fengming 0.3.3 → 0.3.5
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 +3 -3
- package/dist/abort-CjCDVBbH.js +277 -0
- package/dist/abort.runtime-DxJ8129J.js +2 -0
- package/dist/abort.runtime.js +1 -1
- package/dist/accounts-Cyn0sm_v.js +423 -0
- package/dist/accounts-DzcLKcN5.js +2 -0
- package/dist/acp/control-plane/manager.js +1 -1
- package/dist/acp-spawn-4lfz_3K9.js +1286 -0
- package/dist/acp-spawn-BCUjuO6L.js +2 -0
- package/dist/acp-stateful-target-driver-Bv99uwEA.js +89 -0
- package/dist/action-info-CP-p6RHS.js +75 -0
- package/dist/active-runtime-registry-DjKe53a5.js +62 -0
- package/dist/active-tool-schema-warnings-p7CqUnu1.js +105 -0
- package/dist/active-tool-schema-warnings-pGI92yka.js +2 -0
- package/dist/agent-B77yluip.js +1825 -0
- package/dist/agent-BooUvZnR.js +2 -0
- package/dist/agent-bundle-lsp-runtime-3ieSgTgo.js +389 -0
- package/dist/agent-bundle-lsp-runtime-CkJ0XJK7.js +2 -0
- package/dist/agent-bundle-mcp-materialize-BH-esGZL.js +124 -0
- package/dist/agent-bundle-mcp-tools-DkixTTnL.js +3 -0
- package/dist/agent-command-BJKcnQy6.js +1435 -0
- package/dist/agent-delivery-CEfe_Zzt.js +117 -0
- package/dist/agent-harness-runtime-R_Ae6o9C.js +207 -0
- package/dist/agent-kWSaRcQt.js +3 -0
- package/dist/agent-model-discovery-C49swEgd.js +238 -0
- package/dist/agent-model-discovery-DZbixJQs.js +3 -0
- package/dist/agent-runner-utils-BChpi9Ec.js +267 -0
- package/dist/agent-runner.runtime-3LOdt215.js +3784 -0
- package/dist/agent-runner.runtime.js +1 -1
- package/dist/agent-runtime-3jsv8b7Y.js +199 -0
- package/dist/agent-runtime-label-uoFI4ovH.js +30 -0
- package/dist/agent-runtime-metadata-BhFt6kLt.js +53 -0
- package/dist/agent-tool-result-middleware-loader-BxYJNC1i.js +55 -0
- package/dist/agent-tools-COLEG7aL.js +2506 -0
- package/dist/agent-tools.before-tool-call--rMZI5Rd.js +1274 -0
- package/dist/agent-tools.before-tool-call-CbX2sfP4.js +2 -0
- package/dist/agent-via-gateway-DfKij3De.js +486 -0
- package/dist/agent-wait-dedupe-BAUSJotw.js +180 -0
- package/dist/agents/agent-bundle-mcp-materialize.js +1 -1
- package/dist/agents/auth-profiles.runtime.js +1 -1
- package/dist/agents/compaction-planning.worker.js +1 -1
- package/dist/agents/embedded-agent-runner/effective-tool-policy.js +1 -1
- package/dist/agents/embedded-agent-runner/tool-split.js +1 -1
- package/dist/agents/model-catalog.runtime.js +1 -1
- package/dist/agents/model-provider-auth.worker.js +3 -3
- package/dist/agents/models-config.runtime.js +1 -1
- package/dist/agents-CZSNDJWD.js +632 -0
- package/dist/agents.command-shared-DgbjfH23.js +16 -0
- package/dist/agents.commands.add-DknGM1oz.js +304 -0
- package/dist/agents.commands.bind-DDVI0yDe.js +265 -0
- package/dist/agents.commands.delete-Dv4RHEhc.js +128 -0
- package/dist/agents.commands.identity-BSZbc1QR.js +143 -0
- package/dist/agents.commands.list-CA0OTw59.js +235 -0
- package/dist/aliases-EY1GbfwT.js +97 -0
- package/dist/api-CY0oKcRz.js +3 -0
- package/dist/api-DgjY0gIl.js +6 -0
- package/dist/api-VyMyAYze.js +2 -0
- package/dist/api-key-rotation-DxPKIdmC.js +167 -0
- package/dist/app-registration-BBDxCbFo.js +194 -0
- package/dist/apply-DMYy7tc3.js +544 -0
- package/dist/apply-Dd0n97MD.js +2 -0
- package/dist/apply-bHIT1nMp.js +416 -0
- package/dist/apply-g8x7Z83S.js +510 -0
- package/dist/apply-nnbx9TaB.js +2 -0
- package/dist/approval-native-helpers-CjaYvOaZ.js +398 -0
- package/dist/artifacts-B55YR-uA.js +368 -0
- package/dist/assistant-hJaOgfKl.js +291 -0
- package/dist/attachment-normalize-COsastJx.js +213 -0
- package/dist/attempt-execution-fDWDWcWe.js +584 -0
- package/dist/attempt-execution.helpers-Cze5xPim.js +969 -0
- package/dist/attempt-execution.runtime-B1iCG6LN.js +3 -0
- package/dist/attempt-execution.runtime.js +1 -1
- package/dist/attempt.prompt-helpers-CkBYHBBo.js +543 -0
- package/dist/attempt.tool-run-context-DzfRK5pV.js +1240 -0
- package/dist/audio-preflight.runtime-rjWd9uyk.js +7 -0
- package/dist/audio-preflight.runtime.js +1 -1
- package/dist/audit-DgFtNg3U.js +1108 -0
- package/dist/audit-L8EC3WhV.js +477 -0
- package/dist/audit.nondeep.runtime-D0sQ6bO2.js +1416 -0
- package/dist/audit.nondeep.runtime.js +1 -1
- package/dist/audit.runtime-CiG82F31.js +7 -0
- package/dist/audit.runtime.js +1 -1
- package/dist/auth-CzPdsZVM.js +567 -0
- package/dist/auth-choice-BNzS9QBI.js +3 -0
- package/dist/auth-choice-Cwr5kgcD.js +110 -0
- package/dist/auth-choice-DW9qPpMS.js +400 -0
- package/dist/auth-choice.apply.api-providers-C68tOdqj.js +34 -0
- package/dist/auth-choice.apply.api-providers-DSRK0gYo.js +2 -0
- package/dist/auth-choice.plugin-providers.runtime-BJ9VyO1C.js +11 -0
- package/dist/auth-choice.plugin-providers.runtime.js +1 -1
- package/dist/auth-health-BanKwsTW.js +219 -0
- package/dist/auth-list-Dq8obVno.js +115 -0
- package/dist/auth-order-VXqoAroP.js +105 -0
- package/dist/auth-profiles-6VFEdgC-.js +73 -0
- package/dist/auth-profiles-a0M4JYYg.js +14 -0
- package/dist/backend-config-COaTdVnN.js +259 -0
- package/dist/bash-tools-BMAquSiM.js +3 -0
- package/dist/bash-tools-DLiUXfaS.js +3497 -0
- package/dist/binding-routing-Bwvdx_7S.js +113 -0
- package/dist/binding-targets-Z_d0mK_1.js +121 -0
- package/dist/bootstrap-files-CoCV_zqu.js +202 -0
- package/dist/bootstrap-files-_T3VoTrV.js +3 -0
- package/dist/bridge-server-BIaNurGa.js +113 -0
- package/dist/browser-cli-D4wL8NU9.js +230 -0
- package/dist/browser-cli-actions-input-z40PGiYI.js +522 -0
- package/dist/browser-cli-actions-observe-C4TeyNke.js +81 -0
- package/dist/browser-cli-debug-Dv0gH-c8.js +137 -0
- package/dist/browser-cli-inspect-BUXeITYc.js +117 -0
- package/dist/browser-cli-manage-qMb3Yw5Y.js +446 -0
- package/dist/browser-cli-resize-CZWnGwGz.js +32 -0
- package/dist/browser-cli-shared-BpinhvE3.js +69 -0
- package/dist/browser-cli-state-CBbKqqgP.js +371 -0
- package/dist/browser-cli-uI5GGX51.js +2 -0
- package/dist/browser-control-auth-CFPJXdN_.js +2 -0
- package/dist/browser-profiles-D4ni3t4J.js +2 -0
- package/dist/browser-runtime-Dm5D_PLf.js +389 -0
- package/dist/browser-tool.schema-Bek02ox5.js +132 -0
- package/dist/btw-command-DdrwvCK4.js +18 -0
- package/dist/build-DkEeJ9sO.js +261 -0
- package/dist/build-info.json +2 -2
- package/dist/bundled/boot-md/handler.js +2 -2
- package/dist/bundled/session-memory/handler.js +1 -1
- package/dist/bundled-channel-config-schema-BeowdkHi.d.ts +3168 -0
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/capability-cli-DTRuKZJC.js +1809 -0
- package/dist/capability-provider-runtime-Cpp-Jq9g.js +346 -0
- package/dist/cdp.helpers-GfQkB-B5.js +637 -0
- package/dist/channel-BRehZ4Cg.js +2309 -0
- package/dist/channel-actions-hdQKe_se.js +46 -0
- package/dist/channel-bootstrap.runtime-BzjlNG_j.js +38 -0
- package/dist/channel-bootstrap.runtime-CmNNVl40.js +2 -0
- package/dist/channel-bootstrap.runtime.js +1 -1
- package/dist/channel-core-BLcWqSk-.js +5 -0
- package/dist/channel-inbound-pR1B7HTU.js +121 -0
- package/dist/channel-message-W0VurpjH.js +12 -0
- package/dist/channel-outbound-DO4HI6E_.js +436 -0
- package/dist/channel-plugin-resolution-CLA7S5_A.js +2 -0
- package/dist/channel-plugin-resolution-DzwVj01h.js +135 -0
- package/dist/channel-resolution-DOPyiG4k.js +46 -0
- package/dist/channel-selection-kwoWZDQ3.js +171 -0
- package/dist/channel-selection.runtime-LiDliif9.js +2 -0
- package/dist/channel-selection.runtime.js +1 -1
- package/dist/channel.runtime-DDt3PayH.js +697 -0
- package/dist/channel.runtime.js +1 -1
- package/dist/channels-CKJd4eUz.js +1004 -0
- package/dist/channels-cli-DLAPi8pX.js +331 -0
- package/dist/chat-6WsYrS9m.js +3 -0
- package/dist/chat-DpsCEXAx.js +2940 -0
- package/dist/chrome-BWHc9vYG.js +1517 -0
- package/dist/chrome-mcp-BGKgR8A_.js +2 -0
- package/dist/chrome-mcp-Bg5D5PDc.js +864 -0
- package/dist/claude-live-session-BLCZnv-A.js +2 -0
- package/dist/claude-live-session-CGnB64D6.js +1338 -0
- package/dist/clawbot-cli-ynXzgp8B.js +9 -0
- package/dist/cli/daemon-cli.js +3 -3
- package/dist/cli/gateway-lifecycle.runtime.js +4 -4
- package/dist/cli/run-main.js +12 -12
- package/dist/cli-B4Ttnj0P.js +2 -0
- package/dist/cli-BjVgdamH.js +2 -0
- package/dist/cli-CNqBrHLU.js +293 -0
- package/dist/cli-backends.runtime-DoxtCrow.js +7 -0
- package/dist/cli-backends.runtime.js +1 -1
- package/dist/cli-compaction-BCuLbs75.js +363 -0
- package/dist/cli-mthNIkji.js +141 -0
- package/dist/cli-registry-loader-B2sNTdgY.js +2 -0
- package/dist/cli-registry-loader-Dz9YFrjw.js +193 -0
- package/dist/cli-runner-C9t-9-Io.js +597 -0
- package/dist/cli-runner-D21qMGk7.js +2 -0
- package/dist/cli-runner.runtime-BNqbJFgu.js +3 -0
- package/dist/cli-runner.runtime-Dv50IEvH.js +4 -0
- package/dist/cli-runner.runtime.js +1 -1
- package/dist/cli-session-jBtClYfT.js +119 -0
- package/dist/cli-startup-metadata.json +9 -9
- package/dist/cli.runtime-CGBzSGAG.js +1276 -0
- package/dist/cli.runtime.js +1 -1
- package/dist/codex-native-web-search-B3C-srtm.js +20 -0
- package/dist/codex-native-web-search-B7xh2Xcb.js +4 -0
- package/dist/codex-native-web-search-core-CrwANQg5.js +106 -0
- package/dist/command-auth-Dz_pdczs.js +135 -0
- package/dist/command-config-resolution-XCA63Yv8.js +25 -0
- package/dist/command-config-resolution-xtKMDTG9.js +2 -0
- package/dist/command-config-resolution.runtime-xtKMDTG9.js +2 -0
- package/dist/command-config-resolution.runtime.js +1 -1
- package/dist/command-execution-startup-CasEqEXh.js +90 -0
- package/dist/command-primitives-runtime-DC9gtSI3.js +3 -0
- package/dist/command-registry-BQnMdca9.js +9 -0
- package/dist/command-registry-core-hx2t1jQP.js +114 -0
- package/dist/command-registry-rbKA-L_8.js +4 -0
- package/dist/command-secret-gateway-7oveYQCx.js +589 -0
- package/dist/command-secret-targets-B7M1Us_C.js +2 -0
- package/dist/command-status-builders-DrSoZhiI.js +147 -0
- package/dist/command-status.runtime-By0071-y.js +90 -0
- package/dist/command-status.runtime.js +1 -1
- package/dist/commands/status.summary.runtime.js +3 -3
- package/dist/commands-B1MnUj5-.js +161 -0
- package/dist/commands-compact.runtime-DELj3JaW.js +10 -0
- package/dist/commands-compact.runtime.js +1 -1
- package/dist/commands-core.runtime-Zw0grrkC.js +2 -0
- package/dist/commands-core.runtime.js +1 -1
- package/dist/commands-handlers.runtime-BCl_ZHJZ.js +6327 -0
- package/dist/commands-handlers.runtime.js +1 -1
- package/dist/commands-models-Uurm-0C3.js +448 -0
- package/dist/commands-registry-Bo1AeDcq.js +195 -0
- package/dist/commands-registry.runtime-C9DBHyhh.js +4 -0
- package/dist/commands-registry.runtime.js +1 -1
- package/dist/commands-status-BoAXH-wg.js +16 -0
- package/dist/commands-status-CNALMTN9.js +3 -0
- package/dist/commands-status.runtime-CNALMTN9.js +3 -0
- package/dist/commands-status.runtime.js +1 -1
- package/dist/commands-subagents-control.runtime-Dl4IuTzV.js +2 -0
- package/dist/commands-subagents-control.runtime.js +1 -1
- package/dist/commands-system-prompt-BPzpLmUp.js +2 -0
- package/dist/commands-system-prompt-DCOZSNh5.js +161 -0
- package/dist/commands.runtime-bfCLM0Sg.js +175 -0
- package/dist/commands.runtime.js +1 -1
- package/dist/commitments/runtime.js +1 -1
- package/dist/common-CoOYhmSg.js +286 -0
- package/dist/compact-yqaUOESq.js +1165 -0
- package/dist/compact.runtime-Y91AFZVE.js +12 -0
- package/dist/compact.runtime.js +1 -1
- package/dist/compaction-planning-DVnykwzd.js +202 -0
- package/dist/completion-cli-BJjq_g_B.js +393 -0
- package/dist/config-CsmSEaNn.js +374 -0
- package/dist/config-CtNXZ0iy.js +610 -0
- package/dist/config-cli-CNpIVdqp.js +1703 -0
- package/dist/config-mutation-B-SErGM0.js +5 -0
- package/dist/config-mutations-Bu3ahkX8.js +161 -0
- package/dist/config-utils-Bv0Nisds.js +141 -0
- package/dist/config-validation-DitvTYD8.js +33 -0
- package/dist/configure-CdjbRKTg.js +771 -0
- package/dist/configure-Cvi-5ml4.js +3 -0
- package/dist/configure.commands-BJii4733.js +1253 -0
- package/dist/configure.commands-tJzVFJ0o.js +2 -0
- package/dist/context-D1N9oPds.js +2 -0
- package/dist/context-XMtJ9b3v.js +248 -0
- package/dist/context-engine-host-compat-3QznbSaW.js +280 -0
- package/dist/context-engine-host-compat-DquSpnKD.js +2 -0
- package/dist/context-engine-lifecycle-Bqdhy9JU.js +627 -0
- package/dist/control-auth-CMW_9jmY.js +114 -0
- package/dist/control-service-D-r3k91q.js +40 -0
- package/dist/control-service-uIPYrp9F.js +3 -0
- package/dist/control-ui/assets/activity-DgMhyllD.js +124 -0
- package/dist/control-ui/assets/agents-CsRhxO2O.js +1030 -0
- package/dist/control-ui/assets/channels-Dq8bzpMg.js +120 -0
- package/dist/control-ui/assets/cron-Dk5bqYwg.js +1016 -0
- package/dist/control-ui/assets/debug-CNIwFEQO.js +97 -0
- package/dist/control-ui/assets/index-CV2NsPlu.js +7214 -0
- package/dist/control-ui/assets/instances-DLr0iEvT.js +57 -0
- package/dist/control-ui/assets/nodes-D3JEksjl.js +444 -0
- package/dist/control-ui/assets/sessions-nbXWGlHZ.js +425 -0
- package/dist/control-ui/assets/skills-tBOi8OBq.js +362 -0
- package/dist/control-ui/assets/workboard-ClTo7wmK.js +402 -0
- package/dist/control-ui/index.html +1 -1
- package/dist/control-ui/sw.js +1 -1
- package/dist/control-ui-AkRMsk9S.js +750 -0
- package/dist/conversation-label-generator-DHtcgSBn.js +72 -0
- package/dist/conversation-runtime-BEgHW4ta.js +31 -0
- package/dist/core-Bslrvfnp.js +284 -0
- package/dist/core-api-BOlUb7G8.js +5 -0
- package/dist/core-api-CiBoGa2I.js +2 -0
- package/dist/crestodian/crestodian.js +1 -1
- package/dist/crestodian/rescue-message.js +1 -1
- package/dist/crestodian-mXnyuHx9.js +55 -0
- package/dist/cron-PbdpyFrD.js +453 -0
- package/dist/daemon-install-C-d4dFvn.js +66 -0
- package/dist/daemon-install-auth-profiles-store.runtime-CvE2EVVo.js +2 -0
- package/dist/daemon-install-auth-profiles-store.runtime.js +1 -1
- package/dist/dashboard-Ey5dnvMI.js +263 -0
- package/dist/defaults-CsRAv-qE.js +130 -0
- package/dist/defaults-DHZBSNHC.js +3 -0
- package/dist/defaults.constants-CR4S_tvw.js +76 -0
- package/dist/deliver-BkuuFBlm.js +1399 -0
- package/dist/deliver-P4upyes7.js +3 -0
- package/dist/deliver-runtime-CjnLI_nC.js +2 -0
- package/dist/delivery-outbound.runtime-fcJ-M8qj.js +7 -0
- package/dist/delivery-outbound.runtime.js +1 -1
- package/dist/delivery-queue-BqgHvNlY.js +863 -0
- package/dist/delivery-queue-CfsRscJb.js +2 -0
- package/dist/delivery-queue-runtime-D0PKG1Bv.js +16 -0
- package/dist/delivery-target.runtime-C5e8d0WH.js +45 -0
- package/dist/delivery-target.runtime.js +1 -1
- package/dist/delivery.runtime-2Ut8xM3P.js +470 -0
- package/dist/delivery.runtime.js +1 -1
- package/dist/detached-task-runtime-OOZBqRy-.js +86 -0
- package/dist/diagnostics-zf6WQ2h7.js +168 -0
- package/dist/dialogue-C8IOya-l.js +37 -0
- package/dist/direct-dm-wPF-KfNb.js +81 -0
- package/dist/directive-handling.defaults-C-1lmFYo.js +22 -0
- package/dist/directive-handling.fast-lane-DENPMtYI.js +70 -0
- package/dist/directive-handling.impl-C1p5t3qA.js +2 -0
- package/dist/directive-handling.impl-DOo2Sa7C.js +823 -0
- package/dist/directive-handling.model-selection-6gC-fr_g.js +122 -0
- package/dist/directive-handling.persist.runtime-CuhUd2kW.js +274 -0
- package/dist/directive-handling.persist.runtime.js +1 -1
- package/dist/directives-BIKSyN8C.js +319 -0
- package/dist/directory-cli-DZ0PU0Rv.js +239 -0
- package/dist/dispatch-DQLImAqt.js +2057 -0
- package/dist/dispatch-acp-DzyX7wsq.js +1102 -0
- package/dist/dispatch-acp-manager.runtime-CoAfs4O1.js +3 -0
- package/dist/dispatch-acp-manager.runtime.js +1 -1
- package/dist/dispatch-acp-media.runtime-7uUP_jr9.js +4 -0
- package/dist/dispatch-acp-media.runtime.js +1 -1
- package/dist/dispatch-acp-transcript.runtime-BUlmV_h0.js +40 -0
- package/dist/dispatch-acp-transcript.runtime.js +1 -1
- package/dist/dispatch-acp-tts.runtime-ChBnVkNt.js +3 -0
- package/dist/dispatch-acp-tts.runtime.js +1 -1
- package/dist/dispatch-acp.runtime-DAexFaBu.js +18 -0
- package/dist/dispatch-acp.runtime.js +1 -1
- package/dist/dispatcher-D3IQEbf9.js +106 -0
- package/dist/doctor-BSqEqfb6.js +760 -0
- package/dist/doctor-auth-flat-profiles-BIZ4wsYP.js +2 -0
- package/dist/doctor-auth-flat-profiles-DXtD5LfC.js +516 -0
- package/dist/doctor-auth-legacy-oauth-DwFbRYTP.js +48 -0
- package/dist/doctor-auth-oauth-sidecar-6I3FEJbi.js +2 -0
- package/dist/doctor-auth-oauth-sidecar-BSC3rnDM.js +177 -0
- package/dist/doctor-auth-tVGsUiM6.js +216 -0
- package/dist/doctor-bootstrap-size-B0q6bdkO.js +57 -0
- package/dist/doctor-claude-cli-Bn79OuBT.js +150 -0
- package/dist/doctor-config-flow-CCwocXpV.js +1819 -0
- package/dist/doctor-core-checks-D7-1l8jy.js +666 -0
- package/dist/doctor-core-checks-eM8FNi8B.js +2 -0
- package/dist/doctor-core-checks.runtime-Dc03aeoU.js +278 -0
- package/dist/doctor-core-checks.runtime.js +1 -1
- package/dist/doctor-gRYfpEbB.js +6 -0
- package/dist/doctor-gateway-daemon-flow-KTnHAdeV.js +349 -0
- package/dist/doctor-gateway-services-BByDQtjY.js +465 -0
- package/dist/doctor-health-CnoM718z.js +65 -0
- package/dist/doctor-health-contributions-flVKMQwr.js +874 -0
- package/dist/doctor-lint-BBm6gtBa.js +95 -0
- package/dist/doctor-memory-search-DjHVDCGo.js +407 -0
- package/dist/doctor-state-integrity-Bgw25cz1.js +1257 -0
- package/dist/doctor-tool-result-cap-advice-B8wTpiTO.js +27 -0
- package/dist/doctor-workspace-status-DcjeJIpT.js +76 -0
- package/dist/dreaming-BE4t8DVf.js +523 -0
- package/dist/dreaming-command-DWm1lB-Z.js +101 -0
- package/dist/dreaming-narrative-8DM-OMrm.js +721 -0
- package/dist/dreaming-narrative-CcFfheQI.js +2 -0
- package/dist/dreaming-phases-CqOhhTdZ.js +2 -0
- package/dist/dreaming-phases-D9eT6Kk0.js +1162 -0
- package/dist/drive-D2M5B7-2.js +899 -0
- package/dist/echo-transcript-B-wl5MoX.js +52 -0
- package/dist/effective-tool-policy-Cx8mC5aA.js +89 -0
- package/dist/embedded-agent-BTvtoOe_.js +4 -0
- package/dist/embedded-agent-CGmSKuNM.js +4074 -0
- package/dist/embedded-agent-helpers-CboIPx57.js +6 -0
- package/dist/embedded-agent-helpers-cw0InMDZ.js +1037 -0
- package/dist/embedded-agent.runtime-Bfe4bjyF.js +4 -0
- package/dist/embedded-agent.runtime.js +1 -1
- package/dist/embedded-backend-D-EshN85.js +744 -0
- package/dist/embedded-gateway-stub.runtime-Cx9qs0KV.js +12 -0
- package/dist/embedded-gateway-stub.runtime.js +1 -1
- package/dist/embedding-provider-runtime-DaXfsUPo.js +86 -0
- package/dist/embedding-providers-CdU99clu.js +2 -0
- package/dist/embeddings-http-BQnlTr-1.js +222 -0
- package/dist/engine-qmd-5jbjGywA.js +708 -0
- package/dist/engine-storage-CfAgwoDp.js +203 -0
- package/dist/entry.js +1 -1
- package/dist/errors-C0AUxo3P.js +2 -0
- package/dist/exec-approval-forwarder.runtime-BvR47p5Z.js +4 -0
- package/dist/exec-approval-forwarder.runtime.js +1 -1
- package/dist/exec-approval-session-target-CCqYgaVa.js +177 -0
- package/dist/exec-auto-reviewer-BfJaNkNy.js +2 -0
- package/dist/exec-auto-reviewer-Dqx7I88Z.js +241 -0
- package/dist/execute.runtime-Qb6Z75sG.js +579 -0
- package/dist/execute.runtime.js +1 -1
- package/dist/extensionAPI.js +2 -2
- package/dist/extensions/active-memory/index.js +3 -3
- package/dist/extensions/admin-http-rpc/index.js +1 -1
- package/dist/extensions/alibaba/index.js +1 -1
- package/dist/extensions/alibaba/video-generation-provider.js +1 -1
- package/dist/extensions/baichuan/index.js +1 -1
- package/dist/extensions/browser/browser-bridge.js +1 -1
- package/dist/extensions/browser/browser-cdp.js +1 -1
- package/dist/extensions/browser/browser-config.js +5 -5
- package/dist/extensions/browser/browser-control-auth.js +2 -2
- package/dist/extensions/browser/browser-doctor.js +3 -3
- package/dist/extensions/browser/browser-maintenance.js +1 -1
- package/dist/extensions/browser/browser-profiles.js +3 -3
- package/dist/extensions/browser/browser-runtime-api.js +14 -14
- package/dist/extensions/browser/cli-metadata.js +1 -1
- package/dist/extensions/browser/index.js +1 -1
- package/dist/extensions/browser/plugin-registration.js +1 -1
- package/dist/extensions/browser/register.runtime.js +4 -4
- package/dist/extensions/browser/runtime-api.js +16 -16
- package/dist/extensions/byteplus/index.js +3 -3
- package/dist/extensions/byteplus/video-generation-provider.js +1 -1
- package/dist/extensions/canvas/index.js +3 -3
- package/dist/extensions/canvas/runtime-api.js +2 -2
- package/dist/extensions/deepseek/index.js +1 -1
- package/dist/extensions/device-pair/api.js +2 -2
- package/dist/extensions/device-pair/pair-command-approve.js +1 -1
- package/dist/extensions/device-pair/qr-image.js +2 -2
- package/dist/extensions/longcat/index.js +1 -1
- package/dist/extensions/memory-core/api.js +3 -3
- package/dist/extensions/memory-core/cli-metadata.js +1 -1
- package/dist/extensions/memory-core/cli.js +2 -2
- package/dist/extensions/memory-core/index.js +11 -11
- package/dist/extensions/memory-core/manager-runtime.js +1 -1
- package/dist/extensions/memory-core/runtime-api.js +6 -6
- package/dist/extensions/minimax/image-generation-provider.js +1 -1
- package/dist/extensions/minimax/index.js +7 -7
- package/dist/extensions/minimax/media-understanding-provider.js +1 -1
- package/dist/extensions/minimax/music-generation-provider.js +1 -1
- package/dist/extensions/minimax/oauth.js +1 -1
- package/dist/extensions/minimax/oauth.runtime.js +1 -1
- package/dist/extensions/minimax/provider-registration.js +1 -1
- package/dist/extensions/minimax/speech-provider.js +1 -1
- package/dist/extensions/minimax/video-generation-provider.js +1 -1
- package/dist/extensions/minimax/web-search-provider.js +1 -1
- package/dist/extensions/moonshot/index.js +5 -5
- package/dist/extensions/moonshot/media-understanding-provider.js +1 -1
- package/dist/extensions/moonshot/web-search-provider.js +1 -1
- package/dist/extensions/qianfan/index.js +1 -1
- package/dist/extensions/qwen/index.js +5 -5
- package/dist/extensions/qwen/media-understanding-provider.js +1 -1
- package/dist/extensions/qwen/video-generation-provider.js +1 -1
- package/dist/extensions/sensenova/index.js +1 -1
- package/dist/extensions/skill-workshop/api.js +2 -2
- package/dist/extensions/skill-workshop/index.js +4 -4
- package/dist/extensions/stepfun/index.js +2 -2
- package/dist/extensions/tavily/index.js +1 -1
- package/dist/extensions/tavily/web-search-provider.js +1 -1
- package/dist/extensions/tencent/index.js +2 -2
- package/dist/extensions/tiangong/index.js +1 -1
- package/dist/extensions/volcengine/index.js +3 -3
- package/dist/extensions/volcengine/speech-provider.js +1 -1
- package/dist/extensions/webhooks/api.js +1 -1
- package/dist/extensions/webhooks/index.js +1 -1
- package/dist/extensions/weixin/index.js +7 -7
- package/dist/extensions/workboard/index.js +2 -2
- package/dist/extensions/xiaomi/index.js +4 -4
- package/dist/extensions/xiaomi/speech-provider.js +1 -1
- package/dist/extensions/xingchen/index.js +1 -1
- package/dist/extensions/yi/index.js +1 -1
- package/dist/extensions/zai/index.js +4 -4
- package/dist/extensions/zai/media-understanding-provider.js +1 -1
- package/dist/extensions/zhinao/index.js +1 -1
- package/dist/external-cli-auth-selection-CM_aOUJw.js +113 -0
- package/dist/extra-params-Bm1eLWN9.js +615 -0
- package/dist/fallback-notice-state-v1kyWACv.js +15 -0
- package/dist/fallbacks-CDllk2g1.js +31 -0
- package/dist/fallbacks-shared-DdMKEmAC.js +116 -0
- package/dist/fengming-runtime-DSv30J04.js +33 -0
- package/dist/fengming-runtime-config-BE-DquuY.js +2 -0
- package/dist/fengming-runtime-memory-BE-DquuY.js +2 -0
- package/dist/fengming-runtime-session-BE-DquuY.js +2 -0
- package/dist/fengming-tools-DHb-ZeDC.js +12221 -0
- package/dist/flows-Cz3y10A9.js +189 -0
- package/dist/fs-utils-D05rps7O.js +9 -0
- package/dist/gateway-DTi2D7ZS.js +133 -0
- package/dist/gateway-cli-DT2fL2fX.js +443 -0
- package/dist/gateway-install-token-CJhAycOA.js +136 -0
- package/dist/gateway-method-runtime-BuiYTDQk.js +21 -0
- package/dist/gateway-runtime-C5_cVlSW.js +23 -0
- package/dist/get-reply-Cz-dUrWm.js +5198 -0
- package/dist/get-reply-from-config.runtime-BC1HT67i.js +2 -0
- package/dist/get-reply-from-config.runtime.js +1 -1
- package/dist/github-copilot-token-09lxV3kH.js +2 -0
- package/dist/health-CmihbcqN.js +621 -0
- package/dist/health-D8L37hBZ.js +111 -0
- package/dist/health-DU7I9RrJ.js +3 -0
- package/dist/health-state-QZ2E6xGQ.js +106 -0
- package/dist/heartbeat-runner-Bz5PMzEI.js +1930 -0
- package/dist/heartbeat-runner-DfqqQ_8w.js +5 -0
- package/dist/heartbeat-runner.runtime-8BshUhoS.js +3 -0
- package/dist/heartbeat-runner.runtime.js +1 -1
- package/dist/helpers-Bkq4POdX.js +406 -0
- package/dist/hook-helpers-nmDwt3Fa.js +44 -0
- package/dist/hooks-9FOcRqfu.js +536 -0
- package/dist/hooks-cli-CrQelcwo.js +465 -0
- package/dist/http-endpoint-helpers-BD5u6YsT.js +37 -0
- package/dist/http-utils-RcKuBJ0I.js +98 -0
- package/dist/image-DwNoypK2.js +385 -0
- package/dist/image-fallbacks-BUyDnmUX.js +31 -0
- package/dist/image-generation-core.auth.runtime-CA8miEMh.js +2 -0
- package/dist/image-generation-core.auth.runtime.js +1 -1
- package/dist/image-generation-provider-DXMW5EmB.js +152 -0
- package/dist/image-runtime-D5QpNNzz.js +9 -0
- package/dist/image-tool.helpers-6vGxo1Y0.js +150 -0
- package/dist/images-BGWLzQEJ.js +416 -0
- package/dist/images-Db4UB3JG.js +2 -0
- package/dist/inbound-reply-dispatch-DRF6ZmQg.js +2 -0
- package/dist/inbound-reply-dispatch-RAKLqow4.js +147 -0
- package/dist/index.js +1 -1
- package/dist/infra-runtime-BFrpRc_V.js +32 -0
- package/dist/init-sR7bCS9D.js +59 -0
- package/dist/install-BzdJbOUx.js +262 -0
- package/dist/install.runtime-Zye6pbZ6.js +2 -0
- package/dist/internal-DL_vFx8C.js +399 -0
- package/dist/isolated-agent-Qif8Llbt.js +2 -0
- package/dist/isolated-agent-aqEjxqs-.js +1097 -0
- package/dist/kernel-B-i4c2IK.js +979 -0
- package/dist/kernel-DYDJ_hLb.js +3 -0
- package/dist/kimi-web-search-provider.runtime-95HAkvHY.js +307 -0
- package/dist/kimi-web-search-provider.runtime.js +1 -1
- package/dist/library-CZVbE5hF.js +45 -0
- package/dist/lifecycle-C8M3YLbT.js +2 -0
- package/dist/lifecycle-CPDNQnUN.js +570 -0
- package/dist/lifecycle-DpuP7n3J.js +355 -0
- package/dist/lifecycle.runtime-C8M3YLbT.js +2 -0
- package/dist/lifecycle.runtime.js +1 -1
- package/dist/link-understanding/apply.runtime.js +3 -3
- package/dist/list-B_ALwpPl.js +2 -0
- package/dist/list-Bda_GYFy.js +207 -0
- package/dist/list.list-command-W9OGfAIU.js +429 -0
- package/dist/list.model-row-LV4AaX0H.js +39 -0
- package/dist/list.probe-CrZm6BH2.js +451 -0
- package/dist/list.probe-Dfdmb8bC.js +2 -0
- package/dist/list.provider-catalog-7T1jKk0n.js +211 -0
- package/dist/list.provider-catalog-DjGyZVEj.js +2 -0
- package/dist/list.registry-load-DkCS8JZQ.js +152 -0
- package/dist/list.row-sources-B1vjo_Y9.js +474 -0
- package/dist/list.source-plan-C9Sa6zRK.js +81 -0
- package/dist/list.status-command-9daSZZDm.js +815 -0
- package/dist/live-model-switch-Dy-UFUMS.js +119 -0
- package/dist/llm-slug-generator-DEmh5-_1.js +78 -0
- package/dist/llm-slug-generator.js +1 -1
- package/dist/load-config-CvQpC8k6.js +27 -0
- package/dist/load-context-_qSHpZ5S.js +82 -0
- package/dist/loader-CntMt07B.js +7008 -0
- package/dist/local-dispatch.runtime-BSN_gqNS.js +10 -0
- package/dist/local-dispatch.runtime.js +1 -1
- package/dist/main-session-restart-recovery-Db7366lt.js +2 -0
- package/dist/main-session-restart-recovery-n87NTooQ.js +389 -0
- package/dist/managed-image-attachments-BTBBHlKl.js +2 -0
- package/dist/managed-image-attachments-C6_V1yX0.js +616 -0
- package/dist/manager-CKrWxjV6.js +3737 -0
- package/dist/manager-Dvb1FVnx.js +2314 -0
- package/dist/mcp/plugin-tools-serve.js +2 -2
- package/dist/mcp-http-CSoGXOa_.js +583 -0
- package/dist/mcp-http-D4ieDB3W.js +2 -0
- package/dist/media-runtime-GeQTQkkK.js +391 -0
- package/dist/media-services-CWbIUZDe.js +416 -0
- package/dist/media-understanding/apply.runtime.js +1 -1
- package/dist/media-understanding-DXc2BD2L.js +87 -0
- package/dist/media-understanding-provider-BkdUiVWU.js +70 -0
- package/dist/media-understanding-provider-BlgmLViW.js +13 -0
- package/dist/media-understanding-provider-C9P2VjkC.js +29 -0
- package/dist/media-understanding-provider-CJlbgAvl.js +69 -0
- package/dist/memory-CnC2jM1l.js +437 -0
- package/dist/memory-core-host-engine-embeddings-Dy9vN-Ce.js +667 -0
- package/dist/memory-core-host-engine-foundation-C-pGGQnm.js +15 -0
- package/dist/memory-core-host-engine-qmd-DLJDON9w.js +2 -0
- package/dist/memory-core-host-engine-storage-Bzf-C8XE.js +2 -0
- package/dist/memory-core-host-runtime-cli-_LWA6G3x.js +10 -0
- package/dist/memory-core-host-runtime-core-CromkNBr.js +12 -0
- package/dist/memory-core-host-runtime-files-DpbviC1b.js +4 -0
- package/dist/memory-embedding-provider-runtime-CaVVaYC5.js +36 -0
- package/dist/memory-host-core-B5dWHwBF.js +78 -0
- package/dist/memory-host-search.runtime-DqlCFac1.js +2 -0
- package/dist/memory-host-search.runtime.js +1 -1
- package/dist/memory-runtime-BCeeWb1G.js +2 -0
- package/dist/memory-runtime-pR9KGin0.js +57 -0
- package/dist/memory-search-CpDEEY2Q.js +235 -0
- package/dist/message-BeGCG-D8.js +284 -0
- package/dist/message-YGMOyqP5.js +2 -0
- package/dist/message-action-runner-ByMT3_eb.js +1922 -0
- package/dist/message-action-runner-VXmKO_W7.js +2 -0
- package/dist/message-handler-MZ0DMbCx.js +1806 -0
- package/dist/metadata-registry-loader-BH9D1UOx.js +2 -0
- package/dist/metadata-registry-loader-BK1cHCas.js +22 -0
- package/dist/migrate-BA6w0hd3.js +2 -0
- package/dist/migrate-BGuQC-1W.js +458 -0
- package/dist/migration-provider-runtime-BBdDegWG.js +2 -0
- package/dist/migration-provider-runtime-C5WUjrQz.js +68 -0
- package/dist/minimax-web-search-provider.runtime-suVFk3Zx.js +148 -0
- package/dist/minimax-web-search-provider.runtime.js +1 -1
- package/dist/model-BJZXR9dq.js +1302 -0
- package/dist/model-BL7xlN5h.js +2 -0
- package/dist/model-auth-C-6dYVob.js +6 -0
- package/dist/model-auth-DJz7R41W.js +705 -0
- package/dist/model-auth-label-DKNXktIu.js +67 -0
- package/dist/model-catalog-BjiK5rtT.js +3 -0
- package/dist/model-catalog-DM1CTjkW.js +434 -0
- package/dist/model-catalog-visibility-DEJZG0In.js +76 -0
- package/dist/model-config.helpers-BKcUeE_P.js +95 -0
- package/dist/model-context-tokens-5y_PQELY.js +572 -0
- package/dist/model-fallback-BDdBR053.js +1288 -0
- package/dist/model-fallback-auth.runtime-pcWfkIUF.js +5 -0
- package/dist/model-fallback-auth.runtime.js +1 -1
- package/dist/model-picker-Bpvp4_N4.js +1135 -0
- package/dist/model-picker-DWPPtq6d.js +3 -0
- package/dist/model-picker-visibility-BtdqVF80.js +22 -0
- package/dist/model-picker.runtime-CYlqts2z.js +48 -0
- package/dist/model-picker.runtime.js +1 -1
- package/dist/model-pricing-cache-BmmncDqL.js +856 -0
- package/dist/model-pricing-cache-CEwRyWw2.js +3 -0
- package/dist/model-pricing-cache-state-B8Aspp85.js +83 -0
- package/dist/model-provider-auth-B3KXoKkE.js +2 -0
- package/dist/model-provider-auth-Bo_8T7of.js +375 -0
- package/dist/model-runtime-aliases-Br-ZlhrL.js +133 -0
- package/dist/model-selection-D5-ERakL.js +254 -0
- package/dist/model-selection-DrzgktRu.js +7 -0
- package/dist/model-selection-ibwsPgIw.js +352 -0
- package/dist/model-selection.runtime-BRkOZejt.js +7 -0
- package/dist/model-selection.runtime.js +1 -1
- package/dist/models-RPAH3ZBn.js +57 -0
- package/dist/models-auth-status-Cwu9OXU8.js +280 -0
- package/dist/models-cli-CrYkSUoa.js +257 -0
- package/dist/models-config-Ayzj9gDz.js +1189 -0
- package/dist/models-config-BFcjB7nN.js +2 -0
- package/dist/models-config.providers.secrets-CCRUW7gL.js +2 -0
- package/dist/models-config.providers.secrets-DdX_XSRo.js +382 -0
- package/dist/models-http-jLFnelH7.js +88 -0
- package/dist/monitor-CqWICrjO.js +60 -0
- package/dist/monitor-DwccYPfp.js +1024 -0
- package/dist/monitor.account-e9EVttpP.js +5382 -0
- package/dist/music-generation-provider-Dfc--R-x.js +308 -0
- package/dist/native-hook-relay-Cioqiqv8.js +1378 -0
- package/dist/native-hook-relay-DRwJIspI.js +19 -0
- package/dist/node-cli-CrG3LH9J.js +2806 -0
- package/dist/node-command-policy-CkBTEmhl.js +295 -0
- package/dist/nodes-BxrWFA09.js +1483 -0
- package/dist/nodes-DFPTGZjc.js +3 -0
- package/dist/nodes-cli-Czwyt6r1.js +960 -0
- package/dist/nodes-pending-B_4QHyB2.js +211 -0
- package/dist/nodes-utils-c4k31OaG.js +85 -0
- package/dist/oauth-BXncC0JP.js +852 -0
- package/dist/oauth-Ba1O2vqP.js +207 -0
- package/dist/oauth-CGQkfxbJ.js +746 -0
- package/dist/onboard-I5tQlVm6.js +768 -0
- package/dist/onboard-channels-BleKfB1D.js +2 -0
- package/dist/onboard-channels-jVaUjGYX.js +1534 -0
- package/dist/onboard-custom-BR_5oqUr.js +3 -0
- package/dist/onboard-custom-Ss0DThuP.js +280 -0
- package/dist/onboard-custom-config-B-knjQm7.js +422 -0
- package/dist/onboard-search-BsIztGYF.js +412 -0
- package/dist/openai-compat-errors-UkLkk8Q9.js +136 -0
- package/dist/openai-http-mTQB44gu.js +836 -0
- package/dist/openai-transport-stream-CZSs3SIi.js +3427 -0
- package/dist/openresponses-http-BA1Shmj-.js +1175 -0
- package/dist/operations-DhgPih1F.js +805 -0
- package/dist/order-CaXafMPG.js +218 -0
- package/dist/outbound-attachment-BAp7DXDc.js +19 -0
- package/dist/param-readers-De-m2SoB.js +2 -0
- package/dist/payloads-Dg9aAEOC.js +256 -0
- package/dist/persistent-bindings.lifecycle-BkLOz501.js +2 -0
- package/dist/persistent-bindings.lifecycle-e2MLbBCo.js +85 -0
- package/dist/plugin-enabled-CGSENjXc.js +232 -0
- package/dist/plugin-install-BI9_bsVT.js +118 -0
- package/dist/plugin-install-an4V2iXO.js +2 -0
- package/dist/plugin-install-config-policy-C66Nss3D.js +169 -0
- package/dist/plugin-registration-DMerQktl.js +97 -0
- package/dist/plugin-registry-BZfdCw65.js +3 -0
- package/dist/plugin-registry-I1fegSdK.js +2 -0
- package/dist/plugin-runtime-B3XMLJka.js +102 -0
- package/dist/plugin-sdk/.boundary-entry-shims.stamp +1 -1
- package/dist/plugin-sdk/acp-binding-runtime.js +1 -1
- package/dist/plugin-sdk/acp-runtime-backend.js +1 -1
- package/dist/plugin-sdk/acp-runtime.js +2 -2
- package/dist/plugin-sdk/agent-config-primitives.d.ts +1 -1
- package/dist/plugin-sdk/agent-harness-runtime.js +16 -16
- package/dist/plugin-sdk/agent-harness-task-runtime.js +4 -4
- package/dist/plugin-sdk/agent-harness.js +17 -17
- package/dist/plugin-sdk/agent-runtime.js +17 -17
- package/dist/plugin-sdk/agent-sessions.js +1 -1
- package/dist/plugin-sdk/approval-native-runtime.js +2 -2
- package/dist/plugin-sdk/approval-reaction-runtime.js +1 -1
- package/dist/plugin-sdk/approval-runtime.js +2 -2
- package/dist/plugin-sdk/bundled-channel-config-schema-BsOWCrJT.d.ts +3169 -0
- package/dist/plugin-sdk/bundled-channel-config-schema.d.ts +3 -3
- package/dist/plugin-sdk/channel-actions.js +2 -2
- package/dist/plugin-sdk/channel-config-primitives.d.ts +2 -2
- package/dist/plugin-sdk/channel-config-schema-legacy.d.ts +3 -3
- package/dist/plugin-sdk/channel-config-schema.d.ts +2 -2
- package/dist/plugin-sdk/channel-core.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 +4 -4
- package/dist/plugin-sdk/channel-location.js +1 -1
- package/dist/plugin-sdk/channel-message-runtime.js +5 -5
- package/dist/plugin-sdk/channel-message.js +5 -5
- package/dist/plugin-sdk/channel-outbound.js +2 -2
- package/dist/plugin-sdk/channel-plugin-common.d.ts +1 -1
- package/dist/plugin-sdk/channel-reply-options-runtime.js +1 -1
- package/dist/plugin-sdk/command-auth-native.js +2 -2
- package/dist/plugin-sdk/command-auth.js +4 -4
- package/dist/plugin-sdk/command-primitives-runtime.js +2 -2
- package/dist/plugin-sdk/command-status-runtime.js +1 -1
- package/dist/plugin-sdk/command-status.js +1 -1
- package/dist/plugin-sdk/compat.d.ts +2 -2
- package/dist/plugin-sdk/compat.js +2 -2
- package/dist/plugin-sdk/config-mutation.js +2 -2
- package/dist/plugin-sdk/config-runtime.js +1 -1
- package/dist/plugin-sdk/config-schema-DUddICQM.d.ts +33 -0
- package/dist/plugin-sdk/conversation-binding-runtime.js +1 -1
- package/dist/plugin-sdk/conversation-runtime.js +3 -3
- package/dist/plugin-sdk/core.d.ts +1 -1
- package/dist/plugin-sdk/core.js +3 -3
- package/dist/plugin-sdk/delivery-queue-runtime.js +1 -1
- package/dist/plugin-sdk/direct-dm.js +1 -1
- package/dist/plugin-sdk/discord.d.ts +2 -2
- package/dist/plugin-sdk/embedding-providers.js +2 -2
- package/dist/plugin-sdk/gateway-method-runtime.js +1 -1
- package/dist/plugin-sdk/gateway-runtime.js +2 -2
- package/dist/plugin-sdk/health.js +1 -1
- package/dist/plugin-sdk/image-generation-core.js +3 -3
- package/dist/plugin-sdk/image-generation-runtime.js +1 -1
- package/dist/plugin-sdk/image-generation.js +2 -2
- package/dist/plugin-sdk/inbound-reply-dispatch.js +3 -3
- package/dist/plugin-sdk/index.js +1 -1
- package/dist/plugin-sdk/infra-runtime.js +3 -3
- package/dist/plugin-sdk/mattermost.js +1 -1
- package/dist/plugin-sdk/media-generation-runtime-shared.js +1 -1
- package/dist/plugin-sdk/media-generation-runtime.js +1 -1
- package/dist/plugin-sdk/media-runtime.js +7 -7
- package/dist/plugin-sdk/media-understanding-runtime.js +1 -1
- package/dist/plugin-sdk/media-understanding.js +2 -2
- package/dist/plugin-sdk/memory-core-host-engine-embeddings.js +4 -4
- package/dist/plugin-sdk/memory-core-host-engine-foundation.js +2 -2
- package/dist/plugin-sdk/memory-core-host-engine-qmd.js +2 -2
- package/dist/plugin-sdk/memory-core-host-engine-storage.js +6 -6
- package/dist/plugin-sdk/memory-core-host-runtime-cli.js +2 -2
- package/dist/plugin-sdk/memory-core-host-runtime-core.js +3 -3
- package/dist/plugin-sdk/memory-core-host-runtime-files.js +4 -4
- package/dist/plugin-sdk/memory-core.js +3 -3
- package/dist/plugin-sdk/memory-host-core.js +3 -3
- package/dist/plugin-sdk/memory-host-files.js +4 -4
- package/dist/plugin-sdk/memory-host-search.js +1 -1
- package/dist/plugin-sdk/models-provider-runtime.js +1 -1
- package/dist/plugin-sdk/music-generation-core.js +1 -1
- package/dist/plugin-sdk/native-command-registry.js +1 -1
- package/dist/plugin-sdk/outbound-media.js +2 -2
- package/dist/plugin-sdk/outbound-runtime.js +3 -3
- package/dist/plugin-sdk/param-readers.js +2 -2
- package/dist/plugin-sdk/plugin-runtime.js +2 -2
- package/dist/plugin-sdk/provider-auth-api-key.js +4 -4
- package/dist/plugin-sdk/provider-auth-login.js +1 -1
- package/dist/plugin-sdk/provider-auth-runtime.js +2 -2
- package/dist/plugin-sdk/provider-auth.js +6 -6
- package/dist/plugin-sdk/provider-catalog-runtime.js +2 -2
- package/dist/plugin-sdk/provider-entry.js +1 -1
- package/dist/plugin-sdk/provider-setup.js +1 -1
- package/dist/plugin-sdk/provider-stream-family.js +3 -3
- package/dist/plugin-sdk/provider-stream.js +2 -2
- package/dist/plugin-sdk/provider-transport-runtime.js +1 -1
- package/dist/plugin-sdk/provider-web-fetch.js +2 -2
- package/dist/plugin-sdk/provider-web-search.js +4 -4
- package/dist/plugin-sdk/realtime-bootstrap-context.js +2 -2
- package/dist/plugin-sdk/realtime-transcription.js +1 -1
- package/dist/plugin-sdk/realtime-voice.js +2 -2
- package/dist/plugin-sdk/reply-dispatch-runtime.js +1 -1
- package/dist/plugin-sdk/reply-runtime.js +6 -6
- package/dist/plugin-sdk/runtime-secret-resolution.js +2 -2
- package/dist/plugin-sdk/runtime.js +3 -3
- package/dist/plugin-sdk/self-hosted-provider-setup.js +1 -1
- package/dist/plugin-sdk/simple-completion-runtime.js +1 -1
- package/dist/plugin-sdk/speech-core.js +2 -2
- package/dist/plugin-sdk/speech.js +1 -1
- package/dist/plugin-sdk/tool-plugin.js +1 -1
- package/dist/plugin-sdk/transcripts.js +1 -1
- package/dist/plugin-sdk/tts-runtime.d.ts +1 -1
- package/dist/plugin-sdk/tts-runtime.js +1 -1
- package/dist/plugin-sdk/video-generation-core.js +2 -2
- package/dist/plugin-sdk/video-generation-runtime.js +1 -1
- package/dist/plugin-sdk/web-media.js +3 -3
- package/dist/plugin-sdk/zalouser.js +1 -1
- package/dist/plugin-sdk/zod-schema.core-B4_b2R5K.d.ts +166 -0
- package/dist/plugin-service-2XF6Lu_a.js +1249 -0
- package/dist/plugins/build-smoke-entry.js +2 -2
- package/dist/plugins/loader.js +1 -1
- package/dist/plugins/provider-discovery.runtime.js +1 -1
- package/dist/plugins/provider-runtime.runtime.js +1 -1
- package/dist/plugins/runtime/index.js +21 -21
- package/dist/plugins/tools.js +1 -1
- package/dist/plugins-authoring-command-CCX6tJwd.js +304 -0
- package/dist/plugins-cli-HX8nTV2h.js +63 -0
- package/dist/plugins-cli.runtime-BYn4VsLP.js +339 -0
- package/dist/plugins-cli.runtime.js +1 -1
- package/dist/plugins-command-helpers-ByuW-yNj.js +2 -0
- package/dist/plugins-command-helpers-DaaxGnCD.js +164 -0
- package/dist/plugins-inspect-command-C9NDk23X.js +248 -0
- package/dist/plugins-install-command-B0NfUxeA.js +993 -0
- package/dist/plugins-install-command-BmuScfLI.js +2 -0
- package/dist/plugins-install-persist-CfwO876P.js +252 -0
- package/dist/plugins-list-command-Bx8X908n.js +184 -0
- package/dist/plugins-uninstall-command-p6h44-Ft.js +118 -0
- package/dist/postinstall-inventory.json +862 -862
- package/dist/prepare.runtime-8DdQ4k9k.js +798 -0
- package/dist/prepare.runtime.js +1 -1
- package/dist/presentation-card-DeAf3jYW.js +164 -0
- package/dist/preview-warnings-BF7nlTo8.js +618 -0
- package/dist/profiles-DUhMLnqX.js +194 -0
- package/dist/program-C7f_U7fr.js +131 -0
- package/dist/provider-adapters-CWLwE9KS.js +104 -0
- package/dist/provider-api-key-auth-CshQbUPZ.js +117 -0
- package/dist/provider-api-key-auth.runtime-B64jPCKn.js +14 -0
- package/dist/provider-api-key-auth.runtime.js +1 -1
- package/dist/provider-auth-D-I3YLSn.js +281 -0
- package/dist/provider-auth-api-key-Bub0Rjak.js +5 -0
- package/dist/provider-auth-choice-DpNAEScm.js +311 -0
- package/dist/provider-auth-choice-helpers-Bof937LW.js +210 -0
- package/dist/provider-auth-choice.runtime-B3spikLY.js +18 -0
- package/dist/provider-auth-choice.runtime-vVgz7FKq.js +2 -0
- package/dist/provider-auth-choice.runtime.js +1 -1
- package/dist/provider-auth-guidance-DcCL0Q2U.js +2 -0
- package/dist/provider-auth-guidance-rWRMN4Jn.js +34 -0
- package/dist/provider-auth-helpers-Cp8L-Xha.js +177 -0
- package/dist/provider-auth-login.runtime-BJUzc4iH.js +156 -0
- package/dist/provider-auth-login.runtime.js +1 -1
- package/dist/provider-auth-runtime-DmcWtzbb.js +186 -0
- package/dist/provider-discovery-JyAJi97k.js +95 -0
- package/dist/provider-discovery.runtime-D_0WTYr8.js +290 -0
- package/dist/provider-discovery.runtime.js +1 -1
- package/dist/provider-dispatcher-C8Jt94Xl.js +22 -0
- package/dist/provider-dispatcher.runtime.js +1 -1
- package/dist/provider-entry-By0ggZuI.js +134 -0
- package/dist/provider-hook-runtime-B8AUbQxf.js +255 -0
- package/dist/provider-openai-codex-oauth-C9Mmnt7d.js +2 -0
- package/dist/provider-openai-codex-oauth-CH5Jg1vk.js +44 -0
- package/dist/provider-registration-C1zvaHQP.js +235 -0
- package/dist/provider-registry-B9diJyLv.js +31 -0
- package/dist/provider-registry-BXSxmPGA.js +61 -0
- package/dist/provider-registry-CoE-sxbq.js +61 -0
- package/dist/provider-registry-DLth_GdI.js +61 -0
- package/dist/provider-registry-J4LRd5Rg.js +36 -0
- package/dist/provider-runtime-B4cw16pt.js +3 -0
- package/dist/provider-runtime-DNNbfwOK.js +386 -0
- package/dist/provider-runtime.runtime-98mAe_ni.js +26 -0
- package/dist/provider-runtime.runtime.js +1 -1
- package/dist/provider-self-hosted-setup-Dysv2Kwt.js +373 -0
- package/dist/provider-stream-BLaC8bqO.js +1084 -0
- package/dist/provider-stream-Caa5YOx2.js +313 -0
- package/dist/provider-stream-family-CvvfxLyP.js +2 -0
- package/dist/provider-usage-CVNosTP3.js +71 -0
- package/dist/provider-usage-D2NudXbO.js +4 -0
- package/dist/provider-usage.load-DG6R3lkG.js +357 -0
- package/dist/provider-web-search-DmgTaxRU.js +58 -0
- package/dist/provider-wizard-Cw-5H3tX.js +125 -0
- package/dist/providers.runtime-DF0T9lFz.js +240 -0
- package/dist/providers.runtime-oM9Vn1wr.js +2 -0
- package/dist/providers.runtime.js +1 -1
- package/dist/proxy-BxGnVyJu.js +662 -0
- package/dist/public-artifacts-BMP9hZfh.js +7 -0
- package/dist/pw-ai-CD52qfYo.js +3064 -0
- package/dist/qmd-manager-BYbvU4YC.js +2040 -0
- package/dist/qr-cli-Btz2ZdO3.js +2 -0
- package/dist/qr-cli-eyTRwMm2.js +371 -0
- package/dist/qr-image-BCwiO6tL.js +2 -0
- package/dist/queue-CJRoTOBi.js +923 -0
- package/dist/read-file-ogB-HjbK.js +183 -0
- package/dist/register-service-commands-D_gQ3b6_.js +77 -0
- package/dist/register.agent-DXQLn-r0.js +152 -0
- package/dist/register.configure-FavQPGce.js +16 -0
- package/dist/register.crestodian-Cbfmnl6h.js +24 -0
- package/dist/register.maintenance-B8xODEMU.js +85 -0
- package/dist/register.message-B8PYgZ-j.js +404 -0
- package/dist/register.migrate-CieoN8zZ.js +106 -0
- package/dist/register.onboard-BqWDIDKH.js +115 -0
- package/dist/register.setup-CgeTBW4T.js +40 -0
- package/dist/register.status-health-sessions-C99aHa5h.js +293 -0
- package/dist/register.subclis-79SvyMFt.js +31 -0
- package/dist/register.subclis-CXrO8_TO.js +3 -0
- package/dist/register.subclis-core-GoXV1yMG.js +273 -0
- package/dist/rem-harness-laL5luQa.js +649 -0
- package/dist/repair-sequencing-DGY2mBg6.js +652 -0
- package/dist/reply-media-paths.runtime-BeWVPkgy.js +2 -0
- package/dist/reply-media-paths.runtime-rzAV_Kee.js +154 -0
- package/dist/reply-media-paths.runtime.js +1 -1
- package/dist/reply-payloads-D_JHMviC.js +79 -0
- package/dist/reply-payloads-dedupe-B9GGGaL-.js +176 -0
- package/dist/reply-payloads-dedupe.runtime--C3jHs9y.js +2 -0
- package/dist/reply-payloads-dedupe.runtime.js +1 -1
- package/dist/reply-timing-tracker-DPjlETUb.js +205 -0
- package/dist/reply-turn-admission-DdfIwcMK.js +2056 -0
- package/dist/reply.runtime-BC1HT67i.js +2 -0
- package/dist/reply.runtime.js +1 -1
- package/dist/reset-preserved-selection-Czd80hug.js +45 -0
- package/dist/resolve-COJFlAZT.js +106 -0
- package/dist/restart-B9GMMIZt.js +121 -0
- package/dist/result-fallback-classifier-By0Z6b8r.js +98 -0
- package/dist/root-help-Bp0kGaUZ.js +43 -0
- package/dist/route-CgG9Z7OI.js +475 -0
- package/dist/route-reply-D9_9oRg1.js +174 -0
- package/dist/route-reply.runtime-BwNl3h2m.js +2 -0
- package/dist/route-reply.runtime.js +1 -1
- package/dist/routes-Cz2NHUV4.js +2 -0
- package/dist/routes-DMo6Eacc.js +3701 -0
- package/dist/run-SFRSThMI.js +1162 -0
- package/dist/run-auth-profile.runtime-BxLM8m_2.js +2 -0
- package/dist/run-auth-profile.runtime.js +1 -1
- package/dist/run-command-Cd5iN7eN.js +2 -0
- package/dist/run-command-ah46O06U.js +23 -0
- package/dist/run-context-DGCQJldA.js +66 -0
- package/dist/run-context.runtime-CSBHDAd5.js +2 -0
- package/dist/run-context.runtime.js +1 -1
- package/dist/run-delivery.runtime-C9xoiZ3h.js +762 -0
- package/dist/run-delivery.runtime.js +1 -1
- package/dist/run-embedded.runtime-D8bz5vfV.js +4 -0
- package/dist/run-embedded.runtime.js +1 -1
- package/dist/run-execution-cli.runtime-BAa8KPn7.js +4 -0
- package/dist/run-execution-cli.runtime.js +1 -1
- package/dist/run-executor.runtime-CNnemqSa.js +330 -0
- package/dist/run-executor.runtime.js +1 -1
- package/dist/run-model-catalog.runtime-Dh7EghXr.js +2 -0
- package/dist/run-model-catalog.runtime.js +1 -1
- package/dist/run-session-state-cMlTFwT_.js +159 -0
- package/dist/run-subagent-registry.runtime-BgQU86-E.js +2 -0
- package/dist/run-subagent-registry.runtime.js +1 -1
- package/dist/runner-B3YXRJOB.js +704 -0
- package/dist/runner.entries-DMTKpRDP.js +1485 -0
- package/dist/runtime-BHReFHE2.js +2 -0
- package/dist/runtime-BiQZ6Usw.js +615 -0
- package/dist/runtime-CAeriu2O.js +10 -0
- package/dist/runtime-CAnCRCX3.js +224 -0
- package/dist/runtime-CV_2NqSY.js +300 -0
- package/dist/runtime-CmpnvXo3.js +245 -0
- package/dist/runtime-D2fci1Ey.js +2 -0
- package/dist/runtime-DAsYmYeA.js +3 -0
- package/dist/runtime-DeA45VKG.js +210 -0
- package/dist/runtime-DvkZ8tHI.js +436 -0
- package/dist/runtime-DxVUR2Xg.js +2 -0
- package/dist/runtime-api-B88le0UE.js +12 -0
- package/dist/runtime-channel-AubRWvnH.js +2 -0
- package/dist/runtime-channel-DdclSuEu.js +148 -0
- package/dist/runtime-config-collectors-DukTj2va.js +525 -0
- package/dist/runtime-embedded-agent.runtime-BpLweeFv.js +2 -0
- package/dist/runtime-embedded-agent.runtime.js +1 -1
- package/dist/runtime-internal-CaoUylZw.js +2 -0
- package/dist/runtime-llm.runtime-DlpqGc7S.js +307 -0
- package/dist/runtime-llm.runtime.js +1 -1
- package/dist/runtime-model-auth.runtime-CLAaWzxY.js +46 -0
- package/dist/runtime-model-auth.runtime-DxVvqRTd.js +2 -0
- package/dist/runtime-model-auth.runtime.js +1 -1
- package/dist/runtime-options-TTtN01-I.js +275 -0
- package/dist/runtime-plugin-ClqxJSbp.js +92 -0
- package/dist/runtime-plugins-Bq01wLXP.js +32 -0
- package/dist/runtime-plugins.runtime-cwCvl1TR.js +2 -0
- package/dist/runtime-plugins.runtime.js +1 -1
- package/dist/runtime-prepare.runtime-Cz_hV_k5.js +81 -0
- package/dist/runtime-prepare.runtime.js +1 -1
- package/dist/runtime-provider-QCJq90av.js +24 -0
- package/dist/runtime-provider-Wllc3jC6.js +2 -0
- package/dist/runtime-registry-loader-BM1mQBJr.js +2 -0
- package/dist/runtime-registry-loader-DzhYCt4s.js +117 -0
- package/dist/runtime-shared-BfqOW-Vb.js +365 -0
- package/dist/runtime-web-channel-plugin-BcVPgD14.js +204 -0
- package/dist/runtime-web-tools-fallback.runtime.js +1 -1
- package/dist/scan-ldbaD8jq.js +573 -0
- package/dist/sdk-security-runtime-Bxhq2O1G.js +86 -0
- package/dist/sdk-setup-tools-CsQM9pF0.js +8 -0
- package/dist/secrets-cli-DbpIf4-z.js +150 -0
- package/dist/security-cli-BK4Xpa6h.js +520 -0
- package/dist/selection-BXKik6Ps.js +3 -0
- package/dist/selection-D4O3gK3Q.js +18365 -0
- package/dist/send-DaoGIay5.js +1222 -0
- package/dist/send-DzNjJGJX.js +178 -0
- package/dist/send-f5w9krNS.js +711 -0
- package/dist/send-media-cOciBxcg.js +2072 -0
- package/dist/send-result-DMFwBuOl.js +141 -0
- package/dist/server-BoC1mxZ-.js +24 -0
- package/dist/server-DZnI6w5k.js +72 -0
- package/dist/server-aux-handlers-BwRdYdub.js +1347 -0
- package/dist/server-chat-Q95f4ywD.js +827 -0
- package/dist/server-close.runtime.js +3 -3
- package/dist/server-context-CnXNaarB.js +2 -0
- package/dist/server-context-DRBebo7Y.js +955 -0
- package/dist/server-cron-C0o0ZvqF.js +3173 -0
- package/dist/server-cron-CLeBvurR.js +2 -0
- package/dist/server-maintenance-CqHfTnFD.js +152 -0
- package/dist/server-methods-BmlBQJMD.js +497 -0
- package/dist/server-middleware-DJhnR6jl.js +122 -0
- package/dist/server-model-catalog-CoSSk_Gy.js +2 -0
- package/dist/server-model-catalog-D32oDTQp.js +73 -0
- package/dist/server-node-events-DX9a4etQ.js +597 -0
- package/dist/server-plugin-bootstrap-Vco-EpxY.js +71 -0
- package/dist/server-plugins-WBX2fZRp.js +435 -0
- package/dist/server-reload-handlers-DGJLH8bg.js +719 -0
- package/dist/server-restart-sentinel-Bvon7f8K.js +700 -0
- package/dist/server-runtime-services-BNcH4vhR.js +3 -0
- package/dist/server-runtime-services-BjcQG5y7.js +147 -0
- package/dist/server-runtime-subscriptions-W39HeyoT.js +67 -0
- package/dist/server-session-events-CO73dMU-.js +244 -0
- package/dist/server-session-key-D8V67lDk.js +2 -0
- package/dist/server-session-key-v-KYSmRS.js +75 -0
- package/dist/server-startup-config-u54lUdWN.js +305 -0
- package/dist/server-startup-early-Cy5kArJG.js +87 -0
- package/dist/server-startup-memory-DvINFAYn.js +72 -0
- package/dist/server-startup-plugins-CerpbOSQ.js +127 -0
- package/dist/server-startup-post-attach-COUCwhNa.js +793 -0
- package/dist/server-ws-runtime-BfznAnbI.js +374 -0
- package/dist/server.impl-dQXccj0z.js +2622 -0
- package/dist/session-cost-usage-Bs5yIOBH.js +1600 -0
- package/dist/session-kill-http-DVleb3RW.js +121 -0
- package/dist/session-log-runtime-OG7J4j9m.js +1258 -0
- package/dist/session-override-LIWl5a9T.js +134 -0
- package/dist/session-reset-model.runtime-BpnTi4sa.js +144 -0
- package/dist/session-reset-model.runtime.js +1 -1
- package/dist/session-reset-service-HA07zS8L.js +651 -0
- package/dist/session-status.runtime-D6_clH8l.js +2 -0
- package/dist/session-status.runtime.js +1 -1
- package/dist/session-store-Cj4Rh6qc.js +273 -0
- package/dist/session-store.runtime-DSCxACdZ.js +4 -0
- package/dist/session-store.runtime.js +1 -1
- package/dist/session-subagent-reactivation.runtime-CcwaHAxg.js +2 -0
- package/dist/session-subagent-reactivation.runtime.js +1 -1
- package/dist/session-tab-registry-C-9uI2Wi.js +551 -0
- package/dist/session-utils-BRtPESA4.js +1508 -0
- package/dist/sessions-Beltl3Ra.js +1917 -0
- package/dist/sessions-DR-X-j8D.js +316 -0
- package/dist/sessions-cleanup-CR1CFcJb.js +165 -0
- package/dist/sessions-history-http-CjyHWYEv.js +432 -0
- package/dist/sessions-patch-peSeltuF.js +401 -0
- package/dist/sessions-resolve-D9ULr95s.js +180 -0
- package/dist/sessions-table-Da6bua9d.js +161 -0
- package/dist/sessions-uKpnhod0.js +12736 -0
- package/dist/sessions.runtime-C1mVNaU3.js +2 -0
- package/dist/sessions.runtime.js +1 -1
- package/dist/set-DVj21EuB.js +31 -0
- package/dist/set-image-JChDCaAP.js +17 -0
- package/dist/setup-5I-zpID3.js +614 -0
- package/dist/setup-CjtY6cli.js +2 -0
- package/dist/setup-onboard-configure-help-fast-path-C5GcSuXb.js +64 -0
- package/dist/setup.finalize-Bf10PNbl.js +586 -0
- package/dist/setup.gateway-config-EH5Rvwzy.js +281 -0
- package/dist/setup.migration-import-CoeV4Kc1.js +200 -0
- package/dist/setup.migration-import-DFFGw4DI.js +2 -0
- package/dist/setup.post-install-migration-DcQmWTE7.js +128 -0
- package/dist/shared-BFSJZ6B3.js +212 -0
- package/dist/shared-CVM-dYkO.js +5 -0
- package/dist/shared-fvgcmCsj.js +71 -0
- package/dist/simple-completion-runtime-C_TXe4M1.js +2 -0
- package/dist/simple-completion-runtime-DREq-fcF.js +206 -0
- package/dist/simple-completion-transport-DtD1fEvJ.js +83 -0
- package/dist/snapshot-urls-B-wkwDI9.js +317 -0
- package/dist/speech-core-KQg6oKcR.js +119 -0
- package/dist/speech-provider-DfyLYitQ.js +171 -0
- package/dist/speech-provider-oDvTumNW.js +227 -0
- package/dist/speech-provider-yL-TQ3Em.js +233 -0
- package/dist/stale-oauth-profile-shadows-CW11VYMM.js +2 -0
- package/dist/stale-oauth-profile-shadows-DFl6Lyf1.js +186 -0
- package/dist/standalone-runtime-registry-loader-BiponY-y.js +59 -0
- package/dist/startup-context-PVXYM-X3.js +314 -0
- package/dist/status-BA_0z83w.js +249 -0
- package/dist/status-Bc7BGlRt.js +2 -0
- package/dist/status-BwPWg9eQ.js +3 -0
- package/dist/status-CLQ66eml.js +4 -0
- package/dist/status-Ci2gChtY.js +466 -0
- package/dist/status-CmtBWJEE.js +2 -0
- package/dist/status-DdnMnPNs.js +73 -0
- package/dist/status-all-BpTvkYrt.js +573 -0
- package/dist/status-json-CizozZCr.js +15 -0
- package/dist/status-json-command-FzKa2t6O.js +84 -0
- package/dist/status-message-BHbnxwmt.js +495 -0
- package/dist/status-message.runtime-Df5WBBAk.js +6 -0
- package/dist/status-message.runtime.js +1 -1
- package/dist/status-queue.runtime-CXnZV4Bj.js +2 -0
- package/dist/status-queue.runtime.js +1 -1
- package/dist/status-runtime-shared-D3Hz8WZ_.js +289 -0
- package/dist/status-subagents.runtime-PoDdwwaw.js +32 -0
- package/dist/status-subagents.runtime.js +1 -1
- package/dist/status-text-DNxXSCuI.js +301 -0
- package/dist/status.command-C_e9GcMg.js +2 -0
- package/dist/status.command-DjVKDmt_.js +425 -0
- package/dist/status.command.text-runtime-BeHlqL8b.js +15 -0
- package/dist/status.runtime-h--fx9HY.js +2 -0
- package/dist/status.scan-WyR8TeJz.js +72 -0
- package/dist/status.scan-overview-CMzUAQMQ.js +460 -0
- package/dist/status.scan.deps.runtime-1JTrdyHk.js +19 -0
- package/dist/status.scan.deps.runtime.js +1 -1
- package/dist/status.scan.fast-json-D2jw1wKO.js +163 -0
- package/dist/status.scan.fast-json-DbN1KxJT.js +2 -0
- package/dist/status.summary-6ZijZM1g.js +2 -0
- package/dist/status.summary-CiCsChO-.js +276 -0
- package/dist/store-CdBPITcg.js +2302 -0
- package/dist/store-D0l2NCdn.js +3 -0
- package/dist/stored-model-override-HEgnFh6b.js +79 -0
- package/dist/subagent-announce-BUv_kA1W.js +353 -0
- package/dist/subagent-announce-delivery-Ci2Y_p--.js +1369 -0
- package/dist/subagent-control-BM3vNgsQ.js +492 -0
- package/dist/subagent-control.runtime-Df3pVQL9.js +3 -0
- package/dist/subagent-control.runtime.js +1 -1
- package/dist/subagent-hooks-CN2fLez2.js +2 -0
- package/dist/subagent-hooks-CeOmTJBf.js +230 -0
- package/dist/subagent-hooks-api-Cfe4DAT9.js +23 -0
- package/dist/subagent-registry-B9RPAXUs.js +2627 -0
- package/dist/subagent-registry-C7tedtVB.js +3 -0
- package/dist/subagent-registry.runtime.js +2 -2
- package/dist/subagent-session-cleanup-y0ijZ-LQ.js +390 -0
- package/dist/system-DVtrOGbV.js +111 -0
- package/dist/system-prompt-config-BVmrcmmr.js +918 -0
- package/dist/talk-CrdgqTCl.js +2454 -0
- package/dist/target-id-CrUyi-Uq.js +107 -0
- package/dist/targets-KZ2ezPwx.js +267 -0
- package/dist/targets.runtime-iZ8KdQ1C.js +2 -0
- package/dist/targets.runtime.js +1 -1
- package/dist/task-executor-893pMqzn.js +349 -0
- package/dist/task-owner-access-DC7MKz3n.js +74 -0
- package/dist/task-registry-control.runtime.js +2 -2
- package/dist/task-registry-delivery-runtime-YGMOyqP5.js +2 -0
- package/dist/task-registry-uaYJfgXF.js +2362 -0
- package/dist/task-registry.maintenance-Dx0m2NYh.js +2 -0
- package/dist/task-registry.maintenance-gApg-XOt.js +764 -0
- package/dist/task-status-access-CFhD_ieY.js +18 -0
- package/dist/tasks-B_Qoz38D.js +153 -0
- package/dist/tasks-DtV85zJT.js +548 -0
- package/dist/tasks-audit-system-Con3yYnm.js +210 -0
- package/dist/tasks-json-BM3pauZl.js +73 -0
- package/dist/tavily-web-search-provider.runtime-Cmyyc5kX.js +112 -0
- package/dist/tavily-web-search-provider.runtime.js +1 -1
- package/dist/text-report-CKxmVmt5.js +695 -0
- package/dist/text-transforms.runtime-DVwVsBRS.js +113 -0
- package/dist/text-transforms.runtime.js +1 -1
- package/dist/thread-bindings-B6UEVp9q.js +228 -0
- package/dist/tool-KOZc7TIF.js +143 -0
- package/dist/tool-dispatch-Ca4z2GEr.js +155 -0
- package/dist/tool-images-CzDwHeDR.js +247 -0
- package/dist/tool-plugin-BvQBJ2gU.js +93 -0
- package/dist/tool-resolution-Ddxl6tjh.js +153 -0
- package/dist/tool-result-truncation-BSKuIhd5.js +498 -0
- package/dist/tool-schema-nB27q-vb.js +40 -0
- package/dist/tool-schema-projection-COrMarLR.js +215 -0
- package/dist/tool-split-BjPHBFrv.js +323 -0
- package/dist/tools-CV40BWkc.js +901 -0
- package/dist/tools-catalog-5stC7W2V.js +156 -0
- package/dist/tools-effective-BVjqz2FV.js +442 -0
- package/dist/tools-effective-inventory-esPY5jRB.js +379 -0
- package/dist/tools-invoke-Czk_NM9G.js +51 -0
- package/dist/tools-invoke-http-D7PbsODz.js +68 -0
- package/dist/tools-invoke-shared-CzrEn0Dm.js +200 -0
- package/dist/tools-rSjgf61B.js +579 -0
- package/dist/tools.runtime-DiChCSGI.js +5 -0
- package/dist/tools.runtime.js +1 -1
- package/dist/transcript-rewrite-4IQefjvK.js +688 -0
- package/dist/transcripts-tool-BXTS8tE5.js +2 -0
- package/dist/transcripts-tool-CeWGgz5k.js +656 -0
- package/dist/tts-BS8EeM8p.js +2 -0
- package/dist/tts-BlTZjsaE.js +194 -0
- package/dist/tts-runtime-BfRdJDyY.js +1337 -0
- package/dist/tts-vRSvSw-t.js +3 -0
- package/dist/tts.runtime-ChBnVkNt.js +3 -0
- package/dist/tts.runtime-CmVCUbzq.js +2 -0
- package/dist/tts.runtime.js +1 -1
- package/dist/tui-BoQVBgWB.js +4860 -0
- package/dist/tui-DBYK9BeQ.js +2 -0
- package/dist/tui-backend-X0NI7rAv.js +256 -0
- package/dist/tui-cli-BpUtjV38.js +40 -0
- package/dist/typing-policy-CBwyAQh4.js +199 -0
- package/dist/usage-Bl-tgGx-.js +623 -0
- package/dist/usage-Cj_ektBl.js +1113 -0
- package/dist/usage-format-DWO9ckX3.js +394 -0
- package/dist/usage-format-DnCIXsqG.js +2 -0
- package/dist/video-generation-provider-B7ib4AeI.js +297 -0
- package/dist/video-generation-provider-CXQ6fqJx.js +64 -0
- package/dist/video-generation-provider-DXjl05T6.js +325 -0
- package/dist/video-generation-provider-Db8h71jA.js +77 -0
- package/dist/web-fetch/runtime.js +1 -1
- package/dist/web-fetch-providers.runtime-DhPkYjgB.js +41 -0
- package/dist/web-fetch-providers.runtime.js +1 -1
- package/dist/web-guarded-fetch-BdsVyvDS.js +58 -0
- package/dist/web-guarded-fetch-CJR3JCwT.js +2 -0
- package/dist/web-media-BzzQJAwk.js +4 -0
- package/dist/web-media-DViZjNBa.js +2 -0
- package/dist/web-media-inHawfBU.js +651 -0
- package/dist/web-provider-runtime-shared-Cc08Lt9p.js +142 -0
- package/dist/web-search-provider-common-CtbtmUL-.js +252 -0
- package/dist/web-search-providers.runtime-B7x_cRVn.js +41 -0
- package/dist/web-search-providers.runtime.js +1 -1
- package/package.json +1 -1
- package/dist/abort-CR0u3VsG.js +0 -277
- package/dist/abort.runtime-CXUxanGg.js +0 -2
- package/dist/accounts-BxBaquAf.js +0 -423
- package/dist/accounts-vQjpoqEe.js +0 -2
- package/dist/acp-spawn-2elSoS0E.js +0 -1286
- package/dist/acp-spawn-DtKOHNO1.js +0 -2
- package/dist/acp-stateful-target-driver-BqeA5j0h.js +0 -89
- package/dist/action-info-B8NotHFw.js +0 -75
- package/dist/active-runtime-registry-BO9mpPuB.js +0 -62
- package/dist/active-tool-schema-warnings-C8vGj5FX.js +0 -105
- package/dist/active-tool-schema-warnings-CVeFJuWI.js +0 -2
- package/dist/agent-BgEaDMdp.js +0 -1825
- package/dist/agent-_V5GbziF.js +0 -2
- package/dist/agent-bundle-lsp-runtime-0jBcDEHh.js +0 -389
- package/dist/agent-bundle-lsp-runtime-CQ6dZLs_.js +0 -2
- package/dist/agent-bundle-mcp-materialize-Cu6JqMzC.js +0 -124
- package/dist/agent-bundle-mcp-tools-BGL827cn.js +0 -3
- package/dist/agent-command-CMJdGr16.js +0 -1435
- package/dist/agent-delivery-DMu1MOeq.js +0 -117
- package/dist/agent-harness-runtime-BKSW2E1O.js +0 -207
- package/dist/agent-model-discovery-Cu4YL31r.js +0 -3
- package/dist/agent-model-discovery-DdmVtkZo.js +0 -238
- package/dist/agent-runner-utils-DXNDhwkI.js +0 -267
- package/dist/agent-runner.runtime-Cym4Odfd.js +0 -3784
- package/dist/agent-runtime-BkbhevY3.js +0 -199
- package/dist/agent-runtime-label-DNP06p76.js +0 -30
- package/dist/agent-runtime-metadata-JaTKc7mA.js +0 -53
- package/dist/agent-tool-result-middleware-loader-FbZE0Qpk.js +0 -55
- package/dist/agent-tools-Nwh8BlKX.js +0 -2506
- package/dist/agent-tools.before-tool-call-BwY-FYFl.js +0 -1274
- package/dist/agent-tools.before-tool-call-DwUmYhE3.js +0 -2
- package/dist/agent-u5NDWrw9.js +0 -3
- package/dist/agent-via-gateway-DMtOMwZa.js +0 -486
- package/dist/agent-wait-dedupe-CLuKbI_7.js +0 -180
- package/dist/agents-CiW7UEuB.js +0 -632
- package/dist/agents.command-shared-CXGSQscb.js +0 -16
- package/dist/agents.commands.add-BYBrZDXD.js +0 -304
- package/dist/agents.commands.bind-nfg3AlVc.js +0 -265
- package/dist/agents.commands.delete-pRj6vIrn.js +0 -128
- package/dist/agents.commands.identity-Ci2PnDDl.js +0 -143
- package/dist/agents.commands.list-Crj3BmqB.js +0 -235
- package/dist/aliases-BFspFx3-.js +0 -97
- package/dist/api-BiXhdPle.js +0 -3
- package/dist/api-Cptkjys5.js +0 -6
- package/dist/api-D3vT4ZVi.js +0 -2
- package/dist/api-key-rotation-CQgW8LEx.js +0 -167
- package/dist/app-registration-YW276fZC.js +0 -194
- package/dist/apply-BRxKrOiK.js +0 -510
- package/dist/apply-D0fWCa-U.js +0 -2
- package/dist/apply-DIR8y0ZA.js +0 -2
- package/dist/apply-DNUIV0Lt.js +0 -416
- package/dist/apply-Dux9jI7f.js +0 -544
- package/dist/approval-native-helpers-BMT-5X47.js +0 -398
- package/dist/artifacts-CTrtIv9T.js +0 -368
- package/dist/assistant-ClfI8Kho.js +0 -291
- package/dist/attachment-normalize-DAW86mZY.js +0 -213
- package/dist/attempt-execution-DTi2UfET.js +0 -584
- package/dist/attempt-execution.helpers-DrX0QToi.js +0 -969
- package/dist/attempt-execution.runtime-BCmAxwGy.js +0 -3
- package/dist/attempt.prompt-helpers-BE6kGRtT.js +0 -543
- package/dist/attempt.tool-run-context-J9O2yjbV.js +0 -1240
- package/dist/audio-preflight.runtime-D3GXVYBI.js +0 -7
- package/dist/audit-5T20D-xm.js +0 -1108
- package/dist/audit-CWuV5GlP.js +0 -477
- package/dist/audit.nondeep.runtime-DeYwRDYj.js +0 -1416
- package/dist/audit.runtime-rUlvK4Rb.js +0 -7
- package/dist/auth-DunUSatn.js +0 -567
- package/dist/auth-choice--eBzca8Y.js +0 -3
- package/dist/auth-choice-DJ9jsFUq.js +0 -400
- package/dist/auth-choice-_pLkIdVh.js +0 -110
- package/dist/auth-choice.apply.api-providers-CALcopRP.js +0 -2
- package/dist/auth-choice.apply.api-providers-Dzzm1snk.js +0 -34
- package/dist/auth-choice.plugin-providers.runtime-BHKTeZZc.js +0 -11
- package/dist/auth-health-Cs4OjiF2.js +0 -219
- package/dist/auth-list-bwJ4QDs0.js +0 -115
- package/dist/auth-order-BoHN3Dc_.js +0 -105
- package/dist/auth-profiles-BOLncVgy.js +0 -73
- package/dist/auth-profiles-BiQRkULt.js +0 -14
- package/dist/backend-config-B5yga5ay.js +0 -259
- package/dist/bash-tools-BWvldguc.js +0 -3
- package/dist/bash-tools-DEAAO5np.js +0 -3497
- package/dist/binding-routing-BbtHmU_l.js +0 -113
- package/dist/binding-targets-DSNv3-QA.js +0 -121
- package/dist/bootstrap-files-DD8V2dLe.js +0 -202
- package/dist/bootstrap-files-_6u1uJW2.js +0 -3
- package/dist/bridge-server-v1-XPnAZ.js +0 -113
- package/dist/browser-cli-CnpuO4KR.js +0 -230
- package/dist/browser-cli-DPbIn8SK.js +0 -2
- package/dist/browser-cli-actions-input-DoGR6LI-.js +0 -522
- package/dist/browser-cli-actions-observe-CYMpgmtF.js +0 -81
- package/dist/browser-cli-debug-ChJjSq-h.js +0 -137
- package/dist/browser-cli-inspect-Bbci-WPG.js +0 -117
- package/dist/browser-cli-manage-Bnscjb7b.js +0 -446
- package/dist/browser-cli-resize-D1MJdvZI.js +0 -32
- package/dist/browser-cli-shared-BCQwqz51.js +0 -69
- package/dist/browser-cli-state-BWkPsvUg.js +0 -371
- package/dist/browser-control-auth-CEP_ExeC.js +0 -2
- package/dist/browser-profiles-SvnqnHVN.js +0 -2
- package/dist/browser-runtime-0mRxjFpp.js +0 -389
- package/dist/browser-tool.schema--CLR3nDv.js +0 -132
- package/dist/btw-command-DV6HfrRV.js +0 -18
- package/dist/build-DiRmljCi.js +0 -261
- package/dist/bundled-channel-config-schema-DpdKMATU.d.ts +0 -3168
- package/dist/capability-cli-ATfwTYFe.js +0 -1809
- package/dist/capability-provider-runtime-l3nnLGvn.js +0 -346
- package/dist/cdp.helpers-IIuc0KGS.js +0 -637
- package/dist/channel-CzTD2ouI.js +0 -2309
- package/dist/channel-actions-B5Yk5Axf.js +0 -46
- package/dist/channel-bootstrap.runtime-C9F-Pq1o.js +0 -38
- package/dist/channel-bootstrap.runtime-TPyY5Ngv.js +0 -2
- package/dist/channel-core-XMZJ-ZGF.js +0 -5
- package/dist/channel-inbound-DvqkKmiH.js +0 -121
- package/dist/channel-message-CnJ4vUyt.js +0 -12
- package/dist/channel-outbound-BhefGAqY.js +0 -436
- package/dist/channel-plugin-resolution-BiaJ8aRa.js +0 -2
- package/dist/channel-plugin-resolution-D_CxkMVc.js +0 -135
- package/dist/channel-resolution-DzI28gIM.js +0 -46
- package/dist/channel-selection-CLFO4-eQ.js +0 -171
- package/dist/channel-selection.runtime-Beb2-bMH.js +0 -2
- package/dist/channel.runtime-By5T5eGw.js +0 -697
- package/dist/channels-BrRY9Mag.js +0 -1004
- package/dist/channels-cli-CF--e2RU.js +0 -331
- package/dist/chat-BTMPilpx.js +0 -2940
- package/dist/chat-DnC7XCWK.js +0 -3
- package/dist/chrome-C3_dN9jE.js +0 -1517
- package/dist/chrome-mcp-5jjDHIgn.js +0 -864
- package/dist/chrome-mcp-DFAa-WzK.js +0 -2
- package/dist/claude-live-session-BUPeOzLE.js +0 -1338
- package/dist/claude-live-session-Bprgmr1-.js +0 -2
- package/dist/clawbot-cli-5UVkLT1Y.js +0 -9
- package/dist/cli-6a6sMEUB.js +0 -2
- package/dist/cli-COCN9B5e.js +0 -2
- package/dist/cli-CpI4dBXy.js +0 -141
- package/dist/cli-YLx-ekdH.js +0 -293
- package/dist/cli-backends.runtime-CsBjr7ag.js +0 -7
- package/dist/cli-compaction-Bh0oMwUa.js +0 -363
- package/dist/cli-registry-loader-DDbaAJgY.js +0 -2
- package/dist/cli-registry-loader-xc2Ah8S4.js +0 -193
- package/dist/cli-runner-BfSrIn-9.js +0 -597
- package/dist/cli-runner-D_FAjNbR.js +0 -2
- package/dist/cli-runner.runtime-BJetQDu1.js +0 -3
- package/dist/cli-runner.runtime-BKJQkc7C.js +0 -4
- package/dist/cli-session-Cy3IeH0g.js +0 -119
- package/dist/cli.runtime-BpOz0s3N.js +0 -1276
- package/dist/codex-native-web-search-BDtKRV3F.js +0 -4
- package/dist/codex-native-web-search-C0TrfoMX.js +0 -20
- package/dist/codex-native-web-search-core-CzlK1GfN.js +0 -106
- package/dist/command-auth-CFnvdYX2.js +0 -135
- package/dist/command-config-resolution-B_86rG8v.js +0 -2
- package/dist/command-config-resolution-BbadcA2M.js +0 -25
- package/dist/command-config-resolution.runtime-B_86rG8v.js +0 -2
- package/dist/command-execution-startup-Rrwwdg_5.js +0 -90
- package/dist/command-primitives-runtime-C9bTt5IV.js +0 -3
- package/dist/command-registry-CbpdQKmu.js +0 -9
- package/dist/command-registry-Dw-XC_Zk.js +0 -4
- package/dist/command-registry-core-rvEDki6p.js +0 -114
- package/dist/command-secret-gateway-BX6BIiFn.js +0 -589
- package/dist/command-secret-targets-DCzlTkb5.js +0 -2
- package/dist/command-status-builders-DIsZN9aY.js +0 -147
- package/dist/command-status.runtime-C2x4yMRd.js +0 -90
- package/dist/commands-FYCxWqIx.js +0 -161
- package/dist/commands-compact.runtime-BTMQfx1k.js +0 -10
- package/dist/commands-core.runtime-CuNLz2wm.js +0 -2
- package/dist/commands-handlers.runtime-DyNuPOmY.js +0 -6327
- package/dist/commands-models-s7BRmLQh.js +0 -448
- package/dist/commands-registry-BxEq-3UJ.js +0 -195
- package/dist/commands-registry.runtime-CbXW33S_.js +0 -4
- package/dist/commands-status-BRJMba4h.js +0 -16
- package/dist/commands-status-DCXEwlSF.js +0 -3
- package/dist/commands-status.runtime-DCXEwlSF.js +0 -3
- package/dist/commands-subagents-control.runtime-CduLQJFD.js +0 -2
- package/dist/commands-system-prompt-B3LD8CDs.js +0 -161
- package/dist/commands-system-prompt-DPsXTqOQ.js +0 -2
- package/dist/commands.runtime-3sVz8Qgo.js +0 -175
- package/dist/common-CZvBLb3w.js +0 -286
- package/dist/compact-DxU_9XEc.js +0 -1165
- package/dist/compact.runtime-CqQTypVl.js +0 -12
- package/dist/compaction-planning-DArTi9SN.js +0 -202
- package/dist/completion-cli-CiKl5HhI.js +0 -393
- package/dist/config--yllOaSC.js +0 -374
- package/dist/config-Yt5UcD91.js +0 -610
- package/dist/config-cli-BeXS3R6k.js +0 -1703
- package/dist/config-mutation-cQeWhUqy.js +0 -5
- package/dist/config-mutations-Cg04LH_S.js +0 -161
- package/dist/config-utils-Dhq_UKMC.js +0 -141
- package/dist/config-validation-BANohTKD.js +0 -33
- package/dist/configure-CWxhlx9G.js +0 -771
- package/dist/configure-Jejkc6dn.js +0 -3
- package/dist/configure.commands-BYy1bz8G.js +0 -2
- package/dist/configure.commands-C3hDvZse.js +0 -1253
- package/dist/context-DptQ59DZ.js +0 -248
- package/dist/context-_ZshNBhD.js +0 -2
- package/dist/context-engine-host-compat-C_eflvRw.js +0 -2
- package/dist/context-engine-host-compat-s15Pu845.js +0 -280
- package/dist/context-engine-lifecycle-COHFLnj4.js +0 -627
- package/dist/control-auth-CQJpLoIb.js +0 -114
- package/dist/control-service-BFSgA0Py.js +0 -40
- package/dist/control-service-D7GZv-GS.js +0 -3
- package/dist/control-ui/assets/activity-B7yRLbf3.js +0 -124
- package/dist/control-ui/assets/agents-E-3DAkaW.js +0 -1030
- package/dist/control-ui/assets/channels-D0c7A9OX.js +0 -120
- package/dist/control-ui/assets/cron-B54j2Vmo.js +0 -1016
- package/dist/control-ui/assets/debug-CRcGYNA9.js +0 -97
- package/dist/control-ui/assets/index-bZJJ7U8q.js +0 -7214
- package/dist/control-ui/assets/instances-RcBeqNzx.js +0 -57
- package/dist/control-ui/assets/nodes-BoWRh42t.js +0 -444
- package/dist/control-ui/assets/sessions-BmRQ932H.js +0 -425
- package/dist/control-ui/assets/skills-BDn45kHZ.js +0 -362
- package/dist/control-ui/assets/workboard-BwbcNuC5.js +0 -402
- package/dist/control-ui-ChfTPXZo.js +0 -750
- package/dist/conversation-label-generator-CTfnInQF.js +0 -72
- package/dist/conversation-runtime-B7oAN9Tq.js +0 -31
- package/dist/core-api-CBD0dvTQ.js +0 -5
- package/dist/core-api-ClCm_yM8.js +0 -2
- package/dist/core-wuoxL08a.js +0 -284
- package/dist/crestodian--iYeGB8u.js +0 -55
- package/dist/cron-D2SzQyqo.js +0 -453
- package/dist/daemon-install-B6CAkU3V.js +0 -66
- package/dist/daemon-install-auth-profiles-store.runtime-Cpt5LSD6.js +0 -2
- package/dist/dashboard-ChYOQjM2.js +0 -263
- package/dist/defaults-CCopehWw.js +0 -130
- package/dist/defaults-H4kBp17N.js +0 -3
- package/dist/defaults.constants-CjB9HP6f.js +0 -76
- package/dist/deliver-BzPhWO_F.js +0 -3
- package/dist/deliver-DGyKH3Qi.js +0 -1399
- package/dist/deliver-runtime-Ca2kcQoZ.js +0 -2
- package/dist/delivery-outbound.runtime-D7ycPxY-.js +0 -7
- package/dist/delivery-queue-CnLv30ko.js +0 -863
- package/dist/delivery-queue-CuaDjNMh.js +0 -2
- package/dist/delivery-queue-runtime-DO2vqOIJ.js +0 -16
- package/dist/delivery-target.runtime-QcBVk_j8.js +0 -45
- package/dist/delivery.runtime-L09v4tys.js +0 -470
- package/dist/detached-task-runtime-BqU7YXYT.js +0 -86
- package/dist/diagnostics-T-Hk_Qzi.js +0 -168
- package/dist/dialogue-C0VnTMMn.js +0 -37
- package/dist/direct-dm-BWn67tDD.js +0 -81
- package/dist/directive-handling.defaults-DO6Snm4_.js +0 -22
- package/dist/directive-handling.fast-lane-BemYRfPn.js +0 -70
- package/dist/directive-handling.impl-BMVh1pMh.js +0 -823
- package/dist/directive-handling.impl-vr4MsYbt.js +0 -2
- package/dist/directive-handling.model-selection-DegP9exp.js +0 -122
- package/dist/directive-handling.persist.runtime-BUdU6_zm.js +0 -274
- package/dist/directives-1xk_ZcMf.js +0 -319
- package/dist/directory-cli-D83WEjEG.js +0 -239
- package/dist/dispatch-Ck2tvRYH.js +0 -2057
- package/dist/dispatch-acp-GdaHNdvf.js +0 -1102
- package/dist/dispatch-acp-manager.runtime-BGSrJqrW.js +0 -3
- package/dist/dispatch-acp-media.runtime-DQ8dYQh8.js +0 -4
- package/dist/dispatch-acp-transcript.runtime-CsJZGhnu.js +0 -40
- package/dist/dispatch-acp-tts.runtime-Bo-QxKgx.js +0 -3
- package/dist/dispatch-acp.runtime-C_u7sGcQ.js +0 -18
- package/dist/dispatcher-GtuYO6Ni.js +0 -106
- package/dist/doctor-B2qP9g8d.js +0 -760
- package/dist/doctor-D9wCez5t.js +0 -6
- package/dist/doctor-auth-XnseqtS7.js +0 -216
- package/dist/doctor-auth-flat-profiles-B6cL-TiJ.js +0 -516
- package/dist/doctor-auth-flat-profiles-Birb7qIk.js +0 -2
- package/dist/doctor-auth-legacy-oauth-CXO3OtyG.js +0 -48
- package/dist/doctor-auth-oauth-sidecar-BSgQPbcS.js +0 -177
- package/dist/doctor-auth-oauth-sidecar-CzzyNwxc.js +0 -2
- package/dist/doctor-bootstrap-size-BlVcO5D6.js +0 -57
- package/dist/doctor-claude-cli-_MTVnCQ-.js +0 -150
- package/dist/doctor-config-flow-0kxzjUjK.js +0 -1819
- package/dist/doctor-core-checks-C_g9REOd.js +0 -666
- package/dist/doctor-core-checks-CahzmM1L.js +0 -2
- package/dist/doctor-core-checks.runtime-Bi_oTiTZ.js +0 -278
- package/dist/doctor-gateway-daemon-flow-UAIWsI9w.js +0 -349
- package/dist/doctor-gateway-services-BiMEGiw_.js +0 -465
- package/dist/doctor-health-C69GVfMl.js +0 -65
- package/dist/doctor-health-contributions-Bz19QhI4.js +0 -874
- package/dist/doctor-lint-BVW4E6Qf.js +0 -95
- package/dist/doctor-memory-search-D2PWzDCY.js +0 -407
- package/dist/doctor-state-integrity-DuJIszQj.js +0 -1257
- package/dist/doctor-tool-result-cap-advice-Dpn4zNH3.js +0 -27
- package/dist/doctor-workspace-status-nW9TcIWi.js +0 -76
- package/dist/dreaming-CcOWzGN5.js +0 -523
- package/dist/dreaming-command-sxm3FQGb.js +0 -101
- package/dist/dreaming-narrative-BSRwiUPL.js +0 -2
- package/dist/dreaming-narrative-BskwmYdC.js +0 -721
- package/dist/dreaming-phases-BuHjGyPw.js +0 -2
- package/dist/dreaming-phases-ChVT8Ovk.js +0 -1162
- package/dist/drive-C_u5W4ln.js +0 -899
- package/dist/echo-transcript-tnZWH4EO.js +0 -52
- package/dist/effective-tool-policy-CeHdL2D7.js +0 -89
- package/dist/embedded-agent-CGULn3lb.js +0 -4
- package/dist/embedded-agent-DZTa1YiK.js +0 -4074
- package/dist/embedded-agent-helpers-B65K9o55.js +0 -6
- package/dist/embedded-agent-helpers-BPXCvWBb.js +0 -1037
- package/dist/embedded-agent.runtime-TfBgXcUV.js +0 -4
- package/dist/embedded-backend-BAaFwayA.js +0 -744
- package/dist/embedded-gateway-stub.runtime-CNyrjvgT.js +0 -12
- package/dist/embedding-provider-runtime-EnkHdROJ.js +0 -86
- package/dist/embedding-providers-CDkDb0kv.js +0 -2
- package/dist/embeddings-http-ClIu4_mP.js +0 -222
- package/dist/engine-qmd-DZRiT9i4.js +0 -708
- package/dist/engine-storage-BEqlN8TR.js +0 -203
- package/dist/errors-Co8auIlv.js +0 -2
- package/dist/exec-approval-forwarder.runtime-C7QvfWQ6.js +0 -4
- package/dist/exec-approval-session-target-ChuH1nXL.js +0 -177
- package/dist/exec-auto-reviewer-Bm7380HF.js +0 -2
- package/dist/exec-auto-reviewer-BrrdGleK.js +0 -241
- package/dist/execute.runtime-B-8jUqDB.js +0 -579
- package/dist/external-cli-auth-selection-0BxmRUps.js +0 -113
- package/dist/extra-params-BgyvpEpv.js +0 -615
- package/dist/fallback-notice-state-BXk_kRWM.js +0 -15
- package/dist/fallbacks-CPdVRP81.js +0 -31
- package/dist/fallbacks-shared-CSGf1oaf.js +0 -116
- package/dist/fengming-runtime-NUA51sEw.js +0 -33
- package/dist/fengming-runtime-config-CIZ-SHPt.js +0 -2
- package/dist/fengming-runtime-memory-CIZ-SHPt.js +0 -2
- package/dist/fengming-runtime-session-CIZ-SHPt.js +0 -2
- package/dist/fengming-tools-MvRSt0JA.js +0 -12221
- package/dist/flows-BocRit8D.js +0 -189
- package/dist/fs-utils-DSXeBcjj.js +0 -9
- package/dist/gateway-BCrUxrVw.js +0 -133
- package/dist/gateway-cli-B8bXBd_L.js +0 -443
- package/dist/gateway-install-token-pngTMc-f.js +0 -136
- package/dist/gateway-method-runtime-ueZTz7WH.js +0 -21
- package/dist/gateway-runtime-DbsoThML.js +0 -23
- package/dist/get-reply-DUuaxcBz.js +0 -5198
- package/dist/get-reply-from-config.runtime-B4Dgs3Hg.js +0 -2
- package/dist/github-copilot-token-7AfRRF7J.js +0 -2
- package/dist/health-7Yq5zpoZ.js +0 -3
- package/dist/health-DlZqxm2f.js +0 -621
- package/dist/health-DxesUuur.js +0 -111
- package/dist/health-state-BMG8kOby.js +0 -106
- package/dist/heartbeat-runner-Bq7A_Cjm.js +0 -5
- package/dist/heartbeat-runner-DVwbVyft.js +0 -1930
- package/dist/heartbeat-runner.runtime-DQ2NPXMD.js +0 -3
- package/dist/helpers-PCu2RivJ.js +0 -406
- package/dist/hook-helpers-DLEnCRO7.js +0 -44
- package/dist/hooks-Bv-otcl7.js +0 -536
- package/dist/hooks-cli-C5ve0nzF.js +0 -465
- package/dist/http-endpoint-helpers-w2SagsQz.js +0 -37
- package/dist/http-utils-CVvn0ZA-.js +0 -98
- package/dist/image-BeixBis4.js +0 -385
- package/dist/image-fallbacks-CPbmIMn9.js +0 -31
- package/dist/image-generation-core.auth.runtime-Co38iRxQ.js +0 -2
- package/dist/image-generation-provider-BA4Ar91S.js +0 -152
- package/dist/image-runtime-7ZsfioS1.js +0 -9
- package/dist/image-tool.helpers-upjA3ksB.js +0 -150
- package/dist/images-ChLi1Uog.js +0 -2
- package/dist/images-nB0XAnTa.js +0 -416
- package/dist/inbound-reply-dispatch-DglobJ8j.js +0 -2
- package/dist/inbound-reply-dispatch-QKOgNx-m.js +0 -147
- package/dist/infra-runtime-CGD3RE_2.js +0 -32
- package/dist/init-poVZDCAM.js +0 -59
- package/dist/install-Dn9oPGmU.js +0 -262
- package/dist/install.runtime-D5sllsjl.js +0 -2
- package/dist/internal-CnOL_Roa.js +0 -399
- package/dist/isolated-agent-CNw6E3F0.js +0 -1097
- package/dist/isolated-agent-DjkHhEyR.js +0 -2
- package/dist/kernel-B5Y5IQ-A.js +0 -3
- package/dist/kernel-CMuO4VJy.js +0 -979
- package/dist/kimi-web-search-provider.runtime-V4m_MHsk.js +0 -307
- package/dist/library-B-1EZjtY.js +0 -45
- package/dist/lifecycle-B-5gEZ7O.js +0 -570
- package/dist/lifecycle-Bzh5Jo09.js +0 -2
- package/dist/lifecycle-DvbcJYMl.js +0 -355
- package/dist/lifecycle.runtime-Bzh5Jo09.js +0 -2
- package/dist/list-B4xSHRdU.js +0 -2
- package/dist/list-BnhZHpxx.js +0 -207
- package/dist/list.list-command-DAz-Ws_6.js +0 -429
- package/dist/list.model-row-DtdX9KDu.js +0 -39
- package/dist/list.probe-CY6lxq51.js +0 -2
- package/dist/list.probe-DPuE1GOH.js +0 -451
- package/dist/list.provider-catalog-BHc9WXI6.js +0 -211
- package/dist/list.provider-catalog-CFbrroys.js +0 -2
- package/dist/list.registry-load-C1_sr3gb.js +0 -152
- package/dist/list.row-sources-BMtHc9oi.js +0 -474
- package/dist/list.source-plan-Dth72qPP.js +0 -81
- package/dist/list.status-command-BXCnEq8Q.js +0 -815
- package/dist/live-model-switch-Dxav22vq.js +0 -119
- package/dist/llm-slug-generator-6o8RXL11.js +0 -78
- package/dist/load-config-EF3n0Dyo.js +0 -27
- package/dist/load-context-CI_ogQt_.js +0 -82
- package/dist/loader-DtwEzpp-.js +0 -7008
- package/dist/local-dispatch.runtime-21liE3rA.js +0 -10
- package/dist/main-session-restart-recovery-D1g62iJ5.js +0 -2
- package/dist/main-session-restart-recovery-v2I9CEXi.js +0 -389
- package/dist/managed-image-attachments-BEl5qfCT.js +0 -616
- package/dist/managed-image-attachments-D5KqX2Qy.js +0 -2
- package/dist/manager-DZc3xiNq.js +0 -2314
- package/dist/manager-Vf3vLTGe.js +0 -3737
- package/dist/mcp-http-BaJoPKF9.js +0 -583
- package/dist/mcp-http-CpEaJIGJ.js +0 -2
- package/dist/media-runtime-DtP_Ff8m.js +0 -391
- package/dist/media-services-CXYbyIIp.js +0 -416
- package/dist/media-understanding-DvTIsIyr.js +0 -87
- package/dist/media-understanding-provider-DBBAvuwG.js +0 -13
- package/dist/media-understanding-provider-DOf_uZrx.js +0 -70
- package/dist/media-understanding-provider-DdRfNh9h.js +0 -69
- package/dist/media-understanding-provider-mqpQDt8V.js +0 -29
- package/dist/memory-BNk25Hi6.js +0 -437
- package/dist/memory-core-host-engine-embeddings-XsK5xS70.js +0 -667
- package/dist/memory-core-host-engine-foundation-BYkoOLXl.js +0 -15
- package/dist/memory-core-host-engine-qmd-0JuUCKCK.js +0 -2
- package/dist/memory-core-host-engine-storage-MCFGjDwW.js +0 -2
- package/dist/memory-core-host-runtime-cli-fVGH65E8.js +0 -10
- package/dist/memory-core-host-runtime-core-JtXIAdlM.js +0 -12
- package/dist/memory-core-host-runtime-files-BGw_ypoN.js +0 -4
- package/dist/memory-embedding-provider-runtime-3UBzs4sx.js +0 -36
- package/dist/memory-host-core-Y_O5V-mu.js +0 -78
- package/dist/memory-host-search.runtime-B4TzyvmR.js +0 -2
- package/dist/memory-runtime-9kEPAeKV.js +0 -2
- package/dist/memory-runtime-BU4t85uu.js +0 -57
- package/dist/memory-search-CVX--mSz.js +0 -235
- package/dist/message-BVXoNpWP.js +0 -284
- package/dist/message-HaiKqj0A.js +0 -2
- package/dist/message-action-runner-Chwzn02r.js +0 -2
- package/dist/message-action-runner-tEEliptt.js +0 -1922
- package/dist/message-handler-CHDS_NF-.js +0 -1806
- package/dist/metadata-registry-loader-Croa1pgR.js +0 -22
- package/dist/metadata-registry-loader-w0p86vis.js +0 -2
- package/dist/migrate-CPCZJ4H5.js +0 -2
- package/dist/migrate-CUj6m6Cx.js +0 -458
- package/dist/migration-provider-runtime-4r4WGtf2.js +0 -2
- package/dist/migration-provider-runtime-TxrH_mM7.js +0 -68
- package/dist/minimax-web-search-provider.runtime-Dr2GJiWj.js +0 -148
- package/dist/model-BQSouNOa.js +0 -2
- package/dist/model-CAk0bcuO.js +0 -1302
- package/dist/model-auth-BF7w9Fiv.js +0 -705
- package/dist/model-auth-label-r729wcPk.js +0 -67
- package/dist/model-auth-us8b_D5d.js +0 -6
- package/dist/model-catalog-BGykBGxx.js +0 -434
- package/dist/model-catalog-BVXrqFbI.js +0 -3
- package/dist/model-catalog-visibility-Bsup46vy.js +0 -76
- package/dist/model-config.helpers-wzD1EEfE.js +0 -95
- package/dist/model-context-tokens-DrIU9eJc.js +0 -572
- package/dist/model-fallback-GySPjr3J.js +0 -1288
- package/dist/model-fallback-auth.runtime-Dg_Jmguu.js +0 -5
- package/dist/model-picker-BI6jXOjt.js +0 -3
- package/dist/model-picker-DYyJHhfH.js +0 -1135
- package/dist/model-picker-visibility-D_IMZfxd.js +0 -22
- package/dist/model-picker.runtime-B70kQMyc.js +0 -48
- package/dist/model-pricing-cache-CSpUDzSt.js +0 -856
- package/dist/model-pricing-cache-dkPwTUVJ.js +0 -3
- package/dist/model-pricing-cache-state-C6shoEWy.js +0 -83
- package/dist/model-provider-auth-BfZHbTaj.js +0 -2
- package/dist/model-provider-auth-CPCBWvqL.js +0 -375
- package/dist/model-runtime-aliases-DUzusc9_.js +0 -133
- package/dist/model-selection-8UzO5mgF.js +0 -254
- package/dist/model-selection-Cb7azWw1.js +0 -7
- package/dist/model-selection-jDYEo0WI.js +0 -352
- package/dist/model-selection.runtime-D_yHZLbs.js +0 -7
- package/dist/models-BxA2IU3W.js +0 -57
- package/dist/models-auth-status-yG7yyRcv.js +0 -280
- package/dist/models-cli-DUt4uiMH.js +0 -257
- package/dist/models-config-B5bkuh6A.js +0 -1189
- package/dist/models-config-Xj8vG_x2.js +0 -2
- package/dist/models-config.providers.secrets-DNBB440Z.js +0 -2
- package/dist/models-config.providers.secrets-DNIQlBSE.js +0 -382
- package/dist/models-http-DMILRsry.js +0 -88
- package/dist/monitor-7tD_FE_5.js +0 -60
- package/dist/monitor-HjEwlqJs.js +0 -1024
- package/dist/monitor.account-D0F9tnWD.js +0 -5382
- package/dist/music-generation-provider-3ykPaUwR.js +0 -308
- package/dist/native-hook-relay-BJKHIhWd.js +0 -1378
- package/dist/native-hook-relay-V8Kappw1.js +0 -19
- package/dist/node-cli-BLVyQ93e.js +0 -2806
- package/dist/node-command-policy-B0ezpI_O.js +0 -295
- package/dist/nodes-DnWH_15m.js +0 -3
- package/dist/nodes-RkB4ZmP6.js +0 -1483
- package/dist/nodes-cli-upwPs91b.js +0 -960
- package/dist/nodes-pending--sojaxpI.js +0 -211
- package/dist/nodes-utils-Yks_uDZK.js +0 -85
- package/dist/oauth-CQN2efEy.js +0 -207
- package/dist/oauth-DApi3OI9.js +0 -746
- package/dist/oauth-DkUWBub2.js +0 -852
- package/dist/onboard-CiQSBSrz.js +0 -768
- package/dist/onboard-channels-DaWYXiLv.js +0 -1534
- package/dist/onboard-channels-DnwM2_IL.js +0 -2
- package/dist/onboard-custom-BQPckD0V.js +0 -3
- package/dist/onboard-custom-config-BmbThk2-.js +0 -422
- package/dist/onboard-custom-xInFj1Rs.js +0 -280
- package/dist/onboard-search-DSfmthe5.js +0 -412
- package/dist/openai-compat-errors-VR4SN1MV.js +0 -136
- package/dist/openai-http-DV95ynPi.js +0 -836
- package/dist/openai-transport-stream-BwpzqR-b.js +0 -3427
- package/dist/openresponses-http-DPchx8IC.js +0 -1175
- package/dist/operations-f9R8j-r9.js +0 -805
- package/dist/order-BQx8mNGZ.js +0 -218
- package/dist/outbound-attachment-C4yojK6p.js +0 -19
- package/dist/param-readers-BIXyd5la.js +0 -2
- package/dist/payloads-DrY1bKyF.js +0 -256
- package/dist/persistent-bindings.lifecycle-BiPN7luW.js +0 -85
- package/dist/persistent-bindings.lifecycle-X3wfan2Z.js +0 -2
- package/dist/plugin-enabled-CqsBObeO.js +0 -232
- package/dist/plugin-install-CfB1_kpX.js +0 -118
- package/dist/plugin-install-DzMraXHH.js +0 -2
- package/dist/plugin-install-config-policy-BD_elPNg.js +0 -169
- package/dist/plugin-registration-Dy58ncPf.js +0 -97
- package/dist/plugin-registry-BlmODeop.js +0 -3
- package/dist/plugin-registry-k5OK18l5.js +0 -2
- package/dist/plugin-runtime-B3t53CKr.js +0 -102
- package/dist/plugin-sdk/bundled-channel-config-schema-C3pWWvwG.d.ts +0 -3169
- package/dist/plugin-sdk/config-schema-D7cABQ6o.d.ts +0 -33
- package/dist/plugin-sdk/zod-schema.core-CwBNqcXp.d.ts +0 -166
- package/dist/plugin-service-sKF4gWFm.js +0 -1249
- package/dist/plugins-authoring-command-I72k2cuv.js +0 -304
- package/dist/plugins-cli-DMQRbPsU.js +0 -63
- package/dist/plugins-cli.runtime-CvDuKFJj.js +0 -339
- package/dist/plugins-command-helpers-C5WMM4bk.js +0 -164
- package/dist/plugins-command-helpers-DDt_pMQ4.js +0 -2
- package/dist/plugins-inspect-command-ka7Hpld3.js +0 -248
- package/dist/plugins-install-command-BHSgof-_.js +0 -2
- package/dist/plugins-install-command-t5caX9q_.js +0 -993
- package/dist/plugins-install-persist-Bah1m3x7.js +0 -252
- package/dist/plugins-list-command-BXLWwXHM.js +0 -184
- package/dist/plugins-uninstall-command-C_3m6CrW.js +0 -118
- package/dist/prepare.runtime-COZaHg5E.js +0 -798
- package/dist/presentation-card-CciJv4ru.js +0 -164
- package/dist/preview-warnings-L4VuEOyB.js +0 -618
- package/dist/profiles-CM2xoUYX.js +0 -194
- package/dist/program-B-4C7bC-.js +0 -131
- package/dist/provider-adapters-Eh8mS2Fd.js +0 -104
- package/dist/provider-api-key-auth-DTh2cbmS.js +0 -117
- package/dist/provider-api-key-auth.runtime-DrTYYfxK.js +0 -14
- package/dist/provider-auth-Bnaijzmv.js +0 -281
- package/dist/provider-auth-api-key-CNP8o5E7.js +0 -5
- package/dist/provider-auth-choice-Devw4sQf.js +0 -311
- package/dist/provider-auth-choice-helpers-DmVudRp6.js +0 -210
- package/dist/provider-auth-choice.runtime-C337IQ3W.js +0 -2
- package/dist/provider-auth-choice.runtime-DqGYalFo.js +0 -18
- package/dist/provider-auth-guidance-Bk4WV6Lg.js +0 -2
- package/dist/provider-auth-guidance-C7NCKuKn.js +0 -34
- package/dist/provider-auth-helpers-r7mC8I5l.js +0 -177
- package/dist/provider-auth-login.runtime-BFJgAAS6.js +0 -156
- package/dist/provider-auth-runtime-BiLPGiMW.js +0 -186
- package/dist/provider-discovery-uxRmAIf_.js +0 -95
- package/dist/provider-discovery.runtime-mwbSivDS.js +0 -290
- package/dist/provider-dispatcher-CtKWj3r-.js +0 -22
- package/dist/provider-entry-DjACqdrB.js +0 -134
- package/dist/provider-hook-runtime-CpJsM7Dk.js +0 -255
- package/dist/provider-openai-codex-oauth-DWGmVUYg.js +0 -2
- package/dist/provider-openai-codex-oauth-ctxd00JW.js +0 -44
- package/dist/provider-registration-l8EX4voM.js +0 -235
- package/dist/provider-registry-BgIQXJle.js +0 -31
- package/dist/provider-registry-CVuzobHN.js +0 -36
- package/dist/provider-registry-DmdDbSQs.js +0 -61
- package/dist/provider-registry-LqtLqheu.js +0 -61
- package/dist/provider-registry-pTYVjODc.js +0 -61
- package/dist/provider-runtime-BQZSuC9l.js +0 -3
- package/dist/provider-runtime-D9Q-7VuO.js +0 -386
- package/dist/provider-runtime.runtime-C6YZ8YI0.js +0 -26
- package/dist/provider-self-hosted-setup-BIAD2ISe.js +0 -373
- package/dist/provider-stream-DScdaoRo.js +0 -313
- package/dist/provider-stream-PE0IxmpZ.js +0 -1084
- package/dist/provider-stream-family-S2fhlydZ.js +0 -2
- package/dist/provider-usage-DVKHMF6l.js +0 -4
- package/dist/provider-usage-EEjx1av0.js +0 -71
- package/dist/provider-usage.load-Cu11xbrw.js +0 -357
- package/dist/provider-web-search-Dbk7MO-1.js +0 -58
- package/dist/provider-wizard-DS2Xb2eu.js +0 -125
- package/dist/providers.runtime-BPhGcupv.js +0 -240
- package/dist/providers.runtime-DoylK-ht.js +0 -2
- package/dist/proxy-BxacG0p3.js +0 -662
- package/dist/public-artifacts-Dq3y7bBv.js +0 -7
- package/dist/pw-ai-DlSSqerW.js +0 -3064
- package/dist/qmd-manager-B_SG-ejE.js +0 -2040
- package/dist/qr-cli-CT-sE_j9.js +0 -2
- package/dist/qr-cli-DPlDCXJQ.js +0 -371
- package/dist/qr-image--VmmvuDB.js +0 -2
- package/dist/queue-Be2Y7PcO.js +0 -923
- package/dist/read-file-hhemkDfq.js +0 -183
- package/dist/register-service-commands-CeVpCQU3.js +0 -77
- package/dist/register.agent-JLsb-giw.js +0 -152
- package/dist/register.configure-CP0Q-ost.js +0 -16
- package/dist/register.crestodian-CBXyXEix.js +0 -24
- package/dist/register.maintenance-DGIPQ2Vo.js +0 -85
- package/dist/register.message-BBQwz0Ld.js +0 -404
- package/dist/register.migrate-CkgNlvLD.js +0 -106
- package/dist/register.onboard-CS9gRK0c.js +0 -115
- package/dist/register.setup-DhqDOer9.js +0 -40
- package/dist/register.status-health-sessions-CiwQN_lw.js +0 -293
- package/dist/register.subclis-86Md7P0P.js +0 -3
- package/dist/register.subclis-CTVI8zvZ.js +0 -31
- package/dist/register.subclis-core-Cy4AnRCu.js +0 -273
- package/dist/rem-harness-vSsq3HiK.js +0 -649
- package/dist/repair-sequencing-SHADYdcA.js +0 -652
- package/dist/reply-media-paths.runtime-Bf5nxPuP.js +0 -154
- package/dist/reply-media-paths.runtime-sLsMpKGO.js +0 -2
- package/dist/reply-payloads-CJ3w8rSA.js +0 -79
- package/dist/reply-payloads-dedupe-DDFXWCVR.js +0 -176
- package/dist/reply-payloads-dedupe.runtime-DbXPzKmG.js +0 -2
- package/dist/reply-timing-tracker-DjVIBsVb.js +0 -205
- package/dist/reply-turn-admission-nEW5QbY5.js +0 -2056
- package/dist/reply.runtime-B4Dgs3Hg.js +0 -2
- package/dist/reset-preserved-selection-CVD1yeVC.js +0 -45
- package/dist/resolve-DidlinMh.js +0 -106
- package/dist/restart-DzTrO95c.js +0 -121
- package/dist/result-fallback-classifier-BqsFUDvP.js +0 -98
- package/dist/root-help-QGs0dCCN.js +0 -43
- package/dist/route-B3R-uzFG.js +0 -475
- package/dist/route-reply-CdfhgIoY.js +0 -174
- package/dist/route-reply.runtime-DwuU2WjH.js +0 -2
- package/dist/routes-ChXmJocl.js +0 -3701
- package/dist/routes-D-ZF4AdA.js +0 -2
- package/dist/run-ClmVDTET.js +0 -1162
- package/dist/run-auth-profile.runtime-CTxrwz0y.js +0 -2
- package/dist/run-command-CqZJQ0Im.js +0 -2
- package/dist/run-command-GClW75NL.js +0 -23
- package/dist/run-context-BOdGeRg5.js +0 -66
- package/dist/run-context.runtime-CwuKVYPj.js +0 -2
- package/dist/run-delivery.runtime-BQ39dm34.js +0 -762
- package/dist/run-embedded.runtime-e1K4Bt1_.js +0 -4
- package/dist/run-execution-cli.runtime-Cjrgt4cV.js +0 -4
- package/dist/run-executor.runtime-C2JE6JGb.js +0 -330
- package/dist/run-model-catalog.runtime-DkrLKopr.js +0 -2
- package/dist/run-session-state-C5YdQs7o.js +0 -159
- package/dist/run-subagent-registry.runtime-Dl_lXi6y.js +0 -2
- package/dist/runner-CNGHdaIg.js +0 -704
- package/dist/runner.entries-dckPkeld.js +0 -1485
- package/dist/runtime-9LxcVCyw.js +0 -615
- package/dist/runtime-BCOtBS5G.js +0 -3
- package/dist/runtime-C-pgjoJr.js +0 -210
- package/dist/runtime-CyF0vJXG.js +0 -10
- package/dist/runtime-D-7lMvGV.js +0 -2
- package/dist/runtime-D17OmF9G.js +0 -224
- package/dist/runtime-D6SweufG.js +0 -245
- package/dist/runtime-DVAM7AFd.js +0 -2
- package/dist/runtime-DX2ClrP-.js +0 -436
- package/dist/runtime-FOOWuiYX.js +0 -300
- package/dist/runtime-api-B0F0JsV1.js +0 -12
- package/dist/runtime-cREKSBYC.js +0 -2
- package/dist/runtime-channel-BmD4hoCR.js +0 -148
- package/dist/runtime-channel-BsebQSPL.js +0 -2
- package/dist/runtime-config-collectors-BjYeQ0Tk.js +0 -525
- package/dist/runtime-embedded-agent.runtime-A4r23Bn8.js +0 -2
- package/dist/runtime-internal-DkV-EMTK.js +0 -2
- package/dist/runtime-llm.runtime-BQKNnuRc.js +0 -307
- package/dist/runtime-model-auth.runtime-BbGqHVM5.js +0 -2
- package/dist/runtime-model-auth.runtime-rtJH4LBB.js +0 -46
- package/dist/runtime-options-B0EGb1Wq.js +0 -275
- package/dist/runtime-plugin-Bdqm44bH.js +0 -92
- package/dist/runtime-plugins-rZk1eAK_.js +0 -32
- package/dist/runtime-plugins.runtime-DApiYzny.js +0 -2
- package/dist/runtime-prepare.runtime-DWxvnbyY.js +0 -81
- package/dist/runtime-provider-B0slPjtk.js +0 -2
- package/dist/runtime-provider-DLgupOKt.js +0 -24
- package/dist/runtime-registry-loader-Cf2HuMjd.js +0 -2
- package/dist/runtime-registry-loader-DLzDrA7e.js +0 -117
- package/dist/runtime-shared-Bg-OiD4u.js +0 -365
- package/dist/runtime-web-channel-plugin-DrMjRaqi.js +0 -204
- package/dist/scan-DA7Oqxuv.js +0 -573
- package/dist/sdk-security-runtime-WjOaCbga.js +0 -86
- package/dist/sdk-setup-tools-DaYT6_jD.js +0 -8
- package/dist/secrets-cli-fJQ0geWO.js +0 -150
- package/dist/security-cli-CJMwGp8U.js +0 -520
- package/dist/selection-BNwLQzqJ.js +0 -3
- package/dist/selection-Cj-l80pO.js +0 -18365
- package/dist/send-DstYcrDW.js +0 -711
- package/dist/send-aTxtLkJm.js +0 -178
- package/dist/send-media-Bl2ryo6a.js +0 -2072
- package/dist/send-qwDMMnM6.js +0 -1222
- package/dist/send-result-BWRKr16H.js +0 -141
- package/dist/server-CMtA1S09.js +0 -24
- package/dist/server-DIRaYiiH.js +0 -72
- package/dist/server-aux-handlers-BRO-9-Jf.js +0 -1347
- package/dist/server-chat-0J_ke0ph.js +0 -827
- package/dist/server-context-DWOSX34k.js +0 -2
- package/dist/server-context-R7MFLFdI.js +0 -955
- package/dist/server-cron-2FuFg2j8.js +0 -2
- package/dist/server-cron-ChPAVQtg.js +0 -3173
- package/dist/server-maintenance-ZvS7Id6T.js +0 -152
- package/dist/server-methods-DSbhPK3k.js +0 -497
- package/dist/server-middleware-CYxFU-e5.js +0 -122
- package/dist/server-model-catalog-B22UhmRr.js +0 -73
- package/dist/server-model-catalog-BJIHPP3P.js +0 -2
- package/dist/server-node-events-tNWJnXQM.js +0 -597
- package/dist/server-plugin-bootstrap-Ccu97zi8.js +0 -71
- package/dist/server-plugins-ByXwKPnj.js +0 -435
- package/dist/server-reload-handlers-ConGiT9Q.js +0 -719
- package/dist/server-restart-sentinel-mPHo61LL.js +0 -700
- package/dist/server-runtime-services-BR1icaUW.js +0 -3
- package/dist/server-runtime-services-Bx8n34dj.js +0 -147
- package/dist/server-runtime-subscriptions-CZklTkRG.js +0 -67
- package/dist/server-session-events-DxdiZYM2.js +0 -244
- package/dist/server-session-key-CYvLslFO.js +0 -75
- package/dist/server-session-key-D9GQut81.js +0 -2
- package/dist/server-startup-config-Byb0vR8j.js +0 -305
- package/dist/server-startup-early-a65fHTQS.js +0 -87
- package/dist/server-startup-memory-ClwzC9jX.js +0 -72
- package/dist/server-startup-plugins-CaBj0Nt2.js +0 -127
- package/dist/server-startup-post-attach-B7TcxkmO.js +0 -793
- package/dist/server-ws-runtime-Cxk_CqMr.js +0 -374
- package/dist/server.impl-CQ6dnx43.js +0 -2622
- package/dist/session-cost-usage-GsYDNvka.js +0 -1600
- package/dist/session-kill-http-CKkxZhhd.js +0 -121
- package/dist/session-log-runtime-Bwc2Oijk.js +0 -1258
- package/dist/session-override-CWbKiXiC.js +0 -134
- package/dist/session-reset-model.runtime-CDFMjwWA.js +0 -144
- package/dist/session-reset-service-SE0aK4cw.js +0 -651
- package/dist/session-status.runtime-Df89I7Fk.js +0 -2
- package/dist/session-store-RkvjJPMQ.js +0 -273
- package/dist/session-store.runtime-C7P5asx7.js +0 -4
- package/dist/session-subagent-reactivation.runtime-BhGUZG1Z.js +0 -2
- package/dist/session-tab-registry-9rSuQ0Yz.js +0 -551
- package/dist/session-utils-De8TIM0h.js +0 -1508
- package/dist/sessions-6b9a00Tl.js +0 -1917
- package/dist/sessions-CEPHczjC.js +0 -316
- package/dist/sessions-CEojHc8b.js +0 -12736
- package/dist/sessions-cleanup-BkG7_sq9.js +0 -165
- package/dist/sessions-history-http-BjJEfjJa.js +0 -432
- package/dist/sessions-patch-PwG5sknc.js +0 -401
- package/dist/sessions-resolve-CSIrd_fi.js +0 -180
- package/dist/sessions-table-8CbU7jXa.js +0 -161
- package/dist/sessions.runtime-BYHMD0M7.js +0 -2
- package/dist/set-BJDpe28W.js +0 -31
- package/dist/set-image-CwTFx7PX.js +0 -17
- package/dist/setup-B6LmeIms.js +0 -614
- package/dist/setup-B_zxHfYu.js +0 -2
- package/dist/setup-onboard-configure-help-fast-path-Bck3SKEH.js +0 -64
- package/dist/setup.finalize-CmLYX-Rf.js +0 -586
- package/dist/setup.gateway-config-H_89Msro.js +0 -281
- package/dist/setup.migration-import-DVzyUjX6.js +0 -2
- package/dist/setup.migration-import-DmJpqoqf.js +0 -200
- package/dist/setup.post-install-migration-WPFWKXXg.js +0 -128
- package/dist/shared-CUhu8NTs.js +0 -5
- package/dist/shared-D-BN2JhY.js +0 -71
- package/dist/shared-ES8nDIcn.js +0 -212
- package/dist/simple-completion-runtime-BGZkWvKr.js +0 -206
- package/dist/simple-completion-runtime-CM_IISYW.js +0 -2
- package/dist/simple-completion-transport-Bo0u9dhp.js +0 -83
- package/dist/snapshot-urls-C1KjRQD5.js +0 -317
- package/dist/speech-core-Bas7e4h0.js +0 -119
- package/dist/speech-provider-BonJQv5S.js +0 -227
- package/dist/speech-provider-CwdKQmDv.js +0 -171
- package/dist/speech-provider-DcQRnYhZ.js +0 -233
- package/dist/stale-oauth-profile-shadows-C3aeAWfv.js +0 -186
- package/dist/stale-oauth-profile-shadows-m5rb8dPc.js +0 -2
- package/dist/standalone-runtime-registry-loader-B9n2LBKC.js +0 -59
- package/dist/startup-context-DY7C4riM.js +0 -314
- package/dist/status-6EPKat7p.js +0 -73
- package/dist/status-C6Fa7Dsf.js +0 -2
- package/dist/status-CNnxDQlM.js +0 -4
- package/dist/status-D2Scvbc0.js +0 -3
- package/dist/status-Ducanro3.js +0 -2
- package/dist/status-_XX_6QVA.js +0 -466
- package/dist/status-all-BP1u6vou.js +0 -573
- package/dist/status-json-DPlOJ_ue.js +0 -15
- package/dist/status-json-command-BT7EwVKj.js +0 -84
- package/dist/status-message-Dzr9-MX-.js +0 -495
- package/dist/status-message.runtime-DFezIt1d.js +0 -6
- package/dist/status-prBlcUV5.js +0 -249
- package/dist/status-queue.runtime-C1bmg2rl.js +0 -2
- package/dist/status-runtime-shared-RjKIPEQ0.js +0 -289
- package/dist/status-subagents.runtime-tsCCe4Ny.js +0 -32
- package/dist/status-text-Bkeyg8Bf.js +0 -301
- package/dist/status.command-D06_4ATq.js +0 -425
- package/dist/status.command-dDEZM84a.js +0 -2
- package/dist/status.command.text-runtime-WH9tP7yg.js +0 -15
- package/dist/status.runtime-B76GaBIR.js +0 -2
- package/dist/status.scan-Bc6clx0F.js +0 -72
- package/dist/status.scan-overview-v_-AaFhC.js +0 -460
- package/dist/status.scan.deps.runtime-BkH1HAb4.js +0 -19
- package/dist/status.scan.fast-json-CrlfKKI3.js +0 -2
- package/dist/status.scan.fast-json-D8v6zfP8.js +0 -163
- package/dist/status.summary-DBhvgOPr.js +0 -276
- package/dist/status.summary-hQV0PKFO.js +0 -2
- package/dist/store-BClomp_4.js +0 -3
- package/dist/store-BHqDPtNw.js +0 -2302
- package/dist/stored-model-override-vm4CtQWX.js +0 -79
- package/dist/subagent-announce-D244Q4w2.js +0 -353
- package/dist/subagent-announce-delivery-qKZfF7Bs.js +0 -1369
- package/dist/subagent-control-c87mVGUE.js +0 -492
- package/dist/subagent-control.runtime-DfQtIsDb.js +0 -3
- package/dist/subagent-hooks-B_UW5Len.js +0 -2
- package/dist/subagent-hooks-CYvFWt_r.js +0 -230
- package/dist/subagent-hooks-api-DZgaJf19.js +0 -23
- package/dist/subagent-registry-BlcoCggo.js +0 -2627
- package/dist/subagent-registry-CuObhNeO.js +0 -3
- package/dist/subagent-session-cleanup-hFF8Z34s.js +0 -390
- package/dist/system-CN_Knfqq.js +0 -111
- package/dist/system-prompt-config-BmZlhYK9.js +0 -918
- package/dist/talk-DrjGczYs.js +0 -2454
- package/dist/target-id-BNpbyWkq.js +0 -107
- package/dist/targets-CQcGo6u4.js +0 -267
- package/dist/targets.runtime-DwcxNI-x.js +0 -2
- package/dist/task-executor-CZg-qt4u.js +0 -349
- package/dist/task-owner-access-Duem5jjb.js +0 -74
- package/dist/task-registry-Cw8pc3Ry.js +0 -2362
- package/dist/task-registry-delivery-runtime-HaiKqj0A.js +0 -2
- package/dist/task-registry.maintenance-BLv3wpK9.js +0 -764
- package/dist/task-registry.maintenance-CvlIcxE-.js +0 -2
- package/dist/task-status-access-C5nDJSI4.js +0 -18
- package/dist/tasks-D3CfEAlq.js +0 -548
- package/dist/tasks-WKnE5fvr.js +0 -153
- package/dist/tasks-audit-system-okJjcOjU.js +0 -210
- package/dist/tasks-json-C-iUgWNu.js +0 -73
- package/dist/tavily-web-search-provider.runtime-jpagljrA.js +0 -112
- package/dist/text-report-BTsF3Pv3.js +0 -695
- package/dist/text-transforms.runtime-CgH_pbcQ.js +0 -113
- package/dist/thread-bindings-BWxpUE9U.js +0 -228
- package/dist/tool-DhJbbm91.js +0 -143
- package/dist/tool-dispatch-CpFUfblu.js +0 -155
- package/dist/tool-images-C-tFlXjE.js +0 -247
- package/dist/tool-plugin-3NejWxZW.js +0 -93
- package/dist/tool-resolution-oW8Cbamd.js +0 -153
- package/dist/tool-result-truncation-CWFGf7Eu.js +0 -498
- package/dist/tool-schema-CMtc7PdZ.js +0 -40
- package/dist/tool-schema-projection-DJRPEEvY.js +0 -215
- package/dist/tool-split-E4RdK5jS.js +0 -323
- package/dist/tools-BAl3JiNw.js +0 -901
- package/dist/tools-DC8tCPxR.js +0 -579
- package/dist/tools-catalog-Dzv9zaBD.js +0 -156
- package/dist/tools-effective-CGvzyIL2.js +0 -442
- package/dist/tools-effective-inventory-GI5N5Q9v.js +0 -379
- package/dist/tools-invoke-CU2U0hNH.js +0 -51
- package/dist/tools-invoke-http-8s3FiUy4.js +0 -68
- package/dist/tools-invoke-shared-DIETrEY7.js +0 -200
- package/dist/tools.runtime-Bnm8CI7w.js +0 -5
- package/dist/transcript-rewrite-Buv2ITw4.js +0 -688
- package/dist/transcripts-tool-BCFlLCFd.js +0 -2
- package/dist/transcripts-tool-CWgNd0Uw.js +0 -656
- package/dist/tts-Aguo4zC5.js +0 -3
- package/dist/tts-Bf77cURn.js +0 -2
- package/dist/tts-DnADOKOP.js +0 -194
- package/dist/tts-runtime-MBSH-nOM.js +0 -1337
- package/dist/tts.runtime-B-NR9osE.js +0 -2
- package/dist/tts.runtime-Bo-QxKgx.js +0 -3
- package/dist/tui-B0CdNmCz.js +0 -4860
- package/dist/tui-ByRcXM3Z.js +0 -2
- package/dist/tui-backend-C52BUoZI.js +0 -256
- package/dist/tui-cli-BQHpZ4n0.js +0 -40
- package/dist/typing-policy-XspVOezC.js +0 -199
- package/dist/usage-BOYwzimH.js +0 -1113
- package/dist/usage-BSmLrVWB.js +0 -623
- package/dist/usage-format-CfzICmvv.js +0 -2
- package/dist/usage-format-DPJKCPic.js +0 -394
- package/dist/video-generation-provider-CdCTztQ7.js +0 -77
- package/dist/video-generation-provider-MUUshUzz.js +0 -325
- package/dist/video-generation-provider-XmzzTa6e.js +0 -297
- package/dist/video-generation-provider-weiQUJE5.js +0 -64
- package/dist/web-fetch-providers.runtime-tD9zqAS2.js +0 -41
- package/dist/web-guarded-fetch-CyhQZ1yD.js +0 -2
- package/dist/web-guarded-fetch-DIXHI-yJ.js +0 -58
- package/dist/web-media-BPnTMYE5.js +0 -4
- package/dist/web-media-DV_tCQiQ.js +0 -2
- package/dist/web-media-DYydVGCK.js +0 -651
- package/dist/web-provider-runtime-shared-h3M6Bqyg.js +0 -142
- package/dist/web-search-provider-common-CEYWuDcp.js +0 -252
- package/dist/web-search-providers.runtime-YrayP296.js +0 -41
- /package/dist/{acp-runtime-backend-CHZtaM6t.js → acp-runtime-backend-B83JR5Zf.js} +0 -0
- /package/dist/{agent-turn-attachments-BYCRK86s.js → agent-turn-attachments-D5uJijuK.js} +0 -0
- /package/dist/{auth-install-policy-t46tJ8jV.js → auth-install-policy-BIpdwrZ9.js} +0 -0
- /package/dist/{cli-backends-BHXnrVN_.js → cli-backends-79CCRQ2a.js} +0 -0
- /package/dist/{command-secret-targets-DZ0J2Wm3.js → command-secret-targets-BOJlcBil.js} +0 -0
- /package/dist/{commands-DWp49Exc.js → commands-Dw9hwmVt.js} +0 -0
- /package/dist/{commands-reset-hooks-MMq2dvff.js → commands-reset-hooks-epArfNOY.js} +0 -0
- /package/dist/{delegate-Dkj_5OvH.js → delegate-Bw8NQXVr.js} +0 -0
- /package/dist/{jobs-BGELIHcx.js → jobs-BIOTaq7l.js} +0 -0
- /package/dist/{kimi-web-search-provider-4PlMYsPx.js → kimi-web-search-provider-Bzg_DiXO.js} +0 -0
- /package/dist/{memory-host-search-Ds9GiNpf.js → memory-host-search-Dph0Mq-v.js} +0 -0
- /package/dist/{minimax-web-search-provider-d5gTJUNg.js → minimax-web-search-provider-CETxDkkI.js} +0 -0
- /package/dist/{model-selection-cli-CO6BHPiL.js → model-selection-cli-DizUvxeY.js} +0 -0
- /package/dist/{provider-auth-choice-preference-f7Us6TQL.js → provider-auth-choice-preference-uJn1811S.js} +0 -0
- /package/dist/{runtime-wfO9bV5y.js → runtime-BEVbpIgZ.js} +0 -0
- /package/dist/{runtime-web-tools-B6vr1LZs.js → runtime-web-tools-Bf0aEe-F.js} +0 -0
- /package/dist/{runtime-web-tools-fallback.runtime-Crs7KfH5.js → runtime-web-tools-fallback.runtime-DU6rTj6l.js} +0 -0
- /package/dist/{session-subagent-reactivation-H5Rdwkyy.js → session-subagent-reactivation-Bb5SCi9J.js} +0 -0
- /package/dist/{tavily-web-search-provider-DbdIzpMv.js → tavily-web-search-provider-CIEhV60D.js} +0 -0
|
@@ -0,0 +1,2622 @@
|
|
|
1
|
+
import { c as normalizeOptionalString } from "./string-coerce-DKw2K5wM.js";
|
|
2
|
+
import { n as isVitestRuntimeEnv, r as logAcceptedEnvOption, t as isTruthyEnvValue } from "./env-D3X1qW1U.js";
|
|
3
|
+
import { S as resolveIntegerOption, _ as parseStrictPositiveInteger } from "./number-coercion-D1aDmIZp.js";
|
|
4
|
+
import { a as normalizeStateDirEnv, i as isNixMode } from "./paths-9MqJt9oL.js";
|
|
5
|
+
import { _ as uniqueStrings } from "./string-normalization-B8G0vlWE.js";
|
|
6
|
+
import { _ as sleep } from "./utils-v5zGdVpj.js";
|
|
7
|
+
import { E as runWithDiagnosticTraceContext, _ as createDiagnosticTraceContext, c as isDiagnosticsEnabled, m as setDiagnosticsEnabledForProcess } from "./diagnostic-events-Bwqd0ZOT.js";
|
|
8
|
+
import { r as runtimeForLogger, t as createSubsystemLogger } from "./subsystem-46gngkCY.js";
|
|
9
|
+
import { o as setCurrentPluginMetadataSnapshot } from "./current-plugin-metadata-snapshot-CADL859L.js";
|
|
10
|
+
import { t as clearPluginMetadataLifecycleCaches } from "./plugin-metadata-lifecycle-BqWfg4Sp.js";
|
|
11
|
+
import { o as emitDiagnosticsTimelineEvent, s as isDiagnosticsTimelineEnabled } from "./plugin-metadata-snapshot-DeNMzywg.js";
|
|
12
|
+
import { t as loadBundledPluginPublicArtifactModuleSync } from "./public-surface-loader-BxZUDpzM.js";
|
|
13
|
+
import { t as isContainerEnvironment } from "./container-environment-CNsJSTpY.js";
|
|
14
|
+
import { _ as resolveRequestClientIp, i as isLoopbackHost, m as resolveGatewayListenHosts } from "./net-BK5OVE9D.js";
|
|
15
|
+
import { a as createAuthRateLimiter } from "./auth-rate-limit-DdDWBtkA.js";
|
|
16
|
+
import { n as resolveGatewayAuth } from "./auth-resolve-DQPFGhog.js";
|
|
17
|
+
import { o as isLocalDirectRequest, r as authorizeHttpGatewayConnect } from "./auth-zd4y6lgs.js";
|
|
18
|
+
import { c as promoteConfigSnapshotToLastKnownGood, i as getRuntimeConfig, j as applyConfigOverrides, u as readConfigFileSnapshot, v as registerConfigWriteListener } from "./io-DAZXanmU.js";
|
|
19
|
+
import { v as setRuntimeConfigSnapshot } from "./runtime-snapshot-D93_HOsR.js";
|
|
20
|
+
import { n as isRestartEnabled } from "./commands.flags-BRADB-MQ.js";
|
|
21
|
+
import { t as loadGatewayTlsRuntime$1 } from "./gateway-CFSMSlU7.js";
|
|
22
|
+
import { n as createCoreGatewayMethodDescriptors, r as isCoreGatewayMethodClassified, s as listCoreGatewayMethodNames, t as STARTUP_UNAVAILABLE_GATEWAY_METHODS } from "./core-descriptors-B9yUgJ17.js";
|
|
23
|
+
import { i as READ_SCOPE, n as APPROVALS_SCOPE, o as WRITE_SCOPE, r as PAIRING_SCOPE, t as ADMIN_SCOPE } from "./operator-scopes-DGvgHuOd.js";
|
|
24
|
+
import "./method-scopes-CTk-6mpm.js";
|
|
25
|
+
import { h as setPreRestartDeferralCheck, m as setGatewaySigusr1RestartPolicy } from "./restart-B0jWYC-1.js";
|
|
26
|
+
import { n as readGatewayRestartHandoffSync } from "./restart-handoff-C26ie9Ry.js";
|
|
27
|
+
import { d as pinActivePluginChannelRegistry, f as pinActivePluginHttpRouteRegistry, h as releasePinnedPluginHttpRouteRegistry, m as releasePinnedPluginChannelRegistry } from "./runtime-BxNgD-nn.js";
|
|
28
|
+
import { i as createPluginGatewayMethodDescriptors, n as createGatewayMethodRegistry, t as createGatewayMethodDescriptorsFromHandlers } from "./registry-BQNtQhdh.js";
|
|
29
|
+
import { i as resolveMainSessionKey } from "./main-session-BxJmPEXx.js";
|
|
30
|
+
import { n as getLoadedChannelPluginEntryById, r as listLoadedChannelPlugins } from "./registry-loaded-CP4VA-bv.js";
|
|
31
|
+
import "./sessions-Cs11K_1i.js";
|
|
32
|
+
import { a as enqueueSystemEvent } from "./system-events-DviB_CZO.js";
|
|
33
|
+
import { b as startDiagnosticHeartbeat, x as stopDiagnosticHeartbeat } from "./diagnostic-mK1DfrTJ.js";
|
|
34
|
+
import { i as withDiagnosticPhase } from "./diagnostic-phase-ewqU1V1-.js";
|
|
35
|
+
import { u as getActiveEmbeddedRunCount } from "./run-state-CU3dnr0T.js";
|
|
36
|
+
import { l as getTotalQueueSize } from "./command-queue-DFj-9GVz.js";
|
|
37
|
+
import { o as resolveCronStorePath } from "./store-DvIbNKvA.js";
|
|
38
|
+
import { n as clearSecretsRuntimeSnapshot, o as getActiveSecretsRuntimeSnapshot } from "./runtime-state-BGqiBNuK.js";
|
|
39
|
+
import { o as setFallbackGatewayContextResolver } from "./server-plugins-WBX2fZRp.js";
|
|
40
|
+
import { t as getTotalPendingReplies } from "./dispatcher-registry-CaTZukRA.js";
|
|
41
|
+
import { c as recordGatewayRestartTraceDetail, d as resumeGatewayRestartTraceFromHandoff, i as finishGatewayRestartTrace, l as recordGatewayRestartTraceSpan, n as collectGatewayProcessMemoryUsageMb, u as resumeGatewayRestartTraceFromEnv } from "./restart-trace-Bd5Ldtwf.js";
|
|
42
|
+
import { t as ensureFengMingCliOnPath } from "./path-env-DoFiL3pG.js";
|
|
43
|
+
import { n as logRejectedLargePayload } from "./diagnostic-payload-BP1TpHgP.js";
|
|
44
|
+
import { i as MAX_BUFFERED_BYTES, o as MAX_PREAUTH_PAYLOAD_BYTES } from "./server-constants-BGwLM6XN.js";
|
|
45
|
+
import { s as normalizePluginNodeCapabilityScopedUrl } from "./plugin-node-capability-DH-ae5Gb.js";
|
|
46
|
+
import { i as summarizeAgentEventForWsLog, n as logWs, r as shouldLogWs } from "./ws-log-tuDbcNZH.js";
|
|
47
|
+
import { t as createDefaultDeps } from "./deps-DMtOVZ9f.js";
|
|
48
|
+
import { c as setDefaultSecurityHeaders, r as sendGatewayAuthFailure } from "./http-common-0d25vgIL.js";
|
|
49
|
+
import { t as GatewayLockError } from "./gateway-lock-BzGOimZ4.js";
|
|
50
|
+
import { n as DEFAULT_CHANNEL_STALE_EVENT_THRESHOLD_MS, r as evaluateChannelHealth, t as DEFAULT_CHANNEL_CONNECT_GRACE_MS } from "./channel-health-policy-D_eDwUBm.js";
|
|
51
|
+
import { c as resolveControlUiRootSync, n as isPackageProvenControlUiRootSync, s as resolveControlUiRootOverrideSync, t as ensureControlUiAssetsBuilt } from "./control-ui-assets-B64glIS_.js";
|
|
52
|
+
import { n as ensureControlUiAllowedOriginsForNonLoopbackBind } from "./gateway-control-ui-origins-Cr3qDWBG.js";
|
|
53
|
+
import { n as resolveAssistantIdentity } from "./assistant-identity-YiW3OQ7k.js";
|
|
54
|
+
import { t as resolveSharedGatewaySessionGeneration } from "./ws-shared-generation-Bp5l7wzu.js";
|
|
55
|
+
import { i as getRequiredSharedGatewaySessionGeneration, r as enforceSharedGatewaySessionGenerationForConfigWrite } from "./server-shared-auth-generation-Csm1h6QK.js";
|
|
56
|
+
import { a as createToolEventRecipientRegistry, n as createChatRunState } from "./server-chat-state-B4ta4USz.js";
|
|
57
|
+
import { a as incrementPresenceVersion, i as getPresenceVersion, n as getHealthCache, o as refreshGatewayHealthSnapshot, r as getHealthVersion } from "./health-state-QZ2E6xGQ.js";
|
|
58
|
+
import { t as resolveGatewayPluginConfig } from "./runtime-plugin-config-DawVJP1C.js";
|
|
59
|
+
import { n as applyGatewayLaneConcurrency, t as resolveHookClientIpConfig } from "./hook-client-ip-config-CQnD6lwp.js";
|
|
60
|
+
import { t as GATEWAY_EVENTS } from "./server-methods-list-D8PJ5m-Q.js";
|
|
61
|
+
import { n as isProtectedPluginRoutePathFromContext, r as resolvePluginRoutePathContext } from "./route-match-DdHHDhWl.js";
|
|
62
|
+
import { n as shouldEnforceGatewayAuthForPluginPath } from "./route-auth-2fSSQYKc.js";
|
|
63
|
+
import { t as findMatchingPluginNodeCapabilityRoute } from "./route-capability-DZXc1U_r.js";
|
|
64
|
+
import path from "node:path";
|
|
65
|
+
import { monitorEventLoopDelay, performance } from "node:perf_hooks";
|
|
66
|
+
import { WebSocketServer } from "ws";
|
|
67
|
+
import { createServer } from "node:http";
|
|
68
|
+
import { createServer as createServer$1 } from "node:https";
|
|
69
|
+
//#region src/gateway/plugin-channel-reload-targets.ts
|
|
70
|
+
function addNormalizedTarget(targets, value) {
|
|
71
|
+
const normalized = normalizeOptionalString(value);
|
|
72
|
+
if (normalized) targets.add(normalized);
|
|
73
|
+
}
|
|
74
|
+
function listChannelPluginConfigTargetIds(target) {
|
|
75
|
+
const targets = /* @__PURE__ */ new Set();
|
|
76
|
+
addNormalizedTarget(targets, target.channelId);
|
|
77
|
+
addNormalizedTarget(targets, target.pluginId);
|
|
78
|
+
for (const alias of target.aliases ?? []) addNormalizedTarget(targets, alias);
|
|
79
|
+
return targets;
|
|
80
|
+
}
|
|
81
|
+
function pluginConfigTargetsChanged(targetIds, changedPaths) {
|
|
82
|
+
const prefixes = Array.from(targetIds, (id) => [`plugins.entries.${id}`, `plugins.installs.${id}`]).flat();
|
|
83
|
+
return changedPaths.some((path) => prefixes.some((prefix) => path === prefix || path.startsWith(`${prefix}.`)));
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/gateway/server-control-ui-root.ts
|
|
87
|
+
async function resolveGatewayControlUiRootState(params) {
|
|
88
|
+
if (params.controlUiRootOverride) {
|
|
89
|
+
const resolvedOverride = resolveControlUiRootOverrideSync(params.controlUiRootOverride);
|
|
90
|
+
const resolvedOverridePath = path.resolve(params.controlUiRootOverride);
|
|
91
|
+
if (!resolvedOverride) params.log.warn(`gateway: controlUi.root not found at ${resolvedOverridePath}`);
|
|
92
|
+
return resolvedOverride ? {
|
|
93
|
+
kind: "resolved",
|
|
94
|
+
path: resolvedOverride
|
|
95
|
+
} : {
|
|
96
|
+
kind: "invalid",
|
|
97
|
+
path: resolvedOverridePath
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
if (!params.controlUiEnabled) return;
|
|
101
|
+
const resolveRoot = () => resolveControlUiRootSync({
|
|
102
|
+
moduleUrl: import.meta.url,
|
|
103
|
+
argv1: process.argv[1],
|
|
104
|
+
cwd: process.cwd()
|
|
105
|
+
});
|
|
106
|
+
let resolvedRoot = resolveRoot();
|
|
107
|
+
if (!resolvedRoot) {
|
|
108
|
+
const ensureResult = await ensureControlUiAssetsBuilt(params.gatewayRuntime);
|
|
109
|
+
if (!ensureResult.ok && ensureResult.message) params.log.warn(`gateway: ${ensureResult.message}`);
|
|
110
|
+
resolvedRoot = resolveRoot();
|
|
111
|
+
}
|
|
112
|
+
if (!resolvedRoot) return { kind: "missing" };
|
|
113
|
+
return {
|
|
114
|
+
kind: isPackageProvenControlUiRootSync(resolvedRoot, {
|
|
115
|
+
moduleUrl: import.meta.url,
|
|
116
|
+
argv1: process.argv[1],
|
|
117
|
+
cwd: process.cwd()
|
|
118
|
+
}) ? "bundled" : "resolved",
|
|
119
|
+
path: resolvedRoot
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/gateway/server-cron-lazy.ts
|
|
124
|
+
function createLazyGatewayCronState(params) {
|
|
125
|
+
const storePath = resolveCronStorePath(params.cfg.cron?.store);
|
|
126
|
+
const cronEnabled = process.env.FENGMING_SKIP_CRON !== "1" && params.cfg.cron?.enabled !== false;
|
|
127
|
+
let loaded = null;
|
|
128
|
+
let loading = null;
|
|
129
|
+
let stopped = false;
|
|
130
|
+
const load = async () => {
|
|
131
|
+
if (loaded) return loaded;
|
|
132
|
+
loading ??= import("./server-cron-CLeBvurR.js").then(({ buildGatewayCronService }) => {
|
|
133
|
+
loaded = {
|
|
134
|
+
state: buildGatewayCronService(params),
|
|
135
|
+
started: false
|
|
136
|
+
};
|
|
137
|
+
return loaded;
|
|
138
|
+
});
|
|
139
|
+
return await loading;
|
|
140
|
+
};
|
|
141
|
+
return {
|
|
142
|
+
cron: {
|
|
143
|
+
async start() {
|
|
144
|
+
stopped = false;
|
|
145
|
+
const resolved = await load();
|
|
146
|
+
if (stopped) return;
|
|
147
|
+
if (resolved.started) return;
|
|
148
|
+
resolved.started = true;
|
|
149
|
+
await resolved.state.cron.start();
|
|
150
|
+
if (stopped && resolved.started) {
|
|
151
|
+
resolved.started = false;
|
|
152
|
+
resolved.state.cron.stop();
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
stop() {
|
|
156
|
+
stopped = true;
|
|
157
|
+
if (loaded) {
|
|
158
|
+
loaded.started = false;
|
|
159
|
+
loaded.state.cron.stop();
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (loading) loading.then((resolved) => {
|
|
163
|
+
if (!stopped) return;
|
|
164
|
+
resolved.started = false;
|
|
165
|
+
resolved.state.cron.stop();
|
|
166
|
+
}).catch(() => {});
|
|
167
|
+
},
|
|
168
|
+
async status() {
|
|
169
|
+
return await (await load()).state.cron.status();
|
|
170
|
+
},
|
|
171
|
+
async list(opts) {
|
|
172
|
+
return await (await load()).state.cron.list(opts);
|
|
173
|
+
},
|
|
174
|
+
async listPage(opts) {
|
|
175
|
+
return await (await load()).state.cron.listPage(opts);
|
|
176
|
+
},
|
|
177
|
+
async add(input) {
|
|
178
|
+
return await (await load()).state.cron.add(input);
|
|
179
|
+
},
|
|
180
|
+
async update(id, patch) {
|
|
181
|
+
return await (await load()).state.cron.update(id, patch);
|
|
182
|
+
},
|
|
183
|
+
async remove(id) {
|
|
184
|
+
return await (await load()).state.cron.remove(id);
|
|
185
|
+
},
|
|
186
|
+
async run(id, mode) {
|
|
187
|
+
return await (await load()).state.cron.run(id, mode);
|
|
188
|
+
},
|
|
189
|
+
async enqueueRun(id, mode) {
|
|
190
|
+
return await (await load()).state.cron.enqueueRun(id, mode);
|
|
191
|
+
},
|
|
192
|
+
getJob(id) {
|
|
193
|
+
if (!loaded) return;
|
|
194
|
+
return loaded.state.cron.getJob(id);
|
|
195
|
+
},
|
|
196
|
+
async readJob(id) {
|
|
197
|
+
return await (await load()).state.cron.readJob(id);
|
|
198
|
+
},
|
|
199
|
+
getDefaultAgentId() {
|
|
200
|
+
if (!loaded) return;
|
|
201
|
+
return loaded.state.cron.getDefaultAgentId();
|
|
202
|
+
},
|
|
203
|
+
wake(opts) {
|
|
204
|
+
if (!loaded) {
|
|
205
|
+
load();
|
|
206
|
+
return { ok: false };
|
|
207
|
+
}
|
|
208
|
+
return loaded.state.cron.wake(opts);
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
storePath,
|
|
212
|
+
cronEnabled
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region src/gateway/server-runtime-handles.ts
|
|
217
|
+
function createGatewayServerMutableState() {
|
|
218
|
+
const noopInterval = () => {
|
|
219
|
+
const timer = setInterval(() => {}, 1 << 30);
|
|
220
|
+
timer.unref?.();
|
|
221
|
+
return timer;
|
|
222
|
+
};
|
|
223
|
+
return {
|
|
224
|
+
bonjourStop: null,
|
|
225
|
+
tickInterval: noopInterval(),
|
|
226
|
+
healthInterval: noopInterval(),
|
|
227
|
+
dedupeCleanup: noopInterval(),
|
|
228
|
+
mediaCleanup: null,
|
|
229
|
+
heartbeatRunner: {
|
|
230
|
+
stop: () => {},
|
|
231
|
+
updateConfig: (_cfg) => {}
|
|
232
|
+
},
|
|
233
|
+
stopGatewayUpdateCheck: () => {},
|
|
234
|
+
tailscaleCleanup: null,
|
|
235
|
+
postReadySidecars: [],
|
|
236
|
+
gatewayLifetimeSidecars: [],
|
|
237
|
+
skillsRefreshTimer: null,
|
|
238
|
+
skillsRefreshDelayMs: 3e4,
|
|
239
|
+
skillsChangeUnsub: () => {},
|
|
240
|
+
channelHealthMonitor: null,
|
|
241
|
+
stopModelPricingRefresh: () => {},
|
|
242
|
+
mcpServer: void 0,
|
|
243
|
+
configReloader: { stop: async () => {} },
|
|
244
|
+
agentUnsub: null,
|
|
245
|
+
heartbeatUnsub: null,
|
|
246
|
+
transcriptUnsub: null,
|
|
247
|
+
lifecycleUnsub: null
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region src/gateway/server-live-state.ts
|
|
252
|
+
function createGatewayServerLiveState(params) {
|
|
253
|
+
return {
|
|
254
|
+
...createGatewayServerMutableState(),
|
|
255
|
+
hooksConfig: params.hooksConfig,
|
|
256
|
+
hookClientIpConfig: params.hookClientIpConfig,
|
|
257
|
+
cronState: params.cronState,
|
|
258
|
+
pluginServices: null,
|
|
259
|
+
gatewayMethods: params.gatewayMethods
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
//#endregion
|
|
263
|
+
//#region src/gateway/server-broadcast.ts
|
|
264
|
+
const EVENT_SCOPE_GUARDS = {
|
|
265
|
+
agent: [READ_SCOPE],
|
|
266
|
+
chat: [READ_SCOPE],
|
|
267
|
+
"chat.side_result": [READ_SCOPE],
|
|
268
|
+
cron: [READ_SCOPE],
|
|
269
|
+
health: [],
|
|
270
|
+
"exec.approval.requested": [APPROVALS_SCOPE],
|
|
271
|
+
"exec.approval.resolved": [APPROVALS_SCOPE],
|
|
272
|
+
heartbeat: [],
|
|
273
|
+
"plugin.approval.requested": [APPROVALS_SCOPE],
|
|
274
|
+
"plugin.approval.resolved": [APPROVALS_SCOPE],
|
|
275
|
+
presence: [],
|
|
276
|
+
shutdown: [],
|
|
277
|
+
tick: [],
|
|
278
|
+
"talk.event": [READ_SCOPE],
|
|
279
|
+
"talk.mode": [WRITE_SCOPE],
|
|
280
|
+
"update.available": [],
|
|
281
|
+
"voicewake.changed": [READ_SCOPE],
|
|
282
|
+
"voicewake.routing.changed": [READ_SCOPE],
|
|
283
|
+
"device.pair.requested": [PAIRING_SCOPE],
|
|
284
|
+
"device.pair.resolved": [PAIRING_SCOPE],
|
|
285
|
+
"node.pair.requested": [PAIRING_SCOPE],
|
|
286
|
+
"node.pair.resolved": [PAIRING_SCOPE],
|
|
287
|
+
"sessions.changed": [READ_SCOPE],
|
|
288
|
+
"session.message": [READ_SCOPE],
|
|
289
|
+
"session.operation": [READ_SCOPE],
|
|
290
|
+
"session.tool": [READ_SCOPE]
|
|
291
|
+
};
|
|
292
|
+
const NODE_ALLOWED_EVENTS = new Set(["voicewake.changed", "voicewake.routing.changed"]);
|
|
293
|
+
function serializeFrameField(name, value) {
|
|
294
|
+
const fieldJSON = JSON.stringify({ [name]: value });
|
|
295
|
+
const keyJSON = JSON.stringify(name);
|
|
296
|
+
const prefix = `{${keyJSON}:`;
|
|
297
|
+
return fieldJSON.startsWith(prefix) ? `,${keyJSON}:${fieldJSON.slice(prefix.length, -1)}` : "";
|
|
298
|
+
}
|
|
299
|
+
function hasEventScope(client, event) {
|
|
300
|
+
const required = EVENT_SCOPE_GUARDS[event];
|
|
301
|
+
if (!required && event.startsWith("plugin.")) {
|
|
302
|
+
if ((client.connect.role ?? "operator") !== "operator") return false;
|
|
303
|
+
const scopes = Array.isArray(client.connect.scopes) ? client.connect.scopes : [];
|
|
304
|
+
return scopes.includes("operator.write") || scopes.includes("operator.admin");
|
|
305
|
+
}
|
|
306
|
+
if (!required) return false;
|
|
307
|
+
if (required.length === 0) return true;
|
|
308
|
+
const role = client.connect.role ?? "operator";
|
|
309
|
+
if (role !== "operator") return role === "node" && NODE_ALLOWED_EVENTS.has(event);
|
|
310
|
+
const scopes = Array.isArray(client.connect.scopes) ? client.connect.scopes : [];
|
|
311
|
+
if (scopes.includes("operator.admin")) return true;
|
|
312
|
+
if (required.includes("operator.read")) return scopes.includes("operator.read") || scopes.includes("operator.write");
|
|
313
|
+
return required.some((scope) => scopes.includes(scope));
|
|
314
|
+
}
|
|
315
|
+
function createGatewayBroadcaster(params) {
|
|
316
|
+
const clientSeq = /* @__PURE__ */ new WeakMap();
|
|
317
|
+
const reportedSlowPayloadClients = /* @__PURE__ */ new WeakSet();
|
|
318
|
+
const broadcastInternal = (event, payload, opts, targetConnIds) => {
|
|
319
|
+
if (params.clients.size === 0) return;
|
|
320
|
+
const isTargeted = Boolean(targetConnIds);
|
|
321
|
+
if (shouldLogWs()) {
|
|
322
|
+
const logMeta = {
|
|
323
|
+
event,
|
|
324
|
+
seq: isTargeted ? "targeted" : "per-client",
|
|
325
|
+
clients: params.clients.size,
|
|
326
|
+
targets: targetConnIds ? targetConnIds.size : void 0,
|
|
327
|
+
dropIfSlow: opts?.dropIfSlow,
|
|
328
|
+
presenceVersion: opts?.stateVersion?.presence,
|
|
329
|
+
healthVersion: opts?.stateVersion?.health
|
|
330
|
+
};
|
|
331
|
+
if (event === "agent") Object.assign(logMeta, summarizeAgentEventForWsLog(payload));
|
|
332
|
+
logWs("out", "event", logMeta);
|
|
333
|
+
}
|
|
334
|
+
let frameBase;
|
|
335
|
+
const getFrameBase = () => {
|
|
336
|
+
if (!frameBase) frameBase = {
|
|
337
|
+
eventJSON: JSON.stringify(event),
|
|
338
|
+
payloadFragment: serializeFrameField("payload", payload),
|
|
339
|
+
stateVersionFragment: opts?.stateVersion === void 0 ? "" : serializeFrameField("stateVersion", opts.stateVersion)
|
|
340
|
+
};
|
|
341
|
+
return frameBase;
|
|
342
|
+
};
|
|
343
|
+
for (const c of params.clients) {
|
|
344
|
+
if (targetConnIds && !targetConnIds.has(c.connId)) continue;
|
|
345
|
+
if (!hasEventScope(c, event)) continue;
|
|
346
|
+
const nextSeq = (clientSeq.get(c) ?? 0) + 1;
|
|
347
|
+
const slow = c.socket.bufferedAmount > MAX_BUFFERED_BYTES;
|
|
348
|
+
if (!slow) reportedSlowPayloadClients.delete(c);
|
|
349
|
+
else if (!reportedSlowPayloadClients.has(c)) {
|
|
350
|
+
reportedSlowPayloadClients.add(c);
|
|
351
|
+
logRejectedLargePayload({
|
|
352
|
+
surface: "gateway.ws.outbound_buffer",
|
|
353
|
+
bytes: c.socket.bufferedAmount,
|
|
354
|
+
limitBytes: MAX_BUFFERED_BYTES,
|
|
355
|
+
reason: opts?.dropIfSlow ? "ws_send_buffer_drop" : "ws_send_buffer_close"
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
if (slow && opts?.dropIfSlow) {
|
|
359
|
+
if (!isTargeted) clientSeq.set(c, nextSeq);
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
if (slow) {
|
|
363
|
+
try {
|
|
364
|
+
c.socket.close(1008, "slow consumer");
|
|
365
|
+
} catch {}
|
|
366
|
+
continue;
|
|
367
|
+
}
|
|
368
|
+
try {
|
|
369
|
+
const eventSeq = isTargeted ? void 0 : nextSeq;
|
|
370
|
+
if (!isTargeted) clientSeq.set(c, nextSeq);
|
|
371
|
+
const base = getFrameBase();
|
|
372
|
+
const seqFragment = eventSeq === void 0 ? "" : `,"seq":${eventSeq}`;
|
|
373
|
+
const frame = `{"type":"event","event":${base.eventJSON}${base.payloadFragment}${seqFragment}${base.stateVersionFragment}}`;
|
|
374
|
+
c.socket.send(frame);
|
|
375
|
+
} catch {}
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
const broadcast = (event, payload, opts) => broadcastInternal(event, payload, opts);
|
|
379
|
+
const broadcastToConnIds = (event, payload, connIds, opts) => {
|
|
380
|
+
if (connIds.size === 0) return;
|
|
381
|
+
broadcastInternal(event, payload, opts, connIds);
|
|
382
|
+
};
|
|
383
|
+
return {
|
|
384
|
+
broadcast,
|
|
385
|
+
broadcastToConnIds
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
//#endregion
|
|
389
|
+
//#region src/channels/plugins/gateway-auth-bypass.ts
|
|
390
|
+
const GATEWAY_AUTH_API_ARTIFACT_BASENAME = "gateway-auth-api.js";
|
|
391
|
+
const MISSING_PUBLIC_SURFACE_PREFIX = "Unable to resolve bundled plugin public surface ";
|
|
392
|
+
function loadBundledChannelGatewayAuthApi(channelId) {
|
|
393
|
+
try {
|
|
394
|
+
return loadBundledPluginPublicArtifactModuleSync({
|
|
395
|
+
dirName: channelId,
|
|
396
|
+
artifactBasename: GATEWAY_AUTH_API_ARTIFACT_BASENAME
|
|
397
|
+
});
|
|
398
|
+
} catch (error) {
|
|
399
|
+
if (error instanceof Error && error.message.startsWith(MISSING_PUBLIC_SURFACE_PREFIX)) return;
|
|
400
|
+
throw error;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
function resolveBundledChannelGatewayAuthBypassPaths(params) {
|
|
404
|
+
return (loadBundledChannelGatewayAuthApi(params.channelId)?.resolveGatewayAuthBypassPaths?.({ cfg: params.cfg }) ?? []).flatMap((path) => typeof path === "string" && path.trim() ? [path.trim()] : []);
|
|
405
|
+
}
|
|
406
|
+
//#endregion
|
|
407
|
+
//#region src/gateway/server-http.ts
|
|
408
|
+
let identityAvatarModulePromise;
|
|
409
|
+
let controlUiModulePromise;
|
|
410
|
+
let embeddingsHttpModulePromise;
|
|
411
|
+
let managedImageAttachmentsModulePromise;
|
|
412
|
+
let modelsHttpModulePromise;
|
|
413
|
+
let openAiHttpModulePromise;
|
|
414
|
+
let openResponsesHttpModulePromise;
|
|
415
|
+
let sessionHistoryHttpModulePromise;
|
|
416
|
+
let sessionKillHttpModulePromise;
|
|
417
|
+
let toolsInvokeHttpModulePromise;
|
|
418
|
+
let pluginNodeCapabilityAuthModulePromise;
|
|
419
|
+
let httpAuthUtilsModulePromise;
|
|
420
|
+
let pluginRouteRuntimeScopesModulePromise;
|
|
421
|
+
function getIdentityAvatarModule() {
|
|
422
|
+
identityAvatarModulePromise ??= import("./identity-avatar-D3wuGITa.js");
|
|
423
|
+
return identityAvatarModulePromise;
|
|
424
|
+
}
|
|
425
|
+
function getControlUiModule() {
|
|
426
|
+
controlUiModulePromise ??= import("./control-ui-AkRMsk9S.js");
|
|
427
|
+
return controlUiModulePromise;
|
|
428
|
+
}
|
|
429
|
+
function getEmbeddingsHttpModule() {
|
|
430
|
+
embeddingsHttpModulePromise ??= import("./embeddings-http-BQnlTr-1.js");
|
|
431
|
+
return embeddingsHttpModulePromise;
|
|
432
|
+
}
|
|
433
|
+
function getManagedImageAttachmentsModule() {
|
|
434
|
+
managedImageAttachmentsModulePromise ??= import("./managed-image-attachments-BTBBHlKl.js");
|
|
435
|
+
return managedImageAttachmentsModulePromise;
|
|
436
|
+
}
|
|
437
|
+
function getModelsHttpModule() {
|
|
438
|
+
modelsHttpModulePromise ??= import("./models-http-jLFnelH7.js");
|
|
439
|
+
return modelsHttpModulePromise;
|
|
440
|
+
}
|
|
441
|
+
function getOpenAiHttpModule() {
|
|
442
|
+
openAiHttpModulePromise ??= import("./openai-http-mTQB44gu.js");
|
|
443
|
+
return openAiHttpModulePromise;
|
|
444
|
+
}
|
|
445
|
+
function getOpenResponsesHttpModule() {
|
|
446
|
+
openResponsesHttpModulePromise ??= import("./openresponses-http-BA1Shmj-.js");
|
|
447
|
+
return openResponsesHttpModulePromise;
|
|
448
|
+
}
|
|
449
|
+
function getSessionHistoryHttpModule() {
|
|
450
|
+
sessionHistoryHttpModulePromise ??= import("./sessions-history-http-CjyHWYEv.js");
|
|
451
|
+
return sessionHistoryHttpModulePromise;
|
|
452
|
+
}
|
|
453
|
+
function getSessionKillHttpModule() {
|
|
454
|
+
sessionKillHttpModulePromise ??= import("./session-kill-http-DVleb3RW.js");
|
|
455
|
+
return sessionKillHttpModulePromise;
|
|
456
|
+
}
|
|
457
|
+
function getToolsInvokeHttpModule() {
|
|
458
|
+
toolsInvokeHttpModulePromise ??= import("./tools-invoke-http-D7PbsODz.js");
|
|
459
|
+
return toolsInvokeHttpModulePromise;
|
|
460
|
+
}
|
|
461
|
+
function getPluginNodeCapabilityAuthModule() {
|
|
462
|
+
pluginNodeCapabilityAuthModulePromise ??= import("./plugin-node-capability-auth-DUzf2YYt.js");
|
|
463
|
+
return pluginNodeCapabilityAuthModulePromise;
|
|
464
|
+
}
|
|
465
|
+
function getHttpAuthUtilsModule() {
|
|
466
|
+
httpAuthUtilsModulePromise ??= import("./http-auth-utils-DuHo4z80.js");
|
|
467
|
+
return httpAuthUtilsModulePromise;
|
|
468
|
+
}
|
|
469
|
+
function getPluginRouteRuntimeScopesModule() {
|
|
470
|
+
pluginRouteRuntimeScopesModulePromise ??= import("./plugin-route-runtime-scopes-Da58QYD9.js");
|
|
471
|
+
return pluginRouteRuntimeScopesModulePromise;
|
|
472
|
+
}
|
|
473
|
+
const GATEWAY_PROBE_STATUS_BY_PATH = new Map([
|
|
474
|
+
["/health", "live"],
|
|
475
|
+
["/healthz", "live"],
|
|
476
|
+
["/ready", "ready"],
|
|
477
|
+
["/readyz", "ready"]
|
|
478
|
+
]);
|
|
479
|
+
const pluginGatewayAuthBypassPathsCache = /* @__PURE__ */ new WeakMap();
|
|
480
|
+
async function resolvePluginGatewayAuthBypassPaths(configSnapshot) {
|
|
481
|
+
const paths = /* @__PURE__ */ new Set();
|
|
482
|
+
const configuredChannels = configSnapshot.channels;
|
|
483
|
+
if (!configuredChannels || Object.keys(configuredChannels).length === 0) return paths;
|
|
484
|
+
for (const channelId of Object.keys(configuredChannels)) for (const path of resolveBundledChannelGatewayAuthBypassPaths({
|
|
485
|
+
channelId,
|
|
486
|
+
cfg: configSnapshot
|
|
487
|
+
})) paths.add(path);
|
|
488
|
+
return paths;
|
|
489
|
+
}
|
|
490
|
+
function getCachedPluginGatewayAuthBypassPaths(configSnapshot) {
|
|
491
|
+
const cached = pluginGatewayAuthBypassPathsCache.get(configSnapshot);
|
|
492
|
+
if (cached) return cached;
|
|
493
|
+
const resolved = resolvePluginGatewayAuthBypassPaths(configSnapshot).catch((error) => {
|
|
494
|
+
pluginGatewayAuthBypassPathsCache.delete(configSnapshot);
|
|
495
|
+
throw error;
|
|
496
|
+
});
|
|
497
|
+
pluginGatewayAuthBypassPathsCache.set(configSnapshot, resolved);
|
|
498
|
+
return resolved;
|
|
499
|
+
}
|
|
500
|
+
function isOpenAiModelsPath(pathname) {
|
|
501
|
+
return pathname === "/v1/models" || pathname.startsWith("/v1/models/");
|
|
502
|
+
}
|
|
503
|
+
function isEmbeddingsPath(pathname) {
|
|
504
|
+
return pathname === "/v1/embeddings";
|
|
505
|
+
}
|
|
506
|
+
function isOpenAiChatCompletionsPath(pathname) {
|
|
507
|
+
return pathname === "/v1/chat/completions";
|
|
508
|
+
}
|
|
509
|
+
function isOpenResponsesPath(pathname) {
|
|
510
|
+
return pathname === "/v1/responses";
|
|
511
|
+
}
|
|
512
|
+
function isToolsInvokePath(pathname) {
|
|
513
|
+
return pathname === "/tools/invoke";
|
|
514
|
+
}
|
|
515
|
+
function isManagedOutgoingImagePath(pathname) {
|
|
516
|
+
return pathname.startsWith("/api/chat/media/outgoing/");
|
|
517
|
+
}
|
|
518
|
+
function isSessionKillPath(pathname) {
|
|
519
|
+
return /^\/sessions\/[^/]+\/kill$/.test(pathname);
|
|
520
|
+
}
|
|
521
|
+
function isSessionHistoryPath(pathname) {
|
|
522
|
+
return /^\/sessions\/[^/]+\/history$/.test(pathname);
|
|
523
|
+
}
|
|
524
|
+
function shouldEnforceDefaultPluginGatewayAuth(pathContext) {
|
|
525
|
+
return pathContext.malformedEncoding || pathContext.decodePassLimitReached || isProtectedPluginRoutePathFromContext(pathContext);
|
|
526
|
+
}
|
|
527
|
+
async function canRevealReadinessDetails(params) {
|
|
528
|
+
if (isLocalDirectRequest(params.req, params.trustedProxies, params.allowRealIpFallback)) return true;
|
|
529
|
+
if (params.resolvedAuth.mode === "none") return false;
|
|
530
|
+
const { getBearerToken, resolveHttpBrowserOriginPolicy } = await getHttpAuthUtilsModule();
|
|
531
|
+
const bearerToken = getBearerToken(params.req);
|
|
532
|
+
return (await authorizeHttpGatewayConnect({
|
|
533
|
+
auth: params.resolvedAuth,
|
|
534
|
+
connectAuth: bearerToken ? {
|
|
535
|
+
token: bearerToken,
|
|
536
|
+
password: bearerToken
|
|
537
|
+
} : null,
|
|
538
|
+
req: params.req,
|
|
539
|
+
trustedProxies: params.trustedProxies,
|
|
540
|
+
allowRealIpFallback: params.allowRealIpFallback,
|
|
541
|
+
browserOriginPolicy: resolveHttpBrowserOriginPolicy(params.req)
|
|
542
|
+
})).ok;
|
|
543
|
+
}
|
|
544
|
+
async function handleGatewayProbeRequest(req, res, requestPath, resolvedAuth, trustedProxies, allowRealIpFallback, getReadiness) {
|
|
545
|
+
const status = GATEWAY_PROBE_STATUS_BY_PATH.get(requestPath);
|
|
546
|
+
if (!status) return false;
|
|
547
|
+
const method = (req.method ?? "GET").toUpperCase();
|
|
548
|
+
if (method !== "GET" && method !== "HEAD") {
|
|
549
|
+
res.statusCode = 405;
|
|
550
|
+
res.setHeader("Allow", "GET, HEAD");
|
|
551
|
+
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
552
|
+
res.end("Method Not Allowed");
|
|
553
|
+
return true;
|
|
554
|
+
}
|
|
555
|
+
res.setHeader("Content-Type", "application/json; charset=utf-8");
|
|
556
|
+
res.setHeader("Cache-Control", "no-store");
|
|
557
|
+
let statusCode;
|
|
558
|
+
let body;
|
|
559
|
+
if (status === "ready" && getReadiness) {
|
|
560
|
+
const includeDetails = await canRevealReadinessDetails({
|
|
561
|
+
req,
|
|
562
|
+
resolvedAuth,
|
|
563
|
+
trustedProxies,
|
|
564
|
+
allowRealIpFallback
|
|
565
|
+
});
|
|
566
|
+
try {
|
|
567
|
+
const result = getReadiness();
|
|
568
|
+
statusCode = result.ready ? 200 : 503;
|
|
569
|
+
body = JSON.stringify(includeDetails ? result : { ready: result.ready });
|
|
570
|
+
} catch {
|
|
571
|
+
statusCode = 503;
|
|
572
|
+
body = JSON.stringify(includeDetails ? {
|
|
573
|
+
ready: false,
|
|
574
|
+
failing: ["internal"],
|
|
575
|
+
uptimeMs: 0
|
|
576
|
+
} : { ready: false });
|
|
577
|
+
}
|
|
578
|
+
} else {
|
|
579
|
+
statusCode = 200;
|
|
580
|
+
body = JSON.stringify({
|
|
581
|
+
ok: true,
|
|
582
|
+
status
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
res.statusCode = statusCode;
|
|
586
|
+
res.end(method === "HEAD" ? void 0 : body);
|
|
587
|
+
return true;
|
|
588
|
+
}
|
|
589
|
+
function writeUpgradeAuthFailure(socket, auth) {
|
|
590
|
+
if (auth.rateLimited) {
|
|
591
|
+
const retryAfterSeconds = auth.retryAfterMs && auth.retryAfterMs > 0 ? Math.ceil(auth.retryAfterMs / 1e3) : void 0;
|
|
592
|
+
socket.write([
|
|
593
|
+
"HTTP/1.1 429 Too Many Requests",
|
|
594
|
+
retryAfterSeconds ? `Retry-After: ${retryAfterSeconds}` : void 0,
|
|
595
|
+
"Content-Type: application/json; charset=utf-8",
|
|
596
|
+
"Connection: close",
|
|
597
|
+
"",
|
|
598
|
+
JSON.stringify({ error: {
|
|
599
|
+
message: "Too many failed authentication attempts. Please try again later.",
|
|
600
|
+
type: "rate_limited"
|
|
601
|
+
} })
|
|
602
|
+
].filter(Boolean).join("\r\n"));
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
socket.write("HTTP/1.1 401 Unauthorized\r\nConnection: close\r\n\r\n");
|
|
606
|
+
}
|
|
607
|
+
function writeUpgradeServiceUnavailable(socket, body) {
|
|
608
|
+
socket.write(`HTTP/1.1 503 Service Unavailable\r
|
|
609
|
+
Connection: close\r
|
|
610
|
+
Content-Type: text/plain; charset=utf-8\r
|
|
611
|
+
Content-Length: ${Buffer.byteLength(body, "utf8")}\r\n\r
|
|
612
|
+
` + body);
|
|
613
|
+
}
|
|
614
|
+
function parseGatewayRequestPath(rawUrl) {
|
|
615
|
+
try {
|
|
616
|
+
return new URL(rawUrl ?? "/", "http://localhost").pathname;
|
|
617
|
+
} catch {
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
async function runGatewayHttpRequestStages(stages) {
|
|
622
|
+
for (const stage of stages) try {
|
|
623
|
+
if (await stage.run()) return true;
|
|
624
|
+
} catch (err) {
|
|
625
|
+
if (!stage.continueOnError) throw err;
|
|
626
|
+
console.error(`[gateway-http] stage "${stage.name}" threw — skipping:`, err);
|
|
627
|
+
}
|
|
628
|
+
return false;
|
|
629
|
+
}
|
|
630
|
+
function buildPluginRequestStages(params) {
|
|
631
|
+
if (!params.handlePluginRequest) return [];
|
|
632
|
+
let pluginGatewayAuthSatisfied = false;
|
|
633
|
+
let pluginGatewayRequestAuth;
|
|
634
|
+
let pluginRequestOperatorScopes;
|
|
635
|
+
return [{
|
|
636
|
+
name: "plugin-auth",
|
|
637
|
+
run: async () => {
|
|
638
|
+
const pathContext = params.pluginPathContext ?? resolvePluginRoutePathContext(params.requestPath);
|
|
639
|
+
if (!(params.shouldEnforcePluginGatewayAuth ?? shouldEnforceDefaultPluginGatewayAuth)(pathContext)) return false;
|
|
640
|
+
if ((await params.getGatewayAuthBypassPaths()).has(params.requestPath)) return false;
|
|
641
|
+
const { authorizeGatewayHttpRequestOrReply } = await getHttpAuthUtilsModule();
|
|
642
|
+
const requestAuth = await authorizeGatewayHttpRequestOrReply({
|
|
643
|
+
req: params.req,
|
|
644
|
+
res: params.res,
|
|
645
|
+
auth: params.resolvedAuth,
|
|
646
|
+
trustedProxies: params.trustedProxies,
|
|
647
|
+
allowRealIpFallback: params.allowRealIpFallback,
|
|
648
|
+
rateLimiter: params.rateLimiter
|
|
649
|
+
});
|
|
650
|
+
if (!requestAuth) return true;
|
|
651
|
+
pluginGatewayAuthSatisfied = true;
|
|
652
|
+
pluginGatewayRequestAuth = requestAuth;
|
|
653
|
+
const { resolvePluginRouteRuntimeOperatorScopes } = await getPluginRouteRuntimeScopesModule();
|
|
654
|
+
pluginRequestOperatorScopes = resolvePluginRouteRuntimeOperatorScopes(params.req, requestAuth);
|
|
655
|
+
return false;
|
|
656
|
+
}
|
|
657
|
+
}, {
|
|
658
|
+
name: "plugin-http",
|
|
659
|
+
continueOnError: true,
|
|
660
|
+
run: () => {
|
|
661
|
+
const pathContext = params.pluginPathContext ?? resolvePluginRoutePathContext(params.requestPath);
|
|
662
|
+
return params.handlePluginRequest?.(params.req, params.res, pathContext, {
|
|
663
|
+
gatewayAuthSatisfied: pluginGatewayAuthSatisfied,
|
|
664
|
+
gatewayRequestAuth: pluginGatewayRequestAuth,
|
|
665
|
+
gatewayRequestOperatorScopes: pluginRequestOperatorScopes
|
|
666
|
+
}) ?? false;
|
|
667
|
+
}
|
|
668
|
+
}];
|
|
669
|
+
}
|
|
670
|
+
function createGatewayHttpServer(opts) {
|
|
671
|
+
const { clients, controlUiEnabled, controlUiBasePath, controlUiRoot, openAiChatCompletionsEnabled, openAiChatCompletionsConfig, openResponsesEnabled, openResponsesConfig, strictTransportSecurityHeader, handleHooksRequest, handlePluginRequest, shouldEnforcePluginGatewayAuth, resolvePluginNodeCapabilityRoute, resolvedAuth, rateLimiter, getReadiness } = opts;
|
|
672
|
+
const getResolvedAuth = opts.getResolvedAuth ?? (() => resolvedAuth);
|
|
673
|
+
const loadGatewayConfig = opts.getRuntimeConfig ?? getRuntimeConfig;
|
|
674
|
+
const openAiCompatEnabled = openAiChatCompletionsEnabled || openResponsesEnabled;
|
|
675
|
+
const httpServer = opts.tlsOptions ? createServer$1(opts.tlsOptions, (req, res) => {
|
|
676
|
+
handleRequestWithTrace(req, res);
|
|
677
|
+
}) : createServer((req, res) => {
|
|
678
|
+
handleRequestWithTrace(req, res);
|
|
679
|
+
});
|
|
680
|
+
function handleRequestWithTrace(req, res) {
|
|
681
|
+
return runWithDiagnosticTraceContext(createDiagnosticTraceContext(), () => handleRequest(req, res));
|
|
682
|
+
}
|
|
683
|
+
async function handleRequest(req, res) {
|
|
684
|
+
setDefaultSecurityHeaders(res, { strictTransportSecurity: strictTransportSecurityHeader });
|
|
685
|
+
if ((req.headers.upgrade ?? "").toLowerCase() === "websocket") return;
|
|
686
|
+
try {
|
|
687
|
+
const requestPath = parseGatewayRequestPath(req.url);
|
|
688
|
+
if (requestPath === void 0) {
|
|
689
|
+
sendGatewayAuthFailure(res, {
|
|
690
|
+
ok: false,
|
|
691
|
+
reason: "unauthorized"
|
|
692
|
+
});
|
|
693
|
+
return;
|
|
694
|
+
}
|
|
695
|
+
if (GATEWAY_PROBE_STATUS_BY_PATH.get(requestPath) === "live") {
|
|
696
|
+
await handleGatewayProbeRequest(req, res, requestPath, getResolvedAuth(), [], false, getReadiness);
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
const configSnapshot = loadGatewayConfig();
|
|
700
|
+
const trustedProxies = configSnapshot.gateway?.trustedProxies ?? [];
|
|
701
|
+
const allowRealIpFallback = configSnapshot.gateway?.allowRealIpFallback === true;
|
|
702
|
+
const scopedNodeCapability = normalizePluginNodeCapabilityScopedUrl(req.url ?? "/");
|
|
703
|
+
if (scopedNodeCapability.malformedScopedPath) {
|
|
704
|
+
sendGatewayAuthFailure(res, {
|
|
705
|
+
ok: false,
|
|
706
|
+
reason: "unauthorized"
|
|
707
|
+
});
|
|
708
|
+
return;
|
|
709
|
+
}
|
|
710
|
+
if (scopedNodeCapability.rewrittenUrl) req.url = scopedNodeCapability.rewrittenUrl;
|
|
711
|
+
const scopedRequestPath = scopedNodeCapability.pathname;
|
|
712
|
+
const pluginPathContext = handlePluginRequest ? resolvePluginRoutePathContext(scopedRequestPath) : null;
|
|
713
|
+
const resolvedAuth = getResolvedAuth();
|
|
714
|
+
const requestStages = [{
|
|
715
|
+
name: "gateway-probes",
|
|
716
|
+
run: () => handleGatewayProbeRequest(req, res, scopedRequestPath, resolvedAuth, trustedProxies, allowRealIpFallback, getReadiness)
|
|
717
|
+
}, {
|
|
718
|
+
name: "hooks",
|
|
719
|
+
run: () => handleHooksRequest(req, res)
|
|
720
|
+
}];
|
|
721
|
+
if (openAiCompatEnabled && isOpenAiModelsPath(scopedRequestPath)) requestStages.push({
|
|
722
|
+
name: "models",
|
|
723
|
+
run: async () => (await getModelsHttpModule()).handleOpenAiModelsHttpRequest(req, res, {
|
|
724
|
+
auth: resolvedAuth,
|
|
725
|
+
trustedProxies,
|
|
726
|
+
allowRealIpFallback,
|
|
727
|
+
rateLimiter
|
|
728
|
+
})
|
|
729
|
+
});
|
|
730
|
+
if (openAiCompatEnabled && isEmbeddingsPath(scopedRequestPath)) requestStages.push({
|
|
731
|
+
name: "embeddings",
|
|
732
|
+
run: async () => (await getEmbeddingsHttpModule()).handleOpenAiEmbeddingsHttpRequest(req, res, {
|
|
733
|
+
auth: resolvedAuth,
|
|
734
|
+
trustedProxies,
|
|
735
|
+
allowRealIpFallback,
|
|
736
|
+
rateLimiter
|
|
737
|
+
})
|
|
738
|
+
});
|
|
739
|
+
if (isToolsInvokePath(scopedRequestPath)) requestStages.push({
|
|
740
|
+
name: "tools-invoke",
|
|
741
|
+
run: async () => (await getToolsInvokeHttpModule()).handleToolsInvokeHttpRequest(req, res, {
|
|
742
|
+
auth: resolvedAuth,
|
|
743
|
+
trustedProxies,
|
|
744
|
+
allowRealIpFallback,
|
|
745
|
+
rateLimiter
|
|
746
|
+
})
|
|
747
|
+
});
|
|
748
|
+
if (isSessionKillPath(scopedRequestPath)) requestStages.push({
|
|
749
|
+
name: "sessions-kill",
|
|
750
|
+
run: async () => (await getSessionKillHttpModule()).handleSessionKillHttpRequest(req, res, {
|
|
751
|
+
auth: resolvedAuth,
|
|
752
|
+
trustedProxies,
|
|
753
|
+
allowRealIpFallback,
|
|
754
|
+
rateLimiter
|
|
755
|
+
})
|
|
756
|
+
});
|
|
757
|
+
if (isSessionHistoryPath(scopedRequestPath)) requestStages.push({
|
|
758
|
+
name: "sessions-history",
|
|
759
|
+
run: async () => (await getSessionHistoryHttpModule()).handleSessionHistoryHttpRequest(req, res, {
|
|
760
|
+
auth: resolvedAuth,
|
|
761
|
+
getResolvedAuth,
|
|
762
|
+
trustedProxies,
|
|
763
|
+
allowRealIpFallback,
|
|
764
|
+
rateLimiter
|
|
765
|
+
})
|
|
766
|
+
});
|
|
767
|
+
if (openResponsesEnabled && isOpenResponsesPath(scopedRequestPath)) requestStages.push({
|
|
768
|
+
name: "openresponses",
|
|
769
|
+
run: async () => (await getOpenResponsesHttpModule()).handleOpenResponsesHttpRequest(req, res, {
|
|
770
|
+
auth: resolvedAuth,
|
|
771
|
+
config: openResponsesConfig,
|
|
772
|
+
trustedProxies,
|
|
773
|
+
allowRealIpFallback,
|
|
774
|
+
rateLimiter
|
|
775
|
+
})
|
|
776
|
+
});
|
|
777
|
+
if (openAiChatCompletionsEnabled && isOpenAiChatCompletionsPath(scopedRequestPath)) requestStages.push({
|
|
778
|
+
name: "openai",
|
|
779
|
+
run: async () => (await getOpenAiHttpModule()).handleOpenAiHttpRequest(req, res, {
|
|
780
|
+
auth: resolvedAuth,
|
|
781
|
+
config: openAiChatCompletionsConfig,
|
|
782
|
+
trustedProxies,
|
|
783
|
+
allowRealIpFallback,
|
|
784
|
+
rateLimiter
|
|
785
|
+
})
|
|
786
|
+
});
|
|
787
|
+
if (handlePluginRequest && pluginPathContext && resolvePluginNodeCapabilityRoute?.(pluginPathContext)) {
|
|
788
|
+
const nodeCapability = resolvePluginNodeCapabilityRoute(pluginPathContext);
|
|
789
|
+
requestStages.push({
|
|
790
|
+
name: "plugin-node-capability-auth",
|
|
791
|
+
run: async () => {
|
|
792
|
+
if (!nodeCapability) return false;
|
|
793
|
+
const { authorizePluginNodeCapabilityRequest } = await getPluginNodeCapabilityAuthModule();
|
|
794
|
+
const ok = await authorizePluginNodeCapabilityRequest({
|
|
795
|
+
req,
|
|
796
|
+
auth: resolvedAuth,
|
|
797
|
+
trustedProxies,
|
|
798
|
+
allowRealIpFallback,
|
|
799
|
+
clients,
|
|
800
|
+
nodeCapability,
|
|
801
|
+
capability: scopedNodeCapability.capability,
|
|
802
|
+
malformedScopedPath: scopedNodeCapability.malformedScopedPath,
|
|
803
|
+
rateLimiter
|
|
804
|
+
});
|
|
805
|
+
if (!ok.ok) {
|
|
806
|
+
sendGatewayAuthFailure(res, ok);
|
|
807
|
+
return true;
|
|
808
|
+
}
|
|
809
|
+
return false;
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
requestStages.push(...buildPluginRequestStages({
|
|
814
|
+
req,
|
|
815
|
+
res,
|
|
816
|
+
requestPath: scopedRequestPath,
|
|
817
|
+
getGatewayAuthBypassPaths: () => getCachedPluginGatewayAuthBypassPaths(configSnapshot),
|
|
818
|
+
pluginPathContext,
|
|
819
|
+
handlePluginRequest,
|
|
820
|
+
shouldEnforcePluginGatewayAuth,
|
|
821
|
+
resolvedAuth,
|
|
822
|
+
trustedProxies,
|
|
823
|
+
allowRealIpFallback,
|
|
824
|
+
rateLimiter
|
|
825
|
+
}));
|
|
826
|
+
if (isManagedOutgoingImagePath(scopedRequestPath)) requestStages.push({
|
|
827
|
+
name: "chat-managed-image-media",
|
|
828
|
+
run: async () => (await getManagedImageAttachmentsModule()).handleManagedOutgoingImageHttpRequest(req, res, {
|
|
829
|
+
auth: resolvedAuth,
|
|
830
|
+
trustedProxies,
|
|
831
|
+
allowRealIpFallback,
|
|
832
|
+
rateLimiter
|
|
833
|
+
})
|
|
834
|
+
});
|
|
835
|
+
if (controlUiEnabled) {
|
|
836
|
+
requestStages.push({
|
|
837
|
+
name: "control-ui-assistant-media",
|
|
838
|
+
run: async () => (await getControlUiModule()).handleControlUiAssistantMediaRequest(req, res, {
|
|
839
|
+
basePath: controlUiBasePath,
|
|
840
|
+
config: configSnapshot,
|
|
841
|
+
agentId: resolveAssistantIdentity({ cfg: configSnapshot }).agentId,
|
|
842
|
+
auth: resolvedAuth,
|
|
843
|
+
trustedProxies,
|
|
844
|
+
allowRealIpFallback,
|
|
845
|
+
rateLimiter
|
|
846
|
+
})
|
|
847
|
+
});
|
|
848
|
+
requestStages.push({
|
|
849
|
+
name: "control-ui-avatar",
|
|
850
|
+
run: async () => {
|
|
851
|
+
const { handleControlUiAvatarRequest } = await getControlUiModule();
|
|
852
|
+
const { resolveAgentAvatar } = await getIdentityAvatarModule();
|
|
853
|
+
return handleControlUiAvatarRequest(req, res, {
|
|
854
|
+
basePath: controlUiBasePath,
|
|
855
|
+
auth: resolvedAuth,
|
|
856
|
+
trustedProxies,
|
|
857
|
+
allowRealIpFallback,
|
|
858
|
+
rateLimiter,
|
|
859
|
+
resolveAvatar: (agentId) => resolveAgentAvatar(configSnapshot, agentId, { includeUiOverride: true })
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
});
|
|
863
|
+
requestStages.push({
|
|
864
|
+
name: "control-ui-http",
|
|
865
|
+
run: async () => (await getControlUiModule()).handleControlUiHttpRequest(req, res, {
|
|
866
|
+
basePath: controlUiBasePath,
|
|
867
|
+
config: configSnapshot,
|
|
868
|
+
agentId: resolveAssistantIdentity({ cfg: configSnapshot }).agentId,
|
|
869
|
+
root: controlUiRoot,
|
|
870
|
+
auth: resolvedAuth,
|
|
871
|
+
trustedProxies,
|
|
872
|
+
allowRealIpFallback,
|
|
873
|
+
rateLimiter
|
|
874
|
+
})
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
if (await runGatewayHttpRequestStages(requestStages)) return;
|
|
878
|
+
res.statusCode = 404;
|
|
879
|
+
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
880
|
+
res.end("Not Found");
|
|
881
|
+
} catch (err) {
|
|
882
|
+
console.error("[gateway-http] unhandled error in request handler:", err);
|
|
883
|
+
res.statusCode = 500;
|
|
884
|
+
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
885
|
+
res.end("Internal Server Error");
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
return httpServer;
|
|
889
|
+
}
|
|
890
|
+
function attachGatewayUpgradeHandler(opts) {
|
|
891
|
+
const { httpServer, wss, handlePluginUpgrade, shouldEnforcePluginGatewayAuth, resolvePluginNodeCapabilityRoute, clients, preauthConnectionBudget, resolvedAuth, rateLimiter, log } = opts;
|
|
892
|
+
const getResolvedAuth = opts.getResolvedAuth ?? (() => resolvedAuth);
|
|
893
|
+
httpServer.on("upgrade", (req, socket, head) => {
|
|
894
|
+
runWithDiagnosticTraceContext(createDiagnosticTraceContext(), async () => {
|
|
895
|
+
const configSnapshot = getRuntimeConfig();
|
|
896
|
+
const trustedProxies = configSnapshot.gateway?.trustedProxies ?? [];
|
|
897
|
+
const allowRealIpFallback = configSnapshot.gateway?.allowRealIpFallback === true;
|
|
898
|
+
const scopedNodeCapability = normalizePluginNodeCapabilityScopedUrl(req.url ?? "/");
|
|
899
|
+
if (scopedNodeCapability.malformedScopedPath) {
|
|
900
|
+
writeUpgradeAuthFailure(socket, {
|
|
901
|
+
ok: false,
|
|
902
|
+
reason: "unauthorized"
|
|
903
|
+
});
|
|
904
|
+
socket.destroy();
|
|
905
|
+
return;
|
|
906
|
+
}
|
|
907
|
+
if (scopedNodeCapability.rewrittenUrl) req.url = scopedNodeCapability.rewrittenUrl;
|
|
908
|
+
const resolvedAuth = getResolvedAuth();
|
|
909
|
+
const requestPath = scopedNodeCapability.pathname;
|
|
910
|
+
const pathContext = resolvePluginRoutePathContext(requestPath);
|
|
911
|
+
const nodeCapability = resolvePluginNodeCapabilityRoute?.(pathContext);
|
|
912
|
+
if (nodeCapability) {
|
|
913
|
+
const { authorizePluginNodeCapabilityRequest } = await getPluginNodeCapabilityAuthModule();
|
|
914
|
+
const ok = await authorizePluginNodeCapabilityRequest({
|
|
915
|
+
req,
|
|
916
|
+
auth: resolvedAuth,
|
|
917
|
+
trustedProxies,
|
|
918
|
+
allowRealIpFallback,
|
|
919
|
+
clients,
|
|
920
|
+
nodeCapability,
|
|
921
|
+
capability: scopedNodeCapability.capability,
|
|
922
|
+
malformedScopedPath: scopedNodeCapability.malformedScopedPath,
|
|
923
|
+
rateLimiter
|
|
924
|
+
});
|
|
925
|
+
if (!ok.ok) {
|
|
926
|
+
writeUpgradeAuthFailure(socket, ok);
|
|
927
|
+
socket.destroy();
|
|
928
|
+
return;
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
if (handlePluginUpgrade) {
|
|
932
|
+
let pluginGatewayAuthSatisfied = false;
|
|
933
|
+
let pluginGatewayRequestAuth;
|
|
934
|
+
let pluginGatewayRequestOperatorScopes;
|
|
935
|
+
if ((shouldEnforcePluginGatewayAuth ?? shouldEnforceDefaultPluginGatewayAuth)(pathContext) && !(await getCachedPluginGatewayAuthBypassPaths(configSnapshot)).has(requestPath)) {
|
|
936
|
+
const { checkGatewayHttpRequestAuth } = await getHttpAuthUtilsModule();
|
|
937
|
+
const authCheck = await checkGatewayHttpRequestAuth({
|
|
938
|
+
req,
|
|
939
|
+
auth: resolvedAuth,
|
|
940
|
+
trustedProxies,
|
|
941
|
+
allowRealIpFallback,
|
|
942
|
+
rateLimiter,
|
|
943
|
+
cfg: configSnapshot
|
|
944
|
+
});
|
|
945
|
+
if (!authCheck.ok) {
|
|
946
|
+
writeUpgradeAuthFailure(socket, authCheck.authResult);
|
|
947
|
+
socket.destroy();
|
|
948
|
+
return;
|
|
949
|
+
}
|
|
950
|
+
pluginGatewayAuthSatisfied = true;
|
|
951
|
+
pluginGatewayRequestAuth = authCheck.requestAuth;
|
|
952
|
+
const { resolvePluginRouteRuntimeOperatorScopes } = await getPluginRouteRuntimeScopesModule();
|
|
953
|
+
pluginGatewayRequestOperatorScopes = resolvePluginRouteRuntimeOperatorScopes(req, authCheck.requestAuth);
|
|
954
|
+
}
|
|
955
|
+
if (await handlePluginUpgrade(req, socket, head, pathContext, {
|
|
956
|
+
gatewayAuthSatisfied: pluginGatewayAuthSatisfied,
|
|
957
|
+
gatewayRequestAuth: pluginGatewayRequestAuth,
|
|
958
|
+
gatewayRequestOperatorScopes: pluginGatewayRequestOperatorScopes
|
|
959
|
+
})) return;
|
|
960
|
+
}
|
|
961
|
+
const preauthBudgetKey = resolveRequestClientIp(req, trustedProxies, allowRealIpFallback);
|
|
962
|
+
if (wss.listenerCount("connection") === 0) {
|
|
963
|
+
writeUpgradeServiceUnavailable(socket, "Gateway websocket handlers unavailable");
|
|
964
|
+
socket.destroy();
|
|
965
|
+
return;
|
|
966
|
+
}
|
|
967
|
+
if (!preauthConnectionBudget.acquire(preauthBudgetKey)) {
|
|
968
|
+
writeUpgradeServiceUnavailable(socket, "Too many unauthenticated sockets");
|
|
969
|
+
socket.destroy();
|
|
970
|
+
return;
|
|
971
|
+
}
|
|
972
|
+
let budgetTransferred = false;
|
|
973
|
+
const releaseUpgradeBudget = () => {
|
|
974
|
+
if (budgetTransferred) return;
|
|
975
|
+
budgetTransferred = true;
|
|
976
|
+
preauthConnectionBudget.release(preauthBudgetKey);
|
|
977
|
+
};
|
|
978
|
+
socket.once("close", releaseUpgradeBudget);
|
|
979
|
+
try {
|
|
980
|
+
wss.handleUpgrade(req, socket, head, (ws) => {
|
|
981
|
+
ws["__fengmingPreauthBudgetKey"] = preauthBudgetKey;
|
|
982
|
+
wss.emit("connection", ws, req);
|
|
983
|
+
if (Boolean(ws["__fengmingPreauthBudgetClaimed"])) {
|
|
984
|
+
budgetTransferred = true;
|
|
985
|
+
socket.off("close", releaseUpgradeBudget);
|
|
986
|
+
}
|
|
987
|
+
});
|
|
988
|
+
} catch {
|
|
989
|
+
socket.off("close", releaseUpgradeBudget);
|
|
990
|
+
releaseUpgradeBudget();
|
|
991
|
+
throw new Error("网关 WebSocket 升级失败");
|
|
992
|
+
}
|
|
993
|
+
}).catch((err) => {
|
|
994
|
+
const remoteAddress = socket.remoteAddress ?? "unknown";
|
|
995
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
996
|
+
log?.warn(`ws upgrade error from ${remoteAddress}: ${errorMessage}`);
|
|
997
|
+
socket.destroy();
|
|
998
|
+
});
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
//#endregion
|
|
1002
|
+
//#region src/gateway/server/http-listen.ts
|
|
1003
|
+
const EADDRINUSE_MAX_RETRIES = 20;
|
|
1004
|
+
const EADDRINUSE_RETRY_INTERVAL_MS = 500;
|
|
1005
|
+
async function closeServerQuietly(httpServer) {
|
|
1006
|
+
await new Promise((resolve) => {
|
|
1007
|
+
try {
|
|
1008
|
+
httpServer.close(() => resolve());
|
|
1009
|
+
} catch {
|
|
1010
|
+
resolve();
|
|
1011
|
+
}
|
|
1012
|
+
});
|
|
1013
|
+
}
|
|
1014
|
+
async function listenGatewayHttpServer(params) {
|
|
1015
|
+
const { httpServer, bindHost, port } = params;
|
|
1016
|
+
for (let attempt = 0;; attempt++) try {
|
|
1017
|
+
await new Promise((resolve, reject) => {
|
|
1018
|
+
const onError = (err) => {
|
|
1019
|
+
httpServer.off("listening", onListening);
|
|
1020
|
+
reject(err);
|
|
1021
|
+
};
|
|
1022
|
+
const onListening = () => {
|
|
1023
|
+
httpServer.off("error", onError);
|
|
1024
|
+
resolve();
|
|
1025
|
+
};
|
|
1026
|
+
httpServer.once("error", onError);
|
|
1027
|
+
httpServer.once("listening", onListening);
|
|
1028
|
+
httpServer.listen(port, bindHost);
|
|
1029
|
+
});
|
|
1030
|
+
return;
|
|
1031
|
+
} catch (err) {
|
|
1032
|
+
const code = err.code;
|
|
1033
|
+
if (code === "EADDRINUSE" && attempt < EADDRINUSE_MAX_RETRIES) {
|
|
1034
|
+
await closeServerQuietly(httpServer);
|
|
1035
|
+
await sleep(EADDRINUSE_RETRY_INTERVAL_MS);
|
|
1036
|
+
continue;
|
|
1037
|
+
}
|
|
1038
|
+
if (code === "EADDRINUSE") throw new GatewayLockError(`another gateway instance is already listening on ws://${bindHost}:${port}`, err);
|
|
1039
|
+
throw new GatewayLockError(`failed to bind gateway socket on ws://${bindHost}:${port}: ${String(err)}`, err);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
//#endregion
|
|
1043
|
+
//#region src/gateway/server/preauth-connection-budget.ts
|
|
1044
|
+
const DEFAULT_MAX_PREAUTH_CONNECTIONS_PER_IP = 32;
|
|
1045
|
+
const UNKNOWN_CLIENT_IP_BUDGET_KEY = "__fengming_unknown_client_ip__";
|
|
1046
|
+
function getMaxPreauthConnectionsPerIpFromEnv(env = process.env) {
|
|
1047
|
+
const configured = env.FENGMING_MAX_PREAUTH_CONNECTIONS_PER_IP || env.VITEST && env.FENGMING_TEST_MAX_PREAUTH_CONNECTIONS_PER_IP;
|
|
1048
|
+
if (!configured) return DEFAULT_MAX_PREAUTH_CONNECTIONS_PER_IP;
|
|
1049
|
+
const parsed = parseStrictPositiveInteger(configured);
|
|
1050
|
+
if (parsed === void 0) return DEFAULT_MAX_PREAUTH_CONNECTIONS_PER_IP;
|
|
1051
|
+
return parsed;
|
|
1052
|
+
}
|
|
1053
|
+
function createPreauthConnectionBudget(limit = getMaxPreauthConnectionsPerIpFromEnv()) {
|
|
1054
|
+
const maxConnectionsPerIp = resolveIntegerOption(limit, getMaxPreauthConnectionsPerIpFromEnv(), { min: 1 });
|
|
1055
|
+
const counts = /* @__PURE__ */ new Map();
|
|
1056
|
+
const normalizeBudgetKey = (clientIp) => {
|
|
1057
|
+
return clientIp?.trim() || UNKNOWN_CLIENT_IP_BUDGET_KEY;
|
|
1058
|
+
};
|
|
1059
|
+
return {
|
|
1060
|
+
acquire(clientIp) {
|
|
1061
|
+
const ip = normalizeBudgetKey(clientIp);
|
|
1062
|
+
const next = (counts.get(ip) ?? 0) + 1;
|
|
1063
|
+
if (next > maxConnectionsPerIp) return false;
|
|
1064
|
+
counts.set(ip, next);
|
|
1065
|
+
return true;
|
|
1066
|
+
},
|
|
1067
|
+
release(clientIp) {
|
|
1068
|
+
const ip = normalizeBudgetKey(clientIp);
|
|
1069
|
+
const current = counts.get(ip);
|
|
1070
|
+
if (current === void 0) return;
|
|
1071
|
+
if (current <= 1) {
|
|
1072
|
+
counts.delete(ip);
|
|
1073
|
+
return;
|
|
1074
|
+
}
|
|
1075
|
+
counts.set(ip, current - 1);
|
|
1076
|
+
}
|
|
1077
|
+
};
|
|
1078
|
+
}
|
|
1079
|
+
//#endregion
|
|
1080
|
+
//#region src/gateway/server-runtime-state.ts
|
|
1081
|
+
async function createGatewayRuntimeState(params) {
|
|
1082
|
+
pinActivePluginHttpRouteRegistry(params.pluginRegistry);
|
|
1083
|
+
if (params.pinChannelRegistry !== false) pinActivePluginChannelRegistry(params.pluginRegistry);
|
|
1084
|
+
else releasePinnedPluginChannelRegistry();
|
|
1085
|
+
try {
|
|
1086
|
+
const resolvePluginRouteRegistry = () => params.getPluginRouteRegistry?.() ?? params.pluginRegistry;
|
|
1087
|
+
const clients = /* @__PURE__ */ new Set();
|
|
1088
|
+
const { broadcast, broadcastToConnIds } = createGatewayBroadcaster({ clients });
|
|
1089
|
+
let loadedHooksRequestHandler = null;
|
|
1090
|
+
const handleHooksRequest = async (req, res) => {
|
|
1091
|
+
const hooksConfig = params.hooksConfig();
|
|
1092
|
+
if (!hooksConfig) return false;
|
|
1093
|
+
const url = new URL(req.url ?? "/", "http://localhost");
|
|
1094
|
+
const basePath = hooksConfig.basePath;
|
|
1095
|
+
if (url.pathname !== basePath && !url.pathname.startsWith(`${basePath}/`)) return false;
|
|
1096
|
+
if (!loadedHooksRequestHandler) {
|
|
1097
|
+
const { createGatewayHooksRequestHandler } = await import("./hooks-9FOcRqfu.js");
|
|
1098
|
+
loadedHooksRequestHandler = createGatewayHooksRequestHandler({
|
|
1099
|
+
deps: params.deps,
|
|
1100
|
+
getHooksConfig: params.hooksConfig,
|
|
1101
|
+
getClientIpConfig: params.getHookClientIpConfig,
|
|
1102
|
+
bindHost: params.bindHost,
|
|
1103
|
+
port: params.port,
|
|
1104
|
+
logHooks: params.logHooks
|
|
1105
|
+
});
|
|
1106
|
+
}
|
|
1107
|
+
return await loadedHooksRequestHandler(req, res);
|
|
1108
|
+
};
|
|
1109
|
+
let loadedPluginRequestHandler = null;
|
|
1110
|
+
let loadedPluginUpgradeHandler = null;
|
|
1111
|
+
const handlePluginRequest = async (req, res, pathContext, dispatchContext) => {
|
|
1112
|
+
if ((resolvePluginRouteRegistry().httpRoutes ?? []).length === 0) return false;
|
|
1113
|
+
if (!loadedPluginRequestHandler) {
|
|
1114
|
+
const { createGatewayPluginRequestHandler } = await import("./plugins-http-DSvq5uzu.js");
|
|
1115
|
+
loadedPluginRequestHandler = createGatewayPluginRequestHandler({
|
|
1116
|
+
registry: params.pluginRegistry,
|
|
1117
|
+
getRouteRegistry: resolvePluginRouteRegistry,
|
|
1118
|
+
log: params.logPlugins,
|
|
1119
|
+
getGatewayRequestContext: params.getGatewayRequestContext
|
|
1120
|
+
});
|
|
1121
|
+
}
|
|
1122
|
+
return await loadedPluginRequestHandler(req, res, pathContext, dispatchContext);
|
|
1123
|
+
};
|
|
1124
|
+
const handlePluginUpgrade = async (req, socket, head, pathContext, dispatchContext) => {
|
|
1125
|
+
if ((resolvePluginRouteRegistry().httpRoutes ?? []).length === 0) return false;
|
|
1126
|
+
if (!loadedPluginUpgradeHandler) {
|
|
1127
|
+
const { createGatewayPluginUpgradeHandler } = await import("./plugins-http-DSvq5uzu.js");
|
|
1128
|
+
loadedPluginUpgradeHandler = createGatewayPluginUpgradeHandler({
|
|
1129
|
+
registry: params.pluginRegistry,
|
|
1130
|
+
getRouteRegistry: resolvePluginRouteRegistry,
|
|
1131
|
+
log: params.logPlugins,
|
|
1132
|
+
getGatewayRequestContext: params.getGatewayRequestContext
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
return await loadedPluginUpgradeHandler(req, socket, head, pathContext, dispatchContext);
|
|
1136
|
+
};
|
|
1137
|
+
const shouldEnforcePluginGatewayAuth = (pathContext) => {
|
|
1138
|
+
return shouldEnforceGatewayAuthForPluginPath(resolvePluginRouteRegistry(), pathContext);
|
|
1139
|
+
};
|
|
1140
|
+
const resolvePluginNodeCapabilityRoute = (pathContext) => findMatchingPluginNodeCapabilityRoute(resolvePluginRouteRegistry(), pathContext)?.nodeCapability;
|
|
1141
|
+
const bindHosts = await resolveGatewayListenHosts(params.bindHost);
|
|
1142
|
+
if (!isLoopbackHost(params.bindHost)) params.log.warn("⚠️ Gateway is binding to a non-loopback address. Ensure authentication is configured before exposing to public networks.");
|
|
1143
|
+
if (params.cfg.gateway?.controlUi?.dangerouslyAllowHostHeaderOriginFallback === true) params.log.warn("⚠️ gateway.controlUi.dangerouslyAllowHostHeaderOriginFallback=true is enabled. Host-header origin fallback weakens origin checks and should only be used as break-glass.");
|
|
1144
|
+
const wss = new WebSocketServer({
|
|
1145
|
+
noServer: true,
|
|
1146
|
+
maxPayload: MAX_PREAUTH_PAYLOAD_BYTES
|
|
1147
|
+
});
|
|
1148
|
+
const preauthConnectionBudget = createPreauthConnectionBudget();
|
|
1149
|
+
const httpServers = [];
|
|
1150
|
+
const httpBindHosts = [];
|
|
1151
|
+
for (const _ of bindHosts) {
|
|
1152
|
+
const httpServer = createGatewayHttpServer({
|
|
1153
|
+
clients,
|
|
1154
|
+
controlUiEnabled: params.controlUiEnabled,
|
|
1155
|
+
controlUiBasePath: params.controlUiBasePath,
|
|
1156
|
+
controlUiRoot: params.controlUiRoot,
|
|
1157
|
+
openAiChatCompletionsEnabled: params.openAiChatCompletionsEnabled,
|
|
1158
|
+
openAiChatCompletionsConfig: params.openAiChatCompletionsConfig,
|
|
1159
|
+
openResponsesEnabled: params.openResponsesEnabled,
|
|
1160
|
+
openResponsesConfig: params.openResponsesConfig,
|
|
1161
|
+
strictTransportSecurityHeader: params.strictTransportSecurityHeader,
|
|
1162
|
+
handleHooksRequest,
|
|
1163
|
+
handlePluginRequest,
|
|
1164
|
+
shouldEnforcePluginGatewayAuth,
|
|
1165
|
+
resolvePluginNodeCapabilityRoute,
|
|
1166
|
+
resolvedAuth: params.resolvedAuth,
|
|
1167
|
+
getResolvedAuth: params.getResolvedAuth,
|
|
1168
|
+
rateLimiter: params.rateLimiter,
|
|
1169
|
+
getReadiness: params.getReadiness,
|
|
1170
|
+
tlsOptions: params.gatewayTls?.enabled ? params.gatewayTls.tlsOptions : void 0
|
|
1171
|
+
});
|
|
1172
|
+
attachGatewayUpgradeHandler({
|
|
1173
|
+
httpServer,
|
|
1174
|
+
wss,
|
|
1175
|
+
handlePluginUpgrade,
|
|
1176
|
+
shouldEnforcePluginGatewayAuth,
|
|
1177
|
+
resolvePluginNodeCapabilityRoute,
|
|
1178
|
+
clients,
|
|
1179
|
+
preauthConnectionBudget,
|
|
1180
|
+
resolvedAuth: params.resolvedAuth,
|
|
1181
|
+
getResolvedAuth: params.getResolvedAuth,
|
|
1182
|
+
rateLimiter: params.rateLimiter,
|
|
1183
|
+
log: params.log
|
|
1184
|
+
});
|
|
1185
|
+
httpServers.push(httpServer);
|
|
1186
|
+
}
|
|
1187
|
+
const httpServer = httpServers[0];
|
|
1188
|
+
if (!httpServer) throw new Error("网关 HTTP 服务启动失败");
|
|
1189
|
+
let startListeningPromise = null;
|
|
1190
|
+
const startListening = async () => {
|
|
1191
|
+
if (startListeningPromise) {
|
|
1192
|
+
await startListeningPromise;
|
|
1193
|
+
return;
|
|
1194
|
+
}
|
|
1195
|
+
startListeningPromise = (async () => {
|
|
1196
|
+
for (const [index, host] of bindHosts.entries()) {
|
|
1197
|
+
const server = httpServers[index];
|
|
1198
|
+
if (!server) throw new Error(`Missing gateway HTTP server for bind host ${host}`);
|
|
1199
|
+
try {
|
|
1200
|
+
await listenGatewayHttpServer({
|
|
1201
|
+
httpServer: server,
|
|
1202
|
+
bindHost: host,
|
|
1203
|
+
port: params.port
|
|
1204
|
+
});
|
|
1205
|
+
httpBindHosts.push(host);
|
|
1206
|
+
} catch (err) {
|
|
1207
|
+
if (host === bindHosts[0]) throw err;
|
|
1208
|
+
params.log.warn(`gateway: failed to bind loopback alias ${host}:${params.port} (${String(err)})`);
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
if (httpBindHosts.length === 0) throw new Error("网关 HTTP 服务启动失败");
|
|
1212
|
+
})();
|
|
1213
|
+
try {
|
|
1214
|
+
await startListeningPromise;
|
|
1215
|
+
} catch (err) {
|
|
1216
|
+
startListeningPromise = null;
|
|
1217
|
+
throw err;
|
|
1218
|
+
}
|
|
1219
|
+
};
|
|
1220
|
+
const agentRunSeq = /* @__PURE__ */ new Map();
|
|
1221
|
+
const dedupe = /* @__PURE__ */ new Map();
|
|
1222
|
+
const chatRunState = createChatRunState();
|
|
1223
|
+
const chatRunRegistry = chatRunState.registry;
|
|
1224
|
+
return {
|
|
1225
|
+
releasePluginRouteRegistry: () => {
|
|
1226
|
+
releasePinnedPluginHttpRouteRegistry();
|
|
1227
|
+
releasePinnedPluginChannelRegistry();
|
|
1228
|
+
},
|
|
1229
|
+
httpServer,
|
|
1230
|
+
httpServers,
|
|
1231
|
+
httpBindHosts,
|
|
1232
|
+
startListening,
|
|
1233
|
+
wss,
|
|
1234
|
+
preauthConnectionBudget,
|
|
1235
|
+
clients,
|
|
1236
|
+
broadcast,
|
|
1237
|
+
broadcastToConnIds,
|
|
1238
|
+
agentRunSeq,
|
|
1239
|
+
dedupe,
|
|
1240
|
+
chatRunState,
|
|
1241
|
+
chatRunBuffers: chatRunState.buffers,
|
|
1242
|
+
chatDeltaSentAt: chatRunState.deltaSentAt,
|
|
1243
|
+
chatDeltaLastBroadcastLen: chatRunState.deltaLastBroadcastLen,
|
|
1244
|
+
addChatRun: chatRunRegistry.add,
|
|
1245
|
+
removeChatRun: chatRunRegistry.remove,
|
|
1246
|
+
chatAbortControllers: /* @__PURE__ */ new Map(),
|
|
1247
|
+
toolEventRecipients: createToolEventRecipientRegistry()
|
|
1248
|
+
};
|
|
1249
|
+
} catch (err) {
|
|
1250
|
+
releasePinnedPluginHttpRouteRegistry();
|
|
1251
|
+
releasePinnedPluginChannelRegistry();
|
|
1252
|
+
throw err;
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
//#endregion
|
|
1256
|
+
//#region src/gateway/server-wizard-sessions.ts
|
|
1257
|
+
function createWizardSessionTracker() {
|
|
1258
|
+
const wizardSessions = /* @__PURE__ */ new Map();
|
|
1259
|
+
const findRunningWizard = () => {
|
|
1260
|
+
for (const [id, session] of wizardSessions) if (session.getStatus() === "running") return id;
|
|
1261
|
+
return null;
|
|
1262
|
+
};
|
|
1263
|
+
const purgeWizardSession = (id) => {
|
|
1264
|
+
const session = wizardSessions.get(id);
|
|
1265
|
+
if (!session) return;
|
|
1266
|
+
if (session.getStatus() === "running") return;
|
|
1267
|
+
wizardSessions.delete(id);
|
|
1268
|
+
};
|
|
1269
|
+
return {
|
|
1270
|
+
wizardSessions,
|
|
1271
|
+
findRunningWizard,
|
|
1272
|
+
purgeWizardSession
|
|
1273
|
+
};
|
|
1274
|
+
}
|
|
1275
|
+
//#endregion
|
|
1276
|
+
//#region src/gateway/server/event-loop-health.ts
|
|
1277
|
+
const EVENT_LOOP_MONITOR_RESOLUTION_MS = 20;
|
|
1278
|
+
const EVENT_LOOP_DELAY_WARN_MS = 1e3;
|
|
1279
|
+
const EVENT_LOOP_UTILIZATION_WARN = .95;
|
|
1280
|
+
const CPU_CORE_RATIO_WARN = .9;
|
|
1281
|
+
const LOAD_DEGRADATION_DELAY_COEVIDENCE_MS = 25;
|
|
1282
|
+
const SUSTAINED_LOAD_SAMPLE_MIN_INTERVAL_MS = 1e3;
|
|
1283
|
+
function roundMetric(value, digits = 3) {
|
|
1284
|
+
if (!Number.isFinite(value)) return 0;
|
|
1285
|
+
const factor = 10 ** digits;
|
|
1286
|
+
return Math.round(value * factor) / factor;
|
|
1287
|
+
}
|
|
1288
|
+
function nanosecondsToMilliseconds(value) {
|
|
1289
|
+
return roundMetric(value / 1e6, 1);
|
|
1290
|
+
}
|
|
1291
|
+
function classifyGatewayEventLoopHealthReasons(metrics) {
|
|
1292
|
+
const reasons = [];
|
|
1293
|
+
if (metrics.delayP99Ms >= EVENT_LOOP_DELAY_WARN_MS || metrics.delayMaxMs >= EVENT_LOOP_DELAY_WARN_MS) reasons.push("event_loop_delay");
|
|
1294
|
+
if (metrics.intervalMs < SUSTAINED_LOAD_SAMPLE_MIN_INTERVAL_MS) return reasons;
|
|
1295
|
+
if (!(metrics.delayP99Ms >= LOAD_DEGRADATION_DELAY_COEVIDENCE_MS || metrics.delayMaxMs >= LOAD_DEGRADATION_DELAY_COEVIDENCE_MS)) return reasons;
|
|
1296
|
+
if (metrics.utilization >= EVENT_LOOP_UTILIZATION_WARN) reasons.push("event_loop_utilization");
|
|
1297
|
+
if (metrics.cpuCoreRatio >= CPU_CORE_RATIO_WARN) reasons.push("cpu");
|
|
1298
|
+
return reasons;
|
|
1299
|
+
}
|
|
1300
|
+
function createGatewayEventLoopHealthMonitor(deps = {}) {
|
|
1301
|
+
const nowMs = deps.now ?? Date.now;
|
|
1302
|
+
const readCpuUsage = deps.cpuUsage ?? process.cpuUsage.bind(process);
|
|
1303
|
+
const readEventLoopUtilization = deps.eventLoopUtilization ?? performance.eventLoopUtilization.bind(performance);
|
|
1304
|
+
const createDelayMonitor = deps.createDelayMonitor ?? ((resolutionMs) => monitorEventLoopDelay({ resolution: resolutionMs }));
|
|
1305
|
+
let monitor = null;
|
|
1306
|
+
let lastWallAt = nowMs();
|
|
1307
|
+
let lastCpuUsage = readCpuUsage();
|
|
1308
|
+
let lastEventLoopUtilization = readEventLoopUtilization();
|
|
1309
|
+
let lastSnapshot;
|
|
1310
|
+
try {
|
|
1311
|
+
monitor = createDelayMonitor(EVENT_LOOP_MONITOR_RESOLUTION_MS);
|
|
1312
|
+
monitor.enable();
|
|
1313
|
+
monitor.reset();
|
|
1314
|
+
} catch {
|
|
1315
|
+
monitor = null;
|
|
1316
|
+
}
|
|
1317
|
+
return {
|
|
1318
|
+
snapshot: () => {
|
|
1319
|
+
if (!monitor || !lastCpuUsage || !lastEventLoopUtilization || lastWallAt <= 0) return;
|
|
1320
|
+
const now = nowMs();
|
|
1321
|
+
const intervalMs = Math.max(1, now - lastWallAt);
|
|
1322
|
+
const delayP99Ms = nanosecondsToMilliseconds(monitor.percentile(99));
|
|
1323
|
+
const delayMaxMs = nanosecondsToMilliseconds(monitor.max);
|
|
1324
|
+
if (!(delayP99Ms >= EVENT_LOOP_DELAY_WARN_MS || delayMaxMs >= EVENT_LOOP_DELAY_WARN_MS) && intervalMs < SUSTAINED_LOAD_SAMPLE_MIN_INTERVAL_MS) return lastSnapshot;
|
|
1325
|
+
const cpuUsage = readCpuUsage(lastCpuUsage);
|
|
1326
|
+
const currentEventLoopUtilization = readEventLoopUtilization();
|
|
1327
|
+
const utilization = roundMetric(readEventLoopUtilization(currentEventLoopUtilization, lastEventLoopUtilization).utilization);
|
|
1328
|
+
const cpuCoreRatio = roundMetric(roundMetric((cpuUsage.user + cpuUsage.system) / 1e3, 1) / intervalMs);
|
|
1329
|
+
const reasons = classifyGatewayEventLoopHealthReasons({
|
|
1330
|
+
intervalMs,
|
|
1331
|
+
delayP99Ms,
|
|
1332
|
+
delayMaxMs,
|
|
1333
|
+
utilization,
|
|
1334
|
+
cpuCoreRatio
|
|
1335
|
+
});
|
|
1336
|
+
const snapshot = {
|
|
1337
|
+
degraded: reasons.length > 0,
|
|
1338
|
+
reasons,
|
|
1339
|
+
intervalMs,
|
|
1340
|
+
delayP99Ms,
|
|
1341
|
+
delayMaxMs,
|
|
1342
|
+
utilization,
|
|
1343
|
+
cpuCoreRatio
|
|
1344
|
+
};
|
|
1345
|
+
monitor.reset();
|
|
1346
|
+
lastWallAt = now;
|
|
1347
|
+
lastCpuUsage = readCpuUsage();
|
|
1348
|
+
lastEventLoopUtilization = currentEventLoopUtilization;
|
|
1349
|
+
lastSnapshot = snapshot;
|
|
1350
|
+
return snapshot;
|
|
1351
|
+
},
|
|
1352
|
+
stop: () => {
|
|
1353
|
+
monitor?.disable();
|
|
1354
|
+
monitor = null;
|
|
1355
|
+
lastWallAt = 0;
|
|
1356
|
+
lastCpuUsage = null;
|
|
1357
|
+
lastEventLoopUtilization = null;
|
|
1358
|
+
lastSnapshot = void 0;
|
|
1359
|
+
}
|
|
1360
|
+
};
|
|
1361
|
+
}
|
|
1362
|
+
//#endregion
|
|
1363
|
+
//#region src/gateway/server/readiness.ts
|
|
1364
|
+
const DEFAULT_READINESS_CACHE_TTL_MS = 1e3;
|
|
1365
|
+
function shouldIgnoreReadinessFailure(accountSnapshot, health) {
|
|
1366
|
+
if (health.reason === "unmanaged" || health.reason === "stale-socket") return true;
|
|
1367
|
+
return health.reason === "not-running" && accountSnapshot.restartPending === true;
|
|
1368
|
+
}
|
|
1369
|
+
function createReadinessChecker(deps) {
|
|
1370
|
+
const { channelManager, startedAt } = deps;
|
|
1371
|
+
const cacheTtlMs = Math.max(0, deps.cacheTtlMs ?? DEFAULT_READINESS_CACHE_TTL_MS);
|
|
1372
|
+
let cachedAt = 0;
|
|
1373
|
+
let cachedState = null;
|
|
1374
|
+
return () => {
|
|
1375
|
+
const now = Date.now();
|
|
1376
|
+
const uptimeMs = now - startedAt;
|
|
1377
|
+
if (deps.getStartupPending?.()) return withEventLoopHealth({
|
|
1378
|
+
ready: false,
|
|
1379
|
+
failing: [deps.getStartupPendingReason?.() ?? "startup-sidecars"],
|
|
1380
|
+
uptimeMs
|
|
1381
|
+
}, deps.getEventLoopHealth);
|
|
1382
|
+
if (deps.shouldSkipChannelReadiness?.()) return withEventLoopHealth({
|
|
1383
|
+
ready: true,
|
|
1384
|
+
failing: [],
|
|
1385
|
+
uptimeMs
|
|
1386
|
+
}, deps.getEventLoopHealth);
|
|
1387
|
+
if (cachedState && now - cachedAt < cacheTtlMs) return withEventLoopHealth({
|
|
1388
|
+
...cachedState,
|
|
1389
|
+
uptimeMs
|
|
1390
|
+
}, deps.getEventLoopHealth);
|
|
1391
|
+
const snapshot = channelManager.getRuntimeSnapshot();
|
|
1392
|
+
const failing = [];
|
|
1393
|
+
for (const [channelId, accounts] of Object.entries(snapshot.channelAccounts)) {
|
|
1394
|
+
if (!accounts) continue;
|
|
1395
|
+
for (const accountSnapshot of Object.values(accounts)) {
|
|
1396
|
+
if (!accountSnapshot) continue;
|
|
1397
|
+
const health = evaluateChannelHealth(accountSnapshot, {
|
|
1398
|
+
now,
|
|
1399
|
+
staleEventThresholdMs: DEFAULT_CHANNEL_STALE_EVENT_THRESHOLD_MS,
|
|
1400
|
+
channelConnectGraceMs: DEFAULT_CHANNEL_CONNECT_GRACE_MS,
|
|
1401
|
+
channelId
|
|
1402
|
+
});
|
|
1403
|
+
if (!health.healthy && !shouldIgnoreReadinessFailure(accountSnapshot, health)) {
|
|
1404
|
+
failing.push(channelId);
|
|
1405
|
+
break;
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
cachedAt = now;
|
|
1410
|
+
cachedState = {
|
|
1411
|
+
ready: failing.length === 0,
|
|
1412
|
+
failing
|
|
1413
|
+
};
|
|
1414
|
+
return withEventLoopHealth({
|
|
1415
|
+
...cachedState,
|
|
1416
|
+
uptimeMs
|
|
1417
|
+
}, deps.getEventLoopHealth);
|
|
1418
|
+
};
|
|
1419
|
+
}
|
|
1420
|
+
function withEventLoopHealth(result, getEventLoopHealth) {
|
|
1421
|
+
const eventLoop = getEventLoopHealth?.();
|
|
1422
|
+
return eventLoop ? {
|
|
1423
|
+
...result,
|
|
1424
|
+
eventLoop
|
|
1425
|
+
} : result;
|
|
1426
|
+
}
|
|
1427
|
+
//#endregion
|
|
1428
|
+
//#region src/gateway/server/tls.ts
|
|
1429
|
+
async function loadGatewayTlsRuntime(cfg, log) {
|
|
1430
|
+
return await loadGatewayTlsRuntime$1(cfg, log);
|
|
1431
|
+
}
|
|
1432
|
+
//#endregion
|
|
1433
|
+
//#region src/gateway/startup-control-ui-origins.ts
|
|
1434
|
+
async function maybeSeedControlUiAllowedOriginsAtStartup(params) {
|
|
1435
|
+
const seeded = ensureControlUiAllowedOriginsForNonLoopbackBind(params.config, {
|
|
1436
|
+
isContainerEnvironment,
|
|
1437
|
+
runtimeBind: params.runtimeBind,
|
|
1438
|
+
runtimePort: params.runtimePort
|
|
1439
|
+
});
|
|
1440
|
+
if (!seeded.seededOrigins || !seeded.bind) return {
|
|
1441
|
+
config: params.config,
|
|
1442
|
+
seededAllowedOrigins: false
|
|
1443
|
+
};
|
|
1444
|
+
params.log.info(buildSeededOriginsInfoLog(seeded.seededOrigins, seeded.bind));
|
|
1445
|
+
return {
|
|
1446
|
+
config: seeded.config,
|
|
1447
|
+
seededAllowedOrigins: true
|
|
1448
|
+
};
|
|
1449
|
+
}
|
|
1450
|
+
function buildSeededOriginsInfoLog(origins, bind) {
|
|
1451
|
+
return `gateway: seeded gateway.controlUi.allowedOrigins ${JSON.stringify(origins)} for bind=${bind} (required since v2026.2.26; see issue #29385). Applied for this runtime without writing config; add other origins to gateway.controlUi.allowedOrigins if needed.`;
|
|
1452
|
+
}
|
|
1453
|
+
//#endregion
|
|
1454
|
+
//#region src/gateway/server.impl.ts
|
|
1455
|
+
async function resetModelCatalogCacheForTest() {
|
|
1456
|
+
const { resetModelCatalogCacheForTest } = await import("./server-model-catalog-CoSSk_Gy.js");
|
|
1457
|
+
await resetModelCatalogCacheForTest();
|
|
1458
|
+
}
|
|
1459
|
+
ensureFengMingCliOnPath();
|
|
1460
|
+
const MAX_MEDIA_TTL_HOURS = 168;
|
|
1461
|
+
const POST_READY_MAINTENANCE_DELAY_MS = 250;
|
|
1462
|
+
let gatewayStartupEarlyModulePromise = null;
|
|
1463
|
+
let gatewayStartupPostAttachModulePromise = null;
|
|
1464
|
+
function loadGatewayStartupEarlyModule() {
|
|
1465
|
+
gatewayStartupEarlyModulePromise ??= import("./server-startup-early-Cy5kArJG.js");
|
|
1466
|
+
return gatewayStartupEarlyModulePromise;
|
|
1467
|
+
}
|
|
1468
|
+
function loadGatewayStartupPostAttachModule() {
|
|
1469
|
+
gatewayStartupPostAttachModulePromise ??= import("./server-startup-post-attach-COUCwhNa.js");
|
|
1470
|
+
return gatewayStartupPostAttachModulePromise;
|
|
1471
|
+
}
|
|
1472
|
+
function listGatewayStartupChannelPlugins() {
|
|
1473
|
+
return listLoadedChannelPlugins();
|
|
1474
|
+
}
|
|
1475
|
+
function resolveMediaCleanupTtlMs(ttlHoursRaw) {
|
|
1476
|
+
const ttlMs = Math.min(Math.max(ttlHoursRaw, 1), MAX_MEDIA_TTL_HOURS) * 60 * 6e4;
|
|
1477
|
+
if (!Number.isFinite(ttlMs) || !Number.isSafeInteger(ttlMs)) throw new Error(`Invalid media.ttlHours: ${String(ttlHoursRaw)}`);
|
|
1478
|
+
return ttlMs;
|
|
1479
|
+
}
|
|
1480
|
+
const log = createSubsystemLogger("gateway");
|
|
1481
|
+
const logDiscovery = log.child("discovery");
|
|
1482
|
+
const logTailscale = log.child("tailscale");
|
|
1483
|
+
const logChannels = log.child("channels");
|
|
1484
|
+
let cachedChannelRuntimePromise = null;
|
|
1485
|
+
let cachedStartupChannelRuntimePromise = null;
|
|
1486
|
+
function getChannelRuntime() {
|
|
1487
|
+
cachedChannelRuntimePromise ??= import("./runtime-channel-AubRWvnH.js").then(({ createRuntimeChannel }) => createRuntimeChannel());
|
|
1488
|
+
return cachedChannelRuntimePromise;
|
|
1489
|
+
}
|
|
1490
|
+
function getStartupChannelRuntime() {
|
|
1491
|
+
cachedStartupChannelRuntimePromise ??= import("./channel-runtime-contexts-Cw6AuV8u.js").then(({ createChannelRuntimeContextRegistry }) => ({ runtimeContexts: createChannelRuntimeContextRegistry() }));
|
|
1492
|
+
return cachedStartupChannelRuntimePromise;
|
|
1493
|
+
}
|
|
1494
|
+
async function closeMcpLoopbackServerOnDemand() {
|
|
1495
|
+
const { closeMcpLoopbackServer } = await import("./mcp-http-D4ieDB3W.js");
|
|
1496
|
+
await closeMcpLoopbackServer();
|
|
1497
|
+
}
|
|
1498
|
+
let gatewayCloseModulePromise = null;
|
|
1499
|
+
function loadGatewayCloseModule() {
|
|
1500
|
+
gatewayCloseModulePromise ??= import("./server-close.runtime.js");
|
|
1501
|
+
return gatewayCloseModulePromise;
|
|
1502
|
+
}
|
|
1503
|
+
let gatewayModelCatalogModulePromise = null;
|
|
1504
|
+
const loadGatewayModelCatalog = async (...args) => {
|
|
1505
|
+
gatewayModelCatalogModulePromise ??= import("./server-model-catalog-CoSSk_Gy.js");
|
|
1506
|
+
return (await gatewayModelCatalogModulePromise).loadGatewayModelCatalog(...args);
|
|
1507
|
+
};
|
|
1508
|
+
const logHealth = log.child("health");
|
|
1509
|
+
const logCron = log.child("cron");
|
|
1510
|
+
const logReload = log.child("reload");
|
|
1511
|
+
const logHooks = log.child("hooks");
|
|
1512
|
+
const logPlugins = log.child("plugins");
|
|
1513
|
+
const logWsControl = log.child("ws");
|
|
1514
|
+
const logSecrets = log.child("secrets");
|
|
1515
|
+
const gatewayRuntime = runtimeForLogger(log);
|
|
1516
|
+
function createGatewayStartupTrace() {
|
|
1517
|
+
const logEnabled = isTruthyEnvValue(process.env.FENGMING_GATEWAY_STARTUP_TRACE);
|
|
1518
|
+
let timelineConfig;
|
|
1519
|
+
let eventLoopDelay;
|
|
1520
|
+
const timelineOptions = () => ({
|
|
1521
|
+
...timelineConfig ? { config: timelineConfig } : {},
|
|
1522
|
+
env: process.env
|
|
1523
|
+
});
|
|
1524
|
+
const eventLoopTimelineEnabled = () => isDiagnosticsTimelineEnabled(timelineOptions()) && isTruthyEnvValue(process.env.FENGMING_DIAGNOSTICS_EVENT_LOOP);
|
|
1525
|
+
const ensureEventLoopDelay = () => {
|
|
1526
|
+
if (eventLoopDelay || !logEnabled && !eventLoopTimelineEnabled()) return;
|
|
1527
|
+
eventLoopDelay = monitorEventLoopDelay({ resolution: 10 });
|
|
1528
|
+
eventLoopDelay.enable();
|
|
1529
|
+
};
|
|
1530
|
+
ensureEventLoopDelay();
|
|
1531
|
+
const started = performance.now();
|
|
1532
|
+
let last = started;
|
|
1533
|
+
let spanSequence = 0;
|
|
1534
|
+
const formatMetric = (key, value) => `${key}=${typeof value === "number" ? value.toFixed(1) : value}`;
|
|
1535
|
+
const mapTimelineName = (name) => {
|
|
1536
|
+
switch (name) {
|
|
1537
|
+
case "config.snapshot": return "config.load";
|
|
1538
|
+
case "config.auth":
|
|
1539
|
+
case "config.final-snapshot":
|
|
1540
|
+
case "runtime.config": return "config.normalize";
|
|
1541
|
+
case "plugins.bootstrap": return "plugins.load";
|
|
1542
|
+
case "runtime.post-attach":
|
|
1543
|
+
case "ready": return "gateway.ready";
|
|
1544
|
+
default: return name;
|
|
1545
|
+
}
|
|
1546
|
+
};
|
|
1547
|
+
const takeEventLoopSample = () => {
|
|
1548
|
+
if (!eventLoopDelay) return;
|
|
1549
|
+
const sample = {
|
|
1550
|
+
p50Ms: eventLoopDelay.percentile(50) / 1e6,
|
|
1551
|
+
p95Ms: eventLoopDelay.percentile(95) / 1e6,
|
|
1552
|
+
p99Ms: eventLoopDelay.percentile(99) / 1e6,
|
|
1553
|
+
maxMs: eventLoopDelay.max / 1e6
|
|
1554
|
+
};
|
|
1555
|
+
eventLoopDelay.reset();
|
|
1556
|
+
return sample;
|
|
1557
|
+
};
|
|
1558
|
+
const emitEventLoopTimelineSample = (activeSpanName, sample) => {
|
|
1559
|
+
if (!eventLoopTimelineEnabled()) return;
|
|
1560
|
+
if (!sample) return;
|
|
1561
|
+
emitDiagnosticsTimelineEvent({
|
|
1562
|
+
type: "eventLoop.sample",
|
|
1563
|
+
name: "eventLoop",
|
|
1564
|
+
phase: "startup",
|
|
1565
|
+
activeSpanName: mapTimelineName(activeSpanName),
|
|
1566
|
+
attributes: activeSpanName === mapTimelineName(activeSpanName) ? void 0 : { traceName: activeSpanName },
|
|
1567
|
+
...sample
|
|
1568
|
+
}, timelineOptions());
|
|
1569
|
+
};
|
|
1570
|
+
const emit = (name, durationMs, totalMs, eventLoopSample, extras = []) => {
|
|
1571
|
+
const metrics = [["eventLoopMax", `${(eventLoopSample?.maxMs ?? 0).toFixed(1)}ms`], ...extras];
|
|
1572
|
+
recordGatewayRestartTraceSpan(`restart.ready.${name}`, durationMs, totalMs, metrics);
|
|
1573
|
+
if (logEnabled) log.info(`startup trace: ${name} ${durationMs.toFixed(1)}ms total=${totalMs.toFixed(1)}ms ${metrics.map(([key, value]) => formatMetric(key, value)).join(" ")}`);
|
|
1574
|
+
};
|
|
1575
|
+
return {
|
|
1576
|
+
setConfig(config) {
|
|
1577
|
+
timelineConfig = config;
|
|
1578
|
+
ensureEventLoopDelay();
|
|
1579
|
+
},
|
|
1580
|
+
mark(name) {
|
|
1581
|
+
const now = performance.now();
|
|
1582
|
+
const eventLoopSample = takeEventLoopSample();
|
|
1583
|
+
emit(name, now - last, now - started, eventLoopSample);
|
|
1584
|
+
emitDiagnosticsTimelineEvent({
|
|
1585
|
+
type: "mark",
|
|
1586
|
+
name: mapTimelineName(name),
|
|
1587
|
+
phase: "startup",
|
|
1588
|
+
durationMs: now - started,
|
|
1589
|
+
attributes: name === mapTimelineName(name) ? void 0 : { traceName: name }
|
|
1590
|
+
}, timelineOptions());
|
|
1591
|
+
emitEventLoopTimelineSample(name, eventLoopSample);
|
|
1592
|
+
last = now;
|
|
1593
|
+
if (name === "ready") eventLoopDelay?.disable();
|
|
1594
|
+
},
|
|
1595
|
+
detail(name, metrics) {
|
|
1596
|
+
const attributes = Object.fromEntries(metrics);
|
|
1597
|
+
recordGatewayRestartTraceDetail(`restart.ready.${name}`, metrics);
|
|
1598
|
+
if (logEnabled) log.info(`startup trace: ${name} ${metrics.map(([key, value]) => formatMetric(key, value)).join(" ")}`);
|
|
1599
|
+
emitDiagnosticsTimelineEvent({
|
|
1600
|
+
type: "mark",
|
|
1601
|
+
name: mapTimelineName(name),
|
|
1602
|
+
phase: "startup",
|
|
1603
|
+
attributes: {
|
|
1604
|
+
traceName: name,
|
|
1605
|
+
...attributes
|
|
1606
|
+
}
|
|
1607
|
+
}, timelineOptions());
|
|
1608
|
+
},
|
|
1609
|
+
async measure(name, run, options = {}) {
|
|
1610
|
+
const before = performance.now();
|
|
1611
|
+
const spanId = `gateway-startup-${++spanSequence}`;
|
|
1612
|
+
emitDiagnosticsTimelineEvent({
|
|
1613
|
+
type: "span.start",
|
|
1614
|
+
name: mapTimelineName(name),
|
|
1615
|
+
phase: "startup",
|
|
1616
|
+
spanId,
|
|
1617
|
+
attributes: name === mapTimelineName(name) ? void 0 : { traceName: name }
|
|
1618
|
+
}, timelineOptions());
|
|
1619
|
+
try {
|
|
1620
|
+
const result = await withDiagnosticPhase(mapTimelineName(name), run, { traceName: name });
|
|
1621
|
+
const now = performance.now();
|
|
1622
|
+
emitDiagnosticsTimelineEvent({
|
|
1623
|
+
type: "span.end",
|
|
1624
|
+
name: mapTimelineName(name),
|
|
1625
|
+
phase: "startup",
|
|
1626
|
+
spanId,
|
|
1627
|
+
durationMs: now - before,
|
|
1628
|
+
attributes: name === mapTimelineName(name) ? void 0 : { traceName: name }
|
|
1629
|
+
}, timelineOptions());
|
|
1630
|
+
return result;
|
|
1631
|
+
} catch (error) {
|
|
1632
|
+
const now = performance.now();
|
|
1633
|
+
emitDiagnosticsTimelineEvent({
|
|
1634
|
+
type: "span.error",
|
|
1635
|
+
name: mapTimelineName(name),
|
|
1636
|
+
phase: "startup",
|
|
1637
|
+
spanId,
|
|
1638
|
+
durationMs: now - before,
|
|
1639
|
+
attributes: name === mapTimelineName(name) ? void 0 : { traceName: name },
|
|
1640
|
+
errorName: error instanceof Error ? error.name : typeof error,
|
|
1641
|
+
...options.omitErrorMessage ? {} : { errorMessage: error instanceof Error ? error.message : String(error) }
|
|
1642
|
+
}, timelineOptions());
|
|
1643
|
+
throw error;
|
|
1644
|
+
} finally {
|
|
1645
|
+
const now = performance.now();
|
|
1646
|
+
const eventLoopSample = takeEventLoopSample();
|
|
1647
|
+
emit(name, now - before, now - started, eventLoopSample);
|
|
1648
|
+
emitEventLoopTimelineSample(name, eventLoopSample);
|
|
1649
|
+
last = now;
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
};
|
|
1653
|
+
}
|
|
1654
|
+
function formatRuntimeGatewayAuthTokenWarning() {
|
|
1655
|
+
const base = "Gateway auth token was missing. Generated a runtime token for this startup without changing config; restart will generate a different token.";
|
|
1656
|
+
if (!isNixMode) return `${base} Persist one with \`fengming config set gateway.auth.mode token\` and \`fengming config set gateway.auth.token <token>\`.`;
|
|
1657
|
+
return [
|
|
1658
|
+
base,
|
|
1659
|
+
"In Nix mode, set gateway.auth.token in your Nix-managed FengMing config and rebuild.",
|
|
1660
|
+
"For the first-party Nix flow, see https://github.com/fengming/nix-fengming#quick-start and https://docs.fengming.ai/install/nix."
|
|
1661
|
+
].join(" ");
|
|
1662
|
+
}
|
|
1663
|
+
async function stopTaskRegistryMaintenanceOnDemand() {
|
|
1664
|
+
const { stopTaskRegistryMaintenance } = await import("./task-registry.maintenance-Dx0m2NYh.js");
|
|
1665
|
+
stopTaskRegistryMaintenance();
|
|
1666
|
+
}
|
|
1667
|
+
function createGatewayAuthRateLimiters(rateLimitConfig) {
|
|
1668
|
+
return {
|
|
1669
|
+
rateLimiter: createAuthRateLimiter(rateLimitConfig ?? {}),
|
|
1670
|
+
browserRateLimiter: createAuthRateLimiter({
|
|
1671
|
+
...rateLimitConfig,
|
|
1672
|
+
exemptLoopback: false
|
|
1673
|
+
})
|
|
1674
|
+
};
|
|
1675
|
+
}
|
|
1676
|
+
const runDefaultSetupWizard = async (...args) => {
|
|
1677
|
+
const { runSetupWizard } = await import("./setup-CjtY6cli.js");
|
|
1678
|
+
return runSetupWizard(...args);
|
|
1679
|
+
};
|
|
1680
|
+
async function startGatewayServer(port = 18789, opts = {}) {
|
|
1681
|
+
normalizeStateDirEnv(process.env);
|
|
1682
|
+
const { bootstrapGatewayNetworkRuntime } = await import("./server-network-runtime-hruywBSn.js");
|
|
1683
|
+
bootstrapGatewayNetworkRuntime();
|
|
1684
|
+
const minimalTestGateway = isVitestRuntimeEnv() && process.env.FENGMING_TEST_MINIMAL_GATEWAY === "1";
|
|
1685
|
+
process.env.FENGMING_GATEWAY_PORT = String(port);
|
|
1686
|
+
logAcceptedEnvOption({
|
|
1687
|
+
key: "FENGMING_RAW_STREAM",
|
|
1688
|
+
description: "raw stream logging enabled"
|
|
1689
|
+
});
|
|
1690
|
+
logAcceptedEnvOption({
|
|
1691
|
+
key: "FENGMING_RAW_STREAM_PATH",
|
|
1692
|
+
description: "raw stream log path override"
|
|
1693
|
+
});
|
|
1694
|
+
if (!resumeGatewayRestartTraceFromEnv(process.env, [["source", "env"]])) {
|
|
1695
|
+
const restartHandoff = readGatewayRestartHandoffSync();
|
|
1696
|
+
resumeGatewayRestartTraceFromHandoff(restartHandoff?.restartTrace, [
|
|
1697
|
+
["source", restartHandoff?.source],
|
|
1698
|
+
["restartKind", restartHandoff?.restartKind],
|
|
1699
|
+
["supervisorMode", restartHandoff?.supervisorMode]
|
|
1700
|
+
]);
|
|
1701
|
+
}
|
|
1702
|
+
const startupTrace = createGatewayStartupTrace();
|
|
1703
|
+
const startupConfigModulePromise = import("./server-startup-config-u54lUdWN.js");
|
|
1704
|
+
let startupPluginsModulePromise = null;
|
|
1705
|
+
const loadStartupPluginsModule = () => {
|
|
1706
|
+
startupPluginsModulePromise ??= import("./server-startup-plugins-CerpbOSQ.js");
|
|
1707
|
+
return startupPluginsModulePromise;
|
|
1708
|
+
};
|
|
1709
|
+
const { loadGatewayStartupConfigSnapshot } = await startupConfigModulePromise;
|
|
1710
|
+
const startupConfigLoad = await startupTrace.measure("config.snapshot", () => loadGatewayStartupConfigSnapshot({
|
|
1711
|
+
minimalTestGateway,
|
|
1712
|
+
log,
|
|
1713
|
+
measure: (name, run) => startupTrace.measure(name, run),
|
|
1714
|
+
...opts.startupConfigSnapshotRead ? { initialSnapshotRead: opts.startupConfigSnapshotRead } : {}
|
|
1715
|
+
}));
|
|
1716
|
+
const configSnapshot = startupConfigLoad.snapshot;
|
|
1717
|
+
const emitSecretsStateEvent = (code, message, cfg) => {
|
|
1718
|
+
enqueueSystemEvent(`[${code}] ${message}`, {
|
|
1719
|
+
sessionKey: resolveMainSessionKey(cfg),
|
|
1720
|
+
contextKey: code
|
|
1721
|
+
});
|
|
1722
|
+
};
|
|
1723
|
+
const { createRuntimeSecretsActivator } = await startupConfigModulePromise;
|
|
1724
|
+
const activateRuntimeSecrets = createRuntimeSecretsActivator({
|
|
1725
|
+
logSecrets,
|
|
1726
|
+
emitStateEvent: emitSecretsStateEvent,
|
|
1727
|
+
...startupConfigLoad.pluginMetadataSnapshot ? { pluginMetadataSnapshot: startupConfigLoad.pluginMetadataSnapshot } : {}
|
|
1728
|
+
});
|
|
1729
|
+
let cfgAtStart;
|
|
1730
|
+
let startupInternalWriteHash = null;
|
|
1731
|
+
let startupLastGoodSnapshot = configSnapshot;
|
|
1732
|
+
const startupActivationSourceConfig = configSnapshot.sourceConfig;
|
|
1733
|
+
const startupRuntimeConfig = applyConfigOverrides(configSnapshot.config);
|
|
1734
|
+
startupTrace.setConfig(startupRuntimeConfig);
|
|
1735
|
+
const { prepareGatewayStartupConfig } = await startupConfigModulePromise;
|
|
1736
|
+
const authBootstrap = await startupTrace.measure("config.auth", () => prepareGatewayStartupConfig({
|
|
1737
|
+
configSnapshot,
|
|
1738
|
+
authOverride: opts.auth,
|
|
1739
|
+
tailscaleOverride: opts.tailscale,
|
|
1740
|
+
activateRuntimeSecrets,
|
|
1741
|
+
measure: (name, run, measureOptions) => startupTrace.measure(name, run, measureOptions)
|
|
1742
|
+
}), { omitErrorMessage: true });
|
|
1743
|
+
cfgAtStart = authBootstrap.cfg;
|
|
1744
|
+
startupTrace.setConfig(cfgAtStart);
|
|
1745
|
+
if (authBootstrap.generatedToken) log.warn(formatRuntimeGatewayAuthTokenWarning());
|
|
1746
|
+
const diagnosticsEnabled = isDiagnosticsEnabled(cfgAtStart);
|
|
1747
|
+
setDiagnosticsEnabledForProcess(diagnosticsEnabled);
|
|
1748
|
+
if (diagnosticsEnabled) startDiagnosticHeartbeat(void 0, {
|
|
1749
|
+
getConfig: getRuntimeConfig,
|
|
1750
|
+
startupGraceMs: 6e4
|
|
1751
|
+
});
|
|
1752
|
+
setGatewaySigusr1RestartPolicy({ allowExternal: isRestartEnabled(cfgAtStart) });
|
|
1753
|
+
let getActiveTaskCount = () => 0;
|
|
1754
|
+
setPreRestartDeferralCheck(() => getTotalQueueSize() + getTotalPendingReplies() + getActiveEmbeddedRunCount() + getActiveTaskCount());
|
|
1755
|
+
cfgAtStart = (minimalTestGateway ? {
|
|
1756
|
+
config: cfgAtStart,
|
|
1757
|
+
seededAllowedOrigins: false
|
|
1758
|
+
} : await startupTrace.measure("control-ui.seed", () => maybeSeedControlUiAllowedOriginsAtStartup({
|
|
1759
|
+
config: cfgAtStart,
|
|
1760
|
+
log,
|
|
1761
|
+
runtimeBind: opts.bind,
|
|
1762
|
+
runtimePort: port
|
|
1763
|
+
}))).config;
|
|
1764
|
+
if (startupConfigLoad.wroteConfig || authBootstrap.persistedGeneratedToken) {
|
|
1765
|
+
const startupSnapshot = await startupTrace.measure("config.final-snapshot", () => readConfigFileSnapshot());
|
|
1766
|
+
startupInternalWriteHash = startupSnapshot.hash ?? null;
|
|
1767
|
+
startupLastGoodSnapshot = startupSnapshot;
|
|
1768
|
+
}
|
|
1769
|
+
setRuntimeConfigSnapshot(cfgAtStart, startupLastGoodSnapshot.sourceConfig);
|
|
1770
|
+
const { prepareGatewayPluginBootstrap } = await loadStartupPluginsModule();
|
|
1771
|
+
const pluginBootstrap = await startupTrace.measure("plugins.bootstrap", () => prepareGatewayPluginBootstrap({
|
|
1772
|
+
cfgAtStart,
|
|
1773
|
+
activationSourceConfig: startupActivationSourceConfig,
|
|
1774
|
+
startupRuntimeConfig,
|
|
1775
|
+
pluginMetadataSnapshot: startupConfigLoad.pluginMetadataSnapshot,
|
|
1776
|
+
minimalTestGateway,
|
|
1777
|
+
log,
|
|
1778
|
+
loadRuntimePlugins: false,
|
|
1779
|
+
loadSetupRuntimePlugins: true
|
|
1780
|
+
}));
|
|
1781
|
+
const { gatewayPluginConfigAtStart, defaultWorkspaceDir, deferredConfiguredChannelPluginIds, startupPluginIds, pluginLookUpTable, baseMethods, runtimePluginsLoaded } = pluginBootstrap;
|
|
1782
|
+
const coreGatewayMethodNames = listCoreGatewayMethodNames();
|
|
1783
|
+
setCurrentPluginMetadataSnapshot(pluginLookUpTable, {
|
|
1784
|
+
config: startupActivationSourceConfig,
|
|
1785
|
+
compatibleConfigs: [
|
|
1786
|
+
startupRuntimeConfig,
|
|
1787
|
+
cfgAtStart,
|
|
1788
|
+
gatewayPluginConfigAtStart
|
|
1789
|
+
],
|
|
1790
|
+
env: process.env,
|
|
1791
|
+
workspaceDir: defaultWorkspaceDir
|
|
1792
|
+
});
|
|
1793
|
+
if (pluginLookUpTable) {
|
|
1794
|
+
const metrics = pluginLookUpTable.metrics;
|
|
1795
|
+
startupTrace.detail("plugins.lookup-table", [
|
|
1796
|
+
["registrySnapshotMs", metrics.registrySnapshotMs],
|
|
1797
|
+
["manifestRegistryMs", metrics.manifestRegistryMs],
|
|
1798
|
+
["startupPlanMs", metrics.startupPlanMs],
|
|
1799
|
+
["ownerMapsMs", metrics.ownerMapsMs],
|
|
1800
|
+
["totalMs", metrics.totalMs],
|
|
1801
|
+
["indexPlugins", String(metrics.indexPluginCount)],
|
|
1802
|
+
["indexPluginCount", metrics.indexPluginCount],
|
|
1803
|
+
["manifestPlugins", String(metrics.manifestPluginCount)],
|
|
1804
|
+
["manifestPluginCount", metrics.manifestPluginCount],
|
|
1805
|
+
["startupPlugins", String(metrics.startupPluginCount)],
|
|
1806
|
+
["startupPluginCount", metrics.startupPluginCount],
|
|
1807
|
+
["deferredChannelPlugins", String(metrics.deferredChannelPluginCount)],
|
|
1808
|
+
["deferredChannelPluginCount", metrics.deferredChannelPluginCount]
|
|
1809
|
+
]);
|
|
1810
|
+
}
|
|
1811
|
+
let { pluginRegistry, baseGatewayMethods } = pluginBootstrap;
|
|
1812
|
+
const channelLogs = Object.fromEntries(listGatewayStartupChannelPlugins().map((plugin) => [plugin.id, logChannels.child(plugin.id)]));
|
|
1813
|
+
const channelRuntimeEnvs = Object.fromEntries(Object.entries(channelLogs).map(([id, logger]) => [id, runtimeForLogger(logger)]));
|
|
1814
|
+
const listStartupChannelGatewayMethods = () => {
|
|
1815
|
+
const methods = [];
|
|
1816
|
+
for (const plugin of listGatewayStartupChannelPlugins()) {
|
|
1817
|
+
methods.push(...plugin.gatewayMethods ?? []);
|
|
1818
|
+
for (const descriptor of plugin.gatewayMethodDescriptors ?? []) methods.push(descriptor.name);
|
|
1819
|
+
}
|
|
1820
|
+
return methods;
|
|
1821
|
+
};
|
|
1822
|
+
const listActiveGatewayMethods = (nextBaseGatewayMethods) => uniqueStrings([...nextBaseGatewayMethods, ...listStartupChannelGatewayMethods()]);
|
|
1823
|
+
const runtimeConfig = await startupTrace.measure("runtime.config", async () => {
|
|
1824
|
+
const { resolveGatewayRuntimeConfig } = await import("./server-runtime-config-CIJCcEKA.js");
|
|
1825
|
+
return resolveGatewayRuntimeConfig({
|
|
1826
|
+
cfg: cfgAtStart,
|
|
1827
|
+
port,
|
|
1828
|
+
bind: opts.bind,
|
|
1829
|
+
host: opts.host,
|
|
1830
|
+
controlUiEnabled: opts.controlUiEnabled,
|
|
1831
|
+
openAiChatCompletionsEnabled: opts.openAiChatCompletionsEnabled,
|
|
1832
|
+
openResponsesEnabled: opts.openResponsesEnabled,
|
|
1833
|
+
auth: opts.auth,
|
|
1834
|
+
tailscale: opts.tailscale
|
|
1835
|
+
});
|
|
1836
|
+
});
|
|
1837
|
+
const { bindHost, controlUiEnabled, openAiChatCompletionsEnabled, openAiChatCompletionsConfig, openResponsesEnabled, openResponsesConfig, strictTransportSecurityHeader, controlUiBasePath, controlUiRoot: controlUiRootOverride, resolvedAuth, tailscaleConfig, tailscaleMode } = runtimeConfig;
|
|
1838
|
+
const getResolvedAuth = () => resolveGatewayAuth({
|
|
1839
|
+
authConfig: getActiveSecretsRuntimeSnapshot()?.config.gateway?.auth ?? getRuntimeConfig().gateway?.auth,
|
|
1840
|
+
authOverride: opts.auth,
|
|
1841
|
+
env: process.env,
|
|
1842
|
+
tailscaleMode
|
|
1843
|
+
});
|
|
1844
|
+
const resolveSharedGatewaySessionGenerationForConfig = (config) => resolveSharedGatewaySessionGeneration(resolveGatewayAuth({
|
|
1845
|
+
authConfig: config.gateway?.auth,
|
|
1846
|
+
authOverride: opts.auth,
|
|
1847
|
+
env: process.env,
|
|
1848
|
+
tailscaleMode
|
|
1849
|
+
}), config.gateway?.trustedProxies);
|
|
1850
|
+
const resolveCurrentSharedGatewaySessionGeneration = () => resolveSharedGatewaySessionGeneration(getResolvedAuth(), getRuntimeConfig().gateway?.trustedProxies);
|
|
1851
|
+
const resolveSharedGatewaySessionGenerationForRuntimeSnapshot = () => resolveSharedGatewaySessionGeneration(resolveGatewayAuth({
|
|
1852
|
+
authConfig: getRuntimeConfig().gateway?.auth,
|
|
1853
|
+
authOverride: opts.auth,
|
|
1854
|
+
env: process.env,
|
|
1855
|
+
tailscaleMode
|
|
1856
|
+
}), getRuntimeConfig().gateway?.trustedProxies);
|
|
1857
|
+
const sharedGatewaySessionGenerationState = {
|
|
1858
|
+
current: resolveCurrentSharedGatewaySessionGeneration(),
|
|
1859
|
+
required: null
|
|
1860
|
+
};
|
|
1861
|
+
const preauthHandshakeTimeoutMs = cfgAtStart.gateway?.handshakeTimeoutMs ?? getRuntimeConfig().gateway?.handshakeTimeoutMs;
|
|
1862
|
+
const initialHooksConfig = runtimeConfig.hooksConfig;
|
|
1863
|
+
const initialHookClientIpConfig = resolveHookClientIpConfig(cfgAtStart);
|
|
1864
|
+
const rateLimitConfig = cfgAtStart.gateway?.auth?.rateLimit;
|
|
1865
|
+
const { rateLimiter: authRateLimiter, browserRateLimiter: browserAuthRateLimiter } = createGatewayAuthRateLimiters(rateLimitConfig);
|
|
1866
|
+
const controlUiRootState = await startupTrace.measure("control-ui.root", () => resolveGatewayControlUiRootState({
|
|
1867
|
+
controlUiRootOverride,
|
|
1868
|
+
controlUiEnabled,
|
|
1869
|
+
gatewayRuntime,
|
|
1870
|
+
log
|
|
1871
|
+
}));
|
|
1872
|
+
const wizardRunner = opts.wizardRunner ?? runDefaultSetupWizard;
|
|
1873
|
+
const { wizardSessions, findRunningWizard, purgeWizardSession } = createWizardSessionTracker();
|
|
1874
|
+
const deps = createDefaultDeps();
|
|
1875
|
+
let runtimeState = null;
|
|
1876
|
+
let gatewayCronStartHandled = false;
|
|
1877
|
+
const gatewayTls = await startupTrace.measure("tls.runtime", () => loadGatewayTlsRuntime(cfgAtStart.gateway?.tls, log.child("tls")));
|
|
1878
|
+
if (cfgAtStart.gateway?.tls?.enabled && !gatewayTls.enabled) throw new Error(gatewayTls.error ?? "gateway tls: failed to enable");
|
|
1879
|
+
const serverStartedAt = Date.now();
|
|
1880
|
+
const readinessEventLoopHealth = createGatewayEventLoopHealthMonitor();
|
|
1881
|
+
let startupSidecarsReady = minimalTestGateway;
|
|
1882
|
+
let startupPendingReason = "startup-sidecars";
|
|
1883
|
+
let releaseStartupAccountStarts = () => {};
|
|
1884
|
+
const startupAccountStartsReady = new Promise((resolve) => {
|
|
1885
|
+
releaseStartupAccountStarts = resolve;
|
|
1886
|
+
});
|
|
1887
|
+
const { createChannelManager } = await import("./server-channels-C3MFo4jL.js");
|
|
1888
|
+
const channelManager = createChannelManager({
|
|
1889
|
+
getRuntimeConfig: () => {
|
|
1890
|
+
return resolveGatewayPluginConfig({ config: getRuntimeConfig() });
|
|
1891
|
+
},
|
|
1892
|
+
channelLogs,
|
|
1893
|
+
channelRuntimeEnvs,
|
|
1894
|
+
resolveChannelRuntime: getChannelRuntime,
|
|
1895
|
+
resolveStartupChannelRuntime: getStartupChannelRuntime,
|
|
1896
|
+
getPluginHttpRouteRegistry: () => pluginRegistry,
|
|
1897
|
+
startupTrace,
|
|
1898
|
+
deferStartupAccountStartsUntil: startupAccountStartsReady
|
|
1899
|
+
});
|
|
1900
|
+
const deferStartupSidecars = opts.deferStartupSidecars === true;
|
|
1901
|
+
const isGatewayStartupPending = () => !startupSidecarsReady && !deferStartupSidecars;
|
|
1902
|
+
const getReadiness = createReadinessChecker({
|
|
1903
|
+
channelManager,
|
|
1904
|
+
startedAt: serverStartedAt,
|
|
1905
|
+
getStartupPending: isGatewayStartupPending,
|
|
1906
|
+
getStartupPendingReason: () => startupPendingReason,
|
|
1907
|
+
getEventLoopHealth: readinessEventLoopHealth.snapshot,
|
|
1908
|
+
shouldSkipChannelReadiness: () => isTruthyEnvValue(process.env.FENGMING_SKIP_CHANNELS) || isTruthyEnvValue(process.env.FENGMING_SKIP_PROVIDERS)
|
|
1909
|
+
});
|
|
1910
|
+
log.info("starting HTTP server...");
|
|
1911
|
+
let currentPluginRegistryGatewayContext;
|
|
1912
|
+
const { releasePluginRouteRegistry, httpServer, httpServers, httpBindHosts, startListening, wss, preauthConnectionBudget, clients, broadcast, broadcastToConnIds, agentRunSeq, dedupe, chatRunState, chatRunBuffers, chatDeltaSentAt, chatDeltaLastBroadcastLen, addChatRun, removeChatRun, chatAbortControllers, toolEventRecipients } = await startupTrace.measure("runtime.state", () => createGatewayRuntimeState({
|
|
1913
|
+
cfg: cfgAtStart,
|
|
1914
|
+
bindHost,
|
|
1915
|
+
port,
|
|
1916
|
+
controlUiEnabled,
|
|
1917
|
+
controlUiBasePath,
|
|
1918
|
+
controlUiRoot: controlUiRootState,
|
|
1919
|
+
openAiChatCompletionsEnabled,
|
|
1920
|
+
openAiChatCompletionsConfig,
|
|
1921
|
+
openResponsesEnabled,
|
|
1922
|
+
openResponsesConfig,
|
|
1923
|
+
strictTransportSecurityHeader,
|
|
1924
|
+
resolvedAuth,
|
|
1925
|
+
rateLimiter: authRateLimiter,
|
|
1926
|
+
gatewayTls,
|
|
1927
|
+
getResolvedAuth,
|
|
1928
|
+
hooksConfig: () => runtimeState?.hooksConfig ?? initialHooksConfig,
|
|
1929
|
+
getHookClientIpConfig: () => runtimeState?.hookClientIpConfig ?? initialHookClientIpConfig,
|
|
1930
|
+
pluginRegistry,
|
|
1931
|
+
getPluginRouteRegistry: () => pluginRegistry,
|
|
1932
|
+
getGatewayRequestContext: () => currentPluginRegistryGatewayContext,
|
|
1933
|
+
pinChannelRegistry: !minimalTestGateway,
|
|
1934
|
+
deps,
|
|
1935
|
+
log,
|
|
1936
|
+
logHooks,
|
|
1937
|
+
logPlugins,
|
|
1938
|
+
getReadiness
|
|
1939
|
+
}));
|
|
1940
|
+
const { createGatewayNodeSessionRuntime } = await import("./server-node-session-runtime-BOl2B_ak.js");
|
|
1941
|
+
const { nodeRegistry, nodePresenceTimers, sessionEventSubscribers, sessionMessageSubscribers, nodeSendToSession, nodeSendToAllSubscribed, nodeSubscribe, nodeUnsubscribe, nodeUnsubscribeAll, broadcastVoiceWakeChanged, hasTalkNodeConnected } = createGatewayNodeSessionRuntime({ broadcast });
|
|
1942
|
+
applyGatewayLaneConcurrency(cfgAtStart);
|
|
1943
|
+
runtimeState = createGatewayServerLiveState({
|
|
1944
|
+
hooksConfig: initialHooksConfig,
|
|
1945
|
+
hookClientIpConfig: initialHookClientIpConfig,
|
|
1946
|
+
cronState: createLazyGatewayCronState({
|
|
1947
|
+
cfg: cfgAtStart,
|
|
1948
|
+
deps,
|
|
1949
|
+
broadcast
|
|
1950
|
+
}),
|
|
1951
|
+
gatewayMethods: listActiveGatewayMethods(baseGatewayMethods)
|
|
1952
|
+
});
|
|
1953
|
+
deps.cron = runtimeState.cronState.cron;
|
|
1954
|
+
const pluginHostServices = { get cron() {
|
|
1955
|
+
return runtimeState.cronState.cron;
|
|
1956
|
+
} };
|
|
1957
|
+
let closePreludeStarted = false;
|
|
1958
|
+
let postReadyMaintenanceTimer = null;
|
|
1959
|
+
const clearPostReadyMaintenanceTimer = () => {
|
|
1960
|
+
if (!postReadyMaintenanceTimer) return;
|
|
1961
|
+
clearTimeout(postReadyMaintenanceTimer);
|
|
1962
|
+
postReadyMaintenanceTimer = null;
|
|
1963
|
+
};
|
|
1964
|
+
const markClosePreludeStarted = () => {
|
|
1965
|
+
closePreludeStarted = true;
|
|
1966
|
+
clearPostReadyMaintenanceTimer();
|
|
1967
|
+
};
|
|
1968
|
+
const runClosePrelude = async () => {
|
|
1969
|
+
markClosePreludeStarted();
|
|
1970
|
+
clearPluginMetadataLifecycleCaches();
|
|
1971
|
+
const { runGatewayClosePrelude } = await loadGatewayCloseModule();
|
|
1972
|
+
await runGatewayClosePrelude({
|
|
1973
|
+
...diagnosticsEnabled ? { stopDiagnostics: stopDiagnosticHeartbeat } : {},
|
|
1974
|
+
clearSkillsRefreshTimer: () => {
|
|
1975
|
+
if (!runtimeState?.skillsRefreshTimer) return;
|
|
1976
|
+
clearTimeout(runtimeState.skillsRefreshTimer);
|
|
1977
|
+
runtimeState.skillsRefreshTimer = null;
|
|
1978
|
+
},
|
|
1979
|
+
skillsChangeUnsub: runtimeState.skillsChangeUnsub,
|
|
1980
|
+
disposeAuthRateLimiter: () => authRateLimiter.dispose(),
|
|
1981
|
+
disposeBrowserAuthRateLimiter: () => browserAuthRateLimiter.dispose(),
|
|
1982
|
+
stopModelPricingRefresh: runtimeState.stopModelPricingRefresh,
|
|
1983
|
+
stopChannelHealthMonitor: () => runtimeState?.channelHealthMonitor?.stop(),
|
|
1984
|
+
stopReadinessEventLoopHealth: readinessEventLoopHealth.stop,
|
|
1985
|
+
clearSecretsRuntimeSnapshot,
|
|
1986
|
+
closeMcpServer: closeMcpLoopbackServerOnDemand
|
|
1987
|
+
});
|
|
1988
|
+
};
|
|
1989
|
+
const { getRuntimeSnapshot, startChannels, startChannel, stopChannel, markChannelLoggedOut } = channelManager;
|
|
1990
|
+
const refreshGatewayHealthSnapshotWithRuntime = (opts) => refreshGatewayHealthSnapshot({
|
|
1991
|
+
...opts,
|
|
1992
|
+
getRuntimeSnapshot,
|
|
1993
|
+
getEventLoopHealth: readinessEventLoopHealth.snapshot
|
|
1994
|
+
});
|
|
1995
|
+
const stopRegisteredPostReadySidecars = async () => {
|
|
1996
|
+
const postReadySidecars = runtimeState.postReadySidecars;
|
|
1997
|
+
runtimeState.postReadySidecars = [];
|
|
1998
|
+
for (const postReadySidecar of postReadySidecars) await postReadySidecar.stop();
|
|
1999
|
+
};
|
|
2000
|
+
const stopRegisteredGatewayLifetimeSidecars = async () => {
|
|
2001
|
+
const gatewayLifetimeSidecars = runtimeState.gatewayLifetimeSidecars;
|
|
2002
|
+
runtimeState.gatewayLifetimeSidecars = [];
|
|
2003
|
+
for (const gatewayLifetimeSidecar of gatewayLifetimeSidecars) await gatewayLifetimeSidecar.stop();
|
|
2004
|
+
};
|
|
2005
|
+
const createCloseHandler = () => async (opts) => {
|
|
2006
|
+
const channelIds = listLoadedChannelPlugins().map((plugin) => plugin.id);
|
|
2007
|
+
const { createGatewayCloseHandler, drainActiveSessionsForShutdown } = await loadGatewayCloseModule();
|
|
2008
|
+
await createGatewayCloseHandler({
|
|
2009
|
+
bonjourStop: runtimeState.bonjourStop,
|
|
2010
|
+
tailscaleCleanup: runtimeState.tailscaleCleanup,
|
|
2011
|
+
releasePluginRouteRegistry,
|
|
2012
|
+
channelIds,
|
|
2013
|
+
stopChannel,
|
|
2014
|
+
pluginServices: runtimeState.pluginServices,
|
|
2015
|
+
postReadySidecars: runtimeState.postReadySidecars,
|
|
2016
|
+
cron: runtimeState.cronState.cron,
|
|
2017
|
+
heartbeatRunner: runtimeState.heartbeatRunner,
|
|
2018
|
+
updateCheckStop: runtimeState.stopGatewayUpdateCheck,
|
|
2019
|
+
stopTaskRegistryMaintenance: stopTaskRegistryMaintenanceOnDemand,
|
|
2020
|
+
nodePresenceTimers,
|
|
2021
|
+
broadcast,
|
|
2022
|
+
tickInterval: runtimeState.tickInterval,
|
|
2023
|
+
healthInterval: runtimeState.healthInterval,
|
|
2024
|
+
dedupeCleanup: runtimeState.dedupeCleanup,
|
|
2025
|
+
mediaCleanup: runtimeState.mediaCleanup,
|
|
2026
|
+
agentUnsub: runtimeState.agentUnsub,
|
|
2027
|
+
heartbeatUnsub: runtimeState.heartbeatUnsub,
|
|
2028
|
+
transcriptUnsub: runtimeState.transcriptUnsub,
|
|
2029
|
+
lifecycleUnsub: runtimeState.lifecycleUnsub,
|
|
2030
|
+
chatRunState,
|
|
2031
|
+
chatAbortControllers,
|
|
2032
|
+
removeChatRun,
|
|
2033
|
+
agentRunSeq,
|
|
2034
|
+
nodeSendToSession,
|
|
2035
|
+
getPendingReplyCount: getTotalPendingReplies,
|
|
2036
|
+
clients,
|
|
2037
|
+
configReloader: runtimeState.configReloader,
|
|
2038
|
+
wss,
|
|
2039
|
+
httpServer,
|
|
2040
|
+
httpServers,
|
|
2041
|
+
drainActiveSessionsForShutdown
|
|
2042
|
+
})(opts);
|
|
2043
|
+
};
|
|
2044
|
+
let clearFallbackGatewayContextForServer = () => {};
|
|
2045
|
+
const closeOnStartupFailure = async () => {
|
|
2046
|
+
try {
|
|
2047
|
+
await stopRegisteredGatewayLifetimeSidecars();
|
|
2048
|
+
await stopRegisteredPostReadySidecars();
|
|
2049
|
+
await runClosePrelude();
|
|
2050
|
+
await createCloseHandler()({ reason: "gateway startup failed" });
|
|
2051
|
+
} finally {
|
|
2052
|
+
clearFallbackGatewayContextForServer();
|
|
2053
|
+
}
|
|
2054
|
+
};
|
|
2055
|
+
const broadcastVoiceWakeRoutingChanged = (config) => {
|
|
2056
|
+
broadcast("voicewake.routing.changed", { config }, { dropIfSlow: true });
|
|
2057
|
+
};
|
|
2058
|
+
try {
|
|
2059
|
+
const earlyRuntime = await startupTrace.measure("runtime.early", () => loadGatewayStartupEarlyModule().then(({ startGatewayEarlyRuntime }) => startGatewayEarlyRuntime({
|
|
2060
|
+
minimalTestGateway,
|
|
2061
|
+
cfgAtStart,
|
|
2062
|
+
port,
|
|
2063
|
+
gatewayTls,
|
|
2064
|
+
gatewayDirectReachable: !isLoopbackHost(bindHost),
|
|
2065
|
+
tailscaleMode,
|
|
2066
|
+
log,
|
|
2067
|
+
logDiscovery,
|
|
2068
|
+
nodeRegistry,
|
|
2069
|
+
pluginRegistry,
|
|
2070
|
+
broadcast,
|
|
2071
|
+
nodeSendToAllSubscribed,
|
|
2072
|
+
getPresenceVersion,
|
|
2073
|
+
getHealthVersion,
|
|
2074
|
+
refreshGatewayHealthSnapshot: refreshGatewayHealthSnapshotWithRuntime,
|
|
2075
|
+
logHealth,
|
|
2076
|
+
dedupe,
|
|
2077
|
+
chatAbortControllers,
|
|
2078
|
+
chatRunState,
|
|
2079
|
+
chatRunBuffers,
|
|
2080
|
+
chatDeltaSentAt,
|
|
2081
|
+
chatDeltaLastBroadcastLen,
|
|
2082
|
+
removeChatRun,
|
|
2083
|
+
agentRunSeq,
|
|
2084
|
+
nodeSendToSession,
|
|
2085
|
+
...typeof cfgAtStart.media?.ttlHours === "number" ? { mediaCleanupTtlMs: resolveMediaCleanupTtlMs(cfgAtStart.media.ttlHours) } : {},
|
|
2086
|
+
skillsRefreshDelayMs: runtimeState.skillsRefreshDelayMs,
|
|
2087
|
+
getSkillsRefreshTimer: () => runtimeState.skillsRefreshTimer,
|
|
2088
|
+
setSkillsRefreshTimer: (timer) => {
|
|
2089
|
+
runtimeState.skillsRefreshTimer = timer;
|
|
2090
|
+
},
|
|
2091
|
+
getRuntimeConfig,
|
|
2092
|
+
startupTrace
|
|
2093
|
+
})));
|
|
2094
|
+
runtimeState.bonjourStop = earlyRuntime.bonjourStop;
|
|
2095
|
+
getActiveTaskCount = earlyRuntime.getActiveTaskCount;
|
|
2096
|
+
runtimeState.skillsChangeUnsub = earlyRuntime.skillsChangeUnsub;
|
|
2097
|
+
const [{ startGatewayEventSubscriptions }, { startGatewayRuntimeServices }] = await startupTrace.measure("runtime.post-early-imports", () => Promise.all([import("./server-runtime-subscriptions-W39HeyoT.js"), import("./server-runtime-startup-services-eXz0irXp.js")]));
|
|
2098
|
+
const runtimeSubscriptions = await startupTrace.measure("runtime.subscriptions", () => startGatewayEventSubscriptions({
|
|
2099
|
+
broadcast,
|
|
2100
|
+
broadcastToConnIds,
|
|
2101
|
+
nodeSendToSession,
|
|
2102
|
+
agentRunSeq,
|
|
2103
|
+
chatRunState,
|
|
2104
|
+
toolEventRecipients,
|
|
2105
|
+
sessionEventSubscribers,
|
|
2106
|
+
sessionMessageSubscribers,
|
|
2107
|
+
chatAbortControllers
|
|
2108
|
+
}));
|
|
2109
|
+
Object.assign(runtimeState, runtimeSubscriptions);
|
|
2110
|
+
const runtimeServices = await startupTrace.measure("runtime.services", () => startGatewayRuntimeServices({
|
|
2111
|
+
minimalTestGateway,
|
|
2112
|
+
cfgAtStart,
|
|
2113
|
+
channelManager,
|
|
2114
|
+
log
|
|
2115
|
+
}));
|
|
2116
|
+
Object.assign(runtimeState, runtimeServices);
|
|
2117
|
+
const { execApprovalManager, pluginApprovalManager, extraHandlers, coreGatewayHandlers } = await startupTrace.measure("gateway.handlers", async () => {
|
|
2118
|
+
const [{ createGatewayAuxHandlers }, { coreGatewayHandlers }] = await Promise.all([import("./server-aux-handlers-BwRdYdub.js"), import("./server-methods-BmlBQJMD.js")]);
|
|
2119
|
+
return {
|
|
2120
|
+
...createGatewayAuxHandlers({
|
|
2121
|
+
log,
|
|
2122
|
+
activateRuntimeSecrets,
|
|
2123
|
+
sharedGatewaySessionGenerationState,
|
|
2124
|
+
resolveSharedGatewaySessionGenerationForConfig,
|
|
2125
|
+
clients,
|
|
2126
|
+
startChannel,
|
|
2127
|
+
stopChannel,
|
|
2128
|
+
logChannels
|
|
2129
|
+
}),
|
|
2130
|
+
coreGatewayHandlers
|
|
2131
|
+
};
|
|
2132
|
+
});
|
|
2133
|
+
const attachedGatewayExtraHandlers = {
|
|
2134
|
+
...pluginRegistry.gatewayHandlers,
|
|
2135
|
+
...extraHandlers
|
|
2136
|
+
};
|
|
2137
|
+
let attachedPluginGatewayHandlerKeys = new Set(Object.keys(pluginRegistry.gatewayHandlers));
|
|
2138
|
+
const buildAttachedGatewayMethodRegistry = (nextPluginRegistry) => {
|
|
2139
|
+
const coreDescriptorHandlers = { ...coreGatewayHandlers };
|
|
2140
|
+
const auxHandlers = {};
|
|
2141
|
+
for (const [method, handler] of Object.entries(extraHandlers)) if (isCoreGatewayMethodClassified(method)) coreDescriptorHandlers[method] = handler;
|
|
2142
|
+
else auxHandlers[method] = handler;
|
|
2143
|
+
return createGatewayMethodRegistry([
|
|
2144
|
+
...createCoreGatewayMethodDescriptors(coreDescriptorHandlers),
|
|
2145
|
+
...createPluginGatewayMethodDescriptors(nextPluginRegistry),
|
|
2146
|
+
...createGatewayMethodDescriptorsFromHandlers({
|
|
2147
|
+
handlers: auxHandlers,
|
|
2148
|
+
owner: {
|
|
2149
|
+
kind: "aux",
|
|
2150
|
+
area: "gateway-extra"
|
|
2151
|
+
},
|
|
2152
|
+
defaultScope: ADMIN_SCOPE
|
|
2153
|
+
})
|
|
2154
|
+
]);
|
|
2155
|
+
};
|
|
2156
|
+
let attachedGatewayMethodRegistry = buildAttachedGatewayMethodRegistry(pluginRegistry);
|
|
2157
|
+
const listAttachedGatewayMethods = () => {
|
|
2158
|
+
const methods = attachedGatewayMethodRegistry.listAdvertisedMethods();
|
|
2159
|
+
methods.push(...listStartupChannelGatewayMethods());
|
|
2160
|
+
return uniqueStrings(methods);
|
|
2161
|
+
};
|
|
2162
|
+
runtimeState.gatewayMethods.splice(0, runtimeState.gatewayMethods.length, ...listAttachedGatewayMethods());
|
|
2163
|
+
const replaceAttachedPluginRuntime = (loaded) => {
|
|
2164
|
+
pluginRegistry = loaded.pluginRegistry;
|
|
2165
|
+
baseGatewayMethods = loaded.gatewayMethods;
|
|
2166
|
+
for (const key of attachedPluginGatewayHandlerKeys) delete attachedGatewayExtraHandlers[key];
|
|
2167
|
+
Object.assign(attachedGatewayExtraHandlers, pluginRegistry.gatewayHandlers);
|
|
2168
|
+
attachedPluginGatewayHandlerKeys = new Set(Object.keys(pluginRegistry.gatewayHandlers));
|
|
2169
|
+
attachedGatewayMethodRegistry = buildAttachedGatewayMethodRegistry(pluginRegistry);
|
|
2170
|
+
runtimeState.gatewayMethods.splice(0, runtimeState.gatewayMethods.length, ...listAttachedGatewayMethods());
|
|
2171
|
+
pinActivePluginHttpRouteRegistry(pluginRegistry);
|
|
2172
|
+
pinActivePluginChannelRegistry(pluginRegistry);
|
|
2173
|
+
};
|
|
2174
|
+
const refreshAttachedGatewayDiscovery = async (nextPluginRegistry) => {
|
|
2175
|
+
if (minimalTestGateway) return;
|
|
2176
|
+
try {
|
|
2177
|
+
const stopPreviousDiscovery = runtimeState.bonjourStop;
|
|
2178
|
+
runtimeState.bonjourStop = null;
|
|
2179
|
+
if (stopPreviousDiscovery) try {
|
|
2180
|
+
await stopPreviousDiscovery();
|
|
2181
|
+
} catch (err) {
|
|
2182
|
+
logDiscovery.warn(`gateway discovery stop failed before plugin refresh: ${String(err)}`);
|
|
2183
|
+
}
|
|
2184
|
+
const { startGatewayPluginDiscovery } = await loadGatewayStartupEarlyModule();
|
|
2185
|
+
runtimeState.bonjourStop = await startGatewayPluginDiscovery({
|
|
2186
|
+
minimalTestGateway,
|
|
2187
|
+
cfgAtStart,
|
|
2188
|
+
port,
|
|
2189
|
+
gatewayTls,
|
|
2190
|
+
gatewayDirectReachable: !isLoopbackHost(bindHost),
|
|
2191
|
+
tailscaleMode,
|
|
2192
|
+
logDiscovery,
|
|
2193
|
+
pluginRegistry: nextPluginRegistry
|
|
2194
|
+
});
|
|
2195
|
+
} catch (err) {
|
|
2196
|
+
logDiscovery.warn(`gateway discovery refresh failed after plugin load: ${String(err)}`);
|
|
2197
|
+
}
|
|
2198
|
+
};
|
|
2199
|
+
const listAttachedChannelConfigTargets = () => new Map(listGatewayStartupChannelPlugins().map((plugin) => [plugin.id, listChannelPluginConfigTargetIds({
|
|
2200
|
+
channelId: plugin.id,
|
|
2201
|
+
pluginId: getLoadedChannelPluginEntryById(plugin.id)?.pluginId,
|
|
2202
|
+
aliases: plugin.meta.aliases
|
|
2203
|
+
})]));
|
|
2204
|
+
const reloadAttachedGatewayPlugins = async (params) => {
|
|
2205
|
+
const beforeChannelTargets = listAttachedChannelConfigTargets();
|
|
2206
|
+
const beforeChannelIds = new Set(beforeChannelTargets.keys());
|
|
2207
|
+
const [{ loadPluginLookUpTable }, { prepareGatewayPluginLoad }, { startPluginServices }] = await Promise.all([
|
|
2208
|
+
import("./plugin-lookup-table-BapN8jXZ.js"),
|
|
2209
|
+
import("./server-plugin-bootstrap-Vco-EpxY.js"),
|
|
2210
|
+
import("./services-B6WZ_7bn.js")
|
|
2211
|
+
]);
|
|
2212
|
+
const nextPluginLookUpTable = loadPluginLookUpTable({
|
|
2213
|
+
config: params.nextConfig,
|
|
2214
|
+
workspaceDir: defaultWorkspaceDir,
|
|
2215
|
+
env: process.env,
|
|
2216
|
+
activationSourceConfig: params.nextConfig
|
|
2217
|
+
});
|
|
2218
|
+
const nextStartupPluginIds = new Set(nextPluginLookUpTable.startup.pluginIds);
|
|
2219
|
+
const nextStartupChannelIds = /* @__PURE__ */ new Set();
|
|
2220
|
+
for (const plugin of nextPluginLookUpTable.manifestRegistry.plugins) {
|
|
2221
|
+
if (!nextStartupPluginIds.has(plugin.id)) continue;
|
|
2222
|
+
if (plugin.channels.length === 0) {
|
|
2223
|
+
nextStartupChannelIds.add(plugin.id);
|
|
2224
|
+
continue;
|
|
2225
|
+
}
|
|
2226
|
+
for (const channelId of plugin.channels) nextStartupChannelIds.add(channelId);
|
|
2227
|
+
}
|
|
2228
|
+
const channelsToStopBeforeReplace = /* @__PURE__ */ new Set();
|
|
2229
|
+
for (const channelId of beforeChannelIds) {
|
|
2230
|
+
const targetIds = beforeChannelTargets.get(channelId) ?? new Set([channelId]);
|
|
2231
|
+
if (!nextStartupChannelIds.has(channelId) || pluginConfigTargetsChanged(targetIds, params.changedPaths)) channelsToStopBeforeReplace.add(channelId);
|
|
2232
|
+
}
|
|
2233
|
+
await params.beforeReplace(channelsToStopBeforeReplace);
|
|
2234
|
+
setCurrentPluginMetadataSnapshot(nextPluginLookUpTable, {
|
|
2235
|
+
config: params.nextConfig,
|
|
2236
|
+
env: process.env,
|
|
2237
|
+
workspaceDir: defaultWorkspaceDir
|
|
2238
|
+
});
|
|
2239
|
+
const loaded = prepareGatewayPluginLoad({
|
|
2240
|
+
cfg: params.nextConfig,
|
|
2241
|
+
workspaceDir: defaultWorkspaceDir,
|
|
2242
|
+
log,
|
|
2243
|
+
coreGatewayMethodNames,
|
|
2244
|
+
hostServices: pluginHostServices,
|
|
2245
|
+
baseMethods,
|
|
2246
|
+
pluginLookUpTable: nextPluginLookUpTable
|
|
2247
|
+
});
|
|
2248
|
+
const previousPluginServices = runtimeState.pluginServices;
|
|
2249
|
+
runtimeState.pluginServices = null;
|
|
2250
|
+
if (previousPluginServices) await previousPluginServices.stop().catch((err) => {
|
|
2251
|
+
log.warn(`plugin services stop failed during reload: ${String(err)}`);
|
|
2252
|
+
});
|
|
2253
|
+
replaceAttachedPluginRuntime(loaded);
|
|
2254
|
+
await refreshAttachedGatewayDiscovery(loaded.pluginRegistry);
|
|
2255
|
+
try {
|
|
2256
|
+
runtimeState.pluginServices = await startPluginServices({
|
|
2257
|
+
registry: loaded.pluginRegistry,
|
|
2258
|
+
config: params.nextConfig,
|
|
2259
|
+
workspaceDir: defaultWorkspaceDir
|
|
2260
|
+
});
|
|
2261
|
+
} catch (err) {
|
|
2262
|
+
log.warn(`plugin services failed to start after reload: ${String(err)}`);
|
|
2263
|
+
}
|
|
2264
|
+
const afterChannelTargets = listAttachedChannelConfigTargets();
|
|
2265
|
+
const afterChannelIds = new Set(afterChannelTargets.keys());
|
|
2266
|
+
const restartChannels = /* @__PURE__ */ new Set();
|
|
2267
|
+
for (const channelId of new Set([...beforeChannelIds, ...afterChannelIds])) {
|
|
2268
|
+
const targetIds = afterChannelTargets.get(channelId) ?? beforeChannelTargets.get(channelId) ?? new Set([channelId]);
|
|
2269
|
+
if (afterChannelIds.has(channelId) && (beforeChannelIds.has(channelId) !== afterChannelIds.has(channelId) || pluginConfigTargetsChanged(targetIds, params.changedPaths))) restartChannels.add(channelId);
|
|
2270
|
+
}
|
|
2271
|
+
return {
|
|
2272
|
+
restartChannels,
|
|
2273
|
+
activeChannels: afterChannelIds
|
|
2274
|
+
};
|
|
2275
|
+
};
|
|
2276
|
+
const unavailableGatewayMethods = new Set(minimalTestGateway ? [] : STARTUP_UNAVAILABLE_GATEWAY_METHODS);
|
|
2277
|
+
const gatewayRequestContext = await startupTrace.measure("gateway.request-context", async () => {
|
|
2278
|
+
const { createGatewayRequestContext } = await import("./server-request-context-DrlcKs-I.js");
|
|
2279
|
+
return createGatewayRequestContext({
|
|
2280
|
+
deps,
|
|
2281
|
+
runtimeState,
|
|
2282
|
+
getRuntimeConfig,
|
|
2283
|
+
execApprovalManager,
|
|
2284
|
+
pluginApprovalManager,
|
|
2285
|
+
loadGatewayModelCatalog,
|
|
2286
|
+
getHealthCache,
|
|
2287
|
+
refreshHealthSnapshot: refreshGatewayHealthSnapshotWithRuntime,
|
|
2288
|
+
logHealth,
|
|
2289
|
+
logGateway: log,
|
|
2290
|
+
incrementPresenceVersion,
|
|
2291
|
+
getHealthVersion,
|
|
2292
|
+
broadcast,
|
|
2293
|
+
broadcastToConnIds,
|
|
2294
|
+
nodeSendToSession,
|
|
2295
|
+
nodeSendToAllSubscribed,
|
|
2296
|
+
nodeSubscribe,
|
|
2297
|
+
nodeUnsubscribe,
|
|
2298
|
+
nodeUnsubscribeAll,
|
|
2299
|
+
hasConnectedTalkNode: hasTalkNodeConnected,
|
|
2300
|
+
clients,
|
|
2301
|
+
enforceSharedGatewayAuthGenerationForConfigWrite: (nextConfig) => {
|
|
2302
|
+
enforceSharedGatewaySessionGenerationForConfigWrite({
|
|
2303
|
+
state: sharedGatewaySessionGenerationState,
|
|
2304
|
+
nextConfig,
|
|
2305
|
+
resolveRuntimeSnapshotGeneration: resolveSharedGatewaySessionGenerationForRuntimeSnapshot,
|
|
2306
|
+
clients
|
|
2307
|
+
});
|
|
2308
|
+
},
|
|
2309
|
+
nodeRegistry,
|
|
2310
|
+
agentRunSeq,
|
|
2311
|
+
chatAbortControllers,
|
|
2312
|
+
chatAbortedRuns: chatRunState.abortedRuns,
|
|
2313
|
+
chatRunBuffers: chatRunState.buffers,
|
|
2314
|
+
chatDeltaSentAt: chatRunState.deltaSentAt,
|
|
2315
|
+
chatDeltaLastBroadcastLen: chatRunState.deltaLastBroadcastLen,
|
|
2316
|
+
chatDeltaLastBroadcastText: chatRunState.deltaLastBroadcastText,
|
|
2317
|
+
agentDeltaSentAt: chatRunState.agentDeltaSentAt,
|
|
2318
|
+
bufferedAgentEvents: chatRunState.bufferedAgentEvents,
|
|
2319
|
+
clearChatRunState: chatRunState.clearRun,
|
|
2320
|
+
addChatRun,
|
|
2321
|
+
removeChatRun,
|
|
2322
|
+
subscribeSessionEvents: sessionEventSubscribers.subscribe,
|
|
2323
|
+
unsubscribeSessionEvents: sessionEventSubscribers.unsubscribe,
|
|
2324
|
+
subscribeSessionMessageEvents: sessionMessageSubscribers.subscribe,
|
|
2325
|
+
unsubscribeSessionMessageEvents: sessionMessageSubscribers.unsubscribe,
|
|
2326
|
+
unsubscribeAllSessionEvents: (connId) => {
|
|
2327
|
+
sessionEventSubscribers.unsubscribe(connId);
|
|
2328
|
+
sessionMessageSubscribers.unsubscribeAll(connId);
|
|
2329
|
+
},
|
|
2330
|
+
getSessionEventSubscriberConnIds: sessionEventSubscribers.getAll,
|
|
2331
|
+
registerToolEventRecipient: toolEventRecipients.add,
|
|
2332
|
+
dedupe,
|
|
2333
|
+
wizardSessions,
|
|
2334
|
+
findRunningWizard,
|
|
2335
|
+
purgeWizardSession,
|
|
2336
|
+
getRuntimeSnapshot,
|
|
2337
|
+
getEventLoopHealth: readinessEventLoopHealth.snapshot,
|
|
2338
|
+
startChannel,
|
|
2339
|
+
stopChannel,
|
|
2340
|
+
markChannelLoggedOut,
|
|
2341
|
+
wizardRunner,
|
|
2342
|
+
broadcastVoiceWakeChanged,
|
|
2343
|
+
unavailableGatewayMethods,
|
|
2344
|
+
broadcastVoiceWakeRoutingChanged
|
|
2345
|
+
});
|
|
2346
|
+
});
|
|
2347
|
+
currentPluginRegistryGatewayContext = gatewayRequestContext;
|
|
2348
|
+
const fallbackGatewayContextCleanup = setFallbackGatewayContextResolver(() => gatewayRequestContext);
|
|
2349
|
+
clearFallbackGatewayContextForServer = typeof fallbackGatewayContextCleanup === "function" ? () => {
|
|
2350
|
+
fallbackGatewayContextCleanup();
|
|
2351
|
+
} : () => {};
|
|
2352
|
+
if (!minimalTestGateway) {
|
|
2353
|
+
if (runtimePluginsLoaded && deferredConfiguredChannelPluginIds.length > 0) {
|
|
2354
|
+
const { reloadDeferredGatewayPlugins } = await import("./server-plugin-bootstrap-Vco-EpxY.js");
|
|
2355
|
+
const loaded = await startupTrace.measure("gateway.deferred-plugins", () => reloadDeferredGatewayPlugins({
|
|
2356
|
+
cfg: gatewayPluginConfigAtStart,
|
|
2357
|
+
activationSourceConfig: startupActivationSourceConfig,
|
|
2358
|
+
workspaceDir: defaultWorkspaceDir,
|
|
2359
|
+
log,
|
|
2360
|
+
coreGatewayMethodNames,
|
|
2361
|
+
hostServices: pluginHostServices,
|
|
2362
|
+
baseMethods,
|
|
2363
|
+
pluginIds: startupPluginIds,
|
|
2364
|
+
pluginLookUpTable,
|
|
2365
|
+
logDiagnostics: false
|
|
2366
|
+
}));
|
|
2367
|
+
replaceAttachedPluginRuntime(loaded);
|
|
2368
|
+
await refreshAttachedGatewayDiscovery(loaded.pluginRegistry);
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
const [{ attachGatewayWsHandlers }, { listPluginNodeCapabilities }] = await startupTrace.measure("gateway.ws-imports", () => Promise.all([import("./server-ws-runtime-BfznAnbI.js"), import("./route-capability-aTQ4px-E.js")]));
|
|
2372
|
+
const pluginSurfaceScheme = gatewayTls.enabled ? "https" : "http";
|
|
2373
|
+
await startupTrace.measure("gateway.ws-attach", () => attachGatewayWsHandlers({
|
|
2374
|
+
wss,
|
|
2375
|
+
clients,
|
|
2376
|
+
preauthConnectionBudget,
|
|
2377
|
+
port,
|
|
2378
|
+
gatewayHost: bindHost ?? void 0,
|
|
2379
|
+
pluginSurfaceScheme,
|
|
2380
|
+
getPluginNodeCapabilities: () => listPluginNodeCapabilities(pluginRegistry),
|
|
2381
|
+
resolvedAuth,
|
|
2382
|
+
getResolvedAuth,
|
|
2383
|
+
getRequiredSharedGatewaySessionGeneration: () => getRequiredSharedGatewaySessionGeneration(sharedGatewaySessionGenerationState),
|
|
2384
|
+
rateLimiter: authRateLimiter,
|
|
2385
|
+
browserRateLimiter: browserAuthRateLimiter,
|
|
2386
|
+
preauthHandshakeTimeoutMs,
|
|
2387
|
+
isStartupPending: isGatewayStartupPending,
|
|
2388
|
+
gatewayMethods: runtimeState.gatewayMethods,
|
|
2389
|
+
events: GATEWAY_EVENTS,
|
|
2390
|
+
logGateway: log,
|
|
2391
|
+
logHealth,
|
|
2392
|
+
logWsControl,
|
|
2393
|
+
extraHandlers: attachedGatewayExtraHandlers,
|
|
2394
|
+
getMethodRegistry: () => attachedGatewayMethodRegistry,
|
|
2395
|
+
broadcast,
|
|
2396
|
+
context: gatewayRequestContext
|
|
2397
|
+
}));
|
|
2398
|
+
await startupTrace.measure("http.listen", () => startListening());
|
|
2399
|
+
startupTrace.mark("http.bound");
|
|
2400
|
+
const sessionDeliveryRecoveryMaxEnqueuedAt = Date.now();
|
|
2401
|
+
let postAttachRuntimeReturned = false;
|
|
2402
|
+
let scheduledServicesActivated = false;
|
|
2403
|
+
let scheduledServicesModulePromise = null;
|
|
2404
|
+
const loadScheduledServicesModule = () => {
|
|
2405
|
+
scheduledServicesModulePromise ??= import("./server-runtime-services-BNcH4vhR.js");
|
|
2406
|
+
return scheduledServicesModulePromise;
|
|
2407
|
+
};
|
|
2408
|
+
const activateScheduledServicesWhenReady = () => {
|
|
2409
|
+
if (closePreludeStarted || !postAttachRuntimeReturned || !startupSidecarsReady || scheduledServicesActivated) return;
|
|
2410
|
+
scheduledServicesActivated = true;
|
|
2411
|
+
loadScheduledServicesModule().then((gatewayRuntimeServices) => {
|
|
2412
|
+
if (closePreludeStarted) return;
|
|
2413
|
+
const activated = gatewayRuntimeServices.activateGatewayScheduledServices({
|
|
2414
|
+
minimalTestGateway,
|
|
2415
|
+
cfgAtStart,
|
|
2416
|
+
deps,
|
|
2417
|
+
sessionDeliveryRecoveryMaxEnqueuedAt,
|
|
2418
|
+
cron: runtimeState.cronState.cron,
|
|
2419
|
+
startCron: false,
|
|
2420
|
+
logCron,
|
|
2421
|
+
log,
|
|
2422
|
+
pluginLookUpTable
|
|
2423
|
+
});
|
|
2424
|
+
runtimeState.heartbeatRunner = activated.heartbeatRunner;
|
|
2425
|
+
runtimeState.stopModelPricingRefresh = activated.stopModelPricingRefresh;
|
|
2426
|
+
});
|
|
2427
|
+
};
|
|
2428
|
+
({stopGatewayUpdateCheck: runtimeState.stopGatewayUpdateCheck, tailscaleCleanup: runtimeState.tailscaleCleanup, pluginServices: runtimeState.pluginServices} = await startupTrace.measure("runtime.post-attach", () => loadGatewayStartupPostAttachModule().then(({ startGatewayPostAttachRuntime, stopPostReadySidecarsAfterCloseStarted }) => startGatewayPostAttachRuntime({
|
|
2429
|
+
minimalTestGateway,
|
|
2430
|
+
cfgAtStart,
|
|
2431
|
+
bindHost,
|
|
2432
|
+
bindHosts: httpBindHosts,
|
|
2433
|
+
port,
|
|
2434
|
+
tlsEnabled: gatewayTls.enabled,
|
|
2435
|
+
log,
|
|
2436
|
+
isNixMode,
|
|
2437
|
+
startupStartedAt: opts.startupStartedAt,
|
|
2438
|
+
broadcast,
|
|
2439
|
+
tailscaleMode,
|
|
2440
|
+
resetOnExit: tailscaleConfig.resetOnExit ?? false,
|
|
2441
|
+
preserveFunnel: tailscaleConfig.preserveFunnel ?? false,
|
|
2442
|
+
controlUiBasePath,
|
|
2443
|
+
logTailscale,
|
|
2444
|
+
gatewayPluginConfigAtStart,
|
|
2445
|
+
pluginRegistry,
|
|
2446
|
+
defaultWorkspaceDir,
|
|
2447
|
+
deps,
|
|
2448
|
+
startChannels,
|
|
2449
|
+
logHooks,
|
|
2450
|
+
logChannels,
|
|
2451
|
+
unavailableGatewayMethods,
|
|
2452
|
+
loadStartupPlugins: runtimePluginsLoaded ? void 0 : async () => {
|
|
2453
|
+
const { loadGatewayStartupPluginRuntime } = await loadStartupPluginsModule();
|
|
2454
|
+
return loadGatewayStartupPluginRuntime({
|
|
2455
|
+
cfg: gatewayPluginConfigAtStart,
|
|
2456
|
+
activationSourceConfig: startupActivationSourceConfig,
|
|
2457
|
+
workspaceDir: defaultWorkspaceDir,
|
|
2458
|
+
log,
|
|
2459
|
+
baseMethods,
|
|
2460
|
+
coreGatewayMethodNames,
|
|
2461
|
+
hostServices: pluginHostServices,
|
|
2462
|
+
startupPluginIds,
|
|
2463
|
+
pluginLookUpTable,
|
|
2464
|
+
startupTrace
|
|
2465
|
+
});
|
|
2466
|
+
},
|
|
2467
|
+
onStartupPluginsLoading: () => {
|
|
2468
|
+
startupPendingReason = "startup-sidecars";
|
|
2469
|
+
},
|
|
2470
|
+
onStartupPluginsLoaded: async (loaded) => {
|
|
2471
|
+
replaceAttachedPluginRuntime(loaded);
|
|
2472
|
+
startupPendingReason = "startup-sidecars";
|
|
2473
|
+
await refreshAttachedGatewayDiscovery(loaded.pluginRegistry);
|
|
2474
|
+
},
|
|
2475
|
+
getCronService: () => runtimeState?.cronState.cron,
|
|
2476
|
+
onChannelsStarted: () => {
|
|
2477
|
+
releaseStartupAccountStarts();
|
|
2478
|
+
},
|
|
2479
|
+
onPluginServices: (pluginServices) => {
|
|
2480
|
+
runtimeState.pluginServices = pluginServices;
|
|
2481
|
+
},
|
|
2482
|
+
onPostReadySidecars: (postReadySidecars) => {
|
|
2483
|
+
runtimeState.postReadySidecars = postReadySidecars;
|
|
2484
|
+
stopPostReadySidecarsAfterCloseStarted({
|
|
2485
|
+
postReadySidecars,
|
|
2486
|
+
closeStarted: closePreludeStarted
|
|
2487
|
+
});
|
|
2488
|
+
if (closePreludeStarted) runtimeState.postReadySidecars = [];
|
|
2489
|
+
},
|
|
2490
|
+
onGatewayLifetimeSidecars: (gatewayLifetimeSidecars) => {
|
|
2491
|
+
runtimeState.gatewayLifetimeSidecars = gatewayLifetimeSidecars;
|
|
2492
|
+
stopPostReadySidecarsAfterCloseStarted({
|
|
2493
|
+
postReadySidecars: gatewayLifetimeSidecars,
|
|
2494
|
+
closeStarted: closePreludeStarted
|
|
2495
|
+
});
|
|
2496
|
+
if (closePreludeStarted) runtimeState.gatewayLifetimeSidecars = [];
|
|
2497
|
+
},
|
|
2498
|
+
onSidecarsReady: () => {
|
|
2499
|
+
startupSidecarsReady = true;
|
|
2500
|
+
activateScheduledServicesWhenReady();
|
|
2501
|
+
},
|
|
2502
|
+
isClosing: () => closePreludeStarted,
|
|
2503
|
+
startupTrace,
|
|
2504
|
+
deferSidecars: deferStartupSidecars,
|
|
2505
|
+
logReadyOnSidecars: !deferStartupSidecars,
|
|
2506
|
+
providerAuthPrewarm: { getConfig: getRuntimeConfig }
|
|
2507
|
+
}))));
|
|
2508
|
+
startupTrace.detail("memory.ready", collectGatewayProcessMemoryUsageMb());
|
|
2509
|
+
startupTrace.mark("ready");
|
|
2510
|
+
if (deferStartupSidecars) log.info("gateway ready");
|
|
2511
|
+
finishGatewayRestartTrace("restart.ready", collectGatewayProcessMemoryUsageMb());
|
|
2512
|
+
postAttachRuntimeReturned = true;
|
|
2513
|
+
activateScheduledServicesWhenReady();
|
|
2514
|
+
const { startManagedGatewayConfigReloader } = await import("./server-reload-handlers-DGJLH8bg.js");
|
|
2515
|
+
runtimeState.configReloader = startManagedGatewayConfigReloader({
|
|
2516
|
+
minimalTestGateway,
|
|
2517
|
+
initialConfig: cfgAtStart,
|
|
2518
|
+
initialCompareConfig: startupLastGoodSnapshot.sourceConfig,
|
|
2519
|
+
initialInternalWriteHash: startupInternalWriteHash,
|
|
2520
|
+
watchPath: configSnapshot.path,
|
|
2521
|
+
readSnapshot: readConfigFileSnapshot,
|
|
2522
|
+
promoteSnapshot: promoteConfigSnapshotToLastKnownGood,
|
|
2523
|
+
subscribeToWrites: registerConfigWriteListener,
|
|
2524
|
+
deps,
|
|
2525
|
+
broadcast,
|
|
2526
|
+
getState: () => ({
|
|
2527
|
+
hooksConfig: runtimeState.hooksConfig,
|
|
2528
|
+
hookClientIpConfig: runtimeState.hookClientIpConfig,
|
|
2529
|
+
heartbeatRunner: runtimeState.heartbeatRunner,
|
|
2530
|
+
cronState: runtimeState.cronState,
|
|
2531
|
+
channelHealthMonitor: runtimeState.channelHealthMonitor
|
|
2532
|
+
}),
|
|
2533
|
+
setState: (nextState) => {
|
|
2534
|
+
const cronStateChanged = nextState.cronState !== runtimeState.cronState;
|
|
2535
|
+
runtimeState.hooksConfig = nextState.hooksConfig;
|
|
2536
|
+
runtimeState.hookClientIpConfig = nextState.hookClientIpConfig;
|
|
2537
|
+
runtimeState.heartbeatRunner = nextState.heartbeatRunner;
|
|
2538
|
+
runtimeState.cronState = nextState.cronState;
|
|
2539
|
+
deps.cron = runtimeState.cronState.cron;
|
|
2540
|
+
runtimeState.channelHealthMonitor = nextState.channelHealthMonitor;
|
|
2541
|
+
if (cronStateChanged) gatewayCronStartHandled = true;
|
|
2542
|
+
},
|
|
2543
|
+
startChannel,
|
|
2544
|
+
stopChannel,
|
|
2545
|
+
stopPostReadySidecars: stopRegisteredPostReadySidecars,
|
|
2546
|
+
reloadPlugins: reloadAttachedGatewayPlugins,
|
|
2547
|
+
logHooks,
|
|
2548
|
+
logChannels,
|
|
2549
|
+
logCron,
|
|
2550
|
+
logReload,
|
|
2551
|
+
onCronRestart: () => {
|
|
2552
|
+
gatewayCronStartHandled = true;
|
|
2553
|
+
},
|
|
2554
|
+
channelManager,
|
|
2555
|
+
activateRuntimeSecrets,
|
|
2556
|
+
resolveSharedGatewaySessionGenerationForConfig,
|
|
2557
|
+
sharedGatewaySessionGenerationState,
|
|
2558
|
+
clients
|
|
2559
|
+
});
|
|
2560
|
+
await promoteConfigSnapshotToLastKnownGood(startupLastGoodSnapshot).catch((err) => {
|
|
2561
|
+
log.warn(`gateway: failed to promote config last-known-good backup: ${String(err)}`);
|
|
2562
|
+
});
|
|
2563
|
+
if (!minimalTestGateway) postReadyMaintenanceTimer = (await loadScheduledServicesModule()).scheduleGatewayPostReadyMaintenance({
|
|
2564
|
+
delayMs: POST_READY_MAINTENANCE_DELAY_MS,
|
|
2565
|
+
isClosing: () => closePreludeStarted,
|
|
2566
|
+
onStarted: () => {
|
|
2567
|
+
postReadyMaintenanceTimer = null;
|
|
2568
|
+
},
|
|
2569
|
+
startMaintenance: async () => {
|
|
2570
|
+
if (closePreludeStarted) return null;
|
|
2571
|
+
return earlyRuntime.startMaintenance();
|
|
2572
|
+
},
|
|
2573
|
+
applyMaintenance: (maintenance) => {
|
|
2574
|
+
if (closePreludeStarted) {
|
|
2575
|
+
clearInterval(maintenance.tickInterval);
|
|
2576
|
+
clearInterval(maintenance.healthInterval);
|
|
2577
|
+
clearInterval(maintenance.dedupeCleanup);
|
|
2578
|
+
if (maintenance.mediaCleanup) clearInterval(maintenance.mediaCleanup);
|
|
2579
|
+
return;
|
|
2580
|
+
}
|
|
2581
|
+
runtimeState.tickInterval = maintenance.tickInterval;
|
|
2582
|
+
runtimeState.healthInterval = maintenance.healthInterval;
|
|
2583
|
+
runtimeState.dedupeCleanup = maintenance.dedupeCleanup;
|
|
2584
|
+
runtimeState.mediaCleanup = maintenance.mediaCleanup;
|
|
2585
|
+
},
|
|
2586
|
+
shouldStartCron: () => !closePreludeStarted && !gatewayCronStartHandled,
|
|
2587
|
+
markCronStartHandled: () => {
|
|
2588
|
+
gatewayCronStartHandled = true;
|
|
2589
|
+
},
|
|
2590
|
+
cron: runtimeState.cronState.cron,
|
|
2591
|
+
logCron,
|
|
2592
|
+
log,
|
|
2593
|
+
recordPostReadyMemory: () => {
|
|
2594
|
+
startupTrace.detail("memory.post-ready", collectGatewayProcessMemoryUsageMb());
|
|
2595
|
+
}
|
|
2596
|
+
});
|
|
2597
|
+
else startupTrace.detail("memory.post-ready", collectGatewayProcessMemoryUsageMb());
|
|
2598
|
+
} catch (err) {
|
|
2599
|
+
await closeOnStartupFailure();
|
|
2600
|
+
throw err;
|
|
2601
|
+
}
|
|
2602
|
+
const close = createCloseHandler();
|
|
2603
|
+
return { close: async (opts) => {
|
|
2604
|
+
try {
|
|
2605
|
+
markClosePreludeStarted();
|
|
2606
|
+
await stopRegisteredGatewayLifetimeSidecars();
|
|
2607
|
+
await stopRegisteredPostReadySidecars();
|
|
2608
|
+
const { runGlobalGatewayStopSafely } = await import("./plugins/hook-runner-global.js");
|
|
2609
|
+
await runGlobalGatewayStopSafely({
|
|
2610
|
+
event: { reason: opts?.reason ?? "gateway stopping" },
|
|
2611
|
+
ctx: { port },
|
|
2612
|
+
onError: (err) => log.warn(`gateway_stop hook failed: ${String(err)}`)
|
|
2613
|
+
});
|
|
2614
|
+
await runClosePrelude();
|
|
2615
|
+
await close(opts);
|
|
2616
|
+
} finally {
|
|
2617
|
+
clearFallbackGatewayContextForServer();
|
|
2618
|
+
}
|
|
2619
|
+
} };
|
|
2620
|
+
}
|
|
2621
|
+
//#endregion
|
|
2622
|
+
export { resetModelCatalogCacheForTest, startGatewayServer };
|