remoteclaw 0.0.0 → 0.1.0-next.2abd2fa
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/CHANGELOG.md +7 -0
- package/LICENSE +661 -0
- package/README.md +490 -0
- package/assets/chrome-extension/README.md +23 -0
- package/assets/chrome-extension/background-utils.js +48 -0
- package/assets/chrome-extension/background.js +899 -0
- package/assets/chrome-extension/icons/icon128.png +0 -0
- package/assets/chrome-extension/icons/icon16.png +0 -0
- package/assets/chrome-extension/icons/icon32.png +0 -0
- package/assets/chrome-extension/icons/icon48.png +0 -0
- package/assets/chrome-extension/manifest.json +25 -0
- package/assets/chrome-extension/options-validation.js +57 -0
- package/assets/chrome-extension/options.html +200 -0
- package/assets/chrome-extension/options.js +74 -0
- package/assets/clawtributor-avatar-placeholder.png +0 -0
- package/assets/dmg-background-small.png +0 -0
- package/assets/dmg-background.png +0 -0
- package/dist/account-lookup-0KDSp5Mj.js +11 -0
- package/dist/account-lookup-zvANGr2x.js +11 -0
- package/dist/accounts-BFy_Z3od.js +272 -0
- package/dist/accounts-BTXSfPWi.js +270 -0
- package/dist/accounts-BxGS70Do.js +36 -0
- package/dist/accounts-CNY1TGj1.js +47 -0
- package/dist/accounts-DBohBlww.js +32 -0
- package/dist/accounts-DqRQ75w3.js +36 -0
- package/dist/accounts-iODF3SK2.js +47 -0
- package/dist/ack-reactions-B11TAC2D.js +446 -0
- package/dist/ack-reactions-BWVjL4H6.js +446 -0
- package/dist/acp-cli-CA1xMmVo.js +1320 -0
- package/dist/acp-cli-CGo6fJVZ.js +1326 -0
- package/dist/active-listener-VzhWW8W6.js +37 -0
- package/dist/active-listener-z0qVEcom.js +37 -0
- package/dist/agent-CTizRPIJ.js +732 -0
- package/dist/agent-D2RVoS5g.js +731 -0
- package/dist/agent-helpers-B6VfZ9_u.js +606 -0
- package/dist/agent-helpers-CTx5KKJu.js +606 -0
- package/dist/agent-scope-BGYzhtWQ.js +121 -0
- package/dist/agent-scope-C50VuLKh.js +119 -0
- package/dist/agents-BuYn-obw.js +788 -0
- package/dist/agents.config-BSTxuTVd.js +116 -0
- package/dist/agents.config-p3V3b9u6.js +116 -0
- package/dist/ansi-D04X81yq.js +14 -0
- package/dist/api-BeQMq2iS.js +17 -0
- package/dist/api-CxX8-gGz.js +17 -0
- package/dist/argv-Co-b9Zsc.js +101 -0
- package/dist/audio-DPOuhNq7.js +43 -0
- package/dist/audio-VBcVDa08.js +43 -0
- package/dist/audio-preflight-BwmCYeuM.js +64 -0
- package/dist/audio-preflight-co8gjlPX.js +69 -0
- package/dist/audit-oH4urD3G.js +3138 -0
- package/dist/audit-qgtCT3ik.js +3138 -0
- package/dist/auth-CAczFgAO.js +448 -0
- package/dist/auth-Deh9i9Eg.js +448 -0
- package/dist/auth-profiles-BquJGKLC.js +279 -0
- package/dist/auth-profiles-D8vKiBPq.js +281 -0
- package/dist/banner-Cf978khN.js +294 -0
- package/dist/binaries-DXW6oATV.js +13 -0
- package/dist/bindings-CRU_udk8.js +69 -0
- package/dist/bindings-DQZAu8Wv.js +69 -0
- package/dist/bonjour-discovery-DdAk1VyO.js +378 -0
- package/dist/bonjour-discovery-DuhiIZZx.js +378 -0
- package/dist/boot/handler.js +1498 -0
- package/dist/brew-C4zKZsHX.js +46 -0
- package/dist/brew-DbSbN8sD.js +46 -0
- package/dist/browser-cli-CZC4h5V4.js +1687 -0
- package/dist/browser-cli-DAgi_aQk.js +1692 -0
- package/dist/build-info.json +5 -0
- package/dist/bundled/boot/HOOK.md +24 -0
- package/dist/bundled/command-logger/HOOK.md +122 -0
- package/dist/call-BbwtB9Y-.js +2828 -0
- package/dist/call-PivL7Uex.js +2829 -0
- package/dist/canvas-host/a2ui/.bundle.hash +1 -0
- package/dist/canvas-host/a2ui/a2ui.bundle.js +13193 -0
- package/dist/canvas-host/a2ui/index.html +307 -0
- package/dist/catalog-BqO6yem_.js +185 -0
- package/dist/catalog-DFmaYwfk.js +185 -0
- package/dist/channel-account-context-CvIDAtHS.js +550 -0
- package/dist/channel-account-context-q-o0pG1A.js +550 -0
- package/dist/channel-activity-BaCNOZpP.js +94 -0
- package/dist/channel-activity-C-G4n9BK.js +292 -0
- package/dist/channel-activity-DTKGf3j5.js +94 -0
- package/dist/channel-options-Cyappik_.js +32 -0
- package/dist/channel-options-DFnypY5S.js +33 -0
- package/dist/channel-selection-BGl53D5K.js +51 -0
- package/dist/channel-selection-NNPbxnyZ.js +51 -0
- package/dist/channel-web-DmhVkWbP.js +2134 -0
- package/dist/channel-web-kRC3UYBJ.js +2136 -0
- package/dist/channels-cli-C5XRkPJl.js +1421 -0
- package/dist/channels-cli-D6TqCI0m.js +1426 -0
- package/dist/channels-status-issues-CUc9mpeW.js +18 -0
- package/dist/channels-status-issues-DwRDzwrV.js +18 -0
- package/dist/chat-envelope-DEZ-5RY8.js +248 -0
- package/dist/chat-envelope-el7Uo-Fe.js +248 -0
- package/dist/chat-type-CYPyHAj-.js +11 -0
- package/dist/chat-type-DKb2TlGZ.js +11 -0
- package/dist/chrome-0QaGKb3L.js +1732 -0
- package/dist/chrome-CFeWdP0Y.js +1733 -0
- package/dist/chunk-CSQfUhgF.js +341 -0
- package/dist/chunk-D0Y_w4oX.js +341 -0
- package/dist/clack-prompter-B7tOxhJd.js +122 -0
- package/dist/clack-prompter-CCFnKP_1.js +121 -0
- package/dist/cleanup-utils-CqAVZz2b.js +94 -0
- package/dist/cleanup-utils-CwQvD73q.js +94 -0
- package/dist/cli/daemon-cli.js +9 -0
- package/dist/cli-BR2J3c4l.js +125 -0
- package/dist/cli-C1q1vSmN.js +130 -0
- package/dist/cli-name-BicfmwQX.js +23 -0
- package/dist/cli-name-C6rJGl18.js +23 -0
- package/dist/cli-utils-BhXbz2UF.js +16 -0
- package/dist/cli-utils-DZe_rVkZ.js +16 -0
- package/dist/client-C61M8zI3.js +22 -0
- package/dist/client-DdpmATKq.js +22 -0
- package/dist/clipboard-D7_SKHPK.js +31 -0
- package/dist/clipboard-Dzkx6Q2K.js +31 -0
- package/dist/command-format-CVfo8I5f.js +18 -0
- package/dist/command-format-DgXcqxBt.js +32 -0
- package/dist/command-logger/handler.js +57 -0
- package/dist/command-options-C4paWSGf.js +26 -0
- package/dist/command-options-CA30lfLK.js +26 -0
- package/dist/command-registry-CYjvOp8W.js +215 -0
- package/dist/commands-CDonBOrw.js +41 -0
- package/dist/commands-D_-bgTlO.js +41 -0
- package/dist/commands-registry-CWJv6xe2.js +892 -0
- package/dist/commands-registry-Ci8_cFk9.js +893 -0
- package/dist/common-CMI-qsF8.js +156 -0
- package/dist/common-DSVmydhm.js +156 -0
- package/dist/completion-cli-8iZJqfmX.js +452 -0
- package/dist/completion-cli-CYDjEZSt.js +452 -0
- package/dist/config-D5XU45KD.js +6953 -0
- package/dist/config-FHu9Bn4R.js +6951 -0
- package/dist/config-cli-Gehy4sav.js +241 -0
- package/dist/config-cli-RC9qMgJq.js +246 -0
- package/dist/config-eval-CjGZtLwx.js +102 -0
- package/dist/config-eval-H_wlEYIG.js +102 -0
- package/dist/config-guard-J-Q_DFWk.js +97 -0
- package/dist/config-guard-cB5a_ANg.js +75 -0
- package/dist/config-validation-BPNyd9_3.js +18 -0
- package/dist/config-validation-BPWuvhVe.js +18 -0
- package/dist/configure-CC2XdRRm.js +891 -0
- package/dist/configure-DxFBJuhZ.js +889 -0
- package/dist/constants-BmRFoHl0.js +67 -0
- package/dist/constants-C9WPAluB.js +67 -0
- package/dist/constants-ChptG3d7.js +12 -0
- package/dist/constants-DY6b-_Wl.js +12 -0
- package/dist/control-auth-D0tpV3ts.js +397 -0
- package/dist/control-auth-_-0PGRUs.js +397 -0
- package/dist/control-ui/apple-touch-icon.png +0 -0
- package/dist/control-ui/assets/index-B4ZM1lW1.js +7738 -0
- package/dist/control-ui/assets/index-B4ZM1lW1.js.map +1 -0
- package/dist/control-ui/assets/index-PED72sKF.css +1 -0
- package/dist/control-ui/assets/pt-BR-eq0TfCI7.js +2 -0
- package/dist/control-ui/assets/pt-BR-eq0TfCI7.js.map +1 -0
- package/dist/control-ui/assets/zh-CN-DmLG2MF9.js +2 -0
- package/dist/control-ui/assets/zh-CN-DmLG2MF9.js.map +1 -0
- package/dist/control-ui/assets/zh-TW-BLErH0EM.js +2 -0
- package/dist/control-ui/assets/zh-TW-BLErH0EM.js.map +1 -0
- package/dist/control-ui/favicon-32.png +0 -0
- package/dist/control-ui/favicon.ico +0 -0
- package/dist/control-ui/favicon.svg +67 -0
- package/dist/control-ui/index.html +17 -0
- package/dist/control-ui-assets-Cx_mw4D0.js +186 -0
- package/dist/control-ui-assets-W1AUuGrO.js +186 -0
- package/dist/conversation-label-C4SDz4sT.js +36 -0
- package/dist/conversation-label-D1frnvYe.js +36 -0
- package/dist/credentials-BHWUBHMd.js +91 -0
- package/dist/credentials-DFsi1_e8.js +91 -0
- package/dist/cron-cli-BzERxhr5.js +495 -0
- package/dist/cron-cli-C8j_uslU.js +490 -0
- package/dist/daemon-cli-C95XNbX0.js +1199 -0
- package/dist/daemon-cli-e6sURMqd.js +1197 -0
- package/dist/daemon-cli.js +15243 -0
- package/dist/daemon-install-CcohRvKV.js +55 -0
- package/dist/daemon-install-DDshfT0J.js +60 -0
- package/dist/daemon-install-helpers-CFGAfRlj.js +462 -0
- package/dist/daemon-install-helpers-DIUzSFG1.js +462 -0
- package/dist/daemon-runtime-CMnbwryP.js +13 -0
- package/dist/daemon-runtime-CvqE4ysg.js +13 -0
- package/dist/dangerous-name-matching-BzmiLXmA.js +45 -0
- package/dist/dangerous-name-matching-DaVRgwer.js +45 -0
- package/dist/dangerous-tools-BOLoCRv4.js +253 -0
- package/dist/dangerous-tools-Baq7Q-i6.js +253 -0
- package/dist/defaults-B5KStIBg.js +7 -0
- package/dist/defaults-xUAL2Z-F.js +7 -0
- package/dist/deliver-912khjLK.js +481 -0
- package/dist/deliver-D56J4-1F.js +481 -0
- package/dist/delivery-queue-Cfa9Wmxp.js +244 -0
- package/dist/delivery-queue-CxVRi4tw.js +244 -0
- package/dist/devices-cli-0qDhTgZR.js +316 -0
- package/dist/devices-cli-6SKMR2bV.js +321 -0
- package/dist/diagnostics-99iCgBUh.js +46 -0
- package/dist/diagnostics-VC0cz7kX.js +46 -0
- package/dist/directory-cli-5YXdoVdn.js +217 -0
- package/dist/directory-cli-D3IKCHmn.js +222 -0
- package/dist/dm-policy-shared-4rkjhcrM.js +22 -0
- package/dist/dm-policy-shared-D8lgnmrC.js +22 -0
- package/dist/dns-cli-11CtErVU.js +197 -0
- package/dist/dns-cli-SiEd_1Lq.js +202 -0
- package/dist/dock-BqNINg7k.js +928 -0
- package/dist/dock-CQuu41bw.js +929 -0
- package/dist/doctor-completion-BR1SlAT3.js +92 -0
- package/dist/doctor-completion-CZwpEhIK.js +92 -0
- package/dist/doctor-config-flow-BVkHcvoj.js +1933 -0
- package/dist/doctor-config-flow-DVYRn0An.js +1934 -0
- package/dist/enable-DcJnkzfz.js +59 -0
- package/dist/enable-ibNq4UWy.js +59 -0
- package/dist/entry.js +2620 -0
- package/dist/env-DeF64iu0.js +60 -0
- package/dist/env-vars-7aZqKPhk.js +93 -0
- package/dist/env-vars-CLGbxdpL.js +93 -0
- package/dist/errors-8F-77i6m.js +35 -0
- package/dist/errors-DZ199hOo.js +35 -0
- package/dist/exec-DbKuYyM1.js +164 -0
- package/dist/exec-DkFE7lqU.js +164 -0
- package/dist/export-html/template.css +1060 -0
- package/dist/export-html/template.html +88 -0
- package/dist/export-html/template.js +1797 -0
- package/dist/export-html/vendor/highlight.min.js +1213 -0
- package/dist/export-html/vendor/marked.min.js +6 -0
- package/dist/extensionAPI.js +11520 -0
- package/dist/fetch-BFSBLBkA.js +67 -0
- package/dist/fetch-C6XKGA11.js +67 -0
- package/dist/fetch-CEDsOiql.js +67 -0
- package/dist/fetch-timeout-DTIN7CGM.js +43 -0
- package/dist/fetch-timeout-DoySHqfO.js +43 -0
- package/dist/file-identity-BxlKD8Ys.js +12 -0
- package/dist/file-lock-CIvloidc.js +107 -0
- package/dist/file-lock-CzBL_VIx.js +107 -0
- package/dist/format-duration-CqUERz51.js +35 -0
- package/dist/format-duration-Ct-yiwkS.js +35 -0
- package/dist/format-relative-79_Y1n2Y.js +55 -0
- package/dist/format-relative-CxLpEQOX.js +55 -0
- package/dist/fs-safe-DSwT85uK.js +88 -0
- package/dist/fs-safe-DkBhNAc3.js +98 -0
- package/dist/gateway-cli-BEEZhCHv.js +23747 -0
- package/dist/gateway-cli-Nob0g_4y.js +23742 -0
- package/dist/gateway-rpc-CksB-N83.js +28 -0
- package/dist/gateway-rpc-Dq44SkOv.js +28 -0
- package/dist/gmail-setup-utils-Cnx8A5pW.js +422 -0
- package/dist/gmail-setup-utils-nkabbKOE.js +423 -0
- package/dist/health-RT-F3hzT.js +1423 -0
- package/dist/health-SOuaKNRa.js +1420 -0
- package/dist/health-format-BG95OE6N.js +28 -0
- package/dist/health-format-B_QRD8Si.js +28 -0
- package/dist/heartbeat-visibility-BxkZjE5m.js +125 -0
- package/dist/heartbeat-visibility-CGG-G7px.js +125 -0
- package/dist/heartbeat-wake-LGEgcXjs.js +182 -0
- package/dist/heartbeat-wake-Y97geucO.js +182 -0
- package/dist/help-format-DAxf0l_h.js +17 -0
- package/dist/help-format-NNm_Ov4H.js +17 -0
- package/dist/helpers-BAsMXprO.js +25 -0
- package/dist/helpers-DLgbkcEn.js +25 -0
- package/dist/helpers-R7bU5IBz.js +10 -0
- package/dist/helpers-kkeXif0Q.js +10 -0
- package/dist/hook-runner-global-DJ14gXFP.js +527 -0
- package/dist/hooks-cli-DyEKryW8.js +1217 -0
- package/dist/hooks-cli-RuEn0-oy.js +1222 -0
- package/dist/host-env-security-Bms2_EMV.js +92 -0
- package/dist/host-env-security-szwfmhC4.js +92 -0
- package/dist/image-ops-Bi6JPSkD.js +354 -0
- package/dist/image-ops-DWytvdh_.js +354 -0
- package/dist/import-D8BBZQgl.js +170 -0
- package/dist/import-DQ6NI4Fz.js +168 -0
- package/dist/inbound-context-CPkkQW0i.js +68 -0
- package/dist/inbound-context-DS_kpIYI.js +68 -0
- package/dist/inbound-path-policy-Bg4gZBx-.js +250 -0
- package/dist/inbound-path-policy-sdr5Ji0k.js +250 -0
- package/dist/index.js +569 -0
- package/dist/input-provenance-Bn6thJNm.js +35 -0
- package/dist/input-provenance-xUsSMOsz.js +35 -0
- package/dist/inspect-Dt8hogS3.js +559 -0
- package/dist/inspect-vYIL1oA0.js +559 -0
- package/dist/installs-aM5dWAyn.js +325 -0
- package/dist/installs-pWdqG8HL.js +325 -0
- package/dist/ip-C9q3Oq20.js +200 -0
- package/dist/ip-D0zgNmBV.js +200 -0
- package/dist/ipv4--2WXMVtE.js +46 -0
- package/dist/ipv4-CDQpx1A7.js +46 -0
- package/dist/ir-BpaAMTfW.js +940 -0
- package/dist/is-main-DN8-sNR5.js +30 -0
- package/dist/json-file-B7l5-Xhr.js +25 -0
- package/dist/json-file-ChO_R9yh.js +25 -0
- package/dist/json-files-CmpYSF4G.js +46 -0
- package/dist/json-files-DzpTak5i.js +46 -0
- package/dist/lanes-ByWMUgrz.js +58 -0
- package/dist/lanes-cHJ5arWg.js +58 -0
- package/dist/links-Bz4V7R_p.js +15 -0
- package/dist/links-C3soDNDH.js +15 -0
- package/dist/loader-Ccwsh8Sh.js +22624 -0
- package/dist/loader-y9MhJewT.js +22621 -0
- package/dist/local-roots-BrH0Q63K.js +313 -0
- package/dist/local-roots-nImrw2WR.js +314 -0
- package/dist/location-DBWCGNLq.js +43 -0
- package/dist/location-GbZ0bBRU.js +43 -0
- package/dist/logger-BWMPnILd.js +47 -0
- package/dist/logger-Bw3cFE5t.js +49 -0
- package/dist/logger-DyL5G2DO.js +12 -0
- package/dist/logger-GvipVDfh.js +12 -0
- package/dist/logging-C-nxX2fn.js +20 -0
- package/dist/logging-D8-Kozjc.js +19 -0
- package/dist/login-C_Kt57nO.js +62 -0
- package/dist/login-DOmWDMeP.js +61 -0
- package/dist/login-qr-CXU0wC5K.js +322 -0
- package/dist/login-qr-D0u6fdeO.js +327 -0
- package/dist/logs-cli-CschwP4d.js +238 -0
- package/dist/logs-cli-D7ayUvz_.js +233 -0
- package/dist/markdown-tables-CrmghPAr.js +29 -0
- package/dist/markdown-tables-jrnSPvZ6.js +29 -0
- package/dist/media-CojxZ45J.js +10492 -0
- package/dist/media-DN7yRfrH.js +940 -0
- package/dist/message-action-names-CtEZcmlU.js +2521 -0
- package/dist/message-action-names-WglOO_DT.js +2521 -0
- package/dist/message-channel-DzJqHVZD.js +91 -0
- package/dist/message-channel-uWMAiywE.js +91 -0
- package/dist/mime-BS3jhcZE.js +149 -0
- package/dist/mime-Cxh_64P6.js +149 -0
- package/dist/mutable-allowlist-detectors-DiZDtmlZ.js +64 -0
- package/dist/mutable-allowlist-detectors-U5ThQr9V.js +64 -0
- package/dist/net-Cg8AQeke.js +225 -0
- package/dist/net-D6D0wgcF.js +225 -0
- package/dist/node-cli-Q2-n3Fgv.js +24 -0
- package/dist/node-cli-Uf6lAntf.js +24 -0
- package/dist/nodes-cli-C2SoKfCv.js +1343 -0
- package/dist/nodes-cli-CQmlfx0K.js +1348 -0
- package/dist/nodes-screen-BR9sYoPa.js +250 -0
- package/dist/nodes-screen-Cw7Hv7M2.js +250 -0
- package/dist/note-Dlv4NmlQ.js +92 -0
- package/dist/note-kvWV4xtw.js +92 -0
- package/dist/npm-registry-spec-0qiKawvv.js +786 -0
- package/dist/npm-registry-spec-COvUzy5J.js +786 -0
- package/dist/npm-resolution-6v_Zm-9G.js +86 -0
- package/dist/npm-resolution-BFz7LeoN.js +86 -0
- package/dist/onboard-CgyU-mDL.js +407 -0
- package/dist/onboard-RI4vNTZd.js +405 -0
- package/dist/onboard-channels-DN5JoKPd.js +2548 -0
- package/dist/onboard-channels-DyAd1OZr.js +2547 -0
- package/dist/onboard-config-BCTthQ7J.js +24 -0
- package/dist/onboard-config-y-2cgT0V.js +24 -0
- package/dist/onboard-helpers-BCzZUD0z.js +363 -0
- package/dist/onboard-helpers-sDc2Ky6H.js +362 -0
- package/dist/onboard-remote-CJrMtttl.js +127 -0
- package/dist/onboard-remote-hyQIBguz.js +127 -0
- package/dist/onboarding-DCu1iBTV.js +541 -0
- package/dist/onboarding-zKMitzpb.js +543 -0
- package/dist/onboarding.finalize-ClHhYE2E.js +401 -0
- package/dist/onboarding.finalize-D5JkVJgg.js +398 -0
- package/dist/onboarding.gateway-config-DFh71Ndn.js +198 -0
- package/dist/onboarding.gateway-config-VBk6AP9U.js +191 -0
- package/dist/outbound-BYlZshIw.js +221 -0
- package/dist/outbound-CFfJC1j5.js +220 -0
- package/dist/outbound-attachment-BCNs1u1F.js +18 -0
- package/dist/outbound-attachment-B_0D60Yr.js +18 -0
- package/dist/outbound-attachment-o0seS0CP.js +18 -0
- package/dist/pairing-cli-BeydfoF9.js +122 -0
- package/dist/pairing-cli-DWzX866x.js +127 -0
- package/dist/pairing-labels-B-N8S5Fc.js +9 -0
- package/dist/pairing-labels-B_53dY5L.js +9 -0
- package/dist/pairing-store-BxdqFZGK.js +460 -0
- package/dist/pairing-store-CTkD51uW.js +459 -0
- package/dist/parse-log-line-enq8pduH.js +44 -0
- package/dist/parse-log-line-mz9TG6ig.js +44 -0
- package/dist/parse-timeout-BMP8a0_a.js +16 -0
- package/dist/parse-timeout-CDkco8kd.js +16 -0
- package/dist/path-env-DR5vn3QL.js +89 -0
- package/dist/path-env-qRJbjJzj.js +89 -0
- package/dist/path-guards-CIx4hURU.js +31 -0
- package/dist/path-guards-CrQOUlsq.js +31 -0
- package/dist/path-safety-DkT9RmTG.js +14 -0
- package/dist/path-safety-juI2XbO1.js +14 -0
- package/dist/paths-BTaH3rLn.js +232 -0
- package/dist/plugin-auto-enable-D23gv7Aw.js +302 -0
- package/dist/plugin-auto-enable-DuPS9XiJ.js +301 -0
- package/dist/plugin-registry-CNu_1KZz.js +33 -0
- package/dist/plugin-registry-DeHwd2jk.js +33 -0
- package/dist/plugin-sdk/account-id.d.ts +1 -0
- package/dist/plugin-sdk/account-id.js +34 -0
- package/dist/plugin-sdk/agents/agent-helpers/errors.d.ts +55 -0
- package/dist/plugin-sdk/agents/agent-helpers/google.d.ts +3 -0
- package/dist/plugin-sdk/agents/agent-helpers/images.d.ts +21 -0
- package/dist/plugin-sdk/agents/agent-helpers/message-sanitization.d.ts +14 -0
- package/dist/plugin-sdk/agents/agent-helpers/messaging-dedupe.d.ts +10 -0
- package/dist/plugin-sdk/agents/agent-helpers/openai.d.ts +9 -0
- package/dist/plugin-sdk/agents/agent-helpers/thinking.d.ts +5 -0
- package/dist/plugin-sdk/agents/agent-helpers/turns.d.ts +20 -0
- package/dist/plugin-sdk/agents/agent-helpers/types.d.ts +1 -0
- package/dist/plugin-sdk/agents/agent-helpers.d.ts +11 -0
- package/dist/plugin-sdk/agents/agent-messaging.d.ts +8 -0
- package/dist/plugin-sdk/agents/agent-paths.d.ts +1 -0
- package/dist/plugin-sdk/agents/agent-scope.d.ts +61 -0
- package/dist/plugin-sdk/agents/agent-types.d.ts +78 -0
- package/dist/plugin-sdk/agents/agent-utils.d.ts +39 -0
- package/dist/plugin-sdk/agents/announce-idempotency.d.ts +11 -0
- package/dist/plugin-sdk/agents/api-key-rotation.d.ts +22 -0
- package/dist/plugin-sdk/agents/auth-profiles/constants.d.ts +16 -0
- package/dist/plugin-sdk/agents/auth-profiles/display.d.ts +7 -0
- package/dist/plugin-sdk/agents/auth-profiles/doctor.d.ts +8 -0
- package/dist/plugin-sdk/agents/auth-profiles/oauth.d.ts +14 -0
- package/dist/plugin-sdk/agents/auth-profiles/paths.d.ts +4 -0
- package/dist/plugin-sdk/agents/auth-profiles/profiles.d.ts +12 -0
- package/dist/plugin-sdk/agents/auth-profiles/session-override.d.ts +18 -0
- package/dist/plugin-sdk/agents/auth-profiles/store.d.ts +10 -0
- package/dist/plugin-sdk/agents/auth-profiles/types.d.ts +13 -0
- package/dist/plugin-sdk/agents/auth-profiles.d.ts +8 -0
- package/dist/plugin-sdk/agents/block-chunker.d.ts +19 -0
- package/dist/plugin-sdk/agents/channel-tools.d.ts +27 -0
- package/dist/plugin-sdk/agents/cli-session.d.ts +3 -0
- package/dist/plugin-sdk/agents/current-time.d.ts +17 -0
- package/dist/plugin-sdk/agents/date-time.d.ts +13 -0
- package/dist/plugin-sdk/agents/defaults.d.ts +3 -0
- package/dist/plugin-sdk/agents/identity-avatar.d.ts +15 -0
- package/dist/plugin-sdk/agents/identity.d.ts +28 -0
- package/dist/plugin-sdk/agents/image-sanitization.d.ts +8 -0
- package/dist/plugin-sdk/agents/lanes.d.ts +3 -0
- package/dist/plugin-sdk/agents/live-auth-keys.d.ts +6 -0
- package/dist/plugin-sdk/agents/owner-display.d.ts +19 -0
- package/dist/plugin-sdk/agents/provider-auth.d.ts +40 -0
- package/dist/plugin-sdk/agents/provider-utils.d.ts +21 -0
- package/dist/plugin-sdk/agents/schema/typebox.d.ts +14 -0
- package/dist/plugin-sdk/agents/session-write-lock.d.ts +53 -0
- package/dist/plugin-sdk/agents/stable-stringify.d.ts +1 -0
- package/dist/plugin-sdk/agents/subagent-announce-queue.d.ts +24 -0
- package/dist/plugin-sdk/agents/subagent-announce.d.ts +39 -0
- package/dist/plugin-sdk/agents/subagent-depth.d.ts +11 -0
- package/dist/plugin-sdk/agents/subagent-lifecycle-events.d.ts +18 -0
- package/dist/plugin-sdk/agents/subagent-registry-cleanup.d.ts +24 -0
- package/dist/plugin-sdk/agents/subagent-registry-completion.d.ts +15 -0
- package/dist/plugin-sdk/agents/subagent-registry-queries.d.ts +11 -0
- package/dist/plugin-sdk/agents/subagent-registry-state.d.ts +7 -0
- package/dist/plugin-sdk/agents/subagent-registry.d.ts +45 -0
- package/dist/plugin-sdk/agents/subagent-registry.store.d.ts +5 -0
- package/dist/plugin-sdk/agents/subagent-registry.types.d.ts +34 -0
- package/dist/plugin-sdk/agents/subagent-spawn.d.ts +47 -0
- package/dist/plugin-sdk/agents/timeout.d.ts +8 -0
- package/dist/plugin-sdk/agents/tool-call-id.d.ts +27 -0
- package/dist/plugin-sdk/agents/tool-display-common.d.ts +32 -0
- package/dist/plugin-sdk/agents/tool-display.d.ts +15 -0
- package/dist/plugin-sdk/agents/tool-images.d.ts +10 -0
- package/dist/plugin-sdk/agents/tools/agent-step.d.ts +15 -0
- package/dist/plugin-sdk/agents/tools/common.d.ts +80 -0
- package/dist/plugin-sdk/agents/tools/discord-actions-guild.d.ts +4 -0
- package/dist/plugin-sdk/agents/tools/discord-actions-messaging.d.ts +6 -0
- package/dist/plugin-sdk/agents/tools/discord-actions-moderation-shared.d.ts +13 -0
- package/dist/plugin-sdk/agents/tools/discord-actions-moderation.d.ts +4 -0
- package/dist/plugin-sdk/agents/tools/discord-actions-presence.d.ts +4 -0
- package/dist/plugin-sdk/agents/tools/discord-actions.d.ts +5 -0
- package/dist/plugin-sdk/agents/tools/sessions-access.d.ts +42 -0
- package/dist/plugin-sdk/agents/tools/sessions-helpers.d.ts +52 -0
- package/dist/plugin-sdk/agents/tools/sessions-resolution.d.ts +59 -0
- package/dist/plugin-sdk/agents/tools/sessions-send-helpers.d.ts +34 -0
- package/dist/plugin-sdk/agents/tools/slack-actions.d.ts +15 -0
- package/dist/plugin-sdk/agents/tools/telegram-actions.d.ts +7 -0
- package/dist/plugin-sdk/agents/tools/whatsapp-actions.d.ts +3 -0
- package/dist/plugin-sdk/agents/tools/whatsapp-target-auth.d.ts +10 -0
- package/dist/plugin-sdk/agents/usage.d.ts +49 -0
- package/dist/plugin-sdk/agents/workspace.d.ts +1 -0
- package/dist/plugin-sdk/auto-reply/chunk.d.ts +45 -0
- package/dist/plugin-sdk/auto-reply/command-auth.d.ts +17 -0
- package/dist/plugin-sdk/auto-reply/command-detection.d.ts +13 -0
- package/dist/plugin-sdk/auto-reply/commands-args.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/commands-registry.d.ts +47 -0
- package/dist/plugin-sdk/auto-reply/commands-registry.data.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/commands-registry.types.d.ts +66 -0
- package/dist/plugin-sdk/auto-reply/dispatch.d.ts +32 -0
- package/dist/plugin-sdk/auto-reply/envelope.d.ts +58 -0
- package/dist/plugin-sdk/auto-reply/fallback-state.d.ts +55 -0
- package/dist/plugin-sdk/auto-reply/group-activation.d.ts +6 -0
- package/dist/plugin-sdk/auto-reply/heartbeat-reply-payload.d.ts +2 -0
- package/dist/plugin-sdk/auto-reply/heartbeat.d.ts +16 -0
- package/dist/plugin-sdk/auto-reply/inbound-debounce.d.ts +17 -0
- package/dist/plugin-sdk/auto-reply/media-note.d.ts +2 -0
- package/dist/plugin-sdk/auto-reply/model-runtime.d.ts +17 -0
- package/dist/plugin-sdk/auto-reply/model.d.ts +8 -0
- package/dist/plugin-sdk/auto-reply/reply/abort.d.ts +32 -0
- package/dist/plugin-sdk/auto-reply/reply/agent-runner-execution.d.ts +59 -0
- package/dist/plugin-sdk/auto-reply/reply/agent-runner-helpers.d.ts +15 -0
- package/dist/plugin-sdk/auto-reply/reply/agent-runner-payloads.d.ts +27 -0
- package/dist/plugin-sdk/auto-reply/reply/agent-runner-utils.d.ts +152 -0
- package/dist/plugin-sdk/auto-reply/reply/agent-runner.d.ts +36 -0
- package/dist/plugin-sdk/auto-reply/reply/block-reply-coalescer.d.ts +15 -0
- package/dist/plugin-sdk/auto-reply/reply/block-reply-pipeline.d.ts +31 -0
- package/dist/plugin-sdk/auto-reply/reply/block-streaming.d.ts +22 -0
- package/dist/plugin-sdk/auto-reply/reply/body.d.ts +10 -0
- package/dist/plugin-sdk/auto-reply/reply/command-gates.d.ts +18 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-allowlist.d.ts +2 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-config.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-context.d.ts +12 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-core.d.ts +13 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-export-session.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-info.d.ts +11 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-plugin.d.ts +13 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-session.d.ts +8 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-setunset-standard.d.ts +10 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-setunset.d.ts +34 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-slash-parse.d.ts +24 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-status.d.ts +26 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-subagents/action-agents.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-subagents/action-focus.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-subagents/action-help.d.ts +2 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-subagents/action-info.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-subagents/action-kill.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-subagents/action-list.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-subagents/action-log.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-subagents/action-send.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-subagents/action-spawn.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-subagents/action-unfocus.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-subagents/shared.d.ts +81 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-subagents.d.ts +4 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-tts.d.ts +2 -0
- package/dist/plugin-sdk/auto-reply/reply/commands-types.d.ts +61 -0
- package/dist/plugin-sdk/auto-reply/reply/commands.d.ts +4 -0
- package/dist/plugin-sdk/auto-reply/reply/config-commands.d.ts +15 -0
- package/dist/plugin-sdk/auto-reply/reply/config-value.d.ts +4 -0
- package/dist/plugin-sdk/auto-reply/reply/debug-commands.d.ts +16 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.auth.d.ts +19 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.d.ts +6 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.fast-lane.d.ts +7 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.impl.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.levels.d.ts +20 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.params.d.ts +59 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.parse.d.ts +65 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.persist.d.ts +42 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.queue-validation.d.ts +10 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-handling.shared.d.ts +29 -0
- package/dist/plugin-sdk/auto-reply/reply/directive-parsing.d.ts +5 -0
- package/dist/plugin-sdk/auto-reply/reply/directives.d.ts +58 -0
- package/dist/plugin-sdk/auto-reply/reply/dispatch-from-config.d.ts +16 -0
- package/dist/plugin-sdk/auto-reply/reply/dispatcher-registry.d.ts +24 -0
- package/dist/plugin-sdk/auto-reply/reply/elevated-allowlist-matcher.d.ts +20 -0
- package/dist/plugin-sdk/auto-reply/reply/elevated-unavailable.d.ts +8 -0
- package/dist/plugin-sdk/auto-reply/reply/followup-runner.d.ts +16 -0
- package/dist/plugin-sdk/auto-reply/reply/get-reply-directives-apply.d.ts +64 -0
- package/dist/plugin-sdk/auto-reply/reply/get-reply-directives-utils.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/get-reply-directives.d.ts +121 -0
- package/dist/plugin-sdk/auto-reply/reply/get-reply-inline-actions.d.ts +56 -0
- package/dist/plugin-sdk/auto-reply/reply/get-reply-run.d.ts +73 -0
- package/dist/plugin-sdk/auto-reply/reply/get-reply.d.ts +4 -0
- package/dist/plugin-sdk/auto-reply/reply/groups.d.ts +26 -0
- package/dist/plugin-sdk/auto-reply/reply/history.d.ts +72 -0
- package/dist/plugin-sdk/auto-reply/reply/inbound-context.d.ts +8 -0
- package/dist/plugin-sdk/auto-reply/reply/inbound-dedupe.d.ts +8 -0
- package/dist/plugin-sdk/auto-reply/reply/inbound-meta.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/inbound-text.d.ts +1 -0
- package/dist/plugin-sdk/auto-reply/reply/line-directives.d.ts +22 -0
- package/dist/plugin-sdk/auto-reply/reply/mentions.d.ts +19 -0
- package/dist/plugin-sdk/auto-reply/reply/normalize-reply.d.ts +11 -0
- package/dist/plugin-sdk/auto-reply/reply/origin-routing.d.ts +13 -0
- package/dist/plugin-sdk/auto-reply/reply/provider-dispatcher.d.ts +19 -0
- package/dist/plugin-sdk/auto-reply/reply/queue/cleanup.d.ts +6 -0
- package/dist/plugin-sdk/auto-reply/reply/queue/directive.d.ts +15 -0
- package/dist/plugin-sdk/auto-reply/reply/queue/drain.d.ts +2 -0
- package/dist/plugin-sdk/auto-reply/reply/queue/enqueue.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/queue/normalize.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/reply/queue/settings.d.ts +2 -0
- package/dist/plugin-sdk/auto-reply/reply/queue/state.d.ts +20 -0
- package/dist/plugin-sdk/auto-reply/reply/queue/types.d.ts +87 -0
- package/dist/plugin-sdk/auto-reply/reply/queue-policy.d.ts +8 -0
- package/dist/plugin-sdk/auto-reply/reply/queue.d.ts +8 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-delivery.d.ts +27 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-directives.d.ts +14 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-dispatcher.d.ts +53 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-elevated.d.ts +16 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-inline.d.ts +8 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-payloads.d.ts +27 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-reference.d.ts +20 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-tags.d.ts +6 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-threading.d.ts +9 -0
- package/dist/plugin-sdk/auto-reply/reply/response-prefix-template.d.ts +51 -0
- package/dist/plugin-sdk/auto-reply/reply/route-reply.d.ts +56 -0
- package/dist/plugin-sdk/auto-reply/reply/session-reset-prompt.d.ts +1 -0
- package/dist/plugin-sdk/auto-reply/reply/session-run-accounting.d.ts +11 -0
- package/dist/plugin-sdk/auto-reply/reply/session-updates.d.ts +18 -0
- package/dist/plugin-sdk/auto-reply/reply/session-usage.d.ts +21 -0
- package/dist/plugin-sdk/auto-reply/reply/session.d.ts +26 -0
- package/dist/plugin-sdk/auto-reply/reply/strip-inbound-meta.d.ts +27 -0
- package/dist/plugin-sdk/auto-reply/reply/subagents-utils.d.ts +26 -0
- package/dist/plugin-sdk/auto-reply/reply/typing-mode.d.ts +27 -0
- package/dist/plugin-sdk/auto-reply/reply/typing.d.ts +18 -0
- package/dist/plugin-sdk/auto-reply/reply/untrusted-context.d.ts +1 -0
- package/dist/plugin-sdk/auto-reply/reply.d.ts +5 -0
- package/dist/plugin-sdk/auto-reply/send-policy.d.ts +6 -0
- package/dist/plugin-sdk/auto-reply/status.d.ts +59 -0
- package/dist/plugin-sdk/auto-reply/templating.d.ts +159 -0
- package/dist/plugin-sdk/auto-reply/thinking.d.ts +22 -0
- package/dist/plugin-sdk/auto-reply/tokens.d.ts +3 -0
- package/dist/plugin-sdk/auto-reply/types.d.ts +82 -0
- package/dist/plugin-sdk/channel-web.d.ts +6 -0
- package/dist/plugin-sdk/channels/account-summary.d.ts +17 -0
- package/dist/plugin-sdk/channels/ack-reactions.d.ts +29 -0
- package/dist/plugin-sdk/channels/allow-from.d.ts +11 -0
- package/dist/plugin-sdk/channels/allowlist-match.d.ts +16 -0
- package/dist/plugin-sdk/channels/allowlists/resolve-utils.d.ts +33 -0
- package/dist/plugin-sdk/channels/channel-config.d.ts +39 -0
- package/dist/plugin-sdk/channels/chat-type.d.ts +2 -0
- package/dist/plugin-sdk/channels/command-gating.d.ts +20 -0
- package/dist/plugin-sdk/channels/conversation-label.d.ts +2 -0
- package/dist/plugin-sdk/channels/dock.d.ts +25 -0
- package/dist/plugin-sdk/channels/draft-stream-controls.d.ts +54 -0
- package/dist/plugin-sdk/channels/draft-stream-loop.d.ts +13 -0
- package/dist/plugin-sdk/channels/location.d.ts +21 -0
- package/dist/plugin-sdk/channels/logging.d.ts +20 -0
- package/dist/plugin-sdk/channels/mention-gating.d.ts +27 -0
- package/dist/plugin-sdk/channels/model-overrides.d.ts +18 -0
- package/dist/plugin-sdk/channels/plugins/account-action-gate.d.ts +5 -0
- package/dist/plugin-sdk/channels/plugins/account-helpers.d.ts +6 -0
- package/dist/plugin-sdk/channels/plugins/actions/discord/handle-action.d.ts +3 -0
- package/dist/plugin-sdk/channels/plugins/actions/discord/handle-action.guild-admin.d.ts +9 -0
- package/dist/plugin-sdk/channels/plugins/actions/discord.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/actions/shared.d.ts +7 -0
- package/dist/plugin-sdk/channels/plugins/actions/signal.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/actions/telegram.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/agent-tools/whatsapp-login.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/allowlist-match.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/bluebubbles-actions.d.ts +48 -0
- package/dist/plugin-sdk/channels/plugins/channel-config.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/config-helpers.d.ts +14 -0
- package/dist/plugin-sdk/channels/plugins/config-schema.d.ts +3 -0
- package/dist/plugin-sdk/channels/plugins/config-writes.d.ts +7 -0
- package/dist/plugin-sdk/channels/plugins/directory-config.d.ts +16 -0
- package/dist/plugin-sdk/channels/plugins/group-mentions.d.ts +18 -0
- package/dist/plugin-sdk/channels/plugins/helpers.d.ts +8 -0
- package/dist/plugin-sdk/channels/plugins/index.d.ts +8 -0
- package/dist/plugin-sdk/channels/plugins/media-limits.d.ts +9 -0
- package/dist/plugin-sdk/channels/plugins/media-payload.d.ts +15 -0
- package/dist/plugin-sdk/channels/plugins/message-action-names.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/normalize/discord.d.ts +14 -0
- package/dist/plugin-sdk/channels/plugins/normalize/imessage.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/normalize/shared.d.ts +6 -0
- package/dist/plugin-sdk/channels/plugins/normalize/signal.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/normalize/slack.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/normalize/telegram.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/normalize/whatsapp.d.ts +3 -0
- package/dist/plugin-sdk/channels/plugins/onboarding/channel-access-configure.d.ts +21 -0
- package/dist/plugin-sdk/channels/plugins/onboarding/channel-access.d.ts +31 -0
- package/dist/plugin-sdk/channels/plugins/onboarding/discord.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/onboarding/helpers.d.ts +177 -0
- package/dist/plugin-sdk/channels/plugins/onboarding/imessage.d.ts +6 -0
- package/dist/plugin-sdk/channels/plugins/onboarding/signal.d.ts +7 -0
- package/dist/plugin-sdk/channels/plugins/onboarding/slack.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/onboarding/telegram.d.ts +4 -0
- package/dist/plugin-sdk/channels/plugins/onboarding/whatsapp.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/onboarding-types.d.ts +77 -0
- package/dist/plugin-sdk/channels/plugins/outbound/load.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/pairing-message.d.ts +1 -0
- package/dist/plugin-sdk/channels/plugins/pairing.d.ts +16 -0
- package/dist/plugin-sdk/channels/plugins/registry-loader.d.ts +5 -0
- package/dist/plugin-sdk/channels/plugins/setup-helpers.d.ts +13 -0
- package/dist/plugin-sdk/channels/plugins/status-issues/bluebubbles.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/status-issues/discord.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/status-issues/shared.d.ts +29 -0
- package/dist/plugin-sdk/channels/plugins/status-issues/telegram.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/status-issues/whatsapp.d.ts +2 -0
- package/dist/plugin-sdk/channels/plugins/types.adapters.d.ts +288 -0
- package/dist/plugin-sdk/channels/plugins/types.core.d.ts +349 -0
- package/dist/plugin-sdk/channels/plugins/types.d.ts +6 -0
- package/dist/plugin-sdk/channels/plugins/types.plugin.d.ts +54 -0
- package/dist/plugin-sdk/channels/plugins/whatsapp-heartbeat.d.ts +11 -0
- package/dist/plugin-sdk/channels/plugins/whatsapp-shared.d.ts +5 -0
- package/dist/plugin-sdk/channels/registry.d.ts +15 -0
- package/dist/plugin-sdk/channels/reply-prefix.d.ts +24 -0
- package/dist/plugin-sdk/channels/sender-label.d.ts +9 -0
- package/dist/plugin-sdk/channels/session.d.ts +18 -0
- package/dist/plugin-sdk/channels/status-reactions.d.ts +62 -0
- package/dist/plugin-sdk/channels/targets.d.ts +42 -0
- package/dist/plugin-sdk/channels/telegram/api.d.ts +5 -0
- package/dist/plugin-sdk/channels/typing-lifecycle.d.ts +12 -0
- package/dist/plugin-sdk/channels/typing.d.ts +13 -0
- package/dist/plugin-sdk/channels/web/index.d.ts +1 -0
- package/dist/plugin-sdk/cli/cli-name.d.ts +3 -0
- package/dist/plugin-sdk/cli/command-format.d.ts +1 -0
- package/dist/plugin-sdk/cli/deps.d.ts +18 -0
- package/dist/plugin-sdk/cli/outbound-send-deps.d.ts +4 -0
- package/dist/plugin-sdk/cli/outbound-send-mapping.d.ts +10 -0
- package/dist/plugin-sdk/cli/parse-bytes.d.ts +4 -0
- package/dist/plugin-sdk/cli/parse-duration.d.ts +4 -0
- package/dist/plugin-sdk/cli/profile-utils.d.ts +2 -0
- package/dist/plugin-sdk/cli/progress.d.ts +24 -0
- package/dist/plugin-sdk/cli/wait.d.ts +1 -0
- package/dist/plugin-sdk/commands/agent/delivery.d.ts +25 -0
- package/dist/plugin-sdk/commands/agent/run-context.d.ts +2 -0
- package/dist/plugin-sdk/commands/agent/session-store.d.ts +16 -0
- package/dist/plugin-sdk/commands/agent/session.d.ts +33 -0
- package/dist/plugin-sdk/commands/agent/types.d.ts +89 -0
- package/dist/plugin-sdk/commands/agent.d.ts +14 -0
- package/dist/plugin-sdk/commands/daemon-runtime.d.ts +8 -0
- package/dist/plugin-sdk/commands/health.d.ts +63 -0
- package/dist/plugin-sdk/commands/oauth-flow.d.ts +21 -0
- package/dist/plugin-sdk/commands/onboard-helpers.d.ts +81 -0
- package/dist/plugin-sdk/commands/onboard-types.d.ts +69 -0
- package/dist/plugin-sdk/commands/signal-install.d.ts +30 -0
- package/dist/plugin-sdk/compat/legacy-names.d.ts +8 -0
- package/dist/plugin-sdk/config/agent-dirs.d.ts +14 -0
- package/dist/plugin-sdk/config/agent-limits.d.ts +6 -0
- package/dist/plugin-sdk/config/backup-rotation.d.ts +5 -0
- package/dist/plugin-sdk/config/cache-utils.d.ts +6 -0
- package/dist/plugin-sdk/config/commands.d.ts +20 -0
- package/dist/plugin-sdk/config/config-paths.d.ts +10 -0
- package/dist/plugin-sdk/config/config.d.ts +7 -0
- package/dist/plugin-sdk/config/dangerous-name-matching.d.ts +12 -0
- package/dist/plugin-sdk/config/defaults.d.ts +19 -0
- package/dist/plugin-sdk/config/discord-preview-streaming.d.ts +25 -0
- package/dist/plugin-sdk/config/env-preserve.d.ts +10 -0
- package/dist/plugin-sdk/config/env-substitution.d.ts +36 -0
- package/dist/plugin-sdk/config/env-vars.d.ts +6 -0
- package/dist/plugin-sdk/config/group-policy.d.ts +49 -0
- package/dist/plugin-sdk/config/includes.d.ts +32 -0
- package/dist/plugin-sdk/config/io.d.ts +60 -0
- package/dist/plugin-sdk/config/legacy-migrate.d.ts +5 -0
- package/dist/plugin-sdk/config/legacy.d.ts +6 -0
- package/dist/plugin-sdk/config/legacy.migrations.d.ts +1 -0
- package/dist/plugin-sdk/config/legacy.migrations.part-1.d.ts +2 -0
- package/dist/plugin-sdk/config/legacy.migrations.part-2.d.ts +2 -0
- package/dist/plugin-sdk/config/legacy.migrations.part-3.d.ts +2 -0
- package/dist/plugin-sdk/config/legacy.rules.d.ts +2 -0
- package/dist/plugin-sdk/config/legacy.shared.d.ts +19 -0
- package/dist/plugin-sdk/config/markdown-tables.d.ts +7 -0
- package/dist/plugin-sdk/config/merge-config.d.ts +7 -0
- package/dist/plugin-sdk/config/merge-patch.d.ts +5 -0
- package/dist/plugin-sdk/config/model-input.d.ts +9 -0
- package/dist/plugin-sdk/config/normalize-paths.d.ts +8 -0
- package/dist/plugin-sdk/config/paths.d.ts +57 -0
- package/dist/plugin-sdk/config/prototype-keys.d.ts +1 -0
- package/dist/plugin-sdk/config/runtime-group-policy.d.ts +56 -0
- package/dist/plugin-sdk/config/runtime-overrides.d.ts +15 -0
- package/dist/plugin-sdk/config/sessions/artifacts.d.ts +5 -0
- package/dist/plugin-sdk/config/sessions/constants.d.ts +2 -0
- package/dist/plugin-sdk/config/sessions/delivery-info.d.ts +16 -0
- package/dist/plugin-sdk/config/sessions/disk-budget.d.ts +28 -0
- package/dist/plugin-sdk/config/sessions/group.d.ts +11 -0
- package/dist/plugin-sdk/config/sessions/main-session.d.ts +43 -0
- package/dist/plugin-sdk/config/sessions/metadata.d.ts +16 -0
- package/dist/plugin-sdk/config/sessions/paths.d.ts +21 -0
- package/dist/plugin-sdk/config/sessions/reset.d.ts +43 -0
- package/dist/plugin-sdk/config/sessions/session-file.d.ts +15 -0
- package/dist/plugin-sdk/config/sessions/session-key.d.ts +8 -0
- package/dist/plugin-sdk/config/sessions/store.d.ts +123 -0
- package/dist/plugin-sdk/config/sessions/transcript.d.ts +18 -0
- package/dist/plugin-sdk/config/sessions/types.d.ts +160 -0
- package/dist/plugin-sdk/config/sessions.d.ts +13 -0
- package/dist/plugin-sdk/config/talk.d.ts +21 -0
- package/dist/plugin-sdk/config/telegram-custom-commands.d.ts +24 -0
- package/dist/plugin-sdk/config/types.agent-defaults.d.ts +268 -0
- package/dist/plugin-sdk/config/types.agents-shared.d.ts +49 -0
- package/dist/plugin-sdk/config/types.agents.d.ts +57 -0
- package/dist/plugin-sdk/config/types.approvals.d.ts +26 -0
- package/dist/plugin-sdk/config/types.auth.d.ts +28 -0
- package/dist/plugin-sdk/config/types.base.d.ts +203 -0
- package/dist/plugin-sdk/config/types.browser.d.ts +65 -0
- package/dist/plugin-sdk/config/types.channel-messaging-common.d.ts +44 -0
- package/dist/plugin-sdk/config/types.channels.d.ts +53 -0
- package/dist/plugin-sdk/config/types.cron.d.ts +26 -0
- package/dist/plugin-sdk/config/types.d.ts +27 -0
- package/dist/plugin-sdk/config/types.discord.d.ts +273 -0
- package/dist/plugin-sdk/config/types.gateway.d.ts +335 -0
- package/dist/plugin-sdk/config/types.googlechat.d.ts +107 -0
- package/dist/plugin-sdk/config/types.hooks.d.ts +123 -0
- package/dist/plugin-sdk/config/types.imessage.d.ts +77 -0
- package/dist/plugin-sdk/config/types.installs.d.ts +14 -0
- package/dist/plugin-sdk/config/types.irc.d.ts +54 -0
- package/dist/plugin-sdk/config/types.messages.d.ts +154 -0
- package/dist/plugin-sdk/config/types.models.d.ts +41 -0
- package/dist/plugin-sdk/config/types.msteams.d.ts +108 -0
- package/dist/plugin-sdk/config/types.node-host.d.ts +10 -0
- package/dist/plugin-sdk/config/types.plugins.d.ts +23 -0
- package/dist/plugin-sdk/config/types.queue.d.ts +14 -0
- package/dist/plugin-sdk/config/types.remoteclaw.d.ts +119 -0
- package/dist/plugin-sdk/config/types.signal.d.ts +46 -0
- package/dist/plugin-sdk/config/types.slack.d.ts +181 -0
- package/dist/plugin-sdk/config/types.telegram.d.ts +191 -0
- package/dist/plugin-sdk/config/types.tools.d.ts +322 -0
- package/dist/plugin-sdk/config/types.tts.d.ts +78 -0
- package/dist/plugin-sdk/config/types.whatsapp.d.ts +101 -0
- package/dist/plugin-sdk/config/validation.d.ts +37 -0
- package/dist/plugin-sdk/config/version.d.ts +8 -0
- package/dist/plugin-sdk/config/zod-schema.agent-defaults.d.ts +156 -0
- package/dist/plugin-sdk/config/zod-schema.agent-model.d.ts +5 -0
- package/dist/plugin-sdk/config/zod-schema.agent-runtime.d.ts +500 -0
- package/dist/plugin-sdk/config/zod-schema.agents.d.ts +298 -0
- package/dist/plugin-sdk/config/zod-schema.allowdeny.d.ts +13 -0
- package/dist/plugin-sdk/config/zod-schema.approvals.d.ts +15 -0
- package/dist/plugin-sdk/config/zod-schema.channels.d.ts +6 -0
- package/dist/plugin-sdk/config/zod-schema.core.d.ts +583 -0
- package/dist/plugin-sdk/config/zod-schema.d.ts +3434 -0
- package/dist/plugin-sdk/config/zod-schema.hooks.d.ts +85 -0
- package/dist/plugin-sdk/config/zod-schema.installs.d.ts +16 -0
- package/dist/plugin-sdk/config/zod-schema.providers-core.d.ts +3693 -0
- package/dist/plugin-sdk/config/zod-schema.providers-whatsapp.d.ts +235 -0
- package/dist/plugin-sdk/config/zod-schema.providers.d.ts +2200 -0
- package/dist/plugin-sdk/config/zod-schema.sensitive.d.ts +2 -0
- package/dist/plugin-sdk/config/zod-schema.session.d.ts +234 -0
- package/dist/plugin-sdk/cron/delivery.d.ts +9 -0
- package/dist/plugin-sdk/cron/legacy-delivery.d.ts +3 -0
- package/dist/plugin-sdk/cron/parse.d.ts +1 -0
- package/dist/plugin-sdk/cron/payload-migration.d.ts +3 -0
- package/dist/plugin-sdk/cron/schedule.d.ts +2 -0
- package/dist/plugin-sdk/cron/service/jobs.d.ts +21 -0
- package/dist/plugin-sdk/cron/service/locked.d.ts +2 -0
- package/dist/plugin-sdk/cron/service/normalize.d.ts +18 -0
- package/dist/plugin-sdk/cron/service/ops.d.ts +81 -0
- package/dist/plugin-sdk/cron/service/state.d.ts +125 -0
- package/dist/plugin-sdk/cron/service/store.d.ts +9 -0
- package/dist/plugin-sdk/cron/service/timer.d.ts +47 -0
- package/dist/plugin-sdk/cron/service.d.ts +66 -0
- package/dist/plugin-sdk/cron/session-reaper.d.ts +35 -0
- package/dist/plugin-sdk/cron/stagger.d.ts +8 -0
- package/dist/plugin-sdk/cron/store.d.ts +6 -0
- package/dist/plugin-sdk/cron/types.d.ts +131 -0
- package/dist/plugin-sdk/cron/webhook-url.d.ts +1 -0
- package/dist/plugin-sdk/daemon/constants.d.ts +35 -0
- package/dist/plugin-sdk/discord/accounts.d.ts +21 -0
- package/dist/plugin-sdk/discord/api.d.ts +11 -0
- package/dist/plugin-sdk/discord/audit.d.ts +29 -0
- package/dist/plugin-sdk/discord/chunk.d.ts +20 -0
- package/dist/plugin-sdk/discord/client.d.ts +21 -0
- package/dist/plugin-sdk/discord/components-registry.d.ts +16 -0
- package/dist/plugin-sdk/discord/components.d.ts +196 -0
- package/dist/plugin-sdk/discord/directory-live.d.ts +4 -0
- package/dist/plugin-sdk/discord/draft-chunking.d.ts +6 -0
- package/dist/plugin-sdk/discord/draft-stream.d.ts +21 -0
- package/dist/plugin-sdk/discord/gateway-logging.d.ts +8 -0
- package/dist/plugin-sdk/discord/guilds.d.ts +6 -0
- package/dist/plugin-sdk/discord/monitor/agent-components.d.ts +55 -0
- package/dist/plugin-sdk/discord/monitor/allow-list.d.ts +176 -0
- package/dist/plugin-sdk/discord/monitor/commands.d.ts +2 -0
- package/dist/plugin-sdk/discord/monitor/format.d.ts +13 -0
- package/dist/plugin-sdk/discord/monitor/gateway-plugin.d.ts +8 -0
- package/dist/plugin-sdk/discord/monitor/gateway-registry.d.ts +9 -0
- package/dist/plugin-sdk/discord/monitor/listeners.d.ts +44 -0
- package/dist/plugin-sdk/discord/monitor/message-handler.d.ts +5 -0
- package/dist/plugin-sdk/discord/monitor/message-handler.preflight.d.ts +14 -0
- package/dist/plugin-sdk/discord/monitor/message-handler.preflight.types.d.ts +95 -0
- package/dist/plugin-sdk/discord/monitor/message-handler.process.d.ts +2 -0
- package/dist/plugin-sdk/discord/monitor/message-utils.d.ts +40 -0
- package/dist/plugin-sdk/discord/monitor/native-command.d.ts +23 -0
- package/dist/plugin-sdk/discord/monitor/presence-cache.d.ts +9 -0
- package/dist/plugin-sdk/discord/monitor/presence.d.ts +5 -0
- package/dist/plugin-sdk/discord/monitor/provider.allowlist.d.ts +14 -0
- package/dist/plugin-sdk/discord/monitor/provider.d.ts +28 -0
- package/dist/plugin-sdk/discord/monitor/provider.lifecycle.d.ts +23 -0
- package/dist/plugin-sdk/discord/monitor/reply-context.d.ts +17 -0
- package/dist/plugin-sdk/discord/monitor/reply-delivery.d.ts +22 -0
- package/dist/plugin-sdk/discord/monitor/rest-fetch.d.ts +2 -0
- package/dist/plugin-sdk/discord/monitor/sender-identity.d.ts +31 -0
- package/dist/plugin-sdk/discord/monitor/system-events.d.ts +2 -0
- package/dist/plugin-sdk/discord/monitor/thread-bindings.d.ts +5 -0
- package/dist/plugin-sdk/discord/monitor/thread-bindings.discord-api.d.ts +36 -0
- package/dist/plugin-sdk/discord/monitor/thread-bindings.lifecycle.d.ts +30 -0
- package/dist/plugin-sdk/discord/monitor/thread-bindings.manager.d.ts +17 -0
- package/dist/plugin-sdk/discord/monitor/thread-bindings.messages.d.ts +17 -0
- package/dist/plugin-sdk/discord/monitor/thread-bindings.state.d.ts +61 -0
- package/dist/plugin-sdk/discord/monitor/thread-bindings.types.d.ts +64 -0
- package/dist/plugin-sdk/discord/monitor/threading.d.ts +106 -0
- package/dist/plugin-sdk/discord/monitor/typing.d.ts +5 -0
- package/dist/plugin-sdk/discord/monitor.d.ts +10 -0
- package/dist/plugin-sdk/discord/monitor.gateway.d.ts +12 -0
- package/dist/plugin-sdk/discord/pluralkit.d.ts +26 -0
- package/dist/plugin-sdk/discord/probe.d.ts +28 -0
- package/dist/plugin-sdk/discord/resolve-channels.d.ts +15 -0
- package/dist/plugin-sdk/discord/resolve-users.d.ts +14 -0
- package/dist/plugin-sdk/discord/send.channels.d.ts +17 -0
- package/dist/plugin-sdk/discord/send.components.d.ts +17 -0
- package/dist/plugin-sdk/discord/send.d.ts +10 -0
- package/dist/plugin-sdk/discord/send.emojis-stickers.d.ts +4 -0
- package/dist/plugin-sdk/discord/send.guild.d.ts +24 -0
- package/dist/plugin-sdk/discord/send.messages.d.ts +20 -0
- package/dist/plugin-sdk/discord/send.outbound.d.ts +57 -0
- package/dist/plugin-sdk/discord/send.permissions.d.ts +20 -0
- package/dist/plugin-sdk/discord/send.reactions.d.ts +15 -0
- package/dist/plugin-sdk/discord/send.shared.d.ts +85 -0
- package/dist/plugin-sdk/discord/send.types.d.ts +144 -0
- package/dist/plugin-sdk/discord/targets.d.ts +18 -0
- package/dist/plugin-sdk/discord/token.d.ts +11 -0
- package/dist/plugin-sdk/discord/voice/command.d.ts +15 -0
- package/dist/plugin-sdk/discord/voice/manager.d.ts +52 -0
- package/dist/plugin-sdk/discord/voice-message.d.ts +50 -0
- package/dist/plugin-sdk/gateway/call.d.ts +65 -0
- package/dist/plugin-sdk/gateway/chat-abort.d.ts +44 -0
- package/dist/plugin-sdk/gateway/chat-sanitize.d.ts +4 -0
- package/dist/plugin-sdk/gateway/client.d.ts +64 -0
- package/dist/plugin-sdk/gateway/control-ui-shared.d.ts +9 -0
- package/dist/plugin-sdk/gateway/credentials.d.ts +36 -0
- package/dist/plugin-sdk/gateway/device-auth.d.ts +11 -0
- package/dist/plugin-sdk/gateway/method-scopes.d.ts +22 -0
- package/dist/plugin-sdk/gateway/net.d.ts +77 -0
- package/dist/plugin-sdk/gateway/node-registry.d.ts +60 -0
- package/dist/plugin-sdk/gateway/protocol/client-info.d.ts +58 -0
- package/dist/plugin-sdk/gateway/protocol/index.d.ts +497 -0
- package/dist/plugin-sdk/gateway/protocol/schema/agent.d.ts +89 -0
- package/dist/plugin-sdk/gateway/protocol/schema/agents-models-skills.d.ts +188 -0
- package/dist/plugin-sdk/gateway/protocol/schema/channels.d.ts +134 -0
- package/dist/plugin-sdk/gateway/protocol/schema/config.d.ts +53 -0
- package/dist/plugin-sdk/gateway/protocol/schema/cron.d.ts +324 -0
- package/dist/plugin-sdk/gateway/protocol/schema/devices.d.ts +41 -0
- package/dist/plugin-sdk/gateway/protocol/schema/error-codes.d.ts +14 -0
- package/dist/plugin-sdk/gateway/protocol/schema/frames.d.ts +168 -0
- package/dist/plugin-sdk/gateway/protocol/schema/logs-chat.d.ts +45 -0
- package/dist/plugin-sdk/gateway/protocol/schema/nodes.d.ts +64 -0
- package/dist/plugin-sdk/gateway/protocol/schema/primitives.d.ts +4 -0
- package/dist/plugin-sdk/gateway/protocol/schema/protocol-schemas.d.ts +3 -0
- package/dist/plugin-sdk/gateway/protocol/schema/push.d.ts +15 -0
- package/dist/plugin-sdk/gateway/protocol/schema/sessions.d.ts +81 -0
- package/dist/plugin-sdk/gateway/protocol/schema/snapshot.d.ts +69 -0
- package/dist/plugin-sdk/gateway/protocol/schema/types.d.ts +120 -0
- package/dist/plugin-sdk/gateway/protocol/schema/wizard.d.ts +86 -0
- package/dist/plugin-sdk/gateway/protocol/schema.d.ts +16 -0
- package/dist/plugin-sdk/gateway/server/ws-types.d.ts +9 -0
- package/dist/plugin-sdk/gateway/server-broadcast.d.ts +17 -0
- package/dist/plugin-sdk/gateway/server-channels.d.ts +26 -0
- package/dist/plugin-sdk/gateway/server-constants.d.ts +10 -0
- package/dist/plugin-sdk/gateway/server-methods/types.d.ts +84 -0
- package/dist/plugin-sdk/gateway/server-shared.d.ts +7 -0
- package/dist/plugin-sdk/gateway/session-utils.fs.d.ts +48 -0
- package/dist/plugin-sdk/gateway/session-utils.types.d.ts +84 -0
- package/dist/plugin-sdk/gateway/ws-log.d.ts +5 -0
- package/dist/plugin-sdk/gateway/ws-logging.d.ts +4 -0
- package/dist/plugin-sdk/globals.d.ts +11 -0
- package/dist/plugin-sdk/hooks/internal-hooks.d.ts +140 -0
- package/dist/plugin-sdk/hooks/types.d.ts +62 -0
- package/dist/plugin-sdk/imessage/accounts.d.ts +16 -0
- package/dist/plugin-sdk/imessage/client.d.ts +46 -0
- package/dist/plugin-sdk/imessage/constants.d.ts +2 -0
- package/dist/plugin-sdk/imessage/monitor/abort-handler.d.ts +9 -0
- package/dist/plugin-sdk/imessage/monitor/deliver.d.ts +14 -0
- package/dist/plugin-sdk/imessage/monitor/echo-cache.d.ts +9 -0
- package/dist/plugin-sdk/imessage/monitor/inbound-processing.d.ts +96 -0
- package/dist/plugin-sdk/imessage/monitor/monitor-provider.d.ts +7 -0
- package/dist/plugin-sdk/imessage/monitor/parse-notification.d.ts +2 -0
- package/dist/plugin-sdk/imessage/monitor/runtime.d.ts +4 -0
- package/dist/plugin-sdk/imessage/monitor/types.d.ts +37 -0
- package/dist/plugin-sdk/imessage/monitor.d.ts +2 -0
- package/dist/plugin-sdk/imessage/probe.d.ts +17 -0
- package/dist/plugin-sdk/imessage/send.d.ts +34 -0
- package/dist/plugin-sdk/imessage/target-parsing-helpers.d.ts +45 -0
- package/dist/plugin-sdk/imessage/targets.d.ts +39 -0
- package/dist/plugin-sdk/index.d.ts +1 -0
- package/dist/plugin-sdk/index.js +24645 -0
- package/dist/plugin-sdk/infra/agent-events.d.ts +21 -0
- package/dist/plugin-sdk/infra/archive-path.d.ts +12 -0
- package/dist/plugin-sdk/infra/archive.d.ts +46 -0
- package/dist/plugin-sdk/infra/backoff.d.ts +8 -0
- package/dist/plugin-sdk/infra/brew.d.ts +8 -0
- package/dist/plugin-sdk/infra/channel-activity.d.ts +18 -0
- package/dist/plugin-sdk/infra/channel-summary.d.ts +6 -0
- package/dist/plugin-sdk/infra/dedupe.d.ts +12 -0
- package/dist/plugin-sdk/infra/device-auth-store.d.ts +18 -0
- package/dist/plugin-sdk/infra/device-identity.d.ts +11 -0
- package/dist/plugin-sdk/infra/device-pairing.d.ts +101 -0
- package/dist/plugin-sdk/infra/diagnostic-events.d.ts +140 -0
- package/dist/plugin-sdk/infra/diagnostic-flags.d.ts +4 -0
- package/dist/plugin-sdk/infra/dotenv.d.ts +3 -0
- package/dist/plugin-sdk/infra/env.d.ts +11 -0
- package/dist/plugin-sdk/infra/errors.d.ts +11 -0
- package/dist/plugin-sdk/infra/fetch.d.ts +2 -0
- package/dist/plugin-sdk/infra/file-identity.d.ts +5 -0
- package/dist/plugin-sdk/infra/file-lock.d.ts +2 -0
- package/dist/plugin-sdk/infra/format-time/format-datetime.d.ts +35 -0
- package/dist/plugin-sdk/infra/format-time/format-duration.d.ts +23 -0
- package/dist/plugin-sdk/infra/format-time/format-relative.d.ts +39 -0
- package/dist/plugin-sdk/infra/fs-safe.d.ts +25 -0
- package/dist/plugin-sdk/infra/gemini-auth.d.ts +16 -0
- package/dist/plugin-sdk/infra/git-commit.d.ts +4 -0
- package/dist/plugin-sdk/infra/git-root.d.ts +7 -0
- package/dist/plugin-sdk/infra/heartbeat-active-hours.d.ts +5 -0
- package/dist/plugin-sdk/infra/heartbeat-events-filter.d.ts +8 -0
- package/dist/plugin-sdk/infra/heartbeat-events.d.ts +21 -0
- package/dist/plugin-sdk/infra/heartbeat-reason.d.ts +5 -0
- package/dist/plugin-sdk/infra/heartbeat-runner.d.ts +45 -0
- package/dist/plugin-sdk/infra/heartbeat-visibility.d.ts +17 -0
- package/dist/plugin-sdk/infra/heartbeat-wake.d.ts +31 -0
- package/dist/plugin-sdk/infra/home-dir.d.ts +7 -0
- package/dist/plugin-sdk/infra/host-env-security.d.ts +21 -0
- package/dist/plugin-sdk/infra/http-body.d.ts +46 -0
- package/dist/plugin-sdk/infra/json-file.d.ts +2 -0
- package/dist/plugin-sdk/infra/json-files.d.ts +5 -0
- package/dist/plugin-sdk/infra/map-size.d.ts +1 -0
- package/dist/plugin-sdk/infra/net/fetch-guard.d.ts +21 -0
- package/dist/plugin-sdk/infra/net/hostname.d.ts +1 -0
- package/dist/plugin-sdk/infra/net/ssrf.d.ts +35 -0
- package/dist/plugin-sdk/infra/outbound/abort.d.ts +8 -0
- package/dist/plugin-sdk/infra/outbound/agent-delivery.d.ts +46 -0
- package/dist/plugin-sdk/infra/outbound/bound-delivery-router.d.ts +16 -0
- package/dist/plugin-sdk/infra/outbound/channel-selection.d.ts +11 -0
- package/dist/plugin-sdk/infra/outbound/channel-target.d.ts +6 -0
- package/dist/plugin-sdk/infra/outbound/deliver.d.ts +81 -0
- package/dist/plugin-sdk/infra/outbound/delivery-queue.d.ts +78 -0
- package/dist/plugin-sdk/infra/outbound/directory-cache.d.ts +24 -0
- package/dist/plugin-sdk/infra/outbound/envelope.d.ts +16 -0
- package/dist/plugin-sdk/infra/outbound/format.d.ts +39 -0
- package/dist/plugin-sdk/infra/outbound/identity.d.ts +8 -0
- package/dist/plugin-sdk/infra/outbound/message-action-spec.d.ts +5 -0
- package/dist/plugin-sdk/infra/outbound/payloads.d.ts +18 -0
- package/dist/plugin-sdk/infra/outbound/session-binding-service.d.ts +57 -0
- package/dist/plugin-sdk/infra/outbound/target-errors.d.ts +6 -0
- package/dist/plugin-sdk/infra/outbound/target-normalization.d.ts +4 -0
- package/dist/plugin-sdk/infra/outbound/target-resolver.d.ts +53 -0
- package/dist/plugin-sdk/infra/outbound/targets.d.ts +87 -0
- package/dist/plugin-sdk/infra/pairing-files.d.ts +23 -0
- package/dist/plugin-sdk/infra/pairing-pending.d.ts +13 -0
- package/dist/plugin-sdk/infra/pairing-token.d.ts +3 -0
- package/dist/plugin-sdk/infra/path-guards.d.ts +5 -0
- package/dist/plugin-sdk/infra/path-safety.d.ts +2 -0
- package/dist/plugin-sdk/infra/plain-object.d.ts +4 -0
- package/dist/plugin-sdk/infra/prototype-keys.d.ts +1 -0
- package/dist/plugin-sdk/infra/provider-usage.auth.d.ts +11 -0
- package/dist/plugin-sdk/infra/provider-usage.d.ts +4 -0
- package/dist/plugin-sdk/infra/provider-usage.fetch.claude.d.ts +2 -0
- package/dist/plugin-sdk/infra/provider-usage.fetch.codex.d.ts +2 -0
- package/dist/plugin-sdk/infra/provider-usage.fetch.copilot.d.ts +2 -0
- package/dist/plugin-sdk/infra/provider-usage.fetch.d.ts +6 -0
- package/dist/plugin-sdk/infra/provider-usage.fetch.gemini.d.ts +2 -0
- package/dist/plugin-sdk/infra/provider-usage.fetch.minimax.d.ts +2 -0
- package/dist/plugin-sdk/infra/provider-usage.fetch.shared.d.ts +12 -0
- package/dist/plugin-sdk/infra/provider-usage.fetch.zai.d.ts +2 -0
- package/dist/plugin-sdk/infra/provider-usage.format.d.ts +13 -0
- package/dist/plugin-sdk/infra/provider-usage.load.d.ts +12 -0
- package/dist/plugin-sdk/infra/provider-usage.shared.d.ts +8 -0
- package/dist/plugin-sdk/infra/provider-usage.types.d.ts +17 -0
- package/dist/plugin-sdk/infra/restart.d.ts +70 -0
- package/dist/plugin-sdk/infra/retry-policy.d.ts +25 -0
- package/dist/plugin-sdk/infra/retry.d.ts +21 -0
- package/dist/plugin-sdk/infra/safe-executable-value.d.ts +1 -0
- package/dist/plugin-sdk/infra/scp-host.d.ts +2 -0
- package/dist/plugin-sdk/infra/secure-random.d.ts +2 -0
- package/dist/plugin-sdk/infra/session-cost-usage.d.ts +45 -0
- package/dist/plugin-sdk/infra/session-cost-usage.types.d.ts +153 -0
- package/dist/plugin-sdk/infra/session-maintenance-warning.d.ts +10 -0
- package/dist/plugin-sdk/infra/shell-env.d.ts +34 -0
- package/dist/plugin-sdk/infra/system-events.d.ts +18 -0
- package/dist/plugin-sdk/infra/tailnet.d.ts +8 -0
- package/dist/plugin-sdk/infra/tls/fingerprint.d.ts +1 -0
- package/dist/plugin-sdk/infra/tls/gateway.d.ts +16 -0
- package/dist/plugin-sdk/infra/tmp-remoteclaw-dir.d.ts +18 -0
- package/dist/plugin-sdk/infra/transport-ready.d.ts +16 -0
- package/dist/plugin-sdk/infra/unhandled-rejections.d.ts +15 -0
- package/dist/plugin-sdk/infra/ws.d.ts +2 -0
- package/dist/plugin-sdk/infra/wsl.d.ts +11 -0
- package/dist/plugin-sdk/line/accounts.d.ts +10 -0
- package/dist/plugin-sdk/line/actions.d.ts +22 -0
- package/dist/plugin-sdk/line/auto-reply-delivery.d.ts +38 -0
- package/dist/plugin-sdk/line/bot-access.d.ts +17 -0
- package/dist/plugin-sdk/line/bot-handlers.d.ts +13 -0
- package/dist/plugin-sdk/line/bot-message-context.d.ts +118 -0
- package/dist/plugin-sdk/line/bot.d.ts +24 -0
- package/dist/plugin-sdk/line/channel-access-token.d.ts +4 -0
- package/dist/plugin-sdk/line/config-schema.d.ts +64 -0
- package/dist/plugin-sdk/line/download.d.ts +7 -0
- package/dist/plugin-sdk/line/flex-templates/basic-cards.d.ts +46 -0
- package/dist/plugin-sdk/line/flex-templates/common.d.ts +2 -0
- package/dist/plugin-sdk/line/flex-templates/media-control-cards.d.ts +73 -0
- package/dist/plugin-sdk/line/flex-templates/message.d.ts +6 -0
- package/dist/plugin-sdk/line/flex-templates/schedule-cards.d.ts +55 -0
- package/dist/plugin-sdk/line/flex-templates/types.d.ts +19 -0
- package/dist/plugin-sdk/line/flex-templates.d.ts +5 -0
- package/dist/plugin-sdk/line/markdown-to-line.d.ts +72 -0
- package/dist/plugin-sdk/line/monitor.d.ts +28 -0
- package/dist/plugin-sdk/line/probe.d.ts +2 -0
- package/dist/plugin-sdk/line/reply-chunks.d.ts +24 -0
- package/dist/plugin-sdk/line/send.d.ts +91 -0
- package/dist/plugin-sdk/line/signature.d.ts +1 -0
- package/dist/plugin-sdk/line/template-messages.d.ts +100 -0
- package/dist/plugin-sdk/line/types.d.ts +113 -0
- package/dist/plugin-sdk/line/webhook-node.d.ts +15 -0
- package/dist/plugin-sdk/line/webhook-utils.d.ts +3 -0
- package/dist/plugin-sdk/line/webhook.d.ts +19 -0
- package/dist/plugin-sdk/link-understanding/apply.d.ts +10 -0
- package/dist/plugin-sdk/link-understanding/defaults.d.ts +2 -0
- package/dist/plugin-sdk/link-understanding/detect.d.ts +3 -0
- package/dist/plugin-sdk/link-understanding/format.d.ts +4 -0
- package/dist/plugin-sdk/link-understanding/runner.d.ts +11 -0
- package/dist/plugin-sdk/logger.d.ts +6 -0
- package/dist/plugin-sdk/logging/config.d.ts +4 -0
- package/dist/plugin-sdk/logging/console.d.ts +23 -0
- package/dist/plugin-sdk/logging/diagnostic-session-state.d.ts +30 -0
- package/dist/plugin-sdk/logging/diagnostic.d.ts +65 -0
- package/dist/plugin-sdk/logging/env-log-level.d.ts +2 -0
- package/dist/plugin-sdk/logging/levels.d.ts +5 -0
- package/dist/plugin-sdk/logging/logger.d.ts +44 -0
- package/dist/plugin-sdk/logging/node-require.d.ts +1 -0
- package/dist/plugin-sdk/logging/redact-identifier.d.ts +4 -0
- package/dist/plugin-sdk/logging/redact.d.ts +9 -0
- package/dist/plugin-sdk/logging/state.d.ts +19 -0
- package/dist/plugin-sdk/logging/subsystem.d.ts +18 -0
- package/dist/plugin-sdk/logging/timestamps.d.ts +1 -0
- package/dist/plugin-sdk/logging.d.ts +10 -0
- package/dist/plugin-sdk/markdown/fences.d.ts +10 -0
- package/dist/plugin-sdk/markdown/ir.d.ts +32 -0
- package/dist/plugin-sdk/markdown/render.d.ts +18 -0
- package/dist/plugin-sdk/markdown/tables.d.ts +2 -0
- package/dist/plugin-sdk/markdown/whatsapp.d.ts +14 -0
- package/dist/plugin-sdk/media/audio-tags.d.ts +10 -0
- package/dist/plugin-sdk/media/audio.d.ts +19 -0
- package/dist/plugin-sdk/media/base64.d.ts +6 -0
- package/dist/plugin-sdk/media/constants.d.ts +7 -0
- package/dist/plugin-sdk/media/fetch.d.ts +23 -0
- package/dist/plugin-sdk/media/image-ops.d.ts +41 -0
- package/dist/plugin-sdk/media/inbound-path-policy.d.ts +18 -0
- package/dist/plugin-sdk/media/input-files.d.ts +95 -0
- package/dist/plugin-sdk/media/local-roots.d.ts +3 -0
- package/dist/plugin-sdk/media/mime.d.ts +16 -0
- package/dist/plugin-sdk/media/outbound-attachment.d.ts +6 -0
- package/dist/plugin-sdk/media/parse.d.ts +8 -0
- package/dist/plugin-sdk/media/png-encode.d.ts +8 -0
- package/dist/plugin-sdk/media/read-response-with-limit.d.ts +7 -0
- package/dist/plugin-sdk/media/store.d.ts +33 -0
- package/dist/plugin-sdk/media-understanding/apply.d.ts +19 -0
- package/dist/plugin-sdk/media-understanding/attachments.d.ts +49 -0
- package/dist/plugin-sdk/media-understanding/audio-preflight.d.ts +16 -0
- package/dist/plugin-sdk/media-understanding/concurrency.d.ts +1 -0
- package/dist/plugin-sdk/media-understanding/defaults.d.ts +12 -0
- package/dist/plugin-sdk/media-understanding/errors.d.ts +6 -0
- package/dist/plugin-sdk/media-understanding/format.d.ts +7 -0
- package/dist/plugin-sdk/media-understanding/fs.d.ts +1 -0
- package/dist/plugin-sdk/media-understanding/output-extract.d.ts +2 -0
- package/dist/plugin-sdk/media-understanding/providers/anthropic/index.d.ts +2 -0
- package/dist/plugin-sdk/media-understanding/providers/deepgram/audio.d.ts +4 -0
- package/dist/plugin-sdk/media-understanding/providers/deepgram/index.d.ts +2 -0
- package/dist/plugin-sdk/media-understanding/providers/google/audio.d.ts +3 -0
- package/dist/plugin-sdk/media-understanding/providers/google/index.d.ts +2 -0
- package/dist/plugin-sdk/media-understanding/providers/google/inline-data.d.ts +20 -0
- package/dist/plugin-sdk/media-understanding/providers/google/video.d.ts +3 -0
- package/dist/plugin-sdk/media-understanding/providers/groq/index.d.ts +2 -0
- package/dist/plugin-sdk/media-understanding/providers/index.d.ts +4 -0
- package/dist/plugin-sdk/media-understanding/providers/minimax/index.d.ts +2 -0
- package/dist/plugin-sdk/media-understanding/providers/mistral/index.d.ts +2 -0
- package/dist/plugin-sdk/media-understanding/providers/moonshot/index.d.ts +2 -0
- package/dist/plugin-sdk/media-understanding/providers/moonshot/video.d.ts +3 -0
- package/dist/plugin-sdk/media-understanding/providers/openai/audio.d.ts +3 -0
- package/dist/plugin-sdk/media-understanding/providers/openai/index.d.ts +2 -0
- package/dist/plugin-sdk/media-understanding/providers/shared.d.ts +20 -0
- package/dist/plugin-sdk/media-understanding/providers/zai/index.d.ts +2 -0
- package/dist/plugin-sdk/media-understanding/resolve.d.ts +44 -0
- package/dist/plugin-sdk/media-understanding/runner.d.ts +34 -0
- package/dist/plugin-sdk/media-understanding/runner.entries.d.ts +33 -0
- package/dist/plugin-sdk/media-understanding/scope.d.ts +9 -0
- package/dist/plugin-sdk/media-understanding/types.d.ts +74 -0
- package/dist/plugin-sdk/media-understanding/video.d.ts +2 -0
- package/dist/plugin-sdk/middleware/channel-bridge.d.ts +39 -0
- package/dist/plugin-sdk/middleware/cli-runtime-base.d.ts +35 -0
- package/dist/plugin-sdk/middleware/delivery-adapter.d.ts +36 -0
- package/dist/plugin-sdk/middleware/error-classifier.d.ts +14 -0
- package/dist/plugin-sdk/middleware/mcp-side-effects.d.ts +20 -0
- package/dist/plugin-sdk/middleware/runtime-factory.d.ts +4 -0
- package/dist/plugin-sdk/middleware/runtimes/claude.d.ts +27 -0
- package/dist/plugin-sdk/middleware/runtimes/codex.d.ts +74 -0
- package/dist/plugin-sdk/middleware/runtimes/gemini.d.ts +52 -0
- package/dist/plugin-sdk/middleware/runtimes/opencode.d.ts +54 -0
- package/dist/plugin-sdk/middleware/session-map.d.ts +36 -0
- package/dist/plugin-sdk/middleware/system-prompt.d.ts +30 -0
- package/dist/plugin-sdk/middleware/types.d.ts +188 -0
- package/dist/plugin-sdk/pairing/pairing-labels.d.ts +2 -0
- package/dist/plugin-sdk/pairing/pairing-messages.d.ts +6 -0
- package/dist/plugin-sdk/pairing/pairing-store.d.ts +48 -0
- package/dist/plugin-sdk/plugin-sdk/account-id.d.ts +1 -0
- package/dist/plugin-sdk/plugin-sdk/agent-media-payload.d.ts +12 -0
- package/dist/plugin-sdk/plugin-sdk/allow-from.d.ts +32 -0
- package/dist/plugin-sdk/plugin-sdk/command-auth.d.ts +25 -0
- package/dist/plugin-sdk/plugin-sdk/config-paths.d.ts +6 -0
- package/dist/plugin-sdk/plugin-sdk/file-lock.d.ts +16 -0
- package/dist/plugin-sdk/plugin-sdk/group-access.d.ts +16 -0
- package/dist/plugin-sdk/plugin-sdk/index.d.ts +162 -0
- package/dist/plugin-sdk/plugin-sdk/json-store.d.ts +5 -0
- package/dist/plugin-sdk/plugin-sdk/onboarding.d.ts +11 -0
- package/dist/plugin-sdk/plugin-sdk/persistent-dedupe.d.ts +20 -0
- package/dist/plugin-sdk/plugin-sdk/reply-payload.d.ts +22 -0
- package/dist/plugin-sdk/plugin-sdk/run-command.d.ts +12 -0
- package/dist/plugin-sdk/plugin-sdk/runtime.d.ts +10 -0
- package/dist/plugin-sdk/plugin-sdk/slack-message-actions.d.ts +11 -0
- package/dist/plugin-sdk/plugin-sdk/status-helpers.d.ts +88 -0
- package/dist/plugin-sdk/plugin-sdk/temp-path.d.ts +12 -0
- package/dist/plugin-sdk/plugin-sdk/text-chunking.d.ts +1 -0
- package/dist/plugin-sdk/plugin-sdk/tool-send.d.ts +4 -0
- package/dist/plugin-sdk/plugin-sdk/webhook-path.d.ts +6 -0
- package/dist/plugin-sdk/plugin-sdk/webhook-targets.d.ts +23 -0
- package/dist/plugin-sdk/plugins/bundled-dir.d.ts +1 -0
- package/dist/plugin-sdk/plugins/commands.d.ts +83 -0
- package/dist/plugin-sdk/plugins/config-schema.d.ts +2 -0
- package/dist/plugin-sdk/plugins/config-state.d.ts +30 -0
- package/dist/plugin-sdk/plugins/discovery.d.ts +24 -0
- package/dist/plugin-sdk/plugins/hook-runner-global.d.ts +37 -0
- package/dist/plugin-sdk/plugins/hooks.d.ts +49 -0
- package/dist/plugin-sdk/plugins/http-path.d.ts +1 -0
- package/dist/plugin-sdk/plugins/http-registry.d.ts +13 -0
- package/dist/plugin-sdk/plugins/manifest-registry.d.ts +34 -0
- package/dist/plugin-sdk/plugins/manifest.d.ts +66 -0
- package/dist/plugin-sdk/plugins/path-safety.d.ts +5 -0
- package/dist/plugin-sdk/plugins/registry.d.ts +130 -0
- package/dist/plugin-sdk/plugins/runtime/native-deps.d.ts +8 -0
- package/dist/plugin-sdk/plugins/runtime/types.d.ts +310 -0
- package/dist/plugin-sdk/plugins/runtime.d.ts +5 -0
- package/dist/plugin-sdk/plugins/schema-validator.d.ts +10 -0
- package/dist/plugin-sdk/plugins/types.d.ts +487 -0
- package/dist/plugin-sdk/polls.d.ts +31 -0
- package/dist/plugin-sdk/process/command-queue.d.ts +51 -0
- package/dist/plugin-sdk/process/exec.d.ts +30 -0
- package/dist/plugin-sdk/process/lanes.d.ts +6 -0
- package/dist/plugin-sdk/process/spawn-utils.d.ts +26 -0
- package/dist/plugin-sdk/routing/account-id.d.ts +3 -0
- package/dist/plugin-sdk/routing/account-lookup.d.ts +1 -0
- package/dist/plugin-sdk/routing/bindings.d.ts +11 -0
- package/dist/plugin-sdk/routing/resolve-route.d.ts +42 -0
- package/dist/plugin-sdk/routing/session-key.d.ts +48 -0
- package/dist/plugin-sdk/runtime.d.ts +7 -0
- package/dist/plugin-sdk/security/channel-metadata.d.ts +6 -0
- package/dist/plugin-sdk/security/dm-policy-shared.d.ts +33 -0
- package/dist/plugin-sdk/security/external-content.d.ts +53 -0
- package/dist/plugin-sdk/security/safe-regex.d.ts +2 -0
- package/dist/plugin-sdk/security/scan-paths.d.ts +5 -0
- package/dist/plugin-sdk/security/secret-equal.d.ts +1 -0
- package/dist/plugin-sdk/sessions/input-provenance.d.ts +16 -0
- package/dist/plugin-sdk/sessions/level-overrides.d.ts +10 -0
- package/dist/plugin-sdk/sessions/model-overrides.d.ts +14 -0
- package/dist/plugin-sdk/sessions/send-policy.d.ts +11 -0
- package/dist/plugin-sdk/sessions/session-key-utils.d.ts +16 -0
- package/dist/plugin-sdk/sessions/session-label.d.ts +9 -0
- package/dist/plugin-sdk/sessions/transcript-events.d.ts +7 -0
- package/dist/plugin-sdk/shared/avatar-policy.d.ts +16 -0
- package/dist/plugin-sdk/shared/chat-content.d.ts +5 -0
- package/dist/plugin-sdk/shared/chat-envelope.d.ts +2 -0
- package/dist/plugin-sdk/shared/device-auth.d.ts +13 -0
- package/dist/plugin-sdk/shared/gateway-bind-url.d.ts +14 -0
- package/dist/plugin-sdk/shared/net/ip.d.ts +19 -0
- package/dist/plugin-sdk/shared/operator-scope-compat.d.ts +5 -0
- package/dist/plugin-sdk/shared/pid-alive.d.ts +1 -0
- package/dist/plugin-sdk/shared/process-scoped-map.d.ts +1 -0
- package/dist/plugin-sdk/shared/string-normalization.d.ts +4 -0
- package/dist/plugin-sdk/shared/subagents-format.d.ts +15 -0
- package/dist/plugin-sdk/shared/tailscale-status.d.ts +8 -0
- package/dist/plugin-sdk/shared/text/code-regions.d.ts +6 -0
- package/dist/plugin-sdk/shared/text/reasoning-tags.d.ts +6 -0
- package/dist/plugin-sdk/shared/text-chunking.d.ts +1 -0
- package/dist/plugin-sdk/signal/accounts.d.ts +17 -0
- package/dist/plugin-sdk/signal/client.d.ts +32 -0
- package/dist/plugin-sdk/signal/daemon.d.ts +26 -0
- package/dist/plugin-sdk/signal/format.d.ts +17 -0
- package/dist/plugin-sdk/signal/identity.d.ts +24 -0
- package/dist/plugin-sdk/signal/index.d.ts +5 -0
- package/dist/plugin-sdk/signal/monitor/event-handler.d.ts +5 -0
- package/dist/plugin-sdk/signal/monitor/event-handler.types.d.ts +125 -0
- package/dist/plugin-sdk/signal/monitor/mentions.d.ts +2 -0
- package/dist/plugin-sdk/signal/monitor.d.ts +25 -0
- package/dist/plugin-sdk/signal/probe.d.ts +7 -0
- package/dist/plugin-sdk/signal/reaction-level.d.ts +17 -0
- package/dist/plugin-sdk/signal/rpc-context.d.ts +9 -0
- package/dist/plugin-sdk/signal/send-reactions.d.ts +32 -0
- package/dist/plugin-sdk/signal/send.d.ts +25 -0
- package/dist/plugin-sdk/signal/sse-reconnect.d.ts +13 -0
- package/dist/plugin-sdk/slack/accounts.d.ts +32 -0
- package/dist/plugin-sdk/slack/actions.d.ts +56 -0
- package/dist/plugin-sdk/slack/blocks-fallback.d.ts +2 -0
- package/dist/plugin-sdk/slack/blocks-input.d.ts +3 -0
- package/dist/plugin-sdk/slack/channel-migration.d.ts +20 -0
- package/dist/plugin-sdk/slack/client.d.ts +4 -0
- package/dist/plugin-sdk/slack/directory-live.d.ts +4 -0
- package/dist/plugin-sdk/slack/draft-stream.d.ts +25 -0
- package/dist/plugin-sdk/slack/format.d.ts +7 -0
- package/dist/plugin-sdk/slack/http/index.d.ts +1 -0
- package/dist/plugin-sdk/slack/http/registry.d.ts +12 -0
- package/dist/plugin-sdk/slack/index.d.ts +6 -0
- package/dist/plugin-sdk/slack/message-actions.d.ts +4 -0
- package/dist/plugin-sdk/slack/modal-metadata.d.ts +7 -0
- package/dist/plugin-sdk/slack/monitor/allow-list.d.ts +23 -0
- package/dist/plugin-sdk/slack/monitor/auth.d.ts +11 -0
- package/dist/plugin-sdk/slack/monitor/channel-config.d.ts +43 -0
- package/dist/plugin-sdk/slack/monitor/commands.d.ts +9 -0
- package/dist/plugin-sdk/slack/monitor/context.d.ts +104 -0
- package/dist/plugin-sdk/slack/monitor/events/channels.d.ts +4 -0
- package/dist/plugin-sdk/slack/monitor/events/interactions.d.ts +4 -0
- package/dist/plugin-sdk/slack/monitor/events/members.d.ts +4 -0
- package/dist/plugin-sdk/slack/monitor/events/messages.d.ts +6 -0
- package/dist/plugin-sdk/slack/monitor/events/pins.d.ts +4 -0
- package/dist/plugin-sdk/slack/monitor/events/reactions.d.ts +4 -0
- package/dist/plugin-sdk/slack/monitor/events.d.ts +8 -0
- package/dist/plugin-sdk/slack/monitor/external-arg-menu-store.d.ts +18 -0
- package/dist/plugin-sdk/slack/monitor/media.d.ts +66 -0
- package/dist/plugin-sdk/slack/monitor/message-handler/dispatch.d.ts +12 -0
- package/dist/plugin-sdk/slack/monitor/message-handler/prepare.d.ts +13 -0
- package/dist/plugin-sdk/slack/monitor/message-handler/types.d.ts +22 -0
- package/dist/plugin-sdk/slack/monitor/message-handler.d.ts +11 -0
- package/dist/plugin-sdk/slack/monitor/mrkdwn.d.ts +1 -0
- package/dist/plugin-sdk/slack/monitor/policy.d.ts +5 -0
- package/dist/plugin-sdk/slack/monitor/provider.d.ts +7 -0
- package/dist/plugin-sdk/slack/monitor/replies.d.ts +53 -0
- package/dist/plugin-sdk/slack/monitor/room-context.d.ts +14 -0
- package/dist/plugin-sdk/slack/monitor/slash.d.ts +6 -0
- package/dist/plugin-sdk/slack/monitor/thread-resolution.d.ts +12 -0
- package/dist/plugin-sdk/slack/monitor/types.d.ts +97 -0
- package/dist/plugin-sdk/slack/monitor.d.ts +5 -0
- package/dist/plugin-sdk/slack/probe.d.ts +14 -0
- package/dist/plugin-sdk/slack/resolve-channels.d.ts +19 -0
- package/dist/plugin-sdk/slack/resolve-users.d.ts +26 -0
- package/dist/plugin-sdk/slack/send.d.ts +22 -0
- package/dist/plugin-sdk/slack/stream-mode.d.ts +23 -0
- package/dist/plugin-sdk/slack/streaming.d.ts +72 -0
- package/dist/plugin-sdk/slack/targets.d.ts +7 -0
- package/dist/plugin-sdk/slack/threading-tool-context.d.ts +10 -0
- package/dist/plugin-sdk/slack/threading.d.ts +29 -0
- package/dist/plugin-sdk/slack/token.d.ts +3 -0
- package/dist/plugin-sdk/slack/types.d.ts +58 -0
- package/dist/plugin-sdk/telegram/accounts.d.ts +21 -0
- package/dist/plugin-sdk/telegram/allowed-updates.d.ts +4 -0
- package/dist/plugin-sdk/telegram/api-logging.d.ts +11 -0
- package/dist/plugin-sdk/telegram/audit.d.ts +29 -0
- package/dist/plugin-sdk/telegram/bot/delivery.d.ts +35 -0
- package/dist/plugin-sdk/telegram/bot/helpers.d.ts +128 -0
- package/dist/plugin-sdk/telegram/bot/types.d.ts +28 -0
- package/dist/plugin-sdk/telegram/bot-access.d.ts +26 -0
- package/dist/plugin-sdk/telegram/bot-handlers.d.ts +2 -0
- package/dist/plugin-sdk/telegram/bot-message-context.d.ts +145 -0
- package/dist/plugin-sdk/telegram/bot-message-dispatch.d.ts +19 -0
- package/dist/plugin-sdk/telegram/bot-message.d.ts +20 -0
- package/dist/plugin-sdk/telegram/bot-native-command-menu.d.ts +33 -0
- package/dist/plugin-sdk/telegram/bot-native-commands.d.ts +59 -0
- package/dist/plugin-sdk/telegram/bot-updates.d.ts +31 -0
- package/dist/plugin-sdk/telegram/bot.d.ts +62 -0
- package/dist/plugin-sdk/telegram/button-types.d.ts +7 -0
- package/dist/plugin-sdk/telegram/caption.d.ts +5 -0
- package/dist/plugin-sdk/telegram/dm-access.d.ts +18 -0
- package/dist/plugin-sdk/telegram/draft-stream.d.ts +37 -0
- package/dist/plugin-sdk/telegram/fetch.d.ts +5 -0
- package/dist/plugin-sdk/telegram/format.d.ts +18 -0
- package/dist/plugin-sdk/telegram/group-access.d.ts +54 -0
- package/dist/plugin-sdk/telegram/group-config-helpers.d.ts +8 -0
- package/dist/plugin-sdk/telegram/group-migration.d.ts +20 -0
- package/dist/plugin-sdk/telegram/inline-buttons.d.ts +11 -0
- package/dist/plugin-sdk/telegram/lane-delivery.d.ts +56 -0
- package/dist/plugin-sdk/telegram/monitor.d.ts +19 -0
- package/dist/plugin-sdk/telegram/network-config.d.ts +33 -0
- package/dist/plugin-sdk/telegram/network-errors.d.ts +5 -0
- package/dist/plugin-sdk/telegram/outbound-params.d.ts +2 -0
- package/dist/plugin-sdk/telegram/probe.d.ts +17 -0
- package/dist/plugin-sdk/telegram/proxy.d.ts +1 -0
- package/dist/plugin-sdk/telegram/reaction-level.d.ts +11 -0
- package/dist/plugin-sdk/telegram/reasoning-lane-coordinator.d.ts +18 -0
- package/dist/plugin-sdk/telegram/send.d.ts +153 -0
- package/dist/plugin-sdk/telegram/sent-message-cache.d.ts +16 -0
- package/dist/plugin-sdk/telegram/status-reaction-variants.d.ts +21 -0
- package/dist/plugin-sdk/telegram/sticker-cache.d.ts +47 -0
- package/dist/plugin-sdk/telegram/target-writeback.d.ts +7 -0
- package/dist/plugin-sdk/telegram/targets.d.ts +11 -0
- package/dist/plugin-sdk/telegram/token.d.ts +13 -0
- package/dist/plugin-sdk/telegram/update-offset-store.d.ts +15 -0
- package/dist/plugin-sdk/telegram/voice.d.ts +16 -0
- package/dist/plugin-sdk/telegram/webhook.d.ts +20 -0
- package/dist/plugin-sdk/terminal/ansi.d.ts +2 -0
- package/dist/plugin-sdk/terminal/health-style.d.ts +1 -0
- package/dist/plugin-sdk/terminal/links.d.ts +6 -0
- package/dist/plugin-sdk/terminal/palette.d.ts +10 -0
- package/dist/plugin-sdk/terminal/progress-line.d.ts +3 -0
- package/dist/plugin-sdk/terminal/prompt-style.d.ts +3 -0
- package/dist/plugin-sdk/terminal/restore.d.ts +17 -0
- package/dist/plugin-sdk/terminal/theme.d.ts +15 -0
- package/dist/plugin-sdk/tts/tts-core.d.ts +38 -0
- package/dist/plugin-sdk/tts/tts.d.ts +177 -0
- package/dist/plugin-sdk/types/agent-types.d.ts +1 -0
- package/dist/plugin-sdk/utils/account-id.d.ts +1 -0
- package/dist/plugin-sdk/utils/boolean.d.ts +5 -0
- package/dist/plugin-sdk/utils/chunk-items.d.ts +1 -0
- package/dist/plugin-sdk/utils/delivery-context.d.ts +29 -0
- package/dist/plugin-sdk/utils/directive-tags.d.ts +29 -0
- package/dist/plugin-sdk/utils/fetch-timeout.d.ts +13 -0
- package/dist/plugin-sdk/utils/mask-api-key.d.ts +1 -0
- package/dist/plugin-sdk/utils/message-channel.d.ts +27 -0
- package/dist/plugin-sdk/utils/normalize-secret-input.d.ts +11 -0
- package/dist/plugin-sdk/utils/provider-utils.d.ts +9 -0
- package/dist/plugin-sdk/utils/queue-helpers.d.ts +80 -0
- package/dist/plugin-sdk/utils/reaction-level.d.ts +15 -0
- package/dist/plugin-sdk/utils/run-with-concurrency.d.ts +11 -0
- package/dist/plugin-sdk/utils/transcript-tools.d.ts +8 -0
- package/dist/plugin-sdk/utils/usage-format.d.ts +26 -0
- package/dist/plugin-sdk/utils/with-timeout.d.ts +1 -0
- package/dist/plugin-sdk/utils.d.ts +63 -0
- package/dist/plugin-sdk/version.d.ts +8 -0
- package/dist/plugin-sdk/web/accounts.d.ts +39 -0
- package/dist/plugin-sdk/web/active-listener.d.ts +25 -0
- package/dist/plugin-sdk/web/auth-store.d.ts +26 -0
- package/dist/plugin-sdk/web/auto-reply/constants.d.ts +1 -0
- package/dist/plugin-sdk/web/auto-reply/deliver-reply.d.ts +19 -0
- package/dist/plugin-sdk/web/auto-reply/heartbeat-runner.d.ts +20 -0
- package/dist/plugin-sdk/web/auto-reply/loggers.d.ts +4 -0
- package/dist/plugin-sdk/web/auto-reply/mentions.d.ts +19 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/ack-reaction.d.ts +13 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/broadcast.d.ts +16 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/commands.d.ts +2 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/echo.d.ts +17 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/group-activation.d.ts +9 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/group-gating.d.ts +33 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/group-members.d.ts +6 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/last-route.d.ts +15 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/message-line.d.ts +11 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/on-message.d.ts +24 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/peer.d.ts +2 -0
- package/dist/plugin-sdk/web/auto-reply/monitor/process-message.d.ts +40 -0
- package/dist/plugin-sdk/web/auto-reply/monitor.d.ts +5 -0
- package/dist/plugin-sdk/web/auto-reply/session-snapshot.d.ts +17 -0
- package/dist/plugin-sdk/web/auto-reply/types.d.ts +30 -0
- package/dist/plugin-sdk/web/auto-reply/util.d.ts +2 -0
- package/dist/plugin-sdk/web/auto-reply.d.ts +1 -0
- package/dist/plugin-sdk/web/auto-reply.impl.d.ts +5 -0
- package/dist/plugin-sdk/web/inbound/access-control.d.ts +36 -0
- package/dist/plugin-sdk/web/inbound/dedupe.d.ts +2 -0
- package/dist/plugin-sdk/web/inbound/extract.d.ts +13 -0
- package/dist/plugin-sdk/web/inbound/media.d.ts +7 -0
- package/dist/plugin-sdk/web/inbound/monitor.d.ts +30 -0
- package/dist/plugin-sdk/web/inbound/send-api.d.ts +22 -0
- package/dist/plugin-sdk/web/inbound/types.d.ts +41 -0
- package/dist/plugin-sdk/web/inbound.d.ts +4 -0
- package/dist/plugin-sdk/web/login-qr.d.ts +19 -0
- package/dist/plugin-sdk/web/login.d.ts +3 -0
- package/dist/plugin-sdk/web/media.d.ts +43 -0
- package/dist/plugin-sdk/web/outbound.d.ts +24 -0
- package/dist/plugin-sdk/web/qr-image.d.ts +4 -0
- package/dist/plugin-sdk/web/reconnect.d.ts +12 -0
- package/dist/plugin-sdk/web/session.d.ts +14 -0
- package/dist/plugin-sdk/web/vcard.d.ts +6 -0
- package/dist/plugin-sdk/whatsapp/normalize.d.ts +6 -0
- package/dist/plugin-sdk/whatsapp/resolve-outbound-target.d.ts +12 -0
- package/dist/plugin-sdk/wizard/prompts.d.ts +43 -0
- package/dist/plugin-sdk/wizard/session.d.ts +42 -0
- package/dist/plugins-BflZz0sp.js +453 -0
- package/dist/plugins-allowlist-BbTQ5Z2k.js +15 -0
- package/dist/plugins-allowlist-C20oaESO.js +15 -0
- package/dist/plugins-cli-DV82scUw.js +798 -0
- package/dist/plugins-cli-Qj1UyIZO.js +793 -0
- package/dist/plugins-woGRXMzU.js +455 -0
- package/dist/polls-B0CCBDeR.js +33 -0
- package/dist/polls-CwwHzYBM.js +33 -0
- package/dist/ports-DrruB2fK.js +370 -0
- package/dist/ports-GT1yV-Tg.js +96 -0
- package/dist/ports-NPqtlfp0.js +316 -0
- package/dist/ports-QMI4-F9m.js +96 -0
- package/dist/ports-lsof-Wteul3ju.js +27 -0
- package/dist/process-scoped-map-CV9kDvfG.js +39 -0
- package/dist/process-scoped-map-PEvnG75N.js +39 -0
- package/dist/program-CQmIaRUI.js +244 -0
- package/dist/program-context-DEU6ACnL.js +474 -0
- package/dist/program-context-jqeI5alP.js +17 -0
- package/dist/progress-C1kUfYL-.js +123 -0
- package/dist/progress-CBkSaM6z.js +124 -0
- package/dist/prompt-Bllj1dhc.js +21 -0
- package/dist/prompt-Yn2yClg1.js +21 -0
- package/dist/prompt-select-styled-BhTN6zE2.js +1650 -0
- package/dist/prompt-select-styled-WopXnjIy.js +1647 -0
- package/dist/prompt-style-DVEm3BZW.js +9 -0
- package/dist/prompt-style-DjEYC_s-.js +9 -0
- package/dist/provider-dispatcher-B4QMe-I6.js +659 -0
- package/dist/provider-dispatcher-Bfauw6zz.js +660 -0
- package/dist/provider-utils-3JTMJroG.js +79 -0
- package/dist/provider-utils-FaBmofiq.js +79 -0
- package/dist/proxy-DL3MD6-P.js +16 -0
- package/dist/proxy-DpNv2cSV.js +16 -0
- package/dist/push-apns-C0LyG-WB.js +713 -0
- package/dist/push-apns-DuG95AKC.js +711 -0
- package/dist/pw-ai-D9n6-Wa6.js +1906 -0
- package/dist/pw-ai-T280E6Mn.js +1910 -0
- package/dist/pw-ai-state-CGfLv6nV.js +11 -0
- package/dist/pw-ai-state-Dynx20hr.js +11 -0
- package/dist/qr-cli-DVECWTHN.js +352 -0
- package/dist/qr-cli-hSLixZCe.js +347 -0
- package/dist/redact-Dx1Fue21.js +191 -0
- package/dist/redact-eZq1uwNK.js +191 -0
- package/dist/redact-identifier-BTIWtaa-.js +15 -0
- package/dist/redact-identifier-CAagcfWA.js +15 -0
- package/dist/redact-snapshot-BZYLIqe-.js +2028 -0
- package/dist/redact-snapshot-C6hVx_9I.js +2028 -0
- package/dist/register.agent-Dmj-sgEl.js +1043 -0
- package/dist/register.agent-IspcBFeD.js +286 -0
- package/dist/register.configure-BqJEqyGL.js +130 -0
- package/dist/register.configure-PPkU_4Ea.js +124 -0
- package/dist/register.import-Bs-UkOs-.js +27 -0
- package/dist/register.import-DLng8g-e.js +30 -0
- package/dist/register.maintenance-BbpkJil3.js +497 -0
- package/dist/register.maintenance-C5nkOQxa.js +494 -0
- package/dist/register.message-C83Hi1b3.js +681 -0
- package/dist/register.message-D16isu4u.js +686 -0
- package/dist/register.onboard-B8EzX3wY.js +257 -0
- package/dist/register.onboard-CyRbr_0V.js +262 -0
- package/dist/register.setup-DWyoowAz.js +109 -0
- package/dist/register.setup-Dz6GwMnu.js +114 -0
- package/dist/register.status-health-sessions-CbQOfycz.js +423 -0
- package/dist/register.status-health-sessions-DXIWG47y.js +669 -0
- package/dist/register.subclis-DeGP5UPU.js +267 -0
- package/dist/remoteclaw-root-C2HV2VeC.js +88 -0
- package/dist/remoteclaw-root-DybYl8PL.js +88 -0
- package/dist/render-6ahYfPwj.js +104 -0
- package/dist/render-CCLsW6Lz.js +104 -0
- package/dist/render-uf6PvGMV.js +104 -0
- package/dist/replies-BKrzM0QI.js +136 -0
- package/dist/replies-Cl2gYBVt.js +136 -0
- package/dist/reply-CCu_DY64.js +13900 -0
- package/dist/reply-DSKC8kyS.js +13897 -0
- package/dist/reply-directives-BHJKp1Du.js +182 -0
- package/dist/reply-directives-CD2WycBM.js +182 -0
- package/dist/reply-payloads-D_BM1Anb.js +527 -0
- package/dist/reply-prefix-DBLCYiup.js +38 -0
- package/dist/reply-prefix-Q4DOJSn_.js +38 -0
- package/dist/resolve-route-CBVbY0xS.js +249 -0
- package/dist/resolve-route-DGEgTEif.js +249 -0
- package/dist/response-prefix-template-rVZQOViK.js +136 -0
- package/dist/response-prefix-template-up4REfuR.js +136 -0
- package/dist/retry-BhuXOEVR.js +77 -0
- package/dist/retry-DUjAzOBy.js +77 -0
- package/dist/retry-DnqPAqWp.js +77 -0
- package/dist/rolldown-runtime-Cbj13DAv.js +20 -0
- package/dist/run-main-Um5xhxla.js +320 -0
- package/dist/runner-yVJ4HB2K.js +2294 -0
- package/dist/runner-z92MWZ3m.js +2294 -0
- package/dist/runtime-DJNp29jv.js +94 -0
- package/dist/runtime-guard-DZ_xuCc4.js +60 -0
- package/dist/runtime-guard-U-ewY_QH.js +60 -0
- package/dist/secret-equal-BbHdTtqY.js +11 -0
- package/dist/secret-equal-CXJEZiWb.js +11 -0
- package/dist/secure-random-CS2mSdTn.js +12 -0
- package/dist/secure-random-Pl9rPl0l.js +44 -0
- package/dist/secure-random-_dzDDlFo.js +12 -0
- package/dist/security-cli-CdwbWZUj.js +484 -0
- package/dist/security-cli-DP5QJpa5.js +478 -0
- package/dist/send-B1_Ymjb9.js +1778 -0
- package/dist/send-B84axiIa.js +29 -0
- package/dist/send-BN_zYVlx.js +547 -0
- package/dist/send-BqVOxAmK.js +1174 -0
- package/dist/send-Bx9bUGav.js +492 -0
- package/dist/send-C3pdJ6p-.js +2245 -0
- package/dist/send-CBGSXjfD.js +2245 -0
- package/dist/send-CGXyTF22.js +426 -0
- package/dist/send-CKavrhXj.js +11 -0
- package/dist/send-D08Je6DL.js +374 -0
- package/dist/send-D1aYEG-k.js +332 -0
- package/dist/send-DHldI3gf.js +492 -0
- package/dist/send-D_DUQJ6H.js +349 -0
- package/dist/send-Ds63eF4a.js +349 -0
- package/dist/send-YRVDWfSs.js +547 -0
- package/dist/send-xnwty9cY.js +1775 -0
- package/dist/server-BQFoyCRR.js +200 -0
- package/dist/server-DhXw25Jq.js +205 -0
- package/dist/server-lifecycle-BjCCyD3w.js +2437 -0
- package/dist/server-lifecycle-Coyr6Lda.js +2437 -0
- package/dist/server-node-events-De4WZQQD.js +393 -0
- package/dist/server-node-events-dXXayuqY.js +398 -0
- package/dist/service-Bjqii5nW.js +670 -0
- package/dist/service-fp29z5Ww.js +670 -0
- package/dist/session-DBL5nHDy.js +170 -0
- package/dist/session-cost-usage-DX09eTPU.js +627 -0
- package/dist/session-cost-usage-yYi525j3.js +627 -0
- package/dist/session-dirs-Cj5xi7zX.js +947 -0
- package/dist/session-dirs-DdF6TDsE.js +947 -0
- package/dist/session-key-5YLnn_qf.js +235 -0
- package/dist/session-key-C2n-VILA.js +235 -0
- package/dist/session-utils-CEtEq6bi.js +625 -0
- package/dist/session-utils-WmlWAs1r.js +625 -0
- package/dist/session-xKIW6gL2.js +170 -0
- package/dist/sessions--PykPynp.js +2593 -0
- package/dist/sessions-Bw4LRnSr.js +252 -0
- package/dist/ssrf-Ck9HDZpv.js +183 -0
- package/dist/ssrf-m7kFIobZ.js +183 -0
- package/dist/stagger-BXv_apuy.js +56 -0
- package/dist/stagger-MI9gd2rQ.js +56 -0
- package/dist/status-BmtCS3T1.js +21 -0
- package/dist/status-BrwHRn2B.js +21 -0
- package/dist/status-CtzYFLLF.js +2072 -0
- package/dist/status-DiN1cq2p.js +2068 -0
- package/dist/status.update-C55QM2xs.js +79 -0
- package/dist/status.update-CBmPXwYN.js +79 -0
- package/dist/store-C3tOpizT.js +64 -0
- package/dist/store-CPJXuhvQ.js +53 -0
- package/dist/store-SusmIfz7.js +2595 -0
- package/dist/store-v3P-OWhi.js +64 -0
- package/dist/strip-inbound-meta-DjKcSFaW.js +110 -0
- package/dist/strip-inbound-meta-jy3bkUab.js +110 -0
- package/dist/subagent-registry-Db4Ho_2Y.js +4858 -0
- package/dist/subagent-registry-Du_j0Fnt.js +4860 -0
- package/dist/subsystem-BUXAJwPD.js +1079 -0
- package/dist/subsystem-COd61u0P.js +1139 -0
- package/dist/system-cli-DYCpLO3T.js +75 -0
- package/dist/system-cli-eAk5wVbP.js +70 -0
- package/dist/systemd-DSnlM3jX.js +547 -0
- package/dist/systemd-TfK8GuTx.js +547 -0
- package/dist/systemd-linger-Axnc1xCb.js +75 -0
- package/dist/systemd-linger-_0_-RY4v.js +75 -0
- package/dist/table-C1rdyYl9.js +278 -0
- package/dist/table-DPTzZyhu.js +279 -0
- package/dist/tables-DI5LGEr1.js +55 -0
- package/dist/tables-PxcSPSO0.js +55 -0
- package/dist/tables-TWiml6b1.js +55 -0
- package/dist/tailnet-CEudzG0i.js +40 -0
- package/dist/tailnet-PnMrjwGT.js +40 -0
- package/dist/tailscale-DTATQxAG.js +230 -0
- package/dist/tailscale-Dbyahx0J.js +230 -0
- package/dist/target-errors-BDpPcwh5.js +26 -0
- package/dist/target-errors-DdIAPcMM.js +26 -0
- package/dist/targets-BMenhVHg.js +39 -0
- package/dist/targets-C-2xwh9f.js +45 -0
- package/dist/targets-C1NeMn2J.js +220 -0
- package/dist/targets-CcTME3bp.js +46 -0
- package/dist/targets-CmC5m7Ey.js +53 -0
- package/dist/targets-D-qLBpTA.js +79 -0
- package/dist/targets-D-u6Kyio.js +650 -0
- package/dist/targets-D7OKVXMI.js +650 -0
- package/dist/targets-D7PT_rdO.js +45 -0
- package/dist/targets-DB4vBpIQ.js +2172 -0
- package/dist/targets-DfqPGOmM.js +2173 -0
- package/dist/targets-DyybKefq.js +53 -0
- package/dist/targets-JCISV-hS.js +120 -0
- package/dist/targets-UncQvCVs.js +79 -0
- package/dist/text-format-BQ3z_OXA.js +9 -0
- package/dist/text-format-oWqzVmah.js +9 -0
- package/dist/tokens-B-jmvNR9.js +21 -0
- package/dist/tokens-DzFOtLlW.js +21 -0
- package/dist/tool-display-Br6mwaJc.js +785 -0
- package/dist/tool-display-sgNwLOBj.js +785 -0
- package/dist/tool-images-BNfIJ_Kj.js +263 -0
- package/dist/tool-images-kloBqxqK.js +263 -0
- package/dist/trash-DPi0aCCQ.js +125 -0
- package/dist/trash-D_Jd_yQZ.js +125 -0
- package/dist/tui-CHc0EfJO.js +3392 -0
- package/dist/tui-CyHwc2uX.js +3392 -0
- package/dist/tui-cli-BvwbrIYO.js +63 -0
- package/dist/tui-cli-C9I18SfW.js +58 -0
- package/dist/update-DxyjwCL2.js +349 -0
- package/dist/update-IX7vdqA8.js +349 -0
- package/dist/update-cli-CBeXUSzq.js +1373 -0
- package/dist/update-cli-DkAWmUrp.js +1370 -0
- package/dist/usage-BdhBT0Vz.js +57 -0
- package/dist/usage-BtQcAnf6.js +57 -0
- package/dist/usage-CYlQW4M2.js +5279 -0
- package/dist/usage-format-C3mNLfhI.js +31 -0
- package/dist/usage-format-DAaPzr_z.js +31 -0
- package/dist/utils-LBKvDoPx.js +631 -0
- package/dist/warning-filter.js +48 -0
- package/dist/web-BUYUdnRH.js +3065 -0
- package/dist/web-Dquzwqf4.js +70 -0
- package/dist/web-tS8diboh.js +76 -0
- package/dist/webhooks-cli-B7Vw3CMz.js +333 -0
- package/dist/webhooks-cli-BpZHQlVd.js +328 -0
- package/dist/whatsapp-actions-D5HXezjp.js +128 -0
- package/dist/whatsapp-actions-DaA291Ya.js +122 -0
- package/dist/widearea-dns-CsmBVbez.js +127 -0
- package/dist/widearea-dns-DSoaA-eH.js +127 -0
- package/dist/workspace-B4ZvVYT9.js +447 -0
- package/dist/workspace-B8PA8oxJ.js +449 -0
- package/dist/workspace-BzPeZDew.js +10 -0
- package/dist/workspace-DkGLVfOl.js +10 -0
- package/dist/wsl-BCnYV9O0.js +52 -0
- package/dist/wsl-B_sPlzWw.js +52 -0
- package/extensions/bluebubbles/README.md +45 -0
- package/extensions/bluebubbles/index.ts +19 -0
- package/extensions/bluebubbles/package.json +33 -0
- package/extensions/bluebubbles/remoteclaw.plugin.json +9 -0
- package/extensions/bluebubbles/src/account-resolve.ts +35 -0
- package/extensions/bluebubbles/src/accounts.ts +90 -0
- package/extensions/bluebubbles/src/actions.ts +460 -0
- package/extensions/bluebubbles/src/attachments.ts +268 -0
- package/extensions/bluebubbles/src/channel.ts +418 -0
- package/extensions/bluebubbles/src/chat.ts +329 -0
- package/extensions/bluebubbles/src/config-schema.ts +65 -0
- package/extensions/bluebubbles/src/history.ts +177 -0
- package/extensions/bluebubbles/src/media-send.ts +317 -0
- package/extensions/bluebubbles/src/monitor-normalize.ts +825 -0
- package/extensions/bluebubbles/src/monitor-processing.ts +1448 -0
- package/extensions/bluebubbles/src/monitor-reply-cache.ts +185 -0
- package/extensions/bluebubbles/src/monitor-shared.ts +41 -0
- package/extensions/bluebubbles/src/monitor.ts +534 -0
- package/extensions/bluebubbles/src/multipart.ts +32 -0
- package/extensions/bluebubbles/src/onboarding.ts +340 -0
- package/extensions/bluebubbles/src/probe.ts +163 -0
- package/extensions/bluebubbles/src/reactions.ts +182 -0
- package/extensions/bluebubbles/src/request-url.ts +12 -0
- package/extensions/bluebubbles/src/runtime.ts +34 -0
- package/extensions/bluebubbles/src/send-helpers.ts +53 -0
- package/extensions/bluebubbles/src/send.ts +472 -0
- package/extensions/bluebubbles/src/targets.ts +370 -0
- package/extensions/bluebubbles/src/test-harness.ts +79 -0
- package/extensions/bluebubbles/src/test-mocks.ts +11 -0
- package/extensions/bluebubbles/src/types.ts +135 -0
- package/extensions/device-pair/index.ts +529 -0
- package/extensions/device-pair/remoteclaw.plugin.json +20 -0
- package/extensions/diagnostics-otel/index.ts +15 -0
- package/extensions/diagnostics-otel/package.json +24 -0
- package/extensions/diagnostics-otel/remoteclaw.plugin.json +8 -0
- package/extensions/diagnostics-otel/src/service.ts +682 -0
- package/extensions/discord/index.ts +19 -0
- package/extensions/discord/package.json +11 -0
- package/extensions/discord/remoteclaw.plugin.json +9 -0
- package/extensions/discord/src/channel.ts +451 -0
- package/extensions/discord/src/runtime.ts +14 -0
- package/extensions/discord/src/subagent-hooks.ts +152 -0
- package/extensions/feishu/index.ts +63 -0
- package/extensions/feishu/package.json +34 -0
- package/extensions/feishu/remoteclaw.plugin.json +10 -0
- package/extensions/feishu/skills/feishu-doc/SKILL.md +105 -0
- package/extensions/feishu/skills/feishu-doc/references/block-types.md +103 -0
- package/extensions/feishu/skills/feishu-drive/SKILL.md +97 -0
- package/extensions/feishu/skills/feishu-perm/SKILL.md +119 -0
- package/extensions/feishu/skills/feishu-wiki/SKILL.md +111 -0
- package/extensions/feishu/src/accounts.ts +144 -0
- package/extensions/feishu/src/bitable.ts +739 -0
- package/extensions/feishu/src/bot.ts +1006 -0
- package/extensions/feishu/src/channel.ts +359 -0
- package/extensions/feishu/src/client.ts +118 -0
- package/extensions/feishu/src/config-schema.ts +226 -0
- package/extensions/feishu/src/dedup.ts +54 -0
- package/extensions/feishu/src/directory.ts +177 -0
- package/extensions/feishu/src/doc-schema.ts +47 -0
- package/extensions/feishu/src/docx.ts +536 -0
- package/extensions/feishu/src/drive-schema.ts +46 -0
- package/extensions/feishu/src/drive.ts +227 -0
- package/extensions/feishu/src/dynamic-agent.ts +131 -0
- package/extensions/feishu/src/external-keys.ts +19 -0
- package/extensions/feishu/src/media.ts +441 -0
- package/extensions/feishu/src/mention.ts +133 -0
- package/extensions/feishu/src/monitor.ts +397 -0
- package/extensions/feishu/src/onboarding.ts +351 -0
- package/extensions/feishu/src/outbound.ts +55 -0
- package/extensions/feishu/src/perm-schema.ts +52 -0
- package/extensions/feishu/src/perm.ts +173 -0
- package/extensions/feishu/src/policy.ts +120 -0
- package/extensions/feishu/src/probe.ts +44 -0
- package/extensions/feishu/src/reactions.ts +160 -0
- package/extensions/feishu/src/reply-dispatcher.ts +239 -0
- package/extensions/feishu/src/runtime.ts +14 -0
- package/extensions/feishu/src/send-result.ts +29 -0
- package/extensions/feishu/src/send-target.ts +25 -0
- package/extensions/feishu/src/send.ts +313 -0
- package/extensions/feishu/src/streaming-card.ts +218 -0
- package/extensions/feishu/src/targets.ts +78 -0
- package/extensions/feishu/src/tools-config.ts +21 -0
- package/extensions/feishu/src/types.ts +81 -0
- package/extensions/feishu/src/typing.ts +80 -0
- package/extensions/feishu/src/wiki-schema.ts +55 -0
- package/extensions/feishu/src/wiki.ts +232 -0
- package/extensions/googlechat/index.ts +19 -0
- package/extensions/googlechat/node_modules/.bin/remoteclaw +21 -0
- package/extensions/googlechat/package.json +37 -0
- package/extensions/googlechat/remoteclaw.plugin.json +9 -0
- package/extensions/googlechat/src/accounts.ts +147 -0
- package/extensions/googlechat/src/actions.ts +176 -0
- package/extensions/googlechat/src/api.ts +282 -0
- package/extensions/googlechat/src/auth.ts +137 -0
- package/extensions/googlechat/src/channel.ts +576 -0
- package/extensions/googlechat/src/monitor.ts +965 -0
- package/extensions/googlechat/src/onboarding.ts +270 -0
- package/extensions/googlechat/src/runtime.ts +14 -0
- package/extensions/googlechat/src/targets.ts +65 -0
- package/extensions/googlechat/src/types.config.ts +3 -0
- package/extensions/googlechat/src/types.ts +73 -0
- package/extensions/imessage/index.ts +17 -0
- package/extensions/imessage/package.json +12 -0
- package/extensions/imessage/remoteclaw.plugin.json +9 -0
- package/extensions/imessage/src/channel.ts +304 -0
- package/extensions/imessage/src/runtime.ts +14 -0
- package/extensions/irc/index.ts +17 -0
- package/extensions/irc/package.json +11 -0
- package/extensions/irc/remoteclaw.plugin.json +9 -0
- package/extensions/irc/src/accounts.ts +268 -0
- package/extensions/irc/src/channel.ts +364 -0
- package/extensions/irc/src/client.ts +439 -0
- package/extensions/irc/src/config-schema.ts +91 -0
- package/extensions/irc/src/connect-options.ts +30 -0
- package/extensions/irc/src/control-chars.ts +22 -0
- package/extensions/irc/src/inbound.ts +372 -0
- package/extensions/irc/src/monitor.ts +146 -0
- package/extensions/irc/src/normalize.ts +123 -0
- package/extensions/irc/src/onboarding.ts +479 -0
- package/extensions/irc/src/policy.ts +166 -0
- package/extensions/irc/src/probe.ts +53 -0
- package/extensions/irc/src/protocol.ts +169 -0
- package/extensions/irc/src/runtime.ts +14 -0
- package/extensions/irc/src/send.ts +88 -0
- package/extensions/irc/src/types.ts +99 -0
- package/extensions/line/index.ts +19 -0
- package/extensions/line/package.json +27 -0
- package/extensions/line/remoteclaw.plugin.json +9 -0
- package/extensions/line/src/card-command.ts +344 -0
- package/extensions/line/src/channel.ts +797 -0
- package/extensions/line/src/runtime.ts +14 -0
- package/extensions/matrix/CHANGELOG.md +32 -0
- package/extensions/matrix/index.ts +17 -0
- package/extensions/matrix/node_modules/.bin/markdown-it +21 -0
- package/extensions/matrix/package.json +33 -0
- package/extensions/matrix/remoteclaw.plugin.json +9 -0
- package/extensions/matrix/src/actions.ts +195 -0
- package/extensions/matrix/src/channel.ts +486 -0
- package/extensions/matrix/src/config-schema.ts +63 -0
- package/extensions/matrix/src/directory-live.ts +208 -0
- package/extensions/matrix/src/group-mentions.ts +52 -0
- package/extensions/matrix/src/matrix/accounts.ts +137 -0
- package/extensions/matrix/src/matrix/actions/client.ts +47 -0
- package/extensions/matrix/src/matrix/actions/limits.ts +6 -0
- package/extensions/matrix/src/matrix/actions/messages.ts +126 -0
- package/extensions/matrix/src/matrix/actions/pins.ts +84 -0
- package/extensions/matrix/src/matrix/actions/reactions.ts +102 -0
- package/extensions/matrix/src/matrix/actions/room.ts +85 -0
- package/extensions/matrix/src/matrix/actions/summary.ts +75 -0
- package/extensions/matrix/src/matrix/actions/types.ts +85 -0
- package/extensions/matrix/src/matrix/actions.ts +15 -0
- package/extensions/matrix/src/matrix/active-client.ts +32 -0
- package/extensions/matrix/src/matrix/client/config.ts +219 -0
- package/extensions/matrix/src/matrix/client/create-client.ts +123 -0
- package/extensions/matrix/src/matrix/client/logging.ts +36 -0
- package/extensions/matrix/src/matrix/client/runtime.ts +4 -0
- package/extensions/matrix/src/matrix/client/shared.ts +201 -0
- package/extensions/matrix/src/matrix/client/storage.ts +131 -0
- package/extensions/matrix/src/matrix/client/types.ts +34 -0
- package/extensions/matrix/src/matrix/client-bootstrap.ts +39 -0
- package/extensions/matrix/src/matrix/client.ts +14 -0
- package/extensions/matrix/src/matrix/credentials.ts +125 -0
- package/extensions/matrix/src/matrix/deps.ts +60 -0
- package/extensions/matrix/src/matrix/format.ts +22 -0
- package/extensions/matrix/src/matrix/index.ts +11 -0
- package/extensions/matrix/src/matrix/monitor/allowlist.ts +103 -0
- package/extensions/matrix/src/matrix/monitor/auto-join.ts +71 -0
- package/extensions/matrix/src/matrix/monitor/direct.ts +104 -0
- package/extensions/matrix/src/matrix/monitor/events.ts +148 -0
- package/extensions/matrix/src/matrix/monitor/handler.ts +688 -0
- package/extensions/matrix/src/matrix/monitor/index.ts +358 -0
- package/extensions/matrix/src/matrix/monitor/location.ts +100 -0
- package/extensions/matrix/src/matrix/monitor/media.ts +118 -0
- package/extensions/matrix/src/matrix/monitor/mentions.ts +62 -0
- package/extensions/matrix/src/matrix/monitor/replies.ts +124 -0
- package/extensions/matrix/src/matrix/monitor/room-info.ts +55 -0
- package/extensions/matrix/src/matrix/monitor/rooms.ts +47 -0
- package/extensions/matrix/src/matrix/monitor/threads.ts +68 -0
- package/extensions/matrix/src/matrix/monitor/types.ts +39 -0
- package/extensions/matrix/src/matrix/poll-types.ts +167 -0
- package/extensions/matrix/src/matrix/probe.ts +69 -0
- package/extensions/matrix/src/matrix/send/client.ts +97 -0
- package/extensions/matrix/src/matrix/send/formatting.ts +93 -0
- package/extensions/matrix/src/matrix/send/media.ts +230 -0
- package/extensions/matrix/src/matrix/send/targets.ts +150 -0
- package/extensions/matrix/src/matrix/send/types.ts +109 -0
- package/extensions/matrix/src/matrix/send-queue.ts +44 -0
- package/extensions/matrix/src/matrix/send.ts +265 -0
- package/extensions/matrix/src/onboarding.ts +446 -0
- package/extensions/matrix/src/outbound.ts +55 -0
- package/extensions/matrix/src/resolve-targets.ts +126 -0
- package/extensions/matrix/src/runtime.ts +14 -0
- package/extensions/matrix/src/tool-actions.ts +164 -0
- package/extensions/matrix/src/types.ts +116 -0
- package/extensions/mattermost/index.ts +17 -0
- package/extensions/mattermost/package.json +25 -0
- package/extensions/mattermost/remoteclaw.plugin.json +9 -0
- package/extensions/mattermost/src/channel.ts +439 -0
- package/extensions/mattermost/src/config-schema.ts +62 -0
- package/extensions/mattermost/src/group-mentions.ts +15 -0
- package/extensions/mattermost/src/mattermost/accounts.ts +128 -0
- package/extensions/mattermost/src/mattermost/client.ts +230 -0
- package/extensions/mattermost/src/mattermost/index.ts +9 -0
- package/extensions/mattermost/src/mattermost/monitor-helpers.ts +72 -0
- package/extensions/mattermost/src/mattermost/monitor-onchar.ts +25 -0
- package/extensions/mattermost/src/mattermost/monitor-websocket.ts +221 -0
- package/extensions/mattermost/src/mattermost/monitor.ts +1061 -0
- package/extensions/mattermost/src/mattermost/probe.ts +61 -0
- package/extensions/mattermost/src/mattermost/reactions.test-helpers.ts +83 -0
- package/extensions/mattermost/src/mattermost/reactions.ts +124 -0
- package/extensions/mattermost/src/mattermost/reconnect.ts +103 -0
- package/extensions/mattermost/src/mattermost/send.ts +231 -0
- package/extensions/mattermost/src/normalize.ts +46 -0
- package/extensions/mattermost/src/onboarding-helpers.ts +1 -0
- package/extensions/mattermost/src/onboarding.ts +182 -0
- package/extensions/mattermost/src/runtime.ts +14 -0
- package/extensions/mattermost/src/types.ts +62 -0
- package/extensions/msteams/CHANGELOG.md +35 -0
- package/extensions/msteams/index.ts +17 -0
- package/extensions/msteams/package.json +32 -0
- package/extensions/msteams/remoteclaw.plugin.json +9 -0
- package/extensions/msteams/src/attachments/download.ts +282 -0
- package/extensions/msteams/src/attachments/graph.ts +354 -0
- package/extensions/msteams/src/attachments/html.ts +90 -0
- package/extensions/msteams/src/attachments/payload.ts +14 -0
- package/extensions/msteams/src/attachments/remote-media.ts +42 -0
- package/extensions/msteams/src/attachments/shared.ts +404 -0
- package/extensions/msteams/src/attachments/types.ts +37 -0
- package/extensions/msteams/src/attachments.ts +18 -0
- package/extensions/msteams/src/channel.ts +464 -0
- package/extensions/msteams/src/conversation-store-fs.ts +165 -0
- package/extensions/msteams/src/conversation-store-memory.ts +47 -0
- package/extensions/msteams/src/conversation-store.ts +41 -0
- package/extensions/msteams/src/directory-live.ts +108 -0
- package/extensions/msteams/src/errors.ts +190 -0
- package/extensions/msteams/src/file-consent-helpers.ts +73 -0
- package/extensions/msteams/src/file-consent.ts +126 -0
- package/extensions/msteams/src/file-lock.ts +1 -0
- package/extensions/msteams/src/graph-chat.ts +53 -0
- package/extensions/msteams/src/graph-upload.ts +452 -0
- package/extensions/msteams/src/graph-users.ts +29 -0
- package/extensions/msteams/src/graph.ts +81 -0
- package/extensions/msteams/src/inbound.ts +48 -0
- package/extensions/msteams/src/index.ts +4 -0
- package/extensions/msteams/src/media-helpers.ts +105 -0
- package/extensions/msteams/src/mentions.ts +114 -0
- package/extensions/msteams/src/messenger.ts +484 -0
- package/extensions/msteams/src/monitor-handler/inbound-media.ts +128 -0
- package/extensions/msteams/src/monitor-handler/message-handler.ts +661 -0
- package/extensions/msteams/src/monitor-handler.ts +162 -0
- package/extensions/msteams/src/monitor-types.ts +5 -0
- package/extensions/msteams/src/monitor.ts +305 -0
- package/extensions/msteams/src/onboarding.ts +406 -0
- package/extensions/msteams/src/outbound.ts +46 -0
- package/extensions/msteams/src/pending-uploads.ts +89 -0
- package/extensions/msteams/src/policy.ts +259 -0
- package/extensions/msteams/src/polls-store-memory.ts +32 -0
- package/extensions/msteams/src/polls.ts +315 -0
- package/extensions/msteams/src/probe.ts +94 -0
- package/extensions/msteams/src/reply-dispatcher.ts +132 -0
- package/extensions/msteams/src/resolve-allowlist.ts +198 -0
- package/extensions/msteams/src/runtime.ts +14 -0
- package/extensions/msteams/src/sdk-types.ts +19 -0
- package/extensions/msteams/src/sdk.ts +33 -0
- package/extensions/msteams/src/send-context.ts +164 -0
- package/extensions/msteams/src/send.ts +530 -0
- package/extensions/msteams/src/sent-message-cache.ts +44 -0
- package/extensions/msteams/src/storage.ts +25 -0
- package/extensions/msteams/src/store-fs.ts +44 -0
- package/extensions/msteams/src/test-runtime.ts +16 -0
- package/extensions/msteams/src/token-response.ts +11 -0
- package/extensions/msteams/src/token.ts +19 -0
- package/extensions/nextcloud-talk/index.ts +17 -0
- package/extensions/nextcloud-talk/package.json +30 -0
- package/extensions/nextcloud-talk/remoteclaw.plugin.json +9 -0
- package/extensions/nextcloud-talk/src/accounts.ts +170 -0
- package/extensions/nextcloud-talk/src/channel.ts +416 -0
- package/extensions/nextcloud-talk/src/config-schema.ts +72 -0
- package/extensions/nextcloud-talk/src/format.ts +79 -0
- package/extensions/nextcloud-talk/src/inbound.ts +343 -0
- package/extensions/nextcloud-talk/src/monitor.ts +275 -0
- package/extensions/nextcloud-talk/src/normalize.ts +39 -0
- package/extensions/nextcloud-talk/src/onboarding.ts +349 -0
- package/extensions/nextcloud-talk/src/policy.ts +180 -0
- package/extensions/nextcloud-talk/src/room-info.ts +125 -0
- package/extensions/nextcloud-talk/src/runtime.ts +14 -0
- package/extensions/nextcloud-talk/src/send.ts +215 -0
- package/extensions/nextcloud-talk/src/signature.ts +72 -0
- package/extensions/nextcloud-talk/src/types.ts +185 -0
- package/extensions/nostr/CHANGELOG.md +44 -0
- package/extensions/nostr/README.md +136 -0
- package/extensions/nostr/index.ts +68 -0
- package/extensions/nostr/package.json +30 -0
- package/extensions/nostr/remoteclaw.plugin.json +9 -0
- package/extensions/nostr/src/channel.ts +345 -0
- package/extensions/nostr/src/config-schema.ts +90 -0
- package/extensions/nostr/src/metrics.ts +458 -0
- package/extensions/nostr/src/nostr-bus.ts +719 -0
- package/extensions/nostr/src/nostr-profile-http.ts +519 -0
- package/extensions/nostr/src/nostr-profile-import.ts +262 -0
- package/extensions/nostr/src/nostr-profile.ts +277 -0
- package/extensions/nostr/src/nostr-state-store.ts +226 -0
- package/extensions/nostr/src/runtime.ts +14 -0
- package/extensions/nostr/src/seen-tracker.ts +289 -0
- package/extensions/nostr/src/types.ts +101 -0
- package/extensions/phone-control/index.ts +421 -0
- package/extensions/phone-control/remoteclaw.plugin.json +10 -0
- package/extensions/shared/resolve-target-test-helpers.ts +66 -0
- package/extensions/signal/index.ts +17 -0
- package/extensions/signal/package.json +12 -0
- package/extensions/signal/remoteclaw.plugin.json +9 -0
- package/extensions/signal/src/channel.ts +299 -0
- package/extensions/signal/src/runtime.ts +14 -0
- package/extensions/slack/index.ts +17 -0
- package/extensions/slack/package.json +12 -0
- package/extensions/slack/remoteclaw.plugin.json +9 -0
- package/extensions/slack/src/channel.ts +421 -0
- package/extensions/slack/src/runtime.ts +14 -0
- package/extensions/synology-chat/index.ts +17 -0
- package/extensions/synology-chat/package.json +28 -0
- package/extensions/synology-chat/remoteclaw.plugin.json +9 -0
- package/extensions/synology-chat/src/accounts.ts +87 -0
- package/extensions/synology-chat/src/channel.ts +347 -0
- package/extensions/synology-chat/src/client.ts +142 -0
- package/extensions/synology-chat/src/runtime.ts +20 -0
- package/extensions/synology-chat/src/security.ts +140 -0
- package/extensions/synology-chat/src/types.ts +60 -0
- package/extensions/synology-chat/src/webhook-handler.ts +221 -0
- package/extensions/talk-voice/index.ts +150 -0
- package/extensions/talk-voice/remoteclaw.plugin.json +10 -0
- package/extensions/telegram/index.ts +17 -0
- package/extensions/telegram/package.json +12 -0
- package/extensions/telegram/remoteclaw.plugin.json +9 -0
- package/extensions/telegram/src/channel.ts +569 -0
- package/extensions/telegram/src/runtime.ts +14 -0
- package/extensions/test-utils/runtime-env.ts +12 -0
- package/extensions/thread-ownership/index.ts +133 -0
- package/extensions/thread-ownership/remoteclaw.plugin.json +28 -0
- package/extensions/tlon/README.md +5 -0
- package/extensions/tlon/index.ts +17 -0
- package/extensions/tlon/package.json +29 -0
- package/extensions/tlon/remoteclaw.plugin.json +9 -0
- package/extensions/tlon/src/account-fields.ts +25 -0
- package/extensions/tlon/src/channel.ts +384 -0
- package/extensions/tlon/src/config-schema.ts +41 -0
- package/extensions/tlon/src/monitor/discovery.ts +78 -0
- package/extensions/tlon/src/monitor/history.ts +92 -0
- package/extensions/tlon/src/monitor/index.ts +596 -0
- package/extensions/tlon/src/monitor/processed-messages.ts +33 -0
- package/extensions/tlon/src/monitor/utils.ts +106 -0
- package/extensions/tlon/src/onboarding.ts +229 -0
- package/extensions/tlon/src/runtime.ts +14 -0
- package/extensions/tlon/src/targets.ts +89 -0
- package/extensions/tlon/src/types.ts +99 -0
- package/extensions/tlon/src/urbit/auth.ts +48 -0
- package/extensions/tlon/src/urbit/base-url.ts +57 -0
- package/extensions/tlon/src/urbit/channel-client.ts +158 -0
- package/extensions/tlon/src/urbit/channel-ops.ts +164 -0
- package/extensions/tlon/src/urbit/context.ts +47 -0
- package/extensions/tlon/src/urbit/errors.ts +51 -0
- package/extensions/tlon/src/urbit/fetch.ts +39 -0
- package/extensions/tlon/src/urbit/send.ts +131 -0
- package/extensions/tlon/src/urbit/sse-client.ts +431 -0
- package/extensions/twitch/CHANGELOG.md +39 -0
- package/extensions/twitch/README.md +89 -0
- package/extensions/twitch/index.ts +20 -0
- package/extensions/twitch/package.json +17 -0
- package/extensions/twitch/remoteclaw.plugin.json +9 -0
- package/extensions/twitch/src/access-control.ts +166 -0
- package/extensions/twitch/src/actions.ts +174 -0
- package/extensions/twitch/src/client-manager-registry.ts +115 -0
- package/extensions/twitch/src/config-schema.ts +84 -0
- package/extensions/twitch/src/config.ts +116 -0
- package/extensions/twitch/src/monitor.ts +273 -0
- package/extensions/twitch/src/onboarding.ts +417 -0
- package/extensions/twitch/src/outbound.ts +187 -0
- package/extensions/twitch/src/plugin.ts +274 -0
- package/extensions/twitch/src/probe.ts +119 -0
- package/extensions/twitch/src/resolver.ts +137 -0
- package/extensions/twitch/src/runtime.ts +14 -0
- package/extensions/twitch/src/send.ts +136 -0
- package/extensions/twitch/src/status.ts +179 -0
- package/extensions/twitch/src/test-fixtures.ts +30 -0
- package/extensions/twitch/src/token.ts +94 -0
- package/extensions/twitch/src/twitch-client.ts +277 -0
- package/extensions/twitch/src/types.ts +141 -0
- package/extensions/twitch/src/utils/markdown.ts +98 -0
- package/extensions/twitch/src/utils/twitch.ts +80 -0
- package/extensions/voice-call/CHANGELOG.md +49 -0
- package/extensions/voice-call/README.md +181 -0
- package/extensions/voice-call/index.ts +512 -0
- package/extensions/voice-call/package.json +16 -0
- package/extensions/voice-call/remoteclaw.plugin.json +559 -0
- package/extensions/voice-call/src/allowlist.ts +19 -0
- package/extensions/voice-call/src/cli.ts +380 -0
- package/extensions/voice-call/src/config.ts +477 -0
- package/extensions/voice-call/src/core-bridge.ts +170 -0
- package/extensions/voice-call/src/manager/context.ts +41 -0
- package/extensions/voice-call/src/manager/events.ts +242 -0
- package/extensions/voice-call/src/manager/lookup.ts +35 -0
- package/extensions/voice-call/src/manager/outbound.ts +380 -0
- package/extensions/voice-call/src/manager/state.ts +48 -0
- package/extensions/voice-call/src/manager/store.ts +94 -0
- package/extensions/voice-call/src/manager/timers.ts +112 -0
- package/extensions/voice-call/src/manager/twiml.ts +9 -0
- package/extensions/voice-call/src/manager.ts +209 -0
- package/extensions/voice-call/src/media-stream.ts +527 -0
- package/extensions/voice-call/src/providers/base.ts +67 -0
- package/extensions/voice-call/src/providers/index.ts +10 -0
- package/extensions/voice-call/src/providers/mock.ts +165 -0
- package/extensions/voice-call/src/providers/plivo.ts +560 -0
- package/extensions/voice-call/src/providers/stt-openai-realtime.ts +311 -0
- package/extensions/voice-call/src/providers/telnyx.ts +318 -0
- package/extensions/voice-call/src/providers/tts-openai.ts +259 -0
- package/extensions/voice-call/src/providers/twilio/api.ts +42 -0
- package/extensions/voice-call/src/providers/twilio/webhook.ts +33 -0
- package/extensions/voice-call/src/providers/twilio.ts +688 -0
- package/extensions/voice-call/src/response-generator.ts +174 -0
- package/extensions/voice-call/src/runtime.ts +217 -0
- package/extensions/voice-call/src/telephony-audio.ts +90 -0
- package/extensions/voice-call/src/telephony-tts.ts +106 -0
- package/extensions/voice-call/src/tunnel.ts +314 -0
- package/extensions/voice-call/src/types.ts +280 -0
- package/extensions/voice-call/src/utils.ts +14 -0
- package/extensions/voice-call/src/voice-mapping.ts +67 -0
- package/extensions/voice-call/src/webhook-security.ts +880 -0
- package/extensions/voice-call/src/webhook.ts +556 -0
- package/extensions/whatsapp/index.ts +17 -0
- package/extensions/whatsapp/package.json +12 -0
- package/extensions/whatsapp/remoteclaw.plugin.json +9 -0
- package/extensions/whatsapp/src/channel.ts +459 -0
- package/extensions/whatsapp/src/runtime.ts +14 -0
- package/extensions/zalo/CHANGELOG.md +29 -0
- package/extensions/zalo/README.md +50 -0
- package/extensions/zalo/index.ts +19 -0
- package/extensions/zalo/package.json +32 -0
- package/extensions/zalo/remoteclaw.plugin.json +9 -0
- package/extensions/zalo/src/accounts.ts +82 -0
- package/extensions/zalo/src/actions.ts +56 -0
- package/extensions/zalo/src/api.ts +208 -0
- package/extensions/zalo/src/channel.ts +398 -0
- package/extensions/zalo/src/config-schema.ts +27 -0
- package/extensions/zalo/src/group-access.ts +48 -0
- package/extensions/zalo/src/monitor.ts +675 -0
- package/extensions/zalo/src/monitor.webhook.ts +219 -0
- package/extensions/zalo/src/onboarding.ts +398 -0
- package/extensions/zalo/src/probe.ts +45 -0
- package/extensions/zalo/src/proxy.ts +24 -0
- package/extensions/zalo/src/runtime.ts +14 -0
- package/extensions/zalo/src/send.ts +124 -0
- package/extensions/zalo/src/status-issues.ts +53 -0
- package/extensions/zalo/src/token.ts +62 -0
- package/extensions/zalo/src/types.ts +48 -0
- package/extensions/zalouser/CHANGELOG.md +31 -0
- package/extensions/zalouser/README.md +225 -0
- package/extensions/zalouser/index.ts +31 -0
- package/extensions/zalouser/package.json +32 -0
- package/extensions/zalouser/remoteclaw.plugin.json +9 -0
- package/extensions/zalouser/src/accounts.ts +138 -0
- package/extensions/zalouser/src/channel.ts +652 -0
- package/extensions/zalouser/src/config-schema.ts +28 -0
- package/extensions/zalouser/src/monitor.ts +619 -0
- package/extensions/zalouser/src/onboarding.ts +428 -0
- package/extensions/zalouser/src/probe.ts +27 -0
- package/extensions/zalouser/src/runtime.ts +14 -0
- package/extensions/zalouser/src/send.ts +141 -0
- package/extensions/zalouser/src/status-issues.ts +89 -0
- package/extensions/zalouser/src/tool.ts +166 -0
- package/extensions/zalouser/src/types.ts +105 -0
- package/extensions/zalouser/src/zca.ts +198 -0
- package/package.json +251 -15
- package/remoteclaw.mjs +56 -0
- package/index.js +0 -4
|
@@ -0,0 +1,3138 @@
|
|
|
1
|
+
import { Kt as resolveOAuthDir, Rt as resolveConfigPath, qt as resolveStateDir } from "./entry.js";
|
|
2
|
+
import { t as formatCliCommand } from "./command-format-CVfo8I5f.js";
|
|
3
|
+
import { l as resolveAgentIdFromSessionKey, s as normalizeAgentId, w as resolveThreadParentSessionKey } from "./session-key-C2n-VILA.js";
|
|
4
|
+
import { I as MANIFEST_KEY, at as extensionUsesSkippedScannerPath, it as MAX_INCLUDE_DEPTH, lt as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, ot as isPathInside, r as createConfigIO, rt as INCLUDE_KEY, z as normalizePluginsConfig } from "./config-FHu9Bn4R.js";
|
|
5
|
+
import { l as resolveAgentModelFallbackValues, r as resolveAgentConfig, s as resolveDefaultAgentId, u as resolveAgentModelPrimaryValue } from "./agent-scope-C50VuLKh.js";
|
|
6
|
+
import { l as normalizeStringEntries, o as resolveChannelGroupToolsPolicy, t as getChannelDock } from "./dock-BqNINg7k.js";
|
|
7
|
+
import { c as normalizeMessageChannel, f as GATEWAY_CLIENT_MODES, p as GATEWAY_CLIENT_NAMES } from "./message-channel-uWMAiywE.js";
|
|
8
|
+
import { n as listChannelPlugins } from "./plugins-BflZz0sp.js";
|
|
9
|
+
import { c as READ_SCOPE, f as GatewayClient, t as buildGatewayConnectionDetails } from "./call-BbwtB9Y-.js";
|
|
10
|
+
import { t as resolveGatewayCredentialsFromConfig } from "./credentials-BHWUBHMd.js";
|
|
11
|
+
import { n as runExec } from "./exec-DkFE7lqU.js";
|
|
12
|
+
import { i as resolveNativeCommandsEnabled } from "./commands-CDonBOrw.js";
|
|
13
|
+
import { n as formatErrorMessage } from "./errors-DZ199hOo.js";
|
|
14
|
+
import { i as readChannelAllowFromStore } from "./pairing-store-CTkD51uW.js";
|
|
15
|
+
import { n as resolveBrowserControlAuth, o as resolveBrowserConfig, s as resolveProfile } from "./control-auth-D0tpV3ts.js";
|
|
16
|
+
import { a as resolveGatewayAuth } from "./auth-Deh9i9Eg.js";
|
|
17
|
+
import { n as DEFAULT_GATEWAY_HTTP_TOOL_DENY, r as CORE_TOOL_GROUPS, s as resolveCoreToolProfilePolicy } from "./dangerous-tools-BOLoCRv4.js";
|
|
18
|
+
import { t as resolveChannelDefaultAccountId } from "./helpers-R7bU5IBz.js";
|
|
19
|
+
import { n as isDangerousNameMatchingEnabled } from "./dangerous-name-matching-BzmiLXmA.js";
|
|
20
|
+
import { c as normalizeTelegramAllowFromEntry, s as isNumericTelegramUserId, t as isDiscordMutableAllowEntry } from "./mutable-allowlist-detectors-DiZDtmlZ.js";
|
|
21
|
+
import { t as resolveDmAllowState } from "./dm-policy-shared-D8lgnmrC.js";
|
|
22
|
+
import os from "node:os";
|
|
23
|
+
import path from "node:path";
|
|
24
|
+
import JSON5 from "json5";
|
|
25
|
+
import * as fs from "node:fs/promises";
|
|
26
|
+
import fsp from "node:fs/promises";
|
|
27
|
+
import { randomUUID } from "node:crypto";
|
|
28
|
+
import { isIP } from "node:net";
|
|
29
|
+
|
|
30
|
+
//#region src/gateway/probe.ts
|
|
31
|
+
async function probeGateway(opts) {
|
|
32
|
+
const startedAt = Date.now();
|
|
33
|
+
const instanceId = randomUUID();
|
|
34
|
+
let connectLatencyMs = null;
|
|
35
|
+
let connectError = null;
|
|
36
|
+
let close = null;
|
|
37
|
+
return await new Promise((resolve) => {
|
|
38
|
+
let settled = false;
|
|
39
|
+
const settle = (result) => {
|
|
40
|
+
if (settled) return;
|
|
41
|
+
settled = true;
|
|
42
|
+
clearTimeout(timer);
|
|
43
|
+
client.stop();
|
|
44
|
+
resolve({
|
|
45
|
+
url: opts.url,
|
|
46
|
+
...result
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
const client = new GatewayClient({
|
|
50
|
+
url: opts.url,
|
|
51
|
+
token: opts.auth?.token,
|
|
52
|
+
password: opts.auth?.password,
|
|
53
|
+
scopes: [READ_SCOPE],
|
|
54
|
+
clientName: GATEWAY_CLIENT_NAMES.CLI,
|
|
55
|
+
clientVersion: "dev",
|
|
56
|
+
mode: GATEWAY_CLIENT_MODES.PROBE,
|
|
57
|
+
instanceId,
|
|
58
|
+
onConnectError: (err) => {
|
|
59
|
+
connectError = formatErrorMessage(err);
|
|
60
|
+
},
|
|
61
|
+
onClose: (code, reason) => {
|
|
62
|
+
close = {
|
|
63
|
+
code,
|
|
64
|
+
reason
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
onHelloOk: async () => {
|
|
68
|
+
connectLatencyMs = Date.now() - startedAt;
|
|
69
|
+
try {
|
|
70
|
+
const [health, status, presence, configSnapshot] = await Promise.all([
|
|
71
|
+
client.request("health"),
|
|
72
|
+
client.request("status"),
|
|
73
|
+
client.request("system-presence"),
|
|
74
|
+
client.request("config.get", {})
|
|
75
|
+
]);
|
|
76
|
+
settle({
|
|
77
|
+
ok: true,
|
|
78
|
+
connectLatencyMs,
|
|
79
|
+
error: null,
|
|
80
|
+
close,
|
|
81
|
+
health,
|
|
82
|
+
status,
|
|
83
|
+
presence: Array.isArray(presence) ? presence : null,
|
|
84
|
+
configSnapshot
|
|
85
|
+
});
|
|
86
|
+
} catch (err) {
|
|
87
|
+
settle({
|
|
88
|
+
ok: false,
|
|
89
|
+
connectLatencyMs,
|
|
90
|
+
error: formatErrorMessage(err),
|
|
91
|
+
close,
|
|
92
|
+
health: null,
|
|
93
|
+
status: null,
|
|
94
|
+
presence: null,
|
|
95
|
+
configSnapshot: null
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
const timer = setTimeout(() => {
|
|
101
|
+
settle({
|
|
102
|
+
ok: false,
|
|
103
|
+
connectLatencyMs,
|
|
104
|
+
error: connectError ? `connect failed: ${connectError}` : "timeout",
|
|
105
|
+
close,
|
|
106
|
+
health: null,
|
|
107
|
+
status: null,
|
|
108
|
+
presence: null,
|
|
109
|
+
configSnapshot: null
|
|
110
|
+
});
|
|
111
|
+
}, Math.max(250, opts.timeoutMs));
|
|
112
|
+
client.start();
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/gateway/node-command-policy.ts
|
|
118
|
+
const CANVAS_COMMANDS = [
|
|
119
|
+
"canvas.present",
|
|
120
|
+
"canvas.hide",
|
|
121
|
+
"canvas.navigate",
|
|
122
|
+
"canvas.eval",
|
|
123
|
+
"canvas.snapshot",
|
|
124
|
+
"canvas.a2ui.push",
|
|
125
|
+
"canvas.a2ui.pushJSONL",
|
|
126
|
+
"canvas.a2ui.reset"
|
|
127
|
+
];
|
|
128
|
+
const CAMERA_COMMANDS = ["camera.list"];
|
|
129
|
+
const CAMERA_DANGEROUS_COMMANDS = ["camera.snap", "camera.clip"];
|
|
130
|
+
const SCREEN_DANGEROUS_COMMANDS = ["screen.record"];
|
|
131
|
+
const LOCATION_COMMANDS = ["location.get"];
|
|
132
|
+
const DEVICE_COMMANDS = ["device.info", "device.status"];
|
|
133
|
+
const CONTACTS_COMMANDS = ["contacts.search"];
|
|
134
|
+
const CONTACTS_DANGEROUS_COMMANDS = ["contacts.add"];
|
|
135
|
+
const CALENDAR_COMMANDS = ["calendar.events"];
|
|
136
|
+
const CALENDAR_DANGEROUS_COMMANDS = ["calendar.add"];
|
|
137
|
+
const REMINDERS_COMMANDS = ["reminders.list"];
|
|
138
|
+
const REMINDERS_DANGEROUS_COMMANDS = ["reminders.add"];
|
|
139
|
+
const PHOTOS_COMMANDS = ["photos.latest"];
|
|
140
|
+
const MOTION_COMMANDS = ["motion.activity", "motion.pedometer"];
|
|
141
|
+
const SMS_DANGEROUS_COMMANDS = ["sms.send"];
|
|
142
|
+
const IOS_SYSTEM_COMMANDS = ["system.notify"];
|
|
143
|
+
const SYSTEM_COMMANDS = [
|
|
144
|
+
"system.run",
|
|
145
|
+
"system.which",
|
|
146
|
+
"system.notify",
|
|
147
|
+
"browser.proxy"
|
|
148
|
+
];
|
|
149
|
+
const DEFAULT_DANGEROUS_NODE_COMMANDS = [
|
|
150
|
+
...CAMERA_DANGEROUS_COMMANDS,
|
|
151
|
+
...SCREEN_DANGEROUS_COMMANDS,
|
|
152
|
+
...CONTACTS_DANGEROUS_COMMANDS,
|
|
153
|
+
...CALENDAR_DANGEROUS_COMMANDS,
|
|
154
|
+
...REMINDERS_DANGEROUS_COMMANDS,
|
|
155
|
+
...SMS_DANGEROUS_COMMANDS
|
|
156
|
+
];
|
|
157
|
+
const PLATFORM_DEFAULTS = {
|
|
158
|
+
ios: [
|
|
159
|
+
...CANVAS_COMMANDS,
|
|
160
|
+
...CAMERA_COMMANDS,
|
|
161
|
+
...LOCATION_COMMANDS,
|
|
162
|
+
...DEVICE_COMMANDS,
|
|
163
|
+
...CONTACTS_COMMANDS,
|
|
164
|
+
...CALENDAR_COMMANDS,
|
|
165
|
+
...REMINDERS_COMMANDS,
|
|
166
|
+
...PHOTOS_COMMANDS,
|
|
167
|
+
...MOTION_COMMANDS,
|
|
168
|
+
...IOS_SYSTEM_COMMANDS
|
|
169
|
+
],
|
|
170
|
+
android: [
|
|
171
|
+
...CANVAS_COMMANDS,
|
|
172
|
+
...CAMERA_COMMANDS,
|
|
173
|
+
...LOCATION_COMMANDS,
|
|
174
|
+
...DEVICE_COMMANDS,
|
|
175
|
+
...CONTACTS_COMMANDS,
|
|
176
|
+
...CALENDAR_COMMANDS,
|
|
177
|
+
...REMINDERS_COMMANDS,
|
|
178
|
+
...PHOTOS_COMMANDS,
|
|
179
|
+
...MOTION_COMMANDS
|
|
180
|
+
],
|
|
181
|
+
macos: [
|
|
182
|
+
...CANVAS_COMMANDS,
|
|
183
|
+
...CAMERA_COMMANDS,
|
|
184
|
+
...LOCATION_COMMANDS,
|
|
185
|
+
...DEVICE_COMMANDS,
|
|
186
|
+
...CONTACTS_COMMANDS,
|
|
187
|
+
...CALENDAR_COMMANDS,
|
|
188
|
+
...REMINDERS_COMMANDS,
|
|
189
|
+
...PHOTOS_COMMANDS,
|
|
190
|
+
...MOTION_COMMANDS,
|
|
191
|
+
...SYSTEM_COMMANDS
|
|
192
|
+
],
|
|
193
|
+
linux: [...SYSTEM_COMMANDS],
|
|
194
|
+
windows: [...SYSTEM_COMMANDS],
|
|
195
|
+
unknown: [
|
|
196
|
+
...CANVAS_COMMANDS,
|
|
197
|
+
...CAMERA_COMMANDS,
|
|
198
|
+
...LOCATION_COMMANDS,
|
|
199
|
+
...SYSTEM_COMMANDS
|
|
200
|
+
]
|
|
201
|
+
};
|
|
202
|
+
function normalizePlatformId(platform, deviceFamily) {
|
|
203
|
+
const raw = (platform ?? "").trim().toLowerCase();
|
|
204
|
+
if (raw.startsWith("ios")) return "ios";
|
|
205
|
+
if (raw.startsWith("android")) return "android";
|
|
206
|
+
if (raw.startsWith("mac")) return "macos";
|
|
207
|
+
if (raw.startsWith("darwin")) return "macos";
|
|
208
|
+
if (raw.startsWith("win")) return "windows";
|
|
209
|
+
if (raw.startsWith("linux")) return "linux";
|
|
210
|
+
const family = (deviceFamily ?? "").trim().toLowerCase();
|
|
211
|
+
if (family.includes("iphone") || family.includes("ipad") || family.includes("ios")) return "ios";
|
|
212
|
+
if (family.includes("android")) return "android";
|
|
213
|
+
if (family.includes("mac")) return "macos";
|
|
214
|
+
if (family.includes("windows")) return "windows";
|
|
215
|
+
if (family.includes("linux")) return "linux";
|
|
216
|
+
return "unknown";
|
|
217
|
+
}
|
|
218
|
+
function resolveNodeCommandAllowlist(cfg, node) {
|
|
219
|
+
const base = PLATFORM_DEFAULTS[normalizePlatformId(node?.platform, node?.deviceFamily)] ?? PLATFORM_DEFAULTS.unknown;
|
|
220
|
+
const extra = cfg.gateway?.nodes?.allowCommands ?? [];
|
|
221
|
+
const deny = new Set(cfg.gateway?.nodes?.denyCommands ?? []);
|
|
222
|
+
const allow = new Set([...base, ...extra].map((cmd) => cmd.trim()).filter(Boolean));
|
|
223
|
+
for (const blocked of deny) {
|
|
224
|
+
const trimmed = blocked.trim();
|
|
225
|
+
if (trimmed) allow.delete(trimmed);
|
|
226
|
+
}
|
|
227
|
+
return allow;
|
|
228
|
+
}
|
|
229
|
+
function isNodeCommandAllowed(params) {
|
|
230
|
+
const command = params.command.trim();
|
|
231
|
+
if (!command) return {
|
|
232
|
+
ok: false,
|
|
233
|
+
reason: "command required"
|
|
234
|
+
};
|
|
235
|
+
if (!params.allowlist.has(command)) return {
|
|
236
|
+
ok: false,
|
|
237
|
+
reason: "command not allowlisted"
|
|
238
|
+
};
|
|
239
|
+
if (Array.isArray(params.declaredCommands) && params.declaredCommands.length > 0) {
|
|
240
|
+
if (!params.declaredCommands.includes(command)) return {
|
|
241
|
+
ok: false,
|
|
242
|
+
reason: "command not declared by node"
|
|
243
|
+
};
|
|
244
|
+
} else return {
|
|
245
|
+
ok: false,
|
|
246
|
+
reason: "node did not declare commands"
|
|
247
|
+
};
|
|
248
|
+
return { ok: true };
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region src/gateway/probe-auth.ts
|
|
253
|
+
function resolveGatewayProbeAuth(params) {
|
|
254
|
+
return resolveGatewayCredentialsFromConfig({
|
|
255
|
+
cfg: params.cfg,
|
|
256
|
+
env: params.env,
|
|
257
|
+
modeOverride: params.mode,
|
|
258
|
+
includeLegacyEnv: false,
|
|
259
|
+
remoteTokenFallback: "remote-only"
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
//#endregion
|
|
264
|
+
//#region src/security/audit-channel.ts
|
|
265
|
+
function normalizeAllowFromList$1(list) {
|
|
266
|
+
return normalizeStringEntries(Array.isArray(list) ? list : void 0);
|
|
267
|
+
}
|
|
268
|
+
function addDiscordNameBasedEntries(params) {
|
|
269
|
+
if (!Array.isArray(params.values)) return;
|
|
270
|
+
for (const value of params.values) {
|
|
271
|
+
if (!isDiscordMutableAllowEntry(String(value))) continue;
|
|
272
|
+
const text = String(value).trim();
|
|
273
|
+
if (!text) continue;
|
|
274
|
+
params.target.add(`${params.source}:${text}`);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
function classifyChannelWarningSeverity(message) {
|
|
278
|
+
const s = message.toLowerCase();
|
|
279
|
+
if (s.includes("dms: open") || s.includes("grouppolicy=\"open\"") || s.includes("dmpolicy=\"open\"")) return "critical";
|
|
280
|
+
if (s.includes("allows any") || s.includes("anyone can dm") || s.includes("public")) return "critical";
|
|
281
|
+
if (s.includes("locked") || s.includes("disabled")) return "info";
|
|
282
|
+
return "warn";
|
|
283
|
+
}
|
|
284
|
+
function dedupeFindings(findings) {
|
|
285
|
+
const seen = /* @__PURE__ */ new Set();
|
|
286
|
+
const out = [];
|
|
287
|
+
for (const finding of findings) {
|
|
288
|
+
const key = [
|
|
289
|
+
finding.checkId,
|
|
290
|
+
finding.severity,
|
|
291
|
+
finding.title,
|
|
292
|
+
finding.detail ?? "",
|
|
293
|
+
finding.remediation ?? ""
|
|
294
|
+
].join("\n");
|
|
295
|
+
if (seen.has(key)) continue;
|
|
296
|
+
seen.add(key);
|
|
297
|
+
out.push(finding);
|
|
298
|
+
}
|
|
299
|
+
return out;
|
|
300
|
+
}
|
|
301
|
+
function hasExplicitProviderAccountConfig(cfg, provider, accountId) {
|
|
302
|
+
const channel = cfg.channels?.[provider];
|
|
303
|
+
if (!channel || typeof channel !== "object") return false;
|
|
304
|
+
const accounts = channel.accounts;
|
|
305
|
+
if (!accounts || typeof accounts !== "object") return false;
|
|
306
|
+
return accountId in accounts;
|
|
307
|
+
}
|
|
308
|
+
async function collectChannelSecurityFindings(params) {
|
|
309
|
+
const findings = [];
|
|
310
|
+
const coerceNativeSetting = (value) => {
|
|
311
|
+
if (value === true) return true;
|
|
312
|
+
if (value === false) return false;
|
|
313
|
+
if (value === "auto") return "auto";
|
|
314
|
+
};
|
|
315
|
+
const warnDmPolicy = async (input) => {
|
|
316
|
+
const policyPath = input.policyPath ?? `${input.allowFromPath}policy`;
|
|
317
|
+
const { hasWildcard, isMultiUserDm } = await resolveDmAllowState({
|
|
318
|
+
provider: input.provider,
|
|
319
|
+
allowFrom: input.allowFrom,
|
|
320
|
+
normalizeEntry: input.normalizeEntry
|
|
321
|
+
});
|
|
322
|
+
const dmScope = params.cfg.session?.dmScope ?? "main";
|
|
323
|
+
if (input.dmPolicy === "open") {
|
|
324
|
+
const allowFromKey = `${input.allowFromPath}allowFrom`;
|
|
325
|
+
findings.push({
|
|
326
|
+
checkId: `channels.${input.provider}.dm.open`,
|
|
327
|
+
severity: "critical",
|
|
328
|
+
title: `${input.label} DMs are open`,
|
|
329
|
+
detail: `${policyPath}="open" allows anyone to DM the bot.`,
|
|
330
|
+
remediation: `Use pairing/allowlist; if you really need open DMs, ensure ${allowFromKey} includes "*".`
|
|
331
|
+
});
|
|
332
|
+
if (!hasWildcard) findings.push({
|
|
333
|
+
checkId: `channels.${input.provider}.dm.open_invalid`,
|
|
334
|
+
severity: "warn",
|
|
335
|
+
title: `${input.label} DM config looks inconsistent`,
|
|
336
|
+
detail: `"open" requires ${allowFromKey} to include "*".`
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
if (input.dmPolicy === "disabled") {
|
|
340
|
+
findings.push({
|
|
341
|
+
checkId: `channels.${input.provider}.dm.disabled`,
|
|
342
|
+
severity: "info",
|
|
343
|
+
title: `${input.label} DMs are disabled`,
|
|
344
|
+
detail: `${policyPath}="disabled" ignores inbound DMs.`
|
|
345
|
+
});
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
if (dmScope === "main" && isMultiUserDm) findings.push({
|
|
349
|
+
checkId: `channels.${input.provider}.dm.scope_main_multiuser`,
|
|
350
|
+
severity: "warn",
|
|
351
|
+
title: `${input.label} DMs share the main session`,
|
|
352
|
+
detail: "Multiple DM senders currently share the main session, which can leak context across users.",
|
|
353
|
+
remediation: "Run: " + formatCliCommand("remoteclaw config set session.dmScope \"per-channel-peer\"") + " (or \"per-account-channel-peer\" for multi-account channels) to isolate DM sessions per sender."
|
|
354
|
+
});
|
|
355
|
+
};
|
|
356
|
+
for (const plugin of params.plugins) {
|
|
357
|
+
if (!plugin.security) continue;
|
|
358
|
+
const accountIds = plugin.config.listAccountIds(params.cfg);
|
|
359
|
+
const defaultAccountId = resolveChannelDefaultAccountId({
|
|
360
|
+
plugin,
|
|
361
|
+
cfg: params.cfg,
|
|
362
|
+
accountIds
|
|
363
|
+
});
|
|
364
|
+
const orderedAccountIds = Array.from(new Set([defaultAccountId, ...accountIds]));
|
|
365
|
+
for (const accountId of orderedAccountIds) {
|
|
366
|
+
const hasExplicitAccountPath = hasExplicitProviderAccountConfig(params.cfg, plugin.id, accountId);
|
|
367
|
+
const account = plugin.config.resolveAccount(params.cfg, accountId);
|
|
368
|
+
if (!(plugin.config.isEnabled ? plugin.config.isEnabled(account, params.cfg) : true)) continue;
|
|
369
|
+
if (!(plugin.config.isConfigured ? await plugin.config.isConfigured(account, params.cfg) : true)) continue;
|
|
370
|
+
const accountConfig = account?.config;
|
|
371
|
+
if (isDangerousNameMatchingEnabled(accountConfig)) {
|
|
372
|
+
const accountNote = orderedAccountIds.length > 1 || hasExplicitAccountPath ? ` (account: ${accountId})` : "";
|
|
373
|
+
findings.push({
|
|
374
|
+
checkId: `channels.${plugin.id}.allowFrom.dangerous_name_matching_enabled`,
|
|
375
|
+
severity: "info",
|
|
376
|
+
title: `${plugin.meta.label ?? plugin.id} dangerous name matching is enabled${accountNote}`,
|
|
377
|
+
detail: "dangerouslyAllowNameMatching=true re-enables mutable name/email/tag matching for sender authorization. This is a break-glass compatibility mode, not a hardened default.",
|
|
378
|
+
remediation: "Prefer stable sender IDs in allowlists, then disable dangerouslyAllowNameMatching."
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
if (plugin.id === "discord") {
|
|
382
|
+
const discordCfg = account?.config ?? {};
|
|
383
|
+
const dangerousNameMatchingEnabled = isDangerousNameMatchingEnabled(discordCfg);
|
|
384
|
+
const storeAllowFrom = await readChannelAllowFromStore("discord").catch(() => []);
|
|
385
|
+
const discordNameBasedAllowEntries = /* @__PURE__ */ new Set();
|
|
386
|
+
const discordPathPrefix = orderedAccountIds.length > 1 || hasExplicitAccountPath ? `channels.discord.accounts.${accountId}` : "channels.discord";
|
|
387
|
+
addDiscordNameBasedEntries({
|
|
388
|
+
target: discordNameBasedAllowEntries,
|
|
389
|
+
values: discordCfg.allowFrom,
|
|
390
|
+
source: `${discordPathPrefix}.allowFrom`
|
|
391
|
+
});
|
|
392
|
+
addDiscordNameBasedEntries({
|
|
393
|
+
target: discordNameBasedAllowEntries,
|
|
394
|
+
values: discordCfg.dm?.allowFrom,
|
|
395
|
+
source: `${discordPathPrefix}.dm.allowFrom`
|
|
396
|
+
});
|
|
397
|
+
addDiscordNameBasedEntries({
|
|
398
|
+
target: discordNameBasedAllowEntries,
|
|
399
|
+
values: storeAllowFrom,
|
|
400
|
+
source: "~/.remoteclaw/credentials/discord-allowFrom.json"
|
|
401
|
+
});
|
|
402
|
+
const discordGuildEntries = discordCfg.guilds ?? {};
|
|
403
|
+
for (const [guildKey, guildValue] of Object.entries(discordGuildEntries)) {
|
|
404
|
+
if (!guildValue || typeof guildValue !== "object") continue;
|
|
405
|
+
const guild = guildValue;
|
|
406
|
+
addDiscordNameBasedEntries({
|
|
407
|
+
target: discordNameBasedAllowEntries,
|
|
408
|
+
values: guild.users,
|
|
409
|
+
source: `${discordPathPrefix}.guilds.${guildKey}.users`
|
|
410
|
+
});
|
|
411
|
+
const channels = guild.channels;
|
|
412
|
+
if (!channels || typeof channels !== "object") continue;
|
|
413
|
+
for (const [channelKey, channelValue] of Object.entries(channels)) {
|
|
414
|
+
if (!channelValue || typeof channelValue !== "object") continue;
|
|
415
|
+
addDiscordNameBasedEntries({
|
|
416
|
+
target: discordNameBasedAllowEntries,
|
|
417
|
+
values: channelValue.users,
|
|
418
|
+
source: `${discordPathPrefix}.guilds.${guildKey}.channels.${channelKey}.users`
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
if (discordNameBasedAllowEntries.size > 0) {
|
|
423
|
+
const examples = Array.from(discordNameBasedAllowEntries).slice(0, 5);
|
|
424
|
+
const more = discordNameBasedAllowEntries.size > examples.length ? ` (+${discordNameBasedAllowEntries.size - examples.length} more)` : "";
|
|
425
|
+
findings.push({
|
|
426
|
+
checkId: "channels.discord.allowFrom.name_based_entries",
|
|
427
|
+
severity: dangerousNameMatchingEnabled ? "info" : "warn",
|
|
428
|
+
title: dangerousNameMatchingEnabled ? "Discord allowlist uses break-glass name/tag matching" : "Discord allowlist contains name or tag entries",
|
|
429
|
+
detail: dangerousNameMatchingEnabled ? `Discord name/tag allowlist matching is explicitly enabled via dangerouslyAllowNameMatching. This mutable-identity mode is operator-selected break-glass behavior and out-of-scope for vulnerability reports by itself. Found: ${examples.join(", ")}${more}.` : `Discord name/tag allowlist matching uses normalized slugs and can collide across users. Found: ${examples.join(", ")}${more}.`,
|
|
430
|
+
remediation: dangerousNameMatchingEnabled ? "Prefer stable Discord IDs (or <@id>/user:<id>/pk:<id>), then disable dangerouslyAllowNameMatching." : "Prefer stable Discord IDs (or <@id>/user:<id>/pk:<id>) in channels.discord.allowFrom and channels.discord.guilds.*.users, or explicitly opt in with dangerouslyAllowNameMatching=true if you accept the risk."
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
if (resolveNativeCommandsEnabled({
|
|
434
|
+
providerId: "discord",
|
|
435
|
+
providerSetting: coerceNativeSetting(discordCfg.commands?.native),
|
|
436
|
+
globalSetting: params.cfg.commands?.native
|
|
437
|
+
})) {
|
|
438
|
+
const defaultGroupPolicy = params.cfg.channels?.defaults?.groupPolicy;
|
|
439
|
+
const groupPolicy = discordCfg.groupPolicy ?? defaultGroupPolicy ?? "allowlist";
|
|
440
|
+
const guildEntries = discordGuildEntries;
|
|
441
|
+
const guildsConfigured = Object.keys(guildEntries).length > 0;
|
|
442
|
+
const hasAnyUserAllowlist = Object.values(guildEntries).some((guild) => {
|
|
443
|
+
if (!guild || typeof guild !== "object") return false;
|
|
444
|
+
const g = guild;
|
|
445
|
+
if (Array.isArray(g.users) && g.users.length > 0) return true;
|
|
446
|
+
const channels = g.channels;
|
|
447
|
+
if (!channels || typeof channels !== "object") return false;
|
|
448
|
+
return Object.values(channels).some((channel) => {
|
|
449
|
+
if (!channel || typeof channel !== "object") return false;
|
|
450
|
+
const c = channel;
|
|
451
|
+
return Array.isArray(c.users) && c.users.length > 0;
|
|
452
|
+
});
|
|
453
|
+
});
|
|
454
|
+
const dmAllowFromRaw = discordCfg.dm?.allowFrom;
|
|
455
|
+
const ownerAllowFromConfigured = normalizeAllowFromList$1([...Array.isArray(dmAllowFromRaw) ? dmAllowFromRaw : [], ...storeAllowFrom]).length > 0;
|
|
456
|
+
const useAccessGroups = params.cfg.commands?.useAccessGroups !== false;
|
|
457
|
+
if (!useAccessGroups && groupPolicy !== "disabled" && guildsConfigured && !hasAnyUserAllowlist) findings.push({
|
|
458
|
+
checkId: "channels.discord.commands.native.unrestricted",
|
|
459
|
+
severity: "critical",
|
|
460
|
+
title: "Discord slash commands are unrestricted",
|
|
461
|
+
detail: "commands.useAccessGroups=false disables sender allowlists for Discord slash commands unless a per-guild/channel users allowlist is configured; with no users allowlist, any user in allowed guild channels can invoke /… commands.",
|
|
462
|
+
remediation: "Set commands.useAccessGroups=true (recommended), or configure channels.discord.guilds.<id>.users (or channels.discord.guilds.<id>.channels.<channel>.users)."
|
|
463
|
+
});
|
|
464
|
+
else if (useAccessGroups && groupPolicy !== "disabled" && guildsConfigured && !ownerAllowFromConfigured && !hasAnyUserAllowlist) findings.push({
|
|
465
|
+
checkId: "channels.discord.commands.native.no_allowlists",
|
|
466
|
+
severity: "warn",
|
|
467
|
+
title: "Discord slash commands have no allowlists",
|
|
468
|
+
detail: "Discord slash commands are enabled, but neither an owner allowFrom list nor any per-guild/channel users allowlist is configured; /… commands will be rejected for everyone.",
|
|
469
|
+
remediation: "Add your user id to channels.discord.allowFrom (or approve yourself via pairing), or configure channels.discord.guilds.<id>.users."
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
if (plugin.id === "slack") {
|
|
474
|
+
const slackCfg = account?.config ?? {};
|
|
475
|
+
if (resolveNativeCommandsEnabled({
|
|
476
|
+
providerId: "slack",
|
|
477
|
+
providerSetting: coerceNativeSetting(slackCfg.commands?.native),
|
|
478
|
+
globalSetting: params.cfg.commands?.native
|
|
479
|
+
}) || slackCfg.slashCommand?.enabled === true) if (!(params.cfg.commands?.useAccessGroups !== false)) findings.push({
|
|
480
|
+
checkId: "channels.slack.commands.slash.useAccessGroups_off",
|
|
481
|
+
severity: "critical",
|
|
482
|
+
title: "Slack slash commands bypass access groups",
|
|
483
|
+
detail: "Slack slash/native commands are enabled while commands.useAccessGroups=false; this can allow unrestricted /… command execution from channels/users you didn't explicitly authorize.",
|
|
484
|
+
remediation: "Set commands.useAccessGroups=true (recommended)."
|
|
485
|
+
});
|
|
486
|
+
else {
|
|
487
|
+
const allowFromRaw = account?.config?.allowFrom;
|
|
488
|
+
const legacyAllowFromRaw = account?.dm?.allowFrom;
|
|
489
|
+
const allowFrom = Array.isArray(allowFromRaw) ? allowFromRaw : Array.isArray(legacyAllowFromRaw) ? legacyAllowFromRaw : [];
|
|
490
|
+
const storeAllowFrom = await readChannelAllowFromStore("slack").catch(() => []);
|
|
491
|
+
const ownerAllowFromConfigured = normalizeAllowFromList$1([...allowFrom, ...storeAllowFrom]).length > 0;
|
|
492
|
+
const channels = slackCfg.channels ?? {};
|
|
493
|
+
const hasAnyChannelUsersAllowlist = Object.values(channels).some((value) => {
|
|
494
|
+
if (!value || typeof value !== "object") return false;
|
|
495
|
+
const channel = value;
|
|
496
|
+
return Array.isArray(channel.users) && channel.users.length > 0;
|
|
497
|
+
});
|
|
498
|
+
if (!ownerAllowFromConfigured && !hasAnyChannelUsersAllowlist) findings.push({
|
|
499
|
+
checkId: "channels.slack.commands.slash.no_allowlists",
|
|
500
|
+
severity: "warn",
|
|
501
|
+
title: "Slack slash commands have no allowlists",
|
|
502
|
+
detail: "Slack slash/native commands are enabled, but neither an owner allowFrom list nor any channels.<id>.users allowlist is configured; /… commands will be rejected for everyone.",
|
|
503
|
+
remediation: "Approve yourself via pairing (recommended), or set channels.slack.allowFrom and/or channels.slack.channels.<id>.users."
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
const dmPolicy = plugin.security.resolveDmPolicy?.({
|
|
508
|
+
cfg: params.cfg,
|
|
509
|
+
accountId,
|
|
510
|
+
account
|
|
511
|
+
});
|
|
512
|
+
if (dmPolicy) await warnDmPolicy({
|
|
513
|
+
label: plugin.meta.label ?? plugin.id,
|
|
514
|
+
provider: plugin.id,
|
|
515
|
+
dmPolicy: dmPolicy.policy,
|
|
516
|
+
allowFrom: dmPolicy.allowFrom,
|
|
517
|
+
policyPath: dmPolicy.policyPath,
|
|
518
|
+
allowFromPath: dmPolicy.allowFromPath,
|
|
519
|
+
normalizeEntry: dmPolicy.normalizeEntry
|
|
520
|
+
});
|
|
521
|
+
if (plugin.security.collectWarnings) {
|
|
522
|
+
const warnings = await plugin.security.collectWarnings({
|
|
523
|
+
cfg: params.cfg,
|
|
524
|
+
accountId,
|
|
525
|
+
account
|
|
526
|
+
});
|
|
527
|
+
for (const message of warnings ?? []) {
|
|
528
|
+
const trimmed = String(message).trim();
|
|
529
|
+
if (!trimmed) continue;
|
|
530
|
+
findings.push({
|
|
531
|
+
checkId: `channels.${plugin.id}.warning.${findings.length + 1}`,
|
|
532
|
+
severity: classifyChannelWarningSeverity(trimmed),
|
|
533
|
+
title: `${plugin.meta.label ?? plugin.id} security warning`,
|
|
534
|
+
detail: trimmed.replace(/^-\s*/, "")
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
if (plugin.id !== "telegram") continue;
|
|
539
|
+
if (!(params.cfg.commands?.text !== false)) continue;
|
|
540
|
+
const telegramCfg = account?.config ?? {};
|
|
541
|
+
const defaultGroupPolicy = params.cfg.channels?.defaults?.groupPolicy;
|
|
542
|
+
const groupPolicy = telegramCfg.groupPolicy ?? defaultGroupPolicy ?? "allowlist";
|
|
543
|
+
const groups = telegramCfg.groups;
|
|
544
|
+
const groupsConfigured = Boolean(groups) && Object.keys(groups ?? {}).length > 0;
|
|
545
|
+
if (!(groupPolicy === "open" || groupPolicy === "allowlist" && groupsConfigured)) continue;
|
|
546
|
+
const storeAllowFrom = await readChannelAllowFromStore("telegram").catch(() => []);
|
|
547
|
+
const storeHasWildcard = storeAllowFrom.some((v) => String(v).trim() === "*");
|
|
548
|
+
const invalidTelegramAllowFromEntries = /* @__PURE__ */ new Set();
|
|
549
|
+
for (const entry of storeAllowFrom) {
|
|
550
|
+
const normalized = normalizeTelegramAllowFromEntry(entry);
|
|
551
|
+
if (!normalized || normalized === "*") continue;
|
|
552
|
+
if (!isNumericTelegramUserId(normalized)) invalidTelegramAllowFromEntries.add(normalized);
|
|
553
|
+
}
|
|
554
|
+
const groupAllowFrom = Array.isArray(telegramCfg.groupAllowFrom) ? telegramCfg.groupAllowFrom : [];
|
|
555
|
+
const groupAllowFromHasWildcard = groupAllowFrom.some((v) => String(v).trim() === "*");
|
|
556
|
+
for (const entry of groupAllowFrom) {
|
|
557
|
+
const normalized = normalizeTelegramAllowFromEntry(entry);
|
|
558
|
+
if (!normalized || normalized === "*") continue;
|
|
559
|
+
if (!isNumericTelegramUserId(normalized)) invalidTelegramAllowFromEntries.add(normalized);
|
|
560
|
+
}
|
|
561
|
+
const dmAllowFrom = Array.isArray(telegramCfg.allowFrom) ? telegramCfg.allowFrom : [];
|
|
562
|
+
for (const entry of dmAllowFrom) {
|
|
563
|
+
const normalized = normalizeTelegramAllowFromEntry(entry);
|
|
564
|
+
if (!normalized || normalized === "*") continue;
|
|
565
|
+
if (!isNumericTelegramUserId(normalized)) invalidTelegramAllowFromEntries.add(normalized);
|
|
566
|
+
}
|
|
567
|
+
const anyGroupOverride = Boolean(groups && Object.values(groups).some((value) => {
|
|
568
|
+
if (!value || typeof value !== "object") return false;
|
|
569
|
+
const group = value;
|
|
570
|
+
const allowFrom = Array.isArray(group.allowFrom) ? group.allowFrom : [];
|
|
571
|
+
if (allowFrom.length > 0) {
|
|
572
|
+
for (const entry of allowFrom) {
|
|
573
|
+
const normalized = normalizeTelegramAllowFromEntry(entry);
|
|
574
|
+
if (!normalized || normalized === "*") continue;
|
|
575
|
+
if (!isNumericTelegramUserId(normalized)) invalidTelegramAllowFromEntries.add(normalized);
|
|
576
|
+
}
|
|
577
|
+
return true;
|
|
578
|
+
}
|
|
579
|
+
const topics = group.topics;
|
|
580
|
+
if (!topics || typeof topics !== "object") return false;
|
|
581
|
+
return Object.values(topics).some((topicValue) => {
|
|
582
|
+
if (!topicValue || typeof topicValue !== "object") return false;
|
|
583
|
+
const topic = topicValue;
|
|
584
|
+
const topicAllow = Array.isArray(topic.allowFrom) ? topic.allowFrom : [];
|
|
585
|
+
for (const entry of topicAllow) {
|
|
586
|
+
const normalized = normalizeTelegramAllowFromEntry(entry);
|
|
587
|
+
if (!normalized || normalized === "*") continue;
|
|
588
|
+
if (!isNumericTelegramUserId(normalized)) invalidTelegramAllowFromEntries.add(normalized);
|
|
589
|
+
}
|
|
590
|
+
return topicAllow.length > 0;
|
|
591
|
+
});
|
|
592
|
+
}));
|
|
593
|
+
const hasAnySenderAllowlist = storeAllowFrom.length > 0 || groupAllowFrom.length > 0 || anyGroupOverride;
|
|
594
|
+
if (invalidTelegramAllowFromEntries.size > 0) {
|
|
595
|
+
const examples = Array.from(invalidTelegramAllowFromEntries).slice(0, 5);
|
|
596
|
+
const more = invalidTelegramAllowFromEntries.size > examples.length ? ` (+${invalidTelegramAllowFromEntries.size - examples.length} more)` : "";
|
|
597
|
+
findings.push({
|
|
598
|
+
checkId: "channels.telegram.allowFrom.invalid_entries",
|
|
599
|
+
severity: "warn",
|
|
600
|
+
title: "Telegram allowlist contains non-numeric entries",
|
|
601
|
+
detail: `Telegram sender authorization requires numeric Telegram user IDs. Found non-numeric allowFrom entries: ${examples.join(", ")}${more}.`,
|
|
602
|
+
remediation: "Replace @username entries with numeric Telegram user IDs (use onboarding to resolve), then re-run the audit."
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
if (storeHasWildcard || groupAllowFromHasWildcard) {
|
|
606
|
+
findings.push({
|
|
607
|
+
checkId: "channels.telegram.groups.allowFrom.wildcard",
|
|
608
|
+
severity: "critical",
|
|
609
|
+
title: "Telegram group allowlist contains wildcard",
|
|
610
|
+
detail: "Telegram group sender allowlist contains \"*\", which allows any group member to run /… commands and control directives.",
|
|
611
|
+
remediation: "Remove \"*\" from channels.telegram.groupAllowFrom and pairing store; prefer explicit numeric Telegram user IDs."
|
|
612
|
+
});
|
|
613
|
+
continue;
|
|
614
|
+
}
|
|
615
|
+
if (!hasAnySenderAllowlist) findings.push({
|
|
616
|
+
checkId: "channels.telegram.groups.allowFrom.missing",
|
|
617
|
+
severity: "critical",
|
|
618
|
+
title: "Telegram group commands have no sender allowlist",
|
|
619
|
+
detail: "Telegram group access is enabled but no sender allowlist is configured; this allows any group member to invoke /… commands.",
|
|
620
|
+
remediation: "Approve yourself via pairing (recommended), or set channels.telegram.groupAllowFrom (or per-group groups.<id>.allowFrom)."
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
return dedupeFindings(findings);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
//#endregion
|
|
628
|
+
//#region src/agents/glob-pattern.ts
|
|
629
|
+
function escapeRegex(value) {
|
|
630
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
631
|
+
}
|
|
632
|
+
function compileGlobPattern(params) {
|
|
633
|
+
const normalized = params.normalize(params.raw);
|
|
634
|
+
if (!normalized) return {
|
|
635
|
+
kind: "exact",
|
|
636
|
+
value: ""
|
|
637
|
+
};
|
|
638
|
+
if (normalized === "*") return { kind: "all" };
|
|
639
|
+
if (!normalized.includes("*")) return {
|
|
640
|
+
kind: "exact",
|
|
641
|
+
value: normalized
|
|
642
|
+
};
|
|
643
|
+
return {
|
|
644
|
+
kind: "regex",
|
|
645
|
+
value: new RegExp(`^${escapeRegex(normalized).replaceAll("\\*", ".*")}$`)
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
function compileGlobPatterns(params) {
|
|
649
|
+
if (!Array.isArray(params.raw)) return [];
|
|
650
|
+
return params.raw.map((raw) => compileGlobPattern({
|
|
651
|
+
raw,
|
|
652
|
+
normalize: params.normalize
|
|
653
|
+
})).filter((pattern) => pattern.kind !== "exact" || pattern.value);
|
|
654
|
+
}
|
|
655
|
+
function matchesAnyGlobPattern(value, patterns) {
|
|
656
|
+
for (const pattern of patterns) {
|
|
657
|
+
if (pattern.kind === "all") return true;
|
|
658
|
+
if (pattern.kind === "exact" && value === pattern.value) return true;
|
|
659
|
+
if (pattern.kind === "regex" && pattern.value.test(value)) return true;
|
|
660
|
+
}
|
|
661
|
+
return false;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
//#endregion
|
|
665
|
+
//#region src/agents/tool-policy-shared.ts
|
|
666
|
+
const TOOL_NAME_ALIASES = {};
|
|
667
|
+
const TOOL_GROUPS = { ...CORE_TOOL_GROUPS };
|
|
668
|
+
function normalizeToolName(name) {
|
|
669
|
+
const normalized = name.trim().toLowerCase();
|
|
670
|
+
return TOOL_NAME_ALIASES[normalized] ?? normalized;
|
|
671
|
+
}
|
|
672
|
+
function normalizeToolList(list) {
|
|
673
|
+
if (!list) return [];
|
|
674
|
+
return list.map(normalizeToolName).filter(Boolean);
|
|
675
|
+
}
|
|
676
|
+
function expandToolGroups(list) {
|
|
677
|
+
const normalized = normalizeToolList(list);
|
|
678
|
+
const expanded = [];
|
|
679
|
+
for (const value of normalized) {
|
|
680
|
+
const group = TOOL_GROUPS[value];
|
|
681
|
+
if (group) {
|
|
682
|
+
expanded.push(...group);
|
|
683
|
+
continue;
|
|
684
|
+
}
|
|
685
|
+
expanded.push(value);
|
|
686
|
+
}
|
|
687
|
+
return Array.from(new Set(expanded));
|
|
688
|
+
}
|
|
689
|
+
function resolveToolProfilePolicy(profile) {
|
|
690
|
+
return resolveCoreToolProfilePolicy(profile);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
//#endregion
|
|
694
|
+
//#region src/agents/tool-policy.ts
|
|
695
|
+
function collectExplicitAllowlist(policies) {
|
|
696
|
+
const entries = [];
|
|
697
|
+
for (const policy of policies) {
|
|
698
|
+
if (!policy?.allow) continue;
|
|
699
|
+
for (const value of policy.allow) {
|
|
700
|
+
if (typeof value !== "string") continue;
|
|
701
|
+
const trimmed = value.trim();
|
|
702
|
+
if (trimmed) entries.push(trimmed);
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
return entries;
|
|
706
|
+
}
|
|
707
|
+
function buildPluginToolGroups(params) {
|
|
708
|
+
const all = [];
|
|
709
|
+
const byPlugin = /* @__PURE__ */ new Map();
|
|
710
|
+
for (const tool of params.tools) {
|
|
711
|
+
const meta = params.toolMeta(tool);
|
|
712
|
+
if (!meta) continue;
|
|
713
|
+
const name = normalizeToolName(tool.name);
|
|
714
|
+
all.push(name);
|
|
715
|
+
const pluginId = meta.pluginId.toLowerCase();
|
|
716
|
+
const list = byPlugin.get(pluginId) ?? [];
|
|
717
|
+
list.push(name);
|
|
718
|
+
byPlugin.set(pluginId, list);
|
|
719
|
+
}
|
|
720
|
+
return {
|
|
721
|
+
all,
|
|
722
|
+
byPlugin
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
function expandPluginGroups(list, groups) {
|
|
726
|
+
if (!list || list.length === 0) return list;
|
|
727
|
+
const expanded = [];
|
|
728
|
+
for (const entry of list) {
|
|
729
|
+
const normalized = normalizeToolName(entry);
|
|
730
|
+
if (normalized === "group:plugins") {
|
|
731
|
+
if (groups.all.length > 0) expanded.push(...groups.all);
|
|
732
|
+
else expanded.push(normalized);
|
|
733
|
+
continue;
|
|
734
|
+
}
|
|
735
|
+
const tools = groups.byPlugin.get(normalized);
|
|
736
|
+
if (tools && tools.length > 0) {
|
|
737
|
+
expanded.push(...tools);
|
|
738
|
+
continue;
|
|
739
|
+
}
|
|
740
|
+
expanded.push(normalized);
|
|
741
|
+
}
|
|
742
|
+
return Array.from(new Set(expanded));
|
|
743
|
+
}
|
|
744
|
+
function expandPolicyWithPluginGroups(policy, groups) {
|
|
745
|
+
if (!policy) return;
|
|
746
|
+
return {
|
|
747
|
+
allow: expandPluginGroups(policy.allow, groups),
|
|
748
|
+
deny: expandPluginGroups(policy.deny, groups)
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
function stripPluginOnlyAllowlist(policy, groups, coreTools) {
|
|
752
|
+
if (!policy?.allow || policy.allow.length === 0) return {
|
|
753
|
+
policy,
|
|
754
|
+
unknownAllowlist: [],
|
|
755
|
+
strippedAllowlist: false
|
|
756
|
+
};
|
|
757
|
+
const normalized = normalizeToolList(policy.allow);
|
|
758
|
+
if (normalized.length === 0) return {
|
|
759
|
+
policy,
|
|
760
|
+
unknownAllowlist: [],
|
|
761
|
+
strippedAllowlist: false
|
|
762
|
+
};
|
|
763
|
+
const pluginIds = new Set(groups.byPlugin.keys());
|
|
764
|
+
const pluginTools = new Set(groups.all);
|
|
765
|
+
const unknownAllowlist = [];
|
|
766
|
+
let hasCoreEntry = false;
|
|
767
|
+
for (const entry of normalized) {
|
|
768
|
+
if (entry === "*") {
|
|
769
|
+
hasCoreEntry = true;
|
|
770
|
+
continue;
|
|
771
|
+
}
|
|
772
|
+
const isPluginEntry = entry === "group:plugins" || pluginIds.has(entry) || pluginTools.has(entry);
|
|
773
|
+
const isCoreEntry = expandToolGroups([entry]).some((tool) => coreTools.has(tool));
|
|
774
|
+
if (isCoreEntry) hasCoreEntry = true;
|
|
775
|
+
if (!isCoreEntry && !isPluginEntry) unknownAllowlist.push(entry);
|
|
776
|
+
}
|
|
777
|
+
const strippedAllowlist = !hasCoreEntry;
|
|
778
|
+
if (strippedAllowlist) {}
|
|
779
|
+
return {
|
|
780
|
+
policy: strippedAllowlist ? {
|
|
781
|
+
...policy,
|
|
782
|
+
allow: void 0
|
|
783
|
+
} : policy,
|
|
784
|
+
unknownAllowlist: Array.from(new Set(unknownAllowlist)),
|
|
785
|
+
strippedAllowlist
|
|
786
|
+
};
|
|
787
|
+
}
|
|
788
|
+
function mergeAlsoAllowPolicy(policy, alsoAllow) {
|
|
789
|
+
if (!policy?.allow || !Array.isArray(alsoAllow) || alsoAllow.length === 0) return policy;
|
|
790
|
+
return {
|
|
791
|
+
...policy,
|
|
792
|
+
allow: Array.from(new Set([...policy.allow, ...alsoAllow]))
|
|
793
|
+
};
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
//#endregion
|
|
797
|
+
//#region src/agents/tool-policy-resolution.ts
|
|
798
|
+
function normalizeToolPolicy$2(config) {
|
|
799
|
+
if (!config) return;
|
|
800
|
+
const allow = Array.isArray(config.allow) ? config.allow : void 0;
|
|
801
|
+
const deny = Array.isArray(config.deny) ? config.deny : void 0;
|
|
802
|
+
if (!allow && !deny) return;
|
|
803
|
+
return {
|
|
804
|
+
allow,
|
|
805
|
+
deny
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
function makeToolPolicyMatcher(policy) {
|
|
809
|
+
const deny = compileGlobPatterns({
|
|
810
|
+
raw: expandToolGroups(policy.deny ?? []),
|
|
811
|
+
normalize: normalizeToolName
|
|
812
|
+
});
|
|
813
|
+
const allow = compileGlobPatterns({
|
|
814
|
+
raw: expandToolGroups(policy.allow ?? []),
|
|
815
|
+
normalize: normalizeToolName
|
|
816
|
+
});
|
|
817
|
+
return (name) => {
|
|
818
|
+
const normalized = normalizeToolName(name);
|
|
819
|
+
if (matchesAnyGlobPattern(normalized, deny)) return false;
|
|
820
|
+
if (allow.length === 0) return true;
|
|
821
|
+
if (matchesAnyGlobPattern(normalized, allow)) return true;
|
|
822
|
+
return false;
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Tools always denied for sub-agents regardless of depth.
|
|
827
|
+
* These are system-level or interactive tools that sub-agents should never use.
|
|
828
|
+
*/
|
|
829
|
+
const SUBAGENT_TOOL_DENY_ALWAYS = [
|
|
830
|
+
"gateway",
|
|
831
|
+
"agents_list",
|
|
832
|
+
"whatsapp_login",
|
|
833
|
+
"session_status",
|
|
834
|
+
"cron",
|
|
835
|
+
"sessions_send"
|
|
836
|
+
];
|
|
837
|
+
/**
|
|
838
|
+
* Additional tools denied for leaf sub-agents (depth >= maxSpawnDepth).
|
|
839
|
+
* These are tools that only make sense for orchestrator sub-agents that can spawn children.
|
|
840
|
+
*/
|
|
841
|
+
const SUBAGENT_TOOL_DENY_LEAF = [
|
|
842
|
+
"sessions_list",
|
|
843
|
+
"sessions_history",
|
|
844
|
+
"sessions_spawn"
|
|
845
|
+
];
|
|
846
|
+
/**
|
|
847
|
+
* Build the deny list for a sub-agent at a given depth.
|
|
848
|
+
*
|
|
849
|
+
* - Depth 1 with maxSpawnDepth >= 2 (orchestrator): allowed to use sessions_spawn,
|
|
850
|
+
* subagents, sessions_list, sessions_history so it can manage its children.
|
|
851
|
+
* - Depth >= maxSpawnDepth (leaf): denied sessions_spawn and
|
|
852
|
+
* session management tools. Still allowed subagents (for list/status visibility).
|
|
853
|
+
*/
|
|
854
|
+
function resolveSubagentDenyList(depth, maxSpawnDepth) {
|
|
855
|
+
if (depth >= Math.max(1, Math.floor(maxSpawnDepth))) return [...SUBAGENT_TOOL_DENY_ALWAYS, ...SUBAGENT_TOOL_DENY_LEAF];
|
|
856
|
+
return [...SUBAGENT_TOOL_DENY_ALWAYS];
|
|
857
|
+
}
|
|
858
|
+
function resolveSubagentToolPolicy(cfg, depth) {
|
|
859
|
+
const configured = cfg?.tools?.subagents?.tools;
|
|
860
|
+
const maxSpawnDepth = cfg?.agents?.defaults?.subagents?.maxSpawnDepth ?? DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH;
|
|
861
|
+
const baseDeny = resolveSubagentDenyList(typeof depth === "number" && depth >= 0 ? depth : 1, maxSpawnDepth);
|
|
862
|
+
const allow = Array.isArray(configured?.allow) ? configured.allow : void 0;
|
|
863
|
+
const alsoAllow = Array.isArray(configured?.alsoAllow) ? configured.alsoAllow : void 0;
|
|
864
|
+
const explicitAllow = new Set([...allow ?? [], ...alsoAllow ?? []].map((toolName) => normalizeToolName(toolName)));
|
|
865
|
+
const deny = [...baseDeny.filter((toolName) => !explicitAllow.has(normalizeToolName(toolName))), ...Array.isArray(configured?.deny) ? configured.deny : []];
|
|
866
|
+
return {
|
|
867
|
+
allow: allow && alsoAllow ? Array.from(new Set([...allow, ...alsoAllow])) : allow,
|
|
868
|
+
deny
|
|
869
|
+
};
|
|
870
|
+
}
|
|
871
|
+
function isToolAllowedByPolicyName(name, policy) {
|
|
872
|
+
if (!policy) return true;
|
|
873
|
+
return makeToolPolicyMatcher(policy)(name);
|
|
874
|
+
}
|
|
875
|
+
function filterToolsByPolicy(tools, policy) {
|
|
876
|
+
if (!policy) return tools;
|
|
877
|
+
const matcher = makeToolPolicyMatcher(policy);
|
|
878
|
+
return tools.filter((tool) => matcher(tool.name));
|
|
879
|
+
}
|
|
880
|
+
function normalizeProviderKey(value) {
|
|
881
|
+
return value.trim().toLowerCase();
|
|
882
|
+
}
|
|
883
|
+
function resolveGroupContextFromSessionKey(sessionKey) {
|
|
884
|
+
const raw = (sessionKey ?? "").trim();
|
|
885
|
+
if (!raw) return {};
|
|
886
|
+
const parts = (resolveThreadParentSessionKey(raw) ?? raw).split(":").filter(Boolean);
|
|
887
|
+
let body = parts[0] === "agent" ? parts.slice(2) : parts;
|
|
888
|
+
if (body[0] === "subagent") body = body.slice(1);
|
|
889
|
+
if (body.length < 3) return {};
|
|
890
|
+
const [channel, kind, ...rest] = body;
|
|
891
|
+
if (kind !== "group" && kind !== "channel") return {};
|
|
892
|
+
const groupId = rest.join(":").trim();
|
|
893
|
+
if (!groupId) return {};
|
|
894
|
+
return {
|
|
895
|
+
channel: channel.trim().toLowerCase(),
|
|
896
|
+
groupId
|
|
897
|
+
};
|
|
898
|
+
}
|
|
899
|
+
function resolveProviderToolPolicy(params) {
|
|
900
|
+
const provider = params.modelProvider?.trim();
|
|
901
|
+
if (!provider || !params.byProvider) return;
|
|
902
|
+
const entries = Object.entries(params.byProvider);
|
|
903
|
+
if (entries.length === 0) return;
|
|
904
|
+
const lookup = /* @__PURE__ */ new Map();
|
|
905
|
+
for (const [key, value] of entries) {
|
|
906
|
+
const normalized = normalizeProviderKey(key);
|
|
907
|
+
if (!normalized) continue;
|
|
908
|
+
lookup.set(normalized, value);
|
|
909
|
+
}
|
|
910
|
+
const normalizedProvider = normalizeProviderKey(provider);
|
|
911
|
+
const rawModelId = params.modelId?.trim().toLowerCase();
|
|
912
|
+
const fullModelId = rawModelId && !rawModelId.includes("/") ? `${normalizedProvider}/${rawModelId}` : rawModelId;
|
|
913
|
+
const candidates = [...fullModelId ? [fullModelId] : [], normalizedProvider];
|
|
914
|
+
for (const key of candidates) {
|
|
915
|
+
const match = lookup.get(key);
|
|
916
|
+
if (match) return match;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
function resolveEffectiveToolPolicy(params) {
|
|
920
|
+
const agentId = (typeof params.agentId === "string" && params.agentId.trim() ? normalizeAgentId(params.agentId) : void 0) ?? (params.sessionKey ? resolveAgentIdFromSessionKey(params.sessionKey) : void 0);
|
|
921
|
+
const agentTools = (params.config && agentId ? resolveAgentConfig(params.config, agentId) : void 0)?.tools;
|
|
922
|
+
const globalTools = params.config?.tools;
|
|
923
|
+
const profile = agentTools?.profile ?? globalTools?.profile;
|
|
924
|
+
const providerPolicy = resolveProviderToolPolicy({
|
|
925
|
+
byProvider: globalTools?.byProvider,
|
|
926
|
+
modelProvider: params.modelProvider,
|
|
927
|
+
modelId: params.modelId
|
|
928
|
+
});
|
|
929
|
+
const agentProviderPolicy = resolveProviderToolPolicy({
|
|
930
|
+
byProvider: agentTools?.byProvider,
|
|
931
|
+
modelProvider: params.modelProvider,
|
|
932
|
+
modelId: params.modelId
|
|
933
|
+
});
|
|
934
|
+
return {
|
|
935
|
+
agentId,
|
|
936
|
+
globalPolicy: normalizeToolPolicy$2(globalTools),
|
|
937
|
+
globalProviderPolicy: normalizeToolPolicy$2(providerPolicy),
|
|
938
|
+
agentPolicy: normalizeToolPolicy$2(agentTools),
|
|
939
|
+
agentProviderPolicy: normalizeToolPolicy$2(agentProviderPolicy),
|
|
940
|
+
profile,
|
|
941
|
+
providerProfile: agentProviderPolicy?.profile ?? providerPolicy?.profile,
|
|
942
|
+
profileAlsoAllow: Array.isArray(agentTools?.alsoAllow) ? agentTools?.alsoAllow : Array.isArray(globalTools?.alsoAllow) ? globalTools?.alsoAllow : void 0,
|
|
943
|
+
providerProfileAlsoAllow: Array.isArray(agentProviderPolicy?.alsoAllow) ? agentProviderPolicy?.alsoAllow : Array.isArray(providerPolicy?.alsoAllow) ? providerPolicy?.alsoAllow : void 0
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
function resolveGroupToolPolicy(params) {
|
|
947
|
+
if (!params.config) return;
|
|
948
|
+
const sessionContext = resolveGroupContextFromSessionKey(params.sessionKey);
|
|
949
|
+
const spawnedContext = resolveGroupContextFromSessionKey(params.spawnedBy);
|
|
950
|
+
const groupId = params.groupId ?? sessionContext.groupId ?? spawnedContext.groupId;
|
|
951
|
+
if (!groupId) return;
|
|
952
|
+
const channel = normalizeMessageChannel(params.messageProvider ?? sessionContext.channel ?? spawnedContext.channel);
|
|
953
|
+
if (!channel) return;
|
|
954
|
+
let dock;
|
|
955
|
+
try {
|
|
956
|
+
dock = getChannelDock(channel);
|
|
957
|
+
} catch {
|
|
958
|
+
dock = void 0;
|
|
959
|
+
}
|
|
960
|
+
return normalizeToolPolicy$2(dock?.groups?.resolveToolPolicy?.({
|
|
961
|
+
cfg: params.config,
|
|
962
|
+
groupId,
|
|
963
|
+
groupChannel: params.groupChannel,
|
|
964
|
+
groupSpace: params.groupSpace,
|
|
965
|
+
accountId: params.accountId,
|
|
966
|
+
senderId: params.senderId,
|
|
967
|
+
senderName: params.senderName,
|
|
968
|
+
senderUsername: params.senderUsername,
|
|
969
|
+
senderE164: params.senderE164
|
|
970
|
+
}) ?? resolveChannelGroupToolsPolicy({
|
|
971
|
+
cfg: params.config,
|
|
972
|
+
channel,
|
|
973
|
+
groupId,
|
|
974
|
+
accountId: params.accountId,
|
|
975
|
+
senderId: params.senderId,
|
|
976
|
+
senderName: params.senderName,
|
|
977
|
+
senderUsername: params.senderUsername,
|
|
978
|
+
senderE164: params.senderE164
|
|
979
|
+
}));
|
|
980
|
+
}
|
|
981
|
+
function isToolAllowedByPolicies(name, policies) {
|
|
982
|
+
return policies.every((policy) => isToolAllowedByPolicyName(name, policy));
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
//#endregion
|
|
986
|
+
//#region src/shared/model-param-b.ts
|
|
987
|
+
function inferParamBFromIdOrName(text) {
|
|
988
|
+
const matches = text.toLowerCase().matchAll(/(?:^|[^a-z0-9])[a-z]?(\d+(?:\.\d+)?)b(?:[^a-z0-9]|$)/g);
|
|
989
|
+
let best = null;
|
|
990
|
+
for (const match of matches) {
|
|
991
|
+
const numRaw = match[1];
|
|
992
|
+
if (!numRaw) continue;
|
|
993
|
+
const value = Number(numRaw);
|
|
994
|
+
if (!Number.isFinite(value) || value <= 0) continue;
|
|
995
|
+
if (best === null || value > best) best = value;
|
|
996
|
+
}
|
|
997
|
+
return best;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
//#endregion
|
|
1001
|
+
//#region src/security/audit-extra.sync.ts
|
|
1002
|
+
/**
|
|
1003
|
+
* Synchronous security audit collector functions.
|
|
1004
|
+
*
|
|
1005
|
+
* These functions analyze config-based security properties without I/O.
|
|
1006
|
+
*/
|
|
1007
|
+
const resolveSandboxConfigForAgent$1 = (_cfg, _agentId) => ({
|
|
1008
|
+
mode: "off",
|
|
1009
|
+
workspaceAccess: void 0,
|
|
1010
|
+
docker: void 0,
|
|
1011
|
+
browser: {
|
|
1012
|
+
enabled: false,
|
|
1013
|
+
network: "",
|
|
1014
|
+
cdpSourceRange: void 0
|
|
1015
|
+
},
|
|
1016
|
+
prune: void 0,
|
|
1017
|
+
scope: void 0
|
|
1018
|
+
});
|
|
1019
|
+
const resolveToolPolicyForAgent$1 = (_cfg, _agentId) => void 0;
|
|
1020
|
+
const isDangerousNetworkMode = (_mode) => false;
|
|
1021
|
+
const normalizeNetworkMode = (_mode) => void 0;
|
|
1022
|
+
const getBlockedBindReason = (_bind) => void 0;
|
|
1023
|
+
function normalizeToolPolicy$1(config) {
|
|
1024
|
+
if (!config) return;
|
|
1025
|
+
const allow = Array.isArray(config.allow) ? config.allow : void 0;
|
|
1026
|
+
const deny = Array.isArray(config.deny) ? config.deny : void 0;
|
|
1027
|
+
if (!allow && !deny) return;
|
|
1028
|
+
return {
|
|
1029
|
+
allow,
|
|
1030
|
+
deny
|
|
1031
|
+
};
|
|
1032
|
+
}
|
|
1033
|
+
const SMALL_MODEL_PARAM_B_MAX = 300;
|
|
1034
|
+
function summarizeGroupPolicy(cfg) {
|
|
1035
|
+
const channels = cfg.channels;
|
|
1036
|
+
if (!channels || typeof channels !== "object") return {
|
|
1037
|
+
open: 0,
|
|
1038
|
+
allowlist: 0,
|
|
1039
|
+
other: 0
|
|
1040
|
+
};
|
|
1041
|
+
let open = 0;
|
|
1042
|
+
let allowlist = 0;
|
|
1043
|
+
let other = 0;
|
|
1044
|
+
for (const value of Object.values(channels)) {
|
|
1045
|
+
if (!value || typeof value !== "object") continue;
|
|
1046
|
+
const policy = value.groupPolicy;
|
|
1047
|
+
if (policy === "open") open += 1;
|
|
1048
|
+
else if (policy === "allowlist") allowlist += 1;
|
|
1049
|
+
else other += 1;
|
|
1050
|
+
}
|
|
1051
|
+
return {
|
|
1052
|
+
open,
|
|
1053
|
+
allowlist,
|
|
1054
|
+
other
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
1057
|
+
function isProbablySyncedPath(p) {
|
|
1058
|
+
const s = p.toLowerCase();
|
|
1059
|
+
return s.includes("icloud") || s.includes("dropbox") || s.includes("google drive") || s.includes("googledrive") || s.includes("onedrive");
|
|
1060
|
+
}
|
|
1061
|
+
function looksLikeEnvRef(value) {
|
|
1062
|
+
const v = value.trim();
|
|
1063
|
+
return v.startsWith("${") && v.endsWith("}");
|
|
1064
|
+
}
|
|
1065
|
+
function isGatewayRemotelyExposed(cfg) {
|
|
1066
|
+
if ((typeof cfg.gateway?.bind === "string" ? cfg.gateway.bind : "loopback") !== "loopback") return true;
|
|
1067
|
+
const tailscaleMode = cfg.gateway?.tailscale?.mode ?? "off";
|
|
1068
|
+
return tailscaleMode === "serve" || tailscaleMode === "funnel";
|
|
1069
|
+
}
|
|
1070
|
+
function addModel(models, raw, source) {
|
|
1071
|
+
if (typeof raw !== "string") return;
|
|
1072
|
+
const id = raw.trim();
|
|
1073
|
+
if (!id) return;
|
|
1074
|
+
models.push({
|
|
1075
|
+
id,
|
|
1076
|
+
source
|
|
1077
|
+
});
|
|
1078
|
+
}
|
|
1079
|
+
function collectModels(cfg) {
|
|
1080
|
+
const out = [];
|
|
1081
|
+
addModel(out, resolveAgentModelPrimaryValue(cfg.agents?.defaults?.model), "agents.defaults.model.primary");
|
|
1082
|
+
for (const f of resolveAgentModelFallbackValues(cfg.agents?.defaults?.model)) addModel(out, f, "agents.defaults.model.fallbacks");
|
|
1083
|
+
addModel(out, resolveAgentModelPrimaryValue(cfg.agents?.defaults?.imageModel), "agents.defaults.imageModel.primary");
|
|
1084
|
+
for (const f of resolveAgentModelFallbackValues(cfg.agents?.defaults?.imageModel)) addModel(out, f, "agents.defaults.imageModel.fallbacks");
|
|
1085
|
+
const list = Array.isArray(cfg.agents?.list) ? cfg.agents?.list : [];
|
|
1086
|
+
for (const agent of list ?? []) {
|
|
1087
|
+
if (!agent || typeof agent !== "object") continue;
|
|
1088
|
+
const id = typeof agent.id === "string" ? agent.id : "";
|
|
1089
|
+
const model = agent.model;
|
|
1090
|
+
if (typeof model === "string") addModel(out, model, `agents.list.${id}.model`);
|
|
1091
|
+
else if (model && typeof model === "object") {
|
|
1092
|
+
addModel(out, model.primary, `agents.list.${id}.model.primary`);
|
|
1093
|
+
const fallbacks = model.fallbacks;
|
|
1094
|
+
if (Array.isArray(fallbacks)) for (const f of fallbacks) addModel(out, f, `agents.list.${id}.model.fallbacks`);
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
return out;
|
|
1098
|
+
}
|
|
1099
|
+
const LEGACY_MODEL_PATTERNS = [
|
|
1100
|
+
{
|
|
1101
|
+
id: "openai.gpt35",
|
|
1102
|
+
re: /\bgpt-3\.5\b/i,
|
|
1103
|
+
label: "GPT-3.5 family"
|
|
1104
|
+
},
|
|
1105
|
+
{
|
|
1106
|
+
id: "anthropic.claude2",
|
|
1107
|
+
re: /\bclaude-(instant|2)\b/i,
|
|
1108
|
+
label: "Claude 2/Instant family"
|
|
1109
|
+
},
|
|
1110
|
+
{
|
|
1111
|
+
id: "openai.gpt4_legacy",
|
|
1112
|
+
re: /\bgpt-4-(0314|0613)\b/i,
|
|
1113
|
+
label: "Legacy GPT-4 snapshots"
|
|
1114
|
+
}
|
|
1115
|
+
];
|
|
1116
|
+
const WEAK_TIER_MODEL_PATTERNS = [{
|
|
1117
|
+
id: "anthropic.haiku",
|
|
1118
|
+
re: /\bhaiku\b/i,
|
|
1119
|
+
label: "Haiku tier (smaller model)"
|
|
1120
|
+
}];
|
|
1121
|
+
function isGptModel(id) {
|
|
1122
|
+
return /\bgpt-/i.test(id);
|
|
1123
|
+
}
|
|
1124
|
+
function isGpt5OrHigher(id) {
|
|
1125
|
+
return /\bgpt-5(?:\b|[.-])/i.test(id);
|
|
1126
|
+
}
|
|
1127
|
+
function isClaudeModel(id) {
|
|
1128
|
+
return /\bclaude-/i.test(id);
|
|
1129
|
+
}
|
|
1130
|
+
function isClaude45OrHigher(id) {
|
|
1131
|
+
return /\bclaude-[^\s/]*?(?:-4-?(?:[5-9]|[1-9]\d)\b|4\.(?:[5-9]|[1-9]\d)\b|-[5-9](?:\b|[.-]))/i.test(id);
|
|
1132
|
+
}
|
|
1133
|
+
function extractAgentIdFromSource(source) {
|
|
1134
|
+
return source.match(/^agents\.list\.([^.]*)\./)?.[1] ?? null;
|
|
1135
|
+
}
|
|
1136
|
+
function hasConfiguredDockerConfig(docker) {
|
|
1137
|
+
if (!docker || typeof docker !== "object") return false;
|
|
1138
|
+
return Object.values(docker).some((value) => value !== void 0);
|
|
1139
|
+
}
|
|
1140
|
+
function normalizeNodeCommand(value) {
|
|
1141
|
+
return typeof value === "string" ? value.trim() : "";
|
|
1142
|
+
}
|
|
1143
|
+
function listKnownNodeCommands(cfg) {
|
|
1144
|
+
const baseCfg = {
|
|
1145
|
+
...cfg,
|
|
1146
|
+
gateway: {
|
|
1147
|
+
...cfg.gateway,
|
|
1148
|
+
nodes: {
|
|
1149
|
+
...cfg.gateway?.nodes,
|
|
1150
|
+
denyCommands: []
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
};
|
|
1154
|
+
const out = /* @__PURE__ */ new Set();
|
|
1155
|
+
for (const platform of [
|
|
1156
|
+
"ios",
|
|
1157
|
+
"android",
|
|
1158
|
+
"macos",
|
|
1159
|
+
"linux",
|
|
1160
|
+
"windows",
|
|
1161
|
+
"unknown"
|
|
1162
|
+
]) {
|
|
1163
|
+
const allow = resolveNodeCommandAllowlist(baseCfg, { platform });
|
|
1164
|
+
for (const cmd of allow) {
|
|
1165
|
+
const normalized = normalizeNodeCommand(cmd);
|
|
1166
|
+
if (normalized) out.add(normalized);
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
return out;
|
|
1170
|
+
}
|
|
1171
|
+
function looksLikeNodeCommandPattern(value) {
|
|
1172
|
+
if (!value) return false;
|
|
1173
|
+
if (/[?*[\]{}(),|]/.test(value)) return true;
|
|
1174
|
+
if (value.startsWith("/") || value.endsWith("/") || value.startsWith("^") || value.endsWith("$")) return true;
|
|
1175
|
+
return /\s/.test(value) || value.includes("group:");
|
|
1176
|
+
}
|
|
1177
|
+
function resolveToolPolicies$1(params) {
|
|
1178
|
+
const policies = [];
|
|
1179
|
+
const profilePolicy = resolveToolProfilePolicy(params.agentTools?.profile ?? params.cfg.tools?.profile);
|
|
1180
|
+
if (profilePolicy) policies.push(profilePolicy);
|
|
1181
|
+
const globalPolicy = normalizeToolPolicy$1(params.cfg.tools ?? void 0);
|
|
1182
|
+
if (globalPolicy) policies.push(globalPolicy);
|
|
1183
|
+
const agentPolicy = normalizeToolPolicy$1(params.agentTools);
|
|
1184
|
+
if (agentPolicy) policies.push(agentPolicy);
|
|
1185
|
+
if (params.sandboxMode === "all") {
|
|
1186
|
+
const sandboxPolicy = resolveToolPolicyForAgent$1(params.cfg, params.agentId ?? void 0);
|
|
1187
|
+
if (sandboxPolicy) policies.push(sandboxPolicy);
|
|
1188
|
+
}
|
|
1189
|
+
return policies;
|
|
1190
|
+
}
|
|
1191
|
+
function isBrowserEnabled(cfg) {
|
|
1192
|
+
try {
|
|
1193
|
+
return resolveBrowserConfig(cfg.browser, cfg).enabled;
|
|
1194
|
+
} catch {
|
|
1195
|
+
return true;
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
function listGroupPolicyOpen(cfg) {
|
|
1199
|
+
const out = [];
|
|
1200
|
+
const channels = cfg.channels;
|
|
1201
|
+
if (!channels || typeof channels !== "object") return out;
|
|
1202
|
+
for (const [channelId, value] of Object.entries(channels)) {
|
|
1203
|
+
if (!value || typeof value !== "object") continue;
|
|
1204
|
+
const section = value;
|
|
1205
|
+
if (section.groupPolicy === "open") out.push(`channels.${channelId}.groupPolicy`);
|
|
1206
|
+
const accounts = section.accounts;
|
|
1207
|
+
if (accounts && typeof accounts === "object") for (const [accountId, accountVal] of Object.entries(accounts)) {
|
|
1208
|
+
if (!accountVal || typeof accountVal !== "object") continue;
|
|
1209
|
+
if (accountVal.groupPolicy === "open") out.push(`channels.${channelId}.accounts.${accountId}.groupPolicy`);
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
return out;
|
|
1213
|
+
}
|
|
1214
|
+
function hasConfiguredGroupTargets(section) {
|
|
1215
|
+
return [
|
|
1216
|
+
"groups",
|
|
1217
|
+
"guilds",
|
|
1218
|
+
"channels",
|
|
1219
|
+
"rooms"
|
|
1220
|
+
].some((key) => {
|
|
1221
|
+
const value = section[key];
|
|
1222
|
+
return Boolean(value && typeof value === "object" && Object.keys(value).length > 0);
|
|
1223
|
+
});
|
|
1224
|
+
}
|
|
1225
|
+
function listPotentialMultiUserSignals(cfg) {
|
|
1226
|
+
const out = /* @__PURE__ */ new Set();
|
|
1227
|
+
const channels = cfg.channels;
|
|
1228
|
+
if (!channels || typeof channels !== "object") return [];
|
|
1229
|
+
const inspectSection = (section, basePath) => {
|
|
1230
|
+
const groupPolicy = typeof section.groupPolicy === "string" ? section.groupPolicy : null;
|
|
1231
|
+
if (groupPolicy === "open") out.add(`${basePath}.groupPolicy="open"`);
|
|
1232
|
+
else if (groupPolicy === "allowlist" && hasConfiguredGroupTargets(section)) out.add(`${basePath}.groupPolicy="allowlist" with configured group targets`);
|
|
1233
|
+
if ((typeof section.dmPolicy === "string" ? section.dmPolicy : null) === "open") out.add(`${basePath}.dmPolicy="open"`);
|
|
1234
|
+
if ((Array.isArray(section.allowFrom) ? section.allowFrom : []).some((entry) => String(entry).trim() === "*")) out.add(`${basePath}.allowFrom includes "*"`);
|
|
1235
|
+
if ((Array.isArray(section.groupAllowFrom) ? section.groupAllowFrom : []).some((entry) => String(entry).trim() === "*")) out.add(`${basePath}.groupAllowFrom includes "*"`);
|
|
1236
|
+
const dm = section.dm;
|
|
1237
|
+
if (dm && typeof dm === "object") {
|
|
1238
|
+
const dmSection = dm;
|
|
1239
|
+
if ((typeof dmSection.policy === "string" ? dmSection.policy : null) === "open") out.add(`${basePath}.dm.policy="open"`);
|
|
1240
|
+
if ((Array.isArray(dmSection.allowFrom) ? dmSection.allowFrom : []).some((entry) => String(entry).trim() === "*")) out.add(`${basePath}.dm.allowFrom includes "*"`);
|
|
1241
|
+
}
|
|
1242
|
+
};
|
|
1243
|
+
for (const [channelId, value] of Object.entries(channels)) {
|
|
1244
|
+
if (!value || typeof value !== "object") continue;
|
|
1245
|
+
const section = value;
|
|
1246
|
+
inspectSection(section, `channels.${channelId}`);
|
|
1247
|
+
const accounts = section.accounts;
|
|
1248
|
+
if (!accounts || typeof accounts !== "object") continue;
|
|
1249
|
+
for (const [accountId, accountValue] of Object.entries(accounts)) {
|
|
1250
|
+
if (!accountValue || typeof accountValue !== "object") continue;
|
|
1251
|
+
inspectSection(accountValue, `channels.${channelId}.accounts.${accountId}`);
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
return Array.from(out);
|
|
1255
|
+
}
|
|
1256
|
+
function collectRiskyToolExposureContexts(cfg) {
|
|
1257
|
+
const contexts = [{ label: "agents.defaults" }];
|
|
1258
|
+
for (const agent of cfg.agents?.list ?? []) {
|
|
1259
|
+
if (!agent || typeof agent !== "object" || typeof agent.id !== "string") continue;
|
|
1260
|
+
contexts.push({
|
|
1261
|
+
label: `agents.list.${agent.id}`,
|
|
1262
|
+
agentId: agent.id,
|
|
1263
|
+
tools: agent.tools
|
|
1264
|
+
});
|
|
1265
|
+
}
|
|
1266
|
+
const riskyContexts = [];
|
|
1267
|
+
let hasRuntimeRisk = false;
|
|
1268
|
+
for (const context of contexts) {
|
|
1269
|
+
const sandboxMode = resolveSandboxConfigForAgent$1(cfg, context.agentId).mode;
|
|
1270
|
+
const runtimeTools = [];
|
|
1271
|
+
if (!(runtimeTools.length > 0 && sandboxMode !== "all")) continue;
|
|
1272
|
+
hasRuntimeRisk = true;
|
|
1273
|
+
riskyContexts.push(`${context.label} (sandbox=${sandboxMode}; runtime=[${runtimeTools.join(", ") || "off"}])`);
|
|
1274
|
+
}
|
|
1275
|
+
return {
|
|
1276
|
+
riskyContexts,
|
|
1277
|
+
hasRuntimeRisk
|
|
1278
|
+
};
|
|
1279
|
+
}
|
|
1280
|
+
function collectAttackSurfaceSummaryFindings(cfg) {
|
|
1281
|
+
const group = summarizeGroupPolicy(cfg);
|
|
1282
|
+
const elevated = cfg.tools?.elevated?.enabled !== false;
|
|
1283
|
+
const webhooksEnabled = cfg.hooks?.enabled === true;
|
|
1284
|
+
const internalHooksEnabled = cfg.hooks?.internal?.enabled === true;
|
|
1285
|
+
const browserEnabled = cfg.browser?.enabled ?? true;
|
|
1286
|
+
return [{
|
|
1287
|
+
checkId: "summary.attack_surface",
|
|
1288
|
+
severity: "info",
|
|
1289
|
+
title: "Attack surface summary",
|
|
1290
|
+
detail: `groups: open=${group.open}, allowlist=${group.allowlist}\ntools.elevated: ${elevated ? "enabled" : "disabled"}\nhooks.webhooks: ${webhooksEnabled ? "enabled" : "disabled"}\nhooks.internal: ${internalHooksEnabled ? "enabled" : "disabled"}\nbrowser control: ${browserEnabled ? "enabled" : "disabled"}\ntrust model: personal assistant (one trusted operator boundary), not hostile multi-tenant on one shared gateway`
|
|
1291
|
+
}];
|
|
1292
|
+
}
|
|
1293
|
+
function collectSyncedFolderFindings(params) {
|
|
1294
|
+
const findings = [];
|
|
1295
|
+
if (isProbablySyncedPath(params.stateDir) || isProbablySyncedPath(params.configPath)) findings.push({
|
|
1296
|
+
checkId: "fs.synced_dir",
|
|
1297
|
+
severity: "warn",
|
|
1298
|
+
title: "State/config path looks like a synced folder",
|
|
1299
|
+
detail: `stateDir=${params.stateDir}, configPath=${params.configPath}. Synced folders (iCloud/Dropbox/OneDrive/Google Drive) can leak tokens and transcripts onto other devices.`,
|
|
1300
|
+
remediation: `Keep REMOTECLAW_STATE_DIR on a local-only volume and re-run "${formatCliCommand("remoteclaw security audit --fix")}".`
|
|
1301
|
+
});
|
|
1302
|
+
return findings;
|
|
1303
|
+
}
|
|
1304
|
+
function collectSecretsInConfigFindings(cfg) {
|
|
1305
|
+
const findings = [];
|
|
1306
|
+
const password = typeof cfg.gateway?.auth?.password === "string" ? cfg.gateway.auth.password.trim() : "";
|
|
1307
|
+
if (password && !looksLikeEnvRef(password)) findings.push({
|
|
1308
|
+
checkId: "config.secrets.gateway_password_in_config",
|
|
1309
|
+
severity: "warn",
|
|
1310
|
+
title: "Gateway password is stored in config",
|
|
1311
|
+
detail: "gateway.auth.password is set in the config file; prefer environment variables for secrets when possible.",
|
|
1312
|
+
remediation: "Prefer REMOTECLAW_GATEWAY_PASSWORD (env) and remove gateway.auth.password from disk."
|
|
1313
|
+
});
|
|
1314
|
+
const hooksToken = typeof cfg.hooks?.token === "string" ? cfg.hooks.token.trim() : "";
|
|
1315
|
+
if (cfg.hooks?.enabled === true && hooksToken && !looksLikeEnvRef(hooksToken)) findings.push({
|
|
1316
|
+
checkId: "config.secrets.hooks_token_in_config",
|
|
1317
|
+
severity: "info",
|
|
1318
|
+
title: "Hooks token is stored in config",
|
|
1319
|
+
detail: "hooks.token is set in the config file; keep config perms tight and treat it like an API secret."
|
|
1320
|
+
});
|
|
1321
|
+
return findings;
|
|
1322
|
+
}
|
|
1323
|
+
function collectHooksHardeningFindings(cfg, env = process.env) {
|
|
1324
|
+
const findings = [];
|
|
1325
|
+
if (cfg.hooks?.enabled !== true) return findings;
|
|
1326
|
+
const token = typeof cfg.hooks?.token === "string" ? cfg.hooks.token.trim() : "";
|
|
1327
|
+
if (token && token.length < 24) findings.push({
|
|
1328
|
+
checkId: "hooks.token_too_short",
|
|
1329
|
+
severity: "warn",
|
|
1330
|
+
title: "Hooks token looks short",
|
|
1331
|
+
detail: `hooks.token is ${token.length} chars; prefer a long random token.`
|
|
1332
|
+
});
|
|
1333
|
+
const gatewayAuth = resolveGatewayAuth({
|
|
1334
|
+
authConfig: cfg.gateway?.auth,
|
|
1335
|
+
tailscaleMode: cfg.gateway?.tailscale?.mode ?? "off",
|
|
1336
|
+
env
|
|
1337
|
+
});
|
|
1338
|
+
const remoteclawGatewayToken = typeof env.REMOTECLAW_GATEWAY_TOKEN === "string" && env.REMOTECLAW_GATEWAY_TOKEN.trim() ? env.REMOTECLAW_GATEWAY_TOKEN.trim() : null;
|
|
1339
|
+
const gatewayToken = gatewayAuth.mode === "token" && typeof gatewayAuth.token === "string" && gatewayAuth.token.trim() ? gatewayAuth.token.trim() : remoteclawGatewayToken ? remoteclawGatewayToken : null;
|
|
1340
|
+
if (token && gatewayToken && token === gatewayToken) findings.push({
|
|
1341
|
+
checkId: "hooks.token_reuse_gateway_token",
|
|
1342
|
+
severity: "critical",
|
|
1343
|
+
title: "Hooks token reuses the Gateway token",
|
|
1344
|
+
detail: "hooks.token matches gateway.auth token; compromise of hooks expands blast radius to the Gateway API.",
|
|
1345
|
+
remediation: "Use a separate hooks.token dedicated to hook ingress."
|
|
1346
|
+
});
|
|
1347
|
+
if ((typeof cfg.hooks?.path === "string" ? cfg.hooks.path.trim() : "") === "/") findings.push({
|
|
1348
|
+
checkId: "hooks.path_root",
|
|
1349
|
+
severity: "critical",
|
|
1350
|
+
title: "Hooks base path is '/'",
|
|
1351
|
+
detail: "hooks.path='/' would shadow other HTTP endpoints and is unsafe.",
|
|
1352
|
+
remediation: "Use a dedicated path like '/hooks'."
|
|
1353
|
+
});
|
|
1354
|
+
const allowRequestSessionKey = cfg.hooks?.allowRequestSessionKey === true;
|
|
1355
|
+
const defaultSessionKey = typeof cfg.hooks?.defaultSessionKey === "string" ? cfg.hooks.defaultSessionKey.trim() : "";
|
|
1356
|
+
const allowedPrefixes = Array.isArray(cfg.hooks?.allowedSessionKeyPrefixes) ? cfg.hooks.allowedSessionKeyPrefixes.map((prefix) => prefix.trim()).filter((prefix) => prefix.length > 0) : [];
|
|
1357
|
+
const remoteExposure = isGatewayRemotelyExposed(cfg);
|
|
1358
|
+
if (!defaultSessionKey) findings.push({
|
|
1359
|
+
checkId: "hooks.default_session_key_unset",
|
|
1360
|
+
severity: "warn",
|
|
1361
|
+
title: "hooks.defaultSessionKey is not configured",
|
|
1362
|
+
detail: "Hook agent runs without explicit sessionKey use generated per-request keys. Set hooks.defaultSessionKey to keep hook ingress scoped to a known session.",
|
|
1363
|
+
remediation: "Set hooks.defaultSessionKey (for example, \"hook:ingress\")."
|
|
1364
|
+
});
|
|
1365
|
+
if (allowRequestSessionKey) findings.push({
|
|
1366
|
+
checkId: "hooks.request_session_key_enabled",
|
|
1367
|
+
severity: remoteExposure ? "critical" : "warn",
|
|
1368
|
+
title: "External hook payloads may override sessionKey",
|
|
1369
|
+
detail: "hooks.allowRequestSessionKey=true allows `/hooks/agent` callers to choose the session key. Treat hook token holders as full-trust unless you also restrict prefixes.",
|
|
1370
|
+
remediation: "Set hooks.allowRequestSessionKey=false (recommended) or constrain hooks.allowedSessionKeyPrefixes."
|
|
1371
|
+
});
|
|
1372
|
+
if (allowRequestSessionKey && allowedPrefixes.length === 0) findings.push({
|
|
1373
|
+
checkId: "hooks.request_session_key_prefixes_missing",
|
|
1374
|
+
severity: remoteExposure ? "critical" : "warn",
|
|
1375
|
+
title: "Request sessionKey override is enabled without prefix restrictions",
|
|
1376
|
+
detail: "hooks.allowRequestSessionKey=true and hooks.allowedSessionKeyPrefixes is unset/empty, so request payloads can target arbitrary session key shapes.",
|
|
1377
|
+
remediation: "Set hooks.allowedSessionKeyPrefixes (for example, [\"hook:\"]) or disable request overrides."
|
|
1378
|
+
});
|
|
1379
|
+
return findings;
|
|
1380
|
+
}
|
|
1381
|
+
function collectGatewayHttpSessionKeyOverrideFindings(cfg) {
|
|
1382
|
+
const findings = [];
|
|
1383
|
+
const chatCompletionsEnabled = cfg.gateway?.http?.endpoints?.chatCompletions?.enabled === true;
|
|
1384
|
+
const responsesEnabled = cfg.gateway?.http?.endpoints?.responses?.enabled === true;
|
|
1385
|
+
if (!chatCompletionsEnabled && !responsesEnabled) return findings;
|
|
1386
|
+
const enabledEndpoints = [chatCompletionsEnabled ? "/v1/chat/completions" : null, responsesEnabled ? "/v1/responses" : null].filter((entry) => Boolean(entry));
|
|
1387
|
+
findings.push({
|
|
1388
|
+
checkId: "gateway.http.session_key_override_enabled",
|
|
1389
|
+
severity: "info",
|
|
1390
|
+
title: "HTTP API session-key override is enabled",
|
|
1391
|
+
detail: `${enabledEndpoints.join(", ")} accept x-remoteclaw-session-key for per-request session routing. Treat API credential holders as trusted principals.`
|
|
1392
|
+
});
|
|
1393
|
+
return findings;
|
|
1394
|
+
}
|
|
1395
|
+
function collectGatewayHttpNoAuthFindings(cfg, env) {
|
|
1396
|
+
const findings = [];
|
|
1397
|
+
const tailscaleMode = cfg.gateway?.tailscale?.mode ?? "off";
|
|
1398
|
+
if (resolveGatewayAuth({
|
|
1399
|
+
authConfig: cfg.gateway?.auth,
|
|
1400
|
+
tailscaleMode,
|
|
1401
|
+
env
|
|
1402
|
+
}).mode !== "none") return findings;
|
|
1403
|
+
const chatCompletionsEnabled = cfg.gateway?.http?.endpoints?.chatCompletions?.enabled === true;
|
|
1404
|
+
const responsesEnabled = cfg.gateway?.http?.endpoints?.responses?.enabled === true;
|
|
1405
|
+
const enabledEndpoints = [
|
|
1406
|
+
"/tools/invoke",
|
|
1407
|
+
chatCompletionsEnabled ? "/v1/chat/completions" : null,
|
|
1408
|
+
responsesEnabled ? "/v1/responses" : null
|
|
1409
|
+
].filter((entry) => Boolean(entry));
|
|
1410
|
+
const remoteExposure = isGatewayRemotelyExposed(cfg);
|
|
1411
|
+
findings.push({
|
|
1412
|
+
checkId: "gateway.http.no_auth",
|
|
1413
|
+
severity: remoteExposure ? "critical" : "warn",
|
|
1414
|
+
title: "Gateway HTTP APIs are reachable without auth",
|
|
1415
|
+
detail: `gateway.auth.mode="none" leaves ${enabledEndpoints.join(", ")} callable without a shared secret. Treat this as trusted-local only and avoid exposing the gateway beyond loopback.`,
|
|
1416
|
+
remediation: "Set gateway.auth.mode to token/password (recommended). If you intentionally keep mode=none, keep gateway.bind=loopback and disable optional HTTP endpoints."
|
|
1417
|
+
});
|
|
1418
|
+
return findings;
|
|
1419
|
+
}
|
|
1420
|
+
function collectSandboxDockerNoopFindings(cfg) {
|
|
1421
|
+
const findings = [];
|
|
1422
|
+
const configuredPaths = [];
|
|
1423
|
+
const agents = Array.isArray(cfg.agents?.list) ? cfg.agents.list : [];
|
|
1424
|
+
const defaultsSandbox = cfg.agents?.defaults?.sandbox;
|
|
1425
|
+
const hasDefaultDocker = hasConfiguredDockerConfig(defaultsSandbox?.docker);
|
|
1426
|
+
const defaultMode = defaultsSandbox?.mode ?? "off";
|
|
1427
|
+
const hasAnySandboxEnabledAgent = agents.some((entry) => {
|
|
1428
|
+
if (!entry || typeof entry !== "object" || typeof entry.id !== "string") return false;
|
|
1429
|
+
return resolveSandboxConfigForAgent$1(cfg, entry.id).mode !== "off";
|
|
1430
|
+
});
|
|
1431
|
+
if (hasDefaultDocker && defaultMode === "off" && !hasAnySandboxEnabledAgent) configuredPaths.push("agents.defaults.sandbox.docker");
|
|
1432
|
+
for (const entry of agents) {
|
|
1433
|
+
if (!entry || typeof entry !== "object" || typeof entry.id !== "string") continue;
|
|
1434
|
+
if (!hasConfiguredDockerConfig(entry.sandbox?.docker)) continue;
|
|
1435
|
+
if (resolveSandboxConfigForAgent$1(cfg, entry.id).mode === "off") configuredPaths.push(`agents.list.${entry.id}.sandbox.docker`);
|
|
1436
|
+
}
|
|
1437
|
+
if (configuredPaths.length === 0) return findings;
|
|
1438
|
+
findings.push({
|
|
1439
|
+
checkId: "sandbox.docker_config_mode_off",
|
|
1440
|
+
severity: "warn",
|
|
1441
|
+
title: "Sandbox docker settings configured while sandbox mode is off",
|
|
1442
|
+
detail: "These docker settings will not take effect until sandbox mode is enabled:\n" + configuredPaths.map((entry) => `- ${entry}`).join("\n"),
|
|
1443
|
+
remediation: "Enable sandbox mode (`agents.defaults.sandbox.mode=\"non-main\"` or `\"all\"`) where needed, or remove unused docker settings."
|
|
1444
|
+
});
|
|
1445
|
+
return findings;
|
|
1446
|
+
}
|
|
1447
|
+
function collectSandboxDangerousConfigFindings(cfg) {
|
|
1448
|
+
const findings = [];
|
|
1449
|
+
const agents = Array.isArray(cfg.agents?.list) ? cfg.agents.list : [];
|
|
1450
|
+
const configs = [];
|
|
1451
|
+
const defaultDocker = cfg.agents?.defaults?.sandbox?.docker;
|
|
1452
|
+
if (defaultDocker && typeof defaultDocker === "object") configs.push({
|
|
1453
|
+
source: "agents.defaults.sandbox.docker",
|
|
1454
|
+
docker: defaultDocker
|
|
1455
|
+
});
|
|
1456
|
+
for (const entry of agents) {
|
|
1457
|
+
if (!entry || typeof entry !== "object" || typeof entry.id !== "string") continue;
|
|
1458
|
+
const agentDocker = entry.sandbox?.docker;
|
|
1459
|
+
if (agentDocker && typeof agentDocker === "object") configs.push({
|
|
1460
|
+
source: `agents.list.${entry.id}.sandbox.docker`,
|
|
1461
|
+
docker: agentDocker
|
|
1462
|
+
});
|
|
1463
|
+
}
|
|
1464
|
+
for (const { source, docker } of configs) {
|
|
1465
|
+
const binds = Array.isArray(docker.binds) ? docker.binds : [];
|
|
1466
|
+
for (const bind of binds) {
|
|
1467
|
+
if (typeof bind !== "string") continue;
|
|
1468
|
+
const blocked = getBlockedBindReason(bind);
|
|
1469
|
+
if (!blocked) continue;
|
|
1470
|
+
if (blocked.kind === "non_absolute") {
|
|
1471
|
+
findings.push({
|
|
1472
|
+
checkId: "sandbox.bind_mount_non_absolute",
|
|
1473
|
+
severity: "warn",
|
|
1474
|
+
title: "Sandbox bind mount uses a non-absolute source path",
|
|
1475
|
+
detail: `${source}.binds contains "${bind}" which uses source path "${blocked.sourcePath}". Non-absolute bind sources are hard to validate safely and may resolve unexpectedly.`,
|
|
1476
|
+
remediation: `Rewrite "${bind}" to use an absolute host path (for example: /home/user/project:/project:ro).`
|
|
1477
|
+
});
|
|
1478
|
+
continue;
|
|
1479
|
+
}
|
|
1480
|
+
if (blocked.kind !== "covers" && blocked.kind !== "targets") continue;
|
|
1481
|
+
const verb = blocked.kind === "covers" ? "covers" : "targets";
|
|
1482
|
+
findings.push({
|
|
1483
|
+
checkId: "sandbox.dangerous_bind_mount",
|
|
1484
|
+
severity: "critical",
|
|
1485
|
+
title: "Dangerous bind mount in sandbox config",
|
|
1486
|
+
detail: `${source}.binds contains "${bind}" which ${verb} blocked path "${blocked.blockedPath}". This can expose host system directories or the Docker socket to sandbox containers.`,
|
|
1487
|
+
remediation: `Remove "${bind}" from ${source}.binds. Use project-specific paths instead.`
|
|
1488
|
+
});
|
|
1489
|
+
}
|
|
1490
|
+
const network = typeof docker.network === "string" ? docker.network : void 0;
|
|
1491
|
+
const normalizedNetwork = normalizeNetworkMode(network);
|
|
1492
|
+
if (network && isDangerousNetworkMode(network)) {
|
|
1493
|
+
const modeLabel = normalizedNetwork === "host" ? "\"host\"" : `"${network}"`;
|
|
1494
|
+
const detail = normalizedNetwork === "host" ? `${source}.network is "host" which bypasses container network isolation entirely.` : `${source}.network is ${modeLabel} which joins another container namespace and can bypass sandbox network isolation.`;
|
|
1495
|
+
findings.push({
|
|
1496
|
+
checkId: "sandbox.dangerous_network_mode",
|
|
1497
|
+
severity: "critical",
|
|
1498
|
+
title: "Dangerous network mode in sandbox config",
|
|
1499
|
+
detail,
|
|
1500
|
+
remediation: `Set ${source}.network to "bridge", "none", or a custom bridge network name. Use ${source}.dangerouslyAllowContainerNamespaceJoin=true only as a break-glass override when you fully trust this runtime.`
|
|
1501
|
+
});
|
|
1502
|
+
}
|
|
1503
|
+
const seccompProfile = typeof docker.seccompProfile === "string" ? docker.seccompProfile : void 0;
|
|
1504
|
+
if (seccompProfile && seccompProfile.trim().toLowerCase() === "unconfined") findings.push({
|
|
1505
|
+
checkId: "sandbox.dangerous_seccomp_profile",
|
|
1506
|
+
severity: "critical",
|
|
1507
|
+
title: "Seccomp unconfined in sandbox config",
|
|
1508
|
+
detail: `${source}.seccompProfile is "unconfined" which disables syscall filtering.`,
|
|
1509
|
+
remediation: `Remove ${source}.seccompProfile or use a custom seccomp profile file.`
|
|
1510
|
+
});
|
|
1511
|
+
const apparmorProfile = typeof docker.apparmorProfile === "string" ? docker.apparmorProfile : void 0;
|
|
1512
|
+
if (apparmorProfile && apparmorProfile.trim().toLowerCase() === "unconfined") findings.push({
|
|
1513
|
+
checkId: "sandbox.dangerous_apparmor_profile",
|
|
1514
|
+
severity: "critical",
|
|
1515
|
+
title: "AppArmor unconfined in sandbox config",
|
|
1516
|
+
detail: `${source}.apparmorProfile is "unconfined" which disables AppArmor enforcement.`,
|
|
1517
|
+
remediation: `Remove ${source}.apparmorProfile or use a named AppArmor profile.`
|
|
1518
|
+
});
|
|
1519
|
+
}
|
|
1520
|
+
const browserExposurePaths = [];
|
|
1521
|
+
const defaultBrowser = resolveSandboxConfigForAgent$1(cfg).browser;
|
|
1522
|
+
if (defaultBrowser.enabled && defaultBrowser.network.trim().toLowerCase() === "bridge" && !defaultBrowser.cdpSourceRange?.trim()) browserExposurePaths.push("agents.defaults.sandbox.browser");
|
|
1523
|
+
for (const entry of agents) {
|
|
1524
|
+
if (!entry || typeof entry !== "object" || typeof entry.id !== "string") continue;
|
|
1525
|
+
const browser = resolveSandboxConfigForAgent$1(cfg, entry.id).browser;
|
|
1526
|
+
if (!browser.enabled) continue;
|
|
1527
|
+
if (browser.network.trim().toLowerCase() !== "bridge") continue;
|
|
1528
|
+
if (browser.cdpSourceRange?.trim()) continue;
|
|
1529
|
+
browserExposurePaths.push(`agents.list.${entry.id}.sandbox.browser`);
|
|
1530
|
+
}
|
|
1531
|
+
if (browserExposurePaths.length > 0) findings.push({
|
|
1532
|
+
checkId: "sandbox.browser_cdp_bridge_unrestricted",
|
|
1533
|
+
severity: "warn",
|
|
1534
|
+
title: "Sandbox browser CDP may be reachable by peer containers",
|
|
1535
|
+
detail: "These sandbox browser configs use Docker bridge networking with no CDP source restriction:\n" + browserExposurePaths.map((entry) => `- ${entry}`).join("\n"),
|
|
1536
|
+
remediation: "Set sandbox.browser.network to a dedicated bridge network (recommended default: remoteclaw-sandbox-browser), or set sandbox.browser.cdpSourceRange (for example 172.21.0.1/32) to restrict container-edge CDP ingress."
|
|
1537
|
+
});
|
|
1538
|
+
return findings;
|
|
1539
|
+
}
|
|
1540
|
+
function collectNodeDenyCommandPatternFindings(cfg) {
|
|
1541
|
+
const findings = [];
|
|
1542
|
+
const denyListRaw = cfg.gateway?.nodes?.denyCommands;
|
|
1543
|
+
if (!Array.isArray(denyListRaw) || denyListRaw.length === 0) return findings;
|
|
1544
|
+
const denyList = denyListRaw.map(normalizeNodeCommand).filter(Boolean);
|
|
1545
|
+
if (denyList.length === 0) return findings;
|
|
1546
|
+
const knownCommands = listKnownNodeCommands(cfg);
|
|
1547
|
+
const patternLike = denyList.filter((entry) => looksLikeNodeCommandPattern(entry));
|
|
1548
|
+
const unknownExact = denyList.filter((entry) => !looksLikeNodeCommandPattern(entry) && !knownCommands.has(entry));
|
|
1549
|
+
if (patternLike.length === 0 && unknownExact.length === 0) return findings;
|
|
1550
|
+
const detailParts = [];
|
|
1551
|
+
if (patternLike.length > 0) detailParts.push(`Pattern-like entries (not supported by exact matching): ${patternLike.join(", ")}`);
|
|
1552
|
+
if (unknownExact.length > 0) detailParts.push(`Unknown command names (not in defaults/allowCommands): ${unknownExact.join(", ")}`);
|
|
1553
|
+
const examples = Array.from(knownCommands).slice(0, 8);
|
|
1554
|
+
findings.push({
|
|
1555
|
+
checkId: "gateway.nodes.deny_commands_ineffective",
|
|
1556
|
+
severity: "warn",
|
|
1557
|
+
title: "Some gateway.nodes.denyCommands entries are ineffective",
|
|
1558
|
+
detail: "gateway.nodes.denyCommands uses exact command-name matching only.\n" + detailParts.map((entry) => `- ${entry}`).join("\n"),
|
|
1559
|
+
remediation: `Use exact command names (for example: ${examples.join(", ")}). If you need broader restrictions, remove risky commands from allowCommands/default workflows.`
|
|
1560
|
+
});
|
|
1561
|
+
return findings;
|
|
1562
|
+
}
|
|
1563
|
+
function collectNodeDangerousAllowCommandFindings(cfg) {
|
|
1564
|
+
const findings = [];
|
|
1565
|
+
const allowRaw = cfg.gateway?.nodes?.allowCommands;
|
|
1566
|
+
if (!Array.isArray(allowRaw) || allowRaw.length === 0) return findings;
|
|
1567
|
+
const allow = new Set(allowRaw.map(normalizeNodeCommand).filter(Boolean));
|
|
1568
|
+
if (allow.size === 0) return findings;
|
|
1569
|
+
const deny = new Set((cfg.gateway?.nodes?.denyCommands ?? []).map(normalizeNodeCommand));
|
|
1570
|
+
const dangerousAllowed = DEFAULT_DANGEROUS_NODE_COMMANDS.filter((cmd) => allow.has(cmd) && !deny.has(cmd));
|
|
1571
|
+
if (dangerousAllowed.length === 0) return findings;
|
|
1572
|
+
findings.push({
|
|
1573
|
+
checkId: "gateway.nodes.allow_commands_dangerous",
|
|
1574
|
+
severity: isGatewayRemotelyExposed(cfg) ? "critical" : "warn",
|
|
1575
|
+
title: "Dangerous node commands explicitly enabled",
|
|
1576
|
+
detail: `gateway.nodes.allowCommands includes: ${dangerousAllowed.join(", ")}. These commands can trigger high-impact device actions (camera/screen/contacts/calendar/reminders/SMS).`,
|
|
1577
|
+
remediation: "Remove these entries from gateway.nodes.allowCommands (recommended). If you keep them, treat gateway auth as full operator access and keep gateway exposure local/tailnet-only."
|
|
1578
|
+
});
|
|
1579
|
+
return findings;
|
|
1580
|
+
}
|
|
1581
|
+
function collectMinimalProfileOverrideFindings(cfg) {
|
|
1582
|
+
const findings = [];
|
|
1583
|
+
if (cfg.tools?.profile !== "minimal") return findings;
|
|
1584
|
+
const overrides = (cfg.agents?.list ?? []).filter((entry) => {
|
|
1585
|
+
return Boolean(entry && typeof entry === "object" && typeof entry.id === "string" && entry.tools?.profile && entry.tools.profile !== "minimal");
|
|
1586
|
+
}).map((entry) => `${entry.id}=${entry.tools?.profile}`);
|
|
1587
|
+
if (overrides.length === 0) return findings;
|
|
1588
|
+
findings.push({
|
|
1589
|
+
checkId: "tools.profile_minimal_overridden",
|
|
1590
|
+
severity: "warn",
|
|
1591
|
+
title: "Global tools.profile=minimal is overridden by agent profiles",
|
|
1592
|
+
detail: "Global minimal profile is set, but these agent profiles take precedence:\n" + overrides.map((entry) => `- agents.list.${entry}`).join("\n"),
|
|
1593
|
+
remediation: "Set those agents to `tools.profile=\"minimal\"` (or remove the agent override) if you want minimal tools enforced globally."
|
|
1594
|
+
});
|
|
1595
|
+
return findings;
|
|
1596
|
+
}
|
|
1597
|
+
function collectModelHygieneFindings(cfg) {
|
|
1598
|
+
const findings = [];
|
|
1599
|
+
const models = collectModels(cfg);
|
|
1600
|
+
if (models.length === 0) return findings;
|
|
1601
|
+
const weakMatches = /* @__PURE__ */ new Map();
|
|
1602
|
+
const addWeakMatch = (model, source, reason) => {
|
|
1603
|
+
const key = `${model}@@${source}`;
|
|
1604
|
+
const existing = weakMatches.get(key);
|
|
1605
|
+
if (!existing) {
|
|
1606
|
+
weakMatches.set(key, {
|
|
1607
|
+
model,
|
|
1608
|
+
source,
|
|
1609
|
+
reasons: [reason]
|
|
1610
|
+
});
|
|
1611
|
+
return;
|
|
1612
|
+
}
|
|
1613
|
+
if (!existing.reasons.includes(reason)) existing.reasons.push(reason);
|
|
1614
|
+
};
|
|
1615
|
+
for (const entry of models) {
|
|
1616
|
+
for (const pat of WEAK_TIER_MODEL_PATTERNS) if (pat.re.test(entry.id)) {
|
|
1617
|
+
addWeakMatch(entry.id, entry.source, pat.label);
|
|
1618
|
+
break;
|
|
1619
|
+
}
|
|
1620
|
+
if (isGptModel(entry.id) && !isGpt5OrHigher(entry.id)) addWeakMatch(entry.id, entry.source, "Below GPT-5 family");
|
|
1621
|
+
if (isClaudeModel(entry.id) && !isClaude45OrHigher(entry.id)) addWeakMatch(entry.id, entry.source, "Below Claude 4.5");
|
|
1622
|
+
}
|
|
1623
|
+
const matches = [];
|
|
1624
|
+
for (const entry of models) for (const pat of LEGACY_MODEL_PATTERNS) if (pat.re.test(entry.id)) {
|
|
1625
|
+
matches.push({
|
|
1626
|
+
model: entry.id,
|
|
1627
|
+
source: entry.source,
|
|
1628
|
+
reason: pat.label
|
|
1629
|
+
});
|
|
1630
|
+
break;
|
|
1631
|
+
}
|
|
1632
|
+
if (matches.length > 0) {
|
|
1633
|
+
const lines = matches.slice(0, 12).map((m) => `- ${m.model} (${m.reason}) @ ${m.source}`).join("\n");
|
|
1634
|
+
const more = matches.length > 12 ? `\n…${matches.length - 12} more` : "";
|
|
1635
|
+
findings.push({
|
|
1636
|
+
checkId: "models.legacy",
|
|
1637
|
+
severity: "warn",
|
|
1638
|
+
title: "Some configured models look legacy",
|
|
1639
|
+
detail: "Older/legacy models can be less robust against prompt injection and tool misuse.\n" + lines + more,
|
|
1640
|
+
remediation: "Prefer modern, instruction-hardened models for any bot that can run tools."
|
|
1641
|
+
});
|
|
1642
|
+
}
|
|
1643
|
+
if (weakMatches.size > 0) {
|
|
1644
|
+
const lines = Array.from(weakMatches.values()).slice(0, 12).map((m) => `- ${m.model} (${m.reasons.join("; ")}) @ ${m.source}`).join("\n");
|
|
1645
|
+
const more = weakMatches.size > 12 ? `\n…${weakMatches.size - 12} more` : "";
|
|
1646
|
+
findings.push({
|
|
1647
|
+
checkId: "models.weak_tier",
|
|
1648
|
+
severity: "warn",
|
|
1649
|
+
title: "Some configured models are below recommended tiers",
|
|
1650
|
+
detail: "Smaller/older models are generally more susceptible to prompt injection and tool misuse.\n" + lines + more,
|
|
1651
|
+
remediation: "Use the latest, top-tier model for any bot with tools or untrusted inboxes. Avoid Haiku tiers; prefer GPT-5+ and Claude 4.5+."
|
|
1652
|
+
});
|
|
1653
|
+
}
|
|
1654
|
+
return findings;
|
|
1655
|
+
}
|
|
1656
|
+
function collectSmallModelRiskFindings(params) {
|
|
1657
|
+
const findings = [];
|
|
1658
|
+
const models = collectModels(params.cfg).filter((entry) => !entry.source.includes("imageModel"));
|
|
1659
|
+
if (models.length === 0) return findings;
|
|
1660
|
+
const smallModels = models.map((entry) => {
|
|
1661
|
+
const paramB = inferParamBFromIdOrName(entry.id);
|
|
1662
|
+
if (!paramB || paramB > SMALL_MODEL_PARAM_B_MAX) return null;
|
|
1663
|
+
return {
|
|
1664
|
+
...entry,
|
|
1665
|
+
paramB
|
|
1666
|
+
};
|
|
1667
|
+
}).filter((entry) => Boolean(entry));
|
|
1668
|
+
if (smallModels.length === 0) return findings;
|
|
1669
|
+
let hasUnsafe = false;
|
|
1670
|
+
const modelLines = [];
|
|
1671
|
+
const exposureSet = /* @__PURE__ */ new Set();
|
|
1672
|
+
for (const entry of smallModels) {
|
|
1673
|
+
const agentId = extractAgentIdFromSource(entry.source);
|
|
1674
|
+
const sandboxMode = resolveSandboxConfigForAgent$1(params.cfg, agentId ?? void 0).mode;
|
|
1675
|
+
const agentTools = agentId && params.cfg.agents?.list ? params.cfg.agents.list.find((agent) => agent?.id === agentId)?.tools : void 0;
|
|
1676
|
+
const policies = resolveToolPolicies$1({
|
|
1677
|
+
cfg: params.cfg,
|
|
1678
|
+
agentTools,
|
|
1679
|
+
sandboxMode,
|
|
1680
|
+
agentId
|
|
1681
|
+
});
|
|
1682
|
+
const exposed = [];
|
|
1683
|
+
if (isBrowserEnabled(params.cfg)) {
|
|
1684
|
+
if (isToolAllowedByPolicies("browser", policies)) exposed.push("browser");
|
|
1685
|
+
}
|
|
1686
|
+
for (const tool of exposed) exposureSet.add(tool);
|
|
1687
|
+
const sandboxLabel = sandboxMode === "all" ? "sandbox=all" : `sandbox=${sandboxMode}`;
|
|
1688
|
+
const exposureLabel = exposed.length > 0 ? ` web=[${exposed.join(", ")}]` : " web=[off]";
|
|
1689
|
+
const safe = sandboxMode === "all" && exposed.length === 0;
|
|
1690
|
+
if (!safe) hasUnsafe = true;
|
|
1691
|
+
const statusLabel = safe ? "ok" : "unsafe";
|
|
1692
|
+
modelLines.push(`- ${entry.id} (${entry.paramB}B) @ ${entry.source} (${statusLabel}; ${sandboxLabel};${exposureLabel})`);
|
|
1693
|
+
}
|
|
1694
|
+
const exposureList = Array.from(exposureSet);
|
|
1695
|
+
const exposureDetail = exposureList.length > 0 ? `Uncontrolled input tools allowed: ${exposureList.join(", ")}.` : "No web/browser tools detected for these models.";
|
|
1696
|
+
findings.push({
|
|
1697
|
+
checkId: "models.small_params",
|
|
1698
|
+
severity: hasUnsafe ? "critical" : "info",
|
|
1699
|
+
title: "Small models require sandboxing and web tools disabled",
|
|
1700
|
+
detail: `Small models (<=${SMALL_MODEL_PARAM_B_MAX}B params) detected:\n` + modelLines.join("\n") + `\n` + exposureDetail + "\nSmall models are not recommended for untrusted inputs.",
|
|
1701
|
+
remediation: "If you must use small models, enable sandboxing for all sessions (agents.defaults.sandbox.mode=\"all\") and disable web_fetch/browser (tools.deny=[\"group:web\",\"browser\"])."
|
|
1702
|
+
});
|
|
1703
|
+
return findings;
|
|
1704
|
+
}
|
|
1705
|
+
function collectExposureMatrixFindings(cfg) {
|
|
1706
|
+
const findings = [];
|
|
1707
|
+
const openGroups = listGroupPolicyOpen(cfg);
|
|
1708
|
+
if (openGroups.length === 0) return findings;
|
|
1709
|
+
if (cfg.tools?.elevated?.enabled !== false) findings.push({
|
|
1710
|
+
checkId: "security.exposure.open_groups_with_elevated",
|
|
1711
|
+
severity: "critical",
|
|
1712
|
+
title: "Open groupPolicy with elevated tools enabled",
|
|
1713
|
+
detail: `Found groupPolicy="open" at:\n${openGroups.map((p) => `- ${p}`).join("\n")}\nWith tools.elevated enabled, a prompt injection in those rooms can become a high-impact incident.`,
|
|
1714
|
+
remediation: `Set groupPolicy="allowlist" and keep elevated allowlists extremely tight.`
|
|
1715
|
+
});
|
|
1716
|
+
const { riskyContexts, hasRuntimeRisk } = collectRiskyToolExposureContexts(cfg);
|
|
1717
|
+
if (riskyContexts.length > 0) findings.push({
|
|
1718
|
+
checkId: "security.exposure.open_groups_with_runtime_or_fs",
|
|
1719
|
+
severity: hasRuntimeRisk ? "critical" : "warn",
|
|
1720
|
+
title: "Open groupPolicy with runtime/filesystem tools exposed",
|
|
1721
|
+
detail: `Found groupPolicy="open" at:\n${openGroups.map((p) => `- ${p}`).join("\n")}\nRisky tool exposure contexts:\n${riskyContexts.map((line) => `- ${line}`).join("\n")}\nPrompt injection in open groups can trigger command/file actions in these contexts.`,
|
|
1722
|
+
remediation: "For open groups, prefer tools.profile=\"messaging\" (or deny group:runtime/group:fs), set tools.fs.workspaceOnly=true, and use agents.defaults.sandbox.mode=\"all\" for exposed agents."
|
|
1723
|
+
});
|
|
1724
|
+
return findings;
|
|
1725
|
+
}
|
|
1726
|
+
function collectLikelyMultiUserSetupFindings(cfg) {
|
|
1727
|
+
const findings = [];
|
|
1728
|
+
const signals = listPotentialMultiUserSignals(cfg);
|
|
1729
|
+
if (signals.length === 0) return findings;
|
|
1730
|
+
const { riskyContexts, hasRuntimeRisk } = collectRiskyToolExposureContexts(cfg);
|
|
1731
|
+
const impactLine = hasRuntimeRisk ? "Runtime/process tools are exposed without full sandboxing in at least one context." : "No unguarded runtime/process tools were detected by this heuristic.";
|
|
1732
|
+
const riskyContextsDetail = riskyContexts.length > 0 ? `Potential high-impact tool exposure contexts:\n${riskyContexts.map((line) => `- ${line}`).join("\n")}` : "No unguarded runtime/filesystem contexts detected.";
|
|
1733
|
+
findings.push({
|
|
1734
|
+
checkId: "security.trust_model.multi_user_heuristic",
|
|
1735
|
+
severity: "warn",
|
|
1736
|
+
title: "Potential multi-user setup detected (personal-assistant model warning)",
|
|
1737
|
+
detail: "Heuristic signals indicate this gateway may be reachable by multiple users:\n" + signals.map((signal) => `- ${signal}`).join("\n") + `\n${impactLine}\n${riskyContextsDetail}\nRemoteClaw's default security model is personal-assistant (one trusted operator boundary), not hostile multi-tenant isolation on one shared gateway.`,
|
|
1738
|
+
remediation: "If users may be mutually untrusted, split trust boundaries (separate gateways + credentials, ideally separate OS users/hosts). If you intentionally run shared-user access, set agents.defaults.sandbox.mode=\"all\", keep tools.fs.workspaceOnly=true, deny runtime/fs/web tools unless required, and keep personal/private identities + credentials off that runtime."
|
|
1739
|
+
});
|
|
1740
|
+
return findings;
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
//#endregion
|
|
1744
|
+
//#region src/config/includes-scan.ts
|
|
1745
|
+
function listDirectIncludes(parsed) {
|
|
1746
|
+
const out = [];
|
|
1747
|
+
const visit = (value) => {
|
|
1748
|
+
if (!value) return;
|
|
1749
|
+
if (Array.isArray(value)) {
|
|
1750
|
+
for (const item of value) visit(item);
|
|
1751
|
+
return;
|
|
1752
|
+
}
|
|
1753
|
+
if (typeof value !== "object") return;
|
|
1754
|
+
const rec = value;
|
|
1755
|
+
const includeVal = rec[INCLUDE_KEY];
|
|
1756
|
+
if (typeof includeVal === "string") out.push(includeVal);
|
|
1757
|
+
else if (Array.isArray(includeVal)) {
|
|
1758
|
+
for (const item of includeVal) if (typeof item === "string") out.push(item);
|
|
1759
|
+
}
|
|
1760
|
+
for (const v of Object.values(rec)) visit(v);
|
|
1761
|
+
};
|
|
1762
|
+
visit(parsed);
|
|
1763
|
+
return out;
|
|
1764
|
+
}
|
|
1765
|
+
function resolveIncludePath(baseConfigPath, includePath) {
|
|
1766
|
+
return path.normalize(path.isAbsolute(includePath) ? includePath : path.resolve(path.dirname(baseConfigPath), includePath));
|
|
1767
|
+
}
|
|
1768
|
+
async function collectIncludePathsRecursive(params) {
|
|
1769
|
+
const visited = /* @__PURE__ */ new Set();
|
|
1770
|
+
const result = [];
|
|
1771
|
+
const walk = async (basePath, parsed, depth) => {
|
|
1772
|
+
if (depth > MAX_INCLUDE_DEPTH) return;
|
|
1773
|
+
for (const raw of listDirectIncludes(parsed)) {
|
|
1774
|
+
const resolved = resolveIncludePath(basePath, raw);
|
|
1775
|
+
if (visited.has(resolved)) continue;
|
|
1776
|
+
visited.add(resolved);
|
|
1777
|
+
result.push(resolved);
|
|
1778
|
+
const rawText = await fs.readFile(resolved, "utf-8").catch(() => null);
|
|
1779
|
+
if (!rawText) continue;
|
|
1780
|
+
const nestedParsed = (() => {
|
|
1781
|
+
try {
|
|
1782
|
+
return JSON5.parse(rawText);
|
|
1783
|
+
} catch {
|
|
1784
|
+
return null;
|
|
1785
|
+
}
|
|
1786
|
+
})();
|
|
1787
|
+
if (nestedParsed) await walk(resolved, nestedParsed, depth + 1);
|
|
1788
|
+
}
|
|
1789
|
+
};
|
|
1790
|
+
await walk(params.configPath, params.parsed, 0);
|
|
1791
|
+
return result;
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
//#endregion
|
|
1795
|
+
//#region src/security/windows-acl.ts
|
|
1796
|
+
const INHERIT_FLAGS = new Set([
|
|
1797
|
+
"I",
|
|
1798
|
+
"OI",
|
|
1799
|
+
"CI",
|
|
1800
|
+
"IO",
|
|
1801
|
+
"NP"
|
|
1802
|
+
]);
|
|
1803
|
+
const WORLD_PRINCIPALS = new Set([
|
|
1804
|
+
"everyone",
|
|
1805
|
+
"users",
|
|
1806
|
+
"builtin\\users",
|
|
1807
|
+
"authenticated users",
|
|
1808
|
+
"nt authority\\authenticated users"
|
|
1809
|
+
]);
|
|
1810
|
+
const TRUSTED_BASE = new Set([
|
|
1811
|
+
"nt authority\\system",
|
|
1812
|
+
"system",
|
|
1813
|
+
"builtin\\administrators",
|
|
1814
|
+
"creator owner"
|
|
1815
|
+
]);
|
|
1816
|
+
const WORLD_SUFFIXES = ["\\users", "\\authenticated users"];
|
|
1817
|
+
const TRUSTED_SUFFIXES = ["\\administrators", "\\system"];
|
|
1818
|
+
const SID_RE = /^s-\d+-\d+(-\d+)+$/i;
|
|
1819
|
+
const TRUSTED_SIDS = new Set([
|
|
1820
|
+
"s-1-5-18",
|
|
1821
|
+
"s-1-5-32-544",
|
|
1822
|
+
"s-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464"
|
|
1823
|
+
]);
|
|
1824
|
+
const STATUS_PREFIXES = [
|
|
1825
|
+
"successfully processed",
|
|
1826
|
+
"processed",
|
|
1827
|
+
"failed processing",
|
|
1828
|
+
"no mapping between account names"
|
|
1829
|
+
];
|
|
1830
|
+
const normalize = (value) => value.trim().toLowerCase();
|
|
1831
|
+
function resolveWindowsUserPrincipal(env) {
|
|
1832
|
+
const username = env?.USERNAME?.trim() || os.userInfo().username?.trim();
|
|
1833
|
+
if (!username) return null;
|
|
1834
|
+
const domain = env?.USERDOMAIN?.trim();
|
|
1835
|
+
return domain ? `${domain}\\${username}` : username;
|
|
1836
|
+
}
|
|
1837
|
+
function buildTrustedPrincipals(env) {
|
|
1838
|
+
const trusted = new Set(TRUSTED_BASE);
|
|
1839
|
+
const principal = resolveWindowsUserPrincipal(env);
|
|
1840
|
+
if (principal) {
|
|
1841
|
+
trusted.add(normalize(principal));
|
|
1842
|
+
const userOnly = principal.split("\\").at(-1);
|
|
1843
|
+
if (userOnly) trusted.add(normalize(userOnly));
|
|
1844
|
+
}
|
|
1845
|
+
const userSid = normalize(env?.USERSID ?? "");
|
|
1846
|
+
if (userSid && SID_RE.test(userSid)) trusted.add(userSid);
|
|
1847
|
+
return trusted;
|
|
1848
|
+
}
|
|
1849
|
+
function classifyPrincipal(principal, trustedPrincipals) {
|
|
1850
|
+
const normalized = normalize(principal);
|
|
1851
|
+
if (SID_RE.test(normalized)) return TRUSTED_SIDS.has(normalized) || trustedPrincipals.has(normalized) ? "trusted" : "group";
|
|
1852
|
+
if (trustedPrincipals.has(normalized) || TRUSTED_SUFFIXES.some((suffix) => normalized.endsWith(suffix))) return "trusted";
|
|
1853
|
+
if (WORLD_PRINCIPALS.has(normalized) || WORLD_SUFFIXES.some((suffix) => normalized.endsWith(suffix))) return "world";
|
|
1854
|
+
return "group";
|
|
1855
|
+
}
|
|
1856
|
+
function rightsFromTokens(tokens) {
|
|
1857
|
+
const upper = tokens.join("").toUpperCase();
|
|
1858
|
+
const canWrite = upper.includes("F") || upper.includes("M") || upper.includes("W") || upper.includes("D");
|
|
1859
|
+
return {
|
|
1860
|
+
canRead: upper.includes("F") || upper.includes("M") || upper.includes("R"),
|
|
1861
|
+
canWrite
|
|
1862
|
+
};
|
|
1863
|
+
}
|
|
1864
|
+
function isStatusLine(lowerLine) {
|
|
1865
|
+
return STATUS_PREFIXES.some((prefix) => lowerLine.startsWith(prefix));
|
|
1866
|
+
}
|
|
1867
|
+
function stripTargetPrefix(params) {
|
|
1868
|
+
if (params.lowerLine.startsWith(params.lowerTarget)) return params.trimmedLine.slice(params.normalizedTarget.length).trim();
|
|
1869
|
+
if (params.lowerLine.startsWith(params.quotedLower)) return params.trimmedLine.slice(params.quotedTarget.length).trim();
|
|
1870
|
+
return params.trimmedLine;
|
|
1871
|
+
}
|
|
1872
|
+
function parseAceEntry(entry) {
|
|
1873
|
+
if (!entry || !entry.includes("(")) return null;
|
|
1874
|
+
const idx = entry.indexOf(":");
|
|
1875
|
+
if (idx === -1) return null;
|
|
1876
|
+
const principal = entry.slice(0, idx).trim();
|
|
1877
|
+
const rawRights = entry.slice(idx + 1).trim();
|
|
1878
|
+
const tokens = rawRights.match(/\(([^)]+)\)/g)?.map((token) => token.slice(1, -1).trim()).filter(Boolean) ?? [];
|
|
1879
|
+
if (tokens.some((token) => token.toUpperCase() === "DENY")) return null;
|
|
1880
|
+
const rights = tokens.filter((token) => !INHERIT_FLAGS.has(token.toUpperCase()));
|
|
1881
|
+
if (rights.length === 0) return null;
|
|
1882
|
+
const { canRead, canWrite } = rightsFromTokens(rights);
|
|
1883
|
+
return {
|
|
1884
|
+
principal,
|
|
1885
|
+
rights,
|
|
1886
|
+
rawRights,
|
|
1887
|
+
canRead,
|
|
1888
|
+
canWrite
|
|
1889
|
+
};
|
|
1890
|
+
}
|
|
1891
|
+
function parseIcaclsOutput(output, targetPath) {
|
|
1892
|
+
const entries = [];
|
|
1893
|
+
const normalizedTarget = targetPath.trim();
|
|
1894
|
+
const lowerTarget = normalizedTarget.toLowerCase();
|
|
1895
|
+
const quotedTarget = `"${normalizedTarget}"`;
|
|
1896
|
+
const quotedLower = quotedTarget.toLowerCase();
|
|
1897
|
+
for (const rawLine of output.split(/\r?\n/)) {
|
|
1898
|
+
const line = rawLine.trimEnd();
|
|
1899
|
+
if (!line.trim()) continue;
|
|
1900
|
+
const trimmed = line.trim();
|
|
1901
|
+
const lower = trimmed.toLowerCase();
|
|
1902
|
+
if (isStatusLine(lower)) continue;
|
|
1903
|
+
const parsed = parseAceEntry(stripTargetPrefix({
|
|
1904
|
+
trimmedLine: trimmed,
|
|
1905
|
+
lowerLine: lower,
|
|
1906
|
+
normalizedTarget,
|
|
1907
|
+
lowerTarget,
|
|
1908
|
+
quotedTarget,
|
|
1909
|
+
quotedLower
|
|
1910
|
+
}));
|
|
1911
|
+
if (!parsed) continue;
|
|
1912
|
+
entries.push(parsed);
|
|
1913
|
+
}
|
|
1914
|
+
return entries;
|
|
1915
|
+
}
|
|
1916
|
+
function summarizeWindowsAcl(entries, env) {
|
|
1917
|
+
const trustedPrincipals = buildTrustedPrincipals(env);
|
|
1918
|
+
const trusted = [];
|
|
1919
|
+
const untrustedWorld = [];
|
|
1920
|
+
const untrustedGroup = [];
|
|
1921
|
+
for (const entry of entries) {
|
|
1922
|
+
const classification = classifyPrincipal(entry.principal, trustedPrincipals);
|
|
1923
|
+
if (classification === "trusted") trusted.push(entry);
|
|
1924
|
+
else if (classification === "world") untrustedWorld.push(entry);
|
|
1925
|
+
else untrustedGroup.push(entry);
|
|
1926
|
+
}
|
|
1927
|
+
return {
|
|
1928
|
+
trusted,
|
|
1929
|
+
untrustedWorld,
|
|
1930
|
+
untrustedGroup
|
|
1931
|
+
};
|
|
1932
|
+
}
|
|
1933
|
+
async function inspectWindowsAcl(targetPath, opts) {
|
|
1934
|
+
const exec = opts?.exec ?? runExec;
|
|
1935
|
+
try {
|
|
1936
|
+
const { stdout, stderr } = await exec("icacls", [targetPath]);
|
|
1937
|
+
const entries = parseIcaclsOutput(`${stdout}\n${stderr}`.trim(), targetPath);
|
|
1938
|
+
const { trusted, untrustedWorld, untrustedGroup } = summarizeWindowsAcl(entries, opts?.env);
|
|
1939
|
+
return {
|
|
1940
|
+
ok: true,
|
|
1941
|
+
entries,
|
|
1942
|
+
trusted,
|
|
1943
|
+
untrustedWorld,
|
|
1944
|
+
untrustedGroup
|
|
1945
|
+
};
|
|
1946
|
+
} catch (err) {
|
|
1947
|
+
return {
|
|
1948
|
+
ok: false,
|
|
1949
|
+
entries: [],
|
|
1950
|
+
trusted: [],
|
|
1951
|
+
untrustedWorld: [],
|
|
1952
|
+
untrustedGroup: [],
|
|
1953
|
+
error: String(err)
|
|
1954
|
+
};
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
function formatWindowsAclSummary(summary) {
|
|
1958
|
+
if (!summary.ok) return "unknown";
|
|
1959
|
+
const untrusted = [...summary.untrustedWorld, ...summary.untrustedGroup];
|
|
1960
|
+
if (untrusted.length === 0) return "trusted-only";
|
|
1961
|
+
return untrusted.map((entry) => `${entry.principal}:${entry.rawRights}`).join(", ");
|
|
1962
|
+
}
|
|
1963
|
+
function formatIcaclsResetCommand(targetPath, opts) {
|
|
1964
|
+
const user = resolveWindowsUserPrincipal(opts.env) ?? "%USERNAME%";
|
|
1965
|
+
const grant = opts.isDir ? "(OI)(CI)F" : "F";
|
|
1966
|
+
return `icacls "${targetPath}" /inheritance:r /grant:r "${user}:${grant}" /grant:r "SYSTEM:${grant}"`;
|
|
1967
|
+
}
|
|
1968
|
+
function createIcaclsResetCommand(targetPath, opts) {
|
|
1969
|
+
const user = resolveWindowsUserPrincipal(opts.env);
|
|
1970
|
+
if (!user) return null;
|
|
1971
|
+
const grant = opts.isDir ? "(OI)(CI)F" : "F";
|
|
1972
|
+
return {
|
|
1973
|
+
command: "icacls",
|
|
1974
|
+
args: [
|
|
1975
|
+
targetPath,
|
|
1976
|
+
"/inheritance:r",
|
|
1977
|
+
"/grant:r",
|
|
1978
|
+
`${user}:${grant}`,
|
|
1979
|
+
"/grant:r",
|
|
1980
|
+
`SYSTEM:${grant}`
|
|
1981
|
+
],
|
|
1982
|
+
display: formatIcaclsResetCommand(targetPath, opts)
|
|
1983
|
+
};
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1986
|
+
//#endregion
|
|
1987
|
+
//#region src/security/audit-fs.ts
|
|
1988
|
+
async function safeStat(targetPath) {
|
|
1989
|
+
try {
|
|
1990
|
+
const lst = await fsp.lstat(targetPath);
|
|
1991
|
+
return {
|
|
1992
|
+
ok: true,
|
|
1993
|
+
isSymlink: lst.isSymbolicLink(),
|
|
1994
|
+
isDir: lst.isDirectory(),
|
|
1995
|
+
mode: typeof lst.mode === "number" ? lst.mode : null,
|
|
1996
|
+
uid: typeof lst.uid === "number" ? lst.uid : null,
|
|
1997
|
+
gid: typeof lst.gid === "number" ? lst.gid : null
|
|
1998
|
+
};
|
|
1999
|
+
} catch (err) {
|
|
2000
|
+
return {
|
|
2001
|
+
ok: false,
|
|
2002
|
+
isSymlink: false,
|
|
2003
|
+
isDir: false,
|
|
2004
|
+
mode: null,
|
|
2005
|
+
uid: null,
|
|
2006
|
+
gid: null,
|
|
2007
|
+
error: String(err)
|
|
2008
|
+
};
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
2011
|
+
async function inspectPathPermissions(targetPath, opts) {
|
|
2012
|
+
const st = await safeStat(targetPath);
|
|
2013
|
+
if (!st.ok) return {
|
|
2014
|
+
ok: false,
|
|
2015
|
+
isSymlink: false,
|
|
2016
|
+
isDir: false,
|
|
2017
|
+
mode: null,
|
|
2018
|
+
bits: null,
|
|
2019
|
+
source: "unknown",
|
|
2020
|
+
worldWritable: false,
|
|
2021
|
+
groupWritable: false,
|
|
2022
|
+
worldReadable: false,
|
|
2023
|
+
groupReadable: false,
|
|
2024
|
+
error: st.error
|
|
2025
|
+
};
|
|
2026
|
+
let effectiveMode = st.mode;
|
|
2027
|
+
let effectiveIsDir = st.isDir;
|
|
2028
|
+
if (st.isSymlink) try {
|
|
2029
|
+
const target = await fsp.stat(targetPath);
|
|
2030
|
+
effectiveMode = typeof target.mode === "number" ? target.mode : st.mode;
|
|
2031
|
+
effectiveIsDir = target.isDirectory();
|
|
2032
|
+
} catch {}
|
|
2033
|
+
const bits = modeBits(effectiveMode);
|
|
2034
|
+
if ((opts?.platform ?? process.platform) === "win32") {
|
|
2035
|
+
const acl = await inspectWindowsAcl(targetPath, {
|
|
2036
|
+
env: opts?.env,
|
|
2037
|
+
exec: opts?.exec
|
|
2038
|
+
});
|
|
2039
|
+
if (!acl.ok) return {
|
|
2040
|
+
ok: true,
|
|
2041
|
+
isSymlink: st.isSymlink,
|
|
2042
|
+
isDir: effectiveIsDir,
|
|
2043
|
+
mode: effectiveMode,
|
|
2044
|
+
bits,
|
|
2045
|
+
source: "unknown",
|
|
2046
|
+
worldWritable: false,
|
|
2047
|
+
groupWritable: false,
|
|
2048
|
+
worldReadable: false,
|
|
2049
|
+
groupReadable: false,
|
|
2050
|
+
error: acl.error
|
|
2051
|
+
};
|
|
2052
|
+
return {
|
|
2053
|
+
ok: true,
|
|
2054
|
+
isSymlink: st.isSymlink,
|
|
2055
|
+
isDir: effectiveIsDir,
|
|
2056
|
+
mode: effectiveMode,
|
|
2057
|
+
bits,
|
|
2058
|
+
source: "windows-acl",
|
|
2059
|
+
worldWritable: acl.untrustedWorld.some((entry) => entry.canWrite),
|
|
2060
|
+
groupWritable: acl.untrustedGroup.some((entry) => entry.canWrite),
|
|
2061
|
+
worldReadable: acl.untrustedWorld.some((entry) => entry.canRead),
|
|
2062
|
+
groupReadable: acl.untrustedGroup.some((entry) => entry.canRead),
|
|
2063
|
+
aclSummary: formatWindowsAclSummary(acl)
|
|
2064
|
+
};
|
|
2065
|
+
}
|
|
2066
|
+
return {
|
|
2067
|
+
ok: true,
|
|
2068
|
+
isSymlink: st.isSymlink,
|
|
2069
|
+
isDir: effectiveIsDir,
|
|
2070
|
+
mode: effectiveMode,
|
|
2071
|
+
bits,
|
|
2072
|
+
source: "posix",
|
|
2073
|
+
worldWritable: isWorldWritable(bits),
|
|
2074
|
+
groupWritable: isGroupWritable(bits),
|
|
2075
|
+
worldReadable: isWorldReadable(bits),
|
|
2076
|
+
groupReadable: isGroupReadable(bits)
|
|
2077
|
+
};
|
|
2078
|
+
}
|
|
2079
|
+
function formatPermissionDetail(targetPath, perms) {
|
|
2080
|
+
if (perms.source === "windows-acl") return `${targetPath} acl=${perms.aclSummary ?? "unknown"}`;
|
|
2081
|
+
return `${targetPath} mode=${formatOctal(perms.bits)}`;
|
|
2082
|
+
}
|
|
2083
|
+
function formatPermissionRemediation(params) {
|
|
2084
|
+
if (params.perms.source === "windows-acl") return formatIcaclsResetCommand(params.targetPath, {
|
|
2085
|
+
isDir: params.isDir,
|
|
2086
|
+
env: params.env
|
|
2087
|
+
});
|
|
2088
|
+
return `chmod ${params.posixMode.toString(8).padStart(3, "0")} ${params.targetPath}`;
|
|
2089
|
+
}
|
|
2090
|
+
function modeBits(mode) {
|
|
2091
|
+
if (mode == null) return null;
|
|
2092
|
+
return mode & 511;
|
|
2093
|
+
}
|
|
2094
|
+
function formatOctal(bits) {
|
|
2095
|
+
if (bits == null) return "unknown";
|
|
2096
|
+
return bits.toString(8).padStart(3, "0");
|
|
2097
|
+
}
|
|
2098
|
+
function isWorldWritable(bits) {
|
|
2099
|
+
if (bits == null) return false;
|
|
2100
|
+
return (bits & 2) !== 0;
|
|
2101
|
+
}
|
|
2102
|
+
function isGroupWritable(bits) {
|
|
2103
|
+
if (bits == null) return false;
|
|
2104
|
+
return (bits & 16) !== 0;
|
|
2105
|
+
}
|
|
2106
|
+
function isWorldReadable(bits) {
|
|
2107
|
+
if (bits == null) return false;
|
|
2108
|
+
return (bits & 4) !== 0;
|
|
2109
|
+
}
|
|
2110
|
+
function isGroupReadable(bits) {
|
|
2111
|
+
if (bits == null) return false;
|
|
2112
|
+
return (bits & 32) !== 0;
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
//#endregion
|
|
2116
|
+
//#region src/security/audit-extra.async.ts
|
|
2117
|
+
/**
|
|
2118
|
+
* Asynchronous security audit collector functions.
|
|
2119
|
+
*
|
|
2120
|
+
* These functions perform I/O (filesystem, config reads) to detect security issues.
|
|
2121
|
+
*/
|
|
2122
|
+
const resolveSandboxConfigForAgent = (_cfg, _agentId) => ({ mode: "off" });
|
|
2123
|
+
const resolveToolPolicyForAgent = (_cfg, _agentId) => void 0;
|
|
2124
|
+
function normalizeToolPolicy(config) {
|
|
2125
|
+
if (!config) return;
|
|
2126
|
+
const allow = Array.isArray(config.allow) ? config.allow : void 0;
|
|
2127
|
+
const deny = Array.isArray(config.deny) ? config.deny : void 0;
|
|
2128
|
+
if (!allow && !deny) return;
|
|
2129
|
+
return {
|
|
2130
|
+
allow,
|
|
2131
|
+
deny
|
|
2132
|
+
};
|
|
2133
|
+
}
|
|
2134
|
+
function expandTilde(p, env) {
|
|
2135
|
+
if (!p.startsWith("~")) return p;
|
|
2136
|
+
const home = typeof env.HOME === "string" && env.HOME.trim() ? env.HOME.trim() : null;
|
|
2137
|
+
if (!home) return null;
|
|
2138
|
+
if (p === "~") return home;
|
|
2139
|
+
if (p.startsWith("~/") || p.startsWith("~\\")) return path.join(home, p.slice(2));
|
|
2140
|
+
return null;
|
|
2141
|
+
}
|
|
2142
|
+
async function readPluginManifestExtensions(pluginPath) {
|
|
2143
|
+
const manifestPath = path.join(pluginPath, "package.json");
|
|
2144
|
+
const raw = await fsp.readFile(manifestPath, "utf-8").catch(() => "");
|
|
2145
|
+
if (!raw.trim()) return [];
|
|
2146
|
+
const extensions = JSON.parse(raw)?.[MANIFEST_KEY]?.extensions;
|
|
2147
|
+
if (!Array.isArray(extensions)) return [];
|
|
2148
|
+
return extensions.map((entry) => typeof entry === "string" ? entry.trim() : "").filter(Boolean);
|
|
2149
|
+
}
|
|
2150
|
+
async function listInstalledPluginDirs(params) {
|
|
2151
|
+
const extensionsDir = path.join(params.stateDir, "extensions");
|
|
2152
|
+
const st = await safeStat(extensionsDir);
|
|
2153
|
+
if (!st.ok || !st.isDir) return {
|
|
2154
|
+
extensionsDir,
|
|
2155
|
+
pluginDirs: []
|
|
2156
|
+
};
|
|
2157
|
+
return {
|
|
2158
|
+
extensionsDir,
|
|
2159
|
+
pluginDirs: (await fsp.readdir(extensionsDir, { withFileTypes: true }).catch((err) => {
|
|
2160
|
+
params.onReadError?.(err);
|
|
2161
|
+
return [];
|
|
2162
|
+
})).filter((entry) => entry.isDirectory()).map((entry) => entry.name).filter(Boolean)
|
|
2163
|
+
};
|
|
2164
|
+
}
|
|
2165
|
+
function resolveToolPolicies(params) {
|
|
2166
|
+
const policies = [
|
|
2167
|
+
resolveToolProfilePolicy(params.agentTools?.profile ?? params.cfg.tools?.profile),
|
|
2168
|
+
normalizeToolPolicy(params.cfg.tools ?? void 0),
|
|
2169
|
+
normalizeToolPolicy(params.agentTools)
|
|
2170
|
+
];
|
|
2171
|
+
if (params.sandboxMode === "all") policies.push(resolveToolPolicyForAgent(params.cfg, params.agentId ?? void 0));
|
|
2172
|
+
return policies;
|
|
2173
|
+
}
|
|
2174
|
+
function normalizePluginIdSet(entries) {
|
|
2175
|
+
return new Set(entries.map((entry) => entry.trim().toLowerCase()).filter(Boolean));
|
|
2176
|
+
}
|
|
2177
|
+
function resolveEnabledExtensionPluginIds(params) {
|
|
2178
|
+
const normalized = normalizePluginsConfig(params.cfg.plugins);
|
|
2179
|
+
if (!normalized.enabled) return [];
|
|
2180
|
+
const allowSet = normalizePluginIdSet(normalized.allow);
|
|
2181
|
+
const denySet = normalizePluginIdSet(normalized.deny);
|
|
2182
|
+
const entryById = /* @__PURE__ */ new Map();
|
|
2183
|
+
for (const [id, entry] of Object.entries(normalized.entries)) entryById.set(id.trim().toLowerCase(), entry);
|
|
2184
|
+
const enabled = [];
|
|
2185
|
+
for (const id of params.pluginDirs) {
|
|
2186
|
+
const normalizedId = id.trim().toLowerCase();
|
|
2187
|
+
if (!normalizedId) continue;
|
|
2188
|
+
if (denySet.has(normalizedId)) continue;
|
|
2189
|
+
if (allowSet.size > 0 && !allowSet.has(normalizedId)) continue;
|
|
2190
|
+
if (entryById.get(normalizedId)?.enabled === false) continue;
|
|
2191
|
+
enabled.push(normalizedId);
|
|
2192
|
+
}
|
|
2193
|
+
return enabled;
|
|
2194
|
+
}
|
|
2195
|
+
function collectAllowEntries(config) {
|
|
2196
|
+
const out = [];
|
|
2197
|
+
if (Array.isArray(config?.allow)) out.push(...config.allow);
|
|
2198
|
+
if (Array.isArray(config?.alsoAllow)) out.push(...config.alsoAllow);
|
|
2199
|
+
return out.map((entry) => entry.trim().toLowerCase()).filter(Boolean);
|
|
2200
|
+
}
|
|
2201
|
+
function hasExplicitPluginAllow(params) {
|
|
2202
|
+
return params.allowEntries.some((entry) => entry === "group:plugins" || params.enabledPluginIds.has(entry));
|
|
2203
|
+
}
|
|
2204
|
+
function hasProviderPluginAllow(params) {
|
|
2205
|
+
if (!params.byProvider) return false;
|
|
2206
|
+
for (const policy of Object.values(params.byProvider)) if (hasExplicitPluginAllow({
|
|
2207
|
+
allowEntries: collectAllowEntries(policy),
|
|
2208
|
+
enabledPluginIds: params.enabledPluginIds
|
|
2209
|
+
})) return true;
|
|
2210
|
+
return false;
|
|
2211
|
+
}
|
|
2212
|
+
function isPinnedRegistrySpec(spec) {
|
|
2213
|
+
const value = spec.trim();
|
|
2214
|
+
if (!value) return false;
|
|
2215
|
+
const at = value.lastIndexOf("@");
|
|
2216
|
+
if (at <= 0 || at >= value.length - 1) return false;
|
|
2217
|
+
const version = value.slice(at + 1).trim();
|
|
2218
|
+
return /^v?\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(version);
|
|
2219
|
+
}
|
|
2220
|
+
async function readInstalledPackageVersion(dir) {
|
|
2221
|
+
try {
|
|
2222
|
+
const raw = await fsp.readFile(path.join(dir, "package.json"), "utf-8");
|
|
2223
|
+
const parsed = JSON.parse(raw);
|
|
2224
|
+
return typeof parsed.version === "string" ? parsed.version : void 0;
|
|
2225
|
+
} catch {
|
|
2226
|
+
return;
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
async function collectPluginsTrustFindings(params) {
|
|
2230
|
+
const findings = [];
|
|
2231
|
+
const { extensionsDir, pluginDirs } = await listInstalledPluginDirs({ stateDir: params.stateDir });
|
|
2232
|
+
if (pluginDirs.length > 0) {
|
|
2233
|
+
const allow = params.cfg.plugins?.allow;
|
|
2234
|
+
if (!(Array.isArray(allow) && allow.length > 0)) findings.push({
|
|
2235
|
+
checkId: "plugins.extensions_no_allowlist",
|
|
2236
|
+
severity: "warn",
|
|
2237
|
+
title: "Extensions exist but plugins.allow is not set",
|
|
2238
|
+
detail: `Found ${pluginDirs.length} extension(s) under ${extensionsDir}. Without plugins.allow, any discovered plugin id may load (depending on config and plugin behavior).`,
|
|
2239
|
+
remediation: "Set plugins.allow to an explicit list of plugin ids you trust."
|
|
2240
|
+
});
|
|
2241
|
+
const enabledExtensionPluginIds = resolveEnabledExtensionPluginIds({
|
|
2242
|
+
cfg: params.cfg,
|
|
2243
|
+
pluginDirs
|
|
2244
|
+
});
|
|
2245
|
+
if (enabledExtensionPluginIds.length > 0) {
|
|
2246
|
+
const enabledPluginSet = new Set(enabledExtensionPluginIds);
|
|
2247
|
+
const contexts = [{ label: "default" }];
|
|
2248
|
+
for (const entry of params.cfg.agents?.list ?? []) {
|
|
2249
|
+
if (!entry || typeof entry !== "object" || typeof entry.id !== "string") continue;
|
|
2250
|
+
contexts.push({
|
|
2251
|
+
label: `agents.list.${entry.id}`,
|
|
2252
|
+
agentId: entry.id,
|
|
2253
|
+
tools: entry.tools
|
|
2254
|
+
});
|
|
2255
|
+
}
|
|
2256
|
+
const permissiveContexts = [];
|
|
2257
|
+
for (const context of contexts) {
|
|
2258
|
+
const profile = context.tools?.profile ?? params.cfg.tools?.profile;
|
|
2259
|
+
const restrictiveProfile = Boolean(resolveToolProfilePolicy(profile));
|
|
2260
|
+
const sandboxMode = resolveSandboxConfigForAgent(params.cfg, context.agentId).mode;
|
|
2261
|
+
const broadPolicy = isToolAllowedByPolicies("__remoteclaw_plugin_probe__", resolveToolPolicies({
|
|
2262
|
+
cfg: params.cfg,
|
|
2263
|
+
agentTools: context.tools,
|
|
2264
|
+
sandboxMode,
|
|
2265
|
+
agentId: context.agentId
|
|
2266
|
+
}));
|
|
2267
|
+
const explicitPluginAllow = !restrictiveProfile && (hasExplicitPluginAllow({
|
|
2268
|
+
allowEntries: collectAllowEntries(params.cfg.tools),
|
|
2269
|
+
enabledPluginIds: enabledPluginSet
|
|
2270
|
+
}) || hasProviderPluginAllow({
|
|
2271
|
+
byProvider: params.cfg.tools?.byProvider,
|
|
2272
|
+
enabledPluginIds: enabledPluginSet
|
|
2273
|
+
}) || hasExplicitPluginAllow({
|
|
2274
|
+
allowEntries: collectAllowEntries(context.tools),
|
|
2275
|
+
enabledPluginIds: enabledPluginSet
|
|
2276
|
+
}) || hasProviderPluginAllow({
|
|
2277
|
+
byProvider: context.tools?.byProvider,
|
|
2278
|
+
enabledPluginIds: enabledPluginSet
|
|
2279
|
+
}));
|
|
2280
|
+
if (broadPolicy || explicitPluginAllow) permissiveContexts.push(context.label);
|
|
2281
|
+
}
|
|
2282
|
+
if (permissiveContexts.length > 0) findings.push({
|
|
2283
|
+
checkId: "plugins.tools_reachable_permissive_policy",
|
|
2284
|
+
severity: "warn",
|
|
2285
|
+
title: "Extension plugin tools may be reachable under permissive tool policy",
|
|
2286
|
+
detail: `Enabled extension plugins: ${enabledExtensionPluginIds.join(", ")}.\nPermissive tool policy contexts:\n${permissiveContexts.map((entry) => `- ${entry}`).join("\n")}`,
|
|
2287
|
+
remediation: "Use restrictive profiles (`minimal`/`coding`) or explicit tool allowlists that exclude plugin tools for agents handling untrusted input."
|
|
2288
|
+
});
|
|
2289
|
+
}
|
|
2290
|
+
}
|
|
2291
|
+
const pluginInstalls = params.cfg.plugins?.installs ?? {};
|
|
2292
|
+
const npmPluginInstalls = Object.entries(pluginInstalls).filter(([, record]) => record?.source === "npm");
|
|
2293
|
+
if (npmPluginInstalls.length > 0) {
|
|
2294
|
+
const unpinned = npmPluginInstalls.filter(([, record]) => typeof record.spec === "string" && !isPinnedRegistrySpec(record.spec)).map(([pluginId, record]) => `${pluginId} (${record.spec})`);
|
|
2295
|
+
if (unpinned.length > 0) findings.push({
|
|
2296
|
+
checkId: "plugins.installs_unpinned_npm_specs",
|
|
2297
|
+
severity: "warn",
|
|
2298
|
+
title: "Plugin installs include unpinned npm specs",
|
|
2299
|
+
detail: `Unpinned plugin install records:\n${unpinned.map((entry) => `- ${entry}`).join("\n")}`,
|
|
2300
|
+
remediation: "Pin install specs to exact versions (for example, `@scope/pkg@1.2.3`) for higher supply-chain stability."
|
|
2301
|
+
});
|
|
2302
|
+
const missingIntegrity = npmPluginInstalls.filter(([, record]) => typeof record.integrity !== "string" || record.integrity.trim() === "").map(([pluginId]) => pluginId);
|
|
2303
|
+
if (missingIntegrity.length > 0) findings.push({
|
|
2304
|
+
checkId: "plugins.installs_missing_integrity",
|
|
2305
|
+
severity: "warn",
|
|
2306
|
+
title: "Plugin installs are missing integrity metadata",
|
|
2307
|
+
detail: `Plugin install records missing integrity:\n${missingIntegrity.map((entry) => `- ${entry}`).join("\n")}`,
|
|
2308
|
+
remediation: "Reinstall or update plugins to refresh install metadata with resolved integrity hashes."
|
|
2309
|
+
});
|
|
2310
|
+
const pluginVersionDrift = [];
|
|
2311
|
+
for (const [pluginId, record] of npmPluginInstalls) {
|
|
2312
|
+
const recordedVersion = record.resolvedVersion ?? record.version;
|
|
2313
|
+
if (!recordedVersion) continue;
|
|
2314
|
+
const installedVersion = await readInstalledPackageVersion(record.installPath ?? path.join(params.stateDir, "extensions", pluginId));
|
|
2315
|
+
if (!installedVersion || installedVersion === recordedVersion) continue;
|
|
2316
|
+
pluginVersionDrift.push(`${pluginId} (recorded ${recordedVersion}, installed ${installedVersion})`);
|
|
2317
|
+
}
|
|
2318
|
+
if (pluginVersionDrift.length > 0) findings.push({
|
|
2319
|
+
checkId: "plugins.installs_version_drift",
|
|
2320
|
+
severity: "warn",
|
|
2321
|
+
title: "Plugin install records drift from installed package versions",
|
|
2322
|
+
detail: `Detected plugin install metadata drift:\n${pluginVersionDrift.map((entry) => `- ${entry}`).join("\n")}`,
|
|
2323
|
+
remediation: "Run `remoteclaw plugins update --all` (or reinstall affected plugins) to refresh install metadata."
|
|
2324
|
+
});
|
|
2325
|
+
}
|
|
2326
|
+
const hookInstalls = params.cfg.hooks?.internal?.installs ?? {};
|
|
2327
|
+
const npmHookInstalls = Object.entries(hookInstalls).filter(([, record]) => record?.source === "npm");
|
|
2328
|
+
if (npmHookInstalls.length > 0) {
|
|
2329
|
+
const unpinned = npmHookInstalls.filter(([, record]) => typeof record.spec === "string" && !isPinnedRegistrySpec(record.spec)).map(([hookId, record]) => `${hookId} (${record.spec})`);
|
|
2330
|
+
if (unpinned.length > 0) findings.push({
|
|
2331
|
+
checkId: "hooks.installs_unpinned_npm_specs",
|
|
2332
|
+
severity: "warn",
|
|
2333
|
+
title: "Hook installs include unpinned npm specs",
|
|
2334
|
+
detail: `Unpinned hook install records:\n${unpinned.map((entry) => `- ${entry}`).join("\n")}`,
|
|
2335
|
+
remediation: "Pin hook install specs to exact versions (for example, `@scope/pkg@1.2.3`) for higher supply-chain stability."
|
|
2336
|
+
});
|
|
2337
|
+
const missingIntegrity = npmHookInstalls.filter(([, record]) => typeof record.integrity !== "string" || record.integrity.trim() === "").map(([hookId]) => hookId);
|
|
2338
|
+
if (missingIntegrity.length > 0) findings.push({
|
|
2339
|
+
checkId: "hooks.installs_missing_integrity",
|
|
2340
|
+
severity: "warn",
|
|
2341
|
+
title: "Hook installs are missing integrity metadata",
|
|
2342
|
+
detail: `Hook install records missing integrity:\n${missingIntegrity.map((entry) => `- ${entry}`).join("\n")}`,
|
|
2343
|
+
remediation: "Reinstall or update hooks to refresh install metadata with resolved integrity hashes."
|
|
2344
|
+
});
|
|
2345
|
+
const hookVersionDrift = [];
|
|
2346
|
+
for (const [hookId, record] of npmHookInstalls) {
|
|
2347
|
+
const recordedVersion = record.resolvedVersion ?? record.version;
|
|
2348
|
+
if (!recordedVersion) continue;
|
|
2349
|
+
const installedVersion = await readInstalledPackageVersion(record.installPath ?? path.join(params.stateDir, "hooks", hookId));
|
|
2350
|
+
if (!installedVersion || installedVersion === recordedVersion) continue;
|
|
2351
|
+
hookVersionDrift.push(`${hookId} (recorded ${recordedVersion}, installed ${installedVersion})`);
|
|
2352
|
+
}
|
|
2353
|
+
if (hookVersionDrift.length > 0) findings.push({
|
|
2354
|
+
checkId: "hooks.installs_version_drift",
|
|
2355
|
+
severity: "warn",
|
|
2356
|
+
title: "Hook install records drift from installed package versions",
|
|
2357
|
+
detail: `Detected hook install metadata drift:\n${hookVersionDrift.map((entry) => `- ${entry}`).join("\n")}`,
|
|
2358
|
+
remediation: "Run `remoteclaw hooks update --all` (or reinstall affected hooks) to refresh install metadata."
|
|
2359
|
+
});
|
|
2360
|
+
}
|
|
2361
|
+
return findings;
|
|
2362
|
+
}
|
|
2363
|
+
async function collectIncludeFilePermFindings(params) {
|
|
2364
|
+
const findings = [];
|
|
2365
|
+
if (!params.configSnapshot.exists) return findings;
|
|
2366
|
+
const configPath = params.configSnapshot.path;
|
|
2367
|
+
const includePaths = await collectIncludePathsRecursive({
|
|
2368
|
+
configPath,
|
|
2369
|
+
parsed: params.configSnapshot.parsed
|
|
2370
|
+
});
|
|
2371
|
+
if (includePaths.length === 0) return findings;
|
|
2372
|
+
for (const p of includePaths) {
|
|
2373
|
+
const perms = await inspectPathPermissions(p, {
|
|
2374
|
+
env: params.env,
|
|
2375
|
+
platform: params.platform,
|
|
2376
|
+
exec: params.execIcacls
|
|
2377
|
+
});
|
|
2378
|
+
if (!perms.ok) continue;
|
|
2379
|
+
if (perms.worldWritable || perms.groupWritable) findings.push({
|
|
2380
|
+
checkId: "fs.config_include.perms_writable",
|
|
2381
|
+
severity: "critical",
|
|
2382
|
+
title: "Config include file is writable by others",
|
|
2383
|
+
detail: `${formatPermissionDetail(p, perms)}; another user could influence your effective config.`,
|
|
2384
|
+
remediation: formatPermissionRemediation({
|
|
2385
|
+
targetPath: p,
|
|
2386
|
+
perms,
|
|
2387
|
+
isDir: false,
|
|
2388
|
+
posixMode: 384,
|
|
2389
|
+
env: params.env
|
|
2390
|
+
})
|
|
2391
|
+
});
|
|
2392
|
+
else if (perms.worldReadable) findings.push({
|
|
2393
|
+
checkId: "fs.config_include.perms_world_readable",
|
|
2394
|
+
severity: "critical",
|
|
2395
|
+
title: "Config include file is world-readable",
|
|
2396
|
+
detail: `${formatPermissionDetail(p, perms)}; include files can contain tokens and private settings.`,
|
|
2397
|
+
remediation: formatPermissionRemediation({
|
|
2398
|
+
targetPath: p,
|
|
2399
|
+
perms,
|
|
2400
|
+
isDir: false,
|
|
2401
|
+
posixMode: 384,
|
|
2402
|
+
env: params.env
|
|
2403
|
+
})
|
|
2404
|
+
});
|
|
2405
|
+
else if (perms.groupReadable) findings.push({
|
|
2406
|
+
checkId: "fs.config_include.perms_group_readable",
|
|
2407
|
+
severity: "warn",
|
|
2408
|
+
title: "Config include file is group-readable",
|
|
2409
|
+
detail: `${formatPermissionDetail(p, perms)}; include files can contain tokens and private settings.`,
|
|
2410
|
+
remediation: formatPermissionRemediation({
|
|
2411
|
+
targetPath: p,
|
|
2412
|
+
perms,
|
|
2413
|
+
isDir: false,
|
|
2414
|
+
posixMode: 384,
|
|
2415
|
+
env: params.env
|
|
2416
|
+
})
|
|
2417
|
+
});
|
|
2418
|
+
}
|
|
2419
|
+
return findings;
|
|
2420
|
+
}
|
|
2421
|
+
async function collectStateDeepFilesystemFindings(params) {
|
|
2422
|
+
const findings = [];
|
|
2423
|
+
const oauthDir = resolveOAuthDir(params.env, params.stateDir);
|
|
2424
|
+
const oauthPerms = await inspectPathPermissions(oauthDir, {
|
|
2425
|
+
env: params.env,
|
|
2426
|
+
platform: params.platform,
|
|
2427
|
+
exec: params.execIcacls
|
|
2428
|
+
});
|
|
2429
|
+
if (oauthPerms.ok && oauthPerms.isDir) {
|
|
2430
|
+
if (oauthPerms.worldWritable || oauthPerms.groupWritable) findings.push({
|
|
2431
|
+
checkId: "fs.credentials_dir.perms_writable",
|
|
2432
|
+
severity: "critical",
|
|
2433
|
+
title: "Credentials dir is writable by others",
|
|
2434
|
+
detail: `${formatPermissionDetail(oauthDir, oauthPerms)}; another user could drop/modify credential files.`,
|
|
2435
|
+
remediation: formatPermissionRemediation({
|
|
2436
|
+
targetPath: oauthDir,
|
|
2437
|
+
perms: oauthPerms,
|
|
2438
|
+
isDir: true,
|
|
2439
|
+
posixMode: 448,
|
|
2440
|
+
env: params.env
|
|
2441
|
+
})
|
|
2442
|
+
});
|
|
2443
|
+
else if (oauthPerms.groupReadable || oauthPerms.worldReadable) findings.push({
|
|
2444
|
+
checkId: "fs.credentials_dir.perms_readable",
|
|
2445
|
+
severity: "warn",
|
|
2446
|
+
title: "Credentials dir is readable by others",
|
|
2447
|
+
detail: `${formatPermissionDetail(oauthDir, oauthPerms)}; credentials and allowlists can be sensitive.`,
|
|
2448
|
+
remediation: formatPermissionRemediation({
|
|
2449
|
+
targetPath: oauthDir,
|
|
2450
|
+
perms: oauthPerms,
|
|
2451
|
+
isDir: true,
|
|
2452
|
+
posixMode: 448,
|
|
2453
|
+
env: params.env
|
|
2454
|
+
})
|
|
2455
|
+
});
|
|
2456
|
+
}
|
|
2457
|
+
const agentIds = Array.isArray(params.cfg.agents?.list) ? params.cfg.agents?.list.map((a) => a && typeof a === "object" && typeof a.id === "string" ? a.id.trim() : "").filter(Boolean) : [];
|
|
2458
|
+
const defaultAgentId = resolveDefaultAgentId(params.cfg);
|
|
2459
|
+
const ids = Array.from(new Set([defaultAgentId, ...agentIds])).map((id) => normalizeAgentId(id));
|
|
2460
|
+
for (const agentId of ids) {
|
|
2461
|
+
const agentDir = path.join(params.stateDir, "agents", agentId, "agent");
|
|
2462
|
+
const authPath = path.join(agentDir, "auth-profiles.json");
|
|
2463
|
+
const authPerms = await inspectPathPermissions(authPath, {
|
|
2464
|
+
env: params.env,
|
|
2465
|
+
platform: params.platform,
|
|
2466
|
+
exec: params.execIcacls
|
|
2467
|
+
});
|
|
2468
|
+
if (authPerms.ok) {
|
|
2469
|
+
if (authPerms.worldWritable || authPerms.groupWritable) findings.push({
|
|
2470
|
+
checkId: "fs.auth_profiles.perms_writable",
|
|
2471
|
+
severity: "critical",
|
|
2472
|
+
title: "auth-profiles.json is writable by others",
|
|
2473
|
+
detail: `${formatPermissionDetail(authPath, authPerms)}; another user could inject credentials.`,
|
|
2474
|
+
remediation: formatPermissionRemediation({
|
|
2475
|
+
targetPath: authPath,
|
|
2476
|
+
perms: authPerms,
|
|
2477
|
+
isDir: false,
|
|
2478
|
+
posixMode: 384,
|
|
2479
|
+
env: params.env
|
|
2480
|
+
})
|
|
2481
|
+
});
|
|
2482
|
+
else if (authPerms.worldReadable || authPerms.groupReadable) findings.push({
|
|
2483
|
+
checkId: "fs.auth_profiles.perms_readable",
|
|
2484
|
+
severity: "warn",
|
|
2485
|
+
title: "auth-profiles.json is readable by others",
|
|
2486
|
+
detail: `${formatPermissionDetail(authPath, authPerms)}; auth-profiles.json contains API keys and OAuth tokens.`,
|
|
2487
|
+
remediation: formatPermissionRemediation({
|
|
2488
|
+
targetPath: authPath,
|
|
2489
|
+
perms: authPerms,
|
|
2490
|
+
isDir: false,
|
|
2491
|
+
posixMode: 384,
|
|
2492
|
+
env: params.env
|
|
2493
|
+
})
|
|
2494
|
+
});
|
|
2495
|
+
}
|
|
2496
|
+
const storePath = path.join(params.stateDir, "agents", agentId, "sessions", "sessions.json");
|
|
2497
|
+
const storePerms = await inspectPathPermissions(storePath, {
|
|
2498
|
+
env: params.env,
|
|
2499
|
+
platform: params.platform,
|
|
2500
|
+
exec: params.execIcacls
|
|
2501
|
+
});
|
|
2502
|
+
if (storePerms.ok) {
|
|
2503
|
+
if (storePerms.worldReadable || storePerms.groupReadable) findings.push({
|
|
2504
|
+
checkId: "fs.sessions_store.perms_readable",
|
|
2505
|
+
severity: "warn",
|
|
2506
|
+
title: "sessions.json is readable by others",
|
|
2507
|
+
detail: `${formatPermissionDetail(storePath, storePerms)}; routing and transcript metadata can be sensitive.`,
|
|
2508
|
+
remediation: formatPermissionRemediation({
|
|
2509
|
+
targetPath: storePath,
|
|
2510
|
+
perms: storePerms,
|
|
2511
|
+
isDir: false,
|
|
2512
|
+
posixMode: 384,
|
|
2513
|
+
env: params.env
|
|
2514
|
+
})
|
|
2515
|
+
});
|
|
2516
|
+
}
|
|
2517
|
+
}
|
|
2518
|
+
const logFile = typeof params.cfg.logging?.file === "string" ? params.cfg.logging.file.trim() : "";
|
|
2519
|
+
if (logFile) {
|
|
2520
|
+
const expanded = logFile.startsWith("~") ? expandTilde(logFile, params.env) : logFile;
|
|
2521
|
+
if (expanded) {
|
|
2522
|
+
const logPath = path.resolve(expanded);
|
|
2523
|
+
const logPerms = await inspectPathPermissions(logPath, {
|
|
2524
|
+
env: params.env,
|
|
2525
|
+
platform: params.platform,
|
|
2526
|
+
exec: params.execIcacls
|
|
2527
|
+
});
|
|
2528
|
+
if (logPerms.ok) {
|
|
2529
|
+
if (logPerms.worldReadable || logPerms.groupReadable) findings.push({
|
|
2530
|
+
checkId: "fs.log_file.perms_readable",
|
|
2531
|
+
severity: "warn",
|
|
2532
|
+
title: "Log file is readable by others",
|
|
2533
|
+
detail: `${formatPermissionDetail(logPath, logPerms)}; logs can contain private messages and tool output.`,
|
|
2534
|
+
remediation: formatPermissionRemediation({
|
|
2535
|
+
targetPath: logPath,
|
|
2536
|
+
perms: logPerms,
|
|
2537
|
+
isDir: false,
|
|
2538
|
+
posixMode: 384,
|
|
2539
|
+
env: params.env
|
|
2540
|
+
})
|
|
2541
|
+
});
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
return findings;
|
|
2546
|
+
}
|
|
2547
|
+
async function readConfigSnapshotForAudit(params) {
|
|
2548
|
+
return await createConfigIO({
|
|
2549
|
+
env: params.env,
|
|
2550
|
+
configPath: params.configPath
|
|
2551
|
+
}).readConfigFileSnapshot();
|
|
2552
|
+
}
|
|
2553
|
+
async function collectPluginsCodeSafetyFindings(params) {
|
|
2554
|
+
const findings = [];
|
|
2555
|
+
const { extensionsDir, pluginDirs } = await listInstalledPluginDirs({
|
|
2556
|
+
stateDir: params.stateDir,
|
|
2557
|
+
onReadError: (err) => {
|
|
2558
|
+
findings.push({
|
|
2559
|
+
checkId: "plugins.code_safety.scan_failed",
|
|
2560
|
+
severity: "warn",
|
|
2561
|
+
title: "Plugin extensions directory scan failed",
|
|
2562
|
+
detail: `Static code scan could not list extensions directory: ${String(err)}`,
|
|
2563
|
+
remediation: "Check file permissions and plugin layout, then rerun `remoteclaw security audit --deep`."
|
|
2564
|
+
});
|
|
2565
|
+
}
|
|
2566
|
+
});
|
|
2567
|
+
for (const pluginName of pluginDirs) {
|
|
2568
|
+
const pluginPath = path.join(extensionsDir, pluginName);
|
|
2569
|
+
const extensionEntries = await readPluginManifestExtensions(pluginPath).catch(() => []);
|
|
2570
|
+
const forcedScanEntries = [];
|
|
2571
|
+
const escapedEntries = [];
|
|
2572
|
+
for (const entry of extensionEntries) {
|
|
2573
|
+
const resolvedEntry = path.resolve(pluginPath, entry);
|
|
2574
|
+
if (!isPathInside(pluginPath, resolvedEntry)) {
|
|
2575
|
+
escapedEntries.push(entry);
|
|
2576
|
+
continue;
|
|
2577
|
+
}
|
|
2578
|
+
if (extensionUsesSkippedScannerPath(entry)) findings.push({
|
|
2579
|
+
checkId: "plugins.code_safety.entry_path",
|
|
2580
|
+
severity: "warn",
|
|
2581
|
+
title: `Plugin "${pluginName}" entry path is hidden or node_modules`,
|
|
2582
|
+
detail: `Extension entry "${entry}" points to a hidden or node_modules path. Deep code scan will cover this entry explicitly, but review this path choice carefully.`,
|
|
2583
|
+
remediation: "Prefer extension entrypoints under normal source paths like dist/ or src/."
|
|
2584
|
+
});
|
|
2585
|
+
forcedScanEntries.push(resolvedEntry);
|
|
2586
|
+
}
|
|
2587
|
+
if (escapedEntries.length > 0) findings.push({
|
|
2588
|
+
checkId: "plugins.code_safety.entry_escape",
|
|
2589
|
+
severity: "critical",
|
|
2590
|
+
title: `Plugin "${pluginName}" has extension entry path traversal`,
|
|
2591
|
+
detail: `Found extension entries that escape the plugin directory:\n${escapedEntries.map((entry) => ` - ${entry}`).join("\n")}`,
|
|
2592
|
+
remediation: "Update the plugin manifest so all remoteclaw.extensions entries stay inside the plugin directory."
|
|
2593
|
+
});
|
|
2594
|
+
}
|
|
2595
|
+
return findings;
|
|
2596
|
+
}
|
|
2597
|
+
|
|
2598
|
+
//#endregion
|
|
2599
|
+
//#region src/security/dangerous-config-flags.ts
|
|
2600
|
+
function collectEnabledInsecureOrDangerousFlags(cfg) {
|
|
2601
|
+
const enabledFlags = [];
|
|
2602
|
+
if (cfg.gateway?.controlUi?.allowInsecureAuth === true) enabledFlags.push("gateway.controlUi.allowInsecureAuth=true");
|
|
2603
|
+
if (cfg.gateway?.controlUi?.dangerouslyAllowHostHeaderOriginFallback === true) enabledFlags.push("gateway.controlUi.dangerouslyAllowHostHeaderOriginFallback=true");
|
|
2604
|
+
if (cfg.gateway?.controlUi?.dangerouslyDisableDeviceAuth === true) enabledFlags.push("gateway.controlUi.dangerouslyDisableDeviceAuth=true");
|
|
2605
|
+
if (cfg.hooks?.gmail?.allowUnsafeExternalContent === true) enabledFlags.push("hooks.gmail.allowUnsafeExternalContent=true");
|
|
2606
|
+
if (Array.isArray(cfg.hooks?.mappings)) {
|
|
2607
|
+
for (const [index, mapping] of cfg.hooks.mappings.entries()) if (mapping?.allowUnsafeExternalContent === true) enabledFlags.push(`hooks.mappings[${index}].allowUnsafeExternalContent=true`);
|
|
2608
|
+
}
|
|
2609
|
+
return enabledFlags;
|
|
2610
|
+
}
|
|
2611
|
+
|
|
2612
|
+
//#endregion
|
|
2613
|
+
//#region src/security/audit.ts
|
|
2614
|
+
function countBySeverity(findings) {
|
|
2615
|
+
let critical = 0;
|
|
2616
|
+
let warn = 0;
|
|
2617
|
+
let info = 0;
|
|
2618
|
+
for (const f of findings) if (f.severity === "critical") critical += 1;
|
|
2619
|
+
else if (f.severity === "warn") warn += 1;
|
|
2620
|
+
else info += 1;
|
|
2621
|
+
return {
|
|
2622
|
+
critical,
|
|
2623
|
+
warn,
|
|
2624
|
+
info
|
|
2625
|
+
};
|
|
2626
|
+
}
|
|
2627
|
+
function normalizeAllowFromList(list) {
|
|
2628
|
+
if (!Array.isArray(list)) return [];
|
|
2629
|
+
return list.map((v) => String(v).trim()).filter(Boolean);
|
|
2630
|
+
}
|
|
2631
|
+
async function collectFilesystemFindings(params) {
|
|
2632
|
+
const findings = [];
|
|
2633
|
+
const stateDirPerms = await inspectPathPermissions(params.stateDir, {
|
|
2634
|
+
env: params.env,
|
|
2635
|
+
platform: params.platform,
|
|
2636
|
+
exec: params.execIcacls
|
|
2637
|
+
});
|
|
2638
|
+
if (stateDirPerms.ok) {
|
|
2639
|
+
if (stateDirPerms.isSymlink) findings.push({
|
|
2640
|
+
checkId: "fs.state_dir.symlink",
|
|
2641
|
+
severity: "warn",
|
|
2642
|
+
title: "State dir is a symlink",
|
|
2643
|
+
detail: `${params.stateDir} is a symlink; treat this as an extra trust boundary.`
|
|
2644
|
+
});
|
|
2645
|
+
if (stateDirPerms.worldWritable) findings.push({
|
|
2646
|
+
checkId: "fs.state_dir.perms_world_writable",
|
|
2647
|
+
severity: "critical",
|
|
2648
|
+
title: "State dir is world-writable",
|
|
2649
|
+
detail: `${formatPermissionDetail(params.stateDir, stateDirPerms)}; other users can write into your RemoteClaw state.`,
|
|
2650
|
+
remediation: formatPermissionRemediation({
|
|
2651
|
+
targetPath: params.stateDir,
|
|
2652
|
+
perms: stateDirPerms,
|
|
2653
|
+
isDir: true,
|
|
2654
|
+
posixMode: 448,
|
|
2655
|
+
env: params.env
|
|
2656
|
+
})
|
|
2657
|
+
});
|
|
2658
|
+
else if (stateDirPerms.groupWritable) findings.push({
|
|
2659
|
+
checkId: "fs.state_dir.perms_group_writable",
|
|
2660
|
+
severity: "warn",
|
|
2661
|
+
title: "State dir is group-writable",
|
|
2662
|
+
detail: `${formatPermissionDetail(params.stateDir, stateDirPerms)}; group users can write into your RemoteClaw state.`,
|
|
2663
|
+
remediation: formatPermissionRemediation({
|
|
2664
|
+
targetPath: params.stateDir,
|
|
2665
|
+
perms: stateDirPerms,
|
|
2666
|
+
isDir: true,
|
|
2667
|
+
posixMode: 448,
|
|
2668
|
+
env: params.env
|
|
2669
|
+
})
|
|
2670
|
+
});
|
|
2671
|
+
else if (stateDirPerms.groupReadable || stateDirPerms.worldReadable) findings.push({
|
|
2672
|
+
checkId: "fs.state_dir.perms_readable",
|
|
2673
|
+
severity: "warn",
|
|
2674
|
+
title: "State dir is readable by others",
|
|
2675
|
+
detail: `${formatPermissionDetail(params.stateDir, stateDirPerms)}; consider restricting to 700.`,
|
|
2676
|
+
remediation: formatPermissionRemediation({
|
|
2677
|
+
targetPath: params.stateDir,
|
|
2678
|
+
perms: stateDirPerms,
|
|
2679
|
+
isDir: true,
|
|
2680
|
+
posixMode: 448,
|
|
2681
|
+
env: params.env
|
|
2682
|
+
})
|
|
2683
|
+
});
|
|
2684
|
+
}
|
|
2685
|
+
const configPerms = await inspectPathPermissions(params.configPath, {
|
|
2686
|
+
env: params.env,
|
|
2687
|
+
platform: params.platform,
|
|
2688
|
+
exec: params.execIcacls
|
|
2689
|
+
});
|
|
2690
|
+
if (configPerms.ok) {
|
|
2691
|
+
const skipReadablePermWarnings = configPerms.isSymlink;
|
|
2692
|
+
if (configPerms.isSymlink) findings.push({
|
|
2693
|
+
checkId: "fs.config.symlink",
|
|
2694
|
+
severity: "warn",
|
|
2695
|
+
title: "Config file is a symlink",
|
|
2696
|
+
detail: `${params.configPath} is a symlink; make sure you trust its target.`
|
|
2697
|
+
});
|
|
2698
|
+
if (configPerms.worldWritable || configPerms.groupWritable) findings.push({
|
|
2699
|
+
checkId: "fs.config.perms_writable",
|
|
2700
|
+
severity: "critical",
|
|
2701
|
+
title: "Config file is writable by others",
|
|
2702
|
+
detail: `${formatPermissionDetail(params.configPath, configPerms)}; another user could change gateway/auth/tool policies.`,
|
|
2703
|
+
remediation: formatPermissionRemediation({
|
|
2704
|
+
targetPath: params.configPath,
|
|
2705
|
+
perms: configPerms,
|
|
2706
|
+
isDir: false,
|
|
2707
|
+
posixMode: 384,
|
|
2708
|
+
env: params.env
|
|
2709
|
+
})
|
|
2710
|
+
});
|
|
2711
|
+
else if (!skipReadablePermWarnings && configPerms.worldReadable) findings.push({
|
|
2712
|
+
checkId: "fs.config.perms_world_readable",
|
|
2713
|
+
severity: "critical",
|
|
2714
|
+
title: "Config file is world-readable",
|
|
2715
|
+
detail: `${formatPermissionDetail(params.configPath, configPerms)}; config can contain tokens and private settings.`,
|
|
2716
|
+
remediation: formatPermissionRemediation({
|
|
2717
|
+
targetPath: params.configPath,
|
|
2718
|
+
perms: configPerms,
|
|
2719
|
+
isDir: false,
|
|
2720
|
+
posixMode: 384,
|
|
2721
|
+
env: params.env
|
|
2722
|
+
})
|
|
2723
|
+
});
|
|
2724
|
+
else if (!skipReadablePermWarnings && configPerms.groupReadable) findings.push({
|
|
2725
|
+
checkId: "fs.config.perms_group_readable",
|
|
2726
|
+
severity: "warn",
|
|
2727
|
+
title: "Config file is group-readable",
|
|
2728
|
+
detail: `${formatPermissionDetail(params.configPath, configPerms)}; config can contain tokens and private settings.`,
|
|
2729
|
+
remediation: formatPermissionRemediation({
|
|
2730
|
+
targetPath: params.configPath,
|
|
2731
|
+
perms: configPerms,
|
|
2732
|
+
isDir: false,
|
|
2733
|
+
posixMode: 384,
|
|
2734
|
+
env: params.env
|
|
2735
|
+
})
|
|
2736
|
+
});
|
|
2737
|
+
}
|
|
2738
|
+
return findings;
|
|
2739
|
+
}
|
|
2740
|
+
function collectGatewayConfigFindings(cfg, env) {
|
|
2741
|
+
const findings = [];
|
|
2742
|
+
const bind = typeof cfg.gateway?.bind === "string" ? cfg.gateway.bind : "loopback";
|
|
2743
|
+
const tailscaleMode = cfg.gateway?.tailscale?.mode ?? "off";
|
|
2744
|
+
const auth = resolveGatewayAuth({
|
|
2745
|
+
authConfig: cfg.gateway?.auth,
|
|
2746
|
+
tailscaleMode,
|
|
2747
|
+
env
|
|
2748
|
+
});
|
|
2749
|
+
const controlUiEnabled = cfg.gateway?.controlUi?.enabled !== false;
|
|
2750
|
+
const controlUiAllowedOrigins = (cfg.gateway?.controlUi?.allowedOrigins ?? []).map((value) => value.trim()).filter(Boolean);
|
|
2751
|
+
const dangerouslyAllowHostHeaderOriginFallback = cfg.gateway?.controlUi?.dangerouslyAllowHostHeaderOriginFallback === true;
|
|
2752
|
+
const trustedProxies = Array.isArray(cfg.gateway?.trustedProxies) ? cfg.gateway.trustedProxies : [];
|
|
2753
|
+
const hasToken = typeof auth.token === "string" && auth.token.trim().length > 0;
|
|
2754
|
+
const hasPassword = typeof auth.password === "string" && auth.password.trim().length > 0;
|
|
2755
|
+
const hasSharedSecret = auth.mode === "token" && hasToken || auth.mode === "password" && hasPassword;
|
|
2756
|
+
const hasTailscaleAuth = auth.allowTailscale && tailscaleMode === "serve";
|
|
2757
|
+
const hasGatewayAuth = hasSharedSecret || hasTailscaleAuth;
|
|
2758
|
+
const allowRealIpFallback = cfg.gateway?.allowRealIpFallback === true;
|
|
2759
|
+
const mdnsMode = cfg.discovery?.mdns?.mode ?? "minimal";
|
|
2760
|
+
const gatewayToolsAllowRaw = Array.isArray(cfg.gateway?.tools?.allow) ? cfg.gateway?.tools?.allow : [];
|
|
2761
|
+
const gatewayToolsAllow = new Set(gatewayToolsAllowRaw.map((v) => typeof v === "string" ? v.trim().toLowerCase() : "").filter(Boolean));
|
|
2762
|
+
const reenabledOverHttp = DEFAULT_GATEWAY_HTTP_TOOL_DENY.filter((name) => gatewayToolsAllow.has(name));
|
|
2763
|
+
if (reenabledOverHttp.length > 0) {
|
|
2764
|
+
const extraRisk = bind !== "loopback" || tailscaleMode === "funnel";
|
|
2765
|
+
findings.push({
|
|
2766
|
+
checkId: "gateway.tools_invoke_http.dangerous_allow",
|
|
2767
|
+
severity: extraRisk ? "critical" : "warn",
|
|
2768
|
+
title: "Gateway HTTP /tools/invoke re-enables dangerous tools",
|
|
2769
|
+
detail: `gateway.tools.allow includes ${reenabledOverHttp.join(", ")} which removes them from the default HTTP deny list. This can allow remote session spawning / control-plane actions via HTTP and increases RCE blast radius if the gateway is reachable.`,
|
|
2770
|
+
remediation: "Remove these entries from gateway.tools.allow (recommended). If you keep them enabled, keep gateway.bind loopback-only (or tailnet-only), restrict network exposure, and treat the gateway token/password as full-admin."
|
|
2771
|
+
});
|
|
2772
|
+
}
|
|
2773
|
+
if (bind !== "loopback" && !hasSharedSecret && auth.mode !== "trusted-proxy") findings.push({
|
|
2774
|
+
checkId: "gateway.bind_no_auth",
|
|
2775
|
+
severity: "critical",
|
|
2776
|
+
title: "Gateway binds beyond loopback without auth",
|
|
2777
|
+
detail: `gateway.bind="${bind}" but no gateway.auth token/password is configured.`,
|
|
2778
|
+
remediation: `Set gateway.auth (token recommended) or bind to loopback.`
|
|
2779
|
+
});
|
|
2780
|
+
if (bind === "loopback" && controlUiEnabled && trustedProxies.length === 0) findings.push({
|
|
2781
|
+
checkId: "gateway.trusted_proxies_missing",
|
|
2782
|
+
severity: "warn",
|
|
2783
|
+
title: "Reverse proxy headers are not trusted",
|
|
2784
|
+
detail: "gateway.bind is loopback and gateway.trustedProxies is empty. If you expose the Control UI through a reverse proxy, configure trusted proxies so local-client checks cannot be spoofed.",
|
|
2785
|
+
remediation: "Set gateway.trustedProxies to your proxy IPs or keep the Control UI local-only."
|
|
2786
|
+
});
|
|
2787
|
+
if (bind === "loopback" && controlUiEnabled && !hasGatewayAuth) findings.push({
|
|
2788
|
+
checkId: "gateway.loopback_no_auth",
|
|
2789
|
+
severity: "critical",
|
|
2790
|
+
title: "Gateway auth missing on loopback",
|
|
2791
|
+
detail: "gateway.bind is loopback but no gateway auth secret is configured. If the Control UI is exposed through a reverse proxy, unauthenticated access is possible.",
|
|
2792
|
+
remediation: "Set gateway.auth (token recommended) or keep the Control UI local-only."
|
|
2793
|
+
});
|
|
2794
|
+
if (bind !== "loopback" && controlUiEnabled && controlUiAllowedOrigins.length === 0 && !dangerouslyAllowHostHeaderOriginFallback) findings.push({
|
|
2795
|
+
checkId: "gateway.control_ui.allowed_origins_required",
|
|
2796
|
+
severity: "critical",
|
|
2797
|
+
title: "Non-loopback Control UI missing explicit allowed origins",
|
|
2798
|
+
detail: "Control UI is enabled on a non-loopback bind but gateway.controlUi.allowedOrigins is empty. Strict origin policy requires explicit allowed origins for non-loopback deployments.",
|
|
2799
|
+
remediation: "Set gateway.controlUi.allowedOrigins to full trusted origins (for example https://control.example.com). If your deployment intentionally relies on Host-header origin fallback, set gateway.controlUi.dangerouslyAllowHostHeaderOriginFallback=true."
|
|
2800
|
+
});
|
|
2801
|
+
if (dangerouslyAllowHostHeaderOriginFallback) {
|
|
2802
|
+
const exposed = bind !== "loopback";
|
|
2803
|
+
findings.push({
|
|
2804
|
+
checkId: "gateway.control_ui.host_header_origin_fallback",
|
|
2805
|
+
severity: exposed ? "critical" : "warn",
|
|
2806
|
+
title: "DANGEROUS: Host-header origin fallback enabled",
|
|
2807
|
+
detail: "gateway.controlUi.dangerouslyAllowHostHeaderOriginFallback=true enables Host-header origin fallback for Control UI/WebChat websocket checks and weakens DNS rebinding protections.",
|
|
2808
|
+
remediation: "Disable gateway.controlUi.dangerouslyAllowHostHeaderOriginFallback and configure explicit gateway.controlUi.allowedOrigins."
|
|
2809
|
+
});
|
|
2810
|
+
}
|
|
2811
|
+
if (allowRealIpFallback) {
|
|
2812
|
+
const hasNonLoopbackTrustedProxy = trustedProxies.some((proxy) => !isStrictLoopbackTrustedProxyEntry(proxy));
|
|
2813
|
+
const exposed = bind !== "loopback" || auth.mode === "trusted-proxy" && hasNonLoopbackTrustedProxy;
|
|
2814
|
+
findings.push({
|
|
2815
|
+
checkId: "gateway.real_ip_fallback_enabled",
|
|
2816
|
+
severity: exposed ? "critical" : "warn",
|
|
2817
|
+
title: "X-Real-IP fallback is enabled",
|
|
2818
|
+
detail: "gateway.allowRealIpFallback=true trusts X-Real-IP when trusted proxies omit X-Forwarded-For. Misconfigured proxies that forward client-supplied X-Real-IP can spoof source IP and local-client checks.",
|
|
2819
|
+
remediation: "Keep gateway.allowRealIpFallback=false (default). Only enable this when your trusted proxy always overwrites X-Real-IP and cannot provide X-Forwarded-For."
|
|
2820
|
+
});
|
|
2821
|
+
}
|
|
2822
|
+
if (mdnsMode === "full") {
|
|
2823
|
+
const exposed = bind !== "loopback";
|
|
2824
|
+
findings.push({
|
|
2825
|
+
checkId: "discovery.mdns_full_mode",
|
|
2826
|
+
severity: exposed ? "critical" : "warn",
|
|
2827
|
+
title: "mDNS full mode can leak host metadata",
|
|
2828
|
+
detail: "discovery.mdns.mode=\"full\" publishes cliPath/sshPort in local-network TXT records. This can reveal usernames, filesystem layout, and management ports.",
|
|
2829
|
+
remediation: "Prefer discovery.mdns.mode=\"minimal\" (recommended) or \"off\", especially when gateway.bind is not loopback."
|
|
2830
|
+
});
|
|
2831
|
+
}
|
|
2832
|
+
if (tailscaleMode === "funnel") findings.push({
|
|
2833
|
+
checkId: "gateway.tailscale_funnel",
|
|
2834
|
+
severity: "critical",
|
|
2835
|
+
title: "Tailscale Funnel exposure enabled",
|
|
2836
|
+
detail: `gateway.tailscale.mode="funnel" exposes the Gateway publicly; keep auth strict and treat it as internet-facing.`,
|
|
2837
|
+
remediation: `Prefer tailscale.mode="serve" (tailnet-only) or set tailscale.mode="off".`
|
|
2838
|
+
});
|
|
2839
|
+
else if (tailscaleMode === "serve") findings.push({
|
|
2840
|
+
checkId: "gateway.tailscale_serve",
|
|
2841
|
+
severity: "info",
|
|
2842
|
+
title: "Tailscale Serve exposure enabled",
|
|
2843
|
+
detail: `gateway.tailscale.mode="serve" exposes the Gateway to your tailnet (loopback behind Tailscale).`
|
|
2844
|
+
});
|
|
2845
|
+
if (cfg.gateway?.controlUi?.allowInsecureAuth === true) findings.push({
|
|
2846
|
+
checkId: "gateway.control_ui.insecure_auth",
|
|
2847
|
+
severity: "warn",
|
|
2848
|
+
title: "Control UI insecure auth toggle enabled",
|
|
2849
|
+
detail: "gateway.controlUi.allowInsecureAuth=true does not bypass secure context or device identity checks; only dangerouslyDisableDeviceAuth disables Control UI device identity checks.",
|
|
2850
|
+
remediation: "Disable it or switch to HTTPS (Tailscale Serve) or localhost."
|
|
2851
|
+
});
|
|
2852
|
+
if (cfg.gateway?.controlUi?.dangerouslyDisableDeviceAuth === true) findings.push({
|
|
2853
|
+
checkId: "gateway.control_ui.device_auth_disabled",
|
|
2854
|
+
severity: "critical",
|
|
2855
|
+
title: "DANGEROUS: Control UI device auth disabled",
|
|
2856
|
+
detail: "gateway.controlUi.dangerouslyDisableDeviceAuth=true disables device identity checks for the Control UI.",
|
|
2857
|
+
remediation: "Disable it unless you are in a short-lived break-glass scenario."
|
|
2858
|
+
});
|
|
2859
|
+
const enabledDangerousFlags = collectEnabledInsecureOrDangerousFlags(cfg);
|
|
2860
|
+
if (enabledDangerousFlags.length > 0) findings.push({
|
|
2861
|
+
checkId: "config.insecure_or_dangerous_flags",
|
|
2862
|
+
severity: "warn",
|
|
2863
|
+
title: "Insecure or dangerous config flags enabled",
|
|
2864
|
+
detail: `Detected ${enabledDangerousFlags.length} enabled flag(s): ${enabledDangerousFlags.join(", ")}.`,
|
|
2865
|
+
remediation: "Disable these flags when not actively debugging, or keep deployment scoped to trusted/local-only networks."
|
|
2866
|
+
});
|
|
2867
|
+
const token = typeof auth.token === "string" && auth.token.trim().length > 0 ? auth.token.trim() : null;
|
|
2868
|
+
if (auth.mode === "token" && token && token.length < 24) findings.push({
|
|
2869
|
+
checkId: "gateway.token_too_short",
|
|
2870
|
+
severity: "warn",
|
|
2871
|
+
title: "Gateway token looks short",
|
|
2872
|
+
detail: `gateway auth token is ${token.length} chars; prefer a long random token.`
|
|
2873
|
+
});
|
|
2874
|
+
if (auth.mode === "trusted-proxy") {
|
|
2875
|
+
const trustedProxies = cfg.gateway?.trustedProxies ?? [];
|
|
2876
|
+
const trustedProxyConfig = cfg.gateway?.auth?.trustedProxy;
|
|
2877
|
+
findings.push({
|
|
2878
|
+
checkId: "gateway.trusted_proxy_auth",
|
|
2879
|
+
severity: "critical",
|
|
2880
|
+
title: "Trusted-proxy auth mode enabled",
|
|
2881
|
+
detail: "gateway.auth.mode=\"trusted-proxy\" delegates authentication to a reverse proxy. Ensure your proxy (Pomerium, Caddy, nginx) handles auth correctly and that gateway.trustedProxies only contains IPs of your actual proxy servers.",
|
|
2882
|
+
remediation: "Verify: (1) Your proxy terminates TLS and authenticates users. (2) gateway.trustedProxies is restricted to proxy IPs only. (3) Direct access to the Gateway port is blocked by firewall. See /gateway/trusted-proxy-auth for setup guidance."
|
|
2883
|
+
});
|
|
2884
|
+
if (trustedProxies.length === 0) findings.push({
|
|
2885
|
+
checkId: "gateway.trusted_proxy_no_proxies",
|
|
2886
|
+
severity: "critical",
|
|
2887
|
+
title: "Trusted-proxy auth enabled but no trusted proxies configured",
|
|
2888
|
+
detail: "gateway.auth.mode=\"trusted-proxy\" but gateway.trustedProxies is empty. All requests will be rejected.",
|
|
2889
|
+
remediation: "Set gateway.trustedProxies to the IP(s) of your reverse proxy."
|
|
2890
|
+
});
|
|
2891
|
+
if (!trustedProxyConfig?.userHeader) findings.push({
|
|
2892
|
+
checkId: "gateway.trusted_proxy_no_user_header",
|
|
2893
|
+
severity: "critical",
|
|
2894
|
+
title: "Trusted-proxy auth missing userHeader config",
|
|
2895
|
+
detail: "gateway.auth.mode=\"trusted-proxy\" but gateway.auth.trustedProxy.userHeader is not configured.",
|
|
2896
|
+
remediation: "Set gateway.auth.trustedProxy.userHeader to the header name your proxy uses (e.g., \"x-forwarded-user\", \"x-pomerium-claim-email\")."
|
|
2897
|
+
});
|
|
2898
|
+
if ((trustedProxyConfig?.allowUsers ?? []).length === 0) findings.push({
|
|
2899
|
+
checkId: "gateway.trusted_proxy_no_allowlist",
|
|
2900
|
+
severity: "warn",
|
|
2901
|
+
title: "Trusted-proxy auth allows all authenticated users",
|
|
2902
|
+
detail: "gateway.auth.trustedProxy.allowUsers is empty, so any user authenticated by your proxy can access the Gateway.",
|
|
2903
|
+
remediation: "Consider setting gateway.auth.trustedProxy.allowUsers to restrict access to specific users (e.g., [\"nick@example.com\"])."
|
|
2904
|
+
});
|
|
2905
|
+
}
|
|
2906
|
+
if (bind !== "loopback" && auth.mode !== "trusted-proxy" && !cfg.gateway?.auth?.rateLimit) findings.push({
|
|
2907
|
+
checkId: "gateway.auth_no_rate_limit",
|
|
2908
|
+
severity: "warn",
|
|
2909
|
+
title: "No auth rate limiting configured",
|
|
2910
|
+
detail: "gateway.bind is not loopback but no gateway.auth.rateLimit is configured. Without rate limiting, brute-force auth attacks are not mitigated.",
|
|
2911
|
+
remediation: "Set gateway.auth.rateLimit (e.g. { maxAttempts: 10, windowMs: 60000, lockoutMs: 300000 })."
|
|
2912
|
+
});
|
|
2913
|
+
return findings;
|
|
2914
|
+
}
|
|
2915
|
+
function isStrictLoopbackTrustedProxyEntry(entry) {
|
|
2916
|
+
const candidate = entry.trim();
|
|
2917
|
+
if (!candidate) return false;
|
|
2918
|
+
if (!candidate.includes("/")) return candidate === "127.0.0.1" || candidate.toLowerCase() === "::1";
|
|
2919
|
+
const [rawIp, rawPrefix] = candidate.split("/", 2);
|
|
2920
|
+
if (!rawIp || !rawPrefix) return false;
|
|
2921
|
+
const ipVersion = isIP(rawIp.trim());
|
|
2922
|
+
const prefix = Number.parseInt(rawPrefix.trim(), 10);
|
|
2923
|
+
if (!Number.isInteger(prefix)) return false;
|
|
2924
|
+
if (ipVersion === 4) return rawIp.trim() === "127.0.0.1" && prefix === 32;
|
|
2925
|
+
if (ipVersion === 6) return prefix === 128 && rawIp.trim().toLowerCase() === "::1";
|
|
2926
|
+
return false;
|
|
2927
|
+
}
|
|
2928
|
+
function collectBrowserControlFindings(cfg, env) {
|
|
2929
|
+
const findings = [];
|
|
2930
|
+
let resolved;
|
|
2931
|
+
try {
|
|
2932
|
+
resolved = resolveBrowserConfig(cfg.browser, cfg);
|
|
2933
|
+
} catch (err) {
|
|
2934
|
+
findings.push({
|
|
2935
|
+
checkId: "browser.control_invalid_config",
|
|
2936
|
+
severity: "warn",
|
|
2937
|
+
title: "Browser control config looks invalid",
|
|
2938
|
+
detail: String(err),
|
|
2939
|
+
remediation: `Fix browser.cdpUrl in ${resolveConfigPath()} and re-run "${formatCliCommand("remoteclaw security audit --deep")}".`
|
|
2940
|
+
});
|
|
2941
|
+
return findings;
|
|
2942
|
+
}
|
|
2943
|
+
if (!resolved.enabled) return findings;
|
|
2944
|
+
const browserAuth = resolveBrowserControlAuth(cfg, env);
|
|
2945
|
+
if (!browserAuth.token && !browserAuth.password) findings.push({
|
|
2946
|
+
checkId: "browser.control_no_auth",
|
|
2947
|
+
severity: "critical",
|
|
2948
|
+
title: "Browser control has no auth",
|
|
2949
|
+
detail: "Browser control HTTP routes are enabled but no gateway.auth token/password is configured. Any local process (or SSRF to loopback) can call browser control endpoints.",
|
|
2950
|
+
remediation: "Set gateway.auth.token (recommended) or gateway.auth.password so browser control HTTP routes require authentication. Restarting the gateway will auto-generate gateway.auth.token when browser control is enabled."
|
|
2951
|
+
});
|
|
2952
|
+
for (const name of Object.keys(resolved.profiles)) {
|
|
2953
|
+
const profile = resolveProfile(resolved, name);
|
|
2954
|
+
if (!profile || profile.cdpIsLoopback) continue;
|
|
2955
|
+
let url;
|
|
2956
|
+
try {
|
|
2957
|
+
url = new URL(profile.cdpUrl);
|
|
2958
|
+
} catch {
|
|
2959
|
+
continue;
|
|
2960
|
+
}
|
|
2961
|
+
if (url.protocol === "http:") findings.push({
|
|
2962
|
+
checkId: "browser.remote_cdp_http",
|
|
2963
|
+
severity: "warn",
|
|
2964
|
+
title: "Remote CDP uses HTTP",
|
|
2965
|
+
detail: `browser profile "${name}" uses http CDP (${profile.cdpUrl}); this is OK only if it's tailnet-only or behind an encrypted tunnel.`,
|
|
2966
|
+
remediation: `Prefer HTTPS/TLS or a tailnet-only endpoint for remote CDP.`
|
|
2967
|
+
});
|
|
2968
|
+
}
|
|
2969
|
+
return findings;
|
|
2970
|
+
}
|
|
2971
|
+
function collectLoggingFindings(cfg) {
|
|
2972
|
+
if (cfg.logging?.redactSensitive !== "off") return [];
|
|
2973
|
+
return [{
|
|
2974
|
+
checkId: "logging.redact_off",
|
|
2975
|
+
severity: "warn",
|
|
2976
|
+
title: "Tool summary redaction is disabled",
|
|
2977
|
+
detail: `logging.redactSensitive="off" can leak secrets into logs and status output.`,
|
|
2978
|
+
remediation: `Set logging.redactSensitive="tools".`
|
|
2979
|
+
}];
|
|
2980
|
+
}
|
|
2981
|
+
function collectElevatedFindings(cfg) {
|
|
2982
|
+
const findings = [];
|
|
2983
|
+
const enabled = cfg.tools?.elevated?.enabled;
|
|
2984
|
+
const allowFrom = cfg.tools?.elevated?.allowFrom ?? {};
|
|
2985
|
+
const anyAllowFromKeys = Object.keys(allowFrom).length > 0;
|
|
2986
|
+
if (enabled === false) return findings;
|
|
2987
|
+
if (!anyAllowFromKeys) return findings;
|
|
2988
|
+
for (const [provider, list] of Object.entries(allowFrom)) {
|
|
2989
|
+
const normalized = normalizeAllowFromList(list);
|
|
2990
|
+
if (normalized.includes("*")) findings.push({
|
|
2991
|
+
checkId: `tools.elevated.allowFrom.${provider}.wildcard`,
|
|
2992
|
+
severity: "critical",
|
|
2993
|
+
title: "Elevated exec allowlist contains wildcard",
|
|
2994
|
+
detail: `tools.elevated.allowFrom.${provider} includes "*" which effectively approves everyone on that channel for elevated mode.`
|
|
2995
|
+
});
|
|
2996
|
+
else if (normalized.length > 25) findings.push({
|
|
2997
|
+
checkId: `tools.elevated.allowFrom.${provider}.large`,
|
|
2998
|
+
severity: "warn",
|
|
2999
|
+
title: "Elevated exec allowlist is large",
|
|
3000
|
+
detail: `tools.elevated.allowFrom.${provider} has ${normalized.length} entries; consider tightening elevated access.`
|
|
3001
|
+
});
|
|
3002
|
+
}
|
|
3003
|
+
return findings;
|
|
3004
|
+
}
|
|
3005
|
+
async function maybeProbeGateway(params) {
|
|
3006
|
+
const url = buildGatewayConnectionDetails({ config: params.cfg }).url;
|
|
3007
|
+
const isRemoteMode = params.cfg.gateway?.mode === "remote";
|
|
3008
|
+
const remoteUrlRaw = typeof params.cfg.gateway?.remote?.url === "string" ? params.cfg.gateway.remote.url.trim() : "";
|
|
3009
|
+
const auth = !isRemoteMode || isRemoteMode && !remoteUrlRaw ? resolveGatewayProbeAuth({
|
|
3010
|
+
cfg: params.cfg,
|
|
3011
|
+
env: params.env,
|
|
3012
|
+
mode: "local"
|
|
3013
|
+
}) : resolveGatewayProbeAuth({
|
|
3014
|
+
cfg: params.cfg,
|
|
3015
|
+
env: params.env,
|
|
3016
|
+
mode: "remote"
|
|
3017
|
+
});
|
|
3018
|
+
const res = await params.probe({
|
|
3019
|
+
url,
|
|
3020
|
+
auth,
|
|
3021
|
+
timeoutMs: params.timeoutMs
|
|
3022
|
+
}).catch((err) => ({
|
|
3023
|
+
ok: false,
|
|
3024
|
+
url,
|
|
3025
|
+
connectLatencyMs: null,
|
|
3026
|
+
error: String(err),
|
|
3027
|
+
close: null,
|
|
3028
|
+
health: null,
|
|
3029
|
+
status: null,
|
|
3030
|
+
presence: null,
|
|
3031
|
+
configSnapshot: null
|
|
3032
|
+
}));
|
|
3033
|
+
return { gateway: {
|
|
3034
|
+
attempted: true,
|
|
3035
|
+
url,
|
|
3036
|
+
ok: res.ok,
|
|
3037
|
+
error: res.ok ? null : res.error,
|
|
3038
|
+
close: res.close ? {
|
|
3039
|
+
code: res.close.code,
|
|
3040
|
+
reason: res.close.reason
|
|
3041
|
+
} : null
|
|
3042
|
+
} };
|
|
3043
|
+
}
|
|
3044
|
+
async function runSecurityAudit(opts) {
|
|
3045
|
+
const findings = [];
|
|
3046
|
+
const cfg = opts.config;
|
|
3047
|
+
const env = opts.env ?? process.env;
|
|
3048
|
+
const platform = opts.platform ?? process.platform;
|
|
3049
|
+
const execIcacls = opts.execIcacls;
|
|
3050
|
+
const stateDir = opts.stateDir ?? resolveStateDir(env);
|
|
3051
|
+
const configPath = opts.configPath ?? resolveConfigPath(env, stateDir);
|
|
3052
|
+
findings.push(...collectAttackSurfaceSummaryFindings(cfg));
|
|
3053
|
+
findings.push(...collectSyncedFolderFindings({
|
|
3054
|
+
stateDir,
|
|
3055
|
+
configPath
|
|
3056
|
+
}));
|
|
3057
|
+
findings.push(...collectGatewayConfigFindings(cfg, env));
|
|
3058
|
+
findings.push(...collectBrowserControlFindings(cfg, env));
|
|
3059
|
+
findings.push(...collectLoggingFindings(cfg));
|
|
3060
|
+
findings.push(...collectElevatedFindings(cfg));
|
|
3061
|
+
findings.push(...collectHooksHardeningFindings(cfg, env));
|
|
3062
|
+
findings.push(...collectGatewayHttpNoAuthFindings(cfg, env));
|
|
3063
|
+
findings.push(...collectGatewayHttpSessionKeyOverrideFindings(cfg));
|
|
3064
|
+
findings.push(...collectSandboxDockerNoopFindings(cfg));
|
|
3065
|
+
findings.push(...collectSandboxDangerousConfigFindings(cfg));
|
|
3066
|
+
findings.push(...collectNodeDenyCommandPatternFindings(cfg));
|
|
3067
|
+
findings.push(...collectNodeDangerousAllowCommandFindings(cfg));
|
|
3068
|
+
findings.push(...collectMinimalProfileOverrideFindings(cfg));
|
|
3069
|
+
findings.push(...collectSecretsInConfigFindings(cfg));
|
|
3070
|
+
findings.push(...collectModelHygieneFindings(cfg));
|
|
3071
|
+
findings.push(...collectSmallModelRiskFindings({
|
|
3072
|
+
cfg,
|
|
3073
|
+
env
|
|
3074
|
+
}));
|
|
3075
|
+
findings.push(...collectExposureMatrixFindings(cfg));
|
|
3076
|
+
findings.push(...collectLikelyMultiUserSetupFindings(cfg));
|
|
3077
|
+
const configSnapshot = opts.includeFilesystem !== false ? await readConfigSnapshotForAudit({
|
|
3078
|
+
env,
|
|
3079
|
+
configPath
|
|
3080
|
+
}).catch(() => null) : null;
|
|
3081
|
+
if (opts.includeFilesystem !== false) {
|
|
3082
|
+
findings.push(...await collectFilesystemFindings({
|
|
3083
|
+
stateDir,
|
|
3084
|
+
configPath,
|
|
3085
|
+
env,
|
|
3086
|
+
platform,
|
|
3087
|
+
execIcacls
|
|
3088
|
+
}));
|
|
3089
|
+
if (configSnapshot) findings.push(...await collectIncludeFilePermFindings({
|
|
3090
|
+
configSnapshot,
|
|
3091
|
+
env,
|
|
3092
|
+
platform,
|
|
3093
|
+
execIcacls
|
|
3094
|
+
}));
|
|
3095
|
+
findings.push(...await collectStateDeepFilesystemFindings({
|
|
3096
|
+
cfg,
|
|
3097
|
+
env,
|
|
3098
|
+
stateDir,
|
|
3099
|
+
platform,
|
|
3100
|
+
execIcacls
|
|
3101
|
+
}));
|
|
3102
|
+
findings.push(...await collectPluginsTrustFindings({
|
|
3103
|
+
cfg,
|
|
3104
|
+
stateDir
|
|
3105
|
+
}));
|
|
3106
|
+
if (opts.deep === true) findings.push(...await collectPluginsCodeSafetyFindings({ stateDir }));
|
|
3107
|
+
}
|
|
3108
|
+
if (opts.includeChannelSecurity !== false) {
|
|
3109
|
+
const plugins = opts.plugins ?? listChannelPlugins();
|
|
3110
|
+
findings.push(...await collectChannelSecurityFindings({
|
|
3111
|
+
cfg,
|
|
3112
|
+
plugins
|
|
3113
|
+
}));
|
|
3114
|
+
}
|
|
3115
|
+
const deep = opts.deep === true ? await maybeProbeGateway({
|
|
3116
|
+
cfg,
|
|
3117
|
+
env,
|
|
3118
|
+
timeoutMs: Math.max(250, opts.deepTimeoutMs ?? 5e3),
|
|
3119
|
+
probe: opts.probeGatewayFn ?? probeGateway
|
|
3120
|
+
}) : void 0;
|
|
3121
|
+
if (deep?.gateway?.attempted && !deep.gateway.ok) findings.push({
|
|
3122
|
+
checkId: "gateway.probe_failed",
|
|
3123
|
+
severity: "warn",
|
|
3124
|
+
title: "Gateway probe failed (deep)",
|
|
3125
|
+
detail: deep.gateway.error ?? "gateway unreachable",
|
|
3126
|
+
remediation: `Run "${formatCliCommand("remoteclaw status --all")}" to debug connectivity/auth, then re-run "${formatCliCommand("remoteclaw security audit --deep")}".`
|
|
3127
|
+
});
|
|
3128
|
+
const summary = countBySeverity(findings);
|
|
3129
|
+
return {
|
|
3130
|
+
ts: Date.now(),
|
|
3131
|
+
summary,
|
|
3132
|
+
findings,
|
|
3133
|
+
deep
|
|
3134
|
+
};
|
|
3135
|
+
}
|
|
3136
|
+
|
|
3137
|
+
//#endregion
|
|
3138
|
+
export { resolveGatewayProbeAuth as _, collectIncludePathsRecursive as a, probeGateway as b, resolveGroupToolPolicy as c, collectExplicitAllowlist as d, expandPolicyWithPluginGroups as f, resolveToolProfilePolicy as g, normalizeToolName as h, formatIcaclsResetCommand as i, resolveSubagentToolPolicy as l, stripPluginOnlyAllowlist as m, collectEnabledInsecureOrDangerousFlags as n, filterToolsByPolicy as o, mergeAlsoAllowPolicy as p, createIcaclsResetCommand as r, resolveEffectiveToolPolicy as s, runSecurityAudit as t, buildPluginToolGroups as u, isNodeCommandAllowed as v, resolveNodeCommandAllowlist as y };
|