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.
Files changed (102) hide show
  1. package/README.md +216 -20
  2. package/dist/agents/contracts.d.ts +10 -0
  3. package/dist/agents/contracts.d.ts.map +1 -1
  4. package/dist/agents/rollout/shared.d.ts +4 -4
  5. package/dist/agents/rollout/shared.js +4 -4
  6. package/dist/core/loop.d.ts.map +1 -1
  7. package/dist/core/loop.js +9 -8
  8. package/dist/core/loop.js.map +1 -1
  9. package/dist/index.d.ts +8 -7
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +8 -7
  12. package/dist/index.js.map +1 -1
  13. package/dist/memory/compressor.d.ts +8 -5
  14. package/dist/memory/compressor.d.ts.map +1 -1
  15. package/dist/memory/compressor.js +10 -4
  16. package/dist/memory/compressor.js.map +1 -1
  17. package/dist/memory/reminder.d.ts +11 -12
  18. package/dist/memory/reminder.d.ts.map +1 -1
  19. package/dist/memory/reminder.js +22 -32
  20. package/dist/memory/reminder.js.map +1 -1
  21. package/dist/platform/config.d.ts +0 -2
  22. package/dist/platform/config.d.ts.map +1 -1
  23. package/dist/platform/config.js +9 -18
  24. package/dist/platform/config.js.map +1 -1
  25. package/dist/platform/version.d.ts +13 -0
  26. package/dist/platform/version.d.ts.map +1 -0
  27. package/dist/platform/version.js +13 -0
  28. package/dist/platform/version.js.map +1 -0
  29. package/dist/provider.d.ts +62 -0
  30. package/dist/provider.d.ts.map +1 -1
  31. package/dist/provider.js +137 -30
  32. package/dist/provider.js.map +1 -1
  33. package/dist/registry.d.ts.map +1 -1
  34. package/dist/registry.js +16 -1
  35. package/dist/registry.js.map +1 -1
  36. package/dist/session-store.d.ts +95 -4
  37. package/dist/session-store.d.ts.map +1 -1
  38. package/dist/session-store.js +144 -13
  39. package/dist/session-store.js.map +1 -1
  40. package/dist/skills/curator.d.ts +8 -6
  41. package/dist/skills/curator.d.ts.map +1 -1
  42. package/dist/skills/curator.js +13 -7
  43. package/dist/skills/curator.js.map +1 -1
  44. package/dist/skills/loader.d.ts +45 -20
  45. package/dist/skills/loader.d.ts.map +1 -1
  46. package/dist/skills/loader.js +56 -11
  47. package/dist/skills/loader.js.map +1 -1
  48. package/dist/state/tasks.d.ts +107 -0
  49. package/dist/state/tasks.d.ts.map +1 -0
  50. package/dist/state/tasks.js +398 -0
  51. package/dist/state/tasks.js.map +1 -0
  52. package/dist/sub-agent/runner.d.ts +1 -1
  53. package/dist/sub-agent/runner.d.ts.map +1 -1
  54. package/dist/sub-agent/runner.js +3 -5
  55. package/dist/sub-agent/runner.js.map +1 -1
  56. package/dist/tools/builtin/edit.d.ts.map +1 -1
  57. package/dist/tools/builtin/edit.js +0 -4
  58. package/dist/tools/builtin/edit.js.map +1 -1
  59. package/dist/tools/builtin/glob.d.ts +17 -0
  60. package/dist/tools/builtin/glob.d.ts.map +1 -0
  61. package/dist/tools/builtin/glob.js +235 -0
  62. package/dist/tools/builtin/glob.js.map +1 -0
  63. package/dist/tools/builtin/grep.d.ts +3 -0
  64. package/dist/tools/builtin/grep.d.ts.map +1 -0
  65. package/dist/tools/builtin/grep.js +272 -0
  66. package/dist/tools/builtin/grep.js.map +1 -0
  67. package/dist/tools/builtin/read.d.ts.map +1 -1
  68. package/dist/tools/builtin/read.js +0 -4
  69. package/dist/tools/builtin/read.js.map +1 -1
  70. package/dist/tools/builtin/skill_write.d.ts +53 -0
  71. package/dist/tools/builtin/skill_write.d.ts.map +1 -0
  72. package/dist/tools/builtin/skill_write.js +264 -0
  73. package/dist/tools/builtin/skill_write.js.map +1 -0
  74. package/dist/tools/builtin/tasks.d.ts +34 -0
  75. package/dist/tools/builtin/tasks.d.ts.map +1 -0
  76. package/dist/tools/builtin/tasks.js +258 -0
  77. package/dist/tools/builtin/tasks.js.map +1 -0
  78. package/dist/tools/builtin/write.d.ts +4 -10
  79. package/dist/tools/builtin/write.d.ts.map +1 -1
  80. package/dist/tools/builtin/write.js.map +1 -1
  81. package/dist/tools/file-state.d.ts +1 -1
  82. package/dist/tools/file-state.js +1 -1
  83. package/dist/tools/registry.d.ts +1 -1
  84. package/dist/types.d.ts +64 -0
  85. package/dist/types.d.ts.map +1 -1
  86. package/package.json +1 -1
  87. package/dist/state/todos.d.ts +0 -95
  88. package/dist/state/todos.d.ts.map +0 -1
  89. package/dist/state/todos.js +0 -198
  90. package/dist/state/todos.js.map +0 -1
  91. package/dist/tools/builtin/sandbox.d.ts +0 -16
  92. package/dist/tools/builtin/sandbox.d.ts.map +0 -1
  93. package/dist/tools/builtin/sandbox.js +0 -59
  94. package/dist/tools/builtin/sandbox.js.map +0 -1
  95. package/dist/tools/builtin/todo_write.d.ts +0 -29
  96. package/dist/tools/builtin/todo_write.d.ts.map +0 -1
  97. package/dist/tools/builtin/todo_write.js +0 -96
  98. package/dist/tools/builtin/todo_write.js.map +0 -1
  99. package/dist/tools/hooks/sandbox-fs.d.ts +0 -25
  100. package/dist/tools/hooks/sandbox-fs.d.ts.map +0 -1
  101. package/dist/tools/hooks/sandbox-fs.js +0 -48
  102. package/dist/tools/hooks/sandbox-fs.js.map +0 -1
@@ -1,7 +1,6 @@
1
1
  import { ACTIVE_TASK_TEMPLATE, wrapCompactedSummary } from "../memory/active-task-template.js";
2
2
  import { pruneMessages } from "../memory/prune.js";
3
3
  import { estimateTokens } from "../memory/token-estimate.js";
4
- import { MODEL_HAIKU } from "../platform/config.js";
5
4
  import { logger } from "../platform/logger.js";
6
5
  const compactorAntiThrash = new WeakMap();
7
6
  /** A compaction that doesn't save at least this fraction of tokens is
@@ -40,7 +39,7 @@ export async function compressIfNeeded(messages, opts = {}) {
40
39
  const triggerRatio = opts.triggerRatio ?? 0.8;
41
40
  const headProtect = opts.headProtect ?? 2;
42
41
  const tailProtect = opts.tailProtect ?? 6;
43
- const auxModel = opts.auxModel ?? MODEL_HAIKU;
42
+ const auxModel = opts.auxModel;
44
43
  // Step 1: prune first. Cheap and often enough.
45
44
  const pruned = pruneMessages(messages);
46
45
  const prunedTokens = estimateTokens(pruned);
@@ -77,11 +76,18 @@ export async function compressIfNeeded(messages, opts = {}) {
77
76
  // Step 3: aux LLM call.
78
77
  if (!opts.auxProvider) {
79
78
  // No provider supplied AND no factory available in production callers
80
- // (maestroProvider passes its own AnthropicProvider). Without one we
81
- // can't summarize — drop to pruned and log so the operator sees why.
79
+ // (the agent loop passes its own provider). Without one we can't
80
+ // summarize — drop to pruned and log so the operator sees why.
82
81
  logger.warn({ prunedTokens, threshold }, "compressIfNeeded: over threshold but no auxProvider supplied — falling back to prune-only");
83
82
  return pruned;
84
83
  }
84
+ if (!auxModel) {
85
+ // No model id supplied. The agent loop wires `auxModel: agent.config.model`
86
+ // by default, so this branch only fires if a host calls compressIfNeeded
87
+ // directly without one. Same fallback as missing provider.
88
+ logger.warn({ prunedTokens, threshold }, "compressIfNeeded: over threshold but no auxModel supplied — falling back to prune-only");
89
+ return pruned;
90
+ }
85
91
  let summaryText;
86
92
  try {
87
93
  const auxResponse = await opts.auxProvider.complete({
@@ -1 +1 @@
1
- {"version":3,"file":"compressor.js","sourceRoot":"","sources":["../../src/memory/compressor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AA6E3C,MAAM,mBAAmB,GAAG,IAAI,OAAO,EAAsC,CAAC;AAE9E;wDACwD;AACxD,MAAM,2BAA2B,GAAG,GAAG,CAAC;AACxC;aACa;AACb,MAAM,2BAA2B,GAAG,CAAC,CAAC;AAEtC,SAAS,oBAAoB;IAC3B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,sB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GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC5C,OAAO,CAAC,GAAG,GAAG,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM;QAAE,CAAC,EAAE,CAAC;IAClE,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;GAIG;AACH,SAAS,aAAa,CAAC,QAA2B,EAAE,UAAkB;IACpE,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;IAC1C,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAChC,OAAO,CAAC,GAAG,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM;QAAE,CAAC,EAAE,CAAC;IACpE,OAAO,CAAC,CAAC;AACX,CAAC;AAED,qEAAqE;AACrE,SAAS,WAAW,CAAC,MAA8B;IACjD,OAAO,MAAM;SACV,MAAM,CAAC,CAAC,CAAC,EAAuC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC;SACrE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;SAClB,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,qBAAqB,CAAC,QAA2B;IAC/D,mBAAmB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACvC,CAAC"}
@@ -1,13 +1,12 @@
1
- import type { TodoEntry } from "../state/todos.js";
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
- * — sandbox state, workspace root, future: active task — and is what keeps
9
- * long sessions from forgetting the rules after the compactor evicts the
10
- * middle.
8
+ * — session id, task list, caller-supplied extras — and is what keeps long
9
+ * sessions from forgetting the rules after the compactor evicts the middle.
11
10
  *
12
11
  * Why this lives outside `loop.ts`:
13
12
  *
@@ -33,12 +32,13 @@ export interface SystemReminderContext {
33
32
  */
34
33
  sessionId: string;
35
34
  /**
36
- * Current TodoWrite list snapshot. When non-empty, the reminder renders
37
- * a compact status header so the model carries the plan across turns
38
- * without having to call a read-side tool. The list is the read-side —
39
- * `todo_write` is the only related tool the model sees.
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.
40
40
  */
41
- todos?: readonly TodoEntry[];
41
+ tasks?: readonly TaskEntry[];
42
42
  /**
43
43
  * Anything additional the caller wants to render verbatim. Each entry
44
44
  * becomes one line at the tail of the reminder. Caller owns formatting.
@@ -49,9 +49,8 @@ export interface SystemReminderContext {
49
49
  * Build the `<system-reminder>` block. Returns a self-contained string that
50
50
  * callers attach verbatim as a `text` content block on a user message.
51
51
  *
52
- * Empty extras + sandbox-enabled (default) state renders to ~3 lines so
53
- * the per-turn token cost is bounded; the catalog of facts only grows as
54
- * later phases add semantic state (Phase 3.2 task list, etc.).
52
+ * Empty extras renders to ~2 lines so the per-turn token cost is bounded;
53
+ * the catalog of facts only grows as later phases add semantic state.
55
54
  */
56
55
  export declare function buildSystemReminder(ctx: SystemReminderContext): string;
57
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;AAI/C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;IAC7B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,qBAAqB,GAAG,MAAM,CA8CtE"}
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"}
@@ -1,44 +1,34 @@
1
- import { isSandboxEnabled } from "../tools/builtin/sandbox.js";
2
- import { WORKSPACE_DIR } from "../platform/config.js";
3
1
  /**
4
2
  * Build the `<system-reminder>` block. Returns a self-contained string that
5
3
  * callers attach verbatim as a `text` content block on a user message.
6
4
  *
7
- * Empty extras + sandbox-enabled (default) state renders to ~3 lines so
8
- * the per-turn token cost is bounded; the catalog of facts only grows as
9
- * later phases add semantic state (Phase 3.2 task list, etc.).
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.
10
7
  */
11
8
  export function buildSystemReminder(ctx) {
12
9
  const lines = ["<system-reminder>"];
13
- // Sandbox state — the model needs to know whether file paths outside
14
- // WORKSPACE_DIR will be rejected, so it can either prefix paths correctly
15
- // or pre-emptively flag the limitation when the user asks for an
16
- // out-of-workspace operation. Default is unsandboxed (parity with
17
- // claude/codex providers); the operator opts in by exporting
18
- // `MAESTRO_FS_SANDBOX_ENABLED=1`.
19
- if (isSandboxEnabled()) {
20
- lines.push(`Filesystem sandbox: enabled. Allowed root: ${WORKSPACE_DIR}`);
21
- lines.push(" Paths outside this root will be rejected by Read/Write/Edit. " +
22
- "Prefer relative-to-workspace paths.");
23
- }
24
- else {
25
- lines.push("Filesystem sandbox: disabled (any absolute path may be read/written).");
26
- }
27
10
  // Session id — emitted so cross-session tools (ask_session, tell_session,
28
11
  // fork helpers) have a stable handle to reference without round-tripping.
29
12
  lines.push(`Session: ${ctx.sessionId}`);
30
- // TodoWrite read-side: render the current list (if any) so the model
31
- // doesn't need a `todo_list` tool. Compact one-line-per-entry format
32
- // tracks `[✓/→/ ] task-N content` matches the tool result preview
33
- // so the model sees the same shape it wrote.
34
- if (ctx.todos && ctx.todos.length > 0) {
35
- lines.push(`Task list (${todoSummaryCount(ctx.todos)}):`);
36
- for (const t of ctx.todos) {
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) {
37
21
  const mark = t.status === "completed" ? "✓" : t.status === "in_progress" ? "→" : " ";
38
- lines.push(` [${mark}] ${t.id} ${t.content}`);
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}`);
39
27
  }
40
- lines.push("Update this list with `todo_write` whenever you start a step, finish one, " +
41
- "or change the plan. Only ONE item may be in_progress at a time.");
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.");
42
32
  }
43
33
  // Caller-supplied tail. Each extra is one line — caller owns formatting.
44
34
  for (const e of ctx.extras ?? []) {
@@ -50,8 +40,8 @@ export function buildSystemReminder(ctx) {
50
40
  }
51
41
  /** Compact "3/5" style summary — completed over total. Used in the list
52
42
  * header so the model gets progress at a glance without re-counting. */
53
- function todoSummaryCount(todos) {
54
- const done = todos.filter((t) => t.status === "completed").length;
55
- return `${done}/${todos.length}`;
43
+ function taskSummaryCount(tasks) {
44
+ const done = tasks.filter((t) => t.status === "completed").length;
45
+ return `${done}/${tasks.length}`;
56
46
  }
57
47
  //# sourceMappingURL=reminder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reminder.js","sourceRoot":"","sources":["../../src/memory/reminder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAkDlD;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAA0B;IAC5D,MAAM,KAAK,GAAa,CAAC,mBAAmB,CAAC,CAAC;IAE9C,qEAAqE;IACrE,0EAA0E;IAC1E,iEAAiE;IACjE,kEAAkE;IAClE,6DAA6D;IAC7D,kCAAkC;IAClC,IAAI,gBAAgB,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,IAAI,CAAC,8CAA8C,aAAa,EAAE,CAAC,CAAC;QAC1E,KAAK,CAAC,IAAI,CACR,iEAAiE;YAC/D,qCAAqC,CACxC,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,IAAI,CAAC,uEAAuE,CAAC,CAAC;IACtF,CAAC;IA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C,CAAC,CAAC,EAAE,CAAC;YAC9C,KAAK,CAAC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,OAAO,GAAG,KAAK,GAAG,IAAI,EAAE,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"}
@@ -1,6 +1,4 @@
1
1
  export declare const DATA_DIR: string;
2
- export declare const WORKSPACE_DIR: string;
3
- export declare const MODEL_HAIKU: string;
4
2
  export declare const MODEL_SONNET: string;
5
3
  export declare const MODEL_OPUS: string;
6
4
  export declare const MODEL_DEEPSEEK_V4_PRO: string;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/platform/config.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,QAAQ,EAAE,MAEM,CAAC;AAE9B,eAAO,MAAM,aAAa,EAAE,MAEU,CAAC;AAEvC,eAAO,MAAM,WAAW,EAAE,MAC4C,CAAC;AAKvE,eAAO,MAAM,YAAY,EAAE,MAA4B,CAAC;AACxD,eAAO,MAAM,UAAU,EAAE,MAA0B,CAAC;AAGpD,eAAO,MAAM,qBAAqB,EAAE,MAA0B,CAAC;AAC/D,eAAO,MAAM,uBAAuB,EAAE,MAA4B,CAAC;AAEnE,eAAO,MAAM,cAAc,EAAE,MAAgC,CAAC;AAgB9D;yEACyE;AACzE,wBAAgB,WAAW,IAAI,MAAM,CAAC,UAAU,CAI/C"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/platform/config.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,QAAQ,EAAE,MAEM,CAAC;AAK9B,eAAO,MAAM,YAAY,EAAE,MAA4B,CAAC;AACxD,eAAO,MAAM,UAAU,EAAE,MAA0B,CAAC;AAGpD,eAAO,MAAM,qBAAqB,EAAE,MAA0B,CAAC;AAC/D,eAAO,MAAM,uBAAuB,EAAE,MAA4B,CAAC;AAEnE,eAAO,MAAM,cAAc,EAAE,MAAgC,CAAC;AAW9D;yEACyE;AACzE,wBAAgB,WAAW,IAAI,MAAM,CAAC,UAAU,CAI/C"}
@@ -4,13 +4,14 @@ import { resolve } from "node:path";
4
4
  /**
5
5
  * SDK runtime configuration — single source of truth for paths and model ids.
6
6
  *
7
- * Values are resolved once at module load. Hosts that need non-default paths
8
- * must set the corresponding env var (`MAESTRO_DATA_DIR`, `MAESTRO_WORKSPACE_DIR`,
9
- * `MAESTRO_COMPRESSION_MODEL`) **before** importing any SDK module that
10
- * depends on them.
7
+ * Values are resolved once at module load. Hosts that need a non-default
8
+ * data directory must set `MAESTRO_DATA_DIR` **before** importing any SDK
9
+ * module that depends on it.
11
10
  *
12
11
  * For per-call overrides, prefer `AgentQueryOptions.cwd` (filesystem root)
13
- * and `AIAgentConfig.model` (compression model is wired through there too).
12
+ * and `AIAgentConfig.model` the memory compressor reuses the same model
13
+ * the agent is already configured with, so no separate compression-model
14
+ * knob exists.
14
15
  */
15
16
  const HOME = homedir();
16
17
  // Default lives at `~/.maestro` (NOT `~/.maestro-agent`) so the path matches
@@ -21,10 +22,6 @@ const HOME = homedir();
21
22
  export const DATA_DIR = process.env.MAESTRO_DATA_DIR
22
23
  ? resolve(process.env.MAESTRO_DATA_DIR)
23
24
  : resolve(HOME, ".maestro");
24
- export const WORKSPACE_DIR = process.env.MAESTRO_WORKSPACE_DIR
25
- ? resolve(process.env.MAESTRO_WORKSPACE_DIR)
26
- : resolve(HOME, "maestro-workspace");
27
- export const MODEL_HAIKU = process.env.MAESTRO_COMPRESSION_MODEL ?? "claude-haiku-4-5-20251001";
28
25
  // Canonical model IDs used by the SDK's maestro registry. Hosts can pick a
29
26
  // different default per-query via `AgentQueryOptions.model`, so these are
30
27
  // just baseline references.
@@ -34,21 +31,15 @@ export const MODEL_OPUS = "claude-opus-4-7";
34
31
  export const MODEL_DEEPSEEK_V4_PRO = "deepseek-v4-pro";
35
32
  export const MODEL_DEEPSEEK_V4_FLASH = "deepseek-v4-flash";
36
33
  export const FILE_TAG_REGEX = /\[FILE:(\/[^\]]+)\]/gi;
37
- // Make sure DATA_DIR and WORKSPACE_DIR exist before any tool/skill code tries
38
- // to mkdtemp/readdir into them. Idempotent and best-effort — hosts that point
39
- // these at read-only mount points should override before importing the SDK.
34
+ // Make sure DATA_DIR exists before any tool/skill code tries to readdir into
35
+ // it. Idempotent and best-effort — hosts that point this at a read-only
36
+ // mount point should override before importing the SDK.
40
37
  try {
41
38
  mkdirSync(DATA_DIR, { recursive: true });
42
39
  }
43
40
  catch {
44
41
  // ignore — host may have pre-created with stricter perms
45
42
  }
46
- try {
47
- mkdirSync(WORKSPACE_DIR, { recursive: true });
48
- }
49
- catch {
50
- // ignore — host may have pre-created with stricter perms
51
- }
52
43
  /** Returns `process.env` without `CLAUDECODE` so spawned subprocesses don't
53
44
  * inherit a nested-claude-code detection flag from a parent harness. */
54
45
  export function getCleanEnv() {
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources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AAW,mBAAmB,CAAC;AAEnE,MAAM,CAAC,MAAM,cAAc,GAAW,uBAAuB,CAAC;AAE9D,6EAA6E;AAC7E,wEAAwE;AACxE,wDAAwD;AACxD,IAAI,CAAC;IACH,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC3C,CAAC;AAAC,MAAM,CAAC;IACP,yDAAyD;AAC3D,CAAC;AAED;yEACyE;AACzE,MAAM,UAAU,WAAW;IACzB,MAAM,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC/B,OAAO,GAAG,CAAC,UAAU,CAAC;IACtB,OAAO,GAAG,CAAC;AACb,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"}
@@ -58,6 +58,68 @@ export declare function maestroProvider(opts: AgentQueryOptions): AsyncGenerator
58
58
  * exact phrasing if they need parity.
59
59
  */
60
60
  export declare function iterationBudgetLine(remaining: number, max: number): string;
61
+ /**
62
+ * Skill profile name used when `AgentQueryOptions.skillKey` is omitted.
63
+ *
64
+ * Every skill the SDK loads lives under `<cwd>/.skills/<key>/` — there is
65
+ * no "uncategorized" slot directly beneath `.skills/`. When the caller
66
+ * doesn't specify a key, the SDK routes to this default subdirectory so
67
+ * the on-disk layout stays uniformly `key → catalog`. Hosts that want
68
+ * a different default name can pass `skillKey: "their-name"` explicitly
69
+ * on every call; the constant is exported so they can reference it
70
+ * symbolically rather than hard-coding the string.
71
+ */
72
+ export declare const MAESTRO_DEFAULT_SKILL_KEY: "default";
73
+ /**
74
+ * Resolve the directory the skill catalog should be loaded from for this
75
+ * call. Deterministic from `(opts.cwd, opts.skillKey)`:
76
+ *
77
+ * - `opts.skillKey` set → `<cwd>/.skills/<skillKey>/`
78
+ * - `opts.skillKey` unset → `<cwd>/.skills/default/`
79
+ *
80
+ * Every loaded skill lives under a named key — the SDK never reads from
81
+ * `<cwd>/.skills/` directly. This keeps the layout uniform so a caller
82
+ * scanning the filesystem can answer "which profiles exist in this
83
+ * workspace?" with one `readdir`.
84
+ *
85
+ * The per-cwd `.skills/` convention treats every session's working
86
+ * directory as its own skill scope — agents create, edit, and consume
87
+ * SKILL.md files inside the workspace they're operating on, with no
88
+ * global side effects on `~/.maestro/skills/` or on a peer SDK like
89
+ * Claude Code's `~/.claude/skills/`. The result is project-local
90
+ * autonomy: a `.skills/` dir checks into source control with the project,
91
+ * ships with the repo, and sub-agents inherit the parent's catalog
92
+ * because they share the cwd.
93
+ *
94
+ * `skillKey` partitions the per-cwd catalog: one workspace can host
95
+ * multiple disjoint skill sets (e.g. "legal" topic vs "coding" topic
96
+ * sharing the same `cwd`), and each session selects its profile via the
97
+ * key. The keyed dir IS the loader's root, so any skill the agent writes
98
+ * during the session naturally lands in the same profile.
99
+ *
100
+ * Hosts can pre-create a keyed dir as a symlink to share skills across
101
+ * profiles. The SDK itself takes no opinion on cross-profile sharing.
102
+ *
103
+ * Exported so hosts can recompute the same value (e.g. for a pre-warm
104
+ * step that calls `loadSkillsCached` ahead of a provider invocation).
105
+ */
106
+ export declare function resolveSkillsDir(opts: {
107
+ cwd: string;
108
+ skillKey?: string;
109
+ }): string;
110
+ /**
111
+ * Filter a loaded SkillEntry catalog by an optional `allowedSkills` whitelist.
112
+ * `undefined` returns the input unchanged (default "all allowed" behavior for
113
+ * pre-v0.1.5 hosts); an empty array intentionally returns nothing (the host
114
+ * explicitly opted into "no skills"). Unknown names are silently ignored — a
115
+ * host can pass a superset of names that may or may not exist.
116
+ *
117
+ * Generic over the SkillEntry shape so sub-agents and tests can reuse it
118
+ * with their own narrowed types without `as SkillEntry` casts.
119
+ */
120
+ export declare function applySkillAllowlist<T extends {
121
+ name: string;
122
+ }>(skills: T[], allowedSkills?: string[]): T[];
61
123
  /**
62
124
  * Pick the right provider adapter for a resolved model id. DeepSeek's V4
63
125
  * family uses `deepseek-*` ids; everything else (Anthropic claude-* + future
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,QAAQ,EAAyC,MAAM,kBAAkB,CAAC;AA0BxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAuB,eAAe,CAAC,IAAI,EAAE,iBAAiB,GAA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