winclaw 2026.3.21 → 2026.3.23
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/{agents-_gcdm-kb.js → agents-Dc_S8rZ8.js} +4 -4
- package/dist/{agents.config-BkgsJJng.js → agents.config-BC6TW53i.js} +1 -1
- package/dist/{agents.config-Bw1hbsLj.js → agents.config-ZESYvAuZ.js} +1 -1
- package/dist/{auth-choice-sfRzFTug.js → auth-choice-CHCEiG_5.js} +1 -1
- package/dist/{auth-choice-i771W71t.js → auth-choice-CSZQYOpt.js} +1 -1
- package/dist/{banner-C-01b-if.js → banner-C3BSkrQk.js} +1 -1
- package/dist/build-info.json +2 -2
- package/dist/bundled/boot-md/handler.js +1 -1
- package/dist/bundled/session-memory/handler.js +1 -1
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-options-BAvRIwTX.js → channel-options-DG60shRM.js} +1 -1
- package/dist/{channel-options-it9Z3dNk.js → channel-options-XEKts1bm.js} +1 -1
- package/dist/{channel-web-BiIs0cCf.js → channel-web-XARrFQNi.js} +1 -1
- package/dist/{channel-web-CJ_jcZSw.js → channel-web-_2_SqIZ4.js} +1 -1
- package/dist/{channels-cli-CNbBNhlO.js → channels-cli-BEXYziVz.js} +6 -6
- package/dist/{channels-cli-miFqkj2-.js → channels-cli-ZssJjBmG.js} +6 -6
- package/dist/{cli-Da0pNyXg.js → cli-BZZG4J_j.js} +1 -1
- package/dist/{cli-BhZvhDWg.js → cli-CY_Senie.js} +1 -1
- package/dist/{command-registry-m8nfRV-J.js → command-registry-CWxe1f-O.js} +9 -9
- package/dist/{completion-cli-B-8mTxbh.js → completion-cli-BKoxA3-3.js} +2 -2
- package/dist/{completion-cli-c9ogb7DR.js → completion-cli-DisKMPGI.js} +1 -1
- package/dist/{config-cli-D2natFSq.js → config-cli-Bfwm9TCS.js} +1 -1
- package/dist/{config-cli-1ecjxVfC.js → config-cli-FMUUH4Ti.js} +1 -1
- package/dist/{configure-B-tOY-wa.js → configure-BJxly9Yt.js} +3 -3
- package/dist/{configure-BgqQPO5L.js → configure-DarTg7E_.js} +3 -3
- package/dist/{deps-send-whatsapp.runtime-BJV7VcRP.js → deps-send-whatsapp.runtime-CeFobiyN.js} +2 -2
- package/dist/{deps-send-whatsapp.runtime-DlmzDIzc.js → deps-send-whatsapp.runtime-D7OYrbTL.js} +2 -2
- package/dist/{deps-send-whatsapp.runtime-Dflrvnq-.js → deps-send-whatsapp.runtime-Dk3bVJzk.js} +3 -3
- package/dist/{deps-send-whatsapp.runtime-BHJLeHSL.js → deps-send-whatsapp.runtime-iiQJpw-8.js} +3 -3
- package/dist/{doctor-completion-DEdT-_9v.js → doctor-completion-BtQY4Eaa.js} +1 -1
- package/dist/{doctor-completion-C3SXIoSh.js → doctor-completion-t3rdrQev.js} +1 -1
- package/dist/entry.js +2 -2
- package/dist/extensionAPI.js +1 -1
- package/dist/{gateway-cli-C_4mlmOW.js → gateway-cli-BeABpkZ1.js} +11 -11
- package/dist/{gateway-cli-CL5LDNmu.js → gateway-cli-Juhp3APs.js} +11 -11
- package/dist/{health-C5a0wlfE.js → health-8quueFaP.js} +1 -1
- package/dist/{health-CqiwN5ZR.js → health-BoOzWD1m.js} +1 -1
- package/dist/{hooks-cli-C79J_WG7.js → hooks-cli-B475HcKz.js} +2 -2
- package/dist/{hooks-cli-DDWnA5Zx.js → hooks-cli-BcKW3j9V.js} +2 -2
- package/dist/index.js +6 -6
- package/dist/llm-slug-generator.js +1 -1
- package/dist/{models-Do96D4zT.js → models-FzoA9YFe.js} +2 -2
- package/dist/{models-cli-pblTciC_.js → models-cli-B9FoteUK.js} +3 -3
- package/dist/{models-cli-DOfsOmW1.js → models-cli-DPCSWjYD.js} +2 -2
- package/dist/{npm-resolution-Bd8dB7rI.js → npm-resolution-DUcSV3Er.js} +1 -1
- package/dist/{npm-resolution-DE7xcGkg.js → npm-resolution-Kay_MP5U.js} +1 -1
- package/dist/{onboard-CReGZ3G9.js → onboard-DSE0sFKG.js} +2 -2
- package/dist/{onboard-channels-DvpqJP6s.js → onboard-channels-DleZdwBe.js} +1 -1
- package/dist/{onboard-channels-ljMkIe7O.js → onboard-channels-DuQfbGvH.js} +1 -1
- package/dist/{onboard-CXyqQtlq.js → onboard-lgDkrSqS.js} +2 -2
- package/dist/{onboarding-BZWA8Nqq.js → onboarding-D713_nF-.js} +3 -3
- package/dist/{onboarding-CoH1hPY0.js → onboarding-tBrb0kFS.js} +3 -3
- package/dist/{onboarding.finalize-B1qRlV6H.js → onboarding.finalize-DenRnQtC.js} +5 -5
- package/dist/{onboarding.finalize-DzRWtkmA.js → onboarding.finalize-femvpEYf.js} +6 -6
- package/dist/{pi-embedded-DUO1eQ_J.js → pi-embedded-CPqoXbPh.js} +15 -15
- package/dist/{pi-embedded-xAf-RVi5.js → pi-embedded-yo67-7fx.js} +15 -15
- package/dist/{plugin-registry-DckyegZB.js → plugin-registry-ByrPvIy8.js} +1 -1
- package/dist/{plugin-registry-Cb_XRQUR.js → plugin-registry-C_HMboob.js} +1 -1
- package/dist/plugin-sdk/{channel-web-CfZNFYCV.js → channel-web-CZNn3YpA.js} +1 -1
- package/dist/plugin-sdk/{channel-web-D02gHjxz.js → channel-web-ut6coWO5.js} +1 -1
- package/dist/plugin-sdk/compat.js +50 -50
- package/dist/plugin-sdk/{deps-send-whatsapp.runtime-DJlWl-wv.js → deps-send-whatsapp.runtime-7Y4jFeSR.js} +3 -3
- package/dist/plugin-sdk/{deps-send-whatsapp.runtime-BxQ5tZO2.js → deps-send-whatsapp.runtime-BYqY0Q9J.js} +3 -3
- package/dist/plugin-sdk/imessage.js +2 -2
- package/dist/plugin-sdk/index.js +2 -2
- package/dist/plugin-sdk/{reply-BEBnUyG7.js → reply-CHTGOm7N.js} +15 -15
- package/dist/plugin-sdk/{reply-Cx_4UtvJ.js → reply-CbZPef0p.js} +15 -15
- package/dist/plugin-sdk/slack.js +2 -2
- package/dist/plugin-sdk/{slash-dispatch.runtime-C74v1zF9.js → slash-dispatch.runtime-CU94t3bC.js} +1 -1
- package/dist/plugin-sdk/{slash-dispatch.runtime-DN7TWAWh.js → slash-dispatch.runtime-fens4sxk.js} +1 -1
- package/dist/plugin-sdk/{subagent-registry-runtime-CprGCjIU.js → subagent-registry-runtime-CwlC6o7G.js} +1 -1
- package/dist/plugin-sdk/{subagent-registry-runtime-9CC9qb9s.js → subagent-registry-runtime-DE56KyD-.js} +1 -1
- package/dist/plugin-sdk/telegram.js +2 -2
- package/dist/plugin-sdk/{web-D9wJfMr_.js → web-DSbskSAb.js} +2 -2
- package/dist/plugin-sdk/{web-D0OZnnn7.js → web-Oo_Fd7RA.js} +2 -2
- package/dist/plugin-sdk/whatsapp.js +2 -2
- package/dist/plugin-sdk/zalouser.js +2 -2
- package/dist/{plugins-cli-BWCjQEMr.js → plugins-cli-CI8xpqVq.js} +2 -2
- package/dist/{plugins-cli-C6Oo9R6E.js → plugins-cli-DQCpV91t.js} +2 -2
- package/dist/{program-CEJ6CsoR.js → program-N2SbF1HK.js} +7 -7
- package/dist/{program-context-EXWtPjXg.js → program-context-DMg-_LjD.js} +17 -17
- package/dist/{prompt-select-styled-D-f3R2mt.js → prompt-select-styled-BehogMCm.js} +4 -4
- package/dist/{prompt-select-styled-B_AHrNLY.js → prompt-select-styled-pMhNy-Rt.js} +4 -4
- package/dist/{provider-auth-helpers-CN4iPBfs.js → provider-auth-helpers-4bL3VgNE.js} +1 -1
- package/dist/{provider-auth-helpers-CiXbjGH-.js → provider-auth-helpers-Rpp9Sh_y.js} +1 -1
- package/dist/{push-apns-D7Si-92v.js → push-apns-CGUAuXgJ.js} +1 -1
- package/dist/{push-apns-BEZdCQsM.js → push-apns-hyDzrrIU.js} +1 -1
- package/dist/{register.agent-BDosszM8.js → register.agent-CFrG4s6H.js} +6 -6
- package/dist/{register.agent-BjxrirHi.js → register.agent-CTNWQCtt.js} +7 -7
- package/dist/{register.configure-MduIRRMt.js → register.configure-DIKLgW8P.js} +7 -7
- package/dist/{register.configure-C0B9vKwT.js → register.configure-Di8Uh5GB.js} +7 -7
- package/dist/{register.maintenance-CfnzY1OX.js → register.maintenance-Cc675Yxz.js} +7 -7
- package/dist/{register.maintenance-BfdiJ7KX.js → register.maintenance-GewLmA3i.js} +8 -8
- package/dist/{register.message-D4VYaBqq.js → register.message-BI_R0TJs.js} +2 -2
- package/dist/{register.message-BszoJEBm.js → register.message-CtBJO09g.js} +2 -2
- package/dist/{register.onboard-CbJU4Y-3.js → register.onboard-45htf4DA.js} +2 -2
- package/dist/{register.onboard-CjuT9fKW.js → register.onboard-Jv--xCKB.js} +2 -2
- package/dist/{register.setup-DZzf7J04.js → register.setup-Bm99k2pm.js} +2 -2
- package/dist/{register.setup-BTTBsCT0.js → register.setup-CqrPLejH.js} +2 -2
- package/dist/{register.status-health-sessions-C3Ji8sqv.js → register.status-health-sessions-BBDVWYvb.js} +3 -3
- package/dist/{register.status-health-sessions-BKcFfUR6.js → register.status-health-sessions-BmpJln2_.js} +3 -3
- package/dist/{register.subclis-2iN-TxPh.js → register.subclis-4LlGcEld.js} +9 -9
- package/dist/{reply-KTubTl9h.js → reply-a2GVvnP2.js} +15 -15
- package/dist/{run-main-BEtPk_9z.js → run-main-B3eIQkhk.js} +14 -14
- package/dist/{server-node-events-BozhXo6J.js → server-node-events-Bn6C-kB6.js} +2 -2
- package/dist/{server-node-events-CFcRS-lD.js → server-node-events-CbUk95yd.js} +2 -2
- package/dist/{slash-dispatch.runtime-D5Cl7j1v.js → slash-dispatch.runtime-B4quYJn4.js} +1 -1
- package/dist/{slash-dispatch.runtime-B0OIPdp3.js → slash-dispatch.runtime-BBH2jQsL.js} +1 -1
- package/dist/{slash-dispatch.runtime-DDLolsGY.js → slash-dispatch.runtime-BLQZdvZW.js} +1 -1
- package/dist/{slash-dispatch.runtime-DtN2NmXJ.js → slash-dispatch.runtime-wBORF-o1.js} +1 -1
- package/dist/{status-B5hylgEQ.js → status-BqpyCRc4.js} +2 -2
- package/dist/{status-DClHhy30.js → status-DHIaRvxs.js} +2 -2
- package/dist/{subagent-registry-iD-ynHA9.js → subagent-registry-CRAr7csi.js} +15 -15
- package/dist/{subagent-registry-runtime-DfMDVaOY.js → subagent-registry-runtime-BfYm3d-n.js} +1 -1
- package/dist/{subagent-registry-runtime-CdEy9DKy.js → subagent-registry-runtime-CnPoAflv.js} +1 -1
- package/dist/{subagent-registry-runtime-Cv_Xt2cx.js → subagent-registry-runtime-DQb8qzq2.js} +1 -1
- package/dist/{subagent-registry-runtime-LH0OBaWN.js → subagent-registry-runtime-sMbEjW_q.js} +1 -1
- package/dist/{update-cli-C1nysDmM.js → update-cli-Bk3xkEPl.js} +8 -8
- package/dist/{update-cli-Dj_9Bokl.js → update-cli-G1w1hdg4.js} +7 -7
- package/dist/{update-runner-BpzbDTnQ.js → update-runner-CgS5D8t8.js} +1 -1
- package/dist/{update-runner-BUoHYjl8.js → update-runner-TyDM6-ms.js} +1 -1
- package/dist/{web-DxHq9RWt.js → web-7w_9CsnG.js} +2 -2
- package/dist/{web-Dbqs3hbC.js → web-B790MBdK.js} +1 -1
- package/dist/{web-CodV11ZY.js → web-BPiSo--I.js} +1 -1
- package/dist/{web-YBvuT4WS.js → web-BmYQFz4q.js} +2 -2
- package/package.json +1 -1
- package/dist/plugin-sdk/accounts-B71rIfIG.js +0 -35
- package/dist/plugin-sdk/accounts-Bh_CxVlh.js +0 -46
- package/dist/plugin-sdk/accounts-BoD7489q.js +0 -288
- package/dist/plugin-sdk/active-listener-6CPAmAh-.js +0 -50
- package/dist/plugin-sdk/api-key-rotation-DEDhmJAk.js +0 -181
- package/dist/plugin-sdk/audio-preflight-CMPZ9BXN.js +0 -69
- package/dist/plugin-sdk/audio-transcription-runner-CdADoJed.js +0 -2176
- package/dist/plugin-sdk/audit-membership-runtime-CxP2fdgS.js +0 -58
- package/dist/plugin-sdk/channel-activity-9ivqqvRB.js +0 -94
- package/dist/plugin-sdk/channel-web-CHDoy_Ex.js +0 -2256
- package/dist/plugin-sdk/chrome-B1yeIHRg.js +0 -2415
- package/dist/plugin-sdk/commands-registry-D-wyzYid.js +0 -1125
- package/dist/plugin-sdk/config-CmS6HzGU.js +0 -17959
- package/dist/plugin-sdk/deliver-Cy287pZ5.js +0 -1719
- package/dist/plugin-sdk/deliver-runtime-BH3fUFW1.js +0 -32
- package/dist/plugin-sdk/deps-send-discord.runtime-CLboFQJz.js +0 -23
- package/dist/plugin-sdk/deps-send-imessage.runtime-BVlGKP96.js +0 -22
- package/dist/plugin-sdk/deps-send-signal.runtime-0640YmBr.js +0 -21
- package/dist/plugin-sdk/deps-send-slack.runtime-BqbFKjcg.js +0 -19
- package/dist/plugin-sdk/deps-send-telegram.runtime-1a2RXcA2.js +0 -24
- package/dist/plugin-sdk/deps-send-whatsapp.runtime-CpOH0wYd.js +0 -57
- package/dist/plugin-sdk/diagnostic-DGt5TnqW.js +0 -319
- package/dist/plugin-sdk/errors-D7zDdduc.js +0 -54
- package/dist/plugin-sdk/fetch-guard-BsatETDz.js +0 -156
- package/dist/plugin-sdk/fs-safe-ynDN1AOr.js +0 -352
- package/dist/plugin-sdk/image-6No3eiOM.js +0 -2314
- package/dist/plugin-sdk/image-ops-CmFoHyKE.js +0 -584
- package/dist/plugin-sdk/image-runtime-D57a2W4s.js +0 -25
- package/dist/plugin-sdk/ir-CX1ZjDTn.js +0 -1296
- package/dist/plugin-sdk/local-roots-DnE8988Y.js +0 -186
- package/dist/plugin-sdk/logger-cN8CgKqt.js +0 -1163
- package/dist/plugin-sdk/login-hk6_2GSM.js +0 -57
- package/dist/plugin-sdk/login-qr-UaVS_Rce.js +0 -320
- package/dist/plugin-sdk/manager-CBP2ZQ5W.js +0 -3929
- package/dist/plugin-sdk/manager-runtime-3rKbDrJp.js +0 -15
- package/dist/plugin-sdk/outbound-B0Ab6CJM.js +0 -212
- package/dist/plugin-sdk/outbound-attachment-CktA053B.js +0 -19
- package/dist/plugin-sdk/path-alias-guards-WXu8eYZ3.js +0 -43
- package/dist/plugin-sdk/paths-Brta7ydd.js +0 -166
- package/dist/plugin-sdk/pi-embedded-helpers-BfbOXbe6.js +0 -9627
- package/dist/plugin-sdk/pi-model-discovery-ruarR-_j.js +0 -134
- package/dist/plugin-sdk/pi-model-discovery-runtime-26px0QfL.js +0 -8
- package/dist/plugin-sdk/pi-tools.before-tool-call.runtime-VVLpfXqQ.js +0 -354
- package/dist/plugin-sdk/plugins-C995vsQz.js +0 -864
- package/dist/plugin-sdk/proxy-fetch-iSQrNgP-.js +0 -38
- package/dist/plugin-sdk/pw-ai-BJXHSS3q.js +0 -1938
- package/dist/plugin-sdk/qmd-manager-A7m15SeJ.js +0 -1448
- package/dist/plugin-sdk/query-expansion-DngcFbkC.js +0 -1011
- package/dist/plugin-sdk/redact-CIb5VTTO.js +0 -319
- package/dist/plugin-sdk/reply-vuWmM3Ra.js +0 -100211
- package/dist/plugin-sdk/resolve-outbound-target-CQ6hRY-h.js +0 -40
- package/dist/plugin-sdk/run-with-concurrency-BlfAoChN.js +0 -1994
- package/dist/plugin-sdk/runtime-whatsapp-login.runtime-YsrzSsFL.js +0 -10
- package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-DL6Ses5K.js +0 -19
- package/dist/plugin-sdk/send-BEy8EUzH.js +0 -414
- package/dist/plugin-sdk/send-CWP6COto.js +0 -3135
- package/dist/plugin-sdk/send-DQTgt3Cu.js +0 -540
- package/dist/plugin-sdk/send-DzpV-k17.js +0 -2587
- package/dist/plugin-sdk/send-HuIksBS6.js +0 -503
- package/dist/plugin-sdk/session-Cc3Y4mXL.js +0 -169
- package/dist/plugin-sdk/skill-commands-p8Zwjnwy.js +0 -353
- package/dist/plugin-sdk/skills-k8XpacZa.js +0 -1428
- package/dist/plugin-sdk/slash-commands.runtime-ynnr6oUR.js +0 -13
- package/dist/plugin-sdk/slash-dispatch.runtime-DOmMrwMj.js +0 -52
- package/dist/plugin-sdk/slash-skill-commands.runtime-eAk1jhVy.js +0 -16
- package/dist/plugin-sdk/ssrf-DZSsYJgJ.js +0 -202
- package/dist/plugin-sdk/store-Cn0oLCP4.js +0 -81
- package/dist/plugin-sdk/subagent-registry-runtime-CQ3m7TwQ.js +0 -52
- package/dist/plugin-sdk/tables-KWxXnbkq.js +0 -55
- package/dist/plugin-sdk/target-errors-Cr0q4o7K.js +0 -195
- package/dist/plugin-sdk/thinking-CfA6xbI_.js +0 -1206
- package/dist/plugin-sdk/tokens-B-D1YRTV.js +0 -52
- package/dist/plugin-sdk/tool-images-CVV7LNFW.js +0 -274
- package/dist/plugin-sdk/web-B1Svh1KM.js +0 -56
- package/dist/plugin-sdk/whatsapp-actions-CLNhBLJz.js +0 -80
|
@@ -2,7 +2,7 @@ import { g as resolveStateDir, n as DEFAULT_GATEWAY_PORT, u as resolveGatewayPor
|
|
|
2
2
|
import { p as theme } from "./globals-mxjDvm3x.js";
|
|
3
3
|
import { h as pathExists } from "./utils-D2mWpsBR.js";
|
|
4
4
|
import "./thinking-44rmAw5o.js";
|
|
5
|
-
import { q as trimLogTail } from "./reply-
|
|
5
|
+
import { q as trimLogTail } from "./reply-a2GVvnP2.js";
|
|
6
6
|
import "./agent-scope-BjM05Snq.js";
|
|
7
7
|
import { d as defaultRuntime } from "./subsystem-notCuUgs.js";
|
|
8
8
|
import { t as resolveWinClawPackageRoot } from "./winclaw-root-ExuHY0xi.js";
|
|
@@ -113,7 +113,7 @@ import "./server-lifecycle-CiI6yOKH.js";
|
|
|
113
113
|
import "./stagger-BU0UZwZh.js";
|
|
114
114
|
import { f as resolveGatewaySystemdServiceName, l as resolveGatewayLaunchAgentLabel, p as resolveGatewayWindowsTaskName } from "./constants-BmfqwMZv.js";
|
|
115
115
|
import { r as parseSemver } from "./runtime-guard-DGD1G4Ur.js";
|
|
116
|
-
import "./program-context-
|
|
116
|
+
import "./program-context-DMg-_LjD.js";
|
|
117
117
|
import "./skills-status-D8Nj34Fr.js";
|
|
118
118
|
import { n as inheritOptionFromParent } from "./command-options-6wdtBBWB.js";
|
|
119
119
|
import "./note-BwMaaMpg.js";
|
|
@@ -123,7 +123,7 @@ import "./skill-scanner-Cxf7IqSj.js";
|
|
|
123
123
|
import "./installs-38JZgJ6W.js";
|
|
124
124
|
import { n as formatConfigIssueLines } from "./issue-format-DioDa5vQ.js";
|
|
125
125
|
import "./channels-status-issues-BRENJAql.js";
|
|
126
|
-
import { r as installCompletion } from "./completion-cli-
|
|
126
|
+
import { r as installCompletion } from "./completion-cli-DisKMPGI.js";
|
|
127
127
|
import "./daemon-install-helpers-Bl9cC3_Q.js";
|
|
128
128
|
import "./systemd-CaLRjLzI.js";
|
|
129
129
|
import { t as resolveGatewayService } from "./service-BqlGUtYA.js";
|
|
@@ -133,10 +133,10 @@ import { a as terminateStaleGatewayPids, i as renderRestartDiagnostics, o as wai
|
|
|
133
133
|
import "./probe-C9wPn2Ea.js";
|
|
134
134
|
import "./diagnostics-DL2w3coK.js";
|
|
135
135
|
import { t as renderTable } from "./table-DiQF-UFj.js";
|
|
136
|
-
import "./health-
|
|
136
|
+
import "./health-BoOzWD1m.js";
|
|
137
137
|
import "./control-ui-assets-6YLru-BI.js";
|
|
138
138
|
import { c as DEFAULT_PACKAGE_CHANNEL, d as formatUpdateChannelLabel, g as resolveUpdateChannelDisplay, h as resolveEffectiveUpdateChannel, i as fetchNpmTagVersion, m as normalizeUpdateChannel, n as checkUpdateStatus, o as resolveNpmChannelTag, r as compareSemverStrings, s as DEFAULT_GIT_CHANNEL, u as channelToNpmTag } from "./channel-account-context-DMSK5tU0.js";
|
|
139
|
-
import { a as globalInstallArgs, c as readPackageName, i as detectGlobalInstallManagerForRoot, l as readPackageVersion, n as cleanupGlobalRenameDirs, o as resolveGlobalPackageRoot, r as detectGlobalInstallManagerByPresence, s as normalizePackageTagInput, t as runGatewayUpdate } from "./update-runner-
|
|
139
|
+
import { a as globalInstallArgs, c as readPackageName, i as detectGlobalInstallManagerForRoot, l as readPackageVersion, n as cleanupGlobalRenameDirs, o as resolveGlobalPackageRoot, r as detectGlobalInstallManagerByPresence, s as normalizePackageTagInput, t as runGatewayUpdate } from "./update-runner-TyDM6-ms.js";
|
|
140
140
|
import { i as resolveUpdateAvailability, n as formatUpdateOneLiner, t as formatUpdateAvailableHint } from "./status.update-DUWVI4vj.js";
|
|
141
141
|
import "./logging-CpYJdtZV.js";
|
|
142
142
|
import { n as updateNpmInstalledPlugins, t as syncPluginsForUpdateChannel } from "./update-BJcKcpwE.js";
|
|
@@ -144,8 +144,8 @@ import "./doctor-config-flow-BBBpR1FO.js";
|
|
|
144
144
|
import "./oauth-tls-preflight-C2ySqLlb.js";
|
|
145
145
|
import "./systemd-linger-BljEXZqb.js";
|
|
146
146
|
import "./health-format-CiRrAVc0.js";
|
|
147
|
-
import { n as doctorCommand, t as selectStyled } from "./prompt-select-styled-
|
|
148
|
-
import { r as ensureCompletionCacheExists, t as checkShellCompletionStatus } from "./doctor-completion-
|
|
147
|
+
import { n as doctorCommand, t as selectStyled } from "./prompt-select-styled-pMhNy-Rt.js";
|
|
148
|
+
import { r as ensureCompletionCacheExists, t as checkShellCompletionStatus } from "./doctor-completion-t3rdrQev.js";
|
|
149
149
|
import os from "node:os";
|
|
150
150
|
import path from "node:path";
|
|
151
151
|
import fs from "node:fs/promises";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as pathExists } from "./utils-hiIKrqOK.js";
|
|
2
2
|
import { t as runCommandWithTimeout } from "./exec-CaapFZaD.js";
|
|
3
|
-
import { Bt as trimLogTail } from "./subagent-registry-
|
|
3
|
+
import { Bt as trimLogTail } from "./subagent-registry-CRAr7csi.js";
|
|
4
4
|
import { p as resolveStableNodePath } from "./daemon-install-helpers-D1YQ03lO.js";
|
|
5
5
|
import { n as resolveControlUiDistIndexHealth, r as resolveControlUiDistIndexPathForRoot } from "./control-ui-assets-B0DdamQU.js";
|
|
6
6
|
import { _ as detectPackageManager$1, c as DEFAULT_PACKAGE_CHANNEL, f as isBetaTag, l as DEV_BRANCH, p as isStableTag, r as compareSemverStrings, u as channelToNpmTag } from "./channel-account-context-B4ofKr9t.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h as pathExists } from "./utils-D2mWpsBR.js";
|
|
2
|
-
import { q as trimLogTail } from "./reply-
|
|
2
|
+
import { q as trimLogTail } from "./reply-a2GVvnP2.js";
|
|
3
3
|
import { t as runCommandWithTimeout } from "./exec-BQMqbouM.js";
|
|
4
4
|
import { p as resolveStableNodePath } from "./daemon-install-helpers-Bl9cC3_Q.js";
|
|
5
5
|
import { n as resolveControlUiDistIndexHealth, r as resolveControlUiDistIndexPathForRoot } from "./control-ui-assets-6YLru-BI.js";
|
|
@@ -26,7 +26,7 @@ import "./logging-CFvkxgcX.js";
|
|
|
26
26
|
import "./accounts-CLKFSM00.js";
|
|
27
27
|
import "./send-DTvtOsK3.js";
|
|
28
28
|
import "./send-3vnK2por.js";
|
|
29
|
-
import "./subagent-registry-
|
|
29
|
+
import "./subagent-registry-CRAr7csi.js";
|
|
30
30
|
import "./paths-ByCv35uy.js";
|
|
31
31
|
import "./chat-envelope-DDCB7eZC.js";
|
|
32
32
|
import "./client-DCxDsURZ.js";
|
|
@@ -107,7 +107,7 @@ import "./cli-utils-BlpNlYVq.js";
|
|
|
107
107
|
import "./help-format-DqamOwoM.js";
|
|
108
108
|
import "./progress-Dtl-ttAH.js";
|
|
109
109
|
import { t as sendMessageWhatsApp } from "./outbound-D0KF3CHY.js";
|
|
110
|
-
import { n as monitorWebInbox, t as monitorWebChannel } from "./channel-web-
|
|
110
|
+
import { n as monitorWebInbox, t as monitorWebChannel } from "./channel-web-_2_SqIZ4.js";
|
|
111
111
|
import { i as waitForWaConnection, t as createWaSocket } from "./session-C4iQQHfw.js";
|
|
112
112
|
import { t as loginWeb } from "./login-D26qK4NQ.js";
|
|
113
113
|
|
|
@@ -2,7 +2,7 @@ import { G as buildAgentMainSessionKey, W as DEFAULT_MAIN_KEY, X as normalizeAge
|
|
|
2
2
|
import "./paths-3zpvpr1V.js";
|
|
3
3
|
import { C as sleep, G as getChildLogger, L as logVerbose, O as createSubsystemLogger, T as toWhatsappJid, h as normalizeE164, j as defaultRuntime, m as jidToE164, o as clamp, p as isSelfChatMode, v as resolveJidToE164, z as shouldLogVerbose } from "./logger-BYHR8bcX.js";
|
|
4
4
|
import { Y as loadConfig, pr as formatCliCommand } from "./model-selection-DCOfPdhN.js";
|
|
5
|
-
import { A as computeBackoff, C as formatInboundEnvelope, D as resolveAgentRoute, E as buildAgentSessionKey, F as hasControlCommand, I as shouldComputeCommandAuthorized, K as resolveIdentityNamePrefix, L as buildMentionRegexes, M as formatDurationPrecise, N as enqueueSystemEvent, O as normalizeGroupActivation, P as finalizeInboundContext, R as normalizeMentionText, S as resolveInboundDebounceMs, T as getReplyFromConfig, _ as resolvePinnedMainDmOwnerFromAllowlist, a as createReplyPrefixOptions, c as DEFAULT_GROUP_HISTORY_LIMIT, d as resolveDefaultGroupPolicy, f as resolveOpenProviderRuntimeGroupPolicy, g as resolveDmGroupAccessWithLists, h as resolveDmGroupAccessWithCommandGate, i as resolveInboundSessionEnvelopeContext, j as sleepWithAbort, k as parseActivationCommand, l as buildHistoryContextFromEntries, m as readStoreAllowFromForDmPolicy, o as buildPairingReply, p as warnMissingProviderGroupPolicyFallbackOnce, q as resolveMessagePrefix, s as resolveMentionGating, u as recordPendingHistoryEntryIfEnabled, v as shouldAckReactionForWhatsApp, w as createDedupeCache, x as createInboundDebouncer, y as dispatchReplyWithBufferedBlockDispatcher } from "./pi-embedded-
|
|
5
|
+
import { A as computeBackoff, C as formatInboundEnvelope, D as resolveAgentRoute, E as buildAgentSessionKey, F as hasControlCommand, I as shouldComputeCommandAuthorized, K as resolveIdentityNamePrefix, L as buildMentionRegexes, M as formatDurationPrecise, N as enqueueSystemEvent, O as normalizeGroupActivation, P as finalizeInboundContext, R as normalizeMentionText, S as resolveInboundDebounceMs, T as getReplyFromConfig, _ as resolvePinnedMainDmOwnerFromAllowlist, a as createReplyPrefixOptions, c as DEFAULT_GROUP_HISTORY_LIMIT, d as resolveDefaultGroupPolicy, f as resolveOpenProviderRuntimeGroupPolicy, g as resolveDmGroupAccessWithLists, h as resolveDmGroupAccessWithCommandGate, i as resolveInboundSessionEnvelopeContext, j as sleepWithAbort, k as parseActivationCommand, l as buildHistoryContextFromEntries, m as readStoreAllowFromForDmPolicy, o as buildPairingReply, p as warnMissingProviderGroupPolicyFallbackOnce, q as resolveMessagePrefix, s as resolveMentionGating, u as recordPendingHistoryEntryIfEnabled, v as shouldAckReactionForWhatsApp, w as createDedupeCache, x as createInboundDebouncer, y as dispatchReplyWithBufferedBlockDispatcher } from "./pi-embedded-yo67-7fx.js";
|
|
6
6
|
import "./github-copilot-token-C-HHmlE6.js";
|
|
7
7
|
import { h as resolveChannelGroupRequireMention, m as resolveChannelGroupPolicy } from "./thinking-bn_HIbhN.js";
|
|
8
8
|
import "./tokens-BjTxlE27.js";
|
|
@@ -8,7 +8,7 @@ import "./github-copilot-token-BPV26Xlc.js";
|
|
|
8
8
|
import "./legacy-names-BfbtBVxA.js";
|
|
9
9
|
import { h as resolveChannelGroupRequireMention, m as resolveChannelGroupPolicy } from "./thinking-leUv0tOz.js";
|
|
10
10
|
import "./tokens-DKL-qP0N.js";
|
|
11
|
-
import { A as normalizeGroupActivation, B as normalizeMentionText, C as createInboundDebouncer, D as getReplyFromConfig, E as createDedupeCache, F as enqueueSystemEvent, I as finalizeInboundContext, K as resolveIdentityNamePrefix, L as hasControlCommand, M as computeBackoff, N as sleepWithAbort, O as buildAgentSessionKey, P as formatDurationPrecise, R as shouldComputeCommandAuthorized, T as formatInboundEnvelope, _ as resolveDmGroupAccessWithCommandGate, b as shouldAckReactionForWhatsApp, c as buildPairingReply, d as buildHistoryContextFromEntries, f as recordPendingHistoryEntryIfEnabled, g as readStoreAllowFromForDmPolicy, h as warnMissingProviderGroupPolicyFallbackOnce, i as resolveInboundSessionEnvelopeContext, j as parseActivationCommand, k as resolveAgentRoute, l as resolveMentionGating, m as resolveOpenProviderRuntimeGroupPolicy, p as resolveDefaultGroupPolicy, q as resolveMessagePrefix, s as createReplyPrefixOptions, u as DEFAULT_GROUP_HISTORY_LIMIT, v as resolveDmGroupAccessWithLists, w as resolveInboundDebounceMs, x as dispatchReplyWithBufferedBlockDispatcher, y as resolvePinnedMainDmOwnerFromAllowlist, z as buildMentionRegexes } from "./pi-embedded-
|
|
11
|
+
import { A as normalizeGroupActivation, B as normalizeMentionText, C as createInboundDebouncer, D as getReplyFromConfig, E as createDedupeCache, F as enqueueSystemEvent, I as finalizeInboundContext, K as resolveIdentityNamePrefix, L as hasControlCommand, M as computeBackoff, N as sleepWithAbort, O as buildAgentSessionKey, P as formatDurationPrecise, R as shouldComputeCommandAuthorized, T as formatInboundEnvelope, _ as resolveDmGroupAccessWithCommandGate, b as shouldAckReactionForWhatsApp, c as buildPairingReply, d as buildHistoryContextFromEntries, f as recordPendingHistoryEntryIfEnabled, g as readStoreAllowFromForDmPolicy, h as warnMissingProviderGroupPolicyFallbackOnce, i as resolveInboundSessionEnvelopeContext, j as parseActivationCommand, k as resolveAgentRoute, l as resolveMentionGating, m as resolveOpenProviderRuntimeGroupPolicy, p as resolveDefaultGroupPolicy, q as resolveMessagePrefix, s as createReplyPrefixOptions, u as DEFAULT_GROUP_HISTORY_LIMIT, v as resolveDmGroupAccessWithLists, w as resolveInboundDebounceMs, x as dispatchReplyWithBufferedBlockDispatcher, y as resolvePinnedMainDmOwnerFromAllowlist, z as buildMentionRegexes } from "./pi-embedded-CPqoXbPh.js";
|
|
12
12
|
import "./plugins-7rATz3L_.js";
|
|
13
13
|
import { a as logWebSelfId, c as pickWebChannel, i as getWebAuthAgeMs, m as webAuthExists, n as resolveWhatsAppAccount, r as WA_WEB_AUTH_DIR, u as readWebSelfId } from "./accounts-C4E8dXY5.js";
|
|
14
14
|
import "./send-CM2xsD1-.js";
|
|
@@ -2,7 +2,7 @@ import "./paths-D358qawm.js";
|
|
|
2
2
|
import "./globals-mxjDvm3x.js";
|
|
3
3
|
import "./utils-D2mWpsBR.js";
|
|
4
4
|
import "./thinking-44rmAw5o.js";
|
|
5
|
-
import "./reply-
|
|
5
|
+
import "./reply-a2GVvnP2.js";
|
|
6
6
|
import "./agent-scope-BjM05Snq.js";
|
|
7
7
|
import "./subsystem-notCuUgs.js";
|
|
8
8
|
import "./winclaw-root-ExuHY0xi.js";
|
|
@@ -109,7 +109,7 @@ import "./help-format-BLEVId2S.js";
|
|
|
109
109
|
import "./progress-BikJvgBA.js";
|
|
110
110
|
import "./server-lifecycle-CiI6yOKH.js";
|
|
111
111
|
import "./stagger-BU0UZwZh.js";
|
|
112
|
-
import { n as monitorWebInbox, t as monitorWebChannel } from "./channel-web-
|
|
112
|
+
import { n as monitorWebInbox, t as monitorWebChannel } from "./channel-web-XARrFQNi.js";
|
|
113
113
|
import { t as sendMessageWhatsApp } from "./outbound-1lBWfxjp.js";
|
|
114
114
|
import { i as waitForWaConnection, t as createWaSocket } from "./session-CyPL2g_-.js";
|
|
115
115
|
import { t as loginWeb } from "./login-DzE0leVg.js";
|
package/package.json
CHANGED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ot as normalizeAccountId } from "./run-with-concurrency-BlfAoChN.js";
|
|
2
|
-
import { v as resolveAccountEntry, y as createAccountListHelpers } from "./accounts-BoD7489q.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 };
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { ot as normalizeAccountId } from "./run-with-concurrency-BlfAoChN.js";
|
|
2
|
-
import { v as resolveAccountEntry, y as createAccountListHelpers } from "./accounts-BoD7489q.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 };
|
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import { at as DEFAULT_ACCOUNT_ID, ot as normalizeAccountId, st as normalizeOptionalAccountId } from "./run-with-concurrency-BlfAoChN.js";
|
|
2
|
-
import { o as resolveOAuthDir } from "./paths-BEfQqXwE.js";
|
|
3
|
-
import { Pr as formatCliCommand } from "./config-CmS6HzGU.js";
|
|
4
|
-
import { B as success, E as resolveUserPath, G as getChildLogger, I as info, c as defaultRuntime, x as jidToE164 } from "./logger-cN8CgKqt.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("winclaw 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 };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { at as DEFAULT_ACCOUNT_ID } from "./run-with-concurrency-BlfAoChN.js";
|
|
2
|
-
import { Pr as formatCliCommand } from "./config-CmS6HzGU.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(`winclaw 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 };
|