@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
|
@@ -1,1496 +0,0 @@
|
|
|
1
|
-
import { h as pathExists } from "./utils-rjVNXUns.js";
|
|
2
|
-
import { $u as normalizeOptionalText, Hu as trimLogTail, Xu as inferLegacyName, Yu as resolveDefaultCronStaggerMs, ef as applyPathPrepend, id as normalizeLegacyDeliveryInput, nd as migrateLegacyCronPayload, qu as normalizeCronStaggerMs, rd as parseAbsoluteTimeMs } from "./auth-profiles-BJcHzwPy.js";
|
|
3
|
-
import { n as runCommandWithTimeout } from "./exec-CoBTyh8B.js";
|
|
4
|
-
import { s as resolveStableNodePath } from "./runtime-paths-DPdaWILN.js";
|
|
5
|
-
import { i as resolveControlUiDistIndexPathForRoot, r as resolveControlUiDistIndexHealth } from "./control-ui-assets-Bwqp8PYM.js";
|
|
6
|
-
import { c as DEV_BRANCH, d as isBetaTag, f as isStableTag, l as channelToNpmTag, n as compareSemverStrings, o as detectPackageManager$1 } from "./update-check-Me_VZCOt.js";
|
|
7
|
-
import path from "node:path";
|
|
8
|
-
import os from "node:os";
|
|
9
|
-
import fs from "node:fs/promises";
|
|
10
|
-
import { Cron } from "croner";
|
|
11
|
-
//#region src/cron/schedule.ts
|
|
12
|
-
const CRON_EVAL_CACHE_MAX = 512;
|
|
13
|
-
const cronEvalCache = /* @__PURE__ */ new Map();
|
|
14
|
-
function resolveCronTimezone(tz) {
|
|
15
|
-
const trimmed = typeof tz === "string" ? tz.trim() : "";
|
|
16
|
-
if (trimmed) return trimmed;
|
|
17
|
-
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
18
|
-
}
|
|
19
|
-
function resolveCachedCron(expr, timezone) {
|
|
20
|
-
const key = `${timezone}\u0000${expr}`;
|
|
21
|
-
const cached = cronEvalCache.get(key);
|
|
22
|
-
if (cached) return cached;
|
|
23
|
-
if (cronEvalCache.size >= CRON_EVAL_CACHE_MAX) {
|
|
24
|
-
const oldest = cronEvalCache.keys().next().value;
|
|
25
|
-
if (oldest) cronEvalCache.delete(oldest);
|
|
26
|
-
}
|
|
27
|
-
const next = new Cron(expr, {
|
|
28
|
-
timezone,
|
|
29
|
-
catch: false
|
|
30
|
-
});
|
|
31
|
-
cronEvalCache.set(key, next);
|
|
32
|
-
return next;
|
|
33
|
-
}
|
|
34
|
-
function resolveCronFromSchedule(schedule) {
|
|
35
|
-
const exprSource = typeof schedule.expr === "string" ? schedule.expr : schedule.cron;
|
|
36
|
-
if (typeof exprSource !== "string") throw new Error("invalid cron schedule: expr is required");
|
|
37
|
-
const expr = exprSource.trim();
|
|
38
|
-
if (!expr) return;
|
|
39
|
-
return resolveCachedCron(expr, resolveCronTimezone(schedule.tz));
|
|
40
|
-
}
|
|
41
|
-
function coerceFiniteScheduleNumber(value) {
|
|
42
|
-
if (typeof value === "number") return Number.isFinite(value) ? value : void 0;
|
|
43
|
-
if (typeof value === "string") {
|
|
44
|
-
const trimmed = value.trim();
|
|
45
|
-
if (!trimmed) return;
|
|
46
|
-
const parsed = Number(trimmed);
|
|
47
|
-
return Number.isFinite(parsed) ? parsed : void 0;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
function computeNextRunAtMs(schedule, nowMs) {
|
|
51
|
-
if (schedule.kind === "at") {
|
|
52
|
-
const sched = schedule;
|
|
53
|
-
const atMs = typeof sched.atMs === "number" && Number.isFinite(sched.atMs) && sched.atMs > 0 ? sched.atMs : typeof sched.atMs === "string" ? parseAbsoluteTimeMs(sched.atMs) : typeof sched.at === "string" ? parseAbsoluteTimeMs(sched.at) : null;
|
|
54
|
-
if (atMs === null) return;
|
|
55
|
-
return atMs > nowMs ? atMs : void 0;
|
|
56
|
-
}
|
|
57
|
-
if (schedule.kind === "every") {
|
|
58
|
-
const everyMsRaw = coerceFiniteScheduleNumber(schedule.everyMs);
|
|
59
|
-
if (everyMsRaw === void 0) return;
|
|
60
|
-
const everyMs = Math.max(1, Math.floor(everyMsRaw));
|
|
61
|
-
const anchorRaw = coerceFiniteScheduleNumber(schedule.anchorMs);
|
|
62
|
-
const anchor = Math.max(0, Math.floor(anchorRaw ?? nowMs));
|
|
63
|
-
if (nowMs < anchor) return anchor;
|
|
64
|
-
const elapsed = nowMs - anchor;
|
|
65
|
-
return anchor + Math.max(1, Math.floor((elapsed + everyMs - 1) / everyMs)) * everyMs;
|
|
66
|
-
}
|
|
67
|
-
const cron = resolveCronFromSchedule(schedule);
|
|
68
|
-
if (!cron) return;
|
|
69
|
-
let next = cron.nextRun(new Date(nowMs));
|
|
70
|
-
if (!next) return;
|
|
71
|
-
let nextMs = next.getTime();
|
|
72
|
-
if (!Number.isFinite(nextMs)) return;
|
|
73
|
-
if (nextMs <= nowMs) {
|
|
74
|
-
const nextSecondMs = Math.floor(nowMs / 1e3) * 1e3 + 1e3;
|
|
75
|
-
const retry = cron.nextRun(new Date(nextSecondMs));
|
|
76
|
-
if (retry) {
|
|
77
|
-
const retryMs = retry.getTime();
|
|
78
|
-
if (Number.isFinite(retryMs) && retryMs > nowMs) return retryMs;
|
|
79
|
-
}
|
|
80
|
-
const tomorrowMs = new Date(nowMs).setUTCHours(24, 0, 0, 0);
|
|
81
|
-
const retry2 = cron.nextRun(new Date(tomorrowMs));
|
|
82
|
-
if (retry2) {
|
|
83
|
-
const retry2Ms = retry2.getTime();
|
|
84
|
-
if (Number.isFinite(retry2Ms) && retry2Ms > nowMs) return retry2Ms;
|
|
85
|
-
}
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
return nextMs;
|
|
89
|
-
}
|
|
90
|
-
function computePreviousRunAtMs(schedule, nowMs) {
|
|
91
|
-
if (schedule.kind !== "cron") return;
|
|
92
|
-
const cron = resolveCronFromSchedule(schedule);
|
|
93
|
-
if (!cron) return;
|
|
94
|
-
const previous = cron.previousRuns(1, new Date(nowMs))[0];
|
|
95
|
-
if (!previous) return;
|
|
96
|
-
const previousMs = previous.getTime();
|
|
97
|
-
if (!Number.isFinite(previousMs)) return;
|
|
98
|
-
if (previousMs >= nowMs) return;
|
|
99
|
-
return previousMs;
|
|
100
|
-
}
|
|
101
|
-
//#endregion
|
|
102
|
-
//#region src/cron/store-migration.ts
|
|
103
|
-
function incrementIssue(issues, key) {
|
|
104
|
-
issues[key] = (issues[key] ?? 0) + 1;
|
|
105
|
-
}
|
|
106
|
-
function normalizePayloadKind(payload) {
|
|
107
|
-
const raw = typeof payload.kind === "string" ? payload.kind.trim().toLowerCase() : "";
|
|
108
|
-
if (raw === "agentturn") {
|
|
109
|
-
if (payload.kind !== "agentTurn") {
|
|
110
|
-
payload.kind = "agentTurn";
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
return false;
|
|
114
|
-
}
|
|
115
|
-
if (raw === "systemevent") {
|
|
116
|
-
if (payload.kind !== "systemEvent") {
|
|
117
|
-
payload.kind = "systemEvent";
|
|
118
|
-
return true;
|
|
119
|
-
}
|
|
120
|
-
return false;
|
|
121
|
-
}
|
|
122
|
-
return false;
|
|
123
|
-
}
|
|
124
|
-
function inferPayloadIfMissing(raw) {
|
|
125
|
-
const message = typeof raw.message === "string" ? raw.message.trim() : "";
|
|
126
|
-
const text = typeof raw.text === "string" ? raw.text.trim() : "";
|
|
127
|
-
const command = typeof raw.command === "string" ? raw.command.trim() : "";
|
|
128
|
-
if (message) {
|
|
129
|
-
raw.payload = {
|
|
130
|
-
kind: "agentTurn",
|
|
131
|
-
message
|
|
132
|
-
};
|
|
133
|
-
return true;
|
|
134
|
-
}
|
|
135
|
-
if (text) {
|
|
136
|
-
raw.payload = {
|
|
137
|
-
kind: "systemEvent",
|
|
138
|
-
text
|
|
139
|
-
};
|
|
140
|
-
return true;
|
|
141
|
-
}
|
|
142
|
-
if (command) {
|
|
143
|
-
raw.payload = {
|
|
144
|
-
kind: "systemEvent",
|
|
145
|
-
text: command
|
|
146
|
-
};
|
|
147
|
-
return true;
|
|
148
|
-
}
|
|
149
|
-
return false;
|
|
150
|
-
}
|
|
151
|
-
function copyTopLevelAgentTurnFields(raw, payload) {
|
|
152
|
-
let mutated = false;
|
|
153
|
-
const copyTrimmedString = (field) => {
|
|
154
|
-
const existing = payload[field];
|
|
155
|
-
if (typeof existing === "string" && existing.trim()) return;
|
|
156
|
-
const value = raw[field];
|
|
157
|
-
if (typeof value === "string" && value.trim()) {
|
|
158
|
-
payload[field] = value.trim();
|
|
159
|
-
mutated = true;
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
copyTrimmedString("model");
|
|
163
|
-
copyTrimmedString("thinking");
|
|
164
|
-
if (typeof payload.timeoutSeconds !== "number" && typeof raw.timeoutSeconds === "number" && Number.isFinite(raw.timeoutSeconds)) {
|
|
165
|
-
payload.timeoutSeconds = Math.max(0, Math.floor(raw.timeoutSeconds));
|
|
166
|
-
mutated = true;
|
|
167
|
-
}
|
|
168
|
-
if (typeof payload.allowUnsafeExternalContent !== "boolean" && typeof raw.allowUnsafeExternalContent === "boolean") {
|
|
169
|
-
payload.allowUnsafeExternalContent = raw.allowUnsafeExternalContent;
|
|
170
|
-
mutated = true;
|
|
171
|
-
}
|
|
172
|
-
if (typeof payload.deliver !== "boolean" && typeof raw.deliver === "boolean") {
|
|
173
|
-
payload.deliver = raw.deliver;
|
|
174
|
-
mutated = true;
|
|
175
|
-
}
|
|
176
|
-
if (typeof payload.channel !== "string" && typeof raw.channel === "string" && raw.channel.trim()) {
|
|
177
|
-
payload.channel = raw.channel.trim();
|
|
178
|
-
mutated = true;
|
|
179
|
-
}
|
|
180
|
-
if (typeof payload.to !== "string" && typeof raw.to === "string" && raw.to.trim()) {
|
|
181
|
-
payload.to = raw.to.trim();
|
|
182
|
-
mutated = true;
|
|
183
|
-
}
|
|
184
|
-
if (typeof payload.bestEffortDeliver !== "boolean" && typeof raw.bestEffortDeliver === "boolean") {
|
|
185
|
-
payload.bestEffortDeliver = raw.bestEffortDeliver;
|
|
186
|
-
mutated = true;
|
|
187
|
-
}
|
|
188
|
-
if (typeof payload.provider !== "string" && typeof raw.provider === "string" && raw.provider.trim()) {
|
|
189
|
-
payload.provider = raw.provider.trim();
|
|
190
|
-
mutated = true;
|
|
191
|
-
}
|
|
192
|
-
return mutated;
|
|
193
|
-
}
|
|
194
|
-
function stripLegacyTopLevelFields(raw) {
|
|
195
|
-
if ("model" in raw) delete raw.model;
|
|
196
|
-
if ("thinking" in raw) delete raw.thinking;
|
|
197
|
-
if ("timeoutSeconds" in raw) delete raw.timeoutSeconds;
|
|
198
|
-
if ("allowUnsafeExternalContent" in raw) delete raw.allowUnsafeExternalContent;
|
|
199
|
-
if ("message" in raw) delete raw.message;
|
|
200
|
-
if ("text" in raw) delete raw.text;
|
|
201
|
-
if ("deliver" in raw) delete raw.deliver;
|
|
202
|
-
if ("channel" in raw) delete raw.channel;
|
|
203
|
-
if ("to" in raw) delete raw.to;
|
|
204
|
-
if ("bestEffortDeliver" in raw) delete raw.bestEffortDeliver;
|
|
205
|
-
if ("provider" in raw) delete raw.provider;
|
|
206
|
-
if ("command" in raw) delete raw.command;
|
|
207
|
-
if ("timeout" in raw) delete raw.timeout;
|
|
208
|
-
}
|
|
209
|
-
function normalizeStoredCronJobs(jobs) {
|
|
210
|
-
const issues = {};
|
|
211
|
-
let mutated = false;
|
|
212
|
-
for (const raw of jobs) {
|
|
213
|
-
const jobIssues = /* @__PURE__ */ new Set();
|
|
214
|
-
const trackIssue = (key) => {
|
|
215
|
-
if (jobIssues.has(key)) return;
|
|
216
|
-
jobIssues.add(key);
|
|
217
|
-
incrementIssue(issues, key);
|
|
218
|
-
};
|
|
219
|
-
const state = raw.state;
|
|
220
|
-
if (!state || typeof state !== "object" || Array.isArray(state)) {
|
|
221
|
-
raw.state = {};
|
|
222
|
-
mutated = true;
|
|
223
|
-
}
|
|
224
|
-
const rawId = typeof raw.id === "string" ? raw.id.trim() : "";
|
|
225
|
-
const legacyJobId = typeof raw.jobId === "string" ? raw.jobId.trim() : "";
|
|
226
|
-
if (!rawId && legacyJobId) {
|
|
227
|
-
raw.id = legacyJobId;
|
|
228
|
-
mutated = true;
|
|
229
|
-
trackIssue("jobId");
|
|
230
|
-
} else if (rawId && raw.id !== rawId) {
|
|
231
|
-
raw.id = rawId;
|
|
232
|
-
mutated = true;
|
|
233
|
-
}
|
|
234
|
-
if ("jobId" in raw) {
|
|
235
|
-
delete raw.jobId;
|
|
236
|
-
mutated = true;
|
|
237
|
-
trackIssue("jobId");
|
|
238
|
-
}
|
|
239
|
-
if (typeof raw.schedule === "string") {
|
|
240
|
-
raw.schedule = {
|
|
241
|
-
kind: "cron",
|
|
242
|
-
expr: raw.schedule.trim()
|
|
243
|
-
};
|
|
244
|
-
mutated = true;
|
|
245
|
-
trackIssue("legacyScheduleString");
|
|
246
|
-
}
|
|
247
|
-
const nameRaw = raw.name;
|
|
248
|
-
if (typeof nameRaw !== "string" || nameRaw.trim().length === 0) {
|
|
249
|
-
raw.name = inferLegacyName({
|
|
250
|
-
schedule: raw.schedule,
|
|
251
|
-
payload: raw.payload
|
|
252
|
-
});
|
|
253
|
-
mutated = true;
|
|
254
|
-
} else raw.name = nameRaw.trim();
|
|
255
|
-
const desc = normalizeOptionalText(raw.description);
|
|
256
|
-
if (raw.description !== desc) {
|
|
257
|
-
raw.description = desc;
|
|
258
|
-
mutated = true;
|
|
259
|
-
}
|
|
260
|
-
if ("sessionKey" in raw) {
|
|
261
|
-
const sessionKey = typeof raw.sessionKey === "string" ? normalizeOptionalText(raw.sessionKey) : void 0;
|
|
262
|
-
if (raw.sessionKey !== sessionKey) {
|
|
263
|
-
raw.sessionKey = sessionKey;
|
|
264
|
-
mutated = true;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
if (typeof raw.enabled !== "boolean") {
|
|
268
|
-
raw.enabled = true;
|
|
269
|
-
mutated = true;
|
|
270
|
-
}
|
|
271
|
-
const wakeModeRaw = typeof raw.wakeMode === "string" ? raw.wakeMode.trim().toLowerCase() : "";
|
|
272
|
-
if (wakeModeRaw === "next-heartbeat") {
|
|
273
|
-
if (raw.wakeMode !== "next-heartbeat") {
|
|
274
|
-
raw.wakeMode = "next-heartbeat";
|
|
275
|
-
mutated = true;
|
|
276
|
-
}
|
|
277
|
-
} else if (wakeModeRaw === "now") {
|
|
278
|
-
if (raw.wakeMode !== "now") {
|
|
279
|
-
raw.wakeMode = "now";
|
|
280
|
-
mutated = true;
|
|
281
|
-
}
|
|
282
|
-
} else {
|
|
283
|
-
raw.wakeMode = "now";
|
|
284
|
-
mutated = true;
|
|
285
|
-
}
|
|
286
|
-
const payload = raw.payload;
|
|
287
|
-
if ((!payload || typeof payload !== "object" || Array.isArray(payload)) && inferPayloadIfMissing(raw)) {
|
|
288
|
-
mutated = true;
|
|
289
|
-
trackIssue("legacyTopLevelPayloadFields");
|
|
290
|
-
}
|
|
291
|
-
const payloadRecord = raw.payload && typeof raw.payload === "object" && !Array.isArray(raw.payload) ? raw.payload : null;
|
|
292
|
-
if (payloadRecord) {
|
|
293
|
-
if (normalizePayloadKind(payloadRecord)) {
|
|
294
|
-
mutated = true;
|
|
295
|
-
trackIssue("legacyPayloadKind");
|
|
296
|
-
}
|
|
297
|
-
if (!payloadRecord.kind) {
|
|
298
|
-
if (typeof payloadRecord.message === "string" && payloadRecord.message.trim()) {
|
|
299
|
-
payloadRecord.kind = "agentTurn";
|
|
300
|
-
mutated = true;
|
|
301
|
-
trackIssue("legacyPayloadKind");
|
|
302
|
-
} else if (typeof payloadRecord.text === "string" && payloadRecord.text.trim()) {
|
|
303
|
-
payloadRecord.kind = "systemEvent";
|
|
304
|
-
mutated = true;
|
|
305
|
-
trackIssue("legacyPayloadKind");
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
if (payloadRecord.kind === "agentTurn" && copyTopLevelAgentTurnFields(raw, payloadRecord)) mutated = true;
|
|
309
|
-
}
|
|
310
|
-
const hadLegacyTopLevelPayloadFields = "model" in raw || "thinking" in raw || "timeoutSeconds" in raw || "allowUnsafeExternalContent" in raw || "message" in raw || "text" in raw || "command" in raw || "timeout" in raw;
|
|
311
|
-
const hadLegacyTopLevelDeliveryFields = "deliver" in raw || "channel" in raw || "to" in raw || "bestEffortDeliver" in raw || "provider" in raw;
|
|
312
|
-
if (hadLegacyTopLevelPayloadFields || hadLegacyTopLevelDeliveryFields) {
|
|
313
|
-
stripLegacyTopLevelFields(raw);
|
|
314
|
-
mutated = true;
|
|
315
|
-
if (hadLegacyTopLevelPayloadFields) trackIssue("legacyTopLevelPayloadFields");
|
|
316
|
-
if (hadLegacyTopLevelDeliveryFields) trackIssue("legacyTopLevelDeliveryFields");
|
|
317
|
-
}
|
|
318
|
-
if (payloadRecord) {
|
|
319
|
-
const hadLegacyPayloadProvider = typeof payloadRecord.provider === "string" && payloadRecord.provider.trim().length > 0;
|
|
320
|
-
if (migrateLegacyCronPayload(payloadRecord)) {
|
|
321
|
-
mutated = true;
|
|
322
|
-
if (hadLegacyPayloadProvider) trackIssue("legacyPayloadProvider");
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
const schedule = raw.schedule;
|
|
326
|
-
if (schedule && typeof schedule === "object" && !Array.isArray(schedule)) {
|
|
327
|
-
const sched = schedule;
|
|
328
|
-
const kind = typeof sched.kind === "string" ? sched.kind.trim().toLowerCase() : "";
|
|
329
|
-
if (!kind && ("at" in sched || "atMs" in sched)) {
|
|
330
|
-
sched.kind = "at";
|
|
331
|
-
mutated = true;
|
|
332
|
-
}
|
|
333
|
-
const atRaw = typeof sched.at === "string" ? sched.at.trim() : "";
|
|
334
|
-
const atMsRaw = sched.atMs;
|
|
335
|
-
const parsedAtMs = typeof atMsRaw === "number" ? atMsRaw : typeof atMsRaw === "string" ? parseAbsoluteTimeMs(atMsRaw) : atRaw ? parseAbsoluteTimeMs(atRaw) : null;
|
|
336
|
-
if (parsedAtMs !== null) {
|
|
337
|
-
sched.at = new Date(parsedAtMs).toISOString();
|
|
338
|
-
if ("atMs" in sched) delete sched.atMs;
|
|
339
|
-
mutated = true;
|
|
340
|
-
}
|
|
341
|
-
const everyMsRaw = sched.everyMs;
|
|
342
|
-
const everyMsCoerced = coerceFiniteScheduleNumber(everyMsRaw);
|
|
343
|
-
const everyMs = everyMsCoerced !== void 0 ? Math.floor(everyMsCoerced) : null;
|
|
344
|
-
if (everyMs !== null && everyMsRaw !== everyMs) {
|
|
345
|
-
sched.everyMs = everyMs;
|
|
346
|
-
mutated = true;
|
|
347
|
-
}
|
|
348
|
-
if ((kind === "every" || sched.kind === "every") && everyMs !== null) {
|
|
349
|
-
const anchorRaw = sched.anchorMs;
|
|
350
|
-
const anchorCoerced = coerceFiniteScheduleNumber(anchorRaw);
|
|
351
|
-
const normalizedAnchor = anchorCoerced !== void 0 ? Math.max(0, Math.floor(anchorCoerced)) : typeof raw.createdAtMs === "number" && Number.isFinite(raw.createdAtMs) ? Math.max(0, Math.floor(raw.createdAtMs)) : typeof raw.updatedAtMs === "number" && Number.isFinite(raw.updatedAtMs) ? Math.max(0, Math.floor(raw.updatedAtMs)) : null;
|
|
352
|
-
if (normalizedAnchor !== null && anchorRaw !== normalizedAnchor) {
|
|
353
|
-
sched.anchorMs = normalizedAnchor;
|
|
354
|
-
mutated = true;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
const exprRaw = typeof sched.expr === "string" ? sched.expr.trim() : "";
|
|
358
|
-
const legacyCronRaw = typeof sched.cron === "string" ? sched.cron.trim() : "";
|
|
359
|
-
let normalizedExpr = exprRaw;
|
|
360
|
-
if (!normalizedExpr && legacyCronRaw) {
|
|
361
|
-
normalizedExpr = legacyCronRaw;
|
|
362
|
-
sched.expr = normalizedExpr;
|
|
363
|
-
mutated = true;
|
|
364
|
-
trackIssue("legacyScheduleCron");
|
|
365
|
-
}
|
|
366
|
-
if (typeof sched.expr === "string" && sched.expr !== normalizedExpr) {
|
|
367
|
-
sched.expr = normalizedExpr;
|
|
368
|
-
mutated = true;
|
|
369
|
-
}
|
|
370
|
-
if ("cron" in sched) {
|
|
371
|
-
delete sched.cron;
|
|
372
|
-
mutated = true;
|
|
373
|
-
trackIssue("legacyScheduleCron");
|
|
374
|
-
}
|
|
375
|
-
if ((kind === "cron" || sched.kind === "cron") && normalizedExpr) {
|
|
376
|
-
const explicitStaggerMs = normalizeCronStaggerMs(sched.staggerMs);
|
|
377
|
-
const defaultStaggerMs = resolveDefaultCronStaggerMs(normalizedExpr);
|
|
378
|
-
const targetStaggerMs = explicitStaggerMs ?? defaultStaggerMs;
|
|
379
|
-
if (targetStaggerMs === void 0) {
|
|
380
|
-
if ("staggerMs" in sched) {
|
|
381
|
-
delete sched.staggerMs;
|
|
382
|
-
mutated = true;
|
|
383
|
-
}
|
|
384
|
-
} else if (sched.staggerMs !== targetStaggerMs) {
|
|
385
|
-
sched.staggerMs = targetStaggerMs;
|
|
386
|
-
mutated = true;
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
const delivery = raw.delivery;
|
|
391
|
-
if (delivery && typeof delivery === "object" && !Array.isArray(delivery)) {
|
|
392
|
-
const modeRaw = delivery.mode;
|
|
393
|
-
if (typeof modeRaw === "string") {
|
|
394
|
-
if (modeRaw.trim().toLowerCase() === "deliver") {
|
|
395
|
-
delivery.mode = "announce";
|
|
396
|
-
mutated = true;
|
|
397
|
-
trackIssue("legacyDeliveryMode");
|
|
398
|
-
}
|
|
399
|
-
} else if (modeRaw === void 0 || modeRaw === null) {
|
|
400
|
-
delivery.mode = "announce";
|
|
401
|
-
mutated = true;
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
const isolation = raw.isolation;
|
|
405
|
-
if (isolation && typeof isolation === "object" && !Array.isArray(isolation)) {
|
|
406
|
-
delete raw.isolation;
|
|
407
|
-
mutated = true;
|
|
408
|
-
}
|
|
409
|
-
const payloadKind = payloadRecord && typeof payloadRecord.kind === "string" ? payloadRecord.kind : "";
|
|
410
|
-
const rawSessionTarget = typeof raw.sessionTarget === "string" ? raw.sessionTarget.trim() : "";
|
|
411
|
-
const loweredSessionTarget = rawSessionTarget.toLowerCase();
|
|
412
|
-
if (loweredSessionTarget === "main" || loweredSessionTarget === "isolated") {
|
|
413
|
-
if (raw.sessionTarget !== loweredSessionTarget) {
|
|
414
|
-
raw.sessionTarget = loweredSessionTarget;
|
|
415
|
-
mutated = true;
|
|
416
|
-
}
|
|
417
|
-
} else if (loweredSessionTarget.startsWith("session:")) {
|
|
418
|
-
const customSessionId = rawSessionTarget.slice(8).trim();
|
|
419
|
-
if (customSessionId) {
|
|
420
|
-
const normalizedSessionTarget = `session:${customSessionId}`;
|
|
421
|
-
if (raw.sessionTarget !== normalizedSessionTarget) {
|
|
422
|
-
raw.sessionTarget = normalizedSessionTarget;
|
|
423
|
-
mutated = true;
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
} else if (loweredSessionTarget === "current") {
|
|
427
|
-
if (raw.sessionTarget !== "isolated") {
|
|
428
|
-
raw.sessionTarget = "isolated";
|
|
429
|
-
mutated = true;
|
|
430
|
-
}
|
|
431
|
-
} else {
|
|
432
|
-
const inferredSessionTarget = payloadKind === "agentTurn" ? "isolated" : "main";
|
|
433
|
-
if (raw.sessionTarget !== inferredSessionTarget) {
|
|
434
|
-
raw.sessionTarget = inferredSessionTarget;
|
|
435
|
-
mutated = true;
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
const sessionTarget = typeof raw.sessionTarget === "string" ? raw.sessionTarget.trim().toLowerCase() : "";
|
|
439
|
-
const isIsolatedAgentTurn = sessionTarget === "isolated" || sessionTarget === "current" || sessionTarget.startsWith("session:") || sessionTarget === "" && payloadKind === "agentTurn";
|
|
440
|
-
const hasDelivery = delivery && typeof delivery === "object" && !Array.isArray(delivery);
|
|
441
|
-
const normalizedLegacy = normalizeLegacyDeliveryInput({
|
|
442
|
-
delivery: hasDelivery ? delivery : null,
|
|
443
|
-
payload: payloadRecord
|
|
444
|
-
});
|
|
445
|
-
if (isIsolatedAgentTurn && payloadKind === "agentTurn") {
|
|
446
|
-
if (!hasDelivery && normalizedLegacy.delivery) {
|
|
447
|
-
raw.delivery = normalizedLegacy.delivery;
|
|
448
|
-
mutated = true;
|
|
449
|
-
} else if (!hasDelivery) {
|
|
450
|
-
raw.delivery = { mode: "announce" };
|
|
451
|
-
mutated = true;
|
|
452
|
-
} else if (normalizedLegacy.mutated && normalizedLegacy.delivery) {
|
|
453
|
-
raw.delivery = normalizedLegacy.delivery;
|
|
454
|
-
mutated = true;
|
|
455
|
-
}
|
|
456
|
-
} else if (normalizedLegacy.mutated && normalizedLegacy.delivery) {
|
|
457
|
-
raw.delivery = normalizedLegacy.delivery;
|
|
458
|
-
mutated = true;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
return {
|
|
462
|
-
issues,
|
|
463
|
-
jobs,
|
|
464
|
-
mutated
|
|
465
|
-
};
|
|
466
|
-
}
|
|
467
|
-
//#endregion
|
|
468
|
-
//#region src/infra/package-json.ts
|
|
469
|
-
async function readPackageVersion(root) {
|
|
470
|
-
try {
|
|
471
|
-
const raw = await fs.readFile(path.join(root, "package.json"), "utf-8");
|
|
472
|
-
const version = JSON.parse(raw)?.version?.trim();
|
|
473
|
-
return version ? version : null;
|
|
474
|
-
} catch {
|
|
475
|
-
return null;
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
async function readPackageName(root) {
|
|
479
|
-
try {
|
|
480
|
-
const raw = await fs.readFile(path.join(root, "package.json"), "utf-8");
|
|
481
|
-
const name = JSON.parse(raw)?.name?.trim();
|
|
482
|
-
return name ? name : null;
|
|
483
|
-
} catch {
|
|
484
|
-
return null;
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
//#endregion
|
|
488
|
-
//#region src/infra/package-tag.ts
|
|
489
|
-
function normalizePackageTagInput(value, packageNames) {
|
|
490
|
-
const trimmed = value?.trim();
|
|
491
|
-
if (!trimmed) return null;
|
|
492
|
-
for (const packageName of packageNames) {
|
|
493
|
-
if (trimmed === packageName) return null;
|
|
494
|
-
const prefix = `${packageName}@`;
|
|
495
|
-
if (trimmed.startsWith(prefix)) {
|
|
496
|
-
const tag = trimmed.slice(prefix.length).trim();
|
|
497
|
-
return tag ? tag : null;
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
return trimmed;
|
|
501
|
-
}
|
|
502
|
-
//#endregion
|
|
503
|
-
//#region src/infra/update-global.ts
|
|
504
|
-
const PRIMARY_PACKAGE_NAME = "moldclaw";
|
|
505
|
-
const ALL_PACKAGE_NAMES = [PRIMARY_PACKAGE_NAME];
|
|
506
|
-
const GLOBAL_RENAME_PREFIX = ".";
|
|
507
|
-
const MOLDCLAW_MAIN_PACKAGE_SPEC = "github:moldclaw/moldclaw#main";
|
|
508
|
-
const NPM_GLOBAL_INSTALL_QUIET_FLAGS = [
|
|
509
|
-
"--no-fund",
|
|
510
|
-
"--no-audit",
|
|
511
|
-
"--loglevel=error"
|
|
512
|
-
];
|
|
513
|
-
const NPM_GLOBAL_INSTALL_OMIT_OPTIONAL_FLAGS = ["--omit=optional", ...NPM_GLOBAL_INSTALL_QUIET_FLAGS];
|
|
514
|
-
function normalizePackageTarget(value) {
|
|
515
|
-
return value.trim();
|
|
516
|
-
}
|
|
517
|
-
function isMainPackageTarget(value) {
|
|
518
|
-
return normalizePackageTarget(value).toLowerCase() === "main";
|
|
519
|
-
}
|
|
520
|
-
function isExplicitPackageInstallSpec(value) {
|
|
521
|
-
const trimmed = normalizePackageTarget(value);
|
|
522
|
-
if (!trimmed) return false;
|
|
523
|
-
return trimmed.includes("://") || trimmed.includes("#") || /^(?:file|github|git\+ssh|git\+https|git\+http|git\+file|npm):/i.test(trimmed);
|
|
524
|
-
}
|
|
525
|
-
function canResolveRegistryVersionForPackageTarget(value) {
|
|
526
|
-
const trimmed = normalizePackageTarget(value);
|
|
527
|
-
if (!trimmed) return true;
|
|
528
|
-
return !isMainPackageTarget(trimmed) && !isExplicitPackageInstallSpec(trimmed);
|
|
529
|
-
}
|
|
530
|
-
async function resolvePortableGitPathPrepend(env) {
|
|
531
|
-
if (process.platform !== "win32") return [];
|
|
532
|
-
const localAppData = env?.LOCALAPPDATA?.trim() || process.env.LOCALAPPDATA?.trim();
|
|
533
|
-
if (!localAppData) return [];
|
|
534
|
-
const portableGitRoot = path.join(localAppData, "moldClaw", "deps", "portable-git");
|
|
535
|
-
const candidates = [
|
|
536
|
-
path.join(portableGitRoot, "mingw64", "bin"),
|
|
537
|
-
path.join(portableGitRoot, "usr", "bin"),
|
|
538
|
-
path.join(portableGitRoot, "cmd"),
|
|
539
|
-
path.join(portableGitRoot, "bin")
|
|
540
|
-
];
|
|
541
|
-
const existing = [];
|
|
542
|
-
for (const candidate of candidates) if (await pathExists(candidate)) existing.push(candidate);
|
|
543
|
-
return existing;
|
|
544
|
-
}
|
|
545
|
-
function applyWindowsPackageInstallEnv(env) {
|
|
546
|
-
if (process.platform !== "win32") return;
|
|
547
|
-
env.NPM_CONFIG_UPDATE_NOTIFIER = "false";
|
|
548
|
-
env.NPM_CONFIG_FUND = "false";
|
|
549
|
-
env.NPM_CONFIG_AUDIT = "false";
|
|
550
|
-
env.NPM_CONFIG_SCRIPT_SHELL = "cmd.exe";
|
|
551
|
-
env.NODE_LLAMA_CPP_SKIP_DOWNLOAD = "1";
|
|
552
|
-
}
|
|
553
|
-
function resolveGlobalInstallSpec(params) {
|
|
554
|
-
const override = params.env?.MOLDCLAW_UPDATE_PACKAGE_SPEC?.trim() || process.env.MOLDCLAW_UPDATE_PACKAGE_SPEC?.trim();
|
|
555
|
-
if (override) return override;
|
|
556
|
-
const target = normalizePackageTarget(params.tag);
|
|
557
|
-
if (isMainPackageTarget(target)) return MOLDCLAW_MAIN_PACKAGE_SPEC;
|
|
558
|
-
if (isExplicitPackageInstallSpec(target)) return target;
|
|
559
|
-
return `${params.packageName}@${target}`;
|
|
560
|
-
}
|
|
561
|
-
async function createGlobalInstallEnv(env) {
|
|
562
|
-
const pathPrepend = await resolvePortableGitPathPrepend(env);
|
|
563
|
-
if (pathPrepend.length === 0 && process.platform !== "win32") return env;
|
|
564
|
-
const merged = Object.fromEntries(Object.entries(env ?? process.env).filter(([, value]) => value != null).map(([key, value]) => [key, String(value)]));
|
|
565
|
-
applyPathPrepend(merged, pathPrepend);
|
|
566
|
-
applyWindowsPackageInstallEnv(merged);
|
|
567
|
-
return merged;
|
|
568
|
-
}
|
|
569
|
-
async function tryRealpath(targetPath) {
|
|
570
|
-
try {
|
|
571
|
-
return await fs.realpath(targetPath);
|
|
572
|
-
} catch {
|
|
573
|
-
return path.resolve(targetPath);
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
function resolveBunGlobalRoot() {
|
|
577
|
-
const bunInstall = process.env.BUN_INSTALL?.trim() || path.join(os.homedir(), ".bun");
|
|
578
|
-
return path.join(bunInstall, "install", "global", "node_modules");
|
|
579
|
-
}
|
|
580
|
-
async function resolveGlobalRoot(manager, runCommand, timeoutMs) {
|
|
581
|
-
if (manager === "bun") return resolveBunGlobalRoot();
|
|
582
|
-
const res = await runCommand(manager === "pnpm" ? [
|
|
583
|
-
"pnpm",
|
|
584
|
-
"root",
|
|
585
|
-
"-g"
|
|
586
|
-
] : [
|
|
587
|
-
"npm",
|
|
588
|
-
"root",
|
|
589
|
-
"-g"
|
|
590
|
-
], { timeoutMs }).catch(() => null);
|
|
591
|
-
if (!res || res.code !== 0) return null;
|
|
592
|
-
return res.stdout.trim() || null;
|
|
593
|
-
}
|
|
594
|
-
async function resolveGlobalPackageRoot(manager, runCommand, timeoutMs) {
|
|
595
|
-
const root = await resolveGlobalRoot(manager, runCommand, timeoutMs);
|
|
596
|
-
if (!root) return null;
|
|
597
|
-
return path.join(root, PRIMARY_PACKAGE_NAME);
|
|
598
|
-
}
|
|
599
|
-
async function detectGlobalInstallManagerForRoot(runCommand, pkgRoot, timeoutMs) {
|
|
600
|
-
const pkgReal = await tryRealpath(pkgRoot);
|
|
601
|
-
for (const { manager, argv } of [{
|
|
602
|
-
manager: "npm",
|
|
603
|
-
argv: [
|
|
604
|
-
"npm",
|
|
605
|
-
"root",
|
|
606
|
-
"-g"
|
|
607
|
-
]
|
|
608
|
-
}, {
|
|
609
|
-
manager: "pnpm",
|
|
610
|
-
argv: [
|
|
611
|
-
"pnpm",
|
|
612
|
-
"root",
|
|
613
|
-
"-g"
|
|
614
|
-
]
|
|
615
|
-
}]) {
|
|
616
|
-
const res = await runCommand(argv, { timeoutMs }).catch(() => null);
|
|
617
|
-
if (!res || res.code !== 0) continue;
|
|
618
|
-
const globalRoot = res.stdout.trim();
|
|
619
|
-
if (!globalRoot) continue;
|
|
620
|
-
const globalReal = await tryRealpath(globalRoot);
|
|
621
|
-
for (const name of ALL_PACKAGE_NAMES) {
|
|
622
|
-
const expectedReal = await tryRealpath(path.join(globalReal, name));
|
|
623
|
-
if (path.resolve(expectedReal) === path.resolve(pkgReal)) return manager;
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
const bunGlobalReal = await tryRealpath(resolveBunGlobalRoot());
|
|
627
|
-
for (const name of ALL_PACKAGE_NAMES) {
|
|
628
|
-
const bunExpectedReal = await tryRealpath(path.join(bunGlobalReal, name));
|
|
629
|
-
if (path.resolve(bunExpectedReal) === path.resolve(pkgReal)) return "bun";
|
|
630
|
-
}
|
|
631
|
-
return null;
|
|
632
|
-
}
|
|
633
|
-
async function detectGlobalInstallManagerByPresence(runCommand, timeoutMs) {
|
|
634
|
-
for (const manager of ["npm", "pnpm"]) {
|
|
635
|
-
const root = await resolveGlobalRoot(manager, runCommand, timeoutMs);
|
|
636
|
-
if (!root) continue;
|
|
637
|
-
for (const name of ALL_PACKAGE_NAMES) if (await pathExists(path.join(root, name))) return manager;
|
|
638
|
-
}
|
|
639
|
-
const bunRoot = resolveBunGlobalRoot();
|
|
640
|
-
for (const name of ALL_PACKAGE_NAMES) if (await pathExists(path.join(bunRoot, name))) return "bun";
|
|
641
|
-
return null;
|
|
642
|
-
}
|
|
643
|
-
function globalInstallArgs(manager, spec) {
|
|
644
|
-
if (manager === "pnpm") return [
|
|
645
|
-
"pnpm",
|
|
646
|
-
"add",
|
|
647
|
-
"-g",
|
|
648
|
-
spec
|
|
649
|
-
];
|
|
650
|
-
if (manager === "bun") return [
|
|
651
|
-
"bun",
|
|
652
|
-
"add",
|
|
653
|
-
"-g",
|
|
654
|
-
spec
|
|
655
|
-
];
|
|
656
|
-
return [
|
|
657
|
-
"npm",
|
|
658
|
-
"i",
|
|
659
|
-
"-g",
|
|
660
|
-
spec,
|
|
661
|
-
...NPM_GLOBAL_INSTALL_QUIET_FLAGS
|
|
662
|
-
];
|
|
663
|
-
}
|
|
664
|
-
function globalInstallFallbackArgs(manager, spec) {
|
|
665
|
-
if (manager !== "npm") return null;
|
|
666
|
-
return [
|
|
667
|
-
"npm",
|
|
668
|
-
"i",
|
|
669
|
-
"-g",
|
|
670
|
-
spec,
|
|
671
|
-
...NPM_GLOBAL_INSTALL_OMIT_OPTIONAL_FLAGS
|
|
672
|
-
];
|
|
673
|
-
}
|
|
674
|
-
async function cleanupGlobalRenameDirs(params) {
|
|
675
|
-
const removed = [];
|
|
676
|
-
const root = params.globalRoot.trim();
|
|
677
|
-
const name = params.packageName.trim();
|
|
678
|
-
if (!root || !name) return { removed };
|
|
679
|
-
const prefix = `${GLOBAL_RENAME_PREFIX}${name}-`;
|
|
680
|
-
let entries = [];
|
|
681
|
-
try {
|
|
682
|
-
entries = await fs.readdir(root);
|
|
683
|
-
} catch {
|
|
684
|
-
return { removed };
|
|
685
|
-
}
|
|
686
|
-
for (const entry of entries) {
|
|
687
|
-
if (!entry.startsWith(prefix)) continue;
|
|
688
|
-
const target = path.join(root, entry);
|
|
689
|
-
try {
|
|
690
|
-
if (!(await fs.lstat(target)).isDirectory()) continue;
|
|
691
|
-
await fs.rm(target, {
|
|
692
|
-
recursive: true,
|
|
693
|
-
force: true
|
|
694
|
-
});
|
|
695
|
-
removed.push(entry);
|
|
696
|
-
} catch {}
|
|
697
|
-
}
|
|
698
|
-
return { removed };
|
|
699
|
-
}
|
|
700
|
-
//#endregion
|
|
701
|
-
//#region src/infra/update-runner.ts
|
|
702
|
-
const DEFAULT_TIMEOUT_MS = 20 * 6e4;
|
|
703
|
-
const MAX_LOG_CHARS = 8e3;
|
|
704
|
-
const PREFLIGHT_MAX_COMMITS = 10;
|
|
705
|
-
const START_DIRS = [
|
|
706
|
-
"cwd",
|
|
707
|
-
"argv1",
|
|
708
|
-
"process"
|
|
709
|
-
];
|
|
710
|
-
const DEFAULT_PACKAGE_NAME = "moldclaw";
|
|
711
|
-
const CORE_PACKAGE_NAMES = new Set([DEFAULT_PACKAGE_NAME]);
|
|
712
|
-
function normalizeDir(value) {
|
|
713
|
-
if (!value) return null;
|
|
714
|
-
const trimmed = value.trim();
|
|
715
|
-
if (!trimmed) return null;
|
|
716
|
-
return path.resolve(trimmed);
|
|
717
|
-
}
|
|
718
|
-
function resolveNodeModulesBinPackageRoot(argv1) {
|
|
719
|
-
const normalized = path.resolve(argv1);
|
|
720
|
-
const parts = normalized.split(path.sep);
|
|
721
|
-
const binIndex = parts.lastIndexOf(".bin");
|
|
722
|
-
if (binIndex <= 0) return null;
|
|
723
|
-
if (parts[binIndex - 1] !== "node_modules") return null;
|
|
724
|
-
const binName = path.basename(normalized);
|
|
725
|
-
const nodeModulesDir = parts.slice(0, binIndex).join(path.sep);
|
|
726
|
-
return path.join(nodeModulesDir, binName);
|
|
727
|
-
}
|
|
728
|
-
function buildStartDirs(opts) {
|
|
729
|
-
const dirs = [];
|
|
730
|
-
const cwd = normalizeDir(opts.cwd);
|
|
731
|
-
if (cwd) dirs.push(cwd);
|
|
732
|
-
const argv1 = normalizeDir(opts.argv1);
|
|
733
|
-
if (argv1) {
|
|
734
|
-
dirs.push(path.dirname(argv1));
|
|
735
|
-
const packageRoot = resolveNodeModulesBinPackageRoot(argv1);
|
|
736
|
-
if (packageRoot) dirs.push(packageRoot);
|
|
737
|
-
}
|
|
738
|
-
const proc = normalizeDir(process.cwd());
|
|
739
|
-
if (proc) dirs.push(proc);
|
|
740
|
-
return Array.from(new Set(dirs));
|
|
741
|
-
}
|
|
742
|
-
async function readBranchName(runCommand, root, timeoutMs) {
|
|
743
|
-
const res = await runCommand([
|
|
744
|
-
"git",
|
|
745
|
-
"-C",
|
|
746
|
-
root,
|
|
747
|
-
"rev-parse",
|
|
748
|
-
"--abbrev-ref",
|
|
749
|
-
"HEAD"
|
|
750
|
-
], { timeoutMs }).catch(() => null);
|
|
751
|
-
if (!res || res.code !== 0) return null;
|
|
752
|
-
return res.stdout.trim() || null;
|
|
753
|
-
}
|
|
754
|
-
async function listGitTags(runCommand, root, timeoutMs, pattern = "v*") {
|
|
755
|
-
const res = await runCommand([
|
|
756
|
-
"git",
|
|
757
|
-
"-C",
|
|
758
|
-
root,
|
|
759
|
-
"tag",
|
|
760
|
-
"--list",
|
|
761
|
-
pattern,
|
|
762
|
-
"--sort=-v:refname"
|
|
763
|
-
], { timeoutMs }).catch(() => null);
|
|
764
|
-
if (!res || res.code !== 0) return [];
|
|
765
|
-
return res.stdout.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
766
|
-
}
|
|
767
|
-
async function resolveChannelTag(runCommand, root, timeoutMs, channel) {
|
|
768
|
-
const tags = await listGitTags(runCommand, root, timeoutMs);
|
|
769
|
-
if (channel === "beta") {
|
|
770
|
-
const betaTag = tags.find((tag) => isBetaTag(tag)) ?? null;
|
|
771
|
-
const stableTag = tags.find((tag) => isStableTag(tag)) ?? null;
|
|
772
|
-
if (!betaTag) return stableTag;
|
|
773
|
-
if (!stableTag) return betaTag;
|
|
774
|
-
const cmp = compareSemverStrings(betaTag, stableTag);
|
|
775
|
-
if (cmp != null && cmp < 0) return stableTag;
|
|
776
|
-
return betaTag;
|
|
777
|
-
}
|
|
778
|
-
return tags.find((tag) => isStableTag(tag)) ?? null;
|
|
779
|
-
}
|
|
780
|
-
async function resolveGitRoot(runCommand, candidates, timeoutMs) {
|
|
781
|
-
for (const dir of candidates) {
|
|
782
|
-
const res = await runCommand([
|
|
783
|
-
"git",
|
|
784
|
-
"-C",
|
|
785
|
-
dir,
|
|
786
|
-
"rev-parse",
|
|
787
|
-
"--show-toplevel"
|
|
788
|
-
], { timeoutMs }).catch(() => null);
|
|
789
|
-
if (!res) continue;
|
|
790
|
-
if (res.code === 0) {
|
|
791
|
-
const root = res.stdout.trim();
|
|
792
|
-
if (root) return root;
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
return null;
|
|
796
|
-
}
|
|
797
|
-
async function findPackageRoot(candidates) {
|
|
798
|
-
for (const dir of candidates) {
|
|
799
|
-
let current = dir;
|
|
800
|
-
for (let i = 0; i < 12; i += 1) {
|
|
801
|
-
const pkgPath = path.join(current, "package.json");
|
|
802
|
-
try {
|
|
803
|
-
const raw = await fs.readFile(pkgPath, "utf-8");
|
|
804
|
-
const name = JSON.parse(raw)?.name?.trim();
|
|
805
|
-
if (name && CORE_PACKAGE_NAMES.has(name)) return current;
|
|
806
|
-
} catch {}
|
|
807
|
-
const parent = path.dirname(current);
|
|
808
|
-
if (parent === current) break;
|
|
809
|
-
current = parent;
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
return null;
|
|
813
|
-
}
|
|
814
|
-
async function detectPackageManager(root) {
|
|
815
|
-
return await detectPackageManager$1(root) ?? "npm";
|
|
816
|
-
}
|
|
817
|
-
async function runStep(opts) {
|
|
818
|
-
const { runCommand, name, argv, cwd, timeoutMs, env, progress, stepIndex, totalSteps } = opts;
|
|
819
|
-
const command = argv.join(" ");
|
|
820
|
-
const stepInfo = {
|
|
821
|
-
name,
|
|
822
|
-
command,
|
|
823
|
-
index: stepIndex,
|
|
824
|
-
total: totalSteps
|
|
825
|
-
};
|
|
826
|
-
progress?.onStepStart?.(stepInfo);
|
|
827
|
-
const started = Date.now();
|
|
828
|
-
const result = await runCommand(argv, {
|
|
829
|
-
cwd,
|
|
830
|
-
timeoutMs,
|
|
831
|
-
env
|
|
832
|
-
});
|
|
833
|
-
const durationMs = Date.now() - started;
|
|
834
|
-
const stderrTail = trimLogTail(result.stderr, MAX_LOG_CHARS);
|
|
835
|
-
progress?.onStepComplete?.({
|
|
836
|
-
...stepInfo,
|
|
837
|
-
durationMs,
|
|
838
|
-
exitCode: result.code,
|
|
839
|
-
stderrTail
|
|
840
|
-
});
|
|
841
|
-
return {
|
|
842
|
-
name,
|
|
843
|
-
command,
|
|
844
|
-
cwd,
|
|
845
|
-
durationMs,
|
|
846
|
-
exitCode: result.code,
|
|
847
|
-
stdoutTail: trimLogTail(result.stdout, MAX_LOG_CHARS),
|
|
848
|
-
stderrTail: trimLogTail(result.stderr, MAX_LOG_CHARS)
|
|
849
|
-
};
|
|
850
|
-
}
|
|
851
|
-
function managerScriptArgs(manager, script, args = []) {
|
|
852
|
-
if (manager === "pnpm") return [
|
|
853
|
-
"pnpm",
|
|
854
|
-
script,
|
|
855
|
-
...args
|
|
856
|
-
];
|
|
857
|
-
if (manager === "bun") return [
|
|
858
|
-
"bun",
|
|
859
|
-
"run",
|
|
860
|
-
script,
|
|
861
|
-
...args
|
|
862
|
-
];
|
|
863
|
-
if (args.length > 0) return [
|
|
864
|
-
"npm",
|
|
865
|
-
"run",
|
|
866
|
-
script,
|
|
867
|
-
"--",
|
|
868
|
-
...args
|
|
869
|
-
];
|
|
870
|
-
return [
|
|
871
|
-
"npm",
|
|
872
|
-
"run",
|
|
873
|
-
script
|
|
874
|
-
];
|
|
875
|
-
}
|
|
876
|
-
function managerInstallArgs(manager) {
|
|
877
|
-
if (manager === "pnpm") return ["pnpm", "install"];
|
|
878
|
-
if (manager === "bun") return ["bun", "install"];
|
|
879
|
-
return ["npm", "install"];
|
|
880
|
-
}
|
|
881
|
-
function normalizeTag(tag) {
|
|
882
|
-
return normalizePackageTagInput(tag, ["moldclaw", DEFAULT_PACKAGE_NAME]) ?? "latest";
|
|
883
|
-
}
|
|
884
|
-
async function runGatewayUpdate(opts = {}) {
|
|
885
|
-
const startedAt = Date.now();
|
|
886
|
-
const runCommand = opts.runCommand ?? (async (argv, options) => {
|
|
887
|
-
const res = await runCommandWithTimeout(argv, options);
|
|
888
|
-
return {
|
|
889
|
-
stdout: res.stdout,
|
|
890
|
-
stderr: res.stderr,
|
|
891
|
-
code: res.code
|
|
892
|
-
};
|
|
893
|
-
});
|
|
894
|
-
const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
895
|
-
const progress = opts.progress;
|
|
896
|
-
const steps = [];
|
|
897
|
-
const candidates = buildStartDirs(opts);
|
|
898
|
-
let stepIndex = 0;
|
|
899
|
-
let gitTotalSteps = 0;
|
|
900
|
-
const step = (name, argv, cwd, env) => {
|
|
901
|
-
const currentIndex = stepIndex;
|
|
902
|
-
stepIndex += 1;
|
|
903
|
-
return {
|
|
904
|
-
runCommand,
|
|
905
|
-
name,
|
|
906
|
-
argv,
|
|
907
|
-
cwd,
|
|
908
|
-
timeoutMs,
|
|
909
|
-
env,
|
|
910
|
-
progress,
|
|
911
|
-
stepIndex: currentIndex,
|
|
912
|
-
totalSteps: gitTotalSteps
|
|
913
|
-
};
|
|
914
|
-
};
|
|
915
|
-
const pkgRoot = await findPackageRoot(candidates);
|
|
916
|
-
let gitRoot = await resolveGitRoot(runCommand, candidates, timeoutMs);
|
|
917
|
-
if (gitRoot && pkgRoot && path.resolve(gitRoot) !== path.resolve(pkgRoot)) gitRoot = null;
|
|
918
|
-
if (gitRoot && !pkgRoot) return {
|
|
919
|
-
status: "error",
|
|
920
|
-
mode: "unknown",
|
|
921
|
-
root: gitRoot,
|
|
922
|
-
reason: "not-moldclaw-root",
|
|
923
|
-
steps: [],
|
|
924
|
-
durationMs: Date.now() - startedAt
|
|
925
|
-
};
|
|
926
|
-
if (gitRoot && pkgRoot && path.resolve(gitRoot) === path.resolve(pkgRoot)) {
|
|
927
|
-
const beforeSha = (await runCommand([
|
|
928
|
-
"git",
|
|
929
|
-
"-C",
|
|
930
|
-
gitRoot,
|
|
931
|
-
"rev-parse",
|
|
932
|
-
"HEAD"
|
|
933
|
-
], {
|
|
934
|
-
cwd: gitRoot,
|
|
935
|
-
timeoutMs
|
|
936
|
-
})).stdout.trim() || null;
|
|
937
|
-
const beforeVersion = await readPackageVersion(gitRoot);
|
|
938
|
-
const channel = opts.channel ?? "dev";
|
|
939
|
-
const branch = channel === "dev" ? await readBranchName(runCommand, gitRoot, timeoutMs) : null;
|
|
940
|
-
const needsCheckoutMain = channel === "dev" && branch !== "main";
|
|
941
|
-
gitTotalSteps = channel === "dev" ? needsCheckoutMain ? 11 : 10 : 9;
|
|
942
|
-
const buildGitErrorResult = (reason) => ({
|
|
943
|
-
status: "error",
|
|
944
|
-
mode: "git",
|
|
945
|
-
root: gitRoot,
|
|
946
|
-
reason,
|
|
947
|
-
before: {
|
|
948
|
-
sha: beforeSha,
|
|
949
|
-
version: beforeVersion
|
|
950
|
-
},
|
|
951
|
-
steps,
|
|
952
|
-
durationMs: Date.now() - startedAt
|
|
953
|
-
});
|
|
954
|
-
const runGitCheckoutOrFail = async (name, argv) => {
|
|
955
|
-
const checkoutStep = await runStep(step(name, argv, gitRoot));
|
|
956
|
-
steps.push(checkoutStep);
|
|
957
|
-
if (checkoutStep.exitCode !== 0) return buildGitErrorResult("checkout-failed");
|
|
958
|
-
return null;
|
|
959
|
-
};
|
|
960
|
-
const statusCheck = await runStep(step("clean check", [
|
|
961
|
-
"git",
|
|
962
|
-
"-C",
|
|
963
|
-
gitRoot,
|
|
964
|
-
"status",
|
|
965
|
-
"--porcelain",
|
|
966
|
-
"--",
|
|
967
|
-
":!dist/control-ui/"
|
|
968
|
-
], gitRoot));
|
|
969
|
-
steps.push(statusCheck);
|
|
970
|
-
if (statusCheck.stdoutTail && statusCheck.stdoutTail.trim().length > 0) return {
|
|
971
|
-
status: "skipped",
|
|
972
|
-
mode: "git",
|
|
973
|
-
root: gitRoot,
|
|
974
|
-
reason: "dirty",
|
|
975
|
-
before: {
|
|
976
|
-
sha: beforeSha,
|
|
977
|
-
version: beforeVersion
|
|
978
|
-
},
|
|
979
|
-
steps,
|
|
980
|
-
durationMs: Date.now() - startedAt
|
|
981
|
-
};
|
|
982
|
-
if (channel === "dev") {
|
|
983
|
-
if (needsCheckoutMain) {
|
|
984
|
-
const failure = await runGitCheckoutOrFail(`git checkout ${DEV_BRANCH}`, [
|
|
985
|
-
"git",
|
|
986
|
-
"-C",
|
|
987
|
-
gitRoot,
|
|
988
|
-
"checkout",
|
|
989
|
-
DEV_BRANCH
|
|
990
|
-
]);
|
|
991
|
-
if (failure) return failure;
|
|
992
|
-
}
|
|
993
|
-
const upstreamStep = await runStep(step("upstream check", [
|
|
994
|
-
"git",
|
|
995
|
-
"-C",
|
|
996
|
-
gitRoot,
|
|
997
|
-
"rev-parse",
|
|
998
|
-
"--abbrev-ref",
|
|
999
|
-
"--symbolic-full-name",
|
|
1000
|
-
"@{upstream}"
|
|
1001
|
-
], gitRoot));
|
|
1002
|
-
steps.push(upstreamStep);
|
|
1003
|
-
if (upstreamStep.exitCode !== 0) return {
|
|
1004
|
-
status: "skipped",
|
|
1005
|
-
mode: "git",
|
|
1006
|
-
root: gitRoot,
|
|
1007
|
-
reason: "no-upstream",
|
|
1008
|
-
before: {
|
|
1009
|
-
sha: beforeSha,
|
|
1010
|
-
version: beforeVersion
|
|
1011
|
-
},
|
|
1012
|
-
steps,
|
|
1013
|
-
durationMs: Date.now() - startedAt
|
|
1014
|
-
};
|
|
1015
|
-
const fetchStep = await runStep(step("git fetch", [
|
|
1016
|
-
"git",
|
|
1017
|
-
"-C",
|
|
1018
|
-
gitRoot,
|
|
1019
|
-
"fetch",
|
|
1020
|
-
"--all",
|
|
1021
|
-
"--prune",
|
|
1022
|
-
"--tags"
|
|
1023
|
-
], gitRoot));
|
|
1024
|
-
steps.push(fetchStep);
|
|
1025
|
-
const upstreamShaStep = await runStep(step("git rev-parse @{upstream}", [
|
|
1026
|
-
"git",
|
|
1027
|
-
"-C",
|
|
1028
|
-
gitRoot,
|
|
1029
|
-
"rev-parse",
|
|
1030
|
-
"@{upstream}"
|
|
1031
|
-
], gitRoot));
|
|
1032
|
-
steps.push(upstreamShaStep);
|
|
1033
|
-
const upstreamSha = upstreamShaStep.stdoutTail?.trim();
|
|
1034
|
-
if (!upstreamShaStep.stdoutTail || !upstreamSha) return {
|
|
1035
|
-
status: "error",
|
|
1036
|
-
mode: "git",
|
|
1037
|
-
root: gitRoot,
|
|
1038
|
-
reason: "no-upstream-sha",
|
|
1039
|
-
before: {
|
|
1040
|
-
sha: beforeSha,
|
|
1041
|
-
version: beforeVersion
|
|
1042
|
-
},
|
|
1043
|
-
steps,
|
|
1044
|
-
durationMs: Date.now() - startedAt
|
|
1045
|
-
};
|
|
1046
|
-
const revListStep = await runStep(step("git rev-list", [
|
|
1047
|
-
"git",
|
|
1048
|
-
"-C",
|
|
1049
|
-
gitRoot,
|
|
1050
|
-
"rev-list",
|
|
1051
|
-
`--max-count=${PREFLIGHT_MAX_COMMITS}`,
|
|
1052
|
-
upstreamSha
|
|
1053
|
-
], gitRoot));
|
|
1054
|
-
steps.push(revListStep);
|
|
1055
|
-
if (revListStep.exitCode !== 0) return {
|
|
1056
|
-
status: "error",
|
|
1057
|
-
mode: "git",
|
|
1058
|
-
root: gitRoot,
|
|
1059
|
-
reason: "preflight-revlist-failed",
|
|
1060
|
-
before: {
|
|
1061
|
-
sha: beforeSha,
|
|
1062
|
-
version: beforeVersion
|
|
1063
|
-
},
|
|
1064
|
-
steps,
|
|
1065
|
-
durationMs: Date.now() - startedAt
|
|
1066
|
-
};
|
|
1067
|
-
const candidates = (revListStep.stdoutTail ?? "").split("\n").map((line) => line.trim()).filter(Boolean);
|
|
1068
|
-
if (candidates.length === 0) return {
|
|
1069
|
-
status: "error",
|
|
1070
|
-
mode: "git",
|
|
1071
|
-
root: gitRoot,
|
|
1072
|
-
reason: "preflight-no-candidates",
|
|
1073
|
-
before: {
|
|
1074
|
-
sha: beforeSha,
|
|
1075
|
-
version: beforeVersion
|
|
1076
|
-
},
|
|
1077
|
-
steps,
|
|
1078
|
-
durationMs: Date.now() - startedAt
|
|
1079
|
-
};
|
|
1080
|
-
const manager = await detectPackageManager(gitRoot);
|
|
1081
|
-
const preflightRoot = await fs.mkdtemp(path.join(os.tmpdir(), "moldclaw-update-preflight-"));
|
|
1082
|
-
const worktreeDir = path.join(preflightRoot, "worktree");
|
|
1083
|
-
const worktreeStep = await runStep(step("preflight worktree", [
|
|
1084
|
-
"git",
|
|
1085
|
-
"-C",
|
|
1086
|
-
gitRoot,
|
|
1087
|
-
"worktree",
|
|
1088
|
-
"add",
|
|
1089
|
-
"--detach",
|
|
1090
|
-
worktreeDir,
|
|
1091
|
-
upstreamSha
|
|
1092
|
-
], gitRoot));
|
|
1093
|
-
steps.push(worktreeStep);
|
|
1094
|
-
if (worktreeStep.exitCode !== 0) {
|
|
1095
|
-
await fs.rm(preflightRoot, {
|
|
1096
|
-
recursive: true,
|
|
1097
|
-
force: true
|
|
1098
|
-
}).catch(() => {});
|
|
1099
|
-
return {
|
|
1100
|
-
status: "error",
|
|
1101
|
-
mode: "git",
|
|
1102
|
-
root: gitRoot,
|
|
1103
|
-
reason: "preflight-worktree-failed",
|
|
1104
|
-
before: {
|
|
1105
|
-
sha: beforeSha,
|
|
1106
|
-
version: beforeVersion
|
|
1107
|
-
},
|
|
1108
|
-
steps,
|
|
1109
|
-
durationMs: Date.now() - startedAt
|
|
1110
|
-
};
|
|
1111
|
-
}
|
|
1112
|
-
let selectedSha = null;
|
|
1113
|
-
try {
|
|
1114
|
-
for (const sha of candidates) {
|
|
1115
|
-
const shortSha = sha.slice(0, 8);
|
|
1116
|
-
const checkoutStep = await runStep(step(`preflight checkout (${shortSha})`, [
|
|
1117
|
-
"git",
|
|
1118
|
-
"-C",
|
|
1119
|
-
worktreeDir,
|
|
1120
|
-
"checkout",
|
|
1121
|
-
"--detach",
|
|
1122
|
-
sha
|
|
1123
|
-
], worktreeDir));
|
|
1124
|
-
steps.push(checkoutStep);
|
|
1125
|
-
if (checkoutStep.exitCode !== 0) continue;
|
|
1126
|
-
const depsStep = await runStep(step(`preflight deps install (${shortSha})`, managerInstallArgs(manager), worktreeDir));
|
|
1127
|
-
steps.push(depsStep);
|
|
1128
|
-
if (depsStep.exitCode !== 0) continue;
|
|
1129
|
-
const buildStep = await runStep(step(`preflight build (${shortSha})`, managerScriptArgs(manager, "build"), worktreeDir));
|
|
1130
|
-
steps.push(buildStep);
|
|
1131
|
-
if (buildStep.exitCode !== 0) continue;
|
|
1132
|
-
const lintStep = await runStep(step(`preflight lint (${shortSha})`, managerScriptArgs(manager, "lint"), worktreeDir));
|
|
1133
|
-
steps.push(lintStep);
|
|
1134
|
-
if (lintStep.exitCode !== 0) continue;
|
|
1135
|
-
selectedSha = sha;
|
|
1136
|
-
break;
|
|
1137
|
-
}
|
|
1138
|
-
} finally {
|
|
1139
|
-
const removeStep = await runStep(step("preflight cleanup", [
|
|
1140
|
-
"git",
|
|
1141
|
-
"-C",
|
|
1142
|
-
gitRoot,
|
|
1143
|
-
"worktree",
|
|
1144
|
-
"remove",
|
|
1145
|
-
"--force",
|
|
1146
|
-
worktreeDir
|
|
1147
|
-
], gitRoot));
|
|
1148
|
-
steps.push(removeStep);
|
|
1149
|
-
await runCommand([
|
|
1150
|
-
"git",
|
|
1151
|
-
"-C",
|
|
1152
|
-
gitRoot,
|
|
1153
|
-
"worktree",
|
|
1154
|
-
"prune"
|
|
1155
|
-
], {
|
|
1156
|
-
cwd: gitRoot,
|
|
1157
|
-
timeoutMs
|
|
1158
|
-
}).catch(() => null);
|
|
1159
|
-
await fs.rm(preflightRoot, {
|
|
1160
|
-
recursive: true,
|
|
1161
|
-
force: true
|
|
1162
|
-
}).catch(() => {});
|
|
1163
|
-
}
|
|
1164
|
-
if (!selectedSha) return {
|
|
1165
|
-
status: "error",
|
|
1166
|
-
mode: "git",
|
|
1167
|
-
root: gitRoot,
|
|
1168
|
-
reason: "preflight-no-good-commit",
|
|
1169
|
-
before: {
|
|
1170
|
-
sha: beforeSha,
|
|
1171
|
-
version: beforeVersion
|
|
1172
|
-
},
|
|
1173
|
-
steps,
|
|
1174
|
-
durationMs: Date.now() - startedAt
|
|
1175
|
-
};
|
|
1176
|
-
const rebaseStep = await runStep(step("git rebase", [
|
|
1177
|
-
"git",
|
|
1178
|
-
"-C",
|
|
1179
|
-
gitRoot,
|
|
1180
|
-
"rebase",
|
|
1181
|
-
selectedSha
|
|
1182
|
-
], gitRoot));
|
|
1183
|
-
steps.push(rebaseStep);
|
|
1184
|
-
if (rebaseStep.exitCode !== 0) {
|
|
1185
|
-
const abortResult = await runCommand([
|
|
1186
|
-
"git",
|
|
1187
|
-
"-C",
|
|
1188
|
-
gitRoot,
|
|
1189
|
-
"rebase",
|
|
1190
|
-
"--abort"
|
|
1191
|
-
], {
|
|
1192
|
-
cwd: gitRoot,
|
|
1193
|
-
timeoutMs
|
|
1194
|
-
});
|
|
1195
|
-
steps.push({
|
|
1196
|
-
name: "git rebase --abort",
|
|
1197
|
-
command: "git rebase --abort",
|
|
1198
|
-
cwd: gitRoot,
|
|
1199
|
-
durationMs: 0,
|
|
1200
|
-
exitCode: abortResult.code,
|
|
1201
|
-
stdoutTail: trimLogTail(abortResult.stdout, MAX_LOG_CHARS),
|
|
1202
|
-
stderrTail: trimLogTail(abortResult.stderr, MAX_LOG_CHARS)
|
|
1203
|
-
});
|
|
1204
|
-
return {
|
|
1205
|
-
status: "error",
|
|
1206
|
-
mode: "git",
|
|
1207
|
-
root: gitRoot,
|
|
1208
|
-
reason: "rebase-failed",
|
|
1209
|
-
before: {
|
|
1210
|
-
sha: beforeSha,
|
|
1211
|
-
version: beforeVersion
|
|
1212
|
-
},
|
|
1213
|
-
steps,
|
|
1214
|
-
durationMs: Date.now() - startedAt
|
|
1215
|
-
};
|
|
1216
|
-
}
|
|
1217
|
-
} else {
|
|
1218
|
-
const fetchStep = await runStep(step("git fetch", [
|
|
1219
|
-
"git",
|
|
1220
|
-
"-C",
|
|
1221
|
-
gitRoot,
|
|
1222
|
-
"fetch",
|
|
1223
|
-
"--all",
|
|
1224
|
-
"--prune",
|
|
1225
|
-
"--tags"
|
|
1226
|
-
], gitRoot));
|
|
1227
|
-
steps.push(fetchStep);
|
|
1228
|
-
if (fetchStep.exitCode !== 0) return {
|
|
1229
|
-
status: "error",
|
|
1230
|
-
mode: "git",
|
|
1231
|
-
root: gitRoot,
|
|
1232
|
-
reason: "fetch-failed",
|
|
1233
|
-
before: {
|
|
1234
|
-
sha: beforeSha,
|
|
1235
|
-
version: beforeVersion
|
|
1236
|
-
},
|
|
1237
|
-
steps,
|
|
1238
|
-
durationMs: Date.now() - startedAt
|
|
1239
|
-
};
|
|
1240
|
-
const tag = await resolveChannelTag(runCommand, gitRoot, timeoutMs, channel);
|
|
1241
|
-
if (!tag) return {
|
|
1242
|
-
status: "error",
|
|
1243
|
-
mode: "git",
|
|
1244
|
-
root: gitRoot,
|
|
1245
|
-
reason: "no-release-tag",
|
|
1246
|
-
before: {
|
|
1247
|
-
sha: beforeSha,
|
|
1248
|
-
version: beforeVersion
|
|
1249
|
-
},
|
|
1250
|
-
steps,
|
|
1251
|
-
durationMs: Date.now() - startedAt
|
|
1252
|
-
};
|
|
1253
|
-
const failure = await runGitCheckoutOrFail(`git checkout ${tag}`, [
|
|
1254
|
-
"git",
|
|
1255
|
-
"-C",
|
|
1256
|
-
gitRoot,
|
|
1257
|
-
"checkout",
|
|
1258
|
-
"--detach",
|
|
1259
|
-
tag
|
|
1260
|
-
]);
|
|
1261
|
-
if (failure) return failure;
|
|
1262
|
-
}
|
|
1263
|
-
const manager = await detectPackageManager(gitRoot);
|
|
1264
|
-
const depsStep = await runStep(step("deps install", managerInstallArgs(manager), gitRoot));
|
|
1265
|
-
steps.push(depsStep);
|
|
1266
|
-
if (depsStep.exitCode !== 0) return {
|
|
1267
|
-
status: "error",
|
|
1268
|
-
mode: "git",
|
|
1269
|
-
root: gitRoot,
|
|
1270
|
-
reason: "deps-install-failed",
|
|
1271
|
-
before: {
|
|
1272
|
-
sha: beforeSha,
|
|
1273
|
-
version: beforeVersion
|
|
1274
|
-
},
|
|
1275
|
-
steps,
|
|
1276
|
-
durationMs: Date.now() - startedAt
|
|
1277
|
-
};
|
|
1278
|
-
const buildStep = await runStep(step("build", managerScriptArgs(manager, "build"), gitRoot));
|
|
1279
|
-
steps.push(buildStep);
|
|
1280
|
-
if (buildStep.exitCode !== 0) return {
|
|
1281
|
-
status: "error",
|
|
1282
|
-
mode: "git",
|
|
1283
|
-
root: gitRoot,
|
|
1284
|
-
reason: "build-failed",
|
|
1285
|
-
before: {
|
|
1286
|
-
sha: beforeSha,
|
|
1287
|
-
version: beforeVersion
|
|
1288
|
-
},
|
|
1289
|
-
steps,
|
|
1290
|
-
durationMs: Date.now() - startedAt
|
|
1291
|
-
};
|
|
1292
|
-
const uiBuildStep = await runStep(step("ui:build", managerScriptArgs(manager, "ui:build"), gitRoot));
|
|
1293
|
-
steps.push(uiBuildStep);
|
|
1294
|
-
if (uiBuildStep.exitCode !== 0) return {
|
|
1295
|
-
status: "error",
|
|
1296
|
-
mode: "git",
|
|
1297
|
-
root: gitRoot,
|
|
1298
|
-
reason: "ui-build-failed",
|
|
1299
|
-
before: {
|
|
1300
|
-
sha: beforeSha,
|
|
1301
|
-
version: beforeVersion
|
|
1302
|
-
},
|
|
1303
|
-
steps,
|
|
1304
|
-
durationMs: Date.now() - startedAt
|
|
1305
|
-
};
|
|
1306
|
-
const doctorEntry = path.join(gitRoot, "moldclaw.mjs");
|
|
1307
|
-
if (!await fs.stat(doctorEntry).then(() => true).catch(() => false)) {
|
|
1308
|
-
steps.push({
|
|
1309
|
-
name: "moldclaw doctor entry",
|
|
1310
|
-
command: `verify ${doctorEntry}`,
|
|
1311
|
-
cwd: gitRoot,
|
|
1312
|
-
durationMs: 0,
|
|
1313
|
-
exitCode: 1,
|
|
1314
|
-
stderrTail: `missing ${doctorEntry}`
|
|
1315
|
-
});
|
|
1316
|
-
return {
|
|
1317
|
-
status: "error",
|
|
1318
|
-
mode: "git",
|
|
1319
|
-
root: gitRoot,
|
|
1320
|
-
reason: "doctor-entry-missing",
|
|
1321
|
-
before: {
|
|
1322
|
-
sha: beforeSha,
|
|
1323
|
-
version: beforeVersion
|
|
1324
|
-
},
|
|
1325
|
-
steps,
|
|
1326
|
-
durationMs: Date.now() - startedAt
|
|
1327
|
-
};
|
|
1328
|
-
}
|
|
1329
|
-
const doctorStep = await runStep(step("moldclaw doctor", [
|
|
1330
|
-
await resolveStableNodePath(process.execPath),
|
|
1331
|
-
doctorEntry,
|
|
1332
|
-
"doctor",
|
|
1333
|
-
"--non-interactive",
|
|
1334
|
-
"--fix"
|
|
1335
|
-
], gitRoot, { MOLDCLAW_UPDATE_IN_PROGRESS: "1" }));
|
|
1336
|
-
steps.push(doctorStep);
|
|
1337
|
-
if (!(await resolveControlUiDistIndexHealth({ root: gitRoot })).exists) {
|
|
1338
|
-
const repairArgv = managerScriptArgs(manager, "ui:build");
|
|
1339
|
-
const started = Date.now();
|
|
1340
|
-
const repairResult = await runCommand(repairArgv, {
|
|
1341
|
-
cwd: gitRoot,
|
|
1342
|
-
timeoutMs
|
|
1343
|
-
});
|
|
1344
|
-
const repairStep = {
|
|
1345
|
-
name: "ui:build (post-doctor repair)",
|
|
1346
|
-
command: repairArgv.join(" "),
|
|
1347
|
-
cwd: gitRoot,
|
|
1348
|
-
durationMs: Date.now() - started,
|
|
1349
|
-
exitCode: repairResult.code,
|
|
1350
|
-
stdoutTail: trimLogTail(repairResult.stdout, MAX_LOG_CHARS),
|
|
1351
|
-
stderrTail: trimLogTail(repairResult.stderr, MAX_LOG_CHARS)
|
|
1352
|
-
};
|
|
1353
|
-
steps.push(repairStep);
|
|
1354
|
-
if (repairResult.code !== 0) return {
|
|
1355
|
-
status: "error",
|
|
1356
|
-
mode: "git",
|
|
1357
|
-
root: gitRoot,
|
|
1358
|
-
reason: repairStep.name,
|
|
1359
|
-
before: {
|
|
1360
|
-
sha: beforeSha,
|
|
1361
|
-
version: beforeVersion
|
|
1362
|
-
},
|
|
1363
|
-
steps,
|
|
1364
|
-
durationMs: Date.now() - startedAt
|
|
1365
|
-
};
|
|
1366
|
-
const repairedUiIndexHealth = await resolveControlUiDistIndexHealth({ root: gitRoot });
|
|
1367
|
-
if (!repairedUiIndexHealth.exists) {
|
|
1368
|
-
const uiIndexPath = repairedUiIndexHealth.indexPath ?? resolveControlUiDistIndexPathForRoot(gitRoot);
|
|
1369
|
-
steps.push({
|
|
1370
|
-
name: "ui assets verify",
|
|
1371
|
-
command: `verify ${uiIndexPath}`,
|
|
1372
|
-
cwd: gitRoot,
|
|
1373
|
-
durationMs: 0,
|
|
1374
|
-
exitCode: 1,
|
|
1375
|
-
stderrTail: `missing ${uiIndexPath}`
|
|
1376
|
-
});
|
|
1377
|
-
return {
|
|
1378
|
-
status: "error",
|
|
1379
|
-
mode: "git",
|
|
1380
|
-
root: gitRoot,
|
|
1381
|
-
reason: "ui-assets-missing",
|
|
1382
|
-
before: {
|
|
1383
|
-
sha: beforeSha,
|
|
1384
|
-
version: beforeVersion
|
|
1385
|
-
},
|
|
1386
|
-
steps,
|
|
1387
|
-
durationMs: Date.now() - startedAt
|
|
1388
|
-
};
|
|
1389
|
-
}
|
|
1390
|
-
}
|
|
1391
|
-
const failedStep = steps.find((s) => s.exitCode !== 0);
|
|
1392
|
-
const afterShaStep = await runStep(step("git rev-parse HEAD (after)", [
|
|
1393
|
-
"git",
|
|
1394
|
-
"-C",
|
|
1395
|
-
gitRoot,
|
|
1396
|
-
"rev-parse",
|
|
1397
|
-
"HEAD"
|
|
1398
|
-
], gitRoot));
|
|
1399
|
-
steps.push(afterShaStep);
|
|
1400
|
-
const afterVersion = await readPackageVersion(gitRoot);
|
|
1401
|
-
return {
|
|
1402
|
-
status: failedStep ? "error" : "ok",
|
|
1403
|
-
mode: "git",
|
|
1404
|
-
root: gitRoot,
|
|
1405
|
-
reason: failedStep ? failedStep.name : void 0,
|
|
1406
|
-
before: {
|
|
1407
|
-
sha: beforeSha,
|
|
1408
|
-
version: beforeVersion
|
|
1409
|
-
},
|
|
1410
|
-
after: {
|
|
1411
|
-
sha: afterShaStep.stdoutTail?.trim() ?? null,
|
|
1412
|
-
version: afterVersion
|
|
1413
|
-
},
|
|
1414
|
-
steps,
|
|
1415
|
-
durationMs: Date.now() - startedAt
|
|
1416
|
-
};
|
|
1417
|
-
}
|
|
1418
|
-
if (!pkgRoot) return {
|
|
1419
|
-
status: "error",
|
|
1420
|
-
mode: "unknown",
|
|
1421
|
-
reason: `no root (${START_DIRS.join(",")})`,
|
|
1422
|
-
steps: [],
|
|
1423
|
-
durationMs: Date.now() - startedAt
|
|
1424
|
-
};
|
|
1425
|
-
const beforeVersion = await readPackageVersion(pkgRoot);
|
|
1426
|
-
const globalManager = await detectGlobalInstallManagerForRoot(runCommand, pkgRoot, timeoutMs);
|
|
1427
|
-
if (globalManager) {
|
|
1428
|
-
const packageName = await readPackageName(pkgRoot) ?? DEFAULT_PACKAGE_NAME;
|
|
1429
|
-
await cleanupGlobalRenameDirs({
|
|
1430
|
-
globalRoot: path.dirname(pkgRoot),
|
|
1431
|
-
packageName
|
|
1432
|
-
});
|
|
1433
|
-
const channel = opts.channel ?? "stable";
|
|
1434
|
-
const tag = normalizeTag(opts.tag ?? channelToNpmTag(channel));
|
|
1435
|
-
const steps = [];
|
|
1436
|
-
const globalInstallEnv = await createGlobalInstallEnv();
|
|
1437
|
-
const spec = resolveGlobalInstallSpec({
|
|
1438
|
-
packageName,
|
|
1439
|
-
tag,
|
|
1440
|
-
env: globalInstallEnv
|
|
1441
|
-
});
|
|
1442
|
-
const updateStep = await runStep({
|
|
1443
|
-
runCommand,
|
|
1444
|
-
name: "global update",
|
|
1445
|
-
argv: globalInstallArgs(globalManager, spec),
|
|
1446
|
-
cwd: pkgRoot,
|
|
1447
|
-
timeoutMs,
|
|
1448
|
-
env: globalInstallEnv,
|
|
1449
|
-
progress,
|
|
1450
|
-
stepIndex: 0,
|
|
1451
|
-
totalSteps: 1
|
|
1452
|
-
});
|
|
1453
|
-
steps.push(updateStep);
|
|
1454
|
-
let finalStep = updateStep;
|
|
1455
|
-
if (updateStep.exitCode !== 0) {
|
|
1456
|
-
const fallbackArgv = globalInstallFallbackArgs(globalManager, spec);
|
|
1457
|
-
if (fallbackArgv) {
|
|
1458
|
-
const fallbackStep = await runStep({
|
|
1459
|
-
runCommand,
|
|
1460
|
-
name: "global update (omit optional)",
|
|
1461
|
-
argv: fallbackArgv,
|
|
1462
|
-
cwd: pkgRoot,
|
|
1463
|
-
timeoutMs,
|
|
1464
|
-
env: globalInstallEnv,
|
|
1465
|
-
progress,
|
|
1466
|
-
stepIndex: 0,
|
|
1467
|
-
totalSteps: 1
|
|
1468
|
-
});
|
|
1469
|
-
steps.push(fallbackStep);
|
|
1470
|
-
finalStep = fallbackStep;
|
|
1471
|
-
}
|
|
1472
|
-
}
|
|
1473
|
-
const afterVersion = await readPackageVersion(pkgRoot);
|
|
1474
|
-
return {
|
|
1475
|
-
status: finalStep.exitCode === 0 ? "ok" : "error",
|
|
1476
|
-
mode: globalManager,
|
|
1477
|
-
root: pkgRoot,
|
|
1478
|
-
reason: finalStep.exitCode === 0 ? void 0 : finalStep.name,
|
|
1479
|
-
before: { version: beforeVersion },
|
|
1480
|
-
after: { version: afterVersion },
|
|
1481
|
-
steps,
|
|
1482
|
-
durationMs: Date.now() - startedAt
|
|
1483
|
-
};
|
|
1484
|
-
}
|
|
1485
|
-
return {
|
|
1486
|
-
status: "skipped",
|
|
1487
|
-
mode: "unknown",
|
|
1488
|
-
root: pkgRoot,
|
|
1489
|
-
reason: "not-git-install",
|
|
1490
|
-
before: { version: beforeVersion },
|
|
1491
|
-
steps: [],
|
|
1492
|
-
durationMs: Date.now() - startedAt
|
|
1493
|
-
};
|
|
1494
|
-
}
|
|
1495
|
-
//#endregion
|
|
1496
|
-
export { detectGlobalInstallManagerByPresence as a, resolveGlobalInstallSpec as c, readPackageName as d, readPackageVersion as f, computePreviousRunAtMs as g, computeNextRunAtMs as h, createGlobalInstallEnv as i, resolveGlobalPackageRoot as l, coerceFiniteScheduleNumber as m, canResolveRegistryVersionForPackageTarget as n, detectGlobalInstallManagerForRoot as o, normalizeStoredCronJobs as p, cleanupGlobalRenameDirs as r, globalInstallArgs as s, runGatewayUpdate as t, normalizePackageTagInput as u };
|