@qawolf/cli 2.2.2 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -8405,7 +8405,7 @@ var agentMessages = {
8405
8405
  conflictingSessionList: "Pass --sessions alone, without --session or a session argument.",
8406
8406
  emptySessionList: "Pass at least one session id with --sessions.",
8407
8407
  sessionListNeedsFollow: "Pass --follow when using --sessions.",
8408
- answerSendFailed: (reason) => `The answer could not be sent: ${reason}. The session is still waiting, so try again.`,
8408
+ answerSendFailed: (reason) => `The answer could not be sent: ${reason.replace(/\.$/, "")}. The session is still waiting, so try again.`,
8409
8409
  blocked: (sessionId) => `QA Wolf asked a question and cannot continue until it is answered. Answer it with qawolf agent send "<your answer>" --session ${sessionId}.`,
8410
8410
  detachHint: "Press Ctrl-C to stop following. The session keeps running in the background.",
8411
8411
  detached: (sessionId) => `Stopped following. The session is still running — pick it back up with ${followAgain(sessionId)}.`,
@@ -8450,6 +8450,7 @@ var authErrorMessages = {
8450
8450
  notFound404Record: (noun, id) => `QA Wolf has no ${noun} ${id} (HTTP 404).`,
8451
8451
  notFound404: (noun) => noun === undefined ? "QA Wolf found nothing matching the request (HTTP 404)." : `QA Wolf found nothing matching the ${noun} request (HTTP 404).`,
8452
8452
  failedWithStatus: (status, noun) => `QA Wolf API${noun ? ` ${noun}` : ""} request failed (HTTP ${status}).`,
8453
+ notSent: "Nothing was sent, so this request did not take effect.",
8453
8454
  networkUnreachable: (options) => `Could not reach the QA Wolf API at ${options.baseUrl}${options.noun ? ` to fetch ${options.noun}` : ""}${options.cause ? ` (${options.cause})` : ""}. Check your network connection and QAWOLF_HOST_URL.`,
8454
8455
  timedOut: (timeoutMs, noun) => `The QA Wolf API${noun ? ` ${noun}` : ""} request timed out after ${formatSeconds(timeoutMs)}. The work may still be finishing on the platform.`,
8455
8456
  unexpectedResponse: (noun) => `Unexpected${noun ? ` ${noun}` : ""} response from the QA Wolf API.`
@@ -15677,9 +15678,9 @@ async function requestWithRetry(args) {
15677
15678
  const unreachable = result.error.kind === "network" || result.error.kind === "timeout";
15678
15679
  return {
15679
15680
  ok: false,
15680
- ...args.describe(result.error),
15681
15681
  ...mayHaveArrived ? { mayHaveArrived } : {},
15682
- ...unreachable ? { unreachable } : {}
15682
+ ...unreachable ? { unreachable } : {},
15683
+ ...args.describe(result.error)
15683
15684
  };
15684
15685
  }
15685
15686
  await sleep2(backoff);
@@ -15694,6 +15695,13 @@ function callPublicApi(trpc, contract, input, options) {
15694
15695
  }
15695
15696
  return trpc.mutation(path, input, contract.output, options);
15696
15697
  }
15698
+ var notSentCodes = new Set([
15699
+ "ConnectionRefused",
15700
+ "EAI_AGAIN",
15701
+ "ECONNREFUSED",
15702
+ "ENOTFOUND",
15703
+ "UND_ERR_CONNECT_TIMEOUT"
15704
+ ]);
15697
15705
  function makeCallPublicApiMethod(trpc, deps, readBackoffMs) {
15698
15706
  return async (contract, input, options) => {
15699
15707
  const sent = applyWorkspaceId(contract.input, input, deps.workspaceId);
@@ -15701,7 +15709,17 @@ function makeCallPublicApiMethod(trpc, deps, readBackoffMs) {
15701
15709
  return requestWithRetry({
15702
15710
  call: () => callPublicApi(trpc, contract, sent, options),
15703
15711
  backoffMs: contract.kind === "read" ? readBackoffMs : [],
15704
- describe: (err) => describeRequestError(err, deps.baseUrl, contract.name, subject),
15712
+ describe: (err) => {
15713
+ const failure = describeRequestError(err, deps.baseUrl, contract.name, subject);
15714
+ const code = err.kind === "network" ? errorCode(err.cause.cause) ?? errorCode(err.cause) : undefined;
15715
+ if (contract.kind !== "write" || !code || !notSentCodes.has(code))
15716
+ return failure;
15717
+ return {
15718
+ ...failure,
15719
+ error: `${failure.error} ${authMessages.errors.request.notSent}`,
15720
+ mayHaveArrived: false
15721
+ };
15722
+ },
15705
15723
  sleep: deps.sleep
15706
15724
  });
15707
15725
  };
@@ -16584,7 +16602,8 @@ function createTrpcClient(apiKey, deps) {
16584
16602
  return withLogging(path, () => sendWireRequest(deps.fetch, url, {
16585
16603
  body,
16586
16604
  headers: { ...authHeader, "content-type": "application/json" },
16587
- method: "POST"
16605
+ method: "POST",
16606
+ redirect: "error"
16588
16607
  }, schema, options?.timeoutMs ?? defaultTimeoutMs));
16589
16608
  }
16590
16609
  };
@@ -23672,7 +23691,7 @@ function startUpdateCheck(deps) {
23672
23691
  // package.json
23673
23692
  var package_default = {
23674
23693
  name: "@qawolf/cli",
23675
- version: "2.2.2",
23694
+ version: "2.3.0",
23676
23695
  description: "Run and manage QA Wolf flows from the terminal, CI, or an AI agent",
23677
23696
  keywords: [
23678
23697
  "automation",
@@ -23868,7 +23887,7 @@ function withAuthContext(signals, fn, deps = {}) {
23868
23887
  baseUrl: apiBaseUrl,
23869
23888
  fetch: globalThis.fetch,
23870
23889
  logger: ctx.log("trpc"),
23871
- workspaceId: resolved.workspaceId
23890
+ workspaceId: deps.workspaceId ?? resolved.workspaceId
23872
23891
  });
23873
23892
  try {
23874
23893
  const result = await fn({
@@ -39408,6 +39427,20 @@ function makeInteractiveRunnerDeps(options) {
39408
39427
 
39409
39428
  // src/commands/runner/context.ts
39410
39429
  var runnerFlagDescription = "Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored runner";
39430
+ function workspaceIdOption() {
39431
+ return new Option2("--workspace-id <id>", "Workspace to work in for this command only. Defaults to the one 'qawolf auth switch' saved, and is never saved itself").argParser((value) => {
39432
+ const trimmed = value.trim();
39433
+ if (!trimmed)
39434
+ throw new InvalidArgumentError2("Give a workspace id.");
39435
+ return trimmed;
39436
+ });
39437
+ }
39438
+ function withRunnerContext(signals, fn, deps = {}) {
39439
+ return (opts, command) => withAuthContext(signals, fn, {
39440
+ ...deps,
39441
+ workspaceId: command.optsWithGlobals().workspaceId
39442
+ })(opts, command);
39443
+ }
39411
39444
  function runnerDeps(ctx) {
39412
39445
  return makeInteractiveRunnerDeps({
39413
39446
  cwd: process.cwd(),
@@ -39425,7 +39458,7 @@ Every action in a see-and-act loop is followed by a look at the result, so ask f
39425
39458
 
39426
39459
  Coordinates are pixels on the same screenshot you just read. The runner serves one see-or-act request at a time, so never have two in flight; when the next few steps are already known, send them as one \`runner actions\` sequence instead. Bounds are checked before anything is sent, so an over-long --text or an out-of-range coordinate comes back immediately naming the limit.
39427
39460
 
39428
- On a 4, the answer may have been lost with the action in flight: take a screenshot before repeating a click, and repeat only what the screen says did not happen.
39461
+ On a 4, unless the message says nothing was sent, the answer may have been lost with the action in flight: take a screenshot before repeating a click, and repeat only what the screen says did not happen.
39429
39462
 
39430
39463
  # Mobile
39431
39464
 
@@ -39710,7 +39743,7 @@ Both succeed when there was nothing to do, and say which: \`wasRunning\` is fals
39710
39743
  `;
39711
39744
 
39712
39745
  // src/commands/runner/guides/workflow.md
39713
- var workflow_default = "An interactive runner is a live pod with a browser or a mobile device in it. You launch one, look at it, act on it, run flows on it, and read what it recorded. Everything is a plain request to one host, so there is no connection to hold open. This guide covers what spans commands; each command's own help below covers the rest.\n\n## Which runner a command reaches\n\nCommands that target a runner find one in this order: `--runner`, then `QAWOLF_RUNNER_ID`, then the runner stored for the current directory, which `qawolf runner launch` sets. Setting the environment variable once is the most robust for a harness whose working directory may not be stable, with two catches:\n\n- `qawolf runner launch` is not in that order: it takes its id from `--id` and never reads `QAWOLF_RUNNER_ID`. Pass `--id` whenever you have an id in mind.\n- A runner id that is set is treated as found, whether or not anything is running under it. Exporting `QAWOLF_RUNNER_ID=agent-1` turns off the auto-launch described next: instead of starting `agent-1`, commands try to reach it and fail with exit code `8`, naming the id and saying the variable is what chose it. Launch that id once yourself and the rest follows.\n\nIf nothing names a runner, the commands that change something launch one and say so on stderr, naming it: `run`, `act`, `actions` and `exec`. Read that announcement. The browser it just started is fresh: nothing has been run on it, nothing is signed in, and it shows only the QA Wolf welcome page. Acting as though your earlier setup survived is the single most likely way to drive the wrong page.\n\nNo read command ever launches a runner. `screenshot`, `events` and `keepalive` tell you there is no runner rather than quietly billing one, and so does `terminate`.\n\n## The order that matters\n\nA playwright runner's screen starts as it launches, showing a QA Wolf welcome page, so the screenshot-and-act loop works before you run anything.\n\nAny other runner, such as a mobile one, has no screen until its first run, and nothing else starts it. Until you have run something on it, `screenshot` and `act` fail with exit code `2`. That is not a fault, and it does not clear on its own: run a flow with `qawolf runner run <flow>`, which needs a flow file and a `package.json` on disk.\n\n## Exit codes\n\nRetry on the exit code, not on the message text:\n\n- `4` is transient, with one exception. The screen cannot serve this instant: still coming up just after launch, restarting after a display-size change, or busy with another request. Retry in a second or two, and bound the retries. The exception is a command that changes something, where a `4` can instead mean the answer was lost with the work in flight. For `act` and `actions`, take a screenshot first and repeat only what the screen says did not happen. For `run`, poll `run-status` instead of submitting again, since a second submission risks a second billed run. For `exec`, check the effect the snippet was meant to have before running it again.\n- `6` means the work ran out of the time it is given.\n- `7` means billing prevented the request, such as a plan that does not cover the runner you asked for. The message says what was refused and what clears it.\n- `8` means there is no such runner. It was never launched, or it was terminated, or it idled out. Retrying never brings one back, so stop and launch the id or name one that is running. The message says which runner was meant and whether `--runner`, `QAWOLF_RUNNER_ID` or this directory's stored default chose it; read that line before you pick an id to launch.\n- `2` will not clear on its own. Nothing has run on this runner yet, so run a flow; or the runner has no browser at all, so launch with `--name playwright` instead; or the action belongs to the other runner family, so send `tap`, `swipe` or `fill` to a mobile runner and the browser actions to a browser runner. The message says which.\n\n`act`, `actions`, `run` and `exec` are the commands whose lost answer may still have taken effect.\n\n## End to end\n\nRun from a directory holding a flow and a `package.json`.\n\n```sh\nexport QAWOLF_API_KEY=... # the only credential\nexport QAWOLF_RUNNER_ID=agent-1 # so no command below needs --runner\n\nqawolf runner launch --id agent-1 --json # --id, not the variable; read .alreadyRunning and .url\nqawolf runner run flows/smoke.flow.ts --follow # exit 1 if it failed\n\nqawolf runner act navigate --url https://example.com/login --screenshot step-1.jpg # then read step-1.jpg yourself\nqawolf runner act click --button left --x 480 --y 260 --screenshot step-2.jpg\nqawolf runner act type --text \"someone@example.com\" --screenshot step-3.jpg\n\nqawolf runner inspect element-html --selector \"#email\"\nqawolf runner inspect variable --name cart | jq .total\n\nqawolf runner run flows/smoke.flow.ts --lines 12-40 --follow # just those lines\nqawolf runner events recorder --tail 5 | jq -r '[.locator] + (.alternates // []) | @tsv'\nqawolf runner terminate\n```\n\nOn a mobile runner, launch with `--name android` or `--name ios`, and drive it with `tap`, `swipe`, `fill` and `type` instead of the browser actions.\n";
39746
+ var workflow_default = "An interactive runner is a live pod with a browser or a mobile device in it. You launch one, look at it, act on it, run flows on it, and read what it recorded. Everything is a plain request to one host, so there is no connection to hold open. This guide covers what spans commands; each command's own help below covers the rest.\n\n## Which runner a command reaches\n\nEvery runner command works in the workspace `qawolf auth switch` saved, unless it is given `--workspace-id <id>`. The flag holds for that one command and is never saved, so sessions on one machine working on different workspaces do not move each other. Since runner ids are scoped to a team, pass the same `--workspace-id` to every command that drives a runner you launched with it; leave it off one and that command looks for the runner in the saved workspace.\n\nCommands that target a runner find one in this order: `--runner`, then `QAWOLF_RUNNER_ID`, then the runner stored for the current directory, which `qawolf runner launch` sets. Setting the environment variable once is the most robust for a harness whose working directory may not be stable, with two catches:\n\n- `qawolf runner launch` is not in that order: it takes its id from `--id` and never reads `QAWOLF_RUNNER_ID`. Pass `--id` whenever you have an id in mind.\n- A runner id that is set is treated as found, whether or not anything is running under it. Exporting `QAWOLF_RUNNER_ID=agent-1` turns off the auto-launch described next: instead of starting `agent-1`, commands try to reach it and fail with exit code `8`, naming the id and saying the variable is what chose it. Launch that id once yourself and the rest follows.\n\nIf nothing names a runner, the commands that change something launch one and say so on stderr, naming it: `run`, `act`, `actions` and `exec`. Read that announcement. The browser it just started is fresh: nothing has been run on it, nothing is signed in, and it shows only the QA Wolf welcome page. Acting as though your earlier setup survived is the single most likely way to drive the wrong page.\n\nNo read command ever launches a runner. `screenshot`, `events` and `keepalive` tell you there is no runner rather than quietly billing one, and so does `terminate`.\n\n## The order that matters\n\nA playwright runner's screen starts as it launches, showing a QA Wolf welcome page, so the screenshot-and-act loop works before you run anything.\n\nAny other runner, such as a mobile one, has no screen until its first run, and nothing else starts it. Until you have run something on it, `screenshot` and `act` fail with exit code `2`. That is not a fault, and it does not clear on its own: run a flow with `qawolf runner run <flow>`, which needs a flow file and a `package.json` on disk.\n\n## Exit codes\n\nRetry on the exit code:\n\n- `4` is transient, with one exception. The screen cannot serve this instant: still coming up just after launch, restarting after a display-size change, or busy with another request. Retry in a second or two, and bound the retries. The exception is a command that changes something, where a `4` can instead mean the answer was lost with the work in flight, unless the message says nothing was sent. For `act` and `actions`, take a screenshot first and repeat only what the screen says did not happen. For `run`, poll `run-status` instead of submitting again, since a second submission risks a second billed run. For `exec`, check the effect the snippet was meant to have before running it again.\n- `6` means the work ran out of the time it is given.\n- `7` means billing prevented the request, such as a plan that does not cover the runner you asked for. The message says what was refused and what clears it.\n- `8` means there is no such runner. It was never launched, or it was terminated, or it idled out. Retrying never brings one back, so stop and launch the id or name one that is running. The message says which runner was meant and whether `--runner`, `QAWOLF_RUNNER_ID` or this directory's stored default chose it; read that line before you pick an id to launch.\n- `2` will not clear on its own. Nothing has run on this runner yet, so run a flow; or the runner has no browser at all, so launch with `--name playwright` instead; or the action belongs to the other runner family, so send `tap`, `swipe` or `fill` to a mobile runner and the browser actions to a browser runner. The message says which.\n\n`act`, `actions`, `run` and `exec` are the commands whose lost answer may still have taken effect.\n\n## End to end\n\nRun from a directory holding a flow and a `package.json`.\n\n```sh\nexport QAWOLF_API_KEY=... # the only credential\nexport QAWOLF_RUNNER_ID=agent-1 # so no command below needs --runner\n\nqawolf runner launch --id agent-1 --json # --id, not the variable; read .alreadyRunning and .url\nqawolf runner run flows/smoke.flow.ts --follow # exit 1 if it failed\n\nqawolf runner act navigate --url https://example.com/login --screenshot step-1.jpg # then read step-1.jpg yourself\nqawolf runner act click --button left --x 480 --y 260 --screenshot step-2.jpg\nqawolf runner act type --text \"someone@example.com\" --screenshot step-3.jpg\n\nqawolf runner inspect element-html --selector \"#email\"\nqawolf runner inspect variable --name cart | jq .total\n\nqawolf runner run flows/smoke.flow.ts --lines 12-40 --follow # just those lines\nqawolf runner events recorder --tail 5 | jq -r '[.locator] + (.alternates // []) | @tsv'\nqawolf runner terminate\n```\n\nOn a mobile runner, launch with `--name android` or `--name ios`, and drive it with `tap`, `swipe`, `fill` and `type` instead of the browser actions.\n";
39714
39747
 
39715
39748
  // src/commands/runner/guides/index.ts
39716
39749
  var runnerGuides = {
@@ -39745,7 +39778,7 @@ Mobile:
39745
39778
  $ qawolf runner actions '[{"type":"tap","selector":"//*[@content-desc=\\"Email\\"]"},{"type":"type","text":"hello@example.com"},{"type":"tap","x":540,"y":1650}]' --screenshot after-login.jpg
39746
39779
  $ qawolf runner actions '[{"type":"fill","selector":"name == \\"Postal code\\"","strategy":"ios-predicate","text":"94107"},{"type":"swipe","from":{"x":540,"y":1600},"to":{"x":540,"y":600}}]'`;
39747
39780
  function registerRunnerActionsCommand(runner, signals) {
39748
- declareCommandKind(runner.command("actions <sequence>"), "write").description("Perform a sequence of up to ten raw actions on a runner's screen in one request, as a JSON array of the same actions `runner act` takes. Use - to read the array from stdin. Actions run back to back, so batch only steps whose targets are on the screen you last saw, and end the sequence at the step that changes the page. Each result carries an effect: performed, not-performed, or unknown when the runner stopped answering and the action may have landed").option("--continue-on-failure", "Carry on past an action that reached the runner and did not take effect; a runner that cannot be reached or a screen that cannot serve still ends the sequence").option("--runner <id>", runnerFlagDescription).option("--screenshot <path>", "Save a JPEG of the screen after the last action to this file. With --screenshot-mode each, one file per action, with the action's index before the extension. - writes the final frame to stdout and moves the confirmation to stderr").addOption(new Option2("--screenshot-mode <mode>", "Defaults to final when --screenshot is given, none otherwise").choices([...screenshotModes])).addHelpText("after", actionsExamples).addHelpText("after", runnerGuides.actions).action((sequence, opts, command) => withAuthContext(signals, (ctx) => handleRunnerActions(ctx, {
39781
+ declareCommandKind(runner.command("actions <sequence>"), "write").description("Perform a sequence of up to ten raw actions on a runner's screen in one request, as a JSON array of the same actions `runner act` takes. Use - to read the array from stdin. Actions run back to back, so batch only steps whose targets are on the screen you last saw, and end the sequence at the step that changes the page. Each result carries an effect: performed, not-performed, or unknown when the runner stopped answering and the action may have landed").option("--continue-on-failure", "Carry on past an action that reached the runner and did not take effect; a runner that cannot be reached or a screen that cannot serve still ends the sequence").option("--runner <id>", runnerFlagDescription).option("--screenshot <path>", "Save a JPEG of the screen after the last action to this file. With --screenshot-mode each, one file per action, with the action's index before the extension. - writes the final frame to stdout and moves the confirmation to stderr").addOption(new Option2("--screenshot-mode <mode>", "Defaults to final when --screenshot is given, none otherwise").choices([...screenshotModes])).addHelpText("after", actionsExamples).addHelpText("after", runnerGuides.actions).action((sequence, opts, command) => withRunnerContext(signals, (ctx) => handleRunnerActions(ctx, {
39749
39782
  actions: sequence,
39750
39783
  continueOnFailure: opts.continueOnFailure === true,
39751
39784
  runner: opts.runner,
@@ -39916,7 +39949,7 @@ Examples:
39916
39949
  $ echo 'console.log(await page.title())' | qawolf runner exec -
39917
39950
  $ qawolf runner exec snippet.ts --file flows/checkout.flow.ts`;
39918
39951
  function registerRunnerExecCommand(runner, signals) {
39919
- declareCommandKind(runner.command("exec <file>"), "write").description("Evaluate a snippet against a runner's live page. Use - to read the snippet from stdin").option("--file <path>", "File whose scope the snippet is evaluated in; it and the directory's other files travel with it").option("--runner <id>", runnerFlagDescription).addHelpText("after", execExamples).addHelpText("after", runnerGuides.exec).action((file, opts, command) => withAuthContext(signals, (ctx) => handleRunnerExec(ctx, { contextFile: opts.file, runner: opts.runner, source: file }, runnerDeps(ctx)))(opts, command));
39952
+ declareCommandKind(runner.command("exec <file>"), "write").description("Evaluate a snippet against a runner's live page. Use - to read the snippet from stdin").option("--file <path>", "File whose scope the snippet is evaluated in; it and the directory's other files travel with it").option("--runner <id>", runnerFlagDescription).addHelpText("after", execExamples).addHelpText("after", runnerGuides.exec).action((file, opts, command) => withRunnerContext(signals, (ctx) => handleRunnerExec(ctx, { contextFile: opts.file, runner: opts.runner, source: file }, runnerDeps(ctx)))(opts, command));
39920
39953
  }
39921
39954
 
39922
39955
  // src/domains/interactiveRunner/highlightSelector.ts
@@ -39991,7 +40024,7 @@ Examples:
39991
40024
  $ qawolf runner highlight-selector "#checkout" && qawolf runner screenshot
39992
40025
  $ qawolf runner highlight-selector`;
39993
40026
  function registerRunnerHighlightSelectorCommand(runner, signals) {
39994
- declareCommandKind(runner.command("highlight-selector [selector]"), "write").description("Highlight what a selector matches on a runner's live page, so the next screenshot shows it. Omit the selector to clear the highlight").option("--runner <id>", runnerFlagDescription).addHelpText("after", highlightExamples).addHelpText("after", runnerGuides.highlightSelector).action((selector, opts, command) => withAuthContext(signals, (ctx) => handleRunnerHighlightSelector(ctx, { runner: opts.runner, selector }, runnerDeps(ctx)))(opts, command));
40027
+ declareCommandKind(runner.command("highlight-selector [selector]"), "write").description("Highlight what a selector matches on a runner's live page, so the next screenshot shows it. Omit the selector to clear the highlight").option("--runner <id>", runnerFlagDescription).addHelpText("after", highlightExamples).addHelpText("after", runnerGuides.highlightSelector).action((selector, opts, command) => withRunnerContext(signals, (ctx) => handleRunnerHighlightSelector(ctx, { runner: opts.runner, selector }, runnerDeps(ctx)))(opts, command));
39995
40028
  }
39996
40029
 
39997
40030
  // src/domains/interactiveRunner/importPackage.ts
@@ -40102,7 +40135,7 @@ Examples:
40102
40135
  $ qawolf runner import-package dayjs
40103
40136
  $ qawolf runner import-package dayjs --package-version 1.11.13`;
40104
40137
  function registerRunnerImportPackageCommand(runner, signals) {
40105
- declareCommandKind(runner.command("import-package <name>"), "write").description("Install a package into a runner's live run, so a snippet or a selection can import it").option("--package-version <version>", "Version to install", "latest").option("--runner <id>", runnerFlagDescription).addHelpText("after", importPackageExamples).addHelpText("after", runnerGuides.importPackage).action((name, opts, command) => withAuthContext(signals, (ctx) => handleRunnerImportPackage(ctx, { name, runner: opts.runner, version: opts.packageVersion }, runnerDeps(ctx)))(opts, command));
40138
+ declareCommandKind(runner.command("import-package <name>"), "write").description("Install a package into a runner's live run, so a snippet or a selection can import it").option("--package-version <version>", "Version to install", "latest").option("--runner <id>", runnerFlagDescription).addHelpText("after", importPackageExamples).addHelpText("after", runnerGuides.importPackage).action((name, opts, command) => withRunnerContext(signals, (ctx) => handleRunnerImportPackage(ctx, { name, runner: opts.runner, version: opts.packageVersion }, runnerDeps(ctx)))(opts, command));
40106
40139
  }
40107
40140
 
40108
40141
  // src/core/interactiveRunner/inspectRequest.ts
@@ -40319,22 +40352,22 @@ async function handleRunnerInspectMobile(ctx, options, deps) {
40319
40352
 
40320
40353
  // src/commands/runner/inspectMobile.register.ts
40321
40354
  function registerRunnerInspectMobileCommands(inspect, signals) {
40322
- declareCommandKind(inspect.command("session"), "read").description("Print the Appium session's status: ready, or why not").option("--runner <id>", runnerFlagDescription).action((opts, command) => withAuthContext(signals, (ctx) => handleRunnerInspectMobile(ctx, {
40355
+ declareCommandKind(inspect.command("session"), "read").description("Print the Appium session's status: ready, or why not").option("--runner <id>", runnerFlagDescription).action((opts, command) => withRunnerContext(signals, (ctx) => handleRunnerInspectMobile(ctx, {
40323
40356
  flags: blankInspectMobileFlags,
40324
40357
  runner: opts.runner,
40325
40358
  what: "session"
40326
40359
  }, runnerDeps(ctx)))(opts, command));
40327
- declareCommandKind(inspect.command("contexts"), "read").description("List the WebView contexts available, and which is current").option("--runner <id>", runnerFlagDescription).action((opts, command) => withAuthContext(signals, (ctx) => handleRunnerInspectMobile(ctx, {
40360
+ declareCommandKind(inspect.command("contexts"), "read").description("List the WebView contexts available, and which is current").option("--runner <id>", runnerFlagDescription).action((opts, command) => withRunnerContext(signals, (ctx) => handleRunnerInspectMobile(ctx, {
40328
40361
  flags: blankInspectMobileFlags,
40329
40362
  runner: opts.runner,
40330
40363
  what: "contexts"
40331
40364
  }, runnerDeps(ctx)))(opts, command));
40332
- declareCommandKind(inspect.command("page-source"), "read").description("Print the current context's page source, as a tree").option("--context <name>", "Read this context instead of the current one").option("--runner <id>", runnerFlagDescription).action((opts, command) => withAuthContext(signals, (ctx) => handleRunnerInspectMobile(ctx, {
40365
+ declareCommandKind(inspect.command("page-source"), "read").description("Print the current context's page source, as a tree").option("--context <name>", "Read this context instead of the current one").option("--runner <id>", runnerFlagDescription).action((opts, command) => withRunnerContext(signals, (ctx) => handleRunnerInspectMobile(ctx, {
40333
40366
  flags: { ...blankInspectMobileFlags, context: opts.context },
40334
40367
  runner: opts.runner,
40335
40368
  what: "page"
40336
40369
  }, runnerDeps(ctx)))(opts, command));
40337
- declareCommandKind(inspect.command("elements"), "read").description("Find elements at a screen point, carrying some text, or matching a selector").option("--context <name>", "Read this context instead of the current one").option("--partial", "text: match text containing this, rather than exactly this").option("--runner <id>", runnerFlagDescription).option("--selector <selector>", "Resolved the same way a screen object's own selector is").option("--strategy <strategy>", "selector: xpath, ios-predicate, or shadow (defaults to xpath)").option("--text <text>", "text: the text to match").option("--x <pixels>", "point: whole pixels on the device's own screen").option("--y <pixels>", "point: whole pixels on the device's own screen").action((opts, command) => withAuthContext(signals, (ctx) => handleRunnerInspectMobile(ctx, {
40370
+ declareCommandKind(inspect.command("elements"), "read").description("Find elements at a screen point, carrying some text, or matching a selector").option("--context <name>", "Read this context instead of the current one").option("--partial", "text: match text containing this, rather than exactly this").option("--runner <id>", runnerFlagDescription).option("--selector <selector>", "Resolved the same way a screen object's own selector is").option("--strategy <strategy>", "selector: xpath, ios-predicate, or shadow (defaults to xpath)").option("--text <text>", "text: the text to match").option("--x <pixels>", "point: whole pixels on the device's own screen").option("--y <pixels>", "point: whole pixels on the device's own screen").action((opts, command) => withRunnerContext(signals, (ctx) => handleRunnerInspectMobile(ctx, {
40338
40371
  flags: {
40339
40372
  context: opts.context,
40340
40373
  partial: opts.partial,
@@ -40363,17 +40396,17 @@ Examples:
40363
40396
  $ qawolf runner inspect elements --selector "//android.widget.Button[@text='Sign in']"`;
40364
40397
  function registerRunnerInspectCommands(runner, signals) {
40365
40398
  const inspect = runner.command("inspect").description("Read one thing off a runner's live page (browser) or Appium session (mobile)").addHelpText("after", inspectExamples).addHelpText("after", runnerGuides.inspect);
40366
- declareCommandKind(inspect.command("element-html"), "read").description("Print the HTML of the first element a selector matches").requiredOption("--selector <selector>", "Playwright selector to inspect").option("--runner <id>", runnerFlagDescription).action((opts, command) => withAuthContext(signals, (ctx) => handleRunnerInspect(ctx, {
40399
+ declareCommandKind(inspect.command("element-html"), "read").description("Print the HTML of the first element a selector matches").requiredOption("--selector <selector>", "Playwright selector to inspect").option("--runner <id>", runnerFlagDescription).action((opts, command) => withRunnerContext(signals, (ctx) => handleRunnerInspect(ctx, {
40367
40400
  flags: { name: undefined, selector: opts.selector },
40368
40401
  runner: opts.runner,
40369
40402
  what: "element-html"
40370
40403
  }, runnerDeps(ctx)))(opts, command));
40371
- declareCommandKind(inspect.command("page-html"), "read").description("Print the page's HTML, simplified for a model to read").option("--selector <selector>", "Limit the output to this subtree").option("--runner <id>", runnerFlagDescription).action((opts, command) => withAuthContext(signals, (ctx) => handleRunnerInspect(ctx, {
40404
+ declareCommandKind(inspect.command("page-html"), "read").description("Print the page's HTML, simplified for a model to read").option("--selector <selector>", "Limit the output to this subtree").option("--runner <id>", runnerFlagDescription).action((opts, command) => withRunnerContext(signals, (ctx) => handleRunnerInspect(ctx, {
40372
40405
  flags: { name: undefined, selector: opts.selector },
40373
40406
  runner: opts.runner,
40374
40407
  what: "page-html"
40375
40408
  }, runnerDeps(ctx)))(opts, command));
40376
- declareCommandKind(inspect.command("variable"), "read").description("Print a top-level variable's value from the running workflow").requiredOption("--name <name>", "Name of the variable to read").option("--runner <id>", runnerFlagDescription).action((opts, command) => withAuthContext(signals, (ctx) => handleRunnerInspect(ctx, {
40409
+ declareCommandKind(inspect.command("variable"), "read").description("Print a top-level variable's value from the running workflow").requiredOption("--name <name>", "Name of the variable to read").option("--runner <id>", runnerFlagDescription).action((opts, command) => withRunnerContext(signals, (ctx) => handleRunnerInspect(ctx, {
40377
40410
  flags: { name: opts.name, selector: undefined },
40378
40411
  runner: opts.runner,
40379
40412
  what: "variable"
@@ -40648,17 +40681,19 @@ Mobile:
40648
40681
  $ qawolf runner act fill --selector 'name == "Postal code"' --strategy ios-predicate --text 94107
40649
40682
  $ qawolf runner act swipe --from 540,1600 --to 540,600 --duration-ms 1500`;
40650
40683
 
40651
- // src/commands/runner/interact.register.ts
40652
- var defaultScreenshotPath = "screenshot.jpg";
40684
+ // src/commands/runner/screenshotExamples.ts
40653
40685
  var screenshotExamples = `
40654
40686
  Examples:
40655
40687
  $ qawolf runner screenshot
40656
40688
  $ qawolf runner screenshot --out screens/step-3.jpg
40657
40689
  $ qawolf runner screenshot --out - > step-3.jpg
40658
40690
  $ qawolf runner screenshot --out - | my-vision-tool`;
40691
+
40692
+ // src/commands/runner/interact.register.ts
40693
+ var defaultScreenshotPath = "screenshot.jpg";
40659
40694
  function registerRunnerInteractCommands(runner, signals) {
40660
- declareCommandKind(runner.command("screenshot"), "read").description("Save a JPEG of an interactive runner's screen to a file, or write it to stdout with --out -").option("--out <path>", "File to write the image to. - writes the JPEG bytes to stdout on their own and moves the confirmation, JSON included, to stderr", defaultScreenshotPath).option("--runner <id>", runnerFlagDescription).addHelpText("after", screenshotExamples).addHelpText("after", runnerGuides.screenshot).action((opts, command) => withAuthContext(signals, (ctx) => handleRunnerScreenshot(ctx, { out: opts.out, runner: opts.runner }, runnerDeps(ctx)))(opts, command));
40661
- declareCommandKind(runner.command("act <action>"), "write").description("Perform one raw action on a runner's screen. A browser runner takes click, double_click, scroll, move, drag, keypress, navigate and type; a mobile runner takes tap, swipe, fill and type. A browser runner answers mobile actions with action-not-supported-on-browser; a mobile runner answers the other browser actions with action-not-supported-on-mobile. Use - to read a whole action as JSON from stdin").option("--button <button>", "click: left (default), right, wheel, back or forward").option("--duration-ms <ms>", "swipe: how long it takes, up to 10000. Slow scrolls, fast flings").option("--from <x,y>", "swipe: the point it starts at").option("--keys <keys...>", "keypress: modifiers and the key, e.g. Control a").option("--path <json>", "drag: JSON array of points to drag through").option("--runner <id>", runnerFlagDescription).option("--screenshot <path>", "Also save a JPEG of the screen, taken after the action, to this file, in place of a separate screenshot. An action that did not take effect answers with one too. - writes it to stdout and moves the confirmation, JSON included, to stderr").option("--scroll-x <delta>", "scroll: horizontal wheel delta, 0 when only --scroll-y is given").option("--scroll-y <delta>", "scroll: vertical wheel delta, 0 when only --scroll-x is given").option("--selector <selector>", "tap or fill: the element to act on, as a screen object would find it. tap takes it in place of --x and --y").option("--strategy <strategy>", "how --selector is resolved: xpath (default), ios-predicate or shadow").option("--text <text>", "type: the text to type into what has focus. fill: the field's new value").option("--to <x,y>", "swipe: the point it ends at").option("--url <url>", "navigate: the http or https URL to go to").option("--x <pixels>", "click, tap and the like: x, in screenshot pixels").option("--y <pixels>", "click, tap and the like: y, in screenshot pixels").addHelpText("after", actExamples).addHelpText("after", runnerGuides.act).action((action, opts, command) => withAuthContext(signals, (ctx) => handleRunnerAct(ctx, {
40695
+ declareCommandKind(runner.command("screenshot"), "read").description("Save a JPEG of an interactive runner's screen to a file, or write it to stdout with --out -").option("--out <path>", "File to write the image to. - writes the JPEG bytes to stdout on their own and moves the confirmation, JSON included, to stderr", defaultScreenshotPath).option("--runner <id>", runnerFlagDescription).addHelpText("after", screenshotExamples).addHelpText("after", runnerGuides.screenshot).action((opts, command) => withRunnerContext(signals, (ctx) => handleRunnerScreenshot(ctx, { out: opts.out, runner: opts.runner }, runnerDeps(ctx)))(opts, command));
40696
+ declareCommandKind(runner.command("act <action>"), "write").description("Perform one raw action on a runner's screen. A browser runner takes click, double_click, scroll, move, drag, keypress, navigate and type; a mobile runner takes tap, swipe, fill and type. A browser runner answers mobile actions with action-not-supported-on-browser; a mobile runner answers the other browser actions with action-not-supported-on-mobile. Use - to read a whole action as JSON from stdin").option("--button <button>", "click: left (default), right, wheel, back or forward").option("--duration-ms <ms>", "swipe: how long it takes, up to 10000. Slow scrolls, fast flings").option("--from <x,y>", "swipe: the point it starts at").option("--keys <keys...>", "keypress: modifiers and the key, e.g. Control a").option("--path <json>", "drag: JSON array of points to drag through").option("--runner <id>", runnerFlagDescription).option("--screenshot <path>", "Also save a JPEG of the screen, taken after the action, to this file, in place of a separate screenshot. An action that did not take effect answers with one too. - writes it to stdout and moves the confirmation, JSON included, to stderr").option("--scroll-x <delta>", "scroll: horizontal wheel delta, 0 when only --scroll-y is given").option("--scroll-y <delta>", "scroll: vertical wheel delta, 0 when only --scroll-x is given").option("--selector <selector>", "tap or fill: the element to act on, as a screen object would find it. tap takes it in place of --x and --y").option("--strategy <strategy>", "how --selector is resolved: xpath (default), ios-predicate or shadow").option("--text <text>", "type: the text to type into what has focus. fill: the field's new value").option("--to <x,y>", "swipe: the point it ends at").option("--url <url>", "navigate: the http or https URL to go to").option("--x <pixels>", "click, tap and the like: x, in screenshot pixels").option("--y <pixels>", "click, tap and the like: y, in screenshot pixels").addHelpText("after", actExamples).addHelpText("after", runnerGuides.act).action((action, opts, command) => withRunnerContext(signals, (ctx) => handleRunnerAct(ctx, {
40662
40697
  flags: {
40663
40698
  button: opts.button,
40664
40699
  durationMs: opts.durationMs,
@@ -40871,11 +40906,11 @@ Examples:
40871
40906
  $ qawolf runner keepalive
40872
40907
  $ qawolf runner keepalive --runner ci`;
40873
40908
  function registerRunnerLifecycleCommands(runner, signals) {
40874
- declareCommandKind(runner.command("launch"), "write").description("Launch an interactive runner and make it this directory's default").option("--id <id>", "Id to launch under. Relaunching an id attaches to that runner").option("--name <family>", "Runner family to run, e.g. playwright").addHelpText("after", launchExamples).addHelpText("after", runnerGuides.launch).action((opts, command) => withAuthContext(signals, (ctx) => handleRunnerLaunch(ctx, { id: opts.id, name: opts.name }, runnerDeps(ctx)))(opts, command));
40875
- declareCommandKind(runner.command("list"), "read").description("List the runners running on your team").option("--here", "Only the runners this directory launched or QAWOLF_RUNNER_ID names").addHelpText("after", listExamples2).addHelpText("after", runnerGuides.list).action((opts, command) => withAuthContext(signals, (ctx) => handleRunnerList(ctx, { here: opts.here === true }, runnerDeps(ctx)))(opts, command));
40876
- declareCommandKind(runner.command("terminate"), "write").description("End an interactive runner, and the pod it runs on with it").option("--runner <id>", runnerFlagDescription).addHelpText("after", runnerGuides.stopOrTerminate).action((opts, command) => withAuthContext(signals, (ctx) => handleRunnerTerminate(ctx, { runner: opts.runner }, runnerDeps(ctx)))(opts, command));
40877
- declareCommandKind(runner.command("stop-run"), "write").description("Stop what a runner is currently executing, leaving the runner up").option("--runner <id>", runnerFlagDescription).addHelpText("after", runnerGuides.stopOrTerminate).action((opts, command) => withAuthContext(signals, (ctx) => handleRunnerStopRun(ctx, { runner: opts.runner }, runnerDeps(ctx)))(opts, command));
40878
- declareCommandKind(runner.command("keepalive"), "read").description("Reset a runner's inactivity clock, for a caller that pauses between actions").option("--runner <id>", runnerFlagDescription).addHelpText("after", keepaliveExamples).addHelpText("after", runnerGuides.keepalive).action((opts, command) => withAuthContext(signals, (ctx) => handleRunnerKeepalive(ctx, { runner: opts.runner }, runnerDeps(ctx)))(opts, command));
40909
+ declareCommandKind(runner.command("launch"), "write").description("Launch an interactive runner and make it this directory's default").option("--id <id>", "Id to launch under. Relaunching an id attaches to that runner").option("--name <family>", "Runner family to run, e.g. playwright").addHelpText("after", launchExamples).addHelpText("after", runnerGuides.launch).action((opts, command) => withRunnerContext(signals, (ctx) => handleRunnerLaunch(ctx, { id: opts.id, name: opts.name }, runnerDeps(ctx)))(opts, command));
40910
+ declareCommandKind(runner.command("list"), "read").description("List the runners running on your team").option("--here", "Only the runners this directory launched or QAWOLF_RUNNER_ID names").addHelpText("after", listExamples2).addHelpText("after", runnerGuides.list).action((opts, command) => withRunnerContext(signals, (ctx) => handleRunnerList(ctx, { here: opts.here === true }, runnerDeps(ctx)))(opts, command));
40911
+ declareCommandKind(runner.command("terminate"), "write").description("End an interactive runner, and the pod it runs on with it").option("--runner <id>", runnerFlagDescription).addHelpText("after", runnerGuides.stopOrTerminate).action((opts, command) => withRunnerContext(signals, (ctx) => handleRunnerTerminate(ctx, { runner: opts.runner }, runnerDeps(ctx)))(opts, command));
40912
+ declareCommandKind(runner.command("stop-run"), "write").description("Stop what a runner is currently executing, leaving the runner up").option("--runner <id>", runnerFlagDescription).addHelpText("after", runnerGuides.stopOrTerminate).action((opts, command) => withRunnerContext(signals, (ctx) => handleRunnerStopRun(ctx, { runner: opts.runner }, runnerDeps(ctx)))(opts, command));
40913
+ declareCommandKind(runner.command("keepalive"), "read").description("Reset a runner's inactivity clock, for a caller that pauses between actions").option("--runner <id>", runnerFlagDescription).addHelpText("after", keepaliveExamples).addHelpText("after", runnerGuides.keepalive).action((opts, command) => withRunnerContext(signals, (ctx) => handleRunnerKeepalive(ctx, { runner: opts.runner }, runnerDeps(ctx)))(opts, command));
40879
40914
  }
40880
40915
 
40881
40916
  // src/domains/interactiveRunner/promoteSnapshot.ts
@@ -40932,7 +40967,7 @@ Examples:
40932
40967
  $ qawolf runner promote-snapshot --screenshot checkout-1-actual.png --baseline checkout-1.png
40933
40968
  $ qawolf runner events run-events --tail 20 | jq 'select(.type == "imageDiffArtifact")'`;
40934
40969
  function registerRunnerPromoteSnapshotCommand(runner, signals) {
40935
- declareCommandKind(runner.command("promote-snapshot"), "write").description("Accept a run's screenshot as the new baseline for an image diff, on the runner that produced it").requiredOption("--screenshot <path>", "The screenshot to promote, as the image diff named it").requiredOption("--baseline <path>", "The baseline to replace, as the image diff named it").option("--runner <id>", runnerFlagDescription).addHelpText("after", promoteSnapshotExamples).addHelpText("after", runnerGuides.promoteSnapshot).action((opts, command) => withAuthContext(signals, (ctx) => handleRunnerPromoteSnapshot(ctx, {
40970
+ declareCommandKind(runner.command("promote-snapshot"), "write").description("Accept a run's screenshot as the new baseline for an image diff, on the runner that produced it").requiredOption("--screenshot <path>", "The screenshot to promote, as the image diff named it").requiredOption("--baseline <path>", "The baseline to replace, as the image diff named it").option("--runner <id>", runnerFlagDescription).addHelpText("after", promoteSnapshotExamples).addHelpText("after", runnerGuides.promoteSnapshot).action((opts, command) => withRunnerContext(signals, (ctx) => handleRunnerPromoteSnapshot(ctx, {
40936
40971
  baselinePath: opts.baseline,
40937
40972
  runner: opts.runner,
40938
40973
  screenshotPath: opts.screenshot
@@ -41126,7 +41161,7 @@ Examples:
41126
41161
  $ qawolf runner events run-logs --run <runId> --follow
41127
41162
  $ qawolf runner events console --since 120 --json`;
41128
41163
  function registerRunnerEventsCommand(runner, signals) {
41129
- declareCommandKind(runner.command("events <stream>"), "read").description(`Print a runner's journal, one entry per line. QA Wolf writes ${knownJournalStreams.join(", ")}`).option("--follow", "Keep reading as new entries arrive. Reading counts as activity, so a follow left open keeps the runner alive and billing", false).option("--run <id>", "Restrict run-scoped streams to one run").option("--runner <id>", runnerFlagDescription).option("--since <sequence>", "Read entries after this sequence").option("--tail <count>", "Read only the newest <count> entries").option("--timeout <seconds>", "Give up following after this long. Reading keeps the runner alive, so a follow left open would otherwise bill until the terminal closed", String(defaultFollowTimeoutSeconds)).addHelpText("after", eventsExamples).addHelpText("after", runnerGuides.events).action((stream, opts, command) => withAuthContext(signals, (ctx) => handleRunnerEvents(ctx, {
41164
+ declareCommandKind(runner.command("events <stream>"), "read").description(`Print a runner's journal, one entry per line. QA Wolf writes ${knownJournalStreams.join(", ")}`).option("--follow", "Keep reading as new entries arrive. Reading counts as activity, so a follow left open keeps the runner alive and billing", false).option("--run <id>", "Restrict run-scoped streams to one run").option("--runner <id>", runnerFlagDescription).option("--since <sequence>", "Read entries after this sequence").option("--tail <count>", "Read only the newest <count> entries").option("--timeout <seconds>", "Give up following after this long. Reading keeps the runner alive, so a follow left open would otherwise bill until the terminal closed", String(defaultFollowTimeoutSeconds)).addHelpText("after", eventsExamples).addHelpText("after", runnerGuides.events).action((stream, opts, command) => withRunnerContext(signals, (ctx) => handleRunnerEvents(ctx, {
41130
41165
  envelope: Boolean(command.optsWithGlobals().json),
41131
41166
  follow: opts.follow,
41132
41167
  run: opts.run,
@@ -41600,7 +41635,7 @@ Examples:
41600
41635
  $ qawolf runner run flows/checkout.flow.ts --lines 4-9 --lines-file pages/login.ts
41601
41636
  $ qawolf runner run flows/checkout.flow.ts --env-id staging`;
41602
41637
  function registerRunCommand(runner, signals) {
41603
- declareCommandKind(runner.command("run <flowFile>"), "write").description("Run a flow on an interactive runner, shipping the flow and what it imports").option("--follow", "Report the run's status until it settles: in progress, then passed or failed", false).option("--logs", "Stream every log line the run produces while following. Implies --follow", false).option("--run-events", "Stream the run's progress events as JSON lines while following. Implies --follow", false).option("--recorder-events", "Stream the browser actions the runner records as JSON lines while following, from an anchor taken just before submission: the recorder is runner-wide, not run-scoped. Implies --follow", false).option("--env-id <env>", "QA Wolf environment whose variables the run is given, by id or alias. Defaults to QAWOLF_ENVIRONMENT. QA Wolf reads and decrypts them itself, so they never leave the server and no size limit applies to them").option("--env-file <path>", "Dotenv file on this machine whose variables the run is given. Pass this or --env-id, not both").option("--lines <start-end>", "Run only these 1-indexed lines against the browser as it stands, instead of the whole flow from a fresh one").option("--lines-file <path>", "File the --lines range lives in. Defaults to <flowFile>; pass it only when the lines are in another file, such as a page object").option("--runner <id>", runnerFlagDescription).option("--timeout <seconds>", "Give up following after this long. Following keeps the runner alive, so a run that never settles would otherwise bill until the terminal closed", String(defaultFollowTimeoutSeconds)).addHelpText("after", runExamples2).addHelpText("after", runnerGuides.run).action((flowFile, opts, command) => withAuthContext(signals, (ctx) => handleRunnerRun(ctx, {
41638
+ declareCommandKind(runner.command("run <flowFile>"), "write").description("Run a flow on an interactive runner, shipping the flow and what it imports").option("--follow", "Report the run's status until it settles: in progress, then passed or failed", false).option("--logs", "Stream every log line the run produces while following. Implies --follow", false).option("--run-events", "Stream the run's progress events as JSON lines while following. Implies --follow", false).option("--recorder-events", "Stream the browser actions the runner records as JSON lines while following, from an anchor taken just before submission: the recorder is runner-wide, not run-scoped. Implies --follow", false).option("--env-id <env>", "QA Wolf environment whose variables the run is given, by id or alias. Defaults to QAWOLF_ENVIRONMENT. QA Wolf reads and decrypts them itself, so they never leave the server and no size limit applies to them").option("--env-file <path>", "Dotenv file on this machine whose variables the run is given. Pass this or --env-id, not both").option("--lines <start-end>", "Run only these 1-indexed lines against the browser as it stands, instead of the whole flow from a fresh one").option("--lines-file <path>", "File the --lines range lives in. Defaults to <flowFile>; pass it only when the lines are in another file, such as a page object").option("--runner <id>", runnerFlagDescription).option("--timeout <seconds>", "Give up following after this long. Following keeps the runner alive, so a run that never settles would otherwise bill until the terminal closed", String(defaultFollowTimeoutSeconds)).addHelpText("after", runExamples2).addHelpText("after", runnerGuides.run).action((flowFile, opts, command) => withRunnerContext(signals, (ctx) => handleRunnerRun(ctx, {
41604
41639
  entryPoint: flowFile,
41605
41640
  envFile: opts.envFile,
41606
41641
  envId: opts.envId,
@@ -41791,26 +41826,26 @@ async function handleRunnerRecordings(ctx, options, deps) {
41791
41826
  // src/commands/runner/recording.register.ts
41792
41827
  function registerRunnerRecordingCommands(runner, signals) {
41793
41828
  const record = runner.command("record").description("Control video recording on a browser, mobile, Windows, or Mac runner").addHelpText("after", runnerGuides.record);
41794
- declareCommandKind(record.command("start"), "write").description("Start manual video capture across runs. Requires a ready screen and suppresses automatic capture until stopped").option("--recording-id <uuid>", "Recording UUID. Generated when omitted; reuse it when retrying this start").option("--runner <id>", runnerFlagDescription).action((opts, command) => withAuthContext(signals, (ctx) => handleRunnerRecord(ctx, {
41829
+ declareCommandKind(record.command("start"), "write").description("Start manual video capture across runs. Requires a ready screen and suppresses automatic capture until stopped").option("--recording-id <uuid>", "Recording UUID. Generated when omitted; reuse it when retrying this start").option("--runner <id>", runnerFlagDescription).action((opts, command) => withRunnerContext(signals, (ctx) => handleRunnerRecord(ctx, {
41795
41830
  command: { action: "start", recordingId: opts.recordingId },
41796
41831
  runner: opts.runner
41797
41832
  }, runnerDeps(ctx)))(opts, command));
41798
- declareCommandKind(record.command("stop <recording-id>"), "write").description("Stop the recording with this UUID and publish it. Retrying cannot stop a later recording").option("--runner <id>", runnerFlagDescription).action((recordingId, opts, command) => withAuthContext(signals, (ctx) => handleRunnerRecord(ctx, {
41833
+ declareCommandKind(record.command("stop <recording-id>"), "write").description("Stop the recording with this UUID and publish it. Retrying cannot stop a later recording").option("--runner <id>", runnerFlagDescription).action((recordingId, opts, command) => withRunnerContext(signals, (ctx) => handleRunnerRecord(ctx, {
41799
41834
  command: { action: "stop", recordingId },
41800
41835
  runner: opts.runner
41801
41836
  }, runnerDeps(ctx)))(opts, command));
41802
- declareCommandKind(record.command("status"), "read").description("Show the active recording and automatic recording setting").option("--runner <id>", runnerFlagDescription).action((opts, command) => withAuthContext(signals, (ctx) => handleRunnerRecord(ctx, {
41837
+ declareCommandKind(record.command("status"), "read").description("Show the active recording and automatic recording setting").option("--runner <id>", runnerFlagDescription).action((opts, command) => withRunnerContext(signals, (ctx) => handleRunnerRecord(ctx, {
41803
41838
  command: { action: "status" },
41804
41839
  runner: opts.runner
41805
41840
  }, runnerDeps(ctx)))(opts, command));
41806
41841
  declareCommandKind(record.command("auto"), "write").addArgument(new Argument2("<setting>", "Automatic recording setting").choices([
41807
41842
  "on",
41808
41843
  "off"
41809
- ])).description("Enable or disable automatic recording for subsequent full runs").option("--runner <id>", runnerFlagDescription).action((setting, opts, command) => withAuthContext(signals, (ctx) => handleRunnerRecord(ctx, {
41844
+ ])).description("Enable or disable automatic recording for subsequent full runs").option("--runner <id>", runnerFlagDescription).action((setting, opts, command) => withRunnerContext(signals, (ctx) => handleRunnerRecord(ctx, {
41810
41845
  command: { action: "auto", enabled: setting === "on" },
41811
41846
  runner: opts.runner
41812
41847
  }, runnerDeps(ctx)))(opts, command));
41813
- declareCommandKind(runner.command("list-recordings"), "read").description("Read a page of published video recordings, including after the runner terminates. Platform URLs persist; video URLs expire").option("--runner <id>", runnerFlagDescription).option("--recording-id <uuid>", "Look up one recording; an empty result means it is not published or does not exist").option("--page-token <token>", "Continue from nextPageToken returned by the previous page").addHelpText("after", runnerGuides.listRecordings).action((opts, command) => withAuthContext(signals, (ctx) => handleRunnerRecordings(ctx, {
41848
+ declareCommandKind(runner.command("list-recordings"), "read").description("Read a page of published video recordings, including after the runner terminates. Platform URLs persist; video URLs expire").option("--runner <id>", runnerFlagDescription).option("--recording-id <uuid>", "Look up one recording; an empty result means it is not published or does not exist").option("--page-token <token>", "Continue from nextPageToken returned by the previous page").addHelpText("after", runnerGuides.listRecordings).action((opts, command) => withRunnerContext(signals, (ctx) => handleRunnerRecordings(ctx, {
41814
41849
  runner: opts.runner,
41815
41850
  ...opts.recordingId === undefined ? {} : { recordingId: opts.recordingId },
41816
41851
  ...opts.pageToken === undefined ? {} : { pageToken: opts.pageToken }
@@ -41819,7 +41854,7 @@ function registerRunnerRecordingCommands(runner, signals) {
41819
41854
 
41820
41855
  // src/commands/runner/index.ts
41821
41856
  function registerRunnerCommand(program, signals) {
41822
- const runner = declareReferenceGuide(program.command("runner"), runnerWorkflowGuide).description("Drive an interactive runner on the QA Wolf platform");
41857
+ const runner = declareReferenceGuide(program.command("runner"), runnerWorkflowGuide).description("Drive an interactive runner on the QA Wolf platform").addOption(workspaceIdOption()).configureHelp({ showGlobalOptions: true });
41823
41858
  registerRunnerLifecycleCommands(runner, signals);
41824
41859
  registerRunCommand(runner, signals);
41825
41860
  registerRunnerEventsCommand(runner, signals);
@@ -41863,4 +41898,4 @@ createProgram({ signals }).parseAsync().catch(() => {
41863
41898
  process.exitCode = 1;
41864
41899
  }).finally(() => exitWhenIdle(typeof process.exitCode === "number" ? process.exitCode : 0));
41865
41900
 
41866
- //# debugId=B8D4928E940289A464756E2164756E21
41901
+ //# debugId=EE62A061E9D077A764756E2164756E21
@@ -11459,6 +11459,7 @@ var authErrorMessages = {
11459
11459
  notFound404Record: (noun, id) => `QA Wolf has no ${noun} ${id} (HTTP 404).`,
11460
11460
  notFound404: (noun) => noun === undefined ? "QA Wolf found nothing matching the request (HTTP 404)." : `QA Wolf found nothing matching the ${noun} request (HTTP 404).`,
11461
11461
  failedWithStatus: (status, noun) => `QA Wolf API${noun ? ` ${noun}` : ""} request failed (HTTP ${status}).`,
11462
+ notSent: "Nothing was sent, so this request did not take effect.",
11462
11463
  networkUnreachable: (options) => `Could not reach the QA Wolf API at ${options.baseUrl}${options.noun ? ` to fetch ${options.noun}` : ""}${options.cause ? ` (${options.cause})` : ""}. Check your network connection and QAWOLF_HOST_URL.`,
11463
11464
  timedOut: (timeoutMs, noun) => `The QA Wolf API${noun ? ` ${noun}` : ""} request timed out after ${formatSeconds(timeoutMs)}. The work may still be finishing on the platform.`,
11464
11465
  unexpectedResponse: (noun) => `Unexpected${noun ? ` ${noun}` : ""} response from the QA Wolf API.`
@@ -12002,9 +12003,9 @@ async function requestWithRetry(args) {
12002
12003
  const unreachable = result.error.kind === "network" || result.error.kind === "timeout";
12003
12004
  return {
12004
12005
  ok: false,
12005
- ...args.describe(result.error),
12006
12006
  ...mayHaveArrived ? { mayHaveArrived } : {},
12007
- ...unreachable ? { unreachable } : {}
12007
+ ...unreachable ? { unreachable } : {},
12008
+ ...args.describe(result.error)
12008
12009
  };
12009
12010
  }
12010
12011
  await sleep2(backoff);
@@ -13856,6 +13857,13 @@ function callPublicApi(trpc, contract, input, options) {
13856
13857
  }
13857
13858
  return trpc.mutation(path, input, contract.output, options);
13858
13859
  }
13860
+ var notSentCodes = new Set([
13861
+ "ConnectionRefused",
13862
+ "EAI_AGAIN",
13863
+ "ECONNREFUSED",
13864
+ "ENOTFOUND",
13865
+ "UND_ERR_CONNECT_TIMEOUT"
13866
+ ]);
13859
13867
  function makeCallPublicApiMethod(trpc, deps, readBackoffMs) {
13860
13868
  return async (contract, input, options) => {
13861
13869
  const sent = applyWorkspaceId(contract.input, input, deps.workspaceId);
@@ -13863,7 +13871,17 @@ function makeCallPublicApiMethod(trpc, deps, readBackoffMs) {
13863
13871
  return requestWithRetry({
13864
13872
  call: () => callPublicApi(trpc, contract, sent, options),
13865
13873
  backoffMs: contract.kind === "read" ? readBackoffMs : [],
13866
- describe: (err) => describeRequestError(err, deps.baseUrl, contract.name, subject),
13874
+ describe: (err) => {
13875
+ const failure = describeRequestError(err, deps.baseUrl, contract.name, subject);
13876
+ const code = err.kind === "network" ? errorCode(err.cause.cause) ?? errorCode(err.cause) : undefined;
13877
+ if (contract.kind !== "write" || !code || !notSentCodes.has(code))
13878
+ return failure;
13879
+ return {
13880
+ ...failure,
13881
+ error: `${failure.error} ${authMessages.errors.request.notSent}`,
13882
+ mayHaveArrived: false
13883
+ };
13884
+ },
13867
13885
  sleep: deps.sleep
13868
13886
  });
13869
13887
  };
@@ -14746,7 +14764,8 @@ function createTrpcClient(apiKey, deps) {
14746
14764
  return withLogging(path, () => sendWireRequest(deps.fetch, url, {
14747
14765
  body,
14748
14766
  headers: { ...authHeader, "content-type": "application/json" },
14749
- method: "POST"
14767
+ method: "POST",
14768
+ redirect: "error"
14750
14769
  }, schema, options?.timeoutMs ?? defaultTimeoutMs));
14751
14770
  }
14752
14771
  };
@@ -16123,4 +16142,4 @@ export {
16123
16142
  createRunnerSdk
16124
16143
  };
16125
16144
 
16126
- //# debugId=549062A3D36EB66B64756E2164756E21
16145
+ //# debugId=6228F1BDD956959964756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qawolf/cli",
3
- "version": "2.2.2",
3
+ "version": "2.3.0",
4
4
  "description": "Run and manage QA Wolf flows from the terminal, CI, or an AI agent",
5
5
  "keywords": [
6
6
  "automation",
@@ -62,6 +62,12 @@ rather than leaving it to time out.
62
62
  commands that follow need no `--runner`. Override that default for one command
63
63
  with `--runner <id>`, or for a whole session with `QAWOLF_RUNNER_ID`.
64
64
 
65
+ Runner commands work in the workspace `qawolf auth switch` saved, which is
66
+ shared by every session on the machine. When more than one session may be
67
+ working in different workspaces, pass `--workspace-id <id>` to every runner
68
+ command instead of switching; it applies to that command only and is never
69
+ saved.
70
+
65
71
  ## Output
66
72
 
67
73
  When consuming output programmatically, always pass `--json` (or `--agent`).
@@ -6,6 +6,8 @@ An interactive runner is a live pod with a browser or a mobile device in it. You
6
6
 
7
7
  ## Which runner a command reaches
8
8
 
9
+ Every runner command works in the workspace `qawolf auth switch` saved, unless it is given `--workspace-id <id>`. The flag holds for that one command and is never saved, so sessions on one machine working on different workspaces do not move each other. Since runner ids are scoped to a team, pass the same `--workspace-id` to every command that drives a runner you launched with it; leave it off one and that command looks for the runner in the saved workspace.
10
+
9
11
  Commands that target a runner find one in this order: `--runner`, then `QAWOLF_RUNNER_ID`, then the runner stored for the current directory, which `qawolf runner launch` sets. Setting the environment variable once is the most robust for a harness whose working directory may not be stable, with two catches:
10
12
 
11
13
  - `qawolf runner launch` is not in that order: it takes its id from `--id` and never reads `QAWOLF_RUNNER_ID`. Pass `--id` whenever you have an id in mind.
@@ -23,9 +25,9 @@ Any other runner, such as a mobile one, has no screen until its first run, and n
23
25
 
24
26
  ## Exit codes
25
27
 
26
- Retry on the exit code, not on the message text:
28
+ Retry on the exit code:
27
29
 
28
- - `4` is transient, with one exception. The screen cannot serve this instant: still coming up just after launch, restarting after a display-size change, or busy with another request. Retry in a second or two, and bound the retries. The exception is a command that changes something, where a `4` can instead mean the answer was lost with the work in flight. For `act` and `actions`, take a screenshot first and repeat only what the screen says did not happen. For `run`, poll `run-status` instead of submitting again, since a second submission risks a second billed run. For `exec`, check the effect the snippet was meant to have before running it again.
30
+ - `4` is transient, with one exception. The screen cannot serve this instant: still coming up just after launch, restarting after a display-size change, or busy with another request. Retry in a second or two, and bound the retries. The exception is a command that changes something, where a `4` can instead mean the answer was lost with the work in flight, unless the message says nothing was sent. For `act` and `actions`, take a screenshot first and repeat only what the screen says did not happen. For `run`, poll `run-status` instead of submitting again, since a second submission risks a second billed run. For `exec`, check the effect the snippet was meant to have before running it again.
29
31
  - `6` means the work ran out of the time it is given.
30
32
  - `7` means billing prevented the request, such as a plan that does not cover the runner you asked for. The message says what was refused and what clears it.
31
33
  - `8` means there is no such runner. It was never launched, or it was terminated, or it idled out. Retrying never brings one back, so stop and launch the id or name one that is running. The message says which runner was meant and whether `--runner`, `QAWOLF_RUNNER_ID` or this directory's stored default chose it; read that line before you pick an id to launch.
@@ -64,8 +66,17 @@ Usage: qawolf runner [options] [command]
64
66
  Drive an interactive runner on the QA Wolf platform
65
67
 
66
68
  Options:
69
+ --workspace-id <id> Workspace to work in for this command only. Defaults to
70
+ the one 'qawolf auth switch' saved, and is never saved
71
+ itself
67
72
  -h, --help display help for command
68
73
 
74
+ Global Options:
75
+ -V, --version output the version number
76
+ --verbose Enable debug logging to stderr
77
+ --json Output as JSON
78
+ --agent Output for agent consumption
79
+
69
80
  Commands:
70
81
  launch [options] Launch an interactive runner and make it this directory's
71
82
  default
@@ -126,9 +137,17 @@ Usage: qawolf runner launch [options]
126
137
  Launch an interactive runner and make it this directory's default
127
138
 
128
139
  Options:
129
- --id <id> Id to launch under. Relaunching an id attaches to that runner
130
- --name <family> Runner family to run, e.g. playwright
131
- -h, --help display help for command
140
+ --id <id> Id to launch under. Relaunching an id attaches to that runner
141
+ --name <family> Runner family to run, e.g. playwright
142
+ -h, --help display help for command
143
+
144
+ Global Options:
145
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf auth
146
+ switch' saved, and is never saved itself
147
+ -V, --version output the version number
148
+ --verbose Enable debug logging to stderr
149
+ --json Output as JSON
150
+ --agent Output for agent consumption
132
151
 
133
152
  Examples:
134
153
  $ qawolf runner launch
@@ -183,8 +202,16 @@ Usage: qawolf runner list [options]
183
202
  List the runners running on your team
184
203
 
185
204
  Options:
186
- --here Only the runners this directory launched or QAWOLF_RUNNER_ID names
187
- -h, --help display help for command
205
+ --here Only the runners this directory launched or QAWOLF_RUNNER_ID names
206
+ -h, --help display help for command
207
+
208
+ Global Options:
209
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf auth
210
+ switch' saved, and is never saved itself
211
+ -V, --version output the version number
212
+ --verbose Enable debug logging to stderr
213
+ --json Output as JSON
214
+ --agent Output for agent consumption
188
215
 
189
216
  Examples:
190
217
  $ qawolf runner list
@@ -222,8 +249,17 @@ Usage: qawolf runner terminate [options]
222
249
  End an interactive runner, and the pod it runs on with it
223
250
 
224
251
  Options:
225
- --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored runner
226
- -h, --help display help for command
252
+ --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored
253
+ runner
254
+ -h, --help display help for command
255
+
256
+ Global Options:
257
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf auth
258
+ switch' saved, and is never saved itself
259
+ -V, --version output the version number
260
+ --verbose Enable debug logging to stderr
261
+ --json Output as JSON
262
+ --agent Output for agent consumption
227
263
 
228
264
  Stopping a run or ending a runner:
229
265
  Two different things, and the names are the only warning you get:
@@ -248,8 +284,17 @@ Usage: qawolf runner stop-run [options]
248
284
  Stop what a runner is currently executing, leaving the runner up
249
285
 
250
286
  Options:
251
- --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored runner
252
- -h, --help display help for command
287
+ --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored
288
+ runner
289
+ -h, --help display help for command
290
+
291
+ Global Options:
292
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf auth
293
+ switch' saved, and is never saved itself
294
+ -V, --version output the version number
295
+ --verbose Enable debug logging to stderr
296
+ --json Output as JSON
297
+ --agent Output for agent consumption
253
298
 
254
299
  Stopping a run or ending a runner:
255
300
  Two different things, and the names are the only warning you get:
@@ -274,8 +319,17 @@ Usage: qawolf runner keepalive [options]
274
319
  Reset a runner's inactivity clock, for a caller that pauses between actions
275
320
 
276
321
  Options:
277
- --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored runner
278
- -h, --help display help for command
322
+ --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored
323
+ runner
324
+ -h, --help display help for command
325
+
326
+ Global Options:
327
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf auth
328
+ switch' saved, and is never saved itself
329
+ -V, --version output the version number
330
+ --verbose Enable debug logging to stderr
331
+ --json Output as JSON
332
+ --agent Output for agent consumption
279
333
 
280
334
  Examples:
281
335
  $ qawolf runner keepalive
@@ -329,6 +383,14 @@ Options:
329
383
  "3600")
330
384
  -h, --help display help for command
331
385
 
386
+ Global Options:
387
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf auth
388
+ switch' saved, and is never saved itself
389
+ -V, --version output the version number
390
+ --verbose Enable debug logging to stderr
391
+ --json Output as JSON
392
+ --agent Output for agent consumption
393
+
332
394
  Examples:
333
395
  $ qawolf runner run flows/checkout.flow.ts
334
396
  $ qawolf runner run flows/checkout.flow.ts --follow
@@ -471,6 +533,14 @@ Options:
471
533
  "3600")
472
534
  -h, --help display help for command
473
535
 
536
+ Global Options:
537
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf auth
538
+ switch' saved, and is never saved itself
539
+ -V, --version output the version number
540
+ --verbose Enable debug logging to stderr
541
+ --json Output as JSON
542
+ --agent Output for agent consumption
543
+
474
544
  Examples:
475
545
  $ qawolf runner events recorder --tail 5
476
546
  $ qawolf runner events run-logs --run <runId> --follow
@@ -544,10 +614,20 @@ Usage: qawolf runner screenshot [options]
544
614
  Save a JPEG of an interactive runner's screen to a file, or write it to stdout with --out -
545
615
 
546
616
  Options:
547
- --out <path> File to write the image to. - writes the JPEG bytes to stdout on their own and
548
- moves the confirmation, JSON included, to stderr (default: "screenshot.jpg")
549
- --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored runner
550
- -h, --help display help for command
617
+ --out <path> File to write the image to. - writes the JPEG bytes to stdout on their own
618
+ and moves the confirmation, JSON included, to stderr (default:
619
+ "screenshot.jpg")
620
+ --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored
621
+ runner
622
+ -h, --help display help for command
623
+
624
+ Global Options:
625
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf auth
626
+ switch' saved, and is never saved itself
627
+ -V, --version output the version number
628
+ --verbose Enable debug logging to stderr
629
+ --json Output as JSON
630
+ --agent Output for agent consumption
551
631
 
552
632
  Examples:
553
633
  $ qawolf runner screenshot
@@ -604,6 +684,14 @@ Options:
604
684
  --y <pixels> click, tap and the like: y, in screenshot pixels
605
685
  -h, --help display help for command
606
686
 
687
+ Global Options:
688
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf
689
+ auth switch' saved, and is never saved itself
690
+ -V, --version output the version number
691
+ --verbose Enable debug logging to stderr
692
+ --json Output as JSON
693
+ --agent Output for agent consumption
694
+
607
695
  Examples:
608
696
  $ qawolf runner act click --button left --x 480 --y 260
609
697
  $ qawolf runner act type --text "hello@example.com"
@@ -645,9 +733,9 @@ Seeing and acting:
645
733
  instead. Bounds are checked before anything is sent, so an over-long --text or
646
734
  an out-of-range coordinate comes back immediately naming the limit.
647
735
 
648
- On a 4, the answer may have been lost with the action in flight: take a
649
- screenshot before repeating a click, and repeat only what the screen says did
650
- not happen.
736
+ On a 4, unless the message says nothing was sent, the answer may have been
737
+ lost with the action in flight: take a screenshot before repeating a click,
738
+ and repeat only what the screen says did not happen.
651
739
 
652
740
  Mobile:
653
741
  A mobile runner has a touchscreen, not a mouse, so it has actions of its own:
@@ -700,6 +788,14 @@ Options:
700
788
  "none", "final", "each")
701
789
  -h, --help display help for command
702
790
 
791
+ Global Options:
792
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf
793
+ auth switch' saved, and is never saved itself
794
+ -V, --version output the version number
795
+ --verbose Enable debug logging to stderr
796
+ --json Output as JSON
797
+ --agent Output for agent consumption
798
+
703
799
  Examples:
704
800
  $ qawolf runner actions '[{"type":"click","button":"left","x":480,"y":260},{"type":"type","text":"hello@example.com"},{"type":"keypress","keys":["Enter"]}]' --screenshot after-login.jpg
705
801
  $ echo '[{"type":"click","button":"left","x":1,"y":2},{"type":"type","text":"hi"}]' | qawolf runner actions -
@@ -766,10 +862,19 @@ Usage: qawolf runner exec [options] <file>
766
862
  Evaluate a snippet against a runner's live page. Use - to read the snippet from stdin
767
863
 
768
864
  Options:
769
- --file <path> File whose scope the snippet is evaluated in; it and the directory's other files
770
- travel with it
771
- --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored runner
772
- -h, --help display help for command
865
+ --file <path> File whose scope the snippet is evaluated in; it and the directory's other
866
+ files travel with it
867
+ --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored
868
+ runner
869
+ -h, --help display help for command
870
+
871
+ Global Options:
872
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf auth
873
+ switch' saved, and is never saved itself
874
+ -V, --version output the version number
875
+ --verbose Enable debug logging to stderr
876
+ --json Output as JSON
877
+ --agent Output for agent consumption
773
878
 
774
879
  Examples:
775
880
  $ qawolf runner exec snippet.ts
@@ -815,6 +920,14 @@ Read one thing off a runner's live page (browser) or Appium session (mobile)
815
920
  Options:
816
921
  -h, --help display help for command
817
922
 
923
+ Global Options:
924
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf
925
+ auth switch' saved, and is never saved itself
926
+ -V, --version output the version number
927
+ --verbose Enable debug logging to stderr
928
+ --json Output as JSON
929
+ --agent Output for agent consumption
930
+
818
931
  Commands:
819
932
  element-html [options] Print the HTML of the first element a selector matches
820
933
  page-html [options] Print the page's HTML, simplified for a model to read
@@ -903,6 +1016,14 @@ Options:
903
1016
  --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's
904
1017
  stored runner
905
1018
  -h, --help display help for command
1019
+
1020
+ Global Options:
1021
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf
1022
+ auth switch' saved, and is never saved itself
1023
+ -V, --version output the version number
1024
+ --verbose Enable debug logging to stderr
1025
+ --json Output as JSON
1026
+ --agent Output for agent consumption
906
1027
  ```
907
1028
 
908
1029
  ### qawolf runner inspect page-html
@@ -917,6 +1038,14 @@ Options:
917
1038
  --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's
918
1039
  stored runner
919
1040
  -h, --help display help for command
1041
+
1042
+ Global Options:
1043
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf
1044
+ auth switch' saved, and is never saved itself
1045
+ -V, --version output the version number
1046
+ --verbose Enable debug logging to stderr
1047
+ --json Output as JSON
1048
+ --agent Output for agent consumption
920
1049
  ```
921
1050
 
922
1051
  ### qawolf runner inspect variable
@@ -927,9 +1056,18 @@ Usage: qawolf runner inspect variable [options]
927
1056
  Print a top-level variable's value from the running workflow
928
1057
 
929
1058
  Options:
930
- --name <name> Name of the variable to read
931
- --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored runner
932
- -h, --help display help for command
1059
+ --name <name> Name of the variable to read
1060
+ --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored
1061
+ runner
1062
+ -h, --help display help for command
1063
+
1064
+ Global Options:
1065
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf auth
1066
+ switch' saved, and is never saved itself
1067
+ -V, --version output the version number
1068
+ --verbose Enable debug logging to stderr
1069
+ --json Output as JSON
1070
+ --agent Output for agent consumption
933
1071
  ```
934
1072
 
935
1073
  ### qawolf runner inspect session
@@ -940,8 +1078,17 @@ Usage: qawolf runner inspect session [options]
940
1078
  Print the Appium session's status: ready, or why not
941
1079
 
942
1080
  Options:
943
- --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored runner
944
- -h, --help display help for command
1081
+ --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored
1082
+ runner
1083
+ -h, --help display help for command
1084
+
1085
+ Global Options:
1086
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf auth
1087
+ switch' saved, and is never saved itself
1088
+ -V, --version output the version number
1089
+ --verbose Enable debug logging to stderr
1090
+ --json Output as JSON
1091
+ --agent Output for agent consumption
945
1092
  ```
946
1093
 
947
1094
  ### qawolf runner inspect contexts
@@ -952,8 +1099,17 @@ Usage: qawolf runner inspect contexts [options]
952
1099
  List the WebView contexts available, and which is current
953
1100
 
954
1101
  Options:
955
- --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored runner
956
- -h, --help display help for command
1102
+ --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored
1103
+ runner
1104
+ -h, --help display help for command
1105
+
1106
+ Global Options:
1107
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf auth
1108
+ switch' saved, and is never saved itself
1109
+ -V, --version output the version number
1110
+ --verbose Enable debug logging to stderr
1111
+ --json Output as JSON
1112
+ --agent Output for agent consumption
957
1113
  ```
958
1114
 
959
1115
  ### qawolf runner inspect page-source
@@ -964,10 +1120,18 @@ Usage: qawolf runner inspect page-source [options]
964
1120
  Print the current context's page source, as a tree
965
1121
 
966
1122
  Options:
967
- --context <name> Read this context instead of the current one
968
- --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored
969
- runner
970
- -h, --help display help for command
1123
+ --context <name> Read this context instead of the current one
1124
+ --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored
1125
+ runner
1126
+ -h, --help display help for command
1127
+
1128
+ Global Options:
1129
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf auth
1130
+ switch' saved, and is never saved itself
1131
+ -V, --version output the version number
1132
+ --verbose Enable debug logging to stderr
1133
+ --json Output as JSON
1134
+ --agent Output for agent consumption
971
1135
  ```
972
1136
 
973
1137
  ### qawolf runner inspect elements
@@ -988,6 +1152,14 @@ Options:
988
1152
  --x <pixels> point: whole pixels on the device's own screen
989
1153
  --y <pixels> point: whole pixels on the device's own screen
990
1154
  -h, --help display help for command
1155
+
1156
+ Global Options:
1157
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf
1158
+ auth switch' saved, and is never saved itself
1159
+ -V, --version output the version number
1160
+ --verbose Enable debug logging to stderr
1161
+ --json Output as JSON
1162
+ --agent Output for agent consumption
991
1163
  ```
992
1164
 
993
1165
  ## qawolf runner import-package
@@ -1003,6 +1175,14 @@ Options:
1003
1175
  stored runner
1004
1176
  -h, --help display help for command
1005
1177
 
1178
+ Global Options:
1179
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one
1180
+ 'qawolf auth switch' saved, and is never saved itself
1181
+ -V, --version output the version number
1182
+ --verbose Enable debug logging to stderr
1183
+ --json Output as JSON
1184
+ --agent Output for agent consumption
1185
+
1006
1186
  Examples:
1007
1187
  $ qawolf runner import-package dayjs
1008
1188
  $ qawolf runner import-package dayjs --package-version 1.11.13
@@ -1026,8 +1206,17 @@ Highlight what a selector matches on a runner's live page, so the next screensho
1026
1206
  selector to clear the highlight
1027
1207
 
1028
1208
  Options:
1029
- --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored runner
1030
- -h, --help display help for command
1209
+ --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored
1210
+ runner
1211
+ -h, --help display help for command
1212
+
1213
+ Global Options:
1214
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf auth
1215
+ switch' saved, and is never saved itself
1216
+ -V, --version output the version number
1217
+ --verbose Enable debug logging to stderr
1218
+ --json Output as JSON
1219
+ --agent Output for agent consumption
1031
1220
 
1032
1221
  Examples:
1033
1222
  $ qawolf runner highlight-selector "text=Sign in"
@@ -1067,6 +1256,14 @@ Options:
1067
1256
  runner
1068
1257
  -h, --help display help for command
1069
1258
 
1259
+ Global Options:
1260
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf auth
1261
+ switch' saved, and is never saved itself
1262
+ -V, --version output the version number
1263
+ --verbose Enable debug logging to stderr
1264
+ --json Output as JSON
1265
+ --agent Output for agent consumption
1266
+
1070
1267
  Examples:
1071
1268
  $ qawolf runner promote-snapshot --screenshot checkout-1-actual.png --baseline checkout-1.png
1072
1269
  $ qawolf runner events run-events --tail 20 | jq 'select(.type == "imageDiffArtifact")'
@@ -1095,6 +1292,14 @@ Control video recording on a browser, mobile, Windows, or Mac runner
1095
1292
  Options:
1096
1293
  -h, --help display help for command
1097
1294
 
1295
+ Global Options:
1296
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one
1297
+ 'qawolf auth switch' saved, and is never saved itself
1298
+ -V, --version output the version number
1299
+ --verbose Enable debug logging to stderr
1300
+ --json Output as JSON
1301
+ --agent Output for agent consumption
1302
+
1098
1303
  Commands:
1099
1304
  start [options] Start manual video capture across runs. Requires a ready screen and
1100
1305
  suppresses automatic capture until stopped
@@ -1140,6 +1345,14 @@ Options:
1140
1345
  --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's
1141
1346
  stored runner
1142
1347
  -h, --help display help for command
1348
+
1349
+ Global Options:
1350
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf
1351
+ auth switch' saved, and is never saved itself
1352
+ -V, --version output the version number
1353
+ --verbose Enable debug logging to stderr
1354
+ --json Output as JSON
1355
+ --agent Output for agent consumption
1143
1356
  ```
1144
1357
 
1145
1358
  ### qawolf runner record stop
@@ -1150,8 +1363,17 @@ Usage: qawolf runner record stop [options] <recording-id>
1150
1363
  Stop the recording with this UUID and publish it. Retrying cannot stop a later recording
1151
1364
 
1152
1365
  Options:
1153
- --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored runner
1154
- -h, --help display help for command
1366
+ --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored
1367
+ runner
1368
+ -h, --help display help for command
1369
+
1370
+ Global Options:
1371
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf auth
1372
+ switch' saved, and is never saved itself
1373
+ -V, --version output the version number
1374
+ --verbose Enable debug logging to stderr
1375
+ --json Output as JSON
1376
+ --agent Output for agent consumption
1155
1377
  ```
1156
1378
 
1157
1379
  ### qawolf runner record status
@@ -1162,8 +1384,17 @@ Usage: qawolf runner record status [options]
1162
1384
  Show the active recording and automatic recording setting
1163
1385
 
1164
1386
  Options:
1165
- --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored runner
1166
- -h, --help display help for command
1387
+ --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored
1388
+ runner
1389
+ -h, --help display help for command
1390
+
1391
+ Global Options:
1392
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf auth
1393
+ switch' saved, and is never saved itself
1394
+ -V, --version output the version number
1395
+ --verbose Enable debug logging to stderr
1396
+ --json Output as JSON
1397
+ --agent Output for agent consumption
1167
1398
  ```
1168
1399
 
1169
1400
  ### qawolf runner record auto
@@ -1174,11 +1405,20 @@ Usage: qawolf runner record auto [options] <setting>
1174
1405
  Enable or disable automatic recording for subsequent full runs
1175
1406
 
1176
1407
  Arguments:
1177
- setting Automatic recording setting (choices: "on", "off")
1408
+ setting Automatic recording setting (choices: "on", "off")
1178
1409
 
1179
1410
  Options:
1180
- --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored runner
1181
- -h, --help display help for command
1411
+ --runner <id> Runner to target. Defaults to QAWOLF_RUNNER_ID, then this directory's stored
1412
+ runner
1413
+ -h, --help display help for command
1414
+
1415
+ Global Options:
1416
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf auth
1417
+ switch' saved, and is never saved itself
1418
+ -V, --version output the version number
1419
+ --verbose Enable debug logging to stderr
1420
+ --json Output as JSON
1421
+ --agent Output for agent consumption
1182
1422
  ```
1183
1423
 
1184
1424
  ## qawolf runner list-recordings
@@ -1197,6 +1437,14 @@ Options:
1197
1437
  --page-token <token> Continue from nextPageToken returned by the previous page
1198
1438
  -h, --help display help for command
1199
1439
 
1440
+ Global Options:
1441
+ --workspace-id <id> Workspace to work in for this command only. Defaults to the one 'qawolf
1442
+ auth switch' saved, and is never saved itself
1443
+ -V, --version output the version number
1444
+ --verbose Enable debug logging to stderr
1445
+ --json Output as JSON
1446
+ --agent Output for agent consumption
1447
+
1200
1448
  Reading pages:
1201
1449
  $ qawolf runner list-recordings --runner ci --json
1202
1450
  $ qawolf runner list-recordings --runner ci --recording-id <uuid> --json