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
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SSE reader for the shared `/api/llm/stream` proxy. Concatenates `text_delta`
|
|
3
|
-
* events; surfaces `error` events and non-OK HTTP responses as
|
|
4
|
-
* `LlmStreamError` instances that carry the same structured envelope the
|
|
5
|
-
* model-stream contract uses. `fetch` + auth-header resolver are injected so
|
|
6
|
-
* this module stays host-agnostic.
|
|
7
|
-
*/
|
|
8
|
-
import { type ShortcutXLLlmOperation, type ShortcutXLModelStreamErrorDetails } from '../../../contracts/model-stream.js';
|
|
9
|
-
export interface LlmStreamRequest {
|
|
10
|
-
readonly baseUrl: string;
|
|
11
|
-
readonly body: Record<string, unknown>;
|
|
12
|
-
readonly clientPlatform: string;
|
|
13
|
-
readonly fetch: typeof globalThis.fetch;
|
|
14
|
-
readonly authHeaders: () => Promise<Record<string, string>>;
|
|
15
|
-
readonly llmOperation?: ShortcutXLLlmOperation;
|
|
16
|
-
readonly requestId?: string;
|
|
17
|
-
readonly sessionId?: string;
|
|
18
|
-
readonly signal?: AbortSignal;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Error thrown by `readLlmStreamText` carrying the structured stream-error
|
|
22
|
-
* envelope (`provider_error_type`/`retryable`/`retry_after_ms`/`status`) so
|
|
23
|
-
* callers can inspect failure semantics instead of regexing the message.
|
|
24
|
-
*/
|
|
25
|
-
export declare class LlmStreamError extends Error {
|
|
26
|
-
readonly details: ShortcutXLModelStreamErrorDetails | undefined;
|
|
27
|
-
constructor(message: string, details: ShortcutXLModelStreamErrorDetails | undefined);
|
|
28
|
-
}
|
|
29
|
-
/** POST `/api/llm/stream`, consume the SSE response, return concatenated `text_delta`. */
|
|
30
|
-
export declare function readLlmStreamText(options: LlmStreamRequest): Promise<string>;
|
|
31
|
-
//# sourceMappingURL=llm-stream.d.ts.map
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SSE reader for the shared `/api/llm/stream` proxy. Concatenates `text_delta`
|
|
3
|
-
* events; surfaces `error` events and non-OK HTTP responses as
|
|
4
|
-
* `LlmStreamError` instances that carry the same structured envelope the
|
|
5
|
-
* model-stream contract uses. `fetch` + auth-header resolver are injected so
|
|
6
|
-
* this module stays host-agnostic.
|
|
7
|
-
*/
|
|
8
|
-
import { extractStructuredHttpErrorPayload, networkErrorDetails, parseStreamErrorPayload, safeModelStreamErrorMessage, ShortcutXLModelStreamFetchStage } from '../../../contracts/model-stream.js';
|
|
9
|
-
/**
|
|
10
|
-
* Error thrown by `readLlmStreamText` carrying the structured stream-error
|
|
11
|
-
* envelope (`provider_error_type`/`retryable`/`retry_after_ms`/`status`) so
|
|
12
|
-
* callers can inspect failure semantics instead of regexing the message.
|
|
13
|
-
*/
|
|
14
|
-
export class LlmStreamError extends Error {
|
|
15
|
-
details;
|
|
16
|
-
constructor(message, details) {
|
|
17
|
-
super(message);
|
|
18
|
-
this.name = 'LlmStreamError';
|
|
19
|
-
this.details = details;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
function errorToMessage(error) {
|
|
23
|
-
return error instanceof Error ? error.message : String(error);
|
|
24
|
-
}
|
|
25
|
-
function withTransportFailureStage(details, stage) {
|
|
26
|
-
return {
|
|
27
|
-
...(details ?? {}),
|
|
28
|
-
transportFailureStage: stage
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
/** POST `/api/llm/stream`, consume the SSE response, return concatenated `text_delta`. */
|
|
32
|
-
export async function readLlmStreamText(options) {
|
|
33
|
-
const headers = new Headers(await options.authHeaders());
|
|
34
|
-
headers.set('X-Agent-Runtime', 'shortcutxl_embedded');
|
|
35
|
-
headers.set('X-Client-Platform', options.clientPlatform);
|
|
36
|
-
if (options.llmOperation)
|
|
37
|
-
headers.set('X-LLM-Operation', options.llmOperation);
|
|
38
|
-
if (options.requestId)
|
|
39
|
-
headers.set('X-Request-Id', options.requestId);
|
|
40
|
-
if (options.sessionId)
|
|
41
|
-
headers.set('X-Session-Id', options.sessionId);
|
|
42
|
-
let response;
|
|
43
|
-
try {
|
|
44
|
-
response = await options.fetch(`${options.baseUrl}/api/llm/stream`, {
|
|
45
|
-
method: 'POST',
|
|
46
|
-
headers,
|
|
47
|
-
body: JSON.stringify(options.body),
|
|
48
|
-
credentials: 'include',
|
|
49
|
-
signal: options.signal
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
catch (error) {
|
|
53
|
-
if (options.signal?.aborted === true)
|
|
54
|
-
throw error;
|
|
55
|
-
throw new LlmStreamError(errorToMessage(error), networkErrorDetails(ShortcutXLModelStreamFetchStage.BeforeResponse));
|
|
56
|
-
}
|
|
57
|
-
if (!response.ok) {
|
|
58
|
-
const rawBody = await response.text().catch(() => '');
|
|
59
|
-
let parsedBody;
|
|
60
|
-
try {
|
|
61
|
-
parsedBody = rawBody ? JSON.parse(rawBody) : undefined;
|
|
62
|
-
}
|
|
63
|
-
catch {
|
|
64
|
-
parsedBody = undefined;
|
|
65
|
-
}
|
|
66
|
-
const payload = extractStructuredHttpErrorPayload(parsedBody);
|
|
67
|
-
const details = withTransportFailureStage(parseStreamErrorPayload(payload, response.status) ?? { status: response.status }, ShortcutXLModelStreamFetchStage.NonOkResponse);
|
|
68
|
-
const message = safeModelStreamErrorMessage(details);
|
|
69
|
-
throw new LlmStreamError(message, details);
|
|
70
|
-
}
|
|
71
|
-
if (!response.body) {
|
|
72
|
-
throw new LlmStreamError('LLM stream returned no response body', networkErrorDetails(ShortcutXLModelStreamFetchStage.ResponseBody));
|
|
73
|
-
}
|
|
74
|
-
const reader = response.body.getReader();
|
|
75
|
-
const decoder = new TextDecoder();
|
|
76
|
-
let buffer = '';
|
|
77
|
-
let text = '';
|
|
78
|
-
const handleBlock = (block) => {
|
|
79
|
-
if (!block.trim())
|
|
80
|
-
return;
|
|
81
|
-
let event = null;
|
|
82
|
-
const dataLines = [];
|
|
83
|
-
for (const line of block.split('\n')) {
|
|
84
|
-
if (line.startsWith('event:'))
|
|
85
|
-
event = line.slice(6).trim();
|
|
86
|
-
else if (line.startsWith('data:'))
|
|
87
|
-
dataLines.push(line.slice(5).trimStart());
|
|
88
|
-
}
|
|
89
|
-
if (!event)
|
|
90
|
-
return;
|
|
91
|
-
let payload;
|
|
92
|
-
try {
|
|
93
|
-
payload = JSON.parse(dataLines.join('\n'));
|
|
94
|
-
}
|
|
95
|
-
catch {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
if (event === 'text_delta') {
|
|
99
|
-
const delta = payload.delta;
|
|
100
|
-
if (typeof delta === 'string')
|
|
101
|
-
text += delta;
|
|
102
|
-
}
|
|
103
|
-
else if (event === 'error') {
|
|
104
|
-
const errorPayload = payload;
|
|
105
|
-
const details = withTransportFailureStage(parseStreamErrorPayload(errorPayload), ShortcutXLModelStreamFetchStage.ResponseBody);
|
|
106
|
-
const msg = details !== undefined
|
|
107
|
-
? safeModelStreamErrorMessage(details)
|
|
108
|
-
: typeof errorPayload.message === 'string'
|
|
109
|
-
? errorPayload.message
|
|
110
|
-
: 'LLM stream failed';
|
|
111
|
-
throw new LlmStreamError(msg, details);
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
try {
|
|
115
|
-
while (true) {
|
|
116
|
-
const { done, value } = await reader.read();
|
|
117
|
-
if (done)
|
|
118
|
-
break;
|
|
119
|
-
buffer += decoder.decode(value, { stream: true });
|
|
120
|
-
const blocks = buffer.split('\n\n');
|
|
121
|
-
buffer = blocks.pop() ?? '';
|
|
122
|
-
for (const block of blocks)
|
|
123
|
-
handleBlock(block);
|
|
124
|
-
}
|
|
125
|
-
buffer += decoder.decode();
|
|
126
|
-
if (buffer.trim())
|
|
127
|
-
handleBlock(buffer);
|
|
128
|
-
}
|
|
129
|
-
catch (error) {
|
|
130
|
-
if (error instanceof LlmStreamError || options.signal?.aborted === true)
|
|
131
|
-
throw error;
|
|
132
|
-
throw new LlmStreamError(errorToMessage(error), networkErrorDetails(ShortcutXLModelStreamFetchStage.ResponseBody));
|
|
133
|
-
}
|
|
134
|
-
return text;
|
|
135
|
-
}
|
|
136
|
-
//# sourceMappingURL=llm-stream.js.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type ShortcutXLModelCall, type ShortcutXLModelCallTransportKind as ShortcutXLModelCallTransportKindType, type ShortcutXLProviderUsageEvent, type ShortcutXLUsageLogResult } from '../contracts/model-call.js';
|
|
2
|
-
import type { ShortcutXLModelStreamRequest } from '../contracts/model-stream.js';
|
|
3
|
-
import { type RunShortcutXLModelStreamRequestOptions } from './stream.js';
|
|
4
|
-
export interface ShortcutXLModelStreamTransport {
|
|
5
|
-
readonly kind: ShortcutXLModelCallTransportKindType;
|
|
6
|
-
stream(call: ShortcutXLModelCall, options: RunShortcutXLModelStreamRequestOptions): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
export interface ShortcutXLModelCallOrchestrator {
|
|
9
|
-
stream(request: ShortcutXLModelStreamRequest, options: RunShortcutXLModelStreamRequestOptions): Promise<void>;
|
|
10
|
-
}
|
|
11
|
-
export interface ShortcutXLModelUsageStatusLogger {
|
|
12
|
-
recordProviderUsage(event: ShortcutXLProviderUsageEvent): void | Promise<void>;
|
|
13
|
-
recordUsageReportResult(result: ShortcutXLUsageLogResult): void | Promise<void>;
|
|
14
|
-
}
|
|
15
|
-
export interface CreateShortcutXLModelCallOrchestratorOptions {
|
|
16
|
-
readonly streamTransport?: ShortcutXLModelStreamTransport;
|
|
17
|
-
readonly usageStatusLogger?: ShortcutXLModelUsageStatusLogger;
|
|
18
|
-
}
|
|
19
|
-
export declare function createShortcutProxyModelStreamTransport(): ShortcutXLModelStreamTransport;
|
|
20
|
-
export declare function createShortcutXLModelCallOrchestrator(options?: CreateShortcutXLModelCallOrchestratorOptions): ShortcutXLModelCallOrchestrator;
|
|
21
|
-
export declare function runShortcutXLModelCallStreamRequest(request: ShortcutXLModelStreamRequest, options: RunShortcutXLModelStreamRequestOptions): Promise<void>;
|
|
22
|
-
//# sourceMappingURL=model-call-orchestrator.d.ts.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ShortcutXLModelCallTransportKind, splitShortcutXLModelStreamRequest, toShortcutXLModelStreamRequest } from '../contracts/model-call.js';
|
|
2
|
-
import { runShortcutXLModelStreamRequest } from './stream.js';
|
|
3
|
-
export function createShortcutProxyModelStreamTransport() {
|
|
4
|
-
return {
|
|
5
|
-
kind: ShortcutXLModelCallTransportKind.ShortcutProxy,
|
|
6
|
-
stream(call, options) {
|
|
7
|
-
return runShortcutXLModelStreamRequest(toShortcutXLModelStreamRequest(call), options);
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export function createShortcutXLModelCallOrchestrator(options = {}) {
|
|
12
|
-
const streamTransport = options.streamTransport ?? createShortcutProxyModelStreamTransport();
|
|
13
|
-
return {
|
|
14
|
-
stream(request, streamOptions) {
|
|
15
|
-
return streamTransport.stream(splitShortcutXLModelStreamRequest(request), streamOptions);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export function runShortcutXLModelCallStreamRequest(request, options) {
|
|
20
|
-
return createShortcutXLModelCallOrchestrator().stream(request, options);
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=model-call-orchestrator.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type ShortcutXLModelStreamErrorDetails } from '../contracts/model-stream.js';
|
|
2
|
-
export declare class ShortcutXLHttpStreamError extends Error {
|
|
3
|
-
readonly details: ShortcutXLModelStreamErrorDetails | undefined;
|
|
4
|
-
constructor(message: string, details: ShortcutXLModelStreamErrorDetails | undefined);
|
|
5
|
-
}
|
|
6
|
-
export declare function buildHttpStreamError(response: Response): Promise<ShortcutXLHttpStreamError>;
|
|
7
|
-
export declare function streamErrorDetails(error: unknown): ShortcutXLModelStreamErrorDetails | undefined;
|
|
8
|
-
export declare function isRetryableStreamError(error: unknown): boolean;
|
|
9
|
-
export declare function computeRetryDelayMs(error: unknown, attempt: number, baseDelayMs: number, maxDelayMs: number, serverMaxDelayMs: number): number;
|
|
10
|
-
//# sourceMappingURL=stream-errors.d.ts.map
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { isContextOverflowErrorMessage } from '../ai/utils/overflow.js';
|
|
2
|
-
import { applyModelAccessDeniedErrorDetails, extractStructuredHttpErrorPayload, LLMErrorMetadataHeaders, parseStreamErrorPayload, safeModelStreamErrorMessage } from '../contracts/model-stream.js';
|
|
3
|
-
export class ShortcutXLHttpStreamError extends Error {
|
|
4
|
-
details;
|
|
5
|
-
constructor(message, details) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.name = 'ShortcutXLHttpStreamError';
|
|
8
|
-
this.details = details;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
function streamErrorPayloadFromHeaders(headers) {
|
|
12
|
-
const payload = {
|
|
13
|
-
provider_error_type: headers.get(LLMErrorMetadataHeaders.providerErrorType) ?? undefined,
|
|
14
|
-
failure_stage: headers.get(LLMErrorMetadataHeaders.failureStage) ?? undefined,
|
|
15
|
-
requested_model: headers.get(LLMErrorMetadataHeaders.requestedModel) ?? undefined,
|
|
16
|
-
credential_mode: headers.get(LLMErrorMetadataHeaders.credentialMode) ?? undefined
|
|
17
|
-
};
|
|
18
|
-
return Object.values(payload).some((value) => value !== undefined) ? payload : undefined;
|
|
19
|
-
}
|
|
20
|
-
export async function buildHttpStreamError(response) {
|
|
21
|
-
const rawBody = await response.text();
|
|
22
|
-
let parsedBody;
|
|
23
|
-
try {
|
|
24
|
-
parsedBody = rawBody ? JSON.parse(rawBody) : undefined;
|
|
25
|
-
}
|
|
26
|
-
catch {
|
|
27
|
-
parsedBody = undefined;
|
|
28
|
-
}
|
|
29
|
-
const bodyPayload = extractStructuredHttpErrorPayload(parsedBody);
|
|
30
|
-
const headerPayload = streamErrorPayloadFromHeaders(response.headers);
|
|
31
|
-
const payload = bodyPayload || headerPayload
|
|
32
|
-
? {
|
|
33
|
-
...(bodyPayload ?? {}),
|
|
34
|
-
...(headerPayload ?? {})
|
|
35
|
-
}
|
|
36
|
-
: undefined;
|
|
37
|
-
const parsedDetails = parseStreamErrorPayload(payload, response.status) ?? {
|
|
38
|
-
status: response.status
|
|
39
|
-
};
|
|
40
|
-
const rawMessage = typeof payload?.message === 'string' ? payload.message : rawBody;
|
|
41
|
-
const accessAwareDetails = applyModelAccessDeniedErrorDetails(parsedDetails, rawMessage);
|
|
42
|
-
const details = isContextOverflowErrorMessage(rawMessage)
|
|
43
|
-
? { ...accessAwareDetails, code: 'context_overflow' }
|
|
44
|
-
: accessAwareDetails;
|
|
45
|
-
const message = safeModelStreamErrorMessage(details);
|
|
46
|
-
return new ShortcutXLHttpStreamError(message, details);
|
|
47
|
-
}
|
|
48
|
-
function isRetryableStatus(status) {
|
|
49
|
-
return status === 408 || status === 429 || (status !== undefined && status >= 500);
|
|
50
|
-
}
|
|
51
|
-
export function streamErrorDetails(error) {
|
|
52
|
-
return error instanceof ShortcutXLHttpStreamError ? error.details : undefined;
|
|
53
|
-
}
|
|
54
|
-
export function isRetryableStreamError(error) {
|
|
55
|
-
if (error instanceof Error && error.name === 'AbortError') {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
if (error instanceof ShortcutXLHttpStreamError) {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
const details = streamErrorDetails(error);
|
|
62
|
-
return details === undefined || isRetryableStatus(details.status);
|
|
63
|
-
}
|
|
64
|
-
export function computeRetryDelayMs(error, attempt, baseDelayMs, maxDelayMs, serverMaxDelayMs) {
|
|
65
|
-
const requested = streamErrorDetails(error)?.retryAfterMs;
|
|
66
|
-
if (requested !== undefined && requested >= 0) {
|
|
67
|
-
// Server-directed delays use their own (higher) ceiling so a recovering
|
|
68
|
-
// provider's explicit hint isn't truncated to the client backoff cap.
|
|
69
|
-
return Math.min(requested, serverMaxDelayMs);
|
|
70
|
-
}
|
|
71
|
-
return Math.min(maxDelayMs, baseDelayMs * 2 ** Math.max(0, attempt - 1));
|
|
72
|
-
}
|
|
73
|
-
//# sourceMappingURL=stream-errors.js.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type ShortcutXLAgentAssistantMessage, type ShortcutXLModelStreamEvent } from '../contracts/model-stream.js';
|
|
2
|
-
import type { RuntimeAssistantMessage } from '../core/session/session-error-recovery.js';
|
|
3
|
-
import type { ShortcutStreamEvent } from './stream-sse.js';
|
|
4
|
-
export declare function createInitialAssistantMessage(model: string): RuntimeAssistantMessage;
|
|
5
|
-
export declare function createAssistantMessageSnapshot(message: RuntimeAssistantMessage): ShortcutXLAgentAssistantMessage;
|
|
6
|
-
export interface StreamAttemptEventState {
|
|
7
|
-
readonly partial: RuntimeAssistantMessage;
|
|
8
|
-
readonly toolCallArguments: Map<number, string>;
|
|
9
|
-
readonly thinkingText: Map<number, string>;
|
|
10
|
-
emitStartIfNeeded(): void;
|
|
11
|
-
markTerminal(): void;
|
|
12
|
-
}
|
|
13
|
-
export declare function processStreamEvent(event: ShortcutStreamEvent, state: StreamAttemptEventState, onEvent: (event: ShortcutXLModelStreamEvent) => void, canRetryInlineError: () => boolean): void;
|
|
14
|
-
//# sourceMappingURL=stream-message-state.d.ts.map
|
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
import { parseStreamErrorPayload, safeModelStreamErrorMessage, ShortcutXLAgentAssistantContentKind, ShortcutXLModelStreamEventKind, ShortcutXLModelStreamStopReason } from '../contracts/model-stream.js';
|
|
2
|
-
import { ShortcutXLAgentProviderId } from './model-registry.js';
|
|
3
|
-
import { isRetryableStreamError, ShortcutXLHttpStreamError } from './stream-errors.js';
|
|
4
|
-
const ShortcutRuntimeApi = 'shortcut-llm';
|
|
5
|
-
// Decode the proxy's usage shape. LangChain-style keys are primary; OpenAI-style
|
|
6
|
-
// fallbacks keep the parser tolerant if a future provider emits them.
|
|
7
|
-
function buildUsage(rawUsage) {
|
|
8
|
-
const details = rawUsage.input_token_details ?? {};
|
|
9
|
-
const input = rawUsage.input_tokens ??
|
|
10
|
-
rawUsage.prompt_tokens ??
|
|
11
|
-
0;
|
|
12
|
-
const output = rawUsage.output_tokens ??
|
|
13
|
-
rawUsage.completion_tokens ??
|
|
14
|
-
0;
|
|
15
|
-
const cacheRead = details.cache_read ??
|
|
16
|
-
rawUsage.cache_read_tokens ??
|
|
17
|
-
0;
|
|
18
|
-
const cacheWrite = details.cache_creation ??
|
|
19
|
-
rawUsage.cache_creation_tokens ??
|
|
20
|
-
0;
|
|
21
|
-
return {
|
|
22
|
-
input,
|
|
23
|
-
output,
|
|
24
|
-
cacheRead,
|
|
25
|
-
cacheWrite,
|
|
26
|
-
totalTokens: input + output,
|
|
27
|
-
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 }
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export function createInitialAssistantMessage(model) {
|
|
31
|
-
return {
|
|
32
|
-
role: 'assistant',
|
|
33
|
-
content: [],
|
|
34
|
-
api: ShortcutRuntimeApi,
|
|
35
|
-
provider: ShortcutXLAgentProviderId.Shortcut,
|
|
36
|
-
model,
|
|
37
|
-
usage: buildUsage({}),
|
|
38
|
-
stopReason: 'stop',
|
|
39
|
-
timestamp: Date.now()
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
export function createAssistantMessageSnapshot(message) {
|
|
43
|
-
return {
|
|
44
|
-
api: message.api,
|
|
45
|
-
content: message.content.map((content) => {
|
|
46
|
-
switch (content.type) {
|
|
47
|
-
case 'text':
|
|
48
|
-
return {
|
|
49
|
-
type: ShortcutXLAgentAssistantContentKind.Text,
|
|
50
|
-
text: content.text
|
|
51
|
-
};
|
|
52
|
-
case 'thinking':
|
|
53
|
-
return {
|
|
54
|
-
type: ShortcutXLAgentAssistantContentKind.Thinking,
|
|
55
|
-
thinking: content.thinking,
|
|
56
|
-
redacted: content.redacted ?? false,
|
|
57
|
-
thinkingSignature: content.thinkingSignature ?? ''
|
|
58
|
-
};
|
|
59
|
-
case 'toolCall':
|
|
60
|
-
return {
|
|
61
|
-
type: ShortcutXLAgentAssistantContentKind.ToolCall,
|
|
62
|
-
id: content.id,
|
|
63
|
-
name: content.name,
|
|
64
|
-
arguments: content.arguments
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
}),
|
|
68
|
-
...(message.errorDetails ? { errorDetails: message.errorDetails } : {}),
|
|
69
|
-
errorMessage: message.errorMessage,
|
|
70
|
-
model: message.model,
|
|
71
|
-
provider: message.provider,
|
|
72
|
-
role: 'assistant',
|
|
73
|
-
stopReason: message.stopReason,
|
|
74
|
-
timestamp: message.timestamp,
|
|
75
|
-
usage: message.usage
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
export function processStreamEvent(event, state, onEvent, canRetryInlineError) {
|
|
79
|
-
const { partial, toolCallArguments, thinkingText } = state;
|
|
80
|
-
if (event.event === 'error') {
|
|
81
|
-
const details = parseStreamErrorPayload(event.payload);
|
|
82
|
-
const streamError = new ShortcutXLHttpStreamError(event.payload.message, details);
|
|
83
|
-
if (canRetryInlineError() && isRetryableStreamError(streamError)) {
|
|
84
|
-
throw streamError;
|
|
85
|
-
}
|
|
86
|
-
// Terminal error. Emit Start first so consumers always see
|
|
87
|
-
// Start -> ... -> Error ordering even when the very first SSE frame errors.
|
|
88
|
-
state.emitStartIfNeeded();
|
|
89
|
-
partial.stopReason = ShortcutXLModelStreamStopReason.Error;
|
|
90
|
-
partial.errorMessage = details ? safeModelStreamErrorMessage(details) : event.payload.message;
|
|
91
|
-
if (details)
|
|
92
|
-
partial.errorDetails = details;
|
|
93
|
-
state.markTerminal();
|
|
94
|
-
onEvent({
|
|
95
|
-
kind: ShortcutXLModelStreamEventKind.Error,
|
|
96
|
-
error: createAssistantMessageSnapshot(partial),
|
|
97
|
-
partial: createAssistantMessageSnapshot(partial),
|
|
98
|
-
reason: ShortcutXLModelStreamStopReason.Error
|
|
99
|
-
});
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
state.emitStartIfNeeded();
|
|
103
|
-
switch (event.event) {
|
|
104
|
-
case 'text_start':
|
|
105
|
-
ensureContentSlot(partial.content, event.payload.content_index, partial);
|
|
106
|
-
partial.content[event.payload.content_index] = {
|
|
107
|
-
type: 'text',
|
|
108
|
-
text: ''
|
|
109
|
-
};
|
|
110
|
-
onEvent({
|
|
111
|
-
kind: ShortcutXLModelStreamEventKind.TextStart,
|
|
112
|
-
contentIndex: event.payload.content_index,
|
|
113
|
-
partial: createAssistantMessageSnapshot(partial)
|
|
114
|
-
});
|
|
115
|
-
return;
|
|
116
|
-
case 'text_delta': {
|
|
117
|
-
ensureContentSlot(partial.content, event.payload.content_index, partial);
|
|
118
|
-
const existing = partial.content[event.payload.content_index];
|
|
119
|
-
const nextText = (existing?.text ?? '') + event.payload.delta;
|
|
120
|
-
partial.content[event.payload.content_index] = {
|
|
121
|
-
type: 'text',
|
|
122
|
-
text: nextText
|
|
123
|
-
};
|
|
124
|
-
onEvent({
|
|
125
|
-
kind: ShortcutXLModelStreamEventKind.TextDelta,
|
|
126
|
-
contentIndex: event.payload.content_index,
|
|
127
|
-
delta: event.payload.delta,
|
|
128
|
-
partial: createAssistantMessageSnapshot(partial)
|
|
129
|
-
});
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
case 'thinking_start':
|
|
133
|
-
ensureContentSlot(partial.content, event.payload.content_index, partial);
|
|
134
|
-
thinkingText.set(event.payload.content_index, '');
|
|
135
|
-
partial.content[event.payload.content_index] = {
|
|
136
|
-
type: 'thinking',
|
|
137
|
-
thinking: '',
|
|
138
|
-
redacted: false,
|
|
139
|
-
thinkingSignature: ''
|
|
140
|
-
};
|
|
141
|
-
onEvent({
|
|
142
|
-
kind: ShortcutXLModelStreamEventKind.ThinkingStart,
|
|
143
|
-
contentIndex: event.payload.content_index,
|
|
144
|
-
partial: createAssistantMessageSnapshot(partial)
|
|
145
|
-
});
|
|
146
|
-
return;
|
|
147
|
-
case 'thinking_delta': {
|
|
148
|
-
const nextThinking = (thinkingText.get(event.payload.content_index) ?? '') + event.payload.delta;
|
|
149
|
-
thinkingText.set(event.payload.content_index, nextThinking);
|
|
150
|
-
partial.content[event.payload.content_index] = {
|
|
151
|
-
type: 'thinking',
|
|
152
|
-
thinking: nextThinking,
|
|
153
|
-
redacted: false,
|
|
154
|
-
thinkingSignature: ''
|
|
155
|
-
};
|
|
156
|
-
onEvent({
|
|
157
|
-
kind: ShortcutXLModelStreamEventKind.ThinkingDelta,
|
|
158
|
-
contentIndex: event.payload.content_index,
|
|
159
|
-
delta: event.payload.delta,
|
|
160
|
-
partial: createAssistantMessageSnapshot(partial)
|
|
161
|
-
});
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
case 'thinking_end': {
|
|
165
|
-
const existing = partial.content[event.payload.content_index];
|
|
166
|
-
partial.content[event.payload.content_index] = {
|
|
167
|
-
...existing,
|
|
168
|
-
type: 'thinking',
|
|
169
|
-
thinkingSignature: event.payload.signature,
|
|
170
|
-
redacted: false
|
|
171
|
-
};
|
|
172
|
-
onEvent({
|
|
173
|
-
kind: ShortcutXLModelStreamEventKind.ThinkingEnd,
|
|
174
|
-
content: existing?.thinking ?? '',
|
|
175
|
-
contentIndex: event.payload.content_index,
|
|
176
|
-
partial: createAssistantMessageSnapshot(partial)
|
|
177
|
-
});
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
case 'thinking_redacted': {
|
|
181
|
-
const existing = partial.content[event.payload.content_index];
|
|
182
|
-
partial.content[event.payload.content_index] = {
|
|
183
|
-
...existing,
|
|
184
|
-
type: 'thinking',
|
|
185
|
-
redacted: true,
|
|
186
|
-
thinkingSignature: event.payload.signature
|
|
187
|
-
};
|
|
188
|
-
onEvent({
|
|
189
|
-
kind: ShortcutXLModelStreamEventKind.ThinkingRedacted,
|
|
190
|
-
contentIndex: event.payload.content_index,
|
|
191
|
-
partial: createAssistantMessageSnapshot(partial)
|
|
192
|
-
});
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
case 'toolcall_start':
|
|
196
|
-
partial.content[event.payload.content_index] = {
|
|
197
|
-
type: 'toolCall',
|
|
198
|
-
id: event.payload.id,
|
|
199
|
-
name: event.payload.name,
|
|
200
|
-
arguments: {}
|
|
201
|
-
};
|
|
202
|
-
toolCallArguments.set(event.payload.content_index, '');
|
|
203
|
-
onEvent({
|
|
204
|
-
kind: ShortcutXLModelStreamEventKind.ToolCallStart,
|
|
205
|
-
contentIndex: event.payload.content_index,
|
|
206
|
-
partial: createAssistantMessageSnapshot(partial)
|
|
207
|
-
});
|
|
208
|
-
return;
|
|
209
|
-
case 'toolcall_delta': {
|
|
210
|
-
const nextArguments = (toolCallArguments.get(event.payload.content_index) ?? '') + event.payload.delta;
|
|
211
|
-
toolCallArguments.set(event.payload.content_index, nextArguments);
|
|
212
|
-
onEvent({
|
|
213
|
-
kind: ShortcutXLModelStreamEventKind.ToolCallDelta,
|
|
214
|
-
contentIndex: event.payload.content_index,
|
|
215
|
-
delta: event.payload.delta,
|
|
216
|
-
partial: createAssistantMessageSnapshot(partial)
|
|
217
|
-
});
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
case 'toolcall_end': {
|
|
221
|
-
let parsedArguments = {};
|
|
222
|
-
try {
|
|
223
|
-
parsedArguments = JSON.parse(event.payload.arguments);
|
|
224
|
-
}
|
|
225
|
-
catch {
|
|
226
|
-
parsedArguments = {};
|
|
227
|
-
}
|
|
228
|
-
partial.content[event.payload.content_index] = {
|
|
229
|
-
type: 'toolCall',
|
|
230
|
-
id: event.payload.id,
|
|
231
|
-
name: event.payload.name,
|
|
232
|
-
arguments: parsedArguments
|
|
233
|
-
};
|
|
234
|
-
onEvent({
|
|
235
|
-
kind: ShortcutXLModelStreamEventKind.ToolCallEnd,
|
|
236
|
-
contentIndex: event.payload.content_index,
|
|
237
|
-
partial: createAssistantMessageSnapshot(partial),
|
|
238
|
-
toolCall: {
|
|
239
|
-
type: ShortcutXLAgentAssistantContentKind.ToolCall,
|
|
240
|
-
id: event.payload.id,
|
|
241
|
-
name: event.payload.name,
|
|
242
|
-
arguments: parsedArguments
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
case 'done':
|
|
248
|
-
partial.stopReason =
|
|
249
|
-
event.payload.stop_reason === 'tool_use'
|
|
250
|
-
? ShortcutXLModelStreamStopReason.ToolUse
|
|
251
|
-
: event.payload.stop_reason === 'max_tokens'
|
|
252
|
-
? ShortcutXLModelStreamStopReason.Length
|
|
253
|
-
: ShortcutXLModelStreamStopReason.Stop;
|
|
254
|
-
partial.usage = buildUsage(event.payload.usage);
|
|
255
|
-
state.markTerminal();
|
|
256
|
-
onEvent({
|
|
257
|
-
kind: ShortcutXLModelStreamEventKind.Done,
|
|
258
|
-
message: createAssistantMessageSnapshot(partial),
|
|
259
|
-
partial: createAssistantMessageSnapshot(partial),
|
|
260
|
-
reason: partial.stopReason
|
|
261
|
-
});
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
function ensureContentSlot(content, index, fallback) {
|
|
266
|
-
while (content.length <= index) {
|
|
267
|
-
content.push({ type: 'text', text: '' });
|
|
268
|
-
}
|
|
269
|
-
fallback.content = content;
|
|
270
|
-
}
|
|
271
|
-
//# sourceMappingURL=stream-message-state.js.map
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import type { ShortcutXLModelStreamErrorDetails } from '../contracts/model-stream.js';
|
|
2
|
-
export declare const SHORTCUT_STREAM_IDLE_TIMEOUT_MS = 180000;
|
|
3
|
-
export type ShortcutStreamEvent = {
|
|
4
|
-
event: 'text_start';
|
|
5
|
-
payload: {
|
|
6
|
-
content_index: number;
|
|
7
|
-
};
|
|
8
|
-
} | {
|
|
9
|
-
event: 'text_delta';
|
|
10
|
-
payload: {
|
|
11
|
-
content_index: number;
|
|
12
|
-
delta: string;
|
|
13
|
-
};
|
|
14
|
-
} | {
|
|
15
|
-
event: 'thinking_start';
|
|
16
|
-
payload: {
|
|
17
|
-
content_index: number;
|
|
18
|
-
};
|
|
19
|
-
} | {
|
|
20
|
-
event: 'thinking_delta';
|
|
21
|
-
payload: {
|
|
22
|
-
content_index: number;
|
|
23
|
-
delta: string;
|
|
24
|
-
};
|
|
25
|
-
} | {
|
|
26
|
-
event: 'thinking_end';
|
|
27
|
-
payload: {
|
|
28
|
-
content_index: number;
|
|
29
|
-
signature: string;
|
|
30
|
-
};
|
|
31
|
-
} | {
|
|
32
|
-
event: 'thinking_redacted';
|
|
33
|
-
payload: {
|
|
34
|
-
content_index: number;
|
|
35
|
-
signature: string;
|
|
36
|
-
};
|
|
37
|
-
} | {
|
|
38
|
-
event: 'toolcall_start';
|
|
39
|
-
payload: {
|
|
40
|
-
content_index: number;
|
|
41
|
-
id: string;
|
|
42
|
-
name: string;
|
|
43
|
-
};
|
|
44
|
-
} | {
|
|
45
|
-
event: 'toolcall_delta';
|
|
46
|
-
payload: {
|
|
47
|
-
content_index: number;
|
|
48
|
-
delta: string;
|
|
49
|
-
};
|
|
50
|
-
} | {
|
|
51
|
-
event: 'toolcall_end';
|
|
52
|
-
payload: {
|
|
53
|
-
content_index: number;
|
|
54
|
-
id: string;
|
|
55
|
-
name: string;
|
|
56
|
-
arguments: string;
|
|
57
|
-
};
|
|
58
|
-
} | {
|
|
59
|
-
event: 'done';
|
|
60
|
-
payload: {
|
|
61
|
-
stop_reason: string;
|
|
62
|
-
usage: Record<string, number>;
|
|
63
|
-
};
|
|
64
|
-
} | {
|
|
65
|
-
event: 'error';
|
|
66
|
-
payload: {
|
|
67
|
-
message: string;
|
|
68
|
-
provider_error_type?: ShortcutXLModelStreamErrorDetails['providerErrorType'];
|
|
69
|
-
retry_after_ms?: number;
|
|
70
|
-
retryable?: boolean;
|
|
71
|
-
status?: number;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
export declare function readShortcutStream(response: Response, onEvent: (event: ShortcutStreamEvent) => void, idleTimeoutMs?: number, observers?: {
|
|
75
|
-
onBytes?: (length: number) => void;
|
|
76
|
-
onEvent?: () => void;
|
|
77
|
-
}): Promise<void>;
|
|
78
|
-
//# sourceMappingURL=stream-sse.d.ts.map
|