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
|
File without changes
|
|
@@ -6,16 +6,21 @@ This module provides a Session object to manage and persist settings across
|
|
|
6
6
|
requests (cookies, auth, proxies).
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
9
11
|
import os
|
|
10
12
|
import sys
|
|
11
13
|
import time
|
|
12
14
|
from collections import OrderedDict
|
|
15
|
+
from collections.abc import Generator, Mapping, MutableMapping
|
|
13
16
|
from datetime import timedelta
|
|
17
|
+
from typing import TYPE_CHECKING, Any, cast
|
|
14
18
|
|
|
15
19
|
from ._internal_utils import to_native_string
|
|
20
|
+
from ._types import is_prepared as _is_prepared
|
|
16
21
|
from .adapters import HTTPAdapter
|
|
17
|
-
from .auth import _basic_auth_str
|
|
18
|
-
from .compat import
|
|
22
|
+
from .auth import _basic_auth_str # type: ignore[reportPrivateUsage]
|
|
23
|
+
from .compat import cookielib, urljoin, urlparse
|
|
19
24
|
from .cookies import (
|
|
20
25
|
RequestsCookieJar,
|
|
21
26
|
cookiejar_from_dict,
|
|
@@ -33,9 +38,10 @@ from .hooks import default_hooks, dispatch_hook
|
|
|
33
38
|
# formerly defined here, reexposed here for backward compatibility
|
|
34
39
|
from .models import ( # noqa: F401
|
|
35
40
|
DEFAULT_REDIRECT_LIMIT,
|
|
36
|
-
REDIRECT_STATI,
|
|
41
|
+
REDIRECT_STATI, # type: ignore[reportUnusedImport]
|
|
37
42
|
PreparedRequest,
|
|
38
43
|
Request,
|
|
44
|
+
Response,
|
|
39
45
|
)
|
|
40
46
|
from .status_codes import codes
|
|
41
47
|
from .structures import CaseInsensitiveDict
|
|
@@ -48,10 +54,18 @@ from .utils import ( # noqa: F401
|
|
|
48
54
|
requote_uri,
|
|
49
55
|
resolve_proxies,
|
|
50
56
|
rewind_body,
|
|
51
|
-
should_bypass_proxies,
|
|
57
|
+
should_bypass_proxies, # type: ignore[reportUnusedImport] # re-export for external consumers
|
|
52
58
|
to_key_val_list,
|
|
53
59
|
)
|
|
54
60
|
|
|
61
|
+
if TYPE_CHECKING:
|
|
62
|
+
from http.cookiejar import CookieJar
|
|
63
|
+
|
|
64
|
+
from typing_extensions import Self, Unpack
|
|
65
|
+
|
|
66
|
+
from . import _types as _t
|
|
67
|
+
from .adapters import BaseAdapter
|
|
68
|
+
|
|
55
69
|
# Preferred clock, based on which one is more accurate on a given system.
|
|
56
70
|
if sys.platform == "win32":
|
|
57
71
|
preferred_clock = time.perf_counter
|
|
@@ -59,7 +73,9 @@ else:
|
|
|
59
73
|
preferred_clock = time.time
|
|
60
74
|
|
|
61
75
|
|
|
62
|
-
def merge_setting(
|
|
76
|
+
def merge_setting(
|
|
77
|
+
request_setting: Any, session_setting: Any, dict_class: type = OrderedDict
|
|
78
|
+
) -> Any:
|
|
63
79
|
"""Determines appropriate setting for a given request, taking into account
|
|
64
80
|
the explicit setting on that request, and the setting in the session. If a
|
|
65
81
|
setting is a dictionary, they will be merged together using `dict_class`
|
|
@@ -77,8 +93,8 @@ def merge_setting(request_setting, session_setting, dict_class=OrderedDict):
|
|
|
77
93
|
):
|
|
78
94
|
return request_setting
|
|
79
95
|
|
|
80
|
-
merged_setting = dict_class(to_key_val_list(session_setting))
|
|
81
|
-
merged_setting.update(to_key_val_list(request_setting))
|
|
96
|
+
merged_setting = dict_class(to_key_val_list(session_setting)) # type: ignore[arg-type] # isinstance narrows Any to Mapping[Unknown]
|
|
97
|
+
merged_setting.update(to_key_val_list(request_setting)) # type: ignore[arg-type]
|
|
82
98
|
|
|
83
99
|
# Remove keys that are set to None. Extract keys first to avoid altering
|
|
84
100
|
# the dictionary during iteration.
|
|
@@ -89,7 +105,11 @@ def merge_setting(request_setting, session_setting, dict_class=OrderedDict):
|
|
|
89
105
|
return merged_setting
|
|
90
106
|
|
|
91
107
|
|
|
92
|
-
def merge_hooks(
|
|
108
|
+
def merge_hooks(
|
|
109
|
+
request_hooks: _t.HooksType,
|
|
110
|
+
session_hooks: _t.HooksType,
|
|
111
|
+
dict_class: type = OrderedDict,
|
|
112
|
+
) -> _t.HooksType:
|
|
93
113
|
"""Properly merges both requests and session hooks.
|
|
94
114
|
|
|
95
115
|
This is necessary because when request_hooks == {'response': []}, the
|
|
@@ -105,7 +125,13 @@ def merge_hooks(request_hooks, session_hooks, dict_class=OrderedDict):
|
|
|
105
125
|
|
|
106
126
|
|
|
107
127
|
class SessionRedirectMixin:
|
|
108
|
-
|
|
128
|
+
max_redirects: int
|
|
129
|
+
trust_env: bool
|
|
130
|
+
cookies: RequestsCookieJar
|
|
131
|
+
|
|
132
|
+
def send(self, request: PreparedRequest, **kwargs: Any) -> Response: ...
|
|
133
|
+
|
|
134
|
+
def get_redirect_target(self, resp: Response) -> str | None:
|
|
109
135
|
"""Receives a Response. Returns a redirect URI or ``None``"""
|
|
110
136
|
# Due to the nature of how requests processes redirects this method will
|
|
111
137
|
# be called at least once upon the original response and at least twice
|
|
@@ -125,7 +151,7 @@ class SessionRedirectMixin:
|
|
|
125
151
|
return to_native_string(location, "utf8")
|
|
126
152
|
return None
|
|
127
153
|
|
|
128
|
-
def should_strip_auth(self, old_url, new_url):
|
|
154
|
+
def should_strip_auth(self, old_url: str, new_url: str) -> bool:
|
|
129
155
|
"""Decide whether Authorization header should be removed when redirecting"""
|
|
130
156
|
old_parsed = urlparse(old_url)
|
|
131
157
|
new_parsed = urlparse(new_url)
|
|
@@ -159,19 +185,19 @@ class SessionRedirectMixin:
|
|
|
159
185
|
|
|
160
186
|
def resolve_redirects(
|
|
161
187
|
self,
|
|
162
|
-
resp,
|
|
163
|
-
req,
|
|
164
|
-
stream=False,
|
|
165
|
-
timeout=None,
|
|
166
|
-
verify=True,
|
|
167
|
-
cert=None,
|
|
168
|
-
proxies=None,
|
|
169
|
-
yield_requests=False,
|
|
170
|
-
**adapter_kwargs,
|
|
171
|
-
):
|
|
188
|
+
resp: Response,
|
|
189
|
+
req: PreparedRequest,
|
|
190
|
+
stream: bool = False,
|
|
191
|
+
timeout: _t.TimeoutType = None,
|
|
192
|
+
verify: _t.VerifyType = True,
|
|
193
|
+
cert: _t.CertType = None,
|
|
194
|
+
proxies: dict[str, str] | None = None,
|
|
195
|
+
yield_requests: bool = False,
|
|
196
|
+
**adapter_kwargs: Any,
|
|
197
|
+
) -> Generator[Response, None, None]:
|
|
172
198
|
"""Receives a Response. Returns a generator of Responses or Requests."""
|
|
173
199
|
|
|
174
|
-
hist = [] # keep track of history
|
|
200
|
+
hist: list[Response] = [] # keep track of history
|
|
175
201
|
|
|
176
202
|
url = self.get_redirect_target(resp)
|
|
177
203
|
previous_fragment = urlparse(req.url).fragment
|
|
@@ -179,9 +205,8 @@ class SessionRedirectMixin:
|
|
|
179
205
|
prepared_request = req.copy()
|
|
180
206
|
|
|
181
207
|
# Update history and keep track of redirects.
|
|
182
|
-
|
|
208
|
+
resp.history = hist[:]
|
|
183
209
|
hist.append(resp)
|
|
184
|
-
resp.history = hist[1:]
|
|
185
210
|
|
|
186
211
|
try:
|
|
187
212
|
resp.content # Consume socket so it can be released
|
|
@@ -238,9 +263,10 @@ class SessionRedirectMixin:
|
|
|
238
263
|
# Extract any cookies sent on the response to the cookiejar
|
|
239
264
|
# in the new request. Because we've mutated our copied prepared
|
|
240
265
|
# request, use the old one that we haven't yet touched.
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
266
|
+
cookie_jar = cast("CookieJar", prepared_request._cookies) # type: ignore[reportPrivateUsage]
|
|
267
|
+
extract_cookies_to_jar(cookie_jar, req, resp.raw)
|
|
268
|
+
merge_cookies(cookie_jar, self.cookies)
|
|
269
|
+
prepared_request.prepare_cookies(cookie_jar)
|
|
244
270
|
|
|
245
271
|
# Rebuild auth and proxy information.
|
|
246
272
|
proxies = self.rebuild_proxies(prepared_request, proxies)
|
|
@@ -249,7 +275,7 @@ class SessionRedirectMixin:
|
|
|
249
275
|
# A failed tell() sets `_body_position` to `object()`. This non-None
|
|
250
276
|
# value ensures `rewindable` will be True, allowing us to raise an
|
|
251
277
|
# UnrewindableBodyError, instead of hanging the connection.
|
|
252
|
-
rewindable = prepared_request._body_position is not None and (
|
|
278
|
+
rewindable = prepared_request._body_position is not None and ( # type: ignore[reportPrivateUsage]
|
|
253
279
|
"Content-Length" in headers or "Transfer-Encoding" in headers
|
|
254
280
|
)
|
|
255
281
|
|
|
@@ -261,7 +287,7 @@ class SessionRedirectMixin:
|
|
|
261
287
|
req = prepared_request
|
|
262
288
|
|
|
263
289
|
if yield_requests:
|
|
264
|
-
yield req
|
|
290
|
+
yield req # type: ignore[misc] # Internal use only, returns PreparedRequest
|
|
265
291
|
else:
|
|
266
292
|
resp = self.send(
|
|
267
293
|
req,
|
|
@@ -280,17 +306,22 @@ class SessionRedirectMixin:
|
|
|
280
306
|
url = self.get_redirect_target(resp)
|
|
281
307
|
yield resp
|
|
282
308
|
|
|
283
|
-
def rebuild_auth(
|
|
309
|
+
def rebuild_auth(
|
|
310
|
+
self, prepared_request: PreparedRequest, response: Response
|
|
311
|
+
) -> None:
|
|
284
312
|
"""When being redirected we may want to strip authentication from the
|
|
285
313
|
request to avoid leaking credentials. This method intelligently removes
|
|
286
314
|
and reapplies authentication where possible to avoid credential loss.
|
|
287
315
|
"""
|
|
316
|
+
original_request = response.request
|
|
317
|
+
assert _is_prepared(original_request)
|
|
318
|
+
assert _is_prepared(prepared_request)
|
|
319
|
+
|
|
288
320
|
headers = prepared_request.headers
|
|
321
|
+
original_url = original_request.url
|
|
289
322
|
url = prepared_request.url
|
|
290
323
|
|
|
291
|
-
if "Authorization" in headers and self.should_strip_auth(
|
|
292
|
-
response.request.url, url
|
|
293
|
-
):
|
|
324
|
+
if "Authorization" in headers and self.should_strip_auth(original_url, url):
|
|
294
325
|
# If we get redirected to a new host, we should strip out any
|
|
295
326
|
# authentication headers.
|
|
296
327
|
del headers["Authorization"]
|
|
@@ -300,7 +331,11 @@ class SessionRedirectMixin:
|
|
|
300
331
|
if new_auth is not None:
|
|
301
332
|
prepared_request.prepare_auth(new_auth)
|
|
302
333
|
|
|
303
|
-
def rebuild_proxies(
|
|
334
|
+
def rebuild_proxies(
|
|
335
|
+
self,
|
|
336
|
+
prepared_request: PreparedRequest,
|
|
337
|
+
proxies: dict[str, str] | None,
|
|
338
|
+
) -> dict[str, str]:
|
|
304
339
|
"""This method re-evaluates the proxy configuration by considering the
|
|
305
340
|
environment variables. If we are redirected to a URL covered by
|
|
306
341
|
NO_PROXY, we strip the proxy configuration. Otherwise, we set missing
|
|
@@ -312,6 +347,7 @@ class SessionRedirectMixin:
|
|
|
312
347
|
|
|
313
348
|
:rtype: dict
|
|
314
349
|
"""
|
|
350
|
+
assert _is_prepared(prepared_request)
|
|
315
351
|
headers = prepared_request.headers
|
|
316
352
|
scheme = urlparse(prepared_request.url).scheme
|
|
317
353
|
new_proxies = resolve_proxies(prepared_request, proxies, self.trust_env)
|
|
@@ -331,7 +367,9 @@ class SessionRedirectMixin:
|
|
|
331
367
|
|
|
332
368
|
return new_proxies
|
|
333
369
|
|
|
334
|
-
def rebuild_method(
|
|
370
|
+
def rebuild_method(
|
|
371
|
+
self, prepared_request: PreparedRequest, response: Response
|
|
372
|
+
) -> None:
|
|
335
373
|
"""When being redirected we may want to change the method of the request
|
|
336
374
|
based on certain specs or browser behavior.
|
|
337
375
|
"""
|
|
@@ -373,7 +411,20 @@ class Session(SessionRedirectMixin):
|
|
|
373
411
|
<Response [200]>
|
|
374
412
|
"""
|
|
375
413
|
|
|
376
|
-
|
|
414
|
+
headers: CaseInsensitiveDict[str]
|
|
415
|
+
auth: _t.AuthType
|
|
416
|
+
proxies: dict[str, str]
|
|
417
|
+
hooks: dict[str, list[_t.HookType]]
|
|
418
|
+
params: MutableMapping[str, Any]
|
|
419
|
+
stream: bool
|
|
420
|
+
verify: _t.VerifyType
|
|
421
|
+
cert: _t.CertType
|
|
422
|
+
max_redirects: int
|
|
423
|
+
trust_env: bool
|
|
424
|
+
cookies: RequestsCookieJar
|
|
425
|
+
adapters: MutableMapping[str, BaseAdapter]
|
|
426
|
+
|
|
427
|
+
__attrs__: list[str] = [
|
|
377
428
|
"headers",
|
|
378
429
|
"cookies",
|
|
379
430
|
"auth",
|
|
@@ -388,7 +439,7 @@ class Session(SessionRedirectMixin):
|
|
|
388
439
|
"max_redirects",
|
|
389
440
|
]
|
|
390
441
|
|
|
391
|
-
def __init__(self):
|
|
442
|
+
def __init__(self) -> None:
|
|
392
443
|
#: A case-insensitive dictionary of headers to be sent on each
|
|
393
444
|
#: :class:`Request <Request>` sent from this
|
|
394
445
|
#: :class:`Session <Session>`.
|
|
@@ -451,13 +502,13 @@ class Session(SessionRedirectMixin):
|
|
|
451
502
|
self.mount("https://", HTTPAdapter())
|
|
452
503
|
self.mount("http://", HTTPAdapter())
|
|
453
504
|
|
|
454
|
-
def __enter__(self):
|
|
505
|
+
def __enter__(self) -> Self:
|
|
455
506
|
return self
|
|
456
507
|
|
|
457
|
-
def __exit__(self, *args):
|
|
508
|
+
def __exit__(self, *args: Any) -> None:
|
|
458
509
|
self.close()
|
|
459
510
|
|
|
460
|
-
def prepare_request(self, request):
|
|
511
|
+
def prepare_request(self, request: Request) -> PreparedRequest:
|
|
461
512
|
"""Constructs a :class:`PreparedRequest <PreparedRequest>` for
|
|
462
513
|
transmission and returns it. The :class:`PreparedRequest` has settings
|
|
463
514
|
merged from the :class:`Request <Request>` instance and those of the
|
|
@@ -467,6 +518,9 @@ class Session(SessionRedirectMixin):
|
|
|
467
518
|
session's settings.
|
|
468
519
|
:rtype: requests.PreparedRequest
|
|
469
520
|
"""
|
|
521
|
+
url = cast("_t.UriType", request.url)
|
|
522
|
+
method = cast(str, request.method)
|
|
523
|
+
|
|
470
524
|
cookies = request.cookies or {}
|
|
471
525
|
|
|
472
526
|
# Bootstrap CookieJar.
|
|
@@ -481,12 +535,12 @@ class Session(SessionRedirectMixin):
|
|
|
481
535
|
# Set environment's basic authentication if not explicitly set.
|
|
482
536
|
auth = request.auth
|
|
483
537
|
if self.trust_env and not auth and not self.auth:
|
|
484
|
-
auth = get_netrc_auth(
|
|
538
|
+
auth = get_netrc_auth(url)
|
|
485
539
|
|
|
486
540
|
p = PreparedRequest()
|
|
487
541
|
p.prepare(
|
|
488
|
-
method=
|
|
489
|
-
url=
|
|
542
|
+
method=method.upper(),
|
|
543
|
+
url=url,
|
|
490
544
|
files=request.files,
|
|
491
545
|
data=request.data,
|
|
492
546
|
json=request.json,
|
|
@@ -502,23 +556,23 @@ class Session(SessionRedirectMixin):
|
|
|
502
556
|
|
|
503
557
|
def request(
|
|
504
558
|
self,
|
|
505
|
-
method,
|
|
506
|
-
url,
|
|
507
|
-
params=None,
|
|
508
|
-
data=None,
|
|
509
|
-
headers=None,
|
|
510
|
-
cookies=None,
|
|
511
|
-
files=None,
|
|
512
|
-
auth=None,
|
|
513
|
-
timeout=None,
|
|
514
|
-
allow_redirects=True,
|
|
515
|
-
proxies=None,
|
|
516
|
-
hooks=None,
|
|
517
|
-
stream=None,
|
|
518
|
-
verify=None,
|
|
519
|
-
cert=None,
|
|
520
|
-
json=None,
|
|
521
|
-
):
|
|
559
|
+
method: str,
|
|
560
|
+
url: _t.UriType,
|
|
561
|
+
params: _t.ParamsType = None,
|
|
562
|
+
data: _t.DataType = None,
|
|
563
|
+
headers: _t.HeadersType = None,
|
|
564
|
+
cookies: RequestsCookieJar | CookieJar | dict[str, str] | None = None,
|
|
565
|
+
files: _t.FilesType = None,
|
|
566
|
+
auth: _t.AuthType = None,
|
|
567
|
+
timeout: _t.TimeoutType = None,
|
|
568
|
+
allow_redirects: bool = True,
|
|
569
|
+
proxies: dict[str, str] | None = None,
|
|
570
|
+
hooks: _t.HooksInputType | None = None,
|
|
571
|
+
stream: bool | None = None,
|
|
572
|
+
verify: _t.VerifyType | None = None,
|
|
573
|
+
cert: _t.CertType = None,
|
|
574
|
+
json: _t.JsonType = None,
|
|
575
|
+
) -> Response:
|
|
522
576
|
"""Constructs a :class:`Request <Request>`, prepares it and sends it.
|
|
523
577
|
Returns :class:`Response <Response>` object.
|
|
524
578
|
|
|
@@ -562,6 +616,9 @@ class Session(SessionRedirectMixin):
|
|
|
562
616
|
If Tuple, ('cert', 'key') pair.
|
|
563
617
|
:rtype: requests.Response
|
|
564
618
|
"""
|
|
619
|
+
if isinstance(url, bytes):
|
|
620
|
+
url = url.decode("utf-8")
|
|
621
|
+
|
|
565
622
|
# Create the Request.
|
|
566
623
|
req = Request(
|
|
567
624
|
method=method.upper(),
|
|
@@ -577,6 +634,8 @@ class Session(SessionRedirectMixin):
|
|
|
577
634
|
)
|
|
578
635
|
prep = self.prepare_request(req)
|
|
579
636
|
|
|
637
|
+
assert _is_prepared(prep)
|
|
638
|
+
|
|
580
639
|
proxies = proxies or {}
|
|
581
640
|
|
|
582
641
|
settings = self.merge_environment_settings(
|
|
@@ -593,18 +652,25 @@ class Session(SessionRedirectMixin):
|
|
|
593
652
|
|
|
594
653
|
return resp
|
|
595
654
|
|
|
596
|
-
def get(
|
|
655
|
+
def get(
|
|
656
|
+
self,
|
|
657
|
+
url: _t.UriType,
|
|
658
|
+
params: _t.ParamsType = None,
|
|
659
|
+
**kwargs: Unpack[_t.GetKwargs],
|
|
660
|
+
) -> Response:
|
|
597
661
|
r"""Sends a GET request. Returns :class:`Response` object.
|
|
598
662
|
|
|
599
663
|
:param url: URL for the new :class:`Request` object.
|
|
664
|
+
:param params: (optional) Dictionary, list of tuples or bytes to send
|
|
665
|
+
in the query string for the :class:`Request`.
|
|
600
666
|
:param \*\*kwargs: Optional arguments that ``request`` takes.
|
|
601
667
|
:rtype: requests.Response
|
|
602
668
|
"""
|
|
603
669
|
|
|
604
670
|
kwargs.setdefault("allow_redirects", True)
|
|
605
|
-
return self.request("GET", url, **kwargs)
|
|
671
|
+
return self.request("GET", url, params=params, **kwargs)
|
|
606
672
|
|
|
607
|
-
def options(self, url, **kwargs):
|
|
673
|
+
def options(self, url: _t.UriType, **kwargs: Unpack[_t.RequestKwargs]) -> Response:
|
|
608
674
|
r"""Sends a OPTIONS request. Returns :class:`Response` object.
|
|
609
675
|
|
|
610
676
|
:param url: URL for the new :class:`Request` object.
|
|
@@ -615,7 +681,7 @@ class Session(SessionRedirectMixin):
|
|
|
615
681
|
kwargs.setdefault("allow_redirects", True)
|
|
616
682
|
return self.request("OPTIONS", url, **kwargs)
|
|
617
683
|
|
|
618
|
-
def head(self, url, **kwargs):
|
|
684
|
+
def head(self, url: _t.UriType, **kwargs: Unpack[_t.RequestKwargs]) -> Response:
|
|
619
685
|
r"""Sends a HEAD request. Returns :class:`Response` object.
|
|
620
686
|
|
|
621
687
|
:param url: URL for the new :class:`Request` object.
|
|
@@ -626,7 +692,13 @@ class Session(SessionRedirectMixin):
|
|
|
626
692
|
kwargs.setdefault("allow_redirects", False)
|
|
627
693
|
return self.request("HEAD", url, **kwargs)
|
|
628
694
|
|
|
629
|
-
def post(
|
|
695
|
+
def post(
|
|
696
|
+
self,
|
|
697
|
+
url: _t.UriType,
|
|
698
|
+
data: _t.DataType = None,
|
|
699
|
+
json: _t.JsonType = None,
|
|
700
|
+
**kwargs: Unpack[_t.PostKwargs],
|
|
701
|
+
) -> Response:
|
|
630
702
|
r"""Sends a POST request. Returns :class:`Response` object.
|
|
631
703
|
|
|
632
704
|
:param url: URL for the new :class:`Request` object.
|
|
@@ -639,7 +711,9 @@ class Session(SessionRedirectMixin):
|
|
|
639
711
|
|
|
640
712
|
return self.request("POST", url, data=data, json=json, **kwargs)
|
|
641
713
|
|
|
642
|
-
def put(
|
|
714
|
+
def put(
|
|
715
|
+
self, url: _t.UriType, data: _t.DataType = None, **kwargs: Unpack[_t.DataKwargs]
|
|
716
|
+
) -> Response:
|
|
643
717
|
r"""Sends a PUT request. Returns :class:`Response` object.
|
|
644
718
|
|
|
645
719
|
:param url: URL for the new :class:`Request` object.
|
|
@@ -651,7 +725,9 @@ class Session(SessionRedirectMixin):
|
|
|
651
725
|
|
|
652
726
|
return self.request("PUT", url, data=data, **kwargs)
|
|
653
727
|
|
|
654
|
-
def patch(
|
|
728
|
+
def patch(
|
|
729
|
+
self, url: _t.UriType, data: _t.DataType = None, **kwargs: Unpack[_t.DataKwargs]
|
|
730
|
+
) -> Response:
|
|
655
731
|
r"""Sends a PATCH request. Returns :class:`Response` object.
|
|
656
732
|
|
|
657
733
|
:param url: URL for the new :class:`Request` object.
|
|
@@ -663,7 +739,7 @@ class Session(SessionRedirectMixin):
|
|
|
663
739
|
|
|
664
740
|
return self.request("PATCH", url, data=data, **kwargs)
|
|
665
741
|
|
|
666
|
-
def delete(self, url, **kwargs):
|
|
742
|
+
def delete(self, url: _t.UriType, **kwargs: Unpack[_t.RequestKwargs]) -> Response:
|
|
667
743
|
r"""Sends a DELETE request. Returns :class:`Response` object.
|
|
668
744
|
|
|
669
745
|
:param url: URL for the new :class:`Request` object.
|
|
@@ -673,7 +749,7 @@ class Session(SessionRedirectMixin):
|
|
|
673
749
|
|
|
674
750
|
return self.request("DELETE", url, **kwargs)
|
|
675
751
|
|
|
676
|
-
def send(self, request, **kwargs):
|
|
752
|
+
def send(self, request: PreparedRequest, **kwargs: Any) -> Response:
|
|
677
753
|
"""Send a given PreparedRequest.
|
|
678
754
|
|
|
679
755
|
:rtype: requests.Response
|
|
@@ -691,6 +767,8 @@ class Session(SessionRedirectMixin):
|
|
|
691
767
|
if isinstance(request, Request):
|
|
692
768
|
raise ValueError("You can only send PreparedRequests.")
|
|
693
769
|
|
|
770
|
+
assert _is_prepared(request)
|
|
771
|
+
|
|
694
772
|
# Set up variables needed for resolve_redirects and dispatching of hooks
|
|
695
773
|
allow_redirects = kwargs.pop("allow_redirects", True)
|
|
696
774
|
stream = kwargs.get("stream")
|
|
@@ -739,7 +817,7 @@ class Session(SessionRedirectMixin):
|
|
|
739
817
|
# If redirects aren't being followed, store the response on the Request for Response.next().
|
|
740
818
|
if not allow_redirects:
|
|
741
819
|
try:
|
|
742
|
-
r._next = next(
|
|
820
|
+
r._next = next( # type: ignore[assignment] # yield_requests=True returns PreparedRequest
|
|
743
821
|
self.resolve_redirects(r, request, yield_requests=True, **kwargs)
|
|
744
822
|
)
|
|
745
823
|
except StopIteration:
|
|
@@ -750,7 +828,14 @@ class Session(SessionRedirectMixin):
|
|
|
750
828
|
|
|
751
829
|
return r
|
|
752
830
|
|
|
753
|
-
def merge_environment_settings(
|
|
831
|
+
def merge_environment_settings(
|
|
832
|
+
self,
|
|
833
|
+
url: str,
|
|
834
|
+
proxies: dict[str, str] | None,
|
|
835
|
+
stream: bool | None,
|
|
836
|
+
verify: _t.VerifyType | None,
|
|
837
|
+
cert: _t.CertType,
|
|
838
|
+
) -> dict[str, Any]:
|
|
754
839
|
"""
|
|
755
840
|
Check the environment and merge it with some settings.
|
|
756
841
|
|
|
@@ -761,8 +846,9 @@ class Session(SessionRedirectMixin):
|
|
|
761
846
|
# Set environment's proxies.
|
|
762
847
|
no_proxy = proxies.get("no_proxy") if proxies is not None else None
|
|
763
848
|
env_proxies = get_environ_proxies(url, no_proxy=no_proxy)
|
|
764
|
-
|
|
765
|
-
|
|
849
|
+
if proxies is not None:
|
|
850
|
+
for k, v in env_proxies.items():
|
|
851
|
+
proxies.setdefault(k, v)
|
|
766
852
|
|
|
767
853
|
# Look for requests environment configuration
|
|
768
854
|
# and be compatible with cURL.
|
|
@@ -781,7 +867,7 @@ class Session(SessionRedirectMixin):
|
|
|
781
867
|
|
|
782
868
|
return {"proxies": proxies, "stream": stream, "verify": verify, "cert": cert}
|
|
783
869
|
|
|
784
|
-
def get_adapter(self, url):
|
|
870
|
+
def get_adapter(self, url: str) -> BaseAdapter:
|
|
785
871
|
"""
|
|
786
872
|
Returns the appropriate connection adapter for the given URL.
|
|
787
873
|
|
|
@@ -794,12 +880,12 @@ class Session(SessionRedirectMixin):
|
|
|
794
880
|
# Nothing matches :-/
|
|
795
881
|
raise InvalidSchema(f"No connection adapters were found for {url!r}")
|
|
796
882
|
|
|
797
|
-
def close(self):
|
|
883
|
+
def close(self) -> None:
|
|
798
884
|
"""Closes all adapters and as such the session"""
|
|
799
885
|
for v in self.adapters.values():
|
|
800
886
|
v.close()
|
|
801
887
|
|
|
802
|
-
def mount(self, prefix, adapter):
|
|
888
|
+
def mount(self, prefix: str, adapter: BaseAdapter) -> None:
|
|
803
889
|
"""Registers a connection adapter to a prefix.
|
|
804
890
|
|
|
805
891
|
Adapters are sorted in descending order by prefix length.
|
|
@@ -810,16 +896,16 @@ class Session(SessionRedirectMixin):
|
|
|
810
896
|
for key in keys_to_move:
|
|
811
897
|
self.adapters[key] = self.adapters.pop(key)
|
|
812
898
|
|
|
813
|
-
def __getstate__(self):
|
|
899
|
+
def __getstate__(self) -> dict[str, Any]:
|
|
814
900
|
state = {attr: getattr(self, attr, None) for attr in self.__attrs__}
|
|
815
901
|
return state
|
|
816
902
|
|
|
817
|
-
def __setstate__(self, state):
|
|
903
|
+
def __setstate__(self, state: dict[str, Any]) -> None:
|
|
818
904
|
for attr, value in state.items():
|
|
819
905
|
setattr(self, attr, value)
|
|
820
906
|
|
|
821
907
|
|
|
822
|
-
def session():
|
|
908
|
+
def session() -> Session:
|
|
823
909
|
"""
|
|
824
910
|
Returns a :class:`Session` for context-management.
|
|
825
911
|
|
|
@@ -103,7 +103,7 @@ _codes = {
|
|
|
103
103
|
511: ("network_authentication_required", "network_auth", "network_authentication"),
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
codes = LookupDict(name="status_codes")
|
|
106
|
+
codes: LookupDict[int] = LookupDict(name="status_codes")
|
|
107
107
|
|
|
108
108
|
|
|
109
109
|
def _init():
|
|
@@ -113,7 +113,7 @@ def _init():
|
|
|
113
113
|
if not title.startswith(("\\", "/")):
|
|
114
114
|
setattr(codes, title.upper(), code)
|
|
115
115
|
|
|
116
|
-
def doc(code):
|
|
116
|
+
def doc(code: int) -> str:
|
|
117
117
|
names = ", ".join(f"``{n}``" for n in _codes[code])
|
|
118
118
|
return "* %d: %s" % (code, names)
|
|
119
119
|
|