@riddledc/riddle-proof 0.7.218 → 0.7.219
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/cli.cjs +100 -4
- package/dist/cli.js +100 -4
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -16332,6 +16332,92 @@ function extractRiddleProofProfileResult(input) {
|
|
|
16332
16332
|
|
|
16333
16333
|
// src/cli.ts
|
|
16334
16334
|
var RIDDLE_PROFILE_BALANCE_PREFLIGHT_MIN_SECONDS_PER_JOB = 30;
|
|
16335
|
+
var KNOWN_CLI_OPTIONS = /* @__PURE__ */ new Set([
|
|
16336
|
+
"agent",
|
|
16337
|
+
"apiBaseUrl",
|
|
16338
|
+
"apiKey",
|
|
16339
|
+
"apiKeyFile",
|
|
16340
|
+
"artifact",
|
|
16341
|
+
"attempts",
|
|
16342
|
+
"balancePreflight",
|
|
16343
|
+
"baseUrl",
|
|
16344
|
+
"candidateJson",
|
|
16345
|
+
"candidatesJson",
|
|
16346
|
+
"checkpointMode",
|
|
16347
|
+
"checkpointVisibility",
|
|
16348
|
+
"codexCommand",
|
|
16349
|
+
"codexFullAuto",
|
|
16350
|
+
"codexHome",
|
|
16351
|
+
"codexModel",
|
|
16352
|
+
"codexSandbox",
|
|
16353
|
+
"codexTimeoutMs",
|
|
16354
|
+
"command",
|
|
16355
|
+
"continueWithStage",
|
|
16356
|
+
"createdAt",
|
|
16357
|
+
"decision",
|
|
16358
|
+
"defaultReviewer",
|
|
16359
|
+
"defaultShipMode",
|
|
16360
|
+
"exclude",
|
|
16361
|
+
"format",
|
|
16362
|
+
"framework",
|
|
16363
|
+
"help",
|
|
16364
|
+
"image",
|
|
16365
|
+
"input",
|
|
16366
|
+
"inputDir",
|
|
16367
|
+
"inputFile",
|
|
16368
|
+
"inputFiles",
|
|
16369
|
+
"inputs",
|
|
16370
|
+
"intervalMs",
|
|
16371
|
+
"job",
|
|
16372
|
+
"jobId",
|
|
16373
|
+
"maxIterations",
|
|
16374
|
+
"navigationTimeout",
|
|
16375
|
+
"output",
|
|
16376
|
+
"outputDir",
|
|
16377
|
+
"path",
|
|
16378
|
+
"payloadJson",
|
|
16379
|
+
"pollAttempts",
|
|
16380
|
+
"pollIntervalMs",
|
|
16381
|
+
"port",
|
|
16382
|
+
"profile",
|
|
16383
|
+
"progressEveryMs",
|
|
16384
|
+
"quiet",
|
|
16385
|
+
"readinessPath",
|
|
16386
|
+
"readinessTimeout",
|
|
16387
|
+
"reasonsJson",
|
|
16388
|
+
"requestJson",
|
|
16389
|
+
"requiredJson",
|
|
16390
|
+
"responseJson",
|
|
16391
|
+
"resultFormat",
|
|
16392
|
+
"resultsDir",
|
|
16393
|
+
"riddleEngineModuleUrl",
|
|
16394
|
+
"riddleProofDir",
|
|
16395
|
+
"route",
|
|
16396
|
+
"runDir",
|
|
16397
|
+
"runner",
|
|
16398
|
+
"scriptFile",
|
|
16399
|
+
"sourceKind",
|
|
16400
|
+
"splitViewports",
|
|
16401
|
+
"stateDir",
|
|
16402
|
+
"statePath",
|
|
16403
|
+
"strict",
|
|
16404
|
+
"submitRetries",
|
|
16405
|
+
"submitTimeoutMs",
|
|
16406
|
+
"summary",
|
|
16407
|
+
"sync",
|
|
16408
|
+
"timeout",
|
|
16409
|
+
"url",
|
|
16410
|
+
"unsubmittedJobRetries",
|
|
16411
|
+
"unsubmittedJobTimeoutMs",
|
|
16412
|
+
"unsubmittedRetries",
|
|
16413
|
+
"unsubmittedTimeoutMs",
|
|
16414
|
+
"viewport",
|
|
16415
|
+
"viewportName",
|
|
16416
|
+
"viewportNames",
|
|
16417
|
+
"viewports",
|
|
16418
|
+
"wait",
|
|
16419
|
+
"waitForSelector"
|
|
16420
|
+
]);
|
|
16335
16421
|
function usage() {
|
|
16336
16422
|
return [
|
|
16337
16423
|
"Usage:",
|
|
@@ -16340,9 +16426,9 @@ function usage() {
|
|
|
16340
16426
|
" riddle-proof-loop respond --state-path <path> --response-json <file|json|->",
|
|
16341
16427
|
" riddle-proof-loop respond --state-path <path> --decision <decision> --summary <text> [--payload-json <file|json|->]",
|
|
16342
16428
|
" riddle-proof-loop status --state-path <path>",
|
|
16343
|
-
" riddle-proof-loop run-profile --profile <file|json|-> --url <base-url> [--runner riddle] [--viewport-name <name[,name...]>] [--strict true|false; default false] [--split-viewports true|false; default false] [--balance-preflight true|false; default true] [--poll-attempts n] [--output <dir>|--output-dir <dir>] [--result-format json|compact-json|summary|none; default json] [--quiet]",
|
|
16344
|
-
" riddle-proof-loop run-profile aggregate --profile <file|json|-> --url <base-url> --input-dir <dir>|--inputs <path[,path...]> [--output <dir>|--output-dir <dir>] [--result-format json|compact-json|summary|none; default json]",
|
|
16345
|
-
" riddle-proof-loop run-profile recover --profile <file|json|-> --url <base-url> --job <job-id> [--viewport-name <name[,name...]>] [--output <dir>|--output-dir <dir>] [--result-format json|compact-json|summary|none; default json]",
|
|
16429
|
+
" riddle-proof-loop run-profile --profile <file|json|-> --url <base-url> [--base-url <base-url>] [--runner riddle] [--viewport-name <name[,name...]>] [--strict true|false; default false] [--split-viewports true|false; default false] [--balance-preflight true|false; default true] [--poll-attempts n] [--output <dir>|--output-dir <dir>] [--result-format json|compact-json|summary|none; default json] [--quiet]",
|
|
16430
|
+
" riddle-proof-loop run-profile aggregate --profile <file|json|-> --url <base-url> [--base-url <base-url>] --input-dir <dir>|--inputs <path[,path...]> [--output <dir>|--output-dir <dir>] [--result-format json|compact-json|summary|none; default json]",
|
|
16431
|
+
" riddle-proof-loop run-profile recover --profile <file|json|-> --url <base-url> [--base-url <base-url>] --job <job-id> [--viewport-name <name[,name...]>] [--output <dir>|--output-dir <dir>] [--result-format json|compact-json|summary|none; default json]",
|
|
16346
16432
|
" riddle-proof-loop profile-body-assertions --artifact <file|url|-> --candidates-json <file|json|-> [--required-json <file|json|->] [--format json|body-contains]",
|
|
16347
16433
|
" riddle-proof-loop profile-http-status-preflight --profile <file|json|-> --url <base-url> [--format json|summary]",
|
|
16348
16434
|
" riddle-proof-loop riddle-preview-deploy <build-dir> <label> [--framework spa|static]",
|
|
@@ -16382,6 +16468,15 @@ function parseArgs(argv) {
|
|
|
16382
16468
|
}
|
|
16383
16469
|
return { positional, options };
|
|
16384
16470
|
}
|
|
16471
|
+
function optionKeyToFlagName(key) {
|
|
16472
|
+
return key.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
16473
|
+
}
|
|
16474
|
+
function validateCliOptions(options) {
|
|
16475
|
+
const unknown = Object.keys(options).filter((key) => !KNOWN_CLI_OPTIONS.has(key));
|
|
16476
|
+
if (!unknown.length) return;
|
|
16477
|
+
const flags = unknown.map((key) => `--${optionKeyToFlagName(key)}`).join(", ");
|
|
16478
|
+
throw new Error(`Unknown option${unknown.length === 1 ? "" : "s"}: ${flags}. Run riddle-proof-loop help for usage.`);
|
|
16479
|
+
}
|
|
16385
16480
|
function optionString(options, key) {
|
|
16386
16481
|
const value = options[key];
|
|
16387
16482
|
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
@@ -16703,7 +16798,7 @@ function parseProfileViewports(value) {
|
|
|
16703
16798
|
function normalizeProfileForCli(options) {
|
|
16704
16799
|
const rawProfile = readJsonValue(optionString(options, "profile"), "--profile");
|
|
16705
16800
|
return normalizeRiddleProofProfile(rawProfile, {
|
|
16706
|
-
url: optionString(options, "url"),
|
|
16801
|
+
url: optionString(options, "url") ?? optionString(options, "baseUrl"),
|
|
16707
16802
|
route: optionString(options, "route"),
|
|
16708
16803
|
viewports: parseProfileViewports(optionString(options, "viewports") || optionString(options, "viewport"))
|
|
16709
16804
|
});
|
|
@@ -19955,6 +20050,7 @@ async function main() {
|
|
|
19955
20050
|
`);
|
|
19956
20051
|
return;
|
|
19957
20052
|
}
|
|
20053
|
+
validateCliOptions(options);
|
|
19958
20054
|
if (command === "doctor") {
|
|
19959
20055
|
const subject = positional[1];
|
|
19960
20056
|
if (!isLocalAgentMode(subject)) throw new Error("Only `doctor local` is supported.");
|
package/dist/cli.js
CHANGED
|
@@ -41,6 +41,92 @@ import "./chunk-VY4Y5U57.js";
|
|
|
41
41
|
import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from "fs";
|
|
42
42
|
import path from "path";
|
|
43
43
|
var RIDDLE_PROFILE_BALANCE_PREFLIGHT_MIN_SECONDS_PER_JOB = 30;
|
|
44
|
+
var KNOWN_CLI_OPTIONS = /* @__PURE__ */ new Set([
|
|
45
|
+
"agent",
|
|
46
|
+
"apiBaseUrl",
|
|
47
|
+
"apiKey",
|
|
48
|
+
"apiKeyFile",
|
|
49
|
+
"artifact",
|
|
50
|
+
"attempts",
|
|
51
|
+
"balancePreflight",
|
|
52
|
+
"baseUrl",
|
|
53
|
+
"candidateJson",
|
|
54
|
+
"candidatesJson",
|
|
55
|
+
"checkpointMode",
|
|
56
|
+
"checkpointVisibility",
|
|
57
|
+
"codexCommand",
|
|
58
|
+
"codexFullAuto",
|
|
59
|
+
"codexHome",
|
|
60
|
+
"codexModel",
|
|
61
|
+
"codexSandbox",
|
|
62
|
+
"codexTimeoutMs",
|
|
63
|
+
"command",
|
|
64
|
+
"continueWithStage",
|
|
65
|
+
"createdAt",
|
|
66
|
+
"decision",
|
|
67
|
+
"defaultReviewer",
|
|
68
|
+
"defaultShipMode",
|
|
69
|
+
"exclude",
|
|
70
|
+
"format",
|
|
71
|
+
"framework",
|
|
72
|
+
"help",
|
|
73
|
+
"image",
|
|
74
|
+
"input",
|
|
75
|
+
"inputDir",
|
|
76
|
+
"inputFile",
|
|
77
|
+
"inputFiles",
|
|
78
|
+
"inputs",
|
|
79
|
+
"intervalMs",
|
|
80
|
+
"job",
|
|
81
|
+
"jobId",
|
|
82
|
+
"maxIterations",
|
|
83
|
+
"navigationTimeout",
|
|
84
|
+
"output",
|
|
85
|
+
"outputDir",
|
|
86
|
+
"path",
|
|
87
|
+
"payloadJson",
|
|
88
|
+
"pollAttempts",
|
|
89
|
+
"pollIntervalMs",
|
|
90
|
+
"port",
|
|
91
|
+
"profile",
|
|
92
|
+
"progressEveryMs",
|
|
93
|
+
"quiet",
|
|
94
|
+
"readinessPath",
|
|
95
|
+
"readinessTimeout",
|
|
96
|
+
"reasonsJson",
|
|
97
|
+
"requestJson",
|
|
98
|
+
"requiredJson",
|
|
99
|
+
"responseJson",
|
|
100
|
+
"resultFormat",
|
|
101
|
+
"resultsDir",
|
|
102
|
+
"riddleEngineModuleUrl",
|
|
103
|
+
"riddleProofDir",
|
|
104
|
+
"route",
|
|
105
|
+
"runDir",
|
|
106
|
+
"runner",
|
|
107
|
+
"scriptFile",
|
|
108
|
+
"sourceKind",
|
|
109
|
+
"splitViewports",
|
|
110
|
+
"stateDir",
|
|
111
|
+
"statePath",
|
|
112
|
+
"strict",
|
|
113
|
+
"submitRetries",
|
|
114
|
+
"submitTimeoutMs",
|
|
115
|
+
"summary",
|
|
116
|
+
"sync",
|
|
117
|
+
"timeout",
|
|
118
|
+
"url",
|
|
119
|
+
"unsubmittedJobRetries",
|
|
120
|
+
"unsubmittedJobTimeoutMs",
|
|
121
|
+
"unsubmittedRetries",
|
|
122
|
+
"unsubmittedTimeoutMs",
|
|
123
|
+
"viewport",
|
|
124
|
+
"viewportName",
|
|
125
|
+
"viewportNames",
|
|
126
|
+
"viewports",
|
|
127
|
+
"wait",
|
|
128
|
+
"waitForSelector"
|
|
129
|
+
]);
|
|
44
130
|
function usage() {
|
|
45
131
|
return [
|
|
46
132
|
"Usage:",
|
|
@@ -49,9 +135,9 @@ function usage() {
|
|
|
49
135
|
" riddle-proof-loop respond --state-path <path> --response-json <file|json|->",
|
|
50
136
|
" riddle-proof-loop respond --state-path <path> --decision <decision> --summary <text> [--payload-json <file|json|->]",
|
|
51
137
|
" riddle-proof-loop status --state-path <path>",
|
|
52
|
-
" riddle-proof-loop run-profile --profile <file|json|-> --url <base-url> [--runner riddle] [--viewport-name <name[,name...]>] [--strict true|false; default false] [--split-viewports true|false; default false] [--balance-preflight true|false; default true] [--poll-attempts n] [--output <dir>|--output-dir <dir>] [--result-format json|compact-json|summary|none; default json] [--quiet]",
|
|
53
|
-
" riddle-proof-loop run-profile aggregate --profile <file|json|-> --url <base-url> --input-dir <dir>|--inputs <path[,path...]> [--output <dir>|--output-dir <dir>] [--result-format json|compact-json|summary|none; default json]",
|
|
54
|
-
" riddle-proof-loop run-profile recover --profile <file|json|-> --url <base-url> --job <job-id> [--viewport-name <name[,name...]>] [--output <dir>|--output-dir <dir>] [--result-format json|compact-json|summary|none; default json]",
|
|
138
|
+
" riddle-proof-loop run-profile --profile <file|json|-> --url <base-url> [--base-url <base-url>] [--runner riddle] [--viewport-name <name[,name...]>] [--strict true|false; default false] [--split-viewports true|false; default false] [--balance-preflight true|false; default true] [--poll-attempts n] [--output <dir>|--output-dir <dir>] [--result-format json|compact-json|summary|none; default json] [--quiet]",
|
|
139
|
+
" riddle-proof-loop run-profile aggregate --profile <file|json|-> --url <base-url> [--base-url <base-url>] --input-dir <dir>|--inputs <path[,path...]> [--output <dir>|--output-dir <dir>] [--result-format json|compact-json|summary|none; default json]",
|
|
140
|
+
" riddle-proof-loop run-profile recover --profile <file|json|-> --url <base-url> [--base-url <base-url>] --job <job-id> [--viewport-name <name[,name...]>] [--output <dir>|--output-dir <dir>] [--result-format json|compact-json|summary|none; default json]",
|
|
55
141
|
" riddle-proof-loop profile-body-assertions --artifact <file|url|-> --candidates-json <file|json|-> [--required-json <file|json|->] [--format json|body-contains]",
|
|
56
142
|
" riddle-proof-loop profile-http-status-preflight --profile <file|json|-> --url <base-url> [--format json|summary]",
|
|
57
143
|
" riddle-proof-loop riddle-preview-deploy <build-dir> <label> [--framework spa|static]",
|
|
@@ -91,6 +177,15 @@ function parseArgs(argv) {
|
|
|
91
177
|
}
|
|
92
178
|
return { positional, options };
|
|
93
179
|
}
|
|
180
|
+
function optionKeyToFlagName(key) {
|
|
181
|
+
return key.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
182
|
+
}
|
|
183
|
+
function validateCliOptions(options) {
|
|
184
|
+
const unknown = Object.keys(options).filter((key) => !KNOWN_CLI_OPTIONS.has(key));
|
|
185
|
+
if (!unknown.length) return;
|
|
186
|
+
const flags = unknown.map((key) => `--${optionKeyToFlagName(key)}`).join(", ");
|
|
187
|
+
throw new Error(`Unknown option${unknown.length === 1 ? "" : "s"}: ${flags}. Run riddle-proof-loop help for usage.`);
|
|
188
|
+
}
|
|
94
189
|
function optionString(options, key) {
|
|
95
190
|
const value = options[key];
|
|
96
191
|
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
@@ -412,7 +507,7 @@ function parseProfileViewports(value) {
|
|
|
412
507
|
function normalizeProfileForCli(options) {
|
|
413
508
|
const rawProfile = readJsonValue(optionString(options, "profile"), "--profile");
|
|
414
509
|
return normalizeRiddleProofProfile(rawProfile, {
|
|
415
|
-
url: optionString(options, "url"),
|
|
510
|
+
url: optionString(options, "url") ?? optionString(options, "baseUrl"),
|
|
416
511
|
route: optionString(options, "route"),
|
|
417
512
|
viewports: parseProfileViewports(optionString(options, "viewports") || optionString(options, "viewport"))
|
|
418
513
|
});
|
|
@@ -3664,6 +3759,7 @@ async function main() {
|
|
|
3664
3759
|
`);
|
|
3665
3760
|
return;
|
|
3666
3761
|
}
|
|
3762
|
+
validateCliOptions(options);
|
|
3667
3763
|
if (command === "doctor") {
|
|
3668
3764
|
const subject = positional[1];
|
|
3669
3765
|
if (!isLocalAgentMode(subject)) throw new Error("Only `doctor local` is supported.");
|