@qawolf/cli 1.19.0 → 1.19.2

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
@@ -325822,6 +325822,7 @@ var authMessages = {
325822
325822
  },
325823
325823
  request: {
325824
325824
  rejected401: (noun) => `QA Wolf API rejected the${noun ? ` ${noun}` : ""} request (HTTP 401). Check your API key.`,
325825
+ rejected402: (noun) => `QA Wolf API refused the${noun ? ` ${noun}` : ""} request (HTTP 402): billing prevented it.`,
325825
325826
  rejected403: (noun) => `QA Wolf API rejected the${noun ? ` ${noun}` : ""} request (HTTP 403). Check that your API key has access to this environment.`,
325826
325827
  notFound404: (noun) => `QA Wolf API could not find ${noun ? `${noun} for that environment` : "that environment"} (HTTP 404). Check the --env value.`,
325827
325828
  failedWithStatus: (status, noun) => `QA Wolf API${noun ? ` ${noun}` : ""} request failed (HTTP ${status}).`,
@@ -326145,6 +326146,7 @@ var lifecycleMessages = {
326145
326146
  alreadyRunning: (id) => `Runner ${id} was already running.`,
326146
326147
  defaultNotRemembered: (id) => `Runner ${id} could not be written to .qawolf as this directory's default, so later commands will not find it on their own. Pass --runner ${id}, or set QAWOLF_RUNNER_ID=${id}.`,
326147
326148
  defaultNotForgotten: (id) => `Runner ${id} was terminated, but it could not be removed from .qawolf as this directory's default, so later commands will still be sent to it. Pass --runner, or launch a new runner.`,
326149
+ envRunnerIdShadowsLaunch: (launchedId, envId) => `QAWOLF_RUNNER_ID=${envId} is still set, so commands that omit --runner will keep targeting it instead of the runner just launched. Pass --runner ${launchedId} to address this one.`,
326148
326150
  keptAlive: (id) => `Runner ${id} is alive, and its inactivity clock has been reset.`,
326149
326151
  launchFailed: (id, error) => `Launching runner ${id} failed. ${error}`,
326150
326152
  launchLost: (id, error) => `Launching runner ${id} failed. ${error}. The request may still have reached QA Wolf and started a runner, so relaunch the same id with qawolf runner launch --id ${id} to attach to it rather than start a second one, or terminate it with qawolf runner terminate --runner ${id}.`,
@@ -326381,7 +326383,8 @@ var exitCodes = {
326381
326383
  auth: 3,
326382
326384
  network: 4,
326383
326385
  config: 5,
326384
- timeout: 6
326386
+ timeout: 6,
326387
+ payment: 7
326385
326388
  };
326386
326389
  function exit(code, message, proc = process) {
326387
326390
  if (message !== undefined && message.length > 0) {
@@ -341065,6 +341068,12 @@ function describeRequestError(err, baseUrl, noun) {
341065
341068
  exitCode: exitCodes.auth,
341066
341069
  ...body
341067
341070
  };
341071
+ if (err.status === 402)
341072
+ return {
341073
+ error: m.request.rejected402(noun),
341074
+ exitCode: exitCodes.payment,
341075
+ ...body
341076
+ };
341068
341077
  if (err.status === 403)
341069
341078
  return { error: m.request.rejected403(noun), ...body };
341070
341079
  if (err.status === 404)
@@ -346127,7 +346136,7 @@ function startUpdateCheck(deps) {
346127
346136
  // package.json
346128
346137
  var package_default = {
346129
346138
  name: "@qawolf/cli",
346130
- version: "1.19.0",
346139
+ version: "1.19.2",
346131
346140
  description: "Run and manage QA Wolf flows from the terminal, CI, or an AI agent",
346132
346141
  keywords: [
346133
346142
  "automation",
@@ -356707,7 +356716,7 @@ async function launchRunner(ctx, options) {
356707
356716
  if (!result.ok) {
356708
356717
  return {
356709
356718
  ...failureFields(result),
356710
- exitCode: exitCodes.network,
356719
+ exitCode: result.exitCode ?? exitCodes.network,
356711
356720
  mayHaveArrived: result.mayHaveArrived ?? false,
356712
356721
  ok: false
356713
356722
  };
@@ -357347,7 +357356,10 @@ async function handleRunnerImportPackage(ctx, options, deps) {
357347
357356
  packageVersion
357348
357357
  }, runnerCallOptions);
357349
357358
  if (!result.ok) {
357350
- return { ...failureFields(result), exitCode: exitCodes.network };
357359
+ return {
357360
+ ...failureFields(result),
357361
+ exitCode: result.exitCode ?? exitCodes.network
357362
+ };
357351
357363
  }
357352
357364
  if (result.value.outcome === "failure") {
357353
357365
  const failure = result.value;
@@ -357758,7 +357770,10 @@ async function handleRunnerExec(ctx, options, deps) {
357758
357770
  ...scope.files === undefined ? {} : { files: scope.files }
357759
357771
  }, runnerCallOptions);
357760
357772
  if (!result.ok) {
357761
- return { ...failureFields(result), exitCode: exitCodes.network };
357773
+ return {
357774
+ ...failureFields(result),
357775
+ exitCode: result.exitCode ?? exitCodes.network
357776
+ };
357762
357777
  }
357763
357778
  if (result.value.outcome === "failure") {
357764
357779
  result.value.failureReason;
@@ -358082,6 +358097,10 @@ async function handleRunnerLaunch(ctx, options, deps) {
358082
358097
  if (!launched.ok) {
358083
358098
  return { ...failureFields(launched), exitCode: launched.exitCode };
358084
358099
  }
358100
+ const envRunnerId = deps.env[runnerIdEnvironmentVariable]?.trim();
358101
+ if (envRunnerId && envRunnerId !== launched.value.id) {
358102
+ ctx.ui.warn(interactiveRunnerMessages.envRunnerIdShadowsLaunch(launched.value.id, envRunnerId));
358103
+ }
358085
358104
  ctx.ui.output(launched.value, launched.value.alreadyRunning ? interactiveRunnerMessages.alreadyRunning(launched.value.id) : interactiveRunnerMessages.launched(launched.value.id));
358086
358105
  return;
358087
358106
  }
@@ -358796,7 +358815,10 @@ async function sendRunFlowRequest(ctx, options, delta) {
358796
358815
  }, runnerCallOptions);
358797
358816
  if (!result.ok) {
358798
358817
  return {
358799
- failure: { ...failureFields(result), exitCode: exitCodes.network },
358818
+ failure: {
358819
+ ...failureFields(result),
358820
+ exitCode: result.exitCode ?? exitCodes.network
358821
+ },
358800
358822
  type: "failed"
358801
358823
  };
358802
358824
  }
@@ -359008,4 +359030,4 @@ createProgram({ signals }).parseAsync().catch(() => {
359008
359030
  process.exitCode = 1;
359009
359031
  }).finally(() => flushAndExit(typeof process.exitCode === "number" ? process.exitCode : 0));
359010
359032
 
359011
- //# debugId=C46D821567854FC564756E2164756E21
359033
+ //# debugId=3E751EC68D3A12B564756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qawolf/cli",
3
- "version": "1.19.0",
3
+ "version": "1.19.2",
4
4
  "description": "Run and manage QA Wolf flows from the terminal, CI, or an AI agent",
5
5
  "keywords": [
6
6
  "automation",
@@ -17,7 +17,7 @@ Commands that target a runner find one in this order: `--runner`, then
17
17
  `QAWOLF_RUNNER_ID`, then the runner stored for the current directory (which
18
18
  `qawolf runner launch` sets). Setting the environment variable once is the most
19
19
  robust for a harness whose working directory may not be stable, but it comes
20
- with two catches worth knowing before you rely on it.
20
+ with three catches worth knowing before you rely on it.
21
21
 
22
22
  `qawolf runner launch` is not in that order: it takes its id from `--id` and
23
23
  never reads `QAWOLF_RUNNER_ID`. Bare `qawolf runner launch` invents a random id,
@@ -31,6 +31,13 @@ auto-launch described next: instead of starting `agent-1`, commands try to reach
31
31
  it and fail with exit code `4`, which reads as "retry" and never succeeds.
32
32
  Launch that id once yourself and the rest follows.
33
33
 
34
+ And launching an id that differs from `QAWOLF_RUNNER_ID` prints a warning on
35
+ stderr naming both ids: the variable still outranks the directory default, so
36
+ commands that omit `--runner` keep going to whatever it names, not the runner
37
+ you just launched. Expected when you are launching an additional runner on
38
+ purpose — address that one with `--runner` rather than re-exporting the
39
+ variable, which would repoint every other runner-less command too.
40
+
34
41
  If nothing names a runner, the commands that change something will launch one
35
42
  and say so on stderr, naming it: `run`, `act` and `exec`. **Read that
36
43
  announcement.** The browser it just started is fresh: nothing has been run on it,