adhdev 0.9.37 → 0.9.38
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/cli/index.js +22 -13
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +22 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14094,17 +14094,24 @@ function buildPersistableCliHistorySignature(message) {
|
|
|
14094
14094
|
normalizePersistableCliHistoryContent(message.content)
|
|
14095
14095
|
].join("|");
|
|
14096
14096
|
}
|
|
14097
|
+
function hasSamePersistableCliHistoryIdentity(a, b) {
|
|
14098
|
+
return String(a?.role || "") === String(b?.role || "") && String(a?.kind || "") === String(b?.kind || "") && String(a?.senderName || "") === String(b?.senderName || "") && String(a?.content || "") === String(b?.content || "");
|
|
14099
|
+
}
|
|
14097
14100
|
function buildIncrementalHistoryAppendMessages(previousMessages, currentMessages) {
|
|
14098
14101
|
if (!Array.isArray(currentMessages) || currentMessages.length === 0) return [];
|
|
14099
14102
|
if (!Array.isArray(previousMessages) || previousMessages.length === 0) return currentMessages;
|
|
14100
|
-
const
|
|
14101
|
-
const currentSignatures = currentMessages.map(buildPersistableCliHistorySignature);
|
|
14103
|
+
const comparableLength = Math.min(previousMessages.length, currentMessages.length);
|
|
14102
14104
|
let sharedPrefixLength = 0;
|
|
14103
|
-
while (sharedPrefixLength <
|
|
14105
|
+
while (sharedPrefixLength < comparableLength && hasSamePersistableCliHistoryIdentity(previousMessages[sharedPrefixLength], currentMessages[sharedPrefixLength])) {
|
|
14106
|
+
sharedPrefixLength += 1;
|
|
14107
|
+
}
|
|
14108
|
+
if (sharedPrefixLength === currentMessages.length) return [];
|
|
14109
|
+
if (sharedPrefixLength === previousMessages.length) return currentMessages.slice(sharedPrefixLength);
|
|
14110
|
+
while (sharedPrefixLength < comparableLength && buildPersistableCliHistorySignature(previousMessages[sharedPrefixLength]) === buildPersistableCliHistorySignature(currentMessages[sharedPrefixLength])) {
|
|
14104
14111
|
sharedPrefixLength += 1;
|
|
14105
14112
|
}
|
|
14106
|
-
if (sharedPrefixLength ===
|
|
14107
|
-
if (sharedPrefixLength ===
|
|
14113
|
+
if (sharedPrefixLength === currentMessages.length) return [];
|
|
14114
|
+
if (sharedPrefixLength === previousMessages.length) return currentMessages.slice(sharedPrefixLength);
|
|
14108
14115
|
return currentMessages;
|
|
14109
14116
|
}
|
|
14110
14117
|
function getDatabaseSync() {
|
|
@@ -14371,13 +14378,15 @@ var init_cli_provider_instance = __esm({
|
|
|
14371
14378
|
}));
|
|
14372
14379
|
if (!canonicalBackedHistory && !shouldSkipReplayPersist && normalizedMessagesToSave.length > 0) {
|
|
14373
14380
|
const incrementalMessages = buildIncrementalHistoryAppendMessages(this.lastPersistedHistoryMessages, normalizedMessagesToSave);
|
|
14374
|
-
|
|
14375
|
-
this.
|
|
14376
|
-
|
|
14377
|
-
|
|
14378
|
-
|
|
14379
|
-
|
|
14380
|
-
|
|
14381
|
+
if (incrementalMessages.length > 0) {
|
|
14382
|
+
this.historyWriter.appendNewMessages(
|
|
14383
|
+
this.type,
|
|
14384
|
+
incrementalMessages,
|
|
14385
|
+
parsedStatus?.title || dirName,
|
|
14386
|
+
this.instanceId,
|
|
14387
|
+
this.providerSessionId
|
|
14388
|
+
);
|
|
14389
|
+
}
|
|
14381
14390
|
}
|
|
14382
14391
|
if (!canonicalBackedHistory) {
|
|
14383
14392
|
this.lastPersistedHistoryMessages = normalizedMessagesToSave;
|
|
@@ -56575,7 +56584,7 @@ var init_adhdev_daemon = __esm({
|
|
|
56575
56584
|
init_version();
|
|
56576
56585
|
init_src();
|
|
56577
56586
|
init_runtime_defaults();
|
|
56578
|
-
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.
|
|
56587
|
+
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.38" });
|
|
56579
56588
|
AdhdevDaemon = class _AdhdevDaemon {
|
|
56580
56589
|
localHttpServer = null;
|
|
56581
56590
|
localWss = null;
|