/**
 * Content policy for semantic-search indexing.
 *
 * Translates an agent message object into a list of role-tagged, weighted
 * text entries ready to be wrapped in `Indexable`s by upstream sources.
 *
 * This replaces the older `message-extractor.ts::extractTextFromMessage`
 * which only emitted flat assistant text. See design doc §5 for the
 * authoritative table of role → weight → text rules.
 *
 * Design reference: docs/design/semantic-search.md §5 (Content policy).
 */
import type { Role } from "./types.js";
/**
 * Bump when the extraction rules below change in a way that alters what
 * text gets indexed or how it is weighted. A version mismatch in
 * `search_meta` triggers a full rebuild on next open (see §10).
 */
export declare const CONTENT_POLICY_VERSION = 1;
/**
 * Raw tool-result content bigger than this is hard-skipped (not indexed).
 * Aligned with `src/server/agent/truncate-large-content.ts` (32KB).
 */
export declare const MAX_TOOL_RESULT_INPUT_CHARS = 32768;
/** Tool-result text is truncated to this many characters when indexed. */
export declare const TOOL_RESULT_INDEX_CHARS = 500;
export interface PolicyEntry {
    role: Role;
    weight: number;
    text: string;
    /** Stable per-message key — used by callers to build chunk/row ids. */
    blockKey: string;
}
export interface PolicyHit {
    entries: PolicyEntry[];
}
export interface ExtractOptions {
    /** Skip tool_result blocks whose raw content exceeds this (default 32768). */
    maxToolResultInputChars?: number;
    /** Truncate indexed tool_result text to this length (default 500). */
    toolResultIndexChars?: number;
}
/**
 * Remove `<thinking>…</thinking>` blocks from assistant text.
 *
 * Non-nested, multi-line. Unmatched opening tags are left untouched — we
 * only strip when a matching close tag is found. This keeps partial
 * streaming output sensible and avoids eating everything to EOF.
 */
export declare function stripThinking(text: string): string;
/**
 * Summarise a tool invocation into a single short indexable line:
 *
 *     <tool_name> <first-line-of-stringified-input>
 *
 * Robust to non-serialisable input (falls back to an empty arg section).
 */
export declare function summariseToolCall(name: string, input: unknown): string;
/**
 * Extract role-weighted indexable entries from a single message.
 *
 * Role-detection rule order (per block) — design §5:
 *   1. user + text      → user,         2.0
 *   2. user + tool_result → tool_result, 0.5 (skip if raw >32KB, else first 500 chars)
 *   3. assistant + text → assistant,    1.0  (stripThinking)
 *   4. assistant + tool_use → tool_call, 0.8
 *   5. thinking blocks  → skip
 *   6. image/binary     → skip
 *
 * A bare string `content` on a user/assistant message is treated as a
 * single text block.
 *
 * Empty-text entries are filtered out before returning — callers never
 * have to re-check.
 */
export declare function extractForIndexing(message: unknown, opts?: ExtractOptions): PolicyHit;
//# sourceMappingURL=content-policy.d.ts.map