@adhdev/daemon-standalone 0.9.76-rc.64 → 0.9.76-rc.66

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
@@ -31226,6 +31226,7 @@ var require_dist2 = __commonJS({
31226
31226
  requireApprovalForDestructiveGit: true,
31227
31227
  dirtyWorkspaceBehavior: "warn",
31228
31228
  maxParallelTasks: 2,
31229
+ spawnedSessionVisibility: "visible",
31229
31230
  sessionCleanupOnNodeRemove: "preserve"
31230
31231
  };
31231
31232
  }
@@ -31662,6 +31663,9 @@ var require_dist2 = __commonJS({
31662
31663
  if (!SESSION_CLEANUP_MODES.has(String(policy.sessionCleanupOnNodeRemove))) {
31663
31664
  policy.sessionCleanupOnNodeRemove = "preserve";
31664
31665
  }
31666
+ if (!SPAWNED_SESSION_VISIBILITY_MODES.has(String(policy.spawnedSessionVisibility))) {
31667
+ policy.spawnedSessionVisibility = "visible";
31668
+ }
31665
31669
  return policy;
31666
31670
  }
31667
31671
  function listMeshes() {
@@ -31770,6 +31774,7 @@ var require_dist2 = __commonJS({
31770
31774
  var import_path22;
31771
31775
  var import_crypto32;
31772
31776
  var SESSION_CLEANUP_MODES;
31777
+ var SPAWNED_SESSION_VISIBILITY_MODES;
31773
31778
  var init_mesh_config = __esm2({
31774
31779
  "src/config/mesh-config.ts"() {
31775
31780
  "use strict";
@@ -31779,6 +31784,7 @@ var require_dist2 = __commonJS({
31779
31784
  init_config();
31780
31785
  init_repo_mesh_types();
31781
31786
  SESSION_CLEANUP_MODES = /* @__PURE__ */ new Set(["preserve", "stop", "delete_stopped", "stop_and_delete"]);
31787
+ SPAWNED_SESSION_VISIBILITY_MODES = /* @__PURE__ */ new Set(["visible", "hidden"]);
31782
31788
  }
31783
31789
  });
31784
31790
  var coordinator_prompt_exports = {};
@@ -46431,8 +46437,32 @@ ${effect.notification.body || ""}`.trim();
46431
46437
  fs6.mkdirSync(dir, { recursive: true });
46432
46438
  const filePath = path16.join(dir, safeInputImageBasename(index, part.mimeType));
46433
46439
  fs6.writeFileSync(filePath, Buffer.from(rawData, "base64"));
46440
+ cleanupStaleMaterializedImages(dir);
46434
46441
  return filePath;
46435
46442
  }
46443
+ var MATERIALIZED_IMAGE_MAX_AGE_MS = 60 * 60 * 1e3;
46444
+ var MATERIALIZED_IMAGE_CLEANUP_INTERVAL_MS = 5 * 60 * 1e3;
46445
+ var lastMaterializedImageCleanupAt = 0;
46446
+ function cleanupStaleMaterializedImages(dir) {
46447
+ const now = Date.now();
46448
+ if (now - lastMaterializedImageCleanupAt < MATERIALIZED_IMAGE_CLEANUP_INTERVAL_MS) return;
46449
+ lastMaterializedImageCleanupAt = now;
46450
+ try {
46451
+ const entries = fs6.readdirSync(dir);
46452
+ for (const entry of entries) {
46453
+ if (!entry.startsWith("adhdev-input-image-")) continue;
46454
+ const fullPath = path16.join(dir, entry);
46455
+ try {
46456
+ const stat2 = fs6.statSync(fullPath);
46457
+ if (now - stat2.mtimeMs > MATERIALIZED_IMAGE_MAX_AGE_MS) {
46458
+ fs6.unlinkSync(fullPath);
46459
+ }
46460
+ } catch {
46461
+ }
46462
+ }
46463
+ } catch {
46464
+ }
46465
+ }
46436
46466
  function buildCliStructuredInputPrompt(input, options = {}) {
46437
46467
  const promptParts = [];
46438
46468
  const imageRefs = [];
@@ -46459,7 +46489,10 @@ ${effect.notification.body || ""}`.trim();
46459
46489
  resourceRefs.push([part.name, part.text, part.uri].filter(Boolean).join("\n"));
46460
46490
  }
46461
46491
  });
46462
- if (input.textFallback.trim()) promptParts.push(input.textFallback.trim());
46492
+ const hasExplicitTextParts = input.parts.some((part) => part.type === "text" && part.text.trim());
46493
+ if (!hasExplicitTextParts && input.textFallback.trim()) {
46494
+ promptParts.push(input.textFallback.trim());
46495
+ }
46463
46496
  const ordered = [
46464
46497
  ...imageRefs,
46465
46498
  ...promptParts,
@@ -52285,7 +52318,10 @@ ${(0, import_node_path.resolve)(workspace || os17.tmpdir())}`;
52285
52318
  const workspace = readNonEmptyString(state.workspace);
52286
52319
  if (!workspace) return;
52287
52320
  const settings = state.settings && typeof state.settings === "object" ? state.settings : {};
52321
+ if (readNonEmptyString(settings.meshCoordinatorFor)) return;
52288
52322
  const meshIdFromRuntime = readNonEmptyString(settings.meshNodeFor);
52323
+ const isMeshDelegate = Boolean(meshIdFromRuntime || settings.launchedByCoordinator);
52324
+ if (!isMeshDelegate) return;
52289
52325
  const mesh = meshIdFromRuntime ? getMesh(meshIdFromRuntime) : getMeshByRepo(workspace);
52290
52326
  const meshId = meshIdFromRuntime || readNonEmptyString(mesh?.id);
52291
52327
  if (!meshId) return;
@@ -54761,7 +54797,7 @@ ${(0, import_node_path.resolve)(workspace || os17.tmpdir())}`;
54761
54797
  };
54762
54798
  }
54763
54799
  const fullMessages = normalizeChatMessages(Array.isArray(result.messages) ? result.messages : []);
54764
- const messages = filterUserFacingChatMessages(fullMessages);
54800
+ const messages = fullMessages;
54765
54801
  const title = typeof result.title === "string" ? result.title : void 0;
54766
54802
  const activeModal = normalizeChatTailActiveModal(result.activeModal);
54767
54803
  const status = typeof result.status === "string" ? result.status : "idle";