@pellux/goodvibes-sdk 0.28.13 → 0.28.15
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/_internal/contracts/artifacts/operator-contract.json +19 -1
- package/dist/_internal/contracts/generated/foundation-metadata.d.ts +1 -1
- package/dist/_internal/contracts/generated/foundation-metadata.js +1 -1
- package/dist/_internal/contracts/generated/operator-contract.d.ts.map +1 -1
- package/dist/_internal/contracts/generated/operator-contract.js +19 -1
- package/dist/_internal/platform/control-plane/operator-contract-schemas-knowledge.d.ts.map +1 -1
- package/dist/_internal/platform/control-plane/operator-contract-schemas-knowledge.js +1 -0
- package/dist/_internal/platform/knowledge/home-graph/generated-pages.d.ts.map +1 -1
- package/dist/_internal/platform/knowledge/home-graph/generated-pages.js +28 -3
- package/dist/_internal/platform/knowledge/home-graph/service.d.ts.map +1 -1
- package/dist/_internal/platform/knowledge/home-graph/service.js +48 -46
- package/dist/_internal/platform/knowledge/home-graph/types.d.ts +1 -0
- package/dist/_internal/platform/knowledge/home-graph/types.d.ts.map +1 -1
- package/dist/_internal/platform/knowledge/semantic/answer-fallback.d.ts +11 -0
- package/dist/_internal/platform/knowledge/semantic/answer-fallback.d.ts.map +1 -0
- package/dist/_internal/platform/knowledge/semantic/answer-fallback.js +45 -0
- package/dist/_internal/platform/knowledge/semantic/answer.d.ts.map +1 -1
- package/dist/_internal/platform/knowledge/semantic/answer.js +7 -18
- package/dist/_internal/platform/knowledge/semantic/gap-repair.d.ts.map +1 -1
- package/dist/_internal/platform/knowledge/semantic/gap-repair.js +171 -14
- package/dist/_internal/platform/knowledge/semantic/self-improvement-promotion.d.ts +11 -0
- package/dist/_internal/platform/knowledge/semantic/self-improvement-promotion.d.ts.map +1 -0
- package/dist/_internal/platform/knowledge/semantic/self-improvement-promotion.js +243 -0
- package/dist/_internal/platform/knowledge/semantic/self-improvement-tasks.d.ts +12 -0
- package/dist/_internal/platform/knowledge/semantic/self-improvement-tasks.d.ts.map +1 -0
- package/dist/_internal/platform/knowledge/semantic/self-improvement-tasks.js +87 -0
- package/dist/_internal/platform/knowledge/semantic/self-improvement.d.ts +4 -0
- package/dist/_internal/platform/knowledge/semantic/self-improvement.d.ts.map +1 -1
- package/dist/_internal/platform/knowledge/semantic/self-improvement.js +64 -90
- package/dist/_internal/platform/knowledge/semantic/service.d.ts.map +1 -1
- package/dist/_internal/platform/knowledge/semantic/service.js +12 -2
- package/dist/_internal/platform/knowledge/semantic/types.d.ts +2 -0
- package/dist/_internal/platform/knowledge/semantic/types.d.ts.map +1 -1
- package/dist/_internal/platform/knowledge/store-refinement.d.ts.map +1 -1
- package/dist/_internal/platform/knowledge/store-refinement.js +8 -0
- package/dist/_internal/platform/knowledge/store-schema.d.ts.map +1 -1
- package/dist/_internal/platform/knowledge/store-schema.js +6 -1
- package/dist/_internal/platform/knowledge/store.d.ts +1 -0
- package/dist/_internal/platform/knowledge/store.d.ts.map +1 -1
- package/dist/_internal/platform/knowledge/store.js +1 -0
- package/dist/_internal/platform/knowledge/types.d.ts +2 -0
- package/dist/_internal/platform/knowledge/types.d.ts.map +1 -1
- package/dist/_internal/platform/state/sqlite-store.d.ts +3 -0
- package/dist/_internal/platform/state/sqlite-store.d.ts.map +1 -1
- package/dist/_internal/platform/state/sqlite-store.js +19 -0
- package/dist/_internal/platform/version.js +1 -1
- package/package.json +1 -1
|
@@ -13,6 +13,8 @@ export class SQLiteStore {
|
|
|
13
13
|
db = null;
|
|
14
14
|
dbPath;
|
|
15
15
|
initPromise = null;
|
|
16
|
+
saveBatchDepth = 0;
|
|
17
|
+
saveDirty = false;
|
|
16
18
|
constructor(dbPath) {
|
|
17
19
|
this.dbPath = dbPath ?? null;
|
|
18
20
|
}
|
|
@@ -38,10 +40,27 @@ export class SQLiteStore {
|
|
|
38
40
|
exec(sql, params) {
|
|
39
41
|
return this.getDb().exec(sql, params);
|
|
40
42
|
}
|
|
43
|
+
async batch(operation) {
|
|
44
|
+
this.saveBatchDepth += 1;
|
|
45
|
+
try {
|
|
46
|
+
return await operation();
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
this.saveBatchDepth -= 1;
|
|
50
|
+
if (this.saveBatchDepth === 0 && this.saveDirty) {
|
|
51
|
+
this.saveDirty = false;
|
|
52
|
+
await this.save();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
41
56
|
async save() {
|
|
42
57
|
const dbPath = this.dbPath;
|
|
43
58
|
if (isEphemeralDbPath(dbPath) || !this.db || !dbPath)
|
|
44
59
|
return false;
|
|
60
|
+
if (this.saveBatchDepth > 0) {
|
|
61
|
+
this.saveDirty = true;
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
45
64
|
try {
|
|
46
65
|
mkdirSync(dirname(dbPath), { recursive: true });
|
|
47
66
|
const data = this.db.export();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
-
let version = '0.28.
|
|
3
|
+
let version = '0.28.15';
|
|
4
4
|
try {
|
|
5
5
|
const pkg = JSON.parse(readFileSync(join(import.meta.dir, '..', '..', 'package.json'), 'utf-8'));
|
|
6
6
|
version = pkg.version ?? version;
|