@spacebar_ai/moldclaw-core 2026.3.14 → 2026.3.16
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/README.md +108 -3
- package/dist/account-id-plS5L20e.d.ts +1 -0
- package/dist/accounts-BAYVGC2k.js +109 -0
- package/dist/accounts-DrjRgReV.d.ts +103 -0
- package/dist/acp-cli-at_UYEOS.js +2088 -0
- package/dist/acpx-Chy1GQ_k.d.ts +5 -0
- package/dist/actions.runtime-C0F7dMfO.js +114 -0
- package/dist/actions.runtime-caI2LG9o.js +128 -0
- package/dist/agent-media-payload-CkpAqaOh.d.ts +16 -0
- package/dist/agents-B98yPGc5.js +853 -0
- package/dist/agents-BrLr08L3.js +217 -0
- package/dist/allow-from-BIwT4dl7.d.ts +42 -0
- package/dist/allow-list-CHt7yvAf.js +81 -0
- package/dist/allowlist-CxQo2wQc.js +142 -0
- package/dist/allowlist-resolution-B7ib7gye.d.ts +17 -0
- package/dist/api-Co7TNHbL.js +6953 -0
- package/dist/api-cEQ_ql_8.js +112 -0
- package/dist/audit-AnKnnlaZ.js +787 -0
- package/dist/audit-channel.collect.runtime-CAk1DFQ3.js +600 -0
- package/dist/audit-channel.runtime-5phdZp_m.js +116 -0
- package/dist/audit-extra.async-B8ZXFxic.js +813 -0
- package/dist/audit-hdKa3D-u.js +54 -0
- package/dist/audit-membership-runtime-CJV5XvGU.js +157 -0
- package/dist/audit.deep.runtime-DNMcRQrp.js +24 -0
- package/dist/audit.nondeep.runtime-DhNDL6yM.js +831 -0
- package/dist/audit.runtime-Bx7uWEh8.js +113 -0
- package/dist/auth-choice-C37W9MA7.js +268 -0
- package/dist/auth-choice-CNppOY_V.js +117 -0
- package/dist/auth-choice-XYFnp6fI.js +502 -0
- package/dist/auth-choice-options-D6oZY4Xo.js +123 -0
- package/dist/auth-choice-prompt-BhRqchJx.js +110 -0
- package/dist/auth-choice-prompt-C1xv0N08.js +36 -0
- package/dist/auth-choice.plugin-providers.runtime-DhLEtbmR.js +114 -0
- package/dist/auth-profiles-9zZdaXJK.js +127756 -0
- package/dist/auth-profiles.runtime-HONFDgiu.js +111 -0
- package/dist/bluebubbles-BY8JhO4y.js +64 -0
- package/dist/bluebubbles-CQjEnzK_.d.ts +6 -0
- package/dist/bluebubbles-RmcKgkBa.d.ts +45 -0
- package/dist/boolean-param-F1sMwnPu.d.ts +5 -0
- package/dist/bot-BGh-ATV7.d.ts +478 -0
- package/dist/brave-CljenznH.js +24 -0
- package/dist/browser-cli-CX8i0wf0.js +1492 -0
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.d.ts +6 -0
- package/dist/bundled/boot-md/handler.js +26 -26
- package/dist/bundled/bootstrap-extra-files/handler.d.ts +6 -0
- package/dist/bundled/command-logger/handler.d.ts +9 -0
- package/dist/bundled/session-memory/handler.d.ts +9 -0
- package/dist/bundled/session-memory/handler.js +27 -27
- package/dist/call-Bc257L16.js +37 -0
- package/dist/call-DYFR7oGy.js +639 -0
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/channel-Bd-igGEW.js +803 -0
- package/dist/channel-BgRMb6bZ.js +575 -0
- package/dist/channel-BtcLrU6J.js +1598 -0
- package/dist/channel-Bwf6m_hD.js +538 -0
- package/dist/channel-C7-kgDBd.js +562 -0
- package/dist/channel-CEXOAxIc.js +949 -0
- package/dist/channel-CpZ3p9MJ.js +226 -0
- package/dist/channel-CqBlN6A2.js +619 -0
- package/dist/channel-DKhfHW4U.js +352 -0
- package/dist/channel-DS3t_KdJ2.js +316 -0
- package/dist/channel-DY24FA1v.js +4681 -0
- package/dist/channel-DYFGmImJ.js +542 -0
- package/dist/channel-DcyIqX5p.js +207 -0
- package/dist/channel-J-2XcAli.js +214 -0
- package/dist/channel-N616f4gZ.js +306 -0
- package/dist/channel-NY7aU2Gj.js +397 -0
- package/dist/channel-PNI8BOmm.js +1321 -0
- package/dist/channel-UcXepDJs.js +943 -0
- package/dist/channel-account-context-CL3hEq1j.js +103 -0
- package/dist/channel-config-schema-Q2nzcCCR.d.ts +1 -0
- package/dist/channel-jA_jodJo.js +920 -0
- package/dist/channel-options-CtgU5qkG.js +50 -0
- package/dist/channel-policy-7wXDp6d3.d.ts +1 -0
- package/dist/channel-rGI8uig4.js +497 -0
- package/dist/channel-summary-DGJZXo0r.js +106 -0
- package/dist/channel.runtime--WZvlNJM.js +413 -0
- package/dist/channel.runtime-B0ct42DL.js +122 -0
- package/dist/channel.runtime-BEZUZrYB.js +177 -0
- package/dist/channel.runtime-BMuWmsIC.js +166 -0
- package/dist/channel.runtime-BtvHP0po.js +4006 -0
- package/dist/channel.runtime-Cwf993pX.js +194 -0
- package/dist/channel.runtime-Cy4lEpTX.js +174 -0
- package/dist/channel.runtime-DAz6axda.js +865 -0
- package/dist/channel.runtime-DdQ2mOVh.js +236 -0
- package/dist/channel.runtime-Dy3HPgOU.js +399 -0
- package/dist/channel.runtime-iqfC25k7.js +213 -0
- package/dist/channel.setup-B4VYMZlQ.js +9 -0
- package/dist/channel.setup-BohGbCbI.js +57 -0
- package/dist/channel.setup-Bq2AQqqc.js +6 -0
- package/dist/channel.setup-BxiSfLp1.js +8 -0
- package/dist/channel.setup-DOUS6fjO.js +8 -0
- package/dist/channel.setup-DXhdYU3g.js +9 -0
- package/dist/channel.setup-N51CgfNy.js +11 -0
- package/dist/channels/plugins/actions/discord.d.ts +3 -0
- package/dist/channels/plugins/actions/discord.js +26 -26
- package/dist/channels/plugins/actions/signal.d.ts +2 -0
- package/dist/channels/plugins/actions/signal.js +26 -26
- package/dist/channels/plugins/actions/telegram.d.ts +3 -0
- package/dist/channels/plugins/actions/telegram.js +26 -26
- package/dist/channels/plugins/agent-tools/whatsapp-login.d.ts +4 -0
- package/dist/channels/plugins/agent-tools/whatsapp-login.js +26 -26
- package/dist/channels-CueeFf0q.js +404 -0
- package/dist/channels-PheAd73E.js +1113 -0
- package/dist/channels-cli-CXzVF84v.js +286 -0
- package/dist/channels-status-issues-BjWBQHhU.js +16 -0
- package/dist/chat-type-BlSN0vo4.d.ts +5 -0
- package/dist/clawbot-cli-BBehDXW1.js +113 -0
- package/dist/cli/daemon-cli.d.ts +58 -0
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/cli-CIm7d5Id.js +149 -0
- package/dist/command-format-pq3tS8t2.d.ts +4 -0
- package/dist/command-registry-CDkp__KH.js +13 -0
- package/dist/command-registry-DSEkUBW1.js +212 -0
- package/dist/command-secret-gateway-CqP_o0n8.js +106 -0
- package/dist/compact.runtime-Qm_csEtG.js +111 -0
- package/dist/completion-cli-Ch1sgSLQ.js +445 -0
- package/dist/completion-cli-vF067Tso.js +16 -0
- package/dist/config-B2W1zTP1.js +44 -0
- package/dist/config-CMhKplgO.js +938 -0
- package/dist/config-DchtRsvs.js +30 -0
- package/dist/config-cli-C41d88_c.js +428 -0
- package/dist/config-guard-B_vjkXCQ.js +117 -0
- package/dist/config-schema-pPBCF4hz.js +31 -0
- package/dist/config-validation-6om9cBUx.js +262 -0
- package/dist/config-value-Dl3XEpA6.js +132 -0
- package/dist/configure-BxzvDSzu.js +1100 -0
- package/dist/configure-CLMLoWAn.js +238 -0
- package/dist/control-ui-shared-E8Nz6uKZ.js +29 -0
- package/dist/core-Cd3fMFKq.d.ts +87 -0
- package/dist/credentials-yYt6VWCq.js +268 -0
- package/dist/cron-cli-CA3lV3kh.js +634 -0
- package/dist/daemon-cli-BtQuIXEk.js +339 -0
- package/dist/daemon-install-BWKGzgMm.js +175 -0
- package/dist/deliver-CgMNmfTy.js +106 -0
- package/dist/deliver-runtime-Bn1KWoiQ.js +106 -0
- package/dist/devices-cli-D601npiL.js +340 -0
- package/dist/diagnostic-CkiYEGqt.js +310 -0
- package/dist/diffs-B5tZ8Coj.d.ts +1 -0
- package/dist/directory-cli-skEV8MT7.js +306 -0
- package/dist/directory-config-helpers-B-tiBKIv.d.ts +38 -0
- package/dist/directory-runtime-BEJ2fCIR.d.ts +1 -0
- package/dist/directory.static-CnyzoWbV.js +44 -0
- package/dist/discord-B_gbzPti.js +109 -0
- package/dist/discovery-CqI-e_Mv.js +48 -0
- package/dist/dm-policy-shared-nybkS1uP.d.ts +95 -0
- package/dist/dns-cli-Cjes3Ruw.js +216 -0
- package/dist/docs-cli-C3g3Gi_d.js +173 -0
- package/dist/doctor-completion-TvgV4SZH.js +90 -0
- package/dist/doctor-config-flow-0w9Ux7V8.js +107 -0
- package/dist/doctor-config-flow-DLzr8W7Y.js +2437 -0
- package/dist/enable-VYzv8b2z.js +24 -0
- package/dist/entry.d.ts +7 -0
- package/dist/entry.js +1 -1
- package/dist/env-overrides-DYVIkuvN.js +434 -0
- package/dist/env-overrides.runtime-6kijpIuu.js +17 -0
- package/dist/exec-approvals-cli-D_lkTG-l.js +419 -0
- package/dist/exec-sVmouhA9.d.ts +39 -0
- package/dist/extensions/acpx/index.d.ts +11 -0
- package/dist/extensions/acpx/index.js +1 -1
- package/dist/extensions/amazon-bedrock/index.d.ts +11 -0
- package/dist/extensions/anthropic/index.d.ts +11 -0
- package/dist/extensions/anthropic/index.js +26 -26
- package/dist/extensions/bluebubbles/index.d.ts +11 -0
- package/dist/extensions/bluebubbles/index.js +30 -30
- package/dist/extensions/bluebubbles/setup-entry.d.ts +59 -0
- package/dist/extensions/bluebubbles/setup-entry.js +30 -30
- package/dist/extensions/brave/index.d.ts +11 -0
- package/dist/extensions/brave/index.js +2 -2
- package/dist/extensions/byteplus/index.d.ts +11 -0
- package/dist/extensions/byteplus/index.js +26 -26
- package/dist/extensions/cloudflare-ai-gateway/index.d.ts +11 -0
- package/dist/extensions/cloudflare-ai-gateway/index.js +27 -27
- package/dist/extensions/copilot-proxy/index.d.ts +11 -0
- package/dist/extensions/device-pair/index.d.ts +12 -0
- package/dist/extensions/diagnostics-otel/index.d.ts +11 -0
- package/dist/extensions/diffs/index.d.ts +11 -0
- package/dist/extensions/discord/index.d.ts +11 -0
- package/dist/extensions/discord/index.js +31 -31
- package/dist/extensions/discord/setup-entry.d.ts +7 -0
- package/dist/extensions/discord/setup-entry.js +29 -29
- package/dist/extensions/elevenlabs/index.d.ts +11 -0
- package/dist/extensions/elevenlabs/index.js +26 -26
- package/dist/extensions/feishu/index.d.ts +229 -0
- package/dist/extensions/feishu/index.js +31 -31
- package/dist/extensions/feishu/setup-entry.d.ts +9 -0
- package/dist/extensions/feishu/setup-entry.js +28 -28
- package/dist/extensions/firecrawl/index.d.ts +11 -0
- package/dist/extensions/firecrawl/index.js +26 -26
- package/dist/extensions/github-copilot/index.d.ts +11 -0
- package/dist/extensions/github-copilot/index.js +27 -27
- package/dist/extensions/google/index.d.ts +11 -0
- package/dist/extensions/google/index.js +26 -26
- package/dist/extensions/googlechat/index.d.ts +11 -0
- package/dist/extensions/googlechat/index.js +30 -30
- package/dist/extensions/googlechat/setup-entry.d.ts +19 -0
- package/dist/extensions/googlechat/setup-entry.js +30 -30
- package/dist/extensions/huggingface/index.d.ts +11 -0
- package/dist/extensions/huggingface/index.js +26 -26
- package/dist/extensions/imessage/index.d.ts +11 -0
- package/dist/extensions/imessage/index.js +30 -30
- package/dist/extensions/imessage/setup-entry.d.ts +7 -0
- package/dist/extensions/imessage/setup-entry.js +30 -30
- package/dist/extensions/irc/index.d.ts +11 -0
- package/dist/extensions/irc/index.js +29 -29
- package/dist/extensions/irc/setup-entry.d.ts +8 -0
- package/dist/extensions/irc/setup-entry.js +29 -29
- package/dist/extensions/kakao-talkchannel/index.d.ts +19 -0
- package/dist/extensions/kakao-talkchannel/index.js +1762 -0
- package/dist/extensions/kakao-talkchannel/moldclaw.plugin.json +111 -0
- package/dist/extensions/kakao-talkchannel/package.json +12 -0
- package/dist/extensions/kilocode/index.d.ts +11 -0
- package/dist/extensions/kilocode/index.js +26 -26
- package/dist/extensions/kimi-coding/index.d.ts +11 -0
- package/dist/extensions/kimi-coding/index.js +26 -26
- package/dist/extensions/line/index.d.ts +11 -0
- package/dist/extensions/line/index.js +28 -28
- package/dist/extensions/line/setup-entry.d.ts +7 -0
- package/dist/extensions/line/setup-entry.js +28 -28
- package/dist/extensions/llm-task/index.d.ts +11 -0
- package/dist/extensions/llm-task/index.js +28 -28
- package/dist/extensions/lobster/index.d.ts +11 -0
- package/dist/extensions/matrix/index.d.ts +11 -0
- package/dist/extensions/matrix/index.js +31 -31
- package/dist/extensions/matrix/setup-entry.d.ts +20 -0
- package/dist/extensions/matrix/setup-entry.js +31 -31
- package/dist/extensions/mattermost/index.d.ts +11 -0
- package/dist/extensions/mattermost/index.js +28 -28
- package/dist/extensions/mattermost/setup-entry.d.ts +88 -0
- package/dist/extensions/mattermost/setup-entry.js +28 -28
- package/dist/extensions/memory-core/index.d.ts +11 -0
- package/dist/extensions/memory-lancedb/index.d.ts +25 -0
- package/dist/extensions/microsoft/index.d.ts +11 -0
- package/dist/extensions/microsoft/index.js +26 -26
- package/dist/extensions/minimax/index.d.ts +11 -0
- package/dist/extensions/minimax/index.js +26 -26
- package/dist/extensions/mistral/index.d.ts +11 -0
- package/dist/extensions/mistral/index.js +26 -26
- package/dist/extensions/modelstudio/index.d.ts +11 -0
- package/dist/extensions/modelstudio/index.js +26 -26
- package/dist/extensions/moonshot/index.d.ts +11 -0
- package/dist/extensions/moonshot/index.js +26 -26
- package/dist/extensions/msteams/index.d.ts +11 -0
- package/dist/extensions/msteams/index.js +31 -31
- package/dist/extensions/msteams/setup-entry.d.ts +11 -0
- package/dist/extensions/msteams/setup-entry.js +31 -31
- package/dist/extensions/nextcloud-talk/index.d.ts +11 -0
- package/dist/extensions/nextcloud-talk/index.js +28 -28
- package/dist/extensions/nextcloud-talk/setup-entry.d.ts +60 -0
- package/dist/extensions/nextcloud-talk/setup-entry.js +28 -28
- package/dist/extensions/nostr/index.d.ts +11 -0
- package/dist/extensions/nostr/index.js +28 -28
- package/dist/extensions/nostr/setup-entry.d.ts +49 -0
- package/dist/extensions/nostr/setup-entry.js +28 -28
- package/dist/extensions/nvidia/index.d.ts +11 -0
- package/dist/extensions/ollama/index.d.ts +11 -0
- package/dist/extensions/open-prose/index.d.ts +11 -0
- package/dist/extensions/openai/index.d.ts +11 -0
- package/dist/extensions/openai/index.js +26 -26
- package/dist/extensions/opencode/index.d.ts +11 -0
- package/dist/extensions/opencode/index.js +26 -26
- package/dist/extensions/opencode-go/index.d.ts +11 -0
- package/dist/extensions/opencode-go/index.js +26 -26
- package/dist/extensions/openrouter/index.d.ts +11 -0
- package/dist/extensions/openrouter/index.js +26 -26
- package/dist/extensions/openshell/index.d.ts +11 -0
- package/dist/extensions/openshell/index.js +26 -26
- package/dist/extensions/perplexity/index.d.ts +11 -0
- package/dist/extensions/perplexity/index.js +2 -2
- package/dist/extensions/phone-control/index.d.ts +12 -0
- package/dist/extensions/qianfan/index.d.ts +11 -0
- package/dist/extensions/qianfan/index.js +26 -26
- package/dist/extensions/qwen-portal-auth/index.d.ts +12 -0
- package/dist/extensions/qwen-portal-auth/index.js +26 -26
- package/dist/extensions/sglang/index.d.ts +11 -0
- package/dist/extensions/sglang/index.js +26 -26
- package/dist/extensions/signal/index.d.ts +11 -0
- package/dist/extensions/signal/index.js +29 -29
- package/dist/extensions/signal/setup-entry.d.ts +7 -0
- package/dist/extensions/signal/setup-entry.js +29 -29
- package/dist/extensions/slack/index.d.ts +11 -0
- package/dist/extensions/slack/index.js +30 -30
- package/dist/extensions/slack/setup-entry.d.ts +7 -0
- package/dist/extensions/slack/setup-entry.js +29 -29
- package/dist/extensions/synology-chat/index.d.ts +11 -0
- package/dist/extensions/synology-chat/index.js +28 -28
- package/dist/extensions/synology-chat/setup-entry.d.ts +138 -0
- package/dist/extensions/synology-chat/setup-entry.js +28 -28
- package/dist/extensions/synthetic/index.d.ts +11 -0
- package/dist/extensions/synthetic/index.js +26 -26
- package/dist/extensions/talk-voice/index.d.ts +12 -0
- package/dist/extensions/talk-voice/index.js +26 -26
- package/dist/extensions/telegram/index.d.ts +11 -0
- package/dist/extensions/telegram/index.js +29 -29
- package/dist/extensions/telegram/setup-entry.d.ts +7 -0
- package/dist/extensions/telegram/setup-entry.js +28 -28
- package/dist/extensions/thread-ownership/index.d.ts +12 -0
- package/dist/extensions/tlon/index.d.ts +11 -0
- package/dist/extensions/tlon/index.js +28 -28
- package/dist/extensions/tlon/setup-entry.d.ts +7 -0
- package/dist/extensions/tlon/setup-entry.js +28 -28
- package/dist/extensions/together/index.d.ts +11 -0
- package/dist/extensions/together/index.js +26 -26
- package/dist/extensions/twitch/index.d.ts +39 -0
- package/dist/extensions/twitch/index.js +28 -28
- package/dist/extensions/venice/index.d.ts +11 -0
- package/dist/extensions/venice/index.js +26 -26
- package/dist/extensions/vercel-ai-gateway/index.d.ts +11 -0
- package/dist/extensions/vercel-ai-gateway/index.js +26 -26
- package/dist/extensions/vllm/index.d.ts +11 -0
- package/dist/extensions/vllm/index.js +26 -26
- package/dist/extensions/voice-call/index.d.ts +11 -0
- package/dist/extensions/voice-call/index.js +26 -26
- package/dist/extensions/volcengine/index.d.ts +11 -0
- package/dist/extensions/volcengine/index.js +26 -26
- package/dist/extensions/whatsapp/index.d.ts +11 -0
- package/dist/extensions/whatsapp/index.js +29 -29
- package/dist/extensions/whatsapp/setup-entry.d.ts +7 -0
- package/dist/extensions/whatsapp/setup-entry.js +29 -29
- package/dist/extensions/xai/index.d.ts +11 -0
- package/dist/extensions/xai/index.js +26 -26
- package/dist/extensions/xiaomi/index.d.ts +11 -0
- package/dist/extensions/xiaomi/index.js +26 -26
- package/dist/extensions/zai/index.d.ts +11 -0
- package/dist/extensions/zai/index.js +26 -26
- package/dist/extensions/zalo/index.d.ts +11 -0
- package/dist/extensions/zalo/index.js +30 -30
- package/dist/extensions/zalo/setup-entry.d.ts +34 -0
- package/dist/extensions/zalo/setup-entry.js +30 -30
- package/dist/extensions/zalouser/index.d.ts +11 -0
- package/dist/extensions/zalouser/index.js +31 -31
- package/dist/extensions/zalouser/setup-entry.d.ts +42 -0
- package/dist/extensions/zalouser/setup-entry.js +31 -31
- package/dist/feishu-DCKEC3ao.d.ts +36 -0
- package/dist/gateway-cli-DN1Ii6J-.js +26432 -0
- package/dist/gateway-install-token-CJYFJBaC.js +163 -0
- package/dist/gateway-rpc-CroQg9MB.js +26 -0
- package/dist/gateway-runtime-D9FRZqKP.js +69 -0
- package/dist/googlechat-CBCkerAy.js +307 -0
- package/dist/googlechat-CSUNieHX.d.ts +12 -0
- package/dist/group-access-rSvkIglb.d.ts +61 -0
- package/dist/health-B6WwLJp4.js +570 -0
- package/dist/health-CAlJydXv.js +108 -0
- package/dist/history-BwNxb0sJ.d.ts +75 -0
- package/dist/hooks-BYlfU3Nf.d.ts +6 -0
- package/dist/hooks-cli-DuKmdo_H.js +995 -0
- package/dist/http-registry-DX_LVtuK.d.ts +20 -0
- package/dist/image-generation-DKkdRpve.d.ts +9 -0
- package/dist/imessage-7abjbe2Q.js +31 -0
- package/dist/imessage-DOH1yaDE.js +110 -0
- package/dist/inbound-envelope-CmvweL6U.d.ts +78 -0
- package/dist/inbound-reply-dispatch-BvnKTOec.js +71 -0
- package/dist/inbound-reply-dispatch-C7LjHRZN.d.ts +72 -0
- package/dist/index-DTQqfqj9.d.ts +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +2 -2
- package/dist/infra/warning-filter.d.ts +10 -0
- package/dist/install-target-tXRD7VkM.js +574 -0
- package/dist/installs-C8fz8sm3.js +532 -0
- package/dist/io-C6XifaT4.js +9737 -0
- package/dist/io-C8awRnSW.js +28 -0
- package/dist/ipv4-d88_Jn2p.js +82 -0
- package/dist/irc-DpR6FXjN.js +672 -0
- package/dist/json-store-Sr_kk-II.d.ts +14 -0
- package/dist/keyed-async-queue-BA3BKukE.d.ts +19 -0
- package/dist/library-DOwowAGN.js +107 -0
- package/dist/lifecycle-core-BHHBoRTY.js +382 -0
- package/dist/line/accounts.d.ts +3 -0
- package/dist/line/send.d.ts +2 -0
- package/dist/line/send.js +4 -4
- package/dist/line/template-messages.d.ts +2 -0
- package/dist/line-8rsNbJCP.js +530 -0
- package/dist/line-D_cvIf6B.d.ts +75 -0
- package/dist/links-BOnvOj1z.d.ts +7 -0
- package/dist/llm-slug-generator-D9HjWtJT.js +67 -0
- package/dist/llm-slug-generator.d.ts +12 -0
- package/dist/llm-slug-generator.js +27 -27
- package/dist/logging-BhqLWxTD.js +13 -0
- package/dist/logging-DfaiL4OX.js +29 -0
- package/dist/login-qr-COBYR52w.js +233 -0
- package/dist/login-qr-xK4QIpPc.js +107 -0
- package/dist/logs-cli-RSSTw8L_.js +254 -0
- package/dist/manager-runtime-DL6JoSj9.js +106 -0
- package/dist/manager.runtime-Cbyhg1vB.js +710 -0
- package/dist/markdown-to-line-BTlEkOls.d.ts +91 -0
- package/dist/matrix-DX-jaB88.js +1490 -0
- package/dist/matrix-H6Yyj1QZ.d.ts +68 -0
- package/dist/matrix-J8s45tRw.js +1269 -0
- package/dist/mattermost-D75n6bRI.d.ts +6 -0
- package/dist/mcp-cli-CLc3_yCO.js +86 -0
- package/dist/media-understanding.runtime-BI0Lljbl.js +111 -0
- package/dist/memory-cli-CTp2cYrf.js +106 -0
- package/dist/method-scopes-Du8ODGFW.js +2586 -0
- package/dist/model-auth-markers-DEDakSUW.d.ts +20 -0
- package/dist/model-picker-CDBs7LJF.js +390 -0
- package/dist/model-picker-CRix4Wwv.js +107 -0
- package/dist/model-picker.runtime-CITyy3Rn.js +120 -0
- package/dist/model-suppression.runtime-Ce7D6QUT.js +111 -0
- package/dist/models-BK1eanuP.js +113 -0
- package/dist/models-X4Czy3uE.js +2514 -0
- package/dist/models-cli-C79Ulviy.js +304 -0
- package/dist/models-config-DALlu3S9.js +106 -0
- package/dist/models-config.providers.discovery-CSJ1STM1.d.ts +18 -0
- package/dist/monitor-B45a_RpX.js +3468 -0
- package/dist/monitor-C8KbJ-i0.js +767 -0
- package/dist/monitor-CIhrvegZ.js +3076 -0
- package/dist/monitor-CQut7klP.js +6823 -0
- package/dist/monitor-DZb5IJle.js +777 -0
- package/dist/monitor-DaFkdD27.js +108 -0
- package/dist/monitor-Do9Tp2Ii.js +110 -0
- package/dist/monitor-shared-CMK9cDOb.js +444 -0
- package/dist/msteams-A6H_wv5F.js +852 -0
- package/dist/net-DpMJgN-o.d.ts +19 -0
- package/dist/nextcloud-talk-f1pZ5Bge.d.ts +1 -0
- package/dist/node-cli-BXnmsjzL.js +2498 -0
- package/dist/node-resolve-CupmrA0Y.js +835 -0
- package/dist/nodes-cli-DZVrah_8.js +1375 -0
- package/dist/nostr-DMV534Ks.d.ts +7 -0
- package/dist/nostr-SAk3tjtR.js +8744 -0
- package/dist/npm-resolution-Dr9wssCY.js +60 -0
- package/dist/oauth-utils-DnyXdWU9.d.ts +10 -0
- package/dist/onboard-BE5pmb1g.js +589 -0
- package/dist/onboard-channels-3hNVY0E7.js +1241 -0
- package/dist/onboard-channels-vaO3nWLL.js +200 -0
- package/dist/onboard-custom-CI5uFyWH.js +571 -0
- package/dist/onboard-custom-eIvRswgv.js +109 -0
- package/dist/onboard-helpers-ChMWfUnl.js +335 -0
- package/dist/onboard-helpers-DRFi9oaD.js +108 -0
- package/dist/onboard-remote-BTspTgA4.js +112 -0
- package/dist/onboard-remote-so38yXlX.js +181 -0
- package/dist/onboard-search-DS0tZS24.js +297 -0
- package/dist/onboard-skills-B9DxCCiU.js +133 -0
- package/dist/onboard-skills-so0a_BJV.js +112 -0
- package/dist/outbound-media-BiJscGlR.js +11 -0
- package/dist/outbound-media-DJF-TuJu.d.ts +11 -0
- package/dist/pairing-access-CuiJP9xN.d.ts +21 -0
- package/dist/pairing-cli-DN0u1Cez.js +212 -0
- package/dist/parse-finite-number-B3FJTjyQ.d.ts +5 -0
- package/dist/perplexity-Bw1u3CAF.js +24 -0
- package/dist/persistent-dedupe-DR5Ka6BX.d.ts +26 -0
- package/dist/pi-model-discovery-runtime-iwKNCaYu.js +106 -0
- package/dist/pi-tools.before-tool-call.runtime-BM_N-JZe.js +380 -0
- package/dist/plugin-install--KVul05Z.js +184 -0
- package/dist/plugin-install-DVpPsLkS.js +112 -0
- package/dist/plugin-install-plan-Dwc6-coz.js +49 -0
- package/dist/plugin-registry-XRswugE9.js +108 -0
- package/dist/plugin-registry-jozQafRo.js +49 -0
- package/dist/plugin-sdk/account-resolution.js +26 -26
- package/dist/plugin-sdk/acp-runtime.js +26 -26
- package/dist/plugin-sdk/acpx.js +1 -1
- package/dist/plugin-sdk/agent-runtime.js +26 -26
- package/dist/plugin-sdk/bluebubbles.js +29 -29
- package/dist/plugin-sdk/channel-config-helpers.js +26 -26
- package/dist/plugin-sdk/channel-config-schema.js +2 -2
- package/dist/plugin-sdk/channel-policy.js +26 -26
- package/dist/plugin-sdk/channel-runtime.js +26 -26
- package/dist/plugin-sdk/compat.js +27 -27
- package/dist/plugin-sdk/config-runtime.js +28 -28
- package/dist/plugin-sdk/conversation-runtime.js +26 -26
- package/dist/plugin-sdk/discord.js +26 -26
- package/dist/plugin-sdk/feishu.js +27 -27
- package/dist/plugin-sdk/gateway-runtime.js +8 -8
- package/dist/plugin-sdk/googlechat.js +29 -29
- package/dist/plugin-sdk/image-generation-runtime.js +26 -26
- package/dist/plugin-sdk/image-generation.js +26 -26
- package/dist/plugin-sdk/imessage.js +27 -27
- package/dist/plugin-sdk/index.js +26 -26
- package/dist/plugin-sdk/infra-runtime.js +26 -26
- package/dist/plugin-sdk/irc.js +29 -29
- package/dist/plugin-sdk/line.js +27 -27
- package/dist/plugin-sdk/llm-task.js +26 -26
- package/dist/plugin-sdk/matrix.js +29 -29
- package/dist/plugin-sdk/mattermost.js +28 -28
- package/dist/plugin-sdk/media-runtime.js +26 -26
- package/dist/plugin-sdk/media-understanding-runtime.js +26 -26
- package/dist/plugin-sdk/media-understanding.js +26 -26
- package/dist/plugin-sdk/msteams.js +30 -30
- package/dist/plugin-sdk/nextcloud-talk.js +28 -28
- package/dist/plugin-sdk/nostr.js +27 -27
- package/dist/plugin-sdk/plugin-runtime.js +26 -26
- package/dist/plugin-sdk/provider-auth.js +28 -28
- package/dist/plugin-sdk/provider-setup.js +27 -27
- package/dist/plugin-sdk/provider-web-search.js +1 -1
- package/dist/plugin-sdk/qwen-portal-auth.js +26 -26
- package/dist/plugin-sdk/reply-history.js +26 -26
- package/dist/plugin-sdk/reply-runtime.js +26 -26
- package/dist/plugin-sdk/sandbox.js +26 -26
- package/dist/plugin-sdk/security-runtime.js +26 -26
- package/dist/plugin-sdk/self-hosted-provider-setup.js +27 -27
- package/dist/plugin-sdk/setup.js +27 -27
- package/dist/plugin-sdk/signal.js +26 -26
- package/dist/plugin-sdk/slack.js +26 -26
- package/dist/plugin-sdk/speech-runtime.js +26 -26
- package/dist/plugin-sdk/speech.js +26 -26
- package/dist/plugin-sdk/src/channels/plugins/setup-wizard-helpers.d.ts +3 -0
- package/dist/plugin-sdk/src/config/config-lock.d.ts +38 -0
- package/dist/plugin-sdk/src/config/config.d.ts +1 -1
- package/dist/plugin-sdk/src/config/io.d.ts +39 -0
- package/dist/plugin-sdk/src/config/types.gateway.d.ts +12 -0
- package/dist/plugin-sdk/src/config/types.secrets.d.ts +10 -0
- package/dist/plugin-sdk/src/config/zod-schema.d.ts +2 -0
- package/dist/plugin-sdk/src/gateway/credential-planner.d.ts +3 -1
- package/dist/plugin-sdk/src/secrets/provider-env-vars.d.ts +61 -0
- package/dist/plugin-sdk/src/secrets/sec1-placeholder.d.ts +181 -0
- package/dist/plugin-sdk/src/secrets/sec1-utils.d.ts +57 -0
- package/dist/plugin-sdk/synology-chat.js +27 -27
- package/dist/plugin-sdk/telegram.js +26 -26
- package/dist/plugin-sdk/text-runtime.js +4 -4
- package/dist/plugin-sdk/tlon.js +27 -27
- package/dist/plugin-sdk/twitch.js +26 -26
- package/dist/plugin-sdk/voice-call.js +26 -26
- package/dist/plugin-sdk/whatsapp.js +26 -26
- package/dist/plugin-sdk/zalo.js +30 -30
- package/dist/plugin-sdk/zalouser.js +29 -29
- package/dist/plugins/runtime/index.d.ts +22 -0
- package/dist/plugins/runtime/index.js +26 -26
- package/dist/plugins-C4PiDdjc.js +106 -0
- package/dist/plugins-cli-zhmliYNU.js +912 -0
- package/dist/policy-CcSolumc.js +143 -0
- package/dist/preflight-audio.runtime-BAbfqqzW.js +111 -0
- package/dist/probe-Bgt5c-cr.js +129 -0
- package/dist/probe-CPk5iGcg.js +47 -0
- package/dist/probe-DR4KRKXz.js +19 -0
- package/dist/probe-DnoCyJ_m.js +1793 -0
- package/dist/probe-VsLtK3vQ.js +6328 -0
- package/dist/probe-auth-BnsKrQt7.js +38 -0
- package/dist/probe-auth-DYdUG8l1.js +48 -0
- package/dist/program-8enYYBsc.js +247 -0
- package/dist/prompt-select-styled-DxBcUasv.js +2673 -0
- package/dist/provider-api-key-auth.runtime-DsLZyt6h.js +116 -0
- package/dist/provider-auth-choice-30EvRxqc.js +126 -0
- package/dist/provider-auth-choice-preference-DMr1WmRg.js +189 -0
- package/dist/provider-auth-choice.runtime-CI98BgQF.js +118 -0
- package/dist/provider-auth-guidance-WKDIi_wk.js +34 -0
- package/dist/provider-auth-result-Cs8wguSI.d.ts +18 -0
- package/dist/provider-models-EOys_Nvi.d.ts +867 -0
- package/dist/provider-ollama-setup-D89zlm9C.d.ts +32 -0
- package/dist/provider-onboard-BzOpgCLu.d.ts +40 -0
- package/dist/provider-runtime.runtime-Cm4as2KG.js +106 -0
- package/dist/provider-self-hosted-setup-Bmv_AQmw.d.ts +61 -0
- package/dist/provider-self-hosted-setup-CJwFVVB4.js +182 -0
- package/dist/provider-usage-CVNyLLDb.js +106 -0
- package/dist/provider-usage.types-CdTymHNu.d.ts +16 -0
- package/dist/provider-web-search-BJhXD5dH.js +2392 -0
- package/dist/provider-wizard-DMMYXjlW.js +152 -0
- package/dist/push-apns-BnWTdTEk.js +1038 -0
- package/dist/pw-ai-CtK_7Cy2.js +1866 -0
- package/dist/qr-cli-CA-BF0--.js +108 -0
- package/dist/qr-cli-D18HiUkh.js +369 -0
- package/dist/reactions-Df7XG8Uh.js +281 -0
- package/dist/read-only-account-inspect.discord.runtime-B-FP0mwb.js +111 -0
- package/dist/read-only-account-inspect.slack.runtime-DkWZ2ccW.js +111 -0
- package/dist/read-only-account-inspect.telegram.runtime-BnlTkn_e.js +111 -0
- package/dist/redact-snapshot-DVdstBvO.js +2661 -0
- package/dist/ref-contract-RPkB754Q.js +53 -0
- package/dist/register.agent-DVAxXQKW.js +434 -0
- package/dist/register.backup-CUuL5KUZ.js +624 -0
- package/dist/register.configure-bC0UEwfU.js +247 -0
- package/dist/register.maintenance-iIqvl_eT.js +569 -0
- package/dist/register.message-CEDd4z07.js +704 -0
- package/dist/register.onboard-Cejfnysy.js +187 -0
- package/dist/register.setup-DU7uHdYt.js +207 -0
- package/dist/register.status-health-sessions-BWphMXNR.js +493 -0
- package/dist/register.subclis-DnIweTEG.js +315 -0
- package/dist/register.subclis-gJX_Pbub.js +12 -0
- package/dist/registry-Dgwc-7eS.js +1183 -0
- package/dist/replies-D9PEZ8yn.js +110 -0
- package/dist/reply-history-lHgoC4l3.d.ts +1 -0
- package/dist/reply-payload-Bd2HuR4g.d.ts +46 -0
- package/dist/request-url-BcSJaiiu.d.ts +5 -0
- package/dist/resolve-BbsCHGLY.js +660 -0
- package/dist/resolve-channels-BtrGC95o.js +262 -0
- package/dist/resolve-channels-C1SthO1N.js +226 -0
- package/dist/resolve-users-CgSxHrU0.js +143 -0
- package/dist/routes-BZtqNrBf.js +7097 -0
- package/dist/rpc-D3KMxG4J.js +67 -0
- package/dist/run-command-C8b3dCZV.d.ts +16 -0
- package/dist/run-main-BlWJVotF.js +423 -0
- package/dist/runtime-RWGbO5Qy.d.ts +26 -0
- package/dist/runtime-discord-ops.runtime-DUXIYvQr.js +9073 -0
- package/dist/runtime-slack-ops.runtime-n1yFfyp1.js +4551 -0
- package/dist/runtime-telegram-ops.runtime-PZUWchjT.js +128 -0
- package/dist/runtime-whatsapp-login.runtime-xsuNyvGz.js +109 -0
- package/dist/runtime-whatsapp-outbound.runtime-5EfEyCsO.js +112 -0
- package/dist/sandbox-cli-Dw1nWNmQ.js +530 -0
- package/dist/search-manager-BJoRxOaf.js +15 -0
- package/dist/search-manager-DxkQvUrW.js +386 -0
- package/dist/secret-input-schema-Cp_La9qv.d.ts +19 -0
- package/dist/secrets-cli-BPyV2gSq.js +2065 -0
- package/dist/security-cli-EK4sSRfG.js +570 -0
- package/dist/send-B01Gvh9m.js +629 -0
- package/dist/send-B4L4wRJO.js +100 -0
- package/dist/send-BDcGrXt0.js +1025 -0
- package/dist/send-BRRtHxyR.js +283 -0
- package/dist/send-DU6dmMXW.js +631 -0
- package/dist/server-CWw5GFEg.js +106 -0
- package/dist/server-node-events-92cDVswC.js +501 -0
- package/dist/session-key-DbkfhOjM.d.ts +46 -0
- package/dist/sessions-B052uHA3.js +218 -0
- package/dist/sessions-Cef4dZNP.js +107 -0
- package/dist/setup-BlQPyDPy.js +387 -0
- package/dist/setup-DcSZ_pTn.d.ts +37 -0
- package/dist/setup-core-B9mdZYnU.js +166 -0
- package/dist/setup-core-Cj0sLkpP.js +47 -0
- package/dist/setup-core-CkZbebOv.js +143 -0
- package/dist/setup-core-MRNjnrJl.js +205 -0
- package/dist/setup-surface-3ZY0JtWE.js +490 -0
- package/dist/setup-wizard-helpers-Dwzb9Dcz.d.ts +203 -0
- package/dist/setup.finalize-B5ETm3Ui.js +517 -0
- package/dist/setup.gateway-config-C8hdtlbw.js +338 -0
- package/dist/setup.secret-input-BZSIeiqy.js +25 -0
- package/dist/shared--9_eQ_lc.js +75 -0
- package/dist/shared-CxkH3H0U.js +102 -0
- package/dist/shared-DTNL0hA9.js +298 -0
- package/dist/shared-HSP1OV-Q.js +96 -0
- package/dist/shared-UIjWb_3B.js +182 -0
- package/dist/signal-CTI6bSmB.js +109 -0
- package/dist/skills-4-r1mfJM.js +853 -0
- package/dist/skills-RNm54CBO.js +19 -0
- package/dist/skills-cli-te7dSs5p.js +291 -0
- package/dist/skills-install-Del-Ogv8.js +763 -0
- package/dist/skills-status-BZpoMXrR.js +169 -0
- package/dist/skills-status-Dq61Sz8U.js +20 -0
- package/dist/slack-oc-viUtl.js +109 -0
- package/dist/slash-commands.runtime-NdkD2LZV.js +123 -0
- package/dist/slash-dispatch.runtime-DQgeaF3J.js +136 -0
- package/dist/slash-skill-commands.runtime-DmOl2DnL.js +111 -0
- package/dist/src-0wtt7seR.js +1696 -0
- package/dist/status-5oR_gqv_.js +121 -0
- package/dist/status-BO8LY0hC.js +1599 -0
- package/dist/status-D_oHA9yO.js +126 -0
- package/dist/status-IrMacJRj.js +606 -0
- package/dist/status-Prdeg53E.js +43 -0
- package/dist/status-json-Da0hR-1Z.js +286 -0
- package/dist/status.link-channel-BgUJEZAz.js +138 -0
- package/dist/status.scan.deps.runtime-D9vHTxOW.js +121 -0
- package/dist/status.scan.runtime-D-EdD5CW.js +114 -0
- package/dist/status.summary--i6xduWH.js +592 -0
- package/dist/status.summary.runtime-BqMXjaBc.js +113 -0
- package/dist/subagent-orphan-recovery-DiRJcFQc.js +302 -0
- package/dist/subagent-registry-runtime-B66EYEYm.js +106 -0
- package/dist/synology-chat-BemXqdzG.js +297 -0
- package/dist/system-cli-CSuiia4-.js +92 -0
- package/dist/telegram/audit.d.ts +2 -0
- package/dist/telegram/audit.js +1 -1
- package/dist/telegram/token.d.ts +2 -0
- package/dist/telegram/token.js +26 -26
- package/dist/telegram-DLFcRv5a.js +109 -0
- package/dist/testing-DZrulv-n.d.ts +1755 -0
- package/dist/text-chunking-BaYBIUoR.d.ts +79 -0
- package/dist/text-chunking-C8kmbNfa.js +84 -0
- package/dist/thinking-D8aqmr3o.d.ts +13 -0
- package/dist/tlon-Bpr4f3yF.js +433 -0
- package/dist/tool-send-BHKm5ztm.d.ts +9 -0
- package/dist/tui-BY3QRgC1.js +3834 -0
- package/dist/tui-cli-CCfZOlV0.js +132 -0
- package/dist/types-CKx5nDZB.d.ts +45 -0
- package/dist/types-DBhDdMQd.d.ts +22670 -0
- package/dist/types.base-B_TkkSS8.d.ts +188 -0
- package/dist/types.secrets-Bojc4omL.js +92 -0
- package/dist/ui-1UpZZyI3.js +31 -0
- package/dist/update-BR4JvFpV.js +1036 -0
- package/dist/update-cli-BZv44lFq.js +1498 -0
- package/dist/update-offset-store-DGdBotIW.js +107 -0
- package/dist/update-runner-D34sooPe.js +1496 -0
- package/dist/vllm-defaults-BCGSJ7K0.d.ts +13 -0
- package/dist/wait-BU9vJv22.d.ts +4 -0
- package/dist/web-CXpU2D41.js +107 -0
- package/dist/web-shared-B4sL45ah.d.ts +45 -0
- package/dist/webhook-memory-guards-B7oLVseG.d.ts +43 -0
- package/dist/webhook-request-guards-CqIH7equ.d.ts +76 -0
- package/dist/webhook-targets-CAAGATtk.js +181 -0
- package/dist/webhook-targets-oQ0jd4r0.d.ts +106 -0
- package/dist/webhooks-cli-B46t2VT5.js +349 -0
- package/dist/whatsapp-Dniwd4Rv.js +109 -0
- package/dist/whatsapp-actions-fL46PsNs.js +162 -0
- package/dist/windows-spawn-DGeE98SH.d.ts +43 -0
- package/dist/workspace-dirs-d3Ms_ryk.js +2002 -0
- package/dist/zalo-Csulx0XK.d.ts +9 -0
- package/dist/zalo-gh0yAWmS.js +415 -0
- package/dist/zalouser-CuxRvztM.js +30911 -0
- package/dist/zod-schema.agent-runtime-B4MkB-_3.d.ts +10 -0
- package/dist/zod-schema.core-D5reNip6.js +541 -0
- package/dist/zod-schema.core-DN3RhEUG.d.ts +173 -0
- package/docs/SEC1.md +523 -0
- package/docs/SEC1_IMPLEMENTATION/CHANNELS_REPORT.md +173 -0
- package/docs/SEC1_IMPLEMENTATION/CORE_UTIL_REPORT.md +139 -0
- package/docs/SEC1_IMPLEMENTATION/DOCS_REPORT.md +134 -0
- package/docs/SEC1_IMPLEMENTATION/ENV_MAP_DRAFT.md +148 -0
- package/docs/SEC1_IMPLEMENTATION/INTEGRATION_REPORT.md +170 -0
- package/docs/SEC1_IMPLEMENTATION/PROVIDERS_REPORT.md +291 -0
- package/docs/SEC1_IMPLEMENTATION/QA_REPORT.md +249 -0
- package/docs/SEC1_IMPLEMENTATION/RECURSIVE_QA/wave1-channels.md +317 -0
- package/docs/SEC1_IMPLEMENTATION/RECURSIVE_QA/wave1-docs.md +212 -0
- package/docs/SEC1_IMPLEMENTATION/RECURSIVE_QA/wave1-security.md +368 -0
- package/docs/SEC1_IMPLEMENTATION/RECURSIVE_QA/wave2-critic-consolidated.md +195 -0
- package/docs/SEC1_IMPLEMENTATION/RECURSIVE_QA/wave3-fix-report.md +105 -0
- package/docs/SEC1_IMPLEMENTATION/STRATEGY.md +451 -0
- package/docs/SEC1_IMPLEMENTATION/TEST_REPORT.md +156 -0
- package/docs/pipeline-sdk/CLI_SPEC.md +609 -0
- package/docs/pipeline-sdk/PIPELINE_SDK_DESIGN.md +1372 -0
- package/extensions/kakao-talkchannel/MIGRATION_ARCH_ANALYSIS.md +455 -0
- package/extensions/kakao-talkchannel/MIGRATION_CODE_ANALYSIS.md +383 -0
- package/extensions/kakao-talkchannel/MIGRATION_STRATEGY.md +115 -0
- package/extensions/kakao-talkchannel/README.md +50 -0
- package/extensions/kakao-talkchannel/index.ts +20 -0
- package/extensions/kakao-talkchannel/moldclaw.plugin.json +98 -0
- package/extensions/kakao-talkchannel/package.json +12 -0
- package/extensions/kakao-talkchannel/src/adapters/config.ts +132 -0
- package/extensions/kakao-talkchannel/src/adapters/gateway.ts +974 -0
- package/extensions/kakao-talkchannel/src/adapters/outbound.ts +52 -0
- package/extensions/kakao-talkchannel/src/adapters/pairing.ts +35 -0
- package/extensions/kakao-talkchannel/src/adapters/security.ts +57 -0
- package/extensions/kakao-talkchannel/src/adapters/setup.ts +105 -0
- package/extensions/kakao-talkchannel/src/adapters/status.ts +117 -0
- package/extensions/kakao-talkchannel/src/channel.ts +58 -0
- package/extensions/kakao-talkchannel/src/commands/card.ts +413 -0
- package/extensions/kakao-talkchannel/src/config/schema.ts +129 -0
- package/extensions/kakao-talkchannel/src/kakao/callback.ts +133 -0
- package/extensions/kakao-talkchannel/src/kakao/limits.ts +129 -0
- package/extensions/kakao-talkchannel/src/kakao/payload.ts +138 -0
- package/extensions/kakao-talkchannel/src/kakao/response.ts +373 -0
- package/extensions/kakao-talkchannel/src/relay/client.ts +146 -0
- package/extensions/kakao-talkchannel/src/relay/session.ts +137 -0
- package/extensions/kakao-talkchannel/src/relay/sse.ts +258 -0
- package/extensions/kakao-talkchannel/src/relay/stream.ts +149 -0
- package/extensions/kakao-talkchannel/src/runtime.ts +21 -0
- package/extensions/kakao-talkchannel/src/types.ts +447 -0
- package/extensions/kakao-talkchannel/src/version.ts +3 -0
- package/extensions/kakao-talkchannel/tsconfig.json +19 -0
- package/package.json +23 -8
- package/skills/meshy/SKILL.md +69 -0
- package/skills/meshy/scripts/__pycache__/check_status.cpython-312.pyc +0 -0
- package/skills/meshy/scripts/__pycache__/image_to_3d.cpython-312.pyc +0 -0
- package/skills/meshy/scripts/__pycache__/text_to_3d.cpython-312.pyc +0 -0
- package/skills/meshy/scripts/check_status.py +147 -0
- package/skills/meshy/scripts/image_to_3d.py +229 -0
- package/skills/meshy/scripts/text_to_3d.py +214 -0
- package/skills/nano-banana-pro/scripts/generate_image.py +1 -1
- package/skills/openai-whisper-api/scripts/transcribe.sh +0 -0
- package/skills/tavily-search/SKILL.md +61 -0
- package/skills/tavily-search/scripts/__pycache__/search.cpython-312.pyc +0 -0
- package/skills/tavily-search/scripts/search.py +238 -0
- package/skills/video-frames/scripts/frame.sh +0 -0
- package/LICENSE +0 -21
- package/dist/accounts-UcSvD34O.js +0 -109
- package/dist/acp-cli-BPb8PgHP.js +0 -2088
- package/dist/actions.runtime-BL5QRooG.js +0 -114
- package/dist/actions.runtime-DSdfSo40.js +0 -128
- package/dist/agents-CHeX_5-H.js +0 -217
- package/dist/agents-DQRL9XKP.js +0 -853
- package/dist/allow-list-Boi79v-U.js +0 -81
- package/dist/allowlist-B2eBBeMF.js +0 -142
- package/dist/api-CFAtRSYL.js +0 -6953
- package/dist/api-D5JNJj8n.js +0 -112
- package/dist/audit-BM0GsdzV.js +0 -787
- package/dist/audit-BqRK9OSj.js +0 -54
- package/dist/audit-channel.collect.runtime-BPvDB8aq.js +0 -600
- package/dist/audit-channel.runtime-D3fzHiAo.js +0 -116
- package/dist/audit-extra.async-NveNIzX0.js +0 -813
- package/dist/audit-membership-runtime-mu470WFO.js +0 -157
- package/dist/audit.deep.runtime-RdxvW8Tj.js +0 -24
- package/dist/audit.nondeep.runtime-DDu8vA9Z.js +0 -831
- package/dist/audit.runtime-Y8C9W7s9.js +0 -113
- package/dist/auth-choice-C1CIxRsi.js +0 -268
- package/dist/auth-choice-CTvqWiDI.js +0 -117
- package/dist/auth-choice-Ddzko1B8.js +0 -502
- package/dist/auth-choice-options-BIAmAiCe.js +0 -123
- package/dist/auth-choice-prompt-B815kArz.js +0 -110
- package/dist/auth-choice-prompt-CGhTNCJx.js +0 -36
- package/dist/auth-choice.plugin-providers.runtime-AvAZ6S5W.js +0 -114
- package/dist/auth-profiles-BJcHzwPy.js +0 -127650
- package/dist/auth-profiles.runtime-CieFilK5.js +0 -111
- package/dist/bluebubbles-F8FGE9cH.js +0 -64
- package/dist/brave-BG5Yopn8.js +0 -24
- package/dist/browser-cli-Co7PJGZF.js +0 -1492
- package/dist/call-CoaQYq7c.js +0 -639
- package/dist/call-D3eu5Jjh.js +0 -37
- package/dist/channel-BftWD6yu.js +0 -1321
- package/dist/channel-Bub9U5Xg.js +0 -214
- package/dist/channel-C0oDs7TO.js +0 -4681
- package/dist/channel-C8CnEdkZ.js +0 -352
- package/dist/channel-CI-RC-xf.js +0 -497
- package/dist/channel-CY-hZCOJ.js +0 -397
- package/dist/channel-CbtGJB2x.js +0 -943
- package/dist/channel-CcfK3wP8.js +0 -803
- package/dist/channel-DBoDIeVj.js +0 -619
- package/dist/channel-DEq6Ecs-.js +0 -920
- package/dist/channel-DH4dhW1n.js +0 -226
- package/dist/channel-DQ_wdKg_.js +0 -575
- package/dist/channel-DT6qD1Ic.js +0 -207
- package/dist/channel-DZNAyxwr.js +0 -542
- package/dist/channel-DtakwAEe.js +0 -538
- package/dist/channel-DuYgH6p1.js +0 -562
- package/dist/channel-Hn-AN-d52.js +0 -316
- package/dist/channel-_R4hbD5h.js +0 -1598
- package/dist/channel-account-context-DXq8dlvI.js +0 -103
- package/dist/channel-kQmEVn3I.js +0 -306
- package/dist/channel-options-DHfxaklg.js +0 -50
- package/dist/channel-summary-DUpnoYhI.js +0 -106
- package/dist/channel-t-JxCWk6.js +0 -949
- package/dist/channel.runtime--GYriaXU.js +0 -213
- package/dist/channel.runtime-BJtn3GOH.js +0 -174
- package/dist/channel.runtime-BV7t_oNz.js +0 -166
- package/dist/channel.runtime-Bi8a3n9S.js +0 -865
- package/dist/channel.runtime-BjsYF0NN.js +0 -122
- package/dist/channel.runtime-BnI6YtmI.js +0 -413
- package/dist/channel.runtime-CQOftcCd.js +0 -194
- package/dist/channel.runtime-CuIAcPjZ.js +0 -4006
- package/dist/channel.runtime-DH1Q1G4k.js +0 -399
- package/dist/channel.runtime-DYYUPKxr.js +0 -236
- package/dist/channel.runtime-U5Gszsr5.js +0 -177
- package/dist/channel.setup-BQFHmgki.js +0 -9
- package/dist/channel.setup-BVoDwklu.js +0 -8
- package/dist/channel.setup-Bf73HsXr.js +0 -57
- package/dist/channel.setup-CblD4flM.js +0 -11
- package/dist/channel.setup-DgxlrPgz.js +0 -6
- package/dist/channel.setup-GLIAEVKL.js +0 -8
- package/dist/channel.setup-YTy5R1sz.js +0 -9
- package/dist/channels-CTL8iR9J.js +0 -404
- package/dist/channels-DBGvnjHY.js +0 -1113
- package/dist/channels-cli-BmVO5-sq.js +0 -286
- package/dist/channels-status-issues-kDtsWzA-.js +0 -16
- package/dist/clawbot-cli-DtcMJHqX.js +0 -113
- package/dist/cli-BNGECGVY.js +0 -149
- package/dist/command-registry-1SDrWgER.js +0 -13
- package/dist/command-registry-DNorYU4w.js +0 -212
- package/dist/command-secret-gateway-DqDZparO.js +0 -106
- package/dist/compact.runtime-C1ZN8UGb.js +0 -111
- package/dist/completion-cli-Q_Jt5Foc.js +0 -16
- package/dist/completion-cli-QkTXhuJh.js +0 -445
- package/dist/config-BbxrRaLf.js +0 -938
- package/dist/config-CkD8DJ7L.js +0 -44
- package/dist/config-cli-BoPrlYTp.js +0 -428
- package/dist/config-guard-CEhCvr_u.js +0 -117
- package/dist/config-schema-GQ6uWjXe.js +0 -31
- package/dist/config-validation-woE2_LpC.js +0 -262
- package/dist/config-value-Dh8m-CFf.js +0 -132
- package/dist/config-y4i5g7s4.js +0 -30
- package/dist/configure-DGRzwdFN.js +0 -1100
- package/dist/configure-S4AHE3k_.js +0 -238
- package/dist/control-ui-shared-kLBp4YlS.js +0 -29
- package/dist/credentials-D5uBf_C5.js +0 -265
- package/dist/cron-cli-lGupeVCW.js +0 -634
- package/dist/daemon-cli-Cs_edi0I.js +0 -339
- package/dist/daemon-install-DIFpP_qv.js +0 -175
- package/dist/deliver-DYa_DFZU.js +0 -106
- package/dist/deliver-runtime-DCW_o2Ot.js +0 -106
- package/dist/devices-cli-YsGOW2-w.js +0 -340
- package/dist/diagnostic-vMghIesG.js +0 -310
- package/dist/directory-cli-DtjMQjU5.js +0 -306
- package/dist/directory.static-DBZGvsdF.js +0 -44
- package/dist/discord-DYCu19HT.js +0 -109
- package/dist/discovery-DZYAoDF_.js +0 -48
- package/dist/dns-cli-DqW4pNgW.js +0 -216
- package/dist/docs-cli-Bu9TBlDU.js +0 -173
- package/dist/doctor-completion-B5hcQD5c.js +0 -90
- package/dist/doctor-config-flow-BBB2ZKfT.js +0 -107
- package/dist/doctor-config-flow-DDBYUS9f.js +0 -2437
- package/dist/enable-Tmsp8QuB.js +0 -24
- package/dist/env-overrides-BHxqjYZG.js +0 -434
- package/dist/env-overrides.runtime-Cz98bf-l.js +0 -17
- package/dist/exec-approvals-cli-wO5cYfMa.js +0 -419
- package/dist/gateway-cli-CFvDGhB9.js +0 -26429
- package/dist/gateway-install-token-CskJfo_N.js +0 -163
- package/dist/gateway-rpc-srYfBID9.js +0 -26
- package/dist/gateway-runtime-C76hUmUV.js +0 -69
- package/dist/googlechat-Cha5utST.js +0 -307
- package/dist/health-DDQYYsJy.js +0 -108
- package/dist/health-DXZykGaX.js +0 -570
- package/dist/hooks-cli-DfkurPYP.js +0 -995
- package/dist/imessage-B26k39pl.js +0 -110
- package/dist/imessage-Bp1_6cws.js +0 -31
- package/dist/inbound-reply-dispatch-DoIJLztA.js +0 -71
- package/dist/install-target-BjOuS4I8.js +0 -574
- package/dist/installs-Cz4k0W1Y.js +0 -532
- package/dist/io-B0OKifLZ.js +0 -28
- package/dist/io-DcoxdH6t.js +0 -9570
- package/dist/ipv4-CTQQ4_IW.js +0 -82
- package/dist/irc-B8vBDigm.js +0 -672
- package/dist/library-VCM_cQY4.js +0 -107
- package/dist/lifecycle-core-Ctz36PdQ.js +0 -382
- package/dist/line-B_uTLrdI.js +0 -530
- package/dist/llm-slug-generator-YWg0g2pj.js +0 -67
- package/dist/logging-S-5LPdfQ.js +0 -13
- package/dist/logging-ueBMCGMR.js +0 -29
- package/dist/login-qr-pcACm2Ng.js +0 -107
- package/dist/login-qr-pv-kxMfF.js +0 -233
- package/dist/logs-cli-RgADgSMO.js +0 -254
- package/dist/manager-runtime-BhTkoKmb.js +0 -106
- package/dist/manager.runtime-BjHzikoK.js +0 -710
- package/dist/matrix-C4EEu2Qp.js +0 -1490
- package/dist/matrix-Dfzcc5nV.js +0 -1269
- package/dist/mcp-cli-CJmOm9Oj.js +0 -86
- package/dist/media-understanding.runtime-DCETFCw_.js +0 -111
- package/dist/memory-cli-DFqd6tYx.js +0 -106
- package/dist/method-scopes-D-Q9dvbj.js +0 -2586
- package/dist/model-picker-Z-CUcuMr.js +0 -390
- package/dist/model-picker-v5mUsZ4J.js +0 -107
- package/dist/model-picker.runtime-A_z0dHfS.js +0 -120
- package/dist/model-suppression.runtime-QVWVJRr-.js +0 -111
- package/dist/models-Bbj0xV4F.js +0 -2514
- package/dist/models-D-OIjZqU.js +0 -113
- package/dist/models-cli-Bpn-5i4h.js +0 -304
- package/dist/models-config-Cwa5cJbC.js +0 -106
- package/dist/monitor-BchfCAaU.js +0 -6823
- package/dist/monitor-BydV44SP.js +0 -3076
- package/dist/monitor-CT8axwfm.js +0 -767
- package/dist/monitor-CZGWNOvn.js +0 -777
- package/dist/monitor-DN62r69g.js +0 -3468
- package/dist/monitor-DZ0fzJku.js +0 -110
- package/dist/monitor-DvNjzWFu.js +0 -108
- package/dist/monitor-shared-B-DBSlkQ.js +0 -444
- package/dist/msteams-Bf-wk2Rp.js +0 -852
- package/dist/node-cli-kH16TQI7.js +0 -2498
- package/dist/node-resolve-DfOpQmxm.js +0 -835
- package/dist/nodes-cli-CkAMXW5u.js +0 -1375
- package/dist/nostr-B8UGHclZ.js +0 -8744
- package/dist/npm-resolution-DmjlifII.js +0 -60
- package/dist/onboard-C883nfyw.js +0 -589
- package/dist/onboard-channels-Dc-BxN7p.js +0 -200
- package/dist/onboard-channels-j5EENtum.js +0 -1241
- package/dist/onboard-custom-0atne0C5.js +0 -571
- package/dist/onboard-custom-CWMqwjJx.js +0 -109
- package/dist/onboard-helpers-D3wWfH8F.js +0 -335
- package/dist/onboard-helpers-DZmRCe8l.js +0 -108
- package/dist/onboard-remote-Cn6kW-p0.js +0 -112
- package/dist/onboard-remote-Cx4w5VAk.js +0 -181
- package/dist/onboard-search-Ck9HRh2M.js +0 -297
- package/dist/onboard-skills-BtqrGioT.js +0 -133
- package/dist/onboard-skills-Dnw19Os8.js +0 -112
- package/dist/outbound-media-C5Nv4o18.js +0 -11
- package/dist/pairing-cli-Cwy9QZ_4.js +0 -212
- package/dist/perplexity-Brhpb45X.js +0 -24
- package/dist/pi-model-discovery-runtime-DIOdo6D8.js +0 -106
- package/dist/pi-tools.before-tool-call.runtime-CFM4gsDF.js +0 -380
- package/dist/plugin-install-BOV00hia.js +0 -112
- package/dist/plugin-install-Bak8fUBv.js +0 -184
- package/dist/plugin-install-plan-bKkEefRf.js +0 -49
- package/dist/plugin-registry-DxAXQUlZ.js +0 -108
- package/dist/plugin-registry-n0p3phem.js +0 -49
- package/dist/plugins-Ca3RK8Fi.js +0 -106
- package/dist/plugins-cli-BnC51H2R.js +0 -912
- package/dist/policy-BJv97w9e.js +0 -143
- package/dist/preflight-audio.runtime-BrFcf-6_.js +0 -111
- package/dist/probe-063xvvZc.js +0 -19
- package/dist/probe-BJEb2wGv.js +0 -1793
- package/dist/probe-CJQlxgsl.js +0 -47
- package/dist/probe-Caa2HznF.js +0 -6328
- package/dist/probe-CfL4tnJ6.js +0 -129
- package/dist/probe-auth-DN2Ec83-.js +0 -38
- package/dist/probe-auth-D_UKzu4m.js +0 -48
- package/dist/program-BOMdC7MC.js +0 -247
- package/dist/prompt-select-styled-DDnCfM3j.js +0 -2673
- package/dist/provider-api-key-auth.runtime-DUns3fwX.js +0 -116
- package/dist/provider-auth-choice-B_j1ctT2.js +0 -126
- package/dist/provider-auth-choice-preference-BaOBZ_Xn.js +0 -189
- package/dist/provider-auth-choice.runtime-DOako_zV.js +0 -118
- package/dist/provider-auth-guidance-CrjxnoNZ.js +0 -34
- package/dist/provider-runtime.runtime-BkOkgmTw.js +0 -106
- package/dist/provider-self-hosted-setup-BFDU6dRa.js +0 -182
- package/dist/provider-usage-CaDE0mqq.js +0 -106
- package/dist/provider-web-search-BR7etTjJ.js +0 -2392
- package/dist/provider-wizard-DCPdKUvb.js +0 -152
- package/dist/push-apns-B_OZjm4v.js +0 -1038
- package/dist/pw-ai-dG60P0hQ.js +0 -1866
- package/dist/qr-cli-DWfiw79I.js +0 -369
- package/dist/qr-cli-DwuKtyZQ.js +0 -108
- package/dist/reactions-CIGAPBn8.js +0 -281
- package/dist/read-only-account-inspect.discord.runtime-D54mnq8l.js +0 -111
- package/dist/read-only-account-inspect.slack.runtime-Bxs9ObMC.js +0 -111
- package/dist/read-only-account-inspect.telegram.runtime-UoVuf_Yo.js +0 -111
- package/dist/redact-snapshot-DZ3Vq-SC.js +0 -2657
- package/dist/ref-contract-D96lSYLs.js +0 -53
- package/dist/register.agent-2KmeahEL.js +0 -434
- package/dist/register.backup-ECBnWVR7.js +0 -624
- package/dist/register.configure-Doz1daCp.js +0 -247
- package/dist/register.maintenance-C33cV-WM.js +0 -569
- package/dist/register.message-CnL0NiF6.js +0 -704
- package/dist/register.onboard-BrYGZeQA.js +0 -187
- package/dist/register.setup-Bx6gEg6X.js +0 -207
- package/dist/register.status-health-sessions-FLb0CUOO.js +0 -493
- package/dist/register.subclis-BuqgaeIf.js +0 -12
- package/dist/register.subclis-DwdgfdnT.js +0 -315
- package/dist/registry-xhgvU89y.js +0 -1107
- package/dist/replies-hB2aipLu.js +0 -110
- package/dist/resolve-3ErMOltL.js +0 -660
- package/dist/resolve-channels-BV8GXuPe.js +0 -226
- package/dist/resolve-channels-CTY_XRIP.js +0 -262
- package/dist/resolve-users-DQ4Ne4Zc.js +0 -143
- package/dist/routes-BNDsNO_e.js +0 -7097
- package/dist/rpc-BLGTBWXq.js +0 -67
- package/dist/run-main-COAE4GlI.js +0 -423
- package/dist/runtime-discord-ops.runtime-Dxg-nlgd.js +0 -9073
- package/dist/runtime-slack-ops.runtime-Di474LJr.js +0 -4551
- package/dist/runtime-telegram-ops.runtime-Da8vgf3O.js +0 -128
- package/dist/runtime-whatsapp-login.runtime-DcouP4iF.js +0 -109
- package/dist/runtime-whatsapp-outbound.runtime-CYamaEJX.js +0 -112
- package/dist/sandbox-cli-U5ZTxhxL.js +0 -530
- package/dist/search-manager-CfizyEMk.js +0 -386
- package/dist/search-manager-DaF2QP4s.js +0 -15
- package/dist/secrets-cli-C0gytFip.js +0 -2065
- package/dist/security-cli-C74EuLUO.js +0 -570
- package/dist/send-BTLVBf_E.js +0 -631
- package/dist/send-BlWWCEZE.js +0 -1025
- package/dist/send-CfypD1B_.js +0 -100
- package/dist/send-Cm9v3uhF.js +0 -283
- package/dist/send-g2odQuYI.js +0 -629
- package/dist/server-C8b5QJ2s.js +0 -106
- package/dist/server-node-events-xqQe5xiu.js +0 -501
- package/dist/sessions-CSSzvgPQ.js +0 -107
- package/dist/sessions-z0GIvdKa.js +0 -218
- package/dist/setup-D9XTmlF8.js +0 -387
- package/dist/setup-core-BDrLOwYO.js +0 -143
- package/dist/setup-core-CM7cY7_i.js +0 -166
- package/dist/setup-core-CnmgANY-.js +0 -205
- package/dist/setup-core-DgcjCKmG.js +0 -47
- package/dist/setup-surface-DzRrVKYj.js +0 -490
- package/dist/setup.finalize-UaPu_adv.js +0 -517
- package/dist/setup.gateway-config-Djc1ceEh.js +0 -338
- package/dist/setup.secret-input-BkczghbR.js +0 -25
- package/dist/shared-BHizGoNk.js +0 -298
- package/dist/shared-CUfYhQkP.js +0 -96
- package/dist/shared-DYYqr9EC.js +0 -75
- package/dist/shared-DthOxMRQ.js +0 -182
- package/dist/shared-On_A5_hW.js +0 -102
- package/dist/signal-D6px9PGZ.js +0 -109
- package/dist/skills-B4h1k-SP.js +0 -853
- package/dist/skills-Bto10BGB.js +0 -19
- package/dist/skills-cli-CXGR3Y5j.js +0 -291
- package/dist/skills-install-B1AlkK8C.js +0 -763
- package/dist/skills-status-BsmJ_iSg.js +0 -20
- package/dist/skills-status-DGdxY3OI.js +0 -169
- package/dist/slack-B7vWFmxP.js +0 -109
- package/dist/slash-commands.runtime-DXdAT84n.js +0 -123
- package/dist/slash-dispatch.runtime-CNf2-9Aj.js +0 -136
- package/dist/slash-skill-commands.runtime-CBjffHRX.js +0 -111
- package/dist/src-Cp7P7T08.js +0 -1696
- package/dist/status-158fWh4A.js +0 -43
- package/dist/status-BJIVLJnb.js +0 -1599
- package/dist/status-BQiBI6N9.js +0 -126
- package/dist/status-CZipXGUu.js +0 -121
- package/dist/status-ZZIVFLI-.js +0 -606
- package/dist/status-json-BNUy5Mem.js +0 -286
- package/dist/status.link-channel-B694y1Xu.js +0 -138
- package/dist/status.scan.deps.runtime-BcoKEzQD.js +0 -121
- package/dist/status.scan.runtime-CqScDt-p.js +0 -114
- package/dist/status.summary-AMek7qvI.js +0 -592
- package/dist/status.summary.runtime-XgkcQ_kr.js +0 -113
- package/dist/subagent-orphan-recovery-CrCYTmFC.js +0 -302
- package/dist/subagent-registry-runtime-Cg-YvLx3.js +0 -106
- package/dist/synology-chat-0G85jIqQ.js +0 -297
- package/dist/system-cli-kZtSxKNm.js +0 -92
- package/dist/telegram-DV0Wy89w.js +0 -109
- package/dist/text-chunking-C2J2Oeul.js +0 -84
- package/dist/tlon-DmK1NUVP.js +0 -433
- package/dist/tui-D3bNPLG7.js +0 -3834
- package/dist/tui-cli-DtMp9k_s.js +0 -132
- package/dist/types.secrets-DuSPmmWB.js +0 -80
- package/dist/ui-CeGztSEL.js +0 -31
- package/dist/update-De7VudzP.js +0 -1036
- package/dist/update-cli-BH8Pb-So.js +0 -1498
- package/dist/update-offset-store-syELkdEW.js +0 -107
- package/dist/update-runner-Cq-Q40T9.js +0 -1496
- package/dist/web-CjMtvfSq.js +0 -107
- package/dist/webhook-targets-_jTR0Bb_.js +0 -181
- package/dist/webhooks-cli-DQ6u2Qau.js +0 -349
- package/dist/whatsapp-CyLk16SZ.js +0 -109
- package/dist/whatsapp-actions-Dzr2Wzqw.js +0 -162
- package/dist/workspace-dirs-L1_QQ9mB.js +0 -2002
- package/dist/zalo-CrehfXvK.js +0 -415
- package/dist/zalouser-D1QD-O-I.js +0 -30911
- package/dist/zod-schema.core-CWxzqcUs.js +0 -541
|
@@ -0,0 +1,938 @@
|
|
|
1
|
+
import { u as resolveGatewayPort } from "./paths-D6AgsMTU.js";
|
|
2
|
+
import { a as logVerbose, i as isYes, r as isVerbose } from "./globals-DESrFYmC.js";
|
|
3
|
+
import { m as defaultRuntime } from "./subsystem-S4LNMNHd.js";
|
|
4
|
+
import { y as resolveUserPath } from "./utils-rjVNXUns.js";
|
|
5
|
+
import { r as runExec } from "./exec-CoBTyh8B.js";
|
|
6
|
+
import { d as resolveSecretInputRef } from "./types.secrets-Bojc4omL.js";
|
|
7
|
+
import { t as safeEqualSecret } from "./secret-equal-BH8cCC3g.js";
|
|
8
|
+
import { a as isTrustedProxyAddress, f as resolveRequestClientIp, l as resolveClientIp, n as isLoopbackAddress, r as isLoopbackHost, t as isLocalishHost } from "./net-B_Iq_SVP.js";
|
|
9
|
+
import { i as resolveGatewayCredentialsFromValues } from "./credentials-yYt6VWCq.js";
|
|
10
|
+
import { stdin, stdout } from "node:process";
|
|
11
|
+
import { existsSync } from "node:fs";
|
|
12
|
+
import readline from "node:readline/promises";
|
|
13
|
+
//#region src/browser/constants.ts
|
|
14
|
+
const DEFAULT_MOLDCLAW_BROWSER_COLOR = "#FF4500";
|
|
15
|
+
const DEFAULT_MOLDCLAW_BROWSER_PROFILE_NAME = "moldclaw";
|
|
16
|
+
const DEFAULT_AI_SNAPSHOT_MAX_CHARS = 8e4;
|
|
17
|
+
const DEFAULT_AI_SNAPSHOT_EFFICIENT_MAX_CHARS = 1e4;
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/cli/prompt.ts
|
|
20
|
+
async function promptYesNo(question, defaultYes = false) {
|
|
21
|
+
if (isVerbose() && isYes()) return true;
|
|
22
|
+
if (isYes()) return true;
|
|
23
|
+
const rl = readline.createInterface({
|
|
24
|
+
input: stdin,
|
|
25
|
+
output: stdout
|
|
26
|
+
});
|
|
27
|
+
const suffix = defaultYes ? " [Y/n] " : " [y/N] ";
|
|
28
|
+
const answer = (await rl.question(`${question}${suffix}`)).trim().toLowerCase();
|
|
29
|
+
rl.close();
|
|
30
|
+
if (!answer) return defaultYes;
|
|
31
|
+
return answer.startsWith("y");
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/infra/binaries.ts
|
|
35
|
+
async function ensureBinary(name, exec = runExec, runtime = defaultRuntime) {
|
|
36
|
+
await exec("which", [name]).catch(() => {
|
|
37
|
+
runtime.error(`Missing required binary: ${name}. Please install it.`);
|
|
38
|
+
runtime.exit(1);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/infra/tailscale.ts
|
|
43
|
+
function parsePossiblyNoisyJsonObject(stdout) {
|
|
44
|
+
const trimmed = stdout.trim();
|
|
45
|
+
const start = trimmed.indexOf("{");
|
|
46
|
+
const end = trimmed.lastIndexOf("}");
|
|
47
|
+
if (start >= 0 && end > start) return JSON.parse(trimmed.slice(start, end + 1));
|
|
48
|
+
return JSON.parse(trimmed);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Locate Tailscale binary using multiple strategies:
|
|
52
|
+
* 1. PATH lookup (via which command)
|
|
53
|
+
* 2. Known macOS app path
|
|
54
|
+
* 3. find /Applications for Tailscale.app
|
|
55
|
+
* 4. locate database (if available)
|
|
56
|
+
*
|
|
57
|
+
* @returns Path to Tailscale binary or null if not found
|
|
58
|
+
*/
|
|
59
|
+
async function findTailscaleBinary() {
|
|
60
|
+
const checkBinary = async (path) => {
|
|
61
|
+
if (!path || !existsSync(path)) return false;
|
|
62
|
+
try {
|
|
63
|
+
await Promise.race([runExec(path, ["--version"], { timeoutMs: 3e3 }), new Promise((_, reject) => setTimeout(() => reject(/* @__PURE__ */ new Error("timeout")), 3e3))]);
|
|
64
|
+
return true;
|
|
65
|
+
} catch {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
try {
|
|
70
|
+
const { stdout } = await runExec("which", ["tailscale"]);
|
|
71
|
+
const fromPath = stdout.trim();
|
|
72
|
+
if (fromPath && await checkBinary(fromPath)) return fromPath;
|
|
73
|
+
} catch {}
|
|
74
|
+
const macAppPath = "/Applications/Tailscale.app/Contents/MacOS/Tailscale";
|
|
75
|
+
if (await checkBinary(macAppPath)) return macAppPath;
|
|
76
|
+
try {
|
|
77
|
+
const { stdout } = await runExec("find", [
|
|
78
|
+
"/Applications",
|
|
79
|
+
"-maxdepth",
|
|
80
|
+
"3",
|
|
81
|
+
"-name",
|
|
82
|
+
"Tailscale",
|
|
83
|
+
"-path",
|
|
84
|
+
"*/Tailscale.app/Contents/MacOS/Tailscale"
|
|
85
|
+
], { timeoutMs: 5e3 });
|
|
86
|
+
const found = stdout.trim().split("\n")[0];
|
|
87
|
+
if (found && await checkBinary(found)) return found;
|
|
88
|
+
} catch {}
|
|
89
|
+
try {
|
|
90
|
+
const { stdout } = await runExec("locate", ["Tailscale.app"]);
|
|
91
|
+
const candidates = stdout.trim().split("\n").filter((line) => line.includes("/Tailscale.app/Contents/MacOS/Tailscale"));
|
|
92
|
+
for (const candidate of candidates) if (await checkBinary(candidate)) return candidate;
|
|
93
|
+
} catch {}
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
async function getTailnetHostname(exec = runExec, detectedBinary) {
|
|
97
|
+
const candidates = detectedBinary ? [detectedBinary] : ["tailscale", "/Applications/Tailscale.app/Contents/MacOS/Tailscale"];
|
|
98
|
+
let lastError;
|
|
99
|
+
for (const candidate of candidates) {
|
|
100
|
+
if (candidate.startsWith("/") && !existsSync(candidate)) continue;
|
|
101
|
+
try {
|
|
102
|
+
const { stdout } = await exec(candidate, ["status", "--json"], {
|
|
103
|
+
timeoutMs: 5e3,
|
|
104
|
+
maxBuffer: 4e5
|
|
105
|
+
});
|
|
106
|
+
const parsed = stdout ? parsePossiblyNoisyJsonObject(stdout) : {};
|
|
107
|
+
const self = typeof parsed.Self === "object" && parsed.Self !== null ? parsed.Self : void 0;
|
|
108
|
+
const dns = typeof self?.DNSName === "string" ? self.DNSName : void 0;
|
|
109
|
+
const ips = Array.isArray(self?.TailscaleIPs) ? parsed.Self.TailscaleIPs ?? [] : [];
|
|
110
|
+
if (dns && dns.length > 0) return dns.replace(/\.$/, "");
|
|
111
|
+
if (ips.length > 0) return ips[0];
|
|
112
|
+
throw new Error("Could not determine Tailscale DNS or IP");
|
|
113
|
+
} catch (err) {
|
|
114
|
+
lastError = err;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
throw lastError ?? /* @__PURE__ */ new Error("Could not determine Tailscale DNS or IP");
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Get the Tailscale binary command to use.
|
|
121
|
+
* Returns a cached detected binary or the default "tailscale" command.
|
|
122
|
+
*/
|
|
123
|
+
let cachedTailscaleBinary = null;
|
|
124
|
+
async function getTailscaleBinary() {
|
|
125
|
+
const forcedBinary = process.env.MOLDCLAW_TEST_TAILSCALE_BINARY?.trim();
|
|
126
|
+
if (forcedBinary) {
|
|
127
|
+
cachedTailscaleBinary = forcedBinary;
|
|
128
|
+
return forcedBinary;
|
|
129
|
+
}
|
|
130
|
+
if (cachedTailscaleBinary) return cachedTailscaleBinary;
|
|
131
|
+
cachedTailscaleBinary = await findTailscaleBinary();
|
|
132
|
+
return cachedTailscaleBinary ?? "tailscale";
|
|
133
|
+
}
|
|
134
|
+
async function readTailscaleStatusJson(exec = runExec, opts) {
|
|
135
|
+
const { stdout } = await exec(await getTailscaleBinary(), ["status", "--json"], {
|
|
136
|
+
timeoutMs: opts?.timeoutMs ?? 5e3,
|
|
137
|
+
maxBuffer: 4e5
|
|
138
|
+
});
|
|
139
|
+
return stdout ? parsePossiblyNoisyJsonObject(stdout) : {};
|
|
140
|
+
}
|
|
141
|
+
const whoisCache = /* @__PURE__ */ new Map();
|
|
142
|
+
function extractExecErrorText(err) {
|
|
143
|
+
const errOutput = err;
|
|
144
|
+
return {
|
|
145
|
+
stdout: typeof errOutput.stdout === "string" ? errOutput.stdout : "",
|
|
146
|
+
stderr: typeof errOutput.stderr === "string" ? errOutput.stderr : "",
|
|
147
|
+
message: typeof errOutput.message === "string" ? errOutput.message : "",
|
|
148
|
+
code: typeof errOutput.code === "string" ? errOutput.code : ""
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
function isPermissionDeniedError(err) {
|
|
152
|
+
const { stdout, stderr, message, code } = extractExecErrorText(err);
|
|
153
|
+
if (code.toUpperCase() === "EACCES") return true;
|
|
154
|
+
const combined = `${stdout}\n${stderr}\n${message}`.toLowerCase();
|
|
155
|
+
return combined.includes("permission denied") || combined.includes("access denied") || combined.includes("operation not permitted") || combined.includes("not permitted") || combined.includes("requires root") || combined.includes("must be run as root") || combined.includes("must be run with sudo") || combined.includes("requires sudo") || combined.includes("need sudo");
|
|
156
|
+
}
|
|
157
|
+
async function execWithSudoFallback(exec, bin, args, opts) {
|
|
158
|
+
try {
|
|
159
|
+
return await exec(bin, args, opts);
|
|
160
|
+
} catch (err) {
|
|
161
|
+
if (!isPermissionDeniedError(err)) throw err;
|
|
162
|
+
logVerbose(`Command failed, retrying with sudo: ${bin} ${args.join(" ")}`);
|
|
163
|
+
try {
|
|
164
|
+
return await exec("sudo", [
|
|
165
|
+
"-n",
|
|
166
|
+
bin,
|
|
167
|
+
...args
|
|
168
|
+
], opts);
|
|
169
|
+
} catch (sudoErr) {
|
|
170
|
+
const { stderr, message } = extractExecErrorText(sudoErr);
|
|
171
|
+
const detail = (stderr || message).trim();
|
|
172
|
+
if (detail) logVerbose(`Sudo retry failed: ${detail}`);
|
|
173
|
+
throw err;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
async function enableTailscaleServe(port, exec = runExec) {
|
|
178
|
+
await execWithSudoFallback(exec, await getTailscaleBinary(), [
|
|
179
|
+
"serve",
|
|
180
|
+
"--bg",
|
|
181
|
+
"--yes",
|
|
182
|
+
`${port}`
|
|
183
|
+
], {
|
|
184
|
+
maxBuffer: 2e5,
|
|
185
|
+
timeoutMs: 15e3
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
async function disableTailscaleServe(exec = runExec) {
|
|
189
|
+
await execWithSudoFallback(exec, await getTailscaleBinary(), ["serve", "reset"], {
|
|
190
|
+
maxBuffer: 2e5,
|
|
191
|
+
timeoutMs: 15e3
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
async function enableTailscaleFunnel(port, exec = runExec) {
|
|
195
|
+
await execWithSudoFallback(exec, await getTailscaleBinary(), [
|
|
196
|
+
"funnel",
|
|
197
|
+
"--bg",
|
|
198
|
+
"--yes",
|
|
199
|
+
`${port}`
|
|
200
|
+
], {
|
|
201
|
+
maxBuffer: 2e5,
|
|
202
|
+
timeoutMs: 15e3
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
async function disableTailscaleFunnel(exec = runExec) {
|
|
206
|
+
await execWithSudoFallback(exec, await getTailscaleBinary(), ["funnel", "reset"], {
|
|
207
|
+
maxBuffer: 2e5,
|
|
208
|
+
timeoutMs: 15e3
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
function getString(value) {
|
|
212
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
213
|
+
}
|
|
214
|
+
function readRecord(value) {
|
|
215
|
+
return value && typeof value === "object" ? value : null;
|
|
216
|
+
}
|
|
217
|
+
function parseWhoisIdentity(payload) {
|
|
218
|
+
const userProfile = readRecord(payload.UserProfile) ?? readRecord(payload.userProfile) ?? readRecord(payload.User);
|
|
219
|
+
const login = getString(userProfile?.LoginName) ?? getString(userProfile?.Login) ?? getString(userProfile?.login) ?? getString(payload.LoginName) ?? getString(payload.login);
|
|
220
|
+
if (!login) return null;
|
|
221
|
+
return {
|
|
222
|
+
login,
|
|
223
|
+
name: getString(userProfile?.DisplayName) ?? getString(userProfile?.Name) ?? getString(userProfile?.displayName) ?? getString(payload.DisplayName) ?? getString(payload.name)
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
function readCachedWhois(ip, now) {
|
|
227
|
+
const cached = whoisCache.get(ip);
|
|
228
|
+
if (!cached) return;
|
|
229
|
+
if (cached.expiresAt <= now) {
|
|
230
|
+
whoisCache.delete(ip);
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
return cached.value;
|
|
234
|
+
}
|
|
235
|
+
function writeCachedWhois(ip, value, ttlMs) {
|
|
236
|
+
whoisCache.set(ip, {
|
|
237
|
+
value,
|
|
238
|
+
expiresAt: Date.now() + ttlMs
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
async function readTailscaleWhoisIdentity(ip, exec = runExec, opts) {
|
|
242
|
+
const normalized = ip.trim();
|
|
243
|
+
if (!normalized) return null;
|
|
244
|
+
const cached = readCachedWhois(normalized, Date.now());
|
|
245
|
+
if (cached !== void 0) return cached;
|
|
246
|
+
const cacheTtlMs = opts?.cacheTtlMs ?? 6e4;
|
|
247
|
+
const errorTtlMs = opts?.errorTtlMs ?? 5e3;
|
|
248
|
+
try {
|
|
249
|
+
const { stdout } = await exec(await getTailscaleBinary(), [
|
|
250
|
+
"whois",
|
|
251
|
+
"--json",
|
|
252
|
+
normalized
|
|
253
|
+
], {
|
|
254
|
+
timeoutMs: opts?.timeoutMs ?? 5e3,
|
|
255
|
+
maxBuffer: 2e5
|
|
256
|
+
});
|
|
257
|
+
const identity = parseWhoisIdentity(stdout ? parsePossiblyNoisyJsonObject(stdout) : {});
|
|
258
|
+
writeCachedWhois(normalized, identity, cacheTtlMs);
|
|
259
|
+
return identity;
|
|
260
|
+
} catch {
|
|
261
|
+
writeCachedWhois(normalized, null, errorTtlMs);
|
|
262
|
+
return null;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
const AUTH_RATE_LIMIT_SCOPE_SHARED_SECRET = "shared-secret";
|
|
266
|
+
const AUTH_RATE_LIMIT_SCOPE_DEVICE_TOKEN = "device-token";
|
|
267
|
+
const AUTH_RATE_LIMIT_SCOPE_HOOK_AUTH = "hook-auth";
|
|
268
|
+
const DEFAULT_MAX_ATTEMPTS = 10;
|
|
269
|
+
const DEFAULT_WINDOW_MS = 6e4;
|
|
270
|
+
const DEFAULT_LOCKOUT_MS = 3e5;
|
|
271
|
+
const PRUNE_INTERVAL_MS = 6e4;
|
|
272
|
+
/**
|
|
273
|
+
* Canonicalize client IPs used for auth throttling so all call sites
|
|
274
|
+
* share one representation (including IPv4-mapped IPv6 forms).
|
|
275
|
+
*/
|
|
276
|
+
function normalizeRateLimitClientIp(ip) {
|
|
277
|
+
return resolveClientIp({ remoteAddr: ip }) ?? "unknown";
|
|
278
|
+
}
|
|
279
|
+
function createAuthRateLimiter(config) {
|
|
280
|
+
const maxAttempts = config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS;
|
|
281
|
+
const windowMs = config?.windowMs ?? DEFAULT_WINDOW_MS;
|
|
282
|
+
const lockoutMs = config?.lockoutMs ?? DEFAULT_LOCKOUT_MS;
|
|
283
|
+
const exemptLoopback = config?.exemptLoopback ?? true;
|
|
284
|
+
const pruneIntervalMs = config?.pruneIntervalMs ?? PRUNE_INTERVAL_MS;
|
|
285
|
+
const entries = /* @__PURE__ */ new Map();
|
|
286
|
+
const pruneTimer = pruneIntervalMs > 0 ? setInterval(() => prune(), pruneIntervalMs) : null;
|
|
287
|
+
if (pruneTimer?.unref) pruneTimer.unref();
|
|
288
|
+
function normalizeScope(scope) {
|
|
289
|
+
return (scope ?? "default").trim() || "default";
|
|
290
|
+
}
|
|
291
|
+
function normalizeIp(ip) {
|
|
292
|
+
return normalizeRateLimitClientIp(ip);
|
|
293
|
+
}
|
|
294
|
+
function resolveKey(rawIp, rawScope) {
|
|
295
|
+
const ip = normalizeIp(rawIp);
|
|
296
|
+
return {
|
|
297
|
+
key: `${normalizeScope(rawScope)}:${ip}`,
|
|
298
|
+
ip
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
function isExempt(ip) {
|
|
302
|
+
return exemptLoopback && isLoopbackAddress(ip);
|
|
303
|
+
}
|
|
304
|
+
function slideWindow(entry, now) {
|
|
305
|
+
const cutoff = now - windowMs;
|
|
306
|
+
entry.attempts = entry.attempts.filter((ts) => ts > cutoff);
|
|
307
|
+
}
|
|
308
|
+
function check(rawIp, rawScope) {
|
|
309
|
+
const { key, ip } = resolveKey(rawIp, rawScope);
|
|
310
|
+
if (isExempt(ip)) return {
|
|
311
|
+
allowed: true,
|
|
312
|
+
remaining: maxAttempts,
|
|
313
|
+
retryAfterMs: 0
|
|
314
|
+
};
|
|
315
|
+
const now = Date.now();
|
|
316
|
+
const entry = entries.get(key);
|
|
317
|
+
if (!entry) return {
|
|
318
|
+
allowed: true,
|
|
319
|
+
remaining: maxAttempts,
|
|
320
|
+
retryAfterMs: 0
|
|
321
|
+
};
|
|
322
|
+
if (entry.lockedUntil && now < entry.lockedUntil) return {
|
|
323
|
+
allowed: false,
|
|
324
|
+
remaining: 0,
|
|
325
|
+
retryAfterMs: entry.lockedUntil - now
|
|
326
|
+
};
|
|
327
|
+
if (entry.lockedUntil && now >= entry.lockedUntil) {
|
|
328
|
+
entry.lockedUntil = void 0;
|
|
329
|
+
entry.attempts = [];
|
|
330
|
+
}
|
|
331
|
+
slideWindow(entry, now);
|
|
332
|
+
const remaining = Math.max(0, maxAttempts - entry.attempts.length);
|
|
333
|
+
return {
|
|
334
|
+
allowed: remaining > 0,
|
|
335
|
+
remaining,
|
|
336
|
+
retryAfterMs: 0
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
function recordFailure(rawIp, rawScope) {
|
|
340
|
+
const { key, ip } = resolveKey(rawIp, rawScope);
|
|
341
|
+
if (isExempt(ip)) return;
|
|
342
|
+
const now = Date.now();
|
|
343
|
+
let entry = entries.get(key);
|
|
344
|
+
if (!entry) {
|
|
345
|
+
entry = { attempts: [] };
|
|
346
|
+
entries.set(key, entry);
|
|
347
|
+
}
|
|
348
|
+
if (entry.lockedUntil && now < entry.lockedUntil) return;
|
|
349
|
+
slideWindow(entry, now);
|
|
350
|
+
entry.attempts.push(now);
|
|
351
|
+
if (entry.attempts.length >= maxAttempts) entry.lockedUntil = now + lockoutMs;
|
|
352
|
+
}
|
|
353
|
+
function reset(rawIp, rawScope) {
|
|
354
|
+
const { key } = resolveKey(rawIp, rawScope);
|
|
355
|
+
entries.delete(key);
|
|
356
|
+
}
|
|
357
|
+
function prune() {
|
|
358
|
+
const now = Date.now();
|
|
359
|
+
for (const [key, entry] of entries) {
|
|
360
|
+
if (entry.lockedUntil && now < entry.lockedUntil) continue;
|
|
361
|
+
slideWindow(entry, now);
|
|
362
|
+
if (entry.attempts.length === 0) entries.delete(key);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
function size() {
|
|
366
|
+
return entries.size;
|
|
367
|
+
}
|
|
368
|
+
function dispose() {
|
|
369
|
+
if (pruneTimer) clearInterval(pruneTimer);
|
|
370
|
+
entries.clear();
|
|
371
|
+
}
|
|
372
|
+
return {
|
|
373
|
+
check,
|
|
374
|
+
recordFailure,
|
|
375
|
+
reset,
|
|
376
|
+
size,
|
|
377
|
+
prune,
|
|
378
|
+
dispose
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
//#endregion
|
|
382
|
+
//#region src/gateway/auth.ts
|
|
383
|
+
function normalizeLogin(login) {
|
|
384
|
+
return login.trim().toLowerCase();
|
|
385
|
+
}
|
|
386
|
+
function headerValue(value) {
|
|
387
|
+
return Array.isArray(value) ? value[0] : value;
|
|
388
|
+
}
|
|
389
|
+
const TAILSCALE_TRUSTED_PROXIES = ["127.0.0.1", "::1"];
|
|
390
|
+
function resolveTailscaleClientIp(req) {
|
|
391
|
+
if (!req) return;
|
|
392
|
+
return resolveClientIp({
|
|
393
|
+
remoteAddr: req.socket?.remoteAddress ?? "",
|
|
394
|
+
forwardedFor: headerValue(req.headers?.["x-forwarded-for"]),
|
|
395
|
+
trustedProxies: [...TAILSCALE_TRUSTED_PROXIES]
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
function isLocalDirectRequest(req, trustedProxies, allowRealIpFallback = false) {
|
|
399
|
+
if (!req) return false;
|
|
400
|
+
if (!isLoopbackAddress(resolveRequestClientIp(req, trustedProxies, allowRealIpFallback) ?? "")) return false;
|
|
401
|
+
const hasForwarded = Boolean(req.headers?.["x-forwarded-for"] || req.headers?.["x-real-ip"] || req.headers?.["x-forwarded-host"]);
|
|
402
|
+
const remoteIsTrustedProxy = isTrustedProxyAddress(req.socket?.remoteAddress, trustedProxies);
|
|
403
|
+
return isLocalishHost(req.headers?.host) && (!hasForwarded || remoteIsTrustedProxy);
|
|
404
|
+
}
|
|
405
|
+
function getTailscaleUser(req) {
|
|
406
|
+
if (!req) return null;
|
|
407
|
+
const login = req.headers["tailscale-user-login"];
|
|
408
|
+
if (typeof login !== "string" || !login.trim()) return null;
|
|
409
|
+
const nameRaw = req.headers["tailscale-user-name"];
|
|
410
|
+
const profilePic = req.headers["tailscale-user-profile-pic"];
|
|
411
|
+
const name = typeof nameRaw === "string" && nameRaw.trim() ? nameRaw.trim() : login.trim();
|
|
412
|
+
return {
|
|
413
|
+
login: login.trim(),
|
|
414
|
+
name,
|
|
415
|
+
profilePic: typeof profilePic === "string" && profilePic.trim() ? profilePic.trim() : void 0
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
function hasTailscaleProxyHeaders(req) {
|
|
419
|
+
if (!req) return false;
|
|
420
|
+
return Boolean(req.headers["x-forwarded-for"] && req.headers["x-forwarded-proto"] && req.headers["x-forwarded-host"]);
|
|
421
|
+
}
|
|
422
|
+
function isTailscaleProxyRequest(req) {
|
|
423
|
+
if (!req) return false;
|
|
424
|
+
return isLoopbackAddress(req.socket?.remoteAddress) && hasTailscaleProxyHeaders(req);
|
|
425
|
+
}
|
|
426
|
+
async function resolveVerifiedTailscaleUser(params) {
|
|
427
|
+
const { req, tailscaleWhois } = params;
|
|
428
|
+
const tailscaleUser = getTailscaleUser(req);
|
|
429
|
+
if (!tailscaleUser) return {
|
|
430
|
+
ok: false,
|
|
431
|
+
reason: "tailscale_user_missing"
|
|
432
|
+
};
|
|
433
|
+
if (!isTailscaleProxyRequest(req)) return {
|
|
434
|
+
ok: false,
|
|
435
|
+
reason: "tailscale_proxy_missing"
|
|
436
|
+
};
|
|
437
|
+
const clientIp = resolveTailscaleClientIp(req);
|
|
438
|
+
if (!clientIp) return {
|
|
439
|
+
ok: false,
|
|
440
|
+
reason: "tailscale_whois_failed"
|
|
441
|
+
};
|
|
442
|
+
const whois = await tailscaleWhois(clientIp);
|
|
443
|
+
if (!whois?.login) return {
|
|
444
|
+
ok: false,
|
|
445
|
+
reason: "tailscale_whois_failed"
|
|
446
|
+
};
|
|
447
|
+
if (normalizeLogin(whois.login) !== normalizeLogin(tailscaleUser.login)) return {
|
|
448
|
+
ok: false,
|
|
449
|
+
reason: "tailscale_user_mismatch"
|
|
450
|
+
};
|
|
451
|
+
return {
|
|
452
|
+
ok: true,
|
|
453
|
+
user: {
|
|
454
|
+
login: whois.login,
|
|
455
|
+
name: whois.name ?? tailscaleUser.name,
|
|
456
|
+
profilePic: tailscaleUser.profilePic
|
|
457
|
+
}
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
function resolveGatewayAuth(params) {
|
|
461
|
+
const baseAuthConfig = params.authConfig ?? {};
|
|
462
|
+
const authOverride = params.authOverride ?? void 0;
|
|
463
|
+
const authConfig = { ...baseAuthConfig };
|
|
464
|
+
if (authOverride) {
|
|
465
|
+
if (authOverride.mode !== void 0) authConfig.mode = authOverride.mode;
|
|
466
|
+
if (authOverride.token !== void 0) authConfig.token = authOverride.token;
|
|
467
|
+
if (authOverride.password !== void 0) authConfig.password = authOverride.password;
|
|
468
|
+
if (authOverride.allowTailscale !== void 0) authConfig.allowTailscale = authOverride.allowTailscale;
|
|
469
|
+
if (authOverride.rateLimit !== void 0) authConfig.rateLimit = authOverride.rateLimit;
|
|
470
|
+
if (authOverride.trustedProxy !== void 0) authConfig.trustedProxy = authOverride.trustedProxy;
|
|
471
|
+
}
|
|
472
|
+
const env = params.env ?? process.env;
|
|
473
|
+
const tokenRef = resolveSecretInputRef({ value: authConfig.token }).ref;
|
|
474
|
+
const passwordRef = resolveSecretInputRef({ value: authConfig.password }).ref;
|
|
475
|
+
const resolvedCredentials = resolveGatewayCredentialsFromValues({
|
|
476
|
+
configToken: tokenRef ? void 0 : authConfig.token,
|
|
477
|
+
configPassword: passwordRef ? void 0 : authConfig.password,
|
|
478
|
+
env,
|
|
479
|
+
includeLegacyEnv: false,
|
|
480
|
+
tokenPrecedence: "config-first",
|
|
481
|
+
passwordPrecedence: "config-first"
|
|
482
|
+
});
|
|
483
|
+
const token = resolvedCredentials.token;
|
|
484
|
+
const password = resolvedCredentials.password;
|
|
485
|
+
const trustedProxy = authConfig.trustedProxy;
|
|
486
|
+
let mode;
|
|
487
|
+
let modeSource;
|
|
488
|
+
if (authOverride?.mode !== void 0) {
|
|
489
|
+
mode = authOverride.mode;
|
|
490
|
+
modeSource = "override";
|
|
491
|
+
} else if (authConfig.mode) {
|
|
492
|
+
mode = authConfig.mode;
|
|
493
|
+
modeSource = "config";
|
|
494
|
+
} else if (password) {
|
|
495
|
+
mode = "password";
|
|
496
|
+
modeSource = "password";
|
|
497
|
+
} else if (token) {
|
|
498
|
+
mode = "token";
|
|
499
|
+
modeSource = "token";
|
|
500
|
+
} else {
|
|
501
|
+
mode = "token";
|
|
502
|
+
modeSource = "default";
|
|
503
|
+
}
|
|
504
|
+
const allowTailscale = authConfig.allowTailscale ?? (params.tailscaleMode === "serve" && mode !== "password" && mode !== "trusted-proxy");
|
|
505
|
+
return {
|
|
506
|
+
mode,
|
|
507
|
+
modeSource,
|
|
508
|
+
token,
|
|
509
|
+
password,
|
|
510
|
+
allowTailscale,
|
|
511
|
+
trustedProxy
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
function assertGatewayAuthConfigured(auth, rawAuthConfig) {
|
|
515
|
+
if (auth.mode === "token" && !auth.token) {
|
|
516
|
+
if (auth.allowTailscale) return;
|
|
517
|
+
throw new Error("gateway auth mode is token, but no token was configured (set gateway.auth.token or MOLDCLAW_GATEWAY_TOKEN)");
|
|
518
|
+
}
|
|
519
|
+
if (auth.mode === "password" && !auth.password) {
|
|
520
|
+
if (rawAuthConfig?.password != null && typeof rawAuthConfig.password !== "string") throw new Error("gateway auth mode is password, but gateway.auth.password contains a provider reference object instead of a resolved string — bootstrap secrets (gateway.auth.password) must be plaintext strings or set via the MOLDCLAW_GATEWAY_PASSWORD environment variable because the secrets provider system has not initialised yet at gateway startup");
|
|
521
|
+
throw new Error("gateway auth mode is password, but no password was configured");
|
|
522
|
+
}
|
|
523
|
+
if (auth.mode === "trusted-proxy") {
|
|
524
|
+
if (!auth.trustedProxy) throw new Error("gateway auth mode is trusted-proxy, but no trustedProxy config was provided (set gateway.auth.trustedProxy)");
|
|
525
|
+
if (!auth.trustedProxy.userHeader || auth.trustedProxy.userHeader.trim() === "") throw new Error("gateway auth mode is trusted-proxy, but trustedProxy.userHeader is empty (set gateway.auth.trustedProxy.userHeader)");
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Check if the request came from a trusted proxy and extract user identity.
|
|
530
|
+
* Returns the user identity if valid, or null with a reason if not.
|
|
531
|
+
*/
|
|
532
|
+
function authorizeTrustedProxy(params) {
|
|
533
|
+
const { req, trustedProxies, trustedProxyConfig } = params;
|
|
534
|
+
if (!req) return { reason: "trusted_proxy_no_request" };
|
|
535
|
+
const remoteAddr = req.socket?.remoteAddress;
|
|
536
|
+
if (!remoteAddr || !isTrustedProxyAddress(remoteAddr, trustedProxies)) return { reason: "trusted_proxy_untrusted_source" };
|
|
537
|
+
const requiredHeaders = trustedProxyConfig.requiredHeaders ?? [];
|
|
538
|
+
for (const header of requiredHeaders) {
|
|
539
|
+
const value = headerValue(req.headers[header.toLowerCase()]);
|
|
540
|
+
if (!value || value.trim() === "") return { reason: `trusted_proxy_missing_header_${header}` };
|
|
541
|
+
}
|
|
542
|
+
const userHeaderValue = headerValue(req.headers[trustedProxyConfig.userHeader.toLowerCase()]);
|
|
543
|
+
if (!userHeaderValue || userHeaderValue.trim() === "") return { reason: "trusted_proxy_user_missing" };
|
|
544
|
+
const user = userHeaderValue.trim();
|
|
545
|
+
const allowUsers = trustedProxyConfig.allowUsers ?? [];
|
|
546
|
+
if (allowUsers.length > 0 && !allowUsers.includes(user)) return { reason: "trusted_proxy_user_not_allowed" };
|
|
547
|
+
return { user };
|
|
548
|
+
}
|
|
549
|
+
function shouldAllowTailscaleHeaderAuth(authSurface) {
|
|
550
|
+
return authSurface === "ws-control-ui";
|
|
551
|
+
}
|
|
552
|
+
async function authorizeGatewayConnect(params) {
|
|
553
|
+
const { auth, connectAuth, req, trustedProxies } = params;
|
|
554
|
+
const tailscaleWhois = params.tailscaleWhois ?? readTailscaleWhoisIdentity;
|
|
555
|
+
const allowTailscaleHeaderAuth = shouldAllowTailscaleHeaderAuth(params.authSurface ?? "http");
|
|
556
|
+
const localDirect = isLocalDirectRequest(req, trustedProxies, params.allowRealIpFallback === true);
|
|
557
|
+
if (auth.mode === "trusted-proxy") {
|
|
558
|
+
if (!auth.trustedProxy) return {
|
|
559
|
+
ok: false,
|
|
560
|
+
reason: "trusted_proxy_config_missing"
|
|
561
|
+
};
|
|
562
|
+
if (!trustedProxies || trustedProxies.length === 0) return {
|
|
563
|
+
ok: false,
|
|
564
|
+
reason: "trusted_proxy_no_proxies_configured"
|
|
565
|
+
};
|
|
566
|
+
const result = authorizeTrustedProxy({
|
|
567
|
+
req,
|
|
568
|
+
trustedProxies,
|
|
569
|
+
trustedProxyConfig: auth.trustedProxy
|
|
570
|
+
});
|
|
571
|
+
if ("user" in result) return {
|
|
572
|
+
ok: true,
|
|
573
|
+
method: "trusted-proxy",
|
|
574
|
+
user: result.user
|
|
575
|
+
};
|
|
576
|
+
return {
|
|
577
|
+
ok: false,
|
|
578
|
+
reason: result.reason
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
if (auth.mode === "none") return {
|
|
582
|
+
ok: true,
|
|
583
|
+
method: "none"
|
|
584
|
+
};
|
|
585
|
+
const limiter = params.rateLimiter;
|
|
586
|
+
const ip = params.clientIp ?? resolveRequestClientIp(req, trustedProxies, params.allowRealIpFallback === true) ?? req?.socket?.remoteAddress;
|
|
587
|
+
const rateLimitScope = params.rateLimitScope ?? "shared-secret";
|
|
588
|
+
if (limiter) {
|
|
589
|
+
const rlCheck = limiter.check(ip, rateLimitScope);
|
|
590
|
+
if (!rlCheck.allowed) return {
|
|
591
|
+
ok: false,
|
|
592
|
+
reason: "rate_limited",
|
|
593
|
+
rateLimited: true,
|
|
594
|
+
retryAfterMs: rlCheck.retryAfterMs
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
if (allowTailscaleHeaderAuth && auth.allowTailscale && !localDirect) {
|
|
598
|
+
const tailscaleCheck = await resolveVerifiedTailscaleUser({
|
|
599
|
+
req,
|
|
600
|
+
tailscaleWhois
|
|
601
|
+
});
|
|
602
|
+
if (tailscaleCheck.ok) {
|
|
603
|
+
limiter?.reset(ip, rateLimitScope);
|
|
604
|
+
return {
|
|
605
|
+
ok: true,
|
|
606
|
+
method: "tailscale",
|
|
607
|
+
user: tailscaleCheck.user.login
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
if (auth.mode === "token") {
|
|
612
|
+
if (!auth.token) return {
|
|
613
|
+
ok: false,
|
|
614
|
+
reason: "token_missing_config"
|
|
615
|
+
};
|
|
616
|
+
if (!connectAuth?.token) return {
|
|
617
|
+
ok: false,
|
|
618
|
+
reason: "token_missing"
|
|
619
|
+
};
|
|
620
|
+
if (!safeEqualSecret(connectAuth.token, auth.token)) {
|
|
621
|
+
limiter?.recordFailure(ip, rateLimitScope);
|
|
622
|
+
return {
|
|
623
|
+
ok: false,
|
|
624
|
+
reason: "token_mismatch"
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
limiter?.reset(ip, rateLimitScope);
|
|
628
|
+
return {
|
|
629
|
+
ok: true,
|
|
630
|
+
method: "token"
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
if (auth.mode === "password") {
|
|
634
|
+
const password = connectAuth?.password;
|
|
635
|
+
if (!auth.password) return {
|
|
636
|
+
ok: false,
|
|
637
|
+
reason: "password_missing_config"
|
|
638
|
+
};
|
|
639
|
+
if (!password) return {
|
|
640
|
+
ok: false,
|
|
641
|
+
reason: "password_missing"
|
|
642
|
+
};
|
|
643
|
+
if (!safeEqualSecret(password, auth.password)) {
|
|
644
|
+
limiter?.recordFailure(ip, rateLimitScope);
|
|
645
|
+
return {
|
|
646
|
+
ok: false,
|
|
647
|
+
reason: "password_mismatch"
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
limiter?.reset(ip, rateLimitScope);
|
|
651
|
+
return {
|
|
652
|
+
ok: true,
|
|
653
|
+
method: "password"
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
limiter?.recordFailure(ip, rateLimitScope);
|
|
657
|
+
return {
|
|
658
|
+
ok: false,
|
|
659
|
+
reason: "unauthorized"
|
|
660
|
+
};
|
|
661
|
+
}
|
|
662
|
+
async function authorizeHttpGatewayConnect(params) {
|
|
663
|
+
return authorizeGatewayConnect({
|
|
664
|
+
...params,
|
|
665
|
+
authSurface: "http"
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
async function authorizeWsControlUiGatewayConnect(params) {
|
|
669
|
+
return authorizeGatewayConnect({
|
|
670
|
+
...params,
|
|
671
|
+
authSurface: "ws-control-ui"
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
//#endregion
|
|
675
|
+
//#region src/config/port-defaults.ts
|
|
676
|
+
function isValidPort(port) {
|
|
677
|
+
return Number.isFinite(port) && port > 0 && port <= 65535;
|
|
678
|
+
}
|
|
679
|
+
function clampPort(port, fallback) {
|
|
680
|
+
return isValidPort(port) ? port : fallback;
|
|
681
|
+
}
|
|
682
|
+
function derivePort(base, offset, fallback) {
|
|
683
|
+
return clampPort(base + offset, fallback);
|
|
684
|
+
}
|
|
685
|
+
const DEFAULT_BROWSER_CONTROL_PORT = 18791;
|
|
686
|
+
const DEFAULT_BROWSER_CDP_PORT_RANGE_START = 18800;
|
|
687
|
+
const DEFAULT_BROWSER_CDP_PORT_RANGE_END = 18899;
|
|
688
|
+
function deriveDefaultBrowserControlPort(gatewayPort) {
|
|
689
|
+
return derivePort(gatewayPort, 2, DEFAULT_BROWSER_CONTROL_PORT);
|
|
690
|
+
}
|
|
691
|
+
function deriveDefaultBrowserCdpPortRange(browserControlPort) {
|
|
692
|
+
const start = derivePort(browserControlPort, 9, DEFAULT_BROWSER_CDP_PORT_RANGE_START);
|
|
693
|
+
const end = clampPort(start + (DEFAULT_BROWSER_CDP_PORT_RANGE_END - DEFAULT_BROWSER_CDP_PORT_RANGE_START), DEFAULT_BROWSER_CDP_PORT_RANGE_END);
|
|
694
|
+
if (end < start) return {
|
|
695
|
+
start,
|
|
696
|
+
end: start
|
|
697
|
+
};
|
|
698
|
+
return {
|
|
699
|
+
start,
|
|
700
|
+
end
|
|
701
|
+
};
|
|
702
|
+
}
|
|
703
|
+
const PROFILE_NAME_REGEX = /^[a-z0-9][a-z0-9-]*$/;
|
|
704
|
+
function isValidProfileName(name) {
|
|
705
|
+
if (!name || name.length > 64) return false;
|
|
706
|
+
return PROFILE_NAME_REGEX.test(name);
|
|
707
|
+
}
|
|
708
|
+
function allocateCdpPort(usedPorts, range) {
|
|
709
|
+
const start = range?.start ?? 18800;
|
|
710
|
+
const end = range?.end ?? 18899;
|
|
711
|
+
if (!Number.isFinite(start) || !Number.isFinite(end) || start <= 0 || end <= 0) return null;
|
|
712
|
+
if (start > end) return null;
|
|
713
|
+
for (let port = start; port <= end; port++) if (!usedPorts.has(port)) return port;
|
|
714
|
+
return null;
|
|
715
|
+
}
|
|
716
|
+
function getUsedPorts(profiles) {
|
|
717
|
+
if (!profiles) return /* @__PURE__ */ new Set();
|
|
718
|
+
const used = /* @__PURE__ */ new Set();
|
|
719
|
+
for (const profile of Object.values(profiles)) {
|
|
720
|
+
if (typeof profile.cdpPort === "number") {
|
|
721
|
+
used.add(profile.cdpPort);
|
|
722
|
+
continue;
|
|
723
|
+
}
|
|
724
|
+
const rawUrl = profile.cdpUrl?.trim();
|
|
725
|
+
if (!rawUrl) continue;
|
|
726
|
+
try {
|
|
727
|
+
const parsed = new URL(rawUrl);
|
|
728
|
+
const port = parsed.port && Number.parseInt(parsed.port, 10) > 0 ? Number.parseInt(parsed.port, 10) : parsed.protocol === "https:" ? 443 : 80;
|
|
729
|
+
if (!Number.isNaN(port) && port > 0 && port <= 65535) used.add(port);
|
|
730
|
+
} catch {}
|
|
731
|
+
}
|
|
732
|
+
return used;
|
|
733
|
+
}
|
|
734
|
+
const PROFILE_COLORS = [
|
|
735
|
+
"#FF4500",
|
|
736
|
+
"#0066CC",
|
|
737
|
+
"#00AA00",
|
|
738
|
+
"#9933FF",
|
|
739
|
+
"#FF6699",
|
|
740
|
+
"#00CCCC",
|
|
741
|
+
"#FF9900",
|
|
742
|
+
"#6666FF",
|
|
743
|
+
"#CC3366",
|
|
744
|
+
"#339966"
|
|
745
|
+
];
|
|
746
|
+
function allocateColor(usedColors) {
|
|
747
|
+
for (const color of PROFILE_COLORS) if (!usedColors.has(color.toUpperCase())) return color;
|
|
748
|
+
return PROFILE_COLORS[usedColors.size % PROFILE_COLORS.length] ?? PROFILE_COLORS[0];
|
|
749
|
+
}
|
|
750
|
+
function getUsedColors(profiles) {
|
|
751
|
+
if (!profiles) return /* @__PURE__ */ new Set();
|
|
752
|
+
return new Set(Object.values(profiles).map((p) => p.color.toUpperCase()));
|
|
753
|
+
}
|
|
754
|
+
//#endregion
|
|
755
|
+
//#region src/browser/config.ts
|
|
756
|
+
function normalizeHexColor(raw) {
|
|
757
|
+
const value = (raw ?? "").trim();
|
|
758
|
+
if (!value) return DEFAULT_MOLDCLAW_BROWSER_COLOR;
|
|
759
|
+
const normalized = value.startsWith("#") ? value : `#${value}`;
|
|
760
|
+
if (!/^#[0-9a-fA-F]{6}$/.test(normalized)) return DEFAULT_MOLDCLAW_BROWSER_COLOR;
|
|
761
|
+
return normalized.toUpperCase();
|
|
762
|
+
}
|
|
763
|
+
function normalizeTimeoutMs(raw, fallback) {
|
|
764
|
+
const value = typeof raw === "number" && Number.isFinite(raw) ? Math.floor(raw) : fallback;
|
|
765
|
+
return value < 0 ? fallback : value;
|
|
766
|
+
}
|
|
767
|
+
function resolveCdpPortRangeStart(rawStart, fallbackStart, rangeSpan) {
|
|
768
|
+
const start = typeof rawStart === "number" && Number.isFinite(rawStart) ? Math.floor(rawStart) : fallbackStart;
|
|
769
|
+
if (start < 1 || start > 65535) throw new Error(`browser.cdpPortRangeStart must be between 1 and 65535, got: ${start}`);
|
|
770
|
+
const maxStart = 65535 - rangeSpan;
|
|
771
|
+
if (start > maxStart) throw new Error(`browser.cdpPortRangeStart (${start}) is too high for a ${rangeSpan + 1}-port range; max is ${maxStart}.`);
|
|
772
|
+
return start;
|
|
773
|
+
}
|
|
774
|
+
function normalizeStringList(raw) {
|
|
775
|
+
if (!Array.isArray(raw) || raw.length === 0) return;
|
|
776
|
+
const values = raw.map((value) => value.trim()).filter((value) => value.length > 0);
|
|
777
|
+
return values.length > 0 ? values : void 0;
|
|
778
|
+
}
|
|
779
|
+
function resolveBrowserSsrFPolicy(cfg) {
|
|
780
|
+
const allowPrivateNetwork = cfg?.ssrfPolicy?.allowPrivateNetwork;
|
|
781
|
+
const dangerouslyAllowPrivateNetwork = cfg?.ssrfPolicy?.dangerouslyAllowPrivateNetwork;
|
|
782
|
+
const allowedHostnames = normalizeStringList(cfg?.ssrfPolicy?.allowedHostnames);
|
|
783
|
+
const hostnameAllowlist = normalizeStringList(cfg?.ssrfPolicy?.hostnameAllowlist);
|
|
784
|
+
const hasExplicitPrivateSetting = allowPrivateNetwork !== void 0 || dangerouslyAllowPrivateNetwork !== void 0;
|
|
785
|
+
const resolvedAllowPrivateNetwork = dangerouslyAllowPrivateNetwork === true || allowPrivateNetwork === true || !hasExplicitPrivateSetting;
|
|
786
|
+
if (!resolvedAllowPrivateNetwork && !hasExplicitPrivateSetting && !allowedHostnames && !hostnameAllowlist) return;
|
|
787
|
+
return {
|
|
788
|
+
...resolvedAllowPrivateNetwork ? { dangerouslyAllowPrivateNetwork: true } : {},
|
|
789
|
+
...allowedHostnames ? { allowedHostnames } : {},
|
|
790
|
+
...hostnameAllowlist ? { hostnameAllowlist } : {}
|
|
791
|
+
};
|
|
792
|
+
}
|
|
793
|
+
function parseHttpUrl(raw, label) {
|
|
794
|
+
const trimmed = raw.trim();
|
|
795
|
+
const parsed = new URL(trimmed);
|
|
796
|
+
if (![
|
|
797
|
+
"http:",
|
|
798
|
+
"https:",
|
|
799
|
+
"ws:",
|
|
800
|
+
"wss:"
|
|
801
|
+
].includes(parsed.protocol)) throw new Error(`${label} must be http(s) or ws(s), got: ${parsed.protocol.replace(":", "")}`);
|
|
802
|
+
const isSecure = parsed.protocol === "https:" || parsed.protocol === "wss:";
|
|
803
|
+
const port = parsed.port && Number.parseInt(parsed.port, 10) > 0 ? Number.parseInt(parsed.port, 10) : isSecure ? 443 : 80;
|
|
804
|
+
if (Number.isNaN(port) || port <= 0 || port > 65535) throw new Error(`${label} has invalid port: ${parsed.port}`);
|
|
805
|
+
return {
|
|
806
|
+
parsed,
|
|
807
|
+
port,
|
|
808
|
+
normalized: parsed.toString().replace(/\/$/, "")
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* Ensure the default "moldclaw" profile exists in the profiles map.
|
|
813
|
+
* Auto-creates it with the legacy CDP port (from browser.cdpUrl) or first port if missing.
|
|
814
|
+
*/
|
|
815
|
+
function ensureDefaultProfile(profiles, defaultColor, legacyCdpPort, derivedDefaultCdpPort, legacyCdpUrl) {
|
|
816
|
+
const result = { ...profiles };
|
|
817
|
+
if (!result["moldclaw"]) result[DEFAULT_MOLDCLAW_BROWSER_PROFILE_NAME] = {
|
|
818
|
+
cdpPort: legacyCdpPort ?? derivedDefaultCdpPort ?? 18800,
|
|
819
|
+
color: defaultColor,
|
|
820
|
+
...legacyCdpUrl ? { cdpUrl: legacyCdpUrl } : {}
|
|
821
|
+
};
|
|
822
|
+
return result;
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* Ensure a built-in "user" profile exists for Chrome's existing-session attach flow.
|
|
826
|
+
*/
|
|
827
|
+
function ensureDefaultUserBrowserProfile(profiles) {
|
|
828
|
+
const result = { ...profiles };
|
|
829
|
+
if (result.user) return result;
|
|
830
|
+
result.user = {
|
|
831
|
+
driver: "existing-session",
|
|
832
|
+
attachOnly: true,
|
|
833
|
+
color: "#00AA00"
|
|
834
|
+
};
|
|
835
|
+
return result;
|
|
836
|
+
}
|
|
837
|
+
function resolveBrowserConfig(cfg, rootConfig) {
|
|
838
|
+
const enabled = cfg?.enabled ?? true;
|
|
839
|
+
const evaluateEnabled = cfg?.evaluateEnabled ?? true;
|
|
840
|
+
const controlPort = deriveDefaultBrowserControlPort(resolveGatewayPort(rootConfig) ?? 18791);
|
|
841
|
+
const defaultColor = normalizeHexColor(cfg?.color);
|
|
842
|
+
const remoteCdpTimeoutMs = normalizeTimeoutMs(cfg?.remoteCdpTimeoutMs, 1500);
|
|
843
|
+
const remoteCdpHandshakeTimeoutMs = normalizeTimeoutMs(cfg?.remoteCdpHandshakeTimeoutMs, Math.max(2e3, remoteCdpTimeoutMs * 2));
|
|
844
|
+
const derivedCdpRange = deriveDefaultBrowserCdpPortRange(controlPort);
|
|
845
|
+
const cdpRangeSpan = derivedCdpRange.end - derivedCdpRange.start;
|
|
846
|
+
const cdpPortRangeStart = resolveCdpPortRangeStart(cfg?.cdpPortRangeStart, derivedCdpRange.start, cdpRangeSpan);
|
|
847
|
+
const cdpPortRangeEnd = cdpPortRangeStart + cdpRangeSpan;
|
|
848
|
+
const rawCdpUrl = (cfg?.cdpUrl ?? "").trim();
|
|
849
|
+
let cdpInfo;
|
|
850
|
+
if (rawCdpUrl) cdpInfo = parseHttpUrl(rawCdpUrl, "browser.cdpUrl");
|
|
851
|
+
else {
|
|
852
|
+
const derivedPort = controlPort + 1;
|
|
853
|
+
if (derivedPort > 65535) throw new Error(`Derived CDP port (${derivedPort}) is too high; check gateway port configuration.`);
|
|
854
|
+
const derived = new URL(`http://127.0.0.1:${derivedPort}`);
|
|
855
|
+
cdpInfo = {
|
|
856
|
+
parsed: derived,
|
|
857
|
+
port: derivedPort,
|
|
858
|
+
normalized: derived.toString().replace(/\/$/, "")
|
|
859
|
+
};
|
|
860
|
+
}
|
|
861
|
+
const headless = cfg?.headless === true;
|
|
862
|
+
const noSandbox = cfg?.noSandbox === true;
|
|
863
|
+
const attachOnly = cfg?.attachOnly === true;
|
|
864
|
+
const executablePath = cfg?.executablePath?.trim() || void 0;
|
|
865
|
+
const defaultProfileFromConfig = cfg?.defaultProfile?.trim() || void 0;
|
|
866
|
+
const legacyCdpPort = rawCdpUrl ? cdpInfo.port : void 0;
|
|
867
|
+
const isWsUrl = cdpInfo.parsed.protocol === "ws:" || cdpInfo.parsed.protocol === "wss:";
|
|
868
|
+
const legacyCdpUrl = rawCdpUrl && isWsUrl ? cdpInfo.normalized : void 0;
|
|
869
|
+
const profiles = ensureDefaultUserBrowserProfile(ensureDefaultProfile(cfg?.profiles, defaultColor, legacyCdpPort, cdpPortRangeStart, legacyCdpUrl));
|
|
870
|
+
const cdpProtocol = cdpInfo.parsed.protocol === "https:" ? "https" : "http";
|
|
871
|
+
const defaultProfile = defaultProfileFromConfig ?? (profiles["moldclaw"] ? "moldclaw" : profiles["moldclaw"] ? "moldclaw" : "user");
|
|
872
|
+
const extraArgs = Array.isArray(cfg?.extraArgs) ? cfg.extraArgs.filter((a) => typeof a === "string" && a.trim().length > 0) : [];
|
|
873
|
+
const ssrfPolicy = resolveBrowserSsrFPolicy(cfg);
|
|
874
|
+
return {
|
|
875
|
+
enabled,
|
|
876
|
+
evaluateEnabled,
|
|
877
|
+
controlPort,
|
|
878
|
+
cdpPortRangeStart,
|
|
879
|
+
cdpPortRangeEnd,
|
|
880
|
+
cdpProtocol,
|
|
881
|
+
cdpHost: cdpInfo.parsed.hostname,
|
|
882
|
+
cdpIsLoopback: isLoopbackHost(cdpInfo.parsed.hostname),
|
|
883
|
+
remoteCdpTimeoutMs,
|
|
884
|
+
remoteCdpHandshakeTimeoutMs,
|
|
885
|
+
color: defaultColor,
|
|
886
|
+
executablePath,
|
|
887
|
+
headless,
|
|
888
|
+
noSandbox,
|
|
889
|
+
attachOnly,
|
|
890
|
+
defaultProfile,
|
|
891
|
+
profiles,
|
|
892
|
+
ssrfPolicy,
|
|
893
|
+
extraArgs
|
|
894
|
+
};
|
|
895
|
+
}
|
|
896
|
+
/**
|
|
897
|
+
* Resolve a profile by name from the config.
|
|
898
|
+
* Returns null if the profile doesn't exist.
|
|
899
|
+
*/
|
|
900
|
+
function resolveProfile(resolved, profileName) {
|
|
901
|
+
const profile = resolved.profiles[profileName];
|
|
902
|
+
if (!profile) return null;
|
|
903
|
+
const rawProfileUrl = profile.cdpUrl?.trim() ?? "";
|
|
904
|
+
let cdpHost = resolved.cdpHost;
|
|
905
|
+
let cdpPort = profile.cdpPort ?? 0;
|
|
906
|
+
let cdpUrl = "";
|
|
907
|
+
const driver = profile.driver === "existing-session" ? "existing-session" : "moldclaw";
|
|
908
|
+
if (driver === "existing-session") return {
|
|
909
|
+
name: profileName,
|
|
910
|
+
cdpPort: 0,
|
|
911
|
+
cdpUrl: "",
|
|
912
|
+
cdpHost: "",
|
|
913
|
+
cdpIsLoopback: true,
|
|
914
|
+
userDataDir: resolveUserPath(profile.userDataDir?.trim() || "") || void 0,
|
|
915
|
+
color: profile.color,
|
|
916
|
+
driver,
|
|
917
|
+
attachOnly: true
|
|
918
|
+
};
|
|
919
|
+
if (rawProfileUrl) {
|
|
920
|
+
const parsed = parseHttpUrl(rawProfileUrl, `browser.profiles.${profileName}.cdpUrl`);
|
|
921
|
+
cdpHost = parsed.parsed.hostname;
|
|
922
|
+
cdpPort = parsed.port;
|
|
923
|
+
cdpUrl = parsed.normalized;
|
|
924
|
+
} else if (cdpPort) cdpUrl = `${resolved.cdpProtocol}://${resolved.cdpHost}:${cdpPort}`;
|
|
925
|
+
else throw new Error(`Profile "${profileName}" must define cdpPort or cdpUrl.`);
|
|
926
|
+
return {
|
|
927
|
+
name: profileName,
|
|
928
|
+
cdpPort,
|
|
929
|
+
cdpUrl,
|
|
930
|
+
cdpHost,
|
|
931
|
+
cdpIsLoopback: isLoopbackHost(cdpHost),
|
|
932
|
+
color: profile.color,
|
|
933
|
+
driver,
|
|
934
|
+
attachOnly: profile.attachOnly ?? resolved.attachOnly
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
//#endregion
|
|
938
|
+
export { DEFAULT_AI_SNAPSHOT_MAX_CHARS as A, enableTailscaleServe as C, ensureBinary as D, readTailscaleStatusJson as E, DEFAULT_MOLDCLAW_BROWSER_PROFILE_NAME as M, promptYesNo as O, enableTailscaleFunnel as S, getTailnetHostname as T, AUTH_RATE_LIMIT_SCOPE_SHARED_SECRET as _, allocateColor as a, disableTailscaleFunnel as b, isValidProfileName as c, authorizeHttpGatewayConnect as d, authorizeWsControlUiGatewayConnect as f, AUTH_RATE_LIMIT_SCOPE_HOOK_AUTH as g, AUTH_RATE_LIMIT_SCOPE_DEVICE_TOKEN as h, allocateCdpPort as i, DEFAULT_MOLDCLAW_BROWSER_COLOR as j, DEFAULT_AI_SNAPSHOT_EFFICIENT_MAX_CHARS as k, deriveDefaultBrowserCdpPortRange as l, resolveGatewayAuth as m, resolveBrowserConfig as n, getUsedColors as o, isLocalDirectRequest as p, resolveProfile as r, getUsedPorts as s, parseHttpUrl as t, assertGatewayAuthConfigured as u, createAuthRateLimiter as v, findTailscaleBinary as w, disableTailscaleServe as x, normalizeRateLimitClientIp as y };
|