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 +34 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +34 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -16207,8 +16207,29 @@ function materializeImageDataPart(part, index, dir) {
|
|
|
16207
16207
|
fs6.mkdirSync(dir, { recursive: true });
|
|
16208
16208
|
const filePath = path16.join(dir, safeInputImageBasename(index, part.mimeType));
|
|
16209
16209
|
fs6.writeFileSync(filePath, Buffer.from(rawData, "base64"));
|
|
16210
|
+
cleanupStaleMaterializedImages(dir);
|
|
16210
16211
|
return filePath;
|
|
16211
16212
|
}
|
|
16213
|
+
function cleanupStaleMaterializedImages(dir) {
|
|
16214
|
+
const now = Date.now();
|
|
16215
|
+
if (now - lastMaterializedImageCleanupAt < MATERIALIZED_IMAGE_CLEANUP_INTERVAL_MS) return;
|
|
16216
|
+
lastMaterializedImageCleanupAt = now;
|
|
16217
|
+
try {
|
|
16218
|
+
const entries = fs6.readdirSync(dir);
|
|
16219
|
+
for (const entry of entries) {
|
|
16220
|
+
if (!entry.startsWith("adhdev-input-image-")) continue;
|
|
16221
|
+
const fullPath = path16.join(dir, entry);
|
|
16222
|
+
try {
|
|
16223
|
+
const stat5 = fs6.statSync(fullPath);
|
|
16224
|
+
if (now - stat5.mtimeMs > MATERIALIZED_IMAGE_MAX_AGE_MS) {
|
|
16225
|
+
fs6.unlinkSync(fullPath);
|
|
16226
|
+
}
|
|
16227
|
+
} catch {
|
|
16228
|
+
}
|
|
16229
|
+
}
|
|
16230
|
+
} catch {
|
|
16231
|
+
}
|
|
16232
|
+
}
|
|
16212
16233
|
function buildCliStructuredInputPrompt(input, options = {}) {
|
|
16213
16234
|
const promptParts = [];
|
|
16214
16235
|
const imageRefs = [];
|
|
@@ -16235,7 +16256,10 @@ function buildCliStructuredInputPrompt(input, options = {}) {
|
|
|
16235
16256
|
resourceRefs.push([part.name, part.text, part.uri].filter(Boolean).join("\n"));
|
|
16236
16257
|
}
|
|
16237
16258
|
});
|
|
16238
|
-
|
|
16259
|
+
const hasExplicitTextParts = input.parts.some((part) => part.type === "text" && part.text.trim());
|
|
16260
|
+
if (!hasExplicitTextParts && input.textFallback.trim()) {
|
|
16261
|
+
promptParts.push(input.textFallback.trim());
|
|
16262
|
+
}
|
|
16239
16263
|
const ordered = [
|
|
16240
16264
|
...imageRefs,
|
|
16241
16265
|
...promptParts,
|
|
@@ -16318,7 +16342,7 @@ async function waitForCliAdapterReady(adapter, options) {
|
|
|
16318
16342
|
}
|
|
16319
16343
|
throw new Error(`CLI runtime did not become ready within ${timeoutMs}ms`);
|
|
16320
16344
|
}
|
|
16321
|
-
var os14, path16, crypto3, fs6, import_node_module, IMAGE_MIME_EXTENSIONS, CachedDatabaseSync, CliProviderInstance;
|
|
16345
|
+
var os14, path16, crypto3, fs6, import_node_module, IMAGE_MIME_EXTENSIONS, MATERIALIZED_IMAGE_MAX_AGE_MS, MATERIALIZED_IMAGE_CLEANUP_INTERVAL_MS, lastMaterializedImageCleanupAt, CachedDatabaseSync, CliProviderInstance;
|
|
16322
16346
|
var init_cli_provider_instance = __esm({
|
|
16323
16347
|
"../../oss/packages/daemon-core/src/providers/cli-provider-instance.ts"() {
|
|
16324
16348
|
"use strict";
|
|
@@ -16349,6 +16373,9 @@ var init_cli_provider_instance = __esm({
|
|
|
16349
16373
|
"image/tiff": ".tiff",
|
|
16350
16374
|
"image/svg+xml": ".svg"
|
|
16351
16375
|
};
|
|
16376
|
+
MATERIALIZED_IMAGE_MAX_AGE_MS = 60 * 60 * 1e3;
|
|
16377
|
+
MATERIALIZED_IMAGE_CLEANUP_INTERVAL_MS = 5 * 60 * 1e3;
|
|
16378
|
+
lastMaterializedImageCleanupAt = 0;
|
|
16352
16379
|
CachedDatabaseSync = null;
|
|
16353
16380
|
CliProviderInstance = class {
|
|
16354
16381
|
constructor(provider, workingDir, cliArgs = [], instanceId, transportFactory, options) {
|
|
@@ -42846,7 +42873,10 @@ function setupMeshEventForwarding(components) {
|
|
|
42846
42873
|
const workspace = readNonEmptyString(state.workspace);
|
|
42847
42874
|
if (!workspace) return;
|
|
42848
42875
|
const settings = state.settings && typeof state.settings === "object" ? state.settings : {};
|
|
42876
|
+
if (readNonEmptyString(settings.meshCoordinatorFor)) return;
|
|
42849
42877
|
const meshIdFromRuntime = readNonEmptyString(settings.meshNodeFor);
|
|
42878
|
+
const isMeshDelegate = Boolean(meshIdFromRuntime || settings.launchedByCoordinator);
|
|
42879
|
+
if (!isMeshDelegate) return;
|
|
42850
42880
|
const mesh = meshIdFromRuntime ? getMesh(meshIdFromRuntime) : getMeshByRepo(workspace);
|
|
42851
42881
|
const meshId = meshIdFromRuntime || readNonEmptyString(mesh?.id);
|
|
42852
42882
|
if (!meshId) return;
|
|
@@ -45402,7 +45432,7 @@ function prepareSessionChatTailUpdate(input) {
|
|
|
45402
45432
|
};
|
|
45403
45433
|
}
|
|
45404
45434
|
const fullMessages = normalizeChatMessages(Array.isArray(result.messages) ? result.messages : []);
|
|
45405
|
-
const messages =
|
|
45435
|
+
const messages = fullMessages;
|
|
45406
45436
|
const title = typeof result.title === "string" ? result.title : void 0;
|
|
45407
45437
|
const activeModal = normalizeChatTailActiveModal(result.activeModal);
|
|
45408
45438
|
const status = typeof result.status === "string" ? result.status : "idle";
|
|
@@ -63438,7 +63468,7 @@ var init_adhdev_daemon = __esm({
|
|
|
63438
63468
|
init_version();
|
|
63439
63469
|
init_src();
|
|
63440
63470
|
init_runtime_defaults();
|
|
63441
|
-
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.76-rc.
|
|
63471
|
+
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.76-rc.65" });
|
|
63442
63472
|
AdhdevDaemon = class _AdhdevDaemon {
|
|
63443
63473
|
localHttpServer = null;
|
|
63444
63474
|
localWss = null;
|