shortcutxl 0.3.76 → 0.3.78
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/BINARY-INVENTORY.json +813 -813
- package/CHANGELOG.md +14 -0
- package/dist/ai/models.d.ts +10 -6
- package/dist/ai/models.generated.d.ts +72 -0
- package/dist/ai/models.generated.js +33 -0
- package/dist/ai/models.js +36 -13
- package/dist/ai/providers/anthropic.d.ts +4 -2
- package/dist/ai/providers/anthropic.js +59 -29
- package/dist/ai/providers/azure-openai-responses.d.ts +2 -1
- package/dist/ai/providers/azure-openai-responses.js +4 -20
- package/dist/ai/providers/google-vertex.d.ts +8 -2
- package/dist/ai/providers/google-vertex.js +66 -54
- package/dist/ai/providers/google.js +15 -48
- package/dist/ai/providers/openai-completions.d.ts +4 -1
- package/dist/ai/providers/openai-completions.js +26 -10
- package/dist/ai/providers/openai-reasoning.d.ts +5 -0
- package/dist/ai/providers/openai-reasoning.js +13 -0
- package/dist/ai/providers/openai-responses-shared.js +1 -1
- package/dist/ai/providers/openai-responses.d.ts +6 -2
- package/dist/ai/providers/openai-responses.js +28 -23
- package/dist/ai/providers/simple-options.d.ts +2 -3
- package/dist/ai/providers/simple-options.js +4 -6
- package/dist/ai/types.d.ts +19 -2
- package/dist/app/agent-session-runtime-adapter.js +7 -6
- package/dist/app/agent-session.d.ts +0 -15
- package/dist/app/agent-session.js +0 -37
- package/dist/app/approvals/approval-errors.d.ts +15 -0
- package/dist/app/approvals/approval-errors.js +14 -0
- package/dist/app/approvals/runtime-approval-gates.d.ts +1 -2
- package/dist/app/approvals/tool-approval.d.ts +1 -0
- package/dist/app/approvals/tool-approval.js +11 -23
- package/dist/app/approvals/types.d.ts +0 -14
- package/dist/app/approvals/types.js +0 -2
- package/dist/app/background/tool-summaries.js +0 -2
- package/dist/app/extensions/slash-commands.js +1 -3
- package/dist/app/local/tools/execute-code/executor.d.ts +1 -1
- package/dist/app/local/tools/execute-code/executor.js +20 -10
- package/dist/app/local/tools/execute-code/tool.js +21 -2
- package/dist/app/modes/action/agent.js +4 -5
- package/dist/app/modes/ask/agent.js +4 -6
- package/dist/app/modes/index.js +20 -10
- package/dist/app/modes/installation/agent.js +4 -5
- package/dist/app/modes/manage/agent.js +3 -4
- package/dist/app/modes/manage/prompt.js +1 -2
- package/dist/app/modes/metadata.d.ts +31 -0
- package/dist/app/modes/metadata.js +35 -0
- package/dist/app/modes/plan/agent.js +5 -8
- package/dist/app/modes/plan/prompt.js +3 -3
- package/dist/app/permissions/runtime-approval-flow.d.ts +1 -5
- package/dist/app/permissions/runtime-approval-flow.js +0 -28
- package/dist/app/permissions/tool-gates.d.ts +2 -3
- package/dist/app/permissions/tool-gates.js +3 -81
- package/dist/app/prompts/com-api.js +1 -1
- package/dist/app/prompts/shared-guidelines.js +7 -3
- package/dist/app/providers/google-vertex-gateway.js +4 -51
- package/dist/app/providers/model-registry.d.ts +1 -0
- package/dist/app/providers/model-registry.js +39 -0
- package/dist/app/providers/model-resolver.js +10 -7
- package/dist/app/providers/register-shortcut-provider.js +6 -6
- package/dist/app/providers/shortcut-api-v2-transport.js +4 -0
- package/dist/app/providers/shortcut-llm-proxy-client.d.ts +2 -2
- package/dist/app/providers/shortcut-llm-proxy-client.js +1 -0
- package/dist/app/resources/package-manager.js +2 -123
- package/dist/app/resources/resource-patterns.d.ts +9 -0
- package/dist/app/resources/resource-patterns.js +120 -0
- package/dist/app/session/forked-agent.d.ts +2 -2
- package/dist/app/session/model-manager.js +3 -2
- package/dist/app/session/session-lifecycle.js +3 -2
- package/dist/app/session/session-models.d.ts +2 -0
- package/dist/app/session/session-models.js +14 -6
- package/dist/app/settings-manager.d.ts +3 -3
- package/dist/app/shared/tools/execute-code/mog.d.ts +3 -1
- package/dist/app/shared/tools/execute-code/mog.js +18 -2
- package/dist/app/tools/bash.js +3 -3
- package/dist/app/tools/execute-code/index.d.ts +1 -0
- package/dist/app/tools/execute-code/index.js +3 -1
- package/dist/app/tools/find-ignore-files.d.ts +3 -0
- package/dist/app/tools/find-ignore-files.js +33 -0
- package/dist/app/tools/find.js +2 -21
- package/dist/app/tools/llm-analysis.js +0 -2
- package/dist/app/tools/refresh-context.d.ts +1 -1
- package/dist/app/tools/session-settings/update-session-settings.js +2 -2
- package/dist/app/tools/switch-mode.js +2 -2
- package/dist/app/tools/take-screenshot.js +0 -2
- package/dist/app/tools/task/runner.js +1 -2
- package/dist/app/tools/task/task.d.ts +1 -3
- package/dist/app/tools/task/task.js +20 -40
- package/dist/app/tools/web-search.js +12 -2
- package/dist/autocomplete/core.d.ts +33 -0
- package/dist/autocomplete/core.js +113 -0
- package/dist/{tui → autocomplete}/fuzzy.d.ts +0 -1
- package/dist/{tui → autocomplete}/fuzzy.js +0 -1
- package/dist/{tui/autocomplete.d.ts → autocomplete/index.d.ts} +0 -1
- package/dist/{tui/autocomplete.js → autocomplete/index.js} +62 -158
- package/dist/cli/args.js +1 -1
- package/dist/cli/list-models.js +1 -1
- package/dist/cli.js +26227 -30480
- package/dist/constants.d.ts +0 -2
- package/dist/constants.js +0 -3
- package/dist/contracts/agent-session-store.d.ts +1 -1
- package/dist/contracts/agent-settings.d.ts +1 -0
- package/dist/contracts/agent-settings.js +2 -1
- package/dist/contracts/model-call.d.ts +1 -2
- package/dist/contracts/model-call.js +1 -2
- package/dist/contracts/model-stream.d.ts +1 -0
- package/dist/contracts/model-stream.js +1 -0
- package/dist/contracts/wire.d.ts +10 -7
- package/dist/contracts/wire.js +8 -0
- package/dist/core/agent-engine.js +1 -1
- package/dist/core/core-types.d.ts +1 -21
- package/dist/core/defaults.d.ts +1 -1
- package/dist/core/defaults.js +9 -1
- package/dist/core/prompts/agent-guidelines.d.ts +4 -5
- package/dist/core/prompts/agent-guidelines.js +28 -42
- package/dist/core/session-schema.d.ts +1 -1
- package/dist/embedded-agent/ai-invoke.d.ts +1 -2
- package/dist/embedded-agent/ai-invoke.js +2 -70
- package/dist/embedded-agent/anthropic-messages-transport.d.ts +4 -20
- package/dist/embedded-agent/anthropic-messages-transport.js +23 -786
- package/dist/embedded-agent/bootstrap.js +2 -2
- package/dist/embedded-agent/compose.js +8 -7
- package/dist/embedded-agent/gateway-base-url.d.ts +3 -0
- package/dist/embedded-agent/gateway-base-url.js +35 -0
- package/dist/embedded-agent/google-vertex-transport.d.ts +2 -11
- package/dist/embedded-agent/google-vertex-transport.js +20 -117
- package/dist/embedded-agent/host-runtime-options.d.ts +0 -8
- package/dist/embedded-agent/host-runtime-options.js +10 -2
- package/dist/embedded-agent/host-tools/invoke-llm/contract.d.ts +2 -2
- package/dist/embedded-agent/host-tools/invoke-llm/contract.js +4 -2
- package/dist/embedded-agent/host-tools/sandbox-llm/contract.d.ts +8 -3
- package/dist/embedded-agent/host-tools/sandbox-llm/contract.js +12 -8
- package/dist/embedded-agent/host-tools/sandbox-llm/index.d.ts +1 -1
- package/dist/embedded-agent/host-tools/sandbox-llm/index.js +1 -1
- package/dist/embedded-agent/host-tools/shared/index.d.ts +1 -1
- package/dist/embedded-agent/host-tools/shared/index.js +1 -1
- package/dist/embedded-agent/host-tools/shared/llm-stream-error.d.ts +7 -0
- package/dist/embedded-agent/host-tools/shared/llm-stream-error.js +10 -0
- package/dist/embedded-agent/host-tools/take-screenshot/contract.d.ts +0 -2
- package/dist/embedded-agent/host-tools/take-screenshot/contract.js +1 -3
- package/dist/embedded-agent/host-tools/take-screenshot/index.d.ts +1 -1
- package/dist/embedded-agent/host-tools/take-screenshot/index.js +1 -1
- package/dist/embedded-agent/host-tools/task/agents/clone.js +1 -2
- package/dist/embedded-agent/host-tools/task/contract.js +1 -1
- package/dist/embedded-agent/index.d.ts +3 -4
- package/dist/embedded-agent/index.js +2 -3
- package/dist/embedded-agent/model-selection.d.ts +0 -6
- package/dist/embedded-agent/model-selection.js +15 -8
- package/dist/embedded-agent/openai-completions-transport.d.ts +2 -11
- package/dist/embedded-agent/openai-completions-transport.js +20 -120
- package/dist/embedded-agent/openai-responses-transport.d.ts +2 -11
- package/dist/embedded-agent/openai-responses-transport.js +15 -170
- package/dist/embedded-agent/prompt/build.js +1 -2
- package/dist/embedded-agent/prompt/sections.d.ts +1 -1
- package/dist/embedded-agent/prompt/sections.js +2 -0
- package/dist/embedded-agent/provider-native-request.d.ts +29 -0
- package/dist/embedded-agent/provider-native-request.js +65 -0
- package/dist/embedded-agent/run-stats.d.ts +1 -1
- package/dist/embedded-agent/stream.d.ts +10 -96
- package/dist/embedded-agent/stream.js +31 -556
- package/dist/embedded-agent/suggestions.d.ts +1 -1
- package/dist/embedded-agent/suggestions.js +1 -1
- package/dist/embedded-agent/worker-bridge/host-client.d.ts +7 -0
- package/dist/embedded-agent/worker-bridge/host-client.js +15 -0
- package/dist/embedded-agent/worker-bridge/worker-port.js +17 -1
- package/dist/main.js +18 -14
- package/dist/rpc/index.d.ts +1 -1
- package/dist/rpc/rpc-approval-gates.js +1 -2
- package/dist/rpc/rpc-host.d.ts +4 -0
- package/dist/rpc/rpc-host.js +13 -24
- package/dist/rpc/rpc-types.d.ts +6 -17
- package/dist/shared/platform/open.d.ts +4 -1
- package/dist/shared/platform/open.js +14 -2
- package/dist/shell/approvals/runtime-approval-gates.js +1 -3
- package/dist/shell/components/selectors/model-selector.js +2 -1
- package/dist/shell/components/selectors/session-selector-search.js +1 -1
- package/dist/shell/components/selectors/thinking-selector.js +7 -6
- package/dist/shell/index.d.ts +0 -1
- package/dist/shell/index.js +0 -1
- package/dist/shell/interactive/interactive-mode-options.d.ts +10 -0
- package/dist/shell/interactive/interactive-mode.d.ts +6 -12
- package/dist/shell/interactive/interactive-mode.js +39 -158
- package/dist/shell/interactive/slash-commands.d.ts +0 -34
- package/dist/shell/interactive/slash-commands.js +0 -2
- package/dist/shell/links/local-file-link-input.d.ts +15 -0
- package/dist/shell/links/local-file-link-input.js +38 -0
- package/dist/shell/links/local-file-link.d.ts +7 -0
- package/dist/shell/links/local-file-link.js +35 -0
- package/dist/shell/links/local-file-opener.d.ts +16 -0
- package/dist/shell/links/local-file-opener.js +90 -0
- package/dist/shell/session-client.d.ts +0 -1
- package/dist/shell/session-client.js +0 -6
- package/dist/shell/status/update-check-scheduler.d.ts +30 -0
- package/dist/shell/status/update-check-scheduler.js +71 -0
- package/dist/shell/status/update-reminder-controller.d.ts +22 -0
- package/dist/shell/status/update-reminder-controller.js +40 -0
- package/dist/shell/status/update-reminder.d.ts +6 -0
- package/dist/shell/status/update-reminder.js +4 -0
- package/dist/shell/theme/dark.json +1 -2
- package/dist/shell/theme/light.json +1 -2
- package/dist/shell/theme/runtime.d.ts +2 -3
- package/dist/shell/theme/runtime.js +2 -6
- package/dist/shell/theme/theme-schema.json +1 -6
- package/dist/shortcut-model-catalog.d.ts +7 -2
- package/dist/shortcut-model-catalog.js +134 -10
- package/dist/startup/update-manager.d.ts +6 -6
- package/dist/startup/update-manager.js +23 -38
- package/dist/startup/update-prompt.d.ts +1 -0
- package/dist/startup/update-prompt.js +2 -2
- package/dist/tui/components/editor.d.ts +1 -1
- package/dist/tui/components/editor.js +1 -1
- package/dist/tui/components/markdown.js +15 -6
- package/dist/tui/components/settings-list.js +1 -1
- package/dist/tui/editor-component.d.ts +1 -1
- package/dist/tui/index.d.ts +7 -8
- package/dist/tui/index.js +7 -6
- package/dist/tui/tui.d.ts +2 -0
- package/dist/tui/tui.js +16 -1
- package/dist/tui/utils.d.ts +7 -0
- package/dist/tui/utils.js +58 -8
- package/native-app/main/index.js +3200 -48
- package/native-app/main/{photon_rs-SoVDgheu.js → photon_rs-XkYyYTVA.js} +2 -2
- package/native-app/package.json +1 -1
- package/native-app/preload/index.cjs +2 -0
- package/native-app/renderer/assets/{index-CFc-oZuS.js → index-B4jz6epR.js} +825 -155
- package/native-app/renderer/assets/{index-OhGE0UY4.css → index-C__g36ft.css} +412 -162
- package/native-app/renderer/assets/shortcutagent-DxFsGSkw.png +0 -0
- package/native-app/renderer/index.html +2 -2
- package/package.json +17 -3
- package/skills/add-custom-model/SKILL.md +52 -0
- package/user-docs/dist/index.html +1 -1
- package/user-docs/dist/shortcutxl-docs.pdf +0 -0
- package/xll/ShortcutXL.xll +0 -0
- package/xll/modules/shortcut_xl/_managed.py +26 -7
- package/xll/modules/shortcut_xl/_tracking.py +141 -251
- package/xll/modules/shortcut_xl/api/__init__.py +60 -0
- package/xll/modules/shortcut_xl/api/workbook.py +9 -1
- package/xll/modules/shortcut_xl/api/worksheet.py +4 -1
- package/xll/python/Lib/site-packages/httpx-0.28.1.dist-info/RECORD +1 -1
- package/xll/python/Lib/site-packages/idna-3.18.dist-info/RECORD +1 -1
- package/xll/python/Lib/site-packages/pip/__init__.py +1 -1
- package/xll/python/Lib/site-packages/pip/_internal/build_env/__init__.py +25 -0
- package/xll/python/Lib/site-packages/pip/_internal/build_env/base.py +103 -0
- package/xll/python/Lib/site-packages/pip/_internal/build_env/installer.py +333 -0
- package/xll/python/Lib/site-packages/pip/_internal/build_env/noop.py +42 -0
- package/xll/python/Lib/site-packages/pip/_internal/build_env/venv.py +145 -0
- package/xll/python/Lib/site-packages/pip/_internal/build_env/virtual.py +139 -0
- package/xll/python/Lib/site-packages/pip/_internal/cache.py +4 -1
- package/xll/python/Lib/site-packages/pip/_internal/cli/autocompletion.py +4 -1
- package/xll/python/Lib/site-packages/pip/_internal/cli/base_command.py +11 -14
- package/xll/python/Lib/site-packages/pip/_internal/cli/cmdoptions.py +133 -22
- package/xll/python/Lib/site-packages/pip/_internal/cli/index_command.py +11 -6
- package/xll/python/Lib/site-packages/pip/_internal/cli/main.py +2 -1
- package/xll/python/Lib/site-packages/pip/_internal/cli/main_parser.py +1 -2
- package/xll/python/Lib/site-packages/pip/_internal/cli/parser.py +10 -2
- package/xll/python/Lib/site-packages/pip/_internal/cli/progress_bars.py +2 -2
- package/xll/python/Lib/site-packages/pip/_internal/cli/req_command.py +57 -25
- package/xll/python/Lib/site-packages/pip/_internal/cli/status_codes.py +1 -0
- package/xll/python/Lib/site-packages/pip/_internal/commands/cache.py +7 -6
- package/xll/python/Lib/site-packages/pip/_internal/commands/configuration.py +2 -1
- package/xll/python/Lib/site-packages/pip/_internal/commands/debug.py +4 -5
- package/xll/python/Lib/site-packages/pip/_internal/commands/download.py +4 -0
- package/xll/python/Lib/site-packages/pip/_internal/commands/freeze.py +1 -1
- package/xll/python/Lib/site-packages/pip/_internal/commands/index.py +10 -3
- package/xll/python/Lib/site-packages/pip/_internal/commands/inspect.py +1 -1
- package/xll/python/Lib/site-packages/pip/_internal/commands/install.py +6 -6
- package/xll/python/Lib/site-packages/pip/_internal/commands/list.py +11 -6
- package/xll/python/Lib/site-packages/pip/_internal/commands/lock.py +4 -6
- package/xll/python/Lib/site-packages/pip/_internal/commands/show.py +14 -8
- package/xll/python/Lib/site-packages/pip/_internal/commands/wheel.py +7 -1
- package/xll/python/Lib/site-packages/pip/_internal/configuration.py +2 -3
- package/xll/python/Lib/site-packages/pip/_internal/distributions/base.py +5 -3
- package/xll/python/Lib/site-packages/pip/_internal/distributions/installed.py +3 -2
- package/xll/python/Lib/site-packages/pip/_internal/distributions/sdist.py +45 -20
- package/xll/python/Lib/site-packages/pip/_internal/distributions/wheel.py +3 -2
- package/xll/python/Lib/site-packages/pip/_internal/exceptions.py +174 -0
- package/xll/python/Lib/site-packages/pip/_internal/index/collector.py +70 -48
- package/xll/python/Lib/site-packages/pip/_internal/index/package_finder.py +46 -7
- package/xll/python/Lib/site-packages/pip/_internal/index/sources.py +1 -2
- package/xll/python/Lib/site-packages/pip/_internal/locations/_sysconfig.py +1 -1
- package/xll/python/Lib/site-packages/pip/_internal/locations/base.py +1 -1
- package/xll/python/Lib/site-packages/pip/_internal/metadata/base.py +10 -5
- package/xll/python/Lib/site-packages/pip/_internal/metadata/importlib/_dists.py +1 -1
- package/xll/python/Lib/site-packages/pip/_internal/metadata/importlib/_envs.py +8 -3
- package/xll/python/Lib/site-packages/pip/_internal/models/candidate.py +5 -1
- package/xll/python/Lib/site-packages/pip/_internal/models/link.py +53 -13
- package/xll/python/Lib/site-packages/pip/_internal/network/auth.py +38 -21
- package/xll/python/Lib/site-packages/pip/_internal/network/cache.py +2 -2
- package/xll/python/Lib/site-packages/pip/_internal/network/download.py +58 -11
- package/xll/python/Lib/site-packages/pip/_internal/network/session.py +35 -40
- package/xll/python/Lib/site-packages/pip/_internal/network/utils.py +109 -1
- package/xll/python/Lib/site-packages/pip/_internal/operations/check.py +2 -3
- package/xll/python/Lib/site-packages/pip/_internal/operations/install/wheel.py +23 -18
- package/xll/python/Lib/site-packages/pip/_internal/operations/prepare.py +152 -7
- package/xll/python/Lib/site-packages/pip/_internal/req/__init__.py +2 -0
- package/xll/python/Lib/site-packages/pip/_internal/req/constructors.py +54 -69
- package/xll/python/Lib/site-packages/pip/_internal/req/req_file.py +6 -6
- package/xll/python/Lib/site-packages/pip/_internal/req/req_install.py +25 -21
- package/xll/python/Lib/site-packages/pip/_internal/req/req_uninstall.py +13 -8
- package/xll/python/Lib/site-packages/pip/_internal/resolution/base.py +2 -2
- package/xll/python/Lib/site-packages/pip/_internal/resolution/legacy/resolver.py +2 -2
- package/xll/python/Lib/site-packages/pip/_internal/resolution/resolvelib/base.py +1 -1
- package/xll/python/Lib/site-packages/pip/_internal/resolution/resolvelib/candidates.py +0 -1
- package/xll/python/Lib/site-packages/pip/_internal/resolution/resolvelib/factory.py +39 -52
- package/xll/python/Lib/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +3 -3
- package/xll/python/Lib/site-packages/pip/_internal/resolution/resolvelib/provider.py +3 -0
- package/xll/python/Lib/site-packages/pip/_internal/resolution/resolvelib/resolver.py +9 -0
- package/xll/python/Lib/site-packages/pip/_internal/utils/compat.py +15 -9
- package/xll/python/Lib/site-packages/pip/_internal/utils/deprecation.py +6 -1
- package/xll/python/Lib/site-packages/pip/_internal/utils/filesystem.py +2 -2
- package/xll/python/Lib/site-packages/pip/_internal/utils/logging.py +11 -3
- package/xll/python/Lib/site-packages/pip/_internal/utils/misc.py +48 -4
- package/xll/python/Lib/site-packages/pip/_internal/utils/pylock.py +18 -2
- package/xll/python/Lib/site-packages/pip/_internal/utils/retry.py +2 -1
- package/xll/python/Lib/site-packages/pip/_internal/utils/subprocess.py +4 -3
- package/xll/python/Lib/site-packages/pip/_internal/utils/temp_dir.py +1 -2
- package/xll/python/Lib/site-packages/pip/_internal/utils/unpacking.py +30 -4
- package/xll/python/Lib/site-packages/pip/_internal/utils/urls.py +5 -2
- package/xll/python/Lib/site-packages/pip/_internal/utils/virtualenv.py +2 -36
- package/xll/python/Lib/site-packages/pip/_internal/vcs/git.py +8 -5
- package/xll/python/Lib/site-packages/pip/_internal/vcs/versioncontrol.py +1 -2
- package/xll/python/Lib/site-packages/pip/_internal/wheel_builder.py +5 -1
- package/xll/python/Lib/site-packages/pip/_vendor/bom.cdx.json +231 -0
- package/xll/python/Lib/site-packages/pip/_vendor/certifi/__init__.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/certifi/cacert.pem +0 -631
- package/xll/python/Lib/site-packages/pip/_vendor/distlib/__init__.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/distlib/compat.py +34 -64
- package/xll/python/Lib/site-packages/pip/_vendor/distlib/resources.py +28 -14
- package/xll/python/Lib/site-packages/pip/_vendor/distlib/scripts.py +7 -3
- package/xll/python/Lib/site-packages/pip/_vendor/distlib/util.py +48 -11
- package/xll/python/Lib/site-packages/pip/_vendor/idna/LICENSE.md +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/idna/__main__.py +6 -0
- package/xll/python/Lib/site-packages/pip/_vendor/idna/cli.py +128 -0
- package/xll/python/Lib/site-packages/pip/_vendor/idna/codec.py +50 -13
- package/xll/python/Lib/site-packages/pip/_vendor/idna/compat.py +26 -0
- package/xll/python/Lib/site-packages/pip/_vendor/idna/core.py +352 -141
- package/xll/python/Lib/site-packages/pip/_vendor/idna/idnadata.py +571 -2983
- package/xll/python/Lib/site-packages/pip/_vendor/idna/intranges.py +5 -7
- package/xll/python/Lib/site-packages/pip/_vendor/idna/package_data.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/idna/uts46data.py +16887 -8832
- package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/__init__.py +352 -66
- package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/__main__.py +11 -0
- package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/_xdg.py +171 -0
- package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/android.py +92 -41
- package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/api.py +213 -49
- package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/macos.py +128 -51
- package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/unix.py +176 -127
- package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/version.py +8 -18
- package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/windows.py +185 -68
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/__init__.py +2 -2
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/__main__.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/console.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/filter.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/filters/__init__.py +10 -8
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/formatter.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/formatters/__init__.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/lexer.py +7 -5
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/lexers/__init__.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/lexers/_mapping.py +9 -8
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/lexers/python.py +35 -32
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/modeline.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/plugin.py +3 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/regexopt.py +13 -2
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/scanner.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/sphinxext.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/style.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/styles/__init__.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/token.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/unistring.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/pygments/util.py +2 -2
- package/xll/python/Lib/site-packages/pip/_vendor/requests/__init__.py +52 -16
- package/xll/python/Lib/site-packages/pip/_vendor/requests/__version__.py +2 -2
- package/xll/python/Lib/site-packages/pip/_vendor/requests/_internal_utils.py +2 -2
- package/xll/python/Lib/site-packages/pip/_vendor/requests/_types.py +183 -0
- package/xll/python/Lib/site-packages/pip/_vendor/requests/adapters.py +101 -50
- package/xll/python/Lib/site-packages/pip/_vendor/requests/api.py +31 -8
- package/xll/python/Lib/site-packages/pip/_vendor/requests/auth.py +80 -40
- package/xll/python/Lib/site-packages/pip/_vendor/requests/compat.py +9 -3
- package/xll/python/Lib/site-packages/pip/_vendor/requests/cookies.py +143 -79
- package/xll/python/Lib/site-packages/pip/_vendor/requests/exceptions.py +15 -5
- package/xll/python/Lib/site-packages/pip/_vendor/requests/help.py +13 -10
- package/xll/python/Lib/site-packages/pip/_vendor/requests/hooks.py +23 -9
- package/xll/python/Lib/site-packages/pip/_vendor/requests/models.py +265 -126
- package/xll/python/Lib/site-packages/pip/_vendor/requests/py.typed +0 -0
- package/xll/python/Lib/site-packages/pip/_vendor/requests/sessions.py +164 -78
- package/xll/python/Lib/site-packages/pip/_vendor/requests/status_codes.py +2 -2
- package/xll/python/Lib/site-packages/pip/_vendor/requests/structures.py +51 -20
- package/xll/python/Lib/site-packages/pip/_vendor/requests/utils.py +161 -89
- package/xll/python/Lib/site-packages/pip/_vendor/tomli/__init__.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/tomli/_parser.py +9 -4
- package/xll/python/Lib/site-packages/pip/_vendor/tomli/_re.py +13 -9
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/_base_connection.py +3 -1
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/_collections.py +0 -1
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/_version.py +8 -18
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/connection.py +4 -4
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py +23 -10
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/contrib/emscripten/response.py +5 -1
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +7 -8
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/contrib/socks.py +1 -1
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/exceptions.py +2 -2
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/fields.py +14 -14
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/poolmanager.py +8 -6
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/response.py +35 -22
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/util/retry.py +8 -0
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/util/ssl_.py +11 -61
- package/xll/python/Lib/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.py +5 -11
- package/xll/python/Lib/site-packages/pip/_vendor/vendor.txt +8 -8
- package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/METADATA +3 -2
- package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/RECORD +208 -188
- package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/AUTHORS.txt +20 -0
- package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/idna/LICENSE.md +1 -1
- package/xll/python/Lib/site-packages/pywin32-311.dist-info/RECORD +2 -2
- package/xll/python/Scripts/httpx.exe +0 -0
- package/xll/python/Scripts/idna.exe +0 -0
- package/xll/python/Scripts/pip.exe +0 -0
- package/xll/python/Scripts/pip3.13.exe +0 -0
- package/xll/python/Scripts/pip3.exe +0 -0
- package/xll/python/Scripts/pywin32_postinstall.exe +0 -0
- package/xll/python/Scripts/pywin32_testall.exe +0 -0
- package/dist/app/collab/awareness.d.ts +0 -32
- package/dist/app/collab/awareness.js +0 -52
- package/dist/app/collab/collab-client.d.ts +0 -37
- package/dist/app/collab/collab-client.js +0 -208
- package/dist/app/collab/collab-manager.d.ts +0 -91
- package/dist/app/collab/collab-manager.js +0 -218
- package/dist/app/collab/collab-sync.d.ts +0 -62
- package/dist/app/collab/collab-sync.js +0 -215
- package/dist/app/collab/index.d.ts +0 -9
- package/dist/app/collab/index.js +0 -6
- package/dist/app/collab/super-fight.d.ts +0 -90
- package/dist/app/collab/super-fight.js +0 -310
- package/dist/app/collab/sync-bridge.d.ts +0 -35
- package/dist/app/collab/sync-bridge.js +0 -109
- package/dist/app/collab/types.d.ts +0 -75
- package/dist/app/collab/types.js +0 -5
- package/dist/embedded-agent/ai-content.d.ts +0 -52
- package/dist/embedded-agent/ai-content.js +0 -101
- package/dist/embedded-agent/host-tools/shared/llm-stream.d.ts +0 -31
- package/dist/embedded-agent/host-tools/shared/llm-stream.js +0 -136
- package/dist/embedded-agent/model-call-orchestrator.d.ts +0 -22
- package/dist/embedded-agent/model-call-orchestrator.js +0 -22
- package/dist/embedded-agent/stream-errors.d.ts +0 -10
- package/dist/embedded-agent/stream-errors.js +0 -73
- package/dist/embedded-agent/stream-message-state.d.ts +0 -14
- package/dist/embedded-agent/stream-message-state.js +0 -271
- package/dist/embedded-agent/stream-sse.d.ts +0 -78
- package/dist/embedded-agent/stream-sse.js +0 -73
- package/dist/shell/approvals/task-spawn-approval.d.ts +0 -20
- package/dist/shell/approvals/task-spawn-approval.js +0 -93
- package/dist/shell/interactive/collab-command.d.ts +0 -9
- package/dist/shell/interactive/collab-command.js +0 -115
- package/dist/shell/interactive/super-fight-ui.d.ts +0 -80
- package/dist/shell/interactive/super-fight-ui.js +0 -484
- package/dist/shell/status/collab-status.d.ts +0 -18
- package/dist/shell/status/collab-status.js +0 -46
- package/xll/python/Lib/site-packages/pip/_internal/build_env.py +0 -606
- /package/dist/{tui → autocomplete}/skill-autocomplete.js +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/INSTALLER +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/REQUESTED +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/WHEEL +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/entry_points.txt +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/LICENSE.txt +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/cachecontrol/LICENSE.txt +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/certifi/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/distlib/LICENSE.txt +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/distro/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/msgpack/COPYING +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/packaging/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/packaging/LICENSE.APACHE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/packaging/LICENSE.BSD +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/pkg_resources/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/platformdirs/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/pygments/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/pyproject_hooks/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/requests/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/resolvelib/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/rich/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/tomli/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/tomli_w/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/truststore/LICENSE +0 -0
- /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/src/pip/_vendor/urllib3/LICENSE.txt +0 -0
|
@@ -17,20 +17,19 @@ import type { EmbeddedErrorRecoverySettings } from './settings.js';
|
|
|
17
17
|
export { createAgentSnapshotFromAgentMessages } from '../core/agent-snapshot-builder.js';
|
|
18
18
|
export { assertSessionInvariants, buildSessionContextMessageEntryIds, canonicalizeUserMessageEntries, parseSessionEntriesStrict, repairOrphanToolUses, serializeFileEntries } from '../core/session-schema.js';
|
|
19
19
|
export type { CompactionEntry, FileEntry, LlmCallEntry, ModelChangeEntry, ParseSessionStrictResult, RepairOrphanToolUsesOptions, RepairOrphanToolUsesResult, SessionEntry, SessionHeader, SessionInvariantViolation, SessionMessageEntry, SessionParseError, SpeedChangeEntry, SystemPromptEntry, ThinkingLevelChangeEntry, ToolDefinitionsEntry, TurnEndEntry, TurnStartEntry } from '../core/session-schema.js';
|
|
20
|
-
export { assistantMessageToShortcutXLInvokeResponse, createShortcutXLAiModelInvokeRequestFromParams
|
|
20
|
+
export { assistantMessageToShortcutXLInvokeResponse, createShortcutXLAiModelInvokeRequestFromParams } from './ai-invoke.js';
|
|
21
21
|
export { createShortcutXLAgentSettingsStore, createShortcutXLDefaultSessionContext } from './bootstrap.js';
|
|
22
22
|
export { buildHostEmbeddedAgentOptions, type BuildHostEmbeddedAgentOptionsInput, type BuildHostEmbeddedAgentOptionsResult } from './host-runtime-options.js';
|
|
23
23
|
export { detectEmbeddedReadOnlyViolations } from './host-tools/execute-code/index.js';
|
|
24
24
|
export { getHostToolTimeoutMs } from './host-tools/timeouts.js';
|
|
25
|
-
export { createShortcutProxyModelStreamTransport, createShortcutXLModelCallOrchestrator, runShortcutXLModelCallStreamRequest, type CreateShortcutXLModelCallOrchestratorOptions, type ShortcutXLModelCallOrchestrator, type ShortcutXLModelStreamTransport, type ShortcutXLModelUsageStatusLogger } from './model-call-orchestrator.js';
|
|
26
25
|
export { createShortcutXLAgentModel, createShortcutXLAgentModelRegistry, ShortcutXLAgentModelId, ShortcutXLAgentProviderId, type CreateShortcutXLAgentModelOptions, type CreateShortcutXLAgentModelRegistryOptions } from './model-registry.js';
|
|
27
26
|
export { buildShortcutXLAgentSystemPrompt, createShortcutXLAgentConfiguration, ShortcutXLPromptMode, type ShortcutXLPromptPlatform } from './prompt/build.js';
|
|
28
27
|
export { createRunStatsAccumulator, type CreateRunStatsAccumulatorOptions, type RunStatsAccumulator, type RunStatsEntry, type RunStatsModelUsage, type RunStatsSnapshot, type RunStatsTokenUsageByModel } from './run-stats.js';
|
|
29
28
|
export { EmbeddedSessionEntryBuilder, type AgentToolDefinitionSnapshot } from './session-entry-builder.js';
|
|
30
29
|
export { createShortcutXLAgentSessionStore, type CreateShortcutXLAgentSessionStoreOptions, type ShortcutXLAgentSessionArtifacts, type ShortcutXLAgentSessionStore, type ShortcutXLSessionWriter } from './session-store.js';
|
|
31
30
|
export { pushShortcutXLModelStreamEvent } from './stream-events.js';
|
|
32
|
-
export { buildShortcutRuntimeRequestBody,
|
|
33
|
-
export { createEmbeddedAgentPortClient, ShortcutXLModelStreamTraceKind, type CreateEmbeddedAgentPortClientOptions, type EmbeddedAgentPortClient, type ShortcutXLModelStreamBridgeMetrics, type ShortcutXLModelStreamRequestHandler, type ShortcutXLModelStreamTraceEntry, type ShortcutXLWorkerPort } from './worker-bridge/host-client.js';
|
|
31
|
+
export { buildShortcutRuntimeRequestBody, createShortcutXLModelStreamRequest, type CreateShortcutXLModelStreamRequestOptions, type RunShortcutXLModelStreamRequestOptions, type ShortcutRuntimeRequestBody } from './stream.js';
|
|
32
|
+
export { createEmbeddedAgentPortClient, ShortcutXLModelStreamTraceKind, type CreateEmbeddedAgentPortClientOptions, type EmbeddedAgentPortClient, type ShortcutXLInitialSubmitReceipt, type ShortcutXLModelStreamBridgeMetrics, type ShortcutXLModelStreamRequestHandler, type ShortcutXLModelStreamTraceEntry, type ShortcutXLWorkerPort } from './worker-bridge/host-client.js';
|
|
34
33
|
export { AgentExecuteCodeModeValue as AgentExecuteCodeMode, ExecuteCodeSurfaceValue as ExecuteCodeSurface };
|
|
35
34
|
/** Host-provided knobs the runtime reads at boot and per turn. */
|
|
36
35
|
export interface EmbeddedAgentSettingsStore {
|
|
@@ -4,19 +4,18 @@ export { createAgentSnapshotFromAgentMessages } from '../core/agent-snapshot-bui
|
|
|
4
4
|
export {
|
|
5
5
|
// Pure session helpers shared by the embedded host for upload and hydration.
|
|
6
6
|
assertSessionInvariants, buildSessionContextMessageEntryIds, canonicalizeUserMessageEntries, parseSessionEntriesStrict, repairOrphanToolUses, serializeFileEntries } from '../core/session-schema.js';
|
|
7
|
-
export { assistantMessageToShortcutXLInvokeResponse, createShortcutXLAiModelInvokeRequestFromParams
|
|
7
|
+
export { assistantMessageToShortcutXLInvokeResponse, createShortcutXLAiModelInvokeRequestFromParams } from './ai-invoke.js';
|
|
8
8
|
export { createShortcutXLAgentSettingsStore, createShortcutXLDefaultSessionContext } from './bootstrap.js';
|
|
9
9
|
export { buildHostEmbeddedAgentOptions } from './host-runtime-options.js';
|
|
10
10
|
export { detectEmbeddedReadOnlyViolations } from './host-tools/execute-code/index.js';
|
|
11
11
|
export { getHostToolTimeoutMs } from './host-tools/timeouts.js';
|
|
12
|
-
export { createShortcutProxyModelStreamTransport, createShortcutXLModelCallOrchestrator, runShortcutXLModelCallStreamRequest } from './model-call-orchestrator.js';
|
|
13
12
|
export { createShortcutXLAgentModel, createShortcutXLAgentModelRegistry, ShortcutXLAgentModelId, ShortcutXLAgentProviderId } from './model-registry.js';
|
|
14
13
|
export { buildShortcutXLAgentSystemPrompt, createShortcutXLAgentConfiguration, ShortcutXLPromptMode } from './prompt/build.js';
|
|
15
14
|
export { createRunStatsAccumulator } from './run-stats.js';
|
|
16
15
|
export { EmbeddedSessionEntryBuilder } from './session-entry-builder.js';
|
|
17
16
|
export { createShortcutXLAgentSessionStore } from './session-store.js';
|
|
18
17
|
export { pushShortcutXLModelStreamEvent } from './stream-events.js';
|
|
19
|
-
export { buildShortcutRuntimeRequestBody,
|
|
18
|
+
export { buildShortcutRuntimeRequestBody, createShortcutXLModelStreamRequest } from './stream.js';
|
|
20
19
|
export { createEmbeddedAgentPortClient, ShortcutXLModelStreamTraceKind } from './worker-bridge/host-client.js';
|
|
21
20
|
export { AgentExecuteCodeModeValue as AgentExecuteCodeMode, ExecuteCodeSurfaceValue as ExecuteCodeSurface };
|
|
22
21
|
export { EmbeddedAgentCreditGate } from './credit-gate.js';
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Model + thinking-level resolution at session boot. Model order: explicit
|
|
3
|
-
* boot model > saved session model (with valid api key) > first available.
|
|
4
|
-
* Thinking order: explicit override > saved session thinking > default.
|
|
5
|
-
* Reasoning is forced off for non-reasoning models.
|
|
6
|
-
*/
|
|
7
1
|
import type { AgentModelRegistry } from '../contracts/agent-model.js';
|
|
8
2
|
import type { AgentSessionContext } from '../contracts/agent-session-store.js';
|
|
9
3
|
import type { ThinkingLevel } from '../core/core-types.js';
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Model + thinking-level resolution at session boot. Model order: explicit
|
|
3
|
+
* boot model > saved session model (with valid api key) > first available.
|
|
4
|
+
* Thinking order: explicit override > saved session thinking > default.
|
|
5
|
+
* Reasoning is forced off for non-reasoning models.
|
|
6
|
+
*/
|
|
7
|
+
import { resolveModelReasoningLevel } from '../ai/models.js';
|
|
8
|
+
import { isValidThinkingLevel } from '../core/defaults.js';
|
|
2
9
|
function resolveSavedThinkingLevel(sessionContext, override) {
|
|
3
10
|
if (override !== undefined) {
|
|
4
11
|
return override;
|
|
@@ -7,7 +14,7 @@ function resolveSavedThinkingLevel(sessionContext, override) {
|
|
|
7
14
|
if (isValidThinkingLevel(savedThinkingLevel)) {
|
|
8
15
|
return savedThinkingLevel;
|
|
9
16
|
}
|
|
10
|
-
return
|
|
17
|
+
return undefined;
|
|
11
18
|
}
|
|
12
19
|
async function resolveSavedModel(sessionContext, modelRegistry) {
|
|
13
20
|
if (sessionContext.model == null) {
|
|
@@ -38,11 +45,11 @@ export async function selectInitialRuntimeModel(options) {
|
|
|
38
45
|
const availableModels = await options.modelRegistry.getAvailable();
|
|
39
46
|
model = availableModels[0];
|
|
40
47
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
return {
|
|
49
|
+
model,
|
|
50
|
+
thinkingLevel: model
|
|
51
|
+
? resolveModelReasoningLevel(model, thinkingLevel)
|
|
52
|
+
: 'off'
|
|
53
|
+
};
|
|
47
54
|
}
|
|
48
55
|
//# sourceMappingURL=model-selection.js.map
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import { type ShortcutXLModelInvokeResponse } from '../contracts/model-call.js';
|
|
2
2
|
import type { ShortcutXLAiModelInvokeRequest, ShortcutXLAiModelStreamRequest } from '../contracts/wire.js';
|
|
3
|
-
import type
|
|
3
|
+
import { type ProviderGatewayOptions, type ShortcutXLModelUsageStatusLogger } from './provider-native-request.js';
|
|
4
4
|
import type { RunShortcutXLModelStreamRequestOptions } from './stream.js';
|
|
5
|
-
export interface
|
|
6
|
-
readonly headerName: 'Authorization' | 'x-api-key';
|
|
7
|
-
readonly token: string;
|
|
8
|
-
}
|
|
9
|
-
export interface OpenAICompletionsTransportOptions {
|
|
10
|
-
readonly auth: OpenAICompletionsGatewayAuth;
|
|
11
|
-
readonly baseUrl: string;
|
|
12
|
-
readonly fetchImpl?: typeof fetch;
|
|
13
|
-
readonly fetchOptions?: RequestInit;
|
|
14
|
-
readonly headers?: Readonly<Record<string, string | null>>;
|
|
5
|
+
export interface OpenAICompletionsTransportOptions extends ProviderGatewayOptions {
|
|
15
6
|
readonly qwenCompatibility?: {
|
|
16
7
|
readonly disableThinkingForSuggestions?: boolean;
|
|
17
8
|
};
|
|
@@ -1,61 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buildOpenAICompletionsRequest, streamSimpleOpenAICompletions } from '../ai/providers/openai-completions.js';
|
|
2
2
|
import { ShortcutXLModelCallTransportKind, ShortcutXLProviderUsageStatus } from '../contracts/model-call.js';
|
|
3
3
|
import { toProviderUsageFromAi, toShortcutXLModelStreamEvent } from './anthropic-messages-transport.js';
|
|
4
|
-
import {
|
|
5
|
-
import { shortcutProviderFastModeFromRequest, withProviderFastModePayload, withProviderFastModePayloadOverride } from './provider-fast-mode.js';
|
|
4
|
+
import { applyGatewayProviderPayload, concreteProviderHeaders, createGatewayProviderModel, createGatewayProviderOptions } from './provider-native-request.js';
|
|
6
5
|
import { normalizeTransportFetchError, throwInvalidResponse, throwTransportHttpError } from './transport-errors.js';
|
|
7
|
-
function normalizeBaseUrl(baseUrl) {
|
|
8
|
-
return baseUrl.replace(/\/+$/, '');
|
|
9
|
-
}
|
|
10
|
-
const normalizeAiOpenAIBaseUrl = withV1Segment;
|
|
11
|
-
function createAuthHeader(auth) {
|
|
12
|
-
if (auth.headerName === 'Authorization') {
|
|
13
|
-
return {
|
|
14
|
-
Authorization: auth.token.startsWith('Bearer ') ? auth.token : `Bearer ${auth.token}`
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
return { 'x-api-key': auth.token };
|
|
18
|
-
}
|
|
19
|
-
function buildGatewayAiModel(request, baseUrl) {
|
|
20
|
-
return {
|
|
21
|
-
api: 'openai-completions',
|
|
22
|
-
baseUrl: normalizeAiOpenAIBaseUrl(baseUrl),
|
|
23
|
-
compat: {
|
|
24
|
-
maxTokensField: 'max_completion_tokens',
|
|
25
|
-
supportsDeveloperRole: false,
|
|
26
|
-
supportsStore: false
|
|
27
|
-
},
|
|
28
|
-
contextWindow: request.model.contextWindow,
|
|
29
|
-
cost: { cacheRead: 0, cacheWrite: 0, input: 0, output: 0 },
|
|
30
|
-
id: request.model.id,
|
|
31
|
-
input: request.model.input,
|
|
32
|
-
maxTokens: request.model.maxTokens,
|
|
33
|
-
name: request.model.name,
|
|
34
|
-
provider: 'openai',
|
|
35
|
-
reasoning: request.model.reasoning
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
function buildGatewayAiStreamOptions(request, options) {
|
|
39
|
-
const fastMode = shortcutProviderFastModeFromRequest('openai', request);
|
|
40
|
-
return withProviderFastModePayloadOverride({
|
|
41
|
-
apiKey: options.auth.token,
|
|
42
|
-
cacheRetention: request.options?.cacheRetention,
|
|
43
|
-
fetch: options.fetchImpl,
|
|
44
|
-
fetchOptions: options.fetchOptions,
|
|
45
|
-
headers: {
|
|
46
|
-
...request.options?.headers,
|
|
47
|
-
...options.headers,
|
|
48
|
-
...createAuthHeader(options.auth)
|
|
49
|
-
},
|
|
50
|
-
maxRetryDelayMs: request.options?.maxRetryDelayMs,
|
|
51
|
-
maxTokens: request.options?.maxTokens,
|
|
52
|
-
metadata: request.options?.metadata,
|
|
53
|
-
reasoning: request.options?.reasoning,
|
|
54
|
-
signal: options.signal,
|
|
55
|
-
temperature: request.options?.temperature,
|
|
56
|
-
transport: request.options?.transport
|
|
57
|
-
}, fastMode);
|
|
58
|
-
}
|
|
59
6
|
function toProviderUsage(usage) {
|
|
60
7
|
if (!usage)
|
|
61
8
|
return undefined;
|
|
@@ -69,64 +16,6 @@ function toProviderUsage(usage) {
|
|
|
69
16
|
totalTokens: usage.total_tokens ?? input + output
|
|
70
17
|
};
|
|
71
18
|
}
|
|
72
|
-
function buildInvokeRequestBody(request, options) {
|
|
73
|
-
const baseUrl = options.baseUrl;
|
|
74
|
-
const model = buildGatewayAiModel(request, baseUrl);
|
|
75
|
-
const toolChoice = request.options?.toolChoice;
|
|
76
|
-
const disableQwenThinking = request.options?.requestType === 'suggestions' &&
|
|
77
|
-
options.qwenCompatibility?.disableThinkingForSuggestions === true;
|
|
78
|
-
return withProviderFastModePayload({
|
|
79
|
-
...(disableQwenThinking ? { enable_thinking: false } : {}),
|
|
80
|
-
max_completion_tokens: request.options?.maxTokens ?? 4096,
|
|
81
|
-
messages: convertMessages(model, request.context, {
|
|
82
|
-
maxTokensField: 'max_completion_tokens',
|
|
83
|
-
openRouterRouting: {},
|
|
84
|
-
requiresAssistantAfterToolResult: false,
|
|
85
|
-
requiresMistralToolIds: false,
|
|
86
|
-
requiresThinkingAsText: false,
|
|
87
|
-
requiresToolResultName: false,
|
|
88
|
-
supportsDeveloperRole: false,
|
|
89
|
-
supportsReasoningEffort: true,
|
|
90
|
-
supportsStore: false,
|
|
91
|
-
supportsStrictMode: true,
|
|
92
|
-
supportsUsageInStreaming: true,
|
|
93
|
-
thinkingFormat: 'openai',
|
|
94
|
-
vercelGatewayRouting: {}
|
|
95
|
-
}),
|
|
96
|
-
model: model.id,
|
|
97
|
-
stream: false,
|
|
98
|
-
...(request.context.tools
|
|
99
|
-
? {
|
|
100
|
-
tools: request.context.tools.map((tool) => ({
|
|
101
|
-
function: {
|
|
102
|
-
description: tool.description,
|
|
103
|
-
name: tool.name,
|
|
104
|
-
parameters: tool.parameters
|
|
105
|
-
},
|
|
106
|
-
type: 'function'
|
|
107
|
-
}))
|
|
108
|
-
}
|
|
109
|
-
: {}),
|
|
110
|
-
...(typeof toolChoice === 'object'
|
|
111
|
-
? {
|
|
112
|
-
tool_choice: {
|
|
113
|
-
function: { name: toolChoice.name },
|
|
114
|
-
type: 'function'
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
: {}),
|
|
118
|
-
...(toolChoice === 'required' || toolChoice === 'any' ? { tool_choice: 'required' } : {}),
|
|
119
|
-
...(toolChoice === 'auto' || toolChoice === 'none' ? { tool_choice: toolChoice } : {})
|
|
120
|
-
}, shortcutProviderFastModeFromRequest('openai', request));
|
|
121
|
-
}
|
|
122
|
-
function concreteHeaders(headers) {
|
|
123
|
-
const result = {};
|
|
124
|
-
for (const [key, value] of Object.entries(headers ?? {})) {
|
|
125
|
-
if (value !== null)
|
|
126
|
-
result[key] = value;
|
|
127
|
-
}
|
|
128
|
-
return result;
|
|
129
|
-
}
|
|
130
19
|
function parseInvokeResponse(data) {
|
|
131
20
|
if (!data || typeof data !== 'object') {
|
|
132
21
|
throwInvalidResponse('OpenAI Chat Completions invoke response must be a JSON object.');
|
|
@@ -148,8 +37,10 @@ function parseInvokeResponse(data) {
|
|
|
148
37
|
};
|
|
149
38
|
}
|
|
150
39
|
export async function streamAiOpenAICompletionsModelRequest(request, options) {
|
|
151
|
-
const model =
|
|
152
|
-
const stream = streamSimpleOpenAICompletions(model, request.context,
|
|
40
|
+
const model = createGatewayProviderModel(request, 'openai-completions', options.baseUrl);
|
|
41
|
+
const stream = streamSimpleOpenAICompletions(model, request.context, createGatewayProviderOptions(request, 'openai-completions', options, {
|
|
42
|
+
signal: options.signal
|
|
43
|
+
}));
|
|
153
44
|
let finalMessage;
|
|
154
45
|
for await (const event of stream) {
|
|
155
46
|
if (event.type === 'done')
|
|
@@ -173,14 +64,23 @@ export async function streamAiOpenAICompletionsModelRequest(request, options) {
|
|
|
173
64
|
}
|
|
174
65
|
export async function invokeOpenAICompletionsModel(request, options) {
|
|
175
66
|
const fetchImpl = options.fetchImpl ?? fetch;
|
|
67
|
+
const model = createGatewayProviderModel(request, 'openai-completions', options.baseUrl);
|
|
68
|
+
const requestOptions = createGatewayProviderOptions(request, 'openai-completions', options, {
|
|
69
|
+
maxTokens: 4096,
|
|
70
|
+
signal: options.signal
|
|
71
|
+
});
|
|
72
|
+
const body = applyGatewayProviderPayload(request, 'openai-completions', buildOpenAICompletionsRequest(model, request.context, requestOptions, false));
|
|
73
|
+
if (request.options?.requestType === 'suggestions' &&
|
|
74
|
+
options.qwenCompatibility?.disableThinkingForSuggestions === true) {
|
|
75
|
+
body.enable_thinking = false;
|
|
76
|
+
}
|
|
176
77
|
let response;
|
|
177
78
|
try {
|
|
178
|
-
response = await fetchImpl(`${
|
|
179
|
-
body: JSON.stringify(
|
|
180
|
-
headers:
|
|
79
|
+
response = await fetchImpl(`${model.baseUrl}/chat/completions`, {
|
|
80
|
+
body: JSON.stringify(body),
|
|
81
|
+
headers: concreteProviderHeaders({
|
|
181
82
|
'content-type': 'application/json',
|
|
182
|
-
...
|
|
183
|
-
...createAuthHeader(options.auth)
|
|
83
|
+
...requestOptions.headers
|
|
184
84
|
}),
|
|
185
85
|
method: 'POST',
|
|
186
86
|
credentials: options.fetchOptions?.credentials,
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import { type ShortcutXLModelInvokeResponse } from '../contracts/model-call.js';
|
|
2
2
|
import type { ShortcutXLAiModelInvokeRequest, ShortcutXLAiModelStreamRequest } from '../contracts/wire.js';
|
|
3
|
-
import type
|
|
3
|
+
import { type ProviderGatewayOptions, type ShortcutXLModelUsageStatusLogger } from './provider-native-request.js';
|
|
4
4
|
import type { RunShortcutXLModelStreamRequestOptions } from './stream.js';
|
|
5
|
-
export interface
|
|
6
|
-
readonly headerName: 'Authorization' | 'x-api-key';
|
|
7
|
-
readonly token: string;
|
|
8
|
-
}
|
|
9
|
-
export interface OpenAIResponsesTransportOptions {
|
|
10
|
-
readonly auth: OpenAIResponsesGatewayAuth;
|
|
11
|
-
readonly baseUrl: string;
|
|
12
|
-
readonly fetchImpl?: typeof fetch;
|
|
13
|
-
readonly fetchOptions?: RequestInit;
|
|
14
|
-
readonly headers?: Readonly<Record<string, string | null>>;
|
|
5
|
+
export interface OpenAIResponsesTransportOptions extends ProviderGatewayOptions {
|
|
15
6
|
readonly usageStatusLogger?: ShortcutXLModelUsageStatusLogger;
|
|
16
7
|
}
|
|
17
8
|
export declare function streamAiOpenAIResponsesModelRequest(request: ShortcutXLAiModelStreamRequest, options: OpenAIResponsesTransportOptions & {
|
|
@@ -1,161 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { streamSimpleOpenAIResponses } from '../ai/providers/openai-responses.js';
|
|
1
|
+
import { buildOpenAIResponsesRequest, streamSimpleOpenAIResponses } from '../ai/providers/openai-responses.js';
|
|
3
2
|
import { ShortcutXLModelCallTransportKind, ShortcutXLProviderUsageStatus } from '../contracts/model-call.js';
|
|
4
|
-
import { aiUserContentToOpenAIResponsesContent } from './ai-content.js';
|
|
5
3
|
import { toProviderUsageFromAi, toShortcutXLModelStreamEvent } from './anthropic-messages-transport.js';
|
|
6
|
-
import {
|
|
7
|
-
import { OPENAI_PRIORITY_SERVICE_TIER, shortcutProviderFastModeFromRequest, withProviderFastModePayload, withProviderFastModePayloadOverride } from './provider-fast-mode.js';
|
|
4
|
+
import { applyGatewayProviderPayload, concreteProviderHeaders, createGatewayProviderModel, createGatewayProviderOptions } from './provider-native-request.js';
|
|
8
5
|
import { normalizeTransportFetchError, throwInvalidResponse, throwTransportHttpError } from './transport-errors.js';
|
|
9
|
-
function normalizeBaseUrl(baseUrl) {
|
|
10
|
-
return baseUrl.replace(/\/+$/, '');
|
|
11
|
-
}
|
|
12
|
-
const normalizeAiOpenAIResponsesBaseUrl = withV1Segment;
|
|
13
|
-
function createAuthHeader(auth) {
|
|
14
|
-
if (auth.headerName === 'Authorization') {
|
|
15
|
-
return {
|
|
16
|
-
Authorization: auth.token.startsWith('Bearer ') ? auth.token : `Bearer ${auth.token}`
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
return { 'x-api-key': auth.token };
|
|
20
|
-
}
|
|
21
|
-
function buildGatewayAiModel(request, baseUrl) {
|
|
22
|
-
return {
|
|
23
|
-
api: 'openai-responses',
|
|
24
|
-
baseUrl: normalizeAiOpenAIResponsesBaseUrl(baseUrl),
|
|
25
|
-
contextWindow: request.model.contextWindow,
|
|
26
|
-
cost: { cacheRead: 0, cacheWrite: 0, input: 0, output: 0 },
|
|
27
|
-
id: request.model.id,
|
|
28
|
-
input: request.model.input,
|
|
29
|
-
maxTokens: request.model.maxTokens,
|
|
30
|
-
name: request.model.name,
|
|
31
|
-
provider: 'openai',
|
|
32
|
-
reasoning: request.model.reasoning
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
function buildInvokeAiModel(request, baseUrl) {
|
|
36
|
-
return {
|
|
37
|
-
api: 'openai-responses',
|
|
38
|
-
baseUrl: normalizeAiOpenAIResponsesBaseUrl(baseUrl),
|
|
39
|
-
contextWindow: request.model.contextWindow,
|
|
40
|
-
cost: { cacheRead: 0, cacheWrite: 0, input: 0, output: 0 },
|
|
41
|
-
id: request.model.id,
|
|
42
|
-
input: ['text', 'image'],
|
|
43
|
-
maxTokens: request.options?.maxTokens ?? request.model.maxTokens,
|
|
44
|
-
name: request.model.name,
|
|
45
|
-
provider: 'openai',
|
|
46
|
-
reasoning: request.model.reasoning
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
function buildGatewayAiStreamOptions(request, options) {
|
|
50
|
-
const fastMode = shortcutProviderFastModeFromRequest('openai', request);
|
|
51
|
-
return withProviderFastModePayloadOverride({
|
|
52
|
-
apiKey: options.auth.token,
|
|
53
|
-
cacheRetention: request.options?.cacheRetention,
|
|
54
|
-
fetch: options.fetchImpl,
|
|
55
|
-
fetchOptions: options.fetchOptions,
|
|
56
|
-
headers: {
|
|
57
|
-
...request.options?.headers,
|
|
58
|
-
...options.headers,
|
|
59
|
-
...createAuthHeader(options.auth)
|
|
60
|
-
},
|
|
61
|
-
maxRetryDelayMs: request.options?.maxRetryDelayMs,
|
|
62
|
-
maxTokens: request.options?.maxTokens,
|
|
63
|
-
metadata: request.options?.metadata,
|
|
64
|
-
reasoning: request.options?.reasoning,
|
|
65
|
-
...(fastMode === 'openai' ? { serviceTier: OPENAI_PRIORITY_SERVICE_TIER } : {}),
|
|
66
|
-
signal: options.signal,
|
|
67
|
-
temperature: request.options?.temperature,
|
|
68
|
-
transport: request.options?.transport
|
|
69
|
-
}, fastMode);
|
|
70
|
-
}
|
|
71
|
-
// Local invoke converter because upstream owned AI's Responses converter only accepts
|
|
72
|
-
// text/image content. The shared owned AI content helper owns the extra input_file case.
|
|
73
|
-
function convertResponsesInvokeMessages(request) {
|
|
74
|
-
const input = [];
|
|
75
|
-
if (request.context.systemPrompt) {
|
|
76
|
-
input.push({
|
|
77
|
-
content: request.context.systemPrompt,
|
|
78
|
-
role: request.model.reasoning ? 'developer' : 'system'
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
for (const message of request.context.messages) {
|
|
82
|
-
if (message.role === 'user') {
|
|
83
|
-
const content = aiUserContentToOpenAIResponsesContent(message.content);
|
|
84
|
-
if (content.length > 0)
|
|
85
|
-
input.push({ content, role: 'user' });
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
88
|
-
if (message.role === 'assistant') {
|
|
89
|
-
for (const block of message.content) {
|
|
90
|
-
if (block.type === 'text') {
|
|
91
|
-
input.push({
|
|
92
|
-
content: [{ annotations: [], text: block.text, type: 'output_text' }],
|
|
93
|
-
role: 'assistant',
|
|
94
|
-
status: 'completed',
|
|
95
|
-
type: 'message'
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
else if (block.type === 'toolCall') {
|
|
99
|
-
const [callId, itemId] = block.id.split('|');
|
|
100
|
-
input.push({
|
|
101
|
-
arguments: JSON.stringify(block.arguments),
|
|
102
|
-
call_id: callId,
|
|
103
|
-
...(itemId ? { id: itemId.startsWith('fc') ? itemId : `fc_${itemId}` } : {}),
|
|
104
|
-
name: block.name,
|
|
105
|
-
type: 'function_call'
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
continue;
|
|
110
|
-
}
|
|
111
|
-
const output = message.content
|
|
112
|
-
.filter((block) => block.type === 'text')
|
|
113
|
-
.map((block) => block.text)
|
|
114
|
-
.join('\n');
|
|
115
|
-
const attachments = message.content.filter((block) => block.type === 'image' || block.type === 'document');
|
|
116
|
-
const [callId] = message.toolCallId.split('|');
|
|
117
|
-
input.push({
|
|
118
|
-
call_id: callId,
|
|
119
|
-
output: output || '(see attached file)',
|
|
120
|
-
type: 'function_call_output'
|
|
121
|
-
});
|
|
122
|
-
if (attachments.length > 0) {
|
|
123
|
-
input.push({
|
|
124
|
-
content: aiUserContentToOpenAIResponsesContent([
|
|
125
|
-
{ text: 'Attached file(s) from tool result:', type: 'text' },
|
|
126
|
-
...attachments
|
|
127
|
-
]),
|
|
128
|
-
role: 'user'
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return input;
|
|
133
|
-
}
|
|
134
|
-
function buildInvokeRequestBody(request, baseUrl) {
|
|
135
|
-
const model = buildInvokeAiModel(request, baseUrl);
|
|
136
|
-
return withProviderFastModePayload({
|
|
137
|
-
input: convertResponsesInvokeMessages(request),
|
|
138
|
-
max_output_tokens: request.options?.maxTokens ?? 4096,
|
|
139
|
-
model: model.id,
|
|
140
|
-
stream: false,
|
|
141
|
-
// Browser-direct enterprise gateways must not persist helper conversation
|
|
142
|
-
// state by default; keep this explicit while Responses invoke is direct.
|
|
143
|
-
store: false,
|
|
144
|
-
...(request.context.tools
|
|
145
|
-
? {
|
|
146
|
-
tools: convertResponsesTools(request.context.tools, { strict: false })
|
|
147
|
-
}
|
|
148
|
-
: {}),
|
|
149
|
-
...(typeof request.options?.toolChoice === 'object'
|
|
150
|
-
? {
|
|
151
|
-
tool_choice: {
|
|
152
|
-
name: request.options.toolChoice.name,
|
|
153
|
-
type: 'function'
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
: {})
|
|
157
|
-
}, shortcutProviderFastModeFromRequest('openai', request));
|
|
158
|
-
}
|
|
159
6
|
function toProviderUsage(usage) {
|
|
160
7
|
if (!usage)
|
|
161
8
|
return undefined;
|
|
@@ -169,14 +16,6 @@ function toProviderUsage(usage) {
|
|
|
169
16
|
totalTokens: usage.total_tokens ?? input + output
|
|
170
17
|
};
|
|
171
18
|
}
|
|
172
|
-
function concreteHeaders(headers) {
|
|
173
|
-
const result = {};
|
|
174
|
-
for (const [key, value] of Object.entries(headers ?? {})) {
|
|
175
|
-
if (value !== null)
|
|
176
|
-
result[key] = value;
|
|
177
|
-
}
|
|
178
|
-
return result;
|
|
179
|
-
}
|
|
180
19
|
function parseInvokeResponse(data) {
|
|
181
20
|
if (!data || typeof data !== 'object') {
|
|
182
21
|
throwInvalidResponse('OpenAI Responses invoke response must be a JSON object.');
|
|
@@ -213,8 +52,10 @@ function parseInvokeResponse(data) {
|
|
|
213
52
|
};
|
|
214
53
|
}
|
|
215
54
|
export async function streamAiOpenAIResponsesModelRequest(request, options) {
|
|
216
|
-
const model =
|
|
217
|
-
const stream = streamSimpleOpenAIResponses(model, request.context,
|
|
55
|
+
const model = createGatewayProviderModel(request, 'openai-responses', options.baseUrl);
|
|
56
|
+
const stream = streamSimpleOpenAIResponses(model, request.context, createGatewayProviderOptions(request, 'openai-responses', options, {
|
|
57
|
+
signal: options.signal
|
|
58
|
+
}));
|
|
218
59
|
let finalMessage;
|
|
219
60
|
for await (const event of stream) {
|
|
220
61
|
if (event.type === 'done')
|
|
@@ -238,14 +79,18 @@ export async function streamAiOpenAIResponsesModelRequest(request, options) {
|
|
|
238
79
|
}
|
|
239
80
|
export async function invokeOpenAIResponsesModel(request, options) {
|
|
240
81
|
const fetchImpl = options.fetchImpl ?? fetch;
|
|
82
|
+
const model = createGatewayProviderModel(request, 'openai-responses', options.baseUrl);
|
|
83
|
+
const requestOptions = createGatewayProviderOptions(request, 'openai-responses', options, {
|
|
84
|
+
maxTokens: 4096,
|
|
85
|
+
signal: options.signal
|
|
86
|
+
});
|
|
241
87
|
let response;
|
|
242
88
|
try {
|
|
243
|
-
response = await fetchImpl(`${
|
|
244
|
-
body: JSON.stringify(
|
|
245
|
-
headers:
|
|
89
|
+
response = await fetchImpl(`${model.baseUrl}/responses`, {
|
|
90
|
+
body: JSON.stringify(applyGatewayProviderPayload(request, 'openai-responses', buildOpenAIResponsesRequest(model, request.context, requestOptions, false))),
|
|
91
|
+
headers: concreteProviderHeaders({
|
|
246
92
|
'content-type': 'application/json',
|
|
247
|
-
...
|
|
248
|
-
...createAuthHeader(options.auth)
|
|
93
|
+
...requestOptions.headers
|
|
249
94
|
}),
|
|
250
95
|
method: 'POST',
|
|
251
96
|
credentials: options.fetchOptions?.credentials,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AgentExecuteCodeMode } from '../../contracts/agent-execute-code.js';
|
|
2
|
-
import {
|
|
2
|
+
import { COMMUNICATION, DATA_FORMATTING, TASK_EXECUTION, WRITING_CODE } from '../../core/prompts/agent-guidelines.js';
|
|
3
3
|
import { buildShortcutXLApiReferenceSection } from '../../utils/api-reference.js';
|
|
4
4
|
import { TOOLS_BY_MODE_NAMES } from '../host-tools/mode-host-tools.js';
|
|
5
5
|
import { buildActionModeMainSection } from './modes/action.js';
|
|
@@ -29,7 +29,6 @@ function buildModeSections(mode, platform) {
|
|
|
29
29
|
case AgentExecuteCodeMode.Action:
|
|
30
30
|
return [
|
|
31
31
|
buildActionModeMainSection(platformIdentity, currentDate),
|
|
32
|
-
AGENT_PHILOSOPHY,
|
|
33
32
|
TASK_EXECUTION,
|
|
34
33
|
COMMUNICATION,
|
|
35
34
|
SANDBOX_FILESYSTEM,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Sandbox layout reference. Subagents that touch the sandbox (general,
|
|
7
7
|
* document_reader) append this to their system prompt.
|
|
8
8
|
*/
|
|
9
|
-
export declare const SANDBOX_FILESYSTEM = "\n======================\n## SANDBOX FILESYSTEM\n======================\n\nYour sandbox has these top-level directories \u2014 they are separate mounts:\n\n- `/workspace/` \u2014 Active workspace. Primary working directory. Uploaded files and generated output belong here for the selected workspace scope.\n- `/skills/` \u2014 Skills directory (completely separate from /workspace):\n - `/skills/default/` \u2014 Built-in skills baked into the Modal image (read-only).\n - `/skills/user/` \u2014 Personal skills mounted read-write.\n - `/skills/team/your-team-id/` \u2014 Team-shared skills mounted according to your team permissions.\n- `/memories/` \u2014 Persistent memory (MEMORY.md, daily notes, traces)\n- `/tmp/` \u2014 Ephemeral local SSD scratch space. Use only when an operation needs normal local-disk behavior; cleared between sessions.\n\n**Storage notes:** `/skills/default` is baked into the Modal image. `/workspace`, `/skills/user`, `/skills/team`, and `/memories` are cloud-backed mounts. Cloud-backed mounts persist, but do not support normal local-disk behavior such as append operations (`>>`, `tee -a`) or random-write/seek-heavy file creation. `/tmp` is local SSD: it supports normal local file operations, but is ephemeral and cleared between sessions. Do not leave raw, intermediate, or final artifacts only in `/tmp`; organize durable work under `/workspace`.\n\nNEVER create skills under `workspace`. Skills MUST go in `skills`.\nNEVER save user files under `skills`. Generated files belong in `workspace`.\n\nUsers can browse, edit, preview, and download files via the **Workspace Files** panel in the UI. The panel shows the active workspace scope selected for the conversation.\n- Save outputs to `/workspace/`\n- When you have generated files relevant to the user's requests, tell users the relative path where files are saved and mention they can find files in the Workspace Files panel\n";
|
|
9
|
+
export declare const SANDBOX_FILESYSTEM = "\n======================\n## SANDBOX FILESYSTEM\n======================\n\nYour sandbox has these top-level directories \u2014 they are separate mounts:\n\n- `/workspace/` \u2014 Active workspace. Primary working directory. Uploaded files and generated output belong here for the selected workspace scope.\n- `/skills/` \u2014 Skills directory (completely separate from /workspace):\n - `/skills/default/` \u2014 Built-in skills baked into the Modal image (read-only).\n - `/skills/user/` \u2014 Personal skills mounted read-write.\n - `/skills/team/your-team-id/` \u2014 Team-shared skills mounted according to your team permissions.\n- `/memories/` \u2014 Persistent memory (MEMORY.md, daily notes, traces)\n- `/tmp/` \u2014 Ephemeral local SSD scratch space. Use only when an operation needs normal local-disk behavior; cleared between sessions.\n\n**Storage notes:** `/skills/default` is baked into the Modal image. `/workspace`, `/skills/user`, `/skills/team`, and `/memories` are cloud-backed mounts. Cloud-backed mounts persist, but do not support normal local-disk behavior such as append operations (`>>`, `tee -a`) or random-write/seek-heavy file creation. `/tmp` is local SSD: it supports normal local file operations, but is ephemeral and cleared between sessions. Do not leave raw, intermediate, or final artifacts only in `/tmp`; organize durable work under `/workspace`.\n\nDo not read files that are concurrently being created in the same turn. Wait for creation to finish.\n\nNEVER create skills under `workspace`. Skills MUST go in `skills`.\nNEVER save user files under `skills`. Generated files belong in `workspace`.\n\nUsers can browse, edit, preview, and download files via the **Workspace Files** panel in the UI. The panel shows the active workspace scope selected for the conversation.\n- Save outputs to `/workspace/`\n- When you have generated files relevant to the user's requests, tell users the relative path where files are saved and mention they can find files in the Workspace Files panel\n";
|
|
10
10
|
/**
|
|
11
11
|
* File-layout reference for the document_reader subagent. Mirrors
|
|
12
12
|
* `backend/agent/constants/file_reading.py:FILE_STRUCTURE` verbatim, with
|
|
@@ -24,6 +24,8 @@ Your sandbox has these top-level directories — they are separate mounts:
|
|
|
24
24
|
|
|
25
25
|
**Storage notes:** \`/skills/default\` is baked into the Modal image. \`/workspace\`, \`/skills/user\`, \`/skills/team\`, and \`/memories\` are cloud-backed mounts. Cloud-backed mounts persist, but do not support normal local-disk behavior such as append operations (\`>>\`, \`tee -a\`) or random-write/seek-heavy file creation. \`/tmp\` is local SSD: it supports normal local file operations, but is ephemeral and cleared between sessions. Do not leave raw, intermediate, or final artifacts only in \`/tmp\`; organize durable work under \`/workspace\`.
|
|
26
26
|
|
|
27
|
+
Do not read files that are concurrently being created in the same turn. Wait for creation to finish.
|
|
28
|
+
|
|
27
29
|
NEVER create skills under \`workspace\`. Skills MUST go in \`skills\`.
|
|
28
30
|
NEVER save user files under \`skills\`. Generated files belong in \`workspace\`.
|
|
29
31
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Model, SimpleStreamOptions } from '../ai/types.js';
|
|
2
|
+
import type { ShortcutXLProviderUsageEvent, ShortcutXLUsageLogResult } from '../contracts/model-call.js';
|
|
3
|
+
import type { ShortcutXLAiModelInvokeRequest, ShortcutXLAiModelStreamRequest } from '../contracts/wire.js';
|
|
4
|
+
import { type GatewayTransport } from './gateway-base-url.js';
|
|
5
|
+
type ProviderRequest = ShortcutXLAiModelStreamRequest | ShortcutXLAiModelInvokeRequest;
|
|
6
|
+
export interface ShortcutXLModelUsageStatusLogger {
|
|
7
|
+
recordProviderUsage(event: ShortcutXLProviderUsageEvent): void | Promise<void>;
|
|
8
|
+
recordUsageReportResult(result: ShortcutXLUsageLogResult): void | Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export interface ProviderGatewayAuth {
|
|
11
|
+
readonly headerName: 'Authorization' | 'x-api-key';
|
|
12
|
+
readonly token: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ProviderGatewayOptions {
|
|
15
|
+
readonly auth: ProviderGatewayAuth;
|
|
16
|
+
readonly baseUrl: string;
|
|
17
|
+
readonly fetchImpl?: typeof fetch;
|
|
18
|
+
readonly fetchOptions?: RequestInit;
|
|
19
|
+
readonly headers?: Readonly<Record<string, string | null>>;
|
|
20
|
+
}
|
|
21
|
+
export declare function createGatewayProviderModel<TApi extends GatewayTransport>(request: ProviderRequest, transport: TApi, baseUrl: string): Model<TApi>;
|
|
22
|
+
export declare function concreteProviderHeaders(headers: Readonly<Record<string, string | null>> | undefined): Record<string, string>;
|
|
23
|
+
export declare function createGatewayProviderOptions(request: ProviderRequest, transport: GatewayTransport, options: ProviderGatewayOptions, defaults?: {
|
|
24
|
+
readonly maxTokens?: number;
|
|
25
|
+
readonly signal?: AbortSignal;
|
|
26
|
+
}): SimpleStreamOptions;
|
|
27
|
+
export declare function applyGatewayProviderPayload<T extends Record<string, unknown>>(request: ProviderRequest, transport: GatewayTransport, payload: T): T;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=provider-native-request.d.ts.map
|