@qawolf/cli 2.2.2 → 2.4.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.
@@ -7365,6 +7365,37 @@ var defaultIdSchemas = {
7365
7365
  };
7366
7366
  var workspaceForEnvironmentRef = (workspace) => workspace.optional().describe("The workspace the environment belongs to, which an alias resolves in. Read it from whoami.");
7367
7367
 
7368
+ // node_modules/@qawolf/api-contracts/dist/v1/build/resource.js
7369
+ var buildPlatformSchema = _enum(["android", "ios"]).describe("The platform the build runs on, read from its file type.");
7370
+ var buildIdSchema = string2().regex(/^[a-z0-9]{24}obld$/, "Expected a build id from build.requestUpload.").describe("The id of the build, from build.requestUpload.");
7371
+ var makeBuildResourceSchema = (ids) => resource({
7372
+ appId: string2().describe("The package name (Android) or bundle ID (iOS) read from the file. A flow launches it with `launch({ app: { id } })`."),
7373
+ appName: string2().optional().describe("The app's display name, when the file names one."),
7374
+ branch: string2().optional().describe("The branch the uploader said the build came from."),
7375
+ buildNumber: string2().optional().describe("versionCode (Android) or CFBundleVersion (iOS), when the file has one."),
7376
+ commitSha: string2().optional().describe("The commit the uploader said the build came from."),
7377
+ createdAt: exports_iso.datetime().describe("When the build was created."),
7378
+ deletedAt: exports_iso.datetime().optional().describe("When the build was deleted. Runs never install it after."),
7379
+ environmentId: ids.environment.optional().describe("The environment whose runs install the build while it is the newest one there for its app and platform. Absent: only a run created with the build installs it."),
7380
+ fileName: string2().describe("The uploaded file's name."),
7381
+ id: buildIdSchema,
7382
+ platform: buildPlatformSchema,
7383
+ sizeBytes: number2().int().optional().describe("The file's size in bytes."),
7384
+ version: string2().optional().describe("versionName (Android) or CFBundleShortVersionString (iOS), when the file has one.")
7385
+ }, { urlFieldDescription: "Absolute URL of the team's Builds page." });
7386
+ var makeBuildEnvironmentSelectorSchema = (ids) => union([
7387
+ strictObject({
7388
+ id: ids.environment.describe("The id of an existing environment. Never creates an environment. Send an alias through name instead.")
7389
+ }),
7390
+ strictObject({
7391
+ baseEphemeralEnvironment: string2().trim().min(1).max(255).optional().describe("The alias or name of the environment a created ephemeral environment copies from. Only valid with ephemeral."),
7392
+ ephemeral: boolean2().optional().describe("Requests an ephemeral environment when the name creates one, such as a pull request's. A name that matches an existing environment keeps that environment's kind."),
7393
+ name: string2().trim().min(1).max(255).describe("The environment's alias or name, as deployment.reportStatus takes it. Creates the environment when none matches. It keeps its base's URL.")
7394
+ })
7395
+ ], {
7396
+ error: "Send environment as either { id } or { name }, with optional ephemeral and baseEphemeralEnvironment."
7397
+ });
7398
+
7368
7399
  // node_modules/@qawolf/api-contracts/dist/v1/run/flowSelection.js
7369
7400
  var makeFlowSelectionSchema = (ids) => object({
7370
7401
  flowIds: array(ids.flow).default([]),
@@ -7377,6 +7408,7 @@ var makeFlowSelectionSchema = (ids) => object({
7377
7408
  var makeCreateRunContract = (ids) => {
7378
7409
  const input = object({
7379
7410
  aiTaskId: ids.aiTask.optional().describe("The AI task whose conversation should receive run status updates."),
7411
+ builds: array(buildIdSchema).min(1).max(20).optional().describe("Builds to install in this run only. Each replaces the environment's latest build of its app and platform."),
7380
7412
  chatSessionId: ids.chatSession.optional().describe("The chat session whose transcript should receive run status updates."),
7381
7413
  environmentId: ids.environmentRef,
7382
7414
  environmentVariables: record(string2(), string2()).optional().describe("Environment variables for this run only, over the environment's own."),
@@ -7844,14 +7876,14 @@ var makeInspectMobileOnRunnerContract = (ids) => {
7844
7876
  annotationJustifications: {
7845
7877
  destructiveHint: "Does not change application data, edit tests, or stop the runner.",
7846
7878
  openWorldHint: "Inspects the existing QA Wolf mobile runner without submitting application actions or contacting arbitrary services.",
7847
- readOnlyHint: "Reads mobile session status, contexts, page source, or elements without refreshing the runner's inactivity timer."
7879
+ readOnlyHint: "Reads mobile session status, contexts, page source, or elements and refreshes activity, which can cancel an inactivity shutdown."
7848
7880
  },
7849
7881
  annotations: {
7850
7882
  destructiveHint: false,
7851
7883
  openWorldHint: false,
7852
- readOnlyHint: true
7884
+ readOnlyHint: false
7853
7885
  },
7854
- 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}`,
7886
+ 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 refreshes the inactivity timer and can extend the runner's billed lifetime. 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}`,
7855
7887
  input,
7856
7888
  kind: "read",
7857
7889
  name: "runner.inspectMobile",
@@ -8220,7 +8252,7 @@ var makeRecordOnRunnerContract = (ids) => {
8220
8252
  openWorldHint: false,
8221
8253
  readOnlyHint: false
8222
8254
  },
8223
- description: "Control video recording on a Playwright runner. Start requires a caller-generated UUID; stop targets that UUID so retries cannot stop a later recording. Manual capture spans runs and suppresses automatic capture. Auto settings affect subsequent full runs. The URL opens recording history after the runner terminates. Videos may be unavailable after abrupt pod loss.",
8255
+ description: "Control video recording on a browser, mobile, Windows, or Mac runner. Start requires a caller-generated UUID; stop targets that UUID so retries cannot stop a later recording. Manual capture spans runs and suppresses automatic capture. Auto settings affect subsequent full runs. The URL opens recording history after the runner terminates. Videos may be unavailable after abrupt pod loss.",
8224
8256
  input,
8225
8257
  kind: "write",
8226
8258
  name: "runner.record",
@@ -8301,6 +8333,7 @@ var makeTriggerActionSchema = (ids) => object({
8301
8333
  investigateFailures: boolean2().optional().describe("Whether QA Wolf investigates failures in the resulting runs. Defaults to true."),
8302
8334
  kind: triggerActionKindSchema.default("createSuite"),
8303
8335
  runConcurrencyLimit: string2().trim().min(1).max(255).optional().describe(`How many runs of the resulting suite may execute at once: a whole number from 1 to 1000, "unlimited", or a concurrency expression, which the server validates. It replaces the environment's limit rather than capping below it. Omit it to leave the environment's limit in charge.`),
8336
+ suggestCoverage: boolean2().optional().describe("Whether QA Wolf explores the environment after the resulting runs and suggests coverage that nothing tests yet. Defaults to false."),
8304
8337
  tagNames: array(string2().min(1)).default([]).describe("Tags naming the flows to run. Combined with flowIds.")
8305
8338
  }).describe("What the trigger runs when it fires.");
8306
8339
  var makeTriggerScheduleFields = (ids) => ({
@@ -8823,6 +8856,173 @@ var makeGetAttemptContract = (ids) => {
8823
8856
  };
8824
8857
  };
8825
8858
 
8859
+ // node_modules/@qawolf/api-contracts/dist/v1/build/create.js
8860
+ var makeCreateBuildContract = (ids) => {
8861
+ const input = object({
8862
+ branch: string2().trim().min(1).max(255).optional().describe("The branch the build came from. Shown with the build."),
8863
+ buildId: buildIdSchema.describe("The buildId build.requestUpload answered with. Upload the file first."),
8864
+ commitSha: string2().trim().min(1).max(255).optional().describe("The commit the build came from. Shown with the build."),
8865
+ environment: makeBuildEnvironmentSelectorSchema(ids).optional().describe("The environment whose runs install the build from now on, until a newer build of the same app and platform arrives. Omit for a build that only runs created with it install."),
8866
+ workspaceId: ids.workspace.optional().describe("The workspace of the build. Required when authenticating with an organization or user API key.")
8867
+ }).superRefine((value, context) => {
8868
+ if (value.environment !== undefined && "name" in value.environment && value.environment.baseEphemeralEnvironment !== undefined && value.environment.ephemeral !== true) {
8869
+ context.addIssue({
8870
+ code: "custom",
8871
+ message: "baseEphemeralEnvironment is only valid with ephemeral.",
8872
+ path: ["environment", "baseEphemeralEnvironment"]
8873
+ });
8874
+ }
8875
+ });
8876
+ const output = object({ build: makeBuildResourceSchema(ids) });
8877
+ return {
8878
+ annotationJustifications: {
8879
+ destructiveHint: "Creates a build. With an environment, later runs there install it instead of the previous build.",
8880
+ openWorldHint: "Reads the uploaded file from QA Wolf storage only.",
8881
+ readOnlyHint: "Creates a build, and can create the environment it names."
8882
+ },
8883
+ annotations: {
8884
+ destructiveHint: false,
8885
+ openWorldHint: false,
8886
+ readOnlyHint: false
8887
+ },
8888
+ description: "Create a build from a file uploaded with build.requestUpload. Reads the app ID, name, version and build number from the file before it answers, or refuses a file that isn't an app. Calling it again with the same buildId answers the build the first call created, unchanged: a repeated call's branch, commitSha and environment are ignored.",
8889
+ input,
8890
+ kind: "write",
8891
+ name: "build.create",
8892
+ output
8893
+ };
8894
+ };
8895
+
8896
+ // node_modules/@qawolf/api-contracts/dist/v1/build/delete.js
8897
+ var makeDeleteBuildContract = (ids) => {
8898
+ const input = object({
8899
+ buildId: buildIdSchema,
8900
+ workspaceId: ids.workspace.optional().describe("The workspace of the build. Required when authenticating with an organization or user API key.")
8901
+ });
8902
+ const output = object({ build: makeBuildResourceSchema(ids) });
8903
+ return {
8904
+ annotationJustifications: {
8905
+ destructiveHint: "Deletes the build. Runs never install it after, and when it is an environment's latest build, runs there install the previous one instead, if its file is still kept.",
8906
+ openWorldHint: "Changes QA Wolf data and storage only.",
8907
+ readOnlyHint: "Deletes one build."
8908
+ },
8909
+ annotations: {
8910
+ destructiveHint: true,
8911
+ openWorldHint: false,
8912
+ readOnlyHint: false
8913
+ },
8914
+ description: "Delete a build. Runs never install a deleted build. Deleting an environment's latest build makes the previous one its latest. Runs install that build only if its file is still kept: only the latest builds of static environments are kept past the bucket's expiry, 180 days after upload on QA Wolf's cloud. Answers the build with deletedAt set. Deleting a deleted build answers it unchanged.",
8915
+ input,
8916
+ kind: "write",
8917
+ name: "build.delete",
8918
+ output
8919
+ };
8920
+ };
8921
+
8922
+ // node_modules/@qawolf/api-contracts/dist/v1/build/get.js
8923
+ var makeGetBuildContract = (ids) => {
8924
+ const input = object({
8925
+ buildId: buildIdSchema,
8926
+ workspaceId: ids.workspace.optional().describe("The workspace of the build. Required when authenticating with an organization or user API key.")
8927
+ });
8928
+ const output = object({ build: makeBuildResourceSchema(ids) });
8929
+ return {
8930
+ annotationJustifications: {
8931
+ destructiveHint: "Does not change the build.",
8932
+ openWorldHint: "Reads QA Wolf data only.",
8933
+ readOnlyHint: "Reads one build."
8934
+ },
8935
+ annotations: {
8936
+ destructiveHint: false,
8937
+ openWorldHint: false,
8938
+ readOnlyHint: true
8939
+ },
8940
+ description: "Get a build: its app, platform, version and environment. Deleted builds are returned too.",
8941
+ input,
8942
+ kind: "read",
8943
+ name: "build.get",
8944
+ output
8945
+ };
8946
+ };
8947
+
8948
+ // node_modules/@qawolf/api-contracts/dist/v1/build/list.js
8949
+ var makeListBuildsContract = (ids) => {
8950
+ const input = object({
8951
+ appId: string2().trim().min(1).optional().describe("Only list builds of this package name or bundle ID."),
8952
+ environmentId: ids.environment.optional().describe("Only list builds on this environment."),
8953
+ latestOnly: boolean2().default(false).describe("List only the builds the environment's next run installs: the newest undeleted build of each app and platform. Requires environmentId."),
8954
+ workspaceId: ids.workspace.optional().describe("The workspace to list builds from. Required when authenticating with an organization or user API key."),
8955
+ ...makePaginationInputFields({ defaultLimit: 20, maxLimit: 100 })
8956
+ }).refine((value) => !value.latestOnly || value.environmentId !== undefined, {
8957
+ message: "latestOnly requires environmentId.",
8958
+ path: ["latestOnly"]
8959
+ });
8960
+ const output = object({
8961
+ builds: array(makeBuildResourceSchema(ids)).describe("Undeleted builds, newest first."),
8962
+ nextCursor: nextCursorSchema
8963
+ });
8964
+ return {
8965
+ annotationJustifications: {
8966
+ destructiveHint: "Does not change any build.",
8967
+ openWorldHint: "Reads QA Wolf data only.",
8968
+ readOnlyHint: "Lists builds."
8969
+ },
8970
+ annotations: {
8971
+ destructiveHint: false,
8972
+ openWorldHint: false,
8973
+ readOnlyHint: true
8974
+ },
8975
+ description: "List the workspace's undeleted builds, newest first. With latestOnly, list what the environment's next run installs.",
8976
+ input,
8977
+ kind: "read",
8978
+ name: "build.list",
8979
+ output
8980
+ };
8981
+ };
8982
+
8983
+ // node_modules/@qawolf/api-contracts/dist/v1/build/requestUpload.js
8984
+ var maxBuildFileBytes = 500 * 1024 * 1024;
8985
+ var makeRequestBuildUploadContract = (ids) => {
8986
+ const input = object({
8987
+ buildId: buildIdSchema.optional().describe("Send the buildId of an earlier answer to get a fresh URL for the same build. Omit for a new build."),
8988
+ fileName: string2().regex(/^[A-Za-z0-9._-]{1,255}$/, "A file name is one path segment of letters, digits, dots, dashes and underscores, at most 255 characters.").refine((fileName) => /\.(apk|aab|ipa)$/i.test(fileName), "A build is an .apk, .aab or .ipa file.").describe("The file's name, such as `app-release.apk`, `app-release.aab` or `App.ipa`. Its extension sets the platform."),
8989
+ fileSizeBytes: number2().int().min(1).max(maxBuildFileBytes).describe("The file's exact size in bytes, at most 500 MB. The URL accepts only a file of this size."),
8990
+ workspaceId: ids.workspace.optional().describe("The workspace to upload into. Required when authenticating with an organization or user API key.")
8991
+ });
8992
+ const output = object({
8993
+ buildId: buildIdSchema.describe("Send this to build.create after the PUT."),
8994
+ expiresAt: exports_iso.datetime().describe("When uploadUrl stops working. Request another one after it."),
8995
+ uploadHeaders: record(string2(), string2()).describe("Send these headers with the PUT, exactly. The URL is signed for them."),
8996
+ uploadUrl: string2().describe("Send the file's bytes here with a single HTTP PUT carrying uploadHeaders, for example `curl -X PUT -H 'Content-Type: application/octet-stream' -H 'x-goog-if-generation-match: 0' --upload-file app.apk \"<uploadUrl>\"`. The URL only creates the file: it refuses to overwrite one.")
8997
+ });
8998
+ return {
8999
+ annotationJustifications: {
9000
+ destructiveHint: "The URL only creates a new file. It cannot overwrite or delete one.",
9001
+ openWorldHint: "The upload target is QA Wolf's run inputs storage, not an external service.",
9002
+ readOnlyHint: "Returns an expiring URL that permits writing one file to the workspace's storage."
9003
+ },
9004
+ annotations: {
9005
+ destructiveHint: false,
9006
+ openWorldHint: false,
9007
+ readOnlyHint: false
9008
+ },
9009
+ description: "Get a URL to upload an app build: an .apk, .aab or .ipa, up to 500 MB. PUT the file there with uploadHeaders, then call build.create with the buildId.",
9010
+ input,
9011
+ kind: "write",
9012
+ name: "build.requestUpload",
9013
+ output
9014
+ };
9015
+ };
9016
+
9017
+ // node_modules/@qawolf/api-contracts/dist/v1/build/index.js
9018
+ var makeBuildContracts = (ids) => ({
9019
+ create: makeCreateBuildContract(ids),
9020
+ delete: makeDeleteBuildContract(ids),
9021
+ get: makeGetBuildContract(ids),
9022
+ list: makeListBuildsContract(ids),
9023
+ requestUpload: makeRequestBuildUploadContract(ids)
9024
+ });
9025
+
8826
9026
  // node_modules/@qawolf/api-contracts/dist/v1/codeHostIntegration/resource.js
8827
9027
  var makeCodeHostIntegrationResourceSchema = () => resource({
8828
9028
  connectedAt: exports_iso.datetime().describe("When the code host was connected to the workspace."),
@@ -9059,6 +9259,7 @@ var makeReportDeploymentStatusContract = (ids) => {
9059
9259
  error: "Send environment as either { id } or { name }, with optional ephemeral and baseEphemeralEnvironment."
9060
9260
  });
9061
9261
  const input = strictObject({
9262
+ builds: array(buildIdSchema).min(1).max(20).optional().describe("The builds this deployment ships, from build.create. Runs this deployment starts install them. A report that omits this field keeps the stored builds."),
9062
9263
  deployTarget: httpUrl().max(2048).describe("The URL the deployment serves, e.g. a preview URL. A mobile pipeline leaves it unset and reports a service instead.").optional(),
9063
9264
  environment: environment.describe("Selects the environment the deployment reports into.").optional(),
9064
9265
  environmentVariables: record(string2(), string2()).describe("Environment variable overrides for the runs this deployment requests. A report that omits this field keeps the stored values. A report that sends it replaces them.").optional(),
@@ -9952,12 +10153,28 @@ var makeGetIssueContract = (ids) => {
9952
10153
  };
9953
10154
 
9954
10155
  // node_modules/@qawolf/api-contracts/dist/v1/investigation/finding.js
9955
- var investigationFindingStateDescription = 'What the investigation concluded about the cause. Known values: "investigating", "fixed", "fix-proposed", "reported", "report-proposed", "flake", "question" and "dismissed". New values can appear.';
10156
+ var investigationFindingStateDescription = 'What the investigation concluded about the cause. Known values: "investigating", "fixed", "fix-proposed", "reported", "report-proposed", "flake", "question", "dismissed" and "superseded". "superseded" means a newer run replaced this run before the investigation concluded. New values can appear.';
10157
+ var investigationQuestionSchema = object({
10158
+ answers: array(object({
10159
+ description: string2().optional(),
10160
+ title: string2(),
10161
+ value: string2().describe('What choosing this answer means. Known values: "apply", "dismiss", "report", "maintenance", "bug" and "baseline". New values can appear.')
10162
+ })),
10163
+ body: string2().optional().describe("Markdown details under the question: what the test expects, what the app does and what each answer changes. A value a person must copy is in a code block."),
10164
+ comparisonId: string2().optional().describe('The failed screenshot comparison a screenshot question is about, as `run listScreenshotComparisons` names it. Its answers are "bug" (the old screenshot is right), "maintenance" (both are right) and "baseline" (the new screenshot is right).'),
10165
+ text: string2()
10166
+ });
9956
10167
  var makeInvestigationFindingSchema = (ids) => object({
9957
10168
  actual: string2().optional(),
9958
10169
  commitHash: string2().optional().describe("The commit of a commit fix. Same as `fix.commitHash`."),
9959
10170
  decidedBy: _enum(["agent", "user"]).optional().describe("Who decided: the AI on its own, or a person who approved or dismissed it. Absent until someone decides."),
9960
10171
  disputeReason: string2().optional().describe("Why a person disputed what the AI did. Present on a proposal the AI made again after that dispute."),
10172
+ earlierQuestions: array(object({
10173
+ answer: string2(),
10174
+ answeredAt: exports_iso.datetime(),
10175
+ body: string2().optional(),
10176
+ text: string2()
10177
+ })).optional().describe("Questions about this cause that a person already answered, oldest first. The AI acted on each answer."),
9961
10178
  expected: string2().optional(),
9962
10179
  findingId: string2(),
9963
10180
  fix: discriminatedUnion("type", [
@@ -9984,15 +10201,7 @@ var makeInvestigationFindingSchema = (ids) => object({
9984
10201
  reason: string2().describe("Why the investigation reached the verdict."),
9985
10202
  verdict: string2().describe('Whether the pull request caused the failure. Known values: "caused", "not-caused" and "unclear". New values can appear.')
9986
10203
  }).optional().describe("Whether the pull request the run tested caused this finding. Absent on a run that didn't test a pull request, and when the investigation didn't say."),
9987
- question: object({
9988
- answers: array(object({
9989
- description: string2().optional(),
9990
- title: string2(),
9991
- value: string2().describe('What choosing this answer means. Known values: "apply", "dismiss", "report", "maintenance", "bug" and "baseline". New values can appear.')
9992
- })),
9993
- comparisonId: string2().optional().describe('The failed screenshot comparison a screenshot question is about, as `run listScreenshotComparisons` names it. Its answers are "bug" (the old screenshot is right), "maintenance" (both are right) and "baseline" (the new screenshot is right).'),
9994
- text: string2()
9995
- }).optional().describe("The question waiting for a person, with the answers offered."),
10204
+ question: investigationQuestionSchema.optional().describe("The question waiting for a person, with the answers offered."),
9996
10205
  response: object({
9997
10206
  answer: string2().optional(),
9998
10207
  at: exports_iso.datetime(),
@@ -10004,6 +10213,7 @@ var makeInvestigationFindingSchema = (ids) => object({
10004
10213
  steps: array(string2()).optional(),
10005
10214
  subSessionIds: array(ids.chatSession),
10006
10215
  summary: string2().optional(),
10216
+ supersededByRunId: ids.run.optional().describe('The newer run that replaced this run, on a "superseded" finding.'),
10007
10217
  updatedAt: exports_iso.datetime()
10008
10218
  });
10009
10219
 
@@ -10013,6 +10223,17 @@ var makeGetInvestigationContract = (ids) => {
10013
10223
  const output = resource({
10014
10224
  baselineChanges: _enum(["automatic", "needs-approval"]).describe('How the investigation can make a new screenshot the baseline. "automatic": it can accept a baseline on its own. ' + '"needs-approval": it proposes the baseline on a fix-proposed finding, and accepts it only after a person applies the proposal.'),
10015
10225
  findings: array(makeInvestigationFindingSchema(ids)),
10226
+ questionsFromOtherRuns: array(object({
10227
+ answer: string2().optional().describe(`The person's answer, when status is "answered".`),
10228
+ answeredAt: exports_iso.datetime().optional(),
10229
+ body: string2().optional(),
10230
+ findingId: string2(),
10231
+ flowIds: array(ids.flow),
10232
+ headline: string2().optional().describe("The cause that the question is about."),
10233
+ runId: ids.run,
10234
+ status: string2().describe('Known values: "open" (waiting for a person) and "answered". New values can appear.'),
10235
+ text: string2()
10236
+ })).optional().describe("Questions that the workspace's other run investigations asked about the same flows in the last 7 days, newest first."),
10016
10237
  runId: ids.run,
10017
10238
  sessionId: ids.chatSession.optional().describe("The investigation session. Absent when the run has none."),
10018
10239
  status: _enum(["investigating", "finished", "not-investigated", "not-enabled"]).describe('Whether the lead or any child investigator is still working. "not-investigated" when the run has no investigation. ' + '"not-enabled" when automatic investigation does not cover this run, because its workspace has it off or investigates only pull request runs: read its failures with run.get and attempt.get instead.'),
@@ -10040,9 +10261,55 @@ var makeGetInvestigationContract = (ids) => {
10040
10261
  };
10041
10262
  };
10042
10263
 
10264
+ // node_modules/@qawolf/api-contracts/dist/v1/investigation/question/find.js
10265
+ var makeFindInvestigationQuestionsContract = (ids) => {
10266
+ const input = object({
10267
+ ...makePaginationInputFields({ defaultLimit: 20, maxLimit: 100 }),
10268
+ environmentId: ids.environmentRef.optional().describe("Only list the questions of runs in this environment. Omit to list the questions of every environment."),
10269
+ statuses: array(_enum(["open"])).min(1).default(["open"]).describe(`Question statuses to include. "open" (waiting for a person's answer) is the only status today.`),
10270
+ workspaceId: ids.workspace.optional().describe("The workspace to list questions from. Required when authenticating with an organization or user API key.")
10271
+ });
10272
+ const output = object({
10273
+ nextCursor: nextCursorSchema,
10274
+ questions: array(resource({
10275
+ askedAt: exports_iso.datetime().describe("When the investigation first recorded the finding that asks the question."),
10276
+ findingId: string2(),
10277
+ flows: array(object({ flowId: ids.flow, name: string2() })).describe("The failed flows the question is about."),
10278
+ headline: string2().optional(),
10279
+ question: investigationQuestionSchema,
10280
+ runId: ids.run,
10281
+ sessionId: ids.chatSession.describe("The investigation session. Answer the question by sending the person's answer to it with agent.send."),
10282
+ summary: string2().optional()
10283
+ }, { urlFieldDescription: "The run in the QA Wolf app." })).describe("Questions that wait for a person's answer, the most recently recorded first. A page can hold fewer than limit questions, or none, while nextCursor is present.")
10284
+ });
10285
+ return {
10286
+ annotationJustifications: {
10287
+ destructiveHint: "Does not answer, dismiss or change any question.",
10288
+ openWorldHint: "Reads recorded QA Wolf findings without changing the application under test.",
10289
+ readOnlyHint: "Lists the open questions of a workspace's investigations without answering them."
10290
+ },
10291
+ annotations: {
10292
+ destructiveHint: false,
10293
+ openWorldHint: false,
10294
+ readOnlyHint: true
10295
+ },
10296
+ description: "List the questions the QA Wolf AI investigating failed runs is waiting for a person to answer, across a workspace's runs. " + "Each question names its run, flows, details and offered answers. " + "To answer one, send the person's answer to its sessionId with agent.send.",
10297
+ input,
10298
+ kind: "read",
10299
+ name: "investigation.question.find",
10300
+ output
10301
+ };
10302
+ };
10303
+
10304
+ // node_modules/@qawolf/api-contracts/dist/v1/investigation/question/index.js
10305
+ var makeInvestigationQuestionContracts = (ids) => ({
10306
+ find: makeFindInvestigationQuestionsContract(ids)
10307
+ });
10308
+
10043
10309
  // node_modules/@qawolf/api-contracts/dist/v1/investigation/index.js
10044
10310
  var makeInvestigationContracts = (ids) => ({
10045
- get: makeGetInvestigationContract(ids)
10311
+ get: makeGetInvestigationContract(ids),
10312
+ question: makeInvestigationQuestionContracts(ids)
10046
10313
  });
10047
10314
 
10048
10315
  // node_modules/@qawolf/api-contracts/dist/v1/issue/addFlows.js
@@ -10132,6 +10399,35 @@ var makeCreateIssueContract = (ids) => {
10132
10399
  };
10133
10400
  };
10134
10401
 
10402
+ // node_modules/@qawolf/api-contracts/dist/v1/issue/decideSuggestion.js
10403
+ var makeDecideSuggestionContract = (ids) => {
10404
+ const input = object({
10405
+ decision: _enum(["add", "report", "skip", "undo", "activate"]).describe("add: turn on the suggested flow. report: file the potential bug. skip: decline the suggestion. undo: take back an add, report or skip before the flow joins. activate: retry a suggestion that QA Wolf held."),
10406
+ issueId: ids.issue.describe("The coverage request or bug report that QA Wolf opened for a suggestion."),
10407
+ skipReason: _enum(["not-worth-testing", "already-covered", "feature-removed"]).optional().describe("Why the suggestion is skipped. Required for skip.")
10408
+ }).refine(({ decision, skipReason }) => decision !== "skip" || skipReason !== undefined, { message: "skipReason is required when the decision is skip." });
10409
+ const output = object({
10410
+ issue: makeIssueResourceSchema(ids)
10411
+ });
10412
+ return {
10413
+ annotationJustifications: {
10414
+ destructiveHint: "Every decision can be undone until the flow joins, and nothing is deleted.",
10415
+ openWorldHint: "An added suggestion writes its flow to the environment's flow code repository.",
10416
+ readOnlyHint: "Records a decision on a suggestion and changes the issue's status."
10417
+ },
10418
+ annotations: {
10419
+ destructiveHint: false,
10420
+ openWorldHint: true,
10421
+ readOnlyHint: false
10422
+ },
10423
+ description: "Decide a coverage request or bug report that QA Wolf suggested after exploring an environment. " + "Add turns on the suggested flow in the environment. Report files a potential bug. " + "Skip declines the suggestion. Undo takes back a decision before the flow joins. " + "The issue's status follows the decision, so change the status only through this tool while the suggestion is undecided.",
10424
+ input,
10425
+ kind: "write",
10426
+ name: "issue.decideSuggestion",
10427
+ output
10428
+ };
10429
+ };
10430
+
10135
10431
  // node_modules/@qawolf/api-contracts/dist/v1/issue/listActivity.js
10136
10432
  var issueActivityTypeSchema = _enum([
10137
10433
  "created",
@@ -10391,6 +10687,35 @@ var makeLegacyTriggerContracts = (ids) => ({
10391
10687
  resume: makeResumeLegacyTriggerContract(ids)
10392
10688
  });
10393
10689
 
10690
+ // node_modules/@qawolf/api-contracts/dist/v1/mcpServer/connect.js
10691
+ var makeConnectMcpServerContract = (ids) => {
10692
+ const input = object({
10693
+ server: string2().trim().min(1).describe("The server to connect, by its catalog id or name, such as linear or Linear."),
10694
+ workspaceId: ids.workspace.optional().describe("The workspace to connect the server to. Required when authenticating with an organization or user API key.")
10695
+ });
10696
+ const output = object({
10697
+ authorizationUrl: string2().url().describe("The server's sign-in page. Show it to the user: the connection is ready once they approve access there."),
10698
+ serverName: string2().describe("The catalog name of the server.")
10699
+ });
10700
+ return {
10701
+ annotationJustifications: {
10702
+ destructiveHint: "Starts a sign-in without changing or removing existing connections.",
10703
+ openWorldHint: "Asks the external server's OAuth provider for a sign-in page.",
10704
+ readOnlyHint: "Records a pending connection on the workspace."
10705
+ },
10706
+ annotations: {
10707
+ destructiveHint: false,
10708
+ openWorldHint: true,
10709
+ readOnlyHint: false
10710
+ },
10711
+ description: "Start connecting an MCP server from the workspace's catalog, such as Linear, so Tester can use its tools. Returns a sign-in link to show the user.",
10712
+ input,
10713
+ kind: "write",
10714
+ name: "mcpServer.connect",
10715
+ output
10716
+ };
10717
+ };
10718
+
10394
10719
  // node_modules/@qawolf/api-contracts/dist/v1/run/investigationSessionId.js
10395
10720
  var investigationSessionId = string2().trim().min(1).max(100).optional();
10396
10721
 
@@ -10474,6 +10799,7 @@ var makeDiagnoseRunContract = (ids) => {
10474
10799
  // node_modules/@qawolf/api-contracts/dist/v1/run/find.js
10475
10800
  var makeFindRunsContract = (ids) => {
10476
10801
  const input = object({
10802
+ buildId: buildIdSchema.optional().describe("Only include runs that installed this build."),
10477
10803
  createdAfter: exports_iso.datetime({ offset: true }).optional().describe("Only include runs created after this instant, e.g. the runs since a deploy."),
10478
10804
  ...makePaginationInputFields({ defaultLimit: 20, maxLimit: 100 }),
10479
10805
  environmentId: ids.environmentRef,
@@ -10598,6 +10924,7 @@ var makeGetRunContract = (ids) => {
10598
10924
  const output = resource({
10599
10925
  ...makeRunSummaryFields(ids),
10600
10926
  blockingBugCount: number2().int().nonnegative().describe("How many bugs this run found are blocking: still open, and priority urgent, high, or unprioritized — unprioritized counts because nobody has ruled it out yet. This is what `failed` is derived from, so it explains a failure rather than adding a second verdict: gate on `status`, then read this to say how many bugs are holding the build. It counts a bug filed against a later run by an investigation that carried over from this one, and it drops a bug once that bug is resolved."),
10927
+ builds: array(makeBuildResourceSchema(ids)).describe("The builds the run installs, one per app and platform. Empty when the run has none."),
10601
10928
  flows,
10602
10929
  runId: ids.run.describe("The run this response describes. Treat it as canonical: it can differ from the id you asked for. A deploy notification returns a run id before the run exists, and if a second notification for the same commit is folded into an earlier run, that id resolves to the earlier run instead.")
10603
10930
  }, { urlFieldDescription: "Absolute URL of the run page." });
@@ -11074,7 +11401,7 @@ var makeReadRunnerJournalContract = (ids) => {
11074
11401
  openWorldHint: false,
11075
11402
  readOnlyHint: false
11076
11403
  },
11077
- description: `Read a window of one of an interactive runner's journal streams — the newest few, everything after a cursor, or everything belonging to one run. This is how a flow run's outcome and output are followed: \`run-status\` settles it, \`run-logs\` and \`run-events\` carry what it produced, and \`recorder\` carries the browser actions the runner recorded. A read counts as activity, so working through history does not get the runner reaped underneath you. ${retryableRunnerUnreachableDescription}`,
11404
+ description: `Read a window of one of an interactive runner's journal streams — the newest few, everything after a cursor, or everything belonging to one run. This is how a flow run's outcome and output are followed: \`run-status\` settles it, \`run-logs\` and \`run-events\` carry what it produced, and \`recorder\` carries the browser actions the runner recorded. A read counts as activity, so working through history does not get the runner reaped underneath you. Polling \`runner.get\` or \`runner.list\` does not count as activity, so the inactivity clock keeps running until the runner is reaped. The journal lives only on the runner: once it is terminated or stops after inactivity, the journal is gone and this read answers not-found. ${retryableRunnerUnreachableDescription}`,
11078
11405
  input,
11079
11406
  kind: "read",
11080
11407
  name: "runner.readJournal",
@@ -11224,7 +11551,7 @@ var makeTakeScreenshotOnRunnerContract = (ids) => {
11224
11551
  openWorldHint: false,
11225
11552
  readOnlyHint: false
11226
11553
  },
11227
- 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} On a mobile or Windows runner, \`screen-not-ready\` can also mean its Appium session did not answer in time; if it persists after 3 tries, terminate the runner and launch it again with the same id and runnerName. ${runnerHasNoScreenDescription} ${retryableRunnerUnreachableDescription}`,
11554
+ description: `Take one screenshot of an interactive runner's screen. This refreshes the inactivity timer and can extend the runner's billed lifetime. On a runner with a browser the image is the whole virtual desktop, browser window and all. 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} On a mobile or Windows runner, \`screen-not-ready\` can also mean its Appium session did not answer in time; if it persists after 3 tries, terminate the runner and launch it again with the same id and runnerName. ${runnerHasNoScreenDescription} ${retryableRunnerUnreachableDescription}`,
11228
11555
  input,
11229
11556
  kind: "read",
11230
11557
  name: "runner.takeScreenshot",
@@ -11359,6 +11686,7 @@ var makeContractsV1 = (ids) => {
11359
11686
  attempt: {
11360
11687
  get: makeGetAttemptContract(resolvedIds)
11361
11688
  },
11689
+ build: makeBuildContracts(resolvedIds),
11362
11690
  codeHostIntegration: {
11363
11691
  find: makeFindCodeHostIntegrationsContract(resolvedIds),
11364
11692
  listRepositories: makeListCodeHostRepositoriesContract(resolvedIds)
@@ -11396,6 +11724,7 @@ var makeContractsV1 = (ids) => {
11396
11724
  issue: {
11397
11725
  addFlows: makeAddFlowsToIssueContract(resolvedIds),
11398
11726
  create: makeCreateIssueContract(resolvedIds),
11727
+ decideSuggestion: makeDecideSuggestionContract(resolvedIds),
11399
11728
  find: makeFindIssuesContract(resolvedIds),
11400
11729
  get: makeGetIssueContract(resolvedIds),
11401
11730
  listActivity: makeListIssueActivityContract(resolvedIds),
@@ -11403,6 +11732,9 @@ var makeContractsV1 = (ids) => {
11403
11732
  update: makeUpdateIssueContract(resolvedIds)
11404
11733
  },
11405
11734
  legacyTrigger: makeLegacyTriggerContracts(resolvedIds),
11735
+ mcpServer: {
11736
+ connect: makeConnectMcpServerContract(resolvedIds)
11737
+ },
11406
11738
  promotion: makePromotionContracts(resolvedIds),
11407
11739
  run: {
11408
11740
  acceptScreenshotBaseline: makeAcceptScreenshotBaselineContract(resolvedIds),
@@ -11459,6 +11791,7 @@ var authErrorMessages = {
11459
11791
  notFound404Record: (noun, id) => `QA Wolf has no ${noun} ${id} (HTTP 404).`,
11460
11792
  notFound404: (noun) => noun === undefined ? "QA Wolf found nothing matching the request (HTTP 404)." : `QA Wolf found nothing matching the ${noun} request (HTTP 404).`,
11461
11793
  failedWithStatus: (status, noun) => `QA Wolf API${noun ? ` ${noun}` : ""} request failed (HTTP ${status}).`,
11794
+ notSent: "Nothing was sent, so this request did not take effect.",
11462
11795
  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
11796
  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
11797
  unexpectedResponse: (noun) => `Unexpected${noun ? ` ${noun}` : ""} response from the QA Wolf API.`
@@ -12002,9 +12335,9 @@ async function requestWithRetry(args) {
12002
12335
  const unreachable = result.error.kind === "network" || result.error.kind === "timeout";
12003
12336
  return {
12004
12337
  ok: false,
12005
- ...args.describe(result.error),
12006
12338
  ...mayHaveArrived ? { mayHaveArrived } : {},
12007
- ...unreachable ? { unreachable } : {}
12339
+ ...unreachable ? { unreachable } : {},
12340
+ ...args.describe(result.error)
12008
12341
  };
12009
12342
  }
12010
12343
  await sleep2(backoff);
@@ -13856,6 +14189,13 @@ function callPublicApi(trpc, contract, input, options) {
13856
14189
  }
13857
14190
  return trpc.mutation(path, input, contract.output, options);
13858
14191
  }
14192
+ var notSentCodes = new Set([
14193
+ "ConnectionRefused",
14194
+ "EAI_AGAIN",
14195
+ "ECONNREFUSED",
14196
+ "ENOTFOUND",
14197
+ "UND_ERR_CONNECT_TIMEOUT"
14198
+ ]);
13859
14199
  function makeCallPublicApiMethod(trpc, deps, readBackoffMs) {
13860
14200
  return async (contract, input, options) => {
13861
14201
  const sent = applyWorkspaceId(contract.input, input, deps.workspaceId);
@@ -13863,7 +14203,17 @@ function makeCallPublicApiMethod(trpc, deps, readBackoffMs) {
13863
14203
  return requestWithRetry({
13864
14204
  call: () => callPublicApi(trpc, contract, sent, options),
13865
14205
  backoffMs: contract.kind === "read" ? readBackoffMs : [],
13866
- describe: (err) => describeRequestError(err, deps.baseUrl, contract.name, subject),
14206
+ describe: (err) => {
14207
+ const failure = describeRequestError(err, deps.baseUrl, contract.name, subject);
14208
+ const code = err.kind === "network" ? errorCode(err.cause.cause) ?? errorCode(err.cause) : undefined;
14209
+ if (contract.kind !== "write" || !code || !notSentCodes.has(code))
14210
+ return failure;
14211
+ return {
14212
+ ...failure,
14213
+ error: `${failure.error} ${authMessages.errors.request.notSent}`,
14214
+ mayHaveArrived: false
14215
+ };
14216
+ },
13867
14217
  sleep: deps.sleep
13868
14218
  });
13869
14219
  };
@@ -14746,7 +15096,8 @@ function createTrpcClient(apiKey, deps) {
14746
15096
  return withLogging(path, () => sendWireRequest(deps.fetch, url, {
14747
15097
  body,
14748
15098
  headers: { ...authHeader, "content-type": "application/json" },
14749
- method: "POST"
15099
+ method: "POST",
15100
+ redirect: "error"
14750
15101
  }, schema, options?.timeoutMs ?? defaultTimeoutMs));
14751
15102
  }
14752
15103
  };
@@ -16123,4 +16474,4 @@ export {
16123
16474
  createRunnerSdk
16124
16475
  };
16125
16476
 
16126
- //# debugId=549062A3D36EB66B64756E2164756E21
16477
+ //# debugId=87F77F3A03400AEC64756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qawolf/cli",
3
- "version": "2.2.2",
3
+ "version": "2.4.0",
4
4
  "description": "Run and manage QA Wolf flows from the terminal, CI, or an AI agent",
5
5
  "keywords": [
6
6
  "automation",
@@ -72,7 +72,7 @@
72
72
  "@clack/prompts": "1.5.1",
73
73
  "@napi-rs/keyring": "1.3.0",
74
74
  "@oxc-node/core": "0.1.0",
75
- "@qawolf/api-contracts": "0.98.1",
75
+ "@qawolf/api-contracts": "0.104.0",
76
76
  "@qawolf/emails": "1.1.1",
77
77
  "@qawolf/flow-targets": "2.0.0",
78
78
  "@qawolf/flows": "0.3.0",