@adhdev/daemon-standalone 1.0.44-rc.2 → 1.0.45-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
- // ../../node_modules/tar-stream/node_modules/b4a/index.js
31426
+ // ../daemon-core/node_modules/b4a/index.js
31427
31427
  var require_b4a2 = __commonJS({
31428
- "../../node_modules/tar-stream/node_modules/b4a/index.js"(exports2, module2) {
31428
+ "../daemon-core/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
- // ../../node_modules/tar-stream/headers.js
31584
+ // ../daemon-core/node_modules/tar-stream/headers.js
31585
31585
  var require_headers = __commonJS({
31586
- "../../node_modules/tar-stream/headers.js"(exports2) {
31586
+ "../daemon-core/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
- // ../../node_modules/tar-stream/extract.js
31847
+ // ../daemon-core/node_modules/tar-stream/extract.js
31848
31848
  var require_extract = __commonJS({
31849
- "../../node_modules/tar-stream/extract.js"(exports2, module2) {
31849
+ "../daemon-core/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
- // ../../node_modules/tar-stream/constants.js
32192
+ // ../daemon-core/node_modules/tar-stream/constants.js
32193
32193
  var require_constants = __commonJS({
32194
- "../../node_modules/tar-stream/constants.js"(exports2, module2) {
32194
+ "../daemon-core/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
- // ../../node_modules/tar-stream/pack.js
32213
+ // ../daemon-core/node_modules/tar-stream/pack.js
32214
32214
  var require_pack = __commonJS({
32215
- "../../node_modules/tar-stream/pack.js"(exports2, module2) {
32215
+ "../daemon-core/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
- // ../../node_modules/tar-stream/index.js
32448
+ // ../daemon-core/node_modules/tar-stream/index.js
32449
32449
  var require_tar_stream = __commonJS({
32450
- "../../node_modules/tar-stream/index.js"(exports2) {
32450
+ "../daemon-core/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
- // ../../node_modules/tar-fs/index.js
32693
+ // ../daemon-core/node_modules/tar-fs/index.js
32694
32694
  var require_tar_fs = __commonJS({
32695
- "../../node_modules/tar-fs/index.js"(exports2) {
32695
+ "../daemon-core/node_modules/tar-fs/index.js"(exports2) {
32696
32696
  "use strict";
32697
32697
  var tar = require_tar_stream();
32698
32698
  var pump = require_pump();
@@ -36556,10 +36556,10 @@ var require_dist3 = __commonJS({
36556
36556
  }
36557
36557
  function getDaemonBuildInfo() {
36558
36558
  if (cached2) return cached2;
36559
- const commit = readInjected(true ? "648305378fc7e0a1970cfe964a80ce7a68172964" : void 0) ?? "unknown";
36560
- const commitShort = readInjected(true ? "64830537" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
36561
- const version2 = readInjected(true ? "1.0.44-rc.2" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
36562
- const builtAt = readInjected(true ? "2026-08-11T08:23:49.936Z" : void 0);
36559
+ const commit = readInjected(true ? "c17f2078df64faf3fb3169a6e2af8e6e79f85562" : void 0) ?? "unknown";
36560
+ const commitShort = readInjected(true ? "c17f207" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
36561
+ const version2 = readInjected(true ? "1.0.45-rc.1" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
36562
+ const builtAt = readInjected(true ? "2026-08-11T13:37:11.714Z" : void 0);
36563
36563
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
36564
36564
  return cached2;
36565
36565
  }
@@ -97630,6 +97630,46 @@ ${buttons.join("\n")}`;
97630
97630
  host.pushEvent({ event: me.type, agentKey: me.agentKey, message: me.message, elapsedSec: me.elapsedSec, timestamp: me.timestamp });
97631
97631
  }
97632
97632
  }
97633
+ init_contracts2();
97634
+ var MAX_TRACKED_MESSAGES = 2e3;
97635
+ function hasUsableTimestamp(message) {
97636
+ const value = Number(message.receivedAt || message.timestamp || 0);
97637
+ return Number.isFinite(value) && value > 0;
97638
+ }
97639
+ var ParsedIngestTimestampStamper = class {
97640
+ firstSeenAtByKey = /* @__PURE__ */ new Map();
97641
+ stamp(messages, nowMs = Date.now()) {
97642
+ return messages.map((message) => {
97643
+ if (!message || hasUsableTimestamp(message)) return message;
97644
+ const key2 = this.keyFor(message);
97645
+ let firstSeenAt = this.firstSeenAtByKey.get(key2);
97646
+ if (firstSeenAt === void 0) {
97647
+ firstSeenAt = nowMs;
97648
+ this.remember(key2, firstSeenAt);
97649
+ }
97650
+ return { ...message, receivedAt: firstSeenAt };
97651
+ });
97652
+ }
97653
+ keyFor(message) {
97654
+ const role = typeof message.role === "string" ? message.role.trim().toLowerCase() : "";
97655
+ const kind = typeof message.kind === "string" ? message.kind.trim().toLowerCase() : "";
97656
+ let text = "";
97657
+ try {
97658
+ text = flattenContent(message.content);
97659
+ } catch {
97660
+ text = String(message.content ?? "");
97661
+ }
97662
+ return `${role}|${kind}|${text.replace(/\s+/g, " ").trim()}`;
97663
+ }
97664
+ remember(key2, firstSeenAt) {
97665
+ this.firstSeenAtByKey.set(key2, firstSeenAt);
97666
+ while (this.firstSeenAtByKey.size > MAX_TRACKED_MESSAGES) {
97667
+ const oldest = this.firstSeenAtByKey.keys().next();
97668
+ if (oldest.done) break;
97669
+ this.firstSeenAtByKey.delete(oldest.value);
97670
+ }
97671
+ }
97672
+ };
97633
97673
  init_auto_approve_modes();
97634
97674
  var CliProviderInstance = class _CliProviderInstance {
97635
97675
  constructor(provider, workingDir, cliArgs = [], instanceId, transportFactory, options) {
@@ -98014,6 +98054,11 @@ ${buttons.join("\n")}`;
98014
98054
  appliedEffectKeys = /* @__PURE__ */ new Set();
98015
98055
  historyWriter;
98016
98056
  runtimeMessages = [];
98057
+ // INGEST-TIMESTAMP: stamps untimed provider-parsed messages with their
98058
+ // first-observed time so mergeConversationMessages can interleave the
98059
+ // timestamped runtime user-input ack by clock instead of pinning it after
98060
+ // every parsed message (the "user bubble stuck at the bottom" defect).
98061
+ parsedIngestTimestamps = new ParsedIngestTimestampStamper();
98017
98062
  lastPersistedHistoryMessages = [];
98018
98063
  lastAcknowledgedUserInputAt = 0;
98019
98064
  // TASKBUBBLE-DUP: per-content last-ack timestamps so the same dispatched
@@ -98192,7 +98237,7 @@ ${buttons.join("\n")}`;
98192
98237
  if (historyMessageCount !== null) {
98193
98238
  parsedMessages = historyMessageCount > 0 ? parsedMessages.slice(-historyMessageCount) : [];
98194
98239
  }
98195
- const mergedMessages = mergeConversationMessages(this.runtimeMessages, parsedMessages);
98240
+ const mergedMessages = mergeConversationMessages(this.runtimeMessages, this.parsedIngestTimestamps.stamp(parsedMessages));
98196
98241
  const canonicalBackedHistory = this.shouldHydrateExistingProviderHistory() ? this.syncCanonicalSavedHistoryIfNeeded() : false;
98197
98242
  const statusMessages = canonicalBackedHistory && this.lastPersistedHistoryMessages.length > 0 ? this.lastPersistedHistoryMessages.map((message) => ({
98198
98243
  role: message.role,
@@ -100273,7 +100318,7 @@ ${buttons.join("\n")}`;
100273
100318
  }
100274
100319
  }
100275
100320
  mergeRuntimeChatMessages(parsedMessages) {
100276
- return mergeConversationMessages(this.runtimeMessages, parsedMessages);
100321
+ return mergeConversationMessages(this.runtimeMessages, this.parsedIngestTimestamps.stamp(parsedMessages));
100277
100322
  }
100278
100323
  promoteProviderSessionId(sessionId, opts = {}) {
100279
100324
  const nextSessionId = String(sessionId || "").trim();