stitchkit 0.74.1 → 0.75.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 (75) hide show
  1. package/dist/agent-runtime/sqlite-purge.d.ts +3 -3
  2. package/dist/agent-runtime/sqlite-purge.d.ts.map +1 -1
  3. package/dist/agent-runtime/sqlite.d.ts +5 -17
  4. package/dist/agent-runtime/sqlite.d.ts.map +1 -1
  5. package/dist/agent-runtime-coding-tools.js +2 -1
  6. package/dist/agent-runtime-harness.js +5 -4
  7. package/dist/agent-runtime-sqlite-bun.d.ts +1 -1
  8. package/dist/agent-runtime-sqlite-bun.d.ts.map +1 -1
  9. package/dist/agent-runtime-sqlite-node.d.ts +1 -1
  10. package/dist/agent-runtime-sqlite-node.d.ts.map +1 -1
  11. package/dist/agent-runtime.js +8 -7
  12. package/dist/application/keyspace-sqlite.d.ts +31 -0
  13. package/dist/application/keyspace-sqlite.d.ts.map +1 -0
  14. package/dist/application/keyspace.d.ts +142 -0
  15. package/dist/application/keyspace.d.ts.map +1 -0
  16. package/dist/application/watch-hub.d.ts +125 -0
  17. package/dist/application/watch-hub.d.ts.map +1 -0
  18. package/dist/application.d.ts +4 -0
  19. package/dist/application.d.ts.map +1 -1
  20. package/dist/application.js +455 -0
  21. package/dist/cli.js +7 -6
  22. package/dist/contract/index.js +2 -1
  23. package/dist/{index-aczggrty.js → index-28jsdwt1.js} +1 -1
  24. package/dist/index-35z5h2ty.js +594 -0
  25. package/dist/{index-f6n5n7nz.js → index-4kp4fxvp.js} +4 -18
  26. package/dist/{index-118v0z41.js → index-52400rdd.js} +8 -3
  27. package/dist/{index-da1aqnhb.js → index-65kathdm.js} +6 -4
  28. package/dist/{index-jqtsc9mj.js → index-6wr9f6qm.js} +2 -2
  29. package/dist/{index-7qy2ex0m.js → index-885chjxq.js} +1 -1
  30. package/dist/{index-k2zczx1g.js → index-9c5dbr5q.js} +1 -1
  31. package/dist/{index-s2rchahr.js → index-9my2n66s.js} +4 -4
  32. package/dist/{index-nemjkxjp.js → index-e0a57ymn.js} +1 -1
  33. package/dist/{index-vbf2p6me.js → index-endzd8sj.js} +1 -1
  34. package/dist/{index-vj3vvpaa.js → index-hsz2mmk0.js} +1 -17
  35. package/dist/{index-s4c8wy8m.js → index-k68e5jz0.js} +2 -2
  36. package/dist/index-rxfy4cq7.js +17 -0
  37. package/dist/{index-58jzmnn4.js → index-v5dm4bwq.js} +1 -1
  38. package/dist/{index-m668wzyc.js → index-v7xjfy10.js} +1 -1
  39. package/dist/index-vdvmcy7r.js +22 -0
  40. package/dist/{index-ezmn6ac6.js → index-xgahrwdf.js} +3 -3
  41. package/dist/index.js +26 -611
  42. package/dist/internal/sqlite.d.ts +27 -0
  43. package/dist/internal/sqlite.d.ts.map +1 -0
  44. package/dist/internal/stable-digest.d.ts +24 -0
  45. package/dist/internal/stable-digest.d.ts.map +1 -0
  46. package/dist/live/events.d.ts +155 -0
  47. package/dist/live/events.d.ts.map +1 -0
  48. package/dist/live/watch-client.d.ts +66 -0
  49. package/dist/live/watch-client.d.ts.map +1 -0
  50. package/dist/live/watch-contract.d.ts +157 -0
  51. package/dist/live/watch-contract.d.ts.map +1 -0
  52. package/dist/live.d.ts +18 -0
  53. package/dist/live.d.ts.map +1 -0
  54. package/dist/live.js +284 -0
  55. package/dist/node.js +5 -4
  56. package/dist/observability/index.js +4 -3
  57. package/dist/primitives.js +2 -1
  58. package/dist/remote.js +3 -2
  59. package/dist/server/create.d.ts.map +1 -1
  60. package/dist/server/event-bus.d.ts +49 -1
  61. package/dist/server/event-bus.d.ts.map +1 -1
  62. package/dist/server/index.d.ts +2 -1
  63. package/dist/server/index.d.ts.map +1 -1
  64. package/dist/server/index.js +224 -12
  65. package/dist/server/middleware/trust-fence.d.ts +116 -0
  66. package/dist/server/middleware/trust-fence.d.ts.map +1 -0
  67. package/dist/server/types.d.ts +16 -1
  68. package/dist/server/types.d.ts.map +1 -1
  69. package/dist/testing.js +3 -2
  70. package/dist/tool-invoker.js +6 -5
  71. package/dist/tools/mcp-round.d.ts.map +1 -1
  72. package/dist/tools.js +15 -30
  73. package/llms-full.txt +426 -4
  74. package/llms.txt +1 -0
  75. package/package.json +6 -2
@@ -3,7 +3,7 @@ import {
3
3
  } from "./index-wwst0td5.js";
4
4
  import {
5
5
  contractToolMountable
6
- } from "./index-7qy2ex0m.js";
6
+ } from "./index-885chjxq.js";
7
7
  import {
8
8
  projectToolSurface
9
9
  } from "./index-22by16v6.js";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  collectToolSurface
3
- } from "./index-k2zczx1g.js";
3
+ } from "./index-9c5dbr5q.js";
4
4
  import {
5
5
  createToolRunner,
6
6
  formatToolError
7
- } from "./index-7qy2ex0m.js";
7
+ } from "./index-885chjxq.js";
8
8
  import {
9
9
  coerceJsonArgs,
10
10
  toolResultFromError
11
- } from "./index-s4c8wy8m.js";
11
+ } from "./index-k68e5jz0.js";
12
12
  import {
13
13
  isWithinDir
14
14
  } from "./index-sbdmyz75.js";
@@ -27,7 +27,7 @@ import {
27
27
  import {
28
28
  isUnsafeKey,
29
29
  safeJsonParse
30
- } from "./index-vj3vvpaa.js";
30
+ } from "./index-hsz2mmk0.js";
31
31
  import {
32
32
  isRecord
33
33
  } from "./index-qyrqwr4c.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./index-nt1mp8km.js";
4
4
  import {
5
5
  isUnsafeKey
6
- } from "./index-vj3vvpaa.js";
6
+ } from "./index-hsz2mmk0.js";
7
7
  import {
8
8
  isRecord
9
9
  } from "./index-qyrqwr4c.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  isUnsafeKey,
3
3
  mergeMeta
4
- } from "./index-vj3vvpaa.js";
4
+ } from "./index-hsz2mmk0.js";
5
5
  import {
6
6
  callRuntimeHandler,
7
7
  isRecord,
@@ -272,22 +272,6 @@ function mergeMeta(contractMeta, endpointMeta) {
272
272
  import { z as z2 } from "zod";
273
273
  // src/contract/pagination.ts
274
274
  import { z as z3 } from "zod";
275
-
276
- // src/internal/base64url.ts
277
- function bytesToBase64Url(bytes) {
278
- let binary = "";
279
- for (const byte of bytes)
280
- binary += String.fromCharCode(byte);
281
- return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
282
- }
283
- function base64UrlToBytes(segment) {
284
- if (!/^[A-Za-z0-9_-]*$/.test(segment) || segment.length % 4 === 1) {
285
- throw new Error("invalid base64url segment");
286
- }
287
- const b64 = segment.replace(/-/g, "+").replace(/_/g, "/");
288
- const padded = b64.padEnd(Math.ceil(b64.length / 4) * 4, "=");
289
- return Uint8Array.from(atob(padded), (c) => c.charCodeAt(0));
290
- }
291
275
  // src/contract/stream.ts
292
276
  import { z as z4 } from "zod";
293
277
  var DEFAULT_CONTRACT_STREAM_FRAME_BYTES = 256 * 1024;
@@ -304,4 +288,4 @@ var ContractStreamFrameSchema = z4.discriminatedUnion("type", [
304
288
  }).strict(),
305
289
  z4.object({ type: z4.literal("end") }).strict()
306
290
  ]);
307
- export { joinRoutePath, parseTrailingWildcard, isUnsafeKey, safeJsonParse, defineContract, mergeMeta, bytesToBase64Url, base64UrlToBytes, DEFAULT_CONTRACT_STREAM_FRAME_BYTES, ContractStreamFrameSchema };
291
+ export { joinRoutePath, parseTrailingWildcard, isUnsafeKey, safeJsonParse, defineContract, mergeMeta, DEFAULT_CONTRACT_STREAM_FRAME_BYTES, ContractStreamFrameSchema };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getRequestContext,
3
3
  runWithRequestContext
4
- } from "./index-nemjkxjp.js";
4
+ } from "./index-e0a57ymn.js";
5
5
  import {
6
6
  objectShapeKeys
7
7
  } from "./index-22by16v6.js";
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  isUnsafeKey,
15
15
  safeJsonParse
16
- } from "./index-vj3vvpaa.js";
16
+ } from "./index-hsz2mmk0.js";
17
17
  import {
18
18
  AppError,
19
19
  STITCH_ERROR_STATUS,
@@ -0,0 +1,17 @@
1
+ // src/internal/base64url.ts
2
+ function bytesToBase64Url(bytes) {
3
+ let binary = "";
4
+ for (const byte of bytes)
5
+ binary += String.fromCharCode(byte);
6
+ return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
7
+ }
8
+ function base64UrlToBytes(segment) {
9
+ if (!/^[A-Za-z0-9_-]*$/.test(segment) || segment.length % 4 === 1) {
10
+ throw new Error("invalid base64url segment");
11
+ }
12
+ const b64 = segment.replace(/-/g, "+").replace(/_/g, "/");
13
+ const padded = b64.padEnd(Math.ceil(b64.length / 4) * 4, "=");
14
+ return Uint8Array.from(atob(padded), (c) => c.charCodeAt(0));
15
+ }
16
+
17
+ export { bytesToBase64Url, base64UrlToBytes };
@@ -8,7 +8,7 @@ import {
8
8
  ContractStreamFrameSchema,
9
9
  DEFAULT_CONTRACT_STREAM_FRAME_BYTES,
10
10
  parseTrailingWildcard
11
- } from "./index-vj3vvpaa.js";
11
+ } from "./index-hsz2mmk0.js";
12
12
  import {
13
13
  isRecord,
14
14
  mapObject,
@@ -15,7 +15,7 @@ import {
15
15
  import {
16
16
  ToolExecutionControlError,
17
17
  isToolExecutionControlError
18
- } from "./index-s4c8wy8m.js";
18
+ } from "./index-k68e5jz0.js";
19
19
  import {
20
20
  AgentAssistantPlaceholderSchema,
21
21
  AgentJsonObjectSchema,
@@ -0,0 +1,22 @@
1
+ import {
2
+ bytesToBase64Url
3
+ } from "./index-rxfy4cq7.js";
4
+
5
+ // src/internal/stable-digest.ts
6
+ function stableValue(value) {
7
+ if (Array.isArray(value))
8
+ return value.map(stableValue);
9
+ if (value === null || typeof value !== "object")
10
+ return value;
11
+ const result = {};
12
+ for (const key of Object.keys(value).sort()) {
13
+ result[key] = stableValue(Reflect.get(value, key));
14
+ }
15
+ return result;
16
+ }
17
+ async function argumentsDigest(args) {
18
+ const bytes = new TextEncoder().encode(JSON.stringify(stableValue(args)));
19
+ return bytesToBase64Url(new Uint8Array(await crypto.subtle.digest("SHA-256", bytes)));
20
+ }
21
+
22
+ export { stableValue, argumentsDigest };
@@ -3,15 +3,15 @@ import {
3
3
  } from "./index-3xnq72rz.js";
4
4
  import {
5
5
  collectToolSurface
6
- } from "./index-k2zczx1g.js";
6
+ } from "./index-9c5dbr5q.js";
7
7
  import {
8
8
  createToolRunner,
9
9
  formatToolError
10
- } from "./index-7qy2ex0m.js";
10
+ } from "./index-885chjxq.js";
11
11
  import {
12
12
  isToolExecutionControlError,
13
13
  toolResultFromError
14
- } from "./index-s4c8wy8m.js";
14
+ } from "./index-k68e5jz0.js";
15
15
  import {
16
16
  isRecord
17
17
  } from "./index-qyrqwr4c.js";