facult 2.8.6 → 2.8.7

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/README.md CHANGED
@@ -703,7 +703,8 @@ Under machine-local Facult state:
703
703
  - `.../autosync/services/*.json` (autosync service configs)
704
704
  - `.../autosync/state/*.json` (autosync runtime state)
705
705
  - `.../autosync/logs/*` (autosync service logs)
706
- - `runtime/<version>/<platform-arch>/...` under the machine-local cache root (npm launcher binary cache)
706
+ - `cache/runtime/<version>/<platform-arch>/...` under the macOS machine-local state root, or `runtime/<version>/<platform-arch>/...` under `FACULT_CACHE_DIR`/XDG cache roots on other platforms (npm launcher binary cache)
707
+ - if that cache root is unavailable, the npm launcher falls back to a temp-dir runtime cache before using the bundled source fallback
707
708
 
708
709
  ### Config reference
709
710
 
package/bin/fclt.cjs CHANGED
@@ -45,7 +45,7 @@ function localCacheRoot(home) {
45
45
  return path.resolve(override);
46
46
  }
47
47
  if (process.platform === "darwin") {
48
- return path.join(home, "Library", "Caches", "fclt");
48
+ return path.join(localStateRoot(home), "cache");
49
49
  }
50
50
  const xdg = String(process.env.XDG_CACHE_HOME || "").trim();
51
51
  return xdg
@@ -67,7 +67,7 @@ async function main() {
67
67
  }
68
68
 
69
69
  const home = os.homedir();
70
- const cacheRoot = path.join(localCacheRoot(home), "runtime");
70
+ const cacheRoot = await runtimeCacheRoot(home);
71
71
  const installDir = path.join(
72
72
  cacheRoot,
73
73
  version,
@@ -174,6 +174,22 @@ async function main() {
174
174
  process.exit(1);
175
175
  }
176
176
 
177
+ async function runtimeCacheRoot(home) {
178
+ const primary = path.join(localCacheRoot(home), "runtime");
179
+ try {
180
+ await fsp.mkdir(primary, { recursive: true });
181
+ return primary;
182
+ } catch {
183
+ const fallback = path.join(os.tmpdir(), "fclt", "runtime-cache");
184
+ try {
185
+ await fsp.mkdir(fallback, { recursive: true });
186
+ return fallback;
187
+ } catch {
188
+ return primary;
189
+ }
190
+ }
191
+ }
192
+
177
193
  async function canUseSourceFallback(sourceEntry) {
178
194
  if (!(await fileExists(sourceEntry))) {
179
195
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "facult",
3
- "version": "2.8.6",
3
+ "version": "2.8.7",
4
4
  "description": "Manage canonical AI capabilities, sync surfaces, and evolution state.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/paths.ts CHANGED
@@ -114,7 +114,7 @@ export function facultLocalCacheRoot(home: string = defaultHomeDir()): string {
114
114
  return resolvePath(override, home);
115
115
  }
116
116
  if (process.platform === "darwin") {
117
- return join(home, "Library", "Caches", "fclt");
117
+ return join(facultLocalStateRoot(home), "cache");
118
118
  }
119
119
  const xdg = process.env.XDG_CACHE_HOME?.trim();
120
120
  return xdg