@zshuangmu/agenthub 0.1.8 → 0.2.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.md +96 -80
- package/package.json +1 -1
- package/src/commands/rollback.js +11 -1
- package/src/commands/update.js +11 -2
- package/src/commands/verify.js +44 -5
package/README.md
CHANGED
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
# 🤖 AgentHub
|
|
4
4
|
|
|
5
|
-
**
|
|
5
|
+
**OpenClaw Agent 的打包、发布与分发平台**
|
|
6
6
|
|
|
7
|
+
[](https://www.npmjs.com/package/@zshuangmu/agenthub)
|
|
7
8
|
[](https://opensource.org/licenses/MIT)
|
|
8
9
|
[](https://nodejs.org/)
|
|
9
|
-
[](https://github.com/itshaungmu/AgentHub)
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
**把你调教好的 OpenClaw Agent 变成可复用、可分发、可升级的标准资产**
|
|
12
13
|
|
|
13
|
-
🌐
|
|
14
|
+
🌐 **在线演示**: [https://agenthub.cyou](https://agenthub.cyou/)
|
|
14
15
|
|
|
15
16
|
[English](README.md) | [中文](README_CN.md)
|
|
16
17
|
|
|
@@ -18,108 +19,123 @@
|
|
|
18
19
|
|
|
19
20
|
---
|
|
20
21
|
|
|
21
|
-
## 🎯
|
|
22
|
+
## 🎯 AgentHub 是什么?
|
|
22
23
|
|
|
23
|
-
AgentHub
|
|
24
|
+
AgentHub 是一个专为 **OpenClaw** 设计的 Agent 打包与分发平台,类似于:
|
|
25
|
+
- **Docker Hub** 之于 Docker 容器
|
|
26
|
+
- **npm** 之于 Node.js 包
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
- **🚀 Publish** to a local or remote registry with one command
|
|
27
|
-
- **🔍 Discover** and search agents from the marketplace
|
|
28
|
-
- **⚡ Install** agents to any workspace instantly
|
|
28
|
+
但专注于 **OpenClaw Agent 的分发与复刻**。
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
### 核心能力
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
| 能力 | 描述 |
|
|
33
|
+
|------|------|
|
|
34
|
+
| 📦 **一键打包** | 将 Agent 的 personality、memory、skills 打包成标准 Bundle |
|
|
35
|
+
| 🚀 **发布分发** | 发布到本地或远程 Registry,生成可分享链接 |
|
|
36
|
+
| ⚡ **一键安装** | 团队成员通过统一命令安装,复刻完整 Agent 能力 |
|
|
37
|
+
| 🔄 **版本管理** | 完整的升级、回滚、校验支持 |
|
|
33
38
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
### 适合谁?
|
|
40
|
+
|
|
41
|
+
- **✅ OpenClaw 团队用户**: 统一分发、版本管理、团队复用
|
|
42
|
+
- **✅ Agent 创作者**: 打包分享你调教好的 Agent
|
|
43
|
+
- **✅ AI 重度用户**: 快速获得别人调教好的 Agent 能力
|
|
44
|
+
|
|
45
|
+
### 不适合谁?
|
|
46
|
+
|
|
47
|
+
- ❌ 非 OpenClaw 用户(当前仅支持 OpenClaw)
|
|
48
|
+
- ❌ 需要 Prompt 收藏夹(请使用专门的 Prompt 工具)
|
|
49
|
+
- ❌ 单个 Skill 分发(请使用 ClawHub)
|
|
42
50
|
|
|
43
51
|
## 📸 Screenshots
|
|
44
52
|
|
|
45
|
-

|
|
47
54
|
|
|
48
|
-
|
|
55
|
+
## 🚀 3 步上手
|
|
49
56
|
|
|
50
|
-
|
|
51
|
-
# Clone the repository
|
|
52
|
-
git clone https://github.com/agenthub/agenthub.git
|
|
53
|
-
cd agenthub
|
|
57
|
+
### 第一步:安装
|
|
54
58
|
|
|
55
|
-
|
|
56
|
-
npm
|
|
59
|
+
```bash
|
|
60
|
+
# 通过 npm 全局安装
|
|
61
|
+
npm install -g @zshuangmu/agenthub
|
|
57
62
|
|
|
58
|
-
#
|
|
59
|
-
|
|
63
|
+
# 或克隆源码
|
|
64
|
+
git clone https://github.com/itshaungmu/AgentHub.git
|
|
65
|
+
cd AgentHub && npm install && npm link
|
|
60
66
|
```
|
|
61
67
|
|
|
62
|
-
###
|
|
68
|
+
### 第二步:打包并发布你的 Agent
|
|
63
69
|
|
|
64
70
|
```bash
|
|
65
|
-
# 1.
|
|
66
|
-
agenthub pack --workspace ./my-
|
|
71
|
+
# 1. 打包你的 OpenClaw workspace
|
|
72
|
+
agenthub pack --workspace ./my-workspace --config openclaw.json
|
|
67
73
|
|
|
68
|
-
# 2.
|
|
74
|
+
# 2. 发布到 Registry
|
|
69
75
|
agenthub publish ./bundles/my-agent.agent --registry ./.registry
|
|
76
|
+
```
|
|
70
77
|
|
|
71
|
-
|
|
78
|
+
### 第三步:团队成员安装使用
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# 团队成员一键安装
|
|
82
|
+
agenthub install my-agent --registry ./.registry --target-workspace ./workspace
|
|
83
|
+
|
|
84
|
+
# 或启动 Web 界面浏览
|
|
72
85
|
agenthub serve --registry ./.registry --port 3000
|
|
73
86
|
```
|
|
74
87
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
|
84
|
-
|
|
85
|
-
| `
|
|
86
|
-
| `
|
|
87
|
-
| `
|
|
88
|
-
| `
|
|
89
|
-
| `
|
|
90
|
-
| `
|
|
91
|
-
| `
|
|
92
|
-
| `
|
|
93
|
-
| `
|
|
94
|
-
| `
|
|
95
|
-
| `
|
|
96
|
-
| `
|
|
88
|
+
访问 http://localhost:3000 查看你的 Agent!
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 📖 命令文档
|
|
93
|
+
|
|
94
|
+
### CLI 命令
|
|
95
|
+
|
|
96
|
+
| 命令 | 描述 |
|
|
97
|
+
|------|------|
|
|
98
|
+
| `pack` | 打包 workspace 为 Agent Bundle |
|
|
99
|
+
| `publish` | 发布到本地 Registry |
|
|
100
|
+
| `publish-remote` | 发布到远程服务器 |
|
|
101
|
+
| `search` | 搜索 Registry 中的 Agent |
|
|
102
|
+
| `info` | 查看 Agent 详情 |
|
|
103
|
+
| `install` | 安装 Agent 到 workspace |
|
|
104
|
+
| `list` | 列出已安装的 Agent |
|
|
105
|
+
| `verify` | 校验已安装 Agent 是否完整 |
|
|
106
|
+
| `versions` | 查看 Agent 版本历史 |
|
|
107
|
+
| `update` | 更新 Agent 到最新版 |
|
|
108
|
+
| `rollback` | 回滚 Agent 到指定版本 |
|
|
109
|
+
| `stats` | 查看 Agent 统计信息 |
|
|
110
|
+
| `serve` | 启动 Web + API 服务 |
|
|
111
|
+
| `api` | 仅启动 API 服务 |
|
|
112
|
+
| `web` | 仅启动 Web 前端 |
|
|
97
113
|
|
|
98
114
|
### HTTP API
|
|
99
115
|
|
|
100
116
|
```bash
|
|
101
|
-
#
|
|
117
|
+
# 列出所有 Agent
|
|
102
118
|
curl http://localhost:3001/api/agents
|
|
103
119
|
|
|
104
|
-
#
|
|
120
|
+
# 搜索 Agent
|
|
105
121
|
curl "http://localhost:3001/api/agents?q=react"
|
|
106
122
|
|
|
107
|
-
#
|
|
123
|
+
# 获取 Agent 详情
|
|
108
124
|
curl http://localhost:3001/api/agents/my-agent
|
|
109
125
|
|
|
110
|
-
#
|
|
126
|
+
# 获取统计信息
|
|
111
127
|
curl http://localhost:3001/api/stats
|
|
112
128
|
```
|
|
113
129
|
|
|
114
|
-
### AI
|
|
130
|
+
### AI 自动发现
|
|
115
131
|
|
|
116
|
-
|
|
132
|
+
让你的 AI 助手自动发现可用的 Agent:
|
|
117
133
|
|
|
118
134
|
```bash
|
|
119
135
|
curl http://localhost:3001/api/skills/agenthub-discover
|
|
120
136
|
```
|
|
121
137
|
|
|
122
|
-
## 🏗️
|
|
138
|
+
## 🏗️ 架构
|
|
123
139
|
|
|
124
140
|
```
|
|
125
141
|
┌─────────────────┐ pack ┌─────────────────┐ publish ┌─────────────────┐
|
|
@@ -136,45 +152,45 @@ curl http://localhost:3001/api/skills/agenthub-discover
|
|
|
136
152
|
└─────────────────┘
|
|
137
153
|
```
|
|
138
154
|
|
|
139
|
-
## 🧪
|
|
155
|
+
## 🧪 开发
|
|
140
156
|
|
|
141
157
|
```bash
|
|
142
|
-
#
|
|
158
|
+
# 运行测试
|
|
143
159
|
npm test
|
|
144
160
|
|
|
145
|
-
#
|
|
161
|
+
# 启动开发服务器
|
|
146
162
|
node src/cli.js serve --registry ./.registry
|
|
147
163
|
```
|
|
148
164
|
|
|
149
|
-
## 🐳 Docker
|
|
165
|
+
## 🐳 Docker 部署
|
|
150
166
|
|
|
151
167
|
```bash
|
|
152
|
-
#
|
|
168
|
+
# 生产环境启动(容器内)
|
|
153
169
|
NODE_ENV=production node src/cli.js serve --registry ./.registry --port 3000 --host 0.0.0.0
|
|
154
170
|
```
|
|
155
171
|
|
|
156
|
-
## 🤝
|
|
172
|
+
## 🤝 贡献
|
|
157
173
|
|
|
158
|
-
|
|
174
|
+
欢迎贡献!请查看 [CONTRIBUTING.md](CONTRIBUTING.md) 了解详情。
|
|
159
175
|
|
|
160
|
-
- 🐛 [
|
|
161
|
-
- 💡 [
|
|
162
|
-
- 🔧 [
|
|
176
|
+
- 🐛 [报告 Bug](https://github.com/itshaungmu/AgentHub/issues/new?template=bug_report.md)
|
|
177
|
+
- 💡 [请求功能](https://github.com/itshaungmu/AgentHub/issues/new?template=feature_request.md)
|
|
178
|
+
- 🔧 [提交 PR](https://github.com/itshaungmu/AgentHub/pulls)
|
|
163
179
|
|
|
164
|
-
## 📄
|
|
180
|
+
## 📄 许可证
|
|
165
181
|
|
|
166
182
|
[MIT License](LICENSE) © AgentHub Team
|
|
167
183
|
|
|
168
|
-
## 🙏
|
|
184
|
+
## 🙏 致谢
|
|
169
185
|
|
|
170
|
-
-
|
|
171
|
-
-
|
|
186
|
+
- 为 [OpenClaw](https://github.com/openclaw) 生态系统构建
|
|
187
|
+
- 灵感来自 npm 和 Docker Hub
|
|
172
188
|
|
|
173
189
|
---
|
|
174
190
|
|
|
175
191
|
<div align="center">
|
|
176
192
|
|
|
177
|
-
**[⬆
|
|
193
|
+
**[⬆ 返回顶部](#agenthub)**
|
|
178
194
|
|
|
179
195
|
Made with ❤️ by the AgentHub Team
|
|
180
196
|
|
package/package.json
CHANGED
package/src/commands/rollback.js
CHANGED
|
@@ -8,6 +8,7 @@ import { getCurrentVersion, updateInstallRecord, buildInstallOptions } from "../
|
|
|
8
8
|
import { installBundle } from "../lib/install.js";
|
|
9
9
|
import { parseSpec } from "../lib/registry.js";
|
|
10
10
|
import { versionsCommand } from "./versions.js";
|
|
11
|
+
import { success, warning, highlight, muted, symbols } from "../lib/colors.js";
|
|
11
12
|
|
|
12
13
|
export async function rollbackCommand(agentSpec, options = {}) {
|
|
13
14
|
const targetWorkspace = options.targetWorkspace ? path.resolve(options.targetWorkspace) : null;
|
|
@@ -41,7 +42,16 @@ export async function rollbackCommand(agentSpec, options = {}) {
|
|
|
41
42
|
|
|
42
43
|
return {
|
|
43
44
|
rolledBack: true,
|
|
44
|
-
message:
|
|
45
|
+
message: [
|
|
46
|
+
success(`${symbols.success} 回滚成功`),
|
|
47
|
+
"",
|
|
48
|
+
` ${highlight("Agent:")} ${slug}`,
|
|
49
|
+
` ${muted("回滚前:")} ${currentVersion || "未知"}`,
|
|
50
|
+
` ${highlight("当前版本:")} ${targetVersion}`,
|
|
51
|
+
"",
|
|
52
|
+
` ${muted("运行")} ${highlight("agenthub verify " + slug)} ${muted("校验安装状态")}`,
|
|
53
|
+
` ${muted("运行")} ${highlight("agenthub update " + slug)} ${muted("恢复到最新版本")}`,
|
|
54
|
+
].join("\n"),
|
|
45
55
|
currentVersion: targetVersion,
|
|
46
56
|
previousVersion: currentVersion,
|
|
47
57
|
manifest: result.manifest,
|
package/src/commands/update.js
CHANGED
|
@@ -7,6 +7,7 @@ import path from "node:path";
|
|
|
7
7
|
import { getCurrentVersion, performVersionChange } from "../lib/version-manager.js";
|
|
8
8
|
import { parseSpec } from "../lib/registry.js";
|
|
9
9
|
import { versionsCommand } from "./versions.js";
|
|
10
|
+
import { success, warning, highlight, muted, symbols } from "../lib/colors.js";
|
|
10
11
|
|
|
11
12
|
export async function updateCommand(agentSpec, options = {}) {
|
|
12
13
|
const targetWorkspace = options.targetWorkspace ? path.resolve(options.targetWorkspace) : null;
|
|
@@ -26,7 +27,7 @@ export async function updateCommand(agentSpec, options = {}) {
|
|
|
26
27
|
if (currentVersion === latestVersion) {
|
|
27
28
|
return {
|
|
28
29
|
updated: false,
|
|
29
|
-
message:
|
|
30
|
+
message: `${success(`${symbols.success} ${slug} 已是最新版本`)} ${muted(`(${latestVersion})`)}`,
|
|
30
31
|
currentVersion,
|
|
31
32
|
latestVersion,
|
|
32
33
|
};
|
|
@@ -37,7 +38,15 @@ export async function updateCommand(agentSpec, options = {}) {
|
|
|
37
38
|
|
|
38
39
|
return {
|
|
39
40
|
updated: true,
|
|
40
|
-
message:
|
|
41
|
+
message: [
|
|
42
|
+
success(`${symbols.success} 更新成功`),
|
|
43
|
+
"",
|
|
44
|
+
` ${highlight("Agent:")} ${slug}`,
|
|
45
|
+
` ${muted("旧版本:")} ${currentVersion || "未知"}`,
|
|
46
|
+
` ${highlight("新版本:")} ${latestVersion}`,
|
|
47
|
+
"",
|
|
48
|
+
` ${muted("运行")} ${highlight("agenthub verify " + slug)} ${muted("校验安装状态")}`,
|
|
49
|
+
].join("\n"),
|
|
41
50
|
currentVersion: latestVersion,
|
|
42
51
|
previousVersion: currentVersion,
|
|
43
52
|
manifest: result.manifest,
|
package/src/commands/verify.js
CHANGED
|
@@ -2,6 +2,7 @@ import path from "node:path";
|
|
|
2
2
|
import { pathExists, readJson } from "../lib/fs-utils.js";
|
|
3
3
|
import { parseSpec } from "../lib/registry.js";
|
|
4
4
|
import { infoCommand } from "./info.js";
|
|
5
|
+
import { success, error, warning, info as infoColor, highlight, muted, symbols } from "../lib/colors.js";
|
|
5
6
|
|
|
6
7
|
export async function verifyCommand(agentSpec, options = {}) {
|
|
7
8
|
const targetWorkspace = path.resolve(options.targetWorkspace || process.cwd());
|
|
@@ -78,17 +79,55 @@ export async function verifyCommand(agentSpec, options = {}) {
|
|
|
78
79
|
|
|
79
80
|
export function formatVerifyOutput(result) {
|
|
80
81
|
const lines = [];
|
|
81
|
-
|
|
82
|
+
|
|
83
|
+
// 标题
|
|
84
|
+
if (result.verified) {
|
|
85
|
+
lines.push(`\n${success(`${symbols.success} 校验通过`)}\n`);
|
|
86
|
+
} else {
|
|
87
|
+
lines.push(`\n${error(`${symbols.error} 校验失败`)}\n`);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Agent 信息
|
|
82
91
|
if (result.installRecord) {
|
|
83
|
-
lines.push(
|
|
92
|
+
lines.push(`${highlight("Agent:")} ${result.installRecord.slug}@${result.installRecord.version}`);
|
|
84
93
|
}
|
|
85
|
-
lines.push(
|
|
94
|
+
lines.push(`${highlight("Workspace:")} ${result.targetWorkspace}`);
|
|
86
95
|
lines.push("");
|
|
96
|
+
|
|
97
|
+
// 检查结果
|
|
98
|
+
lines.push(`${infoColor("检查项目:")}`);
|
|
87
99
|
for (const check of result.checks || []) {
|
|
88
|
-
|
|
100
|
+
const status = check.ok
|
|
101
|
+
? success(`${symbols.success} PASS`)
|
|
102
|
+
: error(`${symbols.error} FAIL`);
|
|
103
|
+
const checkName = check.name.replace(":", ": ").replace("_", " ");
|
|
104
|
+
lines.push(` ${status} ${muted(checkName)}`);
|
|
105
|
+
if (!check.ok || check.name.includes(":")) {
|
|
106
|
+
lines.push(` ${muted(check.detail)}`);
|
|
107
|
+
}
|
|
89
108
|
}
|
|
109
|
+
|
|
110
|
+
// 失败原因
|
|
90
111
|
if (result.reason) {
|
|
91
|
-
lines.push(`\
|
|
112
|
+
lines.push(`\n${warning(`原因: ${result.reason}`)}`);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// 健康度建议
|
|
116
|
+
if (result.verified) {
|
|
117
|
+
lines.push(`\n${success("Agent 安装完整,可以正常使用。")}`);
|
|
118
|
+
} else {
|
|
119
|
+
lines.push(`\n${warning("建议:")}`);
|
|
120
|
+
if (result.checks?.some(c => c.name === "install_record" && !c.ok)) {
|
|
121
|
+
lines.push(` - 运行 ${highlight("agenthub install <agent-slug>")} 安装 Agent`);
|
|
122
|
+
}
|
|
123
|
+
if (result.checks?.some(c => c.name.includes("workspace_file") && !c.ok)) {
|
|
124
|
+
lines.push(` - 检查 workspace 文件是否完整`);
|
|
125
|
+
lines.push(` - 尝试重新安装: ${highlight("agenthub install <agent-slug> --force")}`);
|
|
126
|
+
}
|
|
127
|
+
if (result.checks?.some(c => c.name === "applied_config" && !c.ok)) {
|
|
128
|
+
lines.push(` - 配置文件未应用,检查 OPENCLAW.template.json`);
|
|
129
|
+
}
|
|
92
130
|
}
|
|
131
|
+
|
|
93
132
|
return lines.join("\n");
|
|
94
133
|
}
|