@thenajs/tools 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/shell.tool.d.ts +6 -0
- package/dist/shell.tool.d.ts.map +1 -0
- package/dist/shell.tool.js +26 -0
- package/dist/shell.tool.js.map +1 -0
- package/package.json +27 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.tool.d.ts","sourceRoot":"","sources":["../src/shell.tool.ts"],"names":[],"mappings":"AAOA,qBAKa,SAAS;IACd,OAAO,CAAC,EAAE,OAAO,EAAE,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE;CAI/C"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { exec } from "node:child_process";
|
|
8
|
+
import { promisify } from "node:util";
|
|
9
|
+
import { Tool } from "@thenajs/core";
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
const run = promisify(exec);
|
|
12
|
+
let ShellTool = class ShellTool {
|
|
13
|
+
async execute({ command }) {
|
|
14
|
+
const { stdout, stderr } = await run(command);
|
|
15
|
+
return stdout || stderr;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
ShellTool = __decorate([
|
|
19
|
+
Tool({
|
|
20
|
+
name: "shell",
|
|
21
|
+
description: "Executa um comando shell e retorna a saída.",
|
|
22
|
+
schema: z.object({ command: z.string() }),
|
|
23
|
+
})
|
|
24
|
+
], ShellTool);
|
|
25
|
+
export { ShellTool };
|
|
26
|
+
//# sourceMappingURL=shell.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.tool.js","sourceRoot":"","sources":["../src/shell.tool.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAOrB,IAAM,SAAS,GAAf,MAAM,SAAS;IACpB,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAuB;QAC5C,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC;QAC9C,OAAO,MAAM,IAAI,MAAM,CAAC;IAC1B,CAAC;CACF,CAAA;AALY,SAAS;IALrB,IAAI,CAAC;QACJ,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,6CAA6C;QAC1D,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;KAC1C,CAAC;GACW,SAAS,CAKrB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@thenajs/tools",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Tools prontas para agentes ThenaJs (ex.: ShellTool).",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "castroneto",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/thenajs/ThenaJS.git",
|
|
10
|
+
"directory": "packages/tools"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/thenajs/ThenaJS#readme",
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"files": ["dist"],
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@thenajs/core": "^0.1.1",
|
|
25
|
+
"zod": "^4.0.0"
|
|
26
|
+
}
|
|
27
|
+
}
|