traderclaw-cli 1.0.68 → 1.0.69
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.
|
@@ -199,6 +199,38 @@ const NO_COLOR_ENV = { ...process.env, NO_COLOR: "1", FORCE_COLOR: "0" };
|
|
|
199
199
|
* every gateway restart and group messages are dropped. Wizard onboarding targets DMs first; set
|
|
200
200
|
* explicit "open" unless the user already configured sender allowlists.
|
|
201
201
|
*/
|
|
202
|
+
/**
|
|
203
|
+
* Write Telegram bot token directly to openclaw.json.
|
|
204
|
+
*
|
|
205
|
+
* `openclaw channels add --channel telegram` was removed — the Telegram plugin
|
|
206
|
+
* no longer exports register/activate, so the CLI rejects that call with
|
|
207
|
+
* "telegram missing register/activate export / Channel telegram does not support add."
|
|
208
|
+
*
|
|
209
|
+
* The current OpenClaw approach (docs.openclaw.ai/channels/telegram):
|
|
210
|
+
* channels.telegram.botToken = "<token>" → token source
|
|
211
|
+
* channels.telegram.enabled = true → enable the channel
|
|
212
|
+
* channels.telegram.dmPolicy = "pairing" → safe default (user approves first DM)
|
|
213
|
+
*/
|
|
214
|
+
function writeTelegramChannelConfig(botToken, configPath = CONFIG_FILE) {
|
|
215
|
+
let config = {};
|
|
216
|
+
try {
|
|
217
|
+
config = JSON.parse(readFileSync(configPath, "utf-8"));
|
|
218
|
+
} catch {
|
|
219
|
+
config = {};
|
|
220
|
+
}
|
|
221
|
+
if (!config.channels || typeof config.channels !== "object") config.channels = {};
|
|
222
|
+
if (!config.channels.telegram || typeof config.channels.telegram !== "object") config.channels.telegram = {};
|
|
223
|
+
config.channels.telegram.enabled = true;
|
|
224
|
+
config.channels.telegram.botToken = botToken;
|
|
225
|
+
// Only set dmPolicy if not already configured (preserve existing policy on re-installs).
|
|
226
|
+
if (!config.channels.telegram.dmPolicy) {
|
|
227
|
+
config.channels.telegram.dmPolicy = "pairing";
|
|
228
|
+
}
|
|
229
|
+
ensureAgentsDefaultsSchemaCompat(config);
|
|
230
|
+
mkdirSync(CONFIG_DIR, { recursive: true });
|
|
231
|
+
writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
|
|
232
|
+
}
|
|
233
|
+
|
|
202
234
|
function ensureTelegramGroupPolicyOpenForWizard(configPath = CONFIG_FILE) {
|
|
203
235
|
if (!existsSync(configPath)) return { changed: false };
|
|
204
236
|
let config = {};
|
|
@@ -1790,9 +1822,15 @@ export class InstallerStepEngine {
|
|
|
1790
1822
|
"Telegram token is required for this installer flow. Add your bot token in the wizard and start again.",
|
|
1791
1823
|
);
|
|
1792
1824
|
}
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1825
|
+
|
|
1826
|
+
// OpenClaw no longer supports `openclaw channels add --channel telegram`.
|
|
1827
|
+
// The Telegram plugin does not export register/activate, so that command
|
|
1828
|
+
// fails with "telegram missing register/activate export / Channel telegram
|
|
1829
|
+
// does not support add." The current documented approach is to write the
|
|
1830
|
+
// bot token directly to openclaw.json — see docs.openclaw.ai/channels/telegram.
|
|
1831
|
+
writeTelegramChannelConfig(this.options.telegramToken, CONFIG_FILE);
|
|
1832
|
+
this.emitLog("telegram_required", "info", "Telegram bot token written to openclaw.json (channels.telegram.botToken).");
|
|
1833
|
+
|
|
1796
1834
|
const policy = ensureTelegramGroupPolicyOpenForWizard();
|
|
1797
1835
|
if (policy.changed) {
|
|
1798
1836
|
this.emitLog(
|
|
@@ -1801,6 +1839,14 @@ export class InstallerStepEngine {
|
|
|
1801
1839
|
"Set channels.telegram.groupPolicy=open (no sender allowlist yet) to avoid Doctor allowlist warnings on gateway restart. Tighten groupAllowFrom later if you use groups.",
|
|
1802
1840
|
);
|
|
1803
1841
|
}
|
|
1842
|
+
|
|
1843
|
+
// Probe channel status for visibility — best-effort, don't fail the step.
|
|
1844
|
+
try {
|
|
1845
|
+
await runCommandWithEvents("openclaw", ["channels", "status", "--probe"]);
|
|
1846
|
+
} catch {
|
|
1847
|
+
this.emitLog("telegram_required", "warn", "channels status --probe did not complete (gateway may not be fully up yet). Token is written and will be active after gateway restart.");
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1804
1850
|
return { configured: true };
|
|
1805
1851
|
}
|
|
1806
1852
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "traderclaw-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.69",
|
|
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": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"node": ">=22"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"solana-traderclaw": "^1.0.
|
|
20
|
+
"solana-traderclaw": "^1.0.69"
|
|
21
21
|
},
|
|
22
22
|
"keywords": [
|
|
23
23
|
"traderclaw",
|