@wrongstack/core 0.148.0 → 0.236.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 (82) hide show
  1. package/dist/{agent-bridge-r9y6gdn4.d.ts → agent-bridge-Cimv7bK7.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-1GeQE_L0.d.ts → agent-subagent-runner-C658wj_c.d.ts} +9 -8
  3. package/dist/{brain-Cp_3GIS2.d.ts → brain-sCZ3lCjq.d.ts} +28 -2
  4. package/dist/{compactor-BueGt7LG.d.ts → compactor-BRfg3QPd.d.ts} +1 -1
  5. package/dist/{config-BaVThgnT.d.ts → config-Koq6f3fs.d.ts} +2 -2
  6. package/dist/{context-C7G_MtLV.d.ts → context-CLz3z_E8.d.ts} +126 -2
  7. package/dist/coordination/index.d.ts +70 -13
  8. package/dist/coordination/index.js +2126 -151
  9. package/dist/coordination/index.js.map +1 -1
  10. package/dist/defaults/index.d.ts +27 -27
  11. package/dist/defaults/index.js +1328 -354
  12. package/dist/defaults/index.js.map +1 -1
  13. package/dist/execution/index.d.ts +45 -16
  14. package/dist/execution/index.js +367 -59
  15. package/dist/execution/index.js.map +1 -1
  16. package/dist/execution/prompt-enhancer.d.ts +86 -0
  17. package/dist/execution/prompt-enhancer.js +125 -0
  18. package/dist/execution/prompt-enhancer.js.map +1 -0
  19. package/dist/extension/index.d.ts +6 -6
  20. package/dist/extension/index.js +3 -1
  21. package/dist/extension/index.js.map +1 -1
  22. package/dist/{goal-preamble-CYJLg0wk.d.ts → goal-preamble-CnbzyVvl.d.ts} +19 -10
  23. package/dist/{index-BZdezm3g.d.ts → index-BlMqh5GO.d.ts} +8 -8
  24. package/dist/{index-CPweVoFM.d.ts → index-C2eSNPsB.d.ts} +7 -5
  25. package/dist/index.d.ts +439 -129
  26. package/dist/index.js +5206 -905
  27. package/dist/index.js.map +1 -1
  28. package/dist/infrastructure/index.d.ts +7 -7
  29. package/dist/infrastructure/index.js +72 -15
  30. package/dist/infrastructure/index.js.map +1 -1
  31. package/dist/kernel/index.d.ts +9 -9
  32. package/dist/kernel/index.js +7 -1
  33. package/dist/kernel/index.js.map +1 -1
  34. package/dist/{llm-selector-CP72f1lC.d.ts → llm-selector-D22R4AFz.d.ts} +2 -2
  35. package/dist/logger-DmmQhf4P.d.ts +65 -0
  36. package/dist/{mcp-servers-Bl5LTvQg.d.ts → mcp-servers-DFbirBv6.d.ts} +11 -4
  37. package/dist/models/index.d.ts +5 -5
  38. package/dist/models/index.js +89 -9
  39. package/dist/models/index.js.map +1 -1
  40. package/dist/{models-registry-D90K9UnM.d.ts → models-registry-CnJRjTXc.d.ts} +1 -1
  41. package/dist/{multi-agent-coordinator-QWEzJDlm.d.ts → multi-agent-coordinator-60weDZoA.d.ts} +8 -8
  42. package/dist/{null-fleet-bus-BUyfqh23.d.ts → null-fleet-bus-1068dEnr.d.ts} +7 -7
  43. package/dist/observability/index.d.ts +2 -2
  44. package/dist/package-outdated-watcher-pzJ5w7y8.d.ts +560 -0
  45. package/dist/{parallel-eternal-engine-C75QuhAI.d.ts → parallel-eternal-engine-DtG1fjc9.d.ts} +13 -9
  46. package/dist/{path-resolver-DRjQBkoO.d.ts → path-resolver-CA1ULU0J.d.ts} +3 -3
  47. package/dist/{permission-B7nKnEvQ.d.ts → permission-DbWPbuoA.d.ts} +1 -1
  48. package/dist/{permission-policy-8-6zBmfA.d.ts → permission-policy-AOk0LVsV.d.ts} +2 -2
  49. package/dist/pipeline-DsmlwTXu.d.ts +493 -0
  50. package/dist/{plan-templates-CkKNPU3I.d.ts → plan-templates-DPABrDvy.d.ts} +19 -8
  51. package/dist/{provider-runner-BNpuIyOL.d.ts → provider-runner-D0HgUqwV.d.ts} +3 -3
  52. package/dist/{retry-policy-rutAfVeR.d.ts → retry-policy-BVnkbMET.d.ts} +1 -1
  53. package/dist/sdd/index.d.ts +8 -8
  54. package/dist/sdd/index.js +358 -85
  55. package/dist/sdd/index.js.map +1 -1
  56. package/dist/{secret-vault-DoISxaKO.d.ts → secret-vault-BJDY28ev.d.ts} +7 -1
  57. package/dist/{secret-vault-BTcC_T5v.d.ts → secret-vault-CeVNiy_f.d.ts} +4 -3
  58. package/dist/security/index.d.ts +6 -5
  59. package/dist/security/index.js +214 -35
  60. package/dist/security/index.js.map +1 -1
  61. package/dist/{selector-4vDFZKt3.d.ts → selector-Cb4_9-hf.d.ts} +1 -1
  62. package/dist/{session-event-bridge-DWlvglC2.d.ts → session-event-bridge-BhtkkFFy.d.ts} +4 -2
  63. package/dist/{session-reader-BAtCxdaw.d.ts → session-reader-CCOssnBS.d.ts} +1 -1
  64. package/dist/skills/index.js +171 -21
  65. package/dist/skills/index.js.map +1 -1
  66. package/dist/storage/index.d.ts +151 -13
  67. package/dist/storage/index.js +1117 -256
  68. package/dist/storage/index.js.map +1 -1
  69. package/dist/types/index.d.ts +68 -21
  70. package/dist/types/index.js +616 -74
  71. package/dist/types/index.js.map +1 -1
  72. package/dist/utils/expect-defined.js +3 -1
  73. package/dist/utils/expect-defined.js.map +1 -1
  74. package/dist/utils/index.d.ts +80 -4
  75. package/dist/utils/index.js +100 -15
  76. package/dist/utils/index.js.map +1 -1
  77. package/dist/{wstack-paths-DD50Omgn.d.ts → wstack-paths-CJjEwPXn.d.ts} +14 -1
  78. package/package.json +7 -3
  79. package/skills/chimera/SKILL.md +105 -0
  80. package/skills/research-web/SKILL.md +342 -0
  81. package/dist/logger-B9J5puGM.d.ts +0 -32
  82. package/dist/pipeline-BG7UgbDc.d.ts +0 -239
@@ -1,20 +1,20 @@
1
- import { M as MemoryBackend, j as FileMemoryBackendOptions } from '../plan-templates-CkKNPU3I.js';
2
- export { A as AbandonedSession, a as AttachmentStoreOptions, C as ConfigLoaderOptions, b as ConfigMigration, c as ConfigMigrationError, d as ConfigSource, D as DEFAULT_CONFIG_MIGRATIONS, e as DefaultAttachmentStore, f as DefaultConfigLoader, g as DefaultConfigStore, h as DefaultMemoryStore, i as DefaultSessionStore, F as FileMemoryBackend, k as MemoryStoreOptions, l as MigrationContext, m as MigrationResult, P as PersistedQueueItem, n as PlanFile, o as PlanItem, p as PlanTemplate, Q as QueueStore, R as RecoveryLock, q as RecoveryLockOptions, S as SessionAnalyzer, r as SessionStoreOptions, T as TodosCheckpointFile, s as addPlanItem, t as attachPlanCheckpoint, u as attachTodosCheckpoint, v as clearPlan, w as deriveTodosFromPlanItem, x as emptyPlan, y as formatPlan, z as formatPlanTemplates, B as getPlanTemplate, E as listPlanTemplates, G as loadPlan, H as loadTodosCheckpoint, I as parseEntries, J as removePlanItem, K as runConfigMigrations, L as savePlan, N as saveTodosCheckpoint, O as setPlanItemStatus } from '../plan-templates-CkKNPU3I.js';
3
- import { M as MemoryScope, k as MemoryEntry, l as MemoryStore } from '../brain-Cp_3GIS2.js';
4
- import { l as AgentExtension, j as AfterRunHook } from '../index-CPweVoFM.js';
5
- import { P as Provider, R as Request, b as Response, S as SessionEvent } from '../context-C7G_MtLV.js';
6
- export { D as DefaultSessionReader, f as DefaultSessionReaderOptions, S as SessionReader } from '../session-reader-BAtCxdaw.js';
1
+ import { M as MemoryBackend, j as FileMemoryBackendOptions } from '../plan-templates-DPABrDvy.js';
2
+ export { A as AbandonedSession, a as AttachmentStoreOptions, C as ConfigLoaderOptions, b as ConfigMigration, c as ConfigMigrationError, d as ConfigSource, D as DEFAULT_CONFIG_MIGRATIONS, e as DefaultAttachmentStore, f as DefaultConfigLoader, g as DefaultConfigStore, h as DefaultMemoryStore, i as DefaultSessionStore, F as FileMemoryBackend, k as MemoryStoreOptions, l as MigrationContext, m as MigrationResult, P as PersistedQueueItem, n as PlanFile, o as PlanItem, p as PlanTemplate, Q as QueueStore, R as RecoveryLock, q as RecoveryLockOptions, S as SessionAnalyzer, r as SessionStoreOptions, T as TodosCheckpointFile, s as addPlanItem, t as attachPlanCheckpoint, u as attachTodosCheckpoint, v as clearPlan, w as deriveTodosFromPlanItem, x as emptyPlan, y as formatPlan, z as formatPlanTemplates, B as getPlanTemplate, E as listPlanTemplates, G as loadPlan, H as loadTodosCheckpoint, I as mutatePlan, J as parseEntries, K as removePlanItem, L as runConfigMigrations, N as savePlan, O as saveTodosCheckpoint, U as setPlanItemStatus } from '../plan-templates-DPABrDvy.js';
3
+ import { M as MemoryScope, k as MemoryEntry, l as MemoryStore, E as EventBus } from '../brain-sCZ3lCjq.js';
4
+ import { l as AgentExtension, j as AfterRunHook } from '../index-C2eSNPsB.js';
5
+ import { P as Provider, R as Request, b as Response, S as SessionEvent } from '../context-CLz3z_E8.js';
6
+ export { D as DefaultSessionReader, f as DefaultSessionReaderOptions, S as SessionReader } from '../session-reader-CCOssnBS.js';
7
7
  import { S as SessionRewinder, C as CheckpointInfo, a as RewindResultExtended } from '../session-rewinder-C9HnMkhP.js';
8
8
  import { T as TaskItem } from '../task-format-vGOIftmK.js';
9
9
  export { a as DirectorStateCheckpoint, D as DirectorStateSnapshot, b as DirectorSubagentState, c as DirectorTaskState, l as loadDirectorState } from '../director-state-BfeCUbmk.js';
10
10
  export { G as GoalFile, J as JournalEntry, M as MAX_JOURNAL_ENTRIES, a as MAX_PROGRESS_HISTORY, P as ProgressSnapshot, b as appendJournal, e as emptyGoal, f as formatGoal, g as goalFilePath, l as loadGoal, p as parseProgressFromText, r as recordProgress, s as saveGoal, c as setProgress, d as summarizeUsage } from '../goal-store-CV9Yz2X_.js';
11
- import { W as WstackPaths } from '../wstack-paths-DD50Omgn.js';
12
- import { B as SyncCategory, k as SyncConfig } from '../config-BaVThgnT.js';
13
- export { A as AuditLevel, C as CORE_RECONSTRUCT_EVENTS, a as STANDARD_AUDIT_EVENTS, S as SessionEventBridge, b as SessionEventBridgeOptions, c as SessionSamplingOptions, T as ToolProgressSamplingOptions, d as createSessionEventBridge, r as resolveAuditLevel, e as resolveSessionLoggingConfig } from '../session-event-bridge-DWlvglC2.js';
14
- import '../permission-B7nKnEvQ.js';
15
- import '../secret-vault-DoISxaKO.js';
11
+ import { W as WstackPaths } from '../wstack-paths-CJjEwPXn.js';
12
+ import { E as SyncCategory, k as SyncConfig } from '../config-Koq6f3fs.js';
13
+ export { A as AuditLevel, C as CORE_RECONSTRUCT_EVENTS, a as STANDARD_AUDIT_EVENTS, S as SessionEventBridge, b as SessionEventBridgeOptions, c as SessionSamplingOptions, T as ToolProgressSamplingOptions, d as createSessionEventBridge, r as resolveAuditLevel, e as resolveSessionLoggingConfig } from '../session-event-bridge-BhtkkFFy.js';
14
+ import '../permission-DbWPbuoA.js';
15
+ import '../secret-vault-BJDY28ev.js';
16
16
  import '../logger-B63L5bTg.js';
17
- import '../pipeline-BG7UgbDc.js';
17
+ import '../pipeline-DsmlwTXu.js';
18
18
  import '../observability-D-HZN_mF.js';
19
19
  import '../task-graph-u1q9Jkyk.js';
20
20
 
@@ -537,6 +537,129 @@ declare class ToolAuditLog {
537
537
  private enqueue;
538
538
  }
539
539
 
540
+ /** Live status of a single agent within a session. */
541
+ type AgentLiveStatus = 'idle' | 'running' | 'streaming' | 'waiting_user' | 'error';
542
+ interface AgentEntry {
543
+ /** Unique agent id (ULID or UUID). */
544
+ id: string;
545
+ /** Human-readable label (e.g. "leader", "bug-hunter #1"). */
546
+ name: string;
547
+ status: AgentLiveStatus;
548
+ /** Current tool name if running, undefined otherwise. */
549
+ currentTool?: string | undefined;
550
+ /** Iteration count so far. */
551
+ iterations: number;
552
+ /** Tool calls so far. */
553
+ toolCalls: number;
554
+ /** UTC ISO timestamp of last activity. */
555
+ lastActivityAt: string;
556
+ }
557
+ type SessionLiveStatus = 'active' | 'idle' | 'closing' | 'stale';
558
+ interface SessionRegistryEntry {
559
+ sessionId: string;
560
+ projectSlug: string;
561
+ projectRoot: string;
562
+ projectName: string;
563
+ workingDir: string;
564
+ /** Current git branch, if the project is a git repo. Detected at registration. */
565
+ gitBranch?: string | undefined;
566
+ status: SessionLiveStatus;
567
+ pid: number;
568
+ /** UTC ISO */
569
+ startedAt: string;
570
+ /** UTC ISO — updated on every heartbeat */
571
+ lastHeartbeatAt: string;
572
+ /** Count of tracked agents */
573
+ agentCount: number;
574
+ agents: AgentEntry[];
575
+ }
576
+ declare class SessionRegistry {
577
+ private readonly filePath;
578
+ private heartbeatTimer;
579
+ private currentSessionId;
580
+ constructor(globalRoot: string);
581
+ /**
582
+ * Register the current session. Call once on session start.
583
+ * Starts the heartbeat timer.
584
+ */
585
+ register(entry: Omit<SessionRegistryEntry, 'status' | 'lastHeartbeatAt' | 'agentCount' | 'agents'> & {
586
+ agents?: AgentEntry[] | undefined;
587
+ }): Promise<void>;
588
+ /**
589
+ * Update agent status for the current session. Call on every
590
+ * significant status change (agent start, tool start, user wait, error).
591
+ */
592
+ updateAgents(agents: AgentEntry[]): Promise<void>;
593
+ /**
594
+ * Mark the session as closing. Called during shutdown.
595
+ * Stops the heartbeat timer.
596
+ */
597
+ markClosing(): Promise<void>;
598
+ /**
599
+ * Remove the current session from the registry. Call on clean exit.
600
+ */
601
+ unregister(): Promise<void>;
602
+ /**
603
+ * List all non-stale sessions. Prunes stale entries automatically.
604
+ */
605
+ list(): Promise<SessionRegistryEntry[]>;
606
+ /**
607
+ * Get a single session entry by ID. Returns undefined if not found or stale.
608
+ */
609
+ get(sessionId: string): Promise<SessionRegistryEntry | undefined>;
610
+ /**
611
+ * List all sessions for a specific project (by slug).
612
+ */
613
+ listByProject(projectSlug: string): Promise<SessionRegistryEntry[]>;
614
+ /**
615
+ * Return the registry file path. Useful for WebUI to watch/read.
616
+ */
617
+ get registryPath(): string;
618
+ private heartbeat;
619
+ private readAndPrune;
620
+ private atomicUpdate;
621
+ private writeAtomicLocked;
622
+ /** Legacy write without lock — used by heartbeat for performance. */
623
+ private writeAtomic;
624
+ }
625
+ declare function getSessionRegistry(globalRoot?: string): SessionRegistry;
626
+ declare function hasSessionRegistry(): boolean;
627
+
628
+ /**
629
+ * AgentStatusTracker — subscribes to EventBus events and keeps the
630
+ * SessionRegistry updated with live agent status.
631
+ *
632
+ * Created once per process during boot. Listens for:
633
+ * - agent.run.started / agent.run.completed → agent status changes
634
+ * - tool.started / tool.executed → current tool tracking
635
+ * - brain.ask_human → waiting_user status
636
+ * - fleet events (subagent spawn/start/done) → agent entries
637
+ *
638
+ * @module agent-status-tracker
639
+ */
640
+
641
+ interface AgentStatusTrackerOptions {
642
+ events: EventBus;
643
+ registry: SessionRegistry;
644
+ /** Leader agent name shown in the registry. Default: "leader". */
645
+ leaderName?: string | undefined;
646
+ }
647
+ declare class AgentStatusTracker {
648
+ private readonly events;
649
+ private readonly registry;
650
+ private readonly leaderName;
651
+ private agents;
652
+ private leaderStatus;
653
+ private leaderCurrentTool;
654
+ private leaderIterations;
655
+ private leaderToolCalls;
656
+ private unsubscribers;
657
+ constructor(opts: AgentStatusTrackerOptions);
658
+ start(): void;
659
+ stop(): void;
660
+ private flush;
661
+ }
662
+
540
663
  interface SessionRewinderOptions {
541
664
  sessionsDir: string;
542
665
  /** The project root directory; used to validate rewind targets stay inside it. */
@@ -563,8 +686,23 @@ interface TaskFile {
563
686
  tasks: TaskItem[];
564
687
  }
565
688
  declare function emptyTaskFile(sessionId: string): TaskFile;
689
+ /** Read the task file. Returns null when the file doesn't exist. */
566
690
  declare function loadTasks(filePath: string): Promise<TaskFile | null>;
691
+ /**
692
+ * Write the task file atomically. Prefer `mutateTasks` for read-modify-write
693
+ * cycles — this low-level function does NOT acquire a lock.
694
+ */
567
695
  declare function saveTasks(filePath: string, tasks: TaskFile): Promise<void>;
696
+ /**
697
+ * Load, modify, and save the task file under a file-level lock.
698
+ * `fn` receives the current TaskFile (or a fresh empty one) and must
699
+ * return the mutated TaskFile (mutating in-place is fine — the returned
700
+ * reference is what gets saved).
701
+ *
702
+ * This is the primary API for any code path that reads *and then writes*
703
+ * the task file — it prevents races from parallel `batch_tool_use` calls.
704
+ */
705
+ declare function mutateTasks(filePath: string, sessionId: string, fn: (file: TaskFile) => TaskFile | Promise<TaskFile>): Promise<TaskFile>;
568
706
 
569
707
  interface PromptEntry {
570
708
  id: string;
@@ -635,4 +773,4 @@ declare class CloudSync {
635
773
  private walkDir;
636
774
  }
637
775
 
638
- export { ALL_SYNC_CATEGORIES, type Annotation, AnnotationsStore, type AnnotationsStoreOptions, type AuditEntry, CloudSync, type ConsolidationOp, DefaultPromptStore, DefaultSessionRewinder, FileMemoryBackendOptions, GraphMemoryBackend, type GraphMemoryBackendOptions, MemoryBackend, type MemoryConsolidatorOptions, type PromptEntry, type PromptStore, type RecoveryPlan, type ReplayEntry, ReplayLogStore, type ReplayLogStoreOptions, SessionMemoryConsolidator, SessionRecovery, type SessionRewinderOptions, type StaleSession, SyncCategory, SyncConfig, type SyncResult, type TaskFile, ToolAuditLog, type ToolAuditLogOptions, type VerifyResult, emptyTaskFile, loadTasks, saveTasks };
776
+ export { ALL_SYNC_CATEGORIES, type AgentEntry, type AgentLiveStatus, AgentStatusTracker, type AgentStatusTrackerOptions, type Annotation, AnnotationsStore, type AnnotationsStoreOptions, type AuditEntry, CloudSync, type ConsolidationOp, DefaultPromptStore, DefaultSessionRewinder, FileMemoryBackendOptions, GraphMemoryBackend, type GraphMemoryBackendOptions, MemoryBackend, type MemoryConsolidatorOptions, type PromptEntry, type PromptStore, type RecoveryPlan, type ReplayEntry, ReplayLogStore, type ReplayLogStoreOptions, type SessionLiveStatus, SessionMemoryConsolidator, SessionRecovery, SessionRegistry, type SessionRegistryEntry, type SessionRewinderOptions, type StaleSession, SyncCategory, SyncConfig, type SyncResult, type TaskFile, ToolAuditLog, type ToolAuditLogOptions, type VerifyResult, emptyTaskFile, getSessionRegistry, hasSessionRegistry, loadTasks, mutateTasks, saveTasks };