ci: new publish method (#1451)
This commit is contained in:
@@ -2,20 +2,17 @@ import { z } from "zod"
|
|||||||
import { Tool } from "./tool"
|
import { Tool } from "./tool"
|
||||||
import DESCRIPTION from "./bash.txt"
|
import DESCRIPTION from "./bash.txt"
|
||||||
import { App } from "../app/app"
|
import { App } from "../app/app"
|
||||||
import path from "path"
|
|
||||||
|
|
||||||
import Parser from "tree-sitter"
|
// import Parser from "tree-sitter"
|
||||||
import Bash from "tree-sitter-bash"
|
// import Bash from "tree-sitter-bash"
|
||||||
import { Config } from "../config/config"
|
// import { Config } from "../config/config"
|
||||||
import { Filesystem } from "../util/filesystem"
|
|
||||||
import { Permission } from "../permission"
|
|
||||||
|
|
||||||
const MAX_OUTPUT_LENGTH = 30000
|
const MAX_OUTPUT_LENGTH = 30000
|
||||||
const DEFAULT_TIMEOUT = 1 * 60 * 1000
|
const DEFAULT_TIMEOUT = 1 * 60 * 1000
|
||||||
const MAX_TIMEOUT = 10 * 60 * 1000
|
const MAX_TIMEOUT = 10 * 60 * 1000
|
||||||
|
|
||||||
const parser = new Parser()
|
// const parser = new Parser()
|
||||||
parser.setLanguage(Bash.language as any)
|
// parser.setLanguage(Bash.language as any)
|
||||||
|
|
||||||
export const BashTool = Tool.define("bash", {
|
export const BashTool = Tool.define("bash", {
|
||||||
description: DESCRIPTION,
|
description: DESCRIPTION,
|
||||||
@@ -30,9 +27,10 @@ export const BashTool = Tool.define("bash", {
|
|||||||
}),
|
}),
|
||||||
async execute(params, ctx) {
|
async execute(params, ctx) {
|
||||||
const timeout = Math.min(params.timeout ?? DEFAULT_TIMEOUT, MAX_TIMEOUT)
|
const timeout = Math.min(params.timeout ?? DEFAULT_TIMEOUT, MAX_TIMEOUT)
|
||||||
const tree = parser.parse(params.command)
|
|
||||||
const cfg = await Config.get()
|
|
||||||
const app = App.info()
|
const app = App.info()
|
||||||
|
/*
|
||||||
|
const _cfg = await Config.get()
|
||||||
|
const tree = parser.parse(params.command)
|
||||||
const permissions = (() => {
|
const permissions = (() => {
|
||||||
const value = cfg.permission?.bash
|
const value = cfg.permission?.bash
|
||||||
if (!value)
|
if (!value)
|
||||||
@@ -101,6 +99,7 @@ export const BashTool = Tool.define("bash", {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
const process = Bun.spawn({
|
const process = Bun.spawn({
|
||||||
cmd: ["bash", "-c", params.command],
|
cmd: ["bash", "-c", params.command],
|
||||||
|
|||||||
Reference in New Issue
Block a user