@qawolf/cli 1.40.0 → 1.41.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.
@@ -7222,6 +7222,7 @@ var defaultIdSchemas = {
7222
7222
  flow: string2().min(1).describe("The id of the flow."),
7223
7223
  issue: string2().min(1).describe("The id of the issue."),
7224
7224
  legacyTrigger: string2().min(1).describe("The id of the legacy trigger, from legacyTrigger.find."),
7225
+ promotion: string2().min(1).describe("The id of the promotion, from promotion.find or environment.promote."),
7225
7226
  run: string2().min(1).describe("The id of the run."),
7226
7227
  runAttempt: string2().min(1).describe("The id of the run attempt."),
7227
7228
  trigger: string2().min(1).describe("The id of the trigger."),
@@ -7544,7 +7545,7 @@ var makeInspectOnRunnerContract = (ids) => {
7544
7545
  openWorldHint: false,
7545
7546
  readOnlyHint: false
7546
7547
  },
7547
- description: "Inspect one thing on an interactive runner: an element's HTML, the page's HTML simplified for a model, or a top-level variable's value as JSON. This refreshes the inactivity timer and can extend the runner's billed lifetime. `nothing-to-inspect` means the runner had nothing to answer with: no live page, no element matching the selector, or no variable under that name. A runner cannot tell those apart, so it reports the one reason and puts whatever it did say in `errorMessage`. `runner-is-not-a-browser` on a mobile runner — call `runner.inspectMobile` for its equivalent surface instead. " + retryableRunnerUnreachableDescription,
7548
+ description: "Inspect one thing on an interactive runner: an element's HTML, the page's HTML simplified for a model, or a top-level variable's value as JSON. This refreshes the inactivity timer and can extend the runner's billed lifetime. `nothing-to-inspect` means the runner had nothing to answer with: no live page, no element matching the selector, or no variable under that name. A runner cannot tell those apart, so it reports the one reason and puts whatever it did say in `errorMessage`. A mobile or Windows runner answers `variable`; for `element-html` or `page-html` it answers `runner-is-not-a-browser` — call `runner.inspectMobile` for its equivalent surface instead. " + retryableRunnerUnreachableDescription,
7548
7549
  input,
7549
7550
  kind: "read",
7550
7551
  name: "runner.inspect",
@@ -7615,8 +7616,8 @@ var elementsRequestSchema = discriminatedUnion("by", [
7615
7616
  by: literal("point"),
7616
7617
  context: string2().min(1).optional(),
7617
7618
  what: literal("elements"),
7618
- x: int().min(0).describe("Whole pixels on the device's own screen."),
7619
- y: int().min(0).describe("Whole pixels on the device's own screen.")
7619
+ x: int().min(0).describe("Whole pixels in the same space as `runner.takeScreenshot`."),
7620
+ y: int().min(0).describe("Whole pixels in the same space as `runner.takeScreenshot`.")
7620
7621
  }),
7621
7622
  object({
7622
7623
  by: literal("text"),
@@ -7678,7 +7679,7 @@ var inspectMobileAnswerSchema = discriminatedUnion("what", [
7678
7679
  context: string2(),
7679
7680
  orientation: orientationSchema,
7680
7681
  outcome: literal("success"),
7681
- pageSource: pageSourceNodeSchema,
7682
+ pageSource: pageSourceNodeSchema.describe("The element tree. Its bounds are in the device's own pixels, not the screenshot's; to find a point to act on, ask for `elements`, whose bounds and centers are in screenshot pixels."),
7682
7683
  what: literal("page")
7683
7684
  }),
7684
7685
  object({
@@ -7714,7 +7715,7 @@ var makeInspectMobileOnRunnerContract = (ids) => {
7714
7715
  openWorldHint: false,
7715
7716
  readOnlyHint: true
7716
7717
  },
7717
- description: `Inspect one thing on a mobile interactive runner: the Appium session's status, the WebView contexts available, the current context's page source, or the elements at a point, carrying some text, or matching a selector. This does not refresh the runner's inactivity timer. Mobile only — a browser runner answers \`runner-is-not-mobile\`; call \`runner.inspect\` for a browser's equivalent surface instead. \`what: "session"\` always answers with the session's own status rather than \`screen-needs-a-run\`, since that is the question it exists to answer; the other three request kinds need a live session first and answer the same \`screen-needs-a-run\` or \`screen-not-ready\` outcomes \`runner.performAction\` and \`runner.takeScreenshot\` use, instead of reading anything when there is none. \`screen-needs-a-run\` means no Appium session has started on this runner yet — call \`runner.runFlow\` with a flow that opens one, then inspect again. \`screen-not-ready\` means the runner's Appium session exists but did not answer this instant, or more than one is somehow live — retry once; if it persists, relaunch the runner. \`runner-is-not-mobile\` means there is nothing here to inspect, and retrying will never help — launch an \`android\` or \`ios\` runner instead. \`invalid-selector\` (elements by selector only) means the selector itself could not be parsed under the given \`strategy\` — distinct from a selector that parsed fine but matched nothing, which answers \`matches: []\` instead. ${retryableRunnerUnreachableDescription}`,
7718
+ description: `Inspect one thing on a mobile or Windows interactive runner: the Appium session's status, the contexts available (WebViews on mobile, top-level windows on Windows), the current context's page source, or the elements at a point, carrying some text, or matching a selector. This does not refresh the runner's inactivity timer. Mobile and Windows only — a browser runner answers \`runner-is-not-mobile\`; call \`runner.inspect\` for a browser's equivalent surface instead. \`what: "session"\` always answers with the session's own status rather than \`screen-needs-a-run\`, since that is the question it exists to answer; the other three request kinds need a live session first and answer the same \`screen-needs-a-run\` or \`screen-not-ready\` outcomes \`runner.performAction\` and \`runner.takeScreenshot\` use, instead of reading anything when there is none. \`screen-needs-a-run\` means no Appium session has started on this runner yet — call \`runner.runFlow\` with a flow that opens one, then inspect again. \`screen-not-ready\` means the runner's Appium session exists but did not answer this instant, or more than one is somehow live — retry once; if it persists, relaunch the runner. \`runner-is-not-mobile\` means there is nothing here to inspect, and retrying will never help — launch an \`android\`, \`ios\` or \`windows\` runner instead. \`invalid-selector\` (elements by selector only) means the selector itself could not be parsed under the given \`strategy\` — distinct from a selector that parsed fine but matched nothing, which answers \`matches: []\` instead. ${retryableRunnerUnreachableDescription}`,
7718
7719
  input,
7719
7720
  kind: "read",
7720
7721
  name: "runner.inspectMobile",
@@ -7845,19 +7846,20 @@ var screenFailureReasons = [
7845
7846
  "screen-not-ready"
7846
7847
  ];
7847
7848
  var screenNotReadyDescription = "`screen-not-ready` if the runner has a screen that cannot serve this instant. Retry in a second or two: the desktop restarts when a run changes the display size, and it serves one see-or-act request at a time, so a screenshot or action already in flight is the usual reason. Do not submit a run to clear this — a run may restart the display and discard what is on it.";
7848
- var screenNeedsARunDescription = "`screen-needs-a-run` if the runner's virtual desktop has never started. Waiting will not change this and retrying is pointless — call `runner.runFlow` with a flow that opens a browser, then ask for the screen again. On a runner image with a browser that has never run anything, any `runner.performAction` also starts the browser itself. Evaluating a snippet does not start the desktop.";
7849
- var runnerHasNoScreenDescription = "`runner-has-no-screen` if this runner has no browser desktop to see or drive, and retrying will never help. Launch a `playwright` runner, or on `windows` use `runner.runFlow`.";
7849
+ var screenNeedsARunDescription = "`screen-needs-a-run` if the runner's virtual desktop has never started. Waiting will not change this and retrying is pointless — call `runner.runFlow` with a flow that opens a browser, then ask for the screen again. On a Windows runner any flow run claims the VM and brings up its screen. On a runner image with a browser that has never run anything, any `runner.performAction` also starts the browser itself. Evaluating a snippet does not start the desktop.";
7850
+ var runnerHasNoScreenDescription = "`runner-has-no-screen` if this runner has no browser desktop to see or drive, and retrying will never help. Launch a `playwright` runner.";
7850
7851
  var screenshotImageSchema = string2().min(1).describe("The screenshot, as a base64-encoded JPEG. Decode it and write the bytes to a `.jpg` file — writing this string to the file leaves you with base64 text rather than an image.");
7851
7852
 
7852
7853
  // node_modules/@qawolf/api-contracts/dist/v1/runner/performAction.js
7853
7854
  var unreachableDescription = "`runner-unreachable` if the runner could not be reached: it may still be starting, it may have terminated after inactivity, or it may have stopped answering mid-action. This does not mean the action was not performed — take a screenshot before repeating it.";
7854
- var notSupportedOnMobileDescription = "`action-not-supported-on-mobile` if the runner is a mobile device and this action has no touchscreen equivalent: `double_click`, `scroll`, `move`, `keypress` and `navigate`, and a `click` whose `button` is not `left`, are all pointer-device concepts a touchscreen has nothing to offer for. `type` types into whatever the last tap focused. Deprecated on mobile and to be removed: `click` taps and `drag` swipes between its path's first and last point; send `tap` and `swipe` instead.";
7855
- var mobileActionsDescription = "Only a mobile runner performs `tap`, `swipe` and `fill`: `tap` touches a point or the element a `selector` names, `swipe` moves from one point to another over `duration_ms`, and `fill` replaces the value of the field a `selector` names. A browser runner answers them with `action-not-supported-on-browser`.";
7856
- var withScreenshotDescription = "With `withScreenshot: true`, the answer also carries `imageJpegBase64`: a screenshot taken after the action. One call instead of `runner.performAction` followed by `runner.takeScreenshot`. The action itself is performed exactly as without the option; if the screen could serve no frame after it — a display restart, or a `navigate` on a desktop that is still starting — the action's result comes back without `imageJpegBase64`, so take a screenshot separately rather than repeating the action. On a mobile runner the screenshot is the device's own, taken right after a performed action.";
7855
+ var notSupportedOnMobileDescription = "`action-not-supported-on-mobile` if the runner is a mobile device and this is a browser action other than `type`: `click`, `double_click`, `drag`, `scroll`, `move`, `keypress` and `navigate` describe a mouse and keyboard, so send `tap` and `swipe` instead. `type` types into whatever the last tap focused.";
7856
+ var mobileActionsDescription = "Only a mobile or Windows runner performs `tap`, `swipe` and `fill`: `tap` touches a point or the element a `selector` names, `swipe` moves from one point to another over `duration_ms`, and `fill` replaces the value of the field a `selector` names. A browser runner answers them with `action-not-supported-on-browser`.";
7857
+ var windowsActionsDescription = "On a Windows runner, `click`, `double_click`, `move`, `scroll`, `drag`, `keypress` and `type` act on the whole desktop with a mouse and keyboard, at screenshot coordinates; a `drag` takes only its start and end point, and `swipe` is a drag. `tap` and `fill` also accept a UI Automation XPath `selector` (as in `runner.inspectMobile`) in place of a point. `navigate` is refused with `action-failed` because it needs a browser: open the page from a flow instead. Take points to act on from `runner.inspectMobile` `elements` (their `center`), not from page-source bounds, which are in the desktop's own pixels.";
7858
+ var withScreenshotDescription = "With `withScreenshot: true`, the answer also carries `imageJpegBase64`: a screenshot taken after the action. One call instead of `runner.performAction` followed by `runner.takeScreenshot`. The action itself is performed exactly as without the option; if the screen could serve no frame after it — a display restart, or a `navigate` on a desktop that is still starting — the action's result comes back without `imageJpegBase64`, so take a screenshot separately rather than repeating the action. On a mobile or Windows runner the screenshot is the device's own screen (on Windows, the whole desktop), taken right after a performed action.";
7857
7859
  var maxActionErrorMessageLength = 1000;
7858
7860
  var makePerformActionOnRunnerContract = (ids) => {
7859
7861
  const input = object({
7860
- action: runnerActionSchema.describe(`The action to perform. Coordinates are whole pixels on the runner's virtual desktop, in the same space as \`runner.takeScreenshot\`. The browser action shapes follow the computer-use vocabulary, minus \`screenshot\` (use \`runner.takeScreenshot\`) and \`wait\` (delay on the caller's side). A \`navigate\` does not go through the screen, so a screen that is not ready does not stop it. ${notSupportedOnMobileDescription} ${mobileActionsDescription}`),
7862
+ action: runnerActionSchema.describe(`The action to perform. Coordinates are whole pixels on the runner's virtual desktop, in the same space as \`runner.takeScreenshot\`. The browser action shapes follow the computer-use vocabulary, minus \`screenshot\` (use \`runner.takeScreenshot\`) and \`wait\` (delay on the caller's side). A \`navigate\` does not go through the screen, so a screen that is not ready does not stop it. ${notSupportedOnMobileDescription} ${mobileActionsDescription} ${windowsActionsDescription}`),
7861
7863
  id: runnerIdSchema.describe("Id of the runner to act on."),
7862
7864
  withScreenshot: boolean2().optional().describe(withScreenshotDescription),
7863
7865
  workspaceId: ids.workspace.optional().describe(runnerWorkspaceIdDescription)
@@ -7895,7 +7897,7 @@ var makePerformActionOnRunnerContract = (ids) => {
7895
7897
  openWorldHint: true,
7896
7898
  readOnlyHint: false
7897
7899
  },
7898
- description: `Perform one raw action on an interactive runner: click, double_click, move, drag, scroll, keypress, type, or navigate; on mobile, tap, swipe, fill, or type. One action per request, and the runner serves one at a time. A success means the action took effect. \`action-failed\`, with a reason, if it reached the runner and did not take effect. On a runner image with a browser, the first action on a runner that has never run anything starts its browser and waits for it, so it can take up to a minute to answer — no \`runner.runFlow\` is needed before acting; if the browser is still starting when the wait runs out, the answer is \`screen-not-ready\` and retrying converges. On a mobile runner, the same \`screen-needs-a-run\` and \`screen-not-ready\` outcomes mean no Appium session has started yet, or it did not answer this instant; \`runner.runFlow\` is what starts one, same as a browser. \`screen-needs-a-run\` if the browser could not be started that way — usually a runner whose runs all finished without starting its desktop; call \`runner.runFlow\` with a flow that opens a browser. ${screenNotReadyDescription} ${runnerHasNoScreenDescription} ${unreachableDescription}`,
7900
+ description: `Perform one raw action on an interactive runner: click, double_click, move, drag, scroll, keypress, type, or navigate; on mobile or Windows, also tap, swipe, or fill. One action per request, and the runner serves one at a time. A success means the action took effect. \`action-failed\`, with a reason, if it reached the runner and did not take effect. On a runner image with a browser, the first action on a runner that has never run anything starts its browser and waits for it, so it can take up to a minute to answer — no \`runner.runFlow\` is needed before acting; if the browser is still starting when the wait runs out, the answer is \`screen-not-ready\` and retrying converges. On a mobile or Windows runner, the same \`screen-needs-a-run\` and \`screen-not-ready\` outcomes mean no Appium session has started yet, or it did not answer this instant; \`runner.runFlow\` is what starts one, same as a browser. \`screen-needs-a-run\` if the browser could not be started that way — usually a runner whose runs all finished without starting its desktop; call \`runner.runFlow\` with a flow that opens a browser. ${screenNotReadyDescription} ${runnerHasNoScreenDescription} ${unreachableDescription}`,
7899
7901
  input,
7900
7902
  kind: "write",
7901
7903
  name: "runner.performAction",
@@ -8004,7 +8006,7 @@ var makePerformActionsOnRunnerContract = (ids) => {
8004
8006
  openWorldHint: true,
8005
8007
  readOnlyHint: false
8006
8008
  },
8007
- description: "Perform a sequence of raw actions on an interactive runner in one request, one after another, and answer with what happened to each. A `success` means every action took effect. A `failure` names the first action that did not (`failedIndex`, `failureReason`), the last one that did (`lastCompletedIndex`), and whether actions were left unperformed (`stoppedEarly`); `results` has one entry per action reached, in order. Read `effect` on an entry before sending its action again: `performed` means the runner did it; `not-performed` means the runner answered that it did not take effect, though a `navigate` that timed out may still be loading; `unknown` means the runner stopped answering with the action in flight (`runner-unreachable`), or its screen went quiet mid-action (`action-unconfirmed`), and it may have taken effect — a click that submitted a form, say — so take a screenshot instead of repeating it. A sequence gets about a minute to start its actions; an action it did not reach in time is `out-of-time`, nothing after it was attempted, and the rest can go in a new request. Everything `runner.performAction` says about a runner that has never run anything, a mobile runner, and the `screen-needs-a-run`, `screen-not-ready`, `runner-has-no-screen`, `action-not-supported-on-mobile` and `action-not-supported-on-browser` reasons holds for each action here.",
8009
+ description: "Perform a sequence of raw actions on an interactive runner in one request, one after another, and answer with what happened to each. A `success` means every action took effect. A `failure` names the first action that did not (`failedIndex`, `failureReason`), the last one that did (`lastCompletedIndex`), and whether actions were left unperformed (`stoppedEarly`); `results` has one entry per action reached, in order. Read `effect` on an entry before sending its action again: `performed` means the runner did it; `not-performed` means the runner answered that it did not take effect, though a `navigate` that timed out may still be loading; `unknown` means the runner stopped answering with the action in flight (`runner-unreachable`), or its screen went quiet mid-action (`action-unconfirmed`), and it may have taken effect — a click that submitted a form, say — so take a screenshot instead of repeating it. A sequence gets about a minute to start its actions; an action it did not reach in time is `out-of-time`, nothing after it was attempted, and the rest can go in a new request. Everything `runner.performAction` says about a runner that has never run anything, a mobile or Windows runner, and the `screen-needs-a-run`, `screen-not-ready`, `runner-has-no-screen`, `action-not-supported-on-mobile` and `action-not-supported-on-browser` reasons holds for each action here.",
8008
8010
  input,
8009
8011
  kind: "write",
8010
8012
  name: "runner.performActions",
@@ -8598,6 +8600,88 @@ var makeAgentSendContract = (ids) => {
8598
8600
  };
8599
8601
  };
8600
8602
 
8603
+ // node_modules/@qawolf/api-contracts/dist/v1/attempt/get.js
8604
+ var makeGetAttemptContract = (ids) => {
8605
+ const input = object({ attemptId: ids.runAttempt });
8606
+ const attemptStatus = _enum([
8607
+ "passed",
8608
+ "failed",
8609
+ "canceled",
8610
+ "aborted",
8611
+ "skipped"
8612
+ ]);
8613
+ const attemptNeighbor = object({
8614
+ attemptId: ids.runAttempt,
8615
+ status: attemptStatus
8616
+ });
8617
+ const response = object({
8618
+ flowId: ids.flow,
8619
+ flowStatus: _enum(publicRunStatusValues),
8620
+ retryContext: object({
8621
+ currentOrdinal: number2().int().min(1),
8622
+ next: attemptNeighbor.optional(),
8623
+ previous: attemptNeighbor.optional(),
8624
+ total: number2().int().min(1)
8625
+ }),
8626
+ runId: ids.run,
8627
+ runStatus: _enum(publicRunSummaryStatusValues)
8628
+ });
8629
+ const attempt = object({
8630
+ attemptId: ids.runAttempt,
8631
+ completedAt: exports_iso.datetime().optional(),
8632
+ createdAt: exports_iso.datetime(),
8633
+ error: string2().optional(),
8634
+ startedAt: exports_iso.datetime().optional()
8635
+ });
8636
+ const output = discriminatedUnion("artifactStatus", [
8637
+ response.extend({
8638
+ artifacts: object({
8639
+ logsUrl: url().optional(),
8640
+ traceUrl: url().optional(),
8641
+ videoUrl: url().optional()
8642
+ }),
8643
+ artifactStatus: literal("signed"),
8644
+ attempt: attempt.extend({
8645
+ kind: literal("automated"),
8646
+ status: attemptStatus
8647
+ })
8648
+ }),
8649
+ response.extend({
8650
+ artifacts: object({}).strict(),
8651
+ artifactStatus: literal("signing-failed"),
8652
+ attempt: attempt.extend({
8653
+ kind: literal("automated"),
8654
+ status: attemptStatus
8655
+ })
8656
+ }),
8657
+ response.extend({
8658
+ artifacts: object({}).strict(),
8659
+ artifactStatus: literal("not-captured"),
8660
+ attempt: attempt.extend({
8661
+ kind: literal("manual"),
8662
+ status: literal("passed")
8663
+ })
8664
+ })
8665
+ ]);
8666
+ return {
8667
+ annotationJustifications: {
8668
+ destructiveHint: "Does not retry, cancel or alter the run attempt.",
8669
+ openWorldHint: "Reads recorded QA Wolf artifacts without changing the application under test.",
8670
+ readOnlyHint: "Retrieves a finished attempt's metadata and signed artifact URLs."
8671
+ },
8672
+ annotations: {
8673
+ destructiveHint: false,
8674
+ openWorldHint: false,
8675
+ readOnlyHint: true
8676
+ },
8677
+ description: "Get a finished run attempt: its run and flow status, its place among that flow's attempts in the run, and signed links to its logs, trace, and video when they were captured.",
8678
+ input,
8679
+ kind: "read",
8680
+ name: "attempt.get",
8681
+ output
8682
+ };
8683
+ };
8684
+
8601
8685
  // node_modules/@qawolf/api-contracts/dist/v1/codeHostIntegration/resource.js
8602
8686
  var makeCodeHostIntegrationResourceSchema = () => resource({
8603
8687
  connectedAt: exports_iso.datetime().describe("When the code host was connected to the workspace."),
@@ -9164,6 +9248,32 @@ var makeDeleteEnvironmentVariableContract = (ids) => {
9164
9248
  };
9165
9249
  };
9166
9250
 
9251
+ // node_modules/@qawolf/api-contracts/dist/v1/environment/discard.js
9252
+ var makeDiscardEnvironmentContract = (ids) => {
9253
+ const input = object({
9254
+ environmentId: ids.environmentRef,
9255
+ workspaceId: workspaceForEnvironmentRef(ids.workspace)
9256
+ });
9257
+ const output = makeEnvironmentResourceSchema(ids);
9258
+ return {
9259
+ annotationJustifications: {
9260
+ destructiveHint: "Terminates the environment for good: its runs are canceled and its flow changes are never promoted.",
9261
+ openWorldHint: "Changes QA Wolf environments only, not the customer's own repository or deployments.",
9262
+ readOnlyHint: "Terminates an environment and returns it terminated."
9263
+ },
9264
+ annotations: {
9265
+ destructiveHint: true,
9266
+ openWorldHint: false,
9267
+ readOnlyHint: false
9268
+ },
9269
+ description: "Declare a preview environment's work discarded, typically when its pull request closes without merging: the environment is terminated and its flow changes are not promoted into its base. Returns the environment, now terminated. A terminated environment cannot be discarded again. Use environment.promote instead when the work is accepted.",
9270
+ input,
9271
+ kind: "write",
9272
+ name: "environment.discard",
9273
+ output
9274
+ };
9275
+ };
9276
+
9167
9277
  // node_modules/@qawolf/api-contracts/dist/v1/environment/find.js
9168
9278
  var makeFindEnvironmentsContract = (ids) => {
9169
9279
  const input = object({
@@ -9309,6 +9419,58 @@ var makeSetEnvironmentVariableContract = (ids) => {
9309
9419
  };
9310
9420
  };
9311
9421
 
9422
+ // node_modules/@qawolf/api-contracts/dist/v1/promotion/resource.js
9423
+ var promotionStatusSchema = _enum([
9424
+ "pending",
9425
+ "conflicted",
9426
+ "resolving",
9427
+ "promoted",
9428
+ "no-changes",
9429
+ "abandoned"
9430
+ ]).describe("pending (requested, the merge has not run yet), conflicted (the head's flow changes clash with the base and await a resolution), resolving (a submitted resolution is being applied), promoted (merged into the base and the head environment terminated), no-changes (the head had nothing to promote and was terminated), abandoned (the head environment was discarded or terminated before the promotion settled).");
9431
+ var conflictSchema = object({
9432
+ paths: array(string2()).describe("Every path that conflicts between the head and the base. A resolution must cover exactly these paths."),
9433
+ sourceCommitHash: string2().describe("The head environment's flow code commit the conflict was computed against."),
9434
+ targetCommitHash: string2().describe("The base environment's flow code commit the conflict was computed against.")
9435
+ });
9436
+ var makePromotionResourceSchema = (ids) => resource({
9437
+ aiTaskId: ids.aiTask.optional().describe("The AI task dispatched to resolve this promotion's conflicts. Absent until the agent is dispatched. A promotion that stays conflicted after this is set means the agent could not resolve it."),
9438
+ baseEnvironmentId: ids.environment.describe("The environment the flow changes promote into."),
9439
+ conflict: conflictSchema.optional().describe("The conflict awaiting resolution. Present while status is conflicted or resolving. A resolution must name both commit hashes and cover exactly these paths; if either branch moves, the conflict is recomputed and this changes."),
9440
+ createdAt: exports_iso.datetime().describe("When the promotion was requested."),
9441
+ headEnvironmentId: ids.environment.describe("The environment whose flow changes are promoted."),
9442
+ id: ids.promotion,
9443
+ promotedCommitHash: string2().optional().describe("The commit the promotion landed on the base environment's flow code branch. Present when status is promoted."),
9444
+ settledAt: exports_iso.datetime().optional().describe("When the promotion reached promoted, no-changes or abandoned. Absent while it is open."),
9445
+ status: promotionStatusSchema
9446
+ }, { urlFieldDescription: "Absolute URL of the head environment's page." });
9447
+
9448
+ // node_modules/@qawolf/api-contracts/dist/v1/environment/promote.js
9449
+ var makePromoteEnvironmentContract = (ids) => {
9450
+ const input = object({
9451
+ environmentId: ids.environmentRef,
9452
+ workspaceId: workspaceForEnvironmentRef(ids.workspace)
9453
+ });
9454
+ const output = makePromotionResourceSchema(ids);
9455
+ return {
9456
+ annotationJustifications: {
9457
+ destructiveHint: "Merges the environment's flow changes into its base and terminates the environment once they land.",
9458
+ openWorldHint: "Changes QA Wolf flow code branches only, not the customer's own repository or deployments.",
9459
+ readOnlyHint: "Records a promotion request that a background executor carries out."
9460
+ },
9461
+ annotations: {
9462
+ destructiveHint: true,
9463
+ openWorldHint: false,
9464
+ readOnlyHint: false
9465
+ },
9466
+ description: "Declare a preview environment's work accepted, typically when its pull request merges: its flow changes are promoted into its base environment and the environment is terminated once they land. Returns the promotion in pending; poll promotion.get to learn how it settled. Calling again while a promotion is open returns that promotion. A conflict settles the promotion conflicted and cancels the environment's in-progress runs; promotion.get names the conflicting paths. Use environment.discard instead when the work is abandoned.",
9467
+ input,
9468
+ kind: "write",
9469
+ name: "environment.promote",
9470
+ output
9471
+ };
9472
+ };
9473
+
9312
9474
  // node_modules/@qawolf/api-contracts/dist/v1/environment/update.js
9313
9475
  var makeUpdateEnvironmentContract = (ids) => {
9314
9476
  const nameSchema = string2().trim().min(1).max(255).describe("New display name. Must be unique within the team.");
@@ -9671,7 +9833,8 @@ var makeInvestigationFindingSchema = (ids) => object({
9671
9833
  answer: string2().optional(),
9672
9834
  at: exports_iso.datetime(),
9673
9835
  reason: string2().optional(),
9674
- type: string2().describe('Known values: "answer" and "dispute". New values can appear.')
9836
+ text: string2().optional().describe("A person's answer in their own words, when they typed one."),
9837
+ type: string2().describe('Known values: "answer", "dispute" and "reply". New values can appear.')
9675
9838
  }).optional().describe("A person's answer or dispute that the investigation hasn't acted on yet."),
9676
9839
  state: string2().describe(investigationFindingStateDescription),
9677
9840
  steps: array(string2()).optional(),
@@ -9995,6 +10158,66 @@ var makeLegacyTriggerContracts = (ids) => ({
9995
10158
  resume: makeResumeLegacyTriggerContract(ids)
9996
10159
  });
9997
10160
 
10161
+ // node_modules/@qawolf/api-contracts/dist/v1/promotion/find.js
10162
+ var makeFindPromotionsContract = (ids) => {
10163
+ const input = object({
10164
+ environmentId: ids.environmentRef.optional().describe("Only list promotions out of this head environment, by id or alias. Omit to list the whole workspace's promotions."),
10165
+ status: promotionStatusSchema.optional().describe("Only list promotions in this status. Use conflicted to see the promotions that need attention."),
10166
+ workspaceId: ids.workspace.optional().describe("The workspace to list promotions from, which an environment alias resolves in. Required when authenticating with an organization or user API key."),
10167
+ ...makePaginationInputFields({ defaultLimit: 20, maxLimit: 100 })
10168
+ });
10169
+ const output = object({
10170
+ nextCursor: nextCursorSchema,
10171
+ promotions: array(makePromotionResourceSchema(ids)).describe("The workspace's promotions, newest first.")
10172
+ });
10173
+ return {
10174
+ annotationJustifications: {
10175
+ destructiveHint: "Does not change promotions, environments or flow code branches.",
10176
+ openWorldHint: "Reads private QA Wolf promotion records without changing external systems.",
10177
+ readOnlyHint: "Lists promotions in the authorized workspace without changing them."
10178
+ },
10179
+ annotations: {
10180
+ destructiveHint: false,
10181
+ openWorldHint: false,
10182
+ readOnlyHint: true
10183
+ },
10184
+ description: "List environment promotions, newest first. A promotion moves the flow changes made in a head environment into its base environment. Filter by status conflicted to find the promotions whose conflicts still need a resolution.",
10185
+ input,
10186
+ kind: "read",
10187
+ name: "promotion.find",
10188
+ output
10189
+ };
10190
+ };
10191
+
10192
+ // node_modules/@qawolf/api-contracts/dist/v1/promotion/get.js
10193
+ var makeGetPromotionContract = (ids) => {
10194
+ const input = object({ promotionId: ids.promotion });
10195
+ const output = makePromotionResourceSchema(ids);
10196
+ return {
10197
+ annotationJustifications: {
10198
+ destructiveHint: "Does not change the promotion, its environments or flow code branches.",
10199
+ openWorldHint: "Reads a private QA Wolf promotion record without changing external systems.",
10200
+ readOnlyHint: "Retrieves one authorized promotion's status and conflict without changing it."
10201
+ },
10202
+ annotations: {
10203
+ destructiveHint: false,
10204
+ openWorldHint: false,
10205
+ readOnlyHint: true
10206
+ },
10207
+ description: "Read one environment promotion: its status, the conflicting paths and commit hashes while it is conflicted or resolving, the commit it landed when promoted, and the AI task resolving it. Poll it after environment.promote to learn how the promotion settled. It does not serve file contents; a resolver reads both branches from the flow code repository.",
10208
+ input,
10209
+ kind: "read",
10210
+ name: "promotion.get",
10211
+ output
10212
+ };
10213
+ };
10214
+
10215
+ // node_modules/@qawolf/api-contracts/dist/v1/promotion/index.js
10216
+ var makePromotionContracts = (ids) => ({
10217
+ find: makeFindPromotionsContract(ids),
10218
+ get: makeGetPromotionContract(ids)
10219
+ });
10220
+
9998
10221
  // node_modules/@qawolf/api-contracts/dist/v1/run/investigationSessionId.js
9999
10222
  var investigationSessionId = string2().trim().min(1).max(100).optional();
10000
10223
 
@@ -10210,88 +10433,6 @@ var makeGetRunContract = (ids) => {
10210
10433
  };
10211
10434
  };
10212
10435
 
10213
- // node_modules/@qawolf/api-contracts/dist/v1/run/getAttemptArtifacts.js
10214
- var makeGetRunAttemptArtifactsContract = (ids) => {
10215
- const input = object({ attemptId: ids.runAttempt });
10216
- const attemptStatus = _enum([
10217
- "passed",
10218
- "failed",
10219
- "canceled",
10220
- "aborted",
10221
- "skipped"
10222
- ]);
10223
- const attemptNeighbor = object({
10224
- attemptId: ids.runAttempt,
10225
- status: attemptStatus
10226
- });
10227
- const response = object({
10228
- flowId: ids.flow,
10229
- flowStatus: _enum(publicRunStatusValues),
10230
- retryContext: object({
10231
- currentOrdinal: number2().int().min(1),
10232
- next: attemptNeighbor.optional(),
10233
- previous: attemptNeighbor.optional(),
10234
- total: number2().int().min(1)
10235
- }),
10236
- runId: ids.run,
10237
- runStatus: _enum(publicRunSummaryStatusValues)
10238
- });
10239
- const attempt = object({
10240
- attemptId: ids.runAttempt,
10241
- completedAt: exports_iso.datetime().optional(),
10242
- createdAt: exports_iso.datetime(),
10243
- error: string2().optional(),
10244
- startedAt: exports_iso.datetime().optional()
10245
- });
10246
- const output = discriminatedUnion("artifactStatus", [
10247
- response.extend({
10248
- artifacts: object({
10249
- logsUrl: url().optional(),
10250
- traceUrl: url().optional(),
10251
- videoUrl: url().optional()
10252
- }),
10253
- artifactStatus: literal("signed"),
10254
- attempt: attempt.extend({
10255
- kind: literal("automated"),
10256
- status: attemptStatus
10257
- })
10258
- }),
10259
- response.extend({
10260
- artifacts: object({}).strict(),
10261
- artifactStatus: literal("signing-failed"),
10262
- attempt: attempt.extend({
10263
- kind: literal("automated"),
10264
- status: attemptStatus
10265
- })
10266
- }),
10267
- response.extend({
10268
- artifacts: object({}).strict(),
10269
- artifactStatus: literal("not-captured"),
10270
- attempt: attempt.extend({
10271
- kind: literal("manual"),
10272
- status: literal("passed")
10273
- })
10274
- })
10275
- ]);
10276
- return {
10277
- annotationJustifications: {
10278
- destructiveHint: "Does not retry, cancel or alter the run attempt.",
10279
- openWorldHint: "Reads recorded QA Wolf artifacts without changing the application under test.",
10280
- readOnlyHint: "Retrieves a finished attempt's metadata and signed artifact URLs."
10281
- },
10282
- annotations: {
10283
- destructiveHint: false,
10284
- openWorldHint: false,
10285
- readOnlyHint: true
10286
- },
10287
- description: "Get metadata and signed artifact URLs for one finished run attempt.",
10288
- input,
10289
- kind: "read",
10290
- name: "run.getAttemptArtifacts",
10291
- output
10292
- };
10293
- };
10294
-
10295
10436
  // node_modules/@qawolf/api-contracts/dist/v1/run/optOutOfInvestigation.js
10296
10437
  var makeOptOutOfInvestigationRunContract = (ids) => {
10297
10438
  const input = object({
@@ -10888,7 +11029,7 @@ var makeTakeScreenshotOnRunnerContract = (ids) => {
10888
11029
  openWorldHint: false,
10889
11030
  readOnlyHint: false
10890
11031
  },
10891
- description: `Take one screenshot of an interactive runner's screen. On a runner with a browser the image is the whole virtual desktop, browser window and all; this refreshes the inactivity timer and can extend the runner's billed lifetime. On a mobile runner it is the device's own screen, re-encoded to JPEG on the pod so this contract reads one image format regardless of runner family. ${screenNeedsARunDescription} ${screenNotReadyDescription} ${runnerHasNoScreenDescription} ${retryableRunnerUnreachableDescription}`,
11032
+ description: `Take one screenshot of an interactive runner's screen. On a runner with a browser the image is the whole virtual desktop, browser window and all; this refreshes the inactivity timer and can extend the runner's billed lifetime. On a mobile runner it is the device's own screen, and on Windows the VM's whole desktop, re-encoded to JPEG on the pod so this contract reads one image format regardless of runner family. ${screenNeedsARunDescription} ${screenNotReadyDescription} ${runnerHasNoScreenDescription} ${retryableRunnerUnreachableDescription}`,
10892
11033
  input,
10893
11034
  kind: "read",
10894
11035
  name: "runner.takeScreenshot",
@@ -11020,6 +11161,9 @@ var makeContractsV1 = (ids) => {
11020
11161
  get: makeAgentGetContract(resolvedIds),
11021
11162
  send: makeAgentSendContract(resolvedIds)
11022
11163
  },
11164
+ attempt: {
11165
+ get: makeGetAttemptContract(resolvedIds)
11166
+ },
11023
11167
  codeHostIntegration: {
11024
11168
  find: makeFindCodeHostIntegrationsContract(resolvedIds),
11025
11169
  listRepositories: makeListCodeHostRepositoriesContract(resolvedIds)
@@ -11036,10 +11180,12 @@ var makeContractsV1 = (ids) => {
11036
11180
  environment: {
11037
11181
  create: makeCreateEnvironmentContract(resolvedIds),
11038
11182
  deleteVariable: makeDeleteEnvironmentVariableContract(resolvedIds),
11183
+ discard: makeDiscardEnvironmentContract(resolvedIds),
11039
11184
  find: makeFindEnvironmentsContract(resolvedIds),
11040
11185
  get: makeGetEnvironmentContract(resolvedIds),
11041
11186
  getVariable: makeGetEnvironmentVariableContract(resolvedIds),
11042
11187
  listVariableNames: makeListEnvironmentVariableNamesContract(resolvedIds),
11188
+ promote: makePromoteEnvironmentContract(resolvedIds),
11043
11189
  setVariable: makeSetEnvironmentVariableContract(resolvedIds),
11044
11190
  update: makeUpdateEnvironmentContract(resolvedIds)
11045
11191
  },
@@ -11060,13 +11206,13 @@ var makeContractsV1 = (ids) => {
11060
11206
  update: makeUpdateIssueContract(resolvedIds)
11061
11207
  },
11062
11208
  legacyTrigger: makeLegacyTriggerContracts(resolvedIds),
11209
+ promotion: makePromotionContracts(resolvedIds),
11063
11210
  run: {
11064
11211
  acceptScreenshotBaseline: makeAcceptScreenshotBaselineContract(resolvedIds),
11065
11212
  create: makeCreateRunContract(resolvedIds),
11066
11213
  diagnose: makeDiagnoseRunContract(resolvedIds),
11067
11214
  find: makeFindRunsContract(resolvedIds),
11068
11215
  get: makeGetRunContract(resolvedIds),
11069
- getAttemptArtifacts: makeGetRunAttemptArtifactsContract(resolvedIds),
11070
11216
  listScreenshotComparisons: makeListScreenshotComparisonsContract(resolvedIds),
11071
11217
  optOutOfInvestigation: makeOptOutOfInvestigationRunContract(resolvedIds),
11072
11218
  reattempt: makeReattemptRunContract(resolvedIds),
@@ -13030,6 +13176,20 @@ function makeDefaultFs() {
13030
13176
  await fs2.promises.writeFile(path, data, options ?? undefined);
13031
13177
  }
13032
13178
  },
13179
+ async writeFileExclusive(path, data, options) {
13180
+ try {
13181
+ await fs2.promises.writeFile(path, data, {
13182
+ encoding: typeof data === "string" ? "utf8" : undefined,
13183
+ flag: "wx",
13184
+ mode: options?.mode
13185
+ });
13186
+ return true;
13187
+ } catch (error) {
13188
+ if (errorCode(error) === "EEXIST")
13189
+ return false;
13190
+ throw error;
13191
+ }
13192
+ },
13033
13193
  openWriteHandle: openFsWriteHandle,
13034
13194
  readdir(path) {
13035
13195
  return fs2.promises.readdir(path);
@@ -15705,4 +15865,4 @@ export {
15705
15865
  createRunnerSdk
15706
15866
  };
15707
15867
 
15708
- //# debugId=ADFCE2FBF1F4DDA964756E2164756E21
15868
+ //# debugId=8AE38B5E661AE4A264756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qawolf/cli",
3
- "version": "1.40.0",
3
+ "version": "1.41.0",
4
4
  "description": "Run and manage QA Wolf flows from the terminal, CI, or an AI agent",
5
5
  "keywords": [
6
6
  "automation",
@@ -28,6 +28,7 @@
28
28
  "LICENSE",
29
29
  "README.md",
30
30
  "dist/cli.js",
31
+ "dist/investigation-parser.js",
31
32
  "dist/runner-sdk.js",
32
33
  "dist/types/runnerSdk/index.d.ts",
33
34
  "dist/types/runnerSdk/types.d.ts",
@@ -71,13 +72,14 @@
71
72
  "@clack/prompts": "1.5.1",
72
73
  "@napi-rs/keyring": "1.3.0",
73
74
  "@oxc-node/core": "0.1.0",
74
- "@qawolf/api-contracts": "0.81.0",
75
+ "@qawolf/api-contracts": "0.83.0",
75
76
  "@qawolf/emails": "1.1.1",
76
77
  "@qawolf/flow-targets": "1.0.0",
77
78
  "@qawolf/flows": "0.1.4",
78
79
  "@qawolf/testkit": "1.2.1",
79
80
  "commander": "14.0.3",
80
81
  "env-paths": "4.0.0",
82
+ "jszip": "3.10.1",
81
83
  "picomatch": "4.0.4",
82
84
  "pino": "10.3.1",
83
85
  "playwright": "1.62.0",
@@ -129,6 +129,9 @@ that `url`; never guess a route and never send a repository link in its place.
129
129
  | --- | --- | --- |
130
130
  | `qawolf agent get` | read | Read what the QA Wolf AI has said and whether it is still working |
131
131
  | `qawolf agent send` | write | Ask the QA Wolf AI to do a piece of work, such as covering a journey or fixing a broken flow |
132
+ | `qawolf attempt get` | read | Get a finished run attempt: its run and flow status, its place among that flow's attempts in the run, and signed links to its logs, trace, and video when they were captured. |
133
+ | `qawolf attempt inspect` | read | Inspect one kind of evidence for a finished attempt |
134
+ | `qawolf attempt investigate` | read | Summarize the evidence for one finished attempt |
132
135
  | `qawolf auth login` | local | Authenticate with QA Wolf in a browser or with an API key |
133
136
  | `qawolf auth logout` | local | Remove stored credentials |
134
137
  | `qawolf auth switch` | local | Choose which workspace to work in |
@@ -147,10 +150,12 @@ that `url`; never guess a route and never send a repository link in its place.
147
150
  | `qawolf email send` | write | Send an email from one of the workspace's inbox addresses, for example to exercise a flow that reacts to incoming mail. Returns the sent email; read it back with email.get. |
148
151
  | `qawolf environment create` | write | Create an environment on the caller's team and return it in the environment.get shape. This can also create a branch on the team's connected Git provider. |
149
152
  | `qawolf environment deleteVariable` | write | Remove one environment variable by name. Succeeds whether or not the variable existed. |
153
+ | `qawolf environment discard` | write | Declare a preview environment's work discarded, typically when its pull request closes without merging: the environment is terminated and its flow changes are not promoted into its base. Returns the environment, now terminated. A terminated environment cannot be discarded again. Use environment.promote instead when the work is accepted. |
150
154
  | `qawolf environment find` | read | List the team's environments, newest first. |
151
155
  | `qawolf environment get` | read | Read a single environment's name, kind, standing run health, flow-code branch and reconciliation state, run concurrency limit, and termination state. If flowCodeBranch exists, use its syncStatus for Git reconciliation and read lastSyncedCommitHash only when syncStatus is reconciled. |
152
156
  | `qawolf environment getVariable` | read | Read the values of named environment variables in one call. Values are secrets. Names that do not exist go to missingNames and do not fail the call. |
153
157
  | `qawolf environment listVariableNames` | read | Use this to answer which QA Wolf environment variables are available to test code. Returns names only; values never leave the server. |
158
+ | `qawolf environment promote` | write | Declare a preview environment's work accepted, typically when its pull request merges: its flow changes are promoted into its base environment and the environment is terminated once they land. Returns the promotion in pending; poll promotion.get to learn how it settled. Calling again while a promotion is open returns that promotion. A conflict settles the promotion conflicted and cancels the environment's in-progress runs; promotion.get names the conflicting paths. Use environment.discard instead when the work is abandoned. |
154
159
  | `qawolf environment setVariable` | write | Create or replace an environment variable. If the user asks to create one for "my email" without naming it, use DEFAULT_EMAIL. The value is never returned. |
155
160
  | `qawolf environment update` | write | Update an environment owned by the caller's team and return it in the environment.get shape. Omitted fields remain unchanged. |
156
161
  | `qawolf file requestDownload` | read | Get a URL for reading a file out of the caller's team storage. Answers 404 when nothing is stored at that path. |
@@ -176,12 +181,13 @@ that `url`; never guess a route and never send a repository link in its place.
176
181
  | `qawolf legacyTrigger find` | read | List a workspace's legacy per-environment triggers; trigger.find lists the current ones. For migration only; it goes when legacy triggers go. adaptiveFlowSelection becomes a generativeSuite action, which takes no tags. |
177
182
  | `qawolf legacyTrigger pause` | write | Pause one legacy trigger, the older per-environment kind, so it stops firing; use trigger.pause for a current one. Its copies in pull request environments pause too. For migration only; it goes when legacy triggers go. |
178
183
  | `qawolf legacyTrigger resume` | write | Resume one legacy trigger, the older per-environment kind; use trigger.resume for a current one. Its copies in pull request environments resume too, and a scheduled one jumps to the next upcoming slot even if it was not paused. For migration only; it goes when legacy triggers go. |
184
+ | `qawolf promotion find` | read | List environment promotions, newest first. A promotion moves the flow changes made in a head environment into its base environment. Filter by status conflicted to find the promotions whose conflicts still need a resolution. |
185
+ | `qawolf promotion get` | read | Read one environment promotion: its status, the conflicting paths and commit hashes while it is conflicted or resolving, the commit it landed when promoted, and the AI task resolving it. Poll it after environment.promote to learn how the promotion settled. It does not serve file contents; a resolver reads both branches from the flow code repository. |
179
186
  | `qawolf run acceptScreenshotBaseline` | write | Make the new screenshot of a failed screenshot comparison the baseline, so later runs compare with it. Use it only when the difference is an intended change of the app, not a bug, noise, or a page that was not ready. Every later run of every environment of the workspace compares with the new baseline. Refuses without changing anything when the baseline changed since the run. |
180
187
  | `qawolf run create` | write | Create a run for the selected flows and/or tags in an environment. |
181
188
  | `qawolf run diagnose` | write | Diagnose failed flows in a run as reproductions of a bug or maintenance report owned by the caller's team. The issue's type selects the diagnosis. Each flow must have failed in the run. A flow that is already diagnosed in the run moves to this issue, and may stay linked to other open reports. The diagnosis appears on the run, and the reproduction appears under the issue's reproductions. Coverage requests cannot be diagnosed; use issue.addFlows to cover flows instead. |
182
189
  | `qawolf run find` | read | List an environment's recent runs, newest first, including failed-attempt discovery metadata. |
183
190
  | `qawolf run get` | read | Get a run's status, per-flow results, links, and how many of its bugs are blocking. |
184
- | `qawolf run getAttemptArtifacts` | read | Get metadata and signed artifact URLs for one finished run attempt. |
185
191
  | `qawolf run listScreenshotComparisons` | read | List the screenshot comparisons that failed a run's flows, with the expected, actual and diff images of each. Only comparisons that caused a failure are listed: a screenshot that differs within tolerance, or that differs on a line that did not fail, is left out. Each comparison tells whether its baseline changed since the run and whether the baseline still passes in other environments. The image URLs expire after a few minutes; fetch the preview URLs to look at the images. The first call for an image makes its missing JPEG preview and keeps it in team storage, so later calls reuse it. |
186
192
  | `qawolf run optOutOfInvestigation` | write | Mark failed flows in a run as "do not investigate" (DNI): the failures need no bug or maintenance report. Each flow must have failed in the run and still be under investigation. A flow that already has a diagnosis cannot be opted out. A team or organization key records the opt-out as the workspace's automation user. To link a failure to a report instead, use run.diagnose. |
187
193
  | `qawolf run reattempt` | write | Request new attempts for a run's flows, in the same run. A flow is eligible once its result is failed or canceled and QA Wolf's automatic retries have finished. A fully investigated run no longer accepts reattempts. Attempts run with the latest flow code. Poll run.get for results. |