traderclaw-cli 1.0.53 → 1.0.54

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/bin/cli.ts CHANGED
@@ -204,6 +204,8 @@ async function cmdSetup(args: string[]) {
204
204
  let apiKey = "";
205
205
  let orchestratorUrl = "";
206
206
 
207
+ let forwardTelegramRecipientArg = "";
208
+
207
209
  for (let i = 0; i < args.length; i++) {
208
210
  if ((args[i] === "--api-key" || args[i] === "-k") && args[i + 1]) {
209
211
  apiKey = args[++i];
@@ -211,6 +213,14 @@ async function cmdSetup(args: string[]) {
211
213
  if ((args[i] === "--url" || args[i] === "-u") && args[i + 1]) {
212
214
  orchestratorUrl = args[++i];
213
215
  }
216
+ if (
217
+ (args[i] === "--telegram-recipient" ||
218
+ args[i] === "--forward-telegram-chat-id" ||
219
+ args[i] === "--telegram-chat-id") &&
220
+ args[i + 1]
221
+ ) {
222
+ forwardTelegramRecipientArg = args[++i];
223
+ }
214
224
  }
215
225
 
216
226
  if (!apiKey) {
@@ -344,6 +354,17 @@ async function cmdSetup(args: string[]) {
344
354
  process.exit(1);
345
355
  }
346
356
 
357
+ print("\nTelegram delivery (optional)...\n");
358
+ printInfo(" Enter your Telegram @username or numeric chat id so agent replies can be routed to you.");
359
+ printInfo(" Usernames are resolved with Telegram getChat (set TELEGRAM_BOT_TOKEN on the gateway, or");
360
+ printInfo(" export it here for immediate resolution). Private chats: message your bot once first.\n");
361
+
362
+ let forwardTelegramRecipient = forwardTelegramRecipientArg.trim();
363
+ if (!forwardTelegramRecipient) {
364
+ forwardTelegramRecipient = await prompt("Telegram @username or chat id (optional, Enter to skip)", "");
365
+ }
366
+ forwardTelegramRecipient = forwardTelegramRecipient.trim();
367
+
347
368
  print("\nWriting configuration...\n");
348
369
 
349
370
  const existingConfig = readConfig();
@@ -353,6 +374,32 @@ async function cmdSetup(args: string[]) {
353
374
  apiKey,
354
375
  apiTimeout: 120000,
355
376
  };
377
+
378
+ if (forwardTelegramRecipient) {
379
+ try {
380
+ const { resolveTelegramRecipientToChatId, looksLikeTelegramChatId } = await import("../src/telegram-resolve.ts");
381
+ const botToken = String(
382
+ process.env.TELEGRAM_BOT_TOKEN || process.env.OPENCLAW_TELEGRAM_BOT_TOKEN || "",
383
+ ).trim();
384
+ if (looksLikeTelegramChatId(forwardTelegramRecipient)) {
385
+ pluginConfig.forwardTelegramRecipient = forwardTelegramRecipient;
386
+ printSuccess(` Saved Telegram chat id`);
387
+ } else if (botToken) {
388
+ const id = await resolveTelegramRecipientToChatId({ botToken, raw: forwardTelegramRecipient });
389
+ pluginConfig.forwardTelegramRecipient = id;
390
+ printSuccess(` Resolved @${forwardTelegramRecipient.replace(/^@/, "")} → chat id ${id}`);
391
+ } else {
392
+ pluginConfig.forwardTelegramRecipient = forwardTelegramRecipient;
393
+ printInfo(
394
+ " Saved as-is; start the gateway with TELEGRAM_BOT_TOKEN set to resolve @username on first run.",
395
+ );
396
+ }
397
+ } catch (err) {
398
+ printWarn(` Telegram resolve failed: ${err instanceof Error ? err.message : String(err)}`);
399
+ printInfo(" Saving your username anyway — fix token or use numeric chat id.");
400
+ pluginConfig.forwardTelegramRecipient = forwardTelegramRecipient;
401
+ }
402
+ }
356
403
  setPluginConfig(existingConfig, pluginConfig);
357
404
  writeConfig(existingConfig);
358
405
 
@@ -365,6 +412,7 @@ async function cmdSetup(args: string[]) {
365
412
  Orchestrator: ${orchestratorUrl}
366
413
  Wallet: ${walletLabel} (ID: ${walletId})
367
414
  API Key: ${maskKey(apiKey)}
415
+ Telegram fwd: ${(pluginConfig.forwardTelegramRecipient as string) || "(not set)"}
368
416
  Config: ${CONFIG_FILE}
369
417
  `);
370
418
  print("Next steps:");
@@ -575,8 +623,9 @@ Commands:
575
623
  config View and manage configuration
576
624
 
577
625
  Setup options:
578
- --api-key, -k API key (skip interactive prompt)
579
- --url, -u Orchestrator URL (skip interactive prompt)
626
+ --api-key, -k API key (skip interactive prompt)
627
+ --url, -u Orchestrator URL (skip interactive prompt)
628
+ --telegram-recipient Telegram @username or chat id (alias: --forward-telegram-chat-id)
580
629
 
581
630
  Config subcommands:
582
631
  config show Show current configuration
@@ -586,6 +635,7 @@ Config subcommands:
586
635
  Examples:
587
636
  openclaw-trader setup
588
637
  openclaw-trader setup --api-key sk_live_abc123 --url https://api.traderclaw.ai
638
+ openclaw-trader setup --telegram-recipient @MyChannelOrUser
589
639
  openclaw-trader status
590
640
  openclaw-trader config show
591
641
  openclaw-trader config set apiTimeout 60000
@@ -2262,7 +2262,7 @@ function wizardHtml(defaults) {
2262
2262
  const updateHint = () => {
2263
2263
  const elapsedSeconds = Math.max(1, Math.floor((Date.now() - llmLoadStartedAt) / 1000));
2264
2264
  if (elapsedSeconds >= 8) {
2265
- llmLoadingHintTextEl.textContent = "Still loading provider catalog (" + elapsedSeconds + "s). First run can take up to ~20s.";
2265
+ llmLoadingHintTextEl.textContent = "Still loading provider catalog (" + elapsedSeconds + "s). First run can take up to ~60s.";
2266
2266
  return;
2267
2267
  }
2268
2268
  llmLoadingHintTextEl.textContent = "Fetching provider list (" + elapsedSeconds + "s)...";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "traderclaw-cli",
3
- "version": "1.0.53",
3
+ "version": "1.0.54",
4
4
  "description": "Global TraderClaw CLI (install --wizard, setup, precheck). Installs solana-traderclaw as a dependency for OpenClaw plugin files.",
5
5
  "type": "module",
6
6
  "bin": {