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

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
@@ -46431,8 +46431,32 @@ ${effect.notification.body || ""}`.trim();
46431
46431
  fs6.mkdirSync(dir, { recursive: true });
46432
46432
  const filePath = path16.join(dir, safeInputImageBasename(index, part.mimeType));
46433
46433
  fs6.writeFileSync(filePath, Buffer.from(rawData, "base64"));
46434
+ cleanupStaleMaterializedImages(dir);
46434
46435
  return filePath;
46435
46436
  }
46437
+ var MATERIALIZED_IMAGE_MAX_AGE_MS = 60 * 60 * 1e3;
46438
+ var MATERIALIZED_IMAGE_CLEANUP_INTERVAL_MS = 5 * 60 * 1e3;
46439
+ var lastMaterializedImageCleanupAt = 0;
46440
+ function cleanupStaleMaterializedImages(dir) {
46441
+ const now = Date.now();
46442
+ if (now - lastMaterializedImageCleanupAt < MATERIALIZED_IMAGE_CLEANUP_INTERVAL_MS) return;
46443
+ lastMaterializedImageCleanupAt = now;
46444
+ try {
46445
+ const entries = fs6.readdirSync(dir);
46446
+ for (const entry of entries) {
46447
+ if (!entry.startsWith("adhdev-input-image-")) continue;
46448
+ const fullPath = path16.join(dir, entry);
46449
+ try {
46450
+ const stat2 = fs6.statSync(fullPath);
46451
+ if (now - stat2.mtimeMs > MATERIALIZED_IMAGE_MAX_AGE_MS) {
46452
+ fs6.unlinkSync(fullPath);
46453
+ }
46454
+ } catch {
46455
+ }
46456
+ }
46457
+ } catch {
46458
+ }
46459
+ }
46436
46460
  function buildCliStructuredInputPrompt(input, options = {}) {
46437
46461
  const promptParts = [];
46438
46462
  const imageRefs = [];
@@ -46459,7 +46483,10 @@ ${effect.notification.body || ""}`.trim();
46459
46483
  resourceRefs.push([part.name, part.text, part.uri].filter(Boolean).join("\n"));
46460
46484
  }
46461
46485
  });
46462
- if (input.textFallback.trim()) promptParts.push(input.textFallback.trim());
46486
+ const hasExplicitTextParts = input.parts.some((part) => part.type === "text" && part.text.trim());
46487
+ if (!hasExplicitTextParts && input.textFallback.trim()) {
46488
+ promptParts.push(input.textFallback.trim());
46489
+ }
46463
46490
  const ordered = [
46464
46491
  ...imageRefs,
46465
46492
  ...promptParts,
@@ -52285,7 +52312,10 @@ ${(0, import_node_path.resolve)(workspace || os17.tmpdir())}`;
52285
52312
  const workspace = readNonEmptyString(state.workspace);
52286
52313
  if (!workspace) return;
52287
52314
  const settings = state.settings && typeof state.settings === "object" ? state.settings : {};
52315
+ if (readNonEmptyString(settings.meshCoordinatorFor)) return;
52288
52316
  const meshIdFromRuntime = readNonEmptyString(settings.meshNodeFor);
52317
+ const isMeshDelegate = Boolean(meshIdFromRuntime || settings.launchedByCoordinator);
52318
+ if (!isMeshDelegate) return;
52289
52319
  const mesh = meshIdFromRuntime ? getMesh(meshIdFromRuntime) : getMeshByRepo(workspace);
52290
52320
  const meshId = meshIdFromRuntime || readNonEmptyString(mesh?.id);
52291
52321
  if (!meshId) return;
@@ -54761,7 +54791,7 @@ ${(0, import_node_path.resolve)(workspace || os17.tmpdir())}`;
54761
54791
  };
54762
54792
  }
54763
54793
  const fullMessages = normalizeChatMessages(Array.isArray(result.messages) ? result.messages : []);
54764
- const messages = filterUserFacingChatMessages(fullMessages);
54794
+ const messages = fullMessages;
54765
54795
  const title = typeof result.title === "string" ? result.title : void 0;
54766
54796
  const activeModal = normalizeChatTailActiveModal(result.activeModal);
54767
54797
  const status = typeof result.status === "string" ? result.status : "idle";