@abelxiaoxing/cadence 2.1.2 → 2.1.4

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.
@@ -205,6 +205,7 @@ var LIMITS = Object.freeze({
205
205
  predecessorBytes: 16 * 1024,
206
206
  handoffBytes: 32 * 1024,
207
207
  frameBytes: 64 * 1024,
208
+ coordinatorBytes: 384 * 1024,
208
209
  chunkBytes: 8 * 1024,
209
210
  detailBytes: 32 * 1024 * 1024,
210
211
  dataFrames: 1e5,
@@ -885,14 +886,22 @@ function sourceId(v) {
885
886
  invalid();
886
887
  return s;
887
888
  }
889
+ var MODEL_FAILURE_BYTES = 256;
888
890
  function decodeModelRetry(v) {
889
- const o = closed(v, ["phase", "attempt", "maxAttempts", "delayMs"]);
891
+ const o = closed(v, [
892
+ "phase",
893
+ "attempt",
894
+ "maxAttempts",
895
+ "delayMs",
896
+ ...Object.hasOwn(v ?? {}, "reason") ? ["reason"] : []
897
+ ]);
890
898
  const maxAttempts = integer(o.maxAttempts, 1);
891
899
  const progress = {
892
900
  phase: oneOf(o.phase, ["waiting", "requesting"]),
893
901
  attempt: integer(o.attempt, 1, maxAttempts),
894
902
  maxAttempts,
895
- delayMs: integer(o.delayMs, 0, 2147483647)
903
+ delayMs: integer(o.delayMs, 0, 2147483647),
904
+ ...o.reason === undefined ? {} : { reason: text(o.reason, MODEL_FAILURE_BYTES, true) }
896
905
  };
897
906
  if (progress.phase === "requesting" && progress.delayMs !== 0)
898
907
  throw new ContractError("invalid");