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.
Files changed (480) hide show
  1. package/BINARY-INVENTORY.json +813 -813
  2. package/CHANGELOG.md +14 -0
  3. package/dist/ai/models.d.ts +10 -6
  4. package/dist/ai/models.generated.d.ts +72 -0
  5. package/dist/ai/models.generated.js +33 -0
  6. package/dist/ai/models.js +36 -13
  7. package/dist/ai/providers/anthropic.d.ts +4 -2
  8. package/dist/ai/providers/anthropic.js +59 -29
  9. package/dist/ai/providers/azure-openai-responses.d.ts +2 -1
  10. package/dist/ai/providers/azure-openai-responses.js +4 -20
  11. package/dist/ai/providers/google-vertex.d.ts +8 -2
  12. package/dist/ai/providers/google-vertex.js +66 -54
  13. package/dist/ai/providers/google.js +15 -48
  14. package/dist/ai/providers/openai-completions.d.ts +4 -1
  15. package/dist/ai/providers/openai-completions.js +26 -10
  16. package/dist/ai/providers/openai-reasoning.d.ts +5 -0
  17. package/dist/ai/providers/openai-reasoning.js +13 -0
  18. package/dist/ai/providers/openai-responses-shared.js +1 -1
  19. package/dist/ai/providers/openai-responses.d.ts +6 -2
  20. package/dist/ai/providers/openai-responses.js +28 -23
  21. package/dist/ai/providers/simple-options.d.ts +2 -3
  22. package/dist/ai/providers/simple-options.js +4 -6
  23. package/dist/ai/types.d.ts +19 -2
  24. package/dist/app/agent-session-runtime-adapter.js +7 -6
  25. package/dist/app/agent-session.d.ts +0 -15
  26. package/dist/app/agent-session.js +0 -37
  27. package/dist/app/approvals/approval-errors.d.ts +15 -0
  28. package/dist/app/approvals/approval-errors.js +14 -0
  29. package/dist/app/approvals/runtime-approval-gates.d.ts +1 -2
  30. package/dist/app/approvals/tool-approval.d.ts +1 -0
  31. package/dist/app/approvals/tool-approval.js +11 -23
  32. package/dist/app/approvals/types.d.ts +0 -14
  33. package/dist/app/approvals/types.js +0 -2
  34. package/dist/app/background/tool-summaries.js +0 -2
  35. package/dist/app/extensions/slash-commands.js +1 -3
  36. package/dist/app/local/tools/execute-code/executor.d.ts +1 -1
  37. package/dist/app/local/tools/execute-code/executor.js +20 -10
  38. package/dist/app/local/tools/execute-code/tool.js +21 -2
  39. package/dist/app/modes/action/agent.js +4 -5
  40. package/dist/app/modes/ask/agent.js +4 -6
  41. package/dist/app/modes/index.js +20 -10
  42. package/dist/app/modes/installation/agent.js +4 -5
  43. package/dist/app/modes/manage/agent.js +3 -4
  44. package/dist/app/modes/manage/prompt.js +1 -2
  45. package/dist/app/modes/metadata.d.ts +31 -0
  46. package/dist/app/modes/metadata.js +35 -0
  47. package/dist/app/modes/plan/agent.js +5 -8
  48. package/dist/app/modes/plan/prompt.js +3 -3
  49. package/dist/app/permissions/runtime-approval-flow.d.ts +1 -5
  50. package/dist/app/permissions/runtime-approval-flow.js +0 -28
  51. package/dist/app/permissions/tool-gates.d.ts +2 -3
  52. package/dist/app/permissions/tool-gates.js +3 -81
  53. package/dist/app/prompts/com-api.js +1 -1
  54. package/dist/app/prompts/shared-guidelines.js +7 -3
  55. package/dist/app/providers/google-vertex-gateway.js +4 -51
  56. package/dist/app/providers/model-registry.d.ts +1 -0
  57. package/dist/app/providers/model-registry.js +39 -0
  58. package/dist/app/providers/model-resolver.js +10 -7
  59. package/dist/app/providers/register-shortcut-provider.js +6 -6
  60. package/dist/app/providers/shortcut-api-v2-transport.js +4 -0
  61. package/dist/app/providers/shortcut-llm-proxy-client.d.ts +2 -2
  62. package/dist/app/providers/shortcut-llm-proxy-client.js +1 -0
  63. package/dist/app/resources/package-manager.js +2 -123
  64. package/dist/app/resources/resource-patterns.d.ts +9 -0
  65. package/dist/app/resources/resource-patterns.js +120 -0
  66. package/dist/app/session/forked-agent.d.ts +2 -2
  67. package/dist/app/session/model-manager.js +3 -2
  68. package/dist/app/session/session-lifecycle.js +3 -2
  69. package/dist/app/session/session-models.d.ts +2 -0
  70. package/dist/app/session/session-models.js +14 -6
  71. package/dist/app/settings-manager.d.ts +3 -3
  72. package/dist/app/shared/tools/execute-code/mog.d.ts +3 -1
  73. package/dist/app/shared/tools/execute-code/mog.js +18 -2
  74. package/dist/app/tools/bash.js +3 -3
  75. package/dist/app/tools/execute-code/index.d.ts +1 -0
  76. package/dist/app/tools/execute-code/index.js +3 -1
  77. package/dist/app/tools/find-ignore-files.d.ts +3 -0
  78. package/dist/app/tools/find-ignore-files.js +33 -0
  79. package/dist/app/tools/find.js +2 -21
  80. package/dist/app/tools/llm-analysis.js +0 -2
  81. package/dist/app/tools/refresh-context.d.ts +1 -1
  82. package/dist/app/tools/session-settings/update-session-settings.js +2 -2
  83. package/dist/app/tools/switch-mode.js +2 -2
  84. package/dist/app/tools/take-screenshot.js +0 -2
  85. package/dist/app/tools/task/runner.js +1 -2
  86. package/dist/app/tools/task/task.d.ts +1 -3
  87. package/dist/app/tools/task/task.js +20 -40
  88. package/dist/app/tools/web-search.js +12 -2
  89. package/dist/autocomplete/core.d.ts +33 -0
  90. package/dist/autocomplete/core.js +113 -0
  91. package/dist/{tui → autocomplete}/fuzzy.d.ts +0 -1
  92. package/dist/{tui → autocomplete}/fuzzy.js +0 -1
  93. package/dist/{tui/autocomplete.d.ts → autocomplete/index.d.ts} +0 -1
  94. package/dist/{tui/autocomplete.js → autocomplete/index.js} +62 -158
  95. package/dist/cli/args.js +1 -1
  96. package/dist/cli/list-models.js +1 -1
  97. package/dist/cli.js +26227 -30480
  98. package/dist/constants.d.ts +0 -2
  99. package/dist/constants.js +0 -3
  100. package/dist/contracts/agent-session-store.d.ts +1 -1
  101. package/dist/contracts/agent-settings.d.ts +1 -0
  102. package/dist/contracts/agent-settings.js +2 -1
  103. package/dist/contracts/model-call.d.ts +1 -2
  104. package/dist/contracts/model-call.js +1 -2
  105. package/dist/contracts/model-stream.d.ts +1 -0
  106. package/dist/contracts/model-stream.js +1 -0
  107. package/dist/contracts/wire.d.ts +10 -7
  108. package/dist/contracts/wire.js +8 -0
  109. package/dist/core/agent-engine.js +1 -1
  110. package/dist/core/core-types.d.ts +1 -21
  111. package/dist/core/defaults.d.ts +1 -1
  112. package/dist/core/defaults.js +9 -1
  113. package/dist/core/prompts/agent-guidelines.d.ts +4 -5
  114. package/dist/core/prompts/agent-guidelines.js +28 -42
  115. package/dist/core/session-schema.d.ts +1 -1
  116. package/dist/embedded-agent/ai-invoke.d.ts +1 -2
  117. package/dist/embedded-agent/ai-invoke.js +2 -70
  118. package/dist/embedded-agent/anthropic-messages-transport.d.ts +4 -20
  119. package/dist/embedded-agent/anthropic-messages-transport.js +23 -786
  120. package/dist/embedded-agent/bootstrap.js +2 -2
  121. package/dist/embedded-agent/compose.js +8 -7
  122. package/dist/embedded-agent/gateway-base-url.d.ts +3 -0
  123. package/dist/embedded-agent/gateway-base-url.js +35 -0
  124. package/dist/embedded-agent/google-vertex-transport.d.ts +2 -11
  125. package/dist/embedded-agent/google-vertex-transport.js +20 -117
  126. package/dist/embedded-agent/host-runtime-options.d.ts +0 -8
  127. package/dist/embedded-agent/host-runtime-options.js +10 -2
  128. package/dist/embedded-agent/host-tools/invoke-llm/contract.d.ts +2 -2
  129. package/dist/embedded-agent/host-tools/invoke-llm/contract.js +4 -2
  130. package/dist/embedded-agent/host-tools/sandbox-llm/contract.d.ts +8 -3
  131. package/dist/embedded-agent/host-tools/sandbox-llm/contract.js +12 -8
  132. package/dist/embedded-agent/host-tools/sandbox-llm/index.d.ts +1 -1
  133. package/dist/embedded-agent/host-tools/sandbox-llm/index.js +1 -1
  134. package/dist/embedded-agent/host-tools/shared/index.d.ts +1 -1
  135. package/dist/embedded-agent/host-tools/shared/index.js +1 -1
  136. package/dist/embedded-agent/host-tools/shared/llm-stream-error.d.ts +7 -0
  137. package/dist/embedded-agent/host-tools/shared/llm-stream-error.js +10 -0
  138. package/dist/embedded-agent/host-tools/take-screenshot/contract.d.ts +0 -2
  139. package/dist/embedded-agent/host-tools/take-screenshot/contract.js +1 -3
  140. package/dist/embedded-agent/host-tools/take-screenshot/index.d.ts +1 -1
  141. package/dist/embedded-agent/host-tools/take-screenshot/index.js +1 -1
  142. package/dist/embedded-agent/host-tools/task/agents/clone.js +1 -2
  143. package/dist/embedded-agent/host-tools/task/contract.js +1 -1
  144. package/dist/embedded-agent/index.d.ts +3 -4
  145. package/dist/embedded-agent/index.js +2 -3
  146. package/dist/embedded-agent/model-selection.d.ts +0 -6
  147. package/dist/embedded-agent/model-selection.js +15 -8
  148. package/dist/embedded-agent/openai-completions-transport.d.ts +2 -11
  149. package/dist/embedded-agent/openai-completions-transport.js +20 -120
  150. package/dist/embedded-agent/openai-responses-transport.d.ts +2 -11
  151. package/dist/embedded-agent/openai-responses-transport.js +15 -170
  152. package/dist/embedded-agent/prompt/build.js +1 -2
  153. package/dist/embedded-agent/prompt/sections.d.ts +1 -1
  154. package/dist/embedded-agent/prompt/sections.js +2 -0
  155. package/dist/embedded-agent/provider-native-request.d.ts +29 -0
  156. package/dist/embedded-agent/provider-native-request.js +65 -0
  157. package/dist/embedded-agent/run-stats.d.ts +1 -1
  158. package/dist/embedded-agent/stream.d.ts +10 -96
  159. package/dist/embedded-agent/stream.js +31 -556
  160. package/dist/embedded-agent/suggestions.d.ts +1 -1
  161. package/dist/embedded-agent/suggestions.js +1 -1
  162. package/dist/embedded-agent/worker-bridge/host-client.d.ts +7 -0
  163. package/dist/embedded-agent/worker-bridge/host-client.js +15 -0
  164. package/dist/embedded-agent/worker-bridge/worker-port.js +17 -1
  165. package/dist/main.js +18 -14
  166. package/dist/rpc/index.d.ts +1 -1
  167. package/dist/rpc/rpc-approval-gates.js +1 -2
  168. package/dist/rpc/rpc-host.d.ts +4 -0
  169. package/dist/rpc/rpc-host.js +13 -24
  170. package/dist/rpc/rpc-types.d.ts +6 -17
  171. package/dist/shared/platform/open.d.ts +4 -1
  172. package/dist/shared/platform/open.js +14 -2
  173. package/dist/shell/approvals/runtime-approval-gates.js +1 -3
  174. package/dist/shell/components/selectors/model-selector.js +2 -1
  175. package/dist/shell/components/selectors/session-selector-search.js +1 -1
  176. package/dist/shell/components/selectors/thinking-selector.js +7 -6
  177. package/dist/shell/index.d.ts +0 -1
  178. package/dist/shell/index.js +0 -1
  179. package/dist/shell/interactive/interactive-mode-options.d.ts +10 -0
  180. package/dist/shell/interactive/interactive-mode.d.ts +6 -12
  181. package/dist/shell/interactive/interactive-mode.js +39 -158
  182. package/dist/shell/interactive/slash-commands.d.ts +0 -34
  183. package/dist/shell/interactive/slash-commands.js +0 -2
  184. package/dist/shell/links/local-file-link-input.d.ts +15 -0
  185. package/dist/shell/links/local-file-link-input.js +38 -0
  186. package/dist/shell/links/local-file-link.d.ts +7 -0
  187. package/dist/shell/links/local-file-link.js +35 -0
  188. package/dist/shell/links/local-file-opener.d.ts +16 -0
  189. package/dist/shell/links/local-file-opener.js +90 -0
  190. package/dist/shell/session-client.d.ts +0 -1
  191. package/dist/shell/session-client.js +0 -6
  192. package/dist/shell/status/update-check-scheduler.d.ts +30 -0
  193. package/dist/shell/status/update-check-scheduler.js +71 -0
  194. package/dist/shell/status/update-reminder-controller.d.ts +22 -0
  195. package/dist/shell/status/update-reminder-controller.js +40 -0
  196. package/dist/shell/status/update-reminder.d.ts +6 -0
  197. package/dist/shell/status/update-reminder.js +4 -0
  198. package/dist/shell/theme/dark.json +1 -2
  199. package/dist/shell/theme/light.json +1 -2
  200. package/dist/shell/theme/runtime.d.ts +2 -3
  201. package/dist/shell/theme/runtime.js +2 -6
  202. package/dist/shell/theme/theme-schema.json +1 -6
  203. package/dist/shortcut-model-catalog.d.ts +7 -2
  204. package/dist/shortcut-model-catalog.js +134 -10
  205. package/dist/startup/update-manager.d.ts +6 -6
  206. package/dist/startup/update-manager.js +23 -38
  207. package/dist/startup/update-prompt.d.ts +1 -0
  208. package/dist/startup/update-prompt.js +2 -2
  209. package/dist/tui/components/editor.d.ts +1 -1
  210. package/dist/tui/components/editor.js +1 -1
  211. package/dist/tui/components/markdown.js +15 -6
  212. package/dist/tui/components/settings-list.js +1 -1
  213. package/dist/tui/editor-component.d.ts +1 -1
  214. package/dist/tui/index.d.ts +7 -8
  215. package/dist/tui/index.js +7 -6
  216. package/dist/tui/tui.d.ts +2 -0
  217. package/dist/tui/tui.js +16 -1
  218. package/dist/tui/utils.d.ts +7 -0
  219. package/dist/tui/utils.js +58 -8
  220. package/native-app/main/index.js +3200 -48
  221. package/native-app/main/{photon_rs-SoVDgheu.js → photon_rs-XkYyYTVA.js} +2 -2
  222. package/native-app/package.json +1 -1
  223. package/native-app/preload/index.cjs +2 -0
  224. package/native-app/renderer/assets/{index-CFc-oZuS.js → index-B4jz6epR.js} +825 -155
  225. package/native-app/renderer/assets/{index-OhGE0UY4.css → index-C__g36ft.css} +412 -162
  226. package/native-app/renderer/assets/shortcutagent-DxFsGSkw.png +0 -0
  227. package/native-app/renderer/index.html +2 -2
  228. package/package.json +17 -3
  229. package/skills/add-custom-model/SKILL.md +52 -0
  230. package/user-docs/dist/index.html +1 -1
  231. package/user-docs/dist/shortcutxl-docs.pdf +0 -0
  232. package/xll/ShortcutXL.xll +0 -0
  233. package/xll/modules/shortcut_xl/_managed.py +26 -7
  234. package/xll/modules/shortcut_xl/_tracking.py +141 -251
  235. package/xll/modules/shortcut_xl/api/__init__.py +60 -0
  236. package/xll/modules/shortcut_xl/api/workbook.py +9 -1
  237. package/xll/modules/shortcut_xl/api/worksheet.py +4 -1
  238. package/xll/python/Lib/site-packages/httpx-0.28.1.dist-info/RECORD +1 -1
  239. package/xll/python/Lib/site-packages/idna-3.18.dist-info/RECORD +1 -1
  240. package/xll/python/Lib/site-packages/pip/__init__.py +1 -1
  241. package/xll/python/Lib/site-packages/pip/_internal/build_env/__init__.py +25 -0
  242. package/xll/python/Lib/site-packages/pip/_internal/build_env/base.py +103 -0
  243. package/xll/python/Lib/site-packages/pip/_internal/build_env/installer.py +333 -0
  244. package/xll/python/Lib/site-packages/pip/_internal/build_env/noop.py +42 -0
  245. package/xll/python/Lib/site-packages/pip/_internal/build_env/venv.py +145 -0
  246. package/xll/python/Lib/site-packages/pip/_internal/build_env/virtual.py +139 -0
  247. package/xll/python/Lib/site-packages/pip/_internal/cache.py +4 -1
  248. package/xll/python/Lib/site-packages/pip/_internal/cli/autocompletion.py +4 -1
  249. package/xll/python/Lib/site-packages/pip/_internal/cli/base_command.py +11 -14
  250. package/xll/python/Lib/site-packages/pip/_internal/cli/cmdoptions.py +133 -22
  251. package/xll/python/Lib/site-packages/pip/_internal/cli/index_command.py +11 -6
  252. package/xll/python/Lib/site-packages/pip/_internal/cli/main.py +2 -1
  253. package/xll/python/Lib/site-packages/pip/_internal/cli/main_parser.py +1 -2
  254. package/xll/python/Lib/site-packages/pip/_internal/cli/parser.py +10 -2
  255. package/xll/python/Lib/site-packages/pip/_internal/cli/progress_bars.py +2 -2
  256. package/xll/python/Lib/site-packages/pip/_internal/cli/req_command.py +57 -25
  257. package/xll/python/Lib/site-packages/pip/_internal/cli/status_codes.py +1 -0
  258. package/xll/python/Lib/site-packages/pip/_internal/commands/cache.py +7 -6
  259. package/xll/python/Lib/site-packages/pip/_internal/commands/configuration.py +2 -1
  260. package/xll/python/Lib/site-packages/pip/_internal/commands/debug.py +4 -5
  261. package/xll/python/Lib/site-packages/pip/_internal/commands/download.py +4 -0
  262. package/xll/python/Lib/site-packages/pip/_internal/commands/freeze.py +1 -1
  263. package/xll/python/Lib/site-packages/pip/_internal/commands/index.py +10 -3
  264. package/xll/python/Lib/site-packages/pip/_internal/commands/inspect.py +1 -1
  265. package/xll/python/Lib/site-packages/pip/_internal/commands/install.py +6 -6
  266. package/xll/python/Lib/site-packages/pip/_internal/commands/list.py +11 -6
  267. package/xll/python/Lib/site-packages/pip/_internal/commands/lock.py +4 -6
  268. package/xll/python/Lib/site-packages/pip/_internal/commands/show.py +14 -8
  269. package/xll/python/Lib/site-packages/pip/_internal/commands/wheel.py +7 -1
  270. package/xll/python/Lib/site-packages/pip/_internal/configuration.py +2 -3
  271. package/xll/python/Lib/site-packages/pip/_internal/distributions/base.py +5 -3
  272. package/xll/python/Lib/site-packages/pip/_internal/distributions/installed.py +3 -2
  273. package/xll/python/Lib/site-packages/pip/_internal/distributions/sdist.py +45 -20
  274. package/xll/python/Lib/site-packages/pip/_internal/distributions/wheel.py +3 -2
  275. package/xll/python/Lib/site-packages/pip/_internal/exceptions.py +174 -0
  276. package/xll/python/Lib/site-packages/pip/_internal/index/collector.py +70 -48
  277. package/xll/python/Lib/site-packages/pip/_internal/index/package_finder.py +46 -7
  278. package/xll/python/Lib/site-packages/pip/_internal/index/sources.py +1 -2
  279. package/xll/python/Lib/site-packages/pip/_internal/locations/_sysconfig.py +1 -1
  280. package/xll/python/Lib/site-packages/pip/_internal/locations/base.py +1 -1
  281. package/xll/python/Lib/site-packages/pip/_internal/metadata/base.py +10 -5
  282. package/xll/python/Lib/site-packages/pip/_internal/metadata/importlib/_dists.py +1 -1
  283. package/xll/python/Lib/site-packages/pip/_internal/metadata/importlib/_envs.py +8 -3
  284. package/xll/python/Lib/site-packages/pip/_internal/models/candidate.py +5 -1
  285. package/xll/python/Lib/site-packages/pip/_internal/models/link.py +53 -13
  286. package/xll/python/Lib/site-packages/pip/_internal/network/auth.py +38 -21
  287. package/xll/python/Lib/site-packages/pip/_internal/network/cache.py +2 -2
  288. package/xll/python/Lib/site-packages/pip/_internal/network/download.py +58 -11
  289. package/xll/python/Lib/site-packages/pip/_internal/network/session.py +35 -40
  290. package/xll/python/Lib/site-packages/pip/_internal/network/utils.py +109 -1
  291. package/xll/python/Lib/site-packages/pip/_internal/operations/check.py +2 -3
  292. package/xll/python/Lib/site-packages/pip/_internal/operations/install/wheel.py +23 -18
  293. package/xll/python/Lib/site-packages/pip/_internal/operations/prepare.py +152 -7
  294. package/xll/python/Lib/site-packages/pip/_internal/req/__init__.py +2 -0
  295. package/xll/python/Lib/site-packages/pip/_internal/req/constructors.py +54 -69
  296. package/xll/python/Lib/site-packages/pip/_internal/req/req_file.py +6 -6
  297. package/xll/python/Lib/site-packages/pip/_internal/req/req_install.py +25 -21
  298. package/xll/python/Lib/site-packages/pip/_internal/req/req_uninstall.py +13 -8
  299. package/xll/python/Lib/site-packages/pip/_internal/resolution/base.py +2 -2
  300. package/xll/python/Lib/site-packages/pip/_internal/resolution/legacy/resolver.py +2 -2
  301. package/xll/python/Lib/site-packages/pip/_internal/resolution/resolvelib/base.py +1 -1
  302. package/xll/python/Lib/site-packages/pip/_internal/resolution/resolvelib/candidates.py +0 -1
  303. package/xll/python/Lib/site-packages/pip/_internal/resolution/resolvelib/factory.py +39 -52
  304. package/xll/python/Lib/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +3 -3
  305. package/xll/python/Lib/site-packages/pip/_internal/resolution/resolvelib/provider.py +3 -0
  306. package/xll/python/Lib/site-packages/pip/_internal/resolution/resolvelib/resolver.py +9 -0
  307. package/xll/python/Lib/site-packages/pip/_internal/utils/compat.py +15 -9
  308. package/xll/python/Lib/site-packages/pip/_internal/utils/deprecation.py +6 -1
  309. package/xll/python/Lib/site-packages/pip/_internal/utils/filesystem.py +2 -2
  310. package/xll/python/Lib/site-packages/pip/_internal/utils/logging.py +11 -3
  311. package/xll/python/Lib/site-packages/pip/_internal/utils/misc.py +48 -4
  312. package/xll/python/Lib/site-packages/pip/_internal/utils/pylock.py +18 -2
  313. package/xll/python/Lib/site-packages/pip/_internal/utils/retry.py +2 -1
  314. package/xll/python/Lib/site-packages/pip/_internal/utils/subprocess.py +4 -3
  315. package/xll/python/Lib/site-packages/pip/_internal/utils/temp_dir.py +1 -2
  316. package/xll/python/Lib/site-packages/pip/_internal/utils/unpacking.py +30 -4
  317. package/xll/python/Lib/site-packages/pip/_internal/utils/urls.py +5 -2
  318. package/xll/python/Lib/site-packages/pip/_internal/utils/virtualenv.py +2 -36
  319. package/xll/python/Lib/site-packages/pip/_internal/vcs/git.py +8 -5
  320. package/xll/python/Lib/site-packages/pip/_internal/vcs/versioncontrol.py +1 -2
  321. package/xll/python/Lib/site-packages/pip/_internal/wheel_builder.py +5 -1
  322. package/xll/python/Lib/site-packages/pip/_vendor/bom.cdx.json +231 -0
  323. package/xll/python/Lib/site-packages/pip/_vendor/certifi/__init__.py +1 -1
  324. package/xll/python/Lib/site-packages/pip/_vendor/certifi/cacert.pem +0 -631
  325. package/xll/python/Lib/site-packages/pip/_vendor/distlib/__init__.py +1 -1
  326. package/xll/python/Lib/site-packages/pip/_vendor/distlib/compat.py +34 -64
  327. package/xll/python/Lib/site-packages/pip/_vendor/distlib/resources.py +28 -14
  328. package/xll/python/Lib/site-packages/pip/_vendor/distlib/scripts.py +7 -3
  329. package/xll/python/Lib/site-packages/pip/_vendor/distlib/util.py +48 -11
  330. package/xll/python/Lib/site-packages/pip/_vendor/idna/LICENSE.md +1 -1
  331. package/xll/python/Lib/site-packages/pip/_vendor/idna/__main__.py +6 -0
  332. package/xll/python/Lib/site-packages/pip/_vendor/idna/cli.py +128 -0
  333. package/xll/python/Lib/site-packages/pip/_vendor/idna/codec.py +50 -13
  334. package/xll/python/Lib/site-packages/pip/_vendor/idna/compat.py +26 -0
  335. package/xll/python/Lib/site-packages/pip/_vendor/idna/core.py +352 -141
  336. package/xll/python/Lib/site-packages/pip/_vendor/idna/idnadata.py +571 -2983
  337. package/xll/python/Lib/site-packages/pip/_vendor/idna/intranges.py +5 -7
  338. package/xll/python/Lib/site-packages/pip/_vendor/idna/package_data.py +1 -1
  339. package/xll/python/Lib/site-packages/pip/_vendor/idna/uts46data.py +16887 -8832
  340. package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/__init__.py +352 -66
  341. package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/__main__.py +11 -0
  342. package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/_xdg.py +171 -0
  343. package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/android.py +92 -41
  344. package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/api.py +213 -49
  345. package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/macos.py +128 -51
  346. package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/unix.py +176 -127
  347. package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/version.py +8 -18
  348. package/xll/python/Lib/site-packages/pip/_vendor/platformdirs/windows.py +185 -68
  349. package/xll/python/Lib/site-packages/pip/_vendor/pygments/__init__.py +2 -2
  350. package/xll/python/Lib/site-packages/pip/_vendor/pygments/__main__.py +1 -1
  351. package/xll/python/Lib/site-packages/pip/_vendor/pygments/console.py +1 -1
  352. package/xll/python/Lib/site-packages/pip/_vendor/pygments/filter.py +1 -1
  353. package/xll/python/Lib/site-packages/pip/_vendor/pygments/filters/__init__.py +10 -8
  354. package/xll/python/Lib/site-packages/pip/_vendor/pygments/formatter.py +1 -1
  355. package/xll/python/Lib/site-packages/pip/_vendor/pygments/formatters/__init__.py +1 -1
  356. package/xll/python/Lib/site-packages/pip/_vendor/pygments/lexer.py +7 -5
  357. package/xll/python/Lib/site-packages/pip/_vendor/pygments/lexers/__init__.py +1 -1
  358. package/xll/python/Lib/site-packages/pip/_vendor/pygments/lexers/_mapping.py +9 -8
  359. package/xll/python/Lib/site-packages/pip/_vendor/pygments/lexers/python.py +35 -32
  360. package/xll/python/Lib/site-packages/pip/_vendor/pygments/modeline.py +1 -1
  361. package/xll/python/Lib/site-packages/pip/_vendor/pygments/plugin.py +3 -1
  362. package/xll/python/Lib/site-packages/pip/_vendor/pygments/regexopt.py +13 -2
  363. package/xll/python/Lib/site-packages/pip/_vendor/pygments/scanner.py +1 -1
  364. package/xll/python/Lib/site-packages/pip/_vendor/pygments/sphinxext.py +1 -1
  365. package/xll/python/Lib/site-packages/pip/_vendor/pygments/style.py +1 -1
  366. package/xll/python/Lib/site-packages/pip/_vendor/pygments/styles/__init__.py +1 -1
  367. package/xll/python/Lib/site-packages/pip/_vendor/pygments/token.py +1 -1
  368. package/xll/python/Lib/site-packages/pip/_vendor/pygments/unistring.py +1 -1
  369. package/xll/python/Lib/site-packages/pip/_vendor/pygments/util.py +2 -2
  370. package/xll/python/Lib/site-packages/pip/_vendor/requests/__init__.py +52 -16
  371. package/xll/python/Lib/site-packages/pip/_vendor/requests/__version__.py +2 -2
  372. package/xll/python/Lib/site-packages/pip/_vendor/requests/_internal_utils.py +2 -2
  373. package/xll/python/Lib/site-packages/pip/_vendor/requests/_types.py +183 -0
  374. package/xll/python/Lib/site-packages/pip/_vendor/requests/adapters.py +101 -50
  375. package/xll/python/Lib/site-packages/pip/_vendor/requests/api.py +31 -8
  376. package/xll/python/Lib/site-packages/pip/_vendor/requests/auth.py +80 -40
  377. package/xll/python/Lib/site-packages/pip/_vendor/requests/compat.py +9 -3
  378. package/xll/python/Lib/site-packages/pip/_vendor/requests/cookies.py +143 -79
  379. package/xll/python/Lib/site-packages/pip/_vendor/requests/exceptions.py +15 -5
  380. package/xll/python/Lib/site-packages/pip/_vendor/requests/help.py +13 -10
  381. package/xll/python/Lib/site-packages/pip/_vendor/requests/hooks.py +23 -9
  382. package/xll/python/Lib/site-packages/pip/_vendor/requests/models.py +265 -126
  383. package/xll/python/Lib/site-packages/pip/_vendor/requests/py.typed +0 -0
  384. package/xll/python/Lib/site-packages/pip/_vendor/requests/sessions.py +164 -78
  385. package/xll/python/Lib/site-packages/pip/_vendor/requests/status_codes.py +2 -2
  386. package/xll/python/Lib/site-packages/pip/_vendor/requests/structures.py +51 -20
  387. package/xll/python/Lib/site-packages/pip/_vendor/requests/utils.py +161 -89
  388. package/xll/python/Lib/site-packages/pip/_vendor/tomli/__init__.py +1 -1
  389. package/xll/python/Lib/site-packages/pip/_vendor/tomli/_parser.py +9 -4
  390. package/xll/python/Lib/site-packages/pip/_vendor/tomli/_re.py +13 -9
  391. package/xll/python/Lib/site-packages/pip/_vendor/urllib3/_base_connection.py +3 -1
  392. package/xll/python/Lib/site-packages/pip/_vendor/urllib3/_collections.py +0 -1
  393. package/xll/python/Lib/site-packages/pip/_vendor/urllib3/_version.py +8 -18
  394. package/xll/python/Lib/site-packages/pip/_vendor/urllib3/connection.py +4 -4
  395. package/xll/python/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py +23 -10
  396. package/xll/python/Lib/site-packages/pip/_vendor/urllib3/contrib/emscripten/response.py +5 -1
  397. package/xll/python/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +7 -8
  398. package/xll/python/Lib/site-packages/pip/_vendor/urllib3/contrib/socks.py +1 -1
  399. package/xll/python/Lib/site-packages/pip/_vendor/urllib3/exceptions.py +2 -2
  400. package/xll/python/Lib/site-packages/pip/_vendor/urllib3/fields.py +14 -14
  401. package/xll/python/Lib/site-packages/pip/_vendor/urllib3/poolmanager.py +8 -6
  402. package/xll/python/Lib/site-packages/pip/_vendor/urllib3/response.py +35 -22
  403. package/xll/python/Lib/site-packages/pip/_vendor/urllib3/util/retry.py +8 -0
  404. package/xll/python/Lib/site-packages/pip/_vendor/urllib3/util/ssl_.py +11 -61
  405. package/xll/python/Lib/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.py +5 -11
  406. package/xll/python/Lib/site-packages/pip/_vendor/vendor.txt +8 -8
  407. package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/METADATA +3 -2
  408. package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/RECORD +208 -188
  409. package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/AUTHORS.txt +20 -0
  410. 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
  411. package/xll/python/Lib/site-packages/pywin32-311.dist-info/RECORD +2 -2
  412. package/xll/python/Scripts/httpx.exe +0 -0
  413. package/xll/python/Scripts/idna.exe +0 -0
  414. package/xll/python/Scripts/pip.exe +0 -0
  415. package/xll/python/Scripts/pip3.13.exe +0 -0
  416. package/xll/python/Scripts/pip3.exe +0 -0
  417. package/xll/python/Scripts/pywin32_postinstall.exe +0 -0
  418. package/xll/python/Scripts/pywin32_testall.exe +0 -0
  419. package/dist/app/collab/awareness.d.ts +0 -32
  420. package/dist/app/collab/awareness.js +0 -52
  421. package/dist/app/collab/collab-client.d.ts +0 -37
  422. package/dist/app/collab/collab-client.js +0 -208
  423. package/dist/app/collab/collab-manager.d.ts +0 -91
  424. package/dist/app/collab/collab-manager.js +0 -218
  425. package/dist/app/collab/collab-sync.d.ts +0 -62
  426. package/dist/app/collab/collab-sync.js +0 -215
  427. package/dist/app/collab/index.d.ts +0 -9
  428. package/dist/app/collab/index.js +0 -6
  429. package/dist/app/collab/super-fight.d.ts +0 -90
  430. package/dist/app/collab/super-fight.js +0 -310
  431. package/dist/app/collab/sync-bridge.d.ts +0 -35
  432. package/dist/app/collab/sync-bridge.js +0 -109
  433. package/dist/app/collab/types.d.ts +0 -75
  434. package/dist/app/collab/types.js +0 -5
  435. package/dist/embedded-agent/ai-content.d.ts +0 -52
  436. package/dist/embedded-agent/ai-content.js +0 -101
  437. package/dist/embedded-agent/host-tools/shared/llm-stream.d.ts +0 -31
  438. package/dist/embedded-agent/host-tools/shared/llm-stream.js +0 -136
  439. package/dist/embedded-agent/model-call-orchestrator.d.ts +0 -22
  440. package/dist/embedded-agent/model-call-orchestrator.js +0 -22
  441. package/dist/embedded-agent/stream-errors.d.ts +0 -10
  442. package/dist/embedded-agent/stream-errors.js +0 -73
  443. package/dist/embedded-agent/stream-message-state.d.ts +0 -14
  444. package/dist/embedded-agent/stream-message-state.js +0 -271
  445. package/dist/embedded-agent/stream-sse.d.ts +0 -78
  446. package/dist/embedded-agent/stream-sse.js +0 -73
  447. package/dist/shell/approvals/task-spawn-approval.d.ts +0 -20
  448. package/dist/shell/approvals/task-spawn-approval.js +0 -93
  449. package/dist/shell/interactive/collab-command.d.ts +0 -9
  450. package/dist/shell/interactive/collab-command.js +0 -115
  451. package/dist/shell/interactive/super-fight-ui.d.ts +0 -80
  452. package/dist/shell/interactive/super-fight-ui.js +0 -484
  453. package/dist/shell/status/collab-status.d.ts +0 -18
  454. package/dist/shell/status/collab-status.js +0 -46
  455. package/xll/python/Lib/site-packages/pip/_internal/build_env.py +0 -606
  456. /package/dist/{tui → autocomplete}/skill-autocomplete.js +0 -0
  457. /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/INSTALLER +0 -0
  458. /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/REQUESTED +0 -0
  459. /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/WHEEL +0 -0
  460. /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/entry_points.txt +0 -0
  461. /package/xll/python/Lib/site-packages/{pip-26.1.2.dist-info → pip-26.2.dist-info}/licenses/LICENSE.txt +0 -0
  462. /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
  463. /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
  464. /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
  465. /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
  466. /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
  467. /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
  468. /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
  469. /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
  470. /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
  471. /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
  472. /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
  473. /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
  474. /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
  475. /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
  476. /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
  477. /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
  478. /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
  479. /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
  480. /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
@@ -6,6 +6,8 @@ This module provides utility functions that are used within Requests
6
6
  that are also useful for external consumption.
7
7
  """
8
8
 
9
+ from __future__ import annotations
10
+
9
11
  import codecs
10
12
  import contextlib
11
13
  import io
@@ -18,6 +20,15 @@ import tempfile
18
20
  import warnings
19
21
  import zipfile
20
22
  from collections import OrderedDict
23
+ from collections.abc import Generator, Iterable
24
+ from typing import (
25
+ TYPE_CHECKING,
26
+ Any,
27
+ Final,
28
+ TypeVar,
29
+ cast,
30
+ overload,
31
+ )
21
32
 
22
33
  from pip._vendor.urllib3.util import make_headers, parse_url
23
34
 
@@ -26,21 +37,21 @@ from .__version__ import __version__
26
37
 
27
38
  # to_native_string is unused here, but imported here for backwards compatibility
28
39
  from ._internal_utils import ( # noqa: F401
29
- _HEADER_VALIDATORS_BYTE,
30
- _HEADER_VALIDATORS_STR,
31
- HEADER_VALIDATORS,
32
- to_native_string,
40
+ _HEADER_VALIDATORS_BYTE, # type: ignore[reportPrivateUsage]
41
+ _HEADER_VALIDATORS_STR, # type: ignore[reportPrivateUsage]
42
+ HEADER_VALIDATORS, # type: ignore[reportUnusedImport]
43
+ to_native_string, # type: ignore[reportUnusedImport]
33
44
  )
45
+ from ._types import SupportsItems as _SupportsItems
34
46
  from .compat import (
35
47
  Mapping,
36
- basestring,
37
48
  bytes,
38
49
  getproxies,
39
50
  getproxies_environment,
40
51
  integer_types,
41
52
  is_urllib3_1,
42
53
  proxy_bypass,
43
- proxy_bypass_environment,
54
+ proxy_bypass_environment, # type: ignore[attr-defined] # https://github.com/python/cpython/issues/145331
44
55
  quote,
45
56
  str,
46
57
  unquote,
@@ -57,15 +68,27 @@ from .exceptions import (
57
68
  )
58
69
  from .structures import CaseInsensitiveDict
59
70
 
60
- NETRC_FILES = (".netrc", "_netrc")
71
+ if TYPE_CHECKING:
72
+ from http.cookiejar import CookieJar
73
+ from io import BufferedWriter
74
+
75
+ from . import _types as _t
76
+ from .models import PreparedRequest, Request, Response
77
+
78
+ NETRC_FILES: Final = (".netrc", "_netrc")
79
+
61
80
 
62
81
  # Certificate is extracted by certifi when needed.
63
- DEFAULT_CA_BUNDLE_PATH = certs.where()
82
+ DEFAULT_CA_BUNDLE_PATH: str = certs.where()
83
+
64
84
 
65
- DEFAULT_PORTS = {"http": 80, "https": 443}
85
+ DEFAULT_PORTS: Final = {"http": 80, "https": 443}
86
+
87
+ _KT = TypeVar("_KT")
88
+ _VT = TypeVar("_VT")
66
89
 
67
90
  # Ensure that ', ' is used to preserve previous delimiter behavior.
68
- DEFAULT_ACCEPT_ENCODING = ", ".join(
91
+ DEFAULT_ACCEPT_ENCODING: Final = ", ".join(
69
92
  re.split(r",\s*", make_headers(accept_encoding=True)["accept-encoding"])
70
93
  )
71
94
 
@@ -73,7 +96,7 @@ DEFAULT_ACCEPT_ENCODING = ", ".join(
73
96
  if sys.platform == "win32":
74
97
  # provide a proxy_bypass version on Windows without DNS lookups
75
98
 
76
- def proxy_bypass_registry(host):
99
+ def proxy_bypass_registry(host: str) -> bool:
77
100
  try:
78
101
  import winreg
79
102
  except ImportError:
@@ -111,7 +134,7 @@ if sys.platform == "win32":
111
134
  return True
112
135
  return False
113
136
 
114
- def proxy_bypass(host): # noqa
137
+ def proxy_bypass(host: str) -> bool: # noqa
115
138
  """Return True, if the host should be bypassed.
116
139
 
117
140
  Checks proxy settings gathered from the environment, if specified,
@@ -123,16 +146,18 @@ if sys.platform == "win32":
123
146
  return proxy_bypass_registry(host)
124
147
 
125
148
 
126
- def dict_to_sequence(d):
149
+ def dict_to_sequence(
150
+ d: _t.SupportsItems[Any, Any] | Iterable[tuple[Any, Any]],
151
+ ) -> Iterable[tuple[Any, Any]]:
127
152
  """Returns an internal sequence dictionary update."""
128
153
 
129
- if hasattr(d, "items"):
130
- d = d.items()
154
+ if isinstance(d, _SupportsItems):
155
+ return d.items()
131
156
 
132
157
  return d
133
158
 
134
159
 
135
- def super_len(o):
160
+ def super_len(o: Any) -> int:
136
161
  total_length = None
137
162
  current_position = 0
138
163
 
@@ -203,9 +228,14 @@ def super_len(o):
203
228
  return max(0, total_length - current_position)
204
229
 
205
230
 
206
- def get_netrc_auth(url, raise_errors=False):
231
+ def get_netrc_auth(
232
+ url: _t.UriType, raise_errors: bool = False
233
+ ) -> tuple[str, str] | None:
207
234
  """Returns the Requests tuple auth for a given url from netrc."""
208
235
 
236
+ if isinstance(url, bytes):
237
+ url = url.decode("utf-8")
238
+
209
239
  netrc_file = os.environ.get("NETRC")
210
240
  if netrc_file is not None:
211
241
  netrc_locations = (netrc_file,)
@@ -230,12 +260,15 @@ def get_netrc_auth(url, raise_errors=False):
230
260
  ri = urlparse(url)
231
261
  host = ri.hostname
232
262
 
263
+ if host is None:
264
+ return
265
+
233
266
  try:
234
267
  _netrc = netrc(netrc_path).authenticators(host)
235
268
  if _netrc and any(_netrc):
236
269
  # Return with login / password
237
270
  login_i = 0 if _netrc[0] else 1
238
- return (_netrc[login_i], _netrc[2])
271
+ return (_netrc[login_i] or "", _netrc[2] or "")
239
272
  except (NetrcParseError, OSError):
240
273
  # If there was a parsing error or a permissions issue reading the file,
241
274
  # we'll just skip netrc auth unless explicitly asked to raise errors.
@@ -247,14 +280,14 @@ def get_netrc_auth(url, raise_errors=False):
247
280
  pass
248
281
 
249
282
 
250
- def guess_filename(obj):
283
+ def guess_filename(obj: Any) -> str | None:
251
284
  """Tries to guess the filename of the given object."""
252
285
  name = getattr(obj, "name", None)
253
- if name and isinstance(name, basestring) and name[0] != "<" and name[-1] != ">":
254
- return os.path.basename(name)
286
+ if name and isinstance(name, (str, bytes)) and name[0] != "<" and name[-1] != ">":
287
+ return os.path.basename(name) # type: ignore[return-value] # urllib3 accepts bytes but types str only
255
288
 
256
289
 
257
- def extract_zipped_paths(path):
290
+ def extract_zipped_paths(path: str) -> str:
258
291
  """Replace nonexistent paths that look like they refer to a member of a zip
259
292
  archive with the location of an extracted copy of the target, or else
260
293
  just return the provided path unchanged.
@@ -293,7 +326,7 @@ def extract_zipped_paths(path):
293
326
 
294
327
 
295
328
  @contextlib.contextmanager
296
- def atomic_open(filename):
329
+ def atomic_open(filename: str) -> Generator[BufferedWriter, None, None]:
297
330
  """Write a file to the disk in an atomic fashion"""
298
331
  tmp_descriptor, tmp_name = tempfile.mkstemp(dir=os.path.dirname(filename))
299
332
  try:
@@ -305,7 +338,9 @@ def atomic_open(filename):
305
338
  raise
306
339
 
307
340
 
308
- def from_key_val_list(value):
341
+ def from_key_val_list(
342
+ value: Mapping[Any, Any] | Iterable[tuple[Any, Any]] | None,
343
+ ) -> dict[Any, Any] | None:
309
344
  """Take an object and test to see if it can be represented as a
310
345
  dictionary. Unless it can not be represented as such, return an
311
346
  OrderedDict, e.g.,
@@ -332,7 +367,15 @@ def from_key_val_list(value):
332
367
  return OrderedDict(value)
333
368
 
334
369
 
335
- def to_key_val_list(value):
370
+ @overload
371
+ def to_key_val_list(value: None) -> None: ...
372
+ @overload
373
+ def to_key_val_list(
374
+ value: _t.SupportsItems[_KT, _VT] | Iterable[tuple[_KT, _VT]],
375
+ ) -> list[tuple[_KT, _VT]]: ...
376
+ def to_key_val_list(
377
+ value: _t.SupportsItems[_KT, _VT] | Iterable[tuple[_KT, _VT]] | None,
378
+ ) -> list[tuple[_KT, _VT]] | None:
336
379
  """Take an object and test to see if it can be represented as a
337
380
  dictionary. If it can be, return a list of tuples, e.g.,
338
381
 
@@ -355,14 +398,14 @@ def to_key_val_list(value):
355
398
  if isinstance(value, (str, bytes, bool, int)):
356
399
  raise ValueError("cannot encode objects that are not 2-tuples")
357
400
 
358
- if isinstance(value, Mapping):
359
- value = value.items()
401
+ if isinstance(value, _SupportsItems):
402
+ return list(value.items())
360
403
 
361
404
  return list(value)
362
405
 
363
406
 
364
407
  # From mitsuhiko/werkzeug (used with permission).
365
- def parse_list_header(value):
408
+ def parse_list_header(value: str) -> list[str]:
366
409
  """Parse lists as described by RFC 2068 Section 2.
367
410
 
368
411
  In particular, parse comma-separated lists where the elements of
@@ -385,7 +428,7 @@ def parse_list_header(value):
385
428
  :return: :class:`list`
386
429
  :rtype: list
387
430
  """
388
- result = []
431
+ result: list[str] = []
389
432
  for item in _parse_list_header(value):
390
433
  if item[:1] == item[-1:] == '"':
391
434
  item = unquote_header_value(item[1:-1])
@@ -394,7 +437,7 @@ def parse_list_header(value):
394
437
 
395
438
 
396
439
  # From mitsuhiko/werkzeug (used with permission).
397
- def parse_dict_header(value):
440
+ def parse_dict_header(value: str) -> dict[str, str | None]:
398
441
  """Parse lists of key, value pairs as described by RFC 2068 Section 2 and
399
442
  convert them into a python dict:
400
443
 
@@ -416,7 +459,7 @@ def parse_dict_header(value):
416
459
  :return: :class:`dict`
417
460
  :rtype: dict
418
461
  """
419
- result = {}
462
+ result: dict[str, str | None] = {}
420
463
  for item in _parse_list_header(value):
421
464
  if "=" not in item:
422
465
  result[item] = None
@@ -429,7 +472,7 @@ def parse_dict_header(value):
429
472
 
430
473
 
431
474
  # From mitsuhiko/werkzeug (used with permission).
432
- def unquote_header_value(value, is_filename=False):
475
+ def unquote_header_value(value: str, is_filename: bool = False) -> str:
433
476
  r"""Unquotes a header value. (Reversal of :func:`quote_header_value`).
434
477
  This does not use the real unquoting but what browsers are actually
435
478
  using for quoting.
@@ -454,7 +497,7 @@ def unquote_header_value(value, is_filename=False):
454
497
  return value
455
498
 
456
499
 
457
- def dict_from_cookiejar(cj):
500
+ def dict_from_cookiejar(cj: CookieJar) -> dict[str, str | None]:
458
501
  """Returns a key/value dictionary from a CookieJar.
459
502
 
460
503
  :param cj: CookieJar object to extract cookies from.
@@ -465,7 +508,7 @@ def dict_from_cookiejar(cj):
465
508
  return cookie_dict
466
509
 
467
510
 
468
- def add_dict_to_cookiejar(cj, cookie_dict):
511
+ def add_dict_to_cookiejar(cj: CookieJar, cookie_dict: dict[str, str]) -> CookieJar:
469
512
  """Returns a CookieJar from a key/value dictionary.
470
513
 
471
514
  :param cj: CookieJar to insert cookies into.
@@ -476,7 +519,7 @@ def add_dict_to_cookiejar(cj, cookie_dict):
476
519
  return cookiejar_from_dict(cookie_dict, cj)
477
520
 
478
521
 
479
- def get_encodings_from_content(content):
522
+ def get_encodings_from_content(content: str) -> list[str]:
480
523
  """Returns encodings from given content string.
481
524
 
482
525
  :param content: bytestring to extract encodings from.
@@ -501,7 +544,7 @@ def get_encodings_from_content(content):
501
544
  )
502
545
 
503
546
 
504
- def _parse_content_type_header(header):
547
+ def _parse_content_type_header(header: str) -> tuple[str, dict[str, Any]]:
505
548
  """Returns content type and parameters from given header.
506
549
 
507
550
  :param header: string
@@ -511,7 +554,7 @@ def _parse_content_type_header(header):
511
554
 
512
555
  tokens = header.split(";")
513
556
  content_type, params = tokens[0].strip(), tokens[1:]
514
- params_dict = {}
557
+ params_dict: dict[str, str | bool] = {}
515
558
  strip_chars = "\"' "
516
559
 
517
560
  for param in params:
@@ -523,7 +566,7 @@ def _parse_content_type_header(header):
523
566
  return content_type, params_dict
524
567
 
525
568
 
526
- def get_encoding_from_headers(headers):
569
+ def get_encoding_from_headers(headers: CaseInsensitiveDict[str]) -> str | None:
527
570
  """Returns encodings from given HTTP Header Dict.
528
571
 
529
572
  :param headers: dictionary to extract encoding from.
@@ -548,7 +591,9 @@ def get_encoding_from_headers(headers):
548
591
  return "utf-8"
549
592
 
550
593
 
551
- def stream_decode_response_unicode(iterator, r):
594
+ def stream_decode_response_unicode(
595
+ iterator: Iterable[bytes], r: Response
596
+ ) -> Generator[str | bytes, None, None]:
552
597
  """Stream decodes an iterator."""
553
598
 
554
599
  if r.encoding is None:
@@ -565,7 +610,17 @@ def stream_decode_response_unicode(iterator, r):
565
610
  yield rv
566
611
 
567
612
 
568
- def iter_slices(string, slice_length):
613
+ @overload
614
+ def iter_slices(
615
+ string: bytes, slice_length: int | None
616
+ ) -> Generator[bytes, None, None]: ...
617
+ @overload
618
+ def iter_slices(
619
+ string: str, slice_length: int | None
620
+ ) -> Generator[str, None, None]: ...
621
+ def iter_slices(
622
+ string: bytes | str, slice_length: int | None
623
+ ) -> Generator[bytes | str, None, None]:
569
624
  """Iterate over slices of a string."""
570
625
  pos = 0
571
626
  if slice_length is None or slice_length <= 0:
@@ -575,7 +630,7 @@ def iter_slices(string, slice_length):
575
630
  pos += slice_length
576
631
 
577
632
 
578
- def get_unicode_from_response(r):
633
+ def get_unicode_from_response(r: Response) -> str | bytes | None:
579
634
  """Returns the requested content back in unicode.
580
635
 
581
636
  :param r: Response object to get unicode content from.
@@ -595,8 +650,10 @@ def get_unicode_from_response(r):
595
650
  ),
596
651
  DeprecationWarning,
597
652
  )
653
+ if r.content is None: # type: ignore[reportUnnecessaryComparison]
654
+ return None
598
655
 
599
- tried_encodings = []
656
+ tried_encodings: list[str] = []
600
657
 
601
658
  # Try charset from content-type
602
659
  encoding = get_encoding_from_headers(r.headers)
@@ -609,18 +666,18 @@ def get_unicode_from_response(r):
609
666
 
610
667
  # Fall back:
611
668
  try:
612
- return str(r.content, encoding, errors="replace")
669
+ return str(r.content, encoding or "utf-8", errors="replace")
613
670
  except TypeError:
614
671
  return r.content
615
672
 
616
673
 
617
674
  # The unreserved URI characters (RFC 3986)
618
- UNRESERVED_SET = frozenset(
675
+ UNRESERVED_SET: Final = frozenset(
619
676
  "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" + "0123456789-._~"
620
677
  )
621
678
 
622
679
 
623
- def unquote_unreserved(uri):
680
+ def unquote_unreserved(uri: str) -> str:
624
681
  """Un-escape any percent-escape sequences in a URI that are unreserved
625
682
  characters. This leaves all reserved, illegal and non-ASCII bytes encoded.
626
683
 
@@ -644,7 +701,7 @@ def unquote_unreserved(uri):
644
701
  return "".join(parts)
645
702
 
646
703
 
647
- def requote_uri(uri):
704
+ def requote_uri(uri: str) -> str:
648
705
  """Re-quote the given URI.
649
706
 
650
707
  This function passes the given URI through an unquote/quote cycle to
@@ -666,7 +723,7 @@ def requote_uri(uri):
666
723
  return quote(uri, safe=safe_without_percent)
667
724
 
668
725
 
669
- def address_in_network(ip, net):
726
+ def address_in_network(ip: str, net: str) -> bool:
670
727
  """This function allows you to check if an IP belongs to a network subnet
671
728
 
672
729
  Example: returns True if ip = 192.168.1.1 and net = 192.168.1.0/24
@@ -681,7 +738,7 @@ def address_in_network(ip, net):
681
738
  return (ipaddr & netmask) == (network & netmask)
682
739
 
683
740
 
684
- def dotted_netmask(mask):
741
+ def dotted_netmask(mask: int) -> str:
685
742
  """Converts mask from /xx format to xxx.xxx.xxx.xxx
686
743
 
687
744
  Example: if mask is 24 function returns 255.255.255.0
@@ -692,7 +749,7 @@ def dotted_netmask(mask):
692
749
  return socket.inet_ntoa(struct.pack(">I", bits))
693
750
 
694
751
 
695
- def is_ipv4_address(string_ip):
752
+ def is_ipv4_address(string_ip: str) -> bool:
696
753
  """
697
754
  :rtype: bool
698
755
  """
@@ -703,7 +760,7 @@ def is_ipv4_address(string_ip):
703
760
  return True
704
761
 
705
762
 
706
- def is_valid_cidr(string_network):
763
+ def is_valid_cidr(string_network: str) -> bool:
707
764
  """
708
765
  Very simple check of the cidr format in no_proxy variable.
709
766
 
@@ -728,7 +785,7 @@ def is_valid_cidr(string_network):
728
785
 
729
786
 
730
787
  @contextlib.contextmanager
731
- def set_environ(env_name, value):
788
+ def set_environ(env_name: str, value: str | None) -> Generator[None, None, None]:
732
789
  """Set the environment variable 'env_name' to 'value'
733
790
 
734
791
  Save previous value, yield, and then restore the previous value stored in
@@ -736,6 +793,7 @@ def set_environ(env_name, value):
736
793
 
737
794
  If 'value' is None, do nothing"""
738
795
  value_changed = value is not None
796
+ old_value: str | None = None
739
797
  if value_changed:
740
798
  old_value = os.environ.get(env_name)
741
799
  os.environ[env_name] = value
@@ -749,7 +807,7 @@ def set_environ(env_name, value):
749
807
  os.environ[env_name] = old_value
750
808
 
751
809
 
752
- def should_bypass_proxies(url, no_proxy):
810
+ def should_bypass_proxies(url: str, no_proxy: str | None) -> bool:
753
811
  """
754
812
  Returns whether we should bypass proxies or not.
755
813
 
@@ -758,7 +816,7 @@ def should_bypass_proxies(url, no_proxy):
758
816
 
759
817
  # Prioritize lowercase environment variables over uppercase
760
818
  # to keep a consistent behaviour with other http projects (curl, wget).
761
- def get_proxy(key):
819
+ def get_proxy(key: str) -> str | None:
762
820
  return os.environ.get(key) or os.environ.get(key.upper())
763
821
 
764
822
  # First check whether no_proxy is defined. If it is, check that the URL
@@ -767,40 +825,42 @@ def should_bypass_proxies(url, no_proxy):
767
825
  if no_proxy is None:
768
826
  no_proxy = get_proxy("no_proxy")
769
827
  parsed = urlparse(url)
828
+ hostname = parsed.hostname
770
829
 
771
- if parsed.hostname is None:
830
+ if hostname is None:
772
831
  # URLs don't always have hostnames, e.g. file:/// urls.
773
832
  return True
774
833
 
775
834
  if no_proxy:
776
835
  # We need to check whether we match here. We need to see if we match
777
836
  # the end of the hostname, both with and without the port.
778
- no_proxy = (host for host in no_proxy.replace(" ", "").split(",") if host)
837
+ no_proxy_hosts = (host for host in no_proxy.replace(" ", "").split(",") if host)
779
838
 
780
- if is_ipv4_address(parsed.hostname):
781
- for proxy_ip in no_proxy:
839
+ if is_ipv4_address(hostname):
840
+ for proxy_ip in no_proxy_hosts:
782
841
  if is_valid_cidr(proxy_ip):
783
- if address_in_network(parsed.hostname, proxy_ip):
842
+ if address_in_network(hostname, proxy_ip):
784
843
  return True
785
- elif parsed.hostname == proxy_ip:
844
+ elif hostname == proxy_ip:
786
845
  # If no_proxy ip was defined in plain IP notation instead of cidr notation &
787
846
  # matches the IP of the index
788
847
  return True
789
848
  else:
790
- host_with_port = parsed.hostname
849
+ host_with_port = hostname
791
850
  if parsed.port:
792
851
  host_with_port += f":{parsed.port}"
793
852
 
794
- for host in no_proxy:
795
- if parsed.hostname.endswith(host) or host_with_port.endswith(host):
796
- # The URL does match something in no_proxy, so we don't want
797
- # to apply the proxies on this URL.
853
+ for host in no_proxy_hosts:
854
+ host = host.lstrip(".")
855
+ if hostname == host or host_with_port == host:
856
+ return True
857
+ host = "." + host
858
+ if hostname.endswith(host) or host_with_port.endswith(host):
798
859
  return True
799
860
 
800
861
  with set_environ("no_proxy", no_proxy_arg):
801
- # parsed.hostname can be `None` in cases such as a file URI.
802
862
  try:
803
- bypass = proxy_bypass(parsed.hostname)
863
+ bypass = proxy_bypass(hostname)
804
864
  except (TypeError, socket.gaierror):
805
865
  bypass = False
806
866
 
@@ -810,7 +870,7 @@ def should_bypass_proxies(url, no_proxy):
810
870
  return False
811
871
 
812
872
 
813
- def get_environ_proxies(url, no_proxy=None):
873
+ def get_environ_proxies(url: str, no_proxy: str | None = None) -> dict[str, str]:
814
874
  """
815
875
  Return a dict of environment proxies.
816
876
 
@@ -822,7 +882,7 @@ def get_environ_proxies(url, no_proxy=None):
822
882
  return getproxies()
823
883
 
824
884
 
825
- def select_proxy(url, proxies):
885
+ def select_proxy(url: str, proxies: dict[str, str] | None) -> str | None:
826
886
  """Select a proxy for the url, if applicable.
827
887
 
828
888
  :param url: The url being for the request
@@ -848,7 +908,11 @@ def select_proxy(url, proxies):
848
908
  return proxy
849
909
 
850
910
 
851
- def resolve_proxies(request, proxies, trust_env=True):
911
+ def resolve_proxies(
912
+ request: Request | PreparedRequest,
913
+ proxies: dict[str, str] | None,
914
+ trust_env: bool = True,
915
+ ) -> dict[str, str]:
852
916
  """This method takes proxy information from a request and configuration
853
917
  input to resolve a mapping of target proxies. This will consider settings
854
918
  such as NO_PROXY to strip proxy configurations.
@@ -860,7 +924,7 @@ def resolve_proxies(request, proxies, trust_env=True):
860
924
  :rtype: dict
861
925
  """
862
926
  proxies = proxies if proxies is not None else {}
863
- url = request.url
927
+ url = cast(str, request.url)
864
928
  scheme = urlparse(url).scheme
865
929
  no_proxy = proxies.get("no_proxy")
866
930
  new_proxies = proxies.copy()
@@ -875,7 +939,7 @@ def resolve_proxies(request, proxies, trust_env=True):
875
939
  return new_proxies
876
940
 
877
941
 
878
- def default_user_agent(name="python-requests"):
942
+ def default_user_agent(name: str = "python-requests") -> str:
879
943
  """
880
944
  Return a string representing the default user agent.
881
945
 
@@ -884,7 +948,7 @@ def default_user_agent(name="python-requests"):
884
948
  return f"{name}/{__version__}"
885
949
 
886
950
 
887
- def default_headers():
951
+ def default_headers() -> CaseInsensitiveDict[str]:
888
952
  """
889
953
  :rtype: requests.structures.CaseInsensitiveDict
890
954
  """
@@ -898,7 +962,7 @@ def default_headers():
898
962
  )
899
963
 
900
964
 
901
- def parse_header_links(value):
965
+ def parse_header_links(value: str) -> list[dict[str, str]]:
902
966
  """Return a list of parsed link headers proxies.
903
967
 
904
968
  i.e. Link: <http:/.../front.jpeg>; rel=front; type="image/jpeg",<http://.../back.jpeg>; rel=back;type="image/jpeg"
@@ -906,7 +970,7 @@ def parse_header_links(value):
906
970
  :rtype: list
907
971
  """
908
972
 
909
- links = []
973
+ links: list[dict[str, str]] = []
910
974
 
911
975
  replace_chars = " '\""
912
976
 
@@ -920,7 +984,7 @@ def parse_header_links(value):
920
984
  except ValueError:
921
985
  url, params = val, ""
922
986
 
923
- link = {"url": url.strip("<> '\"")}
987
+ link: dict[str, str] = {"url": url.strip("<> '\"")}
924
988
 
925
989
  for param in params.split(";"):
926
990
  try:
@@ -941,7 +1005,7 @@ _null2 = _null * 2
941
1005
  _null3 = _null * 3
942
1006
 
943
1007
 
944
- def guess_json_utf(data):
1008
+ def guess_json_utf(data: bytes) -> str | None:
945
1009
  """
946
1010
  :rtype: str
947
1011
  """
@@ -973,14 +1037,14 @@ def guess_json_utf(data):
973
1037
  return None
974
1038
 
975
1039
 
976
- def prepend_scheme_if_needed(url, new_scheme):
1040
+ def prepend_scheme_if_needed(url: str, new_scheme: str) -> str:
977
1041
  """Given a URL that may or may not have a scheme, prepend the given scheme.
978
1042
  Does not replace a present scheme with the one provided as an argument.
979
1043
 
980
1044
  :rtype: str
981
1045
  """
982
1046
  parsed = parse_url(url)
983
- scheme, auth, host, port, path, query, fragment = parsed
1047
+ scheme, auth, _host, _port, path, query, fragment = parsed
984
1048
 
985
1049
  # A defect in urlparse determines that there isn't a netloc present in some
986
1050
  # urls. We previously assumed parsing was overly cautious, and swapped the
@@ -993,6 +1057,7 @@ def prepend_scheme_if_needed(url, new_scheme):
993
1057
  if auth:
994
1058
  # parse_url doesn't provide the netloc with auth
995
1059
  # so we'll add it ourselves.
1060
+ netloc = cast(str, netloc)
996
1061
  netloc = "@".join([auth, netloc])
997
1062
  if scheme is None:
998
1063
  scheme = new_scheme
@@ -1002,7 +1067,7 @@ def prepend_scheme_if_needed(url, new_scheme):
1002
1067
  return urlunparse((scheme, netloc, path, "", query, fragment))
1003
1068
 
1004
1069
 
1005
- def get_auth_from_url(url):
1070
+ def get_auth_from_url(url: str) -> tuple[str, str]:
1006
1071
  """Given a url with authentication components, extract them into a tuple of
1007
1072
  username,password.
1008
1073
 
@@ -1011,14 +1076,15 @@ def get_auth_from_url(url):
1011
1076
  parsed = urlparse(url)
1012
1077
 
1013
1078
  try:
1014
- auth = (unquote(parsed.username), unquote(parsed.password))
1079
+ # except handles parsed.username/password being None
1080
+ auth = (unquote(parsed.username), unquote(parsed.password)) # type: ignore[arg-type]
1015
1081
  except (AttributeError, TypeError):
1016
1082
  auth = ("", "")
1017
1083
 
1018
1084
  return auth
1019
1085
 
1020
1086
 
1021
- def check_header_validity(header):
1087
+ def check_header_validity(header: tuple[str | bytes, str | bytes]) -> None:
1022
1088
  """Verifies that header parts don't contain leading whitespace
1023
1089
  reserved characters, or return characters.
1024
1090
 
@@ -1029,10 +1095,15 @@ def check_header_validity(header):
1029
1095
  _validate_header_part(header, value, 1)
1030
1096
 
1031
1097
 
1032
- def _validate_header_part(header, header_part, header_validator_index):
1098
+ def _validate_header_part(
1099
+ header: tuple[str | bytes, str | bytes],
1100
+ header_part: str | bytes,
1101
+ header_validator_index: int,
1102
+ ) -> None:
1033
1103
  if isinstance(header_part, str):
1034
1104
  validator = _HEADER_VALIDATORS_STR[header_validator_index]
1035
- elif isinstance(header_part, bytes):
1105
+ elif isinstance(header_part, bytes): # type: ignore[reportUnnecessaryIsInstance]
1106
+ # runtime guard for non-str/bytes input
1036
1107
  validator = _HEADER_VALIDATORS_BYTE[header_validator_index]
1037
1108
  else:
1038
1109
  raise InvalidHeader(
@@ -1040,7 +1111,7 @@ def _validate_header_part(header, header_part, header_validator_index):
1040
1111
  f"must be of type str or bytes, not {type(header_part)}"
1041
1112
  )
1042
1113
 
1043
- if not validator.match(header_part):
1114
+ if not validator.match(header_part): # type: ignore[arg-type]
1044
1115
  header_kind = "name" if header_validator_index == 0 else "value"
1045
1116
  raise InvalidHeader(
1046
1117
  f"Invalid leading whitespace, reserved character(s), or return "
@@ -1048,13 +1119,13 @@ def _validate_header_part(header, header_part, header_validator_index):
1048
1119
  )
1049
1120
 
1050
1121
 
1051
- def urldefragauth(url):
1122
+ def urldefragauth(url: str) -> str:
1052
1123
  """
1053
1124
  Given a url remove the fragment and the authentication part.
1054
1125
 
1055
1126
  :rtype: str
1056
1127
  """
1057
- scheme, netloc, path, params, query, fragment = urlparse(url)
1128
+ scheme, netloc, path, params, query, _fragment = urlparse(url)
1058
1129
 
1059
1130
  # see func:`prepend_scheme_if_needed`
1060
1131
  if not netloc:
@@ -1065,16 +1136,17 @@ def urldefragauth(url):
1065
1136
  return urlunparse((scheme, netloc, path, params, query, ""))
1066
1137
 
1067
1138
 
1068
- def rewind_body(prepared_request):
1139
+ def rewind_body(prepared_request: PreparedRequest) -> None:
1069
1140
  """Move file pointer back to its recorded starting position
1070
1141
  so it can be read again on redirect.
1071
1142
  """
1072
1143
  body_seek = getattr(prepared_request.body, "seek", None)
1073
1144
  if body_seek is not None and isinstance(
1074
- prepared_request._body_position, integer_types
1145
+ prepared_request._body_position, # type: ignore[reportPrivateUsage]
1146
+ integer_types,
1075
1147
  ):
1076
1148
  try:
1077
- body_seek(prepared_request._body_position)
1149
+ body_seek(prepared_request._body_position) # type: ignore[reportPrivateUsage]
1078
1150
  except OSError:
1079
1151
  raise UnrewindableBodyError(
1080
1152
  "An error occurred when rewinding request body for redirect."