/** * Session Context Tracker * * Tracks agent and model context for each session, allowing: * - System transform hook to inject agent-specific prompts * - Todo enforcer and background tasks to preserve model context * * Flow: * 1. chat.message hook fires with { sessionID, agent, model } * 2. We store the mapping: sessionID -> { agent, model } * 3. experimental.chat.system.transform fires with { sessionID } * 4. We look up the context and inject the appropriate prompt * 5. Todo enforcer / background tasks use model context when sending prompts */ export interface SessionModel { providerID: string; modelID: string; } export interface SessionContext { agent?: string; model?: SessionModel; } /** * Record context (agent + model) for a session. * Called from chat.message hook. */ export declare function setSessionContext(sessionID: string, context: { agent?: string; model?: SessionModel; }): void; /** * Get the full context for a session. */ export declare function getSessionContext(sessionID: string): SessionContext | undefined; /** * Record which agent is active for a session (legacy helper). * Called from chat.message hook. */ export declare function setSessionAgent(sessionID: string, agent: string | undefined): void; /** * Get the active agent for a session. * Called from experimental.chat.system.transform hook. */ export declare function getSessionAgent(sessionID: string): string | undefined; /** * Get the active model for a session. */ export declare function getSessionModel(sessionID: string): SessionModel | undefined; /** * Clear tracking for a session (on deletion). */ export declare function clearSessionAgent(sessionID: string | undefined): void; /** * Check if an agent should receive orchestration injection. * Only build and plan agents get the orchestration prompt. */ export declare function shouldInjectOrchestration(agent: string | undefined): boolean; /** * Get the agent type for prompt selection. * Returns "build", "plan", or string for other agents. */ export declare function getOrchestrationAgentType(agent: string | undefined): "build" | "plan" | string | undefined;