@qawolf/cli 1.41.0 → 1.42.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.
@@ -6952,6 +6952,146 @@ function date4(params) {
6952
6952
 
6953
6953
  // node_modules/zod/v4/classic/external.js
6954
6954
  config(en_default());
6955
+ // node_modules/@qawolf/api-contracts/dist/v1/pagination.js
6956
+ var makePaginationInputFields = (limits) => ({
6957
+ cursor: string2().min(1).optional().describe("Opaque cursor copied from the previous response's nextCursor. Omit to fetch the first page."),
6958
+ limit: number2().int().min(1).max(limits.maxLimit).default(limits.defaultLimit).describe(`Maximum rows per page. Defaults to ${limits.defaultLimit}, capped at ${limits.maxLimit}.`)
6959
+ });
6960
+ var nextCursorSchema = string2().min(1).optional().describe("Repeat the request with this value as cursor to fetch the next page. Absent when there are no further results.");
6961
+
6962
+ // node_modules/@qawolf/api-contracts/dist/v1/resource.js
6963
+ function resource(fields, { urlFieldDescription = "Absolute URL." } = {}) {
6964
+ return object({
6965
+ ...fields,
6966
+ url: url().describe(urlFieldDescription)
6967
+ });
6968
+ }
6969
+
6970
+ // node_modules/@qawolf/api-contracts/dist/v1/promotion/resource.js
6971
+ var promotionStatusSchema = _enum([
6972
+ "pending",
6973
+ "conflicted",
6974
+ "resolving",
6975
+ "promoted",
6976
+ "no-changes",
6977
+ "abandoned"
6978
+ ]).describe("pending (requested, the merge has not run yet), conflicted (the head's flow changes clash with the base and await a resolution), resolving (a submitted resolution is being applied), promoted (merged into the base and the head environment terminated), no-changes (the head had nothing to promote and was terminated), abandoned (the head environment was terminated before the promotion settled).");
6979
+ var conflictSchema = object({
6980
+ paths: array(string2()).describe("Every path that conflicts between the head and the base. A resolution must cover exactly these paths."),
6981
+ sourceCommitHash: string2().describe("The head environment's flow code commit the conflict was computed against."),
6982
+ targetCommitHash: string2().describe("The base environment's flow code commit the conflict was computed against.")
6983
+ });
6984
+ var makePromotionResourceSchema = (ids) => resource({
6985
+ aiTaskId: ids.aiTask.optional().describe("The AI task dispatched to resolve this promotion's conflicts. Absent until the agent is dispatched. A promotion that stays conflicted after this is set means the agent could not resolve it."),
6986
+ baseEnvironmentId: ids.environment.describe("The environment the flow changes promote into."),
6987
+ conflict: conflictSchema.optional().describe("The conflict awaiting resolution. Present while status is conflicted or resolving. A resolution must name both commit hashes and cover exactly these paths; if either branch moves, the conflict is recomputed and this changes."),
6988
+ createdAt: exports_iso.datetime().describe("When the promotion was requested."),
6989
+ headEnvironmentId: ids.environment.describe("The environment whose flow changes are promoted."),
6990
+ id: ids.promotion,
6991
+ promotedCommitHash: string2().optional().describe("The commit the promotion landed on the base environment's flow code branch. Present when status is promoted."),
6992
+ settledAt: exports_iso.datetime().optional().describe("When the promotion reached promoted, no-changes or abandoned. Absent while it is open."),
6993
+ status: promotionStatusSchema
6994
+ }, { urlFieldDescription: "Absolute URL of the head environment's page." });
6995
+
6996
+ // node_modules/@qawolf/api-contracts/dist/v1/promotion/find.js
6997
+ var makeFindPromotionsContract = (ids) => {
6998
+ const input = object({
6999
+ environmentId: ids.environmentRef.optional().describe("Only list promotions out of this head environment, by id or alias. Omit to list the whole workspace's promotions."),
7000
+ status: promotionStatusSchema.optional().describe("Only list promotions in this status. Use conflicted to see the promotions that need attention."),
7001
+ workspaceId: ids.workspace.optional().describe("The workspace to list promotions from, which an environment alias resolves in. Required when authenticating with an organization or user API key."),
7002
+ ...makePaginationInputFields({ defaultLimit: 20, maxLimit: 100 })
7003
+ });
7004
+ const output = object({
7005
+ nextCursor: nextCursorSchema,
7006
+ promotions: array(makePromotionResourceSchema(ids)).describe("The workspace's promotions, newest first.")
7007
+ });
7008
+ return {
7009
+ annotationJustifications: {
7010
+ destructiveHint: "Does not change promotions, environments or flow code branches.",
7011
+ openWorldHint: "Reads private QA Wolf promotion records without changing external systems.",
7012
+ readOnlyHint: "Lists promotions in the authorized workspace without changing them."
7013
+ },
7014
+ annotations: {
7015
+ destructiveHint: false,
7016
+ openWorldHint: false,
7017
+ readOnlyHint: true
7018
+ },
7019
+ description: "List environment promotions, newest first. A promotion moves the flow changes made in a head environment into its base environment. Filter by status conflicted to find the promotions whose conflicts still need a resolution.",
7020
+ input,
7021
+ kind: "read",
7022
+ name: "promotion.find",
7023
+ output
7024
+ };
7025
+ };
7026
+
7027
+ // node_modules/@qawolf/api-contracts/dist/v1/promotion/get.js
7028
+ var makeGetPromotionContract = (ids) => {
7029
+ const input = object({ promotionId: ids.promotion });
7030
+ const output = makePromotionResourceSchema(ids);
7031
+ return {
7032
+ annotationJustifications: {
7033
+ destructiveHint: "Does not change the promotion, its environments or flow code branches.",
7034
+ openWorldHint: "Reads a private QA Wolf promotion record without changing external systems.",
7035
+ readOnlyHint: "Retrieves one authorized promotion's status and conflict without changing it."
7036
+ },
7037
+ annotations: {
7038
+ destructiveHint: false,
7039
+ openWorldHint: false,
7040
+ readOnlyHint: true
7041
+ },
7042
+ description: "Read one environment promotion: its status, the conflicting paths and commit hashes while it is conflicted or resolving, the commit it landed when promoted, and the AI task resolving it. Poll it after environment.promote to learn how the promotion settled. It does not serve file contents; a resolver reads both branches from the flow code repository.",
7043
+ input,
7044
+ kind: "read",
7045
+ name: "promotion.get",
7046
+ output
7047
+ };
7048
+ };
7049
+
7050
+ // node_modules/@qawolf/api-contracts/dist/v1/promotion/resolve.js
7051
+ var maxResolvedFileBytes = 1e6;
7052
+ var utf8ByteLength = (content) => new TextEncoder().encode(content).byteLength;
7053
+ var keptFileSizeIssues = (writes) => Object.entries(writes).map(([path, content]) => ({ bytes: utf8ByteLength(content), path })).filter(({ bytes }) => bytes >= maxResolvedFileBytes).map(({ bytes, path }) => ({
7054
+ code: "custom",
7055
+ message: `Each kept file must be under ${maxResolvedFileBytes} bytes of UTF-8; ${path} is ${bytes} bytes.`,
7056
+ path: [path]
7057
+ }));
7058
+ var makeResolvePromotionContract = (ids) => {
7059
+ const input = object({
7060
+ deletes: array(string2().min(1)).optional().describe("Conflicting paths to remove from the base environment. Repeat the flag once per path."),
7061
+ expectedSourceCommitHash: string2().min(1).describe("The head environment's commit the conflict was computed against: conflict.sourceCommitHash from promotion.get. A different current commit means the branch moved and the call is refused."),
7062
+ expectedTargetCommitHash: string2().min(1).describe("The base environment's commit the conflict was computed against: conflict.targetCommitHash from promotion.get. A different current commit means the branch moved and the call is refused."),
7063
+ promotionId: ids.promotion,
7064
+ writes: record(string2().min(1), string2()).superRefine((writes, refinement) => {
7065
+ keptFileSizeIssues(writes).forEach((issue) => refinement.addIssue(issue));
7066
+ }).optional().describe("The resolved full contents of each conflicting path to keep, keyed by path. Repeat the flag once per path as PATH=CONTENT. Each file must be under 1 MB of UTF-8.")
7067
+ });
7068
+ const output = makePromotionResourceSchema(ids);
7069
+ return {
7070
+ annotationJustifications: {
7071
+ destructiveHint: "Lands the resolved files on the base environment's flow code branch and terminates the head environment once they land.",
7072
+ openWorldHint: "Changes QA Wolf flow code branches only, not the customer's own repository or deployments.",
7073
+ readOnlyHint: "Records a resolution that a background executor applies to the base branch."
7074
+ },
7075
+ annotations: {
7076
+ destructiveHint: true,
7077
+ openWorldHint: false,
7078
+ readOnlyHint: false
7079
+ },
7080
+ description: "Submit the resolution of a conflicted promotion: the full resolved contents of every conflicting path to keep, and every conflicting path to delete. Together they must cover exactly the paths in the promotion's conflict, and both commit hashes must match the conflict's; if a branch moved since, the call is refused as stale-conflict and promotion.get has the current conflict. Returns the promotion in resolving; poll promotion.get until it is promoted, or conflicted again if the branches moved while it applied.",
7081
+ input,
7082
+ kind: "write",
7083
+ name: "promotion.resolve",
7084
+ output
7085
+ };
7086
+ };
7087
+
7088
+ // node_modules/@qawolf/api-contracts/dist/v1/promotion/index.js
7089
+ var makePromotionContracts = (ids) => ({
7090
+ find: makeFindPromotionsContract(ids),
7091
+ get: makeGetPromotionContract(ids),
7092
+ resolve: makeResolvePromotionContract(ids)
7093
+ });
7094
+
6955
7095
  // node_modules/@qawolf/api-contracts/dist/v1/agent/status.js
6956
7096
  var agentSessionStatuses = [
6957
7097
  "working",
@@ -7048,14 +7188,6 @@ var didNotRunReasonSchema = _enum([
7048
7188
  ].join(`
7049
7189
  `));
7050
7190
 
7051
- // node_modules/@qawolf/api-contracts/dist/v1/resource.js
7052
- function resource(fields, { urlFieldDescription = "Absolute URL." } = {}) {
7053
- return object({
7054
- ...fields,
7055
- url: url().describe(urlFieldDescription)
7056
- });
7057
- }
7058
-
7059
7191
  // node_modules/@qawolf/api-contracts/dist/v1/email/resource.js
7060
7192
  var emailDirectionSchema = _enum(["inbound", "outbound"]);
7061
7193
  var namedAddressSchema = object({
@@ -7762,9 +7894,9 @@ var readJournalResponseSchema = object({
7762
7894
  var maxRunFilesByteLength = 30 * 1024 * 1024;
7763
7895
  var maxRunnerRequestEncodedByteLength = 30 * 1024 * 1024;
7764
7896
  function runFilesByteLength(files) {
7765
- return Object.entries(files).reduce((total, [path, content]) => total + utf8ByteLength(content) + utf8ByteLength(path), 0);
7897
+ return Object.entries(files).reduce((total, [path, content]) => total + utf8ByteLength2(content) + utf8ByteLength2(path), 0);
7766
7898
  }
7767
- function utf8ByteLength(text) {
7899
+ function utf8ByteLength2(text) {
7768
7900
  return Buffer.byteLength(text, "utf8");
7769
7901
  }
7770
7902
  var runFilesSchema = record(string2(), string2()).superRefine((files, refinementContext) => {
@@ -8182,7 +8314,7 @@ var makeTriggerScheduleFields = (ids) => ({
8182
8314
  var makeTriggerDeploymentFields = (ids) => ({
8183
8315
  action: makeTriggerActionSchema(ids),
8184
8316
  branchPattern: string2().min(1).optional().describe("Only fire for deployments of a branch matching this pattern."),
8185
- deployTargetPattern: string2().min(1).optional().describe("Only fire for deployments whose deploy target matches this pattern. A deploy target is the URL or label the deploy reported, which many deployments do not carry."),
8317
+ deployTargetPattern: string2().min(1).optional().describe("Only fire for deployments whose deploy target matches this pattern. A deploy target is the URL the deploy reported, which many deployments do not carry."),
8186
8318
  environmentIds: array(ids.environment).default([]).describe("Only fire for deployments to these environments. Mutually exclusive with environmentPattern."),
8187
8319
  environmentPattern: string2().min(1).optional().describe("Only fire for deployments to environments matching this pattern. Mutually exclusive with environmentIds."),
8188
8320
  servicePattern: string2().min(1).optional().describe("Only fire for deployments whose service matches this pattern. A deployment that names no service never matches it.")
@@ -8533,7 +8665,7 @@ var makeAgentGetContract = (ids) => {
8533
8665
  const input = object({
8534
8666
  cursor: string2().min(1).optional().describe("Opaque cursor copied from this same session's previous nextCursor. Omit to read from its first reply."),
8535
8667
  sessionId: ids.chatSession.describe("The id agent.send answered with."),
8536
- waitSeconds: number2().int().min(0).optional().describe(`How long the server may hold this check open, in seconds. Omit or pass 0 to answer at once. A larger value clamps to ${maxAgentWaitSeconds}. Check again as soon as a held check returns.`)
8668
+ 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.`)
8537
8669
  });
8538
8670
  const output = resource({
8539
8671
  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."),
@@ -8725,13 +8857,6 @@ var makeFindCodeHostIntegrationsContract = (ids) => {
8725
8857
  };
8726
8858
  };
8727
8859
 
8728
- // node_modules/@qawolf/api-contracts/dist/v1/pagination.js
8729
- var makePaginationInputFields = (limits) => ({
8730
- cursor: string2().min(1).optional().describe("Opaque cursor copied from the previous response's nextCursor. Omit to fetch the first page."),
8731
- limit: number2().int().min(1).max(limits.maxLimit).default(limits.defaultLimit).describe(`Maximum rows per page. Defaults to ${limits.defaultLimit}, capped at ${limits.maxLimit}.`)
8732
- });
8733
- var nextCursorSchema = string2().min(1).optional().describe("Repeat the request with this value as cursor to fetch the next page. Absent when there are no further results.");
8734
-
8735
8860
  // node_modules/@qawolf/api-contracts/dist/v1/codeHostIntegration/listRepositories.js
8736
8861
  var makeListCodeHostRepositoriesContract = (ids) => {
8737
8862
  const input = object({
@@ -8770,11 +8895,12 @@ var makeDeploymentResourceSchema = (ids) => resource({
8770
8895
  commitSha: string2().optional().describe("The sha of the deployed commit."),
8771
8896
  commitUrl: string2().optional().describe("A link to the deployed commit, as declared by the deployment report."),
8772
8897
  deployedAt: exports_iso.datetime().describe("When QA Wolf first received the deployment."),
8773
- deployTarget: string2().optional().describe("Identifies the deployed app within the environment: the URL it serves, or the build path of a mobile build. A trigger's deployTargetPattern matches against it."),
8898
+ deployTarget: string2().optional().describe("The URL the deployment serves. A trigger's deployTargetPattern matches against it."),
8774
8899
  environmentId: ids.environment.describe("The QA Wolf environment the deployment reported into."),
8775
8900
  environmentName: string2().optional().describe("The environment's name. Absent when the environment has since been deleted."),
8776
8901
  id: ids.deployment,
8777
8902
  provider: _enum(["github", "gitlab", "api"]).optional().describe("How QA Wolf received the deployment: a GitHub webhook, a GitLab webhook, or the deployment.reportStatus API."),
8903
+ repository: string2().optional().describe('The repository the deployment came from, as "owner/name". Absent when neither the code host nor the deployment report named one.'),
8778
8904
  service: string2().optional().describe("Which application was deployed, as the deployer named it. Absent when the deployer named none."),
8779
8905
  status: _enum(["pending", "success", "failure", "inactive"]).optional().describe("The deployment's lifecycle status, in the vocabulary deployment.reportStatus accepts. Absent when no status was ever reported.")
8780
8906
  }, {
@@ -8924,7 +9050,7 @@ var makeReportDeploymentStatusContract = (ids) => {
8924
9050
  error: "Send environment as either { id } or { name }, with optional ephemeral and baseEphemeralEnvironment."
8925
9051
  });
8926
9052
  const input = strictObject({
8927
- deployTarget: httpUrl().max(2048).describe("The URL the deployment serves, e.g. a preview URL.").optional(),
9053
+ 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(),
8928
9054
  environment: environment.describe("Selects the environment the deployment reports into.").optional(),
8929
9055
  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(),
8930
9056
  metadata: deploymentReportMetadata.describe("Details the deployer declares about the deployed revision; a code host integration's own record of the same commit is shown in preference to the message and author declared here.").optional(),
@@ -9172,6 +9298,7 @@ var makeSendEmailContract = (ids) => {
9172
9298
  // node_modules/@qawolf/api-contracts/dist/v1/environment/resource.js
9173
9299
  var makeEnvironmentResourceSchema = (ids) => resource({
9174
9300
  alias: string2().optional().describe("The environment's alias: a team-unique slug that team API keys can use in place of the id. Terminated environments have none."),
9301
+ baseEnvironmentId: ids.environment.optional().describe("The environment this one promotes its flow changes into, if it has a base."),
9175
9302
  flowCodeBranch: discriminatedUnion("syncStatus", [
9176
9303
  object({
9177
9304
  lastSyncedCommitHash: string2().describe("Hash of the latest reconciled commit."),
@@ -9185,6 +9312,7 @@ var makeEnvironmentResourceSchema = (ids) => resource({
9185
9312
  ]).optional().describe("The environment's flow code branch and its git reconciliation state, if it has one."),
9186
9313
  id: ids.environment,
9187
9314
  isDefault: boolean2().describe("Whether this is the workspace's default environment."),
9315
+ isDefaultBase: boolean2().describe("Whether this is the workspace's default base environment."),
9188
9316
  kind: _enum(["static", "preview"]).describe("Whether the environment is static or a preview."),
9189
9317
  name: string2(),
9190
9318
  runConcurrencyLimit: string2().describe('Maximum number of concurrent runs: a whole number, "unlimited", or a concurrency expression.'),
@@ -9248,32 +9376,6 @@ var makeDeleteEnvironmentVariableContract = (ids) => {
9248
9376
  };
9249
9377
  };
9250
9378
 
9251
- // node_modules/@qawolf/api-contracts/dist/v1/environment/discard.js
9252
- var makeDiscardEnvironmentContract = (ids) => {
9253
- const input = object({
9254
- environmentId: ids.environmentRef,
9255
- workspaceId: workspaceForEnvironmentRef(ids.workspace)
9256
- });
9257
- const output = makeEnvironmentResourceSchema(ids);
9258
- return {
9259
- annotationJustifications: {
9260
- destructiveHint: "Terminates the environment for good: its runs are canceled and its flow changes are never promoted.",
9261
- openWorldHint: "Changes QA Wolf environments only, not the customer's own repository or deployments.",
9262
- readOnlyHint: "Terminates an environment and returns it terminated."
9263
- },
9264
- annotations: {
9265
- destructiveHint: true,
9266
- openWorldHint: false,
9267
- readOnlyHint: false
9268
- },
9269
- description: "Declare a preview environment's work discarded, typically when its pull request closes without merging: the environment is terminated and its flow changes are not promoted into its base. Returns the environment, now terminated. A terminated environment cannot be discarded again. Use environment.promote instead when the work is accepted.",
9270
- input,
9271
- kind: "write",
9272
- name: "environment.discard",
9273
- output
9274
- };
9275
- };
9276
-
9277
9379
  // node_modules/@qawolf/api-contracts/dist/v1/environment/find.js
9278
9380
  var makeFindEnvironmentsContract = (ids) => {
9279
9381
  const input = object({
@@ -9419,32 +9521,6 @@ var makeSetEnvironmentVariableContract = (ids) => {
9419
9521
  };
9420
9522
  };
9421
9523
 
9422
- // node_modules/@qawolf/api-contracts/dist/v1/promotion/resource.js
9423
- var promotionStatusSchema = _enum([
9424
- "pending",
9425
- "conflicted",
9426
- "resolving",
9427
- "promoted",
9428
- "no-changes",
9429
- "abandoned"
9430
- ]).describe("pending (requested, the merge has not run yet), conflicted (the head's flow changes clash with the base and await a resolution), resolving (a submitted resolution is being applied), promoted (merged into the base and the head environment terminated), no-changes (the head had nothing to promote and was terminated), abandoned (the head environment was discarded or terminated before the promotion settled).");
9431
- var conflictSchema = object({
9432
- paths: array(string2()).describe("Every path that conflicts between the head and the base. A resolution must cover exactly these paths."),
9433
- sourceCommitHash: string2().describe("The head environment's flow code commit the conflict was computed against."),
9434
- targetCommitHash: string2().describe("The base environment's flow code commit the conflict was computed against.")
9435
- });
9436
- var makePromotionResourceSchema = (ids) => resource({
9437
- aiTaskId: ids.aiTask.optional().describe("The AI task dispatched to resolve this promotion's conflicts. Absent until the agent is dispatched. A promotion that stays conflicted after this is set means the agent could not resolve it."),
9438
- baseEnvironmentId: ids.environment.describe("The environment the flow changes promote into."),
9439
- conflict: conflictSchema.optional().describe("The conflict awaiting resolution. Present while status is conflicted or resolving. A resolution must name both commit hashes and cover exactly these paths; if either branch moves, the conflict is recomputed and this changes."),
9440
- createdAt: exports_iso.datetime().describe("When the promotion was requested."),
9441
- headEnvironmentId: ids.environment.describe("The environment whose flow changes are promoted."),
9442
- id: ids.promotion,
9443
- promotedCommitHash: string2().optional().describe("The commit the promotion landed on the base environment's flow code branch. Present when status is promoted."),
9444
- settledAt: exports_iso.datetime().optional().describe("When the promotion reached promoted, no-changes or abandoned. Absent while it is open."),
9445
- status: promotionStatusSchema
9446
- }, { urlFieldDescription: "Absolute URL of the head environment's page." });
9447
-
9448
9524
  // node_modules/@qawolf/api-contracts/dist/v1/environment/promote.js
9449
9525
  var makePromoteEnvironmentContract = (ids) => {
9450
9526
  const input = object({
@@ -9463,7 +9539,7 @@ var makePromoteEnvironmentContract = (ids) => {
9463
9539
  openWorldHint: false,
9464
9540
  readOnlyHint: false
9465
9541
  },
9466
- description: "Declare a preview environment's work accepted, typically when its pull request merges: its flow changes are promoted into its base environment and the environment is terminated once they land. Returns the promotion in pending; poll promotion.get to learn how it settled. Calling again while a promotion is open returns that promotion. A conflict settles the promotion conflicted and cancels the environment's in-progress runs; promotion.get names the conflicting paths. Use environment.discard instead when the work is abandoned.",
9542
+ description: "Declare a preview environment's work accepted, typically when its pull request merges: its flow changes are promoted into its base environment and the environment is terminated once they land. Returns the promotion in pending; poll promotion.get to learn how it settled. Calling again while a promotion is open returns that promotion. A conflict settles the promotion conflicted and cancels the environment's in-progress runs; promotion.get names the conflicting paths. Use environment.terminate instead when the work is abandoned.",
9467
9543
  input,
9468
9544
  kind: "write",
9469
9545
  name: "environment.promote",
@@ -9471,6 +9547,32 @@ var makePromoteEnvironmentContract = (ids) => {
9471
9547
  };
9472
9548
  };
9473
9549
 
9550
+ // node_modules/@qawolf/api-contracts/dist/v1/environment/terminate.js
9551
+ var makeTerminateEnvironmentContract = (ids) => {
9552
+ const input = object({
9553
+ environmentId: ids.environmentRef,
9554
+ workspaceId: workspaceForEnvironmentRef(ids.workspace)
9555
+ });
9556
+ const output = makeEnvironmentResourceSchema(ids);
9557
+ return {
9558
+ annotationJustifications: {
9559
+ destructiveHint: "Terminates the environment for good: its runs are canceled and its flow changes are never promoted.",
9560
+ openWorldHint: "Changes QA Wolf environments only, not the customer's own repository or deployments.",
9561
+ readOnlyHint: "Terminates an environment and returns it terminated."
9562
+ },
9563
+ annotations: {
9564
+ destructiveHint: true,
9565
+ openWorldHint: false,
9566
+ readOnlyHint: false
9567
+ },
9568
+ description: "Terminate a preview environment, typically when its pull request closes without merging: its flow changes are not promoted into its base. Returns the environment, now terminated. A terminated environment cannot be terminated again. Use environment.promote instead when the work is accepted.",
9569
+ input,
9570
+ kind: "write",
9571
+ name: "environment.terminate",
9572
+ output
9573
+ };
9574
+ };
9575
+
9474
9576
  // node_modules/@qawolf/api-contracts/dist/v1/environment/update.js
9475
9577
  var makeUpdateEnvironmentContract = (ids) => {
9476
9578
  const nameSchema = string2().trim().min(1).max(255).describe("New display name. Must be unique within the team.");
@@ -9573,6 +9675,52 @@ var makeAddTagToFlowsContract = (ids) => {
9573
9675
  };
9574
9676
  };
9575
9677
 
9678
+ // node_modules/@qawolf/api-contracts/dist/v1/flow/getHistory.js
9679
+ var makeGetFlowHistoryContract = (ids) => {
9680
+ const input = object({
9681
+ createdAfter: exports_iso.datetime({ offset: true }).optional().describe("Only include results of runs created strictly after this instant."),
9682
+ createdBefore: exports_iso.datetime({ offset: true }).optional().describe("Only include results of runs created strictly before this instant."),
9683
+ ...makePaginationInputFields({ defaultLimit: 20, maxLimit: 100 }),
9684
+ environmentId: ids.environmentRef,
9685
+ flowId: ids.flow.describe("The flow whose results to list. It must belong to the environment's workspace."),
9686
+ workspaceId: workspaceForEnvironmentRef(ids.workspace)
9687
+ });
9688
+ const result = resource({
9689
+ attemptCount: number2().int().nonnegative().describe("How many automated attempts the flow made in this run."),
9690
+ completedAt: exports_iso.datetime().optional().describe("When the flow finished. Absent until it does."),
9691
+ createdAt: exports_iso.datetime(),
9692
+ diagnosis: object({
9693
+ issueId: ids.issue,
9694
+ type: _enum(["bug", "maintenance"])
9695
+ }).optional().describe("QA Wolf's investigation verdict for a failed result: `bug` means the application is broken, `maintenance` means the test needed an update. Absent until the investigation reaches a verdict, and for results that did not fail."),
9696
+ durationMs: number2().int().nonnegative().optional().describe("Milliseconds from the flow's start to its completion. Absent when either is unknown."),
9697
+ passedAfterRetry: boolean2().describe("The flow passed, but only after at least one earlier attempt in the same run. A signal of flakiness."),
9698
+ runId: ids.run.describe("The run this result belongs to."),
9699
+ status: _enum(publicRunStatusValues)
9700
+ }, { urlFieldDescription: "Absolute URL of the run page." });
9701
+ const output = object({
9702
+ nextCursor: nextCursorSchema,
9703
+ results: array(result).describe("The flow's results in the environment, newest first.")
9704
+ });
9705
+ return {
9706
+ annotationJustifications: {
9707
+ destructiveHint: "Does not rerun, edit or remove the flow or its runs.",
9708
+ openWorldHint: "Reads recorded QA Wolf results without changing the application under test.",
9709
+ readOnlyHint: "Lists one flow's past results across runs."
9710
+ },
9711
+ annotations: {
9712
+ destructiveHint: false,
9713
+ openWorldHint: false,
9714
+ readOnlyHint: true
9715
+ },
9716
+ description: "List one flow's results across runs in an environment, newest first, with status, attempts, duration, and diagnosis. Use it to spot flakiness, failure streaks, and duration trends.",
9717
+ input,
9718
+ kind: "read",
9719
+ name: "flow.getHistory",
9720
+ output
9721
+ };
9722
+ };
9723
+
9576
9724
  // node_modules/@qawolf/api-contracts/dist/v1/flow/readiness.js
9577
9725
  var flowReadinessSchema = _enum(["draft", "active"]);
9578
9726
 
@@ -9809,6 +9957,7 @@ var makeInvestigationFindingSchema = (ids) => object({
9809
9957
  type: literal("commit")
9810
9958
  }),
9811
9959
  object({
9960
+ applyOn: string2().optional().describe(`When the new baseline applies. Known values: "now" (once a person applies the proposal) and "merge" (when the run's pull request merges, because every environment of the workspace shares baselines). Absent means "now". New values can appear.`),
9812
9961
  baselineChangeId: string2().optional().describe('The baseline change that made the new screenshot the baseline, on a "fixed" finding. `run restoreScreenshotBaseline` undoes it.'),
9813
9962
  comparisonId: string2().describe("The failed screenshot comparison whose new screenshot becomes the baseline, as `run listScreenshotComparisons` names it."),
9814
9963
  type: literal("baseline")
@@ -9820,6 +9969,12 @@ var makeInvestigationFindingSchema = (ids) => object({
9820
9969
  kind: string2().describe('What the failure is. Known values: "maintenance", "bug", "flake" and "unknown". New values can appear.'),
9821
9970
  matchReason: string2().optional(),
9822
9971
  priority: issuePrioritySchema.optional(),
9972
+ pullRequest: object({
9973
+ file: string2().optional().describe("The changed file that explains the verdict."),
9974
+ line: number2().int().optional().describe("The line in `file` that explains the verdict."),
9975
+ reason: string2().describe("Why the investigation reached the verdict."),
9976
+ verdict: string2().describe('Whether the pull request caused the failure. Known values: "caused", "not-caused" and "unclear". New values can appear.')
9977
+ }).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."),
9823
9978
  question: object({
9824
9979
  answers: array(object({
9825
9980
  description: string2().optional(),
@@ -9851,7 +10006,7 @@ var makeGetInvestigationContract = (ids) => {
9851
10006
  findings: array(makeInvestigationFindingSchema(ids)),
9852
10007
  runId: ids.run,
9853
10008
  sessionId: ids.chatSession.optional().describe("The investigation session. Absent when the run has none."),
9854
- status: _enum(["investigating", "finished", "not-investigated"]).describe('Whether the lead or any child investigator is still working. "not-investigated" when the run has no investigation.'),
10009
+ 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.'),
9855
10010
  subSessions: array(object({
9856
10011
  sessionId: ids.chatSession,
9857
10012
  status: agentSessionStatusSchema
@@ -9868,7 +10023,7 @@ var makeGetInvestigationContract = (ids) => {
9868
10023
  openWorldHint: false,
9869
10024
  readOnlyHint: true
9870
10025
  },
9871
- description: "Read what the QA Wolf AI investigating a run has concluded: one finding per cause of its failures, " + "with the question waiting for a person and any answer or dispute the investigation hasn't acted on yet.",
10026
+ description: "Read what the QA Wolf AI investigating a run has concluded: one finding per cause of its failures, " + "with the question waiting for a person and any answer or dispute the investigation hasn't acted on yet. " + 'A run that automatic investigation does not cover answers status "not-enabled".',
9872
10027
  input,
9873
10028
  kind: "read",
9874
10029
  name: "investigation.get",
@@ -9957,6 +10112,60 @@ var makeCreateIssueContract = (ids) => {
9957
10112
  };
9958
10113
  };
9959
10114
 
10115
+ // node_modules/@qawolf/api-contracts/dist/v1/issue/listActivity.js
10116
+ var issueActivityTypeSchema = _enum([
10117
+ "created",
10118
+ "status-changed",
10119
+ "priority-changed",
10120
+ "resolved",
10121
+ "auto-resolved",
10122
+ "reopened",
10123
+ "flow-started-reproducing",
10124
+ "flow-stopped-reproducing",
10125
+ "flow-removed",
10126
+ "maintenance-reason-changed",
10127
+ "due-date-changed",
10128
+ "other"
10129
+ ]).describe("What happened. resolved is a person resolving the issue, auto-resolved is QA Wolf resolving it once no flow reproduces it. flow-stopped-reproducing means a run of the flow passed. flow-removed means the flow was detached from the issue, deleted, or its environment ended. other covers edits such as the name or description.");
10130
+ var issueActivityActorKindSchema = _enum(["qa-wolf", "user", "api-key"]).optional().describe("Who caused the event: QA Wolf automation, a person, or an API key. Absent on older events.");
10131
+ var makeListIssueActivityContract = (ids) => {
10132
+ const input = object({
10133
+ issueId: ids.issue,
10134
+ ...makePaginationInputFields({ defaultLimit: 50, maxLimit: 200 })
10135
+ });
10136
+ const output = object({
10137
+ events: array(object({
10138
+ actorKind: issueActivityActorKindSchema,
10139
+ environmentId: ids.environment.optional(),
10140
+ flowId: ids.flow.optional(),
10141
+ fromPriority: issuePrioritySchema.optional(),
10142
+ occurredAt: exports_iso.datetime(),
10143
+ runId: ids.run.optional().describe("The run whose result caused the event."),
10144
+ toPriority: issuePrioritySchema.optional(),
10145
+ toStatus: issueStatusSchema.optional().describe("The issue status after the event."),
10146
+ type: issueActivityTypeSchema
10147
+ })).describe("The issue's activity, oldest first."),
10148
+ nextCursor: nextCursorSchema
10149
+ });
10150
+ return {
10151
+ annotationJustifications: {
10152
+ destructiveHint: "Does not edit the issue or its activity.",
10153
+ openWorldHint: "Reads QA Wolf issue history without publishing updates to linked trackers.",
10154
+ readOnlyHint: "Lists the recorded activity of one issue."
10155
+ },
10156
+ annotations: {
10157
+ destructiveHint: false,
10158
+ openWorldHint: false,
10159
+ readOnlyHint: true
10160
+ },
10161
+ description: "List an issue's activity, oldest first: creation, status and priority changes, and the flows that started or stopped reproducing it. Use it to measure time to fix or to find issues that came back.",
10162
+ input,
10163
+ kind: "read",
10164
+ name: "issue.listActivity",
10165
+ output
10166
+ };
10167
+ };
10168
+
9960
10169
  // node_modules/@qawolf/api-contracts/dist/v1/issue/removeFlows.js
9961
10170
  var makeRemoveFlowsFromIssueContract = (ids) => {
9962
10171
  const input = object({
@@ -10158,66 +10367,6 @@ var makeLegacyTriggerContracts = (ids) => ({
10158
10367
  resume: makeResumeLegacyTriggerContract(ids)
10159
10368
  });
10160
10369
 
10161
- // node_modules/@qawolf/api-contracts/dist/v1/promotion/find.js
10162
- var makeFindPromotionsContract = (ids) => {
10163
- const input = object({
10164
- environmentId: ids.environmentRef.optional().describe("Only list promotions out of this head environment, by id or alias. Omit to list the whole workspace's promotions."),
10165
- status: promotionStatusSchema.optional().describe("Only list promotions in this status. Use conflicted to see the promotions that need attention."),
10166
- workspaceId: ids.workspace.optional().describe("The workspace to list promotions from, which an environment alias resolves in. Required when authenticating with an organization or user API key."),
10167
- ...makePaginationInputFields({ defaultLimit: 20, maxLimit: 100 })
10168
- });
10169
- const output = object({
10170
- nextCursor: nextCursorSchema,
10171
- promotions: array(makePromotionResourceSchema(ids)).describe("The workspace's promotions, newest first.")
10172
- });
10173
- return {
10174
- annotationJustifications: {
10175
- destructiveHint: "Does not change promotions, environments or flow code branches.",
10176
- openWorldHint: "Reads private QA Wolf promotion records without changing external systems.",
10177
- readOnlyHint: "Lists promotions in the authorized workspace without changing them."
10178
- },
10179
- annotations: {
10180
- destructiveHint: false,
10181
- openWorldHint: false,
10182
- readOnlyHint: true
10183
- },
10184
- description: "List environment promotions, newest first. A promotion moves the flow changes made in a head environment into its base environment. Filter by status conflicted to find the promotions whose conflicts still need a resolution.",
10185
- input,
10186
- kind: "read",
10187
- name: "promotion.find",
10188
- output
10189
- };
10190
- };
10191
-
10192
- // node_modules/@qawolf/api-contracts/dist/v1/promotion/get.js
10193
- var makeGetPromotionContract = (ids) => {
10194
- const input = object({ promotionId: ids.promotion });
10195
- const output = makePromotionResourceSchema(ids);
10196
- return {
10197
- annotationJustifications: {
10198
- destructiveHint: "Does not change the promotion, its environments or flow code branches.",
10199
- openWorldHint: "Reads a private QA Wolf promotion record without changing external systems.",
10200
- readOnlyHint: "Retrieves one authorized promotion's status and conflict without changing it."
10201
- },
10202
- annotations: {
10203
- destructiveHint: false,
10204
- openWorldHint: false,
10205
- readOnlyHint: true
10206
- },
10207
- description: "Read one environment promotion: its status, the conflicting paths and commit hashes while it is conflicted or resolving, the commit it landed when promoted, and the AI task resolving it. Poll it after environment.promote to learn how the promotion settled. It does not serve file contents; a resolver reads both branches from the flow code repository.",
10208
- input,
10209
- kind: "read",
10210
- name: "promotion.get",
10211
- output
10212
- };
10213
- };
10214
-
10215
- // node_modules/@qawolf/api-contracts/dist/v1/promotion/index.js
10216
- var makePromotionContracts = (ids) => ({
10217
- find: makeFindPromotionsContract(ids),
10218
- get: makeGetPromotionContract(ids)
10219
- });
10220
-
10221
10370
  // node_modules/@qawolf/api-contracts/dist/v1/run/investigationSessionId.js
10222
10371
  var investigationSessionId = string2().trim().min(1).max(100).optional();
10223
10372
 
@@ -10243,6 +10392,9 @@ var makeAcceptScreenshotBaselineContract = (ids) => {
10243
10392
  object({
10244
10393
  outcome: literal("not-investigation-session").describe("An API key that is not a person's can change a baseline only as the investigation of the run, and chatSessionId is missing or is not the session that investigates the run. Nothing changed.")
10245
10394
  }),
10395
+ object({
10396
+ outcome: literal("waits-for-merge").describe("The investigation proposed this baseline to apply when the run's pull request merges, and it hasn't merged. Nothing changed. QA Wolf applies the approved baseline on merge.")
10397
+ }),
10246
10398
  object({
10247
10399
  outcome: literal("nothing-to-accept").describe("The comparison did not fail, or has no new screenshot to accept. Nothing changed.")
10248
10400
  })
@@ -10470,6 +10622,7 @@ var makeReattemptRunContract = (ids) => {
10470
10622
  });
10471
10623
  const output = resource({
10472
10624
  reattemptedFlowIds: array(ids.flow).describe("The flows a new attempt was requested for."),
10625
+ reattemptedInRunIds: array(ids.run).describe("The runs the new attempts were added to, which is where to poll " + "for their results. It is this run alone unless a flow had kept " + "failing in later runs, because the attempt then goes to the " + "latest of them."),
10473
10626
  runId: ids.run
10474
10627
  }, { urlFieldDescription: "Absolute URL of the run page." });
10475
10628
  return {
@@ -10483,7 +10636,7 @@ var makeReattemptRunContract = (ids) => {
10483
10636
  openWorldHint: true,
10484
10637
  readOnlyHint: false
10485
10638
  },
10486
- description: "Request new attempts for a run's flows, in the same run. " + "A flow is eligible once its result is failed or canceled and QA Wolf's " + "automatic retries have finished. " + "A fully investigated run no longer accepts reattempts. " + "Attempts run with the latest flow code. Poll run.get for results.",
10639
+ description: "Request new attempts for a run's flows. " + "A flow is eligible once its result is failed or canceled and QA Wolf's " + "automatic retries have finished. " + "A flow that kept failing in later runs is attempted in the latest of " + "them, because that is the run carrying the failure, so read " + "reattemptedInRunIds for where each attempt landed. " + "A fully investigated run no longer accepts reattempts. " + "Attempts run with the latest flow code. Poll run.get for results.",
10487
10640
  input,
10488
10641
  kind: "write",
10489
10642
  name: "run.reattempt",
@@ -10903,7 +11056,7 @@ var makeRunFlowOnRunnerContract = (ids) => {
10903
11056
  const input = object({
10904
11057
  entryPointPath: runFilePathSchema.describe("Path of the flow file to run, as it appears in `files`."),
10905
11058
  env: runEnvironmentSchema.optional().describe("Environment variables to make available to the run."),
10906
- 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. Send this or `env`, not both."),
11059
+ 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`. Send this or `env`, not both."),
10907
11060
  files: runFilesSchema.describe("Every file the run needs keyed by its path — the flow file, everything it imports, package.json and tsconfig.json. A runner holds no copy of your project, so what runs is exactly what is sent here."),
10908
11061
  flowId: ids.flow.optional().describe("The QA Wolf flow this run is for. The run then sees it as `QAWOLF_WORKFLOW_ID`, the same value a platform run of that flow sees, so fixtures named and cleaned up by it match across both. Omitted, the flow whose file is at `entryPointPath` on the named environment's flow-code branch stands in; a file not in QA Wolf yet, or a run given no environment, leaves the run with no `QAWOLF_WORKFLOW_ID`."),
10909
11062
  id: runnerIdSchema.describe("Id of the runner to run the flow on."),
@@ -11180,18 +11333,19 @@ var makeContractsV1 = (ids) => {
11180
11333
  environment: {
11181
11334
  create: makeCreateEnvironmentContract(resolvedIds),
11182
11335
  deleteVariable: makeDeleteEnvironmentVariableContract(resolvedIds),
11183
- discard: makeDiscardEnvironmentContract(resolvedIds),
11184
11336
  find: makeFindEnvironmentsContract(resolvedIds),
11185
11337
  get: makeGetEnvironmentContract(resolvedIds),
11186
11338
  getVariable: makeGetEnvironmentVariableContract(resolvedIds),
11187
11339
  listVariableNames: makeListEnvironmentVariableNamesContract(resolvedIds),
11188
11340
  promote: makePromoteEnvironmentContract(resolvedIds),
11189
11341
  setVariable: makeSetEnvironmentVariableContract(resolvedIds),
11342
+ terminate: makeTerminateEnvironmentContract(resolvedIds),
11190
11343
  update: makeUpdateEnvironmentContract(resolvedIds)
11191
11344
  },
11192
11345
  file: makeFileContracts(resolvedIds),
11193
11346
  flow: {
11194
11347
  addTag: makeAddTagToFlowsContract(resolvedIds),
11348
+ getHistory: makeGetFlowHistoryContract(resolvedIds),
11195
11349
  list: makeListFlowsContract(resolvedIds),
11196
11350
  removeTag: makeRemoveTagFromFlowsContract(resolvedIds),
11197
11351
  update: makeUpdateFlowContract(resolvedIds)
@@ -11202,6 +11356,7 @@ var makeContractsV1 = (ids) => {
11202
11356
  create: makeCreateIssueContract(resolvedIds),
11203
11357
  find: makeFindIssuesContract(resolvedIds),
11204
11358
  get: makeGetIssueContract(resolvedIds),
11359
+ listActivity: makeListIssueActivityContract(resolvedIds),
11205
11360
  removeFlows: makeRemoveFlowsFromIssueContract(resolvedIds),
11206
11361
  update: makeUpdateIssueContract(resolvedIds)
11207
11362
  },
@@ -15865,4 +16020,4 @@ export {
15865
16020
  createRunnerSdk
15866
16021
  };
15867
16022
 
15868
- //# debugId=8AE38B5E661AE4A264756E2164756E21
16023
+ //# debugId=A94DB3C7942B00FA64756E2164756E21