feat: support mdtodo workspace-root web-probe config (#899)
Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
@@ -93,7 +93,7 @@ export function hwlabNodeWebProbeHelp(): Record<string, unknown> {
|
||||
"bun scripts/cli.ts hwlab nodes web-probe observe command webobs-xxxx --type steer --text '继续观察当前 trace'",
|
||||
"bun scripts/cli.ts hwlab nodes web-probe observe command webobs-xxxx --type cancel",
|
||||
"bun scripts/cli.ts hwlab nodes web-probe observe command webobs-xxxx --type gotoProjectMdtodo",
|
||||
"bun scripts/cli.ts hwlab nodes web-probe observe command webobs-xxxx --type configureMdtodoHwpodSource --hwpod-id d601-f103-v2 --node-id D601 --root docs/MDTODO",
|
||||
"bun scripts/cli.ts hwlab nodes web-probe observe command webobs-xxxx --type configureMdtodoHwpodSource --hwpod-id d601-f103-v2 --node-id node-d601-f103-v2 --workspace-root 'F:\\\\Work\\\\HWLAB-CASE-F103' --root docs/MDTODO",
|
||||
"bun scripts/cli.ts hwlab nodes web-probe observe command webobs-xxxx --type selectMdtodoFile --file-ref docs/MDTODO/example.md",
|
||||
"bun scripts/cli.ts hwlab nodes web-probe observe command webobs-xxxx --type selectMdtodoTask --task R1.1",
|
||||
"bun scripts/cli.ts hwlab nodes web-probe observe command webobs-xxxx --type editMdtodoTaskTitle --task R1.1 --title '更新任务标题'",
|
||||
|
||||
@@ -148,6 +148,7 @@ interface NodeWebProbeObserveOptions {
|
||||
commandStatus: string | null;
|
||||
commandHwpodId: string | null;
|
||||
commandNodeId: string | null;
|
||||
commandWorkspaceRoot: string | null;
|
||||
commandRoot: string | null;
|
||||
}
|
||||
|
||||
@@ -7582,6 +7583,8 @@ function parseNodeWebProbeObserveOptions(
|
||||
"--status",
|
||||
"--hwpod-id",
|
||||
"--node-id",
|
||||
"--workspace-root",
|
||||
"--workspace-root-ref",
|
||||
"--root",
|
||||
]), new Set(["--force", "--full", "--text-stdin"]));
|
||||
const commandTypeRaw = optionValue(args, "--type") ?? null;
|
||||
@@ -7635,6 +7638,7 @@ function parseNodeWebProbeObserveOptions(
|
||||
const commandStatus = optionValue(args, "--status") ?? null;
|
||||
const commandHwpodId = optionValue(args, "--hwpod-id") ?? null;
|
||||
const commandNodeId = optionValue(args, "--node-id") ?? null;
|
||||
const commandWorkspaceRoot = optionValue(args, "--workspace-root") ?? optionValue(args, "--workspace-root-ref") ?? null;
|
||||
const commandRoot = optionValue(args, "--root") ?? null;
|
||||
for (const [label, value] of [
|
||||
["--source-id", commandSourceId],
|
||||
@@ -7646,6 +7650,7 @@ function parseNodeWebProbeObserveOptions(
|
||||
["--status", commandStatus],
|
||||
["--hwpod-id", commandHwpodId],
|
||||
["--node-id", commandNodeId],
|
||||
["--workspace-root/--workspace-root-ref", commandWorkspaceRoot],
|
||||
["--root", commandRoot],
|
||||
] as const) {
|
||||
if (value !== null && (value.includes("\0") || value.length > 500)) throw new Error(`unsafe web-probe observe ${label}: expected 1-500 non-NUL chars`);
|
||||
@@ -7697,6 +7702,7 @@ function parseNodeWebProbeObserveOptions(
|
||||
commandStatus,
|
||||
commandHwpodId,
|
||||
commandNodeId,
|
||||
commandWorkspaceRoot,
|
||||
commandRoot,
|
||||
};
|
||||
}
|
||||
@@ -8419,6 +8425,7 @@ function runNodeWebProbeObserveCommand(options: NodeWebProbeObserveOptions, spec
|
||||
status: options.commandStatus,
|
||||
hwpodId: options.commandHwpodId,
|
||||
nodeId: options.commandNodeId,
|
||||
workspaceRoot: options.commandWorkspaceRoot,
|
||||
root: options.commandRoot,
|
||||
};
|
||||
const preStopStatus = options.force && stopCommand
|
||||
|
||||
@@ -1772,6 +1772,7 @@ async function configureMdtodoHwpodSource(command) {
|
||||
const fields = [
|
||||
await fillMdtodoField("mdtodo-source-form-hwpod", commandValue(command, ["hwpodId", "hwpod", "value"])),
|
||||
await fillMdtodoField("mdtodo-source-form-node", commandValue(command, ["nodeId", "node"])),
|
||||
await fillMdtodoField("mdtodo-source-form-workspace", commandValue(command, ["workspaceRoot", "workspaceRootRef", "workspace"])),
|
||||
await fillMdtodoField("mdtodo-source-form-root", commandValue(command, ["root", "path"])),
|
||||
];
|
||||
const save = await clickProjectButtonAndMaybeWait("mdtodo-source-save", /^\/v1\/project-management\/mdtodo\/sources/u);
|
||||
@@ -2769,6 +2770,7 @@ function commandInputSummary(command) {
|
||||
status: command.status || null,
|
||||
hwpodId: opaque(command.hwpodId),
|
||||
nodeId: opaque(command.nodeId),
|
||||
workspaceRoot: opaque(command.workspaceRoot),
|
||||
root: opaque(command.root),
|
||||
label: command.label ? truncate(command.label, 200) : null,
|
||||
textHash: text === null ? null : sha256Text(text),
|
||||
|
||||
Reference in New Issue
Block a user