squidclaw 3.0.32 → 3.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{accounts-BFS_qklA.js → accounts-CB2Or0mr.js} +2 -2
- package/dist/{accounts-DfrJiFJJ.js → accounts-Cop2dSRo.js} +2 -2
- package/dist/{accounts-pMDX8iho.js → accounts-CqITV0Ga.js} +4 -4
- package/dist/{active-listener-CH2vJ3EZ.js → active-listener-B6G6kmsb.js} +2 -2
- package/dist/{api-key-rotation-DCBXT0v7.js → api-key-rotation-Da2qYrP7.js} +2 -2
- package/dist/{audio-preflight-B5XvcdFX.js → audio-preflight-yiMsGLW7.js} +30 -30
- package/dist/{audio-transcription-runner-DUC0ItDY.js → audio-transcription-runner-Mha07yP4.js} +12 -12
- package/dist/{audit-membership-runtime-czdecfjJ.js → audit-membership-runtime-By9-qSwl.js} +3 -3
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +49 -49
- package/dist/bundled/bootstrap-extra-files/handler.js +5 -5
- package/dist/bundled/command-logger/handler.js +1 -1
- package/dist/bundled/session-memory/HOOK.md +2 -1
- package/dist/bundled/session-memory/handler.js +190 -55
- package/dist/{channel-activity-7QMEKenc.js → channel-activity-Du1kh0t3.js} +3 -3
- package/dist/{chrome-BTwG9Gvh.js → chrome-C2CliEWR.js} +15 -15
- package/dist/{commands-registry-BIi1tG__.js → commands-registry-6jWzz0mk.js} +4 -4
- package/dist/{deliver-DZCNXFM8.js → deliver-Ddw3EsOV.js} +11 -11
- package/dist/deliver-runtime-CF9aNwHW.js +36 -0
- package/dist/deps-send-discord.runtime-BdlL7AnG.js +26 -0
- package/dist/deps-send-imessage.runtime-BQx5JSa_.js +25 -0
- package/dist/deps-send-signal.runtime-dgrmoRN9.js +24 -0
- package/dist/deps-send-slack.runtime-CCOjVEQr.js +22 -0
- package/dist/deps-send-telegram.runtime-BgwTF5zt.js +27 -0
- package/dist/deps-send-whatsapp.runtime-C_zE7G9V.js +60 -0
- package/dist/{deps-send-whatsapp.runtime-rPF4BAeN.js → deps-send-whatsapp.runtime-DhuS0SeA.js} +2 -2
- package/dist/{diagnostic-4Dbmo6KU.js → diagnostic-B74jJPqv.js} +2 -2
- package/dist/{errors-Dih7OXdL.js → errors-CCLnP2Fs.js} +1 -1
- package/dist/extensionAPI.js +1 -1
- package/dist/{fetch-COEkF6YP.js → fetch-OMudX6HR.js} +4 -4
- package/dist/{fetch-guard-CcP28UT1.js → fetch-guard-DBZ7o2IA.js} +2 -2
- package/dist/{frontmatter-LLGh43CC.js → frontmatter-vSrur-r-.js} +3 -3
- package/dist/{fs-safe-NHJJ1b9f.js → fs-safe-Dy2_iDiY.js} +3 -3
- package/dist/{image-COAbpp2B.js → image-CdfqhHaX.js} +6 -6
- package/dist/{image-ops-QLLBkxzG.js → image-ops-BQmWYj-1.js} +2 -2
- package/dist/image-runtime-BFxy3jl0.js +29 -0
- package/dist/{ir-RKRKj5a9.js → ir-DEPhOdwg.js} +8 -8
- package/dist/{legacy-names-CR_H5NWa.js → legacy-names-CDxprteD.js} +1 -1
- package/dist/llm-slug-generator.js +49 -49
- package/dist/{logger-D20iS3B-.js → logger-onBePS9K.js} +1 -1
- package/dist/{login-C1_lumKW.js → login-BPzRFY6S.js} +5 -5
- package/dist/{login-qr-D0Gij2UC.js → login-qr-BZbSxC-5.js} +8 -8
- package/dist/{manager-B_QaG_-L.js → manager-D3ROcs7_.js} +9 -9
- package/dist/manager-runtime-Dup90ARI.js +18 -0
- package/dist/{model-selection-Bjj4oU16.js → model-selection-Bh4BR1_K.js} +10 -10
- package/dist/{outbound-ChkqJkiM.js → outbound-BApjXYwN.js} +6 -6
- package/dist/{outbound-attachment-CRXa01xP.js → outbound-attachment-1Yd0-JW2.js} +2 -2
- package/dist/{path-alias-guards-DgNuZPBA.js → path-alias-guards-B63g_1Gb.js} +1 -1
- package/dist/{paths-7EEBmI5a.js → paths-BJWEyNJy.js} +1 -1
- package/dist/{pi-embedded-BoY_A7hg.js → pi-embedded-BPU69pec.js} +50 -50
- package/dist/{pi-embedded-CLTN3qXD.js → pi-embedded-Cajbf_ri.js} +131 -131
- package/dist/{pi-embedded-helpers-1Z1aUoto.js → pi-embedded-helpers-xpgo_nwz.js} +19 -19
- package/dist/{pi-model-discovery-DSuyTtRM.js → pi-model-discovery-BbCPyLm5.js} +1 -1
- package/dist/pi-model-discovery-runtime-BeF5ldX8.js +11 -0
- package/dist/{pi-tools.before-tool-call.runtime-BCq4EKHD.js → pi-tools.before-tool-call.runtime-s89v8h6G.js} +7 -7
- package/dist/plugin-sdk/accounts-BXFDqY90.js +288 -0
- package/dist/plugin-sdk/accounts-DU7Js54-.js +46 -0
- package/dist/plugin-sdk/accounts-DxiB_4z4.js +35 -0
- package/dist/plugin-sdk/active-listener-DRKcesNb.js +50 -0
- package/dist/plugin-sdk/api-key-rotation-k1ZNheUH.js +181 -0
- package/dist/plugin-sdk/audio-preflight-Be1sKsob.js +69 -0
- package/dist/plugin-sdk/audio-transcription-runner-jhHyCc_7.js +2176 -0
- package/dist/plugin-sdk/audit-membership-runtime-B9b-zRwg.js +58 -0
- package/dist/plugin-sdk/channel-activity-Bq1Y9RiB.js +94 -0
- package/dist/plugin-sdk/channel-web-AsdjtnvN.js +2256 -0
- package/dist/plugin-sdk/chrome-DOnBMnlx.js +2415 -0
- package/dist/plugin-sdk/commands-registry-D0py59pz.js +1125 -0
- package/dist/plugin-sdk/config-B16xKqSo.js +17912 -0
- package/dist/plugin-sdk/deliver-BqXXtIuw.js +1694 -0
- package/dist/plugin-sdk/deliver-runtime-D0xZkt8n.js +32 -0
- package/dist/plugin-sdk/deps-send-discord.runtime-BM6ppx2Q.js +23 -0
- package/dist/plugin-sdk/deps-send-imessage.runtime-3w5PhXGu.js +22 -0
- package/dist/plugin-sdk/deps-send-signal.runtime-yH9cQl3_.js +21 -0
- package/dist/plugin-sdk/deps-send-slack.runtime-Bh4gw-L5.js +19 -0
- package/dist/plugin-sdk/deps-send-telegram.runtime-C_CtsWgt.js +24 -0
- package/dist/plugin-sdk/deps-send-whatsapp.runtime-BF4vx9Ho.js +57 -0
- package/dist/plugin-sdk/diagnostic-DUbajFSl.js +319 -0
- package/dist/plugin-sdk/errors-B8oJXuCF.js +54 -0
- package/dist/plugin-sdk/fetch-guard-Cgyq6Jv9.js +156 -0
- package/dist/plugin-sdk/fs-safe-BW1ypSDS.js +352 -0
- package/dist/plugin-sdk/image-BPXnvxYL.js +2310 -0
- package/dist/plugin-sdk/image-ops-BBY2fn9x.js +584 -0
- package/dist/plugin-sdk/image-runtime-S-TzaJpg.js +25 -0
- package/dist/plugin-sdk/imessage.js +2 -2
- package/dist/plugin-sdk/index.js +50 -50
- package/dist/plugin-sdk/ir-BJsqyZfm.js +1296 -0
- package/dist/plugin-sdk/local-roots-C1ETRlaC.js +186 -0
- package/dist/plugin-sdk/logger-DDdrdbDu.js +1163 -0
- package/dist/plugin-sdk/login-DtS9DDnV.js +57 -0
- package/dist/plugin-sdk/login-qr-B9YeeJ37.js +320 -0
- package/dist/plugin-sdk/manager-Dn7j3n0d.js +3917 -0
- package/dist/plugin-sdk/manager-runtime-UK1-iA2B.js +15 -0
- package/dist/plugin-sdk/mattermost.js +3 -3
- package/dist/plugin-sdk/outbound-B8ca8vE3.js +212 -0
- package/dist/plugin-sdk/outbound-attachment-BppFIMQa.js +19 -0
- package/dist/plugin-sdk/path-alias-guards-BX-3FprC.js +43 -0
- package/dist/plugin-sdk/paths-CjFcHB_C.js +166 -0
- package/dist/plugin-sdk/pi-embedded-helpers-BeYjP1MW.js +9627 -0
- package/dist/plugin-sdk/pi-model-discovery-B_qCKuSW.js +134 -0
- package/dist/plugin-sdk/pi-model-discovery-runtime-CZNiNFlm.js +8 -0
- package/dist/plugin-sdk/pi-tools.before-tool-call.runtime-cZdrrV27.js +354 -0
- package/dist/plugin-sdk/plugins-rivB8KaQ.js +864 -0
- package/dist/{proxy-fetch-ChIxNDe3.js → plugin-sdk/proxy-fetch-ZPEvp58f.js} +1 -1
- package/dist/plugin-sdk/pw-ai-qaWZD0yx.js +1938 -0
- package/dist/plugin-sdk/qmd-manager-izn0N9V3.js +1448 -0
- package/dist/plugin-sdk/query-expansion-C1Nx0XAb.js +1011 -0
- package/dist/{redact-BSwbgwaV.js → plugin-sdk/redact-BoNEjbpF.js} +1 -1
- package/dist/plugin-sdk/reply-DNSpho0-.js +98763 -0
- package/dist/plugin-sdk/resolve-outbound-target-YiPIGXVN.js +40 -0
- package/dist/plugin-sdk/run-with-concurrency-vfuRiXdY.js +2023 -0
- package/dist/plugin-sdk/runtime-whatsapp-login.runtime-BgwMJs4X.js +10 -0
- package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-Y7maoii7.js +19 -0
- package/dist/plugin-sdk/send-BSD6Pkrk.js +414 -0
- package/dist/plugin-sdk/send-C4KxEJe1.js +503 -0
- package/dist/plugin-sdk/send-D3XVKGvq.js +540 -0
- package/dist/plugin-sdk/send-DFrnRiWm.js +3135 -0
- package/dist/plugin-sdk/send-Dh1f5xjE.js +2587 -0
- package/dist/plugin-sdk/session-D5c0BIEo.js +169 -0
- package/dist/plugin-sdk/skill-commands-CnqkEfhS.js +342 -0
- package/dist/plugin-sdk/skills-DSbDUvmU.js +1428 -0
- package/dist/plugin-sdk/slack.js +2 -2
- package/dist/plugin-sdk/slash-commands.runtime-Dbtq7ppF.js +13 -0
- package/dist/plugin-sdk/slash-dispatch.runtime-BhAks953.js +52 -0
- package/dist/plugin-sdk/slash-skill-commands.runtime-QGNWVO9S.js +16 -0
- package/dist/plugin-sdk/ssrf-DvsjfpC2.js +202 -0
- package/dist/plugin-sdk/store-DG90hxe6.js +81 -0
- package/dist/plugin-sdk/subagent-registry-runtime-Db83OZ3_.js +52 -0
- package/dist/plugin-sdk/tables-DNlQ8oQ3.js +55 -0
- package/dist/{target-errors-BMTA5KVE.js → plugin-sdk/target-errors-BlVYPwVC.js} +2 -2
- package/dist/plugin-sdk/thinking-DT2ZR60x.js +1206 -0
- package/dist/{tokens-Cdk21tF_.js → plugin-sdk/tokens-CTIYTLWu.js} +1 -1
- package/dist/plugin-sdk/tool-images-DroS1EaM.js +274 -0
- package/dist/plugin-sdk/web-42d5VBZj.js +56 -0
- package/dist/plugin-sdk/whatsapp-actions-DR2aYq5f.js +80 -0
- package/dist/{plugins-D-K4oUXz.js → plugins-D8QbEQB8.js} +6 -6
- package/dist/{proxy-env-D9oPe73i.js → proxy-env-DS2YEWWX.js} +1 -1
- package/dist/proxy-fetch-08-dhqxn.js +38 -0
- package/dist/{pw-ai-4QFtj-s9.js → pw-ai-rD2G8OP-.js} +12 -12
- package/dist/{qmd-manager-CIcyVJmI.js → qmd-manager-B9vC7u4w.js} +9 -9
- package/dist/{query-expansion-BMExPdLO.js → query-expansion-o9Ib6_Rk.js} +4 -4
- package/dist/redact-rnJm_Z5E.js +319 -0
- package/dist/{run-with-concurrency-hJFK7PcO.js → run-with-concurrency-C3dKaL_j.js} +3 -3
- package/dist/runtime-whatsapp-login.runtime-BVm0A03Y.js +13 -0
- package/dist/runtime-whatsapp-outbound.runtime-d8oRCgsW.js +22 -0
- package/dist/{send-DySBiOxg.js → send-6s7HVGcN.js} +7 -7
- package/dist/{send-BMtxl7vL.js → send-BdQyKIzE.js} +5 -5
- package/dist/{send-DJcNRhf_.js → send-CAzswJK6.js} +8 -8
- package/dist/{send-CNzGOCHa.js → send-DKB7vlw3.js} +6 -6
- package/dist/{send-pUHxPU20.js → send-Q5SBsGfY.js} +14 -14
- package/dist/{session-DOFapRIv.js → session-D2CiV8TN.js} +4 -4
- package/dist/{skill-commands-yvTkQtnt.js → skill-commands-CgJiKg3Q.js} +5 -5
- package/dist/{skills-BjHeDO5V.js → skills-DNyMj13y.js} +7 -7
- package/dist/slash-commands.runtime-Cvnjq5gh.js +16 -0
- package/dist/{slash-dispatch.runtime-B79IzyjK.js → slash-dispatch.runtime-UHClfKIh.js} +1 -1
- package/dist/slash-dispatch.runtime-YGQtou1U.js +56 -0
- package/dist/slash-skill-commands.runtime-BbZPUdhN.js +20 -0
- package/dist/{store-C3iBzr-_.js → store-Bdm7wypS.js} +2 -2
- package/dist/{subagent-registry-runtime-CFbDYdKR.js → subagent-registry-runtime-BYDycq2m.js} +1 -1
- package/dist/subagent-registry-runtime-DoZWJdY9.js +56 -0
- package/dist/{subsystem-CWsKV5VU.js → subsystem-BJ89YjCN.js} +2 -2
- package/dist/{tables-Bv8tJ0qC.js → tables-MEAoO_QC.js} +1 -1
- package/dist/target-errors-qetEoXTB.js +195 -0
- package/dist/{thinking-BB_GM390.js → thinking-CaLooOu4.js} +7 -7
- package/dist/tokens-9NF8L9Uh.js +52 -0
- package/dist/{tool-images-HRwkh81U.js → tool-images-CkmNQqHm.js} +2 -2
- package/dist/{web-BUpcF84p.js → web-CGbFuIR9.js} +1 -1
- package/dist/{web-BbpOMti_.js → web-ajuJjPrA.js} +53 -53
- package/dist/{whatsapp-actions-CuLcPfQ9.js → whatsapp-actions-DuJpyhRe.js} +19 -19
- package/dist/{workspace-MO4aE903.js → workspace-CkozFUzc.js} +2 -2
- package/package.json +2 -2
- package/dist/deliver-runtime-BJoBkkm_.js +0 -36
- package/dist/deps-send-discord.runtime-Dlb1pOSn.js +0 -26
- package/dist/deps-send-imessage.runtime-DmVvqFTt.js +0 -25
- package/dist/deps-send-signal.runtime-DPX_GcJK.js +0 -24
- package/dist/deps-send-slack.runtime-s7wb1ssP.js +0 -22
- package/dist/deps-send-telegram.runtime-DcIT4v5p.js +0 -27
- package/dist/deps-send-whatsapp.runtime-DfAhniLS.js +0 -60
- package/dist/image-runtime-Dkwf1-U3.js +0 -29
- package/dist/manager-runtime-DPiPNTWB.js +0 -18
- package/dist/pi-model-discovery-runtime-CRif8A8F.js +0 -11
- package/dist/runtime-whatsapp-login.runtime-DTnmQLV1.js +0 -13
- package/dist/runtime-whatsapp-outbound.runtime-Da-07rzo.js +0 -22
- package/dist/slash-commands.runtime-FS9JZ9BW.js +0 -16
- package/dist/slash-dispatch.runtime-BZw5XlvY.js +0 -56
- package/dist/slash-skill-commands.runtime-BZIbPU6x.js +0 -20
- package/dist/subagent-registry-runtime-Blx4zbr0.js +0 -56
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { f as resolveSessionAgentId, i as resolveAgentConfig } from "./run-with-concurrency-
|
|
1
|
+
import { f as resolveSessionAgentId, i as resolveAgentConfig } from "./run-with-concurrency-C3dKaL_j.js";
|
|
2
2
|
import { a as resolveGatewayPort, d as resolveRequiredHomeDir, n as STATE_DIR } from "./paths-ZhiQAuKk.js";
|
|
3
|
-
import { i as defaultRuntime, t as createSubsystemLogger } from "./subsystem-
|
|
4
|
-
import { B as resolveAgentIdFromSessionKey, K as normalizeOptionalAccountId, N as buildAgentMainSessionKey, R as normalizeAgentId, T as resolvePathViaExistingAncestorSync, _ as runExec, a as DEFAULT_IDENTITY_FILENAME, b as openBoundaryFile, c as DEFAULT_USER_FILENAME, i as DEFAULT_HEARTBEAT_FILENAME, j as DEFAULT_AGENT_ID, l as ensureAgentWorkspace, n as DEFAULT_AGENT_WORKSPACE_DIR, o as DEFAULT_SOUL_FILENAME, r as DEFAULT_BOOTSTRAP_FILENAME, s as DEFAULT_TOOLS_FILENAME, t as DEFAULT_AGENTS_FILENAME, z as normalizeMainKey } from "./workspace-
|
|
5
|
-
import { E as truncateUtf16Safe, h as normalizeE164, y as resolveUserPath } from "./logger-
|
|
6
|
-
import { Vt as CHANNEL_IDS, W as resolveSecretRefValues, X as loadConfig, Y as createConfigIO, _r as resolveSecretInputRef, cr as isPidAlive, et as writeConfigFile, ft as secretRefKey, ht as parseByteSize, lr as formatCliCommand, mt as parseDurationMs, or as resolveProcessScopedMap, pt as getBlockedNetworkModeReason, sr as getProcessStartTime } from "./model-selection-
|
|
7
|
-
import { c as parseBooleanValue } from "./legacy-names-
|
|
8
|
-
import { d as getChannelDock, o as normalizeThinkLevel, v as normalizeHyphenSlug } from "./thinking-
|
|
9
|
-
import { _ as normalizeChatType, r as normalizeChannelId } from "./plugins-
|
|
3
|
+
import { i as defaultRuntime, t as createSubsystemLogger } from "./subsystem-BJ89YjCN.js";
|
|
4
|
+
import { B as resolveAgentIdFromSessionKey, K as normalizeOptionalAccountId, N as buildAgentMainSessionKey, R as normalizeAgentId, T as resolvePathViaExistingAncestorSync, _ as runExec, a as DEFAULT_IDENTITY_FILENAME, b as openBoundaryFile, c as DEFAULT_USER_FILENAME, i as DEFAULT_HEARTBEAT_FILENAME, j as DEFAULT_AGENT_ID, l as ensureAgentWorkspace, n as DEFAULT_AGENT_WORKSPACE_DIR, o as DEFAULT_SOUL_FILENAME, r as DEFAULT_BOOTSTRAP_FILENAME, s as DEFAULT_TOOLS_FILENAME, t as DEFAULT_AGENTS_FILENAME, z as normalizeMainKey } from "./workspace-CkozFUzc.js";
|
|
5
|
+
import { E as truncateUtf16Safe, h as normalizeE164, y as resolveUserPath } from "./logger-onBePS9K.js";
|
|
6
|
+
import { Vt as CHANNEL_IDS, W as resolveSecretRefValues, X as loadConfig, Y as createConfigIO, _r as resolveSecretInputRef, cr as isPidAlive, et as writeConfigFile, ft as secretRefKey, ht as parseByteSize, lr as formatCliCommand, mt as parseDurationMs, or as resolveProcessScopedMap, pt as getBlockedNetworkModeReason, sr as getProcessStartTime } from "./model-selection-Bh4BR1_K.js";
|
|
7
|
+
import { c as parseBooleanValue } from "./legacy-names-CDxprteD.js";
|
|
8
|
+
import { d as getChannelDock, o as normalizeThinkLevel, v as normalizeHyphenSlug } from "./thinking-CaLooOu4.js";
|
|
9
|
+
import { _ as normalizeChatType, r as normalizeChannelId } from "./plugins-D8QbEQB8.js";
|
|
10
10
|
import { t as generateSecureToken } from "./secure-random-CXrBi7Jq.js";
|
|
11
|
-
import { i as getImageMetadata, m as normalizeMessageChannel, n as buildImageResizeSideGrid, p as listDeliverableMessageChannels, s as resizeToJpeg, t as IMAGE_REDUCE_QUALITY_STEPS } from "./image-ops-
|
|
12
|
-
import { C as ensureChromeExtensionRelayServer, D as PROFILE_POST_RESTART_WS_TIMEOUT_MS, E as PROFILE_ATTACH_RETRY_TIMEOUT_MS, G as DEFAULT_BROWSER_EVALUATE_ENABLED, H as DEFAULT_AI_SNAPSHOT_EFFICIENT_MAX_CHARS, I as resolveWritablePathWithinRoot, J as DEFAULT_SQUIDCLAW_BROWSER_PROFILE_NAME, K as DEFAULT_SQUIDCLAW_BROWSER_COLOR, M as DEFAULT_TRACE_DIR, N as DEFAULT_UPLOAD_DIR, O as resolveCdpReachabilityTimeouts, P as resolveExistingPathsWithinRoot, R as normalizeBrowserFormField, T as CDP_JSON_NEW_TIMEOUT_MS, U as DEFAULT_AI_SNAPSHOT_MAX_CHARS, V as DEFAULT_AI_SNAPSHOT_EFFICIENT_DEPTH, W as DEFAULT_BROWSER_DEFAULT_PROFILE_NAME, _ as withBrowserNavigationPolicy, a as resolveSquidClawUserDataDir, b as fetchOk, c as resolveBrowserExecutableForPlatform, f as normalizeCdpWsUrl, g as assertBrowserNavigationResultAllowed, h as assertBrowserNavigationAllowed, i as launchSquidClawChrome, j as DEFAULT_DOWNLOAD_DIR, l as captureScreenshot, m as InvalidBrowserNavigationUrlError, n as isChromeCdpReady, o as stopSquidClawChrome, p as snapshotAria, q as DEFAULT_SQUIDCLAW_BROWSER_ENABLED, r as isChromeReachable, u as createTargetViaCdp, v as appendCdpPath, w as stopChromeExtensionRelayServer, y as fetchJson, z as isLoopbackHost } from "./chrome-
|
|
13
|
-
import { a as syncSkillsToWorkspace, l as resolveSandboxInputPath, m as sanitizeEnvVars, u as resolveSandboxPath } from "./skills-
|
|
14
|
-
import { t as PATH_ALIAS_POLICIES } from "./path-alias-guards-
|
|
15
|
-
import { n as extractErrorCode, r as formatErrorMessage } from "./errors-
|
|
16
|
-
import { n as SsrFBlockedError } from "./proxy-env-
|
|
17
|
-
import { i as saveMediaBuffer, n as ensureMediaDir } from "./store-
|
|
11
|
+
import { i as getImageMetadata, m as normalizeMessageChannel, n as buildImageResizeSideGrid, p as listDeliverableMessageChannels, s as resizeToJpeg, t as IMAGE_REDUCE_QUALITY_STEPS } from "./image-ops-BQmWYj-1.js";
|
|
12
|
+
import { C as ensureChromeExtensionRelayServer, D as PROFILE_POST_RESTART_WS_TIMEOUT_MS, E as PROFILE_ATTACH_RETRY_TIMEOUT_MS, G as DEFAULT_BROWSER_EVALUATE_ENABLED, H as DEFAULT_AI_SNAPSHOT_EFFICIENT_MAX_CHARS, I as resolveWritablePathWithinRoot, J as DEFAULT_SQUIDCLAW_BROWSER_PROFILE_NAME, K as DEFAULT_SQUIDCLAW_BROWSER_COLOR, M as DEFAULT_TRACE_DIR, N as DEFAULT_UPLOAD_DIR, O as resolveCdpReachabilityTimeouts, P as resolveExistingPathsWithinRoot, R as normalizeBrowserFormField, T as CDP_JSON_NEW_TIMEOUT_MS, U as DEFAULT_AI_SNAPSHOT_MAX_CHARS, V as DEFAULT_AI_SNAPSHOT_EFFICIENT_DEPTH, W as DEFAULT_BROWSER_DEFAULT_PROFILE_NAME, _ as withBrowserNavigationPolicy, a as resolveSquidClawUserDataDir, b as fetchOk, c as resolveBrowserExecutableForPlatform, f as normalizeCdpWsUrl, g as assertBrowserNavigationResultAllowed, h as assertBrowserNavigationAllowed, i as launchSquidClawChrome, j as DEFAULT_DOWNLOAD_DIR, l as captureScreenshot, m as InvalidBrowserNavigationUrlError, n as isChromeCdpReady, o as stopSquidClawChrome, p as snapshotAria, q as DEFAULT_SQUIDCLAW_BROWSER_ENABLED, r as isChromeReachable, u as createTargetViaCdp, v as appendCdpPath, w as stopChromeExtensionRelayServer, y as fetchJson, z as isLoopbackHost } from "./chrome-C2CliEWR.js";
|
|
13
|
+
import { a as syncSkillsToWorkspace, l as resolveSandboxInputPath, m as sanitizeEnvVars, u as resolveSandboxPath } from "./skills-DNyMj13y.js";
|
|
14
|
+
import { t as PATH_ALIAS_POLICIES } from "./path-alias-guards-B63g_1Gb.js";
|
|
15
|
+
import { n as extractErrorCode, r as formatErrorMessage } from "./errors-CCLnP2Fs.js";
|
|
16
|
+
import { n as SsrFBlockedError } from "./proxy-env-DS2YEWWX.js";
|
|
17
|
+
import { i as saveMediaBuffer, n as ensureMediaDir } from "./store-Bdm7wypS.js";
|
|
18
18
|
import { n as resolveWindowsSpawnProgram, t as materializeWindowsSpawnProgram } from "./windows-spawn-B89VigUN.js";
|
|
19
19
|
import { i as writeTextAtomic, r as writeJsonAtomic } from "./json-files-D7-rxoSr.js";
|
|
20
|
-
import { a as resolveSessionTranscriptPathInDir, i as resolveSessionTranscriptPath, n as resolveSessionFilePath, s as resolveStorePath, t as resolveDefaultSessionStorePath } from "./paths-
|
|
20
|
+
import { a as resolveSessionTranscriptPathInDir, i as resolveSessionTranscriptPath, n as resolveSessionFilePath, s as resolveStorePath, t as resolveDefaultSessionStorePath } from "./paths-BJWEyNJy.js";
|
|
21
21
|
import { t as emitSessionTranscriptUpdate } from "./transcript-events-uYL2gEou.js";
|
|
22
|
-
import { t as sanitizeContentBlocksImages } from "./tool-images-
|
|
22
|
+
import { t as sanitizeContentBlocksImages } from "./tool-images-CkmNQqHm.js";
|
|
23
23
|
import fs from "node:fs/promises";
|
|
24
24
|
import os from "node:os";
|
|
25
25
|
import path, { posix } from "node:path";
|
|
@@ -1278,7 +1278,7 @@ function isModuleNotFoundError(err) {
|
|
|
1278
1278
|
}
|
|
1279
1279
|
async function loadPwAiModule(mode) {
|
|
1280
1280
|
try {
|
|
1281
|
-
return await import("./pw-ai-
|
|
1281
|
+
return await import("./pw-ai-rD2G8OP-.js");
|
|
1282
1282
|
} catch (err) {
|
|
1283
1283
|
if (mode === "soft") return null;
|
|
1284
1284
|
if (isModuleNotFoundError(err)) return null;
|
|
@@ -3644,7 +3644,7 @@ function createProfileAvailability({ opts, profile, state, getProfileState, setP
|
|
|
3644
3644
|
//#region src/browser/server-context.reset.ts
|
|
3645
3645
|
async function closePlaywrightBrowserConnection() {
|
|
3646
3646
|
try {
|
|
3647
|
-
await (await import("./pw-ai-
|
|
3647
|
+
await (await import("./pw-ai-rD2G8OP-.js")).closePlaywrightBrowserConnection();
|
|
3648
3648
|
} catch {}
|
|
3649
3649
|
}
|
|
3650
3650
|
function createProfileResetOps({ profile, getProfileState, stopRunningBrowser, isHttpReachable, resolveSquidClawUserDataDir }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { c as normalizeProviderId, nr as ensureAuthProfileStore } from "./model-selection-
|
|
2
|
+
import { c as normalizeProviderId, nr as ensureAuthProfileStore } from "./model-selection-Bh4BR1_K.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import fssync from "node:fs";
|
|
5
5
|
import * as PiCodingAgent from "@mariozechner/pi-coding-agent";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./run-with-concurrency-C3dKaL_j.js";
|
|
2
|
+
import "./paths-ZhiQAuKk.js";
|
|
3
|
+
import "./subsystem-BJ89YjCN.js";
|
|
4
|
+
import "./workspace-CkozFUzc.js";
|
|
5
|
+
import "./logger-onBePS9K.js";
|
|
6
|
+
import "./model-selection-Bh4BR1_K.js";
|
|
7
|
+
import "./github-copilot-token-B8Wx9FgQ.js";
|
|
8
|
+
import "./legacy-names-CDxprteD.js";
|
|
9
|
+
import { n as discoverModels, t as discoverAuthStorage } from "./pi-model-discovery-BbCPyLm5.js";
|
|
10
|
+
|
|
11
|
+
export { discoverAuthStorage, discoverModels };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./run-with-concurrency-
|
|
1
|
+
import "./run-with-concurrency-C3dKaL_j.js";
|
|
2
2
|
import "./paths-ZhiQAuKk.js";
|
|
3
|
-
import { t as createSubsystemLogger } from "./subsystem-
|
|
4
|
-
import "./workspace-
|
|
5
|
-
import { D as isPlainObject } from "./logger-
|
|
6
|
-
import "./model-selection-
|
|
3
|
+
import { t as createSubsystemLogger } from "./subsystem-BJ89YjCN.js";
|
|
4
|
+
import "./workspace-CkozFUzc.js";
|
|
5
|
+
import { D as isPlainObject } from "./logger-onBePS9K.js";
|
|
6
|
+
import "./model-selection-Bh4BR1_K.js";
|
|
7
7
|
import "./github-copilot-token-B8Wx9FgQ.js";
|
|
8
|
-
import "./legacy-names-
|
|
9
|
-
import { p as getDiagnosticSessionState, s as logToolLoopAction } from "./diagnostic-
|
|
8
|
+
import "./legacy-names-CDxprteD.js";
|
|
9
|
+
import { p as getDiagnosticSessionState, s as logToolLoopAction } from "./diagnostic-B74jJPqv.js";
|
|
10
10
|
import { createHash } from "node:crypto";
|
|
11
11
|
|
|
12
12
|
//#region src/agents/tool-loop-detection.ts
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { at as DEFAULT_ACCOUNT_ID, ot as normalizeAccountId, st as normalizeOptionalAccountId } from "./run-with-concurrency-vfuRiXdY.js";
|
|
2
|
+
import { o as resolveOAuthDir } from "./paths-8xF5kDne.js";
|
|
3
|
+
import { Pr as formatCliCommand } from "./config-B16xKqSo.js";
|
|
4
|
+
import { B as success, E as resolveUserPath, G as getChildLogger, I as info, c as defaultRuntime, x as jidToE164 } from "./logger-DDdrdbDu.js";
|
|
5
|
+
import fs from "node:fs";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import fs$1 from "node:fs/promises";
|
|
8
|
+
|
|
9
|
+
//#region src/channels/plugins/account-helpers.ts
|
|
10
|
+
function createAccountListHelpers(channelKey) {
|
|
11
|
+
function resolveConfiguredDefaultAccountId(cfg) {
|
|
12
|
+
const channel = cfg.channels?.[channelKey];
|
|
13
|
+
const preferred = normalizeOptionalAccountId(typeof channel?.defaultAccount === "string" ? channel.defaultAccount : void 0);
|
|
14
|
+
if (!preferred) return;
|
|
15
|
+
if (listAccountIds(cfg).some((id) => normalizeAccountId(id) === preferred)) return preferred;
|
|
16
|
+
}
|
|
17
|
+
function listConfiguredAccountIds(cfg) {
|
|
18
|
+
const accounts = (cfg.channels?.[channelKey])?.accounts;
|
|
19
|
+
if (!accounts || typeof accounts !== "object") return [];
|
|
20
|
+
return Object.keys(accounts).filter(Boolean);
|
|
21
|
+
}
|
|
22
|
+
function listAccountIds(cfg) {
|
|
23
|
+
const ids = listConfiguredAccountIds(cfg);
|
|
24
|
+
if (ids.length === 0) return [DEFAULT_ACCOUNT_ID];
|
|
25
|
+
return ids.toSorted((a, b) => a.localeCompare(b));
|
|
26
|
+
}
|
|
27
|
+
function resolveDefaultAccountId(cfg) {
|
|
28
|
+
const preferred = resolveConfiguredDefaultAccountId(cfg);
|
|
29
|
+
if (preferred) return preferred;
|
|
30
|
+
const ids = listAccountIds(cfg);
|
|
31
|
+
if (ids.includes(DEFAULT_ACCOUNT_ID)) return DEFAULT_ACCOUNT_ID;
|
|
32
|
+
return ids[0] ?? DEFAULT_ACCOUNT_ID;
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
listConfiguredAccountIds,
|
|
36
|
+
listAccountIds,
|
|
37
|
+
resolveDefaultAccountId
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/routing/account-lookup.ts
|
|
43
|
+
function resolveAccountEntry(accounts, accountId) {
|
|
44
|
+
if (!accounts || typeof accounts !== "object") return;
|
|
45
|
+
if (Object.hasOwn(accounts, accountId)) return accounts[accountId];
|
|
46
|
+
const normalized = accountId.toLowerCase();
|
|
47
|
+
const matchKey = Object.keys(accounts).find((key) => key.toLowerCase() === normalized);
|
|
48
|
+
return matchKey ? accounts[matchKey] : void 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/web/auth-store.ts
|
|
53
|
+
function resolveDefaultWebAuthDir() {
|
|
54
|
+
return path.join(resolveOAuthDir(), "whatsapp", DEFAULT_ACCOUNT_ID);
|
|
55
|
+
}
|
|
56
|
+
const WA_WEB_AUTH_DIR = resolveDefaultWebAuthDir();
|
|
57
|
+
function resolveWebCredsPath(authDir) {
|
|
58
|
+
return path.join(authDir, "creds.json");
|
|
59
|
+
}
|
|
60
|
+
function resolveWebCredsBackupPath(authDir) {
|
|
61
|
+
return path.join(authDir, "creds.json.bak");
|
|
62
|
+
}
|
|
63
|
+
function hasWebCredsSync(authDir) {
|
|
64
|
+
try {
|
|
65
|
+
const stats = fs.statSync(resolveWebCredsPath(authDir));
|
|
66
|
+
return stats.isFile() && stats.size > 1;
|
|
67
|
+
} catch {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function readCredsJsonRaw(filePath) {
|
|
72
|
+
try {
|
|
73
|
+
if (!fs.existsSync(filePath)) return null;
|
|
74
|
+
const stats = fs.statSync(filePath);
|
|
75
|
+
if (!stats.isFile() || stats.size <= 1) return null;
|
|
76
|
+
return fs.readFileSync(filePath, "utf-8");
|
|
77
|
+
} catch {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function maybeRestoreCredsFromBackup(authDir) {
|
|
82
|
+
const logger = getChildLogger({ module: "web-session" });
|
|
83
|
+
try {
|
|
84
|
+
const credsPath = resolveWebCredsPath(authDir);
|
|
85
|
+
const backupPath = resolveWebCredsBackupPath(authDir);
|
|
86
|
+
const raw = readCredsJsonRaw(credsPath);
|
|
87
|
+
if (raw) {
|
|
88
|
+
JSON.parse(raw);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const backupRaw = readCredsJsonRaw(backupPath);
|
|
92
|
+
if (!backupRaw) return;
|
|
93
|
+
JSON.parse(backupRaw);
|
|
94
|
+
fs.copyFileSync(backupPath, credsPath);
|
|
95
|
+
try {
|
|
96
|
+
fs.chmodSync(credsPath, 384);
|
|
97
|
+
} catch {}
|
|
98
|
+
logger.warn({ credsPath }, "restored corrupted WhatsApp creds.json from backup");
|
|
99
|
+
} catch {}
|
|
100
|
+
}
|
|
101
|
+
async function webAuthExists(authDir = resolveDefaultWebAuthDir()) {
|
|
102
|
+
const resolvedAuthDir = resolveUserPath(authDir);
|
|
103
|
+
maybeRestoreCredsFromBackup(resolvedAuthDir);
|
|
104
|
+
const credsPath = resolveWebCredsPath(resolvedAuthDir);
|
|
105
|
+
try {
|
|
106
|
+
await fs$1.access(resolvedAuthDir);
|
|
107
|
+
} catch {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
const stats = await fs$1.stat(credsPath);
|
|
112
|
+
if (!stats.isFile() || stats.size <= 1) return false;
|
|
113
|
+
const raw = await fs$1.readFile(credsPath, "utf-8");
|
|
114
|
+
JSON.parse(raw);
|
|
115
|
+
return true;
|
|
116
|
+
} catch {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
async function clearLegacyBaileysAuthState(authDir) {
|
|
121
|
+
const entries = await fs$1.readdir(authDir, { withFileTypes: true });
|
|
122
|
+
const shouldDelete = (name) => {
|
|
123
|
+
if (name === "oauth.json") return false;
|
|
124
|
+
if (name === "creds.json" || name === "creds.json.bak") return true;
|
|
125
|
+
if (!name.endsWith(".json")) return false;
|
|
126
|
+
return /^(app-state-sync|session|sender-key|pre-key)-/.test(name);
|
|
127
|
+
};
|
|
128
|
+
await Promise.all(entries.map(async (entry) => {
|
|
129
|
+
if (!entry.isFile()) return;
|
|
130
|
+
if (!shouldDelete(entry.name)) return;
|
|
131
|
+
await fs$1.rm(path.join(authDir, entry.name), { force: true });
|
|
132
|
+
}));
|
|
133
|
+
}
|
|
134
|
+
async function logoutWeb(params) {
|
|
135
|
+
const runtime = params.runtime ?? defaultRuntime;
|
|
136
|
+
const resolvedAuthDir = resolveUserPath(params.authDir ?? resolveDefaultWebAuthDir());
|
|
137
|
+
if (!await webAuthExists(resolvedAuthDir)) {
|
|
138
|
+
runtime.log(info("No WhatsApp Web session found; nothing to delete."));
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
if (params.isLegacyAuthDir) await clearLegacyBaileysAuthState(resolvedAuthDir);
|
|
142
|
+
else await fs$1.rm(resolvedAuthDir, {
|
|
143
|
+
recursive: true,
|
|
144
|
+
force: true
|
|
145
|
+
});
|
|
146
|
+
runtime.log(success("Cleared WhatsApp Web credentials."));
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
function readWebSelfId(authDir = resolveDefaultWebAuthDir()) {
|
|
150
|
+
try {
|
|
151
|
+
const credsPath = resolveWebCredsPath(resolveUserPath(authDir));
|
|
152
|
+
if (!fs.existsSync(credsPath)) return {
|
|
153
|
+
e164: null,
|
|
154
|
+
jid: null
|
|
155
|
+
};
|
|
156
|
+
const raw = fs.readFileSync(credsPath, "utf-8");
|
|
157
|
+
const jid = JSON.parse(raw)?.me?.id ?? null;
|
|
158
|
+
return {
|
|
159
|
+
e164: jid ? jidToE164(jid, { authDir }) : null,
|
|
160
|
+
jid
|
|
161
|
+
};
|
|
162
|
+
} catch {
|
|
163
|
+
return {
|
|
164
|
+
e164: null,
|
|
165
|
+
jid: null
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Return the age (in milliseconds) of the cached WhatsApp web auth state, or null when missing.
|
|
171
|
+
* Helpful for heartbeats/observability to spot stale credentials.
|
|
172
|
+
*/
|
|
173
|
+
function getWebAuthAgeMs(authDir = resolveDefaultWebAuthDir()) {
|
|
174
|
+
try {
|
|
175
|
+
const stats = fs.statSync(resolveWebCredsPath(resolveUserPath(authDir)));
|
|
176
|
+
return Date.now() - stats.mtimeMs;
|
|
177
|
+
} catch {
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function logWebSelfId(authDir = resolveDefaultWebAuthDir(), runtime = defaultRuntime, includeChannelPrefix = false) {
|
|
182
|
+
const { e164, jid } = readWebSelfId(authDir);
|
|
183
|
+
const details = e164 || jid ? `${e164 ?? "unknown"}${jid ? ` (jid ${jid})` : ""}` : "unknown";
|
|
184
|
+
const prefix = includeChannelPrefix ? "Web Channel: " : "";
|
|
185
|
+
runtime.log(info(`${prefix}${details}`));
|
|
186
|
+
}
|
|
187
|
+
async function pickWebChannel(pref, authDir = resolveDefaultWebAuthDir()) {
|
|
188
|
+
const choice = pref === "auto" ? "web" : pref;
|
|
189
|
+
if (!await webAuthExists(authDir)) throw new Error(`No WhatsApp Web session found. Run \`${formatCliCommand("squidclaw channels login --channel whatsapp --verbose")}\` to link.`);
|
|
190
|
+
return choice;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
//#endregion
|
|
194
|
+
//#region src/web/accounts.ts
|
|
195
|
+
const { listConfiguredAccountIds, listAccountIds, resolveDefaultAccountId } = createAccountListHelpers("whatsapp");
|
|
196
|
+
const listWhatsAppAccountIds = listAccountIds;
|
|
197
|
+
const resolveDefaultWhatsAppAccountId = resolveDefaultAccountId;
|
|
198
|
+
function listWhatsAppAuthDirs(cfg) {
|
|
199
|
+
const oauthDir = resolveOAuthDir();
|
|
200
|
+
const whatsappDir = path.join(oauthDir, "whatsapp");
|
|
201
|
+
const authDirs = new Set([oauthDir, path.join(whatsappDir, DEFAULT_ACCOUNT_ID)]);
|
|
202
|
+
const accountIds = listConfiguredAccountIds(cfg);
|
|
203
|
+
for (const accountId of accountIds) authDirs.add(resolveWhatsAppAuthDir({
|
|
204
|
+
cfg,
|
|
205
|
+
accountId
|
|
206
|
+
}).authDir);
|
|
207
|
+
try {
|
|
208
|
+
const entries = fs.readdirSync(whatsappDir, { withFileTypes: true });
|
|
209
|
+
for (const entry of entries) {
|
|
210
|
+
if (!entry.isDirectory()) continue;
|
|
211
|
+
authDirs.add(path.join(whatsappDir, entry.name));
|
|
212
|
+
}
|
|
213
|
+
} catch {}
|
|
214
|
+
return Array.from(authDirs);
|
|
215
|
+
}
|
|
216
|
+
function hasAnyWhatsAppAuth(cfg) {
|
|
217
|
+
return listWhatsAppAuthDirs(cfg).some((authDir) => hasWebCredsSync(authDir));
|
|
218
|
+
}
|
|
219
|
+
function resolveAccountConfig(cfg, accountId) {
|
|
220
|
+
return resolveAccountEntry(cfg.channels?.whatsapp?.accounts, accountId);
|
|
221
|
+
}
|
|
222
|
+
function resolveDefaultAuthDir(accountId) {
|
|
223
|
+
return path.join(resolveOAuthDir(), "whatsapp", normalizeAccountId(accountId));
|
|
224
|
+
}
|
|
225
|
+
function resolveLegacyAuthDir() {
|
|
226
|
+
return resolveOAuthDir();
|
|
227
|
+
}
|
|
228
|
+
function legacyAuthExists(authDir) {
|
|
229
|
+
try {
|
|
230
|
+
return fs.existsSync(path.join(authDir, "creds.json"));
|
|
231
|
+
} catch {
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
function resolveWhatsAppAuthDir(params) {
|
|
236
|
+
const accountId = params.accountId.trim() || DEFAULT_ACCOUNT_ID;
|
|
237
|
+
const configured = resolveAccountConfig(params.cfg, accountId)?.authDir?.trim();
|
|
238
|
+
if (configured) return {
|
|
239
|
+
authDir: resolveUserPath(configured),
|
|
240
|
+
isLegacy: false
|
|
241
|
+
};
|
|
242
|
+
const defaultDir = resolveDefaultAuthDir(accountId);
|
|
243
|
+
if (accountId === DEFAULT_ACCOUNT_ID) {
|
|
244
|
+
const legacyDir = resolveLegacyAuthDir();
|
|
245
|
+
if (legacyAuthExists(legacyDir) && !legacyAuthExists(defaultDir)) return {
|
|
246
|
+
authDir: legacyDir,
|
|
247
|
+
isLegacy: true
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
return {
|
|
251
|
+
authDir: defaultDir,
|
|
252
|
+
isLegacy: false
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
function resolveWhatsAppAccount(params) {
|
|
256
|
+
const rootCfg = params.cfg.channels?.whatsapp;
|
|
257
|
+
const accountId = params.accountId?.trim() || resolveDefaultWhatsAppAccountId(params.cfg);
|
|
258
|
+
const accountCfg = resolveAccountConfig(params.cfg, accountId);
|
|
259
|
+
const enabled = accountCfg?.enabled !== false;
|
|
260
|
+
const { authDir, isLegacy } = resolveWhatsAppAuthDir({
|
|
261
|
+
cfg: params.cfg,
|
|
262
|
+
accountId
|
|
263
|
+
});
|
|
264
|
+
return {
|
|
265
|
+
accountId,
|
|
266
|
+
name: accountCfg?.name?.trim() || void 0,
|
|
267
|
+
enabled,
|
|
268
|
+
sendReadReceipts: accountCfg?.sendReadReceipts ?? rootCfg?.sendReadReceipts ?? true,
|
|
269
|
+
messagePrefix: accountCfg?.messagePrefix ?? rootCfg?.messagePrefix ?? params.cfg.messages?.messagePrefix,
|
|
270
|
+
authDir,
|
|
271
|
+
isLegacyAuthDir: isLegacy,
|
|
272
|
+
selfChatMode: accountCfg?.selfChatMode ?? rootCfg?.selfChatMode,
|
|
273
|
+
dmPolicy: accountCfg?.dmPolicy ?? rootCfg?.dmPolicy,
|
|
274
|
+
allowFrom: accountCfg?.allowFrom ?? rootCfg?.allowFrom,
|
|
275
|
+
groupAllowFrom: accountCfg?.groupAllowFrom ?? rootCfg?.groupAllowFrom,
|
|
276
|
+
groupPolicy: accountCfg?.groupPolicy ?? rootCfg?.groupPolicy,
|
|
277
|
+
textChunkLimit: accountCfg?.textChunkLimit ?? rootCfg?.textChunkLimit,
|
|
278
|
+
chunkMode: accountCfg?.chunkMode ?? rootCfg?.chunkMode,
|
|
279
|
+
mediaMaxMb: accountCfg?.mediaMaxMb ?? rootCfg?.mediaMaxMb,
|
|
280
|
+
blockStreaming: accountCfg?.blockStreaming ?? rootCfg?.blockStreaming,
|
|
281
|
+
ackReaction: accountCfg?.ackReaction ?? rootCfg?.ackReaction,
|
|
282
|
+
groups: accountCfg?.groups ?? rootCfg?.groups,
|
|
283
|
+
debounceMs: accountCfg?.debounceMs ?? rootCfg?.debounceMs
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
//#endregion
|
|
288
|
+
export { webAuthExists as _, resolveWhatsAppAuthDir as a, logWebSelfId as c, pickWebChannel as d, readCredsJsonRaw as f, resolveWebCredsPath as g, resolveWebCredsBackupPath as h, resolveWhatsAppAccount as i, logoutWeb as l, resolveDefaultWebAuthDir as m, listWhatsAppAccountIds as n, WA_WEB_AUTH_DIR as o, readWebSelfId as p, resolveDefaultWhatsAppAccountId as r, getWebAuthAgeMs as s, hasAnyWhatsAppAuth as t, maybeRestoreCredsFromBackup as u, resolveAccountEntry as v, createAccountListHelpers as y };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ot as normalizeAccountId } from "./run-with-concurrency-vfuRiXdY.js";
|
|
2
|
+
import { v as resolveAccountEntry, y as createAccountListHelpers } from "./accounts-BXFDqY90.js";
|
|
3
|
+
|
|
4
|
+
//#region src/signal/accounts.ts
|
|
5
|
+
const { listAccountIds, resolveDefaultAccountId } = createAccountListHelpers("signal");
|
|
6
|
+
const listSignalAccountIds = listAccountIds;
|
|
7
|
+
const resolveDefaultSignalAccountId = resolveDefaultAccountId;
|
|
8
|
+
function resolveAccountConfig(cfg, accountId) {
|
|
9
|
+
return resolveAccountEntry(cfg.channels?.signal?.accounts, accountId);
|
|
10
|
+
}
|
|
11
|
+
function mergeSignalAccountConfig(cfg, accountId) {
|
|
12
|
+
const { accounts: _ignored, ...base } = cfg.channels?.signal ?? {};
|
|
13
|
+
const account = resolveAccountConfig(cfg, accountId) ?? {};
|
|
14
|
+
return {
|
|
15
|
+
...base,
|
|
16
|
+
...account
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function resolveSignalAccount(params) {
|
|
20
|
+
const accountId = normalizeAccountId(params.accountId);
|
|
21
|
+
const baseEnabled = params.cfg.channels?.signal?.enabled !== false;
|
|
22
|
+
const merged = mergeSignalAccountConfig(params.cfg, accountId);
|
|
23
|
+
const accountEnabled = merged.enabled !== false;
|
|
24
|
+
const enabled = baseEnabled && accountEnabled;
|
|
25
|
+
const host = merged.httpHost?.trim() || "127.0.0.1";
|
|
26
|
+
const port = merged.httpPort ?? 8080;
|
|
27
|
+
const baseUrl = merged.httpUrl?.trim() || `http://${host}:${port}`;
|
|
28
|
+
const configured = Boolean(merged.account?.trim() || merged.httpUrl?.trim() || merged.cliPath?.trim() || merged.httpHost?.trim() || typeof merged.httpPort === "number" || typeof merged.autoStart === "boolean");
|
|
29
|
+
return {
|
|
30
|
+
accountId,
|
|
31
|
+
enabled,
|
|
32
|
+
name: merged.name?.trim() || void 0,
|
|
33
|
+
baseUrl,
|
|
34
|
+
configured,
|
|
35
|
+
config: merged
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function listEnabledSignalAccounts(cfg) {
|
|
39
|
+
return listSignalAccountIds(cfg).map((accountId) => resolveSignalAccount({
|
|
40
|
+
cfg,
|
|
41
|
+
accountId
|
|
42
|
+
})).filter((account) => account.enabled);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
export { resolveSignalAccount as i, listSignalAccountIds as n, resolveDefaultSignalAccountId as r, listEnabledSignalAccounts as t };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ot as normalizeAccountId } from "./run-with-concurrency-vfuRiXdY.js";
|
|
2
|
+
import { v as resolveAccountEntry, y as createAccountListHelpers } from "./accounts-BXFDqY90.js";
|
|
3
|
+
|
|
4
|
+
//#region src/imessage/accounts.ts
|
|
5
|
+
const { listAccountIds, resolveDefaultAccountId } = createAccountListHelpers("imessage");
|
|
6
|
+
const listIMessageAccountIds = listAccountIds;
|
|
7
|
+
const resolveDefaultIMessageAccountId = resolveDefaultAccountId;
|
|
8
|
+
function resolveAccountConfig(cfg, accountId) {
|
|
9
|
+
return resolveAccountEntry(cfg.channels?.imessage?.accounts, accountId);
|
|
10
|
+
}
|
|
11
|
+
function mergeIMessageAccountConfig(cfg, accountId) {
|
|
12
|
+
const { accounts: _ignored, ...base } = cfg.channels?.imessage ?? {};
|
|
13
|
+
const account = resolveAccountConfig(cfg, accountId) ?? {};
|
|
14
|
+
return {
|
|
15
|
+
...base,
|
|
16
|
+
...account
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function resolveIMessageAccount(params) {
|
|
20
|
+
const accountId = normalizeAccountId(params.accountId);
|
|
21
|
+
const baseEnabled = params.cfg.channels?.imessage?.enabled !== false;
|
|
22
|
+
const merged = mergeIMessageAccountConfig(params.cfg, accountId);
|
|
23
|
+
const accountEnabled = merged.enabled !== false;
|
|
24
|
+
const configured = Boolean(merged.cliPath?.trim() || merged.dbPath?.trim() || merged.service || merged.region?.trim() || merged.allowFrom && merged.allowFrom.length > 0 || merged.groupAllowFrom && merged.groupAllowFrom.length > 0 || merged.dmPolicy || merged.groupPolicy || typeof merged.includeAttachments === "boolean" || merged.attachmentRoots && merged.attachmentRoots.length > 0 || merged.remoteAttachmentRoots && merged.remoteAttachmentRoots.length > 0 || typeof merged.mediaMaxMb === "number" || typeof merged.textChunkLimit === "number" || merged.groups && Object.keys(merged.groups).length > 0);
|
|
25
|
+
return {
|
|
26
|
+
accountId,
|
|
27
|
+
enabled: baseEnabled && accountEnabled,
|
|
28
|
+
name: merged.name?.trim() || void 0,
|
|
29
|
+
config: merged,
|
|
30
|
+
configured
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
export { resolveDefaultIMessageAccountId as n, resolveIMessageAccount as r, listIMessageAccountIds as t };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { at as DEFAULT_ACCOUNT_ID } from "./run-with-concurrency-vfuRiXdY.js";
|
|
2
|
+
import { Pr as formatCliCommand } from "./config-B16xKqSo.js";
|
|
3
|
+
import crypto from "node:crypto";
|
|
4
|
+
|
|
5
|
+
//#region src/logging/redact-identifier.ts
|
|
6
|
+
function sha256HexPrefix(value, len = 12) {
|
|
7
|
+
const safeLen = Number.isFinite(len) ? Math.max(1, Math.floor(len)) : 12;
|
|
8
|
+
return crypto.createHash("sha256").update(value).digest("hex").slice(0, safeLen);
|
|
9
|
+
}
|
|
10
|
+
function redactIdentifier(value, opts) {
|
|
11
|
+
const trimmed = value?.trim();
|
|
12
|
+
if (!trimmed) return "-";
|
|
13
|
+
return `sha256:${sha256HexPrefix(trimmed, opts?.len ?? 12)}`;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/web/active-listener.ts
|
|
18
|
+
const listeners = /* @__PURE__ */ new Map();
|
|
19
|
+
function resolveWebAccountId(accountId) {
|
|
20
|
+
return (accountId ?? "").trim() || DEFAULT_ACCOUNT_ID;
|
|
21
|
+
}
|
|
22
|
+
function requireActiveWebListener(accountId) {
|
|
23
|
+
const id = resolveWebAccountId(accountId);
|
|
24
|
+
const listener = listeners.get(id) ?? null;
|
|
25
|
+
if (!listener) throw new Error(`No active WhatsApp Web listener (account: ${id}). Start the gateway, then link WhatsApp with: ${formatCliCommand(`squidclaw channels login --channel whatsapp --account ${id}`)}.`);
|
|
26
|
+
return {
|
|
27
|
+
accountId: id,
|
|
28
|
+
listener
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function setActiveWebListener(accountIdOrListener, maybeListener) {
|
|
32
|
+
const { accountId, listener } = typeof accountIdOrListener === "string" ? {
|
|
33
|
+
accountId: accountIdOrListener,
|
|
34
|
+
listener: maybeListener ?? null
|
|
35
|
+
} : {
|
|
36
|
+
accountId: DEFAULT_ACCOUNT_ID,
|
|
37
|
+
listener: accountIdOrListener ?? null
|
|
38
|
+
};
|
|
39
|
+
const id = resolveWebAccountId(accountId);
|
|
40
|
+
if (!listener) listeners.delete(id);
|
|
41
|
+
else listeners.set(id, listener);
|
|
42
|
+
if (id === DEFAULT_ACCOUNT_ID) {}
|
|
43
|
+
}
|
|
44
|
+
function getActiveWebListener(accountId) {
|
|
45
|
+
const id = resolveWebAccountId(accountId);
|
|
46
|
+
return listeners.get(id) ?? null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { redactIdentifier as i, requireActiveWebListener as n, setActiveWebListener as r, getActiveWebListener as t };
|