@zshuangmu/agenthub 0.4.2 → 0.4.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zshuangmu/agenthub",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "AI Agent 打包与分发平台 - 一句话打包上传,一键下载获得能力",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/cli.js CHANGED
@@ -115,11 +115,12 @@ agenthub pack - 打包 Agent
115
115
  --version <ver> 版本号 (默认: 1.0.0)
116
116
  --tags <tags> 标签,逗号分隔
117
117
  --category <cat> 分类
118
+ --featured 标记为精选 Agent
118
119
 
119
120
  示例:
120
121
  agenthub pack --workspace ./my-agent --config ./openclaw.json
121
122
  agenthub pack --workspace ./my-agent --config ./openclaw.json --version 2.0.0
122
- agenthub pack --workspace ./my-agent --config ./openclaw.json --name "Code Helper"
123
+ agenthub pack --workspace ./my-agent --config ./openclaw.json --name "Code Helper" --featured
123
124
  `,
124
125
  publish: `
125
126
  agenthub publish - 发布 Agent
@@ -158,23 +159,28 @@ agenthub search - 搜索 Agent
158
159
 
159
160
  选项:
160
161
  --registry <dir> Registry 目录 (必需)
162
+ --json JSON 格式输出
161
163
 
162
164
  示例:
163
165
  agenthub search "code review" --registry ./.registry
164
166
  agenthub search "" --registry ./.registry # 列出所有
167
+ agenthub search "code" --registry ./.registry --json
165
168
  `,
166
169
  list: `
167
170
  agenthub list - 列出已安装 Agent
168
171
 
169
172
  用法:
170
- agenthub list [--target-workspace <dir>]
173
+ agenthub list [--target-workspace <dir>] [--json]
171
174
 
172
175
  选项:
173
176
  --target-workspace <dir> 指定工作区目录(可选)
177
+ --json JSON 格式输出
174
178
 
175
179
  示例:
176
180
  agenthub list
177
181
  agenthub list --target-workspace ./my-workspace
182
+ agenthub list --json
183
+ agenthub list --target-workspace ./my-workspace
178
184
  `,
179
185
  verify: `
180
186
  agenthub verify - 校验已安装 Agent
@@ -363,7 +369,9 @@ async function main() {
363
369
 
364
370
  case "search": {
365
371
  const results = await searchCommand(rest[0] || "", options);
366
- if (results.length === 0) {
372
+ if (options.json) {
373
+ console.log(JSON.stringify({ agents: results, count: results.length, query: rest[0] || "" }, null, 2));
374
+ } else if (results.length === 0) {
367
375
  console.log(warning("未找到匹配的 Agent"));
368
376
  } else {
369
377
  console.log(`\n${infoColor(`找到 ${results.length} 个 Agent:`)}\n`);
@@ -377,14 +385,18 @@ async function main() {
377
385
  case "info": {
378
386
  if (!requireArg(rest[0], "错误: 需要指定 agent slug")) return;
379
387
  const result = await infoCommand(rest[0], options);
380
- console.log(`\n${highlight("📦")} ${result.name} (${result.slug}@${result.version})`);
381
- console.log(` ${result.description}`);
382
- console.log(` ${muted("Runtime:")} ${result.runtime?.type || "openclaw"} ${result.runtime?.version || ""}`);
383
- const mem = result.includes?.memory || {};
384
- if (mem.count > 0) {
385
- console.log(` ${muted("Memory:")} ${mem.count} (public: ${mem.public}, portable: ${mem.portable})`);
388
+ if (options.json) {
389
+ console.log(JSON.stringify(result, null, 2));
390
+ } else {
391
+ console.log(`\n${highlight("📦")} ${result.name} (${result.slug}@${result.version})`);
392
+ console.log(` ${result.description}`);
393
+ console.log(` ${muted("Runtime:")} ${result.runtime?.type || "openclaw"} ${result.runtime?.version || ""}`);
394
+ const mem = result.includes?.memory || {};
395
+ if (mem.count > 0) {
396
+ console.log(` ${muted("Memory:")} ${mem.count} 条 (public: ${mem.public}, portable: ${mem.portable})`);
397
+ }
398
+ console.log(`\n ${infoColor("安装命令:")} agenthub install ${result.slug}`);
386
399
  }
387
- console.log(`\n ${infoColor("安装命令:")} agenthub install ${result.slug}`);
388
400
  return;
389
401
  }
390
402
 
@@ -399,7 +411,11 @@ async function main() {
399
411
 
400
412
  case "list": {
401
413
  const list = await listCommand(options);
402
- console.log(formatListOutput(list));
414
+ if (options.json) {
415
+ console.log(JSON.stringify({ agents: list, count: list.length }, null, 2));
416
+ } else {
417
+ console.log(formatListOutput(list));
418
+ }
403
419
  return;
404
420
  }
405
421
 
@@ -103,6 +103,7 @@ export async function packCommand(options) {
103
103
  tags: options.tags ? options.tags.split(",").map((t) => t.trim()) : [],
104
104
  category: options.category,
105
105
  version,
106
+ featured: options.featured === true,
106
107
  });
107
108
 
108
109
  // 5. 验证 MANIFEST
@@ -5,7 +5,7 @@
5
5
 
6
6
  const WORKSPACE_FILES = ["AGENTS.md", "SOUL.md", "USER.md", "IDENTITY.md", "TOOLS.md", "HEARTBEAT.md", "BOOTSTRAP.md"];
7
7
 
8
- export function createManifest({ slug, name, description, author, memoryCounts, openclawTemplate, skills = [], prompts = [], tags = [], category, language = "zh-CN", version = "1.0.0" }) {
8
+ export function createManifest({ slug, name, description, author, memoryCounts, openclawTemplate, skills = [], prompts = [], tags = [], category, language = "zh-CN", version = "1.0.0", featured = false }) {
9
9
  const hasModel = openclawTemplate?.agents?.defaults?.model?.primary;
10
10
  const totalMemory = memoryCounts.public + memoryCounts.portable + memoryCounts.private;
11
11
 
@@ -69,6 +69,7 @@ export function createManifest({ slug, name, description, author, memoryCounts,
69
69
  category: category || "General",
70
70
  language: language,
71
71
  license: "MIT",
72
+ featured,
72
73
  },
73
74
  };
74
75
  }