stitchkit 0.124.0 → 0.124.2

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.
Files changed (103) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/dist/browser/client-executors.d.ts.map +1 -1
  3. package/dist/browser/contract-stream.d.ts +7 -2
  4. package/dist/browser/contract-stream.d.ts.map +1 -1
  5. package/dist/entrypoints/agent-runtime/coding-tools.js +1 -1
  6. package/dist/entrypoints/agent-runtime/realtime.js +3 -3
  7. package/dist/entrypoints/agent-runtime/sandbox.js +2 -2
  8. package/dist/entrypoints/agent-runtime/sqlite/bun.js +3 -3
  9. package/dist/entrypoints/agent-runtime/sqlite/node.js +3 -3
  10. package/dist/entrypoints/agent-runtime/testing.js +3 -3
  11. package/dist/entrypoints/agent-runtime.js +3 -3
  12. package/dist/entrypoints/application/diagnostic-journal.js +3 -5
  13. package/dist/entrypoints/application/directory-inbox.js +9 -11
  14. package/dist/entrypoints/application.js +3 -3
  15. package/dist/entrypoints/cli/publish.js +6 -6
  16. package/dist/entrypoints/cli.js +6 -3
  17. package/dist/entrypoints/files.js +5 -5
  18. package/dist/entrypoints/http.js +2 -2
  19. package/dist/entrypoints/index.js +6 -6
  20. package/dist/entrypoints/node.js +1 -1
  21. package/dist/entrypoints/process.js +1 -1
  22. package/dist/entrypoints/remote.js +1 -1
  23. package/dist/entrypoints/server.js +8 -8
  24. package/dist/entrypoints/telegram.js +2 -2
  25. package/dist/entrypoints/testing.js +1 -1
  26. package/dist/entrypoints/tools/connections.d.ts +2 -2
  27. package/dist/entrypoints/tools/connections.d.ts.map +1 -1
  28. package/dist/entrypoints/tools/connections.js +122 -30
  29. package/dist/entrypoints/tools/mcp.d.ts +1 -1
  30. package/dist/entrypoints/tools/mcp.d.ts.map +1 -1
  31. package/dist/entrypoints/tools/mcp.js +8 -6
  32. package/dist/entrypoints/tools/toolkit.js +2 -2
  33. package/dist/entrypoints/tools.js +3 -3
  34. package/dist/{index-8yky60kq.js → index-1szhrfsf.js} +5 -7
  35. package/dist/{index-mqttte96.js → index-3ymcmpa9.js} +3 -5
  36. package/dist/{index-v8xm2s9v.js → index-7177dxjn.js} +1 -1
  37. package/dist/{index-2x2ch0bt.js → index-782qtc24.js} +1 -1
  38. package/dist/{index-j8rda9n6.js → index-8pwwd6rp.js} +3 -3
  39. package/dist/{index-m616f0yz.js → index-8x0q6yfb.js} +134 -7
  40. package/dist/{index-jswst0h3.js → index-b2sey031.js} +50 -5
  41. package/dist/{index-tt3ej8r3.js → index-btjwc7xr.js} +217 -24
  42. package/dist/{index-ezwvsqx9.js → index-fvd6pvw3.js} +1 -1
  43. package/dist/{index-6qrspvxp.js → index-gbj964dt.js} +1 -1
  44. package/dist/{index-q89kd1xc.js → index-hzk4ydpy.js} +1 -1
  45. package/dist/{index-w0wy05gr.js → index-jkjh7zw4.js} +50 -40
  46. package/dist/{index-ac6vvm30.js → index-jp2qd9jb.js} +1 -1
  47. package/dist/{index-45dyex0j.js → index-m9hb9wnk.js} +1 -1
  48. package/dist/index-mm89hd8v.js +39 -0
  49. package/dist/{index-zbzagr9k.js → index-ne4j9998.js} +16 -15
  50. package/dist/{index-jc5xgkpk.js → index-qsm899qp.js} +1 -1
  51. package/dist/{index-cjbn98zt.js → index-ss67fxhj.js} +21 -3
  52. package/dist/index-wqzw3qg9.js +91 -0
  53. package/dist/{index-364k2zwa.js → index-wt6rw7rf.js} +5 -7
  54. package/dist/{index-5efrpfmj.js → index-wxadzdb7.js} +1 -1
  55. package/dist/internal/deadline.d.ts +30 -0
  56. package/dist/internal/deadline.d.ts.map +1 -1
  57. package/dist/internal/pinned-http.d.ts +1 -1
  58. package/dist/internal/pinned-http.d.ts.map +1 -1
  59. package/dist/internal/secure-fetch.d.ts +8 -0
  60. package/dist/internal/secure-fetch.d.ts.map +1 -1
  61. package/dist/internal/stream-chunks.d.ts +10 -0
  62. package/dist/internal/stream-chunks.d.ts.map +1 -1
  63. package/dist/tools/cli/resumable-download.d.ts +18 -0
  64. package/dist/tools/cli/resumable-download.d.ts.map +1 -0
  65. package/dist/tools/cli/update.d.ts +18 -0
  66. package/dist/tools/cli/update.d.ts.map +1 -1
  67. package/dist/tools/connections/catalog-cache.d.ts +9 -0
  68. package/dist/tools/connections/catalog-cache.d.ts.map +1 -0
  69. package/dist/tools/connections/errors.d.ts +10 -1
  70. package/dist/tools/connections/errors.d.ts.map +1 -1
  71. package/dist/tools/connections/limits.d.ts +16 -4
  72. package/dist/tools/connections/limits.d.ts.map +1 -1
  73. package/dist/tools/connections/mcp-client.d.ts +10 -2
  74. package/dist/tools/connections/mcp-client.d.ts.map +1 -1
  75. package/dist/tools/connections/mcp.d.ts.map +1 -1
  76. package/dist/tools/connections/operation-limits.d.ts +12 -1
  77. package/dist/tools/connections/operation-limits.d.ts.map +1 -1
  78. package/dist/tools/connections/sse-session.d.ts +2 -2
  79. package/dist/tools/connections/sse-session.d.ts.map +1 -1
  80. package/dist/tools/connections/types.d.ts +38 -2
  81. package/dist/tools/connections/types.d.ts.map +1 -1
  82. package/dist/tools/mcp/catalog-stamp.d.ts +47 -0
  83. package/dist/tools/mcp/catalog-stamp.d.ts.map +1 -0
  84. package/dist/tools/mcp/catalog.d.ts +1 -30
  85. package/dist/tools/mcp/catalog.d.ts.map +1 -1
  86. package/dist/tools/mcp/handler.d.ts.map +1 -1
  87. package/dist/tools/mcp/mount.d.ts +6 -1
  88. package/dist/tools/mcp/mount.d.ts.map +1 -1
  89. package/dist/tools/mcp/register.d.ts +1 -1
  90. package/dist/tools/mcp/register.d.ts.map +1 -1
  91. package/dist/tools/mcp/runtime-tools.d.ts +1 -1
  92. package/dist/tools/mcp/runtime-tools.d.ts.map +1 -1
  93. package/llms/cli.2.txt +60 -6
  94. package/llms/stitchkit.2.txt +6 -0
  95. package/llms/stitchkit.3.txt +1 -1
  96. package/llms/tools-connections.txt +5 -3
  97. package/llms/tools-mcp.txt +5 -2
  98. package/llms/tools.txt +10 -3
  99. package/llms-full.txt +87 -15
  100. package/llms.txt +5 -5
  101. package/package.json +6 -6
  102. package/dist/index-9tqbxv5p.js +0 -44
  103. package/dist/index-b56nnscm.js +0 -132
@@ -1,4 +1,5 @@
1
1
  import type { ToolTransport } from '../../contract/define.js';
2
+ import type { McpCatalogStamp } from '../mcp/catalog-stamp.js';
2
3
  import type { ConnectionTokenProvider, ConnectionToolSkipReporter } from './runtime.js';
3
4
  /** Where one external MCP server lives, plus static request headers. */
4
5
  export interface McpConnectionTransport {
@@ -16,8 +17,19 @@ export type ConnectionPhase = 'discovery' | 'call';
16
17
  export type ConnectionOperation = 'initialize' | 'notifications/initialized' | 'tools/list' | 'tools/call' | 'endpoint' | 'request' | 'openapi/spec' | 'openapi/call';
17
18
  /** Positive finite integer bounds for one logical operation. */
18
19
  export interface ConnectionOperationLimits {
19
- /** Deadline in milliseconds, including transport negotiation and body reads. */
20
+ /**
21
+ * Deadline in milliseconds, including transport negotiation and body reads. Defaults to the
22
+ * connection's shared `timeoutMs`; with neither set, discovery allows 300_000 and a call 30_000.
23
+ */
20
24
  timeoutMs?: number;
25
+ /**
26
+ * End the operation when nothing arrives for this many milliseconds — response headers and
27
+ * every body chunk restart it, so a slow transfer that keeps delivering is not cut off.
28
+ * Discovery with no declared `timeoutMs` (here or shared) defaults to 30_000; otherwise, and
29
+ * for a call, there is none unless set — a tool may compute in silence before it answers.
30
+ * Fails with `ConnectionTimeoutError` whose `deadline` is `'idle'`.
31
+ */
32
+ idleTimeoutMs?: number;
21
33
  /** Raw response-body byte ceiling, including SSE framing. */
22
34
  maxResponseBytes?: number;
23
35
  }
@@ -36,12 +48,21 @@ export interface McpClientConnectionConfig {
36
48
  instanceKey?: string;
37
49
  /** Extra hosts a request may name, beside the connection URL's own host. */
38
50
  allowHosts?: readonly string[];
39
- /** Shared logical-operation deadline; defaults to 30_000 milliseconds. */
51
+ /**
52
+ * Shared logical-operation deadline for both phases. Unset, discovery allows 300_000
53
+ * milliseconds (its idle deadline ends a dead one) and a call 30_000.
54
+ */
40
55
  timeoutMs?: number;
41
56
  /** Response body ceiling in bytes; defaults to 1 MiB. */
42
57
  maxResponseBytes?: number;
43
58
  /** Discovery and call overrides; omitted fields inherit the shared bounds. */
44
59
  limits?: McpConnectionLimits;
60
+ /**
61
+ * Where the discovered catalog is kept between processes. When the server stamps its
62
+ * catalog (a Stitchkit server does), a stored catalog with the live stamp is mounted without
63
+ * asking for `tools/list`; any other answer lists and stores again.
64
+ */
65
+ catalog?: McpConnectionCatalogStore;
45
66
  /**
46
67
  * Which surfaces this server's discovered tools appear on; default MCP and
47
68
  * AGENT. Naming `['CLI']` is how a whole server becomes a set of commands,
@@ -51,6 +72,21 @@ export interface McpClientConnectionConfig {
51
72
  */
52
73
  transports?: readonly ToolTransport[];
53
74
  }
75
+ /** One stored `tools/list` result and the catalog stamp it was listed under. */
76
+ export interface McpConnectionCatalogEntry {
77
+ stamp: McpCatalogStamp;
78
+ /** The `tools/list` result exactly as received, before any `tools` filter. */
79
+ result: unknown;
80
+ }
81
+ /**
82
+ * The application's storage for a connection's discovered catalog — a file, a database row.
83
+ * A failing `load` or `store` costs a `tools/list`, never the mount; a loaded entry is
84
+ * validated before it is used.
85
+ */
86
+ export interface McpConnectionCatalogStore {
87
+ load(): McpConnectionCatalogEntry | undefined | Promise<McpConnectionCatalogEntry | undefined>;
88
+ store(entry: McpConnectionCatalogEntry): void | Promise<void>;
89
+ }
54
90
  /** A defined MCP connection. */
55
91
  export interface McpClientConnection extends McpClientConnectionConfig {
56
92
  kind: 'mcp';
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAErF,wEAAwE;AACxE,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC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wEAAwE;AACxE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,4DAA4D;AAC5D,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,0BAA0B,CAAC;CAC5C"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * The catalog stamp's name and wire forms, with no dependency beyond a type guard — the MCP
3
+ * client of `tools/connections` reads stamps too, and must not pull the JSON Schema machinery
4
+ * that computing one needs (`catalog.ts`).
5
+ */
6
+ /**
7
+ * The `_meta` key carrying the catalog stamp, on every advertised tool and on
8
+ * every tool result.
9
+ *
10
+ * Namespaced, because `_meta` is shared ground: a host, the official SDK and
11
+ * the application all write into it, and a bare `catalog` would eventually mean
12
+ * two things at once.
13
+ */
14
+ export declare const MCP_CATALOG_META_KEY = "stitchkit/catalog";
15
+ /**
16
+ * The HTTP response header carrying the same stamp, as the same JSON object, on the responses
17
+ * of a served surface — `initialize` included. The SDK assembles the `initialize` result
18
+ * itself and leaves no `_meta` to fill, and the header is what lets a client decide whether its
19
+ * stored catalog is current before it asks for `tools/list`.
20
+ */
21
+ export declare const MCP_CATALOG_HEADER = "stitchkit-catalog";
22
+ /**
23
+ * What the server says its advertised catalog currently is.
24
+ *
25
+ * `digest` changes whenever any advertised tool's name, description, input
26
+ * schema, output schema, annotations or UI resource change — and only then. `tools` is the
27
+ * count, carried because it makes a mismatch legible without a second lookup
28
+ * ("they advertise 41, I hold 39").
29
+ */
30
+ export interface McpCatalogStamp {
31
+ digest: string;
32
+ tools: number;
33
+ }
34
+ /** The `_meta` fragment a stamped tool or result carries. */
35
+ export declare function mcpCatalogMeta(stamp: McpCatalogStamp): Record<string, unknown>;
36
+ /** The header value for a stamp — the `_meta` object, serialised. */
37
+ export declare function mcpCatalogHeaderValue(stamp: McpCatalogStamp): string;
38
+ /**
39
+ * Read a catalog stamp out of a peer's `_meta`, or `null` when there is none.
40
+ *
41
+ * Parsed, not trusted: this arrives over the wire from another process, and the
42
+ * fact that it describes a catalog does not exempt it from being validated.
43
+ */
44
+ export declare function readMcpCatalogStamp(meta: unknown): McpCatalogStamp | null;
45
+ /** Read the stamp a response header carries, or `null` when it is absent or malformed. */
46
+ export declare function readMcpCatalogHeader(value: string | null): McpCatalogStamp | null;
47
+ //# sourceMappingURL=catalog-stamp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-stamp.d.ts","sourceRoot":"","sources":["../../../src/tools/mcp/catalog-stamp.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,sBAAsB,CAAC;AAExD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AAEtD;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,6DAA6D;AAC7D,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE9E;AAED,qEAAqE;AACrE,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAGzE;AAED,0FAA0F;AAC1F,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,eAAe,GAAG,IAAI,CAOjF"}
@@ -1,25 +1,5 @@
1
+ import { type McpCatalogStamp } from './catalog-stamp.js';
1
2
  import type { PreparedMcpServerSurface } from './prepare.js';
2
- /**
3
- * The `_meta` key carrying the catalog stamp, on every advertised tool and on
4
- * every tool result.
5
- *
6
- * Namespaced, because `_meta` is shared ground: a host, the official SDK and
7
- * the application all write into it, and a bare `catalog` would eventually mean
8
- * two things at once.
9
- */
10
- export declare const MCP_CATALOG_META_KEY = "stitchkit/catalog";
11
- /**
12
- * What the server says its advertised catalog currently is.
13
- *
14
- * `digest` changes whenever any advertised tool's name, description, input
15
- * schema, output schema or annotations change — and only then. `tools` is the
16
- * count, carried because it makes a mismatch legible without a second lookup
17
- * ("they advertise 41, I hold 39").
18
- */
19
- export interface McpCatalogStamp {
20
- digest: string;
21
- tools: number;
22
- }
23
3
  /**
24
4
  * Fingerprint one advertised MCP catalog.
25
5
  *
@@ -38,15 +18,6 @@ export interface McpCatalogStamp {
38
18
  * it needs no session.
39
19
  */
40
20
  export declare function mcpCatalogStamp(surface: PreparedMcpServerSurface): McpCatalogStamp;
41
- /** The `_meta` fragment a stamped tool or result carries. */
42
- export declare function mcpCatalogMeta(stamp: McpCatalogStamp): Record<string, unknown>;
43
- /**
44
- * Read a catalog stamp out of a peer's `_meta`, or `null` when there is none.
45
- *
46
- * Parsed, not trusted: this arrives over the wire from another process, and the
47
- * fact that it describes a catalog does not exempt it from being validated.
48
- */
49
- export declare function readMcpCatalogStamp(meta: unknown): McpCatalogStamp | null;
50
21
  /**
51
22
  * Attach the stamp to a tool registration, so `tools/list` carries the catalog
52
23
  * the listing came from — the value a consumer stores alongside the tools.
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/tools/mcp/catalog.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,wBAAwB,EAAmB,MAAM,WAAW,CAAC;AAE3E;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,sBAAsB,CAAC;AAExD;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAyBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,wBAAwB,GAAG,eAAe,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type { RuntimeToolDefinition } from '../runtime-tool-declaration.js';
6
6
  import { type McpResourceDef } from './app.js';
7
- import { type McpCatalogStamp } from './catalog.js';
7
+ import type { McpCatalogStamp } from './catalog-stamp.js';
8
8
  import { type McpSchemaValidationConfig, type McpSurfaceRegistry, type PreparedMcpServerSurface, type PreparedMcpSurface, type ValidateMcpSchemasConfig } from './prepare.js';
9
9
  import type { McpRoundRuntime } from './round.js';
10
10
  /**
@@ -156,6 +156,11 @@ export type McpServerBuildConfig<TAuth, TSurfaces extends McpSurfaceRegistry = M
156
156
  */
157
157
  export declare function buildMcpServer(config: McpServerBuildConfig<undefined>): McpServer;
158
158
  export declare function buildMcpServer<TAuth>(config: McpServerBuildConfig<TAuth>, auth: TAuth): McpServer;
159
+ /**
160
+ * The stamp of everything a built server advertises in `tools/list`, or `undefined` when part
161
+ * of it is unknown to Stitchkit (`rawTools`).
162
+ */
163
+ export declare function servedMcpCatalog(server: McpServer): McpCatalogStamp | undefined;
159
164
  /** Build one fresh server from a deterministic surface prepared by its owner. */
160
165
  export declare function buildMcpServerFromPrepared<TAuth>(config: McpServerBuildConfig<TAuth>, auth: TAuth, prepared: PreparedMcpServerSurface): McpServer;
161
166
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../../src/tools/mcp/mount.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAET,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,OAAO,CAAC;AAChE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AS,CAAC;AACnF,wBAAgB,cAAc,CAAC,KAAK,EAClC,MAAM,EAAE,oBAAoB,CAAC,KAAK,CAAC,EACnC,IAAI,EAAE,KAAK,GACV,SAAS,CAAC;AA0Cb;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,GAAG,eAAe,GAAG,SAAS,CAE/E;AAED,iFAAiF;AACjF,wBAAgB,0BAA0B,CAAC,KAAK,EAC9C,MAAM,EAAE,oBAAoB,CAAC,KAAK,CAAC,EACnC,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,wBAAwB,GACjC,SAAS,CAwEX;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI,CAmBlF"}
@@ -4,7 +4,7 @@ import type { ToolExecutionOptions } from '../execute.js';
4
4
  import type { ToolCallHooks } from '../execute-hooks.js';
5
5
  import { type ToolResult } from '../execute-result.js';
6
6
  import type { MountableTool } from '../mount.js';
7
- import { type McpCatalogStamp } from './catalog.js';
7
+ import type { McpCatalogStamp } from './catalog-stamp.js';
8
8
  import type { PreparedMcpTool } from './prepare.js';
9
9
  import { type McpRoundRuntime } from './round.js';
10
10
  /** What the host is told about a tool — contract endpoints and runtime tools alike. */
@@ -1 +1 @@
1
- {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/tools/mcp/register.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,SAAS,EACf,MAAM,8BAA8B,CAAC;AAGtC,OAAO,KAAK,EAA2B,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,KAAK,EAAmB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,KAAK,UAAU,EAAuB,MAAM,mBAAmB,CAAC;AAEzE,OAAO,KAAK,EAAE,aAAa,EA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,CACZ,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,eAAe,CAAC,YAAY,CAAC,EACnC,QAAQ,EAAE,MAAM,KACb,cAAc,CAAC;IACpB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,iBAAiB,CAAC,EAAE,eAAe,CAAC;IACpC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,SAAS,EACjB,YAAY,EAAE,mBAAmB,EACjC,UAAU,EAAE,eAAe,EAC3B,MAAM,EAAE,yBAAyB,GAChC,IAAI,CAiIN"}
@@ -1,7 +1,7 @@
1
1
  import type { CallToolResult, McpServer } from '@modelcontextprotocol/server';
2
2
  import type { ToolCallHooks, ToolLifecycle } from '../execute-hooks.js';
3
3
  import type { ToolResult } from '../execute-result.js';
4
- import type { McpCatalogStamp } from './catalog.js';
4
+ import type { McpCatalogStamp } from './catalog-stamp.js';
5
5
  import type { PreparedRuntimeMcpTool } from './prepare.js';
6
6
  import type { McpRoundRuntime } from './round.js';
7
7
  interface NativeMcpRuntimeConfig {
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/mcp/runtime-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9E,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,UAA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CAAC,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC5D,iBAAiB,CAAC,EAAE,eAAe,CAAC;IACpC,8EAA8E;IAC9E,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,YAAY,EAAE,CACZ,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,sBAAsB,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,EACxD,QAAQ,EAAE,MAAM,KACb,cAAc,CAAC;CACrB;AAaD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,SAAS,sBAAsB,EAAE,EACxC,MAAM,EAAE,sBAAsB,GAC7B,IAAI,CAiCN"}
package/llms/cli.2.txt CHANGED
@@ -64,6 +64,31 @@ Carry the build stamp inside the binary (`CliBuildStampSchema`,
64
64
  `formatCliBuildStamp`) so the tool can say what it is rather than leaving the
65
65
  reader to infer it from behaviour.
66
66
 
67
+ #### A download on a slow link
68
+
69
+ A build is tens of megabytes, and on a slow link that is minutes. `applyCliUpdate` bounds
70
+ the download by silence rather than length: `idleTimeoutMs` (default 30 seconds) ends it
71
+ when nothing has arrived for that long, and `timeoutMs` (default 30 minutes) bounds the
72
+ response headers and, separately, the body. A declared `timeoutMs` keeps meaning exactly that,
73
+ with an idle deadline only when `idleTimeoutMs` is declared too.
74
+
75
+ Give it a `partialPath` in your state directory and an interrupted download continues where
76
+ it stopped:
77
+
78
+ ```ts
79
+ await applyCliUpdate({ asset: check.asset, partialPath: join(stateDir, 'update.part') })
80
+ ```
81
+
82
+ Every received chunk is appended to that file, and `<partialPath>.json` records the URL, the
83
+ build's digest and the server's validator (a strong `ETag`, else `Last-Modified`). The next
84
+ attempt asks for the rest with `Range` and `If-Range`; `206` from the right offset continues
85
+ the file, `200` (the build changed) replaces it, `416` with the full length means it is
86
+ already whole. A part is never trusted: the finished transfer is decoded and checked against
87
+ the manifest like a fresh one, and a continued file that fails — a corrupt part, a build
88
+ re-published under the same URL — is thrown away and downloaded once more from zero. Both
89
+ files are removed once the download is decoded, and `<partialPath>.lock` refuses a second
90
+ update into the same part while one is running. The size ceiling counts the kept part too.
91
+
67
92
  #### A manifest inside your own network
68
93
 
69
94
  The check goes through the same SSRF boundary every outbound fetch does, so a
@@ -467,9 +492,14 @@ const discovered = await mountConnections([
467
492
  token: () => key,
468
493
  transports: ['CLI'], // the opt-in: this server's tools are commands
469
494
  limits: {
470
- discovery: { timeoutMs: 30_000, maxResponseBytes: 4 * 1024 * 1024 },
495
+ discovery: { maxResponseBytes: 4 * 1024 * 1024 }, // 300 s total, 30 s of silence
471
496
  call: { timeoutMs: 120_000 },
472
497
  },
498
+ // Skip tools/list while the stored catalog is the one the server serves.
499
+ catalog: {
500
+ load: async () => JSON.parse(await readFile(catalogPath, 'utf8')),
501
+ store: (entry) => writeFile(catalogPath, JSON.stringify(entry)),
502
+ },
473
503
  }),
474
504
  ])
475
505
  await createCli({ name: 'myapp', version, runtimeTools: discovered, commands: [...] })
@@ -511,13 +541,37 @@ limits. Each logical operation has one deadline, including initial transport
511
541
  negotiation and response-body reading. Legacy endpoint readiness has a discovery
512
542
  deadline; the lifetime of an established SSE stream does not.
513
543
 
514
- Omitted phase fields inherit the existing connection-level `timeoutMs` and
515
- `maxResponseBytes`, whose defaults are 30 seconds and 1 MiB. Values must be positive
516
- safe integers; `timeoutMs` must also fit the runtime timer range. The byte ceiling
544
+ Inside that deadline an operation may have an idle one: `idleTimeoutMs` ends it when
545
+ nothing has arrived for that long — the response headers and every body chunk restart
546
+ it, so a slow link that keeps delivering a large catalog is never cut off, while a
547
+ silent one still ends with `ConnectionTimeoutError` whose `deadline` is `'idle'`. On a
548
+ shared legacy SSE stream any byte is progress for every pending operation.
549
+
550
+ Omitted phase fields inherit the connection-level `timeoutMs` and `maxResponseBytes`.
551
+ With neither set, discovery allows 300 seconds in total and 30 seconds of silence, and
552
+ a call 30 seconds with no idle deadline — a tool may compute in silence before it
553
+ answers, so a call's idle deadline is only what you declare. A declared `timeoutMs`
554
+ keeps meaning exactly that deadline: discovery then has an idle deadline only when you
555
+ declare one too. The byte default is 1 MiB.
556
+ Values must be positive safe integers; deadlines must also fit the runtime timer range. The byte ceiling
517
557
  counts raw UTF-8 body bytes, including SSE framing, regardless of `Content-Length`.
518
558
  Pending legacy calls also count comments and wrong-id frames. `budget.maxTools`
519
559
  and `budget.maxSchemaBytes` remain separate mount limits.
520
560
 
561
+ **A stored catalog is mounted while it is current.** A Stitchkit server sends its
562
+ [catalog stamp](./mcp-and-agents.md#knowing-your-catalog-is-stale--the-catalog-stamp) with
563
+ the `initialize` answer, as the `stitchkit-catalog` response header. Given a `catalog:
564
+ { load, store }`, the connection compares it with the stamp of the stored `tools/list`
565
+ result and mounts the stored one when they match — every stored tool must carry the same
566
+ stamp, and there must be as many — so a start costs no catalog transfer. A different
567
+ stamp (the server's contract moved, or the credential sees another surface) lists and
568
+ stores again. A listing is stored only when every tool in it carries the stamp the
569
+ `initialize` answer announced, so a rolling deploy answering the two requests from
570
+ different builds stores nothing. A server without a stamp, a surface with raw SDK tools
571
+ and a failing `load` or `store` all cost one `tools/list`, never the mount. The stamp
572
+ covers what `tools/list` publishes as Stitchkit builds it; the JSON Schema text the
573
+ server's MCP SDK renders from the same schema is not hashed separately.
574
+
521
575
  Only the initial `initialize` can negotiate HTTP-to-legacy fallback on 400, 404
522
576
  or 405. A failed `tools/call` is not replayed. Caller cancellation preserves its
523
577
  original reason for in-process observers.
@@ -637,7 +691,7 @@ SDK nor the `ai` peer.
637
691
  | `CliProfileError` | class | an `AppError` refusing a named profile that is missing, unreadable or shared between users |
638
692
  | `renderCliInstaller` | function | generate the one-line installer from a build manifest, with the URL and digest substituted — [guide](../guide/cli.md#distribution-and-self-update) |
639
693
  | `checkCliUpdate` | function | bounded, interval-limited, never-throwing check for a newer published build |
640
- | `applyCliUpdate` | function | download, verify the decompressed digest and replace the binary by rename |
694
+ | `applyCliUpdate` | function | download, verify the decompressed digest and replace the binary by rename; with `partialPath` an interrupted download continues with `Range`/`If-Range`, and a continued file that fails its checks is downloaded once more from zero |
641
695
  | `assertCliPublishable` | function | refuse republishing one version from a different commit — takes one manifest or every manifest already published, because the promise a version makes does not stop at a channel boundary |
642
696
  | `rollbackCliUpdate` / `CliRollbackConfig` / `RolledBackCliUpdate` | function / _types_ | put the kept previous build back, digest-checked first and written by the same atomic rename the update uses |
643
697
  | `signCliManifest` / `verifyCliManifest` / `cliManifestSigningPayload` | function | Ed25519 over `{name, version, commit, builtAt, assets[]}` — every asset's digest included, so the chain closes on the file that executes |
@@ -653,7 +707,7 @@ SDK nor the `ai` peer.
653
707
  | `CliBuildStampSchema` / `CliBuildStamp` | schema / _type_ | the version/commit/build time carried inside a binary |
654
708
  | `CliInstallerConfig` | _type_ | manifest, binary name, default install directory, and an optional `asset` — omit it for one script that selects the target by `uname` |
655
709
  | `CliUpdateCheckConfig` / `CliUpdateCheck` | _type_ | check inputs, and its four answers — `skipped`, `current`, `outdated`, `unknown` |
656
- | `CliUpdateApplyConfig` / `AppliedCliUpdate` | _type_ | apply inputs — including `verify`, run on an executable candidate beside the target before the backup and the replacement, within `verifyTimeoutMs` — and the replaced path, byte count and digest |
710
+ | `CliUpdateApplyConfig` / `AppliedCliUpdate` | _type_ | apply inputs — including `verify`, run on an executable candidate beside the target before the backup and the replacement, within `verifyTimeoutMs`; `timeoutMs` (default 30 minutes) and `idleTimeoutMs` (default 30 s of silence when `timeoutMs` is not declared); `partialPath` for a resumable download — and the replaced path, byte count and digest |
657
711
  | `CliProfileStore` / `CliProfileStoreConfig` / `ResolvedCliProfile` | _type_ | the profile store, its directory/schema/hint config, and one resolution |
658
712
  | `CliResultView` | _type_ | the requested view — `count`, `sum`, or `records` (ordered and/or table-rendered) |
659
713
  | `CliViewOutput` | _type_ | a JSON value, or the one human-facing text shape |
@@ -501,6 +501,12 @@ body until it ends or is cancelled. This is the same for a Fetch-config client,
501
501
  Unix transport. Cancelling a quiet stream therefore releases its server source
502
502
  and transport connection instead of only settling the local iterator.
503
503
 
504
+ A stream is read from any response whose `body` has `getReader()`, not only from
505
+ the global `Response` class: a `fetch` of another runtime — `expo/fetch` in
506
+ React Native, which answers with its own `FetchResponse` — streams the same way.
507
+ A response without a readable body is refused with `Streaming endpoint did not
508
+ return a Response`.
509
+
504
510
  An established NDJSON protocol may keep its item schema as the complete wire
505
511
  frame. This mode requires a terminal item because an unwrapped response has no
506
512
  separate safe error/end envelope:
@@ -88,7 +88,7 @@ The browser-and-server entrypoint. Re-exports everything from
88
88
  | `parseNDJSON` | function | parse bounded fatal-UTF-8 NDJSON from a `Response`, a `ReadableStream<Uint8Array>` or an `AsyncIterable<Uint8Array>` (a child's stdout); blank keep-alives are skipped, `finalLine: 'require-newline'` makes the delimiter mandatory and `signal` cancels the source — [guide](../guide/client.md#any-byte-source) |
89
89
  | `createNDJSONDecoder` / `NDJSONDecoder` | function / _type_ | the same bounded NDJSON reading driven by `push(chunk)` / `end()`, for a socket `data` callback |
90
90
  | `readBoundedBody` / `BoundedBodyOptions` | function / _type_ | the whole body of a `ReadableStream<Uint8Array>` or async byte iterable as bytes, never reading past `maxBytes` plus one chunk; `limitError(observedBytes)` and `abortError(reason)` choose the two errors, the source is cancelled on both, a `null` body is empty — [guide](../guide/client.md#reading-a-body-up-to-a-byte-limit) |
91
- | `StreamByteSource` | _type_ | `Response \| ReadableStream<Uint8Array> \| AsyncIterable<Uint8Array>`, what the NDJSON and SSE readers accept |
91
+ | `StreamByteSource` | _type_ | `Response \| ReadableStream<Uint8Array> \| AsyncIterable<Uint8Array>`, what the NDJSON and SSE readers accept; each is recognised by its shape, not its class — a reader, `Symbol.asyncIterator`, else the response's `body` — so another runtime's fetch response (`expo/fetch`) reads like the global `Response` |
92
92
  | `StreamLineLimitError` / `StreamTruncatedLineError` | class | a line past `maxLineBytes` (`limitBytes`, `lineBytes`; a `RangeError`) and a source ended inside a line under `require-newline` (`lineBytes`; a `SyntaxError`) |
93
93
  | `resumableIterator` | function | re-open a long-lived stream from the last delivered cursor, with jittered backoff, a caller-owned terminal item and prompt abort — [guide](../guide/client.md#resumable-streams) |
94
94
  | `createBackoff` | function | exponential backoff with subtractive jitter as a value: `next()` / `reset()` |
@@ -23,9 +23,11 @@ and approval path.
23
23
  | Export | Kind | Summary |
24
24
  |--------|------|---------|
25
25
  | `defineMcpClientConnection` | function | declare one external MCP server connection over Streamable HTTP with an optional SSE fallback |
26
- | `ConnectionOperationLimits` / `McpConnectionLimits` | _type_ | positive finite deadline/raw byte ceilings with independent discovery/call overrides; omitted fields inherit the shared bounds |
26
+ | `ConnectionOperationLimits` / `McpConnectionLimits` | _type_ | positive finite deadline, idle deadline (`idleTimeoutMs`: nothing arrived for that long — headers and every chunk restart it) and raw byte ceilings with independent discovery/call overrides; omitted fields inherit the shared bounds, and discovery with no declared `timeoutMs` allows 300 s in total and 30 s of silence while a call keeps 30 s and no idle deadline; a declared `timeoutMs` has an idle deadline only when one is declared too |
27
27
  | `ConnectionPhase` / `ConnectionOperation` / `ConnectionFailureContext` | _type_ | closed operation/phase vocabulary and measured read context for existing typed connection errors |
28
- | `ConnectionTimeoutError` / `ConnectionResponseTooLargeError` | class | bounded operation refusal, with phase, operation and finite observed bytes; safe tool projection retains the raw cause locally |
28
+ | `ConnectionTimeoutError` / `ConnectionResponseTooLargeError` | class | bounded operation refusal, with phase, operation and finite observed bytes — a timeout also says which `deadline` fired (`'total'` or `'idle'`, with `timeoutMs` the limit that fired); safe tool projection retains the raw cause locally |
29
+ | `ConnectionDeadline` / `ConnectionTimeoutContext` | _type_ | `'total' \| 'idle'`, and a timeout's diagnostics with the deadline that fired (default `'total'`) |
30
+ | `McpConnectionCatalogStore` / `McpConnectionCatalogEntry` | _type_ | `{ load, store }` the application gives a connection's `catalog`, and the `{ stamp, result }` it keeps: when the server's `initialize` answer carries a catalog stamp (a Stitchkit server's does), a stored `tools/list` result whose stamp — and every tool's — matches is mounted without listing; anything else lists and stores again, and a failing store is a miss |
29
31
  | `defineOpenApiConnection` | function | declare one OpenAPI document (object, JSON text or JSON URL) as a tool surface |
30
32
  | `mountConnections` | function | discover every connection and return readonly `RuntimeToolDefinition`s for `mountAgent`; reported structural failures and bounds stay local, while unions and string-format/pattern refusals (including inside record keys) are judged by the server that owns the original schema (ADR 0266, ADR 0272) |
31
33
  | `ConnectionAuthorizationRequiredError` | class | typed reauthorization signal raised on `401` with credentials resolved again on the next call |
@@ -39,7 +41,7 @@ and approval path.
39
41
  | `ConnectionToolSkipReporter` | _type_ | `(skipped) => void` — called per discovered tool the mount could not build; defaults to a stderr line, and the rest of the surface still mounts |
40
42
  | `SkippedConnectionTool` | _type_ | `{ connection, tool, reason }` — which tool was not mounted, and why |
41
43
  | `McpClientConnection` | _type_ | a defined MCP client connection |
42
- | `McpClientConnectionConfig` | _type_ | name, transport, tool filter, token provider, instance key, allowed hosts and `transports` — naming `['CLI']` makes the whole server's discovered tools commands, with no per-definition rewriting |
44
+ | `McpClientConnectionConfig` | _type_ | name, transport, tool filter, token provider, instance key, allowed hosts, bounds, `catalog` store and `transports` — naming `['CLI']` makes the whole server's discovered tools commands, with no per-definition rewriting |
43
45
  | `McpConnectionTransport` | _type_ | `{ url, headers? }` for one MCP endpoint |
44
46
  | `McpToolFilter` | _type_ | `{ allow?, block? }` discovered-tool filter |
45
47
  | `OpenApiConnection` | _type_ | a defined OpenAPI connection |
@@ -25,7 +25,7 @@ payload. See [MCP guide](../guide/mcp-and-agents.md#mcp--createmcphandler).
25
25
 
26
26
  | Export | Kind | Purpose |
27
27
  |--------|------|---------|
28
- | `createMcpHandler` | function | a stateless dual-era Streamable-HTTP MCP handler — [guide](../guide/mcp-and-agents.md#mcp--createmcphandler) |
28
+ | `createMcpHandler` | function | a stateless dual-era Streamable-HTTP MCP handler; each response carries the served surface's catalog stamp as the `stitchkit-catalog` header (none with `rawTools`) — [guide](../guide/mcp-and-agents.md#mcp--createmcphandler) |
29
29
  | `createMcpHttpRoute` | function | framework-owned `RawRoute` adapter for an MCP HTTP handler |
30
30
  | `createStdioMcpServer` | function | a complete stdio MCP server — [guide](../guide/mcp-and-agents.md#mcp-over-stdio--createstdiomcpserver) |
31
31
  | `bindStdioProcessSignals` | function | explicitly bind OS signals to one close-only stdio handle — [guide](../guide/testing-and-deployment.md#stdio-process-signals) |
@@ -69,7 +69,10 @@ retained session to push `notifications/tools/list_changed` down; the stamp need
69
69
  Store the stamp beside the tools when you list them, compare it against the one on every
70
70
  result, and re-list when they differ — including on a refusal, which is exactly when a
71
71
  stale catalog is the likeliest explanation and the least visible one. The server side
72
- needs no wiring: every mount stamps what it advertises.
72
+ needs no wiring: every mount stamps what it advertises — each tool's name, description,
73
+ schemas, annotations and `ui` resource — and `createMcpHandler` sends the same stamp as the
74
+ `stitchkit-catalog` response header, `initialize` included, which is what a connection's
75
+ `catalog` store is checked against before `tools/list`.
73
76
 
74
77
  | Export | Kind | Summary |
75
78
  |--------|------|---------|
package/llms/tools.txt CHANGED
@@ -313,9 +313,16 @@ same problem and `createMcpHandler` cannot send it: it is stateless by
313
313
  construction, so there is no retained session to push down.
314
314
 
315
315
  The digest covers each advertised tool's name, description, input schema, output
316
- schema and annotations, and nothing else — it moves when the contract moves and
317
- not when a handler does. Raw SDK registrations stay consumer-owned and are
318
- outside it.
316
+ schema, annotations and MCP Apps `ui` resource, and nothing else — it moves when the
317
+ contract moves and not when a handler does. Raw SDK registrations stay consumer-owned
318
+ and are outside it, so a handler with `rawTools` sends no stamp header.
319
+
320
+ `createMcpHandler` also sends the stamp of the surface each request was served from as
321
+ the `stitchkit-catalog` response header (the same `{ digest, tools }` JSON), on the
322
+ `initialize` answer included — the SDK assembles that result itself and leaves no
323
+ `_meta` to fill. A client can therefore tell whether its stored catalog is current
324
+ before it asks for `tools/list`; `defineMcpClientConnection({ catalog })` does exactly
325
+ that ([CLI → commands discovered from a running server](./cli.md#commands-discovered-from-a-running-server)).
319
326
 
320
327
  ### Saying which tools only read — `readOnlyHint`
321
328