@sixb/agent 0.0.0-stage → 0.1.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 (219) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +31 -2
  3. package/dist/abort.d.ts +6 -0
  4. package/dist/abort.d.ts.map +1 -0
  5. package/dist/agent-prompt.d.ts +120 -0
  6. package/dist/agent-prompt.d.ts.map +1 -0
  7. package/dist/agent-runtime/errors.d.ts +13 -0
  8. package/dist/agent-runtime/errors.d.ts.map +1 -0
  9. package/dist/agent-runtime/preflight.d.ts +18 -0
  10. package/dist/agent-runtime/preflight.d.ts.map +1 -0
  11. package/dist/agent-runtime/profile.d.ts +14 -0
  12. package/dist/agent-runtime/profile.d.ts.map +1 -0
  13. package/dist/artifacts/layout-check/layout-check.d.ts +87 -0
  14. package/dist/artifacts/layout-check/layout-check.d.ts.map +1 -0
  15. package/dist/artifacts/materialize.d.ts +115 -0
  16. package/dist/artifacts/materialize.d.ts.map +1 -0
  17. package/dist/artifacts/publish-tool.d.ts +86 -0
  18. package/dist/artifacts/publish-tool.d.ts.map +1 -0
  19. package/dist/ask-parent-tool.d.ts +36 -0
  20. package/dist/ask-parent-tool.d.ts.map +1 -0
  21. package/dist/attachments.d.ts +68 -0
  22. package/dist/attachments.d.ts.map +1 -0
  23. package/dist/child-files.d.ts +96 -0
  24. package/dist/child-files.d.ts.map +1 -0
  25. package/dist/child-questions.d.ts +24 -0
  26. package/dist/child-questions.d.ts.map +1 -0
  27. package/dist/computer-runner.d.ts +65 -0
  28. package/dist/computer-runner.d.ts.map +1 -0
  29. package/dist/context-budget.d.ts +28 -0
  30. package/dist/context-budget.d.ts.map +1 -0
  31. package/dist/context-compaction.d.ts +48 -0
  32. package/dist/context-compaction.d.ts.map +1 -0
  33. package/dist/conversation-memory.d.ts +21 -0
  34. package/dist/conversation-memory.d.ts.map +1 -0
  35. package/dist/errors.d.ts +46 -0
  36. package/dist/errors.d.ts.map +1 -0
  37. package/dist/execution-plan.d.ts +34 -0
  38. package/dist/execution-plan.d.ts.map +1 -0
  39. package/dist/failure.d.ts +14 -0
  40. package/dist/failure.d.ts.map +1 -0
  41. package/dist/family-mailbox.d.ts +60 -0
  42. package/dist/family-mailbox.d.ts.map +1 -0
  43. package/dist/file-ref.d.ts +6 -0
  44. package/dist/file-ref.d.ts.map +1 -0
  45. package/dist/image-attachments.d.ts +34 -0
  46. package/dist/image-attachments.d.ts.map +1 -0
  47. package/dist/index.d.ts +35 -0
  48. package/dist/index.d.ts.map +1 -0
  49. package/dist/index.js +12168 -0
  50. package/dist/index.js.map +65 -0
  51. package/dist/message-authors.d.ts +34 -0
  52. package/dist/message-authors.d.ts.map +1 -0
  53. package/dist/message-times.d.ts +8 -0
  54. package/dist/message-times.d.ts.map +1 -0
  55. package/dist/model-adapters.d.ts +55 -0
  56. package/dist/model-adapters.d.ts.map +1 -0
  57. package/dist/model-lines.d.ts +16 -0
  58. package/dist/model-lines.d.ts.map +1 -0
  59. package/dist/requester.d.ts +15 -0
  60. package/dist/requester.d.ts.map +1 -0
  61. package/dist/run-agent-turn.d.ts +63 -0
  62. package/dist/run-agent-turn.d.ts.map +1 -0
  63. package/dist/run-child.d.ts +77 -0
  64. package/dist/run-child.d.ts.map +1 -0
  65. package/dist/run-conversation-turn.d.ts +42 -0
  66. package/dist/run-conversation-turn.d.ts.map +1 -0
  67. package/dist/run-credential.d.ts +22 -0
  68. package/dist/run-credential.d.ts.map +1 -0
  69. package/dist/run-environment.d.ts +115 -0
  70. package/dist/run-environment.d.ts.map +1 -0
  71. package/dist/run-fate.d.ts +15 -0
  72. package/dist/run-fate.d.ts.map +1 -0
  73. package/dist/run-sandbox.d.ts +60 -0
  74. package/dist/run-sandbox.d.ts.map +1 -0
  75. package/dist/run-subagent.d.ts +51 -0
  76. package/dist/run-subagent.d.ts.map +1 -0
  77. package/dist/run-workflow-agent-node.d.ts +41 -0
  78. package/dist/run-workflow-agent-node.d.ts.map +1 -0
  79. package/dist/sandbox-api-context.d.ts +34 -0
  80. package/dist/sandbox-api-context.d.ts.map +1 -0
  81. package/dist/sandbox-file-registry.d.ts +9 -0
  82. package/dist/sandbox-file-registry.d.ts.map +1 -0
  83. package/dist/sandbox-files.d.ts +71 -0
  84. package/dist/sandbox-files.d.ts.map +1 -0
  85. package/dist/sandbox-handle.d.ts +15 -0
  86. package/dist/sandbox-handle.d.ts.map +1 -0
  87. package/dist/sandbox-readiness.d.ts +8 -0
  88. package/dist/sandbox-readiness.d.ts.map +1 -0
  89. package/dist/skills/built-in.d.ts +15 -0
  90. package/dist/skills/built-in.d.ts.map +1 -0
  91. package/dist/subagent-continuation.d.ts +27 -0
  92. package/dist/subagent-continuation.d.ts.map +1 -0
  93. package/dist/subagent-inbox.d.ts +53 -0
  94. package/dist/subagent-inbox.d.ts.map +1 -0
  95. package/dist/subagent-tools.d.ts +282 -0
  96. package/dist/subagent-tools.d.ts.map +1 -0
  97. package/dist/thread-context.d.ts +12 -0
  98. package/dist/thread-context.d.ts.map +1 -0
  99. package/dist/tools/attachments.d.ts +11 -0
  100. package/dist/tools/attachments.d.ts.map +1 -0
  101. package/dist/tools/bash.d.ts +60 -0
  102. package/dist/tools/bash.d.ts.map +1 -0
  103. package/dist/tools/model-spec.d.ts +4 -0
  104. package/dist/tools/model-spec.d.ts.map +1 -0
  105. package/dist/tools/read.d.ts +43 -0
  106. package/dist/tools/read.d.ts.map +1 -0
  107. package/dist/tools/result-media.d.ts +22 -0
  108. package/dist/tools/result-media.d.ts.map +1 -0
  109. package/dist/tools/result-output.d.ts +18 -0
  110. package/dist/tools/result-output.d.ts.map +1 -0
  111. package/dist/tools/tool-files.d.ts +59 -0
  112. package/dist/tools/tool-files.d.ts.map +1 -0
  113. package/dist/tools/view-file.d.ts +40 -0
  114. package/dist/tools/view-file.d.ts.map +1 -0
  115. package/dist/tsconfig.json +5 -0
  116. package/dist/turn-runtime.d.ts +19 -0
  117. package/dist/turn-runtime.d.ts.map +1 -0
  118. package/dist/types.d.ts +76 -0
  119. package/dist/types.d.ts.map +1 -0
  120. package/dist/workflow-input-attachments.d.ts +18 -0
  121. package/dist/workflow-input-attachments.d.ts.map +1 -0
  122. package/package.json +59 -4
  123. package/src/abort.ts +40 -0
  124. package/src/agent-prompt.ts +758 -0
  125. package/src/agent-runtime/errors.ts +44 -0
  126. package/src/agent-runtime/preflight.ts +314 -0
  127. package/src/agent-runtime/profile.ts +23 -0
  128. package/src/artifacts/layout-check/check.cjs +478 -0
  129. package/src/artifacts/layout-check/layout-check.ts +460 -0
  130. package/src/artifacts/materialize.ts +380 -0
  131. package/src/artifacts/publish-tool.ts +700 -0
  132. package/src/ask-parent-tool.ts +100 -0
  133. package/src/attachments.ts +850 -0
  134. package/src/child-files.ts +540 -0
  135. package/src/child-questions.ts +42 -0
  136. package/src/computer-runner.ts +284 -0
  137. package/src/context-budget.ts +161 -0
  138. package/src/context-compaction.ts +529 -0
  139. package/src/conversation-memory.ts +45 -0
  140. package/src/errors.ts +85 -0
  141. package/src/execution-plan.ts +50 -0
  142. package/src/failure.ts +71 -0
  143. package/src/family-mailbox.ts +189 -0
  144. package/src/file-ref.ts +18 -0
  145. package/src/image-attachments.ts +322 -0
  146. package/src/index.ts +54 -0
  147. package/src/message-authors.ts +77 -0
  148. package/src/message-times.ts +21 -0
  149. package/src/model-adapters.ts +227 -0
  150. package/src/model-lines.ts +28 -0
  151. package/src/requester.ts +21 -0
  152. package/src/run-agent-turn.ts +347 -0
  153. package/src/run-child.ts +319 -0
  154. package/src/run-conversation-turn.ts +257 -0
  155. package/src/run-credential.ts +55 -0
  156. package/src/run-environment.ts +769 -0
  157. package/src/run-fate.ts +51 -0
  158. package/src/run-sandbox.ts +63 -0
  159. package/src/run-subagent.ts +347 -0
  160. package/src/run-workflow-agent-node.ts +270 -0
  161. package/src/sandbox-api-context.ts +234 -0
  162. package/src/sandbox-file-registry.ts +26 -0
  163. package/src/sandbox-files.ts +326 -0
  164. package/src/sandbox-handle.ts +19 -0
  165. package/src/sandbox-readiness.ts +22 -0
  166. package/src/skills/built-in.ts +183 -0
  167. package/src/skills/sixb-artifacts/SKILL.md +95 -0
  168. package/src/skills/sixb-artifacts/canvas.md +104 -0
  169. package/src/skills/sixb-artifacts/document.md +63 -0
  170. package/src/skills/sixb-artifacts/examples/canvas/onboarding-flow/boards/first-job.html +42 -0
  171. package/src/skills/sixb-artifacts/examples/canvas/onboarding-flow/boards/region.html +29 -0
  172. package/src/skills/sixb-artifacts/examples/canvas/onboarding-flow/boards/shared.css +35 -0
  173. package/src/skills/sixb-artifacts/examples/canvas/onboarding-flow/boards/welcome.html +31 -0
  174. package/src/skills/sixb-artifacts/examples/canvas/onboarding-flow/canvas.json +107 -0
  175. package/src/skills/sixb-artifacts/examples/canvas/retro/canvas.json +158 -0
  176. package/src/skills/sixb-artifacts/examples/document/incident-report/document.md +35 -0
  177. package/src/skills/sixb-artifacts/examples/document/operations-review/document.md +41 -0
  178. package/src/skills/sixb-artifacts/examples/document/operations-review/figures/restorations.svg +1 -0
  179. package/src/skills/sixb-artifacts/examples/page/collections-desk/index.html +169 -0
  180. package/src/skills/sixb-artifacts/examples/page/collections-desk/queries/overdue.json +13 -0
  181. package/src/skills/sixb-artifacts/examples/page/dispatch-board/data/dispatch.json +234 -0
  182. package/src/skills/sixb-artifacts/examples/page/dispatch-board/index.html +245 -0
  183. package/src/skills/sixb-artifacts/examples/page/fleet-planner/data/plan.json +53 -0
  184. package/src/skills/sixb-artifacts/examples/page/fleet-planner/index.html +462 -0
  185. package/src/skills/sixb-artifacts/examples/page/service-explorer/data/service.json +276 -0
  186. package/src/skills/sixb-artifacts/examples/page/service-explorer/index.html +549 -0
  187. package/src/skills/sixb-artifacts/examples/sheet/overdue-invoices/queries/overdue.json +13 -0
  188. package/src/skills/sixb-artifacts/examples/sheet/overdue-invoices/workbook.json +30 -0
  189. package/src/skills/sixb-artifacts/examples/sheet/parts-inventory/sheets/Inventory.csv +13 -0
  190. package/src/skills/sixb-artifacts/examples/sheet/parts-inventory/sheets/Spend.csv +6 -0
  191. package/src/skills/sixb-artifacts/examples/sheet/parts-inventory/workbook.json +47 -0
  192. package/src/skills/sixb-artifacts/examples/sheet/service-metrics/sheets/Quarters.csv +5 -0
  193. package/src/skills/sixb-artifacts/examples/sheet/service-metrics/sheets/Regions.csv +5 -0
  194. package/src/skills/sixb-artifacts/examples/sheet/service-metrics/workbook.json +78 -0
  195. package/src/skills/sixb-artifacts/examples/slides/launch-plan/index.html +63 -0
  196. package/src/skills/sixb-artifacts/examples/slides/q3-review/index.html +133 -0
  197. package/src/skills/sixb-artifacts/file.md +17 -0
  198. package/src/skills/sixb-artifacts/page.md +215 -0
  199. package/src/skills/sixb-artifacts/queries.md +66 -0
  200. package/src/skills/sixb-artifacts/references.md +68 -0
  201. package/src/skills/sixb-artifacts/sheet.md +223 -0
  202. package/src/skills/sixb-artifacts/slides.md +137 -0
  203. package/src/skills/sixb-memory/SKILL.md +68 -0
  204. package/src/skills/text-assets.d.ts +25 -0
  205. package/src/subagent-continuation.ts +51 -0
  206. package/src/subagent-inbox.ts +101 -0
  207. package/src/subagent-tools.ts +1609 -0
  208. package/src/thread-context.ts +25 -0
  209. package/src/tools/attachments.ts +28 -0
  210. package/src/tools/bash.ts +217 -0
  211. package/src/tools/model-spec.ts +22 -0
  212. package/src/tools/read.ts +262 -0
  213. package/src/tools/result-media.ts +147 -0
  214. package/src/tools/result-output.ts +44 -0
  215. package/src/tools/tool-files.ts +204 -0
  216. package/src/tools/view-file.ts +155 -0
  217. package/src/turn-runtime.ts +33 -0
  218. package/src/types.ts +79 -0
  219. package/src/workflow-input-attachments.ts +140 -0
@@ -0,0 +1,68 @@
1
+ import type { AgentFileDataProjection, FileRef } from "@sixb/core";
2
+ import { type AgentRunFileStore } from "@sixb/core/internal/agents";
3
+ import type { LanguageModel } from "@sixb/core/models";
4
+ import type { AgentMessageRecord } from "@sixb/core/storage";
5
+ /**
6
+ * How many files, and bytes, a sandbox receives of a run's attachments: also what a parent Agent
7
+ * and its child hand each other.
8
+ */
9
+ export declare const SANDBOX_ATTACHMENT_LIMITS: {
10
+ readonly maxFiles: 50;
11
+ readonly fileMaxBytes: number;
12
+ readonly totalMaxBytes: number;
13
+ };
14
+ export interface PreparedAgentAttachmentContext {
15
+ readonly entries: readonly PreparedAgentAttachment[];
16
+ readonly promptTextByPartKey: ReadonlyMap<string, string>;
17
+ readonly modelFileDataByPartKey: ReadonlyMap<string, AgentFileDataProjection>;
18
+ readonly sandboxFiles: readonly PreparedSandboxAttachmentFile[];
19
+ readonly manifestJson: string;
20
+ }
21
+ export interface PreparedAgentAttachment {
22
+ readonly key: string;
23
+ readonly messageId: string;
24
+ readonly partIndex: number;
25
+ readonly fileRef: FileRef;
26
+ readonly fileName: string;
27
+ readonly mediaType: string;
28
+ readonly sizeBytes: number;
29
+ readonly contentPath: string;
30
+ readonly contentUrl: string;
31
+ readonly sandboxPath?: string;
32
+ readonly inlineDisposition: "image" | "text" | "metadata-only" | "omitted";
33
+ readonly notes: readonly string[];
34
+ }
35
+ export interface PreparedSandboxAttachmentFile {
36
+ readonly key: string;
37
+ readonly path: string;
38
+ readonly bytes: Uint8Array;
39
+ readonly fileRef: FileRef;
40
+ }
41
+ export interface PreparedAgentToolFileProjection {
42
+ readonly promptText: string;
43
+ readonly modelFileData?: AgentFileDataProjection;
44
+ }
45
+ export declare function prepareAgentAttachments(input: {
46
+ readonly projectId: string;
47
+ readonly threadId: string;
48
+ readonly messages: readonly AgentMessageRecord[];
49
+ readonly blobStorage: AgentRunFileStore;
50
+ readonly apiBaseUrl: string;
51
+ /** Where the run's files go: attachments are materialized in it. */
52
+ readonly contextDirectory: string;
53
+ readonly inlineImages: boolean;
54
+ readonly signal?: AbortSignal;
55
+ }): Promise<PreparedAgentAttachmentContext>;
56
+ /** Build the bounded, ephemeral projection of a tool-created file for the next model step. */
57
+ export declare function prepareAgentToolFileProjection(input: {
58
+ readonly fileRef: FileRef;
59
+ readonly blobStorage: AgentRunFileStore;
60
+ readonly inlineImages: boolean;
61
+ readonly signal?: AbortSignal;
62
+ readonly sandboxPath?: string;
63
+ readonly imageOmissionNote?: string;
64
+ }): Promise<PreparedAgentToolFileProjection>;
65
+ export declare function modelSupportsInlineImages(model: LanguageModel): boolean;
66
+ export declare function formatBytes(bytes: number): string;
67
+ export { attachmentKey, attachmentKeyMessageId, findMessageAttachment, toolResultAttachmentKey, } from "@sixb/core/internal/agents";
68
+ //# sourceMappingURL=attachments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../src/attachments.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAY,OAAO,EAAE,MAAM,YAAY,CAAA;AAC5E,OAAO,EAAE,KAAK,iBAAiB,EAA0B,MAAM,4BAA4B,CAAA;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAkB5D;;;GAGG;AACH,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAA;AAEV,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,OAAO,EAAE,SAAS,uBAAuB,EAAE,CAAA;IACpD,QAAQ,CAAC,mBAAmB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACzD,QAAQ,CAAC,sBAAsB,EAAE,WAAW,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAA;IAC7E,QAAQ,CAAC,YAAY,EAAE,SAAS,6BAA6B,EAAE,CAAA;IAC/D,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAC9B;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAA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8B,CAAC,CA2C1C;AAED,8FAA8F;AAC9F,wBAAsB,8BAA8B,CAAC,KAAK,EAAE;IAC1D,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAA;IACvC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAA;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CACpC,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAsF3C;AAybD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAMvE;AAoKD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIjD;AAED,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,4BAA4B,CAAA"}
@@ -0,0 +1,96 @@
1
+ import type { AgentRunFileStore } from "@sixb/core/internal/agents";
2
+ import type { SubagentRunFile } from "@sixb/core/storage";
3
+ import { type PreparedAgentAttachmentContext } from "./attachments";
4
+ import type { AgentRunFiles } from "./types";
5
+ /**
6
+ * Where a parent finds them, a directory per spawn key, in the context directory. They last for
7
+ * the turn, like the run's attachments and artifacts.
8
+ */
9
+ export declare const CHILD_FILES_DIRECTORY = "children";
10
+ /** A file a child returned, copied into its parent's sandbox for the turn. */
11
+ export interface InstalledChildFile extends SubagentRunFile {
12
+ /** As the agent names it: relative to the working directory, or absolute. */
13
+ readonly sandboxPath: string;
14
+ }
15
+ /** A file a parent hands its child, checked but not read yet. */
16
+ export interface HandedSource {
17
+ /** Where the child finds it: the path the parent named, relative to the working directory. */
18
+ readonly path: string;
19
+ /** Where it really is, every symbolic link followed. */
20
+ readonly absolutePath: string;
21
+ readonly sizeBytes?: number;
22
+ }
23
+ /**
24
+ * Check the files and directories a parent hands its child, without reading them. Refused when a
25
+ * path is missing or a link, leaves the working directory or really is the run's own context, or
26
+ * when the files pass the attachment limits.
27
+ */
28
+ export declare function listHandedSources(input: {
29
+ readonly files: AgentRunFiles;
30
+ readonly paths: readonly string[];
31
+ readonly signal: AbortSignal;
32
+ }): Promise<readonly HandedSource[]>;
33
+ /**
34
+ * Read and store the files a parent hands its child once it will be admitted, one at a time,
35
+ * against the parent's run budget: `release` them when it is not.
36
+ */
37
+ export declare function storeHandedFiles(input: {
38
+ readonly files: AgentRunFiles;
39
+ readonly sources: readonly HandedSource[];
40
+ readonly signal: AbortSignal;
41
+ }): Promise<{
42
+ readonly files: readonly SubagentRunFile[];
43
+ release(): void;
44
+ }>;
45
+ /** The references the files would be stored under, read one at a time and stored nowhere. */
46
+ export declare function handedFileRefs(input: {
47
+ readonly files: AgentRunFiles;
48
+ readonly sources: readonly HandedSource[];
49
+ readonly signal: AbortSignal;
50
+ }): Promise<readonly SubagentRunFile[]>;
51
+ /**
52
+ * The child's side: the files its parent handed over, at the same paths in its sandbox, listed in
53
+ * `$SIXB_ATTACHMENTS` and readable with `view_file`.
54
+ */
55
+ export declare function prepareHandedFiles(input: {
56
+ readonly projectId: string;
57
+ readonly parentRunId: string;
58
+ readonly files: readonly SubagentRunFile[];
59
+ /**
60
+ * The files are in the sandbox already, as a resumed workspace kept them: listed, not copied,
61
+ * so what the child changed in them stays. Those in the context directory are copied again:
62
+ * every run starts without it.
63
+ */
64
+ readonly inSandbox?: boolean;
65
+ /** The child's context directory, relative to its working directory or absolute. */
66
+ readonly contextDirectory: string;
67
+ readonly blobStorage: AgentRunFileStore;
68
+ readonly signal?: AbortSignal;
69
+ }): Promise<PreparedAgentAttachmentContext>;
70
+ /**
71
+ * Store what a child that finished wrote under `out/`, by path relative to it, against a budget of
72
+ * their own: what the child published does not count. A file its parent handed over there and the
73
+ * child left unchanged does not come back. Past the attachment limits, none comes back and `error`
74
+ * says why, so the child's answer still does.
75
+ */
76
+ export declare function storeChildOutputs(input: {
77
+ readonly files: AgentRunFiles;
78
+ readonly handed: readonly SubagentRunFile[];
79
+ readonly signal: AbortSignal;
80
+ }): Promise<{
81
+ readonly files: readonly SubagentRunFile[];
82
+ readonly error?: string;
83
+ }>;
84
+ /**
85
+ * The parent's side: copy what a child wrote under `out/` into the parent's sandbox for the turn,
86
+ * under `children/<key>/` in its context directory. Each file's reference names it by that path,
87
+ * as its `logicalPath`, and by a name no other file of the child shares, so a later turn tells
88
+ * them apart in `$SIXB_ATTACHMENTS`.
89
+ */
90
+ export declare function installChildOutputs(input: {
91
+ readonly files: AgentRunFiles;
92
+ readonly key: string;
93
+ readonly outputs: readonly SubagentRunFile[];
94
+ readonly signal: AbortSignal;
95
+ }): Promise<readonly InstalledChildFile[]>;
96
+ //# sourceMappingURL=child-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child-files.d.ts","sourceRoot":"","sources":["../src/child-files.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAEnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAGzD,OAAO,EAEL,KAAK,8BAA8B,EAEpC,MAAM,eAAe,CAAA;AAatB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAS5C;;;GAGG;AACH,eAAO,MAAM,qBAAqB,aAAa,CAAA;AAe/C,8EAA8E;AAC9E,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD,6EAA6E;IAC7E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAC7B;AAED,iEAAiE;AACjE,MAAM,WAAW,YAAY;IAC3B,8FAA8F;IAC9F,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,wDAAwD;IACxD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED;;;;GAIG;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,WAAW,CAAA;CAC9B,GAAG,OAAO,CAAC,8BAA8B,CAAC,CA6C1C;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE;IAC7C,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;IAC7B,QAAQ,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAA;IAC3C,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;CAC7B,GAAG,OAAO,CAAC;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAuDnF;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE;IAC/C,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,CAAA;IAC5C,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;CAC7B,GAAG,OAAO,CAAC,SAAS,kBAAkB,EAAE,CAAC,CA2BzC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * A question a child asked: the id of its mail and what it asks. A child paused on it keeps both in
3
+ * its thread, the text as its `ask_parent` call's input and the id in that call's output.
4
+ */
5
+ export interface QuestionRef {
6
+ readonly id: string;
7
+ readonly text: string;
8
+ }
9
+ /** A question a child of the turn asked. */
10
+ export interface ChildQuestion extends QuestionRef {
11
+ /** The child that asked it, waiting for the answer. */
12
+ readonly runId: string;
13
+ }
14
+ /**
15
+ * What the Agent reads for its children's questions it has not seen yet, or, `earlier`, for the
16
+ * children of earlier turns paused on theirs. The children's text is escaped: it must not close the
17
+ * block or pass for one of Sixb's own.
18
+ */
19
+ export declare function renderChildQuestions(questions: readonly (QuestionRef & {
20
+ readonly key: string;
21
+ })[], options?: {
22
+ readonly earlier?: boolean;
23
+ }): string;
24
+ //# sourceMappingURL=child-questions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child-questions.d.ts","sourceRoot":"","sources":["../src/child-questions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAED,4CAA4C;AAC5C,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,uDAAuD;IACvD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,SAAS,CAAC,WAAW,GAAG;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,EAC9D,OAAO,GAAE;IAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAC3C,MAAM,CAcR"}
@@ -0,0 +1,65 @@
1
+ import type { Sandbox, SandboxRequestCredential } from "@sixb/core";
2
+ /** Opens the sandbox a computer's run works in. */
3
+ export type OpenComputerSandbox = (input: {
4
+ /** The user's folder, for a turn; absent for a child, which works in a folder of its own. */
5
+ readonly workingDirectory?: string;
6
+ /** Where the run's own files go, outside the folder: its commands may write there too. */
7
+ readonly runFiles: string;
8
+ /** The run's token, which the sandbox adds outside its commands. */
9
+ readonly credential: SandboxRequestCredential;
10
+ readonly signal: AbortSignal;
11
+ }) => Promise<Sandbox>;
12
+ export interface ComputerRunnerOptions {
13
+ /** The project's API origin. */
14
+ readonly apiUrl: string;
15
+ /** The user's own credential, as an `Authorization` header value, read for each claim. */
16
+ authorization(): Promise<string>;
17
+ /**
18
+ * This computer's id, which each claim names: a thread runs on one of its owner's computers, and
19
+ * only that one claims its turns.
20
+ */
21
+ computerId(): Promise<string>;
22
+ /** The folder the user's turns work in. */
23
+ readonly folder: string;
24
+ /** Where each run's own files go, a directory per run, removed when the run ends. */
25
+ readonly runFilesRoot: string;
26
+ readonly openSandbox: OpenComputerSandbox;
27
+ /** How many children of one turn run at once. Defaults to 4. */
28
+ readonly childCapacity?: number;
29
+ /** A run that failed, once its end is recorded. */
30
+ readonly onFailure?: (error: unknown) => void;
31
+ readonly fetch?: (request: Request) => Promise<Response>;
32
+ }
33
+ export declare class ComputerRunner {
34
+ private readonly options;
35
+ private readonly teardowns;
36
+ /** Each running turn's renewal, by run id, to renew at once. */
37
+ private readonly renewals;
38
+ constructor(options: ComputerRunnerOptions);
39
+ /**
40
+ * Claim a queued turn and run it to its end. False when it was not this computer's to run: it
41
+ * ended already, or another runner holds it. `signal` stops the runner: the turn ends
42
+ * interrupted, its end recorded.
43
+ */
44
+ runTurn(runId: string, signal: AbortSignal): Promise<boolean>;
45
+ /**
46
+ * Renew a running turn's lease now rather than at its next renewal: its answer carries a cancel
47
+ * just asked for, so a stop from this computer takes effect at once.
48
+ */
49
+ renewNow(runId: string): void;
50
+ /** Wait for sandbox teardowns that outlived their runs. */
51
+ drain(): Promise<void>;
52
+ /**
53
+ * Renew the turn's lease, and its children's, until stopped. A renewal answers a cancel; one
54
+ * that finds the turn no longer this computer's stops it.
55
+ */
56
+ private renew;
57
+ private childRunner;
58
+ /**
59
+ * A run's sandbox: the user's folder for a turn, which the prompt describes, or a blank folder
60
+ * of its own for a child. Its own files go in a directory of their own, outside the folder.
61
+ */
62
+ private sandbox;
63
+ private track;
64
+ }
65
+ //# sourceMappingURL=computer-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computer-runner.d.ts","sourceRoot":"","sources":["../src/computer-runner.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAqBnE,mDAAmD;AACnD,MAAM,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE;IACxC,6FAA6F;IAC7F,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAClC,0FAA0F;IAC1F,Q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,IAAI,CAAC;IAI5B;;;OAGG;IACH,OAAO,CAAC,KAAK;IAsBb,OAAO,CAAC,WAAW;IAiCnB;;;OAGG;IACH,OAAO,CAAC,OAAO;IAoCf,OAAO,CAAC,KAAK;CAId"}
@@ -0,0 +1,28 @@
1
+ import { type LanguageModel, type LanguageModelDefinition, type ModelReasoning } from "@sixb/core/models";
2
+ export interface AgentContextBudget {
3
+ readonly windowTokens: number;
4
+ readonly inputBudgetTokens: number;
5
+ readonly reserveTokens: number;
6
+ readonly keepRecentTokens: number;
7
+ readonly source: "model" | "fallback";
8
+ }
9
+ interface AgentModelSelection {
10
+ readonly model: LanguageModel;
11
+ readonly reasoning?: ModelReasoning;
12
+ }
13
+ /**
14
+ * Derive the model's input and output budgets from its definition, and cap each call's output to
15
+ * them. The model comes pinned: whoever hands it over resolved it once for the run.
16
+ */
17
+ export declare function prepareAgentModel(selection: AgentModelSelection): {
18
+ readonly model: LanguageModel;
19
+ readonly budget: AgentContextBudget;
20
+ };
21
+ /**
22
+ * Input-only limits are a conservative window: leave the same reserve without inventing a total.
23
+ * The reserve is the output every call is guaranteed, not its ceiling, so it stays small and a
24
+ * larger output limit never shrinks the input budget.
25
+ */
26
+ export declare function resolveAgentContextBudget(selection: AgentModelSelection, definition?: LanguageModelDefinition): AgentContextBudget;
27
+ export {};
28
+ //# sourceMappingURL=context-budget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-budget.d.ts","sourceRoot":"","sources":["../src/context-budget.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAE5B,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAA;AAI1B,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAA;IAClC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,UAAU,CAAA;CACtC;AAED,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,cAAc,CAAA;CACpC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,mBAAmB,GAAG;IACjE,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;IAC7B,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAA;CACpC,CAoCA;AAyCD;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,mBAAmB,EAC9B,UAAU,GAAE,uBAAoD,GAC/D,kBAAkB,CAkCpB"}
@@ -0,0 +1,48 @@
1
+ import { type AgentContextEstimateTool, type AgentRunSession, type AgentTurnHistory } from "@sixb/core/internal/agents";
2
+ import type { OntologyDocsIndexEntry } from "@sixb/core/internal/ontology";
3
+ import type { ModelTool } from "@sixb/core/models";
4
+ import type { ConversationAgentRunRecord } from "@sixb/core/storage";
5
+ import type { AgentContextBudget } from "./context-budget";
6
+ import type { ConversationMemory } from "./conversation-memory";
7
+ import type { ResolvedAgentExecutionPlan } from "./execution-plan";
8
+ import { type ConversationReaders } from "./message-authors";
9
+ import { type LoadedAgentThreadModelContext } from "./thread-context";
10
+ import type { AgentTurnRuntime } from "./turn-runtime";
11
+ import type { AgentExecutionContext } from "./types";
12
+ export interface PreparedAgentConversationContext {
13
+ readonly threadContext: LoadedAgentThreadModelContext;
14
+ /** The memory the run's prompt shows, as of the active checkpoint. */
15
+ readonly memory?: ConversationMemory;
16
+ }
17
+ /** Memory as of a checkpoint's creation, or of the thread's start when there is none. */
18
+ export type LoadConversationMemory = (checkpoint: {
19
+ readonly createdAt: Date;
20
+ } | null) => Promise<ConversationMemory | undefined>;
21
+ /** Load, estimate, and—when required—compact one admitted conversational run before setup. */
22
+ export declare function prepareAgentConversationContext(input: {
23
+ readonly context: AgentExecutionContext;
24
+ /** The turn's session: its history, the checkpoint it writes, and the records it publishes. */
25
+ readonly session: AgentRunSession;
26
+ readonly plan: ResolvedAgentExecutionPlan;
27
+ /** The ontology files listed in the conversation's prompt. */
28
+ readonly ontologyIndex?: readonly OntologyDocsIndexEntry[];
29
+ /** Where the run's files go, as the prompt names them. */
30
+ readonly contextDirectory: string;
31
+ readonly budget: AgentContextBudget;
32
+ readonly run: ConversationAgentRunRecord;
33
+ /** The conversation's history as the turn started. */
34
+ readonly history: AgentTurnHistory;
35
+ /** Who can read the run's thread: in a shared one, who wrote what counts toward the estimate. */
36
+ readonly conversation?: ConversationReaders;
37
+ readonly runtime: AgentTurnRuntime;
38
+ readonly frameworkTools?: readonly ModelTool[];
39
+ readonly loadMemory?: LoadConversationMemory;
40
+ }): Promise<PreparedAgentConversationContext>;
41
+ /** Conservatively combine matching provider usage with the current deterministic request shape. */
42
+ export declare function estimateAgentConversationInputTokens(input: {
43
+ readonly plan: ResolvedAgentExecutionPlan;
44
+ readonly threadContext: LoadedAgentThreadModelContext;
45
+ readonly systemPrompt: string;
46
+ readonly tools: readonly AgentContextEstimateTool[];
47
+ }): number;
48
+ //# sourceMappingURL=context-compaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-compaction.d.ts","sourceRoot":"","sources":["../src/context-compaction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAE7B,KAAK,eAAe,EAEpB,KAAK,gBAAgB,EAStB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,KAAK,EAIV,0BAA0B,EAC3B,MAAM,oBAAoB,CAAA;AAG3B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EA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AC,OAAO,EAAE,gBAAgB,CAAA;IAClC,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,SAAS,EAAE,CAAA;IAC9C,QAAQ,CAAC,UAAU,CAAC,EAAE,sBAAsB,CAAA;CAC7C,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAyL5C;AAED,mGAAmG;AACnG,wBAAgB,oCAAoC,CAAC,KAAK,EAAE;IAC1D,QAAQ,CAAC,IAAI,EAAE,0BAA0B,CAAA;IACzC,QAAQ,CAAC,aAAa,EAAE,6BAA6B,CAAA;IACrD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,KAAK,EAAE,SAAS,wBAAwB,EAAE,CAAA;CACpD,GAAG,MAAM,CAiCT"}
@@ -0,0 +1,21 @@
1
+ import type { AgentMemoryRepoView } from "@sixb/core";
2
+ import type { AgentRunSession } from "@sixb/core/internal/agents";
3
+ import type { AgentMemoryPromptContext } from "./agent-prompt";
4
+ /** The Agent's memory for one conversational run. */
5
+ export interface ConversationMemory {
6
+ /** Installed under `$SIXB_MEMORY_DIR` at their latest revision, for the Agent to read and save. */
7
+ readonly repos: readonly AgentMemoryRepoView[];
8
+ /** Each repo's `MEMORY.md` as of the time the prompt is frozen at. */
9
+ readonly prompt: AgentMemoryPromptContext;
10
+ }
11
+ /**
12
+ * The repos the run's requester can read, through its session. The prompt shows each `MEMORY.md` as
13
+ * it was at `asOf`, the start of the thread or its latest compaction, so a save leaves the prompt
14
+ * and its cache as they are until the context is next compacted; the installed files are the
15
+ * latest.
16
+ */
17
+ export declare function loadConversationMemory(input: {
18
+ readonly session: Pick<AgentRunSession, "memory">;
19
+ readonly asOf: Date;
20
+ }): Promise<ConversationMemory | undefined>;
21
+ //# sourceMappingURL=conversation-memory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation-memory.d.ts","sourceRoot":"","sources":["../src/conversation-memory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAE9D,qDAAqD;AACrD,MAAM,WAAW,kBAAkB;IACjC,mGAAmG;IACnG,QAAQ,CAAC,KAAK,EAAE,SAAS,mBAAmB,EAAE,CAAA;IAC9C,sEAAsE;IACtE,QAAQ,CAAC,MAAM,EAAE,wBAAwB,CAAA;CAC1C;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,KAAK,EAAE;IAClD,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAA;IACjD,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;CACpB,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAkB1C"}
@@ -0,0 +1,46 @@
1
+ import { AgentToolPublicError } from "@sixb/core";
2
+ import type { AgentCompactionFailureCode } from "@sixb/core/agents/streams";
3
+ /** A thread could not complete its required preflight compaction. */
4
+ export declare class AgentContextCompactionError extends Error {
5
+ readonly code: AgentCompactionFailureCode;
6
+ readonly runId: string;
7
+ readonly name = "AgentContextCompactionError";
8
+ constructor(code: AgentCompactionFailureCode, runId: string, message: string, options?: ErrorOptions);
9
+ }
10
+ /**
11
+ * Whoever asked for a queued turn no longer owns or takes part in its thread: they left it, or its
12
+ * owner removed them. The turn ends cancelled without reaching the model.
13
+ */
14
+ export declare class AgentRequesterLeftThreadError extends Error {
15
+ readonly runId: string;
16
+ readonly name = "AgentRequesterLeftThreadError";
17
+ constructor(runId: string);
18
+ }
19
+ /**
20
+ * Whether this delivery lost its run: its execution token, or its queue lease, which `signal` (the
21
+ * delivery's) may carry. The current owner records the run's fate; this delivery touches nothing.
22
+ */
23
+ export declare function isLostExecution(error: unknown, signal?: AbortSignal): boolean;
24
+ /**
25
+ * Throw why a runner lost its run, if that is why `signal` aborted: its execution token went to
26
+ * another runner, or a queue took back its delivery.
27
+ */
28
+ export declare function throwIfExecutionLost(signal: AbortSignal): void;
29
+ /** Keep an untrusted tool failure as the cause while exposing only a generic message to the model. */
30
+ export declare class AgentToolExecutionError extends Error {
31
+ readonly toolName: string;
32
+ readonly name = "AgentToolExecutionError";
33
+ constructor(toolName: string, options: ErrorOptions);
34
+ }
35
+ /** A selected agent tool returned a value that cannot cross the durable message boundary. */
36
+ export declare class AgentToolOutputError extends AgentToolPublicError {
37
+ readonly toolName: string;
38
+ readonly name = "AgentToolOutputError";
39
+ constructor(toolName: string, reason: string, options?: ErrorOptions);
40
+ }
41
+ /** Failed preservation is a failure even when the run was also cancelled. */
42
+ export declare class AgentEnvironmentSaveError extends Error {
43
+ readonly name = "AgentEnvironmentSaveError";
44
+ constructor();
45
+ }
46
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAA;AAI3E,qEAAqE;AACrE,qBAAa,2BAA4B,SAAQ,KAAK;IAIlD,QAAQ,CAAC,IAAI,EAAE,0BAA0B;IACzC,QAAQ,CAAC,KAAK,EAAE,MAAM;IAJxB,QAAQ,CAAC,IAAI,iCAAgC;gBAGlC,IAAI,EAAE,0BAA0B,EAChC,KAAK,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,YAAY;CAIzB;AAED;;;GAGG;AACH,qBAAa,6BAA8B,SAAQ,KAAK;IAG1C,QAAQ,CAAC,KAAK,EAAE,MAAM;IAFlC,QAAQ,CAAC,IAAI,mCAAkC;gBAE1B,KAAK,EAAE,MAAM;CAKnC;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAE7E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAE9D;AAMD,sGAAsG;AACtG,qBAAa,uBAAwB,SAAQ,KAAK;IAI9C,QAAQ,CAAC,QAAQ,EAAE,MAAM;IAH3B,QAAQ,CAAC,IAAI,6BAA4B;gBAG9B,QAAQ,EAAE,MAAM,EACzB,OAAO,EAAE,YAAY;CAIxB;AAED,6FAA6F;AAC7F,qBAAa,oBAAqB,SAAQ,oBAAoB;IAG1D,QAAQ,CAAC,QAAQ,EAAE,MAAM;IAF3B,SAAkB,IAAI,0BAAyB;gBAEpC,QAAQ,EAAE,MAAM,EACzB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,YAAY;CAIzB;AAED,6EAA6E;AAC7E,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,QAAQ,CAAC,IAAI,+BAA8B;;CAK5C"}
@@ -0,0 +1,34 @@
1
+ import type { AgentReasoning, AgentSkillDefinition } from "@sixb/core";
2
+ import type { AgentRunPlan, AgentToolSpec, SandboxModel } from "@sixb/core/internal/agents";
3
+ import type { RenderedOntologyDocs } from "@sixb/core/internal/ontology";
4
+ import type { LanguageModel } from "@sixb/core/models";
5
+ /**
6
+ * Fully resolved inputs shared by the agent execution engines.
7
+ *
8
+ * This internal runtime value is neither a durable run nor a public API contract. Source-specific
9
+ * adapters resolve it before entering the shared execution path.
10
+ */
11
+ export interface ResolvedAgentExecutionPlan {
12
+ readonly model: LanguageModel;
13
+ readonly reasoning?: AgentReasoning;
14
+ readonly instructions?: string;
15
+ /** The project tools it offers, as the model is offered them; they run where the project is. */
16
+ readonly tools: readonly AgentToolSpec[];
17
+ /** Agent Skills installed in the sandbox and listed in the prompt. */
18
+ readonly skills: readonly AgentSkillDefinition[];
19
+ /** The requester's time zone and locale, when the run captured them. */
20
+ readonly timeZone?: string;
21
+ readonly locale?: string;
22
+ /** Models the sandbox CLI can call beside the agent's own, listed in the prompt. */
23
+ readonly sandboxModels?: readonly SandboxModel[];
24
+ /** Reference docs for the object types the run's requester can see, from their own view. */
25
+ readonly ontologyDocs: RenderedOntologyDocs;
26
+ }
27
+ /**
28
+ * A turn's or a child's plan, with the session's model, which records each call itself, and the
29
+ * harness's skills added. Its project tools run through the session.
30
+ */
31
+ export declare function resolveRunPlan(plan: AgentRunPlan, resolved: {
32
+ readonly model: LanguageModel;
33
+ }): ResolvedAgentExecutionPlan;
34
+ //# sourceMappingURL=execution-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execution-plan.d.ts","sourceRoot":"","sources":["../src/execution-plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGtD;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,cAAc,CAAA;IACnC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;IAC9B,gGAAgG;IAChG,QAAQ,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAA;IACxC,sEAAsE;IACtE,QAAQ,CAAC,MAAM,EAAE,SAAS,oBAAoB,EAAE,CAAA;IAChD,wEAAwE;IACxE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,oFAAoF;IACpF,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,YAAY,EAAE,CAAA;IAChD,4FAA4F;IAC5F,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAA;CAC5C;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;CAAE,GAC1C,0BAA0B,CAa5B"}
@@ -0,0 +1,14 @@
1
+ import type { SixbFailure } from "@sixb/core";
2
+ import { type AgentRunFailureCode } from "@sixb/core/storage";
3
+ export type AgentRunFailure = SixbFailure<AgentRunFailureCode>;
4
+ interface AgentFailureInput {
5
+ readonly status: "failed" | "cancelled";
6
+ readonly at: Date;
7
+ readonly details: Readonly<Record<string, string>>;
8
+ }
9
+ /** Normalize a failure without changing its classification. Used outside active execution. */
10
+ export declare function toAgentRunFailure(error: unknown, input: AgentFailureInput): AgentRunFailure;
11
+ /** Classify only work performed by an active Agent execution. */
12
+ export declare function toAgentExecutionFailure(error: unknown, input: AgentFailureInput): AgentRunFailure;
13
+ export {};
14
+ //# sourceMappingURL=failure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"failure.d.ts","sourceRoot":"","sources":["../src/failure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAO7C,OAAO,EAA2B,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAGtF,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,mBAAmB,CAAC,CAAA;AAE9D,UAAU,iBAAiB;IACzB,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IACvC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAA;IACjB,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CACnD;AAED,8FAA8F;AAC9F,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,iBAAiB,GAAG,eAAe,CAQ3F;AAED,iEAAiE;AACjE,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,iBAAiB,GAAG,eAAe,CAIjG"}
@@ -0,0 +1,60 @@
1
+ import type { ChildQuestion, QuestionRef } from "./child-questions";
2
+ /** What a turn sends one of its children: a message, or a reply to its question. */
3
+ export interface ChildMail {
4
+ /** Names the turn's tool call, so a replay of the call sends nothing twice. */
5
+ readonly id: string;
6
+ readonly kind: "message" | "answer" | "deferred";
7
+ readonly text: string;
8
+ /** The question a reply answers. */
9
+ readonly inReplyTo?: string;
10
+ }
11
+ /** A message a child had not read when it stopped. */
12
+ export type UnreadChildMail = Pick<ChildMail, "id" | "text">;
13
+ /** The child stopped reading: it paused or ended, so mail sent to it now would never be read. */
14
+ export declare class ChildMailClosedError extends Error {
15
+ readonly childRunId: string;
16
+ readonly name = "ChildMailClosedError";
17
+ constructor(childRunId: string);
18
+ }
19
+ /** One child's side of its turn's mailbox. */
20
+ export interface ChildMailbox {
21
+ /** The messages sent since the last take, in the order they were sent. */
22
+ take(): readonly UnreadChildMail[];
23
+ /** Ask the turn, and wait for its reply: an answer, or `deferred` when the turn ends first. */
24
+ ask(question: QuestionRef, signal: AbortSignal): Promise<ChildMail>;
25
+ /** Stop reading: what came and was never taken is returned, and later mail is refused. */
26
+ close(): readonly UnreadChildMail[];
27
+ }
28
+ /**
29
+ * The mail between a turn and the children it runs, held in their runner, one per turn. The turn
30
+ * sends its children messages and replies, and hears their questions and their ends; each child
31
+ * takes its messages at its step boundaries and asks its questions.
32
+ */
33
+ export declare class FamilyMailbox {
34
+ #private;
35
+ /**
36
+ * Send a child mail. Sent twice under one id, it arrives once. Throws
37
+ * {@link ChildMailClosedError} once the child stopped reading, or the turn ended.
38
+ */
39
+ send(childRunId: string, mail: ChildMail): void;
40
+ /** The child's side, for its runner: mail sent before it started is there already. */
41
+ child(childRunId: string): ChildMailbox;
42
+ /** The questions the turn's children wait on, in the order they asked. */
43
+ questions(): readonly ChildQuestion[];
44
+ /** The question `childRunId` waits on, if any. */
45
+ question(childRunId: string): ChildQuestion | undefined;
46
+ /** The turn took the question to answer it: no other answer is sent to it. */
47
+ answered(question: ChildQuestion): void;
48
+ /** Open again a question its answer could not be sent to. */
49
+ reopen(question: ChildQuestion): void;
50
+ /** A child's run ended, or paused: its runner says so, and the turn's waits wake. */
51
+ finished(childRunId: string): void;
52
+ /**
53
+ * Settles when a child asks or finishes. Take it before reading what it wakes for, so what
54
+ * comes during the read wakes the wait.
55
+ */
56
+ changed(): Promise<void>;
57
+ /** The turn ended: it sends nothing more. */
58
+ close(): void;
59
+ }
60
+ //# sourceMappingURL=family-mailbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"family-mailbox.d.ts","sourceRoot":"","sources":["../src/family-mailbox.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAMnE,oFAAoF;AACpF,MAAM,WAAW,SAAS;IACxB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAA;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,oCAAoC;IACpC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,sDAAsD;AACtD,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC,CAAA;AAE5D,iGAAiG;AACjG,qBAAa,oBAAqB,SAAQ,KAAK;IAEjC,QAAQ,CAAC,UAAU,EAAE,MAAM;IADvC,QAAQ,CAAC,IAAI,0BAAyB;gBACjB,UAAU,EAAE,MAAM;CAGxC;AAED,8CAA8C;AAC9C,MAAM,WAAW,YAAY;IAC3B,0EAA0E;IAC1E,IAAI,IAAI,SAAS,eAAe,EAAE,CAAA;IAClC,+FAA+F;IAC/F,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;IACnE,0FAA0F;IAC1F,KAAK,IAAI,SAAS,eAAe,EAAE,CAAA;CACpC;AAED;;;;GAIG;AACH,qBAAa,aAAa;;IAOxB;;;OAGG;IACH,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI;IAK/C,sFAAsF;IACtF,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,YAAY;IAIvC,0EAA0E;IAC1E,SAAS,IAAI,SAAS,aAAa,EAAE;IAIrC,kDAAkD;IAClD,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAIvD,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAMvC,6DAA6D;IAC7D,MAAM,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAIrC,qFAAqF;IACrF,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAMlC;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAWxB,6CAA6C;IAC7C,KAAK,IAAI,IAAI;CA2Bd"}
@@ -0,0 +1,6 @@
1
+ import type { FileRef } from "@sixb/core";
2
+ /** Content identity used only where byte-for-byte duplicates should collapse. */
3
+ export declare function fileContentKey(fileRef: FileRef): string;
4
+ /** Exact reference identity for metadata-sensitive lookups such as sandbox paths. */
5
+ export declare function fileRefKey(fileRef: FileRef): string;
6
+ //# sourceMappingURL=file-ref.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-ref.d.ts","sourceRoot":"","sources":["../src/file-ref.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEvD;AAED,qFAAqF;AACrF,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CASnD"}
@@ -0,0 +1,34 @@
1
+ export interface AgentAttachmentLimits {
2
+ readonly textInlineMaxBytes: number;
3
+ readonly textInlineMaxLines: number;
4
+ readonly imageMaxWidth: number;
5
+ readonly imageMaxHeight: number;
6
+ readonly imageMaxBase64Bytes: number;
7
+ readonly imageJpegQualities: readonly number[];
8
+ readonly imageMaxPixels: number;
9
+ readonly sandboxFileMaxBytes: number;
10
+ readonly sandboxTotalMaxBytes: number;
11
+ }
12
+ export type ProcessedAgentImage = {
13
+ readonly ok: true;
14
+ readonly dataUrl: URL;
15
+ readonly mediaType: "image/png" | "image/jpeg" | "image/webp" | "image/gif";
16
+ readonly width: number;
17
+ readonly height: number;
18
+ readonly originalWidth: number;
19
+ readonly originalHeight: number;
20
+ readonly wasResized: boolean;
21
+ readonly notes: readonly string[];
22
+ } | {
23
+ readonly ok: false;
24
+ readonly reason: string;
25
+ readonly notes: readonly string[];
26
+ };
27
+ export declare function processAgentImageAttachment(input: {
28
+ readonly bytes: Uint8Array;
29
+ readonly declaredMediaType?: string;
30
+ readonly fileName?: string;
31
+ readonly limits: AgentAttachmentLimits;
32
+ readonly signal?: AbortSignal;
33
+ }): Promise<ProcessedAgentImage>;
34
+ //# sourceMappingURL=image-attachments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-attachments.d.ts","sourceRoot":"","sources":["../src/image-attachments.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;IACnC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;IACnC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAA;IACpC,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,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