export interface WorkflowStage { id: string; team?: string; agents?: string[]; target_repo?: string; status?: "pending" | "in_progress" | "completed" | "needs_revision"; depends_on?: string[]; upstream_handoff?: string; } export interface StatusYaml { workflow_id: string; project?: string; created_at?: string; stages: WorkflowStage[]; } /** * Find the first workflow in an org that has a stage currently in_progress * (or ready to run, i.e. pending with all deps completed). Returns the stage, * or null if none found. */ export declare function resolveActiveStage(orgDir: string): { workflowId: string; stage: WorkflowStage; } | null; /** * Resolve the cwd to use when spawning Claude for a *scheduler-driven* * cron in a given org (morning brief / signal scan / weekly review). * * Priority: * 1. Active workflow stage's `target_repo` (if the corresponding folder exists) * 2. First registered repo (tie-breaker — pre-v1.0.1 used role=main) * 3. Org root itself (no repos registered yet, or legacy `.git` at org root) * * v1.0.1: User-driven routing does NOT flow through this function. PM * session cwd is fixed at org root and target_repo is decided inside * the spawn prompt — by `@` mention (mention-parser.ts), workflow * stage `target_repo`, or PM clarifying question. See `src/bot/index.ts` * and `agents/main/chief/SKILL.md`. */ export declare function resolveOrgCwd(orgDir: string): { cwd: string; reason: "workflow" | "first-repo" | "legacy-root"; workflowId?: string; repoSlug?: string; };