- Add Vite as alternative build (vite.config.ts, scripts/vite-plugin-*)
- Add dab04af7 RSS fix (distRoot, ripgrep path, post-build)
- Pull in packages/builtin-tools/ (+354 files)
- Pull in packages/agent-tools/, mcp-client/, acp-link/, weixin/
- Copy defines.ts from upstream for Vite compatibility
- Update package.json with Vite scripts and deps
22 lines
515 B
TypeScript
22 lines
515 B
TypeScript
import type { CoreTool, Tools } from './types.js'
|
|
|
|
/**
|
|
* Checks if a tool matches the given name (primary name or alias).
|
|
*/
|
|
export function toolMatchesName(
|
|
tool: { name: string; aliases?: string[] },
|
|
name: string,
|
|
): boolean {
|
|
return tool.name === name || (tool.aliases?.includes(name) ?? false)
|
|
}
|
|
|
|
/**
|
|
* Finds a tool by name or alias from a list of tools.
|
|
*/
|
|
export function findToolByName(
|
|
tools: Tools,
|
|
name: string,
|
|
): CoreTool | undefined {
|
|
return tools.find(t => toolMatchesName(t, name))
|
|
}
|