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
|
@@ -12499,12 +12499,326 @@ function requireClient() {
|
|
|
12499
12499
|
}
|
|
12500
12500
|
var clientExports = requireClient();
|
|
12501
12501
|
const ReactDOM = /* @__PURE__ */ getDefaultExportFromCjs(clientExports);
|
|
12502
|
+
const BOTTOM_THRESHOLD = 10;
|
|
12503
|
+
reactExports.createContext(null);
|
|
12504
|
+
function useAutoScroll() {
|
|
12505
|
+
const [scrollEl, setScrollEl] = reactExports.useState(null);
|
|
12506
|
+
const [contentEl, setContentEl] = reactExports.useState(null);
|
|
12507
|
+
const scrollRef = reactExports.useCallback((node2) => setScrollEl(node2), []);
|
|
12508
|
+
const contentRef = reactExports.useCallback((node2) => setContentEl(node2), []);
|
|
12509
|
+
const [isAtBottom, setIsAtBottom] = reactExports.useState(true);
|
|
12510
|
+
const [isEngaged, setIsEngaged] = reactExports.useState(true);
|
|
12511
|
+
const isEngagedRef = reactExports.useRef(true);
|
|
12512
|
+
isEngagedRef.current = isEngaged;
|
|
12513
|
+
const previousContentHeightRef = reactExports.useRef(0);
|
|
12514
|
+
const previousScrollMetricsRef = reactExports.useRef(null);
|
|
12515
|
+
const performScroll = reactExports.useCallback(() => {
|
|
12516
|
+
if (!scrollEl) return;
|
|
12517
|
+
scrollEl.scrollTop = scrollEl.scrollHeight - scrollEl.clientHeight;
|
|
12518
|
+
previousScrollMetricsRef.current = {
|
|
12519
|
+
scrollTop: scrollEl.scrollTop,
|
|
12520
|
+
scrollHeight: scrollEl.scrollHeight,
|
|
12521
|
+
clientHeight: scrollEl.clientHeight
|
|
12522
|
+
};
|
|
12523
|
+
}, [scrollEl]);
|
|
12524
|
+
const scrollToBottom = reactExports.useCallback(() => {
|
|
12525
|
+
setIsEngaged(true);
|
|
12526
|
+
isEngagedRef.current = true;
|
|
12527
|
+
performScroll();
|
|
12528
|
+
}, [performScroll]);
|
|
12529
|
+
const disengage = reactExports.useCallback(() => {
|
|
12530
|
+
setIsEngaged(false);
|
|
12531
|
+
isEngagedRef.current = false;
|
|
12532
|
+
}, []);
|
|
12533
|
+
const engage = reactExports.useCallback(() => {
|
|
12534
|
+
setIsEngaged(true);
|
|
12535
|
+
isEngagedRef.current = true;
|
|
12536
|
+
requestAnimationFrame(() => {
|
|
12537
|
+
if (isEngagedRef.current) performScroll();
|
|
12538
|
+
});
|
|
12539
|
+
}, [performScroll]);
|
|
12540
|
+
reactExports.useEffect(() => {
|
|
12541
|
+
if (!scrollEl) return;
|
|
12542
|
+
previousScrollMetricsRef.current = {
|
|
12543
|
+
scrollTop: scrollEl.scrollTop,
|
|
12544
|
+
scrollHeight: scrollEl.scrollHeight,
|
|
12545
|
+
clientHeight: scrollEl.clientHeight
|
|
12546
|
+
};
|
|
12547
|
+
const handleScroll = () => {
|
|
12548
|
+
const { scrollTop, scrollHeight, clientHeight } = scrollEl;
|
|
12549
|
+
const atBottom = scrollHeight - scrollTop - clientHeight < BOTTOM_THRESHOLD;
|
|
12550
|
+
const previous2 = previousScrollMetricsRef.current;
|
|
12551
|
+
const scrollTopDelta = previous2 === null ? 0 : scrollTop - previous2.scrollTop;
|
|
12552
|
+
const maxScrollTopDelta = previous2 === null ? 0 : Math.max(0, scrollHeight - clientHeight) - Math.max(0, previous2.scrollHeight - previous2.clientHeight);
|
|
12553
|
+
const movedUpBeyondGeometry = scrollTopDelta < Math.min(0, maxScrollTopDelta);
|
|
12554
|
+
previousScrollMetricsRef.current = { scrollTop, scrollHeight, clientHeight };
|
|
12555
|
+
setIsAtBottom(atBottom);
|
|
12556
|
+
if (!atBottom && movedUpBeyondGeometry && isEngagedRef.current) {
|
|
12557
|
+
setIsEngaged(false);
|
|
12558
|
+
isEngagedRef.current = false;
|
|
12559
|
+
} else if (atBottom && !isEngagedRef.current) {
|
|
12560
|
+
setIsEngaged(true);
|
|
12561
|
+
isEngagedRef.current = true;
|
|
12562
|
+
}
|
|
12563
|
+
};
|
|
12564
|
+
scrollEl.addEventListener("scroll", handleScroll, { passive: true });
|
|
12565
|
+
return () => scrollEl.removeEventListener("scroll", handleScroll);
|
|
12566
|
+
}, [scrollEl]);
|
|
12567
|
+
reactExports.useEffect(() => {
|
|
12568
|
+
if (!contentEl || !scrollEl) return;
|
|
12569
|
+
let rafId = null;
|
|
12570
|
+
const observer = new ResizeObserver(() => {
|
|
12571
|
+
if (rafId !== null) cancelAnimationFrame(rafId);
|
|
12572
|
+
rafId = requestAnimationFrame(() => {
|
|
12573
|
+
rafId = null;
|
|
12574
|
+
const newHeight = contentEl.scrollHeight;
|
|
12575
|
+
if (newHeight > previousContentHeightRef.current) {
|
|
12576
|
+
if (isEngagedRef.current) {
|
|
12577
|
+
performScroll();
|
|
12578
|
+
} else {
|
|
12579
|
+
const { scrollTop, scrollHeight, clientHeight } = scrollEl;
|
|
12580
|
+
setIsAtBottom(scrollHeight - scrollTop - clientHeight < BOTTOM_THRESHOLD);
|
|
12581
|
+
}
|
|
12582
|
+
}
|
|
12583
|
+
previousContentHeightRef.current = newHeight;
|
|
12584
|
+
});
|
|
12585
|
+
});
|
|
12586
|
+
previousContentHeightRef.current = contentEl.scrollHeight;
|
|
12587
|
+
observer.observe(contentEl);
|
|
12588
|
+
return () => {
|
|
12589
|
+
observer.disconnect();
|
|
12590
|
+
if (rafId !== null) cancelAnimationFrame(rafId);
|
|
12591
|
+
};
|
|
12592
|
+
}, [contentEl, scrollEl, performScroll]);
|
|
12593
|
+
reactExports.useEffect(() => {
|
|
12594
|
+
if (!scrollEl) return;
|
|
12595
|
+
let rafId = null;
|
|
12596
|
+
const observer = new ResizeObserver(() => {
|
|
12597
|
+
if (rafId !== null) cancelAnimationFrame(rafId);
|
|
12598
|
+
rafId = requestAnimationFrame(() => {
|
|
12599
|
+
rafId = null;
|
|
12600
|
+
if (isEngagedRef.current) {
|
|
12601
|
+
performScroll();
|
|
12602
|
+
}
|
|
12603
|
+
});
|
|
12604
|
+
});
|
|
12605
|
+
observer.observe(scrollEl);
|
|
12606
|
+
return () => {
|
|
12607
|
+
observer.disconnect();
|
|
12608
|
+
if (rafId !== null) cancelAnimationFrame(rafId);
|
|
12609
|
+
};
|
|
12610
|
+
}, [scrollEl, performScroll]);
|
|
12611
|
+
return reactExports.useMemo(
|
|
12612
|
+
() => ({
|
|
12613
|
+
scrollRef,
|
|
12614
|
+
contentRef,
|
|
12615
|
+
scrollElement: scrollEl,
|
|
12616
|
+
isAtBottom,
|
|
12617
|
+
isEngaged,
|
|
12618
|
+
scrollToBottom,
|
|
12619
|
+
disengage,
|
|
12620
|
+
engage
|
|
12621
|
+
}),
|
|
12622
|
+
[scrollRef, contentRef, scrollEl, isAtBottom, isEngaged, scrollToBottom, disengage, engage]
|
|
12623
|
+
);
|
|
12624
|
+
}
|
|
12625
|
+
const scrollStateByThread = {};
|
|
12626
|
+
function useScrollPositionByThread({
|
|
12627
|
+
threadId,
|
|
12628
|
+
scrollElement,
|
|
12629
|
+
isEngaged,
|
|
12630
|
+
disengage,
|
|
12631
|
+
engage
|
|
12632
|
+
}) {
|
|
12633
|
+
const prevThreadIdRef = reactExports.useRef(threadId);
|
|
12634
|
+
const hasRestoredRef = reactExports.useRef(false);
|
|
12635
|
+
const isEngagedRef = reactExports.useRef(isEngaged);
|
|
12636
|
+
isEngagedRef.current = isEngaged;
|
|
12637
|
+
const handleScroll = reactExports.useCallback(() => {
|
|
12638
|
+
if (!scrollElement || !threadId) return;
|
|
12639
|
+
scrollStateByThread[threadId] = {
|
|
12640
|
+
scrollTop: scrollElement.scrollTop,
|
|
12641
|
+
wasEngaged: isEngagedRef.current
|
|
12642
|
+
};
|
|
12643
|
+
}, [scrollElement, threadId]);
|
|
12644
|
+
reactExports.useEffect(() => {
|
|
12645
|
+
if (!scrollElement) return;
|
|
12646
|
+
scrollElement.addEventListener("scroll", handleScroll, { passive: true });
|
|
12647
|
+
return () => scrollElement.removeEventListener("scroll", handleScroll);
|
|
12648
|
+
}, [scrollElement, handleScroll]);
|
|
12649
|
+
reactExports.useEffect(() => {
|
|
12650
|
+
if (!scrollElement || !threadId || prevThreadIdRef.current !== threadId || !hasRestoredRef.current) {
|
|
12651
|
+
return;
|
|
12652
|
+
}
|
|
12653
|
+
scrollStateByThread[threadId] = {
|
|
12654
|
+
scrollTop: scrollElement.scrollTop,
|
|
12655
|
+
wasEngaged: isEngaged
|
|
12656
|
+
};
|
|
12657
|
+
}, [threadId, scrollElement, isEngaged]);
|
|
12658
|
+
reactExports.useEffect(() => {
|
|
12659
|
+
if (!scrollElement) return;
|
|
12660
|
+
let rafId = null;
|
|
12661
|
+
if (prevThreadIdRef.current !== threadId) {
|
|
12662
|
+
prevThreadIdRef.current = threadId;
|
|
12663
|
+
hasRestoredRef.current = false;
|
|
12664
|
+
}
|
|
12665
|
+
if (threadId && !hasRestoredRef.current) {
|
|
12666
|
+
const saved = scrollStateByThread[threadId];
|
|
12667
|
+
hasRestoredRef.current = true;
|
|
12668
|
+
if (saved !== void 0 && !saved.wasEngaged) {
|
|
12669
|
+
rafId = requestAnimationFrame(() => {
|
|
12670
|
+
if (prevThreadIdRef.current !== threadId) return;
|
|
12671
|
+
disengage?.();
|
|
12672
|
+
scrollElement.scrollTop = saved.scrollTop;
|
|
12673
|
+
});
|
|
12674
|
+
} else {
|
|
12675
|
+
engage?.();
|
|
12676
|
+
}
|
|
12677
|
+
}
|
|
12678
|
+
return () => {
|
|
12679
|
+
if (rafId !== null) {
|
|
12680
|
+
cancelAnimationFrame(rafId);
|
|
12681
|
+
}
|
|
12682
|
+
};
|
|
12683
|
+
}, [threadId, scrollElement, disengage, engage]);
|
|
12684
|
+
}
|
|
12685
|
+
const INSUFFICIENT_CREDITS_ERROR_CODE = "insufficient_credits";
|
|
12686
|
+
const HOST_AUTH_UNAVAILABLE_ERROR_CODE = "host_auth_unavailable";
|
|
12687
|
+
const PROVIDER_REFUSAL_ERROR_CODE = "provider_refusal";
|
|
12688
|
+
const HOST_AUTH_UNAVAILABLE_MESSAGE_PATTERN = /^(?:No credentials available - user needs to log in|Credentials still not valid after refresh|Failed to refresh credentials|Shortcut authentication is unavailable\. Please sign in again\.|ShortcutXL stream: (?:no access token available|token refresh failed|no access token after refresh|authentication refresh did not return a token) (?:-|—) please sign in again\.)$/i;
|
|
12689
|
+
function isHostAuthUnavailableErrorMessage(message) {
|
|
12690
|
+
return message !== void 0 && HOST_AUTH_UNAVAILABLE_MESSAGE_PATTERN.test(message.trim());
|
|
12691
|
+
}
|
|
12692
|
+
const TERMINAL_MODEL_STREAM_ERROR_CODES = [
|
|
12693
|
+
INSUFFICIENT_CREDITS_ERROR_CODE,
|
|
12694
|
+
HOST_AUTH_UNAVAILABLE_ERROR_CODE,
|
|
12695
|
+
PROVIDER_REFUSAL_ERROR_CODE,
|
|
12696
|
+
"customer_credential_scope_required",
|
|
12697
|
+
"customer_credential_resolution_failed",
|
|
12698
|
+
"customer_credential_resolution_timeout",
|
|
12699
|
+
"customer_credential_resolution_cancelled",
|
|
12700
|
+
"customer_credential_unconfigured",
|
|
12701
|
+
"unsupported_credential_mode",
|
|
12702
|
+
"model_policy_rejected"
|
|
12703
|
+
];
|
|
12704
|
+
new Set(TERMINAL_MODEL_STREAM_ERROR_CODES);
|
|
12502
12705
|
function CommandCenter() {
|
|
12503
12706
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "empty-state command-center", "aria-labelledby": "command-center-heading", children: [
|
|
12504
12707
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { id: "command-center-heading", children: "Coming soon" }),
|
|
12505
12708
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Schedule API jobs and monitor every run from submission through completion." })
|
|
12506
12709
|
] });
|
|
12507
12710
|
}
|
|
12711
|
+
const PATH_DELIMITERS = /* @__PURE__ */ new Set([" ", " ", '"', "'", "="]);
|
|
12712
|
+
function findLastDelimiter(text2) {
|
|
12713
|
+
for (let i = text2.length - 1; i >= 0; i -= 1) {
|
|
12714
|
+
if (PATH_DELIMITERS.has(text2[i] ?? "")) return i;
|
|
12715
|
+
}
|
|
12716
|
+
return -1;
|
|
12717
|
+
}
|
|
12718
|
+
function findUnclosedQuoteStart(text2) {
|
|
12719
|
+
let inQuotes = false;
|
|
12720
|
+
let quoteStart = -1;
|
|
12721
|
+
for (let i = 0; i < text2.length; i += 1) {
|
|
12722
|
+
if (text2[i] === '"') {
|
|
12723
|
+
inQuotes = !inQuotes;
|
|
12724
|
+
if (inQuotes) quoteStart = i;
|
|
12725
|
+
}
|
|
12726
|
+
}
|
|
12727
|
+
return inQuotes ? quoteStart : null;
|
|
12728
|
+
}
|
|
12729
|
+
function isTokenStart(text2, index2) {
|
|
12730
|
+
return index2 === 0 || PATH_DELIMITERS.has(text2[index2 - 1] ?? "");
|
|
12731
|
+
}
|
|
12732
|
+
function extractQuotedPrefix(text2) {
|
|
12733
|
+
const quoteStart = findUnclosedQuoteStart(text2);
|
|
12734
|
+
if (quoteStart === null) return null;
|
|
12735
|
+
if (quoteStart > 0 && text2[quoteStart - 1] === "@") {
|
|
12736
|
+
if (!isTokenStart(text2, quoteStart - 1)) return null;
|
|
12737
|
+
return text2.slice(quoteStart - 1);
|
|
12738
|
+
}
|
|
12739
|
+
if (!isTokenStart(text2, quoteStart)) return null;
|
|
12740
|
+
return text2.slice(quoteStart);
|
|
12741
|
+
}
|
|
12742
|
+
function extractAtPrefix(text2) {
|
|
12743
|
+
const quotedPrefix = extractQuotedPrefix(text2);
|
|
12744
|
+
if (quotedPrefix?.startsWith('@"')) return quotedPrefix;
|
|
12745
|
+
const lastDelimiterIndex = findLastDelimiter(text2);
|
|
12746
|
+
const tokenStart = lastDelimiterIndex === -1 ? 0 : lastDelimiterIndex + 1;
|
|
12747
|
+
return text2[tokenStart] === "@" ? text2.slice(tokenStart) : null;
|
|
12748
|
+
}
|
|
12749
|
+
function applyAutocompleteCompletion(lines, cursorLine, cursorCol, item, prefix) {
|
|
12750
|
+
const currentLine = lines[cursorLine] || "";
|
|
12751
|
+
const beforePrefix = currentLine.slice(0, cursorCol - prefix.length);
|
|
12752
|
+
const afterCursor = currentLine.slice(cursorCol);
|
|
12753
|
+
const isQuotedPrefix = prefix.startsWith('"') || prefix.startsWith('@"');
|
|
12754
|
+
const adjustedAfterCursor = isQuotedPrefix && item.value.endsWith('"') && afterCursor.startsWith('"') ? afterCursor.slice(1) : afterCursor;
|
|
12755
|
+
const isSlashCommand = prefix.startsWith("/") && !prefix.slice(1).includes("/") && (beforePrefix.trim() === "" || item.value.startsWith("skill:"));
|
|
12756
|
+
if (isSlashCommand) {
|
|
12757
|
+
const newLines2 = [...lines];
|
|
12758
|
+
newLines2[cursorLine] = `${beforePrefix}/${item.value} ${adjustedAfterCursor}`;
|
|
12759
|
+
return {
|
|
12760
|
+
lines: newLines2,
|
|
12761
|
+
cursorLine,
|
|
12762
|
+
cursorCol: beforePrefix.length + item.value.length + 2
|
|
12763
|
+
};
|
|
12764
|
+
}
|
|
12765
|
+
if (prefix.startsWith("@")) {
|
|
12766
|
+
const isDirectory2 = item.label.endsWith("/");
|
|
12767
|
+
const suffix = isDirectory2 ? "" : " ";
|
|
12768
|
+
const newLines2 = [...lines];
|
|
12769
|
+
newLines2[cursorLine] = `${beforePrefix + item.value}${suffix}${adjustedAfterCursor}`;
|
|
12770
|
+
const cursorOffset2 = isDirectory2 && item.value.endsWith('"') ? item.value.length - 1 : item.value.length;
|
|
12771
|
+
return {
|
|
12772
|
+
lines: newLines2,
|
|
12773
|
+
cursorLine,
|
|
12774
|
+
cursorCol: beforePrefix.length + cursorOffset2 + suffix.length
|
|
12775
|
+
};
|
|
12776
|
+
}
|
|
12777
|
+
const newLines = [...lines];
|
|
12778
|
+
newLines[cursorLine] = beforePrefix + item.value + adjustedAfterCursor;
|
|
12779
|
+
const isDirectory = item.label.endsWith("/");
|
|
12780
|
+
const cursorOffset = isDirectory && item.value.endsWith('"') ? item.value.length - 1 : item.value.length;
|
|
12781
|
+
return {
|
|
12782
|
+
lines: newLines,
|
|
12783
|
+
cursorLine,
|
|
12784
|
+
cursorCol: beforePrefix.length + cursorOffset
|
|
12785
|
+
};
|
|
12786
|
+
}
|
|
12787
|
+
function editorPosition(message, cursor) {
|
|
12788
|
+
if (!Number.isInteger(cursor) || cursor < 0 || cursor > message.length) {
|
|
12789
|
+
throw new Error("File mention cursor is outside the message");
|
|
12790
|
+
}
|
|
12791
|
+
const lines = message.split("\n");
|
|
12792
|
+
const beforeCursor = message.slice(0, cursor).split("\n");
|
|
12793
|
+
return {
|
|
12794
|
+
cursorLine: beforeCursor.length - 1,
|
|
12795
|
+
cursorCol: beforeCursor.at(-1)?.length ?? 0,
|
|
12796
|
+
lines
|
|
12797
|
+
};
|
|
12798
|
+
}
|
|
12799
|
+
function absoluteCursor(lines, cursorLine, cursorCol) {
|
|
12800
|
+
return lines.slice(0, cursorLine).reduce((length, line2) => length + line2.length + 1, 0) + cursorCol;
|
|
12801
|
+
}
|
|
12802
|
+
function getFileMentionContext(message, cursor) {
|
|
12803
|
+
const position2 = editorPosition(message, cursor);
|
|
12804
|
+
const currentLine = position2.lines[position2.cursorLine] ?? "";
|
|
12805
|
+
const prefix = extractAtPrefix(currentLine.slice(0, position2.cursorCol));
|
|
12806
|
+
return prefix?.startsWith("@") ? { ...position2, prefix } : null;
|
|
12807
|
+
}
|
|
12808
|
+
function applyFileMentionCompletion(message, cursor, prefix, item) {
|
|
12809
|
+
const position2 = editorPosition(message, cursor);
|
|
12810
|
+
const completion = applyAutocompleteCompletion(
|
|
12811
|
+
position2.lines,
|
|
12812
|
+
position2.cursorLine,
|
|
12813
|
+
position2.cursorCol,
|
|
12814
|
+
item,
|
|
12815
|
+
prefix
|
|
12816
|
+
);
|
|
12817
|
+
return {
|
|
12818
|
+
message: completion.lines.join("\n"),
|
|
12819
|
+
cursor: absoluteCursor(completion.lines, completion.cursorLine, completion.cursorCol)
|
|
12820
|
+
};
|
|
12821
|
+
}
|
|
12508
12822
|
function useOutsideDismiss(open, ref, onDismiss) {
|
|
12509
12823
|
reactExports.useEffect(() => {
|
|
12510
12824
|
if (!open) return;
|
|
@@ -12672,6 +12986,7 @@ function label$1(value) {
|
|
|
12672
12986
|
}
|
|
12673
12987
|
function Composer({
|
|
12674
12988
|
disabled,
|
|
12989
|
+
cwd: cwd2,
|
|
12675
12990
|
streaming,
|
|
12676
12991
|
statusText,
|
|
12677
12992
|
commands,
|
|
@@ -12679,6 +12994,7 @@ function Composer({
|
|
|
12679
12994
|
goalToggleRequest,
|
|
12680
12995
|
permissionOpenRequest,
|
|
12681
12996
|
onAbort,
|
|
12997
|
+
onGetFileMentionSuggestions,
|
|
12682
12998
|
onManageGoal,
|
|
12683
12999
|
onModeChange,
|
|
12684
13000
|
onPickAttachments,
|
|
@@ -12687,8 +13003,14 @@ function Composer({
|
|
|
12687
13003
|
onSubmit
|
|
12688
13004
|
}) {
|
|
12689
13005
|
const [message, setMessage] = reactExports.useState("");
|
|
13006
|
+
const [cursor, setCursor] = reactExports.useState(0);
|
|
12690
13007
|
const [sending, setSending] = reactExports.useState(false);
|
|
12691
13008
|
const [attachments, setAttachments] = reactExports.useState([]);
|
|
13009
|
+
const [fileMentionSuggestions, setFileMentionSuggestions] = reactExports.useState(null);
|
|
13010
|
+
const [selectedFileMentionIndex, setSelectedFileMentionIndex] = reactExports.useState(0);
|
|
13011
|
+
const fileMentionRequest = reactExports.useRef(0);
|
|
13012
|
+
const fileMentionMenu = reactExports.useRef(null);
|
|
13013
|
+
const fileMentionMenuId = reactExports.useId();
|
|
12692
13014
|
const [goalArmed, setGoalArmed] = reactExports.useState(false);
|
|
12693
13015
|
const textarea = reactExports.useRef(null);
|
|
12694
13016
|
const queuedMessages = snapshot ? [
|
|
@@ -12699,6 +13021,46 @@ function Composer({
|
|
|
12699
13021
|
const commandMatches = commandQuery === void 0 ? [] : commands.filter((command) => command.name.toLowerCase().includes(commandQuery)).slice(0, 8);
|
|
12700
13022
|
const contextPercent = snapshot?.contextUsage?.percent;
|
|
12701
13023
|
const contextTone = contextPercent === null || contextPercent === void 0 ? "unknown" : contextPercent >= 75 ? "danger" : contextPercent >= 50 ? "warning" : "normal";
|
|
13024
|
+
reactExports.useEffect(() => {
|
|
13025
|
+
const requestId = ++fileMentionRequest.current;
|
|
13026
|
+
const context = getFileMentionContext(message, cursor);
|
|
13027
|
+
if (!cwd2 || disabled || !context) {
|
|
13028
|
+
setFileMentionSuggestions(null);
|
|
13029
|
+
return;
|
|
13030
|
+
}
|
|
13031
|
+
const timeout = window.setTimeout(() => {
|
|
13032
|
+
void onGetFileMentionSuggestions({ cwd: cwd2, prefix: context.prefix }).then((suggestions) => {
|
|
13033
|
+
if (fileMentionRequest.current !== requestId) return;
|
|
13034
|
+
setFileMentionSuggestions(suggestions);
|
|
13035
|
+
setSelectedFileMentionIndex(0);
|
|
13036
|
+
}).catch(() => {
|
|
13037
|
+
if (fileMentionRequest.current === requestId) setFileMentionSuggestions(null);
|
|
13038
|
+
});
|
|
13039
|
+
}, 60);
|
|
13040
|
+
return () => window.clearTimeout(timeout);
|
|
13041
|
+
}, [cursor, cwd2, disabled, message, onGetFileMentionSuggestions]);
|
|
13042
|
+
reactExports.useEffect(() => {
|
|
13043
|
+
const selectedOption = fileMentionMenu.current?.querySelector(
|
|
13044
|
+
`[data-file-mention-index="${selectedFileMentionIndex}"]`
|
|
13045
|
+
);
|
|
13046
|
+
selectedOption?.scrollIntoView({ block: "nearest" });
|
|
13047
|
+
}, [fileMentionSuggestions, selectedFileMentionIndex]);
|
|
13048
|
+
const completeFileMention = (item) => {
|
|
13049
|
+
if (!fileMentionSuggestions) return;
|
|
13050
|
+
const completion = applyFileMentionCompletion(
|
|
13051
|
+
message,
|
|
13052
|
+
cursor,
|
|
13053
|
+
fileMentionSuggestions.prefix,
|
|
13054
|
+
item
|
|
13055
|
+
);
|
|
13056
|
+
setMessage(completion.message);
|
|
13057
|
+
setCursor(completion.cursor);
|
|
13058
|
+
setFileMentionSuggestions(null);
|
|
13059
|
+
requestAnimationFrame(() => {
|
|
13060
|
+
textarea.current?.focus();
|
|
13061
|
+
textarea.current?.setSelectionRange(completion.cursor, completion.cursor);
|
|
13062
|
+
});
|
|
13063
|
+
};
|
|
12702
13064
|
const submit = async () => {
|
|
12703
13065
|
const value = message.trim();
|
|
12704
13066
|
if (!value && attachments.length === 0 || disabled || sending) return;
|
|
@@ -12707,6 +13069,8 @@ function Composer({
|
|
|
12707
13069
|
const succeeded = goalArmed && !value.startsWith("/") ? await onManageGoal("start", value) : await onSubmit(value, streaming ? "steer" : void 0, attachments);
|
|
12708
13070
|
if (succeeded) {
|
|
12709
13071
|
setMessage("");
|
|
13072
|
+
setCursor(0);
|
|
13073
|
+
setFileMentionSuggestions(null);
|
|
12710
13074
|
setAttachments([]);
|
|
12711
13075
|
if (goalArmed && !value.startsWith("/")) setGoalArmed(false);
|
|
12712
13076
|
textarea.current?.focus();
|
|
@@ -12720,9 +13084,33 @@ function Composer({
|
|
|
12720
13084
|
void submit();
|
|
12721
13085
|
};
|
|
12722
13086
|
const onKeyDown = (event) => {
|
|
13087
|
+
const fileMentionItems = fileMentionSuggestions?.items ?? [];
|
|
13088
|
+
if (fileMentionItems.length > 0) {
|
|
13089
|
+
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
13090
|
+
event.preventDefault();
|
|
13091
|
+
const direction = event.key === "ArrowDown" ? 1 : -1;
|
|
13092
|
+
setSelectedFileMentionIndex(
|
|
13093
|
+
(index2) => (index2 + direction + fileMentionItems.length) % fileMentionItems.length
|
|
13094
|
+
);
|
|
13095
|
+
return;
|
|
13096
|
+
}
|
|
13097
|
+
if (event.key === "Escape") {
|
|
13098
|
+
event.preventDefault();
|
|
13099
|
+
setFileMentionSuggestions(null);
|
|
13100
|
+
return;
|
|
13101
|
+
}
|
|
13102
|
+
if (event.key === "Tab" || event.key === "Enter" && !event.shiftKey) {
|
|
13103
|
+
event.preventDefault();
|
|
13104
|
+
const selected = fileMentionItems[selectedFileMentionIndex];
|
|
13105
|
+
if (selected) completeFileMention(selected);
|
|
13106
|
+
return;
|
|
13107
|
+
}
|
|
13108
|
+
}
|
|
12723
13109
|
if (event.key === "Tab" && commandMatches.length > 0 && commandMatches[0].name.toLowerCase() !== commandQuery) {
|
|
12724
13110
|
event.preventDefault();
|
|
12725
|
-
|
|
13111
|
+
const completion = `/${commandMatches[0].name} `;
|
|
13112
|
+
setMessage(completion);
|
|
13113
|
+
setCursor(completion.length);
|
|
12726
13114
|
return;
|
|
12727
13115
|
}
|
|
12728
13116
|
if (event.key === "Enter" && !event.shiftKey) {
|
|
@@ -12737,13 +13125,46 @@ function Composer({
|
|
|
12737
13125
|
"data-thinking-level": snapshot?.thinkingLevel ?? "off",
|
|
12738
13126
|
onSubmit: onFormSubmit,
|
|
12739
13127
|
children: [
|
|
13128
|
+
fileMentionSuggestions && fileMentionSuggestions.items.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
13129
|
+
"div",
|
|
13130
|
+
{
|
|
13131
|
+
"aria-label": "File mentions",
|
|
13132
|
+
className: "command-menu file-mention-menu",
|
|
13133
|
+
"data-testid": "file-mention-menu",
|
|
13134
|
+
id: fileMentionMenuId,
|
|
13135
|
+
ref: fileMentionMenu,
|
|
13136
|
+
role: "listbox",
|
|
13137
|
+
children: fileMentionSuggestions.items.map((item, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
13138
|
+
"button",
|
|
13139
|
+
{
|
|
13140
|
+
"aria-selected": index2 === selectedFileMentionIndex,
|
|
13141
|
+
className: index2 === selectedFileMentionIndex ? "selected" : void 0,
|
|
13142
|
+
"data-file-mention-index": index2,
|
|
13143
|
+
id: `${fileMentionMenuId}-option-${index2}`,
|
|
13144
|
+
role: "option",
|
|
13145
|
+
type: "button",
|
|
13146
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
13147
|
+
onClick: () => completeFileMention(item),
|
|
13148
|
+
children: [
|
|
13149
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: item.label }),
|
|
13150
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: item.description ?? item.value }),
|
|
13151
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("i", { children: item.label.endsWith("/") ? "folder" : "file" })
|
|
13152
|
+
]
|
|
13153
|
+
},
|
|
13154
|
+
item.value
|
|
13155
|
+
))
|
|
13156
|
+
}
|
|
13157
|
+
),
|
|
12740
13158
|
commandMatches.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "command-menu", "data-testid": "command-menu", role: "listbox", children: commandMatches.map((command) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
12741
13159
|
"button",
|
|
12742
13160
|
{
|
|
13161
|
+
"aria-selected": false,
|
|
12743
13162
|
role: "option",
|
|
12744
13163
|
type: "button",
|
|
12745
13164
|
onClick: () => {
|
|
12746
|
-
|
|
13165
|
+
const completion = `/${command.name} `;
|
|
13166
|
+
setMessage(completion);
|
|
13167
|
+
setCursor(completion.length);
|
|
12747
13168
|
textarea.current?.focus();
|
|
12748
13169
|
},
|
|
12749
13170
|
children: [
|
|
@@ -12799,13 +13220,20 @@ function Composer({
|
|
|
12799
13220
|
"textarea",
|
|
12800
13221
|
{
|
|
12801
13222
|
ref: textarea,
|
|
13223
|
+
"aria-activedescendant": fileMentionSuggestions?.items[selectedFileMentionIndex] ? `${fileMentionMenuId}-option-${selectedFileMentionIndex}` : void 0,
|
|
13224
|
+
"aria-autocomplete": "list",
|
|
13225
|
+
"aria-controls": fileMentionSuggestions?.items.length ? fileMentionMenuId : void 0,
|
|
12802
13226
|
"aria-label": "Message Shortcut",
|
|
12803
13227
|
placeholder: streaming ? "Steer the current turn…" : goalArmed ? "Describe the goal…" : "Ask Shortcut anything…",
|
|
12804
13228
|
disabled,
|
|
12805
13229
|
rows: 1,
|
|
12806
13230
|
value: message,
|
|
12807
|
-
onChange: (event) =>
|
|
12808
|
-
|
|
13231
|
+
onChange: (event) => {
|
|
13232
|
+
setMessage(event.target.value);
|
|
13233
|
+
setCursor(event.target.selectionStart);
|
|
13234
|
+
},
|
|
13235
|
+
onKeyDown,
|
|
13236
|
+
onSelect: (event) => setCursor(event.currentTarget.selectionStart)
|
|
12809
13237
|
}
|
|
12810
13238
|
)
|
|
12811
13239
|
] }),
|
|
@@ -12855,7 +13283,7 @@ function Composer({
|
|
|
12855
13283
|
] })
|
|
12856
13284
|
] }),
|
|
12857
13285
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "composer-actions", children: [
|
|
12858
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
13286
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
12859
13287
|
"button",
|
|
12860
13288
|
{
|
|
12861
13289
|
"aria-label": "Attach files",
|
|
@@ -12870,7 +13298,24 @@ function Composer({
|
|
|
12870
13298
|
return [...byPath.values()];
|
|
12871
13299
|
});
|
|
12872
13300
|
},
|
|
12873
|
-
children:
|
|
13301
|
+
children: [
|
|
13302
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
13303
|
+
"svg",
|
|
13304
|
+
{
|
|
13305
|
+
"aria-hidden": "true",
|
|
13306
|
+
fill: "none",
|
|
13307
|
+
height: "12",
|
|
13308
|
+
stroke: "currentColor",
|
|
13309
|
+
strokeLinecap: "round",
|
|
13310
|
+
strokeLinejoin: "round",
|
|
13311
|
+
strokeWidth: "1.6",
|
|
13312
|
+
viewBox: "0 0 24 24",
|
|
13313
|
+
width: "12",
|
|
13314
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M21.44 11.05 12.25 20.24a6 6 0 0 1-8.49-8.49l8.57-8.57a4 4 0 1 1 5.66 5.66l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48" })
|
|
13315
|
+
}
|
|
13316
|
+
),
|
|
13317
|
+
"Attach"
|
|
13318
|
+
]
|
|
12874
13319
|
}
|
|
12875
13320
|
),
|
|
12876
13321
|
streaming && /* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "stop-button", type: "button", onClick: () => void onAbort(), children: "Stop" }),
|
|
@@ -12881,7 +13326,24 @@ function Composer({
|
|
|
12881
13326
|
"aria-label": "Send message",
|
|
12882
13327
|
disabled: disabled || sending || !message.trim() && attachments.length === 0,
|
|
12883
13328
|
type: "submit",
|
|
12884
|
-
children:
|
|
13329
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
13330
|
+
"svg",
|
|
13331
|
+
{
|
|
13332
|
+
"aria-hidden": "true",
|
|
13333
|
+
fill: "none",
|
|
13334
|
+
height: "13",
|
|
13335
|
+
stroke: "currentColor",
|
|
13336
|
+
strokeLinecap: "round",
|
|
13337
|
+
strokeLinejoin: "round",
|
|
13338
|
+
strokeWidth: "2",
|
|
13339
|
+
viewBox: "0 0 24 24",
|
|
13340
|
+
width: "13",
|
|
13341
|
+
children: [
|
|
13342
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("polyline", { points: "9 10 4 15 9 20" }),
|
|
13343
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M20 4v7a4 4 0 0 1-4 4H4" })
|
|
13344
|
+
]
|
|
13345
|
+
}
|
|
13346
|
+
)
|
|
12885
13347
|
}
|
|
12886
13348
|
)
|
|
12887
13349
|
] })
|
|
@@ -25475,32 +25937,63 @@ function remarkGfm(options) {
|
|
|
25475
25937
|
fromMarkdownExtensions.push(gfmFromMarkdown());
|
|
25476
25938
|
toMarkdownExtensions.push(gfmToMarkdown(settings));
|
|
25477
25939
|
}
|
|
25478
|
-
function
|
|
25940
|
+
function safeMarkdownLink(href) {
|
|
25479
25941
|
if (!href) return void 0;
|
|
25480
25942
|
try {
|
|
25481
25943
|
const url = new URL(href);
|
|
25482
|
-
|
|
25944
|
+
if (url.protocol === "https:" || url.protocol === "http:") {
|
|
25945
|
+
return { href: url.href, kind: "external" };
|
|
25946
|
+
}
|
|
25947
|
+
if (url.protocol === "file:") return { href: url.href, kind: "local-file" };
|
|
25948
|
+
return void 0;
|
|
25483
25949
|
} catch {
|
|
25484
25950
|
return void 0;
|
|
25485
25951
|
}
|
|
25486
25952
|
}
|
|
25953
|
+
function markdownUrlTransform(url, key) {
|
|
25954
|
+
if (key === "href") {
|
|
25955
|
+
const link2 = safeMarkdownLink(url);
|
|
25956
|
+
if (link2?.kind === "local-file") return link2.href;
|
|
25957
|
+
}
|
|
25958
|
+
return defaultUrlTransform(url);
|
|
25959
|
+
}
|
|
25487
25960
|
function MarkdownLink({
|
|
25488
25961
|
href,
|
|
25489
25962
|
children,
|
|
25963
|
+
onOpenLocalFile,
|
|
25490
25964
|
...props
|
|
25491
25965
|
}) {
|
|
25492
|
-
const
|
|
25493
|
-
if (!
|
|
25494
|
-
|
|
25966
|
+
const link2 = safeMarkdownLink(href);
|
|
25967
|
+
if (!link2) return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children });
|
|
25968
|
+
if (link2.kind === "local-file") {
|
|
25969
|
+
if (!onOpenLocalFile) return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children });
|
|
25970
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25971
|
+
"a",
|
|
25972
|
+
{
|
|
25973
|
+
...props,
|
|
25974
|
+
href: link2.href,
|
|
25975
|
+
onClick: (event) => {
|
|
25976
|
+
event.preventDefault();
|
|
25977
|
+
onOpenLocalFile(link2.href);
|
|
25978
|
+
},
|
|
25979
|
+
children
|
|
25980
|
+
}
|
|
25981
|
+
);
|
|
25982
|
+
}
|
|
25983
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("a", { ...props, href: link2.href, rel: "noreferrer noopener", target: "_blank", children });
|
|
25495
25984
|
}
|
|
25496
|
-
function Markdown({
|
|
25985
|
+
function Markdown({
|
|
25986
|
+
children,
|
|
25987
|
+
onOpenLocalFile
|
|
25988
|
+
}) {
|
|
25497
25989
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "markdown", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
25498
25990
|
Markdown$1,
|
|
25499
25991
|
{
|
|
25500
25992
|
remarkPlugins: [remarkGfm],
|
|
25501
25993
|
skipHtml: true,
|
|
25994
|
+
urlTransform: markdownUrlTransform,
|
|
25502
25995
|
components: {
|
|
25503
|
-
a: MarkdownLink,
|
|
25996
|
+
a: (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(MarkdownLink, { ...props, onOpenLocalFile }),
|
|
25504
25997
|
input: ({ type, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("input", { ...props, type, disabled: type === "checkbox" || props.disabled })
|
|
25505
25998
|
},
|
|
25506
25999
|
children
|
|
@@ -26169,7 +26662,8 @@ function ToolRun({
|
|
|
26169
26662
|
function AssistantBlocks({
|
|
26170
26663
|
message,
|
|
26171
26664
|
context,
|
|
26172
|
-
hideThinking
|
|
26665
|
+
hideThinking,
|
|
26666
|
+
onOpenLocalFile
|
|
26173
26667
|
}) {
|
|
26174
26668
|
const rendered = [];
|
|
26175
26669
|
let pendingCalls = [];
|
|
@@ -26188,13 +26682,13 @@ function AssistantBlocks({
|
|
|
26188
26682
|
flushCalls();
|
|
26189
26683
|
if (block.type === "text" && block.text) {
|
|
26190
26684
|
rendered.push(
|
|
26191
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "assistant-text", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Markdown, { children: block.text }) }, `text:${index2}`)
|
|
26685
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "assistant-text", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Markdown, { onOpenLocalFile, children: block.text }) }, `text:${index2}`)
|
|
26192
26686
|
);
|
|
26193
26687
|
} else if (!hideThinking && block.type === "thinking" && block.thinking) {
|
|
26194
26688
|
rendered.push(
|
|
26195
26689
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("details", { className: "thinking", children: [
|
|
26196
26690
|
/* @__PURE__ */ jsxRuntimeExports.jsx("summary", { children: "Reasoning" }),
|
|
26197
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Markdown, { children: block.thinking })
|
|
26691
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Markdown, { onOpenLocalFile, children: block.thinking })
|
|
26198
26692
|
] }, `thinking:${index2}`)
|
|
26199
26693
|
);
|
|
26200
26694
|
}
|
|
@@ -26208,7 +26702,8 @@ function AssistantMessage({
|
|
|
26208
26702
|
streaming,
|
|
26209
26703
|
hideThinking,
|
|
26210
26704
|
showMark,
|
|
26211
|
-
continues
|
|
26705
|
+
continues,
|
|
26706
|
+
onOpenLocalFile
|
|
26212
26707
|
}) {
|
|
26213
26708
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
26214
26709
|
"article",
|
|
@@ -26217,7 +26712,15 @@ function AssistantMessage({
|
|
|
26217
26712
|
children: [
|
|
26218
26713
|
showMark ? /* @__PURE__ */ jsxRuntimeExports.jsx("img", { className: "assistant-mark", src: assetUrl(mascotUrl), alt: "Shortcut" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "assistant-mark-spacer" }),
|
|
26219
26714
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "message-body", children: [
|
|
26220
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
26715
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
26716
|
+
AssistantBlocks,
|
|
26717
|
+
{
|
|
26718
|
+
context,
|
|
26719
|
+
hideThinking,
|
|
26720
|
+
message,
|
|
26721
|
+
onOpenLocalFile
|
|
26722
|
+
}
|
|
26723
|
+
),
|
|
26221
26724
|
streaming && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "stream-caret", "aria-label": "Streaming" })
|
|
26222
26725
|
] })
|
|
26223
26726
|
]
|
|
@@ -26277,7 +26780,8 @@ function Conversation({
|
|
|
26277
26780
|
messages,
|
|
26278
26781
|
streamingMessage,
|
|
26279
26782
|
activities,
|
|
26280
|
-
hideThinking
|
|
26783
|
+
hideThinking,
|
|
26784
|
+
onOpenLocalFile
|
|
26281
26785
|
}) {
|
|
26282
26786
|
const results = indexToolResults(messages);
|
|
26283
26787
|
const visible = messages.filter(
|
|
@@ -26290,6 +26794,7 @@ function Conversation({
|
|
|
26290
26794
|
).map(toolCallFromActivity);
|
|
26291
26795
|
const streamingBlocks = streamingMessage ? messageBlocks(streamingMessage) : [];
|
|
26292
26796
|
const showStreamingMessage = streamingMessage?.role === "assistant" && (streamingBlocks.length === 0 || hasVisibleAssistantContent(streamingMessage, results, hideThinking));
|
|
26797
|
+
const hasProse = (message) => messageText(message).trim().length > 0;
|
|
26293
26798
|
let latestAssistantIndex = -1;
|
|
26294
26799
|
if (!showStreamingMessage) {
|
|
26295
26800
|
for (let index2 = visible.length - 1; index2 >= 0; index2 -= 1) {
|
|
@@ -26310,7 +26815,8 @@ function Conversation({
|
|
|
26310
26815
|
message,
|
|
26311
26816
|
context,
|
|
26312
26817
|
hideThinking,
|
|
26313
|
-
showMark: index2 === latestAssistantIndex,
|
|
26818
|
+
showMark: index2 === latestAssistantIndex && hasProse(message),
|
|
26819
|
+
onOpenLocalFile,
|
|
26314
26820
|
continues: visible[index2 + 1]?.role === "assistant" || index2 === visible.length - 1 && showStreamingMessage
|
|
26315
26821
|
},
|
|
26316
26822
|
key
|
|
@@ -26324,13 +26830,15 @@ function Conversation({
|
|
|
26324
26830
|
message: streamingMessage,
|
|
26325
26831
|
context,
|
|
26326
26832
|
hideThinking,
|
|
26327
|
-
showMark:
|
|
26833
|
+
showMark: hasProse(streamingMessage),
|
|
26834
|
+
onOpenLocalFile,
|
|
26328
26835
|
streaming: true
|
|
26329
26836
|
}
|
|
26330
26837
|
),
|
|
26331
26838
|
orphanCalls.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(ToolRun, { calls: orphanCalls, context })
|
|
26332
26839
|
] });
|
|
26333
26840
|
}
|
|
26841
|
+
const wordmarkUrl = "" + new URL("shortcutagent-DxFsGSkw.png", import.meta.url).href;
|
|
26334
26842
|
const COMMANDS = [
|
|
26335
26843
|
["/resume", "Browse sessions"],
|
|
26336
26844
|
["/model", "Choose model"],
|
|
@@ -26350,6 +26858,22 @@ function EmptyConversation({
|
|
|
26350
26858
|
const runtimeAccess = snapshot.permissions.runtimeBypass ? "Full access" : "Approval required";
|
|
26351
26859
|
const spreadsheetAccess = snapshot.permissions.spreadsheetAutoApprove ? "Spreadsheet edits auto-approved" : "Spreadsheet edits ask first";
|
|
26352
26860
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "empty-state runtime-dashboard", children: [
|
|
26861
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("header", { className: "empty-hero", children: [
|
|
26862
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "empty-hero-brand", children: [
|
|
26863
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("img", { alt: "", "aria-hidden": "true", className: "hero-mascot", src: assetUrl(mascotUrl) }),
|
|
26864
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("img", { alt: "SHORTCUT", className: "hero-wordmark", src: assetUrl(wordmarkUrl) }),
|
|
26865
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": "true", className: "hero-spark", children: "✕" })
|
|
26866
|
+
] }),
|
|
26867
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "empty-hero-tagline", children: "A Fundamental Research Labs Product" }),
|
|
26868
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "empty-hero-version", children: [
|
|
26869
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
26870
|
+
"v",
|
|
26871
|
+
"0.3.78"
|
|
26872
|
+
] }),
|
|
26873
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "·" }),
|
|
26874
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "https://www.shortcut.ai/changelog", rel: "noopener noreferrer", target: "_blank", children: "See what's new" })
|
|
26875
|
+
] })
|
|
26876
|
+
] }),
|
|
26353
26877
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("section", { "aria-labelledby": "runtime-environment-heading", children: [
|
|
26354
26878
|
/* @__PURE__ */ jsxRuntimeExports.jsx("header", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { id: "runtime-environment-heading", children: "Environment" }) }),
|
|
26355
26879
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "environment-list", children: [
|
|
@@ -26370,7 +26894,7 @@ function EmptyConversation({
|
|
|
26370
26894
|
onClick: () => void onSubmit("/settings"),
|
|
26371
26895
|
children: [
|
|
26372
26896
|
/* @__PURE__ */ jsxRuntimeExports.jsx("code", { children: "Workspace" }),
|
|
26373
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: snapshot.session.cwd })
|
|
26897
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "path-tail", children: snapshot.session.cwd })
|
|
26374
26898
|
]
|
|
26375
26899
|
}
|
|
26376
26900
|
),
|
|
@@ -26540,7 +27064,6 @@ function InteractionPanel({
|
|
|
26540
27064
|
}
|
|
26541
27065
|
const MODES = /* @__PURE__ */ new Set(["action", "plan", "ask", "manage"]);
|
|
26542
27066
|
const UNAVAILABLE_NATIVE_COMMANDS = /* @__PURE__ */ new Set([
|
|
26543
|
-
"collab",
|
|
26544
27067
|
"compact",
|
|
26545
27068
|
"copy",
|
|
26546
27069
|
"download-skills",
|
|
@@ -26574,11 +27097,13 @@ function parseNativeCommand(input) {
|
|
|
26574
27097
|
case "resume":
|
|
26575
27098
|
return { kind: "native", command: { type: "open_sessions" } };
|
|
26576
27099
|
case "session":
|
|
26577
|
-
case "settings":
|
|
26578
|
-
case "login":
|
|
26579
|
-
case "logout":
|
|
26580
27100
|
case "agents":
|
|
26581
27101
|
return { kind: "native", command: { type: "open_session" } };
|
|
27102
|
+
case "login":
|
|
27103
|
+
return { kind: "native", command: { type: "start_login" } };
|
|
27104
|
+
case "settings":
|
|
27105
|
+
case "logout":
|
|
27106
|
+
return { kind: "native", command: { type: "open_general" } };
|
|
26582
27107
|
case "skills":
|
|
26583
27108
|
return { kind: "native", command: { type: "open_skills" } };
|
|
26584
27109
|
case "permissions":
|
|
@@ -26868,6 +27393,7 @@ function SessionPanel({
|
|
|
26868
27393
|
snapshot,
|
|
26869
27394
|
tab: tab2,
|
|
26870
27395
|
busy,
|
|
27396
|
+
focusAccountsRequest = 0,
|
|
26871
27397
|
onTabChange,
|
|
26872
27398
|
onClose,
|
|
26873
27399
|
onRename,
|
|
@@ -26882,6 +27408,12 @@ function SessionPanel({
|
|
|
26882
27408
|
onReloadResources,
|
|
26883
27409
|
onSetWorkspaceRoots
|
|
26884
27410
|
}) {
|
|
27411
|
+
const accountsRef = reactExports.useRef(null);
|
|
27412
|
+
reactExports.useEffect(() => {
|
|
27413
|
+
if (focusAccountsRequest > 0) {
|
|
27414
|
+
accountsRef.current?.scrollIntoView({ block: "start" });
|
|
27415
|
+
}
|
|
27416
|
+
}, [focusAccountsRequest]);
|
|
26885
27417
|
const [name2, setName] = reactExports.useState(snapshot.session.name ?? "");
|
|
26886
27418
|
const [workspaceRoot, setWorkspaceRoot] = reactExports.useState("");
|
|
26887
27419
|
const [skillFilter, setSkillFilter] = reactExports.useState("all");
|
|
@@ -26962,11 +27494,21 @@ function SessionPanel({
|
|
|
26962
27494
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("header", { children: [
|
|
26963
27495
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
26964
27496
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { children: "Settings" }),
|
|
26965
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Configure this local Shortcut session." })
|
|
27497
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: tab2 === "general" ? "Account and app-wide preferences." : "Configure this local Shortcut session." })
|
|
26966
27498
|
] }),
|
|
26967
27499
|
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { "aria-label": "Close settings", type: "button", onClick: onClose, children: "Close" })
|
|
26968
27500
|
] }),
|
|
26969
27501
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("nav", { "aria-label": "Settings sections", className: "settings-tabs", children: [
|
|
27502
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
27503
|
+
"button",
|
|
27504
|
+
{
|
|
27505
|
+
"aria-selected": tab2 === "general",
|
|
27506
|
+
role: "tab",
|
|
27507
|
+
type: "button",
|
|
27508
|
+
onClick: () => onTabChange("general"),
|
|
27509
|
+
children: "General"
|
|
27510
|
+
}
|
|
27511
|
+
),
|
|
26970
27512
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
26971
27513
|
"button",
|
|
26972
27514
|
{
|
|
@@ -27052,6 +27594,80 @@ function SessionPanel({
|
|
|
27052
27594
|
] }, `${skill.source}:${skill.name}`);
|
|
27053
27595
|
}) })
|
|
27054
27596
|
] })
|
|
27597
|
+
] }) : tab2 === "general" ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
27598
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "settings-list", children: [
|
|
27599
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
27600
|
+
Toggle,
|
|
27601
|
+
{
|
|
27602
|
+
checked: snapshot.settings.telemetry,
|
|
27603
|
+
description: "Upload conversation diagnostics to improve Shortcut.",
|
|
27604
|
+
disabled: busy,
|
|
27605
|
+
label: "Conversation diagnostics",
|
|
27606
|
+
testId: "telemetry-toggle",
|
|
27607
|
+
onChange: (enabled) => onSetSetting("telemetry", enabled)
|
|
27608
|
+
}
|
|
27609
|
+
),
|
|
27610
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
27611
|
+
Toggle,
|
|
27612
|
+
{
|
|
27613
|
+
checked: snapshot.settings.durableMemory,
|
|
27614
|
+
description: "Allow the background memory agent to retain useful context.",
|
|
27615
|
+
disabled: busy,
|
|
27616
|
+
label: "Durable memory",
|
|
27617
|
+
testId: "durable-memory-toggle",
|
|
27618
|
+
onChange: (enabled) => onSetSetting("durableMemory", enabled)
|
|
27619
|
+
}
|
|
27620
|
+
),
|
|
27621
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
27622
|
+
Toggle,
|
|
27623
|
+
{
|
|
27624
|
+
checked: snapshot.settings.devMode,
|
|
27625
|
+
description: "Load development resources and diagnostics next session.",
|
|
27626
|
+
disabled: busy,
|
|
27627
|
+
label: "Developer mode",
|
|
27628
|
+
testId: "dev-mode-toggle",
|
|
27629
|
+
onChange: (enabled) => onSetSetting("devMode", enabled)
|
|
27630
|
+
}
|
|
27631
|
+
)
|
|
27632
|
+
] }),
|
|
27633
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
27634
|
+
"section",
|
|
27635
|
+
{
|
|
27636
|
+
className: "auth-settings",
|
|
27637
|
+
"aria-labelledby": "auth-settings-heading",
|
|
27638
|
+
ref: accountsRef,
|
|
27639
|
+
children: [
|
|
27640
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { id: "auth-settings-heading", children: "Accounts" }),
|
|
27641
|
+
snapshot.auth.activeLogin && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "active-login", "data-testid": "active-login", children: [
|
|
27642
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: snapshot.auth.activeLogin.providerName }),
|
|
27643
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: snapshot.auth.activeLogin.progress ?? snapshot.auth.activeLogin.instructions ?? "Complete login in your browser." }),
|
|
27644
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
27645
|
+
snapshot.auth.activeLogin.url && /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: snapshot.auth.activeLogin.url, target: "_blank", rel: "noreferrer", children: "Open browser" }),
|
|
27646
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { disabled: busy, type: "button", onClick: () => void onCancelLogin(), children: "Cancel" })
|
|
27647
|
+
] })
|
|
27648
|
+
] }),
|
|
27649
|
+
snapshot.auth.providers.length === 0 && !snapshot.auth.activeLogin && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "auth-provider", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
27650
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Shortcut" }),
|
|
27651
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: "Authentication is unavailable in this runtime." })
|
|
27652
|
+
] }) }),
|
|
27653
|
+
snapshot.auth.providers.map((provider) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "auth-provider", children: [
|
|
27654
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
27655
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: provider.name }),
|
|
27656
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: provider.loggedIn ? "Logged in" : "Not logged in" })
|
|
27657
|
+
] }),
|
|
27658
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
27659
|
+
"button",
|
|
27660
|
+
{
|
|
27661
|
+
disabled: busy || Boolean(snapshot.auth.activeLogin),
|
|
27662
|
+
type: "button",
|
|
27663
|
+
onClick: () => void (provider.loggedIn ? onLogout(provider.id) : onLogin(provider.id)),
|
|
27664
|
+
children: provider.loggedIn ? "Log out" : "Log in"
|
|
27665
|
+
}
|
|
27666
|
+
)
|
|
27667
|
+
] }, provider.id))
|
|
27668
|
+
]
|
|
27669
|
+
}
|
|
27670
|
+
)
|
|
27055
27671
|
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
27056
27672
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("form", { className: "rename-form", onSubmit: rename, children: [
|
|
27057
27673
|
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { htmlFor: "session-name", children: "Name" }),
|
|
@@ -27093,52 +27709,17 @@ function SessionPanel({
|
|
|
27093
27709
|
] })
|
|
27094
27710
|
] })
|
|
27095
27711
|
] }),
|
|
27096
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
27097
|
-
|
|
27098
|
-
|
|
27099
|
-
|
|
27100
|
-
|
|
27101
|
-
|
|
27102
|
-
|
|
27103
|
-
|
|
27104
|
-
|
|
27105
|
-
|
|
27106
|
-
|
|
27107
|
-
),
|
|
27108
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
27109
|
-
Toggle,
|
|
27110
|
-
{
|
|
27111
|
-
checked: snapshot.settings.telemetry,
|
|
27112
|
-
description: "Upload conversation diagnostics to improve Shortcut.",
|
|
27113
|
-
disabled: busy,
|
|
27114
|
-
label: "Conversation diagnostics",
|
|
27115
|
-
testId: "telemetry-toggle",
|
|
27116
|
-
onChange: (enabled) => onSetSetting("telemetry", enabled)
|
|
27117
|
-
}
|
|
27118
|
-
),
|
|
27119
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
27120
|
-
Toggle,
|
|
27121
|
-
{
|
|
27122
|
-
checked: snapshot.settings.durableMemory,
|
|
27123
|
-
description: "Allow the background memory agent to retain useful context.",
|
|
27124
|
-
disabled: busy,
|
|
27125
|
-
label: "Durable memory",
|
|
27126
|
-
testId: "durable-memory-toggle",
|
|
27127
|
-
onChange: (enabled) => onSetSetting("durableMemory", enabled)
|
|
27128
|
-
}
|
|
27129
|
-
),
|
|
27130
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
27131
|
-
Toggle,
|
|
27132
|
-
{
|
|
27133
|
-
checked: snapshot.settings.devMode,
|
|
27134
|
-
description: "Load development resources and diagnostics next session.",
|
|
27135
|
-
disabled: busy,
|
|
27136
|
-
label: "Developer mode",
|
|
27137
|
-
testId: "dev-mode-toggle",
|
|
27138
|
-
onChange: (enabled) => onSetSetting("devMode", enabled)
|
|
27139
|
-
}
|
|
27140
|
-
)
|
|
27141
|
-
] }),
|
|
27712
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "settings-list", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
27713
|
+
Toggle,
|
|
27714
|
+
{
|
|
27715
|
+
checked: snapshot.settings.hideThinking,
|
|
27716
|
+
description: "Hide model reasoning blocks from the transcript.",
|
|
27717
|
+
disabled: busy,
|
|
27718
|
+
label: "Hide reasoning",
|
|
27719
|
+
testId: "hide-thinking-toggle",
|
|
27720
|
+
onChange: (enabled) => onSetSetting("hideThinking", enabled)
|
|
27721
|
+
}
|
|
27722
|
+
) }),
|
|
27142
27723
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
27143
27724
|
"section",
|
|
27144
27725
|
{
|
|
@@ -27194,49 +27775,12 @@ function SessionPanel({
|
|
|
27194
27775
|
]
|
|
27195
27776
|
}
|
|
27196
27777
|
),
|
|
27197
|
-
snapshot.auth.providers.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "auth-settings", "aria-labelledby": "auth-settings-heading", children: [
|
|
27198
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { id: "auth-settings-heading", children: "Accounts" }),
|
|
27199
|
-
snapshot.auth.activeLogin && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "active-login", "data-testid": "active-login", children: [
|
|
27200
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: snapshot.auth.activeLogin.providerName }),
|
|
27201
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: snapshot.auth.activeLogin.progress ?? snapshot.auth.activeLogin.instructions ?? "Complete login in your browser." }),
|
|
27202
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
27203
|
-
snapshot.auth.activeLogin.url && /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: snapshot.auth.activeLogin.url, target: "_blank", rel: "noreferrer", children: "Open browser" }),
|
|
27204
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { disabled: busy, type: "button", onClick: () => void onCancelLogin(), children: "Cancel" })
|
|
27205
|
-
] })
|
|
27206
|
-
] }),
|
|
27207
|
-
snapshot.auth.providers.map((provider) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "auth-provider", children: [
|
|
27208
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
27209
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: provider.name }),
|
|
27210
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("small", { children: provider.loggedIn ? "Logged in" : "Not logged in" })
|
|
27211
|
-
] }),
|
|
27212
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
27213
|
-
"button",
|
|
27214
|
-
{
|
|
27215
|
-
disabled: busy || Boolean(snapshot.auth.activeLogin),
|
|
27216
|
-
type: "button",
|
|
27217
|
-
onClick: () => void (provider.loggedIn ? onLogout(provider.id) : onLogin(provider.id)),
|
|
27218
|
-
children: provider.loggedIn ? "Log out" : "Log in"
|
|
27219
|
-
}
|
|
27220
|
-
)
|
|
27221
|
-
] }, provider.id))
|
|
27222
|
-
] }),
|
|
27223
27778
|
snapshot.pendingMessageCount > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "queue-summary", "data-testid": "queue-summary", children: [
|
|
27224
27779
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
27225
27780
|
snapshot.pendingMessageCount,
|
|
27226
27781
|
" queued message(s)"
|
|
27227
27782
|
] }),
|
|
27228
27783
|
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { disabled: busy, type: "button", onClick: () => void onClearQueue(), children: "Clear queue" })
|
|
27229
|
-
] }),
|
|
27230
|
-
snapshot.collaboration.roomId && /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "collab-settings", "aria-labelledby": "collab-settings-heading", children: [
|
|
27231
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { id: "collab-settings-heading", children: "Collaboration" }),
|
|
27232
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
|
|
27233
|
-
"Room ",
|
|
27234
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: snapshot.collaboration.roomId }),
|
|
27235
|
-
" ·",
|
|
27236
|
-
" ",
|
|
27237
|
-
snapshot.collaboration.connected ? "connected" : "disconnected"
|
|
27238
|
-
] }),
|
|
27239
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: snapshot.collaboration.peers.map((peer) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: peer.displayName }, peer.id)) })
|
|
27240
27784
|
] })
|
|
27241
27785
|
] }) }),
|
|
27242
27786
|
tab2 === "session" && /* @__PURE__ */ jsxRuntimeExports.jsx("footer", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { disabled: busy, type: "button", onClick: () => void onExport(), children: "Export HTML" }) })
|
|
@@ -27286,7 +27830,9 @@ function SessionsSidebar({
|
|
|
27286
27830
|
onDeleteAll,
|
|
27287
27831
|
onOpen,
|
|
27288
27832
|
onOpenCommandCenter,
|
|
27289
|
-
onThemeChange
|
|
27833
|
+
onThemeChange,
|
|
27834
|
+
account,
|
|
27835
|
+
onOpenGeneralSettings
|
|
27290
27836
|
}) {
|
|
27291
27837
|
const [sessions, setSessions] = reactExports.useState([]);
|
|
27292
27838
|
const [status, setStatus] = reactExports.useState("loading");
|
|
@@ -27460,7 +28006,28 @@ function SessionsSidebar({
|
|
|
27460
28006
|
]
|
|
27461
28007
|
}
|
|
27462
28008
|
),
|
|
27463
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ThemeSwitch, { themeId, onChange: onThemeChange })
|
|
28009
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ThemeSwitch, { themeId, onChange: onThemeChange }),
|
|
28010
|
+
onOpenGeneralSettings && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
28011
|
+
"button",
|
|
28012
|
+
{
|
|
28013
|
+
className: "sidebar-account",
|
|
28014
|
+
"data-testid": "sidebar-settings-button",
|
|
28015
|
+
type: "button",
|
|
28016
|
+
onClick: onOpenGeneralSettings,
|
|
28017
|
+
children: "Settings"
|
|
28018
|
+
}
|
|
28019
|
+
),
|
|
28020
|
+
account && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
28021
|
+
"button",
|
|
28022
|
+
{
|
|
28023
|
+
className: `sidebar-account ${account.loggedIn ? "" : "logged-out"}`,
|
|
28024
|
+
"data-testid": "sidebar-account-button",
|
|
28025
|
+
disabled: account.disabled,
|
|
28026
|
+
type: "button",
|
|
28027
|
+
onClick: account.onClick,
|
|
28028
|
+
children: account.label
|
|
28029
|
+
}
|
|
28030
|
+
)
|
|
27464
28031
|
] });
|
|
27465
28032
|
}
|
|
27466
28033
|
function ConnectingSidebar({
|
|
@@ -28236,6 +28803,10 @@ function useAgentHost() {
|
|
|
28236
28803
|
);
|
|
28237
28804
|
const pickAttachments = reactExports.useCallback(() => window.shortcut.agent.pickAttachments(), []);
|
|
28238
28805
|
const openFolder = reactExports.useCallback((path2) => window.shortcut.agent.openFolder(path2), []);
|
|
28806
|
+
const openLocalFile = reactExports.useCallback(
|
|
28807
|
+
(href) => request({ type: "open_local_file", href }),
|
|
28808
|
+
[request]
|
|
28809
|
+
);
|
|
28239
28810
|
const login = reactExports.useCallback(
|
|
28240
28811
|
async (providerId) => {
|
|
28241
28812
|
await request({ type: "login", providerId });
|
|
@@ -28291,12 +28862,6 @@ function useAgentHost() {
|
|
|
28291
28862
|
},
|
|
28292
28863
|
[request]
|
|
28293
28864
|
);
|
|
28294
|
-
const sendCollabMessage = reactExports.useCallback(
|
|
28295
|
-
async (message) => {
|
|
28296
|
-
await request({ type: "send_collab_message", message });
|
|
28297
|
-
},
|
|
28298
|
-
[request]
|
|
28299
|
-
);
|
|
28300
28865
|
return {
|
|
28301
28866
|
connection,
|
|
28302
28867
|
hosts: Object.entries(state.hosts).map(([hostId, view]) => ({ hostId, view })),
|
|
@@ -28321,6 +28886,7 @@ function useAgentHost() {
|
|
|
28321
28886
|
getCommands,
|
|
28322
28887
|
pickAttachments,
|
|
28323
28888
|
openFolder,
|
|
28889
|
+
openLocalFile,
|
|
28324
28890
|
login,
|
|
28325
28891
|
cancelLogin,
|
|
28326
28892
|
logout,
|
|
@@ -28332,7 +28898,6 @@ function useAgentHost() {
|
|
|
28332
28898
|
manageGoal,
|
|
28333
28899
|
abortAgentTask,
|
|
28334
28900
|
messageAgentTask,
|
|
28335
|
-
sendCollabMessage,
|
|
28336
28901
|
refreshSnapshot
|
|
28337
28902
|
};
|
|
28338
28903
|
}
|
|
@@ -28389,13 +28954,15 @@ function App({ initialThemeId: initialThemeId2 }) {
|
|
|
28389
28954
|
const [activeSurface, setActiveSurface] = reactExports.useState("chat");
|
|
28390
28955
|
const [interactionWaiting, setInteractionWaiting] = reactExports.useState(false);
|
|
28391
28956
|
const [localError, setLocalError] = reactExports.useState();
|
|
28392
|
-
const [
|
|
28957
|
+
const [dismissedNoticeKey, setDismissedNoticeKey] = reactExports.useState();
|
|
28393
28958
|
const [settingsTab, setSettingsTab] = reactExports.useState();
|
|
28959
|
+
const [accountsFocusRequest, setAccountsFocusRequest] = reactExports.useState(0);
|
|
28394
28960
|
const [goalToggleRequest, setGoalToggleRequest] = reactExports.useState(0);
|
|
28395
28961
|
const [permissionOpenRequest, setPermissionOpenRequest] = reactExports.useState(0);
|
|
28396
28962
|
const [sessionActionBusy, setSessionActionBusy] = reactExports.useState(false);
|
|
28397
28963
|
const [localStatus, setLocalStatus] = reactExports.useState();
|
|
28398
28964
|
const [commands, setCommands] = reactExports.useState([]);
|
|
28965
|
+
const autoScroll = useAutoScroll();
|
|
28399
28966
|
const run = async (operation) => {
|
|
28400
28967
|
setLocalError(void 0);
|
|
28401
28968
|
setLocalStatus(void 0);
|
|
@@ -28409,8 +28976,16 @@ function App({ initialThemeId: initialThemeId2 }) {
|
|
|
28409
28976
|
};
|
|
28410
28977
|
const ready = agent.connection.status === "ready" ? agent.connection : void 0;
|
|
28411
28978
|
const view = ready?.view;
|
|
28979
|
+
const activeChatKey = activeSurface === "chat" && ready && view ? `${ready.hostId}:${view.snapshot.session.id}` : void 0;
|
|
28980
|
+
useScrollPositionByThread({
|
|
28981
|
+
threadId: activeChatKey ?? null,
|
|
28982
|
+
scrollElement: autoScroll.scrollElement,
|
|
28983
|
+
isEngaged: autoScroll.isEngaged,
|
|
28984
|
+
disengage: autoScroll.disengage,
|
|
28985
|
+
engage: autoScroll.engage
|
|
28986
|
+
});
|
|
28412
28987
|
const newestNotice = view?.notices.at(-1);
|
|
28413
|
-
const latestNotice = newestNotice?.id ===
|
|
28988
|
+
const latestNotice = newestNotice && `${ready?.hostId ?? ""}:${newestNotice.id}` === dismissedNoticeKey ? void 0 : newestNotice;
|
|
28414
28989
|
const activeInteraction = view?.pendingInteractions[0];
|
|
28415
28990
|
const canStartNewChat = Boolean(ready);
|
|
28416
28991
|
const liveSessions = agent.hosts.map(({ hostId, view: hostView }) => ({
|
|
@@ -28495,6 +29070,12 @@ function App({ initialThemeId: initialThemeId2 }) {
|
|
|
28495
29070
|
case "new_session":
|
|
28496
29071
|
await agent.newSession();
|
|
28497
29072
|
return;
|
|
29073
|
+
case "start_login":
|
|
29074
|
+
openLogin();
|
|
29075
|
+
return;
|
|
29076
|
+
case "open_general":
|
|
29077
|
+
setSettingsTab("general");
|
|
29078
|
+
return;
|
|
28498
29079
|
case "open_session":
|
|
28499
29080
|
setSettingsTab("session");
|
|
28500
29081
|
return;
|
|
@@ -28567,14 +29148,15 @@ function App({ initialThemeId: initialThemeId2 }) {
|
|
|
28567
29148
|
}
|
|
28568
29149
|
};
|
|
28569
29150
|
const submitMessage = async (message, streamingBehavior, attachments) => {
|
|
29151
|
+
const prompt = (operation) => {
|
|
29152
|
+
if (activeChatKey !== void 0) autoScroll.engage();
|
|
29153
|
+
return run(operation);
|
|
29154
|
+
};
|
|
28570
29155
|
if (attachments.length === 0) {
|
|
28571
|
-
if (message.trim().startsWith(":")) {
|
|
28572
|
-
return run(() => agent.sendCollabMessage(message.trim().slice(1)));
|
|
28573
|
-
}
|
|
28574
29156
|
const commandName = message.trim().startsWith("/") ? message.trim().slice(1).split(/\s/, 1)[0].toLowerCase() : void 0;
|
|
28575
29157
|
const commandMetadata = commandName ? commands.find((command) => command.name.toLowerCase() === commandName) : void 0;
|
|
28576
29158
|
if (commandMetadata && commandMetadata.source !== "builtin") {
|
|
28577
|
-
return
|
|
29159
|
+
return prompt(() => agent.prompt(message, { streamingBehavior }));
|
|
28578
29160
|
}
|
|
28579
29161
|
const parsed = parseNativeCommand(message);
|
|
28580
29162
|
if (parsed.kind === "invalid") {
|
|
@@ -28583,13 +29165,13 @@ function App({ initialThemeId: initialThemeId2 }) {
|
|
|
28583
29165
|
}
|
|
28584
29166
|
if (parsed.kind === "native") return run(() => executeNativeCommand(parsed.command));
|
|
28585
29167
|
if (parsed.kind === "prompt_command") {
|
|
28586
|
-
return
|
|
29168
|
+
return prompt(() => agent.prompt(message, { streamingBehavior }));
|
|
28587
29169
|
}
|
|
28588
29170
|
if (parsed.kind === "runtime_command") {
|
|
28589
29171
|
return run(() => agent.executeCommand(message));
|
|
28590
29172
|
}
|
|
28591
29173
|
}
|
|
28592
|
-
return
|
|
29174
|
+
return prompt(
|
|
28593
29175
|
() => agent.prompt(message, {
|
|
28594
29176
|
streamingBehavior,
|
|
28595
29177
|
images: attachments.flatMap((attachment) => attachment.image ? [attachment.image] : []),
|
|
@@ -28597,10 +29179,63 @@ function App({ initialThemeId: initialThemeId2 }) {
|
|
|
28597
29179
|
})
|
|
28598
29180
|
);
|
|
28599
29181
|
};
|
|
29182
|
+
const shortcutAuth = view?.snapshot.auth.providers.find((provider) => provider.id === "shortcut");
|
|
29183
|
+
const noticeText = localError ?? localStatus ?? latestNotice?.message ?? "";
|
|
29184
|
+
const authNotice = /\blog in to shortcut\b/i.test(noticeText) || isHostAuthUnavailableErrorMessage(noticeText);
|
|
29185
|
+
const needsLogin = Boolean(view && (shortcutAuth && !shortcutAuth.loggedIn || authNotice));
|
|
29186
|
+
const openAccounts = () => {
|
|
29187
|
+
setSettingsTab("general");
|
|
29188
|
+
setAccountsFocusRequest((request) => request + 1);
|
|
29189
|
+
};
|
|
29190
|
+
const loginInitiated = reactExports.useRef(false);
|
|
29191
|
+
const activeLoginUrl = view?.snapshot.auth.activeLogin?.url;
|
|
29192
|
+
const lastOpenedLoginUrl = reactExports.useRef(void 0);
|
|
29193
|
+
reactExports.useEffect(() => {
|
|
29194
|
+
if (!loginInitiated.current) return;
|
|
29195
|
+
if (activeLoginUrl && activeLoginUrl !== lastOpenedLoginUrl.current) {
|
|
29196
|
+
lastOpenedLoginUrl.current = activeLoginUrl;
|
|
29197
|
+
window.open(activeLoginUrl, "_blank", "noopener");
|
|
29198
|
+
}
|
|
29199
|
+
if (!view?.snapshot.auth.activeLogin) {
|
|
29200
|
+
loginInitiated.current = false;
|
|
29201
|
+
lastOpenedLoginUrl.current = void 0;
|
|
29202
|
+
}
|
|
29203
|
+
}, [activeLoginUrl, view?.snapshot.auth.activeLogin]);
|
|
29204
|
+
reactExports.useEffect(() => {
|
|
29205
|
+
if (!latestNotice || latestNotice.level === "error" || authNotice) return;
|
|
29206
|
+
const key = `${ready?.hostId ?? ""}:${latestNotice.id}`;
|
|
29207
|
+
const timer = window.setTimeout(() => setDismissedNoticeKey(key), 5e3);
|
|
29208
|
+
return () => window.clearTimeout(timer);
|
|
29209
|
+
}, [latestNotice, authNotice, ready?.hostId]);
|
|
29210
|
+
const openLogin = () => {
|
|
29211
|
+
if (view?.snapshot.auth.activeLogin) {
|
|
29212
|
+
openAccounts();
|
|
29213
|
+
return;
|
|
29214
|
+
}
|
|
29215
|
+
loginInitiated.current = true;
|
|
29216
|
+
void runSessionAction(() => agent.login("shortcut"));
|
|
29217
|
+
};
|
|
29218
|
+
const openLocalFile = async (href) => {
|
|
29219
|
+
setLocalError(void 0);
|
|
29220
|
+
setLocalStatus(void 0);
|
|
29221
|
+
try {
|
|
29222
|
+
const result = await agent.openLocalFile(href);
|
|
29223
|
+
setLocalStatus(`Opened ${result.path}`);
|
|
29224
|
+
} catch (error) {
|
|
29225
|
+
setLocalError(error instanceof Error ? error.message : String(error));
|
|
29226
|
+
}
|
|
29227
|
+
};
|
|
28600
29228
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("main", { className: "app-shell", children: [
|
|
28601
29229
|
ready && view ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
28602
29230
|
SessionsSidebar,
|
|
28603
29231
|
{
|
|
29232
|
+
account: view ? needsLogin ? {
|
|
29233
|
+
label: "Log in",
|
|
29234
|
+
loggedIn: false,
|
|
29235
|
+
disabled: sessionActionBusy,
|
|
29236
|
+
onClick: openLogin
|
|
29237
|
+
} : { label: "Log out", loggedIn: true, disabled: false, onClick: openAccounts } : void 0,
|
|
29238
|
+
onOpenGeneralSettings: view ? () => setSettingsTab("general") : void 0,
|
|
28604
29239
|
activeSessionId: view.snapshot.session.id,
|
|
28605
29240
|
activeSessionName: view.snapshot.session.name,
|
|
28606
29241
|
commandCenterActive: activeSurface === "command-center",
|
|
@@ -28658,6 +29293,16 @@ function App({ initialThemeId: initialThemeId2 }) {
|
|
|
28658
29293
|
] }) }),
|
|
28659
29294
|
(localError || localStatus || latestNotice) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `notice ${localError && "error" || latestNotice?.level || ""}`, children: [
|
|
28660
29295
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: localError ?? localStatus ?? latestNotice?.message }),
|
|
29296
|
+
authNotice && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
29297
|
+
"button",
|
|
29298
|
+
{
|
|
29299
|
+
className: "notice-login",
|
|
29300
|
+
disabled: sessionActionBusy,
|
|
29301
|
+
type: "button",
|
|
29302
|
+
onClick: openLogin,
|
|
29303
|
+
children: "Log in"
|
|
29304
|
+
}
|
|
29305
|
+
),
|
|
28661
29306
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
28662
29307
|
"button",
|
|
28663
29308
|
{
|
|
@@ -28665,38 +29310,60 @@ function App({ initialThemeId: initialThemeId2 }) {
|
|
|
28665
29310
|
onClick: () => {
|
|
28666
29311
|
setLocalError(void 0);
|
|
28667
29312
|
setLocalStatus(void 0);
|
|
28668
|
-
if (latestNotice)
|
|
29313
|
+
if (latestNotice)
|
|
29314
|
+
setDismissedNoticeKey(`${ready?.hostId ?? ""}:${latestNotice.id}`);
|
|
28669
29315
|
},
|
|
28670
29316
|
children: "Dismiss"
|
|
28671
29317
|
}
|
|
28672
29318
|
)
|
|
28673
29319
|
] }),
|
|
28674
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
28675
|
-
|
|
28676
|
-
|
|
28677
|
-
|
|
28678
|
-
|
|
28679
|
-
|
|
28680
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
28681
|
-
|
|
28682
|
-
|
|
28683
|
-
|
|
28684
|
-
|
|
28685
|
-
|
|
28686
|
-
|
|
28687
|
-
|
|
28688
|
-
|
|
28689
|
-
|
|
28690
|
-
|
|
28691
|
-
|
|
28692
|
-
|
|
28693
|
-
|
|
28694
|
-
|
|
28695
|
-
|
|
28696
|
-
|
|
28697
|
-
|
|
28698
|
-
|
|
28699
|
-
|
|
29320
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "conversation-frame", children: [
|
|
29321
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
29322
|
+
"div",
|
|
29323
|
+
{
|
|
29324
|
+
ref: autoScroll.scrollRef,
|
|
29325
|
+
className: `conversation ${activeSurface === "command-center" ? "command-center-conversation" : ""}`,
|
|
29326
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
29327
|
+
"div",
|
|
29328
|
+
{
|
|
29329
|
+
ref: activeSurface === "chat" ? autoScroll.contentRef : void 0,
|
|
29330
|
+
className: "conversation-content",
|
|
29331
|
+
children: activeSurface === "command-center" ? /* @__PURE__ */ jsxRuntimeExports.jsx(CommandCenter, {}) : agent.connection.status === "failed" ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "empty-state error", children: [
|
|
29332
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { children: "Runtime failed to start" }),
|
|
29333
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: agent.connection.message }),
|
|
29334
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "primary", type: "button", onClick: agent.restart, children: "Retry connection" })
|
|
29335
|
+
] }) : view && (view.messages.length > 0 || view.streamingMessage) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
29336
|
+
Conversation,
|
|
29337
|
+
{
|
|
29338
|
+
messages: view.messages,
|
|
29339
|
+
streamingMessage: view.streamingMessage,
|
|
29340
|
+
activities: view.toolActivities,
|
|
29341
|
+
hideThinking: view.snapshot.settings.hideThinking,
|
|
29342
|
+
onOpenLocalFile: (href) => void openLocalFile(href)
|
|
29343
|
+
}
|
|
29344
|
+
) : view ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
29345
|
+
EmptyConversation,
|
|
29346
|
+
{
|
|
29347
|
+
disabled: false,
|
|
29348
|
+
snapshot: view.snapshot,
|
|
29349
|
+
onSubmit: (message) => submitMessage(message, void 0, [])
|
|
29350
|
+
}
|
|
29351
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "empty-state runtime-starting", children: "Starting local runtime…" })
|
|
29352
|
+
}
|
|
29353
|
+
)
|
|
29354
|
+
}
|
|
29355
|
+
),
|
|
29356
|
+
activeSurface === "chat" && !autoScroll.isAtBottom && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
29357
|
+
"button",
|
|
29358
|
+
{
|
|
29359
|
+
"aria-label": "Scroll to bottom",
|
|
29360
|
+
className: "scroll-to-bottom",
|
|
29361
|
+
type: "button",
|
|
29362
|
+
onClick: autoScroll.scrollToBottom,
|
|
29363
|
+
children: "↓"
|
|
29364
|
+
}
|
|
29365
|
+
)
|
|
29366
|
+
] }),
|
|
28700
29367
|
activeSurface === "chat" && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "footer-stack", children: [
|
|
28701
29368
|
view && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
28702
29369
|
SubagentsPanel,
|
|
@@ -28730,6 +29397,7 @@ function App({ initialThemeId: initialThemeId2 }) {
|
|
|
28730
29397
|
Composer,
|
|
28731
29398
|
{
|
|
28732
29399
|
commands,
|
|
29400
|
+
cwd: view?.snapshot.session.cwd,
|
|
28733
29401
|
disabled: !ready,
|
|
28734
29402
|
goalToggleRequest,
|
|
28735
29403
|
snapshot: view?.snapshot,
|
|
@@ -28737,6 +29405,7 @@ function App({ initialThemeId: initialThemeId2 }) {
|
|
|
28737
29405
|
streaming: view?.snapshot.isStreaming ?? false,
|
|
28738
29406
|
statusText: view?.statusText,
|
|
28739
29407
|
onAbort: () => run(agent.abort),
|
|
29408
|
+
onGetFileMentionSuggestions: window.shortcut.agent.getFileMentionSuggestions,
|
|
28740
29409
|
onManageGoal: (action, objective) => run(() => agent.manageGoal(action, objective)),
|
|
28741
29410
|
onModeChange: (mode) => runSessionAction(() => agent.setMode(mode)),
|
|
28742
29411
|
onPickAttachments: agent.pickAttachments,
|
|
@@ -28753,6 +29422,7 @@ function App({ initialThemeId: initialThemeId2 }) {
|
|
|
28753
29422
|
SessionPanel,
|
|
28754
29423
|
{
|
|
28755
29424
|
busy: sessionActionBusy,
|
|
29425
|
+
focusAccountsRequest: accountsFocusRequest,
|
|
28756
29426
|
snapshot: view.snapshot,
|
|
28757
29427
|
tab: settingsTab,
|
|
28758
29428
|
onClearQueue: () => runSessionAction(agent.clearQueue),
|