feat: allow web observer provider selection
This commit is contained in:
@@ -58,7 +58,7 @@ interface NodeWebProbeScriptOptions {
|
||||
}
|
||||
|
||||
type NodeWebProbeObserveAction = "start" | "status" | "command" | "stop" | "collect" | "analyze";
|
||||
type NodeWebProbeObserveCommandType = "login" | "preflight" | "goto" | "sendPrompt" | "clickSession" | "screenshot" | "mark" | "stop";
|
||||
type NodeWebProbeObserveCommandType = "login" | "preflight" | "goto" | "sendPrompt" | "selectProvider" | "clickSession" | "screenshot" | "mark" | "stop";
|
||||
|
||||
interface NodeWebProbeObserveOptions {
|
||||
action: "observe";
|
||||
@@ -83,6 +83,7 @@ interface NodeWebProbeObserveOptions {
|
||||
commandPath: string | null;
|
||||
commandLabel: string | null;
|
||||
commandSessionId: string | null;
|
||||
commandProvider: string | null;
|
||||
}
|
||||
|
||||
type NodeWebProbeOptions = NodeWebProbeRunOptions | NodeWebProbeScriptOptions | NodeWebProbeObserveOptions;
|
||||
@@ -6062,7 +6063,8 @@ function parseNodeWebProbeObserveOptions(args: string[], node: string, lane: str
|
||||
"--text",
|
||||
"--path",
|
||||
"--label",
|
||||
"--session-id",
|
||||
"--session-id",
|
||||
"--provider",
|
||||
]), new Set(["--force"]));
|
||||
const commandTypeRaw = optionValue(args, "--type") ?? null;
|
||||
const commandType = commandTypeRaw === null ? null : parseNodeWebProbeObserveCommandType(commandTypeRaw);
|
||||
@@ -6096,6 +6098,7 @@ function parseNodeWebProbeObserveOptions(args: string[], node: string, lane: str
|
||||
commandPath: optionValue(args, "--path") ?? null,
|
||||
commandLabel: optionValue(args, "--label") ?? null,
|
||||
commandSessionId: optionValue(args, "--session-id") ?? null,
|
||||
commandProvider: optionValue(args, "--provider") ?? null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6105,12 +6108,13 @@ function parseNodeWebProbeObserveCommandType(value: string): NodeWebProbeObserve
|
||||
|| value === "preflight"
|
||||
|| value === "goto"
|
||||
|| value === "sendPrompt"
|
||||
|| value === "selectProvider"
|
||||
|| value === "clickSession"
|
||||
|| value === "screenshot"
|
||||
|| value === "mark"
|
||||
|| value === "stop"
|
||||
) return value;
|
||||
throw new Error(`web-probe observe command --type must be login, preflight, goto, sendPrompt, clickSession, screenshot, mark, or stop; got ${value}`);
|
||||
throw new Error(`web-probe observe command --type must be login, preflight, goto, sendPrompt, selectProvider, clickSession, screenshot, mark, or stop; got ${value}`);
|
||||
}
|
||||
|
||||
function nodeWebProbeAutoCommandTimeoutSeconds(input: {
|
||||
@@ -6503,6 +6507,7 @@ function runNodeWebProbeObserveCommand(options: NodeWebProbeObserveOptions, spec
|
||||
text: options.commandText,
|
||||
label: options.commandLabel,
|
||||
sessionId: options.commandSessionId,
|
||||
provider: options.commandProvider,
|
||||
};
|
||||
const payloadB64 = Buffer.from(JSON.stringify(payload), "utf8").toString("base64");
|
||||
const script = [
|
||||
@@ -6674,6 +6679,7 @@ function commandSummaryForOutput(payload: Record<string, unknown>): Record<strin
|
||||
path: payload.path ?? null,
|
||||
label: payload.label ?? null,
|
||||
sessionId: payload.sessionId ?? null,
|
||||
provider: payload.provider ?? null,
|
||||
textHash: text === null ? null : `sha256:${createHash("sha256").update(text).digest("hex")}`,
|
||||
textBytes: text === null ? null : Buffer.byteLength(text),
|
||||
valuesRedacted: true,
|
||||
|
||||
Reference in New Issue
Block a user