32 lines
763 B
TypeScript
32 lines
763 B
TypeScript
import { Tool } from "..";
|
|
|
|
export const runTerminalCommandTool: Tool = {
|
|
type: "function",
|
|
action: async (args, extras) => {
|
|
const output = await extras.ide.runCommand(args.command);
|
|
|
|
return [];
|
|
// return [
|
|
// {
|
|
// description: "The contents of the terminal",
|
|
// content: output,
|
|
// name: "Terminal",
|
|
// },
|
|
// ];
|
|
},
|
|
function: {
|
|
name: "run_terminal_command",
|
|
description: "Run a terminal command in the current directory",
|
|
parameters: {
|
|
type: "object",
|
|
required: ["command"],
|
|
properties: {
|
|
command: {
|
|
type: "string",
|
|
description:
|
|
"The command to run. This will be passed directly into the shell.",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|