/** * User Profile — a durable, human-readable description of the user that * personalises how the agent works. It is injected into the system prompt so * every surface (CLI, ACP, VS Code, Zed) adapts the same way, because they all * run through agent.ts. * * Storage (both optional, both injected when present): * - **Global**: `~/.codeep/profile.md` — who the user is across * all projects: preferred reply language, response style, default stack, * hard "always / never" values. * - **Project**: `/.codeep/profile.md` — what THIS project is to * the user: their role, goals, constraints, "don't touch" notes. * * Global is injected first, the project profile second, so the project context * sits closest to the task and can refine/extend the global one. * * This file is written by the user — via `/me` or by hand. There is NO * automatic extraction in this phase, so injecting it carries no surprise. * Injection is gated by `config.userProfile` (default true); set it false to * disable entirely. * * NOTE: This is distinct from the provider "profiles" feature (saved * provider+model combos in config.json, see config/index.ts). Different * concept, different storage, different command (`/me` vs `/profile`). */ /** A minimal chat message shape (avoids importing the heavier Message type). */ type ChatMsg = { role: string; content: string; }; export declare function globalProfilePath(): string; export declare function projectProfilePath(workspaceRoot: string): string; /** * Auto-learned facts files. Kept SEPARATE from the user-authored profile.md so * the learning pass never touches what the user wrote by hand. Populated only * when `autoLearnProfile` is on (or via `/me learn`). * - Global (`~/.codeep/profile.learned.md`): cross-project facts about the * user (reply language, style, general stack, universal always/never). * - Project (`/.codeep/profile.learned.md`): facts specific to working * on THIS project (role, goals, constraints, project conventions stated). */ export declare function globalLearnedProfilePath(): string; export declare function projectLearnedProfilePath(workspaceRoot: string): string; export type LearnScope = 'global' | 'project'; /** * Build the system-prompt addendum describing the user. Returns '' when * injection is disabled or when neither profile file exists. Never throws. */ export declare function loadUserProfilePrompt(workspaceRoot?: string): string; export interface ProfileStatus { enabled: boolean; autoLearn: boolean; globalPath: string; globalExists: boolean; projectPath: string | null; projectExists: boolean; learnedGlobalPath: string; learnedGlobalExists: boolean; learnedProjectPath: string | null; learnedProjectExists: boolean; } export declare function getProfileStatus(workspaceRoot?: string): ProfileStatus; /** * Create a starter profile file if it doesn't exist. Never clobbers existing * content. Returns the path + whether it was created, or null on failure. */ export declare function scaffoldProfile(scope: 'global' | 'project', workspaceRoot?: string): { path: string; created: boolean; } | null; /** Render the `/me` view: injection state, file paths, and current content. */ export declare function formatProfileView(workspaceRoot?: string): string; /** * Observe a conversation and update an auto-learned profile via one cheap LLM * pass that MERGES new durable facts with the existing ones (dedup, newer-wins, * capped). `scope` selects the global profile (cross-project, about the person) * or the project profile (this repo only; needs `workspaceRoot`). Returns the * resulting facts (`updated` = whether the file changed), or null when there's * nothing to learn / the call fails. Never throws. * * Gating (`autoLearnProfile`) is the caller's job for the automatic path; * `/me learn` calls this directly on demand. */ export declare function updateLearnedProfile(history?: ChatMsg[], scope?: LearnScope, workspaceRoot?: string): Promise<{ updated: boolean; facts: string; } | null>; /** * Auto-learn entry point for the session-save hook. No-ops unless the user * opted in (`autoLearnProfile`) and enough new messages have accrued. Safe to * call on every save — fire-and-forget. */ export declare function maybeLearnUserProfile(sessionName: string, history: ChatMsg[], workspaceRoot?: string): Promise; /** * Delete the auto-learned profile(s): always the global one, plus the project * one when a workspace root is given. Returns true if any file was removed. */ export declare function clearLearnedProfile(workspaceRoot?: string): boolean; export {};