alvin-bot 5.7.0 → 5.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +25 -31
  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 -174
  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 -583
  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 -86
  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 -1902
  135. package/dist/web/setup-api.js +1 -1101
  136. package/package.json +5 -2
  137. package/dist/.metadata_never_index +0 -0
package/dist/paths.js CHANGED
@@ -1,146 +1 @@
1
- /**
2
- * Centralized Path Registry — Single source of truth for all file paths.
3
- *
4
- * BOT_ROOT = Code directory (where src/, dist/, plugins/, etc. live)
5
- * DATA_DIR = User data directory (~/.alvin-bot by default, override with ALVIN_DATA_DIR)
6
- *
7
- * All personal/runtime data lives in DATA_DIR (outside the repo).
8
- * All code/templates/plugins live in BOT_ROOT (inside the repo).
9
- */
10
- import { resolve, dirname } from "path";
11
- import { fileURLToPath } from "url";
12
- import os from "os";
13
- // ── Code Directory (repo root) ─────────────────────────────────────
14
- export const BOT_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..");
15
- // ── Data Directory (~/.alvin-bot) ──────────────────────────────────
16
- export const DATA_DIR = resolve(process.env.ALVIN_DATA_DIR || resolve(os.homedir(), ".alvin-bot"));
17
- // ── Code paths (BOT_ROOT) ──────────────────────────────────────────
18
- /** web/public/ — Static assets for Web UI */
19
- export const PUBLIC_DIR = resolve(BOT_ROOT, "web", "public");
20
- /** plugins/ — Plugin directory */
21
- export const PLUGINS_DIR = resolve(BOT_ROOT, "plugins");
22
- /** skills/ — Skill definitions.
23
- * Defaults to BOT_ROOT/skills (repo). Override with ALVIN_SKILLS_DIR so
24
- * tests can redirect skill writes into a throwaway sandbox instead of
25
- * polluting the real repo. Default (no env) is byte-identical to before. */
26
- export const SKILLS_DIR = process.env.ALVIN_SKILLS_DIR
27
- ? resolve(process.env.ALVIN_SKILLS_DIR)
28
- : resolve(BOT_ROOT, "skills");
29
- /** User skills directory (custom, outside repo) */
30
- export const USER_SKILLS_DIR = resolve(DATA_DIR, "skills");
31
- /** Example/template files (always in repo) */
32
- export const SOUL_EXAMPLE = resolve(BOT_ROOT, "SOUL.example.md");
33
- export const TOOLS_EXAMPLE_MD = resolve(BOT_ROOT, "TOOLS.example.md");
34
- export const TOOLS_EXAMPLE_JSON = resolve(BOT_ROOT, "docs", "tools.example.json");
35
- // ── Data paths (DATA_DIR = ~/.alvin-bot) ───────────────────────────
36
- /**
37
- * .env — Environment config with secrets (BOT_TOKEN, API keys, etc.)
38
- *
39
- * Lives in DATA_DIR (outside the code repo) for three reasons:
40
- * 1. Defense in depth against accidental commits — secrets never touch BOT_ROOT
41
- * 2. Survives `npm update -g` (BOT_ROOT in global installs = node_modules, gets wiped)
42
- * 3. Consistent with the loader priority in src/config.ts (DATA_DIR is Priority 1)
43
- *
44
- * Legacy installs with BOT_ROOT/.env are auto-migrated on first run (see src/migrate.ts).
45
- */
46
- export const ENV_FILE = resolve(DATA_DIR, ".env");
47
- /** memory/ — Daily logs and embeddings */
48
- export const MEMORY_DIR = resolve(DATA_DIR, "memory");
49
- /** memory/MEMORY.md — Long-term curated memory (legacy monolithic, still loaded) */
50
- export const MEMORY_FILE = resolve(DATA_DIR, "memory", "MEMORY.md");
51
- /** memory/identity.md — L0 layer (v4.11.0): core user facts, always loaded.
52
- * Optional. If missing, MEMORY.md acts as the L0+L1 fallback. */
53
- export const IDENTITY_FILE = resolve(DATA_DIR, "memory", "identity.md");
54
- /** memory/preferences.md — L1 layer (v4.11.0): communication style + don'ts. */
55
- export const PREFERENCES_FILE = resolve(DATA_DIR, "memory", "preferences.md");
56
- /** memory/projects/ — L2 layer (v4.11.0): per-project context loaded on topic match. */
57
- export const PROJECTS_MEMORY_DIR = resolve(DATA_DIR, "memory", "projects");
58
- /** workspaces/ — Per-workspace configuration (v4.12.0).
59
- * Each file is a markdown doc with YAML frontmatter defining the workspace's
60
- * name, purpose, cwd, color, emoji, and an optional system prompt body.
61
- * See src/services/workspaces.ts for the loader and matcher. */
62
- export const WORKSPACES_DIR = resolve(DATA_DIR, "workspaces");
63
- /** memory/.embeddings.json — Legacy JSON vector index. Read on first SQLite migration only;
64
- * active code path is EMBEDDINGS_DB. */
65
- export const EMBEDDINGS_IDX = resolve(DATA_DIR, "memory", ".embeddings.json");
66
- /** memory/.embeddings.db — SQLite vector store (replaces .embeddings.json since v4.20). */
67
- export const EMBEDDINGS_DB = resolve(DATA_DIR, "memory", ".embeddings.db");
68
- /** users/ — User profiles and per-user memory */
69
- export const USERS_DIR = resolve(DATA_DIR, "users");
70
- /** data/ — Runtime control data */
71
- export const RUNTIME_DIR = resolve(DATA_DIR, "data");
72
- /** data/access.json — Group approval status */
73
- export const ACCESS_FILE = resolve(DATA_DIR, "data", "access.json");
74
- /** data/approved-users.json — DM-pairing approved user IDs */
75
- export const APPROVED_USERS_FILE = resolve(DATA_DIR, "data", "approved-users.json");
76
- /** data/whatsapp-auth/ — WhatsApp session persistence */
77
- export const WHATSAPP_AUTH = resolve(DATA_DIR, "data", "whatsapp-auth");
78
- /** data/wa-media/ — WhatsApp temp media */
79
- export const WA_MEDIA_DIR = resolve(DATA_DIR, "data", "wa-media");
80
- /** data/.sudo-enc / .sudo-key — Encrypted sudo password */
81
- export const SUDO_ENC_FILE = resolve(DATA_DIR, "data", ".sudo-enc");
82
- export const SUDO_KEY_FILE = resolve(DATA_DIR, "data", ".sudo-key");
83
- /** backups/ — Config snapshots */
84
- export const BACKUP_DIR = resolve(DATA_DIR, "backups");
85
- /** state/async-agents.json — Pending background SDK agents (Fix #17 Stage 2).
86
- * See src/services/async-agent-watcher.ts for the watcher that polls and
87
- * delivers these. Survives bot restarts. */
88
- export const ASYNC_AGENTS_STATE_FILE = resolve(DATA_DIR, "state", "async-agents.json");
89
- /** state/sessions.json — Persisted user sessions across bot restarts (v4.11.0).
90
- * Includes: sessionId (Claude SDK resume token), language, effort, voiceReply,
91
- * workingDir, lastActivity, lastSdkHistoryIndex, history (capped). Atomic write
92
- * via tmp+rename. Loaded on startup, debounce-flushed on mutations.
93
- * See src/services/session-persistence.ts for the loader/flusher. */
94
- export const SESSIONS_STATE_FILE = resolve(DATA_DIR, "state", "sessions.json");
95
- /** soul.md — Bot personality */
96
- export const SOUL_FILE = resolve(DATA_DIR, "soul.md");
97
- /** tools.md — Custom tool definitions (Markdown) */
98
- export const TOOLS_MD = resolve(DATA_DIR, "tools.md");
99
- /** tools.json — Custom tool definitions (legacy JSON) */
100
- export const TOOLS_JSON = resolve(DATA_DIR, "tools.json");
101
- /** cron-jobs.json — Scheduled tasks */
102
- export const CRON_FILE = resolve(DATA_DIR, "cron-jobs.json");
103
- /** mcp.json — MCP server config */
104
- export const MCP_CONFIG = resolve(DATA_DIR, "mcp.json");
105
- /** fallback-order.json — Provider fallback chain */
106
- export const FALLBACK_FILE = resolve(DATA_DIR, "fallback-order.json");
107
- /** custom-models.json — Custom LLM endpoints */
108
- export const CUSTOM_MODELS = resolve(DATA_DIR, "custom-models.json");
109
- /** whatsapp-groups.json — WhatsApp group tracking */
110
- export const WA_GROUPS = resolve(DATA_DIR, "whatsapp-groups.json");
111
- /** delivery-queue.json — Reliable message delivery queue */
112
- export const DELIVERY_QUEUE_FILE = resolve(DATA_DIR, "delivery-queue.json");
113
- /** AGENTS.md — Standing orders (permanent instructions for every session) */
114
- export const AGENTS_FILE = resolve(DATA_DIR, "AGENTS.md");
115
- /** hooks/ — User-defined lifecycle event handlers */
116
- export const HOOKS_DIR = resolve(DATA_DIR, "hooks");
117
- /** scripts/browse-server.cjs — HTTP gateway for persistent browser sessions */
118
- export const BROWSE_SERVER_SCRIPT = resolve(BOT_ROOT, "scripts", "browse-server.cjs");
119
- /** ~/.claude/hub/SCRIPTS/browser.sh — Optional dev-only 3-tier browser router.
120
- * Used ONLY if present (maintainer dev environment). Not required for normal operation —
121
- * the bot has its own CDP bootstrap (see src/services/cdp-bootstrap.ts). */
122
- export const HUB_BROWSER_SH = resolve(os.homedir(), ".claude", "hub", "SCRIPTS", "browser.sh");
123
- /** browser/profile/ — Persistent Chromium profile for CDP (cookies, login state) */
124
- export const CDP_PROFILE_DIR = resolve(DATA_DIR, "browser", "profile");
125
- /** browser/screenshots/ — CDP screenshot output directory */
126
- export const CDP_SCREENSHOTS_DIR = resolve(DATA_DIR, "browser", "screenshots");
127
- /** browser/chrome-cdp.pid — PID of Chromium started by cdp-bootstrap */
128
- export const CDP_PID_FILE = resolve(DATA_DIR, "browser", "chrome-cdp.pid");
129
- /** browser/chrome-cdp.log — Chromium stderr/stdout when started by cdp-bootstrap */
130
- export const CDP_LOG_FILE = resolve(DATA_DIR, "browser", "chrome-cdp.log");
131
- /** data/exec-allowlist.json — User-defined exec allowlist */
132
- export const EXEC_ALLOWLIST_FILE = resolve(DATA_DIR, "exec-allowlist.json");
133
- /** assets/ — User-supplied files organized in category subdirectories */
134
- export const ASSETS_DIR = resolve(DATA_DIR, "assets");
135
- /** assets/INDEX.json — Machine-readable asset registry */
136
- export const ASSETS_INDEX_JSON = resolve(DATA_DIR, "assets", "INDEX.json");
137
- /** assets/INDEX.md — Human-readable asset summary (injected into prompts) */
138
- export const ASSETS_INDEX_MD = resolve(DATA_DIR, "assets", "INDEX.md");
139
- /** subagents/ — Detached `claude -p` subprocess output files (v4.13).
140
- * Each dispatched agent writes its full stream-json output to
141
- * subagents/<agentId>.jsonl. The async-agent-watcher polls these files
142
- * and delivers the final result as a separate message when ready.
143
- * These live outside BOT_ROOT/DATA_DIR's state/ so that the watcher's
144
- * giveUpAt-survive-restart logic doesn't leak into the subprocess
145
- * lifecycle. */
146
- export const SUBAGENTS_DIR = resolve(DATA_DIR, "subagents");
1
+ const _0x19fab7=_0x4073,_0x167dd0=_0x4073;(function(_0x5d5cdf,_0x3d7008){const _0x667d5e=_0x4073,_0x50dca0=_0x4073,_0x2325ea=_0x5d5cdf();while(!![]){try{const _0x4812d2=-parseInt(_0x667d5e(0x1b8))/(0x125+-0x1a19+-0x1*-0x18f5)+-parseInt(_0x667d5e(0x1b1))/(-0x1*0x2303+0x6c8*-0x2+-0x1*-0x3095)+-parseInt(_0x50dca0(0x19d))/(-0x2222+0x1073*0x1+0x8d9*0x2)*(-parseInt(_0x667d5e(0x1c6))/(-0x1*-0x2446+-0x21*0x1f+0x1*-0x2043))+parseInt(_0x667d5e(0x1d7))/(0x162b+-0x256a+0xf44)*(-parseInt(_0x667d5e(0x195))/(0x3a5*0x9+-0xf7*-0x22+0x1*-0x4195))+parseInt(_0x50dca0(0x1dd))/(0xd72+-0x18bc+0x1*0xb51)+-parseInt(_0x667d5e(0x19b))/(-0x178b+0x581*-0x6+0x3899)*(parseInt(_0x667d5e(0x1c1))/(-0x15f9+-0x72*-0x3b+-0x444))+parseInt(_0x50dca0(0x1c2))/(-0x1*0x7d5+-0xce5*0x1+-0x4*-0x531)*(parseInt(_0x50dca0(0x1de))/(-0x1911+-0x329*-0x9+0x355*-0x1));if(_0x4812d2===_0x3d7008)break;else _0x2325ea['push'](_0x2325ea['shift']());}catch(_0x2ea3d6){_0x2325ea['push'](_0x2325ea['shift']());}}}(_0x5b56,0xb1d03+0x580*-0x243+0x8edcc));const _0x1fa262=(function(){let _0x56c4ab=!![];return function(_0x26a2d6,_0x58794c){const _0x597c01=_0x56c4ab?function(){const _0x5c5b0c=_0x4073;if(_0x58794c){const _0x4acc5d=_0x58794c[_0x5c5b0c(0x1c8)](_0x26a2d6,arguments);return _0x58794c=null,_0x4acc5d;}}:function(){};return _0x56c4ab=![],_0x597c01;};}()),_0x42b570=_0x1fa262(this,function(){const _0x555bed=_0x4073,_0x1facbc=_0x4073;return _0x42b570[_0x555bed(0x1b4)]()[_0x1facbc(0x1cf)](_0x555bed(0x199)+'+$')[_0x1facbc(0x1b4)]()['constructo'+'r'](_0x42b570)[_0x1facbc(0x1cf)](_0x555bed(0x199)+'+$');});_0x42b570();import{resolve,dirname}from'path';import{fileURLToPath}from'url';import _0x297dd1 from'os';export const BOT_ROOT=resolve(dirname(fileURLToPath(import.meta.url)),'..');export const DATA_DIR=resolve(process[_0x19fab7(0x1c5)][_0x167dd0(0x1ae)+'_DIR']||resolve(_0x297dd1[_0x19fab7(0x1a5)](),_0x19fab7(0x197)));export const PUBLIC_DIR=resolve(BOT_ROOT,_0x167dd0(0x19f),_0x167dd0(0x1dc));export const PLUGINS_DIR=resolve(BOT_ROOT,_0x19fab7(0x1a6));export const SKILLS_DIR=process[_0x167dd0(0x1c5)][_0x19fab7(0x1c0)+_0x19fab7(0x1d3)]?resolve(process[_0x167dd0(0x1c5)][_0x19fab7(0x1c0)+_0x167dd0(0x1d3)]):resolve(BOT_ROOT,_0x19fab7(0x1d2));export const USER_SKILLS_DIR=resolve(DATA_DIR,_0x167dd0(0x1d2));export const SOUL_EXAMPLE=resolve(BOT_ROOT,'SOUL.examp'+_0x167dd0(0x1b6));export const TOOLS_EXAMPLE_MD=resolve(BOT_ROOT,'TOOLS.exam'+_0x19fab7(0x1cd));export const TOOLS_EXAMPLE_JSON=resolve(BOT_ROOT,_0x167dd0(0x1aa),'tools.exam'+_0x167dd0(0x1e0));export const ENV_FILE=resolve(DATA_DIR,_0x19fab7(0x1ad));export const MEMORY_DIR=resolve(DATA_DIR,_0x19fab7(0x1d5));export const MEMORY_FILE=resolve(DATA_DIR,_0x167dd0(0x1d5),_0x167dd0(0x1c4));export const IDENTITY_FILE=resolve(DATA_DIR,_0x19fab7(0x1d5),_0x167dd0(0x1b9)+'d');export const PREFERENCES_FILE=resolve(DATA_DIR,'memory',_0x167dd0(0x19c)+_0x19fab7(0x198));export const PROJECTS_MEMORY_DIR=resolve(DATA_DIR,'memory',_0x19fab7(0x1bc));export const WORKSPACES_DIR=resolve(DATA_DIR,_0x19fab7(0x1a8));export const EMBEDDINGS_IDX=resolve(DATA_DIR,_0x167dd0(0x1d5),'.embedding'+_0x19fab7(0x1a1));export const EMBEDDINGS_DB=resolve(DATA_DIR,_0x167dd0(0x1d5),_0x19fab7(0x1df)+_0x167dd0(0x194));export const USERS_DIR=resolve(DATA_DIR,_0x19fab7(0x1d6));export const RUNTIME_DIR=resolve(DATA_DIR,_0x167dd0(0x1cb));export const ACCESS_FILE=resolve(DATA_DIR,_0x167dd0(0x1cb),_0x19fab7(0x1b3)+'n');function _0x5b56(){const _0x2d42dd=['CgXLlM1K','zxHLyY1HBgXVDW','C2vHCMnO','yMfJA3vWCW','yxnZzxrZ','C2TPBgXZ','tfnFreLs','ANnVBG','BwvTB3j5','DxnLCNm','mZK4nuXvvNLXAa','BgLZDc5QC29U','C2nYzwvUC2HVDa','y2HYB21LlwnKCa','AhvI','ChvIBgLJ','mJm4ndK4ng9Sv05dwG','nZaWmZDmsNHYqNu','lMvTyMvKzgLUzW','CgXLlMPZB24','CY5KyG','nde2nfDPqM5Usq','D2eTBwvKAwe','lMfSDMLUlwjVDa','CY5Tza','kcGOlISPkYKRkq','zwXZlMPZB24','odHqrvPfu1i','ChjLzMvYzw5Jzq','owzqswDeuW','DxrO','D2vI','yxn5BMmTywDLBG','CY5QC29U','C3rHDgu','u0nssvbuuW','CMrLCI5QC29U','Ag9TzwrPCG','CgX1z2LUCW','zMfSBgjHy2STBW','D29YA3nWywnLCW','quDftLrtlM1K','zg9JCW','lNbPza','Ag9VA3m','lMvUDG','quXwsu5Frefuqq','Dwv1zs5QC29U','y3vZDg9Tlw1Vza','nJmXodCYAwzXEM16','yNjVD3nLCG','ywnJzxnZlMPZBW','Dg9tDhjPBMC','yxbWCM92zwqTDq','BguUBwq','lMXVzW','otGZndaWzNDdywTY','AwrLBNrPDhKUBq','su5ervGUBwq','DhmUANnVBG','ChjVAMvJDhm','C29U','yNjVD3nLlxnLCG','D2HHDhnHChaTzW','quXwsu5Fu0Tjta','nda1nJKZBxzpz3ff','mJC3mgHqvu9IvW','zgvSAxzLCNKTCq','tuvnt1jzlM1K','zw52','otG5ntGWz0ziDwzm','ChjVzMLSzq','yxbWBhK','DMvYlMnQCW','Dg9VBhmUBwq','zgf0yq','lNn1zg8TA2v5'];_0x5b56=function(){return _0x2d42dd;};return _0x5b56();}export const APPROVED_USERS_FILE=resolve(DATA_DIR,'data',_0x19fab7(0x1b5)+'sers.json');export const WHATSAPP_AUTH=resolve(DATA_DIR,_0x167dd0(0x1cb),'whatsapp-a'+_0x167dd0(0x19e));export const WA_MEDIA_DIR=resolve(DATA_DIR,'data',_0x167dd0(0x196));export const SUDO_ENC_FILE=resolve(DATA_DIR,_0x167dd0(0x1cb),'.sudo-enc');export const SUDO_KEY_FILE=resolve(DATA_DIR,_0x167dd0(0x1cb),_0x19fab7(0x1cc));export const BACKUP_DIR=resolve(DATA_DIR,_0x167dd0(0x1d0));export const ASYNC_AGENTS_STATE_FILE=resolve(DATA_DIR,_0x167dd0(0x1a2),_0x167dd0(0x1a0)+_0x19fab7(0x1bb));export const SESSIONS_STATE_FILE=resolve(DATA_DIR,_0x167dd0(0x1a2),'sessions.j'+_0x19fab7(0x1bd));export const SOUL_FILE=resolve(DATA_DIR,'soul.md');export const TOOLS_MD=resolve(DATA_DIR,_0x167dd0(0x1ca));export const TOOLS_JSON=resolve(DATA_DIR,'tools.json');export const CRON_FILE=resolve(DATA_DIR,'cron-jobs.'+_0x19fab7(0x1d4));function _0x4073(_0x14de78,_0x4fc17b){_0x14de78=_0x14de78-(0x4*-0x98f+-0x1fb8+0x1c*0x28e);const _0x94515a=_0x5b56();let _0x309ad6=_0x94515a[_0x14de78];if(_0x4073['Dmxkon']===undefined){var _0x15d2b1=function(_0x5d66b3){const _0x2fb031='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3da57c='',_0xb8972c='',_0x54a274=_0x3da57c+_0x15d2b1;for(let _0x23bac6=-0x5a3*-0x1+-0x92*0x2c+0x1375,_0x11179d,_0x526731,_0x2a4274=0x2005*0x1+-0x76b+-0x189a;_0x526731=_0x5d66b3['charAt'](_0x2a4274++);~_0x526731&&(_0x11179d=_0x23bac6%(-0x8b*0x47+-0x15*0x97+0x32f4)?_0x11179d*(-0x25f3+0xe5*0x2+0x2469)+_0x526731:_0x526731,_0x23bac6++%(0x33*0x8e+-0xa35+-0x1211))?_0x3da57c+=_0x54a274['charCodeAt'](_0x2a4274+(0x3aa+-0x260b+0x226b))-(-0x1e81+-0xe6a+0x2cf5)!==-0x1e6d*0x1+0x67*0x3b+0x6b0?String['fromCharCode'](0x7eb+0xbcb+0x3*-0x63d&_0x11179d>>(-(0x1eec+0x1f90+-0x3e7a)*_0x23bac6&-0x35*-0xa1+-0x19d7+-0x8*0xef)):_0x23bac6:0x1*-0x152b+0x161*0x19+0xd4e*-0x1){_0x526731=_0x2fb031['indexOf'](_0x526731);}for(let _0x58b687=-0x2a*-0x28+0x1b46+-0x10eb*0x2,_0x155c4f=_0x3da57c['length'];_0x58b687<_0x155c4f;_0x58b687++){_0xb8972c+='%'+('00'+_0x3da57c['charCodeAt'](_0x58b687)['toString'](-0xe6a+0xe7*0x7+-0x829*-0x1))['slice'](-(-0x1*-0x2173+0x11c5+-0x13*0x2b2));}return decodeURIComponent(_0xb8972c);};_0x4073['vVlNxh']=_0x15d2b1,_0x4073['ExVvnZ']={},_0x4073['Dmxkon']=!![];}const _0x28e71b=_0x94515a[0x125+-0x1a19+-0x2*-0xc7a],_0x262132=_0x14de78+_0x28e71b,_0x1ff2cd=_0x4073['ExVvnZ'][_0x262132];if(!_0x1ff2cd){const _0x5f2aca=function(_0x5cc41e){this['SOqBzh']=_0x5cc41e,this['nwmyXA']=[-0x1*0x2303+0x6c8*-0x2+-0x4*-0xc25,-0x2222+0x1073*0x1+0x11af*0x1,-0x1*-0x2446+-0x21*0x1f+0x1*-0x2047],this['USzKud']=function(){return'newState';},this['FAcNpB']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['bNxUip']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x5f2aca['prototype']['eAVkgT']=function(){const _0x528928=new RegExp(this['FAcNpB']+this['bNxUip']),_0x8aed78=_0x528928['test'](this['USzKud']['toString']())?--this['nwmyXA'][0x162b+-0x256a+0xf40]:--this['nwmyXA'][0x3a5*0x9+-0xf7*-0x22+0x1*-0x419b];return this['LIBmzK'](_0x8aed78);},_0x5f2aca['prototype']['LIBmzK']=function(_0xe850dd){if(!Boolean(~_0xe850dd))return _0xe850dd;return this['crCilh'](this['SOqBzh']);},_0x5f2aca['prototype']['crCilh']=function(_0x516e5d){for(let _0x497554=0xd72+-0x18bc+0x22*0x55,_0xf81b75=this['nwmyXA']['length'];_0x497554<_0xf81b75;_0x497554++){this['nwmyXA']['push'](Math['round'](Math['random']())),_0xf81b75=this['nwmyXA']['length'];}return _0x516e5d(this['nwmyXA'][-0x178b+0x581*-0x6+0x3891]);},new _0x5f2aca(_0x4073)['eAVkgT'](),_0x309ad6=_0x4073['vVlNxh'](_0x309ad6),_0x4073['ExVvnZ'][_0x262132]=_0x309ad6;}else _0x309ad6=_0x1ff2cd;return _0x309ad6;}export const MCP_CONFIG=resolve(DATA_DIR,'mcp.json');export const FALLBACK_FILE=resolve(DATA_DIR,_0x167dd0(0x1a7)+_0x167dd0(0x1a4));export const CUSTOM_MODELS=resolve(DATA_DIR,_0x167dd0(0x1b0)+_0x167dd0(0x19a));export const WA_GROUPS=resolve(DATA_DIR,_0x19fab7(0x1bf)+'roups.json');export const DELIVERY_QUEUE_FILE=resolve(DATA_DIR,_0x167dd0(0x1c3)+_0x19fab7(0x1af));export const AGENTS_FILE=resolve(DATA_DIR,_0x19fab7(0x1a9));export const HOOKS_DIR=resolve(DATA_DIR,_0x19fab7(0x1ac));export const BROWSE_SERVER_SCRIPT=resolve(BOT_ROOT,'scripts',_0x19fab7(0x1be)+_0x167dd0(0x1c9));export const HUB_BROWSER_SH=resolve(_0x297dd1['homedir'](),'.claude',_0x167dd0(0x1db),_0x19fab7(0x1a3),'browser.sh');export const CDP_PROFILE_DIR=resolve(DATA_DIR,_0x19fab7(0x1b2),_0x19fab7(0x1c7));export const CDP_SCREENSHOTS_DIR=resolve(DATA_DIR,_0x19fab7(0x1b2),_0x19fab7(0x1d9)+'s');export const CDP_PID_FILE=resolve(DATA_DIR,_0x19fab7(0x1b2),_0x167dd0(0x1da)+_0x167dd0(0x1ab));export const CDP_LOG_FILE=resolve(DATA_DIR,'browser',_0x167dd0(0x1da)+_0x19fab7(0x1b7));export const EXEC_ALLOWLIST_FILE=resolve(DATA_DIR,_0x167dd0(0x1ce)+_0x19fab7(0x1d8));export const ASSETS_DIR=resolve(DATA_DIR,_0x167dd0(0x1d1));export const ASSETS_INDEX_JSON=resolve(DATA_DIR,'assets','INDEX.json');export const ASSETS_INDEX_MD=resolve(DATA_DIR,_0x167dd0(0x1d1),_0x19fab7(0x1ba));export const SUBAGENTS_DIR=resolve(DATA_DIR,'subagents');
@@ -1,175 +1 @@
1
- /**
2
- * Discord Platform Adapter
3
- *
4
- * Uses discord.js to connect to Discord.
5
- * Optional dependency — only loaded if DISCORD_TOKEN is set.
6
- *
7
- * Setup:
8
- * 1. Create a bot at https://discord.com/developers/applications
9
- * 2. Enable Message Content Intent
10
- * 3. Set DISCORD_TOKEN in .env
11
- * 4. Invite bot to server with messages.read + messages.write permissions
12
- */
13
- let _discordState = {
14
- status: "disconnected",
15
- botName: null,
16
- botTag: null,
17
- guildCount: 0,
18
- connectedAt: null,
19
- error: null,
20
- };
21
- export function getDiscordState() {
22
- return { ..._discordState };
23
- }
24
- export class DiscordAdapter {
25
- platform = "discord";
26
- handler = null;
27
- client = null; // discord.js Client (dynamic import)
28
- token;
29
- constructor(token) {
30
- this.token = token;
31
- }
32
- async start() {
33
- try {
34
- // Dynamic import — discord.js is optional
35
- // @ts-ignore — discord.js is an optional dependency
36
- const { Client, GatewayIntentBits } = await import("discord.js");
37
- this.client = new Client({
38
- intents: [
39
- GatewayIntentBits.Guilds,
40
- GatewayIntentBits.GuildMessages,
41
- GatewayIntentBits.MessageContent,
42
- GatewayIntentBits.DirectMessages,
43
- ],
44
- });
45
- this.client.on("messageCreate", async (msg) => {
46
- if (msg.author.bot)
47
- return;
48
- if (!this.handler)
49
- return;
50
- const isMention = msg.mentions.has(this.client.user);
51
- const isReplyToBot = msg.reference?.messageId
52
- ? (await msg.channel.messages.fetch(msg.reference.messageId).catch(() => null))?.author?.id === this.client.user.id
53
- : false;
54
- const incoming = {
55
- platform: "discord",
56
- messageId: msg.id,
57
- chatId: msg.channel.id,
58
- userId: msg.author.id,
59
- userName: msg.author.displayName || msg.author.username,
60
- userHandle: msg.author.username,
61
- text: msg.content,
62
- isGroup: msg.guild !== null,
63
- isMention,
64
- isReplyToBot,
65
- replyToText: undefined,
66
- };
67
- // In servers: only respond to mentions or replies
68
- if (msg.guild && !isMention && !isReplyToBot)
69
- return;
70
- // Strip mention from text
71
- if (isMention) {
72
- incoming.text = incoming.text.replace(/<@!?\d+>/g, "").trim();
73
- }
74
- await this.handler(incoming);
75
- });
76
- _discordState.status = "connecting";
77
- this.client.on("ready", () => {
78
- _discordState.status = "connected";
79
- _discordState.botName = this.client.user?.displayName || this.client.user?.username || null;
80
- _discordState.botTag = this.client.user?.tag || null;
81
- _discordState.guildCount = this.client.guilds.cache.size;
82
- _discordState.connectedAt = Date.now();
83
- });
84
- await this.client.login(this.token);
85
- console.log(`🎮 Discord adapter started (${this.client.user?.tag})`);
86
- // v4.14 — Register with the delivery registry so the async-agent
87
- // watcher can deliver background sub-agent results back to Discord.
88
- try {
89
- const { registerDeliveryAdapter } = await import("../services/delivery-registry.js");
90
- registerDeliveryAdapter({
91
- platform: "discord",
92
- sendText: async (chatId, text) => {
93
- await this.sendText(String(chatId), text);
94
- },
95
- });
96
- }
97
- catch (err) {
98
- console.warn("[discord] failed to register delivery adapter:", err);
99
- }
100
- }
101
- catch (err) {
102
- _discordState.status = "error";
103
- _discordState.error = err instanceof Error ? err.message : String(err);
104
- console.error("Discord adapter failed to start:", err);
105
- throw err;
106
- }
107
- }
108
- async stop() {
109
- if (this.client) {
110
- this.client.destroy();
111
- }
112
- }
113
- async sendText(chatId, text, options) {
114
- if (!this.client)
115
- return;
116
- const channel = await this.client.channels.fetch(chatId);
117
- if (!channel?.isTextBased())
118
- return;
119
- // Discord max message length is 2000
120
- if (text.length > 2000) {
121
- // Split into chunks
122
- const chunks = text.match(/.{1,1990}/gs) || [text];
123
- for (const chunk of chunks) {
124
- await channel.send({
125
- content: chunk,
126
- reply: options?.replyTo ? { messageReference: options.replyTo } : undefined,
127
- });
128
- }
129
- }
130
- else {
131
- await channel.send({
132
- content: text,
133
- reply: options?.replyTo ? { messageReference: options.replyTo } : undefined,
134
- });
135
- }
136
- }
137
- async sendPhoto(chatId, photo, caption) {
138
- if (!this.client)
139
- return;
140
- const channel = await this.client.channels.fetch(chatId);
141
- if (!channel?.isTextBased())
142
- return;
143
- // @ts-ignore — discord.js is an optional dependency
144
- const { AttachmentBuilder } = await import("discord.js");
145
- const attachment = typeof photo === "string"
146
- ? new AttachmentBuilder(photo)
147
- : new AttachmentBuilder(photo, { name: "image.png" });
148
- await channel.send({ content: caption, files: [attachment] });
149
- }
150
- async react(chatId, messageId, emoji) {
151
- if (!this.client)
152
- return;
153
- try {
154
- const channel = await this.client.channels.fetch(chatId);
155
- if (!channel?.isTextBased())
156
- return;
157
- const msg = await channel.messages.fetch(messageId);
158
- await msg.react(emoji);
159
- }
160
- catch { /* ignore */ }
161
- }
162
- async setTyping(chatId) {
163
- if (!this.client)
164
- return;
165
- try {
166
- const channel = await this.client.channels.fetch(chatId);
167
- if (channel?.isTextBased())
168
- await channel.sendTyping();
169
- }
170
- catch { /* ignore */ }
171
- }
172
- onMessage(handler) {
173
- this.handler = handler;
174
- }
175
- }
1
+ const _0x1cfc85=_0x13f7,_0xa0043d=_0x13f7;(function(_0x287f19,_0x260bdb){const _0x2018f0=_0x13f7,_0x12ffbe=_0x13f7,_0x2d2d2a=_0x287f19();while(!![]){try{const _0x27a6c7=-parseInt(_0x2018f0(0x105))/(0xfd8+0x20ef+-0x30c6)+parseInt(_0x12ffbe(0xfa))/(0x1*-0x16e+-0x19d+0x30d)*(parseInt(_0x2018f0(0x12c))/(-0x686+-0x45+0x6ce))+-parseInt(_0x12ffbe(0xf2))/(0x1a10+-0x350+-0x16bc)*(-parseInt(_0x2018f0(0x137))/(0x24c7+-0xbc8*0x2+0x2*-0x699))+-parseInt(_0x2018f0(0x107))/(-0x1389+-0x11de*0x1+0x256d)+parseInt(_0x2018f0(0x109))/(-0x9a*0x3e+-0x26dd*0x1+-0x4c3*-0x10)+parseInt(_0x12ffbe(0x118))/(-0x13c6+0x19bb+-0x5ed)*(parseInt(_0x12ffbe(0x138))/(0x3a9*-0x3+-0xce+0xbd2))+-parseInt(_0x12ffbe(0x11e))/(-0x22*-0x2c+-0x6b9*-0x2+-0x2c0*0x7);if(_0x27a6c7===_0x260bdb)break;else _0x2d2d2a['push'](_0x2d2d2a['shift']());}catch(_0x34ee96){_0x2d2d2a['push'](_0x2d2d2a['shift']());}}}(_0x29a0,0x16859+-0x1bb*0x2ab+0xd92e5));const _0x206aa5=(function(){let _0x408fb0=!![];return function(_0x1542e2,_0x54b0d1){const _0x1d3aea=_0x408fb0?function(){const _0x4e48c9=_0x13f7;if(_0x54b0d1){const _0x43f9ea=_0x54b0d1[_0x4e48c9(0x126)](_0x1542e2,arguments);return _0x54b0d1=null,_0x43f9ea;}}:function(){};return _0x408fb0=![],_0x1d3aea;};}()),_0x5956c1=_0x206aa5(this,function(){const _0x162a28=_0x13f7,_0x35b60f=_0x13f7;return _0x5956c1[_0x162a28(0x13d)]()[_0x35b60f(0x129)](_0x162a28(0x11b)+'+$')[_0x35b60f(0x13d)]()[_0x162a28(0x136)+'r'](_0x5956c1)[_0x162a28(0x129)](_0x162a28(0x11b)+'+$');});_0x5956c1();function _0x29a0(){const _0x2171c1=['mtyYmhjmuhvvCW','ywDLCW','zgLZCgXHEu5HBq','z3vPBgq','AxnuzxH0qMfZzq','Dg9tDhjPBMC','z3vPBgrZ','D2fYBG','yM90tMfTzq','yM90','Aw1Hz2uUCg5N','DhjPBq','zxjYB3i','y2XPzw50','BwvZC2fNzxm','C2vUzfrLEhq','mZm0ntqZnMniyxzkrq','C3rVCa','BgvUz3rO','zMfPBgvKihrVia','C2vUza','AgfZ','y2f0y2G','ywrHChrLCIbZDa','mZu2odu2uvHRDK5x','CY9KzwXPDMvYEq','Bg9NAw4','C2vUzfr5CgLUzW','y29UDgvUDa','lI4VC2vYDMLJzq','y2HHBM5LBhm','Dgv4Da','C2vUzfbOB3rV','B25nzxnZywDL','y2fJAgu','mte1odu3zu9kugXn','DxnLCM5HBwu','mZG5otG2ohDRtgryEa','Bg9N','nZC1oti0ofPdufDssW','yxb0zxi6','zwXPDMvYEsbHza','z3vPBgrdB3vUDa','yxj0zwqGka','CMvHzhK','BwvZC2fNzuLK','zgLZy29UBMvJDa','CMvWBhLuBW','BwvZC2fNzunYzq','DxnLCG','y29UBMvJDgLUzW','yxrL','yxb0zxiGzMfPBa','Dg9Rzw4','mti2mZjRt2zhD0y','C2L6zq','C3rHDhvZ','kcGOlISPkYKRkq','zgLZy29Yza','AgfUzgXLCG','mte0mdGXmtbzywLKChu','CMvNAxn0zxiGza','C3rHCNq','DgfN','zMv0y2G','r3vPBgrZ','C2v0vhLWAw5N','8j+oRIbeAxnJB3jKia','yxbWBhK','z2vZ','y29UBMvJDgvKqq','C2vHCMnO','BwvUDgLVBNm','y2HHBM5LBa','nM5ztff5sa','zgLZy29Yzc5QCW','y29UBMvJDgvK','CMvHy3q','Bwf0y2G','DgvUDa','yxv0Ag9Y','BM93','zwqGDg8GC3rHCG','CMvMzxjLBMnL','y29UC3rYDwn0BW','nwnctuvxCq'];_0x29a0=function(){return _0x2171c1;};return _0x29a0();}function _0x13f7(_0x4bc2fd,_0x3b5560){_0x4bc2fd=_0x4bc2fd-(-0x176b*-0x1+0x363+-0x19dd);const _0x17d8fb=_0x29a0();let _0x19e123=_0x17d8fb[_0x4bc2fd];if(_0x13f7['hMowGz']===undefined){var _0x1c9e89=function(_0x22a2d5){const _0x41cdb='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x587cce='',_0x140500='',_0x52986c=_0x587cce+_0x1c9e89;for(let _0x8c54bf=-0x16b6+0xb*-0x21d+0x931*0x5,_0x5b355f,_0xbcee3e,_0x178e2b=-0xf25+0x149+0x1*0xddc;_0xbcee3e=_0x22a2d5['charAt'](_0x178e2b++);~_0xbcee3e&&(_0x5b355f=_0x8c54bf%(-0x1*-0xdd3+-0x1*0x15a7+0x1f6*0x4)?_0x5b355f*(0x1*0x110e+0x3bb+-0x1*0x1489)+_0xbcee3e:_0xbcee3e,_0x8c54bf++%(-0x5ce+-0x1c44+0x2*0x110b))?_0x587cce+=_0x52986c['charCodeAt'](_0x178e2b+(0x1a8c+-0x2c2*0xe+-0x2*-0x60d))-(0xc2*0x4+0x18*-0x112+0x245*0xa)!==-0x1983+0x167*0x8+0xe4b?String['fromCharCode'](0x1fe0+0x82c*0x1+-0x270d*0x1&_0x5b355f>>(-(0x18*-0x15+-0x26cb+0x28c5)*_0x8c54bf&-0x4b*-0x49+0x2f1*0x5+-0xab*0x36)):_0x8c54bf:-0x26*0x2d+0x2d*0x76+-0x2*0x708){_0xbcee3e=_0x41cdb['indexOf'](_0xbcee3e);}for(let _0x4f1848=-0xb02*-0x1+-0x22a4+0x5*0x4ba,_0x5ee938=_0x587cce['length'];_0x4f1848<_0x5ee938;_0x4f1848++){_0x140500+='%'+('00'+_0x587cce['charCodeAt'](_0x4f1848)['toString'](0x1*-0x22d1+-0x4*-0x71+0x211d))['slice'](-(-0x16d0+-0x2*-0x8be+0x1*0x556));}return decodeURIComponent(_0x140500);};_0x13f7['OXrlSd']=_0x1c9e89,_0x13f7['mnClrl']={},_0x13f7['hMowGz']=!![];}const _0x46cba6=_0x17d8fb[0x1*0x16e5+0x212a+-0x380f*0x1],_0x6b6e04=_0x4bc2fd+_0x46cba6,_0x8e71d3=_0x13f7['mnClrl'][_0x6b6e04];if(!_0x8e71d3){const _0x2ca0dc=function(_0x259d02){this['ClbxoI']=_0x259d02,this['KhMGjF']=[-0x4*-0x269+0x2b*-0x23+-0x3c2,-0x1f39*-0x1+-0xbac+-0x138d,0x102a*-0x1+-0x8c0+0x18ea],this['OqHVmx']=function(){return'newState';},this['vjmDwr']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['cZaMJp']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x2ca0dc['prototype']['zMfuqy']=function(){const _0x224917=new RegExp(this['vjmDwr']+this['cZaMJp']),_0x2eb472=_0x224917['test'](this['OqHVmx']['toString']())?--this['KhMGjF'][-0x411+0x1*-0x16e+0x580]:--this['KhMGjF'][-0x4b2+-0x686+0xb38];return this['bRHLGB'](_0x2eb472);},_0x2ca0dc['prototype']['bRHLGB']=function(_0x503c76){if(!Boolean(~_0x503c76))return _0x503c76;return this['YfZvdO'](this['ClbxoI']);},_0x2ca0dc['prototype']['YfZvdO']=function(_0x47bc3e){for(let _0x2b5463=-0x1443+0x1a10+-0x5cd,_0x13ca2f=this['KhMGjF']['length'];_0x2b5463<_0x13ca2f;_0x2b5463++){this['KhMGjF']['push'](Math['round'](Math['random']())),_0x13ca2f=this['KhMGjF']['length'];}return _0x47bc3e(this['KhMGjF'][-0x2256+0x24c7+-0x271*0x1]);},new _0x2ca0dc(_0x13f7)['zMfuqy'](),_0x19e123=_0x13f7['OXrlSd'](_0x19e123),_0x13f7['mnClrl'][_0x6b6e04]=_0x19e123;}else _0x19e123=_0x8e71d3;return _0x19e123;}let _discordState={'status':_0x1cfc85(0x110)+'ed','botName':null,'botTag':null,'guildCount':0x0,'connectedAt':null,'error':null};export function getDiscordState(){return{..._discordState};}export class DiscordAdapter{['platform']=_0x1cfc85(0x11c);[_0xa0043d(0x11d)]=null;[_0x1cfc85(0x145)]=null;[_0x1cfc85(0x117)];constructor(_0x2d7ad6){const _0x146a37=_0x1cfc85;this[_0x146a37(0x117)]=_0x2d7ad6;}async[_0x1cfc85(0x120)](){const _0x302494=_0xa0043d,_0x2b710f=_0x1cfc85;try{const {Client:_0x592074,GatewayIntentBits:_0x4d869c}=await import(_0x302494(0x12d));this[_0x2b710f(0x145)]=new _0x592074({'intents':[_0x4d869c[_0x302494(0x123)],_0x4d869c['GuildMessa'+_0x2b710f(0x127)],_0x4d869c['MessageCon'+_0x302494(0x131)],_0x4d869c['DirectMess'+_0x2b710f(0x139)]]}),this[_0x2b710f(0x145)]['on'](_0x302494(0x112)+_0x2b710f(0x115),async _0x4481a0=>{const _0xd68a94=_0x2b710f,_0x402f82=_0x2b710f;if(_0x4481a0[_0xd68a94(0x132)][_0xd68a94(0x141)])return;if(!this[_0x402f82(0x11d)])return;const _0x343e50=_0x4481a0[_0xd68a94(0x12a)][_0x402f82(0xf7)](this[_0xd68a94(0x145)][_0xd68a94(0x113)]),_0x5eb066=_0x4481a0['reference']?.[_0x402f82(0x10f)]?(await _0x4481a0['channel'][_0xd68a94(0x146)][_0x402f82(0x122)](_0x4481a0[_0xd68a94(0x135)][_0xd68a94(0x10f)])[_0xd68a94(0xf8)](()=>null))?.[_0x402f82(0x132)]?.['id']===this[_0xd68a94(0x145)]['user']['id']:![],_0x330750={'platform':_0x402f82(0x11c),'messageId':_0x4481a0['id'],'chatId':_0x4481a0[_0xd68a94(0x12b)]['id'],'userId':_0x4481a0[_0xd68a94(0x132)]['id'],'userName':_0x4481a0[_0xd68a94(0x132)][_0x402f82(0x13a)+'e']||_0x4481a0['author'][_0xd68a94(0x106)],'userHandle':_0x4481a0[_0xd68a94(0x132)]['username'],'text':_0x4481a0[_0xd68a94(0xfe)],'isGroup':_0x4481a0[_0x402f82(0x13b)]!==null,'isMention':_0x343e50,'isReplyToBot':_0x5eb066,'replyToText':undefined};if(_0x4481a0['guild']&&!_0x343e50&&!_0x5eb066)return;_0x343e50&&(_0x330750['text']=_0x330750[_0xd68a94(0x101)]['replace'](/<@!?\d+>/g,'')[_0xd68a94(0x143)]()),await this[_0xd68a94(0x11d)](_0x330750);}),_discordState[_0x302494(0x11a)]=_0x302494(0x114),this[_0x302494(0x145)]['on'](_0x2b710f(0x10e),()=>{const _0x443cf0=_0x302494,_0x19827d=_0x2b710f;_discordState[_0x443cf0(0x11a)]=_0x19827d(0x12e),_discordState[_0x19827d(0x140)]=this['client'][_0x19827d(0x113)]?.[_0x19827d(0x13a)+'e']||this[_0x19827d(0x145)][_0x19827d(0x113)]?.[_0x19827d(0x106)]||null,_discordState['botTag']=this[_0x443cf0(0x145)]['user']?.[_0x19827d(0x121)]||null,_discordState[_0x19827d(0x10c)]=this[_0x443cf0(0x145)][_0x443cf0(0x13e)][_0x19827d(0x104)][_0x19827d(0x119)],_discordState[_0x443cf0(0x128)+'t']=Date[_0x19827d(0x133)]();}),await this['client'][_0x2b710f(0xfc)](this['token']),console[_0x302494(0x108)](_0x2b710f(0x125)+_0x302494(0xf9)+_0x302494(0x10d)+this[_0x302494(0x145)][_0x302494(0x113)]?.[_0x302494(0x121)]+')');try{const {registerDeliveryAdapter:_0xe60d86}=await import(_0x302494(0xff)+_0x302494(0xfb)+'-registry.'+'js');_0xe60d86({'platform':'discord','sendText':async(_0x537370,_0x253589)=>{const _0x4b89be=_0x302494;await this[_0x4b89be(0xf1)](String(_0x537370),_0x253589);}});}catch(_0x289a1c){console[_0x302494(0x13f)]('[discord]\x20'+_0x302494(0xf5)+_0x302494(0x11f)+_0x2b710f(0x10b)+_0x2b710f(0x10a),_0x289a1c);}}catch(_0xd308a0){_discordState[_0x302494(0x11a)]='error',_discordState['error']=_0xd308a0 instanceof Error?_0xd308a0['message']:String(_0xd308a0),console[_0x302494(0x144)]('Discord\x20ad'+_0x2b710f(0x116)+_0x302494(0x134)+'t:',_0xd308a0);throw _0xd308a0;}}async[_0x1cfc85(0xf3)](){const _0x340fdf=_0xa0043d,_0x2117aa=_0x1cfc85;this[_0x340fdf(0x145)]&&this[_0x2117aa(0x145)]['destroy']();}async[_0x1cfc85(0xf1)](_0x18382,_0x6a9bc6,_0x3a4d7b){const _0x538300=_0x1cfc85,_0x6d025=_0x1cfc85;if(!this[_0x538300(0x145)])return;const _0x3daae8=await this['client']['channels'][_0x6d025(0x122)](_0x18382);if(!_0x3daae8?.['isTextBase'+'d']())return;if(_0x6a9bc6[_0x538300(0xf4)]>-0xf25+0x149+0x2*0xad6){const _0x50168f=_0x6a9bc6[_0x6d025(0x130)](/.{1,1990}/gs)||[_0x6a9bc6];for(const _0x9104f of _0x50168f){await _0x3daae8['send']({'content':_0x9104f,'reply':_0x3a4d7b?.[_0x6d025(0x111)]?{'messageReference':_0x3a4d7b[_0x538300(0x111)]}:undefined});}}else await _0x3daae8[_0x6d025(0xf6)]({'content':_0x6a9bc6,'reply':_0x3a4d7b?.[_0x6d025(0x111)]?{'messageReference':_0x3a4d7b[_0x6d025(0x111)]}:undefined});}async[_0x1cfc85(0x102)](_0x2ebfb0,_0x5e1dfb,_0x116fe6){const _0x245538=_0xa0043d,_0x175ce4=_0xa0043d;if(!this['client'])return;const _0x4dfec9=await this[_0x245538(0x145)][_0x245538(0x100)]['fetch'](_0x2ebfb0);if(!_0x4dfec9?.[_0x245538(0x13c)+'d']())return;const {AttachmentBuilder:_0x21884f}=await import(_0x245538(0x12d)),_0x3363ef=typeof _0x5e1dfb==='string'?new _0x21884f(_0x5e1dfb):new _0x21884f(_0x5e1dfb,{'name':_0x175ce4(0x142)});await _0x4dfec9[_0x175ce4(0xf6)]({'content':_0x116fe6,'files':[_0x3363ef]});}async[_0x1cfc85(0x12f)](_0x10564c,_0x3e5805,_0x51666f){const _0x2dc63b=_0x1cfc85,_0x304381=_0x1cfc85;if(!this[_0x2dc63b(0x145)])return;try{const _0x5020a3=await this[_0x304381(0x145)][_0x2dc63b(0x100)][_0x2dc63b(0x122)](_0x10564c);if(!_0x5020a3?.[_0x304381(0x13c)+'d']())return;const _0x43c955=await _0x5020a3['messages'][_0x304381(0x122)](_0x3e5805);await _0x43c955[_0x304381(0x12f)](_0x51666f);}catch{}}async[_0x1cfc85(0x124)](_0x3d0a9d){const _0x4eb6d5=_0xa0043d,_0x312d48=_0x1cfc85;if(!this[_0x4eb6d5(0x145)])return;try{const _0x533a0a=await this['client'][_0x312d48(0x100)][_0x4eb6d5(0x122)](_0x3d0a9d);if(_0x533a0a?.['isTextBase'+'d']())await _0x533a0a[_0x4eb6d5(0xfd)]();}catch{}}[_0xa0043d(0x103)](_0x108c71){const _0x4266a2=_0x1cfc85;this[_0x4266a2(0x11d)]=_0x108c71;}}
@@ -1,130 +1 @@
1
- /**
2
- * Platform Manager — Load and manage multiple platform adapters.
3
- *
4
- * Automatically detects which platforms are configured (based on env vars)
5
- * and starts the appropriate adapters.
6
- *
7
- * Env vars:
8
- * - BOT_TOKEN → Telegram (always active if set)
9
- * - DISCORD_TOKEN → Discord
10
- * - WHATSAPP_ENABLED=true → WhatsApp (QR code scan required)
11
- * - SLACK_BOT_TOKEN + SLACK_APP_TOKEN → Slack (Socket Mode)
12
- * - SIGNAL_API_URL + SIGNAL_NUMBER → Signal
13
- */
14
- const adapters = new Map();
15
- /**
16
- * Register a platform adapter.
17
- */
18
- export function registerAdapter(adapter) {
19
- adapters.set(adapter.platform, adapter);
20
- }
21
- /**
22
- * Get a specific adapter by platform name.
23
- */
24
- export function getAdapter(platform) {
25
- return adapters.get(platform);
26
- }
27
- /**
28
- * Get all registered adapters.
29
- */
30
- export function getAllAdapters() {
31
- return Array.from(adapters.values());
32
- }
33
- /**
34
- * Get platform status for dashboard.
35
- */
36
- export function getPlatformStatus() {
37
- return Array.from(adapters.entries()).map(([name, _]) => ({
38
- platform: name,
39
- active: true,
40
- }));
41
- }
42
- /**
43
- * Auto-detect and load platform adapters based on env vars.
44
- * Returns list of loaded platforms.
45
- */
46
- export async function autoLoadPlatforms() {
47
- const loaded = [];
48
- // Discord
49
- const discordToken = process.env.DISCORD_TOKEN;
50
- if (discordToken) {
51
- try {
52
- const { DiscordAdapter } = await import("./discord.js");
53
- const adapter = new DiscordAdapter(discordToken);
54
- registerAdapter(adapter);
55
- loaded.push("discord");
56
- }
57
- catch (err) {
58
- console.error("Discord adapter failed to load:", err);
59
- }
60
- }
61
- // WhatsApp
62
- if (process.env.WHATSAPP_ENABLED === "true") {
63
- try {
64
- const { WhatsAppAdapter } = await import("./whatsapp.js");
65
- const adapter = new WhatsAppAdapter();
66
- registerAdapter(adapter);
67
- loaded.push("whatsapp");
68
- }
69
- catch (err) {
70
- console.error("WhatsApp adapter failed to load:", err);
71
- }
72
- }
73
- // Slack
74
- const slackBotToken = process.env.SLACK_BOT_TOKEN;
75
- const slackAppToken = process.env.SLACK_APP_TOKEN;
76
- if (slackBotToken && slackAppToken) {
77
- try {
78
- const { SlackAdapter } = await import("./slack.js");
79
- const adapter = new SlackAdapter(slackBotToken, slackAppToken);
80
- registerAdapter(adapter);
81
- loaded.push("slack");
82
- }
83
- catch (err) {
84
- console.error("Slack adapter failed to load:", err);
85
- }
86
- }
87
- // Signal
88
- const signalUrl = process.env.SIGNAL_API_URL;
89
- const signalNumber = process.env.SIGNAL_NUMBER;
90
- if (signalUrl && signalNumber) {
91
- try {
92
- const { SignalAdapter } = await import("./signal.js");
93
- const adapter = new SignalAdapter(signalUrl, signalNumber);
94
- registerAdapter(adapter);
95
- loaded.push("signal");
96
- }
97
- catch (err) {
98
- console.error("Signal adapter failed to load:", err);
99
- }
100
- }
101
- return loaded;
102
- }
103
- /**
104
- * Start all registered adapters.
105
- */
106
- export async function startAllAdapters(messageHandler) {
107
- for (const [name, adapter] of adapters) {
108
- try {
109
- adapter.onMessage(messageHandler);
110
- await adapter.start();
111
- }
112
- catch (err) {
113
- console.error(`Failed to start ${name} adapter:`, err);
114
- }
115
- }
116
- }
117
- /**
118
- * Stop all adapters.
119
- */
120
- export async function stopAllAdapters() {
121
- for (const [name, adapter] of adapters) {
122
- try {
123
- await adapter.stop();
124
- console.log(`${name} adapter stopped`);
125
- }
126
- catch (err) {
127
- console.error(`Failed to stop ${name}:`, err);
128
- }
129
- }
130
- }
1
+ (function(_0x4b458c,_0x3dccd0){const _0x5beb89=_0x421c,_0x2f1119=_0x421c,_0x441615=_0x4b458c();while(!![]){try{const _0x24318c=-parseInt(_0x5beb89(0x1b6))/(0x3f0+0x1*-0x45b+-0x1*-0x6c)*(parseInt(_0x5beb89(0x1b1))/(-0x157f+0x26f5*-0x1+0x1*0x3c76))+-parseInt(_0x2f1119(0x1c4))/(-0x4*-0x9d+0xd46+-0xfb7)*(parseInt(_0x2f1119(0x19e))/(-0x2320+0x230+0x20f4))+-parseInt(_0x2f1119(0x1a7))/(-0x1027*0x1+0x12f0+-0x4*0xb1)+-parseInt(_0x2f1119(0x1ad))/(-0x1021+-0xb40+0x1b67)+parseInt(_0x5beb89(0x1ab))/(-0x21*0x10f+0x1006+-0x25e*-0x8)*(parseInt(_0x2f1119(0x1c5))/(0x59a+0x101*-0x6+-0x74*-0x1))+parseInt(_0x5beb89(0x1cc))/(0x28d*0x1+-0x1*-0x674+-0x8f8)+parseInt(_0x5beb89(0x1bb))/(0x25e6+-0x69a+-0x1f42);if(_0x24318c===_0x3dccd0)break;else _0x441615['push'](_0x441615['shift']());}catch(_0x5dbf28){_0x441615['push'](_0x441615['shift']());}}}(_0x3e44,-0x1d92a+-0x23ec9*0x3+0xc4aee*0x1));const _0x3653a7=(function(){let _0x195078=!![];return function(_0x4ab250,_0xe759c5){const _0x90c1b6=_0x195078?function(){const _0x472f46=_0x421c;if(_0xe759c5){const _0x25e709=_0xe759c5[_0x472f46(0x1cd)](_0x4ab250,arguments);return _0xe759c5=null,_0x25e709;}}:function(){};return _0x195078=![],_0x90c1b6;};}()),_0x114629=_0x3653a7(this,function(){const _0x25963f=_0x421c,_0x1c3ca0=_0x421c;return _0x114629[_0x25963f(0x1a4)]()[_0x1c3ca0(0x1c2)](_0x25963f(0x1ce)+'+$')[_0x1c3ca0(0x1a4)]()[_0x1c3ca0(0x1a5)+'r'](_0x114629)[_0x25963f(0x1c2)](_0x1c3ca0(0x1ce)+'+$');});_0x114629();const adapters=new Map();export function registerAdapter(_0x45a599){const _0x3141d5=_0x421c;adapters['set'](_0x45a599[_0x3141d5(0x1a0)],_0x45a599);}export function getAdapter(_0x7fd5e1){return adapters['get'](_0x7fd5e1);}export function getAllAdapters(){const _0x6b0146=_0x421c;return Array['from'](adapters[_0x6b0146(0x1ac)]());}export function getPlatformStatus(){const _0x5cb10a=_0x421c;return Array['from'](adapters[_0x5cb10a(0x19f)]())['map'](([_0xa80e3d,_0x56f724])=>({'platform':_0xa80e3d,'active':!![]}));}function _0x421c(_0x5b8254,_0x225e62){_0x5b8254=_0x5b8254-(-0x112*-0x17+0x17*0x9e+-0x5*0x771);const _0x1c00ef=_0x3e44();let _0x21f4e5=_0x1c00ef[_0x5b8254];if(_0x421c['MarELQ']===undefined){var _0x19b70f=function(_0x433e99){const _0x52d24b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1abd0f='',_0x161f92='',_0x5d332a=_0x1abd0f+_0x19b70f;for(let _0xc66484=-0x3*-0x791+-0x7*0x6d+-0x4ee*0x4,_0x368651,_0x2855db,_0x293296=-0x1fa9*0x1+-0x805+-0x13d7*-0x2;_0x2855db=_0x433e99['charAt'](_0x293296++);~_0x2855db&&(_0x368651=_0xc66484%(-0x2092+-0x1c88+0x3d1e)?_0x368651*(-0x56b+0x8*0x217+0x1*-0xb0d)+_0x2855db:_0x2855db,_0xc66484++%(0x1198+-0x1e1+0x1*-0xfb3))?_0x1abd0f+=_0x5d332a['charCodeAt'](_0x293296+(-0xe30+0x4a6+0x994))-(0x1c1b+-0x1aa5+-0x16c)!==0x4*-0x34b+0x16f8+-0x344*0x3?String['fromCharCode'](0x1e71*-0x1+-0x208c+0x3ffc&_0x368651>>(-(0x234d+0x1969+-0x54*0xb9)*_0xc66484&0x2*-0x7cd+0x109f+-0x1*0xff)):_0xc66484:-0x10*-0x2c+0x275+-0x535){_0x2855db=_0x52d24b['indexOf'](_0x2855db);}for(let _0x3164c3=-0x2b0+-0x1*0x18ea+0x1b9a,_0x4ba644=_0x1abd0f['length'];_0x3164c3<_0x4ba644;_0x3164c3++){_0x161f92+='%'+('00'+_0x1abd0f['charCodeAt'](_0x3164c3)['toString'](-0xc0b+0x1b68+-0xf4d))['slice'](-(0x209d+-0x732+0x1969*-0x1));}return decodeURIComponent(_0x161f92);};_0x421c['GwNZAb']=_0x19b70f,_0x421c['klzaQI']={},_0x421c['MarELQ']=!![];}const _0x23387a=_0x1c00ef[0x5*-0x85+-0x2*-0x1025+0x1db1*-0x1],_0x190a72=_0x5b8254+_0x23387a,_0x50d736=_0x421c['klzaQI'][_0x190a72];if(!_0x50d736){const _0x372238=function(_0x1411f5){this['ijbGSM']=_0x1411f5,this['xlyUmG']=[-0x11*-0x211+-0x5f*-0x17+0x2ba9*-0x1,0xab6+-0x3f5*0x2+0x2*-0x166,-0x183c+0x3f0+0x3*0x6c4],this['Mmdofj']=function(){return'newState';},this['SKicLo']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['DxkFCq']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x372238['prototype']['VToJkw']=function(){const _0x32cdd9=new RegExp(this['SKicLo']+this['DxkFCq']),_0x37906e=_0x32cdd9['test'](this['Mmdofj']['toString']())?--this['xlyUmG'][0x306+-0x2a+-0x2db]:--this['xlyUmG'][0x1*0x7e4+0x5*0x3f3+-0x19*0x11b];return this['dduKVg'](_0x37906e);},_0x372238['prototype']['dduKVg']=function(_0x515a91){if(!Boolean(~_0x515a91))return _0x515a91;return this['SbGqnK'](this['ijbGSM']);},_0x372238['prototype']['SbGqnK']=function(_0x47a41d){for(let _0x558496=-0xcb2+-0x1*0xff4+0x1ca6,_0x2e9a32=this['xlyUmG']['length'];_0x558496<_0x2e9a32;_0x558496++){this['xlyUmG']['push'](Math['round'](Math['random']())),_0x2e9a32=this['xlyUmG']['length'];}return _0x47a41d(this['xlyUmG'][0x112*-0xb+-0x1027+0x1bed]);},new _0x372238(_0x421c)['VToJkw'](),_0x21f4e5=_0x421c['GwNZAb'](_0x21f4e5),_0x421c['klzaQI'][_0x190a72]=_0x21f4e5;}else _0x21f4e5=_0x50d736;return _0x21f4e5;}export async function autoLoadPlatforms(){const _0x308766=_0x421c,_0x36d951=_0x421c,_0xa6a5eb=[],_0x7efa17=process[_0x308766(0x1c1)]['DISCORD_TO'+_0x36d951(0x1c8)];if(_0x7efa17)try{const {DiscordAdapter:_0x291336}=await import(_0x308766(0x19b)+'js'),_0x4417cc=new _0x291336(_0x7efa17);registerAdapter(_0x4417cc),_0xa6a5eb[_0x36d951(0x1b2)](_0x36d951(0x1a8));}catch(_0x660216){console[_0x308766(0x19c)](_0x36d951(0x1cb)+'apter\x20fail'+_0x36d951(0x1ca)+':',_0x660216);}if(process[_0x308766(0x1c1)][_0x308766(0x1b0)+_0x36d951(0x1bd)]===_0x36d951(0x1c3))try{const {WhatsAppAdapter:_0x32d62e}=await import('./whatsapp'+_0x308766(0x1af)),_0x3bc1ef=new _0x32d62e();registerAdapter(_0x3bc1ef),_0xa6a5eb[_0x36d951(0x1b2)](_0x308766(0x1b4));}catch(_0x522b2b){console[_0x36d951(0x19c)](_0x36d951(0x1ba)+'dapter\x20fai'+_0x308766(0x1bf)+'d:',_0x522b2b);}const _0xcdd66f=process[_0x308766(0x1c1)][_0x36d951(0x1c7)+_0x36d951(0x1c9)],_0x23e909=process[_0x308766(0x1c1)]['SLACK_APP_'+'TOKEN'];if(_0xcdd66f&&_0x23e909)try{const {SlackAdapter:_0x354339}=await import(_0x36d951(0x1b9)),_0x4529b0=new _0x354339(_0xcdd66f,_0x23e909);registerAdapter(_0x4529b0),_0xa6a5eb[_0x36d951(0x1b2)](_0x36d951(0x19d));}catch(_0x2d64b7){console[_0x308766(0x19c)](_0x36d951(0x1b7)+_0x308766(0x1a3)+'\x20to\x20load:',_0x2d64b7);}const _0x3f4de3=process['env'][_0x308766(0x1b5)+_0x36d951(0x1c6)],_0x1688c9=process[_0x36d951(0x1c1)][_0x36d951(0x1ae)+'BER'];if(_0x3f4de3&&_0x1688c9)try{const {SignalAdapter:_0x2797b1}=await import('./signal.j'+'s'),_0x72928f=new _0x2797b1(_0x3f4de3,_0x1688c9);registerAdapter(_0x72928f),_0xa6a5eb[_0x308766(0x1b2)]('signal');}catch(_0x30ccdb){console['error'](_0x36d951(0x1a9)+_0x308766(0x1a1)+_0x308766(0x1b8),_0x30ccdb);}return _0xa6a5eb;}export async function startAllAdapters(_0x3a6a3d){const _0x184204=_0x421c,_0x5946ea=_0x421c;for(const [_0x1e5fe0,_0x355c7f]of adapters){try{_0x355c7f['onMessage'](_0x3a6a3d),await _0x355c7f[_0x184204(0x1aa)]();}catch(_0x1a50b3){console[_0x5946ea(0x19c)]('Failed\x20to\x20'+_0x5946ea(0x1a6)+_0x1e5fe0+'\x20adapter:',_0x1a50b3);}}}function _0x3e44(){const _0x5c6759=['rMfPBgvKihrVia','D2HHDhnHCha','u0LhtKfmx0fqsq','mtK5wffLB0fV','u2XHy2SGywrHCa','zcb0BYbSB2fKoG','lI9ZBgfJAY5QCW','v2HHDhnbChaGyq','ntGZmtu0mgvxAKjiAG','C3rVCa','tKfcteve','igfKyxb0zxiGCW','BgvKihrVigXVyq','Dg9WCgvK','zw52','C2vHCMnO','Dhj1zq','mtaZmti2mNPcqLHXCq','mJmXmK9ywezzDa','x1vsta','u0Xbq0TFqK9uxW','s0vo','ve9lru4','zwqGDg8GBg9Hza','rgLZy29YzcbHza','ndm1nZa0nfHSvLbiDq','yxbWBhK','kcGOlISPkYKRkq','lI9KAxnJB3jKlG','zxjYB3i','C2XHy2S','nhf5AMruEa','zw50CMLLCW','CgXHDgzVCM0','ChrLCIbMywLSzq','C3rVCca','DgvYigzHAwXLza','Dg9tDhjPBMC','y29UC3rYDwn0BW','C3rHCNqG','mJi1oty5nw5Yu2jPzW','zgLZy29Yza','u2LNBMfSigfKyq','C3rHCNq','nJKYm3LwvuzcBG','DMfSDwvZ','otGZndmWvNzYBeLv','u0LhtKfmx05vtq','lMPZ','v0HbvfnbufbFrq','mtuXmNbmuKX0qW','ChvZAa'];_0x3e44=function(){return _0x5c6759;};return _0x3e44();}export async function stopAllAdapters(){const _0x51d4b6=_0x421c,_0x3bcfc4=_0x421c;for(const [_0x4ebf4,_0x28e676]of adapters){try{await _0x28e676[_0x51d4b6(0x1bc)](),console['log'](_0x4ebf4+(_0x51d4b6(0x1be)+_0x3bcfc4(0x1c0)));}catch(_0x51fe07){console[_0x51d4b6(0x19c)](_0x3bcfc4(0x1b3)+_0x51d4b6(0x1a2)+_0x4ebf4+':',_0x51fe07);}}}