/** * flow-discovery.ts — multi-root flow discovery for the CLI. * * Walks every {@link aiResourceRoots} root (the project's own `.skaile/` install * root, bundled factory-assets when installed / the monorepo `ai-assets/` in dev, * `~/.skaile/libraries/`, and the global `~/.skaile/` install root) through the * layout-tolerant `loadAllFlowEntries`, so an installed flow and a built-in flow * are discovered the same way. De-duplicated by flow id (first root wins). * * A flow's identity is its declared `id` — never its filename. Listing and * resolution therefore run over the same enumeration, so on the shared roots what * `flow list` prints is exactly what `run` can start. Both entry points take the * same optional `projectDir`: pass the *same* value to both, or a `--project-dir` * run can start a flow the matching list never showed. * * Listing is a documented **subset** of resolution, not a divergent set: every * root here is also a `flowLookupRoots` root, and that function adds exactly one * more — the project's own `ai-assets/` tree, which `run` prepends and * `discoverFlows` never sees, so a flow living only there is runnable but * unlisted. Closing that gap means teaching listing the same upward walk — * tracked separately, not papered over here. */ import { loadAllFlowEntries } from "@skaile/workspaces/factory-assets/connectors/flow/engine"; type FlowDefinition = ReturnType[number]["flow"]; /** * All flows across every content root, de-duplicated by id. * * @param projectDir - Project whose `.skaile/` install root to include * (default: `process.cwd()`). */ export declare function discoverFlows(projectDir?: string): FlowDefinition[]; /** * Locate the on-disk file of the flow **whose declared `id`** is `flowId`, * across every content root, both content-root layouts (`/flows/` and * `//flows/`), and both flow layouts (flat and per-flow directory). * * A thin binding of the shared `findFlowFileInRoots` to the CLI's root order — * the same lookup `resume`, sub-flow targets and `serve` run, so what `run` * starts is what those can later find. * * `priorityRoots` are searched before the standard {@link aiResourceRoots} so a * project-local `ai-assets/` tree can override a built-in flow. * * @param projectDir - Project whose `.skaile/` install root to include * (default: `process.cwd()`). Must match the one passed to * {@link discoverFlows} for "listed" and "runnable" to stay the same set. */ export declare function findFlowFile(flowId: string, priorityRoots?: string[], projectDir?: string): string | undefined; export {}; //# sourceMappingURL=flow-discovery.d.ts.map