@agenticforge/tools 1.1.0 → 1.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/README.en.md +53 -0
- package/package.json +52 -52
package/README.en.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# @agenticforge/tools
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@agenticforge/tools)
|
|
4
|
+
[](https://github.com/LittleBlacky/AgenticFORGE/blob/main/LICENSE)
|
|
5
|
+
|
|
6
|
+
Tool abstraction layer for AgenticFORGE — `Tool` base class, `ToolRegistry`, `ToolChain`, and async executor.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @agenticforge/tools
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Exports
|
|
15
|
+
|
|
16
|
+
| Name | Description |
|
|
17
|
+
|------|-------------|
|
|
18
|
+
| `Tool` | Tool base class — wraps parameter definitions and execution logic |
|
|
19
|
+
| `toolAction` | Tool action factory with Zod-based parameter validation |
|
|
20
|
+
| `ToolRegistry` | Registry for managing available tools |
|
|
21
|
+
| `ToolChain` | Tool chain — compose multiple tools in sequence or parallel |
|
|
22
|
+
| `AsyncToolExecutor` | Async tool executor with timeout and concurrency control |
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import {Tool, toolAction, ToolRegistry} from "@agenticforge/tools";
|
|
28
|
+
import {z} from "zod";
|
|
29
|
+
|
|
30
|
+
const searchTool = new Tool({
|
|
31
|
+
name: "search",
|
|
32
|
+
description: "Search the web for information",
|
|
33
|
+
parameters: [
|
|
34
|
+
{name: "query", type: "string", description: "Search query", required: true},
|
|
35
|
+
],
|
|
36
|
+
action: toolAction(z.object({query: z.string()}), async ({query}) => {
|
|
37
|
+
return `Search results for: ${query}`;
|
|
38
|
+
}),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const registry = new ToolRegistry();
|
|
42
|
+
registry.register(searchTool);
|
|
43
|
+
|
|
44
|
+
const tool = registry.get("search");
|
|
45
|
+
const result = await tool.execute({query: "AgenticFORGE"});
|
|
46
|
+
console.log(result);
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Links
|
|
50
|
+
|
|
51
|
+
- [GitHub](https://github.com/LittleBlacky/AgenticFORGE/tree/main/packages/tools)
|
|
52
|
+
- [npm](https://www.npmjs.com/package/@agenticforge/tools)
|
|
53
|
+
- [Root README](https://github.com/LittleBlacky/AgenticFORGE)
|
package/package.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@agenticforge/tools",
|
|
3
|
+
"version": "1.1.1",
|
|
4
|
+
"description": "Tooling core for AgenticFORGE",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"main": "./dist/cjs/index.cjs",
|
|
8
|
+
"module": "./dist/esm/index.js",
|
|
9
|
+
"types": "./dist/types/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/types/index.d.ts",
|
|
13
|
+
"import": "./dist/esm/index.js",
|
|
14
|
+
"require": "./dist/cjs/index.cjs"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"clean": "rimraf dist",
|
|
22
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
23
|
+
"build:types": "tsc -p tsconfig.build.json",
|
|
24
|
+
"build:js": "rollup -c",
|
|
25
|
+
"build": "pnpm run clean && pnpm run typecheck && pnpm run build:types && pnpm run build:js"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"reflect-metadata": "^0.2.2",
|
|
29
|
+
"zod": "^4.3.6"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@rollup/plugin-commonjs": "^28.0.8",
|
|
33
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
34
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
35
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
36
|
+
"@types/node": "^25.3.3",
|
|
37
|
+
"rimraf": "^6.0.1",
|
|
38
|
+
"rollup": "^4.50.1",
|
|
39
|
+
"rollup-plugin-esbuild": "^6.2.1",
|
|
40
|
+
"tsx": "^4.21.0",
|
|
41
|
+
"typescript": "~5.9.3"
|
|
42
|
+
},
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "https://github.com/LittleBlacky/AgenticFORGE.git",
|
|
46
|
+
"directory": "packages/tools"
|
|
47
|
+
},
|
|
48
|
+
"homepage": "https://github.com/LittleBlacky/AgenticFORGE/tree/main/packages/tools#readme",
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "https://github.com/LittleBlacky/AgenticFORGE/issues"
|
|
51
|
+
}
|
|
52
|
+
}
|