mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-23 16:42:19 +00:00
* fix(ai): place host_open tabs in the invoking chat's bound workspace * fix(ai): sync generated host open workspace guidance * fix(ai): preserve invoking turn scope for resumed chats --------- Co-authored-by: GOUKI9999 <GOUKI9999@users.noreply.github.com> Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
24 lines
857 B
TypeScript
24 lines
857 B
TypeScript
import type { AISessionScope } from '../types';
|
|
|
|
/**
|
|
* Lets startup code clean up per-chat / per-terminal agent runtime state
|
|
* without importing the runtime itself, which pulls the Catty harness and the
|
|
* AI SDK providers into the startup bundle. globalAgentRuntime registers here
|
|
* when it is created; before that there is no in-memory state to clear.
|
|
*/
|
|
export interface AgentRuntimeCleanup {
|
|
clearChatSession(chatSessionId: string): void;
|
|
clearTerminalSession(terminalSessionId: string): void;
|
|
getActiveScope?(chatSessionId: string): AISessionScope | undefined;
|
|
}
|
|
|
|
let registeredRuntime: AgentRuntimeCleanup | null = null;
|
|
|
|
export function registerAgentRuntimeCleanup(runtime: AgentRuntimeCleanup): void {
|
|
registeredRuntime = runtime;
|
|
}
|
|
|
|
export function peekAgentRuntimeCleanup(): AgentRuntimeCleanup | null {
|
|
return registeredRuntime;
|
|
}
|