/** * Diagram store — encapsulates the manage-diagram.mjs subprocess. * * CLI command handlers should call into this module rather than spawning * the script directly. Centralizes: * - script discovery (repo-local vs ~/.config/opencode) * - diagram file path resolution * - subprocess invocation with consistent stdio + timeout * - task-status → diagram-status namespace mapping */ import type { TaskStatus } from "./storage-utils.js"; export interface DiagramUpdateResult { diagramUpdated: boolean; diagramError?: string; } /** * Locate the manage-diagram.mjs script. Search order: * 1. Repo-local bundle (development checkout) * 2. OpenCode skill install (~/.config/opencode/skills/arcs/to-diagram/...) * 3. Claude Code skill install (~/.claude/skills/arcs-to-diagram/...) * * The Claude Code path uses the `arcs-` prefix because Claude Code skills * are flat under ~/.claude/skills/ — see scripts/deploy-claudecode-bundle.mjs. */ export declare function findDiagramScript(): string | undefined; export declare function resolveDiagramPath(slug: string, planId: string): string; /** * Run the manage-diagram.mjs script and return trimmed stdout. * Throws on non-zero exit; caller is responsible for error mapping. */ export declare function runDiagramScript(scriptPath: string, subcommand: string, diagramPath: string, extraArgs?: string[]): string; /** * Map task status (snake_case in the ARCS task model) to diagram classDef * status (camelCase in the Mermaid script). The two namespaces are * intentionally distinct — task statuses follow Python/JSON convention, * diagram statuses match the classDef identifiers. */ export declare function taskStatusToDiagramStatus(status: TaskStatus): string; /** * Best-effort diagram node status update. Returns a structured result * rather than throwing — callers expect this to fail gracefully when * the diagram or script is absent. */ export declare function attemptDiagramUpdate(slug: string, planId: string, nodeId: string, status: TaskStatus): DiagramUpdateResult; //# sourceMappingURL=diagram-store.d.ts.map