/** * Orchestrate Lifecycle Operations * * Startup, bootstrap, criticalPath, unblockOpportunities, check, * skillInject, and parallel wrappers migrated from * packages/cleo/src/dispatch/engines/orchestrate-engine.ts. * * @task T1570 * @task T4478 * @task T4632 * @task T1634 — LOOM auto-init helper */ import type { BrainState } from '@cleocode/contracts'; import { type EngineResult } from '../engine-result.js'; export type { EngineResult }; /** * Idempotently initialize the LOOM (RCASD-IVTR) lifecycle pipeline for an * epic at the 'research' stage. * * This is the canonical LOOM-init primitive shared by `orchestrateStartup` * (called via `cleo orchestrate start`) and the `addTask` epic creation hook * (T1634 — LOOM auto-init for new epics). Extracted to eliminate duplication * and ensure a single source of truth for the initialization invariant. * * Behaviour: * - If no pipeline exists for `epicId`, creates one at 'research/in_progress'. * - If a pipeline already exists, this is a no-op — returns `{ initialized: false }`. * - Never throws; failures are swallowed so callers (especially fire-and-forget hooks) * can treat this as best-effort. Errors are returned via the result shape. * * @param epicId - Epic task ID to initialize LOOM for. * @param projectRoot - Project root path for DB resolution. * @returns Result indicating whether LOOM was freshly initialized. * @task T1634 */ export declare function initLoomForEpic(epicId: string, projectRoot: string): Promise<{ initialized: boolean; alreadyInitialized: boolean; error?: string; }>; /** * orchestrate.startup - Initialize orchestration for an epic. * * Auto-initializes the RCASD-IVTR lifecycle at the 'research' stage if the * epic has not already been initialized. This is idempotent — a second call * detects the existing pipeline and skips re-initialization. * * Result data includes: * - `autoInitialized` — true if this call created the lifecycle pipeline * - `currentStage` — 'research' when newly initialized, 'already-initialized' otherwise * * @param epicId - Epic to initialize orchestration for. * @param projectRoot - Optional project root path. * @returns Engine result with startup data. * @task T4478 * @task T785 */ export declare function orchestrateStartup(epicId: string, projectRoot?: string): Promise; /** * orchestrate.bootstrap - Load brain state for agent bootstrapping * * @param projectRoot - Optional project root path. * @param params - Bootstrap options including speed mode. * @returns Engine result with brain state data. * @task T4478 * @task T4657 */ export declare function orchestrateBootstrap(projectRoot?: string, params?: { speed?: 'fast' | 'full' | 'complete'; }): Promise>; /** * orchestrate.critical-path - Find the longest dependency chain * * @param projectRoot - Optional project root path. * @returns Engine result with critical path data. * @task T4478 */ export declare function orchestrateCriticalPath(projectRoot?: string): Promise; /** * orchestrate.unblock-opportunities - Analyze dependency graph for unblocking opportunities * * @param projectRoot - Optional project root path. * @returns Engine result with unblock opportunities data. * @task T4478 */ export declare function orchestrateUnblockOpportunities(projectRoot?: string): Promise; /** * orchestrate.parallel - Manage parallel execution (start/end) * * @param action - Action to perform: 'start' or 'end'. * @param epicId - Epic to manage parallel execution for. * @param wave - Wave number (required for both start and end). * @param projectRoot - Optional project root path. * @returns Engine result with parallel execution data. * @task T4632 */ export declare function orchestrateParallel(action: 'start' | 'end', epicId: string, wave?: number, projectRoot?: string): Promise; /** * orchestrate.parallel.start - Start parallel execution for a wave * * @param epicId - Epic to start parallel execution for. * @param wave - Wave number to start. * @param projectRoot - Optional project root path. * @returns Engine result with parallel start data. * @task T4632 */ export declare function orchestrateParallelStart(epicId: string, wave: number, projectRoot?: string): Promise; /** * orchestrate.parallel.end - End parallel execution for a wave * * @param epicId - Epic to end parallel execution for. * @param wave - Wave number to end. * @param projectRoot - Optional project root path. * @returns Engine result with parallel end data. * @task T4632 */ export declare function orchestrateParallelEnd(epicId: string, wave: number, projectRoot?: string): Promise; /** * orchestrate.check - Check current orchestration state * * @param projectRoot - Optional project root path. * @returns Engine result with orchestration check data. * @task T4632 */ export declare function orchestrateCheck(projectRoot?: string): Promise; /** * orchestrate.skill.inject - Read skill content for injection into agent context * * @param skillName - Name of the skill to inject. * @param projectRoot - Optional project root path. * @returns Engine result with skill content data. * @task T4632 */ export declare function orchestrateSkillInject(skillName: string, projectRoot?: string): EngineResult; //# sourceMappingURL=lifecycle-ops.d.ts.map