Merge pull request #3488 from chan1103/fix/explore-allow-lsp-ast-grep
fix(explore): allow LSP and ast-grep tools
This commit is contained in:
@@ -25,13 +25,10 @@ export const EXPLORE_PROMPT_METADATA: AgentPromptMetadata = {
|
||||
}
|
||||
|
||||
export function createExploreAgent(model: string): AgentConfig {
|
||||
const restrictions = createAgentToolRestrictions([
|
||||
"write",
|
||||
"edit",
|
||||
"apply_patch",
|
||||
"task",
|
||||
"call_omo_agent",
|
||||
])
|
||||
const restrictions = createAgentToolRestrictions(
|
||||
["write", "edit", "apply_patch", "task", "call_omo_agent"],
|
||||
["lsp_symbols", "lsp_goto_definition", "lsp_find_references", "lsp_diagnostics", "ast_grep_search"],
|
||||
)
|
||||
|
||||
return {
|
||||
description:
|
||||
|
||||
@@ -13,12 +13,14 @@ export interface PermissionFormat {
|
||||
* Creates tool restrictions that deny specified tools.
|
||||
*/
|
||||
export function createAgentToolRestrictions(
|
||||
denyTools: string[]
|
||||
denyTools: string[],
|
||||
allowTools: string[] = [],
|
||||
): PermissionFormat {
|
||||
return {
|
||||
permission: Object.fromEntries(
|
||||
denyTools.map((tool) => [tool, "deny" as const])
|
||||
),
|
||||
permission: Object.fromEntries([
|
||||
...denyTools.map((tool) => [tool, "deny" as const]),
|
||||
...allowTools.map((tool) => [tool, "allow" as const]),
|
||||
]),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user