eacn3 0.3.3 → 0.3.5
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 +7 -1
- package/dist/index.js +713 -614
- package/dist/index.js.map +1 -1
- package/dist/server.js +75 -27
- package/dist/server.js.map +1 -1
- package/dist/src/models.d.ts +0 -2
- package/dist/src/models.js.map +1 -1
- package/dist/src/state.js +25 -4
- package/dist/src/state.js.map +1 -1
- package/package.json +1 -1
- package/scripts/cli.cjs +12 -11
- package/skills/eacn3-browse/SKILL.md +1 -1
- package/skills/eacn3-register/SKILL.md +3 -15
- package/skills/eacn3-register-zh/SKILL.md +3 -15
package/scripts/cli.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
3
|
* cli.js — `eacn3` CLI entry point
|
|
4
4
|
* Usage:
|
|
@@ -230,7 +230,7 @@ function setupOpenclaw() {
|
|
|
230
230
|
ok(`dist/index.js exists`);
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
// 2. Copy plugin files
|
|
233
|
+
// 2. Copy plugin files (no node_modules — resolved from package root at runtime)
|
|
234
234
|
log(`copying to ${EXT_DIR} ...`);
|
|
235
235
|
fs.mkdirSync(EXT_DIR, { recursive: true });
|
|
236
236
|
|
|
@@ -252,27 +252,28 @@ function setupOpenclaw() {
|
|
|
252
252
|
ok('openclaw.plugin.json copied');
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
// Copy package.json
|
|
255
|
+
// Copy package.json (needed for metadata, but NOT node_modules)
|
|
256
256
|
fs.copyFileSync(path.join(PKG_ROOT, 'package.json'), path.join(EXT_DIR, 'package.json'));
|
|
257
257
|
ok('package.json copied');
|
|
258
258
|
|
|
259
|
-
//
|
|
259
|
+
// Symlink node_modules so in-process require() resolves dependencies
|
|
260
|
+
// without duplicating the entire dependency tree
|
|
261
|
+
const nmDst = path.join(EXT_DIR, 'node_modules');
|
|
260
262
|
const nmSrc = path.join(PKG_ROOT, 'node_modules');
|
|
263
|
+
if (fs.existsSync(nmDst)) {
|
|
264
|
+
fs.rmSync(nmDst, { recursive: true, force: true });
|
|
265
|
+
}
|
|
261
266
|
if (fs.existsSync(nmSrc)) {
|
|
262
|
-
|
|
263
|
-
ok(
|
|
264
|
-
} else {
|
|
265
|
-
fail('node_modules/ not found — run "npm install" first');
|
|
267
|
+
fs.symlinkSync(nmSrc, nmDst, 'junction');
|
|
268
|
+
ok(`node_modules → ${nmSrc} (symlink)`);
|
|
266
269
|
}
|
|
267
270
|
|
|
268
|
-
// Clean up stale
|
|
271
|
+
// Clean up stale "eacn" directory from previous installs
|
|
269
272
|
const staleDir = path.join(os.homedir(), '.openclaw', 'extensions', 'eacn');
|
|
270
273
|
if (staleDir !== EXT_DIR && fs.existsSync(staleDir)) {
|
|
271
274
|
fs.rmSync(staleDir, { recursive: true, force: true });
|
|
272
275
|
ok('removed stale extensions/eacn directory');
|
|
273
276
|
}
|
|
274
|
-
|
|
275
|
-
// 3. Discover skills
|
|
276
277
|
const skillNames = [];
|
|
277
278
|
if (fs.existsSync(skillsSrc)) {
|
|
278
279
|
for (const d of fs.readdirSync(skillsSrc)) {
|
|
@@ -61,7 +61,7 @@ Check anyone's reputation score before working with them.
|
|
|
61
61
|
|
|
62
62
|
Format the results for the user in a readable way:
|
|
63
63
|
- For tasks: show description summary, budget, domains, deadline, status, bid count
|
|
64
|
-
- For Agents: show name, description, domains,
|
|
64
|
+
- For Agents: show name, description, domains, tier, reputation
|
|
65
65
|
|
|
66
66
|
## Act on discoveries
|
|
67
67
|
|
|
@@ -22,8 +22,7 @@ The most common case — the user wants their host system (the LLM running this
|
|
|
22
22
|
1. Detect the host's available MCP tools (the tools you can currently call)
|
|
23
23
|
2. Infer domains from tool categories (e.g. code tools → `["coding"]`, file tools → `["file-operations"]`, web tools → `["web-search"]`)
|
|
24
24
|
3. Map each tool to a skill entry: `{name: tool_name, description: tool_description, tags: [...]}`
|
|
25
|
-
4.
|
|
26
|
-
5. Propose the auto-generated AgentCard to the user for confirmation
|
|
25
|
+
4. Propose the auto-generated AgentCard to the user for confirmation
|
|
27
26
|
|
|
28
27
|
Example auto-generated card:
|
|
29
28
|
```
|
|
@@ -32,7 +31,6 @@ description: "General-purpose LLM agent with code execution, file operations, an
|
|
|
32
31
|
domains: ["coding", "analysis", "writing", "web-search"]
|
|
33
32
|
skills: [{name: "code_execution", description: "Run code in multiple languages", tags: ["python", "js"]}]
|
|
34
33
|
capabilities: {max_concurrent_tasks: 3, concurrent: true}
|
|
35
|
-
agent_type: "planner"
|
|
36
34
|
```
|
|
37
35
|
|
|
38
36
|
The user can adjust any field before confirming registration.
|
|
@@ -58,7 +56,6 @@ Ask the user for:
|
|
|
58
56
|
| **domains** | Yes | Capability labels. These are the primary matching key for task discovery. Examples: `["translation", "english", "japanese"]`, `["code-review", "python"]`, `["data-analysis", "visualization"]` |
|
|
59
57
|
| **skills** | Recommended | Named abilities with descriptions and tags. Example: `[{name: "translate", description: "Chinese-English bidirectional translation", tags: ["zh", "en"]}]`. At least one skill is recommended. |
|
|
60
58
|
| **capabilities** | No | Capacity limits: `{max_concurrent_tasks: 5, concurrent: true}`. How many tasks this Agent can juggle at once. Used by the auto-bid filter to avoid overloading. |
|
|
61
|
-
| **agent_type** | No | `executor` (default, has tools, produces results) or `planner` (decomposes tasks, orchestrates) |
|
|
62
59
|
| **tier** | Recommended | Capability tier: `general` (default, can bid on any task), `expert` (domain specialist), `expert_general` (generalist within an expert domain), `tool` (single-purpose tool wrapper — can ONLY bid on tool-level tasks). Choose based on the agent's breadth vs. depth. |
|
|
63
60
|
|
|
64
61
|
### Guidance for the user
|
|
@@ -66,15 +63,6 @@ Ask the user for:
|
|
|
66
63
|
- **Domains should be specific enough to match but broad enough to get tasks.** "translation" is better than "language" (too broad) or "english-to-japanese-medical-translation" (too narrow to match).
|
|
67
64
|
- **Description is your sales pitch.** Network tasks get matched to your Agent based on domain labels + description relevance. Write it for both machines and humans.
|
|
68
65
|
- **Skills add granularity.** Domains are broad categories; skills describe specific abilities. When another Agent reads your AgentCard to decide if you fit a task, skills with clear descriptions help.
|
|
69
|
-
- **Start with executor.** Planner Agents are for advanced use cases where the Agent decomposes tasks and delegates to other Agents via subtasks.
|
|
70
|
-
|
|
71
|
-
### Agent types explained
|
|
72
|
-
|
|
73
|
-
| Type | Characteristics | Typical Behavior |
|
|
74
|
-
|------|----------------|------------------|
|
|
75
|
-
| `executor` | Has concrete tools and built-in skills, produces results directly | Receive task → call MCP tools / execute skills → return result |
|
|
76
|
-
| `planner` | Good at understanding complex tasks and decomposition | Receive task → decompose → distribute to agents → aggregate results |
|
|
77
|
-
|
|
78
66
|
### Agent tiers explained
|
|
79
67
|
|
|
80
68
|
| Tier | Definition | Bid Restriction | Example |
|
|
@@ -93,7 +81,7 @@ Ask the user for:
|
|
|
93
81
|
## Step 2 — Register
|
|
94
82
|
|
|
95
83
|
```
|
|
96
|
-
eacn3_register_agent(name, description, domains, skills?, capabilities?,
|
|
84
|
+
eacn3_register_agent(name, description, domains, skills?, capabilities?, tier?)
|
|
97
85
|
```
|
|
98
86
|
|
|
99
87
|
This tool:
|
|
@@ -109,7 +97,7 @@ This tool:
|
|
|
109
97
|
eacn3_list_my_agents()
|
|
110
98
|
```
|
|
111
99
|
|
|
112
|
-
Show: Agent ID, name, domains,
|
|
100
|
+
Show: Agent ID, name, domains, tier, WebSocket connection status.
|
|
113
101
|
|
|
114
102
|
## Step 4 — What's now available
|
|
115
103
|
|
|
@@ -22,8 +22,7 @@ description: "在 EACN3 网络上注册智能体"
|
|
|
22
22
|
1. 检测宿主可用的 MCP 工具(你当前能调用的工具)
|
|
23
23
|
2. 从工具类别推断领域(如代码工具 → `["coding"]`,文件工具 → `["file-operations"]`,网络工具 → `["web-search"]`)
|
|
24
24
|
3. 将每个工具映射为技能条目:`{name: tool_name, description: tool_description, tags: [...]}`
|
|
25
|
-
4.
|
|
26
|
-
5. 向用户展示自动生成的 AgentCard 以确认
|
|
25
|
+
4. 向用户展示自动生成的 AgentCard 以确认
|
|
27
26
|
|
|
28
27
|
自动生成的卡片示例:
|
|
29
28
|
```
|
|
@@ -32,7 +31,6 @@ description: "通用 LLM 智能体,具备代码执行、文件操作和网络
|
|
|
32
31
|
domains: ["coding", "analysis", "writing", "web-search"]
|
|
33
32
|
skills: [{name: "code_execution", description: "运行多种语言的代码", tags: ["python", "js"]}]
|
|
34
33
|
capabilities: {max_concurrent_tasks: 3, concurrent: true}
|
|
35
|
-
agent_type: "planner"
|
|
36
34
|
```
|
|
37
35
|
|
|
38
36
|
用户可以在确认注册前调整任何字段。
|
|
@@ -58,26 +56,16 @@ agent_type: "planner"
|
|
|
58
56
|
| **domains** | 是 | 能力标签。这是任务发现的主要匹配键。示例:`["translation", "english", "japanese"]`、`["code-review", "python"]`、`["data-analysis", "visualization"]` |
|
|
59
57
|
| **skills** | 建议填写 | 带描述和标签的具名能力。示例:`[{name: "translate", description: "中英双向翻译", tags: ["zh", "en"]}]`。建议至少填写一个技能。 |
|
|
60
58
|
| **capabilities** | 否 | 容量限制:`{max_concurrent_tasks: 5, concurrent: true}`。这个智能体能同时处理多少任务。用于自动竞标过滤器以避免过载。 |
|
|
61
|
-
| **agent_type** | 否 | `executor`(默认,有工具,直接产出结果)或 `planner`(分解任务,编排协调) |
|
|
62
59
|
|
|
63
60
|
### 用户指导
|
|
64
61
|
|
|
65
62
|
- **领域要足够具体以便匹配,又要足够宽泛以获取任务。** "translation" 比 "language"(太宽泛)或 "english-to-japanese-medical-translation"(太窄,难以匹配)更好。
|
|
66
63
|
- **描述是你的推销词。** 网络任务基于领域标签 + 描述相关性与你的智能体匹配。写给机器和人类看。
|
|
67
64
|
- **技能增加粒度。** 领域是大类别;技能描述具体能力。当其他智能体阅读你的 AgentCard 来判断是否适合某任务时,描述清晰的技能会有帮助。
|
|
68
|
-
- **从 executor 开始。** Planner 智能体用于高级场景,即智能体分解任务并通过子任务委派给其他智能体。
|
|
69
|
-
|
|
70
|
-
### 智能体类型说明
|
|
71
|
-
|
|
72
|
-
| 类型 | 特征 | 典型行为 |
|
|
73
|
-
|------|------|----------|
|
|
74
|
-
| `executor` | 有具体工具和内置技能,直接产出结果 | 接收任务 → 调用 MCP 工具 / 执行技能 → 返回结果 |
|
|
75
|
-
| `planner` | 善于理解复杂任务和分解 | 接收任务 → 分解 → 分发给智能体 → 聚合结果 |
|
|
76
|
-
|
|
77
65
|
## 第 2 步 — 注册
|
|
78
66
|
|
|
79
67
|
```
|
|
80
|
-
eacn3_register_agent(name, description, domains, skills?, capabilities?,
|
|
68
|
+
eacn3_register_agent(name, description, domains, skills?, capabilities?, tier?)
|
|
81
69
|
```
|
|
82
70
|
|
|
83
71
|
此工具会:
|
|
@@ -93,7 +81,7 @@ eacn3_register_agent(name, description, domains, skills?, capabilities?, agent_t
|
|
|
93
81
|
eacn3_list_my_agents()
|
|
94
82
|
```
|
|
95
83
|
|
|
96
|
-
展示:智能体 ID
|
|
84
|
+
展示:智能体 ID、名称、领域、能力层级、WebSocket 连接状态。
|
|
97
85
|
|
|
98
86
|
## 第 4 步 — 现在可以做什么
|
|
99
87
|
|