alvin-bot 5.6.2 → 5.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +1 -1
  3. package/dist/claude.js +1 -102
  4. package/dist/config.js +1 -96
  5. package/dist/engine.js +1 -90
  6. package/dist/find-claude-binary.js +1 -98
  7. package/dist/handlers/async-agent-chunk-handler.js +1 -50
  8. package/dist/handlers/background-bypass.js +1 -75
  9. package/dist/handlers/commands.js +1 -2336
  10. package/dist/handlers/cron-progress.js +1 -52
  11. package/dist/handlers/document.js +1 -194
  12. package/dist/handlers/message.js +1 -959
  13. package/dist/handlers/photo.js +1 -154
  14. package/dist/handlers/platform-message.js +1 -360
  15. package/dist/handlers/stuck-timer.js +1 -54
  16. package/dist/handlers/video.js +1 -237
  17. package/dist/handlers/voice.js +1 -148
  18. package/dist/i18n.js +1 -805
  19. package/dist/index.js +1 -697
  20. package/dist/init-data-dir.js +1 -98
  21. package/dist/middleware/auth.js +1 -233
  22. package/dist/migrate.js +1 -162
  23. package/dist/paths.js +1 -146
  24. package/dist/platforms/discord.js +1 -175
  25. package/dist/platforms/index.js +1 -130
  26. package/dist/platforms/signal.js +1 -205
  27. package/dist/platforms/slack-slash-parser.js +1 -32
  28. package/dist/platforms/slack.js +1 -501
  29. package/dist/platforms/telegram.js +1 -111
  30. package/dist/platforms/types.js +1 -8
  31. package/dist/platforms/whatsapp-auth-helpers.js +1 -53
  32. package/dist/platforms/whatsapp.js +1 -707
  33. package/dist/providers/claude-sdk-provider.js +1 -565
  34. package/dist/providers/codex-cli-provider.js +1 -134
  35. package/dist/providers/index.js +1 -7
  36. package/dist/providers/ollama-provider.js +1 -32
  37. package/dist/providers/openai-compatible.js +1 -406
  38. package/dist/providers/registry.js +1 -352
  39. package/dist/providers/runtime-header.js +1 -45
  40. package/dist/providers/tool-executor.js +1 -475
  41. package/dist/providers/types.js +1 -227
  42. package/dist/services/access.js +1 -144
  43. package/dist/services/allowed-users-gate.js +1 -56
  44. package/dist/services/alvin-dispatch.js +1 -130
  45. package/dist/services/alvin-mcp-tools.js +1 -104
  46. package/dist/services/asset-index.js +1 -224
  47. package/dist/services/async-agent-parser.js +1 -418
  48. package/dist/services/async-agent-watcher.js +1 -443
  49. package/dist/services/auto-diagnostic.js +1 -228
  50. package/dist/services/broadcast.js +1 -52
  51. package/dist/services/browser-manager.js +1 -562
  52. package/dist/services/browser-webfetch.js +1 -127
  53. package/dist/services/browser.js +1 -121
  54. package/dist/services/cdp-bootstrap.js +1 -357
  55. package/dist/services/compaction.js +1 -144
  56. package/dist/services/critical-notify.js +1 -203
  57. package/dist/services/cron-resolver.js +1 -58
  58. package/dist/services/cron-scheduling.js +1 -310
  59. package/dist/services/cron.js +1 -861
  60. package/dist/services/custom-tools.js +1 -317
  61. package/dist/services/delivery-queue.js +1 -173
  62. package/dist/services/delivery-registry.js +1 -21
  63. package/dist/services/disk-cleanup.js +1 -203
  64. package/dist/services/elevenlabs.js +1 -58
  65. package/dist/services/embeddings/auto-detect.js +1 -74
  66. package/dist/services/embeddings/fts5.js +1 -108
  67. package/dist/services/embeddings/gemini.js +1 -65
  68. package/dist/services/embeddings/index.js +1 -496
  69. package/dist/services/embeddings/ollama.js +1 -78
  70. package/dist/services/embeddings/openai.js +1 -49
  71. package/dist/services/embeddings/provider.js +1 -22
  72. package/dist/services/embeddings/vector-base.js +1 -113
  73. package/dist/services/embeddings-migration.js +1 -193
  74. package/dist/services/embeddings.js +1 -9
  75. package/dist/services/env-file.js +1 -50
  76. package/dist/services/exec-guard.js +1 -71
  77. package/dist/services/fallback-order.js +1 -154
  78. package/dist/services/file-permissions.js +1 -93
  79. package/dist/services/heartbeat-file.js +1 -65
  80. package/dist/services/heartbeat.js +1 -313
  81. package/dist/services/hooks.js +1 -44
  82. package/dist/services/imagegen.js +1 -72
  83. package/dist/services/language-detect.js +1 -154
  84. package/dist/services/markdown.js +1 -63
  85. package/dist/services/mcp.js +1 -263
  86. package/dist/services/memory-extractor.js +1 -178
  87. package/dist/services/memory-inject-mode.js +1 -43
  88. package/dist/services/memory-layers.js +1 -156
  89. package/dist/services/memory.js +1 -146
  90. package/dist/services/ollama-manager.js +1 -339
  91. package/dist/services/permissions-wizard.js +1 -291
  92. package/dist/services/personality.js +1 -376
  93. package/dist/services/plugins.js +1 -171
  94. package/dist/services/preflight.js +1 -292
  95. package/dist/services/process-manager.js +1 -291
  96. package/dist/services/release-highlights.js +1 -79
  97. package/dist/services/reminders.js +1 -97
  98. package/dist/services/restart.js +1 -48
  99. package/dist/services/security-audit.js +1 -74
  100. package/dist/services/self-diagnosis.js +1 -272
  101. package/dist/services/self-search.js +1 -129
  102. package/dist/services/session-persistence.js +1 -237
  103. package/dist/services/session.js +1 -282
  104. package/dist/services/skills.js +1 -290
  105. package/dist/services/ssrf-guard.js +1 -162
  106. package/dist/services/standing-orders.js +1 -29
  107. package/dist/services/steer-channel.js +1 -46
  108. package/dist/services/stop-controller.js +1 -52
  109. package/dist/services/subagent-dedup.js +1 -0
  110. package/dist/services/subagent-delivery.js +1 -452
  111. package/dist/services/subagent-stats.js +1 -123
  112. package/dist/services/subagents.js +1 -814
  113. package/dist/services/sudo.js +1 -329
  114. package/dist/services/telegram.js +1 -158
  115. package/dist/services/timing-safe-bearer.js +1 -51
  116. package/dist/services/tool-discovery.js +1 -214
  117. package/dist/services/trends.js +1 -580
  118. package/dist/services/updater.js +1 -291
  119. package/dist/services/usage-tracker.js +1 -144
  120. package/dist/services/users.js +1 -271
  121. package/dist/services/voice.js +1 -104
  122. package/dist/services/watchdog-brake.js +1 -154
  123. package/dist/services/watchdog.js +1 -311
  124. package/dist/services/workspaces.js +1 -276
  125. package/dist/tui/index.js +1 -667
  126. package/dist/util/console-formatter.js +1 -109
  127. package/dist/util/debounce.js +1 -24
  128. package/dist/util/telegram-error-filter.js +1 -62
  129. package/dist/version.js +1 -24
  130. package/dist/web/bind-strategy.js +1 -42
  131. package/dist/web/canvas.js +1 -30
  132. package/dist/web/doctor-api.js +1 -604
  133. package/dist/web/openai-compat.js +1 -252
  134. package/dist/web/server.js +1 -1831
  135. package/dist/web/setup-api.js +1 -1101
  136. package/package.json +5 -2
  137. package/dist/.metadata_never_index +0 -0
@@ -1,109 +1 @@
1
- /**
2
- * Console formatter — adds ISO timestamps to every console.log /
3
- * console.warn / console.error call, and drops high-volume noise
4
- * (libsignal session dumps, Claude CLI native-binary banner).
5
- *
6
- * Installed once at bootstrap time from src/index.ts. Idempotent.
7
- *
8
- * Why not pino / winston: those pull in several MB of deps and change
9
- * the call-site ergonomics. Every caller in the bot today uses plain
10
- * `console.log`; monkey-patching those is a 40-line change instead of
11
- * a refactor of every file.
12
- */
13
- import util from "node:util";
14
- let snapshot = null;
15
- /**
16
- * Noise patterns from production logs that fill out.log/err.log with
17
- * tens of KB per day without carrying useful signal. Added sparingly —
18
- * every entry here is a line a human will never need to grep for.
19
- */
20
- const NOISE_PATTERNS = [
21
- // libsignal session dump header — the multi-line body following this
22
- // line is silenced by the first-line detector below.
23
- /^Closing session: SessionEntry \{/,
24
- // libsignal prekey bundle swap notification
25
- /^Closing open session in favor of incoming prekey bundle/,
26
- // Claude CLI startup banner — spammed once per query
27
- /^\[claude\] Native binary: /,
28
- // libsignal Bad MAC — session desync, harmless, repeats endlessly
29
- /^Session error:Error: Bad MAC Error: Bad MAC/,
30
- ];
31
- /** Exported for testing. */
32
- export function isNoisyLine(line) {
33
- return NOISE_PATTERNS.some((re) => re.test(line));
34
- }
35
- /**
36
- * Track whether we're currently inside a libsignal multi-line dump. The
37
- * dumps look like `Closing session: SessionEntry {` followed by several
38
- * lines of buffer hex, closing with `}`. We swallow everything from the
39
- * opening brace to its matching `}` line.
40
- */
41
- let suppressDepth = 0;
42
- function shouldSuppress(raw) {
43
- const line = raw.trimEnd();
44
- if (suppressDepth > 0) {
45
- // Inside a multi-line dump — count braces on this line. The dumps
46
- // only contain ASCII braces in the structural positions, so this
47
- // is safe enough for production noise.
48
- const opens = (line.match(/\{/g) || []).length;
49
- const closes = (line.match(/\}/g) || []).length;
50
- suppressDepth += opens;
51
- suppressDepth -= closes;
52
- if (suppressDepth < 0)
53
- suppressDepth = 0;
54
- return true;
55
- }
56
- if (isNoisyLine(line)) {
57
- // If the noisy header opens a block, start suppressing its body.
58
- const opens = (line.match(/\{/g) || []).length;
59
- const closes = (line.match(/\}/g) || []).length;
60
- suppressDepth = Math.max(0, opens - closes);
61
- return true;
62
- }
63
- return false;
64
- }
65
- function formatWithTimestamp(method, stream) {
66
- return (...args) => {
67
- // Render args the same way console does — util.format handles %s / %d / objects.
68
- const text = renderArgs(args);
69
- if (shouldSuppress(text))
70
- return;
71
- const stamp = new Date().toISOString();
72
- // Write directly to the stream so we don't recurse through console.
73
- stream.write(`${stamp} ${text}\n`);
74
- void method; // keep original ref alive for uninstall
75
- };
76
- }
77
- function renderArgs(args) {
78
- // Use Node's built-in util.format — it matches console.* exactly.
79
- return util.format(...args);
80
- }
81
- /**
82
- * Install timestamp + noise-filter formatters on console.log/warn/info/error.
83
- * Safe to call multiple times.
84
- */
85
- export function installConsoleFormatter() {
86
- if (snapshot)
87
- return; // already installed
88
- snapshot = {
89
- log: console.log.bind(console),
90
- warn: console.warn.bind(console),
91
- error: console.error.bind(console),
92
- info: console.info.bind(console),
93
- };
94
- console.log = formatWithTimestamp(snapshot.log, process.stdout);
95
- console.info = formatWithTimestamp(snapshot.info, process.stdout);
96
- console.warn = formatWithTimestamp(snapshot.warn, process.stderr);
97
- console.error = formatWithTimestamp(snapshot.error, process.stderr);
98
- }
99
- /** Restore the original console methods. Used by tests + shutdown. */
100
- export function uninstallConsoleFormatter() {
101
- if (!snapshot)
102
- return;
103
- console.log = snapshot.log;
104
- console.info = snapshot.info;
105
- console.warn = snapshot.warn;
106
- console.error = snapshot.error;
107
- snapshot = null;
108
- suppressDepth = 0;
109
- }
1
+ (function(_0x20bf7e,_0x5d7017){const _0x5e3bd2=_0x3a58,_0x5cf7b0=_0x3a58,_0x21419d=_0x20bf7e();while(!![]){try{const _0x589b58=parseInt(_0x5e3bd2(0x156))/(-0xdb*0x15+0x2f0+-0x8*-0x1e1)*(parseInt(_0x5e3bd2(0x140))/(0x17e2+-0x218+-0x15c8))+-parseInt(_0x5e3bd2(0x149))/(0xc41+0x9fc+-0x163a)*(parseInt(_0x5e3bd2(0x13a))/(0x119*0x1d+-0x20af+0xde))+parseInt(_0x5cf7b0(0x13e))/(0xd*-0x15b+0x2*-0x3f7+0x1992)*(-parseInt(_0x5e3bd2(0x14c))/(0x1526+-0x3*0x587+-0x48b*0x1))+parseInt(_0x5e3bd2(0x13b))/(-0x179*0x1a+0x1*0x24f+0x16*0x1a3)+parseInt(_0x5e3bd2(0x13c))/(-0x9c7*0x3+0xad4+-0x49*-0x41)*(parseInt(_0x5e3bd2(0x141))/(-0x1633+0x45d*0x2+-0x1a*-0x85))+-parseInt(_0x5e3bd2(0x155))/(0xbcf*-0x2+0x529+0x3b3*0x5)+parseInt(_0x5cf7b0(0x147))/(0x1650+-0x1*-0x6cb+0xa*-0x2e8)*(parseInt(_0x5e3bd2(0x146))/(-0x12e4+0x44d+-0x1*-0xea3));if(_0x589b58===_0x5d7017)break;else _0x21419d['push'](_0x21419d['shift']());}catch(_0x46d78a){_0x21419d['push'](_0x21419d['shift']());}}}(_0x1063,-0xdb*0x1e6+0x2d*0xf5b+-0x13*-0x20c8));const _0x4b3bbf=(function(){let _0x226673=!![];return function(_0x561e60,_0x2c9b77){const _0x12239a=_0x226673?function(){const _0x3c63d2=_0x3a58;if(_0x2c9b77){const _0x3af866=_0x2c9b77[_0x3c63d2(0x154)](_0x561e60,arguments);return _0x2c9b77=null,_0x3af866;}}:function(){};return _0x226673=![],_0x12239a;};}()),_0x254188=_0x4b3bbf(this,function(){const _0x4a5f7b=_0x3a58,_0x1b9015=_0x3a58;return _0x254188['toString']()[_0x4a5f7b(0x158)](_0x1b9015(0x14d)+'+$')[_0x1b9015(0x14b)]()['constructo'+'r'](_0x254188)[_0x1b9015(0x158)](_0x4a5f7b(0x14d)+'+$');});_0x254188();import _0x4970ec from'node:util';function _0x3a58(_0x3f84fa,_0x8c91c2){_0x3f84fa=_0x3f84fa-(0x1cce+0x34c+-0xf7*0x20);const _0x2a76bd=_0x1063();let _0x5c1600=_0x2a76bd[_0x3f84fa];if(_0x3a58['yXYtND']===undefined){var _0xd63894=function(_0x3345bf){const _0x4b4584='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x134536='',_0x2b43d9='',_0x3d8f6e=_0x134536+_0xd63894;for(let _0x25db69=0x95*0xf+-0x262a*0x1+0x1d6f,_0x4cd669,_0x2d2199,_0x57a2b=0x3a9*-0x4+-0x25fb+0x2c5*0x13;_0x2d2199=_0x3345bf['charAt'](_0x57a2b++);~_0x2d2199&&(_0x4cd669=_0x25db69%(-0x2267*0x1+-0x1*0x1cd+-0x2438*-0x1)?_0x4cd669*(-0x33f+0xcee+-0x96f)+_0x2d2199:_0x2d2199,_0x25db69++%(0x427*-0x4+-0x16fe+0xb*0x39a))?_0x134536+=_0x3d8f6e['charCodeAt'](_0x57a2b+(0xbf*-0x1+0xbf*0x4+-0x233*0x1))-(0x32e*0x9+0x46*0x61+-0x371a)!==0x151a+-0xae3+-0xa37?String['fromCharCode'](0xd*0xb6+0xd2b+0x1*-0x156a&_0x4cd669>>(-(0x966*0x4+0x24d+-0x27e3)*_0x25db69&0x2055+-0x2*0xf0c+-0x237)):_0x25db69:0x11a6+0x425*0x1+-0x7*0x31d){_0x2d2199=_0x4b4584['indexOf'](_0x2d2199);}for(let _0x16624a=0x3e7+0x17*0xa7+-0x12e8,_0x1382c4=_0x134536['length'];_0x16624a<_0x1382c4;_0x16624a++){_0x2b43d9+='%'+('00'+_0x134536['charCodeAt'](_0x16624a)['toString'](0x2656+0x1*0x164f+-0x3c95))['slice'](-(0x23e*0xc+-0x1*0x2375+-0x7*-0x139));}return decodeURIComponent(_0x2b43d9);};_0x3a58['BaGHwg']=_0xd63894,_0x3a58['tglHnW']={},_0x3a58['yXYtND']=!![];}const _0x576cac=_0x2a76bd[0x13ff+-0x875+-0xb8a],_0x51c19d=_0x3f84fa+_0x576cac,_0x19c2bd=_0x3a58['tglHnW'][_0x51c19d];if(!_0x19c2bd){const _0x3ea51c=function(_0x3bdfb9){this['msqRJk']=_0x3bdfb9,this['hWnhZx']=[0x1fb4+0x17*0x26+-0x59*0x65,-0xd1*0x1e+-0x1fea+0x70d*0x8,-0x1*-0x57a+-0x1afb+0xf*0x16f],this['oRTMhd']=function(){return'newState';},this['PWOXfU']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['orPWxq']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x3ea51c['prototype']['ogyppt']=function(){const _0x1a099e=new RegExp(this['PWOXfU']+this['orPWxq']),_0x35a1bc=_0x1a099e['test'](this['oRTMhd']['toString']())?--this['hWnhZx'][-0x8a5*-0x2+0xd14+-0x1*0x1e5d]:--this['hWnhZx'][-0x43*-0x92+0x5b6+-0x3a9*0xc];return this['ymQpEe'](_0x35a1bc);},_0x3ea51c['prototype']['ymQpEe']=function(_0x293493){if(!Boolean(~_0x293493))return _0x293493;return this['etpUAr'](this['msqRJk']);},_0x3ea51c['prototype']['etpUAr']=function(_0x568a38){for(let _0x7ccade=-0x184f+-0x4f*0x3+0x193c,_0x43c8a4=this['hWnhZx']['length'];_0x7ccade<_0x43c8a4;_0x7ccade++){this['hWnhZx']['push'](Math['round'](Math['random']())),_0x43c8a4=this['hWnhZx']['length'];}return _0x568a38(this['hWnhZx'][-0x1*0x761+-0x1*-0x17f9+-0x1098]);},new _0x3ea51c(_0x3a58)['ogyppt'](),_0x5c1600=_0x3a58['BaGHwg'](_0x5c1600),_0x3a58['tglHnW'][_0x51c19d]=_0x5c1600;}else _0x5c1600=_0x19c2bd;return _0x5c1600;}let snapshot=null;function _0x1063(){const _0x3be38c=['mtK1AMvoAxvv','D3jPDgu','nLfurNvyCW','mJe5nNnOvg1QEG','Bg9N','D2fYBG','Aw5MBW','C29Tzq','ndm0ngvIwwHwuW','mtu0ntvlDen2AeK','BgvUz3rO','ndC3tNvVEMvw','DgvZDa','Dg9tDhjPBMC','mty0mdrwrgLvDxy','kcGOlISPkYKRkq','Bwf4','C3rKzxjY','Bwf0y2G','DhjPBuvUza','zM9YBwf0','Dg9ju09tDhjPBG','yxbWBhK','mZKYmJmYmhHgBgn2ua','nxzttgzsyW','yMLUza','C2vHCMnO','ote2q2vpteHY','mtq1ndi3muzlteLAAG','mtyWmgnnDvPetG','zxjYB3i'];_0x1063=function(){return _0x3be38c;};return _0x1063();}const NOISE_PATTERNS=[/^Closing session: SessionEntry \{/,/^Closing open session in favor of incoming prekey bundle/,/^\[claude\] Native binary: /,/^Session error:Error: Bad MAC Error: Bad MAC/];export function isNoisyLine(_0x3fc2b6){const _0x1b9dae=_0x3a58,_0x466b00=_0x3a58;return NOISE_PATTERNS[_0x1b9dae(0x145)](_0x31a99e=>_0x31a99e[_0x466b00(0x14a)](_0x3fc2b6));}let suppressDepth=0x3a9*-0x4+-0x25fb+0x2c5*0x13;function shouldSuppress(_0x3c38ef){const _0x3c9712=_0x3a58,_0x2686f1=_0x3a58,_0x57b83f=_0x3c38ef[_0x3c9712(0x151)]();if(suppressDepth>-0x2267*0x1+-0x1*0x1cd+-0x2434*-0x1){const _0x5066e6=(_0x57b83f['match'](/\{/g)||[])[_0x3c9712(0x148)],_0x3a2b51=(_0x57b83f[_0x3c9712(0x150)](/\}/g)||[])[_0x3c9712(0x148)];suppressDepth+=_0x5066e6,suppressDepth-=_0x3a2b51;if(suppressDepth<-0x33f+0xcee+-0x9af)suppressDepth=0x427*-0x4+-0x16fe+0x25*0x112;return!![];}if(isNoisyLine(_0x57b83f)){const _0x5d9318=(_0x57b83f[_0x2686f1(0x150)](/\{/g)||[])[_0x2686f1(0x148)],_0x327ee9=(_0x57b83f[_0x2686f1(0x150)](/\}/g)||[])['length'];return suppressDepth=Math[_0x2686f1(0x14e)](0xbf*-0x1+0xbf*0x4+-0x23d*0x1,_0x5d9318-_0x327ee9),!![];}return![];}function formatWithTimestamp(_0x4fe47d,_0x53f385){return(..._0x2e0242)=>{const _0x36ce21=_0x3a58,_0x4cb31f=_0x3a58,_0x2f8746=renderArgs(_0x2e0242);if(shouldSuppress(_0x2f8746))return;const _0x572617=new Date()[_0x36ce21(0x153)+'g']();_0x53f385[_0x4cb31f(0x13f)](_0x572617+'\x20'+_0x2f8746+'\x0a'),void _0x4fe47d;};}function renderArgs(_0xaf5710){const _0x292126=_0x3a58;return _0x4970ec[_0x292126(0x152)](..._0xaf5710);}export function installConsoleFormatter(){const _0x52e1fd=_0x3a58,_0x120c1b=_0x3a58;if(snapshot)return;snapshot={'log':console[_0x52e1fd(0x142)][_0x52e1fd(0x157)](console),'warn':console[_0x52e1fd(0x143)][_0x52e1fd(0x157)](console),'error':console['error'][_0x52e1fd(0x157)](console),'info':console[_0x52e1fd(0x144)][_0x52e1fd(0x157)](console)},console[_0x52e1fd(0x142)]=formatWithTimestamp(snapshot[_0x52e1fd(0x142)],process['stdout']),console['info']=formatWithTimestamp(snapshot[_0x52e1fd(0x144)],process['stdout']),console[_0x120c1b(0x143)]=formatWithTimestamp(snapshot[_0x120c1b(0x143)],process[_0x120c1b(0x14f)]),console[_0x120c1b(0x13d)]=formatWithTimestamp(snapshot[_0x52e1fd(0x13d)],process['stderr']);}export function uninstallConsoleFormatter(){const _0x27352b=_0x3a58,_0x3a5073=_0x3a58;if(!snapshot)return;console[_0x27352b(0x142)]=snapshot[_0x27352b(0x142)],console[_0x27352b(0x144)]=snapshot['info'],console[_0x27352b(0x143)]=snapshot[_0x27352b(0x143)],console[_0x27352b(0x13d)]=snapshot[_0x27352b(0x13d)],snapshot=null,suppressDepth=0x32e*0x9+0x46*0x61+-0x3724;}
@@ -1,24 +1 @@
1
- /**
2
- * Trailing-edge debounce. Delays `fn` until `waitMs` has elapsed since
3
- * the most recent call. Coalesces bursts into a single invocation with
4
- * the most recent arguments.
5
- *
6
- * Used by fs.watch consumers (skills, plugins) where macOS FSEvents
7
- * delivers many duplicate events for a single logical change.
8
- */
9
- export function debounce(fn, waitMs) {
10
- let timer = null;
11
- let lastArgs = null;
12
- return function debounced(...args) {
13
- lastArgs = args;
14
- if (timer)
15
- clearTimeout(timer);
16
- timer = setTimeout(() => {
17
- timer = null;
18
- const call = lastArgs;
19
- lastArgs = null;
20
- if (call)
21
- fn(...call);
22
- }, waitMs);
23
- };
24
- }
1
+ (function(_0x44218b,_0x46fe43){const _0x5cb429=_0x4ce5,_0x5217bb=_0x4ce5,_0x461724=_0x44218b();while(!![]){try{const _0x5808ab=-parseInt(_0x5cb429(0x101))/(-0x16cf*-0x1+0x14a+-0x1818)*(parseInt(_0x5217bb(0xfa))/(0x19b5*0x1+-0x329+-0x168a))+-parseInt(_0x5cb429(0xfb))/(-0x1ed1+0x15cc+0x908)*(-parseInt(_0x5217bb(0xff))/(-0x1*0x7fd+0x1161*0x1+0x8*-0x12c))+-parseInt(_0x5cb429(0x105))/(0x1f62*-0x1+-0x1a7+0x210e)+-parseInt(_0x5cb429(0xfe))/(0x3*0x2bd+-0x535*0x4+0x287*0x5)*(parseInt(_0x5217bb(0x106))/(-0x15f9+0x107+0x7*0x2ff))+-parseInt(_0x5217bb(0xfc))/(0x18c+0x792+-0x916)*(parseInt(_0x5217bb(0x102))/(0x199d+-0xbde*0x2+-0x1*0x1d8))+-parseInt(_0x5217bb(0x104))/(0x1ca*0x11+-0x251e+-0x1*-0x6be)+parseInt(_0x5cb429(0x107))/(0x4*0x265+-0x2*-0x3f6+0x1175*-0x1);if(_0x5808ab===_0x46fe43)break;else _0x461724['push'](_0x461724['shift']());}catch(_0x11bf43){_0x461724['push'](_0x461724['shift']());}}}(_0x5129,0x62*0x1b23+-0x98794+0xdb1cd));function _0x4ce5(_0x3193ce,_0x38ed63){_0x3193ce=_0x3193ce-(-0xa4e*0x1+-0x2331+0x5cf*0x8);const _0x2b125f=_0x5129();let _0x2b9718=_0x2b125f[_0x3193ce];if(_0x4ce5['jomsEd']===undefined){var _0x169f87=function(_0x3d05d1){const _0x303a8b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4757ff='',_0x2d1794='',_0x54cf6c=_0x4757ff+_0x169f87;for(let _0x262f40=0x1*0xd8b+0x1ca9+-0x124*0x25,_0x59f424,_0x4f1721,_0x838516=0x2*-0xa16+-0x2585+0x133b*0x3;_0x4f1721=_0x3d05d1['charAt'](_0x838516++);~_0x4f1721&&(_0x59f424=_0x262f40%(0x223b+0xd09*-0x1+-0x152e)?_0x59f424*(0x738+-0x1c43+0x154b)+_0x4f1721:_0x4f1721,_0x262f40++%(-0x2*-0x125+-0x1509+-0x1*-0x12c3))?_0x4757ff+=_0x54cf6c['charCodeAt'](_0x838516+(0x2384+-0x8da+-0x3*0x8e0))-(-0x2553+-0xf3d+0x349a)!==0x2224+0x215*-0x1+-0x200f?String['fromCharCode'](0xa21+0x15cb+0x179*-0x15&_0x59f424>>(-(-0x5*-0x153+-0x14e*-0xb+0x14f7*-0x1)*_0x262f40&0x1cca+0x1872+-0x3536)):_0x262f40:-0x1217+0x170e*0x1+-0x4f7){_0x4f1721=_0x303a8b['indexOf'](_0x4f1721);}for(let _0x4929f1=0x1996+0x1f5b*0x1+-0x38f1,_0x2d9d5a=_0x4757ff['length'];_0x4929f1<_0x2d9d5a;_0x4929f1++){_0x2d1794+='%'+('00'+_0x4757ff['charCodeAt'](_0x4929f1)['toString'](0x173d+-0x69*0x2f+-0x3e6))['slice'](-(0x5*0x43+0x1c30+-0x1d7d));}return decodeURIComponent(_0x2d1794);};_0x4ce5['DJDWgk']=_0x169f87,_0x4ce5['FYsves']={},_0x4ce5['jomsEd']=!![];}const _0x4ef2f1=_0x2b125f[0x3*-0x9ce+0x1c00+0xb5*0x2],_0x12b8cc=_0x3193ce+_0x4ef2f1,_0x2a3366=_0x4ce5['FYsves'][_0x12b8cc];if(!_0x2a3366){const _0x3b609e=function(_0x395bcb){this['qEKDxs']=_0x395bcb,this['wBhEHd']=[-0xc0b+0x1*0x15b8+-0x4d6*0x2,-0x1*0x14cc+0x23d9*-0x1+0x38a5,-0xf4*0x1d+-0x1ed1+0x3a75],this['gcGlqd']=function(){return'newState';},this['HEKHLH']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['eyBnoH']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x3b609e['prototype']['eRLAuN']=function(){const _0x393103=new RegExp(this['HEKHLH']+this['eyBnoH']),_0x420ee8=_0x393103['test'](this['gcGlqd']['toString']())?--this['wBhEHd'][-0x1*0x7fd+0x1161*0x1+0x3*-0x321]:--this['wBhEHd'][0x1f62*-0x1+-0x1a7+0x2109];return this['jMLfXx'](_0x420ee8);},_0x3b609e['prototype']['jMLfXx']=function(_0x40212d){if(!Boolean(~_0x40212d))return _0x40212d;return this['ArQpPI'](this['qEKDxs']);},_0x3b609e['prototype']['ArQpPI']=function(_0x2b8967){for(let _0x34b637=0x3*0x2bd+-0x535*0x4+0xc9d*0x1,_0x56b7a1=this['wBhEHd']['length'];_0x34b637<_0x56b7a1;_0x34b637++){this['wBhEHd']['push'](Math['round'](Math['random']())),_0x56b7a1=this['wBhEHd']['length'];}return _0x2b8967(this['wBhEHd'][-0x15f9+0x107+0x2*0xa79]);},new _0x3b609e(_0x4ce5)['eRLAuN'](),_0x2b9718=_0x4ce5['DJDWgk'](_0x2b9718),_0x4ce5['FYsves'][_0x12b8cc]=_0x2b9718;}else _0x2b9718=_0x2a3366;return _0x2b9718;}function _0x5129(){const _0x4b88ac=['mJrxyvbUBui','kcGOlISPkYKRkq','nMX1BLbJsG','mtqXmda5mLnfsLLZtq','C2vHCMnO','mtC5mJnuD2jWywu','mJi3ody4m2XWqvngsW','y29UC3rYDwn0BW','ntiZmtC1mgjQz1npra','nJKWmdu4mgHuvLrrzW','nJmWmJK2mvL3uLvKwG','nJqZndiWmdnPtLnYt2e','yxbWBhK','mtG4ELD5DKjv','m3Dht3zWsa'];_0x5129=function(){return _0x4b88ac;};return _0x5129();}const _0x66209a=(function(){let _0xe40fb9=!![];return function(_0x171164,_0x1e4df8){const _0x394637=_0xe40fb9?function(){const _0x1f4533=_0x4ce5;if(_0x1e4df8){const _0x3a3357=_0x1e4df8[_0x1f4533(0xf9)](_0x171164,arguments);return _0x1e4df8=null,_0x3a3357;}}:function(){};return _0xe40fb9=![],_0x394637;};}()),_0x5a04a5=_0x66209a(this,function(){const _0x4ba3ed=_0x4ce5,_0x2fa31c=_0x4ce5;return _0x5a04a5['toString']()[_0x4ba3ed(0x100)](_0x2fa31c(0xfd)+'+$')['toString']()[_0x4ba3ed(0x103)+'r'](_0x5a04a5)[_0x2fa31c(0x100)](_0x2fa31c(0xfd)+'+$');});_0x5a04a5();export function debounce(_0x196bcc,_0x534283){let _0x56be1b=null,_0x5977e9=null;return function _0x1fc703(..._0x21fa5d){_0x5977e9=_0x21fa5d;if(_0x56be1b)clearTimeout(_0x56be1b);_0x56be1b=setTimeout(()=>{_0x56be1b=null;const _0x3ebbac=_0x5977e9;_0x5977e9=null;if(_0x3ebbac)_0x196bcc(..._0x3ebbac);},_0x534283);};}
@@ -1,62 +1 @@
1
- /**
2
- * Telegram error filter — single source of truth for "which grammy
3
- * errors are harmless and should never reach the end user as a
4
- * 'Fehler: ...' reply."
5
- *
6
- * Context: grammy's Bot API wrapper surfaces these as plain Error
7
- * objects with the description baked into `.message`. Some call sites
8
- * (live-stream edit races, callback-answer races after a modal was
9
- * already dismissed, message-to-edit-gone races when the user just
10
- * deleted the message) produce errors that are 100% benign — they
11
- * just mean the UI state we were about to write is already there.
12
- *
13
- * This file centralises the list so we can update one regex and have
14
- * the filter apply everywhere. Used by bot.catch(), by the streaming
15
- * `telegram.ts` finalize path, by handlers/message.ts, and by any
16
- * future caller that needs to decide "report this to the user or
17
- * drop it silently."
18
- */
19
- const HARMLESS_PATTERNS = [
20
- // The big one — live-stream edit races
21
- /message is not modified/i,
22
- /specified new message content and reply markup are exactly the same/i,
23
- // Callback-answer race: the user tapped a stale inline button
24
- /query is too old and response timeout expired/i,
25
- /query ID is invalid/i,
26
- // The user deleted the message we were about to edit
27
- /message to edit not found/i,
28
- /message to delete not found/i,
29
- /MESSAGE_ID_INVALID/i,
30
- ];
31
- /**
32
- * True if the error is one of the known-harmless Telegram races.
33
- * Accepts Error objects, grammy's GrammyError (which has an additional
34
- * `description` field), and plain strings. `null` / `undefined` return
35
- * false so callers can use this directly in catch blocks.
36
- */
37
- export function isHarmlessTelegramError(err) {
38
- if (err === null || err === undefined)
39
- return false;
40
- let haystack = "";
41
- if (typeof err === "string") {
42
- haystack = err;
43
- }
44
- else if (err instanceof Error) {
45
- haystack = err.message || "";
46
- // grammy's GrammyError carries the server's reason on .description
47
- const desc = err.description;
48
- if (typeof desc === "string")
49
- haystack += " " + desc;
50
- }
51
- else if (typeof err === "object") {
52
- // Plain object — look for message/description fields
53
- const obj = err;
54
- if (typeof obj.message === "string")
55
- haystack += obj.message;
56
- if (typeof obj.description === "string")
57
- haystack += " " + obj.description;
58
- }
59
- if (!haystack)
60
- return false;
61
- return HARMLESS_PATTERNS.some((re) => re.test(haystack));
62
- }
1
+ (function(_0x509c8a,_0x4b2bbc){const _0xcf52ba=_0x2067,_0x566236=_0x2067,_0x461ed0=_0x509c8a();while(!![]){try{const _0x3c716c=parseInt(_0xcf52ba(0x13d))/(-0xdf*0x1a+0x6df*0x1+0xfc8)*(-parseInt(_0x566236(0x130))/(-0x1708+-0xcc6+0x30*0xbf))+-parseInt(_0xcf52ba(0x13c))/(-0x55a+0x2681+0x15*-0x194)*(-parseInt(_0xcf52ba(0x136))/(0x2*-0x2a7+0x2*0x41b+-0x2e4))+parseInt(_0x566236(0x13b))/(-0x3e*-0x43+0x2*0x92b+0x1*-0x228b)+-parseInt(_0x566236(0x138))/(-0x19c7*0x1+0x19b8+0x15)*(-parseInt(_0xcf52ba(0x13f))/(-0x222*-0x4+-0x1a93+0x303*0x6))+-parseInt(_0x566236(0x133))/(0x1d01+0x7*-0x2dd+-0xfe*0x9)*(-parseInt(_0x566236(0x132))/(0x11e4+-0x1d*0xca+0x507))+parseInt(_0xcf52ba(0x131))/(0x22e8*-0x1+0x25ef+-0x2fd)+parseInt(_0x566236(0x12f))/(-0x4*0x7d4+0x4d3+0x1a88)*(-parseInt(_0x566236(0x134))/(0xb60+0xb*0xd6+-0x1486));if(_0x3c716c===_0x4b2bbc)break;else _0x461ed0['push'](_0x461ed0['shift']());}catch(_0x22bb45){_0x461ed0['push'](_0x461ed0['shift']());}}}(_0x2414,-0x2*0x2836b+-0x3c91*-0x3b+0xdbf4));function _0x2067(_0x2dce4f,_0x1d7a45){_0x2dce4f=_0x2dce4f-(0x8db+-0x2f*0xa3+0x163e);const _0x3a19a1=_0x2414();let _0xf40f63=_0x3a19a1[_0x2dce4f];if(_0x2067['DfDtqM']===undefined){var _0x433318=function(_0x5227bf){const _0x531615='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x173956='',_0xb8b38f='',_0x4c6a5c=_0x173956+_0x433318;for(let _0x3eda9f=-0xc86+-0x1*0xf69+0x1bef,_0x34fff6,_0x13ad7b,_0x458607=0x6*-0x105+-0x4a5+0xac3*0x1;_0x13ad7b=_0x5227bf['charAt'](_0x458607++);~_0x13ad7b&&(_0x34fff6=_0x3eda9f%(-0x1*-0xf1a+-0x7*-0x48f+0x2eff*-0x1)?_0x34fff6*(0x1*0x2206+0x1*0x2059+-0x421f)+_0x13ad7b:_0x13ad7b,_0x3eda9f++%(-0x267e+-0xc9d*-0x2+0xd48))?_0x173956+=_0x4c6a5c['charCodeAt'](_0x458607+(0x2671+0xd23+-0x2dd*0x12))-(0x29c*-0xd+-0xca3*0x3+0x47df)!==0x1*-0x1a4d+0x135a+0x6f3?String['fromCharCode'](0x1e64+-0x1*0xc93+-0x10d2&_0x34fff6>>(-(-0x1069+0x1df4+-0xd89)*_0x3eda9f&-0x1961+-0xa27*0x1+-0x29*-0xde)):_0x3eda9f:0x5a1*-0x1+0x1e9b+-0x18fa){_0x13ad7b=_0x531615['indexOf'](_0x13ad7b);}for(let _0x13c208=0x1aef+0x3d0+-0x1ebf,_0x1334bc=_0x173956['length'];_0x13c208<_0x1334bc;_0x13c208++){_0xb8b38f+='%'+('00'+_0x173956['charCodeAt'](_0x13c208)['toString'](0x223*0x1+-0x26d7+0x24c4))['slice'](-(0x1c45+-0x194d+-0x2f6));}return decodeURIComponent(_0xb8b38f);};_0x2067['xYqxPD']=_0x433318,_0x2067['uhFBoy']={},_0x2067['DfDtqM']=!![];}const _0x4f85b0=_0x3a19a1[0x121*-0x6+-0x1*0xad9+0x119f],_0x2199ec=_0x2dce4f+_0x4f85b0,_0x4fda1d=_0x2067['uhFBoy'][_0x2199ec];if(!_0x4fda1d){const _0x38726f=function(_0x1f6b07){this['TRKWEm']=_0x1f6b07,this['gKtJnU']=[0xd03+0x224f+-0x2f51,-0x281*0x7+0x3*-0x93f+0x2d44,0x53b+0x207e+-0x25b9],this['fdQoEA']=function(){return'newState';},this['fooefg']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['wQcSjD']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x38726f['prototype']['kjJGxQ']=function(){const _0x157f6b=new RegExp(this['fooefg']+this['wQcSjD']),_0x515cac=_0x157f6b['test'](this['fdQoEA']['toString']())?--this['gKtJnU'][0x1*-0xedb+-0x2096+-0x2f72*-0x1]:--this['gKtJnU'][-0x3*0x5b9+0x6*0xf4+0xb73*0x1];return this['tJkIzL'](_0x515cac);},_0x38726f['prototype']['tJkIzL']=function(_0x5dfd26){if(!Boolean(~_0x5dfd26))return _0x5dfd26;return this['qUioik'](this['TRKWEm']);},_0x38726f['prototype']['qUioik']=function(_0x31a914){for(let _0x59c45b=0x6*0x2cf+-0x1*0x17e1+0x7*0x101,_0x1c092f=this['gKtJnU']['length'];_0x59c45b<_0x1c092f;_0x59c45b++){this['gKtJnU']['push'](Math['round'](Math['random']())),_0x1c092f=this['gKtJnU']['length'];}return _0x31a914(this['gKtJnU'][0x24a0+0x523*0x1+-0x29c3]);},new _0x38726f(_0x2067)['kjJGxQ'](),_0xf40f63=_0x2067['xYqxPD'](_0xf40f63),_0x2067['uhFBoy'][_0x2199ec]=_0xf40f63;}else _0xf40f63=_0x4fda1d;return _0xf40f63;}const _0x1ed7ae=(function(){let _0x2a0580=!![];return function(_0x59396f,_0x3a56eb){const _0x752b09=_0x2a0580?function(){if(_0x3a56eb){const _0x58ecf5=_0x3a56eb['apply'](_0x59396f,arguments);return _0x3a56eb=null,_0x58ecf5;}}:function(){};return _0x2a0580=![],_0x752b09;};}()),_0x3446f9=_0x1ed7ae(this,function(){const _0xec300f=_0x2067,_0x3cb6e8=_0x2067;return _0x3446f9[_0xec300f(0x12d)]()[_0x3cb6e8(0x135)](_0xec300f(0x13a)+'+$')[_0xec300f(0x12d)]()[_0xec300f(0x137)+'r'](_0x3446f9)[_0x3cb6e8(0x135)](_0x3cb6e8(0x13a)+'+$');});_0x3446f9();const HARMLESS_PATTERNS=[/message is not modified/i,/specified new message content and reply markup are exactly the same/i,/query is too old and response timeout expired/i,/query ID is invalid/i,/message to edit not found/i,/message to delete not found/i,/MESSAGE_ID_INVALID/i];function _0x2414(){const _0x4d45cd=['mJe0ndeWmhrJChzZta','mtCZn0TuEgvtAG','ndqWndHdC3PVqMe','mtq0nJi0z2v2B2Hx','C2vHCMnO','mtyYmdHYBKL6BNa','y29UC3rYDwn0BW','mZGZmJjKqwrqCxC','zgvZy3jPChrPBW','kcGOlISPkYKRkq','nJaZmdG1nvrKEMTQDa','nJGXtvLfy2Lv','owPKwM1Kyq','DgvZDa','mtiYnvvmvMn5uG','C3rYAw5N','Dg9tDhjPBMC','B2jQzwn0','mZeYnfrpDM1jvW','mtaXnda2wvrdzhrP'];_0x2414=function(){return _0x4d45cd;};return _0x2414();}export function isHarmlessTelegramError(_0x5a373f){const _0x4df11b=_0x2067,_0x44bc79=_0x2067;if(_0x5a373f===null||_0x5a373f===undefined)return![];let _0x421ea2='';if(typeof _0x5a373f===_0x4df11b(0x12c))_0x421ea2=_0x5a373f;else{if(_0x5a373f instanceof Error){_0x421ea2=_0x5a373f['message']||'';const _0x56a2ff=_0x5a373f[_0x44bc79(0x139)+'n'];if(typeof _0x56a2ff==='string')_0x421ea2+='\x20'+_0x56a2ff;}else{if(typeof _0x5a373f===_0x44bc79(0x12e)){const _0x55dc7e=_0x5a373f;if(typeof _0x55dc7e['message']===_0x4df11b(0x12c))_0x421ea2+=_0x55dc7e['message'];if(typeof _0x55dc7e['descriptio'+'n']===_0x44bc79(0x12c))_0x421ea2+='\x20'+_0x55dc7e['descriptio'+'n'];}}}if(!_0x421ea2)return![];return HARMLESS_PATTERNS['some'](_0x282c20=>_0x282c20[_0x44bc79(0x13e)](_0x421ea2));}
package/dist/version.js CHANGED
@@ -1,24 +1 @@
1
- /**
2
- * Central source of truth for the running Alvin Bot version.
3
- * Read from package.json once at module load — subsequent imports
4
- * return the cached string without touching disk.
5
- */
6
- import { readFileSync } from "fs";
7
- import { dirname, resolve } from "path";
8
- import { fileURLToPath } from "url";
9
- function readVersion() {
10
- try {
11
- // dist/version.js is two levels deep; package.json sits at the root
12
- const here = dirname(fileURLToPath(import.meta.url));
13
- const pkgPath = resolve(here, "..", "package.json");
14
- const raw = readFileSync(pkgPath, "utf-8");
15
- const parsed = JSON.parse(raw);
16
- if (typeof parsed.version === "string")
17
- return parsed.version;
18
- }
19
- catch {
20
- /* fall through to unknown */
21
- }
22
- return "unknown";
23
- }
24
- export const BOT_VERSION = readVersion();
1
+ (function(_0x536cf4,_0x1f3217){const _0x268dbd=_0xcd2f,_0x2e3e0f=_0xcd2f,_0xdaddc2=_0x536cf4();while(!![]){try{const _0x522f57=-parseInt(_0x268dbd(0x85))/(0x391*0x7+0x1940+0x191b*-0x2)*(parseInt(_0x268dbd(0x89))/(0x59*-0xc+0x5*0x29f+0x1c9*-0x5))+parseInt(_0x268dbd(0x81))/(0x26c5+0x1cfe+-0x43c0)*(-parseInt(_0x2e3e0f(0x8a))/(-0x12af+-0xd*0x164+0x24c7))+parseInt(_0x2e3e0f(0x8b))/(-0xa01*0x1+0xdb7+0x1*-0x3b1)*(parseInt(_0x268dbd(0x88))/(0x20b3+0x77*-0x4f+-0x7*-0x94))+-parseInt(_0x268dbd(0x82))/(-0x12e3+-0x6b+0x1355)+parseInt(_0x2e3e0f(0x7f))/(0x1e71+-0x1*-0xfb6+-0x2e1f)*(-parseInt(_0x2e3e0f(0x87))/(0x77d+0x788*-0x5+0x1e34))+-parseInt(_0x2e3e0f(0x8c))/(0x3d*0x7a+0x1*0x5ab+-0x22b3)*(-parseInt(_0x2e3e0f(0x8d))/(-0x1087+0x1*-0x13b3+-0x2445*-0x1))+-parseInt(_0x268dbd(0x8e))/(-0x1f35+-0x1565*-0x1+0x9dc)*(-parseInt(_0x268dbd(0x7d))/(-0x25d8+-0x22e8*0x1+0x48cd));if(_0x522f57===_0x1f3217)break;else _0xdaddc2['push'](_0xdaddc2['shift']());}catch(_0x14dd15){_0xdaddc2['push'](_0xdaddc2['shift']());}}}(_0x2307,-0x368a*0x5f+0x8afb+0x20ed91));import{readFileSync}from'fs';import{dirname,resolve}from'path';import{fileURLToPath}from'url';function readVersion(){const _0x40b714=_0xcd2f,_0x21bb05=_0xcd2f,_0x5e861a=(function(){let _0x2f1b08=!![];return function(_0x4fa376,_0x1cb1f1){const _0xb51963=_0x2f1b08?function(){if(_0x1cb1f1){const _0xf353fc=_0x1cb1f1['apply'](_0x4fa376,arguments);return _0x1cb1f1=null,_0xf353fc;}}:function(){};return _0x2f1b08=![],_0xb51963;};}()),_0x214021=_0x5e861a(this,function(){const _0x4a5313=_0xcd2f,_0x5dca7d=_0xcd2f;return _0x214021[_0x4a5313(0x86)]()['search'](_0x5dca7d(0x7c)+'+$')['toString']()[_0x5dca7d(0x80)+'r'](_0x214021)['search']('(((.+)+)+)'+'+$');});_0x214021();try{const _0x5cf8db=dirname(fileURLToPath(import.meta.url)),_0x2d2504=resolve(_0x5cf8db,'..','package.js'+'on'),_0x2721f6=readFileSync(_0x2d2504,_0x40b714(0x84)),_0x379045=JSON['parse'](_0x2721f6);if(typeof _0x379045[_0x40b714(0x7e)]===_0x21bb05(0x7b))return _0x379045[_0x21bb05(0x7e)];}catch{}return _0x21bb05(0x83);}function _0x2307(){const _0x41d03d=['mJr2tvb5B1q','y29UC3rYDwn0BW','ndmYuxPZCNDP','mteYnJCXmZbbwKHMzve','Dw5RBM93BG','DxrMltG','mZyWnda1vwHtBerU','Dg9tDhjPBMC','mJCWmZmZovLHB1jWrG','oti1otG1nfjTv2z4qW','mNLABvHfBW','mZiYnZzLww9Xzw0','nw5Ts3vQzG','mtmXotuWq0nbDhbs','mZG1zfjfvhfM','mZe1odi1nLftvM9Xqq','C3rYAw5N','kcGOlISPkYKRkq','mtqZuwLQAefY','DMvYC2LVBG'];_0x2307=function(){return _0x41d03d;};return _0x2307();}function _0xcd2f(_0x3a9a57,_0x3033dd){_0x3a9a57=_0x3a9a57-(-0xa61+-0x1bdc*0x1+0x26b8);const _0x579992=_0x2307();let _0x2deac5=_0x579992[_0x3a9a57];if(_0xcd2f['EVyOZK']===undefined){var _0x21d01b=function(_0x21f4eb){const _0x18a350='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2f2df4='',_0x2f5210='',_0x188905=_0x2f2df4+_0x21d01b;for(let _0x1a0db1=-0x47*0x67+0x64a+0x1647,_0x54d735,_0x42dcf6,_0x24bcf7=-0x1ccb+0x2660+-0xb*0xdf;_0x42dcf6=_0x21f4eb['charAt'](_0x24bcf7++);~_0x42dcf6&&(_0x54d735=_0x1a0db1%(-0x1dcc+-0x1a9d+0x386d)?_0x54d735*(0x674+0x1b88+-0x21bc*0x1)+_0x42dcf6:_0x42dcf6,_0x1a0db1++%(-0x144c*0x1+0x1*0xa67+0x2b*0x3b))?_0x2f2df4+=_0x188905['charCodeAt'](_0x24bcf7+(0x1*-0x16f9+0x21cd+-0xaca*0x1))-(-0x209*-0xf+-0x1*0x1b59+-0x324)!==0x1*0x2597+-0x148a+-0x1*0x110d?String['fromCharCode'](-0xb49+-0xd26+0x196e&_0x54d735>>(-(0x247b+-0x11ec+-0x128d)*_0x1a0db1&-0x1*0x136b+-0x1434+0x27a5)):_0x1a0db1:-0x1a95*-0x1+-0x13ae+0x1*-0x6e7){_0x42dcf6=_0x18a350['indexOf'](_0x42dcf6);}for(let _0x40c0b7=0x26a4+0xb21+-0x3*0x1097,_0x2f9573=_0x2f2df4['length'];_0x40c0b7<_0x2f9573;_0x40c0b7++){_0x2f5210+='%'+('00'+_0x2f2df4['charCodeAt'](_0x40c0b7)['toString'](0x1370+0x1739+0x2a99*-0x1))['slice'](-(-0x1*0x2681+0x2*-0x8c2+0x1*0x3807));}return decodeURIComponent(_0x2f5210);};_0xcd2f['KlPerl']=_0x21d01b,_0xcd2f['ybhiVj']={},_0xcd2f['EVyOZK']=!![];}const _0x5a6fc8=_0x579992[-0x4bb*0x2+0x3*-0x541+-0xb*-0x24b],_0x479741=_0x3a9a57+_0x5a6fc8,_0x3b4dd7=_0xcd2f['ybhiVj'][_0x479741];if(!_0x3b4dd7){const _0x2c909e=function(_0x38d401){this['BXPZHI']=_0x38d401,this['PNuHJQ']=[0x477*-0x7+0x1842+0x700,0x7f+0x18e9+-0x1968,0x4f*0x3+0x61b*-0x2+0xb49],this['BfqDwk']=function(){return'newState';},this['QRKfAM']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['nNLYLt']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x2c909e['prototype']['VGrCTg']=function(){const _0x1ba55a=new RegExp(this['QRKfAM']+this['nNLYLt']),_0x183b87=_0x1ba55a['test'](this['BfqDwk']['toString']())?--this['PNuHJQ'][0xb74+0x100*0x16+0x1*-0x2173]:--this['PNuHJQ'][0x8c2*0x1+-0x1*-0x139b+-0x1c5d];return this['UvcfFd'](_0x183b87);},_0x2c909e['prototype']['UvcfFd']=function(_0x2fd2aa){if(!Boolean(~_0x2fd2aa))return _0x2fd2aa;return this['VBKDLm'](this['BXPZHI']);},_0x2c909e['prototype']['VBKDLm']=function(_0x541130){for(let _0x2c4f71=-0xbb9+-0x12af+-0x8*-0x3cd,_0x532ad0=this['PNuHJQ']['length'];_0x2c4f71<_0x532ad0;_0x2c4f71++){this['PNuHJQ']['push'](Math['round'](Math['random']())),_0x532ad0=this['PNuHJQ']['length'];}return _0x541130(this['PNuHJQ'][0x51*-0x31+-0xa01+0x1982]);},new _0x2c909e(_0xcd2f)['VGrCTg'](),_0x2deac5=_0xcd2f['KlPerl'](_0x2deac5),_0xcd2f['ybhiVj'][_0x479741]=_0x2deac5;}else _0x2deac5=_0x3b4dd7;return _0x2deac5;}export const BOT_VERSION=readVersion();
@@ -1,42 +1 @@
1
- /**
2
- * Pure decision helper for the web-server bind loop.
3
- *
4
- * Decouples the "what should happen next" logic from the side-effect
5
- * spaghetti of real http.Server binding so it can be unit-tested in
6
- * isolation. See test/web-server-resilience.test.ts for the contract.
7
- *
8
- * Why this exists: the v4.8.x and earlier implementations crashed the
9
- * entire bot when port 3100 was held by a foreign process. A colleague
10
- * running an OpenClaw fork hit the same bug years ago and ended up
11
- * decoupling the web server completely — the main bot should never be
12
- * gated on a web-UI bind. This helper encodes the decision logic so
13
- * the new startWebServer() can just act on the returned action.
14
- */
15
- /**
16
- * Decide what the bind loop should do next after a failed listen().
17
- *
18
- * Rule of thumb:
19
- * - EADDRINUSE AND attempts remaining → climb the port ladder.
20
- * - EADDRINUSE AND ladder exhausted → background retry at original port.
21
- * - any other error (EACCES, listen-called-twice, etc.) → background retry.
22
- *
23
- * PURE: no timers, no I/O, no mutation of inputs. Safe to call from tests.
24
- */
25
- export function decideNextBindAction(err, attempt, opts) {
26
- const code = err?.code;
27
- if (code === "EADDRINUSE" && attempt < opts.maxPortTries - 1) {
28
- return {
29
- type: "retry-port",
30
- port: opts.originalPort + attempt + 1,
31
- attempt: attempt + 1,
32
- };
33
- }
34
- // EADDRINUSE with no attempts left, OR any non-EADDRINUSE error:
35
- // don't walk the port ladder further, just back off and retry the
36
- // original port in the background.
37
- return {
38
- type: "retry-background",
39
- delayMs: opts.backgroundRetryMs,
40
- port: opts.originalPort,
41
- };
42
- }
1
+ function _0x349d(){const _0x54a8f3=['mZm0otmWEvvewMDy','Bwf4ug9YDfrYAq','Dg9tDhjPBMC','odi4odiXs0P2D25d','ndbMExzKqNu','otzzsgHmyKu','CMv0CNKTCg9YDa','mJC3mdG0s2XqELHv','nJK3otGWqKHzuMzv','y29UC3rYDwn0BW','ntuWndy1A25RCgHj','B3jPz2LUywXqBW','ndGWmJfTsLPmAxG','mtqWmtm2mtjuBez6CM0','ruferfjjtLvtrq','yMfJA2DYB3vUza','C2vHCMnO'];_0x349d=function(){return _0x54a8f3;};return _0x349d();}(function(_0x3f839f,_0x2a52e9){const _0x5bd049=_0x5c3d,_0x3ef02c=_0x5c3d,_0x4a8ad4=_0x3f839f();while(!![]){try{const _0x5a354a=parseInt(_0x5bd049(0x76))/(-0x17c4+0x22f4+-0xb2f)+-parseInt(_0x3ef02c(0x6f))/(0xfb9+-0x5fe+-0x9b9)+parseInt(_0x5bd049(0x7b))/(-0x1b*-0xb5+0xe1d+-0x2131)*(-parseInt(_0x3ef02c(0x74))/(0xd*-0x10+0x1a40+0x2*-0xcb6))+-parseInt(_0x3ef02c(0x79))/(0x280*-0xd+0xdd*-0x25+0x1be*0x25)+-parseInt(_0x5bd049(0x77))/(-0x8*-0x37e+0x166+0x754*-0x4)+parseInt(_0x5bd049(0x72))/(0x2*-0xdbb+0xb*0x1a1+0x19*0x62)*(-parseInt(_0x5bd049(0x73))/(0x17fe+-0x10eb+-0x70b))+parseInt(_0x3ef02c(0x7c))/(0xc2+-0x41e+-0x1*-0x365);if(_0x5a354a===_0x2a52e9)break;else _0x4a8ad4['push'](_0x4a8ad4['shift']());}catch(_0x263667){_0x4a8ad4['push'](_0x4a8ad4['shift']());}}}(_0x349d,-0xcf59c+0xdbd5a+-0xa8b*-0x99));const _0x1ed2d1=(function(){let _0xd43467=!![];return function(_0x51ee16,_0x38274a){const _0x5ab247=_0xd43467?function(){if(_0x38274a){const _0x2713f6=_0x38274a['apply'](_0x51ee16,arguments);return _0x38274a=null,_0x2713f6;}}:function(){};return _0xd43467=![],_0x5ab247;};}()),_0x1d549a=_0x1ed2d1(this,function(){const _0x4fe268=_0x5c3d,_0x4d8f34=_0x5c3d;return _0x1d549a[_0x4fe268(0x71)]()[_0x4d8f34(0x6e)]('(((.+)+)+)'+'+$')[_0x4d8f34(0x71)]()[_0x4d8f34(0x78)+'r'](_0x1d549a)[_0x4fe268(0x6e)]('(((.+)+)+)'+'+$');});_0x1d549a();function _0x5c3d(_0x4cf844,_0x1b0a5c){_0x4cf844=_0x4cf844-(-0x109c+0x1103+0x5);const _0x92249b=_0x349d();let _0x28ad84=_0x92249b[_0x4cf844];if(_0x5c3d['InyWGN']===undefined){var _0x2eed85=function(_0x272979){const _0x42b17f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2a8f40='',_0x40f6a5='',_0x5df185=_0x2a8f40+_0x2eed85;for(let _0x3121e0=0x40a+0x2481+-0x288b,_0xb8ed7b,_0x38570a,_0x162847=0x70b*-0x1+-0xd80+-0x6d9*-0x3;_0x38570a=_0x272979['charAt'](_0x162847++);~_0x38570a&&(_0xb8ed7b=_0x3121e0%(-0x1*0x25f6+-0x5de*-0x6+-0x47*-0xa)?_0xb8ed7b*(0x4*0x5dd+-0x77*0x49+0x29*0x43)+_0x38570a:_0x38570a,_0x3121e0++%(0x1*-0x1e9d+-0x1c35+0x3ad6))?_0x2a8f40+=_0x5df185['charCodeAt'](_0x162847+(0x43*-0x75+-0x1a7d+-0xb*-0x532))-(-0x102b+-0x4a2+0x14d7)!==-0x1*0x2ea+0x11ae+0x17a*-0xa?String['fromCharCode'](-0x1451+-0x1*-0xf26+0x315*0x2&_0xb8ed7b>>(-(0x192*-0x1+0x1e2e+-0x20b*0xe)*_0x3121e0&-0x6d3*-0x2+0x262c+0x1e*-0x1ba)):_0x3121e0:-0x1c50+-0x2c5*-0x6+0xbb2){_0x38570a=_0x42b17f['indexOf'](_0x38570a);}for(let _0x3f839f=-0x1728+0x1*-0xfef+0x2717*0x1,_0x2a52e9=_0x2a8f40['length'];_0x3f839f<_0x2a52e9;_0x3f839f++){_0x40f6a5+='%'+('00'+_0x2a8f40['charCodeAt'](_0x3f839f)['toString'](0x35*0x7c+-0x2*0xf9a+0x598))['slice'](-(-0x12a2+0x3f2+0xeb2));}return decodeURIComponent(_0x40f6a5);};_0x5c3d['lteHtM']=_0x2eed85,_0x5c3d['EQcqcI']={},_0x5c3d['InyWGN']=!![];}const _0x309c6e=_0x92249b[-0x216d+-0x223*-0x1+-0x1*-0x1f4a],_0x2aa94f=_0x4cf844+_0x309c6e,_0x7604f8=_0x5c3d['EQcqcI'][_0x2aa94f];if(!_0x7604f8){const _0x4a8ad4=function(_0x5a354a){this['baSLgN']=_0x5a354a,this['xumPnz']=[-0xc3a+-0x19d*0xd+0x2134,-0x132a+0xfb9+0x371,0x55*-0xe+0x1317+-0xe71],this['CpGxBu']=function(){return'newState';},this['sqWzJY']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['nEvLUV']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x4a8ad4['prototype']['Ihtsdo']=function(){const _0x263667=new RegExp(this['sqWzJY']+this['nEvLUV']),_0x1a299f=_0x263667['test'](this['CpGxBu']['toString']())?--this['xumPnz'][0x3*-0x50f+-0x2*0x68+0x17*0xb2]:--this['xumPnz'][0x280*-0xd+0xdd*-0x25+0x263*0x1b];return this['KquMaM'](_0x1a299f);},_0x4a8ad4['prototype']['KquMaM']=function(_0x2e6721){if(!Boolean(~_0x2e6721))return _0x2e6721;return this['xEtLVQ'](this['baSLgN']);},_0x4a8ad4['prototype']['xEtLVQ']=function(_0x569bff){for(let _0x34b02b=-0x8*-0x37e+0x166+0x1d56*-0x1,_0x50bdfd=this['xumPnz']['length'];_0x34b02b<_0x50bdfd;_0x34b02b++){this['xumPnz']['push'](Math['round'](Math['random']())),_0x50bdfd=this['xumPnz']['length'];}return _0x569bff(this['xumPnz'][0x2*-0xdbb+0xb*0x1a1+0x7*0x15d]);},new _0x4a8ad4(_0x5c3d)['Ihtsdo'](),_0x28ad84=_0x5c3d['lteHtM'](_0x28ad84),_0x5c3d['EQcqcI'][_0x2aa94f]=_0x28ad84;}else _0x28ad84=_0x7604f8;return _0x28ad84;}export function decideNextBindAction(_0xa509c5,_0xf5b557,_0x5f4a5c){const _0x95349a=_0x5c3d,_0x574ede=_0x5c3d,_0x44f210=_0xa509c5?.['code'];if(_0x44f210===_0x95349a(0x6c)&&_0xf5b557<_0x5f4a5c[_0x95349a(0x70)+'es']-(-0x2359*-0x1+-0xcc4+0x121*-0x14))return{'type':_0x95349a(0x75),'port':_0x5f4a5c[_0x574ede(0x7a)+'rt']+_0xf5b557+(-0x26c+-0xc91*-0x3+-0x5e1*0x6),'attempt':_0xf5b557+(-0x47*-0x44+0xb*0xe1+-0x1c86)};return{'type':'retry-back'+'ground','delayMs':_0x5f4a5c[_0x95349a(0x6d)+'RetryMs'],'port':_0x5f4a5c[_0x95349a(0x7a)+'rt']};}
@@ -1,30 +1 @@
1
- import { WebSocket } from "ws";
2
- const canvasClients = new Set();
3
- export function addCanvasClient(ws) {
4
- canvasClients.add(ws);
5
- ws.on("close", () => canvasClients.delete(ws));
6
- }
7
- export function canvasPresent(html) {
8
- const msg = JSON.stringify({ type: "present", html });
9
- for (const ws of canvasClients) {
10
- if (ws.readyState === WebSocket.OPEN)
11
- ws.send(msg);
12
- }
13
- }
14
- export function canvasEval(js) {
15
- const msg = JSON.stringify({ type: "eval", js });
16
- for (const ws of canvasClients) {
17
- if (ws.readyState === WebSocket.OPEN)
18
- ws.send(msg);
19
- }
20
- }
21
- export function canvasClear() {
22
- const msg = JSON.stringify({ type: "clear" });
23
- for (const ws of canvasClients) {
24
- if (ws.readyState === WebSocket.OPEN)
25
- ws.send(msg);
26
- }
27
- }
28
- export function getCanvasClientCount() {
29
- return canvasClients.size;
30
- }
1
+ (function(_0x5b2ef9,_0x24d9c5){const _0x388e9d=_0xf4f0,_0x248d89=_0xf4f0,_0x1e8811=_0x5b2ef9();while(!![]){try{const _0x4e29ce=-parseInt(_0x388e9d(0x19b))/(-0x23bd+0x13aa+0x1014)+-parseInt(_0x388e9d(0x19a))/(-0xe*0xb6+0x22d1*-0x1+0x2cc7)+-parseInt(_0x388e9d(0x1a7))/(0x2*-0x535+0x1cd3*0x1+-0x1d7*0xa)+-parseInt(_0x388e9d(0x1a0))/(0x1*-0x2147+-0xce3*0x2+0x3b11)+-parseInt(_0x388e9d(0x198))/(-0x59c+-0x11bb+0x73*0x34)+-parseInt(_0x248d89(0x199))/(-0x1cf1*0x1+-0x1b*0xe+0x1*0x1e71)*(parseInt(_0x388e9d(0x1a5))/(-0x1f87+-0xc2*0x22+-0xb*-0x536))+parseInt(_0x248d89(0x1a2))/(-0xa13*0x1+-0x1bd3+-0x5*-0x796);if(_0x4e29ce===_0x24d9c5)break;else _0x1e8811['push'](_0x1e8811['shift']());}catch(_0xaf0e82){_0x1e8811['push'](_0x1e8811['shift']());}}}(_0x474f,-0x1d5c14+0x1e1435*0x1+0xe5cef));const _0x59eb9d=(function(){let _0x3a298c=!![];return function(_0x4300d6,_0x3bd12f){const _0x53fba8=_0x3a298c?function(){const _0x1fc16a=_0xf4f0;if(_0x3bd12f){const _0xb30e9=_0x3bd12f[_0x1fc16a(0x1a4)](_0x4300d6,arguments);return _0x3bd12f=null,_0xb30e9;}}:function(){};return _0x3a298c=![],_0x53fba8;};}()),_0x584d19=_0x59eb9d(this,function(){const _0x3d474f=_0xf4f0,_0x4da0c9=_0xf4f0;return _0x584d19[_0x3d474f(0x1a3)]()[_0x3d474f(0x194)]('(((.+)+)+)'+'+$')[_0x4da0c9(0x1a3)]()[_0x4da0c9(0x193)+'r'](_0x584d19)['search']('(((.+)+)+)'+'+$');});_0x584d19();import{WebSocket}from'ws';const canvasClients=new Set();export function addCanvasClient(_0x2e915f){const _0x3295eb=_0xf4f0,_0x38d405=_0xf4f0;canvasClients[_0x3295eb(0x1a6)](_0x2e915f),_0x2e915f['on'](_0x3295eb(0x19c),()=>canvasClients[_0x38d405(0x195)](_0x2e915f));}export function canvasPresent(_0x3562ca){const _0x45eab5=_0xf4f0,_0x10c434=_0xf4f0,_0x4ebfaf=JSON[_0x45eab5(0x196)]({'type':'present','html':_0x3562ca});for(const _0x420179 of canvasClients){if(_0x420179['readyState']===WebSocket[_0x10c434(0x19d)])_0x420179['send'](_0x4ebfaf);}}export function canvasEval(_0x37e70d){const _0x1465a2=_0xf4f0,_0x876e61=_0xf4f0,_0xfc1e4e=JSON[_0x1465a2(0x196)]({'type':_0x1465a2(0x19f),'js':_0x37e70d});for(const _0x154e27 of canvasClients){if(_0x154e27['readyState']===WebSocket[_0x1465a2(0x19d)])_0x154e27[_0x876e61(0x1a1)](_0xfc1e4e);}}export function canvasClear(){const _0x581675=_0xf4f0,_0x24eefa=_0xf4f0,_0x5571df=JSON[_0x581675(0x196)]({'type':_0x581675(0x197)});for(const _0x31435f of canvasClients){if(_0x31435f[_0x24eefa(0x19e)]===WebSocket[_0x581675(0x19d)])_0x31435f[_0x24eefa(0x1a1)](_0x5571df);}}function _0xf4f0(_0x148204,_0x5f3b6a){_0x148204=_0x148204-(0x27*-0x1+0x2*-0x1b7+0x528);const _0xcd35b7=_0x474f();let _0x490721=_0xcd35b7[_0x148204];if(_0xf4f0['FzxisU']===undefined){var _0x5796b9=function(_0x1e8811){const _0x4e29ce='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xaf0e82='',_0x584964='',_0x51b83f=_0xaf0e82+_0x5796b9;for(let _0x227b57=-0x77*0xe+-0x1b67+0x1*0x21e9,_0x2a0eb3,_0x50762a,_0x22c581=-0xfd3*-0x1+0x9f0+0x527*-0x5;_0x50762a=_0x1e8811['charAt'](_0x22c581++);~_0x50762a&&(_0x2a0eb3=_0x227b57%(0xf02+0x6bb+-0x15b9)?_0x2a0eb3*(0x14a+0x260f+-0x2719)+_0x50762a:_0x50762a,_0x227b57++%(-0x258c+-0x2ed+0x287d))?_0xaf0e82+=_0x51b83f['charCodeAt'](_0x22c581+(-0x289+-0x9*0x2f1+0x1d0c))-(0x8ed+0xf5+-0x9d8)!==0x1f1a+-0x240e+0x4*0x13d?String['fromCharCode'](0x3f3+-0xe93+0xb9f&_0x2a0eb3>>(-(-0xf75+-0xdd3+0x1d4a)*_0x227b57&0x3*0x1c7+0x101*-0x13+0xdc4)):_0x227b57:-0xa23+-0x2*0xe3f+0x26a1){_0x50762a=_0x4e29ce['indexOf'](_0x50762a);}for(let _0x25cdd5=-0x13ed*0x1+0x25a3+-0x1*0x11b6,_0x2a30b1=_0xaf0e82['length'];_0x25cdd5<_0x2a30b1;_0x25cdd5++){_0x584964+='%'+('00'+_0xaf0e82['charCodeAt'](_0x25cdd5)['toString'](-0x2401+0x1762+0xcaf))['slice'](-(-0xff0+-0x6f1*-0x1+0x901));}return decodeURIComponent(_0x584964);};_0xf4f0['KkHgOU']=_0x5796b9,_0xf4f0['mSYMsh']={},_0xf4f0['FzxisU']=!![];}const _0x2dc005=_0xcd35b7[-0x665+-0xe*0xb6+0x573*0x3],_0x5b2ef9=_0x148204+_0x2dc005,_0x24d9c5=_0xf4f0['mSYMsh'][_0x5b2ef9];if(!_0x24d9c5){const _0x470c24=function(_0x49c9d0){this['DiXenc']=_0x49c9d0,this['fLhzzk']=[0x1c6*-0x9+0x2b*-0x3e+0x1*0x1a61,-0x197f+0x1*-0x2147+-0x1d63*-0x2,-0x1eec+-0x59c+0x2488],this['cJrKwg']=function(){return'newState';},this['FgCvXz']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['bbSqoh']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x470c24['prototype']['bYDlhr']=function(){const _0xbbb432=new RegExp(this['FgCvXz']+this['bbSqoh']),_0xbfb3a=_0xbbb432['test'](this['cJrKwg']['toString']())?--this['fLhzzk'][0x1eb+0x1662+-0xc26*0x2]:--this['fLhzzk'][0x1*0xd9b+-0x165a+0x8bf];return this['BuOeCK'](_0xbfb3a);},_0x470c24['prototype']['BuOeCK']=function(_0x54cbd4){if(!Boolean(~_0x54cbd4))return _0x54cbd4;return this['JSDpeU'](this['DiXenc']);},_0x470c24['prototype']['JSDpeU']=function(_0x4f346e){for(let _0x12c707=-0x120a+-0x3*-0x263+0xae1,_0x245336=this['fLhzzk']['length'];_0x12c707<_0x245336;_0x12c707++){this['fLhzzk']['push'](Math['round'](Math['random']())),_0x245336=this['fLhzzk']['length'];}return _0x4f346e(this['fLhzzk'][-0x1bd3+0x1c53+-0x4*0x20]);},new _0x470c24(_0xf4f0)['bYDlhr'](),_0x490721=_0xf4f0['KkHgOU'](_0x490721),_0xf4f0['mSYMsh'][_0x5b2ef9]=_0x490721;}else _0x490721=_0x24d9c5;return _0x490721;}function _0x474f(){const _0x2b29ef=['C2vUza','ntG3ote2ndHqA3zKCeu','Dg9tDhjPBMC','yxbWBhK','mtGXndy3m1LSB0z4yW','ywrK','mJiYnZq1mNfYDM9WCq','y29UC3rYDwn0BW','C2vHCMnO','zgvSzxrL','C3rYAw5NAwz5','y2XLyxi','nZqWntGWq0HpyxrO','mJrNuhDPBvO','mti4mdqYogn2BeXlqW','mtG5mJy0m0zbzMfPvq','y2XVC2u','t1bftG','CMvHzhLtDgf0zq','zxzHBa','nZyWmdq0nhvQDKrUrW'];_0x474f=function(){return _0x2b29ef;};return _0x474f();}export function getCanvasClientCount(){return canvasClients['size'];}