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.

73 lines 3.63 kB
import { THE_FRAMEWORK_DIR } from './framework-dir.js'; import { type StoreFs } from './store/index.js'; /** * The `.the-framework/LOGS.md` project log (#378): a human-readable markdown * record of every loop, prompt, and build run in a project. Pure core over the * same {@link StoreFs} seam as the run store; the run-lifecycle wiring and UI * land in later issues (#379/#380). */ /** The directory, under the project root, that holds the log. Defined in its own node-free * module (#874) so the browser-reachable preset registry can share it; re-exported here * because this is where every existing import site expects to find it. */ export { THE_FRAMEWORK_DIR }; /** The markdown log file name. */ export declare const LOGS_FILE = "LOGS.md"; /** * The `.the-framework/.gitignore` that keeps run state transient (#313): the dir * holds both the committed DB (LOGS.md) and the transient run logs, so this * ignores everything except LOGS.md and itself. * * An allow-list, so anything else meant to be committed needs its own negation — * see `CONVERSATIONS_GITIGNORE` (#908), which install appends to this. */ export declare const LOGS_GITIGNORE = "# The Framework: the committed project DB; session state is transient.\n*\n!.gitignore\n!LOGS.md\n"; /** One project-log entry: a loop, or a standalone prompt/build. */ export interface LogEntry { /** ISO timestamp. */ at: string; kind: 'loop' | 'prompt' | 'build'; /** The run's intent/prompt. Escaped to one line on write (#897), so it may hold a whole prompt. */ title: string; status: 'done' | 'stopped' | 'failed' | 'running'; /** * The run's id (#898): the join key from this committed entry to the rest of the run, whose * `runs/<id>.json` meta and `runs/<id>.jsonl` events are transient and stay out of git. */ id?: string; /** Claude Code session id. */ sessionId?: string; /** e.g. `https://claude.ai/code/<id>` */ sessionLink?: string; /** The name the agent gave the session (#326), also its `the-framework/<name>` branch. */ sessionName?: string; /** * The branch the run's work landed on (#799). Read from the checkout as the run settles, * because it is not derivable later: a clean run loses its worktree, and the agent may have * branched itself. */ branch?: string; /** For a loop: constituent prompt summaries. */ prompts?: string[]; } /** The one-time first line of the file, written on the first append. */ export declare const LOGS_HEADER = "# The Framework logs\n"; /** The log path under `cwd`. */ export declare function logsPath(cwd: string): string; /** The `.gitignore` path under `cwd`'s `.the-framework/`. */ export declare function gitignorePath(cwd: string): string; /** Markdown for one entry, starting at `## ` (no file header, no blank lines around it). */ export declare function renderLogEntry(entry: LogEntry): string; /** * Parse every entry out of the markdown, in file order (append order, so * oldest-first). Forgiving: a malformed or torn entry is skipped, never thrown. */ export declare function parseLogs(md: string): LogEntry[]; /** * Append one entry to `.the-framework/LOGS.md`, creating the dir and the * one-time file header when absent. A raw write (may reject); the caller * decides best-effort. */ export declare function appendLog(cwd: string, entry: LogEntry, fs?: StoreFs): Promise<void>; /** Read the project log, newest-first (append order reversed). Missing file yields `[]`. */ export declare function readLogs(cwd: string, fs?: StoreFs): Promise<LogEntry[]>; //# sourceMappingURL=logs.d.ts.map