v2.2-paseo-providers: Paseo provider stack + v2.2.1 pane-scoped chat fixes
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>
This commit is contained in:
28
apps/coder/src/services/agent-commands-cache.ts
Normal file
28
apps/coder/src/services/agent-commands-cache.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/** 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);
|
||||
}
|
||||
Reference in New Issue
Block a user