stitchkit 0.88.0 → 0.90.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/CHANGELOG.md +182 -0
  2. package/dist/agent-runtime/child-blocking.d.ts +17 -0
  3. package/dist/agent-runtime/child-blocking.d.ts.map +1 -0
  4. package/dist/agent-runtime/child-budget-policy.d.ts +23 -0
  5. package/dist/agent-runtime/child-budget-policy.d.ts.map +1 -0
  6. package/dist/agent-runtime/children-contract.d.ts +155 -0
  7. package/dist/agent-runtime/children-contract.d.ts.map +1 -0
  8. package/dist/agent-runtime/children.d.ts +4 -99
  9. package/dist/agent-runtime/children.d.ts.map +1 -1
  10. package/dist/agent-runtime/coding-shell-process.d.ts +33 -0
  11. package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -0
  12. package/dist/agent-runtime/coding-tool-contract.d.ts +18 -0
  13. package/dist/agent-runtime/coding-tool-contract.d.ts.map +1 -1
  14. package/dist/agent-runtime/coding-tool-files.d.ts.map +1 -1
  15. package/dist/agent-runtime/coding-tool-listing.d.ts.map +1 -1
  16. package/dist/agent-runtime/coding-tool-search-patch.d.ts.map +1 -1
  17. package/dist/agent-runtime/coding-tool-shell.d.ts.map +1 -1
  18. package/dist/agent-runtime/coding-tool-utf8.d.ts +28 -0
  19. package/dist/agent-runtime/coding-tool-utf8.d.ts.map +1 -0
  20. package/dist/agent-runtime/contained-files.d.ts +20 -0
  21. package/dist/agent-runtime/contained-files.d.ts.map +1 -1
  22. package/dist/agent-runtime/durability-contract.d.ts +176 -0
  23. package/dist/agent-runtime/durability-contract.d.ts.map +1 -0
  24. package/dist/agent-runtime/durability-json.d.ts +3 -0
  25. package/dist/agent-runtime/durability-json.d.ts.map +1 -0
  26. package/dist/agent-runtime/durability-ledger.d.ts +16 -0
  27. package/dist/agent-runtime/durability-ledger.d.ts.map +1 -0
  28. package/dist/agent-runtime/durability-scheduler.d.ts +29 -0
  29. package/dist/agent-runtime/durability-scheduler.d.ts.map +1 -0
  30. package/dist/agent-runtime/durability.d.ts +14 -0
  31. package/dist/agent-runtime/durability.d.ts.map +1 -0
  32. package/dist/agent-runtime/event-search.d.ts.map +1 -1
  33. package/dist/agent-runtime/harness-contract.d.ts +37 -0
  34. package/dist/agent-runtime/harness-contract.d.ts.map +1 -1
  35. package/dist/agent-runtime/harness.d.ts +8 -0
  36. package/dist/agent-runtime/harness.d.ts.map +1 -1
  37. package/dist/agent-runtime/prompt.d.ts +23 -0
  38. package/dist/agent-runtime/prompt.d.ts.map +1 -1
  39. package/dist/agent-runtime/run-execution.d.ts.map +1 -1
  40. package/dist/agent-runtime/runtime-internals.d.ts +4 -0
  41. package/dist/agent-runtime/runtime-internals.d.ts.map +1 -1
  42. package/dist/agent-runtime/runtime.d.ts +13 -0
  43. package/dist/agent-runtime/runtime.d.ts.map +1 -1
  44. package/dist/agent-runtime/sandbox-broker.d.ts +7 -0
  45. package/dist/agent-runtime/sandbox-broker.d.ts.map +1 -0
  46. package/dist/agent-runtime/sandbox-bubblewrap-args.d.ts +9 -0
  47. package/dist/agent-runtime/sandbox-bubblewrap-args.d.ts.map +1 -0
  48. package/dist/agent-runtime/sandbox-bubblewrap-storage.d.ts +22 -0
  49. package/dist/agent-runtime/sandbox-bubblewrap-storage.d.ts.map +1 -0
  50. package/dist/agent-runtime/sandbox-bubblewrap.d.ts +14 -0
  51. package/dist/agent-runtime/sandbox-bubblewrap.d.ts.map +1 -0
  52. package/dist/agent-runtime/sandbox-coding-adapter.d.ts +15 -0
  53. package/dist/agent-runtime/sandbox-coding-adapter.d.ts.map +1 -0
  54. package/dist/agent-runtime/sandbox-coding.d.ts +15 -0
  55. package/dist/agent-runtime/sandbox-coding.d.ts.map +1 -0
  56. package/dist/agent-runtime/sandbox-contract.d.ts +93 -0
  57. package/dist/agent-runtime/sandbox-contract.d.ts.map +1 -0
  58. package/dist/agent-runtime/sandbox-process-owner.d.ts +11 -0
  59. package/dist/agent-runtime/sandbox-process-owner.d.ts.map +1 -0
  60. package/dist/agent-runtime/sandbox-process.d.ts +8 -0
  61. package/dist/agent-runtime/sandbox-process.d.ts.map +1 -0
  62. package/dist/agent-runtime/sandbox-session.d.ts +5 -0
  63. package/dist/agent-runtime/sandbox-session.d.ts.map +1 -0
  64. package/dist/agent-runtime/sandbox.d.ts +19 -0
  65. package/dist/agent-runtime/sandbox.d.ts.map +1 -1
  66. package/dist/agent-runtime/sqlite-purge.d.ts.map +1 -1
  67. package/dist/agent-runtime/sqlite.d.ts.map +1 -1
  68. package/dist/agent-runtime/store-driver.d.ts +127 -0
  69. package/dist/agent-runtime/store-driver.d.ts.map +1 -1
  70. package/dist/agent-runtime/store-events.d.ts +104 -0
  71. package/dist/agent-runtime/store-events.d.ts.map +1 -1
  72. package/dist/agent-runtime/store-migrations/v2-to-v3.d.ts +14 -0
  73. package/dist/agent-runtime/store-migrations/v2-to-v3.d.ts.map +1 -0
  74. package/dist/agent-runtime/store.d.ts +115 -0
  75. package/dist/agent-runtime/store.d.ts.map +1 -1
  76. package/dist/agent-runtime-coding-tools.js +11 -1247
  77. package/dist/agent-runtime-harness.d.ts +1 -1
  78. package/dist/agent-runtime-harness.d.ts.map +1 -1
  79. package/dist/agent-runtime-harness.js +65 -15
  80. package/dist/agent-runtime-openrouter.d.ts +3 -12
  81. package/dist/agent-runtime-openrouter.d.ts.map +1 -1
  82. package/dist/agent-runtime-openrouter.js +10 -7
  83. package/dist/agent-runtime-sandbox.d.ts +5 -0
  84. package/dist/agent-runtime-sandbox.d.ts.map +1 -0
  85. package/dist/agent-runtime-sandbox.js +797 -0
  86. package/dist/agent-runtime-sqlite-bun.js +3 -3
  87. package/dist/agent-runtime-sqlite-node.js +3 -3
  88. package/dist/agent-runtime.d.ts +5 -4
  89. package/dist/agent-runtime.d.ts.map +1 -1
  90. package/dist/agent-runtime.js +259 -65
  91. package/dist/application/watch-hub.d.ts +24 -2
  92. package/dist/application/watch-hub.d.ts.map +1 -1
  93. package/dist/application.js +127 -37
  94. package/dist/cli.js +8 -8
  95. package/dist/index-2na0qrfn.js +214 -0
  96. package/dist/{index-rcgsnrr6.js → index-31jw8fjq.js} +3 -3
  97. package/dist/{index-9hw9eq48.js → index-7601qfg1.js} +14 -14
  98. package/dist/{index-3xnq72rz.js → index-7rkhw9ec.js} +14 -1
  99. package/dist/{index-0vfdh685.js → index-8c3a7m4g.js} +1 -1
  100. package/dist/{index-t7gh5w3v.js → index-bn2cjajt.js} +27 -6
  101. package/dist/index-cp20z0n6.js +1351 -0
  102. package/dist/{index-qp3vshvc.js → index-fadnxwna.js} +87 -5
  103. package/dist/{index-v1qk37y9.js → index-hrbajay7.js} +106 -4
  104. package/dist/{index-p86mxmpp.js → index-hw2chdvy.js} +646 -43
  105. package/dist/{index-0ydchz76.js → index-mnm4qp0p.js} +5 -5
  106. package/dist/{index-1szetq6f.js → index-q3ve2d1k.js} +30 -8
  107. package/dist/{index-6krwcdcf.js → index-zwkgfq1s.js} +95 -85
  108. package/dist/{index-wn9cb82y.js → index-zyvby92n.js} +12 -9
  109. package/dist/index.js +13 -13
  110. package/dist/live/watch-client.d.ts +2 -1
  111. package/dist/live/watch-client.d.ts.map +1 -1
  112. package/dist/live/watch-contract.d.ts +70 -4
  113. package/dist/live/watch-contract.d.ts.map +1 -1
  114. package/dist/live/watch-delta.d.ts +110 -0
  115. package/dist/live/watch-delta.d.ts.map +1 -0
  116. package/dist/live.d.ts +2 -1
  117. package/dist/live.d.ts.map +1 -1
  118. package/dist/live.js +56 -4
  119. package/dist/observability/changes.d.ts +55 -0
  120. package/dist/observability/changes.d.ts.map +1 -0
  121. package/dist/observability/index.d.ts +2 -0
  122. package/dist/observability/index.d.ts.map +1 -1
  123. package/dist/observability/index.js +127 -0
  124. package/dist/observability/spool.d.ts +53 -0
  125. package/dist/observability/spool.d.ts.map +1 -0
  126. package/dist/server/index.js +9 -9
  127. package/dist/testing/agent-store-conformance.d.ts.map +1 -1
  128. package/dist/testing.js +57 -23
  129. package/dist/tool-invoker.js +6 -6
  130. package/dist/tools/agent.d.ts +6 -0
  131. package/dist/tools/agent.d.ts.map +1 -1
  132. package/dist/tools/connections/define.d.ts +6 -0
  133. package/dist/tools/connections/define.d.ts.map +1 -0
  134. package/dist/tools/connections/errors.d.ts +50 -0
  135. package/dist/tools/connections/errors.d.ts.map +1 -0
  136. package/dist/tools/connections/http.d.ts +3 -0
  137. package/dist/tools/connections/http.d.ts.map +1 -0
  138. package/dist/tools/connections/index.d.ts +19 -0
  139. package/dist/tools/connections/index.d.ts.map +1 -0
  140. package/dist/tools/connections/index.js +1047 -0
  141. package/dist/tools/connections/instance.d.ts +3 -0
  142. package/dist/tools/connections/instance.d.ts.map +1 -0
  143. package/dist/tools/connections/json-rpc.d.ts +8 -0
  144. package/dist/tools/connections/json-rpc.d.ts.map +1 -0
  145. package/dist/tools/connections/limits.d.ts +36 -0
  146. package/dist/tools/connections/limits.d.ts.map +1 -0
  147. package/dist/tools/connections/mcp-client.d.ts +44 -0
  148. package/dist/tools/connections/mcp-client.d.ts.map +1 -0
  149. package/dist/tools/connections/mcp.d.ts +5 -0
  150. package/dist/tools/connections/mcp.d.ts.map +1 -0
  151. package/dist/tools/connections/mount.d.ts +12 -0
  152. package/dist/tools/connections/mount.d.ts.map +1 -0
  153. package/dist/tools/connections/openapi-document.d.ts +4 -0
  154. package/dist/tools/connections/openapi-document.d.ts.map +1 -0
  155. package/dist/tools/connections/openapi.d.ts +5 -0
  156. package/dist/tools/connections/openapi.d.ts.map +1 -0
  157. package/dist/tools/connections/runtime.d.ts +29 -0
  158. package/dist/tools/connections/runtime.d.ts.map +1 -0
  159. package/dist/tools/connections/schema-budget.d.ts +8 -0
  160. package/dist/tools/connections/schema-budget.d.ts.map +1 -0
  161. package/dist/tools/connections/sse-frames.d.ts +7 -0
  162. package/dist/tools/connections/sse-frames.d.ts.map +1 -0
  163. package/dist/tools/connections/sse-session.d.ts +26 -0
  164. package/dist/tools/connections/sse-session.d.ts.map +1 -0
  165. package/dist/tools/connections/ssrf.d.ts +15 -0
  166. package/dist/tools/connections/ssrf.d.ts.map +1 -0
  167. package/dist/tools/connections/types.d.ts +60 -0
  168. package/dist/tools/connections/types.d.ts.map +1 -0
  169. package/dist/tools/durability-context.d.ts +7 -0
  170. package/dist/tools/durability-context.d.ts.map +1 -0
  171. package/dist/tools/execute.d.ts +2 -0
  172. package/dist/tools/execute.d.ts.map +1 -1
  173. package/dist/tools/registry.d.ts +38 -0
  174. package/dist/tools/registry.d.ts.map +1 -0
  175. package/dist/tools/runtime-tool.d.ts +4 -0
  176. package/dist/tools/runtime-tool.d.ts.map +1 -1
  177. package/dist/tools.d.ts +1 -0
  178. package/dist/tools.d.ts.map +1 -1
  179. package/dist/tools.js +83 -26
  180. package/llms-full.txt +386 -16
  181. package/llms.txt +1 -0
  182. package/package.json +9 -1
  183. package/dist/index-dre2ywck.js +0 -48
  184. package/dist/{index-evcnmsc3.js → index-t7fkyxcr.js} +3 -3
package/dist/tools.js CHANGED
@@ -21,8 +21,8 @@ import {
21
21
  buildToolManifest,
22
22
  describeToolCatalog,
23
23
  mountAgent
24
- } from "./index-1szetq6f.js";
25
- import"./index-3xnq72rz.js";
24
+ } from "./index-q3ve2d1k.js";
25
+ import"./index-7rkhw9ec.js";
26
26
  import {
27
27
  argumentsDigest
28
28
  } from "./index-a916km3r.js";
@@ -37,7 +37,7 @@ import {
37
37
  } from "./index-4fpa9dy2.js";
38
38
  import {
39
39
  createToolInvoker
40
- } from "./index-0ydchz76.js";
40
+ } from "./index-mnm4qp0p.js";
41
41
  import {
42
42
  WaitTimeoutError,
43
43
  createCli,
@@ -46,47 +46,28 @@ import {
46
46
  fetchPinnedDocument,
47
47
  readCapped,
48
48
  runWaitOperation
49
- } from "./index-9hw9eq48.js";
49
+ } from "./index-7601qfg1.js";
50
50
  import"./index-sbdmyz75.js";
51
51
  import {
52
52
  collectToolSurface
53
- } from "./index-rcgsnrr6.js";
54
- import {
55
- createRuntimeToolFactory,
56
- defineRuntimeTool
57
- } from "./index-kc6h6hg0.js";
53
+ } from "./index-31jw8fjq.js";
58
54
  import {
59
55
  collectTools,
60
56
  createToolRunner,
61
57
  formatToolError
62
- } from "./index-0vfdh685.js";
58
+ } from "./index-8c3a7m4g.js";
63
59
  import {
64
60
  ToolExecutionControlError,
65
61
  executeToolMethod,
66
62
  isToolExecutionControlError,
67
63
  toolResultFromError
68
- } from "./index-wn9cb82y.js";
64
+ } from "./index-zyvby92n.js";
69
65
  import {
70
66
  getRequestContext,
71
67
  getTraceId,
72
68
  runWithRequestContext
73
69
  } from "./index-vsbzgd7b.js";
74
70
  import"./index-f9mb610r.js";
75
- import {
76
- PORTABLE_JSON_SCHEMA_FORMATS,
77
- assertToolName,
78
- assertUniqueToolName,
79
- findNonPortableFormats,
80
- findUntypedProperties,
81
- flattenToolJsonSchema,
82
- prepareProjectedMcpTools,
83
- presentationMetadata,
84
- validateMcpRoundPolicy
85
- } from "./index-r159gjwy.js";
86
- import"./index-cby4ar3v.js";
87
- import {
88
- coerceJsonArgs
89
- } from "./index-7zbps32p.js";
90
71
  import {
91
72
  normalizeError
92
73
  } from "./index-7evdsyez.js";
@@ -104,7 +85,26 @@ import {
104
85
  import {
105
86
  resolvePropagationContext
106
87
  } from "./index-zcgf3gqf.js";
88
+ import {
89
+ coerceJsonArgs
90
+ } from "./index-7zbps32p.js";
107
91
  import"./index-kzfs85xp.js";
92
+ import {
93
+ createRuntimeToolFactory,
94
+ defineRuntimeTool
95
+ } from "./index-kc6h6hg0.js";
96
+ import {
97
+ PORTABLE_JSON_SCHEMA_FORMATS,
98
+ assertToolName,
99
+ assertUniqueToolName,
100
+ findNonPortableFormats,
101
+ findUntypedProperties,
102
+ flattenToolJsonSchema,
103
+ prepareProjectedMcpTools,
104
+ presentationMetadata,
105
+ validateMcpRoundPolicy
106
+ } from "./index-r159gjwy.js";
107
+ import"./index-cby4ar3v.js";
108
108
  import {
109
109
  isRecord
110
110
  } from "./index-77fekveh.js";
@@ -2521,6 +2521,62 @@ function mountOAuthProvider(config) {
2521
2521
  };
2522
2522
  return dcrEnabled ? [metadataRoute, registerRoute, authorizeRoute, tokenRoute] : [metadataRoute, authorizeRoute, tokenRoute];
2523
2523
  }
2524
+ // src/tools/registry.ts
2525
+ function defineToolRegistry(input) {
2526
+ const defaults = [...input.defaults];
2527
+ const slots = new Set;
2528
+ for (const tool of defaults) {
2529
+ if (!tool.name)
2530
+ throw new Error("A default tool must carry a non-empty name");
2531
+ if (slots.has(tool.name))
2532
+ throw new Error(`Duplicate default tool name: ${tool.name}`);
2533
+ slots.add(tool.name);
2534
+ }
2535
+ const disabled = new Set;
2536
+ const replacements = new Map;
2537
+ const assertKnown = (name, verb) => {
2538
+ if (!slots.has(name)) {
2539
+ throw new Error(`Tool registry ${verb}("${name}") names no default; declared: ${[...slots].sort().join(", ") || "(none)"}`);
2540
+ }
2541
+ };
2542
+ const builder = {
2543
+ replace(name, tool) {
2544
+ assertKnown(name, "replace");
2545
+ if (disabled.has(name)) {
2546
+ throw new Error(`Tool registry cannot replace "${name}": it is disabled`);
2547
+ }
2548
+ if (replacements.has(name)) {
2549
+ throw new Error(`Tool registry already replaced "${name}"`);
2550
+ }
2551
+ if (tool.name !== name) {
2552
+ throw new Error(`A replacement for "${name}" must carry that name, not "${tool.name}"`);
2553
+ }
2554
+ replacements.set(name, tool);
2555
+ return builder;
2556
+ },
2557
+ disable(name) {
2558
+ assertKnown(name, "disable");
2559
+ disabled.add(name);
2560
+ return builder;
2561
+ },
2562
+ build() {
2563
+ const tools = [];
2564
+ const seen = new Set;
2565
+ for (const tool of defaults) {
2566
+ if (disabled.has(tool.name))
2567
+ continue;
2568
+ const effective = replacements.get(tool.name) ?? tool;
2569
+ if (seen.has(effective.name)) {
2570
+ throw new Error(`Duplicate composed tool name: ${effective.name}`);
2571
+ }
2572
+ seen.add(effective.name);
2573
+ tools.push(effective);
2574
+ }
2575
+ return { tools, names: tools.map((tool) => tool.name) };
2576
+ }
2577
+ };
2578
+ return builder;
2579
+ }
2524
2580
  // src/tools/tool-logger.ts
2525
2581
  function createToolLogger(config = {}) {
2526
2582
  const log = config.log ?? ((line) => console.error(line));
@@ -2646,6 +2702,7 @@ export {
2646
2702
  defineWaitTool,
2647
2703
  defineViewFileTool,
2648
2704
  defineUploadTool,
2705
+ defineToolRegistry,
2649
2706
  defineRuntimeTool,
2650
2707
  defineDownloadTool,
2651
2708
  defineCliCommand,