mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 08:02:17 +00:00
feat(coding-agent): add input event for extension input interception (#761)
* feat(coding-agent): add input event for extension input interception Extensions can now intercept, transform, or handle user input before the agent processes it. Three result types: continue (pass through), transform (modify text/images), handled (respond without LLM). Handlers chain transforms and short-circuit on handled. Source field identifies origin. * fix: make source public, use if/else over ternary * fix: remove response field, extension handles own UI
This commit is contained in:
parent
012319e15a
commit
3e5d91f287
11 changed files with 282 additions and 5 deletions
|
|
@ -99,7 +99,7 @@ export async function runPrintMode(session: AgentSession, options: PrintModeOpti
|
|||
return { cancelled: result.cancelled };
|
||||
},
|
||||
},
|
||||
// No UI context
|
||||
// No UI context - hasUI will be false
|
||||
);
|
||||
extensionRunner.onError((err) => {
|
||||
console.error(`Extension error (${err.extensionPath}): ${err.error}`);
|
||||
|
|
|
|||
|
|
@ -348,6 +348,7 @@ export async function runRpcMode(session: AgentSession): Promise<never> {
|
|||
.prompt(command.message, {
|
||||
images: command.images,
|
||||
streamingBehavior: command.streamingBehavior,
|
||||
source: "rpc",
|
||||
})
|
||||
.catch((e) => output(error(id, "prompt", e.message)));
|
||||
return success(id, "prompt");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue