@riddledc/riddle-proof 0.7.167 → 0.7.169
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 +6 -3
- package/dist/{chunk-UZZA33AX.js → chunk-25XFUIIC.js} +114 -0
- package/dist/cli.cjs +140 -1
- package/dist/cli.js +27 -2
- package/dist/index.cjs +114 -0
- package/dist/index.js +1 -1
- package/dist/profile.cjs +114 -0
- package/dist/profile.js +1 -1
- package/dist/proof-run-engine.d.cts +3 -3
- package/dist/proof-run-engine.d.ts +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -497,9 +497,12 @@ sequences include `clicked_total` and `clicked_truncated`; the compact `clicked`
|
|
|
497
497
|
list keeps the first and last clicked targets so later route switches and reset
|
|
498
498
|
actions stay visible. Click actions with `click_count` greater than `1` are
|
|
499
499
|
included in clicked-target evidence and rolled up as `click_count_action_total`
|
|
500
|
-
and `click_count_value_total`.
|
|
501
|
-
|
|
502
|
-
|
|
500
|
+
and `click_count_value_total`. Repeated selector runs such as long gameplay
|
|
501
|
+
button loops are also grouped as compact `same-selector` click-sequence
|
|
502
|
+
receipts with click totals and ordinals. Setup receipt sampling favors both
|
|
503
|
+
first and last per-viewport receipts before filling remaining space, so late
|
|
504
|
+
lifecycle phases such as terminal or restart remain visible in compact
|
|
505
|
+
summaries.
|
|
503
506
|
|
|
504
507
|
`target.timeout_sec` is optional. Use it for known-heavy profile targets so the
|
|
505
508
|
profile carries its own hosted Riddle worker budget; an explicit CLI `--timeout`
|
|
@@ -624,6 +624,57 @@ function profileSetupCanvasSignatureStableHashGroups(results) {
|
|
|
624
624
|
}
|
|
625
625
|
return warnings;
|
|
626
626
|
}
|
|
627
|
+
function profileSetupClickSequenceReceipts(clickedItems) {
|
|
628
|
+
const nthChildPattern = /:nth-child\((\d+)\)/;
|
|
629
|
+
const nthChildTemplatePattern = /:nth-child\(\d+\)/g;
|
|
630
|
+
const groups = /* @__PURE__ */ new Map();
|
|
631
|
+
for (const item of clickedItems) {
|
|
632
|
+
const selector = stringValue(item.selector);
|
|
633
|
+
if (!selector) continue;
|
|
634
|
+
const frameSelector = stringValue(item.frame_selector);
|
|
635
|
+
const clickCountValue = numberValue(item.click_count);
|
|
636
|
+
const clickCount = clickCountValue === void 0 ? 1 : Math.max(1, Math.min(100, Math.floor(clickCountValue)));
|
|
637
|
+
const ordinal = numberValue(item.ordinal);
|
|
638
|
+
const match = nthChildPattern.exec(selector);
|
|
639
|
+
const selectorTemplate = match ? selector.replace(nthChildTemplatePattern, ":nth-child(*)") : selector;
|
|
640
|
+
const valueSource = match ? "nth-child" : "same-selector";
|
|
641
|
+
const key = `${valueSource}
|
|
642
|
+
${frameSelector || ""}
|
|
643
|
+
${selectorTemplate}`;
|
|
644
|
+
const group = groups.get(key) || {
|
|
645
|
+
selector_template: selectorTemplate,
|
|
646
|
+
frame_selector: frameSelector,
|
|
647
|
+
value_source: valueSource,
|
|
648
|
+
sequence: [],
|
|
649
|
+
ordinals: [],
|
|
650
|
+
result_count: 0,
|
|
651
|
+
click_total: 0
|
|
652
|
+
};
|
|
653
|
+
if (match) {
|
|
654
|
+
const value = Number(match[1]);
|
|
655
|
+
for (let index = 0; index < clickCount; index += 1) group.sequence.push(value);
|
|
656
|
+
}
|
|
657
|
+
if (ordinal !== void 0) group.ordinals.push(ordinal);
|
|
658
|
+
group.result_count += 1;
|
|
659
|
+
group.click_total += clickCount;
|
|
660
|
+
groups.set(key, group);
|
|
661
|
+
}
|
|
662
|
+
return [...groups.values()].filter((group) => group.result_count >= 4).map((group) => {
|
|
663
|
+
const sequence = group.sequence.slice(0, 32);
|
|
664
|
+
const ordinals = group.ordinals.slice(0, 16);
|
|
665
|
+
return {
|
|
666
|
+
selector_template: group.selector_template,
|
|
667
|
+
frame_selector: group.frame_selector ?? null,
|
|
668
|
+
value_source: group.value_source,
|
|
669
|
+
result_count: group.result_count,
|
|
670
|
+
click_total: group.click_total,
|
|
671
|
+
sequence,
|
|
672
|
+
omitted_sequence_count: Math.max(0, group.sequence.length - sequence.length),
|
|
673
|
+
ordinals,
|
|
674
|
+
omitted_ordinal_count: Math.max(0, group.ordinals.length - ordinals.length)
|
|
675
|
+
};
|
|
676
|
+
});
|
|
677
|
+
}
|
|
627
678
|
function sampleProfileSetupSummaryItems(items, limit) {
|
|
628
679
|
if (items.length <= limit) return items;
|
|
629
680
|
const firstCount = Math.floor(limit / 2);
|
|
@@ -683,6 +734,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
|
|
|
683
734
|
};
|
|
684
735
|
});
|
|
685
736
|
const clicked = sampleProfileSetupSummaryItems(clickedItems, 8);
|
|
737
|
+
const clickSequences = profileSetupClickSequenceReceipts(clickedItems);
|
|
738
|
+
const sampledClickSequences = sampleProfileSetupSummaryItems(clickSequences, 6);
|
|
686
739
|
const text_samples = results.filter((result) => result.ok !== false && typeof result.text === "string" && (profileSetupResultAction(result) === "assert_text_visible" || profileSetupResultAction(result) === "assert_text_absent" || profileSetupResultAction(result) === "wait_for_text")).map((result) => ({
|
|
687
740
|
ordinal: result.ordinal ?? null,
|
|
688
741
|
action: profileSetupResultAction(result),
|
|
@@ -704,6 +757,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
|
|
|
704
757
|
setup_screenshots: profileSetupScreenshotLabels(results),
|
|
705
758
|
clicked_total: clickedItems.length,
|
|
706
759
|
clicked_truncated: clickedItems.length > clicked.length,
|
|
760
|
+
click_sequence_total: clickSequences.length,
|
|
761
|
+
click_sequence_truncated: clickSequences.length > sampledClickSequences.length,
|
|
762
|
+
click_sequences: sampledClickSequences,
|
|
707
763
|
click_count_action_total: clickCountValues.length,
|
|
708
764
|
click_count_value_total: clickCountValues.reduce((sum, value) => sum + value, 0),
|
|
709
765
|
window_call_until_total: windowCallUntilReceipts.length,
|
|
@@ -4277,6 +4333,59 @@ function profileSetupCanvasSignatureStableHashGroups(results) {
|
|
|
4277
4333
|
}
|
|
4278
4334
|
return warnings;
|
|
4279
4335
|
}
|
|
4336
|
+
function profileSetupClickSequenceReceipts(clickedItems) {
|
|
4337
|
+
const nthChildPattern = /:nth-child\((\d+)\)/;
|
|
4338
|
+
const nthChildTemplatePattern = /:nth-child\(\d+\)/g;
|
|
4339
|
+
const groups = new Map();
|
|
4340
|
+
for (const item of clickedItems || []) {
|
|
4341
|
+
const selector = typeof item.selector === "string" && item.selector.trim() ? item.selector.trim() : undefined;
|
|
4342
|
+
if (!selector) continue;
|
|
4343
|
+
const frameSelector = typeof item.frame_selector === "string" && item.frame_selector.trim() ? item.frame_selector.trim() : undefined;
|
|
4344
|
+
const clickCountValue = typeof item.click_count === "number" && Number.isFinite(item.click_count) ? item.click_count : undefined;
|
|
4345
|
+
const clickCount = clickCountValue === undefined ? 1 : Math.max(1, Math.min(100, Math.floor(clickCountValue)));
|
|
4346
|
+
const ordinal = typeof item.ordinal === "number" && Number.isFinite(item.ordinal) ? item.ordinal : undefined;
|
|
4347
|
+
const match = nthChildPattern.exec(selector);
|
|
4348
|
+
const selectorTemplate = match
|
|
4349
|
+
? selector.replace(nthChildTemplatePattern, ":nth-child(*)")
|
|
4350
|
+
: selector;
|
|
4351
|
+
const valueSource = match ? "nth-child" : "same-selector";
|
|
4352
|
+
const key = valueSource + "\\n" + String(frameSelector || "") + "\\n" + selectorTemplate;
|
|
4353
|
+
const group = groups.get(key) || {
|
|
4354
|
+
selector_template: selectorTemplate,
|
|
4355
|
+
frame_selector: frameSelector,
|
|
4356
|
+
value_source: valueSource,
|
|
4357
|
+
sequence: [],
|
|
4358
|
+
ordinals: [],
|
|
4359
|
+
result_count: 0,
|
|
4360
|
+
click_total: 0,
|
|
4361
|
+
};
|
|
4362
|
+
if (match) {
|
|
4363
|
+
const value = Number(match[1]);
|
|
4364
|
+
for (let index = 0; index < clickCount; index += 1) group.sequence.push(value);
|
|
4365
|
+
}
|
|
4366
|
+
if (ordinal !== undefined) group.ordinals.push(ordinal);
|
|
4367
|
+
group.result_count += 1;
|
|
4368
|
+
group.click_total += clickCount;
|
|
4369
|
+
groups.set(key, group);
|
|
4370
|
+
}
|
|
4371
|
+
return [...groups.values()]
|
|
4372
|
+
.filter((group) => group.result_count >= 4)
|
|
4373
|
+
.map((group) => {
|
|
4374
|
+
const sequence = group.sequence.slice(0, 32);
|
|
4375
|
+
const ordinals = group.ordinals.slice(0, 16);
|
|
4376
|
+
return {
|
|
4377
|
+
selector_template: group.selector_template,
|
|
4378
|
+
frame_selector: group.frame_selector || null,
|
|
4379
|
+
value_source: group.value_source,
|
|
4380
|
+
result_count: group.result_count,
|
|
4381
|
+
click_total: group.click_total,
|
|
4382
|
+
sequence,
|
|
4383
|
+
omitted_sequence_count: Math.max(0, group.sequence.length - sequence.length),
|
|
4384
|
+
ordinals,
|
|
4385
|
+
omitted_ordinal_count: Math.max(0, group.ordinals.length - ordinals.length),
|
|
4386
|
+
};
|
|
4387
|
+
});
|
|
4388
|
+
}
|
|
4280
4389
|
function sampleProfileSetupSummaryItems(items, limit) {
|
|
4281
4390
|
if ((items || []).length <= limit) return items || [];
|
|
4282
4391
|
const firstCount = Math.floor(limit / 2);
|
|
@@ -4352,6 +4461,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
|
|
|
4352
4461
|
};
|
|
4353
4462
|
});
|
|
4354
4463
|
const clicked = sampleProfileSetupSummaryItems(clickedItems, 8);
|
|
4464
|
+
const clickSequences = profileSetupClickSequenceReceipts(clickedItems);
|
|
4465
|
+
const sampledClickSequences = sampleProfileSetupSummaryItems(clickSequences, 6);
|
|
4355
4466
|
const textSamples = results
|
|
4356
4467
|
.filter((result) => result && result.ok !== false && typeof result.text === "string" && (
|
|
4357
4468
|
profileSetupResultAction(result) === "assert_text_visible"
|
|
@@ -4381,6 +4492,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
|
|
|
4381
4492
|
setup_screenshots: profileSetupScreenshotLabels(results),
|
|
4382
4493
|
clicked_total: clickedItems.length,
|
|
4383
4494
|
clicked_truncated: clickedItems.length > clicked.length,
|
|
4495
|
+
click_sequence_total: clickSequences.length,
|
|
4496
|
+
click_sequence_truncated: clickSequences.length > sampledClickSequences.length,
|
|
4497
|
+
click_sequences: sampledClickSequences,
|
|
4384
4498
|
click_count_action_total: clickCountValues.length,
|
|
4385
4499
|
click_count_value_total: clickCountValues.reduce((sum, value) => sum + value, 0),
|
|
4386
4500
|
window_call_until_total: windowCallUntilReceipts.length,
|
package/dist/cli.cjs
CHANGED
|
@@ -7581,6 +7581,57 @@ function profileSetupCanvasSignatureStableHashGroups(results) {
|
|
|
7581
7581
|
}
|
|
7582
7582
|
return warnings;
|
|
7583
7583
|
}
|
|
7584
|
+
function profileSetupClickSequenceReceipts(clickedItems) {
|
|
7585
|
+
const nthChildPattern = /:nth-child\((\d+)\)/;
|
|
7586
|
+
const nthChildTemplatePattern = /:nth-child\(\d+\)/g;
|
|
7587
|
+
const groups = /* @__PURE__ */ new Map();
|
|
7588
|
+
for (const item of clickedItems) {
|
|
7589
|
+
const selector = stringValue2(item.selector);
|
|
7590
|
+
if (!selector) continue;
|
|
7591
|
+
const frameSelector = stringValue2(item.frame_selector);
|
|
7592
|
+
const clickCountValue = numberValue(item.click_count);
|
|
7593
|
+
const clickCount = clickCountValue === void 0 ? 1 : Math.max(1, Math.min(100, Math.floor(clickCountValue)));
|
|
7594
|
+
const ordinal = numberValue(item.ordinal);
|
|
7595
|
+
const match = nthChildPattern.exec(selector);
|
|
7596
|
+
const selectorTemplate = match ? selector.replace(nthChildTemplatePattern, ":nth-child(*)") : selector;
|
|
7597
|
+
const valueSource = match ? "nth-child" : "same-selector";
|
|
7598
|
+
const key = `${valueSource}
|
|
7599
|
+
${frameSelector || ""}
|
|
7600
|
+
${selectorTemplate}`;
|
|
7601
|
+
const group = groups.get(key) || {
|
|
7602
|
+
selector_template: selectorTemplate,
|
|
7603
|
+
frame_selector: frameSelector,
|
|
7604
|
+
value_source: valueSource,
|
|
7605
|
+
sequence: [],
|
|
7606
|
+
ordinals: [],
|
|
7607
|
+
result_count: 0,
|
|
7608
|
+
click_total: 0
|
|
7609
|
+
};
|
|
7610
|
+
if (match) {
|
|
7611
|
+
const value = Number(match[1]);
|
|
7612
|
+
for (let index = 0; index < clickCount; index += 1) group.sequence.push(value);
|
|
7613
|
+
}
|
|
7614
|
+
if (ordinal !== void 0) group.ordinals.push(ordinal);
|
|
7615
|
+
group.result_count += 1;
|
|
7616
|
+
group.click_total += clickCount;
|
|
7617
|
+
groups.set(key, group);
|
|
7618
|
+
}
|
|
7619
|
+
return [...groups.values()].filter((group) => group.result_count >= 4).map((group) => {
|
|
7620
|
+
const sequence = group.sequence.slice(0, 32);
|
|
7621
|
+
const ordinals = group.ordinals.slice(0, 16);
|
|
7622
|
+
return {
|
|
7623
|
+
selector_template: group.selector_template,
|
|
7624
|
+
frame_selector: group.frame_selector ?? null,
|
|
7625
|
+
value_source: group.value_source,
|
|
7626
|
+
result_count: group.result_count,
|
|
7627
|
+
click_total: group.click_total,
|
|
7628
|
+
sequence,
|
|
7629
|
+
omitted_sequence_count: Math.max(0, group.sequence.length - sequence.length),
|
|
7630
|
+
ordinals,
|
|
7631
|
+
omitted_ordinal_count: Math.max(0, group.ordinals.length - ordinals.length)
|
|
7632
|
+
};
|
|
7633
|
+
});
|
|
7634
|
+
}
|
|
7584
7635
|
function sampleProfileSetupSummaryItems(items, limit) {
|
|
7585
7636
|
if (items.length <= limit) return items;
|
|
7586
7637
|
const firstCount = Math.floor(limit / 2);
|
|
@@ -7640,6 +7691,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
|
|
|
7640
7691
|
};
|
|
7641
7692
|
});
|
|
7642
7693
|
const clicked = sampleProfileSetupSummaryItems(clickedItems, 8);
|
|
7694
|
+
const clickSequences = profileSetupClickSequenceReceipts(clickedItems);
|
|
7695
|
+
const sampledClickSequences = sampleProfileSetupSummaryItems(clickSequences, 6);
|
|
7643
7696
|
const text_samples = results.filter((result) => result.ok !== false && typeof result.text === "string" && (profileSetupResultAction(result) === "assert_text_visible" || profileSetupResultAction(result) === "assert_text_absent" || profileSetupResultAction(result) === "wait_for_text")).map((result) => ({
|
|
7644
7697
|
ordinal: result.ordinal ?? null,
|
|
7645
7698
|
action: profileSetupResultAction(result),
|
|
@@ -7661,6 +7714,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
|
|
|
7661
7714
|
setup_screenshots: profileSetupScreenshotLabels(results),
|
|
7662
7715
|
clicked_total: clickedItems.length,
|
|
7663
7716
|
clicked_truncated: clickedItems.length > clicked.length,
|
|
7717
|
+
click_sequence_total: clickSequences.length,
|
|
7718
|
+
click_sequence_truncated: clickSequences.length > sampledClickSequences.length,
|
|
7719
|
+
click_sequences: sampledClickSequences,
|
|
7664
7720
|
click_count_action_total: clickCountValues.length,
|
|
7665
7721
|
click_count_value_total: clickCountValues.reduce((sum, value) => sum + value, 0),
|
|
7666
7722
|
window_call_until_total: windowCallUntilReceipts.length,
|
|
@@ -11218,6 +11274,59 @@ function profileSetupCanvasSignatureStableHashGroups(results) {
|
|
|
11218
11274
|
}
|
|
11219
11275
|
return warnings;
|
|
11220
11276
|
}
|
|
11277
|
+
function profileSetupClickSequenceReceipts(clickedItems) {
|
|
11278
|
+
const nthChildPattern = /:nth-child\((\d+)\)/;
|
|
11279
|
+
const nthChildTemplatePattern = /:nth-child\(\d+\)/g;
|
|
11280
|
+
const groups = new Map();
|
|
11281
|
+
for (const item of clickedItems || []) {
|
|
11282
|
+
const selector = typeof item.selector === "string" && item.selector.trim() ? item.selector.trim() : undefined;
|
|
11283
|
+
if (!selector) continue;
|
|
11284
|
+
const frameSelector = typeof item.frame_selector === "string" && item.frame_selector.trim() ? item.frame_selector.trim() : undefined;
|
|
11285
|
+
const clickCountValue = typeof item.click_count === "number" && Number.isFinite(item.click_count) ? item.click_count : undefined;
|
|
11286
|
+
const clickCount = clickCountValue === undefined ? 1 : Math.max(1, Math.min(100, Math.floor(clickCountValue)));
|
|
11287
|
+
const ordinal = typeof item.ordinal === "number" && Number.isFinite(item.ordinal) ? item.ordinal : undefined;
|
|
11288
|
+
const match = nthChildPattern.exec(selector);
|
|
11289
|
+
const selectorTemplate = match
|
|
11290
|
+
? selector.replace(nthChildTemplatePattern, ":nth-child(*)")
|
|
11291
|
+
: selector;
|
|
11292
|
+
const valueSource = match ? "nth-child" : "same-selector";
|
|
11293
|
+
const key = valueSource + "\\n" + String(frameSelector || "") + "\\n" + selectorTemplate;
|
|
11294
|
+
const group = groups.get(key) || {
|
|
11295
|
+
selector_template: selectorTemplate,
|
|
11296
|
+
frame_selector: frameSelector,
|
|
11297
|
+
value_source: valueSource,
|
|
11298
|
+
sequence: [],
|
|
11299
|
+
ordinals: [],
|
|
11300
|
+
result_count: 0,
|
|
11301
|
+
click_total: 0,
|
|
11302
|
+
};
|
|
11303
|
+
if (match) {
|
|
11304
|
+
const value = Number(match[1]);
|
|
11305
|
+
for (let index = 0; index < clickCount; index += 1) group.sequence.push(value);
|
|
11306
|
+
}
|
|
11307
|
+
if (ordinal !== undefined) group.ordinals.push(ordinal);
|
|
11308
|
+
group.result_count += 1;
|
|
11309
|
+
group.click_total += clickCount;
|
|
11310
|
+
groups.set(key, group);
|
|
11311
|
+
}
|
|
11312
|
+
return [...groups.values()]
|
|
11313
|
+
.filter((group) => group.result_count >= 4)
|
|
11314
|
+
.map((group) => {
|
|
11315
|
+
const sequence = group.sequence.slice(0, 32);
|
|
11316
|
+
const ordinals = group.ordinals.slice(0, 16);
|
|
11317
|
+
return {
|
|
11318
|
+
selector_template: group.selector_template,
|
|
11319
|
+
frame_selector: group.frame_selector || null,
|
|
11320
|
+
value_source: group.value_source,
|
|
11321
|
+
result_count: group.result_count,
|
|
11322
|
+
click_total: group.click_total,
|
|
11323
|
+
sequence,
|
|
11324
|
+
omitted_sequence_count: Math.max(0, group.sequence.length - sequence.length),
|
|
11325
|
+
ordinals,
|
|
11326
|
+
omitted_ordinal_count: Math.max(0, group.ordinals.length - ordinals.length),
|
|
11327
|
+
};
|
|
11328
|
+
});
|
|
11329
|
+
}
|
|
11221
11330
|
function sampleProfileSetupSummaryItems(items, limit) {
|
|
11222
11331
|
if ((items || []).length <= limit) return items || [];
|
|
11223
11332
|
const firstCount = Math.floor(limit / 2);
|
|
@@ -11293,6 +11402,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
|
|
|
11293
11402
|
};
|
|
11294
11403
|
});
|
|
11295
11404
|
const clicked = sampleProfileSetupSummaryItems(clickedItems, 8);
|
|
11405
|
+
const clickSequences = profileSetupClickSequenceReceipts(clickedItems);
|
|
11406
|
+
const sampledClickSequences = sampleProfileSetupSummaryItems(clickSequences, 6);
|
|
11296
11407
|
const textSamples = results
|
|
11297
11408
|
.filter((result) => result && result.ok !== false && typeof result.text === "string" && (
|
|
11298
11409
|
profileSetupResultAction(result) === "assert_text_visible"
|
|
@@ -11322,6 +11433,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
|
|
|
11322
11433
|
setup_screenshots: profileSetupScreenshotLabels(results),
|
|
11323
11434
|
clicked_total: clickedItems.length,
|
|
11324
11435
|
clicked_truncated: clickedItems.length > clicked.length,
|
|
11436
|
+
click_sequence_total: clickSequences.length,
|
|
11437
|
+
click_sequence_truncated: clickSequences.length > sampledClickSequences.length,
|
|
11438
|
+
click_sequences: sampledClickSequences,
|
|
11325
11439
|
click_count_action_total: clickCountValues.length,
|
|
11326
11440
|
click_count_value_total: clickCountValues.reduce((sum, value) => sum + value, 0),
|
|
11327
11441
|
window_call_until_total: windowCallUntilReceipts.length,
|
|
@@ -15921,6 +16035,7 @@ function profileSetupSummaryMarkdown(result) {
|
|
|
15921
16035
|
return sum + labels.filter((label) => typeof label === "string" && label.trim()).length;
|
|
15922
16036
|
}, 0);
|
|
15923
16037
|
const clickedTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.clicked_total) || 0), 0);
|
|
16038
|
+
const clickSequenceTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.click_sequence_total) || 0), 0);
|
|
15924
16039
|
const clickCountActionTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.click_count_action_total) || 0), 0);
|
|
15925
16040
|
const clickCountValueTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.click_count_value_total) || 0), 0);
|
|
15926
16041
|
const windowCallTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.window_call_total) || 0), 0);
|
|
@@ -15944,6 +16059,9 @@ function profileSetupSummaryMarkdown(result) {
|
|
|
15944
16059
|
if (clickCountActionTotal) {
|
|
15945
16060
|
lines.push(`- click counts: ${clickCountActionTotal} action(s), click_count total ${clickCountValueTotal}`);
|
|
15946
16061
|
}
|
|
16062
|
+
if (clickSequenceTotal) {
|
|
16063
|
+
lines.push(`- click sequences: ${clickSequenceTotal} group(s)`);
|
|
16064
|
+
}
|
|
15947
16065
|
if (windowCallTotal) {
|
|
15948
16066
|
lines.push(`- window_call: ${windowCallTotal} action(s), stored returns ${windowCallStoredTotal}, captured returns ${windowCallCapturedTotal}`);
|
|
15949
16067
|
}
|
|
@@ -15968,6 +16086,7 @@ function profileSetupSummaryMarkdown(result) {
|
|
|
15968
16086
|
const resultCount = cliFiniteNumber(viewport.result_count) || 0;
|
|
15969
16087
|
const screenshotCount = Array.isArray(viewport.setup_screenshots) ? viewport.setup_screenshots.filter((label) => typeof label === "string" && label.trim()).length : 0;
|
|
15970
16088
|
const clicked = cliFiniteNumber(viewport.clicked_total) || 0;
|
|
16089
|
+
const clickSequenceCount = cliFiniteNumber(viewport.click_sequence_total) || 0;
|
|
15971
16090
|
const clickCountActions = cliFiniteNumber(viewport.click_count_action_total) || 0;
|
|
15972
16091
|
const windowCallActions = cliFiniteNumber(viewport.window_call_total) || 0;
|
|
15973
16092
|
const windowCallStored = cliFiniteNumber(viewport.window_call_stored_total) || 0;
|
|
@@ -15981,8 +16100,28 @@ function profileSetupSummaryMarkdown(result) {
|
|
|
15981
16100
|
const dragActions = cliFiniteNumber(viewport.drag_total) || 0;
|
|
15982
16101
|
const canvasSignatureActions = cliFiniteNumber(viewport.canvas_signature_total) || 0;
|
|
15983
16102
|
const observedPath = cliString(viewport.observed_path);
|
|
15984
|
-
lines.push(`- ${name}: ${ok}, ${resultCount} result(s), ${screenshotCount} setup screenshot(s), ${clicked} click(s)${clickCountActions ? `, ${clickCountActions} click_count action(s)` : ""}${rangeValueActions ? `, ${rangeValueActions} set_range_value action(s)` : ""}${dragActions ? `, ${dragActions} drag action(s)` : ""}${canvasSignatureActions ? `, ${canvasSignatureActions} canvas_signature action(s)` : ""}${windowCallActions ? `, ${windowCallActions} window_call action(s), ${windowCallStored} stored return(s), ${windowCallCaptured} captured return(s)` : ""}${windowEvalActions ? `, ${windowEvalActions} window_eval action(s), ${windowEvalStored} stored return(s), ${windowEvalCaptured} captured return(s)` : ""}${windowCallUntilActions ? `, ${windowCallUntilActions} window_call_until action(s), ${windowCallUntilCalls} call(s)` : ""}${observedPath ? `, path ${observedPath}` : ""}`);
|
|
16103
|
+
lines.push(`- ${name}: ${ok}, ${resultCount} result(s), ${screenshotCount} setup screenshot(s), ${clicked} click(s)${clickSequenceCount ? `, ${clickSequenceCount} click sequence(s)` : ""}${clickCountActions ? `, ${clickCountActions} click_count action(s)` : ""}${rangeValueActions ? `, ${rangeValueActions} set_range_value action(s)` : ""}${dragActions ? `, ${dragActions} drag action(s)` : ""}${canvasSignatureActions ? `, ${canvasSignatureActions} canvas_signature action(s)` : ""}${windowCallActions ? `, ${windowCallActions} window_call action(s), ${windowCallStored} stored return(s), ${windowCallCaptured} captured return(s)` : ""}${windowEvalActions ? `, ${windowEvalActions} window_eval action(s), ${windowEvalStored} stored return(s), ${windowEvalCaptured} captured return(s)` : ""}${windowCallUntilActions ? `, ${windowCallUntilActions} window_call_until action(s), ${windowCallUntilCalls} call(s)` : ""}${observedPath ? `, path ${observedPath}` : ""}`);
|
|
15985
16104
|
}
|
|
16105
|
+
const clickSequenceGroups = viewports.map((viewport) => {
|
|
16106
|
+
const name = cliString(viewport.name) || "viewport";
|
|
16107
|
+
const receipts = Array.isArray(viewport.click_sequences) ? viewport.click_sequences.map(cliRecord).filter((item) => Boolean(item)) : [];
|
|
16108
|
+
return receipts.map((receipt) => ({ name, receipt }));
|
|
16109
|
+
});
|
|
16110
|
+
const clickSequenceDetails = clickSequenceGroups.flat();
|
|
16111
|
+
const sampledClickSequenceDetails = balancedSetupReceiptDetails(clickSequenceGroups, 12);
|
|
16112
|
+
for (const { name, receipt } of sampledClickSequenceDetails) {
|
|
16113
|
+
const selectorTemplate = cliString(receipt.selector_template) || "target";
|
|
16114
|
+
const valueSource = cliString(receipt.value_source);
|
|
16115
|
+
const sequence = Array.isArray(receipt.sequence) ? receipt.sequence.map((value) => cliFiniteNumber(value)).filter((value) => value !== void 0) : [];
|
|
16116
|
+
const sequenceText = sequence.join(",");
|
|
16117
|
+
const omittedSequenceCount = cliFiniteNumber(receipt.omitted_sequence_count) || 0;
|
|
16118
|
+
const clickTotal = cliFiniteNumber(receipt.click_total);
|
|
16119
|
+
const resultCount = cliFiniteNumber(receipt.result_count);
|
|
16120
|
+
const ordinals = Array.isArray(receipt.ordinals) ? receipt.ordinals.map((value) => cliFiniteNumber(value)).filter((value) => value !== void 0) : [];
|
|
16121
|
+
const ordinalText = ordinals.length ? ordinals.join(",") : "";
|
|
16122
|
+
lines.push(`- ${name} click_sequence: ${markdownInlineCode(selectorTemplate)}${valueSource ? ` ${valueSource}` : ""}${sequenceText ? ` sequence ${markdownInlineCode(sequenceText, 160)}` : ""}${omittedSequenceCount ? ` (+${omittedSequenceCount} omitted)` : ""}${clickTotal === void 0 ? "" : `, clicks ${clickTotal}`}${resultCount === void 0 ? "" : `, results ${resultCount}`}${ordinalText ? `, ordinals ${markdownInlineCode(ordinalText, 120)}` : ""}`);
|
|
16123
|
+
}
|
|
16124
|
+
if (clickSequenceDetails.length > sampledClickSequenceDetails.length) lines.push(`- ${clickSequenceDetails.length - sampledClickSequenceDetails.length} additional click_sequence receipt(s) omitted.`);
|
|
15986
16125
|
const dragGroups = viewports.map((viewport) => {
|
|
15987
16126
|
const name = cliString(viewport.name) || "viewport";
|
|
15988
16127
|
const receipts = Array.isArray(viewport.drag) ? viewport.drag.map(cliRecord).filter((item) => Boolean(item)) : [];
|
package/dist/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
profileStatusExitCode,
|
|
14
14
|
resolveRiddleProofProfileTargetUrl,
|
|
15
15
|
resolveRiddleProofProfileTimeoutSec
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-25XFUIIC.js";
|
|
17
17
|
import {
|
|
18
18
|
createRiddleApiClient,
|
|
19
19
|
isTerminalRiddleJobStatus,
|
|
@@ -776,6 +776,7 @@ function profileSetupSummaryMarkdown(result) {
|
|
|
776
776
|
return sum + labels.filter((label) => typeof label === "string" && label.trim()).length;
|
|
777
777
|
}, 0);
|
|
778
778
|
const clickedTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.clicked_total) || 0), 0);
|
|
779
|
+
const clickSequenceTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.click_sequence_total) || 0), 0);
|
|
779
780
|
const clickCountActionTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.click_count_action_total) || 0), 0);
|
|
780
781
|
const clickCountValueTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.click_count_value_total) || 0), 0);
|
|
781
782
|
const windowCallTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.window_call_total) || 0), 0);
|
|
@@ -799,6 +800,9 @@ function profileSetupSummaryMarkdown(result) {
|
|
|
799
800
|
if (clickCountActionTotal) {
|
|
800
801
|
lines.push(`- click counts: ${clickCountActionTotal} action(s), click_count total ${clickCountValueTotal}`);
|
|
801
802
|
}
|
|
803
|
+
if (clickSequenceTotal) {
|
|
804
|
+
lines.push(`- click sequences: ${clickSequenceTotal} group(s)`);
|
|
805
|
+
}
|
|
802
806
|
if (windowCallTotal) {
|
|
803
807
|
lines.push(`- window_call: ${windowCallTotal} action(s), stored returns ${windowCallStoredTotal}, captured returns ${windowCallCapturedTotal}`);
|
|
804
808
|
}
|
|
@@ -823,6 +827,7 @@ function profileSetupSummaryMarkdown(result) {
|
|
|
823
827
|
const resultCount = cliFiniteNumber(viewport.result_count) || 0;
|
|
824
828
|
const screenshotCount = Array.isArray(viewport.setup_screenshots) ? viewport.setup_screenshots.filter((label) => typeof label === "string" && label.trim()).length : 0;
|
|
825
829
|
const clicked = cliFiniteNumber(viewport.clicked_total) || 0;
|
|
830
|
+
const clickSequenceCount = cliFiniteNumber(viewport.click_sequence_total) || 0;
|
|
826
831
|
const clickCountActions = cliFiniteNumber(viewport.click_count_action_total) || 0;
|
|
827
832
|
const windowCallActions = cliFiniteNumber(viewport.window_call_total) || 0;
|
|
828
833
|
const windowCallStored = cliFiniteNumber(viewport.window_call_stored_total) || 0;
|
|
@@ -836,8 +841,28 @@ function profileSetupSummaryMarkdown(result) {
|
|
|
836
841
|
const dragActions = cliFiniteNumber(viewport.drag_total) || 0;
|
|
837
842
|
const canvasSignatureActions = cliFiniteNumber(viewport.canvas_signature_total) || 0;
|
|
838
843
|
const observedPath = cliString(viewport.observed_path);
|
|
839
|
-
lines.push(`- ${name}: ${ok}, ${resultCount} result(s), ${screenshotCount} setup screenshot(s), ${clicked} click(s)${clickCountActions ? `, ${clickCountActions} click_count action(s)` : ""}${rangeValueActions ? `, ${rangeValueActions} set_range_value action(s)` : ""}${dragActions ? `, ${dragActions} drag action(s)` : ""}${canvasSignatureActions ? `, ${canvasSignatureActions} canvas_signature action(s)` : ""}${windowCallActions ? `, ${windowCallActions} window_call action(s), ${windowCallStored} stored return(s), ${windowCallCaptured} captured return(s)` : ""}${windowEvalActions ? `, ${windowEvalActions} window_eval action(s), ${windowEvalStored} stored return(s), ${windowEvalCaptured} captured return(s)` : ""}${windowCallUntilActions ? `, ${windowCallUntilActions} window_call_until action(s), ${windowCallUntilCalls} call(s)` : ""}${observedPath ? `, path ${observedPath}` : ""}`);
|
|
844
|
+
lines.push(`- ${name}: ${ok}, ${resultCount} result(s), ${screenshotCount} setup screenshot(s), ${clicked} click(s)${clickSequenceCount ? `, ${clickSequenceCount} click sequence(s)` : ""}${clickCountActions ? `, ${clickCountActions} click_count action(s)` : ""}${rangeValueActions ? `, ${rangeValueActions} set_range_value action(s)` : ""}${dragActions ? `, ${dragActions} drag action(s)` : ""}${canvasSignatureActions ? `, ${canvasSignatureActions} canvas_signature action(s)` : ""}${windowCallActions ? `, ${windowCallActions} window_call action(s), ${windowCallStored} stored return(s), ${windowCallCaptured} captured return(s)` : ""}${windowEvalActions ? `, ${windowEvalActions} window_eval action(s), ${windowEvalStored} stored return(s), ${windowEvalCaptured} captured return(s)` : ""}${windowCallUntilActions ? `, ${windowCallUntilActions} window_call_until action(s), ${windowCallUntilCalls} call(s)` : ""}${observedPath ? `, path ${observedPath}` : ""}`);
|
|
840
845
|
}
|
|
846
|
+
const clickSequenceGroups = viewports.map((viewport) => {
|
|
847
|
+
const name = cliString(viewport.name) || "viewport";
|
|
848
|
+
const receipts = Array.isArray(viewport.click_sequences) ? viewport.click_sequences.map(cliRecord).filter((item) => Boolean(item)) : [];
|
|
849
|
+
return receipts.map((receipt) => ({ name, receipt }));
|
|
850
|
+
});
|
|
851
|
+
const clickSequenceDetails = clickSequenceGroups.flat();
|
|
852
|
+
const sampledClickSequenceDetails = balancedSetupReceiptDetails(clickSequenceGroups, 12);
|
|
853
|
+
for (const { name, receipt } of sampledClickSequenceDetails) {
|
|
854
|
+
const selectorTemplate = cliString(receipt.selector_template) || "target";
|
|
855
|
+
const valueSource = cliString(receipt.value_source);
|
|
856
|
+
const sequence = Array.isArray(receipt.sequence) ? receipt.sequence.map((value) => cliFiniteNumber(value)).filter((value) => value !== void 0) : [];
|
|
857
|
+
const sequenceText = sequence.join(",");
|
|
858
|
+
const omittedSequenceCount = cliFiniteNumber(receipt.omitted_sequence_count) || 0;
|
|
859
|
+
const clickTotal = cliFiniteNumber(receipt.click_total);
|
|
860
|
+
const resultCount = cliFiniteNumber(receipt.result_count);
|
|
861
|
+
const ordinals = Array.isArray(receipt.ordinals) ? receipt.ordinals.map((value) => cliFiniteNumber(value)).filter((value) => value !== void 0) : [];
|
|
862
|
+
const ordinalText = ordinals.length ? ordinals.join(",") : "";
|
|
863
|
+
lines.push(`- ${name} click_sequence: ${markdownInlineCode(selectorTemplate)}${valueSource ? ` ${valueSource}` : ""}${sequenceText ? ` sequence ${markdownInlineCode(sequenceText, 160)}` : ""}${omittedSequenceCount ? ` (+${omittedSequenceCount} omitted)` : ""}${clickTotal === void 0 ? "" : `, clicks ${clickTotal}`}${resultCount === void 0 ? "" : `, results ${resultCount}`}${ordinalText ? `, ordinals ${markdownInlineCode(ordinalText, 120)}` : ""}`);
|
|
864
|
+
}
|
|
865
|
+
if (clickSequenceDetails.length > sampledClickSequenceDetails.length) lines.push(`- ${clickSequenceDetails.length - sampledClickSequenceDetails.length} additional click_sequence receipt(s) omitted.`);
|
|
841
866
|
const dragGroups = viewports.map((viewport) => {
|
|
842
867
|
const name = cliString(viewport.name) || "viewport";
|
|
843
868
|
const receipts = Array.isArray(viewport.drag) ? viewport.drag.map(cliRecord).filter((item) => Boolean(item)) : [];
|
package/dist/index.cjs
CHANGED
|
@@ -9357,6 +9357,57 @@ function profileSetupCanvasSignatureStableHashGroups(results) {
|
|
|
9357
9357
|
}
|
|
9358
9358
|
return warnings;
|
|
9359
9359
|
}
|
|
9360
|
+
function profileSetupClickSequenceReceipts(clickedItems) {
|
|
9361
|
+
const nthChildPattern = /:nth-child\((\d+)\)/;
|
|
9362
|
+
const nthChildTemplatePattern = /:nth-child\(\d+\)/g;
|
|
9363
|
+
const groups = /* @__PURE__ */ new Map();
|
|
9364
|
+
for (const item of clickedItems) {
|
|
9365
|
+
const selector = stringValue5(item.selector);
|
|
9366
|
+
if (!selector) continue;
|
|
9367
|
+
const frameSelector = stringValue5(item.frame_selector);
|
|
9368
|
+
const clickCountValue = numberValue3(item.click_count);
|
|
9369
|
+
const clickCount = clickCountValue === void 0 ? 1 : Math.max(1, Math.min(100, Math.floor(clickCountValue)));
|
|
9370
|
+
const ordinal = numberValue3(item.ordinal);
|
|
9371
|
+
const match = nthChildPattern.exec(selector);
|
|
9372
|
+
const selectorTemplate = match ? selector.replace(nthChildTemplatePattern, ":nth-child(*)") : selector;
|
|
9373
|
+
const valueSource = match ? "nth-child" : "same-selector";
|
|
9374
|
+
const key = `${valueSource}
|
|
9375
|
+
${frameSelector || ""}
|
|
9376
|
+
${selectorTemplate}`;
|
|
9377
|
+
const group = groups.get(key) || {
|
|
9378
|
+
selector_template: selectorTemplate,
|
|
9379
|
+
frame_selector: frameSelector,
|
|
9380
|
+
value_source: valueSource,
|
|
9381
|
+
sequence: [],
|
|
9382
|
+
ordinals: [],
|
|
9383
|
+
result_count: 0,
|
|
9384
|
+
click_total: 0
|
|
9385
|
+
};
|
|
9386
|
+
if (match) {
|
|
9387
|
+
const value = Number(match[1]);
|
|
9388
|
+
for (let index = 0; index < clickCount; index += 1) group.sequence.push(value);
|
|
9389
|
+
}
|
|
9390
|
+
if (ordinal !== void 0) group.ordinals.push(ordinal);
|
|
9391
|
+
group.result_count += 1;
|
|
9392
|
+
group.click_total += clickCount;
|
|
9393
|
+
groups.set(key, group);
|
|
9394
|
+
}
|
|
9395
|
+
return [...groups.values()].filter((group) => group.result_count >= 4).map((group) => {
|
|
9396
|
+
const sequence = group.sequence.slice(0, 32);
|
|
9397
|
+
const ordinals = group.ordinals.slice(0, 16);
|
|
9398
|
+
return {
|
|
9399
|
+
selector_template: group.selector_template,
|
|
9400
|
+
frame_selector: group.frame_selector ?? null,
|
|
9401
|
+
value_source: group.value_source,
|
|
9402
|
+
result_count: group.result_count,
|
|
9403
|
+
click_total: group.click_total,
|
|
9404
|
+
sequence,
|
|
9405
|
+
omitted_sequence_count: Math.max(0, group.sequence.length - sequence.length),
|
|
9406
|
+
ordinals,
|
|
9407
|
+
omitted_ordinal_count: Math.max(0, group.ordinals.length - ordinals.length)
|
|
9408
|
+
};
|
|
9409
|
+
});
|
|
9410
|
+
}
|
|
9360
9411
|
function sampleProfileSetupSummaryItems(items, limit) {
|
|
9361
9412
|
if (items.length <= limit) return items;
|
|
9362
9413
|
const firstCount = Math.floor(limit / 2);
|
|
@@ -9416,6 +9467,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
|
|
|
9416
9467
|
};
|
|
9417
9468
|
});
|
|
9418
9469
|
const clicked = sampleProfileSetupSummaryItems(clickedItems, 8);
|
|
9470
|
+
const clickSequences = profileSetupClickSequenceReceipts(clickedItems);
|
|
9471
|
+
const sampledClickSequences = sampleProfileSetupSummaryItems(clickSequences, 6);
|
|
9419
9472
|
const text_samples = results.filter((result) => result.ok !== false && typeof result.text === "string" && (profileSetupResultAction(result) === "assert_text_visible" || profileSetupResultAction(result) === "assert_text_absent" || profileSetupResultAction(result) === "wait_for_text")).map((result) => ({
|
|
9420
9473
|
ordinal: result.ordinal ?? null,
|
|
9421
9474
|
action: profileSetupResultAction(result),
|
|
@@ -9437,6 +9490,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
|
|
|
9437
9490
|
setup_screenshots: profileSetupScreenshotLabels(results),
|
|
9438
9491
|
clicked_total: clickedItems.length,
|
|
9439
9492
|
clicked_truncated: clickedItems.length > clicked.length,
|
|
9493
|
+
click_sequence_total: clickSequences.length,
|
|
9494
|
+
click_sequence_truncated: clickSequences.length > sampledClickSequences.length,
|
|
9495
|
+
click_sequences: sampledClickSequences,
|
|
9440
9496
|
click_count_action_total: clickCountValues.length,
|
|
9441
9497
|
click_count_value_total: clickCountValues.reduce((sum, value) => sum + value, 0),
|
|
9442
9498
|
window_call_until_total: windowCallUntilReceipts.length,
|
|
@@ -13010,6 +13066,59 @@ function profileSetupCanvasSignatureStableHashGroups(results) {
|
|
|
13010
13066
|
}
|
|
13011
13067
|
return warnings;
|
|
13012
13068
|
}
|
|
13069
|
+
function profileSetupClickSequenceReceipts(clickedItems) {
|
|
13070
|
+
const nthChildPattern = /:nth-child\((\d+)\)/;
|
|
13071
|
+
const nthChildTemplatePattern = /:nth-child\(\d+\)/g;
|
|
13072
|
+
const groups = new Map();
|
|
13073
|
+
for (const item of clickedItems || []) {
|
|
13074
|
+
const selector = typeof item.selector === "string" && item.selector.trim() ? item.selector.trim() : undefined;
|
|
13075
|
+
if (!selector) continue;
|
|
13076
|
+
const frameSelector = typeof item.frame_selector === "string" && item.frame_selector.trim() ? item.frame_selector.trim() : undefined;
|
|
13077
|
+
const clickCountValue = typeof item.click_count === "number" && Number.isFinite(item.click_count) ? item.click_count : undefined;
|
|
13078
|
+
const clickCount = clickCountValue === undefined ? 1 : Math.max(1, Math.min(100, Math.floor(clickCountValue)));
|
|
13079
|
+
const ordinal = typeof item.ordinal === "number" && Number.isFinite(item.ordinal) ? item.ordinal : undefined;
|
|
13080
|
+
const match = nthChildPattern.exec(selector);
|
|
13081
|
+
const selectorTemplate = match
|
|
13082
|
+
? selector.replace(nthChildTemplatePattern, ":nth-child(*)")
|
|
13083
|
+
: selector;
|
|
13084
|
+
const valueSource = match ? "nth-child" : "same-selector";
|
|
13085
|
+
const key = valueSource + "\\n" + String(frameSelector || "") + "\\n" + selectorTemplate;
|
|
13086
|
+
const group = groups.get(key) || {
|
|
13087
|
+
selector_template: selectorTemplate,
|
|
13088
|
+
frame_selector: frameSelector,
|
|
13089
|
+
value_source: valueSource,
|
|
13090
|
+
sequence: [],
|
|
13091
|
+
ordinals: [],
|
|
13092
|
+
result_count: 0,
|
|
13093
|
+
click_total: 0,
|
|
13094
|
+
};
|
|
13095
|
+
if (match) {
|
|
13096
|
+
const value = Number(match[1]);
|
|
13097
|
+
for (let index = 0; index < clickCount; index += 1) group.sequence.push(value);
|
|
13098
|
+
}
|
|
13099
|
+
if (ordinal !== undefined) group.ordinals.push(ordinal);
|
|
13100
|
+
group.result_count += 1;
|
|
13101
|
+
group.click_total += clickCount;
|
|
13102
|
+
groups.set(key, group);
|
|
13103
|
+
}
|
|
13104
|
+
return [...groups.values()]
|
|
13105
|
+
.filter((group) => group.result_count >= 4)
|
|
13106
|
+
.map((group) => {
|
|
13107
|
+
const sequence = group.sequence.slice(0, 32);
|
|
13108
|
+
const ordinals = group.ordinals.slice(0, 16);
|
|
13109
|
+
return {
|
|
13110
|
+
selector_template: group.selector_template,
|
|
13111
|
+
frame_selector: group.frame_selector || null,
|
|
13112
|
+
value_source: group.value_source,
|
|
13113
|
+
result_count: group.result_count,
|
|
13114
|
+
click_total: group.click_total,
|
|
13115
|
+
sequence,
|
|
13116
|
+
omitted_sequence_count: Math.max(0, group.sequence.length - sequence.length),
|
|
13117
|
+
ordinals,
|
|
13118
|
+
omitted_ordinal_count: Math.max(0, group.ordinals.length - ordinals.length),
|
|
13119
|
+
};
|
|
13120
|
+
});
|
|
13121
|
+
}
|
|
13013
13122
|
function sampleProfileSetupSummaryItems(items, limit) {
|
|
13014
13123
|
if ((items || []).length <= limit) return items || [];
|
|
13015
13124
|
const firstCount = Math.floor(limit / 2);
|
|
@@ -13085,6 +13194,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
|
|
|
13085
13194
|
};
|
|
13086
13195
|
});
|
|
13087
13196
|
const clicked = sampleProfileSetupSummaryItems(clickedItems, 8);
|
|
13197
|
+
const clickSequences = profileSetupClickSequenceReceipts(clickedItems);
|
|
13198
|
+
const sampledClickSequences = sampleProfileSetupSummaryItems(clickSequences, 6);
|
|
13088
13199
|
const textSamples = results
|
|
13089
13200
|
.filter((result) => result && result.ok !== false && typeof result.text === "string" && (
|
|
13090
13201
|
profileSetupResultAction(result) === "assert_text_visible"
|
|
@@ -13114,6 +13225,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
|
|
|
13114
13225
|
setup_screenshots: profileSetupScreenshotLabels(results),
|
|
13115
13226
|
clicked_total: clickedItems.length,
|
|
13116
13227
|
clicked_truncated: clickedItems.length > clicked.length,
|
|
13228
|
+
click_sequence_total: clickSequences.length,
|
|
13229
|
+
click_sequence_truncated: clickSequences.length > sampledClickSequences.length,
|
|
13230
|
+
click_sequences: sampledClickSequences,
|
|
13117
13231
|
click_count_action_total: clickCountValues.length,
|
|
13118
13232
|
click_count_value_total: clickCountValues.reduce((sum, value) => sum + value, 0),
|
|
13119
13233
|
window_call_until_total: windowCallUntilReceipts.length,
|
package/dist/index.js
CHANGED
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
resolveRiddleProofProfileTimeoutSec,
|
|
63
63
|
slugifyRiddleProofProfileName,
|
|
64
64
|
summarizeRiddleProofProfileResult
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-25XFUIIC.js";
|
|
66
66
|
import {
|
|
67
67
|
DEFAULT_RIDDLE_API_BASE_URL,
|
|
68
68
|
DEFAULT_RIDDLE_API_KEY_FILE,
|
package/dist/profile.cjs
CHANGED
|
@@ -671,6 +671,57 @@ function profileSetupCanvasSignatureStableHashGroups(results) {
|
|
|
671
671
|
}
|
|
672
672
|
return warnings;
|
|
673
673
|
}
|
|
674
|
+
function profileSetupClickSequenceReceipts(clickedItems) {
|
|
675
|
+
const nthChildPattern = /:nth-child\((\d+)\)/;
|
|
676
|
+
const nthChildTemplatePattern = /:nth-child\(\d+\)/g;
|
|
677
|
+
const groups = /* @__PURE__ */ new Map();
|
|
678
|
+
for (const item of clickedItems) {
|
|
679
|
+
const selector = stringValue(item.selector);
|
|
680
|
+
if (!selector) continue;
|
|
681
|
+
const frameSelector = stringValue(item.frame_selector);
|
|
682
|
+
const clickCountValue = numberValue(item.click_count);
|
|
683
|
+
const clickCount = clickCountValue === void 0 ? 1 : Math.max(1, Math.min(100, Math.floor(clickCountValue)));
|
|
684
|
+
const ordinal = numberValue(item.ordinal);
|
|
685
|
+
const match = nthChildPattern.exec(selector);
|
|
686
|
+
const selectorTemplate = match ? selector.replace(nthChildTemplatePattern, ":nth-child(*)") : selector;
|
|
687
|
+
const valueSource = match ? "nth-child" : "same-selector";
|
|
688
|
+
const key = `${valueSource}
|
|
689
|
+
${frameSelector || ""}
|
|
690
|
+
${selectorTemplate}`;
|
|
691
|
+
const group = groups.get(key) || {
|
|
692
|
+
selector_template: selectorTemplate,
|
|
693
|
+
frame_selector: frameSelector,
|
|
694
|
+
value_source: valueSource,
|
|
695
|
+
sequence: [],
|
|
696
|
+
ordinals: [],
|
|
697
|
+
result_count: 0,
|
|
698
|
+
click_total: 0
|
|
699
|
+
};
|
|
700
|
+
if (match) {
|
|
701
|
+
const value = Number(match[1]);
|
|
702
|
+
for (let index = 0; index < clickCount; index += 1) group.sequence.push(value);
|
|
703
|
+
}
|
|
704
|
+
if (ordinal !== void 0) group.ordinals.push(ordinal);
|
|
705
|
+
group.result_count += 1;
|
|
706
|
+
group.click_total += clickCount;
|
|
707
|
+
groups.set(key, group);
|
|
708
|
+
}
|
|
709
|
+
return [...groups.values()].filter((group) => group.result_count >= 4).map((group) => {
|
|
710
|
+
const sequence = group.sequence.slice(0, 32);
|
|
711
|
+
const ordinals = group.ordinals.slice(0, 16);
|
|
712
|
+
return {
|
|
713
|
+
selector_template: group.selector_template,
|
|
714
|
+
frame_selector: group.frame_selector ?? null,
|
|
715
|
+
value_source: group.value_source,
|
|
716
|
+
result_count: group.result_count,
|
|
717
|
+
click_total: group.click_total,
|
|
718
|
+
sequence,
|
|
719
|
+
omitted_sequence_count: Math.max(0, group.sequence.length - sequence.length),
|
|
720
|
+
ordinals,
|
|
721
|
+
omitted_ordinal_count: Math.max(0, group.ordinals.length - ordinals.length)
|
|
722
|
+
};
|
|
723
|
+
});
|
|
724
|
+
}
|
|
674
725
|
function sampleProfileSetupSummaryItems(items, limit) {
|
|
675
726
|
if (items.length <= limit) return items;
|
|
676
727
|
const firstCount = Math.floor(limit / 2);
|
|
@@ -730,6 +781,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
|
|
|
730
781
|
};
|
|
731
782
|
});
|
|
732
783
|
const clicked = sampleProfileSetupSummaryItems(clickedItems, 8);
|
|
784
|
+
const clickSequences = profileSetupClickSequenceReceipts(clickedItems);
|
|
785
|
+
const sampledClickSequences = sampleProfileSetupSummaryItems(clickSequences, 6);
|
|
733
786
|
const text_samples = results.filter((result) => result.ok !== false && typeof result.text === "string" && (profileSetupResultAction(result) === "assert_text_visible" || profileSetupResultAction(result) === "assert_text_absent" || profileSetupResultAction(result) === "wait_for_text")).map((result) => ({
|
|
734
787
|
ordinal: result.ordinal ?? null,
|
|
735
788
|
action: profileSetupResultAction(result),
|
|
@@ -751,6 +804,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
|
|
|
751
804
|
setup_screenshots: profileSetupScreenshotLabels(results),
|
|
752
805
|
clicked_total: clickedItems.length,
|
|
753
806
|
clicked_truncated: clickedItems.length > clicked.length,
|
|
807
|
+
click_sequence_total: clickSequences.length,
|
|
808
|
+
click_sequence_truncated: clickSequences.length > sampledClickSequences.length,
|
|
809
|
+
click_sequences: sampledClickSequences,
|
|
754
810
|
click_count_action_total: clickCountValues.length,
|
|
755
811
|
click_count_value_total: clickCountValues.reduce((sum, value) => sum + value, 0),
|
|
756
812
|
window_call_until_total: windowCallUntilReceipts.length,
|
|
@@ -4324,6 +4380,59 @@ function profileSetupCanvasSignatureStableHashGroups(results) {
|
|
|
4324
4380
|
}
|
|
4325
4381
|
return warnings;
|
|
4326
4382
|
}
|
|
4383
|
+
function profileSetupClickSequenceReceipts(clickedItems) {
|
|
4384
|
+
const nthChildPattern = /:nth-child\((\d+)\)/;
|
|
4385
|
+
const nthChildTemplatePattern = /:nth-child\(\d+\)/g;
|
|
4386
|
+
const groups = new Map();
|
|
4387
|
+
for (const item of clickedItems || []) {
|
|
4388
|
+
const selector = typeof item.selector === "string" && item.selector.trim() ? item.selector.trim() : undefined;
|
|
4389
|
+
if (!selector) continue;
|
|
4390
|
+
const frameSelector = typeof item.frame_selector === "string" && item.frame_selector.trim() ? item.frame_selector.trim() : undefined;
|
|
4391
|
+
const clickCountValue = typeof item.click_count === "number" && Number.isFinite(item.click_count) ? item.click_count : undefined;
|
|
4392
|
+
const clickCount = clickCountValue === undefined ? 1 : Math.max(1, Math.min(100, Math.floor(clickCountValue)));
|
|
4393
|
+
const ordinal = typeof item.ordinal === "number" && Number.isFinite(item.ordinal) ? item.ordinal : undefined;
|
|
4394
|
+
const match = nthChildPattern.exec(selector);
|
|
4395
|
+
const selectorTemplate = match
|
|
4396
|
+
? selector.replace(nthChildTemplatePattern, ":nth-child(*)")
|
|
4397
|
+
: selector;
|
|
4398
|
+
const valueSource = match ? "nth-child" : "same-selector";
|
|
4399
|
+
const key = valueSource + "\\n" + String(frameSelector || "") + "\\n" + selectorTemplate;
|
|
4400
|
+
const group = groups.get(key) || {
|
|
4401
|
+
selector_template: selectorTemplate,
|
|
4402
|
+
frame_selector: frameSelector,
|
|
4403
|
+
value_source: valueSource,
|
|
4404
|
+
sequence: [],
|
|
4405
|
+
ordinals: [],
|
|
4406
|
+
result_count: 0,
|
|
4407
|
+
click_total: 0,
|
|
4408
|
+
};
|
|
4409
|
+
if (match) {
|
|
4410
|
+
const value = Number(match[1]);
|
|
4411
|
+
for (let index = 0; index < clickCount; index += 1) group.sequence.push(value);
|
|
4412
|
+
}
|
|
4413
|
+
if (ordinal !== undefined) group.ordinals.push(ordinal);
|
|
4414
|
+
group.result_count += 1;
|
|
4415
|
+
group.click_total += clickCount;
|
|
4416
|
+
groups.set(key, group);
|
|
4417
|
+
}
|
|
4418
|
+
return [...groups.values()]
|
|
4419
|
+
.filter((group) => group.result_count >= 4)
|
|
4420
|
+
.map((group) => {
|
|
4421
|
+
const sequence = group.sequence.slice(0, 32);
|
|
4422
|
+
const ordinals = group.ordinals.slice(0, 16);
|
|
4423
|
+
return {
|
|
4424
|
+
selector_template: group.selector_template,
|
|
4425
|
+
frame_selector: group.frame_selector || null,
|
|
4426
|
+
value_source: group.value_source,
|
|
4427
|
+
result_count: group.result_count,
|
|
4428
|
+
click_total: group.click_total,
|
|
4429
|
+
sequence,
|
|
4430
|
+
omitted_sequence_count: Math.max(0, group.sequence.length - sequence.length),
|
|
4431
|
+
ordinals,
|
|
4432
|
+
omitted_ordinal_count: Math.max(0, group.ordinals.length - ordinals.length),
|
|
4433
|
+
};
|
|
4434
|
+
});
|
|
4435
|
+
}
|
|
4327
4436
|
function sampleProfileSetupSummaryItems(items, limit) {
|
|
4328
4437
|
if ((items || []).length <= limit) return items || [];
|
|
4329
4438
|
const firstCount = Math.floor(limit / 2);
|
|
@@ -4399,6 +4508,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
|
|
|
4399
4508
|
};
|
|
4400
4509
|
});
|
|
4401
4510
|
const clicked = sampleProfileSetupSummaryItems(clickedItems, 8);
|
|
4511
|
+
const clickSequences = profileSetupClickSequenceReceipts(clickedItems);
|
|
4512
|
+
const sampledClickSequences = sampleProfileSetupSummaryItems(clickSequences, 6);
|
|
4402
4513
|
const textSamples = results
|
|
4403
4514
|
.filter((result) => result && result.ok !== false && typeof result.text === "string" && (
|
|
4404
4515
|
profileSetupResultAction(result) === "assert_text_visible"
|
|
@@ -4428,6 +4539,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
|
|
|
4428
4539
|
setup_screenshots: profileSetupScreenshotLabels(results),
|
|
4429
4540
|
clicked_total: clickedItems.length,
|
|
4430
4541
|
clicked_truncated: clickedItems.length > clicked.length,
|
|
4542
|
+
click_sequence_total: clickSequences.length,
|
|
4543
|
+
click_sequence_truncated: clickSequences.length > sampledClickSequences.length,
|
|
4544
|
+
click_sequences: sampledClickSequences,
|
|
4431
4545
|
click_count_action_total: clickCountValues.length,
|
|
4432
4546
|
click_count_value_total: clickCountValues.reduce((sum, value) => sum + value, 0),
|
|
4433
4547
|
window_call_until_total: windowCallUntilReceipts.length,
|
package/dist/profile.js
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
resolveRiddleProofProfileTimeoutSec,
|
|
24
24
|
slugifyRiddleProofProfileName,
|
|
25
25
|
summarizeRiddleProofProfileResult
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-25XFUIIC.js";
|
|
27
27
|
export {
|
|
28
28
|
RIDDLE_PROOF_PROFILE_CHECK_TYPES,
|
|
29
29
|
RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
|
|
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
292
292
|
blocking?: boolean;
|
|
293
293
|
details?: Record<string, unknown>;
|
|
294
294
|
ok: boolean;
|
|
295
|
-
action: "
|
|
295
|
+
action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
|
|
296
296
|
state_path: string;
|
|
297
297
|
stage: any;
|
|
298
298
|
summary: string;
|
|
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
382
382
|
continueWithStage?: WorkflowStage | null;
|
|
383
383
|
blocking?: boolean;
|
|
384
384
|
details?: Record<string, unknown>;
|
|
385
|
-
action: "
|
|
385
|
+
action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
|
|
386
386
|
state_path: string;
|
|
387
387
|
stage: any;
|
|
388
388
|
checkpoint: string;
|
|
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
659
659
|
error?: undefined;
|
|
660
660
|
} | {
|
|
661
661
|
ok: boolean;
|
|
662
|
-
action: "
|
|
662
|
+
action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
|
|
663
663
|
state_path: string;
|
|
664
664
|
stage: any;
|
|
665
665
|
summary: string;
|
|
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
292
292
|
blocking?: boolean;
|
|
293
293
|
details?: Record<string, unknown>;
|
|
294
294
|
ok: boolean;
|
|
295
|
-
action: "
|
|
295
|
+
action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
|
|
296
296
|
state_path: string;
|
|
297
297
|
stage: any;
|
|
298
298
|
summary: string;
|
|
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
382
382
|
continueWithStage?: WorkflowStage | null;
|
|
383
383
|
blocking?: boolean;
|
|
384
384
|
details?: Record<string, unknown>;
|
|
385
|
-
action: "
|
|
385
|
+
action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
|
|
386
386
|
state_path: string;
|
|
387
387
|
stage: any;
|
|
388
388
|
checkpoint: string;
|
|
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
659
659
|
error?: undefined;
|
|
660
660
|
} | {
|
|
661
661
|
ok: boolean;
|
|
662
|
-
action: "
|
|
662
|
+
action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
|
|
663
663
|
state_path: string;
|
|
664
664
|
stage: any;
|
|
665
665
|
summary: string;
|