Ship Paseo-equivalent provider snapshot, AgentComposerBar, ACP dispatch rewrite with streaming/persist, permission prompts, and agent commands. Follow-up: pane-scoped chat resolution, CoderMessageList tool timeline, WS user-delta replace, and inference orphan tool_call stripping. Archive openspec v2-2; update CHANGELOG and CURRENT. Co-authored-by: Cursor <cursoragent@cursor.com>
29 lines
953 B
TypeScript
29 lines
953 B
TypeScript
/** In-memory cache of ACP available_commands_update per task. */
|
|
|
|
import type { AgentCommand } from './provider-types.js';
|
|
import { mergeCommands } from './provider-commands.js';
|
|
|
|
export type { AgentCommand };
|
|
|
|
const commandsByTask = new Map<string, AgentCommand[]>();
|
|
|
|
export function setTaskCommands(taskId: string, commands: AgentCommand[]): void {
|
|
if (commands.length === 0) return;
|
|
commandsByTask.set(taskId, commands);
|
|
}
|
|
|
|
/** Merge by command name; later lists override earlier entries. */
|
|
export function mergeTaskCommands(taskId: string, commands: AgentCommand[]): void {
|
|
if (commands.length === 0) return;
|
|
const merged = mergeCommands(commandsByTask.get(taskId) ?? [], commands);
|
|
commandsByTask.set(taskId, merged);
|
|
}
|
|
|
|
export function getTaskCommands(taskId: string): AgentCommand[] | null {
|
|
return commandsByTask.get(taskId) ?? null;
|
|
}
|
|
|
|
export function clearTaskCommands(taskId: string): void {
|
|
commandsByTask.delete(taskId);
|
|
}
|