@adhdev/daemon-core 1.0.24-rc.1 → 1.0.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/dist/index.js +13 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/providers/provider-loader.ts +12 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adhdev/daemon-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.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",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"author": "vilmire",
|
|
48
48
|
"license": "AGPL-3.0-or-later",
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@adhdev/mesh-shared": "
|
|
51
|
-
"@adhdev/session-host-core": "
|
|
50
|
+
"@adhdev/mesh-shared": "*",
|
|
51
|
+
"@adhdev/session-host-core": "*",
|
|
52
52
|
"@agentclientprotocol/sdk": "^0.16.1",
|
|
53
53
|
"ajv": "^8.20.0",
|
|
54
54
|
"ajv-formats": "^3.0.1",
|
|
@@ -37,6 +37,7 @@ import {
|
|
|
37
37
|
resolveActiveSource,
|
|
38
38
|
} from './external-sources.js';
|
|
39
39
|
import type { ProviderSourceMode } from '../config/config.js';
|
|
40
|
+
import { getConfigDir } from '../config/config.js';
|
|
40
41
|
import {
|
|
41
42
|
resolveRegistryBaseUrl,
|
|
42
43
|
resolveProviderTarballUrl,
|
|
@@ -237,7 +238,7 @@ export class ProviderLoader {
|
|
|
237
238
|
}
|
|
238
239
|
|
|
239
240
|
private detectDefaultUserDir(): { path: string; source: 'sibling-env' | 'sibling-marker' | 'home-default' } {
|
|
240
|
-
const fallback = path.join(
|
|
241
|
+
const fallback = path.join(getConfigDir(), 'providers');
|
|
241
242
|
const envOptIn = process.env[ProviderLoader.SIBLING_ENV_VAR] === '1';
|
|
242
243
|
const visited = new Set<string>();
|
|
243
244
|
|
|
@@ -305,8 +306,10 @@ export class ProviderLoader {
|
|
|
305
306
|
this.registryBaseUrl = resolveRegistryBaseUrl(options?.registryUrl);
|
|
306
307
|
this.providerTarballUrl = resolveProviderTarballUrl(options?.providerTarballUrl);
|
|
307
308
|
|
|
308
|
-
// Default directory for auto-downloads
|
|
309
|
-
|
|
309
|
+
// Default directory for auto-downloads. Resolved via getConfigDir() so
|
|
310
|
+
// ADHDEV_CONFIG_DIR (preview/stable instance isolation) is honored instead
|
|
311
|
+
// of a hardcoded ~/.adhdev.
|
|
312
|
+
this.defaultProvidersDir = path.join(getConfigDir(), 'providers');
|
|
310
313
|
const detected = this.detectDefaultUserDir();
|
|
311
314
|
this.userDir = detected.path;
|
|
312
315
|
this.userDirSource = detected.source;
|
|
@@ -329,9 +332,9 @@ export class ProviderLoader {
|
|
|
329
332
|
|
|
330
333
|
private migrateMarketplaceDirToExternal(): void {
|
|
331
334
|
try {
|
|
332
|
-
const
|
|
333
|
-
const oldDir = path.join(
|
|
334
|
-
const newDir = path.join(
|
|
335
|
+
const configDir = getConfigDir();
|
|
336
|
+
const oldDir = path.join(configDir, 'marketplace');
|
|
337
|
+
const newDir = path.join(configDir, 'external');
|
|
335
338
|
if (!fs.existsSync(oldDir)) return;
|
|
336
339
|
if (fs.existsSync(newDir)) {
|
|
337
340
|
// Both exist — don't merge. Leave old in place; surface in logs so
|
|
@@ -380,7 +383,7 @@ export class ProviderLoader {
|
|
|
380
383
|
// (official auto-sync). findProviderDirInternal walks this list in order
|
|
381
384
|
// to locate the provider dir containing the scripts/, so external must
|
|
382
385
|
// be included here even though loadAll() also reads it directly.
|
|
383
|
-
const externalDir = path.join(
|
|
386
|
+
const externalDir = path.join(getConfigDir(), 'external');
|
|
384
387
|
return [this.userDir, externalDir, this.upstreamDir];
|
|
385
388
|
}
|
|
386
389
|
|
|
@@ -511,7 +514,7 @@ export class ProviderLoader {
|
|
|
511
514
|
// an external source runs JavaScript the daemon hasn't audited, so
|
|
512
515
|
// dashboards must surface an "untrusted source" badge before letting
|
|
513
516
|
// the user enable them.
|
|
514
|
-
const externalDir = path.join(
|
|
517
|
+
const externalDir = path.join(getConfigDir(), 'external');
|
|
515
518
|
if (fs.existsSync(externalDir)) {
|
|
516
519
|
// Legacy layout (pre-source-namespace): manifests sit directly at
|
|
517
520
|
// external/<category>/<type>/. Detect by presence of category dirs at
|
|
@@ -2414,7 +2417,7 @@ export class ProviderLoader {
|
|
|
2414
2417
|
// came from + whether it ships JavaScript hooks. The dashboard
|
|
2415
2418
|
// uses this to render trust badges; non-spec external manifests
|
|
2416
2419
|
// need an explicit user confirm before activation.
|
|
2417
|
-
const externalDirAbs = path.join(
|
|
2420
|
+
const externalDirAbs = path.join(getConfigDir(), 'external');
|
|
2418
2421
|
const layer: 'user' | 'upstream' | 'external' = d.startsWith(externalDirAbs)
|
|
2419
2422
|
? 'external'
|
|
2420
2423
|
: (d.startsWith(this.userDir) && !d.includes('.upstream') ? 'user' : 'upstream');
|