@adhdev/daemon-standalone 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 CHANGED
@@ -30036,10 +30036,10 @@ var require_dist3 = __commonJS({
30036
30036
  }
30037
30037
  function getDaemonBuildInfo() {
30038
30038
  if (cached2) return cached2;
30039
- const commit = readInjected(true ? "e9e62c9770c0f4a419a90f5287125f3d3bb0fd95" : void 0) ?? "unknown";
30040
- const commitShort = readInjected(true ? "e9e62c97" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30041
- const version2 = readInjected(true ? "0.9.82-rc.335" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30042
- const builtAt = readInjected(true ? "2026-06-20T04:31:22.998Z" : void 0);
30039
+ const commit = readInjected(true ? "587b2d866182a5b6c086d23d9f6cc32d22ca50f5" : void 0) ?? "unknown";
30040
+ const commitShort = readInjected(true ? "587b2d86" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30041
+ const version2 = readInjected(true ? "0.9.82-rc.337" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30042
+ const builtAt = readInjected(true ? "2026-06-20T06:38:54.115Z" : void 0);
30043
30043
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
30044
30044
  return cached2;
30045
30045
  }
@@ -37639,6 +37639,26 @@ ${rendered}`, "utf-8");
37639
37639
  function readWorkerResultMetadata(event) {
37640
37640
  return readRecord4(event.workerResult) || readRecord4(event.meshWorkerResult) || readRecord4(event.structuredResult);
37641
37641
  }
37642
+ function resolveMeshSurfacedSessionPreview(metadataEvent) {
37643
+ const workerResult = readWorkerResultMetadata(metadataEvent);
37644
+ const resultRecord = readRecord4(metadataEvent.result);
37645
+ const summaryText = readNonEmptyString2(metadataEvent.finalSummary) || readNonEmptyString2(workerResult?.summary) || readNonEmptyString2(workerResult?.finalSummary) || readNonEmptyString2(resultRecord?.summary) || readNonEmptyString2(resultRecord?.finalSummary);
37646
+ if (!summaryText) return void 0;
37647
+ const truncationSuffix = "...[truncated]";
37648
+ const preview = summaryText.length > MESH_SURFACED_PREVIEW_MAX_CHARS ? `${summaryText.slice(0, MESH_SURFACED_PREVIEW_MAX_CHARS - truncationSuffix.length)}${truncationSuffix}` : summaryText;
37649
+ const timestamp = readEventTimestampValue(metadataEvent.timestamp);
37650
+ return { preview, role: "assistant", receivedAt: timestamp };
37651
+ }
37652
+ function readEventTimestampValue(value) {
37653
+ if (typeof value === "number" && Number.isFinite(value)) return value;
37654
+ if (typeof value === "string" && value.trim()) {
37655
+ const parsed = Number(value);
37656
+ if (Number.isFinite(parsed)) return parsed;
37657
+ const dateMs = Date.parse(value);
37658
+ if (Number.isFinite(dateMs)) return dateMs;
37659
+ }
37660
+ return 0;
37661
+ }
37642
37662
  function formatCompletionMetadata(event) {
37643
37663
  const completionDiagnostic = event.completionDiagnostic && typeof event.completionDiagnostic === "object" ? event.completionDiagnostic : null;
37644
37664
  const diagnosticReason = completionDiagnostic ? readNonEmptyString2(completionDiagnostic.blockReason) || "present" : "";
@@ -37768,9 +37788,11 @@ Next step: ${nextStep}`;
37768
37788
  }
37769
37789
  return "";
37770
37790
  }
37791
+ var MESH_SURFACED_PREVIEW_MAX_CHARS;
37771
37792
  var init_mesh_events_utils = __esm2({
37772
37793
  "src/mesh/mesh-events-utils.ts"() {
37773
37794
  "use strict";
37795
+ MESH_SURFACED_PREVIEW_MAX_CHARS = 512;
37774
37796
  }
37775
37797
  });
37776
37798
  function normalizeCoordinatorDaemonIds(coordinatorDaemonId) {
@@ -40178,6 +40200,7 @@ Next step: ${nextStep}`;
40178
40200
  );
40179
40201
  if (components.onMeshCoordinatorEventForwarded) {
40180
40202
  try {
40203
+ const surfacedPreview = resolveMeshSurfacedSessionPreview(args.metadataEvent);
40181
40204
  components.onMeshCoordinatorEventForwarded({
40182
40205
  event: args.event,
40183
40206
  meshId: args.meshId,
@@ -40186,7 +40209,12 @@ Next step: ${nextStep}`;
40186
40209
  // Ensure a `workspace` field reaches updateMeshOwnedSession even when the
40187
40210
  // worker provider event only carried `workspaceName`. The merge spread of
40188
40211
  // metadataEvent above wins when it already has a non-empty `workspace`.
40189
- workspace: readNonEmptyString2(args.metadataEvent.workspace) || readNonEmptyString2(args.metadataEvent.workspaceName) || void 0
40212
+ workspace: readNonEmptyString2(args.metadataEvent.workspace) || readNonEmptyString2(args.metadataEvent.workspaceName) || void 0,
40213
+ ...surfacedPreview ? {
40214
+ meshSessionLastMessagePreview: surfacedPreview.preview,
40215
+ meshSessionLastMessageRole: surfacedPreview.role,
40216
+ meshSessionLastMessageAt: surfacedPreview.receivedAt || void 0
40217
+ } : {}
40190
40218
  });
40191
40219
  } catch {
40192
40220
  }
@@ -44923,8 +44951,6 @@ ${cont}` : cont;
44923
44951
  var os14;
44924
44952
  var import_session_host_core5;
44925
44953
  var FORCE_SUBMIT_SETTLE_MS;
44926
- var FORCE_SUBMIT_MAX_WAIT_MS;
44927
- var FORCE_SUBMIT_POLL_MS;
44928
44954
  var ProviderCliAdapter;
44929
44955
  var init_provider_cli_adapter = __esm2({
44930
44956
  "src/cli-adapters/provider-cli-adapter.ts"() {
@@ -44943,8 +44969,6 @@ ${cont}` : cont;
44943
44969
  init_provider_cli_runtime();
44944
44970
  init_provider_cli_shared();
44945
44971
  FORCE_SUBMIT_SETTLE_MS = 150;
44946
- FORCE_SUBMIT_MAX_WAIT_MS = 1500;
44947
- FORCE_SUBMIT_POLL_MS = 50;
44948
44972
  ProviderCliAdapter = class _ProviderCliAdapter {
44949
44973
  constructor(provider, workingDir, extraArgs = [], extraEnv = {}, transportFactory = new NodePtyTransportFactory()) {
44950
44974
  this.extraArgs = extraArgs;
@@ -45873,22 +45897,12 @@ ${lastSnapshot}`;
45873
45897
  return;
45874
45898
  }
45875
45899
  LOG2.info("CLI", `[${this.cliType}] force-sending prompt while status=${this.engine.currentStatus}`);
45876
- await this.writeToPty(content);
45877
- await this.waitForForceSubmitSettle(content);
45878
- await this.writeToPty(this.sendKey);
45900
+ await this.waitForForceSubmitSettle();
45901
+ await this.writeToPty(content + this.sendKey);
45879
45902
  this.onStatusChange?.();
45880
45903
  }
45881
- async waitForForceSubmitSettle(content) {
45882
- const startedAt = Date.now();
45883
- const normalizedPromptSnippet = normalizePromptText(extractPromptRetrySnippet(content));
45904
+ async waitForForceSubmitSettle() {
45884
45905
  await new Promise((resolve24) => setTimeout(resolve24, FORCE_SUBMIT_SETTLE_MS));
45885
- if (!normalizedPromptSnippet) return;
45886
- while (Date.now() - startedAt < FORCE_SUBMIT_MAX_WAIT_MS) {
45887
- if (!this.ptyProcess) return;
45888
- const screenText = this.terminalScreen.getText();
45889
- if (promptLikelyVisible(screenText, normalizedPromptSnippet)) return;
45890
- await new Promise((resolve24) => setTimeout(resolve24, FORCE_SUBMIT_POLL_MS));
45891
- }
45892
45906
  }
45893
45907
  enqueuePendingOutboundMessage(text, reason) {
45894
45908
  const content = String(text || "");