fix(explore): allow LSP and ast-grep tools

This commit is contained in:
chan1103
2026-04-17 16:42:43 +09:00
parent f3af23565e
commit 73f09fdb37
2 changed files with 10 additions and 11 deletions
+4 -7
View File
@@ -25,13 +25,10 @@ export const EXPLORE_PROMPT_METADATA: AgentPromptMetadata = {
} }
export function createExploreAgent(model: string): AgentConfig { export function createExploreAgent(model: string): AgentConfig {
const restrictions = createAgentToolRestrictions([ const restrictions = createAgentToolRestrictions(
"write", ["write", "edit", "apply_patch", "task", "call_omo_agent"],
"edit", ["lsp_symbols", "lsp_goto_definition", "lsp_find_references", "lsp_diagnostics", "ast_grep_search"],
"apply_patch", )
"task",
"call_omo_agent",
])
return { return {
description: description:
+6 -4
View File
@@ -13,12 +13,14 @@ export interface PermissionFormat {
* Creates tool restrictions that deny specified tools. * Creates tool restrictions that deny specified tools.
*/ */
export function createAgentToolRestrictions( export function createAgentToolRestrictions(
denyTools: string[] denyTools: string[],
allowTools: string[] = [],
): PermissionFormat { ): PermissionFormat {
return { return {
permission: Object.fromEntries( permission: Object.fromEntries([
denyTools.map((tool) => [tool, "deny" as const]) ...denyTools.map((tool) => [tool, "deny" as const]),
), ...allowTools.map((tool) => [tool, "allow" as const]),
]),
} }
} }