squally-mcp 0.8.4 → 0.9.1

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/openapi.d.ts CHANGED
@@ -69,7 +69,8 @@ export declare function toolParameters(operation: OpenApiOperation): OpenApiPara
69
69
  * agent as "there are no runs on that branch".
70
70
  *
71
71
  * Descriptions come from the document except for those in
72
- * PARAMETER_DESCRIPTIONS - see there for why those cannot - and the parameters
72
+ * OPERATION_PARAMETER_DESCRIPTIONS and PARAMETER_DESCRIPTIONS - see there for
73
+ * why those cannot - and the parameters
73
74
  * in OMITTED_PARAMETERS are not offered at all.
74
75
  */
75
76
  export declare function inputSchemaFor(operation: OpenApiOperation): JsonSchema;
package/dist/openapi.js CHANGED
@@ -111,6 +111,41 @@ const PARAMETER_DESCRIPTIONS = {
111
111
  cursor: "Opaque. Pass nextCursor from the previous answer for the next page of older runs. " +
112
112
  "Without a cursor the newest runs come first.",
113
113
  };
114
+ /**
115
+ * Per operation, where one parameter name means two things (0.9.0, API
116
+ * 1.0.0-beta.19). Read before PARAMETER_DESCRIPTIONS.
117
+ *
118
+ * testName: the run's attempts route still takes a test's stored name - one
119
+ * Playwright project's variant, "chromium > cart.spec.ts > adds" - while the
120
+ * test metrics route takes the test across its projects, the name WITHOUT the
121
+ * project, as squally-list-tests lists it. One text for both would send the
122
+ * name squally-list-tests gives to squally-debug-failure, which answers
123
+ * test_not_found for it. Both keep the no-encoding sentence above.
124
+ *
125
+ * project on listTests: the document says "repeat the parameter" - URL
126
+ * syntax. A tool argument is a list; src/api.ts repeats it.
127
+ */
128
+ const OPERATION_PARAMETER_DESCRIPTIONS = {
129
+ getRunTestAttempts: {
130
+ testName: "The test's name exactly as squally-get-run lists it - with its Playwright project when it " +
131
+ 'has one, for example "chromium > checkout flow > completes payment": one project\'s ' +
132
+ "variant, the way a run counts. Pass the name exactly as shown in Squally; do not " +
133
+ "URL-encode, the server does. A name used in several spec files also needs filePath.",
134
+ },
135
+ getTestMetrics: {
136
+ testName: "The test's name WITHOUT its Playwright project, as squally-list-tests lists it - for " +
137
+ 'example "checkout flow > completes payment" - counts the test across all its projects. ' +
138
+ 'A stored name with its project ("chromium > checkout flow > completes payment", as ' +
139
+ "squally-get-run lists it) still works and counts that project's variant only, like " +
140
+ "project. Pass the name exactly as shown in Squally; do not URL-encode, the server does. " +
141
+ "A name used in several spec files also needs filePath.",
142
+ },
143
+ listTests: {
144
+ project: 'Only these Playwright projects, each exactly as named (e.g. ["chromium"] or ' +
145
+ '["chromium", "firefox"]): each test then counts only those projects\' variants. ' +
146
+ "Every project when absent.",
147
+ },
148
+ };
114
149
  /**
115
150
  * Parameters of an operation that its tool does NOT offer - a deliberate
116
151
  * deviation from the OpenAPI document, like PARAMETER_DESCRIPTIONS above.
@@ -158,7 +193,8 @@ export function toolParameters(operation) {
158
193
  * agent as "there are no runs on that branch".
159
194
  *
160
195
  * Descriptions come from the document except for those in
161
- * PARAMETER_DESCRIPTIONS - see there for why those cannot - and the parameters
196
+ * OPERATION_PARAMETER_DESCRIPTIONS and PARAMETER_DESCRIPTIONS - see there for
197
+ * why those cannot - and the parameters
162
198
  * in OMITTED_PARAMETERS are not offered at all.
163
199
  */
164
200
  export function inputSchemaFor(operation) {
@@ -166,7 +202,8 @@ export function inputSchemaFor(operation) {
166
202
  const required = [];
167
203
  for (const parameter of toolParameters(operation)) {
168
204
  const { description, ...rest } = parameter.schema;
169
- const override = PARAMETER_DESCRIPTIONS[parameter.name];
205
+ const override = OPERATION_PARAMETER_DESCRIPTIONS[operation.operationId]?.[parameter.name] ??
206
+ PARAMETER_DESCRIPTIONS[parameter.name];
170
207
  const text = override ?? parameter.description ?? description;
171
208
  properties[parameter.name] = text === undefined ? { ...rest } : { ...rest, description: text };
172
209
  if (parameter.required)
package/dist/tools.js CHANGED
@@ -27,7 +27,8 @@ export const TOOLS = [
27
27
  "status or source (all by default; ci or local narrows it, and each run says local). Status " +
28
28
  "is passed, failed, cancelled, incomplete or running; settled is false while the run can " +
29
29
  "still change. One row per logical run: a sharded run is collapsed into a single entry, its " +
30
- "counters over all its shards; each job of a CI run that sets a job key is its own run " +
30
+ "counters over all its shards and per Playwright project variant, like Playwright - a test " +
31
+ "that ran in chromium and firefox counts twice; each job of a CI run that sets a job key is its own run " +
31
32
  "(jobKey). attempt and rerunOf say which attempt of its CI run it is and which run it " +
32
33
  "re-ran; ciRunUrl links the CI run. Returns summary counters only; use squally-get-run for " +
33
34
  "the per-test rows.",
@@ -38,7 +39,9 @@ export const TOOLS = [
38
39
  name: "squally-get-run",
39
40
  title: "Get one run",
40
41
  operationId: "getRun",
41
- description: "One run with its per-test result rows, across every shard. Use this to find out which " +
42
+ description: "One run with its per-test result rows, across every shard - one row per Playwright project " +
43
+ "variant, like Playwright: a test that ran in chromium and firefox is two rows, each named " +
44
+ 'with its project ("chromium > cart.spec.ts > adds"). Use this to find out which ' +
42
45
  "test is red in a run; the run list carries only the counters. Its status is cancelled " +
43
46
  "for a cancelled run (cancellation says how and when), and local says it ran without CI. " +
44
47
  "Like squally-find-run it carries settled, jobKey, attempt, rerunOf and ciRunUrl - for a " +
@@ -52,9 +55,10 @@ export const TOOLS = [
52
55
  name: "squally-debug-failure",
53
56
  title: "Debug a failing test",
54
57
  operationId: "getRunTestAttempts",
55
- description: "Every attempt of one test in one run, oldest first, each with the error, the stack and " +
56
- "the full-context prompt (the same text Copy the full context puts on the clipboard in " +
57
- "Squally's Debug with AI panel), and the test's annotations (an issue link, a skip or fixme " +
58
+ description: "Every attempt of one test in one run - one Playwright project variant, by the name " +
59
+ "squally-get-run lists, project included - oldest first, each with the error, the stack and " +
60
+ "the full-context prompt (the same text Squally's Fix panel copies under Fix in your agent, " +
61
+ "Without MCP), and the test's annotations (an issue link, a skip or fixme " +
58
62
  "reason), its line, worker and start time. This is the " +
59
63
  "tool for 'why did this test fail'. If the test name is ambiguous, pass filePath.",
60
64
  answers: "Every attempt of one test in one run: error, stack, full-context prompt.",
@@ -64,9 +68,16 @@ export const TOOLS = [
64
68
  name: "squally-get-test-metrics",
65
69
  title: "Get one test's metrics",
66
70
  operationId: "getTestMetrics",
67
- description: "One test's numbers over a period: runs, stability (runs that passed on the first try " +
71
+ description: "One test's numbers over a period, the test once across its Playwright projects: by its " +
72
+ "name without the project, as squally-list-tests lists it, every project counts (projects " +
73
+ "names them, variants carries each project's own numbers); project, or a stored name with " +
74
+ "its project as squally-get-run lists it, counts that project's variant only. A run counts " +
75
+ "as failed when the test failed in any project, and as passed only after a retry when it " +
76
+ "did so in some project and failed in none. " +
77
+ "runs, stability (runs that passed on the first try " +
68
78
  "/ runs), flakyRate (runs that passed only after a retry / runs), failureRate (failed " +
69
- "runs / runs), time lost to retries and failures, its last 20 runs (each with the run " +
79
+ "runs / runs), time lost to retries and failures, the median duration (per run the " +
80
+ "slowest project), its last 20 runs (each with the run " +
70
81
  "id squally-find-run gives; runs it skipped included, as result \"skipped\" - shown, " +
71
82
  "never counted in runs or any rate) and the branches it ran on. Counts the finished " +
72
83
  "runs of the period, CI and local - a sharded run counts once, by its first shard's start - " +
@@ -78,19 +89,22 @@ export const TOOLS = [
78
89
  "is no verdict - the tool returns the numbers and you judge them. runs = 0 " +
79
90
  "with null rates is a valid answer: no counted run of this test in the period. " +
80
91
  "Cheap; for one test use this, not squally-list-tests.",
81
- answers: "One test's stability, flaky rate and failure rate over a period.",
92
+ answers: "One test's stability, flaky rate and failure rate over a period, across its Playwright projects.",
82
93
  cost: "cheap",
83
94
  },
84
95
  {
85
96
  name: "squally-list-tests",
86
97
  title: "List tests",
87
98
  operationId: "listTests",
88
- description: "Every test with a counted run in the period, CI and local (source=ci or source=local narrows it), with the same numbers per test as " +
89
- "squally-get-test-metrics - runs, stability, flakyRate, failureRate, time lost - ranked " +
99
+ description: "Every test with a counted run in the period, CI and local (source=ci or source=local narrows it), " +
100
+ "one row per test across its Playwright projects - testName is the name without the " +
101
+ "project, projects names them and variants carries each project's own numbers; project " +
102
+ "(a list) counts only those projects - with the same numbers per test as " +
103
+ "squally-get-test-metrics - runs, stability, flakyRate, failureRate, time lost, median duration - ranked " +
90
104
  "worst first by the chosen sort (default: lowest stability). There is no verdict and no " +
91
105
  "status - the tool labels no test; you judge the numbers. Moderate - two queries over " +
92
106
  "the period, paged; for a single test use squally-get-test-metrics.",
93
- answers: "Every test with a run in the period, ranked by stability, flaky rate or failures.",
107
+ answers: "Every test with a run in the period, once across its Playwright projects, ranked by stability, flaky rate or failures.",
94
108
  cost: "cheap",
95
109
  },
96
110
  {
@@ -101,10 +115,13 @@ export const TOOLS = [
101
115
  "often and how recently each occurred. Answers 'is this failure one instance of something " +
102
116
  "that keeps happening' - a grouping no agent can compute from the repository alone. " +
103
117
  "Counts finished runs, CI and local, by default (source=ci or source=local for one of them), a sharded run " +
104
- "once, mass-failure runs included. failedRunCount and flakyRunCount say how the runs " +
118
+ "once, mass-failure runs included. Each test counts once across its Playwright projects: " +
119
+ "testCount and testNames (names without the project) are tests, projects names the " +
120
+ "projects the error hit. failedRunCount and flakyRunCount say how the runs " +
105
121
  "ended: runs in which a test the error hit failed, and runs in which none failed and " +
106
122
  "one passed only after a retry. failedCount and flakyCount count (run, test) pairs " +
107
- "instead - a run in which the error failed three tests counts three times there.",
123
+ "instead - a test once per run however many of its projects the error hit, and a run " +
124
+ "in which the error failed three tests counts three times there.",
108
125
  answers: "Error signatures in a period: what keeps failing, grouped, and how its runs ended.",
109
126
  cost: "cheap",
110
127
  },
package/dist/validate.js CHANGED
@@ -58,6 +58,11 @@ function forParameter(schema) {
58
58
  return integerSchema(schema);
59
59
  case "boolean":
60
60
  return z.boolean();
61
+ // 0.9.0: squally-list-tests' `project` is the first list parameter (API
62
+ // 1.0.0-beta.19, repeatable in the URL). Unread, a list fell through to
63
+ // the string case and ["chromium"] was refused as "expected string".
64
+ case "array":
65
+ return z.array(forParameter((schema["items"] ?? {})));
61
66
  case "string":
62
67
  default:
63
68
  return stringSchema(schema);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squally-mcp",
3
- "version": "0.8.4",
3
+ "version": "0.9.1",
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",