@agenticforge/tools 1.1.1 → 1.1.3

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.md CHANGED
@@ -3,27 +3,27 @@
3
3
  [![npm](https://img.shields.io/npm/v/@agenticforge/tools)](https://www.npmjs.com/package/@agenticforge/tools)
4
4
  [![license](https://img.shields.io/github/license/LittleBlacky/AgenticFORGE)](https://github.com/LittleBlacky/AgenticFORGE/blob/main/LICENSE)
5
5
 
6
- AgenticFORGE 工具核心包,提供 Tool 抽象、ToolRegistry、ToolChain 与异步执行器。
6
+ <p><a href="./README.zh_CN.md">中文</a> | <strong>English</strong></p>
7
7
 
8
- > Tool abstraction, registry, chain, and async executor for AgenticFORGE.
8
+ Tool abstraction layer for AgenticFORGE �?`Tool` base class, `ToolRegistry`, `ToolChain`, and async executor.
9
9
 
10
- ## 安装
10
+ ## Installation
11
11
 
12
12
  ```bash
13
13
  npm install @agenticforge/tools
14
14
  ```
15
15
 
16
- ## 主要导出
16
+ ## Exports
17
17
 
18
- | 名称 | 说明 |
19
- |------|------|
20
- | `Tool` | 工具基类,封装参数定义与执行逻辑 |
21
- | `toolAction` | 工具动作工厂,结合 Zod 做参数校验 |
22
- | `ToolRegistry` | 工具注册表,统一管理可用工具 |
23
- | `ToolChain` | 工具链,支持顺序/并行组合多个工具 |
24
- | `AsyncToolExecutor` | 异步工具执行器,支持超时与并发控制 |
18
+ | Name | Description |
19
+ |------|-------------|
20
+ | `Tool` | Tool base class �?wraps parameter definitions and execution logic |
21
+ | `toolAction` | Tool action factory with Zod-based parameter validation |
22
+ | `ToolRegistry` | Registry for managing available tools |
23
+ | `ToolChain` | Tool chain �?compose multiple tools in sequence or parallel |
24
+ | `AsyncToolExecutor` | Async tool executor with timeout and concurrency control |
25
25
 
26
- ## 使用示例
26
+ ## Usage
27
27
 
28
28
  ```ts
29
29
  import {Tool, toolAction, ToolRegistry} from "@agenticforge/tools";
@@ -31,12 +31,12 @@ import {z} from "zod";
31
31
 
32
32
  const searchTool = new Tool({
33
33
  name: "search",
34
- description: "搜索互联网信息",
34
+ description: "Search the web for information",
35
35
  parameters: [
36
- {name: "query", type: "string", description: "搜索关键词", required: true},
36
+ {name: "query", type: "string", description: "Search query", required: true},
37
37
  ],
38
38
  action: toolAction(z.object({query: z.string()}), async ({query}) => {
39
- return `搜索结果:${query} 相关内容...`;
39
+ return `Search results for: ${query}`;
40
40
  }),
41
41
  });
42
42
 
@@ -48,8 +48,8 @@ const result = await tool.execute({query: "AgenticFORGE"});
48
48
  console.log(result);
49
49
  ```
50
50
 
51
- ## 链接
51
+ ## Links
52
52
 
53
53
  - [GitHub](https://github.com/LittleBlacky/AgenticFORGE/tree/main/packages/tools)
54
54
  - [npm](https://www.npmjs.com/package/@agenticforge/tools)
55
- - [主项目 README](https://github.com/LittleBlacky/AgenticFORGE)
55
+ - [Root README](https://github.com/LittleBlacky/AgenticFORGE)
@@ -0,0 +1,51 @@
1
+ # @agenticforge/tools
2
+
3
+ [![npm](https://img.shields.io/npm/v/@agenticforge/tools)](https://www.npmjs.com/package/@agenticforge/tools)
4
+ [![license](https://img.shields.io/github/license/LittleBlacky/AgenticFORGE)](https://github.com/LittleBlacky/AgenticFORGE/blob/main/LICENSE)
5
+
6
+ <p><strong>中文</strong> | <a href="./README.md">English</a></p>
7
+
8
+ AgenticFORGE 工具核心包,提供 Tool 抽象、ToolRegistry、ToolChain 与异步执行器。
9
+
10
+ ## 安装
11
+
12
+ ```bash
13
+ npm install @agenticforge/tools
14
+ ```
15
+
16
+ ## 主要导出
17
+
18
+ | 名称 | 说明 |
19
+ |------|------|
20
+ | `Tool` | 工具基类,封装参数定义与执行逻辑 |
21
+ | `toolAction` | 工具动作工厂,结合 Zod 做参数校验 |
22
+ | `ToolRegistry` | 工具注册表,统一管理可用工具 |
23
+ | `ToolChain` | 工具链,支持顺序/并行组合多个工具 |
24
+ | `AsyncToolExecutor` | 异步工具执行器,支持超时与并发控制 |
25
+
26
+ ## 使用示例
27
+
28
+ ```ts
29
+ import {Tool, toolAction, ToolRegistry} from "@agenticforge/tools";
30
+ import {z} from "zod";
31
+
32
+ const searchTool = new Tool({
33
+ name: "search",
34
+ description: "搜索互联网信息",
35
+ parameters: [{name: "query", type: "string", required: true}],
36
+ action: toolAction(z.object({query: z.string()}), async ({query}) => {
37
+ return `搜索结果:${query} 相关内容...`;
38
+ }),
39
+ });
40
+
41
+ const registry = new ToolRegistry();
42
+ registry.register(searchTool);
43
+ const result = await registry.get("search").execute({query: "AgenticFORGE"});
44
+ console.log(result);
45
+ ```
46
+
47
+ ## 链接
48
+
49
+ - [GitHub](https://github.com/LittleBlacky/AgenticFORGE/tree/main/packages/tools)
50
+ - [npm](https://www.npmjs.com/package/@agenticforge/tools)
51
+ - [主项目 README](https://github.com/LittleBlacky/AgenticFORGE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticforge/tools",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Tooling core for AgenticFORGE",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -48,5 +48,18 @@
48
48
  "homepage": "https://github.com/LittleBlacky/AgenticFORGE/tree/main/packages/tools#readme",
49
49
  "bugs": {
50
50
  "url": "https://github.com/LittleBlacky/AgenticFORGE/issues"
51
- }
51
+ },
52
+ "license": "CC-BY-NC-SA-4.0",
53
+ "keywords": [
54
+ "agenticforge",
55
+ "agent",
56
+ "ai",
57
+ "llm",
58
+ "typescript",
59
+ "tool",
60
+ "tool-registry",
61
+ "tool-chain",
62
+ "function-calling",
63
+ "zod"
64
+ ]
52
65
  }
package/README.en.md DELETED
@@ -1,53 +0,0 @@
1
- # @agenticforge/tools
2
-
3
- [![npm](https://img.shields.io/npm/v/@agenticforge/tools)](https://www.npmjs.com/package/@agenticforge/tools)
4
- [![license](https://img.shields.io/github/license/LittleBlacky/AgenticFORGE)](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)