stitchkit 0.113.0 → 0.113.1

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/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.113.1] - 2026-10-28
19
+
20
+ ### Fixed
21
+
22
+ - `stitchkit/tools/connections` — restored MCP and OpenAPI tool schemas leave string-format and pattern refusals to the remote instead of substituting a generic datetime/email/regex error before sending. MCP relays the original validation message; OpenAPI retains its existing safe HTTP error projection. Record-key wrappers retain only reported local failures; structural errors, bounds and locally authored schemas keep their existing checks. → ADR 0272
23
+ **Affects:** `stitchkit/tools/connections` behaviour
24
+
18
25
  ## [0.113.0] - 2026-10-26
19
26
 
20
27
  ### ⚠️ Breaking changes
@@ -5,15 +5,15 @@ import"../../index-8kzct1d6.js";
5
5
  import {
6
6
  composeAgentPrompt2,
7
7
  createAgentRuntime2
8
- } from "../../index-ppf5nerp.js";
8
+ } from "../../index-mhrtwttb.js";
9
9
  import"../../index-qaet40b2.js";
10
10
  import"../../index-mnkk1ffz.js";
11
11
  import"../../index-fynr93w4.js";
12
- import"../../index-epmnrnth.js";
13
- import"../../index-jy9wq8tp.js";
12
+ import"../../index-dsa676h8.js";
13
+ import"../../index-rbzq0q16.js";
14
14
  import"../../index-ct75c3at.js";
15
15
  import"../../index-jgwqc38k.js";
16
- import"../../index-z4ga1fa1.js";
16
+ import"../../index-tg2q89ps.js";
17
17
  import"../../index-snef22zr.js";
18
18
  import"../../index-56yx8dxp.js";
19
19
  import"../../index-fggxgbrk.js";
@@ -123,23 +123,23 @@ import {
123
123
  agentGoalStateSlot2,
124
124
  agentTodoStateSlot2,
125
125
  createAgentRuntime2
126
- } from "../index-ppf5nerp.js";
126
+ } from "../index-mhrtwttb.js";
127
127
  import {
128
128
  AgentConversationSummarySchema2,
129
129
  AgentConversationPageSchema2,
130
130
  AgentConversationMessagePageSchema2
131
131
  } from "../index-kqnd6a85.js";
132
132
  import"../index-fynr93w4.js";
133
- import"../index-epmnrnth.js";
134
- import"../index-jy9wq8tp.js";
133
+ import"../index-dsa676h8.js";
134
+ import"../index-rbzq0q16.js";
135
135
  import"../index-ct75c3at.js";
136
136
  import"../index-jgwqc38k.js";
137
- import"../index-z4ga1fa1.js";
138
- import"../index-zm1k7hhv.js";
137
+ import"../index-tg2q89ps.js";
138
+ import"../index-v6mzw27b.js";
139
139
  import {
140
140
  mountAgent2,
141
141
  buildToolManifest2
142
- } from "../index-5jjda9a4.js";
142
+ } from "../index-sjww6myv.js";
143
143
  import {
144
144
  createBoundedSinkManager
145
145
  } from "../index-qaet40b2.js";
@@ -202,7 +202,7 @@ import {
202
202
  import {
203
203
  assertPositiveSafeInteger
204
204
  } from "../index-0s4xebbg.js";
205
- import"../index-eddzs589.js";
205
+ import"../index-emrmgq3s.js";
206
206
  import {
207
207
  defineRuntimeTool2,
208
208
  executableAgentRuntimeTools
@@ -1,7 +1,7 @@
1
- import"../index-epmnrnth.js";
1
+ import"../index-dsa676h8.js";
2
2
  import {
3
3
  coerceJsonArgs2
4
- } from "../index-jy9wq8tp.js";
4
+ } from "../index-rbzq0q16.js";
5
5
  import {
6
6
  defineCliCommand2,
7
7
  DEFAULT_EXIT_CODES2,
@@ -16,12 +16,12 @@ import {
16
16
  renderCliView2,
17
17
  pollUntilDone2,
18
18
  createCli2
19
- } from "../index-gpbk7yse.js";
19
+ } from "../index-fytsnhzj.js";
20
20
  import"../index-fynr93w4.js";
21
21
  import"../index-ct75c3at.js";
22
22
  import"../index-jgwqc38k.js";
23
- import"../index-z4ga1fa1.js";
24
- import"../index-zm1k7hhv.js";
23
+ import"../index-tg2q89ps.js";
24
+ import"../index-v6mzw27b.js";
25
25
  import {
26
26
  CliBuildSignatureSchema2,
27
27
  cliManifestSigningPayload2,
@@ -44,7 +44,7 @@ import {
44
44
  import {
45
45
  writeFileAtomicSync2
46
46
  } from "../index-07dcf2yn.js";
47
- import"../index-eddzs589.js";
47
+ import"../index-emrmgq3s.js";
48
48
  import"../index-nk1mh535.js";
49
49
  import {
50
50
  safeJsonParse
@@ -6,8 +6,8 @@ import {
6
6
  import"../../index-fynr93w4.js";
7
7
  import {
8
8
  markJsonSchemaObjectGuards,
9
- markRemoteUnionVerdict
10
- } from "../../index-epmnrnth.js";
9
+ markRemoteSchemaVerdict
10
+ } from "../../index-dsa676h8.js";
11
11
  import {
12
12
  withSignalDeadline
13
13
  } from "../../index-9tqbxv5p.js";
@@ -847,7 +847,7 @@ function zodObjectFromJsonSchema(schema) {
847
847
  const parsed = z.fromJSONSchema(reconcileDialect(schema));
848
848
  if (parsed instanceof z.ZodObject) {
849
849
  markJsonSchemaObjectGuards(parsed);
850
- markRemoteUnionVerdict(parsed);
850
+ markRemoteSchemaVerdict(parsed);
851
851
  return parsed;
852
852
  }
853
853
  return z.looseObject({});
@@ -9,8 +9,8 @@ import {
9
9
  } from "../../index-0gxvns6s.js";
10
10
  import {
11
11
  coerceJsonArgs2
12
- } from "../../index-jy9wq8tp.js";
13
- import"../../index-epmnrnth.js";
12
+ } from "../../index-rbzq0q16.js";
13
+ import"../../index-dsa676h8.js";
14
14
  export {
15
15
  AsyncOperationCancelResultSchema2 as AsyncOperationCancelResultSchema,
16
16
  McpAnnotationsSchema2 as McpAnnotationsSchema,
@@ -1,13 +1,13 @@
1
1
  import"../../index-fynr93w4.js";
2
- import"../../index-epmnrnth.js";
3
- import"../../index-jy9wq8tp.js";
2
+ import"../../index-dsa676h8.js";
3
+ import"../../index-rbzq0q16.js";
4
4
  import"../../index-ct75c3at.js";
5
5
  import"../../index-jgwqc38k.js";
6
- import"../../index-z4ga1fa1.js";
7
- import"../../index-zm1k7hhv.js";
6
+ import"../../index-tg2q89ps.js";
7
+ import"../../index-v6mzw27b.js";
8
8
  import {
9
9
  createToolInvoker2
10
- } from "../../index-4dh3hfs7.js";
10
+ } from "../../index-nn6607y3.js";
11
11
  export {
12
12
  createToolInvoker2 as createToolInvoker
13
13
  };
@@ -1,10 +1,10 @@
1
1
  import"../../index-ct75c3at.js";
2
2
  import"../../index-fynr93w4.js";
3
- import"../../index-epmnrnth.js";
4
- import"../../index-jy9wq8tp.js";
3
+ import"../../index-dsa676h8.js";
4
+ import"../../index-rbzq0q16.js";
5
5
  import"../../index-jgwqc38k.js";
6
- import"../../index-z4ga1fa1.js";
7
- import"../../index-zm1k7hhv.js";
6
+ import"../../index-tg2q89ps.js";
7
+ import"../../index-v6mzw27b.js";
8
8
  import {
9
9
  RESOURCE_MIME_TYPE2,
10
10
  EXT_APPS_BUNDLE_PLACEHOLDER2,
@@ -20,8 +20,8 @@ import {
20
20
  createMcpHttpRoute2,
21
21
  createStdioMcpServer2,
22
22
  bindStdioProcessSignals2
23
- } from "../../index-54q2mghq.js";
24
- import"../../index-eddzs589.js";
23
+ } from "../../index-8jjzfts8.js";
24
+ import"../../index-emrmgq3s.js";
25
25
  import"../../index-nk1mh535.js";
26
26
  export {
27
27
  EXT_APPS_BUNDLE_PLACEHOLDER2 as EXT_APPS_BUNDLE_PLACEHOLDER,
@@ -9,10 +9,10 @@ import {
9
9
  import {
10
10
  normalizeError2
11
11
  } from "../index-fynr93w4.js";
12
- import"../index-epmnrnth.js";
12
+ import"../index-dsa676h8.js";
13
13
  import {
14
14
  coerceJsonArgs2
15
- } from "../index-jy9wq8tp.js";
15
+ } from "../index-rbzq0q16.js";
16
16
  import"../index-ct75c3at.js";
17
17
  import {
18
18
  assertToolName,
@@ -25,15 +25,15 @@ import {
25
25
  import {
26
26
  ToolExecutionControlError2,
27
27
  isToolExecutionControlError2
28
- } from "../index-z4ga1fa1.js";
28
+ } from "../index-tg2q89ps.js";
29
29
  import {
30
30
  collectTools2
31
- } from "../index-zm1k7hhv.js";
31
+ } from "../index-v6mzw27b.js";
32
32
  import {
33
33
  mountAgent2,
34
34
  describeToolCatalog2,
35
35
  buildToolManifest2
36
- } from "../index-5jjda9a4.js";
36
+ } from "../index-sjww6myv.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-54q2mghq.js";
63
+ } from "../index-8jjzfts8.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-gpbk7yse.js";
77
+ } from "../index-fytsnhzj.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-4dh3hfs7.js";
92
+ } from "../index-nn6607y3.js";
93
93
  import {
94
94
  ManagedFileError2
95
95
  } from "../index-2f9r0jgr.js";
@@ -111,7 +111,7 @@ import {
111
111
  } from "../index-yk4g8805.js";
112
112
  import {
113
113
  collectToolSurface
114
- } from "../index-eddzs589.js";
114
+ } from "../index-emrmgq3s.js";
115
115
  import {
116
116
  getTraceId2
117
117
  } from "../index-r6v4mc67.js";
@@ -13,12 +13,12 @@ import {
13
13
  parseToolCallArguments,
14
14
  toolResultFromError,
15
15
  observed
16
- } from "./index-z4ga1fa1.js";
16
+ } from "./index-tg2q89ps.js";
17
17
  import {
18
18
  collectTools2,
19
19
  createToolRunner,
20
20
  formatToolError
21
- } from "./index-zm1k7hhv.js";
21
+ } from "./index-v6mzw27b.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-eddzs589.js";
34
+ } from "./index-emrmgq3s.js";
35
35
  import {
36
36
  runWithRequestContext2,
37
37
  getRequestContext2
@@ -82,9 +82,9 @@ function markJsonSchemaObjectGuards(schema) {
82
82
  };
83
83
  visit(schema);
84
84
  }
85
- var REMOTE_UNION_VERDICT = Symbol.for("stitchkit.tools.json-schema-remote-union-verdict.v1");
86
- function markRemoteUnionVerdict(schema) {
87
- Reflect.defineProperty(schema, REMOTE_UNION_VERDICT, {
85
+ var REMOTE_SCHEMA_VERDICT = Symbol.for("stitchkit.tools.json-schema-remote-verdict.v1");
86
+ function markRemoteSchemaVerdict(schema) {
87
+ Reflect.defineProperty(schema, REMOTE_SCHEMA_VERDICT, {
88
88
  configurable: false,
89
89
  enumerable: false,
90
90
  value: true,
@@ -92,12 +92,29 @@ function markRemoteUnionVerdict(schema) {
92
92
  });
93
93
  }
94
94
  function localVerdict(schema, error) {
95
- if (Reflect.get(schema, REMOTE_UNION_VERDICT) !== true)
95
+ if (Reflect.get(schema, REMOTE_SCHEMA_VERDICT) !== true)
96
96
  return error;
97
- const local = error.issues.filter((issue) => issue.code !== "invalid_union");
97
+ const local = localIssues(error.issues);
98
98
  if (local.length === 0)
99
99
  return null;
100
- return local.length === error.issues.length ? error : new z.ZodError(local);
100
+ return sameIssues(local, error.issues) ? error : new z.ZodError(local);
101
+ }
102
+ function sameIssues(left, right) {
103
+ return left.length === right.length && left.every((issue, index) => issue === right[index]);
104
+ }
105
+ function localIssues(issues) {
106
+ return issues.flatMap((issue) => {
107
+ if (issue.code === "invalid_union" || issue.code === "invalid_format")
108
+ return [];
109
+ if (issue.code === "invalid_key") {
110
+ const children = localIssues(issue.issues);
111
+ if (children.length === 0)
112
+ return [];
113
+ if (!sameIssues(children, issue.issues))
114
+ return [{ ...issue, issues: children }];
115
+ }
116
+ return [issue];
117
+ });
101
118
  }
102
119
  function jsonSchemaObjectCoercionMembers(schema) {
103
120
  if (Reflect.get(schema, JSON_SCHEMA_OBJECT_GUARD) !== true)
@@ -114,4 +131,4 @@ function jsonSchemaObjectCoercionMembers(schema) {
114
131
  return;
115
132
  }
116
133
 
117
- export { markJsonSchemaObjectGuards, markRemoteUnionVerdict, localVerdict, jsonSchemaObjectCoercionMembers };
134
+ export { markJsonSchemaObjectGuards, markRemoteSchemaVerdict, localVerdict, jsonSchemaObjectCoercionMembers };
@@ -3,7 +3,7 @@ import {
3
3
  } from "./index-jgwqc38k.js";
4
4
  import {
5
5
  contractToolMountable
6
- } from "./index-zm1k7hhv.js";
6
+ } from "./index-v6mzw27b.js";
7
7
  import {
8
8
  runtimeToolMountable
9
9
  } from "./index-nk1mh535.js";
@@ -3,10 +3,10 @@ import {
3
3
  } from "./index-fynr93w4.js";
4
4
  import {
5
5
  jsonSchemaObjectCoercionMembers
6
- } from "./index-epmnrnth.js";
6
+ } from "./index-dsa676h8.js";
7
7
  import {
8
8
  coerceJsonArgs2
9
- } from "./index-jy9wq8tp.js";
9
+ } from "./index-rbzq0q16.js";
10
10
  import {
11
11
  jsonSchemaFields
12
12
  } from "./index-ct75c3at.js";
@@ -18,11 +18,11 @@ import {
18
18
  import {
19
19
  toolResultFromError,
20
20
  toolErrorFromResult
21
- } from "./index-z4ga1fa1.js";
21
+ } from "./index-tg2q89ps.js";
22
22
  import {
23
23
  createToolRunner,
24
24
  formatToolError
25
- } from "./index-zm1k7hhv.js";
25
+ } from "./index-v6mzw27b.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-eddzs589.js";
38
+ } from "./index-emrmgq3s.js";
39
39
  import {
40
40
  isUnsafeKey,
41
41
  safeJsonParse
@@ -14,7 +14,7 @@ import {
14
14
  import {
15
15
  ToolExecutionControlError2,
16
16
  isToolExecutionControlError2
17
- } from "./index-z4ga1fa1.js";
17
+ } from "./index-tg2q89ps.js";
18
18
  import {
19
19
  agentDurableEventId2
20
20
  } from "./index-mnkk1ffz.js";
@@ -3,11 +3,11 @@ import {
3
3
  } from "./index-jgwqc38k.js";
4
4
  import {
5
5
  toolErrorFromResult
6
- } from "./index-z4ga1fa1.js";
6
+ } from "./index-tg2q89ps.js";
7
7
  import {
8
8
  collectTools2,
9
9
  createToolRunner
10
- } from "./index-zm1k7hhv.js";
10
+ } from "./index-v6mzw27b.js";
11
11
  import {
12
12
  AppError2
13
13
  } from "./index-j9gxbztg.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  jsonSchemaObjectCoercionMembers
3
- } from "./index-epmnrnth.js";
3
+ } from "./index-dsa676h8.js";
4
4
  import {
5
5
  safeJsonParse
6
6
  } from "./index-zsarb5xp.js";
@@ -2,18 +2,18 @@ import {
2
2
  toolResultFromError,
3
3
  toolCauseFromResult,
4
4
  isToolExecutionControlError2
5
- } from "./index-z4ga1fa1.js";
5
+ } from "./index-tg2q89ps.js";
6
6
  import {
7
7
  createToolRunner,
8
8
  formatToolError
9
- } from "./index-zm1k7hhv.js";
9
+ } from "./index-v6mzw27b.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-eddzs589.js";
16
+ } from "./index-emrmgq3s.js";
17
17
  import {
18
18
  agentPresenterOf
19
19
  } from "./index-nk1mh535.js";
@@ -4,10 +4,10 @@ import {
4
4
  } from "./index-fynr93w4.js";
5
5
  import {
6
6
  localVerdict
7
- } from "./index-epmnrnth.js";
7
+ } from "./index-dsa676h8.js";
8
8
  import {
9
9
  coerceJsonArgs2
10
- } from "./index-jy9wq8tp.js";
10
+ } from "./index-rbzq0q16.js";
11
11
  import {
12
12
  applyToolViewDefaults,
13
13
  projectToolView,
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  toolErrorFromResult,
9
9
  executeToolMethod
10
- } from "./index-z4ga1fa1.js";
10
+ } from "./index-tg2q89ps.js";
11
11
  import {
12
12
  isRetryableStatus2
13
13
  } from "./index-j9gxbztg.js";
@@ -21,7 +21,7 @@ export declare function withConnectionToken<T>(params: {
21
21
  * Turn a discovered JSON Schema into a `ZodObject`, falling back to a permissive
22
22
  * object when the external schema is absent or not an object. This is the typed
23
23
  * boundary: the schema crosses from an untrusted foreign document into Zod here
24
- * and nowhere else. Its unions are left to the remote that owns the schema.
24
+ * and nowhere else. Unions and string formats are left to the remote that owns the schema.
25
25
  */
26
26
  export declare function zodObjectFromJsonSchema(schema: Record<string, unknown> | undefined): ZodObject;
27
27
  /** Normalise a tool name into the characters every provider accepts. */
@@ -6,19 +6,20 @@ import { z } from 'zod';
6
6
  */
7
7
  export declare function markJsonSchemaObjectGuards(schema: z.core.$ZodType): void;
8
8
  /**
9
- * Record that a schema restored from a foreign document leaves its unions to the remote.
9
+ * Record that a foreign schema leaves unions and string formats to its remote owner.
10
10
  *
11
11
  * A foreign tool schema is the remote's presentation, and a presentation may join a
12
12
  * discriminated union into one object whose shared field is an unlabelled `anyOf` (a stitchkit
13
13
  * server with `flattenUnionInput` does, ADR 0205). Every value the remote accepts still passes
14
14
  * such a union; which branch a value was meant for does not survive. Judged here, a wrong value
15
15
  * can only be refused with every branch listed, while the remote, which holds the original
16
- * schema, names the one field that is wrong.
16
+ * schema, names the one field that is wrong. JSON Schema also carries string formats and
17
+ * patterns without the author's error messages; only the remote can report those faithfully.
17
18
  */
18
- export declare function markRemoteUnionVerdict(schema: z.ZodObject): void;
19
+ export declare function markRemoteSchemaVerdict(schema: z.ZodObject): void;
19
20
  /**
20
- * What a local parse refuses of a value the remote judges: everything but its unions. `null` when
21
- * every refusal was a union's — the value goes to the remote, whose refusal is the answer.
21
+ * Retain every reported issue except foreign unions and string formats. `null` means that
22
+ * every refusal belongs to the remote, whose answer carries the original schema's wording.
22
23
  * A schema that is not a restored foreign one keeps its own verdict whole.
23
24
  */
24
25
  export declare function localVerdict(schema: z.core.$ZodType, error: z.ZodError): z.ZodError | null;
@@ -1 +1 @@
1
- {"version":3,"file":"json-schema-origin.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/json-schema-origin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgCxB;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAiExE;AAID;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAOhE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,GAAG,IAAI,CAK1F;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GACtB,SAAS,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,SAAS,CAsBxC"}
1
+ {"version":3,"file":"json-schema-origin.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/json-schema-origin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgCxB;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAiExE;AAID;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAOjE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,GAAG,IAAI,CAK1F;AAuBD;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GACtB,SAAS,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,SAAS,CAsBxC"}
package/llms/cli.2.txt CHANGED
@@ -149,9 +149,10 @@ One unconvertible schema does not take the connection down. The tool
149
149
  is skipped and **named** (`onSkippedTool`, or a stderr line by default), so a
150
150
  surface of two hundred tools is not lost to one.
151
151
 
152
- **A discovered schema is checked locally, except for its unions.** The arguments are
153
- coerced and parsed against the schema the server advertised, so a missing field or a
154
- wrong scalar is refused before anything is sent. A union in that schema is not judged
152
+ **A discovered schema leaves unions and string formats to its server.** The arguments are
153
+ coerced and parsed against the schema the server advertised. Reported structural failures
154
+ (a missing field, wrong scalar type, unknown key or enum value) and bounds stay local.
155
+ A union in that schema is not judged
155
156
  here: a server's presentation may join a discriminated union into one object whose
156
157
  shared field is an unlabelled `anyOf` (a stitchkit server with `flattenUnionInput`
157
158
  does), and judged against that, a wrong value could only be refused with every branch
@@ -159,6 +160,16 @@ listed. The value goes to the server, which holds the original schema, and its r
159
160
  names the one wrong field — `blocks.0.data.artifactId: expected string` rather than
160
161
  `No union branch matched — branch 1 … and 6 more branches`.
161
162
 
163
+ String formats and patterns also lose the author's error messages in JSON Schema. A
164
+ restored `date-time`, email, UUID or regex check would substitute Zod's generic wording.
165
+ Those `invalid_format` refusals go to the remote instead: a bare `2026-10-12` reaches
166
+ the original datetime schema, whose answer can explain that a full UTC timestamp such
167
+ as `2026-10-12T00:00:00Z` is required. This also applies inside arrays, objects and
168
+ record keys. A mixed refusal retains only its reported local reasons; a record-key
169
+ wrapper stays local when it contains any of those reasons. A schema authored locally
170
+ keeps its complete verdict, including custom errors and refinements. No second parse
171
+ invents checks that the first parse did not reach. See [ADR 0272](../decisions/0272-a-restored-string-format-is-judged-by-its-server.md).
172
+
162
173
  MCP connection limits follow the operation phase. `initialize`, the initialized
163
174
  notification, `tools/list` and legacy endpoint discovery use `limits.discovery`;
164
175
  `tools/call` uses `limits.call`. A mounted call's handshake still uses discovery
@@ -27,7 +27,7 @@ and approval path.
27
27
  | `ConnectionPhase` / `ConnectionOperation` / `ConnectionFailureContext` | _type_ | closed operation/phase vocabulary and measured read context for existing typed connection errors |
28
28
  | `ConnectionTimeoutError` / `ConnectionResponseTooLargeError` | class | bounded operation refusal, with phase, operation and finite observed bytes; safe tool projection retains the raw cause locally |
29
29
  | `defineOpenApiConnection` | function | declare one OpenAPI document (object, JSON text or JSON URL) as a tool surface |
30
- | `mountConnections` | function | discover every connection and return readonly `RuntimeToolDefinition`s for `mountAgent`; a call's arguments are parsed against the discovered schema before sending, except its unions, which the server judges (ADR 0266) |
30
+ | `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
31
  | `ConnectionAuthorizationRequiredError` | class | typed reauthorization signal raised on `401` with credentials resolved again on the next call |
32
32
  | `ConnectionBudgetExceededError` | class | the mount would expose more foreign tools than its declared budget |
33
33
  | `ConnectionRequestError` | class | any non-`2xx` connection response other than the reauthorization signal |
package/llms-full.txt CHANGED
@@ -10900,9 +10900,10 @@ One unconvertible schema does not take the connection down. The tool
10900
10900
  is skipped and **named** (`onSkippedTool`, or a stderr line by default), so a
10901
10901
  surface of two hundred tools is not lost to one.
10902
10902
 
10903
- **A discovered schema is checked locally, except for its unions.** The arguments are
10904
- coerced and parsed against the schema the server advertised, so a missing field or a
10905
- wrong scalar is refused before anything is sent. A union in that schema is not judged
10903
+ **A discovered schema leaves unions and string formats to its server.** The arguments are
10904
+ coerced and parsed against the schema the server advertised. Reported structural failures
10905
+ (a missing field, wrong scalar type, unknown key or enum value) and bounds stay local.
10906
+ A union in that schema is not judged
10906
10907
  here: a server's presentation may join a discriminated union into one object whose
10907
10908
  shared field is an unlabelled `anyOf` (a stitchkit server with `flattenUnionInput`
10908
10909
  does), and judged against that, a wrong value could only be refused with every branch
@@ -10910,6 +10911,16 @@ listed. The value goes to the server, which holds the original schema, and its r
10910
10911
  names the one wrong field — `blocks.0.data.artifactId: expected string` rather than
10911
10912
  `No union branch matched — branch 1 … and 6 more branches`.
10912
10913
 
10914
+ String formats and patterns also lose the author's error messages in JSON Schema. A
10915
+ restored `date-time`, email, UUID or regex check would substitute Zod's generic wording.
10916
+ Those `invalid_format` refusals go to the remote instead: a bare `2026-10-12` reaches
10917
+ the original datetime schema, whose answer can explain that a full UTC timestamp such
10918
+ as `2026-10-12T00:00:00Z` is required. This also applies inside arrays, objects and
10919
+ record keys. A mixed refusal retains only its reported local reasons; a record-key
10920
+ wrapper stays local when it contains any of those reasons. A schema authored locally
10921
+ keeps its complete verdict, including custom errors and refinements. No second parse
10922
+ invents checks that the first parse did not reach. See [ADR 0272](../decisions/0272-a-restored-string-format-is-judged-by-its-server.md).
10923
+
10913
10924
  MCP connection limits follow the operation phase. `initialize`, the initialized
10914
10925
  notification, `tools/list` and legacy endpoint discovery use `limits.discovery`;
10915
10926
  `tools/call` uses `limits.call`. A mounted call's handshake still uses discovery
@@ -23103,7 +23114,7 @@ and approval path.
23103
23114
  | `ConnectionPhase` / `ConnectionOperation` / `ConnectionFailureContext` | _type_ | closed operation/phase vocabulary and measured read context for existing typed connection errors |
23104
23115
  | `ConnectionTimeoutError` / `ConnectionResponseTooLargeError` | class | bounded operation refusal, with phase, operation and finite observed bytes; safe tool projection retains the raw cause locally |
23105
23116
  | `defineOpenApiConnection` | function | declare one OpenAPI document (object, JSON text or JSON URL) as a tool surface |
23106
- | `mountConnections` | function | discover every connection and return readonly `RuntimeToolDefinition`s for `mountAgent`; a call's arguments are parsed against the discovered schema before sending, except its unions, which the server judges (ADR 0266) |
23117
+ | `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) |
23107
23118
  | `ConnectionAuthorizationRequiredError` | class | typed reauthorization signal raised on `401` with credentials resolved again on the next call |
23108
23119
  | `ConnectionBudgetExceededError` | class | the mount would expose more foreign tools than its declared budget |
23109
23120
  | `ConnectionRequestError` | class | any non-`2xx` connection response other than the reauthorization signal |
package/llms.txt CHANGED
@@ -17,8 +17,8 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
17
17
  - **stitchkit/tools/mcp**: [llms/tools-mcp.txt](llms/tools-mcp.txt) 1.8 KB
18
18
  - **stitchkit/tools/contract**: [llms/tools-contract.txt](llms/tools-contract.txt) 0.2 KB
19
19
  - **stitchkit/tools/invoker**: [llms/tools-invoker.txt](llms/tools-invoker.txt) 0.2 KB
20
- - **stitchkit/tools/connections**: [llms/tools-connections.txt](llms/tools-connections.txt) 3.8 KB
21
- - **stitchkit/cli**: [llms/cli.txt](llms/cli.txt) 45.3 KB → [llms/cli.2.txt](llms/cli.2.txt) 21.4 KB
20
+ - **stitchkit/tools/connections**: [llms/tools-connections.txt](llms/tools-connections.txt) 3.9 KB
21
+ - **stitchkit/cli**: [llms/cli.txt](llms/cli.txt) 45.3 KB → [llms/cli.2.txt](llms/cli.2.txt) 22.3 KB
22
22
  - **stitchkit/cli/publish**: [llms/cli-publish.txt](llms/cli-publish.txt) 1.5 KB
23
23
  - **stitchkit/remote**: [llms/remote.txt](llms/remote.txt) 1.0 KB
24
24
  - **stitchkit/contract**: [llms/contract.txt](llms/contract.txt) 31.9 KB
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stitchkit",
3
- "version": "0.113.0",
3
+ "version": "0.113.1",
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",