getstack 0.15.0__tar.gz → 0.16.0__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.
- {getstack-0.15.0 → getstack-0.16.0}/CLAUDE.md +1 -1
- {getstack-0.15.0 → getstack-0.16.0}/PKG-INFO +1 -1
- {getstack-0.15.0 → getstack-0.16.0}/pyproject.toml +1 -1
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/__init__.py +4 -0
- getstack-0.16.0/src/getstack/_async/usage.py +15 -0
- getstack-0.16.0/src/getstack/usage.py +37 -0
- {getstack-0.15.0 → getstack-0.16.0}/tests/test_parity.py +3 -2
- {getstack-0.15.0 → getstack-0.16.0}/.gitignore +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/LICENSE +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/README.md +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/scripts/verify_sign_claim_crosslang.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/__init__.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/agents.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/audit.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/credentials.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/delivery_methods.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/detector_config.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/dropoffs.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/evidence_packs.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/identity.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/inbound_webhooks.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/intents.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/llm.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/missions.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/notifications.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/partner_tenants.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/passport_session.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/passports.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/proxy.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/reviews.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/scan.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/security_events.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/services.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/skills.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/_async/team.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/agent_auth.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/agents.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/audit.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/auth.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/browser_bootstrap.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/client.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/credentials.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/delivery_methods.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/detector_config.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/dropoffs.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/errors.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/evidence_packs.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/identity.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/inbound_webhooks.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/intents.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/llm.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/missions.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/notifications.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/partner_tenants.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/passport_header_verify.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/passport_session.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/passports.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/proxy.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/py.typed +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/reviews.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/scan.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/security_events.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/services.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/sign_claim.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/skills.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/team.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/types.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/src/getstack/verify_offline.py +0 -0
- {getstack-0.15.0 → getstack-0.16.0}/tests/test_sign_claim.py +0 -0
|
@@ -12,7 +12,7 @@ Published to PyPI as `getstack`. Not a workspace member of the main monorepo
|
|
|
12
12
|
`AsyncStack`): agents, passports (+ delegate + revoke-agent/session/all +
|
|
13
13
|
list_active), services (+ connect + grant/revoke/get_permissions),
|
|
14
14
|
credentials, drop-offs (+ expire), skills, identity, audit, notifications
|
|
15
|
-
(+ update), security-events, proxy, scan, intents, missions,
|
|
15
|
+
(+ update), security-events, proxy, scan, usage, intents, missions,
|
|
16
16
|
evidence-packs, llm gateway, inbound-webhooks, partner, **team**,
|
|
17
17
|
**delivery_methods**, **detector_config**.
|
|
18
18
|
- **Offline / customer-managed crypto** (the JS headline features):
|
|
@@ -49,6 +49,7 @@ from .notifications import NotificationService
|
|
|
49
49
|
from .audit import AuditService
|
|
50
50
|
from .proxy import ProxyService as ProxySvc, ProxyResponse
|
|
51
51
|
from .scan import ScanService
|
|
52
|
+
from .usage import UsageService
|
|
52
53
|
from .security_events import SecurityEventService as SecurityEventSvc
|
|
53
54
|
from .skills import SkillService
|
|
54
55
|
from .identity import IdentityService
|
|
@@ -233,6 +234,7 @@ class Stack:
|
|
|
233
234
|
self.audit = AuditService(self._client)
|
|
234
235
|
self.proxy = ProxySvc(self._client)
|
|
235
236
|
self.scan = ScanService(self._client)
|
|
237
|
+
self.usage = UsageService(self._client)
|
|
236
238
|
self.security_events = SecurityEventSvc(self._client)
|
|
237
239
|
self.skills = SkillService(self._client)
|
|
238
240
|
self.identity = IdentityService(self._client)
|
|
@@ -378,6 +380,7 @@ class AsyncStack:
|
|
|
378
380
|
from ._async.audit import AsyncAuditService
|
|
379
381
|
from ._async.proxy import AsyncProxyService
|
|
380
382
|
from ._async.scan import AsyncScanService
|
|
383
|
+
from ._async.usage import AsyncUsageService
|
|
381
384
|
from ._async.security_events import AsyncSecurityEventService
|
|
382
385
|
from ._async.skills import AsyncSkillService
|
|
383
386
|
from ._async.identity import AsyncIdentityService
|
|
@@ -402,6 +405,7 @@ class AsyncStack:
|
|
|
402
405
|
self.audit = AsyncAuditService(self._client)
|
|
403
406
|
self.proxy = AsyncProxyService(self._client)
|
|
404
407
|
self.scan = AsyncScanService(self._client)
|
|
408
|
+
self.usage = AsyncUsageService(self._client)
|
|
405
409
|
self.security_events = AsyncSecurityEventService(self._client)
|
|
406
410
|
self.skills = AsyncSkillService(self._client)
|
|
407
411
|
self.identity = AsyncIdentityService(self._client)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""Async mirror of UsageService."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
from ..client import AsyncHttpClient
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AsyncUsageService:
|
|
11
|
+
def __init__(self, client: AsyncHttpClient):
|
|
12
|
+
self._client = client
|
|
13
|
+
|
|
14
|
+
async def get(self) -> dict[str, Any]:
|
|
15
|
+
return await self._client.request("GET", "/v1/usage")
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""Usage service — `/v1/usage` (usage + spend + earnings rollup).
|
|
2
|
+
|
|
3
|
+
The one-call rollup of what your operator consumed against its plan,
|
|
4
|
+
spent, and earned this billing period. Superset of the per-domain meters
|
|
5
|
+
(`stack.scan.usage()`, `stack.llm.usage`, `stack.proxy` counts) — one
|
|
6
|
+
authoritative shape the CLI and dashboard read too. Money fields are in
|
|
7
|
+
cents.
|
|
8
|
+
|
|
9
|
+
Example::
|
|
10
|
+
|
|
11
|
+
u = stack.usage.get()
|
|
12
|
+
p = u["consumption"]["passports"]
|
|
13
|
+
print(f"Passports {p['used']}/{p['limit']}")
|
|
14
|
+
print(f"Spent this period: ${u['spend_cents']['total'] / 100:.2f}")
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
from typing import Any
|
|
20
|
+
|
|
21
|
+
from .client import HttpClient
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class UsageService:
|
|
25
|
+
def __init__(self, client: HttpClient):
|
|
26
|
+
self._client = client
|
|
27
|
+
|
|
28
|
+
def get(self) -> dict[str, Any]:
|
|
29
|
+
"""Usage, spend, and earnings for the current billing period.
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
Dict with keys: tier, period_start, period_end, consumption
|
|
33
|
+
(per-meter {used, limit}), spend_cents (skills / llm_compute /
|
|
34
|
+
identity / overage / total), wallet_cents ({balance}), and
|
|
35
|
+
earnings_cents ({unpaid, lifetime}). All money in cents.
|
|
36
|
+
"""
|
|
37
|
+
return self._client.request("GET", "/v1/usage")
|
|
@@ -32,8 +32,8 @@ from getstack import ( # noqa: E402
|
|
|
32
32
|
# Services that must exist on BOTH clients.
|
|
33
33
|
EXPECTED_SERVICES = [
|
|
34
34
|
"agents", "passports", "credentials", "services", "dropoffs", "reviews",
|
|
35
|
-
"notifications", "audit", "proxy", "scan", "
|
|
36
|
-
"identity", "intents", "missions", "evidence_packs", "llm",
|
|
35
|
+
"notifications", "audit", "proxy", "scan", "usage", "security_events",
|
|
36
|
+
"skills", "identity", "intents", "missions", "evidence_packs", "llm",
|
|
37
37
|
"inbound_webhooks", "partner_tenants", "team", "delivery_methods",
|
|
38
38
|
"detector_config",
|
|
39
39
|
]
|
|
@@ -58,6 +58,7 @@ EXPECTED_METHODS = [
|
|
|
58
58
|
("team", "invite"),
|
|
59
59
|
("delivery_methods", "add"),
|
|
60
60
|
("detector_config", "upsert"),
|
|
61
|
+
("usage", "get"),
|
|
61
62
|
]
|
|
62
63
|
|
|
63
64
|
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|