@zhushanwen/zcode-session-source 0.2.9 → 0.2.10
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/index.js +10 -11
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -325,12 +325,7 @@ function wrapDb(db) {
|
|
|
325
325
|
},
|
|
326
326
|
readSchemaVersion() {
|
|
327
327
|
try {
|
|
328
|
-
|
|
329
|
-
if (typeof row === "object" && row !== null) {
|
|
330
|
-
const v = row.app_version;
|
|
331
|
-
if (typeof v === "string" && v.length > 0) return v;
|
|
332
|
-
}
|
|
333
|
-
return void 0;
|
|
328
|
+
return queryLatestSchemaVersion(db);
|
|
334
329
|
} catch {
|
|
335
330
|
return void 0;
|
|
336
331
|
}
|
|
@@ -344,14 +339,18 @@ function wrapDb(db) {
|
|
|
344
339
|
}
|
|
345
340
|
};
|
|
346
341
|
}
|
|
342
|
+
function queryLatestSchemaVersion(db) {
|
|
343
|
+
const row = db.prepare("SELECT app_version FROM schema_migration ORDER BY time_applied DESC LIMIT 1").get();
|
|
344
|
+
if (typeof row === "object" && row !== null) {
|
|
345
|
+
const v = row.app_version;
|
|
346
|
+
if (typeof v === "string" && v.length > 0) return v;
|
|
347
|
+
}
|
|
348
|
+
return void 0;
|
|
349
|
+
}
|
|
347
350
|
function assertKnownSchema(db) {
|
|
348
351
|
let observedVersion;
|
|
349
352
|
try {
|
|
350
|
-
|
|
351
|
-
if (typeof row === "object" && row !== null) {
|
|
352
|
-
const v = row.app_version;
|
|
353
|
-
if (typeof v === "string" && v.length > 0) observedVersion = v;
|
|
354
|
-
}
|
|
353
|
+
observedVersion = queryLatestSchemaVersion(db);
|
|
355
354
|
} catch {
|
|
356
355
|
throw new ZcodeSchemaDriftError(
|
|
357
356
|
void 0,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhushanwen/zcode-session-source",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Read-only zcode session database source: bun/node dual sqlite driver with a four-level CANTOPEN recovery ladder, transcript row queries, and schema version gate",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
],
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@zhushanwen/session-core": "0.
|
|
22
|
-
"@zhushanwen/subagent-engine-sdk": "0.
|
|
21
|
+
"@zhushanwen/session-core": "0.13.0",
|
|
22
|
+
"@zhushanwen/subagent-engine-sdk": "0.13.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@vitest/coverage-v8": "^4.1.9",
|