@riddledc/riddle-proof 0.7.153 → 0.7.154
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/{chunk-QJJ3ISMK.js → chunk-YB3LNLZB.js} +108 -0
- package/dist/cli.cjs +121 -2
- package/dist/cli.js +14 -3
- package/dist/index.cjs +108 -0
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/profile.cjs +108 -0
- package/dist/profile.d.cts +6 -1
- package/dist/profile.d.ts +6 -1
- package/dist/profile.js +1 -1
- package/package.json +1 -1
|
@@ -480,6 +480,8 @@ function profileSetupWindowCallReceipts(results) {
|
|
|
480
480
|
};
|
|
481
481
|
if (result.returned !== void 0) receipt.returned = result.returned;
|
|
482
482
|
if (result.expected_return !== void 0) receipt.expected_return = result.expected_return;
|
|
483
|
+
const returnSummary = profileSetupReturnSummary(result);
|
|
484
|
+
if (returnSummary.length) receipt.return_summary = returnSummary;
|
|
483
485
|
return receipt;
|
|
484
486
|
});
|
|
485
487
|
}
|
|
@@ -495,6 +497,40 @@ function profileSetupWindowEvalReceipts(results) {
|
|
|
495
497
|
};
|
|
496
498
|
if (result.returned !== void 0) receipt.returned = result.returned;
|
|
497
499
|
if (result.expected_return !== void 0) receipt.expected_return = result.expected_return;
|
|
500
|
+
const returnSummary = profileSetupReturnSummary(result);
|
|
501
|
+
if (returnSummary.length) receipt.return_summary = returnSummary;
|
|
502
|
+
return receipt;
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
function profileSetupReturnSummaryFields(result) {
|
|
506
|
+
const input = result.return_summary_fields;
|
|
507
|
+
if (!Array.isArray(input)) return [];
|
|
508
|
+
const fields = [];
|
|
509
|
+
for (const item of input) {
|
|
510
|
+
if (typeof item === "string") {
|
|
511
|
+
const path2 = item.trim();
|
|
512
|
+
if (path2) fields.push({ path: path2 });
|
|
513
|
+
continue;
|
|
514
|
+
}
|
|
515
|
+
if (!isRecord(item)) continue;
|
|
516
|
+
const path = stringValue(item.path) ?? stringValue(item.key) ?? stringValue(item.json_path) ?? stringValue(item.jsonPath);
|
|
517
|
+
if (!path) continue;
|
|
518
|
+
const label = stringValue(item.label) ?? stringValue(item.name) ?? stringValue(item.title);
|
|
519
|
+
fields.push(label ? { path, label } : { path });
|
|
520
|
+
}
|
|
521
|
+
return fields;
|
|
522
|
+
}
|
|
523
|
+
function profileSetupReturnSummary(result) {
|
|
524
|
+
if (result.returned === void 0) return [];
|
|
525
|
+
return profileSetupReturnSummaryFields(result).map((field) => {
|
|
526
|
+
const resolved = resolveJsonPath(result.returned, field.path);
|
|
527
|
+
const receipt = {
|
|
528
|
+
label: field.label || field.path,
|
|
529
|
+
path: field.path,
|
|
530
|
+
exists: resolved.exists
|
|
531
|
+
};
|
|
532
|
+
if (resolved.exists) receipt.value = toJsonValue(resolved.value);
|
|
533
|
+
if (resolved.error) receipt.reason = resolved.error;
|
|
498
534
|
return receipt;
|
|
499
535
|
});
|
|
500
536
|
}
|
|
@@ -683,6 +719,37 @@ function normalizeSetupActionArgs(input, index) {
|
|
|
683
719
|
}
|
|
684
720
|
return argsInput.map(toJsonValue);
|
|
685
721
|
}
|
|
722
|
+
function normalizeReturnSummaryFields(input, index) {
|
|
723
|
+
const fieldsInput = valueFromOwn(
|
|
724
|
+
input,
|
|
725
|
+
"return_summary_fields",
|
|
726
|
+
"returnSummaryFields",
|
|
727
|
+
"summary_fields",
|
|
728
|
+
"summaryFields",
|
|
729
|
+
"receipt_fields",
|
|
730
|
+
"receiptFields",
|
|
731
|
+
"return_receipt_fields",
|
|
732
|
+
"returnReceiptFields"
|
|
733
|
+
);
|
|
734
|
+
if (fieldsInput === void 0) return void 0;
|
|
735
|
+
if (!Array.isArray(fieldsInput)) {
|
|
736
|
+
throw new Error(`target.setup_actions[${index}].return_summary_fields must be an array.`);
|
|
737
|
+
}
|
|
738
|
+
return fieldsInput.map((field, fieldIndex) => {
|
|
739
|
+
if (typeof field === "string") {
|
|
740
|
+
const path2 = field.trim();
|
|
741
|
+
if (!path2) throw new Error(`target.setup_actions[${index}].return_summary_fields[${fieldIndex}] requires path.`);
|
|
742
|
+
return { path: path2 };
|
|
743
|
+
}
|
|
744
|
+
if (!isRecord(field)) {
|
|
745
|
+
throw new Error(`target.setup_actions[${index}].return_summary_fields[${fieldIndex}] must be a string path or object.`);
|
|
746
|
+
}
|
|
747
|
+
const path = stringFromOwn(field, "path", "key", "json_path", "jsonPath");
|
|
748
|
+
if (!path) throw new Error(`target.setup_actions[${index}].return_summary_fields[${fieldIndex}] requires path.`);
|
|
749
|
+
const label = stringFromOwn(field, "label", "name", "title");
|
|
750
|
+
return label ? { path, label } : { path };
|
|
751
|
+
});
|
|
752
|
+
}
|
|
686
753
|
function normalizeSetupActionRepeat(input, index) {
|
|
687
754
|
const repeat = numberValue(valueFromOwn(input, "repeat", "repeat_count", "repeatCount", "times"));
|
|
688
755
|
if (repeat === void 0) return void 0;
|
|
@@ -904,6 +971,7 @@ function normalizeSetupAction(input, index) {
|
|
|
904
971
|
expect_return: hasExpectedReturn ? toJsonValue(valueFromOwn(input, "expect_return", "expectReturn", "expected_return", "expectedReturn")) : void 0,
|
|
905
972
|
store_return_to: storeReturnTo,
|
|
906
973
|
capture_return: captureReturn,
|
|
974
|
+
return_summary_fields: normalizeReturnSummaryFields(input, index),
|
|
907
975
|
until_path: untilPath,
|
|
908
976
|
until_expected_value: hasUntilExpectedValue ? toJsonValue(valueFromOwn(input, "until_expected_value", "untilExpectedValue", "until_expected", "untilExpected", "until_value", "untilValue", "expected_value", "expectedValue", "expected")) : void 0,
|
|
909
977
|
max_calls: maxCalls,
|
|
@@ -3942,6 +4010,8 @@ function profileSetupWindowCallReceipts(results) {
|
|
|
3942
4010
|
};
|
|
3943
4011
|
if (result.returned !== undefined) receipt.returned = result.returned;
|
|
3944
4012
|
if (result.expected_return !== undefined) receipt.expected_return = result.expected_return;
|
|
4013
|
+
const returnSummary = profileSetupReturnSummary(result);
|
|
4014
|
+
if (returnSummary.length) receipt.return_summary = returnSummary;
|
|
3945
4015
|
return receipt;
|
|
3946
4016
|
});
|
|
3947
4017
|
}
|
|
@@ -3959,9 +4029,43 @@ function profileSetupWindowEvalReceipts(results) {
|
|
|
3959
4029
|
};
|
|
3960
4030
|
if (result.returned !== undefined) receipt.returned = result.returned;
|
|
3961
4031
|
if (result.expected_return !== undefined) receipt.expected_return = result.expected_return;
|
|
4032
|
+
const returnSummary = profileSetupReturnSummary(result);
|
|
4033
|
+
if (returnSummary.length) receipt.return_summary = returnSummary;
|
|
3962
4034
|
return receipt;
|
|
3963
4035
|
});
|
|
3964
4036
|
}
|
|
4037
|
+
function profileSetupReturnSummaryFields(result) {
|
|
4038
|
+
const input = result && result.return_summary_fields;
|
|
4039
|
+
if (!Array.isArray(input)) return [];
|
|
4040
|
+
const fields = [];
|
|
4041
|
+
for (const item of input) {
|
|
4042
|
+
if (typeof item === "string") {
|
|
4043
|
+
const path = item.trim();
|
|
4044
|
+
if (path) fields.push({ path });
|
|
4045
|
+
continue;
|
|
4046
|
+
}
|
|
4047
|
+
if (!item || typeof item !== "object" || Array.isArray(item)) continue;
|
|
4048
|
+
const path = String(item.path || item.key || item.json_path || item.jsonPath || "").trim();
|
|
4049
|
+
if (!path) continue;
|
|
4050
|
+
const label = String(item.label || item.name || item.title || "").trim();
|
|
4051
|
+
fields.push(label ? { path, label } : { path });
|
|
4052
|
+
}
|
|
4053
|
+
return fields;
|
|
4054
|
+
}
|
|
4055
|
+
function profileSetupReturnSummary(result) {
|
|
4056
|
+
if (!result || result.returned === undefined) return [];
|
|
4057
|
+
return profileSetupReturnSummaryFields(result).map((field) => {
|
|
4058
|
+
const resolved = resolveJsonProbePath(result.returned, field.path);
|
|
4059
|
+
const receipt = {
|
|
4060
|
+
label: field.label || field.path,
|
|
4061
|
+
path: field.path,
|
|
4062
|
+
exists: Boolean(resolved.exists),
|
|
4063
|
+
};
|
|
4064
|
+
if (resolved.exists) receipt.value = setupJsonValue(resolved.value);
|
|
4065
|
+
if (resolved.error) receipt.reason = resolved.error;
|
|
4066
|
+
return receipt;
|
|
4067
|
+
});
|
|
4068
|
+
}
|
|
3965
4069
|
function profileSetupRangeValueReceipts(results) {
|
|
3966
4070
|
return (results || [])
|
|
3967
4071
|
.filter((result) => result && profileSetupResultAction(result) === "set_range_value")
|
|
@@ -5696,6 +5800,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
5696
5800
|
const script = String(action.script || action.code || action.source || action.body || "");
|
|
5697
5801
|
const args = Array.isArray(action.args) ? action.args : [];
|
|
5698
5802
|
const storeReturnTo = String(action.store_return_to || action.storeReturnTo || action.save_return_to || action.saveReturnTo || action.assign_return_to || action.assignReturnTo || action.return_state_path || action.returnStatePath || "").trim();
|
|
5803
|
+
const returnSummaryFields = Array.isArray(action.return_summary_fields) ? action.return_summary_fields : [];
|
|
5699
5804
|
if (!script.trim()) return { ...base, reason: "missing_script" };
|
|
5700
5805
|
const scope = await setupActionScope(action, timeout);
|
|
5701
5806
|
if (!scope.ok) return setupScopeFailure(base, scope);
|
|
@@ -5725,6 +5830,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
5725
5830
|
return_captured: captureReturn,
|
|
5726
5831
|
expected_return: hasExpectation ? setupJsonValue(expected) : undefined,
|
|
5727
5832
|
return_stored_to: result.return_stored_to || storeReturnTo || undefined,
|
|
5833
|
+
return_summary_fields: returnSummaryFields.length ? setupJsonValue(returnSummaryFields) : undefined,
|
|
5728
5834
|
reason: result.ok ? (expectationMet ? undefined : "unexpected_return_value") : result.reason,
|
|
5729
5835
|
store_reason: result.store_reason || undefined,
|
|
5730
5836
|
error: result.error || undefined,
|
|
@@ -5734,6 +5840,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
5734
5840
|
const path = String(action.path || action.function_path || action.functionPath || "");
|
|
5735
5841
|
const args = Array.isArray(action.args) ? action.args : [];
|
|
5736
5842
|
const storeReturnTo = String(action.store_return_to || action.storeReturnTo || action.save_return_to || action.saveReturnTo || action.assign_return_to || action.assignReturnTo || action.return_state_path || action.returnStatePath || "").trim();
|
|
5843
|
+
const returnSummaryFields = Array.isArray(action.return_summary_fields) ? action.return_summary_fields : [];
|
|
5737
5844
|
if (!path) return { ...base, path, reason: "missing_path" };
|
|
5738
5845
|
const scope = await setupActionScope(action, timeout);
|
|
5739
5846
|
if (!scope.ok) return setupScopeFailure(base, scope);
|
|
@@ -5763,6 +5870,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
5763
5870
|
return_captured: captureReturn,
|
|
5764
5871
|
expected_return: hasExpectation ? setupJsonValue(expected) : undefined,
|
|
5765
5872
|
return_stored_to: result.return_stored_to || storeReturnTo || undefined,
|
|
5873
|
+
return_summary_fields: returnSummaryFields.length ? setupJsonValue(returnSummaryFields) : undefined,
|
|
5766
5874
|
reason: result.ok ? (expectationMet ? undefined : "unexpected_return_value") : result.reason,
|
|
5767
5875
|
store_reason: result.store_reason || undefined,
|
|
5768
5876
|
error: result.error || undefined,
|
package/dist/cli.cjs
CHANGED
|
@@ -7437,6 +7437,8 @@ function profileSetupWindowCallReceipts(results) {
|
|
|
7437
7437
|
};
|
|
7438
7438
|
if (result.returned !== void 0) receipt.returned = result.returned;
|
|
7439
7439
|
if (result.expected_return !== void 0) receipt.expected_return = result.expected_return;
|
|
7440
|
+
const returnSummary = profileSetupReturnSummary(result);
|
|
7441
|
+
if (returnSummary.length) receipt.return_summary = returnSummary;
|
|
7440
7442
|
return receipt;
|
|
7441
7443
|
});
|
|
7442
7444
|
}
|
|
@@ -7452,6 +7454,40 @@ function profileSetupWindowEvalReceipts(results) {
|
|
|
7452
7454
|
};
|
|
7453
7455
|
if (result.returned !== void 0) receipt.returned = result.returned;
|
|
7454
7456
|
if (result.expected_return !== void 0) receipt.expected_return = result.expected_return;
|
|
7457
|
+
const returnSummary = profileSetupReturnSummary(result);
|
|
7458
|
+
if (returnSummary.length) receipt.return_summary = returnSummary;
|
|
7459
|
+
return receipt;
|
|
7460
|
+
});
|
|
7461
|
+
}
|
|
7462
|
+
function profileSetupReturnSummaryFields(result) {
|
|
7463
|
+
const input = result.return_summary_fields;
|
|
7464
|
+
if (!Array.isArray(input)) return [];
|
|
7465
|
+
const fields = [];
|
|
7466
|
+
for (const item of input) {
|
|
7467
|
+
if (typeof item === "string") {
|
|
7468
|
+
const path8 = item.trim();
|
|
7469
|
+
if (path8) fields.push({ path: path8 });
|
|
7470
|
+
continue;
|
|
7471
|
+
}
|
|
7472
|
+
if (!isRecord(item)) continue;
|
|
7473
|
+
const path7 = stringValue2(item.path) ?? stringValue2(item.key) ?? stringValue2(item.json_path) ?? stringValue2(item.jsonPath);
|
|
7474
|
+
if (!path7) continue;
|
|
7475
|
+
const label = stringValue2(item.label) ?? stringValue2(item.name) ?? stringValue2(item.title);
|
|
7476
|
+
fields.push(label ? { path: path7, label } : { path: path7 });
|
|
7477
|
+
}
|
|
7478
|
+
return fields;
|
|
7479
|
+
}
|
|
7480
|
+
function profileSetupReturnSummary(result) {
|
|
7481
|
+
if (result.returned === void 0) return [];
|
|
7482
|
+
return profileSetupReturnSummaryFields(result).map((field) => {
|
|
7483
|
+
const resolved = resolveJsonPath(result.returned, field.path);
|
|
7484
|
+
const receipt = {
|
|
7485
|
+
label: field.label || field.path,
|
|
7486
|
+
path: field.path,
|
|
7487
|
+
exists: resolved.exists
|
|
7488
|
+
};
|
|
7489
|
+
if (resolved.exists) receipt.value = toJsonValue(resolved.value);
|
|
7490
|
+
if (resolved.error) receipt.reason = resolved.error;
|
|
7455
7491
|
return receipt;
|
|
7456
7492
|
});
|
|
7457
7493
|
}
|
|
@@ -7640,6 +7676,37 @@ function normalizeSetupActionArgs(input, index) {
|
|
|
7640
7676
|
}
|
|
7641
7677
|
return argsInput.map(toJsonValue);
|
|
7642
7678
|
}
|
|
7679
|
+
function normalizeReturnSummaryFields(input, index) {
|
|
7680
|
+
const fieldsInput = valueFromOwn(
|
|
7681
|
+
input,
|
|
7682
|
+
"return_summary_fields",
|
|
7683
|
+
"returnSummaryFields",
|
|
7684
|
+
"summary_fields",
|
|
7685
|
+
"summaryFields",
|
|
7686
|
+
"receipt_fields",
|
|
7687
|
+
"receiptFields",
|
|
7688
|
+
"return_receipt_fields",
|
|
7689
|
+
"returnReceiptFields"
|
|
7690
|
+
);
|
|
7691
|
+
if (fieldsInput === void 0) return void 0;
|
|
7692
|
+
if (!Array.isArray(fieldsInput)) {
|
|
7693
|
+
throw new Error(`target.setup_actions[${index}].return_summary_fields must be an array.`);
|
|
7694
|
+
}
|
|
7695
|
+
return fieldsInput.map((field, fieldIndex) => {
|
|
7696
|
+
if (typeof field === "string") {
|
|
7697
|
+
const path8 = field.trim();
|
|
7698
|
+
if (!path8) throw new Error(`target.setup_actions[${index}].return_summary_fields[${fieldIndex}] requires path.`);
|
|
7699
|
+
return { path: path8 };
|
|
7700
|
+
}
|
|
7701
|
+
if (!isRecord(field)) {
|
|
7702
|
+
throw new Error(`target.setup_actions[${index}].return_summary_fields[${fieldIndex}] must be a string path or object.`);
|
|
7703
|
+
}
|
|
7704
|
+
const path7 = stringFromOwn(field, "path", "key", "json_path", "jsonPath");
|
|
7705
|
+
if (!path7) throw new Error(`target.setup_actions[${index}].return_summary_fields[${fieldIndex}] requires path.`);
|
|
7706
|
+
const label = stringFromOwn(field, "label", "name", "title");
|
|
7707
|
+
return label ? { path: path7, label } : { path: path7 };
|
|
7708
|
+
});
|
|
7709
|
+
}
|
|
7643
7710
|
function normalizeSetupActionRepeat(input, index) {
|
|
7644
7711
|
const repeat = numberValue(valueFromOwn(input, "repeat", "repeat_count", "repeatCount", "times"));
|
|
7645
7712
|
if (repeat === void 0) return void 0;
|
|
@@ -7861,6 +7928,7 @@ function normalizeSetupAction(input, index) {
|
|
|
7861
7928
|
expect_return: hasExpectedReturn ? toJsonValue(valueFromOwn(input, "expect_return", "expectReturn", "expected_return", "expectedReturn")) : void 0,
|
|
7862
7929
|
store_return_to: storeReturnTo,
|
|
7863
7930
|
capture_return: captureReturn,
|
|
7931
|
+
return_summary_fields: normalizeReturnSummaryFields(input, index),
|
|
7864
7932
|
until_path: untilPath,
|
|
7865
7933
|
until_expected_value: hasUntilExpectedValue ? toJsonValue(valueFromOwn(input, "until_expected_value", "untilExpectedValue", "until_expected", "untilExpected", "until_value", "untilValue", "expected_value", "expectedValue", "expected")) : void 0,
|
|
7866
7934
|
max_calls: maxCalls,
|
|
@@ -10883,6 +10951,8 @@ function profileSetupWindowCallReceipts(results) {
|
|
|
10883
10951
|
};
|
|
10884
10952
|
if (result.returned !== undefined) receipt.returned = result.returned;
|
|
10885
10953
|
if (result.expected_return !== undefined) receipt.expected_return = result.expected_return;
|
|
10954
|
+
const returnSummary = profileSetupReturnSummary(result);
|
|
10955
|
+
if (returnSummary.length) receipt.return_summary = returnSummary;
|
|
10886
10956
|
return receipt;
|
|
10887
10957
|
});
|
|
10888
10958
|
}
|
|
@@ -10900,9 +10970,43 @@ function profileSetupWindowEvalReceipts(results) {
|
|
|
10900
10970
|
};
|
|
10901
10971
|
if (result.returned !== undefined) receipt.returned = result.returned;
|
|
10902
10972
|
if (result.expected_return !== undefined) receipt.expected_return = result.expected_return;
|
|
10973
|
+
const returnSummary = profileSetupReturnSummary(result);
|
|
10974
|
+
if (returnSummary.length) receipt.return_summary = returnSummary;
|
|
10903
10975
|
return receipt;
|
|
10904
10976
|
});
|
|
10905
10977
|
}
|
|
10978
|
+
function profileSetupReturnSummaryFields(result) {
|
|
10979
|
+
const input = result && result.return_summary_fields;
|
|
10980
|
+
if (!Array.isArray(input)) return [];
|
|
10981
|
+
const fields = [];
|
|
10982
|
+
for (const item of input) {
|
|
10983
|
+
if (typeof item === "string") {
|
|
10984
|
+
const path = item.trim();
|
|
10985
|
+
if (path) fields.push({ path });
|
|
10986
|
+
continue;
|
|
10987
|
+
}
|
|
10988
|
+
if (!item || typeof item !== "object" || Array.isArray(item)) continue;
|
|
10989
|
+
const path = String(item.path || item.key || item.json_path || item.jsonPath || "").trim();
|
|
10990
|
+
if (!path) continue;
|
|
10991
|
+
const label = String(item.label || item.name || item.title || "").trim();
|
|
10992
|
+
fields.push(label ? { path, label } : { path });
|
|
10993
|
+
}
|
|
10994
|
+
return fields;
|
|
10995
|
+
}
|
|
10996
|
+
function profileSetupReturnSummary(result) {
|
|
10997
|
+
if (!result || result.returned === undefined) return [];
|
|
10998
|
+
return profileSetupReturnSummaryFields(result).map((field) => {
|
|
10999
|
+
const resolved = resolveJsonProbePath(result.returned, field.path);
|
|
11000
|
+
const receipt = {
|
|
11001
|
+
label: field.label || field.path,
|
|
11002
|
+
path: field.path,
|
|
11003
|
+
exists: Boolean(resolved.exists),
|
|
11004
|
+
};
|
|
11005
|
+
if (resolved.exists) receipt.value = setupJsonValue(resolved.value);
|
|
11006
|
+
if (resolved.error) receipt.reason = resolved.error;
|
|
11007
|
+
return receipt;
|
|
11008
|
+
});
|
|
11009
|
+
}
|
|
10906
11010
|
function profileSetupRangeValueReceipts(results) {
|
|
10907
11011
|
return (results || [])
|
|
10908
11012
|
.filter((result) => result && profileSetupResultAction(result) === "set_range_value")
|
|
@@ -12637,6 +12741,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
12637
12741
|
const script = String(action.script || action.code || action.source || action.body || "");
|
|
12638
12742
|
const args = Array.isArray(action.args) ? action.args : [];
|
|
12639
12743
|
const storeReturnTo = String(action.store_return_to || action.storeReturnTo || action.save_return_to || action.saveReturnTo || action.assign_return_to || action.assignReturnTo || action.return_state_path || action.returnStatePath || "").trim();
|
|
12744
|
+
const returnSummaryFields = Array.isArray(action.return_summary_fields) ? action.return_summary_fields : [];
|
|
12640
12745
|
if (!script.trim()) return { ...base, reason: "missing_script" };
|
|
12641
12746
|
const scope = await setupActionScope(action, timeout);
|
|
12642
12747
|
if (!scope.ok) return setupScopeFailure(base, scope);
|
|
@@ -12666,6 +12771,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
12666
12771
|
return_captured: captureReturn,
|
|
12667
12772
|
expected_return: hasExpectation ? setupJsonValue(expected) : undefined,
|
|
12668
12773
|
return_stored_to: result.return_stored_to || storeReturnTo || undefined,
|
|
12774
|
+
return_summary_fields: returnSummaryFields.length ? setupJsonValue(returnSummaryFields) : undefined,
|
|
12669
12775
|
reason: result.ok ? (expectationMet ? undefined : "unexpected_return_value") : result.reason,
|
|
12670
12776
|
store_reason: result.store_reason || undefined,
|
|
12671
12777
|
error: result.error || undefined,
|
|
@@ -12675,6 +12781,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
12675
12781
|
const path = String(action.path || action.function_path || action.functionPath || "");
|
|
12676
12782
|
const args = Array.isArray(action.args) ? action.args : [];
|
|
12677
12783
|
const storeReturnTo = String(action.store_return_to || action.storeReturnTo || action.save_return_to || action.saveReturnTo || action.assign_return_to || action.assignReturnTo || action.return_state_path || action.returnStatePath || "").trim();
|
|
12784
|
+
const returnSummaryFields = Array.isArray(action.return_summary_fields) ? action.return_summary_fields : [];
|
|
12678
12785
|
if (!path) return { ...base, path, reason: "missing_path" };
|
|
12679
12786
|
const scope = await setupActionScope(action, timeout);
|
|
12680
12787
|
if (!scope.ok) return setupScopeFailure(base, scope);
|
|
@@ -12704,6 +12811,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
12704
12811
|
return_captured: captureReturn,
|
|
12705
12812
|
expected_return: hasExpectation ? setupJsonValue(expected) : undefined,
|
|
12706
12813
|
return_stored_to: result.return_stored_to || storeReturnTo || undefined,
|
|
12814
|
+
return_summary_fields: returnSummaryFields.length ? setupJsonValue(returnSummaryFields) : undefined,
|
|
12707
12815
|
reason: result.ok ? (expectationMet ? undefined : "unexpected_return_value") : result.reason,
|
|
12708
12816
|
store_reason: result.store_reason || undefined,
|
|
12709
12817
|
error: result.error || undefined,
|
|
@@ -15276,6 +15384,15 @@ function cliValueLabel(value) {
|
|
|
15276
15384
|
return String(value);
|
|
15277
15385
|
}
|
|
15278
15386
|
}
|
|
15387
|
+
function cliReturnSummaryLabel(value) {
|
|
15388
|
+
if (!Array.isArray(value)) return void 0;
|
|
15389
|
+
const parts = value.map(cliRecord).filter((item) => Boolean(item)).map((item) => {
|
|
15390
|
+
const label = cliString(item.label) || cliString(item.path) || "value";
|
|
15391
|
+
const observed = item.exists === false ? "missing" : cliValueLabel(item.value);
|
|
15392
|
+
return `${label}=${observed ?? "null"}`;
|
|
15393
|
+
}).filter(Boolean);
|
|
15394
|
+
return parts.length ? parts.join(", ") : void 0;
|
|
15395
|
+
}
|
|
15279
15396
|
function cliStringArray(value) {
|
|
15280
15397
|
return Array.isArray(value) ? value.filter((entry) => typeof entry === "string" && Boolean(entry.trim())) : [];
|
|
15281
15398
|
}
|
|
@@ -15450,10 +15567,11 @@ function profileSetupSummaryMarkdown(result) {
|
|
|
15450
15567
|
const storedTo = cliString(receipt.return_stored_to);
|
|
15451
15568
|
const returned = cliValueLabel(receipt.returned);
|
|
15452
15569
|
const expected = cliValueLabel(receipt.expected_return);
|
|
15570
|
+
const returnSummary = cliReturnSummaryLabel(receipt.return_summary);
|
|
15453
15571
|
const captured = receipt.return_captured === true ? "captured" : receipt.return_captured === false ? "not captured" : "capture unknown";
|
|
15454
15572
|
const ok = receipt.ok === false ? "failed" : "ok";
|
|
15455
15573
|
const reason = cliString(receipt.reason);
|
|
15456
|
-
lines.push(`- ${name} window_call: ${ok}, ${markdownInlineCode(path7)}${storedTo ? `, stored ${markdownInlineCode(storedTo)}` : ""}, return ${captured}${expected === void 0 ? "" : `, expected ${markdownInlineCode(expected, 80)}`}${returned === void 0 ? "" : `, returned ${markdownInlineCode(returned, 80)}`}${reason ? `, reason ${markdownInlineCode(reason, 100)}` : ""}`);
|
|
15574
|
+
lines.push(`- ${name} window_call: ${ok}, ${markdownInlineCode(path7)}${storedTo ? `, stored ${markdownInlineCode(storedTo)}` : ""}, return ${captured}${expected === void 0 ? "" : `, expected ${markdownInlineCode(expected, 80)}`}${returnSummary ? `, summary ${markdownInlineCode(returnSummary, 140)}` : ""}${returned === void 0 ? "" : `, returned ${markdownInlineCode(returned, 80)}`}${reason ? `, reason ${markdownInlineCode(reason, 100)}` : ""}`);
|
|
15457
15575
|
}
|
|
15458
15576
|
if (windowCallDetails.length > 12) lines.push(`- ${windowCallDetails.length - 12} additional window_call receipt(s) omitted.`);
|
|
15459
15577
|
const windowEvalDetails = viewports.flatMap((viewport) => {
|
|
@@ -15466,10 +15584,11 @@ function profileSetupSummaryMarkdown(result) {
|
|
|
15466
15584
|
const storedTo = cliString(receipt.return_stored_to);
|
|
15467
15585
|
const returned = cliValueLabel(receipt.returned);
|
|
15468
15586
|
const expected = cliValueLabel(receipt.expected_return);
|
|
15587
|
+
const returnSummary = cliReturnSummaryLabel(receipt.return_summary);
|
|
15469
15588
|
const captured = receipt.return_captured === true ? "captured" : receipt.return_captured === false ? "not captured" : "capture unknown";
|
|
15470
15589
|
const ok = receipt.ok === false ? "failed" : "ok";
|
|
15471
15590
|
const reason = cliString(receipt.reason);
|
|
15472
|
-
lines.push(`- ${name} window_eval: ${ok}${scriptLength === void 0 ? "" : `, script ${scriptLength} chars`}${storedTo ? `, stored ${markdownInlineCode(storedTo)}` : ""}, return ${captured}${expected === void 0 ? "" : `, expected ${markdownInlineCode(expected, 80)}`}${returned === void 0 ? "" : `, returned ${markdownInlineCode(returned, 80)}`}${reason ? `, reason ${markdownInlineCode(reason, 100)}` : ""}`);
|
|
15591
|
+
lines.push(`- ${name} window_eval: ${ok}${scriptLength === void 0 ? "" : `, script ${scriptLength} chars`}${storedTo ? `, stored ${markdownInlineCode(storedTo)}` : ""}, return ${captured}${expected === void 0 ? "" : `, expected ${markdownInlineCode(expected, 80)}`}${returnSummary ? `, summary ${markdownInlineCode(returnSummary, 140)}` : ""}${returned === void 0 ? "" : `, returned ${markdownInlineCode(returned, 80)}`}${reason ? `, reason ${markdownInlineCode(reason, 100)}` : ""}`);
|
|
15473
15592
|
}
|
|
15474
15593
|
if (windowEvalDetails.length > 12) lines.push(`- ${windowEvalDetails.length - 12} additional window_eval receipt(s) omitted.`);
|
|
15475
15594
|
const windowCallUntilDetails = viewports.flatMap((viewport) => {
|
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-YB3LNLZB.js";
|
|
17
17
|
import {
|
|
18
18
|
createRiddleApiClient,
|
|
19
19
|
isTerminalRiddleJobStatus,
|
|
@@ -635,6 +635,15 @@ function cliValueLabel(value) {
|
|
|
635
635
|
return String(value);
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
|
+
function cliReturnSummaryLabel(value) {
|
|
639
|
+
if (!Array.isArray(value)) return void 0;
|
|
640
|
+
const parts = value.map(cliRecord).filter((item) => Boolean(item)).map((item) => {
|
|
641
|
+
const label = cliString(item.label) || cliString(item.path) || "value";
|
|
642
|
+
const observed = item.exists === false ? "missing" : cliValueLabel(item.value);
|
|
643
|
+
return `${label}=${observed ?? "null"}`;
|
|
644
|
+
}).filter(Boolean);
|
|
645
|
+
return parts.length ? parts.join(", ") : void 0;
|
|
646
|
+
}
|
|
638
647
|
function cliStringArray(value) {
|
|
639
648
|
return Array.isArray(value) ? value.filter((entry) => typeof entry === "string" && Boolean(entry.trim())) : [];
|
|
640
649
|
}
|
|
@@ -809,10 +818,11 @@ function profileSetupSummaryMarkdown(result) {
|
|
|
809
818
|
const storedTo = cliString(receipt.return_stored_to);
|
|
810
819
|
const returned = cliValueLabel(receipt.returned);
|
|
811
820
|
const expected = cliValueLabel(receipt.expected_return);
|
|
821
|
+
const returnSummary = cliReturnSummaryLabel(receipt.return_summary);
|
|
812
822
|
const captured = receipt.return_captured === true ? "captured" : receipt.return_captured === false ? "not captured" : "capture unknown";
|
|
813
823
|
const ok = receipt.ok === false ? "failed" : "ok";
|
|
814
824
|
const reason = cliString(receipt.reason);
|
|
815
|
-
lines.push(`- ${name} window_call: ${ok}, ${markdownInlineCode(path2)}${storedTo ? `, stored ${markdownInlineCode(storedTo)}` : ""}, return ${captured}${expected === void 0 ? "" : `, expected ${markdownInlineCode(expected, 80)}`}${returned === void 0 ? "" : `, returned ${markdownInlineCode(returned, 80)}`}${reason ? `, reason ${markdownInlineCode(reason, 100)}` : ""}`);
|
|
825
|
+
lines.push(`- ${name} window_call: ${ok}, ${markdownInlineCode(path2)}${storedTo ? `, stored ${markdownInlineCode(storedTo)}` : ""}, return ${captured}${expected === void 0 ? "" : `, expected ${markdownInlineCode(expected, 80)}`}${returnSummary ? `, summary ${markdownInlineCode(returnSummary, 140)}` : ""}${returned === void 0 ? "" : `, returned ${markdownInlineCode(returned, 80)}`}${reason ? `, reason ${markdownInlineCode(reason, 100)}` : ""}`);
|
|
816
826
|
}
|
|
817
827
|
if (windowCallDetails.length > 12) lines.push(`- ${windowCallDetails.length - 12} additional window_call receipt(s) omitted.`);
|
|
818
828
|
const windowEvalDetails = viewports.flatMap((viewport) => {
|
|
@@ -825,10 +835,11 @@ function profileSetupSummaryMarkdown(result) {
|
|
|
825
835
|
const storedTo = cliString(receipt.return_stored_to);
|
|
826
836
|
const returned = cliValueLabel(receipt.returned);
|
|
827
837
|
const expected = cliValueLabel(receipt.expected_return);
|
|
838
|
+
const returnSummary = cliReturnSummaryLabel(receipt.return_summary);
|
|
828
839
|
const captured = receipt.return_captured === true ? "captured" : receipt.return_captured === false ? "not captured" : "capture unknown";
|
|
829
840
|
const ok = receipt.ok === false ? "failed" : "ok";
|
|
830
841
|
const reason = cliString(receipt.reason);
|
|
831
|
-
lines.push(`- ${name} window_eval: ${ok}${scriptLength === void 0 ? "" : `, script ${scriptLength} chars`}${storedTo ? `, stored ${markdownInlineCode(storedTo)}` : ""}, return ${captured}${expected === void 0 ? "" : `, expected ${markdownInlineCode(expected, 80)}`}${returned === void 0 ? "" : `, returned ${markdownInlineCode(returned, 80)}`}${reason ? `, reason ${markdownInlineCode(reason, 100)}` : ""}`);
|
|
842
|
+
lines.push(`- ${name} window_eval: ${ok}${scriptLength === void 0 ? "" : `, script ${scriptLength} chars`}${storedTo ? `, stored ${markdownInlineCode(storedTo)}` : ""}, return ${captured}${expected === void 0 ? "" : `, expected ${markdownInlineCode(expected, 80)}`}${returnSummary ? `, summary ${markdownInlineCode(returnSummary, 140)}` : ""}${returned === void 0 ? "" : `, returned ${markdownInlineCode(returned, 80)}`}${reason ? `, reason ${markdownInlineCode(reason, 100)}` : ""}`);
|
|
832
843
|
}
|
|
833
844
|
if (windowEvalDetails.length > 12) lines.push(`- ${windowEvalDetails.length - 12} additional window_eval receipt(s) omitted.`);
|
|
834
845
|
const windowCallUntilDetails = viewports.flatMap((viewport) => {
|
package/dist/index.cjs
CHANGED
|
@@ -9213,6 +9213,8 @@ function profileSetupWindowCallReceipts(results) {
|
|
|
9213
9213
|
};
|
|
9214
9214
|
if (result.returned !== void 0) receipt.returned = result.returned;
|
|
9215
9215
|
if (result.expected_return !== void 0) receipt.expected_return = result.expected_return;
|
|
9216
|
+
const returnSummary = profileSetupReturnSummary(result);
|
|
9217
|
+
if (returnSummary.length) receipt.return_summary = returnSummary;
|
|
9216
9218
|
return receipt;
|
|
9217
9219
|
});
|
|
9218
9220
|
}
|
|
@@ -9228,6 +9230,40 @@ function profileSetupWindowEvalReceipts(results) {
|
|
|
9228
9230
|
};
|
|
9229
9231
|
if (result.returned !== void 0) receipt.returned = result.returned;
|
|
9230
9232
|
if (result.expected_return !== void 0) receipt.expected_return = result.expected_return;
|
|
9233
|
+
const returnSummary = profileSetupReturnSummary(result);
|
|
9234
|
+
if (returnSummary.length) receipt.return_summary = returnSummary;
|
|
9235
|
+
return receipt;
|
|
9236
|
+
});
|
|
9237
|
+
}
|
|
9238
|
+
function profileSetupReturnSummaryFields(result) {
|
|
9239
|
+
const input = result.return_summary_fields;
|
|
9240
|
+
if (!Array.isArray(input)) return [];
|
|
9241
|
+
const fields = [];
|
|
9242
|
+
for (const item of input) {
|
|
9243
|
+
if (typeof item === "string") {
|
|
9244
|
+
const path7 = item.trim();
|
|
9245
|
+
if (path7) fields.push({ path: path7 });
|
|
9246
|
+
continue;
|
|
9247
|
+
}
|
|
9248
|
+
if (!isRecord2(item)) continue;
|
|
9249
|
+
const path6 = stringValue5(item.path) ?? stringValue5(item.key) ?? stringValue5(item.json_path) ?? stringValue5(item.jsonPath);
|
|
9250
|
+
if (!path6) continue;
|
|
9251
|
+
const label = stringValue5(item.label) ?? stringValue5(item.name) ?? stringValue5(item.title);
|
|
9252
|
+
fields.push(label ? { path: path6, label } : { path: path6 });
|
|
9253
|
+
}
|
|
9254
|
+
return fields;
|
|
9255
|
+
}
|
|
9256
|
+
function profileSetupReturnSummary(result) {
|
|
9257
|
+
if (result.returned === void 0) return [];
|
|
9258
|
+
return profileSetupReturnSummaryFields(result).map((field) => {
|
|
9259
|
+
const resolved = resolveJsonPath(result.returned, field.path);
|
|
9260
|
+
const receipt = {
|
|
9261
|
+
label: field.label || field.path,
|
|
9262
|
+
path: field.path,
|
|
9263
|
+
exists: resolved.exists
|
|
9264
|
+
};
|
|
9265
|
+
if (resolved.exists) receipt.value = toJsonValue(resolved.value);
|
|
9266
|
+
if (resolved.error) receipt.reason = resolved.error;
|
|
9231
9267
|
return receipt;
|
|
9232
9268
|
});
|
|
9233
9269
|
}
|
|
@@ -9416,6 +9452,37 @@ function normalizeSetupActionArgs(input, index) {
|
|
|
9416
9452
|
}
|
|
9417
9453
|
return argsInput.map(toJsonValue);
|
|
9418
9454
|
}
|
|
9455
|
+
function normalizeReturnSummaryFields(input, index) {
|
|
9456
|
+
const fieldsInput = valueFromOwn(
|
|
9457
|
+
input,
|
|
9458
|
+
"return_summary_fields",
|
|
9459
|
+
"returnSummaryFields",
|
|
9460
|
+
"summary_fields",
|
|
9461
|
+
"summaryFields",
|
|
9462
|
+
"receipt_fields",
|
|
9463
|
+
"receiptFields",
|
|
9464
|
+
"return_receipt_fields",
|
|
9465
|
+
"returnReceiptFields"
|
|
9466
|
+
);
|
|
9467
|
+
if (fieldsInput === void 0) return void 0;
|
|
9468
|
+
if (!Array.isArray(fieldsInput)) {
|
|
9469
|
+
throw new Error(`target.setup_actions[${index}].return_summary_fields must be an array.`);
|
|
9470
|
+
}
|
|
9471
|
+
return fieldsInput.map((field, fieldIndex) => {
|
|
9472
|
+
if (typeof field === "string") {
|
|
9473
|
+
const path7 = field.trim();
|
|
9474
|
+
if (!path7) throw new Error(`target.setup_actions[${index}].return_summary_fields[${fieldIndex}] requires path.`);
|
|
9475
|
+
return { path: path7 };
|
|
9476
|
+
}
|
|
9477
|
+
if (!isRecord2(field)) {
|
|
9478
|
+
throw new Error(`target.setup_actions[${index}].return_summary_fields[${fieldIndex}] must be a string path or object.`);
|
|
9479
|
+
}
|
|
9480
|
+
const path6 = stringFromOwn(field, "path", "key", "json_path", "jsonPath");
|
|
9481
|
+
if (!path6) throw new Error(`target.setup_actions[${index}].return_summary_fields[${fieldIndex}] requires path.`);
|
|
9482
|
+
const label = stringFromOwn(field, "label", "name", "title");
|
|
9483
|
+
return label ? { path: path6, label } : { path: path6 };
|
|
9484
|
+
});
|
|
9485
|
+
}
|
|
9419
9486
|
function normalizeSetupActionRepeat(input, index) {
|
|
9420
9487
|
const repeat = numberValue3(valueFromOwn(input, "repeat", "repeat_count", "repeatCount", "times"));
|
|
9421
9488
|
if (repeat === void 0) return void 0;
|
|
@@ -9637,6 +9704,7 @@ function normalizeSetupAction(input, index) {
|
|
|
9637
9704
|
expect_return: hasExpectedReturn ? toJsonValue(valueFromOwn(input, "expect_return", "expectReturn", "expected_return", "expectedReturn")) : void 0,
|
|
9638
9705
|
store_return_to: storeReturnTo,
|
|
9639
9706
|
capture_return: captureReturn,
|
|
9707
|
+
return_summary_fields: normalizeReturnSummaryFields(input, index),
|
|
9640
9708
|
until_path: untilPath,
|
|
9641
9709
|
until_expected_value: hasUntilExpectedValue ? toJsonValue(valueFromOwn(input, "until_expected_value", "untilExpectedValue", "until_expected", "untilExpected", "until_value", "untilValue", "expected_value", "expectedValue", "expected")) : void 0,
|
|
9642
9710
|
max_calls: maxCalls,
|
|
@@ -12675,6 +12743,8 @@ function profileSetupWindowCallReceipts(results) {
|
|
|
12675
12743
|
};
|
|
12676
12744
|
if (result.returned !== undefined) receipt.returned = result.returned;
|
|
12677
12745
|
if (result.expected_return !== undefined) receipt.expected_return = result.expected_return;
|
|
12746
|
+
const returnSummary = profileSetupReturnSummary(result);
|
|
12747
|
+
if (returnSummary.length) receipt.return_summary = returnSummary;
|
|
12678
12748
|
return receipt;
|
|
12679
12749
|
});
|
|
12680
12750
|
}
|
|
@@ -12692,9 +12762,43 @@ function profileSetupWindowEvalReceipts(results) {
|
|
|
12692
12762
|
};
|
|
12693
12763
|
if (result.returned !== undefined) receipt.returned = result.returned;
|
|
12694
12764
|
if (result.expected_return !== undefined) receipt.expected_return = result.expected_return;
|
|
12765
|
+
const returnSummary = profileSetupReturnSummary(result);
|
|
12766
|
+
if (returnSummary.length) receipt.return_summary = returnSummary;
|
|
12695
12767
|
return receipt;
|
|
12696
12768
|
});
|
|
12697
12769
|
}
|
|
12770
|
+
function profileSetupReturnSummaryFields(result) {
|
|
12771
|
+
const input = result && result.return_summary_fields;
|
|
12772
|
+
if (!Array.isArray(input)) return [];
|
|
12773
|
+
const fields = [];
|
|
12774
|
+
for (const item of input) {
|
|
12775
|
+
if (typeof item === "string") {
|
|
12776
|
+
const path = item.trim();
|
|
12777
|
+
if (path) fields.push({ path });
|
|
12778
|
+
continue;
|
|
12779
|
+
}
|
|
12780
|
+
if (!item || typeof item !== "object" || Array.isArray(item)) continue;
|
|
12781
|
+
const path = String(item.path || item.key || item.json_path || item.jsonPath || "").trim();
|
|
12782
|
+
if (!path) continue;
|
|
12783
|
+
const label = String(item.label || item.name || item.title || "").trim();
|
|
12784
|
+
fields.push(label ? { path, label } : { path });
|
|
12785
|
+
}
|
|
12786
|
+
return fields;
|
|
12787
|
+
}
|
|
12788
|
+
function profileSetupReturnSummary(result) {
|
|
12789
|
+
if (!result || result.returned === undefined) return [];
|
|
12790
|
+
return profileSetupReturnSummaryFields(result).map((field) => {
|
|
12791
|
+
const resolved = resolveJsonProbePath(result.returned, field.path);
|
|
12792
|
+
const receipt = {
|
|
12793
|
+
label: field.label || field.path,
|
|
12794
|
+
path: field.path,
|
|
12795
|
+
exists: Boolean(resolved.exists),
|
|
12796
|
+
};
|
|
12797
|
+
if (resolved.exists) receipt.value = setupJsonValue(resolved.value);
|
|
12798
|
+
if (resolved.error) receipt.reason = resolved.error;
|
|
12799
|
+
return receipt;
|
|
12800
|
+
});
|
|
12801
|
+
}
|
|
12698
12802
|
function profileSetupRangeValueReceipts(results) {
|
|
12699
12803
|
return (results || [])
|
|
12700
12804
|
.filter((result) => result && profileSetupResultAction(result) === "set_range_value")
|
|
@@ -14429,6 +14533,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
14429
14533
|
const script = String(action.script || action.code || action.source || action.body || "");
|
|
14430
14534
|
const args = Array.isArray(action.args) ? action.args : [];
|
|
14431
14535
|
const storeReturnTo = String(action.store_return_to || action.storeReturnTo || action.save_return_to || action.saveReturnTo || action.assign_return_to || action.assignReturnTo || action.return_state_path || action.returnStatePath || "").trim();
|
|
14536
|
+
const returnSummaryFields = Array.isArray(action.return_summary_fields) ? action.return_summary_fields : [];
|
|
14432
14537
|
if (!script.trim()) return { ...base, reason: "missing_script" };
|
|
14433
14538
|
const scope = await setupActionScope(action, timeout);
|
|
14434
14539
|
if (!scope.ok) return setupScopeFailure(base, scope);
|
|
@@ -14458,6 +14563,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
14458
14563
|
return_captured: captureReturn,
|
|
14459
14564
|
expected_return: hasExpectation ? setupJsonValue(expected) : undefined,
|
|
14460
14565
|
return_stored_to: result.return_stored_to || storeReturnTo || undefined,
|
|
14566
|
+
return_summary_fields: returnSummaryFields.length ? setupJsonValue(returnSummaryFields) : undefined,
|
|
14461
14567
|
reason: result.ok ? (expectationMet ? undefined : "unexpected_return_value") : result.reason,
|
|
14462
14568
|
store_reason: result.store_reason || undefined,
|
|
14463
14569
|
error: result.error || undefined,
|
|
@@ -14467,6 +14573,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
14467
14573
|
const path = String(action.path || action.function_path || action.functionPath || "");
|
|
14468
14574
|
const args = Array.isArray(action.args) ? action.args : [];
|
|
14469
14575
|
const storeReturnTo = String(action.store_return_to || action.storeReturnTo || action.save_return_to || action.saveReturnTo || action.assign_return_to || action.assignReturnTo || action.return_state_path || action.returnStatePath || "").trim();
|
|
14576
|
+
const returnSummaryFields = Array.isArray(action.return_summary_fields) ? action.return_summary_fields : [];
|
|
14470
14577
|
if (!path) return { ...base, path, reason: "missing_path" };
|
|
14471
14578
|
const scope = await setupActionScope(action, timeout);
|
|
14472
14579
|
if (!scope.ok) return setupScopeFailure(base, scope);
|
|
@@ -14496,6 +14603,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
14496
14603
|
return_captured: captureReturn,
|
|
14497
14604
|
expected_return: hasExpectation ? setupJsonValue(expected) : undefined,
|
|
14498
14605
|
return_stored_to: result.return_stored_to || storeReturnTo || undefined,
|
|
14606
|
+
return_summary_fields: returnSummaryFields.length ? setupJsonValue(returnSummaryFields) : undefined,
|
|
14499
14607
|
reason: result.ok ? (expectationMet ? undefined : "unexpected_return_value") : result.reason,
|
|
14500
14608
|
store_reason: result.store_reason || undefined,
|
|
14501
14609
|
error: result.error || undefined,
|
package/dist/index.d.cts
CHANGED
|
@@ -10,5 +10,5 @@ export { CreateCaptureDiagnosticInput, DEFAULT_DIAGNOSTIC_ARRAY_LIMIT, DEFAULT_D
|
|
|
10
10
|
export { BuildVisualProofSessionInput, RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION, RIDDLE_PROOF_VISUAL_SESSION_VERSION, VisualProofSessionMismatch, buildVisualProofSession, compareVisualProofSessionFingerprint, parseVisualProofSession, visualSessionFingerprint, visualSessionFingerprintBasis } from './proof-session.cjs';
|
|
11
11
|
export { AssessPlayabilityOptions, RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION, RIDDLE_PROOF_PLAYABILITY_VERSION, RiddleProofPlayabilityAssessment, RiddleProofPlayabilityEvidence, assessPlayabilityEvidence, extractPlayabilityEvidence, isRiddleProofPlayabilityMode } from './playability.cjs';
|
|
12
12
|
export { AssessBasicGameplayOptions, AttachBasicGameplayArtifactOptions, BASIC_GAMEPLAY_ACTION_TYPES, BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES, BasicGameplayActionResult, BasicGameplayActionType, BasicGameplayArtifactResolution, BasicGameplayAssessmentSummary, BasicGameplayBoundsOffender, BasicGameplayCanvasState, BasicGameplayCatchRecord, BasicGameplayChangeSummary, BasicGameplayFailureCode, BasicGameplayFixReference, BasicGameplayMetric, BasicGameplayMobileEvidence, BasicGameplayProgressCheckType, BasicGameplayProgressionCheck, BasicGameplayProofArtifact, BasicGameplayResponsiveViewportEvidence, BasicGameplayRouteReference, BasicGameplaySnapshot, BasicGameplaySuiteFailure, BasicGameplayWarningCode, CreateBasicGameplayCatchSummaryInput, RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION, RiddleProofBasicGameplayAssessment, RiddleProofBasicGameplayCatchSummary, RiddleProofBasicGameplayEvidence, RiddleProofBasicGameplayRouteAssessment, RiddleProofBasicGameplayRouteEvidence, assessBasicGameplayEvidence, assessBasicGameplayProgressionCheck, assessBasicGameplayProgressionChecks, assessBasicGameplayRoute, attachBasicGameplayArtifactScreenshotHashes, augmentBasicGameplayAssessmentWithProgressionChecks, compactBasicGameplayText, createBasicGameplayCatchRecords, createBasicGameplayCatchSummary, extractBasicGameplayEvidence, resolveBasicGameplayProgressionCheckWithArtifactScreenshots, sanitizeBasicGameplayJsonString } from './basic-gameplay.cjs';
|
|
13
|
-
export { NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, RiddleProofArtifactBodyAssertionInput, RiddleProofArtifactBodyAssertionResult, RiddleProofProfile, RiddleProofProfileArtifactRef, RiddleProofProfileBaselinePolicy, RiddleProofProfileBoundsOffender, RiddleProofProfileCheck, RiddleProofProfileCheckResult, RiddleProofProfileCheckType, RiddleProofProfileEvidence, RiddleProofProfileFailureAction, RiddleProofProfileHttpStatusBodyJsonAssertion, RiddleProofProfileHttpStatusBodyJsonAssertionResult, RiddleProofProfileHttpStatusPreflightCheckResult, RiddleProofProfileHttpStatusPreflightFetch, RiddleProofProfileHttpStatusPreflightFetchResponse, RiddleProofProfileHttpStatusPreflightOptions, RiddleProofProfileHttpStatusPreflightResult, RiddleProofProfileJsonValueType, RiddleProofProfileNetworkAbortErrorCode, RiddleProofProfileNetworkMock, RiddleProofProfileNetworkMockResponse, RiddleProofProfileResult, RiddleProofProfileRouteEvidence, RiddleProofProfileRouteInventoryRoute, RiddleProofProfileRunner, RiddleProofProfileSetupAction, RiddleProofProfileSetupActionType, RiddleProofProfileStatus, RiddleProofProfileTarget, RiddleProofProfileViewport, RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, preflightRiddleProofProfileHttpStatusChecks, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from './profile.cjs';
|
|
13
|
+
export { NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, RiddleProofArtifactBodyAssertionInput, RiddleProofArtifactBodyAssertionResult, RiddleProofProfile, RiddleProofProfileArtifactRef, RiddleProofProfileBaselinePolicy, RiddleProofProfileBoundsOffender, RiddleProofProfileCheck, RiddleProofProfileCheckResult, RiddleProofProfileCheckType, RiddleProofProfileEvidence, RiddleProofProfileFailureAction, RiddleProofProfileHttpStatusBodyJsonAssertion, RiddleProofProfileHttpStatusBodyJsonAssertionResult, RiddleProofProfileHttpStatusPreflightCheckResult, RiddleProofProfileHttpStatusPreflightFetch, RiddleProofProfileHttpStatusPreflightFetchResponse, RiddleProofProfileHttpStatusPreflightOptions, RiddleProofProfileHttpStatusPreflightResult, RiddleProofProfileJsonValueType, RiddleProofProfileNetworkAbortErrorCode, RiddleProofProfileNetworkMock, RiddleProofProfileNetworkMockResponse, RiddleProofProfileResult, RiddleProofProfileReturnSummaryField, RiddleProofProfileRouteEvidence, RiddleProofProfileRouteInventoryRoute, RiddleProofProfileRunner, RiddleProofProfileSetupAction, RiddleProofProfileSetupActionType, RiddleProofProfileStatus, RiddleProofProfileTarget, RiddleProofProfileViewport, RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, preflightRiddleProofProfileHttpStatusChecks, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from './profile.cjs';
|
|
14
14
|
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployResult, RiddlePreviewFramework, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from './riddle-client.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ export { CreateCaptureDiagnosticInput, DEFAULT_DIAGNOSTIC_ARRAY_LIMIT, DEFAULT_D
|
|
|
10
10
|
export { BuildVisualProofSessionInput, RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION, RIDDLE_PROOF_VISUAL_SESSION_VERSION, VisualProofSessionMismatch, buildVisualProofSession, compareVisualProofSessionFingerprint, parseVisualProofSession, visualSessionFingerprint, visualSessionFingerprintBasis } from './proof-session.js';
|
|
11
11
|
export { AssessPlayabilityOptions, RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION, RIDDLE_PROOF_PLAYABILITY_VERSION, RiddleProofPlayabilityAssessment, RiddleProofPlayabilityEvidence, assessPlayabilityEvidence, extractPlayabilityEvidence, isRiddleProofPlayabilityMode } from './playability.js';
|
|
12
12
|
export { AssessBasicGameplayOptions, AttachBasicGameplayArtifactOptions, BASIC_GAMEPLAY_ACTION_TYPES, BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES, BasicGameplayActionResult, BasicGameplayActionType, BasicGameplayArtifactResolution, BasicGameplayAssessmentSummary, BasicGameplayBoundsOffender, BasicGameplayCanvasState, BasicGameplayCatchRecord, BasicGameplayChangeSummary, BasicGameplayFailureCode, BasicGameplayFixReference, BasicGameplayMetric, BasicGameplayMobileEvidence, BasicGameplayProgressCheckType, BasicGameplayProgressionCheck, BasicGameplayProofArtifact, BasicGameplayResponsiveViewportEvidence, BasicGameplayRouteReference, BasicGameplaySnapshot, BasicGameplaySuiteFailure, BasicGameplayWarningCode, CreateBasicGameplayCatchSummaryInput, RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION, RiddleProofBasicGameplayAssessment, RiddleProofBasicGameplayCatchSummary, RiddleProofBasicGameplayEvidence, RiddleProofBasicGameplayRouteAssessment, RiddleProofBasicGameplayRouteEvidence, assessBasicGameplayEvidence, assessBasicGameplayProgressionCheck, assessBasicGameplayProgressionChecks, assessBasicGameplayRoute, attachBasicGameplayArtifactScreenshotHashes, augmentBasicGameplayAssessmentWithProgressionChecks, compactBasicGameplayText, createBasicGameplayCatchRecords, createBasicGameplayCatchSummary, extractBasicGameplayEvidence, resolveBasicGameplayProgressionCheckWithArtifactScreenshots, sanitizeBasicGameplayJsonString } from './basic-gameplay.js';
|
|
13
|
-
export { NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, RiddleProofArtifactBodyAssertionInput, RiddleProofArtifactBodyAssertionResult, RiddleProofProfile, RiddleProofProfileArtifactRef, RiddleProofProfileBaselinePolicy, RiddleProofProfileBoundsOffender, RiddleProofProfileCheck, RiddleProofProfileCheckResult, RiddleProofProfileCheckType, RiddleProofProfileEvidence, RiddleProofProfileFailureAction, RiddleProofProfileHttpStatusBodyJsonAssertion, RiddleProofProfileHttpStatusBodyJsonAssertionResult, RiddleProofProfileHttpStatusPreflightCheckResult, RiddleProofProfileHttpStatusPreflightFetch, RiddleProofProfileHttpStatusPreflightFetchResponse, RiddleProofProfileHttpStatusPreflightOptions, RiddleProofProfileHttpStatusPreflightResult, RiddleProofProfileJsonValueType, RiddleProofProfileNetworkAbortErrorCode, RiddleProofProfileNetworkMock, RiddleProofProfileNetworkMockResponse, RiddleProofProfileResult, RiddleProofProfileRouteEvidence, RiddleProofProfileRouteInventoryRoute, RiddleProofProfileRunner, RiddleProofProfileSetupAction, RiddleProofProfileSetupActionType, RiddleProofProfileStatus, RiddleProofProfileTarget, RiddleProofProfileViewport, RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, preflightRiddleProofProfileHttpStatusChecks, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from './profile.js';
|
|
13
|
+
export { NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, RiddleProofArtifactBodyAssertionInput, RiddleProofArtifactBodyAssertionResult, RiddleProofProfile, RiddleProofProfileArtifactRef, RiddleProofProfileBaselinePolicy, RiddleProofProfileBoundsOffender, RiddleProofProfileCheck, RiddleProofProfileCheckResult, RiddleProofProfileCheckType, RiddleProofProfileEvidence, RiddleProofProfileFailureAction, RiddleProofProfileHttpStatusBodyJsonAssertion, RiddleProofProfileHttpStatusBodyJsonAssertionResult, RiddleProofProfileHttpStatusPreflightCheckResult, RiddleProofProfileHttpStatusPreflightFetch, RiddleProofProfileHttpStatusPreflightFetchResponse, RiddleProofProfileHttpStatusPreflightOptions, RiddleProofProfileHttpStatusPreflightResult, RiddleProofProfileJsonValueType, RiddleProofProfileNetworkAbortErrorCode, RiddleProofProfileNetworkMock, RiddleProofProfileNetworkMockResponse, RiddleProofProfileResult, RiddleProofProfileReturnSummaryField, RiddleProofProfileRouteEvidence, RiddleProofProfileRouteInventoryRoute, RiddleProofProfileRunner, RiddleProofProfileSetupAction, RiddleProofProfileSetupActionType, RiddleProofProfileStatus, RiddleProofProfileTarget, RiddleProofProfileViewport, RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, preflightRiddleProofProfileHttpStatusChecks, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from './profile.js';
|
|
14
14
|
export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployResult, RiddlePreviewFramework, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from './riddle-client.js';
|
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-YB3LNLZB.js";
|
|
66
66
|
import {
|
|
67
67
|
DEFAULT_RIDDLE_API_BASE_URL,
|
|
68
68
|
DEFAULT_RIDDLE_API_KEY_FILE,
|
package/dist/profile.cjs
CHANGED
|
@@ -527,6 +527,8 @@ function profileSetupWindowCallReceipts(results) {
|
|
|
527
527
|
};
|
|
528
528
|
if (result.returned !== void 0) receipt.returned = result.returned;
|
|
529
529
|
if (result.expected_return !== void 0) receipt.expected_return = result.expected_return;
|
|
530
|
+
const returnSummary = profileSetupReturnSummary(result);
|
|
531
|
+
if (returnSummary.length) receipt.return_summary = returnSummary;
|
|
530
532
|
return receipt;
|
|
531
533
|
});
|
|
532
534
|
}
|
|
@@ -542,6 +544,40 @@ function profileSetupWindowEvalReceipts(results) {
|
|
|
542
544
|
};
|
|
543
545
|
if (result.returned !== void 0) receipt.returned = result.returned;
|
|
544
546
|
if (result.expected_return !== void 0) receipt.expected_return = result.expected_return;
|
|
547
|
+
const returnSummary = profileSetupReturnSummary(result);
|
|
548
|
+
if (returnSummary.length) receipt.return_summary = returnSummary;
|
|
549
|
+
return receipt;
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
function profileSetupReturnSummaryFields(result) {
|
|
553
|
+
const input = result.return_summary_fields;
|
|
554
|
+
if (!Array.isArray(input)) return [];
|
|
555
|
+
const fields = [];
|
|
556
|
+
for (const item of input) {
|
|
557
|
+
if (typeof item === "string") {
|
|
558
|
+
const path2 = item.trim();
|
|
559
|
+
if (path2) fields.push({ path: path2 });
|
|
560
|
+
continue;
|
|
561
|
+
}
|
|
562
|
+
if (!isRecord(item)) continue;
|
|
563
|
+
const path = stringValue(item.path) ?? stringValue(item.key) ?? stringValue(item.json_path) ?? stringValue(item.jsonPath);
|
|
564
|
+
if (!path) continue;
|
|
565
|
+
const label = stringValue(item.label) ?? stringValue(item.name) ?? stringValue(item.title);
|
|
566
|
+
fields.push(label ? { path, label } : { path });
|
|
567
|
+
}
|
|
568
|
+
return fields;
|
|
569
|
+
}
|
|
570
|
+
function profileSetupReturnSummary(result) {
|
|
571
|
+
if (result.returned === void 0) return [];
|
|
572
|
+
return profileSetupReturnSummaryFields(result).map((field) => {
|
|
573
|
+
const resolved = resolveJsonPath(result.returned, field.path);
|
|
574
|
+
const receipt = {
|
|
575
|
+
label: field.label || field.path,
|
|
576
|
+
path: field.path,
|
|
577
|
+
exists: resolved.exists
|
|
578
|
+
};
|
|
579
|
+
if (resolved.exists) receipt.value = toJsonValue(resolved.value);
|
|
580
|
+
if (resolved.error) receipt.reason = resolved.error;
|
|
545
581
|
return receipt;
|
|
546
582
|
});
|
|
547
583
|
}
|
|
@@ -730,6 +766,37 @@ function normalizeSetupActionArgs(input, index) {
|
|
|
730
766
|
}
|
|
731
767
|
return argsInput.map(toJsonValue);
|
|
732
768
|
}
|
|
769
|
+
function normalizeReturnSummaryFields(input, index) {
|
|
770
|
+
const fieldsInput = valueFromOwn(
|
|
771
|
+
input,
|
|
772
|
+
"return_summary_fields",
|
|
773
|
+
"returnSummaryFields",
|
|
774
|
+
"summary_fields",
|
|
775
|
+
"summaryFields",
|
|
776
|
+
"receipt_fields",
|
|
777
|
+
"receiptFields",
|
|
778
|
+
"return_receipt_fields",
|
|
779
|
+
"returnReceiptFields"
|
|
780
|
+
);
|
|
781
|
+
if (fieldsInput === void 0) return void 0;
|
|
782
|
+
if (!Array.isArray(fieldsInput)) {
|
|
783
|
+
throw new Error(`target.setup_actions[${index}].return_summary_fields must be an array.`);
|
|
784
|
+
}
|
|
785
|
+
return fieldsInput.map((field, fieldIndex) => {
|
|
786
|
+
if (typeof field === "string") {
|
|
787
|
+
const path2 = field.trim();
|
|
788
|
+
if (!path2) throw new Error(`target.setup_actions[${index}].return_summary_fields[${fieldIndex}] requires path.`);
|
|
789
|
+
return { path: path2 };
|
|
790
|
+
}
|
|
791
|
+
if (!isRecord(field)) {
|
|
792
|
+
throw new Error(`target.setup_actions[${index}].return_summary_fields[${fieldIndex}] must be a string path or object.`);
|
|
793
|
+
}
|
|
794
|
+
const path = stringFromOwn(field, "path", "key", "json_path", "jsonPath");
|
|
795
|
+
if (!path) throw new Error(`target.setup_actions[${index}].return_summary_fields[${fieldIndex}] requires path.`);
|
|
796
|
+
const label = stringFromOwn(field, "label", "name", "title");
|
|
797
|
+
return label ? { path, label } : { path };
|
|
798
|
+
});
|
|
799
|
+
}
|
|
733
800
|
function normalizeSetupActionRepeat(input, index) {
|
|
734
801
|
const repeat = numberValue(valueFromOwn(input, "repeat", "repeat_count", "repeatCount", "times"));
|
|
735
802
|
if (repeat === void 0) return void 0;
|
|
@@ -951,6 +1018,7 @@ function normalizeSetupAction(input, index) {
|
|
|
951
1018
|
expect_return: hasExpectedReturn ? toJsonValue(valueFromOwn(input, "expect_return", "expectReturn", "expected_return", "expectedReturn")) : void 0,
|
|
952
1019
|
store_return_to: storeReturnTo,
|
|
953
1020
|
capture_return: captureReturn,
|
|
1021
|
+
return_summary_fields: normalizeReturnSummaryFields(input, index),
|
|
954
1022
|
until_path: untilPath,
|
|
955
1023
|
until_expected_value: hasUntilExpectedValue ? toJsonValue(valueFromOwn(input, "until_expected_value", "untilExpectedValue", "until_expected", "untilExpected", "until_value", "untilValue", "expected_value", "expectedValue", "expected")) : void 0,
|
|
956
1024
|
max_calls: maxCalls,
|
|
@@ -3989,6 +4057,8 @@ function profileSetupWindowCallReceipts(results) {
|
|
|
3989
4057
|
};
|
|
3990
4058
|
if (result.returned !== undefined) receipt.returned = result.returned;
|
|
3991
4059
|
if (result.expected_return !== undefined) receipt.expected_return = result.expected_return;
|
|
4060
|
+
const returnSummary = profileSetupReturnSummary(result);
|
|
4061
|
+
if (returnSummary.length) receipt.return_summary = returnSummary;
|
|
3992
4062
|
return receipt;
|
|
3993
4063
|
});
|
|
3994
4064
|
}
|
|
@@ -4006,9 +4076,43 @@ function profileSetupWindowEvalReceipts(results) {
|
|
|
4006
4076
|
};
|
|
4007
4077
|
if (result.returned !== undefined) receipt.returned = result.returned;
|
|
4008
4078
|
if (result.expected_return !== undefined) receipt.expected_return = result.expected_return;
|
|
4079
|
+
const returnSummary = profileSetupReturnSummary(result);
|
|
4080
|
+
if (returnSummary.length) receipt.return_summary = returnSummary;
|
|
4009
4081
|
return receipt;
|
|
4010
4082
|
});
|
|
4011
4083
|
}
|
|
4084
|
+
function profileSetupReturnSummaryFields(result) {
|
|
4085
|
+
const input = result && result.return_summary_fields;
|
|
4086
|
+
if (!Array.isArray(input)) return [];
|
|
4087
|
+
const fields = [];
|
|
4088
|
+
for (const item of input) {
|
|
4089
|
+
if (typeof item === "string") {
|
|
4090
|
+
const path = item.trim();
|
|
4091
|
+
if (path) fields.push({ path });
|
|
4092
|
+
continue;
|
|
4093
|
+
}
|
|
4094
|
+
if (!item || typeof item !== "object" || Array.isArray(item)) continue;
|
|
4095
|
+
const path = String(item.path || item.key || item.json_path || item.jsonPath || "").trim();
|
|
4096
|
+
if (!path) continue;
|
|
4097
|
+
const label = String(item.label || item.name || item.title || "").trim();
|
|
4098
|
+
fields.push(label ? { path, label } : { path });
|
|
4099
|
+
}
|
|
4100
|
+
return fields;
|
|
4101
|
+
}
|
|
4102
|
+
function profileSetupReturnSummary(result) {
|
|
4103
|
+
if (!result || result.returned === undefined) return [];
|
|
4104
|
+
return profileSetupReturnSummaryFields(result).map((field) => {
|
|
4105
|
+
const resolved = resolveJsonProbePath(result.returned, field.path);
|
|
4106
|
+
const receipt = {
|
|
4107
|
+
label: field.label || field.path,
|
|
4108
|
+
path: field.path,
|
|
4109
|
+
exists: Boolean(resolved.exists),
|
|
4110
|
+
};
|
|
4111
|
+
if (resolved.exists) receipt.value = setupJsonValue(resolved.value);
|
|
4112
|
+
if (resolved.error) receipt.reason = resolved.error;
|
|
4113
|
+
return receipt;
|
|
4114
|
+
});
|
|
4115
|
+
}
|
|
4012
4116
|
function profileSetupRangeValueReceipts(results) {
|
|
4013
4117
|
return (results || [])
|
|
4014
4118
|
.filter((result) => result && profileSetupResultAction(result) === "set_range_value")
|
|
@@ -5743,6 +5847,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
5743
5847
|
const script = String(action.script || action.code || action.source || action.body || "");
|
|
5744
5848
|
const args = Array.isArray(action.args) ? action.args : [];
|
|
5745
5849
|
const storeReturnTo = String(action.store_return_to || action.storeReturnTo || action.save_return_to || action.saveReturnTo || action.assign_return_to || action.assignReturnTo || action.return_state_path || action.returnStatePath || "").trim();
|
|
5850
|
+
const returnSummaryFields = Array.isArray(action.return_summary_fields) ? action.return_summary_fields : [];
|
|
5746
5851
|
if (!script.trim()) return { ...base, reason: "missing_script" };
|
|
5747
5852
|
const scope = await setupActionScope(action, timeout);
|
|
5748
5853
|
if (!scope.ok) return setupScopeFailure(base, scope);
|
|
@@ -5772,6 +5877,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
5772
5877
|
return_captured: captureReturn,
|
|
5773
5878
|
expected_return: hasExpectation ? setupJsonValue(expected) : undefined,
|
|
5774
5879
|
return_stored_to: result.return_stored_to || storeReturnTo || undefined,
|
|
5880
|
+
return_summary_fields: returnSummaryFields.length ? setupJsonValue(returnSummaryFields) : undefined,
|
|
5775
5881
|
reason: result.ok ? (expectationMet ? undefined : "unexpected_return_value") : result.reason,
|
|
5776
5882
|
store_reason: result.store_reason || undefined,
|
|
5777
5883
|
error: result.error || undefined,
|
|
@@ -5781,6 +5887,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
5781
5887
|
const path = String(action.path || action.function_path || action.functionPath || "");
|
|
5782
5888
|
const args = Array.isArray(action.args) ? action.args : [];
|
|
5783
5889
|
const storeReturnTo = String(action.store_return_to || action.storeReturnTo || action.save_return_to || action.saveReturnTo || action.assign_return_to || action.assignReturnTo || action.return_state_path || action.returnStatePath || "").trim();
|
|
5890
|
+
const returnSummaryFields = Array.isArray(action.return_summary_fields) ? action.return_summary_fields : [];
|
|
5784
5891
|
if (!path) return { ...base, path, reason: "missing_path" };
|
|
5785
5892
|
const scope = await setupActionScope(action, timeout);
|
|
5786
5893
|
if (!scope.ok) return setupScopeFailure(base, scope);
|
|
@@ -5810,6 +5917,7 @@ async function executeSetupAction(action, ordinal, viewport) {
|
|
|
5810
5917
|
return_captured: captureReturn,
|
|
5811
5918
|
expected_return: hasExpectation ? setupJsonValue(expected) : undefined,
|
|
5812
5919
|
return_stored_to: result.return_stored_to || storeReturnTo || undefined,
|
|
5920
|
+
return_summary_fields: returnSummaryFields.length ? setupJsonValue(returnSummaryFields) : undefined,
|
|
5813
5921
|
reason: result.ok ? (expectationMet ? undefined : "unexpected_return_value") : result.reason,
|
|
5814
5922
|
store_reason: result.store_reason || undefined,
|
|
5815
5923
|
error: result.error || undefined,
|
package/dist/profile.d.cts
CHANGED
|
@@ -133,6 +133,7 @@ interface RiddleProofProfileSetupAction {
|
|
|
133
133
|
expect_return?: JsonValue;
|
|
134
134
|
store_return_to?: string;
|
|
135
135
|
capture_return?: boolean;
|
|
136
|
+
return_summary_fields?: RiddleProofProfileReturnSummaryField[];
|
|
136
137
|
until_path?: string;
|
|
137
138
|
until_expected_value?: JsonValue;
|
|
138
139
|
max_calls?: number;
|
|
@@ -159,6 +160,10 @@ interface RiddleProofProfileSetupAction {
|
|
|
159
160
|
optional?: boolean;
|
|
160
161
|
continue_on_failure?: boolean;
|
|
161
162
|
}
|
|
163
|
+
interface RiddleProofProfileReturnSummaryField {
|
|
164
|
+
path: string;
|
|
165
|
+
label?: string;
|
|
166
|
+
}
|
|
162
167
|
interface RiddleProofProfileNetworkMockResponse {
|
|
163
168
|
label?: string;
|
|
164
169
|
status: number;
|
|
@@ -464,4 +469,4 @@ declare function buildRiddleProofProfileScript(profile: RiddleProofProfile): str
|
|
|
464
469
|
declare function collectRiddleProfileArtifactRefs(input: unknown): RiddleProofProfileArtifactRef[];
|
|
465
470
|
declare function extractRiddleProofProfileResult(input: unknown): RiddleProofProfileResult | undefined;
|
|
466
471
|
|
|
467
|
-
export { type NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, type RiddleProofArtifactBodyAssertionInput, type RiddleProofArtifactBodyAssertionResult, type RiddleProofProfile, type RiddleProofProfileArtifactRef, type RiddleProofProfileBaselinePolicy, type RiddleProofProfileBoundsOffender, type RiddleProofProfileCheck, type RiddleProofProfileCheckResult, type RiddleProofProfileCheckType, type RiddleProofProfileEvidence, type RiddleProofProfileFailureAction, type RiddleProofProfileHttpStatusBodyJsonAssertion, type RiddleProofProfileHttpStatusBodyJsonAssertionResult, type RiddleProofProfileHttpStatusPreflightCheckResult, type RiddleProofProfileHttpStatusPreflightFetch, type RiddleProofProfileHttpStatusPreflightFetchResponse, type RiddleProofProfileHttpStatusPreflightOptions, type RiddleProofProfileHttpStatusPreflightResult, type RiddleProofProfileJsonValueType, type RiddleProofProfileNetworkAbortErrorCode, type RiddleProofProfileNetworkMock, type RiddleProofProfileNetworkMockResponse, type RiddleProofProfileResult, type RiddleProofProfileRouteEvidence, type RiddleProofProfileRouteInventoryRoute, type RiddleProofProfileRunner, type RiddleProofProfileSetupAction, type RiddleProofProfileSetupActionType, type RiddleProofProfileStatus, type RiddleProofProfileTarget, type RiddleProofProfileViewport, type RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, preflightRiddleProofProfileHttpStatusChecks, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult };
|
|
472
|
+
export { type NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, type RiddleProofArtifactBodyAssertionInput, type RiddleProofArtifactBodyAssertionResult, type RiddleProofProfile, type RiddleProofProfileArtifactRef, type RiddleProofProfileBaselinePolicy, type RiddleProofProfileBoundsOffender, type RiddleProofProfileCheck, type RiddleProofProfileCheckResult, type RiddleProofProfileCheckType, type RiddleProofProfileEvidence, type RiddleProofProfileFailureAction, type RiddleProofProfileHttpStatusBodyJsonAssertion, type RiddleProofProfileHttpStatusBodyJsonAssertionResult, type RiddleProofProfileHttpStatusPreflightCheckResult, type RiddleProofProfileHttpStatusPreflightFetch, type RiddleProofProfileHttpStatusPreflightFetchResponse, type RiddleProofProfileHttpStatusPreflightOptions, type RiddleProofProfileHttpStatusPreflightResult, type RiddleProofProfileJsonValueType, type RiddleProofProfileNetworkAbortErrorCode, type RiddleProofProfileNetworkMock, type RiddleProofProfileNetworkMockResponse, type RiddleProofProfileResult, type RiddleProofProfileReturnSummaryField, type RiddleProofProfileRouteEvidence, type RiddleProofProfileRouteInventoryRoute, type RiddleProofProfileRunner, type RiddleProofProfileSetupAction, type RiddleProofProfileSetupActionType, type RiddleProofProfileStatus, type RiddleProofProfileTarget, type RiddleProofProfileViewport, type RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, preflightRiddleProofProfileHttpStatusChecks, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult };
|
package/dist/profile.d.ts
CHANGED
|
@@ -133,6 +133,7 @@ interface RiddleProofProfileSetupAction {
|
|
|
133
133
|
expect_return?: JsonValue;
|
|
134
134
|
store_return_to?: string;
|
|
135
135
|
capture_return?: boolean;
|
|
136
|
+
return_summary_fields?: RiddleProofProfileReturnSummaryField[];
|
|
136
137
|
until_path?: string;
|
|
137
138
|
until_expected_value?: JsonValue;
|
|
138
139
|
max_calls?: number;
|
|
@@ -159,6 +160,10 @@ interface RiddleProofProfileSetupAction {
|
|
|
159
160
|
optional?: boolean;
|
|
160
161
|
continue_on_failure?: boolean;
|
|
161
162
|
}
|
|
163
|
+
interface RiddleProofProfileReturnSummaryField {
|
|
164
|
+
path: string;
|
|
165
|
+
label?: string;
|
|
166
|
+
}
|
|
162
167
|
interface RiddleProofProfileNetworkMockResponse {
|
|
163
168
|
label?: string;
|
|
164
169
|
status: number;
|
|
@@ -464,4 +469,4 @@ declare function buildRiddleProofProfileScript(profile: RiddleProofProfile): str
|
|
|
464
469
|
declare function collectRiddleProfileArtifactRefs(input: unknown): RiddleProofProfileArtifactRef[];
|
|
465
470
|
declare function extractRiddleProofProfileResult(input: unknown): RiddleProofProfileResult | undefined;
|
|
466
471
|
|
|
467
|
-
export { type NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, type RiddleProofArtifactBodyAssertionInput, type RiddleProofArtifactBodyAssertionResult, type RiddleProofProfile, type RiddleProofProfileArtifactRef, type RiddleProofProfileBaselinePolicy, type RiddleProofProfileBoundsOffender, type RiddleProofProfileCheck, type RiddleProofProfileCheckResult, type RiddleProofProfileCheckType, type RiddleProofProfileEvidence, type RiddleProofProfileFailureAction, type RiddleProofProfileHttpStatusBodyJsonAssertion, type RiddleProofProfileHttpStatusBodyJsonAssertionResult, type RiddleProofProfileHttpStatusPreflightCheckResult, type RiddleProofProfileHttpStatusPreflightFetch, type RiddleProofProfileHttpStatusPreflightFetchResponse, type RiddleProofProfileHttpStatusPreflightOptions, type RiddleProofProfileHttpStatusPreflightResult, type RiddleProofProfileJsonValueType, type RiddleProofProfileNetworkAbortErrorCode, type RiddleProofProfileNetworkMock, type RiddleProofProfileNetworkMockResponse, type RiddleProofProfileResult, type RiddleProofProfileRouteEvidence, type RiddleProofProfileRouteInventoryRoute, type RiddleProofProfileRunner, type RiddleProofProfileSetupAction, type RiddleProofProfileSetupActionType, type RiddleProofProfileStatus, type RiddleProofProfileTarget, type RiddleProofProfileViewport, type RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, preflightRiddleProofProfileHttpStatusChecks, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult };
|
|
472
|
+
export { type NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, type RiddleProofArtifactBodyAssertionInput, type RiddleProofArtifactBodyAssertionResult, type RiddleProofProfile, type RiddleProofProfileArtifactRef, type RiddleProofProfileBaselinePolicy, type RiddleProofProfileBoundsOffender, type RiddleProofProfileCheck, type RiddleProofProfileCheckResult, type RiddleProofProfileCheckType, type RiddleProofProfileEvidence, type RiddleProofProfileFailureAction, type RiddleProofProfileHttpStatusBodyJsonAssertion, type RiddleProofProfileHttpStatusBodyJsonAssertionResult, type RiddleProofProfileHttpStatusPreflightCheckResult, type RiddleProofProfileHttpStatusPreflightFetch, type RiddleProofProfileHttpStatusPreflightFetchResponse, type RiddleProofProfileHttpStatusPreflightOptions, type RiddleProofProfileHttpStatusPreflightResult, type RiddleProofProfileJsonValueType, type RiddleProofProfileNetworkAbortErrorCode, type RiddleProofProfileNetworkMock, type RiddleProofProfileNetworkMockResponse, type RiddleProofProfileResult, type RiddleProofProfileReturnSummaryField, type RiddleProofProfileRouteEvidence, type RiddleProofProfileRouteInventoryRoute, type RiddleProofProfileRunner, type RiddleProofProfileSetupAction, type RiddleProofProfileSetupActionType, type RiddleProofProfileStatus, type RiddleProofProfileTarget, type RiddleProofProfileViewport, type RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, preflightRiddleProofProfileHttpStatusChecks, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult };
|
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-YB3LNLZB.js";
|
|
27
27
|
export {
|
|
28
28
|
RIDDLE_PROOF_PROFILE_CHECK_TYPES,
|
|
29
29
|
RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
|