@qawolf/cli 2.6.0 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -8586,6 +8586,18 @@ var authMessages = {
8586
8586
  errors: authErrorMessages,
8587
8587
  whoami: whoamiMessages
8588
8588
  };
8589
+ // src/core/messages/build.ts
8590
+ var withoutPeriod = (reason) => reason.replace(/\.$/, "");
8591
+ var buildMessages = {
8592
+ createFailed: (buildId, reason) => `The file is uploaded as build ${buildId}, but the build could not be created: ${withoutPeriod(reason)}. If the cause was temporary, finish it with qawolf build create --build-id ${buildId} and the same environment, branch, commit and workspace flags.`,
8593
+ fileUnreadable: (path) => `${path} is not a readable file.`,
8594
+ storageRefused: (status, reason) => `storage refused it (HTTP ${status}${reason === undefined ? "" : `: ${reason}`})`,
8595
+ storageTimedOut: (timeoutMs) => `it did not finish within ${formatSeconds(timeoutMs)}`,
8596
+ storageUnreachable: (cause) => `could not reach storage${cause === undefined ? "" : ` (${cause})`}`,
8597
+ uploaded: (build) => `Build ${build.id} (${build.appId}, ${build.platform}${build.version === undefined ? "" : ` ${build.version}`}) uploaded: ${build.url}`,
8598
+ uploadFailed: (buildId, reason) => `The upload of build ${buildId} failed: ${reason}. Run qawolf build upload again: it creates a new build.`,
8599
+ uploading: (fileName, sizeBytes) => `Uploading ${fileName} (${sizeBytes} bytes)`
8600
+ };
8589
8601
  // src/core/messages/toolNotFound.ts
8590
8602
  var installRemedy = "Run `qawolf install` to install the runtime dependencies.";
8591
8603
  function toolNotInstalled(tool, path) {
@@ -16878,6 +16890,7 @@ var agentReplySchema = object({
16878
16890
 
16879
16891
  // node_modules/@qawolf/api-contracts/dist/v1/agent/wait.js
16880
16892
  var maxAgentWaitSeconds = 45;
16893
+ var maxAgentWaitSecondsWithProgress = 170;
16881
16894
  var agentWakeReasonSchema = _enum(["reply", "status", "timeout"]).describe('Why a held check answered. "reply" means the AI said something new, "status" means the session settled or needs you, "timeout" means the hold ran out with nothing new.');
16882
16895
 
16883
16896
  // node_modules/@qawolf/api-contracts/dist/v1/run/summary.js
@@ -16910,6 +16923,54 @@ var makeRunSummaryFields = (ids) => ({
16910
16923
  }).optional().describe("The run that replaced this one, present only when `status` is `superseded`. A newer deployment to the same branch and environment (and service, when the deployment named one) cancels the older run's unfinished flows and takes over. Deduplication ignores the commit, so the replacement may be testing a later commit than this run did. Only the direct replacement is named; that run can itself be superseded.")
16911
16924
  });
16912
16925
 
16926
+ // node_modules/@qawolf/api-contracts/dist/v1/activity/wait.js
16927
+ var maxActivityWaitItems = 50;
16928
+ var makeActivityWaitContract = (ids) => {
16929
+ const cursors = record(string2().min(1), string2().min(1));
16930
+ const runIds = array(ids.run);
16931
+ const sessionIds = array(ids.chatSession);
16932
+ const input = object({
16933
+ cursors: cursors.optional().describe("Each session's nextCursor from the previous answer, keyed by its session id. A session without one is read from its first reply."),
16934
+ runIds: runIds.max(maxActivityWaitItems).optional().describe(`The runs you are waiting on, including a run still being created. Send at least one session or run, and at most ${maxActivityWaitItems} together.`),
16935
+ sessionIds: sessionIds.max(maxActivityWaitItems).optional().describe("The Tester sessions you are waiting on, as agent.send answered with."),
16936
+ waitSeconds: number2().int().min(0).optional().describe(`How long the server may hold this call open, in seconds. Defaults to ${maxAgentWaitSeconds}. A larger value clamps to ${maxAgentWaitSeconds}, or to ${maxAgentWaitSecondsWithProgress} when the call carries a progress token. Pass more than ${maxAgentWaitSeconds} only when your instructions say your client keeps the call open while progress arrives.`)
16937
+ });
16938
+ const output = object({
16939
+ open: object({ cursors, runIds, sessionIds }).describe("Everything still worth waiting on: each session whose status is not completed, failed, cancelled or not-found, with its new cursor, and each run that has not finished. Send it as the next call's input."),
16940
+ runs: array(object({
16941
+ finished: boolean2().describe("True once the status is passed, failed, canceled, superseded or not-found. A finished run never changes again."),
16942
+ runId: ids.run.describe("The run id you sent."),
16943
+ status: _enum([...publicRunSummaryStatusValues, "not-found"]).describe(`The run's status, as run.get reports it. A run still being created reads "queued". "not-found" means no run has this id: its creation failed, was skipped or never finished, or the run is gone.`),
16944
+ url: string2().optional().describe("Absolute URL of the run page. Absent while the run is still being created, and when it is not found.")
16945
+ })).describe("Every run you sent, in the order you sent them."),
16946
+ sessions: array(object({
16947
+ nextCursor: string2().min(1).describe("Send back under this session's id in cursors to read only what follows."),
16948
+ replies: array(agentReplySchema).describe("What the AI has said since the cursor, oldest first, as agent.get returns it. Empty when it said nothing new."),
16949
+ sessionId: ids.chatSession,
16950
+ status: _enum([...agentSessionStatuses, "not-found"]).describe('Where the work stands, as agent.get reports it. "working" means the AI is still on it. "waiting-for-you" means it asked a question that agent.send must answer. "completed" means it finished, and a new agent.send continues it. "failed" and "cancelled" are settled. "not-found" means the session is gone and will not change.')
16951
+ })).describe("Every session you sent, in the order you sent them."),
16952
+ waitSeconds: number2().int().describe("The hold this call was allowed, in seconds, after clamping."),
16953
+ wokeOn: _enum(["activity", "timeout"]).describe('"activity" means a session replied or changed status, or a run finished, or a session or run was not found; every item with news is in this answer. "timeout" means the hold ran out with nothing new.')
16954
+ });
16955
+ return {
16956
+ annotationJustifications: {
16957
+ destructiveHint: "Does not cancel work, stop runs or edit tests.",
16958
+ openWorldHint: "Reads QA Wolf sessions and runs without posting to external services.",
16959
+ readOnlyHint: "Retrieves session replies and statuses and run statuses without sending work."
16960
+ },
16961
+ annotations: {
16962
+ destructiveHint: false,
16963
+ openWorldHint: false,
16964
+ readOnlyHint: true
16965
+ },
16966
+ description: `Wait on many QA Wolf AI (Tester) sessions and runs in one call. Pass every Tester session and run you are waiting on. The call returns as soon as any session replies or changes status or any run finishes, and reports every item with news. Send back open as the next call's input, and call again as soon as it returns. Pass waitSeconds above ${maxAgentWaitSeconds} only when your instructions say your client keeps the call open while progress arrives.`,
16967
+ input,
16968
+ kind: "read",
16969
+ name: "activity.wait",
16970
+ output
16971
+ };
16972
+ };
16973
+
16913
16974
  // node_modules/@qawolf/api-contracts/dist/v1/deployment/didNotRunReason.js
16914
16975
  var didNotRunReasonSchema = _enum([
16915
16976
  "billing-prevented",
@@ -17040,7 +17101,7 @@ var makeRequestFileUploadContract = (ids) => {
17040
17101
  const output = object({
17041
17102
  contentType: string2().describe("Send this as the PUT's `Content-Type` header, exactly. The URL is signed for it and refuses any other value."),
17042
17103
  expiresAt: exports_iso.datetime().describe("When uploadUrl stops working. Request another one after it."),
17043
- filePath: string2().describe("Where the file lives in team storage. Send it as filePath to file.requestDownload, or in agent.send's filePaths so the AI fetches it from there."),
17104
+ filePath: string2().describe("Where the file lives in team storage. Send it as filePath to file.requestDownload, in agent.send's filePaths so the AI fetches it from there, or as an image's source in an issue description."),
17044
17105
  path: string2().describe("Deprecated: the same value as filePath. Read filePath instead."),
17045
17106
  uploadUrl: string2().describe(`Send the file's bytes here with a single HTTP PUT carrying the returned contentType, for example \`curl -H 'Content-Type: application/octet-stream' --upload-file "journeys.csv" "<uploadUrl>"\`. Upload the bytes from the shell rather than through this API, so a large file never has to be written out as text.`)
17046
17107
  });
@@ -17133,6 +17194,11 @@ var defaultIdSchemas = {
17133
17194
  };
17134
17195
  var workspaceForEnvironmentRef = (workspace) => workspace.optional().describe("The workspace the environment belongs to, which an alias resolves in. Read it from whoami.");
17135
17196
 
17197
+ // node_modules/@qawolf/api-contracts/dist/v1/issue/description.js
17198
+ var maxInlineImageSizeBytes = 2000000;
17199
+ var maxInlineImagesPerDescription = 10;
17200
+ var issueDescriptionDescription = "The issue description in Markdown, which is stored as rich text. Text without Markdown is stored as written, one paragraph per line. " + "To show an image in the description, upload it with file.requestUpload, PUT its bytes with curl, then write `![what it shows](<filePath>)` where the image belongs, with the returned filePath between the angle brackets. " + `The image is stored in the description itself: a GIF, JPEG, PNG or WebP of at most ${maxInlineImageSizeBytes / 1e6} MB. ` + `A description shows at most ${maxInlineImagesPerDescription} such images, each outside any link. ` + "An image at an http(s) URL is stored as a link instead. " + "If an image's path has no file, is not one of those images, is too large or is inside a link, or there are too many images, nothing is written and the error says why.";
17201
+
17136
17202
  // node_modules/@qawolf/api-contracts/dist/v1/issue/files.js
17137
17203
  var maxAttachedFilesPerRequest = 10;
17138
17204
  var attachedFilePathsSchema = array(teamStoragePathSchema).min(1).max(maxAttachedFilesPerRequest).refine((filePaths) => new Set(filePaths).size === filePaths.length, "filePaths must be unique");
@@ -17297,6 +17363,9 @@ var makeListScreenshotComparisonsContract = (ids) => {
17297
17363
  };
17298
17364
  };
17299
17365
 
17366
+ // node_modules/@qawolf/api-contracts/dist/v1/run/wait.js
17367
+ var runWakeReasonSchema = _enum(["status", "timeout"]).describe(`Why a held check answered. "status" means the run's status differs from the one the check started with, or the run was already terminal; "timeout" means the hold ran out with the status unchanged.`);
17368
+
17300
17369
  // node_modules/@qawolf/api-contracts/dist/v1/runner/actionSequence.js
17301
17370
  var maxActionsPerRequest = 10;
17302
17371
  var screenshotModes = ["none", "final", "each"];
@@ -18079,6 +18148,13 @@ var runSelectionSchema = object({
18079
18148
  error: "A selection's startLine must not be after its endLine.",
18080
18149
  path: ["startLine"]
18081
18150
  });
18151
+ // node_modules/@qawolf/api-contracts/dist/v1/trigger/scheduleRepeatFields.js
18152
+ var triggerScheduleRepeatFields = {
18153
+ dayOfMonth: number2().int().min(1).max(28).optional().describe("The day of the month a monthly schedule fires on, from 1 to 28 so it exists in every month. Required when cadence is monthly."),
18154
+ every: number2().int().min(1).optional().describe("How many hours, days, weeks or months sit between fires. Defaults to 1. Hourly takes 1, 2, 3, 4, 6, 8 or 12, counted from midnight in timezoneId; daily takes up to 31, and weekly and monthly up to 12."),
18155
+ startDate: string2().regex(/^\d{4}-\d{2}-\d{2}$/).optional().describe('The date of the first fire, as "YYYY-MM-DD" in timezoneId, for a daily, weekly or monthly schedule whose every is more than 1. Later fires repeat every N units from it. A weekly start date falls on dayOfWeek and a monthly one on dayOfMonth. Required when every is more than 1.')
18156
+ };
18157
+
18082
18158
  // node_modules/@qawolf/api-contracts/dist/v1/trigger/configuration.js
18083
18159
  var isTimezone = (value) => {
18084
18160
  try {
@@ -18088,7 +18164,7 @@ var isTimezone = (value) => {
18088
18164
  return false;
18089
18165
  }
18090
18166
  };
18091
- var triggerCadenceSchema = _enum(["hourly", "daily", "weekly"]).describe("How often the schedule fires.");
18167
+ var triggerCadenceSchema = _enum(["hourly", "daily", "weekly", "monthly"]).describe("How often the schedule fires.");
18092
18168
  var triggerDayOfWeekSchema = _enum([
18093
18169
  "monday",
18094
18170
  "tuesday",
@@ -18116,11 +18192,74 @@ var makeTriggerScheduleFields = (ids) => ({
18116
18192
  message: "Expected each day to be named at most once."
18117
18193
  }).optional().describe("The only days an hourly or daily schedule fires on, read in timezoneId. Name each day at most once. Omitting it fires on every day."),
18118
18194
  environmentId: ids.environmentId.describe("The environment the scheduled runs happen in."),
18195
+ ...triggerScheduleRepeatFields,
18119
18196
  minuteOfHour: number2().int().min(0).max(59).optional().describe("Minutes past the hour an hourly schedule fires. Defaults to 0."),
18120
- timeOfDay: string2().regex(/^([01]\d|2[0-3]):[0-5]\d$/).optional().describe('The wall clock time a daily or weekly schedule fires, as "HH:mm". Required when cadence is daily or weekly.'),
18197
+ timeOfDay: string2().regex(/^([01]\d|2[0-3]):[0-5]\d$/).optional().describe('The wall clock time a daily, weekly or monthly schedule fires, as "HH:mm". Required when cadence is daily, weekly or monthly.'),
18121
18198
  timezoneId: string2().min(1).refine(isTimezone, "Expected an IANA timezone, such as America/New_York.").optional().describe("The IANA timezone the schedule is read in, such as America/New_York. Required for every cadence: it sets the day boundaries daysOfWeek is read against, and the wall clock timeOfDay is read against.")
18122
18199
  });
18123
18200
 
18201
+ // node_modules/@qawolf/api-contracts/dist/v1/trigger/scheduleRepeatRules.js
18202
+ var hourlyEveryValues = [1, 2, 3, 4, 6, 8, 12];
18203
+ var maxEvery = {
18204
+ daily: 31,
18205
+ monthly: 12,
18206
+ weekly: 12
18207
+ };
18208
+ var dayOfWeekNames = [
18209
+ "sunday",
18210
+ "monday",
18211
+ "tuesday",
18212
+ "wednesday",
18213
+ "thursday",
18214
+ "friday",
18215
+ "saturday"
18216
+ ];
18217
+ var calendarDayOf = (startDate) => {
18218
+ const date = new Date(`${startDate}T00:00:00Z`);
18219
+ return !Number.isNaN(date.getTime()) && date.toISOString().startsWith(startDate) ? date : undefined;
18220
+ };
18221
+ var everyIssue = (value, every) => {
18222
+ if (value.cadence === "hourly") {
18223
+ return hourlyEveryValues.includes(every) ? undefined : "every must divide a day evenly when cadence is hourly: 1, 2, 3, 4, 6, 8 or 12.";
18224
+ }
18225
+ const max = maxEvery[value.cadence];
18226
+ return every > max ? `every is at most ${max} when cadence is ${value.cadence}.` : undefined;
18227
+ };
18228
+ var startDateIssue = (value, startDate) => {
18229
+ const day = calendarDayOf(startDate);
18230
+ if (day === undefined)
18231
+ return "startDate must be a real calendar date.";
18232
+ if (value.cadence === "weekly" && value.dayOfWeek !== undefined && dayOfWeekNames[day.getUTCDay()] !== value.dayOfWeek)
18233
+ return "startDate must fall on dayOfWeek.";
18234
+ if (value.cadence === "monthly" && value.dayOfMonth !== undefined && day.getUTCDate() !== value.dayOfMonth)
18235
+ return "startDate must fall on dayOfMonth.";
18236
+ return;
18237
+ };
18238
+ var checkScheduleRepeat = (value, ctx) => {
18239
+ const every = value.every ?? 1;
18240
+ const issue = (message, field) => ctx.addIssue({ code: "custom", message, path: [field] });
18241
+ const everyMessage = everyIssue(value, every);
18242
+ if (everyMessage !== undefined)
18243
+ issue(everyMessage, "every");
18244
+ if (value.cadence === "hourly")
18245
+ return;
18246
+ if (every > 1 && value.daysOfWeek !== undefined)
18247
+ issue("daysOfWeek applies only when every is 1.", "daysOfWeek");
18248
+ if (every > 1 && value.startDate === undefined) {
18249
+ issue("startDate is required when every is more than 1.", "startDate");
18250
+ return;
18251
+ }
18252
+ if (value.startDate === undefined)
18253
+ return;
18254
+ if (every === 1) {
18255
+ issue("startDate applies only when every is more than 1.", "startDate");
18256
+ return;
18257
+ }
18258
+ const startDateMessage = startDateIssue(value, value.startDate);
18259
+ if (startDateMessage !== undefined)
18260
+ issue(startDateMessage, "startDate");
18261
+ };
18262
+
18124
18263
  // node_modules/@qawolf/api-contracts/dist/v1/trigger/configurationRules.js
18125
18264
  var checkAction = (action, ctx) => {
18126
18265
  const namesFlows = action.flowIds.length + action.tagNames.length > 0;
@@ -18152,24 +18291,32 @@ var checkAction = (action, ctx) => {
18152
18291
  var requiredScheduleFields = {
18153
18292
  daily: ["timeOfDay", "timezoneId"],
18154
18293
  hourly: ["timezoneId"],
18294
+ monthly: ["dayOfMonth", "timeOfDay", "timezoneId"],
18155
18295
  weekly: ["dayOfWeek", "timeOfDay", "timezoneId"]
18156
18296
  };
18157
18297
  var optionalScheduleFields = {
18158
- daily: ["daysOfWeek"],
18159
- hourly: ["daysOfWeek", "minuteOfHour"],
18160
- weekly: []
18298
+ daily: ["daysOfWeek", "every", "startDate"],
18299
+ hourly: ["daysOfWeek", "every", "minuteOfHour"],
18300
+ monthly: ["every", "startDate"],
18301
+ weekly: ["every", "startDate"]
18161
18302
  };
18162
18303
  var cadencesUsingField = {
18304
+ dayOfMonth: "a monthly cadence",
18163
18305
  dayOfWeek: "a weekly cadence",
18164
18306
  daysOfWeek: "an hourly or daily cadence",
18307
+ every: "any cadence",
18165
18308
  minuteOfHour: "an hourly cadence",
18166
- timeOfDay: "a daily or weekly cadence",
18167
- timezoneId: "an hourly, daily or weekly cadence"
18309
+ startDate: "a daily, weekly or monthly cadence",
18310
+ timeOfDay: "a daily, weekly or monthly cadence",
18311
+ timezoneId: "an hourly, daily, weekly or monthly cadence"
18168
18312
  };
18169
18313
  var scheduleFields = [
18314
+ "dayOfMonth",
18170
18315
  "dayOfWeek",
18171
18316
  "daysOfWeek",
18317
+ "every",
18172
18318
  "minuteOfHour",
18319
+ "startDate",
18173
18320
  "timeOfDay",
18174
18321
  "timezoneId"
18175
18322
  ];
@@ -18199,6 +18346,7 @@ var checkScheduleFields = (value, ctx) => {
18199
18346
  };
18200
18347
  var checkSchedule = (value, ctx) => {
18201
18348
  checkScheduleFields(value, ctx);
18349
+ checkScheduleRepeat(value, ctx);
18202
18350
  if (value.action.kind === "generativeSuite") {
18203
18351
  ctx.addIssue({
18204
18352
  code: "custom",
@@ -18477,7 +18625,7 @@ var makeAgentGetContract = (ids) => {
18477
18625
  const input = object({
18478
18626
  cursor: string2().min(1).optional().describe("Opaque cursor copied from this same session's previous nextCursor. Omit to read from its first reply."),
18479
18627
  sessionId: ids.chatSession.describe("The id agent.send answered with."),
18480
- waitSeconds: number2().int().min(0).optional().describe(`How long the server may hold this check open, in seconds. Defaults to ${maxAgentWaitSeconds}, the longest hold, and a larger value clamps to it. Pass 0 to answer at once. Check again as soon as a held check returns.`)
18628
+ waitSeconds: number2().int().min(0).optional().describe(`How long the server may hold this check open, in seconds. Defaults to ${maxAgentWaitSeconds}. Pass 0 to answer at once. A larger value clamps to ${maxAgentWaitSeconds}, or to ${maxAgentWaitSecondsWithProgress} when the call carries a progress token. Pass more than ${maxAgentWaitSeconds} only when your instructions say your client keeps the call open while progress arrives. A held check answers the moment a reply or status change arrives. Check again as soon as a held check returns.`)
18481
18629
  });
18482
18630
  const output = resource({
18483
18631
  nextCursor: string2().min(1).describe("Send back as cursor on the next check to read only what follows. Always present, even with no replies. Belongs to this session alone."),
@@ -18500,7 +18648,7 @@ var makeAgentGetContract = (ids) => {
18500
18648
  openWorldHint: false,
18501
18649
  readOnlyHint: true
18502
18650
  },
18503
- description: 'Monitor a QA Wolf AI session by reading its status and replies. After agent.send, share the returned session URL before monitoring. Pass waitSeconds 45 so the server holds the check open and answers the moment something happens. Check again as soon as it returns; never sleep between checks or loop without waitSeconds. Pass the nextCursor from one response as the cursor on the next check; it then reads only what is new, and only for the session that minted it. Continue monitoring silently when the status is unchanged and no replies come back; do not narrate waiting, announce the next check, or ask whether to keep monitoring. Report only substantive new progress, questions, blockers, or the final outcome. A status of "waiting-for-you" means the last reply is a question the work is blocked on, and answering it with agent.send is what unblocks it. Surface an explicit request for user input even if the status still says "working". Include the session URL when reporting a blocker or final outcome. On "completed", stop status checks and verify the requested result before claiming success. For new flows, validation, publication in the target environment, and readiness are separate checks; a Git push or final reply does not prove the flow is active. If every requested result is verified but status remains "working", report the mismatch and stop monitoring. Stop on "failed" or "cancelled" and report any confirmed partial result.',
18651
+ description: `Monitor a QA Wolf AI session by reading its status and replies. After agent.send, share the returned session URL before monitoring. Pass waitSeconds ${maxAgentWaitSeconds} so the server holds the check open and answers the moment a reply or status change arrives. Check again as soon as it returns; never sleep between checks or loop without waitSeconds. Pass the nextCursor from one response as the cursor on the next check; it then reads only what is new, and only for the session that minted it. Continue monitoring silently when the status is unchanged and no replies come back; do not narrate waiting, announce the next check, or ask whether to keep monitoring. Report only substantive new progress, questions, blockers, or the final outcome. A status of "waiting-for-you" means the last reply is a question the work is blocked on, and answering it with agent.send is what unblocks it. Surface an explicit request for user input even if the status still says "working". Include the session URL when reporting a blocker or final outcome. On "completed", stop status checks and verify the requested result before claiming success. For new flows, validation, publication in the target environment, and readiness are separate checks; a Git push or final reply does not prove the flow is active. If every requested result is verified but status remains "working", report the mismatch and stop monitoring. Stop on "failed" or "cancelled" and report any confirmed partial result.`,
18504
18652
  input,
18505
18653
  kind: "read",
18506
18654
  name: "agent.get",
@@ -18511,6 +18659,7 @@ var makeAgentGetContract = (ids) => {
18511
18659
  // node_modules/@qawolf/api-contracts/dist/v1/agent/send.js
18512
18660
  var makeAgentSendContract = (ids) => {
18513
18661
  const input = object({
18662
+ builds: array(buildIdSchema).min(1).max(20).optional().describe("Builds this request is about, from build.create, at most one per app and platform. The runs of the session install them over the environment's builds of the same app and platform, and record them. Create them without an environment, so the environment's own runs keep their builds."),
18514
18663
  environmentId: ids.environmentRef.optional().describe("The environment to work in. Omit to use the team's default environment. Ignored when sessionId is given, because a session keeps the environment it opened in."),
18515
18664
  filePaths: array(teamStoragePathSchema).max(20).optional().describe("Paths of files this request is about, from file.requestUpload. The AI reads them from storage rather than the message, so a plan of hundreds of journeys costs nothing to send."),
18516
18665
  message: string2().trim().min(1).max(1e4).describe("What you want QA Wolf to do, in plain language. Name the journey, the part of the app it covers, and anything the AI cannot discover for itself, such as a test account, a feature flag, or how to reach a staging environment. When answering a question from agent.get, send the answer here."),
@@ -19860,13 +20009,7 @@ var makeUpdateFlowContract = (ids) => {
19860
20009
  };
19861
20010
 
19862
20011
  // node_modules/@qawolf/api-contracts/dist/v1/issue/index.js
19863
- var issuePrioritySchema = _enum([
19864
- "unprioritized",
19865
- "low",
19866
- "medium",
19867
- "high",
19868
- "urgent"
19869
- ]);
20012
+ var issuePrioritySchema = _enum(["unprioritized", "low", "medium", "high", "urgent"]).describe("An open bug report at unprioritized, high or urgent priority blocks its suite and CI gate. Low and medium don't block. Priority never makes a blocker or coverage request block.");
19870
20013
  var issueStatusSchema = _enum([
19871
20014
  "backlog",
19872
20015
  "pending",
@@ -20066,6 +20209,51 @@ var makeGetInvestigationContract = (ids) => {
20066
20209
  };
20067
20210
  };
20068
20211
 
20212
+ // node_modules/@qawolf/api-contracts/dist/v1/investigation/question/answer.js
20213
+ var maxAnswersPerCall = 50;
20214
+ var findingIdSchema = string2().min(1).max(80);
20215
+ var findingIdsOf = ({ answers = {}, replies = {} }) => [
20216
+ ...Object.keys(answers),
20217
+ ...Object.keys(replies)
20218
+ ];
20219
+ var makeAnswerInvestigationQuestionsContract = (ids) => {
20220
+ const input = object({
20221
+ answers: record(findingIdSchema, string2().min(1)).optional().describe("Offered answers, keyed by the question's findingId. Each value is the `value` of one of the question's offered answers, such as maintenance or bug."),
20222
+ replies: record(findingIdSchema, string2().trim().min(1).max(1000)).optional().describe("The person's own words, keyed by the question's findingId, for a question that none of the offered answers fits."),
20223
+ runId: ids.run
20224
+ }).refine((sent) => findingIdsOf(sent).length > 0, {
20225
+ message: "Send at least one answer or reply."
20226
+ }).refine((sent) => findingIdsOf(sent).length <= maxAnswersPerCall, {
20227
+ message: `Send at most ${maxAnswersPerCall} answers and replies in one call.`
20228
+ }).refine((sent) => new Set(findingIdsOf(sent)).size === findingIdsOf(sent).length, { message: "Answer each question once, as an answer or as a reply." });
20229
+ const output = resource({
20230
+ answeredFindingIds: array(string2()).describe("The questions this call answered. The investigation receives the answers and acts on them."),
20231
+ refused: array(object({
20232
+ findingId: string2(),
20233
+ message: string2().describe("Why the answer was not recorded."),
20234
+ reason: string2().describe('Known values: "answer-not-offered", "environment-terminated", "not-asking", "not-found", "response-pending" and "superseded". New values can appear.')
20235
+ })).describe("The answers that were not recorded."),
20236
+ runId: ids.run
20237
+ }, { urlFieldDescription: "The run in the QA Wolf app." });
20238
+ return {
20239
+ annotationJustifications: {
20240
+ destructiveHint: "Records a person's answer that cannot be changed, and the investigation acts on it, for example by filing a bug or publishing a test fix.",
20241
+ openWorldHint: "A bug report the investigation files from an answer can reach the workspace's configured integrations.",
20242
+ readOnlyHint: "Records answers to the questions of a run's investigation."
20243
+ },
20244
+ annotations: {
20245
+ destructiveHint: true,
20246
+ openWorldHint: true,
20247
+ readOnlyHint: false
20248
+ },
20249
+ description: "Answer the questions the QA Wolf AI investigating a failed run is waiting on, as the signed-in person. " + "List the questions with investigation.question.find, and answer only with the person's approval. " + "The first answer to a question wins, and the investigation acts on it. " + "Only a person's own sign-in or user API key can answer; a team or organization key cannot.",
20250
+ input,
20251
+ kind: "write",
20252
+ name: "investigation.question.answer",
20253
+ output
20254
+ };
20255
+ };
20256
+
20069
20257
  // node_modules/@qawolf/api-contracts/dist/v1/investigation/question/find.js
20070
20258
  var makeFindInvestigationQuestionsContract = (ids) => {
20071
20259
  const input = object({
@@ -20083,7 +20271,7 @@ var makeFindInvestigationQuestionsContract = (ids) => {
20083
20271
  headline: string2().optional(),
20084
20272
  question: investigationQuestionSchema,
20085
20273
  runId: ids.run,
20086
- sessionId: ids.chatSession.describe("The investigation session. Answer the question by sending the person's answer to it with agent.send."),
20274
+ sessionId: ids.chatSession.describe("The investigation session. Read what it is doing with agent.get."),
20087
20275
  summary: string2().optional()
20088
20276
  }, { 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.")
20089
20277
  });
@@ -20098,7 +20286,7 @@ var makeFindInvestigationQuestionsContract = (ids) => {
20098
20286
  openWorldHint: false,
20099
20287
  readOnlyHint: true
20100
20288
  },
20101
- 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.",
20289
+ 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 them, call investigation.question.answer with the run and the person's answers.",
20102
20290
  input,
20103
20291
  kind: "read",
20104
20292
  name: "investigation.question.find",
@@ -20108,6 +20296,7 @@ var makeFindInvestigationQuestionsContract = (ids) => {
20108
20296
 
20109
20297
  // node_modules/@qawolf/api-contracts/dist/v1/investigation/question/index.js
20110
20298
  var makeInvestigationQuestionContracts = (ids) => ({
20299
+ answer: makeAnswerInvestigationQuestionsContract(ids),
20111
20300
  find: makeFindInvestigationQuestionsContract(ids)
20112
20301
  });
20113
20302
 
@@ -20173,12 +20362,61 @@ var makeAttachFilesToIssueContract = (ids) => {
20173
20362
  };
20174
20363
  };
20175
20364
 
20365
+ // node_modules/@qawolf/api-contracts/dist/v1/issue/commentResource.js
20366
+ var issueCommentAuthorSchema = discriminatedUnion("type", [
20367
+ object({
20368
+ email: string2(),
20369
+ name: string2().optional().describe("Absent when the person has not set a name."),
20370
+ type: literal("user")
20371
+ }),
20372
+ object({ type: literal("former-user") }),
20373
+ object({ type: literal("team-api-key") }),
20374
+ object({ type: literal("system") })
20375
+ ]).describe("Who wrote the comment: a person, a person whose account was since deleted (`former-user`), an API key of the team or its organization (`team-api-key`), or QA Wolf itself (`system`).");
20376
+ var makeIssueCommentResourceSchema = (ids) => resource({
20377
+ author: issueCommentAuthorSchema,
20378
+ body: string2().describe("The comment in GitHub-flavored Markdown."),
20379
+ commentId: string2().describe("The id of the comment."),
20380
+ createdAt: exports_coerce.date().describe("When the comment was written."),
20381
+ issueId: ids.issue.describe("The issue the comment is on."),
20382
+ viaQaWolfAi: boolean2().describe("Whether the author wrote the comment through QA Wolf AI.")
20383
+ }, { urlFieldDescription: "Absolute URL of the issue page." });
20384
+
20385
+ // node_modules/@qawolf/api-contracts/dist/v1/issue/comment.js
20386
+ var maxCommentLength = 1e4;
20387
+ var makeCommentOnIssueContract = (ids) => {
20388
+ const input = object({
20389
+ body: string2().trim().min(1).max(maxCommentLength).describe("The comment in GitHub-flavored Markdown."),
20390
+ issueId: ids.issue.describe("The bug report, blocker, or coverage request to comment on.")
20391
+ });
20392
+ const output = object({
20393
+ comment: makeIssueCommentResourceSchema(ids)
20394
+ });
20395
+ return {
20396
+ annotationJustifications: {
20397
+ destructiveHint: "Adds a comment without removing or changing anything else on the issue.",
20398
+ openWorldHint: "Today it changes only QA Wolf records. It does not post the comment to a linked tracker or to any other service of the workspace.",
20399
+ readOnlyHint: "Records a comment on the issue."
20400
+ },
20401
+ annotations: {
20402
+ destructiveHint: false,
20403
+ openWorldHint: false,
20404
+ readOnlyHint: false
20405
+ },
20406
+ description: "Comment on a bug report, blocker (issue type `maintenance`), or coverage request owned by the caller's team. " + "The comment changes nothing else on the issue, such as its status or priority.",
20407
+ input,
20408
+ kind: "write",
20409
+ name: "issue.comment",
20410
+ output
20411
+ };
20412
+ };
20413
+
20176
20414
  // node_modules/@qawolf/api-contracts/dist/v1/issue/create.js
20177
20415
  var makeCreateIssueContract = (ids) => {
20178
20416
  const commonFields = {
20179
- description: string2().optional().describe("The issue description in Markdown, which is stored as rich text. Text without Markdown is stored as written, one paragraph per line."),
20417
+ description: string2().optional().describe(issueDescriptionDescription),
20180
20418
  name: string2().trim().min(1).max(255),
20181
- priority: issuePrioritySchema.optional().describe('Defaults to "unprioritized" for bug reports and coverage requests.'),
20419
+ priority: issuePrioritySchema.optional().describe(`${issuePrioritySchema.description} Defaults to "unprioritized" for bug reports and coverage requests.`),
20182
20420
  workspaceId: ids.workspace.optional().describe("The workspace to create the issue in. Required when authenticating with an organization or user API key.")
20183
20421
  };
20184
20422
  const input = discriminatedUnion("type", [
@@ -20316,6 +20554,35 @@ var makeListIssueActivityContract = (ids) => {
20316
20554
  };
20317
20555
  };
20318
20556
 
20557
+ // node_modules/@qawolf/api-contracts/dist/v1/issue/listComments.js
20558
+ var makeListIssueCommentsContract = (ids) => {
20559
+ const input = object({
20560
+ issueId: ids.issue.describe("The bug report, blocker, or coverage request whose comments to list."),
20561
+ ...makePaginationInputFields({ defaultLimit: 50, maxLimit: 200 })
20562
+ });
20563
+ const output = object({
20564
+ comments: array(makeIssueCommentResourceSchema(ids)).describe("The issue's comments, oldest first."),
20565
+ nextCursor: nextCursorSchema
20566
+ });
20567
+ return {
20568
+ annotationJustifications: {
20569
+ destructiveHint: "Does not edit the issue or its comments.",
20570
+ openWorldHint: "Reads QA Wolf comments without reading or changing linked trackers.",
20571
+ readOnlyHint: "Lists the comments on one issue."
20572
+ },
20573
+ annotations: {
20574
+ destructiveHint: false,
20575
+ openWorldHint: false,
20576
+ readOnlyHint: true
20577
+ },
20578
+ description: "List the comments on a bug report, blocker (issue type `maintenance`), or coverage request, oldest first, with who wrote each one.",
20579
+ input,
20580
+ kind: "read",
20581
+ name: "issue.listComments",
20582
+ output
20583
+ };
20584
+ };
20585
+
20319
20586
  // node_modules/@qawolf/api-contracts/dist/v1/issue/removeFlows.js
20320
20587
  var makeRemoveFlowsFromIssueContract = (ids) => {
20321
20588
  const input = object({
@@ -20347,7 +20614,7 @@ var makeRemoveFlowsFromIssueContract = (ids) => {
20347
20614
 
20348
20615
  // node_modules/@qawolf/api-contracts/dist/v1/issue/update.js
20349
20616
  var makeUpdateIssueContract = (ids) => {
20350
- const descriptionSchema = string2().describe("The issue description in Markdown, which is stored as rich text. Text without Markdown is stored as written, one paragraph per line.");
20617
+ const descriptionSchema = string2().describe(issueDescriptionDescription);
20351
20618
  const nameSchema = string2().trim().min(1).max(255);
20352
20619
  const input = object({
20353
20620
  description: descriptionSchema.optional(),
@@ -20384,11 +20651,13 @@ var makeUpdateIssueContract = (ids) => {
20384
20651
  var makeIssueContracts = (ids) => ({
20385
20652
  addFlows: makeAddFlowsToIssueContract(ids),
20386
20653
  attachFiles: makeAttachFilesToIssueContract(ids),
20654
+ comment: makeCommentOnIssueContract(ids),
20387
20655
  create: makeCreateIssueContract(ids),
20388
20656
  decideSuggestion: makeDecideSuggestionContract(ids),
20389
20657
  find: makeFindIssuesContract(ids),
20390
20658
  get: makeGetIssueContract(ids),
20391
20659
  listActivity: makeListIssueActivityContract(ids),
20660
+ listComments: makeListIssueCommentsContract(ids),
20392
20661
  removeFlows: makeRemoveFlowsFromIssueContract(ids),
20393
20662
  update: makeUpdateIssueContract(ids)
20394
20663
  });
@@ -20542,6 +20811,7 @@ var makeConnectMcpServerContract = (ids) => {
20542
20811
  });
20543
20812
  const output = object({
20544
20813
  authorizationUrl: string2().url().describe("The server's sign-in page. Show it to the user: the connection is ready once they approve access there."),
20814
+ connectionName: string2().describe("The name of the workspace connection the sign-in authorizes. It differs from serverName when the workspace already reaches the server under another name and that connection needs authorizing again."),
20545
20815
  serverName: string2().describe("The catalog name of the server.")
20546
20816
  });
20547
20817
  return {
@@ -20784,7 +21054,8 @@ var makeGetRunContract = (ids) => {
20784
21054
  const flowStatus = _enum(publicRunStatusValues);
20785
21055
  const input = object({
20786
21056
  flowStatuses: array(flowStatus).min(1).optional().describe("Return only the flows whose status is one of these. A suite run can " + "hold hundreds of flows, so start an investigation with failed " + "alone. A flow that passed after a retry reads passed, so add " + "passed when a flaky flow is missing from the answer. Omit to " + "return every flow. The run-level fields are unaffected."),
20787
- runId: ids.run
21057
+ runId: ids.run,
21058
+ waitSeconds: number2().int().min(0).optional().describe(`How long the server may hold this check open, in seconds, waiting for the run's status to change. Defaults to 0, which answers at once. A larger value clamps to ${maxAgentWaitSeconds}, or to ${maxAgentWaitSecondsWithProgress} when the call carries a progress token. Pass more than ${maxAgentWaitSeconds} only when your instructions say your client keeps the call open while progress arrives. A held check answers the moment the status changes, and at once when the run is already terminal. A held check also waits while the run is still being created.`)
20788
21059
  });
20789
21060
  const attempts = makeFlowAttemptsSchema(ids);
20790
21061
  const failedFlow = object({
@@ -20808,7 +21079,9 @@ var makeGetRunContract = (ids) => {
20808
21079
  buildVersions: array(runBuildVersionSchema).describe("The apps the run's attempts installed, one per app and platform, with warnings. Empty when no attempt reported an install and the run has no builds."),
20809
21080
  flows,
20810
21081
  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."),
20811
- siteVersions: array(runSiteVersionSchema).describe("The versions the run's attempts saw on each site origin, with warnings. Empty when no attempt reported one.")
21082
+ siteVersions: array(runSiteVersionSchema).describe("The versions the run's attempts saw on each site origin, with warnings. Empty when no attempt reported one."),
21083
+ waitSeconds: number2().int().optional().describe("The hold this check was allowed, in seconds, after clamping. Absent when the check did not wait."),
21084
+ wokeOn: runWakeReasonSchema.optional()
20812
21085
  }, { urlFieldDescription: "Absolute URL of the run page." });
20813
21086
  return {
20814
21087
  annotationJustifications: {
@@ -20821,7 +21094,7 @@ var makeGetRunContract = (ids) => {
20821
21094
  openWorldHint: false,
20822
21095
  readOnlyHint: true
20823
21096
  },
20824
- description: "Get a run's status, per-flow results, links, and how many of its bugs are blocking.",
21097
+ description: `Get a run's status, per-flow results, links, and how many of its bugs are blocking. Call it without waitSeconds for an immediate answer. To wait on a run that is still queued or running, pass waitSeconds up to ${maxAgentWaitSeconds}: the server holds the check open and answers the moment the status changes. A held check also waits while the run is still being created. After a held check returns, call again only while status is queued or running. Stop when status is passed, failed, canceled, or superseded.`,
20825
21098
  input,
20826
21099
  kind: "read",
20827
21100
  name: "run.get",
@@ -21305,6 +21578,7 @@ var unchangedFilesSchema = record(string2(), string2().min(1)).superRefine((hash
21305
21578
  });
21306
21579
  var makeRunFlowOnRunnerContract = (ids) => {
21307
21580
  const input = object({
21581
+ builds: array(buildIdSchema).min(1).max(20).optional().describe("Builds to install in this run, at most one per app and platform. Each replaces the named environment's latest build of its app and platform. The run sees them in `QAWOLF_BUILDS`, which `launch({ app: { id } })` reads."),
21308
21582
  entryPointPath: runFilePathSchema.describe("Path of the flow file to run, as it appears in `files`."),
21309
21583
  env: runEnvironmentSchema.optional().describe("Environment variables to make available to the run. With `environmentId`, they are added on top of that environment's variables for this run only, replacing any of the same name; the environment itself is not changed."),
21310
21584
  environmentId: ids.environmentRef.optional().describe("A QA Wolf environment whose variables the run is given, by id or alias. QA Wolf reads and decrypts them itself, so they never travel in the request and the count and length limits on `env` do not apply to them. The run also gets `QAWOLF_ENVIRONMENT_ID`, `QAWOLF_ENVIRONMENT_NAME` and `QAWOLF_TEAM_API_KEY`, as a cloud run on that environment does, so a flow can save environment variables with `@qawolf/testkit`; `env` cannot replace these three."),
@@ -21558,6 +21832,9 @@ var makeContractsV1 = (ids) => {
21558
21832
  runAttempt: ids.runAttempt ?? defaultIdSchemas.runAttempt
21559
21833
  };
21560
21834
  return {
21835
+ activity: {
21836
+ wait: makeActivityWaitContract(resolvedIds)
21837
+ },
21561
21838
  agent: {
21562
21839
  get: makeAgentGetContract(resolvedIds),
21563
21840
  send: makeAgentSendContract(resolvedIds)
@@ -24132,7 +24409,7 @@ function startUpdateCheck(deps) {
24132
24409
  // package.json
24133
24410
  var package_default = {
24134
24411
  name: "@qawolf/cli",
24135
- version: "2.6.0",
24412
+ version: "2.8.0",
24136
24413
  description: "Run and manage QA Wolf flows from the terminal, CI, or an AI agent",
24137
24414
  keywords: [
24138
24415
  "automation",
@@ -24204,7 +24481,7 @@ var package_default = {
24204
24481
  "@clack/prompts": "1.5.1",
24205
24482
  "@napi-rs/keyring": "1.3.0",
24206
24483
  "@oxc-node/core": "0.1.0",
24207
- "@qawolf/api-contracts": "0.107.0",
24484
+ "@qawolf/api-contracts": "0.116.0",
24208
24485
  "@qawolf/emails": "1.1.1",
24209
24486
  "@qawolf/flow-targets": "2.0.0",
24210
24487
  "@qawolf/flows": "0.3.0",
@@ -24830,6 +25107,7 @@ var chatSessionIdEnvironmentVariable = "QAWOLF_CHAT_SESSION_ID";
24830
25107
  function parseInput(options) {
24831
25108
  return publicContractsV1.agent.send.input.safeParse({
24832
25109
  message: options.message,
25110
+ ...options.builds === undefined ? {} : { builds: options.builds },
24833
25111
  ...options.environmentId === undefined ? {} : { environmentId: options.environmentId },
24834
25112
  ...options.filePaths === undefined ? {} : { filePaths: options.filePaths },
24835
25113
  ...options.parentSessionId === undefined ? {} : { parentSessionId: options.parentSessionId },
@@ -24891,9 +25169,11 @@ Examples:
24891
25169
  $ qawolf agent send "cover the checkout journey" --follow
24892
25170
  $ qawolf agent send "use the staging login test@example.com" --session <id>
24893
25171
  $ qawolf agent send "cover signup" --environment-id staging --follow
24894
- $ qawolf agent send "cover every journey in the sheet" --file-paths uploads/journeys.csv --follow`;
25172
+ $ qawolf agent send "cover every journey in the sheet" --file-paths uploads/journeys.csv --follow
25173
+ $ qawolf agent send "test the new admin build" --builds <buildId>`;
24895
25174
  function registerAgentSendCommand(agent, signals) {
24896
- declareCommandKind(agent.command("send <message>"), "write").description("Ask the QA Wolf AI to do a piece of work, such as covering a journey or fixing a broken flow").option("--follow", "Stay and report what QA Wolf says until the session settles, answering its questions as they come", false).option("--session <id>", "Continue this session instead of opening a new one. Send an answer, or add context to work already running").addOption(new Option2("--environment-id <env>", "QA Wolf environment to work in, by id or alias. Ignored with --session, because a session keeps the environment it opened in").env(environmentIdEnvironmentVariable)).option("--workspace-id <id>", "The workspace to work in. Required when authenticating with an organization or user API key").option("--file-paths <path...>", "Team-storage paths of files this request is about, from qawolf file requestUpload. The AI reads them from storage rather than the message, so a plan of hundreds of journeys costs nothing to send. Up to 20").option("--timeout <seconds>", timeoutFlagDescription, String(defaultAgentFollowTimeoutSeconds)).addHelpText("after", sendExamples).action((message, opts, command) => withAuthContext(signals, (ctx) => handleAgentSend(ctx, {
25175
+ declareCommandKind(agent.command("send <message>"), "write").description("Ask the QA Wolf AI to do a piece of work, such as covering a journey or fixing a broken flow").option("--follow", "Stay and report what QA Wolf says until the session settles, answering its questions as they come", false).option("--session <id>", "Continue this session instead of opening a new one. Send an answer, or add context to work already running").addOption(new Option2("--environment-id <env>", "QA Wolf environment to work in, by id or alias. Ignored with --session, because a session keeps the environment it opened in").env(environmentIdEnvironmentVariable)).option("--workspace-id <id>", "The workspace to work in. Required when authenticating with an organization or user API key").option("--file-paths <path...>", "Team-storage paths of files this request is about, from qawolf file requestUpload. The AI reads them from storage rather than the message, so a plan of hundreds of journeys costs nothing to send. Up to 20").option("--builds <ids...>", "Builds this request is about, from qawolf build create, one per app and platform. The session's runs install them over the environment's builds of the same app and platform. Put the message before this flag").option("--timeout <seconds>", timeoutFlagDescription, String(defaultAgentFollowTimeoutSeconds)).addHelpText("after", sendExamples).action((message, opts, command) => withAuthContext(signals, (ctx) => handleAgentSend(ctx, {
25176
+ builds: opts.builds,
24897
25177
  environmentId: opts.environmentId,
24898
25178
  filePaths: opts.filePaths,
24899
25179
  follow: opts.follow,
@@ -26141,6 +26421,192 @@ function registerAuthCommand(program, signals) {
26141
26421
  });
26142
26422
  }
26143
26423
 
26424
+ // src/domains/build/uploadFileName.ts
26425
+ import { basename } from "node:path";
26426
+ var maxLength = 255;
26427
+ function uploadFileName(filePath) {
26428
+ const safe = basename(filePath).replaceAll(/[^A-Za-z0-9._-]+/g, "-");
26429
+ if (safe.length <= maxLength)
26430
+ return safe;
26431
+ const extension = safe.slice(safe.lastIndexOf("."));
26432
+ return safe.slice(0, maxLength - extension.length) + extension;
26433
+ }
26434
+
26435
+ // src/domains/build/uploadInput.ts
26436
+ var definedOnly = (fields) => Object.fromEntries(Object.entries(fields).filter(([, value]) => value !== undefined));
26437
+ function environmentSelector(options) {
26438
+ const environment = definedOnly({
26439
+ baseEphemeralEnvironment: options.environmentBaseEphemeralEnvironment,
26440
+ ephemeral: options.environmentEphemeral,
26441
+ id: options.environmentId,
26442
+ name: options.environmentName
26443
+ });
26444
+ return Object.keys(environment).length === 0 ? {} : { environment };
26445
+ }
26446
+ var storageReasonMaxLength = 200;
26447
+ function storageReason(body) {
26448
+ const code = /<Code>([^<]+)<\/Code>/.exec(body)?.[1];
26449
+ const message = /<Message>([^<]+)<\/Message>/.exec(body)?.[1];
26450
+ const reason = code === undefined ? body.replace(/\s+/g, " ").trim() : [code, message].filter((part) => part !== undefined).join(": ");
26451
+ if (reason.length === 0)
26452
+ return;
26453
+ return reason.length > storageReasonMaxLength ? `${reason.slice(0, storageReasonMaxLength)}…` : reason;
26454
+ }
26455
+ function describePutFailure(error) {
26456
+ if (error.kind === "http")
26457
+ return buildMessages.storageRefused(error.status, storageReason(error.body));
26458
+ if (error.kind === "timeout")
26459
+ return buildMessages.storageTimedOut(error.timeoutMs);
26460
+ return buildMessages.storageUnreachable(error.kind === "network" ? describeFetchCause(error.cause) : undefined);
26461
+ }
26462
+ var idForFlagCheck = "000000000000000000000000obld";
26463
+ function parseCreateFlags(options) {
26464
+ const parsed = publicContractsV1.build.create.input.safeParse({
26465
+ ...definedOnly({
26466
+ branch: options.branch,
26467
+ commitSha: options.commitSha,
26468
+ workspaceId: options.workspaceId
26469
+ }),
26470
+ ...environmentSelector(options),
26471
+ buildId: idForFlagCheck
26472
+ });
26473
+ if (!parsed.success)
26474
+ return { ok: false, error: parsed.error };
26475
+ const { buildId: _idForFlagCheck, ...flags } = parsed.data;
26476
+ return { ok: true, value: flags };
26477
+ }
26478
+ var requestUploadFields = (options) => definedOnly(options);
26479
+
26480
+ // src/domains/build/upload.ts
26481
+ var platformFailure = (failure) => ({
26482
+ ...failure.unreachable === true ? { exitCode: exitCodes.network } : {},
26483
+ ...failureFields(failure)
26484
+ });
26485
+ var invalid = (error) => ({
26486
+ error: prettifyError(error),
26487
+ exitCode: exitCodes.invalidArgs
26488
+ });
26489
+ async function handleBuildUpload(ctx, options, deps) {
26490
+ const flags = parseCreateFlags(options);
26491
+ if (!flags.ok)
26492
+ return invalid(flags.error);
26493
+ const file = await deps.openFile(options.filePath);
26494
+ if (file === undefined) {
26495
+ return {
26496
+ error: buildMessages.fileUnreadable(options.filePath),
26497
+ exitCode: exitCodes.invalidArgs
26498
+ };
26499
+ }
26500
+ const fileName = uploadFileName(options.filePath);
26501
+ const requestInput = publicContractsV1.build.requestUpload.input.safeParse(requestUploadFields({
26502
+ fileName,
26503
+ fileSizeBytes: file.size,
26504
+ workspaceId: options.workspaceId
26505
+ }));
26506
+ if (!requestInput.success)
26507
+ return invalid(requestInput.error);
26508
+ const requested = await ctx.platformClient.callPublicApi(publicContractsV1.build.requestUpload, requestInput.data);
26509
+ if (!requested.ok)
26510
+ return platformFailure(requested);
26511
+ const { buildId, uploadHeaders, uploadUrl } = requested.value;
26512
+ const waiting = ctx.ui.wait(buildMessages.uploading(fileName, file.size));
26513
+ const uploaded = await deps.putFile({
26514
+ body: file,
26515
+ headers: uploadHeaders,
26516
+ url: uploadUrl
26517
+ });
26518
+ waiting.stop();
26519
+ if (!uploaded.ok) {
26520
+ return {
26521
+ error: buildMessages.uploadFailed(buildId, describePutFailure(uploaded.error)),
26522
+ exitCode: exitCodes.network
26523
+ };
26524
+ }
26525
+ const created = await ctx.platformClient.callPublicApi(publicContractsV1.build.create, { ...flags.value, buildId });
26526
+ if (!created.ok) {
26527
+ return {
26528
+ ...platformFailure(created),
26529
+ error: buildMessages.createFailed(buildId, created.error)
26530
+ };
26531
+ }
26532
+ const { build } = created.value;
26533
+ ctx.ui.output(build, buildMessages.uploaded(build));
26534
+ return;
26535
+ }
26536
+
26537
+ // src/shell/platform/putSignedUrl.ts
26538
+ import { constants, openAsBlob } from "node:fs";
26539
+ import { access } from "node:fs/promises";
26540
+ var defaultUploadTimeoutMs = 30 * 60 * 1000;
26541
+ async function openFileAsBlob(fs, path) {
26542
+ try {
26543
+ const stats = await fs.stat(path);
26544
+ if (!stats.isFile())
26545
+ return;
26546
+ await access(path, constants.R_OK);
26547
+ return await openAsBlob(path);
26548
+ } catch {
26549
+ return;
26550
+ }
26551
+ }
26552
+ async function putSignedUrl(args, deps = { fetch: globalThis.fetch }) {
26553
+ const timeoutMs = deps.timeoutMs ?? defaultUploadTimeoutMs;
26554
+ let response;
26555
+ try {
26556
+ response = await deps.fetch(args.url, {
26557
+ body: args.body,
26558
+ headers: args.headers,
26559
+ method: "PUT",
26560
+ signal: AbortSignal.timeout(timeoutMs)
26561
+ });
26562
+ } catch (error) {
26563
+ if (isTimeoutError(error)) {
26564
+ return { ok: false, error: { kind: "timeout", timeoutMs } };
26565
+ }
26566
+ return { ok: false, error: { cause: toError(error), kind: "network" } };
26567
+ }
26568
+ if (!response.ok) {
26569
+ const body = await response.text().catch(() => "");
26570
+ return {
26571
+ ok: false,
26572
+ error: { body, kind: "http", status: response.status }
26573
+ };
26574
+ }
26575
+ return { ok: true, data: undefined };
26576
+ }
26577
+
26578
+ // src/commands/build/upload.register.ts
26579
+ var uploadExamples = `
26580
+ Examples:
26581
+ $ qawolf build upload app-release.apk
26582
+ $ qawolf build upload App.ipa --environment-id <id>
26583
+ $ qawolf build upload app-release.aab --environment-name pr-42 --environment-ephemeral --environment-base-ephemeral-environment staging --branch feat/login --commit-sha 1a2b3c4
26584
+
26585
+ Without an environment flag, the build belongs to no environment: only a run
26586
+ created with it installs it.`;
26587
+ var toUploadOptions = (filePath, opts) => ({
26588
+ branch: opts.branch,
26589
+ commitSha: opts.commitSha,
26590
+ environmentBaseEphemeralEnvironment: opts.environmentBaseEphemeralEnvironment,
26591
+ environmentEphemeral: opts.environmentEphemeral,
26592
+ environmentId: opts.environmentId,
26593
+ environmentName: opts.environmentName,
26594
+ filePath,
26595
+ workspaceId: opts.workspaceId
26596
+ });
26597
+ function registerBuildUploadCommand(build, signals) {
26598
+ declareCommandKind(build.command("upload <file>"), "write").description("Upload an app file (.apk, .aab or .ipa, up to 500 MB) and create a build from it. Runs build requestUpload, the PUT and build create in one step").option("--environment-id <id>", "Put the build on this existing environment: its runs install it from now on, until a newer build of the same app and platform arrives").option("--environment-name <name>", "Put the build on the environment with this alias or name, and create the environment when none matches").option("--environment-ephemeral", "With --environment-name, create an ephemeral environment when the name creates one, such as a pull request's").option("--environment-base-ephemeral-environment <name>", "With --environment-ephemeral, the alias or name of the environment a created ephemeral environment copies from").option("--branch <branch>", "The branch the build came from").option("--commit-sha <sha>", "The commit the build came from").option("--workspace-id <id>", "The workspace to upload into. Required when authenticating with an organization or user API key").addHelpText("after", uploadExamples).action((filePath, opts, command) => withAuthContext(signals, (ctx) => handleBuildUpload(ctx, toUploadOptions(filePath, opts), {
26599
+ openFile: (path) => openFileAsBlob(ctx.fs, path),
26600
+ putFile: (args) => putSignedUrl(args)
26601
+ }))(opts, command));
26602
+ }
26603
+
26604
+ // src/commands/build/index.ts
26605
+ function registerBuildCommand(program, signals) {
26606
+ const build = program.command("build").description("Upload app builds and manage the builds runs install");
26607
+ registerBuildUploadCommand(build, signals);
26608
+ }
26609
+
26144
26610
  // node_modules/@qawolf/flow-targets/dist/presets/android/androidPixel2Android14.js
26145
26611
  var androidPixel2Android14Target = {
26146
26612
  meta: {
@@ -28209,7 +28675,7 @@ import { fileURLToPath } from "url";
28209
28675
 
28210
28676
  // node_modules/fdir/dist/index.mjs
28211
28677
  import { createRequire as createRequire2 } from "module";
28212
- import { basename, dirname as dirname5, normalize as normalize2, relative as relative2, resolve, sep as sep3 } from "path";
28678
+ import { basename as basename2, dirname as dirname5, normalize as normalize2, relative as relative2, resolve, sep as sep3 } from "path";
28213
28679
  import * as nativeFs from "fs";
28214
28680
  var __require2 = /* @__PURE__ */ createRequire2(import.meta.url);
28215
28681
  function cleanPath(path) {
@@ -28576,7 +29042,7 @@ var Walker = class {
28576
29042
  this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path + pathSeparator, depth - 1, this.walk);
28577
29043
  } else {
28578
29044
  resolvedPath = useRealPaths ? resolvedPath : path;
28579
- const filename = basename(resolvedPath);
29045
+ const filename = basename2(resolvedPath);
28580
29046
  const directoryPath$1 = normalizePath(dirname5(resolvedPath), this.state.options);
28581
29047
  resolvedPath = this.joinPath(filename, directoryPath$1);
28582
29048
  this.pushFile(resolvedPath, files, this.state.counts, filters);
@@ -29029,7 +29495,7 @@ async function glob(globInput, options) {
29029
29495
  }
29030
29496
 
29031
29497
  // src/core/flowMeta.ts
29032
- import { basename as basename2 } from "node:path";
29498
+ import { basename as basename3 } from "node:path";
29033
29499
 
29034
29500
  // src/core/stringLiteral.ts
29035
29501
  var lineTerminator = /[\n\r\u2028\u2029]/;
@@ -29134,7 +29600,7 @@ function parseFlowCall(source) {
29134
29600
 
29135
29601
  // src/core/flowMeta.ts
29136
29602
  function flowBasename(file) {
29137
- return basename2(file).replace(/\.flow\.(ts|js)$/, "");
29603
+ return basename3(file).replace(/\.flow\.(ts|js)$/, "");
29138
29604
  }
29139
29605
  var browserNameToPlaywright = {
29140
29606
  chrome: "chromium",
@@ -29810,13 +30276,13 @@ function matchesSelectors(flow, selectors) {
29810
30276
  }
29811
30277
 
29812
30278
  // src/core/repoRelativePath.ts
29813
- import { basename as basename3, dirname as dirname6, relative as relative3 } from "node:path";
30279
+ import { basename as basename4, dirname as dirname6, relative as relative3 } from "node:path";
29814
30280
  var toPosix = (path) => path.replaceAll("\\", "/");
29815
30281
  function findPulledEnvDir(flowAbsPath) {
29816
30282
  let current = dirname6(flowAbsPath);
29817
30283
  while (current !== dirname6(current)) {
29818
30284
  const parent = dirname6(current);
29819
- if (basename3(parent) === ".qawolf")
30285
+ if (basename4(parent) === ".qawolf")
29820
30286
  return current;
29821
30287
  current = parent;
29822
30288
  }
@@ -30079,12 +30545,12 @@ async function readCachedTags(files, fs = makeDefaultFs()) {
30079
30545
  }
30080
30546
 
30081
30547
  // src/domains/flows/readEnvLabel.ts
30082
- import { basename as basename4 } from "node:path";
30548
+ import { basename as basename5 } from "node:path";
30083
30549
  async function readEnvLabel(envDir, fs = makeDefaultFs()) {
30084
30550
  const manifest = await readManifest(envDir, fs);
30085
30551
  if (typeof manifest === "string")
30086
- return basename4(envDir);
30087
- return manifest.envSlug ?? manifest.envName ?? basename4(envDir);
30552
+ return basename5(envDir);
30553
+ return manifest.envSlug ?? manifest.envName ?? basename5(envDir);
30088
30554
  }
30089
30555
 
30090
30556
  // src/domains/flows/listDefaults.ts
@@ -35349,16 +35815,16 @@ async function listStagedSourceFiles(options) {
35349
35815
 
35350
35816
  // src/domains/runtimeEnv/stageFlowFiles.ts
35351
35817
  import { createHash as createHash3 } from "node:crypto";
35352
- import { basename as basename6, dirname as dirname12, join as join40, sep as sep4 } from "node:path";
35818
+ import { basename as basename7, dirname as dirname12, join as join40, sep as sep4 } from "node:path";
35353
35819
 
35354
35820
  // src/shell/copyDir.ts
35355
35821
  import { cp, readdir as readdir2 } from "node:fs/promises";
35356
- import { basename as basename5, join as join39 } from "node:path";
35822
+ import { basename as basename6, join as join39 } from "node:path";
35357
35823
  async function copyDirExcluding(source, destination, excludedNames) {
35358
35824
  const entries = await readdir2(source, { withFileTypes: true });
35359
35825
  await Promise.all(entries.filter((entry) => !excludedNames.has(entry.name)).map((entry) => cp(join39(source, entry.name), join39(destination, entry.name), {
35360
35826
  recursive: true,
35361
- filter: (path) => !excludedNames.has(basename5(path))
35827
+ filter: (path) => !excludedNames.has(basename6(path))
35362
35828
  })));
35363
35829
  }
35364
35830
 
@@ -35373,14 +35839,14 @@ async function stageFlowFiles(args) {
35373
35839
  if (files.length > 1) {
35374
35840
  return Promise.all(files.map((f) => stageOneFile(f, execDir, fs)));
35375
35841
  }
35376
- await Promise.all(files.map((f) => fs.copyFile(f, join40(execDir, basename6(f)))));
35377
- return files.map((f) => join40(execDir, basename6(f)));
35842
+ await Promise.all(files.map((f) => fs.copyFile(f, join40(execDir, basename7(f)))));
35843
+ return files.map((f) => join40(execDir, basename7(f)));
35378
35844
  }
35379
35845
  async function stageOneFile(file, execDir, fs) {
35380
35846
  const dirHash = createHash3("sha256").update(dirname12(file)).digest("hex").slice(0, 8);
35381
35847
  const subDir = join40(execDir, dirHash);
35382
35848
  await fs.mkdir(subDir, { recursive: true });
35383
- const dest = join40(subDir, basename6(file));
35849
+ const dest = join40(subDir, basename7(file));
35384
35850
  await fs.copyFile(file, dest);
35385
35851
  return dest;
35386
35852
  }
@@ -36933,14 +37399,14 @@ async function runWebFlow({
36933
37399
 
36934
37400
  // src/shell/embeddedWorkerCli.ts
36935
37401
  import { existsSync as existsSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "node:fs";
36936
- import { basename as basename7, join as join44 } from "node:path";
37402
+ import { basename as basename8, join as join44 } from "node:path";
36937
37403
  var embeddedCliPathEnv = "QAWOLF_EMBEDDED_CLI_PATH";
36938
37404
  function extractEmbeddedWorkerCli() {
36939
37405
  const assetPath = process.env[embeddedCliPathEnv];
36940
37406
  if (assetPath === undefined || assetPath === "")
36941
37407
  return;
36942
37408
  const dir = join44(getDataDir(), "worker");
36943
- const dest = join44(dir, basename7(assetPath));
37409
+ const dest = join44(dir, basename8(assetPath));
36944
37410
  if (existsSync3(dest))
36945
37411
  return dest;
36946
37412
  mkdirSync3(dir, { recursive: true });
@@ -38347,7 +38813,7 @@ Examples:
38347
38813
  }
38348
38814
 
38349
38815
  // src/domains/investigation/handle.ts
38350
- import { basename as basename8 } from "node:path";
38816
+ import { basename as basename9 } from "node:path";
38351
38817
 
38352
38818
  // src/domains/investigation/download.ts
38353
38819
  var traceLimit = 75 * 1024 * 1024;
@@ -38665,7 +39131,7 @@ async function outputInvestigationInspection(ctx, options, parsed) {
38665
39131
  };
38666
39132
  const output = { ...result, outputFile: options.outputFile };
38667
39133
  ctx.ui.output(output, `${renderText(result)}
38668
- Saved ${binary.extension}: ${basename8(options.outputFile)}`);
39134
+ Saved ${binary.extension}: ${basename9(options.outputFile)}`);
38669
39135
  return;
38670
39136
  }
38671
39137
  if (binary?.extension === "html") {
@@ -41754,6 +42220,17 @@ function buildRunSelection(options) {
41754
42220
  return { ok: true, selection: parsed.data };
41755
42221
  }
41756
42222
 
42223
+ // src/core/interactiveRunner/runBuilds.ts
42224
+ function parseRunBuilds(values) {
42225
+ if (values.length === 0)
42226
+ return { builds: undefined, ok: true };
42227
+ const checked = publicContractsV1.runner.runFlow.input.shape.builds.safeParse(values);
42228
+ if (!checked.success) {
42229
+ return { error: prettifyError(checked.error), ok: false };
42230
+ }
42231
+ return { builds: checked.data, ok: true };
42232
+ }
42233
+
41757
42234
  // src/core/interactiveRunner/runEnvironment.ts
41758
42235
  function buildRunEnvironment(content) {
41759
42236
  let parsed;
@@ -41829,6 +42306,9 @@ async function prepareRun(options, deps) {
41829
42306
  const fromVars = parseRunVariables(options.vars);
41830
42307
  if (!fromVars.ok)
41831
42308
  return refused(fromVars.error, exitCodes.invalidArgs);
42309
+ const builds = parseRunBuilds(options.builds);
42310
+ if (!builds.ok)
42311
+ return refused(builds.error, exitCodes.invalidArgs);
41832
42312
  const fromEnvVar = deps.env["QAWOLF_ENVIRONMENT"]?.trim();
41833
42313
  const environmentId = explicitEnvId ?? (options.envFile === undefined && fromEnvVar ? fromEnvVar : undefined);
41834
42314
  const linesFilePath = options.linesFile === undefined ? undefined : toCollectedPath(deps.cwd, options.linesFile);
@@ -41852,28 +42332,22 @@ async function prepareRun(options, deps) {
41852
42332
  if (combined !== undefined && !combined.ok) {
41853
42333
  return refused(combined.error, exitCodes.invalidArgs);
41854
42334
  }
41855
- const given = combined?.environment;
42335
+ const ready = {
42336
+ builds: builds.builds,
42337
+ environment: combined?.environment,
42338
+ environmentId,
42339
+ files,
42340
+ ok: true
42341
+ };
41856
42342
  if (options.lines === undefined) {
41857
- return options.linesFile === undefined ? {
41858
- environment: given,
41859
- environmentId,
41860
- files,
41861
- ok: true,
41862
- selection: undefined
41863
- } : refused(interactiveRunnerMessages.linesFileWithoutLines, exitCodes.invalidArgs);
42343
+ return options.linesFile === undefined ? { ...ready, selection: undefined } : refused(interactiveRunnerMessages.linesFileWithoutLines, exitCodes.invalidArgs);
41864
42344
  }
41865
42345
  const path = linesFilePath ?? options.entryPointPath;
41866
42346
  if (!Object.hasOwn(files, path)) {
41867
42347
  return refused(interactiveRunnerMessages.fileNotCollected(path), exitCodes.invalidArgs);
41868
42348
  }
41869
42349
  const built = buildRunSelection({ lines: options.lines, path });
41870
- return built.ok ? {
41871
- environment: given,
41872
- environmentId,
41873
- files,
41874
- ok: true,
41875
- selection: built.selection
41876
- } : refused(built.error, exitCodes.invalidArgs);
42350
+ return built.ok ? { ...ready, selection: built.selection } : refused(built.error, exitCodes.invalidArgs);
41877
42351
  }
41878
42352
  async function readEnvironment(envFile, deps) {
41879
42353
  if (envFile === undefined)
@@ -41950,6 +42424,7 @@ function describeRunSubmitFailure(failure) {
41950
42424
  // src/domains/interactiveRunner/sendRunFlowRequest.ts
41951
42425
  async function sendRunFlowRequest(ctx, options, delta) {
41952
42426
  const result = await ctx.platformClient.callPublicApi(publicContractsV1.runner.runFlow, {
42427
+ ...options.builds === undefined ? {} : { builds: options.builds },
41953
42428
  entryPointPath: options.entryPointPath,
41954
42429
  files: delta.files,
41955
42430
  id: options.resolved.runnerId,
@@ -42043,6 +42518,7 @@ async function handleRunnerRun(ctx, options, deps) {
42043
42518
  }
42044
42519
  const entryPointPath = toCollectedPath(deps.cwd, options.entryPoint);
42045
42520
  const prepared = await prepareRun({
42521
+ builds: options.builds,
42046
42522
  entryPointPath,
42047
42523
  envFile: options.envFile,
42048
42524
  envId: options.envId,
@@ -42069,6 +42545,7 @@ async function handleRunnerRun(ctx, options, deps) {
42069
42545
  recorderSinceSequence = anchor.sinceSequence;
42070
42546
  }
42071
42547
  const submitted = await submitRun(ctx, {
42548
+ builds: prepared.builds,
42072
42549
  entryPointPath,
42073
42550
  environment: prepared.environment,
42074
42551
  environmentId: prepared.environmentId,
@@ -42112,9 +42589,11 @@ Examples:
42112
42589
  $ qawolf runner run flows/checkout.flow.ts --lines 12-40
42113
42590
  $ qawolf runner run flows/checkout.flow.ts --lines 4-9 --lines-file pages/login.ts
42114
42591
  $ qawolf runner run flows/checkout.flow.ts --env-id staging
42115
- $ qawolf runner run flows/checkout.flow.ts --env-var RUN_INPUT_PATH=uploads/app.apk`;
42592
+ $ qawolf runner run flows/checkout.flow.ts --env-var RUN_INPUT_PATH=uploads/app.apk
42593
+ $ qawolf runner run flows/checkout.flow.ts --builds <buildId> <buildId>`;
42116
42594
  function registerRunCommand(runner, signals) {
42117
- declareCommandKind(runner.command("run <flowFile>"), "write").description("Run a flow on an interactive runner, shipping the flow and what it imports").option("--follow", "Report the run's status until it settles: in progress, then passed or failed", false).option("--logs", "Stream every log line the run produces while following. Implies --follow", false).option("--run-events", "Stream the run's progress events as JSON lines while following. Implies --follow", false).option("--recorder-events", "Stream the browser actions the runner records as JSON lines while following, from an anchor taken just before submission: the recorder is runner-wide, not run-scoped. Implies --follow", false).option("--env-id <env>", "QA Wolf environment whose variables the run is given, by id or alias. Defaults to QAWOLF_ENVIRONMENT unless --env-file is passed. QA Wolf reads and decrypts them itself, so they never leave the server and no size limit applies to them").option("--env-file <path>", "Dotenv file on this machine whose variables the run is given. With --env-id, they go on top of that environment's").option("--var, --env-var <name=value>", "One variable for this run only, on top of the environment and --env-file; repeat for several", collectValue, []).option("--lines <start-end>", "Run only these 1-indexed lines against the browser as it stands, instead of the whole flow from a fresh one").option("--lines-file <path>", "File the --lines range lives in. Defaults to <flowFile>; pass it only when the lines are in another file, such as a page object").option("--runner <id>", runnerFlagDescription).option("--timeout <seconds>", "Give up following after this long. Following keeps the runner alive, so a run that never settles would otherwise bill until the terminal closed", String(defaultFollowTimeoutSeconds)).addHelpText("after", runExamples2).addHelpText("after", runnerGuides.run).action((flowFile, opts, command) => withRunnerContext(signals, (ctx) => handleRunnerRun(ctx, {
42595
+ declareCommandKind(runner.command("run <flowFile>"), "write").description("Run a flow on an interactive runner, shipping the flow and what it imports").option("--follow", "Report the run's status until it settles: in progress, then passed or failed", false).option("--logs", "Stream every log line the run produces while following. Implies --follow", false).option("--run-events", "Stream the run's progress events as JSON lines while following. Implies --follow", false).option("--recorder-events", "Stream the browser actions the runner records as JSON lines while following, from an anchor taken just before submission: the recorder is runner-wide, not run-scoped. Implies --follow", false).option("--env-id <env>", "QA Wolf environment whose variables the run is given, by id or alias. Defaults to QAWOLF_ENVIRONMENT unless --env-file is passed. QA Wolf reads and decrypts them itself, so they never leave the server and no size limit applies to them").option("--env-file <path>", "Dotenv file on this machine whose variables the run is given. With --env-id, they go on top of that environment's").option("--var, --env-var <name=value>", "One variable for this run only, on top of the environment and --env-file; repeat for several", collectValue, []).option("--builds <ids...>", "Builds to install in this run, from build.create, one per app and platform. Each replaces the environment's latest build of its app and platform. Put the flow file before this flag", []).option("--lines <start-end>", "Run only these 1-indexed lines against the browser as it stands, instead of the whole flow from a fresh one").option("--lines-file <path>", "File the --lines range lives in. Defaults to <flowFile>; pass it only when the lines are in another file, such as a page object").option("--runner <id>", runnerFlagDescription).option("--timeout <seconds>", "Give up following after this long. Following keeps the runner alive, so a run that never settles would otherwise bill until the terminal closed", String(defaultFollowTimeoutSeconds)).addHelpText("after", runExamples2).addHelpText("after", runnerGuides.run).action((flowFile, opts, command) => withRunnerContext(signals, (ctx) => handleRunnerRun(ctx, {
42596
+ builds: opts.builds,
42118
42597
  entryPoint: flowFile,
42119
42598
  envFile: opts.envFile,
42120
42599
  envId: opts.envId,
@@ -42357,6 +42836,7 @@ function createProgram({
42357
42836
  });
42358
42837
  registerAgentCommand(program, signals);
42359
42838
  registerAuthCommand(program, signals);
42839
+ registerBuildCommand(program, signals);
42360
42840
  registerDoctorCommand(program, signals);
42361
42841
  registerFlowsCommand(program, signals);
42362
42842
  registerInitCommand(program, signals);
@@ -42378,4 +42858,4 @@ createProgram({ signals }).parseAsync().catch(() => {
42378
42858
  process.exitCode = 1;
42379
42859
  }).finally(() => exitWhenIdle(typeof process.exitCode === "number" ? process.exitCode : 0));
42380
42860
 
42381
- //# debugId=5F33B8D66BC6D61964756E2164756E21
42861
+ //# debugId=EBF23B37C763425B64756E2164756E21