diff --git a/src/everything/resources/templates.ts b/src/everything/resources/templates.ts index 6d4903f74c..49043c201c 100644 --- a/src/everything/resources/templates.ts +++ b/src/everything/resources/templates.ts @@ -139,8 +139,8 @@ export const blobResourceUri = (resourceId: number) => const parseResourceId = (uri: URL, variables: Record) => { const uriError = `Unknown resource: ${uri.toString()}`; if ( - uri.toString().startsWith(textUriBase) && - uri.toString().startsWith(blobUriBase) + !uri.toString().startsWith(textUriBase) && + !uri.toString().startsWith(blobUriBase) ) { throw new Error(uriError); } else { diff --git a/src/everything/tools/trigger-elicitation-request.ts b/src/everything/tools/trigger-elicitation-request.ts index 4de7993e9a..fdf2cb8cca 100644 --- a/src/everything/tools/trigger-elicitation-request.ts +++ b/src/everything/tools/trigger-elicitation-request.ts @@ -189,7 +189,8 @@ export const registerTriggerElicitationRequestTool = (server: McpServer) => { if (userData.name) lines.push(`- Name: ${userData.name}`); if (userData.check !== undefined) lines.push(`- Agreed to terms: ${userData.check}`); - if (userData.color) lines.push(`- Favorite Color: ${userData.color}`); + if (userData.firstLine) + lines.push(`- Favorite First Line: ${userData.firstLine}`); if (userData.email) lines.push(`- Email: ${userData.email}`); if (userData.homepage) lines.push(`- Homepage: ${userData.homepage}`); if (userData.birthdate) @@ -198,7 +199,16 @@ export const registerTriggerElicitationRequestTool = (server: McpServer) => { lines.push(`- Favorite Integer: ${userData.integer}`); if (userData.number !== undefined) lines.push(`- Favorite Number: ${userData.number}`); - if (userData.petType) lines.push(`- Pet Type: ${userData.petType}`); + if (userData.untitledSingleSelectEnum) + lines.push(`- Favorite Friend: ${userData.untitledSingleSelectEnum}`); + if (userData.untitledMultipleSelectEnum) + lines.push(`- Favorite Instruments: ${userData.untitledMultipleSelectEnum}`); + if (userData.titledSingleSelectEnum) + lines.push(`- Favorite Hero: ${userData.titledSingleSelectEnum}`); + if (userData.titledMultipleSelectEnum) + lines.push(`- Favorite Fish: ${userData.titledMultipleSelectEnum}`); + if (userData.legacyTitledEnum) + lines.push(`- Favorite Pet: ${userData.legacyTitledEnum}`); content.push({ type: "text", diff --git a/src/everything/transports/streamableHttp.ts b/src/everything/transports/streamableHttp.ts index 2e79abc554..2580c4ca29 100644 --- a/src/everything/transports/streamableHttp.ts +++ b/src/everything/transports/streamableHttp.ts @@ -225,10 +225,10 @@ process.on("SIGINT", async () => { console.log("Shutting down server..."); // Close all active transports to properly clean up resources - for (const sessionId in transports) { + for (const [sessionId, transport] of transports) { try { console.log(`Closing transport for session ${sessionId}`); - await transports.get(sessionId)!.close(); + await transport.close(); transports.delete(sessionId); } catch (error) { console.log(`Error closing transport for session ${sessionId}:`, error); diff --git a/src/filesystem/lib.ts b/src/filesystem/lib.ts index 17e4654cd5..86bfee53c0 100644 --- a/src/filesystem/lib.ts +++ b/src/filesystem/lib.ts @@ -131,7 +131,10 @@ export async function validatePath(requestedPath: string): Promise { throw new Error(`Access denied - parent directory outside allowed directories: ${realParentPath} not in ${allowedDirectories.join(', ')}`); } return absolute; - } catch { + } catch (innerError) { + if (innerError instanceof Error && innerError.message.startsWith('Access denied')) { + throw innerError; + } throw new Error(`Parent directory does not exist: ${parentDir}`); } } diff --git a/src/memory/index.ts b/src/memory/index.ts index b560bf1e53..64ec87f866 100644 --- a/src/memory/index.ts +++ b/src/memory/index.ts @@ -24,23 +24,24 @@ export async function ensureMemoryFilePath(): Promise { const newMemoryPath = defaultMemoryPath; try { - // Check if old file exists and new file doesn't await fs.access(oldMemoryPath); - try { - await fs.access(newMemoryPath); - // Both files exist, use new one (no migration needed) - return newMemoryPath; - } catch { - // Old file exists, new file doesn't - migrate - console.error('DETECTED: Found legacy memory.json file, migrating to memory.jsonl for JSONL format compatibility'); - await fs.rename(oldMemoryPath, newMemoryPath); - console.error('COMPLETED: Successfully migrated memory.json to memory.jsonl'); - return newMemoryPath; - } } catch { // Old file doesn't exist, use new path return newMemoryPath; } + + try { + await fs.access(newMemoryPath); + // Both files exist, use new one (no migration needed) + return newMemoryPath; + } catch { + // Old file exists, new file doesn't - migrate + // Let rename errors propagate so migration failures are not silently ignored + console.error('DETECTED: Found legacy memory.json file, migrating to memory.jsonl for JSONL format compatibility'); + await fs.rename(oldMemoryPath, newMemoryPath); + console.error('COMPLETED: Successfully migrated memory.json to memory.jsonl'); + return newMemoryPath; + } } // Initialize memory file path (will be set during startup) diff --git a/src/sequentialthinking/index.ts b/src/sequentialthinking/index.ts index 217845bb3d..a668aed184 100644 --- a/src/sequentialthinking/index.ts +++ b/src/sequentialthinking/index.ts @@ -94,7 +94,7 @@ You should: annotations: { readOnlyHint: true, destructiveHint: false, - idempotentHint: true, + idempotentHint: false, openWorldHint: false, }, outputSchema: {