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/cli/index.js
CHANGED
|
@@ -15050,17 +15050,24 @@ function buildPersistableCliHistorySignature(message) {
|
|
|
15050
15050
|
normalizePersistableCliHistoryContent(message.content)
|
|
15051
15051
|
].join("|");
|
|
15052
15052
|
}
|
|
15053
|
+
function hasSamePersistableCliHistoryIdentity(a, b) {
|
|
15054
|
+
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 || "");
|
|
15055
|
+
}
|
|
15053
15056
|
function buildIncrementalHistoryAppendMessages(previousMessages, currentMessages) {
|
|
15054
15057
|
if (!Array.isArray(currentMessages) || currentMessages.length === 0) return [];
|
|
15055
15058
|
if (!Array.isArray(previousMessages) || previousMessages.length === 0) return currentMessages;
|
|
15056
|
-
const
|
|
15057
|
-
const currentSignatures = currentMessages.map(buildPersistableCliHistorySignature);
|
|
15059
|
+
const comparableLength = Math.min(previousMessages.length, currentMessages.length);
|
|
15058
15060
|
let sharedPrefixLength = 0;
|
|
15059
|
-
while (sharedPrefixLength <
|
|
15061
|
+
while (sharedPrefixLength < comparableLength && hasSamePersistableCliHistoryIdentity(previousMessages[sharedPrefixLength], currentMessages[sharedPrefixLength])) {
|
|
15062
|
+
sharedPrefixLength += 1;
|
|
15063
|
+
}
|
|
15064
|
+
if (sharedPrefixLength === currentMessages.length) return [];
|
|
15065
|
+
if (sharedPrefixLength === previousMessages.length) return currentMessages.slice(sharedPrefixLength);
|
|
15066
|
+
while (sharedPrefixLength < comparableLength && buildPersistableCliHistorySignature(previousMessages[sharedPrefixLength]) === buildPersistableCliHistorySignature(currentMessages[sharedPrefixLength])) {
|
|
15060
15067
|
sharedPrefixLength += 1;
|
|
15061
15068
|
}
|
|
15062
|
-
if (sharedPrefixLength ===
|
|
15063
|
-
if (sharedPrefixLength ===
|
|
15069
|
+
if (sharedPrefixLength === currentMessages.length) return [];
|
|
15070
|
+
if (sharedPrefixLength === previousMessages.length) return currentMessages.slice(sharedPrefixLength);
|
|
15064
15071
|
return currentMessages;
|
|
15065
15072
|
}
|
|
15066
15073
|
function getDatabaseSync() {
|
|
@@ -15327,13 +15334,15 @@ var init_cli_provider_instance = __esm({
|
|
|
15327
15334
|
}));
|
|
15328
15335
|
if (!canonicalBackedHistory && !shouldSkipReplayPersist && normalizedMessagesToSave.length > 0) {
|
|
15329
15336
|
const incrementalMessages = buildIncrementalHistoryAppendMessages(this.lastPersistedHistoryMessages, normalizedMessagesToSave);
|
|
15330
|
-
|
|
15331
|
-
this.
|
|
15332
|
-
|
|
15333
|
-
|
|
15334
|
-
|
|
15335
|
-
|
|
15336
|
-
|
|
15337
|
+
if (incrementalMessages.length > 0) {
|
|
15338
|
+
this.historyWriter.appendNewMessages(
|
|
15339
|
+
this.type,
|
|
15340
|
+
incrementalMessages,
|
|
15341
|
+
parsedStatus?.title || dirName,
|
|
15342
|
+
this.instanceId,
|
|
15343
|
+
this.providerSessionId
|
|
15344
|
+
);
|
|
15345
|
+
}
|
|
15337
15346
|
}
|
|
15338
15347
|
if (!canonicalBackedHistory) {
|
|
15339
15348
|
this.lastPersistedHistoryMessages = normalizedMessagesToSave;
|
|
@@ -88295,7 +88304,7 @@ var init_adhdev_daemon = __esm({
|
|
|
88295
88304
|
init_version();
|
|
88296
88305
|
init_src();
|
|
88297
88306
|
init_runtime_defaults();
|
|
88298
|
-
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.
|
|
88307
|
+
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.38" });
|
|
88299
88308
|
AdhdevDaemon = class _AdhdevDaemon {
|
|
88300
88309
|
localHttpServer = null;
|
|
88301
88310
|
localWss = null;
|