fix: improve glob tool Windows compatibility and rg resolution (#309)

This commit is contained in:
Sisyphus
2025-12-29 10:10:22 +09:00
committed by GitHub
parent 55a3a6c9eb
commit 6dd98254be
4 changed files with 71 additions and 14 deletions
+9 -4
View File
@@ -1,5 +1,6 @@
import { tool, type ToolDefinition } from "@opencode-ai/plugin/tool"
import { runRgFiles } from "./cli"
import { resolveGrepCliWithAutoInstall } from "./constants"
import { formatGlobResult } from "./utils"
export const glob: ToolDefinition = tool({
@@ -21,12 +22,16 @@ export const glob: ToolDefinition = tool({
},
execute: async (args) => {
try {
const cli = await resolveGrepCliWithAutoInstall()
const paths = args.path ? [args.path] : undefined
const result = await runRgFiles({
pattern: args.pattern,
paths,
})
const result = await runRgFiles(
{
pattern: args.pattern,
paths,
},
cli
)
return formatGlobResult(result)
} catch (e) {