import { type PromptContributionRegistry } from '../../prompt/contributions.js'; import type { AgentRuntimeContext } from '../../types/agent/base.js'; import type { AgentContextLevel } from '../../types/agent/factory.js'; import type { AgentPersona } from '../../types/persona/index.js'; import type { Skill } from '../../types/skills/index.js'; import type { ToolRegistryContract } from '../../types/tool/index.js'; export interface PromptSegments { /** Layers 1-6: basePrompt, persona identity/expertise/reflexes/skills/outputDiscipline. Stable within a turn. */ readonly static: string; /** Layers 7-10: tools, tier guidance, env context, sessionContext. May change per turn. */ readonly dynamic: string; } export interface PromptBuilderConfig { systemPrompt?: string; persona?: AgentPersona; skills?: Skill[]; basePrompt?: string; tools: ToolRegistryContract; allowedTools?: string[]; runtimeContext?: AgentRuntimeContext; /** * What else goes in the prompt, beyond what this builder knows about. * * Absent means exactly what it meant before this existed: the fixed * list. A capability that needs the model to know something registers * here instead of arguing for a branch or splicing into `systemPrompt` * and losing whatever was there. */ contributions?: PromptContributionRegistry; } export declare class PromptBuilder { private config; constructor(config: PromptBuilderConfig); /** * The context every contribution is rendered against. * * `workingDirectory` is a call argument rather than config, so it is * threaded rather than read off `this`. */ private contributionContext; /** * Skills, once, in the slot they were always in. * * The registry renders at the END of the prompt, and skills belong where * they have always been: immediately after the persona or system prompt. * So the built-in contribution is rendered IN PLACE here rather than * being left to the tail — a host that registers it gets the seam, not a * reordered prompt. * * This is also what makes it a real contributor rather than a decorative * one. Written first as "the builder renders skills, and the registry * skips its own copy", which a mutation caught immediately: the * contribution could be deleted with no observable effect, because the * builder's own branch rendered skills either way. A seam whose first * consumer is inert proves nothing about the seam. * * The persona branch is the exception and stays one: * `assembleSystemPrompt(persona, skills)` places skills inside the * persona's own section ordering, relative to constraints and output * discipline. Routing it through here would silently reorder every * persona-driven prompt in the estate. */ private renderSkillsInPlace; /** * `static` and `dynamic` only, and the signature says so. * * A `turn` contribution rendered here would land in the system prompt — * cached for the turn under `static`, or read as a standing instruction * under `dynamic`. Either way the state it exists to report goes stale * silently, which is the exact failure `turn` was added to avoid. The * iteration loop renders those, into the ephemeral message. */ private renderContributions; build(contextLevel?: AgentContextLevel, workingDirectory?: string): string; buildSegmented(contextLevel?: AgentContextLevel, workingDirectory?: string): PromptSegments; } //# sourceMappingURL=prompt.d.ts.map