maestro-agent-sdk 0.1.3 → 0.1.5
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 +216 -20
- package/dist/agents/contracts.d.ts +10 -0
- package/dist/agents/contracts.d.ts.map +1 -1
- package/dist/agents/rollout/shared.d.ts +4 -4
- package/dist/agents/rollout/shared.js +4 -4
- package/dist/core/loop.d.ts.map +1 -1
- package/dist/core/loop.js +9 -8
- package/dist/core/loop.js.map +1 -1
- package/dist/index.d.ts +8 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/memory/compressor.d.ts +8 -5
- package/dist/memory/compressor.d.ts.map +1 -1
- package/dist/memory/compressor.js +10 -4
- package/dist/memory/compressor.js.map +1 -1
- package/dist/memory/reminder.d.ts +11 -12
- package/dist/memory/reminder.d.ts.map +1 -1
- package/dist/memory/reminder.js +22 -32
- package/dist/memory/reminder.js.map +1 -1
- package/dist/platform/config.d.ts +0 -2
- package/dist/platform/config.d.ts.map +1 -1
- package/dist/platform/config.js +9 -18
- package/dist/platform/config.js.map +1 -1
- package/dist/platform/version.d.ts +13 -0
- package/dist/platform/version.d.ts.map +1 -0
- package/dist/platform/version.js +13 -0
- package/dist/platform/version.js.map +1 -0
- package/dist/provider.d.ts +62 -0
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +137 -30
- package/dist/provider.js.map +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +16 -1
- package/dist/registry.js.map +1 -1
- package/dist/session-store.d.ts +95 -4
- package/dist/session-store.d.ts.map +1 -1
- package/dist/session-store.js +144 -13
- package/dist/session-store.js.map +1 -1
- package/dist/skills/curator.d.ts +8 -6
- package/dist/skills/curator.d.ts.map +1 -1
- package/dist/skills/curator.js +13 -7
- package/dist/skills/curator.js.map +1 -1
- package/dist/skills/loader.d.ts +45 -20
- package/dist/skills/loader.d.ts.map +1 -1
- package/dist/skills/loader.js +56 -11
- package/dist/skills/loader.js.map +1 -1
- package/dist/state/tasks.d.ts +107 -0
- package/dist/state/tasks.d.ts.map +1 -0
- package/dist/state/tasks.js +398 -0
- package/dist/state/tasks.js.map +1 -0
- package/dist/sub-agent/runner.d.ts +1 -1
- package/dist/sub-agent/runner.d.ts.map +1 -1
- package/dist/sub-agent/runner.js +3 -5
- package/dist/sub-agent/runner.js.map +1 -1
- package/dist/tools/builtin/edit.d.ts.map +1 -1
- package/dist/tools/builtin/edit.js +0 -4
- package/dist/tools/builtin/edit.js.map +1 -1
- package/dist/tools/builtin/glob.d.ts +17 -0
- package/dist/tools/builtin/glob.d.ts.map +1 -0
- package/dist/tools/builtin/glob.js +235 -0
- package/dist/tools/builtin/glob.js.map +1 -0
- package/dist/tools/builtin/grep.d.ts +3 -0
- package/dist/tools/builtin/grep.d.ts.map +1 -0
- package/dist/tools/builtin/grep.js +272 -0
- package/dist/tools/builtin/grep.js.map +1 -0
- package/dist/tools/builtin/read.d.ts.map +1 -1
- package/dist/tools/builtin/read.js +0 -4
- package/dist/tools/builtin/read.js.map +1 -1
- package/dist/tools/builtin/skill_write.d.ts +53 -0
- package/dist/tools/builtin/skill_write.d.ts.map +1 -0
- package/dist/tools/builtin/skill_write.js +264 -0
- package/dist/tools/builtin/skill_write.js.map +1 -0
- package/dist/tools/builtin/tasks.d.ts +34 -0
- package/dist/tools/builtin/tasks.d.ts.map +1 -0
- package/dist/tools/builtin/tasks.js +258 -0
- package/dist/tools/builtin/tasks.js.map +1 -0
- package/dist/tools/builtin/write.d.ts +4 -10
- package/dist/tools/builtin/write.d.ts.map +1 -1
- package/dist/tools/builtin/write.js.map +1 -1
- package/dist/tools/file-state.d.ts +1 -1
- package/dist/tools/file-state.js +1 -1
- package/dist/tools/registry.d.ts +1 -1
- package/dist/types.d.ts +64 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/state/todos.d.ts +0 -95
- package/dist/state/todos.d.ts.map +0 -1
- package/dist/state/todos.js +0 -198
- package/dist/state/todos.js.map +0 -1
- package/dist/tools/builtin/sandbox.d.ts +0 -16
- package/dist/tools/builtin/sandbox.d.ts.map +0 -1
- package/dist/tools/builtin/sandbox.js +0 -59
- package/dist/tools/builtin/sandbox.js.map +0 -1
- package/dist/tools/builtin/todo_write.d.ts +0 -29
- package/dist/tools/builtin/todo_write.d.ts.map +0 -1
- package/dist/tools/builtin/todo_write.js +0 -96
- package/dist/tools/builtin/todo_write.js.map +0 -1
- package/dist/tools/hooks/sandbox-fs.d.ts +0 -25
- package/dist/tools/hooks/sandbox-fs.d.ts.map +0 -1
- package/dist/tools/hooks/sandbox-fs.js +0 -48
- package/dist/tools/hooks/sandbox-fs.js.map +0 -1
package/README.md
CHANGED
|
@@ -4,22 +4,30 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/maestro-agent-sdk)
|
|
5
5
|
[](./LICENSE)
|
|
6
6
|
|
|
7
|
-
**Embeddable
|
|
7
|
+
**Embeddable agent SDK that ships skills, memory, and MCP out of the box.**
|
|
8
|
+
Anthropic + DeepSeek today, BYO-provider in one file. No CLI, no gateway, no host lock-in.
|
|
8
9
|
|
|
9
10
|
> **Status:** Early port (v0.1.x). Active development. API surface may change before 1.0.
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
Inspired by [Claude Code](https://www.anthropic.com/claude-code) and [`hermes-agent`](https://github.com/NousResearch/hermes-agent) — same agent-loop shape, repackaged as an embeddable TypeScript library.
|
|
13
|
+
|
|
14
|
+
### How it compares
|
|
15
|
+
|
|
16
|
+
| | What you get |
|
|
17
|
+
|---|---|
|
|
18
|
+
| **vs [`@anthropic-ai/claude-agent-sdk`](https://github.com/anthropics/claude-agent-sdk-typescript)** | Multi-provider from day one (Anthropic + DeepSeek), with skills (`SKILL.md` / `skill.md` indexing), memory (auto context compaction), and MCP client pool built in — not provided as separate add-ons. |
|
|
19
|
+
| **vs LangChain / LangGraph** | Thin loop, no DSL. A provider is one adapter file; a tool is `{ name, description, schema, run }`. You read the source in an afternoon. |
|
|
12
20
|
|
|
13
21
|
## What's in the box
|
|
14
22
|
|
|
15
23
|
- **Agent loop** — provider-driven tool-calling loop with iteration cap, abort signal, and event stream.
|
|
16
24
|
- **Pluggable providers** — first-class adapters for Anthropic (Claude) and DeepSeek V4; provider-neutral message schema so adding OpenAI / Gemini / Ollama is a thin file.
|
|
17
|
-
- **Built-in tools** — `bash`, `
|
|
25
|
+
- **Built-in tools** — `bash`, `Read`, `Write`, `Edit`, `Glob`, `Grep`, `Agent` (sub-agent delegation), `TaskCreate`/`TaskUpdate`/`TaskList`/`TaskGet`, `WebFetch`, `skill_view`, `skill_write`. Bring your own via `ToolRegistry`. Grep shells out to ripgrep (`rg`) so install it if you want the tool active; the SDK surfaces a structured error pointing to the install path when missing.
|
|
18
26
|
- **MCP** — built-in client pool (stdio + SSE) so any MCP server (`@modelcontextprotocol/sdk`) shows up as tools.
|
|
19
|
-
- **Skills** —
|
|
20
|
-
- **Memory** — automatic context compression (summarization + pruning) when the token budget is hit.
|
|
21
|
-
- **
|
|
22
|
-
- **Host integration via DI** — `setLogger`, `setMcpResolver`, `setConversationReader` let you embed without inheriting any one host's opinions.
|
|
27
|
+
- **Skills** — per-workspace `.skills/<skillKey>/<name>/skill.md` packages with FTS-style indexing, on-demand body load (`skill_view`), and agent-autonomous authoring (`skill_write`).
|
|
28
|
+
- **Memory** — automatic context compression (summarization + pruning) when the token budget is hit. Reuses the agent's own model for compaction — no separate model knob.
|
|
29
|
+
- **Session persistence** — multi-turn resume via `~/.maestro/sessions/<sessionId>.jsonl`, with a `_meta` header capturing `cwd`, `skillKey`, `userId`, and host metadata for forensics.
|
|
30
|
+
- **Host integration via DI** — `setLogger`, `setMcpResolver`, `setConversationReader` let you embed without inheriting any one host's opinions. FS policy (path allowlists, owner checks) is a host concern — register a `PreToolUseHook` via `ToolRegistry.use()`.
|
|
23
31
|
|
|
24
32
|
## Install
|
|
25
33
|
|
|
@@ -112,20 +120,143 @@ for await (const event of runConversation(agent, "Summarize today's news.")) {
|
|
|
112
120
|
> | `max` | 65 536 | 200 |
|
|
113
121
|
|
|
114
122
|
More runnable scripts live under [`examples/`](./examples) — Anthropic, DeepSeek,
|
|
115
|
-
|
|
123
|
+
a custom-tool walkthrough, and a `skill_write` demo.
|
|
124
|
+
|
|
125
|
+
## Skills — per-workspace, agent-autonomous
|
|
126
|
+
|
|
127
|
+
Skill catalog routing is deterministic from `(opts.cwd, opts.skillKey)`:
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
skillKey set → <cwd>/.skills/<skillKey>/
|
|
131
|
+
skillKey unset → <cwd>/.skills/default/ (uses MAESTRO_DEFAULT_SKILL_KEY)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Every skill lives under a **named key** subdirectory. The SDK never reads from
|
|
135
|
+
`<cwd>/.skills/` directly, so a host can list "which profiles exist in this
|
|
136
|
+
workspace?" with one `readdir`. One workspace can host multiple disjoint
|
|
137
|
+
catalogs (e.g. `legal/`, `coding/`, `research/`) and each session selects its
|
|
138
|
+
profile by passing `skillKey`.
|
|
139
|
+
|
|
140
|
+
### On-disk layout
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
<cwd>/.skills/
|
|
144
|
+
├── default/ ← skillKey omitted
|
|
145
|
+
│ └── general/note-template/skill.md
|
|
146
|
+
├── legal/ ← skillKey: "legal"
|
|
147
|
+
│ └── general/
|
|
148
|
+
│ ├── ocr/
|
|
149
|
+
│ │ ├── skill.md
|
|
150
|
+
│ │ ├── scripts/preprocess.py
|
|
151
|
+
│ │ └── references/api.md
|
|
152
|
+
│ └── hearing-report/skill.md
|
|
153
|
+
└── coding/ ← skillKey: "coding"
|
|
154
|
+
└── general/code-review/skill.md
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Manifest format (clawgram-style)
|
|
158
|
+
|
|
159
|
+
Two filename conventions are accepted: `SKILL.md` (upstream v0.13.0 with YAML
|
|
160
|
+
frontmatter) and `skill.md` (lowercase, body-based). For new skills the
|
|
161
|
+
clawgram convention is recommended:
|
|
162
|
+
|
|
163
|
+
```markdown
|
|
164
|
+
# OCR 텍스트 추출 (English subtitle)
|
|
165
|
+
|
|
166
|
+
> **Description**: OCR, 이미지 읽어줘, PDF 텍스트 추출 요청 시 트리거.
|
|
167
|
+
|
|
168
|
+
## Required MCP
|
|
169
|
+
- ocr
|
|
170
|
+
- paddleocr
|
|
171
|
+
|
|
172
|
+
## 트리거
|
|
173
|
+
- ...
|
|
174
|
+
|
|
175
|
+
## 프로세스
|
|
176
|
+
### 1. 이미지 준비
|
|
177
|
+
### 2. paddleocr 실행
|
|
178
|
+
|
|
179
|
+
## Gotchas
|
|
180
|
+
- 흐릿한 이미지는 deskew 필요
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
The first heading is the display title; the `> **Description**: ...` blockquote
|
|
184
|
+
carries the trigger keywords (this drives system-prompt activation). The
|
|
185
|
+
loader extracts the description from either YAML frontmatter or this
|
|
186
|
+
blockquote — both styles can coexist in the same `.skills/<key>/` tree.
|
|
187
|
+
|
|
188
|
+
### Authoring from inside the agent — `skill_write`
|
|
189
|
+
|
|
190
|
+
The model can persist new skills mid-session, including adjacent assets
|
|
191
|
+
(scripts, templates, references), in one transactional call:
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
skill_write({
|
|
195
|
+
name: "ocr", // kebab-case, becomes the folder name
|
|
196
|
+
content: "# OCR ...\n\n> **Description**: OCR, 이미지 읽어줘\n\n...",
|
|
197
|
+
files: {
|
|
198
|
+
"scripts/preprocess.py": "import cv2\n...",
|
|
199
|
+
"scripts/run.sh": "#!/bin/bash\n...",
|
|
200
|
+
"templates/report.html": "<!doctype html>...",
|
|
201
|
+
"references/paddleocr-api.md": "# PaddleOCR API\n...",
|
|
202
|
+
},
|
|
203
|
+
overwrite: false, // default: refuse to clobber
|
|
204
|
+
});
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Resulting layout under `<skillsDir>/ocr/`:
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
ocr/
|
|
211
|
+
├── skill.md ← from `content`
|
|
212
|
+
├── scripts/
|
|
213
|
+
│ ├── preprocess.py
|
|
214
|
+
│ └── run.sh
|
|
215
|
+
├── templates/report.html
|
|
216
|
+
└── references/paddleocr-api.md
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Safety:
|
|
220
|
+
|
|
221
|
+
- kebab-case validation on `name`
|
|
222
|
+
- relative-path validation on every `files` key (rejects `..` escapes,
|
|
223
|
+
absolute prefixes, backslashes, and the reserved `skill.md` name)
|
|
224
|
+
- `overwrite=false` → batch aborts BEFORE any disk touch if any target
|
|
225
|
+
already exists (validate-all-then-write)
|
|
226
|
+
- cache invalidation on success → the new skill appears in the NEXT turn's
|
|
227
|
+
`<available_skills>` catalog (intentionally not the current turn — would
|
|
228
|
+
break the prompt cache)
|
|
229
|
+
|
|
230
|
+
### Reading from the model side — `skill_view`
|
|
231
|
+
|
|
232
|
+
The system prompt only carries name + summary per skill (FTS-style index).
|
|
233
|
+
When the model decides a skill is relevant it calls `skill_view(name)` and
|
|
234
|
+
gets the full body back, with a `[Skill directory: ...]` hint so relative
|
|
235
|
+
paths in the body resolve against the right cwd.
|
|
116
236
|
|
|
117
237
|
## Configuration
|
|
118
238
|
|
|
119
|
-
|
|
120
|
-
|
|
239
|
+
Per-call options on `AgentQueryOptions`:
|
|
240
|
+
|
|
241
|
+
| Option | Required | Purpose |
|
|
242
|
+
|---|---|---|
|
|
243
|
+
| `cwd` | ✓ | Workspace root. Drives `.skills/` location, rollout `_meta`, and the `mkdir` invariant. |
|
|
244
|
+
| `skillKey` | — | Named skill profile within `<cwd>/.skills/`. Omit for `default`. |
|
|
245
|
+
| `allowedSkills` | — | Per-call name whitelist applied before curation. |
|
|
246
|
+
| `sessionMetadata` | — | Opaque host bag round-tripped via the rollout `_meta` header. |
|
|
247
|
+
|
|
248
|
+
The SDK resolves its data directory at module load. Override via env var
|
|
249
|
+
**before** importing any SDK module (the value is captured once):
|
|
121
250
|
|
|
122
251
|
| Env var | Default | What it does |
|
|
123
252
|
|---|---|---|
|
|
124
|
-
| `MAESTRO_DATA_DIR` | `~/.maestro` | Where session JSONLs
|
|
125
|
-
|
|
126
|
-
|
|
253
|
+
| `MAESTRO_DATA_DIR` | `~/.maestro` | Where session JSONLs and todo stores live. `maestroSessionsDir()` resolves to `<DATA_DIR>/sessions`. |
|
|
254
|
+
|
|
255
|
+
Everything else is per-call: pass `cwd`, `model`, `effort`, etc. through
|
|
256
|
+
`AIAgentConfig` / `AgentQueryOptions`. The memory compressor reuses the
|
|
257
|
+
agent's configured `model` — no separate compression-model knob.
|
|
127
258
|
|
|
128
|
-
For session housekeeping there's a helper
|
|
259
|
+
For session housekeeping there's a helper hosts can wire into their
|
|
129
260
|
startup sweep:
|
|
130
261
|
|
|
131
262
|
```ts
|
|
@@ -136,19 +267,84 @@ const { scanned, removed } = cleanupStaleMaestroSessions();
|
|
|
136
267
|
console.log(`maestro sweep: removed ${removed}/${scanned}`);
|
|
137
268
|
```
|
|
138
269
|
|
|
270
|
+
## Tasks — granular CRUD via Claude-Code-style `Task*` family
|
|
271
|
+
|
|
272
|
+
v0.1.5 replaced the v0.1.x `TodoWrite` snapshot-replace tool with the
|
|
273
|
+
`Task*` family — `TaskCreate`, `TaskUpdate`, `TaskList`, `TaskGet`. The
|
|
274
|
+
trade-off: per-call payloads are smaller (one task at a time vs the whole
|
|
275
|
+
list every turn) and the model gets first-class dependency edges and
|
|
276
|
+
per-task metadata.
|
|
277
|
+
|
|
278
|
+
```ts
|
|
279
|
+
// Bootstrap a multi-step plan.
|
|
280
|
+
TaskCreate({ subject: "Read spec", activeForm: "Reading spec" });
|
|
281
|
+
// → { ok: true, id: "1", subject: "Read spec" }
|
|
282
|
+
|
|
283
|
+
TaskCreate({ subject: "Implement loader" });
|
|
284
|
+
// → { ok: true, id: "2" }
|
|
285
|
+
|
|
286
|
+
TaskCreate({ subject: "Write tests", owner: "general" });
|
|
287
|
+
// → { ok: true, id: "3" }
|
|
288
|
+
|
|
289
|
+
// Wire dependencies. Both sides update in sync.
|
|
290
|
+
TaskUpdate({ taskId: "3", addBlockedBy: ["2"] });
|
|
291
|
+
|
|
292
|
+
// Advance status. Setting in_progress demotes any other in-flight task.
|
|
293
|
+
TaskUpdate({ taskId: "1", status: "in_progress" });
|
|
294
|
+
TaskUpdate({ taskId: "1", status: "completed" });
|
|
295
|
+
TaskUpdate({ taskId: "2", status: "in_progress" });
|
|
296
|
+
// → { ok: true, task: {...}, demotedId: "1" } // (was already completed, no-op)
|
|
297
|
+
|
|
298
|
+
// Read side — the per-turn system reminder already renders a summary;
|
|
299
|
+
// TaskList exists for programmatic refresh after batch updates.
|
|
300
|
+
TaskList();
|
|
301
|
+
// TaskGet({ taskId: "2" }) for the full entry with description + metadata.
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
Persistence: `~/.maestro/sessions/<sessionId>.tasks.json` (`version: 2`).
|
|
305
|
+
Files written by SDK ≤ 0.1.4 land at `.todos.json` (`version: 1`); the
|
|
306
|
+
v0.1.5 store auto-migrates on first hydrate so existing sessions keep their
|
|
307
|
+
plan without manual conversion. The migration strips the `task-N` prefix
|
|
308
|
+
to bare numeric ids and maps `content` → `subject`.
|
|
309
|
+
|
|
310
|
+
The system reminder rendered every turn carries a compact view:
|
|
311
|
+
|
|
312
|
+
```
|
|
313
|
+
Tasks (1/3):
|
|
314
|
+
[✓] #1 Read spec
|
|
315
|
+
[→] #2 Implement loader
|
|
316
|
+
[ ] #3 Write tests (blocked by #2)
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
## Session rollout format (since v0.1.5)
|
|
320
|
+
|
|
321
|
+
Each session JSONL at `~/.maestro/sessions/<sessionId>.jsonl` carries a
|
|
322
|
+
`_meta` header line for forensics and host-side indexing:
|
|
323
|
+
|
|
324
|
+
```jsonl
|
|
325
|
+
{"_meta":{"version":1,"cwd":"/path","skillKey":"legal","userId":"...","createdAt":"2026-05-18T...","sdkVersion":"0.1.5","skillsDir":"...","metadata":{...}}}
|
|
326
|
+
{"role":"user","content":"..."}
|
|
327
|
+
{"role":"assistant","content":[...]}
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
Backward-compatible: files written by SDK ≤ 0.1.4 had no header — the loader
|
|
331
|
+
treats their first line as a regular message. Hosts that want to inspect
|
|
332
|
+
session metadata without reading the full message log can call
|
|
333
|
+
`loadMaestroSessionMeta(sessionId)`.
|
|
334
|
+
|
|
139
335
|
## Architecture
|
|
140
336
|
|
|
141
337
|
```
|
|
142
338
|
src/
|
|
143
339
|
├── core/ AIAgent class + run_conversation loop
|
|
144
|
-
├── tools/ ToolRegistry + builtin tools +
|
|
340
|
+
├── tools/ ToolRegistry + builtin tools + PreToolUse/PostToolUse hook surface
|
|
145
341
|
├── providers/ Provider adapters (anthropic, deepseek)
|
|
146
342
|
├── mcp/ MCP client pool (stdio + SSE)
|
|
147
|
-
├── skills/
|
|
343
|
+
├── skills/ Skill loader, index builder, usage tracker, curator
|
|
148
344
|
├── memory/ Context compressor, token estimator, reminders, scrubber
|
|
149
345
|
├── state/ Per-session todo store
|
|
150
|
-
├── sub-agent/ Sub-agent runner for the `
|
|
151
|
-
├── platform/ Injectable host adapters (logger, lifecycle, config, jsonl, mcp-config)
|
|
346
|
+
├── sub-agent/ Sub-agent runner for the `Agent` tool
|
|
347
|
+
├── platform/ Injectable host adapters (logger, lifecycle, config, jsonl, version, mcp-config)
|
|
152
348
|
├── agents/ Cross-agent rollout helpers + per-agent registry contract
|
|
153
349
|
├── storage/ ConversationReader DI (host supplies past turns for cross-agent forks)
|
|
154
350
|
└── media/ File-event extraction from inline `[FILE:/path]` tags
|
|
@@ -186,7 +382,7 @@ cd maestro-agent-sdk
|
|
|
186
382
|
npm install
|
|
187
383
|
npm run typecheck # tsc --noEmit
|
|
188
384
|
npm run build # tsc + tsc-alias → dist/
|
|
189
|
-
npm test # vitest,
|
|
385
|
+
npm test # vitest, 426 tests (+11 skipped without ripgrep)
|
|
190
386
|
```
|
|
191
387
|
|
|
192
388
|
### Known gaps
|
|
@@ -200,4 +396,4 @@ They rely on host-side helpers (`appendConversationEvent`, `getConversationPath`
|
|
|
200
396
|
|
|
201
397
|
## License
|
|
202
398
|
|
|
203
|
-
[MIT](./LICENSE)
|
|
399
|
+
[MIT](./LICENSE). Design influenced by [Claude Code](https://www.anthropic.com/claude-code) and Nous Research's [`hermes-agent`](https://github.com/NousResearch/hermes-agent) (also MIT); see [NOTICE](./NOTICE) for attribution details.
|
|
@@ -12,6 +12,16 @@ export interface WriteRolloutOptions {
|
|
|
12
12
|
cwd: string;
|
|
13
13
|
entries: ConversationEntry[];
|
|
14
14
|
reuseSessionId?: string;
|
|
15
|
+
/** Optional host-side identifier carried into the rollout `_meta` header
|
|
16
|
+
* (since v0.1.5). Hosts that orchestrate multiple users can pass their
|
|
17
|
+
* user id here so a later sweep can attribute the JSONL without opening
|
|
18
|
+
* the conversation log it was synthesized from. */
|
|
19
|
+
userId?: string;
|
|
20
|
+
/** Opaque host-supplied bag persisted with the rollout. The registry
|
|
21
|
+
* passes it through to `writeMaestroRollout` verbatim; the SDK never
|
|
22
|
+
* reads the shape. Useful for `topicId`, `groupId`, or any other host
|
|
23
|
+
* identifier the meta header should round-trip. */
|
|
24
|
+
metadata?: Record<string, unknown>;
|
|
15
25
|
}
|
|
16
26
|
export interface WriteRolloutResult {
|
|
17
27
|
sessionId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/agents/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtD;;;;;;;GAOG;AAEH,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,iBAAiB,EAAE,C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,CAAC;IACpC,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,YAAY,EAAE,SAAS,WAAW,EAAE,CAAC;IACrC,cAAc,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;IACxC,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IACzD,YAAY,CAAC,IAAI,EAAE,mBAAmB,GAAG,kBAAkB,CAAC;IAC5D,WAAW,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACpE,eAAe,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9D"}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Helpers shared by every agent's rollout encoder.
|
|
3
3
|
*
|
|
4
4
|
* The cwd-validation step that some upstream hosts implement against a
|
|
5
|
-
* hard-coded
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* hard-coded workspace-root pair is omitted here: hosts may route any cwd
|
|
6
|
+
* through the agent loop, and the SDK has no business dictating where a
|
|
7
|
+
* session may live. The other helpers (UUID shape, `extractChatPairs`)
|
|
8
|
+
* are kept verbatim.
|
|
9
9
|
*/
|
|
10
10
|
import type { ConversationEntry } from "../../storage/conversations.js";
|
|
11
11
|
export declare function clone<T>(obj: T): T;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Helpers shared by every agent's rollout encoder.
|
|
3
3
|
*
|
|
4
4
|
* The cwd-validation step that some upstream hosts implement against a
|
|
5
|
-
* hard-coded
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* hard-coded workspace-root pair is omitted here: hosts may route any cwd
|
|
6
|
+
* through the agent loop, and the SDK has no business dictating where a
|
|
7
|
+
* session may live. The other helpers (UUID shape, `extractChatPairs`)
|
|
8
|
+
* are kept verbatim.
|
|
9
9
|
*/
|
|
10
10
|
import { mkdirSync } from "node:fs";
|
|
11
11
|
import { logger } from "../../platform/logger.js";
|
package/dist/core/loop.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../src/core/loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAc,YAAY,EAAE,MAAM,SAAS,CAAC;AAkBxD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAuB,eAAe,CACpC,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,eAAe,EAAE,GAC1B,cAAc,CAAC,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../src/core/loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,KAAK,EAAc,YAAY,EAAE,MAAM,SAAS,CAAC;AAkBxD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAuB,eAAe,CACpC,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,eAAe,EAAE,GAC1B,cAAc,CAAC,YAAY,CAAC,CAkS9B"}
|
package/dist/core/loop.js
CHANGED
|
@@ -55,10 +55,10 @@ export async function* runConversation(agent, messages) {
|
|
|
55
55
|
}
|
|
56
56
|
// Two-stage context shrink before the provider call:
|
|
57
57
|
// 1. compressIfNeeded — runs pruneMessages internally, then if still
|
|
58
|
-
// over 80% of the context window dispatches the aux LLM
|
|
59
|
-
//
|
|
60
|
-
//
|
|
61
|
-
//
|
|
58
|
+
// over 80% of the context window dispatches the aux LLM to
|
|
59
|
+
// summarize the middle into the Active Task template. Returns the
|
|
60
|
+
// caller's array as-is when below threshold so the common case is
|
|
61
|
+
// just a token-estimate pass.
|
|
62
62
|
// 2. compressIfNeeded already prunes — no second pruneMessages call.
|
|
63
63
|
//
|
|
64
64
|
// Pure with respect to `messages` (canonical history kept intact for
|
|
@@ -66,12 +66,13 @@ export async function* runConversation(agent, messages) {
|
|
|
66
66
|
// array reference (both in prune.ts and compressor.ts) keeps back-to-
|
|
67
67
|
// back iterations near-zero CPU once the conversation stabilizes.
|
|
68
68
|
//
|
|
69
|
-
// Aux provider
|
|
70
|
-
//
|
|
71
|
-
//
|
|
72
|
-
//
|
|
69
|
+
// Aux provider + model are reused from the agent's main config — one
|
|
70
|
+
// client, one model id, no separate env var. Hosts that want compaction
|
|
71
|
+
// to run on a cheaper model can call compressIfNeeded directly with an
|
|
72
|
+
// explicit `auxModel`; this default keeps the SDK self-contained.
|
|
73
73
|
const wireMessages = await compressIfNeeded(messages, {
|
|
74
74
|
auxProvider: agent.provider,
|
|
75
|
+
auxModel: agent.config.model,
|
|
75
76
|
...(agent.config.abortSignal ? { abortSignal: agent.config.abortSignal } : {}),
|
|
76
77
|
});
|
|
77
78
|
// Drive the API call via stream() when available so we can emit
|
package/dist/core/loop.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loop.js","sourceRoot":"","sources":["../../src/core/loop.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAM1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C;;;;;;;;;;;;;GAaG;AACH,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,eAAe,CACpC,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QACrE,qEAAqE;QACrE,qEAAqE;QACrE,oEAAoE;QACpE,oBAAoB;QACpB,IAAI,KAAK,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;YACnC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC;YAC1D,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;YAC/D,IAAI,YAAY,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC5C,gBAAgB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;YAC9D,CAAC;QACH,CAAC;QAED,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC,CAAC;QAC3D,UAAU,EAAE,CAAC;IACf,CAAC;IAED,MAAM;QACJ,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,oCAAoC,OAAO,qBAAqB;KAC1E,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Originally derived from Nous Research's hermes-agent (MIT); see NOTICE.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export { MAESTRO_SDK_VERSION } from "./platform/version.js";
|
|
10
10
|
export declare const MAESTRO_UPSTREAM_SNAPSHOT: "v0.13.0 (2026-05-07)";
|
|
11
11
|
export { AIAgent, type AIAgentConfig } from "./core/agent.js";
|
|
12
12
|
export { runConversation } from "./core/loop.js";
|
|
@@ -15,17 +15,18 @@ export { bashTool } from "./tools/builtin/bash.js";
|
|
|
15
15
|
export { createReadTool } from "./tools/builtin/read.js";
|
|
16
16
|
export { createWriteTool } from "./tools/builtin/write.js";
|
|
17
17
|
export { createEditTool } from "./tools/builtin/edit.js";
|
|
18
|
-
export {
|
|
18
|
+
export { globTool, compileGlob } from "./tools/builtin/glob.js";
|
|
19
|
+
export { grepTool } from "./tools/builtin/grep.js";
|
|
20
|
+
export { createTaskCreateTool, createTaskUpdateTool, createTaskListTool, createTaskGetTool, } from "./tools/builtin/tasks.js";
|
|
19
21
|
export { createSkillViewTool } from "./tools/builtin/skill_view.js";
|
|
22
|
+
export { createSkillWriteTool } from "./tools/builtin/skill_write.js";
|
|
20
23
|
export { createAgentTool } from "./tools/builtin/agent.js";
|
|
21
|
-
export { isSandboxEnabled, checkFilesystemAccess } from "./tools/builtin/sandbox.js";
|
|
22
|
-
export { createSandboxFsHook } from "./tools/hooks/sandbox-fs.js";
|
|
23
24
|
export { getFileStateTracker, dropFileStateTracker } from "./tools/file-state.js";
|
|
24
25
|
export type { Provider, ProviderToolSchema, ProviderMessage, ProviderContentBlock, ProviderResponse, ProviderStreamChunk, ProviderCompleteOptions, } from "./providers/base.js";
|
|
25
26
|
export { AnthropicProvider, effortToThinkingBudget, effortToMaxIter, applyThinkingBudget, buildCacheableSystem, buildCacheableTools, buildCacheableMessages, } from "./providers/anthropic.js";
|
|
26
27
|
export { DeepseekProvider, effortForDeepseek, translateToolsToOpenAI, translateMessagesToOpenAI, } from "./providers/deepseek.js";
|
|
27
28
|
export { maestroRegistry } from "./registry.js";
|
|
28
|
-
export { maestroProvider, providerForModel, isAbortError, iterationBudgetLine } from "./provider.js";
|
|
29
|
+
export { maestroProvider, providerForModel, isAbortError, iterationBudgetLine, resolveSkillsDir, applySkillAllowlist, MAESTRO_DEFAULT_SKILL_KEY, } from "./provider.js";
|
|
29
30
|
export { loadSkillsCached, findSkillByName, type SkillEntry } from "./skills/loader.js";
|
|
30
31
|
export { buildSkillsIndex } from "./skills/index-builder.js";
|
|
31
32
|
export { curateSkills } from "./skills/curator.js";
|
|
@@ -35,9 +36,9 @@ export { estimateTokens } from "./memory/token-estimate.js";
|
|
|
35
36
|
export { buildSystemReminder } from "./memory/reminder.js";
|
|
36
37
|
export { hashToolContent } from "./memory/hash.js";
|
|
37
38
|
export { ACTIVE_TASK_TEMPLATE, wrapCompactedSummary } from "./memory/active-task-template.js";
|
|
38
|
-
export {
|
|
39
|
+
export { getTaskStore, dropTaskStore, type TaskEntry, type TaskStatus } from "./state/tasks.js";
|
|
39
40
|
export type { MaestroMcpServerSpec, MaestroMcpClient, MaestroMcpTool } from "./mcp/client.js";
|
|
40
|
-
export { deleteMaestroSession, maestroSessionsDir, cleanupStaleMaestroSessions, DEFAULT_MAESTRO_SESSION_TTL_MS, } from "./session-store.js";
|
|
41
|
+
export { deleteMaestroSession, maestroSessionsDir, cleanupStaleMaestroSessions, DEFAULT_MAESTRO_SESSION_TTL_MS, loadMaestroSessionMeta, type MaestroSessionMeta, } from "./session-store.js";
|
|
41
42
|
export { setLogger, type Logger, type LogFn } from "./platform/logger.js";
|
|
42
43
|
export { onShutdown, runShutdown } from "./platform/lifecycle.js";
|
|
43
44
|
export { setMcpResolver, type McpResolver, type McpServerMap } from "./platform/mcp-config.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,eAAO,MAAM,yBAAyB,EAAG,sBAA+B,CAAC;AAGzE,OAAO,EAAE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,OAAO,EACL,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,iB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ACV,UAAU,EACV,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,WAAW,GACZ,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Originally derived from Nous Research's hermes-agent (MIT); see NOTICE.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export { MAESTRO_SDK_VERSION } from "./platform/version.js";
|
|
10
10
|
export const MAESTRO_UPSTREAM_SNAPSHOT = "v0.13.0 (2026-05-07)";
|
|
11
11
|
// ─── Core agent loop ─────────────────────────────────────────────────────────
|
|
12
12
|
export { AIAgent } from "./core/agent.js";
|
|
@@ -18,17 +18,18 @@ export { bashTool } from "./tools/builtin/bash.js";
|
|
|
18
18
|
export { createReadTool } from "./tools/builtin/read.js";
|
|
19
19
|
export { createWriteTool } from "./tools/builtin/write.js";
|
|
20
20
|
export { createEditTool } from "./tools/builtin/edit.js";
|
|
21
|
-
export {
|
|
21
|
+
export { globTool, compileGlob } from "./tools/builtin/glob.js";
|
|
22
|
+
export { grepTool } from "./tools/builtin/grep.js";
|
|
23
|
+
export { createTaskCreateTool, createTaskUpdateTool, createTaskListTool, createTaskGetTool, } from "./tools/builtin/tasks.js";
|
|
22
24
|
export { createSkillViewTool } from "./tools/builtin/skill_view.js";
|
|
25
|
+
export { createSkillWriteTool } from "./tools/builtin/skill_write.js";
|
|
23
26
|
export { createAgentTool } from "./tools/builtin/agent.js";
|
|
24
|
-
export { isSandboxEnabled, checkFilesystemAccess } from "./tools/builtin/sandbox.js";
|
|
25
|
-
export { createSandboxFsHook } from "./tools/hooks/sandbox-fs.js";
|
|
26
27
|
export { getFileStateTracker, dropFileStateTracker } from "./tools/file-state.js";
|
|
27
28
|
export { AnthropicProvider, effortToThinkingBudget, effortToMaxIter, applyThinkingBudget, buildCacheableSystem, buildCacheableTools, buildCacheableMessages, } from "./providers/anthropic.js";
|
|
28
29
|
export { DeepseekProvider, effortForDeepseek, translateToolsToOpenAI, translateMessagesToOpenAI, } from "./providers/deepseek.js";
|
|
29
30
|
// ─── Maestro registry + top-level provider entry point ───────────────────────
|
|
30
31
|
export { maestroRegistry } from "./registry.js";
|
|
31
|
-
export { maestroProvider, providerForModel, isAbortError, iterationBudgetLine } from "./provider.js";
|
|
32
|
+
export { maestroProvider, providerForModel, isAbortError, iterationBudgetLine, resolveSkillsDir, applySkillAllowlist, MAESTRO_DEFAULT_SKILL_KEY, } from "./provider.js";
|
|
32
33
|
// ─── Skills ──────────────────────────────────────────────────────────────────
|
|
33
34
|
export { loadSkillsCached, findSkillByName } from "./skills/loader.js";
|
|
34
35
|
export { buildSkillsIndex } from "./skills/index-builder.js";
|
|
@@ -41,9 +42,9 @@ export { buildSystemReminder } from "./memory/reminder.js";
|
|
|
41
42
|
export { hashToolContent } from "./memory/hash.js";
|
|
42
43
|
export { ACTIVE_TASK_TEMPLATE, wrapCompactedSummary } from "./memory/active-task-template.js";
|
|
43
44
|
// ─── State (todos) ───────────────────────────────────────────────────────────
|
|
44
|
-
export {
|
|
45
|
+
export { getTaskStore, dropTaskStore } from "./state/tasks.js";
|
|
45
46
|
// ─── Session store ───────────────────────────────────────────────────────────
|
|
46
|
-
export { deleteMaestroSession, maestroSessionsDir, cleanupStaleMaestroSessions, DEFAULT_MAESTRO_SESSION_TTL_MS, } from "./session-store.js";
|
|
47
|
+
export { deleteMaestroSession, maestroSessionsDir, cleanupStaleMaestroSessions, DEFAULT_MAESTRO_SESSION_TTL_MS, loadMaestroSessionMeta, } from "./session-store.js";
|
|
47
48
|
// ─── Host integration points (dependency injection) ──────────────────────────
|
|
48
49
|
export { setLogger } from "./platform/logger.js";
|
|
49
50
|
export { onShutdown, runShutdown } from "./platform/lifecycle.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,MAAM,CAAC,MAAM,yBAAyB,GAAG,sBAA+B,CAAC;AAEzE,gFAAgF;AAChF,OAAO,EAAE,OAAO,EAAsB,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,gFAAgF;AAChF,OAAO,EACL,YAAY,GASb,MAAM,kBAAkB,CAAC;AAE1B,gFAAgF;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EA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F,OAAO,EAAE,SAAS,EAA2B,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAuC,MAAM,uBAAuB,CAAC;AAC5F,OAAO,EAAE,qBAAqB,EAA2B,MAAM,yBAAyB,CAAC;AAUzF,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,WAAW,GACZ,MAAM,SAAS,CAAC"}
|
|
@@ -2,10 +2,10 @@ import type { Provider, ProviderMessage } from "../providers/base.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Maestro context auto-compaction.
|
|
4
4
|
*
|
|
5
|
-
* When estimated tokens exceed `triggerRatio` × `contextWindow`, dispatch
|
|
6
|
-
*
|
|
7
|
-
* slice of the conversation into the Active Task template, then
|
|
8
|
-
* new message array shaped as:
|
|
5
|
+
* When estimated tokens exceed `triggerRatio` × `contextWindow`, dispatch an
|
|
6
|
+
* aux LLM call — by default the agent's own configured model — to summarize
|
|
7
|
+
* the middle slice of the conversation into the Active Task template, then
|
|
8
|
+
* return a new message array shaped as:
|
|
9
9
|
*
|
|
10
10
|
* [ ...head_protected, { role: "user", content: "<compacted-history>..." },
|
|
11
11
|
* ...tail_protected ]
|
|
@@ -55,7 +55,10 @@ export interface CompressOptions {
|
|
|
55
55
|
/** Number of TAIL messages preserved verbatim. Default 6 (~ last 3 turns
|
|
56
56
|
* of user/assistant alternation). */
|
|
57
57
|
tailProtect?: number;
|
|
58
|
-
/** Aux model id for the summarization call.
|
|
58
|
+
/** Aux model id for the summarization call. The agent loop wires the
|
|
59
|
+
* agent's own configured model in by default, so callers usually don't
|
|
60
|
+
* set this unless they want compaction to run on a different model than
|
|
61
|
+
* the main turn. */
|
|
59
62
|
auxModel?: string;
|
|
60
63
|
/** Inject a different provider for tests. Defaults to a fresh
|
|
61
64
|
* `AnthropicProvider.fromEnv()` reuse-of-the-main-provider via DI. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compressor.d.ts","sourceRoot":"","sources":["../../src/memory/compressor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAwB,eAAe,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"compressor.d.ts","sourceRoot":"","sources":["../../src/memory/compressor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAwB,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGxF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,MAAM,WAAW,eAAe;IAC9B;8CAC0C;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;kEAE8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;0CACsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;0CACsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;yBAGqB;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;2EACuE;IACvE,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB;8DAC0D;IAC1D,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,sDAAsD;IACtD,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AA0BD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,eAAe,EAAE,EAC3B,IAAI,GAAE,eAAoB,GACzB,OAAO,CAAC,eAAe,EAAE,CAAC,CAuH5B;AAoCD,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,eAAe,EAAE,GAAG,IAAI,CAEvE"}
|