@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,51 @@
1
+ import { type AgentRunSession } from "@sixb/core/internal/agents";
2
+ import type { ModelStep } from "@sixb/core/models";
3
+ import { type AgentThreadRecord, type AppendAgentMessageInput, type SubagentRunRecord } from "@sixb/core/storage";
4
+ import type { ResolvedAgentExecutionPlan } from "./execution-plan";
5
+ import type { SubagentHistory } from "./subagent-continuation";
6
+ import type { SubagentInbox } from "./subagent-inbox";
7
+ import type { AgentTurnRuntime } from "./turn-runtime";
8
+ import type { AgentRunFiles, AgentTurnContext } from "./types";
9
+ /**
10
+ * What a child did so far, kept in its thread however its run ends: a failed or stopped child
11
+ * keeps it as an interrupted turn does. Its steps, and each message its parent sent it where it
12
+ * read it.
13
+ */
14
+ export interface SubagentWork {
15
+ messages?: readonly AppendAgentMessageInput[];
16
+ }
17
+ /**
18
+ * Run one child in its thread. Its request is the thread's messages, the task dated at the thread's
19
+ * creation; what it did is the thread's next message, written with its finish. A held call stops it
20
+ * after that step: it pauses, and its thread's next run continues it once the call is decided.
21
+ */
22
+ export declare function runSubagent(input: {
23
+ readonly context: AgentTurnContext;
24
+ readonly plan: ResolvedAgentExecutionPlan;
25
+ readonly run: SubagentRunRecord;
26
+ /** The child's session: its finish is fenced by the run's execution token. */
27
+ readonly session: AgentRunSession;
28
+ /** The child's own thread, and what its runs before this one left there. */
29
+ readonly thread: AgentThreadRecord;
30
+ readonly history: SubagentHistory;
31
+ /** Created by the worker before the run's tools, which share its signal and accounting. */
32
+ readonly runtime: AgentTurnRuntime;
33
+ /** Filled once the model loop returns, for the worker to keep when the run fails afterwards. */
34
+ readonly work?: SubagentWork;
35
+ /** Where it finds the files its parent handed over, and leaves the ones it returns. */
36
+ readonly runFiles: AgentRunFiles;
37
+ /**
38
+ * What its parent sends it while it runs, read before its next step, and the questions it asks,
39
+ * through the inbox's `ask_parent` among its tools.
40
+ */
41
+ readonly inbox: SubagentInbox;
42
+ }): Promise<SubagentRunRecord>;
43
+ /**
44
+ * What the child answers: the text it wrote once its last local tool returned, through any provider
45
+ * continuation, and after the last message its parent sent it (read after `lastMessageAt` steps),
46
+ * which an answer written before it no longer answers. Without any, the last text it wrote, such
47
+ * as an answer it gave before a final tool call. Narration written before earlier tool calls never
48
+ * reaches the parent.
49
+ */
50
+ export declare function subagentAnswer(steps: readonly ModelStep[], lastMessageAt?: number): string;
51
+ //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;IACvF,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAA;IAChC;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;CAC9B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAkD7B;AAgND;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,EAAE,aAAa,SAAI,GAAG,MAAM,CASrF"}
@@ -0,0 +1,41 @@
1
+ import type { AgentMessagePart, ValueType } from "@sixb/core";
2
+ import { type AgentStepDefinition, type WorkflowIOSnapshot } from "@sixb/core/internal/workflows";
3
+ import { type AgentRunFinishReason, coerceAgentRunFinishReason } from "@sixb/core/storage";
4
+ import type { ResolvedAgentExecutionPlan } from "./execution-plan";
5
+ import type { AgentTurnContext } from "./types";
6
+ export interface RunWorkflowAgentNodeInput {
7
+ readonly context: AgentTurnContext;
8
+ readonly agentStepId: string;
9
+ readonly plan: ResolvedAgentExecutionPlan;
10
+ readonly agentStep: AgentStepDefinition;
11
+ readonly workflowId: string;
12
+ readonly workflowRunId: string;
13
+ readonly nodeRunId: string;
14
+ readonly prompt: string;
15
+ /** When the node run was created; dates the prompt for the model. */
16
+ readonly createdAt: Date;
17
+ readonly valueTypesById: ReadonlyMap<string, ValueType>;
18
+ /** The node's signal, which the caller also applies to its tools' model calls. */
19
+ readonly signal: AbortSignal;
20
+ }
21
+ export interface WorkflowAgentNodeResult {
22
+ readonly output: WorkflowIOSnapshot;
23
+ readonly modelId: string;
24
+ readonly finishReason: NonNullable<ReturnType<typeof coerceAgentRunFinishReason>>;
25
+ readonly trace: readonly AgentMessagePart[];
26
+ }
27
+ export type WorkflowAgentFailurePhase = "output-preflight" | "agent-loop" | "structured-finalizer";
28
+ /** Carries best-effort debug context across the workflow node's terminal error boundary. */
29
+ export declare class WorkflowAgentNodeExecutionError extends Error {
30
+ readonly phase: WorkflowAgentFailurePhase;
31
+ readonly finishReason?: AgentRunFinishReason;
32
+ readonly trace: readonly AgentMessagePart[];
33
+ constructor(input: {
34
+ readonly phase: WorkflowAgentFailurePhase;
35
+ readonly finishReason?: AgentRunFinishReason;
36
+ readonly trace: readonly AgentMessagePart[];
37
+ readonly cause: unknown;
38
+ });
39
+ }
40
+ export declare function runWorkflowAgentNode(input: RunWorkflowAgentNodeInput): Promise<WorkflowAgentNodeResult>;
41
+ //# sourceMappingURL=run-workflow-agent-node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-workflow-agent-node.d.ts","sourceRoot":"","sources":["../src/run-workflow-agent-node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAe,SAAS,EAAE,MAAM,YAAY,CAAA;AAI1E,OAAO,EACL,KAAK,mBAAmB,EAGxB,KAAK,kBAAkB,EACxB,MAAM,+BAA+B,CAAA;AAGtC,OAAO,EAAE,KAAK,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAA;AAE1F,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAA;AAGlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAI/C,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAA;IAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,IAAI,EAAE,0BAA0B,CAAA;IACzC,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAA;IACvC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,qEAAqE;IACrE,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAA;IACxB,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IACvD,kFAAkF;IAClF,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;CAC7B;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAA;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC,CAAA;IACjF,QAAQ,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAA;CAC5C;AAED,MAAM,MAAM,yBAAyB,GAAG,kBAAkB,GAAG,YAAY,GAAG,sBAAsB,CAAA;AAElG,4FAA4F;AAC5F,qBAAa,+BAAgC,SAAQ,KAAK;IACxD,QAAQ,CAAC,KAAK,EAAE,yBAAyB,CAAA;IACzC,QAAQ,CAAC,YAAY,CAAC,EAAE,oBAAoB,CAAA;IAC5C,QAAQ,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAA;gBAE/B,KAAK,EAAE;QACjB,QAAQ,CAAC,KAAK,EAAE,yBAAyB,CAAA;QACzC,QAAQ,CAAC,YAAY,CAAC,EAAE,oBAAoB,CAAA;QAC5C,QAAQ,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAA;QAC3C,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;KACxB;CAOF;AAED,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,yBAAyB,GAC/B,OAAO,CAAC,uBAAuB,CAAC,CAyMlC"}
@@ -0,0 +1,34 @@
1
+ import type { AgentMemoryRepoView, AgentProjectFile, AgentSkillDefinition, Sandbox } from "@sixb/core";
2
+ import type { MaterializedArtifacts } from "./artifacts/materialize";
3
+ import type { PreparedAgentAttachmentContext } from "./attachments";
4
+ /**
5
+ * Where a conversation's artifacts are installed, and their manifest, relative to the context
6
+ * directory. A sandbox that outlives the run clears that directory when it opens, so each run's
7
+ * install starts empty.
8
+ */
9
+ export declare const AGENT_ARTIFACTS_DIRECTORY = "artifacts";
10
+ export declare const AGENT_ARTIFACTS_MANIFEST = "context/artifacts.json";
11
+ export interface AgentSandboxApiContext {
12
+ readonly env: Readonly<Record<string, string>>;
13
+ }
14
+ export interface PrepareAgentSandboxApiContextInput {
15
+ readonly sandbox: Sandbox;
16
+ /** Where the run's files go: relative to the working directory, or absolute. */
17
+ readonly contextDirectory: string;
18
+ /** The API origin; commands reach it at the sandbox's credentialed address for it. */
19
+ readonly apiBaseUrl: string;
20
+ readonly projectId: string;
21
+ readonly actorId?: string;
22
+ readonly threadId?: string;
23
+ readonly runId: string;
24
+ readonly attachments?: PreparedAgentAttachmentContext;
25
+ readonly skills: readonly AgentSkillDefinition[];
26
+ /** The run's ontology reference docs and scripts, by path relative to the ontology directory. */
27
+ readonly ontologyFiles: readonly AgentProjectFile[];
28
+ /** A conversation's published artifacts, under {@link AGENT_ARTIFACTS_DIRECTORY}. */
29
+ readonly artifacts?: MaterializedArtifacts;
30
+ /** A conversation's memory repos, under `$SIXB_MEMORY_DIR/<repo>/`. */
31
+ readonly memory?: readonly AgentMemoryRepoView[];
32
+ }
33
+ export declare function prepareAgentSandboxApiContext(input: PrepareAgentSandboxApiContextInput): Promise<AgentSandboxApiContext>;
34
+ //# sourceMappingURL=sandbox-api-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox-api-context.d.ts","sourceRoot":"","sources":["../src/sandbox-api-context.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,OAAO,EAER,MAAM,YAAY,CAAA;AAEnB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,eAAe,CAAA;AAEnE;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,cAAc,CAAA;AACpD,eAAO,MAAM,wBAAwB,2BAA2B,CAAA;AAGhE,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAC/C;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,gFAAgF;IAChF,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,sFAAsF;IACtF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,8BAA8B,CAAA;IACrD,QAAQ,CAAC,MAAM,EAAE,SAAS,oBAAoB,EAAE,CAAA;IAChD,iGAAiG;IACjG,QAAQ,CAAC,aAAa,EAAE,SAAS,gBAAgB,EAAE,CAAA;IACnD,qFAAqF;IACrF,QAAQ,CAAC,SAAS,CAAC,EAAE,qBAAqB,CAAA;IAC1C,uEAAuE;IACvE,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAA;CACjD;AAED,wBAAsB,6BAA6B,CACjD,KAAK,EAAE,kCAAkC,GACxC,OAAO,CAAC,sBAAsB,CAAC,CAgIjC"}
@@ -0,0 +1,9 @@
1
+ import type { FileRef } from "@sixb/core";
2
+ /** Track durable files materialized in the current run sandbox. */
3
+ export declare class AgentSandboxFileRegistry {
4
+ #private;
5
+ register(absolutePath: string, fileRef: FileRef): void;
6
+ get(absolutePath: string): FileRef | undefined;
7
+ pathFor(fileRef: FileRef): string | undefined;
8
+ }
9
+ //# sourceMappingURL=sandbox-file-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox-file-registry.d.ts","sourceRoot":"","sources":["../src/sandbox-file-registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAGzC,mEAAmE;AACnE,qBAAa,wBAAwB;;IAInC,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAStD,GAAG,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAI9C,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;CAG9C"}
@@ -0,0 +1,71 @@
1
+ import { type AgentSandboxHandle } from "./sandbox-handle";
2
+ /** Why a sandbox file could not be listed or read. The message is safe to show to the Agent. */
3
+ export type SandboxFileErrorReason = "invalid_path" | "outside_root" | "not_found" | "too_large" | "changed" | "failed";
4
+ export declare class SandboxFileError extends Error {
5
+ readonly reason: SandboxFileErrorReason;
6
+ constructor(reason: SandboxFileErrorReason, message: string, options?: ErrorOptions);
7
+ }
8
+ export interface SandboxFileEntry {
9
+ /** Path relative to the listed directory, with `/` separators and no `.` or `..` segments. */
10
+ readonly relativePath: string;
11
+ readonly sizeBytes: number;
12
+ }
13
+ export interface SandboxFileListing {
14
+ /** False when nothing is at the path, or it is not a directory: then nothing is listed. */
15
+ readonly directory: boolean;
16
+ /** Regular files under the directory, sorted by path. Symbolic links are never listed. */
17
+ readonly files: readonly SandboxFileEntry[];
18
+ /** True when the directory held more than `maxFiles` files; only the first ones are listed. */
19
+ readonly truncated: boolean;
20
+ }
21
+ interface SandboxCommandOptions {
22
+ readonly signal: AbortSignal;
23
+ readonly timeoutMs: number;
24
+ }
25
+ /**
26
+ * Where a run reads files: its working directory, and its context directory when that lies
27
+ * elsewhere, as it does in a folder on a computer. Absolute, the working directory first.
28
+ */
29
+ export declare function sandboxRoots(handle: AgentSandboxHandle): readonly string[];
30
+ /**
31
+ * Resolve `requestedPath` against the sandbox working directory. Throws when the path is empty or
32
+ * leaves both the working directory and the run's context directory; symbolic links are checked
33
+ * when the file is read.
34
+ */
35
+ export declare function resolveSandboxPath(handle: AgentSandboxHandle, requestedPath: string): string;
36
+ /**
37
+ * List the regular files under `directory`, up to `maxFiles`. A missing directory lists nothing;
38
+ * output that does not parse throws, since a listing that skips a line drops a file silently.
39
+ */
40
+ export declare function listSandboxFiles(handle: AgentSandboxHandle, input: SandboxCommandOptions & {
41
+ readonly directory: string;
42
+ readonly maxFiles: number;
43
+ }): Promise<SandboxFileListing>;
44
+ /**
45
+ * Read one regular file inside the sandbox working directory. Refuses symbolic links, paths whose
46
+ * parent resolves outside the working directory, and files larger than `maxBytes`.
47
+ */
48
+ export declare function readSandboxFile(handle: AgentSandboxHandle, input: SandboxCommandOptions & {
49
+ /** An absolute path, as `resolveSandboxPath` returns it. */
50
+ readonly path: string;
51
+ readonly maxBytes: number;
52
+ }): Promise<Uint8Array>;
53
+ /** What a path names once its symbolic links are followed. */
54
+ export type SandboxPathEntry = {
55
+ readonly kind: "file" | "directory";
56
+ /** Absolute, every symbolic link along it followed. */
57
+ readonly realPath: string;
58
+ } | {
59
+ readonly kind: "missing";
60
+ } | {
61
+ readonly kind: "link";
62
+ };
63
+ /**
64
+ * Follow the symbolic links along `path`, an absolute path as `resolveSandboxPath` returns it, to
65
+ * where it really is. A path that is itself a link is reported as one, as reads refuse it.
66
+ */
67
+ export declare function resolveSandboxEntry(handle: AgentSandboxHandle, input: SandboxCommandOptions & {
68
+ readonly path: string;
69
+ }): Promise<SandboxPathEntry>;
70
+ export {};
71
+ //# sourceMappingURL=sandbox-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox-files.d.ts","sourceRoot":"","sources":["../src/sandbox-files.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,kBAAkB,EAAe,MAAM,kBAAkB,CAAA;AAMvE,gGAAgG;AAChG,MAAM,MAAM,sBAAsB,GAC9B,cAAc,GACd,cAAc,GACd,WAAW,GACX,WAAW,GACX,SAAS,GACT,QAAQ,CAAA;AAEZ,qBAAa,gBAAiB,SAAQ,KAAK;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AA;CAC1B,GACA,OAAO,CAAC,UAAU,CAAC,CAwCrB;AAED,8DAA8D;AAC9D,MAAM,MAAM,gBAAgB,GACxB;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAA;IACnC,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAE7B;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,kBAAkB,EAC1B,KAAK,EAAE,qBAAqB,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACvD,OAAO,CAAC,gBAAgB,CAAC,CAsB3B"}
@@ -0,0 +1,15 @@
1
+ import type { Sandbox } from "@sixb/core";
2
+ /** The sandbox plus its run-scoped environment, resolved lazily when first needed. */
3
+ export interface AgentSandboxHandle {
4
+ readonly sandbox: Sandbox;
5
+ /**
6
+ * Where the run's files are installed: skills, ontology docs, memory, attachments, artifacts,
7
+ * children's files and the agent's `sixb`. As the agent names it: relative to the working
8
+ * directory, or absolute.
9
+ */
10
+ readonly contextDirectory: string;
11
+ readonly env?: Readonly<Record<string, string>>;
12
+ }
13
+ /** A path in the run's context directory, absolute in the sandbox. */
14
+ export declare function contextPath(handle: AgentSandboxHandle, ...segments: string[]): string;
15
+ //# sourceMappingURL=sandbox-handle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox-handle.d.ts","sourceRoot":"","sources":["../src/sandbox-handle.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,sFAAsF;AACtF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAChD;AAED,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,MAAM,EAAE,kBAAkB,EAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAErF"}
@@ -0,0 +1,8 @@
1
+ interface SandboxReadinessGuard {
2
+ readonly signal: AbortSignal;
3
+ throwIfFailed(): void;
4
+ }
5
+ /** Observe concurrent sandbox provisioning without putting healthy boot on the model's critical path. */
6
+ export declare function monitorSandboxReadiness(ready: Promise<unknown> | undefined): SandboxReadinessGuard;
7
+ export {};
8
+ //# sourceMappingURL=sandbox-readiness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox-readiness.d.ts","sourceRoot":"","sources":["../src/sandbox-readiness.ts"],"names":[],"mappings":"AAAA,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;IAC5B,aAAa,IAAI,IAAI,CAAA;CACtB;AAED,yGAAyG;AACzG,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS,GAClC,qBAAqB,CAavB"}
@@ -0,0 +1,15 @@
1
+ import type { AgentSkillDefinition } from "@sixb/core";
2
+ /**
3
+ * Skills the worker ships, in every conversation's catalog. They describe formats the publisher
4
+ * validates and the app renders, so they change with them. Their names start with `sixb-`, which
5
+ * skill discovery refuses for a project's skills, so none collides with one.
6
+ */
7
+ export declare const BUILT_IN_SKILLS: readonly AgentSkillDefinition[];
8
+ /**
9
+ * How to write and save the Agent's memory. Installed with the memory, outside the catalog: the
10
+ * memory section of the prompt names it, so runs without memory never see it.
11
+ */
12
+ export declare const MEMORY_SKILL: AgentSkillDefinition;
13
+ /** The project's skills, then the built-in ones. */
14
+ export declare function withBuiltInSkills(projectSkills: readonly AgentSkillDefinition[]): readonly AgentSkillDefinition[];
15
+ //# sourceMappingURL=built-in.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"built-in.d.ts","sourceRoot":"","sources":["../../src/skills/built-in.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AA2FtD;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,oBAAoB,EAsCzD,CAAA;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,oBAA4D,CAAA;AAEvF,oDAAoD;AACpD,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,SAAS,oBAAoB,EAAE,GAC7C,SAAS,oBAAoB,EAAE,CAEjC"}
@@ -0,0 +1,27 @@
1
+ import type { AgentMessagePart } from "@sixb/core";
2
+ import type { AgentMessageRecord, SubagentRunRecord } from "@sixb/core/storage";
3
+ /** What a child run reads of its thread: its messages, and the paused run it continues (`AgentChildContext`). */
4
+ export interface SubagentHistory {
5
+ readonly messages: readonly AgentMessageRecord[];
6
+ /** The run of the thread that paused on its held calls, when this run continues it. */
7
+ readonly paused?: SubagentRunRecord;
8
+ }
9
+ /**
10
+ * The message a continuation starts with: how each of its calls ended, as its own, or its parent's
11
+ * answer to its question; the messages its parent sent that the paused run never read; what came
12
+ * back to its new sandbox, and when it continues. It stays in
13
+ * the thread, so a later continuation replays the same bytes.
14
+ *
15
+ * A child whose workspace is kept finds it as it left it, and is told nothing about it here. If
16
+ * its files turn out lost, its system prompt says so, as a turn's does.
17
+ */
18
+ export declare function continuationTrigger(input: {
19
+ /** The outcomes as the child reads them, without their caller, or the answer's `mail` part. */
20
+ readonly goesOnWith: readonly AgentMessagePart[];
21
+ readonly paused: SubagentRunRecord;
22
+ /** Whether the sandbox provider keeps the child's workspace while it pauses. */
23
+ readonly keepsWorkspace: boolean;
24
+ readonly createdAt: Date;
25
+ readonly timeZone: string;
26
+ }): readonly AgentMessagePart[];
27
+ //# sourceMappingURL=subagent-continuation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subagent-continuation.d.ts","sourceRoot":"","sources":["../src/subagent-continuation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAS/E,iHAAiH;AACjH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAA;IAChD,uFAAuF;IACvF,QAAQ,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAA;CACpC;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE;IACzC,+FAA+F;IAC/F,QAAQ,CAAC,UAAU,EAAE,SAAS,gBAAgB,EAAE,CAAA;IAChD,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAA;IAClC,gFAAgF;IAChF,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAA;IAChC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAA;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B,GAAG,SAAS,gBAAgB,EAAE,CAS9B"}
@@ -0,0 +1,53 @@
1
+ import { type AgentMailPart, type AgentMessage } from "@sixb/core";
2
+ import type { SubagentRunRecord } from "@sixb/core/storage";
3
+ import type { QuestionRef } from "./child-questions";
4
+ import type { ChildMailbox, UnreadChildMail } from "./family-mailbox";
5
+ /** Messages the child read, and where it read them: after how many of its steps. */
6
+ export interface SubagentDelivery {
7
+ readonly afterSteps: number;
8
+ readonly parts: readonly AgentMailPart[];
9
+ }
10
+ /** How its parent replied to the child's question: its answer, or none before its turn ended. */
11
+ export type ParentReply = {
12
+ readonly kind: "answer";
13
+ readonly text: string;
14
+ } | {
15
+ readonly kind: "deferred";
16
+ readonly questionId: string;
17
+ };
18
+ /**
19
+ * What a child's parent sent it, read at each of its step boundaries (`take`) from its side of the
20
+ * turn's mailbox, and the questions it asks its parent (`ask`). What it read is the child's to
21
+ * record: its thread keeps each delivery where the model read it, and each question as its tool
22
+ * call. What it never read when it pauses is returned by `close`, for the run that continues it.
23
+ */
24
+ export declare class SubagentInbox {
25
+ #private;
26
+ private readonly mailbox;
27
+ private readonly run;
28
+ constructor(mailbox: ChildMailbox, run: SubagentRunRecord);
29
+ /** What the child read, in order. */
30
+ get deliveries(): readonly SubagentDelivery[];
31
+ /** The question its parent's turn ended without answering: the child pauses on it. */
32
+ get deferred(): QuestionRef | undefined;
33
+ /**
34
+ * Ask the parent and wait for its reply, bounded by `signal`: the child's own cancel and its
35
+ * parent's. Its id names the child's model call and tool call, so the parent lists it once.
36
+ */
37
+ ask(question: string, callId: string, signal: AbortSignal): Promise<ParentReply>;
38
+ /**
39
+ * The messages that came since the last read, as the user message the child reads after
40
+ * `afterSteps` of its steps; none when nothing came. `afterAnswer` when the child just answered:
41
+ * it is told to write its result again in full.
42
+ */
43
+ take(afterSteps: number, options?: {
44
+ readonly afterAnswer?: boolean;
45
+ }): AgentMessage | undefined;
46
+ /** Stop reading, as the child stops: what it never read, for the run that continues it. */
47
+ close(): readonly UnreadChildMail[];
48
+ }
49
+ /** A message from the parent, as the child's thread keeps it where the child read it. */
50
+ export declare function mailPart(mail: UnreadChildMail, options?: {
51
+ readonly afterAnswer?: boolean;
52
+ }): AgentMailPart;
53
+ //# sourceMappingURL=subagent-inbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subagent-inbox.d.ts","sourceRoot":"","sources":["../src/subagent-inbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAwB,MAAM,YAAY,CAAA;AACxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM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