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
@@ -1,5 +1,29 @@
1
1
  """API layer — Workbook/Worksheet wrappers and supporting modules."""
2
2
 
3
+ from collections.abc import Callable, Iterator
4
+ from contextlib import contextmanager
5
+ from contextvars import ContextVar
6
+ from functools import wraps
7
+ from inspect import signature
8
+ from typing import Any, Protocol, TypeVar
9
+
10
+
11
+ class _RangeTracker(Protocol):
12
+ def track_range(self, rng: Any) -> None: ...
13
+
14
+
15
+ _active_write_tracker: ContextVar[_RangeTracker | None] = ContextVar('shortcut_xl_active_write_tracker', default=None)
16
+
17
+
18
+ @contextmanager
19
+ def active_write_tracker(tracker: _RangeTracker) -> Iterator[None]:
20
+ """Make *tracker* available to wrapped write operations for one execution."""
21
+ token = _active_write_tracker.set(tracker)
22
+ try:
23
+ yield
24
+ finally:
25
+ _active_write_tracker.reset(token)
26
+
3
27
 
4
28
  def write_op(fn):
5
29
  """Mark a method as a write operation.
@@ -12,3 +36,39 @@ def write_op(fn):
12
36
  Zero-overhead at runtime — just returns the function unchanged.
13
37
  """
14
38
  return fn
39
+
40
+
41
+ _F = TypeVar('_F', bound=Callable[..., Any])
42
+
43
+
44
+ def track_range(argument: str | None = None, *, resolver: Callable[..., Any] | None = None):
45
+ """Snapshot a wrapped write operation's destination range before it runs.
46
+
47
+ Worksheet methods can name the argument containing an A1 address. More
48
+ complex operations can provide a resolver returning the destination COM
49
+ Range. Returning ``None`` opts out for calls that do not change cell
50
+ contents (for example, a formatting-only paste).
51
+ """
52
+ if (argument is None) == (resolver is None):
53
+ raise ValueError('track_range requires exactly one of argument or resolver')
54
+
55
+ def decorate(fn: _F) -> _F:
56
+ fn_signature = signature(fn)
57
+
58
+ @wraps(fn)
59
+ def wrapped(*args, **kwargs):
60
+ tracker = _active_write_tracker.get()
61
+ if tracker is not None:
62
+ if resolver is not None:
63
+ rng = resolver(*args, **kwargs)
64
+ else:
65
+ bound = fn_signature.bind(*args, **kwargs)
66
+ owner = bound.arguments[next(iter(fn_signature.parameters))]
67
+ rng = owner._ws.Range(bound.arguments[argument])
68
+ if rng is not None:
69
+ tracker.track_range(rng)
70
+ return fn(*args, **kwargs)
71
+
72
+ return wrapped # type: ignore[return-value]
73
+
74
+ return decorate
@@ -5,7 +5,7 @@ Output formats match the SpreadJS equivalents.
5
5
 
6
6
  from __future__ import annotations
7
7
 
8
- from shortcut_xl.api import write_op
8
+ from shortcut_xl.api import track_range, write_op
9
9
  from shortcut_xl.api.categorize import com_error_to_str, is_com_error, is_error_value
10
10
  from shortcut_xl.api.named_ranges import get_named_range_info
11
11
  from shortcut_xl.api.utils.com_utils import normalize_2d
@@ -222,6 +222,14 @@ class Workbook:
222
222
  return self._wb.Sheets(sheet_name).Range(cell_addr)
223
223
  return self._wb.Application.Range(address)
224
224
 
225
+ def _copy_destination_range(self, from_range: str, to_address: str, paste_type: str = 'all'):
226
+ if paste_type == 'formatting':
227
+ return None
228
+ source = self._resolve_range(from_range)
229
+ destination = self._resolve_range(to_address)
230
+ return destination.Resize(source.Rows.Count, source.Columns.Count)
231
+
232
+ @track_range(resolver=_copy_destination_range)
225
233
  @write_op
226
234
  def copyPasteRange(self, from_range: str, to_address: str, paste_type: str = 'all') -> None:
227
235
  """Copy a range to another location within the same workbook.
@@ -12,7 +12,7 @@ import re
12
12
  from typing import Any
13
13
 
14
14
  from shortcut_xl._log import xl_log
15
- from shortcut_xl.api import write_op
15
+ from shortcut_xl.api import track_range, write_op
16
16
  from shortcut_xl.api.categorize import com_error_to_str, is_com_error
17
17
  from shortcut_xl.api.picture import add_picture
18
18
  from shortcut_xl.api.range_formatter import format_cell_range
@@ -156,6 +156,7 @@ class Worksheet:
156
156
  # Single cell write
157
157
  # ------------------------------------------------------------------
158
158
 
159
+ @track_range('address')
159
160
  @write_op
160
161
  def setCell(self, address: str, value: Any, number_format: str | None = None, note: str | None = None) -> None:
161
162
  """Write a value (or formula) to a single cell.
@@ -201,6 +202,7 @@ class Worksheet:
201
202
  pass
202
203
  cell.AddComment(text)
203
204
 
205
+ @track_range('range_addr')
204
206
  @write_op
205
207
  def setCellRange(self, range_addr: str, values: list[list], number_format: str | None = None) -> None:
206
208
  """Bulk write values to a range. Formulas detected by leading '='.
@@ -452,6 +454,7 @@ class Worksheet:
452
454
  # AutoFill
453
455
  # ------------------------------------------------------------------
454
456
 
457
+ @track_range('target_range')
455
458
  @write_op
456
459
  def autoFill(self, source_range: str, target_range: str, fill_mode: str = 'auto') -> None:
457
460
  """AutoFill — equivalent to Excel's drag-fill.
@@ -1,4 +1,4 @@
1
- ../../Scripts/httpx.exe,sha256=JwAchdvoX6RIuldcm0EpU0n3K4vP4uCAV0i-vozMmIg,108375
1
+ ../../Scripts/httpx.exe,sha256=zmqk-pjoZpd50U36gderp2WRMlJeOMo3bMdH5QMoAfU,108375
2
2
  httpx-0.28.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
3
3
  httpx-0.28.1.dist-info/METADATA,sha256=_rubD48-gNV8gZnDBPNcQzboWB0dGNeYPJJ2a4J5OyU,7052
4
4
  httpx-0.28.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
- ../../Scripts/idna.exe,sha256=nwGn78zJkX8-1-ekG5ULhzS-jIRNtaa3gBQYjdsiVdo,108378
1
+ ../../Scripts/idna.exe,sha256=U_wul5sDonzzx_dSpoYpZkaQlfxRlLngeBD8IBJSCbE,108378
2
2
  idna-3.18.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
3
3
  idna-3.18.dist-info/METADATA,sha256=Rt_m5axGLQ9oDs2avPZugptqIzSCS02eOXmzETXK8oE,6119
4
4
  idna-3.18.dist-info/RECORD,,
@@ -1,6 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "26.1.2"
3
+ __version__ = "26.2"
4
4
 
5
5
 
6
6
  def main(args: list[str] | None = None) -> int:
@@ -0,0 +1,25 @@
1
+ """Build environments used for isolation during build backend calls."""
2
+
3
+ from pip._internal.build_env.base import (
4
+ BuildEnvironment,
5
+ BuildEnvironmentInstaller,
6
+ BuildIsolationMode,
7
+ )
8
+ from pip._internal.build_env.installer import (
9
+ InprocessBuildEnvironmentInstaller,
10
+ SubprocessBuildEnvironmentInstaller,
11
+ )
12
+ from pip._internal.build_env.noop import NoOpBuildEnvironment
13
+ from pip._internal.build_env.venv import VenvBuildEnvironment
14
+ from pip._internal.build_env.virtual import VirtualBuildEnvironment
15
+
16
+ __all__ = [
17
+ "BuildEnvironment",
18
+ "BuildEnvironmentInstaller",
19
+ "BuildIsolationMode",
20
+ "InprocessBuildEnvironmentInstaller",
21
+ "NoOpBuildEnvironment",
22
+ "SubprocessBuildEnvironmentInstaller",
23
+ "VenvBuildEnvironment",
24
+ "VirtualBuildEnvironment",
25
+ ]
@@ -0,0 +1,103 @@
1
+ from __future__ import annotations
2
+
3
+ import abc
4
+ from collections.abc import Iterable
5
+ from contextlib import AbstractContextManager as ContextManager
6
+ from typing import TYPE_CHECKING, Literal, Protocol
7
+
8
+ from pip._vendor.packaging.version import Version
9
+
10
+ from pip._internal.locations import get_scheme
11
+ from pip._internal.metadata import get_default_environment, get_environment
12
+ from pip._internal.utils.packaging import get_requirement
13
+
14
+ if TYPE_CHECKING:
15
+ from pip._internal.req.req_install import InstallRequirement
16
+
17
+
18
+ BuildIsolationMode = Literal["off", "virtual", "venv"]
19
+
20
+
21
+ def _dedup(a: str, b: str) -> tuple[str] | tuple[str, str]:
22
+ return (a, b) if a != b else (a,)
23
+
24
+
25
+ class Prefix:
26
+ # TODO: simplify this data model when the legacy subprocess installer is removed
27
+ def __init__(self, path: str, *, venv_executable: str | None = None) -> None:
28
+ self.path = path
29
+ self.setup = False
30
+ scheme = get_scheme("", prefix=path)
31
+ self.bin_dir = scheme.scripts
32
+ self.lib_dirs = _dedup(scheme.purelib, scheme.platlib)
33
+ self.venv_executable = venv_executable
34
+
35
+
36
+ class BuildEnvironmentInstaller(Protocol):
37
+ """
38
+ Interface for installing build dependencies into an isolated build
39
+ environment.
40
+ """
41
+
42
+ def install(
43
+ self,
44
+ requirements: Iterable[str],
45
+ prefix: Prefix,
46
+ *,
47
+ kind: str,
48
+ for_req: InstallRequirement | None,
49
+ ) -> None: ...
50
+
51
+
52
+ class BuildEnvironment(ContextManager[None], metaclass=abc.ABCMeta):
53
+ """Creates and manages an isolated environment to install build deps"""
54
+
55
+ lib_dirs: list[str]
56
+ python_executable: str
57
+
58
+ @abc.abstractmethod
59
+ def __init__(self, installer: BuildEnvironmentInstaller): ...
60
+
61
+ def check_requirements(
62
+ self, reqs: Iterable[str]
63
+ ) -> tuple[set[tuple[str, str]], set[str]]:
64
+ """Return 2 sets:
65
+ - conflicting requirements: set of (installed, wanted) reqs tuples
66
+ - missing requirements: set of reqs
67
+ """
68
+ missing = set()
69
+ conflicting = set()
70
+ if reqs:
71
+ env = (
72
+ get_environment(self.lib_dirs)
73
+ if hasattr(self, "lib_dirs")
74
+ else get_default_environment()
75
+ )
76
+ for req_str in reqs:
77
+ req = get_requirement(req_str)
78
+ # We're explicitly evaluating with an empty extra value, since build
79
+ # environments are not provided any mechanism to select specific extras.
80
+ if req.marker is not None and not req.marker.evaluate({"extra": ""}):
81
+ continue
82
+ dist = env.get_distribution(req.name)
83
+ if not dist:
84
+ missing.add(req_str)
85
+ continue
86
+ if isinstance(dist.version, Version):
87
+ installed_req_str = f"{req.name}=={dist.version}"
88
+ else:
89
+ installed_req_str = f"{req.name}==={dist.version}"
90
+ if not req.specifier.contains(dist.version, prereleases=True):
91
+ conflicting.add((installed_req_str, req_str))
92
+ # FIXME: Consider direct URL?
93
+ return conflicting, missing
94
+
95
+ @abc.abstractmethod
96
+ def install_requirements(
97
+ self,
98
+ requirements: Iterable[str],
99
+ prefix_as_string: str,
100
+ *,
101
+ kind: str,
102
+ for_req: InstallRequirement | None = None,
103
+ ) -> None: ...
@@ -0,0 +1,333 @@
1
+ from __future__ import annotations
2
+
3
+ import logging
4
+ import sys
5
+ import textwrap
6
+ from collections.abc import Iterable, Sequence
7
+ from contextlib import AbstractContextManager as ContextManager
8
+ from contextlib import nullcontext
9
+ from io import StringIO
10
+ from typing import TYPE_CHECKING
11
+
12
+ from pip._internal.build_env.base import Prefix
13
+ from pip._internal.cli.spinners import open_rich_spinner, open_spinner
14
+ from pip._internal.exceptions import (
15
+ BuildDependencyInstallError,
16
+ DiagnosticPipError,
17
+ InstallWheelBuildError,
18
+ PipError,
19
+ )
20
+ from pip._internal.metadata import get_environment
21
+ from pip._internal.utils.logging import VERBOSE, capture_logging
22
+ from pip._internal.utils.misc import get_runnable_pip
23
+ from pip._internal.utils.subprocess import call_subprocess
24
+ from pip._internal.utils.temp_dir import TempDirectory
25
+
26
+ if TYPE_CHECKING:
27
+ from pip._internal.cache import WheelCache
28
+ from pip._internal.index.package_finder import PackageFinder
29
+ from pip._internal.operations.build.build_tracker import BuildTracker
30
+ from pip._internal.req.req_install import InstallRequirement
31
+ from pip._internal.resolution.base import BaseResolver
32
+
33
+
34
+ logger = logging.getLogger(__name__)
35
+
36
+
37
+ class SubprocessBuildEnvironmentInstaller:
38
+ """
39
+ Install build dependencies by calling pip in a subprocess.
40
+ """
41
+
42
+ def __init__(
43
+ self,
44
+ finder: PackageFinder,
45
+ build_constraints: list[str] | None = None,
46
+ ) -> None:
47
+ self.finder = finder
48
+ self._build_constraints = build_constraints or []
49
+
50
+ def install(
51
+ self,
52
+ requirements: Iterable[str],
53
+ prefix: Prefix,
54
+ *,
55
+ kind: str,
56
+ for_req: InstallRequirement | None,
57
+ ) -> None:
58
+ finder = self.finder
59
+ args: list[str] = [
60
+ get_runnable_pip(),
61
+ "install",
62
+ # HACK: --prefix shouldn't be necessary for venv environments, but
63
+ # we set it anyway so if it's set via an envvar or configuration
64
+ # file, it won't break things, *sigh*.
65
+ "--prefix",
66
+ prefix.path,
67
+ "--no-user",
68
+ "--no-warn-script-location",
69
+ "--disable-pip-version-check",
70
+ # As the build environment is ephemeral, it's wasteful to
71
+ # pre-compile everything, especially as not every Python
72
+ # module will be used/compiled in most cases.
73
+ "--no-compile",
74
+ # The prefix specified two lines above, thus
75
+ # target from config file or env var should be ignored
76
+ "--target",
77
+ "",
78
+ ]
79
+ if prefix.venv_executable:
80
+ args.insert(0, prefix.venv_executable)
81
+ else:
82
+ args.insert(0, sys.executable)
83
+ args.append("--ignore-installed")
84
+
85
+ if logger.getEffectiveLevel() <= logging.DEBUG:
86
+ args.append("-vv")
87
+ elif logger.getEffectiveLevel() <= VERBOSE:
88
+ args.append("-v")
89
+ for format_control in ("no_binary", "only_binary"):
90
+ formats = getattr(finder.format_control, format_control)
91
+ args.extend(
92
+ (
93
+ "--" + format_control.replace("_", "-"),
94
+ ",".join(sorted(formats or {":none:"})),
95
+ )
96
+ )
97
+
98
+ if finder.release_control is not None:
99
+ # Use ordered args to preserve the user's original command-line order
100
+ # This is important because later flags can override earlier ones
101
+ for attr_name, value in finder.release_control.get_ordered_args():
102
+ args.extend(("--" + attr_name.replace("_", "-"), value))
103
+
104
+ index_urls = finder.index_urls
105
+ if index_urls:
106
+ args.extend(["-i", index_urls[0]])
107
+ for extra_index in index_urls[1:]:
108
+ args.extend(["--extra-index-url", extra_index])
109
+ else:
110
+ args.append("--no-index")
111
+ for link in finder.find_links:
112
+ args.extend(["--find-links", link])
113
+
114
+ # is not None: forward an empty --proxy "" (disable proxying) too.
115
+ if finder.proxy is not None:
116
+ args.extend(["--proxy", finder.proxy])
117
+ if finder.no_proxy_env:
118
+ args.append("--no-proxy-env")
119
+ for host in finder.trusted_hosts:
120
+ args.extend(["--trusted-host", host])
121
+ if finder.custom_cert:
122
+ args.extend(["--cert", finder.custom_cert])
123
+ if finder.client_cert:
124
+ args.extend(["--client-cert", finder.client_cert])
125
+ if finder.prefer_binary:
126
+ args.append("--prefer-binary")
127
+ if finder.refresh_package:
128
+ args.extend(["--refresh-package", ",".join(finder.refresh_package)])
129
+
130
+ # Only build constraints apply in the isolated build environment.
131
+ # _PIP_IN_BUILD_IGNORE_CONSTRAINTS tells the subprocess to ignore the
132
+ # regular constraints it inherits (via PIP_CONSTRAINT or config files).
133
+ # Build constraints reach it through --build-constraint, which also
134
+ # constrains any nested builds.
135
+ for constraint_file in self._build_constraints:
136
+ args.extend(["--build-constraint", constraint_file])
137
+
138
+ if finder.uploaded_prior_to:
139
+ args.extend(["--uploaded-prior-to", finder.uploaded_prior_to.isoformat()])
140
+ args.append("--")
141
+ args.extend(requirements)
142
+
143
+ identify_requirement = (
144
+ f" for {for_req.name}" if for_req and for_req.name else ""
145
+ )
146
+ with open_spinner(f"Installing {kind}") as spinner:
147
+ call_subprocess(
148
+ args,
149
+ command_desc=f"installing {kind}{identify_requirement}",
150
+ spinner=spinner,
151
+ extra_environ={"_PIP_IN_BUILD_IGNORE_CONSTRAINTS": "1"},
152
+ )
153
+
154
+
155
+ class InprocessBuildEnvironmentInstaller:
156
+ """
157
+ Install build dependencies via the already running pip process.
158
+
159
+ This contains a stripped down version of the install command with
160
+ only the logic necessary for installing build dependencies. The
161
+ finder, session, build tracker, and wheel cache are reused, but new
162
+ instances of everything else are created as needed.
163
+
164
+ Options are inherited from the parent install command unless
165
+ they don't make sense for build dependencies (in which case, they
166
+ are hard-coded, see comments below).
167
+ """
168
+
169
+ # TODO: this plays poorly with venv-based build environments, but cannot be
170
+ # fixed until pip gains better support for operating within a Python
171
+ # environment that isn't the running environment.
172
+
173
+ def __init__(
174
+ self,
175
+ *,
176
+ finder: PackageFinder,
177
+ build_tracker: BuildTracker,
178
+ wheel_cache: WheelCache,
179
+ build_constraints: Sequence[InstallRequirement] = (),
180
+ verbosity: int = 0,
181
+ ) -> None:
182
+ from pip._internal.operations.prepare import RequirementPreparer
183
+
184
+ self._finder = finder
185
+ self._build_constraints = build_constraints
186
+ self._wheel_cache = wheel_cache
187
+ self._level = 0
188
+
189
+ build_dir = TempDirectory(kind="build-env-install", globally_managed=True)
190
+ self._preparer = RequirementPreparer(
191
+ build_isolation_installer=self,
192
+ # Inherited options or state.
193
+ finder=finder,
194
+ session=finder._link_collector.session,
195
+ build_dir=build_dir.path,
196
+ build_tracker=build_tracker,
197
+ verbosity=verbosity,
198
+ # This is irrelevant as it only applies to editable requirements.
199
+ src_dir="",
200
+ # Hard-coded options (that should NOT be inherited).
201
+ download_dir=None,
202
+ build_isolation="virtual",
203
+ check_build_deps=False,
204
+ progress_bar="off",
205
+ # TODO: hash-checking should be extended to build deps, but that is
206
+ # deferred for later as it'd be a breaking change.
207
+ require_hashes=False,
208
+ use_user_site=False,
209
+ lazy_wheel=False,
210
+ legacy_resolver=False,
211
+ allow_editables=True,
212
+ )
213
+
214
+ def install(
215
+ self,
216
+ requirements: Iterable[str],
217
+ prefix: Prefix,
218
+ *,
219
+ kind: str,
220
+ for_req: InstallRequirement | None,
221
+ ) -> None:
222
+ """Install entrypoint. Manages output capturing and error handling."""
223
+ capture_logs = not logger.isEnabledFor(VERBOSE) and self._level == 0
224
+ if capture_logs:
225
+ # Hide the logs from the installation of build dependencies.
226
+ # They will be shown only if an error occurs.
227
+ capture_ctx: ContextManager[StringIO] = capture_logging()
228
+ spinner: ContextManager[None] = open_rich_spinner(f"Installing {kind}")
229
+ else:
230
+ # Otherwise, pass-through all logs (with a header).
231
+ capture_ctx, spinner = nullcontext(StringIO()), nullcontext()
232
+ logger.info("Installing %s ...", kind)
233
+
234
+ try:
235
+ self._level += 1
236
+ with spinner, capture_ctx as stream:
237
+ self._install_impl(requirements, prefix)
238
+
239
+ except DiagnosticPipError as exc:
240
+ # Format similar to a nested subprocess error, where the
241
+ # causing error is shown first, followed by the build error.
242
+ logger.info(textwrap.dedent(stream.getvalue()))
243
+ logger.error("%s", exc, extra={"rich": True})
244
+ logger.info("")
245
+ raise BuildDependencyInstallError(
246
+ for_req, requirements, cause=exc, log_lines=None
247
+ )
248
+
249
+ except Exception as exc:
250
+ logs: list[str] | None = textwrap.dedent(stream.getvalue()).splitlines()
251
+ if not capture_logs:
252
+ # If logs aren't being captured, then display the error inline
253
+ # with the rest of the logs.
254
+ logs = None
255
+ if isinstance(exc, PipError):
256
+ logger.error("%s", exc)
257
+ else:
258
+ logger.exception("pip crashed unexpectedly")
259
+ raise BuildDependencyInstallError(
260
+ for_req, requirements, cause=exc, log_lines=logs
261
+ )
262
+
263
+ finally:
264
+ self._level -= 1
265
+
266
+ def _install_impl(self, requirements: Iterable[str], prefix: Prefix) -> None:
267
+ """Core build dependency install logic."""
268
+ from pip._internal.commands.install import installed_packages_summary
269
+ from pip._internal.req import install_given_reqs
270
+ from pip._internal.req.constructors import install_req_from_line
271
+ from pip._internal.wheel_builder import build
272
+
273
+ ireqs = [install_req_from_line(req, user_supplied=True) for req in requirements]
274
+ ireqs.extend(self._build_constraints)
275
+
276
+ resolver = self._make_resolver()
277
+ resolved_set = resolver.resolve(ireqs, check_supported_wheels=True)
278
+ self._preparer.prepare_linked_requirements_more(
279
+ resolved_set.requirements.values()
280
+ )
281
+
282
+ reqs_to_build = [
283
+ r for r in resolved_set.requirements_to_install if not r.is_wheel
284
+ ]
285
+ _, build_failures = build(
286
+ reqs_to_build, self._wheel_cache, verify=True, allow_editables=True
287
+ )
288
+ if build_failures:
289
+ raise InstallWheelBuildError(build_failures)
290
+
291
+ installed = install_given_reqs(
292
+ resolver.get_installation_order(resolved_set),
293
+ prefix=prefix.path,
294
+ # Hard-coded options (that should NOT be inherited).
295
+ root=None,
296
+ home=None,
297
+ warn_script_location=False,
298
+ use_user_site=False,
299
+ # As the build environment is ephemeral, it's wasteful to
300
+ # pre-compile everything since not all modules will be used.
301
+ pycompile=False,
302
+ progress_bar="off",
303
+ # Link console scripts to the build env's interpreter, not pip's.
304
+ script_executable=prefix.venv_executable,
305
+ )
306
+
307
+ env = get_environment(list(prefix.lib_dirs))
308
+ if summary := installed_packages_summary(installed, env):
309
+ logger.info(summary)
310
+
311
+ def _make_resolver(self) -> BaseResolver:
312
+ """Create a new resolver for one time use."""
313
+ # Legacy installer never used the legacy resolver so create a
314
+ # resolvelib resolver directly. Yuck.
315
+ from pip._internal.req.constructors import install_req_from_req_string
316
+ from pip._internal.resolution.resolvelib.resolver import Resolver
317
+
318
+ return Resolver(
319
+ make_install_req=install_req_from_req_string,
320
+ # Inherited state.
321
+ preparer=self._preparer,
322
+ finder=self._finder,
323
+ wheel_cache=self._wheel_cache,
324
+ # Hard-coded options (that should NOT be inherited).
325
+ ignore_requires_python=False,
326
+ use_user_site=False,
327
+ ignore_dependencies=False,
328
+ only_dependencies=False,
329
+ ignore_installed=True,
330
+ force_reinstall=False,
331
+ upgrade_strategy="to-satisfy-only",
332
+ py_version_info=None,
333
+ )
@@ -0,0 +1,42 @@
1
+ from __future__ import annotations
2
+
3
+ import sys
4
+ from collections.abc import Iterable
5
+ from types import TracebackType
6
+ from typing import TYPE_CHECKING
7
+
8
+ from pip._internal.build_env.base import BuildEnvironment
9
+
10
+ if TYPE_CHECKING:
11
+ from pip._internal.req.req_install import InstallRequirement
12
+
13
+
14
+ class NoOpBuildEnvironment(BuildEnvironment):
15
+ """A no-op drop-in replacement for BuildEnvironment"""
16
+
17
+ def __init__(self) -> None:
18
+ self.python_executable = sys.executable
19
+
20
+ def __enter__(self) -> None:
21
+ pass
22
+
23
+ def __exit__(
24
+ self,
25
+ exc_type: type[BaseException] | None,
26
+ exc_val: BaseException | None,
27
+ exc_tb: TracebackType | None,
28
+ ) -> None:
29
+ pass
30
+
31
+ def cleanup(self) -> None:
32
+ pass
33
+
34
+ def install_requirements(
35
+ self,
36
+ requirements: Iterable[str],
37
+ prefix_as_string: str,
38
+ *,
39
+ kind: str,
40
+ for_req: InstallRequirement | None = None,
41
+ ) -> None:
42
+ raise NotImplementedError()