@riddledc/riddle-proof 0.8.36 → 0.8.38

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.
Files changed (36) hide show
  1. package/README.md +21 -0
  2. package/dist/advanced/index.d.cts +1 -1
  3. package/dist/advanced/index.d.ts +1 -1
  4. package/dist/advanced/proof-run-engine.d.cts +1 -1
  5. package/dist/advanced/proof-run-engine.d.ts +1 -1
  6. package/dist/chunk-6KYXX4OE.js +209 -0
  7. package/dist/{chunk-TWTEUS7R.js → chunk-DI2XNGEZ.js} +126 -1
  8. package/dist/{chunk-E25K5PDM.js → chunk-U44KBAPH.js} +168 -7
  9. package/dist/cli/index.js +3 -2
  10. package/dist/cli.cjs +488 -3
  11. package/dist/cli.js +3 -2
  12. package/dist/index.cjs +336 -1
  13. package/dist/index.d.cts +2 -1
  14. package/dist/index.d.ts +2 -1
  15. package/dist/index.js +26 -18
  16. package/dist/pr-comment.cjs +235 -0
  17. package/dist/pr-comment.d.cts +41 -0
  18. package/dist/pr-comment.d.ts +41 -0
  19. package/dist/pr-comment.js +11 -0
  20. package/dist/{proof-run-engine-DYUu2mqY.d.cts → proof-run-engine-4dM37pEx.d.cts} +3 -3
  21. package/dist/{proof-run-engine-BmNYuOJ7.d.ts → proof-run-engine-BqaeqAze.d.ts} +3 -3
  22. package/dist/proof-run-engine.d.cts +1 -1
  23. package/dist/proof-run-engine.d.ts +1 -1
  24. package/dist/riddle-client.cjs +126 -1
  25. package/dist/riddle-client.d.cts +21 -1
  26. package/dist/riddle-client.d.ts +21 -1
  27. package/dist/riddle-client.js +1 -1
  28. package/dist/runtime/index.cjs +126 -1
  29. package/dist/runtime/index.d.cts +1 -1
  30. package/dist/runtime/index.d.ts +1 -1
  31. package/dist/runtime/index.js +1 -1
  32. package/dist/runtime/riddle-client.cjs +126 -1
  33. package/dist/runtime/riddle-client.d.cts +1 -1
  34. package/dist/runtime/riddle-client.d.ts +1 -1
  35. package/dist/runtime/riddle-client.js +1 -1
  36. package/package.json +7 -2
package/dist/index.cjs CHANGED
@@ -3411,6 +3411,7 @@ __export(index_exports, {
3411
3411
  RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES: () => RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES,
3412
3412
  RIDDLE_PROOF_PROFILE_STATUSES: () => RIDDLE_PROOF_PROFILE_STATUSES,
3413
3413
  RIDDLE_PROOF_PROFILE_VERSION: () => RIDDLE_PROOF_PROFILE_VERSION,
3414
+ RIDDLE_PROOF_PR_COMMENT_MARKER: () => RIDDLE_PROOF_PR_COMMENT_MARKER,
3414
3415
  RIDDLE_PROOF_RUN_CARD_VERSION: () => RIDDLE_PROOF_RUN_CARD_VERSION,
3415
3416
  RIDDLE_PROOF_RUN_STATE_VERSION: () => RIDDLE_PROOF_RUN_STATE_VERSION,
3416
3417
  RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION: () => RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION,
@@ -3433,6 +3434,7 @@ __export(index_exports, {
3433
3434
  buildAuthorCheckpointPacket: () => buildAuthorCheckpointPacket,
3434
3435
  buildCheckpointPacketForEngineResult: () => buildCheckpointPacketForEngineResult,
3435
3436
  buildProofAssessmentCheckpointPacket: () => buildProofAssessmentCheckpointPacket,
3437
+ buildRiddleProofPrCommentMarkdown: () => buildRiddleProofPrCommentMarkdown,
3436
3438
  buildRiddleProofProfileScript: () => buildRiddleProofProfileScript,
3437
3439
  buildStageCheckpointPacket: () => buildStageCheckpointPacket,
3438
3440
  buildVisualProofSession: () => buildVisualProofSession,
@@ -3507,6 +3509,7 @@ __export(index_exports, {
3507
3509
  slugifyRiddleProofProfileName: () => slugifyRiddleProofProfileName,
3508
3510
  statePathsForRunState: () => statePathsForRunState,
3509
3511
  summarizeCaptureArtifacts: () => summarizeCaptureArtifacts,
3512
+ summarizeRiddleProofPrComment: () => summarizeRiddleProofPrComment,
3510
3513
  summarizeRiddleProofProfileResult: () => summarizeRiddleProofProfileResult,
3511
3514
  visualSessionFingerprint: () => visualSessionFingerprint,
3512
3515
  visualSessionFingerprintBasis: () => visualSessionFingerprintBasis
@@ -19066,10 +19069,68 @@ function previewDeployResultFromRecord(input) {
19066
19069
  function canRecoverPreviewPublish(error) {
19067
19070
  return error instanceof RiddleApiError && PREVIEW_PUBLISH_RECOVERY_STATUSES.has(error.status);
19068
19071
  }
19072
+ function summarizePreviewDirectory(directory) {
19073
+ const stack = [directory];
19074
+ let fileCount = 0;
19075
+ let totalBytes = 0;
19076
+ while (stack.length) {
19077
+ const current = stack.pop();
19078
+ for (const entry of (0, import_node_fs5.readdirSync)(current, { withFileTypes: true })) {
19079
+ const fullPath = import_node_path5.default.join(current, entry.name);
19080
+ if (entry.isDirectory()) {
19081
+ stack.push(fullPath);
19082
+ continue;
19083
+ }
19084
+ if (!entry.isFile()) continue;
19085
+ const stat = (0, import_node_fs5.statSync)(fullPath);
19086
+ fileCount += 1;
19087
+ totalBytes += stat.size;
19088
+ }
19089
+ }
19090
+ return { file_count: fileCount, total_bytes: totalBytes };
19091
+ }
19092
+ function previewProgressEmitter(config, base) {
19093
+ return async (snapshot) => {
19094
+ if (!config.onPreviewProgress) return;
19095
+ await config.onPreviewProgress({
19096
+ label: base.label,
19097
+ framework: base.framework,
19098
+ directory: base.directory,
19099
+ elapsed_ms: Math.max(0, Date.now() - base.startedAt),
19100
+ warnings: base.warnings?.length ? base.warnings : void 0,
19101
+ ...snapshot
19102
+ });
19103
+ };
19104
+ }
19069
19105
  async function waitForPublishedPreview(config, input) {
19106
+ await input.emitProgress?.({
19107
+ stage: "publish_recovering",
19108
+ id: input.id,
19109
+ file_count: input.localSummary?.file_count,
19110
+ total_bytes: input.localSummary?.total_bytes,
19111
+ publish_error: input.publishError.message,
19112
+ message: `publish returned ${input.publishError.status}; polling preview status`
19113
+ });
19070
19114
  for (let attempt = 1; attempt <= PREVIEW_PUBLISH_RECOVERY_ATTEMPTS; attempt += 1) {
19071
19115
  const status = await riddleRequestJson(config, `/v1/preview/${input.id}`);
19116
+ await input.emitProgress?.({
19117
+ stage: "checking_status",
19118
+ id: input.id,
19119
+ attempt,
19120
+ attempts: PREVIEW_PUBLISH_RECOVERY_ATTEMPTS,
19121
+ status: typeof status.status === "string" ? status.status : null,
19122
+ preview_url: typeof status.preview_url === "string" ? status.preview_url : void 0,
19123
+ file_count: typeof status.file_count === "number" ? status.file_count : input.localSummary?.file_count,
19124
+ total_bytes: typeof status.total_bytes === "number" ? status.total_bytes : input.localSummary?.total_bytes
19125
+ });
19072
19126
  if (String(status.status || "") === "ready" && String(status.preview_url || "").trim()) {
19127
+ await input.emitProgress?.({
19128
+ stage: "ready",
19129
+ id: input.id,
19130
+ preview_url: String(status.preview_url),
19131
+ file_count: typeof status.file_count === "number" ? status.file_count : input.localSummary?.file_count,
19132
+ total_bytes: typeof status.total_bytes === "number" ? status.total_bytes : input.localSummary?.total_bytes
19133
+ });
19073
19134
  return previewDeployResultFromRecord({
19074
19135
  record: status,
19075
19136
  id: input.id,
@@ -19091,7 +19152,17 @@ async function deployRiddlePreview(config, directory, label, framework = "static
19091
19152
  if (!directory?.trim()) throw new Error("directory is required");
19092
19153
  if (!label?.trim()) throw new Error("label is required");
19093
19154
  if (framework !== "spa" && framework !== "static") throw new Error("framework must be spa or static");
19155
+ const startedAt = Date.now();
19094
19156
  const warnings = collectRiddlePreviewDeployWarnings(directory, framework);
19157
+ const emitProgress = previewProgressEmitter(config, { label, framework, directory, startedAt, warnings });
19158
+ await emitProgress({ stage: "validating", message: "checking preview input directory" });
19159
+ const localSummary = summarizePreviewDirectory(directory);
19160
+ await emitProgress({
19161
+ stage: "creating",
19162
+ file_count: localSummary.file_count,
19163
+ total_bytes: localSummary.total_bytes,
19164
+ message: "creating preview upload target"
19165
+ });
19095
19166
  const created = await riddleRequestJson(config, "/v1/preview", {
19096
19167
  method: "POST",
19097
19168
  body: JSON.stringify({ framework, label })
@@ -19099,10 +19170,42 @@ async function deployRiddlePreview(config, directory, label, framework = "static
19099
19170
  const id = String(created.id || "");
19100
19171
  const uploadUrl = String(created.upload_url || "");
19101
19172
  if (!id || !uploadUrl) throw new Error("Riddle preview create response was missing id or upload_url.");
19173
+ await emitProgress({
19174
+ stage: "created",
19175
+ id,
19176
+ file_count: localSummary.file_count,
19177
+ total_bytes: localSummary.total_bytes,
19178
+ message: "preview upload target created"
19179
+ });
19102
19180
  const scratch = (0, import_node_fs5.mkdtempSync)(import_node_path5.default.join((0, import_node_os2.tmpdir)(), "riddle-preview-upload-"));
19103
19181
  const tarball = import_node_path5.default.join(scratch, `${id}.tar.gz`);
19182
+ let tarballBytes = 0;
19104
19183
  try {
19184
+ await emitProgress({
19185
+ stage: "archiving",
19186
+ id,
19187
+ file_count: localSummary.file_count,
19188
+ total_bytes: localSummary.total_bytes,
19189
+ message: "creating preview archive"
19190
+ });
19105
19191
  (0, import_node_child_process4.execFileSync)("tar", ["czf", tarball, "-C", directory, "."], { stdio: "pipe" });
19192
+ tarballBytes = (0, import_node_fs5.statSync)(tarball).size;
19193
+ await emitProgress({
19194
+ stage: "archived",
19195
+ id,
19196
+ file_count: localSummary.file_count,
19197
+ total_bytes: localSummary.total_bytes,
19198
+ tarball_bytes: tarballBytes,
19199
+ message: "preview archive created"
19200
+ });
19201
+ await emitProgress({
19202
+ stage: "uploading",
19203
+ id,
19204
+ file_count: localSummary.file_count,
19205
+ total_bytes: localSummary.total_bytes,
19206
+ tarball_bytes: tarballBytes,
19207
+ message: "uploading preview archive"
19208
+ });
19106
19209
  const upload = await fetchFor(config)(uploadUrl, {
19107
19210
  method: "PUT",
19108
19211
  headers: { "Content-Type": "application/gzip" },
@@ -19111,14 +19214,37 @@ async function deployRiddlePreview(config, directory, label, framework = "static
19111
19214
  if (!upload.ok) {
19112
19215
  throw new RiddleApiError(uploadUrl, upload.status, await upload.text());
19113
19216
  }
19217
+ await emitProgress({
19218
+ stage: "uploaded",
19219
+ id,
19220
+ file_count: localSummary.file_count,
19221
+ total_bytes: localSummary.total_bytes,
19222
+ tarball_bytes: tarballBytes,
19223
+ message: "preview archive uploaded"
19224
+ });
19114
19225
  } finally {
19115
19226
  (0, import_node_fs5.rmSync)(scratch, { recursive: true, force: true });
19116
19227
  }
19117
19228
  const expiresAt = typeof created.expires_at === "string" ? created.expires_at : void 0;
19118
19229
  try {
19230
+ await emitProgress({
19231
+ stage: "publishing",
19232
+ id,
19233
+ file_count: localSummary.file_count,
19234
+ total_bytes: localSummary.total_bytes,
19235
+ tarball_bytes: tarballBytes || void 0,
19236
+ message: "publishing preview"
19237
+ });
19119
19238
  const published = await riddleRequestJson(config, `/v1/preview/${id}/publish`, {
19120
19239
  method: "POST"
19121
19240
  });
19241
+ await emitProgress({
19242
+ stage: "ready",
19243
+ id,
19244
+ preview_url: String(published.preview_url || ""),
19245
+ file_count: typeof published.file_count === "number" ? published.file_count : localSummary.file_count,
19246
+ total_bytes: typeof published.total_bytes === "number" ? published.total_bytes : localSummary.total_bytes
19247
+ });
19122
19248
  return previewDeployResultFromRecord({ record: published, id, label, framework, expiresAt, warnings });
19123
19249
  } catch (error) {
19124
19250
  if (!canRecoverPreviewPublish(error)) throw error;
@@ -19128,7 +19254,9 @@ async function deployRiddlePreview(config, directory, label, framework = "static
19128
19254
  framework,
19129
19255
  expiresAt,
19130
19256
  publishError: error,
19131
- warnings
19257
+ warnings,
19258
+ localSummary,
19259
+ emitProgress
19132
19260
  });
19133
19261
  }
19134
19262
  }
@@ -19441,6 +19569,210 @@ function createRiddleApiClient(config = {}) {
19441
19569
  pollJob: (jobId, options) => pollRiddleJob(config, jobId, options)
19442
19570
  };
19443
19571
  }
19572
+
19573
+ // src/pr-comment.ts
19574
+ var RIDDLE_PROOF_PR_COMMENT_MARKER = "<!-- riddle-proof:pr-comment:v1 -->";
19575
+ function asRecord(value) {
19576
+ return value && typeof value === "object" && !Array.isArray(value) ? value : {};
19577
+ }
19578
+ function asArray(value) {
19579
+ return Array.isArray(value) ? value : [];
19580
+ }
19581
+ function stringValue6(value) {
19582
+ return typeof value === "string" && value.trim() ? value.trim() : void 0;
19583
+ }
19584
+ function numberValue4(value) {
19585
+ return typeof value === "number" && Number.isFinite(value) ? value : void 0;
19586
+ }
19587
+ function booleanValue2(value) {
19588
+ return typeof value === "boolean" ? value : void 0;
19589
+ }
19590
+ function artifactKind(name, url) {
19591
+ const target = `${name} ${url}`.toLowerCase();
19592
+ if (/\.(png|jpe?g|gif|webp|avif|svg)(\?|#|$)/.test(target)) return "image";
19593
+ if (/\.(json|har|txt|md|html|log)(\?|#|$)/.test(target)) return "data";
19594
+ return "artifact";
19595
+ }
19596
+ function artifactDisplayName(value, fallback) {
19597
+ const raw = stringValue6(value);
19598
+ if (raw) return raw;
19599
+ return fallback;
19600
+ }
19601
+ function collectArtifacts(runResponse) {
19602
+ const proofResult = asRecord(runResponse.proofResult);
19603
+ const outputs = asArray(proofResult.outputs);
19604
+ const artifacts = [];
19605
+ const seen = /* @__PURE__ */ new Set();
19606
+ for (const [index, item] of outputs.entries()) {
19607
+ const artifact = asRecord(item);
19608
+ const url = stringValue6(artifact.url);
19609
+ if (!url || seen.has(url)) continue;
19610
+ seen.add(url);
19611
+ const name = artifactDisplayName(artifact.name, `artifact-${index + 1}`);
19612
+ artifacts.push({
19613
+ name,
19614
+ url,
19615
+ kind: artifactKind(name, url),
19616
+ size_bytes: numberValue4(artifact.size)
19617
+ });
19618
+ }
19619
+ return artifacts;
19620
+ }
19621
+ function pageSummaries(result) {
19622
+ const pages = [];
19623
+ for (const page of asArray(result.pages)) {
19624
+ const record = asRecord(page);
19625
+ const route = stringValue6(record.route) || stringValue6(record.url) || "page";
19626
+ const checks = asRecord(record.checks);
19627
+ let passed = 0;
19628
+ let failed = 0;
19629
+ for (const value of Object.values(checks)) {
19630
+ if (value === true) passed += 1;
19631
+ if (value === false) failed += 1;
19632
+ }
19633
+ pages.push({ route, passed, failed });
19634
+ }
19635
+ return pages;
19636
+ }
19637
+ function summarizeExplicitChecks(value) {
19638
+ let passed = 0;
19639
+ let failed = 0;
19640
+ const visit = (current, inChecks = false) => {
19641
+ if (current === true && inChecks) {
19642
+ passed += 1;
19643
+ return;
19644
+ }
19645
+ if (current === false && inChecks) {
19646
+ failed += 1;
19647
+ return;
19648
+ }
19649
+ if (Array.isArray(current)) {
19650
+ for (const item of current) visit(item, inChecks);
19651
+ return;
19652
+ }
19653
+ if (current && typeof current === "object") {
19654
+ for (const [key, item] of Object.entries(current)) {
19655
+ visit(item, inChecks || key === "checks");
19656
+ }
19657
+ }
19658
+ };
19659
+ visit(value);
19660
+ return { passed, failed };
19661
+ }
19662
+ function selectPrimaryImage(artifacts) {
19663
+ const images = artifacts.filter((artifact) => artifact.kind === "image");
19664
+ return images.find((artifact) => /after|proof|screenshot/i.test(artifact.name)) || images[0];
19665
+ }
19666
+ function summarizeRiddleProofPrComment(input) {
19667
+ const runResponse = asRecord(input.runResponse);
19668
+ const result = asRecord(input.result);
19669
+ const proofResult = asRecord(runResponse.proofResult);
19670
+ const preview = asRecord(runResponse.preview);
19671
+ const artifacts = collectArtifacts(runResponse);
19672
+ const pages = pageSummaries(result);
19673
+ const checkSource = { ...result };
19674
+ delete checkSource.ok;
19675
+ const nestedChecks = summarizeExplicitChecks(checkSource);
19676
+ const ok = booleanValue2(result.ok) ?? booleanValue2(runResponse.ok) ?? null;
19677
+ return {
19678
+ ok,
19679
+ status: stringValue6(proofResult.status),
19680
+ job_id: stringValue6(proofResult.job_id),
19681
+ duration_ms: numberValue4(proofResult.duration_ms),
19682
+ proof_url: stringValue6(runResponse.proofUrl),
19683
+ preview_id: stringValue6(preview.id),
19684
+ preview_url: stringValue6(preview.preview_url) || stringValue6(preview.url),
19685
+ preview_publish_recovered: booleanValue2(preview.publish_recovered),
19686
+ preview_publish_error: stringValue6(preview.publish_error),
19687
+ passed_checks: nestedChecks.passed,
19688
+ failed_checks: nestedChecks.failed,
19689
+ pages,
19690
+ artifacts,
19691
+ primary_image: selectPrimaryImage(artifacts)
19692
+ };
19693
+ }
19694
+ function formatDuration(ms) {
19695
+ if (typeof ms !== "number" || !Number.isFinite(ms)) return "";
19696
+ const seconds = Math.max(0, Math.round(ms / 1e3));
19697
+ const minutes = Math.floor(seconds / 60);
19698
+ const remainder = seconds % 60;
19699
+ return minutes > 0 ? `${minutes}m${String(remainder).padStart(2, "0")}s` : `${seconds}s`;
19700
+ }
19701
+ function markdownLink(label, url) {
19702
+ return `[${label.replace(/\]/g, "\\]")}](${url})`;
19703
+ }
19704
+ function resultLabel(summary) {
19705
+ if (summary.ok === true) return "passed";
19706
+ if (summary.ok === false) return "failed";
19707
+ return summary.status || "recorded";
19708
+ }
19709
+ function artifactRank(artifact) {
19710
+ const name = artifact.name.toLowerCase();
19711
+ if (name === "proof.json") return 0;
19712
+ if (name === "result.json") return 1;
19713
+ if (name.includes("proof") && name.endsWith(".json") && !name.includes("layout")) return 2;
19714
+ if (name === "console.json") return 3;
19715
+ if (artifact.kind === "data") return 10;
19716
+ if (artifact.kind === "image") return 20;
19717
+ return 30;
19718
+ }
19719
+ function buildRiddleProofPrCommentMarkdown(input) {
19720
+ const summary = summarizeRiddleProofPrComment(input);
19721
+ const title = input.title?.trim() || "Riddle Proof Evidence";
19722
+ const lines = [
19723
+ RIDDLE_PROOF_PR_COMMENT_MARKER,
19724
+ `## ${title}`,
19725
+ "",
19726
+ `**Result:** ${resultLabel(summary)}`
19727
+ ];
19728
+ if (input.goal?.trim()) lines.push(`**Goal:** ${input.goal.trim()}`);
19729
+ if (input.successCriteria?.trim()) lines.push(`**Success criteria:** ${input.successCriteria.trim()}`);
19730
+ if (summary.status) lines.push(`**Riddle job status:** ${summary.status}`);
19731
+ if (summary.job_id) lines.push(`**Riddle job:** \`${summary.job_id}\``);
19732
+ if (summary.duration_ms) lines.push(`**Duration:** ${formatDuration(summary.duration_ms)}`);
19733
+ if (summary.proof_url) lines.push(`**Proof URL:** ${markdownLink(summary.proof_url, summary.proof_url)}`);
19734
+ if (summary.preview_id || summary.preview_url) {
19735
+ const previewLabel = summary.preview_id ? `\`${summary.preview_id}\`` : "preview";
19736
+ lines.push(`**Preview:** ${summary.preview_url ? markdownLink(previewLabel, summary.preview_url) : previewLabel}`);
19737
+ }
19738
+ if (summary.preview_publish_recovered) {
19739
+ const detail = summary.preview_publish_error ? `: ${summary.preview_publish_error}` : "";
19740
+ lines.push(`**Preview publish recovery:** recovered after publish error${detail}`);
19741
+ }
19742
+ lines.push(`**Checks:** ${summary.passed_checks} passed / ${summary.failed_checks} failed`);
19743
+ lines.push("");
19744
+ if (summary.primary_image) {
19745
+ lines.push("### Screenshot");
19746
+ lines.push(`![${summary.primary_image.name}](${summary.primary_image.url})`);
19747
+ lines.push("");
19748
+ }
19749
+ if (summary.pages.length) {
19750
+ lines.push("### Page Checks");
19751
+ for (const page of summary.pages.slice(0, 12)) {
19752
+ lines.push(`- \`${page.route}\`: ${page.passed} passed / ${page.failed} failed`);
19753
+ }
19754
+ if (summary.pages.length > 12) lines.push(`- ${summary.pages.length - 12} more page(s) omitted`);
19755
+ lines.push("");
19756
+ }
19757
+ const linkedArtifacts = summary.artifacts.filter((artifact) => artifact.url !== summary.primary_image?.url).sort((left, right) => artifactRank(left) - artifactRank(right) || left.name.localeCompare(right.name)).slice(0, 20);
19758
+ if (linkedArtifacts.length) {
19759
+ lines.push("### Artifacts");
19760
+ for (const artifact of linkedArtifacts) {
19761
+ lines.push(`- ${markdownLink(artifact.name, artifact.url)}`);
19762
+ }
19763
+ if (summary.artifacts.length - (summary.primary_image ? 1 : 0) > linkedArtifacts.length) {
19764
+ lines.push(`- ${summary.artifacts.length - (summary.primary_image ? 1 : 0) - linkedArtifacts.length} more artifact(s) omitted`);
19765
+ }
19766
+ lines.push("");
19767
+ }
19768
+ if (input.source?.trim()) {
19769
+ lines.push(`_Source: ${input.source.trim()}_`);
19770
+ } else {
19771
+ lines.push("_Updated by `riddle-proof-loop pr-comment`._");
19772
+ }
19773
+ return `${lines.join("\n").trim()}
19774
+ `;
19775
+ }
19444
19776
  // Annotate the CommonJS export names for ESM import in node:
19445
19777
  0 && (module.exports = {
19446
19778
  BASIC_GAMEPLAY_ACTION_TYPES,
@@ -19465,6 +19797,7 @@ function createRiddleApiClient(config = {}) {
19465
19797
  RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES,
19466
19798
  RIDDLE_PROOF_PROFILE_STATUSES,
19467
19799
  RIDDLE_PROOF_PROFILE_VERSION,
19800
+ RIDDLE_PROOF_PR_COMMENT_MARKER,
19468
19801
  RIDDLE_PROOF_RUN_CARD_VERSION,
19469
19802
  RIDDLE_PROOF_RUN_STATE_VERSION,
19470
19803
  RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION,
@@ -19487,6 +19820,7 @@ function createRiddleApiClient(config = {}) {
19487
19820
  buildAuthorCheckpointPacket,
19488
19821
  buildCheckpointPacketForEngineResult,
19489
19822
  buildProofAssessmentCheckpointPacket,
19823
+ buildRiddleProofPrCommentMarkdown,
19490
19824
  buildRiddleProofProfileScript,
19491
19825
  buildStageCheckpointPacket,
19492
19826
  buildVisualProofSession,
@@ -19561,6 +19895,7 @@ function createRiddleApiClient(config = {}) {
19561
19895
  slugifyRiddleProofProfileName,
19562
19896
  statePathsForRunState,
19563
19897
  summarizeCaptureArtifacts,
19898
+ summarizeRiddleProofPrComment,
19564
19899
  summarizeRiddleProofProfileResult,
19565
19900
  visualSessionFingerprint,
19566
19901
  visualSessionFingerprintBasis
package/dist/index.d.cts CHANGED
@@ -11,4 +11,5 @@ export { BuildVisualProofSessionInput, RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_V
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
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
- export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleApiKeySource, RiddleBalanceResult, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployResult, RiddlePreviewFramework, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, collectRiddlePreviewDeployWarnings, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, getRiddleBalance, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, resolveRiddleApiKeySource, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from './riddle-client.cjs';
14
+ export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleApiKeySource, RiddleBalanceResult, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployProgressSnapshot, RiddlePreviewDeployResult, RiddlePreviewDeployStage, RiddlePreviewFramework, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, collectRiddlePreviewDeployWarnings, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, getRiddleBalance, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, resolveRiddleApiKeySource, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from './riddle-client.cjs';
15
+ export { RIDDLE_PROOF_PR_COMMENT_MARKER, RiddleProofPrCommentArtifact, RiddleProofPrCommentArtifactKind, RiddleProofPrCommentInput, RiddleProofPrCommentPageSummary, RiddleProofPrCommentSummary, buildRiddleProofPrCommentMarkdown, summarizeRiddleProofPrComment } from './pr-comment.cjs';
package/dist/index.d.ts CHANGED
@@ -11,4 +11,5 @@ export { BuildVisualProofSessionInput, RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_V
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
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
- export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleApiKeySource, RiddleBalanceResult, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployResult, RiddlePreviewFramework, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, collectRiddlePreviewDeployWarnings, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, getRiddleBalance, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, resolveRiddleApiKeySource, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from './riddle-client.js';
14
+ export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleApiKeySource, RiddleBalanceResult, RiddleClientConfig, RiddleFetch, RiddlePollJobOptions, RiddlePollJobResult, RiddlePollProgressSnapshot, RiddlePollSummary, RiddlePreviewDeployProgressSnapshot, RiddlePreviewDeployResult, RiddlePreviewDeployStage, RiddlePreviewFramework, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, collectRiddlePreviewDeployWarnings, createRiddleApiClient, deployRiddlePreview, deployRiddleStaticPreview, getRiddleBalance, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, resolveRiddleApiKeySource, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from './riddle-client.js';
15
+ export { RIDDLE_PROOF_PR_COMMENT_MARKER, RiddleProofPrCommentArtifact, RiddleProofPrCommentArtifactKind, RiddleProofPrCommentInput, RiddleProofPrCommentPageSummary, RiddleProofPrCommentSummary, buildRiddleProofPrCommentMarkdown, summarizeRiddleProofPrComment } from './pr-comment.js';
package/dist/index.js CHANGED
@@ -37,6 +37,29 @@ import {
37
37
  resolveBasicGameplayProgressionCheckWithArtifactScreenshots,
38
38
  sanitizeBasicGameplayJsonString
39
39
  } from "./chunk-ELZSPOWV.js";
40
+ import {
41
+ DEFAULT_RIDDLE_API_BASE_URL,
42
+ DEFAULT_RIDDLE_API_KEY_FILE,
43
+ RiddleApiError,
44
+ collectRiddlePreviewDeployWarnings,
45
+ createRiddleApiClient,
46
+ deployRiddlePreview,
47
+ deployRiddleStaticPreview,
48
+ getRiddleBalance,
49
+ isTerminalRiddleJobStatus,
50
+ parseRiddleViewport,
51
+ pollRiddleJob,
52
+ resolveRiddleApiKey,
53
+ resolveRiddleApiKeySource,
54
+ riddleRequestJson,
55
+ runRiddleScript,
56
+ runRiddleServerPreview
57
+ } from "./chunk-DI2XNGEZ.js";
58
+ import {
59
+ RIDDLE_PROOF_PR_COMMENT_MARKER,
60
+ buildRiddleProofPrCommentMarkdown,
61
+ summarizeRiddleProofPrComment
62
+ } from "./chunk-6KYXX4OE.js";
40
63
  import {
41
64
  RIDDLE_PROOF_PROFILE_CHECK_TYPES,
42
65
  RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
@@ -63,24 +86,6 @@ import {
63
86
  slugifyRiddleProofProfileName,
64
87
  summarizeRiddleProofProfileResult
65
88
  } from "./chunk-Z2LCVROU.js";
66
- import {
67
- DEFAULT_RIDDLE_API_BASE_URL,
68
- DEFAULT_RIDDLE_API_KEY_FILE,
69
- RiddleApiError,
70
- collectRiddlePreviewDeployWarnings,
71
- createRiddleApiClient,
72
- deployRiddlePreview,
73
- deployRiddleStaticPreview,
74
- getRiddleBalance,
75
- isTerminalRiddleJobStatus,
76
- parseRiddleViewport,
77
- pollRiddleJob,
78
- resolveRiddleApiKey,
79
- resolveRiddleApiKeySource,
80
- riddleRequestJson,
81
- runRiddleScript,
82
- runRiddleServerPreview
83
- } from "./chunk-TWTEUS7R.js";
84
89
  import {
85
90
  DEFAULT_DIAGNOSTIC_ARRAY_LIMIT,
86
91
  DEFAULT_DIAGNOSTIC_HISTORY_LIMIT,
@@ -169,6 +174,7 @@ export {
169
174
  RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES,
170
175
  RIDDLE_PROOF_PROFILE_STATUSES,
171
176
  RIDDLE_PROOF_PROFILE_VERSION,
177
+ RIDDLE_PROOF_PR_COMMENT_MARKER,
172
178
  RIDDLE_PROOF_RUN_CARD_VERSION,
173
179
  RIDDLE_PROOF_RUN_STATE_VERSION,
174
180
  RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION,
@@ -191,6 +197,7 @@ export {
191
197
  buildAuthorCheckpointPacket,
192
198
  buildCheckpointPacketForEngineResult,
193
199
  buildProofAssessmentCheckpointPacket,
200
+ buildRiddleProofPrCommentMarkdown,
194
201
  buildRiddleProofProfileScript,
195
202
  buildStageCheckpointPacket,
196
203
  buildVisualProofSession,
@@ -265,6 +272,7 @@ export {
265
272
  slugifyRiddleProofProfileName,
266
273
  statePathsForRunState,
267
274
  summarizeCaptureArtifacts,
275
+ summarizeRiddleProofPrComment,
268
276
  summarizeRiddleProofProfileResult,
269
277
  visualSessionFingerprint,
270
278
  visualSessionFingerprintBasis