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.
- package/README.md +423 -101
- package/dist/agents/coding/index.d.ts +1 -0
- package/dist/agents/coding/index.d.ts.map +1 -1
- package/dist/agents/coding/index.js +3 -0
- package/dist/agents/coding/index.js.map +1 -1
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +1 -0
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/terminal/index.d.ts +10 -0
- package/dist/agents/terminal/index.d.ts.map +1 -0
- package/dist/agents/terminal/index.js +20 -0
- package/dist/agents/terminal/index.js.map +1 -0
- package/dist/agents/terminal/phases.d.ts +4 -0
- package/dist/agents/terminal/phases.d.ts.map +1 -0
- package/dist/agents/terminal/phases.js +29 -0
- package/dist/agents/terminal/phases.js.map +1 -0
- package/dist/agents/terminal/prompt.d.ts +13 -0
- package/dist/agents/terminal/prompt.d.ts.map +1 -0
- package/dist/agents/terminal/prompt.js +33 -0
- package/dist/agents/terminal/prompt.js.map +1 -0
- package/dist/agents/terminal/strategy.d.ts +3 -0
- package/dist/agents/terminal/strategy.d.ts.map +1 -0
- package/dist/agents/terminal/strategy.js +12 -0
- package/dist/agents/terminal/strategy.js.map +1 -0
- package/dist/agents/types.d.ts +6 -0
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +188 -0
- package/dist/cli.js.map +1 -0
- package/dist/engine/background.d.ts +48 -0
- package/dist/engine/background.d.ts.map +1 -0
- package/dist/engine/background.js +98 -0
- package/dist/engine/background.js.map +1 -0
- package/dist/engine/budgets.d.ts +1 -0
- package/dist/engine/budgets.d.ts.map +1 -1
- package/dist/engine/budgets.js +3 -0
- package/dist/engine/budgets.js.map +1 -1
- package/dist/engine/dispatch.d.ts +89 -0
- package/dist/engine/dispatch.d.ts.map +1 -0
- package/dist/engine/dispatch.js +262 -0
- package/dist/engine/dispatch.js.map +1 -0
- package/dist/engine/events.d.ts +46 -2
- package/dist/engine/events.d.ts.map +1 -1
- package/dist/engine/guardrails.d.ts +54 -0
- package/dist/engine/guardrails.d.ts.map +1 -0
- package/dist/engine/guardrails.js +91 -0
- package/dist/engine/guardrails.js.map +1 -0
- package/dist/engine/inbox.d.ts +109 -0
- package/dist/engine/inbox.d.ts.map +1 -0
- package/dist/engine/inbox.js +94 -0
- package/dist/engine/inbox.js.map +1 -0
- package/dist/engine/intent.d.ts +8 -0
- package/dist/engine/intent.d.ts.map +1 -0
- package/dist/engine/intent.js +22 -0
- package/dist/engine/intent.js.map +1 -0
- package/dist/engine/loop.d.ts.map +1 -1
- package/dist/engine/loop.js +769 -242
- package/dist/engine/loop.js.map +1 -1
- package/dist/engine/operations.d.ts +82 -0
- package/dist/engine/operations.d.ts.map +1 -0
- package/dist/engine/operations.js +143 -0
- package/dist/engine/operations.js.map +1 -0
- package/dist/engine/thread.d.ts +3 -0
- package/dist/engine/thread.d.ts.map +1 -1
- package/dist/engine/thread.js.map +1 -1
- package/dist/engine/types.d.ts +119 -7
- package/dist/engine/types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/ledger/alignment.d.ts +30 -0
- package/dist/ledger/alignment.d.ts.map +1 -0
- package/dist/ledger/alignment.js +116 -0
- package/dist/ledger/alignment.js.map +1 -0
- package/dist/ledger/compiler.d.ts +23 -0
- package/dist/ledger/compiler.d.ts.map +1 -0
- package/dist/ledger/compiler.js +134 -0
- package/dist/ledger/compiler.js.map +1 -0
- package/dist/ledger/config.d.ts +15 -0
- package/dist/ledger/config.d.ts.map +1 -0
- package/dist/ledger/config.js +2 -0
- package/dist/ledger/config.js.map +1 -0
- package/dist/ledger/index.d.ts +6 -0
- package/dist/ledger/index.d.ts.map +1 -0
- package/dist/ledger/index.js +6 -0
- package/dist/ledger/index.js.map +1 -0
- package/dist/ledger/ledger.d.ts +45 -0
- package/dist/ledger/ledger.d.ts.map +1 -0
- package/dist/ledger/ledger.js +181 -0
- package/dist/ledger/ledger.js.map +1 -0
- package/dist/ledger/types.d.ts +97 -0
- package/dist/ledger/types.d.ts.map +1 -0
- package/dist/ledger/types.js +12 -0
- package/dist/ledger/types.js.map +1 -0
- package/dist/llm/index.d.ts +13 -0
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +4 -1
- package/dist/llm/index.js.map +1 -1
- package/dist/llm/openai-compatible.d.ts +15 -1
- package/dist/llm/openai-compatible.d.ts.map +1 -1
- package/dist/llm/openai-compatible.js +25 -0
- package/dist/llm/openai-compatible.js.map +1 -1
- package/dist/llm/structured.d.ts +36 -0
- package/dist/llm/structured.d.ts.map +1 -0
- package/dist/llm/structured.js +44 -0
- package/dist/llm/structured.js.map +1 -0
- package/dist/llm/types.d.ts +31 -2
- package/dist/llm/types.d.ts.map +1 -1
- package/dist/lsp/client.d.ts +33 -0
- package/dist/lsp/client.d.ts.map +1 -0
- package/dist/lsp/client.js +137 -0
- package/dist/lsp/client.js.map +1 -0
- package/dist/lsp/index.d.ts +15 -0
- package/dist/lsp/index.d.ts.map +1 -0
- package/dist/lsp/index.js +13 -0
- package/dist/lsp/index.js.map +1 -0
- package/dist/lsp/protocol.d.ts +25 -0
- package/dist/lsp/protocol.d.ts.map +1 -0
- package/dist/lsp/protocol.js +45 -0
- package/dist/lsp/protocol.js.map +1 -0
- package/dist/lsp/tools.d.ts +6 -0
- package/dist/lsp/tools.d.ts.map +1 -0
- package/dist/lsp/tools.js +198 -0
- package/dist/lsp/tools.js.map +1 -0
- package/dist/lsp/typescript.d.ts +67 -0
- package/dist/lsp/typescript.d.ts.map +1 -0
- package/dist/lsp/typescript.js +266 -0
- package/dist/lsp/typescript.js.map +1 -0
- package/dist/sandbox/command.d.ts +7 -0
- package/dist/sandbox/command.d.ts.map +1 -0
- package/dist/sandbox/command.js +60 -0
- package/dist/sandbox/command.js.map +1 -0
- package/dist/sandbox/docker/image.d.ts +12 -0
- package/dist/sandbox/docker/image.d.ts.map +1 -0
- package/dist/sandbox/docker/image.js +52 -0
- package/dist/sandbox/docker/image.js.map +1 -0
- package/dist/sandbox/docker/index.d.ts +22 -1
- package/dist/sandbox/docker/index.d.ts.map +1 -1
- package/dist/sandbox/docker/index.js +245 -25
- package/dist/sandbox/docker/index.js.map +1 -1
- package/dist/sandbox/e2b/image.d.ts +13 -0
- package/dist/sandbox/e2b/image.d.ts.map +1 -0
- package/dist/sandbox/e2b/image.js +57 -0
- package/dist/sandbox/e2b/image.js.map +1 -0
- package/dist/sandbox/e2b/index.d.ts +3 -1
- package/dist/sandbox/e2b/index.d.ts.map +1 -1
- package/dist/sandbox/e2b/index.js +103 -0
- package/dist/sandbox/e2b/index.js.map +1 -1
- package/dist/sandbox/heyo/exec.d.ts +2 -0
- package/dist/sandbox/heyo/exec.d.ts.map +1 -1
- package/dist/sandbox/heyo/exec.js +11 -0
- package/dist/sandbox/heyo/exec.js.map +1 -1
- package/dist/sandbox/heyo/image.d.ts +15 -0
- package/dist/sandbox/heyo/image.d.ts.map +1 -0
- package/dist/sandbox/heyo/image.js +74 -0
- package/dist/sandbox/heyo/image.js.map +1 -0
- package/dist/sandbox/heyo/index.d.ts +21 -3
- package/dist/sandbox/heyo/index.d.ts.map +1 -1
- package/dist/sandbox/heyo/index.js +193 -16
- package/dist/sandbox/heyo/index.js.map +1 -1
- package/dist/sandbox/image.d.ts +62 -0
- package/dist/sandbox/image.d.ts.map +1 -0
- package/dist/sandbox/image.js +23 -0
- package/dist/sandbox/image.js.map +1 -0
- package/dist/sandbox/index.d.ts +1 -0
- package/dist/sandbox/index.d.ts.map +1 -1
- package/dist/sandbox/index.js +1 -0
- package/dist/sandbox/index.js.map +1 -1
- package/dist/sandbox/local/index.d.ts +3 -1
- package/dist/sandbox/local/index.d.ts.map +1 -1
- package/dist/sandbox/local/index.js +34 -0
- package/dist/sandbox/local/index.js.map +1 -1
- package/dist/sandbox/process.d.ts +55 -0
- package/dist/sandbox/process.d.ts.map +1 -0
- package/dist/sandbox/process.js +165 -0
- package/dist/sandbox/process.js.map +1 -0
- package/dist/sandbox/provider.d.ts +12 -0
- package/dist/sandbox/provider.d.ts.map +1 -1
- package/dist/sandbox/types.d.ts +55 -3
- package/dist/sandbox/types.d.ts.map +1 -1
- package/dist/sandbox/types.js.map +1 -1
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +108 -3
- package/dist/testing.js.map +1 -1
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +5 -13
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/finish.d.ts +14 -0
- package/dist/tools/finish.d.ts.map +1 -1
- package/dist/tools/finish.js +13 -3
- package/dist/tools/finish.js.map +1 -1
- package/dist/tools/index.d.ts +3 -2
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +1 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/truncate.d.ts +7 -0
- package/dist/tools/truncate.d.ts.map +1 -1
- package/dist/tools/truncate.js +12 -0
- package/dist/tools/truncate.js.map +1 -1
- package/dist/tools/types.d.ts +81 -1
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js +26 -1
- package/dist/tools/types.js.map +1 -1
- 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/
|
|
4
|
-
<img src="https://raw.githubusercontent.com/hrithikkoduri/anchor-ai-sdk/
|
|
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
|
-
<
|
|
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
|
-
<
|
|
12
|
-
|
|
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://
|
|
17
|
-
<a href="
|
|
18
|
-
<a href="
|
|
19
|
-
<
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
| **
|
|
47
|
-
| **
|
|
48
|
-
| **
|
|
49
|
-
| **
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
86
|
-
|
|
87
|
-
ref: "main",
|
|
190
|
+
const provider = docker({
|
|
191
|
+
image: requiredEnv("ANCHOR_DOCKER_IMAGE"),
|
|
88
192
|
});
|
|
89
|
-
|
|
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
|
|
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.
|
|
226
|
+
console.log(result.summary, result.reason, result.evidence);
|
|
96
227
|
} finally {
|
|
97
228
|
await sandbox.destroy();
|
|
98
229
|
}
|
|
99
230
|
```
|
|
100
231
|
|
|
101
|
-
|
|
102
|
-
|
|
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
|
-
##
|
|
435
|
+
## Evaluated, with the limits visible
|
|
105
436
|
|
|
106
|
-
|
|
437
|
+
The completed **Parasail GLM 5.3 / SWE-bench Lite-10** records show:
|
|
438
|
+
|
|
439
|
+
| | Anchor | mini-swe-agent |
|
|
107
440
|
| --- | --- | --- |
|
|
108
|
-
|
|
|
109
|
-
|
|
|
110
|
-
|
|
|
111
|
-
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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;
|
|
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,
|
|
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"}
|
package/dist/agents/index.d.ts
CHANGED
|
@@ -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"}
|
package/dist/agents/index.js
CHANGED
package/dist/agents/index.js.map
CHANGED
|
@@ -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
|