import { Task } from './todo'; /** Agent profile instructions written for each task run */ export declare const AGENT_PROFILE_FILE = ".autodev/PROGRAM.md"; /** Directory where per-task message files are stored */ export declare const MESSAGES_DIR = ".autodev/messages"; /** Directory where attachments are saved, grouped by timestamp+hash */ export declare const ATTACHMENTS_DIR = ".autodev/messages/attachments"; export interface ProfileMeta { title?: string; description?: string; /** When true, the task instruction omits the commit step */ noCommit?: boolean; } /** * Parse YAML-like frontmatter from a markdown file. * Returns metadata and the body with frontmatter stripped. */ export declare function parseFrontmatter(content: string): { meta: ProfileMeta; body: string; }; /** * First-turn system reminder pointing the agent at the master protocol index * (`.autodev/program.md`) and its persistent identity anchor (`SOUL.md`). * * Gated on existence: returns '' when `.autodev/program.md` is absent (e.g. the * user deleted it) so we never emit a broken pointer. This is belt-and-suspenders * on top of the passive AGENTS.md / CLAUDE.md reference — it is meant to be * injected only on the FIRST turn of a session/loop (see buildMessage's * `includeProfile` gate), not repeated every turn. * * Exported so smoke tests can prove the existence gate directly. */ export declare function firstTurnSystemReminder(root: string): string; /** * Re-read-on-update reminder for SOUL.md (the agent's identity/persona anchor). * * The office can edit an agent's SOUL.md live (via the mcp-operate file browser, or * a persona change on connect). This fires a `` on ANY turn whose * SOUL.md mtime advanced past the last one we recorded — so an identity edit made * mid-session is actually adopted, not ignored until the next fresh session. * * State is a tiny `.autodev/.soul-seen` marker (last-seen mtime). The FIRST time we * see a SOUL.md (no marker yet) we only record it and stay silent — the first-turn * reminder already tells the agent to read SOUL.md, and connect-time persona writes * must not trigger a spurious "it changed" on turn 1. Best-effort; never throws. */ export declare function soulUpdatedReminder(root: string): string; /** * Save an attachment to `.autodev/messages/attachments//filename`. * If `groupId` is omitted a new `_` folder is created. * Returns the workspace-relative forward-slash path (suitable for embedding in .md). */ export declare function saveAttachment(workspaceRoot: string, filename: string, data: Buffer | string, groupId?: string): string; /** * Write arbitrary content to a timestamped message file and return the full path. * Used for reminder/check-in messages that bypass buildMessage(). */ export declare function writeMessageFile(root: string, content: string): string; /** * Builds the agent message for a task, writing two separate files: * - `.autodev/AGENT_PROFILE.md` — profile instructions (frontmatter stripped) * - `.autodev/messages/MESSAGE_.md` — task + current TODO * * Returns `{ prompt, messageFile }` where `prompt` is the combined string for UI * providers that cannot read files via @-references, and `messageFile` is the * absolute path of the written message file for CLI providers. */ /** * Assembles and writes `.autodev/AGENT_PROFILE.md` from the currently enabled * profile sections + any active MCP protocol injections. Also deploys / removes * Claude skill files for enabled / disabled MCPs. * * Called directly from the sidebar "Save & Rebuild Profile" button so the file * is updated immediately without waiting for a task run. */ export declare function rebuildProfile(root: string): void; export declare function buildMessage(task: Task, root: string, todoDir: string, includeProfile?: boolean): { prompt: string; messageFile: string; };