mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
tmp disable bash parsing
This commit is contained in:
parent
8034129051
commit
5328ce263c
1 changed files with 4 additions and 7 deletions
|
|
@ -3,22 +3,17 @@ import { exec } from "child_process"
|
|||
|
||||
import { Tool } from "./tool"
|
||||
import DESCRIPTION from "./bash.txt"
|
||||
import { Permission } from "../permission"
|
||||
import { Filesystem } from "../util/filesystem"
|
||||
import { lazy } from "../util/lazy"
|
||||
import { Log } from "../util/log"
|
||||
import { Wildcard } from "../util/wildcard"
|
||||
import { $ } from "bun"
|
||||
import { Instance } from "../project/instance"
|
||||
import { Agent } from "../agent/agent"
|
||||
|
||||
const MAX_OUTPUT_LENGTH = 30_000
|
||||
const DEFAULT_TIMEOUT = 1 * 60 * 1000
|
||||
const MAX_TIMEOUT = 10 * 60 * 1000
|
||||
|
||||
const log = Log.create({ service: "bash-tool" })
|
||||
export const log = Log.create({ service: "bash-tool" })
|
||||
|
||||
const parser = lazy(async () => {
|
||||
export const parser = lazy(async () => {
|
||||
try {
|
||||
const { default: Parser } = await import("tree-sitter")
|
||||
const Bash = await import("tree-sitter-bash")
|
||||
|
|
@ -58,6 +53,7 @@ export const BashTool = Tool.define("bash", {
|
|||
}),
|
||||
async execute(params, ctx) {
|
||||
const timeout = Math.min(params.timeout ?? DEFAULT_TIMEOUT, MAX_TIMEOUT)
|
||||
/*
|
||||
const tree = await parser().then((p) => p.parse(params.command))
|
||||
if (!tree) {
|
||||
throw new Error("Failed to parse command")
|
||||
|
|
@ -150,6 +146,7 @@ export const BashTool = Tool.define("bash", {
|
|||
},
|
||||
})
|
||||
}
|
||||
*/
|
||||
|
||||
const process = exec(params.command, {
|
||||
cwd: Instance.directory,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue