facult 2.15.1 → 2.15.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/manage.ts +28 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "facult",
3
- "version": "2.15.1",
3
+ "version": "2.15.2",
4
4
  "description": "Manage canonical AI capabilities, sync surfaces, and evolution state.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/manage.ts CHANGED
@@ -1005,6 +1005,33 @@ async function canonicalCodexPluginsExist(
1005
1005
  return (await loadCanonicalCodexPlugins(rootDir, homeDir)).length > 0;
1006
1006
  }
1007
1007
 
1008
+ async function canonicalCodexPluginSourceExists(
1009
+ rootDir: string
1010
+ ): Promise<boolean> {
1011
+ if (await fileExists(codexCanonicalPluginMarketplacePath(rootDir))) {
1012
+ return true;
1013
+ }
1014
+
1015
+ const pluginsRoot = codexCanonicalPluginsRoot(rootDir);
1016
+ const entries = await readdir(pluginsRoot, { withFileTypes: true }).catch(
1017
+ () => [] as import("node:fs").Dirent[]
1018
+ );
1019
+ for (const entry of entries) {
1020
+ if (!entry.isDirectory() || entry.name.startsWith(".")) {
1021
+ continue;
1022
+ }
1023
+ if (
1024
+ await fileExists(
1025
+ join(pluginsRoot, entry.name, ".codex-plugin", "plugin.json")
1026
+ )
1027
+ ) {
1028
+ return true;
1029
+ }
1030
+ }
1031
+
1032
+ return false;
1033
+ }
1034
+
1008
1035
  async function loadCanonicalCodexMarketplaceText(
1009
1036
  rootDir: string,
1010
1037
  homeDir?: string
@@ -3483,7 +3510,7 @@ async function repairManagedToolEntry(args: {
3483
3510
  !(next.pluginsDir && next.pluginMarketplacePath) &&
3484
3511
  toolPaths.pluginsDir &&
3485
3512
  toolPaths.pluginMarketplacePath &&
3486
- (await canonicalCodexPluginsExist(rootDir, homeDir))
3513
+ (await canonicalCodexPluginSourceExists(rootDir))
3487
3514
  ) {
3488
3515
  if (!next.pluginsDir) {
3489
3516
  next.pluginsBackup = await backupPath(toolPaths.pluginsDir);