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.
- {albus_cli-0.8.0 → albus_cli-0.8.2}/PKG-INFO +2 -2
- {albus_cli-0.8.0 → albus_cli-0.8.2}/pyproject.toml +2 -2
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/client.py +11 -1
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/conftest.py +6 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_cli.py +21 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/uv.lock +5 -5
- {albus_cli-0.8.0 → albus_cli-0.8.2}/.github/ISSUE_TEMPLATE/bug.yml +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/.github/pull_request_template.md +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/.github/workflows/close-pull-requests.yml +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/.gitignore +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/AGENTS.md +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/CONTRIBUTING.md +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/LICENSE +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/Makefile +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/README.md +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/RELEASING.md +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/SECURITY.md +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/install.ps1 +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/install.sh +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/pyrightconfig.json +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/setup.sh +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/__init__.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/__main__.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/__init__.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/agents.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/auth.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/billing.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/invites.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/memories.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/models.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/organization.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/secrets.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/sessions.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/status.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/tokens.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/commands/traces.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/context.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/credentials.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/docs.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/main.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/oauth.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/src/albus_cli/output.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/__init__.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_auth.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_billing.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_bump_sdk.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_credentials.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_health.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_invites.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_memories.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_models.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_oauth.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_organization.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_release_scripts.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_status.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_tokens.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tests/test_traces.py +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tools/bump-sdk +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tools/check +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tools/mirror-release +0 -0
- {albus_cli-0.8.0 → albus_cli-0.8.2}/tools/publish +0 -0
- {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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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/
|
|
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/
|
|
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
|
|
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
|
|
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
|