fix(sentinel): add YAML shortest-path validation

This commit is contained in:
Codex
2026-07-12 17:28:17 +02:00
parent e5c763f5a7
commit 5a99f4efd7
11 changed files with 153 additions and 15 deletions
+6 -1
View File
@@ -12,7 +12,12 @@ export function webProbeHelp(): Record<string, unknown> {
export async function runWebProbeCommand(_config: Config, args: string[]): Promise<Record<string, unknown> | RenderedCliResult> {
if (args.length === 0 || args.includes("--help") || args.includes("-h") || args[0] === "help") return webProbeHelp();
return runNodeWebProbe(parseNodeWebProbeOptions(args));
const format = args.includes("--json") ? "json" : args.includes("--yaml") ? "yaml" : "text";
const parsedArgs = args.filter((item) => item !== "--json" && item !== "--yaml");
const result = runNodeWebProbe(parseNodeWebProbeOptions(parsedArgs));
if (format === "text" || !("projection" in result) || result.projection === undefined) return result;
if (format === "json") return result.projection;
return { ...result, renderedText: Bun.YAML.stringify(result.projection), contentType: "application/yaml" };
}
export function legacyHwlabNodeWebProbeUnsupported(args: string[]): Record<string, unknown> {