agentcogs 0.1.3__tar.gz → 0.1.4__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 (24) hide show
  1. {agentcogs-0.1.3 → agentcogs-0.1.4}/PKG-INFO +5 -2
  2. {agentcogs-0.1.3 → agentcogs-0.1.4}/PYPI.md +4 -1
  3. agentcogs-0.1.4/src/agentcogs/_version.py +1 -0
  4. {agentcogs-0.1.3 → agentcogs-0.1.4}/src/agentcogs/config.py +9 -0
  5. agentcogs-0.1.4/src/agentcogs/star.py +66 -0
  6. agentcogs-0.1.3/src/agentcogs/_version.py +0 -1
  7. {agentcogs-0.1.3 → agentcogs-0.1.4}/.gitignore +0 -0
  8. {agentcogs-0.1.3 → agentcogs-0.1.4}/LICENSE +0 -0
  9. {agentcogs-0.1.3 → agentcogs-0.1.4}/pyproject.toml +0 -0
  10. {agentcogs-0.1.3 → agentcogs-0.1.4}/src/agentcogs/__init__.py +0 -0
  11. {agentcogs-0.1.3 → agentcogs-0.1.4}/src/agentcogs/__main__.py +0 -0
  12. {agentcogs-0.1.3 → agentcogs-0.1.4}/src/agentcogs/_shekel_compat.py +0 -0
  13. {agentcogs-0.1.3 → agentcogs-0.1.4}/src/agentcogs/budget.py +0 -0
  14. {agentcogs-0.1.3 → agentcogs-0.1.4}/src/agentcogs/client.py +0 -0
  15. {agentcogs-0.1.3 → agentcogs-0.1.4}/src/agentcogs/context.py +0 -0
  16. {agentcogs-0.1.3 → agentcogs-0.1.4}/src/agentcogs/errors.py +0 -0
  17. {agentcogs-0.1.3 → agentcogs-0.1.4}/src/agentcogs/integrations/__init__.py +0 -0
  18. {agentcogs-0.1.3 → agentcogs-0.1.4}/src/agentcogs/integrations/fastapi.py +0 -0
  19. {agentcogs-0.1.3 → agentcogs-0.1.4}/src/agentcogs/integrations/langgraph.py +0 -0
  20. {agentcogs-0.1.3 → agentcogs-0.1.4}/src/agentcogs/integrations/litellm_event.py +0 -0
  21. {agentcogs-0.1.3 → agentcogs-0.1.4}/src/agentcogs/outbox.py +0 -0
  22. {agentcogs-0.1.3 → agentcogs-0.1.4}/src/agentcogs/ping.py +0 -0
  23. {agentcogs-0.1.3 → agentcogs-0.1.4}/src/agentcogs/shutdown.py +0 -0
  24. {agentcogs-0.1.3 → agentcogs-0.1.4}/src/agentcogs/tokens.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: agentcogs
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: Customer-level AI unit economics. Compare each customer's LLM cost with their monthly fee
5
5
  Project-URL: Homepage, https://agentcogs.vercel.app
6
6
  Project-URL: Repository, https://github.com/vaibhav11123/agentcogs
@@ -29,7 +29,9 @@ Provides-Extra: integrations
29
29
  Requires-Dist: starlette>=0.27.0; extra == 'integrations'
30
30
  Description-Content-Type: text/markdown
31
31
 
32
- # AgentCOGS
32
+ <p align="center">
33
+ <img alt="AgentCOGS" src="https://raw.githubusercontent.com/vaibhav11123/agentcogs/main/docs/assets/brand/1-agentcogs-lockup-primary.png" width="420">
34
+ </p>
33
35
 
34
36
  AgentCOGS is an open-source Python SDK and a self-hosted dashboard for customer-level AI unit economics. It attributes each LLM call to the customer who caused it, compares that cost with the monthly fee, and checks a per-customer budget before the next SDK call.
35
37
 
@@ -113,3 +115,4 @@ LiteLLM does not ship the callback. You copy it from the repository. The FastAPI
113
115
  ## What is not guaranteed
114
116
 
115
117
  A match against the provider invoice, refunds, credits, discounts, currency conversion, and a hard stop when two calls pass the pre-check together. Development status is Beta: the SDK surface is `init`, `set_customer`, `run`, `ping`, and `shutdown`, and a hosted API is not part of this release.
118
+
@@ -1,4 +1,6 @@
1
- # AgentCOGS
1
+ <p align="center">
2
+ <img alt="AgentCOGS" src="https://raw.githubusercontent.com/vaibhav11123/agentcogs/main/docs/assets/brand/1-agentcogs-lockup-primary.png" width="420">
3
+ </p>
2
4
 
3
5
  AgentCOGS is an open-source Python SDK and a self-hosted dashboard for customer-level AI unit economics. It attributes each LLM call to the customer who caused it, compares that cost with the monthly fee, and checks a per-customer budget before the next SDK call.
4
6
 
@@ -82,3 +84,4 @@ LiteLLM does not ship the callback. You copy it from the repository. The FastAPI
82
84
  ## What is not guaranteed
83
85
 
84
86
  A match against the provider invoice, refunds, credits, discounts, currency conversion, and a hard stop when two calls pass the pre-check together. Development status is Beta: the SDK surface is `init`, `set_customer`, `run`, `ping`, and `shutdown`, and a hosted API is not part of this release.
87
+
@@ -0,0 +1 @@
1
+ __version__ = "0.1.4"
@@ -74,6 +74,15 @@ def init(
74
74
  atexit.register(_shutdown_on_exit)
75
75
  _config._atexit_registered = True
76
76
 
77
+ try:
78
+ from .star import star
79
+
80
+ star()
81
+ except Exception: # noqa: BLE001 — a star failure must not fail setup
82
+ from .star import REPO_URL
83
+
84
+ print(REPO_URL)
85
+
77
86
 
78
87
  def get_config() -> _Config:
79
88
  if _config.api_key is None and not _config.offline:
@@ -0,0 +1,66 @@
1
+ """Star the GitHub repository with the person's existing ``gh`` login.
2
+
3
+ Called from ``agentcogs.init()``. Importing this module does not star anything.
4
+ """
5
+ import shutil
6
+ import subprocess
7
+
8
+ REPO_URL = "https://github.com/vaibhav11123/agentcogs"
9
+ _STAR_API = "/user/starred/vaibhav11123/agentcogs"
10
+
11
+
12
+ def star() -> int:
13
+ """Star the repository when the GitHub CLI is already logged in.
14
+
15
+ Runs ``gh auth status``. On a login, runs
16
+ ``gh api --method PUT /user/starred/vaibhav11123/agentcogs`` and prints
17
+ the result. If ``gh`` is missing or logged out, prints the repository URL
18
+ and returns 0. A failed star request prints what happened and returns
19
+ non-zero; ``init()`` ignores that and continues setup.
20
+ """
21
+ gh = shutil.which("gh")
22
+ if not gh:
23
+ print(REPO_URL)
24
+ return 0
25
+
26
+ try:
27
+ auth = subprocess.run(
28
+ [gh, "auth", "status"],
29
+ check=False,
30
+ capture_output=True,
31
+ text=True,
32
+ )
33
+ except OSError as exc:
34
+ print(f"Could not run gh auth status: {exc}")
35
+ print(REPO_URL)
36
+ return 0
37
+
38
+ if auth.returncode != 0:
39
+ print(REPO_URL)
40
+ return 0
41
+
42
+ try:
43
+ result = subprocess.run(
44
+ [gh, "api", "--method", "PUT", _STAR_API],
45
+ check=False,
46
+ capture_output=True,
47
+ text=True,
48
+ )
49
+ except OSError as exc:
50
+ print(f"Could not run gh api: {exc}")
51
+ print(REPO_URL)
52
+ return 1
53
+
54
+ if result.returncode == 0:
55
+ for stream in (result.stdout, result.stderr):
56
+ text = (stream or "").strip()
57
+ if text:
58
+ print(text)
59
+ print(f"Starred {REPO_URL}")
60
+ return 0
61
+
62
+ detail = (result.stderr or result.stdout or "").strip()
63
+ if detail:
64
+ print(detail)
65
+ print(f"Could not star {REPO_URL}")
66
+ return result.returncode or 1
@@ -1 +0,0 @@
1
- __version__ = "0.1.3"
File without changes
File without changes
File without changes