import type { WorkflowDefinition } from "../flow/types.ts"; export { WORKFLOW_SUFFIX } from "./load-workflow.ts"; /** Which catalog layer a discovered workflow was installed in (spec §6.8). */ export type WorkflowScope = "project" | "global"; /** A discovered workflow: its installed identity plus metadata loaded for catalog views. */ export interface WorkflowEntry { /** The source filename without `.workflow.ts`; canonical for completion, lookup, and new runs. */ readonly identity: string; /** The definition's authored name. Retained as definition metadata; it is not a command selector. */ readonly name: string; readonly description?: string; readonly filePath: string; /** Which layer installed this file: the project's own catalog, or the user's global directory. */ readonly scope: WorkflowScope; } /** A file in a workflows directory that failed to load — surfaced rather than silently skipped. */ export interface BrokenWorkflow { readonly filePath: string; readonly error: string; } export interface WorkflowCatalog { readonly entries: readonly WorkflowEntry[]; readonly broken: readonly BrokenWorkflow[]; } /** * Cheap, load-free enumeration used by completion and missing-workflow diagnostics. Merged across * both layers and deduped by identity, so a suggestion always names a file the command will load. */ export declare function listWorkflowIdentities(projectRoot: string, globalDir?: string): Promise; /** * Load every workflow the project and the user's global directory define, sorted by name; the * project's file shadows a same-identity global one. A file that throws is reported in `broken` * instead of failing the whole catalog — one unparseable workflow must not make `/workflow list` * useless. A missing directory is simply an empty layer. */ export declare function discoverWorkflows(projectRoot: string, globalDir?: string): Promise; /** A resolved workflow, or a human-readable reason it could not be resolved. */ export type WorkflowResolution = { ok: true; workflow: WorkflowDefinition; filePath: string; } | { ok: false; error: string; }; /** * Resolve `/workflow run ` by explicit TypeScript path or installed filename identity. Declared * definition names are intentionally absent from this namespace: the exact selected file is validated, * loaded once, and its root runtime name is bound to the filename-derived identity. Identity lookup * checks the project layer first, then the global one — a project file always wins (spec §6.8). */ export declare function resolveWorkflow(projectRoot: string, arg: string, globalDir?: string): Promise; //# sourceMappingURL=workflow-catalog.d.ts.map