import type { TaskFactPolicy, TaskFactProjection } from './task-facts.js'; import { type ExtensionContext } from '@earendil-works/pi-coding-agent'; import { type CollectionRequest, type CollectionSource, type StateStore } from './types.js'; export interface CollectionInputMessage { source: CollectionSource; /** An assistant reference is never itself an authorized fact. */ role: 'user' | 'assistant_reference' | 'task_fact' | 'explicit_memory'; /** Verified owner-state receipt; never a selectable source. */ explicitOperationId?: string; projection?: TaskFactProjection; text: string; } export type CollectionInputResult = { status: 'ready'; request: CollectionRequest; messages: CollectionInputMessage[]; excludedEntries: string[]; } | { status: 'blocked'; code: 'MEMORY_COLLECTION_NOT_AUTHORIZED' | 'MEMORY_SOURCE_UNAVAILABLE' | 'MEMORY_COLLECTION_INPUT_LIMIT' | 'MEMORY_COLLECTION_SCAN_FAILED'; }; type Session = Pick; /** The host must resolve attribution from protected source records, never a model. * Return only a contiguous user-authored span of the persisted message. Undefined * excludes that entry; it must not mean falling back to an expanded template. */ export type CollectionUserTextProjector = (input: { source: CollectionSource; text: string; signal?: AbortSignal; }) => string | undefined | Promise; /** Local-only screening; successful screening is not confirmation or permission to send. */ export declare class CollectionInputBuilder { #private; private readonly options; constructor(options: { store: StateStore; scope?: string | null; maxInputBytes: number; taskFacts?: TaskFactPolicy; /** Required for hosts that expand unmarked templates or inject user wrappers. * Must remain resolvable after restart and for copied fork ancestors. */ projectUserText?: CollectionUserTextProjector; /** Trusted host snapshot. Never persisted, returned, or supplied by model input. */ sensitiveValues?: (signal?: AbortSignal) => readonly string[] | Promise; }); build(requestId: string, session: Session, signal?: AbortSignal): Promise; } export {};