silentlake 2026.3.24
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 +4587 -0
- package/LICENSE +21 -0
- package/README.md +248 -0
- package/assets/avatar-placeholder.svg +19 -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/dmg-background-small.png +0 -0
- package/assets/dmg-background.png +0 -0
- package/assets/silentlake-banner.png +0 -0
- package/dist/APEv2Parser-BZv_dP9t.js +269 -0
- package/dist/APEv2Parser-CPzxFNBB.js +5 -0
- package/dist/AbstractID3Parser-mvDFcjYV.js +47 -0
- package/dist/AiffParser-BXQ9SRZk.js +145 -0
- package/dist/AsfParser-CmBDUlZE.js +631 -0
- package/dist/BasicParser-DhmXREDo.js +853 -0
- package/dist/DsdiffParser-CTKKGyZg.js +150 -0
- package/dist/DsfParser-Ds-YQe4Z.js +101 -0
- package/dist/FlacParser-B1XVPgXF.js +5 -0
- package/dist/FlacParser-DMPyL1y4.js +367 -0
- package/dist/ID3v1Parser-BICWWVDG.js +289 -0
- package/dist/ID3v2Parser-BmZHSUqs.js +650 -0
- package/dist/ID3v2Token-DeJf4tYQ.js +145 -0
- package/dist/MP4Parser-Cjf-Zs8T.js +1061 -0
- package/dist/MatroskaParser-DgBzBe8t.js +909 -0
- package/dist/MpegParser-D5swTpA1.js +744 -0
- package/dist/MusepackParser-D8EQXnpK.js +285 -0
- package/dist/OggParser-BcIYPHwP.js +390 -0
- package/dist/Util-D_zGsr97.js +170 -0
- package/dist/WavPackParser-hosU8gfo.js +166 -0
- package/dist/WaveParser-CA00FZrC.js +273 -0
- package/dist/abort-cutoff-CERmtgZI.js +56 -0
- package/dist/abort-cutoff.runtime-DZkGKKzv.js +61 -0
- package/dist/abort-signal-CsrBEr94.js +13 -0
- package/dist/account-helpers-D3c_eI7c.js +37 -0
- package/dist/account-helpers-ru3jdZSV.js +12 -0
- package/dist/account-id-DZnNZg8x.js +1 -0
- package/dist/account-id-ZCrgXl7Z.js +44 -0
- package/dist/account-lookup-nkoa-foB.js +10 -0
- package/dist/account-snapshot-fields-Cvq7803C.js +116 -0
- package/dist/account-summary-B5Xzvntm.js +36 -0
- package/dist/accounts-43SvCDEA.js +212 -0
- package/dist/accounts-CYgFhv2o.js +105 -0
- package/dist/accounts-ChlyF7cx.js +112 -0
- package/dist/ack-reactions-CNVwfOBj.js +43 -0
- package/dist/acp-cli-B4Rv7-xU.js +2033 -0
- package/dist/acp-runtime-BdLdT-QY.js +1 -0
- package/dist/actions.runtime-CqnQssoB.js +217 -0
- package/dist/actions.runtime-FLmCvVRd.js +236 -0
- package/dist/agent-CBOdzEvR.js +1 -0
- package/dist/agent-scope-BLhzf-o0.js +17 -0
- package/dist/agent-scope-DPP4Z_UU.js +193 -0
- package/dist/agents-D8pBK0II.js +855 -0
- package/dist/agents-Dihz1Ihx.js +323 -0
- package/dist/agents.config-C_lrnc9J.js +18 -0
- package/dist/agents.config-D1VqC78r.js +121 -0
- package/dist/allow-from-BPSBITdd.js +9 -0
- package/dist/allow-from-BwTLpvhp.js +20 -0
- package/dist/allow-from-C4iBpqFI.js +62 -0
- package/dist/allowlist-config-edit-CKbnMmwS.js +279 -0
- package/dist/allowlist-match-CYmPgg1K.js +63 -0
- package/dist/ansi-BEJF8NKS.js +54 -0
- package/dist/anthropic-vertex-provider-Dd5agCN9.js +60 -0
- package/dist/apply.runtime-DhKxNSJE.js +370 -0
- package/dist/apply.runtime-ghlh-P6X.js +211 -0
- package/dist/archive-Tr0wIUO-.js +532 -0
- package/dist/arg-split-Dtda0YDl.js +38 -0
- package/dist/artifacts-C_4LekPC.js +39 -0
- package/dist/audit-BOPSQQtd.js +54 -0
- package/dist/audit-C5kdrCi_.js +788 -0
- package/dist/audit-channel.allow-from.runtime-B7BHNblL.js +17 -0
- package/dist/audit-channel.collect.runtime-CjAbXFBV.js +521 -0
- package/dist/audit-channel.discord.runtime-BBY6S9lg.js +5 -0
- package/dist/audit-channel.telegram.runtime-SJnxOJH2.js +8 -0
- package/dist/audit-channel.zalouser.runtime-SGRWvHxT.js +5 -0
- package/dist/audit-extra.async-DY8v7LXH.js +817 -0
- package/dist/audit-fs-oDMUa5N_.js +375 -0
- package/dist/audit-membership-runtime-BPjFryEx.js +261 -0
- package/dist/audit.deep.runtime-WFf-TpsD.js +31 -0
- package/dist/audit.nondeep.runtime-B4BaEaRU.js +842 -0
- package/dist/audit.runtime-rFjCrods.js +74 -0
- package/dist/auth-O6LQFLHJ.js +416 -0
- package/dist/auth-choice-DIBaxmAQ.js +219 -0
- package/dist/auth-choice-PrbpIjyg.js +610 -0
- package/dist/auth-choice-legacy-Clyw2lVc.js +17 -0
- package/dist/auth-choice-options-ohUw8QR-.js +127 -0
- package/dist/auth-choice-prompt-Cm0s-9Du.js +215 -0
- package/dist/auth-choice-prompt-DI-Xl1Nv.js +36 -0
- package/dist/auth-choice-rKBOd02a.js +64 -0
- package/dist/auth-choice.apply-helpers-BibBSEl9.js +66 -0
- package/dist/auth-choice.plugin-providers.runtime-gqF9NO7_.js +219 -0
- package/dist/auth-health-TWboMYA5.js +166 -0
- package/dist/auth-mode-policy-DywddkT-.js +18 -0
- package/dist/auth-profiles-CWEIQV77.js +1047 -0
- package/dist/auth-profiles.runtime-B98lwopF.js +48 -0
- package/dist/avatar-policy-Ds9e6uHI.js +67 -0
- package/dist/axios-xDDnM0KG.js +12831 -0
- package/dist/backup-create-B6JAR6jJ.js +461 -0
- package/dist/banner-bez5CpOK.js +351 -0
- package/dist/base-session-key-Cf2rkwag.js +14 -0
- package/dist/bindings-BV4AtNSY.js +21 -0
- package/dist/bindings-kjwuC11Q.js +69 -0
- package/dist/bluebubbles-C1M3Geg0.js +87 -0
- package/dist/bluebubbles-DRW3JdOY.js +603 -0
- package/dist/bluebubbles-dEl4QpYz.js +37 -0
- package/dist/bonjour-discovery-C2oY96BG.js +376 -0
- package/dist/boolean-DKtCJu_W.js +29 -0
- package/dist/boolean-param-xAGXUSSN.js +13 -0
- package/dist/boundary-file-read-BP6VMpqH.js +106 -0
- package/dist/boundary-path-B3FFLYNx.js +557 -0
- package/dist/brave-CkimJe4j.js +405 -0
- package/dist/brew-DSwWqzLd.js +44 -0
- package/dist/browser-cli-D3kBUBNc.js +1502 -0
- package/dist/bundled/boot-md/handler.js +381 -0
- package/dist/bundled/bootstrap-extra-files/handler.js +56 -0
- package/dist/bundled/command-logger/handler.js +62 -0
- package/dist/bundled/session-memory/handler.js +401 -0
- package/dist/call-BDvaXe4i.js +44 -0
- package/dist/call-BmLt3xO1.js +639 -0
- package/dist/catalog-BwAYUfL7.js +240 -0
- package/dist/channel-BBCuV5OT.js +4945 -0
- package/dist/channel-BDBXuqeg.js +321 -0
- package/dist/channel-C8h1Irxm.js +1284 -0
- package/dist/channel-CbGpFzo4.js +1602 -0
- package/dist/channel-Ci3K8fI9.js +1006 -0
- package/dist/channel-DGT5N1v7.js +1077 -0
- package/dist/channel-account-context-Bwa-YH_o.js +104 -0
- package/dist/channel-actions-DU2CR3xW.js +37 -0
- package/dist/channel-activity-B8aReQoE.js +35 -0
- package/dist/channel-config-3Uv6ve2_.js +115 -0
- package/dist/channel-config-helpers-CieQWILI.js +377 -0
- package/dist/channel-config-schema-DEVsCZpj.js +1 -0
- package/dist/channel-feedback-G6zh8efr.js +245 -0
- package/dist/channel-inbound-DwzVf2PK.js +395 -0
- package/dist/channel-lifecycle-CpU1dRbh.js +354 -0
- package/dist/channel-options-DJaIP4Dv.js +38 -0
- package/dist/channel-pairing-D54mn51y.js +66 -0
- package/dist/channel-plugin-common-BhTxCE5t.js +1 -0
- package/dist/channel-plugin-ids-CFeS3qir.js +26 -0
- package/dist/channel-plugin-resolution-DUngfdFj.js +112 -0
- package/dist/channel-policy-C4GKHvhz.js +1 -0
- package/dist/channel-reply-pipeline-CPTuaW8n.js +15 -0
- package/dist/channel-send-result-By8EpCPw.js +40 -0
- package/dist/channel-setup-Ck35g7zI.js +49 -0
- package/dist/channel-shared-LkXtTPXk.js +308 -0
- package/dist/channel-summary-CdYLGMVt.js +137 -0
- package/dist/channel-summary-D33z52ft.js +41 -0
- package/dist/channel-targets-DfnKGXez.js +87 -0
- package/dist/channel.runtime-DAyBR2A5.js +324 -0
- package/dist/channel.runtime-DVq5tC2D.js +35 -0
- package/dist/channel.runtime-DaLTDGtF.js +288 -0
- package/dist/channel.runtime-FKfTev2g.js +512 -0
- package/dist/channel.runtime-owqedh1t.js +268 -0
- package/dist/channel.runtime-wOTeiifp.js +230 -0
- package/dist/channels-CIHgkPea.js +408 -0
- package/dist/channels-ZXK6Jiuk.js +1393 -0
- package/dist/channels-cli-Bj6qSlkE.js +412 -0
- package/dist/channels-status-issues-C_U44M8Y.js +16 -0
- package/dist/chat-type-C-n03mQY.js +10 -0
- package/dist/clack-prompter-DuzDnaLi.js +112 -0
- package/dist/clawbot-cli-YNPuwmTB.js +218 -0
- package/dist/cli/daemon-cli.js +88 -0
- package/dist/cli-CW46WAZn.js +254 -0
- package/dist/cli-name-Daok7A7-.js +25 -0
- package/dist/cli-runtime-aAVwbEYy.js +7 -0
- package/dist/cli-utils-Np4NAAtt.js +39 -0
- package/dist/command-format-CYK9XiUC.js +16 -0
- package/dist/command-format-g8YUHNir.js +2 -0
- package/dist/command-gating-BQXGSqc9.js +40 -0
- package/dist/command-options-5coRiipK.js +25 -0
- package/dist/command-poll-backoff-CpkSns-6.js +56 -0
- package/dist/command-poll-backoff.runtime-YT6EGcLN.js +7 -0
- package/dist/command-registry-BI2MOs89.js +242 -0
- package/dist/command-registry-BMsxnuoC.js +14 -0
- package/dist/command-secret-gateway-ChXyZwos.js +211 -0
- package/dist/command-secret-targets-COcwhn-D.js +88 -0
- package/dist/command-secret-targets-CQJT3viO.js +3 -0
- package/dist/commands-Bb9xUwz9.js +42 -0
- package/dist/commands-core-C1usZXC2.js +4923 -0
- package/dist/commands-core.runtime-OTZivlO2.js +232 -0
- package/dist/commands-registry-ChCep1KJ.js +295 -0
- package/dist/commands-registry.data-XyUTELK9.js +904 -0
- package/dist/commands-registry.runtime-m5WTxFtv.js +25 -0
- package/dist/commands-status.runtime-C8_hpNgj.js +211 -0
- package/dist/commands.runtime-BZPnQKcW.js +232 -0
- package/dist/common-CUBlLRXB.js +457 -0
- package/dist/compact.runtime-Djmzpbn6.js +216 -0
- package/dist/completion-cli-D8tLgE5W.js +445 -0
- package/dist/completion-cli-Dz89naVA.js +17 -0
- package/dist/config-6sZwvXJD.js +88 -0
- package/dist/config-B7tPwoHZ.js +38 -0
- package/dist/config-DdDLrP_v.js +273 -0
- package/dist/config-cli-C10R8azD.js +945 -0
- package/dist/config-guard-B1c73BYQ.js +126 -0
- package/dist/config-helpers-3u5wfLBu.js +117 -0
- package/dist/config-pn7LKJdW.js +23 -0
- package/dist/config-presence-BmUF_5K9.js +79 -0
- package/dist/config-regex-CvZFnWkO.js +39 -0
- package/dist/config-runtime-CstET7fq.js +142 -0
- package/dist/config-schema-5YkIW1xw.js +270 -0
- package/dist/config-schema-B1UGMwZ8.js +31 -0
- package/dist/config-schema-DzlnsY3D.js +33 -0
- package/dist/config-state-CE0CGjey.js +288 -0
- package/dist/config-validation-CkVqgkHr.js +272 -0
- package/dist/config-value-DgJrpclm.js +25 -0
- package/dist/configure-DMkp7Sr4.js +1126 -0
- package/dist/configure-DOrQthLy.js +344 -0
- package/dist/connection-auth-BSQJeDOU.js +30 -0
- package/dist/constants-C_Scc680.js +71 -0
- package/dist/control-ui-assets-DjqeIg6A.js +232 -0
- package/dist/control-ui-shared-DP000Pxd.js +29 -0
- package/dist/conversation-runtime-1O0Aaolb.js +1458 -0
- package/dist/core-C7aHA4Aq.js +187 -0
- package/dist/core-command-descriptors-DCUYAEZd.js +96 -0
- package/dist/credentials-BPwBlm1X.js +265 -0
- package/dist/cron-cli-N2Hw_02d.js +579 -0
- package/dist/daemon-cli-DgfaF9xx.js +354 -0
- package/dist/daemon-install-CbclJo5M.js +134 -0
- package/dist/daemon-install-plan.shared-DK6BHlWI.js +222 -0
- package/dist/daemon-runtime-CbClrCwc.js +12 -0
- package/dist/dangerous-config-flags-BJtLWIk7.js +15 -0
- package/dist/dangerous-name-matching-DZa_t0RM.js +44 -0
- package/dist/dangerous-tools-yGPDFTHh.js +27 -0
- package/dist/date-time-DCAyaBop.js +118 -0
- package/dist/dedupe-Cgnk5BbX.js +55 -0
- package/dist/defaults-CEdZhIIb.js +6 -0
- package/dist/delegate-D4ql5N70.js +43 -0
- package/dist/deliver-B004w1Mv.js +212 -0
- package/dist/deliver-runtime-IYvc0giI.js +211 -0
- package/dist/delivery-queue-B19wDCjT.js +3 -0
- package/dist/delivery-queue-DrrqB4Hi.js +299 -0
- package/dist/device-auth-GEXe9vqR.js +15 -0
- package/dist/device-bootstrap-CwwokLEY.js +96 -0
- package/dist/device-bootstrap-Dbhe6oe8.js +1 -0
- package/dist/device-metadata-normalization-BDSQ_eA7.js +21 -0
- package/dist/device-pairing-cFWbBray.js +553 -0
- package/dist/devices-cli-DzycjFzS.js +366 -0
- package/dist/diagnostic-DqJXx_4Q.js +310 -0
- package/dist/diagnostic-events-ktCoG8Br.js +48 -0
- package/dist/diagnostics-CMhyGsPu.js +33 -0
- package/dist/diagnostics-DpLHpQ9c.js +14 -0
- package/dist/directive-handling.fast-lane-toP_ri_H.js +273 -0
- package/dist/directive-handling.impl-BRARyrsT.js +638 -0
- package/dist/directive-handling.impl-CUB4MOnK.js +214 -0
- package/dist/directive-handling.levels-8vnMeuGX.js +2 -0
- package/dist/directive-handling.levels-CoruY1AA.js +13 -0
- package/dist/directive-handling.persist.runtime-78Du6PgL.js +170 -0
- package/dist/directive-handling.shared-DCGUCHjn.js +147 -0
- package/dist/directory-cli-DVsDcgIU.js +437 -0
- package/dist/directory-config-helpers-CURJ8mj7.js +129 -0
- package/dist/directory-runtime-DhC8QkMq.js +19 -0
- package/dist/directory.static-DQaG9ohH.js +44 -0
- package/dist/discord-CYj8s73O.js +214 -0
- package/dist/discord-L9zvSHVn.js +635 -0
- package/dist/discord-core-5tkl-BzP.js +1 -0
- package/dist/dm-policy-shared-6bCJzHOS.js +188 -0
- package/dist/dns-cli-BMvHy265.js +223 -0
- package/dist/docker-XFNiArwM.js +1254 -0
- package/dist/docs-cli-BTaH94wD.js +176 -0
- package/dist/doctor-completion-DKx5m2UC.js +90 -0
- package/dist/doctor-config-preflight-BzQgc3_t.js +40 -0
- package/dist/doctor-config-preflight-DxVCut8L.js +150 -0
- package/dist/doctor-state-migrations-CTF66iAy.js +732 -0
- package/dist/doctor-state-migrations-D0VP4dUh.js +212 -0
- package/dist/entry-status-B2OWAf0s.js +172 -0
- package/dist/entry.js +210 -0
- package/dist/env-BP70DGuy.js +30 -0
- package/dist/env-overrides-JneV60sd.js +434 -0
- package/dist/env-overrides.runtime-DLrwions.js +18 -0
- package/dist/env-substitution-D6t_sLS_.js +136 -0
- package/dist/errors-BxyFnvP3.js +58 -0
- package/dist/exec-Dmex2w_d.js +310 -0
- package/dist/exec-approvals-BJhuySBz.js +386 -0
- package/dist/exec-approvals-allowlist-B_wPddCb.js +384 -0
- package/dist/exec-approvals-cli-C2dwhSkX.js +427 -0
- package/dist/exec-safe-bin-runtime-policy-BZkObC8r.js +89 -0
- package/dist/exec-safety-CaaBy-Zw.js +24 -0
- package/dist/extension-shared-5txN7IXK.js +74 -0
- package/dist/extensionAPI.js +218 -0
- package/dist/extensions/amazon-bedrock/index.js +231 -0
- package/dist/extensions/anthropic/index.js +330 -0
- package/dist/extensions/bluebubbles/index.js +224 -0
- package/dist/extensions/bluebubbles/setup-entry.js +289 -0
- package/dist/extensions/brave/index.js +23 -0
- package/dist/extensions/byteplus/index.js +112 -0
- package/dist/extensions/chutes/index.js +221 -0
- package/dist/extensions/cloudflare-ai-gateway/index.js +218 -0
- package/dist/extensions/copilot-proxy/index.js +125 -0
- package/dist/extensions/device-pair/index.js +1040 -0
- package/dist/extensions/discord/index.js +215 -0
- package/dist/extensions/discord/setup-entry.js +215 -0
- package/dist/extensions/elevenlabs/index.js +223 -0
- package/dist/extensions/fal/index.js +112 -0
- package/dist/extensions/feishu/index.js +227 -0
- package/dist/extensions/feishu/setup-entry.js +112 -0
- package/dist/extensions/firecrawl/index.js +211 -0
- package/dist/extensions/github-copilot/index.js +490 -0
- package/dist/extensions/google/index.js +211 -0
- package/dist/extensions/huggingface/index.js +108 -0
- package/dist/extensions/imessage/index.js +223 -0
- package/dist/extensions/imessage/setup-entry.js +220 -0
- package/dist/extensions/irc/index.js +220 -0
- package/dist/extensions/irc/setup-entry.js +222 -0
- package/dist/extensions/kilocode/index.js +282 -0
- package/dist/extensions/kimi-coding/index.js +148 -0
- package/dist/extensions/line/index.js +57 -0
- package/dist/extensions/line/setup-entry.js +49 -0
- package/dist/extensions/llm-task/index.js +157 -0
- package/dist/extensions/lobster/index.js +261 -0
- package/dist/extensions/mattermost/index.js +220 -0
- package/dist/extensions/mattermost/setup-entry.js +222 -0
- package/dist/extensions/memory-core/index.js +36 -0
- package/dist/extensions/microsoft/index.js +223 -0
- package/dist/extensions/minimax/index.js +437 -0
- package/dist/extensions/mistral/index.js +149 -0
- package/dist/extensions/modelstudio/index.js +144 -0
- package/dist/extensions/moonshot/index.js +211 -0
- package/dist/extensions/nextcloud-talk/index.js +221 -0
- package/dist/extensions/nextcloud-talk/setup-entry.js +223 -0
- package/dist/extensions/nvidia/index.js +29 -0
- package/dist/extensions/ollama/index.js +118 -0
- package/dist/extensions/open-prose/index.js +10 -0
- package/dist/extensions/openai/index.js +677 -0
- package/dist/extensions/opencode/index.js +116 -0
- package/dist/extensions/opencode-go/index.js +114 -0
- package/dist/extensions/openrouter/index.js +398 -0
- package/dist/extensions/openshell/index.js +923 -0
- package/dist/extensions/perplexity/index.js +23 -0
- package/dist/extensions/phone-control/index.js +276 -0
- package/dist/extensions/qianfan/index.js +114 -0
- package/dist/extensions/qwen-portal-auth/index.js +350 -0
- package/dist/extensions/sglang/index.js +285 -0
- package/dist/extensions/signal/index.js +218 -0
- package/dist/extensions/signal/setup-entry.js +218 -0
- package/dist/extensions/slack/index.js +222 -0
- package/dist/extensions/slack/setup-entry.js +220 -0
- package/dist/extensions/synology-chat/index.js +56 -0
- package/dist/extensions/synology-chat/setup-entry.js +58 -0
- package/dist/extensions/synthetic/index.js +112 -0
- package/dist/extensions/talk-voice/index.js +197 -0
- package/dist/extensions/tavily/index.js +211 -0
- package/dist/extensions/telegram/index.js +221 -0
- package/dist/extensions/telegram/setup-entry.js +221 -0
- package/dist/extensions/thread-ownership/index.js +70 -0
- package/dist/extensions/together/index.js +113 -0
- package/dist/extensions/venice/index.js +132 -0
- package/dist/extensions/vercel-ai-gateway/index.js +86 -0
- package/dist/extensions/vllm/index.js +285 -0
- package/dist/extensions/voice-call/index.js +5715 -0
- package/dist/extensions/volcengine/index.js +112 -0
- package/dist/extensions/xai/index.js +211 -0
- package/dist/extensions/xiaomi/index.js +115 -0
- package/dist/extensions/zai/index.js +559 -0
- package/dist/extensions/zalo/index.js +225 -0
- package/dist/extensions/zalo/setup-entry.js +226 -0
- package/dist/external-content-BUdUOqkv.js +238 -0
- package/dist/feishu-CgbwAF0e.js +2664 -0
- package/dist/feishu-Dh5fEbh5.js +59127 -0
- package/dist/fetch-guard-DIyN1HW5.js +165 -0
- package/dist/fetch-timeout-C5xpMuGd.js +36 -0
- package/dist/file-identity-Cw0fQxYY.js +11 -0
- package/dist/file-lock-WbEmczmY.js +107 -0
- package/dist/filter-oMGaNOM1.js +20 -0
- package/dist/format-DH8ysi7s.js +19 -0
- package/dist/format-datetime-BGS6tLDE.js +73 -0
- package/dist/format-duration-CO0BGWB0.js +57 -0
- package/dist/format-relative-C3nDxnXz.js +54 -0
- package/dist/frontmatter-S5vS-I4a.js +309 -0
- package/dist/fs-safe-D3qzH-ab.js +731 -0
- package/dist/gateway-cli-PQNp7o0j.js +28378 -0
- package/dist/gateway-install-token-DV5KjD4F.js +164 -0
- package/dist/gateway-rpc-C0Ey-rik.js +26 -0
- package/dist/gateway-runtime-ih2e7a2K.js +42 -0
- package/dist/gaxios-fetch-compat-KX6bsqFm.js +165 -0
- package/dist/gemini-auth-B5ljg7jr.js +29 -0
- package/dist/git-commit-BIdLubm5.js +2 -0
- package/dist/git-commit-OvUvjri2.js +177 -0
- package/dist/github-copilot-auth-Ccm-cBwy.js +104 -0
- package/dist/global-singleton-4KwY5RvX.js +13 -0
- package/dist/globals-41sdSaKv.js +38 -0
- package/dist/gmail-setup-utils-BX68dZla.js +419 -0
- package/dist/group-access-DJZrYPx1.js +113 -0
- package/dist/group-keys-BD_IYSMs.js +44 -0
- package/dist/group-policy-CWFxv3iB.js +201 -0
- package/dist/group-policy-warnings-Ddu6lBkh.js +175 -0
- package/dist/health-Bu1sbyYy.js +573 -0
- package/dist/health-Cbxc9Bn3.js +59 -0
- package/dist/health-format-B5XfOTuJ.js +26 -0
- package/dist/heartbeat-7aHh0m3d.js +169 -0
- package/dist/heartbeat-summary-Das49TYq.js +57 -0
- package/dist/help-CcbF7-ha.js +81 -0
- package/dist/help-format-Dv45FpYu.js +15 -0
- package/dist/helpers-DJ-5HEbE.js +24 -0
- package/dist/helpers-MxyaLZUk.js +32 -0
- package/dist/history-CHjo8B5W.js +102 -0
- package/dist/hook-runtime-BnNBi_q4.js +1 -0
- package/dist/hooks-cli-DUYK4RM1.js +1102 -0
- package/dist/hooks-policy-BL6HDLUn.js +20 -0
- package/dist/hooks-status-gzNmo3li.js +78 -0
- package/dist/host-env-security-BogNN146.js +223 -0
- package/dist/http-body-CCiSfloA.js +237 -0
- package/dist/http-registry-WFFbLYRd.js +153 -0
- package/dist/identity-DovQV4zD.js +112 -0
- package/dist/identity-cyBYcoXS.js +84 -0
- package/dist/identity-file-EndG1nfc.js +60 -0
- package/dist/image-generation-CNKc-mFK.js +441 -0
- package/dist/image-kJ7Tbov4.js +211 -0
- package/dist/image-ops-j01UkxEv.js +371 -0
- package/dist/imessage-B5pSMT47.js +219 -0
- package/dist/imessage-CoIuY1Ro.js +1451 -0
- package/dist/imessage-Cqjsq4VW.js +190 -0
- package/dist/imessage-core-CsYJuaRZ.js +1 -0
- package/dist/inbound-envelope-4P3IIJc3.js +61 -0
- package/dist/inbound-reply-dispatch-i2Vekqyy.js +72 -0
- package/dist/includes-7XyL3p1c.js +188 -0
- package/dist/includes-scan-y-rS6tTw.js +55 -0
- package/dist/index.js +57 -0
- package/dist/infra/warning-filter.js +2 -0
- package/dist/inspect-CcxlJ1ba.js +279 -0
- package/dist/install-safe-path-Rwbw1XCZ.js +62 -0
- package/dist/installs-iHi2aSjM.js +532 -0
- package/dist/interactive-F7iY0yED.js +8 -0
- package/dist/interactive-runtime-OweOj_Vv.js +90 -0
- package/dist/internal-hooks-0uipqzRY.js +156 -0
- package/dist/io-BX49DsSJ.js +35 -0
- package/dist/io-jOnQRia2.js +7178 -0
- package/dist/ip-C8vmzVu0.js +203 -0
- package/dist/ipv4-DAmsJVOV.js +82 -0
- package/dist/irc-AZ-Ec8be.js +12 -0
- package/dist/irc-CCSRuEC2.js +660 -0
- package/dist/is-main-YViS6wOn.js +27 -0
- package/dist/issue-format-CBEXVico.js +31 -0
- package/dist/issue-format-D3HehoKZ.js +4 -0
- package/dist/json-file-C2zjA0Gv.js +23 -0
- package/dist/json-files-WW-H_psG.js +60 -0
- package/dist/json-pointer-f9dEnBoR.js +43 -0
- package/dist/json-store-O1LwpnBH.js +37 -0
- package/dist/kb-cli-DMZs6PCu.js +65 -0
- package/dist/keyed-async-queue-CPUWV5Pm.js +32 -0
- package/dist/kill-tree-CbjXBw3z.js +149 -0
- package/dist/kilocode-shared-DS7_0IMs.js +29 -0
- package/dist/launchd-tyqGVx9U.js +491 -0
- package/dist/lazy-runtime-BcXbyAaC.js +1 -0
- package/dist/lazy-runtime-bWkd2cs3.js +29 -0
- package/dist/legacy-names-CUNZ4vHN.js +7 -0
- package/dist/legacy-web-search-BgZjNG2h.js +222 -0
- package/dist/lib-CERS7N4b.js +503 -0
- package/dist/lib-PPICrHv1.js +1938 -0
- package/dist/library-CZ461krl.js +211 -0
- package/dist/lifecycle-core-Dnxnw0oy.js +382 -0
- package/dist/line/accounts.js +10 -0
- package/dist/line/send.js +39 -0
- package/dist/line/template-messages.js +2 -0
- package/dist/line-CJSvwApm.js +1 -0
- package/dist/line-N9vL-2JB.js +688 -0
- package/dist/line-core-BOIxkjgu.js +1 -0
- package/dist/links-Bilm-v0z.js +13 -0
- package/dist/llm-slug-generator-BuAuQ5Ft.js +68 -0
- package/dist/llm-slug-generator.js +212 -0
- package/dist/llm-task-Dx8ymRFr.js +1 -0
- package/dist/local-roots-DAzCjWbC.js +34 -0
- package/dist/location-DefAH9WS.js +42 -0
- package/dist/logger-CoEtkjhn.js +550 -0
- package/dist/logger-Cqy7-Maj.js +70 -0
- package/dist/logging-B2wMcpWV.js +13 -0
- package/dist/logging-Bz1qZDPg.js +16 -0
- package/dist/logging-CArEWRgI.js +36 -0
- package/dist/logging-CbTTfADU.js +1 -0
- package/dist/logs-cli-BSjKwaur.js +261 -0
- package/dist/magic-string.es-DJPWMt-n.js +1011 -0
- package/dist/main-session-DKr0lBVk.js +36 -0
- package/dist/manager-ChTGDe87.js +2005 -0
- package/dist/manager-DuwFn87U.js +4226 -0
- package/dist/manager-runtime-E16jsvRe.js +59 -0
- package/dist/manager.runtime-F9F1eFiB.js +827 -0
- package/dist/manifest-registry-B90TyTWl.js +1350 -0
- package/dist/map-size-CMTQVKUV.js +15 -0
- package/dist/markdown-to-line-BWwaRx5F.js +640 -0
- package/dist/mask-api-key-CprzEe7l.js +10 -0
- package/dist/matrix-DzvdUw97.js +228 -0
- package/dist/matrix-migration-snapshot-adoDbNii.js +702 -0
- package/dist/mattermost-DO0BCfF3.js +1 -0
- package/dist/mattermost-SjOt4QDb.js +15 -0
- package/dist/mcp-cli-BC_VPl_o.js +94 -0
- package/dist/mcp-config-Coky4zS4.js +108 -0
- package/dist/media-limits-Cuvmmhop.js +14 -0
- package/dist/media-understanding-DD2uMjK8.js +48 -0
- package/dist/media-understanding.runtime-Kbb2bRmk.js +216 -0
- package/dist/memory-DBjQ0TPd.js +1 -0
- package/dist/memory-cli-Cm4Df0hJ.js +215 -0
- package/dist/memory-cli-yzqneSF8.js +541 -0
- package/dist/memory-search-Das1tiuB.js +204 -0
- package/dist/memory-search-DxmSTjHq.js +18 -0
- package/dist/mention-gating-B_q-EHFx.js +25 -0
- package/dist/mentions-Bxys_va0.js +154 -0
- package/dist/message-channel-Cy-gN4K2.js +106 -0
- package/dist/message-hook-mappers-BBTV3JRQ.js +249 -0
- package/dist/method-scopes-DgypDW23.js +2649 -0
- package/dist/mime-C4vVTBso.js +150 -0
- package/dist/minimal-C5yUxtHy.js +2120 -0
- package/dist/model-auth-B__TJTPw.js +309 -0
- package/dist/model-auth-env-CF9ts7Th.js +111 -0
- package/dist/model-catalog.runtime-CWh17vcc.js +211 -0
- package/dist/model-id-normalization-Y-MIsyK_.js +16 -0
- package/dist/model-input-BB2wSAHb.js +20 -0
- package/dist/model-overrides-sIzKU2wo.js +84 -0
- package/dist/model-param-b-DIFEhICm.js +15 -0
- package/dist/model-picker-CAPjetT3.js +400 -0
- package/dist/model-picker-DEw9viWc.js +215 -0
- package/dist/model-picker.runtime-ixYl7lB5.js +224 -0
- package/dist/model-selection-BTpJnslv.js +437 -0
- package/dist/model-selection-Ci9cPkL2.js +765 -0
- package/dist/model-suppression.runtime-D8cIb6Y5.js +216 -0
- package/dist/models-BQtc3khN.js +226 -0
- package/dist/models-CQgBV5dW.js +2536 -0
- package/dist/models-cli-DbQ-QpQk.js +418 -0
- package/dist/models-config-D2xK-G6c.js +211 -0
- package/dist/models-config.providers.discovery-BaIk1NKL.js +141 -0
- package/dist/models-config.runtime-Cf7q9uAQ.js +211 -0
- package/dist/monitor-B5QmKaD7.js +3272 -0
- package/dist/monitor-CL5OYLih.js +878 -0
- package/dist/monitor-CNZxrM4d.js +3145 -0
- package/dist/monitor-CyQVZdDh.js +223 -0
- package/dist/multimodal-DC43jYNv.js +75 -0
- package/dist/mutable-allowlist-detectors-C6EAzWYE.js +62 -0
- package/dist/net-DlJFp95v.js +270 -0
- package/dist/network-mode-DOgvmom4.js +17 -0
- package/dist/nextcloud-talk-ChMP88s-.js +12 -0
- package/dist/nextcloud-talk-CwnkUy8E.js +1 -0
- package/dist/node-cli-BZDC7rXg.js +2484 -0
- package/dist/node-command-policy-Bg2g6Xjp.js +192 -0
- package/dist/node-commands-B6W6Eo0b.js +11 -0
- package/dist/node-require-BgDD9bTi.js +14 -0
- package/dist/node-resolve-BunMro3f.js +69 -0
- package/dist/node-service-CEZZaqba.js +65 -0
- package/dist/node-startup-env-Gz8ZQniA.js +50 -0
- package/dist/nodes-cli-B4Jr9vct.js +1330 -0
- package/dist/nodes-screen-CQ7IvP62.js +401 -0
- package/dist/normalize-secret-input-_PgpexOG.js +32 -0
- package/dist/note-dfjacCV8.js +109 -0
- package/dist/npm-pack-install-CYNRv-vM.js +574 -0
- package/dist/npm-resolution-Ml2aA6Nu.js +60 -0
- package/dist/oauth.runtime-DA_48MPQ.js +687 -0
- package/dist/oauth.runtime-DS1ry5__.js +318 -0
- package/dist/oauth.runtime-qCkidk8J.js +180 -0
- package/dist/ollama-defaults-asNuGW4_.js +4 -0
- package/dist/onboard-BM6gO6Uw.js +589 -0
- package/dist/onboard-D9IU-7uw.js +48 -0
- package/dist/onboard-DQaHGPRm.js +25 -0
- package/dist/onboard-channels-BdQtLjYb.js +300 -0
- package/dist/onboard-channels-DIVUygs5.js +1257 -0
- package/dist/onboard-config-DFKb-0sE.js +29 -0
- package/dist/onboard-config-DYykzJhx.js +2 -0
- package/dist/onboard-custom-CDP4w1AT.js +216 -0
- package/dist/onboard-custom-DhJN13UV.js +644 -0
- package/dist/onboard-helpers-B7XTd4Pw.js +335 -0
- package/dist/onboard-helpers-BUKtx5Bq.js +54 -0
- package/dist/onboard-hooks-BHSSLAhI.js +73 -0
- package/dist/onboard-remote-BOzEPdHA.js +59 -0
- package/dist/onboard-remote-DVza19_k.js +182 -0
- package/dist/onboard-search-CrS-n9_3.js +446 -0
- package/dist/onboard-skills-BojzIPvk.js +133 -0
- package/dist/onboard-skills-D7HyCVjz.js +69 -0
- package/dist/openai-codex-provider.runtime-BFsopDHI.js +2 -0
- package/dist/openai-defaults-B7FUywsh.js +10 -0
- package/dist/openclaw-exec-env-AcZ9we1N.js +14 -0
- package/dist/openclaw-root-TUHYdr9B.js +88 -0
- package/dist/openclaw-tools.runtime-draZJo5r.js +211 -0
- package/dist/outbound-media-69yrWRDt.js +11 -0
- package/dist/outbound-runtime-ic_7ulJJ.js +1 -0
- package/dist/pairing-challenge-CNrPmmi9.js +48 -0
- package/dist/pairing-cli-BohXW2BK.js +150 -0
- package/dist/pairing-labels-CNKCSmBK.js +7 -0
- package/dist/pairing-message-CBv2njJT.js +4 -0
- package/dist/pairing-store-C4lsd4pO.js +590 -0
- package/dist/pairing-token-gKj4SNFJ.js +55 -0
- package/dist/parse-duration-BBGYkY0S.js +41 -0
- package/dist/parse-finite-number-CP4MQF_w.js +30 -0
- package/dist/parse-log-line-CVh9zu3Q.js +43 -0
- package/dist/parse-port-COyt3COn.js +8 -0
- package/dist/path-alias-guards-ZTKqurNH.js +40 -0
- package/dist/path-env-CPkz6U0Y.js +87 -0
- package/dist/paths-CTjJI9l0.js +179 -0
- package/dist/paths-GHJ97ebE.js +268 -0
- package/dist/paths-nCHyK08H.js +56 -0
- package/dist/perplexity-Beshd9zu.js +422 -0
- package/dist/persistent-dedupe-bjKjVI5u.js +116 -0
- package/dist/pi-embedded-CSQySvOV.js +168518 -0
- package/dist/pi-model-discovery-CuX5CDyZ.js +125 -0
- package/dist/pi-model-discovery-runtime-DNsMrX1n.js +44 -0
- package/dist/pi-tools.before-tool-call.runtime-DxVqzMVf.js +387 -0
- package/dist/platform-launcher-CqGy6UhP.js +83 -0
- package/dist/plugin-entry-CwuwM1jC.js +17 -0
- package/dist/plugin-install-JJwfOXtg.js +216 -0
- package/dist/plugin-install-plan-cixz1_W4.js +49 -0
- package/dist/plugin-install-vkpI1UNd.js +184 -0
- package/dist/plugin-registry-C3j_DUnj.js +51 -0
- package/dist/plugin-registry-DB_yxabS.js +213 -0
- package/dist/plugin-sdk/account-helpers.js +3 -0
- package/dist/plugin-sdk/account-id.js +2 -0
- package/dist/plugin-sdk/account-resolution.js +216 -0
- package/dist/plugin-sdk/acp-runtime.js +46 -0
- package/dist/plugin-sdk/agent-runtime.js +215 -0
- package/dist/plugin-sdk/allow-from.js +17 -0
- package/dist/plugin-sdk/allowlist-config-edit.js +2 -0
- package/dist/plugin-sdk/bluebubbles.js +232 -0
- package/dist/plugin-sdk/boolean-param.js +2 -0
- package/dist/plugin-sdk/channel-actions.js +16 -0
- package/dist/plugin-sdk/channel-config-helpers.js +15 -0
- package/dist/plugin-sdk/channel-config-schema.js +5 -0
- package/dist/plugin-sdk/channel-contract.js +1 -0
- package/dist/plugin-sdk/channel-feedback.js +4 -0
- package/dist/plugin-sdk/channel-inbound.js +53 -0
- package/dist/plugin-sdk/channel-lifecycle.js +2 -0
- package/dist/plugin-sdk/channel-pairing.js +2 -0
- package/dist/plugin-sdk/channel-policy.js +19 -0
- package/dist/plugin-sdk/channel-reply-pipeline.js +23 -0
- package/dist/plugin-sdk/channel-runtime.js +33 -0
- package/dist/plugin-sdk/channel-send-result.js +2 -0
- package/dist/plugin-sdk/channel-setup.js +24 -0
- package/dist/plugin-sdk/channel-targets.js +3 -0
- package/dist/plugin-sdk/cli-runtime.js +5 -0
- package/dist/plugin-sdk/command-auth.js +212 -0
- package/dist/plugin-sdk/compat.js +59 -0
- package/dist/plugin-sdk/config-runtime.js +51 -0
- package/dist/plugin-sdk/conversation-runtime.js +55 -0
- package/dist/plugin-sdk/core.js +40 -0
- package/dist/plugin-sdk/device-bootstrap.js +6 -0
- package/dist/plugin-sdk/diagnostics-otel.js +7 -0
- package/dist/plugin-sdk/diffs.js +3 -0
- package/dist/plugin-sdk/directory-runtime.js +5 -0
- package/dist/plugin-sdk/discord-core.js +26 -0
- package/dist/plugin-sdk/discord.js +219 -0
- package/dist/plugin-sdk/extension-shared.js +15 -0
- package/dist/plugin-sdk/feishu.js +101 -0
- package/dist/plugin-sdk/gateway-runtime.js +46 -0
- package/dist/plugin-sdk/googlechat.js +93 -0
- package/dist/plugin-sdk/group-access.js +2 -0
- package/dist/plugin-sdk/hook-runtime.js +12 -0
- package/dist/plugin-sdk/image-generation.js +51 -0
- package/dist/plugin-sdk/imessage-core.js +214 -0
- package/dist/plugin-sdk/imessage.js +223 -0
- package/dist/plugin-sdk/index.js +55 -0
- package/dist/plugin-sdk/infra-runtime.js +223 -0
- package/dist/plugin-sdk/interactive-runtime.js +3 -0
- package/dist/plugin-sdk/irc.js +232 -0
- package/dist/plugin-sdk/json-store.js +9 -0
- package/dist/plugin-sdk/keyed-async-queue.js +2 -0
- package/dist/plugin-sdk/lazy-runtime.js +2 -0
- package/dist/plugin-sdk/line-core.js +29 -0
- package/dist/plugin-sdk/line.js +22 -0
- package/dist/plugin-sdk/llm-task.js +7 -0
- package/dist/plugin-sdk/matrix-runtime-heavy.js +223 -0
- package/dist/plugin-sdk/matrix-runtime-shared.js +2 -0
- package/dist/plugin-sdk/matrix.js +84 -0
- package/dist/plugin-sdk/mattermost.js +233 -0
- package/dist/plugin-sdk/media-runtime.js +212 -0
- package/dist/plugin-sdk/media-understanding-runtime.js +211 -0
- package/dist/plugin-sdk/media-understanding.js +15 -0
- package/dist/plugin-sdk/memory-core.js +2 -0
- package/dist/plugin-sdk/memory-lancedb.js +2 -0
- package/dist/plugin-sdk/msteams.js +244 -0
- package/dist/plugin-sdk/nextcloud-talk.js +231 -0
- package/dist/plugin-sdk/nostr.js +50 -0
- package/dist/plugin-sdk/ollama-setup.js +33 -0
- package/dist/plugin-sdk/outbound-runtime.js +23 -0
- package/dist/plugin-sdk/plugin-entry.js +3 -0
- package/dist/plugin-sdk/plugin-runtime.js +211 -0
- package/dist/plugin-sdk/process-runtime.js +12 -0
- package/dist/plugin-sdk/provider-auth-api-key.js +53 -0
- package/dist/plugin-sdk/provider-auth-login.js +2 -0
- package/dist/plugin-sdk/provider-auth.js +37 -0
- package/dist/plugin-sdk/provider-catalog.js +2 -0
- package/dist/plugin-sdk/provider-env-vars.js +2 -0
- package/dist/plugin-sdk/provider-google.js +3 -0
- package/dist/plugin-sdk/provider-models.js +27 -0
- package/dist/plugin-sdk/provider-onboard.js +20 -0
- package/dist/plugin-sdk/provider-setup.js +58 -0
- package/dist/plugin-sdk/provider-stream.js +211 -0
- package/dist/plugin-sdk/provider-usage.js +18 -0
- package/dist/plugin-sdk/provider-web-search.js +23 -0
- package/dist/plugin-sdk/provider-zai-endpoint.js +3 -0
- package/dist/plugin-sdk/reply-history.js +23 -0
- package/dist/plugin-sdk/reply-payload.js +2 -0
- package/dist/plugin-sdk/reply-runtime.js +211 -0
- package/dist/plugin-sdk/request-url.js +2 -0
- package/dist/plugin-sdk/routing.js +25 -0
- package/dist/plugin-sdk/runtime-env.js +15 -0
- package/dist/plugin-sdk/runtime-store.js +2 -0
- package/dist/plugin-sdk/runtime.js +15 -0
- package/dist/plugin-sdk/sandbox.js +66 -0
- package/dist/plugin-sdk/secret-input.js +3 -0
- package/dist/plugin-sdk/security-runtime.js +18 -0
- package/dist/plugin-sdk/self-hosted-provider-setup.js +33 -0
- package/dist/plugin-sdk/setup-adapter-runtime.js +2 -0
- package/dist/plugin-sdk/setup-runtime.js +17 -0
- package/dist/plugin-sdk/setup-tools.js +21 -0
- package/dist/plugin-sdk/setup.js +26 -0
- package/dist/plugin-sdk/signal.js +220 -0
- package/dist/plugin-sdk/slack-core.js +22 -0
- package/dist/plugin-sdk/slack.js +223 -0
- package/dist/plugin-sdk/speech-runtime.js +213 -0
- package/dist/plugin-sdk/speech.js +212 -0
- package/dist/plugin-sdk/ssrf-runtime.js +5 -0
- package/dist/plugin-sdk/state-paths.js +3 -0
- package/dist/plugin-sdk/status-helpers.js +9 -0
- package/dist/plugin-sdk/telegram-core.js +23 -0
- package/dist/plugin-sdk/telegram.js +224 -0
- package/dist/plugin-sdk/testing.js +13174 -0
- package/dist/plugin-sdk/text-runtime.js +45 -0
- package/dist/plugin-sdk/thread-bindings-runtime.js +2 -0
- package/dist/plugin-sdk/thread-ownership.js +2 -0
- package/dist/plugin-sdk/tlon.js +57 -0
- package/dist/plugin-sdk/tool-send.js +2 -0
- package/dist/plugin-sdk/twitch.js +46 -0
- package/dist/plugin-sdk/voice-call.js +213 -0
- package/dist/plugin-sdk/web-media.js +28 -0
- package/dist/plugin-sdk/webhook-ingress.js +7 -0
- package/dist/plugin-sdk/webhook-path.js +2 -0
- package/dist/plugin-sdk/whatsapp-core.js +219 -0
- package/dist/plugin-sdk/whatsapp-shared.js +18 -0
- package/dist/plugin-sdk/windows-spawn.js +2 -0
- package/dist/plugin-sdk/zalo.js +239 -0
- package/dist/plugin-sdk/zalouser.js +240 -0
- package/dist/plugins/build-smoke-entry.js +211 -0
- package/dist/plugins/runtime/index.js +229 -0
- package/dist/plugins-1Z50ecJ6.js +1 -0
- package/dist/plugins-C6fKmNuA.js +7 -0
- package/dist/plugins-cli-BkgQkGaU.js +1192 -0
- package/dist/policy-CpkbSAfm.js +60 -0
- package/dist/polls-B2VH7SN9.js +35 -0
- package/dist/ports-BjWuIIQw.js +262 -0
- package/dist/ports-DFiK_Jc-.js +385 -0
- package/dist/ports-lsof-DtJqhFOr.js +25 -0
- package/dist/ports-probe-BQqp8l8E.js +14 -0
- package/dist/preflight-audio.runtime-Fi9mofpp.js +216 -0
- package/dist/probe-BM9sbCgS.js +20 -0
- package/dist/probe-DLBOZftS.js +134 -0
- package/dist/probe-auth-Bjp3G4CI.js +48 -0
- package/dist/probe-auth-DMSPTRRk.js +45 -0
- package/dist/process-runtime-C7el-Ri4.js +1 -0
- package/dist/process-scoped-map-C4gOa-gv.js +61 -0
- package/dist/profile-utils-BcMYGFPT.js +15 -0
- package/dist/profiles-D17eMKQZ.js +683 -0
- package/dist/program-Ch-76sgl.js +155 -0
- package/dist/program-context-BMWNUfqL.js +10 -0
- package/dist/program-context-CD_RvRYh.js +2 -0
- package/dist/progress-D1r9bZU1.js +132 -0
- package/dist/prompt-select-styled-NUKYS9QR.js +4879 -0
- package/dist/prompt-style-BvciNCqy.js +7 -0
- package/dist/prompts-NtuylUyl.js +9 -0
- package/dist/prototype-keys-Cm_8mWvq.js +11 -0
- package/dist/provider-api-key-auth-BE0taXiB.js +108 -0
- package/dist/provider-api-key-auth.runtime-jDZZUAMX.js +34 -0
- package/dist/provider-auth-Bw8x1a3o.js +58 -0
- package/dist/provider-auth-api-key-BrQYvdxi.js +1 -0
- package/dist/provider-auth-choice-BYbPq0eC.js +128 -0
- package/dist/provider-auth-choice-helpers-Bj1GkOSn.js +48 -0
- package/dist/provider-auth-choice-preference-tKq5gaJL.js +192 -0
- package/dist/provider-auth-choice.runtime-DegPpvRJ.js +223 -0
- package/dist/provider-auth-choices-QSilukI1.js +58 -0
- package/dist/provider-auth-guidance-gninjjq8.js +34 -0
- package/dist/provider-auth-helpers-B0dS-1WK.js +86 -0
- package/dist/provider-auth-input-BftBdgvW.js +112 -0
- package/dist/provider-auth-login-D0n0lMuc.js +8 -0
- package/dist/provider-auth-login.runtime-LvuBkQrc.js +243 -0
- package/dist/provider-auth-mode-sTdccIKL.js +20 -0
- package/dist/provider-auth-ref-BS3gwrNr.js +168 -0
- package/dist/provider-auth-ref-BmEcEN7K.js +3 -0
- package/dist/provider-catalog--18-pW5t.js +11 -0
- package/dist/provider-catalog-2P2hel74.js +48 -0
- package/dist/provider-catalog-B0FqWSwe.js +48 -0
- package/dist/provider-catalog-BvORKzzD.js +91 -0
- package/dist/provider-catalog-C34j1_or.js +26 -0
- package/dist/provider-catalog-C5vmXjmb.js +11 -0
- package/dist/provider-catalog-CBufm2Dr.js +36 -0
- package/dist/provider-catalog-D7QvsUXS.js +12 -0
- package/dist/provider-catalog-DKy_dzQZ.js +41 -0
- package/dist/provider-env-vars-CsQlY7bF.js +110 -0
- package/dist/provider-id-BpXo5t6v.js +31 -0
- package/dist/provider-model-allowlist-4HSOnlX-.js +24 -0
- package/dist/provider-model-primary-NJ-xlhec.js +53 -0
- package/dist/provider-models-C2EjYMwW.js +2416 -0
- package/dist/provider-oauth-flow-BQN6F6EC.js +33 -0
- package/dist/provider-ollama-setup-DhQvDwAj.js +309 -0
- package/dist/provider-onboard-CjOfyeQG.js +1 -0
- package/dist/provider-onboarding-config-DOZ3pFA6.js +165 -0
- package/dist/provider-openai-codex-oauth-tls-Bo8U4D3E.js +101 -0
- package/dist/provider-runtime.runtime-DnP2jpoM.js +211 -0
- package/dist/provider-self-hosted-setup-CUrmsugW.js +182 -0
- package/dist/provider-usage-ClDVmkhl.js +633 -0
- package/dist/provider-usage-DIC6cn-3.js +211 -0
- package/dist/provider-web-search-NzK8ep1E.js +507 -0
- package/dist/provider-wizard-C6jCuyQe.js +236 -0
- package/dist/provider-zai-endpoint-DeDABzT4.js +106 -0
- package/dist/proxy-H5O2p6AP.js +121 -0
- package/dist/proxy-env-DG2u55RW.js +40 -0
- package/dist/push-apns-D4zD2tmP.js +1050 -0
- package/dist/pw-ai-BuPUVeUK.js +1876 -0
- package/dist/qmd-manager-BpygGMW9.js +1571 -0
- package/dist/qr-cli-DnWHXcxh.js +370 -0
- package/dist/qr-cli-yaZ0FZ6z.js +213 -0
- package/dist/query-expansion-Do45hILP.js +1114 -0
- package/dist/reactions-BcC_XZqD.js +281 -0
- package/dist/read-only-account-inspect-DPJzadPo.js +42 -0
- package/dist/read-only-account-inspect.discord.runtime-CW9DDKH8.js +216 -0
- package/dist/read-only-account-inspect.slack.runtime-BcXBPyh3.js +216 -0
- package/dist/read-only-account-inspect.telegram.runtime-Y7h0Jbdj.js +216 -0
- package/dist/redact-BDinS1q9.js +102 -0
- package/dist/redact-identifier-FUiWQxv5.js +13 -0
- package/dist/redact-snapshot-DBPmeYy2.js +2654 -0
- package/dist/ref-contract-CCBBbf1r.js +53 -0
- package/dist/register-CppP7Ddc.js +43 -0
- package/dist/register.agent-BOD5ROGQ.js +546 -0
- package/dist/register.backup-Y2VGqcRu.js +269 -0
- package/dist/register.configure-1qiTINph.js +354 -0
- package/dist/register.maintenance-shn-zigv.js +694 -0
- package/dist/register.message-mR4CLSoo.js +812 -0
- package/dist/register.onboard-CkDryVid.js +298 -0
- package/dist/register.setup-B0xW5olD.js +318 -0
- package/dist/register.status-health-sessions-CuhWc03j.js +604 -0
- package/dist/register.subclis-BazXM5TW.js +315 -0
- package/dist/register.subclis-C2d8UDhH.js +13 -0
- package/dist/registry-C3q59Qj0.js +55 -0
- package/dist/registry-CPsHw6xU.js +219 -0
- package/dist/registry-CxgtJ09C.js +28 -0
- package/dist/registry-rgYi7KoO.js +160 -0
- package/dist/repair-qXnOAvDy.js +105 -0
- package/dist/replies-EiwmmZ_W.js +122 -0
- package/dist/reply-history-CVCD5oE9.js +1 -0
- package/dist/reply-payload-DBGc074f.js +232 -0
- package/dist/report-cli-DB1jQx32.js +42 -0
- package/dist/request-url-BKfWAQx8.js +10 -0
- package/dist/resolve-Ckjd8TAk.js +14 -0
- package/dist/resolve-T2q_0ARF.js +619 -0
- package/dist/resolve-route-vEY3ONZ2.js +466 -0
- package/dist/resolve-utils-CbqJY2bs.js +102 -0
- package/dist/response-generator-VdoCcQ3y.js +153 -0
- package/dist/restart-stale-pids-CLGiqU2E.js +187 -0
- package/dist/retry-D15TD1S3.js +168 -0
- package/dist/root-help-B9Aou4ho.js +32 -0
- package/dist/routes-TpLEcKO8.js +7084 -0
- package/dist/routing-Y3m0o-kB.js +26 -0
- package/dist/rpc-C6MN-nVc.js +67 -0
- package/dist/run-command-DRKv5Lj6.js +32 -0
- package/dist/run-main-YZSMdx0B.js +424 -0
- package/dist/run-with-concurrency-BrSjWzpg.js +41 -0
- package/dist/runtime-B66W9flm.js +43 -0
- package/dist/runtime-C9VaVKYZ.js +2338 -0
- package/dist/runtime-CT2LIJZu.js +91 -0
- package/dist/runtime-CqDQ81eY.js +143 -0
- package/dist/runtime-CuvWMN7E.js +89 -0
- package/dist/runtime-D4_OpzA1.js +5 -0
- package/dist/runtime-DP-4DZja.js +5 -0
- package/dist/runtime-Dl17x_cV.js +1 -0
- package/dist/runtime-Z35JoYPC.js +30 -0
- package/dist/runtime-api-D79M0lQN.js +1 -0
- package/dist/runtime-api-y3zfnQGK.js +39 -0
- package/dist/runtime-discord-ops.runtime-Bg5h5v9-.js +234 -0
- package/dist/runtime-env-a_iwdJIv.js +1 -0
- package/dist/runtime-forwarders-DtMc8rBP.js +44 -0
- package/dist/runtime-group-policy-B7irU4eu.js +59 -0
- package/dist/runtime-guard-y62lPDGY.js +58 -0
- package/dist/runtime-parse-CeqXmZHJ.js +84 -0
- package/dist/runtime-paths-CstaCCMi.js +334 -0
- package/dist/runtime-slack-ops.runtime-BumgKDhS.js +226 -0
- package/dist/runtime-status-CgL02wYX.js +15 -0
- package/dist/runtime-store-Bt3Sdbrn.js +22 -0
- package/dist/runtime-telegram-ops.runtime-rSLQ3KrE.js +233 -0
- package/dist/runtime-whatsapp-boundary-xZem0NyQ.js +364 -0
- package/dist/safe-open-sync-Bt9R1Mnf.js +83 -0
- package/dist/safe-regex-tLlDZYfM.js +244 -0
- package/dist/safe-text-B_CQuica.js +16 -0
- package/dist/sandbox-CUUouiKs.js +2795 -0
- package/dist/sandbox-cli-BN8y0Get.js +499 -0
- package/dist/sandbox-paths-fqp_TZdO.js +144 -0
- package/dist/sandbox-qSs4h3sk.js +1 -0
- package/dist/sanitize-env-vars-vNSNqm0y.js +74 -0
- package/dist/scan-paths-BJmvUZ1E.js +28 -0
- package/dist/search-manager-DWhFgwyp.js +17 -0
- package/dist/search-manager-r8Cw4ZRv.js +392 -0
- package/dist/secret-equal-ObQfyZGa.js +9 -0
- package/dist/secret-file-Ch0yuOXR.js +11 -0
- package/dist/secret-file-DYJtH6kf.js +92 -0
- package/dist/secret-input-4REZ4sHo.js +35 -0
- package/dist/secrets-cli-D1df8b0o.js +2304 -0
- package/dist/secure-random-Cs8tw_HQ.js +10 -0
- package/dist/security-cli-V66ESmdT.js +676 -0
- package/dist/security-runtime-BuEhpJVE.js +23 -0
- package/dist/send-3tabvle6.js +100 -0
- package/dist/send-CC5J3tyW.js +1026 -0
- package/dist/send-deps-CrFMNvqO.js +19 -0
- package/dist/send-i2-mdtiE.js +250 -0
- package/dist/server-BTOjmlyi.js +116 -0
- package/dist/server-middleware-CCqKhKUb.js +106 -0
- package/dist/server-node-events-D6y22Tt8.js +611 -0
- package/dist/server-startup-matrix-migration-DHWSoS73.js +1595 -0
- package/dist/service-Bxc9uL2e.js +774 -0
- package/dist/service-CBLajPZL.js +21 -0
- package/dist/session-cost-usage-BmbaBvk4.js +212 -0
- package/dist/session-cost-usage-C30Jl2SI.js +615 -0
- package/dist/session-fork.runtime-BZfcC1Nc.js +51 -0
- package/dist/session-key-gFFk3uv9.js +216 -0
- package/dist/session-write-lock-DNKvpjKf.js +324 -0
- package/dist/sessions-BIH_j_XS.js +222 -0
- package/dist/sessions-D5dWcxC_.js +212 -0
- package/dist/sessions-DaSBVNwD.js +669 -0
- package/dist/setup-C2XF1YH3.js +397 -0
- package/dist/setup-CN-teRpz.js +8 -0
- package/dist/setup-adapter-runtime-Bjv2adwG.js +1 -0
- package/dist/setup-binary-BOJA7zdN.js +30 -0
- package/dist/setup-browser-BhNPCUtK.js +71 -0
- package/dist/setup-core-BsG09DZH.js +149 -0
- package/dist/setup-core-D-O1GQax.js +162 -0
- package/dist/setup-core-Dtm54Rcq.js +510 -0
- package/dist/setup-entry-B1mTa7bU.js +10 -0
- package/dist/setup-entry-CTMgw-K5.js +13 -0
- package/dist/setup-entry-Cmd_cufO.js +13 -0
- package/dist/setup-entry-CybgA3zP.js +12 -0
- package/dist/setup-entry-DED_hL6i.js +12 -0
- package/dist/setup-entry-WCq9VMWx.js +14 -0
- package/dist/setup-group-access-BtPApRvE.js +70 -0
- package/dist/setup-helpers-B62Ecg9r.js +362 -0
- package/dist/setup-surface-B7A7qowY.js +452 -0
- package/dist/setup-surface-BBYJVRXc.js +380 -0
- package/dist/setup-surface-CFUz_BJi.js +298 -0
- package/dist/setup-tools-BPiMjAN7.js +1 -0
- package/dist/setup-wizard-helpers-COZ1UAdX.js +770 -0
- package/dist/setup-wizard-proxy-Slwi-1gX.js +116 -0
- package/dist/setup.finalize-B8O01nge.js +633 -0
- package/dist/setup.gateway-config-BPDIFk__.js +288 -0
- package/dist/setup.secret-input-BL-bqJpt.js +25 -0
- package/dist/shared-AygSbeCK.js +50 -0
- package/dist/shared-BHqDLkMG.js +127 -0
- package/dist/shared-BPtG8PgB.js +70 -0
- package/dist/shared-BU0QgVMZ.js +36 -0
- package/dist/shared-Bzr2UyEm.js +351 -0
- package/dist/shared-C_XXbGIF.js +87 -0
- package/dist/shared-Diw3KzwZ.js +82 -0
- package/dist/shared-DngjQumT.js +196 -0
- package/dist/shared-DzH3zmAy.js +64 -0
- package/dist/shared-LeP8iUTz.js +54 -0
- package/dist/shell-argv-DWV43Vya.js +72 -0
- package/dist/shell-env-cD92jEyV.js +181 -0
- package/dist/signal-BQd9f9dF.js +315 -0
- package/dist/signal-Ca7y47bM.js +46 -0
- package/dist/signal-Did9U_fa.js +214 -0
- package/dist/signal-cli-install-DxoL8CgF.js +188 -0
- package/dist/skill-commands-CiSwTFBQ.js +652 -0
- package/dist/skill-commands.runtime-CEwlWT4j.js +34 -0
- package/dist/skill-scanner-DG7MT7pu.js +354 -0
- package/dist/skills-BC8GJ9Rp.js +22 -0
- package/dist/skills-CCgKs_NJ.js +863 -0
- package/dist/skills-cli-dhYXJCuL.js +339 -0
- package/dist/skills-install-DiriUXJd.js +763 -0
- package/dist/skills-status-BmQTn4jL.js +23 -0
- package/dist/skills-status-a9b899Y3.js +169 -0
- package/dist/slack-CXgv7nu7.js +730 -0
- package/dist/slack-CcSByPzI.js +217 -0
- package/dist/slack-CtcCh0Lj.js +24537 -0
- package/dist/slack-core-DcsbATUs.js +1 -0
- package/dist/slash-commands.runtime-kO8EUKYW.js +228 -0
- package/dist/slash-dispatch.runtime-Bu2yMeFy.js +238 -0
- package/dist/slash-skill-commands.runtime-wwX3tF84.js +216 -0
- package/dist/speech-bSreRuDH.js +1 -0
- package/dist/speech-runtime-y1FcnGVA.js +1 -0
- package/dist/src-CmXHIz5f.js +846 -0
- package/dist/ssh-config-ChqR6ijV.js +77 -0
- package/dist/ssh-tunnel-Cz51VBAt.js +159 -0
- package/dist/ssh-tunnel-DWze2IQS.js +16 -0
- package/dist/ssrf-Dk9XaoKN.js +220 -0
- package/dist/ssrf-policy-Dk6oMa20.js +69 -0
- package/dist/ssrf-runtime-C-mAQLVA.js +1 -0
- package/dist/stagger-DU7FjHYo.js +54 -0
- package/dist/state-paths-DJIGEFq_.js +1 -0
- package/dist/status-69r8-Zey.js +75 -0
- package/dist/status-BdLTvZOL.js +44 -0
- package/dist/status-Bt7DQmRI.js +1665 -0
- package/dist/status-CoUFSBgt.js +202 -0
- package/dist/status-DbI3Kbh5.js +235 -0
- package/dist/status-DeKlzu_o.js +212 -0
- package/dist/status-Haie42Fc.js +606 -0
- package/dist/status-helpers-Cda-rGLX.js +101 -0
- package/dist/status-json-DS1M_MWJ.js +322 -0
- package/dist/status.link-channel-Cb8bZ_Od.js +40 -0
- package/dist/status.scan.deps.runtime-7_6VUs50.js +77 -0
- package/dist/status.scan.runtime-DtR8BIE9.js +14 -0
- package/dist/status.summary-l_Bi1buR.js +600 -0
- package/dist/status.summary.runtime-Cng6MzRU.js +151 -0
- package/dist/status.update-DtbnnPKx.js +79 -0
- package/dist/store-CvL8MPei.js +1446 -0
- package/dist/store.runtime-hgnvmZgO.js +43 -0
- package/dist/string-normalization-CvzuCAZv.js +19 -0
- package/dist/string-sample-BOLqzr4Y.js +11 -0
- package/dist/subagent-orphan-recovery-si1z2iBu.js +407 -0
- package/dist/subagent-registry-runtime-CXUDI8gL.js +211 -0
- package/dist/subcli-descriptors-CY_nHzpZ.js +151 -0
- package/dist/subsystem-CUp-6QQf.js +421 -0
- package/dist/synology-chat-CdejNfs0.js +12 -0
- package/dist/system-cli-DkOaXHkQ.js +99 -0
- package/dist/system-events-mAu6Ap6K.js +75 -0
- package/dist/system-message-DA9eUYzB.js +16 -0
- package/dist/system-run-command-Cxq2F1MB.js +258 -0
- package/dist/systemd-CrxZBFae.js +557 -0
- package/dist/systemd-hints-y-zJ9aTm.js +315 -0
- package/dist/systemd-linger-BdklDcLg.js +16 -0
- package/dist/systemd-linger-DLrbG9_d.js +68 -0
- package/dist/table-DFMOhmNZ.js +305 -0
- package/dist/tailnet-ofqBrXzu.js +38 -0
- package/dist/tailscale-Cbsx-2HB.js +254 -0
- package/dist/target-errors-ksphhzJg.js +26 -0
- package/dist/target-registry-krAVlXi_.js +1321 -0
- package/dist/telegram/audit.js +2 -0
- package/dist/telegram/token.js +211 -0
- package/dist/telegram-BjDUP22F.js +10910 -0
- package/dist/telegram-DMiNSGAJ.js +575 -0
- package/dist/telegram-Dt11B3JL.js +218 -0
- package/dist/telegram-core-B4Jo-uko.js +1 -0
- package/dist/template-messages-kh7VfgOb.js +214 -0
- package/dist/text-chunking-CUf5WgqG.js +19 -0
- package/dist/text-format-sFXlJfHH.js +8 -0
- package/dist/text-runtime-C_Roi_Je.js +1418 -0
- package/dist/theme-B5HDbQfl.js +2 -0
- package/dist/theme-CdOoMzRk.js +34 -0
- package/dist/thinking-BBD_0HSp.js +68 -0
- package/dist/thinking.shared-CncvRHts.js +246 -0
- package/dist/thread-bindings-messages-Cdo8jSa9.js +229 -0
- package/dist/thread-bindings-policy-DMjOaNyR.js +119 -0
- package/dist/thread-bindings-runtime-Ckwk3Uuz.js +1 -0
- package/dist/threading-helpers-Cq55SUtb.js +14 -0
- package/dist/timeouts-BwR1sGom.js +72 -0
- package/dist/tmp-openclaw-dir-idKIOMmb.js +102 -0
- package/dist/token-Bgv8XEsC.js +50 -0
- package/dist/tool-catalog-BV6FcEWS.js +337 -0
- package/dist/tool-policy-match-CHqTCSdK.js +46 -0
- package/dist/tool-send-9LXKcrda.js +16 -0
- package/dist/topology-cli-BhUXVViF.js +43 -0
- package/dist/transcript-events-B1V6z5ct.js +29 -0
- package/dist/tui-DDJMGCFK.js +3838 -0
- package/dist/tui-cli-ByN-ZH6y.js +237 -0
- package/dist/typebox-D0SHDJST.js +175 -0
- package/dist/types-BCKGVVld.js +83 -0
- package/dist/types-CtpUGsDP.js +30 -0
- package/dist/types.secrets-BWSeXrF4.js +80 -0
- package/dist/types.tools-BBO8HCi6.js +22 -0
- package/dist/typing-DG_YqWJ7.js +224 -0
- package/dist/unhandled-rejections-CDJ8dOVP.js +170 -0
- package/dist/unhandled-rejections-O6cVOz2D.js +4 -0
- package/dist/update-Br8U-txJ.js +1039 -0
- package/dist/update-check-C3TeQaWg.js +464 -0
- package/dist/update-cli-XHfIntD0.js +1625 -0
- package/dist/update-offset-store-36vzzZXw.js +211 -0
- package/dist/upsert-with-lock-Bb96JHpb.js +34 -0
- package/dist/url-userinfo-Db63ng4y.js +14 -0
- package/dist/utils-Bxk6BLTg.js +236 -0
- package/dist/utils-vDeUf98G.js +7 -0
- package/dist/version-DCY9_obP.js +64 -0
- package/dist/version-DRF-wKTV.js +2 -0
- package/dist/voice-call-D4fgwZNO.js +1 -0
- package/dist/warning-filter-CgvLQB4Y.js +56 -0
- package/dist/web-media-BfBb8i48.js +1 -0
- package/dist/web-media-CtU6jM5V.js +498 -0
- package/dist/webhook-ingress-CupqYpKM.js +338 -0
- package/dist/webhook-memory-guards-BHrFZ4yq.js +129 -0
- package/dist/webhook-path-BGFZ55ML.js +22 -0
- package/dist/webhook-shared-Cvk3b0ac.js +349 -0
- package/dist/webhooks-cli-vOAoBF9b.js +357 -0
- package/dist/whatsapp-D5nD0rGG.js +58 -0
- package/dist/whatsapp-DXbWlm3A.js +82 -0
- package/dist/whatsapp-core-C2WGMsaY.js +89451 -0
- package/dist/whatsapp-heartbeat-CSWnPQ7q.js +84 -0
- package/dist/whatsapp-shared-BmHKqTtR.js +95 -0
- package/dist/widearea-dns-CXimgJzu.js +125 -0
- package/dist/windows-argv-IXrdWrJj.js +145 -0
- package/dist/windows-spawn-vMJGZo89.js +154 -0
- package/dist/with-timeout-2AKTISee.js +58 -0
- package/dist/workspace-BH7CXmrr.js +479 -0
- package/dist/workspace-dirs-_O4V3xCR.js +13 -0
- package/dist/workspace-v5XppK5M.js +302 -0
- package/dist/ws-By-QcLjg.js +11 -0
- package/dist/wsl-BV3Cb66X.js +57 -0
- package/dist/zalo-CHQzsLhE.js +301 -0
- package/dist/zalo-CcJ3J9f2.js +13 -0
- package/dist/zod-schema.agent-runtime-T_EC_6fg.js +600 -0
- package/dist/zod-schema.core-BdgRr-F1.js +545 -0
- package/dist/zod-schema.providers-core-Dgq7MTqU.js +1613 -0
- package/docs/.i18n/README.md +31 -0
- package/docs/.i18n/glossary.ja-JP.json +14 -0
- package/docs/.i18n/glossary.zh-CN.json +242 -0
- package/docs/.i18n/ja-JP.tm.jsonl +0 -0
- package/docs/assets/install-script.svg +1 -0
- package/docs/assets/macos-onboarding/01-macos-warning.jpeg +0 -0
- package/docs/assets/macos-onboarding/02-local-networks.jpeg +0 -0
- package/docs/assets/macos-onboarding/03-security-notice.png +0 -0
- package/docs/assets/macos-onboarding/04-choose-gateway.png +0 -0
- package/docs/assets/macos-onboarding/05-permissions.png +0 -0
- package/docs/assets/openclaw-logo-text-dark.png +0 -0
- package/docs/assets/openclaw-logo-text-dark.svg +418 -0
- package/docs/assets/openclaw-logo-text.png +0 -0
- package/docs/assets/openclaw-logo-text.svg +418 -0
- package/docs/assets/pixel-lobster.svg +60 -0
- package/docs/assets/showcase/agents-ui.jpg +0 -0
- package/docs/assets/showcase/bambu-cli.png +0 -0
- package/docs/assets/showcase/codexmonitor.png +0 -0
- package/docs/assets/showcase/gohome-grafana.png +0 -0
- package/docs/assets/showcase/ios-testflight.jpg +0 -0
- package/docs/assets/showcase/oura-health.png +0 -0
- package/docs/assets/showcase/padel-cli.svg +11 -0
- package/docs/assets/showcase/padel-screenshot.jpg +0 -0
- package/docs/assets/showcase/papla-tts.jpg +0 -0
- package/docs/assets/showcase/pr-review-telegram.jpg +0 -0
- package/docs/assets/showcase/roborock-screenshot.jpg +0 -0
- package/docs/assets/showcase/roborock-status.svg +13 -0
- package/docs/assets/showcase/roof-camera-sky.jpg +0 -0
- package/docs/assets/showcase/snag.png +0 -0
- package/docs/assets/showcase/tesco-shop.jpg +0 -0
- package/docs/assets/showcase/wienerlinien.png +0 -0
- package/docs/assets/showcase/wine-cellar-skill.jpg +0 -0
- package/docs/assets/showcase/winix-air-purifier.jpg +0 -0
- package/docs/assets/showcase/xuezh-pronunciation.jpeg +0 -0
- package/docs/assets/sponsors/blacksmith.svg +14 -0
- package/docs/assets/sponsors/convex.svg +16 -0
- package/docs/assets/sponsors/openai.svg +3 -0
- package/docs/assets/sponsors/vercel.svg +5 -0
- package/docs/auth-credential-semantics.md +53 -0
- package/docs/automation/auth-monitoring.md +44 -0
- package/docs/automation/cron-jobs.md +727 -0
- package/docs/automation/cron-vs-heartbeat.md +286 -0
- package/docs/automation/gmail-pubsub.md +256 -0
- package/docs/automation/hooks.md +1049 -0
- package/docs/automation/poll.md +86 -0
- package/docs/automation/standing-orders.md +251 -0
- package/docs/automation/troubleshooting.md +122 -0
- package/docs/automation/webhook.md +217 -0
- package/docs/brave-search.md +93 -0
- package/docs/channels/bluebubbles.md +347 -0
- package/docs/channels/broadcast-groups.md +442 -0
- package/docs/channels/channel-routing.md +139 -0
- package/docs/channels/discord.md +1229 -0
- package/docs/channels/feishu.md +747 -0
- package/docs/channels/googlechat.md +261 -0
- package/docs/channels/group-messages.md +84 -0
- package/docs/channels/groups.md +379 -0
- package/docs/channels/imessage.md +367 -0
- package/docs/channels/index.md +47 -0
- package/docs/channels/irc.md +242 -0
- package/docs/channels/line.md +194 -0
- package/docs/channels/location.md +56 -0
- package/docs/channels/matrix.md +677 -0
- package/docs/channels/mattermost.md +427 -0
- package/docs/channels/msteams.md +780 -0
- package/docs/channels/nextcloud-talk.md +138 -0
- package/docs/channels/nostr.md +242 -0
- package/docs/channels/pairing.md +114 -0
- package/docs/channels/signal.md +329 -0
- package/docs/channels/slack.md +603 -0
- package/docs/channels/synology-chat.md +132 -0
- package/docs/channels/telegram.md +987 -0
- package/docs/channels/tlon.md +276 -0
- package/docs/channels/troubleshooting.md +118 -0
- package/docs/channels/twitch.md +379 -0
- package/docs/channels/whatsapp.md +460 -0
- package/docs/channels/zalo.md +243 -0
- package/docs/channels/zalouser.md +181 -0
- package/docs/ci.md +55 -0
- package/docs/cli/acp.md +288 -0
- package/docs/cli/agent.md +29 -0
- package/docs/cli/agents.md +123 -0
- package/docs/cli/approvals.md +50 -0
- package/docs/cli/backup.md +76 -0
- package/docs/cli/browser.md +106 -0
- package/docs/cli/channels.md +102 -0
- package/docs/cli/clawbot.md +21 -0
- package/docs/cli/completion.md +35 -0
- package/docs/cli/config.md +295 -0
- package/docs/cli/configure.md +36 -0
- package/docs/cli/cron.md +77 -0
- package/docs/cli/daemon.md +53 -0
- package/docs/cli/dashboard.md +22 -0
- package/docs/cli/devices.md +139 -0
- package/docs/cli/directory.md +63 -0
- package/docs/cli/dns.md +23 -0
- package/docs/cli/docs.md +15 -0
- package/docs/cli/doctor.md +48 -0
- package/docs/cli/gateway.md +235 -0
- package/docs/cli/health.md +21 -0
- package/docs/cli/hooks.md +318 -0
- package/docs/cli/index.md +1147 -0
- package/docs/cli/logs.md +28 -0
- package/docs/cli/memory.md +66 -0
- package/docs/cli/message.md +278 -0
- package/docs/cli/models.md +81 -0
- package/docs/cli/node.md +127 -0
- package/docs/cli/nodes.md +75 -0
- package/docs/cli/onboard.md +157 -0
- package/docs/cli/pairing.md +32 -0
- package/docs/cli/plugins.md +186 -0
- package/docs/cli/qr.md +46 -0
- package/docs/cli/reset.md +20 -0
- package/docs/cli/sandbox.md +197 -0
- package/docs/cli/secrets.md +188 -0
- package/docs/cli/security.md +79 -0
- package/docs/cli/sessions.md +110 -0
- package/docs/cli/setup.md +29 -0
- package/docs/cli/skills.md +26 -0
- package/docs/cli/status.md +30 -0
- package/docs/cli/system.md +60 -0
- package/docs/cli/tui.md +30 -0
- package/docs/cli/uninstall.md +20 -0
- package/docs/cli/update.md +103 -0
- package/docs/cli/voicecall.md +34 -0
- package/docs/cli/webhooks.md +25 -0
- package/docs/concepts/agent-loop.md +148 -0
- package/docs/concepts/agent-workspace.md +236 -0
- package/docs/concepts/agent.md +122 -0
- package/docs/concepts/architecture.md +137 -0
- package/docs/concepts/compaction.md +123 -0
- package/docs/concepts/context-engine.md +268 -0
- package/docs/concepts/context.md +172 -0
- package/docs/concepts/delegate-architecture.md +296 -0
- package/docs/concepts/features.md +73 -0
- package/docs/concepts/markdown-formatting.md +130 -0
- package/docs/concepts/memory.md +108 -0
- package/docs/concepts/messages.md +154 -0
- package/docs/concepts/model-failover.md +152 -0
- package/docs/concepts/model-providers.md +607 -0
- package/docs/concepts/models.md +225 -0
- package/docs/concepts/multi-agent.md +552 -0
- package/docs/concepts/oauth.md +158 -0
- package/docs/concepts/presence.md +102 -0
- package/docs/concepts/queue.md +89 -0
- package/docs/concepts/retry.md +69 -0
- package/docs/concepts/session-pruning.md +121 -0
- package/docs/concepts/session-tool.md +242 -0
- package/docs/concepts/session.md +310 -0
- package/docs/concepts/streaming.md +155 -0
- package/docs/concepts/system-prompt.md +132 -0
- package/docs/concepts/timezone.md +91 -0
- package/docs/concepts/typebox.md +291 -0
- package/docs/concepts/typing-indicators.md +68 -0
- package/docs/concepts/usage-tracking.md +35 -0
- package/docs/date-time.md +128 -0
- package/docs/debug/node-issue.md +85 -0
- package/docs/diagnostics/flags.md +91 -0
- package/docs/docs.json +2061 -0
- package/docs/gateway/authentication.md +179 -0
- package/docs/gateway/background-process.md +97 -0
- package/docs/gateway/bonjour.md +177 -0
- package/docs/gateway/bridge-protocol.md +91 -0
- package/docs/gateway/cli-backends.md +225 -0
- package/docs/gateway/configuration-examples.md +651 -0
- package/docs/gateway/configuration-reference.md +3123 -0
- package/docs/gateway/configuration.md +633 -0
- package/docs/gateway/discovery.md +123 -0
- package/docs/gateway/doctor.md +362 -0
- package/docs/gateway/gateway-lock.md +34 -0
- package/docs/gateway/health.md +44 -0
- package/docs/gateway/heartbeat.md +393 -0
- package/docs/gateway/index.md +261 -0
- package/docs/gateway/local-models.md +152 -0
- package/docs/gateway/logging.md +113 -0
- package/docs/gateway/multiple-gateways.md +112 -0
- package/docs/gateway/network-model.md +22 -0
- package/docs/gateway/openai-http-api.md +132 -0
- package/docs/gateway/openresponses-http-api.md +295 -0
- package/docs/gateway/openshell.md +307 -0
- package/docs/gateway/pairing.md +99 -0
- package/docs/gateway/protocol.md +267 -0
- package/docs/gateway/remote-gateway-readme.md +158 -0
- package/docs/gateway/remote.md +153 -0
- package/docs/gateway/sandbox-vs-tool-policy-vs-elevated.md +134 -0
- package/docs/gateway/sandboxing.md +469 -0
- package/docs/gateway/secrets-plan-contract.md +116 -0
- package/docs/gateway/secrets.md +503 -0
- package/docs/gateway/security/index.md +1213 -0
- package/docs/gateway/tailscale.md +132 -0
- package/docs/gateway/tools-invoke-http-api.md +110 -0
- package/docs/gateway/troubleshooting.md +378 -0
- package/docs/gateway/trusted-proxy-auth.md +330 -0
- package/docs/help/debugging.md +168 -0
- package/docs/help/environment.md +163 -0
- package/docs/help/faq.md +2999 -0
- package/docs/help/index.md +28 -0
- package/docs/help/scripts.md +28 -0
- package/docs/help/testing.md +524 -0
- package/docs/help/troubleshooting.md +297 -0
- package/docs/images/configure-model-picker-unsearchable.png +0 -0
- package/docs/images/feishu-step2-create-app.png +0 -0
- package/docs/images/feishu-step3-credentials.png +0 -0
- package/docs/images/feishu-step4-permissions.png +0 -0
- package/docs/images/feishu-step5-bot-capability.png +0 -0
- package/docs/images/feishu-step6-event-subscription.png +0 -0
- package/docs/images/feishu-verification-token.png +0 -0
- package/docs/images/groups-flow.svg +52 -0
- package/docs/images/mobile-ui-screenshot.png +0 -0
- package/docs/index.md +196 -0
- package/docs/install/ansible.md +230 -0
- package/docs/install/azure.md +311 -0
- package/docs/install/bun.md +55 -0
- package/docs/install/development-channels.md +120 -0
- package/docs/install/digitalocean.md +129 -0
- package/docs/install/docker-vm-runtime.md +142 -0
- package/docs/install/docker.md +375 -0
- package/docs/install/exe-dev.md +126 -0
- package/docs/install/fly.md +501 -0
- package/docs/install/gcp.md +402 -0
- package/docs/install/hetzner.md +251 -0
- package/docs/install/index.md +183 -0
- package/docs/install/installer.md +415 -0
- package/docs/install/kubernetes.md +191 -0
- package/docs/install/macos-vm.md +281 -0
- package/docs/install/migrating-matrix.md +346 -0
- package/docs/install/migrating.md +110 -0
- package/docs/install/nix.md +89 -0
- package/docs/install/node.md +138 -0
- package/docs/install/northflank.mdx +54 -0
- package/docs/install/oracle.md +156 -0
- package/docs/install/podman.md +133 -0
- package/docs/install/railway.mdx +100 -0
- package/docs/install/raspberry-pi.md +159 -0
- package/docs/install/render.mdx +169 -0
- package/docs/install/uninstall.md +128 -0
- package/docs/install/updating.md +128 -0
- package/docs/ja-JP/index.md +186 -0
- package/docs/ja-JP/start/getting-started.md +125 -0
- package/docs/ja-JP/start/wizard.md +77 -0
- package/docs/logging.md +352 -0
- package/docs/nav-tabs-underline.js +100 -0
- package/docs/network.md +54 -0
- package/docs/nodes/audio.md +187 -0
- package/docs/nodes/camera.md +162 -0
- package/docs/nodes/images.md +72 -0
- package/docs/nodes/index.md +393 -0
- package/docs/nodes/location-command.md +98 -0
- package/docs/nodes/media-understanding.md +394 -0
- package/docs/nodes/talk.md +92 -0
- package/docs/nodes/troubleshooting.md +114 -0
- package/docs/nodes/voicewake.md +66 -0
- package/docs/perplexity.md +174 -0
- package/docs/pi-dev.md +80 -0
- package/docs/pi.md +567 -0
- package/docs/platforms/android.md +168 -0
- package/docs/platforms/digitalocean.md +266 -0
- package/docs/platforms/index.md +54 -0
- package/docs/platforms/ios.md +220 -0
- package/docs/platforms/linux.md +94 -0
- package/docs/platforms/mac/bundled-gateway.md +73 -0
- package/docs/platforms/mac/canvas.md +125 -0
- package/docs/platforms/mac/child-process.md +69 -0
- package/docs/platforms/mac/dev-setup.md +104 -0
- package/docs/platforms/mac/health.md +34 -0
- package/docs/platforms/mac/icon.md +31 -0
- package/docs/platforms/mac/logging.md +57 -0
- package/docs/platforms/mac/menu-bar.md +81 -0
- package/docs/platforms/mac/peekaboo.md +65 -0
- package/docs/platforms/mac/permissions.md +50 -0
- package/docs/platforms/mac/remote.md +84 -0
- package/docs/platforms/mac/signing.md +47 -0
- package/docs/platforms/mac/skills.md +33 -0
- package/docs/platforms/mac/voice-overlay.md +60 -0
- package/docs/platforms/mac/voicewake.md +67 -0
- package/docs/platforms/mac/webchat.md +43 -0
- package/docs/platforms/mac/xpc.md +61 -0
- package/docs/platforms/macos.md +226 -0
- package/docs/platforms/oracle.md +303 -0
- package/docs/platforms/raspberry-pi.md +412 -0
- package/docs/platforms/windows.md +241 -0
- package/docs/plugins/agent-tools.md +10 -0
- package/docs/plugins/architecture.md +1363 -0
- package/docs/plugins/building-extensions.md +10 -0
- package/docs/plugins/building-plugins.md +376 -0
- package/docs/plugins/bundles.md +181 -0
- package/docs/plugins/community.md +141 -0
- package/docs/plugins/manifest.md +145 -0
- package/docs/plugins/sdk-migration.md +169 -0
- package/docs/plugins/voice-call.md +380 -0
- package/docs/plugins/zalouser.md +77 -0
- package/docs/prose.md +134 -0
- package/docs/providers/anthropic.md +259 -0
- package/docs/providers/bedrock.md +176 -0
- package/docs/providers/claude-max-api-proxy.md +154 -0
- package/docs/providers/cloudflare-ai-gateway.md +71 -0
- package/docs/providers/deepgram.md +93 -0
- package/docs/providers/github-copilot.md +72 -0
- package/docs/providers/glm.md +43 -0
- package/docs/providers/google.md +78 -0
- package/docs/providers/groq.md +96 -0
- package/docs/providers/huggingface.md +209 -0
- package/docs/providers/index.md +69 -0
- package/docs/providers/kilocode.md +74 -0
- package/docs/providers/litellm.md +154 -0
- package/docs/providers/minimax.md +224 -0
- package/docs/providers/mistral.md +54 -0
- package/docs/providers/models.md +45 -0
- package/docs/providers/modelstudio.md +66 -0
- package/docs/providers/moonshot.md +175 -0
- package/docs/providers/nvidia.md +55 -0
- package/docs/providers/ollama.md +352 -0
- package/docs/providers/openai.md +303 -0
- package/docs/providers/opencode-go.md +45 -0
- package/docs/providers/opencode.md +64 -0
- package/docs/providers/openrouter.md +37 -0
- package/docs/providers/perplexity-provider.md +62 -0
- package/docs/providers/qianfan.md +38 -0
- package/docs/providers/qwen.md +53 -0
- package/docs/providers/sglang.md +104 -0
- package/docs/providers/synthetic.md +99 -0
- package/docs/providers/together.md +66 -0
- package/docs/providers/venice.md +282 -0
- package/docs/providers/vercel-ai-gateway.md +60 -0
- package/docs/providers/vllm.md +92 -0
- package/docs/providers/volcengine.md +74 -0
- package/docs/providers/xai.md +60 -0
- package/docs/providers/xiaomi.md +86 -0
- package/docs/providers/zai.md +46 -0
- package/docs/reference/AGENTS.default.md +126 -0
- package/docs/reference/RELEASING.md +42 -0
- package/docs/reference/api-usage-costs.md +144 -0
- package/docs/reference/credits.md +30 -0
- package/docs/reference/device-models.md +47 -0
- package/docs/reference/memory-config.md +711 -0
- package/docs/reference/prompt-caching.md +185 -0
- package/docs/reference/rpc.md +43 -0
- package/docs/reference/secretref-credential-surface.md +140 -0
- package/docs/reference/secretref-user-supplied-credentials-matrix.json +563 -0
- package/docs/reference/session-management-compaction.md +324 -0
- package/docs/reference/templates/AGENTS.dev.md +83 -0
- package/docs/reference/templates/AGENTS.md +219 -0
- package/docs/reference/templates/BOOT.md +11 -0
- package/docs/reference/templates/BOOTSTRAP.md +62 -0
- package/docs/reference/templates/HEARTBEAT.md +14 -0
- package/docs/reference/templates/IDENTITY.dev.md +47 -0
- package/docs/reference/templates/IDENTITY.md +29 -0
- package/docs/reference/templates/SOUL.dev.md +76 -0
- package/docs/reference/templates/SOUL.md +43 -0
- package/docs/reference/templates/TOOLS.dev.md +24 -0
- package/docs/reference/templates/TOOLS.md +47 -0
- package/docs/reference/templates/USER.dev.md +18 -0
- package/docs/reference/templates/USER.md +23 -0
- package/docs/reference/test.md +90 -0
- package/docs/reference/token-use.md +175 -0
- package/docs/reference/transcript-hygiene.md +151 -0
- package/docs/reference/wizard.md +235 -0
- package/docs/security/CONTRIBUTING-THREAT-MODEL.md +98 -0
- package/docs/security/THREAT-MODEL-ATLAS.md +611 -0
- package/docs/security/formal-verification.md +167 -0
- package/docs/start/bootstrapping.md +41 -0
- package/docs/start/docs-directory.md +66 -0
- package/docs/start/getting-started.md +116 -0
- package/docs/start/hubs.md +198 -0
- package/docs/start/lore.md +219 -0
- package/docs/start/onboarding-overview.md +67 -0
- package/docs/start/onboarding.md +91 -0
- package/docs/start/openclaw.md +216 -0
- package/docs/start/quickstart.md +22 -0
- package/docs/start/setup.md +164 -0
- package/docs/start/showcase.md +418 -0
- package/docs/start/wizard-cli-automation.md +215 -0
- package/docs/start/wizard-cli-reference.md +299 -0
- package/docs/start/wizard.md +125 -0
- package/docs/style.css +37 -0
- package/docs/tools/acp-agents.md +623 -0
- package/docs/tools/agent-send.md +100 -0
- package/docs/tools/apply-patch.md +51 -0
- package/docs/tools/brave-search.md +93 -0
- package/docs/tools/browser-linux-troubleshooting.md +138 -0
- package/docs/tools/browser-login.md +73 -0
- package/docs/tools/browser-wsl2-windows-remote-cdp-troubleshooting.md +211 -0
- package/docs/tools/browser.md +731 -0
- package/docs/tools/btw.md +142 -0
- package/docs/tools/capability-cookbook.md +119 -0
- package/docs/tools/clawhub.md +257 -0
- package/docs/tools/creating-skills.md +117 -0
- package/docs/tools/diffs.md +386 -0
- package/docs/tools/elevated.md +114 -0
- package/docs/tools/exec-approvals.md +400 -0
- package/docs/tools/exec.md +204 -0
- package/docs/tools/firecrawl.md +140 -0
- package/docs/tools/index.md +137 -0
- package/docs/tools/llm-task.md +119 -0
- package/docs/tools/lobster.md +340 -0
- package/docs/tools/loop-detection.md +100 -0
- package/docs/tools/multi-agent-sandbox-tools.md +364 -0
- package/docs/tools/pdf.md +156 -0
- package/docs/tools/perplexity-search.md +174 -0
- package/docs/tools/plugin.md +251 -0
- package/docs/tools/reactions.md +64 -0
- package/docs/tools/skills-config.md +86 -0
- package/docs/tools/skills.md +306 -0
- package/docs/tools/slash-commands.md +294 -0
- package/docs/tools/subagents.md +295 -0
- package/docs/tools/tavily.md +125 -0
- package/docs/tools/thinking.md +96 -0
- package/docs/tools/tts.md +406 -0
- package/docs/tools/web.md +516 -0
- package/docs/tts.md +406 -0
- package/docs/vps.md +112 -0
- package/docs/web/control-ui.md +275 -0
- package/docs/web/dashboard.md +54 -0
- package/docs/web/index.md +120 -0
- package/docs/web/tui.md +170 -0
- package/docs/web/webchat.md +61 -0
- package/docs/whatsapp-openclaw-ai-zh.jpg +0 -0
- package/docs/whatsapp-openclaw.jpg +0 -0
- package/docs/zh-CN/AGENTS.md +61 -0
- package/docs/zh-CN/automation/auth-monitoring.md +47 -0
- package/docs/zh-CN/automation/cron-jobs.md +435 -0
- package/docs/zh-CN/automation/cron-vs-heartbeat.md +286 -0
- package/docs/zh-CN/automation/gmail-pubsub.md +249 -0
- package/docs/zh-CN/automation/hooks.md +1051 -0
- package/docs/zh-CN/automation/poll.md +76 -0
- package/docs/zh-CN/automation/troubleshooting.md +8 -0
- package/docs/zh-CN/automation/webhook.md +163 -0
- package/docs/zh-CN/brave-search.md +60 -0
- package/docs/zh-CN/channels/bluebubbles.md +354 -0
- package/docs/zh-CN/channels/broadcast-groups.md +449 -0
- package/docs/zh-CN/channels/channel-routing.md +117 -0
- package/docs/zh-CN/channels/discord.md +468 -0
- package/docs/zh-CN/channels/feishu.md +728 -0
- package/docs/zh-CN/channels/googlechat.md +257 -0
- package/docs/zh-CN/channels/grammy.md +38 -0
- package/docs/zh-CN/channels/group-messages.md +91 -0
- package/docs/zh-CN/channels/groups.md +379 -0
- package/docs/zh-CN/channels/imessage.md +302 -0
- package/docs/zh-CN/channels/index.md +53 -0
- package/docs/zh-CN/channels/line.md +180 -0
- package/docs/zh-CN/channels/location.md +63 -0
- package/docs/zh-CN/channels/matrix.md +221 -0
- package/docs/zh-CN/channels/mattermost.md +144 -0
- package/docs/zh-CN/channels/msteams.md +775 -0
- package/docs/zh-CN/channels/nextcloud-talk.md +142 -0
- package/docs/zh-CN/channels/nostr.md +249 -0
- package/docs/zh-CN/channels/pairing.md +89 -0
- package/docs/zh-CN/channels/signal.md +209 -0
- package/docs/zh-CN/channels/slack.md +531 -0
- package/docs/zh-CN/channels/synology-chat.md +138 -0
- package/docs/zh-CN/channels/telegram.md +751 -0
- package/docs/zh-CN/channels/tlon.md +136 -0
- package/docs/zh-CN/channels/troubleshooting.md +36 -0
- package/docs/zh-CN/channels/twitch.md +385 -0
- package/docs/zh-CN/channels/whatsapp.md +411 -0
- package/docs/zh-CN/channels/zalo.md +196 -0
- package/docs/zh-CN/channels/zalouser.md +147 -0
- package/docs/zh-CN/cli/acp.md +173 -0
- package/docs/zh-CN/cli/agent.md +30 -0
- package/docs/zh-CN/cli/agents.md +82 -0
- package/docs/zh-CN/cli/approvals.md +57 -0
- package/docs/zh-CN/cli/browser.md +114 -0
- package/docs/zh-CN/cli/channels.md +86 -0
- package/docs/zh-CN/cli/config.md +57 -0
- package/docs/zh-CN/cli/configure.md +38 -0
- package/docs/zh-CN/cli/cron.md +43 -0
- package/docs/zh-CN/cli/dashboard.md +23 -0
- package/docs/zh-CN/cli/devices.md +74 -0
- package/docs/zh-CN/cli/directory.md +70 -0
- package/docs/zh-CN/cli/dns.md +30 -0
- package/docs/zh-CN/cli/docs.md +22 -0
- package/docs/zh-CN/cli/doctor.md +48 -0
- package/docs/zh-CN/cli/gateway.md +206 -0
- package/docs/zh-CN/cli/health.md +28 -0
- package/docs/zh-CN/cli/hooks.md +298 -0
- package/docs/zh-CN/cli/index.md +1143 -0
- package/docs/zh-CN/cli/logs.md +31 -0
- package/docs/zh-CN/cli/memory.md +52 -0
- package/docs/zh-CN/cli/message.md +246 -0
- package/docs/zh-CN/cli/models.md +85 -0
- package/docs/zh-CN/cli/node.md +115 -0
- package/docs/zh-CN/cli/nodes.md +80 -0
- package/docs/zh-CN/cli/onboard.md +164 -0
- package/docs/zh-CN/cli/pairing.md +28 -0
- package/docs/zh-CN/cli/plugins.md +66 -0
- package/docs/zh-CN/cli/reset.md +24 -0
- package/docs/zh-CN/cli/sandbox.md +158 -0
- package/docs/zh-CN/cli/security.md +33 -0
- package/docs/zh-CN/cli/sessions.md +23 -0
- package/docs/zh-CN/cli/setup.md +36 -0
- package/docs/zh-CN/cli/skills.md +33 -0
- package/docs/zh-CN/cli/status.md +33 -0
- package/docs/zh-CN/cli/system.md +63 -0
- package/docs/zh-CN/cli/tui.md +30 -0
- package/docs/zh-CN/cli/uninstall.md +24 -0
- package/docs/zh-CN/cli/update.md +101 -0
- package/docs/zh-CN/cli/voicecall.md +41 -0
- package/docs/zh-CN/cli/webhooks.md +32 -0
- package/docs/zh-CN/concepts/agent-loop.md +146 -0
- package/docs/zh-CN/concepts/agent-workspace.md +219 -0
- package/docs/zh-CN/concepts/agent.md +115 -0
- package/docs/zh-CN/concepts/architecture.md +123 -0
- package/docs/zh-CN/concepts/compaction.md +67 -0
- package/docs/zh-CN/concepts/context.md +168 -0
- package/docs/zh-CN/concepts/features.md +59 -0
- package/docs/zh-CN/concepts/markdown-formatting.md +117 -0
- package/docs/zh-CN/concepts/memory.md +412 -0
- package/docs/zh-CN/concepts/messages.md +141 -0
- package/docs/zh-CN/concepts/model-failover.md +145 -0
- package/docs/zh-CN/concepts/model-providers.md +606 -0
- package/docs/zh-CN/concepts/models.md +225 -0
- package/docs/zh-CN/concepts/multi-agent.md +372 -0
- package/docs/zh-CN/concepts/oauth.md +164 -0
- package/docs/zh-CN/concepts/presence.md +99 -0
- package/docs/zh-CN/concepts/queue.md +94 -0
- package/docs/zh-CN/concepts/retry.md +76 -0
- package/docs/zh-CN/concepts/session-pruning.md +129 -0
- package/docs/zh-CN/concepts/session-tool.md +200 -0
- package/docs/zh-CN/concepts/session.md +166 -0
- package/docs/zh-CN/concepts/streaming.md +133 -0
- package/docs/zh-CN/concepts/system-prompt.md +101 -0
- package/docs/zh-CN/concepts/timezone.md +96 -0
- package/docs/zh-CN/concepts/typebox.md +284 -0
- package/docs/zh-CN/concepts/typing-indicators.md +74 -0
- package/docs/zh-CN/concepts/usage-tracking.md +42 -0
- package/docs/zh-CN/date-time.md +129 -0
- package/docs/zh-CN/debug/node-issue.md +90 -0
- package/docs/zh-CN/diagnostics/flags.md +98 -0
- package/docs/zh-CN/gateway/authentication.md +184 -0
- package/docs/zh-CN/gateway/background-process.md +100 -0
- package/docs/zh-CN/gateway/bonjour.md +174 -0
- package/docs/zh-CN/gateway/bridge-protocol.md +86 -0
- package/docs/zh-CN/gateway/cli-backends.md +213 -0
- package/docs/zh-CN/gateway/configuration-examples.md +587 -0
- package/docs/zh-CN/gateway/configuration-reference.md +3103 -0
- package/docs/zh-CN/gateway/configuration.md +640 -0
- package/docs/zh-CN/gateway/discovery.md +123 -0
- package/docs/zh-CN/gateway/doctor.md +238 -0
- package/docs/zh-CN/gateway/gateway-lock.md +41 -0
- package/docs/zh-CN/gateway/health.md +42 -0
- package/docs/zh-CN/gateway/heartbeat.md +274 -0
- package/docs/zh-CN/gateway/index.md +335 -0
- package/docs/zh-CN/gateway/local-models.md +159 -0
- package/docs/zh-CN/gateway/logging.md +114 -0
- package/docs/zh-CN/gateway/multiple-gateways.md +119 -0
- package/docs/zh-CN/gateway/network-model.md +23 -0
- package/docs/zh-CN/gateway/openai-http-api.md +125 -0
- package/docs/zh-CN/gateway/openresponses-http-api.md +317 -0
- package/docs/zh-CN/gateway/pairing.md +99 -0
- package/docs/zh-CN/gateway/protocol.md +220 -0
- package/docs/zh-CN/gateway/remote-gateway-readme.md +164 -0
- package/docs/zh-CN/gateway/remote.md +133 -0
- package/docs/zh-CN/gateway/sandbox-vs-tool-policy-vs-elevated.md +135 -0
- package/docs/zh-CN/gateway/sandboxing.md +188 -0
- package/docs/zh-CN/gateway/security/index.md +777 -0
- package/docs/zh-CN/gateway/tailscale.md +124 -0
- package/docs/zh-CN/gateway/tools-invoke-http-api.md +92 -0
- package/docs/zh-CN/gateway/troubleshooting.md +771 -0
- package/docs/zh-CN/help/debugging.md +160 -0
- package/docs/zh-CN/help/environment.md +88 -0
- package/docs/zh-CN/help/faq.md +2640 -0
- package/docs/zh-CN/help/index.md +28 -0
- package/docs/zh-CN/help/scripts.md +35 -0
- package/docs/zh-CN/help/testing.md +375 -0
- package/docs/zh-CN/help/troubleshooting.md +104 -0
- package/docs/zh-CN/index.md +186 -0
- package/docs/zh-CN/install/ansible.md +215 -0
- package/docs/zh-CN/install/bun.md +65 -0
- package/docs/zh-CN/install/development-channels.md +81 -0
- package/docs/zh-CN/install/docker.md +532 -0
- package/docs/zh-CN/install/exe-dev.md +133 -0
- package/docs/zh-CN/install/fly.md +490 -0
- package/docs/zh-CN/install/gcp.md +510 -0
- package/docs/zh-CN/install/hetzner.md +337 -0
- package/docs/zh-CN/install/index.md +235 -0
- package/docs/zh-CN/install/installer.md +422 -0
- package/docs/zh-CN/install/macos-vm.md +288 -0
- package/docs/zh-CN/install/migrating.md +199 -0
- package/docs/zh-CN/install/nix.md +99 -0
- package/docs/zh-CN/install/node.md +8 -0
- package/docs/zh-CN/install/northflank.mdx +60 -0
- package/docs/zh-CN/install/railway.mdx +106 -0
- package/docs/zh-CN/install/render.mdx +169 -0
- package/docs/zh-CN/install/uninstall.md +135 -0
- package/docs/zh-CN/install/updating.md +233 -0
- package/docs/zh-CN/logging.md +329 -0
- package/docs/zh-CN/network.md +59 -0
- package/docs/zh-CN/nodes/audio.md +120 -0
- package/docs/zh-CN/nodes/camera.md +162 -0
- package/docs/zh-CN/nodes/images.md +79 -0
- package/docs/zh-CN/nodes/index.md +348 -0
- package/docs/zh-CN/nodes/location-command.md +120 -0
- package/docs/zh-CN/nodes/media-understanding.md +380 -0
- package/docs/zh-CN/nodes/talk.md +97 -0
- package/docs/zh-CN/nodes/troubleshooting.md +8 -0
- package/docs/zh-CN/nodes/voicewake.md +72 -0
- package/docs/zh-CN/perplexity.md +102 -0
- package/docs/zh-CN/pi-dev.md +77 -0
- package/docs/zh-CN/pi.md +619 -0
- package/docs/zh-CN/platforms/android.md +155 -0
- package/docs/zh-CN/platforms/digitalocean.md +273 -0
- package/docs/zh-CN/platforms/index.md +60 -0
- package/docs/zh-CN/platforms/ios.md +114 -0
- package/docs/zh-CN/platforms/linux.md +100 -0
- package/docs/zh-CN/platforms/mac/bundled-gateway.md +75 -0
- package/docs/zh-CN/platforms/mac/canvas.md +128 -0
- package/docs/zh-CN/platforms/mac/child-process.md +73 -0
- package/docs/zh-CN/platforms/mac/dev-setup.md +109 -0
- package/docs/zh-CN/platforms/mac/health.md +41 -0
- package/docs/zh-CN/platforms/mac/icon.md +38 -0
- package/docs/zh-CN/platforms/mac/logging.md +64 -0
- package/docs/zh-CN/platforms/mac/menu-bar.md +88 -0
- package/docs/zh-CN/platforms/mac/peekaboo.md +62 -0
- package/docs/zh-CN/platforms/mac/permissions.md +46 -0
- package/docs/zh-CN/platforms/mac/remote.md +90 -0
- package/docs/zh-CN/platforms/mac/signing.md +54 -0
- package/docs/zh-CN/platforms/mac/skills.md +40 -0
- package/docs/zh-CN/platforms/mac/voice-overlay.md +67 -0
- package/docs/zh-CN/platforms/mac/voicewake.md +74 -0
- package/docs/zh-CN/platforms/mac/webchat.md +43 -0
- package/docs/zh-CN/platforms/mac/xpc.md +68 -0
- package/docs/zh-CN/platforms/macos.md +193 -0
- package/docs/zh-CN/platforms/oracle.md +310 -0
- package/docs/zh-CN/platforms/raspberry-pi.md +416 -0
- package/docs/zh-CN/platforms/windows.md +247 -0
- package/docs/zh-CN/plugins/agent-tools.md +99 -0
- package/docs/zh-CN/plugins/manifest.md +68 -0
- package/docs/zh-CN/plugins/voice-call.md +250 -0
- package/docs/zh-CN/plugins/zalouser.md +88 -0
- package/docs/zh-CN/prose.md +141 -0
- package/docs/zh-CN/providers/anthropic.md +265 -0
- package/docs/zh-CN/providers/bedrock.md +170 -0
- package/docs/zh-CN/providers/claude-max-api-proxy.md +155 -0
- package/docs/zh-CN/providers/cloudflare-ai-gateway.md +78 -0
- package/docs/zh-CN/providers/deepgram.md +97 -0
- package/docs/zh-CN/providers/github-copilot.md +67 -0
- package/docs/zh-CN/providers/glm.md +50 -0
- package/docs/zh-CN/providers/huggingface.md +216 -0
- package/docs/zh-CN/providers/index.md +69 -0
- package/docs/zh-CN/providers/kilocode.md +80 -0
- package/docs/zh-CN/providers/litellm.md +160 -0
- package/docs/zh-CN/providers/minimax.md +222 -0
- package/docs/zh-CN/providers/mistral.md +61 -0
- package/docs/zh-CN/providers/models.md +51 -0
- package/docs/zh-CN/providers/moonshot.md +182 -0
- package/docs/zh-CN/providers/nvidia.md +62 -0
- package/docs/zh-CN/providers/ollama.md +359 -0
- package/docs/zh-CN/providers/openai.md +308 -0
- package/docs/zh-CN/providers/opencode-go.md +52 -0
- package/docs/zh-CN/providers/opencode.md +71 -0
- package/docs/zh-CN/providers/openrouter.md +44 -0
- package/docs/zh-CN/providers/qianfan.md +45 -0
- package/docs/zh-CN/providers/qwen.md +55 -0
- package/docs/zh-CN/providers/sglang.md +111 -0
- package/docs/zh-CN/providers/synthetic.md +106 -0
- package/docs/zh-CN/providers/together.md +72 -0
- package/docs/zh-CN/providers/venice.md +289 -0
- package/docs/zh-CN/providers/vercel-ai-gateway.md +66 -0
- package/docs/zh-CN/providers/xiaomi.md +93 -0
- package/docs/zh-CN/providers/zai.md +53 -0
- package/docs/zh-CN/reference/AGENTS.default.md +131 -0
- package/docs/zh-CN/reference/RELEASING.md +48 -0
- package/docs/zh-CN/reference/api-usage-costs.md +141 -0
- package/docs/zh-CN/reference/credits.md +34 -0
- package/docs/zh-CN/reference/device-models.md +54 -0
- package/docs/zh-CN/reference/rpc.md +48 -0
- package/docs/zh-CN/reference/session-management-compaction.md +287 -0
- package/docs/zh-CN/reference/templates/AGENTS.dev.md +89 -0
- package/docs/zh-CN/reference/templates/AGENTS.md +225 -0
- package/docs/zh-CN/reference/templates/BOOT.md +17 -0
- package/docs/zh-CN/reference/templates/BOOTSTRAP.md +68 -0
- package/docs/zh-CN/reference/templates/HEARTBEAT.md +18 -0
- package/docs/zh-CN/reference/templates/IDENTITY.dev.md +54 -0
- package/docs/zh-CN/reference/templates/IDENTITY.md +36 -0
- package/docs/zh-CN/reference/templates/SOUL.dev.md +83 -0
- package/docs/zh-CN/reference/templates/SOUL.md +49 -0
- package/docs/zh-CN/reference/templates/TOOLS.dev.md +31 -0
- package/docs/zh-CN/reference/templates/TOOLS.md +53 -0
- package/docs/zh-CN/reference/templates/USER.dev.md +25 -0
- package/docs/zh-CN/reference/templates/USER.md +30 -0
- package/docs/zh-CN/reference/test.md +57 -0
- package/docs/zh-CN/reference/token-use.md +119 -0
- package/docs/zh-CN/reference/transcript-hygiene.md +109 -0
- package/docs/zh-CN/reference/wizard.md +242 -0
- package/docs/zh-CN/security/formal-verification.md +171 -0
- package/docs/zh-CN/start/bootstrapping.md +9 -0
- package/docs/zh-CN/start/docs-directory.md +70 -0
- package/docs/zh-CN/start/getting-started.md +143 -0
- package/docs/zh-CN/start/hubs.md +194 -0
- package/docs/zh-CN/start/lore.md +226 -0
- package/docs/zh-CN/start/onboarding-overview.md +58 -0
- package/docs/zh-CN/start/onboarding.md +105 -0
- package/docs/zh-CN/start/openclaw.md +248 -0
- package/docs/zh-CN/start/quickstart.md +88 -0
- package/docs/zh-CN/start/setup.md +153 -0
- package/docs/zh-CN/start/showcase.md +423 -0
- package/docs/zh-CN/start/wizard-cli-automation.md +222 -0
- package/docs/zh-CN/start/wizard-cli-reference.md +306 -0
- package/docs/zh-CN/start/wizard.md +132 -0
- package/docs/zh-CN/tools/agent-send.md +59 -0
- package/docs/zh-CN/tools/apply-patch.md +57 -0
- package/docs/zh-CN/tools/browser-linux-troubleshooting.md +144 -0
- package/docs/zh-CN/tools/browser-login.md +75 -0
- package/docs/zh-CN/tools/browser.md +553 -0
- package/docs/zh-CN/tools/chrome-extension.md +183 -0
- package/docs/zh-CN/tools/clawhub.md +209 -0
- package/docs/zh-CN/tools/creating-skills.md +61 -0
- package/docs/zh-CN/tools/elevated.md +64 -0
- package/docs/zh-CN/tools/exec-approvals.md +234 -0
- package/docs/zh-CN/tools/exec.md +169 -0
- package/docs/zh-CN/tools/firecrawl.md +68 -0
- package/docs/zh-CN/tools/index.md +515 -0
- package/docs/zh-CN/tools/llm-task.md +117 -0
- package/docs/zh-CN/tools/lobster.md +349 -0
- package/docs/zh-CN/tools/multi-agent-sandbox-tools.md +401 -0
- package/docs/zh-CN/tools/plugin.md +1612 -0
- package/docs/zh-CN/tools/reactions.md +29 -0
- package/docs/zh-CN/tools/skills-config.md +78 -0
- package/docs/zh-CN/tools/skills.md +279 -0
- package/docs/zh-CN/tools/slash-commands.md +205 -0
- package/docs/zh-CN/tools/subagents.md +167 -0
- package/docs/zh-CN/tools/thinking.md +80 -0
- package/docs/zh-CN/tools/web.md +289 -0
- package/docs/zh-CN/tts.md +375 -0
- package/docs/zh-CN/vps.md +47 -0
- package/docs/zh-CN/web/control-ui.md +191 -0
- package/docs/zh-CN/web/dashboard.md +53 -0
- package/docs/zh-CN/web/index.md +118 -0
- package/docs/zh-CN/web/tui.md +166 -0
- package/docs/zh-CN/web/webchat.md +56 -0
- package/openclaw.mjs +135 -0
- package/package.json +835 -0
- package/skills/1password/SKILL.md +70 -0
- package/skills/1password/references/cli-examples.md +29 -0
- package/skills/1password/references/get-started.md +17 -0
- package/skills/apple-notes/SKILL.md +77 -0
- package/skills/apple-reminders/SKILL.md +118 -0
- package/skills/bear-notes/SKILL.md +107 -0
- package/skills/blogwatcher/SKILL.md +69 -0
- package/skills/blucli/SKILL.md +47 -0
- package/skills/bluebubbles/SKILL.md +131 -0
- package/skills/camsnap/SKILL.md +45 -0
- package/skills/canvas/SKILL.md +198 -0
- package/skills/clawhub/SKILL.md +77 -0
- package/skills/coding-agent/SKILL.md +295 -0
- package/skills/discord/SKILL.md +197 -0
- package/skills/doubao-code/SKILL.md +43 -0
- package/skills/eightctl/SKILL.md +50 -0
- package/skills/gemini/SKILL.md +43 -0
- package/skills/gh-issues/SKILL.md +865 -0
- package/skills/gifgrep/SKILL.md +79 -0
- package/skills/github/SKILL.md +163 -0
- package/skills/gog/SKILL.md +116 -0
- package/skills/goplaces/SKILL.md +52 -0
- package/skills/healthcheck/SKILL.md +245 -0
- package/skills/himalaya/SKILL.md +257 -0
- package/skills/himalaya/references/configuration.md +184 -0
- package/skills/himalaya/references/message-composition.md +199 -0
- package/skills/imsg/SKILL.md +122 -0
- package/skills/kimi-code/SKILL.md +42 -0
- package/skills/mcporter/SKILL.md +61 -0
- package/skills/model-usage/SKILL.md +69 -0
- package/skills/model-usage/references/codexbar-cli.md +33 -0
- package/skills/model-usage/scripts/model_usage.py +320 -0
- package/skills/model-usage/scripts/test_model_usage.py +40 -0
- package/skills/nano-pdf/SKILL.md +38 -0
- package/skills/node-connect/SKILL.md +142 -0
- package/skills/notion/SKILL.md +174 -0
- package/skills/obsidian/SKILL.md +81 -0
- package/skills/openai-image-gen/SKILL.md +92 -0
- package/skills/openai-image-gen/scripts/gen.py +328 -0
- package/skills/openai-image-gen/scripts/test_gen.py +140 -0
- package/skills/openai-whisper/SKILL.md +38 -0
- package/skills/openai-whisper-api/SKILL.md +52 -0
- package/skills/openai-whisper-api/scripts/transcribe.sh +85 -0
- package/skills/openhue/SKILL.md +112 -0
- package/skills/oracle/SKILL.md +125 -0
- package/skills/ordercli/SKILL.md +78 -0
- package/skills/peekaboo/SKILL.md +190 -0
- package/skills/sag/SKILL.md +87 -0
- package/skills/session-logs/SKILL.md +115 -0
- package/skills/sherpa-onnx-tts/SKILL.md +103 -0
- package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +178 -0
- package/skills/skill-creator/SKILL.md +372 -0
- package/skills/skill-creator/license.txt +202 -0
- package/skills/skill-creator/scripts/init_skill.py +378 -0
- package/skills/skill-creator/scripts/package_skill.py +139 -0
- package/skills/skill-creator/scripts/quick_validate.py +159 -0
- package/skills/skill-creator/scripts/test_package_skill.py +160 -0
- package/skills/skill-creator/scripts/test_quick_validate.py +72 -0
- package/skills/slack/SKILL.md +144 -0
- package/skills/songsee/SKILL.md +49 -0
- package/skills/sonoscli/SKILL.md +65 -0
- package/skills/spotify-player/SKILL.md +64 -0
- package/skills/summarize/SKILL.md +87 -0
- package/skills/things-mac/SKILL.md +86 -0
- package/skills/tmux/SKILL.md +153 -0
- package/skills/tmux/scripts/find-sessions.sh +112 -0
- package/skills/tmux/scripts/wait-for-text.sh +83 -0
- package/skills/trello/SKILL.md +95 -0
- package/skills/video-frames/SKILL.md +46 -0
- package/skills/video-frames/scripts/frame.sh +81 -0
- package/skills/voice-call/SKILL.md +45 -0
- package/skills/wacli/SKILL.md +72 -0
- package/skills/weather/SKILL.md +112 -0
- package/skills/xurl/SKILL.md +461 -0
|
@@ -0,0 +1,2338 @@
|
|
|
1
|
+
import { i as getChildLogger, v as normalizeLogLevel } from "./logger-CoEtkjhn.js";
|
|
2
|
+
import { _ as resolveStateDir } from "./paths-GHJ97ebE.js";
|
|
3
|
+
import { a as logVerbose, l as shouldLogVerbose, t as danger } from "./globals-41sdSaKv.js";
|
|
4
|
+
import { t as createNonExitingRuntime } from "./runtime-CT2LIJZu.js";
|
|
5
|
+
import { S as parseAgentSessionKey } from "./session-key-gFFk3uv9.js";
|
|
6
|
+
import { a as logWarn } from "./logger-Cqy7-Maj.js";
|
|
7
|
+
import { n as runCommandWithTimeout } from "./exec-Dmex2w_d.js";
|
|
8
|
+
import { d as ensureAgentWorkspace } from "./workspace-BH7CXmrr.js";
|
|
9
|
+
import { a as resolveAgentDir, p as resolveAgentWorkspaceDir, v as resolveSessionAgentId } from "./agent-scope-DPP4Z_UU.js";
|
|
10
|
+
import { n as DEFAULT_MODEL, r as DEFAULT_PROVIDER } from "./defaults-CEdZhIIb.js";
|
|
11
|
+
import { S as resolveThinkingDefault } from "./model-selection-BTpJnslv.js";
|
|
12
|
+
import { g as writeConfigFile, s as loadConfig } from "./io-jOnQRia2.js";
|
|
13
|
+
import { n as loadPluginManifestRegistry } from "./manifest-registry-B90TyTWl.js";
|
|
14
|
+
import { a as recordSessionMetaFromInbound, c as updateLastRoute, i as readSessionUpdatedAt, n as loadSessionStore, s as saveSessionStore } from "./store-CvL8MPei.js";
|
|
15
|
+
import { l as resolveStorePath, r as resolveSessionFilePath } from "./paths-CTjJI9l0.js";
|
|
16
|
+
import { n as onSessionTranscriptUpdate } from "./transcript-events-B1V6z5ct.js";
|
|
17
|
+
import { i as resolveHumanDelayConfig, n as resolveAgentIdentity, r as resolveEffectiveMessagesConfig } from "./identity-cyBYcoXS.js";
|
|
18
|
+
import { i as resolveAgentRoute, t as buildAgentSessionKey } from "./resolve-route-vEY3ONZ2.js";
|
|
19
|
+
import { $a as listWebSearchProviders, Bn as resolveThreadBindingIdleTimeoutMs, C as describeImageFile, D as transcribeAudioFile, E as runMediaUnderstandingFile, Gn as discordMessageActions, Hd as listSpeechVoices, Hn as resolveThreadBindingMaxAgeExpiresAt, In as setThreadBindingIdleTimeoutBySessionKey, Ks as signalMessageActions, Ln as setThreadBindingMaxAgeBySessionKey, Nl as finalizeInboundContext, Rf as onAgentEvent, Rn as unbindThreadBindingsBySessionKey, T as describeVideoFile, Tf as requestHeartbeatNow, Un as resolveThreadBindingMaxAgeMs, Vn as resolveThreadBindingInactivityExpiresAt, Xo as listRuntimeImageGenerationProviders, Yo as generateImage, Zr as dispatchReplyWithBufferedBlockDispatcher, _n as resolveTelegramToken, ai as withReplyDispatcher, ba as monitorSignalProvider, eo as runWebSearch, ff as isVoiceCompatibleAudio, if as textToSpeechTelephony, li as dispatchReplyFromConfig, rf as textToSpeech, si as createReplyDispatcherWithTyping, t as runEmbeddedPiAgent, w as describeImageFileWithModel, xa as sendMessageSignal, ya as probeSignal, zn as getThreadBindingManager } from "./pi-embedded-CSQySvOV.js";
|
|
20
|
+
import { n as getApiKeyForModel, s as resolveApiKeyForProvider } from "./model-auth-B__TJTPw.js";
|
|
21
|
+
import { t as waitForAbortSignal } from "./abort-signal-CsrBEr94.js";
|
|
22
|
+
import { C as resolveTextChunkLimit, S as resolveChunkMode, b as chunkText, d as convertMarkdownTables, g as chunkByNewline, t as withTimeout, v as chunkMarkdownText, x as chunkTextWithMode, y as chunkMarkdownTextWithMode } from "./text-runtime-C_Roi_Je.js";
|
|
23
|
+
import { r as recordInboundSession } from "./conversation-runtime-1O0Aaolb.js";
|
|
24
|
+
import { o as normalizePluginHttpPath, t as registerPluginHttpRoute } from "./http-registry-WFFbLYRd.js";
|
|
25
|
+
import { a as logWebSelfId, b as shouldPreferNativeJiti, c as monitorWebChannel, d as sendPollWhatsApp, f as startWebLoginWithQr, g as buildPluginLoaderJitiOptions, i as handleWhatsAppAction, l as readWebSelfId, m as webAuthExists, n as getActiveWebListener, o as loginWeb, p as waitForWebLogin, r as getWebAuthAgeMs, s as logoutWeb, t as createRuntimeWhatsAppLoginTool, u as sendMessageWhatsApp, v as resolvePluginSdkAliasFile, y as resolvePluginSdkScopedAliasMap } from "./runtime-whatsapp-boundary-xZem0NyQ.js";
|
|
26
|
+
import { l as readNumberParam, p as readStringParam, s as jsonResult } from "./common-CUBlLRXB.js";
|
|
27
|
+
import { c as resizeToJpeg, i as getImageMetadata } from "./image-ops-j01UkxEv.js";
|
|
28
|
+
import { m as mediaKindFromMime, t as detectMime } from "./mime-C4vVTBso.js";
|
|
29
|
+
import { x as resolveAgentTimeoutMs } from "./manager-ChTGDe87.js";
|
|
30
|
+
import { t as processLineMessage } from "./markdown-to-line-BWwaRx5F.js";
|
|
31
|
+
import { a as warnMissingProviderGroupPolicyFallbackOnce, n as resolveAllowlistProviderRuntimeGroupPolicy, r as resolveDefaultGroupPolicy } from "./runtime-group-policy-B7irU4eu.js";
|
|
32
|
+
import { t as createChannelPairingChallengeIssuer } from "./channel-pairing-D54mn51y.js";
|
|
33
|
+
import { n as buildPairingReply } from "./pairing-challenge-CNrPmmi9.js";
|
|
34
|
+
import { n as evaluateMatchedGroupAccessForPolicy } from "./group-access-DJZrYPx1.js";
|
|
35
|
+
import { n as isSenderIdAllowed, r as mergeDmAllowFromSources, t as firstDefined } from "./allow-from-BwTLpvhp.js";
|
|
36
|
+
import { n as resolveControlCommandGate, t as resolveCommandAuthorizedFromAuthorizers } from "./command-gating-BQXGSqc9.js";
|
|
37
|
+
import { a as readChannelAllowFromStore, d as upsertChannelPairingRequest } from "./pairing-store-C4lsd4pO.js";
|
|
38
|
+
import { c as resolvePinnedMainDmOwnerFromAllowlist } from "./dm-policy-shared-6bCJzHOS.js";
|
|
39
|
+
import { a as createLazyRuntimeSurface, n as createLazyRuntimeMethodBinder } from "./lazy-runtime-bWkd2cs3.js";
|
|
40
|
+
import { a as fetchRemoteMedia, n as loadWebMedia } from "./web-media-CtU6jM5V.js";
|
|
41
|
+
import { r as enqueueSystemEvent } from "./system-events-mAu6Ap6K.js";
|
|
42
|
+
import { p as resolveSendableOutboundReplyParts } from "./reply-payload-DBGc074f.js";
|
|
43
|
+
import { a as resolveMarkdownTableMode } from "./config-runtime-CstET7fq.js";
|
|
44
|
+
import { n as resolveChannelGroupRequireMention, t as resolveChannelGroupPolicy } from "./group-policy-CWFxv3iB.js";
|
|
45
|
+
import { it as saveMediaBuffer } from "./routes-TpLEcKO8.js";
|
|
46
|
+
import { s as buildRandomTempFilePath } from "./axios-xDDnM0KG.js";
|
|
47
|
+
import { r as readAgentMemoryFile } from "./manager-DuwFn87U.js";
|
|
48
|
+
import { i as matchesMentionWithExplicit, n as buildMentionRegexes, r as matchesMentionPatterns } from "./mentions-Bxys_va0.js";
|
|
49
|
+
import { y as shouldHandleTextCommands } from "./commands-registry-ChCep1KJ.js";
|
|
50
|
+
import { a as resolveInboundDebounceMs, c as formatInboundEnvelope, f as hasControlCommand, h as shouldComputeCommandAuthorized, i as createInboundDebouncer, m as isControlCommandMessage, o as formatAgentEnvelope, t as resolveInboundSessionEnvelopeContext, u as resolveEnvelopeFormatOptions } from "./channel-inbound-DwzVf2PK.js";
|
|
51
|
+
import { n as recordChannelActivity, t as getChannelActivity } from "./channel-activity-B8aReQoE.js";
|
|
52
|
+
import { a as isRequestBodyLimitError, c as requestBodyErrorToText, s as readRequestBodyWithLimit } from "./http-body-CCiSfloA.js";
|
|
53
|
+
import { s as clearHistoryEntriesIfEnabled, u as recordPendingHistoryEntryIfEnabled } from "./history-CHjo8B5W.js";
|
|
54
|
+
import { n as shouldAckReaction, t as removeAckReactionAfterReply } from "./ack-reactions-CNVwfOBj.js";
|
|
55
|
+
import { n as resolveMentionGatingWithBypass } from "./mention-gating-B_q-EHFx.js";
|
|
56
|
+
import { n as toLocationContext, t as formatLocationText } from "./location-DefAH9WS.js";
|
|
57
|
+
import { t as createChannelReplyPipeline } from "./channel-reply-pipeline-CPTuaW8n.js";
|
|
58
|
+
import { t as resolveMemorySearchConfig } from "./memory-search-Das1tiuB.js";
|
|
59
|
+
import { n as getMemorySearchManager, r as resolveMemoryBackendConfig } from "./search-manager-r8Cw4ZRv.js";
|
|
60
|
+
import { n as collectTelegramUnmentionedGroupIds } from "./audit-BOPSQQtd.js";
|
|
61
|
+
import { i as resolveLineAccount, n as normalizeAccountId, r as resolveDefaultLineAccountId, t as listLineAccountIds } from "./accounts-CYgFhv2o.js";
|
|
62
|
+
import { _ as showLoadingAnimation, a as createTextMessageWithQuickReplies, c as pushFlexMessage, d as pushMessageLine, f as pushMessagesLine, g as sendMessageLine, h as replyMessageLine, i as createQuickReplyItems, m as pushTextMessageWithQuickReplies, n as createImageMessage, o as getUserDisplayName, p as pushTemplateMessage, r as createLocationMessage, t as createFlexMessage, u as pushLocationMessage } from "./send-i2-mdtiE.js";
|
|
63
|
+
import { t as buildTemplateMessageFromPayload } from "./template-messages-kh7VfgOb.js";
|
|
64
|
+
import { t as resolvePairingIdLabel } from "./pairing-labels-CNKCSmBK.js";
|
|
65
|
+
import { n as resolveLineGroupConfigEntry, r as resolveLineGroupHistoryKey } from "./group-keys-BD_IYSMs.js";
|
|
66
|
+
import { n as sendMessageIMessage, r as probeIMessage, t as monitorIMessageProvider } from "./imessage-CoIuY1Ro.js";
|
|
67
|
+
import { i as setTelegramThreadBindingMaxAgeBySessionKey, o as telegramMessageActions, r as setTelegramThreadBindingIdleTimeoutBySessionKey } from "./telegram-BjDUP22F.js";
|
|
68
|
+
import { t as registerMemoryCli } from "./memory-cli-yzqneSF8.js";
|
|
69
|
+
import { createRequire } from "node:module";
|
|
70
|
+
import fs from "node:fs";
|
|
71
|
+
import path from "node:path";
|
|
72
|
+
import crypto from "node:crypto";
|
|
73
|
+
import { Type } from "@sinclair/typebox";
|
|
74
|
+
import { createJiti } from "jiti";
|
|
75
|
+
import { messagingApi } from "@line/bot-sdk";
|
|
76
|
+
//#region src/plugins/runtime/runtime-agent.ts
|
|
77
|
+
function createRuntimeAgent() {
|
|
78
|
+
return {
|
|
79
|
+
defaults: {
|
|
80
|
+
model: DEFAULT_MODEL,
|
|
81
|
+
provider: DEFAULT_PROVIDER
|
|
82
|
+
},
|
|
83
|
+
resolveAgentDir,
|
|
84
|
+
resolveAgentWorkspaceDir,
|
|
85
|
+
resolveAgentIdentity,
|
|
86
|
+
resolveThinkingDefault,
|
|
87
|
+
runEmbeddedPiAgent,
|
|
88
|
+
resolveAgentTimeoutMs,
|
|
89
|
+
ensureAgentWorkspace,
|
|
90
|
+
session: {
|
|
91
|
+
resolveStorePath,
|
|
92
|
+
loadSessionStore,
|
|
93
|
+
saveSessionStore,
|
|
94
|
+
resolveSessionFilePath
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/line/auto-reply-delivery.ts
|
|
100
|
+
async function deliverLineAutoReply(params) {
|
|
101
|
+
const { payload, lineData, replyToken, accountId, to, textLimit, deps } = params;
|
|
102
|
+
let replyTokenUsed = params.replyTokenUsed;
|
|
103
|
+
const pushLineMessages = async (messages) => {
|
|
104
|
+
if (messages.length === 0) return;
|
|
105
|
+
for (let i = 0; i < messages.length; i += 5) await deps.pushMessagesLine(to, messages.slice(i, i + 5), { accountId });
|
|
106
|
+
};
|
|
107
|
+
const sendLineMessages = async (messages, allowReplyToken) => {
|
|
108
|
+
if (messages.length === 0) return;
|
|
109
|
+
let remaining = messages;
|
|
110
|
+
if (allowReplyToken && replyToken && !replyTokenUsed) {
|
|
111
|
+
const replyBatch = remaining.slice(0, 5);
|
|
112
|
+
try {
|
|
113
|
+
await deps.replyMessageLine(replyToken, replyBatch, { accountId });
|
|
114
|
+
} catch (err) {
|
|
115
|
+
deps.onReplyError?.(err);
|
|
116
|
+
await pushLineMessages(replyBatch);
|
|
117
|
+
}
|
|
118
|
+
replyTokenUsed = true;
|
|
119
|
+
remaining = remaining.slice(replyBatch.length);
|
|
120
|
+
}
|
|
121
|
+
if (remaining.length > 0) await pushLineMessages(remaining);
|
|
122
|
+
};
|
|
123
|
+
const richMessages = [];
|
|
124
|
+
const hasQuickReplies = Boolean(lineData.quickReplies?.length);
|
|
125
|
+
if (lineData.flexMessage) richMessages.push(deps.createFlexMessage(lineData.flexMessage.altText.slice(0, 400), lineData.flexMessage.contents));
|
|
126
|
+
if (lineData.templateMessage) {
|
|
127
|
+
const templateMsg = deps.buildTemplateMessageFromPayload(lineData.templateMessage);
|
|
128
|
+
if (templateMsg) richMessages.push(templateMsg);
|
|
129
|
+
}
|
|
130
|
+
if (lineData.location) richMessages.push(deps.createLocationMessage(lineData.location));
|
|
131
|
+
const processed = payload.text ? deps.processLineMessage(payload.text) : {
|
|
132
|
+
text: "",
|
|
133
|
+
flexMessages: []
|
|
134
|
+
};
|
|
135
|
+
for (const flexMsg of processed.flexMessages) richMessages.push(deps.createFlexMessage(flexMsg.altText.slice(0, 400), flexMsg.contents));
|
|
136
|
+
const chunks = processed.text ? deps.chunkMarkdownText(processed.text, textLimit) : [];
|
|
137
|
+
const mediaMessages = resolveSendableOutboundReplyParts(payload).mediaUrls.map((url) => url?.trim()).filter((url) => Boolean(url)).map((url) => deps.createImageMessage(url));
|
|
138
|
+
if (chunks.length > 0) {
|
|
139
|
+
const hasRichOrMedia = richMessages.length > 0 || mediaMessages.length > 0;
|
|
140
|
+
if (hasQuickReplies && hasRichOrMedia) try {
|
|
141
|
+
await sendLineMessages([...richMessages, ...mediaMessages], false);
|
|
142
|
+
} catch (err) {
|
|
143
|
+
deps.onReplyError?.(err);
|
|
144
|
+
}
|
|
145
|
+
const { replyTokenUsed: nextReplyTokenUsed } = await deps.sendLineReplyChunks({
|
|
146
|
+
to,
|
|
147
|
+
chunks,
|
|
148
|
+
quickReplies: lineData.quickReplies,
|
|
149
|
+
replyToken,
|
|
150
|
+
replyTokenUsed,
|
|
151
|
+
accountId,
|
|
152
|
+
replyMessageLine: deps.replyMessageLine,
|
|
153
|
+
pushMessageLine: deps.pushMessageLine,
|
|
154
|
+
pushTextMessageWithQuickReplies: deps.pushTextMessageWithQuickReplies,
|
|
155
|
+
createTextMessageWithQuickReplies: deps.createTextMessageWithQuickReplies
|
|
156
|
+
});
|
|
157
|
+
replyTokenUsed = nextReplyTokenUsed;
|
|
158
|
+
if (!hasQuickReplies || !hasRichOrMedia) {
|
|
159
|
+
await sendLineMessages(richMessages, false);
|
|
160
|
+
if (mediaMessages.length > 0) await sendLineMessages(mediaMessages, false);
|
|
161
|
+
}
|
|
162
|
+
} else {
|
|
163
|
+
const combined = [...richMessages, ...mediaMessages];
|
|
164
|
+
if (hasQuickReplies && combined.length > 0) {
|
|
165
|
+
const quickReply = deps.createQuickReplyItems(lineData.quickReplies);
|
|
166
|
+
const targetIndex = replyToken && !replyTokenUsed ? Math.min(4, combined.length - 1) : combined.length - 1;
|
|
167
|
+
combined[targetIndex] = {
|
|
168
|
+
...combined[targetIndex],
|
|
169
|
+
quickReply
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
await sendLineMessages(combined, true);
|
|
173
|
+
}
|
|
174
|
+
return { replyTokenUsed };
|
|
175
|
+
}
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region src/line/bot-access.ts
|
|
178
|
+
function normalizeAllowEntry(value) {
|
|
179
|
+
const trimmed = String(value).trim();
|
|
180
|
+
if (!trimmed) return "";
|
|
181
|
+
if (trimmed === "*") return "*";
|
|
182
|
+
return trimmed.replace(/^line:(?:user:)?/i, "");
|
|
183
|
+
}
|
|
184
|
+
const normalizeAllowFrom = (list) => {
|
|
185
|
+
const entries = (list ?? []).map((value) => normalizeAllowEntry(value)).filter(Boolean);
|
|
186
|
+
return {
|
|
187
|
+
entries,
|
|
188
|
+
hasWildcard: entries.includes("*"),
|
|
189
|
+
hasEntries: entries.length > 0
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
const normalizeDmAllowFromWithStore = (params) => normalizeAllowFrom(mergeDmAllowFromSources(params));
|
|
193
|
+
const isSenderAllowed = (params) => {
|
|
194
|
+
const { allow, senderId } = params;
|
|
195
|
+
return isSenderIdAllowed(allow, senderId, false);
|
|
196
|
+
};
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region src/line/bot-message-context.ts
|
|
199
|
+
function getLineSourceInfo(source) {
|
|
200
|
+
return {
|
|
201
|
+
userId: source.type === "user" ? source.userId : source.type === "group" ? source.userId : source.type === "room" ? source.userId : void 0,
|
|
202
|
+
groupId: source.type === "group" ? source.groupId : void 0,
|
|
203
|
+
roomId: source.type === "room" ? source.roomId : void 0,
|
|
204
|
+
isGroup: source.type === "group" || source.type === "room"
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function buildPeerId(source) {
|
|
208
|
+
const groupKey = resolveLineGroupHistoryKey({
|
|
209
|
+
groupId: source.type === "group" ? source.groupId : void 0,
|
|
210
|
+
roomId: source.type === "room" ? source.roomId : void 0
|
|
211
|
+
});
|
|
212
|
+
if (groupKey) return groupKey;
|
|
213
|
+
if (source.type === "user" && source.userId) return source.userId;
|
|
214
|
+
return "unknown";
|
|
215
|
+
}
|
|
216
|
+
function resolveLineInboundRoute(params) {
|
|
217
|
+
recordChannelActivity({
|
|
218
|
+
channel: "line",
|
|
219
|
+
accountId: params.account.accountId,
|
|
220
|
+
direction: "inbound"
|
|
221
|
+
});
|
|
222
|
+
const { userId, groupId, roomId, isGroup } = getLineSourceInfo(params.source);
|
|
223
|
+
const peerId = buildPeerId(params.source);
|
|
224
|
+
return {
|
|
225
|
+
userId,
|
|
226
|
+
groupId,
|
|
227
|
+
roomId,
|
|
228
|
+
isGroup,
|
|
229
|
+
peerId,
|
|
230
|
+
route: resolveAgentRoute({
|
|
231
|
+
cfg: params.cfg,
|
|
232
|
+
channel: "line",
|
|
233
|
+
accountId: params.account.accountId,
|
|
234
|
+
peer: {
|
|
235
|
+
kind: isGroup ? "group" : "direct",
|
|
236
|
+
id: peerId
|
|
237
|
+
}
|
|
238
|
+
})
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
const STICKER_PACKAGES = {
|
|
242
|
+
"1": "Moon & James",
|
|
243
|
+
"2": "Cony & Brown",
|
|
244
|
+
"3": "Brown & Friends",
|
|
245
|
+
"4": "Moon Special",
|
|
246
|
+
"11537": "Cony",
|
|
247
|
+
"11538": "Brown",
|
|
248
|
+
"11539": "Moon",
|
|
249
|
+
"6136": "Cony's Happy Life",
|
|
250
|
+
"6325": "Brown's Life",
|
|
251
|
+
"6359": "Choco",
|
|
252
|
+
"6362": "Sally",
|
|
253
|
+
"6370": "Edward",
|
|
254
|
+
"789": "LINE Characters"
|
|
255
|
+
};
|
|
256
|
+
function describeStickerKeywords(sticker) {
|
|
257
|
+
const keywords = sticker.keywords;
|
|
258
|
+
if (keywords && keywords.length > 0) return keywords.slice(0, 3).join(", ");
|
|
259
|
+
const stickerText = sticker.text;
|
|
260
|
+
if (stickerText) return stickerText;
|
|
261
|
+
return "";
|
|
262
|
+
}
|
|
263
|
+
function extractMessageText(message) {
|
|
264
|
+
if (message.type === "text") return message.text;
|
|
265
|
+
if (message.type === "location") {
|
|
266
|
+
const loc = message;
|
|
267
|
+
return formatLocationText({
|
|
268
|
+
latitude: loc.latitude,
|
|
269
|
+
longitude: loc.longitude,
|
|
270
|
+
name: loc.title,
|
|
271
|
+
address: loc.address
|
|
272
|
+
}) ?? "";
|
|
273
|
+
}
|
|
274
|
+
if (message.type === "sticker") {
|
|
275
|
+
const sticker = message;
|
|
276
|
+
const packageName = STICKER_PACKAGES[sticker.packageId] ?? "sticker";
|
|
277
|
+
const keywords = describeStickerKeywords(sticker);
|
|
278
|
+
if (keywords) return `[Sent a ${packageName} sticker: ${keywords}]`;
|
|
279
|
+
return `[Sent a ${packageName} sticker]`;
|
|
280
|
+
}
|
|
281
|
+
return "";
|
|
282
|
+
}
|
|
283
|
+
function extractMediaPlaceholder(message) {
|
|
284
|
+
switch (message.type) {
|
|
285
|
+
case "image": return "<media:image>";
|
|
286
|
+
case "video": return "<media:video>";
|
|
287
|
+
case "audio": return "<media:audio>";
|
|
288
|
+
case "file": return "<media:document>";
|
|
289
|
+
default: return "";
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
function resolveLineConversationLabel(params) {
|
|
293
|
+
return params.isGroup ? params.groupId ? `group:${params.groupId}` : params.roomId ? `room:${params.roomId}` : "unknown-group" : params.senderLabel;
|
|
294
|
+
}
|
|
295
|
+
function resolveLineAddresses(params) {
|
|
296
|
+
const fromAddress = params.isGroup ? params.groupId ? `line:group:${params.groupId}` : params.roomId ? `line:room:${params.roomId}` : `line:${params.peerId}` : `line:${params.userId ?? params.peerId}`;
|
|
297
|
+
return {
|
|
298
|
+
fromAddress,
|
|
299
|
+
toAddress: params.isGroup ? fromAddress : `line:${params.userId ?? params.peerId}`,
|
|
300
|
+
originatingTo: params.isGroup ? fromAddress : `line:${params.userId ?? params.peerId}`
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
function resolveLineGroupSystemPrompt(groups, source) {
|
|
304
|
+
return resolveLineGroupConfigEntry(groups, {
|
|
305
|
+
groupId: source.groupId,
|
|
306
|
+
roomId: source.roomId
|
|
307
|
+
})?.systemPrompt?.trim() || void 0;
|
|
308
|
+
}
|
|
309
|
+
async function finalizeLineInboundContext(params) {
|
|
310
|
+
const { fromAddress, toAddress, originatingTo } = resolveLineAddresses({
|
|
311
|
+
isGroup: params.source.isGroup,
|
|
312
|
+
groupId: params.source.groupId,
|
|
313
|
+
roomId: params.source.roomId,
|
|
314
|
+
userId: params.source.userId,
|
|
315
|
+
peerId: params.source.peerId
|
|
316
|
+
});
|
|
317
|
+
const senderId = params.source.userId ?? "unknown";
|
|
318
|
+
const senderLabel = params.source.userId ? `user:${params.source.userId}` : "unknown";
|
|
319
|
+
const conversationLabel = resolveLineConversationLabel({
|
|
320
|
+
isGroup: params.source.isGroup,
|
|
321
|
+
groupId: params.source.groupId,
|
|
322
|
+
roomId: params.source.roomId,
|
|
323
|
+
senderLabel
|
|
324
|
+
});
|
|
325
|
+
const { storePath, envelopeOptions, previousTimestamp } = resolveInboundSessionEnvelopeContext({
|
|
326
|
+
cfg: params.cfg,
|
|
327
|
+
agentId: params.route.agentId,
|
|
328
|
+
sessionKey: params.route.sessionKey
|
|
329
|
+
});
|
|
330
|
+
const body = formatInboundEnvelope({
|
|
331
|
+
channel: "LINE",
|
|
332
|
+
from: conversationLabel,
|
|
333
|
+
timestamp: params.timestamp,
|
|
334
|
+
body: params.rawBody,
|
|
335
|
+
chatType: params.source.isGroup ? "group" : "direct",
|
|
336
|
+
sender: { id: senderId },
|
|
337
|
+
previousTimestamp,
|
|
338
|
+
envelope: envelopeOptions
|
|
339
|
+
});
|
|
340
|
+
const ctxPayload = finalizeInboundContext({
|
|
341
|
+
Body: body,
|
|
342
|
+
BodyForAgent: params.rawBody,
|
|
343
|
+
RawBody: params.rawBody,
|
|
344
|
+
CommandBody: params.rawBody,
|
|
345
|
+
From: fromAddress,
|
|
346
|
+
To: toAddress,
|
|
347
|
+
SessionKey: params.route.sessionKey,
|
|
348
|
+
AccountId: params.route.accountId,
|
|
349
|
+
ChatType: params.source.isGroup ? "group" : "direct",
|
|
350
|
+
ConversationLabel: conversationLabel,
|
|
351
|
+
GroupSubject: params.source.isGroup ? params.source.groupId ?? params.source.roomId : void 0,
|
|
352
|
+
SenderId: senderId,
|
|
353
|
+
Provider: "line",
|
|
354
|
+
Surface: "line",
|
|
355
|
+
MessageSid: params.messageSid,
|
|
356
|
+
Timestamp: params.timestamp,
|
|
357
|
+
MediaPath: params.media.firstPath,
|
|
358
|
+
MediaType: params.media.firstContentType,
|
|
359
|
+
MediaUrl: params.media.firstPath,
|
|
360
|
+
MediaPaths: params.media.paths,
|
|
361
|
+
MediaUrls: params.media.paths,
|
|
362
|
+
MediaTypes: params.media.types,
|
|
363
|
+
...params.locationContext,
|
|
364
|
+
CommandAuthorized: params.commandAuthorized,
|
|
365
|
+
OriginatingChannel: "line",
|
|
366
|
+
OriginatingTo: originatingTo,
|
|
367
|
+
GroupSystemPrompt: params.source.isGroup ? resolveLineGroupSystemPrompt(params.account.config.groups, params.source) : void 0,
|
|
368
|
+
InboundHistory: params.inboundHistory
|
|
369
|
+
});
|
|
370
|
+
const pinnedMainDmOwner = !params.source.isGroup ? resolvePinnedMainDmOwnerFromAllowlist({
|
|
371
|
+
dmScope: params.cfg.session?.dmScope,
|
|
372
|
+
allowFrom: params.account.config.allowFrom,
|
|
373
|
+
normalizeEntry: (entry) => normalizeAllowFrom([entry]).entries[0]
|
|
374
|
+
}) : null;
|
|
375
|
+
await recordInboundSession({
|
|
376
|
+
storePath,
|
|
377
|
+
sessionKey: ctxPayload.SessionKey ?? params.route.sessionKey,
|
|
378
|
+
ctx: ctxPayload,
|
|
379
|
+
updateLastRoute: !params.source.isGroup ? {
|
|
380
|
+
sessionKey: params.route.mainSessionKey,
|
|
381
|
+
channel: "line",
|
|
382
|
+
to: params.source.userId ?? params.source.peerId,
|
|
383
|
+
accountId: params.route.accountId,
|
|
384
|
+
mainDmOwnerPin: pinnedMainDmOwner && params.source.userId ? {
|
|
385
|
+
ownerRecipient: pinnedMainDmOwner,
|
|
386
|
+
senderRecipient: params.source.userId,
|
|
387
|
+
onSkip: ({ ownerRecipient, senderRecipient }) => {
|
|
388
|
+
logVerbose(`line: skip main-session last route for ${senderRecipient} (pinned owner ${ownerRecipient})`);
|
|
389
|
+
}
|
|
390
|
+
} : void 0
|
|
391
|
+
} : void 0,
|
|
392
|
+
onRecordError: (err) => {
|
|
393
|
+
logVerbose(`line: failed updating session meta: ${String(err)}`);
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
if (shouldLogVerbose()) {
|
|
397
|
+
const preview = body.slice(0, 200).replace(/\n/g, "\\n");
|
|
398
|
+
const mediaInfo = params.verboseLog.kind === "inbound" && (params.verboseLog.mediaCount ?? 0) > 1 ? ` mediaCount=${params.verboseLog.mediaCount}` : "";
|
|
399
|
+
logVerbose(`${params.verboseLog.kind === "inbound" ? "line inbound" : "line postback"}: from=${ctxPayload.From} len=${body.length}${mediaInfo} preview="${preview}"`);
|
|
400
|
+
}
|
|
401
|
+
return {
|
|
402
|
+
ctxPayload,
|
|
403
|
+
replyToken: params.event.replyToken
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
async function buildLineMessageContext(params) {
|
|
407
|
+
const { event, allMedia, cfg, account, commandAuthorized, groupHistories, historyLimit } = params;
|
|
408
|
+
const source = event.source;
|
|
409
|
+
const { userId, groupId, roomId, isGroup, peerId, route } = resolveLineInboundRoute({
|
|
410
|
+
source,
|
|
411
|
+
cfg,
|
|
412
|
+
account
|
|
413
|
+
});
|
|
414
|
+
const message = event.message;
|
|
415
|
+
const messageId = message.id;
|
|
416
|
+
const timestamp = event.timestamp;
|
|
417
|
+
const textContent = extractMessageText(message);
|
|
418
|
+
const placeholder = extractMediaPlaceholder(message);
|
|
419
|
+
let rawBody = textContent || placeholder;
|
|
420
|
+
if (!rawBody && allMedia.length > 0) rawBody = `<media:image>${allMedia.length > 1 ? ` (${allMedia.length} images)` : ""}`;
|
|
421
|
+
if (!rawBody && allMedia.length === 0) return null;
|
|
422
|
+
let locationContext;
|
|
423
|
+
if (message.type === "location") {
|
|
424
|
+
const loc = message;
|
|
425
|
+
locationContext = toLocationContext({
|
|
426
|
+
latitude: loc.latitude,
|
|
427
|
+
longitude: loc.longitude,
|
|
428
|
+
name: loc.title,
|
|
429
|
+
address: loc.address
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
const historyKey = isGroup ? peerId : void 0;
|
|
433
|
+
const inboundHistory = historyKey && groupHistories && (historyLimit ?? 0) > 0 ? (groupHistories.get(historyKey) ?? []).map((entry) => ({
|
|
434
|
+
sender: entry.sender,
|
|
435
|
+
body: entry.body,
|
|
436
|
+
timestamp: entry.timestamp
|
|
437
|
+
})) : void 0;
|
|
438
|
+
const { ctxPayload } = await finalizeLineInboundContext({
|
|
439
|
+
cfg,
|
|
440
|
+
account,
|
|
441
|
+
event,
|
|
442
|
+
route,
|
|
443
|
+
source: {
|
|
444
|
+
userId,
|
|
445
|
+
groupId,
|
|
446
|
+
roomId,
|
|
447
|
+
isGroup,
|
|
448
|
+
peerId
|
|
449
|
+
},
|
|
450
|
+
rawBody,
|
|
451
|
+
timestamp,
|
|
452
|
+
messageSid: messageId,
|
|
453
|
+
commandAuthorized,
|
|
454
|
+
media: {
|
|
455
|
+
firstPath: allMedia[0]?.path,
|
|
456
|
+
firstContentType: allMedia[0]?.contentType,
|
|
457
|
+
paths: allMedia.length > 0 ? allMedia.map((m) => m.path) : void 0,
|
|
458
|
+
types: allMedia.length > 0 ? allMedia.map((m) => m.contentType).filter(Boolean) : void 0
|
|
459
|
+
},
|
|
460
|
+
locationContext,
|
|
461
|
+
verboseLog: {
|
|
462
|
+
kind: "inbound",
|
|
463
|
+
mediaCount: allMedia.length
|
|
464
|
+
},
|
|
465
|
+
inboundHistory
|
|
466
|
+
});
|
|
467
|
+
return {
|
|
468
|
+
ctxPayload,
|
|
469
|
+
event,
|
|
470
|
+
userId,
|
|
471
|
+
groupId,
|
|
472
|
+
roomId,
|
|
473
|
+
isGroup,
|
|
474
|
+
route,
|
|
475
|
+
replyToken: event.replyToken,
|
|
476
|
+
accountId: account.accountId
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
async function buildLinePostbackContext(params) {
|
|
480
|
+
const { event, cfg, account, commandAuthorized } = params;
|
|
481
|
+
const source = event.source;
|
|
482
|
+
const { userId, groupId, roomId, isGroup, peerId, route } = resolveLineInboundRoute({
|
|
483
|
+
source,
|
|
484
|
+
cfg,
|
|
485
|
+
account
|
|
486
|
+
});
|
|
487
|
+
const timestamp = event.timestamp;
|
|
488
|
+
const rawData = event.postback?.data?.trim() ?? "";
|
|
489
|
+
if (!rawData) return null;
|
|
490
|
+
let rawBody = rawData;
|
|
491
|
+
if (rawData.includes("line.action=")) {
|
|
492
|
+
const params = new URLSearchParams(rawData);
|
|
493
|
+
const action = params.get("line.action") ?? "";
|
|
494
|
+
const device = params.get("line.device");
|
|
495
|
+
rawBody = device ? `line action ${action} device ${device}` : `line action ${action}`;
|
|
496
|
+
}
|
|
497
|
+
const messageSid = event.replyToken ? `postback:${event.replyToken}` : `postback:${timestamp}`;
|
|
498
|
+
const { ctxPayload } = await finalizeLineInboundContext({
|
|
499
|
+
cfg,
|
|
500
|
+
account,
|
|
501
|
+
event,
|
|
502
|
+
route,
|
|
503
|
+
source: {
|
|
504
|
+
userId,
|
|
505
|
+
groupId,
|
|
506
|
+
roomId,
|
|
507
|
+
isGroup,
|
|
508
|
+
peerId
|
|
509
|
+
},
|
|
510
|
+
rawBody,
|
|
511
|
+
timestamp,
|
|
512
|
+
messageSid,
|
|
513
|
+
commandAuthorized,
|
|
514
|
+
media: {
|
|
515
|
+
firstPath: "",
|
|
516
|
+
firstContentType: void 0,
|
|
517
|
+
paths: void 0,
|
|
518
|
+
types: void 0
|
|
519
|
+
},
|
|
520
|
+
verboseLog: { kind: "postback" }
|
|
521
|
+
});
|
|
522
|
+
return {
|
|
523
|
+
ctxPayload,
|
|
524
|
+
event,
|
|
525
|
+
userId,
|
|
526
|
+
groupId,
|
|
527
|
+
roomId,
|
|
528
|
+
isGroup,
|
|
529
|
+
route,
|
|
530
|
+
replyToken: event.replyToken,
|
|
531
|
+
accountId: account.accountId
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
//#endregion
|
|
535
|
+
//#region src/line/download.ts
|
|
536
|
+
const AUDIO_BRANDS = new Set([
|
|
537
|
+
"m4a ",
|
|
538
|
+
"m4b ",
|
|
539
|
+
"m4p ",
|
|
540
|
+
"m4r ",
|
|
541
|
+
"f4a ",
|
|
542
|
+
"f4b "
|
|
543
|
+
]);
|
|
544
|
+
async function downloadLineMedia(messageId, channelAccessToken, maxBytes = 10 * 1024 * 1024) {
|
|
545
|
+
const response = await new messagingApi.MessagingApiBlobClient({ channelAccessToken }).getMessageContent(messageId);
|
|
546
|
+
const chunks = [];
|
|
547
|
+
let totalSize = 0;
|
|
548
|
+
for await (const chunk of response) {
|
|
549
|
+
totalSize += chunk.length;
|
|
550
|
+
if (totalSize > maxBytes) throw new Error(`Media exceeds ${Math.round(maxBytes / (1024 * 1024))}MB limit`);
|
|
551
|
+
chunks.push(chunk);
|
|
552
|
+
}
|
|
553
|
+
const buffer = Buffer.concat(chunks);
|
|
554
|
+
const contentType = detectContentType(buffer);
|
|
555
|
+
const filePath = buildRandomTempFilePath({
|
|
556
|
+
prefix: "line-media",
|
|
557
|
+
extension: getExtensionForContentType(contentType)
|
|
558
|
+
});
|
|
559
|
+
await fs.promises.writeFile(filePath, buffer);
|
|
560
|
+
logVerbose(`line: downloaded media ${messageId} to ${filePath} (${buffer.length} bytes)`);
|
|
561
|
+
return {
|
|
562
|
+
path: filePath,
|
|
563
|
+
contentType,
|
|
564
|
+
size: buffer.length
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
function detectContentType(buffer) {
|
|
568
|
+
const hasFtypBox = buffer.length >= 12 && buffer[4] === 102 && buffer[5] === 116 && buffer[6] === 121 && buffer[7] === 112;
|
|
569
|
+
if (buffer.length >= 2) {
|
|
570
|
+
if (buffer[0] === 255 && buffer[1] === 216) return "image/jpeg";
|
|
571
|
+
if (buffer[0] === 137 && buffer[1] === 80 && buffer[2] === 78 && buffer[3] === 71) return "image/png";
|
|
572
|
+
if (buffer[0] === 71 && buffer[1] === 73 && buffer[2] === 70) return "image/gif";
|
|
573
|
+
if (buffer[0] === 82 && buffer[1] === 73 && buffer[2] === 70 && buffer[3] === 70 && buffer[8] === 87 && buffer[9] === 69 && buffer[10] === 66 && buffer[11] === 80) return "image/webp";
|
|
574
|
+
if (hasFtypBox) {
|
|
575
|
+
const majorBrand = buffer.toString("ascii", 8, 12).toLowerCase();
|
|
576
|
+
if (AUDIO_BRANDS.has(majorBrand)) return "audio/mp4";
|
|
577
|
+
return "video/mp4";
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
return "application/octet-stream";
|
|
581
|
+
}
|
|
582
|
+
function getExtensionForContentType(contentType) {
|
|
583
|
+
switch (contentType) {
|
|
584
|
+
case "image/jpeg": return ".jpg";
|
|
585
|
+
case "image/png": return ".png";
|
|
586
|
+
case "image/gif": return ".gif";
|
|
587
|
+
case "image/webp": return ".webp";
|
|
588
|
+
case "video/mp4": return ".mp4";
|
|
589
|
+
case "audio/mp4": return ".m4a";
|
|
590
|
+
case "audio/mpeg": return ".mp3";
|
|
591
|
+
default: return ".bin";
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
//#endregion
|
|
595
|
+
//#region src/line/bot-handlers.ts
|
|
596
|
+
const LINE_DOWNLOADABLE_MESSAGE_TYPES = new Set([
|
|
597
|
+
"image",
|
|
598
|
+
"video",
|
|
599
|
+
"audio",
|
|
600
|
+
"file"
|
|
601
|
+
]);
|
|
602
|
+
function isDownloadableLineMessageType(messageType) {
|
|
603
|
+
return LINE_DOWNLOADABLE_MESSAGE_TYPES.has(messageType);
|
|
604
|
+
}
|
|
605
|
+
const LINE_WEBHOOK_REPLAY_WINDOW_MS = 600 * 1e3;
|
|
606
|
+
const LINE_WEBHOOK_REPLAY_MAX_ENTRIES = 4096;
|
|
607
|
+
const LINE_WEBHOOK_REPLAY_PRUNE_INTERVAL_MS = 1e3;
|
|
608
|
+
function createLineWebhookReplayCache() {
|
|
609
|
+
return {
|
|
610
|
+
seenEvents: /* @__PURE__ */ new Map(),
|
|
611
|
+
inFlightEvents: /* @__PURE__ */ new Map(),
|
|
612
|
+
lastPruneAtMs: 0
|
|
613
|
+
};
|
|
614
|
+
}
|
|
615
|
+
function pruneLineWebhookReplayCache(cache, nowMs) {
|
|
616
|
+
const minSeenAt = nowMs - LINE_WEBHOOK_REPLAY_WINDOW_MS;
|
|
617
|
+
for (const [key, seenAt] of cache.seenEvents) if (seenAt < minSeenAt) cache.seenEvents.delete(key);
|
|
618
|
+
if (cache.seenEvents.size > LINE_WEBHOOK_REPLAY_MAX_ENTRIES) {
|
|
619
|
+
const deleteCount = cache.seenEvents.size - LINE_WEBHOOK_REPLAY_MAX_ENTRIES;
|
|
620
|
+
let deleted = 0;
|
|
621
|
+
for (const key of cache.seenEvents.keys()) {
|
|
622
|
+
if (deleted >= deleteCount) break;
|
|
623
|
+
cache.seenEvents.delete(key);
|
|
624
|
+
deleted += 1;
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
function buildLineWebhookReplayKey(event, accountId) {
|
|
629
|
+
if (event.type === "message") {
|
|
630
|
+
const messageId = event.message?.id?.trim();
|
|
631
|
+
if (messageId) return {
|
|
632
|
+
key: `${accountId}|message:${messageId}`,
|
|
633
|
+
eventId: `message:${messageId}`
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
const eventId = event.webhookEventId?.trim();
|
|
637
|
+
if (!eventId) return null;
|
|
638
|
+
const source = event.source;
|
|
639
|
+
const sourceId = source?.type === "group" ? `group:${source.groupId ?? ""}` : source?.type === "room" ? `room:${source.roomId ?? ""}` : `user:${source?.userId ?? ""}`;
|
|
640
|
+
return {
|
|
641
|
+
key: `${accountId}|${event.type}|${sourceId}|${eventId}`,
|
|
642
|
+
eventId: `event:${eventId}`
|
|
643
|
+
};
|
|
644
|
+
}
|
|
645
|
+
function getLineReplayCandidate(event, context) {
|
|
646
|
+
const replay = buildLineWebhookReplayKey(event, context.account.accountId);
|
|
647
|
+
const cache = context.replayCache;
|
|
648
|
+
if (!replay || !cache) return null;
|
|
649
|
+
const nowMs = Date.now();
|
|
650
|
+
if (nowMs - cache.lastPruneAtMs >= LINE_WEBHOOK_REPLAY_PRUNE_INTERVAL_MS || cache.seenEvents.size >= LINE_WEBHOOK_REPLAY_MAX_ENTRIES) {
|
|
651
|
+
pruneLineWebhookReplayCache(cache, nowMs);
|
|
652
|
+
cache.lastPruneAtMs = nowMs;
|
|
653
|
+
}
|
|
654
|
+
return {
|
|
655
|
+
key: replay.key,
|
|
656
|
+
eventId: replay.eventId,
|
|
657
|
+
seenAtMs: nowMs,
|
|
658
|
+
cache
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
function shouldSkipLineReplayEvent(candidate) {
|
|
662
|
+
const inFlightResult = candidate.cache.inFlightEvents.get(candidate.key);
|
|
663
|
+
if (inFlightResult) {
|
|
664
|
+
logVerbose(`line: skipped in-flight replayed webhook event ${candidate.eventId}`);
|
|
665
|
+
return {
|
|
666
|
+
skip: true,
|
|
667
|
+
inFlightResult
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
if (candidate.cache.seenEvents.has(candidate.key)) {
|
|
671
|
+
logVerbose(`line: skipped replayed webhook event ${candidate.eventId}`);
|
|
672
|
+
return { skip: true };
|
|
673
|
+
}
|
|
674
|
+
return { skip: false };
|
|
675
|
+
}
|
|
676
|
+
function markLineReplayEventInFlight(candidate) {
|
|
677
|
+
let resolve;
|
|
678
|
+
let reject;
|
|
679
|
+
const promise = new Promise((resolvePromise, rejectPromise) => {
|
|
680
|
+
resolve = resolvePromise;
|
|
681
|
+
reject = rejectPromise;
|
|
682
|
+
});
|
|
683
|
+
promise.catch(() => {});
|
|
684
|
+
candidate.cache.inFlightEvents.set(candidate.key, promise);
|
|
685
|
+
return {
|
|
686
|
+
promise,
|
|
687
|
+
resolve,
|
|
688
|
+
reject
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
function clearLineReplayEventInFlight(candidate) {
|
|
692
|
+
candidate.cache.inFlightEvents.delete(candidate.key);
|
|
693
|
+
}
|
|
694
|
+
function rememberLineReplayEvent(candidate) {
|
|
695
|
+
candidate.cache.seenEvents.set(candidate.key, candidate.seenAtMs);
|
|
696
|
+
}
|
|
697
|
+
function resolveLineGroupConfig(params) {
|
|
698
|
+
return resolveLineGroupConfigEntry(params.config.groups, {
|
|
699
|
+
groupId: params.groupId,
|
|
700
|
+
roomId: params.roomId
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
async function sendLinePairingReply(params) {
|
|
704
|
+
const { senderId, replyToken, context } = params;
|
|
705
|
+
const idLabel = (() => {
|
|
706
|
+
try {
|
|
707
|
+
return resolvePairingIdLabel("line");
|
|
708
|
+
} catch {
|
|
709
|
+
return "lineUserId";
|
|
710
|
+
}
|
|
711
|
+
})();
|
|
712
|
+
await createChannelPairingChallengeIssuer({
|
|
713
|
+
channel: "line",
|
|
714
|
+
upsertPairingRequest: async ({ id, meta }) => await upsertChannelPairingRequest({
|
|
715
|
+
channel: "line",
|
|
716
|
+
id,
|
|
717
|
+
accountId: context.account.accountId,
|
|
718
|
+
meta
|
|
719
|
+
})
|
|
720
|
+
})({
|
|
721
|
+
senderId,
|
|
722
|
+
senderIdLine: `Your ${idLabel}: ${senderId}`,
|
|
723
|
+
onCreated: () => {
|
|
724
|
+
logVerbose(`line pairing request sender=${senderId}`);
|
|
725
|
+
},
|
|
726
|
+
sendPairingReply: async (text) => {
|
|
727
|
+
if (replyToken) try {
|
|
728
|
+
await replyMessageLine(replyToken, [{
|
|
729
|
+
type: "text",
|
|
730
|
+
text
|
|
731
|
+
}], {
|
|
732
|
+
accountId: context.account.accountId,
|
|
733
|
+
channelAccessToken: context.account.channelAccessToken
|
|
734
|
+
});
|
|
735
|
+
return;
|
|
736
|
+
} catch (err) {
|
|
737
|
+
logVerbose(`line pairing reply failed for ${senderId}: ${String(err)}`);
|
|
738
|
+
}
|
|
739
|
+
try {
|
|
740
|
+
await pushMessageLine(`line:${senderId}`, text, {
|
|
741
|
+
accountId: context.account.accountId,
|
|
742
|
+
channelAccessToken: context.account.channelAccessToken
|
|
743
|
+
});
|
|
744
|
+
} catch (err) {
|
|
745
|
+
logVerbose(`line pairing reply failed for ${senderId}: ${String(err)}`);
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
async function shouldProcessLineEvent(event, context) {
|
|
751
|
+
const denied = {
|
|
752
|
+
allowed: false,
|
|
753
|
+
commandAuthorized: false
|
|
754
|
+
};
|
|
755
|
+
const { cfg, account } = context;
|
|
756
|
+
const { userId, groupId, roomId, isGroup } = getLineSourceInfo(event.source);
|
|
757
|
+
const senderId = userId ?? "";
|
|
758
|
+
const dmPolicy = account.config.dmPolicy ?? "pairing";
|
|
759
|
+
const storeAllowFrom = await readChannelAllowFromStore("line", void 0, account.accountId).catch(() => []);
|
|
760
|
+
const effectiveDmAllow = normalizeDmAllowFromWithStore({
|
|
761
|
+
allowFrom: account.config.allowFrom,
|
|
762
|
+
storeAllowFrom,
|
|
763
|
+
dmPolicy
|
|
764
|
+
});
|
|
765
|
+
const groupConfig = resolveLineGroupConfig({
|
|
766
|
+
config: account.config,
|
|
767
|
+
groupId,
|
|
768
|
+
roomId
|
|
769
|
+
});
|
|
770
|
+
const groupAllowOverride = groupConfig?.allowFrom;
|
|
771
|
+
const fallbackGroupAllowFrom = account.config.allowFrom?.length ? account.config.allowFrom : void 0;
|
|
772
|
+
const effectiveGroupAllow = normalizeAllowFrom(firstDefined(groupAllowOverride, account.config.groupAllowFrom, fallbackGroupAllowFrom));
|
|
773
|
+
const defaultGroupPolicy = resolveDefaultGroupPolicy(cfg);
|
|
774
|
+
const { groupPolicy, providerMissingFallbackApplied } = resolveAllowlistProviderRuntimeGroupPolicy({
|
|
775
|
+
providerConfigPresent: cfg.channels?.line !== void 0,
|
|
776
|
+
groupPolicy: account.config.groupPolicy,
|
|
777
|
+
defaultGroupPolicy
|
|
778
|
+
});
|
|
779
|
+
warnMissingProviderGroupPolicyFallbackOnce({
|
|
780
|
+
providerMissingFallbackApplied,
|
|
781
|
+
providerKey: "line",
|
|
782
|
+
accountId: account.accountId,
|
|
783
|
+
log: (message) => logVerbose(message)
|
|
784
|
+
});
|
|
785
|
+
if (isGroup) {
|
|
786
|
+
if (groupConfig?.enabled === false) {
|
|
787
|
+
logVerbose(`Blocked line group ${groupId ?? roomId ?? "unknown"} (group disabled)`);
|
|
788
|
+
return denied;
|
|
789
|
+
}
|
|
790
|
+
if (typeof groupAllowOverride !== "undefined") {
|
|
791
|
+
if (!senderId) {
|
|
792
|
+
logVerbose("Blocked line group message (group allowFrom override, no sender ID)");
|
|
793
|
+
return denied;
|
|
794
|
+
}
|
|
795
|
+
if (!isSenderAllowed({
|
|
796
|
+
allow: effectiveGroupAllow,
|
|
797
|
+
senderId
|
|
798
|
+
})) {
|
|
799
|
+
logVerbose(`Blocked line group sender ${senderId} (group allowFrom override)`);
|
|
800
|
+
return denied;
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
const senderGroupAccess = evaluateMatchedGroupAccessForPolicy({
|
|
804
|
+
groupPolicy,
|
|
805
|
+
requireMatchInput: true,
|
|
806
|
+
hasMatchInput: Boolean(senderId),
|
|
807
|
+
allowlistConfigured: effectiveGroupAllow.entries.length > 0,
|
|
808
|
+
allowlistMatched: Boolean(senderId) && isSenderAllowed({
|
|
809
|
+
allow: effectiveGroupAllow,
|
|
810
|
+
senderId
|
|
811
|
+
})
|
|
812
|
+
});
|
|
813
|
+
if (!senderGroupAccess.allowed && senderGroupAccess.reason === "disabled") {
|
|
814
|
+
logVerbose("Blocked line group message (groupPolicy: disabled)");
|
|
815
|
+
return denied;
|
|
816
|
+
}
|
|
817
|
+
if (!senderGroupAccess.allowed && senderGroupAccess.reason === "missing_match_input") {
|
|
818
|
+
logVerbose("Blocked line group message (no sender ID, groupPolicy: allowlist)");
|
|
819
|
+
return denied;
|
|
820
|
+
}
|
|
821
|
+
if (!senderGroupAccess.allowed && senderGroupAccess.reason === "empty_allowlist") {
|
|
822
|
+
logVerbose("Blocked line group message (groupPolicy: allowlist, no groupAllowFrom)");
|
|
823
|
+
return denied;
|
|
824
|
+
}
|
|
825
|
+
if (!senderGroupAccess.allowed && senderGroupAccess.reason === "not_allowlisted") {
|
|
826
|
+
logVerbose(`Blocked line group message from ${senderId} (groupPolicy: allowlist)`);
|
|
827
|
+
return denied;
|
|
828
|
+
}
|
|
829
|
+
return {
|
|
830
|
+
allowed: true,
|
|
831
|
+
commandAuthorized: resolveLineCommandAuthorized({
|
|
832
|
+
cfg,
|
|
833
|
+
event,
|
|
834
|
+
senderId,
|
|
835
|
+
allow: effectiveGroupAllow
|
|
836
|
+
})
|
|
837
|
+
};
|
|
838
|
+
}
|
|
839
|
+
if (dmPolicy === "disabled") {
|
|
840
|
+
logVerbose("Blocked line sender (dmPolicy: disabled)");
|
|
841
|
+
return denied;
|
|
842
|
+
}
|
|
843
|
+
if (!(dmPolicy === "open" || isSenderAllowed({
|
|
844
|
+
allow: effectiveDmAllow,
|
|
845
|
+
senderId
|
|
846
|
+
}))) {
|
|
847
|
+
if (dmPolicy === "pairing") {
|
|
848
|
+
if (!senderId) {
|
|
849
|
+
logVerbose("Blocked line sender (dmPolicy: pairing, no sender ID)");
|
|
850
|
+
return denied;
|
|
851
|
+
}
|
|
852
|
+
await sendLinePairingReply({
|
|
853
|
+
senderId,
|
|
854
|
+
replyToken: "replyToken" in event ? event.replyToken : void 0,
|
|
855
|
+
context
|
|
856
|
+
});
|
|
857
|
+
} else logVerbose(`Blocked line sender ${senderId || "unknown"} (dmPolicy: ${dmPolicy})`);
|
|
858
|
+
return denied;
|
|
859
|
+
}
|
|
860
|
+
return {
|
|
861
|
+
allowed: true,
|
|
862
|
+
commandAuthorized: resolveLineCommandAuthorized({
|
|
863
|
+
cfg,
|
|
864
|
+
event,
|
|
865
|
+
senderId,
|
|
866
|
+
allow: effectiveDmAllow
|
|
867
|
+
})
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
/** Extract the mentionees array from a LINE text message (SDK types omit it).
|
|
871
|
+
* LINE webhook payloads include `mention.mentionees` on text messages with
|
|
872
|
+
* `isSelf: true` for the bot and `type: "all"` for @All mentions.
|
|
873
|
+
* The `@line/bot-sdk` types don't expose these fields, so we use a type assertion.
|
|
874
|
+
*/
|
|
875
|
+
function getLineMentionees(message) {
|
|
876
|
+
if (message.type !== "text") return [];
|
|
877
|
+
const mentionees = message.mention?.mentionees;
|
|
878
|
+
return Array.isArray(mentionees) ? mentionees : [];
|
|
879
|
+
}
|
|
880
|
+
function isLineBotMentioned(message) {
|
|
881
|
+
return getLineMentionees(message).some((m) => m.isSelf === true || m.type === "all");
|
|
882
|
+
}
|
|
883
|
+
/** True when *any* @mention exists (bot or other users). */
|
|
884
|
+
function hasAnyLineMention(message) {
|
|
885
|
+
return getLineMentionees(message).length > 0;
|
|
886
|
+
}
|
|
887
|
+
function resolveEventRawText(event) {
|
|
888
|
+
if (event.type === "message") {
|
|
889
|
+
const msg = event.message;
|
|
890
|
+
if (msg.type === "text") return msg.text;
|
|
891
|
+
return "";
|
|
892
|
+
}
|
|
893
|
+
if (event.type === "postback") return event.postback?.data?.trim() ?? "";
|
|
894
|
+
return "";
|
|
895
|
+
}
|
|
896
|
+
function resolveLineCommandAuthorized(params) {
|
|
897
|
+
const senderAllowedForCommands = isSenderAllowed({
|
|
898
|
+
allow: params.allow,
|
|
899
|
+
senderId: params.senderId
|
|
900
|
+
});
|
|
901
|
+
const useAccessGroups = params.cfg.commands?.useAccessGroups !== false;
|
|
902
|
+
const rawText = resolveEventRawText(params.event);
|
|
903
|
+
return resolveControlCommandGate({
|
|
904
|
+
useAccessGroups,
|
|
905
|
+
authorizers: [{
|
|
906
|
+
configured: params.allow.hasEntries,
|
|
907
|
+
allowed: senderAllowedForCommands
|
|
908
|
+
}],
|
|
909
|
+
allowTextCommands: true,
|
|
910
|
+
hasControlCommand: hasControlCommand(rawText, params.cfg)
|
|
911
|
+
}).commandAuthorized;
|
|
912
|
+
}
|
|
913
|
+
async function handleMessageEvent(event, context) {
|
|
914
|
+
const { cfg, account, runtime, mediaMaxBytes, processMessage } = context;
|
|
915
|
+
const message = event.message;
|
|
916
|
+
const decision = await shouldProcessLineEvent(event, context);
|
|
917
|
+
if (!decision.allowed) return;
|
|
918
|
+
const { isGroup, groupId, roomId } = getLineSourceInfo(event.source);
|
|
919
|
+
if (isGroup) {
|
|
920
|
+
const requireMention = resolveLineGroupConfig({
|
|
921
|
+
config: account.config,
|
|
922
|
+
groupId,
|
|
923
|
+
roomId
|
|
924
|
+
})?.requireMention !== false;
|
|
925
|
+
const rawText = message.type === "text" ? message.text : "";
|
|
926
|
+
const peerId = groupId ?? roomId ?? event.source.userId ?? "unknown";
|
|
927
|
+
const { agentId } = resolveAgentRoute({
|
|
928
|
+
cfg,
|
|
929
|
+
channel: "line",
|
|
930
|
+
accountId: account.accountId,
|
|
931
|
+
peer: {
|
|
932
|
+
kind: "group",
|
|
933
|
+
id: peerId
|
|
934
|
+
}
|
|
935
|
+
});
|
|
936
|
+
const mentionRegexes = buildMentionRegexes(cfg, agentId);
|
|
937
|
+
const wasMentionedByNative = isLineBotMentioned(message);
|
|
938
|
+
const wasMentionedByPattern = message.type === "text" ? matchesMentionPatterns(rawText, mentionRegexes) : false;
|
|
939
|
+
const wasMentioned = wasMentionedByNative || wasMentionedByPattern;
|
|
940
|
+
if (resolveMentionGatingWithBypass({
|
|
941
|
+
isGroup: true,
|
|
942
|
+
requireMention,
|
|
943
|
+
canDetectMention: message.type === "text",
|
|
944
|
+
wasMentioned,
|
|
945
|
+
hasAnyMention: hasAnyLineMention(message),
|
|
946
|
+
allowTextCommands: true,
|
|
947
|
+
hasControlCommand: hasControlCommand(rawText, cfg),
|
|
948
|
+
commandAuthorized: decision.commandAuthorized
|
|
949
|
+
}).shouldSkip) {
|
|
950
|
+
logVerbose(`line: skipping group message (requireMention, not mentioned)`);
|
|
951
|
+
const historyKey = groupId ?? roomId;
|
|
952
|
+
const senderId = event.source.type === "group" || event.source.type === "room" ? event.source.userId ?? "unknown" : "unknown";
|
|
953
|
+
if (historyKey && context.groupHistories) recordPendingHistoryEntryIfEnabled({
|
|
954
|
+
historyMap: context.groupHistories,
|
|
955
|
+
historyKey,
|
|
956
|
+
limit: context.historyLimit ?? 50,
|
|
957
|
+
entry: {
|
|
958
|
+
sender: `user:${senderId}`,
|
|
959
|
+
body: rawText || `<${message.type}>`,
|
|
960
|
+
timestamp: event.timestamp
|
|
961
|
+
}
|
|
962
|
+
});
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
const allMedia = [];
|
|
967
|
+
if (isDownloadableLineMessageType(message.type)) try {
|
|
968
|
+
const media = await downloadLineMedia(message.id, account.channelAccessToken, mediaMaxBytes);
|
|
969
|
+
allMedia.push({
|
|
970
|
+
path: media.path,
|
|
971
|
+
contentType: media.contentType
|
|
972
|
+
});
|
|
973
|
+
} catch (err) {
|
|
974
|
+
const errMsg = String(err);
|
|
975
|
+
if (errMsg.includes("exceeds") && errMsg.includes("limit")) logVerbose(`line: media exceeds size limit for message ${message.id}`);
|
|
976
|
+
else runtime.error?.(danger(`line: failed to download media: ${errMsg}`));
|
|
977
|
+
}
|
|
978
|
+
const messageContext = await buildLineMessageContext({
|
|
979
|
+
event,
|
|
980
|
+
allMedia,
|
|
981
|
+
cfg,
|
|
982
|
+
account,
|
|
983
|
+
commandAuthorized: decision.commandAuthorized,
|
|
984
|
+
groupHistories: context.groupHistories,
|
|
985
|
+
historyLimit: context.historyLimit ?? 50
|
|
986
|
+
});
|
|
987
|
+
if (!messageContext) {
|
|
988
|
+
logVerbose("line: skipping empty message");
|
|
989
|
+
return;
|
|
990
|
+
}
|
|
991
|
+
await processMessage(messageContext);
|
|
992
|
+
if (isGroup && context.groupHistories) {
|
|
993
|
+
const historyKey = groupId ?? roomId;
|
|
994
|
+
if (historyKey && context.groupHistories.has(historyKey)) clearHistoryEntriesIfEnabled({
|
|
995
|
+
historyMap: context.groupHistories,
|
|
996
|
+
historyKey,
|
|
997
|
+
limit: context.historyLimit ?? 50
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
async function handleFollowEvent(event, _context) {
|
|
1002
|
+
logVerbose(`line: user ${(event.source.type === "user" ? event.source.userId : void 0) ?? "unknown"} followed`);
|
|
1003
|
+
}
|
|
1004
|
+
async function handleUnfollowEvent(event, _context) {
|
|
1005
|
+
logVerbose(`line: user ${(event.source.type === "user" ? event.source.userId : void 0) ?? "unknown"} unfollowed`);
|
|
1006
|
+
}
|
|
1007
|
+
async function handleJoinEvent(event, _context) {
|
|
1008
|
+
const groupId = event.source.type === "group" ? event.source.groupId : void 0;
|
|
1009
|
+
const roomId = event.source.type === "room" ? event.source.roomId : void 0;
|
|
1010
|
+
logVerbose(`line: bot joined ${groupId ? `group ${groupId}` : `room ${roomId}`}`);
|
|
1011
|
+
}
|
|
1012
|
+
async function handleLeaveEvent(event, _context) {
|
|
1013
|
+
const groupId = event.source.type === "group" ? event.source.groupId : void 0;
|
|
1014
|
+
const roomId = event.source.type === "room" ? event.source.roomId : void 0;
|
|
1015
|
+
logVerbose(`line: bot left ${groupId ? `group ${groupId}` : `room ${roomId}`}`);
|
|
1016
|
+
}
|
|
1017
|
+
async function handlePostbackEvent(event, context) {
|
|
1018
|
+
const data = event.postback.data;
|
|
1019
|
+
logVerbose(`line: received postback: ${data}`);
|
|
1020
|
+
const decision = await shouldProcessLineEvent(event, context);
|
|
1021
|
+
if (!decision.allowed) return;
|
|
1022
|
+
const postbackContext = await buildLinePostbackContext({
|
|
1023
|
+
event,
|
|
1024
|
+
cfg: context.cfg,
|
|
1025
|
+
account: context.account,
|
|
1026
|
+
commandAuthorized: decision.commandAuthorized
|
|
1027
|
+
});
|
|
1028
|
+
if (!postbackContext) return;
|
|
1029
|
+
await context.processMessage(postbackContext);
|
|
1030
|
+
}
|
|
1031
|
+
async function handleLineWebhookEvents(events, context) {
|
|
1032
|
+
let firstError;
|
|
1033
|
+
for (const event of events) {
|
|
1034
|
+
const replayCandidate = getLineReplayCandidate(event, context);
|
|
1035
|
+
const replaySkip = replayCandidate ? shouldSkipLineReplayEvent(replayCandidate) : null;
|
|
1036
|
+
if (replaySkip?.skip) {
|
|
1037
|
+
if (replaySkip.inFlightResult) try {
|
|
1038
|
+
await replaySkip.inFlightResult;
|
|
1039
|
+
} catch (err) {
|
|
1040
|
+
context.runtime.error?.(danger(`line: replayed in-flight event failed: ${String(err)}`));
|
|
1041
|
+
firstError ??= err;
|
|
1042
|
+
}
|
|
1043
|
+
continue;
|
|
1044
|
+
}
|
|
1045
|
+
const inFlightReservation = replayCandidate ? markLineReplayEventInFlight(replayCandidate) : null;
|
|
1046
|
+
try {
|
|
1047
|
+
switch (event.type) {
|
|
1048
|
+
case "message":
|
|
1049
|
+
await handleMessageEvent(event, context);
|
|
1050
|
+
break;
|
|
1051
|
+
case "follow":
|
|
1052
|
+
await handleFollowEvent(event, context);
|
|
1053
|
+
break;
|
|
1054
|
+
case "unfollow":
|
|
1055
|
+
await handleUnfollowEvent(event, context);
|
|
1056
|
+
break;
|
|
1057
|
+
case "join":
|
|
1058
|
+
await handleJoinEvent(event, context);
|
|
1059
|
+
break;
|
|
1060
|
+
case "leave":
|
|
1061
|
+
await handleLeaveEvent(event, context);
|
|
1062
|
+
break;
|
|
1063
|
+
case "postback":
|
|
1064
|
+
await handlePostbackEvent(event, context);
|
|
1065
|
+
break;
|
|
1066
|
+
default: logVerbose(`line: unhandled event type: ${event.type}`);
|
|
1067
|
+
}
|
|
1068
|
+
if (replayCandidate) {
|
|
1069
|
+
rememberLineReplayEvent(replayCandidate);
|
|
1070
|
+
inFlightReservation?.resolve();
|
|
1071
|
+
clearLineReplayEventInFlight(replayCandidate);
|
|
1072
|
+
}
|
|
1073
|
+
} catch (err) {
|
|
1074
|
+
if (replayCandidate) {
|
|
1075
|
+
inFlightReservation?.reject(err);
|
|
1076
|
+
clearLineReplayEventInFlight(replayCandidate);
|
|
1077
|
+
}
|
|
1078
|
+
context.runtime.error?.(danger(`line: event handler failed: ${String(err)}`));
|
|
1079
|
+
firstError ??= err;
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
if (firstError) throw firstError;
|
|
1083
|
+
}
|
|
1084
|
+
//#endregion
|
|
1085
|
+
//#region src/line/signature.ts
|
|
1086
|
+
function validateLineSignature(body, signature, channelSecret) {
|
|
1087
|
+
const hash = crypto.createHmac("SHA256", channelSecret).update(body).digest("base64");
|
|
1088
|
+
const hashBuffer = Buffer.from(hash);
|
|
1089
|
+
const signatureBuffer = Buffer.from(signature);
|
|
1090
|
+
if (hashBuffer.length !== signatureBuffer.length) return false;
|
|
1091
|
+
return crypto.timingSafeEqual(hashBuffer, signatureBuffer);
|
|
1092
|
+
}
|
|
1093
|
+
//#endregion
|
|
1094
|
+
//#region src/line/webhook-utils.ts
|
|
1095
|
+
function parseLineWebhookBody(rawBody) {
|
|
1096
|
+
try {
|
|
1097
|
+
return JSON.parse(rawBody);
|
|
1098
|
+
} catch {
|
|
1099
|
+
return null;
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
//#endregion
|
|
1103
|
+
//#region src/line/bot.ts
|
|
1104
|
+
function createLineBot(opts) {
|
|
1105
|
+
const runtime = opts.runtime ?? createNonExitingRuntime();
|
|
1106
|
+
const cfg = opts.config ?? loadConfig();
|
|
1107
|
+
const account = resolveLineAccount({
|
|
1108
|
+
cfg,
|
|
1109
|
+
accountId: opts.accountId
|
|
1110
|
+
});
|
|
1111
|
+
const mediaMaxBytes = (opts.mediaMaxMb ?? account.config.mediaMaxMb ?? 10) * 1024 * 1024;
|
|
1112
|
+
const processMessage = opts.onMessage ?? (async () => {
|
|
1113
|
+
logVerbose("line: no message handler configured");
|
|
1114
|
+
});
|
|
1115
|
+
const replayCache = createLineWebhookReplayCache();
|
|
1116
|
+
const groupHistories = /* @__PURE__ */ new Map();
|
|
1117
|
+
const handleWebhook = async (body) => {
|
|
1118
|
+
if (!body.events || body.events.length === 0) return;
|
|
1119
|
+
await handleLineWebhookEvents(body.events, {
|
|
1120
|
+
cfg,
|
|
1121
|
+
account,
|
|
1122
|
+
runtime,
|
|
1123
|
+
mediaMaxBytes,
|
|
1124
|
+
processMessage,
|
|
1125
|
+
replayCache,
|
|
1126
|
+
groupHistories,
|
|
1127
|
+
historyLimit: cfg.messages?.groupChat?.historyLimit ?? 50
|
|
1128
|
+
});
|
|
1129
|
+
};
|
|
1130
|
+
return {
|
|
1131
|
+
handleWebhook,
|
|
1132
|
+
account
|
|
1133
|
+
};
|
|
1134
|
+
}
|
|
1135
|
+
//#endregion
|
|
1136
|
+
//#region src/line/reply-chunks.ts
|
|
1137
|
+
async function sendLineReplyChunks(params) {
|
|
1138
|
+
const hasQuickReplies = Boolean(params.quickReplies?.length);
|
|
1139
|
+
let replyTokenUsed = Boolean(params.replyTokenUsed);
|
|
1140
|
+
if (params.chunks.length === 0) return { replyTokenUsed };
|
|
1141
|
+
if (params.replyToken && !replyTokenUsed) try {
|
|
1142
|
+
const replyBatch = params.chunks.slice(0, 5);
|
|
1143
|
+
const remaining = params.chunks.slice(replyBatch.length);
|
|
1144
|
+
const replyMessages = replyBatch.map((chunk) => ({
|
|
1145
|
+
type: "text",
|
|
1146
|
+
text: chunk
|
|
1147
|
+
}));
|
|
1148
|
+
if (hasQuickReplies && remaining.length === 0 && replyMessages.length > 0) {
|
|
1149
|
+
const lastIndex = replyMessages.length - 1;
|
|
1150
|
+
replyMessages[lastIndex] = params.createTextMessageWithQuickReplies(replyBatch[lastIndex], params.quickReplies);
|
|
1151
|
+
}
|
|
1152
|
+
await params.replyMessageLine(params.replyToken, replyMessages, { accountId: params.accountId });
|
|
1153
|
+
replyTokenUsed = true;
|
|
1154
|
+
for (let i = 0; i < remaining.length; i += 1) if (i === remaining.length - 1 && hasQuickReplies) await params.pushTextMessageWithQuickReplies(params.to, remaining[i], params.quickReplies, { accountId: params.accountId });
|
|
1155
|
+
else await params.pushMessageLine(params.to, remaining[i], { accountId: params.accountId });
|
|
1156
|
+
return { replyTokenUsed };
|
|
1157
|
+
} catch (err) {
|
|
1158
|
+
params.onReplyError?.(err);
|
|
1159
|
+
replyTokenUsed = true;
|
|
1160
|
+
}
|
|
1161
|
+
for (let i = 0; i < params.chunks.length; i += 1) if (i === params.chunks.length - 1 && hasQuickReplies) await params.pushTextMessageWithQuickReplies(params.to, params.chunks[i], params.quickReplies, { accountId: params.accountId });
|
|
1162
|
+
else await params.pushMessageLine(params.to, params.chunks[i], { accountId: params.accountId });
|
|
1163
|
+
return { replyTokenUsed };
|
|
1164
|
+
}
|
|
1165
|
+
//#endregion
|
|
1166
|
+
//#region src/line/webhook-node.ts
|
|
1167
|
+
const LINE_WEBHOOK_MAX_BODY_BYTES = 1024 * 1024;
|
|
1168
|
+
const LINE_WEBHOOK_PREAUTH_MAX_BODY_BYTES = 64 * 1024;
|
|
1169
|
+
const LINE_WEBHOOK_PREAUTH_BODY_TIMEOUT_MS = 5e3;
|
|
1170
|
+
async function readLineWebhookRequestBody(req, maxBytes = LINE_WEBHOOK_MAX_BODY_BYTES, timeoutMs = LINE_WEBHOOK_PREAUTH_BODY_TIMEOUT_MS) {
|
|
1171
|
+
return await readRequestBodyWithLimit(req, {
|
|
1172
|
+
maxBytes,
|
|
1173
|
+
timeoutMs
|
|
1174
|
+
});
|
|
1175
|
+
}
|
|
1176
|
+
function createLineNodeWebhookHandler(params) {
|
|
1177
|
+
const maxBodyBytes = params.maxBodyBytes ?? LINE_WEBHOOK_MAX_BODY_BYTES;
|
|
1178
|
+
const readBody = params.readBody ?? readLineWebhookRequestBody;
|
|
1179
|
+
return async (req, res) => {
|
|
1180
|
+
if (req.method === "GET" || req.method === "HEAD") {
|
|
1181
|
+
if (req.method === "HEAD") {
|
|
1182
|
+
res.statusCode = 204;
|
|
1183
|
+
res.end();
|
|
1184
|
+
return;
|
|
1185
|
+
}
|
|
1186
|
+
res.statusCode = 200;
|
|
1187
|
+
res.setHeader("Content-Type", "text/plain");
|
|
1188
|
+
res.end("OK");
|
|
1189
|
+
return;
|
|
1190
|
+
}
|
|
1191
|
+
if (req.method !== "POST") {
|
|
1192
|
+
res.statusCode = 405;
|
|
1193
|
+
res.setHeader("Allow", "GET, HEAD, POST");
|
|
1194
|
+
res.setHeader("Content-Type", "application/json");
|
|
1195
|
+
res.end(JSON.stringify({ error: "Method Not Allowed" }));
|
|
1196
|
+
return;
|
|
1197
|
+
}
|
|
1198
|
+
try {
|
|
1199
|
+
const signatureHeader = req.headers["x-line-signature"];
|
|
1200
|
+
const signature = typeof signatureHeader === "string" ? signatureHeader.trim() : Array.isArray(signatureHeader) ? (signatureHeader[0] ?? "").trim() : "";
|
|
1201
|
+
if (!signature) {
|
|
1202
|
+
logVerbose("line: webhook missing X-Line-Signature header");
|
|
1203
|
+
res.statusCode = 400;
|
|
1204
|
+
res.setHeader("Content-Type", "application/json");
|
|
1205
|
+
res.end(JSON.stringify({ error: "Missing X-Line-Signature header" }));
|
|
1206
|
+
return;
|
|
1207
|
+
}
|
|
1208
|
+
const rawBody = await readBody(req, Math.min(maxBodyBytes, LINE_WEBHOOK_PREAUTH_MAX_BODY_BYTES), LINE_WEBHOOK_PREAUTH_BODY_TIMEOUT_MS);
|
|
1209
|
+
if (!validateLineSignature(rawBody, signature, params.channelSecret)) {
|
|
1210
|
+
logVerbose("line: webhook signature validation failed");
|
|
1211
|
+
res.statusCode = 401;
|
|
1212
|
+
res.setHeader("Content-Type", "application/json");
|
|
1213
|
+
res.end(JSON.stringify({ error: "Invalid signature" }));
|
|
1214
|
+
return;
|
|
1215
|
+
}
|
|
1216
|
+
const body = parseLineWebhookBody(rawBody);
|
|
1217
|
+
if (!body) {
|
|
1218
|
+
res.statusCode = 400;
|
|
1219
|
+
res.setHeader("Content-Type", "application/json");
|
|
1220
|
+
res.end(JSON.stringify({ error: "Invalid webhook payload" }));
|
|
1221
|
+
return;
|
|
1222
|
+
}
|
|
1223
|
+
if (body.events && body.events.length > 0) {
|
|
1224
|
+
logVerbose(`line: received ${body.events.length} webhook events`);
|
|
1225
|
+
await params.bot.handleWebhook(body);
|
|
1226
|
+
}
|
|
1227
|
+
res.statusCode = 200;
|
|
1228
|
+
res.setHeader("Content-Type", "application/json");
|
|
1229
|
+
res.end(JSON.stringify({ status: "ok" }));
|
|
1230
|
+
} catch (err) {
|
|
1231
|
+
if (isRequestBodyLimitError(err, "PAYLOAD_TOO_LARGE")) {
|
|
1232
|
+
res.statusCode = 413;
|
|
1233
|
+
res.setHeader("Content-Type", "application/json");
|
|
1234
|
+
res.end(JSON.stringify({ error: "Payload too large" }));
|
|
1235
|
+
return;
|
|
1236
|
+
}
|
|
1237
|
+
if (isRequestBodyLimitError(err, "REQUEST_BODY_TIMEOUT")) {
|
|
1238
|
+
res.statusCode = 408;
|
|
1239
|
+
res.setHeader("Content-Type", "application/json");
|
|
1240
|
+
res.end(JSON.stringify({ error: requestBodyErrorToText("REQUEST_BODY_TIMEOUT") }));
|
|
1241
|
+
return;
|
|
1242
|
+
}
|
|
1243
|
+
params.runtime.error?.(danger(`line webhook error: ${String(err)}`));
|
|
1244
|
+
if (!res.headersSent) {
|
|
1245
|
+
res.statusCode = 500;
|
|
1246
|
+
res.setHeader("Content-Type", "application/json");
|
|
1247
|
+
res.end(JSON.stringify({ error: "Internal server error" }));
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
};
|
|
1251
|
+
}
|
|
1252
|
+
//#endregion
|
|
1253
|
+
//#region src/line/monitor.ts
|
|
1254
|
+
const runtimeState = /* @__PURE__ */ new Map();
|
|
1255
|
+
function recordChannelRuntimeState(params) {
|
|
1256
|
+
const key = `${params.channel}:${params.accountId}`;
|
|
1257
|
+
const existing = runtimeState.get(key) ?? {
|
|
1258
|
+
running: false,
|
|
1259
|
+
lastStartAt: null,
|
|
1260
|
+
lastStopAt: null,
|
|
1261
|
+
lastError: null
|
|
1262
|
+
};
|
|
1263
|
+
runtimeState.set(key, {
|
|
1264
|
+
...existing,
|
|
1265
|
+
...params.state
|
|
1266
|
+
});
|
|
1267
|
+
}
|
|
1268
|
+
function startLineLoadingKeepalive(params) {
|
|
1269
|
+
const intervalMs = params.intervalMs ?? 18e3;
|
|
1270
|
+
const loadingSeconds = params.loadingSeconds ?? 20;
|
|
1271
|
+
let stopped = false;
|
|
1272
|
+
const trigger = () => {
|
|
1273
|
+
if (stopped) return;
|
|
1274
|
+
showLoadingAnimation(params.userId, {
|
|
1275
|
+
accountId: params.accountId,
|
|
1276
|
+
loadingSeconds
|
|
1277
|
+
}).catch(() => {});
|
|
1278
|
+
};
|
|
1279
|
+
trigger();
|
|
1280
|
+
const timer = setInterval(trigger, intervalMs);
|
|
1281
|
+
return () => {
|
|
1282
|
+
if (stopped) return;
|
|
1283
|
+
stopped = true;
|
|
1284
|
+
clearInterval(timer);
|
|
1285
|
+
};
|
|
1286
|
+
}
|
|
1287
|
+
async function monitorLineProvider(opts) {
|
|
1288
|
+
const { channelAccessToken, channelSecret, accountId, config, runtime, abortSignal, webhookPath } = opts;
|
|
1289
|
+
const resolvedAccountId = accountId ?? "default";
|
|
1290
|
+
const token = channelAccessToken.trim();
|
|
1291
|
+
const secret = channelSecret.trim();
|
|
1292
|
+
if (!token) throw new Error("LINE webhook mode requires a non-empty channel access token.");
|
|
1293
|
+
if (!secret) throw new Error("LINE webhook mode requires a non-empty channel secret.");
|
|
1294
|
+
recordChannelRuntimeState({
|
|
1295
|
+
channel: "line",
|
|
1296
|
+
accountId: resolvedAccountId,
|
|
1297
|
+
state: {
|
|
1298
|
+
running: true,
|
|
1299
|
+
lastStartAt: Date.now()
|
|
1300
|
+
}
|
|
1301
|
+
});
|
|
1302
|
+
const bot = createLineBot({
|
|
1303
|
+
channelAccessToken: token,
|
|
1304
|
+
channelSecret: secret,
|
|
1305
|
+
accountId,
|
|
1306
|
+
runtime,
|
|
1307
|
+
config,
|
|
1308
|
+
onMessage: async (ctx) => {
|
|
1309
|
+
if (!ctx) return;
|
|
1310
|
+
const { ctxPayload, replyToken, route } = ctx;
|
|
1311
|
+
recordChannelRuntimeState({
|
|
1312
|
+
channel: "line",
|
|
1313
|
+
accountId: resolvedAccountId,
|
|
1314
|
+
state: { lastInboundAt: Date.now() }
|
|
1315
|
+
});
|
|
1316
|
+
const shouldShowLoading = Boolean(ctx.userId && !ctx.isGroup);
|
|
1317
|
+
const displayNamePromise = ctx.userId ? getUserDisplayName(ctx.userId, { accountId: ctx.accountId }) : Promise.resolve(ctxPayload.From);
|
|
1318
|
+
const stopLoading = shouldShowLoading ? startLineLoadingKeepalive({
|
|
1319
|
+
userId: ctx.userId,
|
|
1320
|
+
accountId: ctx.accountId
|
|
1321
|
+
}) : null;
|
|
1322
|
+
logVerbose(`line: received message from ${await displayNamePromise} (${ctxPayload.From})`);
|
|
1323
|
+
try {
|
|
1324
|
+
const textLimit = 5e3;
|
|
1325
|
+
let replyTokenUsed = false;
|
|
1326
|
+
const { onModelSelected, ...replyPipeline } = createChannelReplyPipeline({
|
|
1327
|
+
cfg: config,
|
|
1328
|
+
agentId: route.agentId,
|
|
1329
|
+
channel: "line",
|
|
1330
|
+
accountId: route.accountId
|
|
1331
|
+
});
|
|
1332
|
+
const { queuedFinal } = await dispatchReplyWithBufferedBlockDispatcher({
|
|
1333
|
+
ctx: ctxPayload,
|
|
1334
|
+
cfg: config,
|
|
1335
|
+
dispatcherOptions: {
|
|
1336
|
+
...replyPipeline,
|
|
1337
|
+
deliver: async (payload, _info) => {
|
|
1338
|
+
const lineData = payload.channelData?.line ?? {};
|
|
1339
|
+
if (ctx.userId && !ctx.isGroup) showLoadingAnimation(ctx.userId, { accountId: ctx.accountId }).catch(() => {});
|
|
1340
|
+
const { replyTokenUsed: nextReplyTokenUsed } = await deliverLineAutoReply({
|
|
1341
|
+
payload,
|
|
1342
|
+
lineData,
|
|
1343
|
+
to: ctxPayload.From,
|
|
1344
|
+
replyToken,
|
|
1345
|
+
replyTokenUsed,
|
|
1346
|
+
accountId: ctx.accountId,
|
|
1347
|
+
textLimit,
|
|
1348
|
+
deps: {
|
|
1349
|
+
buildTemplateMessageFromPayload,
|
|
1350
|
+
processLineMessage,
|
|
1351
|
+
chunkMarkdownText,
|
|
1352
|
+
sendLineReplyChunks,
|
|
1353
|
+
replyMessageLine,
|
|
1354
|
+
pushMessageLine,
|
|
1355
|
+
pushTextMessageWithQuickReplies,
|
|
1356
|
+
createQuickReplyItems,
|
|
1357
|
+
createTextMessageWithQuickReplies,
|
|
1358
|
+
pushMessagesLine,
|
|
1359
|
+
createFlexMessage,
|
|
1360
|
+
createImageMessage,
|
|
1361
|
+
createLocationMessage,
|
|
1362
|
+
onReplyError: (replyErr) => {
|
|
1363
|
+
logVerbose(`line: reply token failed, falling back to push: ${String(replyErr)}`);
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
});
|
|
1367
|
+
replyTokenUsed = nextReplyTokenUsed;
|
|
1368
|
+
recordChannelRuntimeState({
|
|
1369
|
+
channel: "line",
|
|
1370
|
+
accountId: resolvedAccountId,
|
|
1371
|
+
state: { lastOutboundAt: Date.now() }
|
|
1372
|
+
});
|
|
1373
|
+
},
|
|
1374
|
+
onError: (err, info) => {
|
|
1375
|
+
runtime.error?.(danger(`line ${info.kind} reply failed: ${String(err)}`));
|
|
1376
|
+
}
|
|
1377
|
+
},
|
|
1378
|
+
replyOptions: { onModelSelected }
|
|
1379
|
+
});
|
|
1380
|
+
if (!queuedFinal) logVerbose(`line: no response generated for message from ${ctxPayload.From}`);
|
|
1381
|
+
} catch (err) {
|
|
1382
|
+
runtime.error?.(danger(`line: auto-reply failed: ${String(err)}`));
|
|
1383
|
+
if (replyToken) try {
|
|
1384
|
+
await replyMessageLine(replyToken, [{
|
|
1385
|
+
type: "text",
|
|
1386
|
+
text: "Sorry, I encountered an error processing your message."
|
|
1387
|
+
}], { accountId: ctx.accountId });
|
|
1388
|
+
} catch (replyErr) {
|
|
1389
|
+
runtime.error?.(danger(`line: error reply failed: ${String(replyErr)}`));
|
|
1390
|
+
}
|
|
1391
|
+
} finally {
|
|
1392
|
+
stopLoading?.();
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
});
|
|
1396
|
+
const normalizedPath = normalizePluginHttpPath(webhookPath, "/line/webhook") ?? "/line/webhook";
|
|
1397
|
+
const unregisterHttp = registerPluginHttpRoute({
|
|
1398
|
+
path: normalizedPath,
|
|
1399
|
+
auth: "plugin",
|
|
1400
|
+
replaceExisting: true,
|
|
1401
|
+
pluginId: "line",
|
|
1402
|
+
accountId: resolvedAccountId,
|
|
1403
|
+
log: (msg) => logVerbose(msg),
|
|
1404
|
+
handler: createLineNodeWebhookHandler({
|
|
1405
|
+
channelSecret: secret,
|
|
1406
|
+
bot,
|
|
1407
|
+
runtime
|
|
1408
|
+
})
|
|
1409
|
+
});
|
|
1410
|
+
logVerbose(`line: registered webhook handler at ${normalizedPath}`);
|
|
1411
|
+
let stopped = false;
|
|
1412
|
+
const stopHandler = () => {
|
|
1413
|
+
if (stopped) return;
|
|
1414
|
+
stopped = true;
|
|
1415
|
+
logVerbose(`line: stopping provider for account ${resolvedAccountId}`);
|
|
1416
|
+
unregisterHttp();
|
|
1417
|
+
recordChannelRuntimeState({
|
|
1418
|
+
channel: "line",
|
|
1419
|
+
accountId: resolvedAccountId,
|
|
1420
|
+
state: {
|
|
1421
|
+
running: false,
|
|
1422
|
+
lastStopAt: Date.now()
|
|
1423
|
+
}
|
|
1424
|
+
});
|
|
1425
|
+
};
|
|
1426
|
+
if (abortSignal?.aborted) stopHandler();
|
|
1427
|
+
else if (abortSignal) {
|
|
1428
|
+
abortSignal.addEventListener("abort", stopHandler, { once: true });
|
|
1429
|
+
await waitForAbortSignal(abortSignal);
|
|
1430
|
+
}
|
|
1431
|
+
return {
|
|
1432
|
+
account: bot.account,
|
|
1433
|
+
handleWebhook: bot.handleWebhook,
|
|
1434
|
+
stop: () => {
|
|
1435
|
+
stopHandler();
|
|
1436
|
+
abortSignal?.removeEventListener("abort", stopHandler);
|
|
1437
|
+
}
|
|
1438
|
+
};
|
|
1439
|
+
}
|
|
1440
|
+
//#endregion
|
|
1441
|
+
//#region src/line/probe.ts
|
|
1442
|
+
async function probeLineBot(channelAccessToken, timeoutMs = 5e3) {
|
|
1443
|
+
if (!channelAccessToken?.trim()) return {
|
|
1444
|
+
ok: false,
|
|
1445
|
+
error: "Channel access token not configured"
|
|
1446
|
+
};
|
|
1447
|
+
const client = new messagingApi.MessagingApiClient({ channelAccessToken: channelAccessToken.trim() });
|
|
1448
|
+
try {
|
|
1449
|
+
const profile = await withTimeout(client.getBotInfo(), timeoutMs);
|
|
1450
|
+
return {
|
|
1451
|
+
ok: true,
|
|
1452
|
+
bot: {
|
|
1453
|
+
displayName: profile.displayName,
|
|
1454
|
+
userId: profile.userId,
|
|
1455
|
+
basicId: profile.basicId,
|
|
1456
|
+
pictureUrl: profile.pictureUrl
|
|
1457
|
+
}
|
|
1458
|
+
};
|
|
1459
|
+
} catch (err) {
|
|
1460
|
+
return {
|
|
1461
|
+
ok: false,
|
|
1462
|
+
error: err instanceof Error ? err.message : String(err)
|
|
1463
|
+
};
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
//#endregion
|
|
1467
|
+
//#region src/plugins/runtime/runtime-discord-typing.ts
|
|
1468
|
+
const DEFAULT_DISCORD_TYPING_INTERVAL_MS = 8e3;
|
|
1469
|
+
async function createDiscordTypingLease(params) {
|
|
1470
|
+
const intervalMs = typeof params.intervalMs === "number" && Number.isFinite(params.intervalMs) ? Math.max(1e3, Math.floor(params.intervalMs)) : DEFAULT_DISCORD_TYPING_INTERVAL_MS;
|
|
1471
|
+
let stopped = false;
|
|
1472
|
+
let timer = null;
|
|
1473
|
+
const pulse = async () => {
|
|
1474
|
+
if (stopped) return;
|
|
1475
|
+
await params.pulse({
|
|
1476
|
+
channelId: params.channelId,
|
|
1477
|
+
accountId: params.accountId,
|
|
1478
|
+
cfg: params.cfg
|
|
1479
|
+
});
|
|
1480
|
+
};
|
|
1481
|
+
await pulse();
|
|
1482
|
+
timer = setInterval(() => {
|
|
1483
|
+
pulse().catch((err) => {
|
|
1484
|
+
logWarn(`plugins: discord typing pulse failed: ${String(err)}`);
|
|
1485
|
+
});
|
|
1486
|
+
}, intervalMs);
|
|
1487
|
+
timer.unref?.();
|
|
1488
|
+
return {
|
|
1489
|
+
refresh: async () => {
|
|
1490
|
+
await pulse();
|
|
1491
|
+
},
|
|
1492
|
+
stop: () => {
|
|
1493
|
+
stopped = true;
|
|
1494
|
+
if (timer) {
|
|
1495
|
+
clearInterval(timer);
|
|
1496
|
+
timer = null;
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
};
|
|
1500
|
+
}
|
|
1501
|
+
//#endregion
|
|
1502
|
+
//#region src/plugins/runtime/runtime-discord.ts
|
|
1503
|
+
const bindDiscordRuntimeMethod = createLazyRuntimeMethodBinder(createLazyRuntimeSurface(() => import("./runtime-discord-ops.runtime-Bg5h5v9-.js"), ({ runtimeDiscordOps }) => runtimeDiscordOps));
|
|
1504
|
+
const auditChannelPermissionsLazy = bindDiscordRuntimeMethod((runtimeDiscordOps) => runtimeDiscordOps.auditChannelPermissions);
|
|
1505
|
+
const listDirectoryGroupsLiveLazy$1 = bindDiscordRuntimeMethod((runtimeDiscordOps) => runtimeDiscordOps.listDirectoryGroupsLive);
|
|
1506
|
+
const listDirectoryPeersLiveLazy$1 = bindDiscordRuntimeMethod((runtimeDiscordOps) => runtimeDiscordOps.listDirectoryPeersLive);
|
|
1507
|
+
const probeDiscordLazy = bindDiscordRuntimeMethod((runtimeDiscordOps) => runtimeDiscordOps.probeDiscord);
|
|
1508
|
+
const resolveChannelAllowlistLazy$1 = bindDiscordRuntimeMethod((runtimeDiscordOps) => runtimeDiscordOps.resolveChannelAllowlist);
|
|
1509
|
+
const resolveUserAllowlistLazy$1 = bindDiscordRuntimeMethod((runtimeDiscordOps) => runtimeDiscordOps.resolveUserAllowlist);
|
|
1510
|
+
const sendComponentMessageLazy = bindDiscordRuntimeMethod((runtimeDiscordOps) => runtimeDiscordOps.sendComponentMessage);
|
|
1511
|
+
const sendMessageDiscordLazy = bindDiscordRuntimeMethod((runtimeDiscordOps) => runtimeDiscordOps.sendMessageDiscord);
|
|
1512
|
+
const sendPollDiscordLazy = bindDiscordRuntimeMethod((runtimeDiscordOps) => runtimeDiscordOps.sendPollDiscord);
|
|
1513
|
+
const monitorDiscordProviderLazy = bindDiscordRuntimeMethod((runtimeDiscordOps) => runtimeDiscordOps.monitorDiscordProvider);
|
|
1514
|
+
const sendTypingDiscordLazy = bindDiscordRuntimeMethod((runtimeDiscordOps) => runtimeDiscordOps.typing.pulse);
|
|
1515
|
+
const editMessageDiscordLazy = bindDiscordRuntimeMethod((runtimeDiscordOps) => runtimeDiscordOps.conversationActions.editMessage);
|
|
1516
|
+
const deleteMessageDiscordLazy = bindDiscordRuntimeMethod((runtimeDiscordOps) => runtimeDiscordOps.conversationActions.deleteMessage);
|
|
1517
|
+
const pinMessageDiscordLazy = bindDiscordRuntimeMethod((runtimeDiscordOps) => runtimeDiscordOps.conversationActions.pinMessage);
|
|
1518
|
+
const unpinMessageDiscordLazy = bindDiscordRuntimeMethod((runtimeDiscordOps) => runtimeDiscordOps.conversationActions.unpinMessage);
|
|
1519
|
+
const createThreadDiscordLazy = bindDiscordRuntimeMethod((runtimeDiscordOps) => runtimeDiscordOps.conversationActions.createThread);
|
|
1520
|
+
const editChannelDiscordLazy = bindDiscordRuntimeMethod((runtimeDiscordOps) => runtimeDiscordOps.conversationActions.editChannel);
|
|
1521
|
+
function createRuntimeDiscord() {
|
|
1522
|
+
return {
|
|
1523
|
+
messageActions: discordMessageActions,
|
|
1524
|
+
auditChannelPermissions: auditChannelPermissionsLazy,
|
|
1525
|
+
listDirectoryGroupsLive: listDirectoryGroupsLiveLazy$1,
|
|
1526
|
+
listDirectoryPeersLive: listDirectoryPeersLiveLazy$1,
|
|
1527
|
+
probeDiscord: probeDiscordLazy,
|
|
1528
|
+
resolveChannelAllowlist: resolveChannelAllowlistLazy$1,
|
|
1529
|
+
resolveUserAllowlist: resolveUserAllowlistLazy$1,
|
|
1530
|
+
sendComponentMessage: sendComponentMessageLazy,
|
|
1531
|
+
sendMessageDiscord: sendMessageDiscordLazy,
|
|
1532
|
+
sendPollDiscord: sendPollDiscordLazy,
|
|
1533
|
+
monitorDiscordProvider: monitorDiscordProviderLazy,
|
|
1534
|
+
threadBindings: {
|
|
1535
|
+
getManager: getThreadBindingManager,
|
|
1536
|
+
resolveIdleTimeoutMs: resolveThreadBindingIdleTimeoutMs,
|
|
1537
|
+
resolveInactivityExpiresAt: resolveThreadBindingInactivityExpiresAt,
|
|
1538
|
+
resolveMaxAgeMs: resolveThreadBindingMaxAgeMs,
|
|
1539
|
+
resolveMaxAgeExpiresAt: resolveThreadBindingMaxAgeExpiresAt,
|
|
1540
|
+
setIdleTimeoutBySessionKey: setThreadBindingIdleTimeoutBySessionKey,
|
|
1541
|
+
setMaxAgeBySessionKey: setThreadBindingMaxAgeBySessionKey,
|
|
1542
|
+
unbindBySessionKey: unbindThreadBindingsBySessionKey
|
|
1543
|
+
},
|
|
1544
|
+
typing: {
|
|
1545
|
+
pulse: sendTypingDiscordLazy,
|
|
1546
|
+
start: async ({ channelId, accountId, cfg, intervalMs }) => await createDiscordTypingLease({
|
|
1547
|
+
channelId,
|
|
1548
|
+
accountId,
|
|
1549
|
+
cfg,
|
|
1550
|
+
intervalMs,
|
|
1551
|
+
pulse: async ({ channelId, accountId, cfg }) => void await sendTypingDiscordLazy(channelId, {
|
|
1552
|
+
accountId,
|
|
1553
|
+
cfg
|
|
1554
|
+
})
|
|
1555
|
+
})
|
|
1556
|
+
},
|
|
1557
|
+
conversationActions: {
|
|
1558
|
+
editMessage: editMessageDiscordLazy,
|
|
1559
|
+
deleteMessage: deleteMessageDiscordLazy,
|
|
1560
|
+
pinMessage: pinMessageDiscordLazy,
|
|
1561
|
+
unpinMessage: unpinMessageDiscordLazy,
|
|
1562
|
+
createThread: createThreadDiscordLazy,
|
|
1563
|
+
editChannel: editChannelDiscordLazy
|
|
1564
|
+
}
|
|
1565
|
+
};
|
|
1566
|
+
}
|
|
1567
|
+
//#endregion
|
|
1568
|
+
//#region src/plugins/runtime/runtime-imessage.ts
|
|
1569
|
+
function createRuntimeIMessage() {
|
|
1570
|
+
return {
|
|
1571
|
+
monitorIMessageProvider,
|
|
1572
|
+
probeIMessage,
|
|
1573
|
+
sendMessageIMessage
|
|
1574
|
+
};
|
|
1575
|
+
}
|
|
1576
|
+
//#endregion
|
|
1577
|
+
//#region src/plugins/runtime/runtime-matrix-boundary.ts
|
|
1578
|
+
const MATRIX_PLUGIN_ID = "matrix";
|
|
1579
|
+
let cachedModulePath = null;
|
|
1580
|
+
let cachedModule = null;
|
|
1581
|
+
const jitiLoaders = /* @__PURE__ */ new Map();
|
|
1582
|
+
function readConfigSafely() {
|
|
1583
|
+
try {
|
|
1584
|
+
return loadConfig();
|
|
1585
|
+
} catch {
|
|
1586
|
+
return {};
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
function resolveMatrixPluginRecord() {
|
|
1590
|
+
const record = loadPluginManifestRegistry({
|
|
1591
|
+
config: readConfigSafely(),
|
|
1592
|
+
cache: true
|
|
1593
|
+
}).plugins.find((plugin) => plugin.id === MATRIX_PLUGIN_ID);
|
|
1594
|
+
if (!record?.source) return null;
|
|
1595
|
+
return {
|
|
1596
|
+
rootDir: record.rootDir,
|
|
1597
|
+
source: record.source
|
|
1598
|
+
};
|
|
1599
|
+
}
|
|
1600
|
+
function resolveMatrixRuntimeModulePath(record) {
|
|
1601
|
+
const candidates = [
|
|
1602
|
+
path.join(path.dirname(record.source), "runtime-api.js"),
|
|
1603
|
+
path.join(path.dirname(record.source), "runtime-api.ts"),
|
|
1604
|
+
...record.rootDir ? [path.join(record.rootDir, "runtime-api.js"), path.join(record.rootDir, "runtime-api.ts")] : []
|
|
1605
|
+
];
|
|
1606
|
+
for (const candidate of candidates) if (fs.existsSync(candidate)) return candidate;
|
|
1607
|
+
return null;
|
|
1608
|
+
}
|
|
1609
|
+
function getJiti(modulePath) {
|
|
1610
|
+
const tryNative = shouldPreferNativeJiti(modulePath);
|
|
1611
|
+
const cached = jitiLoaders.get(tryNative);
|
|
1612
|
+
if (cached) return cached;
|
|
1613
|
+
const pluginSdkAlias = resolvePluginSdkAliasFile({
|
|
1614
|
+
srcFile: "root-alias.cjs",
|
|
1615
|
+
distFile: "root-alias.cjs",
|
|
1616
|
+
modulePath
|
|
1617
|
+
});
|
|
1618
|
+
const aliasMap = {
|
|
1619
|
+
...pluginSdkAlias ? { "openclaw/plugin-sdk": pluginSdkAlias } : {},
|
|
1620
|
+
...resolvePluginSdkScopedAliasMap({ modulePath })
|
|
1621
|
+
};
|
|
1622
|
+
const loader = createJiti(import.meta.url, {
|
|
1623
|
+
...buildPluginLoaderJitiOptions(aliasMap),
|
|
1624
|
+
tryNative
|
|
1625
|
+
});
|
|
1626
|
+
jitiLoaders.set(tryNative, loader);
|
|
1627
|
+
return loader;
|
|
1628
|
+
}
|
|
1629
|
+
function loadWithJiti(modulePath) {
|
|
1630
|
+
return getJiti(modulePath)(modulePath);
|
|
1631
|
+
}
|
|
1632
|
+
function loadMatrixModule() {
|
|
1633
|
+
const record = resolveMatrixPluginRecord();
|
|
1634
|
+
if (!record) return null;
|
|
1635
|
+
const modulePath = resolveMatrixRuntimeModulePath(record);
|
|
1636
|
+
if (!modulePath) return null;
|
|
1637
|
+
if (cachedModule && cachedModulePath === modulePath) return cachedModule;
|
|
1638
|
+
const loaded = loadWithJiti(modulePath);
|
|
1639
|
+
cachedModulePath = modulePath;
|
|
1640
|
+
cachedModule = loaded;
|
|
1641
|
+
return loaded;
|
|
1642
|
+
}
|
|
1643
|
+
function setMatrixThreadBindingIdleTimeoutBySessionKey(...args) {
|
|
1644
|
+
const fn = loadMatrixModule()?.setMatrixThreadBindingIdleTimeoutBySessionKey;
|
|
1645
|
+
if (typeof fn !== "function") return [];
|
|
1646
|
+
return fn(...args);
|
|
1647
|
+
}
|
|
1648
|
+
function setMatrixThreadBindingMaxAgeBySessionKey(...args) {
|
|
1649
|
+
const fn = loadMatrixModule()?.setMatrixThreadBindingMaxAgeBySessionKey;
|
|
1650
|
+
if (typeof fn !== "function") return [];
|
|
1651
|
+
return fn(...args);
|
|
1652
|
+
}
|
|
1653
|
+
//#endregion
|
|
1654
|
+
//#region src/plugins/runtime/runtime-matrix.ts
|
|
1655
|
+
function createRuntimeMatrix() {
|
|
1656
|
+
return { threadBindings: {
|
|
1657
|
+
setIdleTimeoutBySessionKey: setMatrixThreadBindingIdleTimeoutBySessionKey,
|
|
1658
|
+
setMaxAgeBySessionKey: setMatrixThreadBindingMaxAgeBySessionKey
|
|
1659
|
+
} };
|
|
1660
|
+
}
|
|
1661
|
+
//#endregion
|
|
1662
|
+
//#region src/plugins/runtime/runtime-signal.ts
|
|
1663
|
+
function createRuntimeSignal() {
|
|
1664
|
+
return {
|
|
1665
|
+
probeSignal,
|
|
1666
|
+
sendMessageSignal,
|
|
1667
|
+
monitorSignalProvider,
|
|
1668
|
+
messageActions: signalMessageActions
|
|
1669
|
+
};
|
|
1670
|
+
}
|
|
1671
|
+
//#endregion
|
|
1672
|
+
//#region src/plugins/runtime/runtime-slack.ts
|
|
1673
|
+
const bindSlackRuntimeMethod = createLazyRuntimeMethodBinder(createLazyRuntimeSurface(() => import("./runtime-slack-ops.runtime-BumgKDhS.js"), ({ runtimeSlackOps }) => runtimeSlackOps));
|
|
1674
|
+
const listDirectoryGroupsLiveLazy = bindSlackRuntimeMethod((runtimeSlackOps) => runtimeSlackOps.listDirectoryGroupsLive);
|
|
1675
|
+
const listDirectoryPeersLiveLazy = bindSlackRuntimeMethod((runtimeSlackOps) => runtimeSlackOps.listDirectoryPeersLive);
|
|
1676
|
+
const probeSlackLazy = bindSlackRuntimeMethod((runtimeSlackOps) => runtimeSlackOps.probeSlack);
|
|
1677
|
+
const resolveChannelAllowlistLazy = bindSlackRuntimeMethod((runtimeSlackOps) => runtimeSlackOps.resolveChannelAllowlist);
|
|
1678
|
+
const resolveUserAllowlistLazy = bindSlackRuntimeMethod((runtimeSlackOps) => runtimeSlackOps.resolveUserAllowlist);
|
|
1679
|
+
const sendMessageSlackLazy = bindSlackRuntimeMethod((runtimeSlackOps) => runtimeSlackOps.sendMessageSlack);
|
|
1680
|
+
const monitorSlackProviderLazy = bindSlackRuntimeMethod((runtimeSlackOps) => runtimeSlackOps.monitorSlackProvider);
|
|
1681
|
+
const handleSlackActionLazy = bindSlackRuntimeMethod((runtimeSlackOps) => runtimeSlackOps.handleSlackAction);
|
|
1682
|
+
function createRuntimeSlack() {
|
|
1683
|
+
return {
|
|
1684
|
+
listDirectoryGroupsLive: listDirectoryGroupsLiveLazy,
|
|
1685
|
+
listDirectoryPeersLive: listDirectoryPeersLiveLazy,
|
|
1686
|
+
probeSlack: probeSlackLazy,
|
|
1687
|
+
resolveChannelAllowlist: resolveChannelAllowlistLazy,
|
|
1688
|
+
resolveUserAllowlist: resolveUserAllowlistLazy,
|
|
1689
|
+
sendMessageSlack: sendMessageSlackLazy,
|
|
1690
|
+
monitorSlackProvider: monitorSlackProviderLazy,
|
|
1691
|
+
handleSlackAction: handleSlackActionLazy
|
|
1692
|
+
};
|
|
1693
|
+
}
|
|
1694
|
+
//#endregion
|
|
1695
|
+
//#region src/plugins/runtime/runtime-telegram-typing.ts
|
|
1696
|
+
async function createTelegramTypingLease(params) {
|
|
1697
|
+
const intervalMs = typeof params.intervalMs === "number" && Number.isFinite(params.intervalMs) ? Math.max(1e3, Math.floor(params.intervalMs)) : 4e3;
|
|
1698
|
+
let stopped = false;
|
|
1699
|
+
const refresh = async () => {
|
|
1700
|
+
if (stopped) return;
|
|
1701
|
+
await params.pulse({
|
|
1702
|
+
to: params.to,
|
|
1703
|
+
accountId: params.accountId,
|
|
1704
|
+
cfg: params.cfg,
|
|
1705
|
+
messageThreadId: params.messageThreadId
|
|
1706
|
+
});
|
|
1707
|
+
};
|
|
1708
|
+
await refresh();
|
|
1709
|
+
const timer = setInterval(() => {
|
|
1710
|
+
refresh().catch((err) => {
|
|
1711
|
+
logWarn(`plugins: telegram typing pulse failed: ${String(err)}`);
|
|
1712
|
+
});
|
|
1713
|
+
}, intervalMs);
|
|
1714
|
+
timer.unref?.();
|
|
1715
|
+
return {
|
|
1716
|
+
refresh,
|
|
1717
|
+
stop: () => {
|
|
1718
|
+
if (stopped) return;
|
|
1719
|
+
stopped = true;
|
|
1720
|
+
clearInterval(timer);
|
|
1721
|
+
}
|
|
1722
|
+
};
|
|
1723
|
+
}
|
|
1724
|
+
//#endregion
|
|
1725
|
+
//#region src/plugins/runtime/runtime-telegram.ts
|
|
1726
|
+
const bindTelegramRuntimeMethod = createLazyRuntimeMethodBinder(createLazyRuntimeSurface(() => import("./runtime-telegram-ops.runtime-rSLQ3KrE.js"), ({ runtimeTelegramOps }) => runtimeTelegramOps));
|
|
1727
|
+
const auditGroupMembershipLazy = bindTelegramRuntimeMethod((runtimeTelegramOps) => runtimeTelegramOps.auditGroupMembership);
|
|
1728
|
+
const probeTelegramLazy = bindTelegramRuntimeMethod((runtimeTelegramOps) => runtimeTelegramOps.probeTelegram);
|
|
1729
|
+
const sendMessageTelegramLazy = bindTelegramRuntimeMethod((runtimeTelegramOps) => runtimeTelegramOps.sendMessageTelegram);
|
|
1730
|
+
const sendPollTelegramLazy = bindTelegramRuntimeMethod((runtimeTelegramOps) => runtimeTelegramOps.sendPollTelegram);
|
|
1731
|
+
const monitorTelegramProviderLazy = bindTelegramRuntimeMethod((runtimeTelegramOps) => runtimeTelegramOps.monitorTelegramProvider);
|
|
1732
|
+
const sendTypingTelegramLazy = bindTelegramRuntimeMethod((runtimeTelegramOps) => runtimeTelegramOps.typing.pulse);
|
|
1733
|
+
const editMessageTelegramLazy = bindTelegramRuntimeMethod((runtimeTelegramOps) => runtimeTelegramOps.conversationActions.editMessage);
|
|
1734
|
+
const editMessageReplyMarkupTelegramLazy = bindTelegramRuntimeMethod((runtimeTelegramOps) => runtimeTelegramOps.conversationActions.editReplyMarkup);
|
|
1735
|
+
const deleteMessageTelegramLazy = bindTelegramRuntimeMethod((runtimeTelegramOps) => runtimeTelegramOps.conversationActions.deleteMessage);
|
|
1736
|
+
const renameForumTopicTelegramLazy = bindTelegramRuntimeMethod((runtimeTelegramOps) => runtimeTelegramOps.conversationActions.renameTopic);
|
|
1737
|
+
const pinMessageTelegramLazy = bindTelegramRuntimeMethod((runtimeTelegramOps) => runtimeTelegramOps.conversationActions.pinMessage);
|
|
1738
|
+
const unpinMessageTelegramLazy = bindTelegramRuntimeMethod((runtimeTelegramOps) => runtimeTelegramOps.conversationActions.unpinMessage);
|
|
1739
|
+
function createRuntimeTelegram() {
|
|
1740
|
+
return {
|
|
1741
|
+
auditGroupMembership: auditGroupMembershipLazy,
|
|
1742
|
+
collectUnmentionedGroupIds: collectTelegramUnmentionedGroupIds,
|
|
1743
|
+
probeTelegram: probeTelegramLazy,
|
|
1744
|
+
resolveTelegramToken,
|
|
1745
|
+
sendMessageTelegram: sendMessageTelegramLazy,
|
|
1746
|
+
sendPollTelegram: sendPollTelegramLazy,
|
|
1747
|
+
monitorTelegramProvider: monitorTelegramProviderLazy,
|
|
1748
|
+
messageActions: telegramMessageActions,
|
|
1749
|
+
threadBindings: {
|
|
1750
|
+
setIdleTimeoutBySessionKey: setTelegramThreadBindingIdleTimeoutBySessionKey,
|
|
1751
|
+
setMaxAgeBySessionKey: setTelegramThreadBindingMaxAgeBySessionKey
|
|
1752
|
+
},
|
|
1753
|
+
typing: {
|
|
1754
|
+
pulse: sendTypingTelegramLazy,
|
|
1755
|
+
start: async ({ to, accountId, cfg, intervalMs, messageThreadId }) => await createTelegramTypingLease({
|
|
1756
|
+
to,
|
|
1757
|
+
accountId,
|
|
1758
|
+
cfg,
|
|
1759
|
+
intervalMs,
|
|
1760
|
+
messageThreadId,
|
|
1761
|
+
pulse: async ({ to, accountId, cfg, messageThreadId }) => await sendTypingTelegramLazy(to, {
|
|
1762
|
+
accountId,
|
|
1763
|
+
cfg,
|
|
1764
|
+
messageThreadId
|
|
1765
|
+
})
|
|
1766
|
+
})
|
|
1767
|
+
},
|
|
1768
|
+
conversationActions: {
|
|
1769
|
+
editMessage: editMessageTelegramLazy,
|
|
1770
|
+
editReplyMarkup: editMessageReplyMarkupTelegramLazy,
|
|
1771
|
+
clearReplyMarkup: async (chatIdInput, messageIdInput, opts = {}) => await editMessageReplyMarkupTelegramLazy(chatIdInput, messageIdInput, [], opts),
|
|
1772
|
+
deleteMessage: deleteMessageTelegramLazy,
|
|
1773
|
+
renameTopic: renameForumTopicTelegramLazy,
|
|
1774
|
+
pinMessage: pinMessageTelegramLazy,
|
|
1775
|
+
unpinMessage: unpinMessageTelegramLazy
|
|
1776
|
+
}
|
|
1777
|
+
};
|
|
1778
|
+
}
|
|
1779
|
+
//#endregion
|
|
1780
|
+
//#region src/plugins/runtime/runtime-whatsapp.ts
|
|
1781
|
+
function createRuntimeWhatsApp() {
|
|
1782
|
+
return {
|
|
1783
|
+
getActiveWebListener,
|
|
1784
|
+
getWebAuthAgeMs,
|
|
1785
|
+
logoutWeb,
|
|
1786
|
+
logWebSelfId,
|
|
1787
|
+
readWebSelfId,
|
|
1788
|
+
webAuthExists,
|
|
1789
|
+
sendMessageWhatsApp,
|
|
1790
|
+
sendPollWhatsApp,
|
|
1791
|
+
loginWeb,
|
|
1792
|
+
startWebLoginWithQr,
|
|
1793
|
+
waitForWebLogin,
|
|
1794
|
+
monitorWebChannel,
|
|
1795
|
+
handleWhatsAppAction,
|
|
1796
|
+
createLoginTool: createRuntimeWhatsAppLoginTool
|
|
1797
|
+
};
|
|
1798
|
+
}
|
|
1799
|
+
//#endregion
|
|
1800
|
+
//#region src/plugins/runtime/runtime-channel.ts
|
|
1801
|
+
function defineCachedValue(target, key, create) {
|
|
1802
|
+
let cached;
|
|
1803
|
+
let ready = false;
|
|
1804
|
+
Object.defineProperty(target, key, {
|
|
1805
|
+
configurable: true,
|
|
1806
|
+
enumerable: true,
|
|
1807
|
+
get() {
|
|
1808
|
+
if (!ready) {
|
|
1809
|
+
cached = create();
|
|
1810
|
+
ready = true;
|
|
1811
|
+
}
|
|
1812
|
+
return cached;
|
|
1813
|
+
}
|
|
1814
|
+
});
|
|
1815
|
+
}
|
|
1816
|
+
function createRuntimeChannel() {
|
|
1817
|
+
const channelRuntime = {
|
|
1818
|
+
text: {
|
|
1819
|
+
chunkByNewline,
|
|
1820
|
+
chunkMarkdownText,
|
|
1821
|
+
chunkMarkdownTextWithMode,
|
|
1822
|
+
chunkText,
|
|
1823
|
+
chunkTextWithMode,
|
|
1824
|
+
resolveChunkMode,
|
|
1825
|
+
resolveTextChunkLimit,
|
|
1826
|
+
hasControlCommand,
|
|
1827
|
+
resolveMarkdownTableMode,
|
|
1828
|
+
convertMarkdownTables
|
|
1829
|
+
},
|
|
1830
|
+
reply: {
|
|
1831
|
+
dispatchReplyWithBufferedBlockDispatcher,
|
|
1832
|
+
createReplyDispatcherWithTyping,
|
|
1833
|
+
resolveEffectiveMessagesConfig,
|
|
1834
|
+
resolveHumanDelayConfig,
|
|
1835
|
+
dispatchReplyFromConfig,
|
|
1836
|
+
withReplyDispatcher,
|
|
1837
|
+
finalizeInboundContext,
|
|
1838
|
+
formatAgentEnvelope,
|
|
1839
|
+
formatInboundEnvelope,
|
|
1840
|
+
resolveEnvelopeFormatOptions
|
|
1841
|
+
},
|
|
1842
|
+
routing: {
|
|
1843
|
+
buildAgentSessionKey,
|
|
1844
|
+
resolveAgentRoute
|
|
1845
|
+
},
|
|
1846
|
+
pairing: {
|
|
1847
|
+
buildPairingReply,
|
|
1848
|
+
readAllowFromStore: ({ channel, accountId, env }) => readChannelAllowFromStore(channel, env, accountId),
|
|
1849
|
+
upsertPairingRequest: ({ channel, id, accountId, meta, env, pairingAdapter }) => upsertChannelPairingRequest({
|
|
1850
|
+
channel,
|
|
1851
|
+
id,
|
|
1852
|
+
accountId,
|
|
1853
|
+
meta,
|
|
1854
|
+
env,
|
|
1855
|
+
pairingAdapter
|
|
1856
|
+
})
|
|
1857
|
+
},
|
|
1858
|
+
media: {
|
|
1859
|
+
fetchRemoteMedia,
|
|
1860
|
+
saveMediaBuffer
|
|
1861
|
+
},
|
|
1862
|
+
activity: {
|
|
1863
|
+
record: recordChannelActivity,
|
|
1864
|
+
get: getChannelActivity
|
|
1865
|
+
},
|
|
1866
|
+
session: {
|
|
1867
|
+
resolveStorePath,
|
|
1868
|
+
readSessionUpdatedAt,
|
|
1869
|
+
recordSessionMetaFromInbound,
|
|
1870
|
+
recordInboundSession,
|
|
1871
|
+
updateLastRoute
|
|
1872
|
+
},
|
|
1873
|
+
mentions: {
|
|
1874
|
+
buildMentionRegexes,
|
|
1875
|
+
matchesMentionPatterns,
|
|
1876
|
+
matchesMentionWithExplicit
|
|
1877
|
+
},
|
|
1878
|
+
reactions: {
|
|
1879
|
+
shouldAckReaction,
|
|
1880
|
+
removeAckReactionAfterReply
|
|
1881
|
+
},
|
|
1882
|
+
groups: {
|
|
1883
|
+
resolveGroupPolicy: resolveChannelGroupPolicy,
|
|
1884
|
+
resolveRequireMention: resolveChannelGroupRequireMention
|
|
1885
|
+
},
|
|
1886
|
+
debounce: {
|
|
1887
|
+
createInboundDebouncer,
|
|
1888
|
+
resolveInboundDebounceMs
|
|
1889
|
+
},
|
|
1890
|
+
commands: {
|
|
1891
|
+
resolveCommandAuthorizedFromAuthorizers,
|
|
1892
|
+
isControlCommandMessage,
|
|
1893
|
+
shouldComputeCommandAuthorized,
|
|
1894
|
+
shouldHandleTextCommands
|
|
1895
|
+
},
|
|
1896
|
+
line: {
|
|
1897
|
+
listLineAccountIds,
|
|
1898
|
+
resolveDefaultLineAccountId,
|
|
1899
|
+
resolveLineAccount,
|
|
1900
|
+
normalizeAccountId,
|
|
1901
|
+
probeLineBot,
|
|
1902
|
+
sendMessageLine,
|
|
1903
|
+
pushMessageLine,
|
|
1904
|
+
pushMessagesLine,
|
|
1905
|
+
pushFlexMessage,
|
|
1906
|
+
pushTemplateMessage,
|
|
1907
|
+
pushLocationMessage,
|
|
1908
|
+
pushTextMessageWithQuickReplies,
|
|
1909
|
+
createQuickReplyItems,
|
|
1910
|
+
buildTemplateMessageFromPayload,
|
|
1911
|
+
monitorLineProvider
|
|
1912
|
+
}
|
|
1913
|
+
};
|
|
1914
|
+
defineCachedValue(channelRuntime, "discord", createRuntimeDiscord);
|
|
1915
|
+
defineCachedValue(channelRuntime, "slack", createRuntimeSlack);
|
|
1916
|
+
defineCachedValue(channelRuntime, "telegram", createRuntimeTelegram);
|
|
1917
|
+
defineCachedValue(channelRuntime, "matrix", createRuntimeMatrix);
|
|
1918
|
+
defineCachedValue(channelRuntime, "signal", createRuntimeSignal);
|
|
1919
|
+
defineCachedValue(channelRuntime, "imessage", createRuntimeIMessage);
|
|
1920
|
+
defineCachedValue(channelRuntime, "whatsapp", createRuntimeWhatsApp);
|
|
1921
|
+
return channelRuntime;
|
|
1922
|
+
}
|
|
1923
|
+
//#endregion
|
|
1924
|
+
//#region src/plugins/runtime/runtime-config.ts
|
|
1925
|
+
function createRuntimeConfig() {
|
|
1926
|
+
return {
|
|
1927
|
+
loadConfig,
|
|
1928
|
+
writeConfigFile
|
|
1929
|
+
};
|
|
1930
|
+
}
|
|
1931
|
+
//#endregion
|
|
1932
|
+
//#region src/plugins/runtime/runtime-events.ts
|
|
1933
|
+
function createRuntimeEvents() {
|
|
1934
|
+
return {
|
|
1935
|
+
onAgentEvent,
|
|
1936
|
+
onSessionTranscriptUpdate
|
|
1937
|
+
};
|
|
1938
|
+
}
|
|
1939
|
+
//#endregion
|
|
1940
|
+
//#region src/plugins/runtime/runtime-logging.ts
|
|
1941
|
+
function createRuntimeLogging() {
|
|
1942
|
+
return {
|
|
1943
|
+
shouldLogVerbose,
|
|
1944
|
+
getChildLogger: (bindings, opts) => {
|
|
1945
|
+
const logger = getChildLogger(bindings, { level: opts?.level ? normalizeLogLevel(opts.level) : void 0 });
|
|
1946
|
+
return {
|
|
1947
|
+
debug: (message) => logger.debug?.(message),
|
|
1948
|
+
info: (message) => logger.info(message),
|
|
1949
|
+
warn: (message) => logger.warn(message),
|
|
1950
|
+
error: (message) => logger.error(message)
|
|
1951
|
+
};
|
|
1952
|
+
}
|
|
1953
|
+
};
|
|
1954
|
+
}
|
|
1955
|
+
//#endregion
|
|
1956
|
+
//#region src/plugins/runtime/runtime-media.ts
|
|
1957
|
+
function createRuntimeMedia() {
|
|
1958
|
+
return {
|
|
1959
|
+
loadWebMedia,
|
|
1960
|
+
detectMime,
|
|
1961
|
+
mediaKindFromMime,
|
|
1962
|
+
isVoiceCompatibleAudio,
|
|
1963
|
+
getImageMetadata,
|
|
1964
|
+
resizeToJpeg
|
|
1965
|
+
};
|
|
1966
|
+
}
|
|
1967
|
+
//#endregion
|
|
1968
|
+
//#region src/plugins/runtime/native-deps.ts
|
|
1969
|
+
function formatNativeDependencyHint(params) {
|
|
1970
|
+
const manager = params.manager ?? "pnpm";
|
|
1971
|
+
const rebuildCommand = params.rebuildCommand ?? (manager === "npm" ? `npm rebuild ${params.packageName}` : manager === "yarn" ? `yarn rebuild ${params.packageName}` : `pnpm rebuild ${params.packageName}`);
|
|
1972
|
+
const steps = [
|
|
1973
|
+
params.approveBuildsCommand ?? (manager === "pnpm" ? `pnpm approve-builds (select ${params.packageName})` : void 0),
|
|
1974
|
+
rebuildCommand,
|
|
1975
|
+
params.downloadCommand
|
|
1976
|
+
].filter((step) => Boolean(step));
|
|
1977
|
+
if (steps.length === 0) return `Install ${params.packageName} and rebuild its native module.`;
|
|
1978
|
+
return `Install ${params.packageName} and rebuild its native module (${steps.join("; ")}).`;
|
|
1979
|
+
}
|
|
1980
|
+
//#endregion
|
|
1981
|
+
//#region src/plugins/runtime/runtime-system.ts
|
|
1982
|
+
function createRuntimeSystem() {
|
|
1983
|
+
return {
|
|
1984
|
+
enqueueSystemEvent,
|
|
1985
|
+
requestHeartbeatNow,
|
|
1986
|
+
runCommandWithTimeout,
|
|
1987
|
+
formatNativeDependencyHint
|
|
1988
|
+
};
|
|
1989
|
+
}
|
|
1990
|
+
//#endregion
|
|
1991
|
+
//#region src/agents/tools/memory-tool.ts
|
|
1992
|
+
const MemorySearchSchema = Type.Object({
|
|
1993
|
+
query: Type.String(),
|
|
1994
|
+
maxResults: Type.Optional(Type.Number()),
|
|
1995
|
+
minScore: Type.Optional(Type.Number())
|
|
1996
|
+
});
|
|
1997
|
+
const MemoryGetSchema = Type.Object({
|
|
1998
|
+
path: Type.String(),
|
|
1999
|
+
from: Type.Optional(Type.Number()),
|
|
2000
|
+
lines: Type.Optional(Type.Number())
|
|
2001
|
+
});
|
|
2002
|
+
function resolveMemoryToolContext(options) {
|
|
2003
|
+
const cfg = options.config;
|
|
2004
|
+
if (!cfg) return null;
|
|
2005
|
+
const agentId = resolveSessionAgentId({
|
|
2006
|
+
sessionKey: options.agentSessionKey,
|
|
2007
|
+
config: cfg
|
|
2008
|
+
});
|
|
2009
|
+
if (!resolveMemorySearchConfig(cfg, agentId)) return null;
|
|
2010
|
+
return {
|
|
2011
|
+
cfg,
|
|
2012
|
+
agentId
|
|
2013
|
+
};
|
|
2014
|
+
}
|
|
2015
|
+
async function getMemoryManagerContext(params) {
|
|
2016
|
+
return await getMemoryManagerContextWithPurpose({
|
|
2017
|
+
...params,
|
|
2018
|
+
purpose: void 0
|
|
2019
|
+
});
|
|
2020
|
+
}
|
|
2021
|
+
async function getMemoryManagerContextWithPurpose(params) {
|
|
2022
|
+
const { manager, error } = await getMemorySearchManager({
|
|
2023
|
+
cfg: params.cfg,
|
|
2024
|
+
agentId: params.agentId,
|
|
2025
|
+
purpose: params.purpose
|
|
2026
|
+
});
|
|
2027
|
+
return manager ? { manager } : { error };
|
|
2028
|
+
}
|
|
2029
|
+
function createMemoryTool(params) {
|
|
2030
|
+
const ctx = resolveMemoryToolContext(params.options);
|
|
2031
|
+
if (!ctx) return null;
|
|
2032
|
+
return {
|
|
2033
|
+
label: params.label,
|
|
2034
|
+
name: params.name,
|
|
2035
|
+
description: params.description,
|
|
2036
|
+
parameters: params.parameters,
|
|
2037
|
+
execute: params.execute(ctx)
|
|
2038
|
+
};
|
|
2039
|
+
}
|
|
2040
|
+
function createMemorySearchTool(options) {
|
|
2041
|
+
return createMemoryTool({
|
|
2042
|
+
options,
|
|
2043
|
+
label: "Memory Search",
|
|
2044
|
+
name: "memory_search",
|
|
2045
|
+
description: "Mandatory recall step: semantically search MEMORY.md + memory/*.md (and optional session transcripts) before answering questions about prior work, decisions, dates, people, preferences, or todos; returns top snippets with path + lines. If response has disabled=true, memory retrieval is unavailable and should be surfaced to the user.",
|
|
2046
|
+
parameters: MemorySearchSchema,
|
|
2047
|
+
execute: ({ cfg, agentId }) => async (_toolCallId, params) => {
|
|
2048
|
+
const query = readStringParam(params, "query", { required: true });
|
|
2049
|
+
const maxResults = readNumberParam(params, "maxResults");
|
|
2050
|
+
const minScore = readNumberParam(params, "minScore");
|
|
2051
|
+
const memory = await getMemoryManagerContext({
|
|
2052
|
+
cfg,
|
|
2053
|
+
agentId
|
|
2054
|
+
});
|
|
2055
|
+
if ("error" in memory) return jsonResult(buildMemorySearchUnavailableResult(memory.error));
|
|
2056
|
+
try {
|
|
2057
|
+
const citationsMode = resolveMemoryCitationsMode(cfg);
|
|
2058
|
+
const includeCitations = shouldIncludeCitations({
|
|
2059
|
+
mode: citationsMode,
|
|
2060
|
+
sessionKey: options.agentSessionKey
|
|
2061
|
+
});
|
|
2062
|
+
const rawResults = await memory.manager.search(query, {
|
|
2063
|
+
maxResults,
|
|
2064
|
+
minScore,
|
|
2065
|
+
sessionKey: options.agentSessionKey
|
|
2066
|
+
});
|
|
2067
|
+
const status = memory.manager.status();
|
|
2068
|
+
const decorated = decorateCitations(rawResults, includeCitations);
|
|
2069
|
+
const resolved = resolveMemoryBackendConfig({
|
|
2070
|
+
cfg,
|
|
2071
|
+
agentId
|
|
2072
|
+
});
|
|
2073
|
+
const results = status.backend === "qmd" ? clampResultsByInjectedChars(decorated, resolved.qmd?.limits.maxInjectedChars) : decorated;
|
|
2074
|
+
const searchMode = status.custom?.searchMode;
|
|
2075
|
+
return jsonResult({
|
|
2076
|
+
results,
|
|
2077
|
+
provider: status.provider,
|
|
2078
|
+
model: status.model,
|
|
2079
|
+
fallback: status.fallback,
|
|
2080
|
+
citations: citationsMode,
|
|
2081
|
+
mode: searchMode
|
|
2082
|
+
});
|
|
2083
|
+
} catch (err) {
|
|
2084
|
+
return jsonResult(buildMemorySearchUnavailableResult(err instanceof Error ? err.message : String(err)));
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
});
|
|
2088
|
+
}
|
|
2089
|
+
function createMemoryGetTool(options) {
|
|
2090
|
+
return createMemoryTool({
|
|
2091
|
+
options,
|
|
2092
|
+
label: "Memory Get",
|
|
2093
|
+
name: "memory_get",
|
|
2094
|
+
description: "Safe snippet read from MEMORY.md or memory/*.md with optional from/lines; use after memory_search to pull only the needed lines and keep context small.",
|
|
2095
|
+
parameters: MemoryGetSchema,
|
|
2096
|
+
execute: ({ cfg, agentId }) => async (_toolCallId, params) => {
|
|
2097
|
+
const relPath = readStringParam(params, "path", { required: true });
|
|
2098
|
+
const from = readNumberParam(params, "from", { integer: true });
|
|
2099
|
+
const lines = readNumberParam(params, "lines", { integer: true });
|
|
2100
|
+
if (resolveMemoryBackendConfig({
|
|
2101
|
+
cfg,
|
|
2102
|
+
agentId
|
|
2103
|
+
}).backend === "builtin") try {
|
|
2104
|
+
return jsonResult(await readAgentMemoryFile({
|
|
2105
|
+
cfg,
|
|
2106
|
+
agentId,
|
|
2107
|
+
relPath,
|
|
2108
|
+
from: from ?? void 0,
|
|
2109
|
+
lines: lines ?? void 0
|
|
2110
|
+
}));
|
|
2111
|
+
} catch (err) {
|
|
2112
|
+
return jsonResult({
|
|
2113
|
+
path: relPath,
|
|
2114
|
+
text: "",
|
|
2115
|
+
disabled: true,
|
|
2116
|
+
error: err instanceof Error ? err.message : String(err)
|
|
2117
|
+
});
|
|
2118
|
+
}
|
|
2119
|
+
const memory = await getMemoryManagerContextWithPurpose({
|
|
2120
|
+
cfg,
|
|
2121
|
+
agentId,
|
|
2122
|
+
purpose: "status"
|
|
2123
|
+
});
|
|
2124
|
+
if ("error" in memory) return jsonResult({
|
|
2125
|
+
path: relPath,
|
|
2126
|
+
text: "",
|
|
2127
|
+
disabled: true,
|
|
2128
|
+
error: memory.error
|
|
2129
|
+
});
|
|
2130
|
+
try {
|
|
2131
|
+
return jsonResult(await memory.manager.readFile({
|
|
2132
|
+
relPath,
|
|
2133
|
+
from: from ?? void 0,
|
|
2134
|
+
lines: lines ?? void 0
|
|
2135
|
+
}));
|
|
2136
|
+
} catch (err) {
|
|
2137
|
+
return jsonResult({
|
|
2138
|
+
path: relPath,
|
|
2139
|
+
text: "",
|
|
2140
|
+
disabled: true,
|
|
2141
|
+
error: err instanceof Error ? err.message : String(err)
|
|
2142
|
+
});
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
});
|
|
2146
|
+
}
|
|
2147
|
+
function resolveMemoryCitationsMode(cfg) {
|
|
2148
|
+
const mode = cfg.memory?.citations;
|
|
2149
|
+
if (mode === "on" || mode === "off" || mode === "auto") return mode;
|
|
2150
|
+
return "auto";
|
|
2151
|
+
}
|
|
2152
|
+
function decorateCitations(results, include) {
|
|
2153
|
+
if (!include) return results.map((entry) => ({
|
|
2154
|
+
...entry,
|
|
2155
|
+
citation: void 0
|
|
2156
|
+
}));
|
|
2157
|
+
return results.map((entry) => {
|
|
2158
|
+
const citation = formatCitation(entry);
|
|
2159
|
+
const snippet = `${entry.snippet.trim()}\n\nSource: ${citation}`;
|
|
2160
|
+
return {
|
|
2161
|
+
...entry,
|
|
2162
|
+
citation,
|
|
2163
|
+
snippet
|
|
2164
|
+
};
|
|
2165
|
+
});
|
|
2166
|
+
}
|
|
2167
|
+
function formatCitation(entry) {
|
|
2168
|
+
const lineRange = entry.startLine === entry.endLine ? `#L${entry.startLine}` : `#L${entry.startLine}-L${entry.endLine}`;
|
|
2169
|
+
return `${entry.path}${lineRange}`;
|
|
2170
|
+
}
|
|
2171
|
+
function clampResultsByInjectedChars(results, budget) {
|
|
2172
|
+
if (!budget || budget <= 0) return results;
|
|
2173
|
+
let remaining = budget;
|
|
2174
|
+
const clamped = [];
|
|
2175
|
+
for (const entry of results) {
|
|
2176
|
+
if (remaining <= 0) break;
|
|
2177
|
+
const snippet = entry.snippet ?? "";
|
|
2178
|
+
if (snippet.length <= remaining) {
|
|
2179
|
+
clamped.push(entry);
|
|
2180
|
+
remaining -= snippet.length;
|
|
2181
|
+
} else {
|
|
2182
|
+
const trimmed = snippet.slice(0, Math.max(0, remaining));
|
|
2183
|
+
clamped.push({
|
|
2184
|
+
...entry,
|
|
2185
|
+
snippet: trimmed
|
|
2186
|
+
});
|
|
2187
|
+
break;
|
|
2188
|
+
}
|
|
2189
|
+
}
|
|
2190
|
+
return clamped;
|
|
2191
|
+
}
|
|
2192
|
+
function buildMemorySearchUnavailableResult(error) {
|
|
2193
|
+
const reason = (error ?? "memory search unavailable").trim() || "memory search unavailable";
|
|
2194
|
+
const isQuotaError = /insufficient_quota|quota|429/.test(reason.toLowerCase());
|
|
2195
|
+
return {
|
|
2196
|
+
results: [],
|
|
2197
|
+
disabled: true,
|
|
2198
|
+
unavailable: true,
|
|
2199
|
+
error: reason,
|
|
2200
|
+
warning: isQuotaError ? "Memory search is unavailable because the embedding provider quota is exhausted." : "Memory search is unavailable due to an embedding/provider error.",
|
|
2201
|
+
action: isQuotaError ? "Top up or switch embedding provider, then retry memory_search." : "Check embedding provider configuration and retry memory_search."
|
|
2202
|
+
};
|
|
2203
|
+
}
|
|
2204
|
+
function shouldIncludeCitations(params) {
|
|
2205
|
+
if (params.mode === "on") return true;
|
|
2206
|
+
if (params.mode === "off") return false;
|
|
2207
|
+
return deriveChatTypeFromSessionKey(params.sessionKey) === "direct";
|
|
2208
|
+
}
|
|
2209
|
+
function deriveChatTypeFromSessionKey(sessionKey) {
|
|
2210
|
+
const parsed = parseAgentSessionKey(sessionKey);
|
|
2211
|
+
if (!parsed?.rest) return "direct";
|
|
2212
|
+
const tokens = new Set(parsed.rest.toLowerCase().split(":").filter(Boolean));
|
|
2213
|
+
if (tokens.has("channel")) return "channel";
|
|
2214
|
+
if (tokens.has("group")) return "group";
|
|
2215
|
+
return "direct";
|
|
2216
|
+
}
|
|
2217
|
+
//#endregion
|
|
2218
|
+
//#region src/plugins/runtime/runtime-tools.ts
|
|
2219
|
+
function createRuntimeTools() {
|
|
2220
|
+
return {
|
|
2221
|
+
createMemoryGetTool,
|
|
2222
|
+
createMemorySearchTool,
|
|
2223
|
+
registerMemoryCli
|
|
2224
|
+
};
|
|
2225
|
+
}
|
|
2226
|
+
//#endregion
|
|
2227
|
+
//#region src/plugins/runtime/index.ts
|
|
2228
|
+
let cachedVersion = null;
|
|
2229
|
+
function resolveVersion() {
|
|
2230
|
+
if (cachedVersion) return cachedVersion;
|
|
2231
|
+
try {
|
|
2232
|
+
cachedVersion = createRequire(import.meta.url)("../../../package.json").version ?? "unknown";
|
|
2233
|
+
return cachedVersion;
|
|
2234
|
+
} catch {
|
|
2235
|
+
cachedVersion = "unknown";
|
|
2236
|
+
return cachedVersion;
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
function createUnavailableSubagentRuntime() {
|
|
2240
|
+
const unavailable = () => {
|
|
2241
|
+
throw new Error("Plugin runtime subagent methods are only available during a gateway request.");
|
|
2242
|
+
};
|
|
2243
|
+
return {
|
|
2244
|
+
run: unavailable,
|
|
2245
|
+
waitForRun: unavailable,
|
|
2246
|
+
getSessionMessages: unavailable,
|
|
2247
|
+
getSession: unavailable,
|
|
2248
|
+
deleteSession: unavailable
|
|
2249
|
+
};
|
|
2250
|
+
}
|
|
2251
|
+
const GATEWAY_SUBAGENT_SYMBOL = Symbol.for("openclaw.plugin.gatewaySubagentRuntime");
|
|
2252
|
+
const gatewaySubagentState = (() => {
|
|
2253
|
+
const g = globalThis;
|
|
2254
|
+
const existing = g[GATEWAY_SUBAGENT_SYMBOL];
|
|
2255
|
+
if (existing) return existing;
|
|
2256
|
+
const created = { subagent: void 0 };
|
|
2257
|
+
g[GATEWAY_SUBAGENT_SYMBOL] = created;
|
|
2258
|
+
return created;
|
|
2259
|
+
})();
|
|
2260
|
+
/**
|
|
2261
|
+
* Set the process-global gateway subagent runtime.
|
|
2262
|
+
* Called during gateway startup so that gateway-bindable plugin runtimes can
|
|
2263
|
+
* resolve subagent methods dynamically even when their registry was cached
|
|
2264
|
+
* before the gateway finished loading plugins.
|
|
2265
|
+
*/
|
|
2266
|
+
function setGatewaySubagentRuntime(subagent) {
|
|
2267
|
+
gatewaySubagentState.subagent = subagent;
|
|
2268
|
+
}
|
|
2269
|
+
/**
|
|
2270
|
+
* Reset the process-global gateway subagent runtime.
|
|
2271
|
+
* Used by tests to avoid leaking gateway state across module reloads.
|
|
2272
|
+
*/
|
|
2273
|
+
function clearGatewaySubagentRuntime() {
|
|
2274
|
+
gatewaySubagentState.subagent = void 0;
|
|
2275
|
+
}
|
|
2276
|
+
/**
|
|
2277
|
+
* Create a late-binding subagent that resolves to:
|
|
2278
|
+
* 1. An explicitly provided subagent (from runtimeOptions), OR
|
|
2279
|
+
* 2. The process-global gateway subagent when the caller explicitly opts in, OR
|
|
2280
|
+
* 3. The unavailable fallback (throws with a clear error message).
|
|
2281
|
+
*/
|
|
2282
|
+
function createLateBindingSubagent(explicit, allowGatewaySubagentBinding = false) {
|
|
2283
|
+
if (explicit) return explicit;
|
|
2284
|
+
const unavailable = createUnavailableSubagentRuntime();
|
|
2285
|
+
if (!allowGatewaySubagentBinding) return unavailable;
|
|
2286
|
+
return new Proxy(unavailable, { get(_target, prop, _receiver) {
|
|
2287
|
+
const resolved = gatewaySubagentState.subagent ?? unavailable;
|
|
2288
|
+
return Reflect.get(resolved, prop, resolved);
|
|
2289
|
+
} });
|
|
2290
|
+
}
|
|
2291
|
+
function createPluginRuntime(_options = {}) {
|
|
2292
|
+
return {
|
|
2293
|
+
version: resolveVersion(),
|
|
2294
|
+
config: createRuntimeConfig(),
|
|
2295
|
+
agent: createRuntimeAgent(),
|
|
2296
|
+
subagent: createLateBindingSubagent(_options.subagent, _options.allowGatewaySubagentBinding === true),
|
|
2297
|
+
system: createRuntimeSystem(),
|
|
2298
|
+
media: createRuntimeMedia(),
|
|
2299
|
+
tts: {
|
|
2300
|
+
textToSpeech,
|
|
2301
|
+
textToSpeechTelephony,
|
|
2302
|
+
listVoices: listSpeechVoices
|
|
2303
|
+
},
|
|
2304
|
+
mediaUnderstanding: {
|
|
2305
|
+
runFile: runMediaUnderstandingFile,
|
|
2306
|
+
describeImageFile,
|
|
2307
|
+
describeImageFileWithModel,
|
|
2308
|
+
describeVideoFile,
|
|
2309
|
+
transcribeAudioFile
|
|
2310
|
+
},
|
|
2311
|
+
imageGeneration: {
|
|
2312
|
+
generate: generateImage,
|
|
2313
|
+
listProviders: listRuntimeImageGenerationProviders
|
|
2314
|
+
},
|
|
2315
|
+
webSearch: {
|
|
2316
|
+
listProviders: listWebSearchProviders,
|
|
2317
|
+
search: runWebSearch
|
|
2318
|
+
},
|
|
2319
|
+
stt: { transcribeAudioFile },
|
|
2320
|
+
tools: createRuntimeTools(),
|
|
2321
|
+
channel: createRuntimeChannel(),
|
|
2322
|
+
events: createRuntimeEvents(),
|
|
2323
|
+
logging: createRuntimeLogging(),
|
|
2324
|
+
state: { resolveStateDir },
|
|
2325
|
+
modelAuth: {
|
|
2326
|
+
getApiKeyForModel: (params) => getApiKeyForModel({
|
|
2327
|
+
model: params.model,
|
|
2328
|
+
cfg: params.cfg
|
|
2329
|
+
}),
|
|
2330
|
+
resolveApiKeyForProvider: (params) => resolveApiKeyForProvider({
|
|
2331
|
+
provider: params.provider,
|
|
2332
|
+
cfg: params.cfg
|
|
2333
|
+
})
|
|
2334
|
+
}
|
|
2335
|
+
};
|
|
2336
|
+
}
|
|
2337
|
+
//#endregion
|
|
2338
|
+
export { createPluginRuntime as n, setGatewaySubagentRuntime as r, clearGatewaySubagentRuntime as t };
|