import { type ProjectConfigReader } from "./config-directories.js";
import type { SlashSkill } from "../skills/slash-skills.js";
/**
 * Resolve the active system-prompt.md path.
 * Prefers the user override at `<bobbitConfigDir()>/system-prompt.md`;
 * falls back to the shipped `<defaultsDir>/system-prompt.md`.
 * Returns `undefined` only when neither file exists.
 */
export declare function resolveSystemPromptPath(): string | undefined;
/** Initialize the prompts directory from a stateDir. Called by server startup. */
export declare function initPromptDirs(stateDir: string): void;
/**
 * Resolve `@path` references in markdown content, matching Claude Code behavior.
 *
 * `@path/to/file.ext` references are expanded inline wherever they appear on a
 * line. Both relative and absolute paths are supported; relative paths resolve
 * from `baseDir`. References are resolved recursively (a referenced file can
 * itself contain `@` references) up to a maximum depth of 5 hops. A `seen` set
 * prevents infinite loops. Paths starting with `~` expand to the home directory.
 *
 * When a `@ref` is the **only** content on a line (with optional leading
 * whitespace), the file content replaces the entire line and inherits the
 * leading indentation. When inline with other text, the file content is
 * inserted in place of the `@ref` token (no indentation adjustment).
 */
export declare function resolveMarkdownRefs(content: string, baseDir: string, seen?: Set<string>, depth?: number): string;
/**
 * Read an AGENTS.md file from a directory, resolving `@` references.
 * Returns the resolved content, or empty string if no file exists.
 * Looks for AGENTS.md (case-sensitive).
 */
export declare function readAgentsMd(cwd: string): string;
/**
 * Read all agent markdown files from configured locations.
 * Collects entries with type "agents" from getAllConfigDirectories(),
 * reads each existing file, resolves @refs, and concatenates.
 * Falls back to readAgentsMd() if no projectConfigStore is provided.
 */
export declare function readAllAgentFiles(cwd: string, projectConfigStore?: ProjectConfigReader): string;
export interface PromptParts {
    /** Path to the global system prompt file. Resolved via resolveSystemPromptPath():
     *  prefers `<bobbitConfigDir()>/system-prompt.md`, falls back to the shipped default. */
    baseSystemPromptPath?: string;
    /** Working directory shown to the agent (may be container-internal for sandbox). */
    cwd: string;
    /** Host-accessible project root for AGENTS.md / config directory discovery.
     *  Falls back to `cwd` when not set (non-sandbox sessions). */
    projectRoot?: string;
    /** Goal title (for header) */
    goalTitle?: string;
    /** Goal state */
    goalState?: string;
    /** Goal spec markdown content */
    goalSpec?: string;
    /** Role prompt template (separate from goalSpec for section display) */
    rolePrompt?: string;
    /** Role name for display */
    roleName?: string;
    /** Task title */
    taskTitle?: string;
    /** Task type (e.g. 'implementation', 'code-review', etc.) */
    taskType?: string;
    /** Task spec markdown content */
    taskSpec?: string;
    /** Human-readable descriptions of dependency tasks */
    taskDependsOn?: string[];
    /** Pre-formatted tool documentation section to append */
    toolDocs?: string;
    /** Allowed tool names for this session — used to filter tool docs */
    allowedTools?: string[];
    /** Pre-formatted upstream gate context from workflow dependencies */
    workflowContext?: string;
    /** Project config store for multi-file agent discovery */
    projectConfigStore?: ProjectConfigReader;
    /** Skills available for autonomous activation via the `activate_skill` tool.
     *  When non-empty, an "Available Skills" section is injected into the system prompt.
     *  Skills with `disable-model-invocation: true` should be filtered out by the caller. */
    skillsCatalog?: SlashSkill[];
    /** Optional override for the skills-catalog byte budget (clamped to [MIN, MAX]).
     *  When undefined, `SKILLS_CATALOG_BUDGET` is used. */
    skillsCatalogBudget?: number;
}
/** Default max bytes of skills-catalog markdown to embed in the system prompt. */
export declare const SKILLS_CATALOG_BUDGET = 16384;
/** Lower bound for a user-configured skills-catalog byte budget. */
export declare const SKILLS_CATALOG_BUDGET_MIN = 1024;
/** Upper bound for a user-configured skills-catalog byte budget. */
export declare const SKILLS_CATALOG_BUDGET_MAX = 131072;
/**
 * Resolve a possibly-undefined override into the effective skills-catalog budget.
 * - `undefined`, `NaN`, or non-finite → `SKILLS_CATALOG_BUDGET`.
 * - Otherwise clamps `Math.floor(override)` to `[MIN, MAX]`.
 */
export declare function resolveSkillsCatalogBudget(override?: number): number;
/**
 * Build the "Available Skills" section. Skills are listed alphabetically;
 * if the budget is exceeded, the tail is truncated with an `(N more …
 * omitted, alphabetically truncated)` footer.
 *
 * Caller is responsible for filtering out skills with
 * `disable-model-invocation: true` — this function trusts its input.
 */
export declare function buildSkillsCatalogSection(skills: SlashSkill[], budgetOverride?: number): string | undefined;
export interface PromptSection {
    label: string;
    source: string;
    content: string;
    /** Estimated token count (~4 chars/token for Claude models) */
    tokens: number;
}
/**
 * Assemble the full system prompt from its parts and write to a temp file.
 *
 * Order (stable prefix first, volatile sections last, for provider prompt-cache reuse):
 *   1. Global system prompt (config/system-prompt.md)
 *   2. AGENTS.md from the session's working directory (with @refs resolved inline)
 *   2.5. Working directory instructions
 *   3. Tool documentation
 *   4. Available Skills catalog
 *   5. Goal spec + role (if session belongs to a goal)
 *   6. Current Task
 *   7. Workflow upstream-gate context
 *
 * Returns the path to the assembled prompt file, or undefined if all parts
 * are empty (in which case no --system-prompt should be passed to the agent).
 */
export declare function assembleSystemPrompt(sessionId: string, parts: PromptParts): string | undefined;
export declare function getPromptSections(parts: PromptParts): PromptSection[];
/**
 * Persist the resolved prompt sections as a JSON snapshot at session creation time.
 * This captures the actual prompt that was used, not a reconstruction from current files.
 */
export declare function persistPromptSections(sessionId: string, parts: PromptParts): void;
/**
 * Load persisted prompt sections snapshot for a session.
 * Returns null if the file doesn't exist or can't be parsed.
 */
export declare function loadPersistedPromptSections(sessionId: string): {
    sections: PromptSection[];
    totalTokens: number;
    createdAt: string;
} | null;
/**
 * Delete the persisted prompt sections JSON for a session (archive purge only).
 */
export declare function purgePromptSectionsJson(sessionId: string): void;
/**
 * Clean up a session's assembled prompt file.
 */
export declare function cleanupSessionPrompt(sessionId: string): void;
//# sourceMappingURL=system-prompt.d.ts.map