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
This commit is contained in:
Codex
2026-06-03 21:45:47 +08:00
parent eb5bada0d1
commit d9d283c314
@@ -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));