@web42/w42 0.1.0 → 0.1.2
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 +2 -20
- package/dist/commands/serve.js +3 -1
- package/dist/utils/banner.d.ts +1 -0
- package/dist/utils/banner.js +22 -0
- package/dist/utils/config.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/commands/search.js
CHANGED
|
@@ -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
|
-
`$$$$$$$$ $$$$$$$$$$$$ $$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$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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
|
-
|
|
84
|
+
printBanner();
|
|
103
85
|
printGlobalHint();
|
|
104
86
|
for (const agent of results) {
|
|
105
87
|
const name = getCardName(agent.agent_card);
|
package/dist/commands/serve.js
CHANGED
|
@@ -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;
|
|
@@ -259,7 +260,8 @@ export const serveCommand = new Command("serve")
|
|
|
259
260
|
// 6. Start listening, then register
|
|
260
261
|
app.listen(port, async () => {
|
|
261
262
|
spinner.stop();
|
|
262
|
-
|
|
263
|
+
printBanner();
|
|
264
|
+
console.log(chalk.green(` Agent "${agentName}" is live`));
|
|
263
265
|
console.log(chalk.dim(` Local: http://localhost:${port}`));
|
|
264
266
|
if (publicUrl)
|
|
265
267
|
console.log(chalk.dim(` Public: ${publicUrl}`));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function printBanner(): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
const LOGO = [
|
|
3
|
+
"$$$$$$$$ $$$$$$$ $$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
|
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$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
|
|
14
|
+
"$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$",
|
|
15
|
+
" $$$$$$$$",
|
|
16
|
+
" $$$$$$$$",
|
|
17
|
+
" $$$$$$$$",
|
|
18
|
+
].join("\n");
|
|
19
|
+
export function printBanner() {
|
|
20
|
+
console.log(chalk.bold.yellow(LOGO));
|
|
21
|
+
console.log();
|
|
22
|
+
}
|
package/dist/utils/config.js
CHANGED
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CLI_VERSION = "0.1.
|
|
1
|
+
export declare const CLI_VERSION = "0.1.2";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CLI_VERSION = "0.1.
|
|
1
|
+
export const CLI_VERSION = "0.1.2";
|