@koda-sl/baker-cli 0.196.0-dev.6d2f498f5 → 0.197.0-dev.6d2f498f5

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.js CHANGED
@@ -34980,10 +34980,28 @@ var BlockedPageError = class extends Error {
34980
34980
  };
34981
34981
  var CaptureFailureError = class extends Error {
34982
34982
  failure;
34983
- constructor(failure) {
34983
+ /**
34984
+ * Which rungs were tried, and what each of them said.
34985
+ *
34986
+ * Carried out of the engine because nothing downstream could otherwise tell a
34987
+ * page refused from three different addresses apart from one refused once —
34988
+ * and those two call for opposite conclusions about whether to try again.
34989
+ *
34990
+ * It is also the only way to see the rollout fail silently. The E2B image
34991
+ * installs the CLI at build time, so until the template is rebuilt a Runtime
34992
+ * runs an older binary that ignores the credentials Convex hands it. That
34993
+ * capture returns an envelope with **no rungs at all** — indistinguishable,
34994
+ * from the outside, from a page that simply was not worth escalating.
34995
+ *
34996
+ * Deliberately thin: tier names and status codes only, so nothing here can
34997
+ * carry a credential or the raw browser text that once reached a user.
34998
+ */
34999
+ rungs;
35000
+ constructor(failure, rungs = []) {
34984
35001
  super(failure.message);
34985
35002
  this.name = "CaptureFailureError";
34986
35003
  this.failure = failure;
35004
+ this.rungs = rungs;
34987
35005
  }
34988
35006
  };
34989
35007
  var LOCAL_ADDRESS_REFUSAL = "That address only opens from inside your own network, so there is nothing there for us to read. A reference page has to be live on the web.";
@@ -36736,6 +36754,13 @@ async function captureSections(args) {
36736
36754
  }
36737
36755
  return sections;
36738
36756
  }
36757
+ function rungReport(outcome) {
36758
+ return {
36759
+ tier: outcome.route.kind === "proxy" ? outcome.route.tier : "direct",
36760
+ code: outcome.failure.code,
36761
+ status: outcome.status
36762
+ };
36763
+ }
36739
36764
  async function openViaLadder(args) {
36740
36765
  const { url, routes, timeoutMs, deadline, log } = args;
36741
36766
  const attempts = [];
@@ -36759,7 +36784,7 @@ async function openViaLadder(args) {
36759
36784
  }
36760
36785
  route = decision.next;
36761
36786
  }
36762
- throw new CaptureFailureError(reportableFailure(attempts));
36787
+ throw new CaptureFailureError(reportableFailure(attempts), attempts.map(rungReport));
36763
36788
  }
36764
36789
  async function scrapeLanding(options) {
36765
36790
  const timeoutMs = options.timeoutMs ?? 45e3;
@@ -36988,6 +37013,13 @@ var scrapeCommand = defineCommand148({
36988
37013
  error: {
36989
37014
  code: failure.code,
36990
37015
  message: failure.message,
37016
+ // Which addresses were tried and what each was told. One rung means
37017
+ // the failure was final wherever we stood; three mean the page turned
37018
+ // us away from three different places, which is a fact about the page.
37019
+ // **Absent** means this Runtime is running a CLI that predates the
37020
+ // ladder — the one way the rollout fails without anything looking
37021
+ // wrong.
37022
+ ...error instanceof CaptureFailureError && error.rungs.length > 0 ? { rungs: error.rungs } : {},
36991
37023
  // Degrade, don't abort: one unreadable reference is never a reason to
36992
37024
  // abandon the job it was research for. `retryable` is the decision
36993
37025
  // the agent would otherwise have to guess at.