@ai-ecoverse/slicc-kernel 1.138.1 → 1.139.0

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
@@ -7513,7 +7513,7 @@ function satisfies(version, range2) {
7513
7513
  }
7514
7514
 
7515
7515
  // src/version.ts
7516
- var KERNEL_VERSION = true ? "1.138.1" : "0.0.0-dev";
7516
+ var KERNEL_VERSION = true ? "1.139.0" : "0.0.0-dev";
7517
7517
  var OS_RELEASE = "6.0.0-slicc";
7518
7518
  function procVersion() {
7519
7519
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
@@ -2775,7 +2775,7 @@ var KERNEL_VERSION, OS_RELEASE;
2775
2775
  var init_version = __esm({
2776
2776
  "src/version.ts"() {
2777
2777
  "use strict";
2778
- KERNEL_VERSION = true ? "1.138.1" : "0.0.0-dev";
2778
+ KERNEL_VERSION = true ? "1.139.0" : "0.0.0-dev";
2779
2779
  OS_RELEASE = "6.0.0-slicc";
2780
2780
  }
2781
2781
  });
@@ -17829,6 +17829,15 @@ function heldOn(init, lane, syncKernel) {
17829
17829
  const ask = () => syncKernel.json({ op: "cwd-check" });
17830
17830
  return new HeldCwd(init.sab, init.slot, ask, init);
17831
17831
  }
17832
+ function measured(measure) {
17833
+ const got = measure?.() ?? {};
17834
+ const out = {};
17835
+ for (const field2 of MEMORY_FIELDS) {
17836
+ const value2 = got[field2];
17837
+ if (typeof value2 === "number" && Number.isFinite(value2)) out[field2] = value2;
17838
+ }
17839
+ return out;
17840
+ }
17832
17841
  function createContext(o) {
17833
17842
  const { kernel } = o;
17834
17843
  const infos = /* @__PURE__ */ new Map();
@@ -17969,6 +17978,7 @@ function createContext(o) {
17969
17978
  tty: terminal.tty,
17970
17979
  exit,
17971
17980
  thread: o.thread,
17981
+ memory: () => measured(o.memory),
17972
17982
  onUncaught: (listener) => listen(strays.exception, listener),
17973
17983
  onUnhandledRejection: (listener) => listen(strays.rejection, listener)
17974
17984
  };
@@ -18166,7 +18176,7 @@ function pathOps(kernel, resolve, statOf, open, tryDev) {
18166
18176
  }
18167
18177
  };
18168
18178
  }
18169
- var KERNEL_INFO, JsExit, encoder4, cryptoRandom;
18179
+ var KERNEL_INFO, JsExit, encoder4, cryptoRandom, MEMORY_FIELDS;
18170
18180
  var init_js_context = __esm({
18171
18181
  "src/process/js/js-context.ts"() {
18172
18182
  "use strict";
@@ -18201,6 +18211,7 @@ var init_js_context = __esm({
18201
18211
  };
18202
18212
  encoder4 = new TextEncoder();
18203
18213
  cryptoRandom = (bytes) => void crypto.getRandomValues(bytes);
18214
+ MEMORY_FIELDS = ["heapUsed", "heapTotal", "heapLimit", "external", "arrayBuffers"];
18204
18215
  }
18205
18216
  });
18206
18217
 
@@ -18374,6 +18385,7 @@ async function runJs(init, port2, deps, thread) {
18374
18385
  fs: { owners: init.owners === true, links: init.links === true },
18375
18386
  strays,
18376
18387
  thread: threadContext(port2, thread),
18388
+ memory: deps.memory,
18377
18389
  ...thread?.owned ? { owned: thread.owned } : {},
18378
18390
  held: init.held,
18379
18391
  failed: () => failedWith