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/testing.js CHANGED
@@ -1,47 +1,39 @@
1
1
  import {
2
2
  createApplication
3
- } from "./index-evcnmsc3.js";
4
- import"./index-2k4yrqkc.js";
3
+ } from "./index-t7fkyxcr.js";
5
4
  import"./index-3gye9wzb.js";
5
+ import"./index-2k4yrqkc.js";
6
6
  import"./index-3z73fh2c.js";
7
7
  import {
8
8
  createMemoryAgentRuntimeStore
9
- } from "./index-v1qk37y9.js";
10
- import {
11
- createAgentRaceBarrier,
12
- createAgentRaceDriver,
13
- createAgentRaceTrace
14
- } from "./index-cnyk6te3.js";
9
+ } from "./index-hrbajay7.js";
15
10
  import {
16
11
  decodeAgentConversationArchive
17
- } from "./index-6krwcdcf.js";
12
+ } from "./index-zwkgfq1s.js";
18
13
  import {
19
14
  AgentMessageSchema,
20
15
  AgentRunSchema
21
16
  } from "./index-gtj3zc53.js";
17
+ import {
18
+ createAgentRaceBarrier,
19
+ createAgentRaceDriver,
20
+ createAgentRaceTrace
21
+ } from "./index-cnyk6te3.js";
22
22
  import {
23
23
  RealtimeRejectDirectionSchema,
24
24
  RealtimeRejectFaultSchema,
25
25
  RealtimeRejectPhaseSchema,
26
26
  RealtimeRejectReasonSchema
27
27
  } from "./index-p7hgdyhb.js";
28
+ import {
29
+ createClient,
30
+ createClients
31
+ } from "./index-27gm3d6g.js";
28
32
  import {
29
33
  RealtimeRequestDisconnectedError,
30
34
  RealtimeRequestInvalidAcknowledgementError,
31
35
  RealtimeRequestTimeoutError
32
36
  } from "./index-2qzskm8h.js";
33
- import {
34
- mcpProjectionCandidate,
35
- prepareProjectedMcpTools,
36
- projectToolSurface
37
- } from "./index-r159gjwy.js";
38
- import {
39
- toJsonSchema
40
- } from "./index-cby4ar3v.js";
41
- import {
42
- createClient,
43
- createClients
44
- } from "./index-27gm3d6g.js";
45
37
  import"./index-qmgs7y68.js";
46
38
  import"./index-3xwxfj4z.js";
47
39
  import"./index-7evdsyez.js";
@@ -52,6 +44,14 @@ import"./index-6k1937bx.js";
52
44
  import"./index-0w9abg87.js";
53
45
  import"./index-zcgf3gqf.js";
54
46
  import"./index-kzfs85xp.js";
47
+ import {
48
+ mcpProjectionCandidate,
49
+ prepareProjectedMcpTools,
50
+ projectToolSurface
51
+ } from "./index-r159gjwy.js";
52
+ import {
53
+ toJsonSchema
54
+ } from "./index-cby4ar3v.js";
55
55
  import {
56
56
  isRecord
57
57
  } from "./index-77fekveh.js";
@@ -97,7 +97,8 @@ async function runAgentStoreConformance(config) {
97
97
  `${run}-causal-active`,
98
98
  `${run}-interrupt-priority`,
99
99
  `${run}-ledger`,
100
- `${run}-archive`
100
+ `${run}-archive`,
101
+ `${run}-seed`
101
102
  ]
102
103
  };
103
104
  const store = await config.createStore(context);
@@ -117,6 +118,36 @@ async function runAgentStoreConformance(config) {
117
118
  if (failure !== undefined)
118
119
  throw failure;
119
120
  }
121
+ async function seedScenario(store, conversationId) {
122
+ const input = {
123
+ conversationId,
124
+ seedKey: "brief",
125
+ inputs: [userMessage(conversationId, "seed-a"), userMessage(conversationId, "seed-b")]
126
+ };
127
+ const first = await store.seedConversationInput(input);
128
+ requireOutcome(first, "applied");
129
+ const before = await store.loadSnapshot(conversationId);
130
+ if (before.messages.map((message) => message.id).join(",") !== "seed-a,seed-b")
131
+ throw new Error("Seed conformance: complete ordered seed missing");
132
+ await Promise.all([store.seedConversationInput(input), store.seedConversationInput(input)]);
133
+ const repeated = await store.loadSnapshot(conversationId);
134
+ if (repeated.version !== before.version || repeated.messages.length !== 2)
135
+ throw new Error("Seed conformance: replay changed history");
136
+ const compacted = await store.replaceCompactedRange({
137
+ conversationId,
138
+ expectedVersion: repeated.version,
139
+ replacedMessageIds: ["seed-a", "seed-b"],
140
+ summary: AgentMessageSchema.parse({
141
+ ...userMessage(conversationId, "seed-summary"),
142
+ role: "summary"
143
+ })
144
+ });
145
+ requireOutcome(compacted, "applied");
146
+ await store.seedConversationInput(input);
147
+ const after = await store.loadSnapshot(conversationId);
148
+ if (after.messages.some((message) => message.id === "seed-a" || message.id === "seed-b"))
149
+ throw new Error("Seed conformance: compacted instructions resurrected");
150
+ }
120
151
  async function conformanceScenario(store, conversationIds) {
121
152
  const [
122
153
  conversationId,
@@ -126,8 +157,11 @@ async function conformanceScenario(store, conversationIds) {
126
157
  causalActiveConversationId,
127
158
  interruptPriorityConversationId,
128
159
  ledgerConversationId,
129
- archiveConversationId
160
+ archiveConversationId,
161
+ seedConversationId
130
162
  ] = conversationIds;
163
+ if (seedConversationId)
164
+ await seedScenario(store, seedConversationId);
131
165
  if (ledgerConversationId)
132
166
  await ledgerScenario(store, ledgerConversationId);
133
167
  if (archiveConversationId)
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  createToolInvoker
3
- } from "./index-0ydchz76.js";
4
- import"./index-0vfdh685.js";
5
- import"./index-wn9cb82y.js";
3
+ } from "./index-mnm4qp0p.js";
4
+ import"./index-8c3a7m4g.js";
5
+ import"./index-zyvby92n.js";
6
6
  import"./index-vsbzgd7b.js";
7
7
  import"./index-f9mb610r.js";
8
- import"./index-r159gjwy.js";
9
- import"./index-cby4ar3v.js";
10
- import"./index-7zbps32p.js";
11
8
  import"./index-7evdsyez.js";
12
9
  import"./index-2bxcmqkb.js";
13
10
  import"./index-6k1937bx.js";
14
11
  import"./index-0w9abg87.js";
15
12
  import"./index-zcgf3gqf.js";
13
+ import"./index-7zbps32p.js";
16
14
  import"./index-kzfs85xp.js";
15
+ import"./index-r159gjwy.js";
16
+ import"./index-cby4ar3v.js";
17
17
  import"./index-77fekveh.js";
18
18
  export {
19
19
  createToolInvoker
@@ -2,6 +2,7 @@ import type { ToolSet } from 'ai';
2
2
  import type { ServiceDef } from '../server/types.js';
3
3
  import { type ErrorHintFn, type ToolCallHooks, type ToolLifecycle } from './execute.js';
4
4
  import { type ToolExtend } from './mount.js';
5
+ import type { AgentToolRegistry } from './registry.js';
5
6
  import type { RuntimeToolDefinition } from './runtime-tool.js';
6
7
  export interface AgentContext {
7
8
  [key: string]: unknown;
@@ -27,6 +28,11 @@ export interface AgentMountConfig {
27
28
  errorHint?: ErrorHintFn;
28
29
  /** Framework-managed pathless operations mounted beside contract tools. */
29
30
  runtimeTools?: readonly RuntimeToolDefinition[];
31
+ /**
32
+ * A composed tool registry. Mutually exclusive with `runtimeTools`: one
33
+ * declaration of the runtime surface, not two lists to reconcile.
34
+ */
35
+ registry?: AgentToolRegistry;
30
36
  }
31
37
  export declare function mountAgent(services: ServiceDef | ServiceDef[], config?: AgentMountConfig): ToolSet;
32
38
  //# sourceMappingURL=agent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/tools/agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAwB,OAAO,EAAE,MAAM,IAAI,CAAC;AAGxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,aAAa,EAClB,KAAK,aAAa,EAEnB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAqC,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAG5D,MAAM,WAAW,YAAY;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,qCAAqC;IACrC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,+EAA+E;IAC/E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mEAAmE;IACnE,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC5D,+EAA+E;IAC/E,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gEAAgE;IAChE,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAC;CACjD;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,UAAU,GAAG,UAAU,EAAE,EACnC,MAAM,GAAE,gBAAqB,GAC5B,OAAO,CA4ET"}
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/tools/agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAwB,OAAO,EAAE,MAAM,IAAI,CAAC;AAGxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,OAAO,EACL,KAAK,WAAW,EAEhB,KAAK,aAAa,EAClB,KAAK,aAAa,EAGnB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAqC,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAG5D,MAAM,WAAW,YAAY;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,qCAAqC;IACrC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,+EAA+E;IAC/E,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mEAAmE;IACnE,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC5D,+EAA+E;IAC/E,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gEAAgE;IAChE,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAChD;;;OAGG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,UAAU,GAAG,UAAU,EAAE,EACnC,MAAM,GAAE,gBAAqB,GAC5B,OAAO,CAyGT"}
@@ -0,0 +1,6 @@
1
+ import type { McpClientConnection, McpClientConnectionConfig, OpenApiConnection, OpenApiConnectionConfig } from './types.js';
2
+ /** Define one external MCP server connection. */
3
+ export declare function defineMcpClientConnection(config: McpClientConnectionConfig): McpClientConnection;
4
+ /** Define one external OpenAPI connection. */
5
+ export declare function defineOpenApiConnection(config: OpenApiConnectionConfig): OpenApiConnection;
6
+ //# sourceMappingURL=define.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/define.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAEjB,iDAAiD;AACjD,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,yBAAyB,GAChC,mBAAmB,CAIrB;AAED,8CAA8C;AAC9C,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,uBAAuB,GAAG,iBAAiB,CAI1F"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Typed failures of the external-connection surface.
3
+ *
4
+ * These are deliberately not `AppError`s: a connection failure is not a
5
+ * contract error and must not be confused with one by an in-process caller.
6
+ * The reauthorization signal is distinct because it is recoverable — the
7
+ * application starts its existing flow — while every other status is terminal
8
+ * for the call.
9
+ */
10
+ /** A `401`: the current credential was rejected and must be re-obtained. */
11
+ export declare class ConnectionAuthorizationRequiredError extends Error {
12
+ readonly connectionName: string;
13
+ readonly instanceId: string;
14
+ constructor(connectionName: string, instanceId: string);
15
+ }
16
+ /** Any non-2xx response other than the reauthorization signal. */
17
+ export declare class ConnectionRequestError extends Error {
18
+ readonly connectionName: string;
19
+ readonly status: number;
20
+ readonly body: string;
21
+ constructor(connectionName: string, status: number, body: string);
22
+ }
23
+ /** A URL the SSRF guard refused before any request left the process. */
24
+ export declare class ConnectionUrlError extends Error {
25
+ readonly url: string;
26
+ constructor(message: string, url: string);
27
+ }
28
+ /** The mount would expose more foreign tools than its declared budget. */
29
+ export declare class ConnectionBudgetExceededError extends Error {
30
+ readonly limit: number;
31
+ readonly actual: number;
32
+ constructor(limit: number, actual: number, unit?: string);
33
+ }
34
+ /**
35
+ * A request exceeded the connection's declared deadline. This is not exported
36
+ * from the public subexport; it is a typed boundary between the transport and
37
+ * the caller, so an application can still tell a timeout from a network error.
38
+ */
39
+ export declare class ConnectionTimeoutError extends Error {
40
+ readonly connectionName: string;
41
+ readonly timeoutMs: number;
42
+ constructor(connectionName: string, timeoutMs: number);
43
+ }
44
+ /** A response exceeded the connection's declared byte ceiling. Internal. */
45
+ export declare class ConnectionResponseTooLargeError extends Error {
46
+ readonly connectionName: string;
47
+ readonly maxBytes: number;
48
+ constructor(connectionName: string, maxBytes: number);
49
+ }
50
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,4EAA4E;AAC5E,qBAAa,oCAAqC,SAAQ,KAAK;IAC7D,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B,YAAY,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAKrD;CACF;AAED,kEAAkE;AAClE,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,YAAY,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAM/D;CACF;AAED,wEAAwE;AACxE,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,YAAY,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAIvC;CACF;AAED,0EAA0E;AAC1E,qBAAa,6BAA8B,SAAQ,KAAK;IACtD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,YAAY,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,SAAU,EAKxD;CACF;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;IAC/C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,YAAY,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAKpD;CACF;AAED,4EAA4E;AAC5E,qBAAa,+BAAgC,SAAQ,KAAK;IACxD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,YAAY,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAKnD;CACF"}
@@ -0,0 +1,3 @@
1
+ /** Redirects require a new host-owned connection declaration. */
2
+ export declare function fetchConnection(target: URL | string, init: RequestInit, allowedHosts: ReadonlySet<string>, connectionName: string): Promise<Response>;
3
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/http.ts"],"names":[],"mappings":"AAGA,iEAAiE;AACjE,wBAAsB,eAAe,CACnC,MAAM,EAAE,GAAG,GAAG,MAAM,EACpB,IAAI,EAAE,WAAW,EACjB,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,EACjC,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,QAAQ,CAAC,CAYnB"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * `stitchkit/tools/connections` — consume external MCP servers and OpenAPI
3
+ * specs as typed tools.
4
+ *
5
+ * This is a server-only subexport of `stitchkit/tools`: a connection pulls in no
6
+ * peer package into the stable tools import, but mounts its foreign operations
7
+ * as plain `RuntimeToolDefinition`s, so `mountAgent({ runtimeTools })` runs them
8
+ * through the same lifecycle, hooks and approval path as our own.
9
+ *
10
+ * A connection URL is application configuration, not a trust boundary: every
11
+ * outbound request is checked against the connection's own host (plus any
12
+ * explicit `allowHosts`), and credentials are resolved separately for each call.
13
+ */
14
+ export { defineMcpClientConnection, defineOpenApiConnection } from './define.js';
15
+ export { ConnectionAuthorizationRequiredError, ConnectionBudgetExceededError, ConnectionRequestError, ConnectionUrlError, } from './errors.js';
16
+ export { mountConnections } from './mount.js';
17
+ export type { ConnectionTokenProvider } from './runtime.js';
18
+ export type { ConnectionBudget, ConnectionDefinition, ConnectionMountOptions, McpClientConnection, McpClientConnectionConfig, McpConnectionTransport, McpToolFilter, OpenApiConnection, OpenApiConnectionConfig, } from './types.js';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAC9E,OAAO,EACL,oCAAoC,EACpC,6BAA6B,EAC7B,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,YAAY,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACzD,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,aAAa,EACb,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,SAAS,CAAC"}