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.03 kB
TypeScript
import type { PreviewHandlers } from './dashboard/telefunc-serve.js';
/** Inputs to {@link createPreviewRuntime}. */
export interface PreviewRuntimeOptions {
/** The daemon's home id, so a request with no project id targets the home workspace. */
homeId: string;
/** Resolve a project id to its checkout path (or the home `cwd`); shared with the run runtime. */
resolveProject: (id: string | undefined) => Promise<string | undefined>;
}
/** The preview surface the dashboard drives, plus the teardown that outlives the daemon. */
export interface PreviewRuntime {
/** The Preview handler set (#475/#797), handed to the dashboard as one value so `runId` survives. */
preview: PreviewHandlers;
/** Stop every live preview so their dev servers do not outlive the daemon (#475). */
dispose: () => Promise<void>;
}
/**
* On-demand app preview (#475), one long-lived preview process per project (plus one per session that
* asks, #797), kept alive across the request that opens it and the Stop that closes it. Split out of
* the project runtime because it shares nothing with the run half but the project resolver and the
* key scheme: previews know nothing about runs, and the run half reaches in only to stop a finished
* run's preview.
*
* Track a preview under its key and evict it the moment it stops serving (stop, or a self-exit: crash
* / build error / the user killing it), so status never reports a dead URL and the idempotent open
* below never hands back a corpse instead of restarting.
*
* Since #797 the key carries the session too, because a session serves its OWN worktree: one preview
* per project as before, plus one per session that asks for it, each pointing at the tree it belongs
* to. Keyed by project alone, a session's Serve booted the project's checkout and showed you code
* that session never wrote.
*/
export declare function createPreviewRuntime({ homeId, resolveProject }: PreviewRuntimeOptions): PreviewRuntime;
//# sourceMappingURL=preview-runtime.d.ts.map