@adhdev/daemon-core 0.9.82-rc.341 → 0.9.82-rc.343
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 +60 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +60 -10
- package/dist/index.mjs.map +1 -1
- package/dist/providers/spec/fsm-driver.d.ts +16 -0
- package/package.json +2 -2
- package/src/mesh/mesh-events-coordinator.ts +15 -1
- package/src/providers/spec/fsm-driver.ts +67 -17
package/dist/index.mjs
CHANGED
|
@@ -311,10 +311,10 @@ function readInjected(value) {
|
|
|
311
311
|
}
|
|
312
312
|
function getDaemonBuildInfo() {
|
|
313
313
|
if (cached) return cached;
|
|
314
|
-
const commit = readInjected(true ? "
|
|
315
|
-
const commitShort = readInjected(true ? "
|
|
316
|
-
const version = readInjected(true ? "0.9.82-rc.
|
|
317
|
-
const builtAt = readInjected(true ? "2026-06-
|
|
314
|
+
const commit = readInjected(true ? "9a4c1af9349a342fc63d8d42746747a6feda8f08" : void 0) ?? "unknown";
|
|
315
|
+
const commitShort = readInjected(true ? "9a4c1af9" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
316
|
+
const version = readInjected(true ? "0.9.82-rc.343" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
317
|
+
const builtAt = readInjected(true ? "2026-06-21T11:25:17.034Z" : void 0);
|
|
318
318
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
319
319
|
return cached;
|
|
320
320
|
}
|
|
@@ -9790,7 +9790,16 @@ function tryAssignQueueTask(components, meshId, nodeId, sessionId, providerType)
|
|
|
9790
9790
|
}).catch((e) => {
|
|
9791
9791
|
LOG.error("MeshQueue", `Failed to dispatch task locally to node ${nodeId}: ${e?.message}`);
|
|
9792
9792
|
updateSessionDeliveryStatus(delivery.id, "failed", { lastError: e?.message, incrementAttempt: true });
|
|
9793
|
-
updateTaskStatus(meshId, task.id, "
|
|
9793
|
+
updateTaskStatus(meshId, task.id, "pending");
|
|
9794
|
+
try {
|
|
9795
|
+
appendLedgerEntry(meshId, {
|
|
9796
|
+
kind: "dispatch_failed",
|
|
9797
|
+
nodeId,
|
|
9798
|
+
sessionId,
|
|
9799
|
+
payload: { taskId: task.id, deliveryId: delivery.id, error: e?.message, retryable: true }
|
|
9800
|
+
});
|
|
9801
|
+
} catch {
|
|
9802
|
+
}
|
|
9794
9803
|
});
|
|
9795
9804
|
return true;
|
|
9796
9805
|
}
|
|
@@ -31622,6 +31631,8 @@ function countNewlines(s) {
|
|
|
31622
31631
|
return n;
|
|
31623
31632
|
}
|
|
31624
31633
|
var SUBMIT_DELAY_FLOOR_MS = 200;
|
|
31634
|
+
var WIN32_SUBMIT_RESEND_GAP_MS = 350;
|
|
31635
|
+
var WIN32_SUBMIT_MAX_RESENDS = 14;
|
|
31625
31636
|
function resolveSubmitDelayMs(specBeforeSubmit, text) {
|
|
31626
31637
|
const lines = countNewlines(text);
|
|
31627
31638
|
const linesBonus = Math.min(800, lines * 80);
|
|
@@ -31673,6 +31684,10 @@ var FsmDriver = class {
|
|
|
31673
31684
|
* after a re-prime we don't re-inject until the screen changes (which
|
|
31674
31685
|
* resets the stall reference) or another full stall window lapses. */
|
|
31675
31686
|
lastRefocusAt = 0;
|
|
31687
|
+
/** Timer driving the win32 verification-based submit resend loop (see
|
|
31688
|
+
* WIN32_SUBMIT_* and scheduleWin32Submit). Re-arms itself until the FSM
|
|
31689
|
+
* leaves idle (submitted) or the resend budget is spent. */
|
|
31690
|
+
win32SubmitTimer = null;
|
|
31676
31691
|
currentEval = null;
|
|
31677
31692
|
stateHistory = [];
|
|
31678
31693
|
prevStateAt = 0;
|
|
@@ -31789,6 +31804,10 @@ var FsmDriver = class {
|
|
|
31789
31804
|
clearTimeout(this.stallTimer);
|
|
31790
31805
|
this.stallTimer = null;
|
|
31791
31806
|
}
|
|
31807
|
+
if (this.win32SubmitTimer) {
|
|
31808
|
+
clearTimeout(this.win32SubmitTimer);
|
|
31809
|
+
this.win32SubmitTimer = null;
|
|
31810
|
+
}
|
|
31792
31811
|
this.specWatcher?.close();
|
|
31793
31812
|
this.adapter.kill();
|
|
31794
31813
|
}
|
|
@@ -32201,11 +32220,8 @@ var FsmDriver = class {
|
|
|
32201
32220
|
const perChar = sm.delay_ms_per_char ?? 0;
|
|
32202
32221
|
const beforeSubmit = resolveSubmitDelayMs(sm.delay_ms_before_submit, text);
|
|
32203
32222
|
if (process.platform === "win32") {
|
|
32204
|
-
|
|
32205
|
-
|
|
32206
|
-
} else {
|
|
32207
|
-
this.adapter.send_keys(text + sm.submit_key);
|
|
32208
|
-
}
|
|
32223
|
+
this.adapter.send_keys(text);
|
|
32224
|
+
this.scheduleWin32Submit(sm.submit_key, beforeSubmit);
|
|
32209
32225
|
return;
|
|
32210
32226
|
}
|
|
32211
32227
|
if (perChar === 0) {
|
|
@@ -32225,6 +32241,40 @@ var FsmDriver = class {
|
|
|
32225
32241
|
i += 1;
|
|
32226
32242
|
}, perChar);
|
|
32227
32243
|
}
|
|
32244
|
+
/** The agent's current coarse status, derived from the FSM node we're in. */
|
|
32245
|
+
currentStatus() {
|
|
32246
|
+
const st = stateById(this.spec, this.currentStateId);
|
|
32247
|
+
return st ? statusForState(st) : "idle";
|
|
32248
|
+
}
|
|
32249
|
+
/**
|
|
32250
|
+
* win32 verification-based submit. Sends the submit key, waits a gap, and if
|
|
32251
|
+
* the FSM is still 'idle' (the prompt did not submit — the CR was absorbed as
|
|
32252
|
+
* a multiline-paste newline) resends, up to WIN32_SUBMIT_MAX_RESENDS. The
|
|
32253
|
+
* first CR always fires (so a stale/edge status never suppresses the submit);
|
|
32254
|
+
* subsequent resends are gated on still being idle, and stop the instant the
|
|
32255
|
+
* agent leaves idle (submitted → generating / approval). This converges the
|
|
32256
|
+
* nondeterministic multiline window without spamming Enter into the next turn.
|
|
32257
|
+
*/
|
|
32258
|
+
scheduleWin32Submit(submitKey, initialDelayMs) {
|
|
32259
|
+
if (this.win32SubmitTimer) {
|
|
32260
|
+
clearTimeout(this.win32SubmitTimer);
|
|
32261
|
+
this.win32SubmitTimer = null;
|
|
32262
|
+
}
|
|
32263
|
+
const fire = (attempt) => {
|
|
32264
|
+
this.win32SubmitTimer = null;
|
|
32265
|
+
this.adapter.send_keys(submitKey);
|
|
32266
|
+
if (attempt + 1 >= WIN32_SUBMIT_MAX_RESENDS) return;
|
|
32267
|
+
this.win32SubmitTimer = setTimeout(() => {
|
|
32268
|
+
if (this.currentStatus() !== "idle") {
|
|
32269
|
+
this.win32SubmitTimer = null;
|
|
32270
|
+
return;
|
|
32271
|
+
}
|
|
32272
|
+
fire(attempt + 1);
|
|
32273
|
+
}, WIN32_SUBMIT_RESEND_GAP_MS);
|
|
32274
|
+
};
|
|
32275
|
+
if (initialDelayMs > 0) this.win32SubmitTimer = setTimeout(() => fire(0), initialDelayMs);
|
|
32276
|
+
else fire(0);
|
|
32277
|
+
}
|
|
32228
32278
|
handleClickControl(controlId, payload) {
|
|
32229
32279
|
const ctl = (this.spec.control_bar ?? []).find((c) => c.id === controlId);
|
|
32230
32280
|
if (!ctl) return;
|