stitchkit 0.127.0 → 0.128.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 (233) hide show
  1. package/CHANGELOG.md +137 -6
  2. package/dist/agent-executor/acp/v1-connect.d.ts +9 -1
  3. package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -1
  4. package/dist/agent-executor/acp/v1-driver.d.ts +8 -2
  5. package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -1
  6. package/dist/agent-executor/acp/v1-map.d.ts.map +1 -1
  7. package/dist/agent-executor/acp/v1-session.d.ts +8 -0
  8. package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
  9. package/dist/agent-executor/claude/cli-driver.d.ts +4 -0
  10. package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -1
  11. package/dist/agent-executor/claude/protocol.d.ts +20 -2
  12. package/dist/agent-executor/claude/protocol.d.ts.map +1 -1
  13. package/dist/agent-executor/claude/session.d.ts +2 -1
  14. package/dist/agent-executor/claude/session.d.ts.map +1 -1
  15. package/dist/agent-executor/claude/transcript.d.ts +7 -4
  16. package/dist/agent-executor/claude/transcript.d.ts.map +1 -1
  17. package/dist/agent-executor/claude-sdk/driver.d.ts +4 -0
  18. package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
  19. package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -1
  20. package/dist/agent-executor/codex/driver.d.ts +4 -0
  21. package/dist/agent-executor/codex/driver.d.ts.map +1 -1
  22. package/dist/agent-executor/codex/protocol.d.ts +26 -2
  23. package/dist/agent-executor/codex/protocol.d.ts.map +1 -1
  24. package/dist/agent-executor/codex/session.d.ts +3 -1
  25. package/dist/agent-executor/codex/session.d.ts.map +1 -1
  26. package/dist/agent-executor/image-input.d.ts +71 -0
  27. package/dist/agent-executor/image-input.d.ts.map +1 -0
  28. package/dist/agent-executor/session-primitives.d.ts +0 -3
  29. package/dist/agent-executor/session-primitives.d.ts.map +1 -1
  30. package/dist/agent-runtime/agent-tool.d.ts +21 -7
  31. package/dist/agent-runtime/agent-tool.d.ts.map +1 -1
  32. package/dist/agent-runtime/branch-contract.d.ts +1 -0
  33. package/dist/agent-runtime/branch-contract.d.ts.map +1 -1
  34. package/dist/agent-runtime/branch-identities.d.ts +5 -2
  35. package/dist/agent-runtime/branch-identities.d.ts.map +1 -1
  36. package/dist/agent-runtime/branch-messages.d.ts +9 -9
  37. package/dist/agent-runtime/branch-messages.d.ts.map +1 -1
  38. package/dist/agent-runtime/branch-observations.d.ts +45 -32
  39. package/dist/agent-runtime/branch-observations.d.ts.map +1 -1
  40. package/dist/agent-runtime/branch-provider.d.ts +12 -6
  41. package/dist/agent-runtime/branch-provider.d.ts.map +1 -1
  42. package/dist/agent-runtime/branch-source.d.ts +13 -1
  43. package/dist/agent-runtime/branch-source.d.ts.map +1 -1
  44. package/dist/agent-runtime/child-tools.d.ts +64 -0
  45. package/dist/agent-runtime/child-tools.d.ts.map +1 -1
  46. package/dist/agent-runtime/event-search-tools.d.ts +82 -5
  47. package/dist/agent-runtime/event-search-tools.d.ts.map +1 -1
  48. package/dist/agent-runtime/invocation-attempt.d.ts +1 -1
  49. package/dist/agent-runtime/invocation-attempt.d.ts.map +1 -1
  50. package/dist/agent-runtime/invocation-payload.d.ts +12 -0
  51. package/dist/agent-runtime/invocation-payload.d.ts.map +1 -1
  52. package/dist/agent-runtime/invocation-read.d.ts +6 -3
  53. package/dist/agent-runtime/invocation-read.d.ts.map +1 -1
  54. package/dist/agent-runtime/invocation-schema.d.ts +50 -8
  55. package/dist/agent-runtime/invocation-schema.d.ts.map +1 -1
  56. package/dist/agent-runtime/invocations.d.ts +20 -9
  57. package/dist/agent-runtime/invocations.d.ts.map +1 -1
  58. package/dist/agent-runtime/postgres.d.ts.map +1 -1
  59. package/dist/agent-runtime/schedule-tools.d.ts +30 -0
  60. package/dist/agent-runtime/schedule-tools.d.ts.map +1 -1
  61. package/dist/agent-runtime/schemas-invocation-payload.d.ts +48 -0
  62. package/dist/agent-runtime/schemas-invocation-payload.d.ts.map +1 -0
  63. package/dist/agent-runtime/sql-events.d.ts.map +1 -1
  64. package/dist/agent-runtime/sql-session.d.ts +11 -0
  65. package/dist/agent-runtime/sql-session.d.ts.map +1 -1
  66. package/dist/agent-runtime/sqlite-transactions.d.ts.map +1 -1
  67. package/dist/agent-runtime/state-tools.d.ts +55 -0
  68. package/dist/agent-runtime/state-tools.d.ts.map +1 -1
  69. package/dist/agent-runtime/store-branch.d.ts.map +1 -1
  70. package/dist/agent-runtime/store-conformance-lifecycle.d.ts +20 -20
  71. package/dist/agent-runtime/store-conformance-support.d.ts +10 -10
  72. package/dist/agent-runtime/store-create.d.ts.map +1 -1
  73. package/dist/agent-runtime/store-driver-contract.d.ts +12 -0
  74. package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -1
  75. package/dist/agent-runtime/store-memory-events.d.ts.map +1 -1
  76. package/dist/agent-runtime/store.d.ts +7 -0
  77. package/dist/agent-runtime/store.d.ts.map +1 -1
  78. package/dist/declaration/declaration.d.ts +6 -3
  79. package/dist/declaration/declaration.d.ts.map +1 -1
  80. package/dist/entrypoints/agent-executor/acp.d.ts +1 -1
  81. package/dist/entrypoints/agent-executor/acp.d.ts.map +1 -1
  82. package/dist/entrypoints/agent-executor/acp.js +23 -12
  83. package/dist/entrypoints/agent-executor/claude-sdk.js +26 -10
  84. package/dist/entrypoints/agent-executor/claude.js +35 -16
  85. package/dist/entrypoints/agent-executor/codex.js +81 -21
  86. package/dist/entrypoints/agent-executor.js +1 -1
  87. package/dist/entrypoints/agent-runtime/harness.js +5 -6
  88. package/dist/entrypoints/agent-runtime/openrouter.js +2 -2
  89. package/dist/entrypoints/agent-runtime/postgres.js +8 -3
  90. package/dist/entrypoints/agent-runtime/sandbox.js +3 -3
  91. package/dist/entrypoints/agent-runtime/sqlite/bun.js +4 -4
  92. package/dist/entrypoints/agent-runtime/sqlite/node.js +4 -4
  93. package/dist/entrypoints/agent-runtime/testing.js +6 -6
  94. package/dist/entrypoints/agent-runtime.d.ts +9 -7
  95. package/dist/entrypoints/agent-runtime.d.ts.map +1 -1
  96. package/dist/entrypoints/agent-runtime.js +246 -199
  97. package/dist/entrypoints/application/diagnostic-journal.js +4 -4
  98. package/dist/entrypoints/application/directory-inbox.js +8 -8
  99. package/dist/entrypoints/cli/publish.js +8 -8
  100. package/dist/entrypoints/cli.js +10 -9
  101. package/dist/entrypoints/declaration.js +0 -1
  102. package/dist/entrypoints/files.js +40 -17
  103. package/dist/entrypoints/node.js +4 -4
  104. package/dist/entrypoints/observability.js +1 -1
  105. package/dist/entrypoints/process.js +1 -1
  106. package/dist/entrypoints/server.js +7 -7
  107. package/dist/entrypoints/service-host/macos.js +4 -4
  108. package/dist/entrypoints/service-host.d.ts +4 -1
  109. package/dist/entrypoints/service-host.d.ts.map +1 -1
  110. package/dist/entrypoints/service-host.js +831 -220
  111. package/dist/entrypoints/spend.js +1 -1
  112. package/dist/entrypoints/telegram.js +4 -4
  113. package/dist/entrypoints/tools/agent.js +4 -3
  114. package/dist/entrypoints/tools/invoker.js +3 -2
  115. package/dist/entrypoints/tools/mcp.js +4 -3
  116. package/dist/entrypoints/tools/toolkit.js +6 -5
  117. package/dist/entrypoints/tools.d.ts +1 -1
  118. package/dist/entrypoints/tools.d.ts.map +1 -1
  119. package/dist/entrypoints/tools.js +10 -8
  120. package/dist/files/directory-appearance.d.ts +20 -9
  121. package/dist/files/directory-appearance.d.ts.map +1 -1
  122. package/dist/files/polled-json.d.ts.map +1 -1
  123. package/dist/files/regular-file.d.ts +15 -5
  124. package/dist/files/regular-file.d.ts.map +1 -1
  125. package/dist/{index-z4k0hqp9.js → index-0gqs8ght.js} +106 -24
  126. package/dist/{index-caywx1c0.js → index-13dnv6d0.js} +107 -10
  127. package/dist/{index-a725ayvz.js → index-1qwrczr1.js} +1 -1
  128. package/dist/{index-xtkw9866.js → index-2c5w2d1d.js} +1 -1
  129. package/dist/{index-g1q7fwn9.js → index-2nwvn7m2.js} +1 -1
  130. package/dist/{index-4s2w4g37.js → index-3tnwtz38.js} +80 -2
  131. package/dist/{index-5e0zsbf7.js → index-4j8efqr3.js} +1 -1
  132. package/dist/{index-p1m9djt6.js → index-5v5vg85s.js} +1 -1
  133. package/dist/{index-x90w78yz.js → index-673drwkn.js} +23 -8
  134. package/dist/{index-7xp05h20.js → index-6wp4dn9d.js} +6 -6
  135. package/dist/{index-0hdm5sx6.js → index-8x22nprv.js} +6 -2
  136. package/dist/{index-j13gzgdv.js → index-bz3gn6cs.js} +8 -4
  137. package/dist/{index-d96c1n1q.js → index-c5gp2gh6.js} +20 -19
  138. package/dist/{index-wbnpa8z6.js → index-d54npte7.js} +4 -4
  139. package/dist/{index-kmbpej2y.js → index-emgrmavr.js} +102 -61
  140. package/dist/{index-bbzvrq66.js → index-g3e57qj6.js} +455 -202
  141. package/dist/index-gf92hc87.js +100 -0
  142. package/dist/{index-3djgv3ch.js → index-gzny6zsw.js} +25 -10
  143. package/dist/{index-3b31z0pc.js → index-hj1zq7mh.js} +12 -6
  144. package/dist/{index-8xr2eq99.js → index-jfecdk1e.js} +3 -3
  145. package/dist/{index-dvd1qdwa.js → index-ke02kxsr.js} +3 -3
  146. package/dist/{index-83n766x4.js → index-m18xm96h.js} +15 -9
  147. package/dist/{index-qnzhmk2s.js → index-n7f89hjw.js} +90 -47
  148. package/dist/{index-3agqmmrg.js → index-pn5b11ce.js} +7 -9
  149. package/dist/{index-3gwp8ez6.js → index-pwskmywy.js} +12 -17
  150. package/dist/{index-9wh98cpa.js → index-rxnyygke.js} +130 -90
  151. package/dist/{index-0djnptn8.js → index-rzeezh79.js} +10 -3
  152. package/dist/{index-nbv44x0x.js → index-s2e3h616.js} +137 -36
  153. package/dist/{index-5zwac8ft.js → index-t7wa7k12.js} +2 -2
  154. package/dist/{index-xypxnzhp.js → index-v1mxss62.js} +2 -2
  155. package/dist/index-vgzhw2zk.js +304 -0
  156. package/dist/{index-jrka9029.js → index-vmbxj75t.js} +2 -2
  157. package/dist/{index-j516jaaz.js → index-waa6t4zx.js} +49 -2
  158. package/dist/{index-fcw255hd.js → index-xv9jb84s.js} +2 -2
  159. package/dist/{index-dwa6pskj.js → index-y065r8g5.js} +82 -43
  160. package/dist/internal/bounded-file-confirm.d.ts +32 -0
  161. package/dist/internal/bounded-file-confirm.d.ts.map +1 -0
  162. package/dist/internal/bounded-file-read.d.ts +10 -7
  163. package/dist/internal/bounded-file-read.d.ts.map +1 -1
  164. package/dist/internal/file-observation.d.ts +5 -1
  165. package/dist/internal/file-observation.d.ts.map +1 -1
  166. package/dist/internal/process-instance.d.ts +8 -0
  167. package/dist/internal/process-instance.d.ts.map +1 -1
  168. package/dist/internal/unix-socket.d.ts +3 -1
  169. package/dist/internal/unix-socket.d.ts.map +1 -1
  170. package/dist/server/unix-client.d.ts +7 -0
  171. package/dist/server/unix-client.d.ts.map +1 -1
  172. package/dist/service-host/systemd-inspect.d.ts +3 -1
  173. package/dist/service-host/systemd-inspect.d.ts.map +1 -1
  174. package/dist/service-host/systemd-render-shared.d.ts +64 -0
  175. package/dist/service-host/systemd-render-shared.d.ts.map +1 -0
  176. package/dist/service-host/systemd-render.d.ts +31 -26
  177. package/dist/service-host/systemd-render.d.ts.map +1 -1
  178. package/dist/service-host/systemd-timer-render.d.ts +31 -0
  179. package/dist/service-host/systemd-timer-render.d.ts.map +1 -0
  180. package/dist/service-host/systemd-timer-rollback.d.ts +26 -0
  181. package/dist/service-host/systemd-timer-rollback.d.ts.map +1 -0
  182. package/dist/service-host/systemd-timer.d.ts +82 -0
  183. package/dist/service-host/systemd-timer.d.ts.map +1 -0
  184. package/dist/service-host/systemd-unit-ops.d.ts +26 -0
  185. package/dist/service-host/systemd-unit-ops.d.ts.map +1 -0
  186. package/dist/service-host/systemd.d.ts +1 -1
  187. package/dist/service-host/systemd.d.ts.map +1 -1
  188. package/dist/tools/access.d.ts +30 -1
  189. package/dist/tools/access.d.ts.map +1 -1
  190. package/dist/tools/agent.d.ts +2 -2
  191. package/dist/tools/agent.d.ts.map +1 -1
  192. package/dist/tools/cli/args-scan.d.ts +5 -0
  193. package/dist/tools/cli/args-scan.d.ts.map +1 -1
  194. package/dist/tools/cli/args.d.ts +11 -5
  195. package/dist/tools/cli/args.d.ts.map +1 -1
  196. package/dist/tools/cli/invoke.d.ts +2 -1
  197. package/dist/tools/cli/invoke.d.ts.map +1 -1
  198. package/dist/tools/cli/notices.d.ts.map +1 -1
  199. package/dist/tools/cli/run-managed.d.ts.map +1 -1
  200. package/dist/tools/cli/session.d.ts.map +1 -1
  201. package/dist/tools/execute.d.ts.map +1 -1
  202. package/dist/tools/invoker.d.ts +2 -1
  203. package/dist/tools/invoker.d.ts.map +1 -1
  204. package/dist/tools/list-names.d.ts +2 -3
  205. package/dist/tools/list-names.d.ts.map +1 -1
  206. package/dist/tools/manifest.d.ts +2 -3
  207. package/dist/tools/manifest.d.ts.map +1 -1
  208. package/dist/tools/mcp/mount.d.ts +5 -5
  209. package/dist/tools/mcp/mount.d.ts.map +1 -1
  210. package/dist/tools/mcp/register.d.ts +2 -1
  211. package/dist/tools/mcp/register.d.ts.map +1 -1
  212. package/dist/tools/mcp/runtime-tools.d.ts.map +1 -1
  213. package/llms/agent-executor-acp.txt +10 -6
  214. package/llms/agent-executor-claude-sdk.txt +1 -1
  215. package/llms/agent-executor-claude.txt +1 -1
  216. package/llms/agent-executor-codex.txt +1 -1
  217. package/llms/agent-runtime.4.txt +21 -9
  218. package/llms/cli.3.txt +4 -4
  219. package/llms/cli.txt +1 -0
  220. package/llms/declaration.txt +2 -2
  221. package/llms/files.txt +1 -1
  222. package/llms/node.txt +2 -2
  223. package/llms/server.5.txt +2 -2
  224. package/llms/service-host.txt +5 -5
  225. package/llms/stitchkit.txt +81 -77
  226. package/llms/tools.3.txt +3 -2
  227. package/llms/upgrading-0.128.0.txt +147 -0
  228. package/llms/upgrading.txt +1 -0
  229. package/llms-full.txt +272 -113
  230. package/llms.txt +14 -13
  231. package/package.json +1 -1
  232. package/dist/index-ajmtxsky.js +0 -193
  233. package/dist/index-ax3wns1a.js +0 -93
@@ -0,0 +1,71 @@
1
+ import type { AgentMessagePart } from '../agent-parts/parts.js';
2
+ /** Default largest single image accepted by an agent-executor driver (5 MiB). */
3
+ export declare const DEFAULT_MAX_IMAGE_BYTES: number;
4
+ /**
5
+ * Bounded stdout line ceiling for Claude CLI sessions (16 MiB): leaves headroom above the
6
+ * 8 MiB outgoing stdin frame limit for `--replay-user-messages` metadata added on echo.
7
+ */
8
+ export declare const CLAUDE_CLI_MAX_LINE_BYTES: number;
9
+ /** Image MIME types accepted by Claude and Codex turn inputs. */
10
+ export type SupportedImageMediaType = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp';
11
+ /** Image MIME types accepted by Claude and Codex turn inputs. */
12
+ export declare const SUPPORTED_IMAGE_MEDIA_TYPES: ReadonlySet<SupportedImageMediaType>;
13
+ /** Narrow a MIME type string to the image types supported by Claude and Codex. */
14
+ export declare function isSupportedImageMediaType(value: string): value is SupportedImageMediaType;
15
+ /** Common image-attachment options shared across agent-executor drivers. */
16
+ export interface DriverImageOptions {
17
+ /** Read the bytes behind a `file` part's `reference`; without it a file part is refused. */
18
+ resolveFile?: (reference: string) => Promise<Uint8Array>;
19
+ /** Maximum decoded size of one image attachment in bytes. Default 5 MiB. */
20
+ maxImageBytes?: number;
21
+ }
22
+ /** One validated, host-resolved part ready to encode in a driver's wire format. */
23
+ export type InlinedPart = {
24
+ readonly type: 'text';
25
+ readonly text: string;
26
+ } | {
27
+ readonly type: 'image';
28
+ readonly mediaType: string;
29
+ readonly base64: string;
30
+ };
31
+ /** Validate driver-level image bounds eagerly before any process is spawned. */
32
+ export declare function validateImageOptions(options: Pick<DriverImageOptions, 'maxImageBytes'>): void;
33
+ /** Zero-copy base64 encoding of a `Uint8Array` view. */
34
+ export declare function bytesToBase64(bytes: Uint8Array): string;
35
+ /**
36
+ * Resolve one image attachment via the host's `resolveFile`, enforcing `maxImageBytes` and
37
+ * non-empty binary output without leaking the reference or host path in thrown errors.
38
+ */
39
+ export declare function resolveImageBytes(reference: string, options: {
40
+ resolveFile: (reference: string) => Promise<Uint8Array>;
41
+ maxImageBytes: number;
42
+ }): Promise<Uint8Array>;
43
+ /**
44
+ * Validate every part synchronously before the first `resolveFile` call, then resolve and
45
+ * base64-encode every image attachment in order. Any refusal rejects the whole turn before
46
+ * anything is sent to the engine.
47
+ */
48
+ export declare function inlineParts(parts: readonly AgentMessagePart[], options: DriverImageOptions & {
49
+ driverLabel: string;
50
+ signal?: AbortSignal;
51
+ }): Promise<InlinedPart[]>;
52
+ /**
53
+ * Serialize-guard an outgoing JSON frame against a byte limit without leaking payload bytes
54
+ * or references in the error message.
55
+ */
56
+ export declare function assertImageFrameBytes(serialized: string, maxBytes: number): void;
57
+ /**
58
+ * Guard a session's `startTurn` while host attachments are resolved asynchronously: prevents
59
+ * concurrent `startTurn` calls during `resolveFile` and re-checks session liveness after await.
60
+ */
61
+ export declare function imageTurnStarter<TInput extends {
62
+ readonly input: readonly AgentMessagePart[];
63
+ }, TTurn>(options: {
64
+ driverLabel: string;
65
+ busyMessage: string;
66
+ imageOptions: DriverImageOptions;
67
+ signal?: AbortSignal;
68
+ check(input: TInput): void;
69
+ dispatch(input: TInput, parts: readonly InlinedPart[]): TTurn | Promise<TTurn>;
70
+ }): (input: TInput) => Promise<TTurn>;
71
+ //# sourceMappingURL=image-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-input.d.ts","sourceRoot":"","sources":["../../src/agent-executor/image-input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAI7D,iFAAiF;AACjF,eAAO,MAAM,uBAAuB,QAAkB,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,yBAAyB,QAAmB,CAAC;AAE1D,iEAAiE;AACjE,MAAM,MAAM,uBAAuB,GAAG,WAAW,GAAG,YAAY,GAAG,WAAW,GAAG,YAAY,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CAAC,EAAE,WAAW,CAAC;CACtB,GACA,OAAO,CAAC,WAAW,EAAE,CAAC,CA0CxB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAOhF;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,SAAS;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAA;CAAE,EAC9D,KAAK,EACL,OAAO,EAAE;IACT,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,kBAAkB,CAAC;IACjC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,WAAW,EAAE,GAAG,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CAChF,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,CAmBpC"}
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import type { AgentMessagePart } from '../agent-parts/parts.js';
3
2
  import { type BoundedChannel } from '../internal/channel.js';
4
3
  import type { EngineProcess } from './engine-process.js';
5
4
  import { type ExecutorProfileConfig } from './profile.js';
@@ -12,8 +11,6 @@ export declare function epochSecondsToIso(seconds: number | null | undefined): s
12
11
  export declare function createTurnDeltaChannel(): BoundedChannel<ExecutorDelta>;
13
12
  /** Push a delta into a turn's channel, failing the channel if its bounds refuse it. */
14
13
  export declare function offerTurnDelta(channel: BoundedChannel<ExecutorDelta> | undefined, delta: ExecutorDelta): void;
15
- /** Extract text parts from a turn's input, refusing any non-text part. */
16
- export declare function extractTextOnlyInput(parts: readonly AgentMessagePart[], driverLabel: string): string;
17
14
  /** A session's own abort, following the caller's signal until the session ends. */
18
15
  export interface SessionAbort {
19
16
  /** Aborts with the caller's reason, or when the session calls `abort()`. */
@@ -1 +1 @@
1
- {"version":3,"file":"session-primitives.d.ts","sourceRoot":"","sources":["../../src/agent-executor/session-primitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,qBAAqB,CAAC;AAGhF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,KAAK,qBAAqB,EAAqB,MAAM,WAAW,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAWlD,mFAAmF;AACnF,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAEjE;AAED,oGAAoG;AACpG,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAKxF;AAED,kEAAkE;AAClE,wBAAgB,sBAAsB,IAAI,cAAc,CAAC,aAAa,CAAC,CAMtE;AAwBD,uFAAuF;AACvF,wBAAgB,cAAc,CAC5B,OAAO,EAAE,cAAc,CAAC,aAAa,CAAC,GAAG,SAAS,EAClD,KAAK,EAAE,aAAa,GACnB,IAAI,CAMN;AAED,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,gBAAgB,EAAE,EAClC,WAAW,EAAE,MAAM,GAClB,MAAM,CASR;AAED,mFAAmF;AACnF,MAAM,WAAW,YAAY;IAC3B,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,4EAA4E;IAC5E,KAAK,IAAI,IAAI,CAAC;IACd,6FAA6F;IAC7F,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,Y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AAS,CAAC,CAAC,CAAC;CACvD;;;;;;GAUA;AAED,oFAAoF;AACpF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAC7C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC;AAMD;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,UAAU,EAAE,gBAAgB,EAC5B,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACpC,OAAO,CAAC,IAAI,CAAC,CAef;AAED;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAAC,CAAC,SAAS,gBAAgB,EAAE,CAAC,EACzE,OAAO,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,EAC5C,GAAG,EAAE,CAAC,UAAU,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GACjC,OAAO,CAAC,CAAC,CAAC,CAkBZ;AAED,mGAAmG;AACnG,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAOhF"}
@@ -1,4 +1,19 @@
1
1
  import type { ZodObject, ZodType, z } from 'zod';
2
+ /** Static non-executable metadata for a built-in agent-only runtime tool. */
3
+ export interface AgentToolDescriptor<TInput extends ZodObject = ZodObject, TOutput extends ZodType = ZodType> {
4
+ readonly name: string;
5
+ readonly description: string;
6
+ readonly identity: {
7
+ readonly serviceName: string;
8
+ readonly action: string;
9
+ readonly scope?: string;
10
+ readonly method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
11
+ readonly meta?: Readonly<Record<string, unknown>>;
12
+ };
13
+ readonly input: TInput;
14
+ readonly output: TOutput;
15
+ readonly expose: readonly ['AGENT'];
16
+ }
2
17
  /** Peer-neutral tool definition for surfaces exposed only to an agent model. */
3
18
  export interface AgentToolDefinition<TInput extends ZodObject, TOutput extends ZodType> {
4
19
  name: string;
@@ -15,11 +30,10 @@ export interface AgentToolDefinition<TInput extends ZodObject, TOutput extends Z
15
30
  expose: readonly ['AGENT'];
16
31
  handler(context: unknown): unknown;
17
32
  }
18
- interface AgentToolSourceDefinition<TInput extends ZodObject, TOutput extends ZodType> extends Omit<AgentToolDefinition<TInput, TOutput>, 'handler'> {
19
- handler(context: {
20
- input: z.output<TInput>;
21
- }): z.output<TOutput> | Promise<z.output<TOutput>>;
22
- }
23
- export declare function defineAgentTool<TInput extends ZodObject, TOutput extends ZodType>(definition: AgentToolSourceDefinition<TInput, TOutput>): AgentToolDefinition<TInput, TOutput>;
24
- export {};
33
+ /** Freeze a static agent tool descriptor so consumers inspecting catalogs cannot mutate shared metadata. */
34
+ export declare function defineAgentToolDescriptor<TInput extends ZodObject, TOutput extends ZodType>(descriptor: AgentToolDescriptor<TInput, TOutput>): AgentToolDescriptor<TInput, TOutput>;
35
+ /** Bind a frozen static descriptor to a run-scoped handler without duplicating schemas or metadata. */
36
+ export declare function bindAgentTool<TInput extends ZodObject, TOutput extends ZodType>(descriptor: AgentToolDescriptor<TInput, TOutput>, handler: (context: {
37
+ input: z.output<TInput>;
38
+ }) => z.output<TOutput> | Promise<z.output<TOutput>>): AgentToolDefinition<TInput, TOutput>;
25
39
  //# sourceMappingURL=agent-tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-tool.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/agent-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAEjD,gFAAgF;AAChF,MAAM,WAAW,mBAAmB,CAAC,MAAM,SAAS,SAAS,EAAE,OAAO,SAAS,OAAO;IACpF,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QA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,wBAAgB,yBAAyB,CAAC,MAAM,SAAS,SAAS,EAAE,OAAO,SAAS,OAAO,EACzF,UAAU,EAAE,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/C,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,CAatC;AAED,uGAAuG;AACvG,wBAAgB,aAAa,CAAC,MAAM,SAAS,SAAS,EAAE,OAAO,SAAS,OAAO,EAC7E,UAAU,EAAE,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,EAChD,OAAO,EAAE,CAAC,OAAO,EAAE;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;CACzB,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GACnD,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,CAgBtC"}
@@ -77,6 +77,7 @@ export declare const BranchAgentConversationInputSchema: z.ZodObject<{
77
77
  }>;
78
78
  sourceIdentity: z.ZodDefault<z.ZodEnum<{
79
79
  refuse: "refuse";
80
+ "rekey-spill": "rekey-spill";
80
81
  retain: "retain";
81
82
  }>>;
82
83
  }, z.core.$strict>>>;
@@ -1 +1 @@
1
- {"version":3,"file":"branch-contract.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/branch-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsCxB,sEAAsE;AACtE,eAAO,MAAM,6BAA6B,YACxC,WAAW,EACX,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,CACJ,CAAC;AAiBX,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA8CpC,CAAC;AAEZ,6DAA6D;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CAAkC,GAAG,CAAC,CAAC,KAAK,CACtD,OAAO,kCAAkC,CAC1C,CAAC;AAEF,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;kBActC,CAAC;AAEZ,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,oCAAoC,CAC5C,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;kBAKrC,CAAC;AAEZ,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CACjD,OAAO,mCAAmC,CAC3C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;kBAUnC,CAAC;AAEZ,6EAA6E;AAC7E,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC"}
@@ -4,6 +4,7 @@ import type { StoreOperation } from './store-reduce-shared.js';
4
4
  export type IdentityKind = 'run' | 'message' | 'call' | 'approval' | 'operation' | 'spill' | 'event' | 'owner' | 'key' | 'schedule' | 'child';
5
5
  /** Where in the source the branch is reading. */
6
6
  type BranchAddress = Pick<AgentBranchRefusal, 'seq' | 'eventKind' | 'messageId' | 'toolName'>;
7
+ export type BranchApplicationKeyMode = 'refuse' | 'retain' | 'rekey-spill';
7
8
  /** Definitions are collected before references are resolved; foreign references never mint IDs. */
8
9
  export declare class BranchIdentities {
9
10
  readonly conversationId: string;
@@ -19,6 +20,8 @@ export declare class BranchIdentities {
19
20
  private readonly applicationKeys;
20
21
  constructor(conversationId: string, requestKey: string, sourceConversationId: string);
21
22
  define(kind: IdentityKind, source: string): string;
23
+ /** Register a spill that legitimately expired via `spill/deleted` in the source log. */
24
+ defineExpiredSpill(source: string): string;
22
25
  /** Run `work` with `address` added to where the branch is reading. */
23
26
  within<T>(address: BranchAddress, work: () => T): T;
24
27
  /**
@@ -48,9 +51,9 @@ export declare class BranchIdentities {
48
51
  /** Keys the host declares as its own data inside application JSON, with what a source identity under them does. */
49
52
  declareApplicationKeys(keys: readonly {
50
53
  key: string;
51
- sourceIdentity: 'refuse' | 'retain';
54
+ sourceIdentity: BranchApplicationKeyMode;
52
55
  }[]): void;
53
- applicationKey(key: string): 'refuse' | 'retain' | undefined;
56
+ applicationKey(key: string): BranchApplicationKeyMode | undefined;
54
57
  /**
55
58
  * Everything of the source conversation that `value` names: the conversation
56
59
  * itself, any identity it defines, a declared application file. One string
@@ -1 +1 @@
1
- {"version":3,"file":"branch-identities.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/branch-identities.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,kBAAkB,EACvB,mCAAmC,EAEpC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,MAAM,MAAM,YAAY,GACpB,KAAK,GACL,SAAS,GACT,MAAM,GACN,UAAU,GACV,WAAW,GACX,OAAO,GACP,OAAO,GACP,OAAO,GACP,KAAK,GACL,UAAU,GACV,OAAO,CAAC;AAEZ,iDAAiD;AACjD,KAAK,aAAa,GAAG,IAAI,CAAC,kBAAkB,EAAE,KAAK,GAAG,WAAW,GAAG,WAAW,GAAG,UAAU,CAAC,CAAC;AAK9F,mGAAmG;AACnG,qBAAa,gBAAgB;IAUzB,QAAQ,CAAC,cAAc,EAAE,MAAM;IAC/B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,QAAQ,CAAC,oBAAoB,EAAE,MAAM;IAXvC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAgD;IAC5E,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA4B;IAClD,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqB;IAC3C,OAAO,CAAC,QAAQ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AAI,CAEN;IACD,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,wBAAwB,GAAG,SAAS,CAEhE;IACD;;;;OAIG;IACH,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,YAAY,GAAG,cAAc,GAAG,MAAM,CAAC,CAMrF;IACD,gGAAgG;IAChG,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAcpC;IACD,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC,CAElD;IACD,cAAc,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAM1C;IACD,UAAU,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI,CAK9B;IACD;;;OAGG;IACH,gBAAgB,CAAC,SAAS,EAAE,cAAc,GAAG,IAAI,CA4BhD;CACF"}
@@ -1,21 +1,21 @@
1
1
  import { z } from 'zod';
2
2
  import type { BranchIdentities } from './branch-identities.js';
3
3
  import type { AgentMessage, AgentRun } from './schemas.js';
4
+ type JsonValue = z.infer<ReturnType<typeof z.json>>;
4
5
  /**
5
6
  * Application JSON is data, never an undocumented runtime reference codec.
6
7
  *
7
8
  * A key named like a runtime reference refuses the branch unless the host
8
- * declares it in `applicationKeys`: the value cannot be rekeyed, and carried as
9
- * it is it could name the source. Under a `'refuse'` key a value that names
10
- * anything of the source still refuses. Under a `'retain'` key a value naming
11
- * the source conversation, a run or a message crosses unchanged as a record of
12
- * the past; one naming a spill, an application file or another runtime
13
- * identity refuses, because what it grants crosses by its own contract.
14
- * Refusals name the key's path inside the payload, never its value, and are
15
- * collected: the branch goes on reading and answers them all at once.
9
+ * declares it in `applicationKeys`: under `'refuse'` a value naming anything
10
+ * of the source refuses; under `'retain'` the source conversation, its runs
11
+ * and its messages cross unchanged as a record of the past; under `'rekey-spill'`
12
+ * a string value must name exclusively a source spill (live or expired) and is
13
+ * rekeyed to the destination spill identity while `null`/non-strings pass
14
+ * through. Pure: never mutates its input.
16
15
  */
17
- export declare function branchOpaqueJson(ids: BranchIdentities, value: z.infer<ReturnType<typeof z.json>>, path?: string): typeof value;
16
+ export declare function branchOpaqueJson(ids: BranchIdentities, value: JsonValue, path?: string): JsonValue;
18
17
  export declare function branchToolJson(ids: BranchIdentities, name: string, value: z.infer<ReturnType<typeof z.json>>, output: boolean): z.JSONType;
19
18
  export declare function branchMessage(ids: BranchIdentities, sourceConversationId: string, message: AgentMessage): AgentMessage;
20
19
  export declare function branchRun(ids: BranchIdentities, sourceConversationId: string, run: AgentRun, settled: boolean): AgentRun;
20
+ export {};
21
21
  //# sourceMappingURL=branch-messages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"branch-messages.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/branch-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,YAAY,EAAoB,QAAQ,EAAE,MAAM,WAAW,CAAC;AAK1E;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,gBAAgB,EACrB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,EACzC,IAAI,SAAK,GACR,OAAO,KAAK,CAyCd;AAED,wBAAgB,cAAc,CAC5B,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,EACzC,MAAM,EAAE,OAAO,cAGhB;AAiDD,wBAAgB,aAAa,CAC3B,GAAG,EAAE,gBAAgB,EACrB,oBAAoB,EAAE,MAAM,EAC5B,OAAO,EAAE,YAAY,GACpB,YAAY,CAad;AAED,wBAAgB,SAAS,CACvB,GAAG,EAAE,gBAAgB,EACrB,oBAAoB,EAAE,MAAM,EAC5B,GAAG,EAAE,QAAQ,EACb,OAAO,EAAE,OAAO,GACf,QAAQ,CAsBV"}
1
+ {"version":3,"file":"branch-messages.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/branch-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,YAAY,EAAoB,QAAQ,EAAE,MAAM,WAAW,CAAC;AAM1E,KAAK,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAEpD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,gBAAgB,EACrB,KAAK,EAAE,SAAS,EAChB,IAAI,SAAK,GACR,SAAS,CAQX;AAgED,wBAAgB,cAAc,CAC5B,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,EACzC,MAAM,EAAE,OAAO,cAGhB;AAsDD,wBAAgB,aAAa,CAC3B,GAAG,EAAE,gBAAgB,EACrB,oBAAoB,EAAE,MAAM,EAC5B,OAAO,EAAE,YAAY,GACpB,YAAY,CAad;AAED,wBAAgB,SAAS,CACvB,GAAG,EAAE,gBAAgB,EACrB,oBAAoB,EAAE,MAAM,EAC5B,GAAG,EAAE,QAAQ,EACb,OAAO,EAAE,OAAO,GACf,QAAQ,CAsBV"}
@@ -1,8 +1,28 @@
1
1
  import { z } from 'zod';
2
2
  import type { BranchIdentities } from './branch-identities.js';
3
+ /** Shared payload schema for `spill/created` and `spill/deleted` events. */
4
+ export declare const SpillEventPayloadSchema: z.ZodObject<{
5
+ reference: z.ZodString;
6
+ bytes: z.ZodInt;
7
+ sha256: z.ZodOptional<z.ZodString>;
8
+ }, z.core.$strict>;
3
9
  type Json = z.infer<ReturnType<typeof z.json>>;
4
10
  /** Control observations are retained under an inert kind: no state/schedule/durability reader can replay them. */
5
11
  export declare function branchObservation(ids: BranchIdentities, kind: string, raw: Json, inherited?: boolean): {
12
+ result: {
13
+ grade: "full";
14
+ restrictions: ("network-denied" | "process-contained" | "secrets-hidden" | "write-contained")[];
15
+ } | {
16
+ grade: "partial";
17
+ restrictions: ("network-denied" | "process-contained" | "secrets-hidden" | "write-contained")[];
18
+ gaps: ("network-denied" | "process-contained" | "secrets-hidden" | "write-contained")[];
19
+ } | {
20
+ grade: "unavailable";
21
+ reason: string;
22
+ };
23
+ required: ("network-denied" | "process-contained" | "secrets-hidden" | "write-contained")[];
24
+ missing: ("network-denied" | "process-contained" | "secrets-hidden" | "write-contained")[];
25
+ } | {
6
26
  conversationId: string;
7
27
  invocationId: string;
8
28
  operationId: string;
@@ -34,6 +54,17 @@ export declare function branchObservation(ids: BranchIdentities, kind: string, r
34
54
  models: string[];
35
55
  payloadSha256: string;
36
56
  };
57
+ } | {
58
+ conversationId: string;
59
+ invocationId: string;
60
+ operationId: string;
61
+ runId?: string | undefined;
62
+ type: "invocation/finished";
63
+ failure?: {
64
+ artifactId: string;
65
+ payloadSha256: string;
66
+ } | undefined;
67
+ status: "cancelled" | "failed" | "succeeded";
37
68
  } | {
38
69
  conversationId: string;
39
70
  invocationId: string;
@@ -55,7 +86,8 @@ export declare function branchObservation(ids: BranchIdentities, kind: string, r
55
86
  modelId: string;
56
87
  provider: string;
57
88
  payloadSha256: string;
58
- artifactId: string;
89
+ artifactId?: string | undefined;
90
+ payloadOmitted?: "max-payload-bytes" | undefined;
59
91
  tools: number;
60
92
  };
61
93
  } | {
@@ -99,48 +131,21 @@ export declare function branchObservation(ids: BranchIdentities, kind: string, r
99
131
  provenance: "computed" | "estimated" | "provider-reported" | "unavailable";
100
132
  } | undefined;
101
133
  };
102
- artifactId: string;
134
+ artifactId?: string | undefined;
135
+ payloadOmitted?: "max-payload-bytes" | undefined;
103
136
  payloadSha256: string;
104
- } | {
105
- conversationId: string;
106
- invocationId: string;
107
- operationId: string;
108
- runId?: string | undefined;
109
- type: "invocation/finished";
110
- failure?: {
111
- artifactId: string;
112
- payloadSha256: string;
113
- } | undefined;
114
- status: "cancelled" | "failed" | "succeeded";
115
- } | {
116
- result: {
117
- grade: "full";
118
- restrictions: ("network-denied" | "process-contained" | "secrets-hidden" | "write-contained")[];
119
- } | {
120
- grade: "partial";
121
- restrictions: ("network-denied" | "process-contained" | "secrets-hidden" | "write-contained")[];
122
- gaps: ("network-denied" | "process-contained" | "secrets-hidden" | "write-contained")[];
123
- } | {
124
- grade: "unavailable";
125
- reason: string;
126
- };
127
- required: ("network-denied" | "process-contained" | "secrets-hidden" | "write-contained")[];
128
- missing: ("network-denied" | "process-contained" | "secrets-hidden" | "write-contained")[];
129
- } | {
130
- name: string;
131
- version: number;
132
- value: z.JSONType;
133
- actor: "agent" | "human" | "system";
134
137
  } | {
135
138
  kind: "sleep";
136
139
  name: string;
137
140
  deadline: number;
141
+ encoded?: string | undefined;
138
142
  runId: string;
139
143
  id?: string | undefined;
140
144
  } | {
141
145
  kind: "wait";
142
146
  event: string;
143
147
  id: string;
148
+ encoded?: string | undefined;
144
149
  runId: string;
145
150
  } | {
146
151
  stepName: string;
@@ -155,6 +160,7 @@ export declare function branchObservation(ids: BranchIdentities, kind: string, r
155
160
  } | {
156
161
  effectName: string;
157
162
  phase: "intent";
163
+ encoded?: string | undefined;
158
164
  runId: string;
159
165
  id?: string | undefined;
160
166
  } | {
@@ -167,6 +173,7 @@ export declare function branchObservation(ids: BranchIdentities, kind: string, r
167
173
  } | {
168
174
  effectName: string;
169
175
  phase: "uncertain";
176
+ encoded?: string | undefined;
170
177
  runId: string;
171
178
  id?: string | undefined;
172
179
  } | {
@@ -193,6 +200,12 @@ export declare function branchObservation(ids: BranchIdentities, kind: string, r
193
200
  artifactId: string;
194
201
  sha256: string;
195
202
  bytes: number;
203
+ expiredAt?: string | undefined;
204
+ } | {
205
+ name: string;
206
+ version: number;
207
+ actor: "agent" | "human" | "system";
208
+ value: z.JSONType;
196
209
  } | {
197
210
  toolName: string;
198
211
  reason: string;
@@ -1 +1 @@
1
- {"version":3,"file":"branch-observations.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/branch-observations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAuD5D,KAAK,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAkM/C,kHAAkH;AAClH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,IAAI,EACT,SAAS,UAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAUlB;AAcD;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,QAqB3F;AAED,eAAO,MAAM,uBAAuB;;;kBAEzB,CAAC"}
1
+ {"version":3,"file":"branch-observations.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/branch-observations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAiC5D,4EAA4E;AAC5E,eAAO,MAAM,uBAAuB;;;;kBAEzB,CAAC;AAoBZ,KAAK,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAqM/C,kHAAkH;AAClH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,gBAAgB,EACrB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,IAAI,EACT,SAAS,UAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAUlB;AAcD;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,QAqB3F;AAED,eAAO,MAAM,uBAAuB;;;kBAEzB,CAAC"}
@@ -1,11 +1,12 @@
1
- import type { z } from 'zod';
1
+ import { z } from 'zod';
2
2
  import type { BranchIdentities } from './branch-identities.js';
3
+ type JsonValue = z.infer<ReturnType<typeof z.json>>;
3
4
  /** Provider IDs stay provider IDs; runtime call references and their content digests are rekeyed. */
4
5
  export declare class BranchProvider {
5
6
  private readonly ids;
6
7
  private readonly digests;
7
8
  constructor(ids: BranchIdentities);
8
- rekey(kind: string, raw: z.infer<ReturnType<typeof z.json>>): {
9
+ rekey(kind: string, raw: JsonValue): {
9
10
  sha256: string;
10
11
  message: {
11
12
  providerOptions?: Record<string, Record<string, z.JSONType>> | undefined;
@@ -79,15 +80,15 @@ export declare class BranchProvider {
79
80
  } | {
80
81
  providerOptions?: Record<string, Record<string, z.JSONType>> | undefined;
81
82
  type: "tool-call";
82
- toolName: string;
83
- providerExecuted?: boolean | undefined;
84
83
  toolCallId: string;
84
+ toolName: string;
85
85
  input: z.JSONType;
86
+ providerExecuted?: boolean | undefined;
86
87
  } | {
87
88
  providerOptions?: Record<string, Record<string, z.JSONType>> | undefined;
88
89
  type: "tool-result";
89
- toolName: string;
90
90
  toolCallId: string;
91
+ toolName: string;
91
92
  output: {
92
93
  providerOptions?: Record<string, Record<string, z.JSONType>> | undefined;
93
94
  type: "error-text" | "text";
@@ -165,13 +166,15 @@ export declare class BranchProvider {
165
166
  type: "tool-approval-request";
166
167
  approvalId: string;
167
168
  toolCallId: string;
169
+ signature?: string | undefined;
170
+ isAutomatic?: boolean | undefined;
168
171
  reason?: string | undefined;
169
172
  } | {
170
173
  type: "tool-approval-response";
174
+ approvalId: string;
171
175
  approved: boolean;
172
176
  reason?: string | undefined;
173
177
  providerExecuted?: boolean | undefined;
174
- approvalId: string;
175
178
  })[];
176
179
  };
177
180
  } | {
@@ -222,5 +225,8 @@ export declare class BranchProvider {
222
225
  message?: undefined;
223
226
  runId: string;
224
227
  };
228
+ private rekeyPart;
229
+ private rekeyToolResultOutput;
225
230
  }
231
+ export {};
226
232
  //# sourceMappingURL=branch-provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"branch-provider.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/branch-provider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAoB5D,qGAAqG;AACrG,qBAAa,cAAc;IAEb,OAAO,CAAC,QAAQ,CAAC,GAAG;IADhC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;IACrD,YAA6B,GAAG,EAAE,gBAAgB,EAAI;IACtD,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAqG1D;CACF"}
1
+ {"version":3,"file":"branch-provider.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/branch-provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAS5D,KAAK,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAmFpD,qGAAqG;AACrG,qBAAa,cAAc;IAEb,OAAO,CAAC,QAAQ,CAAC,GAAG;IADhC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;IACrD,YAA6B,GAAG,EAAE,gBAAgB,EAAI;IACtD,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA8CjC;IAED,OAAO,CAAC,SAAS;IA8CjB,OAAO,CAAC,qBAAqB;CAkD9B"}
@@ -2,13 +2,25 @@ import { z } from 'zod';
2
2
  import type { AgentStoreEventEnvelope } from '../durability/events.js';
3
3
  import { ArchiveSpillSchema } from './archive-spill.js';
4
4
  import type { ParsedBranchAgentConversationInput } from './branch-contract.js';
5
- import type { AgentConversationBranchRefusedError } from './branch-refusal.js';
5
+ import { AgentConversationBranchRefusedError } from './branch-refusal.js';
6
6
  import { type BranchReplay } from './branch-replay.js';
7
7
  export declare function branchHash(value: unknown): string;
8
+ export interface BranchExpiredSpillTail {
9
+ reference: string;
10
+ bytes: number;
11
+ sha256?: string;
12
+ }
8
13
  export interface BranchSource {
9
14
  conversationId: string;
10
15
  events: AgentStoreEventEnvelope[];
11
16
  spills: z.infer<typeof ArchiveSpillSchema>[];
17
+ /** Spills referenced in the selected prefix that legitimately expired via `spill/deleted`. */
18
+ expiredSpills: readonly string[];
19
+ /**
20
+ * Referenced expired spills whose `spill/deleted` occurred after the `throughRunId`
21
+ * cutoff and must be recorded as synthetic observations so subsequent branches succeed.
22
+ */
23
+ tailDeletedSpills: readonly BranchExpiredSpillTail[];
12
24
  replay: BranchReplay;
13
25
  digest: string;
14
26
  /** What declarations would lift, collected over the whole archive; absent when nothing. */
@@ -1 +1 @@
1
- {"version":3,"file":"branch-source.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/branch-source.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,mBAAmB,CAAC;AAG5E,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,iBAAiB,CAAC;AASxE,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEjD;AA8CD,MAAM,WAAW,YAAY;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,uBAAuB,EAAE,CAAC;IAClC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO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,EAAE,CAAC;IACjC;;;OAGG;IACH,iBAAiB,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACrD,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,2FAA2F;IAC3F,OAAO,CAAC,EAAE,mCAAmC,CAAC;IAC9C,gGAAgG;IAChG,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,sGAAsG;AACtG,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,UAAU,EACjB,EACE,MAAM,EACN,gBAAqB,EACrB,eAAoB,GACrB,EAAE,IAAI,CACL,kCAAkC,EAClC,QAAQ,GAAG,kBAAkB,GAAG,iBAAiB,CAClD,GACA,YAAY,CA6Hd"}
@@ -1,6 +1,70 @@
1
1
  import { z } from 'zod';
2
2
  import { type AgentChildManager } from './children.js';
3
3
  import type { AgentRuntimeRunContext } from './runtime.js';
4
+ /**
5
+ * Static non-executable descriptors for the built-in child tools (`createAgentChildTools`).
6
+ * Single source of truth for catalog generation, preset validation, and live run-bound tools.
7
+ */
8
+ export declare const AGENT_CHILD_TOOL_DESCRIPTORS: readonly [import("./agent-tool.js").AgentToolDescriptor<z.ZodObject<{
9
+ childInput: z.ZodJSONSchema;
10
+ budget: z.ZodObject<{
11
+ usd: z.ZodOptional<z.ZodNumber>;
12
+ tokens: z.ZodOptional<z.ZodInt>;
13
+ milliseconds: z.ZodOptional<z.ZodInt>;
14
+ }, z.core.$strict>;
15
+ seedUptoSeq: z.ZodOptional<z.ZodInt>;
16
+ }, z.core.$strict>, z.ZodObject<{
17
+ childConversationId: z.ZodString;
18
+ state: z.ZodString;
19
+ resultReference: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strip>>, import("./agent-tool.js").AgentToolDescriptor<z.ZodObject<{
21
+ childInput: z.ZodJSONSchema;
22
+ budget: z.ZodObject<{
23
+ usd: z.ZodOptional<z.ZodNumber>;
24
+ tokens: z.ZodOptional<z.ZodInt>;
25
+ milliseconds: z.ZodOptional<z.ZodInt>;
26
+ }, z.core.$strict>;
27
+ seedUptoSeq: z.ZodOptional<z.ZodInt>;
28
+ }, z.core.$strict>, z.ZodObject<{
29
+ childConversationId: z.ZodString;
30
+ state: z.ZodString;
31
+ resultReference: z.ZodOptional<z.ZodString>;
32
+ }, z.core.$strip>>, import("./agent-tool.js").AgentToolDescriptor<z.ZodObject<{}, z.core.$strict>, z.ZodObject<{
33
+ children: z.ZodArray<z.ZodObject<{
34
+ parentConversationId: z.ZodString;
35
+ childConversationId: z.ZodString;
36
+ seedUptoSeq: z.ZodInt;
37
+ state: z.ZodEnum<{
38
+ finished: "finished";
39
+ lost: "lost";
40
+ running: "running";
41
+ spawned: "spawned";
42
+ stopped: "stopped";
43
+ }>;
44
+ budget: z.ZodObject<{
45
+ usd: z.ZodOptional<z.ZodNumber>;
46
+ tokens: z.ZodOptional<z.ZodInt>;
47
+ milliseconds: z.ZodOptional<z.ZodInt>;
48
+ }, z.core.$strict>;
49
+ usage: z.ZodObject<{
50
+ tokens: z.ZodInt;
51
+ usd: z.ZodNumber;
52
+ milliseconds: z.ZodInt;
53
+ }, z.core.$strict>;
54
+ resultReference: z.ZodOptional<z.ZodString>;
55
+ createdAt: z.ZodString;
56
+ updatedAt: z.ZodString;
57
+ }, z.core.$strict>>;
58
+ }, z.core.$strip>>, import("./agent-tool.js").AgentToolDescriptor<z.ZodObject<{
59
+ childConversationId: z.ZodString;
60
+ input: z.ZodJSONSchema;
61
+ }, z.core.$strict>, z.ZodObject<{
62
+ sent: z.ZodLiteral<true>;
63
+ }, z.core.$strip>>, import("./agent-tool.js").AgentToolDescriptor<z.ZodObject<{
64
+ childConversationId: z.ZodString;
65
+ }, z.core.$strict>, z.ZodObject<{
66
+ interrupted: z.ZodLiteral<true>;
67
+ }, z.core.$strip>>];
4
68
  /** Configuration binding child-management agent tools to a manager and active run context. */
5
69
  export interface AgentChildToolsConfig {
6
70
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"child-tools.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/child-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAEL,KAAK,iBAAiB,EAEvB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAExD,8FAA8F;AAC9F,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,OAAO,EAAE,IAAI,CACX,iBAAiB,EACjB,YAAY,GAAG,WAAW,GAAG,cAAc,GAAG,aAAa,GAAG,gBAAgB,CAC/E,CAAC;IACF,6FAA6F;IAC7F,GAAG,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC;CACtC;AA0DD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBA6ClE"}
1
+ {"version":3,"file":"child-tools.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/child-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAEL,KAAK,iBAAiB,EAEvB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAmExD;;;GAGG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAM9B,CAAC;AAEZ,8FAA8F;AAC9F,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,OAAO,EAAE,IAAI,CACX,iBAAiB,EACjB,YAAY,GAAG,WAAW,GAAG,cAAc,GAAG,aAAa,GAAG,gBAAgB,CAC/E,CAAC;IACF,6FAA6F;IAC7F,GAAG,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC;CACtC;AAqCD;;;;GAIG;A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