@cyanheads/mcp-ts-core 0.12.8 → 0.12.9
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 +3 -3
- package/CLAUDE.md +3 -3
- package/README.md +2 -2
- package/changelog/0.12.x/0.12.9.md +36 -0
- package/dist/mcp-server/transports/http/httpTransport.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/httpTransport.js +70 -2
- package/dist/mcp-server/transports/http/httpTransport.js.map +1 -1
- package/dist/mcp-server/transports/http/landing-page/sections/connect.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/landing-page/sections/connect.js +9 -2
- package/dist/mcp-server/transports/http/landing-page/sections/connect.js.map +1 -1
- package/dist/mcp-server/transports/http/sessionStore.d.ts +10 -2
- package/dist/mcp-server/transports/http/sessionStore.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/sessionStore.js.map +1 -1
- package/dist/services/mirror/sqlite/handle.d.ts.map +1 -1
- package/dist/services/mirror/sqlite/handle.js +14 -12
- package/dist/services/mirror/sqlite/handle.js.map +1 -1
- package/dist/services/mirror/sqlite/sqliteMirrorStore.js +8 -9
- package/dist/services/mirror/sqlite/sqliteMirrorStore.js.map +1 -1
- package/dist/services/mirror/types.d.ts +5 -1
- package/dist/services/mirror/types.d.ts.map +1 -1
- package/dist/utils/internal/performance.d.ts +1 -1
- package/dist/utils/internal/performance.js +2 -2
- package/dist/utils/network/fetchWithTimeout.js +1 -1
- package/dist/utils/network/retry.js +1 -1
- package/dist/utils/security/idGenerator.d.ts +3 -1
- package/dist/utils/security/idGenerator.d.ts.map +1 -1
- package/dist/utils/security/idGenerator.js +12 -1
- package/dist/utils/security/idGenerator.js.map +1 -1
- package/package.json +7 -7
- package/scripts/devcheck.ts +21 -14
- package/skills/add-tool/SKILL.md +4 -4
- package/skills/api-errors/SKILL.md +2 -1
- package/skills/api-mirror/SKILL.md +3 -1
- package/skills/design-mcp-server/SKILL.md +59 -101
- package/skills/field-test/SKILL.md +10 -5
- package/skills/git-wrapup/SKILL.md +5 -3
- package/skills/polish-docs-meta/SKILL.md +1 -1
- package/skills/polish-docs-meta/references/package-meta.md +1 -1
- package/skills/polish-docs-meta/references/readme.md +2 -2
- package/skills/release-and-publish/SKILL.md +4 -1
- package/skills/security-pass/SKILL.md +2 -2
- package/templates/AGENTS.md +1 -1
- package/templates/CLAUDE.md +1 -1
- package/templates/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/mirror/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEjE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAElF,yEAAyE;AACzE,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAEjD,mDAAmD;AACnD,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,UAAU,GAAG,OAAO,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IACxE,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IACxE,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IACvE,MAAM,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,IA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 @@ export declare function initHandlerMetrics(): void;
|
|
|
12
12
|
* Returns the current time in milliseconds using `globalThis.performance.now()`.
|
|
13
13
|
*
|
|
14
14
|
* Sub-millisecond resolution is guaranteed on all supported engine floors
|
|
15
|
-
* (Node ≥24, Bun ≥1.
|
|
15
|
+
* (Node ≥24, Bun ≥1.4, Cloudflare Workers). The returned value is suitable for
|
|
16
16
|
* computing durations but its epoch origin is implementation-defined — do not
|
|
17
17
|
* treat it as a wall-clock timestamp.
|
|
18
18
|
*
|
|
@@ -54,14 +54,14 @@ function getActiveRequestsGauge() {
|
|
|
54
54
|
* Returns the current time in milliseconds using `globalThis.performance.now()`.
|
|
55
55
|
*
|
|
56
56
|
* Sub-millisecond resolution is guaranteed on all supported engine floors
|
|
57
|
-
* (Node ≥24, Bun ≥1.
|
|
57
|
+
* (Node ≥24, Bun ≥1.4, Cloudflare Workers). The returned value is suitable for
|
|
58
58
|
* computing durations but its epoch origin is implementation-defined — do not
|
|
59
59
|
* treat it as a wall-clock timestamp.
|
|
60
60
|
*
|
|
61
61
|
* @returns Current time in milliseconds.
|
|
62
62
|
*/
|
|
63
63
|
// performance is an ambient global declared by @types/node (perf_hooks.d.ts)
|
|
64
|
-
// and available in all supported environments (Node ≥24, Bun ≥1.
|
|
64
|
+
// and available in all supported environments (Node ≥24, Bun ≥1.4, workerd).
|
|
65
65
|
export const nowMs = () => performance.now();
|
|
66
66
|
// Module-level TextEncoder singleton (stateless, safe to reuse)
|
|
67
67
|
let cachedEncoder;
|
|
@@ -479,7 +479,7 @@ export async function fetchWithTimeout(url, timeoutMs, context, options) {
|
|
|
479
479
|
const timeoutReason = new DOMException(`${operationDescription} timed out after ${timeoutMs}ms.`, 'TimeoutError');
|
|
480
480
|
const timeoutId = setTimeout(() => controller.abort(timeoutReason), timeoutMs);
|
|
481
481
|
// Compose the timeout signal with any caller-supplied signal. AbortSignal.any
|
|
482
|
-
// is available on all supported floors (Node ≥24, Bun ≥1.
|
|
482
|
+
// is available on all supported floors (Node ≥24, Bun ≥1.4, workerd).
|
|
483
483
|
const fetchSignal = externalSignal
|
|
484
484
|
? AbortSignal.any([controller.signal, externalSignal])
|
|
485
485
|
: controller.signal;
|
|
@@ -209,7 +209,7 @@ function sleep(ms, signal) {
|
|
|
209
209
|
return;
|
|
210
210
|
}
|
|
211
211
|
const controller = new AbortController();
|
|
212
|
-
// AbortSignal.any is available on all supported floors (Node ≥24, Bun ≥1.
|
|
212
|
+
// AbortSignal.any is available on all supported floors (Node ≥24, Bun ≥1.4, workerd).
|
|
213
213
|
const combined = signal ? AbortSignal.any([controller.signal, signal]) : controller.signal;
|
|
214
214
|
const timer = setTimeout(() => {
|
|
215
215
|
controller.abort();
|
|
@@ -64,8 +64,10 @@ export declare class IdGenerator {
|
|
|
64
64
|
/**
|
|
65
65
|
* Generates a cryptographically secure random string.
|
|
66
66
|
* @param length - The desired length of the random string. Defaults to `IdGenerator.DEFAULT_LENGTH`.
|
|
67
|
-
* @param charset - The character set to use. Defaults to `IdGenerator.DEFAULT_CHARSET`.
|
|
67
|
+
* @param charset - The character set to use, 1 to 256 characters. Defaults to `IdGenerator.DEFAULT_CHARSET`.
|
|
68
68
|
* @returns The generated random string.
|
|
69
|
+
* @throws {McpError} With {@link JsonRpcErrorCode.ValidationError} when `charset` is empty
|
|
70
|
+
* or longer than 256 characters — the sampler cannot terminate on either.
|
|
69
71
|
*/
|
|
70
72
|
generateRandomString(length?: number, charset?: string): string;
|
|
71
73
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idGenerator.d.ts","sourceRoot":"","sources":["../../../src/utils/security/idGenerator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"idGenerator.d.ts","sourceRoot":"","sources":["../../../src/utils/security/idGenerator.ts"],"names":[],"mappings":"AAqDA;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WA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G;IACI,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,GAAE,MAAsC,GAAG,MAAM,CAe1F;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACI,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,GAAE,MAAsC,GAAG,MAAM,CAStF;CACF;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,aAAoB,CAAC;AAE7C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,QAAO,MAA6B,CAAC;AAE9D;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,wBAAwB,QAAO,MAG3C,CAAC"}
|
|
@@ -21,6 +21,8 @@ function getRandomBytes(count) {
|
|
|
21
21
|
crypto.getRandomValues(bytes);
|
|
22
22
|
return bytes;
|
|
23
23
|
}
|
|
24
|
+
/** Largest charset the byte-wise rejection sampler below can draw from. */
|
|
25
|
+
const MAX_CHARSET_LENGTH = 256;
|
|
24
26
|
/**
|
|
25
27
|
* Builds a random string of `length` characters drawn uniformly from `charset`.
|
|
26
28
|
*
|
|
@@ -28,6 +30,10 @@ function getRandomBytes(count) {
|
|
|
28
30
|
* multiple of `charset.length` that fits in 256, so `byte % charset.length`
|
|
29
31
|
* never biases toward the low characters. Bytes are drawn in over-sized chunks
|
|
30
32
|
* rather than one at a time, so a typical ID costs one `getRandomValues` call.
|
|
33
|
+
*
|
|
34
|
+
* `charset` must hold 1 to {@link MAX_CHARSET_LENGTH} characters: an empty
|
|
35
|
+
* charset never grows `result`, and a longer one rejects every byte, so either
|
|
36
|
+
* would spin here forever. Public callers validate before reaching this.
|
|
31
37
|
*/
|
|
32
38
|
function randomStringFromCharset(length, charset) {
|
|
33
39
|
const maxValidByteValue = Math.floor(256 / charset.length) * charset.length;
|
|
@@ -103,10 +109,15 @@ export class IdGenerator {
|
|
|
103
109
|
/**
|
|
104
110
|
* Generates a cryptographically secure random string.
|
|
105
111
|
* @param length - The desired length of the random string. Defaults to `IdGenerator.DEFAULT_LENGTH`.
|
|
106
|
-
* @param charset - The character set to use. Defaults to `IdGenerator.DEFAULT_CHARSET`.
|
|
112
|
+
* @param charset - The character set to use, 1 to 256 characters. Defaults to `IdGenerator.DEFAULT_CHARSET`.
|
|
107
113
|
* @returns The generated random string.
|
|
114
|
+
* @throws {McpError} With {@link JsonRpcErrorCode.ValidationError} when `charset` is empty
|
|
115
|
+
* or longer than 256 characters — the sampler cannot terminate on either.
|
|
108
116
|
*/
|
|
109
117
|
generateRandomString(length = IdGenerator.DEFAULT_LENGTH, charset = IdGenerator.DEFAULT_CHARSET) {
|
|
118
|
+
if (charset.length === 0 || charset.length > MAX_CHARSET_LENGTH) {
|
|
119
|
+
throw validationError(`Charset must contain between 1 and ${MAX_CHARSET_LENGTH} characters; received ${charset.length}.`, { charsetLength: charset.length, max: MAX_CHARSET_LENGTH });
|
|
120
|
+
}
|
|
110
121
|
return randomStringFromCharset(length, charset);
|
|
111
122
|
}
|
|
112
123
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idGenerator.js","sourceRoot":"","sources":["../../../src/utils/security/idGenerator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D;;;;;GAKG;AACH,SAAS,cAAc,CAAC,KAAa;IACnC,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IACpC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC9B,OAAO,KAAK,CAAC;AACf,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"idGenerator.js","sourceRoot":"","sources":["../../../src/utils/security/idGenerator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D;;;;;GAKG;AACH,SAAS,cAAc,CAAC,KAAa;IACnC,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,KAAK,C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AI,CAAC,aAAa,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QACrD,MAAM,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACzD,MAAM,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACpC,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAEpD,8EAA8E;QAC9E,0CAA0C;QAC1C,OAAO,GAAG,gBAAgB,GAAG,SAAS,GAAG,UAAU,CAAC,WAAW,EAAE,EAAE,CAAC;IACtE,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;AAE7C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAW,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;AAE9D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAW,EAAE;IACnD,MAAM,OAAO,GAAG,sCAAsC,CAAC;IACvD,OAAO,GAAG,uBAAuB,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,uBAAuB,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC;AACzF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/mcp-ts-core",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.9",
|
|
4
4
|
"mcpName": "io.github.cyanheads/mcp-ts-core",
|
|
5
5
|
"description": "Agent-native TypeScript framework for MCP servers. Includes runtime infrastructure and agent skills for building, testing, and shipping servers.",
|
|
6
6
|
"files": [
|
|
@@ -212,8 +212,8 @@
|
|
|
212
212
|
"@opentelemetry/sdk-trace-node": "^2.11.0",
|
|
213
213
|
"@opentelemetry/semantic-conventions": "^1.43.0",
|
|
214
214
|
"@socketsecurity/bun-security-scanner": "^1.1.2",
|
|
215
|
-
"@supabase/supabase-js": "^2.
|
|
216
|
-
"@types/bun": "^1.4.
|
|
215
|
+
"@supabase/supabase-js": "^2.116.0",
|
|
216
|
+
"@types/bun": "^1.4.2",
|
|
217
217
|
"@types/node": "26.4.0",
|
|
218
218
|
"@types/papaparse": "^5.5.2",
|
|
219
219
|
"@types/sanitize-html": "^2.16.1",
|
|
@@ -230,7 +230,7 @@
|
|
|
230
230
|
"execa": "^10.0.1",
|
|
231
231
|
"fast-check": "^4.9.0",
|
|
232
232
|
"fast-xml-parser": "^5.11.1",
|
|
233
|
-
"ignore": "^7.0.
|
|
233
|
+
"ignore": "^7.0.9",
|
|
234
234
|
"js-yaml": "^5.4.1",
|
|
235
235
|
"linkedom": "^0.18.13",
|
|
236
236
|
"node-cron": "^4.6.0",
|
|
@@ -282,7 +282,7 @@
|
|
|
282
282
|
],
|
|
283
283
|
"packageManager": "bun@1.4.0",
|
|
284
284
|
"engines": {
|
|
285
|
-
"bun": ">=1.
|
|
285
|
+
"bun": ">=1.4.0",
|
|
286
286
|
"node": ">=24.0.0"
|
|
287
287
|
},
|
|
288
288
|
"depcheck": {
|
|
@@ -302,14 +302,14 @@
|
|
|
302
302
|
"dependencies": {
|
|
303
303
|
"@hono/node-server": "^2.1.1",
|
|
304
304
|
"@modelcontextprotocol/client": "^2.0.0",
|
|
305
|
-
"@modelcontextprotocol/ext-apps": "^
|
|
305
|
+
"@modelcontextprotocol/ext-apps": "^2.0.0",
|
|
306
306
|
"@modelcontextprotocol/server": "^2.0.0",
|
|
307
307
|
"@opentelemetry/api": "^1.9.1",
|
|
308
308
|
"dotenv": "^17.4.2",
|
|
309
309
|
"hono": "^4.13.7",
|
|
310
310
|
"jose": "^6.2.12",
|
|
311
311
|
"pino": "^10.3.1",
|
|
312
|
-
"zod": "^4.
|
|
312
|
+
"zod": "^4.6.0"
|
|
313
313
|
},
|
|
314
314
|
"peerDependencies": {
|
|
315
315
|
"@duckdb/node-api": "^1.5.5-r.1",
|
package/scripts/devcheck.ts
CHANGED
|
@@ -437,7 +437,8 @@ interface OutdatedRow {
|
|
|
437
437
|
current: string;
|
|
438
438
|
/** The declared key when attribution is unambiguous, else null. */
|
|
439
439
|
declaredKey: string | null;
|
|
440
|
-
|
|
440
|
+
/** The block the row belongs to; `bun outdated` leaves `prod` rows unmarked. */
|
|
441
|
+
group: DependencyGroup;
|
|
441
442
|
/** The row verbatim, used to key the rendered rewrite back to its line. */
|
|
442
443
|
line: string;
|
|
443
444
|
/** First cell as printed, marker included. */
|
|
@@ -457,11 +458,11 @@ interface OutdatedRow {
|
|
|
457
458
|
*/
|
|
458
459
|
function attributeOutdatedRow(
|
|
459
460
|
target: string,
|
|
460
|
-
group: DependencyGroup
|
|
461
|
+
group: DependencyGroup,
|
|
461
462
|
current: string,
|
|
462
463
|
): Pick<OutdatedRow, 'candidates' | 'declaredKey'> {
|
|
463
464
|
const matches = DECLARED_DEPENDENCIES.filter(
|
|
464
|
-
(declared) => declared.target === target &&
|
|
465
|
+
(declared) => declared.target === target && declared.group === group,
|
|
465
466
|
);
|
|
466
467
|
const candidates = matches.map((declared) => declared.key);
|
|
467
468
|
if (candidates.length <= 1) return { candidates, declaredKey: candidates[0] ?? null };
|
|
@@ -481,7 +482,7 @@ function parseOutdatedRows(output: string): OutdatedRow[] {
|
|
|
481
482
|
const rawName = cells[1] ?? '';
|
|
482
483
|
// Skip table chrome: header row and separator (e.g., "---")
|
|
483
484
|
if (!rawName || rawName === 'Package' || /^-+$/.test(rawName)) continue;
|
|
484
|
-
const group = (OUTDATED_GROUP_MARKER.exec(rawName)?.[1] ??
|
|
485
|
+
const group = (OUTDATED_GROUP_MARKER.exec(rawName)?.[1] ?? 'prod') as DependencyGroup;
|
|
485
486
|
const target = rawName.replace(OUTDATED_GROUP_MARKER, '');
|
|
486
487
|
const current = cells[2] ?? '';
|
|
487
488
|
const update = (cells[3] ?? '').replace(/\*/g, '').trim();
|
|
@@ -514,7 +515,7 @@ function renderOutdatedTable(output: string): string {
|
|
|
514
515
|
const row = attributed.get(line);
|
|
515
516
|
let display = cell.trim();
|
|
516
517
|
if (row?.declaredKey && row.declaredKey !== row.target) {
|
|
517
|
-
display = row.group ? `${row.declaredKey} (${row.group})
|
|
518
|
+
display = row.group === 'prod' ? row.declaredKey : `${row.declaredKey} (${row.group})`;
|
|
518
519
|
}
|
|
519
520
|
return { line, display };
|
|
520
521
|
});
|
|
@@ -552,9 +553,12 @@ function renderOutdatedTable(output: string): string {
|
|
|
552
553
|
* Parses `bun audit` output and classifies high/critical vulnerabilities as
|
|
553
554
|
* direct (in our package.json) or upstream (transitive dependency we can't fix).
|
|
554
555
|
*
|
|
555
|
-
* Bun audit format per vulnerability block
|
|
556
|
-
*
|
|
557
|
-
*
|
|
556
|
+
* Bun audit format per vulnerability block — Bun 1.4 changed the header token
|
|
557
|
+
* and the path separator, so both shapes are accepted:
|
|
558
|
+
* <package> <version-range> ← header, Bun <1.4 (no indent, 2+ spaces before range)
|
|
559
|
+
* <package>@<version> ← header, Bun ≥1.4
|
|
560
|
+
* <parent> › <child> [› ...] ← dependency path (indented; › or, Bun ≥1.4, > = transitive)
|
|
561
|
+
* (direct dependency) ← dependency path of a direct dependency, Bun ≥1.4
|
|
558
562
|
* <severity>: <description> ← advisory (indented)
|
|
559
563
|
*
|
|
560
564
|
* Returns null if parsing yields no results (caller should fall back to default behavior).
|
|
@@ -567,8 +571,10 @@ function classifyAuditVulns(output: string): { direct: string[]; upstream: strin
|
|
|
567
571
|
let i = 0;
|
|
568
572
|
|
|
569
573
|
while (i < lines.length) {
|
|
570
|
-
// Package header: non-indented
|
|
571
|
-
|
|
574
|
+
// Package header: non-indented `name range` (2+ spaces, Bun <1.4) or
|
|
575
|
+
// `name@version` (Bun ≥1.4). A scoped name leads with `@`, so only a
|
|
576
|
+
// later `@` splits the Bun 1.4 form.
|
|
577
|
+
const pkgMatch = lines[i]?.match(/^(@?\w[\w./-]*)(?:\s{2,}|@)(\S.*)$/);
|
|
572
578
|
if (!pkgMatch) {
|
|
573
579
|
i++;
|
|
574
580
|
continue;
|
|
@@ -593,14 +599,15 @@ function classifyAuditVulns(output: string): { direct: string[]; upstream: strin
|
|
|
593
599
|
|
|
594
600
|
if (!hasHighCritical) continue;
|
|
595
601
|
|
|
596
|
-
// Direct if: the vulnerable package is in our package.json,
|
|
597
|
-
//
|
|
602
|
+
// Direct if: the vulnerable package is in our package.json, or any
|
|
603
|
+
// dependency path lacks a transitive separator — U+203A `›` (Bun <1.4)
|
|
604
|
+
// or `>` (Bun ≥1.4). Bun 1.4's literal `(direct dependency)` path has neither.
|
|
598
605
|
const pkgName = pkg ?? '';
|
|
599
|
-
const isDirect = DIRECT_DEPS.has(pkgName) || paths.some((p) =>
|
|
606
|
+
const isDirect = DIRECT_DEPS.has(pkgName) || paths.some((p) => !/[\u203a>]/.test(p));
|
|
600
607
|
if (isDirect) {
|
|
601
608
|
direct.push(`${pkgName} ${versionRange}`);
|
|
602
609
|
} else {
|
|
603
|
-
const via = paths[0]?.split(/\s
|
|
610
|
+
const via = paths[0]?.split(/\s*[\u203a>]\s*/)[0] ?? 'unknown';
|
|
604
611
|
upstream.push(`${pkgName} ${versionRange} (via ${via})`);
|
|
605
612
|
}
|
|
606
613
|
}
|
package/skills/add-tool/SKILL.md
CHANGED
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
Scaffold a new MCP tool definition. Use when the user asks to add a tool, create a new tool, or implement a new capability for the server.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "2.
|
|
7
|
+
version: "2.23"
|
|
8
8
|
audience: external
|
|
9
9
|
type: reference
|
|
10
10
|
---
|
|
@@ -26,9 +26,9 @@ Tools use the `tool()` builder from `@cyanheads/mcp-ts-core`. Each tool lives in
|
|
|
26
26
|
|
|
27
27
|
Tools use lowercase snake_case with a canonical server/domain prefix: `{server}_{verb}_{noun}` — 3 words.
|
|
28
28
|
|
|
29
|
-
Examples: `pubmed_search_articles`, `pubmed_fetch_fulltext`, `
|
|
29
|
+
Examples: `pubmed_search_articles`, `pubmed_fetch_fulltext`, `clinicaltrials_find_eligible`.
|
|
30
30
|
|
|
31
|
-
The server prefix
|
|
31
|
+
The server prefix is judged on clarity, not length: the brand name or the plain well-known word for the domain both pass (`pubmed_`, `patents_`); an abbreviation fails only when it reads as something else out of context (`loc_`, `ct_`). A fourth segment is fine when the noun is inherently two words (`openfda_search_device_clearances`). When a name resists the schema — can't pick a verb, noun feels generic, the *verb* wants a second word — that's usually a signal the scope is fuzzy; split the tool, rename, or reconsider.
|
|
32
32
|
|
|
33
33
|
For shape selection (Workflow or Instruction variants — standard single-action tools are the default), see the `design-mcp-server` skill's Tool shapes section.
|
|
34
34
|
|
|
@@ -774,7 +774,7 @@ Large payloads burn the agent's context window. Default to curated summaries; of
|
|
|
774
774
|
- **Lists**: Return top N with a total count and pagination cursor, not unbounded arrays
|
|
775
775
|
- **Large objects**: Return key fields by default; accept a `fields` or `verbose` parameter for full data
|
|
776
776
|
- **Binary/blob content**: Return metadata and a reference, not the raw content
|
|
777
|
-
- **Analytical working sets**: When upstream returns more *analytical* rows (data an agent would SQL — aggregate, group, join) than fit in context, `DataCanvas` (`
|
|
777
|
+
- **Analytical working sets**: When upstream returns more *analytical* rows (data an agent would SQL — aggregate, group, join) than fit in context, `DataCanvas` (`core.canvas`, wired in `setup()` via `setCanvas`; Tier 3 — opt-in via `CANVAS_PROVIDER_TYPE=duckdb`) lets you register the rows and return the `canvas_id` plus a preview so the agent can run SQL to slice down without a re-fetch. The `spillover()` helper (`@cyanheads/mcp-ts-core/canvas`) automates the overflow case: drain rows up to a character budget for the inline preview, auto-register the full source on overflow, return both as a discriminated union. **Two gates:** it must be analytical, not a discovery/search surface of categorical metadata (those don't earn a canvas regardless of row count — use MCP-side list filtering or pagination); and a tool emitting a `canvas_id` MUST be paired with a registered `dataframe_query` tool, or the handle is unreachable. Compute distributions or refinement hints across the full result — not the preview — so the agent gets honest aggregate signal on the rows it didn't read. See `api-canvas` for the register / query / export pattern and the spillover flow.
|
|
778
778
|
- **One large document**: When a single call returns one document-shaped record (not a row set) that can overflow context, return a section *outline* — top-level keys + per-section byte size — and let the agent re-call with `sections: [...]` for only what it needs, instead of truncating one surface. `outlineOnOverflow()` with `OUTLINE_VARIANT` / `selectSections()` / `formatOutline()` (`@cyanheads/mcp-ts-core/utils`) measures the payload and returns a `full | outline` result. Declare the tool's `output` as a flat `z.object` with a `kind` discriminator and presence-based optional arms (fold in `OUTLINE_VARIANT.shape.sections` / `.notice`) — `tool()` rejects a `z.discriminatedUnion` output — and render each arm on field presence in `format()` so parity holds. Pure measure + key-slice — Workers-portable, unlike canvas `spillover()`. Use for one fat record; use `spillover()` for a row collection. See the `techniques` skill's `outline-on-overflow` reference.
|
|
779
779
|
|
|
780
780
|
## MCP-side list filtering
|
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
McpError constructor, JsonRpcErrorCode reference, and error handling patterns for `@cyanheads/mcp-ts-core`. Use when looking up error codes, understanding where errors should be thrown vs. caught, or using ErrorHandler.tryCatch in services.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "1.
|
|
7
|
+
version: "1.10"
|
|
8
8
|
audience: external
|
|
9
9
|
type: reference
|
|
10
10
|
---
|
|
@@ -363,6 +363,7 @@ Important properties:
|
|
|
363
363
|
- **`data` propagation is restricted** to explicitly-thrown `McpError.data` and `ZodError.issues`. Auto-classified plain errors (`TypeError`, network errors, etc.) emit `code` + `message` only — no `data` — so internal classification context never leaks to clients.
|
|
364
364
|
- **Recovery hint mirroring is automatic.** When the thrown `McpError` carries `data.recovery.hint`, the handler factory appends it to the `content[]` text so the markdown surface matches the JSON surface. Authors don't need to format the hint manually.
|
|
365
365
|
- **Argument-schema rejection is a tool error with the same envelope.** An unknown root key, a wrong type, a missing required field, or a failed constraint returns `isError: true` with `structuredContent.error.code = -32602` (`InvalidParams`) and the readable `Invalid arguments for tool <name>: …` diagnostic in `content[]`. The handler never runs. Two neighbouring failures keep the protocol error path instead, arriving as a JSON-RPC error rather than a tool result: an unknown or disabled tool name, and a malformed request envelope.
|
|
366
|
+
- **A schema constraint cannot carry a declared reason.** Because the handler never runs, a rejection by `.max()`, `.regex()`, `.min()`, or any other Zod refinement bypasses `errors[]` entirely: it arrives as `InvalidParams` with `data.issues` and no `data.reason`, so a caller has nothing to branch on and gets no recovery hint. Decide per constraint which surface it belongs on. A bound that is purely structural — the input is the wrong shape and no guidance beyond the diagnostic would help — belongs on the schema, where it also advertises itself in `inputSchema`. A bound a caller is expected to recover from belongs in the handler as `ctx.fail('reason', message, ctx.recoveryFor('reason'))` against a declared `errors[]` entry, with the limit restated in the field's `.describe()` so it is still visible before the call. Enforcing the same bound in both places is the trap: the schema wins, and the contract entry becomes unreachable while still reading as covered.
|
|
366
367
|
|
|
367
368
|
**Handler — throw freely, no try/catch:**
|
|
368
369
|
|
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
Stand up a persistent, self-refreshing local mirror of a bulk upstream dataset with the MirrorService (@cyanheads/mcp-ts-core/mirror). Use when a server wraps a large or slow API and should query a synced local index (embedded SQLite + FTS5) instead of paginating the live API per request.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "1.
|
|
7
|
+
version: "1.2"
|
|
8
8
|
audience: external
|
|
9
9
|
type: reference
|
|
10
10
|
---
|
|
@@ -81,6 +81,8 @@ Why they can't merge: during a from-scratch init the records aren't ordered by t
|
|
|
81
81
|
|
|
82
82
|
For access paths the generic query can't express — junction tables for index-backed multi-value filtering, denormalized counters, bespoke `bm25` weighting — use the **raw handle**: `const db = await mirror.raw();` then run prepared statements against your own auxiliary tables (declare them via a migration). Add the auxiliary DDL in a `migrations` step; maintain it from your `sync` mapping or SQL triggers.
|
|
83
83
|
|
|
84
|
+
A migration runs identically on first creation and on upgrade: a fresh database runs every migration up to `version` right after the declarative DDL, an existing one runs only those above its stored version. So `up()` must tolerate a database that already has the current declarative shape — `CREATE TABLE IF NOT EXISTS` for auxiliary objects, never an `ALTER` that assumes an older layout of a declared column.
|
|
85
|
+
|
|
84
86
|
## Readiness — key off the completion marker, not live status
|
|
85
87
|
|
|
86
88
|
`status().ready` is `true` once a full sync has **ever completed** (`completedAt != null`), not when `status === 'complete'`. The dataset stays transactionally queryable during a refresh, so a mirror mid-refresh — or one whose last refresh failed — is still ready and should keep serving. Gate the mirror read path on `await mirror.ready()`; fall back to the live API only when it is `false` (cold, never-completed init).
|