@adhdev/daemon-core 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.d.ts +1 -1
- package/dist/index.js +38 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -5
- package/dist/index.mjs.map +1 -1
- package/dist/repo-mesh-types.d.ts +7 -0
- package/package.json +1 -1
- package/src/chat/subscription-updates.ts +2 -2
- package/src/config/mesh-config.ts +4 -0
- package/src/index.ts +4 -0
- package/src/mesh/mesh-events.ts +13 -2
- package/src/providers/cli-provider-instance.ts +31 -1
- package/src/repo-mesh-types.ts +8 -0
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Core logic for daemon: CDP, Provider, IDE detection, CLI/ACP adapters and more.
|
|
5
5
|
*/
|
|
6
6
|
export type { ChatBubbleState, ChatMessage, ExtensionInfo, CommandResult as CoreCommandResult, ProviderConfig, DaemonEvent, StatusResponse, SystemInfo, DetectedIde, ProviderInfo, AgentEntry, } from './types.js';
|
|
7
|
-
export type { SessionEntry, CompactSessionEntry, CompactDaemonEntry, CloudDaemonSummaryEntry, DashboardBootstrapDaemonEntry, VersionUpdateReason, CloudStatusReportPayload, DaemonStatusEventPayload, DashboardStatusEventPayload, SessionTransport, SessionKind, SessionCapability, AgentSessionStream, ReadChatCursor, ReadChatSyncResult, TransportTopic, SessionChatTailSubscriptionParams, SessionRuntimeOutputSubscriptionParams, MachineRuntimeSubscriptionParams, SessionHostDiagnosticsSubscriptionParams, SessionModalSubscriptionParams, DaemonMetadataSubscriptionParams, WorkspaceGitSubscriptionParams, SessionChatTailUpdate, MachineRuntimeUpdate, SessionHostDiagnosticsUpdate, SessionModalUpdate, DaemonMetadataUpdate, TopicUpdateEnvelope, SubscribeRequest, UnsubscribeRequest, StandaloneWsStatusPayload, AvailableProviderInfo, AcpConfigOption, AcpMode, ProviderControlSchema, StatusReportPayload, MachineInfo, SessionHostDiagnosticsSnapshot, SessionHostRecord, SessionHostWriteOwner, SessionHostAttachedClient, SessionHostLogEntry, SessionHostRequestTrace, SessionHostRuntimeTransition, DetectedIdeInfo, WorkspaceEntry, ProviderSummaryItem, ProviderSummaryMetadata, ProviderState, ProviderStatus, ProviderErrorReason, SessionActiveChatData, ActiveChatData, IdeProviderState, CliProviderState, AcpProviderState, ExtensionProviderState, } from './shared-types.js';
|
|
7
|
+
export type { SessionEntry, CompactSessionEntry, CompactDaemonEntry, CloudDaemonSummaryEntry, DashboardBootstrapDaemonEntry, VersionUpdateReason, CloudStatusReportPayload, DaemonStatusEventPayload, DashboardStatusEventPayload, SessionTransport, SessionKind, SessionCapability, AgentSessionStream, ReadChatCursor, ReadChatSyncResult, TransportTopic, SessionChatTailSubscriptionParams, SessionRuntimeOutputSubscriptionParams, MachineRuntimeSubscriptionParams, SessionHostDiagnosticsSubscriptionParams, SessionModalSubscriptionParams, DaemonMetadataSubscriptionParams, WorkspaceGitSubscriptionParams, SessionChatTailUpdate, MachineRuntimeUpdate, SessionHostDiagnosticsUpdate, SessionModalUpdate, DaemonMetadataUpdate, TopicUpdateEnvelope, SubscribeRequest, UnsubscribeRequest, StandaloneWsStatusPayload, AvailableProviderInfo, AcpConfigOption, AcpMode, ProviderControlSchema, StatusReportPayload, MachineInfo, SessionHostDiagnosticsSnapshot, SessionHostRecord, SessionHostWriteOwner, SessionHostAttachedClient, SessionHostLogEntry, SessionHostRequestTrace, SessionHostRuntimeTransition, DetectedIdeInfo, WorkspaceEntry, ProviderSummaryItem, ProviderSummaryMetadata, ProviderState, ProviderStatus, ProviderErrorReason, SessionActiveChatData, ActiveChatData, IdeProviderState, CliProviderState, AcpProviderState, ExtensionProviderState, MessageInputSupport, InputMediaStrategyDescriptor, InputAttachmentStrategy, InputMediaType, } from './shared-types.js';
|
|
8
8
|
export type { RepoMesh, RepoMeshNode, RepoMeshNodeHealth, RepoMeshPolicy, RepoMeshNodePolicy, RepoMeshRelatedRepo, RepoMeshNodeCapabilities, DetectedCommand, ProjectContextSnapshot, ProjectContextSource, RepoMeshCoordinatorConfig, LocalMeshConfig, LocalMeshEntry, LocalMeshNodeEntry, RepoMeshStatus, RepoMeshNodeStatus, } from './repo-mesh-types.js';
|
|
9
9
|
export { DEFAULT_MESH_POLICY } from './repo-mesh-types.js';
|
|
10
10
|
export * from './git/index.js';
|
package/dist/index.js
CHANGED
|
@@ -42,6 +42,7 @@ var init_repo_mesh_types = __esm({
|
|
|
42
42
|
requireApprovalForDestructiveGit: true,
|
|
43
43
|
dirtyWorkspaceBehavior: "warn",
|
|
44
44
|
maxParallelTasks: 2,
|
|
45
|
+
spawnedSessionVisibility: "visible",
|
|
45
46
|
sessionCleanupOnNodeRemove: "preserve"
|
|
46
47
|
};
|
|
47
48
|
}
|
|
@@ -471,6 +472,9 @@ function mergeMeshPolicy(base, patch) {
|
|
|
471
472
|
if (!SESSION_CLEANUP_MODES.has(String(policy.sessionCleanupOnNodeRemove))) {
|
|
472
473
|
policy.sessionCleanupOnNodeRemove = "preserve";
|
|
473
474
|
}
|
|
475
|
+
if (!SPAWNED_SESSION_VISIBILITY_MODES.has(String(policy.spawnedSessionVisibility))) {
|
|
476
|
+
policy.spawnedSessionVisibility = "visible";
|
|
477
|
+
}
|
|
474
478
|
return policy;
|
|
475
479
|
}
|
|
476
480
|
function listMeshes() {
|
|
@@ -575,7 +579,7 @@ function updateNode(meshId, nodeId, opts) {
|
|
|
575
579
|
saveMeshConfig(config);
|
|
576
580
|
return node;
|
|
577
581
|
}
|
|
578
|
-
var import_fs2, import_path2, import_crypto3, SESSION_CLEANUP_MODES;
|
|
582
|
+
var import_fs2, import_path2, import_crypto3, SESSION_CLEANUP_MODES, SPAWNED_SESSION_VISIBILITY_MODES;
|
|
579
583
|
var init_mesh_config = __esm({
|
|
580
584
|
"src/config/mesh-config.ts"() {
|
|
581
585
|
"use strict";
|
|
@@ -585,6 +589,7 @@ var init_mesh_config = __esm({
|
|
|
585
589
|
init_config();
|
|
586
590
|
init_repo_mesh_types();
|
|
587
591
|
SESSION_CLEANUP_MODES = /* @__PURE__ */ new Set(["preserve", "stop", "delete_stopped", "stop_and_delete"]);
|
|
592
|
+
SPAWNED_SESSION_VISIBILITY_MODES = /* @__PURE__ */ new Set(["visible", "hidden"]);
|
|
588
593
|
}
|
|
589
594
|
});
|
|
590
595
|
|
|
@@ -15356,8 +15361,32 @@ function materializeImageDataPart(part, index, dir) {
|
|
|
15356
15361
|
fs6.mkdirSync(dir, { recursive: true });
|
|
15357
15362
|
const filePath = path16.join(dir, safeInputImageBasename(index, part.mimeType));
|
|
15358
15363
|
fs6.writeFileSync(filePath, Buffer.from(rawData, "base64"));
|
|
15364
|
+
cleanupStaleMaterializedImages(dir);
|
|
15359
15365
|
return filePath;
|
|
15360
15366
|
}
|
|
15367
|
+
var MATERIALIZED_IMAGE_MAX_AGE_MS = 60 * 60 * 1e3;
|
|
15368
|
+
var MATERIALIZED_IMAGE_CLEANUP_INTERVAL_MS = 5 * 60 * 1e3;
|
|
15369
|
+
var lastMaterializedImageCleanupAt = 0;
|
|
15370
|
+
function cleanupStaleMaterializedImages(dir) {
|
|
15371
|
+
const now = Date.now();
|
|
15372
|
+
if (now - lastMaterializedImageCleanupAt < MATERIALIZED_IMAGE_CLEANUP_INTERVAL_MS) return;
|
|
15373
|
+
lastMaterializedImageCleanupAt = now;
|
|
15374
|
+
try {
|
|
15375
|
+
const entries = fs6.readdirSync(dir);
|
|
15376
|
+
for (const entry of entries) {
|
|
15377
|
+
if (!entry.startsWith("adhdev-input-image-")) continue;
|
|
15378
|
+
const fullPath = path16.join(dir, entry);
|
|
15379
|
+
try {
|
|
15380
|
+
const stat2 = fs6.statSync(fullPath);
|
|
15381
|
+
if (now - stat2.mtimeMs > MATERIALIZED_IMAGE_MAX_AGE_MS) {
|
|
15382
|
+
fs6.unlinkSync(fullPath);
|
|
15383
|
+
}
|
|
15384
|
+
} catch {
|
|
15385
|
+
}
|
|
15386
|
+
}
|
|
15387
|
+
} catch {
|
|
15388
|
+
}
|
|
15389
|
+
}
|
|
15361
15390
|
function buildCliStructuredInputPrompt(input, options = {}) {
|
|
15362
15391
|
const promptParts = [];
|
|
15363
15392
|
const imageRefs = [];
|
|
@@ -15384,7 +15413,10 @@ function buildCliStructuredInputPrompt(input, options = {}) {
|
|
|
15384
15413
|
resourceRefs.push([part.name, part.text, part.uri].filter(Boolean).join("\n"));
|
|
15385
15414
|
}
|
|
15386
15415
|
});
|
|
15387
|
-
|
|
15416
|
+
const hasExplicitTextParts = input.parts.some((part) => part.type === "text" && part.text.trim());
|
|
15417
|
+
if (!hasExplicitTextParts && input.textFallback.trim()) {
|
|
15418
|
+
promptParts.push(input.textFallback.trim());
|
|
15419
|
+
}
|
|
15388
15420
|
const ordered = [
|
|
15389
15421
|
...imageRefs,
|
|
15390
15422
|
...promptParts,
|
|
@@ -21240,7 +21272,10 @@ function setupMeshEventForwarding(components) {
|
|
|
21240
21272
|
const workspace = readNonEmptyString(state.workspace);
|
|
21241
21273
|
if (!workspace) return;
|
|
21242
21274
|
const settings = state.settings && typeof state.settings === "object" ? state.settings : {};
|
|
21275
|
+
if (readNonEmptyString(settings.meshCoordinatorFor)) return;
|
|
21243
21276
|
const meshIdFromRuntime = readNonEmptyString(settings.meshNodeFor);
|
|
21277
|
+
const isMeshDelegate = Boolean(meshIdFromRuntime || settings.launchedByCoordinator);
|
|
21278
|
+
if (!isMeshDelegate) return;
|
|
21244
21279
|
const mesh = meshIdFromRuntime ? getMesh(meshIdFromRuntime) : getMeshByRepo(workspace);
|
|
21245
21280
|
const meshId = meshIdFromRuntime || readNonEmptyString(mesh?.id);
|
|
21246
21281
|
if (!meshId) return;
|
|
@@ -23730,7 +23765,7 @@ function prepareSessionChatTailUpdate(input) {
|
|
|
23730
23765
|
};
|
|
23731
23766
|
}
|
|
23732
23767
|
const fullMessages = normalizeChatMessages(Array.isArray(result.messages) ? result.messages : []);
|
|
23733
|
-
const messages =
|
|
23768
|
+
const messages = fullMessages;
|
|
23734
23769
|
const title = typeof result.title === "string" ? result.title : void 0;
|
|
23735
23770
|
const activeModal = normalizeChatTailActiveModal(result.activeModal);
|
|
23736
23771
|
const status = typeof result.status === "string" ? result.status : "idle";
|