Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/everything/resources/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ export const blobResourceUri = (resourceId: number) =>
const parseResourceId = (uri: URL, variables: Record<string, unknown>) => {
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 {
Expand Down
14 changes: 12 additions & 2 deletions src/everything/tools/trigger-elicitation-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/everything/transports/streamableHttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 4 additions & 1 deletion src/filesystem/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ export async function validatePath(requestedPath: string): Promise<string> {
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}`);
}
}
Expand Down
25 changes: 13 additions & 12 deletions src/memory/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,24 @@ export async function ensureMemoryFilePath(): Promise<string> {
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)
Expand Down
2 changes: 1 addition & 1 deletion src/sequentialthinking/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ You should:
annotations: {
readOnlyHint: true,
destructiveHint: false,
idempotentHint: true,
idempotentHint: false,
openWorldHint: false,
},
outputSchema: {
Expand Down
Loading