@wrongstack/core 0.275.1 → 0.276.2

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 (83) hide show
  1. package/dist/{agent-bridge-D9JkPvJ0.d.ts → agent-bridge-D7A-eu3C.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-CArSFKFl.d.ts → agent-subagent-runner-CEuw4ATz.d.ts} +16 -10
  3. package/dist/{brain-DCkB5_e7.d.ts → brain-BLOyN5ZP.d.ts} +127 -1
  4. package/dist/{compactor-CzSvxM1g.d.ts → compactor-DcBpaJsI.d.ts} +1 -1
  5. package/dist/{config-BzFRKkg7.d.ts → config-Bf5mj-ad.d.ts} +20 -2
  6. package/dist/{context-BrLe8pJy.d.ts → context-CLnUMW5g.d.ts} +40 -2
  7. package/dist/coordination/index.d.ts +43 -24
  8. package/dist/coordination/index.js +849 -648
  9. package/dist/coordination/index.js.map +1 -1
  10. package/dist/defaults/index.d.ts +28 -28
  11. package/dist/defaults/index.js +1636 -845
  12. package/dist/defaults/index.js.map +1 -1
  13. package/dist/execution/index.d.ts +16 -16
  14. package/dist/execution/index.js +218 -49
  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 +7 -7
  18. package/dist/extension/index.js.map +1 -1
  19. package/dist/{global-mailbox-CXkugtNQ.d.ts → global-mailbox-Iqfkgmwu.d.ts} +3 -3
  20. package/dist/{goal-store-DUwdbdoY.d.ts → goal-store-DGb6b5Ed.d.ts} +1 -1
  21. package/dist/hq/index.d.ts +6 -6
  22. package/dist/hq/index.js +178 -75
  23. package/dist/hq/index.js.map +1 -1
  24. package/dist/{index-CtlizLTK.d.ts → index-Cn0NOshr.d.ts} +10 -5
  25. package/dist/{index-neOCEy6q.d.ts → index-L4RZN9jJ.d.ts} +2 -2
  26. package/dist/index.d.ts +56 -48
  27. package/dist/index.js +2789 -1546
  28. package/dist/index.js.map +1 -1
  29. package/dist/infrastructure/index.d.ts +6 -6
  30. package/dist/infrastructure/index.js +26 -7
  31. package/dist/infrastructure/index.js.map +1 -1
  32. package/dist/kernel/index.d.ts +20 -12
  33. package/dist/kernel/index.js +55 -9
  34. package/dist/kernel/index.js.map +1 -1
  35. package/dist/{mailbox-types-_7gaY0Rl.d.ts → mailbox-types-DTl7bRH3.d.ts} +3 -1
  36. package/dist/{mcp-servers-MLL6bMlv.d.ts → mcp-servers-CuZGf9fI.d.ts} +4 -4
  37. package/dist/models/index.d.ts +5 -5
  38. package/dist/models/index.js +223 -139
  39. package/dist/models/index.js.map +1 -1
  40. package/dist/{models-registry-CrkcxQ-g.d.ts → models-registry-8XOdxWQu.d.ts} +16 -1
  41. package/dist/{multi-agent-coordinator-Dc_HuG9p.d.ts → multi-agent-coordinator-CiRtKVTk.d.ts} +8 -1
  42. package/dist/{null-fleet-bus-BMZwMin7.d.ts → null-fleet-bus-d9G-bVy9.d.ts} +26 -22
  43. package/dist/observability/index.d.ts +2 -2
  44. package/dist/{path-resolver-uVK4BatM.d.ts → path-resolver-BhIb6mtd.d.ts} +8 -3
  45. package/dist/{permission-CJR1qfOi.d.ts → permission-BCbQDR2s.d.ts} +1 -1
  46. package/dist/{permission-policy-DLVKKk4w.d.ts → permission-policy-C0ikndX_.d.ts} +2 -18
  47. package/dist/{pipeline-BYR-Vdau.d.ts → pipeline-Dl6XbfE7.d.ts} +10 -6
  48. package/dist/{provider-model-resolve-iREK_1lG.d.ts → provider-model-resolve-B70epO19.d.ts} +3 -3
  49. package/dist/{provider-runner-i7SQXZuC.d.ts → provider-runner-DZ808MSM.d.ts} +3 -3
  50. package/dist/{retry-policy-BmY5ooh3.d.ts → retry-policy-Dt3_z8Aj.d.ts} +1 -1
  51. package/dist/sdd/index.d.ts +19 -10
  52. package/dist/sdd/index.js +411 -240
  53. package/dist/sdd/index.js.map +1 -1
  54. package/dist/{secret-vault-C9leEMzr.d.ts → secret-vault-BUJ2d1gB.d.ts} +1 -1
  55. package/dist/security/index.d.ts +5 -5
  56. package/dist/security/index.js +30 -6
  57. package/dist/security/index.js.map +1 -1
  58. package/dist/{selector-qjpee9BF.d.ts → selector-BCkWgdwy.d.ts} +1 -1
  59. package/dist/{session-event-bridge-m7y--I-H.d.ts → session-event-bridge-CMvIO59_.d.ts} +1 -1
  60. package/dist/{session-reader-BjLH4V9n.d.ts → session-reader-C8aiChUu.d.ts} +1 -1
  61. package/dist/skills/index.js +1 -0
  62. package/dist/skills/index.js.map +1 -1
  63. package/dist/storage/index.d.ts +68 -30
  64. package/dist/storage/index.js +839 -528
  65. package/dist/storage/index.js.map +1 -1
  66. package/dist/{strategy-compactor-C2bmlWYg.d.ts → strategy-compactor-DI1OHVbB.d.ts} +10 -10
  67. package/dist/{todos-checkpoint-oDS9IBNS.d.ts → todos-checkpoint-Ddd2CGr0.d.ts} +56 -9
  68. package/dist/{tool-executor-D4YdaJ-M.d.ts → tool-executor-Bmd5Ygoo.d.ts} +45 -10
  69. package/dist/tools/index.d.ts +2 -2
  70. package/dist/tools/index.js.map +1 -1
  71. package/dist/types/index.d.ts +20 -20
  72. package/dist/types/index.js +331 -98
  73. package/dist/types/index.js.map +1 -1
  74. package/dist/utils/index.d.ts +16 -3
  75. package/dist/utils/index.js +159 -83
  76. package/dist/utils/index.js.map +1 -1
  77. package/dist/{worktree-manager-A1Efnvs0.d.ts → worktree-manager-DBdl_5rs.d.ts} +4 -1
  78. package/instructions/agents/shadow-agent.md +3 -3
  79. package/instructions/coordination/director-preamble.md +3 -3
  80. package/instructions/modes/research-web.md +4 -4
  81. package/package.json +1 -1
  82. package/skills/research-web/SKILL.md +26 -26
  83. package/skills/research-web/SKILL.save.md +1 -1
@@ -196,6 +196,7 @@ declare const ERROR_CODES: {
196
196
  readonly SDD_INVALID_STATE: "SDD_INVALID_STATE";
197
197
  readonly SDD_NOT_READY: "SDD_NOT_READY";
198
198
  readonly VALIDATION_ERROR: "VALIDATION_ERROR";
199
+ readonly PARSE_FAILED: "PARSE_FAILED";
199
200
  readonly UNKNOWN: "UNKNOWN";
200
201
  };
201
202
  /**
@@ -370,6 +371,34 @@ declare class ToolValidationError extends WrongStackError {
370
371
  cause?: unknown | undefined;
371
372
  });
372
373
  }
374
+ /**
375
+ * Response / payload parse error — thrown when an upstream HTTP response,
376
+ * file, or data structure is well-formed at the transport layer (HTTP 200,
377
+ * valid JSON) but is missing required fields or has an unexpected shape.
378
+ *
379
+ * Distinct from `ConfigError(CONFIG_PARSE_FAILED)` (which is specifically
380
+ * for config-file parsing) and `FetchError` (which covers HTTP non-OK
381
+ * responses). `ParseError` fills the gap: the request succeeded but the
382
+ * response body couldn't be interpreted.
383
+ *
384
+ * Common sites: OAuth token responses missing `access_token`, device-code
385
+ * responses missing `device_code`, registry responses with unexpected
386
+ * schemas.
387
+ */
388
+ declare class ParseError extends WrongStackError {
389
+ readonly source?: string | undefined;
390
+ constructor(opts: {
391
+ message: string;
392
+ /**
393
+ * What was being parsed — e.g. `'oauth-token-response'`,
394
+ * `'device-code-response'`. Lets consumers distinguish parse failures
395
+ * from different upstream APIs without parsing the message.
396
+ */
397
+ source?: string | undefined;
398
+ context?: Record<string, unknown> | undefined;
399
+ cause?: unknown | undefined;
400
+ });
401
+ }
373
402
  declare function isWrongStackError(err: unknown): err is WrongStackError;
374
403
  declare function isToolError(err: unknown): err is ToolError;
375
404
  declare function isConfigError(err: unknown): err is ConfigError;
@@ -379,6 +408,7 @@ declare function isAgentError(err: unknown): err is AgentError;
379
408
  declare function isFsError(err: unknown): err is FsError;
380
409
  declare function isToolValidationError(err: unknown): err is ToolValidationError;
381
410
  declare function isFetchError(err: unknown): err is FetchError;
411
+ declare function isParseError(err: unknown): err is ParseError;
382
412
  declare function isSddError(err: unknown): err is SddError;
383
413
 
384
414
  type Permission = 'auto' | 'confirm' | 'deny';
@@ -1001,7 +1031,7 @@ interface SessionMetadata {
1001
1031
  * hard crashes; `DefaultSessionStore.load()` silently skips bad lines.
1002
1032
  *
1003
1033
  * ## Location (source of truth: resolveWstackPaths)
1004
- * ~/.wrongstack/projects/<sha256(projectRoot).slice(0,12)>/sessions/<id>.jsonl
1034
+ * ~/.wrongstack/projects/<sha256(projectRoot).slice(0,12)>/sessions/<date>/sess_<ULID>.jsonl
1005
1035
  *
1006
1036
  * The only files that live inside the project tree are the committed
1007
1037
  * `.wrongstack/AGENTS.md` and `.wrongstack/skills/`.
@@ -1525,6 +1555,8 @@ interface CacheStats {
1525
1555
  }
1526
1556
  interface TokenCounter {
1527
1557
  account(usage: Usage, model?: string): void | undefined;
1558
+ /** Optional live session binding used by token.accounted events. */
1559
+ setSessionId?(sessionId: string | (() => string | undefined) | undefined): void;
1528
1560
  /**
1529
1561
  * Tokens from the most recently-accounted request (input + cacheRead).
1530
1562
  * Use this for per-request context pressure tracking (e.g. status bar
@@ -1536,6 +1568,12 @@ interface TokenCounter {
1536
1568
  input: number;
1537
1569
  cacheRead: number;
1538
1570
  };
1571
+ /**
1572
+ * Override the last-request token snapshot. Used by slash commands like
1573
+ * /compact that modify ctx.messages without making an API request —
1574
+ * after calling this, the TUI/REPL context bar reflects the new size.
1575
+ */
1576
+ setCurrentRequestTokens(input: number, cacheRead?: number): void;
1539
1577
  total(): Usage;
1540
1578
  estimateCost(): {
1541
1579
  input: number;
@@ -1917,4 +1955,4 @@ declare class Context implements RunEnv {
1917
1955
  usage(): Usage;
1918
1956
  }
1919
1957
 
1920
- export { type RequestCacheControl as $, AgentError as A, type ContextEvidenceState as B, Context as C, type ContextFileEvidence as D, type ContextInit as E, type ContextIntentEvidence as F, type ContextRepeatedReadEvidence as G, ERROR_CODES as H, type ErrorCode as I, type JSONSchema as J, type ErrorSeverity as K, type ErrorSubsystem as L, type Message as M, FetchError as N, type FileSnapshot as O, type Provider as P, FsError as Q, type ReasoningRequest as R, type SessionEvent as S, type Tool as T, type Usage as U, type ImageBlock as V, type JsonSchemaSpec as W, type MessageRole as X, PluginError as Y, type ProviderErrorBody as Z, type ReadonlyConversationState as _, type ReasoningConfig as a, type ResponseFormat as a0, type RiskTier as a1, type RunEnv as a2, type SafetySetting as a3, SddError as a4, SessionError as a5, type SideEffect as a6, type SideEffectRisk as a7, type StateChange as a8, type StateChangeHandler as a9, isThinkingBlock as aA, isToolError as aB, isToolResultBlock as aC, isToolUseBlock as aD, isToolValidationError as aE, isWrongStackError as aF, toWrongStackError as aG, wrapAsState as aH, type StopReason as aa, type StreamEvent as ab, StreamHangError as ac, type ThinkingBlock as ad, type ToolCallContext as ae, ToolError as af, ToolErrorCategory as ag, type ToolErrorInfo as ah, type ToolEvidenceStatus as ai, type ToolFinalEvent as aj, type ToolIconId as ak, type ToolStreamEvent as al, ToolValidationError as am, WrongStackError as an, asBlocks as ao, asText as ap, extractRunEnv as aq, isAgentError as ar, isConfigError as as, isFetchError as at, isFsError as au, isImageBlock as av, isPluginError as aw, isSddError as ax, isSessionError as ay, isTextBlock as az, type SessionWriter as b, type Request as c, type Response as d, type TokenCounter as e, type CacheStats as f, ProviderError as g, type Permission as h, type ContentBlock as i, type SessionMetadata as j, type SessionStore as k, type ToolProgressEvent as l, type ToolOutputMetadata as m, type Capabilities as n, type ReasoningEffort as o, type CacheTtl as p, type TextBlock as q, type ToolUseBlock as r, type ToolResultBlock as s, type RunOptions as t, ConversationState as u, type ResumedSession as v, type SessionData as w, type SessionSummary as x, type TodoItem as y, ConfigError as z };
1958
+ export { type ProviderErrorBody as $, AgentError as A, ConfigError as B, Context as C, type ContextEvidenceState as D, type ContextFileEvidence as E, type ContextInit as F, type ContextIntentEvidence as G, type ContextRepeatedReadEvidence as H, ERROR_CODES as I, type JSONSchema as J, type ErrorCode as K, type ErrorSeverity as L, type Message as M, type ErrorSubsystem as N, FetchError as O, type Provider as P, type FileSnapshot as Q, type ReasoningRequest as R, type SessionEvent as S, type Tool as T, type Usage as U, FsError as V, type ImageBlock as W, type JsonSchemaSpec as X, type MessageRole as Y, ParseError as Z, PluginError as _, type ReasoningConfig as a, type ReadonlyConversationState as a0, type RequestCacheControl as a1, type ResponseFormat as a2, type RiskTier as a3, type RunEnv as a4, type SafetySetting as a5, SddError as a6, SessionError as a7, type SideEffect as a8, type SideEffectRisk as a9, isSessionError as aA, isTextBlock as aB, isThinkingBlock as aC, isToolError as aD, isToolResultBlock as aE, isToolUseBlock as aF, isToolValidationError as aG, isWrongStackError as aH, toWrongStackError as aI, wrapAsState as aJ, type StateChange as aa, type StateChangeHandler as ab, type StopReason as ac, type StreamEvent as ad, StreamHangError as ae, type ThinkingBlock as af, type ToolCallContext as ag, ToolError as ah, type ToolErrorInfo as ai, type ToolEvidenceStatus as aj, type ToolFinalEvent as ak, type ToolIconId as al, type ToolStreamEvent as am, ToolValidationError as an, WrongStackError as ao, asBlocks as ap, asText as aq, extractRunEnv as ar, isAgentError as as, isConfigError as at, isFetchError as au, isFsError as av, isImageBlock as aw, isParseError as ax, isPluginError as ay, isSddError as az, type SessionWriter as b, type Request as c, type Response as d, type TokenCounter as e, type CacheStats as f, ProviderError as g, type Permission as h, type ContentBlock as i, type SessionMetadata as j, type SessionStore as k, ToolErrorCategory as l, type ToolProgressEvent as m, type ToolOutputMetadata as n, type Capabilities as o, type ReasoningEffort as p, type CacheTtl as q, type TextBlock as r, type ToolUseBlock as s, type ToolResultBlock as t, type RunOptions as u, ConversationState as v, type ResumedSession as w, type SessionData as x, type SessionSummary as y, type TodoItem as z };
@@ -1,26 +1,26 @@
1
- import { E as EventBus, B as BrainArbiter, f as BrainDecisionOption, k as BrainRisk, h as BrainDecisionRequest, e as BrainDecision, i as BrainDecisionSource } from '../brain-DCkB5_e7.js';
2
- export { g as BrainDecisionQueue, j as BrainFallback, D as DefaultBrainArbiter, l as DefaultBrainArbiterOptions, H as HumanEscalatingBrainArbiter, O as ObservableBrainArbiter, w as formatHumanPrompt } from '../brain-DCkB5_e7.js';
3
- import { H as FleetManager, s as Director } from '../null-fleet-bus-BMZwMin7.js';
4
- export { A as ACP_AGENTS, a as AGENTS_BY_PHASE, b as AGENT_CATALOG, c as ALL_AGENT_DEFINITIONS, d as ALL_FLEET_AGENTS, e as AUDIT_LOG_AGENT, f as AutoExtendCeiling, g as AutoExtendPolicy, B as BUG_HUNTER_AGENT, h as BugFinding, C as CollabBudgetConfig, i as CollabBudgetOverrides, j as CollabBudgetWarningPayload, k as CollabDebugReport, l as CollabSession, m as CollabSessionOptions, n as CreateDelegateToolOptions, o as CriticConcern, p as CriticEvaluation, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, t as DirectorAlert, u as DirectorAlertLevel, v as DirectorCancelCollabPayload, w as DirectorPromptParts, x as DirectorSessionFactory, y as DirectorSessionFactoryOptions, F as FLEET_ROSTER, z as FLEET_ROSTER_BUDGETS, E as FLEET_ROSTER_WITHACP, G as FleetCostCapError, I as FleetManagerOptions, J as FleetRosterBudget, K as FleetSpawnBudgetError, L as ICoordinator, M as IFleetManager, N as LargeAnswerStore, O as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, P as RefactorPhase, Q as RefactorPlan, S as SECURITY_SCANNER_AGENT, T as SharedFileEntry, U as SharedFileSnapshot, V as SubagentPromptParts, W as applyRosterBudget, X as attachAutoExtend, Y as composeDirectorPrompt, Z as composeSubagentPrompt, _ as createDelegateTool, $ as getAgentDefinition, a0 as makeAskResultTool, a1 as makeAskTool, a2 as makeAssignTool, a3 as makeAwaitTasksTool, a4 as makeCollabDebugTool, a5 as makeDirectorSessionFactory, a6 as makeFleetEmitTool, a7 as makeFleetHealthTool, a8 as makeFleetSessionTool, a9 as makeFleetStatusTool, aa as makeFleetUsageTool, ab as makeRollUpTool, ac as makeSpawnTool, ad as makeTerminateTool, ae as makeWorkCompleteTool, af as rosterSummaryFromConfigs } from '../null-fleet-bus-BMZwMin7.js';
5
- import { b as AgentDefinition } from '../multi-agent-coordinator-Dc_HuG9p.js';
6
- export { T as AGENT_TOOL_PRESETS, c as AgentBudgetTier, d as AgentCapability, A as AgentPhase, e as DEFAULT_DISPATCH_ROLE, a as DefaultMultiAgentCoordinator, f as DispatchCandidate, D as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, H as HEAVY_BUDGET, L as LIGHT_BUDGET, M as MEDIUM_BUDGET, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from '../multi-agent-coordinator-Dc_HuG9p.js';
7
- import { F as FleetBus } from '../agent-subagent-runner-CArSFKFl.js';
8
- export { h as AgentFactory, v as AgentFactoryResult, w as AgentRunnerOptions, x as BudgetExceededError, y as BudgetKind, z as BudgetLimits, E as BudgetNegotiationMode, G as BudgetThresholdDecision, H as BudgetThresholdHandler, I as BudgetThresholdSignal, J as BudgetUsage, L as DECISION_TIMEOUT_MS, N as FleetEvent, O as FleetHandler, i as FleetUsage, j as FleetUsageAggregator, Q as SubagentBudget, Y as SubagentUsageSnapshot, Z as TIMEOUT_PREEMPT_FRACTION, $ as makeAgentSubagentRunner, a0 as withDisabledToolFiltering } from '../agent-subagent-runner-CArSFKFl.js';
9
- export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-D9JkPvJ0.js';
10
- import { b as Mailbox, c as MailboxSendInput, M as MailboxMessage, d as MailboxQuery, e as MailboxAckInput, f as MailboxAckBatchInput, a as MailboxAgentStatus, A as AgentRegistrationInput, g as AgentHeartbeatInput, P as PurgeOptions, j as PurgeResult, C as ClientRegistrationInput, h as ClientHeartbeatInput, i as ClientStatus } from '../mailbox-types-_7gaY0Rl.js';
11
- export { k as ClientSource, l as MailboxMessageType, m as MailboxTaskContext, R as ReadReceipts, n as RegisteredAgent, o as normalizeRecipient } from '../mailbox-types-_7gaY0Rl.js';
12
- import { G as GlobalMailbox } from '../global-mailbox-CXkugtNQ.js';
13
- export { aw as resolveProjectDir } from '../global-mailbox-CXkugtNQ.js';
14
- import { C as Context, T as Tool } from '../context-BrLe8pJy.js';
15
- import { A as AdaptiveConcurrencyConfig } from '../config-BzFRKkg7.js';
1
+ import { E as EventBus, B as BrainArbiter, f as BrainDecisionOption, k as BrainRisk, h as BrainDecisionRequest, e as BrainDecision, i as BrainDecisionSource } from '../brain-BLOyN5ZP.js';
2
+ export { g as BrainDecisionQueue, j as BrainFallback, D as DefaultBrainArbiter, l as DefaultBrainArbiterOptions, H as HumanEscalatingBrainArbiter, O as ObservableBrainArbiter, w as formatHumanPrompt } from '../brain-BLOyN5ZP.js';
3
+ import { H as FleetManager, s as Director } from '../null-fleet-bus-d9G-bVy9.js';
4
+ export { A as ACP_AGENTS, a as AGENTS_BY_PHASE, b as AGENT_CATALOG, c as ALL_AGENT_DEFINITIONS, d as ALL_FLEET_AGENTS, e as AUDIT_LOG_AGENT, f as AutoExtendCeiling, g as AutoExtendPolicy, B as BUG_HUNTER_AGENT, h as BugFinding, C as CollabBudgetConfig, i as CollabBudgetOverrides, j as CollabBudgetWarningPayload, k as CollabDebugReport, l as CollabSession, m as CollabSessionOptions, n as CreateDelegateToolOptions, o as CriticConcern, p as CriticEvaluation, D as DEFAULT_DIRECTOR_PREAMBLE, q as DEFAULT_SUBAGENT_BASELINE, r as DelegateHost, t as DirectorAlert, u as DirectorAlertLevel, v as DirectorCancelCollabPayload, w as DirectorPromptParts, x as DirectorSessionFactory, y as DirectorSessionFactoryOptions, F as FLEET_ROSTER, z as FLEET_ROSTER_BUDGETS, E as FLEET_ROSTER_WITHACP, G as FleetCostCapError, I as FleetManagerOptions, J as FleetRosterBudget, K as FleetSpawnBudgetError, L as ICoordinator, M as IFleetManager, N as LargeAnswerStore, O as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, P as RefactorPhase, Q as RefactorPlan, S as SECURITY_SCANNER_AGENT, T as SharedFileEntry, U as SharedFileSnapshot, V as SubagentPromptParts, W as applyRosterBudget, X as attachAutoExtend, Y as composeDirectorPrompt, Z as composeSubagentPrompt, _ as createDelegateTool, $ as getAgentDefinition, a0 as makeAskResultTool, a1 as makeAskTool, a2 as makeAssignTool, a3 as makeAwaitTasksTool, a4 as makeCollabDebugTool, a5 as makeDirectorSessionFactory, a6 as makeFleetEmitTool, a7 as makeFleetHealthTool, a7 as makeFleetSessionTool, a7 as makeFleetStatusTool, a7 as makeFleetTool, a7 as makeFleetUsageTool, a8 as makeRollUpTool, a9 as makeSpawnTool, aa as makeTerminateAllTool, ab as makeTerminateTool, ac as makeWorkCompleteTool, ad as rosterSummaryFromConfigs } from '../null-fleet-bus-d9G-bVy9.js';
5
+ import { b as AgentDefinition } from '../multi-agent-coordinator-CiRtKVTk.js';
6
+ export { T as AGENT_TOOL_PRESETS, c as AgentBudgetTier, d as AgentCapability, A as AgentPhase, e as DEFAULT_DISPATCH_ROLE, a as DefaultMultiAgentCoordinator, f as DispatchCandidate, D as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, H as HEAVY_BUDGET, L as LIGHT_BUDGET, M as MEDIUM_BUDGET, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from '../multi-agent-coordinator-CiRtKVTk.js';
7
+ import { F as FleetBus } from '../agent-subagent-runner-CEuw4ATz.js';
8
+ export { i as AgentFactory, w as AgentFactoryResult, x as AgentRunnerOptions, y as BudgetExceededError, z as BudgetKind, E as BudgetLimits, G as BudgetNegotiationMode, H as BudgetThresholdDecision, I as BudgetThresholdHandler, J as BudgetThresholdSignal, K as BudgetUsage, N as DECISION_TIMEOUT_MS, O as FleetEvent, Q as FleetHandler, j as FleetUsage, k as FleetUsageAggregator, R as SubagentBudget, Z as SubagentUsageSnapshot, _ as TIMEOUT_PREEMPT_FRACTION, a0 as makeAgentSubagentRunner, a1 as withDisabledToolFiltering } from '../agent-subagent-runner-CEuw4ATz.js';
9
+ export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from '../agent-bridge-D7A-eu3C.js';
10
+ import { b as Mailbox, c as MailboxSendInput, M as MailboxMessage, d as MailboxQuery, e as MailboxAckInput, f as MailboxAckBatchInput, a as MailboxAgentStatus, A as AgentRegistrationInput, g as AgentHeartbeatInput, P as PurgeOptions, j as PurgeResult, C as ClientRegistrationInput, h as ClientHeartbeatInput, i as ClientStatus } from '../mailbox-types-DTl7bRH3.js';
11
+ export { k as ClientSource, l as MailboxMessageType, m as MailboxTaskContext, R as ReadReceipts, n as RegisteredAgent, o as normalizeRecipient } from '../mailbox-types-DTl7bRH3.js';
12
+ import { G as GlobalMailbox } from '../global-mailbox-Iqfkgmwu.js';
13
+ export { aw as resolveProjectDir } from '../global-mailbox-Iqfkgmwu.js';
14
+ import { C as Context, T as Tool } from '../context-CLnUMW5g.js';
15
+ import { A as AdaptiveConcurrencyConfig } from '../config-Bf5mj-ad.js';
16
16
  import 'node:events';
17
17
  import '../logger-B63L5bTg.js';
18
18
  import '../director-state-BfeCUbmk.js';
19
- import '../index-CtlizLTK.js';
20
- import '../pipeline-BYR-Vdau.js';
19
+ import '../index-Cn0NOshr.js';
20
+ import '../pipeline-Dl6XbfE7.js';
21
21
  import '../observability-D-HZN_mF.js';
22
- import '../permission-CJR1qfOi.js';
23
- import '../retry-policy-BmY5ooh3.js';
22
+ import '../permission-BCbQDR2s.js';
23
+ import '../retry-policy-Dt3_z8Aj.js';
24
24
 
25
25
  /** Phase 1 · Discovery — map the territory before any work begins. */
26
26
  declare const DISCOVERY_AGENTS: AgentDefinition[];
@@ -153,6 +153,8 @@ interface BrainInterventionInput {
153
153
  interface BrainMonitorOptions {
154
154
  events: EventBus;
155
155
  brain: BrainArbiter;
156
+ /** Active host session id, read lazily so resume/new-session switches are reflected. */
157
+ sessionId?: (() => string | undefined) | undefined;
156
158
  /**
157
159
  * Deliver a corrective steer to the working agent(s). Hosts typically
158
160
  * send a `steer` mail to this session's leader via the project
@@ -499,7 +501,7 @@ interface MailboxToolOptions {
499
501
  }
500
502
  /**
501
503
  * Compact, deterministic tag for a session id — 8 hex chars of its sha256.
502
- * Session ids are date-sharded paths ("2026-06-11/10-48-34Z_model_e66c");
504
+ * Session ids are date-sharded paths ("2026-06-11/sess_<ULID>");
503
505
  * the tag keeps mailbox identities short, filesystem-safe, and stable for
504
506
  * the lifetime of the session (including across process restarts/resumes).
505
507
  */
@@ -532,10 +534,12 @@ declare function makeMailboxTool(opts?: MailboxToolOptions): Tool;
532
534
  /**
533
535
  * mail-tools — thin, high-affordance wrappers over the project mailbox.
534
536
  *
535
- * The multi-action `mailbox` tool is the power surface; these two exist
536
- * because explicit verbs ("send a mail", "read my inbox") are what makes
537
- * agents USE the mailbox autonomously a model reaches for `mail_send`
538
- * mid-task far more readily than for `mailbox action=send ...`.
537
+ * These are the PREFERRED mailbox tools for agents. The multi-action `mailbox`
538
+ * tool is the low-level power surface for advanced queries and agent status;
539
+ * `mail_send` and `mail_inbox` exist because explicit verbs ("send a mail",
540
+ * "read my inbox") are what makes agents USE the mailbox autonomously — a model
541
+ * reaches for `mail_send` mid-task far more readily than for
542
+ * `mailbox action=send ...`.
539
543
  *
540
544
  * mail_send — message one agent (`to: "leader@a1b2c3d4"`), every leader
541
545
  * (`to: "leader"`), or everyone (`to: "*"`)
@@ -1038,6 +1042,18 @@ declare class KnowledgeGraph {
1038
1042
  private readonly pendingDeliveries;
1039
1043
  private readonly filePath;
1040
1044
  private readonly graphFilePath;
1045
+ /**
1046
+ * Stable per-node insertion sequence. `nodes` (a Map) preserves insertion
1047
+ * order even across `update()` (Map.set on an existing key keeps its slot),
1048
+ * but the type index's `Set<string>` does NOT — `update()` removes then
1049
+ * re-adds a node's id, moving it to the set's tail. Index-routed queries sort
1050
+ * by this sequence so they return nodes in creation order, matching the old
1051
+ * `nodes.values()` scan that callers like decision-history `slice(-10)` rely on.
1052
+ */
1053
+ private readonly seq;
1054
+ private seqCounter;
1055
+ /** Assign a stable insertion sequence the first time a node id is seen. */
1056
+ private _trackSeq;
1041
1057
  /** Exposed for unit-testing only: read current index contents. */
1042
1058
  getIndex(): ReadonlyMap<string, ReadonlySet<string>>;
1043
1059
  constructor(sessionDir: string);
@@ -2054,6 +2070,8 @@ interface AgentVirtualSession {
2054
2070
  transcript: AgentTimelineEntry[];
2055
2071
  }
2056
2072
  interface AgentMonitorOptions {
2073
+ /** Parent/host session id for emitted agent timeline/status events. */
2074
+ sessionId?: string | undefined;
2057
2075
  /** The FleetBus to listen on for subagent events. Optional — set via `setFleetBus()` before `start()`. */
2058
2076
  fleetBus?: FleetBus | undefined;
2059
2077
  /** Local EventBus for emitting agent.timeline.* and agent.status_changed events. */
@@ -2070,6 +2088,7 @@ interface AgentMonitorOptions {
2070
2088
  declare class AgentMonitorService {
2071
2089
  private _fleetBus;
2072
2090
  private readonly _events;
2091
+ private readonly _sessionId;
2073
2092
  private readonly _transcriptsDir;
2074
2093
  private readonly _maxEntries;
2075
2094
  private _streamEnabled;