stitchkit 0.103.0 → 0.103.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/agent-runtime/browser-control-contract.d.ts +1118 -0
  3. package/dist/agent-runtime/browser-control-contract.d.ts.map +1 -0
  4. package/dist/agent-runtime/browser-controller.d.ts +31 -0
  5. package/dist/agent-runtime/browser-controller.d.ts.map +1 -0
  6. package/dist/agent-runtime/harness-control.d.ts.map +1 -1
  7. package/dist/agent-runtime/harness-realtime.d.ts +25 -0
  8. package/dist/agent-runtime/harness-realtime.d.ts.map +1 -0
  9. package/dist/agent-runtime/harness-tools.d.ts +11 -0
  10. package/dist/agent-runtime/harness-tools.d.ts.map +1 -0
  11. package/dist/agent-runtime/react.d.ts +4 -0
  12. package/dist/agent-runtime/react.d.ts.map +1 -0
  13. package/dist/agent-runtime/run-assertions.d.ts +63 -0
  14. package/dist/agent-runtime/run-assertions.d.ts.map +1 -0
  15. package/dist/entrypoints/agent-runtime/browser.d.ts +2 -0
  16. package/dist/entrypoints/agent-runtime/browser.d.ts.map +1 -1
  17. package/dist/entrypoints/agent-runtime/browser.js +235 -0
  18. package/dist/entrypoints/agent-runtime/harness-tools.d.ts +2 -0
  19. package/dist/entrypoints/agent-runtime/harness-tools.d.ts.map +1 -0
  20. package/dist/entrypoints/agent-runtime/harness-tools.js +32 -0
  21. package/dist/entrypoints/agent-runtime/harness.js +11 -226
  22. package/dist/entrypoints/agent-runtime/react.d.ts +2 -0
  23. package/dist/entrypoints/agent-runtime/react.d.ts.map +1 -0
  24. package/dist/entrypoints/agent-runtime/react.js +8 -0
  25. package/dist/entrypoints/agent-runtime/realtime.d.ts +2 -0
  26. package/dist/entrypoints/agent-runtime/realtime.d.ts.map +1 -0
  27. package/dist/entrypoints/agent-runtime/realtime.js +159 -0
  28. package/dist/entrypoints/agent-runtime/testing.d.ts +1 -0
  29. package/dist/entrypoints/agent-runtime/testing.d.ts.map +1 -1
  30. package/dist/entrypoints/agent-runtime/testing.js +67 -2
  31. package/dist/entrypoints/agent-runtime.js +23 -18
  32. package/dist/entrypoints/cli.js +6 -6
  33. package/dist/entrypoints/index.js +15 -226
  34. package/dist/entrypoints/node.js +7 -5
  35. package/dist/entrypoints/observability.js +2 -2
  36. package/dist/entrypoints/react.js +2 -2
  37. package/dist/entrypoints/remote.js +3 -3
  38. package/dist/entrypoints/server.js +10 -8
  39. package/dist/entrypoints/testing.js +3 -3
  40. package/dist/entrypoints/tools/invoker.js +5 -5
  41. package/dist/entrypoints/tools.js +23 -34
  42. package/dist/entrypoints/tracking.js +2 -2
  43. package/dist/{index-d82d3xg4.js → index-0c419yx7.js} +1 -1
  44. package/dist/{index-dvwj1f43.js → index-0efgsyav.js} +1 -1
  45. package/dist/index-20yvtn9a.js +38 -0
  46. package/dist/{index-a9pd417t.js → index-5vyd0fkb.js} +1 -34
  47. package/dist/{index-r1z0rd9c.js → index-7n68nmc6.js} +1 -1
  48. package/dist/index-860vjkgm.js +48 -0
  49. package/dist/index-c9d05kvt.js +11 -0
  50. package/dist/{index-m9fndta6.js → index-ds7jdhep.js} +2 -2
  51. package/dist/index-jn9g8xdt.js +246 -0
  52. package/dist/{index-n9tyz8z3.js → index-kgmh97hf.js} +1 -1
  53. package/dist/{index-c6aagrbd.js → index-kkk1wzsq.js} +3 -3
  54. package/dist/index-nggfa2yn.js +34 -0
  55. package/dist/{index-m79yr938.js → index-pw99k9h5.js} +1 -10
  56. package/dist/index-qapzv4p5.js +54 -0
  57. package/dist/index-r34mvse1.js +225 -0
  58. package/dist/index-srs8hj9c.js +10 -0
  59. package/dist/index-vgkbcnkc.js +29 -0
  60. package/dist/{index-ewbaywk5.js → index-x1dkwx5x.js} +1 -1
  61. package/dist/{index-xkhk5d6g.js → index-xgc94hy6.js} +5 -48
  62. package/dist/{index-3ct7hhq6.js → index-xwq9j1sf.js} +6 -56
  63. package/dist/{index-hby4qhax.js → index-yex7eg1v.js} +4 -10
  64. package/dist/{index-1h6gtdrj.js → index-ygkka6zn.js} +1 -1
  65. package/dist/{index-zs4ms3th.js → index-z3pqcy7r.js} +7 -30
  66. package/dist/index-ze1eph1k.js +20 -0
  67. package/llms/agent-runtime-browser.txt +26 -0
  68. package/llms/agent-runtime-harness-tools.txt +25 -0
  69. package/llms/agent-runtime-harness.txt +140 -1
  70. package/llms/agent-runtime-react.txt +21 -0
  71. package/llms/agent-runtime-realtime.txt +30 -0
  72. package/llms/agent-runtime-testing.txt +6 -0
  73. package/llms/stitchkit.txt +5 -1
  74. package/llms-full.txt +209 -1
  75. package/llms.txt +8 -4
  76. package/package.json +13 -1
@@ -1,14 +1,13 @@
1
1
  import {
2
- randomHex,
3
2
  createTraceContext2,
4
3
  parseTraceparent2,
5
4
  formatTraceparent2,
6
5
  childSpan2
7
- } from "../index-hby4qhax.js";
6
+ } from "../index-yex7eg1v.js";
8
7
  import {
9
8
  ApiError2,
10
9
  createHttpClient2
11
- } from "../index-1h6gtdrj.js";
10
+ } from "../index-ygkka6zn.js";
12
11
  import"../index-m38ej7e5.js";
13
12
  import {
14
13
  DEFAULT_CONTRACT_STREAM_FRAME_BYTES2,
@@ -24,7 +23,7 @@ import {
24
23
  createUrlBuilder2,
25
24
  createUrlBuilders2,
26
25
  createScopedUrlBuilders2
27
- } from "../index-d82d3xg4.js";
26
+ } from "../index-0c419yx7.js";
28
27
  import"../index-w0eqdhyd.js";
29
28
  import {
30
29
  LiveStatePhaseSchema2,
@@ -47,12 +46,8 @@ import {
47
46
  } from "../index-n53mswt3.js";
48
47
  import {
49
48
  REALTIME_REJECTION_KEY2,
50
- asRealtimeRejection2,
51
- parseRealtimeRequestArguments,
52
- parseRealtimeRequestAcknowledgement,
53
- createValidatedRealtimeSocket,
54
- isModuleNotFound
55
- } from "../index-m79yr938.js";
49
+ asRealtimeRejection2
50
+ } from "../index-pw99k9h5.js";
56
51
  import {
57
52
  RealtimeRequestPhaseSchema2,
58
53
  RealtimeRequestPhaseEventSchema2,
@@ -61,6 +56,11 @@ import {
61
56
  RealtimeRequestInvalidAcknowledgementError2,
62
57
  RealtimeRequestRejectedError2
63
58
  } from "../index-4s0fep5q.js";
59
+ import {
60
+ realtimeRequestTraces,
61
+ createRequestTracer,
62
+ bindRealtimeClient2
63
+ } from "../index-r34mvse1.js";
64
64
  import {
65
65
  BackoffPolicySchema2,
66
66
  createBackoff2
@@ -85,6 +85,9 @@ import {
85
85
  ManagedFilePathSchema2,
86
86
  ManagedFileRefSchema2
87
87
  } from "../index-xqhede6x.js";
88
+ import {
89
+ isModuleNotFound
90
+ } from "../index-srs8hj9c.js";
88
91
  import {
89
92
  withDeadline
90
93
  } from "../index-n1dqr7gf.js";
@@ -187,220 +190,6 @@ function pause(ms, signal) {
187
190
  signal?.addEventListener("abort", abort, { once: true });
188
191
  });
189
192
  }
190
- // src/browser/socket-io-trace.ts
191
- var realtimeRequestTraces = new WeakMap;
192
- function observeRealtimeRequestPhase(trace, phase) {
193
- const observation = {
194
- requestId: trace.requestId,
195
- event: trace.event,
196
- phase,
197
- elapsedMs: performance.now() - trace.startedAt
198
- };
199
- const observers = trace.observeRequest && trace.observeRequest !== trace.observeClient ? [trace.observeClient, trace.observeRequest] : [trace.observeClient ?? trace.observeRequest];
200
- for (const observer of observers) {
201
- if (!observer)
202
- continue;
203
- try {
204
- const result = observer(observation);
205
- if (result)
206
- Promise.resolve(result).catch(() => {
207
- return;
208
- });
209
- } catch {}
210
- }
211
- }
212
- function socketIoPacketIdentity(data, expected) {
213
- if (typeof data !== "string")
214
- return null;
215
- const type = data.charAt(0);
216
- const binary = type === (expected === "event" ? "5" : "6");
217
- if (type !== (expected === "event" ? "2" : "3") && !binary)
218
- return null;
219
- let offset = 1;
220
- if (binary) {
221
- const separator = data.indexOf("-", offset);
222
- if (separator < 0)
223
- return null;
224
- for (let index = offset;index < separator; index += 1) {
225
- const code = data.charCodeAt(index);
226
- if (code < 48 || code > 57)
227
- return null;
228
- }
229
- offset = separator + 1;
230
- }
231
- let namespace = "/";
232
- if (data.charAt(offset) === "/") {
233
- const separator = data.indexOf(",", offset);
234
- if (separator < 0)
235
- return null;
236
- namespace = data.slice(offset, separator);
237
- offset = separator + 1;
238
- }
239
- const start = offset;
240
- while (offset < data.length) {
241
- const code = data.charCodeAt(offset);
242
- if (code < 48 || code > 57)
243
- break;
244
- offset += 1;
245
- }
246
- if (offset === start)
247
- return null;
248
- return { namespace, id: data.slice(start, offset) };
249
- }
250
- function packetIdentityKey(identity) {
251
- return `${identity.namespace}:${identity.id}`;
252
- }
253
- function createRequestTracer(onRequestPhase) {
254
- const requestTracesByNativeKey = new Map;
255
- const observedRequestEngines = new WeakSet;
256
- let startingRequestTrace = null;
257
- return {
258
- start(event, onPhase) {
259
- if (!onRequestPhase && !onPhase)
260
- return;
261
- const trace = {
262
- requestId: randomHex(16),
263
- event,
264
- startedAt: performance.now(),
265
- observeClient: onRequestPhase,
266
- observeRequest: onPhase,
267
- closed: false
268
- };
269
- return trace;
270
- },
271
- close(trace, phase) {
272
- if (!trace || trace.closed)
273
- return;
274
- trace.closed = true;
275
- if (trace.nativeKey)
276
- requestTracesByNativeKey.delete(trace.nativeKey);
277
- observeRealtimeRequestPhase(trace, phase);
278
- },
279
- starting(trace, emit) {
280
- startingRequestTrace = trace ?? null;
281
- try {
282
- return emit();
283
- } finally {
284
- startingRequestTrace = null;
285
- }
286
- },
287
- observeEachOpen(target, current) {
288
- if (!onRequestPhase)
289
- return;
290
- target.io.on("open", () => {
291
- const socket = current();
292
- if (socket)
293
- this.observe(socket);
294
- });
295
- },
296
- observe(target) {
297
- const engine = target.io.engine;
298
- if (!engine || observedRequestEngines.has(engine))
299
- return;
300
- observedRequestEngines.add(engine);
301
- engine.on("packetCreate", (packet) => {
302
- if (!startingRequestTrace || packet.type !== "message")
303
- return;
304
- const identity = socketIoPacketIdentity(packet.data, "event");
305
- if (!identity)
306
- return;
307
- const key = packetIdentityKey(identity);
308
- startingRequestTrace.nativeKey = key;
309
- requestTracesByNativeKey.set(key, startingRequestTrace);
310
- observeRealtimeRequestPhase(startingRequestTrace, "engine-handoff");
311
- });
312
- engine.on("packet", (packet) => {
313
- if (packet.type !== "message")
314
- return;
315
- const identity = socketIoPacketIdentity(packet.data, "ack");
316
- if (!identity)
317
- return;
318
- const key = packetIdentityKey(identity);
319
- const trace = requestTracesByNativeKey.get(key);
320
- if (!trace || trace.closed)
321
- return;
322
- observeRealtimeRequestPhase(trace, "engine-ack-received");
323
- requestTracesByNativeKey.delete(key);
324
- });
325
- }
326
- };
327
- }
328
-
329
- // src/browser/realtime-client.ts
330
- function assertRealtimeClientTransport(transport) {
331
- for (const capability of ["on", "emit", "emitWithAck", "onConnectionChange"]) {
332
- if (typeof Reflect.get(transport, capability) !== "function") {
333
- throw new TypeError(`Realtime client transport does not implement ${capability}()`);
334
- }
335
- }
336
- if (typeof transport.connected !== "boolean") {
337
- throw new TypeError("Realtime client transport does not expose boolean connected");
338
- }
339
- }
340
- function bindRealtimeClient(contract, transport, { onRejected, logger } = {}) {
341
- assertRealtimeClientTransport(transport);
342
- const events = createValidatedRealtimeSocket({
343
- target: transport,
344
- inbound: contract.serverToClient,
345
- outbound: contract.clientToServer,
346
- inboundDirection: "client-inbound",
347
- outboundDirection: "client-outbound",
348
- onRejected,
349
- logger,
350
- subscribe: (event, handler) => {
351
- const subscribe = Reflect.get(transport, "on");
352
- if (typeof subscribe !== "function") {
353
- throw new Error("Socket.IO client does not implement on()");
354
- }
355
- const unsubscribe = Reflect.apply(subscribe, transport, [event, handler]);
356
- if (typeof unsubscribe !== "function") {
357
- throw new Error("Socket.IO client on() did not return an unsubscribe function");
358
- }
359
- return () => {
360
- Reflect.apply(unsubscribe, undefined, []);
361
- };
362
- }
363
- });
364
- async function request(event, ...args) {
365
- const options = args.at(-1);
366
- if (!options || typeof options !== "object" || !("timeoutMs" in options)) {
367
- throw new TypeError(`Realtime request "${event}" requires { timeoutMs }`);
368
- }
369
- const timeoutMs = options.timeoutMs;
370
- if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
371
- throw new RangeError(`Realtime request "${event}" timeoutMs must be finite and > 0`);
372
- }
373
- const values = args.slice(0, -1);
374
- const parsedArgs = parseRealtimeRequestArguments(contract.clientToServer, event, "client-outbound", values);
375
- const definition = contract.clientToServer[event];
376
- if (!definition?.ack) {
377
- throw new Error(`Realtime request "${event}" has no acknowledgement schema`);
378
- }
379
- const pending = transport.emitWithAck(event, parsedArgs, options);
380
- const trace = realtimeRequestTraces.get(pending);
381
- if (trace)
382
- realtimeRequestTraces.delete(pending);
383
- const value = await pending;
384
- let acknowledgement;
385
- try {
386
- acknowledgement = parseRealtimeRequestAcknowledgement(definition.ack, event, "client-inbound", value, onRejected, logger);
387
- } finally {
388
- if (trace && !trace.closed) {
389
- trace.closed = true;
390
- observeRealtimeRequestPhase(trace, "settled");
391
- }
392
- }
393
- return acknowledgement;
394
- }
395
- return {
396
- ...events,
397
- get connected() {
398
- return transport.connected;
399
- },
400
- request,
401
- onConnectionChange: (listener) => transport.onConnectionChange(listener)
402
- };
403
- }
404
193
  // src/browser/resumable.ts
405
194
  var DEFAULT_RETRY = { minDelayMs: 100, maxDelayMs: 30000, jitter: 0.5 };
406
195
 
@@ -831,7 +620,7 @@ function createIoResolver(injected) {
831
620
  // src/browser/socket-io.ts
832
621
  function createRealtimeClient(contract, { onRejected, logger, onRequestPhase, ...config }) {
833
622
  const transport = createSocketIOClientInternal(config, onRequestPhase);
834
- const bound = bindRealtimeClient(contract, transport, { onRejected, logger });
623
+ const bound = bindRealtimeClient2(contract, transport, { onRejected, logger });
835
624
  return {
836
625
  ...bound,
837
626
  get connected() {
@@ -1008,7 +797,7 @@ export {
1008
797
  appError2 as appError,
1009
798
  asRealtimeRejection2 as asRealtimeRejection,
1010
799
  badRequest2 as badRequest,
1011
- bindRealtimeClient,
800
+ bindRealtimeClient2 as bindRealtimeClient,
1012
801
  childSpan2 as childSpan,
1013
802
  conflict2 as conflict,
1014
803
  contractEndpointMatchers2 as contractEndpointMatchers,
@@ -8,18 +8,17 @@ import {
8
8
  rateLimited2,
9
9
  appError2
10
10
  } from "../index-n53mswt3.js";
11
- import"../index-hby4qhax.js";
11
+ import"../index-yex7eg1v.js";
12
12
  import {
13
13
  createHandler2,
14
14
  createScopedImplementRegistry2,
15
15
  implementRegistry2,
16
16
  createImplementRegistry2,
17
17
  bindProcessSignals2,
18
- bindRealtimeServer2,
19
18
  createSocketIOServer2,
20
19
  UnixClientTransportError2,
21
20
  createUnixClientTransport2
22
- } from "../index-3ct7hhq6.js";
21
+ } from "../index-xwq9j1sf.js";
23
22
  import"../index-b2bz0kdm.js";
24
23
  import"../index-r5c4fedv.js";
25
24
  import {
@@ -31,18 +30,21 @@ import {
31
30
  } from "../index-q0th8q0z.js";
32
31
  import"../index-m38ej7e5.js";
33
32
  import"../index-1bx1xv1k.js";
34
- import"../index-m79yr938.js";
33
+ import"../index-pw99k9h5.js";
35
34
  import"../index-4s0fep5q.js";
36
35
  import"../index-ck71tbcf.js";
37
36
  import"../index-fyphpknh.js";
38
37
  import"../index-xqhede6x.js";
38
+ import {
39
+ bindRealtimeServer2
40
+ } from "../index-qapzv4p5.js";
39
41
  import {
40
42
  createMultipartStream2,
41
43
  implement2,
42
44
  createImplement2,
43
45
  createScopedImplement2
44
46
  } from "../index-afjvjyck.js";
45
- import"../index-r1z0rd9c.js";
47
+ import"../index-7n68nmc6.js";
46
48
  // src/server/node.ts
47
49
  import { serve } from "srvx/node";
48
50
 
@@ -18,7 +18,7 @@ import {
18
18
  resolveTraceContext2,
19
19
  childSpan2,
20
20
  resolvePropagationContext2
21
- } from "../index-hby4qhax.js";
21
+ } from "../index-yex7eg1v.js";
22
22
  import"../index-sznqf8fx.js";
23
23
  import {
24
24
  redact2,
@@ -36,7 +36,7 @@ import {
36
36
  setRequestDimensions2,
37
37
  setRequestError2,
38
38
  wrapInRequestContext2
39
- } from "../index-r1z0rd9c.js";
39
+ } from "../index-7n68nmc6.js";
40
40
  import {
41
41
  isRecord
42
42
  } from "../index-9jfdm5tg.js";
@@ -1,8 +1,8 @@
1
- import"../index-hby4qhax.js";
1
+ import"../index-yex7eg1v.js";
2
2
  import {
3
3
  ApiError2,
4
4
  isAbortLikeError
5
- } from "../index-1h6gtdrj.js";
5
+ } from "../index-ygkka6zn.js";
6
6
  import {
7
7
  isRecord
8
8
  } from "../index-9jfdm5tg.js";
@@ -1,12 +1,12 @@
1
- import"../index-hby4qhax.js";
1
+ import"../index-yex7eg1v.js";
2
2
  import {
3
3
  ApiError2
4
- } from "../index-1h6gtdrj.js";
4
+ } from "../index-ygkka6zn.js";
5
5
  import"../index-m38ej7e5.js";
6
6
  import"../index-r5c4fedv.js";
7
7
  import {
8
8
  createClient2
9
- } from "../index-d82d3xg4.js";
9
+ } from "../index-0c419yx7.js";
10
10
  import {
11
11
  AppError2
12
12
  } from "../index-n53mswt3.js";
@@ -14,7 +14,7 @@ import {
14
14
  errorCode2,
15
15
  normalizeError2
16
16
  } from "../index-b2bz0kdm.js";
17
- import"../index-hby4qhax.js";
17
+ import"../index-yex7eg1v.js";
18
18
  import {
19
19
  contextContributionDelta,
20
20
  prepareContextContribution,
@@ -29,14 +29,13 @@ import {
29
29
  implementRegistry2,
30
30
  createImplementRegistry2,
31
31
  bindProcessSignals2,
32
- bindRealtimeServer2,
33
32
  webSocketLane2,
34
33
  composeWebSocketHandlers2,
35
34
  createSocketIOServer2,
36
35
  socketIoLane2,
37
36
  UnixClientTransportError2,
38
37
  createUnixClientTransport2
39
- } from "../index-3ct7hhq6.js";
38
+ } from "../index-xwq9j1sf.js";
40
39
  import {
41
40
  DEFAULT_CONTRACT_STREAM_FRAME_BYTES2
42
41
  } from "../index-r5c4fedv.js";
@@ -56,7 +55,7 @@ import {
56
55
  toJsonSchema,
57
56
  jsonSchemaFields
58
57
  } from "../index-ct75c3at.js";
59
- import"../index-m79yr938.js";
58
+ import"../index-pw99k9h5.js";
60
59
  import"../index-4s0fep5q.js";
61
60
  import"../index-ck71tbcf.js";
62
61
  import"../index-fyphpknh.js";
@@ -64,6 +63,9 @@ import"../index-xqhede6x.js";
64
63
  import {
65
64
  createFileStateStore2
66
65
  } from "../index-wykebpn9.js";
66
+ import {
67
+ bindRealtimeServer2
68
+ } from "../index-qapzv4p5.js";
67
69
  import {
68
70
  withDeadline
69
71
  } from "../index-n1dqr7gf.js";
@@ -75,6 +77,9 @@ import {
75
77
  signJwt2,
76
78
  verifyPkce2
77
79
  } from "../index-45tdvqa3.js";
80
+ import {
81
+ deriveCodeChallenge2
82
+ } from "../index-ap3gqe56.js";
78
83
  import {
79
84
  DEFAULT_CORS_ALLOW_HEADERS2,
80
85
  DEFAULT_CORS_EXPOSE_HEADERS2,
@@ -86,16 +91,13 @@ import {
86
91
  createImplement2,
87
92
  createScopedImplement2
88
93
  } from "../index-afjvjyck.js";
89
- import {
90
- deriveCodeChallenge2
91
- } from "../index-ap3gqe56.js";
92
94
  import {
93
95
  isWithinDir2,
94
96
  realPathWithinDir
95
97
  } from "../index-5cc6r990.js";
96
98
  import {
97
99
  getTraceId2
98
- } from "../index-r1z0rd9c.js";
100
+ } from "../index-7n68nmc6.js";
99
101
  import {
100
102
  generateTraceId2,
101
103
  resolveTraceId2,
@@ -1,5 +1,5 @@
1
- import"../index-hby4qhax.js";
2
- import"../index-1h6gtdrj.js";
1
+ import"../index-yex7eg1v.js";
2
+ import"../index-ygkka6zn.js";
3
3
  import {
4
4
  joinRoutePath
5
5
  } from "../index-m38ej7e5.js";
@@ -7,7 +7,7 @@ import"../index-r5c4fedv.js";
7
7
  import {
8
8
  createClient2,
9
9
  createClients2
10
- } from "../index-d82d3xg4.js";
10
+ } from "../index-0c419yx7.js";
11
11
  import"../index-n53mswt3.js";
12
12
  import"../index-q0th8q0z.js";
13
13
  import {
@@ -1,15 +1,15 @@
1
1
  import"../../index-n53mswt3.js";
2
2
  import"../../index-b2bz0kdm.js";
3
- import"../../index-dvwj1f43.js";
4
- import"../../index-hby4qhax.js";
3
+ import"../../index-0efgsyav.js";
4
+ import"../../index-yex7eg1v.js";
5
5
  import"../../index-9pw0a51a.js";
6
6
  import"../../index-ct75c3at.js";
7
7
  import"../../index-7z9ym7t8.js";
8
- import"../../index-n9tyz8z3.js";
8
+ import"../../index-kgmh97hf.js";
9
9
  import {
10
10
  createToolInvoker2
11
- } from "../../index-m9fndta6.js";
12
- import"../../index-r1z0rd9c.js";
11
+ } from "../../index-ds7jdhep.js";
12
+ import"../../index-7n68nmc6.js";
13
13
  export {
14
14
  createToolInvoker2 as createToolInvoker
15
15
  };
@@ -1,19 +1,21 @@
1
1
  import {
2
2
  EffectUnresolvedError2,
3
- createLocalStepDurability2,
4
- AgentToolError2,
5
- isAgentToolError2
6
- } from "../index-a9pd417t.js";
3
+ createLocalStepDurability2
4
+ } from "../index-5vyd0fkb.js";
7
5
  import {
8
6
  AppError2,
9
7
  STITCH_ERROR_STATUS2
10
8
  } from "../index-n53mswt3.js";
9
+ import {
10
+ AgentToolError2,
11
+ isAgentToolError2
12
+ } from "../index-nggfa2yn.js";
11
13
  import {
12
14
  normalizeError2
13
15
  } from "../index-b2bz0kdm.js";
14
16
  import {
15
17
  resolvePropagationContext2
16
- } from "../index-hby4qhax.js";
18
+ } from "../index-yex7eg1v.js";
17
19
  import {
18
20
  coerceJsonArgs2
19
21
  } from "../index-9pw0a51a.js";
@@ -39,17 +41,15 @@ import {
39
41
  toolResultFromError,
40
42
  ToolExecutionControlError2,
41
43
  isToolExecutionControlError2
42
- } from "../index-dvwj1f43.js";
44
+ } from "../index-0efgsyav.js";
43
45
  import {
44
46
  collectTools2,
45
47
  createToolRunner,
46
48
  formatToolError
47
- } from "../index-n9tyz8z3.js";
49
+ } from "../index-kgmh97hf.js";
48
50
  import {
49
- mountAgent2,
50
- describeToolCatalog2,
51
- buildToolManifest2
52
- } from "../index-xkhk5d6g.js";
51
+ mountAgent2
52
+ } from "../index-xgc94hy6.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-c6aagrbd.js";
80
+ } from "../index-kkk1wzsq.js";
81
81
  import {
82
82
  ManagedFilePathSchema2,
83
83
  ManagedFileRefSchema2
@@ -85,6 +85,9 @@ import {
85
85
  import {
86
86
  ManagedFileError2
87
87
  } from "../index-v4a2fjtk.js";
88
+ import {
89
+ composeToolLifecycle2
90
+ } from "../index-ze1eph1k.js";
88
91
  import {
89
92
  signJwt2,
90
93
  verifyPkce2
@@ -98,20 +101,24 @@ import {
98
101
  guardSignalCallback,
99
102
  mediaTypeEssence
100
103
  } from "../index-afjvjyck.js";
104
+ import {
105
+ describeToolCatalog2,
106
+ buildToolManifest2
107
+ } from "../index-860vjkgm.js";
101
108
  import {
102
109
  collectToolSurface
103
- } from "../index-ewbaywk5.js";
110
+ } from "../index-x1dkwx5x.js";
104
111
  import {
105
112
  argumentsDigest
106
113
  } from "../index-r7a7r7ha.js";
107
114
  import {
108
115
  createToolInvoker2
109
- } from "../index-m9fndta6.js";
116
+ } from "../index-ds7jdhep.js";
110
117
  import {
111
118
  runWithRequestContext2,
112
119
  getRequestContext2,
113
120
  getTraceId2
114
- } from "../index-r1z0rd9c.js";
121
+ } from "../index-7n68nmc6.js";
115
122
  import {
116
123
  defineRuntimeTool2,
117
124
  createRuntimeToolFactory2
@@ -836,24 +843,6 @@ function mountOAuthProvider(config) {
836
843
  };
837
844
  return dcrEnabled ? [metadataRoute(ctx), registerRoute(ctx), authorizeRoute(ctx), tokenRoute(ctx)] : [metadataRoute(ctx), authorizeRoute(ctx), tokenRoute(ctx)];
838
845
  }
839
- // src/tools/lifecycle.ts
840
- function composeToolLifecycle(...hooks) {
841
- return {
842
- beforeHandle: async (ctx, endpoint) => {
843
- for (const hook of hooks)
844
- await hook?.beforeHandle?.(ctx, endpoint);
845
- },
846
- afterHandle: async (ctx, result, endpoint) => {
847
- let current = result;
848
- for (const hook of hooks) {
849
- const transformed = await hook?.afterHandle?.(ctx, current, endpoint);
850
- if (transformed !== undefined)
851
- current = transformed;
852
- }
853
- return current;
854
- }
855
- };
856
- }
857
846
  // src/tools/list-names.ts
858
847
  function listToolNames(surface) {
859
848
  const entries = new Map;
@@ -2958,7 +2947,7 @@ export {
2958
2947
  buildToolManifest2 as buildToolManifest,
2959
2948
  coerceJsonArgs2 as coerceJsonArgs,
2960
2949
  collectTools2 as collectTools,
2961
- composeToolLifecycle,
2950
+ composeToolLifecycle2 as composeToolLifecycle,
2962
2951
  createAsyncOperationSnapshotSchema2 as createAsyncOperationSnapshotSchema,
2963
2952
  createLocalStepDurability2 as createLocalStepDurability,
2964
2953
  createMcpHandler,
@@ -1,7 +1,7 @@
1
- import"../index-hby4qhax.js";
1
+ import"../index-yex7eg1v.js";
2
2
  import {
3
3
  ApiError2
4
- } from "../index-1h6gtdrj.js";
4
+ } from "../index-ygkka6zn.js";
5
5
  import"../index-m38ej7e5.js";
6
6
  import {
7
7
  defineContract2
@@ -7,7 +7,7 @@ import {
7
7
  ApiError2,
8
8
  refuseLocally,
9
9
  parseApiErrorBody
10
- } from "./index-1h6gtdrj.js";
10
+ } from "./index-ygkka6zn.js";
11
11
  import {
12
12
  parseTrailingWildcard
13
13
  } from "./index-m38ej7e5.js";
@@ -19,7 +19,7 @@ import {
19
19
  import {
20
20
  runWithRequestContext2,
21
21
  getRequestContext2
22
- } from "./index-r1z0rd9c.js";
22
+ } from "./index-7n68nmc6.js";
23
23
  import {
24
24
  formatZodError2
25
25
  } from "./index-1eeqpadm.js";