@oh-my-pi/pi-catalog 18.4.11 → 18.5.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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [18.5.0] - 2026-10-03
6
+
7
+ ### Added
8
+
9
+ - Added `closeModelCache()` (`@oh-my-pi/pi-catalog/model-cache`) to release the shared default `models.db` handle so an agent directory can be deleted on Windows; the next cache access reopens it
10
+
5
11
  ## [18.4.11] - 2026-10-02
6
12
 
7
13
  ### Fixed
@@ -35,6 +35,12 @@ export interface CacheEntry<TApi extends Api = Api> {
35
35
  */
36
36
  staticFingerprint: string;
37
37
  }
38
+ /**
39
+ * Closes the shared handle to the default `<agent-dir>/models.db`; the next
40
+ * default-path access reopens it. Call before deleting an agent directory the
41
+ * cache was opened under — Windows cannot remove a database that is still open.
42
+ */
43
+ export declare function closeModelCache(): void;
38
44
  export declare function readModelCache<TApi extends Api>(providerId: string, ttlMs: number, now: () => number, dbPath?: string): CacheEntry<TApi> | null;
39
45
  /**
40
46
  * Persist a provider snapshot.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-pi/pi-catalog",
3
- "version": "18.4.11",
3
+ "version": "18.5.0",
4
4
  "description": "Model catalog for omp: bundled model database, provider discovery descriptors, model identity, classification, and equivalence",
5
5
  "keywords": [
6
6
  "ai",
@@ -93,12 +93,12 @@
93
93
  "gen:proto": "bun scripts/generate-protocols.ts"
94
94
  },
95
95
  "dependencies": {
96
- "@oh-my-pi/omptype": "18.4.11",
97
- "@oh-my-pi/pi-utils": "18.4.11"
96
+ "@oh-my-pi/omptype": "18.5.0",
97
+ "@oh-my-pi/pi-utils": "18.5.0"
98
98
  },
99
99
  "devDependencies": {
100
100
  "@bgotink/kdl": "0.4.0",
101
- "@oh-my-pi/pi-ai": "18.4.11",
101
+ "@oh-my-pi/pi-ai": "18.5.0",
102
102
  "@types/bun": "^1.3.14"
103
103
  },
104
104
  "engines": {
@@ -234,6 +234,16 @@ function closeSharedDb(): void {
234
234
  sharedDbPath = null;
235
235
  }
236
236
 
237
+ /**
238
+ * Closes the shared handle to the default `<agent-dir>/models.db`; the next
239
+ * default-path access reopens it. Call before deleting an agent directory the
240
+ * cache was opened under — Windows cannot remove a database that is still open.
241
+ */
242
+ export function closeModelCache(): void {
243
+ if (sharedDbPath) invalidateReadPath(sharedDbPath);
244
+ closeSharedDb();
245
+ }
246
+
237
247
  function runModelCacheDb<T>(resolvedPath: string, shared: boolean, useDb: (db: Database) => T): T {
238
248
  if (shared && sharedDb && sharedDbPath !== resolvedPath) closeSharedDb();
239
249
  if (shared && sharedDb) {