stitchkit 0.112.2 → 0.112.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/entrypoints/agent-runtime/coding-tools.js +3 -3
  3. package/dist/entrypoints/agent-runtime/harness.js +4 -4
  4. package/dist/entrypoints/agent-runtime/sandbox.js +3 -3
  5. package/dist/entrypoints/agent-runtime/sqlite/bun.js +5 -5
  6. package/dist/entrypoints/agent-runtime/sqlite/node.js +5 -5
  7. package/dist/entrypoints/agent-runtime/testing.js +5 -5
  8. package/dist/entrypoints/agent-runtime.js +10 -10
  9. package/dist/entrypoints/cli.js +6 -6
  10. package/dist/entrypoints/testing.js +1 -1
  11. package/dist/entrypoints/tools/connections.js +6 -6
  12. package/dist/entrypoints/tools/invoker.js +4 -4
  13. package/dist/entrypoints/tools/mcp.js +6 -6
  14. package/dist/entrypoints/tools.js +9 -9
  15. package/dist/{index-jfk93gja.js → index-4dh3hfs7.js} +3 -3
  16. package/dist/{index-651xsm48.js → index-54q2mghq.js} +4 -4
  17. package/dist/{index-c7h371gr.js → index-5jjda9a4.js} +4 -4
  18. package/dist/{index-a0vj9edp.js → index-b9yqb9e7.js} +1 -1
  19. package/dist/{index-fh2ht88b.js → index-c9vpsxw4.js} +1 -1
  20. package/dist/{index-n0adphfg.js → index-dsxrcseb.js} +1 -1
  21. package/dist/{index-hvg9hctd.js → index-eddzs589.js} +3 -3
  22. package/dist/{index-38gvr73z.js → index-f2p949ax.js} +1 -1
  23. package/dist/{index-bd7spznx.js → index-gpbk7yse.js} +4 -4
  24. package/dist/{index-h7accrrv.js → index-jgwqc38k.js} +66 -6
  25. package/dist/{index-d4cnhfdn.js → index-kenvdagc.js} +1 -1
  26. package/dist/{index-ff3agzaf.js → index-nk1mh535.js} +1 -1
  27. package/dist/{index-02h0dfpr.js → index-z4ga1fa1.js} +1 -1
  28. package/dist/{index-vqdjym30.js → index-zm1k7hhv.js} +2 -2
  29. package/dist/json-schema/dialect.d.ts +12 -10
  30. package/dist/json-schema/dialect.d.ts.map +1 -1
  31. package/dist/tools/schema/presentation.d.ts +4 -3
  32. package/dist/tools/schema/presentation.d.ts.map +1 -1
  33. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -15,6 +15,13 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
15
15
 
16
16
  ## [Unreleased]
17
17
 
18
+ ## [0.112.3] - 2026-10-26
19
+
20
+ ### Fixed
21
+
22
+ - `stitchkit/tools/mcp`, `stitchkit/tools/connections` — a tool whose input holds a `z.tuple` is now served as a valid 2020-12 schema: the tuple is written as `prefixItems` (rest as `items`) instead of draft-07's `items` list, which Claude's MCP client refused (`must be object,boolean`) and dropped the tool without a server-side error. The stitchkit MCP client reads a tuple from an older server's document with the same meaning. → ADR 0270
23
+ **Affects:** `stitchkit/tools/mcp` behaviour; `stitchkit/tools/connections` behaviour
24
+
18
25
  ## [0.112.2] - 2026-10-25
19
26
 
20
27
  ### Added
@@ -1,17 +1,17 @@
1
1
  import"../../index-ct75c3at.js";
2
- import"../../index-h7accrrv.js";
2
+ import"../../index-jgwqc38k.js";
3
3
  import"../../index-fynr93w4.js";
4
4
  import {
5
5
  AgentCodingToolLimitsSchema2,
6
6
  AgentCodingToolAuthorizationSchema2,
7
7
  AgentCodingToolPathAuthorizationSchema2,
8
8
  createAgentCodingTools2
9
- } from "../../index-n0adphfg.js";
9
+ } from "../../index-dsxrcseb.js";
10
10
  import"../../index-2kbysk9s.js";
11
11
  import"../../index-84bf5spd.js";
12
12
  import"../../index-7r4knwf8.js";
13
13
  import"../../index-zrtrjkbf.js";
14
- import"../../index-ff3agzaf.js";
14
+ import"../../index-nk1mh535.js";
15
15
  export {
16
16
  AgentCodingToolAuthorizationSchema2 as AgentCodingToolAuthorizationSchema,
17
17
  AgentCodingToolLimitsSchema2 as AgentCodingToolLimitsSchema,
@@ -5,15 +5,15 @@ import"../../index-8kzct1d6.js";
5
5
  import {
6
6
  composeAgentPrompt2,
7
7
  createAgentRuntime2
8
- } from "../../index-a0vj9edp.js";
8
+ } from "../../index-b9yqb9e7.js";
9
9
  import"../../index-qaet40b2.js";
10
10
  import"../../index-mnkk1ffz.js";
11
11
  import"../../index-fynr93w4.js";
12
12
  import"../../index-epmnrnth.js";
13
13
  import"../../index-jy9wq8tp.js";
14
14
  import"../../index-ct75c3at.js";
15
- import"../../index-h7accrrv.js";
16
- import"../../index-02h0dfpr.js";
15
+ import"../../index-jgwqc38k.js";
16
+ import"../../index-z4ga1fa1.js";
17
17
  import"../../index-snef22zr.js";
18
18
  import"../../index-56yx8dxp.js";
19
19
  import"../../index-jna0ejsa.js";
@@ -29,7 +29,7 @@ import {
29
29
  } from "../../index-zrtrjkbf.js";
30
30
  import {
31
31
  defineRuntimeTool2
32
- } from "../../index-ff3agzaf.js";
32
+ } from "../../index-nk1mh535.js";
33
33
 
34
34
  // src/agent-runtime/harness-contract.ts
35
35
  import { z } from "zod";
@@ -3,9 +3,9 @@ import {
3
3
  missingSandboxRestrictions2,
4
4
  codingRefusal,
5
5
  createAgentCodingTools2
6
- } from "../../index-n0adphfg.js";
6
+ } from "../../index-dsxrcseb.js";
7
7
  import"../../index-ct75c3at.js";
8
- import"../../index-h7accrrv.js";
8
+ import"../../index-jgwqc38k.js";
9
9
  import"../../index-fynr93w4.js";
10
10
  import"../../index-2kbysk9s.js";
11
11
  import {
@@ -25,7 +25,7 @@ import {
25
25
  import {
26
26
  MAX_TIMER_MS
27
27
  } from "../../index-eemvahkc.js";
28
- import"../../index-ff3agzaf.js";
28
+ import"../../index-nk1mh535.js";
29
29
 
30
30
  // src/agent-runtime/sandbox-bubblewrap.ts
31
31
  import { mkdir as mkdir2, mkdtemp, realpath, rm as rm2 } from "node:fs/promises";
@@ -1,22 +1,22 @@
1
1
  import"../../../index-jna0ejsa.js";
2
- import"../../../index-38gvr73z.js";
2
+ import"../../../index-f2p949ax.js";
3
3
  import"../../../index-8kzct1d6.js";
4
4
  import {
5
5
  initializeAgentRuntimeSqlite2,
6
6
  createSqliteAgentRuntimeStore2
7
- } from "../../../index-fh2ht88b.js";
7
+ } from "../../../index-c9vpsxw4.js";
8
8
  import"../../../index-kqnd6a85.js";
9
9
  import"../../../index-5w6t91ze.js";
10
- import"../../../index-n0adphfg.js";
10
+ import"../../../index-dsxrcseb.js";
11
11
  import"../../../index-ct75c3at.js";
12
- import"../../../index-h7accrrv.js";
12
+ import"../../../index-jgwqc38k.js";
13
13
  import"../../../index-fynr93w4.js";
14
14
  import"../../../index-2kbysk9s.js";
15
15
  import"../../../index-84bf5spd.js";
16
16
  import"../../../index-7r4knwf8.js";
17
17
  import"../../../index-snef22zr.js";
18
18
  import"../../../index-zrtrjkbf.js";
19
- import"../../../index-ff3agzaf.js";
19
+ import"../../../index-nk1mh535.js";
20
20
 
21
21
  // src/agent-runtime/sqlite-bun.ts
22
22
  import { Database } from "bun:sqlite";
@@ -1,22 +1,22 @@
1
1
  import"../../../index-jna0ejsa.js";
2
- import"../../../index-38gvr73z.js";
2
+ import"../../../index-f2p949ax.js";
3
3
  import"../../../index-8kzct1d6.js";
4
4
  import {
5
5
  initializeAgentRuntimeSqlite2,
6
6
  createSqliteAgentRuntimeStore2
7
- } from "../../../index-fh2ht88b.js";
7
+ } from "../../../index-c9vpsxw4.js";
8
8
  import"../../../index-kqnd6a85.js";
9
9
  import"../../../index-5w6t91ze.js";
10
- import"../../../index-n0adphfg.js";
10
+ import"../../../index-dsxrcseb.js";
11
11
  import"../../../index-ct75c3at.js";
12
- import"../../../index-h7accrrv.js";
12
+ import"../../../index-jgwqc38k.js";
13
13
  import"../../../index-fynr93w4.js";
14
14
  import"../../../index-2kbysk9s.js";
15
15
  import"../../../index-84bf5spd.js";
16
16
  import"../../../index-7r4knwf8.js";
17
17
  import"../../../index-snef22zr.js";
18
18
  import"../../../index-zrtrjkbf.js";
19
- import"../../../index-ff3agzaf.js";
19
+ import"../../../index-nk1mh535.js";
20
20
 
21
21
  // src/agent-runtime/sqlite-node.ts
22
22
  import { DatabaseSync } from "node:sqlite";
@@ -10,10 +10,10 @@ import {
10
10
  advanceToolChronology
11
11
  } from "../../index-jna0ejsa.js";
12
12
  import"../../index-5w6t91ze.js";
13
- import"../../index-n0adphfg.js";
14
- import"../../index-38gvr73z.js";
13
+ import"../../index-dsxrcseb.js";
14
+ import"../../index-f2p949ax.js";
15
15
  import"../../index-ct75c3at.js";
16
- import"../../index-h7accrrv.js";
16
+ import"../../index-jgwqc38k.js";
17
17
  import"../../index-fynr93w4.js";
18
18
  import"../../index-2kbysk9s.js";
19
19
  import"../../index-84bf5spd.js";
@@ -21,12 +21,12 @@ import"../../index-7r4knwf8.js";
21
21
  import"../../index-snef22zr.js";
22
22
  import {
23
23
  createMemoryAgentRuntimeStore2
24
- } from "../../index-d4cnhfdn.js";
24
+ } from "../../index-kenvdagc.js";
25
25
  import"../../index-zrtrjkbf.js";
26
26
  import {
27
27
  assertPositiveSafeInteger
28
28
  } from "../../index-0s4xebbg.js";
29
- import"../../index-ff3agzaf.js";
29
+ import"../../index-nk1mh535.js";
30
30
 
31
31
  // src/agent-runtime/fault-bench.ts
32
32
  import { createServer } from "node:http";
@@ -5,7 +5,7 @@ import {
5
5
  missingSandboxRestrictions2,
6
6
  recordAgentSandboxProbe2,
7
7
  refuseUnknownSpillReference
8
- } from "../index-n0adphfg.js";
8
+ } from "../index-dsxrcseb.js";
9
9
  import {
10
10
  AgentRecordIdSchema2,
11
11
  AgentRecordVersionSchema2,
@@ -58,7 +58,7 @@ import {
58
58
  AgentHistoryMutationSchema2,
59
59
  ACTIVE_AGENT_RUN_STATES2,
60
60
  createAgentRuntimeStore2
61
- } from "../index-38gvr73z.js";
61
+ } from "../index-f2p949ax.js";
62
62
  import {
63
63
  AgentStoreEventKindSchema2,
64
64
  AgentStoreEventEnvelopeSchema2,
@@ -123,7 +123,7 @@ import {
123
123
  agentGoalStateSlot2,
124
124
  agentTodoStateSlot2,
125
125
  createAgentRuntime2
126
- } from "../index-a0vj9edp.js";
126
+ } from "../index-b9yqb9e7.js";
127
127
  import {
128
128
  AgentConversationSummarySchema2,
129
129
  AgentConversationPageSchema2,
@@ -133,13 +133,13 @@ import"../index-fynr93w4.js";
133
133
  import"../index-epmnrnth.js";
134
134
  import"../index-jy9wq8tp.js";
135
135
  import"../index-ct75c3at.js";
136
- import"../index-h7accrrv.js";
137
- import"../index-02h0dfpr.js";
138
- import"../index-vqdjym30.js";
136
+ import"../index-jgwqc38k.js";
137
+ import"../index-z4ga1fa1.js";
138
+ import"../index-zm1k7hhv.js";
139
139
  import {
140
140
  mountAgent2,
141
141
  buildToolManifest2
142
- } from "../index-c7h371gr.js";
142
+ } from "../index-5jjda9a4.js";
143
143
  import {
144
144
  createBoundedSinkManager
145
145
  } from "../index-qaet40b2.js";
@@ -191,7 +191,7 @@ import"../index-84bf5spd.js";
191
191
  import"../index-7r4knwf8.js";
192
192
  import {
193
193
  createMemoryAgentRuntimeStore2
194
- } from "../index-d4cnhfdn.js";
194
+ } from "../index-kenvdagc.js";
195
195
  import {
196
196
  createAgentRuntimeEventSink2
197
197
  } from "../index-616xh7f2.js";
@@ -202,11 +202,11 @@ import {
202
202
  import {
203
203
  assertPositiveSafeInteger
204
204
  } from "../index-0s4xebbg.js";
205
- import"../index-hvg9hctd.js";
205
+ import"../index-eddzs589.js";
206
206
  import {
207
207
  defineRuntimeTool2,
208
208
  executableAgentRuntimeTools
209
- } from "../index-ff3agzaf.js";
209
+ } from "../index-nk1mh535.js";
210
210
  import {
211
211
  createTraceContext2,
212
212
  childSpan2
@@ -16,12 +16,12 @@ import {
16
16
  renderCliView2,
17
17
  pollUntilDone2,
18
18
  createCli2
19
- } from "../index-bd7spznx.js";
19
+ } from "../index-gpbk7yse.js";
20
20
  import"../index-fynr93w4.js";
21
21
  import"../index-ct75c3at.js";
22
- import"../index-h7accrrv.js";
23
- import"../index-02h0dfpr.js";
24
- import"../index-vqdjym30.js";
22
+ import"../index-jgwqc38k.js";
23
+ import"../index-z4ga1fa1.js";
24
+ import"../index-zm1k7hhv.js";
25
25
  import {
26
26
  CliBuildSignatureSchema2,
27
27
  cliManifestSigningPayload2,
@@ -44,8 +44,8 @@ import {
44
44
  import {
45
45
  writeFileAtomicSync2
46
46
  } from "../index-07dcf2yn.js";
47
- import"../index-hvg9hctd.js";
48
- import"../index-ff3agzaf.js";
47
+ import"../index-eddzs589.js";
48
+ import"../index-nk1mh535.js";
49
49
  import {
50
50
  safeJsonParse
51
51
  } from "../index-zsarb5xp.js";
@@ -30,7 +30,7 @@ import {
30
30
  projectToolSurface,
31
31
  mcpProjectionCandidate,
32
32
  prepareProjectedMcpTools
33
- } from "../index-h7accrrv.js";
33
+ } from "../index-jgwqc38k.js";
34
34
  import"../index-fynr93w4.js";
35
35
  import {
36
36
  createClient2,
@@ -1,8 +1,8 @@
1
1
  import"../../index-ct75c3at.js";
2
2
  import {
3
3
  declaresDraft07,
4
- withDefsDialect
5
- } from "../../index-h7accrrv.js";
4
+ withDraft2020Keywords
5
+ } from "../../index-jgwqc38k.js";
6
6
  import"../../index-fynr93w4.js";
7
7
  import {
8
8
  markJsonSchemaObjectGuards,
@@ -26,7 +26,7 @@ import {
26
26
  } from "../../index-0s4xebbg.js";
27
27
  import {
28
28
  defineRuntimeTool2
29
- } from "../../index-ff3agzaf.js";
29
+ } from "../../index-nk1mh535.js";
30
30
  import {
31
31
  TOOL_ERROR_PROJECTION
32
32
  } from "../../index-556g5hsh.js";
@@ -844,7 +844,7 @@ async function withConnectionToken(params, body) {
844
844
  function zodObjectFromJsonSchema(schema) {
845
845
  if (!schema || Object.keys(schema).length === 0)
846
846
  return z.looseObject({});
847
- const parsed = z.fromJSONSchema(reconcileDefinitionKeyword(schema));
847
+ const parsed = z.fromJSONSchema(reconcileDialect(schema));
848
848
  if (parsed instanceof z.ZodObject) {
849
849
  markJsonSchemaObjectGuards(parsed);
850
850
  markRemoteUnionVerdict(parsed);
@@ -852,8 +852,8 @@ function zodObjectFromJsonSchema(schema) {
852
852
  }
853
853
  return z.looseObject({});
854
854
  }
855
- function reconcileDefinitionKeyword(schema) {
856
- return declaresDraft07(schema.$schema) ? schema : withDefsDialect(schema);
855
+ function reconcileDialect(schema) {
856
+ return declaresDraft07(schema.$schema) ? schema : withDraft2020Keywords(schema);
857
857
  }
858
858
  function sanitizeToolName(value) {
859
859
  return value.replace(/[^a-zA-Z0-9_-]+/g, "_").replace(/^_+|_+$/g, "") || "operation";
@@ -2,12 +2,12 @@ import"../../index-fynr93w4.js";
2
2
  import"../../index-epmnrnth.js";
3
3
  import"../../index-jy9wq8tp.js";
4
4
  import"../../index-ct75c3at.js";
5
- import"../../index-h7accrrv.js";
6
- import"../../index-02h0dfpr.js";
7
- import"../../index-vqdjym30.js";
5
+ import"../../index-jgwqc38k.js";
6
+ import"../../index-z4ga1fa1.js";
7
+ import"../../index-zm1k7hhv.js";
8
8
  import {
9
9
  createToolInvoker2
10
- } from "../../index-jfk93gja.js";
10
+ } from "../../index-4dh3hfs7.js";
11
11
  export {
12
12
  createToolInvoker2 as createToolInvoker
13
13
  };
@@ -2,9 +2,9 @@ import"../../index-ct75c3at.js";
2
2
  import"../../index-fynr93w4.js";
3
3
  import"../../index-epmnrnth.js";
4
4
  import"../../index-jy9wq8tp.js";
5
- import"../../index-h7accrrv.js";
6
- import"../../index-02h0dfpr.js";
7
- import"../../index-vqdjym30.js";
5
+ import"../../index-jgwqc38k.js";
6
+ import"../../index-z4ga1fa1.js";
7
+ import"../../index-zm1k7hhv.js";
8
8
  import {
9
9
  RESOURCE_MIME_TYPE2,
10
10
  EXT_APPS_BUNDLE_PLACEHOLDER2,
@@ -20,9 +20,9 @@ import {
20
20
  createMcpHttpRoute2,
21
21
  createStdioMcpServer2,
22
22
  bindStdioProcessSignals2
23
- } from "../../index-651xsm48.js";
24
- import"../../index-hvg9hctd.js";
25
- import"../../index-ff3agzaf.js";
23
+ } from "../../index-54q2mghq.js";
24
+ import"../../index-eddzs589.js";
25
+ import"../../index-nk1mh535.js";
26
26
  export {
27
27
  EXT_APPS_BUNDLE_PLACEHOLDER2 as EXT_APPS_BUNDLE_PLACEHOLDER,
28
28
  MCP_CATALOG_META_KEY2 as MCP_CATALOG_META_KEY,
@@ -21,19 +21,19 @@ import {
21
21
  findNonPortableFormats2,
22
22
  flattenToolJsonSchema2,
23
23
  findUntypedProperties2
24
- } from "../index-h7accrrv.js";
24
+ } from "../index-jgwqc38k.js";
25
25
  import {
26
26
  ToolExecutionControlError2,
27
27
  isToolExecutionControlError2
28
- } from "../index-02h0dfpr.js";
28
+ } from "../index-z4ga1fa1.js";
29
29
  import {
30
30
  collectTools2
31
- } from "../index-vqdjym30.js";
31
+ } from "../index-zm1k7hhv.js";
32
32
  import {
33
33
  mountAgent2,
34
34
  describeToolCatalog2,
35
35
  buildToolManifest2
36
- } from "../index-c7h371gr.js";
36
+ } from "../index-5jjda9a4.js";
37
37
  import"../index-m38ej7e5.js";
38
38
  import {
39
39
  ALL_TRANSPORTS2,
@@ -60,7 +60,7 @@ import {
60
60
  createMcpHttpRoute2,
61
61
  createStdioMcpServer2,
62
62
  bindStdioProcessSignals2
63
- } from "../index-651xsm48.js";
63
+ } from "../index-54q2mghq.js";
64
64
  import {
65
65
  AsyncOperationCancelResultSchema2,
66
66
  createAsyncOperationSnapshotSchema2,
@@ -74,7 +74,7 @@ import {
74
74
  WaitTimeoutError,
75
75
  runWaitOperation,
76
76
  createCli2
77
- } from "../index-bd7spznx.js";
77
+ } from "../index-gpbk7yse.js";
78
78
  import {
79
79
  ManagedFilePathSchema2,
80
80
  ManagedFileRefSchema2
@@ -89,7 +89,7 @@ import {
89
89
  } from "../index-pzw0fpek.js";
90
90
  import {
91
91
  createToolInvoker2
92
- } from "../index-jfk93gja.js";
92
+ } from "../index-4dh3hfs7.js";
93
93
  import {
94
94
  ManagedFileError2
95
95
  } from "../index-2f9r0jgr.js";
@@ -111,14 +111,14 @@ import {
111
111
  } from "../index-yk4g8805.js";
112
112
  import {
113
113
  collectToolSurface
114
- } from "../index-hvg9hctd.js";
114
+ } from "../index-eddzs589.js";
115
115
  import {
116
116
  getTraceId2
117
117
  } from "../index-r6v4mc67.js";
118
118
  import {
119
119
  defineRuntimeTool2,
120
120
  createRuntimeToolFactory2
121
- } from "../index-ff3agzaf.js";
121
+ } from "../index-nk1mh535.js";
122
122
  import {
123
123
  formatZodError2
124
124
  } from "../index-1eeqpadm.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  assertUniqueToolName
3
- } from "./index-h7accrrv.js";
3
+ } from "./index-jgwqc38k.js";
4
4
  import {
5
5
  toolErrorFromResult
6
- } from "./index-02h0dfpr.js";
6
+ } from "./index-z4ga1fa1.js";
7
7
  import {
8
8
  collectTools2,
9
9
  createToolRunner
10
- } from "./index-vqdjym30.js";
10
+ } from "./index-zm1k7hhv.js";
11
11
  import {
12
12
  AppError2
13
13
  } from "./index-j9gxbztg.js";
@@ -8,17 +8,17 @@ import {
8
8
  validateResolvedInputRounds,
9
9
  presentationMetadata,
10
10
  prepareProjectedMcpTools
11
- } from "./index-h7accrrv.js";
11
+ } from "./index-jgwqc38k.js";
12
12
  import {
13
13
  parseToolCallArguments,
14
14
  toolResultFromError,
15
15
  observed
16
- } from "./index-02h0dfpr.js";
16
+ } from "./index-z4ga1fa1.js";
17
17
  import {
18
18
  collectTools2,
19
19
  createToolRunner,
20
20
  formatToolError
21
- } from "./index-vqdjym30.js";
21
+ } from "./index-zm1k7hhv.js";
22
22
  import {
23
23
  DEFAULT_CORS_ALLOW_HEADERS2,
24
24
  DEFAULT_PROCESS_SIGNALS,
@@ -31,7 +31,7 @@ import {
31
31
  } from "./index-e6c2spsd.js";
32
32
  import {
33
33
  collectToolSurface
34
- } from "./index-hvg9hctd.js";
34
+ } from "./index-eddzs589.js";
35
35
  import {
36
36
  runWithRequestContext2,
37
37
  getRequestContext2
@@ -2,21 +2,21 @@ import {
2
2
  toolResultFromError,
3
3
  toolCauseFromResult,
4
4
  isToolExecutionControlError2
5
- } from "./index-02h0dfpr.js";
5
+ } from "./index-z4ga1fa1.js";
6
6
  import {
7
7
  createToolRunner,
8
8
  formatToolError
9
- } from "./index-vqdjym30.js";
9
+ } from "./index-zm1k7hhv.js";
10
10
  import {
11
11
  AgentToolError2,
12
12
  resolveToolDurability
13
13
  } from "./index-56yx8dxp.js";
14
14
  import {
15
15
  collectToolSurface
16
- } from "./index-hvg9hctd.js";
16
+ } from "./index-eddzs589.js";
17
17
  import {
18
18
  agentPresenterOf
19
- } from "./index-ff3agzaf.js";
19
+ } from "./index-nk1mh535.js";
20
20
  import {
21
21
  isRecord
22
22
  } from "./index-9jfdm5tg.js";
@@ -14,7 +14,7 @@ import {
14
14
  import {
15
15
  ToolExecutionControlError2,
16
16
  isToolExecutionControlError2
17
- } from "./index-02h0dfpr.js";
17
+ } from "./index-z4ga1fa1.js";
18
18
  import {
19
19
  agentDurableEventId2
20
20
  } from "./index-mnkk1ffz.js";
@@ -19,7 +19,7 @@ import {
19
19
  appendEventIn,
20
20
  ArchiveProjectionSchema,
21
21
  createAgentRuntimeStore2
22
- } from "./index-38gvr73z.js";
22
+ } from "./index-f2p949ax.js";
23
23
  import {
24
24
  AgentConversationPageSchema2,
25
25
  AgentConversationMessagePageSchema2
@@ -27,7 +27,7 @@ import {
27
27
  } from "./index-j4zh647a.js";
28
28
  import {
29
29
  defineRuntimeTool2
30
- } from "./index-ff3agzaf.js";
30
+ } from "./index-nk1mh535.js";
31
31
  import {
32
32
  AppError2,
33
33
  forbidden2,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  projectToolSurface
3
- } from "./index-h7accrrv.js";
3
+ } from "./index-jgwqc38k.js";
4
4
  import {
5
5
  contractToolMountable
6
- } from "./index-vqdjym30.js";
6
+ } from "./index-zm1k7hhv.js";
7
7
  import {
8
8
  runtimeToolMountable
9
- } from "./index-ff3agzaf.js";
9
+ } from "./index-nk1mh535.js";
10
10
 
11
11
  // src/tools/surface.ts
12
12
  function collectToolSurface({
@@ -4,7 +4,7 @@ import {
4
4
  AgentSandboxRestrictionSchema2,
5
5
  AgentSandboxGradeSchema2,
6
6
  AGENT_CODING_TOOL_NAMES
7
- } from "./index-n0adphfg.js";
7
+ } from "./index-dsxrcseb.js";
8
8
  import {
9
9
  AgentRecordIdSchema2,
10
10
  AgentRecordVersionSchema2,
@@ -14,15 +14,15 @@ import {
14
14
  objectShapeKeys,
15
15
  assertUniqueToolName,
16
16
  buildToolPresentationSchema
17
- } from "./index-h7accrrv.js";
17
+ } from "./index-jgwqc38k.js";
18
18
  import {
19
19
  toolResultFromError,
20
20
  toolErrorFromResult
21
- } from "./index-02h0dfpr.js";
21
+ } from "./index-z4ga1fa1.js";
22
22
  import {
23
23
  createToolRunner,
24
24
  formatToolError
25
- } from "./index-vqdjym30.js";
25
+ } from "./index-zm1k7hhv.js";
26
26
  import {
27
27
  fetchGuarded,
28
28
  readCapped
@@ -35,7 +35,7 @@ import {
35
35
  } from "./index-eemvahkc.js";
36
36
  import {
37
37
  collectToolSurface
38
- } from "./index-hvg9hctd.js";
38
+ } from "./index-eddzs589.js";
39
39
  import {
40
40
  isUnsafeKey,
41
41
  safeJsonParse
@@ -763,6 +763,27 @@ import { z as z2 } from "zod";
763
763
  var DRAFT_07_MARKER = "draft-07";
764
764
  var DRAFT_07_KEYWORD = "definitions";
765
765
  var DEFS_KEYWORD = "$defs";
766
+ var SCHEMA_KEYWORDS = [
767
+ "items",
768
+ "additionalItems",
769
+ "additionalProperties",
770
+ "contains",
771
+ "propertyNames",
772
+ "not",
773
+ "if",
774
+ "then",
775
+ "else",
776
+ "unevaluatedItems",
777
+ "unevaluatedProperties"
778
+ ];
779
+ var SCHEMA_LIST_KEYWORDS = ["allOf", "anyOf", "oneOf", "prefixItems"];
780
+ var SCHEMA_MAP_KEYWORDS = [
781
+ "properties",
782
+ "patternProperties",
783
+ "dependentSchemas",
784
+ DRAFT_07_KEYWORD,
785
+ DEFS_KEYWORD
786
+ ];
766
787
  function declaresDraft07(dialect) {
767
788
  return typeof dialect === "string" && dialect.includes(DRAFT_07_MARKER);
768
789
  }
@@ -777,12 +798,51 @@ function rewriteDefinitionPointers(value) {
777
798
  }
778
799
  return rewritten;
779
800
  }
780
- function withDefsDialect(schema) {
781
- const definitions = schema[DRAFT_07_KEYWORD];
782
- if (!isRecord(definitions) || DEFS_KEYWORD in schema)
801
+ function mapValues(value, rewrite) {
802
+ if (!isRecord(value))
803
+ return value;
804
+ const rewritten = {};
805
+ for (const [name, child] of Object.entries(value))
806
+ rewritten[name] = rewrite(child);
807
+ return rewritten;
808
+ }
809
+ function withPositionalItems(schema) {
810
+ if (!isRecord(schema))
783
811
  return schema;
784
812
  const rewritten = {};
785
- for (const [key, value] of Object.entries(schema)) {
813
+ for (const [key, child] of Object.entries(schema)) {
814
+ if (SCHEMA_KEYWORDS.includes(key))
815
+ rewritten[key] = withPositionalItems(child);
816
+ else if (SCHEMA_LIST_KEYWORDS.includes(key) && Array.isArray(child)) {
817
+ rewritten[key] = child.map(withPositionalItems);
818
+ } else if (SCHEMA_MAP_KEYWORDS.includes(key)) {
819
+ rewritten[key] = mapValues(child, withPositionalItems);
820
+ } else
821
+ rewritten[key] = child;
822
+ }
823
+ const { items, additionalItems } = rewritten;
824
+ if (!Array.isArray(items))
825
+ return rewritten;
826
+ const positional = {};
827
+ for (const [key, child] of Object.entries(rewritten)) {
828
+ if (key === "items")
829
+ positional.prefixItems = items;
830
+ else if (key !== "additionalItems")
831
+ positional[key] = child;
832
+ }
833
+ if (additionalItems !== undefined)
834
+ positional.items = additionalItems;
835
+ return positional;
836
+ }
837
+ function withDraft2020Keywords(schema) {
838
+ const positional = withPositionalItems(schema);
839
+ if (!isRecord(positional))
840
+ return schema;
841
+ const definitions = positional[DRAFT_07_KEYWORD];
842
+ if (!isRecord(definitions) || DEFS_KEYWORD in positional)
843
+ return positional;
844
+ const rewritten = {};
845
+ for (const [key, value] of Object.entries(positional)) {
786
846
  if (key === DRAFT_07_KEYWORD)
787
847
  continue;
788
848
  rewritten[key] = rewriteDefinitionPointers(value);
@@ -977,7 +1037,7 @@ function isObjectPresentationSchema(schema) {
977
1037
  return schema.type === "object" && isRecord(schema.properties);
978
1038
  }
979
1039
  function presentationMetadata(schema) {
980
- return withDefsDialect(withoutDialect(schema));
1040
+ return withDraft2020Keywords(withoutDialect(schema));
981
1041
  }
982
1042
 
983
1043
  // src/tools/internal/surface-projector.ts
@@ -1244,4 +1304,4 @@ function prepareProjectedMcpTools(tools, config = {}) {
1244
1304
  return prepared;
1245
1305
  }
1246
1306
 
1247
- export { toolSurfaceOutputSchema, applyToolViewDefaults, projectToolView, objectShapeKeys, rebuildObject, mergeSchemas, staticInputRounds, validateMcpRoundPolicy, validateResolvedInputRounds, assertToolName, assertUniqueToolName, PORTABLE_JSON_SCHEMA_FORMATS2, findNonPortableFormats2, declaresDraft07, withDefsDialect, flattenToolJsonSchema2, buildToolPresentationSchema, presentationMetadata, findUntypedProperties2, assertToolExtensionCompatible, projectRuntimeTool, projectToolSurface, mcpProjectionCandidate, prepareProjectedMcpTools };
1307
+ export { toolSurfaceOutputSchema, applyToolViewDefaults, projectToolView, objectShapeKeys, rebuildObject, mergeSchemas, staticInputRounds, validateMcpRoundPolicy, validateResolvedInputRounds, assertToolName, assertUniqueToolName, PORTABLE_JSON_SCHEMA_FORMATS2, findNonPortableFormats2, declaresDraft07, withDraft2020Keywords, flattenToolJsonSchema2, buildToolPresentationSchema, presentationMetadata, findUntypedProperties2, assertToolExtensionCompatible, projectRuntimeTool, projectToolSurface, mcpProjectionCandidate, prepareProjectedMcpTools };
@@ -17,7 +17,7 @@ import {
17
17
  replaceMessage,
18
18
  ArchiveSpillSchema,
19
19
  createAgentRuntimeStore2
20
- } from "./index-38gvr73z.js";
20
+ } from "./index-f2p949ax.js";
21
21
 
22
22
  // src/agent-runtime/store-memory.ts
23
23
  import { z as z2 } from "zod";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  projectRuntimeTool
3
- } from "./index-h7accrrv.js";
3
+ } from "./index-jgwqc38k.js";
4
4
  import {
5
5
  isRecord
6
6
  } from "./index-9jfdm5tg.js";
@@ -12,7 +12,7 @@ import {
12
12
  applyToolViewDefaults,
13
13
  projectToolView,
14
14
  objectShapeKeys
15
- } from "./index-h7accrrv.js";
15
+ } from "./index-jgwqc38k.js";
16
16
  import {
17
17
  runWithRequestContext2,
18
18
  getRequestContext2
@@ -3,11 +3,11 @@ import {
3
3
  mergeSchemas,
4
4
  assertToolExtensionCompatible,
5
5
  projectToolSurface
6
- } from "./index-h7accrrv.js";
6
+ } from "./index-jgwqc38k.js";
7
7
  import {
8
8
  toolErrorFromResult,
9
9
  executeToolMethod
10
- } from "./index-02h0dfpr.js";
10
+ } from "./index-z4ga1fa1.js";
11
11
  import {
12
12
  isRetryableStatus2
13
13
  } from "./index-j9gxbztg.js";
@@ -1,17 +1,19 @@
1
1
  /** True when a document says, in its own `$schema`, that it is draft-07. */
2
2
  export declare function declaresDraft07(dialect: unknown): boolean;
3
3
  /**
4
- * Move a document's top-level `definitions` to `$defs`, carrying its pointers.
4
+ * Write a document in the keywords of 2020-12, the dialect an MCP client reads
5
+ * tool schemas in. Two draft-07 keywords mean something else there or nothing:
6
+ * reusable subschemas move from `definitions` to `$defs` with their pointers,
7
+ * and a tuple's `items` list becomes `prefixItems`.
5
8
  *
6
- * A JSON Schema document that names one dialect and uses another's keyword is
7
- * not a style question: a reader registers reusable subschemas from the keyword
8
- * the dialect declares and then cannot resolve `#/definitions/x` at all. Both
9
- * halves of this framework met that document — the MCP SDK stamps 2020-12 onto
10
- * the metadata it is handed, and our own MCP client obeyed the stamp.
9
+ * A document that names one dialect and uses another's keyword is not a style
10
+ * question: a reader registers subschemas from the keyword its dialect declares
11
+ * and cannot resolve `#/definitions/x`, and a reader that validates the schema
12
+ * itself refuses an `items` list and drops the whole tool.
11
13
  *
12
- * Only the top level moves. A `definitions` deeper in the document may be a
13
- * property literally called "definitions", and guessing which is worse than
14
- * leaving it where the author put it.
14
+ * Only the top-level `definitions` moves. A `definitions` deeper in the
15
+ * document may be a property literally called "definitions", and guessing which
16
+ * is worse than leaving it where the author put it.
15
17
  */
16
- export declare function withDefsDialect(schema: Record<string, unknown>): Record<string, unknown>;
18
+ export declare function withDraft2020Keywords(schema: Record<string, unknown>): Record<string, unknown>;
17
19
  //# sourceMappingURL=dialect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialect.d.ts","sourceRoot":"","sources":["../../src/json-schema/dialect.ts"],"names":[],"mappings":"AAQA,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAEzD;AAeD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAUxF"}
1
+ {"version":3,"file":"dialect.d.ts","sourceRoot":"","sources":["../../src/json-schema/dialect.ts"],"names":[],"mappings":"AAiCA,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAEzD;AAmDD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAYzB"}
@@ -16,9 +16,10 @@ export declare function isObjectPresentationSchema(schema: ToolPresentationSchem
16
16
  * Metadata passed to the Zod identity carrier.
17
17
  *
18
18
  * The SDK supplies its own dialect and it is 2020-12, so the document has to
19
- * speak 2020-12: a draft-07 `definitions` block under a 2020-12 `$schema` is a
20
- * document that says one thing and does another, and a client that believes the
21
- * stamp cannot resolve a single `#/definitions/...` pointer in it.
19
+ * speak 2020-12: draft-07 `definitions` under a 2020-12 `$schema` leave every
20
+ * `#/definitions/...` pointer unresolvable, and a tuple's draft-07 `items` list
21
+ * is not a schema there, so a client that validates tool schemas drops the tool.
22
+ * → ADR 0185, ADR 0268.
22
23
  */
23
24
  export declare function presentationMetadata(schema: ToolPresentationSchema): ToolPresentationSchema;
24
25
  //# sourceMappingURL=presentation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"presentation.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/presentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,WAAW,CAAC;AAEnB,MAAM,WAAW,sBAAsB;IACrC,YAAY,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;IACzC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAClC,uFAAuF;IACvF,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC9C;AA+KD,+EAA+E;AAC/E,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,sBAAsB,GAC7B,sBAAsB,CAkDxB;AAoCD,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAElF;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,sBAAsB,GAAG,sBAAsB,CAE3F"}
1
+ {"version":3,"file":"presentation.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/presentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,WAAW,CAAC;AAEnB,MAAM,WAAW,sBAAsB;IACrC,YAAY,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;IACzC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAClC,uFAAuF;IACvF,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC9C;AA+KD,+EAA+E;AAC/E,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,sBAAsB,GAC7B,sBAAsB,CAkDxB;AAoCD,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAElF;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,sBAAsB,GAAG,sBAAsB,CAE3F"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stitchkit",
3
- "version": "0.112.2",
3
+ "version": "0.112.3",
4
4
  "description": "Contract-first backend framework — one defineContract() into an HTTP API, MCP tools, AI-agent tools and a typed client. Bun and Node.",
5
5
  "keywords": [
6
6
  "bun",
@@ -378,6 +378,7 @@
378
378
  "@types/react-dom": "^19.3.0",
379
379
  "@typescript/typescript6": "^6.0.2",
380
380
  "ai": "^7.0.111",
381
+ "ajv": "^8.20.0",
381
382
  "fake-indexeddb": "^6.2.5",
382
383
  "google-auth-library": "^11.1.0",
383
384
  "grammy": "^1.46.0",