@ai-ecoverse/slicc-kernel 1.181.0 → 1.182.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.
@@ -4825,10 +4825,10 @@ var CdpFacade = class {
4825
4825
  );
4826
4826
  return;
4827
4827
  }
4828
- await this.write(conn, json(await this.list(runtime)));
4828
+ await this.write(conn, json(await this.list(runtime, conn.peerStamp)));
4829
4829
  }
4830
- async list(runtime) {
4831
- const conn = await this.host(runtime);
4830
+ async list(runtime, stamp) {
4831
+ const conn = await this.host(runtime, stamp);
4832
4832
  try {
4833
4833
  const reply = await new Promise(
4834
4834
  (resolve2, reject) => {
@@ -4863,12 +4863,15 @@ var CdpFacade = class {
4863
4863
  conn.close();
4864
4864
  }
4865
4865
  }
4866
- host(runtime) {
4867
- return this.options.hosts.connect(runtime ? { runtime } : {});
4866
+ host(runtime, stamp) {
4867
+ return this.options.hosts.connect({
4868
+ ...runtime ? { runtime } : {},
4869
+ ...stamp ? { stamp } : {}
4870
+ });
4868
4871
  }
4869
4872
  async upgrade(conn, incoming, req, runtime) {
4870
4873
  const accept2 = await acceptKey(req.headers);
4871
- const host = await this.host(runtime);
4874
+ const host = await this.host(runtime, conn.peerStamp);
4872
4875
  const limits = {
4873
4876
  max: this.options.maxMessage ?? MAX_MESSAGE,
4874
4877
  closeWaitMs: this.options.closeWaitMs ?? CLOSE_WAIT_MS
@@ -4948,6 +4951,7 @@ function enableCdp(net, hosts) {
4948
4951
  let facade;
4949
4952
  net.kernelOnly(CDP_PORT, true);
4950
4953
  net.reserve(CDP_PORT);
4954
+ net.stampPeers(CDP_PORT);
4951
4955
  net.activate({ family: "inet", host: "127.0.0.1", port: CDP_PORT }, () => {
4952
4956
  const started = new CdpFacade({ net, hosts });
4953
4957
  facade = started;
@@ -4990,7 +4994,7 @@ var CdpHosts = class {
4990
4994
  if (!entry) throw new HttpError(503, NO_CDP_HOST);
4991
4995
  let conn;
4992
4996
  try {
4993
- conn = await entry.hook(request3.runtime ? { runtime: request3.runtime } : {});
4997
+ conn = await entry.hook(hookRequest(request3));
4994
4998
  } catch (e) {
4995
4999
  throw new HttpError(502, `CDP host: ${e instanceof Error ? e.message : String(e)}`);
4996
5000
  }
@@ -5010,6 +5014,12 @@ var CdpHosts = class {
5010
5014
  for (const entry of [this.embedder, ...this.clients]) if (entry) closeAll(entry);
5011
5015
  }
5012
5016
  };
5017
+ function hookRequest({ runtime, stamp }) {
5018
+ return {
5019
+ ...runtime ? { runtime } : {},
5020
+ ...stamp ? { stamp: structuredClone(stamp) } : {}
5021
+ };
5022
+ }
5013
5023
  function closeAll(entry) {
5014
5024
  for (const conn of [...entry.open]) {
5015
5025
  conn.close();
@@ -7158,6 +7168,7 @@ var LoopbackNet = class {
7158
7168
  reserved = /* @__PURE__ */ new Set();
7159
7169
  facades = /* @__PURE__ */ new Map();
7160
7170
  proxyStamped;
7171
+ stamped = /* @__PURE__ */ new Set();
7161
7172
  nextEphemeral = EPHEMERAL_FIRST;
7162
7173
  route;
7163
7174
  origins;
@@ -7232,6 +7243,9 @@ var LoopbackNet = class {
7232
7243
  this.kernelOnly(port, true);
7233
7244
  this.facades.set(port, name2);
7234
7245
  }
7246
+ stampPeers(port) {
7247
+ this.stamped.add(port);
7248
+ }
7235
7249
  stampProxy(port) {
7236
7250
  this.proxyStamped = port;
7237
7251
  }
@@ -7240,7 +7254,7 @@ var LoopbackNet = class {
7240
7254
  }
7241
7255
  stampsPeers(addr) {
7242
7256
  if (addr.family !== "inet" || !isLoopback(canonicalHost(addr.host))) return false;
7243
- return this.facades.has(addr.port) || this.proxyStamped === addr.port;
7257
+ return this.facades.has(addr.port) || this.stamped.has(addr.port) || this.proxyStamped === addr.port;
7244
7258
  }
7245
7259
  activate(addr, start2) {
7246
7260
  this.activators.set(keyOf(addr), start2);
@@ -8206,7 +8220,7 @@ var UserDb = class {
8206
8220
  };
8207
8221
 
8208
8222
  // src/client/protocol.ts
8209
- var PROTOCOL = [1, 16];
8223
+ var PROTOCOL = [1, 17];
8210
8224
  var FS_METHODS = [
8211
8225
  "readFile",
8212
8226
  "writeFile",
@@ -8908,7 +8922,7 @@ function satisfies(version, range2) {
8908
8922
  }
8909
8923
 
8910
8924
  // src/version.ts
8911
- var KERNEL_VERSION = true ? "1.181.0" : "0.0.0-dev";
8925
+ var KERNEL_VERSION = true ? "1.182.0" : "0.0.0-dev";
8912
8926
  var OS_RELEASE = "6.0.0-slicc";
8913
8927
  function procVersion() {
8914
8928
  return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC