stitchkit 0.106.1 → 0.108.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 (147) hide show
  1. package/CHANGELOG.md +151 -0
  2. package/README.md +2 -0
  3. package/darwin-native.cjs +17 -4
  4. package/dist/agent-runtime/deferred-tool-types.d.ts +6 -27
  5. package/dist/agent-runtime/deferred-tool-types.d.ts.map +1 -1
  6. package/dist/browser/stream.d.ts +38 -12
  7. package/dist/browser/stream.d.ts.map +1 -1
  8. package/dist/entrypoints/agent-runtime/browser.js +2 -3
  9. package/dist/entrypoints/agent-runtime/coding-tools.js +6 -8
  10. package/dist/entrypoints/agent-runtime/harness.js +7 -11
  11. package/dist/entrypoints/agent-runtime/realtime.js +2 -3
  12. package/dist/entrypoints/agent-runtime/sandbox.js +6 -8
  13. package/dist/entrypoints/agent-runtime.d.ts +2 -1
  14. package/dist/entrypoints/agent-runtime.d.ts.map +1 -1
  15. package/dist/entrypoints/agent-runtime.js +20 -23
  16. package/dist/entrypoints/application/diagnostic-journal.js +3 -3
  17. package/dist/entrypoints/application/directory-inbox.js +8 -9
  18. package/dist/entrypoints/application/grammy.js +3 -3
  19. package/dist/entrypoints/application.js +7 -8
  20. package/dist/entrypoints/bin/upgrade-cli.d.ts +32 -0
  21. package/dist/entrypoints/bin/upgrade-cli.d.ts.map +1 -1
  22. package/dist/entrypoints/bin/upgrade-cli.js +451 -8
  23. package/dist/entrypoints/cli/publish.js +10 -11
  24. package/dist/entrypoints/cli.js +12 -16
  25. package/dist/entrypoints/contract.js +1 -1
  26. package/dist/entrypoints/files/packaging.d.ts +3 -1
  27. package/dist/entrypoints/files/packaging.d.ts.map +1 -1
  28. package/dist/entrypoints/files/packaging.js +171 -55
  29. package/dist/entrypoints/files.js +16 -16
  30. package/dist/entrypoints/index.d.ts +1 -1
  31. package/dist/entrypoints/index.d.ts.map +1 -1
  32. package/dist/entrypoints/index.js +47 -41
  33. package/dist/entrypoints/node.js +27 -29
  34. package/dist/entrypoints/observability.js +10 -12
  35. package/dist/entrypoints/process.js +2 -2
  36. package/dist/entrypoints/react.js +3 -4
  37. package/dist/entrypoints/remote.js +8 -9
  38. package/dist/entrypoints/server.js +48 -51
  39. package/dist/entrypoints/telegram/html.js +3 -3
  40. package/dist/entrypoints/telegram/screens.js +6 -6
  41. package/dist/entrypoints/telegram.d.ts +2 -0
  42. package/dist/entrypoints/telegram.d.ts.map +1 -1
  43. package/dist/entrypoints/telegram.js +344 -11
  44. package/dist/entrypoints/testing.d.ts +1 -0
  45. package/dist/entrypoints/testing.d.ts.map +1 -1
  46. package/dist/entrypoints/testing.js +138 -11
  47. package/dist/entrypoints/tools/connections.js +11 -11
  48. package/dist/entrypoints/tools/invoker.js +5 -9
  49. package/dist/entrypoints/tools/mcp.js +8 -14
  50. package/dist/entrypoints/tools.js +19 -25
  51. package/dist/entrypoints/tracking.js +3 -3
  52. package/dist/files/native-artifact.d.ts +14 -0
  53. package/dist/files/native-artifact.d.ts.map +1 -0
  54. package/dist/files/native-packaging-layout.d.ts +11 -2
  55. package/dist/files/native-packaging-layout.d.ts.map +1 -1
  56. package/dist/files/native-packaging-plugin.d.ts +53 -0
  57. package/dist/files/native-packaging-plugin.d.ts.map +1 -0
  58. package/dist/files/native-packaging.d.ts +44 -43
  59. package/dist/files/native-packaging.d.ts.map +1 -1
  60. package/dist/{index-v5ee8ath.js → index-1h2zv8rx.js} +10 -40
  61. package/dist/index-2kbysk9s.js +42 -0
  62. package/dist/{index-wbhdzxar.js → index-2s6fpehp.js} +5 -5
  63. package/dist/{index-ksfagmyz.js → index-4qh90tyw.js} +8 -8
  64. package/dist/{index-yvfk3y36.js → index-636mggad.js} +4 -3
  65. package/dist/{index-f199nfq5.js → index-6y9t2fwz.js} +7 -7
  66. package/dist/{index-w8etpm8j.js → index-9j2atjte.js} +1 -1
  67. package/dist/index-a5qr2rj6.js +26 -0
  68. package/dist/{index-azx12jgv.js → index-bh2ht9y5.js} +13 -7
  69. package/dist/{index-pz3y6b6g.js → index-cx2nh595.js} +3 -3
  70. package/dist/{index-2k91mewf.js → index-dm2fv45z.js} +9 -9
  71. package/dist/{index-9bskshe3.js → index-dwf0gymy.js} +10 -10
  72. package/dist/{index-qaqbdm7s.js → index-h7qms8f9.js} +8 -8
  73. package/dist/{index-drs41arz.js → index-ktjmgq9p.js} +1 -1
  74. package/dist/{index-916yh4e2.js → index-mep4sb48.js} +14 -14
  75. package/dist/{index-wdy68sh6.js → index-njs9gvrh.js} +17 -17
  76. package/dist/{index-1ptj98e0.js → index-nx49x0tw.js} +2 -2
  77. package/dist/{index-1pwwan01.js → index-p5kx5vqd.js} +214 -59
  78. package/dist/{index-sj28htvf.js → index-pvh3z03x.js} +1 -1
  79. package/dist/{index-r393tnfp.js → index-q6crhe1n.js} +4 -4
  80. package/dist/{index-dsnjzb62.js → index-t2bsd0hm.js} +1 -1
  81. package/dist/{index-4vsby8n8.js → index-w9mqgnz9.js} +1 -1
  82. package/dist/{index-z23rfxhj.js → index-xmgjtkvr.js} +1 -1
  83. package/dist/{index-e05cjgtf.js → index-xvj9h8yh.js} +28 -1
  84. package/dist/{index-gr5g3xfw.js → index-yz8x0hbx.js} +1 -1
  85. package/dist/{index-gxm9rc97.js → index-zrtrjkbf.js} +1 -1
  86. package/dist/internal/bounded-lines.d.ts +46 -2
  87. package/dist/internal/bounded-lines.d.ts.map +1 -1
  88. package/dist/internal/darwin-binding-error.d.ts +9 -1
  89. package/dist/internal/darwin-binding-error.d.ts.map +1 -1
  90. package/dist/internal/darwin-binding.d.ts.map +1 -1
  91. package/dist/internal/process-identity.d.ts.map +1 -1
  92. package/dist/internal/until-aborted.d.ts +9 -0
  93. package/dist/internal/until-aborted.d.ts.map +1 -0
  94. package/dist/internal/upgrade-affects.d.ts +58 -0
  95. package/dist/internal/upgrade-affects.d.ts.map +1 -0
  96. package/dist/internal/upgrade-plan.d.ts +20 -0
  97. package/dist/internal/upgrade-plan.d.ts.map +1 -1
  98. package/dist/internal/upgrade-usage.d.ts +61 -0
  99. package/dist/internal/upgrade-usage.d.ts.map +1 -0
  100. package/dist/telegram/bot-api.d.ts +10 -4
  101. package/dist/telegram/bot-api.d.ts.map +1 -1
  102. package/dist/telegram/broadcast.d.ts +2 -1
  103. package/dist/telegram/broadcast.d.ts.map +1 -1
  104. package/dist/telegram/not-dispatched.d.ts +26 -0
  105. package/dist/telegram/not-dispatched.d.ts.map +1 -0
  106. package/dist/telegram/operator-channel.d.ts +2 -1
  107. package/dist/telegram/operator-channel.d.ts.map +1 -1
  108. package/dist/telegram/send-failure.d.ts +4 -3
  109. package/dist/telegram/send-failure.d.ts.map +1 -1
  110. package/dist/telegram/transport-connect.d.ts +38 -0
  111. package/dist/telegram/transport-connect.d.ts.map +1 -0
  112. package/dist/telegram/transport.d.ts +43 -0
  113. package/dist/telegram/transport.d.ts.map +1 -0
  114. package/dist/telegram/webhook.d.ts +2 -1
  115. package/dist/telegram/webhook.d.ts.map +1 -1
  116. package/dist/testing/manual-clock.d.ts +82 -0
  117. package/dist/testing/manual-clock.d.ts.map +1 -0
  118. package/dist/tools/internal/surface-projector.d.ts +0 -7
  119. package/dist/tools/internal/surface-projector.d.ts.map +1 -1
  120. package/dist/tools/runtime-tool-declaration.d.ts +11 -0
  121. package/dist/tools/runtime-tool-declaration.d.ts.map +1 -1
  122. package/dist/tools/runtime-tool.d.ts +2 -3
  123. package/dist/tools/runtime-tool.d.ts.map +1 -1
  124. package/llms/files-packaging.txt +13 -6
  125. package/llms/process.txt +71 -15
  126. package/llms/stitchkit.2.txt +211 -628
  127. package/llms/stitchkit.txt +635 -10
  128. package/llms/telegram.txt +36 -3
  129. package/llms/testing.txt +47 -0
  130. package/llms/{upgrading-0.96.0-0.106.0.txt → upgrading-0.100.0-0.108.0.txt} +112 -144
  131. package/llms/{upgrading-0.37.0-0.53.0.txt → upgrading-0.37.0-0.58.0.txt} +209 -3
  132. package/llms/{upgrading-0.55.0-0.68.0.txt → upgrading-0.59.0-0.71.0.txt} +149 -209
  133. package/llms/{upgrading-0.69.0-0.95.0.txt → upgrading-0.72.0-0.99.0.txt} +137 -149
  134. package/llms/upgrading.txt +36 -4
  135. package/llms-full.txt +360 -39
  136. package/llms.txt +10 -10
  137. package/package.json +2 -1
  138. package/llms/stitchkit.3.txt +0 -177
  139. package/dist/{index-cazts87s.js → index-07dcf2yn.js} +3 -3
  140. package/dist/{index-n1nszyk0.js → index-7jvwrjqa.js} +3 -3
  141. package/dist/{index-cmzvhhtd.js → index-85qve8mq.js} +3 -3
  142. package/dist/{index-rpzewktb.js → index-fynr93w4.js} +3 -3
  143. package/dist/{index-37asdw3a.js → index-k7qdkh3n.js} +3 -3
  144. package/dist/{index-x7w1z6pf.js → index-q4hjtyye.js} +4 -4
  145. package/dist/{index-7n68nmc6.js → index-y3nemndz.js} +3 -3
  146. package/dist/{index-12zsej7b.js → index-y70v24cw.js} +3 -3
  147. package/dist/{index-pzb63z66.js → index-ykdcnq1f.js} +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../src/entrypoints/testing.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EACL,KAAK,gCAAgC,EACrC,KAAK,kCAAkC,EACvC,+BAA+B,EAC/B,KAAK,sCAAsC,EAC3C,KAAK,iCAAiC,EACtC,KAAK,+BAA+B,EACpC,qCAAqC,EACrC,KAAK,kCAAkC,EACvC,KAAK,oCAAoC,EACzC,0CAA0C,EAC1C,wCAAwC,EACxC,KAAK,oCAAoC,EACzC,0CAA0C,EAC1C,KAAK,sCAAsC,EAC3C,4CAA4C,EAC5C,6BAA6B,GAC9B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,KAAK,+BAA+B,EACpC,yBAAyB,EACzB,KAAK,yBAAyB,EAC9B,mBAAmB,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,GAC3B,MAAM,2BAA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,+BAA+B,EAC/B,KAAK,4BAA4B,EACjC,0BAA0B,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,6BAA6B,CAAC"}
@@ -1,19 +1,12 @@
1
- import"../index-kfjkb396.js";
2
1
  import {
3
2
  joinRoutePath
4
3
  } from "../index-m38ej7e5.js";
5
4
  import"../index-h2fhjqy7.js";
6
- import {
7
- createClient2,
8
- createClients2
9
- } from "../index-1pwwan01.js";
10
- import"../index-yex7eg1v.js";
11
- import"../index-n1nszyk0.js";
12
- import"../index-j9gxbztg.js";
5
+ import"../index-7jvwrjqa.js";
13
6
  import"../index-q0th8q0z.js";
14
7
  import {
15
8
  createApplication2
16
- } from "../index-12zsej7b.js";
9
+ } from "../index-y70v24cw.js";
17
10
  import"../index-w5s3xftz.js";
18
11
  import {
19
12
  RealtimeRequestTimeoutError2,
@@ -37,8 +30,15 @@ import {
37
30
  projectToolSurface,
38
31
  mcpProjectionCandidate,
39
32
  prepareProjectedMcpTools
40
- } from "../index-r393tnfp.js";
41
- import"../index-rpzewktb.js";
33
+ } from "../index-q6crhe1n.js";
34
+ import"../index-fynr93w4.js";
35
+ import {
36
+ createClient2,
37
+ createClients2
38
+ } from "../index-p5kx5vqd.js";
39
+ import {
40
+ assertPositiveSafeInteger
41
+ } from "../index-0s4xebbg.js";
42
42
  import {
43
43
  compareCodeUnits,
44
44
  serializeCanonicalJson
@@ -648,6 +648,131 @@ async function runManagedResourceConformance(config) {
648
648
  await runScenario(config, scenario, watchdogTimeoutMs);
649
649
  }
650
650
  }
651
+ // src/testing/manual-clock.ts
652
+ class ManualClockError extends Error {
653
+ code;
654
+ holds;
655
+ name = "ManualClockError";
656
+ constructor(code, message, holds = []) {
657
+ super(message);
658
+ this.code = code;
659
+ this.holds = holds;
660
+ }
661
+ }
662
+ var DEFAULT_WALL_START = Date.parse("2026-01-01T00:00:00.000Z");
663
+ function createManualClock(options = {}) {
664
+ const startMs = options.startMs ?? 0;
665
+ if (!Number.isFinite(startMs))
666
+ throw new RangeError("startMs must be a finite number");
667
+ const wallStart = options.wallStart?.getTime() ?? DEFAULT_WALL_START;
668
+ if (!Number.isFinite(wallStart))
669
+ throw new RangeError("wallStart must be a valid date");
670
+ const turns = options.yieldTurns ?? 8;
671
+ assertPositiveSafeInteger("yieldTurns", turns);
672
+ const holdLimitMs = options.holdLimitMs ?? 5000;
673
+ assertPositiveSafeInteger("holdLimitMs", holdLimitMs);
674
+ let now = startMs;
675
+ let order = 0;
676
+ let moving = false;
677
+ const timers = new Map;
678
+ const holds = new Map;
679
+ const activeHolds = () => [...holds.values()].filter((hold) => !hold.parked).map((hold) => hold.reason);
680
+ const settle = async () => {
681
+ for (let turn = 0;turn < turns; turn++)
682
+ await new Promise((resolve) => setImmediate(resolve));
683
+ };
684
+ const idle = async () => {
685
+ const started = performance.now();
686
+ for (let open = activeHolds();open.length > 0; open = activeHolds()) {
687
+ if (performance.now() - started > holdLimitMs)
688
+ throw new ManualClockError("MANUAL_CLOCK_HOLD_TIMEOUT", `Manual clock waited ${holdLimitMs} ms of real time for ${open.length} open hold(s): ${open.join(", ")}`, open);
689
+ await new Promise((resolve) => setTimeout(resolve, 0));
690
+ }
691
+ await settle();
692
+ };
693
+ const nextDue = (limit) => {
694
+ let best;
695
+ for (const entry of timers) {
696
+ const [, timer] = entry;
697
+ if (timer.at > limit)
698
+ continue;
699
+ if (!best || timer.at < best[1].at || timer.at === best[1].at && timer.order < best[1].order)
700
+ best = entry;
701
+ }
702
+ return best;
703
+ };
704
+ const move = async (target) => {
705
+ await idle();
706
+ for (let due = nextDue(target);due; due = nextDue(target)) {
707
+ const [id, timer] = due;
708
+ timers.delete(id);
709
+ now = Math.max(now, timer.at);
710
+ timer.callback();
711
+ await idle();
712
+ }
713
+ now = target;
714
+ await idle();
715
+ };
716
+ const clock = {
717
+ now: () => now,
718
+ wallNow: () => new Date(wallStart + (now - startMs)),
719
+ schedule(callback, delayMs) {
720
+ if (Number.isNaN(delayMs))
721
+ throw new RangeError("Timer delay must be a number");
722
+ const id = ++order;
723
+ timers.set(id, { at: now + Math.max(0, delayMs), order: id, callback });
724
+ return { cancel: () => void timers.delete(id) };
725
+ },
726
+ async advance(ms) {
727
+ if (!Number.isFinite(ms) || ms < 0)
728
+ throw new RangeError(`Manual clock cannot advance by ${ms} ms`);
729
+ if (moving)
730
+ throw new Error("Manual clock is already advancing; await that advance first");
731
+ moving = true;
732
+ try {
733
+ await move(now + ms);
734
+ } finally {
735
+ moving = false;
736
+ }
737
+ },
738
+ async until(done, { stepMs = 100, limitMs = 600000 } = {}) {
739
+ assertPositiveSafeInteger("stepMs", stepMs);
740
+ assertPositiveSafeInteger("limitMs", limitMs);
741
+ const from = now;
742
+ await idle();
743
+ while (!done()) {
744
+ if (now - from >= limitMs)
745
+ throw new ManualClockError("MANUAL_CLOCK_LIMIT", `Condition still false after ${now - from} ms of manual time (limit ${limitMs} ms, ${timers.size} timer(s) pending)`);
746
+ const next = nextDue(Number.POSITIVE_INFINITY);
747
+ const jump = next ? Math.max(0, next[1].at - now) : stepMs;
748
+ await clock.advance(Math.min(jump, from + limitMs - now));
749
+ }
750
+ return now - from;
751
+ },
752
+ pending: () => timers.size,
753
+ hold(reason) {
754
+ const id = ++order;
755
+ holds.set(id, { reason, parked: false });
756
+ return {
757
+ release: () => void holds.delete(id),
758
+ park() {
759
+ const hold = holds.get(id);
760
+ if (!hold || hold.parked)
761
+ return () => {
762
+ return;
763
+ };
764
+ hold.parked = true;
765
+ return () => {
766
+ const current = holds.get(id);
767
+ if (current)
768
+ current.parked = false;
769
+ };
770
+ }
771
+ };
772
+ }
773
+ };
774
+ return clock;
775
+ }
651
776
  // src/testing/surface-conformance.ts
652
777
  import { z as z2 } from "zod";
653
778
  var RealtimeRejectionObservationSchema = z2.object({
@@ -1343,6 +1468,7 @@ export {
1343
1468
  ManagedResourceConformanceScenarioSchema,
1344
1469
  ManagedResourceConformanceTraceEntrySchema,
1345
1470
  ManagedResourceConformanceTraceOutcomeSchema,
1471
+ ManualClockError,
1346
1472
  RealtimeDisconnectObservationSchema,
1347
1473
  RealtimeRejectionObservationSchema,
1348
1474
  SURFACE_MANIFEST_VERSION,
@@ -1362,6 +1488,7 @@ export {
1362
1488
  buildSurfaceManifest,
1363
1489
  createHandlerTestClient,
1364
1490
  createHandlerTestClients,
1491
+ createManualClock,
1365
1492
  createRealtimeProbeDriver,
1366
1493
  defineRealtimeProbe,
1367
1494
  runManagedResourceConformance,
@@ -1,17 +1,9 @@
1
- import {
2
- AppError2,
3
- STITCH_ERROR_STATUS2,
4
- isRetryableStatus2
5
- } from "../../index-j9gxbztg.js";
6
- import {
7
- TOOL_ERROR_PROJECTION
8
- } from "../../index-556g5hsh.js";
9
1
  import"../../index-ct75c3at.js";
10
2
  import {
11
3
  declaresDraft07,
12
4
  withDefsDialect
13
- } from "../../index-r393tnfp.js";
14
- import"../../index-rpzewktb.js";
5
+ } from "../../index-q6crhe1n.js";
6
+ import"../../index-fynr93w4.js";
15
7
  import {
16
8
  withSignalDeadline
17
9
  } from "../../index-9tqbxv5p.js";
@@ -26,7 +18,15 @@ import {
26
18
  } from "../../index-0s4xebbg.js";
27
19
  import {
28
20
  defineRuntimeTool2
29
- } from "../../index-yvfk3y36.js";
21
+ } from "../../index-636mggad.js";
22
+ import {
23
+ TOOL_ERROR_PROJECTION
24
+ } from "../../index-556g5hsh.js";
25
+ import {
26
+ AppError2,
27
+ STITCH_ERROR_STATUS2,
28
+ isRetryableStatus2
29
+ } from "../../index-j9gxbztg.js";
30
30
  import {
31
31
  safeJsonParse
32
32
  } from "../../index-zsarb5xp.js";
@@ -1,16 +1,12 @@
1
- import"../../index-j9gxbztg.js";
2
- import"../../index-rpzewktb.js";
3
- import"../../index-556g5hsh.js";
4
- import"../../index-2k91mewf.js";
5
- import"../../index-yex7eg1v.js";
1
+ import"../../index-fynr93w4.js";
6
2
  import"../../index-6yxhe58g.js";
7
3
  import"../../index-ct75c3at.js";
8
- import"../../index-r393tnfp.js";
9
- import"../../index-wbhdzxar.js";
4
+ import"../../index-q6crhe1n.js";
5
+ import"../../index-dm2fv45z.js";
6
+ import"../../index-2s6fpehp.js";
10
7
  import {
11
8
  createToolInvoker2
12
- } from "../../index-f199nfq5.js";
13
- import"../../index-7n68nmc6.js";
9
+ } from "../../index-6y9t2fwz.js";
14
10
  export {
15
11
  createToolInvoker2 as createToolInvoker
16
12
  };
@@ -1,4 +1,9 @@
1
1
  import"../../index-ct75c3at.js";
2
+ import"../../index-fynr93w4.js";
3
+ import"../../index-6yxhe58g.js";
4
+ import"../../index-q6crhe1n.js";
5
+ import"../../index-dm2fv45z.js";
6
+ import"../../index-2s6fpehp.js";
2
7
  import {
3
8
  RESOURCE_MIME_TYPE2,
4
9
  EXT_APPS_BUNDLE_PLACEHOLDER2,
@@ -14,20 +19,9 @@ import {
14
19
  createMcpHttpRoute2,
15
20
  createStdioMcpServer2,
16
21
  bindStdioProcessSignals2
17
- } from "../../index-916yh4e2.js";
18
- import"../../index-j9gxbztg.js";
19
- import"../../index-rpzewktb.js";
20
- import"../../index-yex7eg1v.js";
21
- import"../../index-6yxhe58g.js";
22
- import"../../index-r393tnfp.js";
23
- import"../../index-2k91mewf.js";
24
- import"../../index-556g5hsh.js";
25
- import"../../index-wbhdzxar.js";
26
- import"../../index-sznqf8fx.js";
27
- import"../../index-e6c2spsd.js";
28
- import"../../index-pz3y6b6g.js";
29
- import"../../index-yvfk3y36.js";
30
- import"../../index-7n68nmc6.js";
22
+ } from "../../index-mep4sb48.js";
23
+ import"../../index-cx2nh595.js";
24
+ import"../../index-636mggad.js";
31
25
  export {
32
26
  EXT_APPS_BUNDLE_PLACEHOLDER2 as EXT_APPS_BUNDLE_PLACEHOLDER,
33
27
  MCP_CATALOG_META_KEY2 as MCP_CATALOG_META_KEY,
@@ -4,14 +4,9 @@ import {
4
4
  AgentToolError2,
5
5
  isAgentToolError2
6
6
  } from "../index-c17xcx4k.js";
7
- import {
8
- AppError2,
9
- STITCH_ERROR_STATUS2
10
- } from "../index-j9gxbztg.js";
11
7
  import {
12
8
  normalizeError2
13
- } from "../index-rpzewktb.js";
14
- import"../index-yex7eg1v.js";
9
+ } from "../index-fynr93w4.js";
15
10
  import {
16
11
  coerceJsonArgs2
17
12
  } from "../index-6yxhe58g.js";
@@ -23,27 +18,25 @@ import {
23
18
  findNonPortableFormats2,
24
19
  flattenToolJsonSchema2,
25
20
  findUntypedProperties2
26
- } from "../index-r393tnfp.js";
21
+ } from "../index-q6crhe1n.js";
27
22
  import {
28
23
  ToolExecutionControlError2,
29
24
  isToolExecutionControlError2
30
- } from "../index-2k91mewf.js";
31
- import"../index-556g5hsh.js";
25
+ } from "../index-dm2fv45z.js";
32
26
  import {
33
27
  collectTools2
34
- } from "../index-wbhdzxar.js";
28
+ } from "../index-2s6fpehp.js";
35
29
  import {
36
30
  mountAgent2,
37
31
  describeToolCatalog2,
38
32
  buildToolManifest2
39
- } from "../index-qaqbdm7s.js";
33
+ } from "../index-h7qms8f9.js";
40
34
  import"../index-m38ej7e5.js";
41
35
  import {
42
36
  ALL_TRANSPORTS2,
43
37
  TOOL_TRANSPORTS2,
44
38
  defineContract2
45
39
  } from "../index-fsw1ybf3.js";
46
- import"../index-1bx1xv1k.js";
47
40
  import {
48
41
  PROTECTED_RESOURCE_PATH2,
49
42
  protectedResourceMetadataUrl2,
@@ -64,9 +57,7 @@ import {
64
57
  createMcpHttpRoute2,
65
58
  createStdioMcpServer2,
66
59
  bindStdioProcessSignals2
67
- } from "../index-916yh4e2.js";
68
- import"../index-sznqf8fx.js";
69
- import"../index-e6c2spsd.js";
60
+ } from "../index-mep4sb48.js";
70
61
  import {
71
62
  AsyncOperationCancelResultSchema2,
72
63
  createAsyncOperationSnapshotSchema2,
@@ -80,15 +71,14 @@ import {
80
71
  WaitTimeoutError,
81
72
  runWaitOperation,
82
73
  createCli2
83
- } from "../index-ksfagmyz.js";
74
+ } from "../index-4qh90tyw.js";
84
75
  import {
85
76
  ManagedFilePathSchema2,
86
77
  ManagedFileRefSchema2
87
78
  } from "../index-xqhede6x.js";
88
- import"../index-j4zh647a.js";
89
79
  import {
90
80
  ManagedFileError2
91
- } from "../index-w8etpm8j.js";
81
+ } from "../index-9j2atjte.js";
92
82
  import {
93
83
  fetchGuarded,
94
84
  fetchPinnedDocument,
@@ -97,31 +87,35 @@ import {
97
87
  import {
98
88
  signJwt2,
99
89
  verifyPkce2
100
- } from "../index-37asdw3a.js";
90
+ } from "../index-k7qdkh3n.js";
101
91
  import {
102
92
  contractOnlyService,
103
93
  mediaTypeEssence
104
- } from "../index-cmzvhhtd.js";
105
- import"../index-cazts87s.js";
94
+ } from "../index-85qve8mq.js";
95
+ import"../index-1bx1xv1k.js";
106
96
  import {
107
97
  collectToolSurface
108
- } from "../index-pz3y6b6g.js";
98
+ } from "../index-cx2nh595.js";
109
99
  import {
110
100
  defineRuntimeTool2,
111
101
  createRuntimeToolFactory2
112
- } from "../index-yvfk3y36.js";
102
+ } from "../index-636mggad.js";
113
103
  import {
114
104
  DEFAULT_CORS_ALLOW_HEADERS2
115
105
  } from "../index-yk4g8805.js";
116
106
  import {
117
107
  createToolInvoker2
118
- } from "../index-f199nfq5.js";
108
+ } from "../index-6y9t2fwz.js";
119
109
  import {
120
110
  getTraceId2
121
- } from "../index-7n68nmc6.js";
111
+ } from "../index-y3nemndz.js";
122
112
  import {
123
113
  formatZodError2
124
114
  } from "../index-1eeqpadm.js";
115
+ import {
116
+ AppError2,
117
+ STITCH_ERROR_STATUS2
118
+ } from "../index-j9gxbztg.js";
125
119
  import {
126
120
  isRecord
127
121
  } from "../index-9jfdm5tg.js";
@@ -1,10 +1,10 @@
1
- import {
2
- ApiError2
3
- } from "../index-kfjkb396.js";
4
1
  import"../index-m38ej7e5.js";
5
2
  import {
6
3
  defineContract2
7
4
  } from "../index-fsw1ybf3.js";
5
+ import {
6
+ ApiError2
7
+ } from "../index-kfjkb396.js";
8
8
 
9
9
  // src/tracking/attribution.ts
10
10
  import { z as z2 } from "zod";
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Which Darwin loader an artifact carries: `packaged` (the static loader a packaging plugin
3
+ * wrote), `unpackaged` (the default loader, which refuses the addon inside a bundle) or
4
+ * `no-loader` (nothing in it loads the addon). An artifact with both reads `unpackaged`: one
5
+ * unpackaged loader is enough for its calls to refuse on macOS.
6
+ */
7
+ export type NativeArtifactLoader = 'packaged' | 'unpackaged' | 'no-loader';
8
+ /**
9
+ * Classify a built artifact (a JS bundle or a compiled executable) by the marker every generated
10
+ * loader carries, without running it. Reads the bytes only; builds made before the marker existed
11
+ * (0.107.0 and earlier) read `no-loader`.
12
+ */
13
+ export declare function inspectNativeArtifact(bytes: Uint8Array): NativeArtifactLoader;
14
+ //# sourceMappingURL=native-artifact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-artifact.d.ts","sourceRoot":"","sources":["../../src/files/native-artifact.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG,YAAY,GAAG,WAAW,CAAC;AAW3E;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,GAAG,oBAAoB,CAI7E"}
@@ -49,10 +49,19 @@ export declare function nativeAssetDigest(bytes: Uint8Array): {
49
49
  /**
50
50
  * How a generated loader names its addons.
51
51
  * `static`: a literal `require` the bundler follows and embeds or copies.
52
- * `beside-loader`: a path computed at runtime from the loader's own directory, which no bundler
53
- * follows. Only a packaging plugin turns the second form into the first.
52
+ * `beside-loader`: a path computed at runtime from the loader's own file, which no bundler
53
+ * follows. It reads `module.filename`, never `__dirname` or `__filename`: a bundler inlines
54
+ * those as the build machine's absolute path, while inside a bundle `module.filename` is not an
55
+ * absolute path, so the loader refuses there with {@link NATIVE_NOT_PACKAGED} instead of
56
+ * looking for the addon on a machine that is not this one. Only a packaging plugin turns the
57
+ * second form into the first.
54
58
  */
55
59
  export type NativeLoaderResolution = 'static' | 'beside-loader';
60
+ /**
61
+ * The string a generated loader carries as `module.exports.stitchkitNativeLoader`: `packaged` for
62
+ * the static loader a packaging plugin writes, `unpackaged` for the default beside-loader.
63
+ */
64
+ export declare function nativeLoaderMarker(state: 'packaged' | 'unpackaged'): string;
56
65
  /** One lazy loader for package, companion and embedded delivery. */
57
66
  export declare function nativeLoaderSource(assets: Readonly<Record<string, string>>, resolution: NativeLoaderResolution): string;
58
67
  //# sourceMappingURL=native-packaging-layout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"native-packaging-layout.d.ts","sourceRoot":"","sources":["../../src/files/native-packaging-layout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wGAAwG;AACxG,eAAO,MAAM,kBAAkB,aAU5B,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;kBAG7B,CAAC;AAEH,kGAAkG;AAClG,eAAO,MAAM,sBAAsB;;;;kBAIjC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;kBASpC,CAAC;AAEH,wCAAwC;AACxC,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,oGAAoG;AACpG,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAErF;AAED;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,eAAe,CAAC;AAKhE,oEAAoE;AACpE,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACxC,UAAU,EAAE,sBAAsB,GACjC,MAAM,CA6BR"}
1
+ {"version":3,"file":"native-packaging-layout.d.ts","sourceRoot":"","sources":["../../src/files/native-packaging-layout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,wGAAwG;AACxG,eAAO,MAAM,kBAAkB,aAU5B,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;kBAG7B,CAAC;AAEH,kGAAkG;AAClG,eAAO,MAAM,sBAAsB;;;;kBAIjC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;kBASpC,CAAC;AAEH,wCAAwC;AACxC,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,oGAAoG;AACpG,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAErF;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,eAAe,CAAC;AAQhE;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,YAAY,GAAG,MAAM,CAE3E;AAQD,oEAAoE;AACpE,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACxC,UAAU,EAAE,sBAAsB,GACjC,MAAM,CAiDR"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Structural Bun plugin protocol: declarations need no Bun runtime or ambient types.
3
+ */
4
+ export type NativePackagingPlugin = {
5
+ name: string;
6
+ setup: (build: {
7
+ config: {
8
+ splitting?: boolean;
9
+ naming?: string | {
10
+ entry?: string;
11
+ };
12
+ entrypoints: string[];
13
+ };
14
+ onLoad: (options: {
15
+ filter: RegExp;
16
+ }, callback: (args: {
17
+ path: string;
18
+ }) => {
19
+ contents: string;
20
+ loader: 'js';
21
+ } | {
22
+ contents: Uint8Array;
23
+ loader: 'napi';
24
+ } | undefined) => unknown;
25
+ onResolve: (options: {
26
+ filter: RegExp;
27
+ }, callback: (args: {
28
+ path: string;
29
+ importer: string;
30
+ }) => {
31
+ path: string;
32
+ external: boolean;
33
+ } | undefined) => unknown;
34
+ }) => void;
35
+ };
36
+ /** The installed package a plugin belongs to: its root, its version and its loader file. */
37
+ export interface NativePackagingOwner {
38
+ readonly root: string;
39
+ readonly version: string;
40
+ /** Absolute path of the default loader, as the published manifest names it. */
41
+ readonly loaderPath: string;
42
+ /** The manifest's relative loader path, the suffix every installation's loader shares. */
43
+ readonly loaderName: string;
44
+ }
45
+ /**
46
+ * The one Bun plugin of both deliveries: it swaps its own installation's default loader for a
47
+ * static one, hands Bun the verified bytes of each embedded addon, and keeps companion addons
48
+ * external to a build whose single entry is named exactly `entryPath`. A default loader of any
49
+ * other installation fails the build: the entry imports a `stitchkit` this plugin did not package,
50
+ * and an artifact that carried that loader would refuse the addon at run time.
51
+ */
52
+ export declare function nativePlugin(owner: NativePackagingOwner, specifiers: Readonly<Record<string, string>>, embedded: ReadonlyMap<string, Uint8Array>, companionEntry: string | undefined): NativePackagingPlugin;
53
+ //# sourceMappingURL=native-packaging-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-packaging-plugin.d.ts","sourceRoot":"","sources":["../../src/files/native-packaging-plugin.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,CAAC,KAAK,EAAE;QACb,MAAM,EAAE;YACN,SAAS,CAAC,EAAE,OAAO,CAAC;YACpB,MAAM,CAAC,EAAE,MAAM,GAAG;gBAAE,KAAK,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC;YACrC,WAAW,EAAE,MAAM,EAAE,CAAC;SACvB,CAAC;QACF,MAAM,EAAE,CACN,OAAO,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,EAC3B,QAAQ,EAAE,CAAC,IAAI,EAAE;YACf,IAAI,EAAE,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