general-augment-cli 0.1.0__py3-none-any.whl
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.
- general_augment_cli-0.1.0.dist-info/METADATA +180 -0
- general_augment_cli-0.1.0.dist-info/RECORD +42 -0
- general_augment_cli-0.1.0.dist-info/WHEEL +4 -0
- general_augment_cli-0.1.0.dist-info/entry_points.txt +2 -0
- platform_cli/__init__.py +5 -0
- platform_cli/branding.py +27 -0
- platform_cli/client.py +179 -0
- platform_cli/commands/__init__.py +1 -0
- platform_cli/commands/approvals.py +150 -0
- platform_cli/commands/auth.py +96 -0
- platform_cli/commands/billing.py +143 -0
- platform_cli/commands/channels.py +212 -0
- platform_cli/commands/deploy.py +72 -0
- platform_cli/commands/dev.py +38 -0
- platform_cli/commands/doctor.py +170 -0
- platform_cli/commands/identity.py +433 -0
- platform_cli/commands/init.py +55 -0
- platform_cli/commands/integrate.py +94 -0
- platform_cli/commands/keys.py +116 -0
- platform_cli/commands/logs.py +43 -0
- platform_cli/commands/mcp.py +258 -0
- platform_cli/commands/memory.py +316 -0
- platform_cli/commands/mock.py +30 -0
- platform_cli/commands/model_providers.py +226 -0
- platform_cli/commands/observability.py +174 -0
- platform_cli/commands/onboarding.py +72 -0
- platform_cli/commands/projects.py +302 -0
- platform_cli/commands/skills.py +116 -0
- platform_cli/commands/smoke.py +280 -0
- platform_cli/commands/status.py +49 -0
- platform_cli/commands/tools.py +179 -0
- platform_cli/commands/users.py +150 -0
- platform_cli/commands/validate.py +96 -0
- platform_cli/commands/verify.py +648 -0
- platform_cli/config.py +114 -0
- platform_cli/errors.py +103 -0
- platform_cli/local_mock.py +1392 -0
- platform_cli/main.py +130 -0
- platform_cli/openapi.py +1048 -0
- platform_cli/output.py +47 -0
- platform_cli/readiness.py +176 -0
- platform_cli/runtime.py +22 -0
platform_cli/output.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Rich output helpers for the standalone CLI."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
from rich.console import Console
|
|
9
|
+
from rich.panel import Panel
|
|
10
|
+
from rich.table import Table
|
|
11
|
+
|
|
12
|
+
console = Console()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def print_json(payload: Any) -> None:
|
|
16
|
+
"""Print JSON using Rich syntax highlighting."""
|
|
17
|
+
console.print_json(json.dumps(payload, indent=2, sort_keys=True))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def print_success(message: str) -> None:
|
|
21
|
+
"""Print a success message."""
|
|
22
|
+
console.print(f"[green]{message}[/green]")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def print_warning(message: str) -> None:
|
|
26
|
+
"""Print a warning message."""
|
|
27
|
+
console.print(f"[yellow]{message}[/yellow]")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def print_error(message: str) -> None:
|
|
31
|
+
"""Print an error message."""
|
|
32
|
+
console.print(f"[red]{message}[/red]")
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def panel(title: str, body: str) -> None:
|
|
36
|
+
"""Print a titled panel."""
|
|
37
|
+
console.print(Panel(body, title=title, border_style="cyan"))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def table(title: str, columns: list[str], rows: list[list[object]]) -> None:
|
|
41
|
+
"""Print a simple table."""
|
|
42
|
+
rich_table = Table(title=title)
|
|
43
|
+
for column in columns:
|
|
44
|
+
rich_table.add_column(column)
|
|
45
|
+
for row in rows:
|
|
46
|
+
rich_table.add_row(*(str(cell) for cell in row))
|
|
47
|
+
console.print(rich_table)
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
"""Shared General Augment readiness checklist helpers."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
READINESS_SCHEMA_VERSION = "general-augment-readiness/v1"
|
|
8
|
+
|
|
9
|
+
READINESS_CHECKS: tuple[dict[str, str], ...] = (
|
|
10
|
+
{
|
|
11
|
+
"key": "api_ready",
|
|
12
|
+
"label": "API ready",
|
|
13
|
+
"description": "Hosted API readiness returned healthy dependencies.",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"key": "project_created",
|
|
17
|
+
"label": "Project created",
|
|
18
|
+
"description": "The tenant project exists and can be resolved by the CLI.",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"key": "project_key_created",
|
|
22
|
+
"label": "Project key created",
|
|
23
|
+
"description": "At least one project-scoped server API key exists.",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"key": "project_key_execution",
|
|
27
|
+
"label": "Project key execution",
|
|
28
|
+
"description": "The configured project key can call /v1/responses.",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"key": "first_response_passed",
|
|
32
|
+
"label": "First response passed",
|
|
33
|
+
"description": "A hosted test turn completed successfully.",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"key": "tools_configured",
|
|
37
|
+
"label": "Tools configured",
|
|
38
|
+
"description": "The tool registry is reachable for this project.",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"key": "runtime_policy_visible",
|
|
42
|
+
"label": "Runtime policy visible",
|
|
43
|
+
"description": "Tenant model routing and Hermes-facing policy are visible.",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"key": "memory_tested",
|
|
47
|
+
"label": "Memory tested",
|
|
48
|
+
"description": "Memory store, search, profile, and delete checks passed.",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"key": "trace_visible",
|
|
52
|
+
"label": "Trace visible",
|
|
53
|
+
"description": "Observability returned trace rows for follow-up debugging.",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"key": "usage_limits_visible",
|
|
57
|
+
"label": "Usage limits visible",
|
|
58
|
+
"description": "Usage totals and plan limits are visible.",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"key": "channel_status_known",
|
|
62
|
+
"label": "Channel status known",
|
|
63
|
+
"description": "Channel readiness state is visible for the project.",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"key": "billing_state_known",
|
|
67
|
+
"label": "Billing state known",
|
|
68
|
+
"description": "The project exposes a billing or plan state.",
|
|
69
|
+
},
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
CHECK_MAPPING: dict[str, tuple[str, ...]] = {
|
|
73
|
+
"api_ready": ("api_ready",),
|
|
74
|
+
"project_created": ("project_resolved",),
|
|
75
|
+
"project_key_created": ("project_api_key",),
|
|
76
|
+
"project_key_execution": ("project_key_execution",),
|
|
77
|
+
"first_response_passed": ("agent_test",),
|
|
78
|
+
"tools_configured": ("tool_registry",),
|
|
79
|
+
"runtime_policy_visible": ("runtime_policy_model_routing",),
|
|
80
|
+
"memory_tested": ("memory_store", "memory_search", "memory_profile", "memory_delete"),
|
|
81
|
+
"trace_visible": ("observability",),
|
|
82
|
+
"usage_limits_visible": ("usage", "usage_limits"),
|
|
83
|
+
"channel_status_known": ("channel_status",),
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def build_readiness_checklist(
|
|
88
|
+
checks: list[dict[str, Any]],
|
|
89
|
+
*,
|
|
90
|
+
project: dict[str, Any],
|
|
91
|
+
) -> dict[str, Any]:
|
|
92
|
+
"""Build the canonical readiness checklist from raw verification checks."""
|
|
93
|
+
|
|
94
|
+
by_name = {str(item.get("name")): item for item in checks}
|
|
95
|
+
items = [
|
|
96
|
+
_readiness_item(definition, by_name, project=project) for definition in READINESS_CHECKS
|
|
97
|
+
]
|
|
98
|
+
return {
|
|
99
|
+
"version": READINESS_SCHEMA_VERSION,
|
|
100
|
+
"status": _checklist_status(items),
|
|
101
|
+
"items": items,
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def _readiness_item(
|
|
106
|
+
definition: dict[str, str],
|
|
107
|
+
checks: dict[str, dict[str, Any]],
|
|
108
|
+
*,
|
|
109
|
+
project: dict[str, Any],
|
|
110
|
+
) -> dict[str, Any]:
|
|
111
|
+
"""Build one readiness item."""
|
|
112
|
+
|
|
113
|
+
key = definition["key"]
|
|
114
|
+
if key == "billing_state_known":
|
|
115
|
+
plan = project.get("plan") or project.get("pricing_tier")
|
|
116
|
+
status = "PASS" if plan else "SKIP"
|
|
117
|
+
detail = f"plan={plan}" if plan else "project plan or pricing tier is not exposed"
|
|
118
|
+
return _item(definition, status, detail, source_checks=[])
|
|
119
|
+
|
|
120
|
+
source_names = CHECK_MAPPING[key]
|
|
121
|
+
source_checks = [checks.get(name) for name in source_names]
|
|
122
|
+
missing = [
|
|
123
|
+
name for name, check in zip(source_names, source_checks, strict=True) if check is None
|
|
124
|
+
]
|
|
125
|
+
present = [check for check in source_checks if check is not None]
|
|
126
|
+
if missing:
|
|
127
|
+
return _item(
|
|
128
|
+
definition,
|
|
129
|
+
"SKIP",
|
|
130
|
+
f"not checked: {', '.join(missing)}",
|
|
131
|
+
source_checks=list(source_names),
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
statuses = {str(check.get("status")) for check in present}
|
|
135
|
+
if "FAIL" in statuses:
|
|
136
|
+
status = "FAIL"
|
|
137
|
+
elif statuses == {"PASS"}:
|
|
138
|
+
status = "PASS"
|
|
139
|
+
elif "SKIP" in statuses:
|
|
140
|
+
status = "SKIP"
|
|
141
|
+
else:
|
|
142
|
+
status = "FAIL"
|
|
143
|
+
detail = "; ".join(
|
|
144
|
+
f"{check.get('name')}: {check.get('detail')}" for check in present if check.get("detail")
|
|
145
|
+
)
|
|
146
|
+
return _item(definition, status, detail, source_checks=list(source_names))
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def _item(
|
|
150
|
+
definition: dict[str, str],
|
|
151
|
+
status: str,
|
|
152
|
+
detail: str,
|
|
153
|
+
*,
|
|
154
|
+
source_checks: list[str],
|
|
155
|
+
) -> dict[str, Any]:
|
|
156
|
+
"""Return a single readiness item."""
|
|
157
|
+
|
|
158
|
+
return {
|
|
159
|
+
"key": definition["key"],
|
|
160
|
+
"label": definition["label"],
|
|
161
|
+
"description": definition["description"],
|
|
162
|
+
"status": status,
|
|
163
|
+
"detail": detail,
|
|
164
|
+
"source_checks": source_checks,
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def _checklist_status(items: list[dict[str, Any]]) -> str:
|
|
169
|
+
"""Roll up readiness status."""
|
|
170
|
+
|
|
171
|
+
statuses = {str(item.get("status")) for item in items}
|
|
172
|
+
if "FAIL" in statuses:
|
|
173
|
+
return "FAIL"
|
|
174
|
+
if "SKIP" in statuses:
|
|
175
|
+
return "PARTIAL"
|
|
176
|
+
return "PASS"
|
platform_cli/runtime.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""Typer runtime object shared by command modules."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
from platform_cli.client import PlatformClient
|
|
9
|
+
from platform_cli.config import CLIConfig
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass(frozen=True)
|
|
13
|
+
class Runtime:
|
|
14
|
+
"""CLI runtime state after config and overrides are loaded."""
|
|
15
|
+
|
|
16
|
+
config: CLIConfig
|
|
17
|
+
config_path: Path
|
|
18
|
+
loaded_config_path: Path
|
|
19
|
+
|
|
20
|
+
def client(self) -> PlatformClient:
|
|
21
|
+
"""Create a platform API client for one command."""
|
|
22
|
+
return PlatformClient(self.config)
|