@wrongstack/core 0.272.2 → 0.273.1

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 (71) hide show
  1. package/dist/{agent-bridge-DFQYEeXf.d.ts → agent-bridge-DpKIxHhE.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-BZa_IEcd.d.ts → agent-subagent-runner-Dx7fZ1bE.d.ts} +14 -7
  3. package/dist/{brain-etbcbRwV.d.ts → brain-BDcQaku-.d.ts} +112 -5
  4. package/dist/{compactor-72ug-ZRB.d.ts → compactor-BuSdj3fq.d.ts} +1 -1
  5. package/dist/{config-rRS8yorV.d.ts → config-CR2yoG8c.d.ts} +61 -4
  6. package/dist/{context-Dw55zZ_Q.d.ts → context-DulAr8Zo.d.ts} +24 -0
  7. package/dist/coordination/index.d.ts +23 -16
  8. package/dist/coordination/index.js +192 -38
  9. package/dist/coordination/index.js.map +1 -1
  10. package/dist/{default-config-B0cj-Hry.d.ts → default-config-BbX4ojZs.d.ts} +1 -0
  11. package/dist/defaults/index.d.ts +29 -28
  12. package/dist/defaults/index.js +3238 -234
  13. package/dist/defaults/index.js.map +1 -1
  14. package/dist/execution/index.d.ts +16 -16
  15. package/dist/execution/index.js +83 -3
  16. package/dist/execution/index.js.map +1 -1
  17. package/dist/execution/prompt-enhancer.d.ts +1 -1
  18. package/dist/extension/index.d.ts +6 -6
  19. package/dist/{global-mailbox-DJ4EoRr0.d.ts → global-mailbox-CwcubDkA.d.ts} +1 -1
  20. package/dist/{goal-preamble-hM8BH7TK.d.ts → goal-preamble-Bu0a2uCG.d.ts} +10 -10
  21. package/dist/{goal-store-CWlbT0TO.d.ts → goal-store-CTmFuZ8J.d.ts} +1 -1
  22. package/dist/hq/index.d.ts +5 -5
  23. package/dist/hq/index.js +1 -0
  24. package/dist/hq/index.js.map +1 -1
  25. package/dist/{index-DWm_PE9L.d.ts → index-CTq5wU3m.d.ts} +14 -6
  26. package/dist/{index-2Lhk5v0o.d.ts → index-CxP-HBhX.d.ts} +8 -2
  27. package/dist/index.d.ts +230 -48
  28. package/dist/index.js +3731 -648
  29. package/dist/index.js.map +1 -1
  30. package/dist/infrastructure/index.d.ts +6 -6
  31. package/dist/kernel/index.d.ts +94 -14
  32. package/dist/kernel/index.js.map +1 -1
  33. package/dist/{mcp-servers-BpWHTKlE.d.ts → mcp-servers-BQaOE71z.d.ts} +3 -3
  34. package/dist/models/index.d.ts +5 -5
  35. package/dist/{models-registry-CXQFUn5t.d.ts → models-registry-BEcny4kP.d.ts} +1 -1
  36. package/dist/{multi-agent-coordinator-jyimfo7D.d.ts → multi-agent-coordinator-Bx8EFkv2.d.ts} +1 -1
  37. package/dist/{null-fleet-bus-DOGQcvrY.d.ts → null-fleet-bus-BC5ZXCQw.d.ts} +16 -6
  38. package/dist/observability/index.d.ts +2 -2
  39. package/dist/{parallel-eternal-engine-rItJBYp9.d.ts → parallel-eternal-engine-C345TI3n.d.ts} +10 -9
  40. package/dist/{path-resolver-DrpF5MGK.d.ts → path-resolver-C-W_wzkF.d.ts} +3 -3
  41. package/dist/{permission-CC7XFYWG.d.ts → permission-CsBGZkxp.d.ts} +1 -1
  42. package/dist/{permission-policy-cYR4RJmw.d.ts → permission-policy-g3Sg0GdZ.d.ts} +2 -2
  43. package/dist/{pipeline-Ckkn3AOA.d.ts → pipeline-xnw_24Z8.d.ts} +2 -2
  44. package/dist/{plan-templates-BvHw5Znw.d.ts → plan-templates-DGaiYEcS.d.ts} +32 -6
  45. package/dist/{provider-model-resolve-nZqnCeaR.d.ts → provider-model-resolve-Cz6OlIOp.d.ts} +3 -3
  46. package/dist/{provider-runner-zVOn1p67.d.ts → provider-runner-7J0HqF6B.d.ts} +3 -3
  47. package/dist/{retry-policy-BV7nzeAd.d.ts → retry-policy-kqXJOVkX.d.ts} +1 -1
  48. package/dist/sdd/index.d.ts +1114 -14
  49. package/dist/sdd/index.js +5516 -2949
  50. package/dist/sdd/index.js.map +1 -1
  51. package/dist/{secret-vault-eMBKfheR.d.ts → secret-vault-CMQUr-eB.d.ts} +1 -1
  52. package/dist/security/index.d.ts +5 -5
  53. package/dist/security/index.js +6 -0
  54. package/dist/security/index.js.map +1 -1
  55. package/dist/{selector-C4ORTOid.d.ts → selector-B4r34PWR.d.ts} +1 -1
  56. package/dist/{session-event-bridge-CeNpUL9w.d.ts → session-event-bridge-BD3LoyLC.d.ts} +1 -1
  57. package/dist/{session-reader-BepLSnGL.d.ts → session-reader-DjrKGD9c.d.ts} +1 -1
  58. package/dist/storage/index.d.ts +12 -12
  59. package/dist/storage/index.js +380 -13
  60. package/dist/storage/index.js.map +1 -1
  61. package/dist/tools/index.d.ts +2 -2
  62. package/dist/tools/index.js.map +1 -1
  63. package/dist/types/index.d.ts +20 -20
  64. package/dist/types/index.js +31 -0
  65. package/dist/types/index.js.map +1 -1
  66. package/dist/utils/index.d.ts +30 -4
  67. package/dist/utils/index.js +110 -1
  68. package/dist/utils/index.js.map +1 -1
  69. package/dist/{index-DqW4o62H.d.ts → worktree-manager-DHdrWQ_7.d.ts} +48 -90
  70. package/dist/{wstack-paths-hOpNLmvf.d.ts → wstack-paths-BqkDAkoh.d.ts} +2 -0
  71. package/package.json +1 -1
@@ -1,16 +1,4 @@
1
- import { T as Token, a as Renderer, S as SystemPromptBuilder, H as HookRegistry } from './pipeline-Ckkn3AOA.js';
2
- import { E as EventBus, c as MemoryStore, B as BrainArbiter } from './brain-etbcbRwV.js';
3
- import { C as Compactor } from './compactor-72ug-ZRB.js';
4
- import { k as ConfigLoader, j as ConfigStore, M as ModelsRegistry } from './config-rRS8yorV.js';
5
- import { E as ErrorHandler, R as RetryPolicy } from './retry-policy-BV7nzeAd.js';
6
- import { I as InputReader } from './input-reader-E-ffP2ee.js';
7
- import { L as Logger } from './logger-B63L5bTg.js';
8
- import { M as ModeStore } from './mode-CZlO9iU1.js';
9
- import { P as PathResolver } from './path-resolver-CPRj4bFY.js';
10
- import { P as PermissionPolicy, S as SecretScrubber } from './permission-CC7XFYWG.js';
11
- import { P as ProviderRunner } from './provider-runner-zVOn1p67.js';
12
- import { e as TokenCounter, k as SessionStore } from './context-Dw55zZ_Q.js';
13
- import { S as SkillLoader } from './skill-DGIXCtdv.js';
1
+ import { E as EventBus } from './brain-BDcQaku-.js';
14
2
 
15
3
  /**
16
4
  * Lifecycle of a single worktree handle.
@@ -115,6 +103,52 @@ declare class WorktreeManager {
115
103
  }>;
116
104
  /** Merge the worktree branch back into the base branch (squash by default). */
117
105
  merge(handle: WorktreeHandle, opts?: MergeOpts): Promise<MergeResult>;
106
+ /**
107
+ * Current tip SHA of a handle's base branch (without checking it out). Capture
108
+ * this before a merge so a regressed merge can be reverted to exactly this
109
+ * commit — unambiguous even when a squash produced no diff. Returns null on
110
+ * failure (caller then skips the revert).
111
+ */
112
+ baseHead(handle: WorktreeHandle): Promise<string | null>;
113
+ /**
114
+ * Hard-reset the base branch back to `sha` (a value previously returned by
115
+ * {@link baseHead}). Used to undo a squash-merge whose integrated result failed
116
+ * re-verification, so an auto-resolved-but-broken merge never sticks on base.
117
+ * Safe because SDD merges are serialized — no other commit lands in between.
118
+ */
119
+ revertBaseTo(handle: WorktreeHandle, sha: string): Promise<boolean>;
120
+ /**
121
+ * Current base branch + tip SHA, captured WITHOUT a handle. The SDD run calls
122
+ * this once at start so a later rollback knows which branch the run's squash
123
+ * commits landed on. Returns null when not in a usable git state.
124
+ */
125
+ currentBase(): Promise<{
126
+ branch: string;
127
+ sha: string;
128
+ } | null>;
129
+ /**
130
+ * Force-remove EVERY managed worktree + branch this project owns, without
131
+ * relying on the in-memory `handles` map — so it works post-run (a fresh
132
+ * manager can clean up a previous run's leftovers). Enumerates
133
+ * `git worktree list --porcelain`, removes every checkout living under the
134
+ * `.wrongstack/worktrees` root, deletes every `wstack/ap/*` branch, then prunes.
135
+ * Returns the number of worktrees removed. Never throws — best-effort cleanup.
136
+ */
137
+ cleanupAllManaged(): Promise<{
138
+ removed: number;
139
+ }>;
140
+ /**
141
+ * Undo a run's squash commits by reverting each (newest → oldest) on the base
142
+ * branch — history-preserving, never a destructive reset. Refuses on a dirty
143
+ * working tree (so uncommitted work is never clobbered) and aborts cleanly if a
144
+ * revert conflicts, reporting which SHA. `shas` are the run commit SHAs in the
145
+ * order they landed; this reverses them. Returns the count reverted.
146
+ */
147
+ revertCommits(baseBranch: string, shas: string[]): Promise<{
148
+ ok: boolean;
149
+ reverted: number;
150
+ reason?: string;
151
+ }>;
118
152
  /**
119
153
  * Run the caller-supplied resolver against a conflicted squash-merge, then
120
154
  * commit if it cleared every marker. Returns a successful `MergeResult` on a
@@ -162,80 +196,4 @@ declare class WorktreeManager {
162
196
  /** Throw if `dir` resolves outside `projectRoot`. */
163
197
  declare function assertSafePath(dir: string, projectRoot: string): void;
164
198
 
165
- declare const TOKENS: {
166
- readonly Logger: Token<Logger>;
167
- readonly TokenCounter: Token<TokenCounter>;
168
- readonly SessionStore: Token<SessionStore>;
169
- readonly MemoryStore: Token<MemoryStore>;
170
- readonly PermissionPolicy: Token<PermissionPolicy>;
171
- readonly Compactor: Token<Compactor>;
172
- readonly PathResolver: Token<PathResolver>;
173
- readonly ConfigLoader: Token<ConfigLoader>;
174
- readonly ConfigStore: Token<ConfigStore>;
175
- readonly Renderer: Token<Renderer>;
176
- readonly InputReader: Token<InputReader>;
177
- readonly ErrorHandler: Token<ErrorHandler>;
178
- readonly RetryPolicy: Token<RetryPolicy>;
179
- readonly SkillLoader: Token<SkillLoader>;
180
- readonly SystemPromptBuilder: Token<SystemPromptBuilder>;
181
- readonly SecretScrubber: Token<SecretScrubber>;
182
- readonly ModelsRegistry: Token<ModelsRegistry>;
183
- readonly ModeStore: Token<ModeStore>;
184
- /** Replaces the entire provider call layer — retry, streaming, tracing. */
185
- readonly ProviderRunner: Token<ProviderRunner>;
186
- /** Optional git-worktree lifecycle manager (per-phase isolation in AutoPhase). */
187
- readonly WorktreeManager: Token<WorktreeManager>;
188
- /** Optional global Brain arbiter for policy/decision escalation. */
189
- readonly BrainArbiter: Token<BrainArbiter>;
190
- /** Lifecycle hook registry (shell + in-process hooks). */
191
- readonly HookRegistry: Token<HookRegistry>;
192
- };
193
-
194
- /**
195
- * RunController centralises abort + cleanup for a single agent run. It
196
- * wraps a single AbortController and exposes a registry of teardown
197
- * hooks that fire (LIFO, exactly once) when the run aborts OR ends
198
- * normally. Anyone holding the controller can:
199
- *
200
- * - read `signal` to bail out cooperatively
201
- * - call `abort(reason?)` to abort the run
202
- * - call `onAbort(fn)` to register a cleanup hook
203
- * - call `dispose()` when the run ends normally — this fires the
204
- * hooks too, so cleanup runs regardless of outcome
205
- *
206
- * Hooks must be idempotent and synchronous-or-quick. Errors thrown
207
- * inside hooks are caught and surfaced through `errorSink` (or the
208
- * console as a last resort) so one bad hook can't block the others.
209
- */
210
- interface RunControllerOptions {
211
- /** Optional parent signal — abort propagates from parent → this. */
212
- parentSignal?: AbortSignal | undefined;
213
- /** Receives errors thrown by cleanup hooks. Defaults to console.warn. */
214
- errorSink?: (err: unknown, where: string) => void;
215
- }
216
- declare class RunController {
217
- private readonly ctrl;
218
- private readonly hooks;
219
- private disposed;
220
- private hooksDrained;
221
- private readonly errorSink;
222
- constructor(opts?: RunControllerOptions);
223
- get signal(): AbortSignal;
224
- get aborted(): boolean;
225
- abort(reason?: unknown): void;
226
- /**
227
- * Register a teardown hook. Returns an unsubscribe function so callers
228
- * can opt out before the hook fires (e.g. when a tool finishes cleanly
229
- * before abort happens).
230
- */
231
- onAbort(fn: () => void | Promise<void>): () => void;
232
- /**
233
- * Fire cleanup hooks and tear down listeners — called when the run
234
- * ends *normally* so cleanup happens regardless of outcome. Subsequent
235
- * aborts become no-ops.
236
- */
237
- dispose(): Promise<void>;
238
- private runHooks;
239
- }
240
-
241
- export { type AllocateOpts as A, type MergeOpts as M, RunController as R, TOKENS as T, WorktreeManager as W, type MergeResult as a, type RunControllerOptions as b, type WorktreeHandle as c, type WorktreeManagerOptions as d, type RunResult as e, type WorktreeStatus as f, assertSafePath as g };
199
+ export { type AllocateOpts as A, type MergeOpts as M, type RunResult as R, WorktreeManager as W, type MergeResult as a, type WorktreeHandle as b, type WorktreeManagerOptions as c, type WorktreeStatus as d, assertSafePath as e };
@@ -79,6 +79,8 @@ interface WstackPaths {
79
79
  projectPlan: string;
80
80
  /** ~/.wrongstack/projects/<hash>/autophase — AutoPhase phase-graph JSON files */
81
81
  projectAutophase: string;
82
+ /** ~/.wrongstack/projects/<hash>/sdd-boards — live SDD board snapshots + JSONL event logs */
83
+ projectSddBoards: string;
82
84
  /** ~/.wrongstack/sync.json — CloudSync configuration */
83
85
  syncConfig: string;
84
86
  /** Function to get the status.json path for a project given its hash. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/core",
3
- "version": "0.272.2",
3
+ "version": "0.273.1",
4
4
  "license": "MIT",
5
5
  "description": "WrongStack core: kernel, types, defaults, and shared utilities for the WrongStack CLI agent.",
6
6
  "repository": {