@zshuangmu/agenthub 0.3.9 → 0.4.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 +5 -1
- package/package.json +1 -1
- package/src/cli.js +2 -0
- package/src/commands/pack.js +5 -3
package/README.md
CHANGED
|
@@ -92,6 +92,9 @@ cd AgentHub && npm install && npm link
|
|
|
92
92
|
# 1. 打包你的 OpenClaw workspace
|
|
93
93
|
agenthub pack --workspace ./my-workspace --config openclaw.json
|
|
94
94
|
|
|
95
|
+
# 或指定版本号
|
|
96
|
+
agenthub pack --workspace ./my-workspace --config openclaw.json --version 2.0.0
|
|
97
|
+
|
|
95
98
|
# 2. 发布到 Registry
|
|
96
99
|
agenthub publish ./bundles/my-agent.agent --registry ./.registry
|
|
97
100
|
```
|
|
@@ -138,7 +141,7 @@ agenthub verify code-review-assistant --registry ./.registry --target-workspace
|
|
|
138
141
|
|
|
139
142
|
| 命令 | 描述 |
|
|
140
143
|
|------|------|
|
|
141
|
-
| `pack` | 打包 workspace 为 Agent Bundle |
|
|
144
|
+
| `pack` | 打包 workspace 为 Agent Bundle(支持 `--version` 指定版本) |
|
|
142
145
|
| `publish` | 发布到本地 Registry |
|
|
143
146
|
| `publish-remote` | 发布到远程服务器 |
|
|
144
147
|
| `search` | 搜索 Registry 中的 Agent |
|
|
@@ -150,6 +153,7 @@ agenthub verify code-review-assistant --registry ./.registry --target-workspace
|
|
|
150
153
|
| `update` | 更新 Agent 到最新版 |
|
|
151
154
|
| `rollback` | 回滚 Agent 到指定版本 |
|
|
152
155
|
| `stats` | 查看 Agent 统计信息 |
|
|
156
|
+
| `doctor` | 诊断 AgentHub 安装和环境问题 |
|
|
153
157
|
| `serve` | 启动 Web + API 服务 |
|
|
154
158
|
| `api` | 仅启动 API 服务 |
|
|
155
159
|
| `web` | 仅启动 Web 前端 |
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -111,6 +111,7 @@ agenthub pack - 打包 Agent
|
|
|
111
111
|
--workspace <dir> OpenClaw 工作区目录 (必需)
|
|
112
112
|
--config <file> openclaw.json 配置文件路径 (必需)
|
|
113
113
|
--output <dir> 输出目录 (默认: ./bundles)
|
|
114
|
+
--name <name> Agent 名称 (默认: 工作区目录名)
|
|
114
115
|
--version <ver> 版本号 (默认: 1.0.0)
|
|
115
116
|
--tags <tags> 标签,逗号分隔
|
|
116
117
|
--category <cat> 分类
|
|
@@ -118,6 +119,7 @@ agenthub pack - 打包 Agent
|
|
|
118
119
|
示例:
|
|
119
120
|
agenthub pack --workspace ./my-agent --config ./openclaw.json
|
|
120
121
|
agenthub pack --workspace ./my-agent --config ./openclaw.json --version 2.0.0
|
|
122
|
+
agenthub pack --workspace ./my-agent --config ./openclaw.json --name "Code Helper"
|
|
121
123
|
`,
|
|
122
124
|
publish: `
|
|
123
125
|
agenthub publish - 发布 Agent
|
package/src/commands/pack.js
CHANGED
|
@@ -68,9 +68,11 @@ export async function packCommand(options) {
|
|
|
68
68
|
const output = path.resolve(options.output ?? "./bundles");
|
|
69
69
|
const configPath = options.config ? path.resolve(options.config) : null;
|
|
70
70
|
const version = options.version || "1.0.0";
|
|
71
|
+
const customName = options.name || null;
|
|
71
72
|
|
|
72
|
-
//
|
|
73
|
-
const
|
|
73
|
+
// 从工作区名称或自定义名称生成 slug
|
|
74
|
+
const baseName = customName || path.basename(workspace);
|
|
75
|
+
const slug = baseName.toLowerCase().replace(/[^a-z0-9-]/g, "-");
|
|
74
76
|
const bundleDir = path.join(output, `${slug}-${version}.agent`);
|
|
75
77
|
|
|
76
78
|
// 1. 扫描工作区
|
|
@@ -93,7 +95,7 @@ export async function packCommand(options) {
|
|
|
93
95
|
// 4. 生成 MANIFEST
|
|
94
96
|
const manifest = createManifest({
|
|
95
97
|
slug,
|
|
96
|
-
name: path.basename(workspace),
|
|
98
|
+
name: customName || path.basename(workspace),
|
|
97
99
|
memoryCounts,
|
|
98
100
|
openclawTemplate: template,
|
|
99
101
|
skills: workspaceFiles.skills,
|