@riddledc/riddle-proof 0.7.87 → 0.7.88
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 +27 -0
- package/dist/cli.js +27 -0
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -11721,6 +11721,28 @@ function profileEnvironmentBlockerMarkdown(result) {
|
|
|
11721
11721
|
if (minimumPurchaseDollars !== void 0) lines.push(`- minimum purchase: $${minimumPurchaseDollars}`);
|
|
11722
11722
|
return lines;
|
|
11723
11723
|
}
|
|
11724
|
+
function profileCliDiagnosticLine(result) {
|
|
11725
|
+
if (result.status !== "environment_blocked") return void 0;
|
|
11726
|
+
const blocker = cliRecord(result.environment_blocker);
|
|
11727
|
+
if (blocker?.reason === "insufficient_balance") {
|
|
11728
|
+
const requiredSeconds = cliFiniteNumber(blocker.required_seconds);
|
|
11729
|
+
const availableSeconds = cliFiniteNumber(blocker.available_seconds);
|
|
11730
|
+
const deficitSeconds = cliFiniteNumber(blocker.deficit_seconds);
|
|
11731
|
+
const parts = [
|
|
11732
|
+
requiredSeconds === void 0 ? "" : `required=${requiredSeconds}s`,
|
|
11733
|
+
availableSeconds === void 0 ? "" : `available=${availableSeconds}s`,
|
|
11734
|
+
deficitSeconds === void 0 ? "" : `deficit=${deficitSeconds}s`
|
|
11735
|
+
].filter(Boolean);
|
|
11736
|
+
return `[riddle-profile] environment_blocked insufficient_balance${parts.length ? ` ${parts.join(" ")}` : ""}`;
|
|
11737
|
+
}
|
|
11738
|
+
const source = cliString(blocker?.source);
|
|
11739
|
+
const endpoint = cliString(blocker?.endpoint);
|
|
11740
|
+
const httpStatus = cliFiniteNumber(blocker?.http_status);
|
|
11741
|
+
if (source || endpoint || httpStatus !== void 0) {
|
|
11742
|
+
return `[riddle-profile] environment_blocked${source ? ` source=${source}` : ""}${endpoint ? ` endpoint=${endpoint}` : ""}${httpStatus === void 0 ? "" : ` http_status=${httpStatus}`}`;
|
|
11743
|
+
}
|
|
11744
|
+
return `[riddle-profile] environment_blocked ${result.summary}`;
|
|
11745
|
+
}
|
|
11724
11746
|
function profileSetupSummaryMarkdown(result) {
|
|
11725
11747
|
const setupCheck = result.checks.find((check) => check.type === "setup_actions_succeeded");
|
|
11726
11748
|
const setupSummary = cliRecord(setupCheck?.evidence?.setup_summary);
|
|
@@ -12020,6 +12042,11 @@ async function main() {
|
|
|
12020
12042
|
const profile = normalizeProfileForCli(options);
|
|
12021
12043
|
const result = await runProfileForCli(profile, options);
|
|
12022
12044
|
writeProfileOutput(profileOutputDirOption(options), result);
|
|
12045
|
+
const diagnosticLine = profileCliDiagnosticLine(result);
|
|
12046
|
+
if (diagnosticLine && optionBoolean(options, "quiet") !== true) {
|
|
12047
|
+
process.stderr.write(`${diagnosticLine}
|
|
12048
|
+
`);
|
|
12049
|
+
}
|
|
12023
12050
|
process.stdout.write(`${JSON.stringify(result, null, 2)}
|
|
12024
12051
|
`);
|
|
12025
12052
|
process.exitCode = profileStatusExitCode(profile, result.status);
|
package/dist/cli.js
CHANGED
|
@@ -456,6 +456,28 @@ function profileEnvironmentBlockerMarkdown(result) {
|
|
|
456
456
|
if (minimumPurchaseDollars !== void 0) lines.push(`- minimum purchase: $${minimumPurchaseDollars}`);
|
|
457
457
|
return lines;
|
|
458
458
|
}
|
|
459
|
+
function profileCliDiagnosticLine(result) {
|
|
460
|
+
if (result.status !== "environment_blocked") return void 0;
|
|
461
|
+
const blocker = cliRecord(result.environment_blocker);
|
|
462
|
+
if (blocker?.reason === "insufficient_balance") {
|
|
463
|
+
const requiredSeconds = cliFiniteNumber(blocker.required_seconds);
|
|
464
|
+
const availableSeconds = cliFiniteNumber(blocker.available_seconds);
|
|
465
|
+
const deficitSeconds = cliFiniteNumber(blocker.deficit_seconds);
|
|
466
|
+
const parts = [
|
|
467
|
+
requiredSeconds === void 0 ? "" : `required=${requiredSeconds}s`,
|
|
468
|
+
availableSeconds === void 0 ? "" : `available=${availableSeconds}s`,
|
|
469
|
+
deficitSeconds === void 0 ? "" : `deficit=${deficitSeconds}s`
|
|
470
|
+
].filter(Boolean);
|
|
471
|
+
return `[riddle-profile] environment_blocked insufficient_balance${parts.length ? ` ${parts.join(" ")}` : ""}`;
|
|
472
|
+
}
|
|
473
|
+
const source = cliString(blocker?.source);
|
|
474
|
+
const endpoint = cliString(blocker?.endpoint);
|
|
475
|
+
const httpStatus = cliFiniteNumber(blocker?.http_status);
|
|
476
|
+
if (source || endpoint || httpStatus !== void 0) {
|
|
477
|
+
return `[riddle-profile] environment_blocked${source ? ` source=${source}` : ""}${endpoint ? ` endpoint=${endpoint}` : ""}${httpStatus === void 0 ? "" : ` http_status=${httpStatus}`}`;
|
|
478
|
+
}
|
|
479
|
+
return `[riddle-profile] environment_blocked ${result.summary}`;
|
|
480
|
+
}
|
|
459
481
|
function profileSetupSummaryMarkdown(result) {
|
|
460
482
|
const setupCheck = result.checks.find((check) => check.type === "setup_actions_succeeded");
|
|
461
483
|
const setupSummary = cliRecord(setupCheck?.evidence?.setup_summary);
|
|
@@ -755,6 +777,11 @@ async function main() {
|
|
|
755
777
|
const profile = normalizeProfileForCli(options);
|
|
756
778
|
const result = await runProfileForCli(profile, options);
|
|
757
779
|
writeProfileOutput(profileOutputDirOption(options), result);
|
|
780
|
+
const diagnosticLine = profileCliDiagnosticLine(result);
|
|
781
|
+
if (diagnosticLine && optionBoolean(options, "quiet") !== true) {
|
|
782
|
+
process.stderr.write(`${diagnosticLine}
|
|
783
|
+
`);
|
|
784
|
+
}
|
|
758
785
|
process.stdout.write(`${JSON.stringify(result, null, 2)}
|
|
759
786
|
`);
|
|
760
787
|
process.exitCode = profileStatusExitCode(profile, result.status);
|