import type { TaskProfile } from '../akinator/types.js'; import type { SqliteDatabase } from '../db/adapter.js'; import { type FederatedOrigin } from '../memory/federated-retrieval.js'; import type { HybridSearchRuntime } from '../memory/hybrid-retrieval.js'; import { type ResolvedProjectWorkspace } from '../memory/workspaces.js'; import { type ProjectFingerprint } from '../repository/project-fingerprint.js'; export declare const SCOPED_CONTEXT_POLICY_VERSION: "context-ranking-v6"; export declare const SCOPED_CONTEXT_DEFAULT_CHARACTER_BUDGET = 8000; export declare const SCOPED_CONTEXT_MAX_CHARACTER_BUDGET = 100000; export interface ScopedContextQuery { cwd?: string; project?: ResolvedProjectWorkspace; fingerprint?: ProjectFingerprint; task: string; taskProfile: TaskProfile; recommendedTags?: string[]; changedPaths?: string[]; errorSignatures?: string[]; limit?: number; characterBudget?: number; runId?: string; } export interface ScopedContextItem { entryId: string; revision: number; origin: FederatedOrigin; title: string; summary: string | null; bodyPreview: string; score: number; scoreComponents: { status: number; trust: number; confidence: number; retrieval: number; taskAffinity: number; recommendedTags: number; scopeAffinity: number; applicability: number; pathOverlap: number; errorSignature: number; exactSignal: number; feedback: number; recency: number; contradiction: number; }; selectionReasons: string[]; metadata: { storedData: true; untrusted: true; instructions: false; }; } export interface ScopedContextResult { project: ResolvedProjectWorkspace | null; taskProfileHash: string; queryHash: string; policyVersion: typeof SCOPED_CONTEXT_POLICY_VERSION; items: ScopedContextItem[]; deliveryId: string | null; truncated: boolean; untrusted: true; } export interface ScopedContextGateDecision { persist: boolean; value: T; assertBeforePersist?: () => void; } export interface ScopedContextGatedResult { context: ScopedContextResult | null; value: T; /** Internal corpus generation used by callers that guard later side effects. */ selectionStateHash: string; } export declare function queryScopedContext(database: SqliteDatabase, raw: ScopedContextQuery, runtime?: HybridSearchRuntime): Promise; export declare function queryScopedContextGated(database: SqliteDatabase, raw: ScopedContextQuery, decide: (candidate: ScopedContextResult) => ScopedContextGateDecision, runtime?: HybridSearchRuntime): Promise>; //# sourceMappingURL=scoped-broker.d.ts.map