albus-cli 0.8.0__tar.gz → 0.8.2__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 (63) hide show
  1. {albus_cli-0.8.0 → albus_cli-0.8.2}/PKG-INFO +2 -2
  2. {albus_cli-0.8.0 → albus_cli-0.8.2}/pyproject.toml +2 -2
  3. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/client.py +11 -1
  4. {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/conftest.py +6 -0
  5. {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_cli.py +21 -0
  6. {albus_cli-0.8.0 → albus_cli-0.8.2}/uv.lock +5 -5
  7. {albus_cli-0.8.0 → albus_cli-0.8.2}/.github/ISSUE_TEMPLATE/bug.yml +0 -0
  8. {albus_cli-0.8.0 → albus_cli-0.8.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  9. {albus_cli-0.8.0 → albus_cli-0.8.2}/.github/pull_request_template.md +0 -0
  10. {albus_cli-0.8.0 → albus_cli-0.8.2}/.github/workflows/close-pull-requests.yml +0 -0
  11. {albus_cli-0.8.0 → albus_cli-0.8.2}/.gitignore +0 -0
  12. {albus_cli-0.8.0 → albus_cli-0.8.2}/AGENTS.md +0 -0
  13. {albus_cli-0.8.0 → albus_cli-0.8.2}/CONTRIBUTING.md +0 -0
  14. {albus_cli-0.8.0 → albus_cli-0.8.2}/LICENSE +0 -0
  15. {albus_cli-0.8.0 → albus_cli-0.8.2}/Makefile +0 -0
  16. {albus_cli-0.8.0 → albus_cli-0.8.2}/README.md +0 -0
  17. {albus_cli-0.8.0 → albus_cli-0.8.2}/RELEASING.md +0 -0
  18. {albus_cli-0.8.0 → albus_cli-0.8.2}/SECURITY.md +0 -0
  19. {albus_cli-0.8.0 → albus_cli-0.8.2}/install.ps1 +0 -0
  20. {albus_cli-0.8.0 → albus_cli-0.8.2}/install.sh +0 -0
  21. {albus_cli-0.8.0 → albus_cli-0.8.2}/pyrightconfig.json +0 -0
  22. {albus_cli-0.8.0 → albus_cli-0.8.2}/setup.sh +0 -0
  23. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/__init__.py +0 -0
  24. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/__main__.py +0 -0
  25. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/__init__.py +0 -0
  26. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/agents.py +0 -0
  27. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/auth.py +0 -0
  28. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/billing.py +0 -0
  29. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/invites.py +0 -0
  30. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/memories.py +0 -0
  31. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/models.py +0 -0
  32. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/organization.py +0 -0
  33. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/secrets.py +0 -0
  34. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/sessions.py +0 -0
  35. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/status.py +0 -0
  36. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/tokens.py +0 -0
  37. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/traces.py +0 -0
  38. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/context.py +0 -0
  39. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/credentials.py +0 -0
  40. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/docs.py +0 -0
  41. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/main.py +0 -0
  42. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/oauth.py +0 -0
  43. {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/output.py +0 -0
  44. {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/__init__.py +0 -0
  45. {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_auth.py +0 -0
  46. {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_billing.py +0 -0
  47. {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_bump_sdk.py +0 -0
  48. {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_credentials.py +0 -0
  49. {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_health.py +0 -0
  50. {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_invites.py +0 -0
  51. {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_memories.py +0 -0
  52. {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_models.py +0 -0
  53. {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_oauth.py +0 -0
  54. {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_organization.py +0 -0
  55. {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_release_scripts.py +0 -0
  56. {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_status.py +0 -0
  57. {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_tokens.py +0 -0
  58. {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_traces.py +0 -0
  59. {albus_cli-0.8.0 → albus_cli-0.8.2}/tools/bump-sdk +0 -0
  60. {albus_cli-0.8.0 → albus_cli-0.8.2}/tools/check +0 -0
  61. {albus_cli-0.8.0 → albus_cli-0.8.2}/tools/mirror-release +0 -0
  62. {albus_cli-0.8.0 → albus_cli-0.8.2}/tools/publish +0 -0
  63. {albus_cli-0.8.0 → albus_cli-0.8.2}/tools/release_state.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: albus-cli
3
- Version: 0.8.0
3
+ Version: 0.8.2
4
4
  Summary: Command-line client for the Albus REST API
5
5
  Project-URL: Homepage, https://github.com/albusgroup/albus-cli
6
6
  Project-URL: Repository, https://github.com/albusgroup/albus-cli
@@ -9,7 +9,7 @@ Author: Albus
9
9
  License-Expression: MIT
10
10
  License-File: LICENSE
11
11
  Requires-Python: >=3.11
12
- Requires-Dist: albus-sdk==0.16.0
12
+ Requires-Dist: albus-sdk==0.16.1
13
13
  Requires-Dist: typer<0.28,>=0.26.8
14
14
  Description-Content-Type: text/markdown
15
15
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "albus-cli"
7
- version = "0.8.0"
7
+ version = "0.8.2"
8
8
  description = "Command-line client for the Albus REST API"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -13,7 +13,7 @@ authors = [{ name = "Albus" }]
13
13
  dependencies = [
14
14
  # Pinned, not floated: the published CLI states the one SDK version it was
15
15
  # tested against, and bumping it is a reviewed edit made when releasing.
16
- "albus-sdk==0.16.0",
16
+ "albus-sdk==0.16.1",
17
17
  "typer>=0.26.8,<0.28",
18
18
  ]
19
19
 
@@ -8,6 +8,7 @@ wrong credential sends an agent somewhere there is nothing to fix."""
8
8
  import os
9
9
  import time
10
10
  from dataclasses import dataclass
11
+ from importlib.metadata import version
11
12
 
12
13
  import httpx
13
14
  from albus_sdk import Albus
@@ -24,6 +25,10 @@ ORGANIZATION_ENV = "ALBUS_ORG"
24
25
  # one already, and the server ignores the header for it.
25
26
  ORGANIZATION_HEADER = "X-Albus-Organization"
26
27
 
28
+ # Every request names the CLI first, before the SDK's own product token,
29
+ # so server logs can tell a command from a script on the same SDK.
30
+ USER_AGENT = f"albus-cli/{version('albus-cli')}"
31
+
27
32
  # Renew slightly early: an access token that outlives the request it is
28
33
  # sent on is not worth the 401.
29
34
  EXPIRY_LEEWAY = 60.0
@@ -288,13 +293,18 @@ def _built(
288
293
  credential: str | None = None,
289
294
  ) -> Albus:
290
295
  headers = {ORGANIZATION_HEADER: organization} if organization else {}
291
- return Albus(
296
+ api = Albus(
292
297
  api_key=credential,
293
298
  server_url=base_url,
294
299
  client=httpx.Client(
295
300
  follow_redirects=True, timeout=timeout, headers=headers
296
301
  ),
297
302
  )
303
+ # The SDK sets User-Agent on each request itself, overriding the
304
+ # transport's headers, so the identification goes on its configuration.
305
+ configuration = api.sdk_configuration
306
+ configuration.user_agent = f"{USER_AGENT} {configuration.user_agent}"
307
+ return api
298
308
 
299
309
 
300
310
  def _current(base_url: str, stored: Credential) -> Credential:
@@ -321,6 +321,11 @@ class FakeBilling:
321
321
  )
322
322
 
323
323
 
324
+ @dataclass
325
+ class FakeConfiguration:
326
+ user_agent: str = "speakeasy-sdk/python"
327
+
328
+
324
329
  @dataclass
325
330
  class FakeAlbus:
326
331
  init_kwargs: list[dict[str, Any]] = field(default_factory=list)
@@ -338,6 +343,7 @@ class FakeAlbus:
338
343
  self.traces = FakeTraces(self.calls)
339
344
  self.organization = FakeOrganization(self.calls)
340
345
  self.billing = FakeBilling(self.calls)
346
+ self.sdk_configuration = FakeConfiguration()
341
347
 
342
348
  def __call__(self, **kwargs: Any) -> "FakeAlbus":
343
349
  self.init_kwargs.append(kwargs)
@@ -196,6 +196,27 @@ def test_base_url_option_overrides_the_default_server(
196
196
  assert albus.init_kwargs[0]["server_url"] == "http://localhost:8080/api"
197
197
 
198
198
 
199
+ def test_every_request_names_the_cli_in_its_user_agent() -> None:
200
+ sent: list[httpx.Request] = []
201
+
202
+ def answer(request: httpx.Request) -> httpx.Response:
203
+ sent.append(request)
204
+ return httpx.Response(200, json={"status": "ok"})
205
+
206
+ api = client.public_client("http://albus.test/api", timeout=None)
207
+ api.sdk_configuration.client = httpx.Client(
208
+ transport=httpx.MockTransport(answer)
209
+ )
210
+
211
+ api.health.health()
212
+
213
+ assert (
214
+ sent[0]
215
+ .headers["User-Agent"]
216
+ .startswith(f"{client.USER_AGENT} speakeasy-sdk/python")
217
+ )
218
+
219
+
199
220
  def sent_organization(albus: FakeAlbus) -> str | None:
200
221
  """The organization header the built transport adds to every
201
222
  request, or None when it sends none."""
@@ -8,7 +8,7 @@ resolution-markers = [
8
8
 
9
9
  [[package]]
10
10
  name = "albus-cli"
11
- version = "0.8.0"
11
+ version = "0.8.2"
12
12
  source = { editable = "." }
13
13
  dependencies = [
14
14
  { name = "albus-sdk" },
@@ -24,7 +24,7 @@ dev = [
24
24
 
25
25
  [package.metadata]
26
26
  requires-dist = [
27
- { name = "albus-sdk", specifier = "==0.16.0" },
27
+ { name = "albus-sdk", specifier = "==0.16.1" },
28
28
  { name = "typer", specifier = ">=0.26.8,<0.28" },
29
29
  ]
30
30
 
@@ -37,16 +37,16 @@ dev = [
37
37
 
38
38
  [[package]]
39
39
  name = "albus-sdk"
40
- version = "0.16.0"
40
+ version = "0.16.1"
41
41
  source = { registry = "https://pypi.org/simple" }
42
42
  dependencies = [
43
43
  { name = "httpcore" },
44
44
  { name = "httpx" },
45
45
  { name = "pydantic" },
46
46
  ]
47
- sdist = { url = "https://files.pythonhosted.org/packages/99/b1/17e68fe0ee1af1205b3133b41d68b40c60d1895fe561de4085617fd6ad56/albus_sdk-0.16.0.tar.gz", hash = "sha256:61fd36f55cbd0fa59f6dd038caeb1fe7364aa0e590c7341517ae116595b5b548", size = 89838, upload-time = "2026-09-08T02:46:29.364Z" }
47
+ sdist = { url = "https://files.pythonhosted.org/packages/a1/8e/007e87d2337f6d5688bdbdcb206c1f1cda45645e51c1cd1d39bafdd58651/albus_sdk-0.16.1.tar.gz", hash = "sha256:2aca610e5b9e2202c4826e5eee65f58bc62b5c1c046f4ca6c29c78137b03ed56", size = 89839, upload-time = "2026-09-08T14:30:41.199Z" }
48
48
  wheels = [
49
- { url = "https://files.pythonhosted.org/packages/26/0e/22e4d6437a71c3faa7caeca4bb5d7af5a491b043c46e715e30aab905ca6a/albus_sdk-0.16.0-py3-none-any.whl", hash = "sha256:8409e81c1745043ca41fc5783ec89f8c206987bb9f0e62f7bfacae7e4e8d3633", size = 146438, upload-time = "2026-09-08T02:46:28.184Z" },
49
+ { url = "https://files.pythonhosted.org/packages/7f/c4/be7fc85666e12332b2ae6b781f46fa30dc27c5ca57ccfc7ef43b8550ff3a/albus_sdk-0.16.1-py3-none-any.whl", hash = "sha256:502aab756bb165806a88e53d26022f503704661ccb09bb0d54d4ed17f94377ee", size = 146345, upload-time = "2026-09-08T14:30:39.786Z" },
50
50
  ]
51
51
 
52
52
  [[package]]
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