refactorai-cli 0.2.12__tar.gz → 0.2.13__tar.gz

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 (32) hide show
  1. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/PKG-INFO +1 -1
  2. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/pyproject.toml +1 -1
  3. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/__init__.py +1 -1
  4. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/runtime_manager.py +16 -2
  5. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli.egg-info/PKG-INFO +1 -1
  6. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/README.md +0 -0
  7. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/auth.py +0 -0
  8. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/client.py +0 -0
  9. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/commands/__init__.py +0 -0
  10. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/commands/auth_cmds.py +0 -0
  11. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/commands/engine_cmds.py +0 -0
  12. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/commands/model_cmds.py +0 -0
  13. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/commands/rules_cmds.py +0 -0
  14. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/commands/run_cmds.py +0 -0
  15. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/commands/runtime_cmds.py +0 -0
  16. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/commands/runtime_proxy_cmds.py +0 -0
  17. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/commands/setup_cmds.py +0 -0
  18. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/control_plane.py +0 -0
  19. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/credentials.py +0 -0
  20. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/local_constitution.py +0 -0
  21. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/local_engine_runtime.py +0 -0
  22. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/local_paths.py +0 -0
  23. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/main.py +0 -0
  24. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/model_policy.py +0 -0
  25. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/settings.py +0 -0
  26. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli/setup_flow.py +0 -0
  27. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli.egg-info/SOURCES.txt +0 -0
  28. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli.egg-info/dependency_links.txt +0 -0
  29. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli.egg-info/entry_points.txt +0 -0
  30. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli.egg-info/requires.txt +0 -0
  31. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/refactorai_cli.egg-info/top_level.txt +0 -0
  32. {refactorai_cli-0.2.12 → refactorai_cli-0.2.13}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: refactorai-cli
3
- Version: 0.2.12
3
+ Version: 0.2.13
4
4
  Summary: Local-first CLI for the refactor platform
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "refactorai-cli"
3
- version = "0.2.12"
3
+ version = "0.2.13"
4
4
  description = "Local-first CLI for the refactor platform"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -5,4 +5,4 @@ the shared `refactor_core` pipeline from a project folder while staying
5
5
  authenticated to the hosted platform via a developer key.
6
6
  """
7
7
 
8
- __version__ = "0.2.12"
8
+ __version__ = "0.2.13"
@@ -14,6 +14,7 @@ import platform
14
14
  from dataclasses import dataclass
15
15
  from datetime import datetime, timezone
16
16
  from pathlib import Path
17
+ from urllib.parse import urlparse
17
18
 
18
19
  import httpx
19
20
 
@@ -153,9 +154,11 @@ def resolve_runtime_manifest(*, channel: str = "stable", timeout: float = 20.0)
153
154
 
154
155
 
155
156
  def download_artifact(url: str, *, timeout: float = 60.0) -> bytes:
156
- auth_header = _runtime_auth_header()
157
+ headers: dict[str, str] = {}
158
+ if _should_send_runtime_auth(url):
159
+ headers["Authorization"] = _runtime_auth_header()
157
160
  try:
158
- response = httpx.get(url, headers={"Authorization": auth_header}, timeout=timeout)
161
+ response = httpx.get(url, headers=headers, timeout=max(float(timeout), 300.0))
159
162
  except httpx.HTTPError as exc:
160
163
  raise RuntimeError(f"Could not download runtime artifact: {exc}") from exc
161
164
  if response.status_code >= 400:
@@ -163,6 +166,17 @@ def download_artifact(url: str, *, timeout: float = 60.0) -> bytes:
163
166
  return response.content
164
167
 
165
168
 
169
+ def _should_send_runtime_auth(url: str) -> bool:
170
+ try:
171
+ artifact_host = str(urlparse(url).netloc or "").strip().lower()
172
+ platform_host = str(urlparse(platform_url()).netloc or "").strip().lower()
173
+ except Exception:
174
+ return True
175
+ if not artifact_host or not platform_host:
176
+ return True
177
+ return artifact_host == platform_host
178
+
179
+
166
180
  def _runtime_auth_header() -> str:
167
181
  try:
168
182
  lease = ensure_lease()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: refactorai-cli
3
- Version: 0.2.12
3
+ Version: 0.2.13
4
4
  Summary: Local-first CLI for the refactor platform
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown