@codemem/core 0.29.0 → 0.29.1

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/dist/db.d.ts CHANGED
@@ -18,6 +18,7 @@ export declare const SCHEMA_VERSION = 7;
18
18
  * too old to have the tables/columns it needs.
19
19
  */
20
20
  export declare const MIN_COMPATIBLE_SCHEMA = 6;
21
+ export declare const REQUIRED_BOOTSTRAPPED_TABLES: readonly ["memory_items", "sessions", "artifacts", "raw_events", "raw_event_sessions", "usage_events", "memory_fts"];
21
22
  /** Default database path — matches Python's DEFAULT_DB_PATH. */
22
23
  export declare const DEFAULT_DB_PATH: string;
23
24
  /**
@@ -77,10 +78,16 @@ export declare function backupOnFirstAccess(dbPath: string): void;
77
78
  /**
78
79
  * Verify the database schema is initialized and compatible.
79
80
  *
81
+ * Empty writable first-run handles are bootstrapped here as a final safety net,
82
+ * even though `connect()` already does the same. A few lower-level maintenance
83
+ * and integration paths call this assertion after receiving an existing database
84
+ * handle, so keeping the bootstrap invariant here prevents one entry point from
85
+ * requiring a manual `codemem db init` while another works automatically.
86
+ *
80
87
  * Per the coexistence contract: TS tolerates additive newer schemas (Python may
81
88
  * have run migrations that add tables/columns the TS runtime doesn't know about).
82
89
  * TS only hard-fails if:
83
- * - Schema is uninitialized (version 0)
90
+ * - Schema is still uninitialized after a bootstrap attempt (version 0)
84
91
  * - Schema is too old (below MIN_COMPATIBLE_SCHEMA)
85
92
  * - Required tables are missing
86
93
  * - FTS5 index is missing (needed for search)
package/dist/db.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../src/db.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgBH,OAAO,KAAK,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAO/D,YAAY,EAAE,YAAY,IAAI,QAAQ,EAAE,CAAC;AAEzC,gEAAgE;AAChE,eAAO,MAAM,cAAc,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AG7C;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,YAAY,GAAG,MAAM,CAGzD;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA2GxD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAsCxD;AAED,+CAA+C;AAC/C,wBAAgB,WAAW,CAAC,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAKpE;AAED,2CAA2C;AAC3C,wBAAgB,YAAY,CAAC,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAMrF;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CA8IxE;AAED,2DAA2D;AAC3D,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAYjF;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASvF;AAED,oEAAoE;AACpE,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAG5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAW3D"}
package/dist/home.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare function codememHomeDir(): string;
2
+ //# sourceMappingURL=home.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../src/home.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,IAAI,MAAM,CAEvC"}
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * This package owns the SQLite store, embedding worker interface,
5
5
  * and type definitions shared across the codemem TS backend.
6
6
  */
7
- export declare const VERSION = "0.29.0";
7
+ export declare const VERSION = "0.29.1";
8
8
  export * as Api from "./api-types.js";
9
9
  export { extractApplyPatchPaths, MUTATING_TOOL_NAMES } from "./apply-patch.js";
10
10
  export type { CreateBetterSqliteCoordinatorAppOptions } from "./better-sqlite-coordinator-runtime.js";