@web42/cli 0.2.7 → 0.2.9

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.
Files changed (58) hide show
  1. package/dist/commands/search.js +20 -15
  2. package/dist/commands/send.js +75 -41
  3. package/dist/commands/serve.d.ts +1 -1
  4. package/dist/commands/serve.js +160 -114
  5. package/dist/index.js +1 -19
  6. package/dist/version.d.ts +1 -1
  7. package/dist/version.js +1 -1
  8. package/package.json +1 -1
  9. package/dist/commands/config.d.ts +0 -2
  10. package/dist/commands/config.js +0 -27
  11. package/dist/commands/init.d.ts +0 -2
  12. package/dist/commands/init.js +0 -451
  13. package/dist/commands/install.d.ts +0 -3
  14. package/dist/commands/install.js +0 -231
  15. package/dist/commands/list.d.ts +0 -3
  16. package/dist/commands/list.js +0 -22
  17. package/dist/commands/pack.d.ts +0 -2
  18. package/dist/commands/pack.js +0 -210
  19. package/dist/commands/pull.d.ts +0 -2
  20. package/dist/commands/pull.js +0 -202
  21. package/dist/commands/push.d.ts +0 -2
  22. package/dist/commands/push.js +0 -374
  23. package/dist/commands/remix.d.ts +0 -2
  24. package/dist/commands/remix.js +0 -49
  25. package/dist/commands/sync.d.ts +0 -2
  26. package/dist/commands/sync.js +0 -98
  27. package/dist/commands/uninstall.d.ts +0 -3
  28. package/dist/commands/uninstall.js +0 -54
  29. package/dist/commands/update.d.ts +0 -3
  30. package/dist/commands/update.js +0 -59
  31. package/dist/platforms/base.d.ts +0 -82
  32. package/dist/platforms/base.js +0 -1
  33. package/dist/platforms/claude/__tests__/adapter.test.d.ts +0 -1
  34. package/dist/platforms/claude/__tests__/adapter.test.js +0 -257
  35. package/dist/platforms/claude/__tests__/security.test.d.ts +0 -1
  36. package/dist/platforms/claude/__tests__/security.test.js +0 -166
  37. package/dist/platforms/claude/adapter.d.ts +0 -34
  38. package/dist/platforms/claude/adapter.js +0 -525
  39. package/dist/platforms/claude/security.d.ts +0 -15
  40. package/dist/platforms/claude/security.js +0 -67
  41. package/dist/platforms/claude/templates.d.ts +0 -5
  42. package/dist/platforms/claude/templates.js +0 -22
  43. package/dist/platforms/openclaw/adapter.d.ts +0 -12
  44. package/dist/platforms/openclaw/adapter.js +0 -476
  45. package/dist/platforms/openclaw/templates.d.ts +0 -7
  46. package/dist/platforms/openclaw/templates.js +0 -369
  47. package/dist/platforms/registry.d.ts +0 -6
  48. package/dist/platforms/registry.js +0 -32
  49. package/dist/types/sync.d.ts +0 -74
  50. package/dist/types/sync.js +0 -7
  51. package/dist/utils/bundled-skills.d.ts +0 -6
  52. package/dist/utils/bundled-skills.js +0 -29
  53. package/dist/utils/secrets.d.ts +0 -32
  54. package/dist/utils/secrets.js +0 -118
  55. package/dist/utils/skill.d.ts +0 -6
  56. package/dist/utils/skill.js +0 -42
  57. package/dist/utils/sync.d.ts +0 -14
  58. package/dist/utils/sync.js +0 -242
@@ -1,13 +1,12 @@
1
- import { existsSync, readFileSync } from 'fs';
2
- import { join } from 'path';
3
- import { Command } from 'commander';
4
- import chalk from 'chalk';
5
- import ora from 'ora';
6
- import express from 'express';
7
- import { agentCardHandler, jsonRpcHandler, } from '@a2a-js/sdk/server/express';
8
- import { DefaultRequestHandler, InMemoryTaskStore, } from '@a2a-js/sdk/server';
9
- import { requireAuth } from '../utils/config.js';
10
- import { getConfig } from '../utils/config.js';
1
+ import { existsSync, readFileSync } from "fs";
2
+ import { join } from "path";
3
+ import { Command } from "commander";
4
+ import chalk from "chalk";
5
+ import ora from "ora";
6
+ import express from "express";
7
+ import { agentCardHandler, jsonRpcHandler, } from "@a2a-js/sdk/server/express";
8
+ import { DefaultRequestHandler, InMemoryTaskStore, } from "@a2a-js/sdk/server";
9
+ import { requireAuth, getConfig } from "../utils/config.js";
11
10
  class OpenClawAgentExecutor {
12
11
  opts;
13
12
  verbose;
@@ -18,7 +17,7 @@ class OpenClawAgentExecutor {
18
17
  async execute(requestContext, eventBus) {
19
18
  const { taskId, contextId, userMessage } = requestContext;
20
19
  const userText = userMessage.parts
21
- .find((p) => p.kind === 'text')?.text ?? '';
20
+ .find((p) => p.kind === "text")?.text ?? "";
22
21
  if (this.verbose) {
23
22
  console.log(chalk.gray(`[verbose] → OpenClaw request: agent=${this.opts.openClawAgent} session=${contextId} port=${this.opts.openClawPort}`));
24
23
  console.log(chalk.gray(`[verbose] → message text: "${userText.slice(0, 100)}"`));
@@ -26,17 +25,17 @@ class OpenClawAgentExecutor {
26
25
  let response;
27
26
  try {
28
27
  response = await fetch(`http://localhost:${this.opts.openClawPort}/v1/chat/completions`, {
29
- method: 'POST',
28
+ method: "POST",
30
29
  headers: {
31
30
  Authorization: `Bearer ${this.opts.openClawToken}`,
32
- 'Content-Type': 'application/json',
33
- 'x-openclaw-agent-id': this.opts.openClawAgent,
34
- 'x-openclaw-session-key': `agent:${this.opts.openClawAgent}:${contextId}`,
31
+ "Content-Type": "application/json",
32
+ "x-openclaw-agent-id": this.opts.openClawAgent,
33
+ "x-openclaw-session-key": `agent:${this.opts.openClawAgent}:${contextId}`,
35
34
  },
36
35
  body: JSON.stringify({
37
- model: 'openclaw',
36
+ model: "openclaw",
38
37
  stream: true,
39
- messages: [{ role: 'user', content: userText }],
38
+ messages: [{ role: "user", content: userText }],
40
39
  }),
41
40
  });
42
41
  }
@@ -49,27 +48,27 @@ class OpenClawAgentExecutor {
49
48
  }
50
49
  if (!response.ok) {
51
50
  if (this.verbose) {
52
- const body = await response.text().catch(() => '(unreadable)');
51
+ const body = await response.text().catch(() => "(unreadable)");
53
52
  console.log(chalk.gray(`[verbose] ← response body: ${body}`));
54
53
  }
55
54
  throw new Error(`OpenClaw error: ${response.status} ${response.statusText}`);
56
55
  }
57
56
  const reader = response.body.getReader();
58
57
  const decoder = new TextDecoder();
59
- let buffer = '';
58
+ let buffer = "";
60
59
  let tokenCount = 0;
61
60
  while (true) {
62
61
  const { done, value } = await reader.read();
63
62
  if (done)
64
63
  break;
65
64
  buffer += decoder.decode(value, { stream: true });
66
- const lines = buffer.split('\n');
67
- buffer = lines.pop() ?? '';
65
+ const lines = buffer.split("\n");
66
+ buffer = lines.pop() ?? "";
68
67
  for (const line of lines) {
69
- if (!line.startsWith('data: '))
68
+ if (!line.startsWith("data: "))
70
69
  continue;
71
70
  const data = line.slice(6).trim();
72
- if (data === '[DONE]')
71
+ if (data === "[DONE]")
73
72
  continue;
74
73
  try {
75
74
  const chunk = JSON.parse(data);
@@ -77,12 +76,12 @@ class OpenClawAgentExecutor {
77
76
  if (token) {
78
77
  tokenCount++;
79
78
  eventBus.publish({
80
- kind: 'artifact-update',
79
+ kind: "artifact-update",
81
80
  taskId,
82
81
  contextId,
83
82
  artifact: {
84
- artifactId: 'response',
85
- parts: [{ kind: 'text', text: token }],
83
+ artifactId: "response",
84
+ parts: [{ kind: "text", text: token }],
86
85
  },
87
86
  });
88
87
  }
@@ -96,10 +95,10 @@ class OpenClawAgentExecutor {
96
95
  console.log(chalk.gray(`[verbose] ← stream complete: ${tokenCount} tokens received`));
97
96
  }
98
97
  eventBus.publish({
99
- kind: 'status-update',
98
+ kind: "status-update",
100
99
  taskId,
101
100
  contextId,
102
- status: { state: 'completed', timestamp: new Date().toISOString() },
101
+ status: { state: "completed", timestamp: new Date().toISOString() },
103
102
  final: true,
104
103
  });
105
104
  eventBus.finished();
@@ -112,35 +111,37 @@ class OpenClawAgentExecutor {
112
111
  async function publishLiveUrl({ apiUrl, token, slug, a2aUrl, enabled, gatewayStatus, }) {
113
112
  try {
114
113
  const res = await fetch(`${apiUrl}/api/agents/${slug}/a2a`, {
115
- method: 'POST',
114
+ method: "POST",
116
115
  headers: {
117
116
  Authorization: `Bearer ${token}`,
118
- 'Content-Type': 'application/json',
117
+ "Content-Type": "application/json",
119
118
  },
120
119
  body: JSON.stringify({ a2a_url: a2aUrl, a2a_enabled: enabled, gateway_status: gatewayStatus }),
121
120
  });
122
121
  if (!res.ok) {
123
- console.warn(chalk.yellow(`⚠ Could not register URL with marketplace: ${res.status}`));
122
+ console.warn(chalk.yellow(` Could not register URL with marketplace: ${res.status}`));
124
123
  }
125
124
  else {
126
- console.log(chalk.dim(' Registered with marketplace ✓'));
125
+ console.log(chalk.dim(" Registered with marketplace"));
127
126
  }
128
127
  }
129
128
  catch (err) {
130
- console.warn(chalk.yellow(`⚠ Could not register URL with marketplace: ${String(err)}`));
129
+ console.warn(chalk.yellow(` Could not register URL with marketplace: ${String(err)}`));
131
130
  }
132
131
  }
133
132
  // ---------------------------------------------------------------------------
134
133
  // Command
135
134
  // ---------------------------------------------------------------------------
136
- export const serveCommand = new Command('serve')
137
- .description('Start a local A2A server for your agent')
138
- .option('--port <port>', 'Port to listen on', '4000')
139
- .option('--url <url>', 'Public URL (e.g. from ngrok) shown in logs and AgentCard')
140
- .option('--openclaw-port <port>', 'OpenClaw gateway port', '18789')
141
- .option('--openclaw-token <token>', 'OpenClaw gateway auth token (or set OPENCLAW_GATEWAY_TOKEN)')
142
- .option('--openclaw-agent <id>', 'OpenClaw agent ID to target', 'main')
143
- .option('--verbose', 'Enable verbose request/response logging')
135
+ export const serveCommand = new Command("serve")
136
+ .description("Start a local A2A server for your agent")
137
+ .option("--port <port>", "Port to listen on", "4000")
138
+ .option("--url <url>", "Public URL (e.g. from ngrok) for registration and AgentCard")
139
+ .option("--openclaw-port <port>", "OpenClaw gateway port", "18789")
140
+ .option("--openclaw-token <token>", "OpenClaw gateway auth token (or set OPENCLAW_GATEWAY_TOKEN)")
141
+ .option("--openclaw-agent <id>", "OpenClaw agent ID to target", "main")
142
+ .option("--client-id <id>", "Developer app client ID (or set WEB42_CLIENT_ID)")
143
+ .option("--client-secret <secret>", "Developer app client secret (or set WEB42_CLIENT_SECRET)")
144
+ .option("--verbose", "Enable verbose request/response logging")
144
145
  .action(async (opts) => {
145
146
  const verbose = opts.verbose ?? false;
146
147
  // 1. Must be logged into web42
@@ -150,131 +151,176 @@ export const serveCommand = new Command('serve')
150
151
  token = authConfig.token;
151
152
  }
152
153
  catch {
153
- console.error(chalk.red('Not authenticated. Run `web42 auth login` first.'));
154
+ console.error(chalk.red("Not authenticated. Run `web42 auth login` first."));
155
+ process.exit(1);
156
+ }
157
+ const clientId = opts.clientId ?? process.env.WEB42_CLIENT_ID;
158
+ const clientSecret = opts.clientSecret ?? process.env.WEB42_CLIENT_SECRET;
159
+ if (!clientId || !clientSecret) {
160
+ console.error(chalk.red("Developer app credentials required.\n" +
161
+ " Provide --client-id and --client-secret flags,\n" +
162
+ " or set WEB42_CLIENT_ID and WEB42_CLIENT_SECRET env vars.\n" +
163
+ " Create them at: https://web42.ai/settings/developer-apps"));
154
164
  process.exit(1);
155
165
  }
156
- const cwd = process.cwd();
157
- const port = parseInt(opts.port, 10);
158
166
  const openClawPort = parseInt(opts.openclawPort, 10);
159
- const openClawToken = opts.openclawToken ?? process.env.OPENCLAW_GATEWAY_TOKEN ?? '';
167
+ const openClawToken = opts.openclawToken ?? process.env.OPENCLAW_GATEWAY_TOKEN ?? "";
160
168
  const openClawAgent = opts.openclawAgent;
169
+ const cwd = process.cwd();
170
+ const port = parseInt(opts.port, 10);
161
171
  const publicUrl = opts.url;
162
- // 2. Read manifest.json
163
- const manifestPath = join(cwd, 'manifest.json');
164
- if (!existsSync(manifestPath)) {
165
- console.error(chalk.red('No manifest.json found in current directory.'));
166
- console.error(chalk.dim('Run `web42 init` to create one.'));
172
+ const config = getConfig();
173
+ const web42ApiUrl = config.apiUrl ?? "https://web42.ai";
174
+ // 2. Read agent-card.json from cwd
175
+ const cardPath = join(cwd, "agent-card.json");
176
+ if (!existsSync(cardPath)) {
177
+ console.error(chalk.red("No agent-card.json found in current directory."));
178
+ console.error(chalk.dim("Create an agent-card.json with your agent's A2A card."));
167
179
  process.exit(1);
168
180
  }
169
- let manifest;
181
+ let cardData;
170
182
  try {
171
- manifest = JSON.parse(readFileSync(manifestPath, 'utf-8'));
183
+ cardData = JSON.parse(readFileSync(cardPath, "utf-8"));
172
184
  }
173
185
  catch {
174
- console.error(chalk.red('Failed to parse manifest.json.'));
186
+ console.error(chalk.red("Failed to parse agent-card.json."));
175
187
  process.exit(1);
176
188
  }
177
- if (!manifest.name) {
178
- console.error(chalk.red('manifest.json must have a "name" field.'));
189
+ const agentName = cardData.name ?? "Untitled Agent";
190
+ if (!agentName || agentName === "Untitled Agent") {
191
+ console.error(chalk.red('agent-card.json must have a "name" field.'));
179
192
  process.exit(1);
180
193
  }
181
- const config = getConfig();
182
- const web42ApiUrl = config.apiUrl ?? 'https://web42.ai';
183
- const spinner = ora('Starting A2A server...').start();
184
- // 3. Build AgentCard from manifest
194
+ const spinner = ora("Starting A2A server...").start();
195
+ // 3. Build AgentCard from local file + overrides
185
196
  const agentCard = {
186
- name: manifest.name,
187
- description: manifest.description ?? '',
188
- protocolVersion: '0.3.0',
189
- version: manifest.version ?? '1.0.0',
197
+ name: agentName,
198
+ description: cardData.description ?? "",
199
+ protocolVersion: cardData.protocolVersion ?? "0.3.0",
200
+ version: cardData.version ?? "1.0.0",
190
201
  url: `${publicUrl ?? `http://localhost:${port}`}/a2a/jsonrpc`,
191
- skills: (manifest.skills ?? []).map((s) => ({
192
- id: s.name.toLowerCase().replace(/\s+/g, '-'),
193
- name: s.name,
194
- description: s.description ?? '',
195
- tags: [],
196
- })),
202
+ skills: cardData.skills ?? [],
197
203
  capabilities: {
198
204
  streaming: true,
199
205
  pushNotifications: false,
206
+ ...(cardData.capabilities ?? {}),
200
207
  },
201
- defaultInputModes: ['text'],
202
- defaultOutputModes: ['text'],
208
+ defaultInputModes: cardData.defaultInputModes ?? ["text"],
209
+ defaultOutputModes: cardData.defaultOutputModes ?? ["text"],
203
210
  securitySchemes: {
204
- Web42Bearer: { type: 'http', scheme: 'bearer' },
211
+ Web42Bearer: { type: "http", scheme: "bearer" },
205
212
  },
206
213
  security: [{ Web42Bearer: [] }],
207
214
  };
208
215
  // 4. Start Express server
209
216
  const app = express();
210
- // Auth: validate caller's web42 Bearer token against marketplace introspect endpoint
217
+ // Auth: validate caller's Bearer token via Web42 introspection with Basic auth
218
+ const basicAuth = `Basic ${Buffer.from(`${clientId}:${clientSecret}`).toString("base64")}`;
211
219
  const userBuilder = async (req) => {
212
- const callerToken = req.headers.authorization?.split(' ')[1];
220
+ const callerToken = req.headers.authorization?.split(" ")[1];
213
221
  if (!callerToken)
214
- throw new Error('Missing token');
222
+ throw new Error("Missing token");
215
223
  if (verbose) {
216
- const masked = `${callerToken.slice(0, 8)}...`;
217
- console.log(chalk.gray(`[verbose] userBuilder: token=${masked} → introspecting...`));
224
+ console.log(chalk.gray(`[verbose] Introspecting token ${callerToken.slice(0, 8)}...`));
218
225
  }
219
226
  const res = await fetch(`${web42ApiUrl}/api/auth/introspect`, {
220
- method: 'POST',
221
- headers: { 'Content-Type': 'application/json' },
222
- body: JSON.stringify({ token: callerToken }),
227
+ method: "POST",
228
+ headers: {
229
+ Authorization: basicAuth,
230
+ "Content-Type": "application/x-www-form-urlencoded",
231
+ },
232
+ body: new URLSearchParams({ token: callerToken }),
223
233
  });
224
234
  if (!res.ok)
225
- throw new Error('Introspect call failed');
235
+ throw new Error("Introspect call failed");
226
236
  const result = (await res.json());
227
237
  if (verbose) {
228
- console.log(chalk.gray(`[verbose] userBuilder: token=${callerToken.slice(0, 8)}... → active=${result.active} sub=${result.sub ?? '(none)'}`));
238
+ console.log(chalk.gray(`[verbose] active=${result.active} sub=${result.sub ?? "(none)"}`));
229
239
  }
230
240
  if (!result.active)
231
- throw new Error('Unauthorized');
232
- const userId = result.sub ?? '';
241
+ throw new Error("Unauthorized");
233
242
  return {
234
243
  get isAuthenticated() { return true; },
235
- get userName() { return userId; },
244
+ get userName() { return result.sub ?? ""; },
236
245
  };
237
246
  };
238
- const executor = new OpenClawAgentExecutor({ openClawPort, openClawToken, openClawAgent, verbose });
247
+ const executor = new OpenClawAgentExecutor({
248
+ openClawPort,
249
+ openClawToken,
250
+ openClawAgent,
251
+ verbose,
252
+ });
239
253
  const requestHandler = new DefaultRequestHandler(agentCard, new InMemoryTaskStore(), executor);
240
254
  // 5. Mount A2A SDK handlers
241
- app.use('/.well-known/agent-card.json', agentCardHandler({ agentCardProvider: requestHandler }));
242
- app.use('/a2a/jsonrpc', jsonRpcHandler({ requestHandler, userBuilder }));
255
+ app.use("/.well-known/agent-card.json", agentCardHandler({ agentCardProvider: requestHandler }));
256
+ app.use("/a2a/jsonrpc", jsonRpcHandler({ requestHandler, userBuilder }));
243
257
  const a2aUrl = `${publicUrl ?? `http://localhost:${port}`}/a2a/jsonrpc`;
244
- // 6. Start listening
258
+ // 6. Start listening, then register
245
259
  app.listen(port, async () => {
246
260
  spinner.stop();
247
- console.log(chalk.green(`\n Agent "${manifest.name}" is live`));
248
- console.log(chalk.dim(` Local: http://localhost:${port}`));
261
+ console.log(chalk.green(`\n Agent "${agentName}" is live`));
262
+ console.log(chalk.dim(` Local: http://localhost:${port}`));
249
263
  if (publicUrl)
250
- console.log(chalk.dim(` Public: ${publicUrl}`));
264
+ console.log(chalk.dim(` Public: ${publicUrl}`));
251
265
  console.log(chalk.dim(` Agent card: http://localhost:${port}/.well-known/agent-card.json`));
252
266
  console.log(chalk.dim(` JSON-RPC: http://localhost:${port}/a2a/jsonrpc`));
253
267
  if (verbose) {
254
- console.log(chalk.gray(`[verbose] agent card url: http://localhost:${port}/.well-known/agent-card.json`));
255
- console.log(chalk.gray(`[verbose] openclaw target: http://localhost:${openClawPort}/v1/chat/completions agent=${openClawAgent}`));
268
+ console.log(chalk.gray(`[verbose] OpenClaw target: http://localhost:${openClawPort}/v1/chat/completions agent=${openClawAgent}`));
269
+ }
270
+ // Register agent with marketplace — API crawls back to fetch the card
271
+ const registrationUrl = publicUrl ?? `http://localhost:${port}`;
272
+ let registeredSlug = null;
273
+ try {
274
+ const regRes = await fetch(`${web42ApiUrl}/api/agents`, {
275
+ method: "POST",
276
+ headers: {
277
+ Authorization: `Bearer ${token}`,
278
+ "Content-Type": "application/json",
279
+ },
280
+ body: JSON.stringify({ url: registrationUrl }),
281
+ });
282
+ if (regRes.ok) {
283
+ const regData = (await regRes.json());
284
+ registeredSlug = regData.agent?.slug ?? null;
285
+ console.log(chalk.dim(` Registered with marketplace (slug: ${registeredSlug})`));
286
+ }
287
+ else {
288
+ const errBody = await regRes.json().catch(() => ({}));
289
+ console.warn(chalk.yellow(` Could not register with marketplace: ${errBody.error ?? regRes.status}`));
290
+ }
291
+ }
292
+ catch (err) {
293
+ console.warn(chalk.yellow(` Could not register with marketplace: ${String(err)}`));
294
+ }
295
+ // Publish live A2A URL
296
+ if (registeredSlug) {
297
+ await publishLiveUrl({
298
+ apiUrl: web42ApiUrl,
299
+ token,
300
+ slug: registeredSlug,
301
+ a2aUrl,
302
+ enabled: true,
303
+ gatewayStatus: "live",
304
+ });
256
305
  }
257
- await publishLiveUrl({
258
- apiUrl: web42ApiUrl,
259
- token,
260
- slug: manifest.name,
261
- a2aUrl,
262
- enabled: true,
263
- gatewayStatus: 'live',
264
- });
265
306
  if (!publicUrl) {
266
- console.log(chalk.yellow(' No --url provided. Registered localhost URL is not publicly reachable; buyers cannot connect.'));
307
+ console.log(chalk.yellow(" No --url provided. Registered localhost URL is not publicly reachable."));
267
308
  }
268
- console.log(chalk.dim('\nWaiting for requests... (Ctrl+C to stop)\n'));
269
- });
270
- // 7. Keep process alive
271
- process.on('SIGINT', async () => {
272
- console.log(chalk.dim('\nShutting down...'));
273
- await fetch(`${web42ApiUrl}/api/agents/${manifest.name}/a2a`, {
274
- method: 'POST',
275
- headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },
276
- body: JSON.stringify({ a2a_url: null, a2a_enabled: false, gateway_status: 'offline' }),
277
- }).catch(() => { }); // best-effort
278
- process.exit(0);
309
+ console.log(chalk.dim("\nWaiting for requests... (Ctrl+C to stop)\n"));
310
+ // 7. Graceful shutdown
311
+ process.on("SIGINT", async () => {
312
+ console.log(chalk.dim("\nShutting down..."));
313
+ if (registeredSlug) {
314
+ await publishLiveUrl({
315
+ apiUrl: web42ApiUrl,
316
+ token,
317
+ slug: registeredSlug,
318
+ a2aUrl: null,
319
+ enabled: false,
320
+ gatewayStatus: "offline",
321
+ }).catch(() => { });
322
+ }
323
+ process.exit(0);
324
+ });
279
325
  });
280
326
  });
package/dist/index.js CHANGED
@@ -1,23 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from "commander";
3
3
  import { authCommand } from "./commands/auth.js";
4
- import { configCommand } from "./commands/config.js";
5
- import { initCommand } from "./commands/init.js";
6
- import { packCommand } from "./commands/pack.js";
7
- import { pushCommand } from "./commands/push.js";
8
- import { pullCommand } from "./commands/pull.js";
9
- import { remixCommand } from "./commands/remix.js";
10
4
  import { searchCommand } from "./commands/search.js";
11
5
  import { sendCommand } from "./commands/send.js";
12
6
  import { serveCommand } from "./commands/serve.js";
13
- import { syncCommand } from "./commands/sync.js";
14
- import { getAllPlatformCommands } from "./platforms/registry.js";
15
7
  import { setApiUrl } from "./utils/config.js";
16
8
  import { CLI_VERSION } from "./version.js";
17
9
  const program = new Command();
18
10
  program
19
11
  .name("web42")
20
- .description("Web42 Agent Marketplace CLI — manage, install, and publish agent packages")
12
+ .description("Web42 CLI — authenticate, discover, and communicate with A2A agents")
21
13
  .version(CLI_VERSION)
22
14
  .option("--api-url <url>", "Override the API URL for this invocation")
23
15
  .hook("preAction", (thisCommand) => {
@@ -27,17 +19,7 @@ program
27
19
  }
28
20
  });
29
21
  program.addCommand(authCommand);
30
- program.addCommand(configCommand);
31
- program.addCommand(initCommand);
32
- program.addCommand(packCommand);
33
- program.addCommand(pushCommand);
34
- program.addCommand(pullCommand);
35
- program.addCommand(remixCommand);
36
22
  program.addCommand(searchCommand);
37
23
  program.addCommand(sendCommand);
38
24
  program.addCommand(serveCommand);
39
- program.addCommand(syncCommand);
40
- for (const platformCmd of getAllPlatformCommands()) {
41
- program.addCommand(platformCmd);
42
- }
43
25
  program.parse();
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const CLI_VERSION = "0.2.7";
1
+ export declare const CLI_VERSION = "0.2.9";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = "0.2.7";
1
+ export const CLI_VERSION = "0.2.9";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@web42/cli",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "description": "CLI for the Web42 Agent Marketplace - push, install, and remix OpenClaw agent packages",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,2 +0,0 @@
1
- import { Command } from "commander";
2
- export declare const configCommand: Command;
@@ -1,27 +0,0 @@
1
- import { Command } from "commander";
2
- import chalk from "chalk";
3
- import { getConfig, setApiUrl } from "../utils/config.js";
4
- export const configCommand = new Command("config").description("View or update CLI configuration");
5
- configCommand
6
- .command("show")
7
- .description("Show the current configuration")
8
- .action(() => {
9
- const cfg = getConfig();
10
- console.log(chalk.bold("Web42 CLI Configuration"));
11
- console.log();
12
- console.log(` API URL: ${chalk.cyan(cfg.apiUrl)}`);
13
- console.log(` Authenticated: ${cfg.authenticated ? chalk.green("yes") : chalk.yellow("no")}`);
14
- if (cfg.username) {
15
- console.log(` User: ${chalk.cyan(`@${cfg.username}`)}`);
16
- }
17
- if (cfg.fullName) {
18
- console.log(` Name: ${cfg.fullName}`);
19
- }
20
- });
21
- configCommand
22
- .command("set-url <url>")
23
- .description("Persistently set the API URL (e.g. http://localhost:3000)")
24
- .action((url) => {
25
- setApiUrl(url);
26
- console.log(chalk.green(`API URL set to ${chalk.bold(url)}`));
27
- });
@@ -1,2 +0,0 @@
1
- import { Command } from "commander";
2
- export declare const initCommand: Command;