@web42/w42 0.1.1 → 0.1.3

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.
@@ -2,6 +2,7 @@ import { Command } from "commander";
2
2
  import chalk from "chalk";
3
3
  import ora from "ora";
4
4
  import { apiGet } from "../utils/api.js";
5
+ import { printBanner } from "../utils/banner.js";
5
6
  import { getConfig } from "../utils/config.js";
6
7
  function getCardName(card) {
7
8
  return card?.name ?? "Untitled Agent";
@@ -52,25 +53,6 @@ function wrapText(text, maxWidth, maxLines) {
52
53
  }
53
54
  return lines.slice(0, maxLines);
54
55
  }
55
- function printAsciiLogo() {
56
- const logo = chalk.bold.yellow(`$$$$$$$$ $$$$$$$ $$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \n` +
57
- `$$$$$$$$ $$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \n` +
58
- `$$$$$$$$ $$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \n` +
59
- `$$$$$$$$ $$$$$$$$$$$$ $$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \n` +
60
- `$$$$$$$$ $$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$ $$$$$$$$ \n` +
61
- `$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \n` +
62
- `$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \n` +
63
- `$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \n` +
64
- `$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$ $$$$$$$$ \n` +
65
- `$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \n` +
66
- `$$$$$$$$$$$$ $$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \n` +
67
- `$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ \n` +
68
- ` $$$$$$$$ \n` +
69
- ` $$$$$$$$ \n` +
70
- ` $$$$$$$$ `);
71
- console.log(logo);
72
- console.log();
73
- }
74
56
  function printGlobalHint() {
75
57
  const hint = ` Talk to any agent with ${chalk.cyan(`npx @web42/w42 send <owner/agent> "your message"`)}`;
76
58
  console.log(hint);
@@ -99,7 +81,7 @@ export const searchCommand = new Command("search")
99
81
  }
100
82
  const limit = parseInt(opts.limit, 10) || 10;
101
83
  const results = agents.slice(0, limit);
102
- printAsciiLogo();
84
+ printBanner();
103
85
  printGlobalHint();
104
86
  for (const agent of results) {
105
87
  const name = getCardName(agent.agent_card);
@@ -6,6 +6,7 @@ import ora from "ora";
6
6
  import express from "express";
7
7
  import { agentCardHandler, jsonRpcHandler, } from "@a2a-js/sdk/server/express";
8
8
  import { DefaultRequestHandler, InMemoryTaskStore, } from "@a2a-js/sdk/server";
9
+ import { printBanner } from "../utils/banner.js";
9
10
  import { requireAuth, getConfig } from "../utils/config.js";
10
11
  class OpenClawAgentExecutor {
11
12
  opts;
@@ -142,6 +143,7 @@ export const serveCommand = new Command("serve")
142
143
  .option("--openclaw-agent <id>", "OpenClaw agent ID to target", "main")
143
144
  .option("--client-id <id>", "Developer app client ID (or set W42_CLIENT_ID)")
144
145
  .option("--client-secret <secret>", "Developer app client secret (or set W42_CLIENT_SECRET)")
146
+ .option("--visibility <vis>", "Marketplace visibility: public or private", "public")
145
147
  .option("--verbose", "Enable verbose request/response logging")
146
148
  .action(async (opts) => {
147
149
  const verbose = opts.verbose ?? false;
@@ -259,7 +261,8 @@ export const serveCommand = new Command("serve")
259
261
  // 6. Start listening, then register
260
262
  app.listen(port, async () => {
261
263
  spinner.stop();
262
- console.log(chalk.green(`\n Agent "${agentName}" is live`));
264
+ printBanner();
265
+ console.log(chalk.green(` Agent "${agentName}" is live`));
263
266
  console.log(chalk.dim(` Local: http://localhost:${port}`));
264
267
  if (publicUrl)
265
268
  console.log(chalk.dim(` Public: ${publicUrl}`));
@@ -278,7 +281,7 @@ export const serveCommand = new Command("serve")
278
281
  Authorization: `Bearer ${token}`,
279
282
  "Content-Type": "application/json",
280
283
  },
281
- body: JSON.stringify({ url: registrationUrl }),
284
+ body: JSON.stringify({ url: registrationUrl, visibility: opts.visibility }),
282
285
  });
283
286
  if (regRes.ok) {
284
287
  const regData = (await regRes.json());
@@ -0,0 +1 @@
1
+ export declare function printBanner(): void;
@@ -0,0 +1,22 @@
1
+ import chalk from "chalk";
2
+ const LOGO = [
3
+ "$$$$$$$$ $$$$$$$ $$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
4
+ "$$$$$$$$ $$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$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$$$$",
15
+ " $$$$$$$$",
16
+ " $$$$$$$$",
17
+ " $$$$$$$$",
18
+ ].join("\n");
19
+ export function printBanner() {
20
+ console.log(chalk.bold.yellow(LOGO));
21
+ console.log();
22
+ }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const CLI_VERSION = "0.1.1";
1
+ export declare const CLI_VERSION = "0.1.3";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = "0.1.1";
1
+ export const CLI_VERSION = "0.1.3";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@web42/w42",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "CLI for the Web42 Agent Network — discover, register, and communicate with A2A agents",
5
5
  "type": "module",
6
6
  "bin": {