/**
 * System prompt construction and project context loading
 */
import type { AgentTool } from "@oh-my-pi/pi-agent-core";
import type { ToolExample, TSchema } from "@oh-my-pi/pi-ai";
import type { Personality, SkillsSettings } from "./config/settings.js";
import { type Skill } from "./extensibility/skills.js";
import { type ActiveRepoContext } from "./utils/active-repo-context.js";
import { type WorkspaceTree } from "./workspace-tree.js";
interface AlwaysApplyRule {
    name: string;
    content: string;
    path: string;
}
/** Discover TITLE_SYSTEM.md file for automatic session-title prompt overrides */
export declare function discoverTitleSystemPromptFile(cwd?: string): string | undefined;
/** Resolve input as file path or literal string */
export declare function resolvePromptInput(input: string | undefined, description: string): Promise<string | undefined>;
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<Array<{
    path: string;
    content: string;
    depth?: number;
}>>;
/**
 * 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<string | null>;
export declare const DEFAULT_SYSTEM_PROMPT_TOOL_NAMES: readonly ["read", "bash", "edit", "write"];
export interface SystemPromptToolMetadata {
    label: string;
    description: string;
    /** Tool name the model sees on the provider wire. Defaults to the internal tool name. */
    wireName?: string;
    /** Tool parameters schema (Zod or JSON Schema), fed to the verbose inventory renderer. */
    parameters?: TSchema;
    /** Illustrative examples rendered into the verbose inventory. */
    examples?: readonly ToolExample[];
}
export declare function buildSystemPromptToolMetadata(tools: Map<string, AgentTool>, overrides?: Partial<Record<string, Partial<SystemPromptToolMetadata>>>): Map<string, SystemPromptToolMetadata>;
export interface BuildSystemPromptOptions {
    /** Custom system prompt (replaces default). */
    customPrompt?: string;
    /** Already-loaded custom system prompt text; bypasses path resolution. */
    resolvedCustomPrompt?: string;
    /** Tools to include in prompt. */
    tools?: Map<string, SystemPromptToolMetadata>;
    /** Tool names to include in prompt. */
    toolNames?: string[];
    /** Text to append to system prompt. */
    appendSystemPrompt?: string;
    /** Already-loaded append prompt text; bypasses path resolution. */
    resolvedAppendSystemPrompt?: string;
    /** Inline full tool descriptors in the system prompt. Default: false */
    inlineToolDescriptors?: boolean;
    /**
     * Whether provider-native tool calling is active (no owned/in-band syntax).
     * When true and `inlineToolDescriptors` is false, the inventory renders as a
     * compact tool-name list; otherwise it renders full `# Tool:` sections. Default: true
     */
    nativeTools?: 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;
    /** When true, the Eager Tasks section uses the hard MUST/ONLY wording (`task.eager: always`) rather than the softer `preferred` nudge. */
    eagerTasksAlways?: boolean;
    /** Whether `task.batch` is enabled; gates batch-call guidance in the Eager Tasks section. */
    taskBatch?: 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<WorkspaceTree>;
    /** Whether the local memory://root summary is active. */
    memoryRootEnabled?: boolean;
    /** Active model identifier (e.g. "anthropic/claude-opus-4") surfaced to the agent. */
    model?: string;
    /** Personality preset rendered into the default system prompt. "none" omits the block. Default: "default" */
    personality?: Personality;
    /** Whether to include the workspace directory tree in the system prompt. Default: false */
    includeWorkspaceTree?: boolean;
    /** Whether Mermaid fenced blocks render as terminal ASCII diagrams. Default: true */
    renderMermaid?: boolean;
    /** Pre-resolved nested active repo context. Undefined resolves from cwd. */
    activeRepoContext?: ActiveRepoContext | null;
}
/** 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<BuildSystemPromptResult>;
export {};
