neohive 6.1.4 → 6.2.0
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/cli.js +9 -1
- package/dashboard.html +300 -842
- package/dashboard.js +13 -4
- package/package.json +1 -1
package/dashboard.js
CHANGED
|
@@ -169,6 +169,7 @@ function readNeohiveDataDirFromMcpConfigs(projectRoot) {
|
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
function resolveDashboardDefaultDataDir() {
|
|
172
|
+
// 1. Explicit env var — highest priority
|
|
172
173
|
let envData = process.env.NEOHIVE_DATA_DIR || process.env.NEOHIVE_DATA;
|
|
173
174
|
if (envData && String(envData).trim()) {
|
|
174
175
|
let s = String(envData).trim();
|
|
@@ -178,10 +179,10 @@ function resolveDashboardDefaultDataDir() {
|
|
|
178
179
|
}
|
|
179
180
|
return { path: path.resolve(s), source: 'environment' };
|
|
180
181
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
|
|
183
|
+
// 2. Project MCP config — authoritative, written by `neohive init`
|
|
184
|
+
// Check this BEFORE the directory walk so a stale ~/.neohive/ from
|
|
185
|
+
// a previous session doesn't shadow the project's explicit config.
|
|
185
186
|
let dir = path.resolve(process.cwd());
|
|
186
187
|
const root = path.parse(dir).root;
|
|
187
188
|
while (true) {
|
|
@@ -192,6 +193,14 @@ function resolveDashboardDefaultDataDir() {
|
|
|
192
193
|
if (dir === root) break;
|
|
193
194
|
dir = path.dirname(dir);
|
|
194
195
|
}
|
|
196
|
+
|
|
197
|
+
// 3. Walk up looking for .neohive/ directories — best-effort fallback
|
|
198
|
+
const fromWalk = bestNeohiveAmongAncestors(process.cwd());
|
|
199
|
+
if (fromWalk) {
|
|
200
|
+
return { path: fromWalk, source: 'walk-up' };
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// 4. cwd/.neohive — last resort
|
|
195
204
|
return { path: path.join(process.cwd(), '.neohive'), source: 'cwd' };
|
|
196
205
|
}
|
|
197
206
|
|