@wrongstack/core 0.257.2 → 0.260.0

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 (63) hide show
  1. package/dist/{agent-bridge-BrxWHEOm.d.ts → agent-bridge-BbskZ7HH.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-US741uBH.d.ts → agent-subagent-runner-BNIGZx18.d.ts} +28 -8
  3. package/dist/{brain-TjEEwSpw.d.ts → brain-C2yDd7Lw.d.ts} +58 -1
  4. package/dist/{compactor-C5sT4U7I.d.ts → compactor-t0R_AIt_.d.ts} +1 -1
  5. package/dist/{config-DuAu23zm.d.ts → config-FG6As4H5.d.ts} +1 -1
  6. package/dist/{context-CGdgA0q6.d.ts → context-JFOVvu6z.d.ts} +22 -0
  7. package/dist/coordination/index.d.ts +14 -14
  8. package/dist/coordination/index.js +189 -28
  9. package/dist/coordination/index.js.map +1 -1
  10. package/dist/defaults/index.d.ts +25 -25
  11. package/dist/defaults/index.js +881 -83
  12. package/dist/defaults/index.js.map +1 -1
  13. package/dist/execution/index.d.ts +15 -15
  14. package/dist/execution/index.js +108 -26
  15. package/dist/execution/index.js.map +1 -1
  16. package/dist/execution/prompt-enhancer.d.ts +1 -1
  17. package/dist/extension/index.d.ts +6 -6
  18. package/dist/{goal-preamble-CznHTZqP.d.ts → goal-preamble-B1IXJtLX.d.ts} +9 -9
  19. package/dist/{goal-store-CV9Yz2X_.d.ts → goal-store-CPXz6Mml.d.ts} +4 -2
  20. package/dist/{index-CitPrI3a.d.ts → index-BPcg4N3M.d.ts} +5 -5
  21. package/dist/{index-CC0Mcm05.d.ts → index-CebbJB94.d.ts} +8 -8
  22. package/dist/index.d.ts +44 -42
  23. package/dist/index.js +1452 -274
  24. package/dist/index.js.map +1 -1
  25. package/dist/infrastructure/index.d.ts +6 -6
  26. package/dist/kernel/index.d.ts +9 -9
  27. package/dist/kernel/index.js.map +1 -1
  28. package/dist/{llm-selector-CJ4SyAFE.d.ts → llm-selector-DXxI2tlu.d.ts} +2 -2
  29. package/dist/{mcp-servers-D8YnLaEp.d.ts → mcp-servers-OwNHo43-.d.ts} +3 -3
  30. package/dist/models/index.d.ts +5 -5
  31. package/dist/{models-registry-ByZCdFuQ.d.ts → models-registry-Djlmq4uB.d.ts} +1 -1
  32. package/dist/{multi-agent-coordinator-DqTUEAeC.d.ts → multi-agent-coordinator-CEmrSCMJ.d.ts} +1 -1
  33. package/dist/{null-fleet-bus-B5mfTJXT.d.ts → null-fleet-bus-DT92xqgJ.d.ts} +13 -8
  34. package/dist/observability/index.d.ts +2 -2
  35. package/dist/{package-outdated-watcher-BSgR_kK-.d.ts → package-outdated-watcher-C70ag2G9.d.ts} +3 -3
  36. package/dist/{parallel-eternal-engine-C0juOszP.d.ts → parallel-eternal-engine-0SItuq5r.d.ts} +13 -9
  37. package/dist/{path-resolver-CbkT-RMU.d.ts → path-resolver-DKBh6Jlo.d.ts} +3 -3
  38. package/dist/{permission-CwBBpCoF.d.ts → permission-BJ7eO9Vl.d.ts} +1 -1
  39. package/dist/{permission-policy-B8rSu908.d.ts → permission-policy-DEXOfnpm.d.ts} +3 -2
  40. package/dist/{pipeline-JG8XoudC.d.ts → pipeline-zflkI2dp.d.ts} +2 -2
  41. package/dist/{plan-templates-DPiQMkBz.d.ts → plan-templates-BFXyRkEK.d.ts} +32 -11
  42. package/dist/{provider-runner-hM7EXlLI.d.ts → provider-runner-BC-uywtT.d.ts} +3 -3
  43. package/dist/{retry-policy-Tg7LXkoK.d.ts → retry-policy-Cavrzmtk.d.ts} +1 -1
  44. package/dist/sdd/index.d.ts +8 -8
  45. package/dist/sdd/index.js +20 -2
  46. package/dist/sdd/index.js.map +1 -1
  47. package/dist/{secret-vault-gxtFZYBt.d.ts → secret-vault-CDvDYXWX.d.ts} +1 -1
  48. package/dist/security/index.d.ts +4 -4
  49. package/dist/security/index.js +30 -1
  50. package/dist/security/index.js.map +1 -1
  51. package/dist/{selector-DWsqVjGf.d.ts → selector-B7AivHsu.d.ts} +1 -1
  52. package/dist/{session-event-bridge-BAFWdgQ3.d.ts → session-event-bridge-BmIDxdJd.d.ts} +1 -1
  53. package/dist/{session-reader-CqRvaL5v.d.ts → session-reader-DtofsB-2.d.ts} +1 -1
  54. package/dist/storage/index.d.ts +30 -21
  55. package/dist/storage/index.js +1264 -216
  56. package/dist/storage/index.js.map +1 -1
  57. package/dist/types/index.d.ts +19 -19
  58. package/dist/types/index.js +8 -0
  59. package/dist/types/index.js.map +1 -1
  60. package/dist/utils/index.d.ts +2 -2
  61. package/package.json +1 -1
  62. package/skills/output-standards/SKILL.md +14 -9
  63. package/skills/output-standards/SKILL.save.md +3 -2
@@ -1,11 +1,11 @@
1
- import { d as AgentPhase, A as AgentDefinition, a as DefaultMultiAgentCoordinator, D as DispatchClassifier } from './multi-agent-coordinator-DqTUEAeC.js';
2
- import { F as FleetBus, u as FleetUsage, S as SubagentConfig, v as FleetUsageAggregator, f as TaskResult, C as CoordinatorStatus, T as TaskSpec, c as MultiAgentConfig, d as SubagentRunner } from './agent-subagent-runner-US741uBH.js';
3
- import { a as SessionWriter, T as Tool, i as SessionStore } from './context-CGdgA0q6.js';
4
- import { B as BrainArbiter, E as EventBus } from './brain-TjEEwSpw.js';
1
+ import { d as AgentPhase, A as AgentDefinition, a as DefaultMultiAgentCoordinator, D as DispatchClassifier } from './multi-agent-coordinator-CEmrSCMJ.js';
2
+ import { F as FleetBus, u as FleetUsage, S as SubagentConfig, v as FleetUsageAggregator, f as TaskResult, C as CoordinatorStatus, T as TaskSpec, c as MultiAgentConfig, d as SubagentRunner } from './agent-subagent-runner-BNIGZx18.js';
3
+ import { a as SessionWriter, T as Tool, i as SessionStore } from './context-JFOVvu6z.js';
4
+ import { B as BrainArbiter, E as EventBus } from './brain-C2yDd7Lw.js';
5
5
  import { EventEmitter } from 'node:events';
6
6
  import { D as DirectorStateSnapshot } from './director-state-BfeCUbmk.js';
7
- import { d as ModelMatrixEntry } from './config-DuAu23zm.js';
8
- import { I as InMemoryAgentBridge } from './agent-bridge-BrxWHEOm.js';
7
+ import { d as ModelMatrixEntry } from './config-FG6As4H5.js';
8
+ import { I as InMemoryAgentBridge } from './agent-bridge-BbskZ7HH.js';
9
9
 
10
10
  /**
11
11
  * Alert levels the Director can emit when a collab session needs attention.
@@ -1629,6 +1629,11 @@ interface DirectorSessionFactoryOptions {
1629
1629
  * prior fleet manifest.
1630
1630
  */
1631
1631
  directorRunId?: string | undefined;
1632
+ /**
1633
+ * Session-level trace ID for correlating subagent storage events with
1634
+ * the parent session's trace in observability pipelines.
1635
+ */
1636
+ traceId?: string | undefined;
1632
1637
  }
1633
1638
  interface DirectorSessionFactory {
1634
1639
  /** Absolute directory where this director run's transcripts live. */
@@ -1680,7 +1685,7 @@ declare function makeDirectorSessionFactory(opts: DirectorSessionFactoryOptions)
1680
1685
  * descriptions live on the tool definitions themselves; this preamble only
1681
1686
  * teaches *when* to reach for them.
1682
1687
  */
1683
- declare const DEFAULT_DIRECTOR_PREAMBLE = "You are the Director of a multi-agent fleet. You orchestrate worker\nsubagents by spawning them, assigning tasks, awaiting completions, and\nrolling up their outputs into your next decision.\n\nCore fleet tools available to you:\n - spawn_subagent \u2014 create a worker with a chosen provider / model / role\n - assign_task \u2014 hand a piece of work to a specific subagent\n - await_tasks \u2014 block until named task ids complete (parallel-safe)\n - ask_subagent \u2014 synchronously query a running subagent via the bridge\n - roll_up \u2014 aggregate finished tasks into a markdown/json summary\n - terminate_subagent \u2014 abort a stuck worker (use sparingly)\n - fleet_status \u2014 snapshot of all subagents and pending tasks\n - fleet_usage \u2014 token + cost breakdown per subagent and total\n\nWorking rules:\n 1. Decompose first. Before spawning, decide which sub-tasks are\n independent and can run in parallel. Sequential work doesn't need a\n subagent \u2014 do it yourself.\n 2. Match worker to job. Cheap/fast model for triage, capable model for\n synthesis. Different providers per sibling is allowed and encouraged.\n 3. Always pair an assign with an await. Don't fire-and-forget; you owe\n the user a single coherent answer at the end.\n 4. Roll up before deciding. After await_tasks resolves, call roll_up so\n the results are folded back into your context in a compact form.\n 5. Budget is real. Check fleet_usage periodically. If a subagent is\n thrashing, terminate it rather than letting cost climb silently.\n 6. Never claim a subagent's work as your own without verifying it. If a\n result looks wrong, ask_subagent for clarification before passing it\n to the user.\n 7. Wind down when satisfied. When the results are good enough, call\n work_complete \u2014 no new subagents will spawn and queued tasks complete\n as aborted. Running subagents finish naturally. Call terminate_subagent\n only for ones you need to stop immediately.";
1688
+ declare const DEFAULT_DIRECTOR_PREAMBLE = "You are the Director of a multi-agent fleet. You orchestrate worker\nsubagents by spawning them, assigning tasks, awaiting completions, and\nrolling up their outputs into your next decision.\n\nCore fleet tools available to you:\n - spawn_subagent \u2014 create a worker with a chosen provider / model / role\n - assign_task \u2014 hand a piece of work to a specific subagent\n - await_tasks \u2014 block until named task ids complete (parallel-safe)\n - ask_subagent \u2014 synchronously query a running subagent via the bridge\n - roll_up \u2014 aggregate finished tasks into a markdown/json summary\n - terminate_subagent \u2014 abort a stuck worker (use sparingly)\n - fleet_status \u2014 snapshot of all subagents and pending tasks\n - fleet_usage \u2014 token + cost breakdown per subagent and total\n\nWorking rules:\n 1. Decompose first. Before spawning, decide which sub-tasks are\n independent and can run in parallel. Sequential work doesn't need a\n subagent \u2014 do it yourself.\n 2. Match worker to job. Cheap/fast model for triage, capable model for\n synthesis. Different providers per sibling is allowed and encouraged.\n 3. Always pair an assign with an await. Don't fire-and-forget; you owe\n the user a single coherent answer at the end.\n 4. Roll up before deciding. After await_tasks resolves, call roll_up so\n the results are folded back into your context in a compact form.\n 5. Budget is real. Check fleet_usage periodically. If a subagent is\n thrashing, terminate it rather than letting cost climb silently.\n 6. Never claim a subagent's work as your own without verifying it. If a\n result looks wrong, ask_subagent for clarification before passing it\n to the user.\n 7. **Act on subagent mail immediately**. Subagent messages (result, ask,\n assign, note) are injected inline before every step \u2014 even mid-task.\n When you see one, address it before continuing: reply to asks, factor\n in results, act on assignments. Use `mailbox action=ack` to mark\n completed messages.\n 8. Wind down when satisfied. When the results are good enough, call\n work_complete \u2014 no new subagents will spawn and queued tasks complete\n as aborted. Running subagents finish naturally. Call terminate_subagent\n only for ones you need to stop immediately.";
1684
1689
  /**
1685
1690
  * Default baseline prepended to every subagent's system prompt. Tells the
1686
1691
  * subagent its place in the hierarchy and the bridge contract — without
@@ -1692,7 +1697,7 @@ declare const DEFAULT_DIRECTOR_PREAMBLE = "You are the Director of a multi-agent
1692
1697
  * baseline reinforces this in plain text — the actual enforcement is at
1693
1698
  * the bridge transport layer.
1694
1699
  */
1695
- declare const DEFAULT_SUBAGENT_BASELINE = "You are a subagent operating under a Director. You were spawned to handle\na specific slice of a larger plan \u2014 do that slice well and report back.\n\nBridge contract:\n - You have a parent (the Director). You may call `request` on the\n parent bridge to ask a clarifying question. Use this sparingly; the\n parent is also working.\n - You MAY NOT request the parent's system prompt, tool list, or other\n subagents' context. Those are not yours to read.\n - Your final task output is what the Director sees. Be concise,\n structured, and self-contained \u2014 assume the Director will paste your\n output into its own context.\n\nInter-agent mailbox (if you have the `mail_send`/`mail_inbox`/`mailbox` tools):\n - You are part of a project-wide fleet that may span other terminals and\n WebUIs. Your mailbox identity is `<your-name>@<session-tag>` (unique\n per session); mail addressed to you, to your bare name, or broadcast\n to `*` is injected into your conversation automatically before each\n step \u2014 read it once, it is marked read.\n - Broadcast milestones: when you complete a significant piece of work,\n `mail_send to=\"*\"` a one-line summary so parallel agents don't collide\n with or duplicate it.\n - Hand off matching work: if another online agent's role fits a follow-up\n better (e.g. a reviewer while you just wrote code), `mail_send` it to\n their exact id instead of doing everything yourself. Discover ids with\n `mailbox action=online`.\n - Answer your mail: reply to the sender's exact `from` id. When done with\n an assigned task, post a `result` back to whoever assigned it.";
1700
+ declare const DEFAULT_SUBAGENT_BASELINE = "You are a subagent operating under a Director. You were spawned to handle\na specific slice of a larger plan \u2014 do that slice well and report back.\n\nBridge contract:\n - You have a parent (the Director). You may call `request` on the\n parent bridge to ask a clarifying question. Use this sparingly; the\n parent is also working.\n - You MAY NOT request the parent's system prompt, tool list, or other\n subagents' context. Those are not yours to read.\n - Your final task output is what the Director sees. Be concise,\n structured, and self-contained \u2014 assume the Director will paste your\n output into its own context.\n\nCRITICAL CONSTRAINT \u2014 NO FURTHER DELEGATION:\n - You MUST NOT call the `delegate` tool or attempt to spawn subagents.\n - You MUST NOT use `spawn_subagent`, `assign_task`, or any equivalent.\n - Your role is to execute the assigned task yourself, not to orchestrate.\n - If a subtask is too complex, report back to the Director with what you\n found and let the Director decide how to decompose.\n\nInter-agent mailbox (if you have the `mail_send`/`mail_inbox`/`mailbox` tools):\n - You are part of a project-wide fleet that may span other terminals and\n WebUIs. Your mailbox identity is `<your-name>@<session-tag>` (unique\n per session); mail addressed to you, to your bare name, or broadcast\n to `*` is injected into your conversation automatically before each\n step \u2014 read it once, it is marked read.\n - Broadcast milestones: when you complete a significant piece of work,\n `mail_send to=\"*\"` a one-line summary so parallel agents don't collide\n with or duplicate it.\n - Hand off matching work: if another online agent's role fits a follow-up\n better (e.g. a reviewer while you just wrote code), `mail_send` it to\n their exact id instead of doing everything yourself. Discover ids with\n `mailbox action=online`.\n - Answer your mail: reply to the sender's exact `from` id. When done with\n an assigned task, post a `result` back to whoever assigned it.\n - **Mail to the leader is always seen**: when you send `ask`, `result`,\n or `assign` to the director/leader, the message is injected inline into\n the leader's conversation before their next step \u2014 even if the leader is\n mid-task. Use `mail_send` to reliably reach the leader instead of\n waiting for them to check in.";
1696
1701
  /** Parts the leader-prompt composer accepts. All optional. */
1697
1702
  interface DirectorPromptParts {
1698
1703
  /** The user's existing leader system prompt — typically what was passed
@@ -1,6 +1,6 @@
1
1
  import { M as MetricsSink, d as MetricLabels, f as MetricsSnapshot, H as HealthRegistry, a as HealthCheck, A as AggregateHealth, T as Tracer, S as Span } from '../observability-D-HZN_mF.js';
2
- import { E as EventBus } from '../brain-TjEEwSpw.js';
3
- import '../context-CGdgA0q6.js';
2
+ import { E as EventBus } from '../brain-C2yDd7Lw.js';
3
+ import '../context-JFOVvu6z.js';
4
4
 
5
5
  /**
6
6
  * In-memory metrics sink. Suitable for embedded use, tests, and /metrics
@@ -1,6 +1,6 @@
1
- import { b as Mailbox, c as MailboxSendInput, d as MailboxMessage, e as MailboxQuery, f as MailboxAckInput, g as MailboxAgentStatus, A as AgentRegistrationInput, h as AgentHeartbeatInput, i as ClientRegistrationInput, j as ClientHeartbeatInput, k as ClientStatus } from './pipeline-JG8XoudC.js';
2
- import { E as EventBus, B as BrainArbiter } from './brain-TjEEwSpw.js';
3
- import { C as Context, T as Tool } from './context-CGdgA0q6.js';
1
+ import { b as Mailbox, c as MailboxSendInput, d as MailboxMessage, e as MailboxQuery, f as MailboxAckInput, g as MailboxAgentStatus, A as AgentRegistrationInput, h as AgentHeartbeatInput, i as ClientRegistrationInput, j as ClientHeartbeatInput, k as ClientStatus } from './pipeline-zflkI2dp.js';
2
+ import { E as EventBus, B as BrainArbiter } from './brain-C2yDd7Lw.js';
3
+ import { C as Context, T as Tool } from './context-JFOVvu6z.js';
4
4
 
5
5
  /**
6
6
  * DefaultMailbox — append-only JSONL inter-agent mailbox (per-session).
@@ -1,12 +1,12 @@
1
- import { e as ProviderError, C as Context, T as Tool, l as ToolUseBlock, m as ToolResultBlock } from './context-CGdgA0q6.js';
2
- import { R as RetryPolicy, E as ErrorHandler, a as RecoveryDecision } from './retry-policy-Tg7LXkoK.js';
3
- import { C as Compactor, a as CompactReport } from './compactor-C5sT4U7I.js';
4
- import { M as ModelsRegistry } from './config-DuAu23zm.js';
5
- import { T as ToolExecutorOptions, a as ToolExecutorStrategy, b as ToolBatchResult } from './index-CitPrI3a.js';
6
- import { g as Agent, h as AgentFactory } from './agent-subagent-runner-US741uBH.js';
7
- import { B as BrainArbiter } from './brain-TjEEwSpw.js';
8
- import { J as JournalEntry } from './goal-store-CV9Yz2X_.js';
9
- import { D as DispatchClassifier, a as DefaultMultiAgentCoordinator } from './multi-agent-coordinator-DqTUEAeC.js';
1
+ import { e as ProviderError, C as Context, T as Tool, l as ToolUseBlock, m as ToolResultBlock } from './context-JFOVvu6z.js';
2
+ import { R as RetryPolicy, E as ErrorHandler, a as RecoveryDecision } from './retry-policy-Cavrzmtk.js';
3
+ import { C as Compactor, a as CompactReport } from './compactor-t0R_AIt_.js';
4
+ import { M as ModelsRegistry } from './config-FG6As4H5.js';
5
+ import { T as ToolExecutorOptions, a as ToolExecutorStrategy, b as ToolBatchResult } from './index-BPcg4N3M.js';
6
+ import { g as Agent, h as AgentFactory } from './agent-subagent-runner-BNIGZx18.js';
7
+ import { B as BrainArbiter, E as EventBus } from './brain-C2yDd7Lw.js';
8
+ import { J as JournalEntry } from './goal-store-CPXz6Mml.js';
9
+ import { D as DispatchClassifier, a as DefaultMultiAgentCoordinator } from './multi-agent-coordinator-CEmrSCMJ.js';
10
10
 
11
11
  declare class DefaultRetryPolicy implements RetryPolicy {
12
12
  shouldRetry(err: Error | ProviderError, attempt: number): boolean;
@@ -277,6 +277,8 @@ interface EternalAutonomyOptions {
277
277
  * Without a brain, the engine uses its built-in heuristics.
278
278
  */
279
279
  brain?: BrainArbiter | undefined;
280
+ /** Optional EventBus for emitting storage.* observability events from goal I/O. */
281
+ events?: EventBus | undefined;
280
282
  }
281
283
  type EternalEngineState = 'idle' | 'running' | 'stopped';
282
284
  /**
@@ -490,6 +492,8 @@ interface ParallelEternalOptions {
490
492
  * provider call — preferred for a continuously-ticking autonomous loop).
491
493
  */
492
494
  dispatchClassifier?: DispatchClassifier | undefined;
495
+ /** Optional EventBus for emitting storage.* observability events from goal I/O. */
496
+ events?: EventBus | undefined;
493
497
  }
494
498
  /**
495
499
  * Sense → Decide → Fan-out (4–8 parallel agents) → Aggregate → Loop.
@@ -1,6 +1,6 @@
1
- import { E as EventBus } from './brain-TjEEwSpw.js';
2
- import { M as ModelsRegistry, b as ResolvedModel } from './config-DuAu23zm.js';
3
- import { c as TokenCounter, U as Usage, d as CacheStats } from './context-CGdgA0q6.js';
1
+ import { E as EventBus } from './brain-C2yDd7Lw.js';
2
+ import { M as ModelsRegistry, b as ResolvedModel } from './config-FG6As4H5.js';
3
+ import { c as TokenCounter, U as Usage, d as CacheStats } from './context-JFOVvu6z.js';
4
4
  import { P as PathResolver } from './path-resolver-CPRj4bFY.js';
5
5
 
6
6
  /**
@@ -1,4 +1,4 @@
1
- import { T as Tool, C as Context, f as Permission } from './context-CGdgA0q6.js';
1
+ import { T as Tool, C as Context, f as Permission } from './context-JFOVvu6z.js';
2
2
 
3
3
  interface SecretScrubber {
4
4
  scrub(text: string): string;
@@ -1,6 +1,6 @@
1
- import { T as Tool, C as Context } from './context-CGdgA0q6.js';
1
+ import { T as Tool, C as Context } from './context-JFOVvu6z.js';
2
2
  import { I as InputReader } from './input-reader-E-ffP2ee.js';
3
- import { P as PermissionPolicy, a as PermissionDecision } from './permission-CwBBpCoF.js';
3
+ import { P as PermissionPolicy, a as PermissionDecision } from './permission-BJ7eO9Vl.js';
4
4
 
5
5
  interface PermissionPolicyOptions {
6
6
  trustFile: string;
@@ -97,6 +97,7 @@ declare class DefaultPermissionPolicy implements PermissionPolicy {
97
97
  getConfirmDestructive(): boolean;
98
98
  reload(): Promise<void>;
99
99
  evaluate(tool: Tool, input: unknown, ctx: Context): Promise<PermissionDecision>;
100
+ private isDestructiveByCapability;
100
101
  private isDestructiveYoloCall;
101
102
  trust(rule: {
102
103
  tool: string;
@@ -1,5 +1,5 @@
1
- import { T as Tool, n as TextBlock, g as ContentBlock } from './context-CGdgA0q6.js';
2
- import { H as HookEvent, e as HookMatcher, I as InProcessHook, S as ShellHook, f as HookEntry } from './config-DuAu23zm.js';
1
+ import { T as Tool, n as TextBlock, g as ContentBlock } from './context-JFOVvu6z.js';
2
+ import { H as HookEvent, e as HookMatcher, I as InProcessHook, S as ShellHook, f as HookEntry } from './config-FG6As4H5.js';
3
3
 
4
4
  /**
5
5
  * Mailbox — persistent inter-agent messaging system with cross-session support.
@@ -1,9 +1,9 @@
1
- import { E as EventBus, M as MemoryScope, k as MemoryEntry, l as MemoryStore, m as MemoryRelevanceContext, S as ScoredEntry } from './brain-TjEEwSpw.js';
2
- import { S as SecretScrubber } from './permission-CwBBpCoF.js';
3
- import { i as SessionStore, h as SessionMetadata, a as SessionWriter, p as ResumedSession, q as SessionData, r as SessionSummary, g as ContentBlock, S as SessionEvent, s as TodoItem, t as ConversationState } from './context-CGdgA0q6.js';
4
- import { A as AttachmentStore, a as AddAttachmentInput, b as AttachmentRef, c as Attachment } from './session-reader-CqRvaL5v.js';
1
+ import { E as EventBus, M as MemoryScope, k as MemoryEntry, l as MemoryStore, m as MemoryRelevanceContext, S as ScoredEntry } from './brain-C2yDd7Lw.js';
2
+ import { S as SecretScrubber } from './permission-BJ7eO9Vl.js';
3
+ import { i as SessionStore, h as SessionMetadata, a as SessionWriter, p as ResumedSession, q as SessionData, r as SessionSummary, g as ContentBlock, S as SessionEvent, s as TodoItem, t as ConversationState } from './context-JFOVvu6z.js';
4
+ import { A as AttachmentStore, a as AddAttachmentInput, b as AttachmentRef, c as Attachment } from './session-reader-DtofsB-2.js';
5
5
  import { W as WstackPaths } from './wstack-paths-CJjEwPXn.js';
6
- import { i as ConfigStore, h as Config, j as ConfigLoader, k as SyncConfig } from './config-DuAu23zm.js';
6
+ import { i as ConfigStore, h as Config, j as ConfigLoader, k as SyncConfig } from './config-FG6As4H5.js';
7
7
  import { S as SecretVault } from './secret-vault-BJDY28ev.js';
8
8
 
9
9
  interface SessionStoreOptions {
@@ -25,6 +25,9 @@ declare class DefaultSessionStore implements SessionStore {
25
25
  private readonly events?;
26
26
  private readonly secretScrubber?;
27
27
  constructor(opts: SessionStoreOptions);
28
+ private emitRead;
29
+ private emitWrite;
30
+ private emitError;
28
31
  /** Absolute path to the session index file. */
29
32
  private get indexFile();
30
33
  /** Join session ID to its absolute path within the store directory. */
@@ -108,8 +111,12 @@ interface PersistedQueueItem {
108
111
  */
109
112
  declare class QueueStore {
110
113
  private readonly file;
114
+ private readonly events;
115
+ private readonly traceId;
111
116
  constructor(opts: {
112
117
  dir: string;
118
+ events?: EventBus;
119
+ traceId?: string;
113
120
  });
114
121
  write(items: PersistedQueueItem[]): Promise<void>;
115
122
  read(): Promise<PersistedQueueItem[]>;
@@ -198,6 +205,7 @@ interface MemoryStoreOptions {
198
205
  declare class DefaultMemoryStore implements MemoryStore {
199
206
  private readonly files;
200
207
  private readonly events?;
208
+ private traceId?;
201
209
  private readonly backend;
202
210
  /**
203
211
  * Per-scope serialization queue. `remember` / `forget` / `consolidate` /
@@ -249,7 +257,16 @@ declare class DefaultMemoryStore implements MemoryStore {
249
257
  forget(query: string, scope?: MemoryScope): Promise<number>;
250
258
  consolidate(scope: MemoryScope): Promise<void>;
251
259
  clear(scope?: MemoryScope): Promise<void>;
252
- /** Mirror current memory content to the persistent backup directory. */
260
+ /**
261
+ * Return a new MemoryStore proxy that carries `traceId` on every storage
262
+ * event. The original store is left unchanged — callers that need a
263
+ * trace-decorated view (e.g. session-run tools) receive the proxy while
264
+ * the singleton remains trace-free for boot-time use.
265
+ *
266
+ * The proxy implements the full `MemoryStore` interface; all other
267
+ * properties (backend, etc.) are delegated to the original store.
268
+ */
269
+ withTraceId(traceId: string): MemoryStore;
253
270
  private mirrorBackup;
254
271
  }
255
272
 
@@ -296,12 +313,16 @@ interface ConfigLoaderOptions {
296
313
  vault?: SecretVault | undefined;
297
314
  /** Extra sources merged after the built-in layers. */
298
315
  sources?: ConfigSource[] | undefined;
316
+ events?: EventBus;
317
+ traceId?: string;
299
318
  }
300
319
  declare class DefaultConfigLoader implements ConfigLoader {
301
320
  private readonly paths;
302
321
  private readonly strict;
303
322
  private readonly vault;
304
323
  private readonly extraSources;
324
+ private readonly events;
325
+ private readonly traceId;
305
326
  constructor(opts: ConfigLoaderOptions);
306
327
  load(opts?: {
307
328
  cliFlags?: Partial<Config> | undefined;
@@ -544,12 +565,12 @@ type TodosCheckpointDetach = () => Promise<void>;
544
565
  /** Read a checkpoint from disk. Returns null when the file doesn't
545
566
  * exist or is corrupt — callers treat both cases as "no prior state".
546
567
  */
547
- declare function loadTodosCheckpoint(filePath: string): Promise<TodoItem[] | null>;
568
+ declare function loadTodosCheckpoint(filePath: string, events?: EventBus, traceId?: string): Promise<TodoItem[] | null>;
548
569
  /** Write the checkpoint atomically. Best-effort: a write failure is
549
570
  * logged but does not throw — losing one checkpoint shouldn't bring
550
571
  * down the agent run.
551
572
  */
552
- declare function saveTodosCheckpoint(filePath: string, sessionId: string, todos: readonly TodoItem[]): Promise<void>;
573
+ declare function saveTodosCheckpoint(filePath: string, sessionId: string, todos: readonly TodoItem[], events?: EventBus, traceId?: string): Promise<void>;
553
574
  /**
554
575
  * Subscribe a `ConversationState` so every `todos_replaced` mutation
555
576
  * triggers an atomic write to disk. Returns the unsubscribe function.
@@ -558,7 +579,7 @@ declare function saveTodosCheckpoint(filePath: string, sessionId: string, todos:
558
579
  * marking three items done in the same tool call) coalesces into one
559
580
  * disk hit.
560
581
  */
561
- declare function attachTodosCheckpoint(state: ConversationState, filePath: string, sessionId: string): TodosCheckpointDetach;
582
+ declare function attachTodosCheckpoint(state: ConversationState, filePath: string, sessionId: string, events?: EventBus, traceId?: string): TodosCheckpointDetach;
562
583
 
563
584
  /**
564
585
  * Plan items are the strategic counterpart to todos. Where `ctx.todos`
@@ -586,8 +607,8 @@ interface PlanFile {
586
607
  updatedAt: string;
587
608
  items: PlanItem[];
588
609
  }
589
- declare function loadPlan(filePath: string): Promise<PlanFile | null>;
590
- declare function savePlan(filePath: string, plan: PlanFile): Promise<void>;
610
+ declare function loadPlan(filePath: string, events?: EventBus): Promise<PlanFile | null>;
611
+ declare function savePlan(filePath: string, plan: PlanFile, events?: EventBus): Promise<void>;
591
612
  /** Create a new PlanFile when none exists on disk. */
592
613
  declare function emptyPlan(sessionId: string, title?: string): PlanFile;
593
614
  declare function addPlanItem(plan: PlanFile, title: string, details?: string | undefined): {
@@ -1,8 +1,8 @@
1
- import { E as EventBus } from './brain-TjEEwSpw.js';
1
+ import { E as EventBus } from './brain-C2yDd7Lw.js';
2
2
  import { L as Logger } from './logger-B63L5bTg.js';
3
3
  import { T as Tracer } from './observability-D-HZN_mF.js';
4
- import { P as Provider, R as Request, C as Context, b as Response } from './context-CGdgA0q6.js';
5
- import { R as RetryPolicy } from './retry-policy-Tg7LXkoK.js';
4
+ import { P as Provider, R as Request, C as Context, b as Response } from './context-JFOVvu6z.js';
5
+ import { R as RetryPolicy } from './retry-policy-Cavrzmtk.js';
6
6
 
7
7
  /**
8
8
  * Options passed to a ProviderRunner when calling the provider.
@@ -1,4 +1,4 @@
1
- import { C as Context, b as Response, e as ProviderError } from './context-CGdgA0q6.js';
1
+ import { C as Context, b as Response, e as ProviderError } from './context-JFOVvu6z.js';
2
2
 
3
3
  type RecoveryDecision = {
4
4
  /**
@@ -1,15 +1,15 @@
1
1
  import { h as Specification, S as SpecAnalysis, g as SpecValidationResult, e as SpecStatus, f as SpecTemplate, b as SpecRequirement } from '../spec-TBi3Jr6T.js';
2
2
  import { d as TaskGraph, e as TaskNode, i as TaskFilter, j as TaskSort, c as TaskProgress, T as TaskType, a as TaskPriority } from '../task-graph-u1q9Jkyk.js';
3
- import { E as EventBus } from '../brain-TjEEwSpw.js';
4
- import { D as DoneCondition, g as Agent, h as AgentFactory, f as TaskResult } from '../agent-subagent-runner-US741uBH.js';
5
- import '../context-CGdgA0q6.js';
6
- import '../index-CitPrI3a.js';
3
+ import { E as EventBus } from '../brain-C2yDd7Lw.js';
4
+ import { D as DoneCondition, g as Agent, h as AgentFactory, f as TaskResult } from '../agent-subagent-runner-BNIGZx18.js';
5
+ import '../context-JFOVvu6z.js';
6
+ import '../index-BPcg4N3M.js';
7
7
  import '../logger-B63L5bTg.js';
8
- import '../pipeline-JG8XoudC.js';
9
- import '../config-DuAu23zm.js';
8
+ import '../pipeline-zflkI2dp.js';
9
+ import '../config-FG6As4H5.js';
10
10
  import '../observability-D-HZN_mF.js';
11
- import '../permission-CwBBpCoF.js';
12
- import '../retry-policy-Tg7LXkoK.js';
11
+ import '../permission-BJ7eO9Vl.js';
12
+ import '../retry-policy-Cavrzmtk.js';
13
13
 
14
14
  declare class SpecParser {
15
15
  parse(content: string): Specification;
package/dist/sdd/index.js CHANGED
@@ -3125,6 +3125,20 @@ var SubagentBudget = class _SubagentBudget {
3125
3125
  };
3126
3126
 
3127
3127
  // src/coordination/agent-subagent-runner.ts
3128
+ function withDisabledToolFiltering(factory) {
3129
+ return async (config) => {
3130
+ const result = await factory(config);
3131
+ const disabled = config.disabledTools ?? [];
3132
+ if (disabled.length === 0) return result;
3133
+ const registry = result.agent.tools;
3134
+ if (registry && typeof registry.unregister === "function") {
3135
+ for (const toolName of disabled) {
3136
+ registry.unregister(toolName);
3137
+ }
3138
+ }
3139
+ return result;
3140
+ };
3141
+ }
3128
3142
  function makeAgentSubagentRunner(opts) {
3129
3143
  const format = opts.formatTaskInput ?? defaultFormatTaskInput;
3130
3144
  return async (task, ctx) => {
@@ -7012,7 +7026,9 @@ var SddParallelRun = class {
7012
7026
  doneCondition: { type: "all_tasks_done" }
7013
7027
  };
7014
7028
  this.coordinator = new DefaultMultiAgentCoordinator(config);
7015
- const runner = makeAgentSubagentRunner({ factory: this.opts.subagentFactory ?? this.defaultFactory() });
7029
+ const baseFactory = this.opts.subagentFactory ?? this.defaultFactory();
7030
+ const filteredFactory = withDisabledToolFiltering(baseFactory);
7031
+ const runner = makeAgentSubagentRunner({ factory: filteredFactory });
7016
7032
  this.coordinator.setRunner?.(runner);
7017
7033
  }
7018
7034
  defaultFactory() {
@@ -7054,7 +7070,9 @@ var SddParallelRun = class {
7054
7070
  id: subagentId,
7055
7071
  name: subagentId,
7056
7072
  role: "executor",
7057
- timeoutMs: this.timeoutMs
7073
+ timeoutMs: this.timeoutMs,
7074
+ // Disable delegation — subagents are leaf workers, not orchestrators
7075
+ disabledTools: ["delegate"]
7058
7076
  })
7059
7077
  );
7060
7078
  const spawnResults = await Promise.all(spawns);