@qawolf/api-contracts 0.74.1 → 0.77.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.
Files changed (45) hide show
  1. package/dist/v1/index.d.ts +248 -8
  2. package/dist/v1/index.d.ts.map +1 -1
  3. package/dist/v1/index.js +6 -0
  4. package/dist/v1/index.js.map +1 -1
  5. package/dist/v1/investigation/finding.d.ts +9 -0
  6. package/dist/v1/investigation/finding.d.ts.map +1 -1
  7. package/dist/v1/investigation/finding.js +30 -2
  8. package/dist/v1/investigation/finding.js.map +1 -1
  9. package/dist/v1/investigation/get.d.ts +13 -0
  10. package/dist/v1/investigation/get.d.ts.map +1 -1
  11. package/dist/v1/investigation/get.js +4 -0
  12. package/dist/v1/investigation/get.js.map +1 -1
  13. package/dist/v1/investigation/index.d.ts +13 -0
  14. package/dist/v1/investigation/index.d.ts.map +1 -1
  15. package/dist/v1/issue/removeFlows.d.ts +2 -1
  16. package/dist/v1/issue/removeFlows.d.ts.map +1 -1
  17. package/dist/v1/issue/removeFlows.js +8 -5
  18. package/dist/v1/issue/removeFlows.js.map +1 -1
  19. package/dist/v1/run/acceptScreenshotBaseline.d.ts +34 -0
  20. package/dist/v1/run/acceptScreenshotBaseline.d.ts.map +1 -0
  21. package/dist/v1/run/acceptScreenshotBaseline.js +61 -0
  22. package/dist/v1/run/acceptScreenshotBaseline.js.map +1 -0
  23. package/dist/v1/run/diagnose.js +1 -1
  24. package/dist/v1/run/diagnose.js.map +1 -1
  25. package/dist/v1/run/investigationSessionId.d.ts +3 -0
  26. package/dist/v1/run/investigationSessionId.d.ts.map +1 -0
  27. package/dist/v1/run/investigationSessionId.js +12 -0
  28. package/dist/v1/run/investigationSessionId.js.map +1 -0
  29. package/dist/v1/run/listScreenshotComparisons.d.ts +60 -0
  30. package/dist/v1/run/listScreenshotComparisons.d.ts.map +1 -0
  31. package/dist/v1/run/listScreenshotComparisons.js +124 -0
  32. package/dist/v1/run/listScreenshotComparisons.js.map +1 -0
  33. package/dist/v1/run/restoreScreenshotBaseline.d.ts +33 -0
  34. package/dist/v1/run/restoreScreenshotBaseline.d.ts.map +1 -0
  35. package/dist/v1/run/restoreScreenshotBaseline.js +57 -0
  36. package/dist/v1/run/restoreScreenshotBaseline.js.map +1 -0
  37. package/dist/v1/runner/catalog.d.ts +3 -3
  38. package/dist/v1/runner/recording.d.ts +10 -10
  39. package/dist/v1/runner/runFlow.js +1 -1
  40. package/dist/v1/runner/runFlow.js.map +1 -1
  41. package/dist/v1/sharedSchemas.d.ts +1 -0
  42. package/dist/v1/sharedSchemas.d.ts.map +1 -1
  43. package/dist/v1/sharedSchemas.js +1 -0
  44. package/dist/v1/sharedSchemas.js.map +1 -1
  45. package/package.json +1 -1
@@ -4,6 +4,10 @@ import { makeInvestigationFindingSchema } from "./finding.js";
4
4
  export const makeGetInvestigationContract = (ids) => {
5
5
  const input = z.object({ runId: ids.run });
6
6
  const output = resource({
7
+ baselineChanges: z
8
+ .enum(["automatic", "needs-approval"])
9
+ .describe('How the investigation can make a new screenshot the baseline. "automatic": it can accept a baseline on its own. ' +
10
+ '"needs-approval": it proposes the baseline on a fix-proposed finding, and accepts it only after a person applies the proposal.'),
7
11
  findings: z.array(makeInvestigationFindingSchema(ids)),
8
12
  runId: ids.run,
9
13
  sessionId: ids.chatSession
@@ -1 +1 @@
1
- {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/v1/investigation/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAE9D,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAK1C,GAMD,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;I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Q,EAAE,CAAC,CAAC,KAAK,CAAC,8BAA8B,CAAC,GAAG,CAAC,CAAC;QACtD,KAAK,EAAE,GAAG,CAAC,GAAG;QACd,SAAS,EAAE,GAAG,CAAC,WAAW;aACvB,QAAQ,EAAE;aACV,QAAQ,CAAC,0DAA0D,CAAC;QACvE,MAAM,EAAE,CAAC;aACN,IAAI,CAAC,CAAC,eAAe,EAAE,UAAU,EAAE,kBAAkB,CAAC,CAAC;aACvD,QAAQ,CACP,2GAA2G,CAC5G;KACJ,EACD,EAAE,mBAAmB,EAAE,6BAA6B,EAAE,CACvD,CAAC;IAEF,OAAO;QACL,WAAW,EAAE;YACX,eAAe,EAAE,KAAK;YACtB,aAAa,EAAE,KAAK;YACpB,YAAY,EAAE,IAAI;SACnB;QACD,WAAW,EACT,qGAAqG;YACrG,yGAAyG;QAC3G,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,mBAAmB;QACzB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -19,6 +19,10 @@ export declare const makeInvestigationContracts: <ChatSessionId extends PublicId
19
19
  readonly kind: "read";
20
20
  readonly name: "investigation.get";
21
21
  readonly output: import("zod").ZodObject<{
22
+ baselineChanges: import("zod").ZodEnum<{
23
+ automatic: "automatic";
24
+ "needs-approval": "needs-approval";
25
+ }>;
22
26
  findings: import("zod").ZodArray<import("zod").ZodObject<{
23
27
  actual: import("zod").ZodOptional<import("zod").ZodString>;
24
28
  commitHash: import("zod").ZodOptional<import("zod").ZodString>;
@@ -29,6 +33,14 @@ export declare const makeInvestigationContracts: <ChatSessionId extends PublicId
29
33
  disputeReason: import("zod").ZodOptional<import("zod").ZodString>;
30
34
  expected: import("zod").ZodOptional<import("zod").ZodString>;
31
35
  findingId: import("zod").ZodString;
36
+ fix: import("zod").ZodOptional<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
37
+ commitHash: import("zod").ZodString;
38
+ type: import("zod").ZodLiteral<"commit">;
39
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
40
+ baselineChangeId: import("zod").ZodOptional<import("zod").ZodString>;
41
+ comparisonId: import("zod").ZodString;
42
+ type: import("zod").ZodLiteral<"baseline">;
43
+ }, import("zod/v4/core").$strip>], "type">>;
32
44
  flowIds: import("zod").ZodArray<FlowId>;
33
45
  headline: import("zod").ZodOptional<import("zod").ZodString>;
34
46
  issueId: import("zod").ZodOptional<IssueId>;
@@ -47,6 +59,7 @@ export declare const makeInvestigationContracts: <ChatSessionId extends PublicId
47
59
  title: import("zod").ZodString;
48
60
  value: import("zod").ZodString;
49
61
  }, import("zod/v4/core").$strip>>;
62
+ comparisonId: import("zod").ZodOptional<import("zod").ZodString>;
50
63
  text: import("zod").ZodString;
51
64
  }, import("zod/v4/core").$strip>>;
52
65
  response: import("zod").ZodOptional<import("zod").ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v1/investigation/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD,eAAO,MAAM,0BAA0B,GACrC,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,OAAO,SAAS,cAAc,EAC9B,KAAK,SAAS,cAAc,EAC5B,KAAK;IACL,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,WAAW,EAAE,aAAa,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/v1/investigation/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD,eAAO,MAAM,0BAA0B,GACrC,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,OAAO,SAAS,cAAc,EAC9B,KAAK,SAAS,cAAc,EAC5B,KAAK;IACL,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,WAAW,EAAE,aAAa,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEC,CAAC"}
@@ -8,11 +8,12 @@ export declare const makeRemoveFlowsFromIssueContract: <EnvironmentId extends Pu
8
8
  }) => {
9
9
  readonly annotations: {
10
10
  readonly destructiveHint: true;
11
- readonly openWorldHint: false;
11
+ readonly openWorldHint: true;
12
12
  readonly readOnlyHint: false;
13
13
  };
14
14
  readonly description: string;
15
15
  readonly input: z.ZodObject<{
16
+ environmentId: z.ZodOptional<EnvironmentId>;
16
17
  flowIds: z.ZodArray<FlowId>;
17
18
  issueId: IssueId;
18
19
  }, z.core.$strip>;
@@ -1 +1 @@
1
- {"version":3,"file":"removeFlows.d.ts","sourceRoot":"","sources":["../../../src/v1/issue/removeFlows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD,eAAO,MAAM,gCAAgC,GAC3C,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAC5B,OAAO,SAAS,cAAc,EAC9B,KAAK;IACL,WAAW,EAAE,aAAa,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCA,CAAC"}
1
+ {"version":3,"file":"removeFlows.d.ts","sourceRoot":"","sources":["../../../src/v1/issue/removeFlows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD,eAAO,MAAM,gCAAgC,GAC3C,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAC5B,OAAO,SAAS,cAAc,EAC9B,KAAK;IACL,WAAW,EAAE,aAAa,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CA,CAAC"}
@@ -2,13 +2,16 @@ import { z } from "zod";
2
2
  import { makeIssueResourceSchema } from "./index.js";
3
3
  export const makeRemoveFlowsFromIssueContract = (ids) => {
4
4
  const input = z.object({
5
+ environmentId: ids.environment
6
+ .optional()
7
+ .describe("The environment whose bug or maintenance reproductions to remove. Required when a selected flow is linked in more than one environment."),
5
8
  flowIds: z
6
9
  .array(ids.flow)
7
10
  .min(1)
8
11
  // Matches the issue.addFlows selection cap.
9
12
  .max(300)
10
13
  .refine((flowIds) => new Set(flowIds).size === flowIds.length, "flowIds must be unique")
11
- .describe("The flows the coverage request no longer covers."),
14
+ .describe("The flows to remove from the issue."),
12
15
  issueId: ids.issue,
13
16
  });
14
17
  const output = z.object({
@@ -17,12 +20,12 @@ export const makeRemoveFlowsFromIssueContract = (ids) => {
17
20
  return {
18
21
  annotations: {
19
22
  destructiveHint: true,
20
- openWorldHint: false,
23
+ openWorldHint: true,
21
24
  readOnlyHint: false,
22
25
  },
23
- description: "Remove flows from a coverage request owned by the caller's team. " +
24
- "Flows the request does not cover are left alone. " +
25
- "Bug and maintenance reports link to flows through the runs that reproduce them, so their flows cannot be set directly.",
26
+ description: "Remove flows from a coverage request or remove bug/maintenance reproductions in an environment. " +
27
+ "Unlinked flows are left alone. Reports auto-close when no active reproductions remain and auto-close is enabled. " +
28
+ "For reports, omit environmentId only when each selected flow is linked in at most one environment.",
26
29
  input,
27
30
  kind: "write",
28
31
  name: "issue.removeFlows",
@@ -1 +1 @@
1
- {"version":3,"file":"removeFlows.js","sourceRoot":"","sources":["../../../src/v1/issue/removeFlows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAK9C,GAKD,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,OAAO,EAAE,CAAC;aACP,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;aACf,GAAG,CAAC,CAAC,CAAC;YACP,4CAA4C;aAC3C,GAAG,CAAC,GAAG,CAAC;aACR,MAAM,CACL,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,MAAM,EACrD,wBAAwB,CACzB;aACA,QAAQ,CAAC,kDAAkD,CAAC;QAC/D,OAAO,EAAE,GAAG,CAAC,KAAK;KACnB,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;QACtB,KAAK,EAAE,uBAAuB,CAAC,GAAG,CAAC;KACpC,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EAAE;YACX,eAAe,EAAE,IAAI;YACrB,aAAa,EAAE,KAAK;YACpB,YAAY,EAAE,KAAK;SACpB;QACD,WAAW,EACT,mEAAmE;YACnE,mDAAmD;YACnD,wHAAwH;QAC1H,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,mBAAmB;QACzB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"removeFlows.js","sourceRoot":"","sources":["../../../src/v1/issue/removeFlows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAK9C,GAKD,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,aAAa,EAAE,GAAG,CAAC,WAAW;aAC3B,QAAQ,EAAE;aACV,QAAQ,CACP,yIAAyI,CAC1I;QACH,OAAO,EAAE,CAAC;aACP,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;aACf,GAAG,CAAC,CAAC,CAAC;YACP,4CAA4C;aAC3C,GAAG,CAAC,GAAG,CAAC;aACR,MAAM,CACL,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,MAAM,EACrD,wBAAwB,CACzB;aACA,QAAQ,CAAC,qCAAqC,CAAC;QAClD,OAAO,EAAE,GAAG,CAAC,KAAK;KACnB,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;QACtB,KAAK,EAAE,uBAAuB,CAAC,GAAG,CAAC;KACpC,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EAAE;YACX,eAAe,EAAE,IAAI;YACrB,aAAa,EAAE,IAAI;YACnB,YAAY,EAAE,KAAK;SACpB;QACD,WAAW,EACT,kGAAkG;YAClG,mHAAmH;YACnH,oGAAoG;QACtG,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,mBAAmB;QACzB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { z } from "zod";
2
+ import type { PublicIdSchema } from "../ids.js";
3
+ export declare const makeAcceptScreenshotBaselineContract: <RunId extends PublicIdSchema>(ids: {
4
+ [key: string]: unknown;
5
+ run: RunId;
6
+ }) => {
7
+ readonly annotations: {
8
+ readonly destructiveHint: true;
9
+ readonly openWorldHint: false;
10
+ readonly readOnlyHint: false;
11
+ };
12
+ readonly description: string;
13
+ readonly input: z.ZodObject<{
14
+ chatSessionId: z.ZodOptional<z.ZodString>;
15
+ comparisonId: z.ZodString;
16
+ runId: RunId;
17
+ }, z.core.$strip>;
18
+ readonly kind: "write";
19
+ readonly name: "run.acceptScreenshotBaseline";
20
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
21
+ baselineChangeId: z.ZodString;
22
+ name: z.ZodString;
23
+ outcome: z.ZodLiteral<"accepted">;
24
+ }, z.core.$strip>, z.ZodObject<{
25
+ outcome: z.ZodLiteral<"baseline-changed">;
26
+ }, z.core.$strip>, z.ZodObject<{
27
+ outcome: z.ZodLiteral<"needs-approval">;
28
+ }, z.core.$strip>, z.ZodObject<{
29
+ outcome: z.ZodLiteral<"not-investigation-session">;
30
+ }, z.core.$strip>, z.ZodObject<{
31
+ outcome: z.ZodLiteral<"nothing-to-accept">;
32
+ }, z.core.$strip>], "outcome">;
33
+ };
34
+ //# sourceMappingURL=acceptScreenshotBaseline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acceptScreenshotBaseline.d.ts","sourceRoot":"","sources":["../../../src/v1/run/acceptScreenshotBaseline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD,eAAO,MAAM,oCAAoC,GAC/C,KAAK,SAAS,cAAc,EAC5B,KAAK;IACL,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiFA,CAAC"}
@@ -0,0 +1,61 @@
1
+ import { z } from "zod";
2
+ import { investigationSessionId } from "./investigationSessionId.js";
3
+ export const makeAcceptScreenshotBaselineContract = (ids) => {
4
+ const input = z.object({
5
+ chatSessionId: investigationSessionId.describe("The chat session of the investigation that accepts the baseline. A workspace or organization API key acts as an automation, so it must send the session that investigates the run. A person's call ignores it."),
6
+ comparisonId: z
7
+ .string()
8
+ .trim()
9
+ .min(1)
10
+ .max(100)
11
+ .describe("The failed screenshot comparison whose new screenshot becomes the baseline, as `run.listScreenshotComparisons` names it."),
12
+ runId: ids.run,
13
+ });
14
+ const output = z.discriminatedUnion("outcome", [
15
+ z.object({
16
+ baselineChangeId: z
17
+ .string()
18
+ .describe("The baseline change. Record it on the fixed finding, and pass it to `run.restoreScreenshotBaseline` with this runId to put the old baseline back."),
19
+ name: z.string().describe("The screenshot name whose baseline changed."),
20
+ outcome: z
21
+ .literal("accepted")
22
+ .describe("The new screenshot is now the baseline. The old baseline is kept, so the change can be restored."),
23
+ }),
24
+ z.object({
25
+ outcome: z
26
+ .literal("baseline-changed")
27
+ .describe("The baseline is no longer the one the run compared with: someone changed or deleted it since. Nothing changed. List the comparisons again to see the current baseline."),
28
+ }),
29
+ z.object({
30
+ outcome: z
31
+ .literal("needs-approval")
32
+ .describe("Only a person can approve this change. Nothing changed. Propose the new baseline on a fix-proposed finding and wait for a person to apply it."),
33
+ }),
34
+ z.object({
35
+ outcome: z
36
+ .literal("not-investigation-session")
37
+ .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."),
38
+ }),
39
+ z.object({
40
+ outcome: z
41
+ .literal("nothing-to-accept")
42
+ .describe("The comparison did not fail, or has no new screenshot to accept. Nothing changed."),
43
+ }),
44
+ ]);
45
+ return {
46
+ annotations: {
47
+ destructiveHint: true,
48
+ openWorldHint: false,
49
+ readOnlyHint: false,
50
+ },
51
+ description: "Make the new screenshot of a failed screenshot comparison the baseline, so later runs compare with it. " +
52
+ "Use it only when the difference is an intended change of the app, not a bug, noise, or a page that was not ready. " +
53
+ "Every later run of every environment of the workspace compares with the new baseline. " +
54
+ "Refuses without changing anything when the baseline changed since the run.",
55
+ input,
56
+ kind: "write",
57
+ name: "run.acceptScreenshotBaseline",
58
+ output,
59
+ };
60
+ };
61
+ //# sourceMappingURL=acceptScreenshotBaseline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acceptScreenshotBaseline.js","sourceRoot":"","sources":["../../../src/v1/run/acceptScreenshotBaseline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAElD,GAGD,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,aAAa,EAAE,sBAAsB,CAAC,QAAQ,CAC5C,gNAAgN,CACjN;QACD,YAAY,EAAE,CAAC;aACZ,MAAM,EAAE;aACR,IAAI,EAAE;aACN,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,CACP,0HAA0H,CAC3H;QACH,KAAK,EAAE,GAAG,CAAC,GAAG;KACf,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;QAC7C,CAAC,CAAC,MAAM,CAAC;YACP,gBAAgB,EAAE,CAAC;iBAChB,MAAM,EAAE;iBACR,QAAQ,CACP,mJAAmJ,CACpJ;YACH,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;YACxE,OAAO,EAAE,CAAC;iBACP,OAAO,CAAC,UAAU,CAAC;iBACnB,QAAQ,CACP,kGAAkG,CACnG;SACJ,CAAC;QACF,CAAC,CAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;iBACP,OAAO,CAAC,kBAAkB,CAAC;iBAC3B,QAAQ,CACP,wKAAwK,CACzK;SACJ,CAAC;QACF,CAAC,CAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;iBACP,OAAO,CAAC,gBAAgB,CAAC;iBACzB,QAAQ,CACP,+IAA+I,CAChJ;SACJ,CAAC;QACF,CAAC,CAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;iBACP,OAAO,CAAC,2BAA2B,CAAC;iBACpC,QAAQ,CACP,8LAA8L,CAC/L;SACJ,CAAC;QACF,CAAC,CAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;iBACP,OAAO,CAAC,mBAAmB,CAAC;iBAC5B,QAAQ,CACP,mFAAmF,CACpF;SACJ,CAAC;KACH,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EAAE;YACX,eAAe,EAAE,IAAI;YACrB,aAAa,EAAE,KAAK;YACpB,YAAY,EAAE,KAAK;SACpB;QACD,WAAW,EACT,yGAAyG;YACzG,oHAAoH;YACpH,wFAAwF;YACxF,4EAA4E;QAC9E,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,8BAA8B;QACpC,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -24,7 +24,7 @@ export const makeDiagnoseRunContract = (ids) => {
24
24
  description: "Diagnose failed flows in a run as reproductions of a bug or maintenance report owned by the caller's team. " +
25
25
  "The issue's type selects the diagnosis. " +
26
26
  "Each flow must have failed in the run. " +
27
- "A flow that is already diagnosed moves to this issue. " +
27
+ "A flow that is already diagnosed in the run moves to this issue, and may stay linked to other open reports. " +
28
28
  "The diagnosis appears on the run, and the reproduction appears under the issue's reproductions. " +
29
29
  "Coverage requests cannot be diagnosed; use issue.addFlows to cover flows instead.",
30
30
  input,
@@ -1 +1 @@
1
- {"version":3,"file":"diagnose.js","sourceRoot":"","sources":["../../../src/v1/run/diagnose.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,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AE,CAAC;aACP,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;aACf,GAAG,CAAC,CAAC,CAAC;YACP,iCAAiC;aAChC,GAAG,CAAC,GAAG,CAAC;aACR,MAAM,CACL,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,MAAM,EACrD,wBAAwB,CACzB;aACA,QAAQ,CAAC,iDAAiD,CAAC;QAC9D,OAAO,EAAE,GAAG,CAAC,KAAK;QAClB,KAAK,EAAE,GAAG,CAAC,GAAG;KACf,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;QACtB,KAAK,EAAE,uBAAuB,CAAC,GAAG,CAAC;KACpC,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EAAE;YACX,eAAe,EAAE,IAAI;YACrB,aAAa,EAAE,IAAI;YACnB,YAAY,EAAE,KAAK;SACpB;QACD,WAAW,EACT,6GAA6G;YAC7G,0CAA0C;YAC1C,yCAAyC;YACzC,8GAA8G;YAC9G,kGAAkG;YAClG,mFAAmF;QACrF,KAAK;QACL,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,cAAc;QACpB,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { z } from "zod";
2
+ export declare const investigationSessionId: z.ZodOptional<z.ZodString>;
3
+ //# sourceMappingURL=investigationSessionId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"investigationSessionId.d.ts","sourceRoot":"","sources":["../../../src/v1/run/investigationSessionId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,sBAAsB,4BAKtB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+ // A plain string, not the chat session id schema: the server authorizes an id
3
+ // schema before the handler runs and answers a session the caller cannot see
4
+ // with not found, while these contracts promise `not-investigation-session`
5
+ // for every session that does not investigate the run.
6
+ export const investigationSessionId = z
7
+ .string()
8
+ .trim()
9
+ .min(1)
10
+ .max(100)
11
+ .optional();
12
+ //# sourceMappingURL=investigationSessionId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"investigationSessionId.js","sourceRoot":"","sources":["../../../src/v1/run/investigationSessionId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,6EAA6E;AAC7E,4EAA4E;AAC5E,uDAAuD;AACvD,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC;KACpC,MAAM,EAAE;KACR,IAAI,EAAE;KACN,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,GAAG,CAAC;KACR,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { z } from "zod";
2
+ import type { PublicIdSchema } from "../ids.js";
3
+ export declare const maxListedScreenshotAttempts = 20;
4
+ export declare const makeListScreenshotComparisonsContract: <EnvironmentId extends PublicIdSchema, FlowId extends PublicIdSchema, RunId extends PublicIdSchema>(ids: {
5
+ [key: string]: unknown;
6
+ environment: EnvironmentId;
7
+ flow: FlowId;
8
+ run: RunId;
9
+ }) => {
10
+ readonly annotations: {
11
+ readonly destructiveHint: false;
12
+ readonly openWorldHint: false;
13
+ readonly readOnlyHint: false;
14
+ };
15
+ readonly description: string;
16
+ readonly input: z.ZodObject<{
17
+ flowIds: z.ZodOptional<z.ZodArray<FlowId>>;
18
+ runId: RunId;
19
+ }, z.core.$strip>;
20
+ readonly kind: "read";
21
+ readonly name: "run.listScreenshotComparisons";
22
+ readonly output: z.ZodObject<{
23
+ comparisons: z.ZodArray<z.ZodObject<{
24
+ actualPreviewUrl: z.ZodOptional<z.ZodURL>;
25
+ actualUrl: z.ZodURL;
26
+ attemptCompletedAt: z.ZodISODateTime;
27
+ baselineStatus: z.ZodEnum<{
28
+ unknown: "unknown";
29
+ accepted: "accepted";
30
+ deleted: "deleted";
31
+ unchanged: "unchanged";
32
+ "changed-since-run": "changed-since-run";
33
+ }>;
34
+ comparisonId: z.ZodString;
35
+ diffPreviewUrl: z.ZodOptional<z.ZodURL>;
36
+ diffUrl: z.ZodURL;
37
+ expectedPreviewUrl: z.ZodOptional<z.ZodURL>;
38
+ expectedUrl: z.ZodURL;
39
+ filePath: z.ZodOptional<z.ZodString>;
40
+ flowId: FlowId;
41
+ lineNumber: z.ZodOptional<z.ZodNumber>;
42
+ name: z.ZodString;
43
+ passingElsewhere: z.ZodDiscriminatedUnion<[z.ZodObject<{
44
+ status: z.ZodLiteral<"not-tracked">;
45
+ }, z.core.$strip>, z.ZodObject<{
46
+ environments: z.ZodArray<z.ZodObject<{
47
+ environmentId: EnvironmentId;
48
+ lastPassedAt: z.ZodISODateTime;
49
+ }, z.core.$strip>>;
50
+ status: z.ZodLiteral<"tracked">;
51
+ }, z.core.$strip>], "status">;
52
+ runAttemptId: z.ZodString;
53
+ similarity: z.ZodNumber;
54
+ sizeMismatch: z.ZodBoolean;
55
+ }, z.core.$strip>>;
56
+ expiresAt: z.ZodISODateTime;
57
+ truncated: z.ZodBoolean;
58
+ }, z.core.$strip>;
59
+ };
60
+ //# sourceMappingURL=listScreenshotComparisons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listScreenshotComparisons.d.ts","sourceRoot":"","sources":["../../../src/v1/run/listScreenshotComparisons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C,eAAO,MAAM,qCAAqC,GAChD,aAAa,SAAS,cAAc,EACpC,MAAM,SAAS,cAAc,EAC7B,KAAK,SAAS,cAAc,EAC5B,KAAK;IACL,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,WAAW,EAAE,aAAa,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoKA,CAAC"}
@@ -0,0 +1,124 @@
1
+ import { z } from "zod";
2
+ // Matches the cap the server applies, so a caller can tell a cut list from a
3
+ // complete one by `truncated` alone.
4
+ export const maxListedScreenshotAttempts = 20;
5
+ export const makeListScreenshotComparisonsContract = (ids) => {
6
+ const input = z.object({
7
+ flowIds: z
8
+ .array(ids.flow)
9
+ .min(1)
10
+ .max(100)
11
+ .refine((flowIds) => new Set(flowIds).size === flowIds.length, "flowIds must be unique")
12
+ .optional()
13
+ .describe("Only list the comparisons of these flows. Each flow must have a result in the run. Omit to list every failed flow of the run."),
14
+ runId: ids.run,
15
+ });
16
+ const imageUrl = (image) => z
17
+ .url()
18
+ .describe(`Signed URL of the full-size ${image} PNG. It stops working at expiresAt.`);
19
+ const previewUrl = (image) => z
20
+ .url()
21
+ .optional()
22
+ .describe(`Signed URL of a JPEG copy of the ${image} image, scaled down so its long edge is at most 1568 pixels. ` +
23
+ "Fetch this one to look at the image: it is small enough to view inline, while the full-size PNG can be too large. " +
24
+ "It stops working at expiresAt. Absent when QA Wolf could not make the copy, for example because the full-size image is gone.");
25
+ const passedEnvironment = z.object({
26
+ environmentId: ids.environment,
27
+ lastPassedAt: z.iso
28
+ .datetime()
29
+ .describe("When the latest passing comparison in this environment ran."),
30
+ });
31
+ const passingElsewhere = z
32
+ .discriminatedUnion("status", [
33
+ z.object({
34
+ status: z
35
+ .literal("not-tracked")
36
+ .describe("QA Wolf does not record screenshot comparisons for this workspace, so it cannot tell."),
37
+ }),
38
+ z.object({
39
+ environments: z
40
+ .array(passedEnvironment)
41
+ .describe("Other environments where the current baseline passed this screenshot in the last 14 days, most recent first. " +
42
+ "Empty when it passed nowhere else, or when the baseline no longer exists."),
43
+ status: z.literal("tracked"),
44
+ }),
45
+ ])
46
+ .describe("Whether the current baseline still passes in other environments. " +
47
+ "A baseline that passes elsewhere points to a difference in this environment rather than an outdated baseline.");
48
+ const comparison = z.object({
49
+ actualPreviewUrl: previewUrl("actual"),
50
+ actualUrl: imageUrl("actual (the screenshot the flow took)"),
51
+ attemptCompletedAt: z.iso
52
+ .datetime()
53
+ .describe("When the run attempt that made the comparison finished."),
54
+ baselineStatus: z
55
+ .enum([
56
+ "unchanged",
57
+ "accepted",
58
+ "changed-since-run",
59
+ "deleted",
60
+ "unknown",
61
+ ])
62
+ .describe('How the current baseline relates to the expected image this comparison used. "unchanged": the baseline is still the expected image. ' +
63
+ '"accepted": the baseline is now this comparison\'s actual screenshot, because someone accepted it, so a reattempt should pass. ' +
64
+ '"changed-since-run": someone replaced the baseline with another image after this run, so rerun the flow before deciding anything. ' +
65
+ '"deleted": the baseline no longer exists, and the next run will save its screenshot as the new baseline. ' +
66
+ '"unknown": the run\'s copy of the expected image is gone, so QA Wolf cannot compare.'),
67
+ comparisonId: z
68
+ .string()
69
+ .describe("Identifies this comparison: the run attempt id and the position of the comparison in that attempt."),
70
+ diffPreviewUrl: previewUrl("diff"),
71
+ diffUrl: imageUrl("diff (the pixels that differ are highlighted)"),
72
+ expectedPreviewUrl: previewUrl("expected"),
73
+ expectedUrl: imageUrl("expected (the baseline as it was when the flow ran)"),
74
+ filePath: z
75
+ .string()
76
+ .optional()
77
+ .describe("The flow file that made the comparison."),
78
+ flowId: ids.flow,
79
+ lineNumber: z
80
+ .number()
81
+ .int()
82
+ .optional()
83
+ .describe("The line of filePath that made the comparison."),
84
+ name: z
85
+ .string()
86
+ .describe("The screenshot name the flow passed to toHaveScreenshot. The baseline is stored as _screenshots_/<name>.png in team storage."),
87
+ passingElsewhere,
88
+ runAttemptId: z.string(),
89
+ similarity: z
90
+ .number()
91
+ .describe("How much of the actual image matches the expected image, in percent."),
92
+ sizeMismatch: z
93
+ .boolean()
94
+ .describe("The actual and expected images have different dimensions. That fails the comparison whatever the pixels show, and similarity reads 0."),
95
+ });
96
+ const output = z.object({
97
+ comparisons: z
98
+ .array(comparison)
99
+ .describe(`Each screenshot comparison that failed its flow, from the ${maxListedScreenshotAttempts} most recent failed attempts of the selected flows, oldest attempt first.`),
100
+ expiresAt: z.iso
101
+ .datetime()
102
+ .describe("When the image URLs stop working. Call run.listScreenshotComparisons again for fresh ones after it."),
103
+ truncated: z
104
+ .boolean()
105
+ .describe(`True when the selected flows have more than ${maxListedScreenshotAttempts} failed attempts. Only the ${maxListedScreenshotAttempts} most recent are listed, and the older attempts cannot be listed.`),
106
+ });
107
+ return {
108
+ annotations: {
109
+ destructiveHint: false,
110
+ openWorldHint: false,
111
+ readOnlyHint: false,
112
+ },
113
+ description: "List the screenshot comparisons that failed a run's flows, with the expected, actual and diff images of each. " +
114
+ "Only comparisons that caused a failure are listed: a screenshot that differs within tolerance, or that differs on a line that did not fail, is left out. " +
115
+ "Each comparison tells whether its baseline changed since the run and whether the baseline still passes in other environments. " +
116
+ "The image URLs expire after a few minutes; fetch the preview URLs to look at the images. " +
117
+ "The first call for an image makes its missing JPEG preview and keeps it in team storage, so later calls reuse it.",
118
+ input,
119
+ kind: "read",
120
+ name: "run.listScreenshotComparisons",
121
+ output,
122
+ };
123
+ };
124
+ //# sourceMappingURL=listScreenshotComparisons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listScreenshotComparisons.js","sourceRoot":"","sources":["../../../src/v1/run/listScreenshotComparisons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,6EAA6E;AAC7E,qCAAqC;AACrC,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAE9C,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAInD,GAKD,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,OAAO,EAAE,CAAC;aACP,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;aACf,GAAG,CAAC,CAAC,CA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,CAAC,CAAC,MAAM,CAAC;QACtB,WAAW,EAAE,CAAC;aACX,KAAK,CAAC,UAAU,CAAC;aACjB,QAAQ,CACP,6DAA6D,2BAA2B,2EAA2E,CACpK;QACH,SAAS,EAAE,CAAC,CAAC,GAAG;aACb,QAAQ,EAAE;aACV,QAAQ,CACP,qGAAqG,CACtG;QACH,SAAS,EAAE,CAAC;aACT,OAAO,EAAE;aACT,QAAQ,CACP,+CAA+C,2BAA2B,8BAA8B,2BAA2B,mEAAmE,CACvM;KACJ,CAAC,CAAC;IAEH,OAAO;QACL,WAAW,EAAE;YACX,eAAe,EAAE,KAAK;YACtB,aAAa,EAAE,KAAK;YACpB,YAAY,EAAE,KAAK;SACpB;QACD,WAAW,EACT,gHAAgH;YAChH,2JAA2J;YAC3J,gIAAgI;YAChI,2FAA2F;YAC3F,mHAAmH;QACrH,KAAK;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,+BAA+B;QACrC,MAAM;KAMP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { z } from "zod";
2
+ import type { PublicIdSchema } from "../ids.js";
3
+ export declare const makeRestoreScreenshotBaselineContract: <RunId extends PublicIdSchema>(ids: {
4
+ [key: string]: unknown;
5
+ run: RunId;
6
+ }) => {
7
+ readonly annotations: {
8
+ readonly destructiveHint: true;
9
+ readonly openWorldHint: false;
10
+ readonly readOnlyHint: false;
11
+ };
12
+ readonly description: string;
13
+ readonly input: z.ZodObject<{
14
+ baselineChangeId: z.ZodString;
15
+ chatSessionId: z.ZodOptional<z.ZodString>;
16
+ runId: RunId;
17
+ }, z.core.$strip>;
18
+ readonly kind: "write";
19
+ readonly name: "run.restoreScreenshotBaseline";
20
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
21
+ name: z.ZodString;
22
+ outcome: z.ZodLiteral<"restored">;
23
+ }, z.core.$strip>, z.ZodObject<{
24
+ outcome: z.ZodLiteral<"baseline-changed">;
25
+ }, z.core.$strip>, z.ZodObject<{
26
+ outcome: z.ZodLiteral<"needs-dispute">;
27
+ }, z.core.$strip>, z.ZodObject<{
28
+ outcome: z.ZodLiteral<"not-investigation-session">;
29
+ }, z.core.$strip>, z.ZodObject<{
30
+ outcome: z.ZodLiteral<"nothing-to-restore">;
31
+ }, z.core.$strip>], "outcome">;
32
+ };
33
+ //# sourceMappingURL=restoreScreenshotBaseline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restoreScreenshotBaseline.d.ts","sourceRoot":"","sources":["../../../src/v1/run/restoreScreenshotBaseline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAIhD,eAAO,MAAM,qCAAqC,GAChD,KAAK,SAAS,cAAc,EAC5B,KAAK;IACL,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,GAAG,EAAE,KAAK,CAAC;CACZ;;;;;;;;;;;;;;;;;;;;;;;;;;CAyEA,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { z } from "zod";
2
+ import { investigationSessionId } from "./investigationSessionId.js";
3
+ export const makeRestoreScreenshotBaselineContract = (ids) => {
4
+ const input = z.object({
5
+ baselineChangeId: z
6
+ .string()
7
+ .trim()
8
+ .min(1)
9
+ .max(100)
10
+ .describe("The baseline change to undo, as `run.acceptScreenshotBaseline` returned it for this run."),
11
+ chatSessionId: investigationSessionId.describe("The chat session of the investigation that restores the baseline. A workspace or organization API key acts as an automation, so it must send the session that investigates the run. A person's call ignores it."),
12
+ runId: ids.run,
13
+ });
14
+ const output = z.discriminatedUnion("outcome", [
15
+ z.object({
16
+ name: z.string().describe("The screenshot name whose baseline changed."),
17
+ outcome: z
18
+ .literal("restored")
19
+ .describe("The baseline the change replaced is the baseline again."),
20
+ }),
21
+ z.object({
22
+ outcome: z
23
+ .literal("baseline-changed")
24
+ .describe("The baseline changed again after this change, so restoring it would undo someone else's change. Nothing changed."),
25
+ }),
26
+ z.object({
27
+ outcome: z
28
+ .literal("needs-dispute")
29
+ .describe("Only a person can restore this change, unless a person disputed the finding that made it. Nothing changed."),
30
+ }),
31
+ z.object({
32
+ outcome: z
33
+ .literal("not-investigation-session")
34
+ .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."),
35
+ }),
36
+ z.object({
37
+ outcome: z
38
+ .literal("nothing-to-restore")
39
+ .describe("The change was already restored, the name had no baseline before it, or the kept copy of the old baseline is missing or is not the baseline the change replaced. Nothing changed."),
40
+ }),
41
+ ]);
42
+ return {
43
+ annotations: {
44
+ destructiveHint: true,
45
+ openWorldHint: false,
46
+ readOnlyHint: false,
47
+ },
48
+ description: "Undo a screenshot baseline change that accepted a failed comparison of the run: put back the baseline it replaced, so later runs compare with the old baseline again. " +
49
+ "Use it when a person disputes a baseline the AI accepted. " +
50
+ "Refuses without changing anything when the baseline changed again since.",
51
+ input,
52
+ kind: "write",
53
+ name: "run.restoreScreenshotBaseline",
54
+ output,
55
+ };
56
+ };
57
+ //# sourceMappingURL=restoreScreenshotBaseline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restoreScreenshotBaseline.js","sourceRoot":"","sources":["../../../src/v1/run/restoreScreenshotBaseline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAEnD,GAGD,EAAE,EAAE;IACH,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;QACrB,gBAAgB,EAAE,CAAC;aAChB,MAAM,EAAE;aACR,IAAI,EAAE;aACN,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,GAAG,CAAC;aACR,QAAQ,CACP,0FAA0F,CAC3F;QACH,aAAa,EAAE,sBAAsB,CAAC,QA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ZodISODateTime;
159
159
  id: import("zod").ZodUUID;
160
160
  mode: import("zod").ZodEnum<{
161
- manual: "manual";
162
161
  automatic: "automatic";
162
+ manual: "manual";
163
163
  }>;
164
164
  runIds: import("zod").ZodArray<import("zod").ZodString>;
165
165
  runnerId: import("zod").ZodString;
@@ -175,8 +175,8 @@ export declare const makeRunnerContracts: <FlowId extends PublicIdSchema, Worksp
175
175
  active: import("zod").ZodOptional<import("zod").ZodObject<{
176
176
  id: import("zod").ZodUUID;
177
177
  mode: import("zod").ZodEnum<{
178
- manual: "manual";
179
178
  automatic: "automatic";
179
+ manual: "manual";
180
180
  }>;
181
181
  startedAt: import("zod").ZodISODateTime;
182
182
  }, import("zod/v4/core").$strip>>;
@@ -222,8 +222,8 @@ export declare const makeRunnerContracts: <FlowId extends PublicIdSchema, Worksp
222
222
  endedAt: import("zod").ZodISODateTime;
223
223
  id: import("zod").ZodUUID;
224
224
  mode: import("zod").ZodEnum<{
225
- manual: "manual";
226
225
  automatic: "automatic";
226
+ manual: "manual";
227
227
  }>;
228
228
  runIds: import("zod").ZodArray<import("zod").ZodString>;
229
229
  runnerId: import("zod").ZodString;