/** * System prompt construction and project context loading */ import type { Extension } from "./extensions/types.ts"; import { type ModelCapabilityProfile } from "./model-capability.ts"; import type { Skill } from "./skills.ts"; export interface BuildSystemPromptOptions { /** Capability profile that selects the stable prompt shape. Missing means full/legacy behavior. */ modelCapability?: Pick; /** Custom system prompt (replaces default). */ customPrompt?: string; /** Tools to include in the prompt. Defaults come from the shared active-tool surface. */ selectedTools?: string[]; /** Optional one-line tool snippets keyed by tool name. */ toolSnippets?: Record; /** Additional guideline bullets appended to the default system prompt guidelines. */ promptGuidelines?: string[]; /** Text to append to system prompt. */ appendSystemPrompt?: string; /** Working directory. */ cwd: string; /** Global instruction files (with content) plus on-demand project paths (path only). */ contextFiles?: Array<{ path: string; content?: string; }>; /** Discovered skills remain host-side; retained for extension/API construction compatibility. */ skills?: Skill[]; /** Discovered extensions currently active. */ extensions?: Extension[]; } /** * Build the system prompt with tools, guidelines, and context. * * CACHE-STABILITY INVARIANT: providers treat the returned string as ONE prompt-cache block (a * single cache breakpoint covering the whole system prompt). The caller (SystemPromptBuilder / * AgentSession, see `_rebuildSystemPrompt` in agent-session.ts) rebuilds it only when the TOOL * SURFACE changes — never per turn. For a fixed `options` (fixed tool surface, cwd, context * files, extensions), two calls on the SAME CALENDAR DAY must return byte-identical * output, because `date` below is deliberately truncated to Y-M-D granularity. Do NOT widen it * to a timestamp (HH:MM:SS) or otherwise fold in any per-turn-volatile field (turn counters, * elapsed time, random ids, etc.) — that would cache-bust this entire block on EVERY turn instead * of once per calendar day, defeating provider prompt caching (cost + latency regression on every * request). Pinned by test/system-prompt-stability.test.ts. */ export declare function buildSystemPrompt(options: BuildSystemPromptOptions): string; //# sourceMappingURL=system-prompt.d.ts.map