import type { SessionTreeEntry } from "@sema-agent/core"; /** * ── [ref] 渲染臂的判据:**证据面与模型所见同进同出** ───────────────────────────────────────────── * core 的 `SessionTreeEntry` 是 12 型联合,曾经这里只渲 message/compaction 两支 ⇒ 10 型静默丢弃。 * 其中 `custom_message` 正是非标准入口用户内容(steering)的落点:core `convertToLlm` 把它按 * `role:"user"` 送模型,而证据面渲没了 ⇒ 评估者如实判「证据不足」⇒ 拦停死循环直到 CAP(cli 带 * 最小复现的真缺陷)。所以分类规则不是「渲会话内容」,而是:**模型看得见的必须在,看不见的必须不在**。 * * 两张表 = 对 core 型全集的**显式全分类**;test/branch-transcript.test.ts 里的闭合钉从 core d.ts * 逐字取联合成员核对「型全集 = 渲染臂 ∪ 跳过表」—— core 加第 13 型 ⇒ 红,逼一次显式分类, * 默认可见(下面循环的 default 臂做通用文本抽取)而不是默认失踪。 */ export declare const RENDERED_ENTRY_TYPES: readonly ["message", "compaction", "custom_message"]; /** * 跳过的理由逐型给(「纯控制型」不是一句话,是逐个核过模型看不见): * thinking_level_change / model_change / label / session_info / leaf / prompt_epoch / * announced_listing / workspace_state / git_announcement / reminder_mark —— 控制面元数据,core 折 * messages 时不产出内容; * custom —— data-only(session.js 折 messages 只认 message/custom_message 两型),模型看不见它的 * data;把它渲出来反而是把模型没见过的东西冒充成证据,与 [ref] 是同一判据的反方向。 */ export declare const SKIPPED_ENTRY_TYPES: readonly ["thinking_level_change", "model_change", "label", "session_info", "leaf", "prompt_epoch", "announced_listing", "workspace_state", "git_announcement", "reminder_mark", "custom"]; /** 渲染结果。**判别式**:证据不足时调用方拿不到 `text`,想用也用不了(见顶注)。 */ export type BranchTranscript = { sufficient: true; text: string; rendered: number; truncated: boolean; } | { sufficient: false; reason: "no-entries" | "nothing-renderable" | "empty-after-render"; }; /** 单次评估送进模型的 transcript 字符上限。超出保留**尾部**(最近的对话对"条件是否已达成"更相关)。 */ export declare const BRANCH_TRANSCRIPT_MAX_CHARS = 60000; /** * 渲染成 transcript。 * * ⚠️ **compaction 的 summary 也算证据**:一次压缩之后,早期内容**只**活在那段摘要里 —— * 把它滤掉等于亲手制造「证据不足」(而那正好会被判成"拦")。 */ export declare function renderBranchTranscript(entries: readonly SessionTreeEntry[] | undefined, opts?: { maxChars?: number; }): BranchTranscript; //# sourceMappingURL=branch-transcript.d.ts.map