maestro-agent-sdk 0.1.4 → 0.1.6
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 +197 -10
- package/dist/agents/contracts.d.ts +10 -0
- package/dist/agents/contracts.d.ts.map +1 -1
- package/dist/index.d.ts +9 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/dist/memory/reminder.d.ts +9 -9
- package/dist/memory/reminder.d.ts.map +1 -1
- package/dist/memory/reminder.js +21 -15
- package/dist/memory/reminder.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 +161 -22
- 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.js +3 -3
- 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/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/types.d.ts +95 -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/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/README.md
CHANGED
|
@@ -15,17 +15,18 @@ Inspired by [Claude Code](https://www.anthropic.com/claude-code) and [`hermes-ag
|
|
|
15
15
|
|
|
16
16
|
| | What you get |
|
|
17
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` indexing), memory (auto context compaction), and MCP client pool built in — not provided as separate add-ons. |
|
|
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
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. |
|
|
20
20
|
|
|
21
21
|
## What's in the box
|
|
22
22
|
|
|
23
23
|
- **Agent loop** — provider-driven tool-calling loop with iteration cap, abort signal, and event stream.
|
|
24
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.
|
|
25
|
-
- **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.
|
|
26
26
|
- **MCP** — built-in client pool (stdio + SSE) so any MCP server (`@modelcontextprotocol/sdk`) shows up as tools.
|
|
27
|
-
- **Skills** —
|
|
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
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.
|
|
29
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()`.
|
|
30
31
|
|
|
31
32
|
## Install
|
|
@@ -119,22 +120,143 @@ for await (const event of runConversation(agent, "Summarize today's news.")) {
|
|
|
119
120
|
> | `max` | 65 536 | 200 |
|
|
120
121
|
|
|
121
122
|
More runnable scripts live under [`examples/`](./examples) — Anthropic, DeepSeek,
|
|
122
|
-
|
|
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.
|
|
123
236
|
|
|
124
237
|
## Configuration
|
|
125
238
|
|
|
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
|
+
|
|
126
248
|
The SDK resolves its data directory at module load. Override via env var
|
|
127
249
|
**before** importing any SDK module (the value is captured once):
|
|
128
250
|
|
|
129
251
|
| Env var | Default | What it does |
|
|
130
252
|
|---|---|---|
|
|
131
|
-
| `MAESTRO_DATA_DIR` | `~/.maestro` | Where session JSONLs
|
|
253
|
+
| `MAESTRO_DATA_DIR` | `~/.maestro` | Where session JSONLs and todo stores live. `maestroSessionsDir()` resolves to `<DATA_DIR>/sessions`. |
|
|
132
254
|
|
|
133
255
|
Everything else is per-call: pass `cwd`, `model`, `effort`, etc. through
|
|
134
256
|
`AIAgentConfig` / `AgentQueryOptions`. The memory compressor reuses the
|
|
135
257
|
agent's configured `model` — no separate compression-model knob.
|
|
136
258
|
|
|
137
|
-
For session housekeeping there's a helper
|
|
259
|
+
For session housekeeping there's a helper hosts can wire into their
|
|
138
260
|
startup sweep:
|
|
139
261
|
|
|
140
262
|
```ts
|
|
@@ -145,6 +267,71 @@ const { scanned, removed } = cleanupStaleMaestroSessions();
|
|
|
145
267
|
console.log(`maestro sweep: removed ${removed}/${scanned}`);
|
|
146
268
|
```
|
|
147
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
|
+
|
|
148
335
|
## Architecture
|
|
149
336
|
|
|
150
337
|
```
|
|
@@ -153,11 +340,11 @@ src/
|
|
|
153
340
|
├── tools/ ToolRegistry + builtin tools + PreToolUse/PostToolUse hook surface
|
|
154
341
|
├── providers/ Provider adapters (anthropic, deepseek)
|
|
155
342
|
├── mcp/ MCP client pool (stdio + SSE)
|
|
156
|
-
├── skills/
|
|
343
|
+
├── skills/ Skill loader, index builder, usage tracker, curator
|
|
157
344
|
├── memory/ Context compressor, token estimator, reminders, scrubber
|
|
158
345
|
├── state/ Per-session todo store
|
|
159
|
-
├── sub-agent/ Sub-agent runner for the `
|
|
160
|
-
├── 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)
|
|
161
348
|
├── agents/ Cross-agent rollout helpers + per-agent registry contract
|
|
162
349
|
├── storage/ ConversationReader DI (host supplies past turns for cross-agent forks)
|
|
163
350
|
└── media/ File-event extraction from inline `[FILE:/path]` tags
|
|
@@ -195,7 +382,7 @@ cd maestro-agent-sdk
|
|
|
195
382
|
npm install
|
|
196
383
|
npm run typecheck # tsc --noEmit
|
|
197
384
|
npm run build # tsc + tsc-alias → dist/
|
|
198
|
-
npm test # vitest,
|
|
385
|
+
npm test # vitest, 426 tests (+11 skipped without ripgrep)
|
|
199
386
|
```
|
|
200
387
|
|
|
201
388
|
### Known gaps
|
|
@@ -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,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;
|
|
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,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;wDAGoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;wDAGoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,kBAA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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,15 +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
24
|
export { getFileStateTracker, dropFileStateTracker } from "./tools/file-state.js";
|
|
22
25
|
export type { Provider, ProviderToolSchema, ProviderMessage, ProviderContentBlock, ProviderResponse, ProviderStreamChunk, ProviderCompleteOptions, } from "./providers/base.js";
|
|
23
26
|
export { AnthropicProvider, effortToThinkingBudget, effortToMaxIter, applyThinkingBudget, buildCacheableSystem, buildCacheableTools, buildCacheableMessages, } from "./providers/anthropic.js";
|
|
24
27
|
export { DeepseekProvider, effortForDeepseek, translateToolsToOpenAI, translateMessagesToOpenAI, } from "./providers/deepseek.js";
|
|
25
28
|
export { maestroRegistry } from "./registry.js";
|
|
26
|
-
export { maestroProvider, providerForModel, isAbortError, iterationBudgetLine } from "./provider.js";
|
|
29
|
+
export { maestroProvider, providerForModel, isAbortError, iterationBudgetLine, resolveSkillsDir, applySkillAllowlist, MAESTRO_DEFAULT_SKILL_KEY, } from "./provider.js";
|
|
27
30
|
export { loadSkillsCached, findSkillByName, type SkillEntry } from "./skills/loader.js";
|
|
28
31
|
export { buildSkillsIndex } from "./skills/index-builder.js";
|
|
29
32
|
export { curateSkills } from "./skills/curator.js";
|
|
@@ -33,14 +36,14 @@ export { estimateTokens } from "./memory/token-estimate.js";
|
|
|
33
36
|
export { buildSystemReminder } from "./memory/reminder.js";
|
|
34
37
|
export { hashToolContent } from "./memory/hash.js";
|
|
35
38
|
export { ACTIVE_TASK_TEMPLATE, wrapCompactedSummary } from "./memory/active-task-template.js";
|
|
36
|
-
export {
|
|
39
|
+
export { getTaskStore, dropTaskStore, type TaskEntry, type TaskStatus } from "./state/tasks.js";
|
|
37
40
|
export type { MaestroMcpServerSpec, MaestroMcpClient, MaestroMcpTool } from "./mcp/client.js";
|
|
38
|
-
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";
|
|
39
42
|
export { setLogger, type Logger, type LogFn } from "./platform/logger.js";
|
|
40
43
|
export { onShutdown, runShutdown } from "./platform/lifecycle.js";
|
|
41
44
|
export { setMcpResolver, type McpResolver, type McpServerMap } from "./platform/mcp-config.js";
|
|
42
45
|
export { setConversationReader, type ConversationReader } from "./storage/conversations.js";
|
|
43
|
-
export type { TokenUsage, EffortLevel, AgentKind, AgentQueryOptions, UnifiedEvent, } from "./types.js";
|
|
46
|
+
export type { TokenUsage, EffortLevel, AgentKind, AgentHooks, AgentQueryOptions, UnifiedEvent, } from "./types.js";
|
|
44
47
|
export { MAESTRO_EFFORT_VALUES, SUPPORTED_AGENTS, FALLBACK_AGENT, isAgentKind, } from "./types.js";
|
|
45
48
|
export type { ConversationEntry } from "./storage/conversations.js";
|
|
46
49
|
export type { AgentRegistry, WriteRolloutOptions, WriteRolloutResult, ForkRegistryOptions, ForkRegistryResult, CleanupRolloutsOptions, } from "./agents/contracts.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,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAC;AAG1B,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,O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_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,15 +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
27
|
export { getFileStateTracker, dropFileStateTracker } from "./tools/file-state.js";
|
|
25
28
|
export { AnthropicProvider, effortToThinkingBudget, effortToMaxIter, applyThinkingBudget, buildCacheableSystem, buildCacheableTools, buildCacheableMessages, } from "./providers/anthropic.js";
|
|
26
29
|
export { DeepseekProvider, effortForDeepseek, translateToolsToOpenAI, translateMessagesToOpenAI, } from "./providers/deepseek.js";
|
|
27
30
|
// ─── Maestro registry + top-level provider entry point ───────────────────────
|
|
28
31
|
export { maestroRegistry } from "./registry.js";
|
|
29
|
-
export { maestroProvider, providerForModel, isAbortError, iterationBudgetLine } from "./provider.js";
|
|
32
|
+
export { maestroProvider, providerForModel, isAbortError, iterationBudgetLine, resolveSkillsDir, applySkillAllowlist, MAESTRO_DEFAULT_SKILL_KEY, } from "./provider.js";
|
|
30
33
|
// ─── Skills ──────────────────────────────────────────────────────────────────
|
|
31
34
|
export { loadSkillsCached, findSkillByName } from "./skills/loader.js";
|
|
32
35
|
export { buildSkillsIndex } from "./skills/index-builder.js";
|
|
@@ -39,9 +42,9 @@ export { buildSystemReminder } from "./memory/reminder.js";
|
|
|
39
42
|
export { hashToolContent } from "./memory/hash.js";
|
|
40
43
|
export { ACTIVE_TASK_TEMPLATE, wrapCompactedSummary } from "./memory/active-task-template.js";
|
|
41
44
|
// ─── State (todos) ───────────────────────────────────────────────────────────
|
|
42
|
-
export {
|
|
45
|
+
export { getTaskStore, dropTaskStore } from "./state/tasks.js";
|
|
43
46
|
// ─── Session store ───────────────────────────────────────────────────────────
|
|
44
|
-
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";
|
|
45
48
|
// ─── Host integration points (dependency injection) ──────────────────────────
|
|
46
49
|
export { setLogger } from "./platform/logger.js";
|
|
47
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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,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAsB,MAAM,gBAAgB,CAAC;AAEzE,gFAAgF;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE3F,gFAAgF;AAChF,OAAO,EAAE,YAAY,EAAE,aAAa,EAAmC,MAAM,eAAe,CAAC;AAK7F,gFAAgF;AAChF,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,2BAA2B,EAC3B,8BAA8B,EAC9B,sBAAsB,GAEvB,MAAM,iBAAiB,CAAC;AAEzB,gFAAgF;AAChF,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;AAWzF,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,WAAW,GACZ,MAAM,SAAS,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TaskEntry } from "../state/tasks.js";
|
|
2
2
|
/**
|
|
3
3
|
* System-reminder builder.
|
|
4
4
|
*
|
|
5
5
|
* Renders the `<system-reminder>…</system-reminder>` block that gets
|
|
6
6
|
* attached to every new user message in `maestroProvider`. The reminder
|
|
7
7
|
* carries invariants the model needs to keep in mind for the current turn
|
|
8
|
-
* — session id,
|
|
8
|
+
* — session id, task list, caller-supplied extras — and is what keeps long
|
|
9
9
|
* sessions from forgetting the rules after the compactor evicts the middle.
|
|
10
10
|
*
|
|
11
11
|
* Why this lives outside `loop.ts`:
|
|
@@ -32,12 +32,13 @@ export interface SystemReminderContext {
|
|
|
32
32
|
*/
|
|
33
33
|
sessionId: string;
|
|
34
34
|
/**
|
|
35
|
-
* Current
|
|
36
|
-
* a compact status header so the model carries the plan
|
|
37
|
-
* without having to call
|
|
38
|
-
*
|
|
35
|
+
* Current task list snapshot (non-deleted entries). When non-empty, the
|
|
36
|
+
* reminder renders a compact status header so the model carries the plan
|
|
37
|
+
* across turns without having to call TaskList. TaskList exists for
|
|
38
|
+
* programmatic refresh after large batches; the reminder is the always-on
|
|
39
|
+
* read path.
|
|
39
40
|
*/
|
|
40
|
-
|
|
41
|
+
tasks?: readonly TaskEntry[];
|
|
41
42
|
/**
|
|
42
43
|
* Anything additional the caller wants to render verbatim. Each entry
|
|
43
44
|
* becomes one line at the tail of the reminder. Caller owns formatting.
|
|
@@ -49,8 +50,7 @@ export interface SystemReminderContext {
|
|
|
49
50
|
* callers attach verbatim as a `text` content block on a user message.
|
|
50
51
|
*
|
|
51
52
|
* Empty extras renders to ~2 lines so the per-turn token cost is bounded;
|
|
52
|
-
* the catalog of facts only grows as later phases add semantic state
|
|
53
|
-
* (Phase 3.2 task list, etc.).
|
|
53
|
+
* the catalog of facts only grows as later phases add semantic state.
|
|
54
54
|
*/
|
|
55
55
|
export declare function buildSystemReminder(ctx: SystemReminderContext): string;
|
|
56
56
|
//# sourceMappingURL=reminder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reminder.d.ts","sourceRoot":"","sources":["../../src/memory/reminder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB
|
|
1
|
+
{"version":3,"file":"reminder.d.ts","sourceRoot":"","sources":["../../src/memory/reminder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;IAC7B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,qBAAqB,GAAG,MAAM,CAuCtE"}
|
package/dist/memory/reminder.js
CHANGED
|
@@ -3,26 +3,32 @@
|
|
|
3
3
|
* callers attach verbatim as a `text` content block on a user message.
|
|
4
4
|
*
|
|
5
5
|
* Empty extras renders to ~2 lines so the per-turn token cost is bounded;
|
|
6
|
-
* the catalog of facts only grows as later phases add semantic state
|
|
7
|
-
* (Phase 3.2 task list, etc.).
|
|
6
|
+
* the catalog of facts only grows as later phases add semantic state.
|
|
8
7
|
*/
|
|
9
8
|
export function buildSystemReminder(ctx) {
|
|
10
9
|
const lines = ["<system-reminder>"];
|
|
11
10
|
// Session id — emitted so cross-session tools (ask_session, tell_session,
|
|
12
11
|
// fork helpers) have a stable handle to reference without round-tripping.
|
|
13
12
|
lines.push(`Session: ${ctx.sessionId}`);
|
|
14
|
-
//
|
|
15
|
-
// doesn't need
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
// Task list read-side: render the current list (if any) so the model
|
|
14
|
+
// doesn't need to call TaskList every turn. Compact one-line-per-entry
|
|
15
|
+
// format `[✓/→/ ] #N subject (blocked by #M)` matches Claude Code's
|
|
16
|
+
// TaskList rendering closely enough that the model's pretrained instincts
|
|
17
|
+
// about the shape transfer cleanly.
|
|
18
|
+
if (ctx.tasks && ctx.tasks.length > 0) {
|
|
19
|
+
lines.push(`Tasks (${taskSummaryCount(ctx.tasks)}):`);
|
|
20
|
+
for (const t of ctx.tasks) {
|
|
21
21
|
const mark = t.status === "completed" ? "✓" : t.status === "in_progress" ? "→" : " ";
|
|
22
|
-
|
|
22
|
+
const deps = t.blockedBy.length > 0
|
|
23
|
+
? ` (blocked by ${t.blockedBy.map((id) => `#${id}`).join(", ")})`
|
|
24
|
+
: "";
|
|
25
|
+
const owner = t.owner ? ` [@${t.owner}]` : "";
|
|
26
|
+
lines.push(` [${mark}] #${t.id} ${t.subject}${owner}${deps}`);
|
|
23
27
|
}
|
|
24
|
-
lines.push("
|
|
25
|
-
"
|
|
28
|
+
lines.push("Use TaskCreate to add tasks, TaskUpdate(taskId, status) to advance them, " +
|
|
29
|
+
"TaskUpdate(taskId, addBlockedBy/addBlocks) for dependencies. Only ONE " +
|
|
30
|
+
"task may be in_progress at a time — setting another flips the prior one " +
|
|
31
|
+
"back to pending.");
|
|
26
32
|
}
|
|
27
33
|
// Caller-supplied tail. Each extra is one line — caller owns formatting.
|
|
28
34
|
for (const e of ctx.extras ?? []) {
|
|
@@ -34,8 +40,8 @@ export function buildSystemReminder(ctx) {
|
|
|
34
40
|
}
|
|
35
41
|
/** Compact "3/5" style summary — completed over total. Used in the list
|
|
36
42
|
* header so the model gets progress at a glance without re-counting. */
|
|
37
|
-
function
|
|
38
|
-
const done =
|
|
39
|
-
return `${done}/${
|
|
43
|
+
function taskSummaryCount(tasks) {
|
|
44
|
+
const done = tasks.filter((t) => t.status === "completed").length;
|
|
45
|
+
return `${done}/${tasks.length}`;
|
|
40
46
|
}
|
|
41
47
|
//# sourceMappingURL=reminder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reminder.js","sourceRoot":"","sources":["../../src/memory/reminder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reminder.js","sourceRoot":"","sources":["../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,CAAC,CAAC;QAClE,CAAC;QACD,KAAK,CAAC,IAAI,CACR,2EAA2E;YACzE,wEAAwE;YACxE,0EAA0E;YAC1E,kBAAkB,CACrB,CAAC;IACJ,CAAC;IAED,yEAAyE;IACzE,KAAK,MAAM,CAAC,IAAI,GAAG,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC;QACjC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC;YAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACjC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;yEACyE;AACzE,SAAS,gBAAgB,CAAC,KAA2B;IACnD,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,MAAM,CAAC;IAClE,OAAO,GAAG,IAAI,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical SDK version constant.
|
|
3
|
+
*
|
|
4
|
+
* Lives in its own module so any subsystem (session-store, rollout encoders,
|
|
5
|
+
* logging) can import the version without pulling in the full public-API
|
|
6
|
+
* surface from `index.ts`. The `index.ts` re-export is what hosts consume —
|
|
7
|
+
* `MAESTRO_SDK_VERSION` is also stamped into every rollout's `_meta` header
|
|
8
|
+
* so a future SDK can detect on-disk format drift on load.
|
|
9
|
+
*
|
|
10
|
+
* Bump in lock-step with `package.json#version` on every release.
|
|
11
|
+
*/
|
|
12
|
+
export declare const MAESTRO_SDK_VERSION: "0.1.5";
|
|
13
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/platform/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,EAAG,OAAgB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical SDK version constant.
|
|
3
|
+
*
|
|
4
|
+
* Lives in its own module so any subsystem (session-store, rollout encoders,
|
|
5
|
+
* logging) can import the version without pulling in the full public-API
|
|
6
|
+
* surface from `index.ts`. The `index.ts` re-export is what hosts consume —
|
|
7
|
+
* `MAESTRO_SDK_VERSION` is also stamped into every rollout's `_meta` header
|
|
8
|
+
* so a future SDK can detect on-disk format drift on load.
|
|
9
|
+
*
|
|
10
|
+
* Bump in lock-step with `package.json#version` on every release.
|
|
11
|
+
*/
|
|
12
|
+
export const MAESTRO_SDK_VERSION = "0.1.5";
|
|
13
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/platform/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAgB,CAAC"}
|