@riddledc/riddle-proof 0.8.63 → 0.8.65

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 CHANGED
@@ -7866,6 +7866,7 @@ var import_node_os2 = require("os");
7866
7866
  var import_node_path5 = __toESM(require("path"), 1);
7867
7867
  var DEFAULT_RIDDLE_API_BASE_URL = "https://api.riddledc.com";
7868
7868
  var DEFAULT_RIDDLE_API_KEY_FILE = "/tmp/riddle-api-key";
7869
+ var RIDDLE_UNSUBMITTED_WAKE_HINT = "hosted worker may still be waking or waiting for a lease";
7869
7870
  var RiddleApiError = class extends Error {
7870
7871
  constructor(pathname, status, body) {
7871
7872
  super(`Riddle API ${pathname} failed HTTP ${status}: ${body}`);
@@ -8333,9 +8334,10 @@ function buildPollSnapshot(jobId, job, input) {
8333
8334
  function pollMessage(snapshot, timedOut) {
8334
8335
  if (!timedOut) return void 0;
8335
8336
  const submitted = snapshot.submitted_at || "not submitted";
8337
+ const wakeHint = snapshot.running_without_submission && !snapshot.created_at && !snapshot.submitted_at ? ` ${RIDDLE_UNSUBMITTED_WAKE_HINT}.` : "";
8336
8338
  const queue = snapshot.queue_elapsed_ms !== null ? ` queue_elapsed_ms=${snapshot.queue_elapsed_ms}` : "";
8337
8339
  const preSubmit = snapshot.pre_submission_elapsed_ms > 0 ? ` pre_submission_elapsed_ms=${snapshot.pre_submission_elapsed_ms}` : "";
8338
- return `Riddle job ${snapshot.job_id} did not reach a terminal status after ${snapshot.attempt} poll attempts; status=${snapshot.status || "unknown"} submitted_at=${submitted}.${queue}${preSubmit}`;
8340
+ return `Riddle job ${snapshot.job_id} did not reach a terminal status after ${snapshot.attempt} poll attempts; status=${snapshot.status || "unknown"} submitted_at=${submitted}.${wakeHint}${queue}${preSubmit}`;
8339
8341
  }
8340
8342
  async function pollRiddleJob(config, jobId, options = {}) {
8341
8343
  if (!jobId?.trim()) throw new Error("jobId is required");
@@ -18284,6 +18286,176 @@ function buildRiddleProofPrCommentMarkdown(input) {
18284
18286
  `;
18285
18287
  }
18286
18288
 
18289
+ // src/profile-suggestions.ts
18290
+ var RIDDLE_PROOF_PROFILE_SUGGESTIONS_VERSION = "riddle-proof.profile-suggestions.v1";
18291
+ var UI_FILE_PATTERN = /\.(css|html?|jsx?|tsx?|vue|svelte|mdx)$/i;
18292
+ var VISUAL_ASSET_PATTERN = /\.(avif|gif|jpe?g|png|svg|webp)$/i;
18293
+ function nonEmptyStrings(values) {
18294
+ return Array.from(new Set(
18295
+ (values || []).filter((value) => typeof value === "string").map((value) => value.trim()).filter(Boolean)
18296
+ ));
18297
+ }
18298
+ function normalizeRoute(value) {
18299
+ if (!value?.trim()) return void 0;
18300
+ const trimmed = value.trim();
18301
+ if (/^https?:\/\//i.test(trimmed)) return void 0;
18302
+ return trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
18303
+ }
18304
+ function routeFromUrl(value) {
18305
+ if (!value?.trim()) return void 0;
18306
+ try {
18307
+ const url = new URL(value);
18308
+ return normalizeRoute(`${url.pathname}${url.search || ""}`);
18309
+ } catch {
18310
+ return void 0;
18311
+ }
18312
+ }
18313
+ function slugify(value) {
18314
+ return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 80) || "suggested-profile";
18315
+ }
18316
+ function inferRouteFromFile(file) {
18317
+ const normalized = file.replace(/\\/g, "/");
18318
+ const routeMatch = normalized.match(/(?:^|\/)(?:pages|routes|app)\/(.+?)(?:\.[^.\/]+)?$/);
18319
+ if (!routeMatch) return void 0;
18320
+ const route = routeMatch[1].replace(/\/index$/i, "").replace(/\/page$/i, "").replace(/\[[^/\]]+\]/g, ":param");
18321
+ return normalizeRoute(route || "/");
18322
+ }
18323
+ function inferRouteFromFiles(files) {
18324
+ for (const file of files) {
18325
+ const route = inferRouteFromFile(file);
18326
+ if (route) return route;
18327
+ }
18328
+ return void 0;
18329
+ }
18330
+ function uniqueChecks(checks) {
18331
+ const seen = /* @__PURE__ */ new Set();
18332
+ return checks.filter((check) => {
18333
+ const key = JSON.stringify(check);
18334
+ if (seen.has(key)) return false;
18335
+ seen.add(key);
18336
+ return true;
18337
+ });
18338
+ }
18339
+ function changedTextEntryText(entry) {
18340
+ return typeof entry === "string" ? entry.trim() : (entry.expected_text || entry.text || "").trim();
18341
+ }
18342
+ function changedTextEntrySelector(entry) {
18343
+ return typeof entry === "string" ? void 0 : entry.selector?.trim() || void 0;
18344
+ }
18345
+ function changedTextEntryLabel(entry) {
18346
+ return typeof entry === "string" ? void 0 : entry.label?.trim() || void 0;
18347
+ }
18348
+ function suggestionProfileName(input, route, files) {
18349
+ if (input.name?.trim()) return input.name.trim();
18350
+ return `suggested-${slugify(route || files[0] || "profile")}`;
18351
+ }
18352
+ function defaultViewports(includeMobile) {
18353
+ const viewports = [
18354
+ { name: "desktop", width: 1280, height: 800 }
18355
+ ];
18356
+ if (includeMobile !== false) {
18357
+ viewports.push({ name: "mobile", width: 390, height: 844 });
18358
+ }
18359
+ return viewports;
18360
+ }
18361
+ function suggestRiddleProofProfileChecks(input) {
18362
+ const changedFiles = nonEmptyStrings(input.changed_files);
18363
+ const selectors = nonEmptyStrings(input.selectors);
18364
+ const changedText = input.changed_text || [];
18365
+ const route = normalizeRoute(input.route) || inferRouteFromFiles(changedFiles) || routeFromUrl(input.url);
18366
+ const uiFiles = changedFiles.filter((file) => UI_FILE_PATTERN.test(file));
18367
+ const visualAssets = changedFiles.filter((file) => VISUAL_ASSET_PATTERN.test(file));
18368
+ const warnings = [];
18369
+ const suggestions = [];
18370
+ const setupActions = [];
18371
+ if (!route && !input.url?.trim()) {
18372
+ warnings.push("No route or URL was supplied; the draft profile defaults to route /.");
18373
+ }
18374
+ if ((uiFiles.length || visualAssets.length) && !changedText.length && !selectors.length) {
18375
+ warnings.push("UI or visual files changed, but no changed text or selectors were supplied; add focused checks before trusting this profile.");
18376
+ }
18377
+ const routeOrDefault = route || "/";
18378
+ const routeChecks = [
18379
+ { type: "route_loaded", expected_path: routeOrDefault }
18380
+ ];
18381
+ suggestions.push({
18382
+ id: "route-loaded",
18383
+ reason: "Every browser proof should first prove that the intended route loaded.",
18384
+ checks: routeChecks
18385
+ });
18386
+ const hygieneChecks = [
18387
+ { type: "no_fatal_console_errors" },
18388
+ { type: "no_mobile_horizontal_overflow" }
18389
+ ];
18390
+ suggestions.push({
18391
+ id: "runtime-hygiene",
18392
+ reason: "UI changes should not introduce fatal console errors or mobile overflow.",
18393
+ checks: hygieneChecks
18394
+ });
18395
+ for (const selector of selectors) {
18396
+ suggestions.push({
18397
+ id: `selector-${slugify(selector)}`,
18398
+ reason: `Changed selector ${selector} should remain visible.`,
18399
+ checks: [{ type: "selector_visible", selector }]
18400
+ });
18401
+ }
18402
+ for (const entry of changedText) {
18403
+ const text = changedTextEntryText(entry);
18404
+ if (!text) continue;
18405
+ const selector = changedTextEntrySelector(entry);
18406
+ const label = changedTextEntryLabel(entry);
18407
+ const check = selector ? { type: "selector_text_visible", selector, text, label } : { type: "text_visible", text, label };
18408
+ suggestions.push({
18409
+ id: `text-${slugify(`${selector || "page"}-${text}`)}`,
18410
+ reason: selector ? `Expected text should be visible inside ${selector}.` : "Expected text should be visible on the route.",
18411
+ checks: [check]
18412
+ });
18413
+ }
18414
+ if (input.include_screenshot !== false && (uiFiles.length || visualAssets.length || selectors.length || changedText.length)) {
18415
+ setupActions.push({ type: "screenshot", label: "suggested-proof-screenshot", full_page: true });
18416
+ suggestions.push({
18417
+ id: "screenshot-artifact",
18418
+ reason: "A screenshot artifact keeps the proof packet inspectable by humans and hosted renderers.",
18419
+ checks: [],
18420
+ setup_actions: setupActions
18421
+ });
18422
+ }
18423
+ const checks = uniqueChecks(suggestions.flatMap((suggestion) => suggestion.checks));
18424
+ const target = {
18425
+ ...input.url?.trim() ? { url: input.url.trim() } : { route: routeOrDefault },
18426
+ viewports: defaultViewports(input.include_mobile),
18427
+ setup_actions: setupActions.length ? setupActions : void 0
18428
+ };
18429
+ const profile = {
18430
+ version: RIDDLE_PROOF_PROFILE_VERSION,
18431
+ name: suggestionProfileName(input, routeOrDefault, changedFiles),
18432
+ target,
18433
+ checks,
18434
+ artifacts: ["screenshot", "console", "proof_json"],
18435
+ baseline_policy: "invariant_only",
18436
+ failure_policy: {
18437
+ product_regression: "fail",
18438
+ proof_insufficient: "review",
18439
+ environment_blocked: "neutral",
18440
+ configuration_error: "fail",
18441
+ needs_human_review: "review"
18442
+ },
18443
+ metadata: {
18444
+ suggestion_input: {
18445
+ changed_files: changedFiles,
18446
+ selectors,
18447
+ changed_text_count: changedText.length
18448
+ }
18449
+ }
18450
+ };
18451
+ return {
18452
+ version: RIDDLE_PROOF_PROFILE_SUGGESTIONS_VERSION,
18453
+ profile,
18454
+ suggestions,
18455
+ warnings
18456
+ };
18457
+ }
18458
+
18287
18459
  // src/cli.ts
18288
18460
  var RIDDLE_PROFILE_BALANCE_PREFLIGHT_MIN_SECONDS_PER_JOB = 30;
18289
18461
  var KNOWN_CLI_OPTIONS = /* @__PURE__ */ new Set([
@@ -18299,6 +18471,8 @@ var KNOWN_CLI_OPTIONS = /* @__PURE__ */ new Set([
18299
18471
  "candidatesJson",
18300
18472
  "checkpointMode",
18301
18473
  "checkpointVisibility",
18474
+ "changedFiles",
18475
+ "changedTextJson",
18302
18476
  "codexCommand",
18303
18477
  "codexFullAuto",
18304
18478
  "codexHome",
@@ -18320,6 +18494,8 @@ var KNOWN_CLI_OPTIONS = /* @__PURE__ */ new Set([
18320
18494
  "help",
18321
18495
  "hostedRiddle",
18322
18496
  "image",
18497
+ "includeMobile",
18498
+ "includeScreenshot",
18323
18499
  "input",
18324
18500
  "inputDir",
18325
18501
  "inputFile",
@@ -18330,6 +18506,7 @@ var KNOWN_CLI_OPTIONS = /* @__PURE__ */ new Set([
18330
18506
  "jobId",
18331
18507
  "localCore",
18332
18508
  "maxIterations",
18509
+ "name",
18333
18510
  "navigationTimeout",
18334
18511
  "output",
18335
18512
  "outputDir",
@@ -18362,6 +18539,7 @@ var KNOWN_CLI_OPTIONS = /* @__PURE__ */ new Set([
18362
18539
  "runResponse",
18363
18540
  "runner",
18364
18541
  "scriptFile",
18542
+ "selectors",
18365
18543
  "sourceKind",
18366
18544
  "splitViewports",
18367
18545
  "stateDir",
@@ -18397,6 +18575,7 @@ function usage() {
18397
18575
  " 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]",
18398
18576
  " 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]",
18399
18577
  " 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]",
18578
+ " riddle-proof-loop profile-suggest --route /path|--url <url> [--changed-files a,b] [--selectors .a,.b] [--changed-text-json <file|json|->] [--format json|profile]",
18400
18579
  " riddle-proof-loop regression-pack run [--pack oc-flow-regression|--pack-file <file>] [--local-core true|false; default true] [--hosted-riddle true|false; default false] [--format json|markdown|compact-json; default json] [--output <dir>|--output-dir <dir>]",
18401
18580
  " riddle-proof-loop pr-comment --proof-dir <dir>|--run-response <file> [--result-json <file>] --pr <number|url> [--repo owner/name] [--dry-run] [--body-file <file>] [--comment-mode update|append]",
18402
18581
  " riddle-proof-loop profile-body-assertions --artifact <file|url|-> --candidates-json <file|json|-> [--required-json <file|json|->] [--format json|body-contains]",
@@ -18451,6 +18630,10 @@ function optionString(options, key) {
18451
18630
  const value = options[key];
18452
18631
  return typeof value === "string" && value.trim() ? value.trim() : void 0;
18453
18632
  }
18633
+ function optionStringList(options, key) {
18634
+ const value = optionString(options, key);
18635
+ return value ? value.split(",").map((item) => item.trim()).filter(Boolean) : void 0;
18636
+ }
18454
18637
  function optionBoolean(options, key) {
18455
18638
  const value = options[key];
18456
18639
  if (typeof value === "undefined") return void 0;
@@ -19184,7 +19367,7 @@ function formatByteCount(bytes) {
19184
19367
  }
19185
19368
  function riddlePollProgressLine(snapshot) {
19186
19369
  const submittedAt = snapshot.submitted_at || "not-submitted";
19187
- const queuePart = snapshot.running_without_submission ? ` waiting_for_submit=${formatPollDuration(snapshot.pre_submission_elapsed_ms)}${snapshot.queue_elapsed_ms !== null ? ` queued_for=${formatPollDuration(snapshot.queue_elapsed_ms)}` : ""}` : snapshot.queue_elapsed_ms !== null ? ` queue=${formatPollDuration(snapshot.queue_elapsed_ms)}` : "";
19370
+ const queuePart = snapshot.running_without_submission ? ` waiting_for_worker_submit=${formatPollDuration(snapshot.pre_submission_elapsed_ms)} worker_wake=possible${snapshot.queue_elapsed_ms !== null ? ` queued_for=${formatPollDuration(snapshot.queue_elapsed_ms)}` : ""}` : snapshot.queue_elapsed_ms !== null ? ` queue=${formatPollDuration(snapshot.queue_elapsed_ms)}` : "";
19188
19371
  const terminalPart = snapshot.terminal ? " terminal=true" : "";
19189
19372
  return [
19190
19373
  "[riddle-poll]",
@@ -19291,6 +19474,11 @@ function readJsonValue(value, label) {
19291
19474
  }
19292
19475
  return parsed;
19293
19476
  }
19477
+ function readJsonAnyValue(value, label) {
19478
+ if (!value) throw new Error(`${label} is required.`);
19479
+ const raw = value === "-" ? readStdin() : (0, import_node_fs6.existsSync)(value) ? (0, import_node_fs6.readFileSync)(value, "utf-8") : value;
19480
+ return JSON.parse(raw);
19481
+ }
19294
19482
  function readOptionalJsonRecord(value, label) {
19295
19483
  if (!value) return void 0;
19296
19484
  return readJsonValue(value, label);
@@ -19605,7 +19793,7 @@ function profileRiddleJobMarkdown(result) {
19605
19793
  lines.push("- artifact recovery: used artifacts endpoint after non-terminal poll");
19606
19794
  }
19607
19795
  if (retryCount !== void 0 && retryCount > 0) {
19608
- lines.push(`- retry recovery: replaced ${retryCount} unsubmitted job${retryCount === 1 ? "" : "s"}${staleJobIds.length ? ` (${staleJobIds.map((value) => markdownInlineCode(value)).join(", ")})` : ""}`);
19796
+ lines.push(`- retry recovery: replaced ${retryCount} unsubmitted hosted job${retryCount === 1 ? "" : "s"}${staleJobIds.length ? ` (${staleJobIds.map((value) => markdownInlineCode(value)).join(", ")})` : ""}; ${RIDDLE_UNSUBMITTED_WAKE_HINT}`);
19609
19797
  }
19610
19798
  for (const job of splitJobs.slice(0, 12)) {
19611
19799
  const viewport = cliString(job.viewport) || "viewport";
@@ -22690,7 +22878,7 @@ async function runSingleRiddleProfileForCli(profile, options, input) {
22690
22878
  }
22691
22879
  staleJobIds.push(jobId);
22692
22880
  if (options.quiet !== true) {
22693
- process.stderr.write(`[riddle-poll] ${jobId} stayed unsubmitted for ${formatPollDuration(poll.poll?.pre_submission_elapsed_ms)}; retrying hosted run ${attempt + 1}/${retryLimit}
22881
+ process.stderr.write(`[riddle-poll] ${jobId} stayed unsubmitted for ${formatPollDuration(poll.poll?.pre_submission_elapsed_ms)}; ${RIDDLE_UNSUBMITTED_WAKE_HINT}; retrying hosted run ${attempt + 1}/${retryLimit}
22694
22882
  `);
22695
22883
  }
22696
22884
  continue;
@@ -22991,6 +23179,34 @@ async function main() {
22991
23179
  process.exitCode = result.ok ? 0 : 1;
22992
23180
  return;
22993
23181
  }
23182
+ if (command === "profile-suggest") {
23183
+ const changedTextJson = optionString(options, "changedTextJson");
23184
+ const changedText = changedTextJson ? readJsonAnyValue(changedTextJson, "--changed-text-json") : void 0;
23185
+ if (changedText !== void 0 && !Array.isArray(changedText)) {
23186
+ throw new Error("--changed-text-json must be a JSON array.");
23187
+ }
23188
+ const result = suggestRiddleProofProfileChecks({
23189
+ name: optionString(options, "name"),
23190
+ route: optionString(options, "route"),
23191
+ url: optionString(options, "url"),
23192
+ changed_files: optionStringList(options, "changedFiles"),
23193
+ selectors: optionStringList(options, "selectors"),
23194
+ changed_text: changedText,
23195
+ include_mobile: optionBoolean(options, "includeMobile"),
23196
+ include_screenshot: optionBoolean(options, "includeScreenshot")
23197
+ });
23198
+ const format = optionString(options, "format") || "json";
23199
+ if (format === "profile") {
23200
+ process.stdout.write(`${JSON.stringify(result.profile, null, 2)}
23201
+ `);
23202
+ } else if (format === "json") {
23203
+ process.stdout.write(`${JSON.stringify(result, null, 2)}
23204
+ `);
23205
+ } else {
23206
+ throw new Error("--format must be json or profile.");
23207
+ }
23208
+ return;
23209
+ }
22994
23210
  if (command === "profile-body-assertions") {
22995
23211
  const artifactText = await readTextValue(optionString(options, "artifact") ?? optionString(options, "input"), "--artifact");
22996
23212
  const candidates = readOptionalJsonStringArray(optionString(options, "candidatesJson") ?? optionString(options, "candidateJson"), "--candidates-json") ?? [];
package/dist/cli.js CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import "./chunk-DDAV6D6K.js";
3
- import "./chunk-DI2XNGEZ.js";
2
+ import "./chunk-JPRKO2DH.js";
3
+ import "./chunk-B2DP2LET.js";
4
4
  import "./chunk-RZ3GXSXQ.js";
5
+ import "./chunk-5Y4V2IXI.js";
5
6
  import "./chunk-EX7TO4I5.js";
6
7
  import "./chunk-P4BHU5NM.js";
7
8
  import "./chunk-NMQIWBSB.js";
package/dist/index.cjs CHANGED
@@ -3428,12 +3428,14 @@ __export(index_exports, {
3428
3428
  RIDDLE_PROOF_PROFILE_RESULT_VERSION: () => RIDDLE_PROOF_PROFILE_RESULT_VERSION,
3429
3429
  RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES: () => RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES,
3430
3430
  RIDDLE_PROOF_PROFILE_STATUSES: () => RIDDLE_PROOF_PROFILE_STATUSES,
3431
+ RIDDLE_PROOF_PROFILE_SUGGESTIONS_VERSION: () => RIDDLE_PROOF_PROFILE_SUGGESTIONS_VERSION,
3431
3432
  RIDDLE_PROOF_PROFILE_VERSION: () => RIDDLE_PROOF_PROFILE_VERSION,
3432
3433
  RIDDLE_PROOF_PR_COMMENT_MARKER: () => RIDDLE_PROOF_PR_COMMENT_MARKER,
3433
3434
  RIDDLE_PROOF_RUN_CARD_VERSION: () => RIDDLE_PROOF_RUN_CARD_VERSION,
3434
3435
  RIDDLE_PROOF_RUN_STATE_VERSION: () => RIDDLE_PROOF_RUN_STATE_VERSION,
3435
3436
  RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION: () => RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION,
3436
3437
  RIDDLE_PROOF_VISUAL_SESSION_VERSION: () => RIDDLE_PROOF_VISUAL_SESSION_VERSION,
3438
+ RIDDLE_UNSUBMITTED_WAKE_HINT: () => RIDDLE_UNSUBMITTED_WAKE_HINT,
3437
3439
  RiddleApiError: () => RiddleApiError,
3438
3440
  appendCaptureDiagnostic: () => appendCaptureDiagnostic,
3439
3441
  appendRunEvent: () => appendRunEvent,
@@ -3537,6 +3539,7 @@ __export(index_exports, {
3537
3539
  shipControlStateFor: () => shipControlStateFor,
3538
3540
  slugifyRiddleProofProfileName: () => slugifyRiddleProofProfileName,
3539
3541
  statePathsForRunState: () => statePathsForRunState,
3542
+ suggestRiddleProofProfileChecks: () => suggestRiddleProofProfileChecks,
3540
3543
  summarizeCaptureArtifacts: () => summarizeCaptureArtifacts,
3541
3544
  summarizeRiddleProofAgentSummarySurface: () => summarizeRiddleProofAgentSummarySurface,
3542
3545
  summarizeRiddleProofHostedProofViewSurface: () => summarizeRiddleProofHostedProofViewSurface,
@@ -19687,6 +19690,176 @@ function extractRiddleProofProfileResult(input) {
19687
19690
  return void 0;
19688
19691
  }
19689
19692
 
19693
+ // src/profile-suggestions.ts
19694
+ var RIDDLE_PROOF_PROFILE_SUGGESTIONS_VERSION = "riddle-proof.profile-suggestions.v1";
19695
+ var UI_FILE_PATTERN = /\.(css|html?|jsx?|tsx?|vue|svelte|mdx)$/i;
19696
+ var VISUAL_ASSET_PATTERN = /\.(avif|gif|jpe?g|png|svg|webp)$/i;
19697
+ function nonEmptyStrings(values) {
19698
+ return Array.from(new Set(
19699
+ (values || []).filter((value) => typeof value === "string").map((value) => value.trim()).filter(Boolean)
19700
+ ));
19701
+ }
19702
+ function normalizeRoute(value) {
19703
+ if (!value?.trim()) return void 0;
19704
+ const trimmed = value.trim();
19705
+ if (/^https?:\/\//i.test(trimmed)) return void 0;
19706
+ return trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
19707
+ }
19708
+ function routeFromUrl(value) {
19709
+ if (!value?.trim()) return void 0;
19710
+ try {
19711
+ const url = new URL(value);
19712
+ return normalizeRoute(`${url.pathname}${url.search || ""}`);
19713
+ } catch {
19714
+ return void 0;
19715
+ }
19716
+ }
19717
+ function slugify(value) {
19718
+ return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 80) || "suggested-profile";
19719
+ }
19720
+ function inferRouteFromFile(file) {
19721
+ const normalized = file.replace(/\\/g, "/");
19722
+ const routeMatch = normalized.match(/(?:^|\/)(?:pages|routes|app)\/(.+?)(?:\.[^.\/]+)?$/);
19723
+ if (!routeMatch) return void 0;
19724
+ const route = routeMatch[1].replace(/\/index$/i, "").replace(/\/page$/i, "").replace(/\[[^/\]]+\]/g, ":param");
19725
+ return normalizeRoute(route || "/");
19726
+ }
19727
+ function inferRouteFromFiles(files) {
19728
+ for (const file of files) {
19729
+ const route = inferRouteFromFile(file);
19730
+ if (route) return route;
19731
+ }
19732
+ return void 0;
19733
+ }
19734
+ function uniqueChecks(checks) {
19735
+ const seen = /* @__PURE__ */ new Set();
19736
+ return checks.filter((check) => {
19737
+ const key = JSON.stringify(check);
19738
+ if (seen.has(key)) return false;
19739
+ seen.add(key);
19740
+ return true;
19741
+ });
19742
+ }
19743
+ function changedTextEntryText(entry) {
19744
+ return typeof entry === "string" ? entry.trim() : (entry.expected_text || entry.text || "").trim();
19745
+ }
19746
+ function changedTextEntrySelector(entry) {
19747
+ return typeof entry === "string" ? void 0 : entry.selector?.trim() || void 0;
19748
+ }
19749
+ function changedTextEntryLabel(entry) {
19750
+ return typeof entry === "string" ? void 0 : entry.label?.trim() || void 0;
19751
+ }
19752
+ function suggestionProfileName(input, route, files) {
19753
+ if (input.name?.trim()) return input.name.trim();
19754
+ return `suggested-${slugify(route || files[0] || "profile")}`;
19755
+ }
19756
+ function defaultViewports(includeMobile) {
19757
+ const viewports = [
19758
+ { name: "desktop", width: 1280, height: 800 }
19759
+ ];
19760
+ if (includeMobile !== false) {
19761
+ viewports.push({ name: "mobile", width: 390, height: 844 });
19762
+ }
19763
+ return viewports;
19764
+ }
19765
+ function suggestRiddleProofProfileChecks(input) {
19766
+ const changedFiles = nonEmptyStrings(input.changed_files);
19767
+ const selectors = nonEmptyStrings(input.selectors);
19768
+ const changedText = input.changed_text || [];
19769
+ const route = normalizeRoute(input.route) || inferRouteFromFiles(changedFiles) || routeFromUrl(input.url);
19770
+ const uiFiles = changedFiles.filter((file) => UI_FILE_PATTERN.test(file));
19771
+ const visualAssets = changedFiles.filter((file) => VISUAL_ASSET_PATTERN.test(file));
19772
+ const warnings = [];
19773
+ const suggestions = [];
19774
+ const setupActions = [];
19775
+ if (!route && !input.url?.trim()) {
19776
+ warnings.push("No route or URL was supplied; the draft profile defaults to route /.");
19777
+ }
19778
+ if ((uiFiles.length || visualAssets.length) && !changedText.length && !selectors.length) {
19779
+ warnings.push("UI or visual files changed, but no changed text or selectors were supplied; add focused checks before trusting this profile.");
19780
+ }
19781
+ const routeOrDefault = route || "/";
19782
+ const routeChecks = [
19783
+ { type: "route_loaded", expected_path: routeOrDefault }
19784
+ ];
19785
+ suggestions.push({
19786
+ id: "route-loaded",
19787
+ reason: "Every browser proof should first prove that the intended route loaded.",
19788
+ checks: routeChecks
19789
+ });
19790
+ const hygieneChecks = [
19791
+ { type: "no_fatal_console_errors" },
19792
+ { type: "no_mobile_horizontal_overflow" }
19793
+ ];
19794
+ suggestions.push({
19795
+ id: "runtime-hygiene",
19796
+ reason: "UI changes should not introduce fatal console errors or mobile overflow.",
19797
+ checks: hygieneChecks
19798
+ });
19799
+ for (const selector of selectors) {
19800
+ suggestions.push({
19801
+ id: `selector-${slugify(selector)}`,
19802
+ reason: `Changed selector ${selector} should remain visible.`,
19803
+ checks: [{ type: "selector_visible", selector }]
19804
+ });
19805
+ }
19806
+ for (const entry of changedText) {
19807
+ const text = changedTextEntryText(entry);
19808
+ if (!text) continue;
19809
+ const selector = changedTextEntrySelector(entry);
19810
+ const label = changedTextEntryLabel(entry);
19811
+ const check = selector ? { type: "selector_text_visible", selector, text, label } : { type: "text_visible", text, label };
19812
+ suggestions.push({
19813
+ id: `text-${slugify(`${selector || "page"}-${text}`)}`,
19814
+ reason: selector ? `Expected text should be visible inside ${selector}.` : "Expected text should be visible on the route.",
19815
+ checks: [check]
19816
+ });
19817
+ }
19818
+ if (input.include_screenshot !== false && (uiFiles.length || visualAssets.length || selectors.length || changedText.length)) {
19819
+ setupActions.push({ type: "screenshot", label: "suggested-proof-screenshot", full_page: true });
19820
+ suggestions.push({
19821
+ id: "screenshot-artifact",
19822
+ reason: "A screenshot artifact keeps the proof packet inspectable by humans and hosted renderers.",
19823
+ checks: [],
19824
+ setup_actions: setupActions
19825
+ });
19826
+ }
19827
+ const checks = uniqueChecks(suggestions.flatMap((suggestion) => suggestion.checks));
19828
+ const target = {
19829
+ ...input.url?.trim() ? { url: input.url.trim() } : { route: routeOrDefault },
19830
+ viewports: defaultViewports(input.include_mobile),
19831
+ setup_actions: setupActions.length ? setupActions : void 0
19832
+ };
19833
+ const profile = {
19834
+ version: RIDDLE_PROOF_PROFILE_VERSION,
19835
+ name: suggestionProfileName(input, routeOrDefault, changedFiles),
19836
+ target,
19837
+ checks,
19838
+ artifacts: ["screenshot", "console", "proof_json"],
19839
+ baseline_policy: "invariant_only",
19840
+ failure_policy: {
19841
+ product_regression: "fail",
19842
+ proof_insufficient: "review",
19843
+ environment_blocked: "neutral",
19844
+ configuration_error: "fail",
19845
+ needs_human_review: "review"
19846
+ },
19847
+ metadata: {
19848
+ suggestion_input: {
19849
+ changed_files: changedFiles,
19850
+ selectors,
19851
+ changed_text_count: changedText.length
19852
+ }
19853
+ }
19854
+ };
19855
+ return {
19856
+ version: RIDDLE_PROOF_PROFILE_SUGGESTIONS_VERSION,
19857
+ profile,
19858
+ suggestions,
19859
+ warnings
19860
+ };
19861
+ }
19862
+
19690
19863
  // src/riddle-client.ts
19691
19864
  var import_node_child_process4 = require("child_process");
19692
19865
  var import_node_fs5 = require("fs");
@@ -19694,6 +19867,7 @@ var import_node_os2 = require("os");
19694
19867
  var import_node_path5 = __toESM(require("path"), 1);
19695
19868
  var DEFAULT_RIDDLE_API_BASE_URL = "https://api.riddledc.com";
19696
19869
  var DEFAULT_RIDDLE_API_KEY_FILE = "/tmp/riddle-api-key";
19870
+ var RIDDLE_UNSUBMITTED_WAKE_HINT = "hosted worker may still be waking or waiting for a lease";
19697
19871
  var RiddleApiError = class extends Error {
19698
19872
  constructor(pathname, status, body) {
19699
19873
  super(`Riddle API ${pathname} failed HTTP ${status}: ${body}`);
@@ -20161,9 +20335,10 @@ function buildPollSnapshot(jobId, job, input) {
20161
20335
  function pollMessage(snapshot, timedOut) {
20162
20336
  if (!timedOut) return void 0;
20163
20337
  const submitted = snapshot.submitted_at || "not submitted";
20338
+ const wakeHint = snapshot.running_without_submission && !snapshot.created_at && !snapshot.submitted_at ? ` ${RIDDLE_UNSUBMITTED_WAKE_HINT}.` : "";
20164
20339
  const queue = snapshot.queue_elapsed_ms !== null ? ` queue_elapsed_ms=${snapshot.queue_elapsed_ms}` : "";
20165
20340
  const preSubmit = snapshot.pre_submission_elapsed_ms > 0 ? ` pre_submission_elapsed_ms=${snapshot.pre_submission_elapsed_ms}` : "";
20166
- return `Riddle job ${snapshot.job_id} did not reach a terminal status after ${snapshot.attempt} poll attempts; status=${snapshot.status || "unknown"} submitted_at=${submitted}.${queue}${preSubmit}`;
20341
+ return `Riddle job ${snapshot.job_id} did not reach a terminal status after ${snapshot.attempt} poll attempts; status=${snapshot.status || "unknown"} submitted_at=${submitted}.${wakeHint}${queue}${preSubmit}`;
20167
20342
  }
20168
20343
  async function pollRiddleJob(config, jobId, options = {}) {
20169
20344
  if (!jobId?.trim()) throw new Error("jobId is required");
@@ -20600,12 +20775,14 @@ function buildRiddleProofPrCommentMarkdown(input) {
20600
20775
  RIDDLE_PROOF_PROFILE_RESULT_VERSION,
20601
20776
  RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES,
20602
20777
  RIDDLE_PROOF_PROFILE_STATUSES,
20778
+ RIDDLE_PROOF_PROFILE_SUGGESTIONS_VERSION,
20603
20779
  RIDDLE_PROOF_PROFILE_VERSION,
20604
20780
  RIDDLE_PROOF_PR_COMMENT_MARKER,
20605
20781
  RIDDLE_PROOF_RUN_CARD_VERSION,
20606
20782
  RIDDLE_PROOF_RUN_STATE_VERSION,
20607
20783
  RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION,
20608
20784
  RIDDLE_PROOF_VISUAL_SESSION_VERSION,
20785
+ RIDDLE_UNSUBMITTED_WAKE_HINT,
20609
20786
  RiddleApiError,
20610
20787
  appendCaptureDiagnostic,
20611
20788
  appendRunEvent,
@@ -20709,6 +20886,7 @@ function buildRiddleProofPrCommentMarkdown(input) {
20709
20886
  shipControlStateFor,
20710
20887
  slugifyRiddleProofProfileName,
20711
20888
  statePathsForRunState,
20889
+ suggestRiddleProofProfileChecks,
20712
20890
  summarizeCaptureArtifacts,
20713
20891
  summarizeRiddleProofAgentSummarySurface,
20714
20892
  summarizeRiddleProofHostedProofViewSurface,
package/dist/index.d.cts CHANGED
@@ -12,5 +12,6 @@ export { BuildVisualProofSessionInput, RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_V
12
12
  export { AssessPlayabilityOptions, RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION, RIDDLE_PROOF_PLAYABILITY_VERSION, RiddleProofPlayabilityAssessment, RiddleProofPlayabilityEvidence, assessPlayabilityEvidence, extractPlayabilityEvidence, isRiddleProofPlayabilityMode } from './playability.cjs';
13
13
  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';
14
14
  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, RiddleProofProfileArtifactCompleteness, 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, applyRiddleProofProfileArtifactCompleteness, assessRiddleProofProfileArtifactCompleteness, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, preflightRiddleProofProfileHttpStatusChecks, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from './profile.cjs';
15
- 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_PROFILE_SUGGESTIONS_VERSION, RiddleProofProfileChangedTextInput, RiddleProofProfileSuggestion, RiddleProofProfileSuggestionInput, RiddleProofProfileSuggestionsResult, suggestRiddleProofProfileChecks } from './profile-suggestions.cjs';
16
+ export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RIDDLE_UNSUBMITTED_WAKE_HINT, 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';
16
17
  export { RIDDLE_PROOF_PR_COMMENT_MARKER, RiddleProofPrCommentArtifact, RiddleProofPrCommentArtifactKind, RiddleProofPrCommentCheckpointSummary, RiddleProofPrCommentInput, RiddleProofPrCommentPageSummary, RiddleProofPrCommentSummary, buildRiddleProofPrCommentMarkdown, summarizeRiddleProofPrComment } from './pr-comment.cjs';
package/dist/index.d.ts CHANGED
@@ -12,5 +12,6 @@ export { BuildVisualProofSessionInput, RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_V
12
12
  export { AssessPlayabilityOptions, RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION, RIDDLE_PROOF_PLAYABILITY_VERSION, RiddleProofPlayabilityAssessment, RiddleProofPlayabilityEvidence, assessPlayabilityEvidence, extractPlayabilityEvidence, isRiddleProofPlayabilityMode } from './playability.js';
13
13
  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';
14
14
  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, RiddleProofProfileArtifactCompleteness, 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, applyRiddleProofProfileArtifactCompleteness, assessRiddleProofProfileArtifactCompleteness, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, preflightRiddleProofProfileHttpStatusChecks, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from './profile.js';
15
- 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_PROFILE_SUGGESTIONS_VERSION, RiddleProofProfileChangedTextInput, RiddleProofProfileSuggestion, RiddleProofProfileSuggestionInput, RiddleProofProfileSuggestionsResult, suggestRiddleProofProfileChecks } from './profile-suggestions.js';
16
+ export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RIDDLE_UNSUBMITTED_WAKE_HINT, 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';
16
17
  export { RIDDLE_PROOF_PR_COMMENT_MARKER, RiddleProofPrCommentArtifact, RiddleProofPrCommentArtifactKind, RiddleProofPrCommentCheckpointSummary, RiddleProofPrCommentInput, RiddleProofPrCommentPageSummary, RiddleProofPrCommentSummary, buildRiddleProofPrCommentMarkdown, summarizeRiddleProofPrComment } from './pr-comment.js';
package/dist/index.js CHANGED
@@ -40,6 +40,7 @@ import {
40
40
  import {
41
41
  DEFAULT_RIDDLE_API_BASE_URL,
42
42
  DEFAULT_RIDDLE_API_KEY_FILE,
43
+ RIDDLE_UNSUBMITTED_WAKE_HINT,
43
44
  RiddleApiError,
44
45
  collectRiddlePreviewDeployWarnings,
45
46
  createRiddleApiClient,
@@ -54,12 +55,16 @@ import {
54
55
  riddleRequestJson,
55
56
  runRiddleScript,
56
57
  runRiddleServerPreview
57
- } from "./chunk-DI2XNGEZ.js";
58
+ } from "./chunk-B2DP2LET.js";
58
59
  import {
59
60
  RIDDLE_PROOF_PR_COMMENT_MARKER,
60
61
  buildRiddleProofPrCommentMarkdown,
61
62
  summarizeRiddleProofPrComment
62
63
  } from "./chunk-RZ3GXSXQ.js";
64
+ import {
65
+ RIDDLE_PROOF_PROFILE_SUGGESTIONS_VERSION,
66
+ suggestRiddleProofProfileChecks
67
+ } from "./chunk-5Y4V2IXI.js";
63
68
  import {
64
69
  RIDDLE_PROOF_PROFILE_CHECK_TYPES,
65
70
  RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
@@ -190,12 +195,14 @@ export {
190
195
  RIDDLE_PROOF_PROFILE_RESULT_VERSION,
191
196
  RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES,
192
197
  RIDDLE_PROOF_PROFILE_STATUSES,
198
+ RIDDLE_PROOF_PROFILE_SUGGESTIONS_VERSION,
193
199
  RIDDLE_PROOF_PROFILE_VERSION,
194
200
  RIDDLE_PROOF_PR_COMMENT_MARKER,
195
201
  RIDDLE_PROOF_RUN_CARD_VERSION,
196
202
  RIDDLE_PROOF_RUN_STATE_VERSION,
197
203
  RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION,
198
204
  RIDDLE_PROOF_VISUAL_SESSION_VERSION,
205
+ RIDDLE_UNSUBMITTED_WAKE_HINT,
199
206
  RiddleApiError,
200
207
  appendCaptureDiagnostic,
201
208
  appendRunEvent,
@@ -299,6 +306,7 @@ export {
299
306
  shipControlStateFor,
300
307
  slugifyRiddleProofProfileName,
301
308
  statePathsForRunState,
309
+ suggestRiddleProofProfileChecks,
302
310
  summarizeCaptureArtifacts,
303
311
  summarizeRiddleProofAgentSummarySurface,
304
312
  summarizeRiddleProofHostedProofViewSurface,