@ouro.bot/cli 0.1.0-alpha.524 → 0.1.0-alpha.525
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.
package/changelog.json
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.525",
|
|
6
|
+
"changes": [
|
|
7
|
+
"`ouro status --json` now returns parseable daemon status JSON instead of the human ANSI status board, giving automation and review gates a truthful machine-readable status surface.",
|
|
8
|
+
"Unavailable-daemon status checks with `--json` now still return structured JSON with socket and health-file context instead of falling back to human prose.",
|
|
9
|
+
"Adds CLI parse and execution coverage for the status JSON flag so future status rendering changes cannot silently break the automation contract again."
|
|
10
|
+
]
|
|
11
|
+
},
|
|
4
12
|
{
|
|
5
13
|
"version": "0.1.0-alpha.524",
|
|
6
14
|
"changes": [
|
|
@@ -469,6 +469,22 @@ function writeProviderRepairSummary(deps, title, degraded) {
|
|
|
469
469
|
const blocks = degraded.map((entry) => (0, readiness_repair_1.renderReadinessIssueNextSteps)(readinessIssueFromDegraded(entry)).join("\n"));
|
|
470
470
|
deps.writeStdout([title, ...blocks].join("\n\n"));
|
|
471
471
|
}
|
|
472
|
+
function formatDaemonStatusJsonOutput(response) {
|
|
473
|
+
return JSON.stringify(response.data ?? {
|
|
474
|
+
ok: response.ok,
|
|
475
|
+
...(response.summary ? { summary: response.summary } : {}),
|
|
476
|
+
...(response.message ? { message: response.message } : {}),
|
|
477
|
+
...(response.error ? { error: response.error } : {}),
|
|
478
|
+
}, null, 2);
|
|
479
|
+
}
|
|
480
|
+
function daemonUnavailableStatusJsonOutput(socketPath, healthFilePath) {
|
|
481
|
+
return JSON.stringify({
|
|
482
|
+
ok: false,
|
|
483
|
+
error: "daemon unavailable",
|
|
484
|
+
socketPath,
|
|
485
|
+
...(healthFilePath ? { healthFilePath } : {}),
|
|
486
|
+
}, null, 2);
|
|
487
|
+
}
|
|
472
488
|
/**
|
|
473
489
|
* Layer 4: render a per-agent drift advisory block to stdout. Called from
|
|
474
490
|
* the `--no-repair` summary path when one or more enabled agents have a
|
|
@@ -7456,7 +7472,9 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
|
|
|
7456
7472
|
return message;
|
|
7457
7473
|
}
|
|
7458
7474
|
if (command.kind === "daemon.status" && (0, cli_render_1.isDaemonUnavailableError)(error)) {
|
|
7459
|
-
const message =
|
|
7475
|
+
const message = command.json
|
|
7476
|
+
? daemonUnavailableStatusJsonOutput(deps.socketPath, deps.healthFilePath)
|
|
7477
|
+
: (0, cli_render_1.daemonUnavailableStatusOutput)(deps.socketPath, deps.healthFilePath);
|
|
7460
7478
|
deps.writeStdout(message);
|
|
7461
7479
|
return message;
|
|
7462
7480
|
}
|
|
@@ -7469,7 +7487,9 @@ async function runOuroCli(args, deps = (0, cli_defaults_1.createDefaultOuroCliDe
|
|
|
7469
7487
|
}
|
|
7470
7488
|
const fallbackMessage = response.summary ?? response.message ?? (response.ok ? "ok" : `error: ${response.error ?? "unknown error"}`);
|
|
7471
7489
|
const message = command.kind === "daemon.status"
|
|
7472
|
-
?
|
|
7490
|
+
? command.json
|
|
7491
|
+
? formatDaemonStatusJsonOutput(response)
|
|
7492
|
+
: (0, cli_render_1.formatDaemonStatusOutput)(response, fallbackMessage)
|
|
7473
7493
|
: fallbackMessage;
|
|
7474
7494
|
deps.writeStdout(message);
|
|
7475
7495
|
return message;
|
|
@@ -1430,12 +1430,16 @@ function parseOuroCommand(args) {
|
|
|
1430
1430
|
return { kind: "daemon.stop" };
|
|
1431
1431
|
if (head === "status") {
|
|
1432
1432
|
const { agent, rest } = extractAgentFlag(args.slice(1));
|
|
1433
|
+
const json = rest.includes("--json");
|
|
1434
|
+
const unknown = rest.filter((token) => token !== "--json");
|
|
1433
1435
|
if (agent) {
|
|
1434
|
-
if (
|
|
1435
|
-
throw new Error("Usage: ouro status --agent <name>");
|
|
1436
|
+
if (unknown.length > 0 || json)
|
|
1437
|
+
throw new Error("Usage: ouro status [--json] OR ouro status --agent <name>");
|
|
1436
1438
|
return { kind: "provider.status", agent };
|
|
1437
1439
|
}
|
|
1438
|
-
|
|
1440
|
+
if (unknown.length > 0)
|
|
1441
|
+
throw new Error("Usage: ouro status [--json] OR ouro status --agent <name>");
|
|
1442
|
+
return { kind: "daemon.status", ...(json ? { json: true } : {}) };
|
|
1439
1443
|
}
|
|
1440
1444
|
if (head === "use")
|
|
1441
1445
|
return parseProviderUseCommand(args.slice(1));
|