/** * Agent profile Markdown (filenames, load order, system prompt assembly) and * small helpers for message content extraction. * * Canonical on-disk root: `agents//profile/`. */ export declare const DEFAULT_AGENTS_FILENAME = "AGENTS.md"; export declare const DEFAULT_SOUL_FILENAME = "SOUL.md"; export declare const DEFAULT_TOOLS_FILENAME = "TOOLS.md"; export declare const DEFAULT_IDENTITY_FILENAME = "IDENTITY.md"; export declare const DEFAULT_HEARTBEAT_FILENAME = "HEARTBEAT.md"; export type AgentProfileMarkdownFilename = typeof DEFAULT_AGENTS_FILENAME | typeof DEFAULT_SOUL_FILENAME | typeof DEFAULT_TOOLS_FILENAME | typeof DEFAULT_IDENTITY_FILENAME | typeof DEFAULT_HEARTBEAT_FILENAME; /** * Order for loading profile Markdown files into the system prompt (persona / user before repo guide, etc.). */ export declare const AGENT_PROFILE_MARKDOWN_SYSTEM_FILES: readonly AgentProfileMarkdownFilename[]; /** Files that should be surfaced when missing. Other profile files are optional overlays. */ export declare const REQUIRED_AGENT_PROFILE_MARKDOWN_FILES: readonly AgentProfileMarkdownFilename[]; export declare const REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET: ReadonlySet; export interface WorkspaceProfileMarkdownFile { name: AgentProfileMarkdownFilename; path: string; content?: string; missing: boolean; } /** * Strip YAML front matter from markdown content. */ export declare function stripFrontMatter(content: string): string; /** Maximum characters to inject from workspace files into system prompt */ export declare const PROFILE_MARKDOWN_MAX_CHARS = 20000; export interface TruncateResult { content: string; truncated: boolean; originalLength: number; } /** * Truncate workspace file content to prevent token overflow. * Keeps head (HEAD_TRUNCATION_RATIO, 70%) and tail (TAIL_TRUNCATION_RATIO, 20%) with a * truncation marker in between; the remainder is reserved for the marker. */ export declare function truncateProfileMarkdownContent(content: string, maxChars: number): TruncateResult; export interface ProfileMarkdownFile { name: AgentProfileMarkdownFilename; path?: string; content: string; missing?: boolean; } /** * Convert {@link ProfileMarkdownFile} to {@link WorkspaceProfileMarkdownFile} (adds required path field). * @param pathFallbackDir — used when `file.path` is absent (e.g. canonical `profile/` root). */ export declare function toWorkspaceProfileMarkdownFile(file: ProfileMarkdownFile, pathFallbackDir: string): { name: AgentProfileMarkdownFilename; path: string; content?: string; missing: boolean; }; /** * Load profile Markdown from `profileDir` (`agents//profile/`). */ export declare function loadProfileMarkdownFiles(profileDir: string): ProfileMarkdownFile[]; /** * Extract text content from agent message content array */ export declare function extractTextContent(content: Array<{ type: string; text?: string; }>): string; /** * Concatenate thinking / reasoning content blocks from assistant message.content. * pi-ai may use `thinking` or `text` on `type: "thinking"` blocks. */ export declare function extractThinkingContent(content: Array<{ type: string; thinking?: string; text?: string; }> | undefined): string; /** * Extended thinking on the assistant message (e.g. Anthropic reasoning / pi-ai reasoning_details). */ export declare function extractThinkingFromAssistantMessage(message: { role?: string; reasoning_details?: { thinking?: string; }; } | undefined): string;