/** * Memory-pack selection (KF-B) — the "injection judgment" v1. * Heuristic, no ML: score = typeWeight · recency · importance, * take top-N under a token budget, render grouped Markdown. * Recency half-life 30 days mirrors search freshness decay. */ import type { DB } from '../storage/db.js'; export interface PackOptions { /** UX-alias input (SessionStart hook only ever sends this) — merged into * the `project` SQL filter, never queried as its own column. See * selectPack's projectFilter comment for the repo/project precedence. */ repo: string; project?: string | null; branch?: string | null; budgetTokens?: number; typeWeights?: Record; now?: number; } export interface PackMemory { id: string; type: string; text: string; score: number; } export declare const DEFAULT_TYPE_WEIGHTS: Record; export declare const DEFAULT_BUDGET_TOKENS = 1500; /** * Rough token estimate: ~4 chars per token. Real tokenizers vary ±20% — * callers needing exact budgets should leave ~10% headroom. The default * 1500-token budget is deliberately conservative for this reason. */ export declare function estimateTokens(text: string): number; export declare function selectPack(db: DB, opts: PackOptions): PackMemory[]; /** Render the pack as compact Markdown grouped by type, memory ids inline. */ export declare function renderPack(memories: PackMemory[]): string;