@riddledc/riddle-proof 0.7.190 → 0.7.192

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.
@@ -5754,7 +5754,118 @@ function setupJsonValue(value) {
5754
5754
  function setupValuesEqual(left, right) {
5755
5755
  return JSON.stringify(setupJsonValue(left)) === JSON.stringify(setupJsonValue(right));
5756
5756
  }
5757
+ async function ensureProfilePageHelpers(context) {
5758
+ try {
5759
+ await context.evaluate(({ targetUrl }) => {
5760
+ const asPathname = (path) => {
5761
+ const value = String(path || "/");
5762
+ return value.startsWith("/") ? value : "/" + value;
5763
+ };
5764
+ const normalizePathname = (path) => {
5765
+ const value = asPathname(path);
5766
+ return value === "/" ? "/" : value.replace(/\/+$/, "") || "/";
5767
+ };
5768
+ const previewMountPrefix = (pathname) => {
5769
+ const value = normalizePathname(pathname);
5770
+ const apiPreview = value.match(/^(\/s\/[^/]+)(?:\/|$)/);
5771
+ if (apiPreview) return apiPreview[1];
5772
+ const internalPreview = value.match(/^(\/preview\/[^/]+\/[^/]+)(?:\/|$)/);
5773
+ return internalPreview ? internalPreview[1] : "";
5774
+ };
5775
+ const targetMountPrefix = () => {
5776
+ try {
5777
+ return previewMountPrefix(new URL(String(targetUrl || ""), window.location.href).pathname);
5778
+ } catch {
5779
+ return "";
5780
+ }
5781
+ };
5782
+ const currentRoute = () => {
5783
+ const pathname = asPathname(window.location.pathname);
5784
+ const normalizedPathname = normalizePathname(pathname);
5785
+ const currentBasePath = previewMountPrefix(normalizedPathname);
5786
+ const basePath = currentBasePath || targetMountPrefix();
5787
+ const suffix = String(window.location.search || "") + String(window.location.hash || "");
5788
+ const appPath = currentBasePath && (normalizedPathname === currentBasePath || normalizedPathname.startsWith(currentBasePath + "/"))
5789
+ ? normalizePathname(normalizedPathname.slice(currentBasePath.length) || "/")
5790
+ : normalizedPathname;
5791
+ return {
5792
+ url: window.location.href,
5793
+ origin: window.location.origin,
5794
+ pathname,
5795
+ search: window.location.search,
5796
+ hash: window.location.hash,
5797
+ basePath,
5798
+ previewMountPrefix: basePath,
5799
+ currentBasePath,
5800
+ appPath,
5801
+ appRoute: appPath + suffix,
5802
+ mountedPath: normalizedPathname,
5803
+ mountedRoute: normalizedPathname + suffix,
5804
+ isPreviewMounted: Boolean(currentBasePath),
5805
+ };
5806
+ };
5807
+ const parseRoute = (route) => {
5808
+ const raw = String(route || "/").trim() || "/";
5809
+ if (/^https?:\/\//i.test(raw)) {
5810
+ try {
5811
+ const url = new URL(raw);
5812
+ if (url.origin !== window.location.origin) return { external: true, value: raw };
5813
+ return { external: false, pathname: normalizePathname(url.pathname), suffix: url.search + url.hash };
5814
+ } catch {
5815
+ return { external: false, pathname: normalizePathname(raw), suffix: "" };
5816
+ }
5817
+ }
5818
+ try {
5819
+ const url = new URL(raw, window.location.origin);
5820
+ return { external: false, pathname: normalizePathname(url.pathname), suffix: url.search + url.hash };
5821
+ } catch {
5822
+ const hashIndex = raw.indexOf("#");
5823
+ const beforeHash = hashIndex >= 0 ? raw.slice(0, hashIndex) : raw;
5824
+ const hash = hashIndex >= 0 ? raw.slice(hashIndex) : "";
5825
+ const searchIndex = beforeHash.indexOf("?");
5826
+ const pathname = searchIndex >= 0 ? beforeHash.slice(0, searchIndex) : beforeHash;
5827
+ const search = searchIndex >= 0 ? beforeHash.slice(searchIndex) : "";
5828
+ return { external: false, pathname: normalizePathname(pathname), suffix: search + hash };
5829
+ }
5830
+ };
5831
+ const joinRoute = (route) => {
5832
+ const parsed = parseRoute(route);
5833
+ if (parsed.external) return parsed.value;
5834
+ const current = currentRoute();
5835
+ const basePath = current.basePath || "";
5836
+ const routePath = parsed.pathname || "/";
5837
+ if (!basePath) return routePath + (parsed.suffix || "");
5838
+ if (routePath === basePath || routePath.startsWith(basePath + "/")) return routePath + (parsed.suffix || "");
5839
+ return (routePath === "/" ? basePath + "/" : basePath + routePath) + (parsed.suffix || "");
5840
+ };
5841
+ const existing = window.__riddleProofProfile && typeof window.__riddleProofProfile === "object"
5842
+ ? window.__riddleProofProfile
5843
+ : {};
5844
+ const refreshSnapshot = () => {
5845
+ const route = currentRoute();
5846
+ existing.current = route;
5847
+ existing.appPath = route.appPath;
5848
+ existing.appRoute = route.appRoute;
5849
+ existing.basePath = route.basePath;
5850
+ existing.previewMountPrefix = route.previewMountPrefix;
5851
+ existing.mountedPath = route.mountedPath;
5852
+ existing.mountedRoute = route.mountedRoute;
5853
+ return route;
5854
+ };
5855
+ existing.version = "riddle-proof.profile-helper.v1";
5856
+ existing.route = currentRoute;
5857
+ existing.getRoute = currentRoute;
5858
+ existing.refresh = refreshSnapshot;
5859
+ existing.joinRoute = joinRoute;
5860
+ refreshSnapshot();
5861
+ window.__riddleProofProfile = existing;
5862
+ }, { targetUrl });
5863
+ } catch {
5864
+ // Profile helper injection is best-effort so existing window actions keep their old behavior.
5865
+ }
5866
+ }
5757
5867
  async function setupReadWindowValue(context, path) {
5868
+ await ensureProfilePageHelpers(context);
5758
5869
  return await context.evaluate(({ path }) => {
5759
5870
  const toJsonValue = (value) => {
5760
5871
  if (value === null || value === undefined) return null;
@@ -5778,6 +5889,7 @@ async function setupReadWindowValue(context, path) {
5778
5889
  }, { path });
5779
5890
  }
5780
5891
  async function setupCallWindowFunction(context, path, args, storeReturnTo, captureReturn) {
5892
+ await ensureProfilePageHelpers(context);
5781
5893
  return await context.evaluate(async ({ path, args, storeReturnTo, captureReturn }) => {
5782
5894
  const toJsonValue = (value) => {
5783
5895
  if (value === null || value === undefined) return null;
@@ -5826,6 +5938,7 @@ async function setupCallWindowFunction(context, path, args, storeReturnTo, captu
5826
5938
  }, { path, args, storeReturnTo, captureReturn });
5827
5939
  }
5828
5940
  async function setupEvaluateWindowScript(context, script, args, storeReturnTo, captureReturn) {
5941
+ await ensureProfilePageHelpers(context);
5829
5942
  return await context.evaluate(async ({ script, args, storeReturnTo, captureReturn }) => {
5830
5943
  const toJsonValue = (value) => {
5831
5944
  if (value === null || value === undefined) return null;
package/dist/cli.cjs CHANGED
@@ -12695,7 +12695,118 @@ function setupJsonValue(value) {
12695
12695
  function setupValuesEqual(left, right) {
12696
12696
  return JSON.stringify(setupJsonValue(left)) === JSON.stringify(setupJsonValue(right));
12697
12697
  }
12698
+ async function ensureProfilePageHelpers(context) {
12699
+ try {
12700
+ await context.evaluate(({ targetUrl }) => {
12701
+ const asPathname = (path) => {
12702
+ const value = String(path || "/");
12703
+ return value.startsWith("/") ? value : "/" + value;
12704
+ };
12705
+ const normalizePathname = (path) => {
12706
+ const value = asPathname(path);
12707
+ return value === "/" ? "/" : value.replace(/\/+$/, "") || "/";
12708
+ };
12709
+ const previewMountPrefix = (pathname) => {
12710
+ const value = normalizePathname(pathname);
12711
+ const apiPreview = value.match(/^(\/s\/[^/]+)(?:\/|$)/);
12712
+ if (apiPreview) return apiPreview[1];
12713
+ const internalPreview = value.match(/^(\/preview\/[^/]+\/[^/]+)(?:\/|$)/);
12714
+ return internalPreview ? internalPreview[1] : "";
12715
+ };
12716
+ const targetMountPrefix = () => {
12717
+ try {
12718
+ return previewMountPrefix(new URL(String(targetUrl || ""), window.location.href).pathname);
12719
+ } catch {
12720
+ return "";
12721
+ }
12722
+ };
12723
+ const currentRoute = () => {
12724
+ const pathname = asPathname(window.location.pathname);
12725
+ const normalizedPathname = normalizePathname(pathname);
12726
+ const currentBasePath = previewMountPrefix(normalizedPathname);
12727
+ const basePath = currentBasePath || targetMountPrefix();
12728
+ const suffix = String(window.location.search || "") + String(window.location.hash || "");
12729
+ const appPath = currentBasePath && (normalizedPathname === currentBasePath || normalizedPathname.startsWith(currentBasePath + "/"))
12730
+ ? normalizePathname(normalizedPathname.slice(currentBasePath.length) || "/")
12731
+ : normalizedPathname;
12732
+ return {
12733
+ url: window.location.href,
12734
+ origin: window.location.origin,
12735
+ pathname,
12736
+ search: window.location.search,
12737
+ hash: window.location.hash,
12738
+ basePath,
12739
+ previewMountPrefix: basePath,
12740
+ currentBasePath,
12741
+ appPath,
12742
+ appRoute: appPath + suffix,
12743
+ mountedPath: normalizedPathname,
12744
+ mountedRoute: normalizedPathname + suffix,
12745
+ isPreviewMounted: Boolean(currentBasePath),
12746
+ };
12747
+ };
12748
+ const parseRoute = (route) => {
12749
+ const raw = String(route || "/").trim() || "/";
12750
+ if (/^https?:\/\//i.test(raw)) {
12751
+ try {
12752
+ const url = new URL(raw);
12753
+ if (url.origin !== window.location.origin) return { external: true, value: raw };
12754
+ return { external: false, pathname: normalizePathname(url.pathname), suffix: url.search + url.hash };
12755
+ } catch {
12756
+ return { external: false, pathname: normalizePathname(raw), suffix: "" };
12757
+ }
12758
+ }
12759
+ try {
12760
+ const url = new URL(raw, window.location.origin);
12761
+ return { external: false, pathname: normalizePathname(url.pathname), suffix: url.search + url.hash };
12762
+ } catch {
12763
+ const hashIndex = raw.indexOf("#");
12764
+ const beforeHash = hashIndex >= 0 ? raw.slice(0, hashIndex) : raw;
12765
+ const hash = hashIndex >= 0 ? raw.slice(hashIndex) : "";
12766
+ const searchIndex = beforeHash.indexOf("?");
12767
+ const pathname = searchIndex >= 0 ? beforeHash.slice(0, searchIndex) : beforeHash;
12768
+ const search = searchIndex >= 0 ? beforeHash.slice(searchIndex) : "";
12769
+ return { external: false, pathname: normalizePathname(pathname), suffix: search + hash };
12770
+ }
12771
+ };
12772
+ const joinRoute = (route) => {
12773
+ const parsed = parseRoute(route);
12774
+ if (parsed.external) return parsed.value;
12775
+ const current = currentRoute();
12776
+ const basePath = current.basePath || "";
12777
+ const routePath = parsed.pathname || "/";
12778
+ if (!basePath) return routePath + (parsed.suffix || "");
12779
+ if (routePath === basePath || routePath.startsWith(basePath + "/")) return routePath + (parsed.suffix || "");
12780
+ return (routePath === "/" ? basePath + "/" : basePath + routePath) + (parsed.suffix || "");
12781
+ };
12782
+ const existing = window.__riddleProofProfile && typeof window.__riddleProofProfile === "object"
12783
+ ? window.__riddleProofProfile
12784
+ : {};
12785
+ const refreshSnapshot = () => {
12786
+ const route = currentRoute();
12787
+ existing.current = route;
12788
+ existing.appPath = route.appPath;
12789
+ existing.appRoute = route.appRoute;
12790
+ existing.basePath = route.basePath;
12791
+ existing.previewMountPrefix = route.previewMountPrefix;
12792
+ existing.mountedPath = route.mountedPath;
12793
+ existing.mountedRoute = route.mountedRoute;
12794
+ return route;
12795
+ };
12796
+ existing.version = "riddle-proof.profile-helper.v1";
12797
+ existing.route = currentRoute;
12798
+ existing.getRoute = currentRoute;
12799
+ existing.refresh = refreshSnapshot;
12800
+ existing.joinRoute = joinRoute;
12801
+ refreshSnapshot();
12802
+ window.__riddleProofProfile = existing;
12803
+ }, { targetUrl });
12804
+ } catch {
12805
+ // Profile helper injection is best-effort so existing window actions keep their old behavior.
12806
+ }
12807
+ }
12698
12808
  async function setupReadWindowValue(context, path) {
12809
+ await ensureProfilePageHelpers(context);
12699
12810
  return await context.evaluate(({ path }) => {
12700
12811
  const toJsonValue = (value) => {
12701
12812
  if (value === null || value === undefined) return null;
@@ -12719,6 +12830,7 @@ async function setupReadWindowValue(context, path) {
12719
12830
  }, { path });
12720
12831
  }
12721
12832
  async function setupCallWindowFunction(context, path, args, storeReturnTo, captureReturn) {
12833
+ await ensureProfilePageHelpers(context);
12722
12834
  return await context.evaluate(async ({ path, args, storeReturnTo, captureReturn }) => {
12723
12835
  const toJsonValue = (value) => {
12724
12836
  if (value === null || value === undefined) return null;
@@ -12767,6 +12879,7 @@ async function setupCallWindowFunction(context, path, args, storeReturnTo, captu
12767
12879
  }, { path, args, storeReturnTo, captureReturn });
12768
12880
  }
12769
12881
  async function setupEvaluateWindowScript(context, script, args, storeReturnTo, captureReturn) {
12882
+ await ensureProfilePageHelpers(context);
12770
12883
  return await context.evaluate(async ({ script, args, storeReturnTo, captureReturn }) => {
12771
12884
  const toJsonValue = (value) => {
12772
12885
  if (value === null || value === undefined) return null;
@@ -16457,6 +16570,24 @@ function profileHasTerminalLossReceipt(receipts) {
16457
16570
  return lastFlightLost || outOfBounds || ["over", "lost", "loss", "failed", "failure", "game_over", "gameover"].includes(status) || ["lost", "loss", "failed", "failure", "game_over", "gameover"].includes(outcome);
16458
16571
  });
16459
16572
  }
16573
+ function profileHasTerminalSuccessReceipt(receipts) {
16574
+ return receipts.some((receipt) => {
16575
+ const status = profileLowerSummaryValue(receipt, ["status", "state", "phase"]);
16576
+ const outcome = profileLowerSummaryValue(receipt, ["lastOutcome", "outcome", "terminalOutcome", "terminal", "result"]);
16577
+ const storedTo = cliString(receipt.return_stored_to) || "";
16578
+ const label = cliString(receipt.label) || "";
16579
+ const path7 = cliString(receipt.path) || cliString(receipt.function_name) || "";
16580
+ const haystack = `${storedTo} ${label} ${path7}`.toLowerCase();
16581
+ if (haystack.includes("shot")) return false;
16582
+ const labelsSuccess = haystack.includes("success") || haystack.includes("terminal") || haystack.includes("completed") || haystack.includes("complete");
16583
+ const success = setupReturnSummaryValue(receipt, ["success", "passed", "completed"]) === true;
16584
+ const targetHit = setupReturnSummaryValue(receipt, ["lastFlightTargetHit", "targetHit"]) === true;
16585
+ const gateHit = setupReturnSummaryValue(receipt, ["lastFlight.passedThroughGate", "passedThroughGate", "gate"]) === true;
16586
+ const bucketHit = setupReturnSummaryValue(receipt, ["lastFlight.bucketHit", "bucketHit", "bucket"]) === true;
16587
+ if (!labelsSuccess && !success && !targetHit && !gateHit && !bucketHit) return false;
16588
+ return success || targetHit || gateHit || bucketHit || ["success", "won", "complete", "completed", "passed"].includes(status) || ["success", "won", "complete", "completed", "passed"].includes(outcome);
16589
+ });
16590
+ }
16460
16591
  function profileHasControlledLaunchReceipt(receipts, expected) {
16461
16592
  return receipts.some((receipt) => {
16462
16593
  const shotKind = profileLowerSummaryValue(receipt, ["lastShotKind", "shotKind", "kind"]);
@@ -16468,6 +16599,20 @@ function profileHasControlledLaunchReceipt(receipts, expected) {
16468
16599
  return ["failure", "failed", "miss", "lost", "loss"].includes(shotKind) || ["failure", "failed", "miss", "lost", "loss"].includes(shotStatus) || ["failure", "failed", "miss", "lost", "loss"].includes(outcome);
16469
16600
  });
16470
16601
  }
16602
+ function profileHasRouteContinuationReceipt(receipts) {
16603
+ return receipts.some((receipt) => {
16604
+ const fromRoute = cliString(setupReturnSummaryValue(receipt, ["fromRoute", "from", "previousRoute", "sourceRoute"]));
16605
+ const target = cliString(setupReturnSummaryValue(receipt, ["target", "nextHref", "toRoute", "nextRoute", "href"]));
16606
+ const afterRoute = cliString(setupReturnSummaryValue(receipt, ["routeAfterPush", "afterRoute", "route", "observedRoute"]));
16607
+ if (!fromRoute || !target && !afterRoute) return false;
16608
+ const storedTo = cliString(receipt.return_stored_to) || "";
16609
+ const label = cliString(receipt.label) || "";
16610
+ const path7 = cliString(receipt.path) || cliString(receipt.function_name) || "";
16611
+ const summary = cliReturnSummaryLabel(receipt.return_summary) || "";
16612
+ const haystack = `${storedTo} ${label} ${path7} ${summary}`.toLowerCase();
16613
+ return haystack.includes("navigation") || haystack.includes("continuation") || haystack.includes("route") || haystack.includes("next") || haystack.includes("target");
16614
+ });
16615
+ }
16471
16616
  function profileHasRecoveredStateReceipt(receipts) {
16472
16617
  return receipts.some((receipt) => {
16473
16618
  const storedTo = cliString(receipt.return_stored_to) || "";
@@ -16539,8 +16684,10 @@ function profilePackReceiptStatus(result, metadata, receipt) {
16539
16684
  const hasOfflineAudioMetricsReceipt = profileHasOfflineAudioMetricsReceipt(valueReceipts);
16540
16685
  const hasActiveRouteLocalProofReceipt = profileHasActiveRouteLocalProofReceipt(valueReceipts);
16541
16686
  const hasTerminalLossReceipt = profileHasTerminalLossReceipt(valueReceipts);
16687
+ const hasTerminalSuccessReceipt = profileHasTerminalSuccessReceipt(valueReceipts);
16542
16688
  const hasControlledFailureLaunchReceipt = profileHasControlledLaunchReceipt(valueReceipts, "failure");
16543
16689
  const hasControlledSuccessLaunchReceipt = profileHasControlledLaunchReceipt(valueReceipts, "success");
16690
+ const hasRouteContinuationReceipt = profileHasRouteContinuationReceipt(valueReceipts);
16544
16691
  const hasRecoveredStateReceipt = profileHasRecoveredStateReceipt(valueReceipts);
16545
16692
  const failedCleanupInventoryReason = profileFailedCleanupInventoryReason(setupViewports);
16546
16693
  if (text.includes("artifact link") || text.includes("artifact path")) {
@@ -16594,6 +16741,13 @@ function profilePackReceiptStatus(result, metadata, receipt) {
16594
16741
  "terminal loss receipt missing"
16595
16742
  );
16596
16743
  }
16744
+ if (text.includes("success") && text.includes("terminal")) {
16745
+ return profileReceiptSignalStatus(
16746
+ hasTerminalSuccessReceipt,
16747
+ "terminal success receipt present",
16748
+ "terminal success receipt missing"
16749
+ );
16750
+ }
16597
16751
  if (text.includes("controlled") && text.includes("launch") && (text.includes("failure") || text.includes("failed") || text.includes("miss"))) {
16598
16752
  return profileReceiptSignalStatus(
16599
16753
  hasControlledFailureLaunchReceipt,
@@ -16615,6 +16769,13 @@ function profilePackReceiptStatus(result, metadata, receipt) {
16615
16769
  "visible recovery-action receipt missing"
16616
16770
  );
16617
16771
  }
16772
+ if (text.includes("route continuation") || text.includes("route-transition") || text.includes("route transition")) {
16773
+ return profileReceiptSignalStatus(
16774
+ hasRouteContinuationReceipt,
16775
+ "route continuation receipt present",
16776
+ "route continuation receipt missing"
16777
+ );
16778
+ }
16618
16779
  if (text.includes("through visible ui") || text.includes("visible ui action") || text.includes("ui-routed") || text.includes("ui routed") || text.includes("visible") && text.includes("route") && text.includes("exit") && text.includes("action") || text.includes("visible") && text.includes("mode") && text.includes("exit") && text.includes("action")) {
16619
16780
  return profileReceiptSignalStatus(
16620
16781
  visibleUiActionCount > 0,
package/dist/cli.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  profileStatusExitCode,
14
14
  resolveRiddleProofProfileTargetUrl,
15
15
  resolveRiddleProofProfileTimeoutSec
16
- } from "./chunk-Z42O55GB.js";
16
+ } from "./chunk-UKMTTGQ4.js";
17
17
  import {
18
18
  createRiddleApiClient,
19
19
  isTerminalRiddleJobStatus,
@@ -662,6 +662,24 @@ function profileHasTerminalLossReceipt(receipts) {
662
662
  return lastFlightLost || outOfBounds || ["over", "lost", "loss", "failed", "failure", "game_over", "gameover"].includes(status) || ["lost", "loss", "failed", "failure", "game_over", "gameover"].includes(outcome);
663
663
  });
664
664
  }
665
+ function profileHasTerminalSuccessReceipt(receipts) {
666
+ return receipts.some((receipt) => {
667
+ const status = profileLowerSummaryValue(receipt, ["status", "state", "phase"]);
668
+ const outcome = profileLowerSummaryValue(receipt, ["lastOutcome", "outcome", "terminalOutcome", "terminal", "result"]);
669
+ const storedTo = cliString(receipt.return_stored_to) || "";
670
+ const label = cliString(receipt.label) || "";
671
+ const path2 = cliString(receipt.path) || cliString(receipt.function_name) || "";
672
+ const haystack = `${storedTo} ${label} ${path2}`.toLowerCase();
673
+ if (haystack.includes("shot")) return false;
674
+ const labelsSuccess = haystack.includes("success") || haystack.includes("terminal") || haystack.includes("completed") || haystack.includes("complete");
675
+ const success = setupReturnSummaryValue(receipt, ["success", "passed", "completed"]) === true;
676
+ const targetHit = setupReturnSummaryValue(receipt, ["lastFlightTargetHit", "targetHit"]) === true;
677
+ const gateHit = setupReturnSummaryValue(receipt, ["lastFlight.passedThroughGate", "passedThroughGate", "gate"]) === true;
678
+ const bucketHit = setupReturnSummaryValue(receipt, ["lastFlight.bucketHit", "bucketHit", "bucket"]) === true;
679
+ if (!labelsSuccess && !success && !targetHit && !gateHit && !bucketHit) return false;
680
+ return success || targetHit || gateHit || bucketHit || ["success", "won", "complete", "completed", "passed"].includes(status) || ["success", "won", "complete", "completed", "passed"].includes(outcome);
681
+ });
682
+ }
665
683
  function profileHasControlledLaunchReceipt(receipts, expected) {
666
684
  return receipts.some((receipt) => {
667
685
  const shotKind = profileLowerSummaryValue(receipt, ["lastShotKind", "shotKind", "kind"]);
@@ -673,6 +691,20 @@ function profileHasControlledLaunchReceipt(receipts, expected) {
673
691
  return ["failure", "failed", "miss", "lost", "loss"].includes(shotKind) || ["failure", "failed", "miss", "lost", "loss"].includes(shotStatus) || ["failure", "failed", "miss", "lost", "loss"].includes(outcome);
674
692
  });
675
693
  }
694
+ function profileHasRouteContinuationReceipt(receipts) {
695
+ return receipts.some((receipt) => {
696
+ const fromRoute = cliString(setupReturnSummaryValue(receipt, ["fromRoute", "from", "previousRoute", "sourceRoute"]));
697
+ const target = cliString(setupReturnSummaryValue(receipt, ["target", "nextHref", "toRoute", "nextRoute", "href"]));
698
+ const afterRoute = cliString(setupReturnSummaryValue(receipt, ["routeAfterPush", "afterRoute", "route", "observedRoute"]));
699
+ if (!fromRoute || !target && !afterRoute) return false;
700
+ const storedTo = cliString(receipt.return_stored_to) || "";
701
+ const label = cliString(receipt.label) || "";
702
+ const path2 = cliString(receipt.path) || cliString(receipt.function_name) || "";
703
+ const summary = cliReturnSummaryLabel(receipt.return_summary) || "";
704
+ const haystack = `${storedTo} ${label} ${path2} ${summary}`.toLowerCase();
705
+ return haystack.includes("navigation") || haystack.includes("continuation") || haystack.includes("route") || haystack.includes("next") || haystack.includes("target");
706
+ });
707
+ }
676
708
  function profileHasRecoveredStateReceipt(receipts) {
677
709
  return receipts.some((receipt) => {
678
710
  const storedTo = cliString(receipt.return_stored_to) || "";
@@ -744,8 +776,10 @@ function profilePackReceiptStatus(result, metadata, receipt) {
744
776
  const hasOfflineAudioMetricsReceipt = profileHasOfflineAudioMetricsReceipt(valueReceipts);
745
777
  const hasActiveRouteLocalProofReceipt = profileHasActiveRouteLocalProofReceipt(valueReceipts);
746
778
  const hasTerminalLossReceipt = profileHasTerminalLossReceipt(valueReceipts);
779
+ const hasTerminalSuccessReceipt = profileHasTerminalSuccessReceipt(valueReceipts);
747
780
  const hasControlledFailureLaunchReceipt = profileHasControlledLaunchReceipt(valueReceipts, "failure");
748
781
  const hasControlledSuccessLaunchReceipt = profileHasControlledLaunchReceipt(valueReceipts, "success");
782
+ const hasRouteContinuationReceipt = profileHasRouteContinuationReceipt(valueReceipts);
749
783
  const hasRecoveredStateReceipt = profileHasRecoveredStateReceipt(valueReceipts);
750
784
  const failedCleanupInventoryReason = profileFailedCleanupInventoryReason(setupViewports);
751
785
  if (text.includes("artifact link") || text.includes("artifact path")) {
@@ -799,6 +833,13 @@ function profilePackReceiptStatus(result, metadata, receipt) {
799
833
  "terminal loss receipt missing"
800
834
  );
801
835
  }
836
+ if (text.includes("success") && text.includes("terminal")) {
837
+ return profileReceiptSignalStatus(
838
+ hasTerminalSuccessReceipt,
839
+ "terminal success receipt present",
840
+ "terminal success receipt missing"
841
+ );
842
+ }
802
843
  if (text.includes("controlled") && text.includes("launch") && (text.includes("failure") || text.includes("failed") || text.includes("miss"))) {
803
844
  return profileReceiptSignalStatus(
804
845
  hasControlledFailureLaunchReceipt,
@@ -820,6 +861,13 @@ function profilePackReceiptStatus(result, metadata, receipt) {
820
861
  "visible recovery-action receipt missing"
821
862
  );
822
863
  }
864
+ if (text.includes("route continuation") || text.includes("route-transition") || text.includes("route transition")) {
865
+ return profileReceiptSignalStatus(
866
+ hasRouteContinuationReceipt,
867
+ "route continuation receipt present",
868
+ "route continuation receipt missing"
869
+ );
870
+ }
823
871
  if (text.includes("through visible ui") || text.includes("visible ui action") || text.includes("ui-routed") || text.includes("ui routed") || text.includes("visible") && text.includes("route") && text.includes("exit") && text.includes("action") || text.includes("visible") && text.includes("mode") && text.includes("exit") && text.includes("action")) {
824
872
  return profileReceiptSignalStatus(
825
873
  visibleUiActionCount > 0,
package/dist/index.cjs CHANGED
@@ -14487,7 +14487,118 @@ function setupJsonValue(value) {
14487
14487
  function setupValuesEqual(left, right) {
14488
14488
  return JSON.stringify(setupJsonValue(left)) === JSON.stringify(setupJsonValue(right));
14489
14489
  }
14490
+ async function ensureProfilePageHelpers(context) {
14491
+ try {
14492
+ await context.evaluate(({ targetUrl }) => {
14493
+ const asPathname = (path) => {
14494
+ const value = String(path || "/");
14495
+ return value.startsWith("/") ? value : "/" + value;
14496
+ };
14497
+ const normalizePathname = (path) => {
14498
+ const value = asPathname(path);
14499
+ return value === "/" ? "/" : value.replace(/\/+$/, "") || "/";
14500
+ };
14501
+ const previewMountPrefix = (pathname) => {
14502
+ const value = normalizePathname(pathname);
14503
+ const apiPreview = value.match(/^(\/s\/[^/]+)(?:\/|$)/);
14504
+ if (apiPreview) return apiPreview[1];
14505
+ const internalPreview = value.match(/^(\/preview\/[^/]+\/[^/]+)(?:\/|$)/);
14506
+ return internalPreview ? internalPreview[1] : "";
14507
+ };
14508
+ const targetMountPrefix = () => {
14509
+ try {
14510
+ return previewMountPrefix(new URL(String(targetUrl || ""), window.location.href).pathname);
14511
+ } catch {
14512
+ return "";
14513
+ }
14514
+ };
14515
+ const currentRoute = () => {
14516
+ const pathname = asPathname(window.location.pathname);
14517
+ const normalizedPathname = normalizePathname(pathname);
14518
+ const currentBasePath = previewMountPrefix(normalizedPathname);
14519
+ const basePath = currentBasePath || targetMountPrefix();
14520
+ const suffix = String(window.location.search || "") + String(window.location.hash || "");
14521
+ const appPath = currentBasePath && (normalizedPathname === currentBasePath || normalizedPathname.startsWith(currentBasePath + "/"))
14522
+ ? normalizePathname(normalizedPathname.slice(currentBasePath.length) || "/")
14523
+ : normalizedPathname;
14524
+ return {
14525
+ url: window.location.href,
14526
+ origin: window.location.origin,
14527
+ pathname,
14528
+ search: window.location.search,
14529
+ hash: window.location.hash,
14530
+ basePath,
14531
+ previewMountPrefix: basePath,
14532
+ currentBasePath,
14533
+ appPath,
14534
+ appRoute: appPath + suffix,
14535
+ mountedPath: normalizedPathname,
14536
+ mountedRoute: normalizedPathname + suffix,
14537
+ isPreviewMounted: Boolean(currentBasePath),
14538
+ };
14539
+ };
14540
+ const parseRoute = (route) => {
14541
+ const raw = String(route || "/").trim() || "/";
14542
+ if (/^https?:\/\//i.test(raw)) {
14543
+ try {
14544
+ const url = new URL(raw);
14545
+ if (url.origin !== window.location.origin) return { external: true, value: raw };
14546
+ return { external: false, pathname: normalizePathname(url.pathname), suffix: url.search + url.hash };
14547
+ } catch {
14548
+ return { external: false, pathname: normalizePathname(raw), suffix: "" };
14549
+ }
14550
+ }
14551
+ try {
14552
+ const url = new URL(raw, window.location.origin);
14553
+ return { external: false, pathname: normalizePathname(url.pathname), suffix: url.search + url.hash };
14554
+ } catch {
14555
+ const hashIndex = raw.indexOf("#");
14556
+ const beforeHash = hashIndex >= 0 ? raw.slice(0, hashIndex) : raw;
14557
+ const hash = hashIndex >= 0 ? raw.slice(hashIndex) : "";
14558
+ const searchIndex = beforeHash.indexOf("?");
14559
+ const pathname = searchIndex >= 0 ? beforeHash.slice(0, searchIndex) : beforeHash;
14560
+ const search = searchIndex >= 0 ? beforeHash.slice(searchIndex) : "";
14561
+ return { external: false, pathname: normalizePathname(pathname), suffix: search + hash };
14562
+ }
14563
+ };
14564
+ const joinRoute = (route) => {
14565
+ const parsed = parseRoute(route);
14566
+ if (parsed.external) return parsed.value;
14567
+ const current = currentRoute();
14568
+ const basePath = current.basePath || "";
14569
+ const routePath = parsed.pathname || "/";
14570
+ if (!basePath) return routePath + (parsed.suffix || "");
14571
+ if (routePath === basePath || routePath.startsWith(basePath + "/")) return routePath + (parsed.suffix || "");
14572
+ return (routePath === "/" ? basePath + "/" : basePath + routePath) + (parsed.suffix || "");
14573
+ };
14574
+ const existing = window.__riddleProofProfile && typeof window.__riddleProofProfile === "object"
14575
+ ? window.__riddleProofProfile
14576
+ : {};
14577
+ const refreshSnapshot = () => {
14578
+ const route = currentRoute();
14579
+ existing.current = route;
14580
+ existing.appPath = route.appPath;
14581
+ existing.appRoute = route.appRoute;
14582
+ existing.basePath = route.basePath;
14583
+ existing.previewMountPrefix = route.previewMountPrefix;
14584
+ existing.mountedPath = route.mountedPath;
14585
+ existing.mountedRoute = route.mountedRoute;
14586
+ return route;
14587
+ };
14588
+ existing.version = "riddle-proof.profile-helper.v1";
14589
+ existing.route = currentRoute;
14590
+ existing.getRoute = currentRoute;
14591
+ existing.refresh = refreshSnapshot;
14592
+ existing.joinRoute = joinRoute;
14593
+ refreshSnapshot();
14594
+ window.__riddleProofProfile = existing;
14595
+ }, { targetUrl });
14596
+ } catch {
14597
+ // Profile helper injection is best-effort so existing window actions keep their old behavior.
14598
+ }
14599
+ }
14490
14600
  async function setupReadWindowValue(context, path) {
14601
+ await ensureProfilePageHelpers(context);
14491
14602
  return await context.evaluate(({ path }) => {
14492
14603
  const toJsonValue = (value) => {
14493
14604
  if (value === null || value === undefined) return null;
@@ -14511,6 +14622,7 @@ async function setupReadWindowValue(context, path) {
14511
14622
  }, { path });
14512
14623
  }
14513
14624
  async function setupCallWindowFunction(context, path, args, storeReturnTo, captureReturn) {
14625
+ await ensureProfilePageHelpers(context);
14514
14626
  return await context.evaluate(async ({ path, args, storeReturnTo, captureReturn }) => {
14515
14627
  const toJsonValue = (value) => {
14516
14628
  if (value === null || value === undefined) return null;
@@ -14559,6 +14671,7 @@ async function setupCallWindowFunction(context, path, args, storeReturnTo, captu
14559
14671
  }, { path, args, storeReturnTo, captureReturn });
14560
14672
  }
14561
14673
  async function setupEvaluateWindowScript(context, script, args, storeReturnTo, captureReturn) {
14674
+ await ensureProfilePageHelpers(context);
14562
14675
  return await context.evaluate(async ({ script, args, storeReturnTo, captureReturn }) => {
14563
14676
  const toJsonValue = (value) => {
14564
14677
  if (value === null || value === undefined) return null;
package/dist/index.js CHANGED
@@ -62,7 +62,7 @@ import {
62
62
  resolveRiddleProofProfileTimeoutSec,
63
63
  slugifyRiddleProofProfileName,
64
64
  summarizeRiddleProofProfileResult
65
- } from "./chunk-Z42O55GB.js";
65
+ } from "./chunk-UKMTTGQ4.js";
66
66
  import {
67
67
  DEFAULT_RIDDLE_API_BASE_URL,
68
68
  DEFAULT_RIDDLE_API_KEY_FILE,
package/dist/profile.cjs CHANGED
@@ -5801,7 +5801,118 @@ function setupJsonValue(value) {
5801
5801
  function setupValuesEqual(left, right) {
5802
5802
  return JSON.stringify(setupJsonValue(left)) === JSON.stringify(setupJsonValue(right));
5803
5803
  }
5804
+ async function ensureProfilePageHelpers(context) {
5805
+ try {
5806
+ await context.evaluate(({ targetUrl }) => {
5807
+ const asPathname = (path) => {
5808
+ const value = String(path || "/");
5809
+ return value.startsWith("/") ? value : "/" + value;
5810
+ };
5811
+ const normalizePathname = (path) => {
5812
+ const value = asPathname(path);
5813
+ return value === "/" ? "/" : value.replace(/\/+$/, "") || "/";
5814
+ };
5815
+ const previewMountPrefix = (pathname) => {
5816
+ const value = normalizePathname(pathname);
5817
+ const apiPreview = value.match(/^(\/s\/[^/]+)(?:\/|$)/);
5818
+ if (apiPreview) return apiPreview[1];
5819
+ const internalPreview = value.match(/^(\/preview\/[^/]+\/[^/]+)(?:\/|$)/);
5820
+ return internalPreview ? internalPreview[1] : "";
5821
+ };
5822
+ const targetMountPrefix = () => {
5823
+ try {
5824
+ return previewMountPrefix(new URL(String(targetUrl || ""), window.location.href).pathname);
5825
+ } catch {
5826
+ return "";
5827
+ }
5828
+ };
5829
+ const currentRoute = () => {
5830
+ const pathname = asPathname(window.location.pathname);
5831
+ const normalizedPathname = normalizePathname(pathname);
5832
+ const currentBasePath = previewMountPrefix(normalizedPathname);
5833
+ const basePath = currentBasePath || targetMountPrefix();
5834
+ const suffix = String(window.location.search || "") + String(window.location.hash || "");
5835
+ const appPath = currentBasePath && (normalizedPathname === currentBasePath || normalizedPathname.startsWith(currentBasePath + "/"))
5836
+ ? normalizePathname(normalizedPathname.slice(currentBasePath.length) || "/")
5837
+ : normalizedPathname;
5838
+ return {
5839
+ url: window.location.href,
5840
+ origin: window.location.origin,
5841
+ pathname,
5842
+ search: window.location.search,
5843
+ hash: window.location.hash,
5844
+ basePath,
5845
+ previewMountPrefix: basePath,
5846
+ currentBasePath,
5847
+ appPath,
5848
+ appRoute: appPath + suffix,
5849
+ mountedPath: normalizedPathname,
5850
+ mountedRoute: normalizedPathname + suffix,
5851
+ isPreviewMounted: Boolean(currentBasePath),
5852
+ };
5853
+ };
5854
+ const parseRoute = (route) => {
5855
+ const raw = String(route || "/").trim() || "/";
5856
+ if (/^https?:\/\//i.test(raw)) {
5857
+ try {
5858
+ const url = new URL(raw);
5859
+ if (url.origin !== window.location.origin) return { external: true, value: raw };
5860
+ return { external: false, pathname: normalizePathname(url.pathname), suffix: url.search + url.hash };
5861
+ } catch {
5862
+ return { external: false, pathname: normalizePathname(raw), suffix: "" };
5863
+ }
5864
+ }
5865
+ try {
5866
+ const url = new URL(raw, window.location.origin);
5867
+ return { external: false, pathname: normalizePathname(url.pathname), suffix: url.search + url.hash };
5868
+ } catch {
5869
+ const hashIndex = raw.indexOf("#");
5870
+ const beforeHash = hashIndex >= 0 ? raw.slice(0, hashIndex) : raw;
5871
+ const hash = hashIndex >= 0 ? raw.slice(hashIndex) : "";
5872
+ const searchIndex = beforeHash.indexOf("?");
5873
+ const pathname = searchIndex >= 0 ? beforeHash.slice(0, searchIndex) : beforeHash;
5874
+ const search = searchIndex >= 0 ? beforeHash.slice(searchIndex) : "";
5875
+ return { external: false, pathname: normalizePathname(pathname), suffix: search + hash };
5876
+ }
5877
+ };
5878
+ const joinRoute = (route) => {
5879
+ const parsed = parseRoute(route);
5880
+ if (parsed.external) return parsed.value;
5881
+ const current = currentRoute();
5882
+ const basePath = current.basePath || "";
5883
+ const routePath = parsed.pathname || "/";
5884
+ if (!basePath) return routePath + (parsed.suffix || "");
5885
+ if (routePath === basePath || routePath.startsWith(basePath + "/")) return routePath + (parsed.suffix || "");
5886
+ return (routePath === "/" ? basePath + "/" : basePath + routePath) + (parsed.suffix || "");
5887
+ };
5888
+ const existing = window.__riddleProofProfile && typeof window.__riddleProofProfile === "object"
5889
+ ? window.__riddleProofProfile
5890
+ : {};
5891
+ const refreshSnapshot = () => {
5892
+ const route = currentRoute();
5893
+ existing.current = route;
5894
+ existing.appPath = route.appPath;
5895
+ existing.appRoute = route.appRoute;
5896
+ existing.basePath = route.basePath;
5897
+ existing.previewMountPrefix = route.previewMountPrefix;
5898
+ existing.mountedPath = route.mountedPath;
5899
+ existing.mountedRoute = route.mountedRoute;
5900
+ return route;
5901
+ };
5902
+ existing.version = "riddle-proof.profile-helper.v1";
5903
+ existing.route = currentRoute;
5904
+ existing.getRoute = currentRoute;
5905
+ existing.refresh = refreshSnapshot;
5906
+ existing.joinRoute = joinRoute;
5907
+ refreshSnapshot();
5908
+ window.__riddleProofProfile = existing;
5909
+ }, { targetUrl });
5910
+ } catch {
5911
+ // Profile helper injection is best-effort so existing window actions keep their old behavior.
5912
+ }
5913
+ }
5804
5914
  async function setupReadWindowValue(context, path) {
5915
+ await ensureProfilePageHelpers(context);
5805
5916
  return await context.evaluate(({ path }) => {
5806
5917
  const toJsonValue = (value) => {
5807
5918
  if (value === null || value === undefined) return null;
@@ -5825,6 +5936,7 @@ async function setupReadWindowValue(context, path) {
5825
5936
  }, { path });
5826
5937
  }
5827
5938
  async function setupCallWindowFunction(context, path, args, storeReturnTo, captureReturn) {
5939
+ await ensureProfilePageHelpers(context);
5828
5940
  return await context.evaluate(async ({ path, args, storeReturnTo, captureReturn }) => {
5829
5941
  const toJsonValue = (value) => {
5830
5942
  if (value === null || value === undefined) return null;
@@ -5873,6 +5985,7 @@ async function setupCallWindowFunction(context, path, args, storeReturnTo, captu
5873
5985
  }, { path, args, storeReturnTo, captureReturn });
5874
5986
  }
5875
5987
  async function setupEvaluateWindowScript(context, script, args, storeReturnTo, captureReturn) {
5988
+ await ensureProfilePageHelpers(context);
5876
5989
  return await context.evaluate(async ({ script, args, storeReturnTo, captureReturn }) => {
5877
5990
  const toJsonValue = (value) => {
5878
5991
  if (value === null || value === undefined) return null;
package/dist/profile.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  resolveRiddleProofProfileTimeoutSec,
24
24
  slugifyRiddleProofProfileName,
25
25
  summarizeRiddleProofProfileResult
26
- } from "./chunk-Z42O55GB.js";
26
+ } from "./chunk-UKMTTGQ4.js";
27
27
  export {
28
28
  RIDDLE_PROOF_PROFILE_CHECK_TYPES,
29
29
  RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
292
292
  blocking?: boolean;
293
293
  details?: Record<string, unknown>;
294
294
  ok: boolean;
295
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
295
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
296
296
  state_path: string;
297
297
  stage: any;
298
298
  summary: string;
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
382
382
  continueWithStage?: WorkflowStage | null;
383
383
  blocking?: boolean;
384
384
  details?: Record<string, unknown>;
385
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
385
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
386
386
  state_path: string;
387
387
  stage: any;
388
388
  checkpoint: string;
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
659
659
  error?: undefined;
660
660
  } | {
661
661
  ok: boolean;
662
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
662
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
292
292
  blocking?: boolean;
293
293
  details?: Record<string, unknown>;
294
294
  ok: boolean;
295
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
295
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
296
296
  state_path: string;
297
297
  stage: any;
298
298
  summary: string;
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
382
382
  continueWithStage?: WorkflowStage | null;
383
383
  blocking?: boolean;
384
384
  details?: Record<string, unknown>;
385
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
385
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
386
386
  state_path: string;
387
387
  stage: any;
388
388
  checkpoint: string;
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
659
659
  error?: undefined;
660
660
  } | {
661
661
  ok: boolean;
662
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
662
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.7.190",
3
+ "version": "0.7.192",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",