@highway1/cli 0.1.55 → 0.1.57

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.js CHANGED
@@ -16616,7 +16616,7 @@ function getRelayUrls2(options) {
16616
16616
  return DEFAULT_RELAY_URLS2;
16617
16617
  }
16618
16618
  function registerDiscoverCommand(program2) {
16619
- program2.command("discover").description("Discover agents on the network").option("--capability <capability>", "Filter by capability").option("--did <did>", "Query specific DID").option("--query <text>", 'Natural language query (e.g., "translate Japanese")').option("--min-trust <score>", "Minimum trust score (0-1)").option("--language <lang>", "Filter by language").option("--limit <number>", "Maximum number of results", "10").option("--relay <url>", "Relay WebSocket URL").action(async (options) => {
16619
+ program2.command("discover").description("Discover agents on the network").option("--capability <capability>", "Filter by capability").option("--did <did>", "Query specific DID").option("--query <text>", 'Natural language query (e.g., "translate Japanese")').option("--min-trust <score>", "Minimum trust score (0-1)").option("--language <lang>", "Filter by language").option("--limit <number>", "Maximum number of results", "10").option("--all", "List all agents on the network").option("--relay <url>", "Relay WebSocket URL").action(async (options) => {
16620
16620
  try {
16621
16621
  printHeader("Discover Agents");
16622
16622
  const identity = getIdentity();
@@ -16723,9 +16723,31 @@ function registerDiscoverCommand(program2) {
16723
16723
  }
16724
16724
  }
16725
16725
  }
16726
+ } else if (options.all) {
16727
+ const cards = await relayIndex.searchSemantic({ limit: parseInt(options.limit, 10) });
16728
+ spin.succeed(`Found ${cards.length} agents`);
16729
+ if (cards.length > 0) {
16730
+ const table = new Table({
16731
+ head: ["DID", "Name", "Capabilities"],
16732
+ colWidths: [40, 20, 40]
16733
+ });
16734
+ for (const card2 of cards) {
16735
+ const capabilities2 = Array.isArray(card2.capabilities) ? card2.capabilities.map(
16736
+ (cap) => typeof cap === "string" ? cap : cap.name
16737
+ ).join(", ") : "";
16738
+ table.push([
16739
+ card2.did.substring(0, 35) + "...",
16740
+ card2.name,
16741
+ capabilities2.substring(0, 35) + (capabilities2.length > 35 ? "..." : "")
16742
+ ]);
16743
+ }
16744
+ console.log();
16745
+ console.log(table.toString());
16746
+ }
16726
16747
  } else {
16727
- spin.fail("Please specify --did, --capability, or --query");
16728
- info("Usage: hw1 discover --did <did>");
16748
+ spin.fail("Please specify --did, --capability, --query, or --all");
16749
+ info("Usage: hw1 discover --all");
16750
+ info(" hw1 discover --did <did>");
16729
16751
  info(" hw1 discover --capability <capability>");
16730
16752
  info(' hw1 discover --query "translate Japanese"');
16731
16753
  }