mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 20:01:24 +00:00
feat(coding-agent): add tool override support via extensions
- Add setActiveTools() to ExtensionAPI for dynamic tool management - Extensions can now override, wrap, or disable built-in tools - Add tool-override.ts example demonstrating the pattern - Update documentation for tool override capabilities
This commit is contained in:
parent
7a2c19cdf0
commit
e3dd4f21d1
10 changed files with 211 additions and 61 deletions
|
|
@ -514,7 +514,10 @@ export async function createAgentSession(options: CreateAgentSessionOptions = {}
|
|||
}
|
||||
|
||||
// Initially active tools = active built-in + extension tools
|
||||
let activeToolsArray: Tool[] = [...initialActiveBuiltInTools, ...wrappedExtensionTools];
|
||||
// Extension tools can override built-in tools with the same name
|
||||
const extensionToolNames = new Set(wrappedExtensionTools.map((t) => t.name));
|
||||
const nonOverriddenBuiltInTools = initialActiveBuiltInTools.filter((t) => !extensionToolNames.has(t.name));
|
||||
let activeToolsArray: Tool[] = [...nonOverriddenBuiltInTools, ...wrappedExtensionTools];
|
||||
time("combineTools");
|
||||
|
||||
// Wrap tools with extensions if available
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue