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.

52 lines 2.98 kB
import { type AgentMeta, type AgentStatus } from '../store/index.js'; import type { ProjectSummary, ProjectionRead } from './projects.js'; export { activityKey } from './keys.js'; /** * One agent lifecycle event worth a passing mention. Two kinds: an agent `started` (entered * `running`) or `finished` (reached a terminal status). The card is not shown for these — they * only drive notifications — so the fields are just what a notification line needs. */ export interface Activity { projectId: string; projectName: string; /** The agent this is about. */ agentId: string; /** `started` = the agent entered `running`; `finished` = it reached a terminal status. */ kind: 'started' | 'finished'; /** What the agent is building (its `intent`), for the notification body; may be absent. */ title?: string; /** The finished agent's terminal status (`finished` only), so a stop reads differently from a done. */ status?: AgentStatus; /** When the agent last changed, ISO, for ordering and the baseline diff. */ updatedAt?: string; } /** Injectable seam so {@link buildActivity} is unit-testable off disk. */ export interface ActivityDeps { /** A project's runs, live prepended to the archived history, newest-first. Defaults to disk. */ readAgents?: (cwd: string) => Promise<AgentMeta[]>; } /** * Build the cross-project activity feed: for each registered project's most recent agents, one * item per agent reflecting where it is now (`started` while it runs, `finished` once it lands), * newest first. Forgiving — a project whose agents cannot be read simply contributes nothing, and * comes back named as one that was *not* read whole (#1623), since "nothing happened there" and * "I could not look" are the same empty list to everyone but the notification watcher. * * The `started` and `finished` items for one agent carry distinct keys ({@link activityKey}), so a * run that is still going notifies once (started) and again when it lands (finished). An agent that * both starts and finishes between two polls is only ever seen terminal, so it notifies once * (finished) — one quick agent, one line. */ export declare function buildActivity(projects: ProjectSummary[], deps?: ActivityDeps): Promise<ProjectionRead<Activity>>; /** * How one activity item reads on Discord: a started agent, or a finished one tagged by its outcome. * Beside {@link Activity} for the same reason {@link interventionLine} sits beside `Intervention` * — it switches on the kind, so it belongs with the type that declares the kinds. */ export declare function activityLine(item: Activity): string; /** * Post the given activity items to a Discord webhook as one message, resolving whether Discord * accepted it (#940). `fetch` is injectable for tests. */ export declare function postActivityDiscord(webhook: string, items: Activity[], fetchImpl?: typeof fetch): Promise<boolean>; //# sourceMappingURL=activity.d.ts.map