chore: format code

This commit is contained in:
GitHub Action
2025-11-08 01:59:02 +00:00
parent 16357e8041
commit 34ff87d504
182 changed files with 940 additions and 3646 deletions

View File

@@ -51,9 +51,7 @@ export const BashTool = Tool.define("bash", {
}),
async execute(params, ctx) {
if (params.timeout !== undefined && params.timeout < 0) {
throw new Error(
`Invalid timeout value: ${params.timeout}. Timeout must be a positive number.`,
)
throw new Error(`Invalid timeout value: ${params.timeout}. Timeout must be a positive number.`)
}
const timeout = Math.min(params.timeout ?? DEFAULT_TIMEOUT, MAX_TIMEOUT)
const tree = await parser().then((p) => p.parse(params.command))
@@ -101,10 +99,7 @@ export const BashTool = Tool.define("bash", {
// always allow cd if it passes above check
if (command[0] !== "cd") {
const action = Wildcard.allStructured(
{ head: command[0], tail: command.slice(1) },
permissions,
)
const action = Wildcard.allStructured({ head: command[0], tail: command.slice(1) }, permissions)
if (action === "deny") {
throw new Error(
`The user has specifically restricted access to this command, you are not allowed to execute it. Here is the configuration: ${JSON.stringify(permissions)}`,