adhdev 0.6.68 → 0.6.69
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 +101 -56
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +101 -56
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -27120,11 +27120,13 @@ ${data.message || ""}`.trim();
|
|
|
27120
27120
|
buildManagedAcps: () => buildManagedAcps,
|
|
27121
27121
|
buildManagedClis: () => buildManagedClis,
|
|
27122
27122
|
buildManagedIdes: () => buildManagedIdes,
|
|
27123
|
+
buildStatusSnapshot: () => buildStatusSnapshot,
|
|
27123
27124
|
connectCdpManager: () => connectCdpManager,
|
|
27124
27125
|
detectAllVersions: () => detectAllVersions,
|
|
27125
27126
|
detectCLIs: () => detectCLIs,
|
|
27126
27127
|
detectIDEs: () => detectIDEs,
|
|
27127
27128
|
findCdpManager: () => findCdpManager,
|
|
27129
|
+
forwardAgentStreamsToIdeInstance: () => forwardAgentStreamsToIdeInstance2,
|
|
27128
27130
|
getAIExtensions: () => getAIExtensions,
|
|
27129
27131
|
getAvailableIdeIds: () => getAvailableIdeIds,
|
|
27130
27132
|
getHostMemorySnapshot: () => getHostMemorySnapshot,
|
|
@@ -33459,10 +33461,72 @@ ${next}`;
|
|
|
33459
33461
|
LOG5.info("StopIDE", `IDE stopped: ${ideType} (processKill=${killProcess})`);
|
|
33460
33462
|
}
|
|
33461
33463
|
};
|
|
33464
|
+
init_logger();
|
|
33462
33465
|
var os10 = __toESM2(require("os"));
|
|
33463
33466
|
init_config();
|
|
33464
33467
|
init_workspaces();
|
|
33465
|
-
|
|
33468
|
+
function buildDetectedIdeInfos(detectedIdes, cdpManagers) {
|
|
33469
|
+
return detectedIdes.filter((ide) => ide.installed !== false).map((ide) => ({
|
|
33470
|
+
id: ide.id,
|
|
33471
|
+
type: ide.id,
|
|
33472
|
+
name: ide.displayName || ide.name || ide.id,
|
|
33473
|
+
running: isCdpConnected(cdpManagers, ide.id),
|
|
33474
|
+
...ide.path ? { path: ide.path } : {}
|
|
33475
|
+
}));
|
|
33476
|
+
}
|
|
33477
|
+
function buildAvailableProviders(providerLoader) {
|
|
33478
|
+
return providerLoader.getAll().map((provider) => ({
|
|
33479
|
+
type: provider.type,
|
|
33480
|
+
name: provider.displayName || provider.type,
|
|
33481
|
+
displayName: provider.displayName || provider.type,
|
|
33482
|
+
icon: provider.icon || "\u{1F4BB}",
|
|
33483
|
+
category: provider.category
|
|
33484
|
+
}));
|
|
33485
|
+
}
|
|
33486
|
+
function buildStatusSnapshot(options) {
|
|
33487
|
+
const cfg = loadConfig3();
|
|
33488
|
+
const wsState = getWorkspaceState(cfg);
|
|
33489
|
+
const memSnap = getHostMemorySnapshot();
|
|
33490
|
+
const { managedIdes, managedClis, managedAcps } = buildAllManagedEntries(
|
|
33491
|
+
options.allStates,
|
|
33492
|
+
options.cdpManagers,
|
|
33493
|
+
{
|
|
33494
|
+
detectedIdes: options.detectedIdes.map((ide) => ({
|
|
33495
|
+
id: ide.id,
|
|
33496
|
+
installed: ide.installed !== false
|
|
33497
|
+
}))
|
|
33498
|
+
}
|
|
33499
|
+
);
|
|
33500
|
+
return {
|
|
33501
|
+
instanceId: options.instanceId,
|
|
33502
|
+
version: options.version,
|
|
33503
|
+
daemonMode: options.daemonMode,
|
|
33504
|
+
machine: {
|
|
33505
|
+
hostname: os10.hostname(),
|
|
33506
|
+
platform: os10.platform(),
|
|
33507
|
+
arch: os10.arch(),
|
|
33508
|
+
cpus: os10.cpus().length,
|
|
33509
|
+
totalMem: memSnap.totalMem,
|
|
33510
|
+
freeMem: memSnap.freeMem,
|
|
33511
|
+
availableMem: memSnap.availableMem,
|
|
33512
|
+
loadavg: os10.loadavg(),
|
|
33513
|
+
uptime: os10.uptime(),
|
|
33514
|
+
release: os10.release()
|
|
33515
|
+
},
|
|
33516
|
+
machineNickname: options.machineNickname ?? cfg.machineNickname ?? null,
|
|
33517
|
+
timestamp: options.timestamp ?? Date.now(),
|
|
33518
|
+
detectedIdes: buildDetectedIdeInfos(options.detectedIdes, options.cdpManagers),
|
|
33519
|
+
...options.p2p ? { p2p: options.p2p } : {},
|
|
33520
|
+
managedIdes,
|
|
33521
|
+
managedClis,
|
|
33522
|
+
managedAcps,
|
|
33523
|
+
workspaces: wsState.workspaces,
|
|
33524
|
+
defaultWorkspaceId: wsState.defaultWorkspaceId,
|
|
33525
|
+
defaultWorkspacePath: wsState.defaultWorkspacePath,
|
|
33526
|
+
workspaceActivity: getWorkspaceActivity(cfg, 15),
|
|
33527
|
+
availableProviders: buildAvailableProviders(options.providerLoader)
|
|
33528
|
+
};
|
|
33529
|
+
}
|
|
33466
33530
|
var DaemonStatusReporter2 = class {
|
|
33467
33531
|
deps;
|
|
33468
33532
|
log;
|
|
@@ -33569,46 +33633,25 @@ ${next}`;
|
|
|
33569
33633
|
allStates,
|
|
33570
33634
|
this.deps.cdpManagers
|
|
33571
33635
|
);
|
|
33572
|
-
const cfg = loadConfig3();
|
|
33573
|
-
const wsState = getWorkspaceState(cfg);
|
|
33574
|
-
const memSnap = getHostMemorySnapshot();
|
|
33575
33636
|
const payload = {
|
|
33576
|
-
|
|
33577
|
-
|
|
33578
|
-
|
|
33579
|
-
|
|
33580
|
-
|
|
33581
|
-
|
|
33582
|
-
|
|
33583
|
-
|
|
33584
|
-
|
|
33585
|
-
|
|
33586
|
-
|
|
33587
|
-
|
|
33588
|
-
|
|
33589
|
-
|
|
33590
|
-
|
|
33591
|
-
|
|
33592
|
-
},
|
|
33593
|
-
managedIdes,
|
|
33594
|
-
managedClis,
|
|
33595
|
-
managedAcps,
|
|
33596
|
-
p2p: {
|
|
33597
|
-
available: p2p?.isAvailable || false,
|
|
33598
|
-
state: p2p?.connectionState || "unavailable",
|
|
33599
|
-
peers: p2p?.connectedPeerCount || 0,
|
|
33600
|
-
screenshotActive: p2p?.screenshotActive || false
|
|
33601
|
-
},
|
|
33637
|
+
...buildStatusSnapshot({
|
|
33638
|
+
allStates,
|
|
33639
|
+
cdpManagers: this.deps.cdpManagers,
|
|
33640
|
+
providerLoader: this.deps.providerLoader,
|
|
33641
|
+
detectedIdes: this.deps.detectedIdes || [],
|
|
33642
|
+
instanceId: this.deps.instanceId,
|
|
33643
|
+
version: this.deps.daemonVersion || "unknown",
|
|
33644
|
+
daemonMode: true,
|
|
33645
|
+
timestamp: now,
|
|
33646
|
+
p2p: {
|
|
33647
|
+
available: p2p?.isAvailable || false,
|
|
33648
|
+
state: p2p?.connectionState || "unavailable",
|
|
33649
|
+
peers: p2p?.connectedPeerCount || 0,
|
|
33650
|
+
screenshotActive: p2p?.screenshotActive || false
|
|
33651
|
+
}
|
|
33652
|
+
}),
|
|
33602
33653
|
screenshotUsage: this.deps.getScreenshotUsage?.() || null,
|
|
33603
|
-
connectedExtensions: []
|
|
33604
|
-
detectedIdes: this.deps.detectedIdes || [],
|
|
33605
|
-
availableProviders: this.deps.providerLoader.getAll().map((p) => ({
|
|
33606
|
-
type: p.type,
|
|
33607
|
-
icon: p.icon || "\u{1F4BB}",
|
|
33608
|
-
displayName: p.displayName || p.type,
|
|
33609
|
-
category: p.category
|
|
33610
|
-
})),
|
|
33611
|
-
timestamp: now
|
|
33654
|
+
connectedExtensions: []
|
|
33612
33655
|
};
|
|
33613
33656
|
const p2pSent = this.sendP2PPayload(payload);
|
|
33614
33657
|
if (p2pSent) {
|
|
@@ -35621,6 +35664,21 @@ ${installInfo}`
|
|
|
35621
35664
|
}
|
|
35622
35665
|
}
|
|
35623
35666
|
};
|
|
35667
|
+
function forwardAgentStreamsToIdeInstance2(instanceManager, ideType, streams) {
|
|
35668
|
+
const ideInstance = instanceManager.getInstance(`ide:${ideType}`);
|
|
35669
|
+
if (!ideInstance?.onEvent) return;
|
|
35670
|
+
for (const stream of streams) {
|
|
35671
|
+
ideInstance.onEvent("stream_update", {
|
|
35672
|
+
extensionType: stream.agentType,
|
|
35673
|
+
streams: [stream],
|
|
35674
|
+
messages: stream.messages || [],
|
|
35675
|
+
status: stream.status || "idle",
|
|
35676
|
+
activeModal: stream.activeModal || null,
|
|
35677
|
+
model: stream.model || void 0,
|
|
35678
|
+
mode: stream.mode || void 0
|
|
35679
|
+
});
|
|
35680
|
+
}
|
|
35681
|
+
}
|
|
35624
35682
|
init_logger();
|
|
35625
35683
|
var ProviderInstanceManager = class {
|
|
35626
35684
|
instances = /* @__PURE__ */ new Map();
|
|
@@ -40909,7 +40967,7 @@ var init_adhdev_daemon = __esm({
|
|
|
40909
40967
|
fs3 = __toESM(require("fs"));
|
|
40910
40968
|
path2 = __toESM(require("path"));
|
|
40911
40969
|
import_chalk = __toESM(require("chalk"));
|
|
40912
|
-
pkgVersion = "0.6.
|
|
40970
|
+
pkgVersion = "0.6.69";
|
|
40913
40971
|
if (pkgVersion === "unknown") {
|
|
40914
40972
|
try {
|
|
40915
40973
|
const possiblePaths = [
|
|
@@ -41004,20 +41062,8 @@ ${err?.stack || ""}`);
|
|
|
41004
41062
|
if (this.ideType === "unknown") this.ideType = ideType;
|
|
41005
41063
|
},
|
|
41006
41064
|
onStreamsUpdated: (ideType, streams) => {
|
|
41007
|
-
|
|
41008
|
-
|
|
41009
|
-
for (const stream of streams) {
|
|
41010
|
-
ideInstance.onEvent("stream_update", {
|
|
41011
|
-
extensionType: stream.agentType,
|
|
41012
|
-
streams: [stream],
|
|
41013
|
-
messages: stream.messages || [],
|
|
41014
|
-
status: stream.status || "idle",
|
|
41015
|
-
activeModal: stream.activeModal || null,
|
|
41016
|
-
model: stream.model || void 0,
|
|
41017
|
-
mode: stream.mode || void 0
|
|
41018
|
-
});
|
|
41019
|
-
}
|
|
41020
|
-
}
|
|
41065
|
+
if (!this.components) return;
|
|
41066
|
+
(0, import_daemon_core4.forwardAgentStreamsToIdeInstance)(this.components.instanceManager, ideType, streams);
|
|
41021
41067
|
}
|
|
41022
41068
|
});
|
|
41023
41069
|
this.components.providerLoader.fetchLatest().then(({ updated }) => {
|
|
@@ -41122,9 +41168,8 @@ ${err?.stack || ""}`);
|
|
|
41122
41168
|
cdpManagers: this.components.cdpManagers,
|
|
41123
41169
|
p2p: this.p2p,
|
|
41124
41170
|
providerLoader: this.components.providerLoader,
|
|
41125
|
-
adapters: this.components.cliManager.adapters,
|
|
41126
41171
|
detectedIdes: this.components.detectedIdes.value,
|
|
41127
|
-
|
|
41172
|
+
instanceId,
|
|
41128
41173
|
daemonVersion: pkgVersion,
|
|
41129
41174
|
instanceManager: this.components.instanceManager,
|
|
41130
41175
|
getScreenshotUsage: () => this.screenshotController?.getUsageStats() || null
|