framework
Version:
The (AI) Framework: turnkey, zero-config AI orchestration that wraps a coding-agent CLI (Claude Code) as a black box and takes you from an idea to a running app. Vite for AI.
33 lines • 2.24 kB
TypeScript
/**
* The checkout a run id resolves to (#738/#797): the run's own worktree while it exists, else
* the project root. Live metas first — a running run records its cwd — then the worktree
* directory itself, which exists before the run has written its `run.json` (#766): the daemon
* creates the directory and spawns the process, and only then does the run write its meta, so
* a lookup by run state alone misses a run that certainly exists.
*
* The directory probe matters beyond a slow first read: a Telefunc Channel resolves its path
* once, when the client subscribes. Falling back to the project root would not self-correct a
* moment later — the channel would tail the wrong file for the life of the subscription, which
* is how a newly started run once showed a previous run's output.
*
* An unknown or finished `runId` falls back to the project root rather than failing: the
* run's worktree may already be gone, and the project's own state is still the sane thing to
* act on. This is the one resolution every run-addressed surface shares — the daemon's serve
* targets and previews, and each dashboard RPC — so the fallback rules cannot drift apart.
*/
export declare function resolveRunCheckout(projectCwd: string, runId: string | undefined): Promise<string>;
/**
* The events journal a run-scoped subscribe should tail (#1472). Follows
* {@link resolveRunCheckout}'s order — live meta cwd, then the worktree — but where that
* resolution would fall back to the project root, an ended run's **archived** `<id>.jsonl`
* wins: the archive existing proves the run ended, and it is the run's own record, where the
* root journal belongs to whatever root run wrote it last. The root journal stays the final
* fallback for the no-archive residue, so a just-starting root run (no meta yet, #766, and no
* worktree to probe) streams exactly as before.
*
* Only the events tails resolve here; every other run-addressed surface keeps
* {@link resolveRunCheckout}'s root fallback, where the project's own state is the sane
* thing to act on.
*/
export declare function resolveRunEventsPath(projectCwd: string, runId: string | undefined): Promise<string>;
//# sourceMappingURL=run-checkout.d.ts.map