@ai-ecoverse/slicc-kernel 1.54.0 → 1.54.2

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/node.js CHANGED
@@ -10461,6 +10461,9 @@ function fingerprint(headers) {
10461
10461
  const fields = MATCHED.map((name2) => header2(headers, name2) ?? "");
10462
10462
  return JSON.stringify([...fields, header2(headers, "authorization") !== void 0]);
10463
10463
  }
10464
+ function unauthorized(print) {
10465
+ return JSON.stringify([...JSON.parse(print).slice(0, -1), false]);
10466
+ }
10464
10467
  function followedWith(status, method) {
10465
10468
  if (status === 303 && method !== "GET" && method !== "HEAD") return "GET";
10466
10469
  if ((status === 301 || status === 302) && method === "POST") return "GET";
@@ -10501,9 +10504,17 @@ function replayingHops(inner, heldMs = HELD_MS) {
10501
10504
  const [hop, ...rest2] = chain.hops;
10502
10505
  const location = hop && header2(hop.headers, "location");
10503
10506
  if (!hop || location === void 0) return chain.final;
10504
- const next2 = new URL(location, hop.url).href;
10507
+ const target = new URL(location, hop.url);
10508
+ target.hash = "";
10505
10509
  const method = followedWith(hop.status, chain.method);
10506
- hold(keyOf2(chain.owner, method, next2), { ...chain, method, hops: rest2 });
10510
+ const away = target.origin !== new URL(hop.url).origin;
10511
+ const print = away ? unauthorized(chain.fingerprint) : chain.fingerprint;
10512
+ hold(keyOf2(chain.owner, method, target.href), {
10513
+ ...chain,
10514
+ method,
10515
+ fingerprint: print,
10516
+ hops: rest2
10517
+ });
10507
10518
  return bodiless(hop);
10508
10519
  };
10509
10520
  return {
@@ -13877,6 +13888,7 @@ function nodeTransport() {
13877
13888
  return { ...transport, traits: { ...transport.traits, crossOrigin: "any" } };
13878
13889
  }
13879
13890
  var TERMINATED = "the kernel is terminated";
13891
+ var EXIT_GRACE_MS = 50;
13880
13892
  function nodeWorker(file, live, closed) {
13881
13893
  const errors = /* @__PURE__ */ new Set();
13882
13894
  const messages = /* @__PURE__ */ new Map();
@@ -13897,7 +13909,9 @@ function nodeWorker(file, live, closed) {
13897
13909
  live.add(kill);
13898
13910
  worker.once("exit", (code) => {
13899
13911
  live.delete(kill);
13900
- if (!ending) fail3(`the process worker exited with ${code}`);
13912
+ setTimeout(() => {
13913
+ if (!ending) fail3(`the process worker exited with ${code}`);
13914
+ }, EXIT_GRACE_MS);
13901
13915
  });
13902
13916
  worker.on("error", (err) => fail3(String(err)));
13903
13917
  } else {