import { type OrchestrationEngine } from './engine.js'; export type { OrchestrationEngine } from './engine.js'; import type { WorkstreamIsolation } from './types.js'; import { AdaptivePlanner } from '../core/adaptive-planner.js'; import type { ConfigManager } from '../config/manager.js'; import type { AgentManager } from '../tools/agent/index.js'; import type { RuntimeEventBus } from '../runtime/events/index.js'; export interface WorkstreamServicesDeps { readonly agentManager: Pick; readonly configManager: Pick; readonly adaptivePlanner: AdaptivePlanner; readonly runtimeBus: RuntimeEventBus; readonly projectRoot: string; } export type { WorkstreamDraft, WorkstreamDraftProvenance } from './workstream-draft-types.js'; import type { WorkstreamDraft } from './workstream-draft-types.js'; /** `ctx.session.workstreamEngine`'s real shape: the live engine plus the draft-proposal bookkeeping the engine itself has no concept of. */ export interface WorkstreamCommandService { readonly engine: OrchestrationEngine; /** Spawn a bounded read-only planning agent to decompose the goal (with automatic heuristic fallback), then hold the draft. Async because the planning agent is real. `isolation` omitted ⇒ the engine's own default ('shared'); see CreateWorkstreamInput.isolation. */ proposeDraft(task: string, isolation?: WorkstreamIsolation): Promise; getDraft(id: string): WorkstreamDraft | undefined; listDrafts(): WorkstreamDraft[]; /** Re-derive a held draft's spec + decomposition from a new task string. Clears any prior approval, an edit must be re-approved. `isolation` omitted ⇒ keeps the draft's current choice (an edit that only changes the task text must not silently reset isolation back to shared). */ editDraft(id: string, task: string, isolation?: WorkstreamIsolation): Promise; /** * Plan-review-gate item edits over a held draft's launchable spec (see * workstream-draft-edits.ts). Each returns the updated draft on success, * `{ error }` with an honest user-facing reason on a bad reference/argument, * or `undefined` when no draft with that id is held. Every successful edit * clears approval, a reshaped plan must be re-approved before launch. */ editItem(id: string, itemRef: string, brief: string): WorkstreamDraft | { error: string; } | undefined; removeItem(id: string, itemRef: string): WorkstreamDraft | { error: string; } | undefined; moveItem(id: string, itemRef: string, toPosition: number): WorkstreamDraft | { error: string; } | undefined; approveDraft(id: string): WorkstreamDraft | undefined; removeDraft(id: string): boolean; /** Materialize an approved draft into a real, running Workstream (engine.createWorkstream + start), then drop the draft. Null when the draft is missing or not approved. */ launchDraft(id: string): { workstreamId: string; } | null; } export interface WorkstreamServices { readonly orchestrationEngine: OrchestrationEngine; readonly workstreamCommands: WorkstreamCommandService; } /** * Constructs one OrchestrationEngine instance and its command-facing facade. * `persist` and `createWorktree` are left at the engine's own defaults: * journal-backed snapshots under .goodvibes/orchestration/ (so resumeAllFromDisk * below has something to resume) and a plain AgentWorktree(projectRoot) for the * (default) `shared`-isolation path. A draft's `isolation: 'worktree'` opts a * single workstream into per-item git-worktree isolation * (WorktreeIsolationManager, engine-side) instead, the engine, not this facade, * owns that lifecycle. */ export declare function createWorkstreamServices(deps: WorkstreamServicesDeps): WorkstreamServices; //# sourceMappingURL=workstream-services.d.ts.map