@easynet/agent-tool 1.0.92 → 1.0.93

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.
Files changed (2) hide show
  1. package/README.md +13 -32
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,55 +1,36 @@
1
1
  # @easynet/agent-tool
2
2
 
3
- 工具运行时包。最小目标:从 `tool.yaml` 生成可给 LangChain 使用的 tools。
3
+ ## Introduction
4
4
 
5
- ## 最小接口
5
+ `@easynet/agent-tool` loads tool definitions from `tool.yaml`, creates LangChain-compatible tools, and registers them into the default `AgentContext`.
6
6
 
7
- ```ts
8
- import { createAgentTools } from "@easynet/agent-tool";
7
+ ## API Reference
9
8
 
10
- // 不传参数:使用内嵌的默认 config/tool.yaml
11
- const tools = createAgentTools();
9
+ | API | What it does | Minimal usage |
10
+ | --- | --- | --- |
11
+ | `createAgentTools` | Load tools and register them into `AgentContext`. | `const tools = createAgentTools({ configFilePath: "./tool.yaml" })` |
12
12
 
13
- // 传入路径:以项目 tool.yaml 覆盖内嵌默认值
14
- const tools = createAgentTools({ configFilePath: "./tool.yaml" });
15
- console.log(tools.map((t) => t.name));
16
- ```
13
+ ## Usage
17
14
 
18
- ## 最小 `tool.yaml`
15
+ Create `tool.yaml`:
19
16
 
20
17
  ```yaml
21
18
  tools:
22
- # FS 工具沙箱根目录(相对路径按当前项目解析)
23
19
  sandboxedPath: .
24
-
25
- # HTTP 允许列表。先给空数组,表示默认禁用外网请求(更安全)
26
20
  allowedHosts: []
27
21
  blockedHosts: []
28
-
29
- # 最小起步:直接加载内置工具包(全部工具)
30
22
  list:
31
23
  - npm:@easynet/agent-tool-buildin
32
24
  ```
33
25
 
34
- ## 最简单示例(带注释)
26
+ Load tools:
35
27
 
36
28
  ```ts
37
29
  import { createAgentTools } from "@easynet/agent-tool";
38
30
 
39
- async function main() {
40
- // 1) 直接获取 LangChain tools(覆盖内嵌默认 config/tool.yaml
41
- const tools = createAgentTools({ configFilePath: "./tool.yaml" });
42
- console.log("loaded tools:", tools.map((t) => t.name));
43
- }
31
+ const tools = createAgentTools({
32
+ configFilePath: "./tool.yaml",
33
+ });
44
34
 
45
- main().catch(console.error);
35
+ console.log(tools.map((tool) => tool.name));
46
36
  ```
47
-
48
- ## 进阶能力
49
-
50
- - 扩展 SDK:`@easynet/agent-tool/sdk`
51
- - 扩展开发:`createExtension(...)`、`generateManifest(...)`
52
-
53
- ## 启动与简单测试
54
-
55
- - 启动示例:`npm run example:start`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easynet/agent-tool",
3
- "version": "1.0.92",
3
+ "version": "1.0.93",
4
4
  "description": "MCP build: init → build → run. Turn your project (@tool, SKILL, n8n) into a standalone MCP npm server (no framework embedding, no package conflict).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",