@wrongstack/core 0.8.4 → 0.8.6

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 (47) hide show
  1. package/dist/{agent-bridge-DPxcUVkn.d.ts → agent-bridge-Bad3ZGQ7.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-Cav3yEJM.d.ts → agent-subagent-runner-Cc8sRJOF.d.ts} +3 -3
  3. package/dist/coordination/index.d.ts +8 -8
  4. package/dist/coordination/index.js +8 -1
  5. package/dist/coordination/index.js.map +1 -1
  6. package/dist/defaults/index.d.ts +11 -11
  7. package/dist/defaults/index.js +41 -21
  8. package/dist/defaults/index.js.map +1 -1
  9. package/dist/{events-DyhxkstG.d.ts → events-yCpJD4wa.d.ts} +49 -0
  10. package/dist/execution/index.d.ts +7 -7
  11. package/dist/execution/index.js +22 -3
  12. package/dist/execution/index.js.map +1 -1
  13. package/dist/extension/index.d.ts +2 -2
  14. package/dist/index-BvZld4Dr.d.ts +200 -0
  15. package/dist/{index-oYZeWsuJ.d.ts → index-SxpnwRlJ.d.ts} +1 -1
  16. package/dist/index.d.ts +132 -21
  17. package/dist/index.js +862 -146
  18. package/dist/index.js.map +1 -1
  19. package/dist/infrastructure/index.d.ts +2 -2
  20. package/dist/kernel/index.d.ts +16 -88
  21. package/dist/kernel/index.js +3 -1
  22. package/dist/kernel/index.js.map +1 -1
  23. package/dist/{multi-agent-CRMznZmf.d.ts → multi-agent-C8uY45AY.d.ts} +9 -1
  24. package/dist/{multi-agent-coordinator-IQKrMfXz.d.ts → multi-agent-coordinator-C7YbZUY8.d.ts} +2 -2
  25. package/dist/{null-fleet-bus-sKnVwEd8.d.ts → null-fleet-bus-Bb2jVLKr.d.ts} +5 -5
  26. package/dist/observability/index.d.ts +1 -1
  27. package/dist/{path-resolver-1CIYbH2Q.d.ts → path-resolver-DnC1nOjb.d.ts} +1 -1
  28. package/dist/{plan-templates-BnlpEkX8.d.ts → plan-templates-Cqdy6rtM.d.ts} +2 -2
  29. package/dist/{provider-runner-BrA0XR-l.d.ts → provider-runner-C4ouU7--.d.ts} +1 -1
  30. package/dist/sdd/index.d.ts +11 -11
  31. package/dist/sdd/index.js +10 -14
  32. package/dist/sdd/index.js.map +1 -1
  33. package/dist/security/index.js.map +1 -1
  34. package/dist/skills/index.js +7 -1
  35. package/dist/skills/index.js.map +1 -1
  36. package/dist/storage/index.d.ts +3 -3
  37. package/dist/storage/index.js +1 -3
  38. package/dist/storage/index.js.map +1 -1
  39. package/dist/{tool-executor-QwfWnQZ8.d.ts → tool-executor-Ch25BDwa.d.ts} +1 -1
  40. package/dist/types/index.d.ts +7 -7
  41. package/dist/types/index.js +22 -3
  42. package/dist/types/index.js.map +1 -1
  43. package/dist/utils/index.d.ts +1 -1
  44. package/dist/utils/index.js +41 -1
  45. package/dist/utils/index.js.map +1 -1
  46. package/dist/{wstack-paths-gCrJ631C.d.ts → wstack-paths-CJYrjQU8.d.ts} +4 -0
  47. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
- export { A as AfterIterationHook, a as AfterRunHook, b as AfterToolExecutionHook, d as AgentExtension, B as BeforeIterationHook, h as BeforeRunHook, i as BeforeToolExecutionHook, E as ExtensionRegistry, O as OnErrorHook, s as ProviderRunnerFn, t as ProviderRunnerWrapper } from '../index-oYZeWsuJ.js';
1
+ export { A as AfterIterationHook, a as AfterRunHook, b as AfterToolExecutionHook, d as AgentExtension, B as BeforeIterationHook, h as BeforeRunHook, i as BeforeToolExecutionHook, E as ExtensionRegistry, O as OnErrorHook, s as ProviderRunnerFn, t as ProviderRunnerWrapper } from '../index-SxpnwRlJ.js';
2
2
  import '../context-z2x5gv_V.js';
3
3
  import '../logger-DDd5C--Z.js';
4
4
  import '../system-prompt-CWA6ml-d.js';
5
5
  import '../observability-BhnVLBLS.js';
6
- import '../events-DyhxkstG.js';
6
+ import '../events-yCpJD4wa.js';
7
7
  import '../secret-scrubber-CyE1-EMG.js';
8
8
  import '../config-Bi4Q0fnz.js';
9
9
  import '../models-registry-BcYJDKLm.js';
@@ -0,0 +1,200 @@
1
+ import { T as Token, e as Renderer, S as SystemPromptBuilder } from './system-prompt-CWA6ml-d.js';
2
+ import { E as EventBus } from './events-yCpJD4wa.js';
3
+ import { a as Compactor } from './compactor-Mw7-rNyb.js';
4
+ import { b as ConfigLoader, c as ConfigStore } from './config-Bi4Q0fnz.js';
5
+ import { E as ErrorHandler, a as RetryPolicy } from './retry-policy-OwtKNxo8.js';
6
+ import { I as InputReader } from './input-reader-E-ffP2ee.js';
7
+ import { a as Logger } from './logger-DDd5C--Z.js';
8
+ import { b as MemoryStore } from './memory-CEXuo7sz.js';
9
+ import { c as ModeStore } from './mode-CV077NjV.js';
10
+ import { b as ModelsRegistry } from './models-registry-BcYJDKLm.js';
11
+ import { P as PathResolver } from './path-resolver-CPRj4bFY.js';
12
+ import { a as PermissionPolicy, S as SecretScrubber } from './secret-scrubber-CyE1-EMG.js';
13
+ import { P as ProviderRunner } from './provider-runner-C4ouU7--.js';
14
+ import { O as TokenCounter, y as SessionStore } from './context-z2x5gv_V.js';
15
+ import { a as SkillLoader } from './skill-CxuWrsKK.js';
16
+
17
+ /**
18
+ * Lifecycle of a single worktree handle.
19
+ *
20
+ * allocating → active → committing → merging → merged
21
+ * └─→ needs-review (conflict, kept)
22
+ * (any) → failed
23
+ */
24
+ type WorktreeStatus = 'allocating' | 'active' | 'committing' | 'merging' | 'merged' | 'needs-review' | 'failed';
25
+ interface WorktreeHandle {
26
+ /** Stable id (== slug). Used as the event `handleId`. */
27
+ id: string;
28
+ /** Caller-supplied owner (a phase id in AutoPhase). */
29
+ ownerId: string;
30
+ /** Human label for the owner (phase name). */
31
+ ownerLabel: string;
32
+ slug: string;
33
+ /** Absolute path to the worktree checkout. */
34
+ dir: string;
35
+ /** Branch checked out in the worktree (`wstack/ap/<slug>`). */
36
+ branch: string;
37
+ /** Branch the worktree was forked from and merges back into. */
38
+ baseBranch: string;
39
+ status: WorktreeStatus;
40
+ createdAt: number;
41
+ updatedAt: number;
42
+ /** Diff stats from the last commit. */
43
+ insertions: number;
44
+ deletions: number;
45
+ files: number;
46
+ sha?: string;
47
+ lastError?: string;
48
+ conflictFiles?: string[];
49
+ }
50
+ interface AllocateOpts {
51
+ /** Friendly basis for the slug/branch (e.g. the phase name). */
52
+ slugHint?: string;
53
+ ownerLabel?: string;
54
+ /** Override the detected base branch. */
55
+ baseBranch?: string;
56
+ }
57
+ interface MergeOpts {
58
+ squash?: boolean;
59
+ message?: string;
60
+ }
61
+ interface MergeResult {
62
+ ok: boolean;
63
+ conflict?: boolean;
64
+ conflictFiles?: string[];
65
+ stderr?: string;
66
+ }
67
+ interface RunResult {
68
+ code: number;
69
+ stdout: string;
70
+ stderr: string;
71
+ }
72
+ interface WorktreeManagerOptions {
73
+ projectRoot: string;
74
+ events?: EventBus;
75
+ gitBin?: string;
76
+ /**
77
+ * Test seam. When provided, replaces the real `git` spawn so the manager's
78
+ * sequencing/arg vectors can be asserted without touching a repo.
79
+ */
80
+ run?: (args: string[], cwd: string) => Promise<RunResult>;
81
+ }
82
+ /**
83
+ * Owns the git-worktree lifecycle for isolated, parallel work units. Shells out
84
+ * to `git` directly (never via the `git` *tool*) so it can target arbitrary
85
+ * worktree directories without the tool's permission gate or `findGitDir`
86
+ * resolution, and so `@wrongstack/core` keeps no dependency on `@wrongstack/tools`.
87
+ */
88
+ declare class WorktreeManager {
89
+ private readonly projectRoot;
90
+ private readonly events?;
91
+ private readonly gitBin;
92
+ private readonly runGit;
93
+ /** Keyed by ownerId. */
94
+ private readonly handles;
95
+ private readonly usedSlugs;
96
+ constructor(opts: WorktreeManagerOptions);
97
+ /** Create a fresh worktree + branch forked from the current base branch. */
98
+ allocate(ownerId: string, opts?: AllocateOpts): Promise<WorktreeHandle>;
99
+ /** Stage everything and commit inside the worktree. */
100
+ commitAll(handle: WorktreeHandle, message: string): Promise<{
101
+ committed: boolean;
102
+ }>;
103
+ /** Merge the worktree branch back into the base branch (squash by default). */
104
+ merge(handle: WorktreeHandle, opts?: MergeOpts): Promise<MergeResult>;
105
+ /**
106
+ * Remove the worktree + branch. Conflicted/failed handles (or `keep:true`)
107
+ * are left on disk for inspection.
108
+ */
109
+ release(handle: WorktreeHandle, opts?: {
110
+ keep?: boolean;
111
+ }): Promise<void>;
112
+ get(ownerId: string): WorktreeHandle | undefined;
113
+ list(): WorktreeHandle[];
114
+ private worktreesRoot;
115
+ private detectBaseBranch;
116
+ private makeSlug;
117
+ private collectStats;
118
+ private unmergedFiles;
119
+ private emitCommitted;
120
+ private fail;
121
+ private setStatus;
122
+ private emit;
123
+ private defaultRun;
124
+ }
125
+ /** Throw if `dir` resolves outside `projectRoot`. */
126
+ declare function assertSafePath(dir: string, projectRoot: string): void;
127
+
128
+ declare const TOKENS: {
129
+ readonly Logger: Token<Logger>;
130
+ readonly TokenCounter: Token<TokenCounter>;
131
+ readonly SessionStore: Token<SessionStore>;
132
+ readonly MemoryStore: Token<MemoryStore>;
133
+ readonly PermissionPolicy: Token<PermissionPolicy>;
134
+ readonly Compactor: Token<Compactor>;
135
+ readonly PathResolver: Token<PathResolver>;
136
+ readonly ConfigLoader: Token<ConfigLoader>;
137
+ readonly ConfigStore: Token<ConfigStore>;
138
+ readonly Renderer: Token<Renderer>;
139
+ readonly InputReader: Token<InputReader>;
140
+ readonly ErrorHandler: Token<ErrorHandler>;
141
+ readonly RetryPolicy: Token<RetryPolicy>;
142
+ readonly SkillLoader: Token<SkillLoader>;
143
+ readonly SystemPromptBuilder: Token<SystemPromptBuilder>;
144
+ readonly SecretScrubber: Token<SecretScrubber>;
145
+ readonly ModelsRegistry: Token<ModelsRegistry>;
146
+ readonly ModeStore: Token<ModeStore>;
147
+ /** Replaces the entire provider call layer — retry, streaming, tracing. */
148
+ readonly ProviderRunner: Token<ProviderRunner>;
149
+ /** Optional git-worktree lifecycle manager (per-phase isolation in AutoPhase). */
150
+ readonly WorktreeManager: Token<WorktreeManager>;
151
+ };
152
+
153
+ /**
154
+ * RunController centralises abort + cleanup for a single agent run. It
155
+ * wraps a single AbortController and exposes a registry of teardown
156
+ * hooks that fire (LIFO, exactly once) when the run aborts OR ends
157
+ * normally. Anyone holding the controller can:
158
+ *
159
+ * - read `signal` to bail out cooperatively
160
+ * - call `abort(reason?)` to abort the run
161
+ * - call `onAbort(fn)` to register a cleanup hook
162
+ * - call `dispose()` when the run ends normally — this fires the
163
+ * hooks too, so cleanup runs regardless of outcome
164
+ *
165
+ * Hooks must be idempotent and synchronous-or-quick. Errors thrown
166
+ * inside hooks are caught and surfaced through `errorSink` (or the
167
+ * console as a last resort) so one bad hook can't block the others.
168
+ */
169
+ interface RunControllerOptions {
170
+ /** Optional parent signal — abort propagates from parent → this. */
171
+ parentSignal?: AbortSignal;
172
+ /** Receives errors thrown by cleanup hooks. Defaults to console.warn. */
173
+ errorSink?: (err: unknown, where: string) => void;
174
+ }
175
+ declare class RunController {
176
+ private readonly ctrl;
177
+ private readonly hooks;
178
+ private disposed;
179
+ private hooksDrained;
180
+ private readonly errorSink;
181
+ constructor(opts?: RunControllerOptions);
182
+ get signal(): AbortSignal;
183
+ get aborted(): boolean;
184
+ abort(reason?: unknown): void;
185
+ /**
186
+ * Register a teardown hook. Returns an unsubscribe function so callers
187
+ * can opt out before the hook fires (e.g. when a tool finishes cleanly
188
+ * before abort happens).
189
+ */
190
+ onAbort(fn: () => void | Promise<void>): () => void;
191
+ /**
192
+ * Fire cleanup hooks and tear down listeners — called when the run
193
+ * ends *normally* so cleanup happens regardless of outcome. Subsequent
194
+ * aborts become no-ops.
195
+ */
196
+ dispose(): Promise<void>;
197
+ private runHooks;
198
+ }
199
+
200
+ export { type AllocateOpts as A, type MergeOpts as M, RunController as R, TOKENS as T, type WorktreeHandle as W, type MergeResult as a, type RunControllerOptions as b, type RunResult as c, WorktreeManager as d, type WorktreeManagerOptions as e, type WorktreeStatus as f, assertSafePath as g };
@@ -2,7 +2,7 @@ import { Q as Tool, Y as ToolResultBlock, _ as ToolUseBlock, d as Context, T as
2
2
  import { a as Logger } from './logger-DDd5C--Z.js';
3
3
  import { e as Renderer, a as BuildContext, C as Container, P as Pipeline, R as ReadonlyPipeline } from './system-prompt-CWA6ml-d.js';
4
4
  import { T as Tracer } from './observability-BhnVLBLS.js';
5
- import { E as EventBus, c as EventName, L as Listener } from './events-DyhxkstG.js';
5
+ import { E as EventBus, c as EventName, L as Listener } from './events-yCpJD4wa.js';
6
6
  import { a as PermissionPolicy, S as SecretScrubber } from './secret-scrubber-CyE1-EMG.js';
7
7
  import { l as ProviderConfig, a as Config } from './config-Bi4Q0fnz.js';
8
8
  import { W as WireFamily } from './models-registry-BcYJDKLm.js';
package/dist/index.d.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  import { S as SystemPromptBuilder, c as ModelCapabilities, a as BuildContext, C as Container } from './system-prompt-CWA6ml-d.js';
2
2
  export { B as BindOptions, D as Decorator, F as Factory, M as Middleware, b as MiddlewareHandler, N as NextFn, P as Pipeline, d as PipelineOptions, e as Renderer, T as Token } from './system-prompt-CWA6ml-d.js';
3
- import { E as EventBus, c as EventName, L as Listener } from './events-DyhxkstG.js';
4
- export { a as EventLogger, b as EventMap, S as ScopedEventBus } from './events-DyhxkstG.js';
5
- export { RunController, RunControllerOptions, TOKENS } from './kernel/index.js';
3
+ import { E as EventBus, c as EventName, L as Listener } from './events-yCpJD4wa.js';
4
+ export { a as EventLogger, b as EventMap, S as ScopedEventBus } from './events-yCpJD4wa.js';
5
+ import { d as WorktreeManager } from './index-BvZld4Dr.js';
6
+ export { A as AllocateOpts, M as MergeOpts, a as MergeResult, R as RunController, b as RunControllerOptions, T as TOKENS, W as WorktreeHandle, e as WorktreeManagerOptions, c as WorktreeRunResult, f as WorktreeStatus, g as assertSafePath } from './index-BvZld4Dr.js';
6
7
  import { d as Context, m as Provider, Q as Tool, c as ContentBlock, T as TextBlock } from './context-z2x5gv_V.js';
7
8
  export { A as AgentError, a as Capabilities, b as ConfigError, e as ContextInit, f as ConversationState, E as ERROR_CODES, g as ErrorCode, h as ErrorSeverity, i as ErrorSubsystem, F as FileSnapshot, j as FsError, I as ImageBlock, J as JSONSchema, M as Message, k as MessageRole, P as Permission, l as PluginError, n as ProviderError, o as ProviderErrorBody, R as ReadonlyConversationState, p as Request, q as Response, r as ResumedSession, s as RiskTier, t as RunEnv, u as RunOptions, S as SessionData, v as SessionError, w as SessionEvent, x as SessionMetadata, y as SessionStore, z as SessionSummary, B as SessionWriter, D as StateChange, G as StateChangeHandler, H as StopReason, K as StreamEvent, L as ThinkingBlock, N as TodoItem, O as TokenCounter, U as ToolCallContext, V as ToolError, W as ToolFinalEvent, X as ToolProgressEvent, Y as ToolResultBlock, Z as ToolStreamEvent, _ as ToolUseBlock, $ as Usage, a0 as WrongStackError, a1 as asBlocks, a2 as asText, a3 as extractRunEnv, a4 as isAgentError, a5 as isConfigError, a6 as isFsError, a7 as isImageBlock, a8 as isPluginError, a9 as isSessionError, aa as isTextBlock, ab as isThinkingBlock, ac as isToolError, ad as isToolResultBlock, ae as isToolUseBlock, af as isWrongStackError, ag as toWrongStackError, ah as wrapAsState } from './context-z2x5gv_V.js';
8
- export { P as ProviderRunner, R as RunProviderOptions } from './provider-runner-BrA0XR-l.js';
9
+ export { P as ProviderRunner, R as RunProviderOptions } from './provider-runner-C4ouU7--.js';
9
10
  import { M as MCPServerConfig, a as Config } from './config-Bi4Q0fnz.js';
10
11
  export { C as CONTEXT_WINDOW_MODES, b as ConfigLoader, c as ConfigStore, d as ContextConfig, e as ContextWindowAggressiveOn, f as ContextWindowConfigLike, g as ContextWindowMode, h as ContextWindowModeId, i as ContextWindowPolicy, j as ContextWindowThresholds, D as DEFAULT_CONTEXT_WINDOW_MODE_ID, F as FeaturesConfig, L as LogConfig, P as PluginConfig, k as ProviderApiKey, l as ProviderConfig, T as ToolsConfig, m as formatContextWindowModeList, n as getContextWindowMode, o as isContextWindowModeId, p as listContextWindowModes, r as resolveContextWindowPolicy } from './config-Bi4Q0fnz.js';
11
12
  export { C as CompactReport, a as Compactor } from './compactor-Mw7-rNyb.js';
@@ -16,35 +17,36 @@ export { a as Attachment, b as AttachmentKind, c as AttachmentMeta, D as Default
16
17
  export { D as DEFAULT_CONTEXT_CONFIG, a as DEFAULT_TOOLS_CONFIG } from './default-config-DvRSTELf.js';
17
18
  export { D as DefaultSecretScrubber, a as DefaultSecretVault, S as SecretVaultOptions, d as decryptConfigSecrets, e as encryptConfigSecrets, m as migratePlaintextSecrets, r as rewriteConfigEncrypted } from './secret-scrubber-C0n1EqrC.js';
18
19
  export { D as DefaultLogger, a as DefaultLoggerOptions } from './logger-bOzkF5LL.js';
19
- export { D as DefaultPathResolver, a as DefaultTokenCounter } from './path-resolver-1CIYbH2Q.js';
20
+ export { D as DefaultPathResolver, a as DefaultTokenCounter } from './path-resolver-DnC1nOjb.js';
20
21
  import { b as MemoryStore } from './memory-CEXuo7sz.js';
21
22
  export { M as MemoryEntry, a as MemoryScope } from './memory-CEXuo7sz.js';
22
- export { C as CompactorOptions, D as DEFAULT_RECOVERY_STRATEGIES, a as DefaultErrorHandler, b as DefaultRetryPolicy, H as HybridCompactor, R as RecoveryStrategy, T as ToolExecutor, c as buildRecoveryStrategies } from './tool-executor-QwfWnQZ8.js';
23
+ export { C as CompactorOptions, D as DEFAULT_RECOVERY_STRATEGIES, a as DefaultErrorHandler, b as DefaultRetryPolicy, H as HybridCompactor, R as RecoveryStrategy, T as ToolExecutor, c as buildRecoveryStrategies } from './tool-executor-Ch25BDwa.js';
23
24
  import { a as SkillLoader } from './skill-CxuWrsKK.js';
24
25
  export { S as SkillEntry, b as SkillManifest } from './skill-CxuWrsKK.js';
25
26
  export { I as InputReader, P as PromptOption } from './input-reader-E-ffP2ee.js';
26
- import { u as SlashCommand, w as SystemPromptContributor, k as PluginAPI, n as PluginPipelines, C as ToolRegistryView, r as ProviderRegistryView, M as MCPRegistryView, v as SlashCommandRegistryView, E as ExtensionRegistry, S as SessionWriterView, j as MetricsSinkView, z as ToolRegistry, q as ProviderRegistry, P as Plugin } from './index-oYZeWsuJ.js';
27
- export { A as AfterIterationHook, a as AfterRunHook, b as AfterToolExecutionHook, c as Agent, d as AgentExtension, e as AgentInit, f as AgentInput, g as AgentPipelines, B as BeforeIterationHook, h as BeforeRunHook, i as BeforeToolExecutionHook, D as DEFAULT_MAX_ITERATIONS, O as OnErrorHook, l as PluginCapabilities, m as PluginDependency, p as ProviderFactory, t as ProviderRunnerWrapper, R as RunResult, F as ToolWrapper, U as UserInputPayload, G as createDefaultPipelines } from './index-oYZeWsuJ.js';
27
+ import { u as SlashCommand, w as SystemPromptContributor, k as PluginAPI, n as PluginPipelines, C as ToolRegistryView, r as ProviderRegistryView, M as MCPRegistryView, v as SlashCommandRegistryView, E as ExtensionRegistry, S as SessionWriterView, j as MetricsSinkView, z as ToolRegistry, q as ProviderRegistry, P as Plugin } from './index-SxpnwRlJ.js';
28
+ export { A as AfterIterationHook, a as AfterRunHook, b as AfterToolExecutionHook, c as Agent, d as AgentExtension, e as AgentInit, f as AgentInput, g as AgentPipelines, B as BeforeIterationHook, h as BeforeRunHook, i as BeforeToolExecutionHook, D as DEFAULT_MAX_ITERATIONS, O as OnErrorHook, l as PluginCapabilities, m as PluginDependency, p as ProviderFactory, t as ProviderRunnerWrapper, R as RunResult, F as ToolWrapper, U as UserInputPayload, G as createDefaultPipelines } from './index-SxpnwRlJ.js';
28
29
  export { D as DefaultModelsRegistry, a as DefaultModelsRegistryOptions, c as classifyFamily } from './models-registry-OG_30xqZ.js';
29
30
  import { c as ModeStore } from './mode-CV077NjV.js';
30
31
  export { D as DEFAULT_MODES, M as Mode, a as ModeConfig, b as ModeManifest } from './mode-CV077NjV.js';
31
- export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from './agent-bridge-DPxcUVkn.js';
32
- export { c as BudgetExceededError, d as BudgetKind, e as BudgetLimits, j as BudgetUsage, C as CoordinatorEvents, k as CoordinatorStatus, D as DoneCondition, M as MultiAgentConfig, l as MultiAgentCoordinator, S as SpawnResult, m as SubagentBudget, n as SubagentConfig, o as SubagentContext, p as SubagentError, q as SubagentErrorKind, r as SubagentRunContext, s as SubagentRunOutcome, t as SubagentRunner, T as TaskDelegation, u as TaskResult, v as TaskSpec } from './multi-agent-CRMznZmf.js';
32
+ export { I as InMemoryAgentBridge, a as InMemoryBridgeTransport, c as createMessage } from './agent-bridge-Bad3ZGQ7.js';
33
+ export { c as BudgetExceededError, d as BudgetKind, e as BudgetLimits, j as BudgetUsage, C as CoordinatorEvents, k as CoordinatorStatus, D as DoneCondition, M as MultiAgentConfig, l as MultiAgentCoordinator, S as SpawnResult, m as SubagentBudget, n as SubagentConfig, o as SubagentContext, p as SubagentError, q as SubagentErrorKind, r as SubagentRunContext, s as SubagentRunOutcome, t as SubagentRunner, T as TaskDelegation, u as TaskResult, v as TaskSpec } from './multi-agent-C8uY45AY.js';
33
34
  import { l as TaskGraph, r as TaskType, n as TaskPriority, m as TaskNode } from './task-graph-D1YQbpxF.js';
34
35
  export { C as CriticalPathResult, D as DEFAULT_SPEC_TEMPLATE, S as SpecAnalysis, a as SpecApiEndpoint, b as SpecRequirement, c as SpecSection, d as SpecSectionType, e as SpecStatus, f as SpecTemplate, g as SpecValidationResult, h as Specification, T as TaskAssignment, i as TaskDependency, j as TaskEdge, k as TaskFilter, o as TaskProgress, p as TaskSort, q as TaskStatus, s as computeTaskProgress, t as findCriticalPath, u as topologicalSort } from './task-graph-D1YQbpxF.js';
35
36
  export { A as AggregateHealth, H as HealthCheck, a as HealthCheckResult, b as HealthRegistry, c as HealthStatus, M as MetricLabels, d as MetricSeries, e as MetricsSink, f as MetricsSnapshot, S as Span, T as Tracer } from './observability-BhnVLBLS.js';
36
37
  export { AtomicWriteOptions, BuildChildEnvOptions, CompileFail, CompileResult, MessageRepairReport, MessageRepairResult, NewlineStyle, RequestTokenBreakdown, SafeParseResult, ToolOutputSerializerOptions, UnifiedDiffOptions, ValidationError, ValidationResult, atomicWrite, buildChildEnv, color, compileGlob, compileUserRegex, createToolOutputSerializer, detectNewlineStyle, ensureDir, estimateRequestTokens, estimateTextTokens, estimateToolDefTokens, estimateToolInputTokens, estimateToolResultTokens, formatTodosList, matchAny, matchGlob, normalizeToLf, repairToolUseAdjacency, safeParse, safeStringify, sanitizeJsonString, stripAnsi, toStyle, unifiedDiff, validateAgainstSchema } from './utils/index.js';
37
- export { W as WstackPathOptions, a as WstackPaths, p as projectHash, r as resolveWstackPaths } from './wstack-paths-gCrJ631C.js';
38
- 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, M as MemoryStoreOptions, j as MigrationContext, k as MigrationResult, P as PersistedQueueItem, l as PlanFile, m as PlanItem, n as PlanTemplate, Q as QueueStore, R as RecoveryLock, o as RecoveryLockOptions, S as SessionAnalyzer, p as SessionStoreOptions, T as TodosCheckpointFile, q as addPlanItem, r as attachPlanCheckpoint, s as attachTodosCheckpoint, t as clearPlan, u as deriveTodosFromPlanItem, v as emptyPlan, w as formatPlan, x as formatPlanTemplates, y as getPlanTemplate, z as listPlanTemplates, B as loadPlan, E as loadTodosCheckpoint, F as removePlanItem, G as runConfigMigrations, H as savePlan, I as saveTodosCheckpoint, J as setPlanItemStatus } from './plan-templates-BnlpEkX8.js';
38
+ export { W as WstackPathOptions, a as WstackPaths, p as projectHash, r as resolveWstackPaths } from './wstack-paths-CJYrjQU8.js';
39
+ 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, M as MemoryStoreOptions, j as MigrationContext, k as MigrationResult, P as PersistedQueueItem, l as PlanFile, m as PlanItem, n as PlanTemplate, Q as QueueStore, R as RecoveryLock, o as RecoveryLockOptions, S as SessionAnalyzer, p as SessionStoreOptions, T as TodosCheckpointFile, q as addPlanItem, r as attachPlanCheckpoint, s as attachTodosCheckpoint, t as clearPlan, u as deriveTodosFromPlanItem, v as emptyPlan, w as formatPlan, x as formatPlanTemplates, y as getPlanTemplate, z as listPlanTemplates, B as loadPlan, E as loadTodosCheckpoint, F as removePlanItem, G as runConfigMigrations, H as savePlan, I as saveTodosCheckpoint, J as setPlanItemStatus } from './plan-templates-Cqdy6rtM.js';
39
40
  export { D as DirectorStateCheckpoint, a as DirectorStateSnapshot, b as DirectorSubagentState, c as DirectorTaskState, l as loadDirectorState } from './director-state-BmYi3DGA.js';
40
41
  export { A as AutoApprovePermissionPolicy, D as DefaultPermissionPolicy, P as PermissionPolicyOptions } from './permission-policy-BBa1M1xc.js';
41
42
  export { AutoCompactionMiddleware, AutonomousRunner, AutonomousRunnerOptions, AutonomyPromptContributorOptions, DefaultSkillLoader, DoneCheckResult, DoneConditionChecker, EternalAutonomyEngine, EternalAutonomyOptions, EternalEngineState, IntelligentCompactor, IntelligentCompactorOptions, ParallelEngineState, ParallelEternalEngine, ParallelEternalOptions, SelectiveCompactor, SelectiveCompactorOptions, SkillLoaderOptions, buildGoalPreamble, makeAutonomyPromptContributor } from './execution/index.js';
42
43
  export { DefaultProviderRunner } from './defaults/index.js';
43
- export { 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, C as CreateDelegateToolOptions, D as DEFAULT_DIRECTOR_PREAMBLE, h as DEFAULT_SUBAGENT_BASELINE, i as DelegateHost, j as Director, k as DirectorPromptParts, l as DirectorSessionFactory, m as DirectorSessionFactoryOptions, F as FLEET_ROSTER, n as FLEET_ROSTER_BUDGETS, q as FleetManager, r as FleetManagerOptions, s as FleetRosterBudget, t as FleetSpawnBudgetError, I as ICoordinator, u as IFleetManager, N as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, S as SECURITY_SCANNER_AGENT, v as SubagentPromptParts, w as applyRosterBudget, x as attachAutoExtend, y as composeDirectorPrompt, z as composeSubagentPrompt, E as createDelegateTool, G as getAgentDefinition, H as makeDirectorSessionFactory, J as rosterSummaryFromConfigs } from './null-fleet-bus-sKnVwEd8.js';
44
- export { A as AgentBudgetTier, a as AgentCapability, b as AgentDefinition, c as AgentPhase, D as DEFAULT_DISPATCH_ROLE, d as DefaultMultiAgentCoordinator, e as DispatchCandidate, f as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from './multi-agent-coordinator-IQKrMfXz.js';
45
- export { A as AgentFactory, a as AgentFactoryResult, b as AgentRunnerOptions, F as FleetBus, c as FleetEvent, d as FleetHandler, e as FleetUsage, f as FleetUsageAggregator, S as SubagentUsageSnapshot, m as makeAgentSubagentRunner } from './agent-subagent-runner-Cav3yEJM.js';
44
+ export { 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, C as CreateDelegateToolOptions, D as DEFAULT_DIRECTOR_PREAMBLE, h as DEFAULT_SUBAGENT_BASELINE, i as DelegateHost, j as Director, k as DirectorPromptParts, l as DirectorSessionFactory, m as DirectorSessionFactoryOptions, F as FLEET_ROSTER, n as FLEET_ROSTER_BUDGETS, q as FleetManager, r as FleetManagerOptions, s as FleetRosterBudget, t as FleetSpawnBudgetError, I as ICoordinator, u as IFleetManager, N as NULL_FLEET_BUS, R as REFACTOR_PLANNER_AGENT, S as SECURITY_SCANNER_AGENT, v as SubagentPromptParts, w as applyRosterBudget, x as attachAutoExtend, y as composeDirectorPrompt, z as composeSubagentPrompt, E as createDelegateTool, G as getAgentDefinition, H as makeDirectorSessionFactory, J as rosterSummaryFromConfigs } from './null-fleet-bus-Bb2jVLKr.js';
45
+ export { A as AgentBudgetTier, a as AgentCapability, b as AgentDefinition, c as AgentPhase, D as DEFAULT_DISPATCH_ROLE, d as DefaultMultiAgentCoordinator, e as DispatchCandidate, f as DispatchClassifier, g as DispatchMethod, h as DispatchOptions, i as DispatchResult, j as MultiAgentCoordinatorOptions, k as dispatchAgent, m as makeLLMClassifier, s as scoreAgents } from './multi-agent-coordinator-C7YbZUY8.js';
46
+ export { A as AgentFactory, a as AgentFactoryResult, b as AgentRunnerOptions, F as FleetBus, c as FleetEvent, d as FleetHandler, e as FleetUsage, f as FleetUsageAggregator, S as SubagentUsageSnapshot, m as makeAgentSubagentRunner } from './agent-subagent-runner-Cc8sRJOF.js';
46
47
  export { DefaultModeStore, LLMSelector, LLMSelectorOptions, ModeLoaderOptions, loadProjectModes, loadUserModes } from './models/index.js';
47
- export { AISpecBuilder, AISpecBuilderOptions, AISpecPhase, AISpecSession, AutoExecutor, AutoExecutorOptions, BottleneckTask, CollectedAnswer, CriticalPathAnalysis, DefaultTaskStore, ExecutionSummary, GeneratedTask, SPEC_TEMPLATES, SddParallelRun, SddParallelRunOptions, SddProgress, SddTaskDecomposer, SddTaskDecomposerOptions, SpecDiff, SpecDrivenDev, SpecDrivenDevOptions, SpecIndexEntry, SpecParser, SpecStore, SpecStoreOptions, SpecVersion, SpecVersioning, TaskBatch, TaskExecutionContext, TaskExecutionResult, TaskFlow, TaskFlowEventMap, TaskFlowEventName, TaskFlowExecutionContext, TaskFlowOptions, TaskFlowPhase, TaskGenerator, TaskGeneratorOptions, TaskGraphIndexEntry, TaskGraphStore, TaskGraphStoreOptions, TaskStore, TaskTracker, TaskTrackerOptions, TaskTransition, WaveResult, analyzeCriticalPath, createAutoExecutor, getTemplate, listTemplates, renderProgress, renderSpecAnalysis, renderTaskGraph, renderTaskList, templateToMarkdown } from './sdd/index.js';
48
+ import { TaskStore } from './sdd/index.js';
49
+ export { AISpecBuilder, AISpecBuilderOptions, AISpecPhase, AISpecSession, AutoExecutor, AutoExecutorOptions, BottleneckTask, CollectedAnswer, CriticalPathAnalysis, DefaultTaskStore, ExecutionSummary, GeneratedTask, SPEC_TEMPLATES, SddParallelRun, SddParallelRunOptions, SddProgress, SddTaskDecomposer, SddTaskDecomposerOptions, SpecDiff, SpecDrivenDev, SpecDrivenDevOptions, SpecIndexEntry, SpecParser, SpecStore, SpecStoreOptions, SpecVersion, SpecVersioning, TaskBatch, TaskExecutionContext, TaskExecutionResult, TaskFlow, TaskFlowEventMap, TaskFlowEventName, TaskFlowExecutionContext, TaskFlowOptions, TaskFlowPhase, TaskGenerator, TaskGeneratorOptions, TaskGraphIndexEntry, TaskGraphStore, TaskGraphStoreOptions, TaskTracker, TaskTrackerOptions, TaskTransition, WaveResult, analyzeCriticalPath, createAutoExecutor, getTemplate, listTemplates, renderProgress, renderSpecAnalysis, renderTaskGraph, renderTaskList, templateToMarkdown } from './sdd/index.js';
48
50
  export { DefaultHealthRegistry, InMemoryMetricsSink, MetricsServerHandle, MetricsServerOptions, NoopMetricsSink, NoopTracer, OTelTracer, OtlpMetricsExporterHandle, OtlpMetricsExporterOptions, OtlpTraceExporterHandle, OtlpTraceExporterOptions, PROMETHEUS_CONTENT_TYPE, buildOtlpMetricsRequest, buildOtlpTracesRequest, renderPrometheus, startMetricsServer, startOtlpMetricsExporter, startOtlpTraceExporter, wireMetricsToEvents } from './observability/index.js';
49
51
  export { C as ContextManagerAction, a as ContextManagerInput, b as ContextManagerResult, c as ContextManagerToolOptions, d as allServers, e as awsServer, f as blockServer, g as braveSearchServer, h as context7Server, i as contextManagerTool, j as createContextManagerTool, k as everArtServer, l as filesystemServer, m as githubServer, n as googleMapsServer, o as miniMaxVisionServer, s as sentinelServer, p as slackServer, z as zaiVisionServer } from './mcp-servers-n2L9ohMX.js';
50
52
  export { DownloadResult, InstallResult, InstalledSkillEntry, ManifestData, ParsedRef, SkillInstaller, SkillInstallerOptions, SkillManifestStore, UpdateResult, downloadGitHubTarball, parseSkillRef } from './skills/index.js';
@@ -911,6 +913,13 @@ interface PhaseEventMap {
911
913
  taskTitle: string;
912
914
  error: string;
913
915
  };
916
+ 'phase.taskRetrying': {
917
+ phaseId: string;
918
+ taskId: string;
919
+ taskTitle: string;
920
+ attempt: number;
921
+ maxRetries: number;
922
+ };
914
923
  'phase.allTasksDone': {
915
924
  phaseId: string;
916
925
  completed: number;
@@ -940,8 +949,14 @@ interface PhaseEventMap {
940
949
  }
941
950
  type PhaseEventName = keyof PhaseEventMap;
942
951
  interface PhaseExecutionContext {
943
- /** Bir görevi çalıştır — AI agent tarafından yapılır */
944
- executeTask: (task: TaskNode, phaseId: string) => Promise<unknown>;
952
+ /**
953
+ * Bir görevi çalıştır AI agent tarafından yapılır. `env`, fazın git
954
+ * worktree'sine (varsa) işaret eder; agent'ı izole çalışma dizininde koştur.
955
+ */
956
+ executeTask: (task: TaskNode, phaseId: string, env?: {
957
+ cwd?: string;
958
+ branch?: string;
959
+ }) => Promise<unknown>;
945
960
  /** Bir faz tamamlandığında çağrılır */
946
961
  onPhaseComplete?: (phase: PhaseNode) => void;
947
962
  /** Bir faz başarısız olduğunda çağrılır */
@@ -967,6 +982,12 @@ interface AutoPhaseOptions {
967
982
  stopOnFailure?: boolean;
968
983
  /** Event bus */
969
984
  events?: EventBus;
985
+ /**
986
+ * Opsiyonel git-worktree yöneticisi. Verilirse her faz kendi
987
+ * worktree+branch'inde izole çalışır ve tamamlanınca ana branch'e sıralı
988
+ * squash-merge edilir. Yoksa davranış değişmez (paylaşılan working tree).
989
+ */
990
+ worktrees?: WorktreeManager;
970
991
  }
971
992
  interface PhaseFilter {
972
993
  status?: PhaseStatus[];
@@ -1034,6 +1055,11 @@ declare class AutoPhaseRunner {
1034
1055
  private orchestrator;
1035
1056
  private opts;
1036
1057
  private progressInterval;
1058
+ private readonly graphCompletedHandler;
1059
+ private readonly graphFailedHandler;
1060
+ /** Stores the unsubscribe function returned by EventBus.on() */
1061
+ private unsubscribeCompleted;
1062
+ private unsubscribeFailed;
1037
1063
  constructor(opts: AutoPhaseRunnerOptions);
1038
1064
  start(): Promise<PhaseGraph>;
1039
1065
  pause(): void;
@@ -1078,12 +1104,23 @@ declare class PhaseOrchestrator {
1078
1104
  private paused;
1079
1105
  private runningPhases;
1080
1106
  private tickInterval;
1107
+ private trackerCache;
1108
+ private taskRetryCounts;
1109
+ private readonly worktrees?;
1110
+ /** Per-phase worktree handles, keyed by phase id. */
1111
+ private readonly phaseWorktrees;
1112
+ /** Serializes all merges back to the base branch (one at a time). */
1113
+ private mergeQueue;
1114
+ /** Per-phase merge promise, so a phase merges only after its deps do. */
1115
+ private readonly phaseMergePromise;
1081
1116
  constructor(opts: PhaseOrchestratorOptions);
1082
1117
  /**
1083
1118
  * Tüm faz akışını başlat.
1084
1119
  * Autonomous mode'da: kök faz(lar)ı başlatır, bitince sonrakini otomatik başlatır.
1085
1120
  */
1086
1121
  start(): Promise<void>;
1122
+ /** Bekleyen tüm faz merge'lerini (dep-sıralı + global seri) bekle. */
1123
+ private drainMerges;
1087
1124
  /** Duraklat — aktif fazlar çalışmaya devam eder ama yeni faz başlamaz */
1088
1125
  pause(): void;
1089
1126
  /** Devam et — yeni fazlar başlayabilir */
@@ -1092,6 +1129,17 @@ declare class PhaseOrchestrator {
1092
1129
  stop(): void;
1093
1130
  private tick;
1094
1131
  private startPhase;
1132
+ /**
1133
+ * Commit the phase's worktree changes, then enqueue the merge back into the
1134
+ * base branch. Merges run dependency-ordered (a phase merges only after its
1135
+ * `dependsOn` phases) and globally serialized (one at a time) to avoid
1136
+ * concurrent writes to the base tree.
1137
+ */
1138
+ private commitAndEnqueueMerge;
1139
+ /** Squash-merge one phase. Conflicts mark the worktree needs-review (run continues). */
1140
+ private mergeOne;
1141
+ /** A failed phase keeps its worktree on disk for inspection (no merge). */
1142
+ private keepWorktreeForReview;
1095
1143
  private executePhaseTasks;
1096
1144
  private executeSingleTask;
1097
1145
  private markTaskCompleted;
@@ -1114,6 +1162,7 @@ declare class PhaseOrchestrator {
1114
1162
  releaseAgent(phaseId: string, agentId: string): void;
1115
1163
  private emit;
1116
1164
  private createNoopEventBus;
1165
+ private delay;
1117
1166
  }
1118
1167
 
1119
1168
  interface PhaseGraphBuilderOptions {
@@ -1125,6 +1174,8 @@ interface PhaseGraphBuilderOptions {
1125
1174
  autonomous?: boolean;
1126
1175
  /** Başarısızlıkta dur */
1127
1176
  stopOnFailure?: boolean;
1177
+ /** Harici TaskStore (opsiyonel) */
1178
+ externalTaskStore?: TaskStore;
1128
1179
  }
1129
1180
  /**
1130
1181
  * PhaseGraphBuilder — Projeyi fazlara bölen ve her faz için task graph oluşturan builder.
@@ -1156,6 +1207,60 @@ declare class PhaseGraphBuilder {
1156
1207
  }): Promise<PhaseGraph>;
1157
1208
  }
1158
1209
 
1210
+ /**
1211
+ * AutoPhasePlanner — Bir hedefi (goal) gerçek bir LLM çağrısıyla faz faz,
1212
+ * her fazın altında bir sürü todo içeren büyük bir task listesine dönüştürür.
1213
+ *
1214
+ * SDD'nin spec→task akışına benzer ama farklı: burada çıktı doğrudan
1215
+ * `PhaseTemplate[]` — her faz `taskTemplates` taşır, böylece
1216
+ * `PhaseGraphBuilder` dolu bir `PhaseGraph` üretir ve `PhaseOrchestrator`
1217
+ * her görevi gerçek bir agent koşusuyla çalıştırır.
1218
+ *
1219
+ * Planner LLM'e bağımlı değildir: çağıran taraf bir `runOnce(prompt)` fonksiyonu
1220
+ * verir (CLI'de bu bir subagent koşusudur, testte bir stub olabilir).
1221
+ */
1222
+
1223
+ interface AutoPhasePlannerOptions {
1224
+ /**
1225
+ * Tek seferlik LLM çağrısı: prompt verir, modelin metin çıktısını döndürür.
1226
+ * CLI'de bir subagent.run sarmalayıcısıdır; testte deterministik stub.
1227
+ */
1228
+ runOnce: (prompt: string) => Promise<string>;
1229
+ /** Hedef/proje başlığı. */
1230
+ goal: string;
1231
+ /** package.json/dizin yapısı gibi opsiyonel proje bağlamı. */
1232
+ projectContext?: string;
1233
+ /** İstenen minimum faz sayısı (default 3). */
1234
+ minPhases?: number;
1235
+ /** İstenen maksimum faz sayısı (default 8). */
1236
+ maxPhases?: number;
1237
+ /** Faz başına hedeflenen todo sayısı (default 6). */
1238
+ todosPerPhase?: number;
1239
+ }
1240
+ interface AutoPhasePlanResult {
1241
+ /** PhaseGraphBuilder'a verilecek faz şablonları. */
1242
+ phases: PhaseTemplate[];
1243
+ /** Modelin ham çıktısı (debug/log için). */
1244
+ raw: string;
1245
+ /** JSON ayrıştırılamadıysa true; bu durumda `phases` boş döner. */
1246
+ parseFailed: boolean;
1247
+ }
1248
+ /**
1249
+ * AutoPhasePlanner — `plan()` çağrısı modeli sürer ve `PhaseTemplate[]` üretir.
1250
+ */
1251
+ declare class AutoPhasePlanner {
1252
+ private readonly opts;
1253
+ constructor(opts: AutoPhasePlannerOptions);
1254
+ /** Hedefi faz+todo planına dönüştür. */
1255
+ plan(): Promise<AutoPhasePlanResult>;
1256
+ /** Modelin üreteceği plan için talimat prompt'u. */
1257
+ buildPrompt(): string;
1258
+ /** Ham çıktıdan JSON'u çıkar, doğrula ve PhaseTemplate[]'e dönüştür. */
1259
+ parse(raw: string): PhaseTemplate[];
1260
+ private coercePhase;
1261
+ private coerceTask;
1262
+ }
1263
+
1159
1264
  interface PhaseStoreOptions {
1160
1265
  baseDir: string;
1161
1266
  }
@@ -1163,7 +1268,7 @@ interface PhaseStoreOptions {
1163
1268
  * PhaseStore — PhaseGraph'ı diske kaydeden ve yükleyen persistence katmanı.
1164
1269
  */
1165
1270
  declare class PhaseStore {
1166
- private baseDir;
1271
+ readonly baseDir: string;
1167
1272
  constructor(opts: PhaseStoreOptions);
1168
1273
  save(graph: PhaseGraph): Promise<void>;
1169
1274
  load(graphId: string): Promise<PhaseGraph | null>;
@@ -1200,6 +1305,7 @@ interface Checkpoint {
1200
1305
  interface CheckpointManagerOptions {
1201
1306
  store: PhaseStore;
1202
1307
  maxCheckpoints?: number;
1308
+ baseDir?: string;
1203
1309
  }
1204
1310
  /**
1205
1311
  * CheckpointManager — Phase graph'ın anlık görüntülerini alır ve geri yükler.
@@ -1214,12 +1320,17 @@ declare class CheckpointManager {
1214
1320
  private store;
1215
1321
  private maxCheckpoints;
1216
1322
  private checkpoints;
1323
+ private baseDir;
1217
1324
  constructor(opts: CheckpointManagerOptions);
1325
+ initialize(): Promise<void>;
1218
1326
  saveCheckpoint(graph: PhaseGraph, label?: string): Promise<Checkpoint>;
1219
1327
  restoreCheckpoint(checkpointId: string): Promise<PhaseGraph | null>;
1220
1328
  listCheckpoints(graphId?: string): Checkpoint[];
1221
- deleteCheckpoint(checkpointId: string): boolean;
1329
+ deleteCheckpoint(checkpointId: string): Promise<boolean>;
1330
+ private saveToDisk;
1331
+ private deleteFromDisk;
1332
+ private loadFromDisk;
1222
1333
  private pruneCheckpoints;
1223
1334
  }
1224
1335
 
1225
- export { AddAttachmentInput, AttachmentRef, AttachmentStore, type AutoPhaseOptions, AutoPhaseRunner, type AutoPhaseRunnerOptions, BuildContext, type Checkpoint, CheckpointManager, type CheckpointManagerOptions, Config, Container, ContentBlock, Context, type ContinueDirective, DefaultPluginAPI, DefaultSystemPromptBuilder, type DefaultSystemPromptBuilderOptions, type DetectedDependency, type DetectionResult, EventBus, EventName, ExtensionRegistry, type Finding, type FullScanResult, type GeneratedSecuritySkill, type GeneratedSkill, type GeneratedSkillContent, GitignoreUpdater, InputBuilder, type InputBuilderEvent, type InputBuilderOptions, KERNEL_API_VERSION, LAYER_1_IDENTITY, Listener, type LoadPluginsOptions, Logger, type MCPRegistryHandle, MCPRegistryView, MCPServerConfig, MemoryStore, MetricsSinkView, ModeStore, ModelCapabilities, type PackageManager, type PhaseEventMap, type PhaseEventName, type PhaseExecutionContext, type PhaseFilter, type PhaseGraph, PhaseGraphBuilder, type PhaseGraphBuilderOptions, type PhaseNode, PhaseOrchestrator, type PhaseOrchestratorOptions, type PhaseProgress, type PhaseSort, type PhaseStatus, PhaseStore, type PhaseStoreOptions, type PhaseTemplate, Plugin, PluginAPI, type PluginAPIInit, PluginPipelines, Provider, ProviderRegistry, ProviderRegistryView, ReportGenerator, type ReportOptions, type ScanOptions, type ScanResult, type ScanScope, type SecurityPattern, SecurityScanner, type SecurityScannerContext, type SecurityScannerOptions, SecurityScannerOrchestrator, SessionWriterView, type SeverityLevel, type SkillGenerationContext, SkillGenerator, type SkillGeneratorOptions, SkillLoader, SlashCommand, SlashCommandRegistry, SlashCommandRegistryView, SystemPromptBuilder, SystemPromptContributor, TaskGraph, TaskNode, TaskPriority, TaskType, type TechStack, TechStackDetector, type TechStackInfo, TextBlock, Tool, ToolRegistry, ToolRegistryView, buildBtwBlock, consumeBtwNotes, createAutoPhaseFromTaskGraph, createMcpControlTool, createSecuritySlashCommand, defaultGitignoreUpdater, defaultOrchestrator, defaultReportGenerator, defaultSecurityScanner, defaultSkillGenerator, defaultTechStackDetector, loadPlugins, makeContinueToNextIterationTool, parseContinueDirective, pendingBtwCount, securitySlashCommand, setBtwNote, unloadPlugins };
1336
+ export { AddAttachmentInput, AttachmentRef, AttachmentStore, type AutoPhaseOptions, type AutoPhasePlanResult, AutoPhasePlanner, type AutoPhasePlannerOptions, AutoPhaseRunner, type AutoPhaseRunnerOptions, BuildContext, type Checkpoint, CheckpointManager, type CheckpointManagerOptions, Config, Container, ContentBlock, Context, type ContinueDirective, DefaultPluginAPI, DefaultSystemPromptBuilder, type DefaultSystemPromptBuilderOptions, type DetectedDependency, type DetectionResult, EventBus, EventName, ExtensionRegistry, type Finding, type FullScanResult, type GeneratedSecuritySkill, type GeneratedSkill, type GeneratedSkillContent, GitignoreUpdater, InputBuilder, type InputBuilderEvent, type InputBuilderOptions, KERNEL_API_VERSION, LAYER_1_IDENTITY, Listener, type LoadPluginsOptions, Logger, type MCPRegistryHandle, MCPRegistryView, MCPServerConfig, MemoryStore, MetricsSinkView, ModeStore, ModelCapabilities, type PackageManager, type PhaseEventMap, type PhaseEventName, type PhaseExecutionContext, type PhaseFilter, type PhaseGraph, PhaseGraphBuilder, type PhaseGraphBuilderOptions, type PhaseNode, PhaseOrchestrator, type PhaseOrchestratorOptions, type PhaseProgress, type PhaseSort, type PhaseStatus, PhaseStore, type PhaseStoreOptions, type PhaseTemplate, Plugin, PluginAPI, type PluginAPIInit, PluginPipelines, Provider, ProviderRegistry, ProviderRegistryView, ReportGenerator, type ReportOptions, type ScanOptions, type ScanResult, type ScanScope, type SecurityPattern, SecurityScanner, type SecurityScannerContext, type SecurityScannerOptions, SecurityScannerOrchestrator, SessionWriterView, type SeverityLevel, type SkillGenerationContext, SkillGenerator, type SkillGeneratorOptions, SkillLoader, SlashCommand, SlashCommandRegistry, SlashCommandRegistryView, SystemPromptBuilder, SystemPromptContributor, TaskGraph, TaskNode, TaskPriority, TaskStore, TaskType, type TechStack, TechStackDetector, type TechStackInfo, TextBlock, Tool, ToolRegistry, ToolRegistryView, WorktreeManager, buildBtwBlock, consumeBtwNotes, createAutoPhaseFromTaskGraph, createMcpControlTool, createSecuritySlashCommand, defaultGitignoreUpdater, defaultOrchestrator, defaultReportGenerator, defaultSecurityScanner, defaultSkillGenerator, defaultTechStackDetector, loadPlugins, makeContinueToNextIterationTool, parseContinueDirective, pendingBtwCount, securitySlashCommand, setBtwNote, unloadPlugins };