@cyanheads/mcp-ts-core 0.11.1 → 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/biome.json +1 -1
- package/changelog/0.11.x/0.11.2.md +98 -0
- package/changelog/0.11.x/0.11.3.md +49 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +3 -13
- 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/app.d.ts +37 -14
- package/dist/core/app.d.ts.map +1 -1
- package/dist/core/app.js +56 -23
- package/dist/core/app.js.map +1 -1
- 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/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/worker.d.ts.map +1 -1
- package/dist/core/worker.js +35 -18
- package/dist/core/worker.js.map +1 -1
- package/dist/logs/combined.log +16 -8
- package/dist/logs/error.log +12 -4
- package/dist/mcp-server/elicitation.d.ts +64 -0
- package/dist/mcp-server/elicitation.d.ts.map +1 -0
- package/dist/mcp-server/elicitation.js +81 -0
- package/dist/mcp-server/elicitation.js.map +1 -0
- package/dist/mcp-server/protocolSession.d.ts +34 -0
- package/dist/mcp-server/protocolSession.d.ts.map +1 -0
- package/dist/mcp-server/protocolSession.js +13 -0
- package/dist/mcp-server/protocolSession.js.map +1 -0
- package/dist/mcp-server/resources/resource-registration.d.ts +2 -1
- package/dist/mcp-server/resources/resource-registration.d.ts.map +1 -1
- package/dist/mcp-server/resources/resource-registration.js +6 -2
- package/dist/mcp-server/resources/resource-registration.js.map +1 -1
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts +7 -12
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts.map +1 -1
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.js +24 -31
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.js.map +1 -1
- package/dist/mcp-server/server.d.ts +3 -0
- package/dist/mcp-server/server.d.ts.map +1 -1
- package/dist/mcp-server/server.js +12 -2
- package/dist/mcp-server/server.js.map +1 -1
- package/dist/mcp-server/tools/tool-registration.d.ts +2 -1
- package/dist/mcp-server/tools/tool-registration.d.ts.map +1 -1
- package/dist/mcp-server/tools/tool-registration.js +6 -2
- package/dist/mcp-server/tools/tool-registration.js.map +1 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts +7 -13
- package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts.map +1 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js +11 -44
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js.map +1 -1
- package/dist/mcp-server/transports/http/httpErrorHandler.js +1 -1
- package/dist/mcp-server/transports/http/httpErrorHandler.js.map +1 -1
- package/dist/mcp-server/transports/http/httpServer.d.ts +2 -2
- package/dist/mcp-server/transports/http/httpServer.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/httpServer.js.map +1 -1
- package/dist/mcp-server/transports/http/httpTransport.d.ts +2 -2
- package/dist/mcp-server/transports/http/httpTransport.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/httpTransport.js +113 -55
- package/dist/mcp-server/transports/http/httpTransport.js.map +1 -1
- package/dist/mcp-server/transports/http/sessionStore.d.ts +17 -0
- package/dist/mcp-server/transports/http/sessionStore.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/sessionStore.js +71 -0
- package/dist/mcp-server/transports/http/sessionStore.js.map +1 -1
- package/dist/mcp-server/transports/manager.d.ts +2 -6
- package/dist/mcp-server/transports/manager.d.ts.map +1 -1
- package/dist/mcp-server/transports/manager.js +4 -0
- package/dist/mcp-server/transports/manager.js.map +1 -1
- package/dist/services/canvas/core/CanvasRegistry.d.ts +2 -2
- package/dist/services/canvas/core/CanvasRegistry.d.ts.map +1 -1
- package/dist/services/canvas/core/CanvasRegistry.js +14 -3
- package/dist/services/canvas/core/CanvasRegistry.js.map +1 -1
- package/dist/services/canvas/core/DataCanvas.d.ts +1 -1
- package/dist/services/canvas/core/DataCanvas.d.ts.map +1 -1
- package/dist/services/canvas/core/DataCanvas.js +2 -2
- package/dist/services/canvas/core/DataCanvas.js.map +1 -1
- package/dist/services/canvas/providers/duckdb/DuckdbProvider.d.ts.map +1 -1
- package/dist/services/canvas/providers/duckdb/DuckdbProvider.js +11 -3
- package/dist/services/canvas/providers/duckdb/DuckdbProvider.js.map +1 -1
- package/dist/services/canvas/providers/duckdb/exportWriter.d.ts.map +1 -1
- package/dist/services/canvas/providers/duckdb/exportWriter.js +23 -2
- package/dist/services/canvas/providers/duckdb/exportWriter.js.map +1 -1
- package/dist/services/mirror/core/defineMirror.d.ts.map +1 -1
- package/dist/services/mirror/core/defineMirror.js +18 -7
- package/dist/services/mirror/core/defineMirror.js.map +1 -1
- package/dist/services/mirror/core/runner.d.ts.map +1 -1
- package/dist/services/mirror/core/runner.js +3 -0
- package/dist/services/mirror/core/runner.js.map +1 -1
- package/dist/services/mirror/index.d.ts +1 -1
- package/dist/services/mirror/index.d.ts.map +1 -1
- package/dist/services/mirror/index.js.map +1 -1
- package/dist/services/mirror/sqlite/sqliteMirrorStore.d.ts +20 -0
- package/dist/services/mirror/sqlite/sqliteMirrorStore.d.ts.map +1 -1
- package/dist/services/mirror/sqlite/sqliteMirrorStore.js +92 -8
- package/dist/services/mirror/sqlite/sqliteMirrorStore.js.map +1 -1
- package/dist/storage/core/StorageService.d.ts.map +1 -1
- package/dist/storage/core/StorageService.js +4 -1
- package/dist/storage/core/StorageService.js.map +1 -1
- package/dist/storage/core/storageValidation.d.ts +8 -0
- package/dist/storage/core/storageValidation.d.ts.map +1 -1
- package/dist/storage/core/storageValidation.js +22 -0
- package/dist/storage/core/storageValidation.js.map +1 -1
- package/dist/storage/providers/inMemory/inMemoryProvider.d.ts +1 -1
- package/dist/storage/providers/inMemory/inMemoryProvider.d.ts.map +1 -1
- package/dist/storage/providers/inMemory/inMemoryProvider.js +67 -25
- package/dist/storage/providers/inMemory/inMemoryProvider.js.map +1 -1
- package/dist/testing/fuzz.d.ts.map +1 -1
- package/dist/testing/fuzz.js +33 -14
- package/dist/testing/fuzz.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 +12 -3
- package/dist/testing/vitest.d.ts.map +1 -1
- package/dist/testing/vitest.js +3 -0
- package/dist/testing/vitest.js.map +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/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.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 +50 -21
- package/dist/utils/network/fetchWithTimeout.d.ts.map +1 -1
- package/dist/utils/network/fetchWithTimeout.js +299 -90
- 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 +2 -2
- package/dist/utils/network/httpError.js.map +1 -1
- package/dist/utils/network/responseBody.d.ts +35 -0
- package/dist/utils/network/responseBody.d.ts.map +1 -0
- package/dist/utils/network/responseBody.js +104 -0
- package/dist/utils/network/responseBody.js.map +1 -0
- 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 +6 -3
- package/dist/utils/parsing/frontmatterParser.d.ts.map +1 -1
- package/dist/utils/parsing/frontmatterParser.js +9 -9
- package/dist/utils/parsing/frontmatterParser.js.map +1 -1
- package/dist/utils/parsing/htmlExtractor.d.ts +8 -3
- package/dist/utils/parsing/htmlExtractor.d.ts.map +1 -1
- package/dist/utils/parsing/htmlExtractor.js +7 -7
- package/dist/utils/parsing/htmlExtractor.js.map +1 -1
- package/dist/utils/parsing/index.d.ts +1 -0
- package/dist/utils/parsing/index.d.ts.map +1 -1
- package/dist/utils/parsing/index.js +1 -0
- package/dist/utils/parsing/index.js.map +1 -1
- package/dist/utils/parsing/inputBudget.d.ts +35 -0
- package/dist/utils/parsing/inputBudget.d.ts.map +1 -0
- package/dist/utils/parsing/inputBudget.js +79 -0
- package/dist/utils/parsing/inputBudget.js.map +1 -0
- package/dist/utils/parsing/jsonParser.d.ts +6 -3
- package/dist/utils/parsing/jsonParser.d.ts.map +1 -1
- package/dist/utils/parsing/jsonParser.js +8 -8
- package/dist/utils/parsing/jsonParser.js.map +1 -1
- package/dist/utils/parsing/pdfParser.d.ts +41 -19
- package/dist/utils/parsing/pdfParser.d.ts.map +1 -1
- package/dist/utils/parsing/pdfParser.js +86 -60
- package/dist/utils/parsing/pdfParser.js.map +1 -1
- package/dist/utils/parsing/xmlParser.d.ts +4 -2
- package/dist/utils/parsing/xmlParser.d.ts.map +1 -1
- package/dist/utils/parsing/xmlParser.js +6 -7
- package/dist/utils/parsing/xmlParser.js.map +1 -1
- package/dist/utils/parsing/yamlParser.d.ts +4 -2
- package/dist/utils/parsing/yamlParser.d.ts.map +1 -1
- package/dist/utils/parsing/yamlParser.js +6 -7
- 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 +17 -15
- 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/skills/git-wrapup/SKILL.md +22 -1
- package/templates/AGENTS.md +1 -1
- package/templates/CLAUDE.md +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rateLimiter.js","sourceRoot":"","sources":["../../../src/utils/security/rateLimiter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;A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AC;CACF"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @module src/utils/telemetry/trace
|
|
6
6
|
*/
|
|
7
7
|
import { type Span } from '@opentelemetry/api';
|
|
8
|
-
import type { RequestContext } from '../../utils/internal/requestContext.js';
|
|
8
|
+
import type { RequestContext, RequestContextLike } from '../../utils/internal/requestContext.js';
|
|
9
9
|
/**
|
|
10
10
|
* Parsed fields from a W3C `traceparent` header (`00-<traceId>-<spanId>-<flags>`).
|
|
11
11
|
* Used to propagate distributed trace context across service boundaries.
|
|
@@ -36,7 +36,7 @@ export interface TraceparentInfo {
|
|
|
36
36
|
* }
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
39
|
-
export declare function buildTraceparent(ctx?: RequestContext): string | undefined;
|
|
39
|
+
export declare function buildTraceparent(ctx?: RequestContextLike | RequestContext): string | undefined;
|
|
40
40
|
/**
|
|
41
41
|
* Extracts W3C traceparent from headers and returns parsed trace/span IDs.
|
|
42
42
|
* Returns undefined if header is missing or malformed.
|
|
@@ -137,7 +137,7 @@ export declare function withSpan<T>(operationName: string, fn: (span: Span) => P
|
|
|
137
137
|
* }, 1000);
|
|
138
138
|
* ```
|
|
139
139
|
*/
|
|
140
|
-
export declare function runInContext<T>(ctx: RequestContext | undefined, fn: () => T): T;
|
|
140
|
+
export declare function runInContext<T>(ctx: RequestContextLike | RequestContext | undefined, fn: () => T): T;
|
|
141
141
|
/**
|
|
142
142
|
* Runs a function with no active span, detached from whatever context is
|
|
143
143
|
* current at the call site.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../src/utils/telemetry/trace.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAIL,KAAK,IAAI,EAGV,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../src/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AC,CAAC,CAAC,CA0BZ;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,GAAG,EAAE,kBAAkB,GAAG,cAAc,GAAG,SAAS,EACpD,EAAE,EAAE,MAAM,CAAC,GACV,CAAC,CAUH;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAE7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../src/utils/telemetry/trace.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,OAAO,IAAI,SAAS,EACpB,WAAW,EACX,YAAY,EAEZ,cAAc,EACd,KAAK,GACN,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAgB3E;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../src/utils/telemetry/trace.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,OAAO,IAAI,SAAS,EACpB,WAAW,EACX,YAAY,EAEZ,cAAc,EACd,KAAK,GACN,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAgB3E;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAyC;IACxE,MAAM,OAAO,GACV,GAAG,EAAE,OAA8B,IAAI,KAAK,CAAC,aAAa,EAAE,EAAE,WAAW,EAAE,CAAC,OAAO,CAAC;IACvF,MAAM,MAAM,GAAI,GA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AAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,YAAY,CAC1B,GAAoD,EACpD,EAAW;IAEX,oCAAoC;IACpC,IAAI,CAAC,GAAG,EAAE,OAAO,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC;QAClC,OAAO,EAAE,EAAE,CAAC;IACd,CAAC;IAED,oCAAoC;IACpC,+DAA+D;IAC/D,2EAA2E;IAC3E,OAAO,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,WAAW,CAAI,EAAW;IACxC,OAAO,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAC1C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/mcp-ts-core",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"mcpName": "io.github.cyanheads/mcp-ts-core",
|
|
5
|
-
"description": "Agent-native TypeScript framework for building MCP servers.
|
|
5
|
+
"description": "Agent-native TypeScript framework for building MCP servers. Declarative definitions with auth, multi-backend storage, OpenTelemetry, and first-class support for Bun/Node/Cloudflare Workers.",
|
|
6
6
|
"files": [
|
|
7
7
|
"changelog/",
|
|
8
8
|
"dist/",
|
|
@@ -172,10 +172,12 @@
|
|
|
172
172
|
"tree": "bun run scripts/tree.ts",
|
|
173
173
|
"fetch-spec": "bun run scripts/fetch-openapi-spec.ts",
|
|
174
174
|
"test": "bunx vitest run",
|
|
175
|
-
"test:all": "bun run test:coverage && bun run test:node && bun run test:worker && bun run test:integration",
|
|
175
|
+
"test:all": "bun run rebuild && bun run test:coverage && bun run test:node && bun run test:worker && bun run test:integration",
|
|
176
176
|
"test:integration": "bunx vitest run --config vitest.integration.ts",
|
|
177
177
|
"test:leaks": "bunx vitest run --detect-async-leaks",
|
|
178
178
|
"test:node": "sh -c 'NODE_BIN=$(which -a node | grep -v /bun-node- | head -n 1); \"$NODE_BIN\" ./node_modules/vitest/vitest.mjs run && \"$NODE_BIN\" ./node_modules/vitest/vitest.mjs run --config vitest.integration.ts'",
|
|
179
|
+
"test:order": "sh -c 'NODE_BIN=$(which -a node | grep -v /bun-node- | head -n 1); \"$NODE_BIN\" ./node_modules/vitest/vitest.mjs run --sequence.shuffle --sequence.seed=20260809 --expect.requireAssertions'",
|
|
180
|
+
"test:package": "bun run rebuild && bunx vitest run --config vitest.package.ts",
|
|
179
181
|
"test:unit": "bunx vitest run --project unit",
|
|
180
182
|
"test:smoke": "bunx vitest run --project smoke",
|
|
181
183
|
"test:fuzz": "bunx vitest run --project fuzz",
|
|
@@ -196,7 +198,7 @@
|
|
|
196
198
|
"@biomejs/biome": "2.5.6",
|
|
197
199
|
"@cloudflare/vitest-pool-workers": "^0.19.1",
|
|
198
200
|
"@cloudflare/workers-types": "5.20260730.1",
|
|
199
|
-
"@duckdb/node-api": "^1.5.5-r.
|
|
201
|
+
"@duckdb/node-api": "^1.5.5-r.3",
|
|
200
202
|
"@hono/otel": "^1.1.2",
|
|
201
203
|
"@opentelemetry/exporter-metrics-otlp-http": "^0.221.0",
|
|
202
204
|
"@opentelemetry/exporter-trace-otlp-http": "^0.221.0",
|
|
@@ -208,7 +210,7 @@
|
|
|
208
210
|
"@opentelemetry/sdk-trace-node": "^2.10.0",
|
|
209
211
|
"@opentelemetry/semantic-conventions": "^1.43.0",
|
|
210
212
|
"@socketsecurity/bun-security-scanner": "^1.1.2",
|
|
211
|
-
"@supabase/supabase-js": "^2.
|
|
213
|
+
"@supabase/supabase-js": "^2.112.2",
|
|
212
214
|
"@types/bun": "^1.3.14",
|
|
213
215
|
"@types/node": "26.1.2",
|
|
214
216
|
"@types/papaparse": "^5.5.2",
|
|
@@ -216,18 +218,18 @@
|
|
|
216
218
|
"@types/validator": "^13.15.10",
|
|
217
219
|
"@vitest/coverage-istanbul": "4.1.10",
|
|
218
220
|
"@vitest/ui": "4.1.10",
|
|
219
|
-
"better-sqlite3": "^13.0.
|
|
221
|
+
"better-sqlite3": "^13.0.3",
|
|
220
222
|
"bun-types": "^1.3.14",
|
|
221
223
|
"chrono-node": "^2.10.1",
|
|
222
224
|
"clipboardy": "^5.3.2",
|
|
223
225
|
"defuddle": "^0.19.2",
|
|
224
226
|
"depcheck": "^1.4.7",
|
|
225
227
|
"diff": "^9.0.0",
|
|
226
|
-
"execa": "^10.0.
|
|
228
|
+
"execa": "^10.0.1",
|
|
227
229
|
"fast-check": "^4.9.0",
|
|
228
230
|
"fast-xml-parser": "^5.10.1",
|
|
229
231
|
"ignore": "^7.0.6",
|
|
230
|
-
"js-yaml": "^5.2.
|
|
232
|
+
"js-yaml": "^5.2.3",
|
|
231
233
|
"linkedom": "^0.18.13",
|
|
232
234
|
"node-cron": "^4.6.0",
|
|
233
235
|
"openai": "^6.49.0",
|
|
@@ -235,7 +237,7 @@
|
|
|
235
237
|
"partial-json": "^0.1.7",
|
|
236
238
|
"pdf-lib": "^1.17.1",
|
|
237
239
|
"pino-pretty": "^13.1.3",
|
|
238
|
-
"repomix": "^1.
|
|
240
|
+
"repomix": "^1.18.0",
|
|
239
241
|
"sanitize-html": "^2.17.6",
|
|
240
242
|
"tsc-alias": "^1.9.1",
|
|
241
243
|
"typedoc": "^0.28.20",
|
|
@@ -297,13 +299,13 @@
|
|
|
297
299
|
},
|
|
298
300
|
"dependencies": {
|
|
299
301
|
"@hono/mcp": "^0.3.1",
|
|
300
|
-
"@hono/node-server": "^2.0
|
|
302
|
+
"@hono/node-server": "^2.1.0",
|
|
301
303
|
"@modelcontextprotocol/ext-apps": "^1.7.5",
|
|
302
304
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
303
305
|
"@opentelemetry/api": "^1.9.1",
|
|
304
306
|
"dotenv": "^17.4.2",
|
|
305
|
-
"hono": "^4.
|
|
306
|
-
"jose": "^6.2.
|
|
307
|
+
"hono": "^4.13.1",
|
|
308
|
+
"jose": "^6.2.8",
|
|
307
309
|
"pino": "^10.3.1",
|
|
308
310
|
"zod": "^4.4.3"
|
|
309
311
|
},
|
|
@@ -430,10 +432,10 @@
|
|
|
430
432
|
},
|
|
431
433
|
"overrides": {
|
|
432
434
|
"brace-expansion": "^2.1.3",
|
|
433
|
-
"postcss": "^8.5.
|
|
435
|
+
"postcss": "^8.5.23",
|
|
434
436
|
"protobufjs": "^7.6.5",
|
|
435
437
|
"sharp": "^0.35.3",
|
|
436
|
-
"fast-uri": "^3.1.
|
|
437
|
-
"
|
|
438
|
+
"fast-uri": "^3.1.5",
|
|
439
|
+
"ip-address": "^10.3.1"
|
|
438
440
|
}
|
|
439
441
|
}
|
package/skills/add-test/SKILL.md
CHANGED
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
Scaffold a test file for an existing tool, resource, or service. Use when the user asks to add tests, improve coverage, or when a definition exists without a matching test file.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "1.
|
|
7
|
+
version: "1.5"
|
|
8
8
|
audience: external
|
|
9
9
|
type: reference
|
|
10
10
|
---
|
|
@@ -35,7 +35,7 @@ Read the handler and identify:
|
|
|
35
35
|
| **Happy path** | Valid input → expected output. Include at least one. |
|
|
36
36
|
| **Input variations** | Optional fields omitted, defaults applied, boundary values |
|
|
37
37
|
| **Error paths** | Invalid state, missing resources, service failures → correct error thrown |
|
|
38
|
-
| **`ctx.state` usage** |
|
|
38
|
+
| **`ctx.state` usage** | Available on any mock context (tenant `'default'` unless `{ tenantId }` says otherwise). It runs the production storage path, so use storage-legal keys (`cache/v1/abc`, never `cache:v1:abc`) and assert TTL expiry with fake timers. |
|
|
39
39
|
| **`ctx.elicit`** | Mock with `vi.fn()`, also test the absent case (undefined) |
|
|
40
40
|
| **`ctx.progress`** | Use `createMockContext({ progress: true })` for task tools |
|
|
41
41
|
| **`ctx.fail` (typed contract)** | Definitions with `errors[]` need `fail` attached to the mock ctx — `createMockContext({ errors: myTool.errors })` does it for you. Assert on `data.reason` (stable per-contract entry), not just `code`. |
|
package/skills/api-auth/SKILL.md
CHANGED
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
Authentication, authorization, and multi-tenancy patterns for `@cyanheads/mcp-ts-core`. Use when implementing auth scopes on tools/resources, configuring auth modes (none/jwt/oauth), working with JWT/OAuth env vars, or understanding how tenantId flows through ctx.state.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "1.
|
|
7
|
+
version: "1.3"
|
|
8
8
|
audience: external
|
|
9
9
|
type: reference
|
|
10
10
|
---
|
|
@@ -175,11 +175,11 @@ A `WARNING`-level log is emitted at startup whenever the flag is active so opera
|
|
|
175
175
|
```ts
|
|
176
176
|
handler: async (input, ctx) => {
|
|
177
177
|
// Automatically scoped to ctx.tenantId — no manual prefixing
|
|
178
|
-
await ctx.state.set('item
|
|
179
|
-
const item = await ctx.state.get<Item>('item
|
|
180
|
-
await ctx.state.delete('item
|
|
178
|
+
await ctx.state.set('item/123', { name: 'Widget', count: 42 });
|
|
179
|
+
const item = await ctx.state.get<Item>('item/123');
|
|
180
|
+
await ctx.state.delete('item/123');
|
|
181
181
|
|
|
182
|
-
const page = await ctx.state.list('item
|
|
182
|
+
const page = await ctx.state.list('item/', { cursor, limit: 20 });
|
|
183
183
|
// page: { items: Array<{ key, value }>, cursor?: string }
|
|
184
184
|
},
|
|
185
185
|
```
|
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
Canonical reference for the unified `Context` object passed to every tool and resource handler in `@cyanheads/mcp-ts-core`. Covers the full interface, all sub-APIs (`ctx.log`, `ctx.state`, `ctx.elicit`, `ctx.progress`, `ctx.enrich`, `ctx.content`), and when to use each.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "1.
|
|
7
|
+
version: "1.10"
|
|
8
8
|
audience: external
|
|
9
9
|
type: reference
|
|
10
10
|
---
|
|
@@ -155,23 +155,23 @@ interface ContextState {
|
|
|
155
155
|
|
|
156
156
|
```ts
|
|
157
157
|
// Store — accepts any serializable value, no manual JSON.stringify needed
|
|
158
|
-
await ctx.state.set('item
|
|
159
|
-
await ctx.state.set('session
|
|
158
|
+
await ctx.state.set('item/123', { name: 'Widget', count: 42 });
|
|
159
|
+
await ctx.state.set('session/xyz', token, { ttl: 3600 }); // TTL in seconds
|
|
160
160
|
|
|
161
161
|
// Retrieve — generic type assertion or Zod-validated
|
|
162
|
-
const item = await ctx.state.get<Item>('item
|
|
163
|
-
const safe = await ctx.state.get('item
|
|
162
|
+
const item = await ctx.state.get<Item>('item/123'); // T | null (type assertion)
|
|
163
|
+
const safe = await ctx.state.get('item/123', ItemSchema); // T | null (runtime validated)
|
|
164
164
|
|
|
165
165
|
// Delete
|
|
166
|
-
await ctx.state.delete('item
|
|
166
|
+
await ctx.state.delete('item/123');
|
|
167
167
|
|
|
168
168
|
// Batch operations
|
|
169
|
-
const values = await ctx.state.getMany<Item>(['item
|
|
169
|
+
const values = await ctx.state.getMany<Item>(['item/1', 'item/2']); // Map<string, T>
|
|
170
170
|
await ctx.state.setMany(new Map([['a', 1], ['b', 2]]));
|
|
171
|
-
const deleted = await ctx.state.deleteMany(['item
|
|
171
|
+
const deleted = await ctx.state.deleteMany(['item/1', 'item/2']); // number
|
|
172
172
|
|
|
173
173
|
// List with prefix + pagination
|
|
174
|
-
const page = await ctx.state.list('item
|
|
174
|
+
const page = await ctx.state.list('item/', { cursor, limit: 20 });
|
|
175
175
|
for (const { key, value } of page.items) { /* ... */ }
|
|
176
176
|
if (page.cursor) { /* more pages available */ }
|
|
177
177
|
```
|
|
@@ -180,6 +180,7 @@ if (page.cursor) { /* more pages available */ }
|
|
|
180
180
|
|
|
181
181
|
- Throws `McpError(InvalidRequest)` if `tenantId` is missing. Won't happen in stdio (any auth mode) or HTTP+`MCP_AUTH_MODE=none` — both default to `'default'`. Can happen in HTTP+`MCP_AUTH_MODE=jwt`/`oauth` when the token lacks a `tid` claim (intentional fail-closed: distinct authenticated callers must not silently share state).
|
|
182
182
|
- Keys are tenant-prefixed internally; handlers never need to namespace manually.
|
|
183
|
+
- **Key charset:** `^[a-zA-Z0-9_.\-/]+$`, 1024 chars max, no `..`. Slashes are the namespace separator — a colon (`item:123`) throws `McpError(ValidationError)` on every call. The rule covers `list` prefixes and every key in a batch operation. `createMockContext().state` enforces it identically, so an illegal key fails in the test rather than in a deployment.
|
|
183
184
|
- **Workers persistence:** The `in-memory` provider loses data on cold starts. Use `cloudflare-kv`, `cloudflare-r2`, or `cloudflare-d1` for durable storage in Workers.
|
|
184
185
|
|
|
185
186
|
---
|
|
@@ -237,14 +238,14 @@ import { invalidRequest } from '@cyanheads/mcp-ts-core/errors';
|
|
|
237
238
|
if (!ctx.sessionId) {
|
|
238
239
|
throw invalidRequest('Session required for this operation.');
|
|
239
240
|
}
|
|
240
|
-
await ctx.state.set(`session
|
|
241
|
+
await ctx.state.set(`session/${ctx.sessionId}/${baseKey}`, value);
|
|
241
242
|
```
|
|
242
243
|
|
|
243
244
|
**Lax — fall back to tenant-shared key:**
|
|
244
245
|
|
|
245
246
|
```ts
|
|
246
247
|
const sessionKey = ctx.sessionId
|
|
247
|
-
? `session
|
|
248
|
+
? `session/${ctx.sessionId}/${baseKey}`
|
|
248
249
|
: baseKey;
|
|
249
250
|
await ctx.state.set(sessionKey, value);
|
|
250
251
|
```
|
|
@@ -253,7 +254,7 @@ await ctx.state.set(sessionKey, value);
|
|
|
253
254
|
|
|
254
255
|
### Behavior notes
|
|
255
256
|
|
|
256
|
-
- **Not a tenant boundary.** `ctx.state` is still tenant-scoped. Building session-scoped state is the consumer's responsibility — prefix with `session
|
|
257
|
+
- **Not a tenant boundary.** `ctx.state` is still tenant-scoped. Building session-scoped state is the consumer's responsibility — prefix with `session/${ctx.sessionId}/` as shown above.
|
|
257
258
|
- **Auto-task tools.** `task: true` handlers run in a detached background context with no session attachment — `ctx.sessionId` is always `undefined` regardless of mode.
|
|
258
259
|
- **Worker bundle.** Workers use the same HTTP transport plumbing; session behavior matches Node HTTP.
|
|
259
260
|
|
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
Testing patterns for MCP tool/resource handlers using `createMockContext` and Vitest. Covers mock context options, handler testing, McpError assertions, format testing, Vitest config setup, and test isolation conventions.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "1.
|
|
7
|
+
version: "1.7"
|
|
8
8
|
audience: external
|
|
9
9
|
type: reference
|
|
10
10
|
---
|
|
@@ -51,7 +51,7 @@ mcpTest('stubs an upstream HTTP boundary', async ({ fetchMock }) => {
|
|
|
51
51
|
| Fixture | Type | Per-test? | Notes |
|
|
52
52
|
|:--------|:-----|:----------|:------|
|
|
53
53
|
| `ctx` | `Context` | Yes | Fresh `createMockContext()` each test |
|
|
54
|
-
| `session` | `MockSession` | Yes | Fresh `{ sessionId, tenantId
|
|
54
|
+
| `session` | `MockSession` | Yes | Fresh `{ sessionId, tenantId, ctx }` from `createMockSession()` |
|
|
55
55
|
| `fetchMock` | `FetchMockHarness` | Yes | Strict fetch fake installed/restored around the requesting test |
|
|
56
56
|
| `storage` | `StorageService` | Yes | Fresh `createInMemoryStorage()` each test |
|
|
57
57
|
|
|
@@ -131,8 +131,8 @@ Use `runToolContract(definition, input, { context })` from `/testing` when a cus
|
|
|
131
131
|
```ts
|
|
132
132
|
import { createMockContext } from '@cyanheads/mcp-ts-core/testing';
|
|
133
133
|
|
|
134
|
-
createMockContext() //
|
|
135
|
-
createMockContext({ tenantId: 'test-tenant' }) //
|
|
134
|
+
createMockContext() // working ctx.state on tenant 'default'
|
|
135
|
+
createMockContext({ tenantId: 'test-tenant' }) // explicit tenant scope for ctx.state
|
|
136
136
|
createMockContext({ errors: myTool.errors }) // attaches typed ctx.fail keyed by the contract reasons
|
|
137
137
|
createMockContext({ elicit: vi.fn().mockResolvedValue(...) }) // with elicitation
|
|
138
138
|
createMockContext({ progress: true }) // with task progress (ctx.progress populated)
|
|
@@ -147,10 +147,10 @@ createMockContext({ uri: new URL('myscheme://item/123') }) // for resource han
|
|
|
147
147
|
`MockContextOptions` interface:
|
|
148
148
|
|
|
149
149
|
```ts
|
|
150
|
-
interface MockContextOptions {
|
|
150
|
+
interface MockContextOptions<TErrors extends readonly ErrorContract[] | undefined> {
|
|
151
151
|
auth?: AuthContext;
|
|
152
152
|
elicit?: (message: string, schema: z.ZodObject<z.ZodRawShape>) => Promise<ElicitResult>;
|
|
153
|
-
errors?:
|
|
153
|
+
errors?: TErrors | undefined;
|
|
154
154
|
notifyPromptListChanged?: () => void;
|
|
155
155
|
notifyResourceListChanged?: () => void;
|
|
156
156
|
notifyResourceUpdated?: (uri: string) => void;
|
|
@@ -166,10 +166,10 @@ interface MockContextOptions {
|
|
|
166
166
|
|
|
167
167
|
| Option | Effect |
|
|
168
168
|
|:-------|:-------|
|
|
169
|
-
| _(none)_ |
|
|
169
|
+
| _(none)_ | Working `ctx.state` on tenant `'default'`; `ctx.elicit`/`ctx.progress` are `undefined` |
|
|
170
170
|
| `auth` | Sets `ctx.auth` for scope-checking tests |
|
|
171
171
|
| `elicit` | Assigns a function to `ctx.elicit` for testing elicitation calls |
|
|
172
|
-
| `errors` | Attaches a typed `ctx.fail` against the contract — same wiring the production handler factory uses. Pass `myTool.errors` directly. |
|
|
172
|
+
| `errors` | Attaches a typed `ctx.fail` against the contract — same wiring the production handler factory uses. Pass `myTool.errors` directly; the return type narrows to `HandlerContext<ReasonOf<…>>`, so the context is assignable to that definition's handler parameter. |
|
|
173
173
|
| `notifyPromptListChanged` | Assigns `ctx.notifyPromptListChanged` for prompt-list change notification tests |
|
|
174
174
|
| `notifyResourceListChanged` | Assigns `ctx.notifyResourceListChanged` for resource notification tests |
|
|
175
175
|
| `notifyResourceUpdated` | Assigns `ctx.notifyResourceUpdated` for resource update notification tests |
|
|
@@ -178,9 +178,28 @@ interface MockContextOptions {
|
|
|
178
178
|
| `progress` | Populates `ctx.progress` with real state-tracking implementation (see below) |
|
|
179
179
|
| `requestId` | Overrides `ctx.requestId` (default: `'test-request-id'`) |
|
|
180
180
|
| `signal` | Overrides `ctx.signal` — useful for cancellation testing |
|
|
181
|
-
| `tenantId` |
|
|
181
|
+
| `tenantId` | Scopes `ctx.state` to a specific tenant. Defaults to `'default'` — the value stdio (and HTTP with `MCP_AUTH_MODE=none`) resolves |
|
|
182
182
|
| `uri` | Sets `ctx.uri` for resource handler testing |
|
|
183
183
|
|
|
184
|
+
### Mock state
|
|
185
|
+
|
|
186
|
+
`ctx.state` is a real `StorageService` over an `InMemoryProvider` — the production storage path, not a `Map`. A test therefore sees the same rules a deployed server enforces:
|
|
187
|
+
|
|
188
|
+
- **Keys** match `^[a-zA-Z0-9_.\-/]+$` and may not contain `..`. Colons are rejected, so `cache:v1:abc` throws `McpError(ValidationError)` in the test exactly as it would in a deployment; use `cache/v1/abc`.
|
|
189
|
+
- **TTL** is honored. An entry written with `{ ttl: 30 }` reads back as `null` once 30 seconds elapse — drive the clock with `vi.useFakeTimers()` to assert expiry.
|
|
190
|
+
- **`getMany` / `setMany` / `deleteMany` / `list`** validate every key and prefix, and `list` paginates with the same opaque cursors.
|
|
191
|
+
- **Cancellation** applies: once `ctx.signal` aborts, state operations reject.
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
const ctx = createMockContext();
|
|
195
|
+
|
|
196
|
+
await ctx.state.set('cache/v1/abc', { hits: 1 }, { ttl: 30 });
|
|
197
|
+
await expect(ctx.state.get('cache/v1/abc')).resolves.toEqual({ hits: 1 });
|
|
198
|
+
await expect(ctx.state.set('cache:v1:abc', {})).rejects.toThrow(McpError);
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Reach for `createInMemoryStorage()` when a service takes a `StorageService` directly — it builds the same pair.
|
|
202
|
+
|
|
184
203
|
### Mock progress
|
|
185
204
|
|
|
186
205
|
When `progress: true`, `ctx.progress` is a real state-tracking object — not `vi.fn()` spies. It maintains internal state accessible via inspection properties:
|
|
@@ -396,7 +415,7 @@ describe('myTool with service', () => {
|
|
|
396
415
|
|
|
397
416
|
- Re-init services with `initMyService()` (or equivalent) in `beforeEach` when tests share a module-level singleton.
|
|
398
417
|
- Vitest runs test files in separate workers — parallel file execution is safe by default.
|
|
399
|
-
-
|
|
418
|
+
- Pass `createMockContext({ tenantId })` when a test needs a specific tenant; omitting it scopes state to `'default'`, not to a broken state surface.
|
|
400
419
|
|
|
401
420
|
---
|
|
402
421
|
|
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
API reference for all utilities exported from `@cyanheads/mcp-ts-core/utils`. Use when looking up utility method signatures, options, peer dependencies, or usage patterns.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "2.
|
|
7
|
+
version: "2.6"
|
|
8
8
|
audience: external
|
|
9
9
|
type: reference
|
|
10
10
|
---
|
|
@@ -15,6 +15,8 @@ Utility exports from `@cyanheads/mcp-ts-core/utils`. Utilities with complex APIs
|
|
|
15
15
|
|
|
16
16
|
**Tier 3** = optional peer dependency. Install as needed (e.g., `bun add js-yaml`). All Tier 3 methods are **async** (lazy-load deps on first call).
|
|
17
17
|
|
|
18
|
+
**Context parameters.** Every helper below that takes a `context` accepts the handler `Context` as well as a `RequestContext` bag — pass `ctx` straight through, no slicing.
|
|
19
|
+
|
|
18
20
|
## References
|
|
19
21
|
|
|
20
22
|
| Reference | Path | Covers |
|
|
@@ -29,7 +31,7 @@ Utility exports from `@cyanheads/mcp-ts-core/utils`. Utilities with complex APIs
|
|
|
29
31
|
|
|
30
32
|
| Export | API | Notes |
|
|
31
33
|
|:-------|:----|:------|
|
|
32
|
-
| `fetchWithTimeout` | `(url, timeoutMs, context
|
|
34
|
+
| `fetchWithTimeout` | `(url, timeoutMs, context, options?: FetchWithTimeoutOptions) -> Promise<Response>` | Wraps `fetch` with `AbortController` timeout. `timeoutMs` bounds the **whole exchange**: on a 2xx carrying a body the returned `Response` is a passthrough wrapper that keeps the deadline armed until the body closes, errors, or is cancelled, so a stalled stream rejects the caller's `.text()`/`.json()` with the same `Timeout` error the header phase raises. `status`, `statusText`, `headers`, `url`, `redirected`, and `type` carry across the wrapper; the original body is locked by it, and bodyless/null-body responses (HEAD, 204/205/304) come back untouched. `FetchWithTimeoutOptions` extends `RequestInit` (minus `signal`) and adds `rejectPrivateIPs?: boolean`, `expectedStatuses?: number[]` (listed non-2xx statuses logged at `debug` not `error`, still thrown), `errorBodyLimit?: number` (bytes of a non-2xx body kept, default `500`), and `signal?: AbortSignal` (external cancellation). On a non-2xx, `error.data` carries `status`/`body` plus the legacy `statusCode`/`responseBody` aliases (identical values; consolidating in a future major); a body over `errorBodyLimit` is captured from both ends — 40% head, 60% tail, joined by `…[N bytes elided]…` — so a diagnostic behind a boilerplate preamble survives the cap, while a body still streaming at the 16 KiB scan ceiling stays head-only with a trailing `…`. SSRF guard (best-effort, not hard isolation): blocks RFC 1918, loopback, link-local, CGNAT, cloud metadata. DNS validation on Node, Bun, and Cloudflare Workers under `nodejs_compat`; hostname-only fallback otherwise. Manual redirect following (max 5) with per-hop SSRF check. **DNS rebinding / TOCTOU gap** — the validation lookup and `fetch`'s own resolution are independent; pair with egress controls or a DNS-pinning fetch proxy for strong isolation. **Error/log redaction:** URLs written into thrown errors and log lines are reduced to `origin + pathname` — the query string (where API keys commonly ride: `?api-key=…`, `?api_key=…`) never reaches the client or the logs. The actual request still uses the full URL. |
|
|
33
35
|
| `withRetry` | `<T>(fn: () => Promise<T>, options?: RetryOptions) -> Promise<T>` | Executes `fn` with exponential backoff. Retries on transient errors (`ServiceUnavailable`, `Timeout`, `RateLimited`); non-transient errors fail immediately. Honors an upstream `Retry-After` on `data.retryAfter` (delta-seconds or HTTP-date) over exponential backoff, capped at `maxDelayMs`; a requested wait beyond the cap fails fast rather than sleeping. On exhaustion, enriches the final error with attempt count in message and `data.retryAttempts`. **Place the retry boundary around the full pipeline** (fetch + parse), not just the network call. `RetryOptions`: `maxRetries` (default `3`), `baseDelayMs` (default `1000`), `maxDelayMs` (default `30000`), `jitter` (default `0.25`), `operation` (log label), `context` (RequestContext), `signal` (AbortSignal), `isTransient` (custom predicate). |
|
|
34
36
|
| `httpErrorFromResponse` | `(response: Response, options?: HttpErrorFromResponseOptions) -> Promise<McpError>` | Maps an HTTP `Response` to a properly classified `McpError` — full status table including 401/403/408/422/429/5xx, body capture (truncated), `retry-after` header, optional `cause`. `error.data` carries `status`/`body` plus the legacy `statusCode`/`responseBody` aliases (identical values), so a consumer can classify either helper's error without knowing which raised it. Use this instead of hand-rolling `if (status === 429) ...` ladders. Reads the response body — `clone()` first if you need it elsewhere. `HttpErrorFromResponseOptions`: `service?` (logical name in message, e.g. `'NCBI'`), `captureBody?` (default `true`), `bodyLimit?` (default `500`), `data?` (extra fields merged into `error.data`), `cause?`, `codeOverride?` (per-status mapping override). Pairs naturally with `withRetry` — both classify codes the same way. |
|
|
35
37
|
| `httpStatusToErrorCode` | `(status: number) -> JsonRpcErrorCode \| undefined` | Sync status → code lookup. Returns `undefined` for 1xx/2xx/3xx. Use when you need just the code without a `Response` object handy. |
|
|
@@ -10,8 +10,9 @@ All parsers are **Tier 3** — lazy-load their peer dependency on first call. Al
|
|
|
10
10
|
|
|
11
11
|
- Singleton instances exported alongside classes
|
|
12
12
|
- `<think>...</think>` blocks at the start of input are automatically stripped and logged at `debug` level (except `dateParser` and `pdfParser`)
|
|
13
|
-
-
|
|
14
|
-
-
|
|
13
|
+
- Every `context?` parameter is optional (synthetic context created if omitted) and accepts the handler `Context` as well as a `RequestContext` bag
|
|
14
|
+
- Input budgets are opt-in: a parser is unbounded unless the caller passes `maxBytes`, which then rejects an over-budget input with `ValidationError` (`reason: 'parser_input_too_large'`). `DEFAULT_TEXT_PARSER_MAX_BYTES` (1 MiB) and `DEFAULT_BINARY_PARSER_MAX_BYTES` (25 MiB) are exported as starting points, not applied defaults
|
|
15
|
+
- Errors throw `McpError` — never return error values. The message is `<summary>: <library message>`, so it carries the underlying parser's diagnostic; `data` carries only `{ reason }`, and the input sample and stack stay on `cause`
|
|
15
16
|
|
|
16
17
|
---
|
|
17
18
|
|
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
Land working-tree changes as logical commits — the work grouped by concern, topped by a release commit (version bump, changelog, regenerated artifacts) and an annotated tag. Verify, commit, tag. Stops at "committed and tagged locally" — no push, no publish. The release-and-publish skill picks up from here. Distilled from the git_wrapup_instructions protocol.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "1.
|
|
7
|
+
version: "1.9"
|
|
8
8
|
audience: external
|
|
9
9
|
type: workflow
|
|
10
10
|
---
|
|
@@ -95,6 +95,8 @@ security: false # true ONLY for a security fix in this server's own source
|
|
|
95
95
|
---
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
+
**Write `summary:` LAST, derived from the body you just wrote — never independently.** It is the line most readers see, and it propagates unedited to three further surfaces: the `CHANGELOG.md` rollup, the GitHub Release body, and the annotated tag (which cannot be edited once pushed). Written from recollection rather than from the body, it reliably names a mechanism that was never built or a target that was never fixed, while the body beside it stays correct. After writing it, re-read the body and confirm every claim in the summary appears there.
|
|
99
|
+
|
|
98
100
|
**`security:` is a source-code signal — not a dependency-CVE signal.** Set `security: true` only when this release fixes a vulnerability or adds hardening in code *this server ships*. A dependency or transitive CVE bump — even one that clears an advisory (`bun audit` going 1 → 0) — is routine maintenance: record it under `## Dependencies` with the advisory ID and leave the flag `false`. The `🛡️ Security` badge answers "does the server itself have a vuln"; a dep bump must not trip it.
|
|
99
101
|
|
|
100
102
|
**Body:** Section order follows Keep a Changelog — Added / Changed / Deprecated / Removed / Fixed / Security. Include only sections with entries. Delete empty sections.
|
|
@@ -142,6 +144,24 @@ git commit -m "<subject>"
|
|
|
142
144
|
- Work commits (no version): `feat: hosted server endpoint`, `fix: handle empty SPARQL result sets`, `feat(linter): enrichment contract rules`, `docs: document the enrichment block`
|
|
143
145
|
- Release commit (subject leads with the version): `chore(release): 0.2.1 — empty SPARQL result handling`
|
|
144
146
|
|
|
147
|
+
**Body: every commit has one, and it is one or two lines.** Uniform across the stack — no commit ships subject-only, none ships a paragraph. One sentence stating the *why* or the load-bearing constraint, a second only if the first genuinely cannot carry it. Two lines is the hard ceiling.
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
fix: handle empty SPARQL result sets
|
|
151
|
+
|
|
152
|
+
Upstream returns 200 with an empty bindings array rather than 404.
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Never put a closing keyword in a commit body.** `Fixes #N`, `Closes #N`, `Resolves #N` and friends close the issue the moment the commit is pushed — before the close-out comment recording what shipped, so the issue closes with no account of the fix. Reference issues as bare `(#N)` backlinks in the subject or body; closing is a deliberate later step.
|
|
156
|
+
|
|
157
|
+
A body is too long the moment it:
|
|
158
|
+
- enumerates the files, subsystems, or symbols touched — that is `git show --stat`
|
|
159
|
+
- walks through how the implementation works — that is the code
|
|
160
|
+
- narrates a fix's mechanism across multiple sentences — that is the changelog entry
|
|
161
|
+
- runs to a second paragraph, ever
|
|
162
|
+
|
|
163
|
+
The changelog carries the depth, the tag carries the headline, the commit carries one line of why. When the body wants to grow, that pressure is telling you the content belongs in the changelog entry.
|
|
164
|
+
|
|
145
165
|
**Rules:**
|
|
146
166
|
- Plain `-m` flag only — no heredoc, no command substitution
|
|
147
167
|
- No `Co-authored-by` or `Generated with` trailers
|
|
@@ -218,6 +238,7 @@ If the working tree isn't clean or the tag doesn't point at HEAD, something went
|
|
|
218
238
|
- [ ] `bun run devcheck` passes
|
|
219
239
|
- [ ] `bun run test:all` (or `test`) passes
|
|
220
240
|
- [ ] Work grouped into logical commits (large features split by layer); release artifacts (version + changelog + tree) committed separately on top, subject leading with the version
|
|
241
|
+
- [ ] Every commit carries a body, and every body is one or two lines — none subject-only, none a paragraph
|
|
221
242
|
- [ ] Annotated tag `v<version>` with structured markdown message, final line linking this version's changelog file
|
|
222
243
|
- [ ] Working tree clean
|
|
223
244
|
- [ ] Nothing pushed — local only
|
package/templates/AGENTS.md
CHANGED
|
@@ -104,7 +104,7 @@ export const itemData = resource('inventory://{itemId}', {
|
|
|
104
104
|
params: z.object({ itemId: z.string().describe('Item identifier') }),
|
|
105
105
|
auth: ['inventory:read'],
|
|
106
106
|
async handler(params, ctx) {
|
|
107
|
-
const item = await ctx.state.get(`item
|
|
107
|
+
const item = await ctx.state.get(`item/${params.itemId}`);
|
|
108
108
|
if (!item) throw notFound(`Item ${params.itemId} not found`, { itemId: params.itemId });
|
|
109
109
|
return item;
|
|
110
110
|
},
|
package/templates/CLAUDE.md
CHANGED
|
@@ -104,7 +104,7 @@ export const itemData = resource('inventory://{itemId}', {
|
|
|
104
104
|
params: z.object({ itemId: z.string().describe('Item identifier') }),
|
|
105
105
|
auth: ['inventory:read'],
|
|
106
106
|
async handler(params, ctx) {
|
|
107
|
-
const item = await ctx.state.get(`item
|
|
107
|
+
const item = await ctx.state.get(`item/${params.itemId}`);
|
|
108
108
|
if (!item) throw notFound(`Item ${params.itemId} not found`, { itemId: params.itemId });
|
|
109
109
|
return item;
|
|
110
110
|
},
|