@qawolf/cli 1.7.1 → 1.7.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.
Files changed (2) hide show
  1. package/dist/cli.js +46 -17
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -155313,6 +155313,8 @@ var environmentsMessages = {
155313
155313
  static: "Static environments",
155314
155314
  preview: "Preview (PR) environments"
155315
155315
  },
155316
+ resolvedAlias: (ref, id) => `Environment ${ref} resolved to ${id}.`,
155317
+ couldNotResolve: (ref, detail) => `Could not resolve environment ${ref}: ${detail} If ${ref} is an alias, note that aliases require a team API key.`,
155316
155318
  aborted: "Aborted; no environment selected.",
155317
155319
  tooManyPages: (pages) => `Stopped listing environments after ${pages} pages. Pass --env explicitly.`
155318
155320
  };
@@ -155330,6 +155332,9 @@ var flowsMessages = {
155330
155332
  remoteRequiresEnv: "--remote requires an environment. Pass --env <env> or set QAWOLF_ENVIRONMENT.",
155331
155333
  flagsRequireRemote: "--env and --include-drafts require --remote"
155332
155334
  },
155335
+ run: {
155336
+ requiresEnv: "An environment is required. Pass --env <env> or set QAWOLF_ENVIRONMENT."
155337
+ },
155333
155338
  pull: {
155334
155339
  requiresEnv: "An environment is required. Pass --env <env> or set QAWOLF_ENVIRONMENT.",
155335
155340
  downloadingBundle: "Downloading flows bundle",
@@ -174611,7 +174616,7 @@ function startUpdateCheck(deps) {
174611
174616
  // package.json
174612
174617
  var package_default = {
174613
174618
  name: "@qawolf/cli",
174614
- version: "1.7.1",
174619
+ version: "1.7.2",
174615
174620
  description: "Run and manage QA Wolf flows from the terminal, CI, or an AI agent",
174616
174621
  keywords: [
174617
174622
  "automation",
@@ -180908,20 +180913,9 @@ async function handleFlowsPull(ctx, opts, deps) {
180908
180913
  }
180909
180914
  }
180910
180915
 
180911
- // src/domains/environments/resolveEnvironment.ts
180916
+ // src/domains/environments/pickEnvironment.ts
180912
180917
  var findContract = publicContractsV1.environment.find;
180913
- async function resolveEnvironment(deps, opts) {
180914
- const explicit = opts.explicit?.trim();
180915
- if (explicit)
180916
- return { kind: "resolved", env: explicit };
180917
- const fromEnvVar = deps.env["QAWOLF_ENVIRONMENT"]?.trim();
180918
- if (fromEnvVar) {
180919
- deps.ui.info(environmentsMessages.usingFromEnvVar(fromEnvVar));
180920
- return { kind: "resolved", env: fromEnvVar };
180921
- }
180922
- if (deps.ui.mode !== "human") {
180923
- return { kind: "error", error: opts.requiredMessage };
180924
- }
180918
+ async function pickEnvironment(deps) {
180925
180919
  const fetched = await fetchAllEnvironments(deps.platformClient);
180926
180920
  if (!fetched.ok)
180927
180921
  return { kind: "error", error: fetched.error };
@@ -180994,6 +180988,39 @@ async function fetchAllEnvironments(platformClient) {
180994
180988
  return { ok: false, error: environmentsMessages.tooManyPages(maxPages) };
180995
180989
  }
180996
180990
 
180991
+ // src/domains/environments/resolveEnvironment.ts
180992
+ var findContract2 = publicContractsV1.environment.find;
180993
+ var getContract = publicContractsV1.environment.get;
180994
+ async function resolveEnvironment(deps, opts) {
180995
+ const explicit = opts.explicit?.trim();
180996
+ if (explicit)
180997
+ return resolveRef2(deps, explicit);
180998
+ const fromEnvVar = deps.env["QAWOLF_ENVIRONMENT"]?.trim();
180999
+ if (fromEnvVar) {
181000
+ deps.ui.info(environmentsMessages.usingFromEnvVar(fromEnvVar));
181001
+ return resolveRef2(deps, fromEnvVar);
181002
+ }
181003
+ if (deps.ui.mode !== "human") {
181004
+ return { kind: "error", error: opts.requiredMessage };
181005
+ }
181006
+ return pickEnvironment(deps);
181007
+ }
181008
+ async function resolveRef2(deps, ref) {
181009
+ const result = await deps.platformClient.callPublicApi(getContract, {
181010
+ environmentId: ref
181011
+ });
181012
+ if (!result.ok) {
181013
+ return {
181014
+ kind: "error",
181015
+ error: environmentsMessages.couldNotResolve(ref, result.error)
181016
+ };
181017
+ }
181018
+ if (result.value.id !== ref) {
181019
+ deps.ui.info(environmentsMessages.resolvedAlias(ref, result.value.id));
181020
+ }
181021
+ return { kind: "resolved", env: result.value.id };
181022
+ }
181023
+
180997
181024
  // src/commands/flows/withResolvedEnv.ts
180998
181025
  function withResolvedEnv(signals, args, fn2) {
180999
181026
  return (opts, command) => {
@@ -183797,8 +183824,10 @@ function registerFlowsRunCommand(flows, signals) {
183797
183824
  kindNote: "read with --env"
183798
183825
  }).description("Run flows matching [pattern], or every flow when omitted; with --env, pull missing flows from that QA Wolf environment").option("--retries <n>", "Retry each failing flow up to this many times", parseInteger("--retries", { min: 0 }), 0).option("--bail", "Stop the run after the first failure", false).option("--workers <n>", "Parallel worker count for web flows", parseInteger("--workers", { min: 1 }), 1).option("--timeout <ms>", "Default timeout for actions and assertions, in milliseconds", parseInteger("--timeout", { min: 0 }), 30000).option("--video <mode>", "Record video: on | off | retain-on-failure", parseEnum("--video", videoModes), videoDefault).option("--trace <mode>", "Record Playwright trace: on | off | retain-on-failure", parseEnum("--trace", traceModes), traceDefault).option("--har <mode>", "Record HAR network log: on | off | retain-on-failure", parseEnum("--har", harModes), harDefault).option("--har-content <mode>", "HAR response bodies: omit | full (full uses more memory)", parseEnum("--har-content", harContentModes), harContentDefault).option("--output-dir <path>", "Directory for run artifacts (videos, traces, HAR)", defaultOutputDir).option("--junit [path]", "Write a JUnit XML report (default: <output-dir>/junit-report.xml)").option("--headed", "Show the browser window instead of headless", false).option("--env <env>", "Pull and run a flow from this environment (UUID or slug) if not cached locally").option("--deps <dir>", "Use this prepared dependency directory instead of auto-installing the runtime; or set QAWOLF_RUNTIME_DIR to relocate the managed runtime").option("--no-browser-deps", "Skip installing OS-level browser dependencies (Linux --with-deps, which needs root); requires the system libraries to already be present").addHelpText("after", runExamples).action((pattern, opts, command) => {
183799
183826
  if (opts.env !== undefined) {
183800
- const hybridFlags = { ...opts, env: opts.env };
183801
- return withAuthContext(signals, (ctx) => handleHybridFlowsRun(ctx, pattern, hybridFlags))(opts, command);
183827
+ return withResolvedEnv(signals, {
183828
+ explicit: opts.env,
183829
+ requiredMessage: flowsMessages.run.requiresEnv
183830
+ }, (ctx, env3) => handleHybridFlowsRun(ctx, pattern, { ...opts, env: env3 }))(opts, command);
183802
183831
  }
183803
183832
  return withContext(signals, (ctx) => handleFlowsRun(ctx, pattern, opts))(opts, command);
183804
183833
  });
@@ -184697,4 +184726,4 @@ createProgram({ signals }).parseAsync().catch(() => {
184697
184726
  process.exitCode = 1;
184698
184727
  }).finally(() => flushAndExit(typeof process.exitCode === "number" ? process.exitCode : 0));
184699
184728
 
184700
- //# debugId=80FB9FE67B1F0A9564756E2164756E21
184729
+ //# debugId=F77E4418A62E284264756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qawolf/cli",
3
- "version": "1.7.1",
3
+ "version": "1.7.2",
4
4
  "description": "Run and manage QA Wolf flows from the terminal, CI, or an AI agent",
5
5
  "keywords": [
6
6
  "automation",