kaijibot 2026.8.21 → 2026.8.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/dist/.buildstamp +1 -1
- package/dist/abort-Bg5O8Yiz.js +202 -0
- package/dist/abort-cutoff.runtime-CvjKPRCc.js +20 -0
- package/dist/abort-cutoff.runtime.js +1 -1
- package/dist/abort.runtime-UZvtDM6M.js +2 -0
- package/dist/abort.runtime.js +1 -1
- package/dist/acp-cli-BHDaxHbu.js +2171 -0
- package/dist/acp-spawn-BJJ8QbXE.js +1024 -0
- package/dist/acp-stateful-target-driver-DyZ1dneY.js +88 -0
- package/dist/action-agents-Bx5S-ZYL.js +67 -0
- package/dist/action-focus-DGURwLDo.js +124 -0
- package/dist/action-help-7ey3e-V9.js +7 -0
- package/dist/action-info-BxQpOqFZ.js +58 -0
- package/dist/action-kill-C7kGSXgP.js +33 -0
- package/dist/action-list-cwGVroWS.js +21 -0
- package/dist/action-log-DT-bRM9X.js +30 -0
- package/dist/action-send-BNv-Wz-l.js +39 -0
- package/dist/action-spawn-DkEYjxPF.js +46 -0
- package/dist/action-unfocus-CU1WRop0.js +28 -0
- package/dist/agent-BOaVCAE9.js +2 -0
- package/dist/agent-command-0Ie27CS4.js +1479 -0
- package/dist/agent-runner-utils-fBrjJUeq.js +202 -0
- package/dist/agent-runner.runtime-DEArTfVM.js +2825 -0
- package/dist/agent-runner.runtime.js +1 -1
- package/dist/agents/auth-profiles.runtime.js +1 -1
- package/dist/agents/model-catalog.runtime.js +1 -1
- package/dist/agents/models-config.runtime.js +1 -1
- package/dist/agents/pi-model-discovery-runtime.js +1 -1
- package/dist/agents-CH6NQBfT.js +5 -0
- package/dist/agents-DuBi4yGs.js +887 -0
- package/dist/anthropic-vertex-stream-C-dr7gew.js +5666 -0
- package/dist/api-C-d6hJ6R.js +3 -0
- package/dist/api-CWzMTsre.js +35 -0
- package/dist/api-CspIEuoI.js +4 -0
- package/dist/api-DWfH8UCU.js +19 -0
- package/dist/api-DnP8S2bH.js +5 -0
- package/dist/api-Y8trG2YC.js +2 -0
- package/dist/api-fZ1Mwhb9.js +2 -0
- package/dist/api-inKLxoen.js +45 -0
- package/dist/api-plrtNPKq.js +2 -0
- package/dist/api-tiV4Lam3.js +2 -0
- package/dist/apply-DyMW1n_a.js +493 -0
- package/dist/apply.runtime-BOvle-IJ.js +166 -0
- package/dist/apply.runtime-C0ny2nmc.js +2 -0
- package/dist/apply.runtime.js +1 -1
- package/dist/approval-client-helpers-Ss4gUaso.js +82 -0
- package/dist/approval-gateway-resolver-D6xh0K2G.js +58 -0
- package/dist/approval-gateway-runtime-CffF6RIQ.js +2 -0
- package/dist/approval-handler-runtime-p9BmT1Xf.js +439 -0
- package/dist/approval-native-runtime-DN73OHKf.js +709 -0
- package/dist/approval-renderers-CITEnajR.js +64 -0
- package/dist/asr-Jt-OmxEb.js +196 -0
- package/dist/audit-BM_BshdA.js +885 -0
- package/dist/audit-extra.async-Cvm-ViC4.js +847 -0
- package/dist/audit.deep.runtime-Ccabqd1Y.js +2 -0
- package/dist/audit.deep.runtime.js +1 -1
- package/dist/audit.nondeep.runtime-BNrDSb24.js +859 -0
- package/dist/audit.nondeep.runtime.js +1 -1
- package/dist/audit.runtime-BKUEHsrE.js +7 -0
- package/dist/audit.runtime.js +1 -1
- package/dist/auth-Dt8gUUJi.js +181 -0
- package/dist/auth-choice-BC_BWYZD.js +3 -0
- package/dist/auth-choice-BtwWAcEq.js +71 -0
- package/dist/auth-choice-CO__21te.js +353 -0
- package/dist/auth-choice-options-BxgjFsFO.js +104 -0
- package/dist/auth-choice-prompt-B-P39mib.js +2 -0
- package/dist/auth-choice-prompt-Dp7Vptqj.js +36 -0
- package/dist/auth-choice.plugin-providers.runtime-BJqmauZz.js +11 -0
- package/dist/auth-choice.plugin-providers.runtime.js +1 -1
- package/dist/auth-health-CPclIUZ3.js +165 -0
- package/dist/auth-profiles-P49vCUs4.js +438 -0
- package/dist/auth-profiles.runtime-pIuc_0v-.js +7 -0
- package/dist/auth-profiles.runtime.js +1 -1
- package/dist/auto-recall-Dm-J3oEj.js +78 -0
- package/dist/backup-create-DcO0pYFy.js +391 -0
- package/dist/banner-CIw8Yepm.js +2 -0
- package/dist/banner-w4GNKrs6.js +281 -0
- package/dist/binding-routing-upMo3iCO.js +50 -0
- package/dist/binding-targets-C9WygzAM.js +99 -0
- package/dist/bridge-server-Cu0xkN0E.js +103 -0
- package/dist/browser-config-runtime-3QVJiqnP.js +6 -0
- package/dist/browser-control-auth-BkunTzw7.js +120 -0
- package/dist/browser-node-runtime-BusKdg2E.js +12 -0
- package/dist/browser-profiles-BocOxjqC.js +170 -0
- package/dist/browser-runtime-D3goJLF9.js +377 -0
- package/dist/browser-setup-tools-j-IDYASL.js +12 -0
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +4 -4
- package/dist/bundled/session-memory/handler.js +2 -2
- package/dist/call-CMDK9Mqx.js +2 -0
- package/dist/call-Cisydyym.js +495 -0
- package/dist/call.runtime-CJUaD_Ck.js +2 -0
- package/dist/call.runtime.js +1 -1
- package/dist/capability-cli-e_bf338W.js +1357 -0
- package/dist/catalog-provider-D5mzbnCM.js +40 -0
- package/dist/cdp.helpers-BqVqEY02.js +372 -0
- package/dist/channel-core-cQ4DROoP.js +5 -0
- package/dist/channel-summary-BHojSrOd.js +139 -0
- package/dist/channel-summary-CzjCL-4-.js +2 -0
- package/dist/channel.runtime-D6e2VBFb.js +399 -0
- package/dist/channel.runtime.js +1 -1
- package/dist/channels-cli-Y-Wnalvd.js +248 -0
- package/dist/channels-uiGUmLk2.js +1147 -0
- package/dist/chat-CQc5lJAu.js +213 -0
- package/dist/chrome-BcU0ZvUn.js +1080 -0
- package/dist/chrome.executables-Dp0Lkjmz.js +550 -0
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/cli-BGB7qdp3.js +191 -0
- package/dist/cli-BtTS8CKF.js +2 -0
- package/dist/cli-CQX3q4Fm.js +57 -0
- package/dist/cli-ZLAF588A.js +154 -0
- package/dist/cli-auth-seam-D-Qci5-b.js +14 -0
- package/dist/cli-backend-DxaeTZ8N.js +66 -0
- package/dist/cli-g4KJW_UT.js +2 -0
- package/dist/cli-migration-B2SFdY0j.js +127 -0
- package/dist/cli-runner-BVQt0v1D.js +1662 -0
- package/dist/cli-runner.runtime-BAMS4uW0.js +3 -0
- package/dist/cli-runner.runtime-H3alxbDK.js +2 -0
- package/dist/cli-runner.runtime.js +1 -1
- package/dist/cli-shared-BaJRfEqD.js +142 -0
- package/dist/cli-startup-metadata.json +2 -2
- package/dist/cli.runtime-CQ1qvGdJ.js +819 -0
- package/dist/cli.runtime.js +1 -1
- package/dist/client-bootstrap-BE7PiMJr.js +28 -0
- package/dist/codex-native-web-search-TdFXLTHZ.js +2 -0
- package/dist/codex-native-web-search-dKQT4ZPV.js +156 -0
- package/dist/collector-BXDPP4rJ.js +2 -0
- package/dist/collector-CT3qBEYi.js +424 -0
- package/dist/command-auth-FR5r0kKW.js +75 -0
- package/dist/command-config-resolution-BfTLOZxI.js +23 -0
- package/dist/command-config-resolution-GV0h_B0u.js +2 -0
- package/dist/command-execution-startup-oMdUg9Py.js +269 -0
- package/dist/command-format-CZ8oMoC9.js +2 -0
- package/dist/command-queue-BlORGS1M.js +260 -0
- package/dist/command-registry-DNKWkedC.js +3 -0
- package/dist/command-registry-DO6fBZ31.js +113 -0
- package/dist/command-secret-gateway-Cnjliq_k.js +528 -0
- package/dist/commands-acp-OeD4TGXU.js +1017 -0
- package/dist/commands-compact.runtime-ZE5b-Pvj.js +10 -0
- package/dist/commands-compact.runtime.js +1 -1
- package/dist/commands-core.runtime-Ca3exd9B.js +2 -0
- package/dist/commands-core.runtime.js +1 -1
- package/dist/commands-handlers.runtime-DKL8ULNw.js +3762 -0
- package/dist/commands-handlers.runtime.js +1 -1
- package/dist/commands-models-uaQEC1GX.js +306 -0
- package/dist/commands-reset-hooks-0RFpUGBC.js +129 -0
- package/dist/commands-status-4HTjDVIN.js +223 -0
- package/dist/commands-status.runtime-CyJiWLQs.js +2 -0
- package/dist/commands-status.runtime.js +1 -1
- package/dist/commands-subagents-control.runtime-B3DtD7Se.js +3 -0
- package/dist/commands-subagents-control.runtime-BLHWicyx.js +2 -0
- package/dist/commands-subagents-control.runtime.js +1 -1
- package/dist/commands.runtime-Bk9-pUEs.js +103 -0
- package/dist/commands.runtime.js +1 -1
- package/dist/comment-shared-BCggDOtV.js +40 -0
- package/dist/compact-CBJu2_ft.js +11324 -0
- package/dist/compact.runtime-Bj3PGRRh.js +7 -0
- package/dist/compact.runtime.js +1 -1
- package/dist/completion-cli-B27D7vni.js +468 -0
- package/dist/completion-cli-QdkbM0Vz.js +2 -0
- package/dist/config-BZb7_jO5.js +166 -0
- package/dist/config-C2M27bOw.js +8 -0
- package/dist/config-D_fICGrQ.js +53 -0
- package/dist/config-cli-B7j3KePQ.js +948 -0
- package/dist/config-defaults-XFEo6I7v.js +163 -0
- package/dist/config-guard-wGGj2x7b.js +94 -0
- package/dist/config-runtime-xwO8vvQP.js +14 -0
- package/dist/config-validation-tPbNhbrH.js +279 -0
- package/dist/configure-CXFWPXal.js +1162 -0
- package/dist/configure-lBR_2rAt.js +2 -0
- package/dist/connection-auth-ClCO21bT.js +30 -0
- package/dist/context-CJMC7SyI.js +249 -0
- package/dist/context-CWC_tVM8.js +2 -0
- package/dist/context-writer-DNkMBOu9.js +290 -0
- package/dist/control-auth-DUZs9D8n.js +122 -0
- package/dist/control-ui/assets/agents-HENIRhRj.js +767 -0
- package/dist/control-ui/assets/anthropic-DlOZcqqy.js +40 -0
- package/dist/control-ui/assets/azure-openai-responses-BmSDwKAQ.js +2 -0
- package/dist/control-ui/assets/cron-B2CJajqc.js +744 -0
- package/dist/control-ui/assets/dialogues-DmWmdbMF.js +83 -0
- package/dist/control-ui/assets/history-CP7LOJan.js +71 -0
- package/dist/control-ui/assets/index-BsGBtIKy.css +1 -0
- package/dist/control-ui/assets/index-BtNFbQhY.js +2686 -0
- package/dist/control-ui/assets/mistral-CYEJ-E7G.js +72 -0
- package/dist/control-ui/assets/openai-codex-responses-BnLjDxo3.js +8 -0
- package/dist/control-ui/assets/openai-completions-D46D4eD2.js +6 -0
- package/dist/control-ui/assets/openai-responses-CNVWXuC0.js +2 -0
- package/dist/control-ui/assets/openai-responses-shared-ByeOE-gc.js +13 -0
- package/dist/control-ui/index.html +2 -2
- package/dist/conversation-id-DlazDTmW.js +140 -0
- package/dist/conversation-runtime-BjljNAU1.js +31 -0
- package/dist/core-4Dt1_PpO.js +210 -0
- package/dist/cron-cli-CTGN3Kum.js +637 -0
- package/dist/curator-BM2jeaou.js +600 -0
- package/dist/curator-_QLWjb7r.js +2 -0
- package/dist/daemon-cli-BLe7aLfJ.js +476 -0
- package/dist/daemon-install-BneaHOcs.js +70 -0
- package/dist/delegate-CyUm6mk6.js +61 -0
- package/dist/deliver-BvUx9v-a.js +3 -0
- package/dist/deliver-DQbRPHSb.js +782 -0
- package/dist/deliver-runtime-ERlRZAW4.js +2 -0
- package/dist/delivery-outbound.runtime-Bi6Lu4JP.js +6 -0
- package/dist/delivery-outbound.runtime.js +1 -1
- package/dist/delivery-queue-B4kCxhnW.js +2 -0
- package/dist/delivery-queue-DDHwRyN-.js +372 -0
- package/dist/deps-DZQeVHSD.js +60 -0
- package/dist/devices-cli-CFSjN2KZ.js +336 -0
- package/dist/diagnostic-Bh12mVkv.js +311 -0
- package/dist/direct-dm-Bn07LLbq.js +139 -0
- package/dist/directive-handling.fast-lane-Cd6SSr-l.js +64 -0
- package/dist/directive-handling.fast-lane-ejwgECy7.js +2 -0
- package/dist/directive-handling.impl-Bpy5KQZr.js +659 -0
- package/dist/directive-handling.impl-ZEKrT-pi.js +2 -0
- package/dist/directive-handling.parse-COyCTXvI.js +376 -0
- package/dist/directive-handling.persist-CgxhTMmz.js +139 -0
- package/dist/directive-handling.persist.runtime-4pppF2CM.js +2 -0
- package/dist/directive-handling.persist.runtime.js +1 -1
- package/dist/directive-handling.shared-BuNzwbwp.js +159 -0
- package/dist/directory-cli-gWQfdmFR.js +240 -0
- package/dist/dispatch-Cg_O6HsU.js +1126 -0
- package/dist/dispatch-acp-C7kPkeqX.js +969 -0
- package/dist/dispatch-acp-manager.runtime-Bh3V5wGh.js +3 -0
- package/dist/dispatch-acp-manager.runtime.js +1 -1
- package/dist/dispatch-acp-media.runtime-pWY6A7VY.js +3 -0
- package/dist/dispatch-acp-media.runtime.js +1 -1
- package/dist/dispatch-acp-session.runtime-DdkuSkq8.js +2 -0
- package/dist/dispatch-acp-session.runtime.js +1 -1
- package/dist/dispatch-acp.runtime-fr_7acr8.js +19 -0
- package/dist/dispatch-acp.runtime.js +1 -1
- package/dist/dns-cli-C4uepTJE.js +193 -0
- package/dist/docs-cli-DWzfteG6.js +156 -0
- package/dist/doctor-completion-D2s3ieS6.js +90 -0
- package/dist/doctor-config-preflight-BIf8igIW.js +148 -0
- package/dist/doctor-config-preflight-BiJSPUPg.js +2 -0
- package/dist/doctor-state-migrations-BbfPLoLz.js +2 -0
- package/dist/doctor-state-migrations-DFQets45.js +3 -0
- package/dist/drive-CvbBPFcl.js +718 -0
- package/dist/embedding-provider-DUT_HxYD.js +26 -0
- package/dist/embedding-provider-DjVEIg-4.js +33 -0
- package/dist/embedding-provider-TKNNnQ3m.js +129 -0
- package/dist/engine-CT4xJJ-H.js +82 -0
- package/dist/engine-embeddings-BN4uJOv0.js +1489 -0
- package/dist/entry-capabilities-BhpTqh0w.js +89 -0
- package/dist/entry.js +2 -2
- package/dist/env-overrides-Dn5yy0l4.js +347 -0
- package/dist/env-overrides.runtime-DdD841Km.js +7 -0
- package/dist/env-overrides.runtime.js +1 -1
- package/dist/exec-approval-forwarder.runtime-CV81fvQh.js +3 -0
- package/dist/exec-approval-forwarder.runtime.js +1 -1
- package/dist/exec-approval-reply-C_NfihTE.js +292 -0
- package/dist/exec-approvals-cli-DKOFcUAn.js +485 -0
- package/dist/exec-defaults-Cs1FwIKH.js +1440 -0
- package/dist/extensionAPI.js +4 -4
- package/dist/extensions/alibaba/index.js +1 -1
- package/dist/extensions/alibaba/video-generation-provider.js +1 -1
- package/dist/extensions/anthropic/api.js +2 -2
- package/dist/extensions/anthropic/cli-auth-seam.js +1 -1
- package/dist/extensions/anthropic/cli-backend-api.js +2 -2
- package/dist/extensions/anthropic/cli-backend.js +1 -1
- package/dist/extensions/anthropic/cli-migration.js +1 -1
- package/dist/extensions/anthropic/cli-shared.js +1 -1
- package/dist/extensions/anthropic/config-defaults.js +1 -1
- package/dist/extensions/anthropic/contract-api.js +1 -1
- package/dist/extensions/anthropic/index.js +1 -1
- package/dist/extensions/anthropic/media-understanding-provider.js +1 -1
- package/dist/extensions/anthropic/provider-policy-api.js +1 -1
- package/dist/extensions/anthropic/register.runtime.js +1 -1
- package/dist/extensions/anthropic/setup-api.js +1 -1
- package/dist/extensions/anthropic/stream-wrappers.js +1 -1
- package/dist/extensions/anthropic/test-api.js +3 -3
- package/dist/extensions/anthropic-vertex/api.js +3 -3
- package/dist/extensions/anthropic-vertex/index.js +2 -2
- package/dist/extensions/anthropic-vertex/provider-catalog.js +1 -1
- package/dist/extensions/anthropic-vertex/region.js +1 -1
- package/dist/extensions/anthropic-vertex/setup-api.js +1 -1
- package/dist/extensions/arcee/index.js +2 -2
- 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 +3 -3
- package/dist/extensions/browser/browser-control-auth.js +1 -1
- package/dist/extensions/browser/browser-doctor.js +4 -4
- package/dist/extensions/browser/browser-host-inspection.js +1 -1
- package/dist/extensions/browser/browser-maintenance.js +2 -2
- package/dist/extensions/browser/browser-profiles.js +1 -1
- package/dist/extensions/browser/browser-runtime-api.js +11 -11
- package/dist/extensions/browser/index.js +1 -1
- package/dist/extensions/browser/plugin-registration.js +1 -1
- package/dist/extensions/browser/register.runtime.js +3 -3
- package/dist/extensions/browser/runtime-api.js +12 -12
- package/dist/extensions/browser/setup-api.js +2 -2
- package/dist/extensions/browser/test-support.js +1 -1
- package/dist/extensions/byteplus/index.js +3 -3
- package/dist/extensions/byteplus/video-generation-provider.js +1 -1
- package/dist/extensions/cerebras/index.js +1 -1
- package/dist/extensions/chutes/api.js +3 -3
- package/dist/extensions/chutes/index.js +7 -7
- package/dist/extensions/chutes/models.js +1 -1
- package/dist/extensions/chutes/onboard.js +2 -2
- package/dist/extensions/chutes/provider-catalog.js +1 -1
- package/dist/extensions/cloudflare-ai-gateway/api.js +1 -1
- package/dist/extensions/cloudflare-ai-gateway/catalog-provider.js +1 -1
- package/dist/extensions/cloudflare-ai-gateway/index.js +6 -6
- package/dist/extensions/deepinfra/api.js +3 -3
- package/dist/extensions/deepinfra/embedding-provider.js +1 -1
- package/dist/extensions/deepinfra/index.js +4 -4
- package/dist/extensions/deepinfra/media-understanding-provider.js +1 -1
- package/dist/extensions/deepinfra/memory-embedding-adapter.js +1 -1
- package/dist/extensions/deepinfra/video-generation-provider.js +1 -1
- package/dist/extensions/deepseek/index.js +1 -1
- package/dist/extensions/device-pair/api.js +2 -2
- package/dist/extensions/device-pair/index.js +5 -5
- package/dist/extensions/device-pair/notify.js +1 -1
- package/dist/extensions/device-pair/pair-command-approve.js +1 -1
- package/dist/extensions/device-pair/qr-image.js +2 -2
- package/dist/extensions/diffs/.kaijibot-runtime-deps-stamp.json +1 -1
- package/dist/extensions/diffs/index.js +1 -1
- package/dist/extensions/diffs/node_modules/.package-lock.json +3 -3
- package/dist/extensions/diffs/node_modules/typebox/build/format/email.mjs +1 -1
- package/dist/extensions/diffs/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
- package/dist/extensions/diffs/node_modules/typebox/package.json +1 -1
- package/dist/extensions/exa/index.js +1 -1
- package/dist/extensions/feishu/.kaijibot-runtime-deps-stamp.json +1 -1
- package/dist/extensions/feishu/api.js +16 -16
- package/dist/extensions/feishu/contract-api.js +2 -2
- package/dist/extensions/feishu/node_modules/.package-lock.json +3 -3
- package/dist/extensions/feishu/node_modules/typebox/build/format/email.mjs +1 -1
- package/dist/extensions/feishu/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
- package/dist/extensions/feishu/node_modules/typebox/package.json +1 -1
- package/dist/extensions/feishu/runtime-api.js +2 -2
- package/dist/extensions/feishu/security-contract-api.js +1 -1
- package/dist/extensions/feishu/session-key-api.js +1 -1
- package/dist/extensions/feishu/setup-api.js +1 -1
- package/dist/extensions/fireworks/index.js +1 -1
- package/dist/extensions/github-copilot/api.js +1 -1
- package/dist/extensions/github-copilot/index.js +6 -6
- package/dist/extensions/github-copilot/login.js +1 -1
- package/dist/extensions/github-copilot/models-defaults.js +1 -1
- package/dist/extensions/github-copilot/models.js +1 -1
- package/dist/extensions/github-copilot/register.runtime.js +4 -4
- package/dist/extensions/github-copilot/replay-policy.js +1 -1
- package/dist/extensions/google/api.js +1 -1
- package/dist/extensions/google/gemini-cli-provider.js +1 -1
- package/dist/extensions/google/image-generation-provider.js +1 -1
- package/dist/extensions/google/index.js +5 -5
- package/dist/extensions/google/media-understanding-provider.js +1 -1
- package/dist/extensions/google/music-generation-provider.js +1 -1
- package/dist/extensions/google/oauth-token-shared.js +1 -1
- package/dist/extensions/google/oauth.credentials.js +1 -1
- package/dist/extensions/google/oauth.flow.js +1 -1
- package/dist/extensions/google/oauth.js +2 -2
- package/dist/extensions/google/oauth.runtime.js +1 -1
- package/dist/extensions/google/oauth.settings.js +1 -1
- package/dist/extensions/google/oauth.token.js +1 -1
- package/dist/extensions/google/provider-models.js +1 -1
- package/dist/extensions/google/provider-registration.js +1 -1
- package/dist/extensions/google/runtime-api.js +2 -2
- package/dist/extensions/google/test-api.js +2 -2
- package/dist/extensions/google/video-generation-provider.js +1 -1
- package/dist/extensions/google/web-search-provider.js +1 -1
- package/dist/extensions/groq/index.js +1 -1
- package/dist/extensions/groq/media-understanding-provider.js +1 -1
- package/dist/extensions/groq/test-api.js +1 -1
- package/dist/extensions/huggingface/api.js +3 -3
- package/dist/extensions/huggingface/index.js +3 -3
- package/dist/extensions/huggingface/models.js +1 -1
- package/dist/extensions/huggingface/onboard.js +1 -1
- package/dist/extensions/huggingface/provider-catalog.js +2 -2
- package/dist/extensions/image-generation-core/api.js +2 -2
- package/dist/extensions/image-generation-core/runtime-api.js +2 -2
- package/dist/extensions/kilocode/api.js +2 -2
- package/dist/extensions/kilocode/index.js +6 -6
- package/dist/extensions/kilocode/onboard.js +2 -2
- package/dist/extensions/kilocode/provider-catalog.js +1 -1
- package/dist/extensions/kilocode/provider-models.js +1 -1
- package/dist/extensions/kilocode/shared.js +1 -1
- package/dist/extensions/kimi-coding/index.js +3 -3
- package/dist/extensions/kindle-portal/.kaijibot-runtime-deps-stamp.json +1 -1
- package/dist/extensions/kindle-portal/node_modules/.package-lock.json +3 -3
- package/dist/extensions/kindle-portal/node_modules/typebox/build/format/email.mjs +1 -1
- package/dist/extensions/kindle-portal/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
- package/dist/extensions/kindle-portal/node_modules/typebox/package.json +1 -1
- package/dist/extensions/knowledge-wiki/index.js +2 -2
- package/dist/extensions/litellm/index.js +1 -1
- package/dist/extensions/llm-task/index.js +1 -1
- package/dist/extensions/lmstudio/api.js +6 -6
- package/dist/extensions/lmstudio/index.js +2 -2
- package/dist/extensions/lmstudio/runtime-api.js +1 -1
- package/dist/extensions/media-understanding-core/runtime-api.js +2 -2
- package/dist/extensions/memory-core/cli-metadata.js +2 -2
- package/dist/extensions/memory-core/index.js +12 -12
- package/dist/extensions/memory-core/manager-runtime.js +1 -1
- package/dist/extensions/memory-core/runtime-api.js +5 -5
- package/dist/extensions/memory-lancedb/cli-metadata.js +1 -1
- package/dist/extensions/memory-lancedb/index.js +1 -1
- package/dist/extensions/microsoft/index.js +1 -1
- package/dist/extensions/microsoft/speech-provider.js +1 -1
- package/dist/extensions/microsoft/test-api.js +1 -1
- package/dist/extensions/microsoft/tts.js +1 -1
- package/dist/extensions/microsoft-foundry/auth.js +1 -1
- package/dist/extensions/microsoft-foundry/cli.js +1 -1
- package/dist/extensions/microsoft-foundry/index.js +1 -1
- package/dist/extensions/microsoft-foundry/onboard.js +2 -2
- package/dist/extensions/microsoft-foundry/provider.js +1 -1
- package/dist/extensions/microsoft-foundry/runtime.js +1 -1
- package/dist/extensions/microsoft-foundry/shared-runtime.js +2 -2
- package/dist/extensions/microsoft-foundry/shared.js +1 -1
- 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/test-api.js +2 -2
- package/dist/extensions/minimax/video-generation-provider.js +1 -1
- package/dist/extensions/minimax/web-search-provider.js +1 -1
- package/dist/extensions/mistral/embedding-provider.js +1 -1
- package/dist/extensions/mistral/index.js +2 -2
- package/dist/extensions/mistral/media-understanding-provider.js +1 -1
- package/dist/extensions/mistral/memory-embedding-adapter.js +3 -3
- package/dist/extensions/mistral/test-api.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/test-api.js +2 -2
- package/dist/extensions/moonshot/web-search-provider.js +1 -1
- package/dist/extensions/nvidia/index.js +1 -1
- package/dist/extensions/ollama/api.js +3 -3
- package/dist/extensions/ollama/index.js +6 -6
- package/dist/extensions/ollama/runtime-api.js +2 -2
- package/dist/extensions/ollama/web-search-provider.js +1 -1
- package/dist/extensions/openai/api.js +3 -3
- package/dist/extensions/openai/image-generation-provider.js +1 -1
- package/dist/extensions/openai/index.js +9 -9
- package/dist/extensions/openai/media-understanding-provider.js +1 -1
- package/dist/extensions/openai/openai-codex-auth-identity.js +1 -1
- package/dist/extensions/openai/openai-codex-cli-auth.js +1 -1
- package/dist/extensions/openai/openai-codex-provider.js +1 -1
- package/dist/extensions/openai/openai-codex-shared.js +1 -1
- package/dist/extensions/openai/openai-provider.js +1 -1
- package/dist/extensions/openai/prompt-overlay.js +1 -1
- package/dist/extensions/openai/realtime-provider-shared.js +1 -1
- package/dist/extensions/openai/realtime-transcription-provider.js +1 -1
- package/dist/extensions/openai/realtime-voice-provider.js +1 -1
- package/dist/extensions/openai/register.runtime.js +8 -8
- package/dist/extensions/openai/shared.js +1 -1
- package/dist/extensions/openai/speech-provider.js +1 -1
- package/dist/extensions/openai/test-api.js +5 -5
- package/dist/extensions/openai/transport-policy.js +1 -1
- package/dist/extensions/openai/video-generation-provider.js +1 -1
- package/dist/extensions/opencode/index.js +3 -3
- package/dist/extensions/opencode-go/index.js +2 -2
- package/dist/extensions/openrouter/api.js +2 -2
- package/dist/extensions/openrouter/image-generation-provider.js +1 -1
- package/dist/extensions/openrouter/index.js +6 -6
- package/dist/extensions/openrouter/media-understanding-provider.js +1 -1
- package/dist/extensions/openrouter/music-generation-provider.js +1 -1
- package/dist/extensions/openrouter/test-api.js +3 -3
- package/dist/extensions/openrouter/video-generation-provider.js +1 -1
- package/dist/extensions/openshell/index.js +4 -4
- package/dist/extensions/qianfan/index.js +1 -1
- package/dist/extensions/qwen/index.js +3 -3
- package/dist/extensions/qwen/media-understanding-provider.js +1 -1
- package/dist/extensions/qwen/test-api.js +2 -2
- package/dist/extensions/qwen/video-generation-provider.js +1 -1
- package/dist/extensions/runway/index.js +1 -1
- package/dist/extensions/runway/video-generation-provider.js +1 -1
- package/dist/extensions/sglang/api.js +2 -2
- package/dist/extensions/sglang/index.js +2 -2
- package/dist/extensions/sglang/models.js +1 -1
- package/dist/extensions/sherpa-speech/asr.js +1 -1
- package/dist/extensions/sherpa-speech/engine.js +1 -1
- package/dist/extensions/sherpa-speech/index.js +1 -1
- package/dist/extensions/speech-core/api.js +2 -2
- package/dist/extensions/speech-core/runtime-api.js +4 -4
- package/dist/extensions/stepfun/index.js +2 -2
- package/dist/extensions/talk-voice/index.js +3 -3
- package/dist/extensions/tavily/index.js +1 -1
- package/dist/extensions/together/index.js +1 -1
- package/dist/extensions/together/video-generation-provider.js +1 -1
- package/dist/extensions/venice/api.js +3 -3
- package/dist/extensions/venice/index.js +5 -5
- package/dist/extensions/venice/models.js +1 -1
- package/dist/extensions/venice/onboard.js +2 -2
- package/dist/extensions/venice/provider-catalog.js +1 -1
- package/dist/extensions/vercel-ai-gateway/index.js +1 -1
- package/dist/extensions/vllm/api.js +2 -2
- package/dist/extensions/vllm/index.js +2 -2
- package/dist/extensions/vllm/models.js +1 -1
- package/dist/extensions/vllm/register.runtime.js +2 -2
- package/dist/extensions/volcengine/index.js +2 -2
- package/dist/extensions/vydra/image-generation-provider.js +1 -1
- package/dist/extensions/vydra/index.js +5 -5
- package/dist/extensions/vydra/shared.js +1 -1
- package/dist/extensions/vydra/speech-provider.js +1 -1
- package/dist/extensions/vydra/video-generation-provider.js +1 -1
- package/dist/extensions/webhooks/.kaijibot-runtime-deps-stamp.json +1 -1
- package/dist/extensions/webhooks/api.js +1 -1
- package/dist/extensions/webhooks/index.js +3 -3
- package/dist/extensions/webhooks/runtime-api.js +1 -1
- package/dist/extensions/wechat/api.js +3 -3
- package/dist/extensions/xai/api.js +5 -5
- package/dist/extensions/xai/code-execution.js +3 -3
- package/dist/extensions/xai/index.js +9 -9
- package/dist/extensions/xai/model-definitions.js +1 -1
- package/dist/extensions/xai/onboard.js +1 -1
- package/dist/extensions/xai/provider-catalog.js +1 -1
- package/dist/extensions/xai/provider-models.js +1 -1
- package/dist/extensions/xai/setup-api.js +1 -1
- package/dist/extensions/xai/video-generation-provider.js +1 -1
- package/dist/extensions/xai/web-search.js +1 -1
- package/dist/extensions/xai/x-search.js +3 -3
- package/dist/extensions/xiaomi/index.js +1 -1
- package/dist/extensions/zai/index.js +5 -5
- package/dist/extensions/zai/media-understanding-provider.js +1 -1
- package/dist/extensions/zai/test-api.js +1 -1
- package/dist/extra-params-CEZLNZPM.js +295 -0
- package/dist/format-P9xNDyfD.js +245 -0
- package/dist/fragment-collector-D6OalgG0.js +189 -0
- package/dist/gateway-cli-Zfvn259p.js +1532 -0
- package/dist/gateway-install-token-6z725yP4.js +284 -0
- package/dist/gateway-rpc-BIq75xob.js +14 -0
- package/dist/gateway-rpc.runtime-qaUC59kw.js +23 -0
- package/dist/gateway-rpc.runtime.js +1 -1
- package/dist/gemini-cli-provider-DapCuX8Q.js +106 -0
- package/dist/gemini-web-search-provider-qckYFHgT.js +167 -0
- package/dist/get-reply-from-config.runtime-DHsGpgGI.js +2 -0
- package/dist/get-reply-from-config.runtime.js +1 -1
- package/dist/gmail-setup-utils-Cc3pRzTO.js +422 -0
- package/dist/health-3b-YI19K.js +579 -0
- package/dist/health-MLtfjMov.js +2 -0
- package/dist/heartbeat-runner-BUj0aHm6.js +4 -0
- package/dist/heartbeat-runner-CsnBv3An.js +1365 -0
- package/dist/heartbeat-runner.runtime-DYHZ3Vol.js +2 -0
- package/dist/heartbeat-runner.runtime.js +1 -1
- package/dist/help-ktSd2tag.js +76 -0
- package/dist/hooks-cli-IZb2tmWn.js +364 -0
- package/dist/image-C3lHN8WH.js +152 -0
- package/dist/image-generation-core-Csa-tOLR.js +17 -0
- package/dist/image-generation-core.auth.runtime-DWfzUU3N.js +2 -0
- package/dist/image-generation-core.auth.runtime.js +1 -1
- package/dist/image-generation-provider-Bq81bEDF.js +94 -0
- package/dist/image-generation-provider-D9rV0jKg.js +280 -0
- package/dist/image-generation-provider-DLxx1bzz.js +130 -0
- package/dist/image-generation-provider-DtYtLZ5X.js +136 -0
- package/dist/image-generation-provider-DxkBVWXc.js +163 -0
- package/dist/image-generation-runtime-BSjvNi3e.js +2 -0
- package/dist/image-runtime-DiMm78ho.js +7 -0
- package/dist/inbound-reply-dispatch-vAjY1w2F.js +73 -0
- package/dist/inbound.runtime-CRF3jMe0.js +3 -0
- package/dist/inbound.runtime-DTPuWSKr.js +4 -0
- package/dist/inbound.runtime.js +1 -1
- package/dist/index.js +2 -2
- package/dist/infra-runtime-D3jjt6RI.js +25 -0
- package/dist/ingest-DZbARiPc.js +2 -0
- package/dist/ingest-gzQEKaUE.js +842 -0
- package/dist/io-NwOu0Lqq.js +7188 -0
- package/dist/io-p7f7Dzgz.js +5 -0
- package/dist/kaijibot-tools-DlPDuhB1.js +9434 -0
- package/dist/kaijibot-tools.runtime-Cme2o8P6.js +2 -0
- package/dist/kaijibot-tools.runtime.js +1 -1
- package/dist/kimi-web-search-provider-Ccz-6FOv.js +308 -0
- package/dist/library-CNY5LwdW.js +45 -0
- package/dist/lifecycle-DPisznBr.js +51 -0
- package/dist/lifecycle-core-DHpL48zF.js +422 -0
- package/dist/list.runtime-BGQLMIEV.js +9 -0
- package/dist/list.runtime-rNaKvGI6.js +12 -0
- package/dist/list.runtime.js +1 -1
- package/dist/llm-engine-CJ4a8si7.js +2 -0
- package/dist/llm-engine-JflSw21y.js +1792 -0
- package/dist/llm-extractor-f_T1e84b.js +445 -0
- package/dist/llm-slug-generator.js +2 -2
- package/dist/load-context-BgiRixkE.js +51 -0
- package/dist/logging-BmlPHvHz.js +13 -0
- package/dist/logging-i6p97HMj.js +2 -0
- package/dist/login-BCtkm5rk.js +108 -0
- package/dist/logs-cli-ObIjoAas.js +264 -0
- package/dist/logs-cli.runtime-BFjo2k4n.js +2 -0
- package/dist/logs-cli.runtime.js +1 -1
- package/dist/manager-CWqmCOrL.js +2049 -0
- package/dist/manager-YA9gsC3-.js +3314 -0
- package/dist/mcp/plugin-tools-serve.js +3 -3
- package/dist/mcp-cli-4snhlJll.js +733 -0
- package/dist/mcp-config-BorcRx6O.js +115 -0
- package/dist/media-runtime-we0ajcYl.js +312 -0
- package/dist/media-understanding-provider-3Ttl6hmp.js +18 -0
- package/dist/media-understanding-provider-BGTcMbZI.js +13 -0
- package/dist/media-understanding-provider-BWZtBNix.js +30 -0
- package/dist/media-understanding-provider-CLJBFDyf.js +123 -0
- package/dist/media-understanding-provider-CZ0oRDnO.js +69 -0
- package/dist/media-understanding-provider-CfBvdveE.js +112 -0
- package/dist/media-understanding-provider-D6Ei6zjV.js +18 -0
- package/dist/media-understanding-provider-DEbLZtur.js +37 -0
- package/dist/media-understanding-provider-DysTPulI.js +14 -0
- package/dist/media-understanding-provider-guIrycoj.js +21 -0
- package/dist/media-understanding-provider-sqqt3Zo1.js +67 -0
- package/dist/media-understanding-runtime-DIH8yX06.js +2 -0
- package/dist/media-understanding-zIdRKTHF.js +83 -0
- package/dist/memory-CEPz51C1.js +242 -0
- package/dist/memory-Dz9LyrwM.js +3 -0
- package/dist/memory-core-host-engine-embeddings-D_hioQXv.js +2 -0
- package/dist/memory-core-host-engine-foundation-1Abnrvzg.js +11 -0
- package/dist/memory-core-host-runtime-cli-CPpWR4jD.js +9 -0
- package/dist/memory-core-host-runtime-core-QOAE1eXJ.js +8 -0
- package/dist/memory-embedding-adapter-CJMHQ4fD.js +33 -0
- package/dist/memory-host-search.runtime-CCL0QyRa.js +2 -0
- package/dist/memory-host-search.runtime.js +1 -1
- package/dist/memory-index-BaKGqStn.js +2 -0
- package/dist/memory-index-Dq16t3Le.js +514 -0
- package/dist/memory-runtime-Cr2ycPVC.js +2 -0
- package/dist/memory-runtime-DuWAywa6.js +26 -0
- package/dist/message-B59-6tOr.js +223 -0
- package/dist/message-action-runner-CD2L-ZBQ.js +2 -0
- package/dist/message-action-runner-y-EYEp0n.js +1628 -0
- package/dist/message.config.runtime-NCa2v5Ci.js +3 -0
- package/dist/message.config.runtime.js +1 -1
- package/dist/message.gateway.runtime-Ba2cmeG0.js +2 -0
- package/dist/message.gateway.runtime.js +1 -1
- package/dist/metadata-registry-loader-BAAhCgIz.js +2 -0
- package/dist/metadata-registry-loader-D7YsnsL7.js +15 -0
- package/dist/minimax-vlm-CRQ1qjBy.js +183 -0
- package/dist/minimax-web-search-provider-CBq2_5UU.js +165 -0
- package/dist/mmr-CqmAMXIW.js +146 -0
- package/dist/model-NNxPja4R.js +630 -0
- package/dist/model-auth-BCNvl8s6.js +427 -0
- package/dist/model-auth-label-B0iZbvPM.js +45 -0
- package/dist/model-catalog-B_WMQ0w_.js +204 -0
- package/dist/model-definitions-YQ1lzfH1.js +258 -0
- package/dist/model-picker-ByUUyua6.js +3 -0
- package/dist/model-picker-D2NwBUVu.js +500 -0
- package/dist/model-picker.runtime-BLIC1v4k.js +15 -0
- package/dist/model-picker.runtime.js +1 -1
- package/dist/model-selection-BNkt6VsY.js +381 -0
- package/dist/model-suppression-BLpblK4C.js +28 -0
- package/dist/model-suppression.runtime-CzgXh3-Q.js +7 -0
- package/dist/model-suppression.runtime.js +1 -1
- package/dist/models-11Amlqm7.js +2584 -0
- package/dist/models-BAPi-xJJ.js +2 -0
- package/dist/models-BUxoFu33.js +47 -0
- package/dist/models-Ch34kBry.js +18 -0
- package/dist/models-CxT1_oJh.js +157 -0
- package/dist/models-DdsCg0Z3.js +18 -0
- package/dist/models-cli-DyOOLtYl.js +198 -0
- package/dist/models-config-C91hdcPk.js +900 -0
- package/dist/models-config.providers.secrets-CAQfFlJs.js +299 -0
- package/dist/models-jeG3zz29.js +555 -0
- package/dist/models-uX_1Gq3N.js +760 -0
- package/dist/models.fetch-CBAxXkYq.js +518 -0
- package/dist/monitor-DAF8Gyq4.js +4435 -0
- package/dist/monitor-DSKG-_yl.js +1023 -0
- package/dist/music-generation-provider-BnrTAmbY.js +142 -0
- package/dist/music-generation-provider-CEN-hiuw.js +238 -0
- package/dist/music-generation-provider-CltAphNV.js +169 -0
- package/dist/node-cli-DiZrvwCr.js +2374 -0
- package/dist/nodes-cli-CHIEN-F1.js +1046 -0
- package/dist/nodes-utils-DsRDUdkI.js +196 -0
- package/dist/notify-CLlD_xFa.js +305 -0
- package/dist/oauth-BH1NzJxX.js +57 -0
- package/dist/oauth-oo4i0YoK.js +152 -0
- package/dist/oauth-token-shared-DQSx2gNJ.js +28 -0
- package/dist/oauth.credentials-Bry_dis_.js +165 -0
- package/dist/oauth.flow-BHm8lbRc.js +122 -0
- package/dist/oauth.settings-BEQZQI_l.js +44 -0
- package/dist/oauth.token-CrxxQ__U.js +43 -0
- package/dist/onboard-7nVuWCbc.js +25 -0
- package/dist/onboard-BR4C6q_p.js +25 -0
- package/dist/onboard-CLJvlk15.js +621 -0
- package/dist/onboard-CdxRLmEw2.js +58 -0
- package/dist/onboard-ClstIj39.js +29 -0
- package/dist/onboard-DCvok686.js +25 -0
- package/dist/onboard-RcjANnyK.js +312 -0
- package/dist/onboard-custom-utbZx3tp.js +2 -0
- package/dist/onboard-custom-zmMvywOs.js +647 -0
- package/dist/onboard-helpers-DptwxvqO.js +223 -0
- package/dist/onboard-helpers-hUiLSHkd.js +5 -0
- package/dist/onboard-remote-BLFcjcH2.js +2 -0
- package/dist/onboard-remote-D21HhC2v.js +193 -0
- package/dist/onboard-search-D-BZAp6B.js +324 -0
- package/dist/onboard-skills-B90sl6kA.js +134 -0
- package/dist/onboard-skills-DBZJuUNt.js +2 -0
- package/dist/openai-codex-auth-identity-DJ-yiC5N.js +45 -0
- package/dist/openai-codex-cli-auth-BdZB_Fn0.js +57 -0
- package/dist/openai-codex-provider-D23flY_z.js +299 -0
- package/dist/openai-codex-shared-7LLW54Av.js +6 -0
- package/dist/openai-provider-xmL-RBDi.js +283 -0
- package/dist/openai-transport-stream-M1bujvhd.js +1632 -0
- package/dist/operator-approvals-client-DNHRZj38.js +68 -0
- package/dist/order-DFWeiLxK.js +794 -0
- package/dist/pair-command-approve-CSw5-2fz.js +34 -0
- package/dist/pairing-cli-WXk-duET.js +118 -0
- package/dist/persistent-bindings.lifecycle-CvUywK5_.js +94 -0
- package/dist/pi-bundle-mcp-tools-CX0SFgbF.js +709 -0
- package/dist/pi-embedded-BycqI-F6.js +2 -0
- package/dist/pi-embedded-CROyZQKw.js +6 -0
- package/dist/pi-embedded-runner-DvjFL5Sg.js +8350 -0
- package/dist/pi-embedded-subscribe.handlers.compaction.runtime-DAY2Idkx.js +23 -0
- package/dist/pi-embedded-subscribe.handlers.compaction.runtime.js +1 -1
- package/dist/pi-embedded.runtime-CnpLMfdZ.js +5 -0
- package/dist/pi-embedded.runtime.js +1 -1
- package/dist/pi-model-discovery-eCOzFFEF.js +232 -0
- package/dist/pi-tools.before-tool-call.runtime-DxhFk59d.js +354 -0
- package/dist/pi-tools.before-tool-call.runtime.js +1 -1
- package/dist/plugin-enabled-CHyNN_TN.js +71 -0
- package/dist/plugin-install-config-policy-AxFoCFZw.js +137 -0
- package/dist/plugin-registration-DNzK0hY5.js +23 -0
- package/dist/plugin-registry-CtFzpQUT.js +3 -0
- package/dist/plugin-registry-loader-2DtlC05M.js +22 -0
- package/dist/plugin-registry-rGAVZ04A.js +2 -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.js +3 -3
- package/dist/plugin-sdk/agent-harness-runtime.js +6 -6
- package/dist/plugin-sdk/agent-runtime.js +9 -9
- package/dist/plugin-sdk/approval-client-runtime.js +2 -2
- package/dist/plugin-sdk/approval-gateway-runtime.js +2 -2
- package/dist/plugin-sdk/approval-handler-runtime.js +3 -3
- package/dist/plugin-sdk/approval-reply-runtime.js +2 -2
- package/dist/plugin-sdk/approval-runtime.js +4 -4
- package/dist/plugin-sdk/browser-config-runtime.js +2 -2
- package/dist/plugin-sdk/browser-config.js +2 -2
- package/dist/plugin-sdk/browser-control-auth.js +1 -1
- package/dist/plugin-sdk/browser-node-runtime.js +3 -3
- package/dist/plugin-sdk/browser-profiles.js +1 -1
- package/dist/plugin-sdk/browser-setup-tools.js +2 -2
- package/dist/plugin-sdk/browser-support.js +7 -7
- package/dist/plugin-sdk/channel-core.js +2 -2
- package/dist/plugin-sdk/channel-inbound.js +3 -3
- package/dist/plugin-sdk/command-auth.js +4 -4
- package/dist/plugin-sdk/compat.js +2 -2
- package/dist/plugin-sdk/config-mutation.js +4 -4
- package/dist/plugin-sdk/config-runtime.js +6 -6
- package/dist/plugin-sdk/config-schema.js +1 -1
- package/dist/plugin-sdk/conversation-binding-runtime.js +1 -1
- package/dist/plugin-sdk/conversation-runtime.js +4 -4
- package/dist/plugin-sdk/core.js +3 -3
- package/dist/plugin-sdk/direct-dm.js +1 -1
- package/dist/plugin-sdk/gateway-method-runtime.js +1 -1
- package/dist/plugin-sdk/gateway-runtime.js +1 -1
- package/dist/plugin-sdk/generate-text.js +1 -1
- package/dist/plugin-sdk/image-generation-core.js +2 -2
- package/dist/plugin-sdk/image-generation-runtime.js +2 -2
- package/dist/plugin-sdk/inbound-reply-dispatch.js +1 -1
- package/dist/plugin-sdk/index.js +1 -1
- package/dist/plugin-sdk/infra-runtime.js +4 -4
- 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 +5 -5
- package/dist/plugin-sdk/media-understanding-runtime.js +2 -2
- package/dist/plugin-sdk/media-understanding.js +2 -2
- package/dist/plugin-sdk/memory-core-host-engine-embeddings.js +2 -2
- package/dist/plugin-sdk/memory-core-host-engine-foundation.js +2 -2
- 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.js +5 -5
- package/dist/plugin-sdk/memory-host-core.js +3 -3
- package/dist/plugin-sdk/memory-host-search.js +1 -1
- package/dist/plugin-sdk/models-provider-runtime.js +1 -1
- package/dist/plugin-sdk/plugin-test-runtime.js +3 -3
- package/dist/plugin-sdk/provider-auth-api-key.js +4 -4
- package/dist/plugin-sdk/provider-auth.js +7 -7
- package/dist/plugin-sdk/provider-entry.js +1 -1
- package/dist/plugin-sdk/provider-setup.js +2 -2
- package/dist/plugin-sdk/provider-stream-family.js +3 -3
- package/dist/plugin-sdk/provider-stream.js +2 -2
- package/dist/plugin-sdk/provider-test-contracts.js +2 -2
- package/dist/plugin-sdk/provider-transport-runtime.js +1 -1
- package/dist/plugin-sdk/reply-dispatch-runtime.js +1 -1
- package/dist/plugin-sdk/reply-runtime.js +7 -7
- package/dist/plugin-sdk/runtime-secret-resolution.js +1 -1
- package/dist/plugin-sdk/runtime.js +3 -3
- package/dist/plugin-sdk/sandbox.js +2 -2
- package/dist/plugin-sdk/self-hosted-provider-setup.js +1 -1
- package/dist/plugin-sdk/session-store-runtime.js +2 -2
- package/dist/plugin-sdk/simple-completion-runtime.js +1 -1
- package/dist/plugin-sdk/skill-commands-runtime.js +1 -1
- package/dist/plugin-sdk/speech-core.js +1 -1
- package/dist/plugin-sdk/src/cognitive/feedback/collector.d.ts +21 -0
- package/dist/plugin-sdk/src/cognitive/persona/lifecycle.d.ts +3 -6
- package/dist/plugin-sdk/src/cognitive/types.d.ts +14 -0
- package/dist/plugin-sdk/src/config/types.cognitive.d.ts +2 -0
- package/dist/plugin-sdk/src/config/zod-schema.cognitive.d.ts +2 -0
- package/dist/plugin-sdk/src/config/zod-schema.d.ts +1 -0
- package/dist/plugin-sdk/testing.js +5 -5
- package/dist/plugin-sdk/text-runtime.js +2 -2
- package/dist/plugin-sdk/video-generation-core.js +1 -1
- package/dist/plugin-sdk/video-generation-runtime.js +1 -1
- package/dist/plugin-service-ByhemcPW.js +2494 -0
- package/dist/plugins/provider-discovery.runtime.js +1 -1
- package/dist/plugins/provider-runtime.runtime.js +1 -1
- package/dist/plugins/runtime/index.js +1 -1
- package/dist/plugins-cli-Bsu-vzeD.js +576 -0
- package/dist/plugins-command-helpers-DHYkcqua.js +117 -0
- package/dist/plugins-install-persist-C8eGd_C5.js +121 -0
- package/dist/plugins-update-command-3xt3Uqf8.js +1009 -0
- package/dist/policy-D-ZKSMmN.js +172 -0
- package/dist/preemptive-compaction-DBfSd-op.js +430 -0
- package/dist/proactive-scheduler-CsHZHnLk.js +1535 -0
- package/dist/probe-CWzUPp-f.js +426 -0
- package/dist/probe-QRfkrTQp.js +54 -0
- package/dist/probe-auth-DG3q8vB9.js +69 -0
- package/dist/probe-auth-GBOKLPAd.js +3 -0
- package/dist/profiles-CBddrdQK.js +117 -0
- package/dist/program-g6p3Qeig.js +111 -0
- package/dist/prompt-overlay-CTwbv1jO.js +72 -0
- package/dist/prompt-select-styled-Cgy0KIgT.js +5305 -0
- package/dist/provider-B_TyrVqo.js +70 -0
- package/dist/provider-api-key-auth-DsEmjrKm.js +113 -0
- package/dist/provider-api-key-auth.runtime-DnU922Pm.js +14 -0
- package/dist/provider-api-key-auth.runtime.js +1 -1
- package/dist/provider-auth-B0NxCABI.js +36 -0
- package/dist/provider-auth-api-key-BRkYGkki.js +5 -0
- package/dist/provider-auth-choice-BU5MwS9n.js +134 -0
- package/dist/provider-auth-choice-preference-BjTvWslj.js +62 -0
- package/dist/provider-auth-choice.runtime-B8ZRr0Ji.js +2 -0
- package/dist/provider-auth-choice.runtime-DIN9GqRk.js +14 -0
- package/dist/provider-auth-choice.runtime.js +1 -1
- package/dist/provider-auth-guidance-BmbcHSR7.js +34 -0
- package/dist/provider-auth-helpers-BHAUl4Gr.js +168 -0
- package/dist/provider-catalog-BL8_CAyj.js +11 -0
- package/dist/provider-catalog-BRtoWqwn.js +11 -0
- package/dist/provider-catalog-BeddZRA_.js +12 -0
- package/dist/provider-catalog-Dl5yMnFQ.js +17 -0
- package/dist/provider-catalog-Doxz6-g3.js +56 -0
- package/dist/provider-catalog-nJImUuqB.js +26 -0
- package/dist/provider-dispatcher-D2GbNyfD.js +22 -0
- package/dist/provider-entry-B01Usrgw.js +97 -0
- package/dist/provider-flow-DgiCMoEf.js +66 -0
- package/dist/provider-models-CjNZS5bS.js +35 -0
- package/dist/provider-models-KjFLrk3V.js +119 -0
- package/dist/provider-models-vPWkBVJC.js +116 -0
- package/dist/provider-registration-BKyn4HAU.js +238 -0
- package/dist/provider-registration-Dtxvk5CC.js +57 -0
- package/dist/provider-runtime-DOtN11v9.js +2 -0
- package/dist/provider-runtime-DSAVX2DR.js +366 -0
- package/dist/provider-runtime.runtime-kKhVhqLz.js +26 -0
- package/dist/provider-runtime.runtime.js +1 -1
- package/dist/provider-self-hosted-setup-l_z2VcmU.js +249 -0
- package/dist/provider-setup-Bf_9tp4f.js +2 -0
- package/dist/provider-stream-BdikYSRa.js +285 -0
- package/dist/provider-stream-family-DSm3KbQw.js +2 -0
- package/dist/provider-usage-BGu0-R4j.js +289 -0
- package/dist/provider-usage-lgVGEKOt.js +3 -0
- package/dist/provider-wizard-BLwU3k7w.js +166 -0
- package/dist/providers.runtime-C0Xkoksw.js +125 -0
- package/dist/providers.runtime.js +1 -1
- package/dist/proxy-stream-wrappers-CIRRoMpa.js +480 -0
- package/dist/push-apns-BuLz1QrB.js +1061 -0
- package/dist/pw-ai-Ld88tf39.js +2268 -0
- package/dist/qmd-manager-kG_qjIil.js +1799 -0
- package/dist/qr-cli-CsNdevN-.js +359 -0
- package/dist/qr-image-CJ2mMFzI.js +2 -0
- package/dist/queue-fniCZ6ND.js +636 -0
- package/dist/realtime-provider-shared-B2y3nIjr.js +21 -0
- package/dist/realtime-transcription-provider-BYeb_Pdh.js +180 -0
- package/dist/realtime-voice-provider-Cs5kAI5o.js +342 -0
- package/dist/record-shared-vbhlkLLm.js +10 -0
- package/dist/refresh-DgMFD0Y0.js +115 -0
- package/dist/region-BOx9--Jp.js +74 -0
- package/dist/register.agent-i88emBrg.js +241 -0
- package/dist/register.backup-PaaKiScO.js +234 -0
- package/dist/register.configure-DOwB_pGJ.js +15 -0
- package/dist/register.maintenance-CYchYFw1.js +443 -0
- package/dist/register.message-DCzLrhHI.js +601 -0
- package/dist/register.onboard-La1ps81U.js +83 -0
- package/dist/register.runtime-Br9LK2gh.js +81 -0
- package/dist/register.runtime-CgbjcVmK.js +343 -0
- package/dist/register.runtime.js +1 -1
- package/dist/register.setup-BwGIBl0j.js +104 -0
- package/dist/register.status-health-sessions-Bg-JiJ0c.js +1211 -0
- package/dist/register.subclis-BvRTTvO6.js +3 -0
- package/dist/register.subclis-C72FAl_s.js +232 -0
- package/dist/repair-DUb-NpH_.js +112 -0
- package/dist/replay-policy-8aUdDKqI.js +8 -0
- package/dist/reply-SolAjGzg.js +3523 -0
- package/dist/reply.runtime-BzJw9WP7.js +2 -0
- package/dist/reply.runtime.js +1 -1
- package/dist/resolve-b0jc4sM3.js +280 -0
- package/dist/restart-CReI1iMn.js +454 -0
- package/dist/root-help-DOYfXVGX.js +44 -0
- package/dist/route-reply-Bsd_X1hM.js +141 -0
- package/dist/route-reply.runtime-0EDNxcfO.js +2 -0
- package/dist/route-reply.runtime.js +1 -1
- package/dist/rpc-C4VoC6lx.js +61 -0
- package/dist/rpc.runtime-CrjwpfEG.js +21 -0
- package/dist/rpc.runtime.js +1 -1
- package/dist/run-main-BqkJC57m.js +453 -0
- package/dist/run-wait-KirpkWGm.js +118 -0
- package/dist/runner-BVkPQnQI.js +1497 -0
- package/dist/runs-Djzm6zWd.js +495 -0
- package/dist/runtime-6nDEFb75.js +72 -0
- package/dist/runtime-BU-qtT4-.js +107 -0
- package/dist/runtime-BYFm5p1W.js +725 -0
- package/dist/runtime-Bw9f54EP.js +355 -0
- package/dist/runtime-D2tXO42J2.js +242 -0
- package/dist/runtime-DOWgnTkX.js +191 -0
- package/dist/runtime-DObmMc6X.js +253 -0
- package/dist/runtime-DoFRWRgY.js +9 -0
- package/dist/runtime-Dt-rXRTW.js +2 -0
- package/dist/runtime-api-BtobjiSx.js +12 -0
- package/dist/runtime-api-CjjNrjOu2.js +2 -0
- package/dist/runtime-api-D7fKSLcI.js +3 -0
- package/dist/runtime-embedded-pi.runtime-2nLOBaP4.js +3 -0
- package/dist/runtime-embedded-pi.runtime.js +1 -1
- package/dist/runtime-internal-BBIguEmO.js +2 -0
- package/dist/runtime-model-auth.runtime-Cgx5HiVv.js +39 -0
- package/dist/runtime-model-auth.runtime.js +1 -1
- package/dist/runtime-oxFh0OA-.js +2 -0
- package/dist/runtime-plugins-zeEZH6Ee.js +69 -0
- package/dist/runtime-prepare.runtime-C1hoi3Pj.js +80 -0
- package/dist/runtime-prepare.runtime.js +1 -1
- package/dist/runtime-provider-CXi4BTPW.js +21 -0
- package/dist/runtime-r3Ke_KuH.js +200 -0
- package/dist/runtime-registry-loader-471RbKgH.js +2 -0
- package/dist/runtime-registry-loader-Dov85dVR.js +58 -0
- package/dist/runtime-schema-DUetufoV.js +28395 -0
- package/dist/runtime-shared-BGttaPX3.js +249 -0
- package/dist/runtime-taskflow-CXpDzGWH.js +250 -0
- package/dist/runtime-web-channel-plugin-Dyt-ZWxm.js +215 -0
- package/dist/runtime-web-tools-CXeVnAOE.js +1467 -0
- package/dist/runtime-web-tools-fallback.runtime-B5P96RjD.js +9 -0
- package/dist/runtime-web-tools-fallback.runtime.js +1 -1
- package/dist/sandbox-B7Mdkad9.js +2586 -0
- package/dist/sandbox-Bkj7NfH_.js +4 -0
- package/dist/sandbox-cli-BMrDh7ip.js +447 -0
- package/dist/secrets-cli-CDO_S3rr.js +2114 -0
- package/dist/security-audit-D4tdLi7R.js +34 -0
- package/dist/security-cli-BtMEiNIM.js +486 -0
- package/dist/semantic-dedup-BGgf2SFR.js +95 -0
- package/dist/send-C5pIHqBv.js +993 -0
- package/dist/send-media-Dcmyu6Y-.js +2123 -0
- package/dist/server-D0ZKpih4.js +77 -0
- package/dist/server-context-BekzVd0R.js +4164 -0
- package/dist/server-iDg2UFb7.js +13 -0
- package/dist/server-methods-MPVSmE3_.js +11937 -0
- package/dist/server-middleware-FqXPNqqT.js +110 -0
- package/dist/server-node-events-C1iGhswC.js +451 -0
- package/dist/server.impl-CFp5ICor.js +19766 -0
- package/dist/session-C-0F1BlP.js +48 -0
- package/dist/session-conversation-Ckza03tl.js +27 -0
- package/dist/session-cost-usage-Dnbtqvv7.js +648 -0
- package/dist/session-cost-usage-iTVG22AO.js +2 -0
- package/dist/session-file-CiJXAZP4.js +44 -0
- package/dist/session-key-6G1LpIon.js +65 -0
- package/dist/session-meta-knhthO95.js +109 -0
- package/dist/session-override-CGqy8cfR.js +103 -0
- package/dist/session-reset-model.runtime-VxsiNT-r.js +120 -0
- package/dist/session-reset-model.runtime.js +1 -1
- package/dist/session-reset-service-6oOKZMC9.js +474 -0
- package/dist/session-subagent-reactivation.runtime-DzMHk0SH.js +2 -0
- package/dist/session-subagent-reactivation.runtime.js +1 -1
- package/dist/session-system-events-BifSkL6x.js +63 -0
- package/dist/session-tab-registry-DR0gRhet.js +553 -0
- package/dist/session-updates-CHOc_4vH.js +234 -0
- package/dist/session-updates.runtime-DsHKjhyM.js +2 -0
- package/dist/session-updates.runtime.js +1 -1
- package/dist/session-utils-GLg54NBi.js +930 -0
- package/dist/sessions-BxOkBx-e.js +45 -0
- package/dist/sessions-C6oolVsU.js +231 -0
- package/dist/sessions-D6_b32XT.js +2 -0
- package/dist/sessions.runtime-Dtv72AMI.js +2 -0
- package/dist/sessions.runtime.js +1 -1
- package/dist/setup-DOX0TZju.js +505 -0
- package/dist/setup-DwqTuGTp.js +329 -0
- package/dist/setup-surface-Ore2Ehcn.js +586 -0
- package/dist/setup.finalize-hAPbyOmw.js +436 -0
- package/dist/setup.gateway-config-DteoOy8F.js +246 -0
- package/dist/shared-CLjMam2L.js +36 -0
- package/dist/shared-DGIkRU6J.js +218 -0
- package/dist/shared-DUnO9yTD.js +175 -0
- package/dist/shared-DeBJWig-.js +137 -0
- package/dist/shared-igYZ1cFQ.js +224 -0
- package/dist/shared-runtime-cWVnVIl5.js +7 -0
- package/dist/short-term-promotion-BhxerFzv.js +1631 -0
- package/dist/simple-completion-runtime-Bv1VtWSA.js +131 -0
- package/dist/simple-completion-transport-CLqa5Iyl.js +32 -0
- package/dist/skill-commands-D02-U6zf.js +82 -0
- package/dist/skill-commands.runtime-J2XiyESs.js +2 -0
- package/dist/skill-commands.runtime.js +1 -1
- package/dist/skills-BI8fjdW_.js +4 -0
- package/dist/skills-C6n71k5r.js +1075 -0
- package/dist/skills-cli-zp3lOjti.js +382 -0
- package/dist/skills-install-DlqA6nec.js +822 -0
- package/dist/skills-status-B57B5p12.js +170 -0
- package/dist/skills-status-DSk7-Gbk.js +2 -0
- package/dist/soul-cli-D_VMWljI.js +110 -0
- package/dist/speech-core-5C9NDTWw.js +126 -0
- package/dist/speech-provider-5npDU3CX.js +103 -0
- package/dist/speech-provider-B-nDtAnq.js +182 -0
- package/dist/speech-provider-BgLqt9Ul.js +184 -0
- package/dist/speech-provider-DAxRZc2f.js +167 -0
- package/dist/stage-sandbox-media.runtime-CFdAVxo8.js +230 -0
- package/dist/stage-sandbox-media.runtime.js +1 -1
- package/dist/standalone-generate-BG6TQ0jK.js +217 -0
- package/dist/standalone-generate-CgZQCsuI.js +2 -0
- package/dist/startup-auth-CKh--SuD.js +151 -0
- package/dist/state-migrations-CN7oRMHd.js +823 -0
- package/dist/status-BAqccuUp.js +278 -0
- package/dist/status-BaSW-xxu.js +2 -0
- package/dist/status-CAODeWKS.js +3 -0
- package/dist/status-CJpxvQmZ.js +500 -0
- package/dist/status-KOZpSuVN.js +2 -0
- package/dist/status-TqK4AoMQ.js +473 -0
- package/dist/status-all-DNG9crv3.js +495 -0
- package/dist/status-evx_KM_Z.js +399 -0
- package/dist/status-json-CT6-w9e9.js +14 -0
- package/dist/status-json-command-sAasGH5G.js +92 -0
- package/dist/status-runtime-shared-DTGujn3T.js +271 -0
- package/dist/status.command.text-runtime-CugrZfYj.js +15 -0
- package/dist/status.gateway-connection.runtime-kuu5mcJa.js +2 -0
- package/dist/status.gateway-connection.runtime.js +1 -1
- package/dist/status.gateway-probe-DNRjTzrV.js +16 -0
- package/dist/status.scan-overview-BjX4TLdw.js +395 -0
- package/dist/status.scan-rcGDJYtU.js +62 -0
- package/dist/status.scan.deps.runtime-CvmH94mX.js +18 -0
- package/dist/status.scan.deps.runtime.js +1 -1
- package/dist/status.scan.fast-json-BJv_9gqh.js +128 -0
- package/dist/status.scan.fast-json-DKOmheDO.js +2 -0
- package/dist/status.scan.runtime-BRjuY3QE.js +417 -0
- package/dist/status.scan.runtime.js +1 -1
- package/dist/status.summary-Bxs_2k1b.js +2 -0
- package/dist/status.summary-Dag8_BJw.js +209 -0
- package/dist/store-BCDEVRXR.js +1112 -0
- package/dist/store-C6poa5Og.js +1075 -0
- package/dist/store-DxQRR8Va.js +424 -0
- package/dist/store.runtime-D6t_wvEo.js +2 -0
- package/dist/store.runtime.js +1 -1
- package/dist/stream-CxAFhAae.js +649 -0
- package/dist/stream-wrappers-BALQapyz.js +144 -0
- package/dist/subagent-announce.registry.runtime-C55O0bdZ.js +3 -0
- package/dist/subagent-announce.registry.runtime.js +1 -1
- package/dist/subagent-control-CoVHKnJF.js +485 -0
- package/dist/subagent-followup.runtime-9Gmh8O_s.js +68 -0
- package/dist/subagent-followup.runtime.js +1 -1
- package/dist/subagent-list-BPsxOWK_.js +168 -0
- package/dist/subagent-orphan-recovery-BCcEet7k.js +214 -0
- package/dist/subagent-registry-DfHx9pew.js +2889 -0
- package/dist/subagent-registry-runtime-B_Mc7UDa.js +2 -0
- package/dist/subagent-registry.runtime-gOuSIzDg.js +3 -0
- package/dist/subagent-registry.runtime.js +1 -1
- package/dist/subagent-spawn-BOLGVu7f.js +782 -0
- package/dist/subagents-format-DXuyOMu-.js +629 -0
- package/dist/system-cli-_jfrKryu.js +60 -0
- package/dist/targets-DKzJlbu6.js +595 -0
- package/dist/task-executor-DhjMRE2d.js +350 -0
- package/dist/task-owner-access-rwopIPhc.js +48 -0
- package/dist/task-registry-C6EQpySp.js +2346 -0
- package/dist/task-registry-control.runtime-t4jeMENC.js +3 -0
- package/dist/task-registry-control.runtime.js +1 -1
- package/dist/task-registry-delivery-runtime-BMfszrF8.js +2 -0
- package/dist/task-registry-delivery-runtime-D_Ocdg0_.js +3 -0
- package/dist/task-registry.maintenance-DNXaqTr4.js +2 -0
- package/dist/task-registry.maintenance-DqvsLuqb.js +425 -0
- package/dist/testing-CXEcd2QQ.js +441 -0
- package/dist/text-report-CUwo5L1k.js +587 -0
- package/dist/text-runtime-B3UrMt6T.js +313 -0
- package/dist/thread-bindings-BR0oLaqe.js +223 -0
- package/dist/tool-auth-shared-BwlRX_zo.js +53 -0
- package/dist/tool-config-shared-CThVi2Zv.js +19 -0
- package/dist/tool-schema-runtime-CiqxCMkH.js +1892 -0
- package/dist/tools-BUzk9uUn.js +110 -0
- package/dist/tools-effective-inventory-CMhZ6G55.js +152 -0
- package/dist/tools.runtime-D6GnPvuW.js +4 -0
- package/dist/tools.runtime.js +1 -1
- package/dist/transcript-kBzFcvfJ.js +233 -0
- package/dist/transcript.runtime-X5nUWG5J.js +2 -0
- package/dist/transcript.runtime.js +1 -1
- package/dist/transport-policy-qrbV7LdB.js +75 -0
- package/dist/tts-BW2-rTjx.js +31 -0
- package/dist/tui-Cnxy7MIi.js +4018 -0
- package/dist/tui-cli-COdAidhT.js +31 -0
- package/dist/update-cli-C62761SQ.js +1779 -0
- package/dist/update-runner-BY92EdE9.js +1492 -0
- package/dist/usage-format-CPx6tGPA.js +2 -0
- package/dist/usage-format-CpsXzXcG.js +507 -0
- package/dist/video-generation-provider-BKRHP8oO.js +171 -0
- package/dist/video-generation-provider-CCsVq0-G.js +263 -0
- package/dist/video-generation-provider-CPHXFGar.js +246 -0
- package/dist/video-generation-provider-DRMOwtTj.js +104 -0
- package/dist/video-generation-provider-DohNwNos.js +181 -0
- package/dist/video-generation-provider-DsIqJI0e.js +227 -0
- package/dist/video-generation-provider-Kg01Dy_G.js +233 -0
- package/dist/video-generation-provider-Z-xZjApd.js +240 -0
- package/dist/video-generation-provider-kfoZ8epM.js +64 -0
- package/dist/video-generation-provider-wgwFq2Wr.js +77 -0
- package/dist/web-fetch-providers.runtime-YHUYJGZL.js +33 -0
- package/dist/web-fetch-providers.runtime.js +1 -1
- package/dist/web-search-C0DUuJkz.js +221 -0
- package/dist/web-search-provider-BVISR8ti.js +155 -0
- package/dist/web-search-providers.runtime-BxK0HVx5.js +206 -0
- package/dist/web-search-providers.runtime.js +1 -1
- package/dist/webhooks-cli-CNvp2Osa.js +321 -0
- package/dist/x-search-shared-uvKOvvdl.js +109 -0
- package/dist/zod-schema-CgftpN_n.js +1401 -0
- package/docs/concepts/cognitive-overview.md +27 -12
- package/package.json +2 -1
- package/dist/abort-BA4i4CO6.js +0 -202
- package/dist/abort-cutoff.runtime-140Dy9Z_.js +0 -20
- package/dist/abort.runtime-D2xd_Jxq.js +0 -2
- package/dist/acp-cli-lUerPOt4.js +0 -2171
- package/dist/acp-spawn-CKu5HWZd.js +0 -1024
- package/dist/acp-stateful-target-driver-DNcDMame.js +0 -88
- package/dist/action-agents-bNO5zlxQ.js +0 -67
- package/dist/action-focus-BQH1yzA9.js +0 -124
- package/dist/action-help-Copk6G3d.js +0 -7
- package/dist/action-info-BUV_zoSU.js +0 -58
- package/dist/action-kill-BMDz9l_U.js +0 -33
- package/dist/action-list-CxkulhYF.js +0 -21
- package/dist/action-log-D0K9-YCV.js +0 -30
- package/dist/action-send-B8ggJVwC.js +0 -39
- package/dist/action-spawn-D9kSXA_K.js +0 -46
- package/dist/action-unfocus-bI4VBonB.js +0 -28
- package/dist/agent-CdxQT19_.js +0 -2
- package/dist/agent-command-Bu_cXSEL.js +0 -1479
- package/dist/agent-runner-utils--p6HAP6k.js +0 -202
- package/dist/agent-runner.runtime-BossnlL1.js +0 -2825
- package/dist/agents-DA2-qNUI.js +0 -887
- package/dist/agents-DaKVGj9F.js +0 -5
- package/dist/anthropic-vertex-stream-CrF-fPgb.js +0 -5666
- package/dist/api-BPByI3-X.js +0 -2
- package/dist/api-BRJq6Aya.js +0 -2
- package/dist/api-BpAm-eRQ.js +0 -2
- package/dist/api-BvFPt7b2.js +0 -19
- package/dist/api-CSOm-O9I.js +0 -5
- package/dist/api-ChQfiSmG.js +0 -4
- package/dist/api-CqBQhm6r.js +0 -2
- package/dist/api-D7qSjVDS.js +0 -3
- package/dist/api-DbRoXBTn.js +0 -45
- package/dist/api-_HshnS5J.js +0 -35
- package/dist/apply-G86rau7x.js +0 -493
- package/dist/apply.runtime-BoYc09wu.js +0 -166
- package/dist/apply.runtime-Dmh02lO-.js +0 -2
- package/dist/approval-client-helpers-cyaJyAMz.js +0 -82
- package/dist/approval-gateway-resolver-bdX78er-.js +0 -58
- package/dist/approval-gateway-runtime-CJm68vrp.js +0 -2
- package/dist/approval-handler-runtime-CT08B2_a.js +0 -439
- package/dist/approval-native-runtime-CN4meUkM.js +0 -709
- package/dist/approval-renderers-CnmO8wke.js +0 -64
- package/dist/asr-Cz-FH-3c.js +0 -196
- package/dist/audit-Cbfv4nmn.js +0 -885
- package/dist/audit-extra.async-DQv_s9K0.js +0 -847
- package/dist/audit.deep.runtime-CAPtrWg1.js +0 -2
- package/dist/audit.nondeep.runtime-HUJ6INiD.js +0 -859
- package/dist/audit.runtime-CAKbHyXK.js +0 -7
- package/dist/auth-CRAwpkC_.js +0 -181
- package/dist/auth-choice-Bhps2D29.js +0 -3
- package/dist/auth-choice-kMIs0xTd.js +0 -71
- package/dist/auth-choice-options-Bx_XsiW-.js +0 -104
- package/dist/auth-choice-prompt-B-koxVGL.js +0 -2
- package/dist/auth-choice-prompt-DytHsI5U.js +0 -36
- package/dist/auth-choice-vRXPONqL.js +0 -353
- package/dist/auth-choice.plugin-providers.runtime-BNfpK_sp.js +0 -11
- package/dist/auth-health-BAxUQXZE.js +0 -165
- package/dist/auth-profiles-YXfmeEhu.js +0 -438
- package/dist/auth-profiles.runtime-CNNciZQU.js +0 -7
- package/dist/auto-recall-CsrNcQNa.js +0 -78
- package/dist/backup-create-DuIPhK_s.js +0 -391
- package/dist/banner-Bb9u_-IS.js +0 -2
- package/dist/banner-BkHTsqFt.js +0 -281
- package/dist/binding-routing-C6_mrNEN.js +0 -50
- package/dist/binding-targets-Cq2e7wRT.js +0 -99
- package/dist/bridge-server-Co3awCAM.js +0 -103
- package/dist/browser-config-runtime-BtkKPBMj.js +0 -6
- package/dist/browser-control-auth-Bqu1lakr.js +0 -120
- package/dist/browser-node-runtime-D8xut4fJ.js +0 -12
- package/dist/browser-profiles-gPG14SPk.js +0 -170
- package/dist/browser-runtime-BBkGI01q.js +0 -377
- package/dist/browser-setup-tools-CD_s48fd.js +0 -12
- package/dist/call-CiUZqjsN.js +0 -2
- package/dist/call-k_nZXTJ3.js +0 -495
- package/dist/call.runtime-CZI7yxSF.js +0 -2
- package/dist/capability-cli-CIm_YhHH.js +0 -1357
- package/dist/catalog-provider-Ch4CMHLl.js +0 -40
- package/dist/cdp.helpers-BVl3YwYe.js +0 -372
- package/dist/channel-core-BB7pTANC.js +0 -5
- package/dist/channel-summary-TxoZjGPA.js +0 -139
- package/dist/channel-summary-dKkFDRbe.js +0 -2
- package/dist/channel.runtime-2WY9MkoH.js +0 -399
- package/dist/channels-D66hRVnR.js +0 -1147
- package/dist/channels-cli-0DjAVaKh.js +0 -248
- package/dist/chat-Fv3LkEfF.js +0 -213
- package/dist/chrome-CEE9kYYR.js +0 -1080
- package/dist/chrome.executables-Dp7W-RgV.js +0 -550
- package/dist/cli-BsNkLoFI.js +0 -57
- package/dist/cli-DQH9X5IE.js +0 -2
- package/dist/cli-DW_ou4hw.js +0 -2
- package/dist/cli-DuoVlLKx.js +0 -154
- package/dist/cli-QG03g_im.js +0 -191
- package/dist/cli-auth-seam-BrijKBRQ.js +0 -14
- package/dist/cli-backend-CIs4F7ip.js +0 -66
- package/dist/cli-migration-CVktTGRI.js +0 -127
- package/dist/cli-runner-12iECISR.js +0 -1662
- package/dist/cli-runner.runtime-C5noDuQ-.js +0 -3
- package/dist/cli-runner.runtime-YrAg_h19.js +0 -2
- package/dist/cli-shared-BUW2okV2.js +0 -142
- package/dist/cli.runtime-Bhxt80sB.js +0 -819
- package/dist/client-bootstrap-BWo-ZK_j.js +0 -28
- package/dist/codex-native-web-search-C6s55zGf.js +0 -2
- package/dist/codex-native-web-search-Cxf1u7R-.js +0 -156
- package/dist/collector-CRTTihSY.js +0 -349
- package/dist/collector-tJxrYXuY.js +0 -2
- package/dist/command-auth-Dlrd5CYD.js +0 -75
- package/dist/command-config-resolution-B8pxzh3W.js +0 -2
- package/dist/command-config-resolution-BXSCDJTh.js +0 -23
- package/dist/command-execution-startup-DYXpKpvc.js +0 -269
- package/dist/command-format-JYoGhCek.js +0 -2
- package/dist/command-queue-CmX7XAL1.js +0 -260
- package/dist/command-registry-BF51N12E.js +0 -3
- package/dist/command-registry-BqpfCBbW.js +0 -113
- package/dist/command-secret-gateway-DuuctECr.js +0 -528
- package/dist/commands-acp-DiLJUV45.js +0 -1017
- package/dist/commands-compact.runtime-BOM8PsWH.js +0 -10
- package/dist/commands-core.runtime-CH_aGeT-.js +0 -2
- package/dist/commands-handlers.runtime-Ca6xoeW5.js +0 -3762
- package/dist/commands-models-CRURuXR-.js +0 -306
- package/dist/commands-reset-hooks-D3RzsOIn.js +0 -129
- package/dist/commands-status-Cufj4x2j.js +0 -223
- package/dist/commands-status.runtime-C8Nz4Glk.js +0 -2
- package/dist/commands-subagents-control.runtime-DjhcmoRT.js +0 -3
- package/dist/commands-subagents-control.runtime-s_DYQWfW.js +0 -2
- package/dist/commands.runtime-ChfYOBeV.js +0 -103
- package/dist/comment-shared-DFEZzqhH.js +0 -40
- package/dist/compact-DEsHFhEL.js +0 -11324
- package/dist/compact.runtime-BzLFUSmk.js +0 -7
- package/dist/completion-cli-CiWtzUFQ.js +0 -2
- package/dist/completion-cli-h3zgpXGM.js +0 -468
- package/dist/config-B3cxNRyw.js +0 -8
- package/dist/config-Bd1PtH4x.js +0 -166
- package/dist/config-DuLfQQvE.js +0 -53
- package/dist/config-cli-BiEmyiRa.js +0 -948
- package/dist/config-defaults-Bw9wwyo1.js +0 -163
- package/dist/config-guard-BGGjXg_Y.js +0 -94
- package/dist/config-runtime-Bvdi0W59.js +0 -14
- package/dist/config-validation-BDeuMlc1.js +0 -279
- package/dist/configure-CUSDnrHs.js +0 -2
- package/dist/configure-FDqT3i_9.js +0 -1162
- package/dist/connection-auth-7izNv08V.js +0 -30
- package/dist/context-B2wCjR9D.js +0 -249
- package/dist/context-n8ANhlMJ.js +0 -2
- package/dist/context-writer-COhxMkVz.js +0 -290
- package/dist/control-auth-Csa4b5CR.js +0 -122
- package/dist/control-ui/assets/agents-CYCtph5J.js +0 -767
- package/dist/control-ui/assets/anthropic-B66S-tt5.js +0 -40
- package/dist/control-ui/assets/azure-openai-responses-CRJyPvrW.js +0 -2
- package/dist/control-ui/assets/cron-DPaLQLTR.js +0 -744
- package/dist/control-ui/assets/dialogues-DPJy1B4C.js +0 -83
- package/dist/control-ui/assets/history-CT3DjMa7.js +0 -71
- package/dist/control-ui/assets/index-Ci2oc-eJ.css +0 -1
- package/dist/control-ui/assets/index-Ua-cFlP6.js +0 -2686
- package/dist/control-ui/assets/mistral-DWkPN1WM.js +0 -72
- package/dist/control-ui/assets/openai-codex-responses-CSJ_tbUW.js +0 -8
- package/dist/control-ui/assets/openai-completions-QUhkmdlC.js +0 -6
- package/dist/control-ui/assets/openai-responses-CjthZA3L.js +0 -2
- package/dist/control-ui/assets/openai-responses-shared-tozh4HQx.js +0 -13
- package/dist/conversation-id-d7KXWjzV.js +0 -140
- package/dist/conversation-runtime-D-YmpVS2.js +0 -31
- package/dist/core-8TPCsNB-.js +0 -210
- package/dist/cron-cli-C5ok2iVK.js +0 -637
- package/dist/curator-9KwCnpXG.js +0 -598
- package/dist/curator-t_jLT3Ie.js +0 -2
- package/dist/daemon-cli-Cr_y38yv.js +0 -476
- package/dist/daemon-install-CrhzPiZ-.js +0 -70
- package/dist/delegate-r3VqUt34.js +0 -61
- package/dist/deliver-Cuu36rnv.js +0 -3
- package/dist/deliver-SAyi_F0e.js +0 -782
- package/dist/deliver-runtime-DKv9J6QE.js +0 -2
- package/dist/delivery-outbound.runtime-DDoInTnF.js +0 -6
- package/dist/delivery-queue-CWi3kUit.js +0 -372
- package/dist/delivery-queue-ecSu6ZNL.js +0 -2
- package/dist/deps-BIU2SScd.js +0 -60
- package/dist/devices-cli-BUAuMOOj.js +0 -336
- package/dist/diagnostic-BLwuJXPT.js +0 -311
- package/dist/direct-dm-D_7_vKGq.js +0 -139
- package/dist/directive-handling.fast-lane-C91i_iZm.js +0 -2
- package/dist/directive-handling.fast-lane-F7l0XNwG.js +0 -64
- package/dist/directive-handling.impl-8RAWZiZE.js +0 -659
- package/dist/directive-handling.impl-BxAIWFS-.js +0 -2
- package/dist/directive-handling.parse-B3O0CfXY.js +0 -376
- package/dist/directive-handling.persist-QXt7GHcD.js +0 -139
- package/dist/directive-handling.persist.runtime-CPPm2qYQ.js +0 -2
- package/dist/directive-handling.shared-C5ywsGJd.js +0 -159
- package/dist/directory-cli-D9v1dSPr.js +0 -240
- package/dist/dispatch-DoyBs65s.js +0 -1126
- package/dist/dispatch-acp-Dz8rU6t9.js +0 -969
- package/dist/dispatch-acp-manager.runtime-tPUGDjl3.js +0 -3
- package/dist/dispatch-acp-media.runtime-rwYN3ewY.js +0 -3
- package/dist/dispatch-acp-session.runtime-C9nyGih8.js +0 -2
- package/dist/dispatch-acp.runtime-Co-JFuKU.js +0 -19
- package/dist/dns-cli-BRVJtnve.js +0 -193
- package/dist/docs-cli-DvJd--iI.js +0 -156
- package/dist/doctor-completion-C46W5KI7.js +0 -90
- package/dist/doctor-config-preflight-B_UDrFsE.js +0 -148
- package/dist/doctor-config-preflight-DtvhOeuT.js +0 -2
- package/dist/doctor-state-migrations-Cd3yfnI1.js +0 -2
- package/dist/doctor-state-migrations-D3qorqjy.js +0 -3
- package/dist/drive-C2mxxJx5.js +0 -718
- package/dist/embedding-provider-C5S1sxvR.js +0 -129
- package/dist/embedding-provider-CNDA2uD3.js +0 -26
- package/dist/embedding-provider-CdVS1B85.js +0 -33
- package/dist/engine-CKgZ1obQ.js +0 -82
- package/dist/engine-embeddings-Bt1bTxtw.js +0 -1489
- package/dist/entry-capabilities-DrciJZn1.js +0 -89
- package/dist/env-overrides-DTd6EBBV.js +0 -347
- package/dist/env-overrides.runtime-Dxy8Shg7.js +0 -7
- package/dist/exec-approval-forwarder.runtime-Dpa8Gi_P.js +0 -3
- package/dist/exec-approval-reply-BaUWuhD6.js +0 -292
- package/dist/exec-approvals-cli-BuOJPaPp.js +0 -485
- package/dist/exec-defaults-B5egc-6t.js +0 -1440
- package/dist/extra-params-Bfdm7Piq.js +0 -295
- package/dist/format-KzNAm6y6.js +0 -245
- package/dist/fragment-collector-DEW1fwlc.js +0 -189
- package/dist/gateway-cli-CWHsIpm8.js +0 -1532
- package/dist/gateway-install-token-CcpoWcqs.js +0 -284
- package/dist/gateway-rpc-Do_3fQSm.js +0 -14
- package/dist/gateway-rpc.runtime-C4kzyrJj.js +0 -23
- package/dist/gemini-cli-provider-YULRMcs8.js +0 -106
- package/dist/gemini-web-search-provider-D_QJZMM3.js +0 -167
- package/dist/get-reply-from-config.runtime-BpdriKtr.js +0 -2
- package/dist/gmail-setup-utils-D_e1q-h_.js +0 -422
- package/dist/health-B5YmS_bW.js +0 -2
- package/dist/health-CQ4zXQ-2.js +0 -579
- package/dist/heartbeat-runner--rVDmB2Z.js +0 -1365
- package/dist/heartbeat-runner-CwtXIPI-.js +0 -4
- package/dist/heartbeat-runner.runtime-D_5UeAsX.js +0 -2
- package/dist/help-CAj5xloH.js +0 -76
- package/dist/hooks-cli-BGDBJqzt.js +0 -364
- package/dist/image-DiK7kcmJ.js +0 -152
- package/dist/image-generation-core-Cwutmg_V.js +0 -17
- package/dist/image-generation-core.auth.runtime-DA7XD5V2.js +0 -2
- package/dist/image-generation-provider-B-0SxnvJ.js +0 -280
- package/dist/image-generation-provider-B-UW3NU_.js +0 -94
- package/dist/image-generation-provider-BR1_oIU4.js +0 -130
- package/dist/image-generation-provider-CnGMLnE9.js +0 -163
- package/dist/image-generation-provider-DHvw6TSJ.js +0 -136
- package/dist/image-generation-runtime-DCWf9P6F.js +0 -2
- package/dist/image-runtime-DGNzvqkb.js +0 -7
- package/dist/inbound-reply-dispatch-DgEqNffL.js +0 -73
- package/dist/inbound.runtime-CloYEZJO.js +0 -4
- package/dist/inbound.runtime-DLbKJWOY.js +0 -3
- package/dist/infra-runtime-DE-Vi3Dn.js +0 -25
- package/dist/ingest-DbZJju1a.js +0 -842
- package/dist/ingest-Dyj9M3ZM.js +0 -2
- package/dist/io-Bz-M35LC.js +0 -7184
- package/dist/io-DacBLjh1.js +0 -5
- package/dist/kaijibot-tools-Df_9YJcO.js +0 -9434
- package/dist/kaijibot-tools.runtime-CZId-V1O.js +0 -2
- package/dist/kimi-web-search-provider-DunVVASJ.js +0 -308
- package/dist/library-BqMFzJMy.js +0 -45
- package/dist/lifecycle-core-DD_IXtH-.js +0 -422
- package/dist/lifecycle-lZ5BtT_X.js +0 -57
- package/dist/list.runtime-DU0ctAjd.js +0 -12
- package/dist/list.runtime-DXWlaAJq.js +0 -9
- package/dist/llm-engine-CMR9RxLA.js +0 -1792
- package/dist/llm-engine-VKRjaGY_.js +0 -2
- package/dist/llm-extractor-BCPvoWmb.js +0 -445
- package/dist/load-context-DV3B4twI.js +0 -51
- package/dist/logging-BMNGvpuz.js +0 -13
- package/dist/logging-CN3VAZ70.js +0 -2
- package/dist/login-Dex1JqnY.js +0 -108
- package/dist/logs-cli-BZFJyrsk.js +0 -264
- package/dist/logs-cli.runtime-bBS2Sbi6.js +0 -2
- package/dist/manager-BmS2ofc4.js +0 -2049
- package/dist/manager-CabVEPeE.js +0 -3314
- package/dist/mcp-cli-DGrmbpsu.js +0 -733
- package/dist/mcp-config-CY_3tJVi.js +0 -115
- package/dist/media-runtime-CAa8uHqv.js +0 -312
- package/dist/media-understanding-D_VRj6xY.js +0 -83
- package/dist/media-understanding-provider-B9Jfjq6L.js +0 -13
- package/dist/media-understanding-provider-BWksuEBw.js +0 -30
- package/dist/media-understanding-provider-Bhtq5Kpe.js +0 -14
- package/dist/media-understanding-provider-BzsmDAMk.js +0 -67
- package/dist/media-understanding-provider-C6_6yxvP.js +0 -123
- package/dist/media-understanding-provider-CdRlAb9s.js +0 -18
- package/dist/media-understanding-provider-D5m-2RW8.js +0 -21
- package/dist/media-understanding-provider-PmVmfI6p.js +0 -112
- package/dist/media-understanding-provider-cmLTPd8x.js +0 -18
- package/dist/media-understanding-provider-nPxfFv8l.js +0 -37
- package/dist/media-understanding-provider-yp9gxov6.js +0 -69
- package/dist/media-understanding-runtime-Bu7m-lVs.js +0 -2
- package/dist/memory-5jlpYBqx.js +0 -242
- package/dist/memory-BFKl6oSn.js +0 -3
- package/dist/memory-core-host-engine-embeddings-p06288xV.js +0 -2
- package/dist/memory-core-host-engine-foundation-DHbdNLgZ.js +0 -11
- package/dist/memory-core-host-runtime-cli-BnvAiNzO.js +0 -9
- package/dist/memory-core-host-runtime-core-CnVg69Uw.js +0 -8
- package/dist/memory-embedding-adapter-Cux48Bvk.js +0 -33
- package/dist/memory-host-search.runtime-D6ORyqHq.js +0 -2
- package/dist/memory-index-DSbV_yD0.js +0 -2
- package/dist/memory-index-EFkCRTeh.js +0 -514
- package/dist/memory-runtime-BKqNwQ9X.js +0 -2
- package/dist/memory-runtime-Cn41W0bC.js +0 -26
- package/dist/message-CMCdNyAT.js +0 -223
- package/dist/message-action-runner-CG2CcWaS.js +0 -1628
- package/dist/message-action-runner-DUZQ7nmt.js +0 -2
- package/dist/message.config.runtime-B3ztIjsr.js +0 -3
- package/dist/message.gateway.runtime-COLMRCv4.js +0 -2
- package/dist/metadata-registry-loader-BSyFpHop.js +0 -15
- package/dist/metadata-registry-loader-Ci3mcmNV.js +0 -2
- package/dist/minimax-vlm-D1DbVSjC.js +0 -183
- package/dist/minimax-web-search-provider-BzgvahXM.js +0 -165
- package/dist/mmr-Clamw4uq.js +0 -146
- package/dist/model-CJIbRRp9.js +0 -630
- package/dist/model-auth-BQpkMtoP.js +0 -427
- package/dist/model-auth-label-dLSkL9EI.js +0 -45
- package/dist/model-catalog-DgqowW_L.js +0 -204
- package/dist/model-definitions-BOTIDDWJ.js +0 -258
- package/dist/model-picker-B4SuA28P.js +0 -3
- package/dist/model-picker-buwrc8kM.js +0 -500
- package/dist/model-picker.runtime-DXgS2Rab.js +0 -15
- package/dist/model-selection-CBuo2hSg.js +0 -381
- package/dist/model-suppression-CthTVW_x.js +0 -28
- package/dist/model-suppression.runtime-R-qnGNBa.js +0 -7
- package/dist/models-B3UnmjRf.js +0 -18
- package/dist/models-BucP8NI1.js +0 -760
- package/dist/models-C3w7hz3K.js +0 -18
- package/dist/models-C4-eAnR7.js +0 -157
- package/dist/models-DMLYOe4h.js +0 -2
- package/dist/models-DNNfkS3j.js +0 -2584
- package/dist/models-DkiHZi9S.js +0 -47
- package/dist/models-OhM18fW_.js +0 -555
- package/dist/models-cli-CfvtZXPd.js +0 -198
- package/dist/models-config-BLMZzgfx.js +0 -900
- package/dist/models-config.providers.secrets-rjdH8T5l.js +0 -299
- package/dist/models.fetch-D1o7sMO8.js +0 -518
- package/dist/monitor-CJdL31iS.js +0 -4435
- package/dist/monitor-DB732mUY.js +0 -1023
- package/dist/music-generation-provider-BrUTQBmG.js +0 -169
- package/dist/music-generation-provider-D6aYWSSm.js +0 -238
- package/dist/music-generation-provider-dpX_Oiuw.js +0 -142
- package/dist/node-cli-BSrC37hh.js +0 -2374
- package/dist/nodes-cli-uwgDIsqv.js +0 -1046
- package/dist/nodes-utils-ChvZvxK1.js +0 -196
- package/dist/notify-C9-q0Rdu.js +0 -305
- package/dist/oauth-CVAbqwnx.js +0 -152
- package/dist/oauth-RbN-L8pg.js +0 -57
- package/dist/oauth-token-shared-CCzflFLG.js +0 -28
- package/dist/oauth.credentials-BeCOUsTe.js +0 -165
- package/dist/oauth.flow-C2PFyq_h.js +0 -122
- package/dist/oauth.settings-CBmYrmAk.js +0 -44
- package/dist/oauth.token-DSow_5Ie.js +0 -43
- package/dist/onboard-B-ZJptUZ.js +0 -25
- package/dist/onboard-Beu-mw_-.js +0 -29
- package/dist/onboard-BzUrcgZ5.js +0 -25
- package/dist/onboard-CPuf8esc.js +0 -25
- package/dist/onboard-CTfex1XR2.js +0 -58
- package/dist/onboard-D-ccZlbM.js +0 -312
- package/dist/onboard-DHXNhsF7.js +0 -621
- package/dist/onboard-custom-9KIp_ybR.js +0 -647
- package/dist/onboard-custom-CbXUFVN6.js +0 -2
- package/dist/onboard-helpers-BFknCN7m.js +0 -223
- package/dist/onboard-helpers-DSJ_xWpL.js +0 -5
- package/dist/onboard-remote-C28pAu4b.js +0 -193
- package/dist/onboard-remote-DQxyE18D.js +0 -2
- package/dist/onboard-search-CPHGVmos.js +0 -324
- package/dist/onboard-skills-B642NK1o.js +0 -2
- package/dist/onboard-skills-CI4B6Kx5.js +0 -134
- package/dist/openai-codex-auth-identity-PqpqYz4a.js +0 -45
- package/dist/openai-codex-cli-auth-cFTkwXjR.js +0 -57
- package/dist/openai-codex-provider-DjUpM_l9.js +0 -299
- package/dist/openai-codex-shared-o0pq7UkS.js +0 -6
- package/dist/openai-provider-ChZN4Q0c.js +0 -283
- package/dist/openai-transport-stream-DXBBlxJ9.js +0 -1632
- package/dist/operator-approvals-client-RJESCyw4.js +0 -68
- package/dist/order-D863tCt-.js +0 -794
- package/dist/pair-command-approve-5Jr6xo-1.js +0 -34
- package/dist/pairing-cli-BF3jieZo.js +0 -118
- package/dist/persistent-bindings.lifecycle-CjXEQUMz.js +0 -94
- package/dist/pi-bundle-mcp-tools-DPVGNVRw.js +0 -709
- package/dist/pi-embedded-Cp3OIZy9.js +0 -2
- package/dist/pi-embedded-DJN2vlNF.js +0 -6
- package/dist/pi-embedded-runner-DXHhhGRS.js +0 -8348
- package/dist/pi-embedded-subscribe.handlers.compaction.runtime-D1jUEg-R.js +0 -23
- package/dist/pi-embedded.runtime-DQPfEvkF.js +0 -5
- package/dist/pi-model-discovery-B9q9ykaA.js +0 -232
- package/dist/pi-tools.before-tool-call.runtime-vGvkJ6V9.js +0 -354
- package/dist/plugin-enabled-CMdiRqJS.js +0 -71
- package/dist/plugin-install-config-policy-32D2JJMl.js +0 -137
- package/dist/plugin-registration-BhPJI7wp.js +0 -23
- package/dist/plugin-registry-Bo4RF_Fn.js +0 -2
- package/dist/plugin-registry-C4M8QkVh.js +0 -3
- package/dist/plugin-registry-loader-ZzUapRh3.js +0 -22
- package/dist/plugin-service-31XQtuZr.js +0 -2494
- package/dist/plugins-cli-20A8dYUN.js +0 -576
- package/dist/plugins-command-helpers-C3Qls10N.js +0 -117
- package/dist/plugins-install-persist-DEr-zA4G.js +0 -121
- package/dist/plugins-update-command-D0Iv4BPb.js +0 -1009
- package/dist/policy-BEVsx7jw.js +0 -172
- package/dist/preemptive-compaction-DlRJt7Zq.js +0 -430
- package/dist/proactive-scheduler-B3w5rW0h.js +0 -1444
- package/dist/probe-CCTEVLB2.js +0 -54
- package/dist/probe-DcSW0ngD.js +0 -426
- package/dist/probe-auth-C7DjgU_m.js +0 -69
- package/dist/probe-auth-Cfwc8qaj.js +0 -3
- package/dist/profiles-BYudUysD.js +0 -117
- package/dist/program-E_Dt_QTp.js +0 -111
- package/dist/prompt-overlay-DsEnjhTn.js +0 -72
- package/dist/prompt-select-styled-Dtw90p2J.js +0 -5305
- package/dist/provider-api-key-auth-CerNsquw.js +0 -113
- package/dist/provider-api-key-auth.runtime-B0BpFkRm.js +0 -14
- package/dist/provider-auth-DwgUXcgu.js +0 -36
- package/dist/provider-auth-api-key-BQfXwqgU.js +0 -5
- package/dist/provider-auth-choice-BKxMQwxd.js +0 -134
- package/dist/provider-auth-choice-preference-DeDdHlsY.js +0 -62
- package/dist/provider-auth-choice.runtime-BJxc73Ex.js +0 -2
- package/dist/provider-auth-choice.runtime-DBcrr0Ab.js +0 -14
- package/dist/provider-auth-guidance-Cqo9An-I.js +0 -34
- package/dist/provider-auth-helpers-r9kVb6L3.js +0 -168
- package/dist/provider-catalog-CjNAbR9b.js +0 -12
- package/dist/provider-catalog-CpTP4D3p.js +0 -56
- package/dist/provider-catalog-D1iJW59q.js +0 -11
- package/dist/provider-catalog-Dc48HHhB.js +0 -11
- package/dist/provider-catalog-jKq2UIeG.js +0 -17
- package/dist/provider-catalog-pmlFBXYr.js +0 -26
- package/dist/provider-dispatcher-Dl07uV70.js +0 -22
- package/dist/provider-entry-DkwXZuZY.js +0 -97
- package/dist/provider-flow-CmI4jkWV.js +0 -66
- package/dist/provider-iVtrs6XY.js +0 -70
- package/dist/provider-models-BXMZj2p1.js +0 -119
- package/dist/provider-models-Bq_MZ0xR.js +0 -35
- package/dist/provider-models-CsUYkHTw.js +0 -116
- package/dist/provider-registration-DkqLtXSj.js +0 -57
- package/dist/provider-registration-vrLHkywc.js +0 -238
- package/dist/provider-runtime-C_ebc-4l.js +0 -2
- package/dist/provider-runtime-Czioyn5w.js +0 -366
- package/dist/provider-runtime.runtime-lPuF4lqy.js +0 -26
- package/dist/provider-self-hosted-setup-Bjk91HZ7.js +0 -249
- package/dist/provider-setup-hUbxRciz.js +0 -2
- package/dist/provider-stream-DTbeHqKf.js +0 -285
- package/dist/provider-stream-family-Cz7SHqeS.js +0 -2
- package/dist/provider-usage-4x0im5xP.js +0 -3
- package/dist/provider-usage-CdkW3Bkb.js +0 -289
- package/dist/provider-wizard-BPkIa2bk.js +0 -166
- package/dist/providers.runtime-CawuCJXc.js +0 -125
- package/dist/proxy-stream-wrappers-BcJuaE24.js +0 -480
- package/dist/push-apns-CO3sqbX3.js +0 -1061
- package/dist/pw-ai-DEf5tZLp.js +0 -2268
- package/dist/qmd-manager-CrqmeTuY.js +0 -1799
- package/dist/qr-cli-g_Pkqstu.js +0 -359
- package/dist/qr-image-DcG1bUox.js +0 -2
- package/dist/queue-BveCZpTb.js +0 -636
- package/dist/realtime-provider-shared-BIili3oc.js +0 -21
- package/dist/realtime-transcription-provider-DqEHy_Jr.js +0 -180
- package/dist/realtime-voice-provider-Dau1KlKK.js +0 -342
- package/dist/record-shared-CC55xbFE.js +0 -10
- package/dist/refresh-BXJ80ji4.js +0 -115
- package/dist/region-CPFmncMW.js +0 -74
- package/dist/register.agent-D5el253o.js +0 -241
- package/dist/register.backup-CBhoChp-.js +0 -234
- package/dist/register.configure-DeqUaelp.js +0 -15
- package/dist/register.maintenance-Dv5x9ZE6.js +0 -443
- package/dist/register.message-e2Pbh8A_.js +0 -601
- package/dist/register.onboard-COuTKpAw.js +0 -83
- package/dist/register.runtime-BjOIl4eF.js +0 -81
- package/dist/register.runtime-BzJ6RkQN.js +0 -343
- package/dist/register.setup-DQYY7K4K.js +0 -104
- package/dist/register.status-health-sessions-CXNGQh_O.js +0 -1211
- package/dist/register.subclis-B6uy_ogx.js +0 -232
- package/dist/register.subclis-Cmdrfiej.js +0 -3
- package/dist/repair-C8v1vNU-.js +0 -112
- package/dist/replay-policy-C6igC4nS.js +0 -8
- package/dist/reply-Bd8ShNWW.js +0 -3523
- package/dist/reply.runtime-ByKwE5dg.js +0 -2
- package/dist/resolve-CSTOvc_c.js +0 -280
- package/dist/restart-C0QhPXk1.js +0 -454
- package/dist/root-help-D2vz4lbV.js +0 -44
- package/dist/route-reply-CXZFXlfK.js +0 -141
- package/dist/route-reply.runtime-BK8V9NEg.js +0 -2
- package/dist/rpc-f0OkPaI1.js +0 -61
- package/dist/rpc.runtime-BQ78T_pB.js +0 -21
- package/dist/run-main-CkwrrhfI.js +0 -453
- package/dist/run-wait-B4pXPLkF.js +0 -118
- package/dist/runner-BSA9M_M9.js +0 -1497
- package/dist/runs-CEDW87Fd.js +0 -495
- package/dist/runtime-C18YgW822.js +0 -242
- package/dist/runtime-C3OJQ1Xd.js +0 -200
- package/dist/runtime-CDNVtwVk.js +0 -72
- package/dist/runtime-CMNHfJtF.js +0 -725
- package/dist/runtime-C_o_otMV.js +0 -355
- package/dist/runtime-CiJWy5Ce.js +0 -9
- package/dist/runtime-D8bLKXLh.js +0 -253
- package/dist/runtime-DM4z9RVx.js +0 -2
- package/dist/runtime-Di50Fr1z.js +0 -191
- package/dist/runtime-W3qG5LHM.js +0 -2
- package/dist/runtime-api-Bx7nlc4w.js +0 -12
- package/dist/runtime-api-DCNC_FTy2.js +0 -2
- package/dist/runtime-api-_Z8MjR0l.js +0 -3
- package/dist/runtime-embedded-pi.runtime-Cv0MW9ps.js +0 -3
- package/dist/runtime-internal-DclGtT-e.js +0 -2
- package/dist/runtime-model-auth.runtime-Bjl23_fr.js +0 -39
- package/dist/runtime-oEwr_zQb.js +0 -107
- package/dist/runtime-plugins-CwWhqXLJ.js +0 -69
- package/dist/runtime-prepare.runtime-Bi-YD5R-.js +0 -80
- package/dist/runtime-provider-CSEDbSxr.js +0 -21
- package/dist/runtime-registry-loader-CbbaZCXY.js +0 -58
- package/dist/runtime-registry-loader-kqiMFCUa.js +0 -2
- package/dist/runtime-schema-CDuvvU7B.js +0 -28383
- package/dist/runtime-shared-BxJFDFe6.js +0 -249
- package/dist/runtime-taskflow-RwpXng2l.js +0 -250
- package/dist/runtime-web-channel-plugin-Bw74Ar_q.js +0 -215
- package/dist/runtime-web-tools-CEaAGeYr.js +0 -1467
- package/dist/runtime-web-tools-fallback.runtime-DU8Hp_QZ.js +0 -9
- package/dist/sandbox-BC2XUWcW.js +0 -4
- package/dist/sandbox-cli-ain0MYTB.js +0 -447
- package/dist/sandbox-epLgxWBQ.js +0 -2586
- package/dist/secrets-cli-iLwRZbRt.js +0 -2114
- package/dist/security-audit-DfrokBuq.js +0 -34
- package/dist/security-cli-BqsMM550.js +0 -486
- package/dist/semantic-dedup-BBpIPaSV.js +0 -95
- package/dist/send-C5LHdZqP.js +0 -993
- package/dist/send-media-Df0E2Z_m.js +0 -2123
- package/dist/server-2CD2yd73.js +0 -13
- package/dist/server-B44RMlVT.js +0 -77
- package/dist/server-context-SulhWpXY.js +0 -4164
- package/dist/server-methods-BPzzX5VC.js +0 -11937
- package/dist/server-middleware-WQzQIrD4.js +0 -110
- package/dist/server-node-events-Ug_Atc7G.js +0 -451
- package/dist/server.impl-InfVdwPj.js +0 -19765
- package/dist/session-B5RmIL21.js +0 -48
- package/dist/session-conversation-CFty7VTc.js +0 -27
- package/dist/session-cost-usage-CckjvorH.js +0 -2
- package/dist/session-cost-usage-DMRjhi4B.js +0 -648
- package/dist/session-file-DGJqy_ea.js +0 -44
- package/dist/session-key-D-jBcxEp.js +0 -65
- package/dist/session-meta-BijZlLS3.js +0 -109
- package/dist/session-override-1YQHEAlz.js +0 -103
- package/dist/session-reset-model.runtime-CEWrfXLr.js +0 -120
- package/dist/session-reset-service-Dphtb16d.js +0 -474
- package/dist/session-subagent-reactivation.runtime-CF4aqSpn.js +0 -2
- package/dist/session-system-events-BSVIh760.js +0 -63
- package/dist/session-tab-registry-DG9SGi0I.js +0 -553
- package/dist/session-updates-BRFvmIoC.js +0 -234
- package/dist/session-updates.runtime-CiHARWGr.js +0 -2
- package/dist/session-utils-Cai4P9ih.js +0 -930
- package/dist/sessions-BTcXDmCA.js +0 -2
- package/dist/sessions-CyYVTseV.js +0 -45
- package/dist/sessions-Fb0ep3uj.js +0 -231
- package/dist/sessions.runtime-BGyynSR4.js +0 -2
- package/dist/setup-CjEjg8Ci.js +0 -505
- package/dist/setup-D-ypxGnK.js +0 -329
- package/dist/setup-surface-QaubzT60.js +0 -586
- package/dist/setup.finalize-B3MWkUF9.js +0 -436
- package/dist/setup.gateway-config-BdK0tA_r.js +0 -246
- package/dist/shared-0JcWj8-R.js +0 -224
- package/dist/shared-BOd3OCF0.js +0 -36
- package/dist/shared-DICWV0-6.js +0 -218
- package/dist/shared-DiGX-JK8.js +0 -137
- package/dist/shared-DktX3NHd.js +0 -175
- package/dist/shared-runtime-BltNIfGY.js +0 -7
- package/dist/short-term-promotion-CT1zdD1r.js +0 -1631
- package/dist/simple-completion-runtime-CZyp8rJ3.js +0 -131
- package/dist/simple-completion-transport-BWyoXghG.js +0 -32
- package/dist/skill-commands-BC_2IdwF.js +0 -82
- package/dist/skill-commands.runtime-BP6BnOeq.js +0 -2
- package/dist/skills-BQX1AsbM.js +0 -4
- package/dist/skills-D7XPR8N-.js +0 -1075
- package/dist/skills-cli-CxmgxC7X.js +0 -382
- package/dist/skills-install-CHUWYiLs.js +0 -822
- package/dist/skills-status-DRTnP8E3.js +0 -170
- package/dist/skills-status-v28wm8HD.js +0 -2
- package/dist/soul-cli-B1-3BHbA.js +0 -110
- package/dist/speech-core-aXx4I3sB.js +0 -126
- package/dist/speech-provider-BTBQ5VOv.js +0 -103
- package/dist/speech-provider-BciszvJf.js +0 -184
- package/dist/speech-provider-BoQDEC_Y.js +0 -167
- package/dist/speech-provider-C-wTEx8k.js +0 -182
- package/dist/stage-sandbox-media.runtime-DhlTQjXA.js +0 -230
- package/dist/standalone-generate-BRvNW_O7.js +0 -2
- package/dist/standalone-generate-CDfZss4x.js +0 -217
- package/dist/startup-auth-B5V0AaIU.js +0 -151
- package/dist/state-migrations-BNib6l8O.js +0 -823
- package/dist/status-8clcfnN0.js +0 -473
- package/dist/status-C9YBVOov.js +0 -278
- package/dist/status-CNcOKUs2.js +0 -500
- package/dist/status-D1l9Tu3s.js +0 -399
- package/dist/status-DKth_wbp.js +0 -2
- package/dist/status-P3bvFirO.js +0 -3
- package/dist/status-TmH9qSMG.js +0 -2
- package/dist/status-all-BeyVXDNT.js +0 -495
- package/dist/status-json-Cj42CVZZ.js +0 -14
- package/dist/status-json-command-DWk5RiyN.js +0 -92
- package/dist/status-runtime-shared-orzti3tZ.js +0 -271
- package/dist/status.command.text-runtime-B-tNLc3T.js +0 -15
- package/dist/status.gateway-connection.runtime-BrkaJ2f5.js +0 -2
- package/dist/status.gateway-probe-BwuiZk1h.js +0 -16
- package/dist/status.scan-DegSjLE2.js +0 -62
- package/dist/status.scan-overview-CrSELCru.js +0 -395
- package/dist/status.scan.deps.runtime-DrUvBz4e.js +0 -18
- package/dist/status.scan.fast-json-Bm5lN6IK.js +0 -2
- package/dist/status.scan.fast-json-Ch2Zw813.js +0 -128
- package/dist/status.scan.runtime-D-LvzBYN.js +0 -417
- package/dist/status.summary-OB-43Bvk.js +0 -2
- package/dist/status.summary-gJukahkb.js +0 -209
- package/dist/store-D5JODeba.js +0 -421
- package/dist/store-D_vXZ7m9.js +0 -1112
- package/dist/store-yc7MvXdd.js +0 -1075
- package/dist/store.runtime-6eaZtPq6.js +0 -2
- package/dist/stream-BgcqyefI.js +0 -649
- package/dist/stream-wrappers-B7-5gN0i.js +0 -144
- package/dist/subagent-announce.registry.runtime-R2bop0gW.js +0 -3
- package/dist/subagent-control-UyMtkJwo.js +0 -485
- package/dist/subagent-followup.runtime-bTK0TymS.js +0 -68
- package/dist/subagent-list-c0JKZR0g.js +0 -168
- package/dist/subagent-orphan-recovery-CSEzwva5.js +0 -214
- package/dist/subagent-registry-Be219RP1.js +0 -2889
- package/dist/subagent-registry-runtime-Dk57Y91p.js +0 -2
- package/dist/subagent-registry.runtime-D6h_BK2i.js +0 -3
- package/dist/subagent-spawn-BeyYZuFf.js +0 -782
- package/dist/subagents-format-ZcZBg1Vh.js +0 -629
- package/dist/system-cli-_3czEwa7.js +0 -60
- package/dist/targets-CXrDP8_l.js +0 -595
- package/dist/task-executor-DNUNtRg8.js +0 -350
- package/dist/task-owner-access--E5Vkg9U.js +0 -48
- package/dist/task-registry-COE-B6MO.js +0 -2346
- package/dist/task-registry-control.runtime-BzsTfRw1.js +0 -3
- package/dist/task-registry-delivery-runtime-Cv6xz8KP.js +0 -2
- package/dist/task-registry-delivery-runtime-DSfcd2LA.js +0 -3
- package/dist/task-registry.maintenance-Bhd9abl9.js +0 -2
- package/dist/task-registry.maintenance-W3lTkY0l.js +0 -425
- package/dist/testing-CQ_-oCQB.js +0 -441
- package/dist/text-report-BgqWDKJR.js +0 -587
- package/dist/text-runtime-asv4kIxS.js +0 -313
- package/dist/thread-bindings-BCRWofo_.js +0 -223
- package/dist/tool-auth-shared-BWZwTobX.js +0 -53
- package/dist/tool-config-shared-BleK697I.js +0 -19
- package/dist/tool-schema-runtime-DZsW_KR4.js +0 -1892
- package/dist/tools-C7lv9rSD.js +0 -110
- package/dist/tools-effective-inventory-SB9JwX-y.js +0 -152
- package/dist/tools.runtime-J5rhfXQp.js +0 -4
- package/dist/transcript-DxWx6dVc.js +0 -233
- package/dist/transcript.runtime-CmBnobSv.js +0 -2
- package/dist/transport-policy-BGfaKNz0.js +0 -75
- package/dist/tts-C1GyTLOi.js +0 -31
- package/dist/tui-Cqdp1x16.js +0 -4018
- package/dist/tui-cli-BC4O3H6r.js +0 -31
- package/dist/update-cli-BzaCTuax.js +0 -1779
- package/dist/update-runner-Cvxezvhf.js +0 -1492
- package/dist/usage-format-DQTT4pqY.js +0 -507
- package/dist/usage-format-sR4xu0xw.js +0 -2
- package/dist/video-generation-provider-7YR4_ldd.js +0 -171
- package/dist/video-generation-provider-AlAZkYIW.js +0 -181
- package/dist/video-generation-provider-BEqi4pUJ.js +0 -104
- package/dist/video-generation-provider-CraaZaR7.js +0 -77
- package/dist/video-generation-provider-CuvO2Hzh.js +0 -246
- package/dist/video-generation-provider-D-t16ACe.js +0 -240
- package/dist/video-generation-provider-DeowxvLt.js +0 -233
- package/dist/video-generation-provider-HbOZ3qzI.js +0 -227
- package/dist/video-generation-provider-_apx1yFE.js +0 -263
- package/dist/video-generation-provider-bvpb6cdV.js +0 -64
- package/dist/web-fetch-providers.runtime-m66rypbB.js +0 -33
- package/dist/web-search-DSDz1iyf.js +0 -221
- package/dist/web-search-provider-DnYRRBVM.js +0 -155
- package/dist/web-search-providers.runtime-Cv56XIGr.js +0 -206
- package/dist/webhooks-cli-DQ_JTSNA.js +0 -321
- package/dist/x-search-shared-DKPdPR5_.js +0 -109
- package/dist/zod-schema-B7jQiHXQ.js +0 -1400
|
@@ -1,1632 +0,0 @@
|
|
|
1
|
-
import { d as readStringValue, i as normalizeLowercaseStringOrEmpty } from "./string-coerce-xZwG7Dq8.js";
|
|
2
|
-
import "./model-selection-Bq91MzO2.js";
|
|
3
|
-
import { r as normalizeProviderId } from "./provider-id-DjOGAXK8.js";
|
|
4
|
-
import { n as resolveProviderRequestCapabilities } from "./provider-attribution-DUpdiKDt.js";
|
|
5
|
-
import { z as resolveProviderTransportTurnStateWithPlugin } from "./provider-runtime-Czioyn5w.js";
|
|
6
|
-
import { c as detectOpenAICompletionsCompat, s as resolveUnsupportedToolSchemaKeywords } from "./provider-model-compat-DfOMY_2L.js";
|
|
7
|
-
import { t as copyChannelAgentToolMeta } from "./channel-tools-wVeRMODi.js";
|
|
8
|
-
import { t as copyPluginToolMeta } from "./tools-C7lv9rSD.js";
|
|
9
|
-
import { n as fetchWithSsrFGuard } from "./fetch-guard-BWtRcc5b.js";
|
|
10
|
-
import { c as resolveProviderRequestPolicyConfig, i as getModelProviderRequestTransport, n as buildProviderRequestDispatcherPolicy } from "./provider-request-config-DIIFdOgF.js";
|
|
11
|
-
import { p as cleanSchemaForGemini, u as stripUnsupportedSchemaKeywords } from "./provider-tools-X4kNlvXF.js";
|
|
12
|
-
import { i as stripSystemPromptCacheBoundary } from "./system-prompt-cache-boundary-BqVZ8lnu.js";
|
|
13
|
-
import { r as hasCopilotVisionInput, t as buildCopilotDynamicHeaders } from "./copilot-dynamic-headers-BwaSVPUy.js";
|
|
14
|
-
import { n as resolveOpenAIResponsesPayloadPolicy, r as flattenCompletionMessagesToStringContent, t as applyOpenAIResponsesPayloadPolicy } from "./openai-responses-payload-policy-CtwSI3rt.js";
|
|
15
|
-
import { randomUUID } from "node:crypto";
|
|
16
|
-
import { calculateCost, createAssistantMessageEventStream, getEnvApiKey, parseStreamingJson } from "@earendil-works/pi-ai";
|
|
17
|
-
import { convertMessages } from "@earendil-works/pi-ai/openai-completions";
|
|
18
|
-
import OpenAI, { AzureOpenAI } from "openai";
|
|
19
|
-
//#region src/agents/pi-tools.schema.ts
|
|
20
|
-
function extractEnumValues(schema) {
|
|
21
|
-
if (!schema || typeof schema !== "object") return;
|
|
22
|
-
const record = schema;
|
|
23
|
-
if (Array.isArray(record.enum)) return record.enum;
|
|
24
|
-
if ("const" in record) return [record.const];
|
|
25
|
-
const variants = Array.isArray(record.anyOf) ? record.anyOf : Array.isArray(record.oneOf) ? record.oneOf : null;
|
|
26
|
-
if (variants) {
|
|
27
|
-
const values = variants.flatMap((variant) => {
|
|
28
|
-
return extractEnumValues(variant) ?? [];
|
|
29
|
-
});
|
|
30
|
-
return values.length > 0 ? values : void 0;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
function mergePropertySchemas(existing, incoming) {
|
|
34
|
-
if (!existing) return incoming;
|
|
35
|
-
if (!incoming) return existing;
|
|
36
|
-
const existingEnum = extractEnumValues(existing);
|
|
37
|
-
const incomingEnum = extractEnumValues(incoming);
|
|
38
|
-
if (existingEnum || incomingEnum) {
|
|
39
|
-
const values = Array.from(new Set([...existingEnum ?? [], ...incomingEnum ?? []]));
|
|
40
|
-
const merged = {};
|
|
41
|
-
for (const source of [existing, incoming]) {
|
|
42
|
-
if (!source || typeof source !== "object") continue;
|
|
43
|
-
const record = source;
|
|
44
|
-
for (const key of [
|
|
45
|
-
"title",
|
|
46
|
-
"description",
|
|
47
|
-
"default"
|
|
48
|
-
]) if (!(key in merged) && key in record) merged[key] = record[key];
|
|
49
|
-
}
|
|
50
|
-
const types = new Set(values.map((value) => typeof value));
|
|
51
|
-
if (types.size === 1) merged.type = Array.from(types)[0];
|
|
52
|
-
merged.enum = values;
|
|
53
|
-
return merged;
|
|
54
|
-
}
|
|
55
|
-
return existing;
|
|
56
|
-
}
|
|
57
|
-
function hasTopLevelArrayKeyword(schemaRecord, key) {
|
|
58
|
-
return Array.isArray(schemaRecord[key]);
|
|
59
|
-
}
|
|
60
|
-
function getFlattenableVariantKey(schemaRecord) {
|
|
61
|
-
if (hasTopLevelArrayKeyword(schemaRecord, "anyOf")) return "anyOf";
|
|
62
|
-
if (hasTopLevelArrayKeyword(schemaRecord, "oneOf")) return "oneOf";
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
function getTopLevelConditionalKey(schemaRecord) {
|
|
66
|
-
return getFlattenableVariantKey(schemaRecord) ?? (hasTopLevelArrayKeyword(schemaRecord, "allOf") ? "allOf" : null);
|
|
67
|
-
}
|
|
68
|
-
function hasTopLevelObjectSchema(schemaRecord, conditionalKey) {
|
|
69
|
-
return "type" in schemaRecord && "properties" in schemaRecord && conditionalKey === null;
|
|
70
|
-
}
|
|
71
|
-
function isObjectLikeSchemaMissingType(schemaRecord, conditionalKey) {
|
|
72
|
-
return !("type" in schemaRecord) && (typeof schemaRecord.properties === "object" || Array.isArray(schemaRecord.required)) && conditionalKey === null;
|
|
73
|
-
}
|
|
74
|
-
function isTypedSchemaMissingProperties(schemaRecord, conditionalKey) {
|
|
75
|
-
return "type" in schemaRecord && !("properties" in schemaRecord) && conditionalKey === null;
|
|
76
|
-
}
|
|
77
|
-
function isTrulyEmptySchema(schemaRecord) {
|
|
78
|
-
return Object.keys(schemaRecord).length === 0;
|
|
79
|
-
}
|
|
80
|
-
function normalizeToolParameterSchema(schema, options) {
|
|
81
|
-
const schemaRecord = schema && typeof schema === "object" ? schema : void 0;
|
|
82
|
-
if (!schemaRecord) return schema;
|
|
83
|
-
const normalizedProvider = normalizeLowercaseStringOrEmpty(options?.modelProvider);
|
|
84
|
-
const isGeminiProvider = normalizedProvider.includes("google") || normalizedProvider.includes("gemini");
|
|
85
|
-
const isAnthropicProvider = normalizedProvider.includes("anthropic");
|
|
86
|
-
const unsupportedToolSchemaKeywords = resolveUnsupportedToolSchemaKeywords(options?.modelCompat);
|
|
87
|
-
function applyProviderCleaning(s) {
|
|
88
|
-
if (isGeminiProvider && !isAnthropicProvider) return cleanSchemaForGemini(s);
|
|
89
|
-
if (unsupportedToolSchemaKeywords.size > 0) return stripUnsupportedSchemaKeywords(s, unsupportedToolSchemaKeywords);
|
|
90
|
-
return s;
|
|
91
|
-
}
|
|
92
|
-
const conditionalKey = getTopLevelConditionalKey(schemaRecord);
|
|
93
|
-
const flattenableVariantKey = getFlattenableVariantKey(schemaRecord);
|
|
94
|
-
if (hasTopLevelObjectSchema(schemaRecord, conditionalKey)) return applyProviderCleaning(schemaRecord);
|
|
95
|
-
if (isObjectLikeSchemaMissingType(schemaRecord, conditionalKey)) return applyProviderCleaning({
|
|
96
|
-
...schemaRecord,
|
|
97
|
-
type: "object"
|
|
98
|
-
});
|
|
99
|
-
if (isTypedSchemaMissingProperties(schemaRecord, conditionalKey)) return applyProviderCleaning({
|
|
100
|
-
...schemaRecord,
|
|
101
|
-
properties: {}
|
|
102
|
-
});
|
|
103
|
-
if (!flattenableVariantKey) {
|
|
104
|
-
if (isTrulyEmptySchema(schemaRecord)) return applyProviderCleaning({
|
|
105
|
-
type: "object",
|
|
106
|
-
properties: {}
|
|
107
|
-
});
|
|
108
|
-
if (conditionalKey === "allOf") return schema;
|
|
109
|
-
return schema;
|
|
110
|
-
}
|
|
111
|
-
const variants = schemaRecord[flattenableVariantKey];
|
|
112
|
-
const mergedProperties = {};
|
|
113
|
-
const requiredCounts = /* @__PURE__ */ new Map();
|
|
114
|
-
let objectVariants = 0;
|
|
115
|
-
for (const entry of variants) {
|
|
116
|
-
if (!entry || typeof entry !== "object") continue;
|
|
117
|
-
const props = entry.properties;
|
|
118
|
-
if (!props || typeof props !== "object") continue;
|
|
119
|
-
objectVariants += 1;
|
|
120
|
-
for (const [key, value] of Object.entries(props)) {
|
|
121
|
-
if (!(key in mergedProperties)) {
|
|
122
|
-
mergedProperties[key] = value;
|
|
123
|
-
continue;
|
|
124
|
-
}
|
|
125
|
-
mergedProperties[key] = mergePropertySchemas(mergedProperties[key], value);
|
|
126
|
-
}
|
|
127
|
-
const required = Array.isArray(entry.required) ? entry.required : [];
|
|
128
|
-
for (const key of required) {
|
|
129
|
-
if (typeof key !== "string") continue;
|
|
130
|
-
requiredCounts.set(key, (requiredCounts.get(key) ?? 0) + 1);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
const baseRequired = Array.isArray(schemaRecord.required) ? schemaRecord.required.filter((key) => typeof key === "string") : void 0;
|
|
134
|
-
const mergedRequired = baseRequired && baseRequired.length > 0 ? baseRequired : objectVariants > 0 ? Array.from(requiredCounts.entries()).filter(([, count]) => count === objectVariants).map(([key]) => key) : void 0;
|
|
135
|
-
const nextSchema = { ...schemaRecord };
|
|
136
|
-
return applyProviderCleaning({
|
|
137
|
-
type: "object",
|
|
138
|
-
...typeof nextSchema.title === "string" ? { title: nextSchema.title } : {},
|
|
139
|
-
...typeof nextSchema.description === "string" ? { description: nextSchema.description } : {},
|
|
140
|
-
properties: Object.keys(mergedProperties).length > 0 ? mergedProperties : schemaRecord.properties ?? {},
|
|
141
|
-
...mergedRequired && mergedRequired.length > 0 ? { required: mergedRequired } : {},
|
|
142
|
-
additionalProperties: "additionalProperties" in schemaRecord ? schemaRecord.additionalProperties : true
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
function normalizeToolParameters(tool, options) {
|
|
146
|
-
function preserveToolMeta(target) {
|
|
147
|
-
copyPluginToolMeta(tool, target);
|
|
148
|
-
copyChannelAgentToolMeta(tool, target);
|
|
149
|
-
return target;
|
|
150
|
-
}
|
|
151
|
-
const schema = tool.parameters && typeof tool.parameters === "object" ? tool.parameters : void 0;
|
|
152
|
-
if (!schema) return tool;
|
|
153
|
-
return preserveToolMeta({
|
|
154
|
-
...tool,
|
|
155
|
-
parameters: normalizeToolParameterSchema(schema, options)
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
//#endregion
|
|
159
|
-
//#region src/infra/retry-after-capture.ts
|
|
160
|
-
/**
|
|
161
|
-
* Parse a `Retry-After` header (RFC 7231) into a millisecond delay.
|
|
162
|
-
*
|
|
163
|
-
* - Delta-seconds (e.g. `"120"`): positive integer seconds → ms.
|
|
164
|
-
* `"0"` and negative values resolve to `undefined` (no delay).
|
|
165
|
-
* - HTTP-date (e.g. `"Wed, 21 Oct 2025 07:28:00 GMT"`): clamped to `>= 0` delta
|
|
166
|
-
* from `now`. Invalid dates resolve to `undefined`.
|
|
167
|
-
* - `null` / `undefined` / empty → `undefined`.
|
|
168
|
-
*
|
|
169
|
-
* @returns delay in ms, or `undefined` when there is nothing to wait for.
|
|
170
|
-
*/
|
|
171
|
-
function parseRetryAfterHeader(value, now = Date.now()) {
|
|
172
|
-
if (value == null) return;
|
|
173
|
-
const trimmed = value.trim();
|
|
174
|
-
if (!trimmed) return;
|
|
175
|
-
if (/^-?\d+$/.test(trimmed)) {
|
|
176
|
-
const seconds = Number(trimmed);
|
|
177
|
-
if (seconds <= 0) return;
|
|
178
|
-
return seconds * 1e3;
|
|
179
|
-
}
|
|
180
|
-
const parsed = Date.parse(trimmed);
|
|
181
|
-
if (Number.isNaN(parsed)) return;
|
|
182
|
-
return Math.max(0, parsed - now);
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Parse a Go-style duration string (e.g. `"6m0s"`, `"1h30m"`, `"500ms"`,
|
|
186
|
-
* `"2m59.56s"`) into milliseconds.
|
|
187
|
-
*
|
|
188
|
-
* Supports `ns`, `us`/`µs`, `ms`, `s`, `m`, `h`. Returns `undefined` when the
|
|
189
|
-
* input is not a valid duration.
|
|
190
|
-
*/
|
|
191
|
-
function parseGoDurationMs(input) {
|
|
192
|
-
if (!/^(?:\d+(?:\.\d+)?(?:ns|us|µs|ms|s|m|h))+$/.test(input)) return;
|
|
193
|
-
const re = /(\d+(?:\.\d+)?)(ns|us|µs|ms|s|m|h)/g;
|
|
194
|
-
let totalMs = 0;
|
|
195
|
-
let match;
|
|
196
|
-
while ((match = re.exec(input)) !== null) {
|
|
197
|
-
const amount = Number(match[1]);
|
|
198
|
-
switch (match[2]) {
|
|
199
|
-
case "ns":
|
|
200
|
-
totalMs += amount / 1e6;
|
|
201
|
-
break;
|
|
202
|
-
case "us":
|
|
203
|
-
case "µs":
|
|
204
|
-
totalMs += amount / 1e3;
|
|
205
|
-
break;
|
|
206
|
-
case "ms":
|
|
207
|
-
totalMs += amount;
|
|
208
|
-
break;
|
|
209
|
-
case "s":
|
|
210
|
-
totalMs += amount * 1e3;
|
|
211
|
-
break;
|
|
212
|
-
case "m":
|
|
213
|
-
totalMs += amount * 6e4;
|
|
214
|
-
break;
|
|
215
|
-
case "h":
|
|
216
|
-
totalMs += amount * 36e5;
|
|
217
|
-
break;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
return Number.isFinite(totalMs) ? totalMs : void 0;
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* Parse a rate-limit-reset header into a millisecond delay from `now`.
|
|
224
|
-
*
|
|
225
|
-
* - `"rfc3339"`: e.g. `"2025-10-21T07:28:00Z"` → clamped delta from `now`.
|
|
226
|
-
* - `"duration"`: Go-style duration → ms.
|
|
227
|
-
* - `"epoch-seconds"`: e.g. `"1718956800"` → clamped delta from `now`.
|
|
228
|
-
*
|
|
229
|
-
* @returns delay in ms, or `undefined` when the value is invalid.
|
|
230
|
-
*/
|
|
231
|
-
function parseRateLimitResetHeader(value, format, now = Date.now()) {
|
|
232
|
-
if (value == null) return;
|
|
233
|
-
const trimmed = value.trim();
|
|
234
|
-
if (!trimmed) return;
|
|
235
|
-
switch (format) {
|
|
236
|
-
case "rfc3339": {
|
|
237
|
-
const parsed = Date.parse(trimmed);
|
|
238
|
-
if (Number.isNaN(parsed)) return;
|
|
239
|
-
return Math.max(0, parsed - now);
|
|
240
|
-
}
|
|
241
|
-
case "duration": return parseGoDurationMs(trimmed);
|
|
242
|
-
case "epoch-seconds": {
|
|
243
|
-
if (!/^\d+$/.test(trimmed)) return;
|
|
244
|
-
const seconds = Number(trimmed);
|
|
245
|
-
return Math.max(0, seconds * 1e3 - now);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
const CACHE_TTL_MS = 6e4;
|
|
250
|
-
const CACHE_MAX_SIZE = 64;
|
|
251
|
-
const retryAfterCache = /* @__PURE__ */ new Map();
|
|
252
|
-
const rateLimitResetCache = /* @__PURE__ */ new Map();
|
|
253
|
-
function evictIfNeeded(cache) {
|
|
254
|
-
while (cache.size > CACHE_MAX_SIZE) {
|
|
255
|
-
let oldestKey;
|
|
256
|
-
let oldestExpiry = Infinity;
|
|
257
|
-
for (const [key, entry] of cache) if (entry.expiresAt < oldestExpiry) {
|
|
258
|
-
oldestExpiry = entry.expiresAt;
|
|
259
|
-
oldestKey = key;
|
|
260
|
-
}
|
|
261
|
-
if (oldestKey === void 0) break;
|
|
262
|
-
cache.delete(oldestKey);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
function recordEntry(cache, provider, ms) {
|
|
266
|
-
cache.set(provider, {
|
|
267
|
-
value: ms,
|
|
268
|
-
expiresAt: Date.now() + CACHE_TTL_MS
|
|
269
|
-
});
|
|
270
|
-
evictIfNeeded(cache);
|
|
271
|
-
}
|
|
272
|
-
function consumeEntry(cache, provider) {
|
|
273
|
-
const entry = cache.get(provider);
|
|
274
|
-
if (entry === void 0) return;
|
|
275
|
-
cache.delete(provider);
|
|
276
|
-
if (Date.now() >= entry.expiresAt) return;
|
|
277
|
-
return entry.value;
|
|
278
|
-
}
|
|
279
|
-
/** Store a `Retry-After` delay (ms) for `provider`. */
|
|
280
|
-
function recordRetryAfterMs(provider, ms) {
|
|
281
|
-
recordEntry(retryAfterCache, provider, ms);
|
|
282
|
-
}
|
|
283
|
-
/** Return and delete the stored `Retry-After` delay for `provider` (if fresh). */
|
|
284
|
-
function consumeRetryAfterMs(provider) {
|
|
285
|
-
return consumeEntry(retryAfterCache, provider);
|
|
286
|
-
}
|
|
287
|
-
/** Store a rate-limit-reset delay (ms) for `provider`. */
|
|
288
|
-
function recordRateLimitResetMs(provider, ms) {
|
|
289
|
-
recordEntry(rateLimitResetCache, provider, ms);
|
|
290
|
-
}
|
|
291
|
-
/** Return and delete the stored rate-limit-reset delay for `provider` (if fresh). */
|
|
292
|
-
function consumeRateLimitResetMs(provider) {
|
|
293
|
-
return consumeEntry(rateLimitResetCache, provider);
|
|
294
|
-
}
|
|
295
|
-
/** Headers that map to a rate-limit-reset delay, with their parse format. */
|
|
296
|
-
const RATE_LIMIT_RESET_HEADERS = [
|
|
297
|
-
["anthropic-ratelimit-tokens-reset", "rfc3339"],
|
|
298
|
-
["anthropic-ratelimit-requests-reset", "rfc3339"],
|
|
299
|
-
["x-ratelimit-reset-requests", "duration"],
|
|
300
|
-
["x-ratelimit-reset-tokens", "duration"]
|
|
301
|
-
];
|
|
302
|
-
/**
|
|
303
|
-
* Inspect a response's headers and record any `Retry-After` / rate-limit-reset
|
|
304
|
-
* hints into the ephemeral cache keyed by `provider`.
|
|
305
|
-
*
|
|
306
|
-
* - `retry-after` (delta-seconds or HTTP-date) and `retry-after-ms` (raw ms)
|
|
307
|
-
* feed {@link recordRetryAfterMs}.
|
|
308
|
-
* - Multiple rate-limit-reset headers are parsed; the longest reset wins
|
|
309
|
-
* (stored via {@link recordRateLimitResetMs}).
|
|
310
|
-
*/
|
|
311
|
-
function captureHeadersFromResponse(provider, headers) {
|
|
312
|
-
const retryAfter = headers.get("retry-after");
|
|
313
|
-
if (retryAfter !== null) {
|
|
314
|
-
const ms = parseRetryAfterHeader(retryAfter);
|
|
315
|
-
if (ms !== void 0) recordRetryAfterMs(provider, ms);
|
|
316
|
-
}
|
|
317
|
-
const retryAfterMsRaw = headers.get("retry-after-ms");
|
|
318
|
-
if (retryAfterMsRaw !== null) {
|
|
319
|
-
const trimmed = retryAfterMsRaw.trim();
|
|
320
|
-
if (/^\d+$/.test(trimmed)) {
|
|
321
|
-
const ms = Number(trimmed);
|
|
322
|
-
if (ms > 0) recordRetryAfterMs(provider, ms);
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
const resetCandidates = [];
|
|
326
|
-
for (const [name, format] of RATE_LIMIT_RESET_HEADERS) {
|
|
327
|
-
const raw = headers.get(name);
|
|
328
|
-
if (raw === null) continue;
|
|
329
|
-
const ms = parseRateLimitResetHeader(raw, format);
|
|
330
|
-
if (ms !== void 0) resetCandidates.push(ms);
|
|
331
|
-
}
|
|
332
|
-
if (resetCandidates.length > 0) recordRateLimitResetMs(provider, Math.max(...resetCandidates));
|
|
333
|
-
}
|
|
334
|
-
//#endregion
|
|
335
|
-
//#region src/agents/provider-fetch-wrapper.ts
|
|
336
|
-
/**
|
|
337
|
-
* Wraps a fetch function to capture Retry-After and rate-limit headers
|
|
338
|
-
* from provider API responses into the ephemeral cache.
|
|
339
|
-
*
|
|
340
|
-
* The wrapper is transparent — it passes the request and response through
|
|
341
|
-
* unchanged. The only side-effect is capturing headers on every response
|
|
342
|
-
* (both success and error) because rate-limit hints can appear on either
|
|
343
|
-
* (e.g. `x-ratelimit-remaining: 0` on a 200, or `retry-after` on a 429).
|
|
344
|
-
*
|
|
345
|
-
* Header-capture errors are silently swallowed so they can never break the
|
|
346
|
-
* actual fetch flow.
|
|
347
|
-
*/
|
|
348
|
-
function createHeaderCapturingFetch(provider, baseFetch = globalThis.fetch) {
|
|
349
|
-
const normalizedProvider = normalizeProviderId(provider);
|
|
350
|
-
return async (input, init) => {
|
|
351
|
-
const response = await baseFetch(input, init);
|
|
352
|
-
try {
|
|
353
|
-
captureHeadersFromResponse(normalizedProvider, response.headers);
|
|
354
|
-
} catch {}
|
|
355
|
-
return response;
|
|
356
|
-
};
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* Creates a header-capturing fetch for `provider` when a provider is present.
|
|
360
|
-
*
|
|
361
|
-
* Returns the original `baseFetch` unchanged when `provider` is missing or
|
|
362
|
-
* empty, so callers can unconditionally pipe through this helper without a
|
|
363
|
-
* guard.
|
|
364
|
-
*/
|
|
365
|
-
function maybeCreateHeaderCapturingFetch(provider, baseFetch = globalThis.fetch) {
|
|
366
|
-
if (!provider) return baseFetch;
|
|
367
|
-
return createHeaderCapturingFetch(provider, baseFetch);
|
|
368
|
-
}
|
|
369
|
-
//#endregion
|
|
370
|
-
//#region src/agents/provider-transport-fetch.ts
|
|
371
|
-
function buildManagedResponse(response, release) {
|
|
372
|
-
if (!response.body) {
|
|
373
|
-
release();
|
|
374
|
-
return response;
|
|
375
|
-
}
|
|
376
|
-
const source = response.body;
|
|
377
|
-
let reader;
|
|
378
|
-
let released = false;
|
|
379
|
-
const finalize = async () => {
|
|
380
|
-
if (released) return;
|
|
381
|
-
released = true;
|
|
382
|
-
await release().catch(() => void 0);
|
|
383
|
-
};
|
|
384
|
-
const wrappedBody = new ReadableStream({
|
|
385
|
-
start() {
|
|
386
|
-
reader = source.getReader();
|
|
387
|
-
},
|
|
388
|
-
async pull(controller) {
|
|
389
|
-
try {
|
|
390
|
-
const chunk = await reader?.read();
|
|
391
|
-
if (!chunk || chunk.done) {
|
|
392
|
-
controller.close();
|
|
393
|
-
await finalize();
|
|
394
|
-
return;
|
|
395
|
-
}
|
|
396
|
-
controller.enqueue(chunk.value);
|
|
397
|
-
} catch (error) {
|
|
398
|
-
controller.error(error);
|
|
399
|
-
await finalize();
|
|
400
|
-
}
|
|
401
|
-
},
|
|
402
|
-
async cancel(reason) {
|
|
403
|
-
try {
|
|
404
|
-
await reader?.cancel(reason);
|
|
405
|
-
} finally {
|
|
406
|
-
await finalize();
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
});
|
|
410
|
-
return new Response(wrappedBody, {
|
|
411
|
-
status: response.status,
|
|
412
|
-
statusText: response.statusText,
|
|
413
|
-
headers: response.headers
|
|
414
|
-
});
|
|
415
|
-
}
|
|
416
|
-
function resolveModelRequestPolicy(model) {
|
|
417
|
-
return resolveProviderRequestPolicyConfig({
|
|
418
|
-
provider: model.provider,
|
|
419
|
-
api: model.api,
|
|
420
|
-
baseUrl: model.baseUrl,
|
|
421
|
-
capability: "llm",
|
|
422
|
-
transport: "stream",
|
|
423
|
-
request: getModelProviderRequestTransport(model)
|
|
424
|
-
});
|
|
425
|
-
}
|
|
426
|
-
function buildGuardedModelFetch(model) {
|
|
427
|
-
const requestConfig = resolveModelRequestPolicy(model);
|
|
428
|
-
const dispatcherPolicy = buildProviderRequestDispatcherPolicy(requestConfig);
|
|
429
|
-
const guardedFetch = async (input, init) => {
|
|
430
|
-
const request = input instanceof Request ? new Request(input, init) : void 0;
|
|
431
|
-
const result = await fetchWithSsrFGuard({
|
|
432
|
-
url: request?.url ?? (input instanceof URL ? input.toString() : typeof input === "string" ? input : (() => {
|
|
433
|
-
throw new Error("Unsupported fetch input for transport-aware model request");
|
|
434
|
-
})()),
|
|
435
|
-
init: (request && {
|
|
436
|
-
method: request.method,
|
|
437
|
-
headers: request.headers,
|
|
438
|
-
body: request.body ?? void 0,
|
|
439
|
-
redirect: request.redirect,
|
|
440
|
-
signal: request.signal,
|
|
441
|
-
...request.body ? { duplex: "half" } : {}
|
|
442
|
-
}) ?? init,
|
|
443
|
-
dispatcherPolicy,
|
|
444
|
-
allowCrossOriginUnsafeRedirectReplay: false,
|
|
445
|
-
...requestConfig.allowPrivateNetwork ? { policy: { allowPrivateNetwork: true } } : {}
|
|
446
|
-
});
|
|
447
|
-
return buildManagedResponse(result.response, result.release);
|
|
448
|
-
};
|
|
449
|
-
return maybeCreateHeaderCapturingFetch(model.provider, guardedFetch);
|
|
450
|
-
}
|
|
451
|
-
//#endregion
|
|
452
|
-
//#region src/agents/transport-message-transform.ts
|
|
453
|
-
function appendMissingToolResults(result, pendingToolCalls, existingToolResultIds) {
|
|
454
|
-
for (const toolCall of pendingToolCalls) if (!existingToolResultIds.has(toolCall.id)) result.push({
|
|
455
|
-
role: "toolResult",
|
|
456
|
-
toolCallId: toolCall.id,
|
|
457
|
-
toolName: toolCall.name,
|
|
458
|
-
content: [{
|
|
459
|
-
type: "text",
|
|
460
|
-
text: "No result provided"
|
|
461
|
-
}],
|
|
462
|
-
isError: true,
|
|
463
|
-
timestamp: Date.now()
|
|
464
|
-
});
|
|
465
|
-
}
|
|
466
|
-
function transformTransportMessages(messages, model, normalizeToolCallId) {
|
|
467
|
-
const toolCallIdMap = /* @__PURE__ */ new Map();
|
|
468
|
-
const transformed = messages.map((msg) => {
|
|
469
|
-
if (msg.role === "user") return msg;
|
|
470
|
-
if (msg.role === "toolResult") {
|
|
471
|
-
const normalizedId = toolCallIdMap.get(msg.toolCallId);
|
|
472
|
-
return normalizedId && normalizedId !== msg.toolCallId ? {
|
|
473
|
-
...msg,
|
|
474
|
-
toolCallId: normalizedId
|
|
475
|
-
} : msg;
|
|
476
|
-
}
|
|
477
|
-
if (msg.role !== "assistant") return msg;
|
|
478
|
-
const isSameModel = msg.provider === model.provider && msg.api === model.api && msg.model === model.id;
|
|
479
|
-
const content = [];
|
|
480
|
-
for (const block of msg.content) {
|
|
481
|
-
if (block.type === "thinking") {
|
|
482
|
-
if (block.redacted) {
|
|
483
|
-
if (isSameModel) content.push(block);
|
|
484
|
-
continue;
|
|
485
|
-
}
|
|
486
|
-
if (isSameModel && block.thinkingSignature) {
|
|
487
|
-
content.push(block);
|
|
488
|
-
continue;
|
|
489
|
-
}
|
|
490
|
-
if (!block.thinking.trim()) continue;
|
|
491
|
-
content.push(isSameModel ? block : {
|
|
492
|
-
type: "text",
|
|
493
|
-
text: block.thinking
|
|
494
|
-
});
|
|
495
|
-
continue;
|
|
496
|
-
}
|
|
497
|
-
if (block.type === "text") {
|
|
498
|
-
content.push(isSameModel ? block : {
|
|
499
|
-
type: "text",
|
|
500
|
-
text: block.text
|
|
501
|
-
});
|
|
502
|
-
continue;
|
|
503
|
-
}
|
|
504
|
-
if (block.type !== "toolCall") {
|
|
505
|
-
content.push(block);
|
|
506
|
-
continue;
|
|
507
|
-
}
|
|
508
|
-
let normalizedToolCall = block;
|
|
509
|
-
if (!isSameModel && block.thoughtSignature) {
|
|
510
|
-
normalizedToolCall = { ...normalizedToolCall };
|
|
511
|
-
delete normalizedToolCall.thoughtSignature;
|
|
512
|
-
}
|
|
513
|
-
if (!isSameModel && normalizeToolCallId) {
|
|
514
|
-
const normalizedId = normalizeToolCallId(block.id, model, msg);
|
|
515
|
-
if (normalizedId !== block.id) {
|
|
516
|
-
toolCallIdMap.set(block.id, normalizedId);
|
|
517
|
-
normalizedToolCall = {
|
|
518
|
-
...normalizedToolCall,
|
|
519
|
-
id: normalizedId
|
|
520
|
-
};
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
content.push(normalizedToolCall);
|
|
524
|
-
}
|
|
525
|
-
return {
|
|
526
|
-
...msg,
|
|
527
|
-
content
|
|
528
|
-
};
|
|
529
|
-
});
|
|
530
|
-
const result = [];
|
|
531
|
-
let pendingToolCalls = [];
|
|
532
|
-
let existingToolResultIds = /* @__PURE__ */ new Set();
|
|
533
|
-
for (const msg of transformed) {
|
|
534
|
-
if (msg.role === "assistant") {
|
|
535
|
-
if (pendingToolCalls.length > 0) {
|
|
536
|
-
appendMissingToolResults(result, pendingToolCalls, existingToolResultIds);
|
|
537
|
-
pendingToolCalls = [];
|
|
538
|
-
existingToolResultIds = /* @__PURE__ */ new Set();
|
|
539
|
-
}
|
|
540
|
-
if (msg.stopReason === "error" || msg.stopReason === "aborted") continue;
|
|
541
|
-
const toolCalls = msg.content.filter((block) => block.type === "toolCall");
|
|
542
|
-
if (toolCalls.length > 0) {
|
|
543
|
-
pendingToolCalls = toolCalls.map((block) => ({
|
|
544
|
-
id: block.id,
|
|
545
|
-
name: block.name
|
|
546
|
-
}));
|
|
547
|
-
existingToolResultIds = /* @__PURE__ */ new Set();
|
|
548
|
-
}
|
|
549
|
-
result.push(msg);
|
|
550
|
-
continue;
|
|
551
|
-
}
|
|
552
|
-
if (msg.role === "toolResult") {
|
|
553
|
-
existingToolResultIds.add(msg.toolCallId);
|
|
554
|
-
result.push(msg);
|
|
555
|
-
continue;
|
|
556
|
-
}
|
|
557
|
-
if (pendingToolCalls.length > 0) {
|
|
558
|
-
appendMissingToolResults(result, pendingToolCalls, existingToolResultIds);
|
|
559
|
-
pendingToolCalls = [];
|
|
560
|
-
existingToolResultIds = /* @__PURE__ */ new Set();
|
|
561
|
-
}
|
|
562
|
-
result.push(msg);
|
|
563
|
-
}
|
|
564
|
-
return result;
|
|
565
|
-
}
|
|
566
|
-
//#endregion
|
|
567
|
-
//#region src/agents/transport-stream-shared.ts
|
|
568
|
-
function sanitizeTransportPayloadText(text) {
|
|
569
|
-
return text.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g, "");
|
|
570
|
-
}
|
|
571
|
-
function mergeTransportHeaders(...headerSources) {
|
|
572
|
-
const merged = {};
|
|
573
|
-
for (const headers of headerSources) if (headers) Object.assign(merged, headers);
|
|
574
|
-
return Object.keys(merged).length > 0 ? merged : void 0;
|
|
575
|
-
}
|
|
576
|
-
function mergeTransportMetadata(payload, metadata) {
|
|
577
|
-
if (!metadata || Object.keys(metadata).length === 0) return payload;
|
|
578
|
-
const existingMetadata = payload.metadata && typeof payload.metadata === "object" && !Array.isArray(payload.metadata) ? payload.metadata : void 0;
|
|
579
|
-
return {
|
|
580
|
-
...payload,
|
|
581
|
-
metadata: {
|
|
582
|
-
...existingMetadata,
|
|
583
|
-
...metadata
|
|
584
|
-
}
|
|
585
|
-
};
|
|
586
|
-
}
|
|
587
|
-
function createEmptyTransportUsage() {
|
|
588
|
-
return {
|
|
589
|
-
input: 0,
|
|
590
|
-
output: 0,
|
|
591
|
-
cacheRead: 0,
|
|
592
|
-
cacheWrite: 0,
|
|
593
|
-
totalTokens: 0,
|
|
594
|
-
cost: {
|
|
595
|
-
input: 0,
|
|
596
|
-
output: 0,
|
|
597
|
-
cacheRead: 0,
|
|
598
|
-
cacheWrite: 0,
|
|
599
|
-
total: 0
|
|
600
|
-
}
|
|
601
|
-
};
|
|
602
|
-
}
|
|
603
|
-
function createWritableTransportEventStream() {
|
|
604
|
-
const eventStream = createAssistantMessageEventStream();
|
|
605
|
-
return {
|
|
606
|
-
eventStream,
|
|
607
|
-
stream: eventStream
|
|
608
|
-
};
|
|
609
|
-
}
|
|
610
|
-
function finalizeTransportStream(params) {
|
|
611
|
-
const { stream, output, signal } = params;
|
|
612
|
-
if (signal?.aborted) throw new Error("Request was aborted");
|
|
613
|
-
if (output.stopReason === "aborted" || output.stopReason === "error") throw new Error("An unknown error occurred");
|
|
614
|
-
stream.push({
|
|
615
|
-
type: "done",
|
|
616
|
-
reason: output.stopReason,
|
|
617
|
-
message: output
|
|
618
|
-
});
|
|
619
|
-
stream.end();
|
|
620
|
-
}
|
|
621
|
-
function failTransportStream(params) {
|
|
622
|
-
const { stream, output, signal, error, cleanup } = params;
|
|
623
|
-
cleanup?.();
|
|
624
|
-
output.stopReason = signal?.aborted ? "aborted" : "error";
|
|
625
|
-
output.errorMessage = error instanceof Error ? error.message : JSON.stringify(error);
|
|
626
|
-
stream.push({
|
|
627
|
-
type: "error",
|
|
628
|
-
reason: output.stopReason,
|
|
629
|
-
error: output
|
|
630
|
-
});
|
|
631
|
-
stream.end();
|
|
632
|
-
}
|
|
633
|
-
//#endregion
|
|
634
|
-
//#region src/agents/openai-tool-schema.ts
|
|
635
|
-
const optionalString = readStringValue;
|
|
636
|
-
function normalizeStrictOpenAIJsonSchema(schema) {
|
|
637
|
-
return normalizeStrictOpenAIJsonSchemaRecursive(normalizeToolParameterSchema(schema ?? {}));
|
|
638
|
-
}
|
|
639
|
-
function normalizeStrictOpenAIJsonSchemaRecursive(schema) {
|
|
640
|
-
if (Array.isArray(schema)) {
|
|
641
|
-
let changed = false;
|
|
642
|
-
const normalized = schema.map((entry) => {
|
|
643
|
-
const next = normalizeStrictOpenAIJsonSchemaRecursive(entry);
|
|
644
|
-
changed ||= next !== entry;
|
|
645
|
-
return next;
|
|
646
|
-
});
|
|
647
|
-
return changed ? normalized : schema;
|
|
648
|
-
}
|
|
649
|
-
if (!schema || typeof schema !== "object") return schema;
|
|
650
|
-
const record = schema;
|
|
651
|
-
let changed = false;
|
|
652
|
-
const normalized = {};
|
|
653
|
-
for (const [key, value] of Object.entries(record)) {
|
|
654
|
-
const next = normalizeStrictOpenAIJsonSchemaRecursive(value);
|
|
655
|
-
normalized[key] = next;
|
|
656
|
-
changed ||= next !== value;
|
|
657
|
-
}
|
|
658
|
-
if (normalized.type === "object") {
|
|
659
|
-
const properties = normalized.properties && typeof normalized.properties === "object" && !Array.isArray(normalized.properties) ? normalized.properties : void 0;
|
|
660
|
-
if (properties && Object.keys(properties).length === 0 && !Array.isArray(normalized.required)) {
|
|
661
|
-
normalized.required = [];
|
|
662
|
-
changed = true;
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
return changed ? normalized : schema;
|
|
666
|
-
}
|
|
667
|
-
function normalizeOpenAIStrictToolParameters(schema, strict) {
|
|
668
|
-
if (!strict) return normalizeToolParameterSchema(schema ?? {});
|
|
669
|
-
return normalizeStrictOpenAIJsonSchema(schema);
|
|
670
|
-
}
|
|
671
|
-
function isStrictOpenAIJsonSchemaCompatible(schema) {
|
|
672
|
-
return isStrictOpenAIJsonSchemaCompatibleRecursive(normalizeStrictOpenAIJsonSchema(schema));
|
|
673
|
-
}
|
|
674
|
-
function isStrictOpenAIJsonSchemaCompatibleRecursive(schema) {
|
|
675
|
-
if (Array.isArray(schema)) return schema.every((entry) => isStrictOpenAIJsonSchemaCompatibleRecursive(entry));
|
|
676
|
-
if (!schema || typeof schema !== "object") return true;
|
|
677
|
-
const record = schema;
|
|
678
|
-
if ("anyOf" in record || "oneOf" in record || "allOf" in record) return false;
|
|
679
|
-
if (Array.isArray(record.type)) return false;
|
|
680
|
-
if (record.type === "object" && record.additionalProperties !== false) return false;
|
|
681
|
-
if (record.type === "object") {
|
|
682
|
-
const properties = record.properties && typeof record.properties === "object" && !Array.isArray(record.properties) ? record.properties : {};
|
|
683
|
-
const required = Array.isArray(record.required) ? record.required.filter((entry) => typeof entry === "string") : void 0;
|
|
684
|
-
if (!required) return false;
|
|
685
|
-
const requiredSet = new Set(required);
|
|
686
|
-
if (Object.keys(properties).some((key) => !requiredSet.has(key))) return false;
|
|
687
|
-
}
|
|
688
|
-
return Object.entries(record).every(([key, entry]) => {
|
|
689
|
-
if (key === "properties" && entry && typeof entry === "object" && !Array.isArray(entry)) return Object.values(entry).every((value) => isStrictOpenAIJsonSchemaCompatibleRecursive(value));
|
|
690
|
-
return isStrictOpenAIJsonSchemaCompatibleRecursive(entry);
|
|
691
|
-
});
|
|
692
|
-
}
|
|
693
|
-
function resolveOpenAIStrictToolFlagForInventory(tools, strict) {
|
|
694
|
-
if (strict !== true) return strict === false ? false : void 0;
|
|
695
|
-
return tools.every((tool) => isStrictOpenAIJsonSchemaCompatible(tool.parameters));
|
|
696
|
-
}
|
|
697
|
-
function resolvesToNativeOpenAIStrictTools(model, transport) {
|
|
698
|
-
const capabilities = resolveProviderRequestCapabilities({
|
|
699
|
-
provider: optionalString(model.provider),
|
|
700
|
-
api: optionalString(model.api),
|
|
701
|
-
baseUrl: optionalString(model.baseUrl),
|
|
702
|
-
capability: "llm",
|
|
703
|
-
transport,
|
|
704
|
-
modelId: optionalString(model.id),
|
|
705
|
-
compat: model.compat && typeof model.compat === "object" ? model.compat : void 0
|
|
706
|
-
});
|
|
707
|
-
if (!capabilities.usesKnownNativeOpenAIRoute) return false;
|
|
708
|
-
return capabilities.provider === "openai" || capabilities.provider === "openai-codex" || capabilities.provider === "azure-openai" || capabilities.provider === "azure-openai-responses";
|
|
709
|
-
}
|
|
710
|
-
function resolveOpenAIStrictToolSetting(model, options) {
|
|
711
|
-
if (resolvesToNativeOpenAIStrictTools(model, options?.transport ?? "stream")) return true;
|
|
712
|
-
if (options?.supportsStrictMode) return false;
|
|
713
|
-
}
|
|
714
|
-
//#endregion
|
|
715
|
-
//#region src/agents/openai-transport-stream.ts
|
|
716
|
-
const DEFAULT_AZURE_OPENAI_API_VERSION = "2024-12-01-preview";
|
|
717
|
-
function stringifyUnknown(value, fallback = "") {
|
|
718
|
-
if (typeof value === "string") return value;
|
|
719
|
-
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
720
|
-
return fallback;
|
|
721
|
-
}
|
|
722
|
-
function stringifyJsonLike(value, fallback = "") {
|
|
723
|
-
if (typeof value === "string") return value;
|
|
724
|
-
if (value && typeof value === "object") return JSON.stringify(value);
|
|
725
|
-
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
726
|
-
return fallback;
|
|
727
|
-
}
|
|
728
|
-
function getServiceTierCostMultiplier(serviceTier) {
|
|
729
|
-
switch (serviceTier) {
|
|
730
|
-
case "flex": return .5;
|
|
731
|
-
case "priority": return 2;
|
|
732
|
-
default: return 1;
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
function applyServiceTierPricing(usage, serviceTier) {
|
|
736
|
-
const multiplier = getServiceTierCostMultiplier(serviceTier);
|
|
737
|
-
if (multiplier === 1) return;
|
|
738
|
-
usage.cost.input *= multiplier;
|
|
739
|
-
usage.cost.output *= multiplier;
|
|
740
|
-
usage.cost.cacheRead *= multiplier;
|
|
741
|
-
usage.cost.cacheWrite *= multiplier;
|
|
742
|
-
usage.cost.total = usage.cost.input + usage.cost.output + usage.cost.cacheRead + usage.cost.cacheWrite;
|
|
743
|
-
}
|
|
744
|
-
function resolveAzureOpenAIApiVersion(env = process.env) {
|
|
745
|
-
return env.AZURE_OPENAI_API_VERSION?.trim() || DEFAULT_AZURE_OPENAI_API_VERSION;
|
|
746
|
-
}
|
|
747
|
-
function shortHash(value) {
|
|
748
|
-
let hash = 0;
|
|
749
|
-
for (let i = 0; i < value.length; i += 1) hash = hash * 31 + value.charCodeAt(i) | 0;
|
|
750
|
-
return Math.abs(hash).toString(36);
|
|
751
|
-
}
|
|
752
|
-
function encodeTextSignatureV1(id, phase) {
|
|
753
|
-
return JSON.stringify({
|
|
754
|
-
v: 1,
|
|
755
|
-
id,
|
|
756
|
-
...phase ? { phase } : {}
|
|
757
|
-
});
|
|
758
|
-
}
|
|
759
|
-
function parseTextSignature(signature) {
|
|
760
|
-
if (!signature) return;
|
|
761
|
-
if (signature.startsWith("{")) try {
|
|
762
|
-
const parsed = JSON.parse(signature);
|
|
763
|
-
if (parsed.v === 1 && typeof parsed.id === "string") return parsed.phase === "commentary" || parsed.phase === "final_answer" ? {
|
|
764
|
-
id: parsed.id,
|
|
765
|
-
phase: parsed.phase
|
|
766
|
-
} : { id: parsed.id };
|
|
767
|
-
} catch {}
|
|
768
|
-
return { id: signature };
|
|
769
|
-
}
|
|
770
|
-
function convertResponsesMessages(model, context, allowedToolCallProviders, options) {
|
|
771
|
-
const messages = [];
|
|
772
|
-
const normalizeIdPart = (part) => {
|
|
773
|
-
const sanitized = part.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
774
|
-
return (sanitized.length > 64 ? sanitized.slice(0, 64) : sanitized).replace(/_+$/, "");
|
|
775
|
-
};
|
|
776
|
-
const buildForeignResponsesItemId = (itemId) => {
|
|
777
|
-
const normalized = `fc_${shortHash(itemId)}`;
|
|
778
|
-
return normalized.length > 64 ? normalized.slice(0, 64) : normalized;
|
|
779
|
-
};
|
|
780
|
-
const normalizeToolCallId = (id, _targetModel, source) => {
|
|
781
|
-
if (!allowedToolCallProviders.has(model.provider)) return normalizeIdPart(id);
|
|
782
|
-
if (!id.includes("|")) return normalizeIdPart(id);
|
|
783
|
-
const [callId, itemId] = id.split("|");
|
|
784
|
-
const normalizedCallId = normalizeIdPart(callId);
|
|
785
|
-
let normalizedItemId = source.provider !== model.provider || source.api !== model.api ? buildForeignResponsesItemId(itemId) : normalizeIdPart(itemId);
|
|
786
|
-
if (!normalizedItemId.startsWith("fc_")) normalizedItemId = normalizeIdPart(`fc_${normalizedItemId}`);
|
|
787
|
-
return `${normalizedCallId}|${normalizedItemId}`;
|
|
788
|
-
};
|
|
789
|
-
const transformedMessages = transformTransportMessages(context.messages, model, normalizeToolCallId);
|
|
790
|
-
if ((options?.includeSystemPrompt ?? true) && context.systemPrompt) messages.push({
|
|
791
|
-
role: model.reasoning && options?.supportsDeveloperRole !== false ? "developer" : "system",
|
|
792
|
-
content: sanitizeTransportPayloadText(stripSystemPromptCacheBoundary(context.systemPrompt))
|
|
793
|
-
});
|
|
794
|
-
let msgIndex = 0;
|
|
795
|
-
for (const msg of transformedMessages) {
|
|
796
|
-
if (msg.role === "user") if (typeof msg.content === "string") messages.push({
|
|
797
|
-
role: "user",
|
|
798
|
-
content: [{
|
|
799
|
-
type: "input_text",
|
|
800
|
-
text: sanitizeTransportPayloadText(msg.content)
|
|
801
|
-
}]
|
|
802
|
-
});
|
|
803
|
-
else {
|
|
804
|
-
const content = msg.content.map((item) => item.type === "text" ? {
|
|
805
|
-
type: "input_text",
|
|
806
|
-
text: sanitizeTransportPayloadText(item.text)
|
|
807
|
-
} : {
|
|
808
|
-
type: "input_image",
|
|
809
|
-
detail: "auto",
|
|
810
|
-
image_url: `data:${item.mimeType};base64,${item.data}`
|
|
811
|
-
}).filter((item) => model.input.includes("image") || item.type !== "input_image");
|
|
812
|
-
if (content.length > 0) messages.push({
|
|
813
|
-
role: "user",
|
|
814
|
-
content
|
|
815
|
-
});
|
|
816
|
-
}
|
|
817
|
-
else if (msg.role === "assistant") {
|
|
818
|
-
const output = [];
|
|
819
|
-
const isDifferentModel = msg.model !== model.id && msg.provider === model.provider && msg.api === model.api;
|
|
820
|
-
for (const block of msg.content) if (block.type === "thinking") {
|
|
821
|
-
if (block.thinkingSignature) output.push(JSON.parse(block.thinkingSignature));
|
|
822
|
-
} else if (block.type === "text") {
|
|
823
|
-
let msgId = parseTextSignature(block.textSignature)?.id ?? `msg_${msgIndex}`;
|
|
824
|
-
if (msgId.length > 64) msgId = `msg_${shortHash(msgId)}`;
|
|
825
|
-
output.push({
|
|
826
|
-
type: "message",
|
|
827
|
-
role: "assistant",
|
|
828
|
-
content: [{
|
|
829
|
-
type: "output_text",
|
|
830
|
-
text: sanitizeTransportPayloadText(block.text),
|
|
831
|
-
annotations: []
|
|
832
|
-
}],
|
|
833
|
-
status: "completed",
|
|
834
|
-
id: msgId,
|
|
835
|
-
phase: parseTextSignature(block.textSignature)?.phase
|
|
836
|
-
});
|
|
837
|
-
} else if (block.type === "toolCall") {
|
|
838
|
-
const [callId, itemIdRaw] = block.id.split("|");
|
|
839
|
-
const itemId = isDifferentModel && itemIdRaw?.startsWith("fc_") ? void 0 : itemIdRaw;
|
|
840
|
-
output.push({
|
|
841
|
-
type: "function_call",
|
|
842
|
-
id: itemId,
|
|
843
|
-
call_id: callId,
|
|
844
|
-
name: block.name,
|
|
845
|
-
arguments: JSON.stringify(block.arguments)
|
|
846
|
-
});
|
|
847
|
-
}
|
|
848
|
-
if (output.length > 0) messages.push(...output);
|
|
849
|
-
} else if (msg.role === "toolResult") {
|
|
850
|
-
const textResult = msg.content.filter((item) => item.type === "text").map((item) => item.text).join("\n");
|
|
851
|
-
const hasImages = msg.content.some((item) => item.type === "image");
|
|
852
|
-
const [callId] = msg.toolCallId.split("|");
|
|
853
|
-
messages.push({
|
|
854
|
-
type: "function_call_output",
|
|
855
|
-
call_id: callId,
|
|
856
|
-
output: hasImages && model.input.includes("image") ? [...textResult ? [{
|
|
857
|
-
type: "input_text",
|
|
858
|
-
text: sanitizeTransportPayloadText(textResult)
|
|
859
|
-
}] : [], ...msg.content.filter((item) => item.type === "image").map((item) => ({
|
|
860
|
-
type: "input_image",
|
|
861
|
-
detail: "auto",
|
|
862
|
-
image_url: `data:${item.mimeType};base64,${item.data}`
|
|
863
|
-
}))] : sanitizeTransportPayloadText(textResult || "(see attached image)")
|
|
864
|
-
});
|
|
865
|
-
}
|
|
866
|
-
msgIndex += 1;
|
|
867
|
-
}
|
|
868
|
-
return messages;
|
|
869
|
-
}
|
|
870
|
-
function convertResponsesTools(tools, options) {
|
|
871
|
-
const strict = resolveOpenAIStrictToolFlagForInventory(tools, options?.strict);
|
|
872
|
-
if (strict === void 0) return tools.map((tool) => ({
|
|
873
|
-
type: "function",
|
|
874
|
-
name: tool.name,
|
|
875
|
-
description: tool.description,
|
|
876
|
-
parameters: tool.parameters
|
|
877
|
-
}));
|
|
878
|
-
return tools.map((tool) => ({
|
|
879
|
-
type: "function",
|
|
880
|
-
name: tool.name,
|
|
881
|
-
description: tool.description,
|
|
882
|
-
parameters: normalizeOpenAIStrictToolParameters(tool.parameters, strict),
|
|
883
|
-
strict
|
|
884
|
-
}));
|
|
885
|
-
}
|
|
886
|
-
async function processResponsesStream(openaiStream, output, stream, model, options) {
|
|
887
|
-
let currentItem = null;
|
|
888
|
-
let currentBlock = null;
|
|
889
|
-
const blockIndex = () => output.content.length - 1;
|
|
890
|
-
for await (const rawEvent of openaiStream) {
|
|
891
|
-
const event = rawEvent;
|
|
892
|
-
const type = stringifyUnknown(event.type);
|
|
893
|
-
if (type === "response.created") output.responseId = stringifyUnknown(event.response?.id);
|
|
894
|
-
else if (type === "response.output_item.added") {
|
|
895
|
-
const item = event.item;
|
|
896
|
-
if (item.type === "reasoning") {
|
|
897
|
-
currentItem = item;
|
|
898
|
-
currentBlock = {
|
|
899
|
-
type: "thinking",
|
|
900
|
-
thinking: ""
|
|
901
|
-
};
|
|
902
|
-
output.content.push(currentBlock);
|
|
903
|
-
stream.push({
|
|
904
|
-
type: "thinking_start",
|
|
905
|
-
contentIndex: blockIndex(),
|
|
906
|
-
partial: output
|
|
907
|
-
});
|
|
908
|
-
} else if (item.type === "message") {
|
|
909
|
-
currentItem = item;
|
|
910
|
-
currentBlock = {
|
|
911
|
-
type: "text",
|
|
912
|
-
text: ""
|
|
913
|
-
};
|
|
914
|
-
output.content.push(currentBlock);
|
|
915
|
-
stream.push({
|
|
916
|
-
type: "text_start",
|
|
917
|
-
contentIndex: blockIndex(),
|
|
918
|
-
partial: output
|
|
919
|
-
});
|
|
920
|
-
} else if (item.type === "function_call") {
|
|
921
|
-
currentItem = item;
|
|
922
|
-
currentBlock = {
|
|
923
|
-
type: "toolCall",
|
|
924
|
-
id: `${stringifyUnknown(item.call_id)}|${stringifyUnknown(item.id)}`,
|
|
925
|
-
name: stringifyUnknown(item.name),
|
|
926
|
-
arguments: {},
|
|
927
|
-
partialJson: stringifyJsonLike(item.arguments)
|
|
928
|
-
};
|
|
929
|
-
output.content.push(currentBlock);
|
|
930
|
-
stream.push({
|
|
931
|
-
type: "toolcall_start",
|
|
932
|
-
contentIndex: blockIndex(),
|
|
933
|
-
partial: output
|
|
934
|
-
});
|
|
935
|
-
}
|
|
936
|
-
} else if (type === "response.reasoning_summary_text.delta") {
|
|
937
|
-
if (currentItem?.type === "reasoning" && currentBlock?.type === "thinking") {
|
|
938
|
-
currentBlock.thinking = `${stringifyUnknown(currentBlock.thinking)}${stringifyUnknown(event.delta)}`;
|
|
939
|
-
stream.push({
|
|
940
|
-
type: "thinking_delta",
|
|
941
|
-
contentIndex: blockIndex(),
|
|
942
|
-
delta: stringifyUnknown(event.delta),
|
|
943
|
-
partial: output
|
|
944
|
-
});
|
|
945
|
-
}
|
|
946
|
-
} else if (type === "response.output_text.delta" || type === "response.refusal.delta") {
|
|
947
|
-
if (currentItem?.type === "message" && currentBlock?.type === "text") {
|
|
948
|
-
currentBlock.text = `${stringifyUnknown(currentBlock.text)}${stringifyUnknown(event.delta)}`;
|
|
949
|
-
stream.push({
|
|
950
|
-
type: "text_delta",
|
|
951
|
-
contentIndex: blockIndex(),
|
|
952
|
-
delta: stringifyUnknown(event.delta),
|
|
953
|
-
partial: output
|
|
954
|
-
});
|
|
955
|
-
}
|
|
956
|
-
} else if (type === "response.function_call_arguments.delta") {
|
|
957
|
-
if (currentItem?.type === "function_call" && currentBlock?.type === "toolCall") {
|
|
958
|
-
currentBlock.partialJson = `${stringifyJsonLike(currentBlock.partialJson)}${stringifyJsonLike(event.delta)}`;
|
|
959
|
-
currentBlock.arguments = parseStreamingJson(stringifyJsonLike(currentBlock.partialJson));
|
|
960
|
-
stream.push({
|
|
961
|
-
type: "toolcall_delta",
|
|
962
|
-
contentIndex: blockIndex(),
|
|
963
|
-
delta: stringifyJsonLike(event.delta),
|
|
964
|
-
partial: output
|
|
965
|
-
});
|
|
966
|
-
}
|
|
967
|
-
} else if (type === "response.output_item.done") {
|
|
968
|
-
const item = event.item;
|
|
969
|
-
if (item.type === "reasoning" && currentBlock?.type === "thinking") {
|
|
970
|
-
const summary = Array.isArray(item.summary) ? item.summary.map((part) => String(part.text ?? "")).join("\n\n") : "";
|
|
971
|
-
currentBlock.thinking = summary;
|
|
972
|
-
currentBlock.thinkingSignature = JSON.stringify(item);
|
|
973
|
-
stream.push({
|
|
974
|
-
type: "thinking_end",
|
|
975
|
-
contentIndex: blockIndex(),
|
|
976
|
-
content: stringifyUnknown(currentBlock.thinking),
|
|
977
|
-
partial: output
|
|
978
|
-
});
|
|
979
|
-
currentBlock = null;
|
|
980
|
-
} else if (item.type === "message" && currentBlock?.type === "text") {
|
|
981
|
-
const content = Array.isArray(item.content) ? item.content : [];
|
|
982
|
-
currentBlock.text = content.map((part) => part.type === "output_text" ? String(part.text ?? "") : String(part.refusal ?? "")).join("");
|
|
983
|
-
currentBlock.textSignature = encodeTextSignatureV1(stringifyUnknown(item.id), item.phase ?? void 0);
|
|
984
|
-
stream.push({
|
|
985
|
-
type: "text_end",
|
|
986
|
-
contentIndex: blockIndex(),
|
|
987
|
-
content: stringifyUnknown(currentBlock.text),
|
|
988
|
-
partial: output
|
|
989
|
-
});
|
|
990
|
-
currentBlock = null;
|
|
991
|
-
} else if (item.type === "function_call") {
|
|
992
|
-
const args = currentBlock?.type === "toolCall" && currentBlock.partialJson ? parseStreamingJson(stringifyJsonLike(currentBlock.partialJson, "{}")) : parseStreamingJson(stringifyJsonLike(item.arguments, "{}"));
|
|
993
|
-
stream.push({
|
|
994
|
-
type: "toolcall_end",
|
|
995
|
-
contentIndex: blockIndex(),
|
|
996
|
-
toolCall: {
|
|
997
|
-
type: "toolCall",
|
|
998
|
-
id: `${stringifyUnknown(item.call_id)}|${stringifyUnknown(item.id)}`,
|
|
999
|
-
name: stringifyUnknown(item.name),
|
|
1000
|
-
arguments: args
|
|
1001
|
-
},
|
|
1002
|
-
partial: output
|
|
1003
|
-
});
|
|
1004
|
-
currentBlock = null;
|
|
1005
|
-
}
|
|
1006
|
-
} else if (type === "response.completed") {
|
|
1007
|
-
const response = event.response;
|
|
1008
|
-
if (typeof response?.id === "string") output.responseId = response.id;
|
|
1009
|
-
const usage = response?.usage;
|
|
1010
|
-
if (usage) {
|
|
1011
|
-
const cachedTokens = usage.input_tokens_details?.cached_tokens || 0;
|
|
1012
|
-
output.usage = {
|
|
1013
|
-
input: (usage.input_tokens || 0) - cachedTokens,
|
|
1014
|
-
output: usage.output_tokens || 0,
|
|
1015
|
-
cacheRead: cachedTokens,
|
|
1016
|
-
cacheWrite: 0,
|
|
1017
|
-
totalTokens: usage.total_tokens || 0,
|
|
1018
|
-
cost: {
|
|
1019
|
-
input: 0,
|
|
1020
|
-
output: 0,
|
|
1021
|
-
cacheRead: 0,
|
|
1022
|
-
cacheWrite: 0,
|
|
1023
|
-
total: 0
|
|
1024
|
-
}
|
|
1025
|
-
};
|
|
1026
|
-
}
|
|
1027
|
-
calculateCost(model, output.usage);
|
|
1028
|
-
if (options?.applyServiceTierPricing) options.applyServiceTierPricing(output.usage, response?.service_tier ?? options.serviceTier);
|
|
1029
|
-
output.stopReason = mapResponsesStopReason(response?.status);
|
|
1030
|
-
if (output.content.some((block) => block.type === "toolCall") && output.stopReason === "stop") output.stopReason = "toolUse";
|
|
1031
|
-
} else if (type === "error") throw new Error(`Error Code ${stringifyUnknown(event.code, "unknown")}: ${stringifyUnknown(event.message, "Unknown error")}`);
|
|
1032
|
-
else if (type === "response.failed") {
|
|
1033
|
-
const response = event.response;
|
|
1034
|
-
const msg = response?.error ? `${response.error.code || "unknown"}: ${response.error.message || "no message"}` : response?.incomplete_details?.reason ? `incomplete: ${response.incomplete_details.reason}` : "Unknown error (no error details in response)";
|
|
1035
|
-
throw new Error(msg);
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
function mapResponsesStopReason(status) {
|
|
1040
|
-
if (!status) return "stop";
|
|
1041
|
-
switch (status) {
|
|
1042
|
-
case "completed": return "stop";
|
|
1043
|
-
case "incomplete": return "length";
|
|
1044
|
-
case "failed":
|
|
1045
|
-
case "cancelled": return "error";
|
|
1046
|
-
case "in_progress":
|
|
1047
|
-
case "queued": return "stop";
|
|
1048
|
-
default: throw new Error(`Unhandled stop reason: ${status}`);
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
function buildOpenAIClientHeaders(model, context, optionHeaders, turnHeaders) {
|
|
1052
|
-
const headers = { ...model.headers };
|
|
1053
|
-
if (model.provider === "github-copilot") Object.assign(headers, buildCopilotDynamicHeaders({
|
|
1054
|
-
messages: context.messages,
|
|
1055
|
-
hasImages: hasCopilotVisionInput(context.messages)
|
|
1056
|
-
}));
|
|
1057
|
-
if (optionHeaders) Object.assign(headers, optionHeaders);
|
|
1058
|
-
if (turnHeaders) Object.assign(headers, turnHeaders);
|
|
1059
|
-
return headers;
|
|
1060
|
-
}
|
|
1061
|
-
function resolveProviderTransportTurnState(model, params) {
|
|
1062
|
-
return resolveProviderTransportTurnStateWithPlugin({
|
|
1063
|
-
provider: model.provider,
|
|
1064
|
-
context: {
|
|
1065
|
-
provider: model.provider,
|
|
1066
|
-
modelId: model.id,
|
|
1067
|
-
model,
|
|
1068
|
-
sessionId: params.sessionId,
|
|
1069
|
-
turnId: params.turnId,
|
|
1070
|
-
attempt: params.attempt,
|
|
1071
|
-
transport: params.transport
|
|
1072
|
-
}
|
|
1073
|
-
});
|
|
1074
|
-
}
|
|
1075
|
-
function createOpenAIResponsesClient(model, context, apiKey, optionHeaders, turnHeaders) {
|
|
1076
|
-
return new OpenAI({
|
|
1077
|
-
apiKey,
|
|
1078
|
-
baseURL: model.baseUrl,
|
|
1079
|
-
dangerouslyAllowBrowser: true,
|
|
1080
|
-
defaultHeaders: buildOpenAIClientHeaders(model, context, optionHeaders, turnHeaders),
|
|
1081
|
-
fetch: buildGuardedModelFetch(model)
|
|
1082
|
-
});
|
|
1083
|
-
}
|
|
1084
|
-
function createOpenAIResponsesTransportStreamFn() {
|
|
1085
|
-
return (model, context, options) => {
|
|
1086
|
-
const eventStream = createAssistantMessageEventStream();
|
|
1087
|
-
const stream = eventStream;
|
|
1088
|
-
(async () => {
|
|
1089
|
-
const output = {
|
|
1090
|
-
role: "assistant",
|
|
1091
|
-
content: [],
|
|
1092
|
-
api: model.api,
|
|
1093
|
-
provider: model.provider,
|
|
1094
|
-
model: model.id,
|
|
1095
|
-
usage: {
|
|
1096
|
-
input: 0,
|
|
1097
|
-
output: 0,
|
|
1098
|
-
cacheRead: 0,
|
|
1099
|
-
cacheWrite: 0,
|
|
1100
|
-
totalTokens: 0,
|
|
1101
|
-
cost: {
|
|
1102
|
-
input: 0,
|
|
1103
|
-
output: 0,
|
|
1104
|
-
cacheRead: 0,
|
|
1105
|
-
cacheWrite: 0,
|
|
1106
|
-
total: 0
|
|
1107
|
-
}
|
|
1108
|
-
},
|
|
1109
|
-
stopReason: "stop",
|
|
1110
|
-
timestamp: Date.now()
|
|
1111
|
-
};
|
|
1112
|
-
try {
|
|
1113
|
-
const apiKey = options?.apiKey || getEnvApiKey(model.provider) || "";
|
|
1114
|
-
const turnState = resolveProviderTransportTurnState(model, {
|
|
1115
|
-
sessionId: options?.sessionId,
|
|
1116
|
-
turnId: randomUUID(),
|
|
1117
|
-
attempt: 1,
|
|
1118
|
-
transport: "stream"
|
|
1119
|
-
});
|
|
1120
|
-
const client = createOpenAIResponsesClient(model, context, apiKey, options?.headers, turnState?.headers);
|
|
1121
|
-
let params = buildOpenAIResponsesParams(model, context, options, turnState?.metadata);
|
|
1122
|
-
const nextParams = await options?.onPayload?.(params, model);
|
|
1123
|
-
if (nextParams !== void 0) params = nextParams;
|
|
1124
|
-
params = mergeTransportMetadata(params, turnState?.metadata);
|
|
1125
|
-
const responseStream = await client.responses.create(params, options?.signal ? { signal: options.signal } : void 0);
|
|
1126
|
-
stream.push({
|
|
1127
|
-
type: "start",
|
|
1128
|
-
partial: output
|
|
1129
|
-
});
|
|
1130
|
-
await processResponsesStream(responseStream, output, stream, model, {
|
|
1131
|
-
serviceTier: options?.serviceTier,
|
|
1132
|
-
applyServiceTierPricing
|
|
1133
|
-
});
|
|
1134
|
-
if (options?.signal?.aborted) throw new Error("Request was aborted");
|
|
1135
|
-
if (output.stopReason === "aborted" || output.stopReason === "error") throw new Error("An unknown error occurred");
|
|
1136
|
-
stream.push({
|
|
1137
|
-
type: "done",
|
|
1138
|
-
reason: output.stopReason,
|
|
1139
|
-
message: output
|
|
1140
|
-
});
|
|
1141
|
-
stream.end();
|
|
1142
|
-
} catch (error) {
|
|
1143
|
-
output.stopReason = options?.signal?.aborted ? "aborted" : "error";
|
|
1144
|
-
output.errorMessage = error instanceof Error ? error.message : JSON.stringify(error);
|
|
1145
|
-
stream.push({
|
|
1146
|
-
type: "error",
|
|
1147
|
-
reason: output.stopReason,
|
|
1148
|
-
error: output
|
|
1149
|
-
});
|
|
1150
|
-
stream.end();
|
|
1151
|
-
}
|
|
1152
|
-
})();
|
|
1153
|
-
return eventStream;
|
|
1154
|
-
};
|
|
1155
|
-
}
|
|
1156
|
-
function resolveCacheRetention(cacheRetention) {
|
|
1157
|
-
if (cacheRetention === "short" || cacheRetention === "long" || cacheRetention === "none") return cacheRetention;
|
|
1158
|
-
if (typeof process !== "undefined" && process.env.PI_CACHE_RETENTION === "long") return "long";
|
|
1159
|
-
return "short";
|
|
1160
|
-
}
|
|
1161
|
-
function getPromptCacheRetention(baseUrl, cacheRetention) {
|
|
1162
|
-
if (cacheRetention !== "long") return;
|
|
1163
|
-
return baseUrl?.includes("api.openai.com") ? "24h" : void 0;
|
|
1164
|
-
}
|
|
1165
|
-
function resolveOpenAIReasoningEffort(options) {
|
|
1166
|
-
return options?.reasoningEffort ?? options?.reasoning ?? "high";
|
|
1167
|
-
}
|
|
1168
|
-
function buildOpenAIResponsesParams(model, context, options, metadata) {
|
|
1169
|
-
const compat = getCompat(model);
|
|
1170
|
-
const supportsDeveloperRole = typeof compat.supportsDeveloperRole === "boolean" ? compat.supportsDeveloperRole : void 0;
|
|
1171
|
-
const messages = convertResponsesMessages(model, context, new Set([
|
|
1172
|
-
"openai",
|
|
1173
|
-
"openai-codex",
|
|
1174
|
-
"opencode",
|
|
1175
|
-
"azure-openai-responses"
|
|
1176
|
-
]), { supportsDeveloperRole });
|
|
1177
|
-
const cacheRetention = resolveCacheRetention(options?.cacheRetention);
|
|
1178
|
-
const payloadPolicy = resolveOpenAIResponsesPayloadPolicy(model, { storeMode: "disable" });
|
|
1179
|
-
const params = {
|
|
1180
|
-
model: model.id,
|
|
1181
|
-
input: messages,
|
|
1182
|
-
stream: true,
|
|
1183
|
-
prompt_cache_key: cacheRetention === "none" ? void 0 : options?.sessionId,
|
|
1184
|
-
prompt_cache_retention: getPromptCacheRetention(model.baseUrl, cacheRetention),
|
|
1185
|
-
...metadata ? { metadata } : {}
|
|
1186
|
-
};
|
|
1187
|
-
if (options?.maxTokens) params.max_output_tokens = options.maxTokens;
|
|
1188
|
-
if (options?.temperature !== void 0) params.temperature = options.temperature;
|
|
1189
|
-
if (options?.serviceTier !== void 0 && payloadPolicy.allowsServiceTier) params.service_tier = options.serviceTier;
|
|
1190
|
-
if (context.tools) params.tools = convertResponsesTools(context.tools, { strict: resolveOpenAIStrictToolSetting(model, { transport: "stream" }) });
|
|
1191
|
-
if (model.reasoning) {
|
|
1192
|
-
if (options?.reasoningEffort || options?.reasoning || options?.reasoningSummary) {
|
|
1193
|
-
params.reasoning = {
|
|
1194
|
-
effort: resolveOpenAIReasoningEffort(options),
|
|
1195
|
-
summary: options?.reasoningSummary || "auto"
|
|
1196
|
-
};
|
|
1197
|
-
params.include = ["reasoning.encrypted_content"];
|
|
1198
|
-
} else if (model.provider !== "github-copilot") {
|
|
1199
|
-
params.reasoning = {
|
|
1200
|
-
effort: "high",
|
|
1201
|
-
summary: "auto"
|
|
1202
|
-
};
|
|
1203
|
-
params.include = ["reasoning.encrypted_content"];
|
|
1204
|
-
}
|
|
1205
|
-
}
|
|
1206
|
-
applyOpenAIResponsesPayloadPolicy(params, payloadPolicy);
|
|
1207
|
-
return params;
|
|
1208
|
-
}
|
|
1209
|
-
function createAzureOpenAIResponsesTransportStreamFn() {
|
|
1210
|
-
return (model, context, options) => {
|
|
1211
|
-
const eventStream = createAssistantMessageEventStream();
|
|
1212
|
-
const stream = eventStream;
|
|
1213
|
-
(async () => {
|
|
1214
|
-
const output = {
|
|
1215
|
-
role: "assistant",
|
|
1216
|
-
content: [],
|
|
1217
|
-
api: "azure-openai-responses",
|
|
1218
|
-
provider: model.provider,
|
|
1219
|
-
model: model.id,
|
|
1220
|
-
usage: {
|
|
1221
|
-
input: 0,
|
|
1222
|
-
output: 0,
|
|
1223
|
-
cacheRead: 0,
|
|
1224
|
-
cacheWrite: 0,
|
|
1225
|
-
totalTokens: 0,
|
|
1226
|
-
cost: {
|
|
1227
|
-
input: 0,
|
|
1228
|
-
output: 0,
|
|
1229
|
-
cacheRead: 0,
|
|
1230
|
-
cacheWrite: 0,
|
|
1231
|
-
total: 0
|
|
1232
|
-
}
|
|
1233
|
-
},
|
|
1234
|
-
stopReason: "stop",
|
|
1235
|
-
timestamp: Date.now()
|
|
1236
|
-
};
|
|
1237
|
-
try {
|
|
1238
|
-
const apiKey = options?.apiKey || getEnvApiKey(model.provider) || "";
|
|
1239
|
-
const turnState = resolveProviderTransportTurnState(model, {
|
|
1240
|
-
sessionId: options?.sessionId,
|
|
1241
|
-
turnId: randomUUID(),
|
|
1242
|
-
attempt: 1,
|
|
1243
|
-
transport: "stream"
|
|
1244
|
-
});
|
|
1245
|
-
const client = createAzureOpenAIClient(model, context, apiKey, options?.headers, turnState?.headers);
|
|
1246
|
-
let params = buildAzureOpenAIResponsesParams(model, context, options, resolveAzureDeploymentName(model), turnState?.metadata);
|
|
1247
|
-
const nextParams = await options?.onPayload?.(params, model);
|
|
1248
|
-
if (nextParams !== void 0) params = nextParams;
|
|
1249
|
-
params = mergeTransportMetadata(params, turnState?.metadata);
|
|
1250
|
-
const responseStream = await client.responses.create(params, options?.signal ? { signal: options.signal } : void 0);
|
|
1251
|
-
stream.push({
|
|
1252
|
-
type: "start",
|
|
1253
|
-
partial: output
|
|
1254
|
-
});
|
|
1255
|
-
await processResponsesStream(responseStream, output, stream, model);
|
|
1256
|
-
if (options?.signal?.aborted) throw new Error("Request was aborted");
|
|
1257
|
-
if (output.stopReason === "aborted" || output.stopReason === "error") throw new Error("An unknown error occurred");
|
|
1258
|
-
stream.push({
|
|
1259
|
-
type: "done",
|
|
1260
|
-
reason: output.stopReason,
|
|
1261
|
-
message: output
|
|
1262
|
-
});
|
|
1263
|
-
stream.end();
|
|
1264
|
-
} catch (error) {
|
|
1265
|
-
output.stopReason = options?.signal?.aborted ? "aborted" : "error";
|
|
1266
|
-
output.errorMessage = error instanceof Error ? error.message : JSON.stringify(error);
|
|
1267
|
-
stream.push({
|
|
1268
|
-
type: "error",
|
|
1269
|
-
reason: output.stopReason,
|
|
1270
|
-
error: output
|
|
1271
|
-
});
|
|
1272
|
-
stream.end();
|
|
1273
|
-
}
|
|
1274
|
-
})();
|
|
1275
|
-
return eventStream;
|
|
1276
|
-
};
|
|
1277
|
-
}
|
|
1278
|
-
function normalizeAzureBaseUrl(baseUrl) {
|
|
1279
|
-
return baseUrl.replace(/\/+$/, "");
|
|
1280
|
-
}
|
|
1281
|
-
function resolveAzureDeploymentName(model) {
|
|
1282
|
-
const deploymentMap = process.env.AZURE_OPENAI_DEPLOYMENT_NAME_MAP;
|
|
1283
|
-
if (deploymentMap) for (const entry of deploymentMap.split(",")) {
|
|
1284
|
-
const [modelId, deploymentName] = entry.split("=", 2).map((value) => value?.trim());
|
|
1285
|
-
if (modelId === model.id && deploymentName) return deploymentName;
|
|
1286
|
-
}
|
|
1287
|
-
return model.id;
|
|
1288
|
-
}
|
|
1289
|
-
function createAzureOpenAIClient(model, context, apiKey, optionHeaders, turnHeaders) {
|
|
1290
|
-
return new AzureOpenAI({
|
|
1291
|
-
apiKey,
|
|
1292
|
-
apiVersion: resolveAzureOpenAIApiVersion(),
|
|
1293
|
-
dangerouslyAllowBrowser: true,
|
|
1294
|
-
defaultHeaders: buildOpenAIClientHeaders(model, context, optionHeaders, turnHeaders),
|
|
1295
|
-
baseURL: normalizeAzureBaseUrl(model.baseUrl),
|
|
1296
|
-
fetch: buildGuardedModelFetch(model)
|
|
1297
|
-
});
|
|
1298
|
-
}
|
|
1299
|
-
function buildAzureOpenAIResponsesParams(model, context, options, deploymentName, metadata) {
|
|
1300
|
-
const params = buildOpenAIResponsesParams(model, context, options, metadata);
|
|
1301
|
-
params.model = deploymentName;
|
|
1302
|
-
delete params.store;
|
|
1303
|
-
return params;
|
|
1304
|
-
}
|
|
1305
|
-
function hasToolHistory(messages) {
|
|
1306
|
-
return messages.some((message) => message.role === "toolResult" || message.role === "assistant" && message.content.some((block) => block.type === "toolCall"));
|
|
1307
|
-
}
|
|
1308
|
-
function createOpenAICompletionsClient(model, context, apiKey, optionHeaders) {
|
|
1309
|
-
return new OpenAI({
|
|
1310
|
-
apiKey,
|
|
1311
|
-
baseURL: model.baseUrl,
|
|
1312
|
-
dangerouslyAllowBrowser: true,
|
|
1313
|
-
defaultHeaders: buildOpenAIClientHeaders(model, context, optionHeaders),
|
|
1314
|
-
fetch: buildGuardedModelFetch(model)
|
|
1315
|
-
});
|
|
1316
|
-
}
|
|
1317
|
-
function createOpenAICompletionsTransportStreamFn() {
|
|
1318
|
-
return (model, context, options) => {
|
|
1319
|
-
const eventStream = createAssistantMessageEventStream();
|
|
1320
|
-
const stream = eventStream;
|
|
1321
|
-
(async () => {
|
|
1322
|
-
const output = {
|
|
1323
|
-
role: "assistant",
|
|
1324
|
-
content: [],
|
|
1325
|
-
api: model.api,
|
|
1326
|
-
provider: model.provider,
|
|
1327
|
-
model: model.id,
|
|
1328
|
-
usage: {
|
|
1329
|
-
input: 0,
|
|
1330
|
-
output: 0,
|
|
1331
|
-
cacheRead: 0,
|
|
1332
|
-
cacheWrite: 0,
|
|
1333
|
-
totalTokens: 0,
|
|
1334
|
-
cost: {
|
|
1335
|
-
input: 0,
|
|
1336
|
-
output: 0,
|
|
1337
|
-
cacheRead: 0,
|
|
1338
|
-
cacheWrite: 0,
|
|
1339
|
-
total: 0
|
|
1340
|
-
}
|
|
1341
|
-
},
|
|
1342
|
-
stopReason: "stop",
|
|
1343
|
-
timestamp: Date.now()
|
|
1344
|
-
};
|
|
1345
|
-
try {
|
|
1346
|
-
const client = createOpenAICompletionsClient(model, context, options?.apiKey || getEnvApiKey(model.provider) || "", options?.headers);
|
|
1347
|
-
let params = buildOpenAICompletionsParams(model, context, options);
|
|
1348
|
-
const nextParams = await options?.onPayload?.(params, model);
|
|
1349
|
-
if (nextParams !== void 0) params = nextParams;
|
|
1350
|
-
const responseStream = await client.chat.completions.create(params, { signal: options?.signal });
|
|
1351
|
-
stream.push({
|
|
1352
|
-
type: "start",
|
|
1353
|
-
partial: output
|
|
1354
|
-
});
|
|
1355
|
-
await processOpenAICompletionsStream(responseStream, output, model, stream);
|
|
1356
|
-
if (options?.signal?.aborted) throw new Error("Request was aborted");
|
|
1357
|
-
stream.push({
|
|
1358
|
-
type: "done",
|
|
1359
|
-
reason: output.stopReason,
|
|
1360
|
-
message: output
|
|
1361
|
-
});
|
|
1362
|
-
stream.end();
|
|
1363
|
-
} catch (error) {
|
|
1364
|
-
output.stopReason = options?.signal?.aborted ? "aborted" : "error";
|
|
1365
|
-
output.errorMessage = error instanceof Error ? error.message : JSON.stringify(error);
|
|
1366
|
-
stream.push({
|
|
1367
|
-
type: "error",
|
|
1368
|
-
reason: output.stopReason,
|
|
1369
|
-
error: output
|
|
1370
|
-
});
|
|
1371
|
-
stream.end();
|
|
1372
|
-
}
|
|
1373
|
-
})();
|
|
1374
|
-
return eventStream;
|
|
1375
|
-
};
|
|
1376
|
-
}
|
|
1377
|
-
async function processOpenAICompletionsStream(responseStream, output, model, stream) {
|
|
1378
|
-
let currentBlock = null;
|
|
1379
|
-
const blockIndex = () => output.content.length - 1;
|
|
1380
|
-
const finishCurrentBlock = () => {
|
|
1381
|
-
if (!currentBlock) return;
|
|
1382
|
-
if (currentBlock.type === "toolCall") {
|
|
1383
|
-
currentBlock.arguments = parseStreamingJson(currentBlock.partialArgs);
|
|
1384
|
-
const completed = {
|
|
1385
|
-
...currentBlock,
|
|
1386
|
-
arguments: parseStreamingJson(currentBlock.partialArgs)
|
|
1387
|
-
};
|
|
1388
|
-
output.content[blockIndex()] = completed;
|
|
1389
|
-
}
|
|
1390
|
-
};
|
|
1391
|
-
for await (const chunk of responseStream) {
|
|
1392
|
-
output.responseId ||= chunk.id;
|
|
1393
|
-
if (chunk.usage) output.usage = parseTransportChunkUsage(chunk.usage, model);
|
|
1394
|
-
const choice = Array.isArray(chunk.choices) ? chunk.choices[0] : void 0;
|
|
1395
|
-
if (!choice) continue;
|
|
1396
|
-
const choiceUsage = choice.usage;
|
|
1397
|
-
if (!chunk.usage && choiceUsage) output.usage = parseTransportChunkUsage(choiceUsage, model);
|
|
1398
|
-
if (choice.finish_reason) {
|
|
1399
|
-
const finishReasonResult = mapStopReason(choice.finish_reason);
|
|
1400
|
-
output.stopReason = finishReasonResult.stopReason;
|
|
1401
|
-
if (finishReasonResult.errorMessage) output.errorMessage = finishReasonResult.errorMessage;
|
|
1402
|
-
}
|
|
1403
|
-
if (!choice.delta) continue;
|
|
1404
|
-
if (choice.delta.content) {
|
|
1405
|
-
if (!currentBlock || currentBlock.type !== "text") {
|
|
1406
|
-
finishCurrentBlock();
|
|
1407
|
-
currentBlock = {
|
|
1408
|
-
type: "text",
|
|
1409
|
-
text: ""
|
|
1410
|
-
};
|
|
1411
|
-
output.content.push(currentBlock);
|
|
1412
|
-
stream.push({
|
|
1413
|
-
type: "text_start",
|
|
1414
|
-
contentIndex: blockIndex(),
|
|
1415
|
-
partial: output
|
|
1416
|
-
});
|
|
1417
|
-
}
|
|
1418
|
-
currentBlock.text += choice.delta.content;
|
|
1419
|
-
stream.push({
|
|
1420
|
-
type: "text_delta",
|
|
1421
|
-
contentIndex: blockIndex(),
|
|
1422
|
-
delta: choice.delta.content,
|
|
1423
|
-
partial: output
|
|
1424
|
-
});
|
|
1425
|
-
continue;
|
|
1426
|
-
}
|
|
1427
|
-
const reasoningField = [
|
|
1428
|
-
"reasoning_content",
|
|
1429
|
-
"reasoning",
|
|
1430
|
-
"reasoning_text"
|
|
1431
|
-
].find((field) => {
|
|
1432
|
-
const value = choice.delta[field];
|
|
1433
|
-
return typeof value === "string" && value.length > 0;
|
|
1434
|
-
});
|
|
1435
|
-
if (reasoningField) {
|
|
1436
|
-
if (!currentBlock || currentBlock.type !== "thinking") {
|
|
1437
|
-
finishCurrentBlock();
|
|
1438
|
-
currentBlock = {
|
|
1439
|
-
type: "thinking",
|
|
1440
|
-
thinking: "",
|
|
1441
|
-
thinkingSignature: reasoningField
|
|
1442
|
-
};
|
|
1443
|
-
output.content.push(currentBlock);
|
|
1444
|
-
stream.push({
|
|
1445
|
-
type: "thinking_start",
|
|
1446
|
-
contentIndex: blockIndex(),
|
|
1447
|
-
partial: output
|
|
1448
|
-
});
|
|
1449
|
-
}
|
|
1450
|
-
currentBlock.thinking += String(choice.delta[reasoningField]);
|
|
1451
|
-
stream.push({
|
|
1452
|
-
type: "thinking_delta",
|
|
1453
|
-
contentIndex: blockIndex(),
|
|
1454
|
-
delta: String(choice.delta[reasoningField]),
|
|
1455
|
-
partial: output
|
|
1456
|
-
});
|
|
1457
|
-
continue;
|
|
1458
|
-
}
|
|
1459
|
-
if (choice.delta.tool_calls) for (const toolCall of choice.delta.tool_calls) {
|
|
1460
|
-
if (!currentBlock || currentBlock.type !== "toolCall" || toolCall.id && currentBlock.id !== toolCall.id) {
|
|
1461
|
-
finishCurrentBlock();
|
|
1462
|
-
currentBlock = {
|
|
1463
|
-
type: "toolCall",
|
|
1464
|
-
id: toolCall.id || "",
|
|
1465
|
-
name: toolCall.function?.name || "",
|
|
1466
|
-
arguments: {},
|
|
1467
|
-
partialArgs: ""
|
|
1468
|
-
};
|
|
1469
|
-
output.content.push(currentBlock);
|
|
1470
|
-
stream.push({
|
|
1471
|
-
type: "toolcall_start",
|
|
1472
|
-
contentIndex: blockIndex(),
|
|
1473
|
-
partial: output
|
|
1474
|
-
});
|
|
1475
|
-
}
|
|
1476
|
-
if (currentBlock.type !== "toolCall") continue;
|
|
1477
|
-
if (toolCall.id) currentBlock.id = toolCall.id;
|
|
1478
|
-
if (toolCall.function?.name) currentBlock.name = toolCall.function.name;
|
|
1479
|
-
if (toolCall.function?.arguments) {
|
|
1480
|
-
currentBlock.partialArgs += toolCall.function.arguments;
|
|
1481
|
-
currentBlock.arguments = parseStreamingJson(currentBlock.partialArgs);
|
|
1482
|
-
stream.push({
|
|
1483
|
-
type: "toolcall_delta",
|
|
1484
|
-
contentIndex: blockIndex(),
|
|
1485
|
-
delta: toolCall.function.arguments,
|
|
1486
|
-
partial: output
|
|
1487
|
-
});
|
|
1488
|
-
}
|
|
1489
|
-
}
|
|
1490
|
-
}
|
|
1491
|
-
finishCurrentBlock();
|
|
1492
|
-
}
|
|
1493
|
-
function detectCompat(model) {
|
|
1494
|
-
const provider = model.provider;
|
|
1495
|
-
const { capabilities, defaults: compatDefaults } = detectOpenAICompletionsCompat(model);
|
|
1496
|
-
const endpointClass = capabilities.endpointClass;
|
|
1497
|
-
const reasoningEffortMap = (endpointClass === "groq-native" || endpointClass === "default" && provider === "groq") && model.id === "qwen/qwen3-32b" ? {
|
|
1498
|
-
minimal: "default",
|
|
1499
|
-
low: "default",
|
|
1500
|
-
medium: "default",
|
|
1501
|
-
high: "default",
|
|
1502
|
-
xhigh: "default"
|
|
1503
|
-
} : {};
|
|
1504
|
-
return {
|
|
1505
|
-
supportsStore: compatDefaults.supportsStore,
|
|
1506
|
-
supportsDeveloperRole: compatDefaults.supportsDeveloperRole,
|
|
1507
|
-
supportsReasoningEffort: compatDefaults.supportsReasoningEffort,
|
|
1508
|
-
reasoningEffortMap,
|
|
1509
|
-
supportsUsageInStreaming: compatDefaults.supportsUsageInStreaming,
|
|
1510
|
-
maxTokensField: compatDefaults.maxTokensField,
|
|
1511
|
-
requiresToolResultName: false,
|
|
1512
|
-
requiresAssistantAfterToolResult: false,
|
|
1513
|
-
requiresThinkingAsText: false,
|
|
1514
|
-
thinkingFormat: compatDefaults.thinkingFormat,
|
|
1515
|
-
openRouterRouting: {},
|
|
1516
|
-
vercelGatewayRouting: {},
|
|
1517
|
-
supportsStrictMode: compatDefaults.supportsStrictMode
|
|
1518
|
-
};
|
|
1519
|
-
}
|
|
1520
|
-
function getCompat(model) {
|
|
1521
|
-
const detected = detectCompat(model);
|
|
1522
|
-
const compat = model.compat ?? {};
|
|
1523
|
-
const supportsStore = typeof compat.supportsStore === "boolean" ? compat.supportsStore : detected.supportsStore;
|
|
1524
|
-
const supportsReasoningEffort = typeof compat.supportsReasoningEffort === "boolean" ? compat.supportsReasoningEffort : detected.supportsReasoningEffort;
|
|
1525
|
-
return {
|
|
1526
|
-
supportsStore,
|
|
1527
|
-
supportsDeveloperRole: compat.supportsDeveloperRole ?? detected.supportsDeveloperRole,
|
|
1528
|
-
supportsReasoningEffort,
|
|
1529
|
-
reasoningEffortMap: compat.reasoningEffortMap ?? detected.reasoningEffortMap,
|
|
1530
|
-
supportsUsageInStreaming: compat.supportsUsageInStreaming ?? detected.supportsUsageInStreaming,
|
|
1531
|
-
maxTokensField: compat.maxTokensField ?? detected.maxTokensField,
|
|
1532
|
-
requiresToolResultName: compat.requiresToolResultName ?? detected.requiresToolResultName,
|
|
1533
|
-
requiresAssistantAfterToolResult: compat.requiresAssistantAfterToolResult ?? detected.requiresAssistantAfterToolResult,
|
|
1534
|
-
requiresThinkingAsText: compat.requiresThinkingAsText ?? detected.requiresThinkingAsText,
|
|
1535
|
-
thinkingFormat: compat.thinkingFormat ?? detected.thinkingFormat,
|
|
1536
|
-
openRouterRouting: compat.openRouterRouting ?? {},
|
|
1537
|
-
vercelGatewayRouting: compat.vercelGatewayRouting ?? detected.vercelGatewayRouting,
|
|
1538
|
-
supportsStrictMode: compat.supportsStrictMode ?? detected.supportsStrictMode,
|
|
1539
|
-
requiresStringContent: compat.requiresStringContent ?? false
|
|
1540
|
-
};
|
|
1541
|
-
}
|
|
1542
|
-
function mapReasoningEffort(effort, reasoningEffortMap) {
|
|
1543
|
-
return reasoningEffortMap[effort] ?? effort;
|
|
1544
|
-
}
|
|
1545
|
-
function resolveOpenAICompletionsReasoningEffort(options) {
|
|
1546
|
-
return options?.reasoningEffort ?? options?.reasoning ?? "high";
|
|
1547
|
-
}
|
|
1548
|
-
function convertTools(tools, compat, model) {
|
|
1549
|
-
const strict = resolveOpenAIStrictToolFlagForInventory(tools, resolveOpenAIStrictToolSetting(model, {
|
|
1550
|
-
transport: "stream",
|
|
1551
|
-
supportsStrictMode: compat?.supportsStrictMode
|
|
1552
|
-
}));
|
|
1553
|
-
return tools.map((tool) => ({
|
|
1554
|
-
type: "function",
|
|
1555
|
-
function: {
|
|
1556
|
-
name: tool.name,
|
|
1557
|
-
description: tool.description,
|
|
1558
|
-
parameters: normalizeOpenAIStrictToolParameters(tool.parameters, strict === true),
|
|
1559
|
-
...strict === void 0 ? {} : { strict }
|
|
1560
|
-
}
|
|
1561
|
-
}));
|
|
1562
|
-
}
|
|
1563
|
-
function buildOpenAICompletionsParams(model, context, options) {
|
|
1564
|
-
const compat = getCompat(model);
|
|
1565
|
-
const messages = convertMessages(model, context.systemPrompt ? {
|
|
1566
|
-
...context,
|
|
1567
|
-
systemPrompt: stripSystemPromptCacheBoundary(context.systemPrompt)
|
|
1568
|
-
} : context, compat);
|
|
1569
|
-
const params = {
|
|
1570
|
-
model: model.id,
|
|
1571
|
-
messages: compat.requiresStringContent ? flattenCompletionMessagesToStringContent(messages) : messages,
|
|
1572
|
-
stream: true
|
|
1573
|
-
};
|
|
1574
|
-
if (compat.supportsUsageInStreaming) params.stream_options = { include_usage: true };
|
|
1575
|
-
if (compat.supportsStore) params.store = false;
|
|
1576
|
-
if (options?.maxTokens) if (compat.maxTokensField === "max_tokens") params.max_tokens = options.maxTokens;
|
|
1577
|
-
else params.max_completion_tokens = options.maxTokens;
|
|
1578
|
-
if (options?.temperature !== void 0) params.temperature = options.temperature;
|
|
1579
|
-
if (context.tools) params.tools = convertTools(context.tools, compat, model);
|
|
1580
|
-
else if (hasToolHistory(context.messages)) params.tools = [];
|
|
1581
|
-
if (options?.toolChoice) params.tool_choice = options.toolChoice;
|
|
1582
|
-
const completionsReasoningEffort = resolveOpenAICompletionsReasoningEffort(options);
|
|
1583
|
-
if (compat.thinkingFormat === "openrouter" && model.reasoning && completionsReasoningEffort) params.reasoning = { effort: mapReasoningEffort(completionsReasoningEffort, compat.reasoningEffortMap) };
|
|
1584
|
-
else if (completionsReasoningEffort && model.reasoning && compat.supportsReasoningEffort) params.reasoning_effort = mapReasoningEffort(completionsReasoningEffort, compat.reasoningEffortMap);
|
|
1585
|
-
return params;
|
|
1586
|
-
}
|
|
1587
|
-
function parseTransportChunkUsage(rawUsage, model) {
|
|
1588
|
-
const cachedTokens = rawUsage.prompt_tokens_details?.cached_tokens || 0;
|
|
1589
|
-
const promptTokens = rawUsage.prompt_tokens || 0;
|
|
1590
|
-
const input = Math.max(0, promptTokens - cachedTokens);
|
|
1591
|
-
const outputTokens = rawUsage.completion_tokens || 0;
|
|
1592
|
-
const usage = {
|
|
1593
|
-
input,
|
|
1594
|
-
output: outputTokens,
|
|
1595
|
-
cacheRead: cachedTokens,
|
|
1596
|
-
cacheWrite: 0,
|
|
1597
|
-
totalTokens: input + outputTokens + cachedTokens,
|
|
1598
|
-
cost: {
|
|
1599
|
-
input: 0,
|
|
1600
|
-
output: 0,
|
|
1601
|
-
cacheRead: 0,
|
|
1602
|
-
cacheWrite: 0,
|
|
1603
|
-
total: 0
|
|
1604
|
-
}
|
|
1605
|
-
};
|
|
1606
|
-
calculateCost(model, usage);
|
|
1607
|
-
return usage;
|
|
1608
|
-
}
|
|
1609
|
-
function mapStopReason(reason) {
|
|
1610
|
-
if (reason === null) return { stopReason: "stop" };
|
|
1611
|
-
switch (reason) {
|
|
1612
|
-
case "stop":
|
|
1613
|
-
case "end": return { stopReason: "stop" };
|
|
1614
|
-
case "length": return { stopReason: "length" };
|
|
1615
|
-
case "function_call":
|
|
1616
|
-
case "tool_calls": return { stopReason: "toolUse" };
|
|
1617
|
-
case "content_filter": return {
|
|
1618
|
-
stopReason: "error",
|
|
1619
|
-
errorMessage: "Provider finish_reason: content_filter"
|
|
1620
|
-
};
|
|
1621
|
-
case "network_error": return {
|
|
1622
|
-
stopReason: "error",
|
|
1623
|
-
errorMessage: "Provider finish_reason: network_error"
|
|
1624
|
-
};
|
|
1625
|
-
default: return {
|
|
1626
|
-
stopReason: "error",
|
|
1627
|
-
errorMessage: `Provider finish_reason: ${reason}`
|
|
1628
|
-
};
|
|
1629
|
-
}
|
|
1630
|
-
}
|
|
1631
|
-
//#endregion
|
|
1632
|
-
export { consumeRateLimitResetMs as _, normalizeOpenAIStrictToolParameters as a, createEmptyTransportUsage as c, finalizeTransportStream as d, mergeTransportHeaders as f, buildGuardedModelFetch as g, transformTransportMessages as h, createOpenAIResponsesTransportStreamFn as i, createWritableTransportEventStream as l, sanitizeTransportPayloadText as m, createAzureOpenAIResponsesTransportStreamFn as n, resolveOpenAIStrictToolFlagForInventory as o, mergeTransportMetadata as p, createOpenAICompletionsTransportStreamFn as r, resolveOpenAIStrictToolSetting as s, buildOpenAICompletionsParams as t, failTransportStream as u, consumeRetryAfterMs as v, normalizeToolParameters as y };
|