import type { AgentMessage } from '@earendil-works/pi-agent-core'; import type { Config } from '../../config/schema.js'; import type { KnowledgeSource } from '../../knowledge-memory/index.js'; import { type ExecutionContext } from './execution-context.js'; export interface ExecutionContextPlan { traceId: string; modelMessage: AgentMessage; executionContext?: ExecutionContext; estimatedTokens: number; contextChars: number; contextItemCount: number; } export interface ExecutionContextCoordinatorOptions { getConfig: () => Config | undefined; getAccessForSession: (sessionKey: string) => { userModel: boolean; knowledge: boolean; knowledgeSources: readonly KnowledgeSource[]; }; getWorkspaceIdForSession: (sessionKey: string) => string; getProjectIdForSession: (sessionKey: string) => string | undefined; } export declare class ExecutionContextCoordinator { private readonly options; private readonly currentBySession; constructor(options: ExecutionContextCoordinatorOptions); forgetSession(sessionKey: string): void; clear(): void; getCurrent(sessionKey: string): ExecutionContext | undefined; prepare(userMessage: AgentMessage, sessionKey: string, turnId: string): Promise; }