fix(web-probe): expose exact command artifacts
This commit is contained in:
@@ -37,6 +37,10 @@ function renderWebObserveStatusTable(value: Record<string, unknown>): string {
|
||||
const heartbeat = record(observer?.heartbeat);
|
||||
const diagnostics = record(observer?.diagnostics) ?? record(value.diagnostics);
|
||||
const commands = record(observer?.commands);
|
||||
const exactCommand = record(observer?.exactCommand);
|
||||
const exactResult = record(exactCommand?.result);
|
||||
const exactError = record(exactCommand?.error);
|
||||
const exactErrorDetails = record(exactError?.details);
|
||||
const tails = record(observer?.tails);
|
||||
const result = record(value.result);
|
||||
const samples = Array.isArray(tails?.samples) ? tails.samples.map(record).filter((item): item is Record<string, unknown> => item !== null).slice(-5) : [];
|
||||
@@ -158,6 +162,19 @@ function renderWebObserveStatusTable(value: Record<string, unknown>): string {
|
||||
]]),
|
||||
"",
|
||||
] : []),
|
||||
...(Object.keys(exactCommand).length > 0 ? [
|
||||
"Exact command:",
|
||||
webObserveTable(["COMMAND", "TYPE", "PHASE", "OK", "STATUS", "REPORT_SHA", "DETAIL"], [[
|
||||
webObserveShort(webObserveText(exactCommand.commandId), 40),
|
||||
exactCommand.type,
|
||||
exactCommand.phase,
|
||||
exactCommand.ok,
|
||||
exactResult.status,
|
||||
webObserveShort(webObserveText(exactResult.reportSha256 ?? exactErrorDetails.reportSha256), 32),
|
||||
webObserveShort(webObserveText(exactError.message ?? exactResult.reportPath ?? exactErrorDetails.reportPath), 96),
|
||||
]]),
|
||||
"",
|
||||
] : []),
|
||||
"Recent samples:",
|
||||
webObserveTable(["SEQ", "TS", "PATH", "ROUTE_SESSION", "ACTIVE_SESSION", "MSG", "TRACE"], samples.length > 0 ? samples.map((sample) => [
|
||||
sample.seq,
|
||||
@@ -255,7 +272,7 @@ function renderWebObserveCommandTable(value: Record<string, unknown>): string {
|
||||
] : []),
|
||||
"",
|
||||
"Next:",
|
||||
` bun scripts/cli.ts web-probe observe status ${id}`,
|
||||
` bun scripts/cli.ts web-probe observe status ${id} --command-id ${webObserveText(value.commandId)}`,
|
||||
` bun scripts/cli.ts web-probe observe analyze ${id}`,
|
||||
` bun scripts/cli.ts web-probe observe collect ${id} --view turn-summary --command-id ${webObserveText(value.commandId)}`,
|
||||
"",
|
||||
|
||||
Reference in New Issue
Block a user