maos-agent 0.1.0__tar.gz → 0.1.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.
- maos_agent-0.1.2/LICENSE +21 -0
- {maos_agent-0.1.0 → maos_agent-0.1.2}/PKG-INFO +3 -12
- {maos_agent-0.1.0 → maos_agent-0.1.2}/README.md +1 -11
- maos_agent-0.1.2/maos_agent/__init__.py +4 -0
- {maos_agent-0.1.0 → maos_agent-0.1.2/maos_agent}/decorators.py +2 -16
- {maos_agent-0.1.0 → maos_agent-0.1.2/maos_agent}/metrics.py +7 -5
- {maos_agent-0.1.0 → maos_agent-0.1.2}/pyproject.toml +1 -1
- {maos_agent-0.1.0 → maos_agent-0.1.2}/.gitignore +0 -0
- {maos_agent-0.1.0 → maos_agent-0.1.2}/.python-version +0 -0
- {maos_agent-0.1.0 → maos_agent-0.1.2}/CONTRIBUTION.md +0 -0
- {maos_agent-0.1.0 → maos_agent-0.1.2}/examples/simple-worker.py +0 -0
- {maos_agent-0.1.0 → maos_agent-0.1.2/maos_agent}/core.py +0 -0
- {maos_agent-0.1.0 → maos_agent-0.1.2/maos_agent}/lifecycle.py +0 -0
maos_agent-0.1.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 maosproject.io
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: maos-agent
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: The Observability & Resilience SDK for Maos AI Agents
|
|
5
5
|
Project-URL: Homepage, https://github.com/maosproject-dev/maos-agent
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/maosproject-dev/maos-agent/issues
|
|
7
7
|
Author-email: Maos AI <support@maosproject.io>
|
|
8
|
+
License-File: LICENSE
|
|
8
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
9
10
|
Classifier: Operating System :: OS Independent
|
|
10
11
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -13,16 +14,6 @@ Requires-Python: >=3.9
|
|
|
13
14
|
Requires-Dist: prometheus-client>=0.17.0
|
|
14
15
|
Description-Content-Type: text/markdown
|
|
15
16
|
|
|
16
|
-
**CTO here.**
|
|
17
|
-
|
|
18
|
-
Here is the `README.md`.
|
|
19
|
-
|
|
20
|
-
It is written to be "Marketing-Engineering" aligned. It doesn't just say *how* to use it; it explains *why* a developer needs it (to stop their agents from dying silently on Spot instances).
|
|
21
|
-
|
|
22
|
-
I’ve added badges, a clear "Quick Start," and a section linking the metrics directly to the Grafana dashboard we just built.
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
17
|
# Maos Agent SDK
|
|
27
18
|
|
|
28
19
|
The official Python SDK for building resilient, observable AI Agents on the **Maos Platform**.
|
|
@@ -144,4 +135,4 @@ We welcome contributions! Please see [CONTRIBUTING.md](https://www.google.com/se
|
|
|
144
135
|
|
|
145
136
|
---
|
|
146
137
|
|
|
147
|
-
**Built by [
|
|
138
|
+
**Built by [Maosproject Platform](https://www.google.com/search?q=https://maosproject.io) — The Control Plane for Autonomous Compute.**
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
**CTO here.**
|
|
2
|
-
|
|
3
|
-
Here is the `README.md`.
|
|
4
|
-
|
|
5
|
-
It is written to be "Marketing-Engineering" aligned. It doesn't just say *how* to use it; it explains *why* a developer needs it (to stop their agents from dying silently on Spot instances).
|
|
6
|
-
|
|
7
|
-
I’ve added badges, a clear "Quick Start," and a section linking the metrics directly to the Grafana dashboard we just built.
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
1
|
# Maos Agent SDK
|
|
12
2
|
|
|
13
3
|
The official Python SDK for building resilient, observable AI Agents on the **Maos Platform**.
|
|
@@ -129,4 +119,4 @@ We welcome contributions! Please see [CONTRIBUTING.md](https://www.google.com/se
|
|
|
129
119
|
|
|
130
120
|
---
|
|
131
121
|
|
|
132
|
-
**Built by [
|
|
122
|
+
**Built by [Maosproject Platform](https://www.google.com/search?q=https://maosproject.io) — The Control Plane for Autonomous Compute.**
|
|
@@ -31,23 +31,9 @@ class TaskContext:
|
|
|
31
31
|
duration = time.time() - self.start_time
|
|
32
32
|
status = "error" if exc_type else "success"
|
|
33
33
|
|
|
34
|
-
# 1. Record Success/Fail Counter
|
|
35
34
|
self.metrics.record_task_success(self.name, status)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
# We manually observe the histogram since we managed the time
|
|
39
|
-
from .metrics import TASK_DURATION
|
|
40
|
-
TASK_DURATION.labels(
|
|
41
|
-
task_type=self.name,
|
|
42
|
-
**self.metrics.labels
|
|
43
|
-
).observe(duration)
|
|
44
|
-
|
|
45
|
-
# 3. Record Steps (The "Loop of Death" check)
|
|
46
|
-
from .metrics import STEPS_PER_GOAL
|
|
47
|
-
STEPS_PER_GOAL.labels(
|
|
48
|
-
task_type=self.name,
|
|
49
|
-
**self.metrics.labels
|
|
50
|
-
).observe(self.steps)
|
|
35
|
+
self.metrics.record_steps(self.name, self.steps)
|
|
36
|
+
self.metrics.record_duration(self.name, duration)
|
|
51
37
|
|
|
52
38
|
if exc_type:
|
|
53
39
|
self.logger.error(f"Task '{self.name}' failed: {exc_val}")
|
|
@@ -45,9 +45,9 @@ class MetricsManager:
|
|
|
45
45
|
# Start the Prometheus exporter server automatically
|
|
46
46
|
try:
|
|
47
47
|
start_http_server(port)
|
|
48
|
-
print(f"[
|
|
48
|
+
print(f"[Maosproject] Metrics server started on port {port}")
|
|
49
49
|
except Exception as e:
|
|
50
|
-
print(f"[
|
|
50
|
+
print(f"[Maosproject] Warning: Could not start metrics server: {e}")
|
|
51
51
|
|
|
52
52
|
def record_tool(self, tool_name: str, status: str = "success"):
|
|
53
53
|
TOOL_CALLS.labels(tool_name=tool_name, status=status, **self.labels).inc()
|
|
@@ -58,6 +58,8 @@ class MetricsManager:
|
|
|
58
58
|
def record_task_success(self, task_type: str, status: str):
|
|
59
59
|
TASK_SUCCESS.labels(task_type=task_type, status=status, **self.labels).inc()
|
|
60
60
|
|
|
61
|
-
def
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
def record_duration(self, task_type: str, seconds: float):
|
|
62
|
+
TASK_DURATION.labels(task_type=task_type, **self.labels).observe(seconds)
|
|
63
|
+
|
|
64
|
+
def record_steps(self, task_type: str, count: int):
|
|
65
|
+
STEPS_PER_GOAL.labels(task_type=task_type, **self.labels).observe(count)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|