@wrongstack/telegram 0.319.0 → 0.320.1
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/bot.d.ts +1 -1
- package/dist/index.js +180 -70
- package/dist/poller.d.ts +1 -1
- package/package.json +3 -3
package/dist/bot.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { TelegramBotOptions } from './bot-types.js';
|
|
|
3
3
|
import { TelegramInbox } from './inbox.js';
|
|
4
4
|
import { Poller } from './poller.js';
|
|
5
5
|
import { TelegramOutbox } from './outbox.js';
|
|
6
|
-
export type { TelegramBotOptions, TelegramBotResponse, TelegramIncomingMessage } from './bot-types.js';
|
|
6
|
+
export type { TelegramBotOptions, TelegramBotResponse, TelegramIncomingMessage, } from './bot-types.js';
|
|
7
7
|
export type { TelegramApprovalRequestInput, TelegramApprovalResult } from './approval-flow.js';
|
|
8
8
|
export { escapeHtml, truncateForTelegram } from './text-format.js';
|
|
9
9
|
export declare class TelegramBot {
|
package/dist/index.js
CHANGED
|
@@ -278,7 +278,8 @@ var ApprovalFlow = class {
|
|
|
278
278
|
if (request?.state !== "pending") return false;
|
|
279
279
|
request.state = state;
|
|
280
280
|
clearTimeout(request.timer);
|
|
281
|
-
if (request.signal && request.abortHandler)
|
|
281
|
+
if (request.signal && request.abortHandler)
|
|
282
|
+
request.signal.removeEventListener("abort", request.abortHandler);
|
|
282
283
|
const leftover = request.pendingCallbacks.splice(0);
|
|
283
284
|
for (const cq of leftover) {
|
|
284
285
|
const notice = state === "expired" ? "Approval request expired" : state === "cancelled" ? "Approval request cancelled" : "Approval request settled";
|
|
@@ -298,7 +299,9 @@ var ApprovalFlow = class {
|
|
|
298
299
|
const denialReason = this.inboundDenialReason(userId, chatId);
|
|
299
300
|
if (denialReason) {
|
|
300
301
|
const identity = denialReason === "user" ? userId ?? "unknown" : chatId ?? "unknown";
|
|
301
|
-
this.log.warn(
|
|
302
|
+
this.log.warn(
|
|
303
|
+
`Ignoring callback_query from non-allowlisted ${denialReason} ${identity} (data="${key}") \u2014 possible hijack attempt.`
|
|
304
|
+
);
|
|
302
305
|
await this.answerCallback(cq.id, "\u26D4 Not authorized", true);
|
|
303
306
|
return;
|
|
304
307
|
}
|
|
@@ -320,37 +323,68 @@ var ApprovalFlow = class {
|
|
|
320
323
|
const chatType = cq.message?.chat.type;
|
|
321
324
|
const wrongIdentity = userId === void 0 || chatId !== request.expectedChatId || !request.expectedUserIds.has(userId) || messageId !== request.promptMessageId || chatType !== "private" && !request.allowGroup;
|
|
322
325
|
if (wrongIdentity) {
|
|
323
|
-
this.log.warn(
|
|
326
|
+
this.log.warn(
|
|
327
|
+
`Ignoring callback_query that does not match approval request ${request.requestId} in session ${request.sessionId}.`
|
|
328
|
+
);
|
|
324
329
|
await this.answerCallback(cq.id, "\u26D4 Not authorized for this approval", true);
|
|
325
330
|
return;
|
|
326
331
|
}
|
|
327
332
|
const approved = action[2] === "yes";
|
|
328
333
|
const fromUser = cq.from?.username ?? cq.from?.first_name ?? `user:${userId}`;
|
|
329
|
-
const resolved = this.settleApproval(requestId, "resolved", {
|
|
330
|
-
|
|
334
|
+
const resolved = this.settleApproval(requestId, "resolved", {
|
|
335
|
+
approved,
|
|
336
|
+
fromUser,
|
|
337
|
+
fromUserId: cq.from?.id
|
|
338
|
+
});
|
|
339
|
+
await this.answerCallback(
|
|
340
|
+
cq.id,
|
|
341
|
+
resolved ? approved ? "Approved \u2713" : "Denied \u2717" : "Approval request unavailable",
|
|
342
|
+
!resolved
|
|
343
|
+
);
|
|
331
344
|
}
|
|
332
345
|
async answerCallback(callbackQueryId, text, showAlert) {
|
|
333
346
|
try {
|
|
334
|
-
await this.api().answerCallbackQuery(callbackQueryId, text, showAlert, {
|
|
347
|
+
await this.api().answerCallbackQuery(callbackQueryId, text, showAlert, {
|
|
348
|
+
signal: AbortSignal.timeout(5e3)
|
|
349
|
+
});
|
|
335
350
|
} catch (err) {
|
|
336
351
|
this.log.debug(`answerCallbackQuery failed: ${err.message}`);
|
|
337
352
|
}
|
|
338
353
|
}
|
|
339
354
|
awaitApproval(input) {
|
|
340
|
-
if (input.expectedUserIds.length === 0)
|
|
341
|
-
|
|
355
|
+
if (input.expectedUserIds.length === 0)
|
|
356
|
+
throw new Error("Telegram approval requires at least one expected user ID.");
|
|
357
|
+
if (this.callbackWaiters.has(input.requestId))
|
|
358
|
+
throw new Error(`Telegram approval request ${input.requestId} is already pending.`);
|
|
342
359
|
return new Promise((resolve) => {
|
|
343
360
|
const delayMs = Math.max(0, input.expiresAt - Date.now());
|
|
344
361
|
const timer = setTimeout(() => {
|
|
345
362
|
this.settleApproval(input.requestId, "expired", { approved: false, fromUser: "timeout" });
|
|
346
363
|
}, delayMs);
|
|
347
|
-
const request = {
|
|
348
|
-
|
|
349
|
-
|
|
364
|
+
const request = {
|
|
365
|
+
requestId: input.requestId,
|
|
366
|
+
sessionId: input.sessionId,
|
|
367
|
+
expectedChatId: String(input.expectedChatId),
|
|
368
|
+
expectedUserIds: new Set(input.expectedUserIds.map(String)),
|
|
369
|
+
allowGroup: input.allowGroup,
|
|
370
|
+
pendingCallbacks: [],
|
|
371
|
+
expiresAt: input.expiresAt,
|
|
372
|
+
state: "pending",
|
|
373
|
+
resolve,
|
|
374
|
+
timer,
|
|
375
|
+
signal: input.signal
|
|
350
376
|
};
|
|
377
|
+
if (input.signal)
|
|
378
|
+
request.abortHandler = () => {
|
|
379
|
+
this.settleApproval(input.requestId, "cancelled", {
|
|
380
|
+
approved: false,
|
|
381
|
+
fromUser: "aborted"
|
|
382
|
+
});
|
|
383
|
+
};
|
|
351
384
|
this.callbackWaiters.set(input.requestId, request);
|
|
352
385
|
if (input.signal?.aborted) request.abortHandler?.();
|
|
353
|
-
else if (input.signal && request.abortHandler)
|
|
386
|
+
else if (input.signal && request.abortHandler)
|
|
387
|
+
input.signal.addEventListener("abort", request.abortHandler, { once: true });
|
|
354
388
|
});
|
|
355
389
|
}
|
|
356
390
|
bindApprovalPrompt(requestId, promptMessageId) {
|
|
@@ -358,14 +392,20 @@ var ApprovalFlow = class {
|
|
|
358
392
|
if (request?.state !== "pending" || request.promptMessageId !== void 0) return false;
|
|
359
393
|
request.promptMessageId = promptMessageId;
|
|
360
394
|
const pending = request.pendingCallbacks.splice(0);
|
|
361
|
-
for (const callback of pending)
|
|
395
|
+
for (const callback of pending)
|
|
396
|
+
void this.dispatchCallback(callback).catch(
|
|
397
|
+
(err) => this.log.debug(
|
|
398
|
+
`Callback dispatch failed: ${err instanceof Error ? err.message : String(err)}`
|
|
399
|
+
)
|
|
400
|
+
);
|
|
362
401
|
return true;
|
|
363
402
|
}
|
|
364
403
|
cancelApproval(requestId, fromUser = "cancelled") {
|
|
365
404
|
return this.settleApproval(requestId, "cancelled", { approved: false, fromUser });
|
|
366
405
|
}
|
|
367
406
|
cancelAll(fromUser) {
|
|
368
|
-
for (const requestId of Array.from(this.callbackWaiters.keys()))
|
|
407
|
+
for (const requestId of Array.from(this.callbackWaiters.keys()))
|
|
408
|
+
this.settleApproval(requestId, "cancelled", { approved: false, fromUser });
|
|
369
409
|
}
|
|
370
410
|
};
|
|
371
411
|
|
|
@@ -431,7 +471,9 @@ var TelegramInbox = class {
|
|
|
431
471
|
const userId = msg.from ? String(msg.from.id) : void 0;
|
|
432
472
|
const denialReason = this.denialReason(userId, chatId);
|
|
433
473
|
if (denialReason === "user") {
|
|
434
|
-
this.deps.log.debug(
|
|
474
|
+
this.deps.log.debug(
|
|
475
|
+
`Ignoring message from user ${userId ?? "unknown"} (not in allowedUsers)`
|
|
476
|
+
);
|
|
435
477
|
void this.deps.sendNotice(chatId, "\u26D4 You are not authorized to interact with this bot.").catch(
|
|
436
478
|
(err) => this.deps.log.debug(
|
|
437
479
|
`Failed to send denial notice: ${err instanceof Error ? err.message : String(err)}`
|
|
@@ -463,6 +505,8 @@ var Poller = class _Poller {
|
|
|
463
505
|
api;
|
|
464
506
|
pollIntervalMs;
|
|
465
507
|
log;
|
|
508
|
+
// Not readonly: start() swaps in a fresh controller when a previous stop()
|
|
509
|
+
// aborted this one (see start()).
|
|
466
510
|
controller;
|
|
467
511
|
offsetStore;
|
|
468
512
|
lock;
|
|
@@ -507,6 +551,7 @@ var Poller = class _Poller {
|
|
|
507
551
|
if (this.pollActive) return;
|
|
508
552
|
this.pollActive = true;
|
|
509
553
|
this._startedAt = Date.now();
|
|
554
|
+
if (this.controller.signal.aborted) this.controller = new AbortController();
|
|
510
555
|
this.acquireAndPoll();
|
|
511
556
|
}
|
|
512
557
|
stop() {
|
|
@@ -526,7 +571,9 @@ var Poller = class _Poller {
|
|
|
526
571
|
if (this.lock && !this.lock.tryAcquire()) {
|
|
527
572
|
if (!this.standbyAnnounced) {
|
|
528
573
|
this.standbyAnnounced = true;
|
|
529
|
-
this.log.info(
|
|
574
|
+
this.log.info(
|
|
575
|
+
"Telegram: another wstack instance is already polling this bot token \u2014 standing by; will take over when it stops."
|
|
576
|
+
);
|
|
530
577
|
}
|
|
531
578
|
this.standbyTimer = setTimeout(() => this.acquireAndPoll(), this.standbyRetryMs);
|
|
532
579
|
this.standbyTimer.unref?.();
|
|
@@ -544,7 +591,9 @@ var Poller = class _Poller {
|
|
|
544
591
|
clearTimeout(this.pollTimer);
|
|
545
592
|
this.pollTimer = null;
|
|
546
593
|
}
|
|
547
|
-
this.log.warn(
|
|
594
|
+
this.log.warn(
|
|
595
|
+
"Telegram: poll lock lost to another instance \u2014 pausing polling and standing by."
|
|
596
|
+
);
|
|
548
597
|
this.standbyAnnounced = true;
|
|
549
598
|
this.standbyTimer = setTimeout(() => this.acquireAndPoll(), this.standbyRetryMs);
|
|
550
599
|
this.standbyTimer.unref?.();
|
|
@@ -559,7 +608,12 @@ var Poller = class _Poller {
|
|
|
559
608
|
}
|
|
560
609
|
async poll() {
|
|
561
610
|
try {
|
|
562
|
-
const updates = await this.api().getUpdates({
|
|
611
|
+
const updates = await this.api().getUpdates({
|
|
612
|
+
offset: this.offset,
|
|
613
|
+
timeoutSeconds: 10,
|
|
614
|
+
deadlineMs: 15e3,
|
|
615
|
+
signal: this.controller.signal
|
|
616
|
+
});
|
|
563
617
|
this._conflictStreak = 0;
|
|
564
618
|
for (const upd of updates) {
|
|
565
619
|
if (upd.update_id < this.offset) continue;
|
|
@@ -575,18 +629,22 @@ var Poller = class _Poller {
|
|
|
575
629
|
}
|
|
576
630
|
try {
|
|
577
631
|
this.onMessageUpdate(raw);
|
|
578
|
-
this.offset = upd.update_id + 1;
|
|
579
632
|
} catch (err) {
|
|
580
|
-
this.log.debug(
|
|
581
|
-
|
|
633
|
+
this.log.debug(
|
|
634
|
+
`Telegram processMessage failed: ${err instanceof Error ? err.message : String(err)}`
|
|
635
|
+
);
|
|
582
636
|
}
|
|
637
|
+
this.offset = upd.update_id + 1;
|
|
583
638
|
}
|
|
584
639
|
if (this.offsetStore && updates.length > 0) void this.saveOffset();
|
|
585
640
|
} catch (err) {
|
|
586
641
|
if (err instanceof TelegramNetworkError && err.aborted) return;
|
|
587
642
|
if (err instanceof TelegramBotApiError && err.errorCode === 409) {
|
|
588
643
|
this._conflictStreak++;
|
|
589
|
-
if (this._conflictStreak === _Poller.CONFLICT_BACKOFF_AFTER)
|
|
644
|
+
if (this._conflictStreak === _Poller.CONFLICT_BACKOFF_AFTER)
|
|
645
|
+
this.log.warn(
|
|
646
|
+
this.lock ? "Telegram: another consumer outside this machine is polling this bot token (HTTP 409) \u2014 backing off to 60s polls. Check other machines/bots using this token, or a registered webhook (deleteWebhook)." : "Telegram: another instance is polling this bot token (HTTP 409) \u2014 backing off to 60s polls until it stops."
|
|
647
|
+
);
|
|
590
648
|
this.log.debug(`Telegram getUpdates failed: ${err.description}`);
|
|
591
649
|
return;
|
|
592
650
|
}
|
|
@@ -764,7 +822,11 @@ var TelegramBot = class {
|
|
|
764
822
|
onMessage: opts.onMessage,
|
|
765
823
|
sendNotice: (chatId, text) => this.sendMessage(chatId, text)
|
|
766
824
|
});
|
|
767
|
-
this.outbox = new TelegramOutbox({
|
|
825
|
+
this.outbox = new TelegramOutbox({
|
|
826
|
+
log: this.log,
|
|
827
|
+
api: () => this.api,
|
|
828
|
+
getParseMode: opts.getParseMode
|
|
829
|
+
});
|
|
768
830
|
this.approvals = new ApprovalFlow({
|
|
769
831
|
log: this.log,
|
|
770
832
|
api: () => this.api,
|
|
@@ -779,7 +841,11 @@ var TelegramBot = class {
|
|
|
779
841
|
lock: opts.lock,
|
|
780
842
|
standbyRetryMs: opts.standbyRetryMs ?? 15e3,
|
|
781
843
|
onCallbackQuery: (cq) => {
|
|
782
|
-
void this.approvals.dispatchCallback(cq).catch(
|
|
844
|
+
void this.approvals.dispatchCallback(cq).catch(
|
|
845
|
+
(err) => this.log.debug(
|
|
846
|
+
`Callback dispatch failed: ${err instanceof Error ? err.message : String(err)}`
|
|
847
|
+
)
|
|
848
|
+
);
|
|
783
849
|
},
|
|
784
850
|
onMessageUpdate: (msg) => this.processMessage({ ...msg, text: msg.text })
|
|
785
851
|
});
|
|
@@ -879,7 +945,10 @@ var TELEGRAM_CONFIG_FIELDS = {
|
|
|
879
945
|
outboundQueueConcurrency: { lifecycle: "restart" },
|
|
880
946
|
rateLimitTokensPerSecond: { lifecycle: "hot", description: "Per-chat rate limit (tokens/sec)" },
|
|
881
947
|
rateLimitBurst: { lifecycle: "hot", description: "Per-chat rate limit burst size" },
|
|
882
|
-
parseMode: {
|
|
948
|
+
parseMode: {
|
|
949
|
+
lifecycle: "hot",
|
|
950
|
+
description: "Telegram parse mode: HTML, MarkdownV2, or empty for plain text"
|
|
951
|
+
}
|
|
883
952
|
};
|
|
884
953
|
var telegramConfigSchema = {
|
|
885
954
|
type: "object",
|
|
@@ -1083,11 +1152,7 @@ function formatDelegateCompleted(e) {
|
|
|
1083
1152
|
const task = e.task.length > 160 ? `${e.task.slice(0, 159)}\u2026` : e.task;
|
|
1084
1153
|
const rawBody = e.summary?.trim() || `(no summary) \u2014 ${task}`;
|
|
1085
1154
|
const body = redactSecrets(rawBody);
|
|
1086
|
-
const stats = [
|
|
1087
|
-
`\u23F1 ${fmtDuration(e.durationMs)}`,
|
|
1088
|
-
`${e.iterations} iter`,
|
|
1089
|
-
`${e.toolCalls} tools`
|
|
1090
|
-
];
|
|
1155
|
+
const stats = [`\u23F1 ${fmtDuration(e.durationMs)}`, `${e.iterations} iter`, `${e.toolCalls} tools`];
|
|
1091
1156
|
if (typeof e.costUsd === "number" && e.costUsd > 0) {
|
|
1092
1157
|
stats.push(`\u{1F4B2}${e.costUsd.toFixed(4)}`);
|
|
1093
1158
|
}
|
|
@@ -1565,10 +1630,15 @@ _Reply by tapping a button. Auto-denies in ${Math.round(timeoutMs / 1e3)}s._`;
|
|
|
1565
1630
|
});
|
|
1566
1631
|
let promptMessageId;
|
|
1567
1632
|
try {
|
|
1568
|
-
const sent = await opts.bot.sendMessageWithKeyboard(
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1633
|
+
const sent = await opts.bot.sendMessageWithKeyboard(
|
|
1634
|
+
chatId,
|
|
1635
|
+
text,
|
|
1636
|
+
[
|
|
1637
|
+
{ text: "\u2705 Approve", callback_data: yesKey },
|
|
1638
|
+
{ text: "\u274C Deny", callback_data: noKey }
|
|
1639
|
+
],
|
|
1640
|
+
toolOpts?.signal
|
|
1641
|
+
);
|
|
1572
1642
|
promptMessageId = sent.result?.message_id;
|
|
1573
1643
|
if (promptMessageId === void 0) {
|
|
1574
1644
|
throw new Error("Telegram approval prompt response did not include a message ID.");
|
|
@@ -1959,7 +2029,9 @@ var TelegramNotificationChannel = class {
|
|
|
1959
2029
|
return { ok: true, channel: this.name, deliveredAt };
|
|
1960
2030
|
}
|
|
1961
2031
|
const res = await this.#bot.sendMessage(this.#chatId, truncated);
|
|
1962
|
-
this.#log?.debug?.(
|
|
2032
|
+
this.#log?.debug?.(
|
|
2033
|
+
`telegram notification delivered (${truncated.length} chars, ok=${res.ok})`
|
|
2034
|
+
);
|
|
1963
2035
|
return {
|
|
1964
2036
|
ok: res.ok,
|
|
1965
2037
|
channel: this.name,
|
|
@@ -2348,7 +2420,8 @@ var plugin = {
|
|
|
2348
2420
|
level: "info",
|
|
2349
2421
|
source: "session.end"
|
|
2350
2422
|
}).then((r) => {
|
|
2351
|
-
if (!r.ok)
|
|
2423
|
+
if (!r.ok)
|
|
2424
|
+
log.warn(`session.ended notification delivery failed: ${r.error ?? "unknown"}`);
|
|
2352
2425
|
}).catch((err) => {
|
|
2353
2426
|
log.debug(`session.ended notification delivery threw: ${err.message}`);
|
|
2354
2427
|
});
|
|
@@ -2356,7 +2429,8 @@ var plugin = {
|
|
|
2356
2429
|
);
|
|
2357
2430
|
cleanups.push(
|
|
2358
2431
|
api.events.on("tool.executed", (event) => {
|
|
2359
|
-
if (!runtimeCfg.notifyChatId || !notifyChannel || runtimeCfg.longToolThresholdMs <= 0)
|
|
2432
|
+
if (!runtimeCfg.notifyChatId || !notifyChannel || runtimeCfg.longToolThresholdMs <= 0)
|
|
2433
|
+
return;
|
|
2360
2434
|
if (event.durationMs < runtimeCfg.longToolThresholdMs) return;
|
|
2361
2435
|
const payload = {
|
|
2362
2436
|
name: event.name,
|
|
@@ -2370,7 +2444,8 @@ var plugin = {
|
|
|
2370
2444
|
level: event.ok ? "info" : "warning",
|
|
2371
2445
|
source: "tool.exec"
|
|
2372
2446
|
}).then((r) => {
|
|
2373
|
-
if (!r.ok)
|
|
2447
|
+
if (!r.ok)
|
|
2448
|
+
log.warn(`tool.executed notification delivery failed: ${r.error ?? "unknown"}`);
|
|
2374
2449
|
}).catch((err) => {
|
|
2375
2450
|
log.debug(`tool.executed notification delivery threw: ${err.message}`);
|
|
2376
2451
|
});
|
|
@@ -2392,9 +2467,14 @@ var plugin = {
|
|
|
2392
2467
|
level: event.ok ? "info" : "warning",
|
|
2393
2468
|
source: "delegate.completed"
|
|
2394
2469
|
}).then((r) => {
|
|
2395
|
-
if (!r.ok)
|
|
2470
|
+
if (!r.ok)
|
|
2471
|
+
log.warn(
|
|
2472
|
+
`delegate.completed notification delivery failed: ${r.error ?? "unknown"}`
|
|
2473
|
+
);
|
|
2396
2474
|
}).catch((err) => {
|
|
2397
|
-
log.debug(
|
|
2475
|
+
log.debug(
|
|
2476
|
+
`delegate.completed notification delivery threw: ${err.message}`
|
|
2477
|
+
);
|
|
2398
2478
|
});
|
|
2399
2479
|
})
|
|
2400
2480
|
);
|
|
@@ -2407,36 +2487,66 @@ var plugin = {
|
|
|
2407
2487
|
const fresh = telegramFromConfig(next);
|
|
2408
2488
|
const hotSet = new Set(hotKeys);
|
|
2409
2489
|
const HOT_APPLIERS = /* @__PURE__ */ new Map([
|
|
2410
|
-
[
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
[
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
[
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
[
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
[
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2490
|
+
[
|
|
2491
|
+
"allowedOutboundChats",
|
|
2492
|
+
(r, f) => {
|
|
2493
|
+
r.allowedOutboundChats = f.allowedOutboundChats;
|
|
2494
|
+
}
|
|
2495
|
+
],
|
|
2496
|
+
[
|
|
2497
|
+
"allowedUsers",
|
|
2498
|
+
(r, f) => {
|
|
2499
|
+
r.allowedUserIds = f.allowedUserIds;
|
|
2500
|
+
}
|
|
2501
|
+
],
|
|
2502
|
+
[
|
|
2503
|
+
"notifyOnSessionEnd",
|
|
2504
|
+
(r, f) => {
|
|
2505
|
+
r.notifyOnSessionEnd = f.notifyOnSessionEnd;
|
|
2506
|
+
}
|
|
2507
|
+
],
|
|
2508
|
+
[
|
|
2509
|
+
"notifyOnDelegate",
|
|
2510
|
+
(r, f) => {
|
|
2511
|
+
r.notifyOnDelegate = f.notifyOnDelegate;
|
|
2512
|
+
}
|
|
2513
|
+
],
|
|
2514
|
+
[
|
|
2515
|
+
"longToolThresholdMs",
|
|
2516
|
+
(r, f) => {
|
|
2517
|
+
r.longToolThresholdMs = f.longToolThresholdMs;
|
|
2518
|
+
}
|
|
2519
|
+
],
|
|
2520
|
+
[
|
|
2521
|
+
"maxMessageLength",
|
|
2522
|
+
(r, f) => {
|
|
2523
|
+
r.maxMessageLength = f.maxMessageLength;
|
|
2524
|
+
}
|
|
2525
|
+
],
|
|
2526
|
+
[
|
|
2527
|
+
"allowGroupApprovals",
|
|
2528
|
+
(r, f) => {
|
|
2529
|
+
r.allowGroupApprovals = f.allowGroupApprovals;
|
|
2530
|
+
}
|
|
2531
|
+
],
|
|
2532
|
+
[
|
|
2533
|
+
"rateLimitTokensPerSecond",
|
|
2534
|
+
(r, f) => {
|
|
2535
|
+
r.rateLimitTokensPerSecond = f.rateLimitTokensPerSecond;
|
|
2536
|
+
}
|
|
2537
|
+
],
|
|
2538
|
+
[
|
|
2539
|
+
"rateLimitBurst",
|
|
2540
|
+
(r, f) => {
|
|
2541
|
+
r.rateLimitBurst = f.rateLimitBurst;
|
|
2542
|
+
}
|
|
2543
|
+
],
|
|
2544
|
+
[
|
|
2545
|
+
"parseMode",
|
|
2546
|
+
(r, f) => {
|
|
2547
|
+
r.parseMode = f.parseMode;
|
|
2548
|
+
}
|
|
2549
|
+
]
|
|
2440
2550
|
]);
|
|
2441
2551
|
for (const [key, apply] of HOT_APPLIERS) {
|
|
2442
2552
|
if (hotSet.has(key)) apply(runtimeCfg, fresh);
|
package/dist/poller.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/telegram",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.320.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "WrongStack plugin — Telegram bridge: send messages, receive prompts, get notified.",
|
|
6
6
|
"repository": {
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"!dist/**/*.map"
|
|
27
27
|
],
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@wrongstack/core": "0.
|
|
29
|
+
"@wrongstack/core": "0.320.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "^26.2.0",
|
|
33
|
-
"@wrongstack/core": "0.
|
|
33
|
+
"@wrongstack/core": "0.320.1",
|
|
34
34
|
"typescript": "^7.0.2"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|