fengming 0.3.4 → 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 -2
- 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 +3 -3
- 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/protocol/index.d.ts +1 -1
- 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-DhOQs6M_.d.ts +1497 -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-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 +1 -1
- package/dist/plugin-sdk/channel-actions.js +2 -2
- package/dist/plugin-sdk/channel-config-schema-legacy.d.ts +1 -1
- package/dist/plugin-sdk/channel-core.js +2 -2
- package/dist/plugin-sdk/channel-envelope.js +1 -1
- package/dist/plugin-sdk/channel-inbound-roots.js +1 -1
- package/dist/plugin-sdk/channel-inbound.js +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-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.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.d.ts +2 -2
- package/dist/plugin-sdk/conversation-binding-runtime.js +1 -1
- package/dist/plugin-sdk/conversation-runtime.js +3 -3
- package/dist/plugin-sdk/core.js +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 +1 -1
- 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.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-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 +19 -19
- 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/dist/zod-schema.core-Cuz0lz6m.d.ts +166 -0
- 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-Bte--ZlY.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-CCu43qU8.js +0 -124
- package/dist/control-ui/assets/agents-DCvsB0yO.js +0 -1030
- package/dist/control-ui/assets/channels-CpM2j5xT.js +0 -120
- package/dist/control-ui/assets/cron-CLXNfwYa.js +0 -1016
- package/dist/control-ui/assets/debug-BcJ34lrC.js +0 -97
- package/dist/control-ui/assets/index-CuBn2YpX.js +0 -7214
- package/dist/control-ui/assets/instances-Bu6NM_Hs.js +0 -57
- package/dist/control-ui/assets/nodes-Bd1WzVLK.js +0 -444
- package/dist/control-ui/assets/sessions-C2r8pbt7.js +0 -425
- package/dist/control-ui/assets/skills-DIjn93ee.js +0 -362
- package/dist/control-ui/assets/workboard-CHb0if1l.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/index-AZzJCgph.d.ts +0 -1497
- 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-2_c2Ttjf.js +0 -1024
- package/dist/monitor-7tD_FE_5.js +0 -60
- 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-UtIBjviA.d.ts +0 -3169
- 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-OG5Gd31l.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/zod-schema.core-BGLctDlK.d.ts +0 -166
- /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
|
@@ -1,2506 +0,0 @@
|
|
|
1
|
-
import { a as normalizeLowercaseStringOrEmpty, s as normalizeOptionalLowercaseString } from "./string-coerce-DKw2K5wM.js";
|
|
2
|
-
import { o as isRecord } from "./record-coerce-Btbek4uV.js";
|
|
3
|
-
import { t as createLazyImportLoader } from "./lazy-promise-Djskx0qC.js";
|
|
4
|
-
import { _ as uniqueStrings, l as normalizeStringEntries, v as uniqueValues } from "./string-normalization-B8G0vlWE.js";
|
|
5
|
-
import "./fs-safe-CR_om3kX.js";
|
|
6
|
-
import { a as root, s as PATH_ALIAS_POLICIES } from "./secure-temp-dir-BvCzS-gM.js";
|
|
7
|
-
import { r as openRootFile } from "./root-file-jRMCpJW4.js";
|
|
8
|
-
import "./boundary-file-read-CF5H6Z2a.js";
|
|
9
|
-
import "./agent-scope-DYvAPpmY.js";
|
|
10
|
-
import { c as parseAgentSessionKey } from "./session-key-utils-CdfsDYvz.js";
|
|
11
|
-
import { l as normalizeAgentId } from "./session-key-CJf5_zWs.js";
|
|
12
|
-
import { c as resolveDefaultAgentId, r as resolveAgentConfig } from "./agent-scope-config-BFfPgg3b.js";
|
|
13
|
-
import { a as logWarn } from "./logger-BZdGwGcr.js";
|
|
14
|
-
import { a as resolveGatewayMessageChannel } from "./message-channel-normalize-CaOaCinb.js";
|
|
15
|
-
import "./message-channel-DcN_7tYD.js";
|
|
16
|
-
import { t as bindAbortRelay } from "./fetch-timeout-CT4Dz9RS.js";
|
|
17
|
-
import { n as assertSandboxPath } from "./sandbox-paths-IHN5V0Q8.js";
|
|
18
|
-
import { i as toRelativeSandboxPath, n as resolveWorkspaceRoot, r as resolvePathFromInput } from "./workspace-dir-B27rGncD.js";
|
|
19
|
-
import { P as createCodingTools, V as createReadTool } from "./sessions-CEojHc8b.js";
|
|
20
|
-
import { c as EXEC_TOOL_DISPLAY_SUMMARY, l as PROCESS_TOOL_DISPLAY_SUMMARY } from "./tool-catalog-BfQXK2pl.js";
|
|
21
|
-
import { a as collectExplicitDenylist, c as hasRestrictiveAllowPolicy, f as expandToolGroups, h as resolveToolProfilePolicy, i as collectExplicitAllowlist, l as mergeAlsoAllowPolicy, m as normalizeToolName, u as replaceWithEffectiveToolAllowlist } from "./tool-policy-Dv92jaRW.js";
|
|
22
|
-
import { t as isToolAllowedByPolicies } from "./tool-policy-match-BK9FXN4N.js";
|
|
23
|
-
import { _ as SANDBOX_AGENT_WORKSPACE_MOUNT } from "./constants-f1q_ho_6.js";
|
|
24
|
-
import { S as wrapToolWorkspaceRootGuardWithOptions, _ as createSandboxedEditTool, b as wrapToolMemoryFlushAppendOnlyWrite, g as createHostWorkspaceWriteTool, h as createHostWorkspaceEditTool, m as createFengMingReadTool, p as resolveFengMingPluginToolsForOptions, t as createFengMingTools, v as createSandboxedReadTool, x as wrapToolWorkspaceRootGuard, y as createSandboxedWriteTool } from "./fengming-tools-MvRSt0JA.js";
|
|
25
|
-
import { o as resolveSubagentCapabilityStore, t as isSubagentEnvelopeSession } from "./subagent-capabilities-CH6UwTM3.js";
|
|
26
|
-
import { i as resolveInheritedToolPolicyForSession, n as resolveEffectiveToolPolicy, o as resolveSubagentToolPolicyForSession, r as resolveGroupToolPolicy } from "./agent-tools.policy-BhqSsYtP.js";
|
|
27
|
-
import { t as resolveSenderToolPolicy } from "./sender-tool-policy-DdFjBIvb.js";
|
|
28
|
-
import { t as HEARTBEAT_RESPONSE_TOOL_NAME } from "./heartbeat-tool-response-BjnQjIIz.js";
|
|
29
|
-
import { o as shouldSuppressManagedWebSearchTool } from "./codex-native-web-search-core-CzlK1GfN.js";
|
|
30
|
-
import { t as normalizeToolParameterSchema } from "./agent-tools-parameter-schema-DxHYZrjk.js";
|
|
31
|
-
import { i as getPluginToolMeta, n as copyPluginToolMeta } from "./tools-BAl3JiNw.js";
|
|
32
|
-
import { O as listChannelAgentTools, T as copyChannelAgentToolMeta, _ as wrapToolWithBeforeToolCallHook, a as copyBeforeToolCallHookMarker, u as isToolWrappedWithBeforeToolCallHook } from "./agent-tools.before-tool-call-BwY-FYFl.js";
|
|
33
|
-
import { l as jsonResult, n as ToolInputError, r as asToolParamsRecord } from "./common-CZvBLb3w.js";
|
|
34
|
-
import { r as resolveImageSanitizationLimits } from "./image-sanitization-B1anI66H.js";
|
|
35
|
-
import { t as resolveExecCommandHighlighting } from "./exec-command-highlighting-Djjw4y9J.js";
|
|
36
|
-
import { n as resolveEventSessionRoutingPolicy } from "./event-session-routing-C-GE4gxF.js";
|
|
37
|
-
import { I as resolveExecPolicyForMode } from "./exec-approvals-OmSY2hSB.js";
|
|
38
|
-
import { i as resolveMergedSafeBinProfileFixtures } from "./exec-safe-bin-runtime-policy-D8i-qd_X.js";
|
|
39
|
-
import { n as describeProcessTool, t as describeExecTool } from "./bash-tools.descriptions-CmnntKkL.js";
|
|
40
|
-
import { n as processSchema, t as execSchema } from "./bash-tools.schemas-DHPBVmIy.js";
|
|
41
|
-
import "./codex-native-web-search-C0TrfoMX.js";
|
|
42
|
-
import { t as resolveToolLoopDetectionConfig } from "./tool-loop-detection-config-DOPGGB14.js";
|
|
43
|
-
import { l as resolveToolFsConfig, o as createToolFsPolicy } from "./local-roots-BK0kFmQd.js";
|
|
44
|
-
import { n as buildDefaultToolPolicyPipelineSteps, t as applyToolPolicyPipeline } from "./tool-policy-pipeline-CYFXxi2c.js";
|
|
45
|
-
import fs from "node:fs";
|
|
46
|
-
import path from "node:path";
|
|
47
|
-
import fs$1 from "node:fs/promises";
|
|
48
|
-
import os from "node:os";
|
|
49
|
-
import { spawn } from "node:child_process";
|
|
50
|
-
import { Type } from "typebox";
|
|
51
|
-
//#region src/agents/agent-tools.abort.ts
|
|
52
|
-
function throwAbortError() {
|
|
53
|
-
const err = /* @__PURE__ */ new Error("已中止");
|
|
54
|
-
err.name = "AbortError";
|
|
55
|
-
throw err;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Checks if an object is a valid AbortSignal using structural typing.
|
|
59
|
-
* This is more reliable than `instanceof` across different realms (VM, iframe, etc.)
|
|
60
|
-
* where the AbortSignal constructor may differ.
|
|
61
|
-
*/
|
|
62
|
-
function isAbortSignal(obj) {
|
|
63
|
-
return obj instanceof AbortSignal;
|
|
64
|
-
}
|
|
65
|
-
function combineAbortSignals(a, b) {
|
|
66
|
-
if (!a && !b) return;
|
|
67
|
-
if (a && !b) return a;
|
|
68
|
-
if (b && !a) return b;
|
|
69
|
-
if (a?.aborted) return a;
|
|
70
|
-
if (b?.aborted) return b;
|
|
71
|
-
if (typeof AbortSignal.any === "function" && isAbortSignal(a) && isAbortSignal(b)) return AbortSignal.any([a, b]);
|
|
72
|
-
const controller = new AbortController();
|
|
73
|
-
const onAbort = bindAbortRelay(controller);
|
|
74
|
-
a?.addEventListener("abort", onAbort, { once: true });
|
|
75
|
-
b?.addEventListener("abort", onAbort, { once: true });
|
|
76
|
-
return controller.signal;
|
|
77
|
-
}
|
|
78
|
-
function wrapToolWithAbortSignal(tool, abortSignal) {
|
|
79
|
-
if (!abortSignal) return tool;
|
|
80
|
-
const execute = tool.execute;
|
|
81
|
-
if (!execute) return tool;
|
|
82
|
-
const wrappedTool = {
|
|
83
|
-
...tool,
|
|
84
|
-
execute: async (toolCallId, params, signal, onUpdate) => {
|
|
85
|
-
const combined = combineAbortSignals(signal, abortSignal);
|
|
86
|
-
if (combined?.aborted) throwAbortError();
|
|
87
|
-
return await execute(toolCallId, params, combined, onUpdate);
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
copyPluginToolMeta(tool, wrappedTool);
|
|
91
|
-
copyChannelAgentToolMeta(tool, wrappedTool);
|
|
92
|
-
copyBeforeToolCallHookMarker(tool, wrappedTool);
|
|
93
|
-
return wrappedTool;
|
|
94
|
-
}
|
|
95
|
-
//#endregion
|
|
96
|
-
//#region src/agents/agent-tools.deferred-followup.ts
|
|
97
|
-
function applyDeferredFollowupToolDescriptions(tools, params) {
|
|
98
|
-
const hasCronTool = tools.some((tool) => tool.name === "cron");
|
|
99
|
-
return tools.map((tool) => {
|
|
100
|
-
if (tool.name === "exec") return {
|
|
101
|
-
...tool,
|
|
102
|
-
description: describeExecTool({
|
|
103
|
-
agentId: params?.agentId,
|
|
104
|
-
hasCronTool
|
|
105
|
-
})
|
|
106
|
-
};
|
|
107
|
-
if (tool.name === "process") return {
|
|
108
|
-
...tool,
|
|
109
|
-
description: describeProcessTool({ hasCronTool })
|
|
110
|
-
};
|
|
111
|
-
return tool;
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
//#endregion
|
|
115
|
-
//#region src/agents/agent-tools.message-provider-policy.ts
|
|
116
|
-
const TOOL_DENY_BY_MESSAGE_PROVIDER = {
|
|
117
|
-
"discord-voice": ["tts"],
|
|
118
|
-
voice: ["tts"]
|
|
119
|
-
};
|
|
120
|
-
const TOOL_ALLOW_BY_MESSAGE_PROVIDER = { node: [
|
|
121
|
-
"canvas",
|
|
122
|
-
"image",
|
|
123
|
-
"pdf",
|
|
124
|
-
"tts",
|
|
125
|
-
"web_fetch",
|
|
126
|
-
"web_search"
|
|
127
|
-
] };
|
|
128
|
-
function filterToolNamesByMessageProvider(toolNames, messageProvider) {
|
|
129
|
-
const normalizedProvider = normalizeOptionalLowercaseString(messageProvider);
|
|
130
|
-
if (!normalizedProvider) return [...toolNames];
|
|
131
|
-
const allowedTools = TOOL_ALLOW_BY_MESSAGE_PROVIDER[normalizedProvider];
|
|
132
|
-
if (allowedTools && allowedTools.length > 0) {
|
|
133
|
-
const allowedSet = new Set(allowedTools);
|
|
134
|
-
return toolNames.filter((toolName) => allowedSet.has(toolName));
|
|
135
|
-
}
|
|
136
|
-
const deniedTools = TOOL_DENY_BY_MESSAGE_PROVIDER[normalizedProvider];
|
|
137
|
-
if (!deniedTools || deniedTools.length === 0) return [...toolNames];
|
|
138
|
-
const deniedSet = new Set(deniedTools);
|
|
139
|
-
return toolNames.filter((toolName) => !deniedSet.has(toolName));
|
|
140
|
-
}
|
|
141
|
-
function filterToolsByMessageProvider(tools, messageProvider) {
|
|
142
|
-
const filteredToolNames = filterToolNamesByMessageProvider(tools.map((tool) => tool.name), messageProvider);
|
|
143
|
-
const remainingCounts = /* @__PURE__ */ new Map();
|
|
144
|
-
for (const toolName of filteredToolNames) remainingCounts.set(toolName, (remainingCounts.get(toolName) ?? 0) + 1);
|
|
145
|
-
return tools.filter((tool) => {
|
|
146
|
-
const remaining = remainingCounts.get(tool.name) ?? 0;
|
|
147
|
-
if (remaining <= 0) return false;
|
|
148
|
-
remainingCounts.set(tool.name, remaining - 1);
|
|
149
|
-
return true;
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
//#endregion
|
|
153
|
-
//#region src/agents/agent-tools.schema.ts
|
|
154
|
-
function isObjectSchemaWithNoRequiredParams(schema) {
|
|
155
|
-
if (!schema || typeof schema !== "object" || Array.isArray(schema)) return false;
|
|
156
|
-
const record = schema;
|
|
157
|
-
const type = record.type;
|
|
158
|
-
if (!(type === "object" || Array.isArray(type) && type.some((entry) => entry === "object"))) return false;
|
|
159
|
-
return !schemaHasRequiredParams(record);
|
|
160
|
-
}
|
|
161
|
-
function schemaHasRequiredParams(schema) {
|
|
162
|
-
if (Array.isArray(schema.required) && schema.required.length > 0) return true;
|
|
163
|
-
for (const key of [
|
|
164
|
-
"allOf",
|
|
165
|
-
"anyOf",
|
|
166
|
-
"oneOf"
|
|
167
|
-
]) {
|
|
168
|
-
const variants = schema[key];
|
|
169
|
-
if (!Array.isArray(variants)) continue;
|
|
170
|
-
if (variants.some((variant) => variant !== null && typeof variant === "object" && !Array.isArray(variant) && schemaHasRequiredParams(variant))) return true;
|
|
171
|
-
}
|
|
172
|
-
return false;
|
|
173
|
-
}
|
|
174
|
-
function addEmptyObjectArgumentPreparation(tool, parameters) {
|
|
175
|
-
if (!isObjectSchemaWithNoRequiredParams(parameters)) return tool;
|
|
176
|
-
return {
|
|
177
|
-
...tool,
|
|
178
|
-
prepareArguments: (args) => {
|
|
179
|
-
const prepared = tool.prepareArguments ? tool.prepareArguments(args) : args;
|
|
180
|
-
return prepared === null || prepared === void 0 ? {} : prepared;
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
function normalizeToolParameters(tool, options) {
|
|
185
|
-
function preserveToolMeta(target) {
|
|
186
|
-
copyPluginToolMeta(tool, target);
|
|
187
|
-
copyChannelAgentToolMeta(tool, target);
|
|
188
|
-
return target;
|
|
189
|
-
}
|
|
190
|
-
const schema = tool.parameters && typeof tool.parameters === "object" ? tool.parameters : void 0;
|
|
191
|
-
if (!schema) return tool;
|
|
192
|
-
const parameters = normalizeToolParameterSchema(schema, options);
|
|
193
|
-
return preserveToolMeta({
|
|
194
|
-
...tool,
|
|
195
|
-
...addEmptyObjectArgumentPreparation(tool, parameters),
|
|
196
|
-
parameters
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
//#endregion
|
|
200
|
-
//#region src/agents/apply-patch-update.ts
|
|
201
|
-
async function defaultReadFile(filePath) {
|
|
202
|
-
return fs$1.readFile(filePath, "utf8");
|
|
203
|
-
}
|
|
204
|
-
async function applyUpdateHunk(filePath, chunks, options) {
|
|
205
|
-
const originalLines = (await (options?.readFile ?? defaultReadFile)(filePath).catch((err) => {
|
|
206
|
-
throw new Error(`Failed to read file to update ${filePath}: ${err}`);
|
|
207
|
-
})).split("\n");
|
|
208
|
-
if (originalLines.length > 0 && originalLines[originalLines.length - 1] === "") originalLines.pop();
|
|
209
|
-
let newLines = applyReplacements(originalLines, computeReplacements(originalLines, filePath, chunks));
|
|
210
|
-
if (newLines.length === 0 || newLines[newLines.length - 1] !== "") newLines = [...newLines, ""];
|
|
211
|
-
return newLines.join("\n");
|
|
212
|
-
}
|
|
213
|
-
function computeReplacements(originalLines, filePath, chunks) {
|
|
214
|
-
const replacements = [];
|
|
215
|
-
let lineIndex = 0;
|
|
216
|
-
for (const chunk of chunks) {
|
|
217
|
-
if (chunk.changeContext) {
|
|
218
|
-
const ctxIndex = seekSequence(originalLines, [chunk.changeContext], lineIndex, false);
|
|
219
|
-
if (ctxIndex === null) throw new Error(`Failed to find context '${chunk.changeContext}' in ${filePath}`);
|
|
220
|
-
lineIndex = ctxIndex + 1;
|
|
221
|
-
}
|
|
222
|
-
if (chunk.oldLines.length === 0) {
|
|
223
|
-
const insertionIndex = chunk.changeContext && !chunk.isEndOfFile ? lineIndex : originalLines.length > 0 && originalLines[originalLines.length - 1] === "" ? originalLines.length - 1 : originalLines.length;
|
|
224
|
-
replacements.push([
|
|
225
|
-
insertionIndex,
|
|
226
|
-
0,
|
|
227
|
-
chunk.newLines
|
|
228
|
-
]);
|
|
229
|
-
lineIndex = insertionIndex;
|
|
230
|
-
continue;
|
|
231
|
-
}
|
|
232
|
-
let pattern = chunk.oldLines;
|
|
233
|
-
let newSlice = chunk.newLines;
|
|
234
|
-
let found = seekSequence(originalLines, pattern, lineIndex, chunk.isEndOfFile);
|
|
235
|
-
if (found === null && pattern[pattern.length - 1] === "") {
|
|
236
|
-
pattern = pattern.slice(0, -1);
|
|
237
|
-
if (newSlice.length > 0 && newSlice[newSlice.length - 1] === "") newSlice = newSlice.slice(0, -1);
|
|
238
|
-
found = seekSequence(originalLines, pattern, lineIndex, chunk.isEndOfFile);
|
|
239
|
-
}
|
|
240
|
-
if (found === null) throw new Error(`Failed to find expected lines in ${filePath}:\n${chunk.oldLines.join("\n")}`);
|
|
241
|
-
replacements.push([
|
|
242
|
-
found,
|
|
243
|
-
pattern.length,
|
|
244
|
-
newSlice
|
|
245
|
-
]);
|
|
246
|
-
lineIndex = found + pattern.length;
|
|
247
|
-
}
|
|
248
|
-
replacements.sort((a, b) => a[0] - b[0]);
|
|
249
|
-
return replacements;
|
|
250
|
-
}
|
|
251
|
-
function applyReplacements(lines, replacements) {
|
|
252
|
-
const result = [...lines];
|
|
253
|
-
for (const [startIndex, oldLen, newLines] of [...replacements].toReversed()) {
|
|
254
|
-
for (let i = 0; i < oldLen; i += 1) if (startIndex < result.length) result.splice(startIndex, 1);
|
|
255
|
-
for (let i = 0; i < newLines.length; i += 1) result.splice(startIndex + i, 0, newLines[i]);
|
|
256
|
-
}
|
|
257
|
-
return result;
|
|
258
|
-
}
|
|
259
|
-
function seekSequence(lines, pattern, start, eof) {
|
|
260
|
-
if (pattern.length === 0) return start;
|
|
261
|
-
if (pattern.length > lines.length) return null;
|
|
262
|
-
const maxStart = lines.length - pattern.length;
|
|
263
|
-
const searchStart = eof && lines.length >= pattern.length ? maxStart : start;
|
|
264
|
-
if (searchStart > maxStart) return null;
|
|
265
|
-
for (let i = searchStart; i <= maxStart; i += 1) if (linesMatch(lines, pattern, i, (value) => value)) return i;
|
|
266
|
-
for (let i = searchStart; i <= maxStart; i += 1) if (linesMatch(lines, pattern, i, (value) => value.trimEnd())) return i;
|
|
267
|
-
for (let i = searchStart; i <= maxStart; i += 1) if (linesMatch(lines, pattern, i, (value) => value.trim())) return i;
|
|
268
|
-
for (let i = searchStart; i <= maxStart; i += 1) if (linesMatch(lines, pattern, i, (value) => normalizePunctuation(value.trim()))) return i;
|
|
269
|
-
return null;
|
|
270
|
-
}
|
|
271
|
-
function linesMatch(lines, pattern, start, normalize) {
|
|
272
|
-
for (let idx = 0; idx < pattern.length; idx += 1) if (normalize(lines[start + idx]) !== normalize(pattern[idx])) return false;
|
|
273
|
-
return true;
|
|
274
|
-
}
|
|
275
|
-
function normalizePunctuation(value) {
|
|
276
|
-
return Array.from(value).map((char) => {
|
|
277
|
-
switch (char) {
|
|
278
|
-
case "‐":
|
|
279
|
-
case "‑":
|
|
280
|
-
case "‒":
|
|
281
|
-
case "–":
|
|
282
|
-
case "—":
|
|
283
|
-
case "―":
|
|
284
|
-
case "−": return "-";
|
|
285
|
-
case "‘":
|
|
286
|
-
case "’":
|
|
287
|
-
case "‚":
|
|
288
|
-
case "‛": return "'";
|
|
289
|
-
case "“":
|
|
290
|
-
case "”":
|
|
291
|
-
case "„":
|
|
292
|
-
case "‟": return "\"";
|
|
293
|
-
case "\xA0":
|
|
294
|
-
case " ":
|
|
295
|
-
case " ":
|
|
296
|
-
case " ":
|
|
297
|
-
case " ":
|
|
298
|
-
case " ":
|
|
299
|
-
case " ":
|
|
300
|
-
case " ":
|
|
301
|
-
case " ":
|
|
302
|
-
case " ":
|
|
303
|
-
case " ":
|
|
304
|
-
case " ":
|
|
305
|
-
case " ": return " ";
|
|
306
|
-
default: return char;
|
|
307
|
-
}
|
|
308
|
-
}).join("");
|
|
309
|
-
}
|
|
310
|
-
//#endregion
|
|
311
|
-
//#region src/agents/apply-patch.ts
|
|
312
|
-
const BEGIN_PATCH_MARKER = "*** Begin Patch";
|
|
313
|
-
const END_PATCH_MARKER = "*** End Patch";
|
|
314
|
-
const ADD_FILE_MARKER = "*** Add File: ";
|
|
315
|
-
const DELETE_FILE_MARKER = "*** Delete File: ";
|
|
316
|
-
const UPDATE_FILE_MARKER = "*** Update File: ";
|
|
317
|
-
const MOVE_TO_MARKER = "*** Move to: ";
|
|
318
|
-
const EOF_MARKER = "*** End of File";
|
|
319
|
-
const CHANGE_CONTEXT_MARKER = "@@ ";
|
|
320
|
-
const EMPTY_CHANGE_CONTEXT_MARKER = "@@";
|
|
321
|
-
const applyPatchSchema = Type.Object({ input: Type.String({ description: "Patch content using the *** Begin Patch/End Patch format." }) });
|
|
322
|
-
function createApplyPatchTool(options = {}) {
|
|
323
|
-
const cwd = options.cwd ?? process.cwd();
|
|
324
|
-
const sandbox = options.sandbox;
|
|
325
|
-
const workspaceOnly = options.workspaceOnly !== false;
|
|
326
|
-
return {
|
|
327
|
-
name: "apply_patch",
|
|
328
|
-
label: "apply_patch",
|
|
329
|
-
description: "Apply a patch to one or more files using the apply_patch format. The input should include *** Begin Patch and *** End Patch markers.",
|
|
330
|
-
parameters: applyPatchSchema,
|
|
331
|
-
execute: async (_toolCallId, args, signal) => {
|
|
332
|
-
const params = args;
|
|
333
|
-
const input = typeof params.input === "string" ? params.input : "";
|
|
334
|
-
if (!input.trim()) throw new Error("Provide a patch input.");
|
|
335
|
-
if (signal?.aborted) {
|
|
336
|
-
const err = /* @__PURE__ */ new Error("已中止");
|
|
337
|
-
err.name = "AbortError";
|
|
338
|
-
throw err;
|
|
339
|
-
}
|
|
340
|
-
const result = await applyPatch(input, {
|
|
341
|
-
cwd,
|
|
342
|
-
sandbox,
|
|
343
|
-
workspaceOnly,
|
|
344
|
-
signal
|
|
345
|
-
});
|
|
346
|
-
return {
|
|
347
|
-
content: [{
|
|
348
|
-
type: "text",
|
|
349
|
-
text: result.text
|
|
350
|
-
}],
|
|
351
|
-
details: { summary: result.summary }
|
|
352
|
-
};
|
|
353
|
-
}
|
|
354
|
-
};
|
|
355
|
-
}
|
|
356
|
-
async function applyPatch(input, options) {
|
|
357
|
-
const parsed = parsePatchText(input);
|
|
358
|
-
if (parsed.hunks.length === 0) throw new Error("没有文件被修改");
|
|
359
|
-
const summary = {
|
|
360
|
-
added: [],
|
|
361
|
-
modified: [],
|
|
362
|
-
deleted: []
|
|
363
|
-
};
|
|
364
|
-
const seen = {
|
|
365
|
-
added: /* @__PURE__ */ new Set(),
|
|
366
|
-
modified: /* @__PURE__ */ new Set(),
|
|
367
|
-
deleted: /* @__PURE__ */ new Set()
|
|
368
|
-
};
|
|
369
|
-
const fileOps = resolvePatchFileOps(options);
|
|
370
|
-
for (const hunk of parsed.hunks) {
|
|
371
|
-
if (options.signal?.aborted) {
|
|
372
|
-
const err = /* @__PURE__ */ new Error("已中止");
|
|
373
|
-
err.name = "AbortError";
|
|
374
|
-
throw err;
|
|
375
|
-
}
|
|
376
|
-
if (hunk.kind === "add") {
|
|
377
|
-
const target = await resolvePatchPath(hunk.path, options);
|
|
378
|
-
await assertPatchParentPath(hunk.path, options);
|
|
379
|
-
await ensureDir(target.resolved, fileOps);
|
|
380
|
-
await fileOps.writeFile(target.resolved, hunk.contents);
|
|
381
|
-
recordSummary(summary, seen, "added", target.display);
|
|
382
|
-
continue;
|
|
383
|
-
}
|
|
384
|
-
if (hunk.kind === "delete") {
|
|
385
|
-
const target = await resolvePatchPath(hunk.path, options, PATH_ALIAS_POLICIES.unlinkTarget);
|
|
386
|
-
await fileOps.remove(target.resolved);
|
|
387
|
-
recordSummary(summary, seen, "deleted", target.display);
|
|
388
|
-
continue;
|
|
389
|
-
}
|
|
390
|
-
const target = await resolvePatchPath(hunk.path, options);
|
|
391
|
-
const applied = await applyUpdateHunk(target.resolved, hunk.chunks, { readFile: (path) => fileOps.readFile(path) });
|
|
392
|
-
if (hunk.movePath) {
|
|
393
|
-
const moveTarget = await resolvePatchPath(hunk.movePath, options);
|
|
394
|
-
await assertPatchParentPath(hunk.movePath, options);
|
|
395
|
-
await ensureDir(moveTarget.resolved, fileOps);
|
|
396
|
-
const moveResolvesToSource = path.resolve(moveTarget.resolved) === path.resolve(target.resolved);
|
|
397
|
-
await fileOps.writeFile(moveResolvesToSource ? target.resolved : moveTarget.resolved, applied);
|
|
398
|
-
if (!moveResolvesToSource) await fileOps.remove(target.resolved);
|
|
399
|
-
recordSummary(summary, seen, "modified", moveResolvesToSource ? target.display : moveTarget.display);
|
|
400
|
-
} else {
|
|
401
|
-
await fileOps.writeFile(target.resolved, applied);
|
|
402
|
-
recordSummary(summary, seen, "modified", target.display);
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
return {
|
|
406
|
-
summary,
|
|
407
|
-
text: formatSummary(summary)
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
function recordSummary(summary, seen, bucket, value) {
|
|
411
|
-
if (seen[bucket].has(value)) return;
|
|
412
|
-
seen[bucket].add(value);
|
|
413
|
-
summary[bucket].push(value);
|
|
414
|
-
}
|
|
415
|
-
function formatSummary(summary) {
|
|
416
|
-
const lines = ["Success. Updated the following files:"];
|
|
417
|
-
for (const file of summary.added) lines.push(`A ${file}`);
|
|
418
|
-
for (const file of summary.modified) lines.push(`M ${file}`);
|
|
419
|
-
for (const file of summary.deleted) lines.push(`D ${file}`);
|
|
420
|
-
return lines.join("\n");
|
|
421
|
-
}
|
|
422
|
-
function resolvePatchFileOps(options) {
|
|
423
|
-
if (options.sandbox) {
|
|
424
|
-
const { root, bridge } = options.sandbox;
|
|
425
|
-
return {
|
|
426
|
-
readFile: async (filePath) => {
|
|
427
|
-
return (await bridge.readFile({
|
|
428
|
-
filePath,
|
|
429
|
-
cwd: root
|
|
430
|
-
})).toString("utf8");
|
|
431
|
-
},
|
|
432
|
-
writeFile: (filePath, content) => bridge.writeFile({
|
|
433
|
-
filePath,
|
|
434
|
-
cwd: root,
|
|
435
|
-
data: content
|
|
436
|
-
}),
|
|
437
|
-
remove: (filePath) => bridge.remove({
|
|
438
|
-
filePath,
|
|
439
|
-
cwd: root,
|
|
440
|
-
force: false
|
|
441
|
-
}),
|
|
442
|
-
mkdirp: (dir) => bridge.mkdirp({
|
|
443
|
-
filePath: dir,
|
|
444
|
-
cwd: root
|
|
445
|
-
})
|
|
446
|
-
};
|
|
447
|
-
}
|
|
448
|
-
const workspaceOnly = options.workspaceOnly !== false;
|
|
449
|
-
const rootPromise = workspaceOnly ? root(options.cwd) : void 0;
|
|
450
|
-
return {
|
|
451
|
-
readFile: async (filePath) => {
|
|
452
|
-
if (!workspaceOnly) return await fs$1.readFile(filePath, "utf8");
|
|
453
|
-
const opened = await openRootFile({
|
|
454
|
-
absolutePath: filePath,
|
|
455
|
-
rootPath: options.cwd,
|
|
456
|
-
boundaryLabel: "workspace root"
|
|
457
|
-
});
|
|
458
|
-
assertBoundaryRead(opened, filePath);
|
|
459
|
-
try {
|
|
460
|
-
return fs.readFileSync(opened.fd, "utf8");
|
|
461
|
-
} finally {
|
|
462
|
-
fs.closeSync(opened.fd);
|
|
463
|
-
}
|
|
464
|
-
},
|
|
465
|
-
writeFile: async (filePath, content) => {
|
|
466
|
-
if (!workspaceOnly) {
|
|
467
|
-
await fs$1.writeFile(filePath, content, "utf8");
|
|
468
|
-
return;
|
|
469
|
-
}
|
|
470
|
-
const relative = toRelativeSandboxPath(options.cwd, filePath);
|
|
471
|
-
await (await rootPromise)?.write(relative, content, { encoding: "utf8" });
|
|
472
|
-
},
|
|
473
|
-
remove: async (filePath) => {
|
|
474
|
-
if (!workspaceOnly) {
|
|
475
|
-
await fs$1.rm(filePath);
|
|
476
|
-
return;
|
|
477
|
-
}
|
|
478
|
-
const relative = toRelativeSandboxPath(options.cwd, filePath);
|
|
479
|
-
await (await rootPromise)?.remove(relative);
|
|
480
|
-
},
|
|
481
|
-
mkdirp: async (dir) => {
|
|
482
|
-
if (!workspaceOnly) {
|
|
483
|
-
await fs$1.mkdir(dir, { recursive: true });
|
|
484
|
-
return;
|
|
485
|
-
}
|
|
486
|
-
const relative = toRelativeSandboxPath(options.cwd, dir, { allowRoot: true });
|
|
487
|
-
const root = await rootPromise;
|
|
488
|
-
if (!root) return;
|
|
489
|
-
if (relative === "" || relative === ".") {
|
|
490
|
-
await root.ensureRoot();
|
|
491
|
-
return;
|
|
492
|
-
}
|
|
493
|
-
await root.mkdir(relative);
|
|
494
|
-
}
|
|
495
|
-
};
|
|
496
|
-
}
|
|
497
|
-
async function ensureDir(filePath, ops) {
|
|
498
|
-
const parent = path.dirname(filePath);
|
|
499
|
-
if (!parent || parent === ".") return;
|
|
500
|
-
await ops.mkdirp(parent);
|
|
501
|
-
}
|
|
502
|
-
async function assertPatchParentPath(filePath, options) {
|
|
503
|
-
if (options.workspaceOnly === false || options.sandbox) return;
|
|
504
|
-
const parent = path.dirname(filePath);
|
|
505
|
-
if (!parent || parent === ".") return;
|
|
506
|
-
await assertSandboxPath({
|
|
507
|
-
filePath: parent,
|
|
508
|
-
cwd: options.cwd,
|
|
509
|
-
root: options.cwd
|
|
510
|
-
});
|
|
511
|
-
await assertNoExistingParentAliases({
|
|
512
|
-
parentPath: resolvePathFromInput(parent, options.cwd),
|
|
513
|
-
rootPath: options.cwd
|
|
514
|
-
});
|
|
515
|
-
}
|
|
516
|
-
async function assertNoExistingParentAliases(params) {
|
|
517
|
-
const rootPath = path.resolve(params.rootPath);
|
|
518
|
-
const parentPath = path.resolve(params.parentPath);
|
|
519
|
-
const relative = path.relative(rootPath, parentPath);
|
|
520
|
-
if (!relative || relative === "" || relativePathEscapesRoot(relative)) return;
|
|
521
|
-
let current = rootPath;
|
|
522
|
-
for (const segment of relative.split(path.sep)) {
|
|
523
|
-
if (!segment) continue;
|
|
524
|
-
current = path.join(current, segment);
|
|
525
|
-
const stat = await fs$1.lstat(current).catch((error) => {
|
|
526
|
-
if (error.code === "ENOENT") return null;
|
|
527
|
-
throw error;
|
|
528
|
-
});
|
|
529
|
-
if (!stat) return;
|
|
530
|
-
if (stat.isSymbolicLink()) throw new Error(`Path alias under sandbox root: ${path.relative(rootPath, current)}`);
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
async function resolvePatchPath(filePath, options, aliasPolicy = PATH_ALIAS_POLICIES.strict) {
|
|
534
|
-
if (options.sandbox) {
|
|
535
|
-
const resolved = options.sandbox.bridge.resolvePath({
|
|
536
|
-
filePath,
|
|
537
|
-
cwd: options.cwd
|
|
538
|
-
});
|
|
539
|
-
if (options.workspaceOnly !== false && resolved.hostPath) await assertSandboxPath({
|
|
540
|
-
filePath: resolved.hostPath,
|
|
541
|
-
cwd: options.cwd,
|
|
542
|
-
root: options.cwd,
|
|
543
|
-
allowFinalSymlinkForUnlink: aliasPolicy.allowFinalSymlinkForUnlink,
|
|
544
|
-
allowFinalHardlinkForUnlink: aliasPolicy.allowFinalHardlinkForUnlink
|
|
545
|
-
});
|
|
546
|
-
return {
|
|
547
|
-
resolved: resolved.hostPath ?? resolved.containerPath,
|
|
548
|
-
display: resolved.relativePath || resolved.containerPath
|
|
549
|
-
};
|
|
550
|
-
}
|
|
551
|
-
const resolved = options.workspaceOnly !== false ? (await assertSandboxPath({
|
|
552
|
-
filePath,
|
|
553
|
-
cwd: options.cwd,
|
|
554
|
-
root: options.cwd,
|
|
555
|
-
allowFinalSymlinkForUnlink: aliasPolicy.allowFinalSymlinkForUnlink,
|
|
556
|
-
allowFinalHardlinkForUnlink: aliasPolicy.allowFinalHardlinkForUnlink
|
|
557
|
-
})).resolved : resolvePathFromInput(filePath, options.cwd);
|
|
558
|
-
return {
|
|
559
|
-
resolved,
|
|
560
|
-
display: toDisplayPath(resolved, options.cwd)
|
|
561
|
-
};
|
|
562
|
-
}
|
|
563
|
-
function assertBoundaryRead(opened, targetPath) {
|
|
564
|
-
if (opened.ok) return;
|
|
565
|
-
const reason = opened.reason === "validation" ? "unsafe path" : "path not found";
|
|
566
|
-
throw new Error(`Failed boundary read for ${targetPath} (${reason})`);
|
|
567
|
-
}
|
|
568
|
-
function toDisplayPath(resolved, cwd) {
|
|
569
|
-
const relative = path.relative(cwd, resolved);
|
|
570
|
-
if (!relative || relative === "") return path.basename(resolved);
|
|
571
|
-
if (relativePathEscapesRoot(relative)) return resolved;
|
|
572
|
-
return relative;
|
|
573
|
-
}
|
|
574
|
-
function relativePathEscapesRoot(relativePath) {
|
|
575
|
-
return relativePath === ".." || relativePath.startsWith("../") || relativePath.startsWith("..\\") || path.isAbsolute(relativePath);
|
|
576
|
-
}
|
|
577
|
-
function parsePatchText(input) {
|
|
578
|
-
const trimmed = input.trim();
|
|
579
|
-
if (!trimmed) throw new Error("Invalid patch: input is empty.");
|
|
580
|
-
const validated = checkPatchBoundariesLenient(trimmed.split(/\r?\n/));
|
|
581
|
-
const hunks = [];
|
|
582
|
-
const lastLineIndex = validated.length - 1;
|
|
583
|
-
let remaining = validated.slice(1, lastLineIndex);
|
|
584
|
-
let lineNumber = 2;
|
|
585
|
-
while (remaining.length > 0) {
|
|
586
|
-
const { hunk, consumed } = parseOneHunk(remaining, lineNumber);
|
|
587
|
-
hunks.push(hunk);
|
|
588
|
-
lineNumber += consumed;
|
|
589
|
-
remaining = remaining.slice(consumed);
|
|
590
|
-
}
|
|
591
|
-
return {
|
|
592
|
-
hunks,
|
|
593
|
-
patch: validated.join("\n")
|
|
594
|
-
};
|
|
595
|
-
}
|
|
596
|
-
function checkPatchBoundariesLenient(lines) {
|
|
597
|
-
const strictError = checkPatchBoundariesStrict(lines);
|
|
598
|
-
if (!strictError) return lines;
|
|
599
|
-
if (lines.length < 4) throw new Error(strictError);
|
|
600
|
-
const first = lines[0];
|
|
601
|
-
const last = lines.at(-1);
|
|
602
|
-
if (last && (first === "<<EOF" || first === "<<'EOF'" || first === "<<\"EOF\"") && last.endsWith("EOF")) {
|
|
603
|
-
const inner = lines.slice(1, -1);
|
|
604
|
-
const innerError = checkPatchBoundariesStrict(inner);
|
|
605
|
-
if (!innerError) return inner;
|
|
606
|
-
throw new Error(innerError);
|
|
607
|
-
}
|
|
608
|
-
throw new Error(strictError);
|
|
609
|
-
}
|
|
610
|
-
function checkPatchBoundariesStrict(lines) {
|
|
611
|
-
const firstLine = lines[0]?.trim();
|
|
612
|
-
const lastLine = lines[lines.length - 1]?.trim();
|
|
613
|
-
if (firstLine === BEGIN_PATCH_MARKER && lastLine === END_PATCH_MARKER) return null;
|
|
614
|
-
if (firstLine !== BEGIN_PATCH_MARKER) return "The first line of the patch must be '*** Begin Patch'";
|
|
615
|
-
return "The last line of the patch must be '*** End Patch'";
|
|
616
|
-
}
|
|
617
|
-
function parseOneHunk(lines, lineNumber) {
|
|
618
|
-
if (lines.length === 0) throw new Error(`Invalid patch hunk at line ${lineNumber}: empty hunk`);
|
|
619
|
-
const firstLine = lines[0].trim();
|
|
620
|
-
if (firstLine.startsWith(ADD_FILE_MARKER)) {
|
|
621
|
-
const targetPath = firstLine.slice(14);
|
|
622
|
-
let contents = "";
|
|
623
|
-
let consumed = 1;
|
|
624
|
-
for (const addLine of lines.slice(1)) if (addLine.startsWith("+")) {
|
|
625
|
-
contents += `${addLine.slice(1)}\n`;
|
|
626
|
-
consumed += 1;
|
|
627
|
-
} else break;
|
|
628
|
-
return {
|
|
629
|
-
hunk: {
|
|
630
|
-
kind: "add",
|
|
631
|
-
path: targetPath,
|
|
632
|
-
contents
|
|
633
|
-
},
|
|
634
|
-
consumed
|
|
635
|
-
};
|
|
636
|
-
}
|
|
637
|
-
if (firstLine.startsWith(DELETE_FILE_MARKER)) return {
|
|
638
|
-
hunk: {
|
|
639
|
-
kind: "delete",
|
|
640
|
-
path: firstLine.slice(17)
|
|
641
|
-
},
|
|
642
|
-
consumed: 1
|
|
643
|
-
};
|
|
644
|
-
if (firstLine.startsWith(UPDATE_FILE_MARKER)) {
|
|
645
|
-
const targetPath = firstLine.slice(17);
|
|
646
|
-
let remaining = lines.slice(1);
|
|
647
|
-
let consumed = 1;
|
|
648
|
-
let movePath;
|
|
649
|
-
const moveCandidate = remaining[0]?.trim();
|
|
650
|
-
if (moveCandidate?.startsWith(MOVE_TO_MARKER)) {
|
|
651
|
-
movePath = moveCandidate.slice(13);
|
|
652
|
-
remaining = remaining.slice(1);
|
|
653
|
-
consumed += 1;
|
|
654
|
-
}
|
|
655
|
-
const chunks = [];
|
|
656
|
-
while (remaining.length > 0) {
|
|
657
|
-
if (remaining[0].trim() === "") {
|
|
658
|
-
remaining = remaining.slice(1);
|
|
659
|
-
consumed += 1;
|
|
660
|
-
continue;
|
|
661
|
-
}
|
|
662
|
-
if (remaining[0].startsWith("***")) break;
|
|
663
|
-
const { chunk, consumed: chunkLines } = parseUpdateFileChunk(remaining, lineNumber + consumed, chunks.length === 0);
|
|
664
|
-
chunks.push(chunk);
|
|
665
|
-
remaining = remaining.slice(chunkLines);
|
|
666
|
-
consumed += chunkLines;
|
|
667
|
-
}
|
|
668
|
-
if (chunks.length === 0) throw new Error(`Invalid patch hunk at line ${lineNumber}: Update file hunk for path '${targetPath}' is empty`);
|
|
669
|
-
return {
|
|
670
|
-
hunk: {
|
|
671
|
-
kind: "update",
|
|
672
|
-
path: targetPath,
|
|
673
|
-
movePath,
|
|
674
|
-
chunks
|
|
675
|
-
},
|
|
676
|
-
consumed
|
|
677
|
-
};
|
|
678
|
-
}
|
|
679
|
-
throw new Error(`Invalid patch hunk at line ${lineNumber}: '${lines[0]}' is not a valid hunk header. Valid hunk headers: '*** Add File: {path}', '*** Delete File: {path}', '*** Update File: {path}'`);
|
|
680
|
-
}
|
|
681
|
-
function parseUpdateFileChunk(lines, lineNumber, allowMissingContext) {
|
|
682
|
-
if (lines.length === 0) throw new Error(`Invalid patch hunk at line ${lineNumber}: Update hunk does not contain any lines`);
|
|
683
|
-
let changeContext;
|
|
684
|
-
let startIndex = 0;
|
|
685
|
-
if (lines[0] === EMPTY_CHANGE_CONTEXT_MARKER) startIndex = 1;
|
|
686
|
-
else if (lines[0].startsWith(CHANGE_CONTEXT_MARKER)) {
|
|
687
|
-
changeContext = lines[0].slice(3);
|
|
688
|
-
startIndex = 1;
|
|
689
|
-
} else if (!allowMissingContext) throw new Error(`Invalid patch hunk at line ${lineNumber}: Expected update hunk to start with a @@ context marker, got: '${lines[0]}'`);
|
|
690
|
-
if (startIndex >= lines.length) throw new Error(`Invalid patch hunk at line ${lineNumber + 1}: Update hunk does not contain any lines`);
|
|
691
|
-
const chunk = {
|
|
692
|
-
changeContext,
|
|
693
|
-
oldLines: [],
|
|
694
|
-
newLines: [],
|
|
695
|
-
isEndOfFile: false
|
|
696
|
-
};
|
|
697
|
-
let parsedLines = 0;
|
|
698
|
-
for (const line of lines.slice(startIndex)) {
|
|
699
|
-
if (line === EOF_MARKER) {
|
|
700
|
-
if (parsedLines === 0) throw new Error(`Invalid patch hunk at line ${lineNumber + 1}: Update hunk does not contain any lines`);
|
|
701
|
-
chunk.isEndOfFile = true;
|
|
702
|
-
parsedLines += 1;
|
|
703
|
-
break;
|
|
704
|
-
}
|
|
705
|
-
const marker = line[0];
|
|
706
|
-
if (!marker) {
|
|
707
|
-
chunk.oldLines.push("");
|
|
708
|
-
chunk.newLines.push("");
|
|
709
|
-
parsedLines += 1;
|
|
710
|
-
continue;
|
|
711
|
-
}
|
|
712
|
-
if (marker === " ") {
|
|
713
|
-
const content = line.slice(1);
|
|
714
|
-
chunk.oldLines.push(content);
|
|
715
|
-
chunk.newLines.push(content);
|
|
716
|
-
parsedLines += 1;
|
|
717
|
-
continue;
|
|
718
|
-
}
|
|
719
|
-
if (marker === "+") {
|
|
720
|
-
chunk.newLines.push(line.slice(1));
|
|
721
|
-
parsedLines += 1;
|
|
722
|
-
continue;
|
|
723
|
-
}
|
|
724
|
-
if (marker === "-") {
|
|
725
|
-
chunk.oldLines.push(line.slice(1));
|
|
726
|
-
parsedLines += 1;
|
|
727
|
-
continue;
|
|
728
|
-
}
|
|
729
|
-
if (parsedLines === 0) throw new Error(`Invalid patch hunk at line ${lineNumber + 1}: Unexpected line found in update hunk: '${line}'. Every line should start with ' ' (context line), '+' (added line), or '-' (removed line)`);
|
|
730
|
-
break;
|
|
731
|
-
}
|
|
732
|
-
return {
|
|
733
|
-
chunk,
|
|
734
|
-
consumed: parsedLines + startIndex
|
|
735
|
-
};
|
|
736
|
-
}
|
|
737
|
-
//#endregion
|
|
738
|
-
//#region src/agents/local-model-lean.ts
|
|
739
|
-
const LOCAL_MODEL_LEAN_DENY_TOOL_NAMES = new Set([
|
|
740
|
-
"browser",
|
|
741
|
-
"cron",
|
|
742
|
-
"message"
|
|
743
|
-
]);
|
|
744
|
-
function resolveLocalModelLeanAgentId(params) {
|
|
745
|
-
const explicitAgentId = typeof params.agentId === "string" && params.agentId.trim() ? normalizeAgentId(params.agentId) : void 0;
|
|
746
|
-
if (explicitAgentId) return explicitAgentId;
|
|
747
|
-
const parsedSessionAgentId = parseAgentSessionKey(params.sessionKey)?.agentId;
|
|
748
|
-
if (parsedSessionAgentId) return normalizeAgentId(parsedSessionAgentId);
|
|
749
|
-
return params.config ? resolveDefaultAgentId(params.config) : void 0;
|
|
750
|
-
}
|
|
751
|
-
function isLocalModelLeanEnabled(params) {
|
|
752
|
-
const normalizedAgentId = resolveLocalModelLeanAgentId(params);
|
|
753
|
-
return (params.config && normalizedAgentId ? resolveAgentConfig(params.config, normalizedAgentId)?.experimental ?? params.config.agents?.defaults?.experimental : params.config?.agents?.defaults?.experimental)?.localModelLean ?? false;
|
|
754
|
-
}
|
|
755
|
-
function filterLocalModelLeanTools(params) {
|
|
756
|
-
if (!isLocalModelLeanEnabled(params)) return params.tools;
|
|
757
|
-
return params.tools.filter((tool) => !LOCAL_MODEL_LEAN_DENY_TOOL_NAMES.has(tool.name));
|
|
758
|
-
}
|
|
759
|
-
//#endregion
|
|
760
|
-
//#region src/agents/tool-search.ts
|
|
761
|
-
const TOOL_SEARCH_CODE_MODE_TOOL_NAME = "tool_search_code";
|
|
762
|
-
const TOOL_SEARCH_RAW_TOOL_NAME = "tool_search";
|
|
763
|
-
const TOOL_DESCRIBE_RAW_TOOL_NAME = "tool_describe";
|
|
764
|
-
const TOOL_CALL_RAW_TOOL_NAME = "tool_call";
|
|
765
|
-
const TOOL_SEARCH_CONTROL_TOOL_NAMES = new Set([
|
|
766
|
-
TOOL_SEARCH_CODE_MODE_TOOL_NAME,
|
|
767
|
-
TOOL_SEARCH_RAW_TOOL_NAME,
|
|
768
|
-
TOOL_DESCRIBE_RAW_TOOL_NAME,
|
|
769
|
-
TOOL_CALL_RAW_TOOL_NAME
|
|
770
|
-
]);
|
|
771
|
-
const DEFAULT_CODE_TIMEOUT_MS = 1e4;
|
|
772
|
-
const DEFAULT_SEARCH_LIMIT = 8;
|
|
773
|
-
const DEFAULT_MAX_SEARCH_LIMIT = 20;
|
|
774
|
-
const MAX_REUSABLE_CATALOG_SNAPSHOTS = 256;
|
|
775
|
-
const TOOL_SEARCH_CODE_MODE_CHILD_SOURCE = String.raw`
|
|
776
|
-
import vm from "node:vm";
|
|
777
|
-
|
|
778
|
-
let activeController;
|
|
779
|
-
|
|
780
|
-
function send(message) {
|
|
781
|
-
if (typeof process.send === "function" && process.connected) {
|
|
782
|
-
process.send(message);
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
function sendAndFlush(message) {
|
|
787
|
-
return new Promise((resolve) => {
|
|
788
|
-
if (typeof process.send !== "function" || !process.connected) {
|
|
789
|
-
resolve();
|
|
790
|
-
return;
|
|
791
|
-
}
|
|
792
|
-
try {
|
|
793
|
-
process.send(message, () => resolve());
|
|
794
|
-
} catch {
|
|
795
|
-
resolve();
|
|
796
|
-
}
|
|
797
|
-
});
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
function toJsonSafe(value) {
|
|
801
|
-
if (value === undefined) {
|
|
802
|
-
return null;
|
|
803
|
-
}
|
|
804
|
-
try {
|
|
805
|
-
return JSON.parse(JSON.stringify(value));
|
|
806
|
-
} catch {
|
|
807
|
-
if (value instanceof Error) {
|
|
808
|
-
return value.message;
|
|
809
|
-
}
|
|
810
|
-
if (value === null) {
|
|
811
|
-
return null;
|
|
812
|
-
}
|
|
813
|
-
switch (typeof value) {
|
|
814
|
-
case "string":
|
|
815
|
-
return value;
|
|
816
|
-
case "number":
|
|
817
|
-
case "boolean":
|
|
818
|
-
case "bigint":
|
|
819
|
-
case "symbol":
|
|
820
|
-
case "function":
|
|
821
|
-
return String(value);
|
|
822
|
-
default:
|
|
823
|
-
return Object.prototype.toString.call(value);
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
function formatLogItem(value) {
|
|
829
|
-
if (typeof value === "string") {
|
|
830
|
-
return value;
|
|
831
|
-
}
|
|
832
|
-
const safe = toJsonSafe(value);
|
|
833
|
-
return typeof safe === "string" ? safe : JSON.stringify(safe);
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
function bridgeResultPayload(message) {
|
|
837
|
-
if (!message.ok) {
|
|
838
|
-
return typeof message.error === "string" ? message.error : "tool bridge failed";
|
|
839
|
-
}
|
|
840
|
-
const json = JSON.stringify(toJsonSafe(message.value));
|
|
841
|
-
return typeof json === "string" ? json : "null";
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
function settleBridge(message) {
|
|
845
|
-
if (!activeController) {
|
|
846
|
-
return;
|
|
847
|
-
}
|
|
848
|
-
const id = typeof message?.id === "string" ? message.id : "";
|
|
849
|
-
try {
|
|
850
|
-
activeController.settleBridge(id, Boolean(message.ok), bridgeResultPayload(message));
|
|
851
|
-
} catch (error) {
|
|
852
|
-
send({
|
|
853
|
-
type: "result",
|
|
854
|
-
ok: false,
|
|
855
|
-
error: error instanceof Error ? error.message : String(error),
|
|
856
|
-
});
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
function buildModelScriptSource(code) {
|
|
861
|
-
return "(async (fengming, console) => {\n" + code + "\n})(fengming, console)";
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
function buildControllerSource() {
|
|
865
|
-
return (
|
|
866
|
-
'"use strict";\n' +
|
|
867
|
-
"(() => {\n" +
|
|
868
|
-
"const pending = new Map();\n" +
|
|
869
|
-
"const bridgeMessages = [];\n" +
|
|
870
|
-
"const logs = [];\n" +
|
|
871
|
-
"let idleWaiters = [];\n" +
|
|
872
|
-
"let nextBridgeId = 1;\n" +
|
|
873
|
-
toJsonSafe.toString() +
|
|
874
|
-
"\n" +
|
|
875
|
-
formatLogItem.toString() +
|
|
876
|
-
"\n" +
|
|
877
|
-
"function notifyBridgeIdle() {\n" +
|
|
878
|
-
" if (pending.size !== 0 || bridgeMessages.length !== 0) return;\n" +
|
|
879
|
-
" const waiters = idleWaiters;\n" +
|
|
880
|
-
" idleWaiters = [];\n" +
|
|
881
|
-
" for (const resolve of waiters) resolve();\n" +
|
|
882
|
-
"}\n" +
|
|
883
|
-
"function isBridgeIdle() {\n" +
|
|
884
|
-
" return pending.size === 0 && bridgeMessages.length === 0;\n" +
|
|
885
|
-
"}\n" +
|
|
886
|
-
"function waitForBridgeIdle() {\n" +
|
|
887
|
-
" if (isBridgeIdle()) return Promise.resolve();\n" +
|
|
888
|
-
" return new Promise((resolve) => idleWaiters.push(resolve));\n" +
|
|
889
|
-
"}\n" +
|
|
890
|
-
"function bridge(method, args) {\n" +
|
|
891
|
-
" let promise;\n" +
|
|
892
|
-
" const start = () => {\n" +
|
|
893
|
-
" if (!promise) {\n" +
|
|
894
|
-
" const id = String(nextBridgeId++);\n" +
|
|
895
|
-
" promise = new Promise((resolve, reject) => {\n" +
|
|
896
|
-
" pending.set(id, { resolve, reject });\n" +
|
|
897
|
-
" bridgeMessages.push({ id, method, args: toJsonSafe(args) });\n" +
|
|
898
|
-
" });\n" +
|
|
899
|
-
" }\n" +
|
|
900
|
-
" return promise;\n" +
|
|
901
|
-
" };\n" +
|
|
902
|
-
" return Object.freeze({\n" +
|
|
903
|
-
" then: (resolve, reject) => start().then(resolve, reject),\n" +
|
|
904
|
-
" catch: (reject) => start().catch(reject),\n" +
|
|
905
|
-
" finally: (onFinally) => start().finally(onFinally),\n" +
|
|
906
|
-
" });\n" +
|
|
907
|
-
"}\n" +
|
|
908
|
-
"const console = Object.freeze({\n" +
|
|
909
|
-
" log: (...items) => logs.push(items.map(formatLogItem)),\n" +
|
|
910
|
-
" warn: (...items) => logs.push(items.map(formatLogItem)),\n" +
|
|
911
|
-
" error: (...items) => logs.push(items.map(formatLogItem)),\n" +
|
|
912
|
-
"});\n" +
|
|
913
|
-
"const fengming = Object.freeze({\n" +
|
|
914
|
-
" tools: Object.freeze({\n" +
|
|
915
|
-
" search: (query, options) => bridge('search', [query, options]),\n" +
|
|
916
|
-
" describe: (id) => bridge('describe', [id]),\n" +
|
|
917
|
-
" call: (id, input) => bridge('call', [id, input]),\n" +
|
|
918
|
-
" }),\n" +
|
|
919
|
-
"});\n" +
|
|
920
|
-
"return Object.freeze({\n" +
|
|
921
|
-
" fengming,\n" +
|
|
922
|
-
" console,\n" +
|
|
923
|
-
" isBridgeIdle,\n" +
|
|
924
|
-
" waitForBridgeIdle,\n" +
|
|
925
|
-
" takeLogs: () => logs.splice(0),\n" +
|
|
926
|
-
" takeBridgeMessages: () => bridgeMessages.splice(0),\n" +
|
|
927
|
-
" settleBridge: (id, ok, payload) => {\n" +
|
|
928
|
-
" const waiter = pending.get(String(id));\n" +
|
|
929
|
-
" if (!waiter) return;\n" +
|
|
930
|
-
" pending.delete(String(id));\n" +
|
|
931
|
-
" if (ok) {\n" +
|
|
932
|
-
" waiter.resolve(JSON.parse(String(payload)));\n" +
|
|
933
|
-
" } else {\n" +
|
|
934
|
-
" waiter.reject(new Error(String(payload)));\n" +
|
|
935
|
-
" }\n" +
|
|
936
|
-
" Promise.resolve().then(notifyBridgeIdle);\n" +
|
|
937
|
-
" },\n" +
|
|
938
|
-
"});\n" +
|
|
939
|
-
"})()"
|
|
940
|
-
);
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
function pumpController(controller) {
|
|
944
|
-
for (const items of controller.takeLogs()) {
|
|
945
|
-
send({ type: "log", items });
|
|
946
|
-
}
|
|
947
|
-
for (const message of controller.takeBridgeMessages()) {
|
|
948
|
-
send({ type: "bridge", id: message.id, method: message.method, args: message.args });
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
async function runModelCode(code, timeoutMs) {
|
|
953
|
-
const sandbox = Object.create(null);
|
|
954
|
-
const context = vm.createContext(sandbox, {
|
|
955
|
-
name: "tool_search_code",
|
|
956
|
-
codeGeneration: { strings: false, wasm: false },
|
|
957
|
-
});
|
|
958
|
-
const controllerScript = new vm.Script(buildControllerSource(), {
|
|
959
|
-
filename: "tool_search_code:controller.js",
|
|
960
|
-
});
|
|
961
|
-
const controller = controllerScript.runInContext(context, {
|
|
962
|
-
timeout: Math.max(1, Math.min(Number(timeoutMs) || 1, 2147483647)),
|
|
963
|
-
breakOnSigint: false,
|
|
964
|
-
});
|
|
965
|
-
Object.defineProperties(sandbox, {
|
|
966
|
-
console: { value: controller.console, enumerable: true },
|
|
967
|
-
fengming: { value: controller.fengming, enumerable: true },
|
|
968
|
-
});
|
|
969
|
-
activeController = controller;
|
|
970
|
-
const pumpTimer = setInterval(() => pumpController(controller), 1);
|
|
971
|
-
try {
|
|
972
|
-
const modelScript = new vm.Script(buildModelScriptSource(code), {
|
|
973
|
-
filename: "tool_search_code:model.js",
|
|
974
|
-
});
|
|
975
|
-
const result = await Promise.resolve(
|
|
976
|
-
modelScript.runInContext(context, {
|
|
977
|
-
timeout: Math.max(1, Math.min(Number(timeoutMs) || 1, 2147483647)),
|
|
978
|
-
breakOnSigint: false,
|
|
979
|
-
}),
|
|
980
|
-
).then(
|
|
981
|
-
(value) => ({ ok: true, value: toJsonSafe(value) }),
|
|
982
|
-
(error) => ({ ok: false, error: error instanceof Error ? error.message : String(error) }),
|
|
983
|
-
);
|
|
984
|
-
do {
|
|
985
|
-
pumpController(controller);
|
|
986
|
-
await controller.waitForBridgeIdle();
|
|
987
|
-
pumpController(controller);
|
|
988
|
-
} while (!controller.isBridgeIdle());
|
|
989
|
-
pumpController(controller);
|
|
990
|
-
await sendAndFlush(
|
|
991
|
-
result.ok
|
|
992
|
-
? { type: "result", ok: true, value: result.value }
|
|
993
|
-
: { type: "result", ok: false, error: result.error },
|
|
994
|
-
);
|
|
995
|
-
} finally {
|
|
996
|
-
clearInterval(pumpTimer);
|
|
997
|
-
activeController = undefined;
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
process.on("message", (message) => {
|
|
1002
|
-
if (message?.type === "bridge-result") {
|
|
1003
|
-
settleBridge(message);
|
|
1004
|
-
return;
|
|
1005
|
-
}
|
|
1006
|
-
if (message?.type !== "run") {
|
|
1007
|
-
return;
|
|
1008
|
-
}
|
|
1009
|
-
const code = typeof message.code === "string" ? message.code : "";
|
|
1010
|
-
runModelCode(code, message.timeoutMs).catch((error) => {
|
|
1011
|
-
return sendAndFlush({
|
|
1012
|
-
type: "result",
|
|
1013
|
-
ok: false,
|
|
1014
|
-
error: error instanceof Error ? error.message : String(error),
|
|
1015
|
-
});
|
|
1016
|
-
}).finally(() => {
|
|
1017
|
-
setTimeout(() => process.exit(0), 100);
|
|
1018
|
-
});
|
|
1019
|
-
});
|
|
1020
|
-
`;
|
|
1021
|
-
const SESSION_CATALOGS_KEY = Symbol.for("fengming.toolSearch.sessionCatalogs");
|
|
1022
|
-
const globalToolSearchState = globalThis;
|
|
1023
|
-
const sessionCatalogs = globalToolSearchState[SESSION_CATALOGS_KEY] ?? (globalToolSearchState[SESSION_CATALOGS_KEY] = /* @__PURE__ */ new Map());
|
|
1024
|
-
const reusableCatalogSnapshots = /* @__PURE__ */ new Map();
|
|
1025
|
-
const catalogFingerprints = /* @__PURE__ */ new WeakMap();
|
|
1026
|
-
const catalogToolIdentities = /* @__PURE__ */ new WeakMap();
|
|
1027
|
-
let nextCatalogToolIdentity = 1;
|
|
1028
|
-
function readToolSearchConfig(config) {
|
|
1029
|
-
const toolSearch = (isRecord(config?.tools) ? config.tools : void 0)?.toolSearch;
|
|
1030
|
-
if (toolSearch === true) return { enabled: true };
|
|
1031
|
-
if (toolSearch === false) return { enabled: false };
|
|
1032
|
-
return isRecord(toolSearch) ? toolSearch : {};
|
|
1033
|
-
}
|
|
1034
|
-
function readBoolean(value, fallback) {
|
|
1035
|
-
return typeof value === "boolean" ? value : fallback;
|
|
1036
|
-
}
|
|
1037
|
-
function readInteger(value, fallback) {
|
|
1038
|
-
return typeof value === "number" && Number.isInteger(value) && value > 0 ? value : fallback;
|
|
1039
|
-
}
|
|
1040
|
-
function isToolSearchCodeModeSupported() {
|
|
1041
|
-
return process.allowedNodeEnvironmentFlags.has("--permission");
|
|
1042
|
-
}
|
|
1043
|
-
function resolveToolSearchConfig(config) {
|
|
1044
|
-
const raw = readToolSearchConfig(config);
|
|
1045
|
-
const rawMode = typeof raw.mode === "string" ? raw.mode : "code";
|
|
1046
|
-
const requestedMode = rawMode === "tools" || rawMode === "code" ? rawMode : "code";
|
|
1047
|
-
const mode = requestedMode === "code" && !isToolSearchCodeModeSupported() ? "tools" : requestedMode;
|
|
1048
|
-
const configured = Object.keys(raw).some((key) => key !== "enabled");
|
|
1049
|
-
const maxSearchLimit = Math.max(1, Math.min(50, readInteger(raw.maxSearchLimit, DEFAULT_MAX_SEARCH_LIMIT)));
|
|
1050
|
-
return {
|
|
1051
|
-
enabled: readBoolean(raw.enabled, configured),
|
|
1052
|
-
mode,
|
|
1053
|
-
codeTimeoutMs: Math.max(1e3, Math.min(6e4, readInteger(raw.codeTimeoutMs, DEFAULT_CODE_TIMEOUT_MS))),
|
|
1054
|
-
searchDefaultLimit: Math.max(1, Math.min(maxSearchLimit, readInteger(raw.searchDefaultLimit, DEFAULT_SEARCH_LIMIT))),
|
|
1055
|
-
maxSearchLimit
|
|
1056
|
-
};
|
|
1057
|
-
}
|
|
1058
|
-
function sessionCatalogKeys(input) {
|
|
1059
|
-
const runId = input.runId?.trim();
|
|
1060
|
-
if (runId) return [`run:${runId}`];
|
|
1061
|
-
const keys = [];
|
|
1062
|
-
if (input.sessionId?.trim()) keys.push(`session:${input.sessionId.trim()}`);
|
|
1063
|
-
if (input.sessionKey?.trim()) keys.push(`key:${input.sessionKey.trim()}`);
|
|
1064
|
-
if (input.agentId?.trim()) keys.push(`agent:${input.agentId.trim()}`);
|
|
1065
|
-
return uniqueStrings(keys);
|
|
1066
|
-
}
|
|
1067
|
-
function sessionCatalogKey(input) {
|
|
1068
|
-
return sessionCatalogKeys(input)[0];
|
|
1069
|
-
}
|
|
1070
|
-
function reusableCatalogKey(input) {
|
|
1071
|
-
return sessionCatalogKey({
|
|
1072
|
-
sessionId: input.sessionId,
|
|
1073
|
-
sessionKey: input.sessionKey,
|
|
1074
|
-
agentId: input.agentId
|
|
1075
|
-
});
|
|
1076
|
-
}
|
|
1077
|
-
function stableJsonFingerprint(value, seen = /* @__PURE__ */ new WeakSet()) {
|
|
1078
|
-
if (value === null || typeof value !== "object") return JSON.stringify(value) ?? "undefined";
|
|
1079
|
-
if (seen.has(value)) return "\"[Circular]\"";
|
|
1080
|
-
seen.add(value);
|
|
1081
|
-
if (Array.isArray(value)) return `[${value.map((item) => stableJsonFingerprint(item, seen)).join(",")}]`;
|
|
1082
|
-
const record = value;
|
|
1083
|
-
return `{${Object.keys(record).toSorted().map((key) => `${JSON.stringify(key)}:${stableJsonFingerprint(record[key], seen)}`).join(",")}}`;
|
|
1084
|
-
}
|
|
1085
|
-
function catalogToolIdentity(tool) {
|
|
1086
|
-
const existing = catalogToolIdentities.get(tool);
|
|
1087
|
-
if (existing !== void 0) return existing;
|
|
1088
|
-
const next = nextCatalogToolIdentity;
|
|
1089
|
-
nextCatalogToolIdentity += 1;
|
|
1090
|
-
catalogToolIdentities.set(tool, next);
|
|
1091
|
-
return next;
|
|
1092
|
-
}
|
|
1093
|
-
function catalogEntriesFingerprint(entries) {
|
|
1094
|
-
return entries.map((entry) => [
|
|
1095
|
-
entry.id,
|
|
1096
|
-
entry.source,
|
|
1097
|
-
entry.sourceName ?? "",
|
|
1098
|
-
entry.name,
|
|
1099
|
-
entry.label ?? "",
|
|
1100
|
-
entry.description,
|
|
1101
|
-
stableJsonFingerprint(entry.parameters),
|
|
1102
|
-
String(catalogToolIdentity(entry.tool))
|
|
1103
|
-
].map((part) => JSON.stringify(part)).join(":")).toSorted().join("\n");
|
|
1104
|
-
}
|
|
1105
|
-
function restoreToolSearchCatalog(params) {
|
|
1106
|
-
const keys = sessionCatalogKeys(params);
|
|
1107
|
-
if (keys.length === 0 && !params.catalogRef) return;
|
|
1108
|
-
const next = {
|
|
1109
|
-
entries: params.entries,
|
|
1110
|
-
searchCount: 0,
|
|
1111
|
-
describeCount: 0,
|
|
1112
|
-
callCount: 0
|
|
1113
|
-
};
|
|
1114
|
-
if (params.catalogRef) params.catalogRef.current = next;
|
|
1115
|
-
catalogFingerprints.set(next, params.fingerprint);
|
|
1116
|
-
for (const key of keys) sessionCatalogs.set(key, next);
|
|
1117
|
-
return next;
|
|
1118
|
-
}
|
|
1119
|
-
function bindToolSearchCatalog(params) {
|
|
1120
|
-
if (params.catalogRef) params.catalogRef.current = params.catalog;
|
|
1121
|
-
for (const key of sessionCatalogKeys(params)) sessionCatalogs.set(key, params.catalog);
|
|
1122
|
-
}
|
|
1123
|
-
function rememberReusableCatalog(key, catalog) {
|
|
1124
|
-
if (!key) return;
|
|
1125
|
-
const fingerprint = catalogFingerprints.get(catalog);
|
|
1126
|
-
if (!fingerprint) return;
|
|
1127
|
-
if (reusableCatalogSnapshots.has(key)) reusableCatalogSnapshots.delete(key);
|
|
1128
|
-
reusableCatalogSnapshots.set(key, {
|
|
1129
|
-
entries: catalog.entries,
|
|
1130
|
-
fingerprint
|
|
1131
|
-
});
|
|
1132
|
-
while (reusableCatalogSnapshots.size > MAX_REUSABLE_CATALOG_SNAPSHOTS) {
|
|
1133
|
-
const oldestKey = reusableCatalogSnapshots.keys().next().value;
|
|
1134
|
-
if (!oldestKey) break;
|
|
1135
|
-
reusableCatalogSnapshots.delete(oldestKey);
|
|
1136
|
-
}
|
|
1137
|
-
}
|
|
1138
|
-
function classifyTool(tool) {
|
|
1139
|
-
const pluginId = getPluginToolMeta(tool)?.pluginId?.trim();
|
|
1140
|
-
if (pluginId === "bundle-mcp") return {
|
|
1141
|
-
source: "mcp",
|
|
1142
|
-
sourceName: pluginId
|
|
1143
|
-
};
|
|
1144
|
-
if (pluginId) return {
|
|
1145
|
-
source: "fengming",
|
|
1146
|
-
sourceName: pluginId
|
|
1147
|
-
};
|
|
1148
|
-
return {
|
|
1149
|
-
source: "fengming",
|
|
1150
|
-
sourceName: "core"
|
|
1151
|
-
};
|
|
1152
|
-
}
|
|
1153
|
-
function makeCatalogId(tool, source, sourceName) {
|
|
1154
|
-
return `${source}:${sourceName?.trim() || "core"}:${tool.name}`;
|
|
1155
|
-
}
|
|
1156
|
-
function wrapCatalogTool(tool, hookContext) {
|
|
1157
|
-
if (!hookContext || isToolWrappedWithBeforeToolCallHook(tool)) return tool;
|
|
1158
|
-
return wrapToolWithBeforeToolCallHook(tool, hookContext);
|
|
1159
|
-
}
|
|
1160
|
-
function toCatalogEntry(tool, sourceOverride, hookContext) {
|
|
1161
|
-
const classified = classifyTool(tool);
|
|
1162
|
-
const source = sourceOverride ?? classified.source;
|
|
1163
|
-
const sourceName = sourceOverride === "client" ? "client" : classified.sourceName;
|
|
1164
|
-
const catalogTool = source === "client" ? tool : wrapCatalogTool(tool, hookContext);
|
|
1165
|
-
return {
|
|
1166
|
-
id: makeCatalogId(tool, source, sourceName),
|
|
1167
|
-
source,
|
|
1168
|
-
sourceName,
|
|
1169
|
-
name: tool.name,
|
|
1170
|
-
label: tool.label,
|
|
1171
|
-
description: tool.description ?? "",
|
|
1172
|
-
parameters: tool.parameters,
|
|
1173
|
-
tool: catalogTool
|
|
1174
|
-
};
|
|
1175
|
-
}
|
|
1176
|
-
function shouldCatalogTool(tool) {
|
|
1177
|
-
if (TOOL_SEARCH_CONTROL_TOOL_NAMES.has(tool.name)) return false;
|
|
1178
|
-
return true;
|
|
1179
|
-
}
|
|
1180
|
-
function shouldExposeControlTool(name, mode) {
|
|
1181
|
-
if (name === "tool_search_code") return mode === "code";
|
|
1182
|
-
if (name === "tool_search" || name === "tool_describe" || name === "tool_call") return mode === "tools";
|
|
1183
|
-
return false;
|
|
1184
|
-
}
|
|
1185
|
-
function readMessageToolResultId(message) {
|
|
1186
|
-
const record = message;
|
|
1187
|
-
const role = typeof record.role === "string" ? record.role : "";
|
|
1188
|
-
const canUseDirectId = role === "toolResult" || role === "tool";
|
|
1189
|
-
const direct = record.toolCallId ?? record.toolUseId ?? record.tool_use_id;
|
|
1190
|
-
if (canUseDirectId && typeof direct === "string" && direct.trim()) return direct;
|
|
1191
|
-
const content = record.content;
|
|
1192
|
-
if (!Array.isArray(content)) return;
|
|
1193
|
-
for (const block of content) {
|
|
1194
|
-
if (!isRecord(block)) continue;
|
|
1195
|
-
if (block.type !== "toolResult") continue;
|
|
1196
|
-
const nested = block.toolCallId ?? block.toolUseId ?? block.tool_use_id ?? block.id;
|
|
1197
|
-
if (typeof nested === "string" && nested.trim()) return nested;
|
|
1198
|
-
}
|
|
1199
|
-
}
|
|
1200
|
-
function textFromToolSearchProjectionResult(result, isError) {
|
|
1201
|
-
if (isRecord(result)) {
|
|
1202
|
-
const detailError = (isRecord(result.details) ? result.details : void 0)?.error;
|
|
1203
|
-
if (typeof detailError === "string" && detailError.trim()) return detailError;
|
|
1204
|
-
const content = result.content;
|
|
1205
|
-
if (Array.isArray(content)) {
|
|
1206
|
-
const text = content.map((item) => isRecord(item) && typeof item.text === "string" ? item.text : "").filter(Boolean).join("\n");
|
|
1207
|
-
if (text.trim()) return text;
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
const safe = toJsonSafe(result);
|
|
1211
|
-
if (typeof safe === "string") return safe;
|
|
1212
|
-
const encoded = JSON.stringify(safe);
|
|
1213
|
-
if (typeof encoded === "string") return encoded;
|
|
1214
|
-
return isError ? "Tool Search target tool failed." : "Tool Search target tool completed.";
|
|
1215
|
-
}
|
|
1216
|
-
function buildToolSearchTargetTranscriptMessages(projection) {
|
|
1217
|
-
const input = toJsonSafe(projection.input);
|
|
1218
|
-
const timestamp = projection.timestamp ?? Date.now();
|
|
1219
|
-
const resultRecord = isRecord(projection.result) ? projection.result : void 0;
|
|
1220
|
-
const resultContent = Array.isArray(resultRecord?.content) && resultRecord.content.length > 0 ? toJsonSafe(resultRecord.content) : [{
|
|
1221
|
-
type: "text",
|
|
1222
|
-
text: textFromToolSearchProjectionResult(projection.result, projection.isError === true)
|
|
1223
|
-
}];
|
|
1224
|
-
return [{
|
|
1225
|
-
role: "assistant",
|
|
1226
|
-
content: [{
|
|
1227
|
-
type: "toolCall",
|
|
1228
|
-
id: projection.toolCallId,
|
|
1229
|
-
name: projection.toolName,
|
|
1230
|
-
arguments: input,
|
|
1231
|
-
input
|
|
1232
|
-
}],
|
|
1233
|
-
stopReason: "toolUse",
|
|
1234
|
-
timestamp
|
|
1235
|
-
}, {
|
|
1236
|
-
role: "toolResult",
|
|
1237
|
-
toolCallId: projection.toolCallId,
|
|
1238
|
-
toolName: projection.toolName,
|
|
1239
|
-
isError: projection.isError === true,
|
|
1240
|
-
content: resultContent,
|
|
1241
|
-
timestamp
|
|
1242
|
-
}];
|
|
1243
|
-
}
|
|
1244
|
-
function projectToolSearchTargetTranscriptMessages(messages, projections) {
|
|
1245
|
-
if (projections.length === 0) return messages;
|
|
1246
|
-
const byParent = /* @__PURE__ */ new Map();
|
|
1247
|
-
const unmatched = [];
|
|
1248
|
-
for (const projection of projections) {
|
|
1249
|
-
const parent = projection.parentToolCallId?.trim();
|
|
1250
|
-
if (!parent) {
|
|
1251
|
-
unmatched.push(projection);
|
|
1252
|
-
continue;
|
|
1253
|
-
}
|
|
1254
|
-
const group = byParent.get(parent) ?? [];
|
|
1255
|
-
group.push(projection);
|
|
1256
|
-
byParent.set(parent, group);
|
|
1257
|
-
}
|
|
1258
|
-
const inserted = /* @__PURE__ */ new Set();
|
|
1259
|
-
const projected = [];
|
|
1260
|
-
for (const message of messages) {
|
|
1261
|
-
projected.push(message);
|
|
1262
|
-
const toolResultId = readMessageToolResultId(message);
|
|
1263
|
-
const group = toolResultId ? byParent.get(toolResultId) : void 0;
|
|
1264
|
-
if (!group) continue;
|
|
1265
|
-
for (const projection of group) {
|
|
1266
|
-
projected.push(...buildToolSearchTargetTranscriptMessages(projection));
|
|
1267
|
-
inserted.add(projection);
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1270
|
-
for (const projection of [...unmatched, ...projections]) {
|
|
1271
|
-
if (inserted.has(projection)) continue;
|
|
1272
|
-
projected.push(...buildToolSearchTargetTranscriptMessages(projection));
|
|
1273
|
-
inserted.add(projection);
|
|
1274
|
-
}
|
|
1275
|
-
return projected;
|
|
1276
|
-
}
|
|
1277
|
-
function createToolSearchCatalogRef() {
|
|
1278
|
-
return {};
|
|
1279
|
-
}
|
|
1280
|
-
function applyToolSearchCatalog(params) {
|
|
1281
|
-
const config = resolveToolSearchConfig(params.config);
|
|
1282
|
-
return applyToolCatalogCompaction({
|
|
1283
|
-
...params,
|
|
1284
|
-
enabled: config.enabled,
|
|
1285
|
-
isVisibleControlTool: (tool) => TOOL_SEARCH_CONTROL_TOOL_NAMES.has(tool.name) && shouldExposeControlTool(tool.name, config.mode)
|
|
1286
|
-
});
|
|
1287
|
-
}
|
|
1288
|
-
function addClientToolsToToolSearchCatalog(params) {
|
|
1289
|
-
return addClientToolsToToolCatalog({
|
|
1290
|
-
...params,
|
|
1291
|
-
enabled: resolveToolSearchConfig(params.config).enabled
|
|
1292
|
-
});
|
|
1293
|
-
}
|
|
1294
|
-
function registerToolSearchCatalog(params) {
|
|
1295
|
-
const keys = sessionCatalogKeys(params);
|
|
1296
|
-
const primaryKey = keys[0];
|
|
1297
|
-
if (!primaryKey && !params.catalogRef) return;
|
|
1298
|
-
const prior = params.append ? params.catalogRef?.current ?? (primaryKey ? sessionCatalogs.get(primaryKey) : void 0) : void 0;
|
|
1299
|
-
const byId = /* @__PURE__ */ new Map();
|
|
1300
|
-
for (const entry of prior?.entries ?? []) byId.set(entry.id, entry);
|
|
1301
|
-
for (const entry of params.entries) {
|
|
1302
|
-
byId.set(entry.id, entry);
|
|
1303
|
-
byId.set(entry.name, entry);
|
|
1304
|
-
}
|
|
1305
|
-
const next = {
|
|
1306
|
-
entries: uniqueValues(byId.values()).toSorted((a, b) => a.id.localeCompare(b.id)),
|
|
1307
|
-
searchCount: prior?.searchCount ?? 0,
|
|
1308
|
-
describeCount: prior?.describeCount ?? 0,
|
|
1309
|
-
callCount: prior?.callCount ?? 0
|
|
1310
|
-
};
|
|
1311
|
-
catalogFingerprints.set(next, catalogEntriesFingerprint(next.entries));
|
|
1312
|
-
if (params.catalogRef) params.catalogRef.current = next;
|
|
1313
|
-
for (const key of keys) sessionCatalogs.set(key, next);
|
|
1314
|
-
return next;
|
|
1315
|
-
}
|
|
1316
|
-
function clearToolSearchCatalog(params) {
|
|
1317
|
-
if (params.catalogRef) params.catalogRef.current = void 0;
|
|
1318
|
-
for (const key of sessionCatalogKeys(params)) sessionCatalogs.delete(key);
|
|
1319
|
-
if (!params.runId?.trim()) {
|
|
1320
|
-
const snapshotKey = reusableCatalogKey(params);
|
|
1321
|
-
if (snapshotKey) reusableCatalogSnapshots.delete(snapshotKey);
|
|
1322
|
-
}
|
|
1323
|
-
}
|
|
1324
|
-
function resolveCatalog(ctx) {
|
|
1325
|
-
if (ctx.catalogRef?.current) return ctx.catalogRef.current;
|
|
1326
|
-
const keys = sessionCatalogKeys({
|
|
1327
|
-
sessionId: ctx.sessionId,
|
|
1328
|
-
sessionKey: ctx.sessionKey,
|
|
1329
|
-
agentId: ctx.agentId,
|
|
1330
|
-
runId: ctx.runId
|
|
1331
|
-
});
|
|
1332
|
-
for (const key of keys) {
|
|
1333
|
-
const catalog = sessionCatalogs.get(key);
|
|
1334
|
-
if (catalog) return catalog;
|
|
1335
|
-
}
|
|
1336
|
-
if (ctx.runId?.trim()) throw new ToolInputError("Tool Search catalog is unavailable for this run.");
|
|
1337
|
-
const uniqueCatalogs = uniqueValues(sessionCatalogs.values());
|
|
1338
|
-
if (uniqueCatalogs.length === 1) {
|
|
1339
|
-
const catalog = uniqueCatalogs[0];
|
|
1340
|
-
if (catalog) return catalog;
|
|
1341
|
-
}
|
|
1342
|
-
throw new ToolInputError("Tool Search catalog is unavailable for this run.");
|
|
1343
|
-
}
|
|
1344
|
-
function compactEntry(entry) {
|
|
1345
|
-
return {
|
|
1346
|
-
id: entry.id,
|
|
1347
|
-
source: entry.source,
|
|
1348
|
-
sourceName: entry.sourceName,
|
|
1349
|
-
name: entry.name,
|
|
1350
|
-
label: entry.label,
|
|
1351
|
-
description: entry.description
|
|
1352
|
-
};
|
|
1353
|
-
}
|
|
1354
|
-
function describeEntry(entry) {
|
|
1355
|
-
return {
|
|
1356
|
-
...compactEntry(entry),
|
|
1357
|
-
parameters: entry.parameters ?? {}
|
|
1358
|
-
};
|
|
1359
|
-
}
|
|
1360
|
-
function tokenize(input) {
|
|
1361
|
-
return normalizeStringEntries(input.toLowerCase().split(/[^a-z0-9_./:-]+/u));
|
|
1362
|
-
}
|
|
1363
|
-
function scoreEntry(entry, terms) {
|
|
1364
|
-
if (terms.length === 0) return 1;
|
|
1365
|
-
const name = entry.name.toLowerCase();
|
|
1366
|
-
const id = entry.id.toLowerCase();
|
|
1367
|
-
const label = (entry.label ?? "").toLowerCase();
|
|
1368
|
-
const description = entry.description.toLowerCase();
|
|
1369
|
-
let score = 0;
|
|
1370
|
-
for (const term of terms) {
|
|
1371
|
-
if (name === term || id === term) score += 20;
|
|
1372
|
-
if (name.includes(term)) score += 8;
|
|
1373
|
-
if (id.includes(term)) score += 6;
|
|
1374
|
-
if (label.includes(term)) score += 4;
|
|
1375
|
-
if (description.includes(term)) score += 2;
|
|
1376
|
-
}
|
|
1377
|
-
return score;
|
|
1378
|
-
}
|
|
1379
|
-
function findEntry(catalog, id) {
|
|
1380
|
-
const needle = id.trim();
|
|
1381
|
-
const entry = catalog.entries.find((candidate) => candidate.id === needle || candidate.name === needle);
|
|
1382
|
-
if (!entry) throw new ToolInputError(`Unknown tool id: ${needle}`);
|
|
1383
|
-
return entry;
|
|
1384
|
-
}
|
|
1385
|
-
function readId(args) {
|
|
1386
|
-
const params = asToolParamsRecord(args);
|
|
1387
|
-
const value = params.id ?? params.toolId ?? params.name;
|
|
1388
|
-
if (typeof value !== "string" || !value.trim()) throw new ToolInputError("id must be a non-empty string.");
|
|
1389
|
-
return value.trim();
|
|
1390
|
-
}
|
|
1391
|
-
function readLimit(value, config) {
|
|
1392
|
-
if (value === void 0) return config.searchDefaultLimit;
|
|
1393
|
-
if (typeof value !== "number" || !Number.isInteger(value) || value < 1) throw new ToolInputError("limit must be a positive integer.");
|
|
1394
|
-
return Math.min(value, config.maxSearchLimit);
|
|
1395
|
-
}
|
|
1396
|
-
function readSearchArgs(args, config) {
|
|
1397
|
-
const params = asToolParamsRecord(args);
|
|
1398
|
-
const query = params.query;
|
|
1399
|
-
if (typeof query !== "string") throw new ToolInputError("query must be a string.");
|
|
1400
|
-
const options = isRecord(params.options) ? params.options : void 0;
|
|
1401
|
-
return {
|
|
1402
|
-
query,
|
|
1403
|
-
limit: readLimit(params.limit ?? options?.limit, config)
|
|
1404
|
-
};
|
|
1405
|
-
}
|
|
1406
|
-
function readCallArgs(args) {
|
|
1407
|
-
const params = asToolParamsRecord(args);
|
|
1408
|
-
return {
|
|
1409
|
-
id: readId(params),
|
|
1410
|
-
input: params.args ?? params.input ?? {}
|
|
1411
|
-
};
|
|
1412
|
-
}
|
|
1413
|
-
function getTelemetry(catalog) {
|
|
1414
|
-
const sources = {
|
|
1415
|
-
fengming: 0,
|
|
1416
|
-
mcp: 0,
|
|
1417
|
-
client: 0
|
|
1418
|
-
};
|
|
1419
|
-
for (const entry of catalog.entries) sources[entry.source] += 1;
|
|
1420
|
-
return {
|
|
1421
|
-
catalogSize: catalog.entries.length,
|
|
1422
|
-
sources,
|
|
1423
|
-
searchCount: catalog.searchCount,
|
|
1424
|
-
describeCount: catalog.describeCount,
|
|
1425
|
-
callCount: catalog.callCount
|
|
1426
|
-
};
|
|
1427
|
-
}
|
|
1428
|
-
function sanitizeToolCallIdPart(value) {
|
|
1429
|
-
return value.trim().replace(/[^A-Za-z0-9_.:-]+/g, "_").slice(0, 120) || "call";
|
|
1430
|
-
}
|
|
1431
|
-
var ToolSearchRuntime = class {
|
|
1432
|
-
constructor(ctx, config) {
|
|
1433
|
-
this.ctx = ctx;
|
|
1434
|
-
this.config = config;
|
|
1435
|
-
this.callSequence = 0;
|
|
1436
|
-
this.search = async (query, options) => {
|
|
1437
|
-
const catalog = resolveCatalog(this.ctx);
|
|
1438
|
-
catalog.searchCount += 1;
|
|
1439
|
-
const limit = readLimit(options?.limit, this.config);
|
|
1440
|
-
const terms = tokenize(query);
|
|
1441
|
-
return catalog.entries.map((entry) => ({
|
|
1442
|
-
entry,
|
|
1443
|
-
score: scoreEntry(entry, terms)
|
|
1444
|
-
})).filter((hit) => hit.score > 0).toSorted((a, b) => b.score - a.score || a.entry.id.localeCompare(b.entry.id)).slice(0, limit).map((hit) => compactEntry(hit.entry));
|
|
1445
|
-
};
|
|
1446
|
-
this.all = () => {
|
|
1447
|
-
return resolveCatalog(this.ctx).entries.map((entry) => compactEntry(entry));
|
|
1448
|
-
};
|
|
1449
|
-
this.describe = async (id) => {
|
|
1450
|
-
const catalog = resolveCatalog(this.ctx);
|
|
1451
|
-
catalog.describeCount += 1;
|
|
1452
|
-
return describeEntry(findEntry(catalog, id));
|
|
1453
|
-
};
|
|
1454
|
-
this.call = async (id, input, options) => {
|
|
1455
|
-
const catalog = resolveCatalog(this.ctx);
|
|
1456
|
-
const entry = findEntry(catalog, id);
|
|
1457
|
-
catalog.callCount += 1;
|
|
1458
|
-
const toolCallId = `tool_search_code:${sanitizeToolCallIdPart(options?.parentToolCallId ?? "direct")}:${entry.name}:${++this.callSequence}`;
|
|
1459
|
-
const result = await (this.ctx.executeTool ?? (async (params) => await params.tool.execute(params.toolCallId, params.input, params.signal, params.onUpdate, void 0)))({
|
|
1460
|
-
tool: entry.tool,
|
|
1461
|
-
toolName: entry.name,
|
|
1462
|
-
toolCallId,
|
|
1463
|
-
parentToolCallId: options?.parentToolCallId,
|
|
1464
|
-
input: input ?? {},
|
|
1465
|
-
signal: options?.signal ?? this.ctx.abortSignal,
|
|
1466
|
-
onUpdate: options?.onUpdate
|
|
1467
|
-
});
|
|
1468
|
-
return {
|
|
1469
|
-
tool: compactEntry(entry),
|
|
1470
|
-
result
|
|
1471
|
-
};
|
|
1472
|
-
};
|
|
1473
|
-
}
|
|
1474
|
-
telemetry() {
|
|
1475
|
-
return getTelemetry(resolveCatalog(this.ctx));
|
|
1476
|
-
}
|
|
1477
|
-
};
|
|
1478
|
-
function applyToolCatalogCompaction(params) {
|
|
1479
|
-
if (!params.enabled) return {
|
|
1480
|
-
tools: params.tools,
|
|
1481
|
-
compacted: false,
|
|
1482
|
-
catalogToolCount: 0,
|
|
1483
|
-
catalogRegistered: false,
|
|
1484
|
-
catalogReused: false
|
|
1485
|
-
};
|
|
1486
|
-
const hasControlTool = params.tools.some((tool) => params.isVisibleControlTool(tool));
|
|
1487
|
-
const key = sessionCatalogKey(params);
|
|
1488
|
-
if (!hasControlTool || !key && !params.catalogRef) return {
|
|
1489
|
-
tools: params.tools.filter((tool) => !TOOL_SEARCH_CONTROL_TOOL_NAMES.has(tool.name)),
|
|
1490
|
-
compacted: false,
|
|
1491
|
-
catalogToolCount: 0,
|
|
1492
|
-
catalogRegistered: false,
|
|
1493
|
-
catalogReused: false
|
|
1494
|
-
};
|
|
1495
|
-
const visible = [];
|
|
1496
|
-
const catalog = [];
|
|
1497
|
-
const shouldCatalog = params.shouldCatalogTool ?? shouldCatalogTool;
|
|
1498
|
-
for (const tool of params.tools) {
|
|
1499
|
-
if (params.isVisibleControlTool(tool)) {
|
|
1500
|
-
visible.push(tool);
|
|
1501
|
-
continue;
|
|
1502
|
-
}
|
|
1503
|
-
if (TOOL_SEARCH_CONTROL_TOOL_NAMES.has(tool.name)) continue;
|
|
1504
|
-
if (shouldCatalog(tool)) {
|
|
1505
|
-
catalog.push(toCatalogEntry(tool, void 0, params.toolHookContext));
|
|
1506
|
-
continue;
|
|
1507
|
-
}
|
|
1508
|
-
visible.push(tool);
|
|
1509
|
-
}
|
|
1510
|
-
const incomingFingerprint = catalogEntriesFingerprint(catalog);
|
|
1511
|
-
const existingCatalog = params.catalogRef?.current ?? (key ? sessionCatalogs.get(key) : void 0);
|
|
1512
|
-
if (existingCatalog && catalogFingerprints.get(existingCatalog) === incomingFingerprint) {
|
|
1513
|
-
bindToolSearchCatalog({
|
|
1514
|
-
sessionId: params.sessionId,
|
|
1515
|
-
sessionKey: params.sessionKey,
|
|
1516
|
-
agentId: params.agentId,
|
|
1517
|
-
runId: params.runId,
|
|
1518
|
-
catalogRef: params.catalogRef,
|
|
1519
|
-
catalog: existingCatalog
|
|
1520
|
-
});
|
|
1521
|
-
return {
|
|
1522
|
-
tools: visible,
|
|
1523
|
-
compacted: catalog.length > 0,
|
|
1524
|
-
catalogToolCount: catalog.length,
|
|
1525
|
-
catalogRegistered: true,
|
|
1526
|
-
catalogReused: true
|
|
1527
|
-
};
|
|
1528
|
-
}
|
|
1529
|
-
const reusableKey = reusableCatalogKey(params);
|
|
1530
|
-
const reusableSnapshot = reusableKey ? reusableCatalogSnapshots.get(reusableKey) : void 0;
|
|
1531
|
-
if (reusableSnapshot?.fingerprint === incomingFingerprint) {
|
|
1532
|
-
restoreToolSearchCatalog({
|
|
1533
|
-
sessionId: params.sessionId,
|
|
1534
|
-
sessionKey: params.sessionKey,
|
|
1535
|
-
agentId: params.agentId,
|
|
1536
|
-
runId: params.runId,
|
|
1537
|
-
catalogRef: params.catalogRef,
|
|
1538
|
-
entries: reusableSnapshot.entries,
|
|
1539
|
-
fingerprint: reusableSnapshot.fingerprint
|
|
1540
|
-
});
|
|
1541
|
-
if (reusableKey) {
|
|
1542
|
-
reusableCatalogSnapshots.delete(reusableKey);
|
|
1543
|
-
reusableCatalogSnapshots.set(reusableKey, reusableSnapshot);
|
|
1544
|
-
}
|
|
1545
|
-
return {
|
|
1546
|
-
tools: visible,
|
|
1547
|
-
compacted: catalog.length > 0,
|
|
1548
|
-
catalogToolCount: catalog.length,
|
|
1549
|
-
catalogRegistered: true,
|
|
1550
|
-
catalogReused: true
|
|
1551
|
-
};
|
|
1552
|
-
}
|
|
1553
|
-
const registered = registerToolSearchCatalog({
|
|
1554
|
-
sessionId: params.sessionId,
|
|
1555
|
-
sessionKey: params.sessionKey,
|
|
1556
|
-
agentId: params.agentId,
|
|
1557
|
-
runId: params.runId,
|
|
1558
|
-
catalogRef: params.catalogRef,
|
|
1559
|
-
entries: catalog,
|
|
1560
|
-
append: false
|
|
1561
|
-
});
|
|
1562
|
-
if (registered) rememberReusableCatalog(reusableKey, registered);
|
|
1563
|
-
return {
|
|
1564
|
-
tools: visible,
|
|
1565
|
-
compacted: catalog.length > 0,
|
|
1566
|
-
catalogToolCount: catalog.length,
|
|
1567
|
-
catalogRegistered: true,
|
|
1568
|
-
catalogReused: false
|
|
1569
|
-
};
|
|
1570
|
-
}
|
|
1571
|
-
function addClientToolsToToolCatalog(params) {
|
|
1572
|
-
const key = sessionCatalogKey(params);
|
|
1573
|
-
if (!params.enabled || !key && !params.catalogRef) return {
|
|
1574
|
-
tools: params.tools,
|
|
1575
|
-
compacted: false,
|
|
1576
|
-
catalogToolCount: 0
|
|
1577
|
-
};
|
|
1578
|
-
if (!(params.catalogRef?.current ?? (key ? sessionCatalogs.get(key) : void 0))) return {
|
|
1579
|
-
tools: params.tools,
|
|
1580
|
-
compacted: false,
|
|
1581
|
-
catalogToolCount: 0
|
|
1582
|
-
};
|
|
1583
|
-
registerToolSearchCatalog({
|
|
1584
|
-
sessionId: params.sessionId,
|
|
1585
|
-
sessionKey: params.sessionKey,
|
|
1586
|
-
agentId: params.agentId,
|
|
1587
|
-
runId: params.runId,
|
|
1588
|
-
catalogRef: params.catalogRef,
|
|
1589
|
-
entries: params.tools.map((tool) => toCatalogEntry(tool, "client")),
|
|
1590
|
-
append: true
|
|
1591
|
-
});
|
|
1592
|
-
return {
|
|
1593
|
-
tools: [],
|
|
1594
|
-
compacted: params.tools.length > 0,
|
|
1595
|
-
catalogToolCount: params.tools.length
|
|
1596
|
-
};
|
|
1597
|
-
}
|
|
1598
|
-
function toJsonSafe(value) {
|
|
1599
|
-
if (value === void 0) return null;
|
|
1600
|
-
try {
|
|
1601
|
-
return JSON.parse(JSON.stringify(value));
|
|
1602
|
-
} catch {
|
|
1603
|
-
if (value instanceof Error) return value.message;
|
|
1604
|
-
if (value === null) return null;
|
|
1605
|
-
switch (typeof value) {
|
|
1606
|
-
case "string": return value;
|
|
1607
|
-
case "number":
|
|
1608
|
-
case "boolean":
|
|
1609
|
-
case "bigint":
|
|
1610
|
-
case "symbol":
|
|
1611
|
-
case "function": return String(value);
|
|
1612
|
-
default: return Object.prototype.toString.call(value);
|
|
1613
|
-
}
|
|
1614
|
-
}
|
|
1615
|
-
}
|
|
1616
|
-
async function runCodeMode(params) {
|
|
1617
|
-
const runtime = new ToolSearchRuntime(params.ctx, params.config);
|
|
1618
|
-
const logs = [];
|
|
1619
|
-
return {
|
|
1620
|
-
ok: true,
|
|
1621
|
-
value: toJsonSafe(await runCodeModeChild({
|
|
1622
|
-
code: params.code,
|
|
1623
|
-
config: params.config,
|
|
1624
|
-
logs,
|
|
1625
|
-
parentToolCallId: params.toolCallId,
|
|
1626
|
-
runtime,
|
|
1627
|
-
signal: params.signal,
|
|
1628
|
-
onUpdate: params.onUpdate
|
|
1629
|
-
})),
|
|
1630
|
-
logs,
|
|
1631
|
-
telemetry: runtime.telemetry()
|
|
1632
|
-
};
|
|
1633
|
-
}
|
|
1634
|
-
function buildCodeModeChildArgs() {
|
|
1635
|
-
if (!process.allowedNodeEnvironmentFlags.has("--permission")) throw new ToolInputError("tool_search_code requires a Node runtime with --permission support.");
|
|
1636
|
-
return [
|
|
1637
|
-
"--permission",
|
|
1638
|
-
"--input-type=module",
|
|
1639
|
-
"--eval",
|
|
1640
|
-
TOOL_SEARCH_CODE_MODE_CHILD_SOURCE
|
|
1641
|
-
];
|
|
1642
|
-
}
|
|
1643
|
-
function isCodeModeBridgeMethod(value) {
|
|
1644
|
-
return value === "search" || value === "describe" || value === "call";
|
|
1645
|
-
}
|
|
1646
|
-
async function runCodeModeBridgeRequest(runtime, method, args, options) {
|
|
1647
|
-
const values = Array.isArray(args) ? args : [];
|
|
1648
|
-
switch (method) {
|
|
1649
|
-
case "search": {
|
|
1650
|
-
const query = values[0];
|
|
1651
|
-
if (typeof query !== "string") throw new ToolInputError("search query must be a string.");
|
|
1652
|
-
const options = isRecord(values[1]) ? values[1] : void 0;
|
|
1653
|
-
return await runtime.search(query, { limit: typeof options?.limit === "number" ? options.limit : void 0 });
|
|
1654
|
-
}
|
|
1655
|
-
case "describe": {
|
|
1656
|
-
const id = values[0];
|
|
1657
|
-
if (typeof id !== "string") throw new ToolInputError("describe id must be a string.");
|
|
1658
|
-
return await runtime.describe(id);
|
|
1659
|
-
}
|
|
1660
|
-
case "call": {
|
|
1661
|
-
const id = values[0];
|
|
1662
|
-
if (typeof id !== "string") throw new ToolInputError("call id must be a string.");
|
|
1663
|
-
return await runtime.call(id, values[1] ?? {}, options);
|
|
1664
|
-
}
|
|
1665
|
-
}
|
|
1666
|
-
throw new ToolInputError("Unsupported tool_search_code bridge method.");
|
|
1667
|
-
}
|
|
1668
|
-
function runCodeModeChild(params) {
|
|
1669
|
-
return new Promise((resolve, reject) => {
|
|
1670
|
-
const child = spawn(process.execPath, buildCodeModeChildArgs(), {
|
|
1671
|
-
cwd: os.tmpdir(),
|
|
1672
|
-
env: {},
|
|
1673
|
-
stdio: [
|
|
1674
|
-
"ignore",
|
|
1675
|
-
"pipe",
|
|
1676
|
-
"pipe",
|
|
1677
|
-
"ipc"
|
|
1678
|
-
]
|
|
1679
|
-
});
|
|
1680
|
-
const stderr = [];
|
|
1681
|
-
let settled = false;
|
|
1682
|
-
let timedOut = false;
|
|
1683
|
-
let timer;
|
|
1684
|
-
let exitRejectionTimer;
|
|
1685
|
-
const bridgeAbortController = new AbortController();
|
|
1686
|
-
let abortFromParent;
|
|
1687
|
-
const settle = (callback) => {
|
|
1688
|
-
if (settled) return;
|
|
1689
|
-
settled = true;
|
|
1690
|
-
if (timer) clearTimeout(timer);
|
|
1691
|
-
if (exitRejectionTimer) clearTimeout(exitRejectionTimer);
|
|
1692
|
-
params.signal?.removeEventListener("abort", abortFromParent);
|
|
1693
|
-
child.kill();
|
|
1694
|
-
callback();
|
|
1695
|
-
};
|
|
1696
|
-
abortFromParent = () => {
|
|
1697
|
-
bridgeAbortController.abort(params.signal?.reason);
|
|
1698
|
-
child.kill("SIGKILL");
|
|
1699
|
-
settle(() => reject(/* @__PURE__ */ new Error("代码搜索工具已中止")));
|
|
1700
|
-
};
|
|
1701
|
-
if (params.signal?.aborted) {
|
|
1702
|
-
abortFromParent();
|
|
1703
|
-
return;
|
|
1704
|
-
}
|
|
1705
|
-
params.signal?.addEventListener("abort", abortFromParent, { once: true });
|
|
1706
|
-
timer = setTimeout(() => {
|
|
1707
|
-
timedOut = true;
|
|
1708
|
-
bridgeAbortController.abort(/* @__PURE__ */ new Error("代码搜索工具已超时"));
|
|
1709
|
-
child.kill("SIGKILL");
|
|
1710
|
-
settle(() => reject(/* @__PURE__ */ new Error("代码搜索工具已超时")));
|
|
1711
|
-
}, params.config.codeTimeoutMs);
|
|
1712
|
-
child.stderr?.setEncoding("utf8");
|
|
1713
|
-
child.stderr?.on("data", (chunk) => {
|
|
1714
|
-
stderr.push(chunk);
|
|
1715
|
-
});
|
|
1716
|
-
child.on("error", (error) => {
|
|
1717
|
-
settle(() => reject(error));
|
|
1718
|
-
});
|
|
1719
|
-
child.on("exit", (code, signal) => {
|
|
1720
|
-
if (settled) return;
|
|
1721
|
-
const rejectOnExit = () => {
|
|
1722
|
-
const suffix = stderr.join("").trim();
|
|
1723
|
-
const detail = suffix ? `: ${suffix.slice(0, 500)}` : "";
|
|
1724
|
-
settle(() => reject(/* @__PURE__ */ new Error(timedOut ? "tool_search_code timed out" : `tool_search_code child exited with ${signal ?? code}${detail}`)));
|
|
1725
|
-
};
|
|
1726
|
-
if (code === 0 && signal === null) {
|
|
1727
|
-
exitRejectionTimer = setTimeout(rejectOnExit, 250);
|
|
1728
|
-
return;
|
|
1729
|
-
}
|
|
1730
|
-
rejectOnExit();
|
|
1731
|
-
});
|
|
1732
|
-
child.on("message", (message) => {
|
|
1733
|
-
if (settled) return;
|
|
1734
|
-
if (!isRecord(message) || typeof message.type !== "string") return;
|
|
1735
|
-
if (message.type === "log") {
|
|
1736
|
-
const items = Array.isArray(message.items) ? message.items : [];
|
|
1737
|
-
params.logs.push(items.map((item) => String(item)).join(" "));
|
|
1738
|
-
return;
|
|
1739
|
-
}
|
|
1740
|
-
if (message.type === "result") {
|
|
1741
|
-
if (message.ok) settle(() => resolve(message.value));
|
|
1742
|
-
else settle(() => reject(new Error(typeof message.error === "string" ? message.error : "code failed")));
|
|
1743
|
-
return;
|
|
1744
|
-
}
|
|
1745
|
-
if (message.type !== "bridge") return;
|
|
1746
|
-
const id = typeof message.id === "string" ? message.id : "";
|
|
1747
|
-
const method = isCodeModeBridgeMethod(message.method) ? message.method : void 0;
|
|
1748
|
-
if (!id || !method) return;
|
|
1749
|
-
runCodeModeBridgeRequest(params.runtime, method, message.args, {
|
|
1750
|
-
parentToolCallId: params.parentToolCallId,
|
|
1751
|
-
signal: bridgeAbortController.signal,
|
|
1752
|
-
onUpdate: params.onUpdate
|
|
1753
|
-
}).then((value) => {
|
|
1754
|
-
if (settled || !child.connected) return;
|
|
1755
|
-
const response = {
|
|
1756
|
-
type: "bridge-result",
|
|
1757
|
-
id,
|
|
1758
|
-
ok: true,
|
|
1759
|
-
value: toJsonSafe(value)
|
|
1760
|
-
};
|
|
1761
|
-
child.send(response, () => void 0);
|
|
1762
|
-
}).catch((error) => {
|
|
1763
|
-
if (settled || !child.connected) return;
|
|
1764
|
-
const response = {
|
|
1765
|
-
type: "bridge-result",
|
|
1766
|
-
id,
|
|
1767
|
-
ok: false,
|
|
1768
|
-
error: error instanceof Error ? error.message : String(error)
|
|
1769
|
-
};
|
|
1770
|
-
child.send(response, () => void 0);
|
|
1771
|
-
});
|
|
1772
|
-
});
|
|
1773
|
-
child.send({
|
|
1774
|
-
type: "run",
|
|
1775
|
-
code: params.code,
|
|
1776
|
-
timeoutMs: params.config.codeTimeoutMs
|
|
1777
|
-
});
|
|
1778
|
-
});
|
|
1779
|
-
}
|
|
1780
|
-
function readCode(args) {
|
|
1781
|
-
const code = asToolParamsRecord(args).code;
|
|
1782
|
-
if (typeof code !== "string" || !code.trim()) throw new ToolInputError("code must be a non-empty string.");
|
|
1783
|
-
return code;
|
|
1784
|
-
}
|
|
1785
|
-
function createToolSearchTools(ctx) {
|
|
1786
|
-
const config = resolveToolSearchConfig(ctx.runtimeConfig ?? ctx.config);
|
|
1787
|
-
const runtime = new ToolSearchRuntime(ctx, config);
|
|
1788
|
-
return [
|
|
1789
|
-
{
|
|
1790
|
-
name: TOOL_SEARCH_CODE_MODE_TOOL_NAME,
|
|
1791
|
-
label: "Tool Search Code",
|
|
1792
|
-
description: "Run JavaScript in an isolated Node subprocess with fengming.tools.search, fengming.tools.describe, and fengming.tools.call for large tool catalogs.",
|
|
1793
|
-
parameters: Type.Object({ code: Type.String({ description: "JavaScript body for an async function. Use return to return the final value. The fengming.tools bridge is available." }) }),
|
|
1794
|
-
execute: async (toolCallId, args, signal, onUpdate) => jsonResult(await runCodeMode({
|
|
1795
|
-
toolCallId,
|
|
1796
|
-
ctx,
|
|
1797
|
-
code: readCode(args),
|
|
1798
|
-
config,
|
|
1799
|
-
signal,
|
|
1800
|
-
onUpdate
|
|
1801
|
-
}))
|
|
1802
|
-
},
|
|
1803
|
-
{
|
|
1804
|
-
name: TOOL_SEARCH_RAW_TOOL_NAME,
|
|
1805
|
-
label: "Tool Search",
|
|
1806
|
-
description: "Search the effective Tool Search catalog.",
|
|
1807
|
-
parameters: Type.Object({
|
|
1808
|
-
query: Type.String({ description: "Search query." }),
|
|
1809
|
-
limit: Type.Optional(Type.Number({ description: "Maximum number of results." }))
|
|
1810
|
-
}),
|
|
1811
|
-
execute: async (_toolCallId, args) => {
|
|
1812
|
-
const search = readSearchArgs(args, config);
|
|
1813
|
-
return jsonResult(await runtime.search(search.query, { limit: search.limit }));
|
|
1814
|
-
}
|
|
1815
|
-
},
|
|
1816
|
-
{
|
|
1817
|
-
name: TOOL_DESCRIBE_RAW_TOOL_NAME,
|
|
1818
|
-
label: "Tool Describe",
|
|
1819
|
-
description: "Load the full schema and metadata for one search result.",
|
|
1820
|
-
parameters: Type.Object({ id: Type.String({ description: "Tool search result id or tool name." }) }),
|
|
1821
|
-
execute: async (_toolCallId, args) => jsonResult(await runtime.describe(readId(args)))
|
|
1822
|
-
},
|
|
1823
|
-
{
|
|
1824
|
-
name: TOOL_CALL_RAW_TOOL_NAME,
|
|
1825
|
-
label: "Tool Call",
|
|
1826
|
-
description: "Call a selected Tool Search catalog entry through FengMing.",
|
|
1827
|
-
parameters: Type.Object({
|
|
1828
|
-
id: Type.String({ description: "Tool search result id or tool name." }),
|
|
1829
|
-
args: Type.Optional(Type.Record(Type.String(), Type.Unknown(), { description: "Tool input." }))
|
|
1830
|
-
}),
|
|
1831
|
-
execute: async (_toolCallId, args, signal, onUpdate) => {
|
|
1832
|
-
const call = readCallArgs(args);
|
|
1833
|
-
return jsonResult(await runtime.call(call.id, call.input, {
|
|
1834
|
-
parentToolCallId: _toolCallId,
|
|
1835
|
-
signal,
|
|
1836
|
-
onUpdate
|
|
1837
|
-
}));
|
|
1838
|
-
}
|
|
1839
|
-
}
|
|
1840
|
-
];
|
|
1841
|
-
}
|
|
1842
|
-
//#endregion
|
|
1843
|
-
//#region src/agents/agent-tools.ts
|
|
1844
|
-
function isOpenAIProvider(provider) {
|
|
1845
|
-
const normalized = normalizeOptionalLowercaseString(provider);
|
|
1846
|
-
return normalized === "openai" || normalized === "openai-codex";
|
|
1847
|
-
}
|
|
1848
|
-
const MEMORY_FLUSH_ALLOWED_TOOL_NAMES = new Set(["read", "write"]);
|
|
1849
|
-
function readOnlyAgentWorkspaceMount(sandbox) {
|
|
1850
|
-
if (!sandbox || sandbox.workspaceAccess !== "ro" || sandbox.agentWorkspaceDir === sandbox.workspaceDir) return;
|
|
1851
|
-
return [{
|
|
1852
|
-
containerRoot: SANDBOX_AGENT_WORKSPACE_MOUNT,
|
|
1853
|
-
hostRoot: sandbox.agentWorkspaceDir
|
|
1854
|
-
}];
|
|
1855
|
-
}
|
|
1856
|
-
function resolveSkillReadRoots(skillsSnapshot) {
|
|
1857
|
-
const roots = /* @__PURE__ */ new Set();
|
|
1858
|
-
for (const skill of skillsSnapshot?.resolvedSkills ?? []) {
|
|
1859
|
-
const baseDir = typeof skill.baseDir === "string" ? skill.baseDir.trim() : "";
|
|
1860
|
-
const filePath = typeof skill.filePath === "string" ? skill.filePath.trim() : "";
|
|
1861
|
-
const root = baseDir || (filePath ? path.dirname(filePath) : "");
|
|
1862
|
-
if (!root || !path.isAbsolute(root)) continue;
|
|
1863
|
-
roots.add(path.resolve(root));
|
|
1864
|
-
}
|
|
1865
|
-
if (roots.size === 0) return;
|
|
1866
|
-
return Array.from(roots);
|
|
1867
|
-
}
|
|
1868
|
-
const bashToolsModuleLoader = createLazyImportLoader(() => import("./bash-tools-BWvldguc.js"));
|
|
1869
|
-
function loadBashToolsModule() {
|
|
1870
|
-
return bashToolsModuleLoader.load();
|
|
1871
|
-
}
|
|
1872
|
-
function createLazyExecTool(defaults) {
|
|
1873
|
-
let loadedTool;
|
|
1874
|
-
const loadTool = async () => {
|
|
1875
|
-
if (!loadedTool) {
|
|
1876
|
-
const { createExecTool } = await loadBashToolsModule();
|
|
1877
|
-
loadedTool = createExecTool(defaults);
|
|
1878
|
-
}
|
|
1879
|
-
return loadedTool;
|
|
1880
|
-
};
|
|
1881
|
-
return {
|
|
1882
|
-
name: "exec",
|
|
1883
|
-
label: "exec",
|
|
1884
|
-
displaySummary: EXEC_TOOL_DISPLAY_SUMMARY,
|
|
1885
|
-
get description() {
|
|
1886
|
-
return describeExecTool({
|
|
1887
|
-
agentId: defaults?.agentId,
|
|
1888
|
-
hasCronTool: defaults?.hasCronTool === true
|
|
1889
|
-
});
|
|
1890
|
-
},
|
|
1891
|
-
parameters: execSchema,
|
|
1892
|
-
execute: async (...args) => (await loadTool()).execute(...args)
|
|
1893
|
-
};
|
|
1894
|
-
}
|
|
1895
|
-
function createLazyProcessTool(defaults) {
|
|
1896
|
-
let loadedTool;
|
|
1897
|
-
const loadTool = async () => {
|
|
1898
|
-
if (!loadedTool) {
|
|
1899
|
-
const { createProcessTool } = await loadBashToolsModule();
|
|
1900
|
-
loadedTool = createProcessTool(defaults);
|
|
1901
|
-
}
|
|
1902
|
-
return loadedTool;
|
|
1903
|
-
};
|
|
1904
|
-
return {
|
|
1905
|
-
name: "process",
|
|
1906
|
-
label: "process",
|
|
1907
|
-
displaySummary: PROCESS_TOOL_DISPLAY_SUMMARY,
|
|
1908
|
-
description: describeProcessTool({ hasCronTool: defaults?.hasCronTool === true }),
|
|
1909
|
-
parameters: processSchema,
|
|
1910
|
-
execute: async (...args) => (await loadTool()).execute(...args)
|
|
1911
|
-
};
|
|
1912
|
-
}
|
|
1913
|
-
function resolveProcessToolScopeKey(params) {
|
|
1914
|
-
const explicitScopeKey = params.scopeKey?.trim();
|
|
1915
|
-
if (explicitScopeKey) return explicitScopeKey;
|
|
1916
|
-
const sessionKey = params.sessionKey?.trim();
|
|
1917
|
-
if (sessionKey) return sessionKey;
|
|
1918
|
-
const sessionId = params.sessionId?.trim();
|
|
1919
|
-
if (sessionId) return sessionId;
|
|
1920
|
-
const agentId = params.agentId?.trim();
|
|
1921
|
-
return agentId ? `agent:${agentId}` : void 0;
|
|
1922
|
-
}
|
|
1923
|
-
function applyModelProviderToolPolicy(tools, params) {
|
|
1924
|
-
tools = filterLocalModelLeanTools({
|
|
1925
|
-
tools,
|
|
1926
|
-
config: params?.config,
|
|
1927
|
-
agentId: params?.agentId,
|
|
1928
|
-
sessionKey: params?.sessionKey
|
|
1929
|
-
});
|
|
1930
|
-
if (params?.suppressManagedWebSearch !== false && shouldSuppressManagedWebSearchTool({
|
|
1931
|
-
config: params?.config,
|
|
1932
|
-
modelProvider: params?.modelProvider,
|
|
1933
|
-
modelApi: params?.modelApi,
|
|
1934
|
-
agentDir: params?.agentDir
|
|
1935
|
-
})) return tools.filter((tool) => tool.name !== "web_search");
|
|
1936
|
-
return tools;
|
|
1937
|
-
}
|
|
1938
|
-
function isApplyPatchAllowedForModel(params) {
|
|
1939
|
-
const allowModels = Array.isArray(params.allowModels) ? params.allowModels : [];
|
|
1940
|
-
if (allowModels.length === 0) return true;
|
|
1941
|
-
const modelId = params.modelId?.trim();
|
|
1942
|
-
if (!modelId) return false;
|
|
1943
|
-
const normalizedModelId = normalizeLowercaseStringOrEmpty(modelId);
|
|
1944
|
-
const provider = normalizeOptionalLowercaseString(params.modelProvider);
|
|
1945
|
-
const normalizedFull = provider && !normalizedModelId.includes("/") ? `${provider}/${normalizedModelId}` : normalizedModelId;
|
|
1946
|
-
return allowModels.some((entry) => {
|
|
1947
|
-
const normalized = normalizeOptionalLowercaseString(entry);
|
|
1948
|
-
if (!normalized) return false;
|
|
1949
|
-
return normalized === normalizedModelId || normalized === normalizedFull;
|
|
1950
|
-
});
|
|
1951
|
-
}
|
|
1952
|
-
function hasLegacyExecPolicy(exec) {
|
|
1953
|
-
return exec?.security !== void 0 || exec?.ask !== void 0;
|
|
1954
|
-
}
|
|
1955
|
-
function applyExecPolicyLayer(base, layer) {
|
|
1956
|
-
if (!layer) return base;
|
|
1957
|
-
if (layer.mode) return {
|
|
1958
|
-
mode: layer.mode,
|
|
1959
|
-
...resolveExecPolicyForMode(layer.mode)
|
|
1960
|
-
};
|
|
1961
|
-
if (hasLegacyExecPolicy(layer)) return {
|
|
1962
|
-
security: layer.security ?? base.security,
|
|
1963
|
-
ask: layer.ask ?? base.ask
|
|
1964
|
-
};
|
|
1965
|
-
return base;
|
|
1966
|
-
}
|
|
1967
|
-
function resolveExecConfig(params) {
|
|
1968
|
-
const cfg = params.cfg;
|
|
1969
|
-
const globalExec = cfg?.tools?.exec;
|
|
1970
|
-
const agentExec = cfg && params.agentId ? resolveAgentConfig(cfg, params.agentId)?.tools?.exec : void 0;
|
|
1971
|
-
const layeredPolicy = applyExecPolicyLayer(applyExecPolicyLayer({}, globalExec), agentExec);
|
|
1972
|
-
return {
|
|
1973
|
-
host: agentExec?.host ?? globalExec?.host,
|
|
1974
|
-
mode: layeredPolicy.mode,
|
|
1975
|
-
security: layeredPolicy.security,
|
|
1976
|
-
ask: layeredPolicy.ask,
|
|
1977
|
-
node: agentExec?.node ?? globalExec?.node,
|
|
1978
|
-
pathPrepend: agentExec?.pathPrepend ?? globalExec?.pathPrepend,
|
|
1979
|
-
safeBins: agentExec?.safeBins ?? globalExec?.safeBins,
|
|
1980
|
-
strictInlineEval: agentExec?.strictInlineEval ?? globalExec?.strictInlineEval,
|
|
1981
|
-
commandHighlighting: resolveExecCommandHighlighting({
|
|
1982
|
-
config: cfg,
|
|
1983
|
-
agentId: params.agentId
|
|
1984
|
-
}),
|
|
1985
|
-
safeBinTrustedDirs: agentExec?.safeBinTrustedDirs ?? globalExec?.safeBinTrustedDirs,
|
|
1986
|
-
safeBinProfiles: resolveMergedSafeBinProfileFixtures({
|
|
1987
|
-
global: globalExec,
|
|
1988
|
-
local: agentExec
|
|
1989
|
-
}),
|
|
1990
|
-
reviewer: agentExec?.reviewer ?? globalExec?.reviewer,
|
|
1991
|
-
backgroundMs: agentExec?.backgroundMs ?? globalExec?.backgroundMs,
|
|
1992
|
-
timeoutSec: agentExec?.timeoutSec ?? globalExec?.timeoutSec,
|
|
1993
|
-
approvalRunningNoticeMs: agentExec?.approvalRunningNoticeMs ?? globalExec?.approvalRunningNoticeMs,
|
|
1994
|
-
cleanupMs: agentExec?.cleanupMs ?? globalExec?.cleanupMs,
|
|
1995
|
-
notifyOnExit: agentExec?.notifyOnExit ?? globalExec?.notifyOnExit,
|
|
1996
|
-
notifyOnExitEmptySuccess: agentExec?.notifyOnExitEmptySuccess ?? globalExec?.notifyOnExitEmptySuccess,
|
|
1997
|
-
applyPatch: agentExec?.applyPatch ?? globalExec?.applyPatch
|
|
1998
|
-
};
|
|
1999
|
-
}
|
|
2000
|
-
function createFengMingCodingTools(options) {
|
|
2001
|
-
const execToolName = "exec";
|
|
2002
|
-
const sandbox = options?.sandbox?.enabled ? options.sandbox : void 0;
|
|
2003
|
-
const isMemoryFlushRun = options?.trigger === "memory";
|
|
2004
|
-
if (isMemoryFlushRun && !options?.memoryFlushWritePath) throw new Error("memory-trigger 工具运行需要 memoryFlushWritePath");
|
|
2005
|
-
const memoryFlushWritePath = isMemoryFlushRun ? options.memoryFlushWritePath : void 0;
|
|
2006
|
-
const cronSelfRemoveOnlyJobId = options?.trigger === "cron" && options.jobId?.trim() ? options.jobId.trim() : void 0;
|
|
2007
|
-
const { agentId, globalPolicy, globalProviderPolicy, agentPolicy, agentProviderPolicy, profile, providerProfile, profileAlsoAllow, providerProfileAlsoAllow } = resolveEffectiveToolPolicy({
|
|
2008
|
-
config: options?.config,
|
|
2009
|
-
sessionKey: options?.sessionKey,
|
|
2010
|
-
agentId: options?.agentId,
|
|
2011
|
-
modelProvider: options?.modelProvider,
|
|
2012
|
-
modelId: options?.modelId
|
|
2013
|
-
});
|
|
2014
|
-
const sandboxToolPolicy = sandbox?.tools;
|
|
2015
|
-
const groupPolicy = resolveGroupToolPolicy({
|
|
2016
|
-
config: options?.config,
|
|
2017
|
-
sessionKey: options?.sessionKey,
|
|
2018
|
-
spawnedBy: options?.spawnedBy,
|
|
2019
|
-
messageProvider: options?.messageProvider,
|
|
2020
|
-
groupId: options?.groupId,
|
|
2021
|
-
groupChannel: options?.groupChannel,
|
|
2022
|
-
groupSpace: options?.groupSpace,
|
|
2023
|
-
accountId: options?.agentAccountId,
|
|
2024
|
-
senderId: options?.senderId,
|
|
2025
|
-
senderName: options?.senderName,
|
|
2026
|
-
senderUsername: options?.senderUsername,
|
|
2027
|
-
senderE164: options?.senderE164
|
|
2028
|
-
});
|
|
2029
|
-
const senderPolicy = resolveSenderToolPolicy({
|
|
2030
|
-
config: options?.config,
|
|
2031
|
-
agentId,
|
|
2032
|
-
messageProvider: options?.messageProvider,
|
|
2033
|
-
senderId: options?.senderId,
|
|
2034
|
-
senderName: options?.senderName,
|
|
2035
|
-
senderUsername: options?.senderUsername,
|
|
2036
|
-
senderE164: options?.senderE164
|
|
2037
|
-
});
|
|
2038
|
-
const profilePolicy = resolveToolProfilePolicy(profile);
|
|
2039
|
-
const providerProfilePolicy = resolveToolProfilePolicy(providerProfile);
|
|
2040
|
-
const enableHeartbeatTool = options?.enableHeartbeatTool === true || options?.trigger === "heartbeat" && options?.config?.messages?.visibleReplies === "message_tool";
|
|
2041
|
-
const forceHeartbeatTool = options?.forceHeartbeatTool === true || enableHeartbeatTool;
|
|
2042
|
-
const toolSearchConfig = resolveToolSearchConfig(options?.config);
|
|
2043
|
-
const toolSearchControlsEnabled = options?.includeToolSearchControls === true && toolSearchConfig.enabled;
|
|
2044
|
-
const toolSearchControlAllowlist = toolSearchControlsEnabled ? [
|
|
2045
|
-
TOOL_SEARCH_CODE_MODE_TOOL_NAME,
|
|
2046
|
-
TOOL_SEARCH_RAW_TOOL_NAME,
|
|
2047
|
-
TOOL_DESCRIBE_RAW_TOOL_NAME,
|
|
2048
|
-
TOOL_CALL_RAW_TOOL_NAME
|
|
2049
|
-
] : [];
|
|
2050
|
-
const mergeToolSearchControlAllowlist = (policy) => mergeAlsoAllowPolicy(policy, toolSearchControlAllowlist);
|
|
2051
|
-
const runtimeToolAllowlistIncludesMessage = expandToolGroups(options?.runtimeToolAllowlist ?? []).some((toolName) => {
|
|
2052
|
-
const normalized = normalizeToolName(toolName);
|
|
2053
|
-
return normalized === "*" || normalized === "message";
|
|
2054
|
-
});
|
|
2055
|
-
const runtimeProfileAlsoAllow = [
|
|
2056
|
-
...options?.forceMessageTool || options?.sourceReplyDeliveryMode === "message_tool_only" ? ["message"] : [],
|
|
2057
|
-
...runtimeToolAllowlistIncludesMessage ? ["message"] : [],
|
|
2058
|
-
...forceHeartbeatTool ? [HEARTBEAT_RESPONSE_TOOL_NAME] : [],
|
|
2059
|
-
...toolSearchControlAllowlist
|
|
2060
|
-
];
|
|
2061
|
-
const profilePolicyWithAlsoAllow = mergeAlsoAllowPolicy(profilePolicy, [...profileAlsoAllow ?? [], ...runtimeProfileAlsoAllow]);
|
|
2062
|
-
const providerProfilePolicyWithAlsoAllow = mergeAlsoAllowPolicy(providerProfilePolicy, [...providerProfileAlsoAllow ?? [], ...runtimeProfileAlsoAllow]);
|
|
2063
|
-
const scopeKey = resolveProcessToolScopeKey({
|
|
2064
|
-
scopeKey: options?.exec?.scopeKey,
|
|
2065
|
-
sessionKey: options?.sessionKey,
|
|
2066
|
-
sessionId: options?.sessionId,
|
|
2067
|
-
agentId
|
|
2068
|
-
});
|
|
2069
|
-
const subagentStore = resolveSubagentCapabilityStore(options?.sessionKey, { cfg: options?.config });
|
|
2070
|
-
const subagentPolicy = options?.sessionKey && isSubagentEnvelopeSession(options.sessionKey, {
|
|
2071
|
-
cfg: options.config,
|
|
2072
|
-
store: subagentStore
|
|
2073
|
-
}) ? resolveSubagentToolPolicyForSession(options.config, options.sessionKey, { store: subagentStore }) : void 0;
|
|
2074
|
-
const inheritedToolPolicy = resolveInheritedToolPolicyForSession(options?.config, options?.sessionKey, { store: subagentStore });
|
|
2075
|
-
const globalPolicyWithToolSearchControls = mergeToolSearchControlAllowlist(globalPolicy);
|
|
2076
|
-
const globalProviderPolicyWithToolSearchControls = mergeToolSearchControlAllowlist(globalProviderPolicy);
|
|
2077
|
-
const agentPolicyWithToolSearchControls = mergeToolSearchControlAllowlist(agentPolicy);
|
|
2078
|
-
const agentProviderPolicyWithToolSearchControls = mergeToolSearchControlAllowlist(agentProviderPolicy);
|
|
2079
|
-
const groupPolicyWithToolSearchControls = mergeToolSearchControlAllowlist(groupPolicy);
|
|
2080
|
-
const senderPolicyWithToolSearchControls = mergeToolSearchControlAllowlist(senderPolicy);
|
|
2081
|
-
const sandboxToolPolicyWithToolSearchControls = mergeToolSearchControlAllowlist(sandboxToolPolicy);
|
|
2082
|
-
const subagentPolicyWithToolSearchControls = mergeToolSearchControlAllowlist(subagentPolicy);
|
|
2083
|
-
const allowBackground = isToolAllowedByPolicies("process", [
|
|
2084
|
-
profilePolicyWithAlsoAllow,
|
|
2085
|
-
providerProfilePolicyWithAlsoAllow,
|
|
2086
|
-
globalPolicyWithToolSearchControls,
|
|
2087
|
-
globalProviderPolicyWithToolSearchControls,
|
|
2088
|
-
agentPolicyWithToolSearchControls,
|
|
2089
|
-
agentProviderPolicyWithToolSearchControls,
|
|
2090
|
-
groupPolicyWithToolSearchControls,
|
|
2091
|
-
senderPolicyWithToolSearchControls,
|
|
2092
|
-
sandboxToolPolicyWithToolSearchControls,
|
|
2093
|
-
subagentPolicyWithToolSearchControls,
|
|
2094
|
-
inheritedToolPolicy
|
|
2095
|
-
]);
|
|
2096
|
-
options?.recordToolPrepStage?.("tool-policy");
|
|
2097
|
-
const execConfig = resolveExecConfig({
|
|
2098
|
-
cfg: options?.config,
|
|
2099
|
-
agentId
|
|
2100
|
-
});
|
|
2101
|
-
const fsConfig = resolveToolFsConfig({
|
|
2102
|
-
cfg: options?.config,
|
|
2103
|
-
agentId
|
|
2104
|
-
});
|
|
2105
|
-
const fsPolicy = createToolFsPolicy({ workspaceOnly: isMemoryFlushRun || fsConfig.workspaceOnly });
|
|
2106
|
-
const sandboxRoot = sandbox?.workspaceDir;
|
|
2107
|
-
const sandboxFsBridge = sandbox?.fsBridge;
|
|
2108
|
-
const allowWorkspaceWrites = sandbox?.workspaceAccess !== "ro";
|
|
2109
|
-
const workspaceRoot = resolveWorkspaceRoot(options?.workspaceDir);
|
|
2110
|
-
const runtimeRoot = resolveWorkspaceRoot(options?.cwd ?? options?.workspaceDir);
|
|
2111
|
-
const codingRoot = sandboxRoot ?? runtimeRoot;
|
|
2112
|
-
const memoryFlushWriteRoot = sandboxRoot ?? workspaceRoot;
|
|
2113
|
-
const includeCoreTools = options?.includeCoreTools !== false;
|
|
2114
|
-
const toolConstructionPlan = options?.toolConstructionPlan ?? {
|
|
2115
|
-
includeBaseCodingTools: includeCoreTools,
|
|
2116
|
-
includeShellTools: includeCoreTools,
|
|
2117
|
-
includeChannelTools: includeCoreTools,
|
|
2118
|
-
includeFengMingTools: includeCoreTools,
|
|
2119
|
-
includePluginTools: true
|
|
2120
|
-
};
|
|
2121
|
-
const includeBaseCodingTools = includeCoreTools && toolConstructionPlan.includeBaseCodingTools;
|
|
2122
|
-
const includeShellTools = includeCoreTools && toolConstructionPlan.includeShellTools;
|
|
2123
|
-
const includeFengMingTools = includeCoreTools && toolConstructionPlan.includeFengMingTools;
|
|
2124
|
-
const includeChannelTools = toolConstructionPlan.includeChannelTools;
|
|
2125
|
-
const includePluginTools = toolConstructionPlan.includePluginTools;
|
|
2126
|
-
const workspaceOnly = fsPolicy.workspaceOnly;
|
|
2127
|
-
const skillReadRoots = sandboxRoot ? void 0 : resolveSkillReadRoots(options?.skillsSnapshot);
|
|
2128
|
-
const applyPatchConfig = execConfig.applyPatch;
|
|
2129
|
-
const applyPatchWorkspaceOnly = workspaceOnly || applyPatchConfig?.workspaceOnly !== false;
|
|
2130
|
-
const applyPatchEnabled = applyPatchConfig?.enabled !== false && isOpenAIProvider(options?.modelProvider) && isApplyPatchAllowedForModel({
|
|
2131
|
-
modelProvider: options?.modelProvider,
|
|
2132
|
-
modelId: options?.modelId,
|
|
2133
|
-
allowModels: applyPatchConfig?.allowModels
|
|
2134
|
-
});
|
|
2135
|
-
if (sandboxRoot && !sandboxFsBridge) throw new Error("沙箱文件系统桥接不可用。");
|
|
2136
|
-
const imageSanitization = resolveImageSanitizationLimits(options?.config);
|
|
2137
|
-
options?.recordToolPrepStage?.("workspace-policy");
|
|
2138
|
-
const base = [];
|
|
2139
|
-
if (includeBaseCodingTools) for (const tool of createCodingTools(codingRoot)) {
|
|
2140
|
-
if (tool.name === "read") {
|
|
2141
|
-
if (sandboxRoot) {
|
|
2142
|
-
const sandboxed = createSandboxedReadTool({
|
|
2143
|
-
root: sandboxRoot,
|
|
2144
|
-
bridge: sandboxFsBridge,
|
|
2145
|
-
modelContextWindowTokens: options?.modelContextWindowTokens,
|
|
2146
|
-
imageSanitization
|
|
2147
|
-
});
|
|
2148
|
-
base.push(workspaceOnly ? wrapToolWorkspaceRootGuardWithOptions(sandboxed, sandboxRoot, {
|
|
2149
|
-
additionalContainerMounts: readOnlyAgentWorkspaceMount(sandbox),
|
|
2150
|
-
containerWorkdir: sandbox.containerWorkdir
|
|
2151
|
-
}) : sandboxed);
|
|
2152
|
-
continue;
|
|
2153
|
-
}
|
|
2154
|
-
const wrapped = createFengMingReadTool(createReadTool(codingRoot), {
|
|
2155
|
-
modelContextWindowTokens: options?.modelContextWindowTokens,
|
|
2156
|
-
imageSanitization
|
|
2157
|
-
});
|
|
2158
|
-
base.push(workspaceOnly ? wrapToolWorkspaceRootGuardWithOptions(wrapped, codingRoot, { additionalRoots: skillReadRoots }) : wrapped);
|
|
2159
|
-
continue;
|
|
2160
|
-
}
|
|
2161
|
-
if (tool.name === "bash" || tool.name === execToolName) continue;
|
|
2162
|
-
if (tool.name === "write") {
|
|
2163
|
-
if (sandboxRoot) continue;
|
|
2164
|
-
const wrapped = createHostWorkspaceWriteTool(codingRoot, { workspaceOnly });
|
|
2165
|
-
base.push(workspaceOnly ? wrapToolWorkspaceRootGuard(wrapped, codingRoot) : wrapped);
|
|
2166
|
-
continue;
|
|
2167
|
-
}
|
|
2168
|
-
if (tool.name === "edit") {
|
|
2169
|
-
if (sandboxRoot) continue;
|
|
2170
|
-
const wrapped = createHostWorkspaceEditTool(codingRoot, { workspaceOnly });
|
|
2171
|
-
base.push(workspaceOnly ? wrapToolWorkspaceRootGuard(wrapped, codingRoot) : wrapped);
|
|
2172
|
-
continue;
|
|
2173
|
-
}
|
|
2174
|
-
base.push(tool);
|
|
2175
|
-
}
|
|
2176
|
-
options?.recordToolPrepStage?.("base-coding-tools");
|
|
2177
|
-
const { cleanupMs: cleanupMsOverride, ...execDefaults } = options?.exec ?? {};
|
|
2178
|
-
const effectiveExecPolicy = applyExecPolicyLayer(execConfig, options?.exec);
|
|
2179
|
-
const execTool = includeShellTools ? createLazyExecTool({
|
|
2180
|
-
...execDefaults,
|
|
2181
|
-
host: options?.exec?.host ?? execConfig.host,
|
|
2182
|
-
mode: effectiveExecPolicy.mode,
|
|
2183
|
-
security: effectiveExecPolicy.security,
|
|
2184
|
-
ask: effectiveExecPolicy.ask,
|
|
2185
|
-
config: options?.exec?.config ?? options?.config,
|
|
2186
|
-
reviewer: options?.exec?.reviewer ?? execConfig.reviewer,
|
|
2187
|
-
trigger: options?.trigger,
|
|
2188
|
-
node: options?.exec?.node ?? execConfig.node,
|
|
2189
|
-
pathPrepend: options?.exec?.pathPrepend ?? execConfig.pathPrepend,
|
|
2190
|
-
safeBins: options?.exec?.safeBins ?? execConfig.safeBins,
|
|
2191
|
-
strictInlineEval: options?.exec?.strictInlineEval ?? execConfig.strictInlineEval,
|
|
2192
|
-
commandHighlighting: options?.exec?.commandHighlighting ?? execConfig.commandHighlighting,
|
|
2193
|
-
safeBinTrustedDirs: options?.exec?.safeBinTrustedDirs ?? execConfig.safeBinTrustedDirs,
|
|
2194
|
-
safeBinProfiles: options?.exec?.safeBinProfiles ?? execConfig.safeBinProfiles,
|
|
2195
|
-
agentId,
|
|
2196
|
-
cwd: codingRoot,
|
|
2197
|
-
allowBackground,
|
|
2198
|
-
scopeKey,
|
|
2199
|
-
sessionKey: options?.sessionKey,
|
|
2200
|
-
mainKey: options?.config?.session?.mainKey,
|
|
2201
|
-
sessionScope: options?.config?.session?.scope,
|
|
2202
|
-
eventRouting: resolveEventSessionRoutingPolicy({
|
|
2203
|
-
cfg: options?.config,
|
|
2204
|
-
sessionKey: options?.sessionKey,
|
|
2205
|
-
channel: options?.messageProvider,
|
|
2206
|
-
accountId: options?.agentAccountId
|
|
2207
|
-
}),
|
|
2208
|
-
messageProvider: options?.messageProvider,
|
|
2209
|
-
currentChannelId: options?.currentChannelId,
|
|
2210
|
-
currentThreadTs: options?.currentThreadTs,
|
|
2211
|
-
accountId: options?.agentAccountId,
|
|
2212
|
-
backgroundMs: options?.exec?.backgroundMs ?? execConfig.backgroundMs,
|
|
2213
|
-
timeoutSec: options?.exec?.timeoutSec ?? execConfig.timeoutSec,
|
|
2214
|
-
approvalRunningNoticeMs: options?.exec?.approvalRunningNoticeMs ?? execConfig.approvalRunningNoticeMs,
|
|
2215
|
-
notifyOnExit: options?.exec?.notifyOnExit ?? execConfig.notifyOnExit,
|
|
2216
|
-
notifyOnExitEmptySuccess: options?.exec?.notifyOnExitEmptySuccess ?? execConfig.notifyOnExitEmptySuccess,
|
|
2217
|
-
sandbox: sandbox ? {
|
|
2218
|
-
containerName: sandbox.containerName,
|
|
2219
|
-
workspaceDir: sandbox.workspaceDir,
|
|
2220
|
-
containerWorkdir: sandbox.containerWorkdir,
|
|
2221
|
-
env: sandbox.backend?.env ?? sandbox.docker.env,
|
|
2222
|
-
buildExecSpec: sandbox.backend?.buildExecSpec.bind(sandbox.backend),
|
|
2223
|
-
finalizeExec: sandbox.backend?.finalizeExec?.bind(sandbox.backend)
|
|
2224
|
-
} : void 0
|
|
2225
|
-
}) : null;
|
|
2226
|
-
const processTool = includeShellTools ? createLazyProcessTool({
|
|
2227
|
-
cleanupMs: cleanupMsOverride ?? execConfig.cleanupMs,
|
|
2228
|
-
scopeKey
|
|
2229
|
-
}) : null;
|
|
2230
|
-
const applyPatchTool = !includeShellTools || !applyPatchEnabled || sandboxRoot && !allowWorkspaceWrites ? null : createApplyPatchTool({
|
|
2231
|
-
cwd: codingRoot,
|
|
2232
|
-
sandbox: sandboxRoot && allowWorkspaceWrites ? {
|
|
2233
|
-
root: sandboxRoot,
|
|
2234
|
-
bridge: sandboxFsBridge
|
|
2235
|
-
} : void 0,
|
|
2236
|
-
workspaceOnly: applyPatchWorkspaceOnly
|
|
2237
|
-
});
|
|
2238
|
-
options?.recordToolPrepStage?.("shell-tools");
|
|
2239
|
-
const pluginToolAllowlist = collectExplicitAllowlist([
|
|
2240
|
-
profilePolicy,
|
|
2241
|
-
providerProfilePolicy,
|
|
2242
|
-
globalPolicy,
|
|
2243
|
-
globalProviderPolicy,
|
|
2244
|
-
agentPolicy,
|
|
2245
|
-
agentProviderPolicy,
|
|
2246
|
-
groupPolicy,
|
|
2247
|
-
senderPolicy,
|
|
2248
|
-
sandboxToolPolicy,
|
|
2249
|
-
subagentPolicy,
|
|
2250
|
-
inheritedToolPolicy,
|
|
2251
|
-
options?.runtimeToolAllowlist ? { allow: options.runtimeToolAllowlist } : void 0
|
|
2252
|
-
]);
|
|
2253
|
-
const pluginToolDenylist = collectExplicitDenylist([
|
|
2254
|
-
profilePolicy,
|
|
2255
|
-
providerProfilePolicy,
|
|
2256
|
-
globalPolicy,
|
|
2257
|
-
globalProviderPolicy,
|
|
2258
|
-
agentPolicy,
|
|
2259
|
-
agentProviderPolicy,
|
|
2260
|
-
groupPolicy,
|
|
2261
|
-
senderPolicy,
|
|
2262
|
-
sandboxToolPolicy,
|
|
2263
|
-
subagentPolicy,
|
|
2264
|
-
inheritedToolPolicy
|
|
2265
|
-
]);
|
|
2266
|
-
const inheritedToolDenylist = [...pluginToolDenylist];
|
|
2267
|
-
const inheritedToolAllowlist = [];
|
|
2268
|
-
const shouldInheritEffectiveToolAllowlist = [
|
|
2269
|
-
profilePolicy,
|
|
2270
|
-
providerProfilePolicy,
|
|
2271
|
-
globalPolicy,
|
|
2272
|
-
globalProviderPolicy,
|
|
2273
|
-
agentPolicy,
|
|
2274
|
-
agentProviderPolicy,
|
|
2275
|
-
groupPolicy,
|
|
2276
|
-
senderPolicy,
|
|
2277
|
-
sandboxToolPolicy,
|
|
2278
|
-
subagentPolicy,
|
|
2279
|
-
inheritedToolPolicy,
|
|
2280
|
-
options?.runtimeToolAllowlist ? { allow: options.runtimeToolAllowlist } : void 0
|
|
2281
|
-
].some(hasRestrictiveAllowPolicy);
|
|
2282
|
-
const pluginToolsOnly = includeFengMingTools || !includePluginTools ? [] : resolveFengMingPluginToolsForOptions({
|
|
2283
|
-
options: {
|
|
2284
|
-
agentSessionKey: options?.sessionKey,
|
|
2285
|
-
agentChannel: resolveGatewayMessageChannel(options?.messageProvider),
|
|
2286
|
-
agentAccountId: options?.agentAccountId,
|
|
2287
|
-
agentTo: options?.messageTo,
|
|
2288
|
-
agentThreadId: options?.messageThreadId,
|
|
2289
|
-
agentDir: options?.agentDir,
|
|
2290
|
-
workspaceDir: workspaceRoot,
|
|
2291
|
-
config: options?.config,
|
|
2292
|
-
fsPolicy,
|
|
2293
|
-
requesterSenderId: options?.senderId,
|
|
2294
|
-
sessionId: options?.sessionId,
|
|
2295
|
-
sandboxBrowserBridgeUrl: sandbox?.browser?.bridgeUrl,
|
|
2296
|
-
allowHostBrowserControl: sandbox ? sandbox.browserAllowHostControl : true,
|
|
2297
|
-
sandboxed: !!sandbox,
|
|
2298
|
-
pluginToolAllowlist,
|
|
2299
|
-
pluginToolDenylist,
|
|
2300
|
-
currentChannelId: options?.currentChannelId,
|
|
2301
|
-
currentThreadTs: options?.currentThreadTs,
|
|
2302
|
-
currentMessageId: options?.currentMessageId,
|
|
2303
|
-
modelProvider: options?.modelProvider,
|
|
2304
|
-
modelId: options?.modelId,
|
|
2305
|
-
modelHasVision: options?.modelHasVision,
|
|
2306
|
-
requireExplicitMessageTarget: options?.requireExplicitMessageTarget,
|
|
2307
|
-
disableMessageTool: options?.disableMessageTool,
|
|
2308
|
-
requesterAgentIdOverride: agentId,
|
|
2309
|
-
allowGatewaySubagentBinding: options?.allowGatewaySubagentBinding,
|
|
2310
|
-
authProfileStore: options?.authProfileStore
|
|
2311
|
-
},
|
|
2312
|
-
resolvedConfig: options?.config
|
|
2313
|
-
});
|
|
2314
|
-
const toolSearchTools = toolSearchControlsEnabled ? createToolSearchTools({
|
|
2315
|
-
config: options?.config,
|
|
2316
|
-
runtimeConfig: options?.config,
|
|
2317
|
-
agentId,
|
|
2318
|
-
sessionKey: options?.sessionKey,
|
|
2319
|
-
sessionId: options?.sessionId,
|
|
2320
|
-
runId: options?.runId,
|
|
2321
|
-
catalogRef: options?.toolSearchCatalogRef,
|
|
2322
|
-
abortSignal: options?.abortSignal,
|
|
2323
|
-
executeTool: options?.toolSearchCatalogExecutor
|
|
2324
|
-
}) : [];
|
|
2325
|
-
const tools = [
|
|
2326
|
-
...base,
|
|
2327
|
-
...includeBaseCodingTools && sandboxRoot ? allowWorkspaceWrites ? [workspaceOnly ? wrapToolWorkspaceRootGuardWithOptions(createSandboxedEditTool({
|
|
2328
|
-
root: sandboxRoot,
|
|
2329
|
-
bridge: sandboxFsBridge
|
|
2330
|
-
}), sandboxRoot, { containerWorkdir: sandbox.containerWorkdir }) : createSandboxedEditTool({
|
|
2331
|
-
root: sandboxRoot,
|
|
2332
|
-
bridge: sandboxFsBridge
|
|
2333
|
-
}), workspaceOnly ? wrapToolWorkspaceRootGuardWithOptions(createSandboxedWriteTool({
|
|
2334
|
-
root: sandboxRoot,
|
|
2335
|
-
bridge: sandboxFsBridge
|
|
2336
|
-
}), sandboxRoot, { containerWorkdir: sandbox.containerWorkdir }) : createSandboxedWriteTool({
|
|
2337
|
-
root: sandboxRoot,
|
|
2338
|
-
bridge: sandboxFsBridge
|
|
2339
|
-
})] : [] : [],
|
|
2340
|
-
...includeShellTools && applyPatchTool ? [applyPatchTool] : [],
|
|
2341
|
-
...execTool ? [execTool] : [],
|
|
2342
|
-
...processTool ? [processTool] : [],
|
|
2343
|
-
...includeChannelTools ? listChannelAgentTools({ cfg: options?.config }) : [],
|
|
2344
|
-
...includeFengMingTools ? createFengMingTools({
|
|
2345
|
-
sandboxBrowserBridgeUrl: sandbox?.browser?.bridgeUrl,
|
|
2346
|
-
allowHostBrowserControl: sandbox ? sandbox.browserAllowHostControl : true,
|
|
2347
|
-
agentSessionKey: options?.sessionKey,
|
|
2348
|
-
runId: options?.runId,
|
|
2349
|
-
runSessionKey: options?.runSessionKey,
|
|
2350
|
-
agentChannel: resolveGatewayMessageChannel(options?.messageProvider),
|
|
2351
|
-
agentAccountId: options?.agentAccountId,
|
|
2352
|
-
agentTo: options?.messageTo,
|
|
2353
|
-
agentThreadId: options?.messageThreadId,
|
|
2354
|
-
agentGroupId: options?.groupId ?? null,
|
|
2355
|
-
agentGroupChannel: options?.groupChannel ?? null,
|
|
2356
|
-
agentGroupSpace: options?.groupSpace ?? null,
|
|
2357
|
-
agentMemberRoleIds: options?.memberRoleIds,
|
|
2358
|
-
agentDir: options?.agentDir,
|
|
2359
|
-
sandboxRoot,
|
|
2360
|
-
sandboxContainerWorkdir: sandbox?.containerWorkdir,
|
|
2361
|
-
sandboxFsBridge,
|
|
2362
|
-
fsPolicy,
|
|
2363
|
-
workspaceDir: workspaceRoot,
|
|
2364
|
-
spawnWorkspaceDir: options?.spawnWorkspaceDir ? resolveWorkspaceRoot(options.spawnWorkspaceDir) : void 0,
|
|
2365
|
-
sandboxed: !!sandbox,
|
|
2366
|
-
config: options?.config,
|
|
2367
|
-
pluginToolAllowlist,
|
|
2368
|
-
pluginToolDenylist,
|
|
2369
|
-
currentChannelId: options?.currentChannelId,
|
|
2370
|
-
currentThreadTs: options?.currentThreadTs,
|
|
2371
|
-
currentMessageId: options?.currentMessageId,
|
|
2372
|
-
modelProvider: options?.modelProvider,
|
|
2373
|
-
modelId: options?.modelId,
|
|
2374
|
-
replyToMode: options?.replyToMode,
|
|
2375
|
-
hasRepliedRef: options?.hasRepliedRef,
|
|
2376
|
-
modelHasVision: options?.modelHasVision,
|
|
2377
|
-
requireExplicitMessageTarget: options?.requireExplicitMessageTarget,
|
|
2378
|
-
sourceReplyDeliveryMode: options?.sourceReplyDeliveryMode,
|
|
2379
|
-
inboundEventKind: options?.inboundEventKind,
|
|
2380
|
-
disableMessageTool: options?.disableMessageTool,
|
|
2381
|
-
enableHeartbeatTool,
|
|
2382
|
-
disablePluginTools: !includePluginTools,
|
|
2383
|
-
wrapBeforeToolCallHook: false,
|
|
2384
|
-
...cronSelfRemoveOnlyJobId ? { cronSelfRemoveOnlyJobId } : {},
|
|
2385
|
-
requesterAgentIdOverride: agentId,
|
|
2386
|
-
requesterSenderId: options?.senderId,
|
|
2387
|
-
senderIsOwner: options?.senderIsOwner,
|
|
2388
|
-
authProfileStore: options?.authProfileStore,
|
|
2389
|
-
sessionId: options?.sessionId,
|
|
2390
|
-
inheritedToolAllowlist,
|
|
2391
|
-
inheritedToolDenylist,
|
|
2392
|
-
onYield: options?.onYield,
|
|
2393
|
-
allowGatewaySubagentBinding: options?.allowGatewaySubagentBinding,
|
|
2394
|
-
recordToolPrepStage: options?.recordToolPrepStage
|
|
2395
|
-
}) : pluginToolsOnly,
|
|
2396
|
-
...toolSearchTools
|
|
2397
|
-
];
|
|
2398
|
-
options?.recordToolPrepStage?.("fengming-tools");
|
|
2399
|
-
const toolsForMemoryFlush = isMemoryFlushRun && memoryFlushWritePath ? [] : tools;
|
|
2400
|
-
if (isMemoryFlushRun && memoryFlushWritePath) for (const tool of tools) {
|
|
2401
|
-
if (!MEMORY_FLUSH_ALLOWED_TOOL_NAMES.has(tool.name)) continue;
|
|
2402
|
-
if (tool.name === "write") {
|
|
2403
|
-
toolsForMemoryFlush.push(wrapToolMemoryFlushAppendOnlyWrite(tool, {
|
|
2404
|
-
root: memoryFlushWriteRoot,
|
|
2405
|
-
relativePath: memoryFlushWritePath,
|
|
2406
|
-
containerWorkdir: sandbox?.containerWorkdir,
|
|
2407
|
-
sandbox: sandboxRoot && sandboxFsBridge ? {
|
|
2408
|
-
root: sandboxRoot,
|
|
2409
|
-
bridge: sandboxFsBridge
|
|
2410
|
-
} : void 0
|
|
2411
|
-
}));
|
|
2412
|
-
continue;
|
|
2413
|
-
}
|
|
2414
|
-
toolsForMemoryFlush.push(tool);
|
|
2415
|
-
}
|
|
2416
|
-
const unavailableCoreToolReason = isMemoryFlushRun && memoryFlushWritePath ? "memory-triggered compaction runs expose only read and append-only write" : void 0;
|
|
2417
|
-
const toolsForMessageProvider = filterToolsByMessageProvider(toolsForMemoryFlush, options?.messageProvider);
|
|
2418
|
-
options?.recordToolPrepStage?.("message-provider-policy");
|
|
2419
|
-
const toolsForModelProvider = applyModelProviderToolPolicy(toolsForMessageProvider, {
|
|
2420
|
-
config: options?.config,
|
|
2421
|
-
modelProvider: options?.modelProvider,
|
|
2422
|
-
modelApi: options?.modelApi,
|
|
2423
|
-
modelId: options?.modelId,
|
|
2424
|
-
agentId: options?.agentId,
|
|
2425
|
-
sessionKey: options?.sessionKey,
|
|
2426
|
-
agentDir: options?.agentDir,
|
|
2427
|
-
modelCompat: options?.modelCompat,
|
|
2428
|
-
suppressManagedWebSearch: options?.suppressManagedWebSearch
|
|
2429
|
-
});
|
|
2430
|
-
options?.recordToolPrepStage?.("model-provider-policy");
|
|
2431
|
-
const subagentFiltered = applyToolPolicyPipeline({
|
|
2432
|
-
tools: toolsForModelProvider,
|
|
2433
|
-
toolMeta: (tool) => getPluginToolMeta(tool),
|
|
2434
|
-
warn: logWarn,
|
|
2435
|
-
steps: [
|
|
2436
|
-
...buildDefaultToolPolicyPipelineSteps({
|
|
2437
|
-
profilePolicy: profilePolicyWithAlsoAllow,
|
|
2438
|
-
profile,
|
|
2439
|
-
profileUnavailableCoreWarningAllowlist: profilePolicy?.allow,
|
|
2440
|
-
providerProfilePolicy: providerProfilePolicyWithAlsoAllow,
|
|
2441
|
-
providerProfile,
|
|
2442
|
-
providerProfileUnavailableCoreWarningAllowlist: providerProfilePolicy?.allow,
|
|
2443
|
-
globalPolicy: globalPolicyWithToolSearchControls,
|
|
2444
|
-
globalProviderPolicy: globalProviderPolicyWithToolSearchControls,
|
|
2445
|
-
agentPolicy: agentPolicyWithToolSearchControls,
|
|
2446
|
-
agentProviderPolicy: agentProviderPolicyWithToolSearchControls,
|
|
2447
|
-
groupPolicy: groupPolicyWithToolSearchControls,
|
|
2448
|
-
senderPolicy: senderPolicyWithToolSearchControls,
|
|
2449
|
-
agentId,
|
|
2450
|
-
unavailableCoreToolReason
|
|
2451
|
-
}),
|
|
2452
|
-
{
|
|
2453
|
-
policy: sandboxToolPolicyWithToolSearchControls,
|
|
2454
|
-
label: "sandbox tools.allow",
|
|
2455
|
-
unavailableCoreToolReason
|
|
2456
|
-
},
|
|
2457
|
-
{
|
|
2458
|
-
policy: subagentPolicyWithToolSearchControls,
|
|
2459
|
-
label: "subagent tools.allow",
|
|
2460
|
-
unavailableCoreToolReason
|
|
2461
|
-
},
|
|
2462
|
-
{
|
|
2463
|
-
policy: inheritedToolPolicy,
|
|
2464
|
-
label: "inherited tools",
|
|
2465
|
-
unavailableCoreToolReason
|
|
2466
|
-
}
|
|
2467
|
-
]
|
|
2468
|
-
});
|
|
2469
|
-
if (shouldInheritEffectiveToolAllowlist) replaceWithEffectiveToolAllowlist(inheritedToolAllowlist, subagentFiltered);
|
|
2470
|
-
options?.recordToolPrepStage?.("authorization-policy");
|
|
2471
|
-
const normalized = subagentFiltered.map((tool) => normalizeToolParameters(tool, {
|
|
2472
|
-
modelProvider: options?.modelProvider,
|
|
2473
|
-
modelId: options?.modelId,
|
|
2474
|
-
modelCompat: options?.modelCompat
|
|
2475
|
-
}));
|
|
2476
|
-
options?.recordToolPrepStage?.("schema-normalization");
|
|
2477
|
-
const withHooks = normalized.map((tool) => wrapToolWithBeforeToolCallHook(tool, {
|
|
2478
|
-
agentId,
|
|
2479
|
-
...options?.config ? { config: options.config } : {},
|
|
2480
|
-
cwd: codingRoot,
|
|
2481
|
-
workspaceDir: workspaceRoot,
|
|
2482
|
-
...options?.skillsSnapshot ? { skillsSnapshot: options.skillsSnapshot } : {},
|
|
2483
|
-
...sandboxRoot && allowWorkspaceWrites ? { sandbox: {
|
|
2484
|
-
root: sandboxRoot,
|
|
2485
|
-
bridge: sandboxFsBridge
|
|
2486
|
-
} } : {},
|
|
2487
|
-
sessionKey: options?.sessionKey,
|
|
2488
|
-
sessionId: options?.sessionId,
|
|
2489
|
-
runId: options?.runId,
|
|
2490
|
-
channelId: options?.hookChannelId ?? options?.currentChannelId,
|
|
2491
|
-
...options?.trace ? { trace: options.trace } : {},
|
|
2492
|
-
loopDetection: resolveToolLoopDetectionConfig({
|
|
2493
|
-
cfg: options?.config,
|
|
2494
|
-
agentId
|
|
2495
|
-
}),
|
|
2496
|
-
onToolOutcome: options?.onToolOutcome
|
|
2497
|
-
}, { emitDiagnostics: options?.emitBeforeToolCallDiagnostics }));
|
|
2498
|
-
options?.recordToolPrepStage?.("tool-hooks");
|
|
2499
|
-
const withAbort = options?.abortSignal ? withHooks.map((tool) => wrapToolWithAbortSignal(tool, options.abortSignal)) : withHooks;
|
|
2500
|
-
options?.recordToolPrepStage?.("abort-wrappers");
|
|
2501
|
-
const withDeferredFollowupDescriptions = applyDeferredFollowupToolDescriptions(withAbort, { agentId });
|
|
2502
|
-
options?.recordToolPrepStage?.("deferred-followup-descriptions");
|
|
2503
|
-
return withDeferredFollowupDescriptions;
|
|
2504
|
-
}
|
|
2505
|
-
//#endregion
|
|
2506
|
-
export { isLocalModelLeanEnabled as _, TOOL_SEARCH_CODE_MODE_TOOL_NAME as a, addClientToolsToToolCatalog as c, applyToolSearchCatalog as d, clearToolSearchCatalog as f, filterLocalModelLeanTools as g, resolveToolSearchConfig as h, TOOL_DESCRIBE_RAW_TOOL_NAME as i, addClientToolsToToolSearchCatalog as l, projectToolSearchTargetTranscriptMessages as m, resolveProcessToolScopeKey as n, TOOL_SEARCH_RAW_TOOL_NAME as o, createToolSearchCatalogRef as p, TOOL_CALL_RAW_TOOL_NAME as r, ToolSearchRuntime as s, createFengMingCodingTools as t, applyToolCatalogCompaction as u };
|