@cyanheads/mcp-ts-core 0.11.2 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +14 -10
- package/CLAUDE.md +14 -10
- package/README.md +3 -3
- package/changelog/0.11.x/0.11.3.md +49 -0
- package/dist/config/index.d.ts +0 -10
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -25
- package/dist/config/index.js.map +1 -1
- package/dist/config/logLevelAlias.d.ts +15 -0
- package/dist/config/logLevelAlias.d.ts.map +1 -0
- package/dist/config/logLevelAlias.js +30 -0
- package/dist/config/logLevelAlias.js.map +1 -0
- package/dist/core/context.d.ts +10 -0
- package/dist/core/context.d.ts.map +1 -1
- package/dist/core/context.js +10 -1
- package/dist/core/context.js.map +1 -1
- package/dist/core/worker.js +1 -1
- package/dist/core/worker.js.map +1 -1
- package/dist/logs/combined.log +16 -0
- package/dist/logs/error.log +12 -0
- package/dist/logs/interactions.log +0 -0
- package/dist/services/mirror/sqlite/sqliteMirrorStore.d.ts +10 -10
- package/dist/services/mirror/sqlite/sqliteMirrorStore.d.ts.map +1 -1
- package/dist/services/mirror/sqlite/sqliteMirrorStore.js +29 -24
- package/dist/services/mirror/sqlite/sqliteMirrorStore.js.map +1 -1
- package/dist/storage/core/storageValidation.d.ts +4 -4
- package/dist/storage/core/storageValidation.d.ts.map +1 -1
- package/dist/storage/core/storageValidation.js +4 -20
- package/dist/storage/core/storageValidation.js.map +1 -1
- package/dist/testing/index.d.ts +45 -13
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +29 -76
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/vitest.d.ts +1 -1
- package/dist/utils/formatting/diffFormatter.d.ts +5 -5
- package/dist/utils/formatting/diffFormatter.d.ts.map +1 -1
- package/dist/utils/formatting/diffFormatter.js +1 -1
- package/dist/utils/formatting/diffFormatter.js.map +1 -1
- package/dist/utils/formatting/tableFormatter.d.ts +3 -3
- package/dist/utils/formatting/tableFormatter.d.ts.map +1 -1
- package/dist/utils/formatting/tableFormatter.js +1 -1
- package/dist/utils/formatting/tableFormatter.js.map +1 -1
- package/dist/utils/formatting/treeFormatter.d.ts +3 -3
- package/dist/utils/formatting/treeFormatter.d.ts.map +1 -1
- package/dist/utils/formatting/treeFormatter.js +1 -1
- package/dist/utils/formatting/treeFormatter.js.map +1 -1
- package/dist/utils/metrics/tokenCounter.d.ts +3 -3
- package/dist/utils/metrics/tokenCounter.d.ts.map +1 -1
- package/dist/utils/metrics/tokenCounter.js.map +1 -1
- package/dist/utils/network/fetchWithTimeout.d.ts +43 -15
- package/dist/utils/network/fetchWithTimeout.d.ts.map +1 -1
- package/dist/utils/network/fetchWithTimeout.js +163 -44
- package/dist/utils/network/fetchWithTimeout.js.map +1 -1
- package/dist/utils/network/httpError.d.ts.map +1 -1
- package/dist/utils/network/httpError.js +1 -2
- package/dist/utils/network/httpError.js.map +1 -1
- package/dist/utils/network/responseBody.d.ts +27 -7
- package/dist/utils/network/responseBody.d.ts.map +1 -1
- package/dist/utils/network/responseBody.js +54 -13
- package/dist/utils/network/responseBody.js.map +1 -1
- package/dist/utils/network/retry.d.ts +2 -2
- package/dist/utils/network/retry.d.ts.map +1 -1
- package/dist/utils/pagination/pagination.d.ts +3 -3
- package/dist/utils/pagination/pagination.d.ts.map +1 -1
- package/dist/utils/pagination/pagination.js.map +1 -1
- package/dist/utils/parsing/csvParser.d.ts +2 -2
- package/dist/utils/parsing/csvParser.d.ts.map +1 -1
- package/dist/utils/parsing/csvParser.js +1 -1
- package/dist/utils/parsing/csvParser.js.map +1 -1
- package/dist/utils/parsing/dateParser.d.ts +11 -7
- package/dist/utils/parsing/dateParser.d.ts.map +1 -1
- package/dist/utils/parsing/dateParser.js +8 -4
- package/dist/utils/parsing/dateParser.js.map +1 -1
- package/dist/utils/parsing/frontmatterParser.d.ts +5 -4
- package/dist/utils/parsing/frontmatterParser.d.ts.map +1 -1
- package/dist/utils/parsing/frontmatterParser.js +5 -4
- package/dist/utils/parsing/frontmatterParser.js.map +1 -1
- package/dist/utils/parsing/htmlExtractor.d.ts +5 -4
- package/dist/utils/parsing/htmlExtractor.d.ts.map +1 -1
- package/dist/utils/parsing/htmlExtractor.js +4 -3
- package/dist/utils/parsing/htmlExtractor.js.map +1 -1
- package/dist/utils/parsing/inputBudget.d.ts +18 -11
- package/dist/utils/parsing/inputBudget.d.ts.map +1 -1
- package/dist/utils/parsing/inputBudget.js +20 -17
- package/dist/utils/parsing/inputBudget.js.map +1 -1
- package/dist/utils/parsing/jsonParser.d.ts +5 -4
- package/dist/utils/parsing/jsonParser.d.ts.map +1 -1
- package/dist/utils/parsing/jsonParser.js +5 -4
- package/dist/utils/parsing/jsonParser.js.map +1 -1
- package/dist/utils/parsing/pdfParser.d.ts +38 -24
- package/dist/utils/parsing/pdfParser.d.ts.map +1 -1
- package/dist/utils/parsing/pdfParser.js +42 -31
- package/dist/utils/parsing/pdfParser.js.map +1 -1
- package/dist/utils/parsing/xmlParser.d.ts +3 -3
- package/dist/utils/parsing/xmlParser.d.ts.map +1 -1
- package/dist/utils/parsing/xmlParser.js +3 -6
- package/dist/utils/parsing/xmlParser.js.map +1 -1
- package/dist/utils/parsing/yamlParser.d.ts +3 -3
- package/dist/utils/parsing/yamlParser.d.ts.map +1 -1
- package/dist/utils/parsing/yamlParser.js +3 -3
- package/dist/utils/parsing/yamlParser.js.map +1 -1
- package/dist/utils/security/rateLimiter.d.ts +2 -2
- package/dist/utils/security/rateLimiter.d.ts.map +1 -1
- package/dist/utils/security/rateLimiter.js +1 -1
- package/dist/utils/security/rateLimiter.js.map +1 -1
- package/dist/utils/telemetry/trace.d.ts +3 -3
- package/dist/utils/telemetry/trace.d.ts.map +1 -1
- package/dist/utils/telemetry/trace.js.map +1 -1
- package/package.json +1 -1
- package/skills/add-test/SKILL.md +2 -2
- package/skills/api-auth/SKILL.md +5 -5
- package/skills/api-context/SKILL.md +13 -12
- package/skills/api-testing/SKILL.md +29 -10
- package/skills/api-utils/SKILL.md +4 -2
- package/skills/api-utils/references/parsing.md +3 -2
- package/templates/AGENTS.md +1 -1
- package/templates/CLAUDE.md +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{"level":50,"time":1786355643970,"env":"testing","version":"0.0.0-test","pid":20757,"requestId":"0796ac6f-2b10-450f-a3aa-afc9e5afd9e9","timestamp":"2026-08-10T09:54:03.969Z","operation":"auto-task:auto_echo","input":{"fail":true,"value":"stdio-failure"},"critical":false,"errorCode":-32603,"originalErrorType":"Error","finalErrorType":"McpError","taskId":"9c7cdae492bcb0a7b734086564df62e7","toolName":"auto_echo","errorData":{"taskId":"9c7cdae492bcb0a7b734086564df62e7","toolName":"auto_echo","originalErrorName":"Error","originalMessage":"intentional task failure: stdio-failure","originalStack":"Error: intentional task failure: stdio-failure\n at Object.handler (file:///Users/casey/Developer/github/mcp-ts-core/tests/fixtures/task-protocol-server.js:60:27)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:253:28)"},"stack":"McpError: intentional task failure: stdio-failure\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:19)\n at ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)","msg":"Error in auto-task:auto_echo: intentional task failure: stdio-failure"}
|
|
2
|
+
{"level":50,"time":1786355651067,"env":"testing","version":"0.0.0-test","pid":20757,"requestId":"85a7c8d1-5db8-40dc-9582-27d611c2610c","timestamp":"2026-08-10T09:54:11.067Z","operation":"auto-task:long_control","input":{"mode":"timeout"},"critical":false,"errorCode":-32004,"originalErrorType":"symbolEncountered","finalErrorType":"McpError","taskId":"bdba0c04c6273baac152a8d399aec106","toolName":"long_control","errorData":{"taskId":"bdba0c04c6273baac152a8d399aec106","toolName":"long_control","originalErrorName":"symbolEncountered","originalMessage":"Symbol(AUTO_TASK_TIMEOUT)"},"stack":"McpError: Symbol(AUTO_TASK_TIMEOUT)\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:19)\n at ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)","msg":"Error in auto-task:long_control: Symbol(AUTO_TASK_TIMEOUT)"}
|
|
3
|
+
{"level":50,"time":1786355652529,"env":"testing","version":"0.0.0-test","pid":20811,"requestId":"21944399-9c90-4496-aad0-4d5550fc1f23","timestamp":"2026-08-10T09:54:12.529Z","operation":"auto-task:auto_echo","input":{"fail":true,"value":"http-failure"},"critical":false,"errorCode":-32603,"originalErrorType":"Error","finalErrorType":"McpError","taskId":"ab518e67680b0878cdb570552cfd9d16","toolName":"auto_echo","errorData":{"taskId":"ab518e67680b0878cdb570552cfd9d16","toolName":"auto_echo","originalErrorName":"Error","originalMessage":"intentional task failure: http-failure","originalStack":"Error: intentional task failure: http-failure\n at Object.handler (file:///Users/casey/Developer/github/mcp-ts-core/tests/fixtures/task-protocol-server.js:60:27)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:253:28)"},"stack":"McpError: intentional task failure: http-failure\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:19)\n at ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)","msg":"Error in auto-task:auto_echo: intentional task failure: http-failure"}
|
|
4
|
+
{"level":50,"time":1786355659662,"env":"testing","version":"0.0.0-test","pid":20811,"requestId":"9d83cfe0-a1a3-4c19-a328-bb6647b73e6a","timestamp":"2026-08-10T09:54:19.662Z","operation":"auto-task:long_control","input":{"mode":"timeout"},"critical":false,"errorCode":-32004,"originalErrorType":"symbolEncountered","finalErrorType":"McpError","taskId":"0a7324de339d3bbca3a9e1a596fcd7b8","toolName":"long_control","errorData":{"taskId":"0a7324de339d3bbca3a9e1a596fcd7b8","toolName":"long_control","originalErrorName":"symbolEncountered","originalMessage":"Symbol(AUTO_TASK_TIMEOUT)"},"stack":"McpError: Symbol(AUTO_TASK_TIMEOUT)\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:19)\n at ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)","msg":"Error in auto-task:long_control: Symbol(AUTO_TASK_TIMEOUT)"}
|
|
5
|
+
{"level":40,"time":1786355660098,"env":"testing","version":"0.11.3","pid":20858,"transport":"http","requestId":"Q706M-MJD1O","timestamp":"2026-08-10T09:54:20.097Z","operation":"TransportManager.start","component":"HttpTransportSetup","msg":"MCP_ALLOWED_ORIGINS is not set — CORS is wildcard for CLI clients; browser Origin headers are restricted to loopback. Set MCP_ALLOWED_ORIGINS for production deployments accepting remote browser origins."}
|
|
6
|
+
{"level":40,"time":1786355662006,"env":"testing","version":"0.11.3","pid":20858,"component":"HttpTransport","requestId":"7FM6Z-PHMPW","timestamp":"2026-08-10T09:54:22.006Z","operation":"HttpRpcRequest","sessionId":"not-a-real-session-1786355662005","msg":"Session validation failed - invalid or hijacked session"}
|
|
7
|
+
{"level":50,"time":1786355665294,"env":"testing","version":"0.0.0-test","pid":20880,"requestId":"O6XB9-51I99","timestamp":"2026-08-10T09:54:25.294Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"04f241b4702cef081f7df131653e982037492a8192bcf202fb894d8960a9f0d7","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"04f241b4702cef081f7df131653e982037492a8192bcf202fb894d8960a9f0d7","toolName":"scoped_echo","requestId":"O6XB9-51I99","timestamp":"2026-08-10T09:54:25.294Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (file:///Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:54)\n at withRequiredScopes (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:68:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:251:17\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:42)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43\n at async wrappedHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js:114:32)"},"stack":"McpError: Insufficient permissions.\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:19)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:300:26\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:42)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43\n at async wrappedHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js:114:32)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
|
|
8
|
+
{"level":50,"time":1786355665304,"env":"testing","version":"0.0.0-test","pid":20880,"requestId":"HNUEZ-SA801","timestamp":"2026-08-10T09:54:25.304Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"73e723222f122e782a537b6aea6696fb732c0a85bd6b2201073d04a2e429c69f","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"73e723222f122e782a537b6aea6696fb732c0a85bd6b2201073d04a2e429c69f","toolName":"scoped_echo","requestId":"HNUEZ-SA801","timestamp":"2026-08-10T09:54:25.304Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (file:///Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:54)\n at withRequiredScopes (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:68:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:251:17\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:42)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43\n at async wrappedHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js:114:32)"},"stack":"McpError: Insufficient permissions.\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:19)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:300:26\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:42)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43\n at async wrappedHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js:114:32)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
|
|
9
|
+
{"level":50,"time":1786355677942,"env":"testing","version":"0.0.0-test","pid":20968,"requestId":"a7b18215-0a17-4115-8166-7c2ac279ed28","timestamp":"2026-08-10T09:54:37.941Z","operation":"auto-task:auto_echo","input":{"fail":true,"value":"stdio-failure"},"critical":false,"errorCode":-32603,"originalErrorType":"Error","finalErrorType":"McpError","taskId":"4c50acaaa49431b65435209ca290b383","toolName":"auto_echo","errorData":{"taskId":"4c50acaaa49431b65435209ca290b383","toolName":"auto_echo","originalErrorName":"Error","originalMessage":"intentional task failure: stdio-failure","originalStack":"Error: intentional task failure: stdio-failure\n at handler (/Users/casey/Developer/github/mcp-ts-core/tests/fixtures/task-protocol-server.js:60:31)\n at async runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:253:42)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: intentional task failure: stdio-failure\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:23)\n at runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in auto-task:auto_echo: intentional task failure: stdio-failure"}
|
|
10
|
+
{"level":50,"time":1786355685002,"env":"testing","version":"0.0.0-test","pid":20968,"requestId":"bff21d5d-7abe-4f04-9fd6-f562f82807fa","timestamp":"2026-08-10T09:54:45.002Z","operation":"auto-task:long_control","input":{"mode":"timeout"},"critical":false,"errorCode":-32004,"originalErrorType":"symbolEncountered","finalErrorType":"McpError","taskId":"d88ffd467dc756996dcbaba74238a229","toolName":"long_control","errorData":{"taskId":"d88ffd467dc756996dcbaba74238a229","toolName":"long_control","originalErrorName":"symbolEncountered","originalMessage":"Symbol(AUTO_TASK_TIMEOUT)"},"stack":"McpError: Symbol(AUTO_TASK_TIMEOUT)\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:23)\n at runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in auto-task:long_control: Symbol(AUTO_TASK_TIMEOUT)"}
|
|
11
|
+
{"level":50,"time":1786355686315,"env":"testing","version":"0.0.0-test","pid":21009,"requestId":"f73e3fe3-ca14-40cf-abfa-e60923ec955b","timestamp":"2026-08-10T09:54:46.315Z","operation":"auto-task:auto_echo","input":{"fail":true,"value":"http-failure"},"critical":false,"errorCode":-32603,"originalErrorType":"Error","finalErrorType":"McpError","taskId":"d5def97d802d98a7239ab34a402af92a","toolName":"auto_echo","errorData":{"taskId":"d5def97d802d98a7239ab34a402af92a","toolName":"auto_echo","originalErrorName":"Error","originalMessage":"intentional task failure: http-failure","originalStack":"Error: intentional task failure: http-failure\n at handler (/Users/casey/Developer/github/mcp-ts-core/tests/fixtures/task-protocol-server.js:60:31)\n at async runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:253:42)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: intentional task failure: http-failure\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:23)\n at runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in auto-task:auto_echo: intentional task failure: http-failure"}
|
|
12
|
+
{"level":50,"time":1786355693444,"env":"testing","version":"0.0.0-test","pid":21009,"requestId":"69c06f06-7927-4ed8-a558-bff91280b178","timestamp":"2026-08-10T09:54:53.444Z","operation":"auto-task:long_control","input":{"mode":"timeout"},"critical":false,"errorCode":-32004,"originalErrorType":"symbolEncountered","finalErrorType":"McpError","taskId":"4672f29ed8a4edf42fdd4c1bc19fd3c6","toolName":"long_control","errorData":{"taskId":"4672f29ed8a4edf42fdd4c1bc19fd3c6","toolName":"long_control","originalErrorName":"symbolEncountered","originalMessage":"Symbol(AUTO_TASK_TIMEOUT)"},"stack":"McpError: Symbol(AUTO_TASK_TIMEOUT)\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:23)\n at runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in auto-task:long_control: Symbol(AUTO_TASK_TIMEOUT)"}
|
|
13
|
+
{"level":40,"time":1786355693769,"env":"testing","version":"0.11.3","pid":21047,"transport":"http","requestId":"GZDRM-Q35FL","timestamp":"2026-08-10T09:54:53.769Z","operation":"TransportManager.start","component":"HttpTransportSetup","msg":"MCP_ALLOWED_ORIGINS is not set — CORS is wildcard for CLI clients; browser Origin headers are restricted to loopback. Set MCP_ALLOWED_ORIGINS for production deployments accepting remote browser origins."}
|
|
14
|
+
{"level":40,"time":1786355695537,"env":"testing","version":"0.11.3","pid":21047,"component":"HttpTransport","requestId":"11T81-2IUQG","timestamp":"2026-08-10T09:54:55.537Z","operation":"HttpRpcRequest","sessionId":"not-a-real-session-1786355695537","msg":"Session validation failed - invalid or hijacked session"}
|
|
15
|
+
{"level":50,"time":1786355697700,"env":"testing","version":"0.0.0-test","pid":21065,"requestId":"4K2O5-X8M89","timestamp":"2026-08-10T09:54:57.699Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"e338a3d5256ad5ec93414fce2ab657430880898daaf9f98795e70b53baf915bf","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"e338a3d5256ad5ec93414fce2ab657430880898daaf9f98795e70b53baf915bf","toolName":"scoped_echo","requestId":"4K2O5-X8M89","timestamp":"2026-08-10T09:54:57.699Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:68:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:251:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:300:26)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
|
|
16
|
+
{"level":50,"time":1786355697708,"env":"testing","version":"0.0.0-test","pid":21065,"requestId":"J2QI1-0UOBS","timestamp":"2026-08-10T09:54:57.707Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"e0694439661bc7f37c76daf80bce90484e77b196ad0ad6c42bd5ba1319f0774a","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"e0694439661bc7f37c76daf80bce90484e77b196ad0ad6c42bd5ba1319f0774a","toolName":"scoped_echo","requestId":"J2QI1-0UOBS","timestamp":"2026-08-10T09:54:57.707Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:68:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:251:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:300:26)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{"level":50,"time":1786355643970,"env":"testing","version":"0.0.0-test","pid":20757,"requestId":"0796ac6f-2b10-450f-a3aa-afc9e5afd9e9","timestamp":"2026-08-10T09:54:03.969Z","operation":"auto-task:auto_echo","input":{"fail":true,"value":"stdio-failure"},"critical":false,"errorCode":-32603,"originalErrorType":"Error","finalErrorType":"McpError","taskId":"9c7cdae492bcb0a7b734086564df62e7","toolName":"auto_echo","errorData":{"taskId":"9c7cdae492bcb0a7b734086564df62e7","toolName":"auto_echo","originalErrorName":"Error","originalMessage":"intentional task failure: stdio-failure","originalStack":"Error: intentional task failure: stdio-failure\n at Object.handler (file:///Users/casey/Developer/github/mcp-ts-core/tests/fixtures/task-protocol-server.js:60:27)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:253:28)"},"stack":"McpError: intentional task failure: stdio-failure\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:19)\n at ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)","msg":"Error in auto-task:auto_echo: intentional task failure: stdio-failure"}
|
|
2
|
+
{"level":50,"time":1786355651067,"env":"testing","version":"0.0.0-test","pid":20757,"requestId":"85a7c8d1-5db8-40dc-9582-27d611c2610c","timestamp":"2026-08-10T09:54:11.067Z","operation":"auto-task:long_control","input":{"mode":"timeout"},"critical":false,"errorCode":-32004,"originalErrorType":"symbolEncountered","finalErrorType":"McpError","taskId":"bdba0c04c6273baac152a8d399aec106","toolName":"long_control","errorData":{"taskId":"bdba0c04c6273baac152a8d399aec106","toolName":"long_control","originalErrorName":"symbolEncountered","originalMessage":"Symbol(AUTO_TASK_TIMEOUT)"},"stack":"McpError: Symbol(AUTO_TASK_TIMEOUT)\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:19)\n at ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)","msg":"Error in auto-task:long_control: Symbol(AUTO_TASK_TIMEOUT)"}
|
|
3
|
+
{"level":50,"time":1786355652529,"env":"testing","version":"0.0.0-test","pid":20811,"requestId":"21944399-9c90-4496-aad0-4d5550fc1f23","timestamp":"2026-08-10T09:54:12.529Z","operation":"auto-task:auto_echo","input":{"fail":true,"value":"http-failure"},"critical":false,"errorCode":-32603,"originalErrorType":"Error","finalErrorType":"McpError","taskId":"ab518e67680b0878cdb570552cfd9d16","toolName":"auto_echo","errorData":{"taskId":"ab518e67680b0878cdb570552cfd9d16","toolName":"auto_echo","originalErrorName":"Error","originalMessage":"intentional task failure: http-failure","originalStack":"Error: intentional task failure: http-failure\n at Object.handler (file:///Users/casey/Developer/github/mcp-ts-core/tests/fixtures/task-protocol-server.js:60:27)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:253:28)"},"stack":"McpError: intentional task failure: http-failure\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:19)\n at ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)","msg":"Error in auto-task:auto_echo: intentional task failure: http-failure"}
|
|
4
|
+
{"level":50,"time":1786355659662,"env":"testing","version":"0.0.0-test","pid":20811,"requestId":"9d83cfe0-a1a3-4c19-a328-bb6647b73e6a","timestamp":"2026-08-10T09:54:19.662Z","operation":"auto-task:long_control","input":{"mode":"timeout"},"critical":false,"errorCode":-32004,"originalErrorType":"symbolEncountered","finalErrorType":"McpError","taskId":"0a7324de339d3bbca3a9e1a596fcd7b8","toolName":"long_control","errorData":{"taskId":"0a7324de339d3bbca3a9e1a596fcd7b8","toolName":"long_control","originalErrorName":"symbolEncountered","originalMessage":"Symbol(AUTO_TASK_TIMEOUT)"},"stack":"McpError: Symbol(AUTO_TASK_TIMEOUT)\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:19)\n at ToolRegistry.runAutoTaskHandler (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)","msg":"Error in auto-task:long_control: Symbol(AUTO_TASK_TIMEOUT)"}
|
|
5
|
+
{"level":50,"time":1786355665294,"env":"testing","version":"0.0.0-test","pid":20880,"requestId":"O6XB9-51I99","timestamp":"2026-08-10T09:54:25.294Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"04f241b4702cef081f7df131653e982037492a8192bcf202fb894d8960a9f0d7","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"04f241b4702cef081f7df131653e982037492a8192bcf202fb894d8960a9f0d7","toolName":"scoped_echo","requestId":"O6XB9-51I99","timestamp":"2026-08-10T09:54:25.294Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (file:///Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:54)\n at withRequiredScopes (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:68:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:251:17\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:42)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43\n at async wrappedHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js:114:32)"},"stack":"McpError: Insufficient permissions.\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:19)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:300:26\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:42)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43\n at async wrappedHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js:114:32)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
|
|
6
|
+
{"level":50,"time":1786355665304,"env":"testing","version":"0.0.0-test","pid":20880,"requestId":"HNUEZ-SA801","timestamp":"2026-08-10T09:54:25.304Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"73e723222f122e782a537b6aea6696fb732c0a85bd6b2201073d04a2e429c69f","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"73e723222f122e782a537b6aea6696fb732c0a85bd6b2201073d04a2e429c69f","toolName":"scoped_echo","requestId":"HNUEZ-SA801","timestamp":"2026-08-10T09:54:25.304Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (file:///Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:54)\n at withRequiredScopes (file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:68:15)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:251:17\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:42)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43\n at async wrappedHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js:114:32)"},"stack":"McpError: Insufficient permissions.\n at ErrorHandler.handleError (file:///Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:19)\n at file:///Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:300:26\n at McpServer.executeToolHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:233:42)\n at file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43\n at async wrappedHandler (file:///Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js:114:32)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
|
|
7
|
+
{"level":50,"time":1786355677942,"env":"testing","version":"0.0.0-test","pid":20968,"requestId":"a7b18215-0a17-4115-8166-7c2ac279ed28","timestamp":"2026-08-10T09:54:37.941Z","operation":"auto-task:auto_echo","input":{"fail":true,"value":"stdio-failure"},"critical":false,"errorCode":-32603,"originalErrorType":"Error","finalErrorType":"McpError","taskId":"4c50acaaa49431b65435209ca290b383","toolName":"auto_echo","errorData":{"taskId":"4c50acaaa49431b65435209ca290b383","toolName":"auto_echo","originalErrorName":"Error","originalMessage":"intentional task failure: stdio-failure","originalStack":"Error: intentional task failure: stdio-failure\n at handler (/Users/casey/Developer/github/mcp-ts-core/tests/fixtures/task-protocol-server.js:60:31)\n at async runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:253:42)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: intentional task failure: stdio-failure\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:23)\n at runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in auto-task:auto_echo: intentional task failure: stdio-failure"}
|
|
8
|
+
{"level":50,"time":1786355685002,"env":"testing","version":"0.0.0-test","pid":20968,"requestId":"bff21d5d-7abe-4f04-9fd6-f562f82807fa","timestamp":"2026-08-10T09:54:45.002Z","operation":"auto-task:long_control","input":{"mode":"timeout"},"critical":false,"errorCode":-32004,"originalErrorType":"symbolEncountered","finalErrorType":"McpError","taskId":"d88ffd467dc756996dcbaba74238a229","toolName":"long_control","errorData":{"taskId":"d88ffd467dc756996dcbaba74238a229","toolName":"long_control","originalErrorName":"symbolEncountered","originalMessage":"Symbol(AUTO_TASK_TIMEOUT)"},"stack":"McpError: Symbol(AUTO_TASK_TIMEOUT)\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:23)\n at runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in auto-task:long_control: Symbol(AUTO_TASK_TIMEOUT)"}
|
|
9
|
+
{"level":50,"time":1786355686315,"env":"testing","version":"0.0.0-test","pid":21009,"requestId":"f73e3fe3-ca14-40cf-abfa-e60923ec955b","timestamp":"2026-08-10T09:54:46.315Z","operation":"auto-task:auto_echo","input":{"fail":true,"value":"http-failure"},"critical":false,"errorCode":-32603,"originalErrorType":"Error","finalErrorType":"McpError","taskId":"d5def97d802d98a7239ab34a402af92a","toolName":"auto_echo","errorData":{"taskId":"d5def97d802d98a7239ab34a402af92a","toolName":"auto_echo","originalErrorName":"Error","originalMessage":"intentional task failure: http-failure","originalStack":"Error: intentional task failure: http-failure\n at handler (/Users/casey/Developer/github/mcp-ts-core/tests/fixtures/task-protocol-server.js:60:31)\n at async runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:253:42)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: intentional task failure: http-failure\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:23)\n at runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in auto-task:auto_echo: intentional task failure: http-failure"}
|
|
10
|
+
{"level":50,"time":1786355693444,"env":"testing","version":"0.0.0-test","pid":21009,"requestId":"69c06f06-7927-4ed8-a558-bff91280b178","timestamp":"2026-08-10T09:54:53.444Z","operation":"auto-task:long_control","input":{"mode":"timeout"},"critical":false,"errorCode":-32004,"originalErrorType":"symbolEncountered","finalErrorType":"McpError","taskId":"4672f29ed8a4edf42fdd4c1bc19fd3c6","toolName":"long_control","errorData":{"taskId":"4672f29ed8a4edf42fdd4c1bc19fd3c6","toolName":"long_control","originalErrorName":"symbolEncountered","originalMessage":"Symbol(AUTO_TASK_TIMEOUT)"},"stack":"McpError: Symbol(AUTO_TASK_TIMEOUT)\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:178:23)\n at runAutoTaskHandler (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/tool-registration.js:266:26)\n at processTicksAndRejections (native:7:39)","msg":"Error in auto-task:long_control: Symbol(AUTO_TASK_TIMEOUT)"}
|
|
11
|
+
{"level":50,"time":1786355697700,"env":"testing","version":"0.0.0-test","pid":21065,"requestId":"4K2O5-X8M89","timestamp":"2026-08-10T09:54:57.699Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"e338a3d5256ad5ec93414fce2ab657430880898daaf9f98795e70b53baf915bf","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"e338a3d5256ad5ec93414fce2ab657430880898daaf9f98795e70b53baf915bf","toolName":"scoped_echo","requestId":"4K2O5-X8M89","timestamp":"2026-08-10T09:54:57.699Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:68:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:251:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:300:26)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
|
|
12
|
+
{"level":50,"time":1786355697708,"env":"testing","version":"0.0.0-test","pid":21065,"requestId":"J2QI1-0UOBS","timestamp":"2026-08-10T09:54:57.707Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"e0694439661bc7f37c76daf80bce90484e77b196ad0ad6c42bd5ba1319f0774a","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"errorData":{"sessionId":"e0694439661bc7f37c76daf80bce90484e77b196ad0ad6c42bd5ba1319f0774a","toolName":"scoped_echo","requestId":"J2QI1-0UOBS","timestamp":"2026-08-10T09:54:57.707Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["openid","email","profile","offline_access"],"clientId":"authz-client","tenantId":"authz-tenant","token":"[REDACTED]"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:68:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:251:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:300:26)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
|
|
File without changes
|
|
@@ -9,28 +9,28 @@
|
|
|
9
9
|
import type { Migration, MirrorStore } from '../types.js';
|
|
10
10
|
import { type SchemaSpec } from './schema.js';
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* store whose
|
|
15
|
-
*
|
|
12
|
+
* Opt-in ceilings on {@link MirrorStore.query} and {@link MirrorStore.getByIds}.
|
|
13
|
+
* Every field is unbounded unless the spec sets it — declare the ones that
|
|
14
|
+
* matter on a store whose read shape a client can influence, and leave the rest
|
|
15
|
+
* open for server-driven bulk reads.
|
|
16
16
|
*/
|
|
17
17
|
export interface SqliteMirrorStoreLimits {
|
|
18
|
-
/** Maximum number of filters on one query.
|
|
18
|
+
/** Maximum number of filters on one query. Unbounded when omitted. */
|
|
19
19
|
filters?: number;
|
|
20
|
-
/** Maximum bound values across all filters, counting each `in` element.
|
|
20
|
+
/** Maximum bound values across all filters, counting each `in` element. Unbounded when omitted. */
|
|
21
21
|
filterValues?: number;
|
|
22
|
-
/** Maximum `ids` accepted by `getByIds`.
|
|
22
|
+
/** Maximum `ids` accepted by `getByIds`. Unbounded when omitted. */
|
|
23
23
|
getByIds?: number;
|
|
24
|
-
/** Maximum `limit` on one query.
|
|
24
|
+
/** Maximum `limit` on one query. Unbounded when omitted. */
|
|
25
25
|
limit?: number;
|
|
26
|
-
/** Maximum `offset` on one query.
|
|
26
|
+
/** Maximum `offset` on one query. Unbounded when omitted. */
|
|
27
27
|
offset?: number;
|
|
28
28
|
}
|
|
29
29
|
/** Configuration for {@link sqliteMirrorStore}. */
|
|
30
30
|
export interface SqliteMirrorStoreSpec extends SchemaSpec {
|
|
31
31
|
/** `PRAGMA busy_timeout` in ms. Default 5000. */
|
|
32
32
|
busyTimeoutMs?: number;
|
|
33
|
-
/** Query and batch ceilings. Omitted fields
|
|
33
|
+
/** Query and batch ceilings. Omitted fields stay unbounded. */
|
|
34
34
|
limits?: SqliteMirrorStoreLimits;
|
|
35
35
|
/** Migrations applied in order when the stored version is lower than `version`. */
|
|
36
36
|
migrations?: Migration[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqliteMirrorStore.d.ts","sourceRoot":"","sources":["../../../../src/services/mirror/sqlite/sqliteMirrorStore.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAEV,SAAS,EAET,WAAW,EAMZ,MAAM,aAAa,CAAC;AAErB,OAAO,EAAkB,KAAK,UAAU,EAAsB,MAAM,aAAa,CAAC;AAElF;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,
|
|
1
|
+
{"version":3,"file":"sqliteMirrorStore.d.ts","sourceRoot":"","sources":["../../../../src/services/mirror/sqlite/sqliteMirrorStore.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAEV,SAAS,EAET,WAAW,EAMZ,MAAM,aAAa,CAAC;AAErB,OAAO,EAAkB,KAAK,UAAU,EAAsB,MAAM,aAAa,CAAC;AAElF;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mGAAmG;IACnG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,mDAAmD;AACnD,MAAM,WAAW,qBAAsB,SAAQ,UAAU;IACvD,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,mFAAmF;IACnF,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAkBD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,qBAAqB,GAAG,WAAW,CAoO1E"}
|
|
@@ -17,13 +17,6 @@ const SQL_OP = {
|
|
|
17
17
|
lt: '<',
|
|
18
18
|
lte: '<=',
|
|
19
19
|
};
|
|
20
|
-
const DEFAULT_LIMITS = {
|
|
21
|
-
filterValues: 500,
|
|
22
|
-
filters: 32,
|
|
23
|
-
getByIds: 500,
|
|
24
|
-
limit: 1_000,
|
|
25
|
-
offset: 1_000_000,
|
|
26
|
-
};
|
|
27
20
|
/**
|
|
28
21
|
* Create a SQLite-backed {@link MirrorStore} from a declarative spec. The store
|
|
29
22
|
* is not opened until the first method call.
|
|
@@ -33,7 +26,7 @@ export function sqliteMirrorStore(spec) {
|
|
|
33
26
|
const { ftsColumns } = validateSchemaSpec(spec);
|
|
34
27
|
const allColumns = Object.keys(spec.columns);
|
|
35
28
|
const ftsTable = `${spec.table}_fts`;
|
|
36
|
-
const limits =
|
|
29
|
+
const limits = spec.limits ?? {};
|
|
37
30
|
let opened;
|
|
38
31
|
let opening;
|
|
39
32
|
let closing;
|
|
@@ -156,7 +149,7 @@ export function sqliteMirrorStore(spec) {
|
|
|
156
149
|
return { rows, total };
|
|
157
150
|
},
|
|
158
151
|
async getByIds(ids) {
|
|
159
|
-
if (ids.length > limits.getByIds) {
|
|
152
|
+
if (limits.getByIds !== undefined && ids.length > limits.getByIds) {
|
|
160
153
|
throw validationError(`Mirror ID list cannot exceed ${limits.getByIds} values.`, {
|
|
161
154
|
count: ids.length,
|
|
162
155
|
max: limits.getByIds,
|
|
@@ -239,35 +232,47 @@ export function sqliteMirrorStore(spec) {
|
|
|
239
232
|
// ---------------------------------------------------------------------------
|
|
240
233
|
// Query building
|
|
241
234
|
// ---------------------------------------------------------------------------
|
|
235
|
+
/**
|
|
236
|
+
* Reject a query SQLite cannot execute meaningfully, and enforce whichever
|
|
237
|
+
* ceilings the spec declared. Pagination shape is always checked — a fractional
|
|
238
|
+
* or negative `limit`/`offset` is a caller bug, not a workload choice — while
|
|
239
|
+
* cardinality is bounded only where {@link SqliteMirrorStoreLimits} says so.
|
|
240
|
+
*/
|
|
242
241
|
function validateQueryOptions(options, limits) {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
242
|
+
const { limit: maxLimit, offset: maxOffset, filters: maxFilters, filterValues } = limits;
|
|
243
|
+
if (!Number.isSafeInteger(options.limit) ||
|
|
244
|
+
options.limit < 1 ||
|
|
245
|
+
(maxLimit !== undefined && options.limit > maxLimit)) {
|
|
246
|
+
throw validationError(maxLimit === undefined
|
|
247
|
+
? 'Mirror query limit must be an integer of at least 1.'
|
|
248
|
+
: `Mirror query limit must be an integer from 1 to ${maxLimit}.`, { limit: options.limit, ...(maxLimit !== undefined && { max: maxLimit }) });
|
|
248
249
|
}
|
|
249
250
|
if (!Number.isSafeInteger(options.offset) ||
|
|
250
251
|
options.offset < 0 ||
|
|
251
|
-
options.offset >
|
|
252
|
-
throw validationError(
|
|
253
|
-
offset
|
|
254
|
-
|
|
255
|
-
});
|
|
252
|
+
(maxOffset !== undefined && options.offset > maxOffset)) {
|
|
253
|
+
throw validationError(maxOffset === undefined
|
|
254
|
+
? 'Mirror query offset must be an integer of at least 0.'
|
|
255
|
+
: `Mirror query offset must be an integer from 0 to ${maxOffset}.`, { offset: options.offset, ...(maxOffset !== undefined && { max: maxOffset }) });
|
|
256
256
|
}
|
|
257
257
|
const filters = options.filters ?? [];
|
|
258
|
-
if (filters.length >
|
|
259
|
-
throw validationError(`Mirror query cannot exceed ${
|
|
258
|
+
if (maxFilters !== undefined && filters.length > maxFilters) {
|
|
259
|
+
throw validationError(`Mirror query cannot exceed ${maxFilters} filters.`, {
|
|
260
260
|
count: filters.length,
|
|
261
|
-
max:
|
|
261
|
+
max: maxFilters,
|
|
262
262
|
});
|
|
263
263
|
}
|
|
264
|
+
if (filterValues === undefined)
|
|
265
|
+
return;
|
|
264
266
|
const filterValueCount = filters.reduce((count, filter) => {
|
|
265
267
|
if (filter.op !== 'in')
|
|
266
268
|
return count + 1;
|
|
267
269
|
return count + (Array.isArray(filter.value) ? filter.value.length : 1);
|
|
268
270
|
}, 0);
|
|
269
|
-
if (filterValueCount >
|
|
270
|
-
throw validationError(`Mirror query filters cannot exceed ${
|
|
271
|
+
if (filterValueCount > filterValues) {
|
|
272
|
+
throw validationError(`Mirror query filters cannot exceed ${filterValues} bound values.`, {
|
|
273
|
+
count: filterValueCount,
|
|
274
|
+
max: filterValues,
|
|
275
|
+
});
|
|
271
276
|
}
|
|
272
277
|
}
|
|
273
278
|
function buildFilterClauses(filters) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqliteMirrorStore.js","sourceRoot":"","sources":["../../../../src/services/mirror/sqlite/sqliteMirrorStore.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAY1E,OAAO,EAA0B,gBAAgB,EAAqB,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAmB,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAmClF,MAAM,MAAM,GAA4C;IACtD,EAAE,EAAE,GAAG;IACP,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,GAAG;IACP,GAAG,EAAE,IAAI;IACT,EAAE,EAAE,GAAG;IACP,GAAG,EAAE,IAAI;CACV,CAAC;AAEF,MAAM,cAAc,GAAsC;IACxD,YAAY,EAAE,GAAG;IACjB,OAAO,EAAE,EAAE;IACX,QAAQ,EAAE,GAAG;IACb,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE,SAAS;CAClB,CAAC;AASF;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAA2B;IAC3D,uEAAuE;IACvE,MAAM,EAAE,UAAU,EAAE,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAChD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7C,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,KAAK,MAAM,CAAC;IACrC,MAAM,MAAM,GAAsC,EAAE,GAAG,cAAc,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IAExF,IAAI,MAA6B,CAAC;IAClC,IAAI,OAAuC,CAAC;IAC5C,IAAI,OAAkC,CAAC;IAEvC,SAAS,IAAI;QACX,IAAI,OAAO;YAAE,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvC,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,CAAC,GAAG,EAAE;QACtB,MAAM,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC,GAAG,EAAE,CAAC;QACnD,MAAM;aACH,OAAO,CAAC,+DAA+D,CAAC;aACxE,GAAG,CAAC,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -44,12 +44,12 @@ export declare function validatePrefix(prefix: string, context: RequestContext):
|
|
|
44
44
|
*/
|
|
45
45
|
export declare function validateStorageOptions(options: StorageOptions | undefined, context: RequestContext): void;
|
|
46
46
|
/**
|
|
47
|
-
* Validates a getMany/deleteMany key
|
|
48
|
-
*
|
|
49
|
-
*
|
|
47
|
+
* Validates the shape of a getMany/deleteMany key list before iteration or
|
|
48
|
+
* provider dispatch. Batch size is left to the caller — a server that wants a
|
|
49
|
+
* ceiling applies its own at the tool boundary, where it knows the workload.
|
|
50
50
|
*/
|
|
51
51
|
export declare function validateBatchKeys(keys: unknown, operation: 'deleteMany' | 'getMany', context: RequestContext): asserts keys is string[];
|
|
52
|
-
/** Validates a setMany
|
|
52
|
+
/** Validates the shape of a setMany entry set. Batch size is left to the caller. */
|
|
53
53
|
export declare function validateBatchEntries(entries: unknown, context: RequestContext): asserts entries is Map<string, unknown>;
|
|
54
54
|
/**
|
|
55
55
|
* Validates list operation options.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storageValidation.d.ts","sourceRoot":"","sources":["../../../src/storage/core/storageValidation.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"storageValidation.d.ts","sourceRoot":"","sources":["../../../src/storage/core/storageValidation.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oC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44,8 +44,6 @@ const MAX_PREFIX_LENGTH = 512;
|
|
|
44
44
|
* Maximum page size to prevent memory exhaustion attacks.
|
|
45
45
|
*/
|
|
46
46
|
const MAX_LIST_LIMIT = 10000;
|
|
47
|
-
/** Maximum keys or entries accepted by a single batch operation. */
|
|
48
|
-
const MAX_BATCH_SIZE = 10000;
|
|
49
47
|
/**
|
|
50
48
|
* Pattern for valid tenant IDs (alphanumeric, hyphens, underscores, dots).
|
|
51
49
|
* More restrictive than key pattern - no slashes allowed to prevent path traversal.
|
|
@@ -212,9 +210,9 @@ export function validateStorageOptions(options, context) {
|
|
|
212
210
|
}
|
|
213
211
|
}
|
|
214
212
|
/**
|
|
215
|
-
* Validates a getMany/deleteMany key
|
|
216
|
-
*
|
|
217
|
-
*
|
|
213
|
+
* Validates the shape of a getMany/deleteMany key list before iteration or
|
|
214
|
+
* provider dispatch. Batch size is left to the caller — a server that wants a
|
|
215
|
+
* ceiling applies its own at the tool boundary, where it knows the workload.
|
|
218
216
|
*/
|
|
219
217
|
export function validateBatchKeys(keys, operation, context) {
|
|
220
218
|
if (!Array.isArray(keys)) {
|
|
@@ -223,15 +221,8 @@ export function validateBatchKeys(keys, operation, context) {
|
|
|
223
221
|
operation: `validateBatchKeys.${operation}`,
|
|
224
222
|
});
|
|
225
223
|
}
|
|
226
|
-
if (keys.length > MAX_BATCH_SIZE) {
|
|
227
|
-
throw validationError(`${operation} exceeds the maximum batch size of ${MAX_BATCH_SIZE} keys.`, {
|
|
228
|
-
...context,
|
|
229
|
-
operation: `validateBatchKeys.${operation}`,
|
|
230
|
-
keyCount: keys.length,
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
224
|
}
|
|
234
|
-
/** Validates a setMany
|
|
225
|
+
/** Validates the shape of a setMany entry set. Batch size is left to the caller. */
|
|
235
226
|
export function validateBatchEntries(entries, context) {
|
|
236
227
|
if (!(entries instanceof Map)) {
|
|
237
228
|
throw validationError('setMany entries must be a Map.', {
|
|
@@ -239,13 +230,6 @@ export function validateBatchEntries(entries, context) {
|
|
|
239
230
|
operation: 'validateBatchEntries.setMany',
|
|
240
231
|
});
|
|
241
232
|
}
|
|
242
|
-
if (entries.size > MAX_BATCH_SIZE) {
|
|
243
|
-
throw validationError(`setMany exceeds the maximum batch size of ${MAX_BATCH_SIZE} entries.`, {
|
|
244
|
-
...context,
|
|
245
|
-
operation: 'validateBatchEntries.setMany',
|
|
246
|
-
entryCount: entries.size,
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
233
|
}
|
|
250
234
|
/**
|
|
251
235
|
* Validates list operation options.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storageValidation.js","sourceRoot":"","sources":["../../../src/storage/core/storageValidation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAIpD;;;GAGG;AACH,MAAM,eAAe,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC;AAExC;;;;;;;;;GASG;AACH,MAAM,oBAAoB,GAAG,GAAY,CAAC;AAC1C,MAAM,cAAc,GAAG,IAAa,CAAC;AACrC,MAAM,iBAAiB,GAAG,GAAY,CAAC;AAEvC;;GAEG;AACH,MAAM,cAAc,GAAG,KAAc,CAAC;AAEtC
|
|
1
|
+
{"version":3,"file":"storageValidation.js","sourceRoot":"","sources":["../../../src/storage/core/storageValidation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEvE,OAAO,EAAE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C,KAAK,QAAQ,EAAE,CAAC;YACxB,MAAM,aAAa,CAAC,gEAAgE,EAAE;gBACpF,GAAG,OAAO;gBACV,SAAS,EAAE,cAAc;aAC1B,CAAC,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC,CAAC,CAAC;IAChB,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,IAAI,KAAK,YAAY,QAAQ,EAAE,CAAC;YAC9B,MAAM,KAAK,CAAC;QACd,CAAC;QACD,gEAAgE;QAChE,MAAM,CAAC,OAAO,CAAC,yBAAyB,EAAE;YACxC,GAAG,OAAO;YACV,SAAS,EAAE,cAAc;YACzB,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAC5D,CAAC,CAAC;QACH,MAAM,aAAa,CAAC,8DAA8D,EAAE;YAClF,GAAG,OAAO;YACV,SAAS,EAAE,cAAc;SAC1B,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -7,12 +7,20 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { CallToolResult, ContentBlock, ElicitResult } from '@modelcontextprotocol/sdk/types.js';
|
|
9
9
|
import type { z } from 'zod';
|
|
10
|
-
import type { AuthContext, Context, ContextLogger } from '../core/context.js';
|
|
10
|
+
import type { AuthContext, Context, ContextLogger, HandlerContext, ReasonOf } from '../core/context.js';
|
|
11
11
|
import type { AnyToolDefinition } from '../mcp-server/tools/utils/toolDefinition.js';
|
|
12
12
|
import { StorageService } from '../storage/core/StorageService.js';
|
|
13
13
|
import { type InMemoryProviderOptions } from '../storage/providers/inMemory/inMemoryProvider.js';
|
|
14
14
|
import type { ErrorContract } from '../types-global/errors.js';
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Options for {@link createMockContext} and {@link createMockSession}.
|
|
17
|
+
*
|
|
18
|
+
* `TErrors` is the definition's own `errors[]` contract, inferred from the
|
|
19
|
+
* `errors` property. Supplying it narrows the returned context to
|
|
20
|
+
* `HandlerContext<ReasonOf<TErrors>>`, which is what a definition declaring a
|
|
21
|
+
* contract types its handler's `ctx` parameter as.
|
|
22
|
+
*/
|
|
23
|
+
export interface MockContextOptions<TErrors extends readonly ErrorContract[] | undefined = readonly ErrorContract[] | undefined> {
|
|
16
24
|
/** Auth context. */
|
|
17
25
|
auth?: AuthContext;
|
|
18
26
|
/**
|
|
@@ -27,8 +35,12 @@ export interface MockContextOptions {
|
|
|
27
35
|
* own `errors` array (`createMockContext({ errors: myTool.errors })`) so the
|
|
28
36
|
* mock's `fail` matches what the production handler factory wires up. Tests
|
|
29
37
|
* can then assert on `data.reason` without manually composing `createFail`.
|
|
38
|
+
*
|
|
39
|
+
* Typed to include `undefined` so a definition's `errors` — optional on the
|
|
40
|
+
* definition, hence `readonly ErrorContract[] | undefined` — can be forwarded
|
|
41
|
+
* directly under `exactOptionalPropertyTypes`.
|
|
30
42
|
*/
|
|
31
|
-
errors?:
|
|
43
|
+
errors?: TErrors | undefined;
|
|
32
44
|
/** Mock prompt list changed notifier. */
|
|
33
45
|
notifyPromptListChanged?: () => void;
|
|
34
46
|
/** Mock resource list changed notifier. */
|
|
@@ -49,7 +61,11 @@ export interface MockContextOptions {
|
|
|
49
61
|
sessionId?: string;
|
|
50
62
|
/** Custom AbortSignal. Defaults to a fresh AbortController's signal. */
|
|
51
63
|
signal?: AbortSignal;
|
|
52
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* Tenant ID for `ctx.state`. Defaults to `'default'`, matching how a stdio
|
|
66
|
+
* server (and HTTP with `MCP_AUTH_MODE=none`) resolves it, so state works
|
|
67
|
+
* without options. Set it to exercise tenant-scoped behavior explicitly.
|
|
68
|
+
*/
|
|
53
69
|
tenantId?: string;
|
|
54
70
|
/** Resource URI for resource handler testing. */
|
|
55
71
|
uri?: URL;
|
|
@@ -80,27 +96,43 @@ export declare function createMockLogger(): MockContextLogger;
|
|
|
80
96
|
/**
|
|
81
97
|
* Creates a mock Context for testing tool and resource handlers.
|
|
82
98
|
*
|
|
99
|
+
* `ctx.state` runs on a real `StorageService` over an `InMemoryProvider`, so a
|
|
100
|
+
* test sees the same key validation, TTL expiry, and pagination a deployed
|
|
101
|
+
* server does — an invalid key fails in the test rather than in the field.
|
|
102
|
+
*
|
|
103
|
+
* When `errors` is supplied, the return type narrows to
|
|
104
|
+
* `HandlerContext<ReasonOf<TErrors>>`: the context carries a typed `ctx.fail`
|
|
105
|
+
* and is assignable to the `ctx` parameter of the handler whose contract it was
|
|
106
|
+
* given.
|
|
107
|
+
*
|
|
83
108
|
* @example
|
|
84
109
|
* ```ts
|
|
85
|
-
* // Minimal — works
|
|
110
|
+
* // Minimal — state works out of the box on tenant 'default'
|
|
86
111
|
* const ctx = createMockContext();
|
|
87
112
|
*
|
|
88
|
-
* //
|
|
113
|
+
* // Explicit tenant
|
|
89
114
|
* const ctx = createMockContext({ tenantId: 'test-tenant' });
|
|
90
115
|
*
|
|
116
|
+
* // Typed ctx.fail against a definition's contract
|
|
117
|
+
* const ctx = createMockContext({ errors: myTool.errors });
|
|
118
|
+
*
|
|
91
119
|
* // With task progress
|
|
92
120
|
* const ctx = createMockContext({ progress: true });
|
|
93
121
|
* ```
|
|
94
122
|
*/
|
|
95
|
-
export declare function createMockContext(options?: MockContextOptions):
|
|
96
|
-
/**
|
|
97
|
-
|
|
123
|
+
export declare function createMockContext<const TErrors extends readonly ErrorContract[] | undefined = undefined>(options?: MockContextOptions<TErrors>): HandlerContext<ReasonOf<TErrors>>;
|
|
124
|
+
/**
|
|
125
|
+
* A mock HTTP session and the handler context bound to it. `R` is the reason
|
|
126
|
+
* union of the contract passed as `errors`, so `session.ctx` carries the same
|
|
127
|
+
* typed `fail` a contract-bearing handler expects.
|
|
128
|
+
*/
|
|
129
|
+
export interface MockSession<R extends string = never> {
|
|
98
130
|
/** Context carrying this session's identity. Pass it directly to a handler. */
|
|
99
|
-
ctx:
|
|
131
|
+
ctx: HandlerContext<R>;
|
|
100
132
|
/** Session identifier exposed as `ctx.sessionId`. */
|
|
101
133
|
sessionId: string;
|
|
102
|
-
/**
|
|
103
|
-
tenantId
|
|
134
|
+
/** Tenant identifier exposed as `ctx.tenantId`. Defaults to `'default'`. */
|
|
135
|
+
tenantId: string;
|
|
104
136
|
}
|
|
105
137
|
/**
|
|
106
138
|
* Creates a handler context bound to a deterministic HTTP session.
|
|
@@ -116,7 +148,7 @@ export interface MockSession {
|
|
|
116
148
|
* expect(session.ctx.sessionId).toBe('test-session-id');
|
|
117
149
|
* ```
|
|
118
150
|
*/
|
|
119
|
-
export declare function createMockSession(options?: MockContextOptions): MockSession
|
|
151
|
+
export declare function createMockSession<const TErrors extends readonly ErrorContract[] | undefined = undefined>(options?: MockContextOptions<TErrors>): MockSession<ReasonOf<TErrors>>;
|
|
120
152
|
/**
|
|
121
153
|
* Reads the enrichment a handler accumulated via `ctx.enrich(...)` on a mock
|
|
122
154
|
* context, for assertions. Returns the merged field values (empty object when
|