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 { MemorySearchResult } from '../memory/types.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; getAccessForSession: (conversationId: string) => { userModel: boolean; knowledge: boolean; knowledgePolicy: KnowledgeReadPolicy; }; getWorkspaceIdForSession: (conversationId: string) => string; getProjectIdForSession: (conversationId: string) => string | undefined; ensureMemoryReady: (conversationId: string) => Promise; searchExternalMemory: (input: { query: string; conversationId: string; agentId: string; workspaceId: string; projectId?: string; maxResults: number; }) => Promise; } export declare class ExecutionContextCoordinator { private readonly options; private readonly currentBySession; constructor(options: ExecutionContextCoordinatorOptions); forgetSession(conversationId: string): void; clear(): void; getCurrent(conversationId: string): ExecutionContext | undefined; prepare(userMessage: AgentMessage, conversationId: string, turnId: string): Promise; }