anchor-ai-sdk 0.1.6 → 0.1.8

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 (207) hide show
  1. package/README.md +423 -101
  2. package/dist/agents/coding/index.d.ts +1 -0
  3. package/dist/agents/coding/index.d.ts.map +1 -1
  4. package/dist/agents/coding/index.js +3 -0
  5. package/dist/agents/coding/index.js.map +1 -1
  6. package/dist/agents/index.d.ts +1 -0
  7. package/dist/agents/index.d.ts.map +1 -1
  8. package/dist/agents/index.js +1 -0
  9. package/dist/agents/index.js.map +1 -1
  10. package/dist/agents/terminal/index.d.ts +10 -0
  11. package/dist/agents/terminal/index.d.ts.map +1 -0
  12. package/dist/agents/terminal/index.js +20 -0
  13. package/dist/agents/terminal/index.js.map +1 -0
  14. package/dist/agents/terminal/phases.d.ts +4 -0
  15. package/dist/agents/terminal/phases.d.ts.map +1 -0
  16. package/dist/agents/terminal/phases.js +29 -0
  17. package/dist/agents/terminal/phases.js.map +1 -0
  18. package/dist/agents/terminal/prompt.d.ts +13 -0
  19. package/dist/agents/terminal/prompt.d.ts.map +1 -0
  20. package/dist/agents/terminal/prompt.js +33 -0
  21. package/dist/agents/terminal/prompt.js.map +1 -0
  22. package/dist/agents/terminal/strategy.d.ts +3 -0
  23. package/dist/agents/terminal/strategy.d.ts.map +1 -0
  24. package/dist/agents/terminal/strategy.js +12 -0
  25. package/dist/agents/terminal/strategy.js.map +1 -0
  26. package/dist/agents/types.d.ts +6 -0
  27. package/dist/agents/types.d.ts.map +1 -1
  28. package/dist/cli.d.ts +3 -0
  29. package/dist/cli.d.ts.map +1 -0
  30. package/dist/cli.js +188 -0
  31. package/dist/cli.js.map +1 -0
  32. package/dist/engine/background.d.ts +48 -0
  33. package/dist/engine/background.d.ts.map +1 -0
  34. package/dist/engine/background.js +98 -0
  35. package/dist/engine/background.js.map +1 -0
  36. package/dist/engine/budgets.d.ts +1 -0
  37. package/dist/engine/budgets.d.ts.map +1 -1
  38. package/dist/engine/budgets.js +3 -0
  39. package/dist/engine/budgets.js.map +1 -1
  40. package/dist/engine/dispatch.d.ts +89 -0
  41. package/dist/engine/dispatch.d.ts.map +1 -0
  42. package/dist/engine/dispatch.js +262 -0
  43. package/dist/engine/dispatch.js.map +1 -0
  44. package/dist/engine/events.d.ts +46 -2
  45. package/dist/engine/events.d.ts.map +1 -1
  46. package/dist/engine/guardrails.d.ts +54 -0
  47. package/dist/engine/guardrails.d.ts.map +1 -0
  48. package/dist/engine/guardrails.js +91 -0
  49. package/dist/engine/guardrails.js.map +1 -0
  50. package/dist/engine/inbox.d.ts +109 -0
  51. package/dist/engine/inbox.d.ts.map +1 -0
  52. package/dist/engine/inbox.js +94 -0
  53. package/dist/engine/inbox.js.map +1 -0
  54. package/dist/engine/intent.d.ts +8 -0
  55. package/dist/engine/intent.d.ts.map +1 -0
  56. package/dist/engine/intent.js +22 -0
  57. package/dist/engine/intent.js.map +1 -0
  58. package/dist/engine/loop.d.ts.map +1 -1
  59. package/dist/engine/loop.js +769 -242
  60. package/dist/engine/loop.js.map +1 -1
  61. package/dist/engine/operations.d.ts +82 -0
  62. package/dist/engine/operations.d.ts.map +1 -0
  63. package/dist/engine/operations.js +143 -0
  64. package/dist/engine/operations.js.map +1 -0
  65. package/dist/engine/thread.d.ts +3 -0
  66. package/dist/engine/thread.d.ts.map +1 -1
  67. package/dist/engine/thread.js.map +1 -1
  68. package/dist/engine/types.d.ts +119 -7
  69. package/dist/engine/types.d.ts.map +1 -1
  70. package/dist/index.d.ts +3 -0
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.js +3 -0
  73. package/dist/index.js.map +1 -1
  74. package/dist/ledger/alignment.d.ts +30 -0
  75. package/dist/ledger/alignment.d.ts.map +1 -0
  76. package/dist/ledger/alignment.js +116 -0
  77. package/dist/ledger/alignment.js.map +1 -0
  78. package/dist/ledger/compiler.d.ts +23 -0
  79. package/dist/ledger/compiler.d.ts.map +1 -0
  80. package/dist/ledger/compiler.js +134 -0
  81. package/dist/ledger/compiler.js.map +1 -0
  82. package/dist/ledger/config.d.ts +15 -0
  83. package/dist/ledger/config.d.ts.map +1 -0
  84. package/dist/ledger/config.js +2 -0
  85. package/dist/ledger/config.js.map +1 -0
  86. package/dist/ledger/index.d.ts +6 -0
  87. package/dist/ledger/index.d.ts.map +1 -0
  88. package/dist/ledger/index.js +6 -0
  89. package/dist/ledger/index.js.map +1 -0
  90. package/dist/ledger/ledger.d.ts +45 -0
  91. package/dist/ledger/ledger.d.ts.map +1 -0
  92. package/dist/ledger/ledger.js +181 -0
  93. package/dist/ledger/ledger.js.map +1 -0
  94. package/dist/ledger/types.d.ts +97 -0
  95. package/dist/ledger/types.d.ts.map +1 -0
  96. package/dist/ledger/types.js +12 -0
  97. package/dist/ledger/types.js.map +1 -0
  98. package/dist/llm/index.d.ts +13 -0
  99. package/dist/llm/index.d.ts.map +1 -1
  100. package/dist/llm/index.js +4 -1
  101. package/dist/llm/index.js.map +1 -1
  102. package/dist/llm/openai-compatible.d.ts +15 -1
  103. package/dist/llm/openai-compatible.d.ts.map +1 -1
  104. package/dist/llm/openai-compatible.js +25 -0
  105. package/dist/llm/openai-compatible.js.map +1 -1
  106. package/dist/llm/structured.d.ts +36 -0
  107. package/dist/llm/structured.d.ts.map +1 -0
  108. package/dist/llm/structured.js +44 -0
  109. package/dist/llm/structured.js.map +1 -0
  110. package/dist/llm/types.d.ts +31 -2
  111. package/dist/llm/types.d.ts.map +1 -1
  112. package/dist/lsp/client.d.ts +33 -0
  113. package/dist/lsp/client.d.ts.map +1 -0
  114. package/dist/lsp/client.js +137 -0
  115. package/dist/lsp/client.js.map +1 -0
  116. package/dist/lsp/index.d.ts +15 -0
  117. package/dist/lsp/index.d.ts.map +1 -0
  118. package/dist/lsp/index.js +13 -0
  119. package/dist/lsp/index.js.map +1 -0
  120. package/dist/lsp/protocol.d.ts +25 -0
  121. package/dist/lsp/protocol.d.ts.map +1 -0
  122. package/dist/lsp/protocol.js +45 -0
  123. package/dist/lsp/protocol.js.map +1 -0
  124. package/dist/lsp/tools.d.ts +6 -0
  125. package/dist/lsp/tools.d.ts.map +1 -0
  126. package/dist/lsp/tools.js +198 -0
  127. package/dist/lsp/tools.js.map +1 -0
  128. package/dist/lsp/typescript.d.ts +67 -0
  129. package/dist/lsp/typescript.d.ts.map +1 -0
  130. package/dist/lsp/typescript.js +266 -0
  131. package/dist/lsp/typescript.js.map +1 -0
  132. package/dist/sandbox/command.d.ts +7 -0
  133. package/dist/sandbox/command.d.ts.map +1 -0
  134. package/dist/sandbox/command.js +60 -0
  135. package/dist/sandbox/command.js.map +1 -0
  136. package/dist/sandbox/docker/image.d.ts +12 -0
  137. package/dist/sandbox/docker/image.d.ts.map +1 -0
  138. package/dist/sandbox/docker/image.js +52 -0
  139. package/dist/sandbox/docker/image.js.map +1 -0
  140. package/dist/sandbox/docker/index.d.ts +22 -1
  141. package/dist/sandbox/docker/index.d.ts.map +1 -1
  142. package/dist/sandbox/docker/index.js +245 -25
  143. package/dist/sandbox/docker/index.js.map +1 -1
  144. package/dist/sandbox/e2b/image.d.ts +13 -0
  145. package/dist/sandbox/e2b/image.d.ts.map +1 -0
  146. package/dist/sandbox/e2b/image.js +57 -0
  147. package/dist/sandbox/e2b/image.js.map +1 -0
  148. package/dist/sandbox/e2b/index.d.ts +3 -1
  149. package/dist/sandbox/e2b/index.d.ts.map +1 -1
  150. package/dist/sandbox/e2b/index.js +103 -0
  151. package/dist/sandbox/e2b/index.js.map +1 -1
  152. package/dist/sandbox/heyo/exec.d.ts +2 -0
  153. package/dist/sandbox/heyo/exec.d.ts.map +1 -1
  154. package/dist/sandbox/heyo/exec.js +11 -0
  155. package/dist/sandbox/heyo/exec.js.map +1 -1
  156. package/dist/sandbox/heyo/image.d.ts +15 -0
  157. package/dist/sandbox/heyo/image.d.ts.map +1 -0
  158. package/dist/sandbox/heyo/image.js +74 -0
  159. package/dist/sandbox/heyo/image.js.map +1 -0
  160. package/dist/sandbox/heyo/index.d.ts +21 -3
  161. package/dist/sandbox/heyo/index.d.ts.map +1 -1
  162. package/dist/sandbox/heyo/index.js +193 -16
  163. package/dist/sandbox/heyo/index.js.map +1 -1
  164. package/dist/sandbox/image.d.ts +62 -0
  165. package/dist/sandbox/image.d.ts.map +1 -0
  166. package/dist/sandbox/image.js +23 -0
  167. package/dist/sandbox/image.js.map +1 -0
  168. package/dist/sandbox/index.d.ts +1 -0
  169. package/dist/sandbox/index.d.ts.map +1 -1
  170. package/dist/sandbox/index.js +1 -0
  171. package/dist/sandbox/index.js.map +1 -1
  172. package/dist/sandbox/local/index.d.ts +3 -1
  173. package/dist/sandbox/local/index.d.ts.map +1 -1
  174. package/dist/sandbox/local/index.js +34 -0
  175. package/dist/sandbox/local/index.js.map +1 -1
  176. package/dist/sandbox/process.d.ts +55 -0
  177. package/dist/sandbox/process.d.ts.map +1 -0
  178. package/dist/sandbox/process.js +165 -0
  179. package/dist/sandbox/process.js.map +1 -0
  180. package/dist/sandbox/provider.d.ts +12 -0
  181. package/dist/sandbox/provider.d.ts.map +1 -1
  182. package/dist/sandbox/types.d.ts +55 -3
  183. package/dist/sandbox/types.d.ts.map +1 -1
  184. package/dist/sandbox/types.js.map +1 -1
  185. package/dist/testing.d.ts.map +1 -1
  186. package/dist/testing.js +108 -3
  187. package/dist/testing.js.map +1 -1
  188. package/dist/tools/bash.d.ts.map +1 -1
  189. package/dist/tools/bash.js +5 -13
  190. package/dist/tools/bash.js.map +1 -1
  191. package/dist/tools/finish.d.ts +14 -0
  192. package/dist/tools/finish.d.ts.map +1 -1
  193. package/dist/tools/finish.js +13 -3
  194. package/dist/tools/finish.js.map +1 -1
  195. package/dist/tools/index.d.ts +3 -2
  196. package/dist/tools/index.d.ts.map +1 -1
  197. package/dist/tools/index.js +1 -1
  198. package/dist/tools/index.js.map +1 -1
  199. package/dist/tools/truncate.d.ts +7 -0
  200. package/dist/tools/truncate.d.ts.map +1 -1
  201. package/dist/tools/truncate.js +12 -0
  202. package/dist/tools/truncate.js.map +1 -1
  203. package/dist/tools/types.d.ts +81 -1
  204. package/dist/tools/types.d.ts.map +1 -1
  205. package/dist/tools/types.js +26 -1
  206. package/dist/tools/types.js.map +1 -1
  207. package/package.json +8 -1
package/README.md CHANGED
@@ -1,147 +1,469 @@
1
1
  <p align="center">
2
2
  <picture>
3
- <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/hrithikkoduri/anchor-ai-sdk/main/assets/logo-dark.svg" />
4
- <img src="https://raw.githubusercontent.com/hrithikkoduri/anchor-ai-sdk/main/assets/logo.svg" alt="Anchor" width="96" />
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/hrithikkoduri/anchor-ai-sdk/d4e34e41ccb6fbb83d4c54824dd3383b5e84adc4/assets/readme-hero-dark.svg" />
4
+ <img src="https://raw.githubusercontent.com/hrithikkoduri/anchor-ai-sdk/d4e34e41ccb6fbb83d4c54824dd3383b5e84adc4/assets/readme-hero.svg" alt="Anchor. Your agent. Your machine. One runtime to wire them together." width="1200" />
5
5
  </picture>
6
6
  </p>
7
7
 
8
- <h1 align="center">Anchor</h1>
8
+ <p align="center">
9
+ <strong>A TypeScript agent harness SDK.</strong><br />
10
+ Define the behavior. Choose the machine. Let the shared runtime handle the turns.
11
+ </p>
9
12
 
10
13
  <p align="center">
11
- <strong>Loop-first, sandbox-first agent harness SDK.</strong><br />
12
- Give it a task and a machine; it reasons, runs tools, checks its own work, and keeps the receipts.
14
+ <a href="https://www.npmjs.com/package/anchor-ai-sdk"><img src="https://img.shields.io/npm/v/anchor-ai-sdk?style=flat-square&color=c2410c" alt="npm version" /></a>
15
+ <a href="https://github.com/hrithikkoduri/anchor-ai-sdk/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/hrithikkoduri/anchor-ai-sdk/ci.yml?style=flat-square&label=ci&color=111114" alt="CI status" /></a>
16
+ <a href="https://github.com/hrithikkoduri/anchor-ai-sdk/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-111114?style=flat-square" alt="MIT license" /></a>
17
+ <img src="https://img.shields.io/badge/node-%E2%89%A520-111114?style=flat-square" alt="Node.js 20 or newer" />
13
18
  </p>
14
19
 
15
20
  <p align="center">
16
- <a href="https://www.npmjs.com/package/anchor-ai-sdk"><img src="https://img.shields.io/npm/v/anchor-ai-sdk?style=flat-square&color=0f1115" alt="npm" /></a>
17
- <a href="https://github.com/hrithikkoduri/anchor-ai-sdk/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/hrithikkoduri/anchor-ai-sdk/ci.yml?style=flat-square&label=ci&color=0f1115" alt="CI" /></a>
18
- <a href="https://github.com/hrithikkoduri/anchor-ai-sdk/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/anchor-ai-sdk?style=flat-square&color=0f1115" alt="license" /></a>
19
- <img src="https://img.shields.io/node/v/anchor-ai-sdk?style=flat-square&color=0f1115" alt="node" />
21
+ <a href="https://anchor-sdk.dev/docs.html"><strong>Documentation</strong></a> ·
22
+ <a href="#quickstart">Quickstart</a> ·
23
+ <a href="#one-sandbox-interface">Sandboxes</a> ·
24
+ <a href="#make-the-agent-yours">Custom agents</a> ·
25
+ <a href="https://anchor-sdk.dev/benchmarks.html">Benchmarks</a>
20
26
  </p>
21
27
 
22
28
  ---
23
29
 
24
- Most agent harnesses give you a loop and leave the hard parts to you: a
25
- context that grows until it dies, a trace you can't replay, a "done" you can't
26
- trust. Anchor ships the hard parts.
27
-
28
- - **Evidence, never vibes.** Every tool result is recorded on
29
- `AgentResult.evidence`; `run_tests` stamps the tree hash it ran against and
30
- `latestEvidenceForTree` ties a green run to the *exact* bytes (fail-closed
31
- when the tree can't be inspected). The engine carries evidence and never
32
- reads success out of a confident sentence; what to gate on it is your
33
- policy, not a hidden wall.
34
- - **Durable by construction.** Conversation, workspace, and the agent's own
35
- notes survive folds, restarts, and budget deaths; the SDK ships the
36
- resumption primitives (thread store, checkpoints, phase pauses, revival
37
- planning), so resuming is wiring, not research.
38
- - **Sandbox-first.** The machine is part of the design, not an afterthought:
39
- one provider contract, adapters accepted by an executable conformance
40
- suite.
41
-
42
- ## Out of the box
43
-
44
- | | |
30
+ Anchor runs the **model → tools → observations → model** loop around your agent.
31
+ It combines configurable guardrails, context compaction, continuation primitives,
32
+ and structured events with a sandbox layer that can also be used on its own.
33
+
34
+ **Your app keeps control of the model, prompts, tools, storage, credentials, and
35
+ release policy.** There is no requirement to turn an agent into a workflow graph.
36
+
37
+ | Build around | What Anchor supplies |
45
38
  | --- | --- |
46
- | **Agent loop with dials** | Budgets (steps / tokens / USD), repeated-call detection, silent-tool and verbose-turn advisories, a per-call output cap (16k, nudge at 8k; a capped prose turn continues once instead of ending), and assistant-text elision (20k replay, 12k head-only when capped, spilled and pointed at); guardrails on by default, each with an off switch. Phases describe the approach, never a second gated execution engine. |
47
- | **Streaming by default** | One wire path: every model call streams. Text and reasoning deltas, tool calls, compaction, checkpoints, and finishes all arrive as typed events. |
48
- | **Durable memory** | `ThreadStore` carries conversation across runs; compaction is derived from the model's *real* context window; reasoning is journaled but never re-sent. |
49
- | **Notes & spill storage** | A reserved `.anchor/notes.md` (git-excluded, checkpoint-carried) is the agent's durable memory across folds; oversized tool output spills to sandbox files and stays addressable instead of vanishing. |
50
- | **Revival** | A dying run leaves a handoff (`request_revival`); `planRevival` + `ThreadBudget` decide how to fund the next run; **same task, phase, and budget**, and when the thread's caps are spent, a human gets the note, quoting the agent's own words on what remains. |
51
- | **Snapshots & resume** | A pluggable snapshot hook (git-backed by default, push optional), phase-boundary pauses, heartbeats and cross-process cancel polling owned by the engine. |
52
- | **Traces you can replay** | One fanout: one sequence number, redaction applied before *every* sink; NDJSON file, database rows, and a live projector share the same ordering. |
53
- | **Sandbox plugins** | One `SandboxProvider` contract: Heyo microVMs, Docker, local. Capabilities are promises; the conformance suite holds adapters to them. Store-backed sessions give adopt-and-fallback continuity for free. |
54
- | **Typed handoffs** | `finish({ handoff })` is shaped by *your* JSON schema; the engine declares the parameter, carries the object, and never interprets it. |
55
- | **Priced & windowed models** | `llmFromCatalog` reads live prices and the genuine context window from the provider catalog; budgets and compaction configure themselves correctly. |
56
-
57
- ## Ten lines to a working agent
39
+ | **Your agent** | Chat and coding bundles, or your own strategy and toolset. Phases label the approach; they are not permissions. |
40
+ | **Your machine** | One `SandboxProvider` / `Sandbox` surface for Heyo Computer, E2B, Docker, and local development. |
41
+ | **Longer tasks** | Conversation compaction, thread-store interfaces, working notes, checkpoints, and opt-in revival planning. |
42
+ | **Observable execution** | Streaming events, tool-result metadata, NDJSON/custom trace sinks, and replay helpers. |
43
+
44
+ ## Quickstart
58
45
 
59
46
  ```bash
60
47
  npm install anchor-ai-sdk
61
48
  ```
62
49
 
63
- ```ts
50
+ Save as `agent.mjs`. This is ordinary JavaScript with ES modules; `.js` also works
51
+ when your `package.json` contains `"type": "module"`.
52
+
53
+ ```js
64
54
  import { chatAgent, llmFromCatalog, runAgent } from "anchor-ai-sdk";
65
55
 
66
- const { llm } = await llmFromCatalog({
56
+ const { llm, compaction } = await llmFromCatalog({
67
57
  baseUrl: "https://openrouter.ai/api/v1",
68
- apiKey: process.env.OPENROUTER_KEY!,
69
- model: "z-ai/glm-5.3",
58
+ apiKey: process.env.OPENROUTER_KEY,
59
+ model: process.env.MODEL ?? "z-ai/glm-5.3",
70
60
  });
71
61
 
72
62
  const result = await runAgent(
73
- { task: "Explain what this repository does" },
74
- { llm, agent: chatAgent },
63
+ { task: "Explain exponential backoff in plain English" },
64
+ { llm, compaction, agent: chatAgent },
75
65
  );
66
+
76
67
  console.log(result.summary);
77
68
  ```
78
69
 
79
- ## Give it a machine
70
+ ```bash
71
+ export OPENROUTER_KEY="your-key"
72
+ node agent.mjs
73
+ ```
74
+
75
+ No sandbox is needed for this chat example. Model calls may incur cost.
76
+ `llmFromCatalog` uses provider pricing and context-window metadata when available;
77
+ pass its returned `compaction` settings to the engine as shown. Catalog lookup is
78
+ best-effort; configure overrides and fallbacks for endpoints without this metadata.
79
+
80
+ ## Task verification
81
+
82
+ For tasks that need evidence before completion, enable the opt-in verifier:
80
83
 
81
84
  ```ts
82
- import { codingAgent, runAgent } from "anchor-ai-sdk";
85
+ const result = await runAgent(
86
+ { task: "Investigate where auth is refreshed" },
87
+ {
88
+ llm,
89
+ sandbox,
90
+ thread: { store, id: threadId },
91
+ verifier: true,
92
+ },
93
+ );
94
+ ```
95
+
96
+ The SDK owns the ledger, intent routing, evidence capture, and phase/finish
97
+ checks. The consumer supplies only the normal `ThreadStore` (the ledger is an
98
+ optional field on `StoredThread`) and the model. Greetings and other chat turns
99
+ create no ledger and make no verifier call. A separate cheap verifier model is
100
+ optional:
101
+
102
+ ```ts
103
+ verifier: {
104
+ llm: cheapLlm,
105
+ gates: ["phase", "finish"],
106
+ allowWaived: true,
107
+ }
108
+ ```
109
+
110
+ `finish` is rejected while a required ledger item is open or lacks linked
111
+ evidence; the agent loops with the missing-evidence feedback. Compiler and
112
+ verifier token usage is counted against the run budget.
113
+
114
+ ## One sandbox interface
115
+
116
+ **Configure the provider once. Keep the agent-facing machine interface the same.**
117
+ The same layer works with the built-in coding tools, custom agents, or direct
118
+ `sandbox.exec()` calls without an agent. For long-lived consumers — LSPs, REPLs,
119
+ dev servers, watchers — `sandbox.openProcess()` is the optional persistent
120
+ stdin/stdout primitive; check `provider.capabilities.processStream` first.
121
+
122
+ | Provider | Import | Boot configuration |
123
+ | --- | --- | --- |
124
+ | **Heyo Computer** | `anchor-ai-sdk/sandbox/heyo` | Image artifact/store on the provider; host-built image kinds are also supported. |
125
+ | **E2B** | `anchor-ai-sdk/sandbox/e2b` | A prepared template name or ID, **not** an arbitrary Docker image at create time. |
126
+ | **Docker** | `anchor-ai-sdk/sandbox/docker` | An explicit container image, Docker CLI, and running daemon. |
127
+ | **Local** | `anchor-ai-sdk/sandbox/local` | Host processes and a working directory. **No isolation; trusted dev/CI only.** |
128
+
129
+ Choose one of the configurations below. Each defines `provider`; the common
130
+ runner that follows uses the `llm` and `compaction` from the quickstart.
131
+
132
+ <details open>
133
+ <summary><strong>Heyo Computer: choose an image and machine size</strong></summary>
134
+
135
+ ```bash
136
+ npm install @heyocomputer/hws
137
+ ```
138
+
139
+ ```js
140
+ import { heyo } from "anchor-ai-sdk/sandbox/heyo";
141
+
142
+ const provider = heyo({
143
+ token: requiredEnv("HEYO_TOKEN"),
144
+ server: requiredEnv("HEYO_SERVER"),
145
+ namespace: requiredEnv("HEYO_NAMESPACE"),
146
+ image: requiredEnv("HEYO_IMAGE"),
147
+ imageKind: "artifact",
148
+ imageStore: requiredEnv("HEYO_IMAGE_STORE"),
149
+ sizeClass: "small",
150
+ diskSizeGb: 10,
151
+ });
152
+ ```
153
+
154
+ Use an artifact/store you can access and a toolchain suitable for the task.
155
+ Heyo configures its image on the provider and rejects per-sandbox `image` and
156
+ `workspacePath` overrides. `requiredEnv` is defined in the shared runner below.
157
+
158
+ </details>
159
+
160
+ <details>
161
+ <summary><strong>E2B: choose a prepared template</strong></summary>
162
+
163
+ ```bash
164
+ npm install 'e2b@^2.56'
165
+ ```
166
+
167
+ ```js
168
+ import { e2b } from "anchor-ai-sdk/sandbox/e2b";
169
+
170
+ const provider = e2b({
171
+ apiKey: requiredEnv("E2B_API_KEY"),
172
+ template: requiredEnv("E2B_TEMPLATE"),
173
+ timeoutMs: 60 * 60_000, // sandbox lifetime, not a command timeout
174
+ });
175
+ ```
176
+
177
+ Build a template with `bash`, `git`, coreutils (including `timeout`), and the
178
+ language tools your task needs. `spec.image` can override the template per run;
179
+ `workspacePath` points to a Git workspace already prepared inside it. Neither
180
+ option turns a Docker image name into an E2B template automatically.
181
+
182
+ </details>
183
+
184
+ <details>
185
+ <summary><strong>Docker: supply your container image</strong></summary>
186
+
187
+ ```js
83
188
  import { docker } from "anchor-ai-sdk/sandbox/docker";
84
189
 
85
- const sandbox = docker().create({
86
- repoUrl: "https://github.com/you/your-repo",
87
- ref: "main",
190
+ const provider = docker({
191
+ image: requiredEnv("ANCHOR_DOCKER_IMAGE"),
88
192
  });
89
- await sandbox.start();
193
+ ```
194
+
195
+ The image must already contain the required tools; Anchor does not infer or
196
+ install your repository's dependencies. `spec.image` overrides the default.
197
+ Use `workspacePath` only when the image already contains the Git workspace.
198
+
199
+ </details>
200
+
201
+ ### Pass the machine to an agent
202
+
203
+ Combine **one** provider configuration above with this runner and the model setup
204
+ from the quickstart. Merge imports when composing an existing application.
205
+
206
+ ```js
207
+ import { codingAgent } from "anchor-ai-sdk";
208
+
209
+ function requiredEnv(name) {
210
+ const value = process.env[name];
211
+ if (!value) throw new Error(`Set ${name} before running this example.`);
212
+ return value;
213
+ }
214
+
215
+ const sandbox = provider.create({
216
+ repoUrl: requiredEnv("REPO_URL"),
217
+ ref: process.env.REPO_REF ?? "main",
218
+ });
219
+
90
220
  try {
221
+ await sandbox.start();
91
222
  const result = await runAgent(
92
- { task: "Run the tests and fix the failing case" },
93
- { llm, agent: codingAgent, sandbox },
223
+ { task: "Run the tests and report the results" },
224
+ { llm, compaction, agent: codingAgent, sandbox },
94
225
  );
95
- console.log(result.summary, result.checkpointRef);
226
+ console.log(result.summary, result.reason, result.evidence);
96
227
  } finally {
97
228
  await sandbox.destroy();
98
229
  }
99
230
  ```
100
231
 
101
- Runnable versions of both snippets live in [`examples/`](https://github.com/hrithikkoduri/anchor-ai-sdk/tree/main/examples), including
102
- a non-coding agent (its own strategy and tool, no sandbox).
232
+ Provider boot settings and optional capabilities differ. Per-sandbox
233
+ `spec.image` is supported by Docker and E2B (as a template name), and by Heyo
234
+ for artifact refs; Local rejects it. Providers that can build/publish expose
235
+ `imagePublisher`, also available as `anchor image publish`.
236
+ Retention needs a cleanup policy; remote machines and model calls can cost money. Private HTTPS repositories
237
+ can use `spec.git.token`, a caller-supplied credential callback.
238
+
239
+ The latest Docker adapter also supports `spec.egress: "none"`: it disconnects
240
+ container networks after `start()` setup. Other adapters reject that setting.
241
+ This is not a claim that all providers offer equivalent isolation.
242
+
243
+ Providers that can build images expose the common `imagePublisher` contract and
244
+ the `anchor image publish` command, so Docker, E2B, and Heyo each use their own
245
+ native registry while the caller keeps one shape. `anchor image publish --help`
246
+ shows the flags. Per-provider instructions are in
247
+ [docs/sandbox-image-publishing.md](docs/sandbox-image-publishing.md).
248
+
249
+ **[Configuration examples](https://anchor-sdk.dev/docs.html#machine)** ·
250
+ **[Provider contract and image guide](https://github.com/hrithikkoduri/anchor-ai-sdk/blob/main/src/sandbox/README.md)** ·
251
+ **[Optional LSP tools](docs/lsp.md)**
252
+
253
+ ## Make the agent yours
254
+
255
+ ```text
256
+ Agent = name + strategy + tools
257
+ Strategy = system prompt + phases + optional context preparation
258
+ Tool = model-visible JSON Schema + your handler
259
+ runAgent = task + agent + model + optional sandbox + runtime settings
260
+ ```
261
+
262
+ Use `chatAgent` or `codingAgent`, compose a bundle, or pass `strategy` and `tools`
263
+ separately. A custom agent is not required to be a coding agent or use a machine.
264
+
265
+ <details>
266
+ <summary><strong>Example: a small policy assistant with its own tool</strong></summary>
267
+
268
+ This fragment uses `llm` and `compaction` from the quickstart. The policy is demo
269
+ data; a real service needs your authorization, validation, and output limits.
270
+
271
+ ```js
272
+ import { defineTool, requireString } from "anchor-ai-sdk";
273
+
274
+ const policies = new Map([
275
+ ["refunds", "Refunds are available within 30 days with the original receipt."],
276
+ ]);
277
+
278
+ const lookupPolicy = defineTool(
279
+ {
280
+ name: "lookup_policy",
281
+ description: "Look up a policy by topic.",
282
+ parameters: {
283
+ type: "object",
284
+ properties: { topic: { type: "string" } },
285
+ required: ["topic"],
286
+ },
287
+ },
288
+ async (input) => {
289
+ const policy = policies.get(requireString(input, "topic").trim().toLowerCase());
290
+ return { ok: policy !== undefined, content: policy ?? "No policy found." };
291
+ },
292
+ );
293
+
294
+ const policyAgent = {
295
+ name: "policy-assistant",
296
+ strategy: {
297
+ name: "policy",
298
+ phases: [{ id: "answer", goal: "Answer using the retrieved policy." }],
299
+ requiredTools: ["lookup_policy"],
300
+ systemPrompt: () =>
301
+ "Look up policy before making policy claims. Say when it is unknown.",
302
+ },
303
+ tools: [lookupPolicy],
304
+ };
305
+
306
+ const answer = await runAgent(
307
+ { task: "Can I get a refund after 20 days?" },
308
+ { llm, compaction, agent: policyAgent },
309
+ );
310
+ console.log(answer.summary);
311
+ ```
312
+
313
+ The schema is declared to the model; `defineTool` does not perform full JSON
314
+ Schema validation. It catches thrown handler errors as failed tool results.
315
+ Validate inputs and enforce permissions in your implementation.
316
+
317
+ </details>
318
+
319
+ **[Tools and schemas](https://anchor-sdk.dev/docs.html#tools)** ·
320
+ **[Runnable SDK examples](https://github.com/hrithikkoduri/anchor-ai-sdk/tree/main/examples)**
321
+
322
+ ## Configure the runtime, not another loop
323
+
324
+ | Capability | Your controls |
325
+ | --- | --- |
326
+ | **Budgets and correction** | Step/token/known-dollar budgets, repeated-call detection, silent-tool and visible-verbosity nudges, prose checkpoints, and per-call output requests. |
327
+ | **Reasoning budget** | Per-run `reasoningEffort` (`minimal`–`xhigh`) or an agent-bundle default, sent in the provider's native shape (`reasoning.effort` on OpenRouter, `reasoning_effort` on OpenAI). |
328
+ | **Context and memory** | Catalog-derived or explicit compaction, supplied thread stores, agent-authored notes, and best-effort output spill. |
329
+ | **Revival and resume** | Opt-in budget warnings, `request_revival`, `planRevival`, and `ThreadBudget`. Your app persists state and decides whether to fund or enqueue another run. |
330
+ | **Snapshots and lifecycle** | Git-backed or custom snapshot hooks, optional push, phase-boundary pauses, heartbeats, and cancellation. |
331
+ | **Streaming and traces** | Raw `onEvent` updates; sequenced, pattern-redacted `traceSinks`; NDJSON files, custom sinks, live projection, and replay. |
332
+ | **Execution evidence** | Tool names/status/metadata plus recorded test-command outcomes and optional post-run Git freshness checks. Your app defines verification and release gates. |
333
+ | **External effects** | Declared effects, a write-ahead operation journal, stable operation ids, reconciliation on resume, and a stop on unknown outcomes. |
334
+
335
+ <details>
336
+ <summary><strong>Example: limits, nudges, compaction, and a recorded trace</strong></summary>
337
+
338
+ Runtime options for a model and started sandbox configured by your host:
339
+
340
+ ```js
341
+ import { JsonlTrace } from "anchor-ai-sdk";
342
+ import { randomUUID } from "node:crypto";
343
+
344
+ const tracePath = "./traces/" + randomUUID() + ".ndjson";
345
+
346
+ const result = await runAgent({ task: "Investigate the failing test" }, {
347
+ llm, sandbox, agent: codingAgent,
348
+ budgets: { maxSteps: 60, maxUsd: 3 },
349
+ compaction: { maxEstimatedTokens: 60_000, keepRecentTokens: 15_000 },
350
+ guardrails: {
351
+ repeatedToolCallLimit: 3,
352
+ toolOnlyNudgeLimit: 8,
353
+ verboseTurnLimit: 8_000,
354
+ proseCheckpoint: true,
355
+ },
356
+ maxOutputTokens: 16_000,
357
+ traceSinks: [new JsonlTrace(tracePath)],
358
+ onEvent(event) {
359
+ if (event.type === "llm_text_delta") process.stdout.write(event.text);
360
+ },
361
+ });
362
+ ```
363
+
364
+ Run usage is checked between calls and can overshoot a budget. Output limits are
365
+ requested from the provider. Compaction is lossy summarization using estimated
366
+ token sizes; persistence and spill require working storage. Trace redaction is
367
+ pattern-based, not a guarantee that all secrets are removed; raw `onEvent` events
368
+ are not redacted. Use distinct trace files/IDs per run in your application.
369
+
370
+ </details>
371
+
372
+ **[Compaction](https://anchor-sdk.dev/docs.html#compaction)** ·
373
+ **[Course correction](https://anchor-sdk.dev/docs.html#correction)** ·
374
+ **[Revival and host-side resume](https://anchor-sdk.dev/docs.html#revival)** ·
375
+ **[Streaming and detailed traces](https://anchor-sdk.dev/docs.html#traces)**
376
+
377
+ > **A completed run is not a correctness certificate.** `run_tests` records a
378
+ > command outcome and, when available, a Git hash captured **after** the command.
379
+ > `latestEvidenceForTree` can compare it with the current tree, but does not prove
380
+ > an immutable tested snapshot, require a full suite, or inspect assertions.
381
+
382
+ ## Recovering external writes
383
+
384
+ A crash between "the target accepted the write" and "the thread saved the
385
+ result" must not become a duplicate write. A tool that changes something outside
386
+ the workspace declares an effect; the engine then records the intent before the
387
+ call and settles it after:
388
+
389
+ ```js
390
+ const createIssue = defineTool({ name: "create_issue", /* ... */ }, async (input, ctx) => {
391
+ const issue = await github.createIssue(input, {
392
+ idempotencyKey: ctx.operationId, // stable across retries
393
+ });
394
+ await ctx.acknowledge?.({ issue: issue.number });
395
+ return { ok: true, content: `Created #${issue.number}` };
396
+ }, {
397
+ effect: {
398
+ async reconcile({ operationId }) {
399
+ const found = await github.findByKey(operationId);
400
+ return found
401
+ ? { status: "applied", result: { ok: true, content: found.url } }
402
+ : { status: "unknown" };
403
+ },
404
+ },
405
+ });
406
+
407
+ await runAgent(task, {
408
+ llm, agent, sandbox,
409
+ operations: { store }, // a durable table in production
410
+ });
411
+ ```
412
+
413
+ On resume, a pending operation is reconciled, never replayed. An unknowable
414
+ outcome ends the run with `reason: "recovery_required"` and
415
+ `AgentResult.pendingOperations`. `MemoryOperationStore` is for tests; production
416
+ needs a durable table with a unique `operation_id`. The target's participation
417
+ (an idempotency key or a status lookup) is what turns this into
418
+ effectively-once; without it, the harness surfaces the ambiguity instead of
419
+ guessing.
420
+
421
+ ## Test the machine contract
422
+
423
+ `runSandboxConformance(provider)` from `anchor-ai-sdk/testing` exercises the
424
+ public sandbox contract: command results, deadlines, environment handling, Git
425
+ checkpoints, retention/adoption, and declared optional capabilities.
426
+
427
+ The repository configures local and Docker conformance in CI. Heyo and E2B live
428
+ suites are opt-in and credential-gated; having a suite is not certification that
429
+ every account, image, or template has passed it. Custom providers can use the
430
+ same contract and tests without rewriting the agent engine.
431
+
432
+ **[Conformance setup](https://anchor-sdk.dev/docs.html#conformance)** ·
433
+ **[Test source](https://github.com/hrithikkoduri/anchor-ai-sdk/tree/main/tests)**
103
434
 
104
- ## Providers
435
+ ## Evaluated, with the limits visible
105
436
 
106
- | subpath | backend | status |
437
+ The completed **Parasail GLM 5.3 / SWE-bench Lite-10** records show:
438
+
439
+ | | Anchor | mini-swe-agent |
107
440
  | --- | --- | --- |
108
- | `anchor-ai-sdk/sandbox/heyo` | Heyo Cloud microVMs (Firecracker) | production path; conformance + live tests |
109
- | `anchor-ai-sdk/sandbox/docker` | containers on the local daemon | conformance-tested in CI |
110
- | `anchor-ai-sdk/sandbox/e2b` | E2B cloud sandboxes (remote) | conformance-tested live (`base` template); opt-in in CI |
111
- | `anchor-ai-sdk/sandbox/local` | this host, **no isolation** | dev / CI only |
112
- | n/a | Daytona | planned |
113
-
114
- E2B boots a **template**, not an arbitrary Docker image at create time: pass
115
- `template` (or let `SandboxSpec.image` name one) and build it with the tools
116
- the task needs. Pause/resume powers retain/adopt, and native sandbox forking
117
- powers `fork()`.
118
-
119
- A backend is "done" when `runSandboxConformance(provider)` from
120
- `anchor-ai-sdk/testing` passes: exec fidelity, kill deadlines, env secrets,
121
- checkpoints, retain/adopt, git identity, pushes, and `fork` where declared.
122
- See [`src/sandbox/README.md`](https://github.com/hrithikkoduri/anchor-ai-sdk/blob/main/src/sandbox/README.md) for the provider guide.
123
-
124
- ## Proof, not promises
125
-
126
- - **Tests:** the engine, tools, trace layer, and every provider scenario run
127
- in CI: local conformance always, Docker conformance on a purpose-built
128
- image. Live microVM conformance is opt-in with your own Heyo credentials
129
- (the suite skips without them).
130
- - **Genericity guards:** executable rules keep the package consumer-neutral:
131
- no product nouns, no env reads, SDKs behind subpaths. They run in the same
132
- suite as everything else.
133
- - **Evaluation:** Anchor vs mini-swe-agent on SWE-bench Lite (same
134
- container, same model, same official grader), resolved the same 7/10 at
135
- roughly **one-third of the cost**
136
- ([`evals/benchmarks/swe-bench/results/comparison.md`](https://github.com/hrithikkoduri/anchor-ai-sdk/blob/main/evals/benchmarks/swe-bench/results/comparison.md)).
137
-
138
- ## Status
139
-
140
- **Early alpha (0.x).** The API will move before 1.0, so pin exact versions. The
141
- [`DECISIONS.md`](https://github.com/hrithikkoduri/anchor-ai-sdk/blob/main/DECISIONS.md) is the engineering log: every API has a written
142
- reason, and the reasons moved with the code when this repo was extracted from
143
- its monorepo.
144
-
145
- - Repo / issues: [github.com/hrithikkoduri/anchor-ai-sdk](https://github.com/hrithikkoduri/anchor-ai-sdk)
146
- - Docs: [anchor-sdk.dev](https://anchor-sdk.dev) (coming)
147
- - License: MIT
441
+ | **Resolved** | **9 / 10** | **9 / 10** |
442
+ | Remaining task | Sympy patch unresolved | Matplotlib patch extraction failed; empty patch |
443
+ | Recorded usage | 11,363,962 tokens; $4.3162 | Not reported; no cost ratio claimed |
444
+ | Published limits | 120 steps / 25M tokens | Its own 250-step / $3 loop |
445
+
446
+ Both records name `zai-org/GLM-5.3` on Parasail, temperature 0, seed 42, and
447
+ Docker-backed tasks. This is a selected ten-task sample with different budgets
448
+ and an extraction failure, not the full benchmark or a general superiority
449
+ claim. The older 7/10 OpenRouter cost comparison is separate historical context.
450
+
451
+ **[Benchmark explorer](https://anchor-sdk.dev/benchmarks.html)** ·
452
+ **[Anchor artifacts](https://github.com/hrithikkoduri/anchor-ai-sdk/tree/main/evals/benchmarks/swe-bench/results/glm53-parasail)** ·
453
+ **[Mini artifacts](https://github.com/hrithikkoduri/anchor-ai-sdk/tree/main/evals/benchmarks/swe-bench/results/glm53-mini)**
454
+
455
+ ## Status and contributing
456
+
457
+ **Early alpha, 0.x.** Pin exact versions and test your integration. Provider and
458
+ runtime features are version-specific; the current source may be ahead of the
459
+ installed package. Daytona, agent teams, and consumer skill bundles remain
460
+ roadmap work in the reviewed source.
461
+
462
+ Questions, bug reports, and provider contributions are welcome. Keep mechanics in
463
+ the SDK and product policy in the consumer; provider changes should include
464
+ conformance coverage and an honest capability declaration.
465
+
466
+ **[Issues](https://github.com/hrithikkoduri/anchor-ai-sdk/issues)** ·
467
+ **[Roadmap](https://github.com/hrithikkoduri/anchor-ai-sdk/blob/main/ROADMAP.md)** ·
468
+ **[Engineering decisions](https://github.com/hrithikkoduri/anchor-ai-sdk/blob/main/DECISIONS.md)** ·
469
+ **[MIT license](https://github.com/hrithikkoduri/anchor-ai-sdk/blob/main/LICENSE)**
@@ -16,6 +16,7 @@ export { codingPhases } from "./phases.js";
16
16
  export declare function createCodingAgent(opts?: {
17
17
  testCommand?: string;
18
18
  maxOutputTokens?: number | false;
19
+ reasoningEffort?: Agent["reasoningEffort"];
19
20
  }): Agent;
20
21
  /** The zero-config coding agent — detection instead of a configured suite. */
21
22
  export declare const codingAgent: Agent;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agents/coding/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;CAAO,GACpE,KAAK,CASP;AAED,8EAA8E;AAC9E,eAAO,MAAM,WAAW,EAAE,KAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agents/coding/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,GAAE;IACJ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACjC,eAAe,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;CACvC,GACL,KAAK,CAYP;AAED,8EAA8E;AAC9E,eAAO,MAAM,WAAW,EAAE,KAA2B,CAAC"}
@@ -21,6 +21,9 @@ export function createCodingAgent(opts = {}) {
21
21
  ...(opts.maxOutputTokens !== undefined
22
22
  ? { maxOutputTokens: opts.maxOutputTokens }
23
23
  : {}),
24
+ ...(opts.reasoningEffort !== undefined
25
+ ? { reasoningEffort: opts.reasoningEffort }
26
+ : {}),
24
27
  };
25
28
  }
26
29
  /** The zero-config coding agent — detection instead of a configured suite. */
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agents/coding/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAe,MAAM,YAAY,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAAI,GAA+D,EAAE;IAErE,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,cAAc;QACxB,KAAK,EAAE,iBAAiB,CAAC,IAAI,CAAC;QAC9B,GAAG,CAAC,IAAI,CAAC,eAAe,KAAK,SAAS;YACpC,CAAC,CAAC,EAAE,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE;YAC3C,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,MAAM,CAAC,MAAM,WAAW,GAAU,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agents/coding/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAe,MAAM,YAAY,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAAI,GAIA,EAAE;IAEN,OAAO;QACL,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,cAAc;QACxB,KAAK,EAAE,iBAAiB,CAAC,IAAI,CAAC;QAC9B,GAAG,CAAC,IAAI,CAAC,eAAe,KAAK,SAAS;YACpC,CAAC,CAAC,EAAE,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE;YAC3C,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,IAAI,CAAC,eAAe,KAAK,SAAS;YACpC,CAAC,CAAC,EAAE,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE;YAC3C,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,MAAM,CAAC,MAAM,WAAW,GAAU,iBAAiB,EAAE,CAAC"}
@@ -7,4 +7,5 @@
7
7
  export * from "./types.js";
8
8
  export * from "./coding/index.js";
9
9
  export * from "./chat/index.js";
10
+ export * from "./terminal/index.js";
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
@@ -7,4 +7,5 @@
7
7
  export * from "./types.js";
8
8
  export * from "./coding/index.js";
9
9
  export * from "./chat/index.js";
10
+ export * from "./terminal/index.js";
10
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Agent } from "../types.js";
2
+ export { terminalStrategy } from "./strategy.js";
3
+ export { terminalPhases } from "./phases.js";
4
+ export { buildTerminalPrompt } from "./prompt.js";
5
+ export declare function createTerminalAgent(opts?: {
6
+ maxOutputTokens?: number | false;
7
+ reasoningEffort?: Agent["reasoningEffort"];
8
+ }): Agent;
9
+ export declare const terminalAgent: Agent;
10
+ //# sourceMappingURL=index.d.ts.map