/** * Orchestrator commands - coordinate multi-agent workflows. * @task T4466 * @epic T4454 */ import type { Task, TaskRef } from '@cleocode/contracts'; import type { DataAccessor } from '../store/data-accessor.js'; import { type SpawnTier } from './spawn-prompt.js'; export type { CircularDependency, DependencyAnalysis, MissingDependency } from './analyze.js'; export { analyzeDependencies, buildDependencyGraph, detectCircularDependencies, findMissingDependencies, } from './analyze.js'; export type { AtomicityErrorCode, AtomicityInput, AtomicityResult, } from './atomicity.js'; export { AtomicityViolationError, checkAtomicity, MAX_WORKER_FILES } from './atomicity.js'; export type { ClassifyOptions, ClassifyResult } from './classify.js'; export { CLASSIFY_CONFIDENCE_FLOOR, CLASSIFY_FALLBACK_AGENT_ID, classifyTask, getRegisteredAgentIds, validateClassifierRules, } from './classify.js'; export type { GrillTrigger, ReadinessResult, ReadinessSignals, ReadinessVerdict, } from './classify-readiness.js'; export { classifyReadiness } from './classify-readiness.js'; export type { ContextEstimation } from './context.js'; export { countManifestEntries, estimateContext } from './context.js'; export type { DashboardRateMetric, OrchestrateDashboardMetrics } from './dashboard.js'; export { collectOrchestrateDashboard, formatDashboardPromptSummary } from './dashboard.js'; export type { HarnessHint, HarnessHintResult, HarnessProfile, ResolveHarnessHintOptions, } from './harness-hint.js'; export { DEDUP_EMBED_CHARS, loadHarnessProfile, persistHarnessProfile, resolveHarnessHint, } from './harness-hint.js'; export type { ComposeSpawnPayloadOptions, SpawnPayload, SpawnPayloadMeta, SpawnPayloadPersonaMeta, SpawnPayloadThinAgentMeta, } from './spawn.js'; export { composeSpawnPayload } from './spawn.js'; export type { BuildSpawnPromptInput, BuildSpawnPromptResult, SpawnProtocolPhase, SpawnTier, } from './spawn-prompt.js'; export { ALL_SPAWN_PROTOCOL_PHASES, buildSpawnPrompt, DEFAULT_SPAWN_TIER, resetSpawnPromptCache, resolvePromptTokens, slugify as slugifyTaskTitle, } from './spawn-prompt.js'; export type { EpicStatus, OverallStatus, ProgressMetrics, StartupSummary, StatusCounts, } from './status.js'; export { computeEpicStatus, computeOverallStatus, computeProgress, computeStartupSummary, countByStatus, } from './status.js'; export type { ThinAgentEnforcementMode, ThinAgentFail, ThinAgentOk, ThinAgentResult, } from './thin-agent.js'; export { E_THIN_AGENT_VIOLATION, enforceThinAgent, THIN_AGENT_SPAWN_TOOLS, } from './thin-agent.js'; export type { SpawnTierValue, TierSelectInput } from './tier-selector.js'; export { resolveEffectiveTier, selectTier } from './tier-selector.js'; /** Orchestrator session state. */ export interface OrchestratorSession { epicId: string; startedAt: string; status: 'active' | 'paused' | 'completed'; currentWave: number; completedTasks: string[]; spawnedAgents: string[]; } /** * Internal orchestrator spawn context for a subagent. * * @remarks * Distinct from the adapter-layer `SpawnContext` in `@cleocode/contracts` * (`{ taskId, prompt, workingDirectory?, options? }`). This type carries the * richer orchestration metadata (protocol, tokenResolution) used internally * by `prepareSpawn` and the skill dispatch layer before it is converted to the * contracts-level shape at the adapter boundary. * * T1719: renamed from `SpawnContext` → `OrchestratorSpawnContext` to eliminate * the name collision with `@cleocode/contracts#SpawnContext`. * * @task T1719 — shape-divergence reconciliation */ export interface OrchestratorSpawnContext { taskId: string; protocol: string; prompt: string; tokenResolution: { fullyResolved: boolean; unresolvedTokens: string[]; }; /** Optional compiled CANT agent definition attached by `cleo orchestrate spawn`. */ agentDef?: unknown; } /** Task readiness assessment. */ export interface TaskReadiness { taskId: string; title: string; /** The task's declared priority level. */ priority: string; /** * All declared dependency IDs for this task (the full `depends` array). * * Distinct from `blockers`, which contains only the subset of deps that are * not yet complete. This field carries the complete declared set so callers * can render the full dependency chain regardless of completion state. */ depends: string[]; ready: boolean; blockers: string[]; protocol: string; } /** Orchestrator analysis result. */ export interface AnalysisResult { epicId: string; totalTasks: number; waves: Array<{ wave: number; tasks: TaskRef[]; }>; readyTasks: string[]; blockedTasks: string[]; completedTasks: string[]; } /** * Start an orchestrator session for an epic. * @task T4466 */ export declare function startOrchestration(epicId: string, _cwd?: string, accessor?: DataAccessor): Promise; /** * Analyze an epic's dependency structure. * @task T4466 */ export declare function analyzeEpic(epicId: string, cwd?: string, accessor?: DataAccessor): Promise; /** * Get parallel-safe ready tasks for an epic. * @task T4466 */ export declare function getReadyTasks(epicId: string, _cwd?: string, accessor?: DataAccessor): Promise; /** * Get the next task to work on for an epic. * @task T4466 */ export declare function getNextTask(epicId: string, cwd?: string, accessor?: DataAccessor): Promise; /** * Prepare a spawn context for a subagent. * * Delegates prompt construction to the canonical * {@link buildSpawnPrompt} in `./spawn-prompt.ts`. The prompt is fully * self-contained (see {@link SpawnProtocolPhase}, {@link SpawnTier}). * * @task T4466 * @task T882 * @task T883 */ export declare function prepareSpawn(taskId: string, cwd?: string, accessor?: DataAccessor, options?: { tier?: SpawnTier; sessionId?: string | null; }): Promise; /** * Validate a subagent's output. * @task T4466 */ export declare function validateSpawnOutput(_taskId: string, output: { file?: string; manifestEntry?: boolean; }): Promise<{ valid: boolean; errors: string[]; }>; /** * Get orchestrator context summary. * @task T4466 */ export declare function getOrchestratorContext(epicId: string, _cwd?: string, accessor?: DataAccessor): Promise<{ epicId: string; epicTitle: string; totalTasks: number; completed: number; inProgress: number; blocked: number; pending: number; completionPercent: number; }>; /** * Auto-dispatch: determine the protocol for a task based on metadata. * @task T4466 */ export declare function autoDispatch(task: Task): string; /** * Resolve tokens in a prompt string. * * Retained as a thin alias over the canonical {@link resolvePromptTokens} so * existing callers (tests, CLI helpers) keep working. New code should import * `resolvePromptTokens` from `./spawn-prompt.js` directly. * * @task T4466 * @task T882 */ export declare function resolveTokens(prompt: string, context: Record): { resolved: string; unresolved: string[]; }; export type { ConduitStatusMessage, RollupWaveStatusOptions } from './lead-rollup.js'; export { resolveLeadRollupMode, rollupEpicStatus, rollupWaveStatus } from './lead-rollup.js'; //# sourceMappingURL=index.d.ts.map