adhdev 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/cli/index.js CHANGED
@@ -17186,8 +17186,29 @@ function materializeImageDataPart(part, index, dir) {
17186
17186
  fs6.mkdirSync(dir, { recursive: true });
17187
17187
  const filePath = path17.join(dir, safeInputImageBasename(index, part.mimeType));
17188
17188
  fs6.writeFileSync(filePath, Buffer.from(rawData, "base64"));
17189
+ cleanupStaleMaterializedImages(dir);
17189
17190
  return filePath;
17190
17191
  }
17192
+ function cleanupStaleMaterializedImages(dir) {
17193
+ const now = Date.now();
17194
+ if (now - lastMaterializedImageCleanupAt < MATERIALIZED_IMAGE_CLEANUP_INTERVAL_MS) return;
17195
+ lastMaterializedImageCleanupAt = now;
17196
+ try {
17197
+ const entries = fs6.readdirSync(dir);
17198
+ for (const entry of entries) {
17199
+ if (!entry.startsWith("adhdev-input-image-")) continue;
17200
+ const fullPath = path17.join(dir, entry);
17201
+ try {
17202
+ const stat5 = fs6.statSync(fullPath);
17203
+ if (now - stat5.mtimeMs > MATERIALIZED_IMAGE_MAX_AGE_MS) {
17204
+ fs6.unlinkSync(fullPath);
17205
+ }
17206
+ } catch {
17207
+ }
17208
+ }
17209
+ } catch {
17210
+ }
17211
+ }
17191
17212
  function buildCliStructuredInputPrompt(input, options = {}) {
17192
17213
  const promptParts = [];
17193
17214
  const imageRefs = [];
@@ -17214,7 +17235,10 @@ function buildCliStructuredInputPrompt(input, options = {}) {
17214
17235
  resourceRefs.push([part.name, part.text, part.uri].filter(Boolean).join("\n"));
17215
17236
  }
17216
17237
  });
17217
- if (input.textFallback.trim()) promptParts.push(input.textFallback.trim());
17238
+ const hasExplicitTextParts = input.parts.some((part) => part.type === "text" && part.text.trim());
17239
+ if (!hasExplicitTextParts && input.textFallback.trim()) {
17240
+ promptParts.push(input.textFallback.trim());
17241
+ }
17218
17242
  const ordered = [
17219
17243
  ...imageRefs,
17220
17244
  ...promptParts,
@@ -17297,7 +17321,7 @@ async function waitForCliAdapterReady(adapter, options) {
17297
17321
  }
17298
17322
  throw new Error(`CLI runtime did not become ready within ${timeoutMs}ms`);
17299
17323
  }
17300
- var os15, path17, crypto3, fs6, import_node_module, IMAGE_MIME_EXTENSIONS, CachedDatabaseSync, CliProviderInstance;
17324
+ var os15, path17, crypto3, fs6, import_node_module, IMAGE_MIME_EXTENSIONS, MATERIALIZED_IMAGE_MAX_AGE_MS, MATERIALIZED_IMAGE_CLEANUP_INTERVAL_MS, lastMaterializedImageCleanupAt, CachedDatabaseSync, CliProviderInstance;
17301
17325
  var init_cli_provider_instance = __esm({
17302
17326
  "../../oss/packages/daemon-core/src/providers/cli-provider-instance.ts"() {
17303
17327
  "use strict";
@@ -17328,6 +17352,9 @@ var init_cli_provider_instance = __esm({
17328
17352
  "image/tiff": ".tiff",
17329
17353
  "image/svg+xml": ".svg"
17330
17354
  };
17355
+ MATERIALIZED_IMAGE_MAX_AGE_MS = 60 * 60 * 1e3;
17356
+ MATERIALIZED_IMAGE_CLEANUP_INTERVAL_MS = 5 * 60 * 1e3;
17357
+ lastMaterializedImageCleanupAt = 0;
17331
17358
  CachedDatabaseSync = null;
17332
17359
  CliProviderInstance = class {
17333
17360
  constructor(provider, workingDir, cliArgs = [], instanceId, transportFactory, options) {
@@ -43825,7 +43852,10 @@ function setupMeshEventForwarding(components) {
43825
43852
  const workspace = readNonEmptyString(state.workspace);
43826
43853
  if (!workspace) return;
43827
43854
  const settings = state.settings && typeof state.settings === "object" ? state.settings : {};
43855
+ if (readNonEmptyString(settings.meshCoordinatorFor)) return;
43828
43856
  const meshIdFromRuntime = readNonEmptyString(settings.meshNodeFor);
43857
+ const isMeshDelegate = Boolean(meshIdFromRuntime || settings.launchedByCoordinator);
43858
+ if (!isMeshDelegate) return;
43829
43859
  const mesh = meshIdFromRuntime ? getMesh(meshIdFromRuntime) : getMeshByRepo(workspace);
43830
43860
  const meshId = meshIdFromRuntime || readNonEmptyString(mesh?.id);
43831
43861
  if (!meshId) return;
@@ -46381,7 +46411,7 @@ function prepareSessionChatTailUpdate(input) {
46381
46411
  };
46382
46412
  }
46383
46413
  const fullMessages = normalizeChatMessages(Array.isArray(result.messages) ? result.messages : []);
46384
- const messages = filterUserFacingChatMessages(fullMessages);
46414
+ const messages = fullMessages;
46385
46415
  const title = typeof result.title === "string" ? result.title : void 0;
46386
46416
  const activeModal = normalizeChatTailActiveModal(result.activeModal);
46387
46417
  const status = typeof result.status === "string" ? result.status : "idle";
@@ -94602,7 +94632,7 @@ var init_adhdev_daemon = __esm({
94602
94632
  init_version();
94603
94633
  init_src();
94604
94634
  init_runtime_defaults();
94605
- pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.76-rc.64" });
94635
+ pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.76-rc.65" });
94606
94636
  AdhdevDaemon = class _AdhdevDaemon {
94607
94637
  localHttpServer = null;
94608
94638
  localWss = null;