squally-mcp 0.8.2 → 0.8.4

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/api.d.ts CHANGED
@@ -16,6 +16,11 @@ export type ApiFailure = {
16
16
  message: string | null;
17
17
  /** The API's stable slug, when it sent a body. */
18
18
  code: string | null;
19
+ /**
20
+ * `x-vercel-mitigated`, when Vercel's firewall in front of the API stopped
21
+ * the request itself (0.8.3): "challenge" or "deny", otherwise null.
22
+ */
23
+ mitigated: "challenge" | "deny" | null;
19
24
  };
20
25
  /** The request never reached the API, or the answer was not JSON. */
21
26
  export type ApiUnreachable = {
package/dist/api.js CHANGED
@@ -1,6 +1,16 @@
1
1
  import { errorCauses } from "./diagnostics.js";
2
2
  /** Set by the API from 7 days before the key expires (OpenAPI components.headers). */
3
3
  export const KEY_EXPIRY_HEADER = "Squally-Key-Expires-At";
4
+ /**
5
+ * Vercel's firewall answering instead of the API (0.8.3). Measured 30.10.2026:
6
+ * this server's Node fetch got 403 with `x-vercel-mitigated: challenge` and
7
+ * Vercel's own `{"error":{"code":"challenge"}}` while curl with the same key
8
+ * got 200 - a temporary mitigation for one machine, not a refusal of the key.
9
+ */
10
+ function edgeMitigation(headers) {
11
+ const value = (headers.get("x-vercel-mitigated") ?? "").trim().toLowerCase();
12
+ return value === "challenge" || value === "deny" ? value : null;
13
+ }
4
14
  /**
5
15
  * Query parameters for which an EMPTY STRING is a value, not an absence.
6
16
  *
@@ -113,5 +123,5 @@ export async function callOperation(config, operation, args, fetcher = fetch) {
113
123
  catch {
114
124
  // Left null; the caller has a sentence for every status either way.
115
125
  }
116
- return { kind: "failure", status: response.status, message, code };
126
+ return { kind: "failure", status: response.status, message, code, mitigated: edgeMitigation(response.headers) };
117
127
  }
@@ -934,6 +934,13 @@
934
934
  "shard": {
935
935
  "index": 1,
936
936
  "runId": "b1e0c6d2-7a43-4f19-8d5e-0c3a9e6f2b71"
937
+ },
938
+ "annotations": [
939
+ "issue"
940
+ ],
941
+ "location": {
942
+ "line": 41,
943
+ "column": 5
937
944
  }
938
945
  },
939
946
  {
@@ -950,6 +957,11 @@
950
957
  "shard": {
951
958
  "index": 2,
952
959
  "runId": "e4a9d3f0-2b6c-4178-a5d1-9f0e3c7b8a26"
960
+ },
961
+ "annotations": [],
962
+ "location": {
963
+ "line": 18,
964
+ "column": 3
953
965
  }
954
966
  }
955
967
  ]
@@ -1253,7 +1265,22 @@
1253
1265
  "shard": {
1254
1266
  "index": 1,
1255
1267
  "runId": "b1e0c6d2-7a43-4f19-8d5e-0c3a9e6f2b71"
1256
- }
1268
+ },
1269
+ "annotations": [
1270
+ {
1271
+ "type": "issue",
1272
+ "description": "https://github.com/example-shop/storefront/issues/412",
1273
+ "location": "tests/checkout.spec.ts:41:5"
1274
+ }
1275
+ ],
1276
+ "annotationsOmitted": 0,
1277
+ "location": {
1278
+ "line": 41,
1279
+ "column": 5
1280
+ },
1281
+ "workerIndex": 2,
1282
+ "parallelIndex": 2,
1283
+ "startedAt": "2026-10-30T09:14:07.412Z"
1257
1284
  },
1258
1285
  {
1259
1286
  "retry": 1,
@@ -1268,7 +1295,22 @@
1268
1295
  "shard": {
1269
1296
  "index": 1,
1270
1297
  "runId": "b1e0c6d2-7a43-4f19-8d5e-0c3a9e6f2b71"
1271
- }
1298
+ },
1299
+ "annotations": [
1300
+ {
1301
+ "type": "issue",
1302
+ "description": "https://github.com/example-shop/storefront/issues/412",
1303
+ "location": "tests/checkout.spec.ts:41:5"
1304
+ }
1305
+ ],
1306
+ "annotationsOmitted": 0,
1307
+ "location": {
1308
+ "line": 41,
1309
+ "column": 5
1310
+ },
1311
+ "workerIndex": 5,
1312
+ "parallelIndex": 2,
1313
+ "startedAt": "2026-10-30T09:14:14.180Z"
1272
1314
  }
1273
1315
  ]
1274
1316
  }
@@ -5378,6 +5420,43 @@
5378
5420
  }
5379
5421
  ],
5380
5422
  "description": "The shard the test's final attempt ran in; null for an unsharded run. One row per test since 1.0.0-beta.12 - a test reported from two shards was one row per shard before."
5423
+ },
5424
+ "annotations": {
5425
+ "type": "array",
5426
+ "items": {
5427
+ "type": "string"
5428
+ },
5429
+ "description": "The final attempt's annotation types (Playwright's test.info().annotations), in the order they were added - types only; descriptions are on the attempts endpoint. Empty when there are none, and for a result from a reporter before 0.19.0."
5430
+ },
5431
+ "location": {
5432
+ "anyOf": [
5433
+ {
5434
+ "type": "object",
5435
+ "properties": {
5436
+ "line": {
5437
+ "type": "integer"
5438
+ },
5439
+ "column": {
5440
+ "anyOf": [
5441
+ {
5442
+ "type": "integer"
5443
+ },
5444
+ {
5445
+ "type": "null"
5446
+ }
5447
+ ]
5448
+ }
5449
+ },
5450
+ "required": [
5451
+ "line",
5452
+ "column"
5453
+ ]
5454
+ },
5455
+ {
5456
+ "type": "null"
5457
+ }
5458
+ ],
5459
+ "description": "Where the test is declared in its file (Playwright's TestCase.location) - the file is filePath. null for a result from a reporter before 0.19.0."
5381
5460
  }
5382
5461
  },
5383
5462
  "required": [
@@ -5391,7 +5470,9 @@
5391
5470
  "browserName",
5392
5471
  "timedOut",
5393
5472
  "timeoutMs",
5394
- "shard"
5473
+ "shard",
5474
+ "annotations",
5475
+ "location"
5395
5476
  ]
5396
5477
  }
5397
5478
  }
@@ -5617,6 +5698,105 @@
5617
5698
  }
5618
5699
  ],
5619
5700
  "description": "The shard this attempt ran in; null for an unsharded run."
5701
+ },
5702
+ "annotations": {
5703
+ "type": "array",
5704
+ "items": {
5705
+ "type": "object",
5706
+ "properties": {
5707
+ "type": {
5708
+ "type": "string"
5709
+ },
5710
+ "description": {
5711
+ "description": "As the test wrote it, with secrets masked the way error text is; at most 1000 characters.",
5712
+ "type": [
5713
+ "string",
5714
+ "null"
5715
+ ]
5716
+ },
5717
+ "location": {
5718
+ "description": "Where the annotation was added, file:line[:column]; null when Playwright did not say.",
5719
+ "type": [
5720
+ "string",
5721
+ "null"
5722
+ ]
5723
+ }
5724
+ },
5725
+ "required": [
5726
+ "type",
5727
+ "description",
5728
+ "location"
5729
+ ]
5730
+ },
5731
+ "description": "This attempt's annotations (Playwright's test.info().annotations), in the order they were added - at most 20. Empty when there are none, and for a result from a reporter before 0.19.0."
5732
+ },
5733
+ "annotationsOmitted": {
5734
+ "type": "integer",
5735
+ "description": "How many annotations past the 20 the reporter did not send."
5736
+ },
5737
+ "location": {
5738
+ "anyOf": [
5739
+ {
5740
+ "type": "object",
5741
+ "properties": {
5742
+ "line": {
5743
+ "type": "integer"
5744
+ },
5745
+ "column": {
5746
+ "anyOf": [
5747
+ {
5748
+ "type": "integer"
5749
+ },
5750
+ {
5751
+ "type": "null"
5752
+ }
5753
+ ]
5754
+ }
5755
+ },
5756
+ "required": [
5757
+ "line",
5758
+ "column"
5759
+ ]
5760
+ },
5761
+ {
5762
+ "type": "null"
5763
+ }
5764
+ ],
5765
+ "description": "Where the test is declared in its file (Playwright's TestCase.location) - the file is filePath. null for a result from a reporter before 0.19.0."
5766
+ },
5767
+ "workerIndex": {
5768
+ "anyOf": [
5769
+ {
5770
+ "type": "integer"
5771
+ },
5772
+ {
5773
+ "type": "null"
5774
+ }
5775
+ ],
5776
+ "description": "The Playwright worker that ran this attempt (workerIndex). null for a result from a reporter before 0.19.0."
5777
+ },
5778
+ "parallelIndex": {
5779
+ "anyOf": [
5780
+ {
5781
+ "type": "integer"
5782
+ },
5783
+ {
5784
+ "type": "null"
5785
+ }
5786
+ ],
5787
+ "description": "The worker's slot, 0 to workers - 1 (parallelIndex); a restarted worker keeps it. null for a result from a reporter before 0.19.0."
5788
+ },
5789
+ "startedAt": {
5790
+ "anyOf": [
5791
+ {
5792
+ "type": "string",
5793
+ "format": "date-time"
5794
+ },
5795
+ {
5796
+ "type": "null"
5797
+ }
5798
+ ],
5799
+ "description": "When this attempt started. null for a result from a reporter before 0.19.0, and when the runner's clock put it more than a day before the run or in the future."
5620
5800
  }
5621
5801
  },
5622
5802
  "required": [
@@ -5629,7 +5809,13 @@
5629
5809
  "browserName",
5630
5810
  "errors",
5631
5811
  "copyPrompt",
5632
- "shard"
5812
+ "shard",
5813
+ "annotations",
5814
+ "annotationsOmitted",
5815
+ "location",
5816
+ "workerIndex",
5817
+ "parallelIndex",
5818
+ "startedAt"
5633
5819
  ]
5634
5820
  }
5635
5821
  }
package/dist/result.d.ts CHANGED
@@ -3,6 +3,14 @@ import type { ApiFailure, ApiResult, ApiUnreachable } from "./api.js";
3
3
  import type { ErrorCode } from "./openapi.js";
4
4
  /** The one message for a rate limit, which arrives without a body. */
5
5
  export declare const RATE_LIMITED_TEXT = "Rate limited - wait 60 seconds, then retry.";
6
+ /**
7
+ * Vercel's firewall stopped the request (0.8.3): 403 with
8
+ * `x-vercel-mitigated`. Until 0.8.2 this read "The Squally API answered HTTP
9
+ * 403." and nothing else - which sends an agent and its user after the key.
10
+ * One retry after a wait, not a loop: retrying into the challenge is what
11
+ * keeps it going.
12
+ */
13
+ export declare function edgeMitigatedText(mitigated: "challenge" | "deny"): string;
6
14
  /**
7
15
  * The line appended when the key is within 7 days of expiring.
8
16
  *
package/dist/result.js CHANGED
@@ -1,6 +1,18 @@
1
1
  import { describeFailure } from "./diagnostics.js";
2
2
  /** The one message for a rate limit, which arrives without a body. */
3
3
  export const RATE_LIMITED_TEXT = "Rate limited - wait 60 seconds, then retry.";
4
+ /**
5
+ * Vercel's firewall stopped the request (0.8.3): 403 with
6
+ * `x-vercel-mitigated`. Until 0.8.2 this read "The Squally API answered HTTP
7
+ * 403." and nothing else - which sends an agent and its user after the key.
8
+ * One retry after a wait, not a loop: retrying into the challenge is what
9
+ * keeps it going.
10
+ */
11
+ export function edgeMitigatedText(mitigated) {
12
+ return (`Vercel's firewall in front of Squally ${mitigated === "deny" ? "blocked" : "challenged"} this request ` +
13
+ `(HTTP 403, x-vercel-mitigated: ${mitigated}). This is not a key problem - the key was not checked. ` +
14
+ "Wait a few minutes, then retry once; do not retry in a loop. If it persists, tell the user.");
15
+ }
4
16
  function text(value) {
5
17
  return { type: "text", text: value };
6
18
  }
@@ -55,6 +67,11 @@ export function failureResult(failure, errorCodes) {
55
67
  if (failure.status === 429) {
56
68
  return { content: [text(RATE_LIMITED_TEXT)], isError: true };
57
69
  }
70
+ // Before the API's own 403s (organization_deleted, tier_too_low): those
71
+ // come without the header and keep their sentence and action.
72
+ if (failure.status === 403 && failure.mitigated !== null) {
73
+ return { content: [text(edgeMitigatedText(failure.mitigated))], isError: true };
74
+ }
58
75
  const known = failure.code ? errorCodes.get(failure.code) : undefined;
59
76
  const lines = [];
60
77
  lines.push(failure.message ?? `The Squally API answered HTTP ${failure.status}.`);
package/dist/tools.js CHANGED
@@ -54,7 +54,8 @@ export const TOOLS = [
54
54
  operationId: "getRunTestAttempts",
55
55
  description: "Every attempt of one test in one run, oldest first, each with the error, the stack and " +
56
56
  "the full-context prompt (the same text Copy the full context puts on the clipboard in " +
57
- "Squally's Debug with AI panel). This is the " +
57
+ "Squally's Debug with AI panel), and the test's annotations (an issue link, a skip or fixme " +
58
+ "reason), its line, worker and start time. This is the " +
58
59
  "tool for 'why did this test fail'. If the test name is ambiguous, pass filePath.",
59
60
  answers: "Every attempt of one test in one run: error, stack, full-context prompt.",
60
61
  cost: "cheap",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squally-mcp",
3
- "version": "0.8.2",
3
+ "version": "0.8.4",
4
4
  "description": "Local MCP server for Squally — read-only access to your Playwright test runs, flaky tests and failures.",
5
5
  "license": "MIT",
6
6
  "author": "Squally",