adhdev 0.8.96 → 0.8.97
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 +33 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +33 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11321,6 +11321,28 @@ __export(provider_cli_adapter_exports, {
|
|
|
11321
11321
|
ProviderCliAdapter: () => ProviderCliAdapter,
|
|
11322
11322
|
normalizeCliProviderForRuntime: () => normalizeCliProviderForRuntime
|
|
11323
11323
|
});
|
|
11324
|
+
function normalizeComparableTranscriptText(value) {
|
|
11325
|
+
return sanitizeTerminalText(String(value || "")).replace(/\s+/g, " ").trim();
|
|
11326
|
+
}
|
|
11327
|
+
function parsedTranscriptIsRicherThanCommitted(parsedMessages, committedMessages) {
|
|
11328
|
+
if (!Array.isArray(parsedMessages) || !Array.isArray(committedMessages)) return false;
|
|
11329
|
+
if (parsedMessages.length > committedMessages.length) return true;
|
|
11330
|
+
if (parsedMessages.length !== committedMessages.length) return false;
|
|
11331
|
+
for (let index = 0; index < parsedMessages.length; index += 1) {
|
|
11332
|
+
const parsed = parsedMessages[index];
|
|
11333
|
+
const committed = committedMessages[index];
|
|
11334
|
+
if (!parsed || !committed) return false;
|
|
11335
|
+
if ((parsed.role || "") !== (committed.role || "")) return false;
|
|
11336
|
+
if (parsed.id && committed.id && String(parsed.id) !== String(committed.id)) return false;
|
|
11337
|
+
if (typeof parsed.index === "number" && typeof committed.index === "number" && parsed.index !== committed.index) return false;
|
|
11338
|
+
const parsedText = normalizeComparableTranscriptText(parsed.content);
|
|
11339
|
+
const committedText = normalizeComparableTranscriptText(committed.content);
|
|
11340
|
+
if (!parsedText || !committedText || parsedText === committedText) continue;
|
|
11341
|
+
if (parsedText.length > committedText.length && parsedText.startsWith(committedText)) return true;
|
|
11342
|
+
return false;
|
|
11343
|
+
}
|
|
11344
|
+
return false;
|
|
11345
|
+
}
|
|
11324
11346
|
var os12, ProviderCliAdapter;
|
|
11325
11347
|
var init_provider_cli_adapter = __esm({
|
|
11326
11348
|
"../../oss/packages/daemon-core/src/cli-adapters/provider-cli-adapter.ts"() {
|
|
@@ -12648,7 +12670,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
12648
12670
|
}));
|
|
12649
12671
|
const parsedLastAssistant = [...parsedHydratedMessages].reverse().find((message) => message.role === "assistant" && typeof message.content === "string" && message.content.trim());
|
|
12650
12672
|
const visibleIdlePrompt = this.looksLikeVisibleIdlePrompt(screenText);
|
|
12651
|
-
const shouldAdoptParsedIdleReplay = !this.currentTurnScope && !this.activeModal && !!parsedLastAssistant && parsedHydratedMessages
|
|
12673
|
+
const shouldAdoptParsedIdleReplay = !this.currentTurnScope && !this.activeModal && !!parsedLastAssistant && parsedTranscriptIsRicherThanCommitted(parsedHydratedMessages, committedHydratedMessages) && (this.currentStatus === "idle" || this.currentStatus === "generating" && this.isWaitingForResponse && parsed.status === "idle" && visibleIdlePrompt);
|
|
12652
12674
|
if (shouldAdoptParsedIdleReplay) {
|
|
12653
12675
|
this.committedMessages = normalizeCliParsedMessages(parsed.messages, {
|
|
12654
12676
|
committedMessages: this.committedMessages,
|
|
@@ -13526,6 +13548,8 @@ var init_cli_provider_instance = __esm({
|
|
|
13526
13548
|
generatingDebounceTimer = null;
|
|
13527
13549
|
generatingDebouncePending = null;
|
|
13528
13550
|
lastApprovalEventAt = 0;
|
|
13551
|
+
autoApproveBusy = false;
|
|
13552
|
+
autoApproveBusyTimer = null;
|
|
13529
13553
|
controlValues = {};
|
|
13530
13554
|
summaryMetadata = void 0;
|
|
13531
13555
|
appliedEffectKeys = /* @__PURE__ */ new Set();
|
|
@@ -13817,7 +13841,13 @@ var init_cli_provider_instance = __esm({
|
|
|
13817
13841
|
const parsedStatus = this.adapter.getScriptParsedStatus?.() || null;
|
|
13818
13842
|
const rawStatus = adapterStatus.status;
|
|
13819
13843
|
const autoApproveActive = rawStatus === "waiting_approval" && this.shouldAutoApprove();
|
|
13820
|
-
if (autoApproveActive) {
|
|
13844
|
+
if (autoApproveActive && !this.autoApproveBusy) {
|
|
13845
|
+
this.autoApproveBusy = true;
|
|
13846
|
+
if (this.autoApproveBusyTimer) clearTimeout(this.autoApproveBusyTimer);
|
|
13847
|
+
this.autoApproveBusyTimer = setTimeout(() => {
|
|
13848
|
+
this.autoApproveBusy = false;
|
|
13849
|
+
this.autoApproveBusyTimer = null;
|
|
13850
|
+
}, 2e3);
|
|
13821
13851
|
const { index: buttonIndex, label: buttonLabel } = pickApprovalButton(adapterStatus.activeModal?.buttons, this.provider);
|
|
13822
13852
|
this.recordAutoApproval(adapterStatus.activeModal?.message, buttonLabel, now);
|
|
13823
13853
|
setTimeout(() => {
|
|
@@ -55097,7 +55127,7 @@ var init_adhdev_daemon = __esm({
|
|
|
55097
55127
|
init_version();
|
|
55098
55128
|
init_src();
|
|
55099
55129
|
init_runtime_defaults();
|
|
55100
|
-
pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.
|
|
55130
|
+
pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.97" });
|
|
55101
55131
|
AdhdevDaemon = class _AdhdevDaemon {
|
|
55102
55132
|
localHttpServer = null;
|
|
55103
55133
|
localWss = null;
|