@adhdev/daemon-core 0.9.82-rc.484 → 0.9.82-rc.485
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 +3 -0
- package/dist/index.js +66 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +66 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/cli-adapters/provider-cli-adapter.ts +70 -1
- package/src/mesh/mesh-queue-assignment.ts +63 -13
|
@@ -57,6 +57,7 @@ export declare class ProviderCliAdapter implements CliAdapter {
|
|
|
57
57
|
private lastScreenSnapshot;
|
|
58
58
|
private lastScreenText;
|
|
59
59
|
private lastScreenSnapshotReadAt;
|
|
60
|
+
private staticIdlePollStreak;
|
|
60
61
|
private serverConn;
|
|
61
62
|
private logBuffer;
|
|
62
63
|
private pendingOutboundQueue;
|
|
@@ -106,6 +107,7 @@ export declare class ProviderCliAdapter implements CliAdapter {
|
|
|
106
107
|
private static readonly MAX_ACCUMULATED_BUFFER;
|
|
107
108
|
private parsedStatusCache;
|
|
108
109
|
private static readonly SCREEN_SNAPSHOT_MIN_INTERVAL_MS;
|
|
110
|
+
private static readonly STATIC_IDLE_POLL_CONFIRM_COUNT;
|
|
109
111
|
private readonly providerResolutionMeta;
|
|
110
112
|
private getBufferState;
|
|
111
113
|
private recordBoundedAppendDrop;
|
|
@@ -119,6 +121,7 @@ export declare class ProviderCliAdapter implements CliAdapter {
|
|
|
119
121
|
private shouldUseFullProviderTranscriptContext;
|
|
120
122
|
private getIdleFinishConfirmMs;
|
|
121
123
|
private getStatusActivityHoldMs;
|
|
124
|
+
private isAutonomousMeshSession;
|
|
122
125
|
private readonly timeouts;
|
|
123
126
|
private readonly approvalKeys;
|
|
124
127
|
private readonly sendDelayMs;
|
package/dist/index.js
CHANGED
|
@@ -409,10 +409,10 @@ function readInjected(value) {
|
|
|
409
409
|
}
|
|
410
410
|
function getDaemonBuildInfo() {
|
|
411
411
|
if (cached) return cached;
|
|
412
|
-
const commit = readInjected(true ? "
|
|
413
|
-
const commitShort = readInjected(true ? "
|
|
414
|
-
const version = readInjected(true ? "0.9.82-rc.
|
|
415
|
-
const builtAt = readInjected(true ? "2026-07-
|
|
412
|
+
const commit = readInjected(true ? "ddf2eb6eafcf949165edfda2c3cf7c77597fa6f8" : void 0) ?? "unknown";
|
|
413
|
+
const commitShort = readInjected(true ? "ddf2eb6e" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
414
|
+
const version = readInjected(true ? "0.9.82-rc.485" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
415
|
+
const builtAt = readInjected(true ? "2026-07-08T15:14:11.978Z" : void 0);
|
|
416
416
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
417
417
|
return cached;
|
|
418
418
|
}
|
|
@@ -15355,6 +15355,24 @@ function getMeshWithCache(components, meshId) {
|
|
|
15355
15355
|
if (!cachedMesh) return localMesh;
|
|
15356
15356
|
return mergeInlineCacheOnlyNodes(localMesh, cachedMesh);
|
|
15357
15357
|
}
|
|
15358
|
+
function bootstrapEpochMs(bootstrap) {
|
|
15359
|
+
const raw = readNonEmptyString2(bootstrap?.startedAt) || readNonEmptyString2(bootstrap?.completedAt);
|
|
15360
|
+
if (!raw) return 0;
|
|
15361
|
+
const parsed = Date.parse(raw);
|
|
15362
|
+
return Number.isFinite(parsed) ? parsed : 0;
|
|
15363
|
+
}
|
|
15364
|
+
function inlineBootstrapIsFresher(inlineBootstrap, configBootstrap) {
|
|
15365
|
+
const inlineStatus = readNonEmptyString2(inlineBootstrap?.status);
|
|
15366
|
+
if (!inlineStatus) return false;
|
|
15367
|
+
const configStatus = readNonEmptyString2(configBootstrap?.status);
|
|
15368
|
+
const inlineTerminal = BOOTSTRAP_TERMINAL_STATUSES.has(inlineStatus);
|
|
15369
|
+
const configTerminal = !!configStatus && BOOTSTRAP_TERMINAL_STATUSES.has(configStatus);
|
|
15370
|
+
if (configTerminal) {
|
|
15371
|
+
return inlineTerminal && inlineStatus !== configStatus && bootstrapEpochMs(inlineBootstrap) > bootstrapEpochMs(configBootstrap);
|
|
15372
|
+
}
|
|
15373
|
+
if (inlineTerminal) return true;
|
|
15374
|
+
return bootstrapEpochMs(inlineBootstrap) > bootstrapEpochMs(configBootstrap);
|
|
15375
|
+
}
|
|
15358
15376
|
function mergeInlineCacheOnlyNodes(localMesh, cachedMesh) {
|
|
15359
15377
|
const localNodes = Array.isArray(localMesh?.nodes) ? localMesh.nodes : [];
|
|
15360
15378
|
const cachedNodes = Array.isArray(cachedMesh?.nodes) ? cachedMesh.nodes : [];
|
|
@@ -15371,8 +15389,8 @@ function mergeInlineCacheOnlyNodes(localMesh, cachedMesh) {
|
|
|
15371
15389
|
const localId = readMeshNodeId(localNode);
|
|
15372
15390
|
if (!localId) continue;
|
|
15373
15391
|
const inlineMatch = cachedNodes.find((cachedNode) => meshNodeIdMatches(cachedNode, localId));
|
|
15374
|
-
|
|
15375
|
-
if (!inlineMatch
|
|
15392
|
+
if (!inlineMatch) continue;
|
|
15393
|
+
if (!inlineBootstrapIsFresher(inlineMatch.worktreeBootstrap, localNode.worktreeBootstrap)) continue;
|
|
15376
15394
|
if (!overlaid) {
|
|
15377
15395
|
overlaidLocalNodes = [...localNodes];
|
|
15378
15396
|
overlaid = true;
|
|
@@ -16521,7 +16539,7 @@ function runIdleMaintenanceThenAssignQueue(components, args) {
|
|
|
16521
16539
|
});
|
|
16522
16540
|
});
|
|
16523
16541
|
}
|
|
16524
|
-
var import_fs13, IDLE_AUTO_FAST_FORWARD_THROTTLE_MS, idleAutoFastForwardLastAttempt, DISPATCH_CONFIRM_TIMEOUT_MS, DISPATCH_CONNECT_TIMEOUT_MS, dispatchWarmupGetterMissingWarned, LOCAL_LAUNCH_READY_TIMEOUT_MS, LOCAL_LAUNCH_READY_POLL_MS, autoLaunchInProgress, autoLaunchCooldownUntil, AUTO_LAUNCH_COOLDOWN_MS, AUTO_LAUNCH_AWAIT_CLAIM_MS, AUTO_LAUNCH_AWAIT_CLAIM_BACKOFF_CAP_CYCLES, AUTO_LAUNCH_REMOTE_IDLE_TTL_MS, autoLaunchAwaitClaimBackoff, lastAutoLaunchLedgerKey, AUTO_LAUNCH_LEDGER_DEDUP_MAX, ACTIONABLE_SKIP_REASON_PREFIXES, TRANSIENT_TARGET_NODE_BOOTSTRAP_PENDING_REASON, lastActionableSkipNotified;
|
|
16542
|
+
var import_fs13, IDLE_AUTO_FAST_FORWARD_THROTTLE_MS, idleAutoFastForwardLastAttempt, BOOTSTRAP_TERMINAL_STATUSES, DISPATCH_CONFIRM_TIMEOUT_MS, DISPATCH_CONNECT_TIMEOUT_MS, dispatchWarmupGetterMissingWarned, LOCAL_LAUNCH_READY_TIMEOUT_MS, LOCAL_LAUNCH_READY_POLL_MS, autoLaunchInProgress, autoLaunchCooldownUntil, AUTO_LAUNCH_COOLDOWN_MS, AUTO_LAUNCH_AWAIT_CLAIM_MS, AUTO_LAUNCH_AWAIT_CLAIM_BACKOFF_CAP_CYCLES, AUTO_LAUNCH_REMOTE_IDLE_TTL_MS, autoLaunchAwaitClaimBackoff, lastAutoLaunchLedgerKey, AUTO_LAUNCH_LEDGER_DEDUP_MAX, ACTIONABLE_SKIP_REASON_PREFIXES, TRANSIENT_TARGET_NODE_BOOTSTRAP_PENDING_REASON, lastActionableSkipNotified;
|
|
16525
16543
|
var init_mesh_queue_assignment = __esm({
|
|
16526
16544
|
"src/mesh/mesh-queue-assignment.ts"() {
|
|
16527
16545
|
"use strict";
|
|
@@ -16549,6 +16567,7 @@ var init_mesh_queue_assignment = __esm({
|
|
|
16549
16567
|
init_mesh_task_inflight();
|
|
16550
16568
|
IDLE_AUTO_FAST_FORWARD_THROTTLE_MS = 30 * 60 * 1e3;
|
|
16551
16569
|
idleAutoFastForwardLastAttempt = /* @__PURE__ */ new Map();
|
|
16570
|
+
BOOTSTRAP_TERMINAL_STATUSES = /* @__PURE__ */ new Set(["complete", "failed"]);
|
|
16552
16571
|
DISPATCH_CONFIRM_TIMEOUT_MS = 12e4;
|
|
16553
16572
|
DISPATCH_CONNECT_TIMEOUT_MS = MESH_CONNECT_TIMEOUT_MS;
|
|
16554
16573
|
dispatchWarmupGetterMissingWarned = /* @__PURE__ */ new Set();
|
|
@@ -25495,6 +25514,13 @@ var init_provider_cli_adapter = __esm({
|
|
|
25495
25514
|
lastScreenSnapshot = "";
|
|
25496
25515
|
lastScreenText = "";
|
|
25497
25516
|
lastScreenSnapshotReadAt = Number.NEGATIVE_INFINITY;
|
|
25517
|
+
// (FALSEIDLE Path-C) Count of CONSECUTIVE getStatus polls that observed a
|
|
25518
|
+
// gate-eligible static-idle screen (detect=idle, no modal, quiet, empty
|
|
25519
|
+
// partial buffer). For a mesh/autonomous worker we require several such
|
|
25520
|
+
// polls in a row before confirming static-idle (see getStatus), so a
|
|
25521
|
+
// single momentarily-silent point-sample of a still-live turn cannot flip
|
|
25522
|
+
// it. Reset to 0 the instant any poll is ineligible.
|
|
25523
|
+
staticIdlePollStreak = 0;
|
|
25498
25524
|
// Server log forwarding
|
|
25499
25525
|
serverConn = null;
|
|
25500
25526
|
logBuffer = [];
|
|
@@ -25560,6 +25586,13 @@ var init_provider_cli_adapter = __esm({
|
|
|
25560
25586
|
static MAX_ACCUMULATED_BUFFER = 262144;
|
|
25561
25587
|
parsedStatusCache = null;
|
|
25562
25588
|
static SCREEN_SNAPSHOT_MIN_INTERVAL_MS = 250;
|
|
25589
|
+
// (FALSEIDLE Path-C) Consecutive gate-eligible getStatus polls a mesh/autonomous
|
|
25590
|
+
// session must show before the poll-static-idle confirm fires. 2 = one extra
|
|
25591
|
+
// status tick of hysteresis: enough to reject a single momentary-silence
|
|
25592
|
+
// point-sample of a still-live turn, cheap enough not to materially delay a
|
|
25593
|
+
// genuine boot-wedge release (the wedge screen is stably static, so it clears
|
|
25594
|
+
// every consecutive poll and confirms on the 2nd).
|
|
25595
|
+
static STATIC_IDLE_POLL_CONFIRM_COUNT = 2;
|
|
25563
25596
|
providerResolutionMeta;
|
|
25564
25597
|
getBufferState() {
|
|
25565
25598
|
const build = (droppedChars, maxChars) => droppedChars > 0 ? { truncated: true, droppedChars, maxChars } : void 0;
|
|
@@ -25631,6 +25664,18 @@ ${lastSnapshot}`;
|
|
|
25631
25664
|
getStatusActivityHoldMs() {
|
|
25632
25665
|
return this.timeouts.statusActivityHold;
|
|
25633
25666
|
}
|
|
25667
|
+
// (FALSEIDLE Path-C) Whether this session is a mesh worker or coordinator's
|
|
25668
|
+
// own autonomous session. Mirrors CliProviderInstance.isAutonomousMeshSession
|
|
25669
|
+
// over the runtimeSettings the instance mirrors down via updateRuntimeSettings
|
|
25670
|
+
// (meshNodeFor / meshActiveTaskId / meshNodeId / launchedByCoordinator =
|
|
25671
|
+
// isMeshWorkerSession, plus meshCoordinatorFor for the coordinator's own turn).
|
|
25672
|
+
// Such a session has no human at the keyboard to correct a premature idle, so
|
|
25673
|
+
// the poll-static-idle confirm is debounced for it (multiple consecutive idle
|
|
25674
|
+
// polls) rather than fired on a single point-sample.
|
|
25675
|
+
isAutonomousMeshSession() {
|
|
25676
|
+
const s2 = this.runtimeSettings;
|
|
25677
|
+
return !!(s2?.meshNodeFor || s2?.meshActiveTaskId || s2?.meshNodeId || s2?.launchedByCoordinator || s2?.meshCoordinatorFor);
|
|
25678
|
+
}
|
|
25634
25679
|
// Resolved timeouts
|
|
25635
25680
|
timeouts;
|
|
25636
25681
|
// Provider approval key mapping
|
|
@@ -26018,14 +26063,27 @@ ${lastSnapshot}`;
|
|
|
26018
26063
|
if (allowParse && this.engine.currentStatus === "generating" && !this.engine.currentTurnScope && !this.engine.activeModal) {
|
|
26019
26064
|
const now = Date.now();
|
|
26020
26065
|
const quietForMs = this.lastNonEmptyOutputAt ? now - this.lastNonEmptyOutputAt : Number.MAX_SAFE_INTEGER;
|
|
26066
|
+
let eligible = false;
|
|
26021
26067
|
if (quietForMs >= this.getStatusActivityHoldMs()) {
|
|
26022
26068
|
const screenText = this.terminalScreen.getText();
|
|
26023
26069
|
const pollDetect = this.runDetectStatus(screenText || this.recentOutputBuffer);
|
|
26024
26070
|
const pollModal = this.runParseApproval(screenText) || this.runParseApproval(this.recentOutputBuffer);
|
|
26025
|
-
|
|
26071
|
+
const partial = this.getPartialResponse();
|
|
26072
|
+
const partialPending = typeof partial === "string" && partial.trim().length > 0;
|
|
26073
|
+
eligible = pollDetect === "idle" && !pollModal && !partialPending;
|
|
26074
|
+
}
|
|
26075
|
+
if (eligible) {
|
|
26076
|
+
const requiredStreak = this.isAutonomousMeshSession() ? _ProviderCliAdapter.STATIC_IDLE_POLL_CONFIRM_COUNT : 1;
|
|
26077
|
+
this.staticIdlePollStreak += 1;
|
|
26078
|
+
if (this.staticIdlePollStreak >= requiredStreak) {
|
|
26026
26079
|
this.engine.confirmPollStaticIdle("poll_static_idle");
|
|
26080
|
+
this.staticIdlePollStreak = 0;
|
|
26027
26081
|
}
|
|
26082
|
+
} else {
|
|
26083
|
+
this.staticIdlePollStreak = 0;
|
|
26028
26084
|
}
|
|
26085
|
+
} else {
|
|
26086
|
+
this.staticIdlePollStreak = 0;
|
|
26029
26087
|
}
|
|
26030
26088
|
let effectiveStatus = this.projectEffectiveStatus(startupModal);
|
|
26031
26089
|
let effectiveModal = startupModal || this.engine.activeModal;
|