stitchkit 0.103.1 → 0.103.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.
- package/CHANGELOG.md +17 -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-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-kkk1wzsq.js → index-ahtnte39.js} +46 -6
- 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/cli/help.d.ts.map +1 -1
- 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/cli.txt +13 -0
- package/llms/tools.3.txt +1 -1
- package/llms/tools.txt +19 -1
- package/llms-full.txt +33 -2
- package/llms.txt +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,23 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
|
|
|
15
15
|
|
|
16
16
|
## [Unreleased]
|
|
17
17
|
|
|
18
|
+
## [0.103.3] — 2026-10-01
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- CLI help displays schema numeric bounds, string lengths and array item counts for
|
|
23
|
+
contract, runtime and native commands, and application options. Alternative schemas
|
|
24
|
+
keep their bounds in separate branches; argument validation is unchanged.
|
|
25
|
+
|
|
26
|
+
## [0.103.2] — 2026-10-01
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- Flattened tool schemas retain distinct field descriptions with their discriminator
|
|
31
|
+
labels, and advertise both availability and conditional requiredness. Structural
|
|
32
|
+
deduplication keeps explanations separate from validation constraints; MCP, agent
|
|
33
|
+
tools and manifests share the same projection. Runtime Zod validation is unchanged.
|
|
34
|
+
|
|
18
35
|
## [0.103.1] — 2026-09-30
|
|
19
36
|
|
|
20
37
|
### 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-ahtnte39.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-ahtnte39.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
|
|
@@ -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";
|
|
@@ -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";
|
|
@@ -1811,6 +1811,46 @@ function typeLabel(schema) {
|
|
|
1811
1811
|
return schema.type;
|
|
1812
1812
|
return "value";
|
|
1813
1813
|
}
|
|
1814
|
+
function constraintLabel(schema) {
|
|
1815
|
+
const limits = [];
|
|
1816
|
+
const bounds = [
|
|
1817
|
+
["minimum", ">="],
|
|
1818
|
+
["exclusiveMinimum", ">"],
|
|
1819
|
+
["maximum", "<="],
|
|
1820
|
+
["exclusiveMaximum", "<"],
|
|
1821
|
+
["minLength", "length >="],
|
|
1822
|
+
["maxLength", "length <="],
|
|
1823
|
+
["minItems", "items >="],
|
|
1824
|
+
["maxItems", "items <="]
|
|
1825
|
+
];
|
|
1826
|
+
for (const [keyword, label] of bounds) {
|
|
1827
|
+
const bound = schema[keyword];
|
|
1828
|
+
if (typeof bound === "number")
|
|
1829
|
+
limits.push(`${label}${bound}`);
|
|
1830
|
+
}
|
|
1831
|
+
const compositions = [
|
|
1832
|
+
["anyOf", "any of", " | "],
|
|
1833
|
+
["oneOf", "one of", " | "],
|
|
1834
|
+
["allOf", "all of", " & "]
|
|
1835
|
+
];
|
|
1836
|
+
for (const [keyword, label, separator] of compositions) {
|
|
1837
|
+
const members = schema[keyword];
|
|
1838
|
+
if (!Array.isArray(members))
|
|
1839
|
+
continue;
|
|
1840
|
+
const branches = members.map((member) => {
|
|
1841
|
+
const constraints = isRecord(member) ? constraintLabel(member) : "";
|
|
1842
|
+
const type = isRecord(member) ? typeLabel(member) : member === false ? "no value" : "any value";
|
|
1843
|
+
return { constraints, text: `${type}${constraints}` };
|
|
1844
|
+
});
|
|
1845
|
+
if (branches.every((branch) => branch.constraints === ""))
|
|
1846
|
+
continue;
|
|
1847
|
+
limits.push(`${label}: ${branches.map((branch) => branch.text).join(separator)}`);
|
|
1848
|
+
}
|
|
1849
|
+
return limits.length === 0 ? "" : ` [${limits.join(", ")}]`;
|
|
1850
|
+
}
|
|
1851
|
+
function fieldTypeLabel(schema) {
|
|
1852
|
+
return `<${typeLabel(schema)}>${constraintLabel(schema)}`;
|
|
1853
|
+
}
|
|
1814
1854
|
function padRight(text, width) {
|
|
1815
1855
|
return text.length >= width ? text : text + " ".repeat(width - text.length);
|
|
1816
1856
|
}
|
|
@@ -1824,7 +1864,7 @@ function summarize(desc) {
|
|
|
1824
1864
|
function applicationOptionLines(fields) {
|
|
1825
1865
|
if (fields.length === 0)
|
|
1826
1866
|
return [];
|
|
1827
|
-
const labels = new Map(fields.map((field) => [field.name, `--${field.name}
|
|
1867
|
+
const labels = new Map(fields.map((field) => [field.name, `--${field.name} ${fieldTypeLabel(field.schema)}`]));
|
|
1828
1868
|
const width = Math.max(...fields.map((field) => labels.get(field.name)?.length ?? 0));
|
|
1829
1869
|
return [
|
|
1830
1870
|
"",
|
|
@@ -1904,7 +1944,7 @@ function renderCommandHelp(name, command, descriptor, applicationOptions = []) {
|
|
|
1904
1944
|
const req = f.required ? " (required)" : "";
|
|
1905
1945
|
const desc = f.description ? ` — ${f.description}` : "";
|
|
1906
1946
|
const label = labels.get(f.name) ?? `--${f.name}`;
|
|
1907
|
-
lines.push(` ${padRight(label, width)}
|
|
1947
|
+
lines.push(` ${padRight(label, width)} ${fieldTypeLabel(f.schema)}${req}${desc}`);
|
|
1908
1948
|
}
|
|
1909
1949
|
const flag = [...kinds].find(([, info]) => info.kind === "boolean")?.[0];
|
|
1910
1950
|
if (flag !== undefined) {
|
|
@@ -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
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/help.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../../src/tools/cli/help.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAAoB,MAAM,+BAA+B,CAAC;AAEvF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AA2GvD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,EAC7C,MAAM,EAAE,MAAM,GACb,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,CASrC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IAC9C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,SAAS,eAAe,EAAE,CAAC;IAC/C,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,MAAM,CAqCT;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,sBAAsB,EAClC,kBAAkB,GAAE,SAAS,eAAe,EAAO,GAClD,MAAM,CA6DR"}
|
|
@@ -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/cli.txt
CHANGED
|
@@ -428,6 +428,19 @@ the argv parser. For example, a required `action` and optional `profile` render
|
|
|
428
428
|
Declared aliases render beside their canonical options, for example
|
|
429
429
|
`-n, --lines`.
|
|
430
430
|
|
|
431
|
+
The argument table and `Application options:` show bounds from their JSON Schema,
|
|
432
|
+
for example `<integer> [>=1, <=50]`, `<string> [length >=1, length <=12]`, and
|
|
433
|
+
`<value…> [items >=2, items <=4]`. Numeric `>` and `<` are exclusive, while `>=`
|
|
434
|
+
and `<=` include the endpoint; a zero limit is displayed too. Unbounded fields
|
|
435
|
+
keep just their type and description. Bounds on an array's items are not bounds
|
|
436
|
+
on the array itself.
|
|
437
|
+
|
|
438
|
+
Composed schemas retain their meaning: `any of:` and `one of:` separate
|
|
439
|
+
alternative branches with `|`, while `all of:` joins constraints with `&`.
|
|
440
|
+
For example, a nullable bounded string renders
|
|
441
|
+
`<value> [any of: string [length >=1] | null]`. These labels describe the input;
|
|
442
|
+
the same contract schema still validates the call.
|
|
443
|
+
|
|
431
444
|
## `--wait` — background-friendly generation
|
|
432
445
|
|
|
433
446
|
`--wait` polls an async result until it is done. It is generic — the core knows
|
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
|
|
@@ -8773,6 +8791,19 @@ the argv parser. For example, a required `action` and optional `profile` render
|
|
|
8773
8791
|
Declared aliases render beside their canonical options, for example
|
|
8774
8792
|
`-n, --lines`.
|
|
8775
8793
|
|
|
8794
|
+
The argument table and `Application options:` show bounds from their JSON Schema,
|
|
8795
|
+
for example `<integer> [>=1, <=50]`, `<string> [length >=1, length <=12]`, and
|
|
8796
|
+
`<value…> [items >=2, items <=4]`. Numeric `>` and `<` are exclusive, while `>=`
|
|
8797
|
+
and `<=` include the endpoint; a zero limit is displayed too. Unbounded fields
|
|
8798
|
+
keep just their type and description. Bounds on an array's items are not bounds
|
|
8799
|
+
on the array itself.
|
|
8800
|
+
|
|
8801
|
+
Composed schemas retain their meaning: `any of:` and `one of:` separate
|
|
8802
|
+
alternative branches with `|`, while `all of:` joins constraints with `&`.
|
|
8803
|
+
For example, a nullable bounded string renders
|
|
8804
|
+
`<value> [any of: string [length >=1] | null]`. These labels describe the input;
|
|
8805
|
+
the same contract schema still validates the call.
|
|
8806
|
+
|
|
8776
8807
|
## `--wait` — background-friendly generation
|
|
8777
8808
|
|
|
8778
8809
|
`--wait` polls an async result until it is done. It is generic — the core knows
|
|
@@ -20216,7 +20247,7 @@ Advanced building blocks — the shared machinery the mounts are built on.
|
|
|
20216
20247
|
| `ToolSurfaceDefinition` | _type_ | shared object-shaped `{ services?, runtimeTools? }` introspection surface |
|
|
20217
20248
|
| `ToolManifestConfig` | _type_ | mixed surface plus required model-facing `transport` and presentation options |
|
|
20218
20249
|
| `coerceJsonArgs` | function | coerce JSON-stringified array/object tool arguments |
|
|
20219
|
-
| `flattenToolJsonSchema` | function | project structurally identifiable discriminated unions into conservative object joins;
|
|
20250
|
+
| `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
20251
|
| `ToolPresentationSchema` | _type_ | immutable model-facing JSON Schema document shared by tool transports |
|
|
20221
20252
|
| `MountableTool` | _type_ | one operation with separate executable CLI argument schema and model-facing presentation schema |
|
|
20222
20253
|
| `ToolManifestEntry` | _type_ | one `buildToolManifest` row |
|
package/llms.txt
CHANGED
|
@@ -13,11 +13,11 @@ 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
|
|
20
|
-
- **stitchkit/cli**: [llms/cli.txt](llms/cli.txt)
|
|
20
|
+
- **stitchkit/cli**: [llms/cli.txt](llms/cli.txt) 43.6 KB → [llms/cli.2.txt](llms/cli.2.txt) 8.1 KB
|
|
21
21
|
- **stitchkit/remote**: [llms/remote.txt](llms/remote.txt) 1.0 KB
|
|
22
22
|
- **stitchkit/contract**: [llms/contract.txt](llms/contract.txt) 31.9 KB
|
|
23
23
|
- **stitchkit/primitives**: [llms/primitives.txt](llms/primitives.txt) 9.3 KB
|
package/package.json
CHANGED