@adhdev/daemon-core 0.9.82-rc.335 → 0.9.82-rc.337
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 +37 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -21
- package/dist/index.mjs.map +1 -1
- package/dist/mesh/mesh-events-utils.d.ts +19 -0
- package/package.json +2 -2
- package/src/cli-adapters/provider-cli-adapter.ts +43 -34
- package/src/mesh/mesh-events-coordinator.ts +15 -0
- package/src/mesh/mesh-events-utils.ts +46 -0
package/dist/index.js
CHANGED
|
@@ -316,10 +316,10 @@ function readInjected(value) {
|
|
|
316
316
|
}
|
|
317
317
|
function getDaemonBuildInfo() {
|
|
318
318
|
if (cached) return cached;
|
|
319
|
-
const commit = readInjected(true ? "
|
|
320
|
-
const commitShort = readInjected(true ? "
|
|
321
|
-
const version = readInjected(true ? "0.9.82-rc.
|
|
322
|
-
const builtAt = readInjected(true ? "2026-06-
|
|
319
|
+
const commit = readInjected(true ? "587b2d866182a5b6c086d23d9f6cc32d22ca50f5" : void 0) ?? "unknown";
|
|
320
|
+
const commitShort = readInjected(true ? "587b2d86" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
321
|
+
const version = readInjected(true ? "0.9.82-rc.337" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
322
|
+
const builtAt = readInjected(true ? "2026-06-20T06:37:55.432Z" : void 0);
|
|
323
323
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
324
324
|
return cached;
|
|
325
325
|
}
|
|
@@ -7863,6 +7863,26 @@ function readRefineJobId(event) {
|
|
|
7863
7863
|
function readWorkerResultMetadata(event) {
|
|
7864
7864
|
return readRecord4(event.workerResult) || readRecord4(event.meshWorkerResult) || readRecord4(event.structuredResult);
|
|
7865
7865
|
}
|
|
7866
|
+
function resolveMeshSurfacedSessionPreview(metadataEvent) {
|
|
7867
|
+
const workerResult = readWorkerResultMetadata(metadataEvent);
|
|
7868
|
+
const resultRecord = readRecord4(metadataEvent.result);
|
|
7869
|
+
const summaryText = readNonEmptyString2(metadataEvent.finalSummary) || readNonEmptyString2(workerResult?.summary) || readNonEmptyString2(workerResult?.finalSummary) || readNonEmptyString2(resultRecord?.summary) || readNonEmptyString2(resultRecord?.finalSummary);
|
|
7870
|
+
if (!summaryText) return void 0;
|
|
7871
|
+
const truncationSuffix = "...[truncated]";
|
|
7872
|
+
const preview = summaryText.length > MESH_SURFACED_PREVIEW_MAX_CHARS ? `${summaryText.slice(0, MESH_SURFACED_PREVIEW_MAX_CHARS - truncationSuffix.length)}${truncationSuffix}` : summaryText;
|
|
7873
|
+
const timestamp = readEventTimestampValue(metadataEvent.timestamp);
|
|
7874
|
+
return { preview, role: "assistant", receivedAt: timestamp };
|
|
7875
|
+
}
|
|
7876
|
+
function readEventTimestampValue(value) {
|
|
7877
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
7878
|
+
if (typeof value === "string" && value.trim()) {
|
|
7879
|
+
const parsed = Number(value);
|
|
7880
|
+
if (Number.isFinite(parsed)) return parsed;
|
|
7881
|
+
const dateMs = Date.parse(value);
|
|
7882
|
+
if (Number.isFinite(dateMs)) return dateMs;
|
|
7883
|
+
}
|
|
7884
|
+
return 0;
|
|
7885
|
+
}
|
|
7866
7886
|
function formatCompletionMetadata(event) {
|
|
7867
7887
|
const completionDiagnostic = event.completionDiagnostic && typeof event.completionDiagnostic === "object" ? event.completionDiagnostic : null;
|
|
7868
7888
|
const diagnosticReason = completionDiagnostic ? readNonEmptyString2(completionDiagnostic.blockReason) || "present" : "";
|
|
@@ -7992,9 +8012,11 @@ Next step: ${nextStep}`;
|
|
|
7992
8012
|
}
|
|
7993
8013
|
return "";
|
|
7994
8014
|
}
|
|
8015
|
+
var MESH_SURFACED_PREVIEW_MAX_CHARS;
|
|
7995
8016
|
var init_mesh_events_utils = __esm({
|
|
7996
8017
|
"src/mesh/mesh-events-utils.ts"() {
|
|
7997
8018
|
"use strict";
|
|
8019
|
+
MESH_SURFACED_PREVIEW_MAX_CHARS = 512;
|
|
7998
8020
|
}
|
|
7999
8021
|
});
|
|
8000
8022
|
|
|
@@ -10402,6 +10424,7 @@ function injectMeshSystemMessage(components, args) {
|
|
|
10402
10424
|
);
|
|
10403
10425
|
if (components.onMeshCoordinatorEventForwarded) {
|
|
10404
10426
|
try {
|
|
10427
|
+
const surfacedPreview = resolveMeshSurfacedSessionPreview(args.metadataEvent);
|
|
10405
10428
|
components.onMeshCoordinatorEventForwarded({
|
|
10406
10429
|
event: args.event,
|
|
10407
10430
|
meshId: args.meshId,
|
|
@@ -10410,7 +10433,12 @@ function injectMeshSystemMessage(components, args) {
|
|
|
10410
10433
|
// Ensure a `workspace` field reaches updateMeshOwnedSession even when the
|
|
10411
10434
|
// worker provider event only carried `workspaceName`. The merge spread of
|
|
10412
10435
|
// metadataEvent above wins when it already has a non-empty `workspace`.
|
|
10413
|
-
workspace: readNonEmptyString2(args.metadataEvent.workspace) || readNonEmptyString2(args.metadataEvent.workspaceName) || void 0
|
|
10436
|
+
workspace: readNonEmptyString2(args.metadataEvent.workspace) || readNonEmptyString2(args.metadataEvent.workspaceName) || void 0,
|
|
10437
|
+
...surfacedPreview ? {
|
|
10438
|
+
meshSessionLastMessagePreview: surfacedPreview.preview,
|
|
10439
|
+
meshSessionLastMessageRole: surfacedPreview.role,
|
|
10440
|
+
meshSessionLastMessageAt: surfacedPreview.receivedAt || void 0
|
|
10441
|
+
} : {}
|
|
10414
10442
|
});
|
|
10415
10443
|
} catch {
|
|
10416
10444
|
}
|
|
@@ -15128,7 +15156,7 @@ function appendBoundedText(current, chunk, maxChars) {
|
|
|
15128
15156
|
if (current.length <= keepFromCurrent) return current + chunk;
|
|
15129
15157
|
return current.slice(-keepFromCurrent) + chunk;
|
|
15130
15158
|
}
|
|
15131
|
-
var os14, import_session_host_core5, FORCE_SUBMIT_SETTLE_MS,
|
|
15159
|
+
var os14, import_session_host_core5, FORCE_SUBMIT_SETTLE_MS, ProviderCliAdapter;
|
|
15132
15160
|
var init_provider_cli_adapter = __esm({
|
|
15133
15161
|
"src/cli-adapters/provider-cli-adapter.ts"() {
|
|
15134
15162
|
"use strict";
|
|
@@ -15146,8 +15174,6 @@ var init_provider_cli_adapter = __esm({
|
|
|
15146
15174
|
init_provider_cli_runtime();
|
|
15147
15175
|
init_provider_cli_shared();
|
|
15148
15176
|
FORCE_SUBMIT_SETTLE_MS = 150;
|
|
15149
|
-
FORCE_SUBMIT_MAX_WAIT_MS = 1500;
|
|
15150
|
-
FORCE_SUBMIT_POLL_MS = 50;
|
|
15151
15177
|
ProviderCliAdapter = class _ProviderCliAdapter {
|
|
15152
15178
|
constructor(provider, workingDir, extraArgs = [], extraEnv = {}, transportFactory = new NodePtyTransportFactory()) {
|
|
15153
15179
|
this.extraArgs = extraArgs;
|
|
@@ -16076,22 +16102,12 @@ ${lastSnapshot}`;
|
|
|
16076
16102
|
return;
|
|
16077
16103
|
}
|
|
16078
16104
|
LOG.info("CLI", `[${this.cliType}] force-sending prompt while status=${this.engine.currentStatus}`);
|
|
16079
|
-
await this.
|
|
16080
|
-
await this.
|
|
16081
|
-
await this.writeToPty(this.sendKey);
|
|
16105
|
+
await this.waitForForceSubmitSettle();
|
|
16106
|
+
await this.writeToPty(content + this.sendKey);
|
|
16082
16107
|
this.onStatusChange?.();
|
|
16083
16108
|
}
|
|
16084
|
-
async waitForForceSubmitSettle(
|
|
16085
|
-
const startedAt = Date.now();
|
|
16086
|
-
const normalizedPromptSnippet = normalizePromptText(extractPromptRetrySnippet(content));
|
|
16109
|
+
async waitForForceSubmitSettle() {
|
|
16087
16110
|
await new Promise((resolve24) => setTimeout(resolve24, FORCE_SUBMIT_SETTLE_MS));
|
|
16088
|
-
if (!normalizedPromptSnippet) return;
|
|
16089
|
-
while (Date.now() - startedAt < FORCE_SUBMIT_MAX_WAIT_MS) {
|
|
16090
|
-
if (!this.ptyProcess) return;
|
|
16091
|
-
const screenText = this.terminalScreen.getText();
|
|
16092
|
-
if (promptLikelyVisible(screenText, normalizedPromptSnippet)) return;
|
|
16093
|
-
await new Promise((resolve24) => setTimeout(resolve24, FORCE_SUBMIT_POLL_MS));
|
|
16094
|
-
}
|
|
16095
16111
|
}
|
|
16096
16112
|
enqueuePendingOutboundMessage(text, reason) {
|
|
16097
16113
|
const content = String(text || "");
|