@oh-my-pi/pi-utils 17.3.8 → 17.4.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.
@@ -181,6 +181,8 @@ export declare function getGpuCachePath(): string;
181
181
  * cache file without touching the rest of the config root.
182
182
  */
183
183
  export declare function getGithubCacheDbPath(): string;
184
+ /** Get the legacy Pi extension parse cache database path. */
185
+ export declare function getLegacyPiExtensionCacheDbPath(): string;
184
186
  /**
185
187
  * Get the encrypted auth-broker snapshot cache path (~/.omp/cache/auth-broker-snapshot.enc).
186
188
  * Honors the `OMP_AUTH_BROKER_SNAPSHOT_CACHE` env var when set so tests and
@@ -243,8 +245,12 @@ export declare function getCrashLogPath(agentDir?: string): string;
243
245
  export declare function getDebugLogPath(agentDir?: string): string;
244
246
  /** Get the secret placeholder key path (~/.omp/agent/secret-placeholder.key; XDG default: $XDG_STATE_HOME/omp/secret-placeholder.key). Adopts a legacy key on first XDG resolution. */
245
247
  export declare function getSecretPlaceholderKeyPath(): string;
248
+ /** Root directory containing every per-project daemon runtime scope (~/.omp/run/daemons; XDG default: $XDG_STATE_HOME/omp/run/daemons). */
249
+ export declare function getDaemonRuntimeRoot(): string;
246
250
  /** Get the daemon runtime directory for a project (~/.omp/run/daemons/<hash>; XDG default: $XDG_STATE_HOME/omp/run/daemons/<hash>). */
247
251
  export declare function getDaemonRuntimeDir(projectDir: string): string;
252
+ /** Root directory containing every machine-global daemon service scope. */
253
+ export declare function getGlobalDaemonRuntimeRoot(): string;
248
254
  /** Get a profile-independent runtime directory for a machine-global daemon service. */
249
255
  export declare function getGlobalDaemonRuntimeDir(service: string): string;
250
256
  /** Get the provider in-flight root directory (~/.omp/run/provider-inflight; XDG default: $XDG_STATE_HOME/omp/run/provider-inflight). */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-utils",
4
- "version": "17.3.8",
4
+ "version": "17.4.0",
5
5
  "description": "Shared utilities for pi packages",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": "Can Boluk",
@@ -31,7 +31,7 @@
31
31
  "fmt": "biome format --write ."
32
32
  },
33
33
  "dependencies": {
34
- "@oh-my-pi/pi-natives": "17.3.8"
34
+ "@oh-my-pi/pi-natives": "17.4.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/bun": "^1.3.14"
package/src/dirs.ts CHANGED
@@ -678,6 +678,11 @@ export function getGithubCacheDbPath(): string {
678
678
  return dirs.rootSubdir(path.join("cache", "github-cache.db"), "cache");
679
679
  }
680
680
 
681
+ /** Get the legacy Pi extension parse cache database path. */
682
+ export function getLegacyPiExtensionCacheDbPath(): string {
683
+ return dirs.rootSubdir(path.join("cache", "legacy-pi-extension-cache.db"), "cache");
684
+ }
685
+
681
686
  /**
682
687
  * Get the encrypted auth-broker snapshot cache path (~/.omp/cache/auth-broker-snapshot.enc).
683
688
  * Honors the `OMP_AUTH_BROKER_SNAPSHOT_CACHE` env var when set so tests and
@@ -854,10 +859,20 @@ export function getSecretPlaceholderKeyPath(): string {
854
859
  return keyPath;
855
860
  }
856
861
 
862
+ /** Root directory containing every per-project daemon runtime scope (~/.omp/run/daemons; XDG default: $XDG_STATE_HOME/omp/run/daemons). */
863
+ export function getDaemonRuntimeRoot(): string {
864
+ return dirs.rootSubdir(path.join("run", "daemons"), "state");
865
+ }
866
+
857
867
  /** Get the daemon runtime directory for a project (~/.omp/run/daemons/<hash>; XDG default: $XDG_STATE_HOME/omp/run/daemons/<hash>). */
858
868
  export function getDaemonRuntimeDir(projectDir: string): string {
859
869
  const key = Bun.hash.wyhash(path.resolve(projectDir)).toString(16).padStart(16, "0");
860
- return dirs.rootSubdir(path.join("run", "daemons", key), "state");
870
+ return path.join(getDaemonRuntimeRoot(), key);
871
+ }
872
+
873
+ /** Root directory containing every machine-global daemon service scope. */
874
+ export function getGlobalDaemonRuntimeRoot(): string {
875
+ return path.join(getBaseConfigRoot(), "run", "daemons", "global");
861
876
  }
862
877
 
863
878
  /** Get a profile-independent runtime directory for a machine-global daemon service. */
@@ -865,7 +880,7 @@ export function getGlobalDaemonRuntimeDir(service: string): string {
865
880
  if (!/^[a-z0-9][a-z0-9._-]*$/i.test(service)) {
866
881
  throw new Error(`Invalid global daemon service name: ${JSON.stringify(service)}`);
867
882
  }
868
- return path.join(getBaseConfigRoot(), "run", "daemons", "global", service);
883
+ return path.join(getGlobalDaemonRuntimeRoot(), service);
869
884
  }
870
885
 
871
886
  /** Get the provider in-flight root directory (~/.omp/run/provider-inflight; XDG default: $XDG_STATE_HOME/omp/run/provider-inflight). */