Keep seal-use probe's stdout to a single JSON document
`runProbe` wrote its progress notes and three separate JSON blobs to stdout, so every consumer parsing the output — `seal-use probe | jq`, the Agent Harness — got prose interleaved with data. The command is also in the help registry, so this was a documented command breaking its own contract. The probe now returns one `ProbeResult` and the command prints it through `printJson`; the `[probe] …` narration moves to stderr, which is the diagnostics channel. The dev-script entry point keeps the same payload and its exit code. Classified read-only too: `probe` reads tenant state and writes nothing, but the allow-list had no entry, so the MCP read-only tool refused it. Its trailing token is an enterprise selector rather than a verb, so the matcher accepts the bare form and bare-plus-selector while still refusing a third token.
This commit is contained in:
1 parent
289ef664da
commit
97bf3301a3
5 files changed
+190
-19
No files matched your search
@@ -1,8 +1,10 @@
|
||||
import { runProbe } from "../../probe.js";
|
||||
import { stringOption } from "../parser.js";
|
||||
import { printJson } from "../printer.js";
|
||||
import type { ParsedArgs } from "../types.js";
|
||||
|
||||
export async function handleProbeCommand(action: string | undefined, maybeName: string | undefined, args: ParsedArgs) {
|
||||
const corpId = maybeName ?? stringOption(args.options.corp) ?? (action && action !== "--corp" ? action : undefined);
|
||||
await runProbe({ corpId });
|
||||
// One JSON document on stdout; runProbe narrates progress on stderr only.
|
||||
printJson(await runProbe({ corpId }));
|
||||
}
|
||||
Reference in new issue
Block a user