/** * System prompt construction and project context loading */ import type { AgentTool } from "@oh-my-pi/pi-agent-core"; import type { SkillsSettings } from "./config/settings"; import { type Skill } from "./extensibility/skills"; import { type WorkspaceTree } from "./workspace-tree"; interface AlwaysApplyRule { name: string; content: string; path: string; } /** Resolve input as file path or literal string */ export declare function resolvePromptInput(input: string | undefined, description: string): Promise; export interface LoadContextFilesOptions { /** Working directory to start walking up from. Default: getProjectDir() */ cwd?: string; } /** * Load all project context files using the capability API. * Returns {path, content, depth} entries for all discovered context files. * Files are sorted by depth (descending) so files closer to cwd appear last/more prominent. */ export declare function loadProjectContextFiles(options?: LoadContextFilesOptions): Promise>; /** * Load the effective system prompt customization from SYSTEM.md. * Project-level SYSTEM.md overrides user-level SYSTEM.md. */ export declare function loadSystemPromptFiles(options?: LoadContextFilesOptions): Promise; export interface SystemPromptToolMetadata { label: string; description: string; /** Tool name the model sees on the provider wire. Defaults to the internal tool name. */ wireName?: string; } export declare function buildSystemPromptToolMetadata(tools: Map, overrides?: Partial>>): Map; export interface BuildSystemPromptOptions { /** Custom system prompt (replaces default). */ customPrompt?: string; /** Tools to include in prompt. */ tools?: Map; /** Tool names to include in prompt. */ toolNames?: string[]; /** Text to append to system prompt. */ appendSystemPrompt?: string; /** Repeat full tool descriptions in system prompt. Default: false */ repeatToolDescriptions?: boolean; /** Skills settings for discovery. */ skillsSettings?: SkillsSettings; /** Working directory. Default: getProjectDir() */ cwd?: string; /** Pre-loaded context files (skips discovery if provided). */ contextFiles?: Array<{ path: string; content: string; depth?: number; }>; /** Skills provided directly to system prompt construction. */ skills?: Skill[]; /** Pre-loaded rulebook rules (descriptions, excluding TTSR and always-apply). */ rules?: Array<{ name: string; description?: string; path: string; globs?: string[]; }>; /** Intent field name injected into every tool schema. If set, explains the field in the prompt. */ intentField?: string; /** Whether MCP tool discovery is active for this prompt build. */ mcpDiscoveryMode?: boolean; /** Discoverable MCP server summaries to advertise when discovery mode is active. */ mcpDiscoveryServerSummaries?: string[]; /** Encourage the agent to delegate via tasks unless changes are trivial. */ eagerTasks?: boolean; /** Rules with alwaysApply=true — their full content is injected into the prompt. */ alwaysApplyRules?: AlwaysApplyRule[]; /** Whether secret obfuscation is active. When true, explains the redaction format in the prompt. */ secretsEnabled?: boolean; /** Pre-loaded workspace tree (skips discovery if provided). May be a Promise to allow early kick-off. */ workspaceTree?: WorkspaceTree | Promise; } /** Result of building provider-facing system prompt messages. */ export interface BuildSystemPromptResult { /** Ordered system prompt blocks. Providers should preserve entries as distinct messages/blocks. */ systemPrompt: string[]; } /** Build the system prompt with tools, guidelines, and context */ export declare function buildSystemPrompt(options?: BuildSystemPromptOptions): Promise; export {};