@spacebar_ai/moldclaw-core 2026.3.41 → 2026.3.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accounts-5qY-dKca.d.ts +103 -0
- package/dist/accounts-SqdHz2ZP.js +114 -0
- package/dist/acp-cli-E6bcNqiE.js +2093 -0
- package/dist/actions.runtime-BU_XMuLk.js +119 -0
- package/dist/actions.runtime-CY5h8lqH.js +133 -0
- package/dist/agent-scope-lZlwP1At.js +208 -0
- package/dist/agents-C4SkadR1.js +853 -0
- package/dist/agents-RfwqGCzE.js +222 -0
- package/dist/agents.config-CX9CPNfP.js +17 -0
- package/dist/agents.config-DF9Zwn9n.js +121 -0
- package/dist/allow-list-3WSjz1zl.js +81 -0
- package/dist/allowlist-DNbDjFjw.js +142 -0
- package/dist/api-BEOpJ7dR.js +117 -0
- package/dist/audit-CpJz_eu6.js +787 -0
- package/dist/audit-CpfSjvyo.js +54 -0
- package/dist/audit-channel.collect.runtime-BeGotloZ.js +605 -0
- package/dist/audit-channel.runtime-BJDZ7ETt.js +121 -0
- package/dist/audit-extra.async-C2G0mqmk.js +813 -0
- package/dist/audit-membership-runtime-B1FqJsPV.js +162 -0
- package/dist/audit.deep.runtime-DyL9O_sU.js +25 -0
- package/dist/audit.nondeep.runtime-C6jFgJfH.js +832 -0
- package/dist/audit.runtime-Dnlsn23e.js +118 -0
- package/dist/auth-Ch3Rchm4.js +101 -0
- package/dist/auth-choice-CEFSlnLT.js +122 -0
- package/dist/auth-choice-CVCef-eU.js +268 -0
- package/dist/auth-choice-Cez-pXrg.js +507 -0
- package/dist/auth-choice-options-DO78mvPe.js +123 -0
- package/dist/auth-choice-prompt-CUkC7Mmb.js +36 -0
- package/dist/auth-choice-prompt-DCuQRiVl.js +115 -0
- package/dist/auth-choice.apply-helpers-BhbNIV8X.js +66 -0
- package/dist/auth-choice.plugin-providers.runtime-4BhqvEw_.js +119 -0
- package/dist/auth-profiles-smABVXzp.js +128040 -0
- package/dist/auth-profiles.runtime-Cr-ojtTc.js +116 -0
- package/dist/banner-CojBHPWr.js +342 -0
- package/dist/bluebubbles-BnLsj2Fy.d.ts +6 -0
- package/dist/bluebubbles-CVk7M3Bl.js +64 -0
- package/dist/bot-DdyrB2z9.d.ts +478 -0
- package/dist/brave-w4Fo8WZ3.js +24 -0
- package/dist/browser-cli-DWFs3P_i.js +1494 -0
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.d.ts +1 -1
- package/dist/bundled/boot-md/handler.js +35 -35
- package/dist/bundled/bootstrap-extra-files/handler.d.ts +1 -1
- package/dist/bundled/bootstrap-extra-files/handler.js +1 -1
- package/dist/bundled/command-logger/handler.d.ts +1 -1
- package/dist/bundled/session-memory/handler.d.ts +1 -1
- package/dist/bundled/session-memory/handler.js +36 -36
- package/dist/call-Do7wTSr7.js +39 -0
- package/dist/call-gdDAt07d.js +640 -0
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/channel-B26pkce0.js +214 -0
- package/dist/channel-BJHp0AQC.js +352 -0
- package/dist/channel-BKFOv51P.js +4681 -0
- package/dist/channel-BNgpOY8v.js +538 -0
- package/dist/channel-BcQAAo2P.js +226 -0
- package/dist/channel-BvNdnhbx.js +1598 -0
- package/dist/channel-C1Rda3Jd.js +306 -0
- package/dist/channel-C87DG-F7.js +803 -0
- package/dist/channel-CIip0kvZ.js +619 -0
- package/dist/channel-CTPxoT_E2.js +316 -0
- package/dist/channel-CklaCzUG.js +562 -0
- package/dist/channel-CoJnAdLs.js +920 -0
- package/dist/channel-D3tafL1_.js +949 -0
- package/dist/channel-DFMrP2uu.js +542 -0
- package/dist/channel-DMd5cJQe.js +397 -0
- package/dist/channel-Dm34kxAJ.js +207 -0
- package/dist/channel-DmwF9udn.js +1321 -0
- package/dist/channel-account-context-Bjur9nlh.js +103 -0
- package/dist/channel-bGnST659.js +943 -0
- package/dist/channel-hIgbkTZf.js +575 -0
- package/dist/channel-m_TGrDKo.js +497 -0
- package/dist/channel-options-DoUPBMa8.js +50 -0
- package/dist/channel-plugin-ids-TZIY4hFs.js +26 -0
- package/dist/channel-summary-qD54bOBO.js +111 -0
- package/dist/channel.runtime-B0H04Dkk.js +199 -0
- package/dist/channel.runtime-BU1f3NkV.js +418 -0
- package/dist/channel.runtime-Bj1sfLep.js +4011 -0
- package/dist/channel.runtime-BtPAAJc3.js +870 -0
- package/dist/channel.runtime-Bx-10m_j.js +171 -0
- package/dist/channel.runtime-CI_TBywQ.js +179 -0
- package/dist/channel.runtime-CSLj14-Z.js +182 -0
- package/dist/channel.runtime-D-lTSYAd.js +404 -0
- package/dist/channel.runtime-DJqIOSji.js +127 -0
- package/dist/channel.runtime-Ec8aQ9V2.js +241 -0
- package/dist/channel.runtime-ax5a1jBm.js +218 -0
- package/dist/channel.setup-B-ncdYLT.js +9 -0
- package/dist/channel.setup-BY4bh5dm.js +9 -0
- package/dist/channel.setup-BovsdMnL.js +57 -0
- package/dist/channel.setup-CXzXA25h.js +6 -0
- package/dist/channel.setup-DcZUEufN.js +8 -0
- package/dist/channel.setup-E6zceRsE.js +8 -0
- package/dist/channel.setup-Pc7nGbdX.js +11 -0
- package/dist/channels/plugins/actions/discord.d.ts +2 -2
- package/dist/channels/plugins/actions/discord.js +35 -35
- package/dist/channels/plugins/actions/signal.d.ts +1 -1
- package/dist/channels/plugins/actions/signal.js +35 -35
- package/dist/channels/plugins/actions/telegram.d.ts +2 -2
- package/dist/channels/plugins/actions/telegram.js +35 -35
- package/dist/channels/plugins/agent-tools/whatsapp-login.d.ts +3 -3
- package/dist/channels/plugins/agent-tools/whatsapp-login.js +35 -35
- package/dist/channels-CPtE5ND6.js +404 -0
- package/dist/channels-Cj8ZolHI.js +1118 -0
- package/dist/channels-cli-D2sKrntt.js +291 -0
- package/dist/channels-status-issues-CzIHODg2.js +16 -0
- package/dist/clawbot-cli-BcwEDmUn.js +118 -0
- package/dist/cleanup-utils-D0L17RsX.js +96 -0
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/cli-BvGVPKnD.js +154 -0
- package/dist/command-registry-CADQzTAg.js +14 -0
- package/dist/command-registry-ktiJNAJd.js +242 -0
- package/dist/command-secret-gateway-CXp10RTM.js +111 -0
- package/dist/compact.runtime-DyKL-Iar.js +116 -0
- package/dist/completion-cli-Bz4STrpt.js +17 -0
- package/dist/completion-cli-pVda2OFb.js +445 -0
- package/dist/config-BbvDRSYp.js +31 -0
- package/dist/config-CwBv71QC.js +44 -0
- package/dist/config-cli-Y0uXHbOw.js +678 -0
- package/dist/config-guard-BpW5g7JE.js +118 -0
- package/dist/config-validation-B-vLIsbo.js +262 -0
- package/dist/config-value-DT3-5958.js +132 -0
- package/dist/configure-B9U-jCqP.js +1100 -0
- package/dist/configure-BJ3Wrs5b.js +243 -0
- package/dist/control-ui-assets-C1YDYi82.js +232 -0
- package/dist/control-ui-shared-Dm5Dh0Lo.js +29 -0
- package/dist/core-BwKq3krw.js +150 -0
- package/dist/core-hjBwfDsW.d.ts +87 -0
- package/dist/cron-cli-DTDgfoMh.js +639 -0
- package/dist/daemon-cli-C-dkAXR1.js +339 -0
- package/dist/daemon-install-Oy0Q5pMF.js +180 -0
- package/dist/deliver-DNGnDqF9.js +111 -0
- package/dist/deliver-runtime-CCNZIhET.js +111 -0
- package/dist/device-id-cli-XvwZbIyC.js +52 -0
- package/dist/device-identity-IG5DngWM.js +365 -0
- package/dist/devices-cli-DIsxj4xp.js +342 -0
- package/dist/diagnostic-DTPopFvh.js +310 -0
- package/dist/directory-cli-DTSY3Ktr.js +311 -0
- package/dist/directory-config-helpers-DpFcAbmo.d.ts +38 -0
- package/dist/directory.static-CBRAUwUW.js +44 -0
- package/dist/discord-CrgxhEWw.js +114 -0
- package/dist/discovery-DrG7wmAR.js +48 -0
- package/dist/dm-policy-shared-DKoGdUpY.d.ts +95 -0
- package/dist/dns-cli-BJiz6CLK.js +217 -0
- package/dist/docs-cli-Dq2Yi5qO.js +174 -0
- package/dist/doctor-completion-D3GeVcFP.js +90 -0
- package/dist/doctor-config-flow-B1cMjr8h.js +112 -0
- package/dist/doctor-config-flow-BUe7JpV3.js +2437 -0
- package/dist/enable-Bc8bCuVe.js +24 -0
- package/dist/entry.js +4 -4
- package/dist/exec-approvals-cli-kLAev6bP.js +421 -0
- package/dist/extensions/acpx/index.d.ts +1 -1
- package/dist/extensions/amazon-bedrock/index.d.ts +1 -1
- package/dist/extensions/amazon-bedrock/index.js +4 -4
- package/dist/extensions/anthropic/index.d.ts +1 -1
- package/dist/extensions/anthropic/index.js +35 -35
- package/dist/extensions/bluebubbles/index.d.ts +1 -1
- package/dist/extensions/bluebubbles/index.js +39 -39
- package/dist/extensions/bluebubbles/setup-entry.d.ts +2 -2
- package/dist/extensions/bluebubbles/setup-entry.js +39 -39
- package/dist/extensions/brave/index.d.ts +1 -1
- package/dist/extensions/brave/index.js +5 -5
- package/dist/extensions/byteplus/index.d.ts +1 -1
- package/dist/extensions/byteplus/index.js +35 -35
- package/dist/extensions/cloudflare-ai-gateway/index.d.ts +1 -1
- package/dist/extensions/cloudflare-ai-gateway/index.js +36 -36
- package/dist/extensions/copilot-proxy/index.d.ts +1 -1
- package/dist/extensions/copilot-proxy/index.js +4 -4
- package/dist/extensions/device-pair/index.d.ts +1 -1
- package/dist/extensions/device-pair/index.js +4 -4
- package/dist/extensions/diagnostics-otel/index.d.ts +1 -1
- package/dist/extensions/diagnostics-otel/index.js +4 -4
- package/dist/extensions/diffs/index.d.ts +1 -1
- package/dist/extensions/discord/index.d.ts +1 -1
- package/dist/extensions/discord/index.js +40 -40
- package/dist/extensions/discord/setup-entry.d.ts +1 -1
- package/dist/extensions/discord/setup-entry.js +38 -38
- package/dist/extensions/elevenlabs/index.d.ts +1 -1
- package/dist/extensions/elevenlabs/index.js +35 -35
- package/dist/extensions/feishu/index.d.ts +2 -2
- package/dist/extensions/feishu/index.js +40 -40
- package/dist/extensions/feishu/setup-entry.d.ts +2 -2
- package/dist/extensions/feishu/setup-entry.js +37 -37
- package/dist/extensions/firecrawl/index.d.ts +1 -1
- package/dist/extensions/firecrawl/index.js +35 -35
- package/dist/extensions/github-copilot/index.d.ts +1 -1
- package/dist/extensions/github-copilot/index.js +35 -35
- package/dist/extensions/google/index.d.ts +1 -1
- package/dist/extensions/google/index.js +35 -35
- package/dist/extensions/googlechat/index.d.ts +1 -1
- package/dist/extensions/googlechat/index.js +38 -38
- package/dist/extensions/googlechat/setup-entry.d.ts +1 -1
- package/dist/extensions/googlechat/setup-entry.js +38 -38
- package/dist/extensions/huggingface/index.d.ts +1 -1
- package/dist/extensions/huggingface/index.js +35 -35
- package/dist/extensions/imessage/index.d.ts +1 -1
- package/dist/extensions/imessage/index.js +39 -39
- package/dist/extensions/imessage/setup-entry.d.ts +1 -1
- package/dist/extensions/imessage/setup-entry.js +39 -39
- package/dist/extensions/irc/index.d.ts +1 -1
- package/dist/extensions/irc/index.js +38 -38
- package/dist/extensions/irc/setup-entry.d.ts +2 -2
- package/dist/extensions/irc/setup-entry.js +38 -38
- package/dist/extensions/kakao-talkchannel/index.d.ts +1 -1
- package/dist/extensions/kakao-talkchannel/index.js +4 -4
- package/dist/extensions/kilocode/index.d.ts +1 -1
- package/dist/extensions/kilocode/index.js +35 -35
- package/dist/extensions/kimi-coding/index.d.ts +1 -1
- package/dist/extensions/kimi-coding/index.js +35 -35
- package/dist/extensions/line/index.d.ts +1 -1
- package/dist/extensions/line/index.js +37 -37
- package/dist/extensions/line/setup-entry.d.ts +1 -1
- package/dist/extensions/line/setup-entry.js +37 -37
- package/dist/extensions/llm-task/index.d.ts +1 -1
- package/dist/extensions/llm-task/index.js +35 -35
- package/dist/extensions/lobster/index.d.ts +1 -1
- package/dist/extensions/lobster/index.js +4 -4
- package/dist/extensions/matrix/index.d.ts +1 -1
- package/dist/extensions/matrix/index.js +40 -40
- package/dist/extensions/matrix/setup-entry.d.ts +2 -2
- package/dist/extensions/matrix/setup-entry.js +40 -40
- package/dist/extensions/mattermost/index.d.ts +1 -1
- package/dist/extensions/mattermost/index.js +37 -37
- package/dist/extensions/mattermost/setup-entry.d.ts +2 -2
- package/dist/extensions/mattermost/setup-entry.js +37 -37
- package/dist/extensions/memory-core/index.d.ts +1 -1
- package/dist/extensions/memory-core/index.js +4 -4
- package/dist/extensions/memory-lancedb/index.d.ts +1 -1
- package/dist/extensions/memory-lancedb/index.js +4 -4
- package/dist/extensions/microsoft/index.d.ts +1 -1
- package/dist/extensions/microsoft/index.js +35 -35
- package/dist/extensions/minimax/index.d.ts +1 -1
- package/dist/extensions/minimax/index.js +35 -35
- package/dist/extensions/mistral/index.d.ts +1 -1
- package/dist/extensions/mistral/index.js +35 -35
- package/dist/extensions/modelstudio/index.d.ts +1 -1
- package/dist/extensions/modelstudio/index.js +35 -35
- package/dist/extensions/moonshot/index.d.ts +1 -1
- package/dist/extensions/moonshot/index.js +35 -35
- package/dist/extensions/msteams/index.d.ts +1 -1
- package/dist/extensions/msteams/index.js +40 -40
- package/dist/extensions/msteams/setup-entry.d.ts +1 -1
- package/dist/extensions/msteams/setup-entry.js +40 -40
- package/dist/extensions/nextcloud-talk/index.d.ts +1 -1
- package/dist/extensions/nextcloud-talk/index.js +37 -37
- package/dist/extensions/nextcloud-talk/setup-entry.d.ts +2 -2
- package/dist/extensions/nextcloud-talk/setup-entry.js +37 -37
- package/dist/extensions/nostr/index.d.ts +1 -1
- package/dist/extensions/nostr/index.js +37 -37
- package/dist/extensions/nostr/setup-entry.d.ts +1 -1
- package/dist/extensions/nostr/setup-entry.js +37 -37
- package/dist/extensions/nvidia/index.d.ts +1 -1
- package/dist/extensions/nvidia/index.js +4 -4
- package/dist/extensions/ollama/index.d.ts +1 -1
- package/dist/extensions/ollama/index.js +7 -7
- package/dist/extensions/open-prose/index.d.ts +1 -1
- package/dist/extensions/open-prose/index.js +4 -4
- package/dist/extensions/openai/index.d.ts +1 -1
- package/dist/extensions/openai/index.js +35 -35
- package/dist/extensions/opencode/index.d.ts +1 -1
- package/dist/extensions/opencode/index.js +35 -35
- package/dist/extensions/opencode-go/index.d.ts +1 -1
- package/dist/extensions/opencode-go/index.js +35 -35
- package/dist/extensions/openrouter/index.d.ts +1 -1
- package/dist/extensions/openrouter/index.js +35 -35
- package/dist/extensions/openshell/index.d.ts +1 -1
- package/dist/extensions/openshell/index.js +35 -35
- package/dist/extensions/perplexity/index.d.ts +1 -1
- package/dist/extensions/perplexity/index.js +5 -5
- package/dist/extensions/phone-control/index.d.ts +1 -1
- package/dist/extensions/phone-control/index.js +4 -4
- package/dist/extensions/qianfan/index.d.ts +1 -1
- package/dist/extensions/qianfan/index.js +35 -35
- package/dist/extensions/qwen-portal-auth/index.d.ts +1 -1
- package/dist/extensions/qwen-portal-auth/index.js +35 -35
- package/dist/extensions/sglang/index.d.ts +1 -1
- package/dist/extensions/sglang/index.js +35 -35
- package/dist/extensions/signal/index.d.ts +1 -1
- package/dist/extensions/signal/index.js +38 -38
- package/dist/extensions/signal/setup-entry.d.ts +1 -1
- package/dist/extensions/signal/setup-entry.js +38 -38
- package/dist/extensions/slack/index.d.ts +1 -1
- package/dist/extensions/slack/index.js +39 -39
- package/dist/extensions/slack/setup-entry.d.ts +1 -1
- package/dist/extensions/slack/setup-entry.js +38 -38
- package/dist/extensions/synology-chat/index.d.ts +1 -1
- package/dist/extensions/synology-chat/index.js +37 -37
- package/dist/extensions/synology-chat/setup-entry.d.ts +1 -1
- package/dist/extensions/synology-chat/setup-entry.js +37 -37
- package/dist/extensions/synthetic/index.d.ts +1 -1
- package/dist/extensions/synthetic/index.js +35 -35
- package/dist/extensions/talk-voice/index.d.ts +1 -1
- package/dist/extensions/talk-voice/index.js +35 -35
- package/dist/extensions/telegram/index.d.ts +1 -1
- package/dist/extensions/telegram/index.js +38 -38
- package/dist/extensions/telegram/setup-entry.d.ts +1 -1
- package/dist/extensions/telegram/setup-entry.js +37 -37
- package/dist/extensions/thread-ownership/index.d.ts +1 -1
- package/dist/extensions/thread-ownership/index.js +4 -4
- package/dist/extensions/tlon/index.d.ts +1 -1
- package/dist/extensions/tlon/index.js +37 -37
- package/dist/extensions/tlon/setup-entry.d.ts +1 -1
- package/dist/extensions/tlon/setup-entry.js +37 -37
- package/dist/extensions/together/index.d.ts +1 -1
- package/dist/extensions/together/index.js +35 -35
- package/dist/extensions/twitch/index.d.ts +2 -2
- package/dist/extensions/twitch/index.js +37 -37
- package/dist/extensions/venice/index.d.ts +1 -1
- package/dist/extensions/venice/index.js +35 -35
- package/dist/extensions/vercel-ai-gateway/index.d.ts +1 -1
- package/dist/extensions/vercel-ai-gateway/index.js +36 -36
- package/dist/extensions/vllm/index.d.ts +1 -1
- package/dist/extensions/vllm/index.js +35 -35
- package/dist/extensions/voice-call/index.d.ts +1 -1
- package/dist/extensions/voice-call/index.js +35 -35
- package/dist/extensions/volcengine/index.d.ts +1 -1
- package/dist/extensions/volcengine/index.js +35 -35
- package/dist/extensions/whatsapp/index.d.ts +1 -1
- package/dist/extensions/whatsapp/index.js +38 -38
- package/dist/extensions/whatsapp/setup-entry.d.ts +1 -1
- package/dist/extensions/whatsapp/setup-entry.js +38 -38
- package/dist/extensions/xai/index.d.ts +1 -1
- package/dist/extensions/xai/index.js +35 -35
- package/dist/extensions/xiaomi/index.d.ts +1 -1
- package/dist/extensions/xiaomi/index.js +35 -35
- package/dist/extensions/zai/index.d.ts +1 -1
- package/dist/extensions/zai/index.js +35 -35
- package/dist/extensions/zalo/index.d.ts +1 -1
- package/dist/extensions/zalo/index.js +39 -39
- package/dist/extensions/zalo/setup-entry.d.ts +1 -1
- package/dist/extensions/zalo/setup-entry.js +39 -39
- package/dist/extensions/zalouser/index.d.ts +1 -1
- package/dist/extensions/zalouser/index.js +40 -40
- package/dist/extensions/zalouser/setup-entry.d.ts +1 -1
- package/dist/extensions/zalouser/setup-entry.js +40 -40
- package/dist/feishu-fIcnHDTd.d.ts +36 -0
- package/dist/gateway-cli-0c-8h93_.js +26437 -0
- package/dist/gateway-install-token-1PwJvrBY.js +163 -0
- package/dist/gateway-rpc-C0Vk51W7.js +26 -0
- package/dist/gateway-runtime-CBm3CCoA.js +69 -0
- package/dist/git-commit-BTWXFY41.js +177 -0
- package/dist/git-commit-D6GTN5Yt.js +2 -0
- package/dist/googlechat-BQr4xgoZ.js +307 -0
- package/dist/googlechat-BvwsCVKl.d.ts +12 -0
- package/dist/group-access-DpiQnd-G.d.ts +61 -0
- package/dist/health-6yZQGADY.js +113 -0
- package/dist/health-C9DYGyRe.js +570 -0
- package/dist/heartbeat-summary-Dct2lqJj.js +57 -0
- package/dist/help-CtwSApfq.js +81 -0
- package/dist/hooks-9gokOxZ5.d.ts +6 -0
- package/dist/hooks-cli-BegKzHZT.js +1000 -0
- package/dist/hooks-status-Bm_pGORf.js +78 -0
- package/dist/http-registry-D-S6a1Na.d.ts +20 -0
- package/dist/identity-file-Diub2a0t.js +60 -0
- package/dist/image-generation-CbIVzmAR.d.ts +9 -0
- package/dist/imessage-Bgok9kfl.js +31 -0
- package/dist/imessage-VIHePprL.js +115 -0
- package/dist/inbound-reply-dispatch-B53GAGWq.js +71 -0
- package/dist/inbound-reply-dispatch-n7U3qg15.d.ts +72 -0
- package/dist/index.js +2 -2
- package/dist/install-target-oz1pjfHH.js +574 -0
- package/dist/installs-CUFm5V8a.js +532 -0
- package/dist/io-BaBxjB1v.js +9739 -0
- package/dist/io-CgHb1Jld.js +29 -0
- package/dist/irc-CaRKzGvW.js +672 -0
- package/dist/library-C5SNBCMb.js +112 -0
- package/dist/lifecycle-core-Dn8PK6nk.js +382 -0
- package/dist/line/accounts.d.ts +2 -2
- package/dist/line/send.d.ts +1 -1
- package/dist/line/send.js +7 -7
- package/dist/line/template-messages.d.ts +1 -1
- package/dist/line-B5QFpgN_.d.ts +75 -0
- package/dist/line-fePrrQOD.js +530 -0
- package/dist/llm-slug-generator-hKae3XDA.js +67 -0
- package/dist/llm-slug-generator.d.ts +1 -1
- package/dist/llm-slug-generator.js +36 -36
- package/dist/logging-CdisccbY.js +13 -0
- package/dist/logging-LKQSgX1d.js +30 -0
- package/dist/login-qr-C1YWh4nE.js +233 -0
- package/dist/login-qr-WFluMDMb.js +112 -0
- package/dist/logs-cli-CNzOvZ2d.js +256 -0
- package/dist/manager-runtime-DgMhLTkR.js +111 -0
- package/dist/manager.runtime-hUWgpPt2.js +715 -0
- package/dist/manifest-registry-CS_p1OBQ.js +1329 -0
- package/dist/matrix-43_RGLZN.d.ts +68 -0
- package/dist/matrix-CCFxHfxa.js +1269 -0
- package/dist/matrix-DWs_qIkJ.js +1495 -0
- package/dist/mcp-cli-Ci2jvv3s.js +87 -0
- package/dist/media-understanding.runtime-Cdr6iTW6.js +116 -0
- package/dist/memory-cli-LZbyF0Iu.js +111 -0
- package/dist/memory-search-BHhETk6u.js +17 -0
- package/dist/memory-search-tTD5o_rU.js +204 -0
- package/dist/method-scopes-B2ZKSsxQ.js +2452 -0
- package/dist/model-auth-markers-LqZ4qhrZ.d.ts +20 -0
- package/dist/model-picker-CTR5mo4v.js +112 -0
- package/dist/model-picker-DG4z_dBs.js +390 -0
- package/dist/model-picker.runtime-DMQ9Pj9_.js +125 -0
- package/dist/model-selection-bBBxfXdb.js +653 -0
- package/dist/model-suppression.runtime-BVG75tZ7.js +116 -0
- package/dist/models-BjkVLfgw.js +2514 -0
- package/dist/models-ZO01Q4cx.js +118 -0
- package/dist/models-cli-DemdF-bm.js +309 -0
- package/dist/models-config-B2Jja8ua.js +111 -0
- package/dist/models-config.providers.discovery-puxTsH39.d.ts +18 -0
- package/dist/moldclaw-root-Cb6HRlUO.js +92 -0
- package/dist/monitor-BP4idxJD.js +782 -0
- package/dist/monitor-B_eP8Eim.js +772 -0
- package/dist/monitor-CRHYNl5J.js +3468 -0
- package/dist/monitor-Ci1Xg4g3.js +113 -0
- package/dist/monitor-DEodDl3z.js +6823 -0
- package/dist/monitor-DJlNKuMz.js +115 -0
- package/dist/monitor-DvFwDS9w.js +3076 -0
- package/dist/monitor-shared--cEjSf8s.js +444 -0
- package/dist/msteams-CV2a8uE8.js +852 -0
- package/dist/node-cli-Of2g7DSd.js +2503 -0
- package/dist/node-resolve-BYC2FbO2.js +835 -0
- package/dist/nodes-cli-CPHM6Upj.js +1380 -0
- package/dist/nostr-BFKRoOlz.d.ts +7 -0
- package/dist/nostr-lHpcBzz4.js +8744 -0
- package/dist/npm-resolution-kqHN85wB.js +60 -0
- package/dist/oauth-env-CLG8KOrz.js +10 -0
- package/dist/onboard-BON0C360.js +48 -0
- package/dist/onboard-CRkIBgOI.js +589 -0
- package/dist/onboard-DsKI17iq.js +25 -0
- package/dist/onboard-channels-BY3IbBBf.js +1241 -0
- package/dist/onboard-channels-CLKdRxvW.js +205 -0
- package/dist/onboard-custom-BjPrMo_R.js +571 -0
- package/dist/onboard-custom-DqcPiZBN.js +114 -0
- package/dist/onboard-helpers-BkrOY5OE.js +113 -0
- package/dist/onboard-helpers-DiSRTpZC.js +335 -0
- package/dist/onboard-hooks-pzEPZAvl.js +72 -0
- package/dist/onboard-remote-ChyLC6Dk.js +181 -0
- package/dist/onboard-remote-DHmK9ntl.js +117 -0
- package/dist/onboard-search-BgA3jEMW.js +302 -0
- package/dist/onboard-skills-BMo_NvnW.js +133 -0
- package/dist/onboard-skills-Bba-Z2p8.js +117 -0
- package/dist/outbound-media-BHD4aJEX.d.ts +11 -0
- package/dist/outbound-media-DSno0N82.js +11 -0
- package/dist/pairing-access-CzHpaM0R.d.ts +21 -0
- package/dist/pairing-cli-CmklqK0q.js +217 -0
- package/dist/perplexity-CXwMDD3u.js +24 -0
- package/dist/persistent-dedupe-B9vrAf8t.d.ts +26 -0
- package/dist/pi-model-discovery-runtime-BrK7tcaO.js +111 -0
- package/dist/pi-tools.before-tool-call.runtime-C5yLUogH.js +381 -0
- package/dist/plugin-install-C4AWJIFP.js +117 -0
- package/dist/plugin-install-CB3J1hfV.js +184 -0
- package/dist/plugin-install-plan-7itZiegi.js +49 -0
- package/dist/plugin-registry-DX_GFoiz.js +113 -0
- package/dist/plugin-registry-e3cxTtvb.js +49 -0
- package/dist/plugin-sdk/account-resolution.js +35 -35
- package/dist/plugin-sdk/acp-runtime.js +35 -35
- package/dist/plugin-sdk/agent-runtime.js +35 -35
- package/dist/plugin-sdk/bluebubbles.js +37 -37
- package/dist/plugin-sdk/channel-config-helpers.js +35 -35
- package/dist/plugin-sdk/channel-policy.js +35 -35
- package/dist/plugin-sdk/channel-runtime.js +35 -35
- package/dist/plugin-sdk/compat.js +36 -36
- package/dist/plugin-sdk/config-runtime.js +35 -35
- package/dist/plugin-sdk/conversation-runtime.js +35 -35
- package/dist/plugin-sdk/copilot-proxy.js +4 -4
- package/dist/plugin-sdk/core.js +4 -4
- package/dist/plugin-sdk/device-pair.js +4 -4
- package/dist/plugin-sdk/discord.js +35 -35
- package/dist/plugin-sdk/feishu.js +35 -35
- package/dist/plugin-sdk/gateway-runtime.js +10 -10
- package/dist/plugin-sdk/googlechat.js +37 -37
- package/dist/plugin-sdk/image-generation-runtime.js +35 -35
- package/dist/plugin-sdk/image-generation.js +35 -35
- package/dist/plugin-sdk/imessage.js +36 -36
- package/dist/plugin-sdk/index.js +35 -35
- package/dist/plugin-sdk/infra-runtime.js +35 -35
- package/dist/plugin-sdk/irc.js +37 -37
- package/dist/plugin-sdk/line.js +36 -36
- package/dist/plugin-sdk/llm-task.js +35 -35
- package/dist/plugin-sdk/lobster.js +4 -4
- package/dist/plugin-sdk/matrix.js +37 -37
- package/dist/plugin-sdk/mattermost.js +36 -36
- package/dist/plugin-sdk/media-runtime.js +35 -35
- package/dist/plugin-sdk/media-understanding-runtime.js +35 -35
- package/dist/plugin-sdk/media-understanding.js +35 -35
- package/dist/plugin-sdk/memory-lancedb.js +4 -4
- package/dist/plugin-sdk/minimax-portal-auth.js +4 -4
- package/dist/plugin-sdk/msteams.js +38 -38
- package/dist/plugin-sdk/nextcloud-talk.js +36 -36
- package/dist/plugin-sdk/nostr.js +36 -36
- package/dist/plugin-sdk/ollama-setup.js +9 -9
- package/dist/plugin-sdk/open-prose.js +4 -4
- package/dist/plugin-sdk/phone-control.js +4 -4
- package/dist/plugin-sdk/plugin-runtime.js +35 -35
- package/dist/plugin-sdk/provider-auth.js +35 -35
- package/dist/plugin-sdk/provider-models.js +5 -5
- package/dist/plugin-sdk/provider-onboard.js +4 -4
- package/dist/plugin-sdk/provider-setup.js +39 -39
- package/dist/plugin-sdk/provider-stream.js +4 -4
- package/dist/plugin-sdk/provider-usage.js +4 -4
- package/dist/plugin-sdk/qwen-portal-auth.js +35 -35
- package/dist/plugin-sdk/reply-history.js +35 -35
- package/dist/plugin-sdk/reply-runtime.js +35 -35
- package/dist/plugin-sdk/routing.js +3 -3
- package/dist/plugin-sdk/sandbox.js +35 -35
- package/dist/plugin-sdk/security-runtime.js +35 -35
- package/dist/plugin-sdk/self-hosted-provider-setup.js +37 -37
- package/dist/plugin-sdk/setup.js +35 -35
- package/dist/plugin-sdk/signal.js +35 -35
- package/dist/plugin-sdk/slack.js +35 -35
- package/dist/plugin-sdk/speech-runtime.js +35 -35
- package/dist/plugin-sdk/speech.js +35 -35
- package/dist/plugin-sdk/src/secrets/secure-file-store.d.ts +26 -0
- package/dist/plugin-sdk/src/subscription/provider.d.ts +5 -3
- package/dist/plugin-sdk/synology-chat.js +36 -36
- package/dist/plugin-sdk/talk-voice.js +4 -4
- package/dist/plugin-sdk/telegram.js +35 -35
- package/dist/plugin-sdk/text-runtime.js +7 -7
- package/dist/plugin-sdk/thread-ownership.js +4 -4
- package/dist/plugin-sdk/tlon.js +36 -36
- package/dist/plugin-sdk/twitch.js +35 -35
- package/dist/plugin-sdk/voice-call.js +35 -35
- package/dist/plugin-sdk/whatsapp.js +35 -35
- package/dist/plugin-sdk/zalo.js +38 -38
- package/dist/plugin-sdk/zalouser.js +38 -38
- package/dist/plugins/runtime/index.d.ts +1 -1
- package/dist/plugins/runtime/index.js +35 -35
- package/dist/plugins-DF5FaTO0.js +111 -0
- package/dist/plugins-cli-CvTJemqC.js +917 -0
- package/dist/policy-CNXISK_a.js +143 -0
- package/dist/preflight-audio.runtime-RP000oxo.js +116 -0
- package/dist/probe-BkM5pykD.js +21 -0
- package/dist/probe-DKbRTJv5.js +1793 -0
- package/dist/probe-DkrfRsjU.js +47 -0
- package/dist/probe-DpcJ0WeP.js +129 -0
- package/dist/probe-auth-BcNjX8hy.js +40 -0
- package/dist/probe-auth-DhuAb8ls.js +48 -0
- package/dist/probe-wciBj-aL.js +6329 -0
- package/dist/program-C8-p0mW5.js +253 -0
- package/dist/prompt-select-styled-DH0pVoc0.js +2673 -0
- package/dist/provider-api-key-auth.runtime-CAFeIQ1u.js +121 -0
- package/dist/provider-auth-choice-CB_HzdTl.js +126 -0
- package/dist/provider-auth-choice-helpers-hzDkh3f1.js +48 -0
- package/dist/provider-auth-choice-preference-BHCXvNSE.js +189 -0
- package/dist/provider-auth-choice.runtime-Dx4ms2C5.js +123 -0
- package/dist/provider-auth-choices-0KaDNPBQ.js +57 -0
- package/dist/provider-auth-guidance-BaAUiNr_.js +34 -0
- package/dist/provider-auth-result-Bto1bYtS.d.ts +18 -0
- package/dist/provider-models-DxOmeToO.d.ts +867 -0
- package/dist/provider-models-xnyxy6mO.js +2113 -0
- package/dist/provider-ollama-setup-DBYK__ov.d.ts +32 -0
- package/dist/provider-ollama-setup-QzgCxj44.js +314 -0
- package/dist/provider-onboard-B9ionepI.js +139 -0
- package/dist/provider-onboard-CURxJ_UX.d.ts +40 -0
- package/dist/provider-runtime.runtime-4xwmsl5L.js +111 -0
- package/dist/provider-self-hosted-setup-BHd24EDG.js +182 -0
- package/dist/provider-self-hosted-setup-qeY8BYSy.d.ts +61 -0
- package/dist/provider-stream-Chz_EFw3.js +512 -0
- package/dist/provider-usage-C11Q7UwS.js +111 -0
- package/dist/provider-usage-kxemdMp2.js +633 -0
- package/dist/provider-wizard-CanJoxNC.js +152 -0
- package/dist/push-apns-Dsajnm8C.js +1038 -0
- package/dist/pw-ai-DUe4BbH2.js +1867 -0
- package/dist/qmd-manager-CAAFp7qK.js +1570 -0
- package/dist/qr-cli-Bu2jqTPY.js +113 -0
- package/dist/qr-cli-Bu9Z-X48.js +369 -0
- package/dist/reactions-Cpfum4iU.js +281 -0
- package/dist/read-only-account-inspect.discord.runtime-BK0LaMgC.js +116 -0
- package/dist/read-only-account-inspect.slack.runtime-DgKiC5wT.js +116 -0
- package/dist/read-only-account-inspect.telegram.runtime-mxfgFVOU.js +116 -0
- package/dist/redact-snapshot-DD8A4tdd.js +2663 -0
- package/dist/register.agent-DU4FtrU2.js +439 -0
- package/dist/register.backup-8nOYtJqg.js +625 -0
- package/dist/register.configure-DmtecqIH.js +252 -0
- package/dist/register.maintenance-Dir3ulKP.js +574 -0
- package/dist/register.message-Cfl-f3Ju.js +709 -0
- package/dist/register.onboard-Bv7WVzEi.js +192 -0
- package/dist/register.setup-BIyeI8RY.js +212 -0
- package/dist/register.status-health-sessions-C69WQcF4.js +498 -0
- package/dist/register.subclis-B_4KCgTd.js +315 -0
- package/dist/register.subclis-BeXsmgBL.js +13 -0
- package/dist/replies-DdcFUmki.js +110 -0
- package/dist/resolve-channels-DRZqPV5o.js +226 -0
- package/dist/resolve-channels-DxW1kqxA.js +262 -0
- package/dist/resolve-route-DdX-HBVt.js +538 -0
- package/dist/resolve-users-rgCQvkLs.js +143 -0
- package/dist/root-help-QAkoA7GD.js +32 -0
- package/dist/routes-CcJNnwTF.js +7097 -0
- package/dist/rpc-DDUAlBbH.js +67 -0
- package/dist/run-main-D9ci5pn7.js +424 -0
- package/dist/runtime-Bitmi8Er.d.ts +26 -0
- package/dist/runtime-discord-ops.runtime-T4sf7aRB.js +9078 -0
- package/dist/runtime-slack-ops.runtime-BQpP48mC.js +4556 -0
- package/dist/runtime-telegram-ops.runtime-cVO5dqOp.js +133 -0
- package/dist/runtime-whatsapp-login.runtime-DtNx0dSY.js +114 -0
- package/dist/runtime-whatsapp-outbound.runtime-Bw47QbFK.js +117 -0
- package/dist/sandbox-cli-DsFwjbjC.js +535 -0
- package/dist/search-manager-BRAK8fEe.js +16 -0
- package/dist/search-manager-BS5Db0A6.js +386 -0
- package/dist/secrets-cli-D3J46TJp.js +2070 -0
- package/dist/security-cli-B866M9cB.js +575 -0
- package/dist/send-B1pX9_Oc.js +283 -0
- package/dist/send-B2RrLg83.js +100 -0
- package/dist/send-DFnV__Aq.js +1025 -0
- package/dist/send-DZIH6CJt.js +629 -0
- package/dist/send-sl9WnKbW.js +631 -0
- package/dist/server-node-events-BT6egg20.js +506 -0
- package/dist/server-zI_K-D05.js +107 -0
- package/dist/sessions-C8kiAcoJ.js +112 -0
- package/dist/sessions-DLBpp52_.js +218 -0
- package/dist/setup-C7eOzMiC.js +387 -0
- package/dist/setup-CFIMq-Pz.d.ts +37 -0
- package/dist/setup-binary-CcAv8NXz.js +406 -0
- package/dist/setup-browser-C4eRV3h6.js +70 -0
- package/dist/setup-core-BnR486P-.js +143 -0
- package/dist/setup-core-CIswIiu5.js +166 -0
- package/dist/setup-core-CcbcrXXg.js +47 -0
- package/dist/setup-core-nZSw5BSv.js +205 -0
- package/dist/setup-surface-C5iSpT4M.js +490 -0
- package/dist/setup-wizard-helpers-r0J6l8ST.d.ts +203 -0
- package/dist/setup.finalize-adiRfo0U.js +522 -0
- package/dist/setup.gateway-config-BwFWKDfT.js +343 -0
- package/dist/shared-12TimyeF.js +182 -0
- package/dist/shared-9EWO34-k.js +298 -0
- package/dist/shared-B4vUbaRR.js +75 -0
- package/dist/shared-bNWpW3Dd.js +96 -0
- package/dist/shared-lU1y5dvS.js +102 -0
- package/dist/signal-DBlETRu9.js +114 -0
- package/dist/skills-Bio8GwTE.js +20 -0
- package/dist/skills-DE_MXFSN.js +853 -0
- package/dist/skills-cli-BGuW-tKw.js +292 -0
- package/dist/skills-install--rnorIoJ.js +763 -0
- package/dist/skills-status-B08PtBc_.js +21 -0
- package/dist/skills-status-CzM008aB.js +169 -0
- package/dist/slack-C4T53Nc-.js +114 -0
- package/dist/slash-commands.runtime-B7fsD8Be.js +128 -0
- package/dist/slash-dispatch.runtime-t0PAX4vQ.js +141 -0
- package/dist/slash-skill-commands.runtime-DIhPnEfR.js +116 -0
- package/dist/src-DrDirlvw.js +1701 -0
- package/dist/status-Bld14WSA.js +131 -0
- package/dist/status-CgeO4RuH.js +43 -0
- package/dist/status-HlvixAOq.js +606 -0
- package/dist/status-Rom_Lf3c.js +1599 -0
- package/dist/status-TwbMH6Am.js +126 -0
- package/dist/status-json-DMW7cmuK.js +288 -0
- package/dist/status.link-channel-V4LkB6Gq.js +143 -0
- package/dist/status.scan.deps.runtime-BE3X-dcP.js +126 -0
- package/dist/status.scan.runtime-BxVY4mty.js +119 -0
- package/dist/status.summary-CzLM0vVr.js +592 -0
- package/dist/status.summary.runtime-BSBnHZ1Q.js +118 -0
- package/dist/status.update-BxblMS7P.js +77 -0
- package/dist/subagent-orphan-recovery-BpRPryEj.js +307 -0
- package/dist/subagent-registry-runtime-DYYU5p3X.js +111 -0
- package/dist/subscription-CpFdxuFS.js +33 -0
- package/dist/subscription-DaA1urx-.js +102 -0
- package/dist/subscription-cli-Bvto9EmO.js +134 -0
- package/dist/synology-chat-3nwk-Nj0.js +297 -0
- package/dist/system-cli-BvNps8sl.js +94 -0
- package/dist/telegram/audit.d.ts +1 -1
- package/dist/telegram/audit.js +1 -1
- package/dist/telegram/token.d.ts +1 -1
- package/dist/telegram/token.js +35 -35
- package/dist/telegram-RtKXoEsF.js +114 -0
- package/dist/text-chunking-BD5mQe2R.js +84 -0
- package/dist/text-chunking-DDUU_vAF.d.ts +79 -0
- package/dist/tlon-z-kYmJE-.js +433 -0
- package/dist/tui-cli-CzSK08Rh.js +137 -0
- package/dist/tui-wV7R1Tlc.js +3834 -0
- package/dist/types-2H_e7eWT.d.ts +45 -0
- package/dist/types-ZKnGUchG.d.ts +22692 -0
- package/dist/types.base-BFiQZ4J9.d.ts +188 -0
- package/dist/ui-BWVHreeR.js +31 -0
- package/dist/update-D1Wgh1Tj.js +1036 -0
- package/dist/update-cli-CZh99uyY.js +1503 -0
- package/dist/update-offset-store-D5xTdUr0.js +112 -0
- package/dist/update-runner-GbKfoCHs.js +1496 -0
- package/dist/upsert-with-lock-BZU7Le8n.js +33 -0
- package/dist/usage-Czgwvg0h.js +115 -0
- package/dist/web-CMczmL90.js +112 -0
- package/dist/web-shared-B5Q0mIJq.d.ts +45 -0
- package/dist/webhook-request-guards-CsKDhZJr.d.ts +76 -0
- package/dist/webhook-targets-BSmFtesN.js +181 -0
- package/dist/webhook-targets-CjxuEE9C.d.ts +106 -0
- package/dist/webhooks-cli-Wl9y6AWW.js +350 -0
- package/dist/whatsapp-VzRW8MdR.js +114 -0
- package/dist/whatsapp-actions-Cg1Wxv8W.js +167 -0
- package/dist/workspace-DJ_S272u.js +484 -0
- package/dist/workspace-DbZSqjw0.js +289 -0
- package/dist/workspace-cli-D93DLmAh.js +154 -0
- package/dist/workspace-dirs-CGeIPpGN.js +2003 -0
- package/dist/zalo-CK2dlGmu.d.ts +9 -0
- package/dist/zalo-Db7s2boL.js +415 -0
- package/dist/zalouser-Jh5YTJX3.js +30911 -0
- package/docs/reference/templates/AGENTS.dev.md +83 -0
- package/docs/reference/templates/AGENTS.md +219 -0
- package/docs/reference/templates/BOOT.md +11 -0
- package/docs/reference/templates/BOOTSTRAP.md +62 -0
- package/docs/reference/templates/HEARTBEAT.md +12 -0
- package/docs/reference/templates/IDENTITY.dev.md +47 -0
- package/docs/reference/templates/IDENTITY.md +29 -0
- package/docs/reference/templates/SOUL.dev.md +76 -0
- package/docs/reference/templates/SOUL.md +43 -0
- package/docs/reference/templates/TOOLS.dev.md +24 -0
- package/docs/reference/templates/TOOLS.md +47 -0
- package/docs/reference/templates/USER.dev.md +18 -0
- package/docs/reference/templates/USER.md +23 -0
- package/extensions/discord/src/monitor/allow-list.ts +8 -1
- package/extensions/discord/src/monitor/message-handler.preflight.ts +4 -1
- package/package.json +2 -1
- package/dist/accounts-CDr-lDaV.d.ts +0 -103
- package/dist/accounts-CS8U4v8C.js +0 -114
- package/dist/acp-cli-BGT0jXcC.js +0 -2093
- package/dist/actions.runtime-BfckTw6c.js +0 -119
- package/dist/actions.runtime-Cl9mBfqH.js +0 -133
- package/dist/agent-scope-C-YmLnnb.js +0 -208
- package/dist/agents-CydD54p8.js +0 -222
- package/dist/agents-DpQsZO6O.js +0 -853
- package/dist/agents.config-XU7IsYE-.js +0 -121
- package/dist/agents.config-ssoQXuvF.js +0 -17
- package/dist/allow-list-Cfn6lmMK.js +0 -81
- package/dist/allowlist-CCYXVpM9.js +0 -142
- package/dist/api-BoXoFKxy.js +0 -117
- package/dist/audit-Bv05N5o9.js +0 -787
- package/dist/audit-CIWW1Aqm.js +0 -54
- package/dist/audit-channel.collect.runtime-Bi7yrdcO.js +0 -605
- package/dist/audit-channel.runtime-C_NDweiW.js +0 -121
- package/dist/audit-extra.async-Dp7OKSXg.js +0 -813
- package/dist/audit-membership-runtime-B8FQ6VtN.js +0 -162
- package/dist/audit.deep.runtime-CXhobL6b.js +0 -25
- package/dist/audit.nondeep.runtime-CrEm3T16.js +0 -832
- package/dist/audit.runtime-CJPKj1Zg.js +0 -118
- package/dist/auth-Byfp0flq.js +0 -101
- package/dist/auth-choice-BgOjdeXN.js +0 -507
- package/dist/auth-choice-CD1Heq0M.js +0 -122
- package/dist/auth-choice-ePNfg0iQ.js +0 -268
- package/dist/auth-choice-options-BlewQWI0.js +0 -123
- package/dist/auth-choice-prompt-BP2b6aXz.js +0 -36
- package/dist/auth-choice-prompt-Cmwl4n97.js +0 -115
- package/dist/auth-choice.apply-helpers-Dq-nxuuX.js +0 -66
- package/dist/auth-choice.plugin-providers.runtime-B23kOUzQ.js +0 -119
- package/dist/auth-profiles-1kPLbBwI.js +0 -127823
- package/dist/auth-profiles.runtime-DAfSjku1.js +0 -116
- package/dist/banner-DeOsobLO.js +0 -342
- package/dist/bluebubbles-BsLGedBM.js +0 -64
- package/dist/bluebubbles-CnT9wiS4.d.ts +0 -6
- package/dist/bot-CuzVYwa_.d.ts +0 -478
- package/dist/brave-BoWimrLe.js +0 -24
- package/dist/browser-cli-D_S3wEYE.js +0 -1494
- package/dist/call-ByEzDJ1_.js +0 -640
- package/dist/call-CHCWVg-O.js +0 -39
- package/dist/channel-3VC0oOMu.js +0 -214
- package/dist/channel-B9fCBPiS.js +0 -207
- package/dist/channel-B9q775cM.js +0 -562
- package/dist/channel-BG3UK54j.js +0 -803
- package/dist/channel-BRQAdMML.js +0 -352
- package/dist/channel-BmlLp933.js +0 -1321
- package/dist/channel-By6KvdTG.js +0 -920
- package/dist/channel-C8rRsdf6.js +0 -226
- package/dist/channel-CLEDBbXE.js +0 -943
- package/dist/channel-CMvBAG7o.js +0 -306
- package/dist/channel-CmlxxjHY.js +0 -1598
- package/dist/channel-CqG6_xN0.js +0 -949
- package/dist/channel-DNueHKs92.js +0 -316
- package/dist/channel-DUtyN7BX.js +0 -4681
- package/dist/channel-DWD6GrfZ.js +0 -538
- package/dist/channel-DaRYMYzj.js +0 -619
- package/dist/channel-Dj6BgLp8.js +0 -575
- package/dist/channel-account-context-Ba3u5D21.js +0 -103
- package/dist/channel-crabk6Em.js +0 -542
- package/dist/channel-i8uqQaK2.js +0 -497
- package/dist/channel-options-xljvwHS2.js +0 -50
- package/dist/channel-plugin-ids-DAgknSG4.js +0 -26
- package/dist/channel-summary-dHTMCG75.js +0 -111
- package/dist/channel-xVWQ96Ni.js +0 -397
- package/dist/channel.runtime-B6PoZ4BV.js +0 -182
- package/dist/channel.runtime-BPZmo57e.js +0 -404
- package/dist/channel.runtime-B_1uGR-U.js +0 -199
- package/dist/channel.runtime-BiXnPU0d.js +0 -218
- package/dist/channel.runtime-BpvDc9sv.js +0 -870
- package/dist/channel.runtime-CUua3W80.js +0 -418
- package/dist/channel.runtime-CaCBTd0A.js +0 -179
- package/dist/channel.runtime-D0FfYvUj.js +0 -4011
- package/dist/channel.runtime-DhoJtpvJ.js +0 -241
- package/dist/channel.runtime-Kj9EXNE0.js +0 -127
- package/dist/channel.runtime-r4tPuPyh.js +0 -171
- package/dist/channel.setup-B7d_grfe.js +0 -6
- package/dist/channel.setup-C0vu1fhi.js +0 -9
- package/dist/channel.setup-CAI0FNHj.js +0 -11
- package/dist/channel.setup-CkDVwv5R.js +0 -57
- package/dist/channel.setup-Cpd00YqQ.js +0 -8
- package/dist/channel.setup-DbBz1-WT.js +0 -9
- package/dist/channel.setup-GZnAvD9g.js +0 -8
- package/dist/channels-5H484RSw.js +0 -1118
- package/dist/channels-BnPudfyx.js +0 -404
- package/dist/channels-cli-WIC-QeH_.js +0 -291
- package/dist/channels-status-issues-RDmzovJU.js +0 -16
- package/dist/clawbot-cli-BgutNwf8.js +0 -118
- package/dist/cleanup-utils-DBl1Aij1.js +0 -96
- package/dist/cli-1P7u6zqu.js +0 -154
- package/dist/command-registry-B8jovrws.js +0 -232
- package/dist/command-registry-DtDl1FVm.js +0 -14
- package/dist/command-secret-gateway-BgUo3FxJ.js +0 -111
- package/dist/compact.runtime-CXbXM0AU.js +0 -116
- package/dist/completion-cli-Cik_owAE.js +0 -17
- package/dist/completion-cli-RU3P2RSl.js +0 -445
- package/dist/config-5HUpB1L1.js +0 -31
- package/dist/config-cli-QHaUHoZI.js +0 -433
- package/dist/config-guard-C9Sn3pE-.js +0 -118
- package/dist/config-sW57gztj.js +0 -44
- package/dist/config-validation-5LkjIKNt.js +0 -262
- package/dist/config-value-CtTWALxG.js +0 -132
- package/dist/configure-BmR2TPLf.js +0 -243
- package/dist/configure-DaLN-5xM.js +0 -1100
- package/dist/control-ui-assets-CH3MYmAo.js +0 -232
- package/dist/control-ui-shared-CA77PTml.js +0 -29
- package/dist/core-CvDzLs7B.js +0 -150
- package/dist/core-jm751KJ9.d.ts +0 -87
- package/dist/cron-cli-tguLpzyq.js +0 -639
- package/dist/daemon-cli-ptosOkL8.js +0 -339
- package/dist/daemon-install-DzU4EnVa.js +0 -180
- package/dist/deliver-DwxFoHM3.js +0 -111
- package/dist/deliver-runtime-DOdDyaPI.js +0 -111
- package/dist/device-id-cli-GopvlxxZ.js +0 -52
- package/dist/device-identity-CRfhC3_s.js +0 -365
- package/dist/devices-cli-ain7ESqU.js +0 -342
- package/dist/diagnostic-D96Xaqrj.js +0 -310
- package/dist/directory-cli-fh1UxGgY.js +0 -311
- package/dist/directory-config-helpers-Coivm0Mt.d.ts +0 -38
- package/dist/directory.static-CKjJUNGl.js +0 -44
- package/dist/discord-CflhwDEM.js +0 -114
- package/dist/discovery-x0ZqY4AB.js +0 -48
- package/dist/dm-policy-shared-DKzsSLlO.d.ts +0 -95
- package/dist/dns-cli-DCHyKjGf.js +0 -217
- package/dist/docs-cli-D3OoqYSP.js +0 -174
- package/dist/doctor-completion-Bq2eP87s.js +0 -90
- package/dist/doctor-config-flow-D8XRG9Ku.js +0 -2437
- package/dist/doctor-config-flow-DGiF1HGc.js +0 -112
- package/dist/enable-0QSF4YGH.js +0 -24
- package/dist/exec-approvals-cli-Bncym0Gd.js +0 -421
- package/dist/feishu-C1dM8pl2.d.ts +0 -36
- package/dist/gateway-cli-DYscsmA-.js +0 -26437
- package/dist/gateway-install-token-CNv17ac9.js +0 -163
- package/dist/gateway-rpc-BGC1Rxvg.js +0 -26
- package/dist/gateway-runtime-D89mSQPB.js +0 -69
- package/dist/git-commit-CeLH5Ozm.js +0 -2
- package/dist/git-commit-DUKRiCP-.js +0 -177
- package/dist/googlechat-BgXeXjd1.js +0 -307
- package/dist/googlechat-CNZQb1jd.d.ts +0 -12
- package/dist/group-access-Deh1tVNr.d.ts +0 -61
- package/dist/health-BEjzWwaB.js +0 -570
- package/dist/health-FjqrWQL6.js +0 -113
- package/dist/heartbeat-summary-CfdSA9M1.js +0 -57
- package/dist/help-BZeVprq1.js +0 -81
- package/dist/hooks-06OUQvAV.d.ts +0 -6
- package/dist/hooks-cli-B7uGJs2O.js +0 -1000
- package/dist/hooks-status-CfceaUSg.js +0 -78
- package/dist/http-registry-DYskWhOr.d.ts +0 -20
- package/dist/identity-file-sshkKKIr.js +0 -60
- package/dist/image-generation-D4o3j8o6.d.ts +0 -9
- package/dist/imessage-BcV3WGx_.js +0 -31
- package/dist/imessage-Dhje7Ty-.js +0 -115
- package/dist/inbound-reply-dispatch-C73_7SOl.js +0 -71
- package/dist/inbound-reply-dispatch-D6_HNqH8.d.ts +0 -72
- package/dist/install-target-D7NRhfzc.js +0 -574
- package/dist/installs-Bj6jblqc.js +0 -532
- package/dist/io-CMfWWPXQ.js +0 -9738
- package/dist/io-CV844hAM.js +0 -29
- package/dist/irc-DKi1fDYI.js +0 -672
- package/dist/library-rygTG3oA.js +0 -112
- package/dist/lifecycle-core-BPlvShWY.js +0 -382
- package/dist/line-B8gTtl3Y.d.ts +0 -75
- package/dist/line-CGsemKWJ.js +0 -530
- package/dist/llm-slug-generator-DlhVyMqT.js +0 -67
- package/dist/logging-5wu9k6w4.js +0 -30
- package/dist/logging-CxP9suT8.js +0 -13
- package/dist/login-qr-BcDsiwHs.js +0 -233
- package/dist/login-qr-Y8pJ5yV4.js +0 -112
- package/dist/logs-cli-XI9oVXpH.js +0 -256
- package/dist/manager-runtime-DkIlXBhD.js +0 -111
- package/dist/manager.runtime-Q0q2rJCC.js +0 -715
- package/dist/manifest-registry-DAd0SRAP.js +0 -1329
- package/dist/matrix-BI0DBBrG.js +0 -1495
- package/dist/matrix-D2JoHzb4.d.ts +0 -68
- package/dist/matrix-DiABGjJR.js +0 -1269
- package/dist/mcp-cli-BOyn_DLL.js +0 -87
- package/dist/media-understanding.runtime-DjUa7Dka.js +0 -116
- package/dist/memory-cli-CJd_vl-Y.js +0 -111
- package/dist/memory-search-CEEItIFR.js +0 -17
- package/dist/memory-search-Cv1SBrn7.js +0 -204
- package/dist/method-scopes-CQE7-bZ-.js +0 -2452
- package/dist/model-auth-markers-BFoM4IPf.d.ts +0 -20
- package/dist/model-picker-D6_89XHg.js +0 -112
- package/dist/model-picker-Svaw-APs.js +0 -390
- package/dist/model-picker.runtime-Chi9nV7A.js +0 -125
- package/dist/model-selection-hL8i1Jbs.js +0 -653
- package/dist/model-suppression.runtime-DjWJZ0X-.js +0 -116
- package/dist/models-7qj1dG_W.js +0 -118
- package/dist/models-BPOB_xJF.js +0 -2514
- package/dist/models-cli-DdlOVUjS.js +0 -309
- package/dist/models-config-CBqUS-jX.js +0 -111
- package/dist/models-config.providers.discovery-Dc905FWG.d.ts +0 -18
- package/dist/moldclaw-root-D6PbhbZk.js +0 -88
- package/dist/monitor-BPYhkEqF.js +0 -782
- package/dist/monitor-BuTcQ24j.js +0 -3468
- package/dist/monitor-CuXvNhFh.js +0 -113
- package/dist/monitor-D-TqSIHF.js +0 -6823
- package/dist/monitor-DRSgo9u2.js +0 -3076
- package/dist/monitor-DcHch39z.js +0 -772
- package/dist/monitor-DsHBMrXp.js +0 -115
- package/dist/monitor-shared-CL8T4gt1.js +0 -444
- package/dist/msteams-7FMwTvQG.js +0 -852
- package/dist/node-cli-BCjaSCZM.js +0 -2503
- package/dist/node-resolve-D5Hvcgyx.js +0 -835
- package/dist/nodes-cli-Dd_SNbkt.js +0 -1380
- package/dist/nostr-DBTFTxKs.js +0 -8744
- package/dist/nostr-DLqaIuZx.d.ts +0 -7
- package/dist/npm-resolution-CYfb3MHG.js +0 -60
- package/dist/oauth-env-zPt5RywA.js +0 -10
- package/dist/onboard-BEFQQeig.js +0 -25
- package/dist/onboard-CJHNyxJh.js +0 -48
- package/dist/onboard-D_3UeLEN.js +0 -589
- package/dist/onboard-channels-B_JL0Djc.js +0 -1241
- package/dist/onboard-channels-CqZzHt2C.js +0 -205
- package/dist/onboard-custom-CER3Ggbq.js +0 -571
- package/dist/onboard-custom-bNRdGECb.js +0 -114
- package/dist/onboard-helpers-BK0Hsb7Y.js +0 -335
- package/dist/onboard-helpers-CXZ5RPoR.js +0 -113
- package/dist/onboard-hooks-1NsxEDjH.js +0 -72
- package/dist/onboard-remote-DuKhC_7W.js +0 -117
- package/dist/onboard-remote-OwRcDuB3.js +0 -181
- package/dist/onboard-search-Cy8dOq2W.js +0 -302
- package/dist/onboard-skills-D5phRa6r.js +0 -117
- package/dist/onboard-skills-c9qWCNe9.js +0 -133
- package/dist/outbound-media-CXKqTh2X.d.ts +0 -11
- package/dist/outbound-media-DYRO2vTD.js +0 -11
- package/dist/pairing-access-BwJu1mkk.d.ts +0 -21
- package/dist/pairing-cli-BOnv0TYn.js +0 -217
- package/dist/perplexity-EZwC3y2b.js +0 -24
- package/dist/persistent-dedupe-hNES5tS1.d.ts +0 -26
- package/dist/pi-model-discovery-runtime-BToY3A6K.js +0 -111
- package/dist/pi-tools.before-tool-call.runtime-D_acPtld.js +0 -381
- package/dist/plugin-install-CgJpSjYd.js +0 -184
- package/dist/plugin-install-Cl1A4EF6.js +0 -117
- package/dist/plugin-install-plan-Dc2Z4DeU.js +0 -49
- package/dist/plugin-registry-B1UaWrQD.js +0 -49
- package/dist/plugin-registry-Cy8biwnn.js +0 -113
- package/dist/plugins-CXwvg50F.js +0 -111
- package/dist/plugins-cli-Uvzp2aYV.js +0 -917
- package/dist/policy-DsMBbEe7.js +0 -143
- package/dist/preflight-audio.runtime-hWsZIYvc.js +0 -116
- package/dist/probe-CNsSf1Uf.js +0 -6329
- package/dist/probe-CqOIrPhb.js +0 -47
- package/dist/probe-DH6gDw-h.js +0 -129
- package/dist/probe-DM16PLf4.js +0 -21
- package/dist/probe-DvAEEWYr.js +0 -1793
- package/dist/probe-auth-COfgCble.js +0 -48
- package/dist/probe-auth-I_5TX1Eh.js +0 -40
- package/dist/program-Dz80sgTU.js +0 -253
- package/dist/prompt-select-styled-wQehwFxK.js +0 -2673
- package/dist/provider-api-key-auth.runtime-BR9GU4ya.js +0 -121
- package/dist/provider-auth-choice-CdhA84kr.js +0 -126
- package/dist/provider-auth-choice-helpers-kabp_0zA.js +0 -48
- package/dist/provider-auth-choice-preference-se3zAM_2.js +0 -189
- package/dist/provider-auth-choice.runtime-BMc8-xNQ.js +0 -123
- package/dist/provider-auth-choices-CYsCViGi.js +0 -57
- package/dist/provider-auth-guidance-CMjUWlNf.js +0 -34
- package/dist/provider-auth-result-5xgWoVGi.d.ts +0 -18
- package/dist/provider-models-BCId_Lfu.js +0 -2113
- package/dist/provider-models-D-eFl9oH.d.ts +0 -867
- package/dist/provider-ollama-setup-B6XJZ0So.js +0 -314
- package/dist/provider-ollama-setup-BF1vhob8.d.ts +0 -32
- package/dist/provider-onboard-BjXHP3IZ.d.ts +0 -40
- package/dist/provider-onboard-Ca0TaNud.js +0 -139
- package/dist/provider-runtime.runtime-DwwkHw_7.js +0 -111
- package/dist/provider-self-hosted-setup-BEKLVGpj.js +0 -182
- package/dist/provider-self-hosted-setup-BQ5BIlpi.d.ts +0 -61
- package/dist/provider-stream-DrUD69ai.js +0 -512
- package/dist/provider-usage-BgKHCnjr.js +0 -111
- package/dist/provider-usage-D8EZpFz9.js +0 -633
- package/dist/provider-wizard-DMdb-zj_.js +0 -152
- package/dist/push-apns-BPH6d4VV.js +0 -1038
- package/dist/pw-ai-DttfldtL.js +0 -1867
- package/dist/qmd-manager-CybcDUfk.js +0 -1570
- package/dist/qr-cli-8NcmJ8Ft.js +0 -369
- package/dist/qr-cli-DWe0Our3.js +0 -113
- package/dist/reactions-D6N0LR16.js +0 -281
- package/dist/read-only-account-inspect.discord.runtime-CqUWTRfl.js +0 -116
- package/dist/read-only-account-inspect.slack.runtime-9-jpln3q.js +0 -116
- package/dist/read-only-account-inspect.telegram.runtime-EKPI1D7n.js +0 -116
- package/dist/redact-snapshot-DwJEIVk9.js +0 -2663
- package/dist/register.agent-D3YdDirP.js +0 -439
- package/dist/register.backup-dR27qCuo.js +0 -625
- package/dist/register.configure-BjFhkkka.js +0 -252
- package/dist/register.maintenance-DiMQJIOa.js +0 -574
- package/dist/register.message-CdZsKYH1.js +0 -709
- package/dist/register.onboard-B0rV1eaO.js +0 -192
- package/dist/register.setup-wKMvohzo.js +0 -212
- package/dist/register.status-health-sessions-BJ68m6pt.js +0 -498
- package/dist/register.subclis-CnnrWt2a.js +0 -315
- package/dist/register.subclis-lSvTkC6z.js +0 -13
- package/dist/replies-BABt9b48.js +0 -110
- package/dist/resolve-channels-BqZFl2Ux.js +0 -262
- package/dist/resolve-channels-DjQLXb7B.js +0 -226
- package/dist/resolve-route-CSHDsa_m.js +0 -538
- package/dist/resolve-users-BG6HaSR5.js +0 -143
- package/dist/root-help-ohmaCyC_.js +0 -32
- package/dist/routes-4k2kpvoT.js +0 -7097
- package/dist/rpc-Cnwn4Q6L.js +0 -67
- package/dist/run-main-VYlacKA0.js +0 -424
- package/dist/runtime-Cy8pqYUB.d.ts +0 -26
- package/dist/runtime-discord-ops.runtime-DafrU-rI.js +0 -9078
- package/dist/runtime-slack-ops.runtime-CdXBKXwd.js +0 -4556
- package/dist/runtime-telegram-ops.runtime-B12sF7gE.js +0 -133
- package/dist/runtime-whatsapp-login.runtime-CqEudH37.js +0 -114
- package/dist/runtime-whatsapp-outbound.runtime-D5m2qyn-.js +0 -117
- package/dist/sandbox-cli-CHJiEWXB.js +0 -535
- package/dist/search-manager-BtNC3-i_.js +0 -16
- package/dist/search-manager-C7J7B3_a.js +0 -386
- package/dist/secrets-cli-C6yIWBbN.js +0 -2070
- package/dist/security-cli-BVu9BkjD.js +0 -575
- package/dist/send-BSreC7rr.js +0 -631
- package/dist/send-BsLHQG_B.js +0 -1025
- package/dist/send-BuNhp8PH.js +0 -283
- package/dist/send-DOCswVar.js +0 -100
- package/dist/send-Dl0LLErk.js +0 -629
- package/dist/server-node-events-Bq2067EG.js +0 -506
- package/dist/server-y38L7N5H.js +0 -107
- package/dist/sessions-BV8gXURR.js +0 -112
- package/dist/sessions-dl1Kc-Ci.js +0 -218
- package/dist/setup-DGszQH0_.js +0 -387
- package/dist/setup-DR5rRw9y.d.ts +0 -37
- package/dist/setup-binary-C17YnmA8.js +0 -406
- package/dist/setup-browser-CPx-nEsr.js +0 -70
- package/dist/setup-core-BByHN1ME.js +0 -143
- package/dist/setup-core-C0KPlBmL.js +0 -47
- package/dist/setup-core-Cq37G6of.js +0 -166
- package/dist/setup-core-uO84_Y75.js +0 -205
- package/dist/setup-surface-BEMi7Rmb.js +0 -490
- package/dist/setup-wizard-helpers-BtuGx_gN.d.ts +0 -203
- package/dist/setup.finalize-BzPBa8zW.js +0 -522
- package/dist/setup.gateway-config-DdwkF-8e.js +0 -343
- package/dist/shared-BCw4SKjB.js +0 -96
- package/dist/shared-CjNzsULP.js +0 -75
- package/dist/shared-Cu1BE7ZE.js +0 -298
- package/dist/shared-DSClmyUn.js +0 -182
- package/dist/shared-DyJdGH6y.js +0 -102
- package/dist/signal-Dyv4NZsB.js +0 -114
- package/dist/skills-CbB5b27M.js +0 -853
- package/dist/skills-CnfI7Szw.js +0 -20
- package/dist/skills-cli-CavB1f_3.js +0 -292
- package/dist/skills-install-B1OBdgd0.js +0 -763
- package/dist/skills-status-B3gAmIbW.js +0 -169
- package/dist/skills-status-DrHhFgU9.js +0 -21
- package/dist/slack-BRzqnoAz.js +0 -114
- package/dist/slash-commands.runtime-BK88kgds.js +0 -128
- package/dist/slash-dispatch.runtime-COGywwJE.js +0 -141
- package/dist/slash-skill-commands.runtime-Ti4brxgh.js +0 -116
- package/dist/src-DUR6OQxI.js +0 -1701
- package/dist/status-C6dgQY9a.js +0 -131
- package/dist/status-CNK0Q7QH.js +0 -606
- package/dist/status-DBcX0DSC.js +0 -43
- package/dist/status-DKgFgbwv.js +0 -1599
- package/dist/status-Wn5lhNAc.js +0 -126
- package/dist/status-json-D2EkWqAl.js +0 -288
- package/dist/status.link-channel-D3ULIdEa.js +0 -143
- package/dist/status.scan.deps.runtime-BsjWTAm4.js +0 -126
- package/dist/status.scan.runtime-D4HbzROD.js +0 -119
- package/dist/status.summary-C3YxPrDK.js +0 -592
- package/dist/status.summary.runtime-DAkXPSaK.js +0 -118
- package/dist/status.update-B4NnN9P1.js +0 -77
- package/dist/subagent-orphan-recovery-QiQEBv36.js +0 -307
- package/dist/subagent-registry-runtime-BJatPQFK.js +0 -111
- package/dist/subscription-BhZORXN9.js +0 -100
- package/dist/subscription-QEUjQRMv.js +0 -33
- package/dist/subscription-cli-HrULlAgc.js +0 -134
- package/dist/synology-chat-DB76GWMN.js +0 -297
- package/dist/system-cli-D8jDwWuL.js +0 -94
- package/dist/telegram-BHiiqKkQ.js +0 -114
- package/dist/text-chunking-Baonm9Lu.js +0 -84
- package/dist/text-chunking-Y3dPBOuZ.d.ts +0 -79
- package/dist/tlon-DLESxNgD.js +0 -433
- package/dist/tui-C75zi2Cl.js +0 -3834
- package/dist/tui-cli-DFwx5e6i.js +0 -137
- package/dist/types-BBJ3Qz7j.d.ts +0 -45
- package/dist/types-Ckufs_BY.d.ts +0 -22692
- package/dist/types.base-Cw0-zIvE.d.ts +0 -188
- package/dist/ui-B55NOIB6.js +0 -31
- package/dist/update--ojavYQ4.js +0 -1036
- package/dist/update-cli-Cvj5aWYM.js +0 -1503
- package/dist/update-offset-store-upatuWwX.js +0 -112
- package/dist/update-runner-DHkY_-76.js +0 -1496
- package/dist/upsert-with-lock-C171GLaR.js +0 -33
- package/dist/usage-N3bxnbmt.js +0 -115
- package/dist/web-RdvT7gKa.js +0 -112
- package/dist/web-shared-HSGD3yGt.d.ts +0 -45
- package/dist/webhook-request-guards-CosLyl01.d.ts +0 -76
- package/dist/webhook-targets-Bfnag-du.js +0 -181
- package/dist/webhook-targets-Di17rt8e.d.ts +0 -106
- package/dist/webhooks-cli-ZpnXrq7G.js +0 -350
- package/dist/whatsapp-DNTAyZHt.js +0 -114
- package/dist/whatsapp-actions-o1zKQzKZ.js +0 -167
- package/dist/workspace-CpWi5wPr.js +0 -479
- package/dist/workspace-Ii7aRS7c.js +0 -289
- package/dist/workspace-dirs-x10McA9t.js +0 -2003
- package/dist/zalo-BN3VCrRY.d.ts +0 -9
- package/dist/zalo-zm_bYCKg.js +0 -415
- package/dist/zalouser-CvVEUvc5.js +0 -30911
- /package/dist/{account-id-B3YSn4hl.d.ts → account-id-B8ce6G_4.d.ts} +0 -0
- /package/dist/{acpx-CnNv70m2.d.ts → acpx-Ci50I9T2.d.ts} +0 -0
- /package/dist/{agent-media-payload-DE2pEcsz.d.ts → agent-media-payload-en-gS5p6.d.ts} +0 -0
- /package/dist/{allow-from-DPpHnT2A.d.ts → allow-from-cMeQ47Ot.d.ts} +0 -0
- /package/dist/{allowlist-resolution-CLFiZ6nE.d.ts → allowlist-resolution-DoAWbfXV.d.ts} +0 -0
- /package/dist/{bluebubbles-Duhu-Jer.d.ts → bluebubbles-C6yYmUl0.d.ts} +0 -0
- /package/dist/{boolean-param-BhFjB3gp.d.ts → boolean-param-CdO2TFTk.d.ts} +0 -0
- /package/dist/{channel-config-schema-DnnVMdjR.d.ts → channel-config-schema-Chp38wel.d.ts} +0 -0
- /package/dist/{channel-policy-Baq-Z06b.d.ts → channel-policy-g2h6AbYQ.d.ts} +0 -0
- /package/dist/{chat-type-DpiBgwuG.d.ts → chat-type-BLt59pPT.d.ts} +0 -0
- /package/dist/{command-format-vi4xq8e8.d.ts → command-format-BDJC05Jp.d.ts} +0 -0
- /package/dist/{diffs-DK7fVSDo.d.ts → diffs-D_iNKCyn.d.ts} +0 -0
- /package/dist/{directory-runtime-BTLPaysA.d.ts → directory-runtime-DhMex6HY.d.ts} +0 -0
- /package/dist/{exec-C01wtBHu.d.ts → exec-pjfUY4KM.d.ts} +0 -0
- /package/dist/{gaxios-fetch-compat-wZ38b3w3.js → gaxios-fetch-compat-B_vtINdV.js} +0 -0
- /package/dist/{history-CwXuP2TW.d.ts → history-aqSS5VGQ.d.ts} +0 -0
- /package/dist/{inbound-envelope-SggrBs9m.d.ts → inbound-envelope-C5hWuZod.d.ts} +0 -0
- /package/dist/{index-apAZHsDo.d.ts → index-DXVQFYGX.d.ts} +0 -0
- /package/dist/{json-store-r75IZGk9.d.ts → json-store-UnqQ5aV3.d.ts} +0 -0
- /package/dist/{keyed-async-queue-DHIr7yNe.d.ts → keyed-async-queue-guucpLw3.d.ts} +0 -0
- /package/dist/{links-HeQ3r_L0.d.ts → links-Bar0meEK.d.ts} +0 -0
- /package/dist/{markdown-to-line-CDb4Jy3V.d.ts → markdown-to-line-D8uH_KOj.d.ts} +0 -0
- /package/dist/{mattermost-DtCsxpgg.d.ts → mattermost-xl7jAFJL.d.ts} +0 -0
- /package/dist/{net-BATPDwdQ.d.ts → net-rGOKGds6.d.ts} +0 -0
- /package/dist/{nextcloud-talk-Bb2wHOwp.d.ts → nextcloud-talk-De2CZ9dV.d.ts} +0 -0
- /package/dist/{oauth-utils-u567CLT0.d.ts → oauth-utils-DzN1AlEH.d.ts} +0 -0
- /package/dist/{parse-finite-number-l3tNlrZh.d.ts → parse-finite-number-odgyqhi0.d.ts} +0 -0
- /package/dist/{provider-usage.types-C6061OVN.d.ts → provider-usage.types-EDE9o-H_.d.ts} +0 -0
- /package/dist/{reply-history-BDsFnZFl.d.ts → reply-history-CVuU31xe.d.ts} +0 -0
- /package/dist/{reply-payload-CCvM4W9u.d.ts → reply-payload-CHkpBYwL.d.ts} +0 -0
- /package/dist/{request-url-C54l4-xC.d.ts → request-url-DHisbiHY.d.ts} +0 -0
- /package/dist/{run-command-D3RqWcHu.d.ts → run-command-y0Cndsb1.d.ts} +0 -0
- /package/dist/{secret-input-schema-BLBt-NAP.d.ts → secret-input-schema-b1vpYDQN.d.ts} +0 -0
- /package/dist/{session-key-BQ2-bR-9.d.ts → session-key-DTHQl57f.d.ts} +0 -0
- /package/dist/{ssh-config-C4mcH9Ly.js → ssh-config-hEHBfU2_.js} +0 -0
- /package/dist/{testing-DLkhGsoz.d.ts → testing-DszuZXgK.d.ts} +0 -0
- /package/dist/{thinking-DRkjX18p.d.ts → thinking-IwXTGSeT.d.ts} +0 -0
- /package/dist/{tool-send-CMMD1uDu.d.ts → tool-send-DWHRmKpz.d.ts} +0 -0
- /package/dist/{vllm-defaults-CcGuf4hL.d.ts → vllm-defaults-CrxZgE6-.d.ts} +0 -0
- /package/dist/{wait-Daog8bxM.d.ts → wait-wDWw_MTI.d.ts} +0 -0
- /package/dist/{webhook-memory-guards-C5MrExwT.d.ts → webhook-memory-guards-DreORuJy.d.ts} +0 -0
- /package/dist/{windows-spawn-j2l-dqu8.d.ts → windows-spawn-BIzH92x2.d.ts} +0 -0
- /package/dist/{zod-schema.agent-runtime-krMrBnIn.d.ts → zod-schema.agent-runtime-CP2rmis3.d.ts} +0 -0
- /package/dist/{zod-schema.core-BNDieZDZ.d.ts → zod-schema.core-Foi1tYwi.d.ts} +0 -0
|
@@ -1,2452 +0,0 @@
|
|
|
1
|
-
import { _ as resolveStateDir } from "./paths-D6AgsMTU.js";
|
|
2
|
-
import { n as logError, t as logDebug } from "./logger-BGzLUitz.js";
|
|
3
|
-
import { n as VERSION } from "./version-T8nMYUnU.js";
|
|
4
|
-
import { n as ENV_SECRET_REF_ID_RE } from "./types.secrets-Ca-9L8vU.js";
|
|
5
|
-
import { n as FILE_SECRET_REF_ID_PATTERN, r as SECRET_PROVIDER_ALIAS_PATTERN, t as EXEC_SECRET_REF_ID_JSON_SCHEMA_PATTERN } from "./ref-contract-4C9nIZsw.js";
|
|
6
|
-
import { i as isSecureWebSocketUrl, r as isLoopbackHost } from "./net-K181nxTH.js";
|
|
7
|
-
import { t as rawDataToString } from "./ws-Bd4lOIoI.js";
|
|
8
|
-
import { _ as GATEWAY_CLIENT_MODES, g as GATEWAY_CLIENT_IDS, v as GATEWAY_CLIENT_NAMES } from "./message-channel-DFE4FuE_.js";
|
|
9
|
-
import { a as signDevicePayload, i as publicKeyRawBase64UrlFromPem, n as loadOrCreateDeviceIdentity } from "./device-identity-CRfhC3_s.js";
|
|
10
|
-
import { n as normalizeDeviceAuthScopes, t as normalizeDeviceAuthRole } from "./device-auth-Cr1eugTx.js";
|
|
11
|
-
import { t as normalizeDeviceMetadataForAuth } from "./device-metadata-normalization-BZ3hZcWh.js";
|
|
12
|
-
import fs from "node:fs";
|
|
13
|
-
import path from "node:path";
|
|
14
|
-
import { randomUUID } from "node:crypto";
|
|
15
|
-
import { WebSocket } from "ws";
|
|
16
|
-
import { Type } from "@sinclair/typebox";
|
|
17
|
-
import Ajv from "ajv";
|
|
18
|
-
//#region src/sessions/input-provenance.ts
|
|
19
|
-
const INPUT_PROVENANCE_KIND_VALUES = [
|
|
20
|
-
"external_user",
|
|
21
|
-
"inter_session",
|
|
22
|
-
"internal_system"
|
|
23
|
-
];
|
|
24
|
-
function normalizeOptionalString(value) {
|
|
25
|
-
if (typeof value !== "string") return;
|
|
26
|
-
const trimmed = value.trim();
|
|
27
|
-
return trimmed ? trimmed : void 0;
|
|
28
|
-
}
|
|
29
|
-
function isInputProvenanceKind(value) {
|
|
30
|
-
return typeof value === "string" && INPUT_PROVENANCE_KIND_VALUES.includes(value);
|
|
31
|
-
}
|
|
32
|
-
function normalizeInputProvenance(value) {
|
|
33
|
-
if (!value || typeof value !== "object") return;
|
|
34
|
-
const record = value;
|
|
35
|
-
if (!isInputProvenanceKind(record.kind)) return;
|
|
36
|
-
return {
|
|
37
|
-
kind: record.kind,
|
|
38
|
-
originSessionId: normalizeOptionalString(record.originSessionId),
|
|
39
|
-
sourceSessionKey: normalizeOptionalString(record.sourceSessionKey),
|
|
40
|
-
sourceChannel: normalizeOptionalString(record.sourceChannel),
|
|
41
|
-
sourceTool: normalizeOptionalString(record.sourceTool)
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
function applyInputProvenanceToUserMessage(message, inputProvenance) {
|
|
45
|
-
if (!inputProvenance) return message;
|
|
46
|
-
if (message.role !== "user") return message;
|
|
47
|
-
if (normalizeInputProvenance(message.provenance)) return message;
|
|
48
|
-
return {
|
|
49
|
-
...message,
|
|
50
|
-
provenance: inputProvenance
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
function isInterSessionInputProvenance(value) {
|
|
54
|
-
return normalizeInputProvenance(value)?.kind === "inter_session";
|
|
55
|
-
}
|
|
56
|
-
function hasInterSessionUserProvenance(message) {
|
|
57
|
-
if (!message || message.role !== "user") return false;
|
|
58
|
-
return isInterSessionInputProvenance(message.provenance);
|
|
59
|
-
}
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region src/infra/tls/fingerprint.ts
|
|
62
|
-
function normalizeFingerprint(input) {
|
|
63
|
-
return input.trim().replace(/^sha-?256\s*:?\s*/i, "").replace(/[^a-fA-F0-9]/g, "").toLowerCase();
|
|
64
|
-
}
|
|
65
|
-
//#endregion
|
|
66
|
-
//#region src/shared/device-auth-store.ts
|
|
67
|
-
function loadDeviceAuthTokenFromStore(params) {
|
|
68
|
-
const store = params.adapter.readStore();
|
|
69
|
-
if (!store || store.deviceId !== params.deviceId) return null;
|
|
70
|
-
const role = normalizeDeviceAuthRole(params.role);
|
|
71
|
-
const entry = store.tokens[role];
|
|
72
|
-
if (!entry || typeof entry.token !== "string") return null;
|
|
73
|
-
return entry;
|
|
74
|
-
}
|
|
75
|
-
function storeDeviceAuthTokenInStore(params) {
|
|
76
|
-
const role = normalizeDeviceAuthRole(params.role);
|
|
77
|
-
const existing = params.adapter.readStore();
|
|
78
|
-
const next = {
|
|
79
|
-
version: 1,
|
|
80
|
-
deviceId: params.deviceId,
|
|
81
|
-
tokens: existing && existing.deviceId === params.deviceId && existing.tokens ? { ...existing.tokens } : {}
|
|
82
|
-
};
|
|
83
|
-
const entry = {
|
|
84
|
-
token: params.token,
|
|
85
|
-
role,
|
|
86
|
-
scopes: normalizeDeviceAuthScopes(params.scopes),
|
|
87
|
-
updatedAtMs: Date.now()
|
|
88
|
-
};
|
|
89
|
-
next.tokens[role] = entry;
|
|
90
|
-
params.adapter.writeStore(next);
|
|
91
|
-
return entry;
|
|
92
|
-
}
|
|
93
|
-
function clearDeviceAuthTokenFromStore(params) {
|
|
94
|
-
const store = params.adapter.readStore();
|
|
95
|
-
if (!store || store.deviceId !== params.deviceId) return;
|
|
96
|
-
const role = normalizeDeviceAuthRole(params.role);
|
|
97
|
-
if (!store.tokens[role]) return;
|
|
98
|
-
const next = {
|
|
99
|
-
version: 1,
|
|
100
|
-
deviceId: store.deviceId,
|
|
101
|
-
tokens: { ...store.tokens }
|
|
102
|
-
};
|
|
103
|
-
delete next.tokens[role];
|
|
104
|
-
params.adapter.writeStore(next);
|
|
105
|
-
}
|
|
106
|
-
//#endregion
|
|
107
|
-
//#region src/infra/device-auth-store.ts
|
|
108
|
-
const DEVICE_AUTH_FILE = "device-auth.json";
|
|
109
|
-
function resolveDeviceAuthPath(env = process.env) {
|
|
110
|
-
return path.join(resolveStateDir(env), "identity", DEVICE_AUTH_FILE);
|
|
111
|
-
}
|
|
112
|
-
function readStore(filePath) {
|
|
113
|
-
try {
|
|
114
|
-
if (!fs.existsSync(filePath)) return null;
|
|
115
|
-
const raw = fs.readFileSync(filePath, "utf8");
|
|
116
|
-
const parsed = JSON.parse(raw);
|
|
117
|
-
if (parsed?.version !== 1 || typeof parsed.deviceId !== "string") return null;
|
|
118
|
-
if (!parsed.tokens || typeof parsed.tokens !== "object") return null;
|
|
119
|
-
return parsed;
|
|
120
|
-
} catch {
|
|
121
|
-
return null;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
function writeStore(filePath, store) {
|
|
125
|
-
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
126
|
-
fs.writeFileSync(filePath, `${JSON.stringify(store, null, 2)}\n`, { mode: 384 });
|
|
127
|
-
try {
|
|
128
|
-
fs.chmodSync(filePath, 384);
|
|
129
|
-
} catch {}
|
|
130
|
-
}
|
|
131
|
-
function loadDeviceAuthToken(params) {
|
|
132
|
-
const filePath = resolveDeviceAuthPath(params.env);
|
|
133
|
-
return loadDeviceAuthTokenFromStore({
|
|
134
|
-
adapter: {
|
|
135
|
-
readStore: () => readStore(filePath),
|
|
136
|
-
writeStore: (_store) => {}
|
|
137
|
-
},
|
|
138
|
-
deviceId: params.deviceId,
|
|
139
|
-
role: params.role
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
function storeDeviceAuthToken(params) {
|
|
143
|
-
const filePath = resolveDeviceAuthPath(params.env);
|
|
144
|
-
return storeDeviceAuthTokenInStore({
|
|
145
|
-
adapter: {
|
|
146
|
-
readStore: () => readStore(filePath),
|
|
147
|
-
writeStore: (store) => writeStore(filePath, store)
|
|
148
|
-
},
|
|
149
|
-
deviceId: params.deviceId,
|
|
150
|
-
role: params.role,
|
|
151
|
-
token: params.token,
|
|
152
|
-
scopes: params.scopes
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
function clearDeviceAuthToken(params) {
|
|
156
|
-
const filePath = resolveDeviceAuthPath(params.env);
|
|
157
|
-
clearDeviceAuthTokenFromStore({
|
|
158
|
-
adapter: {
|
|
159
|
-
readStore: () => readStore(filePath),
|
|
160
|
-
writeStore: (store) => writeStore(filePath, store)
|
|
161
|
-
},
|
|
162
|
-
deviceId: params.deviceId,
|
|
163
|
-
role: params.role
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
//#endregion
|
|
167
|
-
//#region src/gateway/device-auth.ts
|
|
168
|
-
function buildDeviceAuthPayload(params) {
|
|
169
|
-
const scopes = params.scopes.join(",");
|
|
170
|
-
const token = params.token ?? "";
|
|
171
|
-
return [
|
|
172
|
-
"v2",
|
|
173
|
-
params.deviceId,
|
|
174
|
-
params.clientId,
|
|
175
|
-
params.clientMode,
|
|
176
|
-
params.role,
|
|
177
|
-
scopes,
|
|
178
|
-
String(params.signedAtMs),
|
|
179
|
-
token,
|
|
180
|
-
params.nonce
|
|
181
|
-
].join("|");
|
|
182
|
-
}
|
|
183
|
-
function buildDeviceAuthPayloadV3(params) {
|
|
184
|
-
const scopes = params.scopes.join(",");
|
|
185
|
-
const token = params.token ?? "";
|
|
186
|
-
const platform = normalizeDeviceMetadataForAuth(params.platform);
|
|
187
|
-
const deviceFamily = normalizeDeviceMetadataForAuth(params.deviceFamily);
|
|
188
|
-
return [
|
|
189
|
-
"v3",
|
|
190
|
-
params.deviceId,
|
|
191
|
-
params.clientId,
|
|
192
|
-
params.clientMode,
|
|
193
|
-
params.role,
|
|
194
|
-
scopes,
|
|
195
|
-
String(params.signedAtMs),
|
|
196
|
-
token,
|
|
197
|
-
params.nonce,
|
|
198
|
-
platform,
|
|
199
|
-
deviceFamily
|
|
200
|
-
].join("|");
|
|
201
|
-
}
|
|
202
|
-
//#endregion
|
|
203
|
-
//#region src/gateway/protocol/connect-error-details.ts
|
|
204
|
-
const ConnectErrorDetailCodes = {
|
|
205
|
-
AUTH_REQUIRED: "AUTH_REQUIRED",
|
|
206
|
-
AUTH_UNAUTHORIZED: "AUTH_UNAUTHORIZED",
|
|
207
|
-
AUTH_TOKEN_MISSING: "AUTH_TOKEN_MISSING",
|
|
208
|
-
AUTH_TOKEN_MISMATCH: "AUTH_TOKEN_MISMATCH",
|
|
209
|
-
AUTH_TOKEN_NOT_CONFIGURED: "AUTH_TOKEN_NOT_CONFIGURED",
|
|
210
|
-
AUTH_PASSWORD_MISSING: "AUTH_PASSWORD_MISSING",
|
|
211
|
-
AUTH_PASSWORD_MISMATCH: "AUTH_PASSWORD_MISMATCH",
|
|
212
|
-
AUTH_PASSWORD_NOT_CONFIGURED: "AUTH_PASSWORD_NOT_CONFIGURED",
|
|
213
|
-
AUTH_BOOTSTRAP_TOKEN_INVALID: "AUTH_BOOTSTRAP_TOKEN_INVALID",
|
|
214
|
-
AUTH_DEVICE_TOKEN_MISMATCH: "AUTH_DEVICE_TOKEN_MISMATCH",
|
|
215
|
-
AUTH_RATE_LIMITED: "AUTH_RATE_LIMITED",
|
|
216
|
-
AUTH_TAILSCALE_IDENTITY_MISSING: "AUTH_TAILSCALE_IDENTITY_MISSING",
|
|
217
|
-
AUTH_TAILSCALE_PROXY_MISSING: "AUTH_TAILSCALE_PROXY_MISSING",
|
|
218
|
-
AUTH_TAILSCALE_WHOIS_FAILED: "AUTH_TAILSCALE_WHOIS_FAILED",
|
|
219
|
-
AUTH_TAILSCALE_IDENTITY_MISMATCH: "AUTH_TAILSCALE_IDENTITY_MISMATCH",
|
|
220
|
-
CONTROL_UI_ORIGIN_NOT_ALLOWED: "CONTROL_UI_ORIGIN_NOT_ALLOWED",
|
|
221
|
-
CONTROL_UI_DEVICE_IDENTITY_REQUIRED: "CONTROL_UI_DEVICE_IDENTITY_REQUIRED",
|
|
222
|
-
DEVICE_IDENTITY_REQUIRED: "DEVICE_IDENTITY_REQUIRED",
|
|
223
|
-
DEVICE_AUTH_INVALID: "DEVICE_AUTH_INVALID",
|
|
224
|
-
DEVICE_AUTH_DEVICE_ID_MISMATCH: "DEVICE_AUTH_DEVICE_ID_MISMATCH",
|
|
225
|
-
DEVICE_AUTH_SIGNATURE_EXPIRED: "DEVICE_AUTH_SIGNATURE_EXPIRED",
|
|
226
|
-
DEVICE_AUTH_NONCE_REQUIRED: "DEVICE_AUTH_NONCE_REQUIRED",
|
|
227
|
-
DEVICE_AUTH_NONCE_MISMATCH: "DEVICE_AUTH_NONCE_MISMATCH",
|
|
228
|
-
DEVICE_AUTH_SIGNATURE_INVALID: "DEVICE_AUTH_SIGNATURE_INVALID",
|
|
229
|
-
DEVICE_AUTH_PUBLIC_KEY_INVALID: "DEVICE_AUTH_PUBLIC_KEY_INVALID",
|
|
230
|
-
PAIRING_REQUIRED: "PAIRING_REQUIRED"
|
|
231
|
-
};
|
|
232
|
-
const CONNECT_RECOVERY_NEXT_STEP_VALUES = new Set([
|
|
233
|
-
"retry_with_device_token",
|
|
234
|
-
"update_auth_configuration",
|
|
235
|
-
"update_auth_credentials",
|
|
236
|
-
"wait_then_retry",
|
|
237
|
-
"review_auth_configuration"
|
|
238
|
-
]);
|
|
239
|
-
function resolveAuthConnectErrorDetailCode(reason) {
|
|
240
|
-
switch (reason) {
|
|
241
|
-
case "token_missing": return ConnectErrorDetailCodes.AUTH_TOKEN_MISSING;
|
|
242
|
-
case "token_mismatch": return ConnectErrorDetailCodes.AUTH_TOKEN_MISMATCH;
|
|
243
|
-
case "token_missing_config": return ConnectErrorDetailCodes.AUTH_TOKEN_NOT_CONFIGURED;
|
|
244
|
-
case "password_missing": return ConnectErrorDetailCodes.AUTH_PASSWORD_MISSING;
|
|
245
|
-
case "password_mismatch": return ConnectErrorDetailCodes.AUTH_PASSWORD_MISMATCH;
|
|
246
|
-
case "password_missing_config": return ConnectErrorDetailCodes.AUTH_PASSWORD_NOT_CONFIGURED;
|
|
247
|
-
case "bootstrap_token_invalid": return ConnectErrorDetailCodes.AUTH_BOOTSTRAP_TOKEN_INVALID;
|
|
248
|
-
case "tailscale_user_missing": return ConnectErrorDetailCodes.AUTH_TAILSCALE_IDENTITY_MISSING;
|
|
249
|
-
case "tailscale_proxy_missing": return ConnectErrorDetailCodes.AUTH_TAILSCALE_PROXY_MISSING;
|
|
250
|
-
case "tailscale_whois_failed": return ConnectErrorDetailCodes.AUTH_TAILSCALE_WHOIS_FAILED;
|
|
251
|
-
case "tailscale_user_mismatch": return ConnectErrorDetailCodes.AUTH_TAILSCALE_IDENTITY_MISMATCH;
|
|
252
|
-
case "rate_limited": return ConnectErrorDetailCodes.AUTH_RATE_LIMITED;
|
|
253
|
-
case "device_token_mismatch": return ConnectErrorDetailCodes.AUTH_DEVICE_TOKEN_MISMATCH;
|
|
254
|
-
case void 0: return ConnectErrorDetailCodes.AUTH_REQUIRED;
|
|
255
|
-
default: return ConnectErrorDetailCodes.AUTH_UNAUTHORIZED;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
function resolveDeviceAuthConnectErrorDetailCode(reason) {
|
|
259
|
-
switch (reason) {
|
|
260
|
-
case "device-id-mismatch": return ConnectErrorDetailCodes.DEVICE_AUTH_DEVICE_ID_MISMATCH;
|
|
261
|
-
case "device-signature-stale": return ConnectErrorDetailCodes.DEVICE_AUTH_SIGNATURE_EXPIRED;
|
|
262
|
-
case "device-nonce-missing": return ConnectErrorDetailCodes.DEVICE_AUTH_NONCE_REQUIRED;
|
|
263
|
-
case "device-nonce-mismatch": return ConnectErrorDetailCodes.DEVICE_AUTH_NONCE_MISMATCH;
|
|
264
|
-
case "device-signature": return ConnectErrorDetailCodes.DEVICE_AUTH_SIGNATURE_INVALID;
|
|
265
|
-
case "device-public-key": return ConnectErrorDetailCodes.DEVICE_AUTH_PUBLIC_KEY_INVALID;
|
|
266
|
-
default: return ConnectErrorDetailCodes.DEVICE_AUTH_INVALID;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
function readConnectErrorDetailCode(details) {
|
|
270
|
-
if (!details || typeof details !== "object" || Array.isArray(details)) return null;
|
|
271
|
-
const code = details.code;
|
|
272
|
-
return typeof code === "string" && code.trim().length > 0 ? code : null;
|
|
273
|
-
}
|
|
274
|
-
function readConnectErrorRecoveryAdvice(details) {
|
|
275
|
-
if (!details || typeof details !== "object" || Array.isArray(details)) return {};
|
|
276
|
-
const raw = details;
|
|
277
|
-
const canRetryWithDeviceToken = typeof raw.canRetryWithDeviceToken === "boolean" ? raw.canRetryWithDeviceToken : void 0;
|
|
278
|
-
const normalizedNextStep = typeof raw.recommendedNextStep === "string" ? raw.recommendedNextStep.trim() : "";
|
|
279
|
-
return {
|
|
280
|
-
canRetryWithDeviceToken,
|
|
281
|
-
recommendedNextStep: CONNECT_RECOVERY_NEXT_STEP_VALUES.has(normalizedNextStep) ? normalizedNextStep : void 0
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
function parseSessionLabel(raw) {
|
|
285
|
-
if (typeof raw !== "string") return {
|
|
286
|
-
ok: false,
|
|
287
|
-
error: "invalid label: must be a string"
|
|
288
|
-
};
|
|
289
|
-
const trimmed = raw.trim();
|
|
290
|
-
if (!trimmed) return {
|
|
291
|
-
ok: false,
|
|
292
|
-
error: "invalid label: empty"
|
|
293
|
-
};
|
|
294
|
-
if (trimmed.length > 64) return {
|
|
295
|
-
ok: false,
|
|
296
|
-
error: `invalid label: too long (max 64)`
|
|
297
|
-
};
|
|
298
|
-
return {
|
|
299
|
-
ok: true,
|
|
300
|
-
label: trimmed
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
//#endregion
|
|
304
|
-
//#region src/gateway/protocol/schema/primitives.ts
|
|
305
|
-
const NonEmptyString = Type.String({ minLength: 1 });
|
|
306
|
-
const ChatSendSessionKeyString = Type.String({
|
|
307
|
-
minLength: 1,
|
|
308
|
-
maxLength: 512
|
|
309
|
-
});
|
|
310
|
-
const SessionLabelString = Type.String({
|
|
311
|
-
minLength: 1,
|
|
312
|
-
maxLength: 64
|
|
313
|
-
});
|
|
314
|
-
const InputProvenanceSchema = Type.Object({
|
|
315
|
-
kind: Type.String({ enum: [...INPUT_PROVENANCE_KIND_VALUES] }),
|
|
316
|
-
originSessionId: Type.Optional(Type.String()),
|
|
317
|
-
sourceSessionKey: Type.Optional(Type.String()),
|
|
318
|
-
sourceChannel: Type.Optional(Type.String()),
|
|
319
|
-
sourceTool: Type.Optional(Type.String())
|
|
320
|
-
}, { additionalProperties: false });
|
|
321
|
-
const GatewayClientIdSchema = Type.Union(Object.values(GATEWAY_CLIENT_IDS).map((value) => Type.Literal(value)));
|
|
322
|
-
const GatewayClientModeSchema = Type.Union(Object.values(GATEWAY_CLIENT_MODES).map((value) => Type.Literal(value)));
|
|
323
|
-
Type.Union([
|
|
324
|
-
Type.Literal("env"),
|
|
325
|
-
Type.Literal("file"),
|
|
326
|
-
Type.Literal("exec")
|
|
327
|
-
]);
|
|
328
|
-
const SecretProviderAliasString = Type.String({ pattern: SECRET_PROVIDER_ALIAS_PATTERN.source });
|
|
329
|
-
const EnvSecretRefSchema = Type.Object({
|
|
330
|
-
source: Type.Literal("env"),
|
|
331
|
-
provider: SecretProviderAliasString,
|
|
332
|
-
id: Type.String({ pattern: ENV_SECRET_REF_ID_RE.source })
|
|
333
|
-
}, { additionalProperties: false });
|
|
334
|
-
const FileSecretRefSchema = Type.Object({
|
|
335
|
-
source: Type.Literal("file"),
|
|
336
|
-
provider: SecretProviderAliasString,
|
|
337
|
-
id: Type.String({ pattern: FILE_SECRET_REF_ID_PATTERN.source })
|
|
338
|
-
}, { additionalProperties: false });
|
|
339
|
-
const ExecSecretRefSchema = Type.Object({
|
|
340
|
-
source: Type.Literal("exec"),
|
|
341
|
-
provider: SecretProviderAliasString,
|
|
342
|
-
id: Type.String({ pattern: EXEC_SECRET_REF_ID_JSON_SCHEMA_PATTERN })
|
|
343
|
-
}, { additionalProperties: false });
|
|
344
|
-
const SecretRefSchema = Type.Union([
|
|
345
|
-
EnvSecretRefSchema,
|
|
346
|
-
FileSecretRefSchema,
|
|
347
|
-
ExecSecretRefSchema
|
|
348
|
-
]);
|
|
349
|
-
const SecretInputSchema = Type.Union([Type.String(), SecretRefSchema]);
|
|
350
|
-
//#endregion
|
|
351
|
-
//#region src/gateway/protocol/schema/agent.ts
|
|
352
|
-
const AgentInternalEventSchema = Type.Object({
|
|
353
|
-
type: Type.Literal("task_completion"),
|
|
354
|
-
source: Type.String({ enum: ["subagent", "cron"] }),
|
|
355
|
-
childSessionKey: Type.String(),
|
|
356
|
-
childSessionId: Type.Optional(Type.String()),
|
|
357
|
-
announceType: Type.String(),
|
|
358
|
-
taskLabel: Type.String(),
|
|
359
|
-
status: Type.String({ enum: [
|
|
360
|
-
"ok",
|
|
361
|
-
"timeout",
|
|
362
|
-
"error",
|
|
363
|
-
"unknown"
|
|
364
|
-
] }),
|
|
365
|
-
statusLabel: Type.String(),
|
|
366
|
-
result: Type.String(),
|
|
367
|
-
statsLine: Type.Optional(Type.String()),
|
|
368
|
-
replyInstruction: Type.String()
|
|
369
|
-
}, { additionalProperties: false });
|
|
370
|
-
Type.Object({
|
|
371
|
-
runId: NonEmptyString,
|
|
372
|
-
seq: Type.Integer({ minimum: 0 }),
|
|
373
|
-
stream: NonEmptyString,
|
|
374
|
-
ts: Type.Integer({ minimum: 0 }),
|
|
375
|
-
data: Type.Record(Type.String(), Type.Unknown())
|
|
376
|
-
}, { additionalProperties: false });
|
|
377
|
-
const SendParamsSchema = Type.Object({
|
|
378
|
-
to: NonEmptyString,
|
|
379
|
-
message: Type.Optional(Type.String()),
|
|
380
|
-
mediaUrl: Type.Optional(Type.String()),
|
|
381
|
-
mediaUrls: Type.Optional(Type.Array(Type.String())),
|
|
382
|
-
gifPlayback: Type.Optional(Type.Boolean()),
|
|
383
|
-
channel: Type.Optional(Type.String()),
|
|
384
|
-
accountId: Type.Optional(Type.String()),
|
|
385
|
-
agentId: Type.Optional(Type.String()),
|
|
386
|
-
threadId: Type.Optional(Type.String()),
|
|
387
|
-
sessionKey: Type.Optional(Type.String()),
|
|
388
|
-
idempotencyKey: NonEmptyString
|
|
389
|
-
}, { additionalProperties: false });
|
|
390
|
-
const PollParamsSchema = Type.Object({
|
|
391
|
-
to: NonEmptyString,
|
|
392
|
-
question: NonEmptyString,
|
|
393
|
-
options: Type.Array(NonEmptyString, {
|
|
394
|
-
minItems: 2,
|
|
395
|
-
maxItems: 12
|
|
396
|
-
}),
|
|
397
|
-
maxSelections: Type.Optional(Type.Integer({
|
|
398
|
-
minimum: 1,
|
|
399
|
-
maximum: 12
|
|
400
|
-
})),
|
|
401
|
-
durationSeconds: Type.Optional(Type.Integer({
|
|
402
|
-
minimum: 1,
|
|
403
|
-
maximum: 604800
|
|
404
|
-
})),
|
|
405
|
-
durationHours: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
406
|
-
silent: Type.Optional(Type.Boolean()),
|
|
407
|
-
isAnonymous: Type.Optional(Type.Boolean()),
|
|
408
|
-
threadId: Type.Optional(Type.String()),
|
|
409
|
-
channel: Type.Optional(Type.String()),
|
|
410
|
-
accountId: Type.Optional(Type.String()),
|
|
411
|
-
idempotencyKey: NonEmptyString
|
|
412
|
-
}, { additionalProperties: false });
|
|
413
|
-
const AgentParamsSchema = Type.Object({
|
|
414
|
-
message: NonEmptyString,
|
|
415
|
-
agentId: Type.Optional(NonEmptyString),
|
|
416
|
-
to: Type.Optional(Type.String()),
|
|
417
|
-
replyTo: Type.Optional(Type.String()),
|
|
418
|
-
sessionId: Type.Optional(Type.String()),
|
|
419
|
-
sessionKey: Type.Optional(Type.String()),
|
|
420
|
-
thinking: Type.Optional(Type.String()),
|
|
421
|
-
deliver: Type.Optional(Type.Boolean()),
|
|
422
|
-
attachments: Type.Optional(Type.Array(Type.Unknown())),
|
|
423
|
-
channel: Type.Optional(Type.String()),
|
|
424
|
-
replyChannel: Type.Optional(Type.String()),
|
|
425
|
-
accountId: Type.Optional(Type.String()),
|
|
426
|
-
replyAccountId: Type.Optional(Type.String()),
|
|
427
|
-
threadId: Type.Optional(Type.String()),
|
|
428
|
-
groupId: Type.Optional(Type.String()),
|
|
429
|
-
groupChannel: Type.Optional(Type.String()),
|
|
430
|
-
groupSpace: Type.Optional(Type.String()),
|
|
431
|
-
timeout: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
432
|
-
bestEffortDeliver: Type.Optional(Type.Boolean()),
|
|
433
|
-
lane: Type.Optional(Type.String()),
|
|
434
|
-
extraSystemPrompt: Type.Optional(Type.String()),
|
|
435
|
-
internalEvents: Type.Optional(Type.Array(AgentInternalEventSchema)),
|
|
436
|
-
inputProvenance: Type.Optional(InputProvenanceSchema),
|
|
437
|
-
idempotencyKey: NonEmptyString,
|
|
438
|
-
label: Type.Optional(SessionLabelString)
|
|
439
|
-
}, { additionalProperties: false });
|
|
440
|
-
const AgentIdentityParamsSchema = Type.Object({
|
|
441
|
-
agentId: Type.Optional(NonEmptyString),
|
|
442
|
-
sessionKey: Type.Optional(Type.String())
|
|
443
|
-
}, { additionalProperties: false });
|
|
444
|
-
Type.Object({
|
|
445
|
-
agentId: NonEmptyString,
|
|
446
|
-
name: Type.Optional(NonEmptyString),
|
|
447
|
-
avatar: Type.Optional(NonEmptyString),
|
|
448
|
-
emoji: Type.Optional(NonEmptyString)
|
|
449
|
-
}, { additionalProperties: false });
|
|
450
|
-
const AgentWaitParamsSchema = Type.Object({
|
|
451
|
-
runId: NonEmptyString,
|
|
452
|
-
timeoutMs: Type.Optional(Type.Integer({ minimum: 0 }))
|
|
453
|
-
}, { additionalProperties: false });
|
|
454
|
-
const WakeParamsSchema = Type.Object({
|
|
455
|
-
mode: Type.Union([Type.Literal("now"), Type.Literal("next-heartbeat")]),
|
|
456
|
-
text: NonEmptyString
|
|
457
|
-
}, { additionalProperties: false });
|
|
458
|
-
//#endregion
|
|
459
|
-
//#region src/gateway/protocol/schema/agents-models-skills.ts
|
|
460
|
-
const ModelChoiceSchema = Type.Object({
|
|
461
|
-
id: NonEmptyString,
|
|
462
|
-
name: NonEmptyString,
|
|
463
|
-
provider: NonEmptyString,
|
|
464
|
-
contextWindow: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
465
|
-
reasoning: Type.Optional(Type.Boolean())
|
|
466
|
-
}, { additionalProperties: false });
|
|
467
|
-
const AgentSummarySchema = Type.Object({
|
|
468
|
-
id: NonEmptyString,
|
|
469
|
-
name: Type.Optional(NonEmptyString),
|
|
470
|
-
identity: Type.Optional(Type.Object({
|
|
471
|
-
name: Type.Optional(NonEmptyString),
|
|
472
|
-
theme: Type.Optional(NonEmptyString),
|
|
473
|
-
emoji: Type.Optional(NonEmptyString),
|
|
474
|
-
avatar: Type.Optional(NonEmptyString),
|
|
475
|
-
avatarUrl: Type.Optional(NonEmptyString)
|
|
476
|
-
}, { additionalProperties: false }))
|
|
477
|
-
}, { additionalProperties: false });
|
|
478
|
-
const AgentsListParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
479
|
-
Type.Object({
|
|
480
|
-
defaultId: NonEmptyString,
|
|
481
|
-
mainKey: NonEmptyString,
|
|
482
|
-
scope: Type.Union([Type.Literal("per-sender"), Type.Literal("global")]),
|
|
483
|
-
agents: Type.Array(AgentSummarySchema)
|
|
484
|
-
}, { additionalProperties: false });
|
|
485
|
-
const AgentsCreateParamsSchema = Type.Object({
|
|
486
|
-
name: NonEmptyString,
|
|
487
|
-
workspace: NonEmptyString,
|
|
488
|
-
emoji: Type.Optional(Type.String()),
|
|
489
|
-
avatar: Type.Optional(Type.String())
|
|
490
|
-
}, { additionalProperties: false });
|
|
491
|
-
Type.Object({
|
|
492
|
-
ok: Type.Literal(true),
|
|
493
|
-
agentId: NonEmptyString,
|
|
494
|
-
name: NonEmptyString,
|
|
495
|
-
workspace: NonEmptyString
|
|
496
|
-
}, { additionalProperties: false });
|
|
497
|
-
const AgentsUpdateParamsSchema = Type.Object({
|
|
498
|
-
agentId: NonEmptyString,
|
|
499
|
-
name: Type.Optional(NonEmptyString),
|
|
500
|
-
workspace: Type.Optional(NonEmptyString),
|
|
501
|
-
model: Type.Optional(NonEmptyString),
|
|
502
|
-
avatar: Type.Optional(Type.String())
|
|
503
|
-
}, { additionalProperties: false });
|
|
504
|
-
Type.Object({
|
|
505
|
-
ok: Type.Literal(true),
|
|
506
|
-
agentId: NonEmptyString
|
|
507
|
-
}, { additionalProperties: false });
|
|
508
|
-
const AgentsDeleteParamsSchema = Type.Object({
|
|
509
|
-
agentId: NonEmptyString,
|
|
510
|
-
deleteFiles: Type.Optional(Type.Boolean())
|
|
511
|
-
}, { additionalProperties: false });
|
|
512
|
-
Type.Object({
|
|
513
|
-
ok: Type.Literal(true),
|
|
514
|
-
agentId: NonEmptyString,
|
|
515
|
-
removedBindings: Type.Integer({ minimum: 0 })
|
|
516
|
-
}, { additionalProperties: false });
|
|
517
|
-
const AgentsFileEntrySchema = Type.Object({
|
|
518
|
-
name: NonEmptyString,
|
|
519
|
-
path: NonEmptyString,
|
|
520
|
-
missing: Type.Boolean(),
|
|
521
|
-
size: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
522
|
-
updatedAtMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
523
|
-
content: Type.Optional(Type.String())
|
|
524
|
-
}, { additionalProperties: false });
|
|
525
|
-
const AgentsFilesListParamsSchema = Type.Object({ agentId: NonEmptyString }, { additionalProperties: false });
|
|
526
|
-
Type.Object({
|
|
527
|
-
agentId: NonEmptyString,
|
|
528
|
-
workspace: NonEmptyString,
|
|
529
|
-
files: Type.Array(AgentsFileEntrySchema)
|
|
530
|
-
}, { additionalProperties: false });
|
|
531
|
-
const AgentsFilesGetParamsSchema = Type.Object({
|
|
532
|
-
agentId: NonEmptyString,
|
|
533
|
-
name: NonEmptyString
|
|
534
|
-
}, { additionalProperties: false });
|
|
535
|
-
Type.Object({
|
|
536
|
-
agentId: NonEmptyString,
|
|
537
|
-
workspace: NonEmptyString,
|
|
538
|
-
file: AgentsFileEntrySchema
|
|
539
|
-
}, { additionalProperties: false });
|
|
540
|
-
const AgentsFilesSetParamsSchema = Type.Object({
|
|
541
|
-
agentId: NonEmptyString,
|
|
542
|
-
name: NonEmptyString,
|
|
543
|
-
content: Type.String()
|
|
544
|
-
}, { additionalProperties: false });
|
|
545
|
-
Type.Object({
|
|
546
|
-
ok: Type.Literal(true),
|
|
547
|
-
agentId: NonEmptyString,
|
|
548
|
-
workspace: NonEmptyString,
|
|
549
|
-
file: AgentsFileEntrySchema
|
|
550
|
-
}, { additionalProperties: false });
|
|
551
|
-
const ModelsListParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
552
|
-
Type.Object({ models: Type.Array(ModelChoiceSchema) }, { additionalProperties: false });
|
|
553
|
-
const SkillsStatusParamsSchema = Type.Object({ agentId: Type.Optional(NonEmptyString) }, { additionalProperties: false });
|
|
554
|
-
const SkillsBinsParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
555
|
-
Type.Object({ bins: Type.Array(NonEmptyString) }, { additionalProperties: false });
|
|
556
|
-
const SkillsInstallParamsSchema = Type.Object({
|
|
557
|
-
name: NonEmptyString,
|
|
558
|
-
installId: NonEmptyString,
|
|
559
|
-
timeoutMs: Type.Optional(Type.Integer({ minimum: 1e3 }))
|
|
560
|
-
}, { additionalProperties: false });
|
|
561
|
-
const SkillsUpdateParamsSchema = Type.Object({
|
|
562
|
-
skillKey: NonEmptyString,
|
|
563
|
-
enabled: Type.Optional(Type.Boolean()),
|
|
564
|
-
apiKey: Type.Optional(Type.String()),
|
|
565
|
-
env: Type.Optional(Type.Record(NonEmptyString, Type.String()))
|
|
566
|
-
}, { additionalProperties: false });
|
|
567
|
-
const ToolsCatalogParamsSchema = Type.Object({
|
|
568
|
-
agentId: Type.Optional(NonEmptyString),
|
|
569
|
-
includePlugins: Type.Optional(Type.Boolean())
|
|
570
|
-
}, { additionalProperties: false });
|
|
571
|
-
const ToolCatalogProfileSchema = Type.Object({
|
|
572
|
-
id: Type.Union([
|
|
573
|
-
Type.Literal("minimal"),
|
|
574
|
-
Type.Literal("coding"),
|
|
575
|
-
Type.Literal("messaging"),
|
|
576
|
-
Type.Literal("full")
|
|
577
|
-
]),
|
|
578
|
-
label: NonEmptyString
|
|
579
|
-
}, { additionalProperties: false });
|
|
580
|
-
const ToolCatalogEntrySchema = Type.Object({
|
|
581
|
-
id: NonEmptyString,
|
|
582
|
-
label: NonEmptyString,
|
|
583
|
-
description: Type.String(),
|
|
584
|
-
source: Type.Union([Type.Literal("core"), Type.Literal("plugin")]),
|
|
585
|
-
pluginId: Type.Optional(NonEmptyString),
|
|
586
|
-
optional: Type.Optional(Type.Boolean()),
|
|
587
|
-
defaultProfiles: Type.Array(Type.Union([
|
|
588
|
-
Type.Literal("minimal"),
|
|
589
|
-
Type.Literal("coding"),
|
|
590
|
-
Type.Literal("messaging"),
|
|
591
|
-
Type.Literal("full")
|
|
592
|
-
]))
|
|
593
|
-
}, { additionalProperties: false });
|
|
594
|
-
const ToolCatalogGroupSchema = Type.Object({
|
|
595
|
-
id: NonEmptyString,
|
|
596
|
-
label: NonEmptyString,
|
|
597
|
-
source: Type.Union([Type.Literal("core"), Type.Literal("plugin")]),
|
|
598
|
-
pluginId: Type.Optional(NonEmptyString),
|
|
599
|
-
tools: Type.Array(ToolCatalogEntrySchema)
|
|
600
|
-
}, { additionalProperties: false });
|
|
601
|
-
Type.Object({
|
|
602
|
-
agentId: NonEmptyString,
|
|
603
|
-
profiles: Type.Array(ToolCatalogProfileSchema),
|
|
604
|
-
groups: Type.Array(ToolCatalogGroupSchema)
|
|
605
|
-
}, { additionalProperties: false });
|
|
606
|
-
//#endregion
|
|
607
|
-
//#region src/gateway/protocol/schema/channels.ts
|
|
608
|
-
const TalkModeParamsSchema = Type.Object({
|
|
609
|
-
enabled: Type.Boolean(),
|
|
610
|
-
phase: Type.Optional(Type.String())
|
|
611
|
-
}, { additionalProperties: false });
|
|
612
|
-
const TalkConfigParamsSchema = Type.Object({ includeSecrets: Type.Optional(Type.Boolean()) }, { additionalProperties: false });
|
|
613
|
-
const talkProviderFieldSchemas = {
|
|
614
|
-
voiceId: Type.Optional(Type.String()),
|
|
615
|
-
voiceAliases: Type.Optional(Type.Record(Type.String(), Type.String())),
|
|
616
|
-
modelId: Type.Optional(Type.String()),
|
|
617
|
-
outputFormat: Type.Optional(Type.String()),
|
|
618
|
-
apiKey: Type.Optional(SecretInputSchema)
|
|
619
|
-
};
|
|
620
|
-
const TalkProviderConfigSchema = Type.Object(talkProviderFieldSchemas, { additionalProperties: true });
|
|
621
|
-
const ResolvedTalkConfigSchema = Type.Object({
|
|
622
|
-
provider: Type.String(),
|
|
623
|
-
config: TalkProviderConfigSchema
|
|
624
|
-
}, { additionalProperties: false });
|
|
625
|
-
const LegacyTalkConfigSchema = Type.Object({
|
|
626
|
-
...talkProviderFieldSchemas,
|
|
627
|
-
interruptOnSpeech: Type.Optional(Type.Boolean()),
|
|
628
|
-
silenceTimeoutMs: Type.Optional(Type.Integer({ minimum: 1 }))
|
|
629
|
-
}, { additionalProperties: false });
|
|
630
|
-
const NormalizedTalkConfigSchema = Type.Object({
|
|
631
|
-
provider: Type.Optional(Type.String()),
|
|
632
|
-
providers: Type.Optional(Type.Record(Type.String(), TalkProviderConfigSchema)),
|
|
633
|
-
resolved: ResolvedTalkConfigSchema,
|
|
634
|
-
...talkProviderFieldSchemas,
|
|
635
|
-
interruptOnSpeech: Type.Optional(Type.Boolean()),
|
|
636
|
-
silenceTimeoutMs: Type.Optional(Type.Integer({ minimum: 1 }))
|
|
637
|
-
}, { additionalProperties: false });
|
|
638
|
-
const TalkConfigResultSchema = Type.Object({ config: Type.Object({
|
|
639
|
-
talk: Type.Optional(Type.Union([LegacyTalkConfigSchema, NormalizedTalkConfigSchema])),
|
|
640
|
-
session: Type.Optional(Type.Object({ mainKey: Type.Optional(Type.String()) }, { additionalProperties: false })),
|
|
641
|
-
ui: Type.Optional(Type.Object({ seamColor: Type.Optional(Type.String()) }, { additionalProperties: false }))
|
|
642
|
-
}, { additionalProperties: false }) }, { additionalProperties: false });
|
|
643
|
-
const ChannelsStatusParamsSchema = Type.Object({
|
|
644
|
-
probe: Type.Optional(Type.Boolean()),
|
|
645
|
-
timeoutMs: Type.Optional(Type.Integer({ minimum: 0 }))
|
|
646
|
-
}, { additionalProperties: false });
|
|
647
|
-
const ChannelAccountSnapshotSchema = Type.Object({
|
|
648
|
-
accountId: NonEmptyString,
|
|
649
|
-
name: Type.Optional(Type.String()),
|
|
650
|
-
enabled: Type.Optional(Type.Boolean()),
|
|
651
|
-
configured: Type.Optional(Type.Boolean()),
|
|
652
|
-
linked: Type.Optional(Type.Boolean()),
|
|
653
|
-
running: Type.Optional(Type.Boolean()),
|
|
654
|
-
connected: Type.Optional(Type.Boolean()),
|
|
655
|
-
reconnectAttempts: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
656
|
-
lastConnectedAt: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
657
|
-
lastError: Type.Optional(Type.String()),
|
|
658
|
-
lastStartAt: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
659
|
-
lastStopAt: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
660
|
-
lastInboundAt: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
661
|
-
lastOutboundAt: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
662
|
-
busy: Type.Optional(Type.Boolean()),
|
|
663
|
-
activeRuns: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
664
|
-
lastRunActivityAt: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
665
|
-
lastProbeAt: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
666
|
-
mode: Type.Optional(Type.String()),
|
|
667
|
-
dmPolicy: Type.Optional(Type.String()),
|
|
668
|
-
allowFrom: Type.Optional(Type.Array(Type.String())),
|
|
669
|
-
tokenSource: Type.Optional(Type.String()),
|
|
670
|
-
botTokenSource: Type.Optional(Type.String()),
|
|
671
|
-
appTokenSource: Type.Optional(Type.String()),
|
|
672
|
-
baseUrl: Type.Optional(Type.String()),
|
|
673
|
-
allowUnmentionedGroups: Type.Optional(Type.Boolean()),
|
|
674
|
-
cliPath: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
675
|
-
dbPath: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
676
|
-
port: Type.Optional(Type.Union([Type.Integer({ minimum: 0 }), Type.Null()])),
|
|
677
|
-
probe: Type.Optional(Type.Unknown()),
|
|
678
|
-
audit: Type.Optional(Type.Unknown()),
|
|
679
|
-
application: Type.Optional(Type.Unknown())
|
|
680
|
-
}, { additionalProperties: true });
|
|
681
|
-
const ChannelUiMetaSchema = Type.Object({
|
|
682
|
-
id: NonEmptyString,
|
|
683
|
-
label: NonEmptyString,
|
|
684
|
-
detailLabel: NonEmptyString,
|
|
685
|
-
systemImage: Type.Optional(Type.String())
|
|
686
|
-
}, { additionalProperties: false });
|
|
687
|
-
Type.Object({
|
|
688
|
-
ts: Type.Integer({ minimum: 0 }),
|
|
689
|
-
channelOrder: Type.Array(NonEmptyString),
|
|
690
|
-
channelLabels: Type.Record(NonEmptyString, NonEmptyString),
|
|
691
|
-
channelDetailLabels: Type.Optional(Type.Record(NonEmptyString, NonEmptyString)),
|
|
692
|
-
channelSystemImages: Type.Optional(Type.Record(NonEmptyString, NonEmptyString)),
|
|
693
|
-
channelMeta: Type.Optional(Type.Array(ChannelUiMetaSchema)),
|
|
694
|
-
channels: Type.Record(NonEmptyString, Type.Unknown()),
|
|
695
|
-
channelAccounts: Type.Record(NonEmptyString, Type.Array(ChannelAccountSnapshotSchema)),
|
|
696
|
-
channelDefaultAccountId: Type.Record(NonEmptyString, NonEmptyString)
|
|
697
|
-
}, { additionalProperties: false });
|
|
698
|
-
const ChannelsLogoutParamsSchema = Type.Object({
|
|
699
|
-
channel: NonEmptyString,
|
|
700
|
-
accountId: Type.Optional(Type.String())
|
|
701
|
-
}, { additionalProperties: false });
|
|
702
|
-
const WebLoginStartParamsSchema = Type.Object({
|
|
703
|
-
force: Type.Optional(Type.Boolean()),
|
|
704
|
-
timeoutMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
705
|
-
verbose: Type.Optional(Type.Boolean()),
|
|
706
|
-
accountId: Type.Optional(Type.String())
|
|
707
|
-
}, { additionalProperties: false });
|
|
708
|
-
const WebLoginWaitParamsSchema = Type.Object({
|
|
709
|
-
timeoutMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
710
|
-
accountId: Type.Optional(Type.String())
|
|
711
|
-
}, { additionalProperties: false });
|
|
712
|
-
//#endregion
|
|
713
|
-
//#region src/gateway/protocol/schema/config.ts
|
|
714
|
-
const ConfigSchemaLookupPathString = Type.String({
|
|
715
|
-
minLength: 1,
|
|
716
|
-
maxLength: 1024,
|
|
717
|
-
pattern: "^[A-Za-z0-9_./\\[\\]\\-*]+$"
|
|
718
|
-
});
|
|
719
|
-
const ConfigGetParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
720
|
-
const ConfigSetParamsSchema = Type.Object({
|
|
721
|
-
raw: NonEmptyString,
|
|
722
|
-
baseHash: Type.Optional(NonEmptyString)
|
|
723
|
-
}, { additionalProperties: false });
|
|
724
|
-
const ConfigApplyLikeParamsSchema = Type.Object({
|
|
725
|
-
raw: NonEmptyString,
|
|
726
|
-
baseHash: Type.Optional(NonEmptyString),
|
|
727
|
-
sessionKey: Type.Optional(Type.String()),
|
|
728
|
-
note: Type.Optional(Type.String()),
|
|
729
|
-
restartDelayMs: Type.Optional(Type.Integer({ minimum: 0 }))
|
|
730
|
-
}, { additionalProperties: false });
|
|
731
|
-
const ConfigApplyParamsSchema = ConfigApplyLikeParamsSchema;
|
|
732
|
-
const ConfigPatchParamsSchema = ConfigApplyLikeParamsSchema;
|
|
733
|
-
const ConfigSchemaParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
734
|
-
const ConfigSchemaLookupParamsSchema = Type.Object({ path: ConfigSchemaLookupPathString }, { additionalProperties: false });
|
|
735
|
-
const UpdateRunParamsSchema = Type.Object({
|
|
736
|
-
sessionKey: Type.Optional(Type.String()),
|
|
737
|
-
note: Type.Optional(Type.String()),
|
|
738
|
-
restartDelayMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
739
|
-
timeoutMs: Type.Optional(Type.Integer({ minimum: 1 }))
|
|
740
|
-
}, { additionalProperties: false });
|
|
741
|
-
const ConfigUiHintSchema = Type.Object({
|
|
742
|
-
label: Type.Optional(Type.String()),
|
|
743
|
-
help: Type.Optional(Type.String()),
|
|
744
|
-
tags: Type.Optional(Type.Array(Type.String())),
|
|
745
|
-
group: Type.Optional(Type.String()),
|
|
746
|
-
order: Type.Optional(Type.Integer()),
|
|
747
|
-
advanced: Type.Optional(Type.Boolean()),
|
|
748
|
-
sensitive: Type.Optional(Type.Boolean()),
|
|
749
|
-
placeholder: Type.Optional(Type.String()),
|
|
750
|
-
itemTemplate: Type.Optional(Type.Unknown())
|
|
751
|
-
}, { additionalProperties: false });
|
|
752
|
-
Type.Object({
|
|
753
|
-
schema: Type.Unknown(),
|
|
754
|
-
uiHints: Type.Record(Type.String(), ConfigUiHintSchema),
|
|
755
|
-
version: NonEmptyString,
|
|
756
|
-
generatedAt: NonEmptyString
|
|
757
|
-
}, { additionalProperties: false });
|
|
758
|
-
const ConfigSchemaLookupChildSchema = Type.Object({
|
|
759
|
-
key: NonEmptyString,
|
|
760
|
-
path: NonEmptyString,
|
|
761
|
-
type: Type.Optional(Type.Union([Type.String(), Type.Array(Type.String())])),
|
|
762
|
-
required: Type.Boolean(),
|
|
763
|
-
hasChildren: Type.Boolean(),
|
|
764
|
-
hint: Type.Optional(ConfigUiHintSchema),
|
|
765
|
-
hintPath: Type.Optional(Type.String())
|
|
766
|
-
}, { additionalProperties: false });
|
|
767
|
-
const ConfigSchemaLookupResultSchema = Type.Object({
|
|
768
|
-
path: NonEmptyString,
|
|
769
|
-
schema: Type.Unknown(),
|
|
770
|
-
hint: Type.Optional(ConfigUiHintSchema),
|
|
771
|
-
hintPath: Type.Optional(Type.String()),
|
|
772
|
-
children: Type.Array(ConfigSchemaLookupChildSchema)
|
|
773
|
-
}, { additionalProperties: false });
|
|
774
|
-
//#endregion
|
|
775
|
-
//#region src/gateway/protocol/schema/cron.ts
|
|
776
|
-
function cronAgentTurnPayloadSchema(params) {
|
|
777
|
-
return Type.Object({
|
|
778
|
-
kind: Type.Literal("agentTurn"),
|
|
779
|
-
message: params.message,
|
|
780
|
-
model: Type.Optional(Type.String()),
|
|
781
|
-
fallbacks: Type.Optional(Type.Array(Type.String())),
|
|
782
|
-
thinking: Type.Optional(Type.String()),
|
|
783
|
-
timeoutSeconds: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
784
|
-
allowUnsafeExternalContent: Type.Optional(Type.Boolean()),
|
|
785
|
-
lightContext: Type.Optional(Type.Boolean()),
|
|
786
|
-
deliver: Type.Optional(Type.Boolean()),
|
|
787
|
-
channel: Type.Optional(Type.String()),
|
|
788
|
-
to: Type.Optional(Type.String()),
|
|
789
|
-
bestEffortDeliver: Type.Optional(Type.Boolean())
|
|
790
|
-
}, { additionalProperties: false });
|
|
791
|
-
}
|
|
792
|
-
const CronSessionTargetSchema = Type.Union([
|
|
793
|
-
Type.Literal("main"),
|
|
794
|
-
Type.Literal("isolated"),
|
|
795
|
-
Type.Literal("current"),
|
|
796
|
-
Type.String({ pattern: "^session:.+" })
|
|
797
|
-
]);
|
|
798
|
-
const CronWakeModeSchema = Type.Union([Type.Literal("next-heartbeat"), Type.Literal("now")]);
|
|
799
|
-
const CronRunStatusSchema = Type.Union([
|
|
800
|
-
Type.Literal("ok"),
|
|
801
|
-
Type.Literal("error"),
|
|
802
|
-
Type.Literal("skipped")
|
|
803
|
-
]);
|
|
804
|
-
const CronSortDirSchema = Type.Union([Type.Literal("asc"), Type.Literal("desc")]);
|
|
805
|
-
const CronJobsEnabledFilterSchema = Type.Union([
|
|
806
|
-
Type.Literal("all"),
|
|
807
|
-
Type.Literal("enabled"),
|
|
808
|
-
Type.Literal("disabled")
|
|
809
|
-
]);
|
|
810
|
-
const CronJobsSortBySchema = Type.Union([
|
|
811
|
-
Type.Literal("nextRunAtMs"),
|
|
812
|
-
Type.Literal("updatedAtMs"),
|
|
813
|
-
Type.Literal("name")
|
|
814
|
-
]);
|
|
815
|
-
const CronRunsStatusFilterSchema = Type.Union([
|
|
816
|
-
Type.Literal("all"),
|
|
817
|
-
Type.Literal("ok"),
|
|
818
|
-
Type.Literal("error"),
|
|
819
|
-
Type.Literal("skipped")
|
|
820
|
-
]);
|
|
821
|
-
const CronRunsStatusValueSchema = Type.Union([
|
|
822
|
-
Type.Literal("ok"),
|
|
823
|
-
Type.Literal("error"),
|
|
824
|
-
Type.Literal("skipped")
|
|
825
|
-
]);
|
|
826
|
-
const CronDeliveryStatusSchema = Type.Union([
|
|
827
|
-
Type.Literal("delivered"),
|
|
828
|
-
Type.Literal("not-delivered"),
|
|
829
|
-
Type.Literal("unknown"),
|
|
830
|
-
Type.Literal("not-requested")
|
|
831
|
-
]);
|
|
832
|
-
const CronFailoverReasonSchema = Type.Union([
|
|
833
|
-
Type.Literal("auth"),
|
|
834
|
-
Type.Literal("format"),
|
|
835
|
-
Type.Literal("rate_limit"),
|
|
836
|
-
Type.Literal("billing"),
|
|
837
|
-
Type.Literal("timeout"),
|
|
838
|
-
Type.Literal("model_not_found"),
|
|
839
|
-
Type.Literal("unknown")
|
|
840
|
-
]);
|
|
841
|
-
const CronCommonOptionalFields = {
|
|
842
|
-
agentId: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
843
|
-
sessionKey: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
844
|
-
description: Type.Optional(Type.String()),
|
|
845
|
-
enabled: Type.Optional(Type.Boolean()),
|
|
846
|
-
deleteAfterRun: Type.Optional(Type.Boolean())
|
|
847
|
-
};
|
|
848
|
-
function cronIdOrJobIdParams(extraFields) {
|
|
849
|
-
return Type.Union([Type.Object({
|
|
850
|
-
id: NonEmptyString,
|
|
851
|
-
...extraFields
|
|
852
|
-
}, { additionalProperties: false }), Type.Object({
|
|
853
|
-
jobId: NonEmptyString,
|
|
854
|
-
...extraFields
|
|
855
|
-
}, { additionalProperties: false })]);
|
|
856
|
-
}
|
|
857
|
-
const CronRunLogJobIdSchema = Type.String({
|
|
858
|
-
minLength: 1,
|
|
859
|
-
pattern: "^[^/\\\\]+$"
|
|
860
|
-
});
|
|
861
|
-
const CronScheduleSchema = Type.Union([
|
|
862
|
-
Type.Object({
|
|
863
|
-
kind: Type.Literal("at"),
|
|
864
|
-
at: NonEmptyString
|
|
865
|
-
}, { additionalProperties: false }),
|
|
866
|
-
Type.Object({
|
|
867
|
-
kind: Type.Literal("every"),
|
|
868
|
-
everyMs: Type.Integer({ minimum: 1 }),
|
|
869
|
-
anchorMs: Type.Optional(Type.Integer({ minimum: 0 }))
|
|
870
|
-
}, { additionalProperties: false }),
|
|
871
|
-
Type.Object({
|
|
872
|
-
kind: Type.Literal("cron"),
|
|
873
|
-
expr: NonEmptyString,
|
|
874
|
-
tz: Type.Optional(Type.String()),
|
|
875
|
-
staggerMs: Type.Optional(Type.Integer({ minimum: 0 }))
|
|
876
|
-
}, { additionalProperties: false })
|
|
877
|
-
]);
|
|
878
|
-
const CronPayloadSchema = Type.Union([Type.Object({
|
|
879
|
-
kind: Type.Literal("systemEvent"),
|
|
880
|
-
text: NonEmptyString
|
|
881
|
-
}, { additionalProperties: false }), cronAgentTurnPayloadSchema({ message: NonEmptyString })]);
|
|
882
|
-
const CronPayloadPatchSchema = Type.Union([Type.Object({
|
|
883
|
-
kind: Type.Literal("systemEvent"),
|
|
884
|
-
text: Type.Optional(NonEmptyString)
|
|
885
|
-
}, { additionalProperties: false }), cronAgentTurnPayloadSchema({ message: Type.Optional(NonEmptyString) })]);
|
|
886
|
-
const CronFailureAlertSchema = Type.Object({
|
|
887
|
-
after: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
888
|
-
channel: Type.Optional(Type.Union([Type.Literal("last"), NonEmptyString])),
|
|
889
|
-
to: Type.Optional(Type.String()),
|
|
890
|
-
cooldownMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
891
|
-
mode: Type.Optional(Type.Union([Type.Literal("announce"), Type.Literal("webhook")])),
|
|
892
|
-
accountId: Type.Optional(NonEmptyString)
|
|
893
|
-
}, { additionalProperties: false });
|
|
894
|
-
const CronFailureDestinationSchema = Type.Object({
|
|
895
|
-
channel: Type.Optional(Type.Union([Type.Literal("last"), NonEmptyString])),
|
|
896
|
-
to: Type.Optional(Type.String()),
|
|
897
|
-
accountId: Type.Optional(NonEmptyString),
|
|
898
|
-
mode: Type.Optional(Type.Union([Type.Literal("announce"), Type.Literal("webhook")]))
|
|
899
|
-
}, { additionalProperties: false });
|
|
900
|
-
const CronDeliverySharedProperties = {
|
|
901
|
-
channel: Type.Optional(Type.Union([Type.Literal("last"), NonEmptyString])),
|
|
902
|
-
accountId: Type.Optional(NonEmptyString),
|
|
903
|
-
bestEffort: Type.Optional(Type.Boolean()),
|
|
904
|
-
failureDestination: Type.Optional(CronFailureDestinationSchema)
|
|
905
|
-
};
|
|
906
|
-
const CronDeliveryNoopSchema = Type.Object({
|
|
907
|
-
mode: Type.Literal("none"),
|
|
908
|
-
...CronDeliverySharedProperties,
|
|
909
|
-
to: Type.Optional(Type.String())
|
|
910
|
-
}, { additionalProperties: false });
|
|
911
|
-
const CronDeliveryAnnounceSchema = Type.Object({
|
|
912
|
-
mode: Type.Literal("announce"),
|
|
913
|
-
...CronDeliverySharedProperties,
|
|
914
|
-
to: Type.Optional(Type.String())
|
|
915
|
-
}, { additionalProperties: false });
|
|
916
|
-
const CronDeliveryWebhookSchema = Type.Object({
|
|
917
|
-
mode: Type.Literal("webhook"),
|
|
918
|
-
...CronDeliverySharedProperties,
|
|
919
|
-
to: NonEmptyString
|
|
920
|
-
}, { additionalProperties: false });
|
|
921
|
-
const CronDeliverySchema = Type.Union([
|
|
922
|
-
CronDeliveryNoopSchema,
|
|
923
|
-
CronDeliveryAnnounceSchema,
|
|
924
|
-
CronDeliveryWebhookSchema
|
|
925
|
-
]);
|
|
926
|
-
const CronDeliveryPatchSchema = Type.Object({
|
|
927
|
-
mode: Type.Optional(Type.Union([
|
|
928
|
-
Type.Literal("none"),
|
|
929
|
-
Type.Literal("announce"),
|
|
930
|
-
Type.Literal("webhook")
|
|
931
|
-
])),
|
|
932
|
-
...CronDeliverySharedProperties,
|
|
933
|
-
to: Type.Optional(Type.String())
|
|
934
|
-
}, { additionalProperties: false });
|
|
935
|
-
const CronJobStateSchema = Type.Object({
|
|
936
|
-
nextRunAtMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
937
|
-
runningAtMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
938
|
-
lastRunAtMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
939
|
-
lastRunStatus: Type.Optional(CronRunStatusSchema),
|
|
940
|
-
lastStatus: Type.Optional(CronRunStatusSchema),
|
|
941
|
-
lastError: Type.Optional(Type.String()),
|
|
942
|
-
lastErrorReason: Type.Optional(CronFailoverReasonSchema),
|
|
943
|
-
lastDurationMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
944
|
-
consecutiveErrors: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
945
|
-
lastDelivered: Type.Optional(Type.Boolean()),
|
|
946
|
-
lastDeliveryStatus: Type.Optional(CronDeliveryStatusSchema),
|
|
947
|
-
lastDeliveryError: Type.Optional(Type.String()),
|
|
948
|
-
lastFailureAlertAtMs: Type.Optional(Type.Integer({ minimum: 0 }))
|
|
949
|
-
}, { additionalProperties: false });
|
|
950
|
-
Type.Object({
|
|
951
|
-
id: NonEmptyString,
|
|
952
|
-
agentId: Type.Optional(NonEmptyString),
|
|
953
|
-
sessionKey: Type.Optional(NonEmptyString),
|
|
954
|
-
name: NonEmptyString,
|
|
955
|
-
description: Type.Optional(Type.String()),
|
|
956
|
-
enabled: Type.Boolean(),
|
|
957
|
-
deleteAfterRun: Type.Optional(Type.Boolean()),
|
|
958
|
-
createdAtMs: Type.Integer({ minimum: 0 }),
|
|
959
|
-
updatedAtMs: Type.Integer({ minimum: 0 }),
|
|
960
|
-
schedule: CronScheduleSchema,
|
|
961
|
-
sessionTarget: CronSessionTargetSchema,
|
|
962
|
-
wakeMode: CronWakeModeSchema,
|
|
963
|
-
payload: CronPayloadSchema,
|
|
964
|
-
delivery: Type.Optional(CronDeliverySchema),
|
|
965
|
-
failureAlert: Type.Optional(Type.Union([Type.Literal(false), CronFailureAlertSchema])),
|
|
966
|
-
state: CronJobStateSchema
|
|
967
|
-
}, { additionalProperties: false });
|
|
968
|
-
const CronListParamsSchema = Type.Object({
|
|
969
|
-
includeDisabled: Type.Optional(Type.Boolean()),
|
|
970
|
-
limit: Type.Optional(Type.Integer({
|
|
971
|
-
minimum: 1,
|
|
972
|
-
maximum: 200
|
|
973
|
-
})),
|
|
974
|
-
offset: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
975
|
-
query: Type.Optional(Type.String()),
|
|
976
|
-
enabled: Type.Optional(CronJobsEnabledFilterSchema),
|
|
977
|
-
sortBy: Type.Optional(CronJobsSortBySchema),
|
|
978
|
-
sortDir: Type.Optional(CronSortDirSchema)
|
|
979
|
-
}, { additionalProperties: false });
|
|
980
|
-
const CronStatusParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
981
|
-
const CronAddParamsSchema = Type.Object({
|
|
982
|
-
name: NonEmptyString,
|
|
983
|
-
...CronCommonOptionalFields,
|
|
984
|
-
schedule: CronScheduleSchema,
|
|
985
|
-
sessionTarget: CronSessionTargetSchema,
|
|
986
|
-
wakeMode: CronWakeModeSchema,
|
|
987
|
-
payload: CronPayloadSchema,
|
|
988
|
-
delivery: Type.Optional(CronDeliverySchema),
|
|
989
|
-
failureAlert: Type.Optional(Type.Union([Type.Literal(false), CronFailureAlertSchema]))
|
|
990
|
-
}, { additionalProperties: false });
|
|
991
|
-
const CronUpdateParamsSchema = cronIdOrJobIdParams({ patch: Type.Object({
|
|
992
|
-
name: Type.Optional(NonEmptyString),
|
|
993
|
-
...CronCommonOptionalFields,
|
|
994
|
-
schedule: Type.Optional(CronScheduleSchema),
|
|
995
|
-
sessionTarget: Type.Optional(CronSessionTargetSchema),
|
|
996
|
-
wakeMode: Type.Optional(CronWakeModeSchema),
|
|
997
|
-
payload: Type.Optional(CronPayloadPatchSchema),
|
|
998
|
-
delivery: Type.Optional(CronDeliveryPatchSchema),
|
|
999
|
-
failureAlert: Type.Optional(Type.Union([Type.Literal(false), CronFailureAlertSchema])),
|
|
1000
|
-
state: Type.Optional(Type.Partial(CronJobStateSchema))
|
|
1001
|
-
}, { additionalProperties: false }) });
|
|
1002
|
-
const CronRemoveParamsSchema = cronIdOrJobIdParams({});
|
|
1003
|
-
const CronRunParamsSchema = cronIdOrJobIdParams({ mode: Type.Optional(Type.Union([Type.Literal("due"), Type.Literal("force")])) });
|
|
1004
|
-
const CronRunsParamsSchema = Type.Object({
|
|
1005
|
-
scope: Type.Optional(Type.Union([Type.Literal("job"), Type.Literal("all")])),
|
|
1006
|
-
id: Type.Optional(CronRunLogJobIdSchema),
|
|
1007
|
-
jobId: Type.Optional(CronRunLogJobIdSchema),
|
|
1008
|
-
limit: Type.Optional(Type.Integer({
|
|
1009
|
-
minimum: 1,
|
|
1010
|
-
maximum: 200
|
|
1011
|
-
})),
|
|
1012
|
-
offset: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
1013
|
-
statuses: Type.Optional(Type.Array(CronRunsStatusValueSchema, {
|
|
1014
|
-
minItems: 1,
|
|
1015
|
-
maxItems: 3
|
|
1016
|
-
})),
|
|
1017
|
-
status: Type.Optional(CronRunsStatusFilterSchema),
|
|
1018
|
-
deliveryStatuses: Type.Optional(Type.Array(CronDeliveryStatusSchema, {
|
|
1019
|
-
minItems: 1,
|
|
1020
|
-
maxItems: 4
|
|
1021
|
-
})),
|
|
1022
|
-
deliveryStatus: Type.Optional(CronDeliveryStatusSchema),
|
|
1023
|
-
query: Type.Optional(Type.String()),
|
|
1024
|
-
sortDir: Type.Optional(CronSortDirSchema)
|
|
1025
|
-
}, { additionalProperties: false });
|
|
1026
|
-
Type.Object({
|
|
1027
|
-
ts: Type.Integer({ minimum: 0 }),
|
|
1028
|
-
jobId: NonEmptyString,
|
|
1029
|
-
action: Type.Literal("finished"),
|
|
1030
|
-
status: Type.Optional(CronRunStatusSchema),
|
|
1031
|
-
error: Type.Optional(Type.String()),
|
|
1032
|
-
summary: Type.Optional(Type.String()),
|
|
1033
|
-
delivered: Type.Optional(Type.Boolean()),
|
|
1034
|
-
deliveryStatus: Type.Optional(CronDeliveryStatusSchema),
|
|
1035
|
-
deliveryError: Type.Optional(Type.String()),
|
|
1036
|
-
sessionId: Type.Optional(NonEmptyString),
|
|
1037
|
-
sessionKey: Type.Optional(NonEmptyString),
|
|
1038
|
-
runAtMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
1039
|
-
durationMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
1040
|
-
nextRunAtMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
1041
|
-
model: Type.Optional(Type.String()),
|
|
1042
|
-
provider: Type.Optional(Type.String()),
|
|
1043
|
-
usage: Type.Optional(Type.Object({
|
|
1044
|
-
input_tokens: Type.Optional(Type.Number()),
|
|
1045
|
-
output_tokens: Type.Optional(Type.Number()),
|
|
1046
|
-
total_tokens: Type.Optional(Type.Number()),
|
|
1047
|
-
cache_read_tokens: Type.Optional(Type.Number()),
|
|
1048
|
-
cache_write_tokens: Type.Optional(Type.Number())
|
|
1049
|
-
}, { additionalProperties: false })),
|
|
1050
|
-
jobName: Type.Optional(Type.String())
|
|
1051
|
-
}, { additionalProperties: false });
|
|
1052
|
-
//#endregion
|
|
1053
|
-
//#region src/gateway/protocol/schema/error-codes.ts
|
|
1054
|
-
const ErrorCodes = {
|
|
1055
|
-
NOT_LINKED: "NOT_LINKED",
|
|
1056
|
-
NOT_PAIRED: "NOT_PAIRED",
|
|
1057
|
-
AGENT_TIMEOUT: "AGENT_TIMEOUT",
|
|
1058
|
-
INVALID_REQUEST: "INVALID_REQUEST",
|
|
1059
|
-
UNAVAILABLE: "UNAVAILABLE"
|
|
1060
|
-
};
|
|
1061
|
-
function errorShape(code, message, opts) {
|
|
1062
|
-
return {
|
|
1063
|
-
code,
|
|
1064
|
-
message,
|
|
1065
|
-
...opts
|
|
1066
|
-
};
|
|
1067
|
-
}
|
|
1068
|
-
//#endregion
|
|
1069
|
-
//#region src/gateway/protocol/schema/exec-approvals.ts
|
|
1070
|
-
const ExecApprovalsAllowlistEntrySchema = Type.Object({
|
|
1071
|
-
id: Type.Optional(NonEmptyString),
|
|
1072
|
-
pattern: Type.String(),
|
|
1073
|
-
lastUsedAt: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
1074
|
-
lastUsedCommand: Type.Optional(Type.String()),
|
|
1075
|
-
lastResolvedPath: Type.Optional(Type.String())
|
|
1076
|
-
}, { additionalProperties: false });
|
|
1077
|
-
const ExecApprovalsPolicyFields = {
|
|
1078
|
-
security: Type.Optional(Type.String()),
|
|
1079
|
-
ask: Type.Optional(Type.String()),
|
|
1080
|
-
askFallback: Type.Optional(Type.String()),
|
|
1081
|
-
autoAllowSkills: Type.Optional(Type.Boolean())
|
|
1082
|
-
};
|
|
1083
|
-
const ExecApprovalsDefaultsSchema = Type.Object(ExecApprovalsPolicyFields, { additionalProperties: false });
|
|
1084
|
-
const ExecApprovalsAgentSchema = Type.Object({
|
|
1085
|
-
...ExecApprovalsPolicyFields,
|
|
1086
|
-
allowlist: Type.Optional(Type.Array(ExecApprovalsAllowlistEntrySchema))
|
|
1087
|
-
}, { additionalProperties: false });
|
|
1088
|
-
const ExecApprovalsFileSchema = Type.Object({
|
|
1089
|
-
version: Type.Literal(1),
|
|
1090
|
-
socket: Type.Optional(Type.Object({
|
|
1091
|
-
path: Type.Optional(Type.String()),
|
|
1092
|
-
token: Type.Optional(Type.String())
|
|
1093
|
-
}, { additionalProperties: false })),
|
|
1094
|
-
defaults: Type.Optional(ExecApprovalsDefaultsSchema),
|
|
1095
|
-
agents: Type.Optional(Type.Record(Type.String(), ExecApprovalsAgentSchema))
|
|
1096
|
-
}, { additionalProperties: false });
|
|
1097
|
-
Type.Object({
|
|
1098
|
-
path: NonEmptyString,
|
|
1099
|
-
exists: Type.Boolean(),
|
|
1100
|
-
hash: NonEmptyString,
|
|
1101
|
-
file: ExecApprovalsFileSchema
|
|
1102
|
-
}, { additionalProperties: false });
|
|
1103
|
-
const ExecApprovalsGetParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
1104
|
-
const ExecApprovalsSetParamsSchema = Type.Object({
|
|
1105
|
-
file: ExecApprovalsFileSchema,
|
|
1106
|
-
baseHash: Type.Optional(NonEmptyString)
|
|
1107
|
-
}, { additionalProperties: false });
|
|
1108
|
-
const ExecApprovalsNodeGetParamsSchema = Type.Object({ nodeId: NonEmptyString }, { additionalProperties: false });
|
|
1109
|
-
const ExecApprovalsNodeSetParamsSchema = Type.Object({
|
|
1110
|
-
nodeId: NonEmptyString,
|
|
1111
|
-
file: ExecApprovalsFileSchema,
|
|
1112
|
-
baseHash: Type.Optional(NonEmptyString)
|
|
1113
|
-
}, { additionalProperties: false });
|
|
1114
|
-
const ExecApprovalRequestParamsSchema = Type.Object({
|
|
1115
|
-
id: Type.Optional(NonEmptyString),
|
|
1116
|
-
command: Type.Optional(NonEmptyString),
|
|
1117
|
-
commandArgv: Type.Optional(Type.Array(Type.String())),
|
|
1118
|
-
systemRunPlan: Type.Optional(Type.Object({
|
|
1119
|
-
argv: Type.Array(Type.String()),
|
|
1120
|
-
cwd: Type.Union([Type.String(), Type.Null()]),
|
|
1121
|
-
commandText: Type.String(),
|
|
1122
|
-
commandPreview: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
1123
|
-
agentId: Type.Union([Type.String(), Type.Null()]),
|
|
1124
|
-
sessionKey: Type.Union([Type.String(), Type.Null()]),
|
|
1125
|
-
mutableFileOperand: Type.Optional(Type.Union([Type.Object({
|
|
1126
|
-
argvIndex: Type.Integer({ minimum: 0 }),
|
|
1127
|
-
path: Type.String(),
|
|
1128
|
-
sha256: Type.String()
|
|
1129
|
-
}, { additionalProperties: false }), Type.Null()]))
|
|
1130
|
-
}, { additionalProperties: false })),
|
|
1131
|
-
env: Type.Optional(Type.Record(NonEmptyString, Type.String())),
|
|
1132
|
-
cwd: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
1133
|
-
nodeId: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
1134
|
-
host: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
1135
|
-
security: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
1136
|
-
ask: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
1137
|
-
agentId: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
1138
|
-
resolvedPath: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
1139
|
-
sessionKey: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
1140
|
-
turnSourceChannel: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
1141
|
-
turnSourceTo: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
1142
|
-
turnSourceAccountId: Type.Optional(Type.Union([Type.String(), Type.Null()])),
|
|
1143
|
-
turnSourceThreadId: Type.Optional(Type.Union([
|
|
1144
|
-
Type.String(),
|
|
1145
|
-
Type.Number(),
|
|
1146
|
-
Type.Null()
|
|
1147
|
-
])),
|
|
1148
|
-
timeoutMs: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
1149
|
-
twoPhase: Type.Optional(Type.Boolean())
|
|
1150
|
-
}, { additionalProperties: false });
|
|
1151
|
-
const ExecApprovalResolveParamsSchema = Type.Object({
|
|
1152
|
-
id: NonEmptyString,
|
|
1153
|
-
decision: NonEmptyString
|
|
1154
|
-
}, { additionalProperties: false });
|
|
1155
|
-
//#endregion
|
|
1156
|
-
//#region src/gateway/protocol/schema/devices.ts
|
|
1157
|
-
const DevicePairListParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
1158
|
-
const DevicePairApproveParamsSchema = Type.Object({ requestId: NonEmptyString }, { additionalProperties: false });
|
|
1159
|
-
const DevicePairRejectParamsSchema = Type.Object({ requestId: NonEmptyString }, { additionalProperties: false });
|
|
1160
|
-
const DevicePairRemoveParamsSchema = Type.Object({ deviceId: NonEmptyString }, { additionalProperties: false });
|
|
1161
|
-
const DeviceTokenRotateParamsSchema = Type.Object({
|
|
1162
|
-
deviceId: NonEmptyString,
|
|
1163
|
-
role: NonEmptyString,
|
|
1164
|
-
scopes: Type.Optional(Type.Array(NonEmptyString))
|
|
1165
|
-
}, { additionalProperties: false });
|
|
1166
|
-
const DeviceTokenRevokeParamsSchema = Type.Object({
|
|
1167
|
-
deviceId: NonEmptyString,
|
|
1168
|
-
role: NonEmptyString
|
|
1169
|
-
}, { additionalProperties: false });
|
|
1170
|
-
Type.Object({
|
|
1171
|
-
requestId: NonEmptyString,
|
|
1172
|
-
deviceId: NonEmptyString,
|
|
1173
|
-
publicKey: NonEmptyString,
|
|
1174
|
-
displayName: Type.Optional(NonEmptyString),
|
|
1175
|
-
platform: Type.Optional(NonEmptyString),
|
|
1176
|
-
deviceFamily: Type.Optional(NonEmptyString),
|
|
1177
|
-
clientId: Type.Optional(NonEmptyString),
|
|
1178
|
-
clientMode: Type.Optional(NonEmptyString),
|
|
1179
|
-
role: Type.Optional(NonEmptyString),
|
|
1180
|
-
roles: Type.Optional(Type.Array(NonEmptyString)),
|
|
1181
|
-
scopes: Type.Optional(Type.Array(NonEmptyString)),
|
|
1182
|
-
remoteIp: Type.Optional(NonEmptyString),
|
|
1183
|
-
silent: Type.Optional(Type.Boolean()),
|
|
1184
|
-
isRepair: Type.Optional(Type.Boolean()),
|
|
1185
|
-
ts: Type.Integer({ minimum: 0 })
|
|
1186
|
-
}, { additionalProperties: false });
|
|
1187
|
-
Type.Object({
|
|
1188
|
-
requestId: NonEmptyString,
|
|
1189
|
-
deviceId: NonEmptyString,
|
|
1190
|
-
decision: NonEmptyString,
|
|
1191
|
-
ts: Type.Integer({ minimum: 0 })
|
|
1192
|
-
}, { additionalProperties: false });
|
|
1193
|
-
//#endregion
|
|
1194
|
-
//#region src/gateway/protocol/schema/snapshot.ts
|
|
1195
|
-
const PresenceEntrySchema = Type.Object({
|
|
1196
|
-
host: Type.Optional(NonEmptyString),
|
|
1197
|
-
ip: Type.Optional(NonEmptyString),
|
|
1198
|
-
version: Type.Optional(NonEmptyString),
|
|
1199
|
-
platform: Type.Optional(NonEmptyString),
|
|
1200
|
-
deviceFamily: Type.Optional(NonEmptyString),
|
|
1201
|
-
modelIdentifier: Type.Optional(NonEmptyString),
|
|
1202
|
-
mode: Type.Optional(NonEmptyString),
|
|
1203
|
-
lastInputSeconds: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
1204
|
-
reason: Type.Optional(NonEmptyString),
|
|
1205
|
-
tags: Type.Optional(Type.Array(NonEmptyString)),
|
|
1206
|
-
text: Type.Optional(Type.String()),
|
|
1207
|
-
ts: Type.Integer({ minimum: 0 }),
|
|
1208
|
-
deviceId: Type.Optional(NonEmptyString),
|
|
1209
|
-
roles: Type.Optional(Type.Array(NonEmptyString)),
|
|
1210
|
-
scopes: Type.Optional(Type.Array(NonEmptyString)),
|
|
1211
|
-
instanceId: Type.Optional(NonEmptyString)
|
|
1212
|
-
}, { additionalProperties: false });
|
|
1213
|
-
const HealthSnapshotSchema = Type.Any();
|
|
1214
|
-
const SessionDefaultsSchema = Type.Object({
|
|
1215
|
-
defaultAgentId: NonEmptyString,
|
|
1216
|
-
mainKey: NonEmptyString,
|
|
1217
|
-
mainSessionKey: NonEmptyString,
|
|
1218
|
-
scope: Type.Optional(NonEmptyString)
|
|
1219
|
-
}, { additionalProperties: false });
|
|
1220
|
-
const StateVersionSchema = Type.Object({
|
|
1221
|
-
presence: Type.Integer({ minimum: 0 }),
|
|
1222
|
-
health: Type.Integer({ minimum: 0 })
|
|
1223
|
-
}, { additionalProperties: false });
|
|
1224
|
-
const SnapshotSchema = Type.Object({
|
|
1225
|
-
presence: Type.Array(PresenceEntrySchema),
|
|
1226
|
-
health: HealthSnapshotSchema,
|
|
1227
|
-
stateVersion: StateVersionSchema,
|
|
1228
|
-
uptimeMs: Type.Integer({ minimum: 0 }),
|
|
1229
|
-
configPath: Type.Optional(NonEmptyString),
|
|
1230
|
-
stateDir: Type.Optional(NonEmptyString),
|
|
1231
|
-
sessionDefaults: Type.Optional(SessionDefaultsSchema),
|
|
1232
|
-
authMode: Type.Optional(Type.Union([
|
|
1233
|
-
Type.Literal("none"),
|
|
1234
|
-
Type.Literal("token"),
|
|
1235
|
-
Type.Literal("password"),
|
|
1236
|
-
Type.Literal("trusted-proxy")
|
|
1237
|
-
])),
|
|
1238
|
-
updateAvailable: Type.Optional(Type.Object({
|
|
1239
|
-
currentVersion: NonEmptyString,
|
|
1240
|
-
latestVersion: NonEmptyString,
|
|
1241
|
-
channel: NonEmptyString
|
|
1242
|
-
}))
|
|
1243
|
-
}, { additionalProperties: false });
|
|
1244
|
-
Type.Object({ ts: Type.Integer({ minimum: 0 }) }, { additionalProperties: false });
|
|
1245
|
-
Type.Object({
|
|
1246
|
-
reason: NonEmptyString,
|
|
1247
|
-
restartExpectedMs: Type.Optional(Type.Integer({ minimum: 0 }))
|
|
1248
|
-
}, { additionalProperties: false });
|
|
1249
|
-
const ConnectParamsSchema = Type.Object({
|
|
1250
|
-
minProtocol: Type.Integer({ minimum: 1 }),
|
|
1251
|
-
maxProtocol: Type.Integer({ minimum: 1 }),
|
|
1252
|
-
client: Type.Object({
|
|
1253
|
-
id: GatewayClientIdSchema,
|
|
1254
|
-
displayName: Type.Optional(NonEmptyString),
|
|
1255
|
-
version: NonEmptyString,
|
|
1256
|
-
platform: NonEmptyString,
|
|
1257
|
-
deviceFamily: Type.Optional(NonEmptyString),
|
|
1258
|
-
modelIdentifier: Type.Optional(NonEmptyString),
|
|
1259
|
-
mode: GatewayClientModeSchema,
|
|
1260
|
-
instanceId: Type.Optional(NonEmptyString)
|
|
1261
|
-
}, { additionalProperties: false }),
|
|
1262
|
-
caps: Type.Optional(Type.Array(NonEmptyString, { default: [] })),
|
|
1263
|
-
commands: Type.Optional(Type.Array(NonEmptyString)),
|
|
1264
|
-
permissions: Type.Optional(Type.Record(NonEmptyString, Type.Boolean())),
|
|
1265
|
-
pathEnv: Type.Optional(Type.String()),
|
|
1266
|
-
role: Type.Optional(NonEmptyString),
|
|
1267
|
-
scopes: Type.Optional(Type.Array(NonEmptyString)),
|
|
1268
|
-
device: Type.Optional(Type.Object({
|
|
1269
|
-
id: NonEmptyString,
|
|
1270
|
-
publicKey: NonEmptyString,
|
|
1271
|
-
signature: NonEmptyString,
|
|
1272
|
-
signedAt: Type.Integer({ minimum: 0 }),
|
|
1273
|
-
nonce: NonEmptyString
|
|
1274
|
-
}, { additionalProperties: false })),
|
|
1275
|
-
auth: Type.Optional(Type.Object({
|
|
1276
|
-
token: Type.Optional(Type.String()),
|
|
1277
|
-
bootstrapToken: Type.Optional(Type.String()),
|
|
1278
|
-
deviceToken: Type.Optional(Type.String()),
|
|
1279
|
-
password: Type.Optional(Type.String())
|
|
1280
|
-
}, { additionalProperties: false })),
|
|
1281
|
-
locale: Type.Optional(Type.String()),
|
|
1282
|
-
userAgent: Type.Optional(Type.String())
|
|
1283
|
-
}, { additionalProperties: false });
|
|
1284
|
-
Type.Object({
|
|
1285
|
-
type: Type.Literal("hello-ok"),
|
|
1286
|
-
protocol: Type.Integer({ minimum: 1 }),
|
|
1287
|
-
server: Type.Object({
|
|
1288
|
-
version: NonEmptyString,
|
|
1289
|
-
connId: NonEmptyString
|
|
1290
|
-
}, { additionalProperties: false }),
|
|
1291
|
-
features: Type.Object({
|
|
1292
|
-
methods: Type.Array(NonEmptyString),
|
|
1293
|
-
events: Type.Array(NonEmptyString)
|
|
1294
|
-
}, { additionalProperties: false }),
|
|
1295
|
-
snapshot: SnapshotSchema,
|
|
1296
|
-
canvasHostUrl: Type.Optional(NonEmptyString),
|
|
1297
|
-
auth: Type.Optional(Type.Object({
|
|
1298
|
-
deviceToken: NonEmptyString,
|
|
1299
|
-
role: NonEmptyString,
|
|
1300
|
-
scopes: Type.Array(NonEmptyString),
|
|
1301
|
-
issuedAtMs: Type.Optional(Type.Integer({ minimum: 0 }))
|
|
1302
|
-
}, { additionalProperties: false })),
|
|
1303
|
-
policy: Type.Object({
|
|
1304
|
-
maxPayload: Type.Integer({ minimum: 1 }),
|
|
1305
|
-
maxBufferedBytes: Type.Integer({ minimum: 1 }),
|
|
1306
|
-
tickIntervalMs: Type.Integer({ minimum: 1 })
|
|
1307
|
-
}, { additionalProperties: false })
|
|
1308
|
-
}, { additionalProperties: false });
|
|
1309
|
-
const ErrorShapeSchema = Type.Object({
|
|
1310
|
-
code: NonEmptyString,
|
|
1311
|
-
message: NonEmptyString,
|
|
1312
|
-
details: Type.Optional(Type.Unknown()),
|
|
1313
|
-
retryable: Type.Optional(Type.Boolean()),
|
|
1314
|
-
retryAfterMs: Type.Optional(Type.Integer({ minimum: 0 }))
|
|
1315
|
-
}, { additionalProperties: false });
|
|
1316
|
-
const RequestFrameSchema = Type.Object({
|
|
1317
|
-
type: Type.Literal("req"),
|
|
1318
|
-
id: NonEmptyString,
|
|
1319
|
-
method: NonEmptyString,
|
|
1320
|
-
params: Type.Optional(Type.Unknown())
|
|
1321
|
-
}, { additionalProperties: false });
|
|
1322
|
-
const ResponseFrameSchema = Type.Object({
|
|
1323
|
-
type: Type.Literal("res"),
|
|
1324
|
-
id: NonEmptyString,
|
|
1325
|
-
ok: Type.Boolean(),
|
|
1326
|
-
payload: Type.Optional(Type.Unknown()),
|
|
1327
|
-
error: Type.Optional(ErrorShapeSchema)
|
|
1328
|
-
}, { additionalProperties: false });
|
|
1329
|
-
const EventFrameSchema = Type.Object({
|
|
1330
|
-
type: Type.Literal("event"),
|
|
1331
|
-
event: NonEmptyString,
|
|
1332
|
-
payload: Type.Optional(Type.Unknown()),
|
|
1333
|
-
seq: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
1334
|
-
stateVersion: Type.Optional(StateVersionSchema)
|
|
1335
|
-
}, { additionalProperties: false });
|
|
1336
|
-
Type.Union([
|
|
1337
|
-
RequestFrameSchema,
|
|
1338
|
-
ResponseFrameSchema,
|
|
1339
|
-
EventFrameSchema
|
|
1340
|
-
], { discriminator: "type" });
|
|
1341
|
-
//#endregion
|
|
1342
|
-
//#region src/gateway/protocol/schema/logs-chat.ts
|
|
1343
|
-
const LogsTailParamsSchema = Type.Object({
|
|
1344
|
-
cursor: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
1345
|
-
limit: Type.Optional(Type.Integer({
|
|
1346
|
-
minimum: 1,
|
|
1347
|
-
maximum: 5e3
|
|
1348
|
-
})),
|
|
1349
|
-
maxBytes: Type.Optional(Type.Integer({
|
|
1350
|
-
minimum: 1,
|
|
1351
|
-
maximum: 1e6
|
|
1352
|
-
}))
|
|
1353
|
-
}, { additionalProperties: false });
|
|
1354
|
-
Type.Object({
|
|
1355
|
-
file: NonEmptyString,
|
|
1356
|
-
cursor: Type.Integer({ minimum: 0 }),
|
|
1357
|
-
size: Type.Integer({ minimum: 0 }),
|
|
1358
|
-
lines: Type.Array(Type.String()),
|
|
1359
|
-
truncated: Type.Optional(Type.Boolean()),
|
|
1360
|
-
reset: Type.Optional(Type.Boolean())
|
|
1361
|
-
}, { additionalProperties: false });
|
|
1362
|
-
const ChatHistoryParamsSchema = Type.Object({
|
|
1363
|
-
sessionKey: NonEmptyString,
|
|
1364
|
-
limit: Type.Optional(Type.Integer({
|
|
1365
|
-
minimum: 1,
|
|
1366
|
-
maximum: 1e3
|
|
1367
|
-
}))
|
|
1368
|
-
}, { additionalProperties: false });
|
|
1369
|
-
const ChatSendParamsSchema = Type.Object({
|
|
1370
|
-
sessionKey: ChatSendSessionKeyString,
|
|
1371
|
-
message: Type.String(),
|
|
1372
|
-
thinking: Type.Optional(Type.String()),
|
|
1373
|
-
deliver: Type.Optional(Type.Boolean()),
|
|
1374
|
-
attachments: Type.Optional(Type.Array(Type.Unknown())),
|
|
1375
|
-
timeoutMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
1376
|
-
systemInputProvenance: Type.Optional(InputProvenanceSchema),
|
|
1377
|
-
systemProvenanceReceipt: Type.Optional(Type.String()),
|
|
1378
|
-
idempotencyKey: NonEmptyString
|
|
1379
|
-
}, { additionalProperties: false });
|
|
1380
|
-
const ChatAbortParamsSchema = Type.Object({
|
|
1381
|
-
sessionKey: NonEmptyString,
|
|
1382
|
-
runId: Type.Optional(NonEmptyString)
|
|
1383
|
-
}, { additionalProperties: false });
|
|
1384
|
-
const ChatInjectParamsSchema = Type.Object({
|
|
1385
|
-
sessionKey: NonEmptyString,
|
|
1386
|
-
message: NonEmptyString,
|
|
1387
|
-
label: Type.Optional(Type.String({ maxLength: 100 }))
|
|
1388
|
-
}, { additionalProperties: false });
|
|
1389
|
-
const ChatEventSchema = Type.Object({
|
|
1390
|
-
runId: NonEmptyString,
|
|
1391
|
-
sessionKey: NonEmptyString,
|
|
1392
|
-
seq: Type.Integer({ minimum: 0 }),
|
|
1393
|
-
state: Type.Union([
|
|
1394
|
-
Type.Literal("delta"),
|
|
1395
|
-
Type.Literal("final"),
|
|
1396
|
-
Type.Literal("aborted"),
|
|
1397
|
-
Type.Literal("error")
|
|
1398
|
-
]),
|
|
1399
|
-
message: Type.Optional(Type.Unknown()),
|
|
1400
|
-
errorMessage: Type.Optional(Type.String()),
|
|
1401
|
-
usage: Type.Optional(Type.Unknown()),
|
|
1402
|
-
stopReason: Type.Optional(Type.String())
|
|
1403
|
-
}, { additionalProperties: false });
|
|
1404
|
-
//#endregion
|
|
1405
|
-
//#region src/gateway/protocol/schema/nodes.ts
|
|
1406
|
-
const NodePendingWorkTypeSchema = Type.String({ enum: ["status.request", "location.request"] });
|
|
1407
|
-
const NodePendingWorkPrioritySchema = Type.String({ enum: ["normal", "high"] });
|
|
1408
|
-
const NodePairRequestParamsSchema = Type.Object({
|
|
1409
|
-
nodeId: NonEmptyString,
|
|
1410
|
-
displayName: Type.Optional(NonEmptyString),
|
|
1411
|
-
platform: Type.Optional(NonEmptyString),
|
|
1412
|
-
version: Type.Optional(NonEmptyString),
|
|
1413
|
-
coreVersion: Type.Optional(NonEmptyString),
|
|
1414
|
-
uiVersion: Type.Optional(NonEmptyString),
|
|
1415
|
-
deviceFamily: Type.Optional(NonEmptyString),
|
|
1416
|
-
modelIdentifier: Type.Optional(NonEmptyString),
|
|
1417
|
-
caps: Type.Optional(Type.Array(NonEmptyString)),
|
|
1418
|
-
commands: Type.Optional(Type.Array(NonEmptyString)),
|
|
1419
|
-
remoteIp: Type.Optional(NonEmptyString),
|
|
1420
|
-
silent: Type.Optional(Type.Boolean())
|
|
1421
|
-
}, { additionalProperties: false });
|
|
1422
|
-
const NodePairListParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
1423
|
-
const NodePairApproveParamsSchema = Type.Object({ requestId: NonEmptyString }, { additionalProperties: false });
|
|
1424
|
-
const NodePairRejectParamsSchema = Type.Object({ requestId: NonEmptyString }, { additionalProperties: false });
|
|
1425
|
-
const NodePairVerifyParamsSchema = Type.Object({
|
|
1426
|
-
nodeId: NonEmptyString,
|
|
1427
|
-
token: NonEmptyString
|
|
1428
|
-
}, { additionalProperties: false });
|
|
1429
|
-
const NodeRenameParamsSchema = Type.Object({
|
|
1430
|
-
nodeId: NonEmptyString,
|
|
1431
|
-
displayName: NonEmptyString
|
|
1432
|
-
}, { additionalProperties: false });
|
|
1433
|
-
const NodeListParamsSchema = Type.Object({}, { additionalProperties: false });
|
|
1434
|
-
const NodePendingAckParamsSchema = Type.Object({ ids: Type.Array(NonEmptyString, { minItems: 1 }) }, { additionalProperties: false });
|
|
1435
|
-
const NodeDescribeParamsSchema = Type.Object({ nodeId: NonEmptyString }, { additionalProperties: false });
|
|
1436
|
-
const NodeInvokeParamsSchema = Type.Object({
|
|
1437
|
-
nodeId: NonEmptyString,
|
|
1438
|
-
command: NonEmptyString,
|
|
1439
|
-
params: Type.Optional(Type.Unknown()),
|
|
1440
|
-
timeoutMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
1441
|
-
idempotencyKey: NonEmptyString
|
|
1442
|
-
}, { additionalProperties: false });
|
|
1443
|
-
const NodeInvokeResultParamsSchema = Type.Object({
|
|
1444
|
-
id: NonEmptyString,
|
|
1445
|
-
nodeId: NonEmptyString,
|
|
1446
|
-
ok: Type.Boolean(),
|
|
1447
|
-
payload: Type.Optional(Type.Unknown()),
|
|
1448
|
-
payloadJSON: Type.Optional(Type.String()),
|
|
1449
|
-
error: Type.Optional(Type.Object({
|
|
1450
|
-
code: Type.Optional(NonEmptyString),
|
|
1451
|
-
message: Type.Optional(NonEmptyString)
|
|
1452
|
-
}, { additionalProperties: false }))
|
|
1453
|
-
}, { additionalProperties: false });
|
|
1454
|
-
const NodeEventParamsSchema = Type.Object({
|
|
1455
|
-
event: NonEmptyString,
|
|
1456
|
-
payload: Type.Optional(Type.Unknown()),
|
|
1457
|
-
payloadJSON: Type.Optional(Type.String())
|
|
1458
|
-
}, { additionalProperties: false });
|
|
1459
|
-
const NodePendingDrainParamsSchema = Type.Object({ maxItems: Type.Optional(Type.Integer({
|
|
1460
|
-
minimum: 1,
|
|
1461
|
-
maximum: 10
|
|
1462
|
-
})) }, { additionalProperties: false });
|
|
1463
|
-
const NodePendingDrainItemSchema = Type.Object({
|
|
1464
|
-
id: NonEmptyString,
|
|
1465
|
-
type: NodePendingWorkTypeSchema,
|
|
1466
|
-
priority: Type.String({ enum: [
|
|
1467
|
-
"default",
|
|
1468
|
-
"normal",
|
|
1469
|
-
"high"
|
|
1470
|
-
] }),
|
|
1471
|
-
createdAtMs: Type.Integer({ minimum: 0 }),
|
|
1472
|
-
expiresAtMs: Type.Optional(Type.Union([Type.Integer({ minimum: 0 }), Type.Null()])),
|
|
1473
|
-
payload: Type.Optional(Type.Record(Type.String(), Type.Unknown()))
|
|
1474
|
-
}, { additionalProperties: false });
|
|
1475
|
-
Type.Object({
|
|
1476
|
-
nodeId: NonEmptyString,
|
|
1477
|
-
revision: Type.Integer({ minimum: 0 }),
|
|
1478
|
-
items: Type.Array(NodePendingDrainItemSchema),
|
|
1479
|
-
hasMore: Type.Boolean()
|
|
1480
|
-
}, { additionalProperties: false });
|
|
1481
|
-
const NodePendingEnqueueParamsSchema = Type.Object({
|
|
1482
|
-
nodeId: NonEmptyString,
|
|
1483
|
-
type: NodePendingWorkTypeSchema,
|
|
1484
|
-
priority: Type.Optional(NodePendingWorkPrioritySchema),
|
|
1485
|
-
expiresInMs: Type.Optional(Type.Integer({
|
|
1486
|
-
minimum: 1e3,
|
|
1487
|
-
maximum: 864e5
|
|
1488
|
-
})),
|
|
1489
|
-
wake: Type.Optional(Type.Boolean())
|
|
1490
|
-
}, { additionalProperties: false });
|
|
1491
|
-
Type.Object({
|
|
1492
|
-
nodeId: NonEmptyString,
|
|
1493
|
-
revision: Type.Integer({ minimum: 0 }),
|
|
1494
|
-
queued: NodePendingDrainItemSchema,
|
|
1495
|
-
wakeTriggered: Type.Boolean()
|
|
1496
|
-
}, { additionalProperties: false });
|
|
1497
|
-
Type.Object({
|
|
1498
|
-
id: NonEmptyString,
|
|
1499
|
-
nodeId: NonEmptyString,
|
|
1500
|
-
command: NonEmptyString,
|
|
1501
|
-
paramsJSON: Type.Optional(Type.String()),
|
|
1502
|
-
timeoutMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
1503
|
-
idempotencyKey: Type.Optional(NonEmptyString)
|
|
1504
|
-
}, { additionalProperties: false });
|
|
1505
|
-
//#endregion
|
|
1506
|
-
//#region src/gateway/protocol/schema/push.ts
|
|
1507
|
-
const ApnsEnvironmentSchema = Type.String({ enum: ["sandbox", "production"] });
|
|
1508
|
-
const PushTestParamsSchema = Type.Object({
|
|
1509
|
-
nodeId: NonEmptyString,
|
|
1510
|
-
title: Type.Optional(Type.String()),
|
|
1511
|
-
body: Type.Optional(Type.String()),
|
|
1512
|
-
environment: Type.Optional(ApnsEnvironmentSchema)
|
|
1513
|
-
}, { additionalProperties: false });
|
|
1514
|
-
Type.Object({
|
|
1515
|
-
ok: Type.Boolean(),
|
|
1516
|
-
status: Type.Integer(),
|
|
1517
|
-
apnsId: Type.Optional(Type.String()),
|
|
1518
|
-
reason: Type.Optional(Type.String()),
|
|
1519
|
-
tokenSuffix: Type.String(),
|
|
1520
|
-
topic: Type.String(),
|
|
1521
|
-
environment: ApnsEnvironmentSchema,
|
|
1522
|
-
transport: Type.String({ enum: ["direct", "relay"] })
|
|
1523
|
-
}, { additionalProperties: false });
|
|
1524
|
-
Type.Object({}, { additionalProperties: false });
|
|
1525
|
-
const SecretsResolveParamsSchema = Type.Object({
|
|
1526
|
-
commandName: NonEmptyString,
|
|
1527
|
-
targetIds: Type.Array(NonEmptyString)
|
|
1528
|
-
}, { additionalProperties: false });
|
|
1529
|
-
const SecretsResolveAssignmentSchema = Type.Object({
|
|
1530
|
-
path: Type.Optional(NonEmptyString),
|
|
1531
|
-
pathSegments: Type.Array(NonEmptyString),
|
|
1532
|
-
value: Type.Unknown()
|
|
1533
|
-
}, { additionalProperties: false });
|
|
1534
|
-
const SecretsResolveResultSchema = Type.Object({
|
|
1535
|
-
ok: Type.Optional(Type.Boolean()),
|
|
1536
|
-
assignments: Type.Optional(Type.Array(SecretsResolveAssignmentSchema)),
|
|
1537
|
-
diagnostics: Type.Optional(Type.Array(NonEmptyString)),
|
|
1538
|
-
inactiveRefPaths: Type.Optional(Type.Array(NonEmptyString))
|
|
1539
|
-
}, { additionalProperties: false });
|
|
1540
|
-
//#endregion
|
|
1541
|
-
//#region src/gateway/protocol/schema/sessions.ts
|
|
1542
|
-
const SessionsListParamsSchema = Type.Object({
|
|
1543
|
-
limit: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
1544
|
-
activeMinutes: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
1545
|
-
includeGlobal: Type.Optional(Type.Boolean()),
|
|
1546
|
-
includeUnknown: Type.Optional(Type.Boolean()),
|
|
1547
|
-
includeDerivedTitles: Type.Optional(Type.Boolean()),
|
|
1548
|
-
includeLastMessage: Type.Optional(Type.Boolean()),
|
|
1549
|
-
label: Type.Optional(SessionLabelString),
|
|
1550
|
-
spawnedBy: Type.Optional(NonEmptyString),
|
|
1551
|
-
agentId: Type.Optional(NonEmptyString),
|
|
1552
|
-
search: Type.Optional(Type.String())
|
|
1553
|
-
}, { additionalProperties: false });
|
|
1554
|
-
const SessionsPreviewParamsSchema = Type.Object({
|
|
1555
|
-
keys: Type.Array(NonEmptyString, { minItems: 1 }),
|
|
1556
|
-
limit: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
1557
|
-
maxChars: Type.Optional(Type.Integer({ minimum: 20 }))
|
|
1558
|
-
}, { additionalProperties: false });
|
|
1559
|
-
const SessionsResolveParamsSchema = Type.Object({
|
|
1560
|
-
key: Type.Optional(NonEmptyString),
|
|
1561
|
-
sessionId: Type.Optional(NonEmptyString),
|
|
1562
|
-
label: Type.Optional(SessionLabelString),
|
|
1563
|
-
agentId: Type.Optional(NonEmptyString),
|
|
1564
|
-
spawnedBy: Type.Optional(NonEmptyString),
|
|
1565
|
-
includeGlobal: Type.Optional(Type.Boolean()),
|
|
1566
|
-
includeUnknown: Type.Optional(Type.Boolean())
|
|
1567
|
-
}, { additionalProperties: false });
|
|
1568
|
-
const SessionsPatchParamsSchema = Type.Object({
|
|
1569
|
-
key: NonEmptyString,
|
|
1570
|
-
label: Type.Optional(Type.Union([SessionLabelString, Type.Null()])),
|
|
1571
|
-
thinkingLevel: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
1572
|
-
fastMode: Type.Optional(Type.Union([Type.Boolean(), Type.Null()])),
|
|
1573
|
-
verboseLevel: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
1574
|
-
reasoningLevel: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
1575
|
-
responseUsage: Type.Optional(Type.Union([
|
|
1576
|
-
Type.Literal("off"),
|
|
1577
|
-
Type.Literal("tokens"),
|
|
1578
|
-
Type.Literal("full"),
|
|
1579
|
-
Type.Literal("on"),
|
|
1580
|
-
Type.Null()
|
|
1581
|
-
])),
|
|
1582
|
-
elevatedLevel: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
1583
|
-
execHost: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
1584
|
-
execSecurity: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
1585
|
-
execAsk: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
1586
|
-
execNode: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
1587
|
-
model: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
1588
|
-
spawnedBy: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
1589
|
-
spawnedWorkspaceDir: Type.Optional(Type.Union([NonEmptyString, Type.Null()])),
|
|
1590
|
-
spawnDepth: Type.Optional(Type.Union([Type.Integer({ minimum: 0 }), Type.Null()])),
|
|
1591
|
-
subagentRole: Type.Optional(Type.Union([
|
|
1592
|
-
Type.Literal("orchestrator"),
|
|
1593
|
-
Type.Literal("leaf"),
|
|
1594
|
-
Type.Null()
|
|
1595
|
-
])),
|
|
1596
|
-
subagentControlScope: Type.Optional(Type.Union([
|
|
1597
|
-
Type.Literal("children"),
|
|
1598
|
-
Type.Literal("none"),
|
|
1599
|
-
Type.Null()
|
|
1600
|
-
])),
|
|
1601
|
-
sendPolicy: Type.Optional(Type.Union([
|
|
1602
|
-
Type.Literal("allow"),
|
|
1603
|
-
Type.Literal("deny"),
|
|
1604
|
-
Type.Null()
|
|
1605
|
-
])),
|
|
1606
|
-
groupActivation: Type.Optional(Type.Union([
|
|
1607
|
-
Type.Literal("mention"),
|
|
1608
|
-
Type.Literal("always"),
|
|
1609
|
-
Type.Null()
|
|
1610
|
-
]))
|
|
1611
|
-
}, { additionalProperties: false });
|
|
1612
|
-
const SessionsResetParamsSchema = Type.Object({
|
|
1613
|
-
key: NonEmptyString,
|
|
1614
|
-
reason: Type.Optional(Type.Union([Type.Literal("new"), Type.Literal("reset")]))
|
|
1615
|
-
}, { additionalProperties: false });
|
|
1616
|
-
const SessionsDeleteParamsSchema = Type.Object({
|
|
1617
|
-
key: NonEmptyString,
|
|
1618
|
-
deleteTranscript: Type.Optional(Type.Boolean()),
|
|
1619
|
-
emitLifecycleHooks: Type.Optional(Type.Boolean())
|
|
1620
|
-
}, { additionalProperties: false });
|
|
1621
|
-
const SessionsCompactParamsSchema = Type.Object({
|
|
1622
|
-
key: NonEmptyString,
|
|
1623
|
-
maxLines: Type.Optional(Type.Integer({ minimum: 1 }))
|
|
1624
|
-
}, { additionalProperties: false });
|
|
1625
|
-
const SessionsUsageParamsSchema = Type.Object({
|
|
1626
|
-
key: Type.Optional(NonEmptyString),
|
|
1627
|
-
startDate: Type.Optional(Type.String({ pattern: "^\\d{4}-\\d{2}-\\d{2}$" })),
|
|
1628
|
-
endDate: Type.Optional(Type.String({ pattern: "^\\d{4}-\\d{2}-\\d{2}$" })),
|
|
1629
|
-
mode: Type.Optional(Type.Union([
|
|
1630
|
-
Type.Literal("utc"),
|
|
1631
|
-
Type.Literal("gateway"),
|
|
1632
|
-
Type.Literal("specific")
|
|
1633
|
-
])),
|
|
1634
|
-
utcOffset: Type.Optional(Type.String({ pattern: "^UTC[+-]\\d{1,2}(?::[0-5]\\d)?$" })),
|
|
1635
|
-
limit: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
1636
|
-
includeContextWeight: Type.Optional(Type.Boolean())
|
|
1637
|
-
}, { additionalProperties: false });
|
|
1638
|
-
//#endregion
|
|
1639
|
-
//#region src/gateway/protocol/schema/wizard.ts
|
|
1640
|
-
const WizardRunStatusSchema = Type.Union([
|
|
1641
|
-
Type.Literal("running"),
|
|
1642
|
-
Type.Literal("done"),
|
|
1643
|
-
Type.Literal("cancelled"),
|
|
1644
|
-
Type.Literal("error")
|
|
1645
|
-
]);
|
|
1646
|
-
const WizardStartParamsSchema = Type.Object({
|
|
1647
|
-
mode: Type.Optional(Type.Union([Type.Literal("local"), Type.Literal("remote")])),
|
|
1648
|
-
workspace: Type.Optional(Type.String())
|
|
1649
|
-
}, { additionalProperties: false });
|
|
1650
|
-
const WizardAnswerSchema = Type.Object({
|
|
1651
|
-
stepId: NonEmptyString,
|
|
1652
|
-
value: Type.Optional(Type.Unknown())
|
|
1653
|
-
}, { additionalProperties: false });
|
|
1654
|
-
const WizardNextParamsSchema = Type.Object({
|
|
1655
|
-
sessionId: NonEmptyString,
|
|
1656
|
-
answer: Type.Optional(WizardAnswerSchema)
|
|
1657
|
-
}, { additionalProperties: false });
|
|
1658
|
-
const WizardSessionIdParamsSchema = Type.Object({ sessionId: NonEmptyString }, { additionalProperties: false });
|
|
1659
|
-
const WizardCancelParamsSchema = WizardSessionIdParamsSchema;
|
|
1660
|
-
const WizardStatusParamsSchema = WizardSessionIdParamsSchema;
|
|
1661
|
-
const WizardStepOptionSchema = Type.Object({
|
|
1662
|
-
value: Type.Unknown(),
|
|
1663
|
-
label: NonEmptyString,
|
|
1664
|
-
hint: Type.Optional(Type.String())
|
|
1665
|
-
}, { additionalProperties: false });
|
|
1666
|
-
const WizardStepSchema = Type.Object({
|
|
1667
|
-
id: NonEmptyString,
|
|
1668
|
-
type: Type.Union([
|
|
1669
|
-
Type.Literal("note"),
|
|
1670
|
-
Type.Literal("select"),
|
|
1671
|
-
Type.Literal("text"),
|
|
1672
|
-
Type.Literal("confirm"),
|
|
1673
|
-
Type.Literal("multiselect"),
|
|
1674
|
-
Type.Literal("progress"),
|
|
1675
|
-
Type.Literal("action")
|
|
1676
|
-
]),
|
|
1677
|
-
title: Type.Optional(Type.String()),
|
|
1678
|
-
message: Type.Optional(Type.String()),
|
|
1679
|
-
options: Type.Optional(Type.Array(WizardStepOptionSchema)),
|
|
1680
|
-
initialValue: Type.Optional(Type.Unknown()),
|
|
1681
|
-
placeholder: Type.Optional(Type.String()),
|
|
1682
|
-
sensitive: Type.Optional(Type.Boolean()),
|
|
1683
|
-
executor: Type.Optional(Type.Union([Type.Literal("gateway"), Type.Literal("client")]))
|
|
1684
|
-
}, { additionalProperties: false });
|
|
1685
|
-
const WizardResultFields = {
|
|
1686
|
-
done: Type.Boolean(),
|
|
1687
|
-
step: Type.Optional(WizardStepSchema),
|
|
1688
|
-
status: Type.Optional(WizardRunStatusSchema),
|
|
1689
|
-
error: Type.Optional(Type.String())
|
|
1690
|
-
};
|
|
1691
|
-
Type.Object(WizardResultFields, { additionalProperties: false });
|
|
1692
|
-
Type.Object({
|
|
1693
|
-
sessionId: NonEmptyString,
|
|
1694
|
-
...WizardResultFields
|
|
1695
|
-
}, { additionalProperties: false });
|
|
1696
|
-
Type.Object({
|
|
1697
|
-
status: WizardRunStatusSchema,
|
|
1698
|
-
error: Type.Optional(Type.String())
|
|
1699
|
-
}, { additionalProperties: false });
|
|
1700
|
-
//#endregion
|
|
1701
|
-
//#region src/gateway/protocol/index.ts
|
|
1702
|
-
const ajv = new Ajv({
|
|
1703
|
-
allErrors: true,
|
|
1704
|
-
strict: false,
|
|
1705
|
-
removeAdditional: false
|
|
1706
|
-
});
|
|
1707
|
-
const validateConnectParams = ajv.compile(ConnectParamsSchema);
|
|
1708
|
-
const validateRequestFrame = ajv.compile(RequestFrameSchema);
|
|
1709
|
-
const validateResponseFrame = ajv.compile(ResponseFrameSchema);
|
|
1710
|
-
const validateEventFrame = ajv.compile(EventFrameSchema);
|
|
1711
|
-
const validateSendParams = ajv.compile(SendParamsSchema);
|
|
1712
|
-
const validatePollParams = ajv.compile(PollParamsSchema);
|
|
1713
|
-
const validateAgentParams = ajv.compile(AgentParamsSchema);
|
|
1714
|
-
const validateAgentIdentityParams = ajv.compile(AgentIdentityParamsSchema);
|
|
1715
|
-
const validateAgentWaitParams = ajv.compile(AgentWaitParamsSchema);
|
|
1716
|
-
const validateWakeParams = ajv.compile(WakeParamsSchema);
|
|
1717
|
-
const validateAgentsListParams = ajv.compile(AgentsListParamsSchema);
|
|
1718
|
-
const validateAgentsCreateParams = ajv.compile(AgentsCreateParamsSchema);
|
|
1719
|
-
const validateAgentsUpdateParams = ajv.compile(AgentsUpdateParamsSchema);
|
|
1720
|
-
const validateAgentsDeleteParams = ajv.compile(AgentsDeleteParamsSchema);
|
|
1721
|
-
const validateAgentsFilesListParams = ajv.compile(AgentsFilesListParamsSchema);
|
|
1722
|
-
const validateAgentsFilesGetParams = ajv.compile(AgentsFilesGetParamsSchema);
|
|
1723
|
-
const validateAgentsFilesSetParams = ajv.compile(AgentsFilesSetParamsSchema);
|
|
1724
|
-
const validateNodePairRequestParams = ajv.compile(NodePairRequestParamsSchema);
|
|
1725
|
-
const validateNodePairListParams = ajv.compile(NodePairListParamsSchema);
|
|
1726
|
-
const validateNodePairApproveParams = ajv.compile(NodePairApproveParamsSchema);
|
|
1727
|
-
const validateNodePairRejectParams = ajv.compile(NodePairRejectParamsSchema);
|
|
1728
|
-
const validateNodePairVerifyParams = ajv.compile(NodePairVerifyParamsSchema);
|
|
1729
|
-
const validateNodeRenameParams = ajv.compile(NodeRenameParamsSchema);
|
|
1730
|
-
const validateNodeListParams = ajv.compile(NodeListParamsSchema);
|
|
1731
|
-
const validateNodePendingAckParams = ajv.compile(NodePendingAckParamsSchema);
|
|
1732
|
-
const validateNodeDescribeParams = ajv.compile(NodeDescribeParamsSchema);
|
|
1733
|
-
const validateNodeInvokeParams = ajv.compile(NodeInvokeParamsSchema);
|
|
1734
|
-
const validateNodeInvokeResultParams = ajv.compile(NodeInvokeResultParamsSchema);
|
|
1735
|
-
const validateNodeEventParams = ajv.compile(NodeEventParamsSchema);
|
|
1736
|
-
const validateNodePendingDrainParams = ajv.compile(NodePendingDrainParamsSchema);
|
|
1737
|
-
const validateNodePendingEnqueueParams = ajv.compile(NodePendingEnqueueParamsSchema);
|
|
1738
|
-
const validatePushTestParams = ajv.compile(PushTestParamsSchema);
|
|
1739
|
-
const validateSecretsResolveParams = ajv.compile(SecretsResolveParamsSchema);
|
|
1740
|
-
const validateSecretsResolveResult = ajv.compile(SecretsResolveResultSchema);
|
|
1741
|
-
const validateSessionsListParams = ajv.compile(SessionsListParamsSchema);
|
|
1742
|
-
const validateSessionsPreviewParams = ajv.compile(SessionsPreviewParamsSchema);
|
|
1743
|
-
const validateSessionsResolveParams = ajv.compile(SessionsResolveParamsSchema);
|
|
1744
|
-
const validateSessionsPatchParams = ajv.compile(SessionsPatchParamsSchema);
|
|
1745
|
-
const validateSessionsResetParams = ajv.compile(SessionsResetParamsSchema);
|
|
1746
|
-
const validateSessionsDeleteParams = ajv.compile(SessionsDeleteParamsSchema);
|
|
1747
|
-
const validateSessionsCompactParams = ajv.compile(SessionsCompactParamsSchema);
|
|
1748
|
-
const validateSessionsUsageParams = ajv.compile(SessionsUsageParamsSchema);
|
|
1749
|
-
const validateConfigGetParams = ajv.compile(ConfigGetParamsSchema);
|
|
1750
|
-
const validateConfigSetParams = ajv.compile(ConfigSetParamsSchema);
|
|
1751
|
-
const validateConfigApplyParams = ajv.compile(ConfigApplyParamsSchema);
|
|
1752
|
-
const validateConfigPatchParams = ajv.compile(ConfigPatchParamsSchema);
|
|
1753
|
-
const validateConfigSchemaParams = ajv.compile(ConfigSchemaParamsSchema);
|
|
1754
|
-
const validateConfigSchemaLookupParams = ajv.compile(ConfigSchemaLookupParamsSchema);
|
|
1755
|
-
const validateConfigSchemaLookupResult = ajv.compile(ConfigSchemaLookupResultSchema);
|
|
1756
|
-
const validateWizardStartParams = ajv.compile(WizardStartParamsSchema);
|
|
1757
|
-
const validateWizardNextParams = ajv.compile(WizardNextParamsSchema);
|
|
1758
|
-
const validateWizardCancelParams = ajv.compile(WizardCancelParamsSchema);
|
|
1759
|
-
const validateWizardStatusParams = ajv.compile(WizardStatusParamsSchema);
|
|
1760
|
-
const validateTalkModeParams = ajv.compile(TalkModeParamsSchema);
|
|
1761
|
-
const validateTalkConfigParams = ajv.compile(TalkConfigParamsSchema);
|
|
1762
|
-
ajv.compile(TalkConfigResultSchema);
|
|
1763
|
-
const validateChannelsStatusParams = ajv.compile(ChannelsStatusParamsSchema);
|
|
1764
|
-
const validateChannelsLogoutParams = ajv.compile(ChannelsLogoutParamsSchema);
|
|
1765
|
-
const validateModelsListParams = ajv.compile(ModelsListParamsSchema);
|
|
1766
|
-
const validateSkillsStatusParams = ajv.compile(SkillsStatusParamsSchema);
|
|
1767
|
-
const validateToolsCatalogParams = ajv.compile(ToolsCatalogParamsSchema);
|
|
1768
|
-
const validateSkillsBinsParams = ajv.compile(SkillsBinsParamsSchema);
|
|
1769
|
-
const validateSkillsInstallParams = ajv.compile(SkillsInstallParamsSchema);
|
|
1770
|
-
const validateSkillsUpdateParams = ajv.compile(SkillsUpdateParamsSchema);
|
|
1771
|
-
const validateCronListParams = ajv.compile(CronListParamsSchema);
|
|
1772
|
-
const validateCronStatusParams = ajv.compile(CronStatusParamsSchema);
|
|
1773
|
-
const validateCronAddParams = ajv.compile(CronAddParamsSchema);
|
|
1774
|
-
const validateCronUpdateParams = ajv.compile(CronUpdateParamsSchema);
|
|
1775
|
-
const validateCronRemoveParams = ajv.compile(CronRemoveParamsSchema);
|
|
1776
|
-
const validateCronRunParams = ajv.compile(CronRunParamsSchema);
|
|
1777
|
-
const validateCronRunsParams = ajv.compile(CronRunsParamsSchema);
|
|
1778
|
-
const validateDevicePairListParams = ajv.compile(DevicePairListParamsSchema);
|
|
1779
|
-
const validateDevicePairApproveParams = ajv.compile(DevicePairApproveParamsSchema);
|
|
1780
|
-
const validateDevicePairRejectParams = ajv.compile(DevicePairRejectParamsSchema);
|
|
1781
|
-
const validateDevicePairRemoveParams = ajv.compile(DevicePairRemoveParamsSchema);
|
|
1782
|
-
const validateDeviceTokenRotateParams = ajv.compile(DeviceTokenRotateParamsSchema);
|
|
1783
|
-
const validateDeviceTokenRevokeParams = ajv.compile(DeviceTokenRevokeParamsSchema);
|
|
1784
|
-
const validateExecApprovalsGetParams = ajv.compile(ExecApprovalsGetParamsSchema);
|
|
1785
|
-
const validateExecApprovalsSetParams = ajv.compile(ExecApprovalsSetParamsSchema);
|
|
1786
|
-
const validateExecApprovalRequestParams = ajv.compile(ExecApprovalRequestParamsSchema);
|
|
1787
|
-
const validateExecApprovalResolveParams = ajv.compile(ExecApprovalResolveParamsSchema);
|
|
1788
|
-
const validateExecApprovalsNodeGetParams = ajv.compile(ExecApprovalsNodeGetParamsSchema);
|
|
1789
|
-
const validateExecApprovalsNodeSetParams = ajv.compile(ExecApprovalsNodeSetParamsSchema);
|
|
1790
|
-
const validateLogsTailParams = ajv.compile(LogsTailParamsSchema);
|
|
1791
|
-
const validateChatHistoryParams = ajv.compile(ChatHistoryParamsSchema);
|
|
1792
|
-
const validateChatSendParams = ajv.compile(ChatSendParamsSchema);
|
|
1793
|
-
const validateChatAbortParams = ajv.compile(ChatAbortParamsSchema);
|
|
1794
|
-
const validateChatInjectParams = ajv.compile(ChatInjectParamsSchema);
|
|
1795
|
-
ajv.compile(ChatEventSchema);
|
|
1796
|
-
const validateUpdateRunParams = ajv.compile(UpdateRunParamsSchema);
|
|
1797
|
-
const validateWebLoginStartParams = ajv.compile(WebLoginStartParamsSchema);
|
|
1798
|
-
const validateWebLoginWaitParams = ajv.compile(WebLoginWaitParamsSchema);
|
|
1799
|
-
function formatValidationErrors(errors) {
|
|
1800
|
-
if (!errors?.length) return "unknown validation error";
|
|
1801
|
-
const parts = [];
|
|
1802
|
-
for (const err of errors) {
|
|
1803
|
-
const keyword = typeof err?.keyword === "string" ? err.keyword : "";
|
|
1804
|
-
const instancePath = typeof err?.instancePath === "string" ? err.instancePath : "";
|
|
1805
|
-
if (keyword === "additionalProperties") {
|
|
1806
|
-
const additionalProperty = (err?.params)?.additionalProperty;
|
|
1807
|
-
if (typeof additionalProperty === "string" && additionalProperty.trim()) {
|
|
1808
|
-
const where = instancePath ? `at ${instancePath}` : "at root";
|
|
1809
|
-
parts.push(`${where}: unexpected property '${additionalProperty}'`);
|
|
1810
|
-
continue;
|
|
1811
|
-
}
|
|
1812
|
-
}
|
|
1813
|
-
const message = typeof err?.message === "string" && err.message.trim() ? err.message : "validation error";
|
|
1814
|
-
const where = instancePath ? `at ${instancePath}: ` : "";
|
|
1815
|
-
parts.push(`${where}${message}`);
|
|
1816
|
-
}
|
|
1817
|
-
const unique = Array.from(new Set(parts.filter((part) => part.trim())));
|
|
1818
|
-
if (!unique.length) return ajv.errorsText(errors, { separator: "; " }) || "unknown validation error";
|
|
1819
|
-
return unique.join("; ");
|
|
1820
|
-
}
|
|
1821
|
-
//#endregion
|
|
1822
|
-
//#region src/gateway/client.ts
|
|
1823
|
-
var GatewayClientRequestError = class extends Error {
|
|
1824
|
-
constructor(error) {
|
|
1825
|
-
super(error.message ?? "gateway request failed");
|
|
1826
|
-
this.name = "GatewayClientRequestError";
|
|
1827
|
-
this.gatewayCode = error.code ?? "UNAVAILABLE";
|
|
1828
|
-
this.details = error.details;
|
|
1829
|
-
}
|
|
1830
|
-
};
|
|
1831
|
-
const FORCE_STOP_TERMINATE_GRACE_MS = 250;
|
|
1832
|
-
const STOP_AND_WAIT_TIMEOUT_MS = 1e3;
|
|
1833
|
-
var GatewayClient = class {
|
|
1834
|
-
constructor(opts) {
|
|
1835
|
-
this.ws = null;
|
|
1836
|
-
this.pending = /* @__PURE__ */ new Map();
|
|
1837
|
-
this.backoffMs = 1e3;
|
|
1838
|
-
this.closed = false;
|
|
1839
|
-
this.lastSeq = null;
|
|
1840
|
-
this.connectNonce = null;
|
|
1841
|
-
this.connectSent = false;
|
|
1842
|
-
this.connectTimer = null;
|
|
1843
|
-
this.pendingDeviceTokenRetry = false;
|
|
1844
|
-
this.deviceTokenRetryBudgetUsed = false;
|
|
1845
|
-
this.pendingConnectErrorDetailCode = null;
|
|
1846
|
-
this.lastTick = null;
|
|
1847
|
-
this.tickIntervalMs = 3e4;
|
|
1848
|
-
this.tickTimer = null;
|
|
1849
|
-
this.pendingStop = null;
|
|
1850
|
-
this.opts = {
|
|
1851
|
-
...opts,
|
|
1852
|
-
deviceIdentity: opts.deviceIdentity === null ? void 0 : opts.deviceIdentity ?? loadOrCreateDeviceIdentity()
|
|
1853
|
-
};
|
|
1854
|
-
this.requestTimeoutMs = typeof opts.requestTimeoutMs === "number" && Number.isFinite(opts.requestTimeoutMs) ? Math.max(1, Math.min(Math.floor(opts.requestTimeoutMs), 2147483647)) : 3e4;
|
|
1855
|
-
}
|
|
1856
|
-
start() {
|
|
1857
|
-
if (this.closed) return;
|
|
1858
|
-
const url = this.opts.url ?? "ws://127.0.0.1:28789";
|
|
1859
|
-
if (this.opts.tlsFingerprint && !url.startsWith("wss://")) {
|
|
1860
|
-
this.opts.onConnectError?.(/* @__PURE__ */ new Error("gateway tls fingerprint requires wss:// gateway url"));
|
|
1861
|
-
return;
|
|
1862
|
-
}
|
|
1863
|
-
const allowPrivateWs = process.env.MOLDCLAW_ALLOW_INSECURE_PRIVATE_WS === "1";
|
|
1864
|
-
if (!isSecureWebSocketUrl(url, { allowPrivateWs })) {
|
|
1865
|
-
let displayHost = url;
|
|
1866
|
-
try {
|
|
1867
|
-
displayHost = new URL(url).hostname || url;
|
|
1868
|
-
} catch {}
|
|
1869
|
-
const error = /* @__PURE__ */ new Error(`SECURITY ERROR: Cannot connect to "${displayHost}" over plaintext ws://. Both credentials and chat data would be exposed to network interception. Use wss:// for remote URLs. Safe defaults: keep gateway.bind=loopback and connect via SSH tunnel (ssh -N -L 28789:127.0.0.1:28789 user@gateway-host), or use Tailscale Serve/Funnel. ` + (allowPrivateWs ? "" : "Break-glass (trusted private networks only): set MOLDCLAW_ALLOW_INSECURE_PRIVATE_WS=1. ") + "Run `moldclaw doctor --fix` for guidance.");
|
|
1870
|
-
this.opts.onConnectError?.(error);
|
|
1871
|
-
return;
|
|
1872
|
-
}
|
|
1873
|
-
const wsOptions = { maxPayload: 25 * 1024 * 1024 };
|
|
1874
|
-
if (url.startsWith("wss://") && this.opts.tlsFingerprint) {
|
|
1875
|
-
wsOptions.rejectUnauthorized = false;
|
|
1876
|
-
wsOptions.checkServerIdentity = ((_host, cert) => {
|
|
1877
|
-
const fingerprintValue = typeof cert === "object" && cert && "fingerprint256" in cert ? cert.fingerprint256 ?? "" : "";
|
|
1878
|
-
const fingerprint = normalizeFingerprint(typeof fingerprintValue === "string" ? fingerprintValue : "");
|
|
1879
|
-
const expected = normalizeFingerprint(this.opts.tlsFingerprint ?? "");
|
|
1880
|
-
if (!expected) return /* @__PURE__ */ new Error("gateway tls fingerprint missing");
|
|
1881
|
-
if (!fingerprint) return /* @__PURE__ */ new Error("gateway tls fingerprint unavailable");
|
|
1882
|
-
if (fingerprint !== expected) return /* @__PURE__ */ new Error("gateway tls fingerprint mismatch");
|
|
1883
|
-
});
|
|
1884
|
-
}
|
|
1885
|
-
const ws = new WebSocket(url, wsOptions);
|
|
1886
|
-
this.ws = ws;
|
|
1887
|
-
ws.on("open", () => {
|
|
1888
|
-
if (url.startsWith("wss://") && this.opts.tlsFingerprint) {
|
|
1889
|
-
const tlsError = this.validateTlsFingerprint();
|
|
1890
|
-
if (tlsError) {
|
|
1891
|
-
this.opts.onConnectError?.(tlsError);
|
|
1892
|
-
this.ws?.close(1008, tlsError.message);
|
|
1893
|
-
return;
|
|
1894
|
-
}
|
|
1895
|
-
}
|
|
1896
|
-
this.queueConnect();
|
|
1897
|
-
});
|
|
1898
|
-
ws.on("message", (data) => this.handleMessage(rawDataToString(data)));
|
|
1899
|
-
ws.on("close", (code, reason) => {
|
|
1900
|
-
const reasonText = rawDataToString(reason);
|
|
1901
|
-
const connectErrorDetailCode = this.pendingConnectErrorDetailCode;
|
|
1902
|
-
this.pendingConnectErrorDetailCode = null;
|
|
1903
|
-
if (this.ws === ws) this.ws = null;
|
|
1904
|
-
this.resolvePendingStop(ws);
|
|
1905
|
-
if (code === 1008 && reasonText.toLowerCase().includes("device token mismatch") && !this.opts.token && !this.opts.password && this.opts.deviceIdentity) {
|
|
1906
|
-
const deviceId = this.opts.deviceIdentity.deviceId;
|
|
1907
|
-
const role = this.opts.role ?? "operator";
|
|
1908
|
-
try {
|
|
1909
|
-
clearDeviceAuthToken({
|
|
1910
|
-
deviceId,
|
|
1911
|
-
role
|
|
1912
|
-
});
|
|
1913
|
-
logDebug(`cleared stale device-auth token for device ${deviceId}`);
|
|
1914
|
-
} catch (err) {
|
|
1915
|
-
logDebug(`failed clearing stale device-auth token for device ${deviceId}: ${String(err)}`);
|
|
1916
|
-
}
|
|
1917
|
-
}
|
|
1918
|
-
this.flushPendingErrors(/* @__PURE__ */ new Error(`gateway closed (${code}): ${reasonText}`));
|
|
1919
|
-
if (this.shouldPauseReconnectAfterAuthFailure(connectErrorDetailCode)) {
|
|
1920
|
-
this.opts.onClose?.(code, reasonText);
|
|
1921
|
-
return;
|
|
1922
|
-
}
|
|
1923
|
-
this.scheduleReconnect();
|
|
1924
|
-
this.opts.onClose?.(code, reasonText);
|
|
1925
|
-
});
|
|
1926
|
-
ws.on("error", (err) => {
|
|
1927
|
-
logDebug(`gateway client error: ${String(err)}`);
|
|
1928
|
-
if (!this.connectSent) this.opts.onConnectError?.(err instanceof Error ? err : new Error(String(err)));
|
|
1929
|
-
});
|
|
1930
|
-
}
|
|
1931
|
-
stop() {
|
|
1932
|
-
this.beginStop();
|
|
1933
|
-
}
|
|
1934
|
-
async stopAndWait(opts) {
|
|
1935
|
-
const stopPromise = this.beginStop();
|
|
1936
|
-
if (!stopPromise) return;
|
|
1937
|
-
const timeoutMs = typeof opts?.timeoutMs === "number" && Number.isFinite(opts.timeoutMs) ? Math.max(1, Math.floor(opts.timeoutMs)) : STOP_AND_WAIT_TIMEOUT_MS;
|
|
1938
|
-
let timeout = null;
|
|
1939
|
-
try {
|
|
1940
|
-
await Promise.race([stopPromise, new Promise((_, reject) => {
|
|
1941
|
-
timeout = setTimeout(() => {
|
|
1942
|
-
reject(/* @__PURE__ */ new Error(`gateway client stop timed out after ${timeoutMs}ms`));
|
|
1943
|
-
}, timeoutMs);
|
|
1944
|
-
timeout.unref?.();
|
|
1945
|
-
})]);
|
|
1946
|
-
} finally {
|
|
1947
|
-
if (timeout) clearTimeout(timeout);
|
|
1948
|
-
}
|
|
1949
|
-
}
|
|
1950
|
-
beginStop() {
|
|
1951
|
-
this.closed = true;
|
|
1952
|
-
this.pendingDeviceTokenRetry = false;
|
|
1953
|
-
this.deviceTokenRetryBudgetUsed = false;
|
|
1954
|
-
this.pendingConnectErrorDetailCode = null;
|
|
1955
|
-
if (this.tickTimer) {
|
|
1956
|
-
clearInterval(this.tickTimer);
|
|
1957
|
-
this.tickTimer = null;
|
|
1958
|
-
}
|
|
1959
|
-
if (this.connectTimer) {
|
|
1960
|
-
clearTimeout(this.connectTimer);
|
|
1961
|
-
this.connectTimer = null;
|
|
1962
|
-
}
|
|
1963
|
-
if (this.pendingStop) {
|
|
1964
|
-
this.flushPendingErrors(/* @__PURE__ */ new Error("gateway client stopped"));
|
|
1965
|
-
return this.pendingStop.promise;
|
|
1966
|
-
}
|
|
1967
|
-
const ws = this.ws;
|
|
1968
|
-
this.ws = null;
|
|
1969
|
-
if (ws) {
|
|
1970
|
-
const stopPromise = this.createPendingStop(ws);
|
|
1971
|
-
ws.close();
|
|
1972
|
-
setTimeout(() => {
|
|
1973
|
-
try {
|
|
1974
|
-
ws.terminate();
|
|
1975
|
-
} catch {}
|
|
1976
|
-
this.resolvePendingStop(ws);
|
|
1977
|
-
}, FORCE_STOP_TERMINATE_GRACE_MS).unref?.();
|
|
1978
|
-
this.flushPendingErrors(/* @__PURE__ */ new Error("gateway client stopped"));
|
|
1979
|
-
return stopPromise;
|
|
1980
|
-
}
|
|
1981
|
-
this.flushPendingErrors(/* @__PURE__ */ new Error("gateway client stopped"));
|
|
1982
|
-
return null;
|
|
1983
|
-
}
|
|
1984
|
-
createPendingStop(ws) {
|
|
1985
|
-
if (this.pendingStop?.ws === ws) return this.pendingStop.promise;
|
|
1986
|
-
let resolve;
|
|
1987
|
-
const promise = new Promise((res) => {
|
|
1988
|
-
resolve = res;
|
|
1989
|
-
});
|
|
1990
|
-
this.pendingStop = {
|
|
1991
|
-
ws,
|
|
1992
|
-
promise,
|
|
1993
|
-
resolve
|
|
1994
|
-
};
|
|
1995
|
-
return promise;
|
|
1996
|
-
}
|
|
1997
|
-
resolvePendingStop(ws) {
|
|
1998
|
-
if (this.pendingStop?.ws !== ws) return;
|
|
1999
|
-
const { resolve } = this.pendingStop;
|
|
2000
|
-
this.pendingStop = null;
|
|
2001
|
-
resolve();
|
|
2002
|
-
}
|
|
2003
|
-
sendConnect() {
|
|
2004
|
-
if (this.connectSent) return;
|
|
2005
|
-
const nonce = this.connectNonce?.trim() ?? "";
|
|
2006
|
-
if (!nonce) {
|
|
2007
|
-
this.opts.onConnectError?.(/* @__PURE__ */ new Error("gateway connect challenge missing nonce"));
|
|
2008
|
-
this.ws?.close(1008, "connect challenge missing nonce");
|
|
2009
|
-
return;
|
|
2010
|
-
}
|
|
2011
|
-
this.connectSent = true;
|
|
2012
|
-
if (this.connectTimer) {
|
|
2013
|
-
clearTimeout(this.connectTimer);
|
|
2014
|
-
this.connectTimer = null;
|
|
2015
|
-
}
|
|
2016
|
-
const role = this.opts.role ?? "operator";
|
|
2017
|
-
const { authToken, authBootstrapToken, authDeviceToken, authPassword, signatureToken, resolvedDeviceToken, storedToken } = this.selectConnectAuth(role);
|
|
2018
|
-
if (this.pendingDeviceTokenRetry && authDeviceToken) this.pendingDeviceTokenRetry = false;
|
|
2019
|
-
const auth = authToken || authBootstrapToken || authPassword || resolvedDeviceToken ? {
|
|
2020
|
-
token: authToken,
|
|
2021
|
-
bootstrapToken: authBootstrapToken,
|
|
2022
|
-
deviceToken: authDeviceToken ?? resolvedDeviceToken,
|
|
2023
|
-
password: authPassword
|
|
2024
|
-
} : void 0;
|
|
2025
|
-
const signedAtMs = Date.now();
|
|
2026
|
-
const scopes = this.opts.scopes ?? ["operator.admin"];
|
|
2027
|
-
const platform = this.opts.platform ?? process.platform;
|
|
2028
|
-
const device = (() => {
|
|
2029
|
-
if (!this.opts.deviceIdentity) return;
|
|
2030
|
-
const payload = buildDeviceAuthPayloadV3({
|
|
2031
|
-
deviceId: this.opts.deviceIdentity.deviceId,
|
|
2032
|
-
clientId: this.opts.clientName ?? GATEWAY_CLIENT_NAMES.GATEWAY_CLIENT,
|
|
2033
|
-
clientMode: this.opts.mode ?? GATEWAY_CLIENT_MODES.BACKEND,
|
|
2034
|
-
role,
|
|
2035
|
-
scopes,
|
|
2036
|
-
signedAtMs,
|
|
2037
|
-
token: signatureToken ?? null,
|
|
2038
|
-
nonce,
|
|
2039
|
-
platform,
|
|
2040
|
-
deviceFamily: this.opts.deviceFamily
|
|
2041
|
-
});
|
|
2042
|
-
const signature = signDevicePayload(this.opts.deviceIdentity.privateKeyPem, payload);
|
|
2043
|
-
return {
|
|
2044
|
-
id: this.opts.deviceIdentity.deviceId,
|
|
2045
|
-
publicKey: publicKeyRawBase64UrlFromPem(this.opts.deviceIdentity.publicKeyPem),
|
|
2046
|
-
signature,
|
|
2047
|
-
signedAt: signedAtMs,
|
|
2048
|
-
nonce
|
|
2049
|
-
};
|
|
2050
|
-
})();
|
|
2051
|
-
const params = {
|
|
2052
|
-
minProtocol: this.opts.minProtocol ?? 3,
|
|
2053
|
-
maxProtocol: this.opts.maxProtocol ?? 3,
|
|
2054
|
-
client: {
|
|
2055
|
-
id: this.opts.clientName ?? GATEWAY_CLIENT_NAMES.GATEWAY_CLIENT,
|
|
2056
|
-
displayName: this.opts.clientDisplayName,
|
|
2057
|
-
version: this.opts.clientVersion ?? VERSION,
|
|
2058
|
-
platform,
|
|
2059
|
-
deviceFamily: this.opts.deviceFamily,
|
|
2060
|
-
mode: this.opts.mode ?? GATEWAY_CLIENT_MODES.BACKEND,
|
|
2061
|
-
instanceId: this.opts.instanceId
|
|
2062
|
-
},
|
|
2063
|
-
caps: Array.isArray(this.opts.caps) ? this.opts.caps : [],
|
|
2064
|
-
commands: Array.isArray(this.opts.commands) ? this.opts.commands : void 0,
|
|
2065
|
-
permissions: this.opts.permissions && typeof this.opts.permissions === "object" ? this.opts.permissions : void 0,
|
|
2066
|
-
pathEnv: this.opts.pathEnv,
|
|
2067
|
-
auth,
|
|
2068
|
-
role,
|
|
2069
|
-
scopes,
|
|
2070
|
-
device
|
|
2071
|
-
};
|
|
2072
|
-
this.request("connect", params).then((helloOk) => {
|
|
2073
|
-
this.pendingDeviceTokenRetry = false;
|
|
2074
|
-
this.deviceTokenRetryBudgetUsed = false;
|
|
2075
|
-
this.pendingConnectErrorDetailCode = null;
|
|
2076
|
-
const authInfo = helloOk?.auth;
|
|
2077
|
-
if (authInfo?.deviceToken && this.opts.deviceIdentity) storeDeviceAuthToken({
|
|
2078
|
-
deviceId: this.opts.deviceIdentity.deviceId,
|
|
2079
|
-
role: authInfo.role ?? role,
|
|
2080
|
-
token: authInfo.deviceToken,
|
|
2081
|
-
scopes: authInfo.scopes ?? []
|
|
2082
|
-
});
|
|
2083
|
-
this.backoffMs = 1e3;
|
|
2084
|
-
this.tickIntervalMs = typeof helloOk.policy?.tickIntervalMs === "number" ? helloOk.policy.tickIntervalMs : 3e4;
|
|
2085
|
-
this.lastTick = Date.now();
|
|
2086
|
-
this.startTickWatch();
|
|
2087
|
-
this.opts.onHelloOk?.(helloOk);
|
|
2088
|
-
}).catch((err) => {
|
|
2089
|
-
this.pendingConnectErrorDetailCode = err instanceof GatewayClientRequestError ? readConnectErrorDetailCode(err.details) : null;
|
|
2090
|
-
if (this.shouldRetryWithStoredDeviceToken({
|
|
2091
|
-
error: err,
|
|
2092
|
-
explicitGatewayToken: this.opts.token?.trim() || void 0,
|
|
2093
|
-
resolvedDeviceToken,
|
|
2094
|
-
storedToken: storedToken ?? void 0
|
|
2095
|
-
})) {
|
|
2096
|
-
this.pendingDeviceTokenRetry = true;
|
|
2097
|
-
this.deviceTokenRetryBudgetUsed = true;
|
|
2098
|
-
this.backoffMs = Math.min(this.backoffMs, 250);
|
|
2099
|
-
}
|
|
2100
|
-
this.opts.onConnectError?.(err instanceof Error ? err : new Error(String(err)));
|
|
2101
|
-
const msg = `gateway connect failed: ${String(err)}`;
|
|
2102
|
-
if (this.opts.mode === GATEWAY_CLIENT_MODES.PROBE) logDebug(msg);
|
|
2103
|
-
else logError(msg);
|
|
2104
|
-
this.ws?.close(1008, "connect failed");
|
|
2105
|
-
});
|
|
2106
|
-
}
|
|
2107
|
-
shouldPauseReconnectAfterAuthFailure(detailCode) {
|
|
2108
|
-
if (!detailCode) return false;
|
|
2109
|
-
if (detailCode === ConnectErrorDetailCodes.AUTH_TOKEN_MISSING || detailCode === ConnectErrorDetailCodes.AUTH_BOOTSTRAP_TOKEN_INVALID || detailCode === ConnectErrorDetailCodes.AUTH_PASSWORD_MISSING || detailCode === ConnectErrorDetailCodes.AUTH_PASSWORD_MISMATCH || detailCode === ConnectErrorDetailCodes.AUTH_RATE_LIMITED || detailCode === ConnectErrorDetailCodes.PAIRING_REQUIRED || detailCode === ConnectErrorDetailCodes.CONTROL_UI_DEVICE_IDENTITY_REQUIRED || detailCode === ConnectErrorDetailCodes.DEVICE_IDENTITY_REQUIRED) return true;
|
|
2110
|
-
if (detailCode !== ConnectErrorDetailCodes.AUTH_TOKEN_MISMATCH) return false;
|
|
2111
|
-
if (this.pendingDeviceTokenRetry) return false;
|
|
2112
|
-
if (!this.isTrustedDeviceRetryEndpoint()) return true;
|
|
2113
|
-
return this.deviceTokenRetryBudgetUsed;
|
|
2114
|
-
}
|
|
2115
|
-
shouldRetryWithStoredDeviceToken(params) {
|
|
2116
|
-
if (this.deviceTokenRetryBudgetUsed) return false;
|
|
2117
|
-
if (params.resolvedDeviceToken) return false;
|
|
2118
|
-
if (!params.explicitGatewayToken || !params.storedToken) return false;
|
|
2119
|
-
if (!this.isTrustedDeviceRetryEndpoint()) return false;
|
|
2120
|
-
if (!(params.error instanceof GatewayClientRequestError)) return false;
|
|
2121
|
-
const detailCode = readConnectErrorDetailCode(params.error.details);
|
|
2122
|
-
const advice = readConnectErrorRecoveryAdvice(params.error.details);
|
|
2123
|
-
const retryWithDeviceTokenRecommended = advice.recommendedNextStep === "retry_with_device_token";
|
|
2124
|
-
return advice.canRetryWithDeviceToken === true || retryWithDeviceTokenRecommended || detailCode === ConnectErrorDetailCodes.AUTH_TOKEN_MISMATCH;
|
|
2125
|
-
}
|
|
2126
|
-
isTrustedDeviceRetryEndpoint() {
|
|
2127
|
-
const rawUrl = this.opts.url ?? "ws://127.0.0.1:28789";
|
|
2128
|
-
try {
|
|
2129
|
-
const parsed = new URL(rawUrl);
|
|
2130
|
-
const protocol = parsed.protocol === "https:" ? "wss:" : parsed.protocol === "http:" ? "ws:" : parsed.protocol;
|
|
2131
|
-
if (isLoopbackHost(parsed.hostname)) return true;
|
|
2132
|
-
return protocol === "wss:" && Boolean(this.opts.tlsFingerprint?.trim());
|
|
2133
|
-
} catch {
|
|
2134
|
-
return false;
|
|
2135
|
-
}
|
|
2136
|
-
}
|
|
2137
|
-
selectConnectAuth(role) {
|
|
2138
|
-
const explicitGatewayToken = this.opts.token?.trim() || void 0;
|
|
2139
|
-
const explicitBootstrapToken = this.opts.bootstrapToken?.trim() || void 0;
|
|
2140
|
-
const explicitDeviceToken = this.opts.deviceToken?.trim() || void 0;
|
|
2141
|
-
const authPassword = this.opts.password?.trim() || void 0;
|
|
2142
|
-
const storedToken = this.opts.deviceIdentity ? loadDeviceAuthToken({
|
|
2143
|
-
deviceId: this.opts.deviceIdentity.deviceId,
|
|
2144
|
-
role
|
|
2145
|
-
})?.token : null;
|
|
2146
|
-
const shouldUseDeviceRetryToken = this.pendingDeviceTokenRetry && !explicitDeviceToken && Boolean(explicitGatewayToken) && Boolean(storedToken) && this.isTrustedDeviceRetryEndpoint();
|
|
2147
|
-
const resolvedDeviceToken = explicitDeviceToken ?? (shouldUseDeviceRetryToken || !(explicitGatewayToken || authPassword) && (!explicitBootstrapToken || Boolean(storedToken)) ? storedToken ?? void 0 : void 0);
|
|
2148
|
-
const authToken = explicitGatewayToken ?? resolvedDeviceToken;
|
|
2149
|
-
const authBootstrapToken = !explicitGatewayToken && !resolvedDeviceToken ? explicitBootstrapToken : void 0;
|
|
2150
|
-
return {
|
|
2151
|
-
authToken,
|
|
2152
|
-
authBootstrapToken,
|
|
2153
|
-
authDeviceToken: shouldUseDeviceRetryToken ? storedToken ?? void 0 : void 0,
|
|
2154
|
-
authPassword,
|
|
2155
|
-
signatureToken: authToken ?? authBootstrapToken ?? void 0,
|
|
2156
|
-
resolvedDeviceToken,
|
|
2157
|
-
storedToken: storedToken ?? void 0
|
|
2158
|
-
};
|
|
2159
|
-
}
|
|
2160
|
-
handleMessage(raw) {
|
|
2161
|
-
try {
|
|
2162
|
-
const parsed = JSON.parse(raw);
|
|
2163
|
-
if (validateEventFrame(parsed)) {
|
|
2164
|
-
const evt = parsed;
|
|
2165
|
-
if (evt.event === "connect.challenge") {
|
|
2166
|
-
const payload = evt.payload;
|
|
2167
|
-
const nonce = payload && typeof payload.nonce === "string" ? payload.nonce : null;
|
|
2168
|
-
if (!nonce || nonce.trim().length === 0) {
|
|
2169
|
-
this.opts.onConnectError?.(/* @__PURE__ */ new Error("gateway connect challenge missing nonce"));
|
|
2170
|
-
this.ws?.close(1008, "connect challenge missing nonce");
|
|
2171
|
-
return;
|
|
2172
|
-
}
|
|
2173
|
-
this.connectNonce = nonce.trim();
|
|
2174
|
-
this.sendConnect();
|
|
2175
|
-
return;
|
|
2176
|
-
}
|
|
2177
|
-
const seq = typeof evt.seq === "number" ? evt.seq : null;
|
|
2178
|
-
if (seq !== null) {
|
|
2179
|
-
if (this.lastSeq !== null && seq > this.lastSeq + 1) this.opts.onGap?.({
|
|
2180
|
-
expected: this.lastSeq + 1,
|
|
2181
|
-
received: seq
|
|
2182
|
-
});
|
|
2183
|
-
this.lastSeq = seq;
|
|
2184
|
-
}
|
|
2185
|
-
if (evt.event === "tick") this.lastTick = Date.now();
|
|
2186
|
-
this.opts.onEvent?.(evt);
|
|
2187
|
-
return;
|
|
2188
|
-
}
|
|
2189
|
-
if (validateResponseFrame(parsed)) {
|
|
2190
|
-
const pending = this.pending.get(parsed.id);
|
|
2191
|
-
if (!pending) return;
|
|
2192
|
-
const status = parsed.payload?.status;
|
|
2193
|
-
if (pending.expectFinal && status === "accepted") return;
|
|
2194
|
-
this.pending.delete(parsed.id);
|
|
2195
|
-
if (pending.timeout) clearTimeout(pending.timeout);
|
|
2196
|
-
if (parsed.ok) pending.resolve(parsed.payload);
|
|
2197
|
-
else pending.reject(new GatewayClientRequestError({
|
|
2198
|
-
code: parsed.error?.code,
|
|
2199
|
-
message: parsed.error?.message ?? "unknown error",
|
|
2200
|
-
details: parsed.error?.details
|
|
2201
|
-
}));
|
|
2202
|
-
}
|
|
2203
|
-
} catch (err) {
|
|
2204
|
-
logDebug(`gateway client parse error: ${String(err)}`);
|
|
2205
|
-
}
|
|
2206
|
-
}
|
|
2207
|
-
queueConnect() {
|
|
2208
|
-
this.connectNonce = null;
|
|
2209
|
-
this.connectSent = false;
|
|
2210
|
-
const rawConnectDelayMs = this.opts.connectDelayMs;
|
|
2211
|
-
const connectChallengeTimeoutMs = typeof rawConnectDelayMs === "number" && Number.isFinite(rawConnectDelayMs) ? Math.max(250, Math.min(1e4, rawConnectDelayMs)) : 2e3;
|
|
2212
|
-
if (this.connectTimer) clearTimeout(this.connectTimer);
|
|
2213
|
-
this.connectTimer = setTimeout(() => {
|
|
2214
|
-
if (this.connectSent || this.ws?.readyState !== WebSocket.OPEN) return;
|
|
2215
|
-
this.opts.onConnectError?.(/* @__PURE__ */ new Error("gateway connect challenge timeout"));
|
|
2216
|
-
this.ws?.close(1008, "connect challenge timeout");
|
|
2217
|
-
}, connectChallengeTimeoutMs);
|
|
2218
|
-
}
|
|
2219
|
-
scheduleReconnect() {
|
|
2220
|
-
if (this.closed) return;
|
|
2221
|
-
if (this.tickTimer) {
|
|
2222
|
-
clearInterval(this.tickTimer);
|
|
2223
|
-
this.tickTimer = null;
|
|
2224
|
-
}
|
|
2225
|
-
const delay = this.backoffMs;
|
|
2226
|
-
this.backoffMs = Math.min(this.backoffMs * 2, 3e4);
|
|
2227
|
-
setTimeout(() => this.start(), delay).unref();
|
|
2228
|
-
}
|
|
2229
|
-
flushPendingErrors(err) {
|
|
2230
|
-
for (const [, p] of this.pending) {
|
|
2231
|
-
if (p.timeout) clearTimeout(p.timeout);
|
|
2232
|
-
p.reject(err);
|
|
2233
|
-
}
|
|
2234
|
-
this.pending.clear();
|
|
2235
|
-
}
|
|
2236
|
-
startTickWatch() {
|
|
2237
|
-
if (this.tickTimer) clearInterval(this.tickTimer);
|
|
2238
|
-
const rawMinInterval = this.opts.tickWatchMinIntervalMs;
|
|
2239
|
-
const minInterval = typeof rawMinInterval === "number" && Number.isFinite(rawMinInterval) ? Math.max(1, Math.min(3e4, rawMinInterval)) : 1e3;
|
|
2240
|
-
const interval = Math.max(this.tickIntervalMs, minInterval);
|
|
2241
|
-
this.tickTimer = setInterval(() => {
|
|
2242
|
-
if (this.closed) return;
|
|
2243
|
-
if (!this.lastTick) return;
|
|
2244
|
-
if (Date.now() - this.lastTick > this.tickIntervalMs * 2) this.ws?.close(4e3, "tick timeout");
|
|
2245
|
-
}, interval);
|
|
2246
|
-
}
|
|
2247
|
-
validateTlsFingerprint() {
|
|
2248
|
-
if (!this.opts.tlsFingerprint || !this.ws) return null;
|
|
2249
|
-
const expected = normalizeFingerprint(this.opts.tlsFingerprint);
|
|
2250
|
-
if (!expected) return /* @__PURE__ */ new Error("gateway tls fingerprint missing");
|
|
2251
|
-
const socket = this.ws._socket;
|
|
2252
|
-
if (!socket || typeof socket.getPeerCertificate !== "function") return /* @__PURE__ */ new Error("gateway tls fingerprint unavailable");
|
|
2253
|
-
const fingerprint = normalizeFingerprint(socket.getPeerCertificate()?.fingerprint256 ?? "");
|
|
2254
|
-
if (!fingerprint) return /* @__PURE__ */ new Error("gateway tls fingerprint unavailable");
|
|
2255
|
-
if (fingerprint !== expected) return /* @__PURE__ */ new Error("gateway tls fingerprint mismatch");
|
|
2256
|
-
return null;
|
|
2257
|
-
}
|
|
2258
|
-
async request(method, params, opts) {
|
|
2259
|
-
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) throw new Error("gateway not connected");
|
|
2260
|
-
const id = randomUUID();
|
|
2261
|
-
const frame = {
|
|
2262
|
-
type: "req",
|
|
2263
|
-
id,
|
|
2264
|
-
method,
|
|
2265
|
-
params
|
|
2266
|
-
};
|
|
2267
|
-
if (!validateRequestFrame(frame)) throw new Error(`invalid request frame: ${JSON.stringify(validateRequestFrame.errors, null, 2)}`);
|
|
2268
|
-
const expectFinal = opts?.expectFinal === true;
|
|
2269
|
-
const timeoutMs = opts?.timeoutMs === null ? null : typeof opts?.timeoutMs === "number" && Number.isFinite(opts.timeoutMs) ? Math.max(1, Math.min(Math.floor(opts.timeoutMs), 2147483647)) : expectFinal ? null : this.requestTimeoutMs;
|
|
2270
|
-
const p = new Promise((resolve, reject) => {
|
|
2271
|
-
const timeout = timeoutMs === null ? null : setTimeout(() => {
|
|
2272
|
-
this.pending.delete(id);
|
|
2273
|
-
reject(/* @__PURE__ */ new Error(`gateway request timeout for ${method}`));
|
|
2274
|
-
}, timeoutMs);
|
|
2275
|
-
this.pending.set(id, {
|
|
2276
|
-
resolve: (value) => resolve(value),
|
|
2277
|
-
reject,
|
|
2278
|
-
expectFinal,
|
|
2279
|
-
timeout
|
|
2280
|
-
});
|
|
2281
|
-
});
|
|
2282
|
-
this.ws.send(JSON.stringify(frame));
|
|
2283
|
-
return p;
|
|
2284
|
-
}
|
|
2285
|
-
};
|
|
2286
|
-
//#endregion
|
|
2287
|
-
//#region src/gateway/method-scopes.ts
|
|
2288
|
-
const ADMIN_SCOPE = "operator.admin";
|
|
2289
|
-
const READ_SCOPE = "operator.read";
|
|
2290
|
-
const WRITE_SCOPE = "operator.write";
|
|
2291
|
-
const APPROVALS_SCOPE = "operator.approvals";
|
|
2292
|
-
const PAIRING_SCOPE = "operator.pairing";
|
|
2293
|
-
const CLI_DEFAULT_OPERATOR_SCOPES = [
|
|
2294
|
-
ADMIN_SCOPE,
|
|
2295
|
-
READ_SCOPE,
|
|
2296
|
-
WRITE_SCOPE,
|
|
2297
|
-
APPROVALS_SCOPE,
|
|
2298
|
-
PAIRING_SCOPE
|
|
2299
|
-
];
|
|
2300
|
-
const NODE_ROLE_METHODS = new Set([
|
|
2301
|
-
"node.invoke.result",
|
|
2302
|
-
"node.event",
|
|
2303
|
-
"node.pending.drain",
|
|
2304
|
-
"node.canvas.capability.refresh",
|
|
2305
|
-
"node.pending.pull",
|
|
2306
|
-
"node.pending.ack",
|
|
2307
|
-
"skills.bins"
|
|
2308
|
-
]);
|
|
2309
|
-
const METHOD_SCOPE_GROUPS = {
|
|
2310
|
-
[APPROVALS_SCOPE]: [
|
|
2311
|
-
"exec.approval.request",
|
|
2312
|
-
"exec.approval.waitDecision",
|
|
2313
|
-
"exec.approval.resolve"
|
|
2314
|
-
],
|
|
2315
|
-
[PAIRING_SCOPE]: [
|
|
2316
|
-
"node.pair.request",
|
|
2317
|
-
"node.pair.list",
|
|
2318
|
-
"node.pair.approve",
|
|
2319
|
-
"node.pair.reject",
|
|
2320
|
-
"node.pair.verify",
|
|
2321
|
-
"device.pair.list",
|
|
2322
|
-
"device.pair.approve",
|
|
2323
|
-
"device.pair.reject",
|
|
2324
|
-
"device.pair.remove",
|
|
2325
|
-
"device.token.rotate",
|
|
2326
|
-
"device.token.revoke",
|
|
2327
|
-
"node.rename"
|
|
2328
|
-
],
|
|
2329
|
-
[READ_SCOPE]: [
|
|
2330
|
-
"health",
|
|
2331
|
-
"doctor.memory.status",
|
|
2332
|
-
"logs.tail",
|
|
2333
|
-
"channels.status",
|
|
2334
|
-
"status",
|
|
2335
|
-
"usage.status",
|
|
2336
|
-
"usage.cost",
|
|
2337
|
-
"tts.status",
|
|
2338
|
-
"tts.providers",
|
|
2339
|
-
"models.list",
|
|
2340
|
-
"tools.catalog",
|
|
2341
|
-
"agents.list",
|
|
2342
|
-
"agent.identity.get",
|
|
2343
|
-
"skills.status",
|
|
2344
|
-
"voicewake.get",
|
|
2345
|
-
"sessions.list",
|
|
2346
|
-
"sessions.get",
|
|
2347
|
-
"sessions.preview",
|
|
2348
|
-
"sessions.resolve",
|
|
2349
|
-
"sessions.usage",
|
|
2350
|
-
"sessions.usage.timeseries",
|
|
2351
|
-
"sessions.usage.logs",
|
|
2352
|
-
"cron.list",
|
|
2353
|
-
"cron.status",
|
|
2354
|
-
"cron.runs",
|
|
2355
|
-
"gateway.identity.get",
|
|
2356
|
-
"system-presence",
|
|
2357
|
-
"last-heartbeat",
|
|
2358
|
-
"node.list",
|
|
2359
|
-
"node.describe",
|
|
2360
|
-
"chat.history",
|
|
2361
|
-
"config.get",
|
|
2362
|
-
"config.schema.lookup",
|
|
2363
|
-
"talk.config",
|
|
2364
|
-
"agents.files.list",
|
|
2365
|
-
"agents.files.get"
|
|
2366
|
-
],
|
|
2367
|
-
[WRITE_SCOPE]: [
|
|
2368
|
-
"send",
|
|
2369
|
-
"poll",
|
|
2370
|
-
"agent",
|
|
2371
|
-
"agent.wait",
|
|
2372
|
-
"wake",
|
|
2373
|
-
"talk.mode",
|
|
2374
|
-
"tts.enable",
|
|
2375
|
-
"tts.disable",
|
|
2376
|
-
"tts.convert",
|
|
2377
|
-
"tts.setProvider",
|
|
2378
|
-
"voicewake.set",
|
|
2379
|
-
"node.invoke",
|
|
2380
|
-
"chat.send",
|
|
2381
|
-
"chat.abort",
|
|
2382
|
-
"browser.request",
|
|
2383
|
-
"push.test",
|
|
2384
|
-
"node.pending.enqueue"
|
|
2385
|
-
],
|
|
2386
|
-
[ADMIN_SCOPE]: [
|
|
2387
|
-
"channels.logout",
|
|
2388
|
-
"agents.create",
|
|
2389
|
-
"agents.update",
|
|
2390
|
-
"agents.delete",
|
|
2391
|
-
"skills.install",
|
|
2392
|
-
"skills.update",
|
|
2393
|
-
"secrets.reload",
|
|
2394
|
-
"secrets.resolve",
|
|
2395
|
-
"cron.add",
|
|
2396
|
-
"cron.update",
|
|
2397
|
-
"cron.remove",
|
|
2398
|
-
"cron.run",
|
|
2399
|
-
"sessions.patch",
|
|
2400
|
-
"sessions.reset",
|
|
2401
|
-
"sessions.delete",
|
|
2402
|
-
"sessions.compact",
|
|
2403
|
-
"connect",
|
|
2404
|
-
"chat.inject",
|
|
2405
|
-
"web.login.start",
|
|
2406
|
-
"web.login.wait",
|
|
2407
|
-
"set-heartbeats",
|
|
2408
|
-
"system-event",
|
|
2409
|
-
"agents.files.set"
|
|
2410
|
-
]
|
|
2411
|
-
};
|
|
2412
|
-
const ADMIN_METHOD_PREFIXES = [
|
|
2413
|
-
"exec.approvals.",
|
|
2414
|
-
"config.",
|
|
2415
|
-
"wizard.",
|
|
2416
|
-
"update."
|
|
2417
|
-
];
|
|
2418
|
-
const METHOD_SCOPE_BY_NAME = new Map(Object.entries(METHOD_SCOPE_GROUPS).flatMap(([scope, methods]) => methods.map((method) => [method, scope])));
|
|
2419
|
-
function resolveScopedMethod(method) {
|
|
2420
|
-
const explicitScope = METHOD_SCOPE_BY_NAME.get(method);
|
|
2421
|
-
if (explicitScope) return explicitScope;
|
|
2422
|
-
if (ADMIN_METHOD_PREFIXES.some((prefix) => method.startsWith(prefix))) return ADMIN_SCOPE;
|
|
2423
|
-
}
|
|
2424
|
-
function isNodeRoleMethod(method) {
|
|
2425
|
-
return NODE_ROLE_METHODS.has(method);
|
|
2426
|
-
}
|
|
2427
|
-
function resolveRequiredOperatorScopeForMethod(method) {
|
|
2428
|
-
return resolveScopedMethod(method);
|
|
2429
|
-
}
|
|
2430
|
-
function resolveLeastPrivilegeOperatorScopesForMethod(method) {
|
|
2431
|
-
const requiredScope = resolveRequiredOperatorScopeForMethod(method);
|
|
2432
|
-
if (requiredScope) return [requiredScope];
|
|
2433
|
-
return [];
|
|
2434
|
-
}
|
|
2435
|
-
function authorizeOperatorScopesForMethod(method, scopes) {
|
|
2436
|
-
if (scopes.includes("operator.admin")) return { allowed: true };
|
|
2437
|
-
const requiredScope = resolveRequiredOperatorScopeForMethod(method) ?? "operator.admin";
|
|
2438
|
-
if (requiredScope === "operator.read") {
|
|
2439
|
-
if (scopes.includes("operator.read") || scopes.includes("operator.write")) return { allowed: true };
|
|
2440
|
-
return {
|
|
2441
|
-
allowed: false,
|
|
2442
|
-
missingScope: READ_SCOPE
|
|
2443
|
-
};
|
|
2444
|
-
}
|
|
2445
|
-
if (scopes.includes(requiredScope)) return { allowed: true };
|
|
2446
|
-
return {
|
|
2447
|
-
allowed: false,
|
|
2448
|
-
missingScope: requiredScope
|
|
2449
|
-
};
|
|
2450
|
-
}
|
|
2451
|
-
//#endregion
|
|
2452
|
-
export { validateExecApprovalsNodeSetParams as $, buildDeviceAuthPayloadV3 as $t, validateConfigPatchParams as A, validateSessionsUsageParams as At, validateCronRunsParams as B, validateWebLoginStartParams as Bt, validateChannelsStatusParams as C, validateSessionsCompactParams as Ct, validateChatSendParams as D, validateSessionsPreviewParams as Dt, validateChatInjectParams as E, validateSessionsPatchParams as Et, validateConnectParams as F, validateTalkConfigParams as Ft, validateDevicePairRejectParams as G, validateWizardStatusParams as Gt, validateCronUpdateParams as H, validateWizardCancelParams as Ht, validateCronAddParams as I, validateTalkModeParams as It, validateDeviceTokenRotateParams as J, parseSessionLabel as Jt, validateDevicePairRemoveParams as K, ErrorCodes as Kt, validateCronListParams as L, validateToolsCatalogParams as Lt, validateConfigSchemaLookupResult as M, validateSkillsInstallParams as Mt, validateConfigSchemaParams as N, validateSkillsStatusParams as Nt, validateConfigApplyParams as O, validateSessionsResetParams as Ot, validateConfigSetParams as P, validateSkillsUpdateParams as Pt, validateExecApprovalsNodeGetParams as Q, buildDeviceAuthPayload as Qt, validateCronRemoveParams as R, validateUpdateRunParams as Rt, validateChannelsLogoutParams as S, validateSendParams as St, validateChatHistoryParams as T, validateSessionsListParams as Tt, validateDevicePairApproveParams as U, validateWizardNextParams as Ut, validateCronStatusParams as V, validateWebLoginWaitParams as Vt, validateDevicePairListParams as W, validateWizardStartParams as Wt, validateExecApprovalResolveParams as X, resolveAuthConnectErrorDetailCode as Xt, validateExecApprovalRequestParams as Y, ConnectErrorDetailCodes as Yt, validateExecApprovalsGetParams as Z, resolveDeviceAuthConnectErrorDetailCode as Zt, validateAgentsFilesGetParams as _, validatePollParams as _t, READ_SCOPE as a, validateNodeInvokeParams as at, validateAgentsListParams as b, validateSecretsResolveParams as bt, isNodeRoleMethod as c, validateNodePairApproveParams as ct, formatValidationErrors as d, validateNodePairRequestParams as dt, normalizeFingerprint as en, validateExecApprovalsSetParams as et, validateAgentIdentityParams as f, validateNodePairVerifyParams as ft, validateAgentsDeleteParams as g, validateNodeRenameParams as gt, validateAgentsCreateParams as h, validateNodePendingEnqueueParams as ht, PAIRING_SCOPE as i, validateNodeEventParams as it, validateConfigSchemaLookupParams as j, validateSkillsBinsParams as jt, validateConfigGetParams as k, validateSessionsResolveParams as kt, resolveLeastPrivilegeOperatorScopesForMethod as l, validateNodePairListParams as lt, validateAgentWaitParams as m, validateNodePendingDrainParams as mt, APPROVALS_SCOPE as n, hasInterSessionUserProvenance as nn, validateModelsListParams as nt, WRITE_SCOPE as o, validateNodeInvokeResultParams as ot, validateAgentParams as p, validateNodePendingAckParams as pt, validateDeviceTokenRevokeParams as q, errorShape as qt, CLI_DEFAULT_OPERATOR_SCOPES as r, normalizeInputProvenance as rn, validateNodeDescribeParams as rt, authorizeOperatorScopesForMethod as s, validateNodeListParams as st, ADMIN_SCOPE as t, applyInputProvenanceToUserMessage as tn, validateLogsTailParams as tt, GatewayClient as u, validateNodePairRejectParams as ut, validateAgentsFilesListParams as v, validatePushTestParams as vt, validateChatAbortParams as w, validateSessionsDeleteParams as wt, validateAgentsUpdateParams as x, validateSecretsResolveResult as xt, validateAgentsFilesSetParams as y, validateRequestFrame as yt, validateCronRunParams as z, validateWakeParams as zt };
|