mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 21:20:46 +00:00
Summary: - Adds parser-derived exec approval command-span metadata through host registration, gateway validation, generated Swift models, Control UI parsing/rendering, tests, and changelog. - Reproducibility: not applicable. this is a feature PR rather than a bug report. The before/after behavior is ... rom current main’s plain command rendering to PR-head span generation, validation, and Web rendering tests. Automerge notes: - PR branch already contained follow-up commit before automerge: refactor: use neutral exec command spans - PR branch already contained follow-up commit before automerge: refactor: simplify exec command span extraction - PR branch already contained follow-up commit before automerge: refactor: inline approval command span params - PR branch already contained follow-up commit before automerge: fix: keep exec approval spans lazy - PR branch already contained follow-up commit before automerge: build: refresh exec approval protocol models - PR branch already contained follow-up commit before automerge: Highlight exec command risks in Web approvals Validation: - ClawSweeper review passed for head8d9977eb53. - Required merge gates passed before the squash merge. Prepared head SHA:8d9977eb53Review: https://github.com/openclaw/openclaw/pull/77153#issuecomment-4368769228 Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
11 lines
474 B
TypeScript
11 lines
474 B
TypeScript
import { explainShellCommand, formatCommandSpans } from "../infra/command-explainer/index.js";
|
|
import type { ExecApprovalCommandSpan } from "../infra/exec-approvals.js";
|
|
|
|
export async function resolveExecApprovalCommandSpans(
|
|
command: string,
|
|
): Promise<ExecApprovalCommandSpan[] | undefined> {
|
|
const explanation = await explainShellCommand(command);
|
|
const commandSpans = formatCommandSpans(explanation);
|
|
return commandSpans.length > 0 ? commandSpans : undefined;
|
|
}
|