@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.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 ? "587b2d866182a5b6c086d23d9f6cc32d22ca50f5" : void 0) ?? "unknown";
|
|
315
|
+
const commitShort = readInjected(true ? "587b2d86" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
316
|
+
const version = readInjected(true ? "0.9.82-rc.337" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
317
|
+
const builtAt = readInjected(true ? "2026-06-20T06:37:55.432Z" : void 0);
|
|
318
318
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
319
319
|
return cached;
|
|
320
320
|
}
|
|
@@ -7857,6 +7857,26 @@ function readRefineJobId(event) {
|
|
|
7857
7857
|
function readWorkerResultMetadata(event) {
|
|
7858
7858
|
return readRecord4(event.workerResult) || readRecord4(event.meshWorkerResult) || readRecord4(event.structuredResult);
|
|
7859
7859
|
}
|
|
7860
|
+
function resolveMeshSurfacedSessionPreview(metadataEvent) {
|
|
7861
|
+
const workerResult = readWorkerResultMetadata(metadataEvent);
|
|
7862
|
+
const resultRecord = readRecord4(metadataEvent.result);
|
|
7863
|
+
const summaryText = readNonEmptyString2(metadataEvent.finalSummary) || readNonEmptyString2(workerResult?.summary) || readNonEmptyString2(workerResult?.finalSummary) || readNonEmptyString2(resultRecord?.summary) || readNonEmptyString2(resultRecord?.finalSummary);
|
|
7864
|
+
if (!summaryText) return void 0;
|
|
7865
|
+
const truncationSuffix = "...[truncated]";
|
|
7866
|
+
const preview = summaryText.length > MESH_SURFACED_PREVIEW_MAX_CHARS ? `${summaryText.slice(0, MESH_SURFACED_PREVIEW_MAX_CHARS - truncationSuffix.length)}${truncationSuffix}` : summaryText;
|
|
7867
|
+
const timestamp = readEventTimestampValue(metadataEvent.timestamp);
|
|
7868
|
+
return { preview, role: "assistant", receivedAt: timestamp };
|
|
7869
|
+
}
|
|
7870
|
+
function readEventTimestampValue(value) {
|
|
7871
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
7872
|
+
if (typeof value === "string" && value.trim()) {
|
|
7873
|
+
const parsed = Number(value);
|
|
7874
|
+
if (Number.isFinite(parsed)) return parsed;
|
|
7875
|
+
const dateMs = Date.parse(value);
|
|
7876
|
+
if (Number.isFinite(dateMs)) return dateMs;
|
|
7877
|
+
}
|
|
7878
|
+
return 0;
|
|
7879
|
+
}
|
|
7860
7880
|
function formatCompletionMetadata(event) {
|
|
7861
7881
|
const completionDiagnostic = event.completionDiagnostic && typeof event.completionDiagnostic === "object" ? event.completionDiagnostic : null;
|
|
7862
7882
|
const diagnosticReason = completionDiagnostic ? readNonEmptyString2(completionDiagnostic.blockReason) || "present" : "";
|
|
@@ -7986,9 +8006,11 @@ Next step: ${nextStep}`;
|
|
|
7986
8006
|
}
|
|
7987
8007
|
return "";
|
|
7988
8008
|
}
|
|
8009
|
+
var MESH_SURFACED_PREVIEW_MAX_CHARS;
|
|
7989
8010
|
var init_mesh_events_utils = __esm({
|
|
7990
8011
|
"src/mesh/mesh-events-utils.ts"() {
|
|
7991
8012
|
"use strict";
|
|
8013
|
+
MESH_SURFACED_PREVIEW_MAX_CHARS = 512;
|
|
7992
8014
|
}
|
|
7993
8015
|
});
|
|
7994
8016
|
|
|
@@ -10399,6 +10421,7 @@ function injectMeshSystemMessage(components, args) {
|
|
|
10399
10421
|
);
|
|
10400
10422
|
if (components.onMeshCoordinatorEventForwarded) {
|
|
10401
10423
|
try {
|
|
10424
|
+
const surfacedPreview = resolveMeshSurfacedSessionPreview(args.metadataEvent);
|
|
10402
10425
|
components.onMeshCoordinatorEventForwarded({
|
|
10403
10426
|
event: args.event,
|
|
10404
10427
|
meshId: args.meshId,
|
|
@@ -10407,7 +10430,12 @@ function injectMeshSystemMessage(components, args) {
|
|
|
10407
10430
|
// Ensure a `workspace` field reaches updateMeshOwnedSession even when the
|
|
10408
10431
|
// worker provider event only carried `workspaceName`. The merge spread of
|
|
10409
10432
|
// metadataEvent above wins when it already has a non-empty `workspace`.
|
|
10410
|
-
workspace: readNonEmptyString2(args.metadataEvent.workspace) || readNonEmptyString2(args.metadataEvent.workspaceName) || void 0
|
|
10433
|
+
workspace: readNonEmptyString2(args.metadataEvent.workspace) || readNonEmptyString2(args.metadataEvent.workspaceName) || void 0,
|
|
10434
|
+
...surfacedPreview ? {
|
|
10435
|
+
meshSessionLastMessagePreview: surfacedPreview.preview,
|
|
10436
|
+
meshSessionLastMessageRole: surfacedPreview.role,
|
|
10437
|
+
meshSessionLastMessageAt: surfacedPreview.receivedAt || void 0
|
|
10438
|
+
} : {}
|
|
10411
10439
|
});
|
|
10412
10440
|
} catch {
|
|
10413
10441
|
}
|
|
@@ -15125,7 +15153,7 @@ function appendBoundedText(current, chunk, maxChars) {
|
|
|
15125
15153
|
if (current.length <= keepFromCurrent) return current + chunk;
|
|
15126
15154
|
return current.slice(-keepFromCurrent) + chunk;
|
|
15127
15155
|
}
|
|
15128
|
-
var FORCE_SUBMIT_SETTLE_MS,
|
|
15156
|
+
var FORCE_SUBMIT_SETTLE_MS, ProviderCliAdapter;
|
|
15129
15157
|
var init_provider_cli_adapter = __esm({
|
|
15130
15158
|
"src/cli-adapters/provider-cli-adapter.ts"() {
|
|
15131
15159
|
"use strict";
|
|
@@ -15141,8 +15169,6 @@ var init_provider_cli_adapter = __esm({
|
|
|
15141
15169
|
init_provider_cli_runtime();
|
|
15142
15170
|
init_provider_cli_shared();
|
|
15143
15171
|
FORCE_SUBMIT_SETTLE_MS = 150;
|
|
15144
|
-
FORCE_SUBMIT_MAX_WAIT_MS = 1500;
|
|
15145
|
-
FORCE_SUBMIT_POLL_MS = 50;
|
|
15146
15172
|
ProviderCliAdapter = class _ProviderCliAdapter {
|
|
15147
15173
|
constructor(provider, workingDir, extraArgs = [], extraEnv = {}, transportFactory = new NodePtyTransportFactory()) {
|
|
15148
15174
|
this.extraArgs = extraArgs;
|
|
@@ -16071,22 +16097,12 @@ ${lastSnapshot}`;
|
|
|
16071
16097
|
return;
|
|
16072
16098
|
}
|
|
16073
16099
|
LOG.info("CLI", `[${this.cliType}] force-sending prompt while status=${this.engine.currentStatus}`);
|
|
16074
|
-
await this.
|
|
16075
|
-
await this.
|
|
16076
|
-
await this.writeToPty(this.sendKey);
|
|
16100
|
+
await this.waitForForceSubmitSettle();
|
|
16101
|
+
await this.writeToPty(content + this.sendKey);
|
|
16077
16102
|
this.onStatusChange?.();
|
|
16078
16103
|
}
|
|
16079
|
-
async waitForForceSubmitSettle(
|
|
16080
|
-
const startedAt = Date.now();
|
|
16081
|
-
const normalizedPromptSnippet = normalizePromptText(extractPromptRetrySnippet(content));
|
|
16104
|
+
async waitForForceSubmitSettle() {
|
|
16082
16105
|
await new Promise((resolve24) => setTimeout(resolve24, FORCE_SUBMIT_SETTLE_MS));
|
|
16083
|
-
if (!normalizedPromptSnippet) return;
|
|
16084
|
-
while (Date.now() - startedAt < FORCE_SUBMIT_MAX_WAIT_MS) {
|
|
16085
|
-
if (!this.ptyProcess) return;
|
|
16086
|
-
const screenText = this.terminalScreen.getText();
|
|
16087
|
-
if (promptLikelyVisible(screenText, normalizedPromptSnippet)) return;
|
|
16088
|
-
await new Promise((resolve24) => setTimeout(resolve24, FORCE_SUBMIT_POLL_MS));
|
|
16089
|
-
}
|
|
16090
16106
|
}
|
|
16091
16107
|
enqueuePendingOutboundMessage(text, reason) {
|
|
16092
16108
|
const content = String(text || "");
|