import { type AnyEvent } from "./events.js"; /** * v1.4.1 — reverse-lookup a Discord works-thread id → its workflow id, by * scanning each `/workflows//discord-thread.txt` (key=value, written * by discord-task-card `persistThreadRef`). Returns null if no thread matches. * * A linear scan is fine for now — an org has few active workflows. A thread_id→ * workflow index is a future optimisation (PRD v1.4.1 §결정 2). */ export declare function resolveWorkflowIdByThread(orgCwd: string, threadId: string): string | null; /** * v0.3.0 — workspace metadata helper. * * Shared utilities used by: * - workflow CLI (`solosquad workflow list / show`) * - workflow-reconciler.ts (which workflows exist, what state) * - PM SKILL.md (target_repo path resolution at spawn time) * * Phase B intentionally does NOT inject this into the PM prompt at * spawn time — PM is encouraged to read these files via its own * Read/Glob tools so the context stays small. workspace-meta just * exposes a typed read API for the CLIs. */ export interface StageSummary { id: string; status: string; agent?: string; target_repo?: string | null; depends_on?: string[]; } export interface WorkflowSummary { workflowId: string; title?: string; orgSlug: string; path: string; createdAt?: string; stages: StageSummary[]; /** Quick rollups computed from stages. */ totalStages: number; completedStages: number; pendingStages: number; inProgressStages: number; needsRevisionStages: number; recentEventCount: number; lastEventTs?: string; } /** List every workflow directory under `/workflows/`. */ export declare function listWorkflows(workspace: string, orgSlug: string): WorkflowSummary[]; export declare function loadWorkflowSummary(workspace: string, orgSlug: string, workflowId: string): WorkflowSummary | null; export declare function readEvents(workspace: string, orgSlug: string, workflowId: string): AnyEvent[]; /** * Resolve a target_repo slug to its absolute path (or fall back to the * org root). Used by the PM SKILL.md when building Task prompts. */ export declare function resolveTargetRepoPath(workspace: string, orgSlug: string, repoSlug: string | null | undefined): string; /** Path to the PRD.md of a workflow (may not exist yet). */ export declare function prdPath(workspace: string, orgSlug: string, workflowId: string): string; /** Path to the most recent stage's handoff. Used by `workflow show`. */ export declare function latestHandoffPath(workspace: string, orgSlug: string, workflowId: string): string | null;