agentbnb 5.1.10 → 6.0.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.
Files changed (49) hide show
  1. package/dist/{card-RSGDCHCV.js → card-REW7BSWW.js} +1 -1
  2. package/dist/{chunk-EPIWHNB2.js → chunk-2TLZ6G2B.js} +446 -373
  3. package/dist/{chunk-WGZ5AGOX.js → chunk-3CIMVISQ.js} +24 -1
  4. package/dist/{chunk-NH2FIERR.js → chunk-574W3HHE.js} +1 -1
  5. package/dist/{chunk-B5FTAGFN.js → chunk-7XHDSWRD.js} +75 -75
  6. package/dist/{chunk-NLAWT4DT.js → chunk-7YLFLC5C.js} +6 -6
  7. package/dist/chunk-BP3L2TET.js +148 -0
  8. package/dist/{chunk-EGUOAHCW.js → chunk-C2T4BMRW.js} +12 -12
  9. package/dist/{chunk-5KFI5X7B.js → chunk-F53QQIM2.js} +1 -1
  10. package/dist/chunk-JR6TJDIF.js +425 -0
  11. package/dist/{chunk-DFBX3BBD.js → chunk-KA2VIEGM.js} +211 -16
  12. package/dist/chunk-NQTE577Q.js +159 -0
  13. package/dist/{chunk-WTXRY7R2.js → chunk-NYV3NE5Z.js} +157 -9
  14. package/dist/{chunk-UKT6H7YT.js → chunk-OZXCRLP3.js} +1 -1
  15. package/dist/{chunk-QITOPASZ.js → chunk-PSQHUZ7X.js} +1 -1
  16. package/dist/{chunk-EANI2N2V.js → chunk-RVYQSC6L.js} +2 -99
  17. package/dist/{chunk-MLS6IGGG.js → chunk-TQDV254A.js} +1 -1
  18. package/dist/{chunk-QQFBFV4V.js → chunk-TR6UZDNX.js} +57 -18
  19. package/dist/{chunk-ZX5623ER.js → chunk-VMH2YS2I.js} +1 -1
  20. package/dist/{chunk-XND2DWTZ.js → chunk-VPQ44XKE.js} +2 -2
  21. package/dist/{chunk-CSATDXZC.js → chunk-Y7T6IMM3.js} +1 -1
  22. package/dist/{chunk-FLY3WIQR.js → chunk-YRRVFTDR.js} +3 -3
  23. package/dist/cli/index.js +261 -125
  24. package/dist/{client-T5MTY3CS.js → client-HRYRJKSA.js} +3 -3
  25. package/dist/{conduct-WU3VEXB6.js → conduct-LF6FYPLD.js} +11 -11
  26. package/dist/conduct-QAFZIEY6.js +21 -0
  27. package/dist/{conductor-mode-ZMTFZGJP.js → conductor-mode-NUDQLZFM.js} +309 -13
  28. package/dist/conductor-mode-YQ6QSPPT.js +275 -0
  29. package/dist/{execute-4D4ITQCL.js → execute-ITHIYYOX.js} +4 -3
  30. package/dist/execute-PNJFABVJ.js +14 -0
  31. package/dist/index.d.ts +555 -0
  32. package/dist/index.js +592 -83
  33. package/dist/{process-guard-CC7CNRQJ.js → process-guard-QCCBGILS.js} +1 -1
  34. package/dist/publish-capability-TS6CNR5G.js +12 -0
  35. package/dist/{request-VOXBFUOG.js → request-P6QCTCCG.js} +14 -14
  36. package/dist/{serve-skill-IH7UAJNR.js → serve-skill-EZOL7UYN.js} +10 -9
  37. package/dist/{server-JVQW2TID.js → server-3G6ZTASA.js} +16 -16
  38. package/dist/{service-coordinator-EYRDTHL5.js → service-coordinator-CRSE4GWC.js} +174 -242
  39. package/dist/skill-config-4W5W5O6T.js +22 -0
  40. package/dist/skills/agentbnb/bootstrap.js +227 -67
  41. package/openclaw.plugin.json +1 -1
  42. package/package.json +1 -1
  43. package/skills/agentbnb/SKILL.md +50 -1
  44. package/skills/agentbnb/bootstrap.ts +126 -8
  45. package/skills/agentbnb/install.sh +49 -9
  46. package/dist/chunk-CRFCWD6V.js +0 -366
  47. package/dist/conduct-6LKIJJKQ.js +0 -21
  48. package/dist/conductor-mode-Q4IIDY5E.js +0 -123
  49. package/dist/execute-T7Y6RKSW.js +0 -13
package/dist/cli/index.js CHANGED
@@ -6,32 +6,53 @@ import {
6
6
  detectOpenPorts,
7
7
  discoverLocalAgents,
8
8
  getPricingStats
9
- } from "../chunk-MLS6IGGG.js";
9
+ } from "../chunk-TQDV254A.js";
10
10
  import {
11
11
  ensureIdentity
12
- } from "../chunk-QITOPASZ.js";
12
+ } from "../chunk-PSQHUZ7X.js";
13
13
  import {
14
14
  createLedger
15
- } from "../chunk-FLY3WIQR.js";
15
+ } from "../chunk-YRRVFTDR.js";
16
+ import {
17
+ releaseRequesterEscrow,
18
+ settleRequesterEscrow
19
+ } from "../chunk-OZXCRLP3.js";
20
+ import {
21
+ parseSoulMd
22
+ } from "../chunk-BP3L2TET.js";
16
23
  import {
17
24
  AutoRequestor,
18
25
  BudgetManager,
19
26
  DEFAULT_BUDGET_CONFIG
20
- } from "../chunk-EGUOAHCW.js";
21
- import {
22
- DEFAULT_AUTONOMY_CONFIG
23
- } from "../chunk-CSATDXZC.js";
27
+ } from "../chunk-C2T4BMRW.js";
24
28
  import {
25
29
  fetchRemoteCards,
26
30
  mergeResults
27
- } from "../chunk-ZX5623ER.js";
31
+ } from "../chunk-VMH2YS2I.js";
32
+ import {
33
+ DEFAULT_AUTONOMY_CONFIG
34
+ } from "../chunk-Y7T6IMM3.js";
28
35
  import {
29
36
  filterCards,
30
37
  searchCards
31
- } from "../chunk-NH2FIERR.js";
38
+ } from "../chunk-574W3HHE.js";
39
+ import {
40
+ bootstrapAgent,
41
+ getBalance,
42
+ getTransactions,
43
+ holdEscrow,
44
+ migrateOwner,
45
+ openCreditDb
46
+ } from "../chunk-RVYQSC6L.js";
32
47
  import {
33
48
  requestCapability
34
- } from "../chunk-XND2DWTZ.js";
49
+ } from "../chunk-VPQ44XKE.js";
50
+ import {
51
+ generateKeyPair,
52
+ loadKeyPair,
53
+ saveKeyPair,
54
+ signEscrowReceipt
55
+ } from "../chunk-F53QQIM2.js";
35
56
  import {
36
57
  findPeer,
37
58
  loadPeers,
@@ -44,39 +65,23 @@ import {
44
65
  saveConfig
45
66
  } from "../chunk-75OC6E4F.js";
46
67
  import {
47
- releaseRequesterEscrow,
48
- settleRequesterEscrow
49
- } from "../chunk-UKT6H7YT.js";
50
- import {
68
+ deleteCard,
69
+ getCard,
51
70
  insertCard,
52
71
  listCards,
53
72
  openDatabase
54
- } from "../chunk-DFBX3BBD.js";
55
- import {
56
- bootstrapAgent,
57
- getBalance,
58
- getTransactions,
59
- holdEscrow,
60
- migrateOwner,
61
- openCreditDb
62
- } from "../chunk-EANI2N2V.js";
63
- import {
64
- generateKeyPair,
65
- loadKeyPair,
66
- saveKeyPair,
67
- signEscrowReceipt
68
- } from "../chunk-5KFI5X7B.js";
73
+ } from "../chunk-KA2VIEGM.js";
69
74
  import {
70
75
  AgentBnBError,
71
76
  AnyCardSchema,
72
77
  CapabilityCardV2Schema
73
- } from "../chunk-WGZ5AGOX.js";
78
+ } from "../chunk-3CIMVISQ.js";
74
79
 
75
80
  // src/cli/index.ts
76
81
  import { Command } from "commander";
77
82
  import { readFileSync as readFileSync3 } from "fs";
78
83
  import { createRequire } from "module";
79
- import { randomBytes, randomUUID as randomUUID5 } from "crypto";
84
+ import { randomBytes, randomUUID as randomUUID4 } from "crypto";
80
85
  import { join as join2 } from "path";
81
86
  import { networkInterfaces } from "os";
82
87
  import { createInterface as createInterface2 } from "readline";
@@ -289,99 +294,48 @@ function capabilitiesToV2Card(capabilities, owner, agentName) {
289
294
  }
290
295
 
291
296
  // src/openclaw/soul-sync.ts
292
- import { randomUUID as randomUUID4 } from "crypto";
293
-
294
- // src/skills/publish-capability.ts
295
297
  import { randomUUID as randomUUID3 } from "crypto";
296
- function parseSoulMd(content) {
297
- const lines = content.split("\n");
298
- let name = "";
299
- let description = "";
300
- const capabilities = [];
301
- const unknownSections = [];
302
- let currentSection = null;
303
- let currentCapabilityName = "";
304
- let currentCapabilityLines = [];
305
- let currentCapabilityPricing = void 0;
306
- let descriptionLines = [];
307
- let pastFirstH1 = false;
308
- let pastFirstH2 = false;
309
- const flushCapability = () => {
310
- if (currentCapabilityName) {
311
- const cap = {
312
- name: currentCapabilityName,
313
- description: currentCapabilityLines.join(" ").trim()
314
- };
315
- if (currentCapabilityPricing !== void 0) {
316
- cap.pricing = currentCapabilityPricing;
317
- }
318
- capabilities.push(cap);
319
- currentCapabilityName = "";
320
- currentCapabilityLines = [];
321
- currentCapabilityPricing = void 0;
322
- }
323
- };
324
- for (const line of lines) {
325
- const trimmed = line.trim();
326
- if (/^# /.test(trimmed) && !pastFirstH1) {
327
- name = trimmed.slice(2).trim();
328
- pastFirstH1 = true;
329
- currentSection = "preamble";
330
- continue;
331
- }
332
- if (/^## /.test(trimmed)) {
333
- flushCapability();
334
- const capName = trimmed.slice(3).trim();
335
- currentCapabilityName = capName;
336
- currentSection = "capability";
337
- pastFirstH2 = true;
338
- continue;
339
- }
340
- if (/^#{3,} /.test(trimmed)) {
341
- const sectionName = trimmed.replace(/^#+\s*/, "");
342
- if (!unknownSections.includes(sectionName)) {
343
- unknownSections.push(sectionName);
344
- }
345
- continue;
346
- }
347
- if (trimmed === "") continue;
348
- if (currentSection === "preamble" && !pastFirstH2) {
349
- descriptionLines.push(trimmed);
350
- } else if (currentSection === "capability") {
351
- const pricingMatch = trimmed.match(/^pricing:\s*(\d+(?:\.\d+)?)$/i);
352
- if (pricingMatch) {
353
- const val = parseFloat(pricingMatch[1]);
354
- if (!isNaN(val) && val >= 0) {
355
- currentCapabilityPricing = val;
356
- }
357
- } else {
358
- currentCapabilityLines.push(trimmed);
298
+ var SKILL_META_GLOBAL_RE = /(?:^|\s)-\s*(capability_types|requires(?:_capabilities)?|visibility)\s*:\s*([^-][^]*?)(?=\s+-\s+(?:capability_types|requires(?:_capabilities)?|visibility)\s*:|$)/gi;
299
+ function extractSkillMeta(raw) {
300
+ let capability_types;
301
+ let requires_capabilities;
302
+ let visibility;
303
+ const removedRanges = [];
304
+ SKILL_META_GLOBAL_RE.lastIndex = 0;
305
+ let m;
306
+ while ((m = SKILL_META_GLOBAL_RE.exec(raw)) !== null) {
307
+ const key = m[1].toLowerCase();
308
+ const val = m[2].trim();
309
+ if (key === "capability_types") {
310
+ capability_types = val.split(",").map((v) => v.trim()).filter(Boolean);
311
+ } else if (key === "requires" || key === "requires_capabilities") {
312
+ requires_capabilities = val.split(",").map((v) => v.trim()).filter(Boolean);
313
+ } else if (key === "visibility") {
314
+ const vis = val.toLowerCase();
315
+ if (vis === "public" || vis === "private") {
316
+ visibility = vis;
359
317
  }
360
318
  }
319
+ removedRanges.push({ start: m.index, end: m.index + m[0].length });
361
320
  }
362
- flushCapability();
363
- if (descriptionLines.length > 0) {
364
- description = descriptionLines[0] ?? "";
321
+ let description = raw;
322
+ for (const { start, end } of removedRanges.slice().reverse()) {
323
+ description = description.slice(0, start) + description.slice(end);
365
324
  }
366
- return {
367
- name,
368
- description,
369
- level: 2,
370
- capabilities,
371
- unknownSections
372
- };
325
+ description = description.trim();
326
+ return { description, capability_types, requires_capabilities, visibility };
373
327
  }
374
-
375
- // src/openclaw/soul-sync.ts
376
328
  function parseSoulMdV2(content) {
377
329
  const parsed = parseSoulMd(content);
378
330
  const skills = parsed.capabilities.map((cap) => {
379
331
  const sanitizedId = cap.name.toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "");
380
- const id = sanitizedId.length > 0 ? sanitizedId : randomUUID4();
381
- return {
332
+ const id = sanitizedId.length > 0 ? sanitizedId : randomUUID3();
333
+ const { description: cleanDesc, capability_types, requires_capabilities, visibility } = extractSkillMeta(cap.description);
334
+ const finalDescription = (cleanDesc || cap.name).slice(0, 500);
335
+ const skill = {
382
336
  id,
383
337
  name: cap.name,
384
- description: (cap.description.slice(0, 500) || cap.name).slice(0, 500),
338
+ description: finalDescription,
385
339
  level: 2,
386
340
  inputs: [
387
341
  {
@@ -402,6 +356,10 @@ function parseSoulMdV2(content) {
402
356
  pricing: { credits_per_call: cap.pricing !== void 0 ? cap.pricing : 10 },
403
357
  availability: { online: true }
404
358
  };
359
+ if (capability_types !== void 0) skill.capability_types = capability_types;
360
+ if (requires_capabilities !== void 0) skill.requires_capabilities = requires_capabilities;
361
+ if (visibility !== void 0) skill.visibility = visibility;
362
+ return skill;
405
363
  });
406
364
  return {
407
365
  agentName: parsed.name || "Unknown Agent",
@@ -409,8 +367,14 @@ function parseSoulMdV2(content) {
409
367
  skills
410
368
  };
411
369
  }
412
- function publishFromSoulV2(db, soulContent, owner) {
413
- const { agentName, skills } = parseSoulMdV2(soulContent);
370
+ function publishFromSoulV2(db, soulContent, owner, sharedSkills) {
371
+ const { agentName, skills: allSkills } = parseSoulMdV2(soulContent);
372
+ const skills = allSkills.filter((skill) => {
373
+ if (sharedSkills && sharedSkills.length > 0) {
374
+ return sharedSkills.includes(skill.id);
375
+ }
376
+ return skill.visibility !== "private";
377
+ });
414
378
  if (skills.length === 0) {
415
379
  throw new AgentBnBError("SOUL.md has no H2 sections", "VALIDATION_ERROR");
416
380
  }
@@ -419,7 +383,7 @@ function publishFromSoulV2(db, soulContent, owner) {
419
383
  (c) => c.spec_version === "2.0"
420
384
  );
421
385
  const now = (/* @__PURE__ */ new Date()).toISOString();
422
- const cardId = existingV2?.id ?? randomUUID4();
386
+ const cardId = existingV2?.id ?? randomUUID3();
423
387
  const card = {
424
388
  spec_version: "2.0",
425
389
  id: cardId,
@@ -946,6 +910,62 @@ program.command("publish <card.json>").description("Publish a Capability Card to
946
910
  } else if (!registryUrl) {
947
911
  }
948
912
  });
913
+ program.command("publish-skills").description("Publish capabilities from skills.yaml to the local registry").option("--from-skills [path]", "Path to skills.yaml", "./skills.yaml").action(async (opts) => {
914
+ const config = loadConfig();
915
+ if (!config) {
916
+ console.error("Error: not initialized. Run `agentbnb init` first.");
917
+ process.exit(1);
918
+ }
919
+ const { parseSkillsFile } = await import("../skill-config-4W5W5O6T.js");
920
+ const { skillConfigToSkill } = await import("../publish-capability-TS6CNR5G.js");
921
+ const skillsPath = typeof opts.fromSkills === "string" ? opts.fromSkills : "./skills.yaml";
922
+ let yamlContent;
923
+ try {
924
+ yamlContent = readFileSync3(skillsPath, "utf-8");
925
+ } catch {
926
+ console.error(`Error: cannot read skills.yaml at ${skillsPath}`);
927
+ process.exit(1);
928
+ }
929
+ let allSkillConfigs;
930
+ try {
931
+ allSkillConfigs = parseSkillsFile(yamlContent);
932
+ } catch (err) {
933
+ const msg = err instanceof Error ? err.message : String(err);
934
+ console.error(`Error: failed to parse skills.yaml \u2014 ${msg}`);
935
+ process.exit(1);
936
+ }
937
+ const publicSkillConfigs = allSkillConfigs.filter(
938
+ (sc) => sc.visibility !== "private"
939
+ );
940
+ if (publicSkillConfigs.length === 0) {
941
+ console.log("No public skills to publish (all skills have visibility: private or no skills found).");
942
+ return;
943
+ }
944
+ const skills = publicSkillConfigs.map((sc) => skillConfigToSkill(sc));
945
+ const now = (/* @__PURE__ */ new Date()).toISOString();
946
+ const card = {
947
+ spec_version: "2.0",
948
+ id: randomUUID4(),
949
+ owner: config.owner,
950
+ agent_name: config.owner,
951
+ skills,
952
+ availability: { online: true },
953
+ created_at: now,
954
+ updated_at: now
955
+ };
956
+ const db = openDatabase(config.db_path);
957
+ try {
958
+ db.prepare(
959
+ "INSERT OR REPLACE INTO capability_cards (id, owner, data, created_at, updated_at) VALUES (?, ?, ?, ?, ?)"
960
+ ).run(card.id, card.owner, JSON.stringify(card), now, now);
961
+ } finally {
962
+ db.close();
963
+ }
964
+ console.log(`Published ${skills.length} skill(s) to local registry`);
965
+ for (const skill of skills) {
966
+ console.log(` - ${skill.id}: ${skill.name} (${skill.pricing.credits_per_call} cr/call)`);
967
+ }
968
+ });
949
969
  program.command("sync").description("Push all local capability cards to the configured remote registry").option("--registry <url>", "Remote registry URL (overrides config.registry)").option("--json", "Output as JSON").action(async (opts) => {
950
970
  const config = loadConfig();
951
971
  if (!config) {
@@ -1431,13 +1451,13 @@ Batch Results (${res.results.length} items):`);
1431
1451
  };
1432
1452
  const tryViaRelay = async () => {
1433
1453
  const { RelayClient } = await import("../websocket-client-6IIDGXKB.js");
1434
- const { requestViaRelay } = await import("../client-T5MTY3CS.js");
1435
- const requesterId = `${config.owner}:req:${randomUUID5()}`;
1454
+ const { requestViaRelay } = await import("../client-HRYRJKSA.js");
1455
+ const requesterId = `${config.owner}:req:${randomUUID4()}`;
1436
1456
  const tempRelay = new RelayClient({
1437
1457
  registryUrl: config.registry,
1438
1458
  owner: requesterId,
1439
1459
  token: config.token,
1440
- card: { id: randomUUID5(), owner: requesterId, name: requesterId, description: "Requester", level: 1, spec_version: "1.0", inputs: [], outputs: [], pricing: { credits_per_call: 1 }, availability: { online: false } },
1460
+ card: { id: randomUUID4(), owner: requesterId, name: requesterId, description: "Requester", level: 1, spec_version: "1.0", inputs: [], outputs: [], pricing: { credits_per_call: 1 }, availability: { online: false } },
1441
1461
  onRequest: async () => ({ error: { code: -32601, message: "Not serving" } }),
1442
1462
  silent: true
1443
1463
  });
@@ -1560,8 +1580,8 @@ program.command("serve").description("Start the AgentBnB gateway server").option
1560
1580
  console.error("Error: not initialized. Run `agentbnb init` first.");
1561
1581
  process.exit(1);
1562
1582
  }
1563
- const { ProcessGuard } = await import("../process-guard-CC7CNRQJ.js");
1564
- const { ServiceCoordinator } = await import("../service-coordinator-EYRDTHL5.js");
1583
+ const { ProcessGuard } = await import("../process-guard-QCCBGILS.js");
1584
+ const { ServiceCoordinator } = await import("../service-coordinator-CRSE4GWC.js");
1565
1585
  const port = opts.port ? parseInt(opts.port, 10) : config.gateway_port;
1566
1586
  const registryPort = parseInt(opts.registryPort, 10);
1567
1587
  if (!Number.isFinite(port) || !Number.isFinite(registryPort)) {
@@ -1631,7 +1651,7 @@ peersCommand.command("remove <name>").description("Remove a registered peer").ac
1631
1651
  });
1632
1652
  var configCmd = program.command("config").description("Get or set AgentBnB configuration values");
1633
1653
  configCmd.command("set <key> <value>").description("Set a configuration value").action((key, value) => {
1634
- const allowedKeys = ["registry", "tier1", "tier2", "reserve", "idle-threshold", "conductor-public"];
1654
+ const allowedKeys = ["registry", "tier1", "tier2", "reserve", "idle-threshold", "conductor-public", "telegram-notifications", "telegram-bot-token", "telegram-chat-id", "shared-skills"];
1635
1655
  if (!allowedKeys.includes(key)) {
1636
1656
  console.error(`Unknown config key: ${key}. Valid keys: ${allowedKeys.join(", ")}`);
1637
1657
  process.exit(1);
@@ -1707,6 +1727,35 @@ configCmd.command("set <key> <value>").description("Set a configuration value").
1707
1727
  console.log(`Set conductor-public = ${boolVal} (conductor card ${boolVal ? "will be" : "will NOT be"} published to registry)`);
1708
1728
  return;
1709
1729
  }
1730
+ if (key === "telegram-notifications") {
1731
+ if (value !== "true" && value !== "false") {
1732
+ console.error('Error: telegram-notifications must be "true" or "false"');
1733
+ process.exit(1);
1734
+ }
1735
+ config.telegram_notifications = value === "true";
1736
+ saveConfig(config);
1737
+ console.log(`Set telegram-notifications = ${config.telegram_notifications}`);
1738
+ return;
1739
+ }
1740
+ if (key === "telegram-bot-token") {
1741
+ config.telegram_bot_token = value;
1742
+ saveConfig(config);
1743
+ console.log("Set telegram-bot-token");
1744
+ return;
1745
+ }
1746
+ if (key === "telegram-chat-id") {
1747
+ config.telegram_chat_id = value;
1748
+ saveConfig(config);
1749
+ console.log(`Set telegram-chat-id = ${value}`);
1750
+ return;
1751
+ }
1752
+ if (key === "shared-skills") {
1753
+ config.shared_skills = value.trim() === "" ? [] : value.split(",").map((s) => s.trim()).filter(Boolean);
1754
+ saveConfig(config);
1755
+ const display = config.shared_skills.length > 0 ? config.shared_skills.join(", ") : "(all skills published)";
1756
+ console.log(`Set shared-skills: ${display}`);
1757
+ return;
1758
+ }
1710
1759
  config[key] = value;
1711
1760
  saveConfig(config);
1712
1761
  console.log(`Set ${key} = ${value}`);
@@ -1738,11 +1787,97 @@ configCmd.command("get <key>").description("Get a configuration value").action((
1738
1787
  console.log(String(config.conductor?.public ?? false));
1739
1788
  return;
1740
1789
  }
1790
+ if (key === "telegram-notifications") {
1791
+ console.log(String(config.telegram_notifications ?? false));
1792
+ return;
1793
+ }
1794
+ if (key === "telegram-bot-token") {
1795
+ console.log(config.telegram_bot_token ?? "(not set)");
1796
+ return;
1797
+ }
1798
+ if (key === "telegram-chat-id") {
1799
+ console.log(config.telegram_chat_id ?? "(not set)");
1800
+ return;
1801
+ }
1802
+ if (key === "shared-skills") {
1803
+ const skills = config.shared_skills ?? [];
1804
+ console.log(skills.length > 0 ? skills.join(", ") : "(all skills published)");
1805
+ return;
1806
+ }
1741
1807
  const value = config[key];
1742
1808
  console.log(value !== void 0 ? String(value) : "(not set)");
1743
1809
  });
1810
+ var cardsCmd = program.command("cards").description("Manage published capability cards");
1811
+ cardsCmd.command("list").description("List all published capability cards in the local registry").action(() => {
1812
+ const config = loadConfig();
1813
+ if (!config) {
1814
+ console.error("Error: not initialized. Run `agentbnb init` first.");
1815
+ process.exit(1);
1816
+ }
1817
+ const db = openDatabase(config.db_path);
1818
+ try {
1819
+ const cards = listCards(db);
1820
+ if (cards.length === 0) {
1821
+ console.log("No published cards found.");
1822
+ return;
1823
+ }
1824
+ console.log(`Published cards (${cards.length}):`);
1825
+ for (const card of cards) {
1826
+ const v2 = card;
1827
+ const name = String(v2["agent_name"] ?? v2["name"] ?? "(unnamed)");
1828
+ const owner = String(v2["owner"] ?? "");
1829
+ const skills = Array.isArray(v2["skills"]) ? v2["skills"].length : 0;
1830
+ const skillsLabel = skills > 0 ? ` (${skills} skill${skills !== 1 ? "s" : ""})` : "";
1831
+ console.log(` ${card.id} ${name} owner: ${owner}${skillsLabel}`);
1832
+ }
1833
+ } finally {
1834
+ db.close();
1835
+ }
1836
+ });
1837
+ cardsCmd.command("delete <card-id>").description("Delete a published capability card from the local registry").option("--force", "Skip confirmation prompt").action(async (cardId, opts) => {
1838
+ const config = loadConfig();
1839
+ if (!config) {
1840
+ console.error("Error: not initialized. Run `agentbnb init` first.");
1841
+ process.exit(1);
1842
+ }
1843
+ const db = openDatabase(config.db_path);
1844
+ try {
1845
+ const card = getCard(db, cardId);
1846
+ if (!card) {
1847
+ console.error(`Error: card not found: ${cardId}`);
1848
+ process.exit(1);
1849
+ }
1850
+ const v2 = card;
1851
+ const cardName = String(v2["agent_name"] ?? v2["name"] ?? "(unnamed)");
1852
+ const skillCount = Array.isArray(v2["skills"]) ? v2["skills"].length : 0;
1853
+ console.log("Deleting card:");
1854
+ console.log(` Name: "${cardName}"`);
1855
+ console.log(` Owner: ${card.owner}`);
1856
+ console.log(` Skills: ${skillCount}`);
1857
+ console.log(` ID: ${card.id}`);
1858
+ if (!opts.force && process.stdin.isTTY) {
1859
+ const rl = createInterface2({ input: process.stdin, output: process.stdout });
1860
+ const answer = await new Promise((resolve) => {
1861
+ rl.question("Confirm deletion? [y/N] ", resolve);
1862
+ });
1863
+ rl.close();
1864
+ if (answer.toLowerCase() !== "y") {
1865
+ console.log("Cancelled.");
1866
+ process.exit(0);
1867
+ }
1868
+ }
1869
+ deleteCard(db, cardId, card.owner);
1870
+ console.log(`Deleted: "${cardName}" (${skillCount} skill${skillCount !== 1 ? "s" : ""})`);
1871
+ } catch (err) {
1872
+ const msg = err instanceof Error ? err.message : String(err);
1873
+ console.error(`Error: ${msg}`);
1874
+ process.exit(1);
1875
+ } finally {
1876
+ db.close();
1877
+ }
1878
+ });
1744
1879
  var openclaw = program.command("openclaw").description("OpenClaw integration commands");
1745
- openclaw.command("sync").description("Read SOUL.md and publish/update a v2.0 capability card").option("--soul-path <path>", "Path to SOUL.md", "./SOUL.md").action(async (opts) => {
1880
+ openclaw.command("sync").description("Read SOUL.md and publish/update a v2.0 capability card").option("--soul-path <path>", "Path to SOUL.md", "./SOUL.md").option("--skills <ids>", "Comma-separated skill IDs to publish (overrides shared-skills config and skill visibility)").action(async (opts) => {
1746
1881
  const config = loadConfig();
1747
1882
  if (!config) {
1748
1883
  console.error("Error: not initialized. Run `agentbnb init` first.");
@@ -1755,9 +1890,10 @@ openclaw.command("sync").description("Read SOUL.md and publish/update a v2.0 cap
1755
1890
  console.error(`Error: cannot read SOUL.md at ${opts.soulPath}`);
1756
1891
  process.exit(1);
1757
1892
  }
1893
+ const sharedSkills = opts.skills ? opts.skills.split(",").map((s) => s.trim()).filter(Boolean) : config.shared_skills && config.shared_skills.length > 0 ? config.shared_skills : void 0;
1758
1894
  const db = openDatabase(config.db_path);
1759
1895
  try {
1760
- const card = publishFromSoulV2(db, content, config.owner);
1896
+ const card = publishFromSoulV2(db, content, config.owner, sharedSkills);
1761
1897
  console.log(`Published card ${card.id} with ${card.skills.length} skill(s)`);
1762
1898
  for (const skill of card.skills) {
1763
1899
  const stats = getPricingStats(db, skill.name);
@@ -1819,7 +1955,7 @@ openclaw.command("rules").description("Print HEARTBEAT.md rules block (or inject
1819
1955
  }
1820
1956
  });
1821
1957
  program.command("conduct <task>").description("Orchestrate a complex task across the AgentBnB network").option("--plan-only", "Show execution plan without executing").option("--max-budget <credits>", "Maximum credits to spend", "100").option("--json", "Output as JSON").action(async (task, opts) => {
1822
- const { conductAction } = await import("../conduct-6LKIJJKQ.js");
1958
+ const { conductAction } = await import("../conduct-QAFZIEY6.js");
1823
1959
  const result = await conductAction(task, opts);
1824
1960
  if (opts.json) {
1825
1961
  console.log(JSON.stringify(result, null, 2));
@@ -1930,7 +2066,7 @@ Feedback for skill: ${opts.skill} (${feedbacks.length} entries)
1930
2066
  }
1931
2067
  });
1932
2068
  program.command("mcp-server").description("Start an MCP (Model Context Protocol) server for IDE integration").action(async () => {
1933
- const { startMcpServer } = await import("../server-JVQW2TID.js");
2069
+ const { startMcpServer } = await import("../server-3G6ZTASA.js");
1934
2070
  await startMcpServer();
1935
2071
  });
1936
2072
  await program.parseAsync(process.argv);
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  requestCapability,
3
3
  requestViaRelay
4
- } from "./chunk-XND2DWTZ.js";
5
- import "./chunk-5KFI5X7B.js";
6
- import "./chunk-WGZ5AGOX.js";
4
+ } from "./chunk-VPQ44XKE.js";
5
+ import "./chunk-F53QQIM2.js";
6
+ import "./chunk-3CIMVISQ.js";
7
7
  export {
8
8
  requestCapability,
9
9
  requestViaRelay
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  conductAction
3
- } from "./chunk-NLAWT4DT.js";
3
+ } from "./chunk-7YLFLC5C.js";
4
4
  import "./chunk-JOY533UH.js";
5
5
  import "./chunk-QT7TEVNV.js";
6
- import "./chunk-WTXRY7R2.js";
6
+ import "./chunk-NYV3NE5Z.js";
7
7
  import "./chunk-3MJT4PZG.js";
8
- import "./chunk-EGUOAHCW.js";
9
- import "./chunk-CSATDXZC.js";
10
- import "./chunk-ZX5623ER.js";
11
- import "./chunk-NH2FIERR.js";
12
- import "./chunk-XND2DWTZ.js";
8
+ import "./chunk-C2T4BMRW.js";
9
+ import "./chunk-VMH2YS2I.js";
10
+ import "./chunk-Y7T6IMM3.js";
11
+ import "./chunk-574W3HHE.js";
12
+ import "./chunk-RVYQSC6L.js";
13
+ import "./chunk-VPQ44XKE.js";
14
+ import "./chunk-F53QQIM2.js";
13
15
  import "./chunk-5AH3CMOX.js";
14
16
  import "./chunk-75OC6E4F.js";
15
- import "./chunk-DFBX3BBD.js";
16
- import "./chunk-EANI2N2V.js";
17
- import "./chunk-5KFI5X7B.js";
18
- import "./chunk-WGZ5AGOX.js";
17
+ import "./chunk-KA2VIEGM.js";
18
+ import "./chunk-3CIMVISQ.js";
19
19
 
20
20
  // src/mcp/tools/conduct.ts
21
21
  import { z } from "zod";
@@ -0,0 +1,21 @@
1
+ import {
2
+ conductAction
3
+ } from "./chunk-7YLFLC5C.js";
4
+ import "./chunk-JOY533UH.js";
5
+ import "./chunk-QT7TEVNV.js";
6
+ import "./chunk-NYV3NE5Z.js";
7
+ import "./chunk-3MJT4PZG.js";
8
+ import "./chunk-C2T4BMRW.js";
9
+ import "./chunk-VMH2YS2I.js";
10
+ import "./chunk-Y7T6IMM3.js";
11
+ import "./chunk-574W3HHE.js";
12
+ import "./chunk-RVYQSC6L.js";
13
+ import "./chunk-VPQ44XKE.js";
14
+ import "./chunk-F53QQIM2.js";
15
+ import "./chunk-5AH3CMOX.js";
16
+ import "./chunk-75OC6E4F.js";
17
+ import "./chunk-KA2VIEGM.js";
18
+ import "./chunk-3CIMVISQ.js";
19
+ export {
20
+ conductAction
21
+ };