stitchkit 0.90.0 → 0.90.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 (46) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/agent-runtime/coding-tool-refusals.d.ts +31 -10
  3. package/dist/agent-runtime/coding-tool-refusals.d.ts.map +1 -1
  4. package/dist/agent-runtime/spill.d.ts.map +1 -1
  5. package/dist/agent-runtime-coding-tools.js +4 -4
  6. package/dist/agent-runtime-harness.js +5 -5
  7. package/dist/agent-runtime-sandbox.js +5 -5
  8. package/dist/agent-runtime.js +17 -29
  9. package/dist/application-grammy.js +1 -1
  10. package/dist/application.js +2 -2
  11. package/dist/cli.js +7 -7
  12. package/dist/contract/errors.d.ts +3 -0
  13. package/dist/contract/errors.d.ts.map +1 -1
  14. package/dist/contract/index.js +2 -2
  15. package/dist/{index-qmgs7y68.js → index-1txvygak.js} +1 -1
  16. package/dist/{index-8c3a7m4g.js → index-2hrfpw2c.js} +1 -1
  17. package/dist/{index-7evdsyez.js → index-2hryh65w.js} +1 -1
  18. package/dist/{index-zyvby92n.js → index-44ht2790.js} +2 -2
  19. package/dist/{index-27gm3d6g.js → index-6q3zjwaz.js} +2 -2
  20. package/dist/{index-mnm4qp0p.js → index-79hb1wyh.js} +3 -3
  21. package/dist/{index-apn8repm.js → index-7gqx71yd.js} +2 -2
  22. package/dist/{index-7601qfg1.js → index-8dph3pw6.js} +4 -4
  23. package/dist/{index-90d7h2cr.js → index-bg8ypxzn.js} +3 -3
  24. package/dist/{index-vchzar7e.js → index-db51n3xr.js} +5 -5
  25. package/dist/{index-hw2chdvy.js → index-f475yj00.js} +1 -1
  26. package/dist/{index-q3ve2d1k.js → index-gbqjt8jz.js} +3 -3
  27. package/dist/index-gte38nbm.js +101 -0
  28. package/dist/{index-cp20z0n6.js → index-j7q0xj6d.js} +7 -55
  29. package/dist/{index-2bxcmqkb.js → index-kazec06k.js} +1 -1
  30. package/dist/{index-0w9abg87.js → index-scs3f1eg.js} +3 -0
  31. package/dist/{index-31jw8fjq.js → index-wb15909q.js} +1 -1
  32. package/dist/{index-p18f59zy.js → index-z78bjcxj.js} +1 -1
  33. package/dist/{index-t7fkyxcr.js → index-zkcqhxx8.js} +1 -1
  34. package/dist/index.js +6 -6
  35. package/dist/node.js +6 -6
  36. package/dist/observability/index.js +3 -3
  37. package/dist/primitives.js +2 -2
  38. package/dist/remote.js +5 -5
  39. package/dist/server/index.js +8 -8
  40. package/dist/testing.js +6 -6
  41. package/dist/tool-invoker.js +6 -6
  42. package/dist/tools.js +11 -11
  43. package/dist/tracking.js +2 -2
  44. package/llms-full.txt +13 -3
  45. package/package.json +1 -1
  46. package/dist/index-gskm1k5a.js +0 -50
@@ -0,0 +1,101 @@
1
+ import {
2
+ AppError,
3
+ STITCH_ERROR_STATUS
4
+ } from "./index-scs3f1eg.js";
5
+
6
+ // src/agent-runtime/sandbox.ts
7
+ import { z } from "zod";
8
+ var AgentSandboxRestrictionSchema = z.enum([
9
+ "network-denied",
10
+ "write-contained",
11
+ "secrets-hidden",
12
+ "process-contained"
13
+ ]);
14
+ var AgentSandboxGradeSchema = z.discriminatedUnion("grade", [
15
+ z.object({ grade: z.literal("full"), restrictions: z.array(AgentSandboxRestrictionSchema) }).strict(),
16
+ z.object({
17
+ grade: z.literal("partial"),
18
+ restrictions: z.array(AgentSandboxRestrictionSchema),
19
+ gaps: z.array(AgentSandboxRestrictionSchema)
20
+ }).strict(),
21
+ z.object({ grade: z.literal("unavailable"), reason: z.string().min(1) }).strict()
22
+ ]);
23
+ var probes = new WeakMap;
24
+ function probeAgentProcessSandbox(sandbox, options = {}) {
25
+ if (options.refresh)
26
+ probes.delete(sandbox);
27
+ const present = probes.get(sandbox);
28
+ if (present)
29
+ return present;
30
+ const pending = Promise.resolve(sandbox.probe()).then((grade) => AgentSandboxGradeSchema.parse(grade));
31
+ probes.set(sandbox, pending);
32
+ return pending;
33
+ }
34
+ function missingSandboxRestrictions(grade, required) {
35
+ if (grade.grade === "unavailable")
36
+ return required;
37
+ const present = new Set(grade.restrictions);
38
+ return required.filter((restriction) => !present.has(restriction));
39
+ }
40
+ async function recordAgentSandboxProbe(input) {
41
+ const grade = await probeAgentProcessSandbox(input.sandbox);
42
+ const missing = missingSandboxRestrictions(grade, input.required);
43
+ await input.store.appendEvent({
44
+ conversationId: input.conversationId,
45
+ kind: "sandbox/probed",
46
+ payload: {
47
+ result: grade,
48
+ required: [...input.required],
49
+ missing: [...missing]
50
+ }
51
+ });
52
+ return grade;
53
+ }
54
+
55
+ // src/agent-runtime/coding-tool-refusals.ts
56
+ function codingRefusal(code, message, options = {}) {
57
+ throw new AppError(code, message, STITCH_ERROR_STATUS[code], { message, ...options.details }, options.hint);
58
+ }
59
+ function codingPathRefusal(code, message, path, options = {}) {
60
+ codingRefusal(code, message, {
61
+ details: { path, ...options.details },
62
+ ...options.hint && { hint: options.hint }
63
+ });
64
+ }
65
+ function refuseMissingCodingPath(error, relative) {
66
+ const code = error?.code;
67
+ if (error instanceof Error && error.message.includes("is not a regular file")) {
68
+ codingPathRefusal("BAD_REQUEST", "This path is not a regular file", relative, {
69
+ hint: "Use list_directory to see what is here."
70
+ });
71
+ }
72
+ if (code === "ENOENT") {
73
+ codingPathRefusal("NOT_FOUND", "This path does not exist", relative, {
74
+ hint: "Use list_directory or glob to find the right path."
75
+ });
76
+ }
77
+ if (code === "ENOTDIR") {
78
+ codingPathRefusal("BAD_REQUEST", "A segment of this path is not a directory", relative, {
79
+ hint: "Check the path with list_directory."
80
+ });
81
+ }
82
+ if (code === "ELOOP") {
83
+ codingPathRefusal("FORBIDDEN", "This path is a symlink, which is not followed", relative, {
84
+ hint: "Read or write the target directly, by its own workspace-relative path."
85
+ });
86
+ }
87
+ if (code === "EISDIR") {
88
+ codingPathRefusal("BAD_REQUEST", "This path is not a regular file", relative, {
89
+ hint: "Use list_directory to see what is here."
90
+ });
91
+ }
92
+ throw error;
93
+ }
94
+ function refuseUnknownSpillReference(reference) {
95
+ codingRefusal("SPILL_REFERENCE_UNKNOWN", `No spilled output is held under \`${reference}\``, {
96
+ details: { reference },
97
+ hint: "Use the reference returned by the command that spilled its output, not a session or call id."
98
+ });
99
+ }
100
+
101
+ export { AgentSandboxRestrictionSchema, AgentSandboxGradeSchema, probeAgentProcessSandbox, missingSandboxRestrictions, recordAgentSandboxProbe, codingRefusal, codingPathRefusal, refuseMissingCodingPath, refuseUnknownSpillReference };
@@ -12,14 +12,16 @@ import {
12
12
  writeContainedFile
13
13
  } from "./index-bn2cjajt.js";
14
14
  import {
15
+ codingPathRefusal,
16
+ codingRefusal,
15
17
  missingSandboxRestrictions,
16
- probeAgentProcessSandbox
17
- } from "./index-gskm1k5a.js";
18
+ probeAgentProcessSandbox,
19
+ refuseMissingCodingPath
20
+ } from "./index-gte38nbm.js";
18
21
  import {
19
- AppError,
20
22
  conflict,
21
23
  forbidden
22
- } from "./index-0w9abg87.js";
24
+ } from "./index-scs3f1eg.js";
23
25
  import {
24
26
  defineRuntimeTool
25
27
  } from "./index-kc6h6hg0.js";
@@ -178,56 +180,6 @@ import { realpath as realpath2 } from "node:fs/promises";
178
180
  // src/agent-runtime/coding-tool-paths.ts
179
181
  import { lstat, realpath } from "node:fs/promises";
180
182
  import path from "node:path";
181
-
182
- // src/agent-runtime/coding-tool-refusals.ts
183
- var REFUSAL_STATUS = {
184
- BAD_REQUEST: 400,
185
- FORBIDDEN: 403,
186
- NOT_FOUND: 404,
187
- CONFLICT: 409,
188
- SANDBOX_UNAVAILABLE: 503,
189
- SANDBOX_INSUFFICIENT: 503
190
- };
191
- function codingRefusal(code, message, options = {}) {
192
- throw new AppError(code, message, REFUSAL_STATUS[code], { message, ...options.details }, options.hint);
193
- }
194
- function codingPathRefusal(code, message, path, options = {}) {
195
- codingRefusal(code, message, {
196
- details: { path, ...options.details },
197
- ...options.hint && { hint: options.hint }
198
- });
199
- }
200
- function refuseMissingCodingPath(error, relative) {
201
- const code = error?.code;
202
- if (error instanceof Error && error.message.includes("is not a regular file")) {
203
- codingPathRefusal("BAD_REQUEST", "This path is not a regular file", relative, {
204
- hint: "Use list_directory to see what is here."
205
- });
206
- }
207
- if (code === "ENOENT") {
208
- codingPathRefusal("NOT_FOUND", "This path does not exist", relative, {
209
- hint: "Use list_directory or glob to find the right path."
210
- });
211
- }
212
- if (code === "ENOTDIR") {
213
- codingPathRefusal("BAD_REQUEST", "A segment of this path is not a directory", relative, {
214
- hint: "Check the path with list_directory."
215
- });
216
- }
217
- if (code === "ELOOP") {
218
- codingPathRefusal("FORBIDDEN", "This path is a symlink, which is not followed", relative, {
219
- hint: "Read or write the target directly, by its own workspace-relative path."
220
- });
221
- }
222
- if (code === "EISDIR") {
223
- codingPathRefusal("BAD_REQUEST", "This path is not a regular file", relative, {
224
- hint: "Use list_directory to see what is here."
225
- });
226
- }
227
- throw error;
228
- }
229
-
230
- // src/agent-runtime/coding-tool-paths.ts
231
183
  function within(root, target) {
232
184
  const relative = path.relative(root, target);
233
185
  return relative === "" || !relative.startsWith(`..${path.sep}`) && relative !== ".." && !path.isAbsolute(relative);
@@ -1348,4 +1300,4 @@ function createAgentCodingTools(config) {
1348
1300
  ];
1349
1301
  }
1350
1302
 
1351
- export { codingRefusal, AgentCodingToolLimitsSchema, AgentCodingToolAuthorizationSchema, AgentCodingToolPathAuthorizationSchema, createAgentCodingTools };
1303
+ export { AgentCodingToolLimitsSchema, AgentCodingToolAuthorizationSchema, AgentCodingToolPathAuthorizationSchema, createAgentCodingTools };
@@ -2,7 +2,7 @@ import {
2
2
  AppError,
3
3
  STITCH_ERROR_STATUS,
4
4
  isStitchErrorCode
5
- } from "./index-0w9abg87.js";
5
+ } from "./index-scs3f1eg.js";
6
6
  import {
7
7
  isUnsafeKey
8
8
  } from "./index-kzfs85xp.js";
@@ -77,6 +77,9 @@ var STITCH_ERROR_STATUS = {
77
77
  STREAM_FRAME_TOO_LARGE: 500,
78
78
  STREAM_TERMINAL_MISSING: 500,
79
79
  STREAM_LIFETIME_EXCEEDED: 408,
80
+ SANDBOX_UNAVAILABLE: 503,
81
+ SANDBOX_INSUFFICIENT: 503,
82
+ SPILL_REFERENCE_UNKNOWN: 404,
80
83
  INTERNAL_SERVER_ERROR: 500
81
84
  };
82
85
  function isStitchErrorCode(code) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  contractToolMountable
3
- } from "./index-8c3a7m4g.js";
3
+ } from "./index-2hrfpw2c.js";
4
4
  import {
5
5
  runtimeToolMountable
6
6
  } from "./index-kc6h6hg0.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  mergeMeta,
3
3
  resolveRouteParamsSchema
4
- } from "./index-2bxcmqkb.js";
4
+ } from "./index-kazec06k.js";
5
5
  import {
6
6
  isUnsafeKey
7
7
  } from "./index-kzfs85xp.js";
@@ -11,7 +11,7 @@ import {
11
11
  } from "./index-3z73fh2c.js";
12
12
  import {
13
13
  AppError
14
- } from "./index-0w9abg87.js";
14
+ } from "./index-scs3f1eg.js";
15
15
 
16
16
  // src/application/kernel.ts
17
17
  import { z } from "zod";
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  createUrlBuilder,
16
16
  createUrlBuilders,
17
17
  parseNDJSON
18
- } from "./index-27gm3d6g.js";
18
+ } from "./index-6q3zjwaz.js";
19
19
  import {
20
20
  REALTIME_REJECTION_KEY,
21
21
  asRealtimeRejection,
@@ -23,7 +23,7 @@ import {
23
23
  isModuleNotFound,
24
24
  parseRealtimeRequestAcknowledgement,
25
25
  parseRealtimeRequestArguments
26
- } from "./index-apn8repm.js";
26
+ } from "./index-7gqx71yd.js";
27
27
  import {
28
28
  RealtimeRequestDisconnectedError,
29
29
  RealtimeRequestInvalidAcknowledgementError,
@@ -34,7 +34,7 @@ import {
34
34
  } from "./index-2qzskm8h.js";
35
35
  import {
36
36
  parseSSE
37
- } from "./index-qmgs7y68.js";
37
+ } from "./index-1txvygak.js";
38
38
  import {
39
39
  LiveStateControllerStatusSchema,
40
40
  LiveStatePhaseSchema,
@@ -49,7 +49,7 @@ import {
49
49
  import {
50
50
  formatZodError,
51
51
  zodIssues
52
- } from "./index-7evdsyez.js";
52
+ } from "./index-2hryh65w.js";
53
53
  import {
54
54
  ALL_TRANSPORTS,
55
55
  ContractStreamFrameSchema,
@@ -60,7 +60,7 @@ import {
60
60
  defineErrors,
61
61
  encodeCursor,
62
62
  paginatedSchema
63
- } from "./index-2bxcmqkb.js";
63
+ } from "./index-kazec06k.js";
64
64
  import {
65
65
  ManagedFilePathSchema,
66
66
  ManagedFileRefSchema
@@ -76,7 +76,7 @@ import {
76
76
  notFound,
77
77
  rateLimited,
78
78
  unauthorized
79
- } from "./index-0w9abg87.js";
79
+ } from "./index-scs3f1eg.js";
80
80
  import {
81
81
  childSpan,
82
82
  createTraceContext,
package/dist/node.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  createHandler,
6
6
  createSocketIOServer,
7
7
  createUnixClientTransport
8
- } from "./index-vchzar7e.js";
8
+ } from "./index-db51n3xr.js";
9
9
  import"./index-y91ry9h2.js";
10
10
  import {
11
11
  ShutdownOptionsSchema,
@@ -14,7 +14,7 @@ import {
14
14
  ShutdownStatusSchema,
15
15
  createServerLifecycle
16
16
  } from "./index-3z73fh2c.js";
17
- import"./index-apn8repm.js";
17
+ import"./index-7gqx71yd.js";
18
18
  import"./index-2qzskm8h.js";
19
19
  import {
20
20
  createImplement,
@@ -24,11 +24,11 @@ import {
24
24
  createScopedImplementRegistry,
25
25
  implement,
26
26
  implementRegistry
27
- } from "./index-p18f59zy.js";
27
+ } from "./index-z78bjcxj.js";
28
28
  import"./index-vsbzgd7b.js";
29
29
  import"./index-f9mb610r.js";
30
- import"./index-7evdsyez.js";
31
- import"./index-2bxcmqkb.js";
30
+ import"./index-2hryh65w.js";
31
+ import"./index-kazec06k.js";
32
32
  import"./index-6k1937bx.js";
33
33
  import {
34
34
  AppError,
@@ -39,7 +39,7 @@ import {
39
39
  notFound,
40
40
  rateLimited,
41
41
  unauthorized
42
- } from "./index-0w9abg87.js";
42
+ } from "./index-scs3f1eg.js";
43
43
  import"./index-zcgf3gqf.js";
44
44
  import"./index-kzfs85xp.js";
45
45
  import"./index-77fekveh.js";
@@ -27,10 +27,10 @@ import {
27
27
  import"../index-f9mb610r.js";
28
28
  import {
29
29
  recordedErrorMessage
30
- } from "../index-7evdsyez.js";
31
- import"../index-2bxcmqkb.js";
30
+ } from "../index-2hryh65w.js";
31
+ import"../index-kazec06k.js";
32
32
  import"../index-6k1937bx.js";
33
- import"../index-0w9abg87.js";
33
+ import"../index-scs3f1eg.js";
34
34
  import {
35
35
  childSpan,
36
36
  createTraceContext,
@@ -1,8 +1,8 @@
1
- import"./index-2bxcmqkb.js";
1
+ import"./index-kazec06k.js";
2
2
  import {
3
3
  ManagedFileRefSchema
4
4
  } from "./index-6k1937bx.js";
5
- import"./index-0w9abg87.js";
5
+ import"./index-scs3f1eg.js";
6
6
  import"./index-kzfs85xp.js";
7
7
  import"./index-77fekveh.js";
8
8
 
package/dist/remote.js CHANGED
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  createClient
3
- } from "./index-27gm3d6g.js";
4
- import"./index-qmgs7y68.js";
3
+ } from "./index-6q3zjwaz.js";
4
+ import"./index-1txvygak.js";
5
5
  import {
6
6
  ApiError
7
7
  } from "./index-3xwxfj4z.js";
8
- import"./index-7evdsyez.js";
8
+ import"./index-2hryh65w.js";
9
9
  import {
10
10
  mergeMeta,
11
11
  resolveRouteParamsSchema
12
- } from "./index-2bxcmqkb.js";
12
+ } from "./index-kazec06k.js";
13
13
  import"./index-6k1937bx.js";
14
14
  import {
15
15
  AppError
16
- } from "./index-0w9abg87.js";
16
+ } from "./index-scs3f1eg.js";
17
17
  import"./index-zcgf3gqf.js";
18
18
  import"./index-kzfs85xp.js";
19
19
  import {
@@ -13,7 +13,7 @@ import {
13
13
  sseRoute,
14
14
  streamingRoute,
15
15
  webSocketLane
16
- } from "../index-vchzar7e.js";
16
+ } from "../index-db51n3xr.js";
17
17
  import"../index-y91ry9h2.js";
18
18
  import {
19
19
  withDeadline
@@ -25,13 +25,13 @@ import {
25
25
  ShutdownStatusSchema,
26
26
  createServerLifecycle
27
27
  } from "../index-3z73fh2c.js";
28
- import"../index-apn8repm.js";
28
+ import"../index-7gqx71yd.js";
29
29
  import"../index-2qzskm8h.js";
30
30
  import {
31
31
  inputIsQuery,
32
32
  parseSSE,
33
33
  streamSSE
34
- } from "../index-qmgs7y68.js";
34
+ } from "../index-1txvygak.js";
35
35
  import {
36
36
  composeAuthHooks,
37
37
  createAuthHook,
@@ -45,7 +45,7 @@ import {
45
45
  signJwt,
46
46
  verifyJwt,
47
47
  verifyPkce
48
- } from "../index-90d7h2cr.js";
48
+ } from "../index-bg8ypxzn.js";
49
49
  import {
50
50
  DEFAULT_CORS_ALLOW_HEADERS,
51
51
  DEFAULT_CORS_EXPOSE_HEADERS,
@@ -59,7 +59,7 @@ import {
59
59
  defineMultipartStream,
60
60
  implement,
61
61
  implementRegistry
62
- } from "../index-p18f59zy.js";
62
+ } from "../index-z78bjcxj.js";
63
63
  import {
64
64
  isWithinDir,
65
65
  realPathWithinDir
@@ -80,12 +80,12 @@ import {
80
80
  formatZodError,
81
81
  normalizeError,
82
82
  zodIssues
83
- } from "../index-7evdsyez.js";
83
+ } from "../index-2hryh65w.js";
84
84
  import {
85
85
  DEFAULT_CONTRACT_STREAM_FRAME_BYTES,
86
86
  joinRoutePath,
87
87
  parseTrailingWildcard
88
- } from "../index-2bxcmqkb.js";
88
+ } from "../index-kazec06k.js";
89
89
  import"../index-6k1937bx.js";
90
90
  import {
91
91
  AppError,
@@ -98,7 +98,7 @@ import {
98
98
  notFound,
99
99
  rateLimited,
100
100
  unauthorized
101
- } from "../index-0w9abg87.js";
101
+ } from "../index-scs3f1eg.js";
102
102
  import"../index-zcgf3gqf.js";
103
103
  import"../index-kzfs85xp.js";
104
104
  import {
package/dist/testing.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createApplication
3
- } from "./index-t7fkyxcr.js";
3
+ } from "./index-zkcqhxx8.js";
4
4
  import"./index-3gye9wzb.js";
5
5
  import"./index-2k4yrqkc.js";
6
6
  import"./index-3z73fh2c.js";
@@ -28,20 +28,20 @@ import {
28
28
  import {
29
29
  createClient,
30
30
  createClients
31
- } from "./index-27gm3d6g.js";
31
+ } from "./index-6q3zjwaz.js";
32
32
  import {
33
33
  RealtimeRequestDisconnectedError,
34
34
  RealtimeRequestInvalidAcknowledgementError,
35
35
  RealtimeRequestTimeoutError
36
36
  } from "./index-2qzskm8h.js";
37
- import"./index-qmgs7y68.js";
37
+ import"./index-1txvygak.js";
38
38
  import"./index-3xwxfj4z.js";
39
- import"./index-7evdsyez.js";
39
+ import"./index-2hryh65w.js";
40
40
  import {
41
41
  joinRoutePath
42
- } from "./index-2bxcmqkb.js";
42
+ } from "./index-kazec06k.js";
43
43
  import"./index-6k1937bx.js";
44
- import"./index-0w9abg87.js";
44
+ import"./index-scs3f1eg.js";
45
45
  import"./index-zcgf3gqf.js";
46
46
  import"./index-kzfs85xp.js";
47
47
  import {
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  createToolInvoker
3
- } from "./index-mnm4qp0p.js";
4
- import"./index-8c3a7m4g.js";
5
- import"./index-zyvby92n.js";
3
+ } from "./index-79hb1wyh.js";
4
+ import"./index-2hrfpw2c.js";
5
+ import"./index-44ht2790.js";
6
6
  import"./index-vsbzgd7b.js";
7
7
  import"./index-f9mb610r.js";
8
- import"./index-7evdsyez.js";
9
- import"./index-2bxcmqkb.js";
8
+ import"./index-2hryh65w.js";
9
+ import"./index-kazec06k.js";
10
10
  import"./index-6k1937bx.js";
11
- import"./index-0w9abg87.js";
11
+ import"./index-scs3f1eg.js";
12
12
  import"./index-zcgf3gqf.js";
13
13
  import"./index-7zbps32p.js";
14
14
  import"./index-kzfs85xp.js";
package/dist/tools.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  signJwt,
6
6
  verifyPkce
7
- } from "./index-90d7h2cr.js";
7
+ } from "./index-bg8ypxzn.js";
8
8
  import {
9
9
  DEFAULT_CORS_ALLOW_HEADERS,
10
10
  DEFAULT_PROCESS_SIGNALS,
@@ -13,7 +13,7 @@ import {
13
13
  guardSignalCallback,
14
14
  mediaTypeEssence,
15
15
  reportSignalError
16
- } from "./index-p18f59zy.js";
16
+ } from "./index-z78bjcxj.js";
17
17
  import {
18
18
  redact
19
19
  } from "./index-xbppf54a.js";
@@ -21,7 +21,7 @@ import {
21
21
  buildToolManifest,
22
22
  describeToolCatalog,
23
23
  mountAgent
24
- } from "./index-q3ve2d1k.js";
24
+ } from "./index-gbqjt8jz.js";
25
25
  import"./index-7rkhw9ec.js";
26
26
  import {
27
27
  argumentsDigest
@@ -37,7 +37,7 @@ import {
37
37
  } from "./index-4fpa9dy2.js";
38
38
  import {
39
39
  createToolInvoker
40
- } from "./index-mnm4qp0p.js";
40
+ } from "./index-79hb1wyh.js";
41
41
  import {
42
42
  WaitTimeoutError,
43
43
  createCli,
@@ -46,22 +46,22 @@ import {
46
46
  fetchPinnedDocument,
47
47
  readCapped,
48
48
  runWaitOperation
49
- } from "./index-7601qfg1.js";
49
+ } from "./index-8dph3pw6.js";
50
50
  import"./index-sbdmyz75.js";
51
51
  import {
52
52
  collectToolSurface
53
- } from "./index-31jw8fjq.js";
53
+ } from "./index-wb15909q.js";
54
54
  import {
55
55
  collectTools,
56
56
  createToolRunner,
57
57
  formatToolError
58
- } from "./index-8c3a7m4g.js";
58
+ } from "./index-2hrfpw2c.js";
59
59
  import {
60
60
  ToolExecutionControlError,
61
61
  executeToolMethod,
62
62
  isToolExecutionControlError,
63
63
  toolResultFromError
64
- } from "./index-zyvby92n.js";
64
+ } from "./index-44ht2790.js";
65
65
  import {
66
66
  getRequestContext,
67
67
  getTraceId,
@@ -70,10 +70,10 @@ import {
70
70
  import"./index-f9mb610r.js";
71
71
  import {
72
72
  normalizeError
73
- } from "./index-7evdsyez.js";
73
+ } from "./index-2hryh65w.js";
74
74
  import {
75
75
  defineContract
76
- } from "./index-2bxcmqkb.js";
76
+ } from "./index-kazec06k.js";
77
77
  import {
78
78
  ManagedFilePathSchema,
79
79
  ManagedFileRefSchema
@@ -81,7 +81,7 @@ import {
81
81
  import {
82
82
  AppError,
83
83
  STITCH_ERROR_STATUS
84
- } from "./index-0w9abg87.js";
84
+ } from "./index-scs3f1eg.js";
85
85
  import {
86
86
  resolvePropagationContext
87
87
  } from "./index-zcgf3gqf.js";
package/dist/tracking.js CHANGED
@@ -3,9 +3,9 @@ import {
3
3
  } from "./index-3xwxfj4z.js";
4
4
  import {
5
5
  defineContract
6
- } from "./index-2bxcmqkb.js";
6
+ } from "./index-kazec06k.js";
7
7
  import"./index-6k1937bx.js";
8
- import"./index-0w9abg87.js";
8
+ import"./index-scs3f1eg.js";
9
9
  import"./index-zcgf3gqf.js";
10
10
  import"./index-kzfs85xp.js";
11
11
  import"./index-77fekveh.js";
package/llms-full.txt CHANGED
@@ -4765,8 +4765,11 @@ authorization payload, so no directory is created before a host approves it.
4765
4765
 
4766
4766
  **Every ordinary outcome is a refusal a model can act on** — a missing file is `NOT_FOUND`, an
4767
4767
  existing file without `overwrite` is `CONFLICT`, an ambiguous snippet is `CONFLICT` carrying its
4768
- occurrence count, a path outside the root is `FORBIDDEN` each with a `hint` naming the next move.
4768
+ occurrence count, a path outside the root is `FORBIDDEN`, an unknown spilled-output reference is
4769
+ `SPILL_REFERENCE_UNKNOWN` — each with a `hint` naming the next move.
4769
4770
  Host-level causes stay scrubbed to `INTERNAL_SERVER_ERROR` and name nothing outside the workspace.
4771
+ Every refusal code is a member of `STITCH_ERROR_STATUS`, so its status survives an envelope that
4772
+ crosses a process boundary and is rebuilt from the wire.
4770
4773
  → ADR 0139
4771
4774
 
4772
4775
  `list_directory` marks excluded directories rather than hiding them, and `glob` reports
@@ -5032,7 +5035,11 @@ chat messages.
5032
5035
  `createSqliteAgentSpillStore` persists oversized output separately and records
5033
5036
  its locator, hash and lifecycle in the ledger. `read_output` and
5034
5037
  `search_output` re-run both locator authorization and the originating tool
5035
- authorization before reading bytes. `createSqliteAgentEventSearch` returns the
5038
+ authorization before reading bytes. A reference the store does not hold is a
5039
+ refusal like any other — `SPILL_REFERENCE_UNKNOWN` / 404, naming the reference
5040
+ and pointing at the one the spilling command returned. The lookup is scoped by
5041
+ conversation, so a reference belonging to another conversation is absent rather
5042
+ than forbidden, and the refusal cannot tell a model that it exists elsewhere. `createSqliteAgentEventSearch` returns the
5036
5043
  exact conversation and event sequence; cross-conversation results are denied
5037
5044
  unless `authorizeConversation` approves each target.
5038
5045
  `createAgentEventSearchTools` supplies `session_search`, `session_trace` and
@@ -9531,7 +9538,10 @@ core never models them (ADR 0002). But stitchkit itself emits a set of its own:
9531
9538
  `FILE_INSPECTION_REJECTED`, `FILE_TOO_LARGE`, `FILE_EXISTS`,
9532
9539
  `REALTIME_CONTRACT_VIOLATION`, `APPLICATION_NOT_ACCEPTING`, `WAIT_TIMEOUT`,
9533
9540
  `WAIT_FAILED`, `DOWNLOAD_NOT_FOUND`, `VIEW_HTTP_ERROR`,
9534
- `OPERATION_NOT_SUCCEEDED`, `INTERNAL_SERVER_ERROR` — a set that grows in
9541
+ `OPERATION_NOT_SUCCEEDED`, `STREAM_ITEM_INVALID`, `STREAM_FRAME_TOO_LARGE`,
9542
+ `STREAM_TERMINAL_MISSING`, `STREAM_LIFETIME_EXCEEDED`,
9543
+ `GRAMMY_WEBHOOK_NOT_ACCEPTING`, `SANDBOX_UNAVAILABLE`, `SANDBOX_INSUFFICIENT`,
9544
+ `SPILL_REFERENCE_UNKNOWN`, `INTERNAL_SERVER_ERROR` — a set that grows in
9535
9545
  ordinary releases, each addition named in the changelog. They are
9536
9546
  published as **`STITCH_ERROR_STATUS`** (the `code → status` map) and
9537
9547
  **`StitchErrorCode`** (its `keyof`), with **`isStitchErrorCode()`** (→ ADR 0026).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stitchkit",
3
- "version": "0.90.0",
3
+ "version": "0.90.1",
4
4
  "description": "Contract-first backend framework — one defineContract() into an HTTP API, MCP tools, AI-agent tools and a typed client. Bun and Node.",
5
5
  "keywords": [
6
6
  "bun",