@adhdev/daemon-core 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/cli-adapters/provider-cli-adapter.d.ts +2 -0
- package/dist/index.js +50 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +50 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/cli-adapters/cli-state-engine.ts +9 -1
- package/src/cli-adapters/provider-cli-adapter.ts +42 -1
- package/src/providers/cli-provider-instance.ts +55 -11
package/dist/index.mjs
CHANGED
|
@@ -786,10 +786,10 @@ function readInjected(value) {
|
|
|
786
786
|
}
|
|
787
787
|
function getDaemonBuildInfo() {
|
|
788
788
|
if (cached) return cached;
|
|
789
|
-
const commit = readInjected(true ? "
|
|
790
|
-
const commitShort = readInjected(true ? "
|
|
791
|
-
const version = readInjected(true ? "1.0.28-rc.
|
|
792
|
-
const builtAt = readInjected(true ? "2026-07-
|
|
789
|
+
const commit = readInjected(true ? "4d3d797d7472b72daaa82b9460f599e819ffee72" : void 0) ?? "unknown";
|
|
790
|
+
const commitShort = readInjected(true ? "4d3d797d" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
791
|
+
const version = readInjected(true ? "1.0.28-rc.7" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
792
|
+
const builtAt = readInjected(true ? "2026-07-25T10:44:41.655Z" : void 0);
|
|
793
793
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
794
794
|
return cached;
|
|
795
795
|
}
|
|
@@ -29764,7 +29764,7 @@ var init_cli_state_engine = __esm({
|
|
|
29764
29764
|
return true;
|
|
29765
29765
|
}
|
|
29766
29766
|
shouldDeferFinishForTranscript(parsed) {
|
|
29767
|
-
const requiresFinalAssistant =
|
|
29767
|
+
const requiresFinalAssistant = resolveTranscriptAuthorityProfile(this.provider).timing === "floor";
|
|
29768
29768
|
if (!requiresFinalAssistant) return false;
|
|
29769
29769
|
if (!this.isWaitingForResponse || !this.currentTurnScope || this.hasActionableApproval()) return false;
|
|
29770
29770
|
const parsedStatus = typeof parsed?.status === "string" ? parsed.status.trim() : "";
|
|
@@ -30175,6 +30175,9 @@ var init_provider_cli_adapter = __esm({
|
|
|
30175
30175
|
pendingOutboundQueue = [];
|
|
30176
30176
|
pendingOutboundFlushTimer = null;
|
|
30177
30177
|
pendingOutboundFlushInFlight = false;
|
|
30178
|
+
// Stale-queue watchdog: fires STALE_QUEUE_WARN_MS after the oldest queued
|
|
30179
|
+
// message was enqueued if nothing has been flushed yet.
|
|
30180
|
+
pendingOutboundStaleTimer = null;
|
|
30178
30181
|
// Submit retry timer — PTY-level, not state machine
|
|
30179
30182
|
submitRetryTimer = null;
|
|
30180
30183
|
// PTY-WRITE-SERIALIZE: a single per-session tail promise that serializes every
|
|
@@ -31208,6 +31211,9 @@ ${lastSnapshot}`;
|
|
|
31208
31211
|
async waitForForceSubmitSettle() {
|
|
31209
31212
|
await new Promise((resolve28) => setTimeout(resolve28, FORCE_SUBMIT_SETTLE_MS));
|
|
31210
31213
|
}
|
|
31214
|
+
// Stale-queue threshold: warn if a queued message has not been flushed
|
|
31215
|
+
// within this many milliseconds (instrumentation only, no behavior change).
|
|
31216
|
+
static STALE_QUEUE_WARN_MS = 15e3;
|
|
31211
31217
|
enqueuePendingOutboundMessage(text, reason, meshTaskId) {
|
|
31212
31218
|
const content = String(text || "");
|
|
31213
31219
|
const duplicate = this.pendingOutboundQueue.some((message2) => message2.content === content);
|
|
@@ -31215,6 +31221,16 @@ ${lastSnapshot}`;
|
|
|
31215
31221
|
return;
|
|
31216
31222
|
}
|
|
31217
31223
|
const queuedAt = Date.now();
|
|
31224
|
+
const stableMs = this.lastScreenChangeAt ? queuedAt - this.lastScreenChangeAt : -1;
|
|
31225
|
+
const gateContext = {
|
|
31226
|
+
reason,
|
|
31227
|
+
startupParseGate: this.startupParseGate,
|
|
31228
|
+
ready: this.ready,
|
|
31229
|
+
engineStatus: this.engine.currentStatus,
|
|
31230
|
+
isWaitingForResponse: this.engine.isWaitingForResponse,
|
|
31231
|
+
stableMs,
|
|
31232
|
+
sessionId: this.engine.getTraceSessionId()
|
|
31233
|
+
};
|
|
31218
31234
|
const message = {
|
|
31219
31235
|
id: `${queuedAt}:${this.pendingOutboundQueue.length}:${Math.random().toString(36).slice(2, 10)}`,
|
|
31220
31236
|
role: "user",
|
|
@@ -31224,8 +31240,18 @@ ${lastSnapshot}`;
|
|
|
31224
31240
|
...typeof meshTaskId === "string" && meshTaskId.trim() ? { meshTaskId } : {}
|
|
31225
31241
|
};
|
|
31226
31242
|
this.pendingOutboundQueue.push(message);
|
|
31227
|
-
LOG.info("CLI", `[${this.cliType}] queued outbound message
|
|
31243
|
+
LOG.info("CLI", `[${this.cliType}] queued outbound message; gate=${JSON.stringify(gateContext)}; queue=${this.pendingOutboundQueue.length}`);
|
|
31228
31244
|
this.onStatusChange?.();
|
|
31245
|
+
if (!this.pendingOutboundStaleTimer) {
|
|
31246
|
+
this.pendingOutboundStaleTimer = setTimeout(() => {
|
|
31247
|
+
this.pendingOutboundStaleTimer = null;
|
|
31248
|
+
if (this.pendingOutboundQueue.length === 0) return;
|
|
31249
|
+
const oldest = this.pendingOutboundQueue[0];
|
|
31250
|
+
const staleSec = ((Date.now() - oldest.queuedAt) / 1e3).toFixed(1);
|
|
31251
|
+
const nowStableMs = this.lastScreenChangeAt ? Date.now() - this.lastScreenChangeAt : -1;
|
|
31252
|
+
LOG.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}`);
|
|
31253
|
+
}, _ProviderCliAdapter.STALE_QUEUE_WARN_MS);
|
|
31254
|
+
}
|
|
31229
31255
|
}
|
|
31230
31256
|
shouldQueuePendingOutboundMessage(parsedStatusBeforeSend = null) {
|
|
31231
31257
|
if (this.provider.allowInputDuringGeneration === true) return null;
|
|
@@ -31266,6 +31292,10 @@ ${lastSnapshot}`;
|
|
|
31266
31292
|
try {
|
|
31267
31293
|
await this.sendMessageNow(next.content, false, next.meshTaskId);
|
|
31268
31294
|
this.pendingOutboundQueue.shift();
|
|
31295
|
+
if (this.pendingOutboundQueue.length === 0 && this.pendingOutboundStaleTimer) {
|
|
31296
|
+
clearTimeout(this.pendingOutboundStaleTimer);
|
|
31297
|
+
this.pendingOutboundStaleTimer = null;
|
|
31298
|
+
}
|
|
31269
31299
|
this.onStatusChange?.();
|
|
31270
31300
|
} catch (error) {
|
|
31271
31301
|
LOG.warn("CLI", `[${this.cliType}] queued outbound flush failed: ${error?.message || error}`);
|
|
@@ -31597,6 +31627,10 @@ ${lastSnapshot}`;
|
|
|
31597
31627
|
clearTimeout(this.pendingOutboundFlushTimer);
|
|
31598
31628
|
this.pendingOutboundFlushTimer = null;
|
|
31599
31629
|
}
|
|
31630
|
+
if (this.pendingOutboundStaleTimer) {
|
|
31631
|
+
clearTimeout(this.pendingOutboundStaleTimer);
|
|
31632
|
+
this.pendingOutboundStaleTimer = null;
|
|
31633
|
+
}
|
|
31600
31634
|
this.pendingOutboundQueue = [];
|
|
31601
31635
|
this.pendingOutboundFlushInFlight = false;
|
|
31602
31636
|
if (this.ptyProcess) {
|
|
@@ -31625,6 +31659,10 @@ ${lastSnapshot}`;
|
|
|
31625
31659
|
clearTimeout(this.pendingOutboundFlushTimer);
|
|
31626
31660
|
this.pendingOutboundFlushTimer = null;
|
|
31627
31661
|
}
|
|
31662
|
+
if (this.pendingOutboundStaleTimer) {
|
|
31663
|
+
clearTimeout(this.pendingOutboundStaleTimer);
|
|
31664
|
+
this.pendingOutboundStaleTimer = null;
|
|
31665
|
+
}
|
|
31628
31666
|
this.pendingOutboundQueue = [];
|
|
31629
31667
|
this.pendingOutboundFlushInFlight = false;
|
|
31630
31668
|
if (this.ptyProcess) {
|
|
@@ -52321,7 +52359,12 @@ ${buttons.join("\n")}`;
|
|
|
52321
52359
|
fcFinalSummary = extractFinalSummaryFromMessages(evidence.messages);
|
|
52322
52360
|
} catch {
|
|
52323
52361
|
}
|
|
52324
|
-
const
|
|
52362
|
+
const synthTiming = resolveTranscriptAuthorityProfile(this.provider).timing;
|
|
52363
|
+
const missingEvidence = (synthTiming === "floor" || synthTiming === "hold" || fcEvidenceSource === "external-native") && !fcFinalSummary;
|
|
52364
|
+
if (missingEvidence && synthTiming === "hold") {
|
|
52365
|
+
LOG.info("CLI", `[${this.type}] ${reason} held: hold-class transcript not yet landed (source=${fcEvidenceSource})`);
|
|
52366
|
+
return false;
|
|
52367
|
+
}
|
|
52325
52368
|
const hasMeshContext = !!(this.settings.meshNodeFor || this.settings.meshActiveTaskId || this.settings.launchedByCoordinator);
|
|
52326
52369
|
if (missingEvidence && !hasMeshContext) {
|
|
52327
52370
|
LOG.info("CLI", `[${this.type}] ${reason} suppressed: missing final assistant evidence, no mesh context (source=${fcEvidenceSource})`);
|