@adhdev/daemon-standalone 1.0.55 → 1.0.56-rc.2
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
CHANGED
|
@@ -31423,9 +31423,9 @@ var require_streamx = __commonJS({
|
|
|
31423
31423
|
}
|
|
31424
31424
|
});
|
|
31425
31425
|
|
|
31426
|
-
//
|
|
31426
|
+
// ../../node_modules/tar-stream/node_modules/b4a/index.js
|
|
31427
31427
|
var require_b4a2 = __commonJS({
|
|
31428
|
-
"
|
|
31428
|
+
"../../node_modules/tar-stream/node_modules/b4a/index.js"(exports2, module2) {
|
|
31429
31429
|
"use strict";
|
|
31430
31430
|
function isBuffer(value) {
|
|
31431
31431
|
return Buffer.isBuffer(value) || value instanceof Uint8Array;
|
|
@@ -31581,9 +31581,9 @@ var require_b4a2 = __commonJS({
|
|
|
31581
31581
|
}
|
|
31582
31582
|
});
|
|
31583
31583
|
|
|
31584
|
-
//
|
|
31584
|
+
// ../../node_modules/tar-stream/headers.js
|
|
31585
31585
|
var require_headers = __commonJS({
|
|
31586
|
-
"
|
|
31586
|
+
"../../node_modules/tar-stream/headers.js"(exports2) {
|
|
31587
31587
|
"use strict";
|
|
31588
31588
|
var b4a = require_b4a2();
|
|
31589
31589
|
var ZEROS = "0000000000000000000";
|
|
@@ -31844,9 +31844,9 @@ var require_headers = __commonJS({
|
|
|
31844
31844
|
}
|
|
31845
31845
|
});
|
|
31846
31846
|
|
|
31847
|
-
//
|
|
31847
|
+
// ../../node_modules/tar-stream/extract.js
|
|
31848
31848
|
var require_extract = __commonJS({
|
|
31849
|
-
"
|
|
31849
|
+
"../../node_modules/tar-stream/extract.js"(exports2, module2) {
|
|
31850
31850
|
"use strict";
|
|
31851
31851
|
var { Writable, Readable, getStreamError } = require_streamx();
|
|
31852
31852
|
var FIFO = require_fast_fifo();
|
|
@@ -32189,9 +32189,9 @@ var require_extract = __commonJS({
|
|
|
32189
32189
|
}
|
|
32190
32190
|
});
|
|
32191
32191
|
|
|
32192
|
-
//
|
|
32192
|
+
// ../../node_modules/tar-stream/constants.js
|
|
32193
32193
|
var require_constants = __commonJS({
|
|
32194
|
-
"
|
|
32194
|
+
"../../node_modules/tar-stream/constants.js"(exports2, module2) {
|
|
32195
32195
|
"use strict";
|
|
32196
32196
|
var constants = {
|
|
32197
32197
|
// just for envs without fs
|
|
@@ -32210,9 +32210,9 @@ var require_constants = __commonJS({
|
|
|
32210
32210
|
}
|
|
32211
32211
|
});
|
|
32212
32212
|
|
|
32213
|
-
//
|
|
32213
|
+
// ../../node_modules/tar-stream/pack.js
|
|
32214
32214
|
var require_pack = __commonJS({
|
|
32215
|
-
"
|
|
32215
|
+
"../../node_modules/tar-stream/pack.js"(exports2, module2) {
|
|
32216
32216
|
"use strict";
|
|
32217
32217
|
var { Readable, Writable, getStreamError } = require_streamx();
|
|
32218
32218
|
var b4a = require_b4a2();
|
|
@@ -32445,9 +32445,9 @@ var require_pack = __commonJS({
|
|
|
32445
32445
|
}
|
|
32446
32446
|
});
|
|
32447
32447
|
|
|
32448
|
-
//
|
|
32448
|
+
// ../../node_modules/tar-stream/index.js
|
|
32449
32449
|
var require_tar_stream = __commonJS({
|
|
32450
|
-
"
|
|
32450
|
+
"../../node_modules/tar-stream/index.js"(exports2) {
|
|
32451
32451
|
"use strict";
|
|
32452
32452
|
exports2.extract = require_extract();
|
|
32453
32453
|
exports2.pack = require_pack();
|
|
@@ -32690,9 +32690,9 @@ var require_pump = __commonJS({
|
|
|
32690
32690
|
}
|
|
32691
32691
|
});
|
|
32692
32692
|
|
|
32693
|
-
//
|
|
32693
|
+
// ../../node_modules/tar-fs/index.js
|
|
32694
32694
|
var require_tar_fs = __commonJS({
|
|
32695
|
-
"
|
|
32695
|
+
"../../node_modules/tar-fs/index.js"(exports2) {
|
|
32696
32696
|
"use strict";
|
|
32697
32697
|
var tar = require_tar_stream();
|
|
32698
32698
|
var pump = require_pump();
|
|
@@ -36610,10 +36610,10 @@ var require_dist3 = __commonJS({
|
|
|
36610
36610
|
}
|
|
36611
36611
|
function getDaemonBuildInfo() {
|
|
36612
36612
|
if (cached2) return cached2;
|
|
36613
|
-
const commit = readInjected(true ? "
|
|
36614
|
-
const commitShort = readInjected(true ? "
|
|
36615
|
-
const version2 = readInjected(true ? "1.0.
|
|
36616
|
-
const builtAt = readInjected(true ? "2026-08-
|
|
36613
|
+
const commit = readInjected(true ? "d18e98383ad155cd7b5e8060ce3597e1ca15edaf" : void 0) ?? "unknown";
|
|
36614
|
+
const commitShort = readInjected(true ? "d18e9838" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
36615
|
+
const version2 = readInjected(true ? "1.0.56-rc.2" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
36616
|
+
const builtAt = readInjected(true ? "2026-08-18T03:36:51.553Z" : void 0);
|
|
36617
36617
|
cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
|
|
36618
36618
|
return cached2;
|
|
36619
36619
|
}
|
|
@@ -37861,7 +37861,7 @@ var require_dist3 = __commonJS({
|
|
|
37861
37861
|
}
|
|
37862
37862
|
});
|
|
37863
37863
|
function resolveBuildTrack(env2 = process.env) {
|
|
37864
|
-
const injected = true ? "" : void 0;
|
|
37864
|
+
const injected = true ? "preview" : void 0;
|
|
37865
37865
|
const stamped = typeof injected === "string" ? injected.trim() : "";
|
|
37866
37866
|
const raw = (stamped || (env2[BUILD_CHANNEL_ENV_VAR] ?? "").trim()).toLowerCase();
|
|
37867
37867
|
return raw === "preview" || raw === "next" ? "preview" : "stable";
|
|
@@ -47876,9 +47876,23 @@ Next step: ${nextStep}`;
|
|
|
47876
47876
|
LOG2.debug("MeshQueue", `Refusing updateTaskStatus(${taskId} \u2192 ${status}) on mesh ${meshId}: row is terminal (${entry.status}). A late writer (e.g. dispatch-failure requeue) must not resurrect a cancelled/completed/failed task. Pass force to override.`);
|
|
47877
47877
|
return { entry, cascaded: [] };
|
|
47878
47878
|
}
|
|
47879
|
+
const priorStatus = entry.status;
|
|
47879
47880
|
entry.status = status;
|
|
47880
47881
|
MeshRuntimeStore.getInstance().updateQueueEntry(entry);
|
|
47881
47882
|
if (status !== "assigned") endTaskDispatchInFlight(meshId, taskId);
|
|
47883
|
+
if (TERMINAL_TASK_STATUSES.has(status) && !TERMINAL_TASK_STATUSES.has(priorStatus)) {
|
|
47884
|
+
try {
|
|
47885
|
+
proposeTurnCompletion({
|
|
47886
|
+
meshId,
|
|
47887
|
+
taskId,
|
|
47888
|
+
outcome: status,
|
|
47889
|
+
source: "stall_reconcile",
|
|
47890
|
+
sessionId: entry.assignedSessionId,
|
|
47891
|
+
reason: `task_status_terminal:${status}`
|
|
47892
|
+
});
|
|
47893
|
+
} catch {
|
|
47894
|
+
}
|
|
47895
|
+
}
|
|
47882
47896
|
const cascaded = DEPENDENCY_FAILURE_TERMINALS.has(status) ? propagateDependencyFailure(meshId, taskId) : [];
|
|
47883
47897
|
return { entry, cascaded };
|
|
47884
47898
|
});
|
|
@@ -65945,12 +65959,19 @@ ${cleanBody}`;
|
|
|
65945
65959
|
}
|
|
65946
65960
|
const authorityClass = readNonEmptyString(evidence.authorityClass);
|
|
65947
65961
|
const timing = readNonEmptyString(evidence.timing);
|
|
65962
|
+
const evidenceSource = readNonEmptyString(diagnostic.finalAssistantEvidenceSource);
|
|
65963
|
+
const profileDetail = { authorityClass, evidenceSource, timing };
|
|
65948
65964
|
if (authorityClass !== "native-source" && authorityClass !== "pure-pty" || timing !== "floor" && timing !== "hold" && timing !== "immediate") {
|
|
65949
|
-
return { authoritative: false, reason: "non_transcript_authority_profile" };
|
|
65965
|
+
return { authoritative: false, reason: "non_transcript_authority_profile", detail: profileDetail };
|
|
65950
65966
|
}
|
|
65951
|
-
const
|
|
65952
|
-
|
|
65953
|
-
|
|
65967
|
+
const ADMISSIBLE_EVIDENCE_SOURCES = /* @__PURE__ */ new Set([
|
|
65968
|
+
"external-native",
|
|
65969
|
+
"parsed",
|
|
65970
|
+
"native-signal",
|
|
65971
|
+
"cached-summary"
|
|
65972
|
+
]);
|
|
65973
|
+
if (!evidenceSource || !ADMISSIBLE_EVIDENCE_SOURCES.has(evidenceSource)) {
|
|
65974
|
+
return { authoritative: false, reason: "evidence_source_profile_mismatch", detail: profileDetail };
|
|
65954
65975
|
}
|
|
65955
65976
|
const finalSummary = readNonEmptyString(metadataEvent.finalSummary);
|
|
65956
65977
|
const finalContentLength = readFiniteNumber2(evidence.finalContentLength) ?? 0;
|
|
@@ -66447,8 +66468,13 @@ ${cleanBody}`;
|
|
|
66447
66468
|
attempt
|
|
66448
66469
|
});
|
|
66449
66470
|
const heldForRetry = retryEligible && holdCompletionForLiveStateRetry(components, args, eventSessionId, Date.now(), injectMeshSystemMessage);
|
|
66450
|
-
|
|
66451
|
-
|
|
66471
|
+
const authorityDetail = !authority.authoritative && authority.detail ? ` [authorityClass=${authority.detail.authorityClass ?? "none"} evidenceSource=${authority.detail.evidenceSource ?? "none"} timing=${authority.detail.timing ?? "none"}]` : "";
|
|
66472
|
+
LOG2.info("MeshEvents", `Suppressed agent:generating_completed for session ${eventSessionId} (mesh ${args.meshId}): current live evidence remains pending (${live.kind ?? "unknown"}); transcript authority=${authority.authoritative ? "fresh_but_not_newer" : authority.reason}${authorityDetail}${heldForRetry ? " \u2014 bounded content-free retry armed" : ""}`);
|
|
66473
|
+
traceMeshEventDrop(
|
|
66474
|
+
"mid_turn_live_state_pending",
|
|
66475
|
+
traceCtx,
|
|
66476
|
+
`${heldForRetry ? "retry_held" : "dropped"}${authority.authoritative ? "" : ` authority=${authority.reason}${authorityDetail}`}`
|
|
66477
|
+
);
|
|
66452
66478
|
return {
|
|
66453
66479
|
kind: "suppress",
|
|
66454
66480
|
result: {
|
|
@@ -70497,6 +70523,44 @@ ${cleanBody}`;
|
|
|
70497
70523
|
}, `${reason} stale=${Math.round((nowMs - anchorMs) / 6e4)}m`);
|
|
70498
70524
|
}
|
|
70499
70525
|
}
|
|
70526
|
+
function reconcileUnsettledTerminalAttempts(mesh) {
|
|
70527
|
+
const meshId = mesh.id;
|
|
70528
|
+
const terminalRows = getQueue(meshId, { status: ["completed", "failed", "cancelled"] });
|
|
70529
|
+
if (!terminalRows.length) return 0;
|
|
70530
|
+
const store = MeshRuntimeStore.getInstance();
|
|
70531
|
+
const nowMs = Date.now();
|
|
70532
|
+
let settled = 0;
|
|
70533
|
+
for (const row of terminalRows) {
|
|
70534
|
+
const attempt = (() => {
|
|
70535
|
+
try {
|
|
70536
|
+
return store.getCurrentTurnAttempt(meshId, row.id);
|
|
70537
|
+
} catch {
|
|
70538
|
+
return null;
|
|
70539
|
+
}
|
|
70540
|
+
})();
|
|
70541
|
+
if (!attempt || attempt.terminalOutcome || isTerminalTurnStage(attempt.stage)) continue;
|
|
70542
|
+
const anchor = Date.parse(attempt.updatedAt || attempt.createdAt || "");
|
|
70543
|
+
if (!Number.isFinite(anchor) || nowMs - anchor < UNSETTLED_ATTEMPT_GRACE_MS) continue;
|
|
70544
|
+
const outcome = row.status === "completed" ? "completed" : row.status === "cancelled" ? "cancelled" : "failed";
|
|
70545
|
+
LOG2.warn("MeshReconcile", `Unsettled attempt safety net: task ${row.id} on mesh ${meshId} is terminal (${row.status}) but attempt ${attempt.attemptId} is still ${attempt.stage} (lease=${attempt.leaseDeadlineMs ?? "null"}, attempt idle ${Math.round((nowMs - anchor) / 1e3)}s) \u2014 settling it as ${outcome}. THIS SHOULD NOT HAPPEN: a terminal writer bypassed the updateTaskStatus choke point; find it rather than relying on this net.`);
|
|
70546
|
+
traceMeshEventStage("unsettled_attempt_safety_net", {
|
|
70547
|
+
taskId: row.id,
|
|
70548
|
+
sessionId: attempt.sessionId ?? row.assignedSessionId,
|
|
70549
|
+
nodeId: row.assignedNodeId,
|
|
70550
|
+
meshId,
|
|
70551
|
+
event: "agent:generating_completed"
|
|
70552
|
+
}, `${row.status}->${outcome} stage=${attempt.stage}`);
|
|
70553
|
+
if (reconcileTerminalViaReducer({
|
|
70554
|
+
meshId,
|
|
70555
|
+
taskId: row.id,
|
|
70556
|
+
outcome,
|
|
70557
|
+
source: "stall_reconcile",
|
|
70558
|
+
sessionId: attempt.sessionId ?? row.assignedSessionId,
|
|
70559
|
+
reason: `unsettled_attempt_safety_net:${row.status}`
|
|
70560
|
+
})) settled += 1;
|
|
70561
|
+
}
|
|
70562
|
+
return settled;
|
|
70563
|
+
}
|
|
70500
70564
|
var ASSIGNED_STRANDED_DEADLINE_MS;
|
|
70501
70565
|
var DELIVERED_NO_TURN_DEADLINE_MS;
|
|
70502
70566
|
var NATIVE_SOURCE_ACTIVITY_STALE_MS;
|
|
@@ -70509,6 +70573,7 @@ ${cleanBody}`;
|
|
|
70509
70573
|
var ASSIGNED_IDLE_TRANSCRIPT_COMPLETE_MS;
|
|
70510
70574
|
var assignedIdleFinalAssistantSince;
|
|
70511
70575
|
var ZOMBIE_ASSIGNED_MIN_AGE_MS;
|
|
70576
|
+
var UNSETTLED_ATTEMPT_GRACE_MS;
|
|
70512
70577
|
var init_mesh_reconcile_stranded_dispatch = __esm2({
|
|
70513
70578
|
"src/mesh/mesh-reconcile-stranded-dispatch.ts"() {
|
|
70514
70579
|
"use strict";
|
|
@@ -70541,6 +70606,7 @@ ${cleanBody}`;
|
|
|
70541
70606
|
ASSIGNED_IDLE_TRANSCRIPT_COMPLETE_MS = 8e3;
|
|
70542
70607
|
assignedIdleFinalAssistantSince = /* @__PURE__ */ new Map();
|
|
70543
70608
|
ZOMBIE_ASSIGNED_MIN_AGE_MS = 30 * 60 * 1e3;
|
|
70609
|
+
UNSETTLED_ATTEMPT_GRACE_MS = 60 * 1e3;
|
|
70544
70610
|
}
|
|
70545
70611
|
});
|
|
70546
70612
|
function scheduleUnresolvedForwardNudge(components) {
|
|
@@ -70715,6 +70781,11 @@ ${cleanBody}`;
|
|
|
70715
70781
|
} catch (e) {
|
|
70716
70782
|
LOG2.warn("MeshReconcile", `Assigned-zombie sweep failed for mesh ${mesh.id}: ${e?.message || e}`);
|
|
70717
70783
|
}
|
|
70784
|
+
try {
|
|
70785
|
+
reconcileUnsettledTerminalAttempts(mesh);
|
|
70786
|
+
} catch (e) {
|
|
70787
|
+
LOG2.warn("MeshReconcile", `Unsettled-attempt safety net failed for mesh ${mesh.id}: ${e?.message || e}`);
|
|
70788
|
+
}
|
|
70718
70789
|
}
|
|
70719
70790
|
}
|
|
70720
70791
|
for (const mesh of listMeshes()) {
|