fengming 0.3.8 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/abort-CCR8oZyg.js +277 -0
- package/dist/abort.runtime-eqx84NZa.js +2 -0
- package/dist/abort.runtime.js +1 -1
- package/dist/acp-spawn-BcDyvaXh.js +2 -0
- package/dist/acp-spawn-CCtSel-_.js +1286 -0
- package/dist/acp-stateful-target-driver-B3pCvuOV.js +89 -0
- package/dist/active-tool-schema-warnings-Cf-5q5WU.js +105 -0
- package/dist/active-tool-schema-warnings-Dzt3XE-y.js +2 -0
- package/dist/agent-1M2dVE2G.js +2 -0
- package/dist/agent-DLDIbUT4.js +1825 -0
- package/dist/agent-DZi6j3o6.js +3 -0
- package/dist/agent-command-ppfDBwET.js +1435 -0
- package/dist/agent-harness-runtime-C0bo62eY.d.ts +913 -0
- package/dist/agent-harness-runtime-RkTGiliR.js +207 -0
- package/dist/agent-runner-utils-B4YeVAO_.js +267 -0
- package/dist/agent-runner.runtime-T_3tlZN1.js +3784 -0
- package/dist/agent-runner.runtime.js +1 -1
- package/dist/agent-runtime-CloshyK-.d.ts +207 -0
- package/dist/agent-runtime-DZsmp1xr.js +199 -0
- package/dist/agent-tools-CET9usCz.js +2506 -0
- package/dist/agent-via-gateway-CZ0X0YkM.js +486 -0
- package/dist/agent-wait-dedupe-I81_F2tr.js +180 -0
- package/dist/agents/embedded-agent-runner/run/runtime-context-prompt.d.ts +1 -1
- package/dist/agents/embedded-agent-runner/tool-split.d.ts +1 -1
- package/dist/agents/model-catalog.runtime.d.ts +1 -1
- package/dist/api-BDB5xHYj.js +3 -0
- package/dist/api-BH7bfI5d.js +6 -0
- package/dist/api-BxJNXitd.js +2 -0
- package/dist/approval-client-helpers-CfQA9Jzh.d.ts +78 -0
- package/dist/approval-native-helpers-B2zyhxWc.d.ts +241 -0
- package/dist/approval-renderers-CMqSXyvm.d.ts +39 -0
- package/dist/assistant-Cu_Mzzgu.js +291 -0
- package/dist/attachment-normalize-Bb3v5iCC.js +213 -0
- package/dist/attempt-execution-BskbAq5I.js +584 -0
- package/dist/attempt-execution.runtime-BuT1wpNS.js +3 -0
- package/dist/attempt-execution.runtime.js +1 -1
- package/dist/attempt.prompt-helpers-ByKj-vQ7.js +543 -0
- package/dist/auto-reply/reply/commands-crestodian.d.ts +1 -1
- package/dist/binding-routing-EGRNvRC4.js +113 -0
- package/dist/binding-targets-B9vYS8n6.js +121 -0
- package/dist/bridge-server-DG9YtKQe.js +113 -0
- package/dist/browser-cli-B0Ou-Nbm.js +2 -0
- package/dist/browser-cli-GF25gL6M.js +230 -0
- package/dist/browser-cli-actions-input-CuER6RVe.js +522 -0
- package/dist/browser-cli-actions-observe-Dq-Zz_FA.js +81 -0
- package/dist/browser-cli-debug-7hvb49S1.js +137 -0
- package/dist/browser-cli-inspect-WU5KeWOK.js +117 -0
- package/dist/browser-cli-manage-B9D9BvSe.js +446 -0
- package/dist/browser-cli-resize-BUOusOPb.js +32 -0
- package/dist/browser-cli-shared-DmpSN-Qi.js +69 -0
- package/dist/browser-cli-state-D_YxTqRw.js +371 -0
- package/dist/browser-control-auth-Cqd1n9FA.js +2 -0
- package/dist/browser-profiles-9tQ05wYh.js +2 -0
- package/dist/browser-runtime-Bbzumoha.js +389 -0
- package/dist/build-CBXuT2K1.js +261 -0
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +2 -2
- package/dist/bundled/session-memory/handler.js +1 -1
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/capability-cli-CiVGX7ut.js +1809 -0
- package/dist/channel-BIVwHq7P.js +2309 -0
- package/dist/channel-CiA2FVdL.d.ts +427 -0
- package/dist/channel-core-Cj9JTqeu.js +5 -0
- package/dist/channel-core-DjVpcH1C.d.ts +6 -0
- package/dist/channel-entry-contract-Bs_54m1D.d.ts +114 -0
- package/dist/channel-inbound-CdUdeQRa.js +121 -0
- package/dist/channel-inbound-iGiqx6CS.d.ts +97 -0
- package/dist/channel-message-C3QPaDUk.js +12 -0
- package/dist/channel-message-CXDjxb2U.d.ts +9 -0
- package/dist/channel-outbound-ofvvmMSK.d.ts +325 -0
- package/dist/channel-pairing-DKscOV1K.d.ts +58 -0
- package/dist/channel.runtime-VW6PW_ez.js +697 -0
- package/dist/channel.runtime.js +1 -1
- package/dist/chat-CFkQepUQ.js +3 -0
- package/dist/chat-Czh_tXM0.js +2940 -0
- package/dist/chrome-B2cq8YyH.js +1517 -0
- package/dist/cli/run-main.js +5 -5
- package/dist/cli-compaction-Dxv4nt7R.js +363 -0
- package/dist/cli-runner-CimXSTVs.js +2 -0
- package/dist/cli-runner-orCzE1Sr.js +597 -0
- package/dist/cli-runner.runtime-CsW0dXJW.js +3 -0
- package/dist/cli-runner.runtime-DgPrc1do.js +4 -0
- package/dist/cli-runner.runtime.js +1 -1
- package/dist/cli-startup-metadata.json +10 -12
- package/dist/command-registry-C5ooX6PF.js +4 -0
- package/dist/command-registry-DMB-HKIk.js +9 -0
- package/dist/command-registry-core-B2w_XWvn.js +114 -0
- package/dist/command-status.runtime-Bdy3Dkar.js +90 -0
- package/dist/command-status.runtime.js +1 -1
- package/dist/commands-compact.runtime-Bk2jTQo6.js +10 -0
- package/dist/commands-compact.runtime.js +1 -1
- package/dist/commands-handlers.runtime-Csw1og0U.js +6327 -0
- package/dist/commands-handlers.runtime.js +1 -1
- package/dist/commands-mRqmLIVz.d.ts +117 -0
- package/dist/commands-status-Dgrj_ubK.js +3 -0
- package/dist/commands-status-s32HJOpD.js +16 -0
- package/dist/commands-status.runtime-Dgrj_ubK.js +3 -0
- package/dist/commands-status.runtime.js +1 -1
- package/dist/commands-subagents-control.runtime-C_hnOO9l.js +2 -0
- package/dist/commands-subagents-control.runtime.js +1 -1
- package/dist/commands-system-prompt-CQV742Cc.js +2 -0
- package/dist/commands-system-prompt-DTfsKwK1.js +161 -0
- package/dist/commands-types-MXHhrssO.d.ts +132 -0
- package/dist/commands.runtime-akiVK67l.js +175 -0
- package/dist/commands.runtime.js +1 -1
- package/dist/commitments/runtime.js +1 -1
- package/dist/compact-U6ZhvPtD.js +1165 -0
- package/dist/compact.runtime-36E5vKsC.js +12 -0
- package/dist/compact.runtime.js +1 -1
- package/dist/completion-cli-Bf4mEw2W.js +393 -0
- package/dist/config-BJJhHN9E.js +374 -0
- package/dist/config-mutations-swLu-j_p.js +161 -0
- package/dist/config-schema-Tjner6bM.d.ts +20 -0
- package/dist/context-engine-host-compat-6fkn_daV.js +280 -0
- package/dist/context-engine-host-compat-DtAZC1bS.js +2 -0
- package/dist/context-engine-lifecycle-R__Idxi1.js +627 -0
- package/dist/control-auth-DnkI94_D.js +114 -0
- package/dist/control-service-BBsamNjq.js +40 -0
- package/dist/control-service-BGpHj7RL.js +3 -0
- package/dist/control-ui/assets/activity-D-mnRThU.js +124 -0
- package/dist/control-ui/assets/agents-U_KSP5I_.js +1030 -0
- package/dist/control-ui/assets/channels-ohK9_G1O.js +120 -0
- package/dist/control-ui/assets/cron-6ZCzfU29.js +1016 -0
- package/dist/control-ui/assets/debug-CSsDLg_s.js +97 -0
- package/dist/control-ui/assets/index-jUDczxhd.js +7214 -0
- package/dist/control-ui/assets/instances-782ZoDT4.js +57 -0
- package/dist/control-ui/assets/nodes-BMX16BKM.js +444 -0
- package/dist/control-ui/assets/sessions-jLGSApYa.js +425 -0
- package/dist/control-ui/assets/skills-DweBwUhs.js +362 -0
- package/dist/control-ui/assets/workboard-BsU-FXIo.js +402 -0
- package/dist/control-ui/index.html +1 -1
- package/dist/control-ui/sw.js +1 -1
- package/dist/conversation-runtime-DDekWU-U.js +31 -0
- package/dist/core-Bpk-qSJH.js +284 -0
- package/dist/core-Chrz4oRB.d.ts +223 -0
- package/dist/core-api-DSpUKNVW.js +2 -0
- package/dist/core-api-hLsW03Wo.js +5 -0
- package/dist/crestodian/crestodian.js +1 -1
- package/dist/crestodian/rescue-message.d.ts +1 -1
- package/dist/crestodian/rescue-message.js +1 -1
- package/dist/crestodian-C0x7JjF-.js +55 -0
- package/dist/delegate-BArFIZ4B.d.ts +30 -0
- package/dist/deliver-BnVp3VbL.d.ts +111 -0
- package/dist/delivery-queue-BFOASdf5.d.ts +161 -0
- package/dist/delivery-queue-runtime-BFfc8AEs.d.ts +9 -0
- package/dist/dialogue-No0NvYX7.js +37 -0
- package/dist/direct-dm-C-h88JJH.d.ts +79 -0
- package/dist/directive-handling.fast-lane-DTyDKhZb.js +70 -0
- package/dist/directive-handling.impl-DMReM6tu.js +2 -0
- package/dist/directive-handling.impl-DzPouhV-.js +823 -0
- package/dist/directive-handling.model-selection-BjwTBAZJ.js +122 -0
- package/dist/directive-handling.persist.runtime-D_O1okkR.js +274 -0
- package/dist/directive-handling.persist.runtime.js +1 -1
- package/dist/dispatch-Dtl-oRuN.js +2057 -0
- package/dist/dispatch-acp-transcript.runtime-M4y0Dq74.js +40 -0
- package/dist/dispatch-acp-transcript.runtime.js +1 -1
- package/dist/dispatch-acp.runtime-B8uCIKZS.js +18 -0
- package/dist/dispatch-acp.runtime.js +1 -1
- package/dist/dispatcher-DslvaRcj.js +106 -0
- package/dist/doctor-config-flow-LU2C94af.js +1819 -0
- package/dist/doctor-core-checks-BqcjExIZ.js +666 -0
- package/dist/doctor-core-checks-Diuk8l0N.js +2 -0
- package/dist/doctor-core-checks.runtime-DbS-kMZN.js +278 -0
- package/dist/doctor-core-checks.runtime.js +1 -1
- package/dist/doctor-health-BdqHwfYE.js +65 -0
- package/dist/doctor-health-contributions-DLLTVnll.js +874 -0
- package/dist/doctor-lint-PZqkVMWf.js +95 -0
- package/dist/doctor-mRfJMSb5.js +6 -0
- package/dist/doctor-state-integrity-Cdlm-peH.js +1257 -0
- package/dist/draft-stream-controls-B7uLonbw.d.ts +159 -0
- package/dist/embedded-agent-CEpOPW6X.js +4 -0
- package/dist/embedded-agent-CNINO_M-.d.ts +5 -0
- package/dist/embedded-agent-DxwzoZkp.js +4074 -0
- package/dist/embedded-agent.runtime-DDbhA85-.js +4 -0
- package/dist/embedded-agent.runtime.js +1 -1
- package/dist/embedded-backend-ChaKCepC.js +1581 -0
- package/dist/embedded-gateway-stub.runtime-e_ZxGhcW.js +12 -0
- package/dist/embedded-gateway-stub.runtime.js +1 -1
- package/dist/entry.d.ts +1 -1
- package/dist/extensionAPI.d.ts +2 -2
- package/dist/extensionAPI.js +1 -1
- package/dist/extensions/active-memory/index.d.ts +1 -1
- package/dist/extensions/active-memory/index.js +1 -1
- package/dist/extensions/admin-http-rpc/index.d.ts +1 -1
- package/dist/extensions/admin-http-rpc/index.js +1 -1
- package/dist/extensions/bonjour/index.d.ts +1 -1
- package/dist/extensions/browser/browser-bridge.js +1 -1
- package/dist/extensions/browser/browser-config.js +4 -4
- package/dist/extensions/browser/browser-control-auth.js +2 -2
- package/dist/extensions/browser/browser-doctor.js +2 -2
- package/dist/extensions/browser/browser-maintenance.js +1 -1
- package/dist/extensions/browser/browser-profiles.js +2 -2
- package/dist/extensions/browser/browser-runtime-api.js +12 -12
- package/dist/extensions/browser/cli-metadata.d.ts +1 -1
- package/dist/extensions/browser/cli-metadata.js +1 -1
- package/dist/extensions/browser/index.d.ts +1 -1
- package/dist/extensions/browser/index.js +1 -1
- package/dist/extensions/browser/plugin-registration.d.ts +1 -1
- package/dist/extensions/browser/plugin-registration.js +1 -1
- package/dist/extensions/browser/register.runtime.d.ts +2 -2
- package/dist/extensions/browser/register.runtime.js +4 -4
- package/dist/extensions/browser/runtime-api.d.ts +3 -3
- package/dist/extensions/browser/runtime-api.js +14 -14
- package/dist/extensions/browser/setup-api.d.ts +1 -1
- package/dist/extensions/canvas/cli-metadata.d.ts +1 -1
- package/dist/extensions/canvas/index.d.ts +1 -1
- package/dist/extensions/canvas/index.js +1 -1
- package/dist/extensions/canvas/setup-api.d.ts +1 -1
- package/dist/extensions/deepseek/api.d.ts +1 -1
- package/dist/extensions/deepseek/index.d.ts +1 -1
- package/dist/extensions/deepseek/provider-discovery.d.ts +1 -1
- package/dist/extensions/deepseek/stream.d.ts +1 -1
- package/dist/extensions/device-pair/api.d.ts +4 -4
- package/dist/extensions/device-pair/api.js +1 -1
- package/dist/extensions/device-pair/index.d.ts +1 -1
- package/dist/extensions/device-pair/notify.d.ts +1 -1
- package/dist/extensions/device-pair/pair-command-approve.js +1 -1
- package/dist/extensions/device-pair/qr-image.d.ts +1 -1
- package/dist/extensions/memory-core/api.d.ts +1 -1
- package/dist/extensions/memory-core/cli-metadata.d.ts +1 -1
- package/dist/extensions/memory-core/cli-metadata.js +1 -1
- package/dist/extensions/memory-core/index.d.ts +1 -1
- package/dist/extensions/memory-core/manager-runtime.d.ts +1 -1
- package/dist/extensions/memory-core/runtime-api.d.ts +3 -3
- package/dist/extensions/skill-workshop/api.d.ts +2 -2
- package/dist/extensions/skill-workshop/api.js +1 -1
- package/dist/extensions/skill-workshop/index.d.ts +1 -1
- package/dist/extensions/skill-workshop/index.js +2 -2
- package/dist/extensions/tavily/index.d.ts +1 -1
- package/dist/extensions/tavily/web-search-contract-api.d.ts +1 -1
- package/dist/extensions/tavily/web-search-provider.d.ts +1 -1
- package/dist/extensions/thread-ownership/api.d.ts +2 -2
- package/dist/extensions/thread-ownership/index.d.ts +1 -1
- package/dist/extensions/webhooks/api.d.ts +2 -2
- package/dist/extensions/webhooks/api.js +1 -1
- package/dist/extensions/webhooks/index.d.ts +1 -1
- package/dist/extensions/webhooks/index.js +1 -1
- package/dist/extensions/webhooks/runtime-api.d.ts +1 -1
- package/dist/extensions/workboard/api.d.ts +2 -2
- package/dist/extensions/workboard/index.d.ts +1 -1
- package/dist/extensions/workboard/index.js +1 -1
- package/dist/extensions/workboard/runtime-api.d.ts +1 -1
- package/dist/fengming-runtime-CtRd5677.d.ts +153 -0
- package/dist/fengming-tools-DBLsJfsf.js +12221 -0
- package/dist/gateway-cli-BgDV2HF9.js +443 -0
- package/dist/gateway-method-runtime-d9oN_XO9.js +21 -0
- package/dist/get-reply-CEMtvaTJ.js +5198 -0
- package/dist/get-reply-from-config.runtime-CE8zmX7o.js +2 -0
- package/dist/get-reply-from-config.runtime.js +1 -1
- package/dist/heartbeat-runner-H8SmaKmJ.js +5 -0
- package/dist/heartbeat-runner.runtime-6hUaxEbl.js +3 -0
- package/dist/heartbeat-runner.runtime.js +1 -1
- package/dist/hooks-DkEvkwzS.js +536 -0
- package/dist/host-compat-DeAq3dnI.d.ts +21 -0
- package/dist/http-registry-BDoApjTY.d.ts +23 -0
- package/dist/inbound-reply-dispatch-CIYP2OPo.d.ts +156 -0
- package/dist/inbound-reply-dispatch-geHu6oUK.js +147 -0
- package/dist/inbound-reply-dispatch-vwW5Hl-_.js +2 -0
- package/dist/index.js +1 -1
- package/dist/init-DpE_6dG4.js +59 -0
- package/dist/interactive-Cb_1f91G.d.ts +26 -0
- package/dist/isolated-agent-B_upYOOM.js +2 -0
- package/dist/isolated-agent-KH9uwWhw.js +1097 -0
- package/dist/kernel-BHnBXnm2.d.ts +241 -0
- package/dist/lifecycle-BmZwopzF.js +570 -0
- package/dist/list.probe-5kzWm9Jk.js +451 -0
- package/dist/list.probe-9zBcGGQ4.js +2 -0
- package/dist/list.status-command-DY2ifqp1.js +815 -0
- package/dist/llm-slug-generator-Bmx0I84M.js +78 -0
- package/dist/llm-slug-generator.js +1 -1
- package/dist/loader-BVz75gSb.d.ts +142 -0
- package/dist/local-dispatch.runtime-CX3IOY1E.js +10 -0
- package/dist/local-dispatch.runtime.js +1 -1
- package/dist/manager-BXGg8bfG.d.ts +409 -0
- package/dist/mcp-http-B1lnh67s.js +2 -0
- package/dist/mcp-http-CamghE-W.js +583 -0
- package/dist/media-runtime-DpykroJR.d.ts +261 -0
- package/dist/memory-core-host-engine-embeddings-N2dX5P40.d.ts +324 -0
- package/dist/memory-core-host-engine-storage-WQfkQMer.d.ts +54 -0
- package/dist/message-handler-Ca_pqGVS.js +1806 -0
- package/dist/model-catalog-BBMLIjhq.d.ts +88 -0
- package/dist/model-selection-Cq82FXLy.js +352 -0
- package/dist/models-cli-Dm_393dw.js +257 -0
- package/dist/monitor-d0eyE2k0.js +60 -0
- package/dist/monitor.account-vLQ3bKHu.js +5382 -0
- package/dist/nodes-Bunvrb33.js +1483 -0
- package/dist/nodes-edNlxb2I.js +3 -0
- package/dist/nodes-pending-DEIwVh9v.js +211 -0
- package/dist/openai-compat-errors-CvWEoG98.js +136 -0
- package/dist/openai-http-Bskdv4Tv.js +836 -0
- package/dist/openresponses-http-DxdgCxFU.js +1175 -0
- package/dist/operations-Z85LFqsT.js +805 -0
- package/dist/outbound.types-DVkbsxo8.d.ts +291 -0
- package/dist/plugin-enabled-fvhTpvYS.js +232 -0
- package/dist/plugin-entry-CunlVUw6.d.ts +47 -0
- package/dist/plugin-registration-9ovnK_Tk.js +97 -0
- package/dist/plugin-runtime-DH2ZM9P5.d.ts +117 -0
- package/dist/plugin-sdk/.boundary-entry-shims.stamp +1 -1
- package/dist/plugin-sdk/acp-runtime-backend.js +1 -1
- package/dist/plugin-sdk/acp-runtime.js +1 -1
- package/dist/plugin-sdk/agent-harness-runtime.js +5 -5
- package/dist/plugin-sdk/agent-harness-task-runtime.js +1 -1
- package/dist/plugin-sdk/agent-harness.js +6 -6
- package/dist/plugin-sdk/agent-runtime.js +2 -2
- package/dist/plugin-sdk/bundled-channel-config-schema-Dfn3b8sF.d.ts +3169 -0
- package/dist/plugin-sdk/bundled-channel-config-schema.d.ts +1 -1
- package/dist/plugin-sdk/channel-config-schema-legacy.d.ts +1 -1
- package/dist/plugin-sdk/channel-core.js +2 -2
- package/dist/plugin-sdk/channel-envelope.js +1 -1
- package/dist/plugin-sdk/channel-inbound-roots.js +1 -1
- package/dist/plugin-sdk/channel-inbound.js +2 -2
- package/dist/plugin-sdk/channel-location.js +1 -1
- package/dist/plugin-sdk/channel-message-runtime.js +3 -3
- package/dist/plugin-sdk/channel-message.js +2 -2
- package/dist/plugin-sdk/channel-runtime.js +0 -1
- package/dist/plugin-sdk/command-status-runtime.js +1 -1
- package/dist/plugin-sdk/compat.js +1 -1
- package/dist/plugin-sdk/conversation-binding-runtime.js +1 -1
- package/dist/plugin-sdk/conversation-runtime.js +3 -3
- package/dist/plugin-sdk/core.js +2 -2
- package/dist/plugin-sdk/discord.d.ts +1 -1
- package/dist/plugin-sdk/gateway-method-runtime.js +1 -1
- package/dist/plugin-sdk/health.js +1 -1
- package/dist/plugin-sdk/hook-runtime.js +0 -1
- package/dist/plugin-sdk/inbound-reply-dispatch.js +2 -2
- package/dist/plugin-sdk/index.js +1 -1
- package/dist/plugin-sdk/infra-runtime.js +3 -1
- package/dist/plugin-sdk/provider-auth-api-key.js +0 -1
- package/dist/plugin-sdk/provider-stream-family.js +0 -1
- package/dist/plugin-sdk/provider-usage.js +649 -1
- package/dist/plugin-sdk/reply-runtime.js +4 -4
- package/dist/plugin-sdk/video-generation.js +206 -1
- package/dist/plugin-service-BdZxoKBZ.js +1249 -0
- package/dist/plugin-service-quTl5hT0.d.ts +24 -0
- package/dist/plugins/build-smoke-entry.d.ts +2 -2
- package/dist/plugins/loader.d.ts +1 -1
- package/dist/plugins/provider-discovery.runtime.d.ts +1 -1
- package/dist/plugins/provider-runtime.runtime.d.ts +1 -1
- package/dist/plugins/runtime/index.d.ts +1 -1
- package/dist/plugins/runtime/index.js +4 -4
- package/dist/plugins/tools.d.ts +1 -1
- package/dist/prepare.runtime-DFvkUqBZ.js +798 -0
- package/dist/prepare.runtime.js +1 -1
- package/dist/preview-warnings-CGzc8ccG.js +618 -0
- package/dist/program-D19g2jaa.js +131 -0
- package/dist/provider-api-key-auth-B8GgTfo8.d.ts +27 -0
- package/dist/provider-auth-result-Diw-woMA.d.ts +21 -0
- package/dist/provider-catalog-shared-hMvzzDgL.d.ts +62 -0
- package/dist/provider-dispatcher-DCTc4lG_.js +22 -0
- package/dist/provider-dispatcher.runtime.js +1 -1
- package/dist/provider-model-shared-BUCh3uCL.d.ts +143 -0
- package/dist/provider-registry-BIokPlxa.d.ts +8 -0
- package/dist/provider-registry-CyUOXHG-.d.ts +8 -0
- package/dist/provider-registry-i--H79Ao.d.ts +29 -0
- package/dist/provider-self-hosted-setup-BF8UR8wg.d.ts +74 -0
- package/dist/provider-stream-NF0XJnar.d.ts +139 -0
- package/dist/provider-stream-shared-DLwDaYed.d.ts +132 -0
- package/dist/provider-web-search-contract-fields-D61Vl5Kl.d.ts +25 -0
- package/dist/pw-ai-DYR-D7xR.js +3064 -0
- package/dist/register.agent-DwW0mQPk.js +152 -0
- package/dist/register.crestodian-BhIukKDA.js +24 -0
- package/dist/register.maintenance-DWHlvztJ.js +85 -0
- package/dist/register.subclis-Bsvdh8RI.js +3 -0
- package/dist/register.subclis-DVk0HU4k.js +31 -0
- package/dist/register.subclis-core-BK7nVvl6.js +278 -0
- package/dist/registry-hscEPAcC.d.ts +8 -0
- package/dist/registry-types-Ce-n1tuw.d.ts +392 -0
- package/dist/repair-sequencing-0-qGNSUO.js +652 -0
- package/dist/reply-payload-mCw4ZND6.d.ts +200 -0
- package/dist/reply-turn-admission-DMWNadoS.js +2056 -0
- package/dist/reply.runtime-CE8zmX7o.js +2 -0
- package/dist/reply.runtime.js +1 -1
- package/dist/result-fallback-classifier-BZmv2ACy.js +98 -0
- package/dist/route-qQ-jYpFa.js +475 -0
- package/dist/routes-dTCmw98g.js +2 -0
- package/dist/routes-r8DRKa83.js +3701 -0
- package/dist/run-BgH7EPGH.js +1162 -0
- package/dist/run-command-DCsM-BVh.js +23 -0
- package/dist/run-command-I2ib4dwS.js +2 -0
- package/dist/run-context-CWaKUKKJ.js +66 -0
- package/dist/run-embedded.runtime-CBnDBWN0.js +4 -0
- package/dist/run-embedded.runtime.js +1 -1
- package/dist/run-execution-cli.runtime-DlYXI-lw.js +4 -0
- package/dist/run-execution-cli.runtime.js +1 -1
- package/dist/run-executor.runtime-DwepGrmB.js +330 -0
- package/dist/run-executor.runtime.js +1 -1
- package/dist/run-subagent-registry.runtime-CeVpoIhj.js +2 -0
- package/dist/run-subagent-registry.runtime.js +1 -1
- package/dist/runtime-D2ee-rNh.js +436 -0
- package/dist/runtime-api-B99ZlkNt.d.ts +5 -0
- package/dist/runtime-api-Cta2L_Yo.js +12 -0
- package/dist/runtime-channel-LKOkML3M.js +2 -0
- package/dist/runtime-channel-UtWvrTZ5.js +148 -0
- package/dist/runtime-embedded-agent.runtime-9O2Idzyb.js +2 -0
- package/dist/runtime-embedded-agent.runtime.js +1 -1
- package/dist/runtime-forwarders-DjI8RFL5.d.ts +39 -0
- package/dist/sdk-setup-tools-B-X04pa6.js +8 -0
- package/dist/selection-B02h8Old.js +3 -0
- package/dist/selection-DEPvzrW2.js +18365 -0
- package/dist/server-CMYi8gDo.js +24 -0
- package/dist/server-Cx07rsiY.js +72 -0
- package/dist/server-close.runtime.js +1 -1
- package/dist/server-context-BIemGRt4.js +2 -0
- package/dist/server-context-CB_an9iy.js +955 -0
- package/dist/server-cron-BeyuBUjb.js +3173 -0
- package/dist/server-cron-CV7KkVeB.js +2 -0
- package/dist/server-methods-C7EnpOhB.js +497 -0
- package/dist/server-node-events-DMMzZciN.js +597 -0
- package/dist/server-plugin-bootstrap-O6MzvzL8.js +71 -0
- package/dist/server-plugins-Dwnaz9kX.js +435 -0
- package/dist/server-reload-handlers-C-6TyPvI.js +719 -0
- package/dist/server-restart-sentinel-Dc35eYgk.js +700 -0
- package/dist/server-runtime-services-DCs-gqh_.js +3 -0
- package/dist/server-runtime-services-DF2fzzVd.js +147 -0
- package/dist/server-startup-plugins-t-YeYibm.js +127 -0
- package/dist/server-startup-post-attach-CiEki-DC.js +793 -0
- package/dist/server-ws-runtime-uaUpI-e8.js +374 -0
- package/dist/server.impl-MoHjSMr5.js +2622 -0
- package/dist/session-kill-http-CYCiQpt2.js +121 -0
- package/dist/session-reset-service-BYbADY57.js +651 -0
- package/dist/session-status.runtime-8NASbeO4.js +2 -0
- package/dist/session-status.runtime.js +1 -1
- package/dist/session-subagent-reactivation.runtime-DGeNY2Rb.js +2 -0
- package/dist/session-subagent-reactivation.runtime.js +1 -1
- package/dist/session-tab-registry-C2eElZrt.js +551 -0
- package/dist/sessions-DXAdVXIx.js +1917 -0
- package/dist/sessions-history-http-BwK7b8OH.js +432 -0
- package/dist/sessions-patch-BYC5gvY1.js +401 -0
- package/dist/sessions-resolve-C3ORcdmo.js +180 -0
- package/dist/sessions.runtime-BijldeSY.js +2 -0
- package/dist/sessions.runtime.js +1 -1
- package/dist/snapshot-urls-C5CfP3Co.js +317 -0
- package/dist/speech-core-wWkTZPpQ.d.ts +49 -0
- package/dist/standalone-CHrieUsw.js +42 -0
- package/dist/startup-context-CZfmG8-g.js +314 -0
- package/dist/status-subagents.runtime-D2XMebiS.js +32 -0
- package/dist/status-subagents.runtime.js +1 -1
- package/dist/status-text-JR7IPyzZ.js +301 -0
- package/dist/stream-BJgTkLEI.d.ts +5 -0
- package/dist/subagent-announce-B9cfs_KZ.js +353 -0
- package/dist/subagent-announce-delivery-CtmEvLTS.js +1369 -0
- package/dist/subagent-control-DVqLHi9O.js +492 -0
- package/dist/subagent-hooks-D251uSvy.js +230 -0
- package/dist/subagent-hooks-api-DvdMKxsC.js +23 -0
- package/dist/subagent-hooks-uLORYChc.js +2 -0
- package/dist/subagent-registry-BW2l_oYu.js +3 -0
- package/dist/subagent-registry-BxEMHuiN.js +2627 -0
- package/dist/subagent-registry.runtime.d.ts +1 -1
- package/dist/subagent-registry.runtime.js +1 -1
- package/dist/subagent-session-cleanup-BC5wV2qQ.js +390 -0
- package/dist/system-fvgHsr2x.js +111 -0
- package/dist/talk-DU0Sod_K.js +2454 -0
- package/dist/target-id-BR2xJIkd.js +107 -0
- package/dist/task-registry-control.runtime.js +1 -1
- package/dist/thread-bindings-8XNu5U2p.js +228 -0
- package/dist/tool-Boeg0N5g.js +143 -0
- package/dist/tool-dispatch-BhLLaL2g.js +155 -0
- package/dist/tool-resolution-CzsLs-87.js +153 -0
- package/dist/tool-split-Bedy42Ms.d.ts +19 -0
- package/dist/tools-B6egHpE3.d.ts +38 -0
- package/dist/tools-effective-NXscxK8n.js +442 -0
- package/dist/tools-effective-inventory-NsGMUVo-.js +379 -0
- package/dist/tools-invoke-_sSu96Kq.js +51 -0
- package/dist/tools-invoke-http-BDhlRl-G.js +68 -0
- package/dist/tools-invoke-shared-BH-T9Bcg.js +200 -0
- package/dist/tts-runtime-C1wu3o15.d.ts +230 -0
- package/dist/tui-C733Qov0.js +2 -0
- package/dist/tui-DqbscVN5.js +3 -0
- package/dist/tui-backend-_Pn3Byj-.js +257 -0
- package/dist/tui-cli-CAiC39zd.js +40 -0
- package/dist/tui-ink-run-ChXEGj1h.js +7414 -0
- package/dist/tui-ink-run-D4mSfLHj.js +2 -0
- package/dist/types-BQw1qXGl.d.ts +7034 -0
- package/dist/types-BzMoU6-C.d.ts +111 -0
- package/dist/types-DltHmoCX.d.ts +393 -0
- package/dist/types.public-C_bVIMBl.d.ts +70 -0
- package/dist/web-fetch/runtime.d.ts +1 -1
- package/dist/webhook-targets-DW2jhddP.d.ts +99 -0
- package/npm-shrinkwrap.json +12861 -11889
- package/package.json +2 -5
- package/skills/batch/SKILL.md +118 -0
- package/skills/code-review/SKILL.md +107 -0
- package/skills/debug/SKILL.md +83 -0
- package/skills/loop/SKILL.md +118 -0
- package/skills/run/SKILL.md +79 -0
- package/skills/run-skill-generator/SKILL.md +179 -0
- package/skills/verify/SKILL.md +103 -0
- package/dist/abort-DGskei2p.js +0 -277
- package/dist/abort.runtime-Buq9IZxn.js +0 -2
- package/dist/acp-spawn-DC6IyYaB.js +0 -1286
- package/dist/acp-spawn-Diqb3nel.js +0 -2
- package/dist/acp-stateful-target-driver-Clhe_L8v.js +0 -89
- package/dist/active-tool-schema-warnings-BRhKkyvt.js +0 -2
- package/dist/active-tool-schema-warnings-C6N0-ce6.js +0 -105
- package/dist/agent-C5lhsEZJ.js +0 -2
- package/dist/agent-WEb757bl.js +0 -1825
- package/dist/agent-command-iLD_nsVY.js +0 -1435
- package/dist/agent-core-BeDN8Ns5.d.ts +0 -13
- package/dist/agent-harness-runtime-C89_Q-bW.d.ts +0 -913
- package/dist/agent-harness-runtime-Dfn5rik2.js +0 -207
- package/dist/agent-runner-utils-DNiuuo43.js +0 -267
- package/dist/agent-runner.runtime-CFF_qJ5V.js +0 -3784
- package/dist/agent-runtime-BkMtWXxn.js +0 -199
- package/dist/agent-runtime-HufMO_YR.d.ts +0 -207
- package/dist/agent-tools-HmaDv4ot.js +0 -2506
- package/dist/agent-via-gateway-CZQG8RYL.js +0 -486
- package/dist/agent-wait-dedupe-C3xQk2Ww.js +0 -180
- package/dist/agent-z1cs3c7n.js +0 -3
- package/dist/api-B4IMKjSe.js +0 -3
- package/dist/api-BwSbBWI8.js +0 -3
- package/dist/api-CE9In9m4.js +0 -5
- package/dist/api-ClPvYNGa.js +0 -32
- package/dist/api-CntBCaZf.js +0 -3
- package/dist/api-DBZBwTsn.js +0 -6
- package/dist/api-OCPwGOvK.js +0 -2
- package/dist/api-yYhEo7gK.js +0 -4
- package/dist/approval-client-helpers-CfdQ3-vv.d.ts +0 -78
- package/dist/approval-native-helpers-DSHPksK4.d.ts +0 -241
- package/dist/approval-renderers-BfEfwk44.d.ts +0 -39
- package/dist/assistant-v5fdOYu7.js +0 -291
- package/dist/attachment-normalize-BHAbLiL2.js +0 -213
- package/dist/attempt-execution-5w9WYbaJ.js +0 -584
- package/dist/attempt-execution.runtime-DnhOWGzr.js +0 -3
- package/dist/attempt.prompt-helpers-C4M4erF7.js +0 -543
- package/dist/binding-routing-Dpes-QF1.js +0 -113
- package/dist/binding-targets-B6H5Pd-A.js +0 -121
- package/dist/bridge-server-BCpxCRm_.js +0 -113
- package/dist/browser-cli-DMhXHopl.js +0 -230
- package/dist/browser-cli-Dy_VugK0.js +0 -2
- package/dist/browser-cli-actions-input-WMP7_lm6.js +0 -522
- package/dist/browser-cli-actions-observe-DQWAWhwU.js +0 -81
- package/dist/browser-cli-debug-CaT2ZKAx.js +0 -137
- package/dist/browser-cli-inspect-DU-LUXq1.js +0 -117
- package/dist/browser-cli-manage-DAuogqIh.js +0 -446
- package/dist/browser-cli-resize-Cz5uO_aR.js +0 -32
- package/dist/browser-cli-shared-CjPZcG3j.js +0 -69
- package/dist/browser-cli-state-CC3l77-K.js +0 -371
- package/dist/browser-control-auth-ELccIUZy.js +0 -2
- package/dist/browser-profiles-Cuy4ia6_.js +0 -2
- package/dist/browser-runtime-De-iUfME.js +0 -389
- package/dist/build-DEF8Per9.js +0 -261
- package/dist/capability-cli-Bydel4E7.js +0 -1809
- package/dist/channel-6SGL4R5P.js +0 -2309
- package/dist/channel-D3Q3b8J-.d.ts +0 -427
- package/dist/channel-core-Bj71kAB5.d.ts +0 -6
- package/dist/channel-core-DMvyWnHg.js +0 -5
- package/dist/channel-entry-contract-zYxRmEdf.d.ts +0 -114
- package/dist/channel-inbound-DVJzBcJ8.d.ts +0 -97
- package/dist/channel-inbound-DlCa7eJe.js +0 -121
- package/dist/channel-message-CyPGMMFB.js +0 -12
- package/dist/channel-message-Czl4cdoA.d.ts +0 -9
- package/dist/channel-outbound-BNbhmruA.d.ts +0 -325
- package/dist/channel-pairing-BiS-tSvl.d.ts +0 -58
- package/dist/channel-runtime-D8hntg7H.js +0 -7
- package/dist/channel.runtime-DxErReJR.js +0 -697
- package/dist/chat-BLA8ORQI.js +0 -3
- package/dist/chat-DWRXkuvU.js +0 -2940
- package/dist/chrome-DPwFYi-g.js +0 -1517
- package/dist/cli-compaction-YZpssARf.js +0 -363
- package/dist/cli-runner-D2OAqxu3.js +0 -597
- package/dist/cli-runner-DO4SORQf.js +0 -2
- package/dist/cli-runner.runtime-CNSIpbeT.js +0 -4
- package/dist/cli-runner.runtime-DAOYvpVQ.js +0 -3
- package/dist/command-registry-DpD0fb8D.js +0 -4
- package/dist/command-registry-core-Cl3tLG8G.js +0 -114
- package/dist/command-registry-nbP7c8RT.js +0 -9
- package/dist/command-status.runtime-BBuXTkq0.js +0 -90
- package/dist/commands-CR8MVvlD.d.ts +0 -117
- package/dist/commands-compact.runtime-BoafIjjg.js +0 -10
- package/dist/commands-handlers.runtime-D9jViG_x.js +0 -6327
- package/dist/commands-status-BqqJ7PVq.js +0 -16
- package/dist/commands-status-CMd41Vxf.js +0 -3
- package/dist/commands-status.runtime-CMd41Vxf.js +0 -3
- package/dist/commands-subagents-control.runtime-CU4I3A_n.js +0 -2
- package/dist/commands-system-prompt-CTtu1D3-.js +0 -2
- package/dist/commands-system-prompt-xswhORdM.js +0 -161
- package/dist/commands-types-B67CsqXf.d.ts +0 -132
- package/dist/commands.runtime-BUFhkrjQ.js +0 -175
- package/dist/compact-Dz_WvRkQ.js +0 -1165
- package/dist/compact.runtime-n-AKErni.js +0 -12
- package/dist/completion-cli-DJYs_L4_.js +0 -393
- package/dist/config-CFMbHJb0.js +0 -374
- package/dist/config-mutations-DCAloTKR.js +0 -161
- package/dist/config-schema-Drw1zrnG.d.ts +0 -20
- package/dist/context-engine-host-compat-4mNm1HCE.js +0 -2
- package/dist/context-engine-host-compat-BzJ7fUIn.js +0 -280
- package/dist/context-engine-lifecycle-V4PNQp6k.js +0 -627
- package/dist/control-auth-DG_cw-aN.js +0 -114
- package/dist/control-service-CurYipgK.js +0 -3
- package/dist/control-service-VyncoV7j.js +0 -40
- package/dist/control-ui/assets/activity-D5Plhlo-.js +0 -124
- package/dist/control-ui/assets/agents-Chcdfe1E.js +0 -1030
- package/dist/control-ui/assets/channels-BEtB4H37.js +0 -120
- package/dist/control-ui/assets/cron-CZyPkxSU.js +0 -1016
- package/dist/control-ui/assets/debug-DvM8iG47.js +0 -97
- package/dist/control-ui/assets/index-Rmpgh0f1.js +0 -7214
- package/dist/control-ui/assets/instances-yTC_uu60.js +0 -57
- package/dist/control-ui/assets/nodes-vbAxVHIH.js +0 -444
- package/dist/control-ui/assets/sessions-DOviHme5.js +0 -425
- package/dist/control-ui/assets/skills-Bfp5HEGW.js +0 -362
- package/dist/control-ui/assets/workboard-5sU2kHsV.js +0 -402
- package/dist/conversation-runtime-DgaABwHh.js +0 -31
- package/dist/core-BeBXdneV.js +0 -284
- package/dist/core-Chqb7X6l.d.ts +0 -223
- package/dist/core-api-BlK0FgBM.js +0 -2
- package/dist/core-api-pAvYk716.js +0 -5
- package/dist/crestodian-FeGTBqO1.js +0 -55
- package/dist/delegate-BjIjSU_E.d.ts +0 -30
- package/dist/deliver-CvtWN4Ey.d.ts +0 -111
- package/dist/delivery-queue-CQ-cj3KG.d.ts +0 -161
- package/dist/delivery-queue-runtime-ut7MG04m.d.ts +0 -9
- package/dist/detect-BjXPyrwn.js +0 -115
- package/dist/detect-C1xeIemQ.d.ts +0 -16
- package/dist/dialogue-BowVYhEC.js +0 -37
- package/dist/direct-dm-DoZZHpA0.d.ts +0 -79
- package/dist/directive-handling.fast-lane-hnmQ_CvD.js +0 -70
- package/dist/directive-handling.impl-Cai-CFS1.js +0 -2
- package/dist/directive-handling.impl-DY84qIfU.js +0 -823
- package/dist/directive-handling.model-selection-DASssLFQ.js +0 -122
- package/dist/directive-handling.persist.runtime-BY7tJUs2.js +0 -274
- package/dist/dispatch-D5iG5A8j.js +0 -2057
- package/dist/dispatch-acp-transcript.runtime-D3r16hbD.js +0 -40
- package/dist/dispatch-acp.runtime-CAIau5qX.js +0 -18
- package/dist/dispatcher-7-d2gw3J.js +0 -106
- package/dist/doctor-DD5YEMmf.js +0 -6
- package/dist/doctor-config-flow-CdlLHJmX.js +0 -1819
- package/dist/doctor-core-checks-6MP99TQG.js +0 -666
- package/dist/doctor-core-checks-Dm_o576z.js +0 -2
- package/dist/doctor-core-checks.runtime-B2qbKATd.js +0 -278
- package/dist/doctor-health-BKrhOv1v.js +0 -65
- package/dist/doctor-health-contributions-bIBLmw69.js +0 -874
- package/dist/doctor-lint-aOLOWli4.js +0 -95
- package/dist/doctor-state-integrity-23NQNNuo.js +0 -1257
- package/dist/draft-stream-controls-Bk1GVJ1l.d.ts +0 -159
- package/dist/embedded-agent-BeK8FhZr.d.ts +0 -5
- package/dist/embedded-agent-CNp_y7jW.js +0 -4074
- package/dist/embedded-agent-NEmNlXDR.js +0 -4
- package/dist/embedded-agent.runtime-hEby8P2s.js +0 -4
- package/dist/embedded-backend-BdbgfpBP.js +0 -1581
- package/dist/embedded-gateway-stub.runtime-ySZUA3Gy.js +0 -12
- package/dist/extensions/alibaba/fengming.plugin.json +0 -47
- package/dist/extensions/alibaba/index.d.ts +0 -12
- package/dist/extensions/alibaba/index.js +0 -13
- package/dist/extensions/alibaba/package.json +0 -15
- package/dist/extensions/alibaba/video-generation-provider.d.ts +0 -6
- package/dist/extensions/alibaba/video-generation-provider.js +0 -2
- package/dist/extensions/baichuan/fengming.plugin.json +0 -69
- package/dist/extensions/baichuan/index.d.ts +0 -11
- package/dist/extensions/baichuan/index.js +0 -45
- package/dist/extensions/baichuan/models.d.ts +0 -7
- package/dist/extensions/baichuan/models.js +0 -2
- package/dist/extensions/baichuan/onboard.d.ts +0 -5
- package/dist/extensions/baichuan/onboard.js +0 -2
- package/dist/extensions/baichuan/package.json +0 -15
- package/dist/extensions/baichuan/provider-catalog.d.ts +0 -2
- package/dist/extensions/baichuan/provider-catalog.js +0 -2
- package/dist/extensions/baichuan/provider-discovery.d.ts +0 -2
- package/dist/extensions/baichuan/provider-discovery.js +0 -5
- package/dist/extensions/byteplus/api.d.ts +0 -3
- package/dist/extensions/byteplus/api.js +0 -3
- package/dist/extensions/byteplus/fengming.plugin.json +0 -196
- package/dist/extensions/byteplus/index.d.ts +0 -12
- package/dist/extensions/byteplus/index.js +0 -85
- package/dist/extensions/byteplus/models.d.ts +0 -2
- package/dist/extensions/byteplus/models.js +0 -2
- package/dist/extensions/byteplus/package.json +0 -15
- package/dist/extensions/byteplus/provider-catalog.d.ts +0 -2
- package/dist/extensions/byteplus/provider-catalog.js +0 -2
- package/dist/extensions/byteplus/provider-discovery.d.ts +0 -5
- package/dist/extensions/byteplus/provider-discovery.js +0 -23
- package/dist/extensions/byteplus/video-generation-provider.d.ts +0 -6
- package/dist/extensions/byteplus/video-generation-provider.js +0 -2
- package/dist/extensions/longcat/fengming.plugin.json +0 -84
- package/dist/extensions/longcat/index.d.ts +0 -11
- package/dist/extensions/longcat/index.js +0 -45
- package/dist/extensions/longcat/models.d.ts +0 -7
- package/dist/extensions/longcat/models.js +0 -2
- package/dist/extensions/longcat/onboard.d.ts +0 -5
- package/dist/extensions/longcat/onboard.js +0 -2
- package/dist/extensions/longcat/package.json +0 -15
- package/dist/extensions/longcat/provider-catalog.d.ts +0 -2
- package/dist/extensions/longcat/provider-catalog.js +0 -2
- package/dist/extensions/longcat/provider-discovery.d.ts +0 -2
- package/dist/extensions/longcat/provider-discovery.js +0 -5
- package/dist/extensions/minimax/api.d.ts +0 -5
- package/dist/extensions/minimax/api.js +0 -6
- package/dist/extensions/minimax/fengming.plugin.json +0 -206
- package/dist/extensions/minimax/image-generation-provider.d.ts +0 -6
- package/dist/extensions/minimax/image-generation-provider.js +0 -2
- package/dist/extensions/minimax/index.d.ts +0 -12
- package/dist/extensions/minimax/index.js +0 -29
- package/dist/extensions/minimax/media-understanding-provider.d.ts +0 -6
- package/dist/extensions/minimax/media-understanding-provider.js +0 -2
- package/dist/extensions/minimax/model-definitions.d.ts +0 -2
- package/dist/extensions/minimax/model-definitions.js +0 -2
- package/dist/extensions/minimax/music-generation-provider.d.ts +0 -6
- package/dist/extensions/minimax/music-generation-provider.js +0 -2
- package/dist/extensions/minimax/oauth.d.ts +0 -2
- package/dist/extensions/minimax/oauth.js +0 -2
- package/dist/extensions/minimax/oauth.runtime.d.ts +0 -2
- package/dist/extensions/minimax/oauth.runtime.js +0 -2
- package/dist/extensions/minimax/onboard.d.ts +0 -2
- package/dist/extensions/minimax/onboard.js +0 -2
- package/dist/extensions/minimax/package.json +0 -15
- package/dist/extensions/minimax/provider-catalog.d.ts +0 -2
- package/dist/extensions/minimax/provider-catalog.js +0 -2
- package/dist/extensions/minimax/provider-contract-api.d.ts +0 -6
- package/dist/extensions/minimax/provider-contract-api.js +0 -77
- package/dist/extensions/minimax/provider-discovery.d.ts +0 -5
- package/dist/extensions/minimax/provider-discovery.js +0 -23
- package/dist/extensions/minimax/provider-models.d.ts +0 -2
- package/dist/extensions/minimax/provider-models.js +0 -2
- package/dist/extensions/minimax/provider-registration.d.ts +0 -7
- package/dist/extensions/minimax/provider-registration.js +0 -2
- package/dist/extensions/minimax/speech-provider.d.ts +0 -5
- package/dist/extensions/minimax/speech-provider.js +0 -2
- package/dist/extensions/minimax/tts.d.ts +0 -20
- package/dist/extensions/minimax/tts.js +0 -2
- package/dist/extensions/minimax/video-generation-provider.d.ts +0 -7
- package/dist/extensions/minimax/video-generation-provider.js +0 -2
- package/dist/extensions/minimax/web-search-contract-api.d.ts +0 -5
- package/dist/extensions/minimax/web-search-contract-api.js +0 -31
- package/dist/extensions/minimax/web-search-provider.d.ts +0 -5
- package/dist/extensions/minimax/web-search-provider.js +0 -2
- package/dist/extensions/moonshot/api.d.ts +0 -3
- package/dist/extensions/moonshot/api.js +0 -4
- package/dist/extensions/moonshot/fengming.plugin.json +0 -250
- package/dist/extensions/moonshot/index.d.ts +0 -11
- package/dist/extensions/moonshot/index.js +0 -70
- package/dist/extensions/moonshot/media-understanding-provider.d.ts +0 -6
- package/dist/extensions/moonshot/media-understanding-provider.js +0 -2
- package/dist/extensions/moonshot/onboard.d.ts +0 -2
- package/dist/extensions/moonshot/onboard.js +0 -2
- package/dist/extensions/moonshot/package.json +0 -15
- package/dist/extensions/moonshot/provider-catalog.d.ts +0 -2
- package/dist/extensions/moonshot/provider-catalog.js +0 -2
- package/dist/extensions/moonshot/provider-contract-api.d.ts +0 -5
- package/dist/extensions/moonshot/provider-contract-api.js +0 -27
- package/dist/extensions/moonshot/provider-discovery.d.ts +0 -5
- package/dist/extensions/moonshot/provider-discovery.js +0 -15
- package/dist/extensions/moonshot/web-search-contract-api.d.ts +0 -5
- package/dist/extensions/moonshot/web-search-contract-api.js +0 -29
- package/dist/extensions/moonshot/web-search-provider.d.ts +0 -5
- package/dist/extensions/moonshot/web-search-provider.js +0 -2
- package/dist/extensions/qianfan/api.d.ts +0 -3
- package/dist/extensions/qianfan/api.js +0 -3
- package/dist/extensions/qianfan/fengming.plugin.json +0 -89
- package/dist/extensions/qianfan/index.d.ts +0 -11
- package/dist/extensions/qianfan/index.js +0 -26
- package/dist/extensions/qianfan/onboard.d.ts +0 -2
- package/dist/extensions/qianfan/onboard.js +0 -2
- package/dist/extensions/qianfan/package.json +0 -15
- package/dist/extensions/qianfan/provider-catalog.d.ts +0 -2
- package/dist/extensions/qianfan/provider-catalog.js +0 -2
- package/dist/extensions/qwen/api.d.ts +0 -4
- package/dist/extensions/qwen/api.js +0 -5
- package/dist/extensions/qwen/fengming.plugin.json +0 -389
- package/dist/extensions/qwen/index.d.ts +0 -11
- package/dist/extensions/qwen/index.js +0 -202
- package/dist/extensions/qwen/media-understanding-provider.d.ts +0 -6
- package/dist/extensions/qwen/media-understanding-provider.js +0 -2
- package/dist/extensions/qwen/model-definitions.d.ts +0 -2
- package/dist/extensions/qwen/model-definitions.js +0 -2
- package/dist/extensions/qwen/models.d.ts +0 -2
- package/dist/extensions/qwen/models.js +0 -2
- package/dist/extensions/qwen/onboard.d.ts +0 -21
- package/dist/extensions/qwen/onboard.js +0 -2
- package/dist/extensions/qwen/package.json +0 -15
- package/dist/extensions/qwen/provider-catalog.d.ts +0 -2
- package/dist/extensions/qwen/provider-catalog.js +0 -2
- package/dist/extensions/qwen/stream.d.ts +0 -2
- package/dist/extensions/qwen/stream.js +0 -2
- package/dist/extensions/qwen/video-generation-provider.d.ts +0 -6
- package/dist/extensions/qwen/video-generation-provider.js +0 -2
- package/dist/extensions/sensenova/fengming.plugin.json +0 -69
- package/dist/extensions/sensenova/index.d.ts +0 -11
- package/dist/extensions/sensenova/index.js +0 -45
- package/dist/extensions/sensenova/models.d.ts +0 -7
- package/dist/extensions/sensenova/models.js +0 -2
- package/dist/extensions/sensenova/onboard.d.ts +0 -5
- package/dist/extensions/sensenova/onboard.js +0 -2
- package/dist/extensions/sensenova/package.json +0 -15
- package/dist/extensions/sensenova/provider-catalog.d.ts +0 -2
- package/dist/extensions/sensenova/provider-catalog.js +0 -2
- package/dist/extensions/sensenova/provider-discovery.d.ts +0 -2
- package/dist/extensions/sensenova/provider-discovery.js +0 -5
- package/dist/extensions/stepfun/fengming.plugin.json +0 -162
- package/dist/extensions/stepfun/index.d.ts +0 -12
- package/dist/extensions/stepfun/index.js +0 -165
- package/dist/extensions/stepfun/onboard.d.ts +0 -7
- package/dist/extensions/stepfun/onboard.js +0 -2
- package/dist/extensions/stepfun/package.json +0 -15
- package/dist/extensions/stepfun/provider-catalog.d.ts +0 -14
- package/dist/extensions/stepfun/provider-catalog.js +0 -2
- package/dist/extensions/tencent/api.d.ts +0 -3
- package/dist/extensions/tencent/api.js +0 -4
- package/dist/extensions/tencent/fengming.plugin.json +0 -105
- package/dist/extensions/tencent/index.d.ts +0 -12
- package/dist/extensions/tencent/index.js +0 -62
- package/dist/extensions/tencent/models.d.ts +0 -2
- package/dist/extensions/tencent/models.js +0 -2
- package/dist/extensions/tencent/onboard.d.ts +0 -6
- package/dist/extensions/tencent/onboard.js +0 -2
- package/dist/extensions/tencent/package.json +0 -15
- package/dist/extensions/tencent/provider-catalog.d.ts +0 -2
- package/dist/extensions/tencent/provider-catalog.js +0 -2
- package/dist/extensions/tencent/provider-discovery.d.ts +0 -5
- package/dist/extensions/tencent/provider-discovery.js +0 -14
- package/dist/extensions/tiangong/fengming.plugin.json +0 -69
- package/dist/extensions/tiangong/index.d.ts +0 -11
- package/dist/extensions/tiangong/index.js +0 -45
- package/dist/extensions/tiangong/models.d.ts +0 -7
- package/dist/extensions/tiangong/models.js +0 -2
- package/dist/extensions/tiangong/onboard.d.ts +0 -5
- package/dist/extensions/tiangong/onboard.js +0 -2
- package/dist/extensions/tiangong/package.json +0 -15
- package/dist/extensions/tiangong/provider-catalog.d.ts +0 -2
- package/dist/extensions/tiangong/provider-catalog.js +0 -2
- package/dist/extensions/tiangong/provider-discovery.d.ts +0 -2
- package/dist/extensions/tiangong/provider-discovery.js +0 -5
- package/dist/extensions/volcengine/api.d.ts +0 -12
- package/dist/extensions/volcengine/api.js +0 -4
- package/dist/extensions/volcengine/fengming.plugin.json +0 -263
- package/dist/extensions/volcengine/index.d.ts +0 -12
- package/dist/extensions/volcengine/index.js +0 -88
- package/dist/extensions/volcengine/models.d.ts +0 -2
- package/dist/extensions/volcengine/models.js +0 -2
- package/dist/extensions/volcengine/package.json +0 -15
- package/dist/extensions/volcengine/provider-catalog.d.ts +0 -2
- package/dist/extensions/volcengine/provider-catalog.js +0 -2
- package/dist/extensions/volcengine/provider-discovery.d.ts +0 -5
- package/dist/extensions/volcengine/provider-discovery.js +0 -23
- package/dist/extensions/volcengine/speech-provider.d.ts +0 -5
- package/dist/extensions/volcengine/speech-provider.js +0 -2
- package/dist/extensions/volcengine/tts.d.ts +0 -22
- package/dist/extensions/volcengine/tts.js +0 -2
- package/dist/extensions/weixin/fengming.plugin.json +0 -22
- package/dist/extensions/weixin/index.d.ts +0 -26
- package/dist/extensions/weixin/index.js +0 -862
- package/dist/extensions/weixin/package.json +0 -45
- package/dist/extensions/xiaomi/api.d.ts +0 -3
- package/dist/extensions/xiaomi/api.js +0 -3
- package/dist/extensions/xiaomi/fengming.plugin.json +0 -260
- package/dist/extensions/xiaomi/index.d.ts +0 -12
- package/dist/extensions/xiaomi/index.js +0 -284
- package/dist/extensions/xiaomi/onboard.d.ts +0 -2
- package/dist/extensions/xiaomi/onboard.js +0 -2
- package/dist/extensions/xiaomi/package.json +0 -15
- package/dist/extensions/xiaomi/provider-catalog.d.ts +0 -2
- package/dist/extensions/xiaomi/provider-catalog.js +0 -2
- package/dist/extensions/xiaomi/speech-provider.d.ts +0 -5
- package/dist/extensions/xiaomi/speech-provider.js +0 -2
- package/dist/extensions/xiaomi/stream.d.ts +0 -5
- package/dist/extensions/xiaomi/stream.js +0 -2
- package/dist/extensions/xiaomi/thinking.d.ts +0 -11
- package/dist/extensions/xiaomi/thinking.js +0 -2
- package/dist/extensions/xingchen/fengming.plugin.json +0 -69
- package/dist/extensions/xingchen/index.d.ts +0 -11
- package/dist/extensions/xingchen/index.js +0 -45
- package/dist/extensions/xingchen/models.d.ts +0 -7
- package/dist/extensions/xingchen/models.js +0 -2
- package/dist/extensions/xingchen/onboard.d.ts +0 -5
- package/dist/extensions/xingchen/onboard.js +0 -2
- package/dist/extensions/xingchen/package.json +0 -15
- package/dist/extensions/xingchen/provider-catalog.d.ts +0 -2
- package/dist/extensions/xingchen/provider-catalog.js +0 -2
- package/dist/extensions/xingchen/provider-discovery.d.ts +0 -2
- package/dist/extensions/xingchen/provider-discovery.js +0 -5
- package/dist/extensions/yi/fengming.plugin.json +0 -84
- package/dist/extensions/yi/index.d.ts +0 -11
- package/dist/extensions/yi/index.js +0 -45
- package/dist/extensions/yi/models.d.ts +0 -7
- package/dist/extensions/yi/models.js +0 -2
- package/dist/extensions/yi/onboard.d.ts +0 -5
- package/dist/extensions/yi/onboard.js +0 -2
- package/dist/extensions/yi/package.json +0 -15
- package/dist/extensions/yi/provider-catalog.d.ts +0 -2
- package/dist/extensions/yi/provider-catalog.js +0 -2
- package/dist/extensions/yi/provider-discovery.d.ts +0 -2
- package/dist/extensions/yi/provider-discovery.js +0 -5
- package/dist/extensions/zai/api.d.ts +0 -4
- package/dist/extensions/zai/api.js +0 -4
- package/dist/extensions/zai/detect.d.ts +0 -2
- package/dist/extensions/zai/detect.js +0 -2
- package/dist/extensions/zai/fengming.plugin.json +0 -377
- package/dist/extensions/zai/index.d.ts +0 -12
- package/dist/extensions/zai/index.js +0 -297
- package/dist/extensions/zai/media-understanding-provider.d.ts +0 -5
- package/dist/extensions/zai/media-understanding-provider.js +0 -2
- package/dist/extensions/zai/model-definitions.d.ts +0 -2
- package/dist/extensions/zai/model-definitions.js +0 -2
- package/dist/extensions/zai/onboard.d.ts +0 -2
- package/dist/extensions/zai/onboard.js +0 -2
- package/dist/extensions/zai/package.json +0 -15
- package/dist/extensions/zai/runtime-api.d.ts +0 -2
- package/dist/extensions/zai/runtime-api.js +0 -2
- package/dist/extensions/zhinao/fengming.plugin.json +0 -69
- package/dist/extensions/zhinao/index.d.ts +0 -11
- package/dist/extensions/zhinao/index.js +0 -45
- package/dist/extensions/zhinao/models.d.ts +0 -7
- package/dist/extensions/zhinao/models.js +0 -2
- package/dist/extensions/zhinao/onboard.d.ts +0 -5
- package/dist/extensions/zhinao/onboard.js +0 -2
- package/dist/extensions/zhinao/package.json +0 -15
- package/dist/extensions/zhinao/provider-catalog.d.ts +0 -2
- package/dist/extensions/zhinao/provider-catalog.js +0 -2
- package/dist/extensions/zhinao/provider-discovery.d.ts +0 -2
- package/dist/extensions/zhinao/provider-discovery.js +0 -5
- package/dist/fengming-runtime-0jdu_329.d.ts +0 -153
- package/dist/fengming-tools-gQkwsWYz.js +0 -12221
- package/dist/fengming.plugin-C-Kdi1_5.js +0 -130
- package/dist/fengming.plugin-CRPqMj85.js +0 -166
- package/dist/gateway-cli-BV1V43-D.js +0 -443
- package/dist/gateway-method-runtime-J2OPP_oH.js +0 -21
- package/dist/get-reply-BE8ZGJos.js +0 -5198
- package/dist/get-reply-from-config.runtime-C5wfxVI_.js +0 -2
- package/dist/heartbeat-runner-_0HlObMb.js +0 -5
- package/dist/heartbeat-runner.runtime-DvYz_4Z3.js +0 -3
- package/dist/hook-runtime-BH9moP5T.js +0 -4
- package/dist/hooks-icCwsmrQ.js +0 -536
- package/dist/host-compat-dfJvEfe7.d.ts +0 -21
- package/dist/http-registry-Buj7R-F_.d.ts +0 -23
- package/dist/image-generation-provider-hrRXkkGc.js +0 -152
- package/dist/inbound-reply-dispatch-5AYt56Yt.js +0 -147
- package/dist/inbound-reply-dispatch-B5weFW8i.js +0 -2
- package/dist/inbound-reply-dispatch-cJh4H31y.d.ts +0 -156
- package/dist/infra-runtime-3_0R8nmO.js +0 -32
- package/dist/init-BnfkYG_k.js +0 -59
- package/dist/interactive-V8NfYsTW.d.ts +0 -26
- package/dist/isolated-agent-CgH7dfOj.js +0 -1097
- package/dist/isolated-agent-dBWkiw0a.js +0 -2
- package/dist/kernel-Ds2aqAJF.d.ts +0 -241
- package/dist/kimi-web-search-provider-QJT3Ftj3.js +0 -80
- package/dist/kimi-web-search-provider.runtime-Dj3SS4T5.js +0 -307
- package/dist/kimi-web-search-provider.runtime.js +0 -1
- package/dist/lib-Dg4yjNFQ.js +0 -871
- package/dist/lifecycle-B9k7QGsS.js +0 -570
- package/dist/list.probe-CbVHFNwf.js +0 -2
- package/dist/list.probe-CxiEBmyW.js +0 -451
- package/dist/list.status-command-DE-edGgB.js +0 -815
- package/dist/llm-slug-generator-DJgq9eFd.js +0 -78
- package/dist/loader-5AqYM9PC.d.ts +0 -142
- package/dist/local-dispatch.runtime-D3F4v51B.js +0 -10
- package/dist/manager-BWf1ks-Z.d.ts +0 -409
- package/dist/mcp-http-DU7Nsg4P.js +0 -583
- package/dist/mcp-http-iZCW6Cet.js +0 -2
- package/dist/media-runtime-DZ5RpQN7.d.ts +0 -261
- package/dist/media-understanding-DEdEyoQB.d.ts +0 -46
- package/dist/media-understanding-provider-4JHrQOUE.js +0 -70
- package/dist/media-understanding-provider-BV7O82XV.js +0 -29
- package/dist/media-understanding-provider-BlPRhYkx.js +0 -69
- package/dist/media-understanding-provider-BuX8eQLj.js +0 -13
- package/dist/memory-core-host-engine-embeddings-BDu5fx8E.d.ts +0 -324
- package/dist/memory-core-host-engine-storage-CdCuH-E2.d.ts +0 -54
- package/dist/message-handler-L6QLWNVP.js +0 -1806
- package/dist/minimax-web-search-provider-_gxeEOy8.js +0 -58
- package/dist/minimax-web-search-provider.runtime-BF4mGi6U.js +0 -148
- package/dist/minimax-web-search-provider.runtime.js +0 -1
- package/dist/model-catalog-DCnRkX8f.d.ts +0 -88
- package/dist/model-definitions-B2gY43hI.d.ts +0 -34
- package/dist/model-definitions-BLOyeH5h.js +0 -73
- package/dist/model-definitions-CoByf5mT.js +0 -243
- package/dist/model-definitions-WP3OmzbS.d.ts +0 -57
- package/dist/model-selection-DhTE6GZD.js +0 -352
- package/dist/models--iAR9QkZ.js +0 -175
- package/dist/models-8ImVEkvh.js +0 -36
- package/dist/models-BIDM8htk.js +0 -48
- package/dist/models-BRgRfrcS.js +0 -36
- package/dist/models-Bib5-APc.js +0 -67
- package/dist/models-Bl67zOoe.js +0 -36
- package/dist/models-BqDDYFE3.d.ts +0 -65
- package/dist/models-BtRQoRIu.js +0 -36
- package/dist/models-BvXmOXik.js +0 -48
- package/dist/models-C-sJciOD.d.ts +0 -9
- package/dist/models-COnXPdlL.js +0 -24
- package/dist/models-CXTmk-Da.d.ts +0 -8
- package/dist/models-Cz0C_8re.js +0 -36
- package/dist/models-DbwEIt-m.d.ts +0 -15
- package/dist/models-DgXkSADi.js +0 -30
- package/dist/models-cli-Bv3y3JgQ.js +0 -257
- package/dist/monitor-BiVOsbbN.js +0 -1024
- package/dist/monitor-BumfRp1t.js +0 -60
- package/dist/monitor.account-Cd6EwtuZ.js +0 -5382
- package/dist/music-generation-provider-ZdDMiC-c.js +0 -308
- package/dist/nodes-C0f8XgD5.js +0 -1483
- package/dist/nodes-Dk4vOgg9.js +0 -3
- package/dist/nodes-pending-Cjg09MXz.js +0 -211
- package/dist/oauth-BIO69Qw0.d.ts +0 -25
- package/dist/oauth-CnO10TN2.js +0 -207
- package/dist/onboard-B3BYT5k7.js +0 -34
- package/dist/onboard-BDMNV6RE.js +0 -23
- package/dist/onboard-B_WNNy5F.d.ts +0 -6
- package/dist/onboard-BbyMaErU.js +0 -69
- package/dist/onboard-BuYPNE6j2.js +0 -23
- package/dist/onboard-C394zMnM.d.ts +0 -11
- package/dist/onboard-CHn4oVbY.js +0 -24
- package/dist/onboard-CPpVbb0O.js +0 -73
- package/dist/onboard-CWDx7Crt.js +0 -23
- package/dist/onboard-CbzkwBzu.d.ts +0 -12
- package/dist/onboard-D099qUd0.js +0 -23
- package/dist/onboard-D7dbzfHc.js +0 -23
- package/dist/onboard-DB-x0nHF.js +0 -30
- package/dist/onboard-DFVrRnxJ.js +0 -23
- package/dist/onboard-DFiqoOc2.d.ts +0 -7
- package/dist/onboard-DJaMK3rr.d.ts +0 -6
- package/dist/onboard-DMdK8D_h.js +0 -67
- package/dist/onboard-J-KL-I6m.js +0 -48
- package/dist/onboard-MIBU-Rmv.js +0 -39
- package/dist/onboard-vmGylfFe.js +0 -23
- package/dist/openai-compat-errors-Dcr5Y8bF.js +0 -136
- package/dist/openai-http-CcqspzU6.js +0 -836
- package/dist/openresponses-http-BnyYYvUF.js +0 -1175
- package/dist/operations-H2Oq0KYz.js +0 -805
- package/dist/outbound.types-BhRehecY.d.ts +0 -291
- package/dist/plugin-enabled-CEIKWKrq.js +0 -232
- package/dist/plugin-entry-CTVRRaaA.d.ts +0 -47
- package/dist/plugin-registration-BTyO5Fwt.js +0 -97
- package/dist/plugin-runtime-_XF2N_UQ.d.ts +0 -117
- package/dist/plugin-sdk/bundled-channel-config-schema-BsOWCrJT.d.ts +0 -3169
- package/dist/plugin-service-B91jVlmZ.d.ts +0 -24
- package/dist/plugin-service-CtGwVz8V.js +0 -1249
- package/dist/prepare.runtime-9dlboph7.js +0 -798
- package/dist/preview-warnings-DJx4KJpC.js +0 -618
- package/dist/program-CWC-NBBB.js +0 -131
- package/dist/provider-api-key-auth-BmNcYRMl.d.ts +0 -27
- package/dist/provider-auth-api-key-CCaFiqY3.js +0 -5
- package/dist/provider-auth-result-D_E9dcVc.d.ts +0 -21
- package/dist/provider-catalog-5KZLmrDO.js +0 -11
- package/dist/provider-catalog-7P6AvDzS.js +0 -11
- package/dist/provider-catalog-B2gyTjTU.js +0 -88
- package/dist/provider-catalog-B3YBhe77.js +0 -17
- package/dist/provider-catalog-B7XEeuUm.js +0 -11
- package/dist/provider-catalog-BFGPRd9v.js +0 -17
- package/dist/provider-catalog-BLvkIMSk.d.ts +0 -6
- package/dist/provider-catalog-BPBL9mJf.d.ts +0 -5
- package/dist/provider-catalog-BRkZ6-HD.d.ts +0 -5
- package/dist/provider-catalog-Bfl_AoTZ.js +0 -142
- package/dist/provider-catalog-BpiHWHu1.js +0 -11
- package/dist/provider-catalog-C1qDLekT.d.ts +0 -5
- package/dist/provider-catalog-CKWNCfry.js +0 -11
- package/dist/provider-catalog-CUHB2pSt.d.ts +0 -7
- package/dist/provider-catalog-CWqN2j6J.d.ts +0 -5
- package/dist/provider-catalog-CZ8oYbx3.js +0 -11
- package/dist/provider-catalog-CcQ5-4ZW.d.ts +0 -6
- package/dist/provider-catalog-Cd16uZ0U.js +0 -20
- package/dist/provider-catalog-CpF2D0VK.js +0 -61
- package/dist/provider-catalog-CvXq36zW.d.ts +0 -5
- package/dist/provider-catalog-D2pgEME3.js +0 -48
- package/dist/provider-catalog-DPzcupEl.d.ts +0 -5
- package/dist/provider-catalog-DaeI606G.d.ts +0 -9
- package/dist/provider-catalog-DrOCtTb-.js +0 -11
- package/dist/provider-catalog-DwZ1J2Al.d.ts +0 -6
- package/dist/provider-catalog-Dy7IcHmS.js +0 -107
- package/dist/provider-catalog-TsZS52nq.d.ts +0 -10
- package/dist/provider-catalog-YqIFRCND.d.ts +0 -5
- package/dist/provider-catalog-Ywb5jRwG.d.ts +0 -5
- package/dist/provider-catalog-evknl1oN.js +0 -11
- package/dist/provider-catalog-l0hFpFO2.d.ts +0 -17
- package/dist/provider-catalog-shared-DsRBv0Tp.d.ts +0 -62
- package/dist/provider-dispatcher-BMy9mBJ1.js +0 -22
- package/dist/provider-model-shared-CPAfQBNs.d.ts +0 -143
- package/dist/provider-models-Diu65OcG.d.ts +0 -18
- package/dist/provider-models-LE7PlLYY.js +0 -22
- package/dist/provider-onboard-CpvXEmvz.d.ts +0 -91
- package/dist/provider-registration-DF-LkmNE.js +0 -235
- package/dist/provider-registry-D9cTPW1F.d.ts +0 -8
- package/dist/provider-registry-DI7gMKUP.d.ts +0 -8
- package/dist/provider-registry-DZtgZDkl.d.ts +0 -29
- package/dist/provider-self-hosted-setup-CoHvoyKm.d.ts +0 -74
- package/dist/provider-stream-BpXJr5Ap.d.ts +0 -139
- package/dist/provider-stream-family-Bj5aBD8w.js +0 -2
- package/dist/provider-stream-shared-BaUkhUHj.d.ts +0 -132
- package/dist/provider-usage-DFUhW2do.js +0 -651
- package/dist/provider-web-search-contract-fields-CkXzSsWu.d.ts +0 -25
- package/dist/pw-ai-9Q_dIq4B.js +0 -3064
- package/dist/register.agent-CbfrlzXB.js +0 -152
- package/dist/register.crestodian-CEg0rPfK.js +0 -24
- package/dist/register.maintenance-k9N8I4Wg.js +0 -85
- package/dist/register.subclis-CrXOeaS3.js +0 -3
- package/dist/register.subclis-DfKlni8N.js +0 -31
- package/dist/register.subclis-core-Bg4wbDsO.js +0 -278
- package/dist/registry-Bh3-P2HL.d.ts +0 -8
- package/dist/registry-types-BmEUS4d3.d.ts +0 -392
- package/dist/repair-sequencing-E4yViXG9.js +0 -652
- package/dist/reply-payload-S2mrc_Mh.d.ts +0 -200
- package/dist/reply-turn-admission-BBoPjmGB.js +0 -2056
- package/dist/reply.runtime-C5wfxVI_.js +0 -2
- package/dist/result-fallback-classifier-CX4iLD1G.js +0 -98
- package/dist/route-CifxcQZ1.js +0 -475
- package/dist/routes-B3XAOeWo.js +0 -2
- package/dist/routes-H185h3U-.js +0 -3701
- package/dist/run-CTJFbwbB.js +0 -1162
- package/dist/run-command-B7B53tYk.js +0 -23
- package/dist/run-command-BFuxRDxS.js +0 -2
- package/dist/run-context-C7im9ICg.js +0 -66
- package/dist/run-embedded.runtime-TljBTbzh.js +0 -4
- package/dist/run-execution-cli.runtime-Bt5zwx1W.js +0 -4
- package/dist/run-executor.runtime-hmbWX2Ct.js +0 -330
- package/dist/run-subagent-registry.runtime-B70X80nS.js +0 -2
- package/dist/runtime-DoKE0o7v.js +0 -436
- package/dist/runtime-api-Ca4Llbgf.js +0 -12
- package/dist/runtime-api-pa8xcEmg.d.ts +0 -5
- package/dist/runtime-channel-CFQ59svm.js +0 -148
- package/dist/runtime-channel-DRwCWGUx.js +0 -2
- package/dist/runtime-embedded-agent.runtime-DwmqKUVp.js +0 -2
- package/dist/runtime-forwarders-BMThPHg_.d.ts +0 -39
- package/dist/sdk-setup-tools-Cg_Tabrf.js +0 -8
- package/dist/selection-COhr7g82.js +0 -18365
- package/dist/selection-_G44EVqd.js +0 -3
- package/dist/send-media-BNc67G7I.js +0 -2072
- package/dist/server-5rR0RCpI.js +0 -24
- package/dist/server-context-BhiPROPA.js +0 -955
- package/dist/server-context-OShBAJZQ.js +0 -2
- package/dist/server-cron-Bkzb9edh.js +0 -3173
- package/dist/server-cron-DdR-ugiU.js +0 -2
- package/dist/server-lwtC1vaS.js +0 -72
- package/dist/server-methods-BY_ZqDFJ.js +0 -497
- package/dist/server-node-events-CLvE94AS.js +0 -597
- package/dist/server-plugin-bootstrap-cKOAH5GL.js +0 -71
- package/dist/server-plugins-CPpUykw5.js +0 -435
- package/dist/server-reload-handlers-uzt4VDZ-.js +0 -719
- package/dist/server-restart-sentinel-CpvV0t4O.js +0 -700
- package/dist/server-runtime-services-BhOHoerM.js +0 -147
- package/dist/server-runtime-services-D3Ig68nC.js +0 -3
- package/dist/server-startup-plugins-DslzKVHK.js +0 -127
- package/dist/server-startup-post-attach-DPFBTQez.js +0 -793
- package/dist/server-ws-runtime-D0zoWoiz.js +0 -374
- package/dist/server.impl-CzqLQ3qt.js +0 -2622
- package/dist/session-kill-http-D8JhwZVS.js +0 -121
- package/dist/session-reset-service-uoi7E4Xp.js +0 -651
- package/dist/session-status.runtime-CZK5IU8w.js +0 -2
- package/dist/session-subagent-reactivation.runtime-BSO00-FY.js +0 -2
- package/dist/session-tab-registry-DM9U7e3o.js +0 -551
- package/dist/sessions-B-SkIoaa.js +0 -1917
- package/dist/sessions-history-http-DCiOG4FK.js +0 -432
- package/dist/sessions-patch-DlAAvQvB.js +0 -401
- package/dist/sessions-resolve-DfMXookg.js +0 -180
- package/dist/sessions.runtime-0V2YxKxB.js +0 -2
- package/dist/snapshot-urls-Ble1-NEW.js +0 -317
- package/dist/speech-core-Bk60ZS_y.d.ts +0 -49
- package/dist/speech-provider-DQO9eZd0.js +0 -233
- package/dist/speech-provider-DnBCla4V.js +0 -171
- package/dist/speech-provider-DyYHFxT5.js +0 -227
- package/dist/standalone-9EWfcxeO.js +0 -42
- package/dist/startup-context-nti4X0_w.js +0 -314
- package/dist/status-subagents.runtime-CPZb1EF1.js +0 -32
- package/dist/status-text-C1Hf37lF.js +0 -301
- package/dist/stream-9VBt1MDs.js +0 -26
- package/dist/stream-B_3P7v7P.js +0 -86
- package/dist/stream-CXsue2-v.d.ts +0 -9
- package/dist/stream-oNBFxfKt.d.ts +0 -5
- package/dist/subagent-announce-CPjQQLy8.js +0 -353
- package/dist/subagent-announce-delivery-B6iBOicL.js +0 -1369
- package/dist/subagent-control-DP72sk-l.js +0 -492
- package/dist/subagent-hooks-B1oUIYH3.js +0 -2
- package/dist/subagent-hooks-BkGj4_xI.js +0 -230
- package/dist/subagent-hooks-api-D2mulK3S.js +0 -23
- package/dist/subagent-registry-CEKAUB5h.js +0 -3
- package/dist/subagent-registry-OUVucPAn.js +0 -2627
- package/dist/subagent-session-cleanup-Bx8d3kw0.js +0 -390
- package/dist/system-CelaP2zI.js +0 -111
- package/dist/talk-DGOI3Lu3.js +0 -2454
- package/dist/target-id-BXRG7x9x.js +0 -107
- package/dist/thinking-B8V29FhB.js +0 -35
- package/dist/thread-bindings-DpVdEPZ0.js +0 -228
- package/dist/tool-DHzDpxE4.js +0 -143
- package/dist/tool-dispatch-ClP3Rc7g.js +0 -155
- package/dist/tool-resolution-CZcLod1d.js +0 -153
- package/dist/tool-split-BhiQ8676.d.ts +0 -19
- package/dist/tools-ZvSvbsCW.d.ts +0 -38
- package/dist/tools-effective-C2mHZT-A.js +0 -442
- package/dist/tools-effective-inventory-ctnM7hc6.js +0 -379
- package/dist/tools-invoke-Ci6Rux2s.js +0 -51
- package/dist/tools-invoke-http-CJflXcJk.js +0 -68
- package/dist/tools-invoke-shared-BLu_mJEX.js +0 -200
- package/dist/tts-B2rPJPij.js +0 -83
- package/dist/tts-Gp9FI3_n.js +0 -163
- package/dist/tts-runtime-DNi1HXPF.d.ts +0 -230
- package/dist/tui-BUhfQ9vD.js +0 -3
- package/dist/tui-BhH5mvLf.js +0 -2
- package/dist/tui-backend-C_4ajTHI.js +0 -257
- package/dist/tui-cli-BhWJ-QoB.js +0 -40
- package/dist/tui-ink-run-BTWbUQGb.js +0 -7414
- package/dist/tui-ink-run-DfTdivkh.js +0 -2
- package/dist/types-B4fW3r5y.d.ts +0 -111
- package/dist/types-DI62NfFe.d.ts +0 -7034
- package/dist/types-sAih_uQb.d.ts +0 -393
- package/dist/types.public-B3MKhuo2.d.ts +0 -70
- package/dist/video-generation-B9c6a5cw.js +0 -207
- package/dist/video-generation-BgJp7UIA.d.ts +0 -224
- package/dist/video-generation-provider-BjiVjf40.js +0 -325
- package/dist/video-generation-provider-CsnQJg_h.js +0 -297
- package/dist/video-generation-provider-DtU-ZPqP.js +0 -64
- package/dist/video-generation-provider-wZ0bzv0e.js +0 -77
- package/dist/webhook-targets-Cy8e7y3g.d.ts +0 -99
- package/skills/canvas/SKILL.md +0 -78
- package/skills/clawhub/SKILL.md +0 -77
- package/skills/coding-agent/SKILL.md +0 -143
- package/skills/diagram-maker/SKILL.md +0 -53
- package/skills/diagram-maker/references/excalidraw-patterns.md +0 -85
- package/skills/diagram-maker/references/svg-template.md +0 -112
- package/skills/gemini/SKILL.md +0 -47
- package/skills/gh-issues/SKILL.md +0 -213
- package/skills/gifgrep/SKILL.md +0 -85
- package/skills/github/SKILL.md +0 -84
- package/skills/healthcheck/SKILL.md +0 -105
- package/skills/mcporter/SKILL.md +0 -61
- package/skills/meme-maker/SKILL.md +0 -42
- package/skills/meme-maker/references/templates.json +0 -358
- package/skills/meme-maker/scripts/meme.mjs +0 -398
- package/skills/model-usage/SKILL.md +0 -71
- package/skills/model-usage/references/codexbar-cli.md +0 -33
- package/skills/model-usage/scripts/model_usage.py +0 -319
- package/skills/model-usage/scripts/test_model_usage.py +0 -40
- package/skills/nano-pdf/SKILL.md +0 -38
- package/skills/node-connect/SKILL.md +0 -143
- package/skills/node-inspect-debugger/SKILL.md +0 -85
- package/skills/openai-whisper/SKILL.md +0 -38
- package/skills/openai-whisper-api/SKILL.md +0 -71
- package/skills/openai-whisper-api/scripts/transcribe.sh +0 -154
- package/skills/oracle/SKILL.md +0 -126
- package/skills/pyproject.toml +0 -10
- package/skills/python-debugpy/SKILL.md +0 -73
- package/skills/sag/SKILL.md +0 -87
- package/skills/session-logs/SKILL.md +0 -151
- package/skills/sherpa-onnx-tts/SKILL.md +0 -109
- package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +0 -178
- package/skills/skill-creator/SKILL.md +0 -78
- package/skills/skill-creator/license.txt +0 -202
- package/skills/skill-creator/scripts/init_skill.py +0 -378
- package/skills/skill-creator/scripts/package_skill.py +0 -139
- package/skills/skill-creator/scripts/quick_validate.py +0 -169
- package/skills/skill-creator/scripts/test_package_skill.py +0 -161
- package/skills/skill-creator/scripts/test_quick_validate.py +0 -116
- package/skills/spike/SKILL.md +0 -51
- package/skills/summarize/SKILL.md +0 -87
- package/skills/taskflow/SKILL.md +0 -149
- package/skills/taskflow/examples/inbox-triage.lobster +0 -33
- package/skills/taskflow/examples/pr-intake.lobster +0 -32
- package/skills/taskflow-inbox-triage/SKILL.md +0 -119
- package/skills/video-frames/SKILL.md +0 -46
- package/skills/video-frames/scripts/frame.sh +0 -81
- package/skills/voice-call/SKILL.md +0 -45
- package/skills/weather/SKILL.md +0 -64
- /package/dist/{acp-runtime-backend-DbchQ02o.js → acp-runtime-backend-DZ1Lnt7f.js} +0 -0
- /package/dist/{delegate-k1aptKei.js → delegate-CwhxUdeb.js} +0 -0
- /package/dist/{dispatch-acp-CD4YxPpf.js → dispatch-acp-BP4I5ZQf.js} +0 -0
- /package/dist/{exec-approvals-ByWUCFQM.js → exec-approvals-ByWUCFQM2.js} +0 -0
- /package/dist/{heartbeat-runner-CM0UZxa_.js → heartbeat-runner-CL3alQ8-.js} +0 -0
- /package/dist/{index-B0VJdRJQ.d.ts → index-B0VJdRJQ2.d.ts} +0 -0
- /package/dist/{library-CQ71yATP.js → library-CiTr_aqC.js} +0 -0
- /package/dist/{run-session-state-DbDeH-q6.js → run-session-state-BOMUtBKZ.js} +0 -0
- /package/dist/{session-subagent-reactivation-Bj91A2ms.js → session-subagent-reactivation-CH0C2I6Y.js} +0 -0
- /package/dist/{types-C4HgagiY2.d.ts → types-C4HgagiY.d.ts} +0 -0
|
@@ -0,0 +1,1483 @@
|
|
|
1
|
+
import { a as normalizeLowercaseStringOrEmpty, c as normalizeOptionalString, o as normalizeNullableString } from "./string-coerce-DKw2K5wM.js";
|
|
2
|
+
import { E as resolveTimerTimeoutMs } from "./number-coercion-D1aDmIZp.js";
|
|
3
|
+
import { n as asNullableRecord } from "./record-coerce-Btbek4uV.js";
|
|
4
|
+
import { i as formatErrorMessage } from "./errors-C_Wa6a5T.js";
|
|
5
|
+
import { h as normalizeUniqueTrimmedStringList } from "./string-normalization-B8G0vlWE.js";
|
|
6
|
+
import { i as getRuntimeConfig } from "./io-T1CV3Z1L.js";
|
|
7
|
+
import { i as GATEWAY_CLIENT_NAMES, r as GATEWAY_CLIENT_MODES } from "./client-info-D6_UASoA.js";
|
|
8
|
+
import { Ri as ErrorCodes, St as validateNodeRenameParams, _t as validateNodePairVerifyParams, dt as validateNodeListParams, ft as validateNodePairApproveParams, gt as validateNodePairRequestParams, ht as validateNodePairRemoveParams, lt as validateNodeInvokeParams, mt as validateNodePairRejectParams, ot as validateNodeDescribeParams, pt as validateNodePairListParams, st as validateNodeEventParams, ut as validateNodeInvokeResultParams, vt as validateNodePendingAckParams, zi as errorShape } from "./src-B1Y482-m.js";
|
|
9
|
+
import { t as getActiveRuntimePluginRegistry } from "./active-runtime-registry-CL_kGd9k.js";
|
|
10
|
+
import { n as DEFAULT_PLUGIN_APPROVAL_TIMEOUT_MS } from "./plugin-approvals-BAd_Vwt-.js";
|
|
11
|
+
import { a as removePairedNode, i as rejectNodePairing, l as verifyNodeToken, o as renamePairedNode, r as listNodePairing, s as requestNodePairing, t as approveNodePairing } from "./node-pairing-BexWuBNg.js";
|
|
12
|
+
import { i as recordRemoteNodeInfo, o as refreshRemoteNodeBins, s as removeRemoteNodeInfo } from "./remote-e1szzQLr.js";
|
|
13
|
+
import { c as refreshClientPluginNodeCapability } from "./plugin-node-capability-DH-ae5Gb.js";
|
|
14
|
+
import { a as normalizeDeclaredNodeCommands, n as isForegroundRestrictedPluginNodeCommand, o as resolveNodeCommandAllowlist, r as isNodeCommandAllowed } from "./node-command-policy-Txp7J9Jt.js";
|
|
15
|
+
import { i as safeParseJson, n as respondUnavailableOnNodeInvokeError, r as respondUnavailableOnThrow, t as respondInvalidParams } from "./nodes.helpers-DgL2pMOy.js";
|
|
16
|
+
import { l as listDevicePairing } from "./device-pairing-rQ2ou8kg.js";
|
|
17
|
+
import { i as buildSystemRunApprovalBinding, l as toSystemRunApprovalMismatchError, o as matchSystemRunApprovalBinding, r as resolveSystemRunCommandRequest, s as missingSystemRunApprovalBinding } from "./system-run-command-5NffG1dK.js";
|
|
18
|
+
import { r as resolveSystemRunApprovalRuntimeContext } from "./system-run-approval-context-Mn9Sfzu2.js";
|
|
19
|
+
import { c as sendApnsBackgroundWake, d as shouldClearStoredApnsRegistration, f as resolveApnsRelayConfigFromEnv, n as loadApnsRegistration, o as resolveApnsAuthConfigFromEnv, s as sendApnsAlert, t as clearApnsRegistrationIfCurrent } from "./push-apns-DyuuFVak.js";
|
|
20
|
+
import { n as getKnownNode, r as listKnownNodes, t as createKnownNodeCatalog } from "./node-catalog-sgx5gZPY.js";
|
|
21
|
+
import { o as resolveApprovalRequestRecipientConnIds } from "./approval-shared-Y3diEvgj.js";
|
|
22
|
+
import { a as nodeWakeNudgeById, i as nodeWakeById, n as NODE_WAKE_RECONNECT_WAIT_MS, t as NODE_WAKE_RECONNECT_RETRY_WAIT_MS } from "./nodes-wake-state-D3Lnk3Xv.js";
|
|
23
|
+
import { randomUUID } from "node:crypto";
|
|
24
|
+
//#region src/gateway/node-invoke-plugin-policy.ts
|
|
25
|
+
function parseScopes(client) {
|
|
26
|
+
return Array.isArray(client?.connect?.scopes) ? client.connect.scopes.filter((scope) => typeof scope === "string") : [];
|
|
27
|
+
}
|
|
28
|
+
function parsePayload(payloadJSON, payload) {
|
|
29
|
+
if (!payloadJSON) return payload;
|
|
30
|
+
try {
|
|
31
|
+
return JSON.parse(payloadJSON);
|
|
32
|
+
} catch {
|
|
33
|
+
return payload;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function findDangerousPluginNodeCommand(registry, command) {
|
|
37
|
+
const normalizedCommand = command.trim();
|
|
38
|
+
if (!normalizedCommand) return null;
|
|
39
|
+
return registry?.nodeHostCommands?.find((entry) => entry.command.dangerous === true && entry.command.command.trim() === normalizedCommand) ?? null;
|
|
40
|
+
}
|
|
41
|
+
function createApprovalRuntime(params) {
|
|
42
|
+
const manager = params.context.pluginApprovalManager;
|
|
43
|
+
if (!manager) return;
|
|
44
|
+
return { async request(input) {
|
|
45
|
+
const timeoutMs = typeof input.timeoutMs === "number" && Number.isFinite(input.timeoutMs) ? input.timeoutMs : DEFAULT_PLUGIN_APPROVAL_TIMEOUT_MS;
|
|
46
|
+
const request = {
|
|
47
|
+
pluginId: params.pluginId,
|
|
48
|
+
title: input.title.slice(0, 80),
|
|
49
|
+
description: input.description.slice(0, 256),
|
|
50
|
+
severity: input.severity ?? "warning",
|
|
51
|
+
toolName: normalizeOptionalString(input.toolName) ?? null,
|
|
52
|
+
toolCallId: normalizeOptionalString(input.toolCallId) ?? null,
|
|
53
|
+
agentId: normalizeOptionalString(input.agentId) ?? null,
|
|
54
|
+
sessionKey: normalizeOptionalString(input.sessionKey) ?? null
|
|
55
|
+
};
|
|
56
|
+
const record = manager.create(request, timeoutMs, `plugin:${randomUUID()}`);
|
|
57
|
+
record.requestedByConnId = params.client?.connId ?? null;
|
|
58
|
+
record.requestedByDeviceId = params.client?.connect?.device?.id ?? null;
|
|
59
|
+
record.requestedByClientId = params.client?.connect?.client?.id ?? null;
|
|
60
|
+
record.requestedByDeviceTokenAuth = params.client?.isDeviceTokenAuth === true;
|
|
61
|
+
const decisionPromise = manager.register(record, timeoutMs);
|
|
62
|
+
const requestEvent = {
|
|
63
|
+
id: record.id,
|
|
64
|
+
request: record.request,
|
|
65
|
+
createdAtMs: record.createdAtMs,
|
|
66
|
+
expiresAtMs: record.expiresAtMs
|
|
67
|
+
};
|
|
68
|
+
const approvalClientConnIds = resolveApprovalRequestRecipientConnIds({
|
|
69
|
+
context: params.context,
|
|
70
|
+
record,
|
|
71
|
+
excludeConnId: params.client?.connId
|
|
72
|
+
});
|
|
73
|
+
if (approvalClientConnIds) params.context.broadcastToConnIds("plugin.approval.requested", requestEvent, approvalClientConnIds, { dropIfSlow: true });
|
|
74
|
+
else params.context.broadcast("plugin.approval.requested", requestEvent, { dropIfSlow: true });
|
|
75
|
+
if (!(approvalClientConnIds !== null ? approvalClientConnIds.size > 0 : params.context.hasExecApprovalClients?.(params.client?.connId) ?? false)) {
|
|
76
|
+
manager.expire(record.id, "no-approval-route");
|
|
77
|
+
return {
|
|
78
|
+
id: record.id,
|
|
79
|
+
decision: null
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const decision = await decisionPromise;
|
|
83
|
+
return {
|
|
84
|
+
id: record.id,
|
|
85
|
+
decision
|
|
86
|
+
};
|
|
87
|
+
} };
|
|
88
|
+
}
|
|
89
|
+
async function applyPluginNodeInvokePolicy(params) {
|
|
90
|
+
const registry = getActiveRuntimePluginRegistry();
|
|
91
|
+
const entry = registry?.nodeInvokePolicies?.find((candidate) => candidate.policy.commands.includes(params.command));
|
|
92
|
+
if (!entry) {
|
|
93
|
+
const dangerousCommand = findDangerousPluginNodeCommand(registry, params.command);
|
|
94
|
+
if (dangerousCommand) return {
|
|
95
|
+
ok: false,
|
|
96
|
+
code: "PLUGIN_POLICY_MISSING",
|
|
97
|
+
message: `node.invoke ${params.command} is registered as dangerous by plugin ${dangerousCommand.pluginId} but has no plugin node.invoke policy`
|
|
98
|
+
};
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
const invokeNode = async (override = {}) => {
|
|
102
|
+
const res = await params.context.nodeRegistry.invoke({
|
|
103
|
+
nodeId: params.nodeSession.nodeId,
|
|
104
|
+
command: params.command,
|
|
105
|
+
params: override.params ?? params.params,
|
|
106
|
+
timeoutMs: override.timeoutMs ?? params.timeoutMs,
|
|
107
|
+
idempotencyKey: override.idempotencyKey ?? params.idempotencyKey
|
|
108
|
+
});
|
|
109
|
+
if (!res.ok) return {
|
|
110
|
+
ok: false,
|
|
111
|
+
code: res.error?.code,
|
|
112
|
+
message: res.error?.message ?? "node command failed",
|
|
113
|
+
details: { nodeError: res.error ?? null }
|
|
114
|
+
};
|
|
115
|
+
return {
|
|
116
|
+
ok: true,
|
|
117
|
+
payload: parsePayload(res.payloadJSON, res.payload),
|
|
118
|
+
payloadJSON: res.payloadJSON ?? null
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
return await entry.policy.handle({
|
|
122
|
+
nodeId: params.nodeSession.nodeId,
|
|
123
|
+
command: params.command,
|
|
124
|
+
params: params.params,
|
|
125
|
+
timeoutMs: params.timeoutMs,
|
|
126
|
+
idempotencyKey: params.idempotencyKey,
|
|
127
|
+
config: params.context.getRuntimeConfig(),
|
|
128
|
+
pluginConfig: entry.pluginConfig,
|
|
129
|
+
node: {
|
|
130
|
+
nodeId: params.nodeSession.nodeId,
|
|
131
|
+
displayName: params.nodeSession.displayName,
|
|
132
|
+
platform: params.nodeSession.platform,
|
|
133
|
+
deviceFamily: params.nodeSession.deviceFamily,
|
|
134
|
+
commands: params.nodeSession.commands
|
|
135
|
+
},
|
|
136
|
+
client: params.client ? {
|
|
137
|
+
connId: params.client.connId,
|
|
138
|
+
scopes: parseScopes(params.client)
|
|
139
|
+
} : null,
|
|
140
|
+
approvals: createApprovalRuntime({
|
|
141
|
+
context: params.context,
|
|
142
|
+
client: params.client,
|
|
143
|
+
pluginId: entry.pluginId
|
|
144
|
+
}),
|
|
145
|
+
invokeNode
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region src/gateway/node-invoke-system-run-approval-errors.ts
|
|
150
|
+
function systemRunApprovalGuardError(params) {
|
|
151
|
+
const details = params.details ? { ...params.details } : {};
|
|
152
|
+
return {
|
|
153
|
+
ok: false,
|
|
154
|
+
message: params.message,
|
|
155
|
+
details: {
|
|
156
|
+
code: params.code,
|
|
157
|
+
...details
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function systemRunApprovalRequired(runId) {
|
|
162
|
+
return systemRunApprovalGuardError({
|
|
163
|
+
code: "APPROVAL_REQUIRED",
|
|
164
|
+
message: "approval required",
|
|
165
|
+
details: { runId }
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region src/gateway/node-invoke-system-run-approval-match.ts
|
|
170
|
+
function requestMismatch() {
|
|
171
|
+
return {
|
|
172
|
+
ok: false,
|
|
173
|
+
code: "APPROVAL_REQUEST_MISMATCH",
|
|
174
|
+
message: "approval id does not match request"
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function evaluateSystemRunApprovalMatch(params) {
|
|
178
|
+
if (params.request.host !== "node") return requestMismatch();
|
|
179
|
+
const actualBinding = buildSystemRunApprovalBinding({
|
|
180
|
+
argv: params.argv,
|
|
181
|
+
cwd: params.binding.cwd,
|
|
182
|
+
agentId: params.binding.agentId,
|
|
183
|
+
sessionKey: params.binding.sessionKey,
|
|
184
|
+
env: params.binding.env
|
|
185
|
+
});
|
|
186
|
+
const expectedBinding = params.request.systemRunBinding;
|
|
187
|
+
if (!expectedBinding) return missingSystemRunApprovalBinding({ actualEnvKeys: actualBinding.envKeys });
|
|
188
|
+
return matchSystemRunApprovalBinding({
|
|
189
|
+
expected: expectedBinding,
|
|
190
|
+
actual: actualBinding.binding,
|
|
191
|
+
actualEnvKeys: actualBinding.envKeys
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region src/gateway/node-invoke-system-run-approval.ts
|
|
196
|
+
const BACKEND_BRIDGEABLE_NO_DEVICE_REQUEST_CLIENT_IDS = new Set([
|
|
197
|
+
GATEWAY_CLIENT_NAMES.CONTROL_UI,
|
|
198
|
+
GATEWAY_CLIENT_NAMES.WEBCHAT_UI,
|
|
199
|
+
GATEWAY_CLIENT_NAMES.WEBCHAT,
|
|
200
|
+
GATEWAY_CLIENT_NAMES.GATEWAY_CLIENT
|
|
201
|
+
]);
|
|
202
|
+
function normalizeApprovalDecision(value) {
|
|
203
|
+
const s = normalizeNullableString(value);
|
|
204
|
+
return s === "allow-once" || s === "allow-always" ? s : null;
|
|
205
|
+
}
|
|
206
|
+
function clientHasApprovals(client) {
|
|
207
|
+
const scopes = Array.isArray(client?.connect?.scopes) ? client?.connect?.scopes : [];
|
|
208
|
+
return scopes.includes("operator.admin") || scopes.includes("operator.approvals");
|
|
209
|
+
}
|
|
210
|
+
function isTrustedBackendApprovalClient(client) {
|
|
211
|
+
return clientHasApprovals(client) && client?.connect?.client?.id === GATEWAY_CLIENT_NAMES.GATEWAY_CLIENT && client.connect.client.mode === GATEWAY_CLIENT_MODES.BACKEND && client.isDeviceTokenAuth !== true;
|
|
212
|
+
}
|
|
213
|
+
function canBridgeNoDeviceApprovalFromBackend(params) {
|
|
214
|
+
const requestedByClientId = normalizeNullableString(params.snapshot.requestedByClientId);
|
|
215
|
+
const request = params.snapshot.request;
|
|
216
|
+
return params.snapshot.requestedByDeviceId == null && params.snapshot.requestedByDeviceTokenAuth !== true && !hasChatApprovalReplayBinding(request) && requestedByClientId !== null && BACKEND_BRIDGEABLE_NO_DEVICE_REQUEST_CLIENT_IDS.has(requestedByClientId) && isTrustedBackendApprovalClient(params.client);
|
|
217
|
+
}
|
|
218
|
+
function hasChatApprovalReplayBinding(request) {
|
|
219
|
+
return normalizeComparableString(request.turnSourceChannel, { lowercase: true }) !== null || normalizeComparableString(request.turnSourceTo) !== null || normalizeComparableString(request.turnSourceAccountId) !== null || normalizeComparableString(request.turnSourceThreadId) !== null;
|
|
220
|
+
}
|
|
221
|
+
function normalizeComparableString(value, opts = {}) {
|
|
222
|
+
const normalized = typeof value === "number" && Number.isFinite(value) ? String(value) : normalizeNullableString(value);
|
|
223
|
+
if (!normalized) return null;
|
|
224
|
+
return opts.lowercase ? normalized.toLowerCase() : normalized;
|
|
225
|
+
}
|
|
226
|
+
function matchesRequiredString(params) {
|
|
227
|
+
const expected = normalizeComparableString(params.expected, { lowercase: params.lowercase });
|
|
228
|
+
if (!expected) return false;
|
|
229
|
+
return expected === normalizeComparableString(params.actual, { lowercase: params.lowercase });
|
|
230
|
+
}
|
|
231
|
+
function matchesOptionalString(params) {
|
|
232
|
+
const expected = normalizeComparableString(params.expected, { lowercase: params.lowercase });
|
|
233
|
+
if (!expected) return true;
|
|
234
|
+
return expected === normalizeComparableString(params.actual, { lowercase: params.lowercase });
|
|
235
|
+
}
|
|
236
|
+
function canBridgeNoDeviceChatApprovalFromBackend(params) {
|
|
237
|
+
if (params.snapshot.requestedByDeviceId != null || params.snapshot.requestedByDeviceTokenAuth === true || !isTrustedBackendApprovalClient(params.client)) return false;
|
|
238
|
+
const request = params.snapshot.request;
|
|
239
|
+
const plan = request.systemRunPlan ?? null;
|
|
240
|
+
return matchesRequiredString({
|
|
241
|
+
expected: request.turnSourceChannel,
|
|
242
|
+
actual: params.rawParams.turnSourceChannel,
|
|
243
|
+
lowercase: true
|
|
244
|
+
}) && matchesOptionalString({
|
|
245
|
+
expected: request.turnSourceTo,
|
|
246
|
+
actual: params.rawParams.turnSourceTo
|
|
247
|
+
}) && matchesRequiredString({
|
|
248
|
+
expected: plan?.sessionKey ?? request.sessionKey,
|
|
249
|
+
actual: params.rawParams.sessionKey
|
|
250
|
+
}) && matchesOptionalString({
|
|
251
|
+
expected: plan?.agentId ?? request.agentId,
|
|
252
|
+
actual: params.rawParams.agentId
|
|
253
|
+
}) && matchesOptionalString({
|
|
254
|
+
expected: request.turnSourceAccountId,
|
|
255
|
+
actual: params.rawParams.turnSourceAccountId
|
|
256
|
+
}) && matchesOptionalString({
|
|
257
|
+
expected: request.turnSourceThreadId,
|
|
258
|
+
actual: params.rawParams.turnSourceThreadId
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
function pickSystemRunParams(raw) {
|
|
262
|
+
const next = {};
|
|
263
|
+
for (const key of [
|
|
264
|
+
"command",
|
|
265
|
+
"rawCommand",
|
|
266
|
+
"systemRunPlan",
|
|
267
|
+
"cwd",
|
|
268
|
+
"env",
|
|
269
|
+
"timeoutMs",
|
|
270
|
+
"needsScreenRecording",
|
|
271
|
+
"agentId",
|
|
272
|
+
"sessionKey",
|
|
273
|
+
"runId",
|
|
274
|
+
"suppressNotifyOnExit"
|
|
275
|
+
]) if (key in raw) next[key] = raw[key];
|
|
276
|
+
return next;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Gate `system.run` approval flags (`approved`, `approvalDecision`) behind a real
|
|
280
|
+
* `exec.approval.*` record. This prevents users with only `operator.write` from
|
|
281
|
+
* bypassing node-host approvals by injecting control fields into `node.invoke`.
|
|
282
|
+
*/
|
|
283
|
+
function sanitizeSystemRunParamsForForwarding(opts) {
|
|
284
|
+
const obj = asNullableRecord(opts.rawParams);
|
|
285
|
+
if (!obj) return {
|
|
286
|
+
ok: true,
|
|
287
|
+
params: opts.rawParams
|
|
288
|
+
};
|
|
289
|
+
const p = obj;
|
|
290
|
+
const approved = p.approved === true;
|
|
291
|
+
const requestedDecision = normalizeApprovalDecision(p.approvalDecision);
|
|
292
|
+
const wantsApprovalOverride = approved || requestedDecision !== null;
|
|
293
|
+
const next = pickSystemRunParams(obj);
|
|
294
|
+
if (!wantsApprovalOverride) {
|
|
295
|
+
const cmdTextResolution = resolveSystemRunCommandRequest({
|
|
296
|
+
command: p.command,
|
|
297
|
+
rawCommand: p.rawCommand
|
|
298
|
+
});
|
|
299
|
+
if (!cmdTextResolution.ok) return {
|
|
300
|
+
ok: false,
|
|
301
|
+
message: cmdTextResolution.message,
|
|
302
|
+
details: cmdTextResolution.details
|
|
303
|
+
};
|
|
304
|
+
return {
|
|
305
|
+
ok: true,
|
|
306
|
+
params: next
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
const runId = normalizeNullableString(p.runId);
|
|
310
|
+
if (!runId) return systemRunApprovalGuardError({
|
|
311
|
+
code: "MISSING_RUN_ID",
|
|
312
|
+
message: "approval override requires params.runId"
|
|
313
|
+
});
|
|
314
|
+
const manager = opts.execApprovalManager;
|
|
315
|
+
if (!manager) return systemRunApprovalGuardError({
|
|
316
|
+
code: "APPROVALS_UNAVAILABLE",
|
|
317
|
+
message: "exec approvals unavailable"
|
|
318
|
+
});
|
|
319
|
+
const snapshot = manager.getSnapshot(runId);
|
|
320
|
+
if (!snapshot) return systemRunApprovalGuardError({
|
|
321
|
+
code: "UNKNOWN_APPROVAL_ID",
|
|
322
|
+
message: "unknown or expired approval id",
|
|
323
|
+
details: { runId }
|
|
324
|
+
});
|
|
325
|
+
if ((typeof opts.nowMs === "number" ? opts.nowMs : Date.now()) > snapshot.expiresAtMs) return systemRunApprovalGuardError({
|
|
326
|
+
code: "APPROVAL_EXPIRED",
|
|
327
|
+
message: "approval expired",
|
|
328
|
+
details: { runId }
|
|
329
|
+
});
|
|
330
|
+
const targetNodeId = normalizeNullableString(opts.nodeId);
|
|
331
|
+
if (!targetNodeId) return systemRunApprovalGuardError({
|
|
332
|
+
code: "MISSING_NODE_ID",
|
|
333
|
+
message: "node.invoke requires nodeId",
|
|
334
|
+
details: { runId }
|
|
335
|
+
});
|
|
336
|
+
const approvalNodeId = normalizeNullableString(snapshot.request.nodeId);
|
|
337
|
+
if (!approvalNodeId) return systemRunApprovalGuardError({
|
|
338
|
+
code: "APPROVAL_NODE_BINDING_MISSING",
|
|
339
|
+
message: "approval id missing node binding",
|
|
340
|
+
details: { runId }
|
|
341
|
+
});
|
|
342
|
+
if (approvalNodeId !== targetNodeId) return systemRunApprovalGuardError({
|
|
343
|
+
code: "APPROVAL_NODE_MISMATCH",
|
|
344
|
+
message: "approval id not valid for this node",
|
|
345
|
+
details: { runId }
|
|
346
|
+
});
|
|
347
|
+
const snapshotDeviceId = snapshot.requestedByDeviceId ?? null;
|
|
348
|
+
const clientDeviceId = opts.client?.connect?.device?.id ?? null;
|
|
349
|
+
if (snapshotDeviceId) {
|
|
350
|
+
if (snapshotDeviceId !== clientDeviceId) return systemRunApprovalGuardError({
|
|
351
|
+
code: "APPROVAL_DEVICE_MISMATCH",
|
|
352
|
+
message: "approval id not valid for this device",
|
|
353
|
+
details: { runId }
|
|
354
|
+
});
|
|
355
|
+
} else if (snapshot.requestedByConnId && snapshot.requestedByConnId !== (opts.client?.connId ?? null) && !canBridgeNoDeviceApprovalFromBackend({
|
|
356
|
+
snapshot,
|
|
357
|
+
client: opts.client
|
|
358
|
+
}) && !canBridgeNoDeviceChatApprovalFromBackend({
|
|
359
|
+
snapshot,
|
|
360
|
+
rawParams: p,
|
|
361
|
+
client: opts.client
|
|
362
|
+
})) return systemRunApprovalGuardError({
|
|
363
|
+
code: "APPROVAL_CLIENT_MISMATCH",
|
|
364
|
+
message: "approval id not valid for this client",
|
|
365
|
+
details: { runId }
|
|
366
|
+
});
|
|
367
|
+
const runtimeContext = resolveSystemRunApprovalRuntimeContext({
|
|
368
|
+
plan: snapshot.request.systemRunPlan ?? null,
|
|
369
|
+
command: p.command,
|
|
370
|
+
rawCommand: p.rawCommand,
|
|
371
|
+
cwd: p.cwd,
|
|
372
|
+
agentId: p.agentId,
|
|
373
|
+
sessionKey: p.sessionKey
|
|
374
|
+
});
|
|
375
|
+
if (!runtimeContext.ok) return {
|
|
376
|
+
ok: false,
|
|
377
|
+
message: runtimeContext.message,
|
|
378
|
+
details: runtimeContext.details
|
|
379
|
+
};
|
|
380
|
+
if (runtimeContext.plan) {
|
|
381
|
+
next.command = [...runtimeContext.plan.argv];
|
|
382
|
+
next.systemRunPlan = runtimeContext.plan;
|
|
383
|
+
if (runtimeContext.commandText) next.rawCommand = runtimeContext.commandText;
|
|
384
|
+
else delete next.rawCommand;
|
|
385
|
+
if (runtimeContext.cwd) next.cwd = runtimeContext.cwd;
|
|
386
|
+
else delete next.cwd;
|
|
387
|
+
if (runtimeContext.agentId) next.agentId = runtimeContext.agentId;
|
|
388
|
+
else delete next.agentId;
|
|
389
|
+
if (runtimeContext.sessionKey) next.sessionKey = runtimeContext.sessionKey;
|
|
390
|
+
else delete next.sessionKey;
|
|
391
|
+
}
|
|
392
|
+
const approvalMatch = evaluateSystemRunApprovalMatch({
|
|
393
|
+
argv: runtimeContext.argv,
|
|
394
|
+
request: snapshot.request,
|
|
395
|
+
binding: {
|
|
396
|
+
cwd: runtimeContext.cwd,
|
|
397
|
+
agentId: runtimeContext.agentId,
|
|
398
|
+
sessionKey: runtimeContext.sessionKey,
|
|
399
|
+
env: p.env
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
if (!approvalMatch.ok) return toSystemRunApprovalMismatchError({
|
|
403
|
+
runId,
|
|
404
|
+
match: approvalMatch
|
|
405
|
+
});
|
|
406
|
+
if (snapshot.decision === "allow-once") {
|
|
407
|
+
if (typeof manager.consumeAllowOnce !== "function" || !manager.consumeAllowOnce(runId)) return systemRunApprovalRequired(runId);
|
|
408
|
+
next.approved = true;
|
|
409
|
+
next.approvalDecision = "allow-once";
|
|
410
|
+
return {
|
|
411
|
+
ok: true,
|
|
412
|
+
params: next
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
if (snapshot.decision === "allow-always") {
|
|
416
|
+
next.approved = true;
|
|
417
|
+
next.approvalDecision = "allow-always";
|
|
418
|
+
return {
|
|
419
|
+
ok: true,
|
|
420
|
+
params: next
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
if (snapshot.resolvedAtMs !== void 0 && snapshot.decision === void 0 && snapshot.resolvedBy === null && approved && requestedDecision === "allow-once" && clientHasApprovals(opts.client)) {
|
|
424
|
+
next.approved = true;
|
|
425
|
+
next.approvalDecision = "allow-once";
|
|
426
|
+
return {
|
|
427
|
+
ok: true,
|
|
428
|
+
params: next
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
return systemRunApprovalRequired(runId);
|
|
432
|
+
}
|
|
433
|
+
//#endregion
|
|
434
|
+
//#region src/gateway/node-invoke-sanitize.ts
|
|
435
|
+
function sanitizeNodeInvokeParamsForForwarding(opts) {
|
|
436
|
+
if (opts.command === "system.run") return sanitizeSystemRunParamsForForwarding({
|
|
437
|
+
nodeId: opts.nodeId,
|
|
438
|
+
rawParams: opts.rawParams,
|
|
439
|
+
client: opts.client,
|
|
440
|
+
execApprovalManager: opts.execApprovalManager
|
|
441
|
+
});
|
|
442
|
+
return {
|
|
443
|
+
ok: true,
|
|
444
|
+
params: opts.rawParams
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
//#endregion
|
|
448
|
+
//#region src/gateway/server-methods/nodes.handlers.invoke-result.ts
|
|
449
|
+
function normalizeNodeInvokeResultParams(params) {
|
|
450
|
+
if (!params || typeof params !== "object") return params;
|
|
451
|
+
const normalized = { ...params };
|
|
452
|
+
if (normalized.payloadJSON === null) delete normalized.payloadJSON;
|
|
453
|
+
else if (normalized.payloadJSON !== void 0 && typeof normalized.payloadJSON !== "string") {
|
|
454
|
+
if (normalized.payload === void 0) normalized.payload = normalized.payloadJSON;
|
|
455
|
+
delete normalized.payloadJSON;
|
|
456
|
+
}
|
|
457
|
+
if (normalized.error === null) delete normalized.error;
|
|
458
|
+
return normalized;
|
|
459
|
+
}
|
|
460
|
+
const handleNodeInvokeResult = async ({ params, respond, context, client }) => {
|
|
461
|
+
const normalizedParams = normalizeNodeInvokeResultParams(params);
|
|
462
|
+
if (!validateNodeInvokeResultParams(normalizedParams)) {
|
|
463
|
+
respondInvalidParams({
|
|
464
|
+
respond,
|
|
465
|
+
method: "node.invoke.result",
|
|
466
|
+
validator: validateNodeInvokeResultParams
|
|
467
|
+
});
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
const p = normalizedParams;
|
|
471
|
+
const callerNodeId = client?.connect?.device?.id ?? client?.connect?.client?.id;
|
|
472
|
+
if (callerNodeId && callerNodeId !== p.nodeId) {
|
|
473
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "nodeId mismatch"));
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
if (!context.nodeRegistry.handleInvokeResult({
|
|
477
|
+
id: p.id,
|
|
478
|
+
nodeId: p.nodeId,
|
|
479
|
+
connId: client?.connId,
|
|
480
|
+
ok: p.ok,
|
|
481
|
+
payload: p.payload,
|
|
482
|
+
payloadJSON: p.payloadJSON ?? null,
|
|
483
|
+
error: p.error ?? null
|
|
484
|
+
})) {
|
|
485
|
+
context.logGateway.debug(`late invoke result ignored: id=${p.id} node=${p.nodeId}`);
|
|
486
|
+
respond(true, {
|
|
487
|
+
ok: true,
|
|
488
|
+
ignored: true
|
|
489
|
+
}, void 0);
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
respond(true, { ok: true }, void 0);
|
|
493
|
+
};
|
|
494
|
+
//#endregion
|
|
495
|
+
//#region src/gateway/server-methods/nodes.ts
|
|
496
|
+
const NODE_WAKE_THROTTLE_MS = 15e3;
|
|
497
|
+
const NODE_WAKE_NUDGE_THROTTLE_MS = 10 * 6e4;
|
|
498
|
+
const NODE_PENDING_ACTION_TTL_MS = 10 * 6e4;
|
|
499
|
+
const NODE_PENDING_ACTION_MAX_PER_NODE = 64;
|
|
500
|
+
const TALK_PTT_COMMANDS = new Set([
|
|
501
|
+
"talk.ptt.start",
|
|
502
|
+
"talk.ptt.stop",
|
|
503
|
+
"talk.ptt.cancel",
|
|
504
|
+
"talk.ptt.once"
|
|
505
|
+
]);
|
|
506
|
+
const talkPttEventSeqBySessionId = /* @__PURE__ */ new Map();
|
|
507
|
+
const pendingNodeActionsById = /* @__PURE__ */ new Map();
|
|
508
|
+
function normalizeBrowserProxyPath(value) {
|
|
509
|
+
const trimmed = value.trim();
|
|
510
|
+
if (!trimmed) return trimmed;
|
|
511
|
+
const withLeadingSlash = trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
|
|
512
|
+
if (withLeadingSlash.length <= 1) return withLeadingSlash;
|
|
513
|
+
return withLeadingSlash.replace(/\/+$/, "");
|
|
514
|
+
}
|
|
515
|
+
function isPersistentBrowserProxyMutation(method, path) {
|
|
516
|
+
const normalizedPath = normalizeBrowserProxyPath(path);
|
|
517
|
+
if (method === "POST" && (normalizedPath === "/profiles/create" || normalizedPath === "/reset-profile")) return true;
|
|
518
|
+
return method === "DELETE" && /^\/profiles\/[^/]+$/.test(normalizedPath);
|
|
519
|
+
}
|
|
520
|
+
function isForbiddenBrowserProxyMutation(params) {
|
|
521
|
+
if (!params || typeof params !== "object") return false;
|
|
522
|
+
const candidate = params;
|
|
523
|
+
const method = (normalizeOptionalString(candidate.method) ?? "").toUpperCase();
|
|
524
|
+
const path = normalizeOptionalString(candidate.path) ?? "";
|
|
525
|
+
return Boolean(method && path && isPersistentBrowserProxyMutation(method, path));
|
|
526
|
+
}
|
|
527
|
+
function normalizePluginSurfaceRefreshParams(params) {
|
|
528
|
+
if (!params || typeof params !== "object") return;
|
|
529
|
+
const surface = normalizeOptionalString(params.surface);
|
|
530
|
+
if (!surface) return;
|
|
531
|
+
return { surface };
|
|
532
|
+
}
|
|
533
|
+
function respondRefreshedPluginSurface(params) {
|
|
534
|
+
const refreshed = params.client ? refreshClientPluginNodeCapability({
|
|
535
|
+
client: params.client,
|
|
536
|
+
surface: params.client.pluginNodeCapabilitySurfaces?.[params.surface] ?? { surface: params.surface }
|
|
537
|
+
}) : void 0;
|
|
538
|
+
if (!refreshed) {
|
|
539
|
+
params.respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, `${params.surface} plugin surface unavailable`));
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
params.respond(true, {
|
|
543
|
+
surface: refreshed.surface,
|
|
544
|
+
pluginSurfaceUrls: { [refreshed.surface]: refreshed.scopedUrl },
|
|
545
|
+
expiresAtMs: refreshed.expiresAtMs
|
|
546
|
+
}, void 0);
|
|
547
|
+
}
|
|
548
|
+
async function resolveDirectNodePushConfig() {
|
|
549
|
+
const auth = await resolveApnsAuthConfigFromEnv(process.env);
|
|
550
|
+
return auth.ok ? {
|
|
551
|
+
ok: true,
|
|
552
|
+
auth: auth.value
|
|
553
|
+
} : {
|
|
554
|
+
ok: false,
|
|
555
|
+
error: auth.error
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
function resolveRelayNodePushConfig(cfg, registration) {
|
|
559
|
+
const relay = resolveApnsRelayConfigFromEnv(process.env, cfg.gateway, { registrationRelayOrigin: registration.relayOrigin });
|
|
560
|
+
return relay.ok ? {
|
|
561
|
+
ok: true,
|
|
562
|
+
relayConfig: relay.value
|
|
563
|
+
} : {
|
|
564
|
+
ok: false,
|
|
565
|
+
error: relay.error
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
async function clearStaleApnsRegistrationIfNeeded(registration, nodeId, params) {
|
|
569
|
+
if (!shouldClearStoredApnsRegistration({
|
|
570
|
+
registration,
|
|
571
|
+
result: params
|
|
572
|
+
})) return;
|
|
573
|
+
await clearApnsRegistrationIfCurrent({
|
|
574
|
+
nodeId,
|
|
575
|
+
registration
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
async function delayMs(ms) {
|
|
579
|
+
await new Promise((resolve) => setTimeout(resolve, ms));
|
|
580
|
+
}
|
|
581
|
+
function isForegroundRestrictedIosCommand(command) {
|
|
582
|
+
return isForegroundRestrictedPluginNodeCommand(command) || command.startsWith("camera.") || command.startsWith("screen.") || command.startsWith("talk.");
|
|
583
|
+
}
|
|
584
|
+
function shouldQueueAsPendingForegroundAction(params) {
|
|
585
|
+
const platform = normalizeLowercaseStringOrEmpty(params.platform);
|
|
586
|
+
if (!platform.startsWith("ios") && !platform.startsWith("ipados")) return false;
|
|
587
|
+
if (!isForegroundRestrictedIosCommand(params.command)) return false;
|
|
588
|
+
const error = params.error && typeof params.error === "object" ? params.error : null;
|
|
589
|
+
const code = normalizeOptionalString(error?.code)?.toUpperCase() ?? "";
|
|
590
|
+
const message = normalizeOptionalString(error?.message)?.toUpperCase() ?? "";
|
|
591
|
+
return code === "NODE_BACKGROUND_UNAVAILABLE" || message.includes("BACKGROUND_UNAVAILABLE");
|
|
592
|
+
}
|
|
593
|
+
function prunePendingNodeActions(nodeId, nowMs) {
|
|
594
|
+
const queue = pendingNodeActionsById.get(nodeId) ?? [];
|
|
595
|
+
const minTimestampMs = nowMs - NODE_PENDING_ACTION_TTL_MS;
|
|
596
|
+
const live = queue.filter((entry) => entry.enqueuedAtMs >= minTimestampMs);
|
|
597
|
+
if (live.length === 0) {
|
|
598
|
+
pendingNodeActionsById.delete(nodeId);
|
|
599
|
+
return [];
|
|
600
|
+
}
|
|
601
|
+
pendingNodeActionsById.set(nodeId, live);
|
|
602
|
+
return live;
|
|
603
|
+
}
|
|
604
|
+
function enqueuePendingNodeAction(params) {
|
|
605
|
+
const nowMs = Date.now();
|
|
606
|
+
const queue = prunePendingNodeActions(params.nodeId, nowMs);
|
|
607
|
+
const existing = queue.find((entry) => entry.idempotencyKey === params.idempotencyKey);
|
|
608
|
+
if (existing) return existing;
|
|
609
|
+
const entry = {
|
|
610
|
+
id: randomUUID(),
|
|
611
|
+
nodeId: params.nodeId,
|
|
612
|
+
command: params.command,
|
|
613
|
+
paramsJSON: params.paramsJSON,
|
|
614
|
+
idempotencyKey: params.idempotencyKey,
|
|
615
|
+
enqueuedAtMs: nowMs
|
|
616
|
+
};
|
|
617
|
+
queue.push(entry);
|
|
618
|
+
if (queue.length > NODE_PENDING_ACTION_MAX_PER_NODE) queue.splice(0, queue.length - NODE_PENDING_ACTION_MAX_PER_NODE);
|
|
619
|
+
pendingNodeActionsById.set(params.nodeId, queue);
|
|
620
|
+
return entry;
|
|
621
|
+
}
|
|
622
|
+
function listPendingNodeActions(nodeId) {
|
|
623
|
+
return prunePendingNodeActions(nodeId, Date.now());
|
|
624
|
+
}
|
|
625
|
+
function refreshConnectedNodeSurfaceCaches(params) {
|
|
626
|
+
const cfg = params.cfg ?? params.context.getRuntimeConfig();
|
|
627
|
+
const { nodeSession } = params;
|
|
628
|
+
recordRemoteNodeInfo({
|
|
629
|
+
nodeId: nodeSession.nodeId,
|
|
630
|
+
displayName: nodeSession.displayName,
|
|
631
|
+
platform: nodeSession.platform,
|
|
632
|
+
deviceFamily: nodeSession.deviceFamily,
|
|
633
|
+
commands: nodeSession.commands,
|
|
634
|
+
remoteIp: nodeSession.remoteIp
|
|
635
|
+
});
|
|
636
|
+
refreshRemoteNodeBins({
|
|
637
|
+
nodeId: nodeSession.nodeId,
|
|
638
|
+
platform: nodeSession.platform,
|
|
639
|
+
deviceFamily: nodeSession.deviceFamily,
|
|
640
|
+
commands: nodeSession.commands,
|
|
641
|
+
cfg
|
|
642
|
+
}).catch((err) => params.context.logGateway.warn(`remote bin probe failed for ${nodeSession.nodeId}: ${formatErrorMessage(err)}`));
|
|
643
|
+
}
|
|
644
|
+
function resolveAllowedPendingNodeActions(params) {
|
|
645
|
+
const pending = listPendingNodeActions(params.nodeId);
|
|
646
|
+
if (pending.length === 0) return pending;
|
|
647
|
+
const connect = params.client?.connect;
|
|
648
|
+
const declaredCommands = Array.isArray(connect?.commands) ? connect.commands : [];
|
|
649
|
+
const allowlist = resolveNodeCommandAllowlist(params.cfg, {
|
|
650
|
+
platform: connect?.client?.platform,
|
|
651
|
+
deviceFamily: connect?.client?.deviceFamily,
|
|
652
|
+
caps: connect?.caps,
|
|
653
|
+
commands: declaredCommands
|
|
654
|
+
});
|
|
655
|
+
const allowed = pending.filter((entry) => {
|
|
656
|
+
return isNodeCommandAllowed({
|
|
657
|
+
command: entry.command,
|
|
658
|
+
declaredCommands,
|
|
659
|
+
allowlist
|
|
660
|
+
}).ok;
|
|
661
|
+
});
|
|
662
|
+
if (allowed.length !== pending.length) if (allowed.length === 0) pendingNodeActionsById.delete(params.nodeId);
|
|
663
|
+
else pendingNodeActionsById.set(params.nodeId, allowed);
|
|
664
|
+
return allowed;
|
|
665
|
+
}
|
|
666
|
+
function ackPendingNodeActions(nodeId, ids) {
|
|
667
|
+
if (ids.length === 0) return listPendingNodeActions(nodeId);
|
|
668
|
+
const pending = prunePendingNodeActions(nodeId, Date.now());
|
|
669
|
+
const idSet = new Set(ids);
|
|
670
|
+
const remaining = pending.filter((entry) => !idSet.has(entry.id));
|
|
671
|
+
if (remaining.length === 0) {
|
|
672
|
+
pendingNodeActionsById.delete(nodeId);
|
|
673
|
+
return [];
|
|
674
|
+
}
|
|
675
|
+
pendingNodeActionsById.set(nodeId, remaining);
|
|
676
|
+
return remaining;
|
|
677
|
+
}
|
|
678
|
+
function toPendingParamsJSON(params) {
|
|
679
|
+
if (params === void 0) return;
|
|
680
|
+
try {
|
|
681
|
+
return JSON.stringify(params);
|
|
682
|
+
} catch {
|
|
683
|
+
return;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
function emitTalkPttNodeEvent(params) {
|
|
687
|
+
if (!TALK_PTT_COMMANDS.has(params.command)) return;
|
|
688
|
+
const payloadObj = typeof params.payload === "object" && params.payload !== null ? params.payload : {};
|
|
689
|
+
const captureId = normalizeOptionalString(payloadObj.captureId) ?? randomUUID();
|
|
690
|
+
const sessionId = `node:${params.nodeId}:talk:${captureId}`;
|
|
691
|
+
const seq = (talkPttEventSeqBySessionId.get(sessionId) ?? 0) + 1;
|
|
692
|
+
talkPttEventSeqBySessionId.set(sessionId, seq);
|
|
693
|
+
while (talkPttEventSeqBySessionId.size > 2048) {
|
|
694
|
+
const oldest = talkPttEventSeqBySessionId.keys().next().value;
|
|
695
|
+
if (oldest === void 0) break;
|
|
696
|
+
talkPttEventSeqBySessionId.delete(oldest);
|
|
697
|
+
}
|
|
698
|
+
const type = params.command === "talk.ptt.start" ? "capture.started" : params.command === "talk.ptt.cancel" ? "capture.cancelled" : params.command === "talk.ptt.once" ? "capture.once" : "capture.stopped";
|
|
699
|
+
const final = params.command !== "talk.ptt.start";
|
|
700
|
+
const talkEvent = {
|
|
701
|
+
id: `${sessionId}:${seq}`,
|
|
702
|
+
type,
|
|
703
|
+
sessionId,
|
|
704
|
+
captureId,
|
|
705
|
+
seq,
|
|
706
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
707
|
+
mode: "stt-tts",
|
|
708
|
+
transport: "managed-room",
|
|
709
|
+
brain: "agent-consult",
|
|
710
|
+
final,
|
|
711
|
+
payload: {
|
|
712
|
+
nodeId: params.nodeId,
|
|
713
|
+
command: params.command,
|
|
714
|
+
status: normalizeOptionalString(payloadObj.status) ?? void 0,
|
|
715
|
+
transcript: normalizeOptionalString(payloadObj.transcript) ?? void 0
|
|
716
|
+
}
|
|
717
|
+
};
|
|
718
|
+
params.context.broadcast("talk.event", {
|
|
719
|
+
nodeId: params.nodeId,
|
|
720
|
+
command: params.command,
|
|
721
|
+
talkEvent
|
|
722
|
+
}, { dropIfSlow: true });
|
|
723
|
+
}
|
|
724
|
+
async function maybeWakeNodeWithApns(nodeId, opts) {
|
|
725
|
+
const state = nodeWakeById.get(nodeId) ?? { lastWakeAtMs: 0 };
|
|
726
|
+
nodeWakeById.set(nodeId, state);
|
|
727
|
+
if (state.inFlight) return await state.inFlight;
|
|
728
|
+
const now = Date.now();
|
|
729
|
+
if (!(opts?.force === true) && state.lastWakeAtMs > 0 && now - state.lastWakeAtMs < NODE_WAKE_THROTTLE_MS) return {
|
|
730
|
+
available: true,
|
|
731
|
+
throttled: true,
|
|
732
|
+
path: "throttled",
|
|
733
|
+
durationMs: 0
|
|
734
|
+
};
|
|
735
|
+
state.inFlight = (async () => {
|
|
736
|
+
const startedAtMs = Date.now();
|
|
737
|
+
const withDuration = (attempt) => ({
|
|
738
|
+
...attempt,
|
|
739
|
+
durationMs: Math.max(0, Date.now() - startedAtMs)
|
|
740
|
+
});
|
|
741
|
+
try {
|
|
742
|
+
const registration = await loadApnsRegistration(nodeId);
|
|
743
|
+
if (!registration) {
|
|
744
|
+
nodeWakeById.delete(nodeId);
|
|
745
|
+
return withDuration({
|
|
746
|
+
available: false,
|
|
747
|
+
throttled: false,
|
|
748
|
+
path: "no-registration"
|
|
749
|
+
});
|
|
750
|
+
}
|
|
751
|
+
let wakeResult;
|
|
752
|
+
if (registration.transport === "relay") {
|
|
753
|
+
const relay = resolveRelayNodePushConfig(opts?.cfg ?? getRuntimeConfig(), registration);
|
|
754
|
+
if (!relay.ok) return withDuration({
|
|
755
|
+
available: false,
|
|
756
|
+
throttled: false,
|
|
757
|
+
path: "no-auth",
|
|
758
|
+
apnsReason: relay.error
|
|
759
|
+
});
|
|
760
|
+
state.lastWakeAtMs = Date.now();
|
|
761
|
+
wakeResult = await sendApnsBackgroundWake({
|
|
762
|
+
registration,
|
|
763
|
+
nodeId,
|
|
764
|
+
wakeReason: opts?.wakeReason ?? "node.invoke",
|
|
765
|
+
relayConfig: relay.relayConfig
|
|
766
|
+
});
|
|
767
|
+
} else {
|
|
768
|
+
const auth = await resolveDirectNodePushConfig();
|
|
769
|
+
if (!auth.ok) return withDuration({
|
|
770
|
+
available: false,
|
|
771
|
+
throttled: false,
|
|
772
|
+
path: "no-auth",
|
|
773
|
+
apnsReason: auth.error
|
|
774
|
+
});
|
|
775
|
+
state.lastWakeAtMs = Date.now();
|
|
776
|
+
wakeResult = await sendApnsBackgroundWake({
|
|
777
|
+
registration,
|
|
778
|
+
nodeId,
|
|
779
|
+
wakeReason: opts?.wakeReason ?? "node.invoke",
|
|
780
|
+
auth: auth.auth
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
await clearStaleApnsRegistrationIfNeeded(registration, nodeId, wakeResult);
|
|
784
|
+
if (!wakeResult.ok) return withDuration({
|
|
785
|
+
available: true,
|
|
786
|
+
throttled: false,
|
|
787
|
+
path: "send-error",
|
|
788
|
+
apnsStatus: wakeResult.status,
|
|
789
|
+
apnsReason: wakeResult.reason
|
|
790
|
+
});
|
|
791
|
+
return withDuration({
|
|
792
|
+
available: true,
|
|
793
|
+
throttled: false,
|
|
794
|
+
path: "sent",
|
|
795
|
+
apnsStatus: wakeResult.status,
|
|
796
|
+
apnsReason: wakeResult.reason
|
|
797
|
+
});
|
|
798
|
+
} catch (err) {
|
|
799
|
+
const message = formatErrorMessage(err);
|
|
800
|
+
if (state.lastWakeAtMs === 0) return withDuration({
|
|
801
|
+
available: false,
|
|
802
|
+
throttled: false,
|
|
803
|
+
path: "send-error",
|
|
804
|
+
apnsReason: message
|
|
805
|
+
});
|
|
806
|
+
return withDuration({
|
|
807
|
+
available: true,
|
|
808
|
+
throttled: false,
|
|
809
|
+
path: "send-error",
|
|
810
|
+
apnsReason: message
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
})();
|
|
814
|
+
try {
|
|
815
|
+
return await state.inFlight;
|
|
816
|
+
} finally {
|
|
817
|
+
state.inFlight = void 0;
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
async function maybeSendNodeWakeNudge(nodeId, opts) {
|
|
821
|
+
const startedAtMs = Date.now();
|
|
822
|
+
const withDuration = (attempt) => ({
|
|
823
|
+
...attempt,
|
|
824
|
+
durationMs: Math.max(0, Date.now() - startedAtMs)
|
|
825
|
+
});
|
|
826
|
+
const lastNudgeAtMs = nodeWakeNudgeById.get(nodeId) ?? 0;
|
|
827
|
+
if (lastNudgeAtMs > 0 && Date.now() - lastNudgeAtMs < NODE_WAKE_NUDGE_THROTTLE_MS) return withDuration({
|
|
828
|
+
sent: false,
|
|
829
|
+
throttled: true,
|
|
830
|
+
reason: "throttled"
|
|
831
|
+
});
|
|
832
|
+
const registration = await loadApnsRegistration(nodeId);
|
|
833
|
+
if (!registration) return withDuration({
|
|
834
|
+
sent: false,
|
|
835
|
+
throttled: false,
|
|
836
|
+
reason: "no-registration"
|
|
837
|
+
});
|
|
838
|
+
try {
|
|
839
|
+
let result;
|
|
840
|
+
if (registration.transport === "relay") {
|
|
841
|
+
const relay = resolveRelayNodePushConfig(opts?.cfg ?? getRuntimeConfig(), registration);
|
|
842
|
+
if (!relay.ok) return withDuration({
|
|
843
|
+
sent: false,
|
|
844
|
+
throttled: false,
|
|
845
|
+
reason: "no-auth",
|
|
846
|
+
apnsReason: relay.error
|
|
847
|
+
});
|
|
848
|
+
result = await sendApnsAlert({
|
|
849
|
+
registration,
|
|
850
|
+
nodeId,
|
|
851
|
+
title: "FengMing needs a quick reopen",
|
|
852
|
+
body: "Tap to reopen FengMing and restore the node connection.",
|
|
853
|
+
relayConfig: relay.relayConfig
|
|
854
|
+
});
|
|
855
|
+
} else {
|
|
856
|
+
const auth = await resolveDirectNodePushConfig();
|
|
857
|
+
if (!auth.ok) return withDuration({
|
|
858
|
+
sent: false,
|
|
859
|
+
throttled: false,
|
|
860
|
+
reason: "no-auth",
|
|
861
|
+
apnsReason: auth.error
|
|
862
|
+
});
|
|
863
|
+
result = await sendApnsAlert({
|
|
864
|
+
registration,
|
|
865
|
+
nodeId,
|
|
866
|
+
title: "FengMing needs a quick reopen",
|
|
867
|
+
body: "Tap to reopen FengMing and restore the node connection.",
|
|
868
|
+
auth: auth.auth
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
await clearStaleApnsRegistrationIfNeeded(registration, nodeId, result);
|
|
872
|
+
if (!result.ok) return withDuration({
|
|
873
|
+
sent: false,
|
|
874
|
+
throttled: false,
|
|
875
|
+
reason: "apns-not-ok",
|
|
876
|
+
apnsStatus: result.status,
|
|
877
|
+
apnsReason: result.reason
|
|
878
|
+
});
|
|
879
|
+
nodeWakeNudgeById.set(nodeId, Date.now());
|
|
880
|
+
return withDuration({
|
|
881
|
+
sent: true,
|
|
882
|
+
throttled: false,
|
|
883
|
+
reason: "sent",
|
|
884
|
+
apnsStatus: result.status,
|
|
885
|
+
apnsReason: result.reason
|
|
886
|
+
});
|
|
887
|
+
} catch (err) {
|
|
888
|
+
return withDuration({
|
|
889
|
+
sent: false,
|
|
890
|
+
throttled: false,
|
|
891
|
+
reason: "send-error",
|
|
892
|
+
apnsReason: formatErrorMessage(err)
|
|
893
|
+
});
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
async function waitForNodeReconnect(params) {
|
|
897
|
+
const timeoutMs = resolveTimerTimeoutMs(params.timeoutMs, NODE_WAKE_RECONNECT_WAIT_MS, 250);
|
|
898
|
+
const pollMs = resolveTimerTimeoutMs(params.pollMs, 150, 50);
|
|
899
|
+
const deadline = Date.now() + timeoutMs;
|
|
900
|
+
while (Date.now() < deadline) {
|
|
901
|
+
if (params.context.nodeRegistry.get(params.nodeId)) return true;
|
|
902
|
+
await delayMs(pollMs);
|
|
903
|
+
}
|
|
904
|
+
return Boolean(params.context.nodeRegistry.get(params.nodeId));
|
|
905
|
+
}
|
|
906
|
+
const nodeHandlers = {
|
|
907
|
+
"node.pair.request": async ({ params, respond, context }) => {
|
|
908
|
+
if (!validateNodePairRequestParams(params)) {
|
|
909
|
+
respondInvalidParams({
|
|
910
|
+
respond,
|
|
911
|
+
method: "node.pair.request",
|
|
912
|
+
validator: validateNodePairRequestParams
|
|
913
|
+
});
|
|
914
|
+
return;
|
|
915
|
+
}
|
|
916
|
+
const p = params;
|
|
917
|
+
await respondUnavailableOnThrow(respond, async () => {
|
|
918
|
+
const result = await requestNodePairing({
|
|
919
|
+
nodeId: p.nodeId,
|
|
920
|
+
displayName: p.displayName,
|
|
921
|
+
platform: p.platform,
|
|
922
|
+
version: p.version,
|
|
923
|
+
coreVersion: p.coreVersion,
|
|
924
|
+
uiVersion: p.uiVersion,
|
|
925
|
+
deviceFamily: p.deviceFamily,
|
|
926
|
+
modelIdentifier: p.modelIdentifier,
|
|
927
|
+
caps: p.caps,
|
|
928
|
+
commands: p.commands,
|
|
929
|
+
permissions: p.permissions,
|
|
930
|
+
remoteIp: p.remoteIp,
|
|
931
|
+
silent: p.silent
|
|
932
|
+
});
|
|
933
|
+
const resolvedAt = Date.now();
|
|
934
|
+
for (const superseded of result.superseded ?? []) context.broadcast("node.pair.resolved", {
|
|
935
|
+
requestId: superseded.requestId,
|
|
936
|
+
nodeId: superseded.nodeId,
|
|
937
|
+
decision: "rejected",
|
|
938
|
+
ts: resolvedAt
|
|
939
|
+
}, { dropIfSlow: true });
|
|
940
|
+
if (result.status === "pending" && result.created) context.broadcast("node.pair.requested", result.request, { dropIfSlow: true });
|
|
941
|
+
respond(true, result, void 0);
|
|
942
|
+
});
|
|
943
|
+
},
|
|
944
|
+
"node.pair.list": async ({ params, respond }) => {
|
|
945
|
+
if (!validateNodePairListParams(params)) {
|
|
946
|
+
respondInvalidParams({
|
|
947
|
+
respond,
|
|
948
|
+
method: "node.pair.list",
|
|
949
|
+
validator: validateNodePairListParams
|
|
950
|
+
});
|
|
951
|
+
return;
|
|
952
|
+
}
|
|
953
|
+
await respondUnavailableOnThrow(respond, async () => {
|
|
954
|
+
respond(true, await listNodePairing(), void 0);
|
|
955
|
+
});
|
|
956
|
+
},
|
|
957
|
+
"node.pair.approve": async ({ params, respond, context, client }) => {
|
|
958
|
+
if (!validateNodePairApproveParams(params)) {
|
|
959
|
+
respondInvalidParams({
|
|
960
|
+
respond,
|
|
961
|
+
method: "node.pair.approve",
|
|
962
|
+
validator: validateNodePairApproveParams
|
|
963
|
+
});
|
|
964
|
+
return;
|
|
965
|
+
}
|
|
966
|
+
const { requestId } = params;
|
|
967
|
+
const callerScopes = Array.isArray(client?.connect?.scopes) ? client.connect.scopes : [];
|
|
968
|
+
await respondUnavailableOnThrow(respond, async () => {
|
|
969
|
+
const approved = await approveNodePairing(requestId, { callerScopes });
|
|
970
|
+
if (!approved) {
|
|
971
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "unknown requestId"));
|
|
972
|
+
return;
|
|
973
|
+
}
|
|
974
|
+
if ("status" in approved && approved.status === "forbidden") {
|
|
975
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, `missing scope: ${approved.missingScope}`));
|
|
976
|
+
return;
|
|
977
|
+
}
|
|
978
|
+
if (!("node" in approved)) {
|
|
979
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "unknown requestId"));
|
|
980
|
+
return;
|
|
981
|
+
}
|
|
982
|
+
const approvedNode = approved.node;
|
|
983
|
+
const cfg = context.getRuntimeConfig();
|
|
984
|
+
const currentAllowlist = resolveNodeCommandAllowlist(cfg, {
|
|
985
|
+
platform: approvedNode.platform,
|
|
986
|
+
deviceFamily: approvedNode.deviceFamily,
|
|
987
|
+
caps: approvedNode.caps,
|
|
988
|
+
commands: approvedNode.commands,
|
|
989
|
+
approvedCommands: approvedNode.commands
|
|
990
|
+
});
|
|
991
|
+
const currentAllowedCommands = normalizeDeclaredNodeCommands({
|
|
992
|
+
declaredCommands: approvedNode.commands ?? [],
|
|
993
|
+
allowlist: currentAllowlist
|
|
994
|
+
});
|
|
995
|
+
const updatedNode = context.nodeRegistry.updateSurface(approvedNode.nodeId, {
|
|
996
|
+
caps: approvedNode.caps ?? [],
|
|
997
|
+
commands: currentAllowedCommands,
|
|
998
|
+
permissions: approvedNode.permissions
|
|
999
|
+
});
|
|
1000
|
+
if (updatedNode) refreshConnectedNodeSurfaceCaches({
|
|
1001
|
+
context,
|
|
1002
|
+
nodeSession: updatedNode,
|
|
1003
|
+
cfg
|
|
1004
|
+
});
|
|
1005
|
+
context.broadcast("node.pair.resolved", {
|
|
1006
|
+
requestId,
|
|
1007
|
+
nodeId: approvedNode.nodeId,
|
|
1008
|
+
decision: "approved",
|
|
1009
|
+
ts: Date.now()
|
|
1010
|
+
}, { dropIfSlow: true });
|
|
1011
|
+
respond(true, approved, void 0);
|
|
1012
|
+
});
|
|
1013
|
+
},
|
|
1014
|
+
"node.pair.reject": async ({ params, respond, context }) => {
|
|
1015
|
+
if (!validateNodePairRejectParams(params)) {
|
|
1016
|
+
respondInvalidParams({
|
|
1017
|
+
respond,
|
|
1018
|
+
method: "node.pair.reject",
|
|
1019
|
+
validator: validateNodePairRejectParams
|
|
1020
|
+
});
|
|
1021
|
+
return;
|
|
1022
|
+
}
|
|
1023
|
+
const { requestId } = params;
|
|
1024
|
+
await respondUnavailableOnThrow(respond, async () => {
|
|
1025
|
+
const rejected = await rejectNodePairing(requestId);
|
|
1026
|
+
if (!rejected) {
|
|
1027
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "unknown requestId"));
|
|
1028
|
+
return;
|
|
1029
|
+
}
|
|
1030
|
+
context.broadcast("node.pair.resolved", {
|
|
1031
|
+
requestId,
|
|
1032
|
+
nodeId: rejected.nodeId,
|
|
1033
|
+
decision: "rejected",
|
|
1034
|
+
ts: Date.now()
|
|
1035
|
+
}, { dropIfSlow: true });
|
|
1036
|
+
respond(true, rejected, void 0);
|
|
1037
|
+
});
|
|
1038
|
+
},
|
|
1039
|
+
"node.pair.remove": async ({ params, respond, context }) => {
|
|
1040
|
+
if (!validateNodePairRemoveParams(params)) {
|
|
1041
|
+
respondInvalidParams({
|
|
1042
|
+
respond,
|
|
1043
|
+
method: "node.pair.remove",
|
|
1044
|
+
validator: validateNodePairRemoveParams
|
|
1045
|
+
});
|
|
1046
|
+
return;
|
|
1047
|
+
}
|
|
1048
|
+
const { nodeId } = params;
|
|
1049
|
+
await respondUnavailableOnThrow(respond, async () => {
|
|
1050
|
+
const removed = await removePairedNode(nodeId);
|
|
1051
|
+
if (!removed) {
|
|
1052
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "unknown nodeId"));
|
|
1053
|
+
return;
|
|
1054
|
+
}
|
|
1055
|
+
pendingNodeActionsById.delete(removed.nodeId);
|
|
1056
|
+
context.nodeRegistry.updateSurface(removed.nodeId, {
|
|
1057
|
+
caps: [],
|
|
1058
|
+
commands: [],
|
|
1059
|
+
permissions: void 0
|
|
1060
|
+
});
|
|
1061
|
+
removeRemoteNodeInfo(removed.nodeId);
|
|
1062
|
+
context.broadcast("node.pair.resolved", {
|
|
1063
|
+
requestId: "",
|
|
1064
|
+
nodeId: removed.nodeId,
|
|
1065
|
+
decision: "removed",
|
|
1066
|
+
ts: Date.now()
|
|
1067
|
+
}, { dropIfSlow: true });
|
|
1068
|
+
respond(true, removed, void 0);
|
|
1069
|
+
});
|
|
1070
|
+
},
|
|
1071
|
+
"node.pair.verify": async ({ params, respond }) => {
|
|
1072
|
+
if (!validateNodePairVerifyParams(params)) {
|
|
1073
|
+
respondInvalidParams({
|
|
1074
|
+
respond,
|
|
1075
|
+
method: "node.pair.verify",
|
|
1076
|
+
validator: validateNodePairVerifyParams
|
|
1077
|
+
});
|
|
1078
|
+
return;
|
|
1079
|
+
}
|
|
1080
|
+
const { nodeId, token } = params;
|
|
1081
|
+
await respondUnavailableOnThrow(respond, async () => {
|
|
1082
|
+
respond(true, await verifyNodeToken(nodeId, token), void 0);
|
|
1083
|
+
});
|
|
1084
|
+
},
|
|
1085
|
+
"node.rename": async ({ params, respond }) => {
|
|
1086
|
+
if (!validateNodeRenameParams(params)) {
|
|
1087
|
+
respondInvalidParams({
|
|
1088
|
+
respond,
|
|
1089
|
+
method: "node.rename",
|
|
1090
|
+
validator: validateNodeRenameParams
|
|
1091
|
+
});
|
|
1092
|
+
return;
|
|
1093
|
+
}
|
|
1094
|
+
const { nodeId, displayName } = params;
|
|
1095
|
+
await respondUnavailableOnThrow(respond, async () => {
|
|
1096
|
+
const trimmed = displayName.trim();
|
|
1097
|
+
if (!trimmed) {
|
|
1098
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "displayName required"));
|
|
1099
|
+
return;
|
|
1100
|
+
}
|
|
1101
|
+
const updated = await renamePairedNode(nodeId, trimmed);
|
|
1102
|
+
if (!updated) {
|
|
1103
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "unknown nodeId"));
|
|
1104
|
+
return;
|
|
1105
|
+
}
|
|
1106
|
+
respond(true, {
|
|
1107
|
+
nodeId: updated.nodeId,
|
|
1108
|
+
displayName: updated.displayName
|
|
1109
|
+
}, void 0);
|
|
1110
|
+
});
|
|
1111
|
+
},
|
|
1112
|
+
"node.list": async ({ params, respond, context }) => {
|
|
1113
|
+
if (!validateNodeListParams(params)) {
|
|
1114
|
+
respondInvalidParams({
|
|
1115
|
+
respond,
|
|
1116
|
+
method: "node.list",
|
|
1117
|
+
validator: validateNodeListParams
|
|
1118
|
+
});
|
|
1119
|
+
return;
|
|
1120
|
+
}
|
|
1121
|
+
await respondUnavailableOnThrow(respond, async () => {
|
|
1122
|
+
const [devicePairing, nodePairing] = await Promise.all([listDevicePairing(), listNodePairing()]);
|
|
1123
|
+
const nodes = listKnownNodes(createKnownNodeCatalog({
|
|
1124
|
+
pairedDevices: devicePairing.paired,
|
|
1125
|
+
pairedNodes: nodePairing.paired,
|
|
1126
|
+
connectedNodes: context.nodeRegistry.listConnected()
|
|
1127
|
+
}));
|
|
1128
|
+
respond(true, {
|
|
1129
|
+
ts: Date.now(),
|
|
1130
|
+
nodes
|
|
1131
|
+
}, void 0);
|
|
1132
|
+
});
|
|
1133
|
+
},
|
|
1134
|
+
"node.describe": async ({ params, respond, context }) => {
|
|
1135
|
+
if (!validateNodeDescribeParams(params)) {
|
|
1136
|
+
respondInvalidParams({
|
|
1137
|
+
respond,
|
|
1138
|
+
method: "node.describe",
|
|
1139
|
+
validator: validateNodeDescribeParams
|
|
1140
|
+
});
|
|
1141
|
+
return;
|
|
1142
|
+
}
|
|
1143
|
+
const { nodeId } = params;
|
|
1144
|
+
const id = normalizeOptionalString(nodeId) ?? "";
|
|
1145
|
+
if (!id) {
|
|
1146
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "nodeId required"));
|
|
1147
|
+
return;
|
|
1148
|
+
}
|
|
1149
|
+
await respondUnavailableOnThrow(respond, async () => {
|
|
1150
|
+
const [devicePairing, nodePairing] = await Promise.all([listDevicePairing(), listNodePairing()]);
|
|
1151
|
+
const node = getKnownNode(createKnownNodeCatalog({
|
|
1152
|
+
pairedDevices: devicePairing.paired,
|
|
1153
|
+
pairedNodes: nodePairing.paired,
|
|
1154
|
+
connectedNodes: context.nodeRegistry.listConnected()
|
|
1155
|
+
}), id);
|
|
1156
|
+
if (!node) {
|
|
1157
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "unknown nodeId"));
|
|
1158
|
+
return;
|
|
1159
|
+
}
|
|
1160
|
+
respond(true, {
|
|
1161
|
+
ts: Date.now(),
|
|
1162
|
+
...node
|
|
1163
|
+
}, void 0);
|
|
1164
|
+
});
|
|
1165
|
+
},
|
|
1166
|
+
"node.pluginSurface.refresh": async ({ params, respond, client }) => {
|
|
1167
|
+
const parsed = normalizePluginSurfaceRefreshParams(params);
|
|
1168
|
+
if (!parsed) {
|
|
1169
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "surface required"));
|
|
1170
|
+
return;
|
|
1171
|
+
}
|
|
1172
|
+
respondRefreshedPluginSurface({
|
|
1173
|
+
surface: parsed.surface,
|
|
1174
|
+
client,
|
|
1175
|
+
respond
|
|
1176
|
+
});
|
|
1177
|
+
},
|
|
1178
|
+
"node.pending.pull": async ({ params, respond, client, context }) => {
|
|
1179
|
+
if (!validateNodeListParams(params)) {
|
|
1180
|
+
respondInvalidParams({
|
|
1181
|
+
respond,
|
|
1182
|
+
method: "node.pending.pull",
|
|
1183
|
+
validator: validateNodeListParams
|
|
1184
|
+
});
|
|
1185
|
+
return;
|
|
1186
|
+
}
|
|
1187
|
+
const trimmedNodeId = normalizeOptionalString(client?.connect?.device?.id ?? client?.connect?.client?.id) ?? "";
|
|
1188
|
+
if (!trimmedNodeId) {
|
|
1189
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "nodeId required"));
|
|
1190
|
+
return;
|
|
1191
|
+
}
|
|
1192
|
+
respond(true, {
|
|
1193
|
+
nodeId: trimmedNodeId,
|
|
1194
|
+
actions: resolveAllowedPendingNodeActions({
|
|
1195
|
+
nodeId: trimmedNodeId,
|
|
1196
|
+
client,
|
|
1197
|
+
cfg: context.getRuntimeConfig()
|
|
1198
|
+
}).map((entry) => ({
|
|
1199
|
+
id: entry.id,
|
|
1200
|
+
command: entry.command,
|
|
1201
|
+
paramsJSON: entry.paramsJSON ?? null,
|
|
1202
|
+
enqueuedAtMs: entry.enqueuedAtMs
|
|
1203
|
+
}))
|
|
1204
|
+
}, void 0);
|
|
1205
|
+
},
|
|
1206
|
+
"node.pending.ack": async ({ params, respond, client }) => {
|
|
1207
|
+
if (!validateNodePendingAckParams(params)) {
|
|
1208
|
+
respondInvalidParams({
|
|
1209
|
+
respond,
|
|
1210
|
+
method: "node.pending.ack",
|
|
1211
|
+
validator: validateNodePendingAckParams
|
|
1212
|
+
});
|
|
1213
|
+
return;
|
|
1214
|
+
}
|
|
1215
|
+
const trimmedNodeId = normalizeOptionalString(client?.connect?.device?.id ?? client?.connect?.client?.id) ?? "";
|
|
1216
|
+
if (!trimmedNodeId) {
|
|
1217
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "nodeId required"));
|
|
1218
|
+
return;
|
|
1219
|
+
}
|
|
1220
|
+
const ackIds = normalizeUniqueTrimmedStringList(params.ids);
|
|
1221
|
+
respond(true, {
|
|
1222
|
+
nodeId: trimmedNodeId,
|
|
1223
|
+
ackedIds: ackIds,
|
|
1224
|
+
remainingCount: ackPendingNodeActions(trimmedNodeId, ackIds).length
|
|
1225
|
+
}, void 0);
|
|
1226
|
+
},
|
|
1227
|
+
"node.invoke": async ({ params, respond, context, client, req }) => {
|
|
1228
|
+
if (!validateNodeInvokeParams(params)) {
|
|
1229
|
+
respondInvalidParams({
|
|
1230
|
+
respond,
|
|
1231
|
+
method: "node.invoke",
|
|
1232
|
+
validator: validateNodeInvokeParams
|
|
1233
|
+
});
|
|
1234
|
+
return;
|
|
1235
|
+
}
|
|
1236
|
+
const p = params;
|
|
1237
|
+
const nodeId = normalizeOptionalString(p.nodeId) ?? "";
|
|
1238
|
+
const command = normalizeOptionalString(p.command) ?? "";
|
|
1239
|
+
if (!nodeId || !command) {
|
|
1240
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "nodeId and command required"));
|
|
1241
|
+
return;
|
|
1242
|
+
}
|
|
1243
|
+
if (command === "system.execApprovals.get" || command === "system.execApprovals.set") {
|
|
1244
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "node.invoke does not allow system.execApprovals.*; use exec.approvals.node.*", { details: { command } }));
|
|
1245
|
+
return;
|
|
1246
|
+
}
|
|
1247
|
+
if (command === "browser.proxy" && isForbiddenBrowserProxyMutation(p.params)) {
|
|
1248
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "node.invoke cannot mutate persistent browser profiles via browser.proxy", { details: { command } }));
|
|
1249
|
+
return;
|
|
1250
|
+
}
|
|
1251
|
+
await respondUnavailableOnThrow(respond, async () => {
|
|
1252
|
+
const cfg = context.getRuntimeConfig();
|
|
1253
|
+
let nodeSession = context.nodeRegistry.get(nodeId);
|
|
1254
|
+
if (!nodeSession) {
|
|
1255
|
+
const wakeReqId = req.id;
|
|
1256
|
+
const wakeFlowStartedAtMs = Date.now();
|
|
1257
|
+
context.logGateway.info(`node wake start node=${nodeId} req=${wakeReqId} command=${command}`);
|
|
1258
|
+
const wake = await maybeWakeNodeWithApns(nodeId, { cfg });
|
|
1259
|
+
context.logGateway.info(`node wake stage=wake1 node=${nodeId} req=${wakeReqId} available=${wake.available} throttled=${wake.throttled} path=${wake.path} durationMs=${wake.durationMs} apnsStatus=${wake.apnsStatus ?? -1} apnsReason=${wake.apnsReason ?? "-"}`);
|
|
1260
|
+
if (wake.available) {
|
|
1261
|
+
const waitStartedAtMs = Date.now();
|
|
1262
|
+
const waitTimeoutMs = NODE_WAKE_RECONNECT_WAIT_MS;
|
|
1263
|
+
const reconnected = await waitForNodeReconnect({
|
|
1264
|
+
nodeId,
|
|
1265
|
+
context,
|
|
1266
|
+
timeoutMs: waitTimeoutMs
|
|
1267
|
+
});
|
|
1268
|
+
const waitDurationMs = Math.max(0, Date.now() - waitStartedAtMs);
|
|
1269
|
+
context.logGateway.info(`node wake stage=wait1 node=${nodeId} req=${wakeReqId} reconnected=${reconnected} timeoutMs=${waitTimeoutMs} durationMs=${waitDurationMs}`);
|
|
1270
|
+
}
|
|
1271
|
+
nodeSession = context.nodeRegistry.get(nodeId);
|
|
1272
|
+
if (!nodeSession && wake.available) {
|
|
1273
|
+
const retryWake = await maybeWakeNodeWithApns(nodeId, {
|
|
1274
|
+
force: true,
|
|
1275
|
+
cfg
|
|
1276
|
+
});
|
|
1277
|
+
context.logGateway.info(`node wake stage=wake2 node=${nodeId} req=${wakeReqId} force=true available=${retryWake.available} throttled=${retryWake.throttled} path=${retryWake.path} durationMs=${retryWake.durationMs} apnsStatus=${retryWake.apnsStatus ?? -1} apnsReason=${retryWake.apnsReason ?? "-"}`);
|
|
1278
|
+
if (retryWake.available) {
|
|
1279
|
+
const waitStartedAtMs = Date.now();
|
|
1280
|
+
const waitTimeoutMs = NODE_WAKE_RECONNECT_RETRY_WAIT_MS;
|
|
1281
|
+
const reconnected = await waitForNodeReconnect({
|
|
1282
|
+
nodeId,
|
|
1283
|
+
context,
|
|
1284
|
+
timeoutMs: waitTimeoutMs
|
|
1285
|
+
});
|
|
1286
|
+
const waitDurationMs = Math.max(0, Date.now() - waitStartedAtMs);
|
|
1287
|
+
context.logGateway.info(`node wake stage=wait2 node=${nodeId} req=${wakeReqId} reconnected=${reconnected} timeoutMs=${waitTimeoutMs} durationMs=${waitDurationMs}`);
|
|
1288
|
+
}
|
|
1289
|
+
nodeSession = context.nodeRegistry.get(nodeId);
|
|
1290
|
+
}
|
|
1291
|
+
if (!nodeSession) {
|
|
1292
|
+
const totalDurationMs = Math.max(0, Date.now() - wakeFlowStartedAtMs);
|
|
1293
|
+
const nudge = await maybeSendNodeWakeNudge(nodeId, { cfg });
|
|
1294
|
+
context.logGateway.info(`node wake nudge node=${nodeId} req=${wakeReqId} sent=${nudge.sent} throttled=${nudge.throttled} reason=${nudge.reason} durationMs=${nudge.durationMs} apnsStatus=${nudge.apnsStatus ?? -1} apnsReason=${nudge.apnsReason ?? "-"}`);
|
|
1295
|
+
context.logGateway.warn(`node wake done node=${nodeId} req=${wakeReqId} connected=false reason=not_connected totalMs=${totalDurationMs}`);
|
|
1296
|
+
respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, "node not connected", { details: { code: "NOT_CONNECTED" } }));
|
|
1297
|
+
return;
|
|
1298
|
+
}
|
|
1299
|
+
const totalDurationMs = Math.max(0, Date.now() - wakeFlowStartedAtMs);
|
|
1300
|
+
context.logGateway.info(`node wake done node=${nodeId} req=${wakeReqId} connected=true totalMs=${totalDurationMs}`);
|
|
1301
|
+
}
|
|
1302
|
+
const allowlist = resolveNodeCommandAllowlist(cfg, {
|
|
1303
|
+
...nodeSession,
|
|
1304
|
+
approvedCommands: nodeSession.commands
|
|
1305
|
+
});
|
|
1306
|
+
const allowed = isNodeCommandAllowed({
|
|
1307
|
+
command,
|
|
1308
|
+
declaredCommands: nodeSession.commands,
|
|
1309
|
+
allowlist
|
|
1310
|
+
});
|
|
1311
|
+
if (!allowed.ok) {
|
|
1312
|
+
const hint = buildNodeCommandRejectionHint(allowed.reason, command, nodeSession);
|
|
1313
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, hint, { details: {
|
|
1314
|
+
reason: allowed.reason,
|
|
1315
|
+
command
|
|
1316
|
+
} }));
|
|
1317
|
+
return;
|
|
1318
|
+
}
|
|
1319
|
+
const forwardedParams = sanitizeNodeInvokeParamsForForwarding({
|
|
1320
|
+
nodeId,
|
|
1321
|
+
command,
|
|
1322
|
+
rawParams: p.params,
|
|
1323
|
+
client,
|
|
1324
|
+
execApprovalManager: context.execApprovalManager
|
|
1325
|
+
});
|
|
1326
|
+
if (!forwardedParams.ok) {
|
|
1327
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, forwardedParams.message, { details: forwardedParams.details ?? null }));
|
|
1328
|
+
return;
|
|
1329
|
+
}
|
|
1330
|
+
const policyResult = await applyPluginNodeInvokePolicy({
|
|
1331
|
+
context,
|
|
1332
|
+
client,
|
|
1333
|
+
nodeSession,
|
|
1334
|
+
command,
|
|
1335
|
+
params: forwardedParams.params,
|
|
1336
|
+
timeoutMs: p.timeoutMs,
|
|
1337
|
+
idempotencyKey: p.idempotencyKey
|
|
1338
|
+
});
|
|
1339
|
+
if (policyResult) {
|
|
1340
|
+
if (!policyResult.ok) {
|
|
1341
|
+
respond(false, void 0, errorShape(policyResult.unavailable ? ErrorCodes.UNAVAILABLE : ErrorCodes.INVALID_REQUEST, policyResult.message, { details: {
|
|
1342
|
+
...policyResult.details,
|
|
1343
|
+
...policyResult.code ? { code: policyResult.code } : {}
|
|
1344
|
+
} }));
|
|
1345
|
+
return;
|
|
1346
|
+
}
|
|
1347
|
+
emitTalkPttNodeEvent({
|
|
1348
|
+
context,
|
|
1349
|
+
nodeId,
|
|
1350
|
+
command,
|
|
1351
|
+
payload: policyResult.payloadJSON ? safeParseJson(policyResult.payloadJSON) : policyResult.payload
|
|
1352
|
+
});
|
|
1353
|
+
respond(true, {
|
|
1354
|
+
ok: true,
|
|
1355
|
+
nodeId,
|
|
1356
|
+
command,
|
|
1357
|
+
payload: policyResult.payload,
|
|
1358
|
+
payloadJSON: policyResult.payloadJSON ?? null
|
|
1359
|
+
}, void 0);
|
|
1360
|
+
return;
|
|
1361
|
+
}
|
|
1362
|
+
const res = await context.nodeRegistry.invoke({
|
|
1363
|
+
nodeId,
|
|
1364
|
+
command,
|
|
1365
|
+
params: forwardedParams.params,
|
|
1366
|
+
timeoutMs: p.timeoutMs,
|
|
1367
|
+
idempotencyKey: p.idempotencyKey
|
|
1368
|
+
});
|
|
1369
|
+
if (!res.ok) {
|
|
1370
|
+
if (shouldQueueAsPendingForegroundAction({
|
|
1371
|
+
platform: nodeSession.platform,
|
|
1372
|
+
command,
|
|
1373
|
+
error: res.error
|
|
1374
|
+
})) {
|
|
1375
|
+
const queued = enqueuePendingNodeAction({
|
|
1376
|
+
nodeId,
|
|
1377
|
+
command,
|
|
1378
|
+
paramsJSON: toPendingParamsJSON(forwardedParams.params),
|
|
1379
|
+
idempotencyKey: p.idempotencyKey
|
|
1380
|
+
});
|
|
1381
|
+
const wake = await maybeWakeNodeWithApns(nodeId, { cfg });
|
|
1382
|
+
context.logGateway.info(`node pending queued node=${nodeId} req=${req.id} command=${command} queuedId=${queued.id} wakePath=${wake.path} wakeAvailable=${wake.available}`);
|
|
1383
|
+
respond(false, void 0, errorShape(ErrorCodes.UNAVAILABLE, "node command queued until iOS returns to foreground", {
|
|
1384
|
+
retryable: true,
|
|
1385
|
+
details: {
|
|
1386
|
+
code: "QUEUED_UNTIL_FOREGROUND",
|
|
1387
|
+
queuedActionId: queued.id,
|
|
1388
|
+
nodeId,
|
|
1389
|
+
command,
|
|
1390
|
+
wake: {
|
|
1391
|
+
path: wake.path,
|
|
1392
|
+
available: wake.available,
|
|
1393
|
+
throttled: wake.throttled,
|
|
1394
|
+
apnsStatus: wake.apnsStatus,
|
|
1395
|
+
apnsReason: wake.apnsReason
|
|
1396
|
+
},
|
|
1397
|
+
nodeError: res.error ?? null
|
|
1398
|
+
}
|
|
1399
|
+
}));
|
|
1400
|
+
return;
|
|
1401
|
+
}
|
|
1402
|
+
if (!respondUnavailableOnNodeInvokeError(respond, res)) return;
|
|
1403
|
+
return;
|
|
1404
|
+
}
|
|
1405
|
+
const payload = res.payloadJSON ? safeParseJson(res.payloadJSON) : res.payload;
|
|
1406
|
+
emitTalkPttNodeEvent({
|
|
1407
|
+
context,
|
|
1408
|
+
nodeId,
|
|
1409
|
+
command,
|
|
1410
|
+
payload
|
|
1411
|
+
});
|
|
1412
|
+
respond(true, {
|
|
1413
|
+
ok: true,
|
|
1414
|
+
nodeId,
|
|
1415
|
+
command,
|
|
1416
|
+
payload,
|
|
1417
|
+
payloadJSON: res.payloadJSON ?? null
|
|
1418
|
+
}, void 0);
|
|
1419
|
+
});
|
|
1420
|
+
},
|
|
1421
|
+
"node.invoke.result": handleNodeInvokeResult,
|
|
1422
|
+
"node.event": async ({ params, respond, context, client }) => {
|
|
1423
|
+
if (!validateNodeEventParams(params)) {
|
|
1424
|
+
respondInvalidParams({
|
|
1425
|
+
respond,
|
|
1426
|
+
method: "node.event",
|
|
1427
|
+
validator: validateNodeEventParams
|
|
1428
|
+
});
|
|
1429
|
+
return;
|
|
1430
|
+
}
|
|
1431
|
+
const p = params;
|
|
1432
|
+
const payloadJSON = typeof p.payloadJSON === "string" ? p.payloadJSON : p.payload !== void 0 ? JSON.stringify(p.payload) : null;
|
|
1433
|
+
await respondUnavailableOnThrow(respond, async () => {
|
|
1434
|
+
const { handleNodeEvent } = await import("./server-node-events-DMMzZciN.js");
|
|
1435
|
+
const nodeId = client?.connect?.device?.id ?? client?.connect?.client?.id ?? "node";
|
|
1436
|
+
respond(true, await handleNodeEvent({
|
|
1437
|
+
deps: context.deps,
|
|
1438
|
+
broadcast: context.broadcast,
|
|
1439
|
+
nodeSendToSession: context.nodeSendToSession,
|
|
1440
|
+
nodeSubscribe: context.nodeSubscribe,
|
|
1441
|
+
nodeUnsubscribe: context.nodeUnsubscribe,
|
|
1442
|
+
broadcastVoiceWakeChanged: context.broadcastVoiceWakeChanged,
|
|
1443
|
+
addChatRun: context.addChatRun,
|
|
1444
|
+
removeChatRun: context.removeChatRun,
|
|
1445
|
+
chatAbortControllers: context.chatAbortControllers,
|
|
1446
|
+
chatAbortedRuns: context.chatAbortedRuns,
|
|
1447
|
+
chatRunBuffers: context.chatRunBuffers,
|
|
1448
|
+
chatDeltaSentAt: context.chatDeltaSentAt,
|
|
1449
|
+
dedupe: context.dedupe,
|
|
1450
|
+
agentRunSeq: context.agentRunSeq,
|
|
1451
|
+
getHealthCache: context.getHealthCache,
|
|
1452
|
+
refreshHealthSnapshot: context.refreshHealthSnapshot,
|
|
1453
|
+
loadGatewayModelCatalog: context.loadGatewayModelCatalog,
|
|
1454
|
+
authorizeNodeSystemRunEvent: (eventParams) => context.nodeRegistry.authorizeSystemRunEvent({
|
|
1455
|
+
nodeId: eventParams.nodeId,
|
|
1456
|
+
connId: eventParams.connId,
|
|
1457
|
+
runId: eventParams.runId,
|
|
1458
|
+
sessionKey: eventParams.sessionKey,
|
|
1459
|
+
terminal: eventParams.terminal
|
|
1460
|
+
}),
|
|
1461
|
+
logGateway: { warn: context.logGateway.warn }
|
|
1462
|
+
}, nodeId, {
|
|
1463
|
+
event: p.event,
|
|
1464
|
+
payloadJSON
|
|
1465
|
+
}, {
|
|
1466
|
+
connId: client?.connId,
|
|
1467
|
+
deviceId: client?.connect?.device?.id
|
|
1468
|
+
}) ?? { ok: true }, void 0);
|
|
1469
|
+
});
|
|
1470
|
+
}
|
|
1471
|
+
};
|
|
1472
|
+
function buildNodeCommandRejectionHint(reason, command, node) {
|
|
1473
|
+
const platform = node?.platform ?? "unknown";
|
|
1474
|
+
if (reason === "command not declared by node") return `node command not allowed: the node (platform: ${platform}) does not support "${command}"`;
|
|
1475
|
+
if (reason === "command not allowlisted") {
|
|
1476
|
+
if (command.startsWith("talk.")) return `node command not allowed: "${command}" requires a trusted Talk-capable node`;
|
|
1477
|
+
return `node command not allowed: "${command}" is not in the allowlist for platform "${platform}"`;
|
|
1478
|
+
}
|
|
1479
|
+
if (reason === "node did not declare commands") return `node command not allowed: the node did not declare any supported commands`;
|
|
1480
|
+
return `node command not allowed: ${reason}`;
|
|
1481
|
+
}
|
|
1482
|
+
//#endregion
|
|
1483
|
+
export { waitForNodeReconnect as i, maybeWakeNodeWithApns as n, nodeHandlers as r, maybeSendNodeWakeNudge as t };
|