adhdev 0.8.90 → 0.8.91
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 +18 -8
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +18 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7310,10 +7310,11 @@ async function handleReadChat(h, args) {
|
|
|
7310
7310
|
const parsedRecord = parsedStatus && typeof parsedStatus === "object" ? parsedStatus : null;
|
|
7311
7311
|
const adapterStatus = adapter.getStatus();
|
|
7312
7312
|
const shouldPreferAdapterMessages = Array.isArray(adapterStatus.messages) && adapterStatus.messages.length > 0 && Array.isArray(parsedRecord?.messages) && adapterStatus.messages.length > parsedRecord.messages.length;
|
|
7313
|
+
const parsedShowsApproval = hasNonEmptyModalButtons(parsedRecord?.activeModal) && parsedRecord?.status === "waiting_approval";
|
|
7313
7314
|
const status = parsedRecord ? {
|
|
7314
7315
|
...parsedRecord,
|
|
7315
7316
|
messages: shouldPreferAdapterMessages ? adapterStatus.messages : parsedRecord.messages,
|
|
7316
|
-
status: adapterStatus.status !== "idle" ? adapterStatus.status : parsedRecord.status || adapterStatus.status,
|
|
7317
|
+
status: parsedShowsApproval ? parsedRecord.status : adapterStatus.status !== "idle" ? adapterStatus.status : parsedRecord.status || adapterStatus.status,
|
|
7317
7318
|
activeModal: parsedRecord.activeModal || adapterStatus.activeModal
|
|
7318
7319
|
} : adapterStatus;
|
|
7319
7320
|
const title = typeof parsedRecord?.title === "string" ? parsedRecord.title : void 0;
|
|
@@ -11907,14 +11908,15 @@ var init_provider_cli_adapter = __esm({
|
|
|
11907
11908
|
return;
|
|
11908
11909
|
}
|
|
11909
11910
|
const startupModal = this.getStartupConfirmationModal(screenText);
|
|
11910
|
-
const modal = this.runParseApproval(tail) || startupModal;
|
|
11911
|
-
const rawScriptStatus = this.runDetectStatus(tail);
|
|
11912
|
-
const scriptStatus = startupModal ? "waiting_approval" : rawScriptStatus;
|
|
11913
11911
|
const parsedTranscript = this.parseCurrentTranscript(
|
|
11914
11912
|
this.committedMessages,
|
|
11915
11913
|
this.responseBuffer,
|
|
11916
11914
|
this.currentTurnScope
|
|
11917
11915
|
);
|
|
11916
|
+
const parsedModal = parsedTranscript?.activeModal && Array.isArray(parsedTranscript.activeModal.buttons) && parsedTranscript.activeModal.buttons.some((button) => typeof button === "string" && button.trim()) ? parsedTranscript.activeModal : null;
|
|
11917
|
+
const modal = this.runParseApproval(tail) || parsedModal || startupModal;
|
|
11918
|
+
const rawScriptStatus = this.runDetectStatus(tail);
|
|
11919
|
+
const scriptStatus = startupModal ? "waiting_approval" : parsedModal && parsedTranscript?.status === "waiting_approval" ? "waiting_approval" : rawScriptStatus;
|
|
11918
11920
|
const parsedMessages = Array.isArray(parsedTranscript?.messages) ? normalizeCliParsedMessages(parsedTranscript.messages, {
|
|
11919
11921
|
committedMessages: this.committedMessages,
|
|
11920
11922
|
scope: this.currentTurnScope,
|
|
@@ -11924,6 +11926,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
11924
11926
|
return;
|
|
11925
11927
|
}
|
|
11926
11928
|
const lastParsedAssistant = [...parsedMessages].reverse().find((message) => message.role === "assistant");
|
|
11929
|
+
const parsedShowsLiveAssistantProgress = parsedTranscript?.status === "generating" && !!lastParsedAssistant && parsedMessages.length > this.committedMessages.length;
|
|
11927
11930
|
const normalizedPromptSnippet = normalizePromptText(this.submitRetryPromptSnippet || this.currentTurnScope?.prompt || "");
|
|
11928
11931
|
this.recordTrace("settled", {
|
|
11929
11932
|
tail: summarizeCliTraceText(tail, 500),
|
|
@@ -12078,7 +12081,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
12078
12081
|
const effectiveScreenText = screenText || this.accumulatedBuffer;
|
|
12079
12082
|
const noActiveTurn = !this.currentTurnScope;
|
|
12080
12083
|
const looksIdleChrome = /(^|\n)\s*[❯›>]\s*(?:\n|$)/m.test(effectiveScreenText) || /accept edits on/i.test(effectiveScreenText) && (/Update available!/i.test(screenText) || /\/effort/i.test(screenText) || /^.*➜\s+\S+/m.test(effectiveScreenText));
|
|
12081
|
-
if (prevStatus === "idle" && !this.isWaitingForResponse && noActiveTurn && !modal && looksIdleChrome) {
|
|
12084
|
+
if (prevStatus === "idle" && !this.isWaitingForResponse && noActiveTurn && !modal && looksIdleChrome && !parsedShowsLiveAssistantProgress) {
|
|
12082
12085
|
return;
|
|
12083
12086
|
}
|
|
12084
12087
|
if (prevStatus === "waiting_approval") {
|
|
@@ -37307,6 +37310,10 @@ var init_reporter = __esm({
|
|
|
37307
37310
|
}
|
|
37308
37311
|
}
|
|
37309
37312
|
onStatusChange() {
|
|
37313
|
+
if (this.deps.p2p?.isConnected) {
|
|
37314
|
+
this.resetP2PHash();
|
|
37315
|
+
this.sendUnifiedStatusReport({ p2pOnly: true, reason: "status-change" }).catch((e) => LOG.warn("Status", `Immediate P2P status send failed: ${e?.message}`));
|
|
37316
|
+
}
|
|
37310
37317
|
this.throttledReport();
|
|
37311
37318
|
}
|
|
37312
37319
|
throttledReport() {
|
|
@@ -37404,10 +37411,12 @@ var init_reporter = __esm({
|
|
|
37404
37411
|
}
|
|
37405
37412
|
async sendUnifiedStatusReport(opts) {
|
|
37406
37413
|
const { serverConn, p2p } = this.deps;
|
|
37407
|
-
|
|
37414
|
+
const serverConnected = !!serverConn?.isConnected();
|
|
37415
|
+
const p2pConnected = !!p2p?.isConnected;
|
|
37416
|
+
if (!serverConnected && !p2pConnected) return;
|
|
37408
37417
|
this.lastStatusSentAt = Date.now();
|
|
37409
37418
|
const now = this.lastStatusSentAt;
|
|
37410
|
-
const target = opts?.p2pOnly ? "P2P" : "P2P+Server";
|
|
37419
|
+
const target = opts?.p2pOnly ? "P2P" : serverConnected ? "P2P+Server" : "P2P";
|
|
37411
37420
|
const allStates = this.deps.instanceManager.collectAllStates();
|
|
37412
37421
|
const ideStates = allStates.filter((s) => s.category === "ide");
|
|
37413
37422
|
const cliStates = allStates.filter((s) => s.category === "cli");
|
|
@@ -37486,6 +37495,7 @@ var init_reporter = __esm({
|
|
|
37486
37495
|
...wsPayload,
|
|
37487
37496
|
timestamp: void 0
|
|
37488
37497
|
}));
|
|
37498
|
+
if (!serverConnected || !serverConn) return;
|
|
37489
37499
|
if (!opts?.forceServer && wsHash === this.lastServerStatusHash) {
|
|
37490
37500
|
LOG.debug("Server", `skip duplicate status_report${opts?.reason ? ` (${opts.reason})` : ""}`);
|
|
37491
37501
|
return;
|
|
@@ -54803,7 +54813,7 @@ var init_adhdev_daemon = __esm({
|
|
|
54803
54813
|
init_version();
|
|
54804
54814
|
init_src();
|
|
54805
54815
|
init_runtime_defaults();
|
|
54806
|
-
pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.
|
|
54816
|
+
pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.91" });
|
|
54807
54817
|
AdhdevDaemon = class _AdhdevDaemon {
|
|
54808
54818
|
localHttpServer = null;
|
|
54809
54819
|
localWss = null;
|