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.
82 lines • 4.31 kB
TypeScript
import { type ProjectRecord } from '../registry.js';
import { type FrameworkFileConfig } from '../config.js';
import { type AgentMeta } from '../store/index.js';
import type { ProjectError } from '../project-errors.js';
/**
* The multi-project read side (#392): projects the daemon serves come from the registry (#390),
* and every read resolves a project id to that project's path before running the per-cwd reader
* underneath. One daemon serves them all; it runs one agent at a time per project (#393).
*/
/** One project's summary for the Projects sidebar (#314). */
export interface ProjectSummary {
/** Registry id (stable, URL-safe). */
id: string;
/** Absolute repo path. */
path: string;
/** Display name (the path's basename). */
name: string;
/** True when the repo still has its `.the-framework/` marker. */
activated: boolean;
/** ISO timestamp of the project's newest activity: its most recent session. */
lastActivityAt?: string;
/**
* The repo's committed run defaults from `the-framework.yml` (#842), so the launcher can show
* what an agent there will actually resolve to. Read fresh on every summarize, which is what keeps
* it current after an edit; absent when the repo sets nothing (or the file is malformed, which
* {@link loadFrameworkConfig} reports as empty rather than failing).
*/
fileConfig?: FrameworkFileConfig;
/**
* What the daemon's background jobs currently find wrong with the project (#1500), oldest
* first — absent when nothing is. Not part of the summary itself: the dashboard's project
* list attaches it from the daemon's error state.
*/
errors?: ProjectError[];
}
/**
* A projection over the registered projects, together with the projects it could actually see.
*
* A project whose sources cannot be read contributes no items — which is exactly what a project
* with nothing waiting contributes. `whole` is what tells the two apart (#1623). Only a caller
* that keeps a baseline of what it has already announced needs the distinction; the panels that
* simply render the list read `items` and ignore it.
*/
export interface ProjectionRead<T> {
/** What was found. Possibly only part of it, when some project could not be read. */
items: T[];
/** The ids of the projects every source answered for, so their share of `items` is all of it. */
whole: string[];
}
/** Injectable readers so {@link summarizeProject} is unit-testable off disk. */
export interface SummarizeDeps {
isActivated?: (path: string) => Promise<boolean>;
/** The project's runs (live + archived), newest-first. Defaults to {@link readAllAgents}. */
readAgents?: (path: string) => Promise<AgentMeta[]>;
/** The repo's `the-framework.yml` (#842). Defaults to {@link loadFrameworkConfig}. */
readFileConfig?: (path: string) => Promise<FrameworkFileConfig>;
}
/** A project's runs, live prepended to the archived history. Forgiving: a failed read is `[]`. */
/**
* Derive a {@link ProjectSummary} from a registry record: its display name, whether
* it is still activated, and its last activity. Forgiving: a failed read reads as an
* inactive project with no activity, never a throw.
*
* Activity is the sessions themselves (B3). It used to be the newest of those and the latest
* `LOGS.md` entry — a committed markdown re-narration of the same sessions, which could only ever
* be older than the agent it described.
*/
export declare function summarizeProject(record: ProjectRecord, deps?: SummarizeDeps): Promise<ProjectSummary>;
/**
* Reads the registry to serve the multi-project endpoints. The dashboard server
* holds one of these; the daemon uses the default (the real registry), tests pass
* a fake so the server is exercised without touching the user's registry.
*/
export interface ProjectsProvider {
/** Every registered project, summarized, for the projects read. */
list(): Promise<ProjectSummary[]>;
/** The absolute path for a registry id, or `undefined` when unknown. */
resolvePath(id: string): Promise<string | undefined>;
}
/** A {@link ProjectsProvider} backed by the global registry (#390). */
export declare function defaultProjectsProvider(): ProjectsProvider;
//# sourceMappingURL=projects.d.ts.map