This commit is contained in:
Dax Raad
2025-09-27 02:53:20 -04:00
parent 26ebf85b0e
commit d0043a4a78
8 changed files with 483 additions and 188 deletions

View File

@@ -21,21 +21,23 @@ import { Plugin } from "../plugin"
export namespace ToolRegistry {
// Built-in tools that ship with opencode
const BUILTIN = [
InvalidTool,
BashTool,
EditTool,
WebFetchTool,
GlobTool,
GrepTool,
ListTool,
PatchTool,
ReadTool,
WriteTool,
TodoWriteTool,
TodoReadTool,
TaskTool,
]
function builtin() {
return [
InvalidTool,
BashTool,
EditTool,
WebFetchTool,
GlobTool,
GrepTool,
ListTool,
PatchTool,
ReadTool,
WriteTool,
TodoWriteTool,
TodoReadTool,
TaskTool,
]
}
export const state = Instance.state(async () => {
const custom = [] as Tool.Info[]
@@ -91,7 +93,7 @@ export namespace ToolRegistry {
async function all(): Promise<Tool.Info[]> {
const custom = await state().then((x) => x.custom)
return [...BUILTIN, ...custom]
return [...builtin(), ...custom]
}
export async function ids() {