@adhdev/daemon-core 0.5.24 → 0.5.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-core",
3
- "version": "0.5.24",
3
+ "version": "0.5.25",
4
4
  "description": "ADHDev daemon core — CDP, IDE detection, providers, command execution",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -112,6 +112,21 @@ export class AgentStreamPoller {
112
112
  }
113
113
  }
114
114
  }
115
+
116
+ // 1c. If the active agent stream belongs to a now-disabled extension, detach it
117
+ if (this._activeIdeType === ideType && agentStreamManager.activeAgentType) {
118
+ const activeType = agentStreamManager.activeAgentType;
119
+ const enabledExtTypes = new Set(
120
+ providerLoader.getEnabledExtensionProviders(ideType).map((p: any) => p.type)
121
+ );
122
+ if (!enabledExtTypes.has(activeType)) {
123
+ LOG.info('AgentStream', `Active agent ${activeType} was disabled for ${ideType} — detaching`);
124
+ await agentStreamManager.switchActiveAgent(cdp, null);
125
+ this._activeIdeType = null;
126
+ // Report empty streams so dashboard removes the tab
127
+ this.deps.onStreamsUpdated?.(ideType, []);
128
+ }
129
+ }
115
130
  }
116
131
 
117
132
  // ─── Phase 2: Agent session sync + collect ───
@@ -28,7 +28,9 @@ try {
28
28
  if (os.platform() !== 'win32') {
29
29
  try {
30
30
  const fs = require('fs');
31
- const ptyDir = path.dirname(require.resolve('node-pty'));
31
+ // require.resolve('node-pty') → .../node-pty/lib/index.js
32
+ // prebuilds/ is at .../node-pty/prebuilds/, not .../node-pty/lib/prebuilds/
33
+ const ptyDir = path.resolve(path.dirname(require.resolve('node-pty')), '..');
32
34
  const arch = os.arch() === 'arm64' ? 'darwin-arm64' : 'darwin-x64';
33
35
  const helper = path.join(ptyDir, 'prebuilds', arch, 'spawn-helper');
34
36
  if (fs.existsSync(helper)) {