@web42/w42 0.1.22 → 0.1.23
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/commands/search.js +23 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/dist/commands/search.js
CHANGED
|
@@ -59,6 +59,25 @@ function formatSkills(skills) {
|
|
|
59
59
|
const skillNames = skills.map((s) => `${s.name}`);
|
|
60
60
|
return `Skills: ${skillNames.join(" • ")}`;
|
|
61
61
|
}
|
|
62
|
+
function getSecurityIndicator(card) {
|
|
63
|
+
const security = card?.security;
|
|
64
|
+
if (!security || security.length === 0)
|
|
65
|
+
return "";
|
|
66
|
+
const isWeb42 = security.some((req) => "Web42Bearer" in req);
|
|
67
|
+
return isWeb42 ? chalk.green("🛡") : chalk.dim("🛡");
|
|
68
|
+
}
|
|
69
|
+
function getPaymentIndicator(card) {
|
|
70
|
+
const exts = card?.capabilities?.extensions;
|
|
71
|
+
if (!exts)
|
|
72
|
+
return "";
|
|
73
|
+
const hasPayment = exts.some((e) => e.uri.includes("payments"));
|
|
74
|
+
if (!hasPayment)
|
|
75
|
+
return "";
|
|
76
|
+
// Check for Web42 payments (has client_id in network extension)
|
|
77
|
+
const networkExt = card?.capabilities?.extensions?.find((e) => e.uri === "https://web42.ai/ext/network/v1");
|
|
78
|
+
const clientId = networkExt?.params?.client_id;
|
|
79
|
+
return clientId ? chalk.blue("💳") : chalk.dim("💳");
|
|
80
|
+
}
|
|
62
81
|
export const searchCommand = new Command("search")
|
|
63
82
|
.description("Search the network for agents")
|
|
64
83
|
.argument("<query>", "Search query")
|
|
@@ -83,11 +102,14 @@ export const searchCommand = new Command("search")
|
|
|
83
102
|
const description = getCardDescription(agent.agent_card);
|
|
84
103
|
const stars = agent.stars_count > 0 ? `★ ${agent.stars_count}` : "";
|
|
85
104
|
const skills = formatSkills(agent.agent_card.skills);
|
|
86
|
-
// Header: - <name (link)> | <slug> | <stars>
|
|
105
|
+
// Header: - <name (link)> | <slug> | <badges> | <stars>
|
|
87
106
|
const nameLink = chalk.bold.cyan(terminalLink(name, `${config.apiUrl}/${agent.slug}`));
|
|
88
107
|
const slugLabel = chalk.dim(agent.slug);
|
|
89
108
|
const separator = chalk.dim(" | ");
|
|
109
|
+
const badges = [getSecurityIndicator(agent.agent_card), getPaymentIndicator(agent.agent_card)].filter(Boolean).join(" ");
|
|
90
110
|
const headerParts = [nameLink, slugLabel];
|
|
111
|
+
if (badges)
|
|
112
|
+
headerParts.push(badges);
|
|
91
113
|
if (stars)
|
|
92
114
|
headerParts.push(chalk.yellow(stars));
|
|
93
115
|
console.log(`- ${headerParts.join(separator)}`);
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CLI_VERSION = "0.1.
|
|
1
|
+
export declare const CLI_VERSION = "0.1.23";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CLI_VERSION = "0.1.
|
|
1
|
+
export const CLI_VERSION = "0.1.23";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@web42/w42",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"description": "CLI for the Web42 Agent Network — discover, register, and communicate with A2A agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"ora": "^8.1.0",
|
|
19
19
|
"uuid": "^13.0.0",
|
|
20
20
|
"zod": "^3.22.4",
|
|
21
|
-
"@web42/auth": "0.
|
|
21
|
+
"@web42/auth": "0.2.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/express": "^5.0.6",
|