The open source coding agent.
TypeScript
chore: kill some unused tools
Aiden Cline1e2ef07c9789
diff --git a/packages/opencode/src/tool/lsp-diagnostics.ts b/packages/opencode/src/tool/lsp-diagnostics.tsdeleted file mode 100644index 18a6868b677..00000000000--- a/packages/opencode/src/tool/lsp-diagnostics.ts+++ /dev/null@@ -1,26 +0,0 @@-import z from "zod"-import { Tool } from "./tool"-import path from "path"-import { LSP } from "../lsp"-import DESCRIPTION from "./lsp-diagnostics.txt"-import { Instance } from "../project/instance"--export const LspDiagnosticTool = Tool.define("lsp_diagnostics", {- description: DESCRIPTION,- parameters: z.object({- path: z.string().describe("The path to the file to get diagnostics."),- }),- execute: async (args) => {- const normalized = path.isAbsolute(args.path) ? args.path : path.join(Instance.directory, args.path)- await LSP.touchFile(normalized, true)- const diagnostics = await LSP.diagnostics()- const file = diagnostics[normalized]- return {- title: path.relative(Instance.worktree, normalized),- metadata: {- diagnostics,- },- output: file?.length ? file.map(LSP.Diagnostic.pretty).join("\n") : "No errors found",- }- },-})diff --git a/packages/opencode/src/tool/lsp-diagnostics.txt b/packages/opencode/src/tool/lsp-diagnostics.txtdeleted file mode 100644index 88a50f6347a..00000000000--- a/packages/opencode/src/tool/lsp-diagnostics.txt+++ /dev/null@@ -1 +0,0 @@-do not usediff --git a/packages/opencode/src/tool/lsp-hover.ts b/packages/opencode/src/tool/lsp-hover.tsdeleted file mode 100644index 7ef856cc567..00000000000--- a/packages/opencode/src/tool/lsp-hover.ts+++ /dev/null@@ -1,31 +0,0 @@-import z from "zod"-import { Tool } from "./tool"-import path from "path"-import { LSP } from "../lsp"-import DESCRIPTION from "./lsp-hover.txt"-import { Instance } from "../project/instance"--export const LspHoverTool = Tool.define("lsp_hover", {- description: DESCRIPTION,- parameters: z.object({- file: z.string().describe("The path to the file to get diagnostics."),- line: z.number().describe("The line number to get diagnostics."),- character: z.number().describe("The character number to get diagnostics."),- }),- execute: async (args) => {- const file = path.isAbsolute(args.file) ? args.file : path.join(Instance.directory, args.file)- await LSP.touchFile(file, true)- const result = await LSP.hover({- ...args,- file,- })-- return {- title: path.relative(Instance.worktree, file) + ":" + args.line + ":" + args.character,- metadata: {- result,- },- output: JSON.stringify(result, null, 2),- }- },-})diff --git a/packages/opencode/src/tool/lsp-hover.txt b/packages/opencode/src/tool/lsp-hover.txtdeleted file mode 100644index 88a50f6347a..00000000000--- a/packages/opencode/src/tool/lsp-hover.txt+++ /dev/null@@ -1 +0,0 @@-do not use