mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 02:01:29 +00:00
Change getAllTools() to return ToolInfo[] instead of string[]
Breaking change: pi.getAllTools() now returns Array<{ name, description }>
instead of string[]. Extensions needing just names can use .map(t => t.name).
Removes redundant getToolInfo() method added in original PR.
Fixes #647
This commit is contained in:
parent
34ecca352e
commit
1367a76ee8
12 changed files with 34 additions and 19 deletions
|
|
@ -133,9 +133,9 @@ export default function presetExtension(pi: ExtensionAPI) {
|
|||
|
||||
// Apply tools if specified
|
||||
if (preset.tools && preset.tools.length > 0) {
|
||||
const allTools = pi.getAllTools();
|
||||
const validTools = preset.tools.filter((t) => allTools.includes(t));
|
||||
const invalidTools = preset.tools.filter((t) => !allTools.includes(t));
|
||||
const allToolNames = pi.getAllTools().map((t) => t.name);
|
||||
const validTools = preset.tools.filter((t) => allToolNames.includes(t));
|
||||
const invalidTools = preset.tools.filter((t) => !allToolNames.includes(t));
|
||||
|
||||
if (invalidTools.length > 0) {
|
||||
ctx.ui.notify(`Preset "${name}": Unknown tools: ${invalidTools.join(", ")}`, "warning");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue