@highway1/cli 0.1.54 → 0.1.56
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 +29 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -16462,7 +16462,7 @@ function registerInitCommand(program2) {
|
|
|
16462
16462
|
init_esm_shims();
|
|
16463
16463
|
init_dist();
|
|
16464
16464
|
var DEFAULT_RELAY_URLS = [
|
|
16465
|
-
"ws://
|
|
16465
|
+
"ws://hw1.woowot.com:8080"
|
|
16466
16466
|
];
|
|
16467
16467
|
function getRelayUrls(options) {
|
|
16468
16468
|
if (options.relay) return [options.relay];
|
|
@@ -16608,7 +16608,7 @@ function registerJoinCommand(program2) {
|
|
|
16608
16608
|
// src/commands/discover.ts
|
|
16609
16609
|
init_esm_shims();
|
|
16610
16610
|
init_dist();
|
|
16611
|
-
var DEFAULT_RELAY_URLS2 = ["ws://
|
|
16611
|
+
var DEFAULT_RELAY_URLS2 = ["ws://hw1.woowot.com:8080"];
|
|
16612
16612
|
function getRelayUrls2(options) {
|
|
16613
16613
|
if (options.relay) return [options.relay];
|
|
16614
16614
|
const envRelays = process.env.HW1_RELAY_URLS;
|
|
@@ -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 --
|
|
16728
|
-
info("Usage: hw1 discover --
|
|
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
|
}
|
|
@@ -16742,7 +16764,7 @@ init_esm_shims();
|
|
|
16742
16764
|
init_dist();
|
|
16743
16765
|
init_client();
|
|
16744
16766
|
var DEFAULT_RELAY_URLS3 = [
|
|
16745
|
-
"ws://
|
|
16767
|
+
"ws://hw1.woowot.com:8080"
|
|
16746
16768
|
];
|
|
16747
16769
|
function getRelayUrls3(options) {
|
|
16748
16770
|
if (options.relay) return [options.relay];
|
|
@@ -17411,7 +17433,7 @@ init_dist();
|
|
|
17411
17433
|
init_dist();
|
|
17412
17434
|
var logger15 = createLogger("daemon");
|
|
17413
17435
|
var DEFAULT_RELAY_URLS4 = [
|
|
17414
|
-
"ws://
|
|
17436
|
+
"ws://hw1.woowot.com:8080"
|
|
17415
17437
|
];
|
|
17416
17438
|
function getRelayUrls4() {
|
|
17417
17439
|
const envRelays = process.env.HW1_RELAY_URLS;
|