import type { AgentMessage } from '@earendil-works/pi-agent-core'; import type { Config } from '../../config/schema.js'; import type { KnowledgeReadPolicy } from '../../knowledge-memory/index.js'; import { type RecallQueryPlanner } from './deep-recall.js'; import type { SessionStore } from '../../session/store.js'; import { type ExecutionContext } from './execution-context.js'; export interface ExecutionContextPlan { traceId: string; dynamicSystemContext?: string; executionContext?: ExecutionContext; estimatedTokens: number; contextChars: number; contextItemCount: number; } export interface ExecutionContextCoordinatorOptions { getConfig: () => Config | undefined; getSessionStore?: () => SessionStore; planRecallQueries?: (conversationId: string) => RecallQueryPlanner; getAccessForSession: (conversationId: string) => { userModel: boolean; knowledge: boolean; knowledgePolicy: KnowledgeReadPolicy; }; getWorkspaceIdForSession: (conversationId: string) => string; getProjectIdForSession: (conversationId: string) => string | undefined; } export declare class ExecutionContextCoordinator { private readonly options; private readonly queriesBySession; private readonly currentBySession; constructor(options: ExecutionContextCoordinatorOptions); forgetSession(conversationId: string): void; clear(): void; getCurrent(conversationId: string): ExecutionContext | undefined; prepare(userMessage: AgentMessage, conversationId: string, turnId: string, options?: { disableDeepRecall?: boolean; }): Promise; }