@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/index.mjs CHANGED
@@ -404,10 +404,10 @@ function readInjected(value) {
404
404
  }
405
405
  function getDaemonBuildInfo() {
406
406
  if (cached) return cached;
407
- const commit = readInjected(true ? "a503a00d57fbcdc84cd252c6d5caee90cfae6706" : void 0) ?? "unknown";
408
- const commitShort = readInjected(true ? "a503a00d" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
409
- const version = readInjected(true ? "0.9.82-rc.484" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
410
- const builtAt = readInjected(true ? "2026-07-08T13:24:54.463Z" : void 0);
407
+ const commit = readInjected(true ? "ddf2eb6eafcf949165edfda2c3cf7c77597fa6f8" : void 0) ?? "unknown";
408
+ const commitShort = readInjected(true ? "ddf2eb6e" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
409
+ const version = readInjected(true ? "0.9.82-rc.485" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
410
+ const builtAt = readInjected(true ? "2026-07-08T15:14:11.978Z" : void 0);
411
411
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
412
412
  return cached;
413
413
  }
@@ -15358,6 +15358,24 @@ function getMeshWithCache(components, meshId) {
15358
15358
  if (!cachedMesh) return localMesh;
15359
15359
  return mergeInlineCacheOnlyNodes(localMesh, cachedMesh);
15360
15360
  }
15361
+ function bootstrapEpochMs(bootstrap) {
15362
+ const raw = readNonEmptyString2(bootstrap?.startedAt) || readNonEmptyString2(bootstrap?.completedAt);
15363
+ if (!raw) return 0;
15364
+ const parsed = Date.parse(raw);
15365
+ return Number.isFinite(parsed) ? parsed : 0;
15366
+ }
15367
+ function inlineBootstrapIsFresher(inlineBootstrap, configBootstrap) {
15368
+ const inlineStatus = readNonEmptyString2(inlineBootstrap?.status);
15369
+ if (!inlineStatus) return false;
15370
+ const configStatus = readNonEmptyString2(configBootstrap?.status);
15371
+ const inlineTerminal = BOOTSTRAP_TERMINAL_STATUSES.has(inlineStatus);
15372
+ const configTerminal = !!configStatus && BOOTSTRAP_TERMINAL_STATUSES.has(configStatus);
15373
+ if (configTerminal) {
15374
+ return inlineTerminal && inlineStatus !== configStatus && bootstrapEpochMs(inlineBootstrap) > bootstrapEpochMs(configBootstrap);
15375
+ }
15376
+ if (inlineTerminal) return true;
15377
+ return bootstrapEpochMs(inlineBootstrap) > bootstrapEpochMs(configBootstrap);
15378
+ }
15361
15379
  function mergeInlineCacheOnlyNodes(localMesh, cachedMesh) {
15362
15380
  const localNodes = Array.isArray(localMesh?.nodes) ? localMesh.nodes : [];
15363
15381
  const cachedNodes = Array.isArray(cachedMesh?.nodes) ? cachedMesh.nodes : [];
@@ -15374,8 +15392,8 @@ function mergeInlineCacheOnlyNodes(localMesh, cachedMesh) {
15374
15392
  const localId = readMeshNodeId(localNode);
15375
15393
  if (!localId) continue;
15376
15394
  const inlineMatch = cachedNodes.find((cachedNode) => meshNodeIdMatches(cachedNode, localId));
15377
- const inlineBootstrapStatus = readNonEmptyString2(inlineMatch?.worktreeBootstrap?.status);
15378
- if (!inlineMatch || !inlineBootstrapStatus) continue;
15395
+ if (!inlineMatch) continue;
15396
+ if (!inlineBootstrapIsFresher(inlineMatch.worktreeBootstrap, localNode.worktreeBootstrap)) continue;
15379
15397
  if (!overlaid) {
15380
15398
  overlaidLocalNodes = [...localNodes];
15381
15399
  overlaid = true;
@@ -16524,7 +16542,7 @@ function runIdleMaintenanceThenAssignQueue(components, args) {
16524
16542
  });
16525
16543
  });
16526
16544
  }
16527
- var 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;
16545
+ var 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;
16528
16546
  var init_mesh_queue_assignment = __esm({
16529
16547
  "src/mesh/mesh-queue-assignment.ts"() {
16530
16548
  "use strict";
@@ -16551,6 +16569,7 @@ var init_mesh_queue_assignment = __esm({
16551
16569
  init_mesh_task_inflight();
16552
16570
  IDLE_AUTO_FAST_FORWARD_THROTTLE_MS = 30 * 60 * 1e3;
16553
16571
  idleAutoFastForwardLastAttempt = /* @__PURE__ */ new Map();
16572
+ BOOTSTRAP_TERMINAL_STATUSES = /* @__PURE__ */ new Set(["complete", "failed"]);
16554
16573
  DISPATCH_CONFIRM_TIMEOUT_MS = 12e4;
16555
16574
  DISPATCH_CONNECT_TIMEOUT_MS = MESH_CONNECT_TIMEOUT_MS;
16556
16575
  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
- if (pollDetect === "idle" && !pollModal) {
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;