fix: harden workflow console review paths

This commit is contained in:
lda
2026-08-12 14:23:10 +07:00 Verified
parent 447b8d9e89
commit 20e6ecc117
20 changed files with 416 additions and 56 deletions
+1 -1
View File
@@ -495,7 +495,7 @@ describe("run operation registry", () => {
bind_outputs: { "output value": "state target" },
}),
).toBe(
"uv run wf draft add capability console.demo --revision 1 --step echo --capability local.example.echo --route 'when done=state path' --input 'input value=local target''s' --bind-output 'output value=state target'",
"uv run wf draft add capability console.demo --revision 1 --step echo --capability local.example.echo --route 'when done=state path' --input 'input value=local target'\\''s' --bind-output 'output value=state target'",
);
});
+3 -2
View File
@@ -158,9 +158,10 @@ const interpretNextActions = (nextActions: {
const shellArg = (value: string | number): string => {
const text = String(value);
return /^[A-Za-z0-9._/@=:-]+$/.test(text) ? text : `'${text.replace(/'/g, "''")}'`;
return /^[A-Za-z0-9._/@=:-]+$/.test(text)
? text
: `'${text.replace(/'/g, "'\\''")}'`;
};
const nonEquivalentCli = (
command: string,
fields: readonly string[],