stitchkit 0.103.1 → 0.103.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.
- package/CHANGELOG.md +9 -0
- package/dist/entrypoints/agent-runtime/coding-tools.js +3 -3
- package/dist/entrypoints/agent-runtime/harness-tools.js +6 -6
- package/dist/entrypoints/agent-runtime/harness.js +4 -4
- package/dist/entrypoints/agent-runtime/sandbox.js +3 -3
- package/dist/entrypoints/agent-runtime.js +8 -8
- package/dist/entrypoints/cli.js +6 -6
- package/dist/entrypoints/testing.js +1 -1
- package/dist/entrypoints/tools/connections.js +2 -2
- package/dist/entrypoints/tools/invoker.js +4 -4
- package/dist/entrypoints/tools.js +9 -9
- package/dist/{index-kkk1wzsq.js → index-1br6gwhf.js} +4 -4
- package/dist/{index-xgc94hy6.js → index-1khy8y7n.js} +3 -3
- package/dist/{index-z3pqcy7r.js → index-90ppdx3q.js} +1 -1
- package/dist/{index-djjhhgjk.js → index-a4ajxwmb.js} +1 -1
- package/dist/{index-x1dkwx5x.js → index-dnn9z96q.js} +3 -3
- package/dist/{index-860vjkgm.js → index-kmpzj1cq.js} +1 -1
- package/dist/{index-0efgsyav.js → index-m2xqkv55.js} +1 -1
- package/dist/{index-ds7jdhep.js → index-n2gre124.js} +3 -3
- package/dist/{index-kgmh97hf.js → index-r956rndn.js} +2 -2
- package/dist/{index-jzczzcsb.js → index-tgzhq07n.js} +1 -1
- package/dist/{index-7z9ym7t8.js → index-x87j7csh.js} +35 -14
- package/dist/tools/schema/flatten-join.d.ts +1 -1
- package/dist/tools/schema/flatten-join.d.ts.map +1 -1
- package/dist/tools/schema/flatten.d.ts.map +1 -1
- package/llms/tools.3.txt +1 -1
- package/llms/tools.txt +19 -1
- package/llms-full.txt +20 -2
- package/llms.txt +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,15 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
|
|
|
15
15
|
|
|
16
16
|
## [Unreleased]
|
|
17
17
|
|
|
18
|
+
## [0.103.2] — 2026-10-01
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- Flattened tool schemas retain distinct field descriptions with their discriminator
|
|
23
|
+
labels, and advertise both availability and conditional requiredness. Structural
|
|
24
|
+
deduplication keeps explanations separate from validation constraints; MCP, agent
|
|
25
|
+
tools and manifests share the same projection. Runtime Zod validation is unchanged.
|
|
26
|
+
|
|
18
27
|
## [0.103.1] — 2026-09-30
|
|
19
28
|
|
|
20
29
|
### Added
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import"../../index-ct75c3at.js";
|
|
2
|
-
import"../../index-
|
|
2
|
+
import"../../index-x87j7csh.js";
|
|
3
3
|
import"../../index-n53mswt3.js";
|
|
4
4
|
import"../../index-b2bz0kdm.js";
|
|
5
5
|
import {
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
AgentCodingToolAuthorizationSchema2,
|
|
8
8
|
AgentCodingToolPathAuthorizationSchema2,
|
|
9
9
|
createAgentCodingTools2
|
|
10
|
-
} from "../../index-
|
|
10
|
+
} from "../../index-a4ajxwmb.js";
|
|
11
11
|
import"../../index-ahvsksw5.js";
|
|
12
|
-
import"../../index-
|
|
12
|
+
import"../../index-tgzhq07n.js";
|
|
13
13
|
export {
|
|
14
14
|
AgentCodingToolAuthorizationSchema2 as AgentCodingToolAuthorizationSchema,
|
|
15
15
|
AgentCodingToolLimitsSchema2 as AgentCodingToolLimitsSchema,
|
|
@@ -4,18 +4,18 @@ import"../../index-b2bz0kdm.js";
|
|
|
4
4
|
import"../../index-yex7eg1v.js";
|
|
5
5
|
import"../../index-9pw0a51a.js";
|
|
6
6
|
import"../../index-ct75c3at.js";
|
|
7
|
-
import"../../index-
|
|
8
|
-
import"../../index-
|
|
9
|
-
import"../../index-
|
|
7
|
+
import"../../index-x87j7csh.js";
|
|
8
|
+
import"../../index-m2xqkv55.js";
|
|
9
|
+
import"../../index-r956rndn.js";
|
|
10
10
|
import {
|
|
11
11
|
mountAgent2
|
|
12
|
-
} from "../../index-
|
|
12
|
+
} from "../../index-1khy8y7n.js";
|
|
13
13
|
import {
|
|
14
14
|
composeToolLifecycle2
|
|
15
15
|
} from "../../index-ze1eph1k.js";
|
|
16
|
-
import"../../index-
|
|
16
|
+
import"../../index-dnn9z96q.js";
|
|
17
17
|
import"../../index-7n68nmc6.js";
|
|
18
|
-
import"../../index-
|
|
18
|
+
import"../../index-tgzhq07n.js";
|
|
19
19
|
|
|
20
20
|
// src/agent-runtime/harness-tools.ts
|
|
21
21
|
function createAgentHarnessTools(resolve) {
|
|
@@ -5,7 +5,7 @@ import"../../index-8kzct1d6.js";
|
|
|
5
5
|
import {
|
|
6
6
|
composeAgentPrompt2,
|
|
7
7
|
createAgentRuntime2
|
|
8
|
-
} from "../../index-
|
|
8
|
+
} from "../../index-90ppdx3q.js";
|
|
9
9
|
import"../../index-h97tqqp1.js";
|
|
10
10
|
import"../../index-mnkk1ffz.js";
|
|
11
11
|
import"../../index-n53mswt3.js";
|
|
@@ -13,8 +13,8 @@ import"../../index-b2bz0kdm.js";
|
|
|
13
13
|
import"../../index-yex7eg1v.js";
|
|
14
14
|
import"../../index-9pw0a51a.js";
|
|
15
15
|
import"../../index-ct75c3at.js";
|
|
16
|
-
import"../../index-
|
|
17
|
-
import"../../index-
|
|
16
|
+
import"../../index-x87j7csh.js";
|
|
17
|
+
import"../../index-m2xqkv55.js";
|
|
18
18
|
import"../../index-5vyd0fkb.js";
|
|
19
19
|
import"../../index-nggfa2yn.js";
|
|
20
20
|
import"../../index-r5hsgkz5.js";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
import"../../index-7n68nmc6.js";
|
|
30
30
|
import {
|
|
31
31
|
defineRuntimeTool2
|
|
32
|
-
} from "../../index-
|
|
32
|
+
} from "../../index-tgzhq07n.js";
|
|
33
33
|
|
|
34
34
|
// src/agent-runtime/harness-contract.ts
|
|
35
35
|
import { z } from "zod";
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
} from "../../index-ahvsksw5.js";
|
|
6
6
|
import"../../index-n53mswt3.js";
|
|
7
7
|
import"../../index-ct75c3at.js";
|
|
8
|
-
import"../../index-
|
|
8
|
+
import"../../index-x87j7csh.js";
|
|
9
9
|
import"../../index-b2bz0kdm.js";
|
|
10
10
|
import {
|
|
11
11
|
createAgentCodingTools2
|
|
12
|
-
} from "../../index-
|
|
13
|
-
import"../../index-
|
|
12
|
+
} from "../../index-a4ajxwmb.js";
|
|
13
|
+
import"../../index-tgzhq07n.js";
|
|
14
14
|
|
|
15
15
|
// src/agent-runtime/sandbox-bubblewrap.ts
|
|
16
16
|
import { mkdir as mkdir2, mkdtemp, realpath, rm as rm2 } from "node:fs/promises";
|
|
@@ -110,7 +110,7 @@ import {
|
|
|
110
110
|
agentGoalStateSlot2,
|
|
111
111
|
agentTodoStateSlot2,
|
|
112
112
|
createAgentRuntime2
|
|
113
|
-
} from "../index-
|
|
113
|
+
} from "../index-90ppdx3q.js";
|
|
114
114
|
import {
|
|
115
115
|
AgentConversationSummarySchema2,
|
|
116
116
|
AgentConversationPageSchema2,
|
|
@@ -125,12 +125,12 @@ import {
|
|
|
125
125
|
} from "../index-yex7eg1v.js";
|
|
126
126
|
import"../index-9pw0a51a.js";
|
|
127
127
|
import"../index-ct75c3at.js";
|
|
128
|
-
import"../index-
|
|
129
|
-
import"../index-
|
|
130
|
-
import"../index-
|
|
128
|
+
import"../index-x87j7csh.js";
|
|
129
|
+
import"../index-m2xqkv55.js";
|
|
130
|
+
import"../index-r956rndn.js";
|
|
131
131
|
import {
|
|
132
132
|
mountAgent2
|
|
133
|
-
} from "../index-
|
|
133
|
+
} from "../index-1khy8y7n.js";
|
|
134
134
|
import {
|
|
135
135
|
createBoundedSinkManager
|
|
136
136
|
} from "../index-h97tqqp1.js";
|
|
@@ -192,13 +192,13 @@ import {
|
|
|
192
192
|
} from "../index-vgkbcnkc.js";
|
|
193
193
|
import {
|
|
194
194
|
buildToolManifest2
|
|
195
|
-
} from "../index-
|
|
196
|
-
import"../index-
|
|
195
|
+
} from "../index-kmpzj1cq.js";
|
|
196
|
+
import"../index-dnn9z96q.js";
|
|
197
197
|
import"../index-7n68nmc6.js";
|
|
198
198
|
import {
|
|
199
199
|
defineRuntimeTool2,
|
|
200
200
|
executableAgentRuntimeTools
|
|
201
|
-
} from "../index-
|
|
201
|
+
} from "../index-tgzhq07n.js";
|
|
202
202
|
|
|
203
203
|
// src/agent-runtime/child-tools.ts
|
|
204
204
|
import { z as z2 } from "zod";
|
package/dist/entrypoints/cli.js
CHANGED
|
@@ -18,25 +18,25 @@ import {
|
|
|
18
18
|
renderCliView2,
|
|
19
19
|
pollUntilDone2,
|
|
20
20
|
createCli2
|
|
21
|
-
} from "../index-
|
|
21
|
+
} from "../index-1br6gwhf.js";
|
|
22
22
|
import {
|
|
23
23
|
AppError2
|
|
24
24
|
} from "../index-n53mswt3.js";
|
|
25
25
|
import"../index-b2bz0kdm.js";
|
|
26
|
-
import"../index-
|
|
26
|
+
import"../index-m2xqkv55.js";
|
|
27
27
|
import"../index-ct75c3at.js";
|
|
28
|
-
import"../index-
|
|
28
|
+
import"../index-x87j7csh.js";
|
|
29
29
|
import"../index-yex7eg1v.js";
|
|
30
|
-
import"../index-
|
|
30
|
+
import"../index-r956rndn.js";
|
|
31
31
|
import {
|
|
32
32
|
writeFileAtomicSync2
|
|
33
33
|
} from "../index-aan6hqb9.js";
|
|
34
|
-
import"../index-
|
|
34
|
+
import"../index-dnn9z96q.js";
|
|
35
35
|
import {
|
|
36
36
|
argumentsDigest
|
|
37
37
|
} from "../index-r7a7r7ha.js";
|
|
38
38
|
import"../index-7n68nmc6.js";
|
|
39
|
-
import"../index-
|
|
39
|
+
import"../index-tgzhq07n.js";
|
|
40
40
|
import {
|
|
41
41
|
serializeCanonicalJson
|
|
42
42
|
} from "../index-zsvzhjtk.js";
|
|
@@ -2,14 +2,14 @@ import"../../index-ct75c3at.js";
|
|
|
2
2
|
import {
|
|
3
3
|
declaresDraft07,
|
|
4
4
|
withDefsDialect
|
|
5
|
-
} from "../../index-
|
|
5
|
+
} from "../../index-x87j7csh.js";
|
|
6
6
|
import {
|
|
7
7
|
AppError2
|
|
8
8
|
} from "../../index-n53mswt3.js";
|
|
9
9
|
import"../../index-b2bz0kdm.js";
|
|
10
10
|
import {
|
|
11
11
|
defineRuntimeTool2
|
|
12
|
-
} from "../../index-
|
|
12
|
+
} from "../../index-tgzhq07n.js";
|
|
13
13
|
import {
|
|
14
14
|
safeJsonParse
|
|
15
15
|
} from "../../index-zsarb5xp.js";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import"../../index-n53mswt3.js";
|
|
2
2
|
import"../../index-b2bz0kdm.js";
|
|
3
|
-
import"../../index-
|
|
3
|
+
import"../../index-m2xqkv55.js";
|
|
4
4
|
import"../../index-yex7eg1v.js";
|
|
5
5
|
import"../../index-9pw0a51a.js";
|
|
6
6
|
import"../../index-ct75c3at.js";
|
|
7
|
-
import"../../index-
|
|
8
|
-
import"../../index-
|
|
7
|
+
import"../../index-x87j7csh.js";
|
|
8
|
+
import"../../index-r956rndn.js";
|
|
9
9
|
import {
|
|
10
10
|
createToolInvoker2
|
|
11
|
-
} from "../../index-
|
|
11
|
+
} from "../../index-n2gre124.js";
|
|
12
12
|
import"../../index-7n68nmc6.js";
|
|
13
13
|
export {
|
|
14
14
|
createToolInvoker2 as createToolInvoker
|
|
@@ -35,21 +35,21 @@ import {
|
|
|
35
35
|
presentationMetadata,
|
|
36
36
|
findUntypedProperties2,
|
|
37
37
|
prepareProjectedMcpTools
|
|
38
|
-
} from "../index-
|
|
38
|
+
} from "../index-x87j7csh.js";
|
|
39
39
|
import {
|
|
40
40
|
parseToolCallArguments,
|
|
41
41
|
toolResultFromError,
|
|
42
42
|
ToolExecutionControlError2,
|
|
43
43
|
isToolExecutionControlError2
|
|
44
|
-
} from "../index-
|
|
44
|
+
} from "../index-m2xqkv55.js";
|
|
45
45
|
import {
|
|
46
46
|
collectTools2,
|
|
47
47
|
createToolRunner,
|
|
48
48
|
formatToolError
|
|
49
|
-
} from "../index-
|
|
49
|
+
} from "../index-r956rndn.js";
|
|
50
50
|
import {
|
|
51
51
|
mountAgent2
|
|
52
|
-
} from "../index-
|
|
52
|
+
} from "../index-1khy8y7n.js";
|
|
53
53
|
import"../index-m38ej7e5.js";
|
|
54
54
|
import {
|
|
55
55
|
ALL_TRANSPORTS2,
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
WaitTimeoutError,
|
|
78
78
|
runWaitOperation,
|
|
79
79
|
createCli2
|
|
80
|
-
} from "../index-
|
|
80
|
+
} from "../index-1br6gwhf.js";
|
|
81
81
|
import {
|
|
82
82
|
ManagedFilePathSchema2,
|
|
83
83
|
ManagedFileRefSchema2
|
|
@@ -104,16 +104,16 @@ import {
|
|
|
104
104
|
import {
|
|
105
105
|
describeToolCatalog2,
|
|
106
106
|
buildToolManifest2
|
|
107
|
-
} from "../index-
|
|
107
|
+
} from "../index-kmpzj1cq.js";
|
|
108
108
|
import {
|
|
109
109
|
collectToolSurface
|
|
110
|
-
} from "../index-
|
|
110
|
+
} from "../index-dnn9z96q.js";
|
|
111
111
|
import {
|
|
112
112
|
argumentsDigest
|
|
113
113
|
} from "../index-r7a7r7ha.js";
|
|
114
114
|
import {
|
|
115
115
|
createToolInvoker2
|
|
116
|
-
} from "../index-
|
|
116
|
+
} from "../index-n2gre124.js";
|
|
117
117
|
import {
|
|
118
118
|
runWithRequestContext2,
|
|
119
119
|
getRequestContext2,
|
|
@@ -122,7 +122,7 @@ import {
|
|
|
122
122
|
import {
|
|
123
123
|
defineRuntimeTool2,
|
|
124
124
|
createRuntimeToolFactory2
|
|
125
|
-
} from "../index-
|
|
125
|
+
} from "../index-tgzhq07n.js";
|
|
126
126
|
import {
|
|
127
127
|
compareCodeUnits,
|
|
128
128
|
serializeCanonicalJson
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
toolResultFromError,
|
|
6
6
|
toolErrorFromResult
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-m2xqkv55.js";
|
|
8
8
|
import {
|
|
9
9
|
coerceJsonArgs2
|
|
10
10
|
} from "./index-9pw0a51a.js";
|
|
@@ -15,17 +15,17 @@ import {
|
|
|
15
15
|
objectShapeKeys,
|
|
16
16
|
assertUniqueToolName,
|
|
17
17
|
buildToolPresentationSchema
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-x87j7csh.js";
|
|
19
19
|
import {
|
|
20
20
|
createToolRunner,
|
|
21
21
|
formatToolError
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-r956rndn.js";
|
|
23
23
|
import {
|
|
24
24
|
isWithinDir2
|
|
25
25
|
} from "./index-5cc6r990.js";
|
|
26
26
|
import {
|
|
27
27
|
collectToolSurface
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-dnn9z96q.js";
|
|
29
29
|
import {
|
|
30
30
|
formatZodError2
|
|
31
31
|
} from "./index-1eeqpadm.js";
|
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
toolResultFromError,
|
|
7
7
|
toolCauseFromResult,
|
|
8
8
|
isToolExecutionControlError2
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-m2xqkv55.js";
|
|
10
10
|
import {
|
|
11
11
|
createToolRunner,
|
|
12
12
|
formatToolError
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-r956rndn.js";
|
|
14
14
|
import {
|
|
15
15
|
collectToolSurface
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-dnn9z96q.js";
|
|
17
17
|
import {
|
|
18
18
|
isRecord
|
|
19
19
|
} from "./index-9jfdm5tg.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
projectToolSurface
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-x87j7csh.js";
|
|
4
4
|
import {
|
|
5
5
|
contractToolMountable
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-r956rndn.js";
|
|
7
7
|
import {
|
|
8
8
|
runtimeToolMountable
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-tgzhq07n.js";
|
|
10
10
|
|
|
11
11
|
// src/tools/surface.ts
|
|
12
12
|
function collectToolSurface({
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
} from "./index-n53mswt3.js";
|
|
4
4
|
import {
|
|
5
5
|
toolErrorFromResult
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-m2xqkv55.js";
|
|
7
7
|
import {
|
|
8
8
|
assertUniqueToolName
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-x87j7csh.js";
|
|
10
10
|
import {
|
|
11
11
|
collectTools2,
|
|
12
12
|
createToolRunner
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-r956rndn.js";
|
|
14
14
|
|
|
15
15
|
// src/tools/invoker.ts
|
|
16
16
|
function createToolInvoker2(services, config) {
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
mergeSchemas,
|
|
7
7
|
assertToolExtensionCompatible,
|
|
8
8
|
projectToolSurface
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-x87j7csh.js";
|
|
10
10
|
import {
|
|
11
11
|
toolErrorFromResult,
|
|
12
12
|
executeToolMethod
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-m2xqkv55.js";
|
|
14
14
|
|
|
15
15
|
// src/tools/mount.ts
|
|
16
16
|
import { z } from "zod";
|
|
@@ -308,7 +308,26 @@ function commonBaseType(schemas) {
|
|
|
308
308
|
const types = normalizeTypes(nullable ? [...bases, "null"] : bases);
|
|
309
309
|
return types.length > 0 ? { type: types } : {};
|
|
310
310
|
}
|
|
311
|
-
function
|
|
311
|
+
function describeVariants(properties, discriminator) {
|
|
312
|
+
const groups = new Map;
|
|
313
|
+
for (const { schema, labels } of properties) {
|
|
314
|
+
if (typeof schema.description !== "string")
|
|
315
|
+
continue;
|
|
316
|
+
const group = groups.get(schema.description) ?? [];
|
|
317
|
+
group.push(...labels);
|
|
318
|
+
groups.set(schema.description, group);
|
|
319
|
+
}
|
|
320
|
+
if (groups.size === 0)
|
|
321
|
+
return;
|
|
322
|
+
if (groups.size === 1 && properties.every(({ schema }) => typeof schema.description === "string")) {
|
|
323
|
+
return groups.keys().next().value;
|
|
324
|
+
}
|
|
325
|
+
return [...groups].map(([description, labels]) => ({
|
|
326
|
+
description,
|
|
327
|
+
labels: [...new Set(labels)].sort().join(" | ")
|
|
328
|
+
})).sort((left, right) => left.labels < right.labels ? -1 : left.labels > right.labels ? 1 : 0).map(({ description, labels }) => `When ${discriminator} = ${labels}: ${description}`).join(" ");
|
|
329
|
+
}
|
|
330
|
+
function mergePropertySchemas(properties, discriminator) {
|
|
312
331
|
const schemas = properties.map((property) => nullableProjection(property.schema));
|
|
313
332
|
const structural = schemas.map(withoutAnnotations);
|
|
314
333
|
const [first] = structural;
|
|
@@ -318,13 +337,14 @@ function mergePropertySchemas(properties) {
|
|
|
318
337
|
} else {
|
|
319
338
|
const values = schemas.map(stringValues);
|
|
320
339
|
const allStrings = values.every((value) => value !== null);
|
|
321
|
-
merged = allStrings ? { type: "string", enum: [...new Set(values.flatMap((value) => value ?? []))] } : commonBaseType(structural);
|
|
322
|
-
}
|
|
323
|
-
const
|
|
324
|
-
...
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
340
|
+
merged = allStrings ? { type: "string", enum: [...new Set(values.flatMap((value) => value ?? []))].sort() } : commonBaseType(structural);
|
|
341
|
+
}
|
|
342
|
+
const description = describeVariants(properties.map((property, index) => ({
|
|
343
|
+
...property,
|
|
344
|
+
schema: typeof property.schema.description === "string" ? property.schema : schemas[index] ?? property.schema
|
|
345
|
+
})), discriminator);
|
|
346
|
+
if (description !== undefined)
|
|
347
|
+
merged.description = description;
|
|
328
348
|
return merged;
|
|
329
349
|
}
|
|
330
350
|
|
|
@@ -434,20 +454,21 @@ function flattenNode(node) {
|
|
|
434
454
|
});
|
|
435
455
|
}
|
|
436
456
|
const properties = {
|
|
437
|
-
[discriminator.key]: mergePropertySchemas(discriminatorProperties)
|
|
457
|
+
[discriminator.key]: mergePropertySchemas(discriminatorProperties, discriminator.key)
|
|
438
458
|
};
|
|
439
459
|
const required = [discriminator.key];
|
|
440
|
-
for (const [key, entries] of perKey) {
|
|
441
|
-
let merged = mergePropertySchemas(entries);
|
|
460
|
+
for (const [key, entries] of [...perKey].sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0)) {
|
|
461
|
+
let merged = mergePropertySchemas(entries, discriminator.key);
|
|
442
462
|
const requiredEverywhere = entries.length === variants.length && entries.every((entry) => entry.required);
|
|
443
463
|
if (requiredEverywhere) {
|
|
444
464
|
required.push(key);
|
|
445
465
|
} else {
|
|
446
466
|
const requiredLabels = entries.filter((entry) => entry.required).flatMap((entry) => entry.labels);
|
|
447
467
|
const presentLabels = entries.flatMap((entry) => entry.labels);
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
468
|
+
merged = appendHint(merged, `Available if ${discriminator.key} = ${[...new Set(presentLabels)].sort().join(" | ")}.`);
|
|
469
|
+
if (requiredLabels.length > 0) {
|
|
470
|
+
merged = appendHint(merged, `Required if ${discriminator.key} = ${[...new Set(requiredLabels)].sort().join(" | ")}`);
|
|
471
|
+
}
|
|
451
472
|
}
|
|
452
473
|
properties[key] = merged;
|
|
453
474
|
}
|
|
@@ -6,5 +6,5 @@ export interface VariantProperty {
|
|
|
6
6
|
}
|
|
7
7
|
/** The string members of a `const`/`enum`, or `null` when any member is not one. */
|
|
8
8
|
export declare function stringValues(schema: ToolPresentationSchema): string[] | null;
|
|
9
|
-
export declare function mergePropertySchemas(properties: VariantProperty[]): ToolPresentationSchema;
|
|
9
|
+
export declare function mergePropertySchemas(properties: VariantProperty[], discriminator: string): ToolPresentationSchema;
|
|
10
10
|
//# sourceMappingURL=flatten-join.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flatten-join.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/flatten-join.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,sBAAsB,CAAC;IAC/B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAsED,oFAAoF;AACpF,wBAAgB,YAAY,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,EAAE,GAAG,IAAI,CAK5E;
|
|
1
|
+
{"version":3,"file":"flatten-join.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/flatten-join.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,sBAAsB,CAAC;IAC/B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAsED,oFAAoF;AACpF,wBAAgB,YAAY,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,EAAE,GAAG,IAAI,CAK5E;AAsKD,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,eAAe,EAAE,EAC7B,aAAa,EAAE,MAAM,GACpB,sBAAsB,CAiCxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/flatten.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../../src/tools/schema/flatten.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AA4J7D;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,sBAAsB,GAAG,sBAAsB,CAG5F;AAED,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,sBAAsB,GAAG,sBAAsB,CAG3F"}
|
package/llms/tools.3.txt
CHANGED
|
@@ -280,7 +280,7 @@ Advanced building blocks — the shared machinery the mounts are built on.
|
|
|
280
280
|
| `ToolSurfaceDefinition` | _type_ | shared object-shaped `{ services?, runtimeTools? }` introspection surface |
|
|
281
281
|
| `ToolManifestConfig` | _type_ | mixed surface plus required model-facing `transport` and presentation options |
|
|
282
282
|
| `coerceJsonArgs` | function | coerce JSON-stringified array/object tool arguments |
|
|
283
|
-
| `flattenToolJsonSchema` | function | project structurally identifiable discriminated unions into conservative object joins;
|
|
283
|
+
| `flattenToolJsonSchema` | function | project structurally identifiable discriminated unions into conservative object joins; scalar collisions retain provable types, object/array collisions retain structural alternatives, and field descriptions retain discriminator labels plus availability/requiredness hints; the projection never executes validation |
|
|
284
284
|
| `ToolPresentationSchema` | _type_ | immutable model-facing JSON Schema document shared by tool transports |
|
|
285
285
|
| `MountableTool` | _type_ | one operation with separate executable CLI argument schema and model-facing presentation schema |
|
|
286
286
|
| `ToolManifestEntry` | _type_ | one `buildToolManifest` row |
|
package/llms/tools.txt
CHANGED
|
@@ -714,7 +714,25 @@ Capable models (Claude, Gemini, GPT) handle that; weaker / cheaper ones can drop
|
|
|
714
714
|
the field or mangle its strings. Set `flattenUnionInput: true` (on
|
|
715
715
|
`createMcpHandler` / `mountMcp` / `mountAgent`) to advertise each discriminated
|
|
716
716
|
union as a **single flat object** instead — the discriminator becomes an enum and
|
|
717
|
-
each
|
|
717
|
+
each field required by every variant stays required. Other fields become optional
|
|
718
|
+
with `Available if <disc> = …` and, where applicable, `Required if <disc> = …` hints.
|
|
719
|
+
|
|
720
|
+
**Branch explanations keep their meaning.** A shared description appears once;
|
|
721
|
+
different descriptions are grouped by text and qualified with `When <disc> = …:`.
|
|
722
|
+
A branch without a description does not inherit another branch's explanation.
|
|
723
|
+
For example, an optional object `value` in `single` and a required array `value`
|
|
724
|
+
in `group` advertise:
|
|
725
|
+
|
|
726
|
+
```text
|
|
727
|
+
When kind = group: Two to ten references.
|
|
728
|
+
When kind = single: One reference.
|
|
729
|
+
Available if kind = group | single. Required if kind = group
|
|
730
|
+
```
|
|
731
|
+
|
|
732
|
+
A third branch without `value` is absent from those labels. The object and array
|
|
733
|
+
retain their separate shapes; the array's minimum length does not apply to the object.
|
|
734
|
+
Discriminator values, branch explanation labels and joined property order are
|
|
735
|
+
deterministic under branch reordering. → ADR [0221](../decisions/0221-flat-field-explanations-retain-branch-meaning.md).
|
|
718
736
|
|
|
719
737
|
**A field several variants declare keeps its type.** Flattening puts every
|
|
720
738
|
variant's fields side by side, so a key two variants share has to be advertised
|
package/llms-full.txt
CHANGED
|
@@ -4177,7 +4177,25 @@ Capable models (Claude, Gemini, GPT) handle that; weaker / cheaper ones can drop
|
|
|
4177
4177
|
the field or mangle its strings. Set `flattenUnionInput: true` (on
|
|
4178
4178
|
`createMcpHandler` / `mountMcp` / `mountAgent`) to advertise each discriminated
|
|
4179
4179
|
union as a **single flat object** instead — the discriminator becomes an enum and
|
|
4180
|
-
each
|
|
4180
|
+
each field required by every variant stays required. Other fields become optional
|
|
4181
|
+
with `Available if <disc> = …` and, where applicable, `Required if <disc> = …` hints.
|
|
4182
|
+
|
|
4183
|
+
**Branch explanations keep their meaning.** A shared description appears once;
|
|
4184
|
+
different descriptions are grouped by text and qualified with `When <disc> = …:`.
|
|
4185
|
+
A branch without a description does not inherit another branch's explanation.
|
|
4186
|
+
For example, an optional object `value` in `single` and a required array `value`
|
|
4187
|
+
in `group` advertise:
|
|
4188
|
+
|
|
4189
|
+
```text
|
|
4190
|
+
When kind = group: Two to ten references.
|
|
4191
|
+
When kind = single: One reference.
|
|
4192
|
+
Available if kind = group | single. Required if kind = group
|
|
4193
|
+
```
|
|
4194
|
+
|
|
4195
|
+
A third branch without `value` is absent from those labels. The object and array
|
|
4196
|
+
retain their separate shapes; the array's minimum length does not apply to the object.
|
|
4197
|
+
Discriminator values, branch explanation labels and joined property order are
|
|
4198
|
+
deterministic under branch reordering. → ADR [0221](../decisions/0221-flat-field-explanations-retain-branch-meaning.md).
|
|
4181
4199
|
|
|
4182
4200
|
**A field several variants declare keeps its type.** Flattening puts every
|
|
4183
4201
|
variant's fields side by side, so a key two variants share has to be advertised
|
|
@@ -20216,7 +20234,7 @@ Advanced building blocks — the shared machinery the mounts are built on.
|
|
|
20216
20234
|
| `ToolSurfaceDefinition` | _type_ | shared object-shaped `{ services?, runtimeTools? }` introspection surface |
|
|
20217
20235
|
| `ToolManifestConfig` | _type_ | mixed surface plus required model-facing `transport` and presentation options |
|
|
20218
20236
|
| `coerceJsonArgs` | function | coerce JSON-stringified array/object tool arguments |
|
|
20219
|
-
| `flattenToolJsonSchema` | function | project structurally identifiable discriminated unions into conservative object joins;
|
|
20237
|
+
| `flattenToolJsonSchema` | function | project structurally identifiable discriminated unions into conservative object joins; scalar collisions retain provable types, object/array collisions retain structural alternatives, and field descriptions retain discriminator labels plus availability/requiredness hints; the projection never executes validation |
|
|
20220
20238
|
| `ToolPresentationSchema` | _type_ | immutable model-facing JSON Schema document shared by tool transports |
|
|
20221
20239
|
| `MountableTool` | _type_ | one operation with separate executable CLI argument schema and model-facing presentation schema |
|
|
20222
20240
|
| `ToolManifestEntry` | _type_ | one `buildToolManifest` row |
|
package/llms.txt
CHANGED
|
@@ -13,7 +13,7 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
|
|
|
13
13
|
- **stitchkit/live**: [llms/live.txt](llms/live.txt) 21.6 KB
|
|
14
14
|
- **stitchkit/react**: [llms/react.txt](llms/react.txt) 9.0 KB
|
|
15
15
|
- **stitchkit/react/keyboard**: [llms/react-keyboard.txt](llms/react-keyboard.txt) 9.4 KB
|
|
16
|
-
- **stitchkit/tools**: [llms/tools.txt](llms/tools.txt) 45.
|
|
16
|
+
- **stitchkit/tools**: [llms/tools.txt](llms/tools.txt) 45.9 KB → [llms/tools.2.txt](llms/tools.2.txt) 26.9 KB → [llms/tools.3.txt](llms/tools.3.txt) 25.5 KB
|
|
17
17
|
- **stitchkit/tools/contract**: [llms/tools-contract.txt](llms/tools-contract.txt) 0.2 KB
|
|
18
18
|
- **stitchkit/tools/invoker**: [llms/tools-invoker.txt](llms/tools-invoker.txt) 0.2 KB
|
|
19
19
|
- **stitchkit/tools/connections**: [llms/tools-connections.txt](llms/tools-connections.txt) 3.1 KB
|
package/package.json
CHANGED