urun-cli 0.7.4__tar.gz → 0.7.5__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 (34) hide show
  1. {urun_cli-0.7.4 → urun_cli-0.7.5}/PKG-INFO +1 -1
  2. {urun_cli-0.7.4 → urun_cli-0.7.5}/pyproject.toml +1 -1
  3. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/api.py +39 -5
  4. {urun_cli-0.7.4 → urun_cli-0.7.5}/.gitignore +0 -0
  5. {urun_cli-0.7.4 → urun_cli-0.7.5}/CHANGELOG.md +0 -0
  6. {urun_cli-0.7.4 → urun_cli-0.7.5}/LICENSE +0 -0
  7. {urun_cli-0.7.4 → urun_cli-0.7.5}/README.md +0 -0
  8. {urun_cli-0.7.4 → urun_cli-0.7.5}/SECURITY.md +0 -0
  9. {urun_cli-0.7.4 → urun_cli-0.7.5}/hatch_build.py +0 -0
  10. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/__init__.py +0 -0
  11. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/_bin/README.md +0 -0
  12. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/buildlogs.py +0 -0
  13. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/catalog.py +0 -0
  14. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/cli.py +0 -0
  15. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/client_tokens.py +0 -0
  16. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/config.py +0 -0
  17. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/deps.py +0 -0
  18. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/dev.py +0 -0
  19. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/devconsole.py +0 -0
  20. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/devstream.py +0 -0
  21. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/discovery.py +0 -0
  22. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/errors.py +0 -0
  23. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/fleet.py +0 -0
  24. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/frontend_launch.py +0 -0
  25. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/launch_auth.py +0 -0
  26. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/manifest.py +0 -0
  27. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/nodes.py +0 -0
  28. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/openai_proxy_bin.py +0 -0
  29. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/repo_deps.py +0 -0
  30. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/retry.py +0 -0
  31. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/runtime_health.py +0 -0
  32. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/rust.py +0 -0
  33. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/scratch.py +0 -0
  34. {urun_cli-0.7.4 → urun_cli-0.7.5}/src/urun/serve.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: urun-cli
3
- Version: 0.7.4
3
+ Version: 0.7.5
4
4
  Summary: End-user CLI for deploying apps to urun
5
5
  Project-URL: Homepage, https://urun.sh
6
6
  Project-URL: Repository, https://github.com/urun-sh/urun-cli
@@ -20,7 +20,7 @@ name = "urun-cli"
20
20
  # so every merge remains on the already-published version until this value is
21
21
  # advanced. Wiring semantic-release into CI remains separate work; this patch
22
22
  # bump is the minimal release unblock (post-v0.6.3 fixes + the Rust feature minor).
23
- version = "0.7.4"
23
+ version = "0.7.5"
24
24
  description = "End-user CLI for deploying apps to urun"
25
25
  readme = "README.md"
26
26
  requires-python = ">=3.11"
@@ -45,6 +45,39 @@ class ApiClient:
45
45
  self.backoff = backoff
46
46
  self.on_retry = on_retry
47
47
 
48
+ @property
49
+ def session_api_origin(self) -> str:
50
+ """The BARE gateway origin the session-API (``/api/...``) surface lives on.
51
+
52
+ The CLI's ``api_url`` is the REST base carrying the ``/v1`` prefix
53
+ (``https://api.urun.sh/v1``) — but ``/v1/<name>`` routes are the
54
+ Supabase EDGE surfaces (``/v1/apps``, ``/v1/cli/*``, ...), while the
55
+ session-api-ts HTTP surface is served on the BARE origin
56
+ (``https://api.urun.sh/api/...`` behind Envoy). Sending ``/api/*``
57
+ through the ``/v1`` base hits the edge runtime's unknown-function 404
58
+ (``Requested function was not found``) — proven live on
59
+ ``GET /v1/api/scratch`` (2026-09-30, dev proof). One deterministic
60
+ transform, loud on surprise: strip exactly ONE trailing ``/v1`` path
61
+ segment (the mirror of :func:`urun.cli.sdk_base_url`); a bare origin
62
+ is returned as-is; anything else is a hard error.
63
+ """
64
+ parsed = urllib.parse.urlsplit(self.base_url)
65
+ if parsed.path == "/v1":
66
+ return urllib.parse.urlunsplit((parsed.scheme, parsed.netloc, "", "", ""))
67
+ if parsed.path in ("", "/"):
68
+ return self.base_url
69
+ raise UrunError(
70
+ f"cannot derive the session-API origin from api_url {self.base_url!r}: "
71
+ "expected a bare origin or a single trailing /v1 path segment "
72
+ "(the /api/* session-API surface lives on the bare gateway origin)"
73
+ )
74
+
75
+ def _url(self, path: str) -> str:
76
+ """Request URL for ``path``: ``/api/*`` → the session-API origin, rest → REST base."""
77
+ if path.startswith("/api/"):
78
+ return self.session_api_origin + path
79
+ return self.base_url + path
80
+
48
81
  def register_manifest(self, manifest: dict[str, Any]) -> dict[str, Any]:
49
82
  return self._json("POST", "/register-manifest", manifest)
50
83
 
@@ -691,9 +724,10 @@ class ApiClient:
691
724
  """
692
725
  payload = self._request_bytes(
693
726
  "GET",
694
- self.base_url
695
- + self._path(
696
- f"/api/scratch/{urllib.parse.quote(scratch_id, safe='')}/logs", {"tail": tail}
727
+ self._url(
728
+ self._path(
729
+ f"/api/scratch/{urllib.parse.quote(scratch_id, safe='')}/logs", {"tail": tail}
730
+ )
697
731
  ),
698
732
  None,
699
733
  timeout=self.timeout,
@@ -867,7 +901,7 @@ class ApiClient:
867
901
  if body is None
868
902
  else json.dumps(body, sort_keys=True, separators=(",", ":")).encode("utf-8")
869
903
  )
870
- url = self.base_url + path
904
+ url = self._url(path)
871
905
  try:
872
906
  payload = self._request_bytes(method, url, data, timeout=self.timeout)
873
907
  except ApiError:
@@ -892,7 +926,7 @@ class ApiClient:
892
926
  if body is None
893
927
  else json.dumps(body, sort_keys=True, separators=(",", ":")).encode("utf-8")
894
928
  )
895
- url = self.base_url + path
929
+ url = self._url(path)
896
930
 
897
931
  try:
898
932
  payload = retry_call(
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes