From d9d283c314e7bfdde6422e064b6363e6e68dbad7 Mon Sep 17 00:00:00 2001 From: Codex Date: Wed, 3 Jun 2026 21:45:47 +0800 Subject: [PATCH] fix(v0.2): move workspace/debug-probe evidence handler to top-level command in device-host-cli for #773 Live CLI verification at 74.48.78.17:19667 showed that workspace.evidence dispatched correctly through cloud-api and the executor (executor returned text with the actual error), but the device-host-cli threw unsupported command because the new evidence subcommand was nested under command=build instead of being its own top-level command. The args shape for workspace.evidence from deviceHostArgs is [workspace, evidence, kind, ...options], so the main() match in device-host-cli should hit at the workspace group level, not under . Same fix for debug-probe. After the move, readJobEvidence is dispatched with the right kindPrefix (keil-build for workspace.evidence kind=build, keil-download for debug-probe.evidence kind=download) and the optional jobId from rest[1]. Tail defaults to 200 lines, --full for the entire log. Tracked-by: pikasTech/HWLAB#773 --- .../device-pod-cli/assets/device-host-cli.mjs | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/skills/device-pod-cli/assets/device-host-cli.mjs b/skills/device-pod-cli/assets/device-host-cli.mjs index ed0466b4..af4494a8 100644 --- a/skills/device-pod-cli/assets/device-host-cli.mjs +++ b/skills/device-pod-cli/assets/device-host-cli.mjs @@ -1966,14 +1966,15 @@ async function main() { if (sub === 'start') return startJob('keil-build', parseArgs(rest.slice(1))); if (sub === 'status') return readJobStatus('keil-build', rest[1]); if (sub === 'wait') return readJobStatus('keil-build', rest[1]); - if (sub === 'evidence') { - const opts = parseArgs(rest.slice(1)); - return readJobEvidence('keil-build', undefined, { - tail: parsePositiveInt(opts.tail, 200), - full: opts.full === true || opts.full === 'true', - target: opts.target - }); - } + } + if (command === 'evidence') { + const sub = rest[0] || 'build'; + const opts = parseArgs(rest.slice(1)); + return readJobEvidence(sub === 'download' ? 'keil-download' : 'keil-build', rest[1], { + tail: parsePositiveInt(opts.tail, 200), + full: opts.full === true || opts.full === 'true', + target: opts.target + }); } } if (group === 'debug-probe') { @@ -1985,14 +1986,14 @@ async function main() { const sub = rest[0] || 'start'; if (sub === 'start') return startJob('keil-download', parseArgs(rest.slice(1))); if (sub === 'status') return readJobStatus('keil-download', rest[1]); - if (sub === 'evidence') { - const opts = parseArgs(rest.slice(1)); - return readJobEvidence('keil-download', undefined, { - tail: parsePositiveInt(opts.tail, 200), - full: opts.full === true || opts.full === 'true', - target: opts.target - }); - } + } + if (command === 'evidence') { + const opts = parseArgs(rest.slice(1)); + return readJobEvidence('keil-download', rest[1], { + tail: parsePositiveInt(opts.tail, 200), + full: opts.full === true || opts.full === 'true', + target: opts.target + }); } if (command === 'reset') return await resetRun(); if (command === 'launch-flash') return await launchFlash(parseArgs(rest));