@adhdev/daemon-standalone 1.0.28-rc.6 → 1.0.28-rc.7
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 +50 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -33262,10 +33262,10 @@ var require_dist3 = __commonJS({
|
|
|
33262
33262
|
}
|
|
33263
33263
|
function getDaemonBuildInfo() {
|
|
33264
33264
|
if (cached2) return cached2;
|
|
33265
|
-
const commit = readInjected(true ? "
|
|
33266
|
-
const commitShort = readInjected(true ? "
|
|
33267
|
-
const version2 = readInjected(true ? "1.0.28-rc.
|
|
33268
|
-
const builtAt = readInjected(true ? "2026-07-
|
|
33265
|
+
const commit = readInjected(true ? "4d3d797d7472b72daaa82b9460f599e819ffee72" : void 0) ?? "unknown";
|
|
33266
|
+
const commitShort = readInjected(true ? "4d3d797d" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
33267
|
+
const version2 = readInjected(true ? "1.0.28-rc.7" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
33268
|
+
const builtAt = readInjected(true ? "2026-07-25T10:45:15.633Z" : void 0);
|
|
33269
33269
|
cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
|
|
33270
33270
|
return cached2;
|
|
33271
33271
|
}
|
|
@@ -62422,7 +62422,7 @@ ${cont}` : cont;
|
|
|
62422
62422
|
return true;
|
|
62423
62423
|
}
|
|
62424
62424
|
shouldDeferFinishForTranscript(parsed) {
|
|
62425
|
-
const requiresFinalAssistant =
|
|
62425
|
+
const requiresFinalAssistant = resolveTranscriptAuthorityProfile(this.provider).timing === "floor";
|
|
62426
62426
|
if (!requiresFinalAssistant) return false;
|
|
62427
62427
|
if (!this.isWaitingForResponse || !this.currentTurnScope || this.hasActionableApproval()) return false;
|
|
62428
62428
|
const parsedStatus = typeof parsed?.status === "string" ? parsed.status.trim() : "";
|
|
@@ -62834,6 +62834,9 @@ ${cont}` : cont;
|
|
|
62834
62834
|
pendingOutboundQueue = [];
|
|
62835
62835
|
pendingOutboundFlushTimer = null;
|
|
62836
62836
|
pendingOutboundFlushInFlight = false;
|
|
62837
|
+
// Stale-queue watchdog: fires STALE_QUEUE_WARN_MS after the oldest queued
|
|
62838
|
+
// message was enqueued if nothing has been flushed yet.
|
|
62839
|
+
pendingOutboundStaleTimer = null;
|
|
62837
62840
|
// Submit retry timer — PTY-level, not state machine
|
|
62838
62841
|
submitRetryTimer = null;
|
|
62839
62842
|
// PTY-WRITE-SERIALIZE: a single per-session tail promise that serializes every
|
|
@@ -63867,6 +63870,9 @@ ${lastSnapshot}`;
|
|
|
63867
63870
|
async waitForForceSubmitSettle() {
|
|
63868
63871
|
await new Promise((resolve28) => setTimeout(resolve28, FORCE_SUBMIT_SETTLE_MS));
|
|
63869
63872
|
}
|
|
63873
|
+
// Stale-queue threshold: warn if a queued message has not been flushed
|
|
63874
|
+
// within this many milliseconds (instrumentation only, no behavior change).
|
|
63875
|
+
static STALE_QUEUE_WARN_MS = 15e3;
|
|
63870
63876
|
enqueuePendingOutboundMessage(text, reason, meshTaskId) {
|
|
63871
63877
|
const content = String(text || "");
|
|
63872
63878
|
const duplicate = this.pendingOutboundQueue.some((message2) => message2.content === content);
|
|
@@ -63874,6 +63880,16 @@ ${lastSnapshot}`;
|
|
|
63874
63880
|
return;
|
|
63875
63881
|
}
|
|
63876
63882
|
const queuedAt = Date.now();
|
|
63883
|
+
const stableMs = this.lastScreenChangeAt ? queuedAt - this.lastScreenChangeAt : -1;
|
|
63884
|
+
const gateContext = {
|
|
63885
|
+
reason,
|
|
63886
|
+
startupParseGate: this.startupParseGate,
|
|
63887
|
+
ready: this.ready,
|
|
63888
|
+
engineStatus: this.engine.currentStatus,
|
|
63889
|
+
isWaitingForResponse: this.engine.isWaitingForResponse,
|
|
63890
|
+
stableMs,
|
|
63891
|
+
sessionId: this.engine.getTraceSessionId()
|
|
63892
|
+
};
|
|
63877
63893
|
const message = {
|
|
63878
63894
|
id: `${queuedAt}:${this.pendingOutboundQueue.length}:${Math.random().toString(36).slice(2, 10)}`,
|
|
63879
63895
|
role: "user",
|
|
@@ -63883,8 +63899,18 @@ ${lastSnapshot}`;
|
|
|
63883
63899
|
...typeof meshTaskId === "string" && meshTaskId.trim() ? { meshTaskId } : {}
|
|
63884
63900
|
};
|
|
63885
63901
|
this.pendingOutboundQueue.push(message);
|
|
63886
|
-
LOG2.info("CLI", `[${this.cliType}] queued outbound message
|
|
63902
|
+
LOG2.info("CLI", `[${this.cliType}] queued outbound message; gate=${JSON.stringify(gateContext)}; queue=${this.pendingOutboundQueue.length}`);
|
|
63887
63903
|
this.onStatusChange?.();
|
|
63904
|
+
if (!this.pendingOutboundStaleTimer) {
|
|
63905
|
+
this.pendingOutboundStaleTimer = setTimeout(() => {
|
|
63906
|
+
this.pendingOutboundStaleTimer = null;
|
|
63907
|
+
if (this.pendingOutboundQueue.length === 0) return;
|
|
63908
|
+
const oldest = this.pendingOutboundQueue[0];
|
|
63909
|
+
const staleSec = ((Date.now() - oldest.queuedAt) / 1e3).toFixed(1);
|
|
63910
|
+
const nowStableMs = this.lastScreenChangeAt ? Date.now() - this.lastScreenChangeAt : -1;
|
|
63911
|
+
LOG2.warn("CLI", `[${this.cliType}] STALE QUEUE: ${this.pendingOutboundQueue.length} message(s) undelivered for ${staleSec}s; gate=startupParseGate:${this.startupParseGate} ready:${this.ready} engineStatus:${this.engine.currentStatus} isWaitingForResponse:${this.engine.isWaitingForResponse} stableMs:${nowStableMs} sessionId:${this.engine.getTraceSessionId()} enqueueReason:${oldest.id}`);
|
|
63912
|
+
}, _ProviderCliAdapter.STALE_QUEUE_WARN_MS);
|
|
63913
|
+
}
|
|
63888
63914
|
}
|
|
63889
63915
|
shouldQueuePendingOutboundMessage(parsedStatusBeforeSend = null) {
|
|
63890
63916
|
if (this.provider.allowInputDuringGeneration === true) return null;
|
|
@@ -63925,6 +63951,10 @@ ${lastSnapshot}`;
|
|
|
63925
63951
|
try {
|
|
63926
63952
|
await this.sendMessageNow(next.content, false, next.meshTaskId);
|
|
63927
63953
|
this.pendingOutboundQueue.shift();
|
|
63954
|
+
if (this.pendingOutboundQueue.length === 0 && this.pendingOutboundStaleTimer) {
|
|
63955
|
+
clearTimeout(this.pendingOutboundStaleTimer);
|
|
63956
|
+
this.pendingOutboundStaleTimer = null;
|
|
63957
|
+
}
|
|
63928
63958
|
this.onStatusChange?.();
|
|
63929
63959
|
} catch (error48) {
|
|
63930
63960
|
LOG2.warn("CLI", `[${this.cliType}] queued outbound flush failed: ${error48?.message || error48}`);
|
|
@@ -64256,6 +64286,10 @@ ${lastSnapshot}`;
|
|
|
64256
64286
|
clearTimeout(this.pendingOutboundFlushTimer);
|
|
64257
64287
|
this.pendingOutboundFlushTimer = null;
|
|
64258
64288
|
}
|
|
64289
|
+
if (this.pendingOutboundStaleTimer) {
|
|
64290
|
+
clearTimeout(this.pendingOutboundStaleTimer);
|
|
64291
|
+
this.pendingOutboundStaleTimer = null;
|
|
64292
|
+
}
|
|
64259
64293
|
this.pendingOutboundQueue = [];
|
|
64260
64294
|
this.pendingOutboundFlushInFlight = false;
|
|
64261
64295
|
if (this.ptyProcess) {
|
|
@@ -64284,6 +64318,10 @@ ${lastSnapshot}`;
|
|
|
64284
64318
|
clearTimeout(this.pendingOutboundFlushTimer);
|
|
64285
64319
|
this.pendingOutboundFlushTimer = null;
|
|
64286
64320
|
}
|
|
64321
|
+
if (this.pendingOutboundStaleTimer) {
|
|
64322
|
+
clearTimeout(this.pendingOutboundStaleTimer);
|
|
64323
|
+
this.pendingOutboundStaleTimer = null;
|
|
64324
|
+
}
|
|
64287
64325
|
this.pendingOutboundQueue = [];
|
|
64288
64326
|
this.pendingOutboundFlushInFlight = false;
|
|
64289
64327
|
if (this.ptyProcess) {
|
|
@@ -85222,7 +85260,12 @@ ${buttons.join("\n")}`;
|
|
|
85222
85260
|
fcFinalSummary = extractFinalSummaryFromMessages(evidence.messages);
|
|
85223
85261
|
} catch {
|
|
85224
85262
|
}
|
|
85225
|
-
const
|
|
85263
|
+
const synthTiming = resolveTranscriptAuthorityProfile(this.provider).timing;
|
|
85264
|
+
const missingEvidence = (synthTiming === "floor" || synthTiming === "hold" || fcEvidenceSource === "external-native") && !fcFinalSummary;
|
|
85265
|
+
if (missingEvidence && synthTiming === "hold") {
|
|
85266
|
+
LOG2.info("CLI", `[${this.type}] ${reason} held: hold-class transcript not yet landed (source=${fcEvidenceSource})`);
|
|
85267
|
+
return false;
|
|
85268
|
+
}
|
|
85226
85269
|
const hasMeshContext = !!(this.settings.meshNodeFor || this.settings.meshActiveTaskId || this.settings.launchedByCoordinator);
|
|
85227
85270
|
if (missingEvidence && !hasMeshContext) {
|
|
85228
85271
|
LOG2.info("CLI", `[${this.type}] ${reason} suppressed: missing final assistant evidence, no mesh context (source=${fcEvidenceSource})`);
|