machina-cli 0.4.7__tar.gz → 0.4.8__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.
- {machina_cli-0.4.7 → machina_cli-0.4.8}/CHANGELOG.md +5 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/PKG-INFO +1 -1
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs/harness-loop-kit/provision.py +26 -9
- {machina_cli-0.4.7 → machina_cli-0.4.8}/pyproject.toml +1 -1
- machina_cli-0.4.8/src/machina_cli/commands/context_graph.py +165 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/main.py +2 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/.github/workflows/ci.yml +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/.github/workflows/release.yml +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/.gitignore +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/CLAUDE.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/README.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs/agentic-harness-loop.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs/credentials.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs/harness-loop-kit/PLAYBOOK-SCORECARD.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs/harness-loop-kit/README.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs/harness-loop-kit/VALIDATION.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs/harness-loop-kit/context-verify.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs/loop-tools-connector.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/.gitignore +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/.vitepress/config.mts +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/.vitepress/theme/custom.css +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/.vitepress/theme/index.ts +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/README.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/commands/agent.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/commands/config.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/commands/connector.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/commands/credentials.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/commands/deploy.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/commands/document.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/commands/execution.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/commands/factory.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/commands/login.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/commands/loop.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/commands/mapping.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/commands/org.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/commands/project.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/commands/prompt.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/commands/skills.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/commands/sports.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/commands/template.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/commands/update.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/commands/workflow.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/guide/authentication.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/guide/configuration.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/guide/installation.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/guide/quickstart.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/guide/repl.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/guide/running.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/index.md +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/package-lock.json +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/package.json +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/public/favicon.ico +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/public/machina-logo-dark.png +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/public/machina-logo-light.png +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/docs-site/vercel.json +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/install.ps1 +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/install.sh +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/__init__.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/browser_auth.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/client.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/__init__.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/agent.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/auth.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/config_cmd.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/connect.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/connector.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/credentials.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/deploy.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/document.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/execution.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/factory.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/loop.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/mapping.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/mcp.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/org.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/project.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/prompt.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/skills.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/sports.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/template.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/commands/workflow.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/config.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/factory_client.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/loop_client.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/models/__init__.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/project_client.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/repl.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/src/machina_cli/updater.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/tests/__init__.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/tests/test_cli_output.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/tests/test_connect.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/tests/test_mcp_url.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/tests/test_org_usage.py +0 -0
- {machina_cli-0.4.7 → machina_cli-0.4.8}/tests/test_sports_integration.py +0 -0
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to machina-cli are documented here.
|
|
4
4
|
|
|
5
|
+
## [0.4.8] - 2026-06-30
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- **`machina context-graph status`** — see the self-healing / monitoring layer from the CLI (the same truth the Studio Context Graph page shows). Per project it lists the verified edges + health (e.g. `market → team linked 52.5%`, `market ↔ price quality degraded 34.1%`), the live surface verdict (odds/errors, with session-normalized signals + exception count), and the self-heal agents with their beat status — and warns when a beat is `active` but `scheduled=True` (silently not firing). `--org` rolls it up across every project in the org; `--json` for scripts. Answers "what self-healing is running, where, and how healthy" without opening each project one by one.
|
|
9
|
+
|
|
5
10
|
## [0.4.7] - 2026-06-30
|
|
6
11
|
|
|
7
12
|
### Added
|
|
@@ -164,7 +164,7 @@ def _fetch_conversations(a):
|
|
|
164
164
|
# posthog.ai_events table (input/output_choices, anchored on trace_id, 30d retention);
|
|
165
165
|
# events carries only metadata. Key read from the posthog-surface-config doc (same as
|
|
166
166
|
# the surface-verify defense). Returns recent (user-context, bot-answer, category).
|
|
167
|
-
import urllib.request
|
|
167
|
+
import urllib.request, urllib.error, time
|
|
168
168
|
try:
|
|
169
169
|
from core.document.controller import document_search
|
|
170
170
|
except Exception as ex:
|
|
@@ -197,13 +197,26 @@ def _fetch_conversations(a):
|
|
|
197
197
|
"FROM posthog.ai_events AS a INNER JOIN t ON a.trace_id=t.tid "
|
|
198
198
|
"ORDER BY t.ts DESC LIMIT "+str(limit))
|
|
199
199
|
body=json.dumps({"query":{"kind":"HogQLQuery","query":q}}).encode()
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
200
|
+
url="https://us.posthog.com/api/projects/"+pid+"/query/"
|
|
201
|
+
hdr={"Authorization":"Bearer "+key,"Content-Type":"application/json"}
|
|
202
|
+
data=None
|
|
203
|
+
# The PostHog query API returns intermittent 5xx under load (same class as the
|
|
204
|
+
# org-usage scan). Retry transient failures before giving up so a flaky moment
|
|
205
|
+
# doesn't fail the whole turn.
|
|
206
|
+
for attempt in range(3):
|
|
207
|
+
try:
|
|
208
|
+
req=urllib.request.Request(url,data=body,headers=hdr,method="POST")
|
|
209
|
+
with urllib.request.urlopen(req,timeout=45) as resp:
|
|
210
|
+
data=json.loads(resp.read() or "{}")
|
|
211
|
+
break
|
|
212
|
+
except urllib.error.HTTPError as ex:
|
|
213
|
+
if ex.code>=500 and attempt<2:
|
|
214
|
+
time.sleep(1.5*(attempt+1)); continue
|
|
215
|
+
return "fetch_conversations posthog error: HTTP %s"%ex.code
|
|
216
|
+
except Exception as ex:
|
|
217
|
+
if attempt<2:
|
|
218
|
+
time.sleep(1.5*(attempt+1)); continue
|
|
219
|
+
return "fetch_conversations posthog error: "+str(ex)[:140]
|
|
207
220
|
out=[]
|
|
208
221
|
for row in (data.get("results") or []):
|
|
209
222
|
out.append({"category":row[0],"user_ctx":(row[1] or "")[:240],"bot":(row[2] or "")[:240]})
|
|
@@ -456,7 +469,11 @@ def definitions():
|
|
|
456
469
|
"outputs": {"session_id": "$.get('session_id')", "assistant_message": "$.get('assistant_message','')"}}]}
|
|
457
470
|
# loop-beat is the durability tick (scheduling move). Created INACTIVE so it
|
|
458
471
|
# does not run in a shared pod until a reviewer opts in by setting status:active.
|
|
459
|
-
|
|
472
|
+
# NOTE scheduled=False: the platform's frequency beat (_tick_legacy_agent_frequency)
|
|
473
|
+
# only dispatches agents with scheduled=False + status=active + config-frequency.
|
|
474
|
+
# scheduled=True marks an agent as cron-driven (needs a real schedule) and, without
|
|
475
|
+
# one, it is silently NEVER dispatched — so a freq-based beat MUST be scheduled=False.
|
|
476
|
+
beat = {"name": "loop-beat", "title": "Loop Beat", "status": "inactive", "scheduled": False,
|
|
460
477
|
"description": "durability tick: resume orphaned active sessions (set status:active to enable)",
|
|
461
478
|
"context": {"config-frequency": 0.5}, "context-agent": {},
|
|
462
479
|
"workflows": [{"name": "loop-resume", "description": "resume an orphaned active session", "inputs": {}, "outputs": {"resumed_session": "$.get('resumed_session')"}}]}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"""Context Graph — self-healing / monitoring status across projects.
|
|
2
|
+
|
|
3
|
+
Answers "what self-healing is running, where, and how healthy is it" — the same
|
|
4
|
+
truth the Studio Context Graph page shows, from the CLI. Derives status live from
|
|
5
|
+
each project's context_graph_* docs + its self-heal agents (no extra state).
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import json as json_lib
|
|
9
|
+
from typing import Optional
|
|
10
|
+
|
|
11
|
+
import typer
|
|
12
|
+
from rich.console import Console
|
|
13
|
+
from rich.table import Table
|
|
14
|
+
|
|
15
|
+
from machina_cli.client import MachinaClient
|
|
16
|
+
from machina_cli.config import get_config
|
|
17
|
+
from machina_cli.project_client import ProjectClient
|
|
18
|
+
|
|
19
|
+
app = typer.Typer(help="Context Graph — self-healing status")
|
|
20
|
+
console = Console()
|
|
21
|
+
|
|
22
|
+
# agents that make up the self-healing / monitoring layer
|
|
23
|
+
SELF_HEAL_AGENTS = ("surface-watch-beat", "loop-beat", "loop-runner")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _docs(client: ProjectClient, name: str, page_size: int = 12) -> list:
|
|
27
|
+
r = client.post(
|
|
28
|
+
"document/search",
|
|
29
|
+
{"compact": False, "filters": {"name": name}, "page": 1, "page_size": page_size, "sorters": ["updated", -1]},
|
|
30
|
+
)
|
|
31
|
+
d = r.get("data")
|
|
32
|
+
return (d.get("data") if isinstance(d, dict) else d) or []
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def _edge_summary(edge: str, h: dict) -> tuple:
|
|
36
|
+
"""(badge, color, detail) for one context_graph_health edge."""
|
|
37
|
+
if edge == "market<->team_urn":
|
|
38
|
+
unresolved = h.get("linkable_unresolved")
|
|
39
|
+
if unresolved and unresolved > 0:
|
|
40
|
+
return ("unlinked", "red", f"{unresolved} unresolved · {h.get('team_markets', 0)} named")
|
|
41
|
+
lr = h.get("link_rate_pct")
|
|
42
|
+
return ("linked", "green", f"{lr}% linked" if lr is not None else f"{h.get('resolved', 0)} linked")
|
|
43
|
+
rate = h.get("broken_rate_pct")
|
|
44
|
+
if rate is not None:
|
|
45
|
+
return ("degraded" if rate > 0 else "ok", "red" if rate > 0 else "green", f"{rate}%")
|
|
46
|
+
return ("ok", "green", "—")
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def _collect(project_id: str) -> dict:
|
|
50
|
+
"""Live self-healing status for one project. Raises on unreachable/no-access."""
|
|
51
|
+
client = ProjectClient(project_id)
|
|
52
|
+
edges = {}
|
|
53
|
+
for doc in _docs(client, "context_graph_health", 12):
|
|
54
|
+
h = (doc.get("value") or {}).get("health") or {}
|
|
55
|
+
e = h.get("edge")
|
|
56
|
+
if e and e not in edges:
|
|
57
|
+
edges[e] = h
|
|
58
|
+
surf_docs = _docs(client, "context_graph_surface_health", 1)
|
|
59
|
+
surface = (surf_docs[0].get("value") or {}) if surf_docs else None
|
|
60
|
+
agents = {}
|
|
61
|
+
ar = client.post("agent/search", {"filters": {}, "page": 1, "page_size": 100})
|
|
62
|
+
ad = ar.get("data")
|
|
63
|
+
for a in (ad.get("data") if isinstance(ad, dict) else ad) or []:
|
|
64
|
+
if a.get("name") in SELF_HEAL_AGENTS:
|
|
65
|
+
agents[a["name"]] = {
|
|
66
|
+
"status": a.get("status"),
|
|
67
|
+
"scheduled": a.get("scheduled"),
|
|
68
|
+
"freq": (a.get("context") or {}).get("config-frequency"),
|
|
69
|
+
"last": str(a.get("last_execution_date") or a.get("updated") or "")[:19],
|
|
70
|
+
}
|
|
71
|
+
return {"edges": edges, "surface": surface, "agents": agents}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def _render_one(name: str, pid: str, st: dict) -> None:
|
|
75
|
+
console.print(f"\n[bold]{name}[/] [dim]({pid})[/]")
|
|
76
|
+
if not st["edges"] and not st["surface"] and not st["agents"]:
|
|
77
|
+
console.print(" [dim]no self-healing provisioned here[/]")
|
|
78
|
+
return
|
|
79
|
+
for edge, h in st["edges"].items():
|
|
80
|
+
badge, color, detail = _edge_summary(edge, h)
|
|
81
|
+
console.print(f" edge [bold]{edge:24}[/] [{color}]{badge:9}[/] [dim]{detail}[/]")
|
|
82
|
+
s = st["surface"]
|
|
83
|
+
if s:
|
|
84
|
+
v = s.get("verdict", "?")
|
|
85
|
+
h = s.get("health") or {}
|
|
86
|
+
color = "green" if v == "ok" else "yellow" if v == "low_traffic" else "red"
|
|
87
|
+
sig = f"sessions {h.get('sessions', h.get('users', 0))} · {h.get('exceptions', 0)} exc · err/s {h.get('err_per_session', h.get('err_per_user', 0))}"
|
|
88
|
+
console.print(f" surface [bold]odds/errors[/] [{color}]{v:9}[/] [dim]{sig}[/]")
|
|
89
|
+
for an in SELF_HEAL_AGENTS:
|
|
90
|
+
a = st["agents"].get(an)
|
|
91
|
+
if not a:
|
|
92
|
+
continue
|
|
93
|
+
alive = a["status"] == "active" and a["scheduled"] is False
|
|
94
|
+
c = "green" if a["status"] == "active" else "dim"
|
|
95
|
+
note = "" if a["status"] != "active" else (f" · freq={a['freq']}" + ("" if alive else " · [red]scheduled=True (won't fire)[/]"))
|
|
96
|
+
console.print(f" agent [bold]{an:20}[/] [{c}]{a['status']}[/]{note} [dim]{a['last']}[/]")
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
@app.command("status")
|
|
100
|
+
def status(
|
|
101
|
+
project_id: Optional[str] = typer.Option(None, "--project", "-p", help="Project ID (default: selected project)"),
|
|
102
|
+
org: bool = typer.Option(False, "--org", help="Roll up across all projects in the org"),
|
|
103
|
+
json_output: bool = typer.Option(False, "--json", "-j", help="Output as JSON"),
|
|
104
|
+
):
|
|
105
|
+
"""Show the self-healing / monitoring status (edges, surface, beats)."""
|
|
106
|
+
if not org:
|
|
107
|
+
pid = project_id or get_config("default_project_id")
|
|
108
|
+
if not pid:
|
|
109
|
+
console.print("[red]No project selected. Run `machina project use <id>` or pass --project.[/red]")
|
|
110
|
+
raise typer.Exit(1)
|
|
111
|
+
st = _collect(pid)
|
|
112
|
+
if json_output:
|
|
113
|
+
console.print_json(json_lib.dumps(st, default=str))
|
|
114
|
+
return
|
|
115
|
+
_render_one(get_config("default_project_name") or pid, pid, st)
|
|
116
|
+
return
|
|
117
|
+
|
|
118
|
+
# --org: iterate the org's projects
|
|
119
|
+
core = MachinaClient()
|
|
120
|
+
res = core.post("user/projects/search", {"filters": {}, "page": 1, "page_size": 200, "sorters": ["name", 1]})
|
|
121
|
+
projects = res.get("data", []) or []
|
|
122
|
+
rows, skipped = [], 0
|
|
123
|
+
for p in projects:
|
|
124
|
+
pid = p.get("project_id") or p.get("id")
|
|
125
|
+
pname = p.get("project_name") or p.get("name") or pid
|
|
126
|
+
if not pid:
|
|
127
|
+
continue
|
|
128
|
+
try:
|
|
129
|
+
st = _collect(pid)
|
|
130
|
+
except (SystemExit, Exception): # noqa: BLE001
|
|
131
|
+
skipped += 1
|
|
132
|
+
continue
|
|
133
|
+
if not st["edges"] and not st["surface"] and not st["agents"]:
|
|
134
|
+
continue # not provisioned — omit from the rollup
|
|
135
|
+
rows.append((pname, pid, st))
|
|
136
|
+
|
|
137
|
+
if json_output:
|
|
138
|
+
console.print_json(json_lib.dumps({"projects": [{"name": n, "id": i, **s} for n, i, s in rows], "skipped": skipped}, default=str))
|
|
139
|
+
return
|
|
140
|
+
|
|
141
|
+
if not rows:
|
|
142
|
+
console.print("[yellow]No projects have self-healing provisioned (or reachable).[/yellow]")
|
|
143
|
+
return
|
|
144
|
+
table = Table(title="Self-healing across the org")
|
|
145
|
+
table.add_column("Project", style="bold")
|
|
146
|
+
table.add_column("Edges", justify="right")
|
|
147
|
+
table.add_column("Surface")
|
|
148
|
+
table.add_column("Beat")
|
|
149
|
+
for pname, pid, st in rows:
|
|
150
|
+
n_edges = str(len(st["edges"]))
|
|
151
|
+
s = st["surface"]
|
|
152
|
+
surf = "—"
|
|
153
|
+
if s:
|
|
154
|
+
v = s.get("verdict", "?")
|
|
155
|
+
surf = f"[{'green' if v == 'ok' else 'yellow' if v == 'low_traffic' else 'red'}]{v}[/]"
|
|
156
|
+
beat = st["agents"].get("surface-watch-beat") or st["agents"].get("loop-beat")
|
|
157
|
+
if beat:
|
|
158
|
+
live = beat["status"] == "active" and beat["scheduled"] is False
|
|
159
|
+
beat_s = "[green]live[/]" if live else ("[red]active/scheduled=True[/]" if beat["status"] == "active" else "[dim]off[/]")
|
|
160
|
+
else:
|
|
161
|
+
beat_s = "[dim]none[/]"
|
|
162
|
+
table.add_row(pname, n_edges, surf, beat_s)
|
|
163
|
+
console.print(table)
|
|
164
|
+
if skipped:
|
|
165
|
+
console.print(f"[dim]{skipped} project(s) skipped (unreachable / no access).[/]")
|
|
@@ -11,6 +11,7 @@ from machina_cli.commands import (
|
|
|
11
11
|
auth, org, project, credentials, deploy, config_cmd,
|
|
12
12
|
workflow, agent, template, execution, skills,
|
|
13
13
|
connector, mapping, prompt, document, sports, factory, loop, mcp, connect,
|
|
14
|
+
context_graph,
|
|
14
15
|
)
|
|
15
16
|
from machina_cli.commands.auth import do_login
|
|
16
17
|
|
|
@@ -143,6 +144,7 @@ app.add_typer(template.app, name="template", help="Template management")
|
|
|
143
144
|
app.add_typer(skills.app, name="skills", help="Skills management")
|
|
144
145
|
app.add_typer(execution.app, name="execution", help="Execution management")
|
|
145
146
|
app.add_typer(loop.app, name="loop", help="Durable agentic turn loop (harness)")
|
|
147
|
+
app.add_typer(context_graph.app, name="context-graph", help="Self-healing / monitoring status across projects")
|
|
146
148
|
app.add_typer(factory.app, name="factory", help="Trigger Factory coding-agent builds")
|
|
147
149
|
app.add_typer(connector.app, name="connector", help="Connector management")
|
|
148
150
|
app.add_typer(mapping.app, name="mapping", help="Mapping management")
|
|
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
|
|
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
|