@x-otto/tools 0.0.1-alpha.0
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 +72 -0
- package/dist/index.d.ts +1329 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +152 -0
- package/dist/index.js.map +1 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# @x-otto/tools
|
|
2
|
+
|
|
3
|
+
## 模块定位
|
|
4
|
+
|
|
5
|
+
提供 Agent 可用工具的注册、分组与发现能力。TOOL_NODES 单一真相源表 13 节点,三级累积预设按需激活。
|
|
6
|
+
|
|
7
|
+
## 核心功能
|
|
8
|
+
|
|
9
|
+
| 预设 | 节点 |
|
|
10
|
+
| -------- | ------------------------------------------------------------------------------------- |
|
|
11
|
+
| minimal | `read` / `bash`(2 节点) |
|
|
12
|
+
| standard | + `write` / `edit` / `find` / `grep` / `ls` / `web_search` / `web_fetch` / `tool_search` / `task_delegate`(7 节点) |
|
|
13
|
+
| full | + `fork_call` / `agent_call` / `team_run` / `grill_me` / `session_manager` / `skill` / `memory_record` / `memory_read` / `capture_file_state` / `learn` / `task_inspect` / `task_control` / `write_todos`(16 节点,含编排全量+会话+技能+记忆+team) |
|
|
14
|
+
|
|
15
|
+
## 安装
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm add @x-otto/tools
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 快速开始
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { createToolRegistry } from '@x-otto/tools'
|
|
25
|
+
|
|
26
|
+
const registry = createToolRegistry({ preset: 'standard' })
|
|
27
|
+
// preset: 'minimal' (2 tools) | 'standard' (7 tools) | 'full' (16 tools)
|
|
28
|
+
|
|
29
|
+
const tools = registry.getTools() // AgentTool[]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 工具披露(exposure)
|
|
33
|
+
|
|
34
|
+
| 态 | 语义 |
|
|
35
|
+
| -------- | --------------------------------------------- |
|
|
36
|
+
| `direct` | 直进模型工具表(默认) |
|
|
37
|
+
| `deferred` | 经 `tool_search` 按需披露(MCP 工具默认) |
|
|
38
|
+
| `hidden` | 仅派发不进表 |
|
|
39
|
+
|
|
40
|
+
工具表按名称稳定排序,保证 prompt cache 前缀稳定。
|
|
41
|
+
|
|
42
|
+
## 目录概览
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
src/
|
|
46
|
+
types.ts # 核心类型
|
|
47
|
+
tool-registry.ts # 工具注册表(TOOL_NODES + 三级预设 + exposure 投影)
|
|
48
|
+
binary-executor-registry.ts # 二进制工具管理
|
|
49
|
+
builtin-tools/
|
|
50
|
+
fs/ # 文件系统工具
|
|
51
|
+
search/ # 搜索工具
|
|
52
|
+
shell/ # Shell 工具
|
|
53
|
+
web/ # Web 工具
|
|
54
|
+
orchestration/ # 编排工具
|
|
55
|
+
session/ # 会话工具
|
|
56
|
+
skill/ # 技能工具
|
|
57
|
+
memory/ # 记忆工具
|
|
58
|
+
index.ts
|
|
59
|
+
tests/ # 41 个测试文件
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 开发命令
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pnpm --filter @x-otto/tools build
|
|
66
|
+
pnpm --filter @x-otto/tools typecheck
|
|
67
|
+
pnpm --filter @x-otto/tools clean
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## 关联包
|
|
71
|
+
|
|
72
|
+
`@x-otto/agent`、`@x-otto/shared`、`@x-otto/env`、`@x-otto/mcp`、`@x-otto/orchestration-contracts`
|