/** * System-prompt assembly for a model call: builds the canonical prompt from a * character's `system` + `bio` (name-token expanded) plus the caller's role, and * resolves the effective system prompt from explicit params, a leading `system` * chat message, or a fallback — de-duplicating that leading system message when it * already matches the resolved prompt. Also renders the character's static chat * style directions for the v5 stable prefix. */ import type { Character } from "../types/agent.js"; import type { RoleGateRole } from "../types/contexts.js"; import type { ChatMessage } from "../types/model.js"; type MessageLike = { role?: unknown; content?: unknown; }; export declare function renderSystemPromptBio(value: unknown): string; export declare function normalizeSystemPromptRole(role: RoleGateRole | string | null | undefined): string | undefined; export declare function buildCanonicalSystemPrompt(args: { character?: Pick | null; userRole?: RoleGateRole | string | null; }): string; /** * Renders the character's chat-facing style directions (`style.all` + * `style.chat`) as a single self-headed block for the canonical v5 message * pipeline. Computed statically from the character — never through the * per-room CHARACTER provider — so the rendered block is byte-stable and safe * inside the KV-cacheable stable prefix. Returns "" when the character * declares no chat style. */ export declare function buildCharacterStyleDirections(args: { character?: Pick | null; }): string; export declare function textFromChatMessageContent(content: unknown): string; export declare function extractLeadingSystemPrompt(messages: unknown): string | undefined; export declare function resolveEffectiveSystemPrompt(args: { params?: unknown; fallback?: string | null; }): string | undefined; export declare function dropDuplicateLeadingSystemMessage(messages: readonly T[] | undefined, systemPrompt: string | undefined): T[] | undefined; export declare function renderChatMessagesForPrompt(messages: readonly ChatMessage[] | undefined, options?: { omitDuplicateSystem?: string; }): string | undefined; export {};