/** * The CLI's capabilities, reachable from the browser. * * The web interface had fifteen routes against sixty-nine slash commands, which is why it read as * a lesser thing than the terminal. Most of those commands are thin wrappers over modules that * already exist — checkpoints, the preflight gate, the doctor, config, memory — but they live * inside a four-thousand-line React component and cannot be called from anywhere else. * * So this calls the modules directly rather than the commands. The result is the same work with a * better surface: a browser can show a checkpoint's preview before restoring it, a gate's checks as * rows rather than as scrollback, and every setting as a form. Where the web can do better than a * terminal, it should — that is the point of having both. */ import { type DoctorCheck } from '../doctor.js'; import { type FileChange } from './changes.js'; import type { AgentConfig } from '../types.js'; export interface CheckpointRow { id: string; label: string; at: number; /** What restoring it would touch, in words. */ scope: string; files: number; kind: 'workspace' | 'edit'; } /** Restore points, newest first, with what each one covers. */ export declare function checkpoints(cwd: string): Promise; export declare function makeCheckpoint(cwd: string, label: string): Promise; /** * What restoring a checkpoint would do, before it does it. * * The terminal asks for confirmation with a count; a browser can show the list. Nobody should have * to guess what a restore is about to overwrite. */ export declare function checkpointPreview(cwd: string, id: string): Promise; export declare function restoreCheckpoint(cwd: string, id: string): Promise; export interface GateResult { ready: boolean; report: string; git: boolean; staged: number; unstaged: number; untracked: number; whitespacePassed: boolean | null; checks: Array<{ name: string; command: string; ok: boolean; ms: number; detail: string; }>; } /** * Everything /preflight checks, as rows. * * The terminal prints a report and you read it; a browser can show each check with its own state, * which is the difference between "something failed" and "the type check failed, here". */ export declare function gate(cwd: string): Promise; export interface HealthReport { checks: DoctorCheck[]; provider: string; model: string; endpoint: string; keyless: boolean; contextWindow: number; node: string; platform: string; cwd: string; } /** What /doctor and /context answer, together, because they are the same question. */ export declare function health(config: AgentConfig): Promise; export interface SettingRow { key: string; label: string; description: string; kind: string; choices?: readonly string[]; min?: number; max?: number; clearable: boolean; value: unknown; shown: string; /** True when the value comes from a file rather than being unset. */ set: boolean; } /** * Every setting, with its current value. * * The same schema the terminal's /config uses, so the two cannot drift: a setting added to * CONFIG_SCHEMA appears in both without anybody remembering to add it twice. */ export declare function settings(home?: string): Promise; /** Writes one setting, with the same validation the terminal applies. */ export declare function writeSetting(key: string, raw: unknown, /** The server's state home, so a setting written from the browser lands where that server keeps it. */ home?: string): Promise<{ ok: boolean; error?: string; }>; export interface ProjectContext { /** KONECK.md or AGENTS.md, whichever the workspace has. */ instructions: string | null; instructionsPath: string | null; /** Notes the agent wrote to itself in earlier sessions. */ memory: string | null; providers: Array<{ name: string; label: string; keyless: boolean; defaultModel: string; }>; } /** What the agent is told about this project, and where that comes from. */ export declare function projectContext(cwd: string): Promise; /** Writes the project's instruction file. The one thing here that changes the workspace. */ export declare function writeInstructions(cwd: string, text: string): Promise<{ ok: boolean; path: string; }>; export type RefactorKind = 'rename' | 'extract-interface' | 'move' | 'split'; export interface RefactorRequest { kind: RefactorKind; /** The symbol to rename or move. */ symbol?: string; /** The new name, for a rename. */ newName?: string; /** The file a symbol lives in, or the file to split, or the class's file. */ file?: string; /** Where a symbol is moving to. */ toFile?: string; } export interface RefactorResult { ok: boolean; error?: string; /** What it actually did to the workspace. */ changes: FileChange[]; totals: { files: number; added: number; removed: number; }; /** The checkpoint taken beforehand, when one could be, so this can be undone. */ checkpoint: string | null; /** Said plainly when no checkpoint was possible, because then undo is not on offer. */ note?: string; occurrences?: number; } /** What each operation needs, so the form can ask for exactly that and no more. */ export declare const REFACTOR_SHAPES: Record; }>; /** * Runs a refactor, and makes it undoable. * * These functions write immediately — there is no dry run — which is fine at a terminal where the * next thing you type is `git diff`, and not fine in a browser where nothing has told you what * happened. So a checkpoint is taken first, the refactor runs, and the difference it made is * computed and returned. That is better than a preview: the diff is the real result rather than a * prediction of it, and the checkpoint means it can be put back. * * When a checkpoint cannot be taken — no repository in this workspace — it says so and offers no * undo, rather than implying one. */ export declare function runWebRefactor(cwd: string, request: RefactorRequest, config: AgentConfig): Promise; export interface McpServerRow { name: string; /** How it is launched or reached, without anything that authenticates it. */ how: string; enabled: boolean; } /** * The MCP servers this workspace declares. * * Read from the same config the engine reads, so the list is what would actually be connected * rather than a second opinion about it. Environment values are counted, never shown: an MCP * server's env is where its token lives. */ export declare function mcpServers(cwd: string): Promise<{ servers: McpServerRow[]; note?: string; }>; //# sourceMappingURL=capabilities.d.ts.map