facult 2.7.3 → 2.7.4
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 +1 -1
- package/src/paths.ts +21 -1
package/package.json
CHANGED
package/src/paths.ts
CHANGED
|
@@ -147,6 +147,26 @@ function looksLikeFacultRoot(root: string): boolean {
|
|
|
147
147
|
);
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
function isProjectAiRoot(root: string): boolean {
|
|
151
|
+
if (!dirExists(root)) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (looksLikeFacultRoot(root)) {
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (fileExists(join(root, "config.toml"))) {
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (dirExists(join(root, ".facult", "ai"))) {
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
|
|
150
170
|
function detectLegacyStoreUnderAgents(home: string): string | null {
|
|
151
171
|
const agentsDir = join(home, "agents");
|
|
152
172
|
let entries: any[];
|
|
@@ -497,7 +517,7 @@ export function findNearestProjectAiRoot(start: string): string | null {
|
|
|
497
517
|
let current = resolve(start);
|
|
498
518
|
while (true) {
|
|
499
519
|
const candidate = join(current, ".ai");
|
|
500
|
-
if (
|
|
520
|
+
if (isProjectAiRoot(candidate)) {
|
|
501
521
|
return candidate;
|
|
502
522
|
}
|
|
503
523
|
const parent = dirname(current);
|