@adhdev/daemon-standalone 1.0.53 → 1.0.54-rc.1

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/index.js CHANGED
@@ -31423,9 +31423,9 @@ var require_streamx = __commonJS({
31423
31423
  }
31424
31424
  });
31425
31425
 
31426
- // ../daemon-core/node_modules/b4a/index.js
31426
+ // ../../node_modules/tar-stream/node_modules/b4a/index.js
31427
31427
  var require_b4a2 = __commonJS({
31428
- "../daemon-core/node_modules/b4a/index.js"(exports2, module2) {
31428
+ "../../node_modules/tar-stream/node_modules/b4a/index.js"(exports2, module2) {
31429
31429
  "use strict";
31430
31430
  function isBuffer(value) {
31431
31431
  return Buffer.isBuffer(value) || value instanceof Uint8Array;
@@ -31581,9 +31581,9 @@ var require_b4a2 = __commonJS({
31581
31581
  }
31582
31582
  });
31583
31583
 
31584
- // ../daemon-core/node_modules/tar-stream/headers.js
31584
+ // ../../node_modules/tar-stream/headers.js
31585
31585
  var require_headers = __commonJS({
31586
- "../daemon-core/node_modules/tar-stream/headers.js"(exports2) {
31586
+ "../../node_modules/tar-stream/headers.js"(exports2) {
31587
31587
  "use strict";
31588
31588
  var b4a = require_b4a2();
31589
31589
  var ZEROS = "0000000000000000000";
@@ -31844,9 +31844,9 @@ var require_headers = __commonJS({
31844
31844
  }
31845
31845
  });
31846
31846
 
31847
- // ../daemon-core/node_modules/tar-stream/extract.js
31847
+ // ../../node_modules/tar-stream/extract.js
31848
31848
  var require_extract = __commonJS({
31849
- "../daemon-core/node_modules/tar-stream/extract.js"(exports2, module2) {
31849
+ "../../node_modules/tar-stream/extract.js"(exports2, module2) {
31850
31850
  "use strict";
31851
31851
  var { Writable, Readable, getStreamError } = require_streamx();
31852
31852
  var FIFO = require_fast_fifo();
@@ -32189,9 +32189,9 @@ var require_extract = __commonJS({
32189
32189
  }
32190
32190
  });
32191
32191
 
32192
- // ../daemon-core/node_modules/tar-stream/constants.js
32192
+ // ../../node_modules/tar-stream/constants.js
32193
32193
  var require_constants = __commonJS({
32194
- "../daemon-core/node_modules/tar-stream/constants.js"(exports2, module2) {
32194
+ "../../node_modules/tar-stream/constants.js"(exports2, module2) {
32195
32195
  "use strict";
32196
32196
  var constants = {
32197
32197
  // just for envs without fs
@@ -32210,9 +32210,9 @@ var require_constants = __commonJS({
32210
32210
  }
32211
32211
  });
32212
32212
 
32213
- // ../daemon-core/node_modules/tar-stream/pack.js
32213
+ // ../../node_modules/tar-stream/pack.js
32214
32214
  var require_pack = __commonJS({
32215
- "../daemon-core/node_modules/tar-stream/pack.js"(exports2, module2) {
32215
+ "../../node_modules/tar-stream/pack.js"(exports2, module2) {
32216
32216
  "use strict";
32217
32217
  var { Readable, Writable, getStreamError } = require_streamx();
32218
32218
  var b4a = require_b4a2();
@@ -32445,9 +32445,9 @@ var require_pack = __commonJS({
32445
32445
  }
32446
32446
  });
32447
32447
 
32448
- // ../daemon-core/node_modules/tar-stream/index.js
32448
+ // ../../node_modules/tar-stream/index.js
32449
32449
  var require_tar_stream = __commonJS({
32450
- "../daemon-core/node_modules/tar-stream/index.js"(exports2) {
32450
+ "../../node_modules/tar-stream/index.js"(exports2) {
32451
32451
  "use strict";
32452
32452
  exports2.extract = require_extract();
32453
32453
  exports2.pack = require_pack();
@@ -32690,9 +32690,9 @@ var require_pump = __commonJS({
32690
32690
  }
32691
32691
  });
32692
32692
 
32693
- // ../daemon-core/node_modules/tar-fs/index.js
32693
+ // ../../node_modules/tar-fs/index.js
32694
32694
  var require_tar_fs = __commonJS({
32695
- "../daemon-core/node_modules/tar-fs/index.js"(exports2) {
32695
+ "../../node_modules/tar-fs/index.js"(exports2) {
32696
32696
  "use strict";
32697
32697
  var tar = require_tar_stream();
32698
32698
  var pump = require_pump();
@@ -37075,10 +37075,10 @@ var require_dist3 = __commonJS({
37075
37075
  }
37076
37076
  function getDaemonBuildInfo() {
37077
37077
  if (cached2) return cached2;
37078
- const commit = readInjected(true ? "6f71d20f96226b37956caec6b2cd7952dbbe01d9" : void 0) ?? "unknown";
37079
- const commitShort = readInjected(true ? "6f71d20" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
37080
- const version2 = readInjected(true ? "1.0.53" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
37081
- const builtAt = readInjected(true ? "2026-08-17T01:10:49.969Z" : void 0);
37078
+ const commit = readInjected(true ? "9541f272ba22f13d2bfa11c2a903f498a8c196fe" : void 0) ?? "unknown";
37079
+ const commitShort = readInjected(true ? "9541f272" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
37080
+ const version2 = readInjected(true ? "1.0.54-rc.1" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
37081
+ const builtAt = readInjected(true ? "2026-08-17T03:09:14.176Z" : void 0);
37082
37082
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
37083
37083
  return cached2;
37084
37084
  }
@@ -38326,7 +38326,7 @@ var require_dist3 = __commonJS({
38326
38326
  }
38327
38327
  });
38328
38328
  function resolveBuildTrack(env2 = process.env) {
38329
- const injected = true ? "" : void 0;
38329
+ const injected = true ? "preview" : void 0;
38330
38330
  const stamped = typeof injected === "string" ? injected.trim() : "";
38331
38331
  const raw = (stamped || (env2[BUILD_CHANNEL_ENV_VAR] ?? "").trim()).toLowerCase();
38332
38332
  return raw === "preview" || raw === "next" ? "preview" : "stable";
@@ -121100,6 +121100,27 @@ ${ptyResult.output.slice(-2e3)}`);
121100
121100
  init_logger();
121101
121101
  init_runtime_defaults();
121102
121102
  init_snapshot2();
121103
+ function buildCloudP2PSummary(p2p) {
121104
+ if (!p2p) return void 0;
121105
+ const counter = (value) => typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : void 0;
121106
+ const summary = {
121107
+ available: p2p.available,
121108
+ state: p2p.state,
121109
+ peers: p2p.peers
121110
+ };
121111
+ if (p2p.screenshotActive !== void 0) summary.screenshotActive = p2p.screenshotActive;
121112
+ const direct = counter(p2p.direct);
121113
+ const relay = counter(p2p.relay);
121114
+ const unknownTransport = counter(p2p.unknownTransport);
121115
+ const directTotal = counter(p2p.directTotal);
121116
+ const relayTotal = counter(p2p.relayTotal);
121117
+ if (direct !== void 0) summary.direct = direct;
121118
+ if (relay !== void 0) summary.relay = relay;
121119
+ if (unknownTransport !== void 0) summary.unknownTransport = unknownTransport;
121120
+ if (directTotal !== void 0) summary.directTotal = directTotal;
121121
+ if (relayTotal !== void 0) summary.relayTotal = relayTotal;
121122
+ return summary;
121123
+ }
121103
121124
  function buildCloudStatusReportPayload(sessions, p2p, timestamp2) {
121104
121125
  const list = Array.isArray(sessions) ? sessions : [];
121105
121126
  return {
@@ -121122,10 +121143,11 @@ ${ptyResult.output.slice(-2e3)}`);
121122
121143
  muted: session.muted
121123
121144
  };
121124
121145
  }),
121125
- p2p,
121146
+ p2p: buildCloudP2PSummary(p2p),
121126
121147
  timestamp: timestamp2
121127
121148
  };
121128
121149
  }
121150
+ var SERVER_DEDUP_KEEPALIVE_REPORTS = 10;
121129
121151
  var DaemonStatusReporter = class {
121130
121152
  deps;
121131
121153
  log;
@@ -121136,6 +121158,11 @@ ${ptyResult.output.slice(-2e3)}`);
121136
121158
  p2pDebounceTimer = null;
121137
121159
  lastServerStatusHash = "";
121138
121160
  lastStatusSummary = "";
121161
+ /**
121162
+ * Consecutive periodic reports suppressed by the server-side dedup hash.
121163
+ * Reset on every actual send; see SERVER_DEDUP_KEEPALIVE_REPORTS.
121164
+ */
121165
+ serverDedupSkipCount = 0;
121139
121166
  statusTimer = null;
121140
121167
  p2pTimer = null;
121141
121168
  constructor(deps, opts) {
@@ -121149,7 +121176,7 @@ ${ptyResult.output.slice(-2e3)}`);
121149
121176
  }, DEFAULT_STATUS_INITIAL_REPORT_DELAY_MS);
121150
121177
  const scheduleServerReport = () => {
121151
121178
  this.statusTimer = setTimeout(() => {
121152
- this.sendUnifiedStatusReport({ forceServer: true, reason: "periodic" }).catch((e) => LOG2.warn("Status", `Periodic report failed: ${e?.message}`));
121179
+ this.sendUnifiedStatusReport({ reason: "periodic" }).catch((e) => LOG2.warn("Status", `Periodic report failed: ${e?.message}`));
121153
121180
  scheduleServerReport();
121154
121181
  }, DEFAULT_STATUS_SERVER_REPORT_INTERVAL_MS);
121155
121182
  };
@@ -121320,7 +121347,11 @@ ${ptyResult.output.slice(-2e3)}`);
121320
121347
  available: p2p?.isAvailable || false,
121321
121348
  state: p2p?.connectionState || "unavailable",
121322
121349
  peers: p2p?.connectedPeerCount || 0,
121323
- screenshotActive: p2p?.screenshotActive || false
121350
+ screenshotActive: p2p?.screenshotActive || false,
121351
+ // Direct vs TURN-relay tallies. Spread so that a P2P impl without
121352
+ // candidate-pair observability contributes no keys at all rather
121353
+ // than a misleading run of zeros.
121354
+ ...p2p?.transportStats ?? {}
121324
121355
  },
121325
121356
  profile: "live"
121326
121357
  }),
@@ -121346,12 +121377,21 @@ ${ptyResult.output.slice(-2e3)}`);
121346
121377
  }));
121347
121378
  if (!serverConnected || !serverConn) return;
121348
121379
  if (!opts?.forceServer && wsHash === this.lastServerStatusHash) {
121349
- LOG2.debug("Server", `skip duplicate status_report${opts?.reason ? ` (${opts.reason})` : ""}`);
121380
+ if (this.serverDedupSkipCount + 1 < SERVER_DEDUP_KEEPALIVE_REPORTS) {
121381
+ this.serverDedupSkipCount++;
121382
+ LOG2.debug("Server", `skip duplicate status_report${opts?.reason ? ` (${opts.reason})` : ""} [${this.serverDedupSkipCount}/${SERVER_DEDUP_KEEPALIVE_REPORTS}]`);
121383
+ return;
121384
+ }
121385
+ LOG2.debug("Server", `keepalive status_report after ${this.serverDedupSkipCount} skipped duplicates`);
121386
+ }
121387
+ const wsPayloadBytes = JSON.stringify(wsPayload).length;
121388
+ const delivered = serverConn.sendMessage("status_report", wsPayload);
121389
+ if (delivered === false) {
121390
+ LOG2.debug("Server", `status_report not delivered \u2014 keeping previous dedup hash for retry${opts?.reason ? ` (${opts.reason})` : ""}`);
121350
121391
  return;
121351
121392
  }
121393
+ this.serverDedupSkipCount = 0;
121352
121394
  this.lastServerStatusHash = wsHash;
121353
- const wsPayloadBytes = JSON.stringify(wsPayload).length;
121354
- serverConn.sendMessage("status_report", wsPayload);
121355
121395
  LOG2.debug("Server", `sent status_report (${wsPayloadBytes} bytes)${opts?.reason ? ` [${opts.reason}]` : ""}`);
121356
121396
  }
121357
121397
  // ─── P2P ─────────────────────────────────────────