switchroom 0.17.0 → 0.17.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.
@@ -66,7 +66,7 @@ var __export = (target, all) => {
66
66
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
67
67
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
68
68
 
69
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/filter.js
69
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/filter.js
70
70
  var require_filter = __commonJS((exports) => {
71
71
  Object.defineProperty(exports, "__esModule", { value: true });
72
72
  exports.matchFilter = matchFilter;
@@ -273,14 +273,11 @@ var require_filter = __commonJS((exports) => {
273
273
  forward_origin: FORWARD_ORIGIN_KEYS,
274
274
  is_topic_message: {},
275
275
  is_automatic_forward: {},
276
- guest_query_id: {},
277
276
  business_connection_id: {},
278
277
  text: {},
279
- rich_message: {},
280
278
  animation: {},
281
279
  audio: {},
282
280
  document: {},
283
- live_photo: {},
284
281
  paid_media: {},
285
282
  photo: {},
286
283
  sticker: STICKER_KEYS,
@@ -395,7 +392,6 @@ var require_filter = __commonJS((exports) => {
395
392
  business_message: MESSAGE_KEYS,
396
393
  edited_business_message: MESSAGE_KEYS,
397
394
  deleted_business_messages: {},
398
- guest_message: MESSAGE_KEYS,
399
395
  inline_query: {},
400
396
  chosen_inline_result: {},
401
397
  callback_query: CALLBACK_QUERY_KEYS,
@@ -420,10 +416,9 @@ var require_filter = __commonJS((exports) => {
420
416
  };
421
417
  var L2_SHORTCUTS = {
422
418
  "": ["entities", "caption_entities"],
423
- media: ["photo", "live_photo", "video"],
419
+ media: ["photo", "video"],
424
420
  file: [
425
421
  "photo",
426
- "live_photo",
427
422
  "animation",
428
423
  "audio",
429
424
  "document",
@@ -435,7 +430,7 @@ var require_filter = __commonJS((exports) => {
435
430
  };
436
431
  });
437
432
 
438
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/context.js
433
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/context.js
439
434
  var require_context = __commonJS((exports) => {
440
435
  Object.defineProperty(exports, "__esModule", { value: true });
441
436
  exports.Context = undefined;
@@ -625,9 +620,6 @@ var require_context = __commonJS((exports) => {
625
620
  get deletedBusinessMessages() {
626
621
  return this.update.deleted_business_messages;
627
622
  }
628
- get guestMessage() {
629
- return this.update.guest_message;
630
- }
631
623
  get messageReaction() {
632
624
  return this.update.message_reaction;
633
625
  }
@@ -677,8 +669,8 @@ var require_context = __commonJS((exports) => {
677
669
  return this.update.purchased_paid_media;
678
670
  }
679
671
  get msg() {
680
- var _a, _b, _c, _d, _e, _f, _g, _h;
681
- return (_g = (_f = (_e = (_d = (_c = (_b = (_a = this.message) !== null && _a !== undefined ? _a : this.editedMessage) !== null && _b !== undefined ? _b : this.channelPost) !== null && _c !== undefined ? _c : this.editedChannelPost) !== null && _d !== undefined ? _d : this.businessMessage) !== null && _e !== undefined ? _e : this.editedBusinessMessage) !== null && _f !== undefined ? _f : this.guestMessage) !== null && _g !== undefined ? _g : (_h = this.callbackQuery) === null || _h === undefined ? undefined : _h.message;
672
+ var _a, _b, _c, _d, _e, _f, _g;
673
+ return (_f = (_e = (_d = (_c = (_b = (_a = this.message) !== null && _a !== undefined ? _a : this.editedMessage) !== null && _b !== undefined ? _b : this.channelPost) !== null && _c !== undefined ? _c : this.editedChannelPost) !== null && _d !== undefined ? _d : this.businessMessage) !== null && _e !== undefined ? _e : this.editedBusinessMessage) !== null && _f !== undefined ? _f : (_g = this.callbackQuery) === null || _g === undefined ? undefined : _g.message;
682
674
  }
683
675
  get chat() {
684
676
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
@@ -689,8 +681,8 @@ var require_context = __commonJS((exports) => {
689
681
  return (_a = this.msg) === null || _a === undefined ? undefined : _a.sender_chat;
690
682
  }
691
683
  get from() {
692
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
693
- return (_h = (_g = (_c = (_b = (_a = this.businessConnection) !== null && _a !== undefined ? _a : this.messageReaction) !== null && _b !== undefined ? _b : this.managedBot) !== null && _c !== undefined ? _c : (_f = (_e = (_d = this.chatBoost) === null || _d === undefined ? undefined : _d.boost) !== null && _e !== undefined ? _e : this.removedChatBoost) === null || _f === undefined ? undefined : _f.source) === null || _g === undefined ? undefined : _g.user) !== null && _h !== undefined ? _h : (_t = (_s = (_r = (_q = (_p = (_o = (_m = (_l = (_k = (_j = this.callbackQuery) !== null && _j !== undefined ? _j : this.msg) !== null && _k !== undefined ? _k : this.inlineQuery) !== null && _l !== undefined ? _l : this.chosenInlineResult) !== null && _m !== undefined ? _m : this.shippingQuery) !== null && _o !== undefined ? _o : this.preCheckoutQuery) !== null && _p !== undefined ? _p : this.myChatMember) !== null && _q !== undefined ? _q : this.chatMember) !== null && _r !== undefined ? _r : this.chatJoinRequest) !== null && _s !== undefined ? _s : this.purchasedPaidMedia) === null || _t === undefined ? undefined : _t.from;
684
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
685
+ return (_g = (_f = (_b = (_a = this.businessConnection) !== null && _a !== undefined ? _a : this.messageReaction) !== null && _b !== undefined ? _b : (_e = (_d = (_c = this.chatBoost) === null || _c === undefined ? undefined : _c.boost) !== null && _d !== undefined ? _d : this.removedChatBoost) === null || _e === undefined ? undefined : _e.source) === null || _f === undefined ? undefined : _f.user) !== null && _g !== undefined ? _g : (_s = (_r = (_q = (_p = (_o = (_m = (_l = (_k = (_j = (_h = this.callbackQuery) !== null && _h !== undefined ? _h : this.msg) !== null && _j !== undefined ? _j : this.inlineQuery) !== null && _k !== undefined ? _k : this.chosenInlineResult) !== null && _l !== undefined ? _l : this.shippingQuery) !== null && _m !== undefined ? _m : this.preCheckoutQuery) !== null && _o !== undefined ? _o : this.myChatMember) !== null && _p !== undefined ? _p : this.chatMember) !== null && _q !== undefined ? _q : this.chatJoinRequest) !== null && _r !== undefined ? _r : this.purchasedPaidMedia) === null || _s === undefined ? undefined : _s.from;
694
686
  }
695
687
  get msgId() {
696
688
  var _a, _b, _c, _d, _e;
@@ -849,13 +841,10 @@ var require_context = __commonJS((exports) => {
849
841
  ...other
850
842
  }, signal);
851
843
  }
852
- replyWithRichMessage(rich_message, other, signal) {
853
- var _a;
844
+ replyWithDraft(text, other, signal) {
854
845
  const msg = this.msg;
855
- return this.api.sendRichMessage(orThrow(this.chatId, "sendRichMessage"), rich_message, {
856
- business_connection_id: this.businessConnectionId,
857
- ...(msg === null || msg === undefined ? undefined : msg.is_topic_message) ? { message_thread_id: msg.message_thread_id } : {},
858
- direct_messages_topic_id: (_a = msg === null || msg === undefined ? undefined : msg.direct_messages_topic) === null || _a === undefined ? undefined : _a.topic_id,
846
+ return this.api.sendMessageDraft(orThrow(this.chatId, "sendMessageDraft"), this.update.update_id, text, {
847
+ ...(msg === null || msg === undefined ? undefined : msg.is_topic_message) ? { message_thread_id: msg === null || msg === undefined ? undefined : msg.message_thread_id } : {},
859
848
  ...other
860
849
  }, signal);
861
850
  }
@@ -901,16 +890,6 @@ var require_context = __commonJS((exports) => {
901
890
  ...other
902
891
  }, signal);
903
892
  }
904
- replyWithLivePhoto(live_photo, photo, other, signal) {
905
- var _a;
906
- const msg = this.msg;
907
- return this.api.sendLivePhoto(orThrow(this.chatId, "sendLivePhoto"), live_photo, photo, {
908
- business_connection_id: this.businessConnectionId,
909
- ...(msg === null || msg === undefined ? undefined : msg.is_topic_message) ? { message_thread_id: msg.message_thread_id } : {},
910
- direct_messages_topic_id: (_a = msg === null || msg === undefined ? undefined : msg.direct_messages_topic) === null || _a === undefined ? undefined : _a.topic_id,
911
- ...other
912
- }, signal);
913
- }
914
893
  replyWithAudio(audio, other, signal) {
915
894
  var _a;
916
895
  const msg = this.msg;
@@ -971,19 +950,6 @@ var require_context = __commonJS((exports) => {
971
950
  ...other
972
951
  }, signal);
973
952
  }
974
- sendPaidMedia(...args) {
975
- return this.replyWithPaidMedia(...args);
976
- }
977
- replyWithPaidMedia(star_count, media, other, signal) {
978
- var _a, _b;
979
- const msg = this.msg;
980
- return this.api.sendPaidMedia(orThrow(this.chatId, "sendPaidMedia"), star_count, media, {
981
- business_connection_id: this.businessConnectionId,
982
- ...(msg === null || msg === undefined ? undefined : msg.is_topic_message) ? { message_thread_id: msg.message_thread_id } : {},
983
- direct_messages_topic_id: (_b = (_a = this.msg) === null || _a === undefined ? undefined : _a.direct_messages_topic) === null || _b === undefined ? undefined : _b.topic_id,
984
- ...other
985
- }, signal);
986
- }
987
953
  replyWithMediaGroup(media, other, signal) {
988
954
  var _a;
989
955
  const msg = this.msg;
@@ -1012,6 +978,16 @@ var require_context = __commonJS((exports) => {
1012
978
  const inlineId = this.inlineMessageId;
1013
979
  return inlineId !== undefined ? this.api.stopMessageLiveLocationInline(inlineId, { business_connection_id: this.businessConnectionId, ...other }, signal) : this.api.stopMessageLiveLocation(orThrow(this.chatId, "stopMessageLiveLocation"), orThrow(this.msgId, "stopMessageLiveLocation"), { business_connection_id: this.businessConnectionId, ...other }, signal);
1014
980
  }
981
+ sendPaidMedia(star_count, media, other, signal) {
982
+ var _a, _b;
983
+ const msg = this.msg;
984
+ return this.api.sendPaidMedia(orThrow(this.chatId, "sendPaidMedia"), star_count, media, {
985
+ business_connection_id: this.businessConnectionId,
986
+ ...(msg === null || msg === undefined ? undefined : msg.is_topic_message) ? { message_thread_id: msg.message_thread_id } : {},
987
+ direct_messages_topic_id: (_b = (_a = this.msg) === null || _a === undefined ? undefined : _a.direct_messages_topic) === null || _b === undefined ? undefined : _b.topic_id,
988
+ ...other
989
+ }, signal);
990
+ }
1015
991
  replyWithVenue(latitude, longitude, title, address, other, signal) {
1016
992
  var _a;
1017
993
  const msg = this.msg;
@@ -1070,20 +1046,6 @@ var require_context = __commonJS((exports) => {
1070
1046
  react(reaction, other, signal) {
1071
1047
  return this.api.setMessageReaction(orThrow(this.chatId, "setMessageReaction"), orThrow(this.msgId, "setMessageReaction"), typeof reaction === "string" ? [{ type: "emoji", emoji: reaction }] : (Array.isArray(reaction) ? reaction : [reaction]).map((emoji) => typeof emoji === "string" ? { type: "emoji", emoji } : emoji), other, signal);
1072
1048
  }
1073
- replyWithDraft(text, other, signal) {
1074
- const msg = this.msg;
1075
- return this.api.sendMessageDraft(orThrow(this.chatId, "sendMessageDraft"), this.update.update_id, text, {
1076
- ...(msg === null || msg === undefined ? undefined : msg.is_topic_message) ? { message_thread_id: msg.message_thread_id } : {},
1077
- ...other
1078
- }, signal);
1079
- }
1080
- replyWithRichMessageDraft(rich_message, other, signal) {
1081
- const msg = this.msg;
1082
- return this.api.sendRichMessageDraft(orThrow(this.chatId, "sendMessageDraft"), this.update.update_id, rich_message, {
1083
- ...(msg === null || msg === undefined ? undefined : msg.is_topic_message) ? { message_thread_id: msg.message_thread_id } : {},
1084
- ...other
1085
- }, signal);
1086
- }
1087
1049
  getUserProfilePhotos(other, signal) {
1088
1050
  return this.api.getUserProfilePhotos(orThrow(this.from, "getUserProfilePhotos").id, other, signal);
1089
1051
  }
@@ -1105,18 +1067,6 @@ var require_context = __commonJS((exports) => {
1105
1067
  getBusinessConnection(signal) {
1106
1068
  return this.api.getBusinessConnection(orThrow(this.businessConnectionId, "getBusinessConnection"), signal);
1107
1069
  }
1108
- getManagedBotToken(signal) {
1109
- return this.api.getManagedBotToken(orThrow(this.managedBot, "getManagedBotToken").bot.id, signal);
1110
- }
1111
- replaceManagedBotToken(signal) {
1112
- return this.api.replaceManagedBotToken(orThrow(this.managedBot, "getManagedBotToken").bot.id, signal);
1113
- }
1114
- getManagedBotAccessSettings(signal) {
1115
- return this.api.getManagedBotAccessSettings(orThrow(this.managedBot, "getManagedBotAccessSettings").bot.id, signal);
1116
- }
1117
- setManagedBotAccessSettings(is_access_restricted, other, signal) {
1118
- return this.api.setManagedBotAccessSettings(orThrow(this.managedBot, "setManagedBotAccessSettings").bot.id, is_access_restricted, other, signal);
1119
- }
1120
1070
  getFile(signal) {
1121
1071
  var _a, _b, _c, _d, _e, _f;
1122
1072
  const m = orThrow(this.msg, "getFile");
@@ -1189,20 +1139,18 @@ var require_context = __commonJS((exports) => {
1189
1139
  revokeChatInviteLink(invite_link, signal) {
1190
1140
  return this.api.revokeChatInviteLink(orThrow(this.chatId, "editChatInviteLink"), invite_link, signal);
1191
1141
  }
1142
+ getManagedBotToken(signal) {
1143
+ return this.api.getManagedBotToken(orThrow(this.managedBot, "getManagedBotToken").bot.id, signal);
1144
+ }
1145
+ replaceManagedBotToken(signal) {
1146
+ return this.api.replaceManagedBotToken(orThrow(this.managedBot, "getManagedBotToken").bot.id, signal);
1147
+ }
1192
1148
  approveChatJoinRequest(user_id, signal) {
1193
1149
  return this.api.approveChatJoinRequest(orThrow(this.chatId, "approveChatJoinRequest"), user_id, signal);
1194
1150
  }
1195
1151
  declineChatJoinRequest(user_id, signal) {
1196
1152
  return this.api.declineChatJoinRequest(orThrow(this.chatId, "declineChatJoinRequest"), user_id, signal);
1197
1153
  }
1198
- answerChatJoinRequestQuery(result, signal) {
1199
- var _a;
1200
- return this.api.answerChatJoinRequestQuery(orThrow((_a = this.chatJoinRequest) === null || _a === undefined ? undefined : _a.query_id, "answerChatJoinRequestQuery"), result, signal);
1201
- }
1202
- replyWithChatJoinRequestWebApp(web_app_url, signal) {
1203
- var _a;
1204
- return this.api.sendChatJoinRequestWebApp(orThrow((_a = this.chatJoinRequest) === null || _a === undefined ? undefined : _a.query_id, "answerChatJoinRequestQuery"), web_app_url, signal);
1205
- }
1206
1154
  approveSuggestedPost(other, signal) {
1207
1155
  return this.api.approveSuggestedPost(orThrow(this.chatId, "approveSuggestedPost"), orThrow(this.msgId, "approveSuggestedPost"), other, signal);
1208
1156
  }
@@ -1236,8 +1184,8 @@ var require_context = __commonJS((exports) => {
1236
1184
  getChat(signal) {
1237
1185
  return this.api.getChat(orThrow(this.chatId, "getChat"), signal);
1238
1186
  }
1239
- getChatAdministrators(other, signal) {
1240
- return this.api.getChatAdministrators(orThrow(this.chatId, "getChatAdministrators"), other, signal);
1187
+ getChatAdministrators(signal) {
1188
+ return this.api.getChatAdministrators(orThrow(this.chatId, "getChatAdministrators"), signal);
1241
1189
  }
1242
1190
  getChatMembersCount(...args) {
1243
1191
  return this.getChatMemberCount(...args);
@@ -1251,9 +1199,6 @@ var require_context = __commonJS((exports) => {
1251
1199
  getChatMember(user_id, signal) {
1252
1200
  return this.api.getChatMember(orThrow(this.chatId, "getChatMember"), user_id, signal);
1253
1201
  }
1254
- getUserPersonalChatMessages(limit, signal) {
1255
- return this.api.getUserPersonalChatMessages(orThrow(this.from, "getUserPersonalChatMessages").id, limit, signal);
1256
- }
1257
1202
  setChatStickerSet(sticker_set_name, signal) {
1258
1203
  return this.api.setChatStickerSet(orThrow(this.chatId, "setChatStickerSet"), sticker_set_name, signal);
1259
1204
  }
@@ -1309,10 +1254,6 @@ var require_context = __commonJS((exports) => {
1309
1254
  answerCallbackQuery(other, signal) {
1310
1255
  return this.api.answerCallbackQuery(orThrow(this.callbackQuery, "answerCallbackQuery").id, typeof other === "string" ? { text: other } : other, signal);
1311
1256
  }
1312
- answerGuestQuery(result, signal) {
1313
- var _a;
1314
- return this.api.answerGuestQuery(orThrow((_a = this.guestMessage) === null || _a === undefined ? undefined : _a.guest_query_id, "answerGuestQuery"), result, signal);
1315
- }
1316
1257
  setChatMenuButton(other, signal) {
1317
1258
  return this.api.setChatMenuButton(other, signal);
1318
1259
  }
@@ -1356,38 +1297,6 @@ var require_context = __commonJS((exports) => {
1356
1297
  deleteMessages(message_ids, signal) {
1357
1298
  return this.api.deleteMessages(orThrow(this.chatId, "deleteMessages"), message_ids, signal);
1358
1299
  }
1359
- deleteMessageReaction(other, signal) {
1360
- const reaction = orThrow(this.messageReaction, "deleteMessageReaction");
1361
- if (reaction.user !== undefined) {
1362
- return this.deleteMessageReactionUser(reaction.user.id, other, signal);
1363
- } else if (reaction.actor_chat !== undefined) {
1364
- return this.deleteMessageReactionChat(reaction.actor_chat.id, other, signal);
1365
- } else {
1366
- throw new Error("Missing information from message_reaction update for API call to deleteMessageReaction");
1367
- }
1368
- }
1369
- deleteMessageReactionUser(user_id, other, signal) {
1370
- return this.api.deleteMessageReactionUser(orThrow(this.chatId, "deleteMessageReactionUser"), orThrow(this.msgId, "deleteMessageReactionUser"), user_id, other, signal);
1371
- }
1372
- deleteMessageReactionChat(actor_chat_id, other, signal) {
1373
- return this.api.deleteMessageReactionChat(orThrow(this.chatId, "deleteMessageReactionChat"), orThrow(this.msgId, "deleteMessageReactionChat"), actor_chat_id, other, signal);
1374
- }
1375
- deleteAllMessageReactions(other, signal) {
1376
- var _a, _b, _c, _d;
1377
- const chatId = orThrow(this.chatId, "deleteAllMessageReactions");
1378
- const actor = (_c = (_b = (_a = this.messageReaction) === null || _a === undefined ? undefined : _a.actor_chat) !== null && _b !== undefined ? _b : this.senderChat) !== null && _c !== undefined ? _c : (_d = this.pollAnswer) === null || _d === undefined ? undefined : _d.voter_chat;
1379
- if (actor !== undefined) {
1380
- return this.api.deleteAllMessageReactionsChat(chatId, actor.id, other, signal);
1381
- }
1382
- const userId = orThrow(this.from, "deleteAllMessageReactions").id;
1383
- return this.api.deleteAllMessageReactionsUser(chatId, userId, other, signal);
1384
- }
1385
- deleteAllMessageReactionsUser(user_id, other, signal) {
1386
- return this.api.deleteAllMessageReactionsUser(orThrow(this.chatId, "deleteAllMessageReactionsUser"), user_id, other, signal);
1387
- }
1388
- deleteAllMessageReactionsChat(actor_chat_id, other, signal) {
1389
- return this.api.deleteAllMessageReactionsChat(orThrow(this.chatId, "deleteAllMessageReactionsChat"), actor_chat_id, other, signal);
1390
- }
1391
1300
  deleteBusinessMessages(message_ids, signal) {
1392
1301
  return this.api.deleteBusinessMessages(orThrow(this.businessConnectionId, "deleteBusinessMessages"), message_ids, signal);
1393
1302
  }
@@ -1548,7 +1457,7 @@ var require_context = __commonJS((exports) => {
1548
1457
  }
1549
1458
  });
1550
1459
 
1551
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/composer.js
1460
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/composer.js
1552
1461
  var require_composer = __commonJS((exports) => {
1553
1462
  Object.defineProperty(exports, "__esModule", { value: true });
1554
1463
  exports.Composer = exports.BotError = undefined;
@@ -2444,7 +2353,7 @@ var require_src = __commonJS((exports, module) => {
2444
2353
  }
2445
2354
  });
2446
2355
 
2447
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/platform.node.js
2356
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/platform.node.js
2448
2357
  var require_platform_node = __commonJS((exports) => {
2449
2358
  Object.defineProperty(exports, "__esModule", { value: true });
2450
2359
  exports.defaultAdapter = exports.itrToStream = exports.debug = undefined;
@@ -2484,7 +2393,7 @@ var require_platform_node = __commonJS((exports) => {
2484
2393
  exports.defaultAdapter = "express";
2485
2394
  });
2486
2395
 
2487
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/core/error.js
2396
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/core/error.js
2488
2397
  var require_error = __commonJS((exports) => {
2489
2398
  Object.defineProperty(exports, "__esModule", { value: true });
2490
2399
  exports.HttpError = exports.GrammyError = undefined;
@@ -2540,10 +2449,10 @@ var require_error = __commonJS((exports) => {
2540
2449
  }
2541
2450
  });
2542
2451
 
2543
- // ../node_modules/.bun/@grammyjs+types@3.28.0/node_modules/@grammyjs/types/mod.js
2452
+ // ../node_modules/.bun/@grammyjs+types@3.26.0/node_modules/@grammyjs/types/mod.js
2544
2453
  var exports_mod = {};
2545
2454
 
2546
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/types.node.js
2455
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/types.node.js
2547
2456
  var require_types_node = __commonJS((exports) => {
2548
2457
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
2549
2458
  if (k2 === undefined)
@@ -2634,7 +2543,7 @@ var require_types_node = __commonJS((exports) => {
2634
2543
  }
2635
2544
  });
2636
2545
 
2637
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/types.js
2546
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/types.js
2638
2547
  var require_types = __commonJS((exports) => {
2639
2548
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
2640
2549
  if (k2 === undefined)
@@ -2660,7 +2569,7 @@ var require_types = __commonJS((exports) => {
2660
2569
  __exportStar(require_types_node(), exports);
2661
2570
  });
2662
2571
 
2663
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/core/payload.js
2572
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/core/payload.js
2664
2573
  var require_payload = __commonJS((exports) => {
2665
2574
  Object.defineProperty(exports, "__esModule", { value: true });
2666
2575
  exports.requiresFormDataUpload = requiresFormDataUpload;
@@ -3320,7 +3229,7 @@ var require_abort_controller = __commonJS((exports, module) => {
3320
3229
  module.exports.AbortSignal = AbortSignal2;
3321
3230
  });
3322
3231
 
3323
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/shim.node.js
3232
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/shim.node.js
3324
3233
  var require_shim_node = __commonJS((exports) => {
3325
3234
  Object.defineProperty(exports, "__esModule", { value: true });
3326
3235
  exports.fetch = exports.AbortController = undefined;
@@ -3334,7 +3243,7 @@ var require_shim_node = __commonJS((exports) => {
3334
3243
  } });
3335
3244
  });
3336
3245
 
3337
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/core/client.js
3246
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/core/client.js
3338
3247
  var require_client = __commonJS((exports) => {
3339
3248
  Object.defineProperty(exports, "__esModule", { value: true });
3340
3249
  exports.createRawApi = createRawApi;
@@ -3514,7 +3423,7 @@ If you want to prevent such mistakes in the future, consider using TypeScript. h
3514
3423
  var shim_node_js_1 = require_shim_node();
3515
3424
  });
3516
3425
 
3517
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/core/api.js
3426
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/core/api.js
3518
3427
  var require_api = __commonJS((exports) => {
3519
3428
  Object.defineProperty(exports, "__esModule", { value: true });
3520
3429
  exports.Api = undefined;
@@ -3555,8 +3464,8 @@ var require_api = __commonJS((exports) => {
3555
3464
  sendMessage(chat_id, text, other, signal) {
3556
3465
  return this.raw.sendMessage({ chat_id, text, ...other }, signal);
3557
3466
  }
3558
- sendRichMessage(chat_id, rich_message, other, signal) {
3559
- return this.raw.sendRichMessage({ chat_id, rich_message, ...other }, signal);
3467
+ sendMessageDraft(chat_id, draft_id, text, other, signal) {
3468
+ return this.raw.sendMessageDraft({ chat_id, draft_id, text, ...other }, signal);
3560
3469
  }
3561
3470
  forwardMessage(chat_id, from_chat_id, message_id, other, signal) {
3562
3471
  return this.raw.forwardMessage({ chat_id, from_chat_id, message_id, ...other }, signal);
@@ -3583,9 +3492,6 @@ var require_api = __commonJS((exports) => {
3583
3492
  sendPhoto(chat_id, photo, other, signal) {
3584
3493
  return this.raw.sendPhoto({ chat_id, photo, ...other }, signal);
3585
3494
  }
3586
- sendLivePhoto(chat_id, live_photo, photo, other, signal) {
3587
- return this.raw.sendLivePhoto({ chat_id, live_photo, photo, ...other }, signal);
3588
- }
3589
3495
  sendAudio(chat_id, audio, other, signal) {
3590
3496
  return this.raw.sendAudio({ chat_id, audio, ...other }, signal);
3591
3497
  }
@@ -3604,9 +3510,6 @@ var require_api = __commonJS((exports) => {
3604
3510
  sendVideoNote(chat_id, video_note, other, signal) {
3605
3511
  return this.raw.sendVideoNote({ chat_id, video_note, ...other }, signal);
3606
3512
  }
3607
- sendPaidMedia(chat_id, star_count, media, other, signal) {
3608
- return this.raw.sendPaidMedia({ chat_id, star_count, media, ...other }, signal);
3609
- }
3610
3513
  sendMediaGroup(chat_id, media, other, signal) {
3611
3514
  return this.raw.sendMediaGroup({ chat_id, media, ...other }, signal);
3612
3515
  }
@@ -3625,6 +3528,9 @@ var require_api = __commonJS((exports) => {
3625
3528
  stopMessageLiveLocationInline(inline_message_id, other, signal) {
3626
3529
  return this.raw.stopMessageLiveLocation({ inline_message_id, ...other }, signal);
3627
3530
  }
3531
+ sendPaidMedia(chat_id, star_count, media, other, signal) {
3532
+ return this.raw.sendPaidMedia({ chat_id, star_count, media, ...other }, signal);
3533
+ }
3628
3534
  sendVenue(chat_id, latitude, longitude, title, address, other, signal) {
3629
3535
  return this.raw.sendVenue({ chat_id, latitude, longitude, title, address, ...other }, signal);
3630
3536
  }
@@ -3663,12 +3569,6 @@ var require_api = __commonJS((exports) => {
3663
3569
  ...other
3664
3570
  }, signal);
3665
3571
  }
3666
- sendMessageDraft(chat_id, draft_id, text, other, signal) {
3667
- return this.raw.sendMessageDraft({ chat_id, draft_id, text, ...other }, signal);
3668
- }
3669
- sendRichMessageDraft(chat_id, draft_id, rich_message, other, signal) {
3670
- return this.raw.sendRichMessageDraft({ chat_id, draft_id, rich_message, ...other }, signal);
3671
- }
3672
3572
  sendChatAction(chat_id, action, other, signal) {
3673
3573
  return this.raw.sendChatAction({ chat_id, action, ...other }, signal);
3674
3574
  }
@@ -3693,22 +3593,6 @@ var require_api = __commonJS((exports) => {
3693
3593
  getBusinessConnection(business_connection_id, signal) {
3694
3594
  return this.raw.getBusinessConnection({ business_connection_id }, signal);
3695
3595
  }
3696
- getManagedBotToken(user_id, signal) {
3697
- return this.raw.getManagedBotToken({ user_id }, signal);
3698
- }
3699
- replaceManagedBotToken(user_id, signal) {
3700
- return this.raw.replaceManagedBotToken({ user_id }, signal);
3701
- }
3702
- getManagedBotAccessSettings(user_id, signal) {
3703
- return this.raw.getManagedBotAccessSettings({ user_id }, signal);
3704
- }
3705
- setManagedBotAccessSettings(user_id, is_access_restricted, other, signal) {
3706
- return this.raw.setManagedBotAccessSettings({
3707
- user_id,
3708
- is_access_restricted,
3709
- ...other
3710
- }, signal);
3711
- }
3712
3596
  getFile(file_id, signal) {
3713
3597
  return this.raw.getFile({ file_id }, signal);
3714
3598
  }
@@ -3760,18 +3644,18 @@ var require_api = __commonJS((exports) => {
3760
3644
  revokeChatInviteLink(chat_id, invite_link, signal) {
3761
3645
  return this.raw.revokeChatInviteLink({ chat_id, invite_link }, signal);
3762
3646
  }
3647
+ getManagedBotToken(user_id, signal) {
3648
+ return this.raw.getManagedBotToken({ user_id }, signal);
3649
+ }
3650
+ replaceManagedBotToken(user_id, signal) {
3651
+ return this.raw.replaceManagedBotToken({ user_id }, signal);
3652
+ }
3763
3653
  approveChatJoinRequest(chat_id, user_id, signal) {
3764
3654
  return this.raw.approveChatJoinRequest({ chat_id, user_id }, signal);
3765
3655
  }
3766
3656
  declineChatJoinRequest(chat_id, user_id, signal) {
3767
3657
  return this.raw.declineChatJoinRequest({ chat_id, user_id }, signal);
3768
3658
  }
3769
- answerChatJoinRequestQuery(chat_join_request_query_id, result, signal) {
3770
- return this.raw.answerChatJoinRequestQuery({ chat_join_request_query_id, result }, signal);
3771
- }
3772
- sendChatJoinRequestWebApp(chat_join_request_query_id, web_app_url, signal) {
3773
- return this.raw.sendChatJoinRequestWebApp({ chat_join_request_query_id, web_app_url }, signal);
3774
- }
3775
3659
  approveSuggestedPost(chat_id, message_id, other, signal) {
3776
3660
  return this.raw.approveSuggestedPost({ chat_id, message_id, ...other }, signal);
3777
3661
  }
@@ -3805,8 +3689,8 @@ var require_api = __commonJS((exports) => {
3805
3689
  getChat(chat_id, signal) {
3806
3690
  return this.raw.getChat({ chat_id }, signal);
3807
3691
  }
3808
- getChatAdministrators(chat_id, other, signal) {
3809
- return this.raw.getChatAdministrators({ chat_id, ...other }, signal);
3692
+ getChatAdministrators(chat_id, signal) {
3693
+ return this.raw.getChatAdministrators({ chat_id }, signal);
3810
3694
  }
3811
3695
  getChatMembersCount(...args) {
3812
3696
  return this.getChatMemberCount(...args);
@@ -3817,9 +3701,6 @@ var require_api = __commonJS((exports) => {
3817
3701
  getChatMember(chat_id, user_id, signal) {
3818
3702
  return this.raw.getChatMember({ chat_id, user_id }, signal);
3819
3703
  }
3820
- getUserPersonalChatMessages(user_id, limit, signal) {
3821
- return this.raw.getUserPersonalChatMessages({ user_id, limit }, signal);
3822
- }
3823
3704
  setChatStickerSet(chat_id, sticker_set_name, signal) {
3824
3705
  return this.raw.setChatStickerSet({ chat_id, sticker_set_name }, signal);
3825
3706
  }
@@ -3868,9 +3749,6 @@ var require_api = __commonJS((exports) => {
3868
3749
  answerCallbackQuery(callback_query_id, other, signal) {
3869
3750
  return this.raw.answerCallbackQuery({ callback_query_id, ...other }, signal);
3870
3751
  }
3871
- answerGuestQuery(guest_query_id, result, signal) {
3872
- return this.raw.answerGuestQuery({ guest_query_id, result }, signal);
3873
- }
3874
3752
  setMyName(name, other, signal) {
3875
3753
  return this.raw.setMyName({ name, ...other }, signal);
3876
3754
  }
@@ -3919,20 +3797,11 @@ var require_api = __commonJS((exports) => {
3919
3797
  getMyStarBalance(signal) {
3920
3798
  return this.raw.getMyStarBalance(signal);
3921
3799
  }
3922
- editMessageText(chat_id, message_id, text_or_rich_message, other, signal) {
3923
- return this.raw.editMessageText(typeof text_or_rich_message === "string" ? { chat_id, message_id, text: text_or_rich_message, ...other } : {
3924
- chat_id,
3925
- message_id,
3926
- rich_message: text_or_rich_message,
3927
- ...other
3928
- }, signal);
3800
+ editMessageText(chat_id, message_id, text, other, signal) {
3801
+ return this.raw.editMessageText({ chat_id, message_id, text, ...other }, signal);
3929
3802
  }
3930
- editMessageTextInline(inline_message_id, text_or_rich_message, other, signal) {
3931
- return this.raw.editMessageText(typeof text_or_rich_message === "string" ? { inline_message_id, text: text_or_rich_message, ...other } : {
3932
- inline_message_id,
3933
- rich_message: text_or_rich_message,
3934
- ...other
3935
- }, signal);
3803
+ editMessageTextInline(inline_message_id, text, other, signal) {
3804
+ return this.raw.editMessageText({ inline_message_id, text, ...other }, signal);
3936
3805
  }
3937
3806
  editMessageCaption(chat_id, message_id, other, signal) {
3938
3807
  return this.raw.editMessageCaption({ chat_id, message_id, ...other }, signal);
@@ -3961,36 +3830,6 @@ var require_api = __commonJS((exports) => {
3961
3830
  deleteMessages(chat_id, message_ids, signal) {
3962
3831
  return this.raw.deleteMessages({ chat_id, message_ids }, signal);
3963
3832
  }
3964
- deleteMessageReactionUser(chat_id, message_id, user_id, other, signal) {
3965
- return this.raw.deleteMessageReaction({
3966
- chat_id,
3967
- message_id,
3968
- user_id,
3969
- ...other
3970
- }, signal);
3971
- }
3972
- deleteMessageReactionChat(chat_id, message_id, actor_chat_id, other, signal) {
3973
- return this.raw.deleteMessageReaction({
3974
- chat_id,
3975
- message_id,
3976
- actor_chat_id,
3977
- ...other
3978
- }, signal);
3979
- }
3980
- deleteAllMessageReactionsUser(chat_id, user_id, other, signal) {
3981
- return this.raw.deleteAllMessageReactions({
3982
- chat_id,
3983
- user_id,
3984
- ...other
3985
- }, signal);
3986
- }
3987
- deleteAllMessageReactionsChat(chat_id, actor_chat_id, other, signal) {
3988
- return this.raw.deleteAllMessageReactions({
3989
- chat_id,
3990
- actor_chat_id,
3991
- ...other
3992
- }, signal);
3993
- }
3994
3833
  deleteBusinessMessages(business_connection_id, message_ids, signal) {
3995
3834
  return this.raw.deleteBusinessMessages({ business_connection_id, message_ids }, signal);
3996
3835
  }
@@ -4202,7 +4041,7 @@ var require_api = __commonJS((exports) => {
4202
4041
  exports.Api = Api;
4203
4042
  });
4204
4043
 
4205
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/bot.js
4044
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/bot.js
4206
4045
  var require_bot = __commonJS((exports) => {
4207
4046
  Object.defineProperty(exports, "__esModule", { value: true });
4208
4047
  exports.Bot = exports.BotError = exports.DEFAULT_UPDATE_TYPES = undefined;
@@ -4227,7 +4066,6 @@ var require_bot = __commonJS((exports) => {
4227
4066
  "business_message",
4228
4067
  "edited_business_message",
4229
4068
  "deleted_business_messages",
4230
- "guest_message",
4231
4069
  "inline_query",
4232
4070
  "chosen_inline_result",
4233
4071
  "callback_query",
@@ -4532,7 +4370,7 @@ On the other hand, if you actually know what you're doing and you do need to ins
4532
4370
  var shim_node_js_1 = require_shim_node();
4533
4371
  });
4534
4372
 
4535
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/convenience/constants.js
4373
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/convenience/constants.js
4536
4374
  var require_constants = __commonJS((exports) => {
4537
4375
  Object.defineProperty(exports, "__esModule", { value: true });
4538
4376
  exports.API_CONSTANTS = undefined;
@@ -4554,7 +4392,6 @@ var require_constants = __commonJS((exports) => {
4554
4392
  can_send_polls: true,
4555
4393
  can_send_other_messages: true,
4556
4394
  can_add_web_page_previews: true,
4557
- can_react_to_messages: true,
4558
4395
  can_change_info: true,
4559
4396
  can_invite_users: true,
4560
4397
  can_edit_tag: true,
@@ -4569,7 +4406,7 @@ var require_constants = __commonJS((exports) => {
4569
4406
  Object.freeze(exports.API_CONSTANTS);
4570
4407
  });
4571
4408
 
4572
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/convenience/inline_query.js
4409
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/convenience/inline_query.js
4573
4410
  var require_inline_query = __commonJS((exports) => {
4574
4411
  Object.defineProperty(exports, "__esModule", { value: true });
4575
4412
  exports.InlineQueryResultBuilder = undefined;
@@ -4588,13 +4425,6 @@ var require_inline_query = __commonJS((exports) => {
4588
4425
  };
4589
4426
  return { ...queryTemplate, input_message_content: content };
4590
4427
  },
4591
- rich(rich_message, options = {}) {
4592
- const content = {
4593
- rich_message,
4594
- ...options
4595
- };
4596
- return { ...queryTemplate, input_message_content: content };
4597
- },
4598
4428
  location(latitude, longitude, options = {}) {
4599
4429
  const content = {
4600
4430
  latitude,
@@ -4774,7 +4604,7 @@ var require_inline_query = __commonJS((exports) => {
4774
4604
  };
4775
4605
  });
4776
4606
 
4777
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/convenience/input_media.js
4607
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/convenience/input_media.js
4778
4608
  var require_input_media = __commonJS((exports) => {
4779
4609
  Object.defineProperty(exports, "__esModule", { value: true });
4780
4610
  exports.InputMediaBuilder = undefined;
@@ -4797,7 +4627,7 @@ var require_input_media = __commonJS((exports) => {
4797
4627
  };
4798
4628
  });
4799
4629
 
4800
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/convenience/keyboard.js
4630
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/convenience/keyboard.js
4801
4631
  var require_keyboard = __commonJS((exports) => {
4802
4632
  Object.defineProperty(exports, "__esModule", { value: true });
4803
4633
  exports.InlineKeyboard = exports.Keyboard = undefined;
@@ -5155,7 +4985,7 @@ var require_keyboard = __commonJS((exports) => {
5155
4985
  }
5156
4986
  });
5157
4987
 
5158
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/convenience/session.js
4988
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/convenience/session.js
5159
4989
  var require_session = __commonJS((exports) => {
5160
4990
  Object.defineProperty(exports, "__esModule", { value: true });
5161
4991
  exports.MemorySessionStorage = undefined;
@@ -5455,7 +5285,7 @@ var require_session = __commonJS((exports) => {
5455
5285
  }
5456
5286
  });
5457
5287
 
5458
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/convenience/frameworks.js
5288
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/convenience/frameworks.js
5459
5289
  var require_frameworks = __commonJS((exports) => {
5460
5290
  Object.defineProperty(exports, "__esModule", { value: true });
5461
5291
  exports.adapters = undefined;
@@ -5471,32 +5301,28 @@ var require_frameworks = __commonJS((exports) => {
5471
5301
  status: 401,
5472
5302
  statusText: WRONG_TOKEN_ERROR
5473
5303
  });
5474
- var awsLambda = (event, _context, callback) => {
5475
- var _a;
5476
- return {
5477
- get update() {
5478
- var _a2;
5479
- return JSON.parse((_a2 = event.body) !== null && _a2 !== undefined ? _a2 : "{}");
5480
- },
5481
- header: (_a = event.headers[SECRET_HEADER]) !== null && _a !== undefined ? _a : event.headers[SECRET_HEADER_LOWERCASE],
5482
- end: () => callback(null, { statusCode: 200 }),
5483
- respond: (json) => callback(null, {
5484
- statusCode: 200,
5485
- headers: { "Content-Type": "application/json" },
5486
- body: json
5487
- }),
5488
- unauthorized: () => callback(null, { statusCode: 401 })
5489
- };
5490
- };
5304
+ var awsLambda = (event, _context, callback) => ({
5305
+ get update() {
5306
+ var _a;
5307
+ return JSON.parse((_a = event.body) !== null && _a !== undefined ? _a : "{}");
5308
+ },
5309
+ header: event.headers[SECRET_HEADER],
5310
+ end: () => callback(null, { statusCode: 200 }),
5311
+ respond: (json) => callback(null, {
5312
+ statusCode: 200,
5313
+ headers: { "Content-Type": "application/json" },
5314
+ body: json
5315
+ }),
5316
+ unauthorized: () => callback(null, { statusCode: 401 })
5317
+ });
5491
5318
  var awsLambdaAsync = (event, _context) => {
5492
- var _a;
5493
5319
  let resolveResponse;
5494
5320
  return {
5495
5321
  get update() {
5496
- var _a2;
5497
- return JSON.parse((_a2 = event.body) !== null && _a2 !== undefined ? _a2 : "{}");
5322
+ var _a;
5323
+ return JSON.parse((_a = event.body) !== null && _a !== undefined ? _a : "{}");
5498
5324
  },
5499
- header: (_a = event.headers[SECRET_HEADER]) !== null && _a !== undefined ? _a : event.headers[SECRET_HEADER_LOWERCASE],
5325
+ header: event.headers[SECRET_HEADER],
5500
5326
  end: () => resolveResponse({ statusCode: 200 }),
5501
5327
  respond: (json) => resolveResponse({
5502
5328
  statusCode: 200,
@@ -5508,24 +5334,24 @@ var require_frameworks = __commonJS((exports) => {
5508
5334
  };
5509
5335
  };
5510
5336
  var azure = (context, request) => {
5511
- var _a;
5337
+ var _a, _b;
5512
5338
  return {
5513
5339
  get update() {
5514
5340
  return request.body;
5515
5341
  },
5516
- header: (_a = request.headers) === null || _a === undefined ? undefined : _a[SECRET_HEADER_LOWERCASE],
5342
+ header: (_b = (_a = context.res) === null || _a === undefined ? undefined : _a.headers) === null || _b === undefined ? undefined : _b[SECRET_HEADER],
5517
5343
  end: () => context.res = {
5518
5344
  status: 200,
5519
5345
  body: ""
5520
5346
  },
5521
5347
  respond: (json) => {
5522
- var _a2, _b, _c, _d;
5523
- (_b = (_a2 = context.res) === null || _a2 === undefined ? undefined : _a2.set) === null || _b === undefined || _b.call(_a2, "Content-Type", "application/json");
5348
+ var _a2, _b2, _c, _d;
5349
+ (_b2 = (_a2 = context.res) === null || _a2 === undefined ? undefined : _a2.set) === null || _b2 === undefined || _b2.call(_a2, "Content-Type", "application/json");
5524
5350
  (_d = (_c = context.res) === null || _c === undefined ? undefined : _c.send) === null || _d === undefined || _d.call(_c, json);
5525
5351
  },
5526
5352
  unauthorized: () => {
5527
- var _a2, _b;
5528
- (_b = (_a2 = context.res) === null || _a2 === undefined ? undefined : _a2.send) === null || _b === undefined || _b.call(_a2, 401, WRONG_TOKEN_ERROR);
5353
+ var _a2, _b2;
5354
+ (_b2 = (_a2 = context.res) === null || _a2 === undefined ? undefined : _a2.send) === null || _b2 === undefined || _b2.call(_a2, 401, WRONG_TOKEN_ERROR);
5529
5355
  }
5530
5356
  };
5531
5357
  };
@@ -5827,7 +5653,7 @@ var require_frameworks = __commonJS((exports) => {
5827
5653
  };
5828
5654
  });
5829
5655
 
5830
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/convenience/webhook.js
5656
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/convenience/webhook.js
5831
5657
  var require_webhook = __commonJS((exports) => {
5832
5658
  Object.defineProperty(exports, "__esModule", { value: true });
5833
5659
  exports.webhookCallback = webhookCallback;
@@ -5856,7 +5682,7 @@ var require_webhook = __commonJS((exports) => {
5856
5682
  }
5857
5683
  let hasDifference = 0;
5858
5684
  for (let i = 0;i < tokenBytes.length; i++) {
5859
- const headerByte = headerBytes[i];
5685
+ const headerByte = i < headerBytes.length ? headerBytes[i] : 0;
5860
5686
  const tokenByte = tokenBytes[i];
5861
5687
  hasDifference |= headerByte ^ tokenByte;
5862
5688
  }
@@ -5921,7 +5747,7 @@ var require_webhook = __commonJS((exports) => {
5921
5747
  }
5922
5748
  });
5923
5749
 
5924
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/mod.js
5750
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/mod.js
5925
5751
  var require_mod = __commonJS((exports) => {
5926
5752
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
5927
5753
  if (k2 === undefined)
@@ -5987,7 +5813,7 @@ var require_mod = __commonJS((exports) => {
5987
5813
  } });
5988
5814
  });
5989
5815
 
5990
- // ../node_modules/.bun/@grammyjs+runner@2.0.3+061f65c8e99495c7/node_modules/@grammyjs/runner/out/platform.node.js
5816
+ // ../node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/platform.node.js
5991
5817
  var require_platform_node2 = __commonJS((exports) => {
5992
5818
  Object.defineProperty(exports, "__esModule", { value: true });
5993
5819
  exports.parentThread = exports.createThread = undefined;
@@ -6018,7 +5844,7 @@ var require_platform_node2 = __commonJS((exports) => {
6018
5844
  exports.parentThread = parentThread;
6019
5845
  });
6020
5846
 
6021
- // ../node_modules/.bun/@grammyjs+runner@2.0.3+061f65c8e99495c7/node_modules/@grammyjs/runner/out/distribute.js
5847
+ // ../node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/distribute.js
6022
5848
  var require_distribute = __commonJS((exports) => {
6023
5849
  Object.defineProperty(exports, "__esModule", { value: true });
6024
5850
  exports.distribute = undefined;
@@ -6063,7 +5889,7 @@ var require_distribute = __commonJS((exports) => {
6063
5889
  exports.distribute = distribute;
6064
5890
  });
6065
5891
 
6066
- // ../node_modules/.bun/@grammyjs+runner@2.0.3+061f65c8e99495c7/node_modules/@grammyjs/runner/out/queue.js
5892
+ // ../node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/queue.js
6067
5893
  var require_queue = __commonJS((exports) => {
6068
5894
  Object.defineProperty(exports, "__esModule", { value: true });
6069
5895
  exports.DecayingDeque = undefined;
@@ -6207,7 +6033,7 @@ var require_queue = __commonJS((exports) => {
6207
6033
  exports.DecayingDeque = DecayingDeque;
6208
6034
  });
6209
6035
 
6210
- // ../node_modules/.bun/@grammyjs+runner@2.0.3+061f65c8e99495c7/node_modules/@grammyjs/runner/out/sink.js
6036
+ // ../node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/sink.js
6211
6037
  var require_sink = __commonJS((exports) => {
6212
6038
  Object.defineProperty(exports, "__esModule", { value: true });
6213
6039
  exports.createConcurrentSink = exports.createBatchSink = exports.createSequentialSink = undefined;
@@ -6252,7 +6078,7 @@ var require_sink = __commonJS((exports) => {
6252
6078
  exports.createConcurrentSink = createConcurrentSink;
6253
6079
  });
6254
6080
 
6255
- // ../node_modules/.bun/@grammyjs+runner@2.0.3+061f65c8e99495c7/node_modules/@grammyjs/runner/out/node-shim.js
6081
+ // ../node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/node-shim.js
6256
6082
  var require_node_shim = __commonJS((exports) => {
6257
6083
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
6258
6084
  if (k2 === undefined)
@@ -6278,7 +6104,7 @@ var require_node_shim = __commonJS((exports) => {
6278
6104
  __exportStar(require_abort_controller(), exports);
6279
6105
  });
6280
6106
 
6281
- // ../node_modules/.bun/@grammyjs+runner@2.0.3+061f65c8e99495c7/node_modules/@grammyjs/runner/out/source.js
6107
+ // ../node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/source.js
6282
6108
  var require_source = __commonJS((exports) => {
6283
6109
  Object.defineProperty(exports, "__esModule", { value: true });
6284
6110
  exports.createSource = undefined;
@@ -6358,7 +6184,7 @@ var require_source = __commonJS((exports) => {
6358
6184
  var node_shim_js_1 = require_node_shim();
6359
6185
  });
6360
6186
 
6361
- // ../node_modules/.bun/@grammyjs+runner@2.0.3+061f65c8e99495c7/node_modules/@grammyjs/runner/out/runner.js
6187
+ // ../node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/runner.js
6362
6188
  var require_runner = __commonJS((exports) => {
6363
6189
  Object.defineProperty(exports, "__esModule", { value: true });
6364
6190
  exports.createRunner = exports.createUpdateFetcher = exports.run = undefined;
@@ -6510,7 +6336,7 @@ var require_runner = __commonJS((exports) => {
6510
6336
  }
6511
6337
  });
6512
6338
 
6513
- // ../node_modules/.bun/@grammyjs+runner@2.0.3+061f65c8e99495c7/node_modules/@grammyjs/runner/out/sequentialize.js
6339
+ // ../node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/sequentialize.js
6514
6340
  var require_sequentialize = __commonJS((exports) => {
6515
6341
  Object.defineProperty(exports, "__esModule", { value: true });
6516
6342
  exports.sequentialize = undefined;
@@ -6553,7 +6379,7 @@ var require_sequentialize = __commonJS((exports) => {
6553
6379
  exports.sequentialize = sequentialize;
6554
6380
  });
6555
6381
 
6556
- // ../node_modules/.bun/grammy@1.44.0/node_modules/grammy/out/mod.js
6382
+ // ../node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/mod.js
6557
6383
  var require_mod2 = __commonJS((exports) => {
6558
6384
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
6559
6385
  if (k2 === undefined)
@@ -6619,7 +6445,7 @@ var require_mod2 = __commonJS((exports) => {
6619
6445
  } });
6620
6446
  });
6621
6447
 
6622
- // ../node_modules/.bun/@grammyjs+runner@2.0.3+061f65c8e99495c7/node_modules/@grammyjs/runner/out/deps.node.js
6448
+ // ../node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/deps.node.js
6623
6449
  var require_deps_node = __commonJS((exports) => {
6624
6450
  Object.defineProperty(exports, "__esModule", { value: true });
6625
6451
  exports.BotError = exports.Bot = undefined;
@@ -6632,7 +6458,7 @@ var require_deps_node = __commonJS((exports) => {
6632
6458
  } });
6633
6459
  });
6634
6460
 
6635
- // ../node_modules/.bun/@grammyjs+runner@2.0.3+061f65c8e99495c7/node_modules/@grammyjs/runner/out/worker.js
6461
+ // ../node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/worker.js
6636
6462
  var require_worker = __commonJS((exports) => {
6637
6463
  Object.defineProperty(exports, "__esModule", { value: true });
6638
6464
  exports.BotWorker = undefined;
@@ -6674,7 +6500,7 @@ var require_worker = __commonJS((exports) => {
6674
6500
  exports.BotWorker = BotWorker;
6675
6501
  });
6676
6502
 
6677
- // ../node_modules/.bun/@grammyjs+runner@2.0.3+061f65c8e99495c7/node_modules/@grammyjs/runner/out/mod.js
6503
+ // ../node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/mod.js
6678
6504
  var require_mod3 = __commonJS((exports) => {
6679
6505
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
6680
6506
  if (k2 === undefined)
@@ -6713,6 +6539,77 @@ function escapeMarkdown(text) {
6713
6539
  function codeSpanSafe(s) {
6714
6540
  return s.replace(/`/g, "`\u200b");
6715
6541
  }
6542
+ function maskCodeRegions(text, nonce) {
6543
+ const FENCE_MASK_PH = `\x00RMF${nonce}_`;
6544
+ const INLINE_MASK_PH = `\x00RMI${nonce}_`;
6545
+ const codeMasks = [];
6546
+ const masked = text.replace(/```[\s\S]*?```/g, (m) => {
6547
+ const idx = codeMasks.length;
6548
+ codeMasks.push(m);
6549
+ return `${FENCE_MASK_PH}${idx}\x00`;
6550
+ }).replace(/`[^`\n]+`/g, (m) => {
6551
+ const idx = codeMasks.length;
6552
+ codeMasks.push(m);
6553
+ return `${INLINE_MASK_PH}${idx}\x00`;
6554
+ });
6555
+ const escNonce = nonce.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
6556
+ const anyMaskRe = new RegExp(`\x00RM[FI]${escNonce}_(\\d+)\x00`, "g");
6557
+ const restore = (s) => s.replace(anyMaskRe, (_m, idx) => codeMasks[Number(idx)] ?? _m);
6558
+ const stripPlaceholders = (s) => s.replace(anyMaskRe, "");
6559
+ return { masked, restore, placeholder: FENCE_MASK_PH, stripPlaceholders };
6560
+ }
6561
+ function hardenCardBreaks(text) {
6562
+ if (!text.includes(`
6563
+ `))
6564
+ return text;
6565
+ const nonce = Math.random().toString(36).slice(2);
6566
+ const { masked, restore, placeholder } = maskCodeRegions(text, nonce);
6567
+ const out = masked.replace(/\n{3,}/g, `
6568
+
6569
+ `);
6570
+ const isBlockConstructLine = (line) => isListItemLine(line) || isTableRowLine(line) || isTableDelimiterLine(line) || isBlockquoteLine(line) || isHeadingLine(line) || isFenceOpenLine(line, placeholder);
6571
+ const lines = out.split(`
6572
+ `);
6573
+ const pieces = [];
6574
+ for (let i = 0;i < lines.length; i++) {
6575
+ let line = lines[i];
6576
+ const isLast = i === lines.length - 1;
6577
+ const next = isLast ? "" : lines[i + 1];
6578
+ const promote = !isLast && line.trim() !== "" && next.trim() !== "" && !isBlockConstructLine(line) && !isBlockConstructLine(next);
6579
+ if (promote) {
6580
+ line = line.replace(/[ \t\r]+$/, "");
6581
+ }
6582
+ pieces.push(line);
6583
+ if (isLast)
6584
+ break;
6585
+ pieces.push(promote ? `
6586
+ ` : `
6587
+ `);
6588
+ }
6589
+ return restore(pieces.join(""));
6590
+ }
6591
+ function isListItemLine(line) {
6592
+ const t = line.trimStart();
6593
+ return /^[-*+]\s/.test(t) || /^\d+[.)]\s/.test(t);
6594
+ }
6595
+ function isTableRowLine(line) {
6596
+ return /^\s*\|/.test(line);
6597
+ }
6598
+ function isTableDelimiterLine(line) {
6599
+ return /^\s*\|?\s*:?-{1,}:?\s*(\|\s*:?-{1,}:?\s*)*\|?\s*$/.test(line);
6600
+ }
6601
+ function isFenceOpenLine(line, placeholder) {
6602
+ const t = line.trimStart();
6603
+ if (placeholder != null && placeholder.length > 0 && t.startsWith(placeholder))
6604
+ return true;
6605
+ return t.startsWith("```");
6606
+ }
6607
+ function isBlockquoteLine(line) {
6608
+ return line.trimStart().startsWith(">");
6609
+ }
6610
+ function isHeadingLine(line) {
6611
+ return /^#{1,6}\s/.test(line.trimStart());
6612
+ }
6716
6613
  var RICH_MESSAGE_MAX_CHARS = 32768;
6717
6614
 
6718
6615
  // text-voice-scrub.ts
@@ -6872,7 +6769,7 @@ var init_card_format = __esm(() => {
6872
6769
  init_text_voice_scrub();
6873
6770
  });
6874
6771
 
6875
- // ../node_modules/.bun/@grammyjs+runner@2.0.3+061f65c8e99495c7/node_modules/@grammyjs/runner/out/mod.js
6772
+ // ../node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/mod.js
6876
6773
  var require_mod4 = __commonJS((exports) => {
6877
6774
  var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
6878
6775
  if (k2 === undefined)
@@ -32074,11 +31971,11 @@ function registerApprovalsCommands(bot, opts) {
32074
31971
  return `\`${d.id.slice(0, 8)}\` ` + `${escapeMarkdown(d.agent_unit)} \u2192 ` + `\`${codeSpanSafe(d.scope)}\` ` + `(${escapeMarkdown(d.action)}, ${ttl}) ` + `\u00b7 /approvals revoke ${escapeMarkdown(d.id)}`;
32075
31972
  }).join(`
32076
31973
  `);
32077
- await ctx.replyWithRichMessage(richMessage(`**Active approvals**
31974
+ await ctx.replyWithRichMessage(richMessage(hardenCardBreaks(`**Active approvals**
32078
31975
 
32079
31976
  ${summary}
32080
31977
 
32081
- ${detail}`));
31978
+ ${detail}`)));
32082
31979
  return;
32083
31980
  }
32084
31981
  if (sub === "revoke") {
@@ -35303,8 +35200,8 @@ function renderVaultRequestAccessCard(req) {
35303
35200
  }
35304
35201
  lines.push("");
35305
35202
  lines.push(`_Tap Approve to mint a scoped grant token (same flow as \`switchroom vault grant\`). Tap Deny to refuse \u2014 the agent will receive a denial result._`);
35306
- return lines.join(`
35307
- `);
35203
+ return hardenCardBreaks(lines.join(`
35204
+ `));
35308
35205
  }
35309
35206
 
35310
35207
  // gateway/permission-card-store.ts
@@ -45062,26 +44959,29 @@ function repairEscapedWhitespace(text) {
45062
44959
  return text;
45063
44960
  const nonce = Math.random().toString(36).slice(2);
45064
44961
  const BACKSLASH_PH = `\x00BK${nonce}_`;
45065
- const { masked, restore: restore2 } = maskCodeRegions(text, nonce);
44962
+ const { masked, restore: restore2 } = maskCodeRegions2(text, nonce);
45066
44963
  const unescaped = masked.replace(/\\\\/g, BACKSLASH_PH).replace(/\\n/g, `
45067
44964
  `).replace(/\\r/g, "\r").replace(/\\t/g, "\t").replace(/\\"/g, '"').replace(new RegExp(BACKSLASH_PH.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), "\\");
45068
44965
  return restore2(unescaped);
45069
44966
  }
45070
- function maskCodeRegions(text, nonce) {
45071
- const CODE_MASK_PH = `\x00RM${nonce}_`;
44967
+ function maskCodeRegions2(text, nonce) {
44968
+ const FENCE_MASK_PH = `\x00RMF${nonce}_`;
44969
+ const INLINE_MASK_PH = `\x00RMI${nonce}_`;
45072
44970
  const codeMasks = [];
45073
44971
  const masked = text.replace(/```[\s\S]*?```/g, (m) => {
45074
44972
  const idx = codeMasks.length;
45075
44973
  codeMasks.push(m);
45076
- return `${CODE_MASK_PH}${idx}\x00`;
44974
+ return `${FENCE_MASK_PH}${idx}\x00`;
45077
44975
  }).replace(/`[^`\n]+`/g, (m) => {
45078
44976
  const idx = codeMasks.length;
45079
44977
  codeMasks.push(m);
45080
- return `${CODE_MASK_PH}${idx}\x00`;
44978
+ return `${INLINE_MASK_PH}${idx}\x00`;
45081
44979
  });
45082
- const restoreRe = new RegExp(`${CODE_MASK_PH.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(\\d+)\x00`, "g");
45083
- const restore2 = (s) => s.replace(restoreRe, (_m, idx) => codeMasks[Number(idx)] ?? _m);
45084
- return { masked, restore: restore2, placeholder: CODE_MASK_PH };
44980
+ const escNonce = nonce.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
44981
+ const anyMaskRe = new RegExp(`\x00RM[FI]${escNonce}_(\\d+)\x00`, "g");
44982
+ const restore2 = (s) => s.replace(anyMaskRe, (_m, idx) => codeMasks[Number(idx)] ?? _m);
44983
+ const stripPlaceholders = (s) => s.replace(anyMaskRe, "");
44984
+ return { masked, restore: restore2, placeholder: FENCE_MASK_PH, stripPlaceholders };
45085
44985
  }
45086
44986
  function splitCollapsedInlineBullets(text) {
45087
44987
  if (!/[\u2022\u00b7]/.test(text))
@@ -45103,7 +45003,7 @@ function normalizeParagraphBreaks(text) {
45103
45003
  `) && !/[\u2022\u00b7]/.test(text))
45104
45004
  return text;
45105
45005
  const nonce = Math.random().toString(36).slice(2);
45106
- const { masked: maskedRaw, restore: restore2, placeholder } = maskCodeRegions(text, nonce);
45006
+ const { masked: maskedRaw, restore: restore2, placeholder } = maskCodeRegions2(text, nonce);
45107
45007
  const masked = splitCollapsedInlineBullets(maskedRaw);
45108
45008
  let out = masked.replace(/\n[ \t\r]+\n(?:[ \t\r]*\n)*/g, `
45109
45009
 
@@ -45132,6 +45032,36 @@ function normalizeParagraphBreaks(text) {
45132
45032
  out = ensureBlockBoundaries(out, placeholder);
45133
45033
  return restore2(out);
45134
45034
  }
45035
+ function hardenCardBreaks2(text) {
45036
+ if (!text.includes(`
45037
+ `))
45038
+ return text;
45039
+ const nonce = Math.random().toString(36).slice(2);
45040
+ const { masked, restore: restore2, placeholder } = maskCodeRegions2(text, nonce);
45041
+ const out = masked.replace(/\n{3,}/g, `
45042
+
45043
+ `);
45044
+ const isBlockConstructLine = (line) => isListItemLine2(line) || isTableRowLine2(line) || isTableDelimiterLine2(line) || isBlockquoteLine2(line) || isHeadingLine2(line) || isFenceOpenLine2(line, placeholder);
45045
+ const lines = out.split(`
45046
+ `);
45047
+ const pieces = [];
45048
+ for (let i = 0;i < lines.length; i++) {
45049
+ let line = lines[i];
45050
+ const isLast = i === lines.length - 1;
45051
+ const next = isLast ? "" : lines[i + 1];
45052
+ const promote = !isLast && line.trim() !== "" && next.trim() !== "" && !isBlockConstructLine(line) && !isBlockConstructLine(next);
45053
+ if (promote) {
45054
+ line = line.replace(/[ \t\r]+$/, "");
45055
+ }
45056
+ pieces.push(line);
45057
+ if (isLast)
45058
+ break;
45059
+ pieces.push(promote ? `
45060
+ ` : `
45061
+ `);
45062
+ }
45063
+ return restore2(pieces.join(""));
45064
+ }
45135
45065
  var PARAGRAPH_SPACER = "\u00a0";
45136
45066
  function addParagraphSpacers(text) {
45137
45067
  if (!text.includes(`
@@ -45139,7 +45069,7 @@ function addParagraphSpacers(text) {
45139
45069
  `))
45140
45070
  return text;
45141
45071
  const nonce = Math.random().toString(36).slice(2);
45142
- const { masked, restore: restore2, placeholder } = maskCodeRegions(text, nonce);
45072
+ const { masked, restore: restore2, placeholder } = maskCodeRegions2(text, nonce);
45143
45073
  if (!masked.includes(`
45144
45074
 
45145
45075
  `))
@@ -45150,15 +45080,15 @@ function addParagraphSpacers(text) {
45150
45080
  const blockKind = (line) => {
45151
45081
  if (asciiTrim(line) === spacerLine)
45152
45082
  return "spacer";
45153
- if (isFenceOpenLine(line, placeholder))
45083
+ if (isFenceOpenLine2(line, placeholder))
45154
45084
  return "fence";
45155
- if (isListItemLine(line))
45085
+ if (isListItemLine2(line))
45156
45086
  return "list";
45157
- if (isTableRowLine(line) || isTableDelimiterLine(line))
45087
+ if (isTableRowLine2(line) || isTableDelimiterLine2(line))
45158
45088
  return "table";
45159
- if (isBlockquoteLine(line))
45089
+ if (isBlockquoteLine2(line))
45160
45090
  return "quote";
45161
- if (isHeadingLine(line))
45091
+ if (isHeadingLine2(line))
45162
45092
  return "heading";
45163
45093
  if (/^(-{3,}|\*{3,}|_{3,})\s*$/.test(line.trimStart()))
45164
45094
  return "divider";
@@ -45224,7 +45154,7 @@ function normalizePunctuation(text) {
45224
45154
  if (!/[\u2014\u2013\u2022\u00b7]/.test(text))
45225
45155
  return text;
45226
45156
  const nonce = Math.random().toString(36).slice(2);
45227
- const { masked, restore: restore2 } = maskCodeRegions(text, nonce);
45157
+ const { masked, restore: restore2 } = maskCodeRegions2(text, nonce);
45228
45158
  let out = masked.replace(/(\S)[ \t][\u2014\u2013][ \t](?=(\S))/g, (_m, a, b) => /\d/.test(a) && /\d/.test(b) ? `${a}-` : `${a}, `).replace(/(\w)\u2014(?=(\w))/g, (_m, a, b) => /\d/.test(a) && /\d/.test(b) ? `${a}-` : `${a}, `).replace(/(\w)\u2013(?=\w)/g, "$1-");
45229
45159
  out = out.split(`
45230
45160
  `).map((line) => line.replace(/^([ \t]*)[\u2022\u00b7][ \t]+/, "$1- ")).join(`
@@ -45244,9 +45174,8 @@ function stripExcessBold(text) {
45244
45174
  if (!text.includes("**"))
45245
45175
  return text;
45246
45176
  const nonce = Math.random().toString(36).slice(2);
45247
- const { masked, restore: restore2, placeholder } = maskCodeRegions(text, nonce);
45248
- const placeholderRe = new RegExp(`${placeholder.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\d+\x00`, "g");
45249
- const visible = masked.replace(placeholderRe, "");
45177
+ const { masked, restore: restore2, placeholder, stripPlaceholders } = maskCodeRegions2(text, nonce);
45178
+ const visible = stripPlaceholders(masked);
45250
45179
  if (visible.length < 100)
45251
45180
  return restore2(masked);
45252
45181
  let boldChars = 0;
@@ -45261,7 +45190,7 @@ function stripExcessBold(text) {
45261
45190
  `).filter((l) => l.trim() !== "");
45262
45191
  if (lines.length === 0 || !block.includes("**"))
45263
45192
  return block;
45264
- const listLines = lines.filter((l) => isListItemLine(l));
45193
+ const listLines = lines.filter((l) => isListItemLine2(l));
45265
45194
  if (listLines.length >= 2 && listLines.length === lines.length) {
45266
45195
  if (lines.every((l) => isFullyBolded(listItemContent(l))))
45267
45196
  return unbold(block);
@@ -45284,26 +45213,26 @@ function stripExcessBold(text) {
45284
45213
  `) + rebuilt[i];
45285
45214
  return restore2(out);
45286
45215
  }
45287
- function isListItemLine(line) {
45216
+ function isListItemLine2(line) {
45288
45217
  const t = line.trimStart();
45289
45218
  return /^[-*+]\s/.test(t) || /^\d+[.)]\s/.test(t);
45290
45219
  }
45291
- function isTableRowLine(line) {
45220
+ function isTableRowLine2(line) {
45292
45221
  return /^\s*\|/.test(line);
45293
45222
  }
45294
- function isTableDelimiterLine(line) {
45223
+ function isTableDelimiterLine2(line) {
45295
45224
  return /^\s*\|?\s*:?-{1,}:?\s*(\|\s*:?-{1,}:?\s*)*\|?\s*$/.test(line);
45296
45225
  }
45297
- function isFenceOpenLine(line, placeholder) {
45226
+ function isFenceOpenLine2(line, placeholder) {
45298
45227
  const t = line.trimStart();
45299
45228
  if (placeholder != null && placeholder.length > 0 && t.startsWith(placeholder))
45300
45229
  return true;
45301
45230
  return t.startsWith("```");
45302
45231
  }
45303
- function isBlockquoteLine(line) {
45232
+ function isBlockquoteLine2(line) {
45304
45233
  return line.trimStart().startsWith(">");
45305
45234
  }
45306
- function isHeadingLine(line) {
45235
+ function isHeadingLine2(line) {
45307
45236
  return /^#{1,6}\s/.test(line.trimStart());
45308
45237
  }
45309
45238
  function ensureBlockBoundaries(text, placeholder) {
@@ -45320,24 +45249,24 @@ function ensureBlockBoundaries(text, placeholder) {
45320
45249
  const curBlank = line.trim() === "";
45321
45250
  if (prevNonBlank && !curBlank) {
45322
45251
  const next = i + 1 < lines.length ? lines[i + 1] : "";
45323
- const prevIsTable = isTableRowLine(prev);
45324
- const startsTableHere = !prevIsTable && (line.includes("|") && isTableDelimiterLine(next) || isTableRowLine(line) && isTableDelimiterLine(next));
45325
- const startsFence = isFenceOpenLine(line, placeholder) && !isFenceOpenLine(prev, placeholder);
45326
- const startsQuote = isBlockquoteLine(line) && !isBlockquoteLine(prev);
45327
- const startsHeading = isHeadingLine(line) && !isHeadingLine(prev);
45328
- const startsList = isListItemLine(line) && !isListItemLine(prev);
45252
+ const prevIsTable = isTableRowLine2(prev);
45253
+ const startsTableHere = !prevIsTable && (line.includes("|") && isTableDelimiterLine2(next) || isTableRowLine2(line) && isTableDelimiterLine2(next));
45254
+ const startsFence = isFenceOpenLine2(line, placeholder) && !isFenceOpenLine2(prev, placeholder);
45255
+ const startsQuote = isBlockquoteLine2(line) && !isBlockquoteLine2(prev);
45256
+ const startsHeading = isHeadingLine2(line) && !isHeadingLine2(prev);
45257
+ const startsList = isListItemLine2(line) && !isListItemLine2(prev);
45329
45258
  if (startsTableHere || startsFence || startsQuote || startsHeading || startsList) {
45330
45259
  result.push("");
45331
45260
  }
45332
45261
  }
45333
- if (prevNonBlank && !curBlank && isFenceOpenLine(prev, placeholder)) {
45262
+ if (prevNonBlank && !curBlank && isFenceOpenLine2(prev, placeholder)) {
45334
45263
  const alreadySeparated = result.length > 0 && result[result.length - 1].trim() === "";
45335
- const curIsBlockStart = isFenceOpenLine(line, placeholder) || isBlockquoteLine(line) || isHeadingLine(line) || isTableRowLine(line) || isTableDelimiterLine(line);
45264
+ const curIsBlockStart = isFenceOpenLine2(line, placeholder) || isBlockquoteLine2(line) || isHeadingLine2(line) || isTableRowLine2(line) || isTableDelimiterLine2(line);
45336
45265
  if (!alreadySeparated && !curIsBlockStart) {
45337
45266
  result.push("");
45338
45267
  }
45339
45268
  }
45340
- if (prevNonBlank && !curBlank && isListItemLine(prev) && !isListItemLine(line)) {
45269
+ if (prevNonBlank && !curBlank && isListItemLine2(prev) && !isListItemLine2(line)) {
45341
45270
  const isIndentedContinuation = /^(\t| {4,})\S/.test(line);
45342
45271
  const alreadySeparated = result.length > 0 && result[result.length - 1].trim() === "";
45343
45272
  if (!isIndentedContinuation && !alreadySeparated) {
@@ -45355,7 +45284,7 @@ function isMarkerLine(line, placeholder) {
45355
45284
  const t = line.trimStart();
45356
45285
  if (placeholder != null && placeholder.length > 0 && t.startsWith(placeholder))
45357
45286
  return true;
45358
- return /^[-*+]\s/.test(t) || /^\d+[.)]\s/.test(t) || t.startsWith(">") || /^#{1,6}\s/.test(t) || isTableRowLine(line) || isTableDelimiterLine(line) || t.startsWith("```") || /^(-{3,}|\*{3,}|_{3,})\s*$/.test(t);
45287
+ return /^[-*+]\s/.test(t) || /^\d+[.)]\s/.test(t) || t.startsWith(">") || /^#{1,6}\s/.test(t) || isTableRowLine2(line) || isTableDelimiterLine2(line) || t.startsWith("```") || /^(-{3,}|\*{3,}|_{3,})\s*$/.test(t);
45359
45288
  }
45360
45289
  function shouldPromoteBreak(prev, next, placeholder) {
45361
45290
  if (isMarkerLine(prev, placeholder) || isMarkerLine(next, placeholder))
@@ -45786,7 +45715,7 @@ function formatAgentLine(meta) {
45786
45715
  function startText(agentName3, dmDisabled) {
45787
45716
  if (dmDisabled)
45788
45717
  return "This bot isn't accepting new connections.";
45789
- return [
45718
+ return stackCardLines([
45790
45719
  `**Switchroom** \u2014 Telegram on your Claude Pro or Max subscription.`,
45791
45720
  ``,
45792
45721
  `This bot is the **${escapeHtml(agentName3)}** agent. Pair first, then send messages here and they reach the agent; replies and reactions come back.`,
@@ -45796,11 +45725,10 @@ function startText(agentName3, dmDisabled) {
45796
45725
  `2. In Claude Code: \`/telegram:access pair <code>\``,
45797
45726
  ``,
45798
45727
  `After pairing, try \`/status\` or \`/commands\`.`
45799
- ].join(`
45800
- `);
45728
+ ]);
45801
45729
  }
45802
45730
  function helpText(agentName3) {
45803
- return [
45731
+ return stackCardLines([
45804
45732
  `**Switchroom** \u2014 your Pro/Max subscription, wired to Telegram.`,
45805
45733
  ``,
45806
45734
  `This bot is the **${escapeHtml(agentName3)}** agent. Text and photos route through to it; replies, reactions and progress cards come back.`,
@@ -45811,8 +45739,7 @@ function helpText(agentName3) {
45811
45739
  `\`/status\` \u2014 agent, model, auth`,
45812
45740
  `\`/vault audit <agent>\` \u2014 admin: review agent's vault access + one-tap [\uD83D\uDD13 Allow] on recent denials`,
45813
45741
  `\`/commands\` \u2014 full command list`
45814
- ].join(`
45815
- `);
45742
+ ]);
45816
45743
  }
45817
45744
  var STATUS_DOT = {
45818
45745
  ok: "\uD83D\uDFE2",
@@ -45858,13 +45785,14 @@ function statusPairedText(params) {
45858
45785
  if (audit.memoryBank)
45859
45786
  lines.push(`**Memory** ${escapeHtml(audit.memoryBank)}`);
45860
45787
  }
45861
- return lines.join(`
45862
- `);
45788
+ return stackCardLines(lines);
45863
45789
  }
45864
45790
  function statusPendingText(code) {
45865
- return `Pending pairing \u2014 run in Claude Code:
45866
-
45867
- \`/telegram:access pair ${code}\``;
45791
+ return stackCardLines([
45792
+ `Pending pairing \u2014 run in Claude Code:`,
45793
+ ``,
45794
+ `\`/telegram:access pair ${code}\``
45795
+ ]);
45868
45796
  }
45869
45797
  function statusUnpairedText() {
45870
45798
  return "Not paired. Send me a message to get a pairing code.";
@@ -45895,7 +45823,7 @@ var TELEGRAM_MENU_COMMANDS = [
45895
45823
  var TELEGRAM_BASE_COMMANDS = TELEGRAM_MENU_COMMANDS.slice(0, 3);
45896
45824
  var TELEGRAM_SWITCHROOM_COMMANDS = TELEGRAM_MENU_COMMANDS.slice(3);
45897
45825
  function switchroomHelpText(agentName3) {
45898
- return [
45826
+ return stackCardLines([
45899
45827
  `**Switchroom bot** \u2014 commands for the **${escapeHtml(agentName3)}** agent.`,
45900
45828
  ``,
45901
45829
  `**Session & approvals**`,
@@ -45945,8 +45873,7 @@ function switchroomHelpText(agentName3) {
45945
45873
  `\`/commands\` \u2014 this help`,
45946
45874
  ``,
45947
45875
  `_Tip: \`/update\` shows the plan; \`/update apply\` executes it; \`/restart\` bounces a stuck agent; \`/version\` checks what's running._`
45948
- ].join(`
45949
- `);
45876
+ ]);
45950
45877
  }
45951
45878
  function restartAckText(agentName3) {
45952
45879
  return `\uD83D\uDD04 Restarting **${escapeHtml(agentName3)}**\u2026`;
@@ -51577,8 +51504,8 @@ function buildMs365CardText(p) {
51577
51504
  }
51578
51505
  lines.push("");
51579
51506
  lines.push("\u26a0\ufe0f Weak attestation (RFC \u00a78 v1): operator should click through to verify the actual change before approving. Structural diff coming v1.5.");
51580
- return lines.join(`
51581
- `);
51507
+ return hardenCardBreaks(lines.join(`
51508
+ `));
51582
51509
  }
51583
51510
  function truncate3(s, n) {
51584
51511
  if (s.length <= n)
@@ -58663,10 +58590,10 @@ function readTurnActiveMarkerAgeMs(stateDir, now) {
58663
58590
  }
58664
58591
 
58665
58592
  // ../src/build-info.ts
58666
- var VERSION = "0.17.0";
58667
- var COMMIT_SHA = "6bb8a20";
58668
- var COMMIT_DATE = "2026-07-05T13:24:36+10:00";
58669
- var LATEST_PR = 2825;
58593
+ var VERSION = "0.17.2";
58594
+ var COMMIT_SHA = "f06074f4";
58595
+ var COMMIT_DATE = "2026-07-05T09:04:48Z";
58596
+ var LATEST_PR = 2834;
58670
58597
  var COMMITS_AHEAD_OF_TAG = 0;
58671
58598
 
58672
58599
  // gateway/boot-version.ts
@@ -64735,8 +64662,8 @@ function renderVaultRequestSaveCard(req, agentSlug) {
64735
64662
  }
64736
64663
  lines.push("");
64737
64664
  lines.push(`_Tap Save to write to the host vault, Rename to change the key name, or Discard to drop it. The value is held in this chat's gateway memory until you decide._`);
64738
- return lines.join(`
64739
- `);
64665
+ return hardenCardBreaks2(lines.join(`
64666
+ `));
64740
64667
  }
64741
64668
  async function executeVaultRequestSave(args) {
64742
64669
  const chat_id = String(args.chat_id ?? "");
@@ -67343,7 +67270,7 @@ async function switchroomReply(ctx, text2, options = {}) {
67343
67270
  ...options.reply_markup ? { reply_markup: options.reply_markup } : {}
67344
67271
  };
67345
67272
  if (options.html) {
67346
- await ctx.replyWithRichMessage(richMessage2(text2), replyOpts);
67273
+ await ctx.replyWithRichMessage(richMessage2(hardenCardBreaks2(text2)), replyOpts);
67347
67274
  } else {
67348
67275
  await ctx.reply(text2, replyOpts);
67349
67276
  }