import type { ProjectPreferences } from '../preferences/preferences-types.js'; export interface MemoryPreflightConfig { readonly enabled: boolean; /** * Semantics are unchanged — it is the *token* cap, converted to bytes * as `maxTokens * 4` when `maxBytes` is not set. Do NOT drop this key: * existing `.peaks/preferences.json` files set it. */ readonly maxTokens: number; /** Back-compat: hot-tier item cap fallback when `hotItemCap` is absent. */ readonly listCap: number; readonly contentCacheBytes: number; /** Hard byte cap on the composed block. Defaults to `maxTokens * 4`. */ readonly maxBytes: number; /** Max hot (standing rule / feedback) items injected. Default 10. */ readonly hotItemCap: number; /** Max warm (project / reference) items injected; 0 disables warm. Default 4. */ readonly warmItemCap: number; /** * Warm relevance gate: minimum number of distinct task-title tokens * (length >= 4, stopwords removed) that must literally occur in the memo * text before it is warm-eligible. 1 (default) means "at least one task * word appears in the memo"; raise it to tighten the gate. Hot entries * ignore this gate — they are always eligible. */ readonly warmMinTokenHits: number; /** * Soft wall-clock budget (ms) for the whole selection step. When exceeded * the preflight degrades to hot-only (or unranked hot) rather than * blocking a dispatch. 0 forces the hot-only path deterministically. */ readonly selectionTimeBudgetMs: number; /** * Gate for inlining memo *bodies* (via `cacheMemoContent`). Off by * default: the preflight emits a compact index and the sub-agent drills * down with `Read` against `sourcePath`. */ readonly includeBodies: boolean; } /** * Loose input type for `resolveMemoryPreflightConfig`. Accepts either a * full `ProjectPreferences` (e.g. the output of `loadPreferences()`) or * any object that at minimum carries `memoryPreflight`. Lets callers * pass a partial overlay literal — e.g. `{}` or `{ memoryPreflight: {...} }` * — without having to construct a fully-populated preferences fixture. * * Downstream tasks (orchestrator service, dispatch hook) should import * this alias rather than re-deriving the structural type. */ export type MemoryPreflightPrefsInput = ProjectPreferences | Pick; export declare function resolveMemoryPreflightConfig(prefs: MemoryPreflightPrefsInput): MemoryPreflightConfig;