/** * InjectionFormatter — 将知识条目格式化为可注入的文本块 * 支持 markdown 和 plain text 两种输出格式 * 支持 summary-only 和 full-content 两种披露模式(渐进式披露) */ import type { KnowledgeEntry } from '../types/index.js'; export type InjectionFormat = 'markdown' | 'plain'; /** * Disclosure mode — controls how much content is injected. * - 'summary': inject only a one-line description (saves tokens) * - 'full': inject complete content (for deep context) */ export type DisclosureMode = 'summary' | 'full'; export interface FormattedBlock { text: string; entryId: string; estimatedTokens: number; /** The disclosure mode used to produce this block */ disclosureMode: DisclosureMode; } export declare class InjectionFormatter { private readonly format; private readonly disclosureMode; constructor(format?: InjectionFormat, disclosureMode?: DisclosureMode); formatEntry(entry: KnowledgeEntry, modeOverride?: DisclosureMode): FormattedBlock; formatEntries(entries: KnowledgeEntry[], modeOverride?: DisclosureMode): FormattedBlock[]; private formatMarkdown; /** * Summary-only markdown: one-line description for system prompt injection. * Full content loaded on demand via ContextInjector.injectById(). */ private formatMarkdownSummary; private formatPlain; /** * Summary-only plain text: compact single line. */ private formatPlainSummary; } /** 简易 token 估算:~4 字符 ≈ 1 token */ export declare function estimateTokens(text: string): number; //# sourceMappingURL=injection-formatter.d.ts.map