UNPKG

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.

138 lines 7.14 kB
import { type LiveAgent, type AgentMeta, type AgentStatus } from '../store/index.js'; import type { ProjectSummary } from './projects.js'; import { type ProjectQueue } from './queue.js'; import { type WorkspaceTicket } from './tickets.js'; /** One project's in-flight run, surfaced in the Overview's "working now" list. */ export interface ActiveAgent { projectId: string; projectName: string; /** Which run this is (#738): a project can have several in flight, one per worktree. */ agentId: string; /** The agent's own checkout, so its git/file status is read from the worktree it edits (#738). */ cwd: string; status: AgentStatus; /** What the user asked to build (the agent's `scope` event). */ intent?: string; scope?: string; /** ISO timestamp of the agent's last event. */ updatedAt?: string; /** The session name the agent chose (#326), when it set one. */ sessionName?: string; /** Whether the agent signalled `setReadyForMerge()` (#326): drives the building/ready dot. */ readyForMerge?: boolean; } /** One recently active project, most-recent first. */ export interface RecentProject { projectId: string; projectName: string; lastActivityAt?: string; } /** The cross-project Overview payload. */ export interface Overview { /** Projects with a running agent, most-recently-updated first. */ active: ActiveAgent[]; /** Total open TODO items across every project. */ queueOpen: number; /** The most recently active projects (capped). */ recent: RecentProject[]; } /** One recent session, tagged with the project it belongs to, for the cross-project rail. */ export interface RecentAgent { projectId: string; projectName: string; agent: AgentMeta; } /** Injectable reader so {@link buildRecentAgents} is unit-testable off disk. */ export interface RecentAgentsDeps { agents?: (cwd: string) => Promise<AgentMeta[]>; } /** * Every project's sessions pooled and sorted newest-first (capped), so the shared sidebar (#shared- * shell) can show recents on the home/Overview where no single project is selected. Each row carries * the project it belongs to, so selecting it jumps into that project's session. Forgiving — a project * whose agents cannot be read simply contributes nothing. */ export declare function buildRecentAgents(projects: ProjectSummary[], deps?: RecentAgentsDeps): Promise<RecentAgent[]>; /** One project's tickets, for the cross-project Tickets page (#1144). */ export interface ProjectTickets { projectId: string; projectName: string; tickets: WorkspaceTicket[]; } /** Injectable reader so {@link collectAllTickets} is unit-testable off disk. */ export interface AllTicketsDeps { tickets?: (cwd: string) => Promise<WorkspaceTicket[]>; } /** * Every registered project's tickets, one list per project (#1144) — the cross-project Tickets * page. Unlike {@link buildHotTickets} this does not pool or bucket: a ticket belongs to one * project, and the page's whole point is reading each project's backlog (and reaching its own * import/update) rather than one merged feed. Kept in registry order, project included even when * its list comes back empty, so import stays reachable there — the same read failing simply * leaves that project's list empty rather than dropping the section. */ export declare function collectAllTickets(projects: ProjectSummary[], deps?: AllTicketsDeps): Promise<ProjectTickets[]>; /** Which lane of the "hot tickets" overview (#1139) a ticket sits in. */ export type HotBucket = 'in-progress' | 'ai-queue' | 'high-priority'; /** One ticket surfaced on the Overview's hot-tickets card, tagged with its project and lane. */ export interface HotTicket { projectId: string; projectName: string; bucket: HotBucket; ticket: WorkspaceTicket; /** * An agent is implementing this ticket right now (#1117): its id, for the card to link into. * * The difference between "someone planned this at some point" and "this is being coded as you * look at it", which the plan/spike proxy could not tell apart. Only set for a ticket a live agent * actually recorded (`AgentMeta.ticket`), so absent still means the lane was inferred. */ agentId?: string; } /** * A ticket's lane (#1139), or null when it is in none of the three the card shows: * - in-progress: an agent is implementing it right now (#1117), or failing that the agent has * planned it, so work is under way in the older, inferred sense. * - ai-queue: it sits in the AI Queue — an open `TODO_AGENTS.md` entry links to it — so the * framework will pick it up on its own. * - high-priority: none of the above, but flagged high priority; what a human would likely queue next. * * Precedence follows that order: work already under way outranks a queued ticket, which outranks a * bare priority flag. Everything else is dropped — the card is a shortlist, not the whole backlog. * * `implementing` is the only hard evidence and exists for a drain agent only, so the plan proxy * still carries every ticket someone is working by hand. */ export declare function ticketBucket(ticket: WorkspaceTicket, opts?: { implementing?: boolean; queued?: boolean; }): HotBucket | null; /** Injectable readers so {@link buildHotTickets} is unit-testable off disk. */ export interface HotTicketsDeps { tickets?: (cwd: string) => Promise<WorkspaceTicket[]>; /** The project's live agents, read for the ticket each one recorded (#1117). */ liveAgents?: (cwd: string) => Promise<LiveAgent[]>; /** The cross-project TODO queue, for the AI-Queue lane (#1139). Defaults to {@link collectQueue}. */ queue?: (projects: ProjectSummary[]) => Promise<ProjectQueue[]>; } /** * Every project's tickets pooled and bucketed for the Overview's "hot tickets" card (#1139): what is * being worked on (implementing/planned), what sits in the AI Queue (an open `TODO_AGENTS.md` * entry links to it), and what is merely flagged high priority. Ordered lane-first (in-progress, * ai-queue, high-priority), file order within a lane; a ticket in none of the three is dropped. * Forgiving — a project whose tickets cannot be read simply contributes nothing. */ export declare function buildHotTickets(projects: ProjectSummary[], deps?: HotTicketsDeps): Promise<HotTicket[]>; /** Injectable readers so {@link buildOverview} is unit-testable off disk. */ export interface OverviewDeps { liveAgents?: (cwd: string) => Promise<LiveAgent[]>; queue?: (projects: ProjectSummary[]) => Promise<ProjectQueue[]>; } /** * Build the cross-project Overview: the running agents (every live agent of each project, one per * worktree since #736), the total open TODO count (from {@link collectQueue}), and the most * recently active projects (by {@link ProjectSummary.lastActivityAt}). Forgiving — a project * with no live run, or none running, simply contributes nothing to `active`. */ export declare function buildOverview(projects: ProjectSummary[], deps?: OverviewDeps): Promise<Overview>; //# sourceMappingURL=overview.d.ts.map