@molecule/api-ai-tools 1.10.2 → 1.10.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/README.md +177 -3
- package/dist/command-position.d.ts.map +1 -1
- package/dist/command-position.js +86 -14
- package/dist/cut-run.d.ts +9 -1
- package/dist/cut-run.d.ts.map +1 -1
- package/dist/cut-run.js +19 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/inline-script.d.ts +49 -0
- package/dist/inline-script.d.ts.map +1 -0
- package/dist/inline-script.js +115 -0
- package/dist/no-test-run.d.ts +3 -1
- package/dist/no-test-run.d.ts.map +1 -1
- package/dist/no-test-run.js +114 -3
- package/dist/schemas.js +2 -2
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +192 -78
- package/dist/trace-artifacts.d.ts +55 -0
- package/dist/trace-artifacts.d.ts.map +1 -1
- package/dist/trace-artifacts.js +259 -9
- package/dist/types.d.ts +10 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utilities.d.ts +34 -0
- package/dist/utilities.d.ts.map +1 -1
- package/dist/utilities.js +56 -0
- package/package.json +1 -1
package/dist/trace-artifacts.js
CHANGED
|
@@ -236,6 +236,121 @@ function waitedTextOf(message) {
|
|
|
236
236
|
return quoted(/Expected(?: string)?:\\s*(["'])((?:(?!\\1).)*)\\1/)
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
+
// The attributes of one serialized element's opening tag (\`class="a b" id="c"\`). The trace's
|
|
240
|
+
// snapshots carry them as an object already; the ASSERTION's error prints the tag as text.
|
|
241
|
+
function attrsOf(source) {
|
|
242
|
+
const out = {}
|
|
243
|
+
const pattern = /([A-Za-z_:][-A-Za-z0-9_:.]*)\\s*=\\s*("([^"]*)"|'([^']*)')/g
|
|
244
|
+
let match
|
|
245
|
+
while ((match = pattern.exec(String(source || ''))) !== null)
|
|
246
|
+
out[match[1].toLowerCase()] = match[3] !== undefined ? match[3] : match[4]
|
|
247
|
+
return out
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// Whether a serialized subtree carries text of its own. A text node is a string; an element is
|
|
251
|
+
// \`[tag, attrs, …children]\`. A reference to an earlier snapshot is not followed here: the caller
|
|
252
|
+
// only makes a claim when every child is readable in place.
|
|
253
|
+
function subtreeText(node) {
|
|
254
|
+
if (typeof node === 'string') return node.trim() !== ''
|
|
255
|
+
if (!Array.isArray(node) || Array.isArray(node[0]) || typeof node[0] !== 'string') return false
|
|
256
|
+
for (let i = 2; i < node.length; i++) if (subtreeText(node[i])) return true
|
|
257
|
+
return false
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// Whether any child is a REFERENCE to an earlier snapshot (\`[[snapshotIndex, nodeIndex]]\`).
|
|
261
|
+
// Playwright stores an unchanged subtree that way, so an element with a reference child has
|
|
262
|
+
// content this reader cannot see — and no "no text, no children" claim may be made about it.
|
|
263
|
+
function hasReferenceChild(node) {
|
|
264
|
+
if (!Array.isArray(node)) return false
|
|
265
|
+
for (let i = 2; i < node.length; i++) {
|
|
266
|
+
const child = node[i]
|
|
267
|
+
if (Array.isArray(child) && Array.isArray(child[0])) return true
|
|
268
|
+
}
|
|
269
|
+
return false
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// The serialized element children of a node, in document order (references skipped).
|
|
273
|
+
function elementChildren(node) {
|
|
274
|
+
const out = []
|
|
275
|
+
if (!Array.isArray(node)) return out
|
|
276
|
+
for (let i = 2; i < node.length; i++) {
|
|
277
|
+
const child = node[i]
|
|
278
|
+
if (typeof child === 'string' || !Array.isArray(child)) continue
|
|
279
|
+
if (Array.isArray(child[0]) || typeof child[0] !== 'string') continue
|
|
280
|
+
out.push(child)
|
|
281
|
+
}
|
|
282
|
+
return out
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// The first element in a serialized DOM tree with this tag and (when given) id or first class.
|
|
286
|
+
// Playwright's snapshot serializes elements as \`[tag, attrs, …children]\`.
|
|
287
|
+
function findElement(node, tag, id, cls) {
|
|
288
|
+
if (typeof node === 'string' || !Array.isArray(node)) return null
|
|
289
|
+
if (Array.isArray(node[0]) || typeof node[0] !== 'string') return null
|
|
290
|
+
if (node[0].toLowerCase() === tag) {
|
|
291
|
+
const attrs = node[1] && typeof node[1] === 'object' ? node[1] : {}
|
|
292
|
+
const idMatch = id === '' || String(attrs.id || '') === id
|
|
293
|
+
const classes = String(attrs.class || attrs.className || '').split(/\\s+/)
|
|
294
|
+
const classMatch = id !== '' || cls === '' || classes.indexOf(cls) !== -1
|
|
295
|
+
if (idMatch && classMatch) return node
|
|
296
|
+
}
|
|
297
|
+
for (let i = 2; i < node.length; i++) {
|
|
298
|
+
const deeper = findElement(node[i], tag, id, cls)
|
|
299
|
+
if (deeper !== null) return deeper
|
|
300
|
+
}
|
|
301
|
+
return null
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// A locator that RESOLVED whose box Playwright calls hidden. Playwright reports "hidden" for an
|
|
305
|
+
// element with a zero-size box even when it is painted, so the interesting question is why the
|
|
306
|
+
// box is empty — and the trace's own frame snapshot carries the element's children, the only
|
|
307
|
+
// evidence the run would otherwise have to probe for (xr-molecule-flash-m197: \`a.navbar-brand\`
|
|
308
|
+
// was 0x4 px because its only child was an <img> with no CSS size, and the note said only that
|
|
309
|
+
// "the cause is in the page"; the run spent 4.5 minutes rasterising an SVG to PNG).
|
|
310
|
+
// Only what the snapshot proves is reported: an inline display:none/visibility:hidden, a lone
|
|
311
|
+
// <img> child, or a textless element with no children. Anything else says nothing.
|
|
312
|
+
function hiddenBoxOf(message, frames) {
|
|
313
|
+
if (!message) return null
|
|
314
|
+
const text = String(message).replace(/\\u001b\\[[0-9;]*m/g, '')
|
|
315
|
+
if (text.indexOf('strict mode violation') !== -1) return null
|
|
316
|
+
if (!/Received:\\s*hidden/.test(text) && text.indexOf('element is not visible') === -1) return null
|
|
317
|
+
const resolved = /locator resolved to <([A-Za-z][\\w:-]*)((?:[^>"']|"[^"]*"|'[^']*')*)>/.exec(text)
|
|
318
|
+
if (resolved === null) return null
|
|
319
|
+
const tag = resolved[1].toLowerCase()
|
|
320
|
+
const attrs = attrsOf(resolved[2])
|
|
321
|
+
const id = attrs.id || ''
|
|
322
|
+
const cls = String(attrs.class || attrs.className || '').split(/\\s+/).filter(Boolean)[0] || ''
|
|
323
|
+
const named = /Locator:\\s*([^\\n]+)/.exec(text)
|
|
324
|
+
const reading = {
|
|
325
|
+
locator: named !== null ? named[1].trim() : cls ? tag + '.' + cls : tag,
|
|
326
|
+
tag: tag,
|
|
327
|
+
}
|
|
328
|
+
const snapshot = frames.length > 0 ? frames[frames.length - 1].snapshot : null
|
|
329
|
+
const node = snapshot === null || snapshot === undefined ? null : findElement(snapshot, tag, id, cls)
|
|
330
|
+
if (node === null) return null
|
|
331
|
+
const own = node[1] && typeof node[1] === 'object' ? node[1] : {}
|
|
332
|
+
if (typeof own.style === 'string' && own.style) reading.style = own.style.slice(0, 160)
|
|
333
|
+
if (!subtreeText(node) && !hasReferenceChild(node)) {
|
|
334
|
+
const children = elementChildren(node)
|
|
335
|
+
if (children.length === 1 && children[0][0].toLowerCase() === 'img') {
|
|
336
|
+
const image = children[0][1] && typeof children[0][1] === 'object' ? children[0][1] : {}
|
|
337
|
+
reading.image = {}
|
|
338
|
+
for (const key of ['src', 'width', 'height', 'style', 'alt']) {
|
|
339
|
+
if (typeof image[key] === 'string' && image[key])
|
|
340
|
+
reading.image[key] = image[key].slice(0, 120)
|
|
341
|
+
}
|
|
342
|
+
if (typeof image.class === 'string' && image.class) reading.image.className = image.class.slice(0, 120)
|
|
343
|
+
} else if (children.length === 0) {
|
|
344
|
+
reading.empty = true
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
const hiddenStyle = /(?:^|;)\\s*display\\s*:\\s*none|(?:^|;)\\s*visibility\\s*:\\s*hidden/.test(
|
|
348
|
+
typeof own.style === 'string' ? own.style : '',
|
|
349
|
+
)
|
|
350
|
+
if (!reading.image && !reading.empty && !hiddenStyle) return null
|
|
351
|
+
return reading
|
|
352
|
+
}
|
|
353
|
+
|
|
239
354
|
// A request/response body exactly as Playwright stored it: inline on the value, or in a resource
|
|
240
355
|
// entry the value names. Bounded, and binary is dropped — a JSON body is what this is for, and a
|
|
241
356
|
// multipart upload would print bytes.
|
|
@@ -892,6 +1007,10 @@ for (const one of found.slice(0, MAX_TRACES)) {
|
|
|
892
1007
|
}
|
|
893
1008
|
}
|
|
894
1009
|
}
|
|
1010
|
+
// A visibility failure whose element RESOLVED but has an empty box: the snapshot's own DOM says
|
|
1011
|
+
// what the element is made of, so the note names the cause instead of sending the run at the
|
|
1012
|
+
// selector (m197 — an <img> with no CSS size collapsed inside its link).
|
|
1013
|
+
const hiddenBox = hiddenBoxOf(failedError, frames)
|
|
895
1014
|
function wire(r) {
|
|
896
1015
|
return {
|
|
897
1016
|
method: r.method,
|
|
@@ -1112,7 +1231,13 @@ for (const one of found.slice(0, MAX_TRACES)) {
|
|
|
1112
1231
|
const specific = consoleErrors.filter(function (text) { return !/^Failed to load resource/.test(text) })
|
|
1113
1232
|
const keptConsole = specific.concat(consoleSignals, consoleWarnings)
|
|
1114
1233
|
if (specific.length === 0) keptConsole.push.apply(keptConsole, consoleErrors)
|
|
1115
|
-
if (
|
|
1234
|
+
if (
|
|
1235
|
+
chosen.length === 0 &&
|
|
1236
|
+
keptConsole.length === 0 &&
|
|
1237
|
+
actions.length === 0 &&
|
|
1238
|
+
hiddenBox === null
|
|
1239
|
+
)
|
|
1240
|
+
continue
|
|
1116
1241
|
process.stdout.write('TRACE ' + JSON.stringify({
|
|
1117
1242
|
dir: path.relative(ROOT, path.dirname(one.file)),
|
|
1118
1243
|
spec: spec,
|
|
@@ -1125,6 +1250,7 @@ for (const one of found.slice(0, MAX_TRACES)) {
|
|
|
1125
1250
|
requests: chosen.slice(0, MAX_REQUESTS),
|
|
1126
1251
|
...(missingText === null ? {} : { missingText: missingText }),
|
|
1127
1252
|
...(readContradiction === null ? {} : { readContradiction: readContradiction }),
|
|
1253
|
+
...(hiddenBox === null ? {} : { hiddenBox: hiddenBox }),
|
|
1128
1254
|
console: keptConsole.slice(0, MAX_CONSOLE).map(function (text) { return text.slice(0, 300) }),
|
|
1129
1255
|
actions: actions.slice(-MAX_ACTIONS),
|
|
1130
1256
|
...(unattributed ? { unattributed: true } : {}),
|
|
@@ -1207,6 +1333,45 @@ function parseReadContradiction(value) {
|
|
|
1207
1333
|
return null;
|
|
1208
1334
|
return { field: raw.field, writeValue: raw.writeValue, readValue: raw.readValue, write, read };
|
|
1209
1335
|
}
|
|
1336
|
+
/**
|
|
1337
|
+
* One `hiddenBox` out of a `TRACE` line's json, or null when the value is not one.
|
|
1338
|
+
*
|
|
1339
|
+
* The locator and tag are required; the image/empty/style detail is optional evidence, kept only
|
|
1340
|
+
* in the shape the script wrote it.
|
|
1341
|
+
*
|
|
1342
|
+
* @param value - The line's `hiddenBox`.
|
|
1343
|
+
* @returns The element the failed locator resolved to, or null.
|
|
1344
|
+
*/
|
|
1345
|
+
function parseHiddenBox(value) {
|
|
1346
|
+
if (typeof value !== 'object' || value === null)
|
|
1347
|
+
return null;
|
|
1348
|
+
const raw = value;
|
|
1349
|
+
if (typeof raw.locator !== 'string' || raw.locator === '')
|
|
1350
|
+
return null;
|
|
1351
|
+
if (typeof raw.tag !== 'string' || raw.tag === '')
|
|
1352
|
+
return null;
|
|
1353
|
+
// An `image` that parses to no attributes is still the fact that the element wraps an <img>:
|
|
1354
|
+
// its presence is the evidence, so an empty object stays.
|
|
1355
|
+
const image = typeof raw.image === 'object' && raw.image !== null
|
|
1356
|
+
? (() => {
|
|
1357
|
+
const at = raw.image;
|
|
1358
|
+
const out = {};
|
|
1359
|
+
for (const key of ['src', 'width', 'height', 'style', 'className', 'alt']) {
|
|
1360
|
+
const field = at[key];
|
|
1361
|
+
if (typeof field === 'string' && field !== '')
|
|
1362
|
+
out[key] = field;
|
|
1363
|
+
}
|
|
1364
|
+
return out;
|
|
1365
|
+
})()
|
|
1366
|
+
: null;
|
|
1367
|
+
return {
|
|
1368
|
+
locator: raw.locator,
|
|
1369
|
+
tag: raw.tag,
|
|
1370
|
+
...(typeof raw.style === 'string' && raw.style ? { style: raw.style } : {}),
|
|
1371
|
+
...(image === null ? {} : { image }),
|
|
1372
|
+
...(raw.empty === true ? { empty: true } : {}),
|
|
1373
|
+
};
|
|
1374
|
+
}
|
|
1210
1375
|
/**
|
|
1211
1376
|
* One `lastAction` out of a `TRACE` line's json, or null when the value is not one.
|
|
1212
1377
|
*
|
|
@@ -1254,6 +1419,7 @@ export function parseTraceArtifacts(stdout) {
|
|
|
1254
1419
|
const lastAction = parseLastAction(raw.lastAction);
|
|
1255
1420
|
const missingText = parseMissingText(raw.missingText);
|
|
1256
1421
|
const readContradiction = parseReadContradiction(raw.readContradiction);
|
|
1422
|
+
const hiddenBox = parseHiddenBox(raw.hiddenBox);
|
|
1257
1423
|
const otherContexts = Array.isArray(raw.otherContexts)
|
|
1258
1424
|
? raw.otherContexts
|
|
1259
1425
|
.filter((c) => typeof c === 'object' && c !== null)
|
|
@@ -1291,6 +1457,7 @@ export function parseTraceArtifacts(stdout) {
|
|
|
1291
1457
|
...(raw.unattributed === true ? { unattributed: true } : {}),
|
|
1292
1458
|
...(missingText === null ? {} : { missingText }),
|
|
1293
1459
|
...(readContradiction === null ? {} : { readContradiction }),
|
|
1460
|
+
...(hiddenBox === null ? {} : { hiddenBox }),
|
|
1294
1461
|
});
|
|
1295
1462
|
}
|
|
1296
1463
|
catch (_error) {
|
|
@@ -1709,7 +1876,12 @@ function stalledNavigation(item, report) {
|
|
|
1709
1876
|
* @returns True when the trace holds a request or console line worth a row.
|
|
1710
1877
|
*/
|
|
1711
1878
|
function traceRowEvidence(item, report) {
|
|
1712
|
-
return (
|
|
1879
|
+
return (
|
|
1880
|
+
// A hidden-locator reading is evidence of its own: a page that made no app request can still
|
|
1881
|
+
// have resolved the locator into an empty box, and that is the whole cause (m197's shape on a
|
|
1882
|
+
// static page).
|
|
1883
|
+
item.hiddenBox !== undefined ||
|
|
1884
|
+
item.console.length > 0 ||
|
|
1713
1885
|
item.requests.some((request) => !isStaticAssetRequest(request) && !unansweredRequest(request)) ||
|
|
1714
1886
|
// The one shape in which a subresource with no response IS the cause: the navigation the
|
|
1715
1887
|
// runner reported was still running at the end (see {@link stalledNavigation}).
|
|
@@ -2452,6 +2624,72 @@ function consoleLine(text) {
|
|
|
2452
2624
|
return (`${url} answered the app's index.html, not a font — the file is missing from ` +
|
|
2453
2625
|
`\`app/public/\` (or the asset import); copy/import it`);
|
|
2454
2626
|
}
|
|
2627
|
+
/** An `<img>` as the failure snapshot recorded it, for the note's sentence. */
|
|
2628
|
+
function imageMarkup(image) {
|
|
2629
|
+
const attrs = [
|
|
2630
|
+
image.src === undefined ? '' : `src="${image.src}"`,
|
|
2631
|
+
image.alt === undefined ? '' : `alt="${image.alt}"`,
|
|
2632
|
+
image.width === undefined ? '' : `width="${image.width}"`,
|
|
2633
|
+
image.height === undefined ? '' : `height="${image.height}"`,
|
|
2634
|
+
image.className === undefined ? '' : `class="${image.className}"`,
|
|
2635
|
+
image.style === undefined ? '' : `style="${image.style}"`,
|
|
2636
|
+
].filter(Boolean);
|
|
2637
|
+
return `<img${attrs.length > 0 ? ` ${attrs.join(' ')}` : ''}>`;
|
|
2638
|
+
}
|
|
2639
|
+
/** Whether an image's CSS (its class or inline style) declares a width or height. */
|
|
2640
|
+
const IMAGE_SIZE_RULE = /(?:^|;)\s*(?:width|height|max-width|max-height)\s*:/;
|
|
2641
|
+
const HIDING_RULE = /(?:^|;)\s*(?:display\s*:\s*none|visibility\s*:\s*hidden)/;
|
|
2642
|
+
/**
|
|
2643
|
+
* The sentence a "hidden" visibility failure earns when the trace proved WHY the box is empty.
|
|
2644
|
+
*
|
|
2645
|
+
* Playwright calls an element with a zero-size box hidden even when it is painted, so the answer
|
|
2646
|
+
* is in the element's children. `a.navbar-brand` on xr-molecule-flash-m197 was 0×4 px because its
|
|
2647
|
+
* only child was `<img src="/conduit-logo.svg" height="26">`: an SVG with a `viewBox` and no
|
|
2648
|
+
* width/height has no intrinsic size, and the `height` attribute loses to Tailwind's preflight
|
|
2649
|
+
* (`img { max-width: 100%; height: auto }`), which the scaffold's own `index.css` imports. The
|
|
2650
|
+
* note said only "the cause is in the page", and the run spent over four minutes rasterising an
|
|
2651
|
+
* SVG to PNG. Only what the snapshot shows is claimed ({@link TraceHiddenBox}).
|
|
2652
|
+
*
|
|
2653
|
+
* @param items - The traces {@link parseTraceArtifacts} read.
|
|
2654
|
+
* @returns The sentence, or null when no failure carries a hidden-box reading.
|
|
2655
|
+
*/
|
|
2656
|
+
export function hiddenBoxNote(items) {
|
|
2657
|
+
const box = items.find((item) => item.hiddenBox !== undefined)?.hiddenBox;
|
|
2658
|
+
if (box === undefined)
|
|
2659
|
+
return null;
|
|
2660
|
+
const element = `\`${box.locator}\``;
|
|
2661
|
+
// An inline hiding rule is the direct cause whatever the element contains.
|
|
2662
|
+
if (box.style !== undefined && HIDING_RULE.test(box.style)) {
|
|
2663
|
+
return (`${element} resolved but Playwright calls it hidden: its own inline style sets ` +
|
|
2664
|
+
`\`${box.style}\`. Remove that declaration (or the rule that sets it) so the element has a box.`);
|
|
2665
|
+
}
|
|
2666
|
+
if (box.image !== undefined) {
|
|
2667
|
+
const image = box.image;
|
|
2668
|
+
const shown = imageMarkup(image);
|
|
2669
|
+
const sized = image.className !== undefined ||
|
|
2670
|
+
(image.style !== undefined && IMAGE_SIZE_RULE.test(image.style));
|
|
2671
|
+
if (sized) {
|
|
2672
|
+
const rule = image.className === undefined ? 'its inline size' : `\`${image.className}\``;
|
|
2673
|
+
return (`${element} resolved but Playwright calls it hidden: its box has no size, and its only ` +
|
|
2674
|
+
`content is ${shown}. That image declares a size (${rule}), so the rule is not applying ` +
|
|
2675
|
+
`on this page — check that the stylesheet defining it is actually loaded (a supplied ` +
|
|
2676
|
+
`theme has to be linked in index.html, not only imported) and that the class name is ` +
|
|
2677
|
+
`spelled the way the theme defines it.`);
|
|
2678
|
+
}
|
|
2679
|
+
return (`${element} resolved but Playwright calls it hidden: the element's box is empty, and its ` +
|
|
2680
|
+
`only content is ${shown} — an image with no CSS size. An <img> takes its size from CSS or ` +
|
|
2681
|
+
`from the file; an SVG that declares only a viewBox has no intrinsic size, and a ` +
|
|
2682
|
+
`width/height ATTRIBUTE loses to any stylesheet rule (Tailwind's preflight, which the ` +
|
|
2683
|
+
`scaffold's index.css imports, sets img { max-width: 100%; height: auto }). Give the image a ` +
|
|
2684
|
+
`CSS width/height — a class the supplied theme already defines for it, or ` +
|
|
2685
|
+
`style={{ height: … }} — rather than changing the SVG or rasterising it to PNG.`);
|
|
2686
|
+
}
|
|
2687
|
+
if (box.empty === true) {
|
|
2688
|
+
return (`${element} resolved but Playwright calls it hidden: the element has no text and no ` +
|
|
2689
|
+
`children, so its box has zero size. Give it content or an explicit width/height.`);
|
|
2690
|
+
}
|
|
2691
|
+
return null;
|
|
2692
|
+
}
|
|
2455
2693
|
/**
|
|
2456
2694
|
* The note a failed suite run's result carries: what each failing test's page actually sent, and
|
|
2457
2695
|
* what came back.
|
|
@@ -2590,6 +2828,10 @@ export function failureTraceNote(items, target, earlierFailures = [], apiPrefixe
|
|
|
2590
2828
|
const wrapped = traced.some((item) => item.requests.some((request) => request.sent !== undefined && wrappedInData(request.sent)));
|
|
2591
2829
|
// The "one of these requests failing" answer is only honest when a listed request really failed.
|
|
2592
2830
|
const anyFailed = traced.some((item) => item.requests.some(failedRequest));
|
|
2831
|
+
// A visibility failure the trace's own snapshot explains: said instead of the generic
|
|
2832
|
+
// "the cause is in the page" sentence, which m197 read as "go look at the page" and then spent
|
|
2833
|
+
// four minutes rasterising an SVG ({@link hiddenBoxNote}).
|
|
2834
|
+
const hiddenBox = hiddenBoxNote(traced);
|
|
2593
2835
|
// m145's shape: the app's HTTP client lost its base URL, so every API call reached the page
|
|
2594
2836
|
// origin without the prefix the app mounts its routes under. The prefix is READ — the caller's
|
|
2595
2837
|
// client config plus what the traces show — never assumed to be `/api`.
|
|
@@ -2780,6 +3022,10 @@ export function failureTraceNote(items, target, earlierFailures = [], apiPrefixe
|
|
|
2780
3022
|
: 'another browser context the test opened';
|
|
2781
3023
|
parts.push(`${label}: ${context.requests.slice(0, 2).map(requestLine).join('; ')}`);
|
|
2782
3024
|
}
|
|
3025
|
+
// A trace whose only evidence is the hidden-box reading keeps a row that says so, rather than
|
|
3026
|
+
// an em dash and nothing (a static page's assertion failure has no request to print).
|
|
3027
|
+
if (parts.length === 0 && item.hiddenBox !== undefined)
|
|
3028
|
+
parts.push('the failing assertion resolved its locator and Playwright calls the element hidden');
|
|
2783
3029
|
rows.push(` ${index + 1}. ${failureWhereOf(item, failures)} — ${parts.join(' — ')}`);
|
|
2784
3030
|
}
|
|
2785
3031
|
// Distinct locations the note did not name: the repeats collapse, so the count is what is left
|
|
@@ -2954,13 +3200,17 @@ export function failureTraceNote(items, target, earlierFailures = [], apiPrefixe
|
|
|
2954
3200
|
'action sent no request at all, so there is no response to read. The page changed ' +
|
|
2955
3201
|
'route and fetched nothing, which is why it still shows the previous route’s data: ' +
|
|
2956
3202
|
'fix how the page reads the route, not the selector.'
|
|
2957
|
-
:
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
'
|
|
2962
|
-
|
|
2963
|
-
|
|
3203
|
+
: hiddenBox !== null
|
|
3204
|
+
? // The trace's own snapshot explains why the element Playwright resolved has no box:
|
|
3205
|
+
// a fact about the element, so it replaces the "look at the page" advice (m197).
|
|
3206
|
+
hiddenBox
|
|
3207
|
+
: 'No listed request failed — none got a 4xx/5xx or a network error — so the cause is in the ' +
|
|
3208
|
+
"page, not the API. Start with what the test's last action sent (the first line of each " +
|
|
3209
|
+
'row) and what the page did next: a request that answered (2xx included) while the page ' +
|
|
3210
|
+
'still did not show the state the assertion waited on is the fact to read — its status ' +
|
|
3211
|
+
'and response body, not the selector. If the request is not the one the test meant — an ' +
|
|
3212
|
+
'unfollow sent where the test clicked follow — the state the action read was stale ' +
|
|
3213
|
+
'before it.') +
|
|
2964
3214
|
prefixAdvice +
|
|
2965
3215
|
(wrapped
|
|
2966
3216
|
? ' The API received a body wrapped in `data`: app-http’s `post(url, data, config)` / ' +
|
package/dist/types.d.ts
CHANGED
|
@@ -220,6 +220,16 @@ export interface ToolBuildConfig {
|
|
|
220
220
|
* @returns The flags, the derived config and the sentence, or null when nothing is put back.
|
|
221
221
|
*/
|
|
222
222
|
suiteBudget?: (command: string, cwd: string) => Promise<SuiteBudgetPin | null | undefined>;
|
|
223
|
+
/**
|
|
224
|
+
* A whole walk's duration in ms, as the consumer measured it. A suite run the executor detached
|
|
225
|
+
* whose own `timeout` is shorter than this is lifted (m200); unset lifts only a bound no longer
|
|
226
|
+
* than this tool's ceiling.
|
|
227
|
+
*
|
|
228
|
+
* @param command - The suite command.
|
|
229
|
+
* @param cwd - The run's working directory.
|
|
230
|
+
* @returns The duration in ms, or null.
|
|
231
|
+
*/
|
|
232
|
+
suiteRunMs?: (command: string, cwd: string) => Promise<number | null | undefined>;
|
|
223
233
|
/** Post-write hook (e.g. auto-format via Prettier/ESLint). Called after every write_file/edit_file. */
|
|
224
234
|
onAfterWrite?: (path: string) => Promise<void>;
|
|
225
235
|
/** Diff tracking callback. Called before writes with old/new content. */
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yFAAyF;IACzF,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAE5B;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;IAEzB,6CAA6C;IAC7C,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAEvC,qEAAqE;IACrE,SAA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CAAC,EAAE,MAAM,EAAE,CAAA;IAEjB,kFAAkF;IAClF,gBAAgB,CAAC,EAAE,UAAU,EAAE,CAAA;IAE/B,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;CAC1B"}
|
package/dist/utilities.d.ts
CHANGED
|
@@ -477,6 +477,40 @@ export declare function isOutsideRoot(path: string, projectRoot: string): boolea
|
|
|
477
477
|
* @returns `true` when the pattern contains only allowed characters.
|
|
478
478
|
*/
|
|
479
479
|
export declare function isValidGlob(pattern: string): boolean;
|
|
480
|
+
/**
|
|
481
|
+
* The most alternatives one brace group may expand to. The point is to accept
|
|
482
|
+
* the ordinary multi-extension form a model writes from habit
|
|
483
|
+
* (`*.{ts,tsx,yml,json,md}`), not to grow a glob engine: a group is bounded so
|
|
484
|
+
* a pattern cannot turn one search into hundreds.
|
|
485
|
+
*/
|
|
486
|
+
export declare const MAX_BRACE_GLOB_ALTERNATIVES = 16;
|
|
487
|
+
/**
|
|
488
|
+
* The accepted brace form, named in every refusal so a refusal teaches the
|
|
489
|
+
* syntax rather than only reporting that the value was wrong.
|
|
490
|
+
*/
|
|
491
|
+
export declare const BRACE_GLOB_HINT: string;
|
|
492
|
+
/**
|
|
493
|
+
* Expand ONE level of brace alternatives in a glob pattern, validating every
|
|
494
|
+
* expanded pattern.
|
|
495
|
+
*
|
|
496
|
+
* Neither search tool expands braces itself: `grep --include` and `find` take
|
|
497
|
+
* the pattern as a single shell-quoted argument, so no shell ever sees it.
|
|
498
|
+
* `find_files {pattern:"*.{ts,tsx}"}` and `search_files {include:"*.{ts,tsx}"}`
|
|
499
|
+
* were both refused outright (xr-molecule-flash-m199 and m189), costing a round
|
|
500
|
+
* trip and pushing the agent to a narrower search. The group is expanded here
|
|
501
|
+
* instead — `search_files` passes one `--include` per alternative and
|
|
502
|
+
* `find_files` ORs one `-name`/`-path` predicate per alternative.
|
|
503
|
+
*
|
|
504
|
+
* Bounded on purpose: one level of braces, alternatives split on `,`, at most
|
|
505
|
+
* {@link MAX_BRACE_GLOB_ALTERNATIVES}, none empty, and each EXPANDED pattern
|
|
506
|
+
* must still pass {@link isValidGlob} — so a shell metacharacter in any
|
|
507
|
+
* alternative (`*.{ts,$(rm)}`) is refused exactly as a bare one is.
|
|
508
|
+
*
|
|
509
|
+
* @param pattern - The user-supplied glob.
|
|
510
|
+
* @returns Every pattern the value expands to, or null when it is not accepted
|
|
511
|
+
* (the caller reports its tool's glob error).
|
|
512
|
+
*/
|
|
513
|
+
export declare function expandBraceGlob(pattern: string): string[] | null;
|
|
480
514
|
/**
|
|
481
515
|
* The `find` predicate for a `find_files` pattern.
|
|
482
516
|
*
|
package/dist/utilities.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../src/utilities.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAE3E,OAAO,EACL,KAAK,mBAAmB,EAExB,KAAK,aAAa,EAMnB,MAAM,oBAAoB,CAAA;AAE3B;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAS5C;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,GAAG,MAAM,KAAG,MAEE,CAAA;AAuGhD;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAK/C;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAErD;AAKD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAsCzD;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGnD;AAED;;;;;;;;GAQG;AACH,wBAAgB,q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B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAgBvC"}
|
package/dist/utilities.js
CHANGED
|
@@ -1314,6 +1314,62 @@ export function isValidGlob(pattern) {
|
|
|
1314
1314
|
// `@` has no meaning to either.
|
|
1315
1315
|
return /^[A-Za-z0-9@*?._/()[\]-]+$/.test(pattern);
|
|
1316
1316
|
}
|
|
1317
|
+
/**
|
|
1318
|
+
* The most alternatives one brace group may expand to. The point is to accept
|
|
1319
|
+
* the ordinary multi-extension form a model writes from habit
|
|
1320
|
+
* (`*.{ts,tsx,yml,json,md}`), not to grow a glob engine: a group is bounded so
|
|
1321
|
+
* a pattern cannot turn one search into hundreds.
|
|
1322
|
+
*/
|
|
1323
|
+
export const MAX_BRACE_GLOB_ALTERNATIVES = 16;
|
|
1324
|
+
/**
|
|
1325
|
+
* The accepted brace form, named in every refusal so a refusal teaches the
|
|
1326
|
+
* syntax rather than only reporting that the value was wrong.
|
|
1327
|
+
*/
|
|
1328
|
+
export const BRACE_GLOB_HINT = `or one brace group of up to ${MAX_BRACE_GLOB_ALTERNATIVES} comma-separated ` +
|
|
1329
|
+
'alternatives such as *.{ts,tsx}.';
|
|
1330
|
+
/**
|
|
1331
|
+
* Expand ONE level of brace alternatives in a glob pattern, validating every
|
|
1332
|
+
* expanded pattern.
|
|
1333
|
+
*
|
|
1334
|
+
* Neither search tool expands braces itself: `grep --include` and `find` take
|
|
1335
|
+
* the pattern as a single shell-quoted argument, so no shell ever sees it.
|
|
1336
|
+
* `find_files {pattern:"*.{ts,tsx}"}` and `search_files {include:"*.{ts,tsx}"}`
|
|
1337
|
+
* were both refused outright (xr-molecule-flash-m199 and m189), costing a round
|
|
1338
|
+
* trip and pushing the agent to a narrower search. The group is expanded here
|
|
1339
|
+
* instead — `search_files` passes one `--include` per alternative and
|
|
1340
|
+
* `find_files` ORs one `-name`/`-path` predicate per alternative.
|
|
1341
|
+
*
|
|
1342
|
+
* Bounded on purpose: one level of braces, alternatives split on `,`, at most
|
|
1343
|
+
* {@link MAX_BRACE_GLOB_ALTERNATIVES}, none empty, and each EXPANDED pattern
|
|
1344
|
+
* must still pass {@link isValidGlob} — so a shell metacharacter in any
|
|
1345
|
+
* alternative (`*.{ts,$(rm)}`) is refused exactly as a bare one is.
|
|
1346
|
+
*
|
|
1347
|
+
* @param pattern - The user-supplied glob.
|
|
1348
|
+
* @returns Every pattern the value expands to, or null when it is not accepted
|
|
1349
|
+
* (the caller reports its tool's glob error).
|
|
1350
|
+
*/
|
|
1351
|
+
export function expandBraceGlob(pattern) {
|
|
1352
|
+
const open = pattern.indexOf('{');
|
|
1353
|
+
if (open === -1)
|
|
1354
|
+
return isValidGlob(pattern) ? [pattern] : null;
|
|
1355
|
+
const close = pattern.indexOf('}', open + 1);
|
|
1356
|
+
if (close === -1)
|
|
1357
|
+
return null;
|
|
1358
|
+
// One level only: a second `{` before the close or a second `}` after it is a
|
|
1359
|
+
// nested/malformed group, not an alternative.
|
|
1360
|
+
const nextOpen = pattern.indexOf('{', open + 1);
|
|
1361
|
+
if (nextOpen !== -1 && nextOpen < close)
|
|
1362
|
+
return null;
|
|
1363
|
+
if (pattern.indexOf('}', close + 1) !== -1)
|
|
1364
|
+
return null;
|
|
1365
|
+
const alternatives = pattern.slice(open + 1, close).split(',');
|
|
1366
|
+
if (alternatives.length > MAX_BRACE_GLOB_ALTERNATIVES)
|
|
1367
|
+
return null;
|
|
1368
|
+
if (alternatives.some((alt) => alt.length === 0))
|
|
1369
|
+
return null;
|
|
1370
|
+
const expanded = alternatives.map((alt) => `${pattern.slice(0, open)}${alt}${pattern.slice(close + 1)}`);
|
|
1371
|
+
return expanded.every((p) => isValidGlob(p)) ? expanded : null;
|
|
1372
|
+
}
|
|
1317
1373
|
/**
|
|
1318
1374
|
* The `find` predicate for a `find_files` pattern.
|
|
1319
1375
|
*
|