import type { SessionEvidenceReadOptions, SessionEvidenceReadResult, SessionEvidenceSearchResult, SessionEvidenceSource } from '../../store/evidence/types.js'; import type { ResidentHistoryMatch, ResidentHistoryScope, ResidentHistorySource } from './history.js'; /** @experimental Host authority for one pursuit, project and admission boundary. */ export interface ResidentToolEvidenceScope extends ResidentHistoryScope { readonly projectId: string; } /** @experimental Identity of an agenda-verified settlement, not a fabricated transcript. */ export type ResidentSettledInvocation = Pick; /** @experimental Settlement is checked before the host resolves the attempt's invocation. */ export interface ResidentToolEvidenceOptions { readonly history: ResidentHistorySource; readonly projectId: string; /** Host-enforced upper bound for resolveTurn's document reads, charged in full. * Required only when an operation supplies maxReadBytes. Zero asserts no * document reads. This is a declared bound, not a measured receipt. */ readonly resolutionReadBytes?: number; /** * The evidence of the one turn that performed a settled invocation. Its * scope must name that turn (`turnId` present): a source spanning a whole * session could answer with another turn's records. */ readonly resolveTurn: (settled: ResidentSettledInvocation, signal?: AbortSignal) => Promise; } /** @experimental An optional shared ceiling covers history, resolution and turn evidence. */ export interface ResidentToolEvidenceSearchOptions { readonly query?: string; /** Token discovery: 1–16 terms, matched case-insensitively. Combined query/filter JSON ≤512 UTF-8 bytes. */ readonly terms?: readonly string[]; /** Omit successful retrieval copies before they consume candidate slots. */ readonly excludeSuccessfulTools?: readonly string[]; /** Omit query/terms/filter to continue the exact captured search. */ readonly cursor?: string; /** With a token cursor, continue using a strict subset of its terms. Requires * supportsTermRefinement. Scope, exclusions and the original cursor stay intact. */ readonly refineTerms?: readonly string[]; readonly maxReadBytes?: number; } /** @experimental Tool records from at most one settled invocation per bounded search page. */ export interface ResidentToolEvidenceSearchResult { readonly scope: ResidentToolEvidenceScope; readonly revision: number | null; readonly claimId: string | null; readonly evidence: SessionEvidenceSearchResult | null; readonly nextCursor: string | null; readonly incomplete: boolean; readonly unavailableRevisions: readonly number[]; readonly historyBytes: number; /** Present for bounded calls: history + declared resolution + turn evidence reads. * Failed source reads without a receipt conservatively consume the remainder. */ readonly chargedBytes?: number; } /** @experimental The revision is authorized anew on every read, including after restart. */ export interface ResidentToolEvidenceReadOptions extends Omit { readonly revision: number; /** Shared operation ceiling, at most 8 MiB; reserves at least 1 MiB for turn evidence reads. */ readonly maxReadBytes?: number; } /** @experimental Exact invocation text plus the settled claim that authorized access. */ export interface ResidentToolEvidenceReadResult extends SessionEvidenceReadResult { readonly revision: number; readonly claimId: string; readonly chargedBytes?: number; } /** @experimental A host must bind tool access to the executing turn, not just this source. */ export interface ResidentToolEvidenceSource { readonly scope: ResidentToolEvidenceScope; readonly supportsTermRefinement?: boolean; search(options?: ResidentToolEvidenceSearchOptions, signal?: AbortSignal): Promise; read(options: ResidentToolEvidenceReadOptions, signal?: AbortSignal): Promise; } /** @experimental Reuses the immutable agenda boundary; it never enumerates arbitrary sessions. */ export declare function createResidentToolEvidenceSource(options: ResidentToolEvidenceOptions): ResidentToolEvidenceSource; //# sourceMappingURL=tool-evidence.d.ts.map