@easbot/codebase 0.3.29 → 0.3.32
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/README.en.md +55 -1
- package/README.md +55 -1
- package/dist/chunks/cache-D7NVUXB2.mjs +1 -0
- package/dist/chunks/cache-LSQZJEDR.cjs +1 -0
- package/dist/chunks/{chunk-4XKCGYFF.mjs → chunk-33DIOGLJ.mjs} +22 -22
- package/dist/chunks/chunk-37KKG3UK.mjs +48 -0
- package/dist/chunks/chunk-43WAI4Z7.mjs +1 -0
- package/dist/chunks/chunk-CLUGDJA5.cjs +62 -0
- package/dist/chunks/chunk-EH2QTB6S.cjs +37 -0
- package/dist/chunks/chunk-ESA2CL57.mjs +37 -0
- package/dist/chunks/chunk-ETCTXAXR.mjs +1 -0
- package/dist/chunks/chunk-H4VZF3ZQ.mjs +1 -0
- package/dist/chunks/chunk-J7Z3MIR7.cjs +1 -0
- package/dist/chunks/chunk-JEHVBEBS.cjs +1 -0
- package/dist/chunks/chunk-KFESJR3T.cjs +1 -0
- package/dist/chunks/chunk-KR6BQNY6.mjs +203 -0
- package/dist/chunks/chunk-KTSR5VPT.mjs +1 -0
- package/dist/chunks/chunk-OJK5EFPD.cjs +48 -0
- package/dist/chunks/{chunk-YJK7F6NJ.cjs → chunk-OZYQQS63.cjs} +22 -22
- package/dist/chunks/chunk-PRPBK7D6.mjs +62 -0
- package/dist/chunks/chunk-T6KJWYTV.mjs +1 -0
- package/dist/chunks/chunk-TBDAGLC4.cjs +203 -0
- package/dist/chunks/chunk-TMQVJU4I.mjs +1 -0
- package/dist/chunks/chunk-VZCOLSBF.cjs +1 -0
- package/dist/chunks/chunk-W5SMGCKO.cjs +1 -0
- package/dist/chunks/chunk-Y7JDLK56.cjs +1 -0
- package/dist/chunks/cli-handler-IQ6ZNLEJ.mjs +1 -0
- package/dist/chunks/cli-handler-WTEPKO4E.cjs +1 -0
- package/dist/chunks/code-base-5BXR4FUU.cjs +1 -0
- package/dist/chunks/code-base-M4EMTQTG.mjs +1 -0
- package/dist/chunks/database-manager-KM7BOISA.mjs +1 -0
- package/dist/chunks/database-manager-LTHK7MM6.cjs +1 -0
- package/dist/chunks/file-watcher-2MUX5MO5.cjs +1 -0
- package/dist/chunks/file-watcher-ABFT22GS.mjs +1 -0
- package/dist/chunks/{interfaces-S7TJGWWS.mjs → interfaces-43SSCG3E.mjs} +1 -1
- package/dist/chunks/interfaces-LUHDPZOT.cjs +1 -0
- package/dist/chunks/llm-S6D5ICOO.cjs +1 -0
- package/dist/chunks/llm-WS3XKT46.mjs +1 -0
- package/dist/chunks/{stdio-server-DFKFFRSM.cjs → stdio-server-KA3JQB7C.cjs} +2 -2
- package/dist/chunks/stdio-server-QP63TXGI.mjs +30 -0
- package/dist/cli.cjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +149 -41
- package/dist/index.d.ts +149 -41
- package/dist/index.mjs +1 -1
- package/package.json +8 -9
- package/dist/chunks/chunk-23YR2LAM.cjs +0 -1
- package/dist/chunks/chunk-2YMB6W5S.mjs +0 -1
- package/dist/chunks/chunk-3RVRPGJC.mjs +0 -1
- package/dist/chunks/chunk-3UGOMK4F.cjs +0 -62
- package/dist/chunks/chunk-5M2N7JFP.cjs +0 -1
- package/dist/chunks/chunk-A4YJ5ZVE.cjs +0 -203
- package/dist/chunks/chunk-J7AIRI5N.mjs +0 -203
- package/dist/chunks/chunk-LLO6DDXU.mjs +0 -48
- package/dist/chunks/chunk-LQVKXVBS.mjs +0 -51
- package/dist/chunks/chunk-LZLPJAB6.mjs +0 -62
- package/dist/chunks/chunk-M2YU5LAI.cjs +0 -1
- package/dist/chunks/chunk-MZHDSOD7.mjs +0 -1
- package/dist/chunks/chunk-OGTQ7MWV.cjs +0 -51
- package/dist/chunks/chunk-V6PHJ4DG.cjs +0 -48
- package/dist/chunks/cli-handler-B7WPIZRE.cjs +0 -1
- package/dist/chunks/cli-handler-EJX27R4Q.mjs +0 -1
- package/dist/chunks/code-base-FSOSU46G.mjs +0 -1
- package/dist/chunks/code-base-OWYMNEQG.cjs +0 -1
- package/dist/chunks/database-manager-7D7NDXJK.mjs +0 -1
- package/dist/chunks/database-manager-X4DMAUWC.cjs +0 -1
- package/dist/chunks/file-watcher-E2JROVI7.cjs +0 -1
- package/dist/chunks/file-watcher-KSLBUUPP.mjs +0 -1
- package/dist/chunks/interfaces-URUTHSR2.cjs +0 -1
- package/dist/chunks/llm-R2ZLKZDO.cjs +0 -1
- package/dist/chunks/llm-U57HNTZO.mjs +0 -1
- package/dist/chunks/stdio-server-NV5YAXJD.mjs +0 -30
package/README.en.md
CHANGED
|
@@ -6,7 +6,7 @@ Code Knowledge Graph SDK - A code indexing and querying system based on the Prop
|
|
|
6
6
|
|
|
7
7
|
## Version
|
|
8
8
|
|
|
9
|
-
v0.3.
|
|
9
|
+
v0.3.32
|
|
10
10
|
## Features
|
|
11
11
|
|
|
12
12
|
- **Property Graph Model**: Store code entities and their relationships using nodes and edges
|
|
@@ -337,6 +337,60 @@ await service.callers(ctx, { name: 'AuthService' });
|
|
|
337
337
|
| IMPORTS | Module import |
|
|
338
338
|
| REFERENCES | Variable/identifier reference |
|
|
339
339
|
|
|
340
|
+
## Evaluation (Generic Evaluation Model)
|
|
341
|
+
|
|
342
|
+
codebase's extraction-quality evaluation now runs on the generic evaluation model `EvaluationProvider` from `@easbot/llm`, using the `content-quality` type.
|
|
343
|
+
|
|
344
|
+
### Responsibility split
|
|
345
|
+
|
|
346
|
+
| Layer | Responsibility |
|
|
347
|
+
| ---------------------------------- | -------------------------------------------------------------------------------------------- |
|
|
348
|
+
| `@easbot/llm` `EvaluationProvider` | Returns `score` (quality), `passing` (meets standard), `violations` (unmet items), `summary` |
|
|
349
|
+
| codebase (application side) | Owns the threshold and the final verdict: `passing \|\| score >= threshold` |
|
|
350
|
+
|
|
351
|
+
codebase no longer builds its own evaluation prompt or result parser. The evaluation inputs are mapped as follows:
|
|
352
|
+
|
|
353
|
+
| `EvaluationProvider` input | codebase source | Meaning |
|
|
354
|
+
| -------------------------- | ----------------------------- | ---------------------------------------------- |
|
|
355
|
+
| `query` | `EXTRACTION_CRITERIA` | Evaluation criteria (scoring bar) |
|
|
356
|
+
| `response` | `params.predicted` | The extraction under review |
|
|
357
|
+
| `document` | `params.gold` | Reference material (ground truth) |
|
|
358
|
+
| `context` | `EXTRACTION_INPUT_CONVENTION` | Input role legend (what GOLD / PREDICTED mean) |
|
|
359
|
+
|
|
360
|
+
> Why `context` matters: the generic `content-quality` template labels `response` as CONTENT and `document` as DOCUMENT.
|
|
361
|
+
> Without an explicit role legend the model may treat the reference answer as a plain "reference document" and ignore it.
|
|
362
|
+
|
|
363
|
+
### Threshold configuration
|
|
364
|
+
|
|
365
|
+
The default threshold is **0.85** and can be adjusted via the `evaluation_threshold` field in `.easbot/codebase.json` (range `0` ~ `1`):
|
|
366
|
+
|
|
367
|
+
```jsonc
|
|
368
|
+
{
|
|
369
|
+
"evaluation_threshold": 0.85,
|
|
370
|
+
}
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
- When unset, `DEFAULT_EVALUATION_THRESHOLD` (`src/config.ts`) is used.
|
|
374
|
+
- The `easbot codebase ...` CLI entry reads the config and injects it via `Llm.init({ evaluationThreshold })`.
|
|
375
|
+
- When no evaluation model is configured, `evaluateExtraction` returns `score = -1` (meaning "not evaluated") without breaking the main flow.
|
|
376
|
+
- An illegal threshold (`NaN` / `≤ 0` / `> 1`) falls back to the default — a misconfigured threshold must not invalidate a whole evaluation round.
|
|
377
|
+
|
|
378
|
+
### API
|
|
379
|
+
|
|
380
|
+
```typescript
|
|
381
|
+
const result = await Llm.evaluateExtraction({
|
|
382
|
+
gold: 'ground truth (structured JSON entities/relations)',
|
|
383
|
+
predicted: 'model extraction result',
|
|
384
|
+
threshold: 0.9, // optional, defaults to the configured value
|
|
385
|
+
});
|
|
386
|
+
// result: { score, passing, details, missingEntities, extraEntities, wrongRelations, missingRelations }
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
`passing` is the **final verdict computed by codebase** from the threshold (`model says compliant || score >= threshold`).
|
|
390
|
+
When `score = -1` (not evaluated / evaluation failed) `passing = false` — "not evaluated" is not "passed".
|
|
391
|
+
|
|
392
|
+
Each entry of the evaluation report carries `extractionPassing` (present only when an evaluation actually ran).
|
|
393
|
+
|
|
340
394
|
## Architecture
|
|
341
395
|
|
|
342
396
|
```
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
## 版本
|
|
8
8
|
|
|
9
|
-
v0.3.
|
|
9
|
+
v0.3.32
|
|
10
10
|
## 特性
|
|
11
11
|
|
|
12
12
|
- **Property Graph 模型**: 使用节点和边存储代码实体及其关系
|
|
@@ -371,6 +371,60 @@ await service.callers(ctx, { name: 'AuthService' });
|
|
|
371
371
|
| IMPORTS | 导入模块 |
|
|
372
372
|
| REFERENCES | 引用关系 |
|
|
373
373
|
|
|
374
|
+
## 评估实现(通用评估模型)
|
|
375
|
+
|
|
376
|
+
codebase 的抽取质量评估已切换到 `@easbot/llm` 的通用评估模型 `EvaluationProvider`,使用 `content-quality` 类型。
|
|
377
|
+
|
|
378
|
+
### 职责切分
|
|
379
|
+
|
|
380
|
+
| 层 | 职责 |
|
|
381
|
+
| ---------------------------------- | ---------------------------------------------------------------------------------- |
|
|
382
|
+
| `@easbot/llm` `EvaluationProvider` | 给「质量分 `score` + 是否达标 `passing` + 未满足项 `violations` + 说明 `summary`」 |
|
|
383
|
+
| codebase(应用侧) | 确认阈值标准并做最终判定:`passing \|\| score >= threshold` |
|
|
384
|
+
|
|
385
|
+
codebase 不再自建评估 prompt 与结果解析,评估参数映射如下:
|
|
386
|
+
|
|
387
|
+
| `EvaluationProvider` 入参 | codebase 来源 | 含义 |
|
|
388
|
+
| ------------------------- | ----------------------------- | ----------------------------------------- |
|
|
389
|
+
| `query` | `EXTRACTION_CRITERIA` | 评估标准(评分口径) |
|
|
390
|
+
| `response` | `params.predicted` | 待评估的抽取结果 |
|
|
391
|
+
| `document` | `params.gold` | 参考材料(ground truth) |
|
|
392
|
+
| `context` | `EXTRACTION_INPUT_CONVENTION` | 输入角色说明(GOLD / PREDICTED 各指什么) |
|
|
393
|
+
|
|
394
|
+
> `context` 的作用:通用 `content-quality` 模板把 `response` 标为 CONTENT、`document` 标为 DOCUMENT。
|
|
395
|
+
> 不额外说明角色时,模型可能把参考答案误当作「参考文档」而忽略它。
|
|
396
|
+
|
|
397
|
+
### 阈值配置
|
|
398
|
+
|
|
399
|
+
阈值默认 **0.85**,可通过 `.easbot/codebase.json` 的 `evaluation_threshold` 字段调整(取值范围 `0` ~ `1`):
|
|
400
|
+
|
|
401
|
+
```jsonc
|
|
402
|
+
{
|
|
403
|
+
"evaluation_threshold": 0.85,
|
|
404
|
+
}
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
- 未配置时使用 `DEFAULT_EVALUATION_THRESHOLD`(`src/config.ts`)
|
|
408
|
+
- 命令行入口 `easbot codebase ...` 会读取配置并注入 `Llm.init({ evaluationThreshold })`
|
|
409
|
+
- 未配置 evaluation 模型时,`evaluateExtraction` 返回 `score = -1`(表示未评估),不影响主流程
|
|
410
|
+
- 非法阈值(`NaN` / `≤ 0` / `> 1`)一律回退默认值 —— 阈值配错不该让整轮评估失效
|
|
411
|
+
|
|
412
|
+
### API
|
|
413
|
+
|
|
414
|
+
```typescript
|
|
415
|
+
const result = await Llm.evaluateExtraction({
|
|
416
|
+
gold: '标准答案(JSON 结构化 entities/relations)',
|
|
417
|
+
predicted: '模型抽取结果',
|
|
418
|
+
threshold: 0.9, // 可选,缺省取配置值
|
|
419
|
+
});
|
|
420
|
+
// result: { score, passing, details, missingEntities, extraEntities, wrongRelations, missingRelations }
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
`passing` 是 **codebase 侧按阈值做出的最终判定**(`评估模型达标 || score >= threshold`)。
|
|
424
|
+
`score = -1`(未评估 / 评估失败)时 `passing = false` —— 「未评估」不等于「通过」。
|
|
425
|
+
|
|
426
|
+
评测报告的每条结果会带上 `extractionPassing`(仅在真正做过评估时出现)。
|
|
427
|
+
|
|
374
428
|
## 架构
|
|
375
429
|
|
|
376
430
|
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as CODEBASE_JSON_REL_PATH,b as CodebaseCache}from'./chunk-ETCTXAXR.mjs';import'./chunk-H4VZF3ZQ.mjs';import'./chunk-KTSR5VPT.mjs';import'./chunk-43WAI4Z7.mjs';import'./chunk-T6KJWYTV.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkY7JDLK56_cjs=require('./chunk-Y7JDLK56.cjs');require('./chunk-J7Z3MIR7.cjs'),require('./chunk-W5SMGCKO.cjs'),require('./chunk-VZCOLSBF.cjs'),require('./chunk-KFESJR3T.cjs');Object.defineProperty(exports,"CODEBASE_JSON_REL_PATH",{enumerable:true,get:function(){return chunkY7JDLK56_cjs.a}});Object.defineProperty(exports,"CodebaseCache",{enumerable:true,get:function(){return chunkY7JDLK56_cjs.b}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {b}from'./chunk-KTSR5VPT.mjs';import {a}from'./chunk-T6KJWYTV.mjs';import {Log,Filesystem,errorMeta,NameErrors}from'@easbot/utils';import {createSyncSqliteConnection}from'@easbot/database';var A=Log.create({service:"codebase.database.migrations"}),N=1,P=[{id:1,description:"v1 baseline: nodes / edges / file_hashes / nodes_fts / meta / embedding_cache / node_embeddings + unresolved_refs / name_segment_vocab / project_metadata / parse_errors + \u6027\u80FD index (nodes.file_path / edges.source/target)",up:[`CREATE TABLE IF NOT EXISTS nodes (
|
|
2
2
|
id TEXT PRIMARY KEY,
|
|
3
3
|
name TEXT NOT NULL,
|
|
4
4
|
ast_type TEXT NOT NULL,
|
|
@@ -64,22 +64,22 @@ import {a}from'./chunk-2YMB6W5S.mjs';import i from'zod';import {NamedError,Log,F
|
|
|
64
64
|
message TEXT NOT NULL,
|
|
65
65
|
line INTEGER,
|
|
66
66
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
67
|
-
)`,"CREATE INDEX IF NOT EXISTS idx_parse_errors_file_path ON parse_errors(file_path)","CREATE INDEX IF NOT EXISTS idx_nodes_file_path ON nodes(file_path)","CREATE INDEX IF NOT EXISTS idx_edges_source ON edges(source)","CREATE INDEX IF NOT EXISTS idx_edges_target ON edges(target)"]}];function
|
|
67
|
+
)`,"CREATE INDEX IF NOT EXISTS idx_parse_errors_file_path ON parse_errors(file_path)","CREATE INDEX IF NOT EXISTS idx_nodes_file_path ON nodes(file_path)","CREATE INDEX IF NOT EXISTS idx_edges_source ON edges(source)","CREATE INDEX IF NOT EXISTS idx_edges_target ON edges(target)"]}];function v(E,e=N,t={}){E.exec(`CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
68
68
|
id INTEGER PRIMARY KEY,
|
|
69
69
|
applied_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
70
|
-
)`);let s=
|
|
70
|
+
)`);let s=E.prepare("SELECT id FROM schema_migrations").all(),n=new Set(s.map(a=>a.id)),r={applied:[],pending:[],errors:[],currentVersion:Math.max(0,...s.map(a=>a.id)),targetVersion:e};for(let a of P){if(a.id>e)break;if(n.has(a.id)){r.pending.push(a.id);continue}if(t.dryRun){r.applied.push(a.id);continue}try{E.execBatch([...a.up]),E.prepare("INSERT INTO schema_migrations (id) VALUES (?)").run(a.id),n.add(a.id),r.applied.push(a.id),A.debug("migration applied",{id:a.id,description:a.description});}catch(i){let o=errorMeta(i).message,c=a.up[0]??"";r.errors.push({migrationId:a.id,sql:c,error:o}),A.warn("migration step failed (may be idempotent)",{id:a.id,error:errorMeta(i),sqlCount:a.up.length});}}return r}function w(E){try{let e=E.prepare("SELECT id FROM schema_migrations").all();return e.length===0?0:Math.max(...e.map(t=>t.id))}catch{return 0}}var l=Filesystem.toUnixPath,d=Log.create({service:"codebase.database"}),S=3,U=class{constructor(e){a(this,"db");a(this,"dbPath");a(this,"closed",false);a(this,"ftsAvailable",false);this.dbPath=e===":memory:"?e:Filesystem.normalize(e),this.db=createSyncSqliteConnection({path:this.dbPath,backend:"better-sqlite3",walMode:true,foreignKeys:true,busyTimeoutMs:3e4}),this.db.initialize();try{this.db.pragma("synchronous = NORMAL"),this.db.pragma("cache_size = -64000"),this.db.pragma("foreign_keys = ON");}catch(t){d.warn("Failed to apply codebase PRAGMAs (synchronous / cache_size / foreign_keys)",{error:errorMeta(t)});}try{this.ensureSchema();let t=w(this.db);t>0&&this.setMeta("schema_version",String(t)),this.ftsAvailable=this.checkFtsAvailability(),this.detectAndMarkStaleOnInit();}catch(t){try{this.db.close();}catch{}throw this.closed=true,t}}ensureSchema(){try{v(this.db,N);let e=[["version","1.0.0"],["createdAt",new Date().toISOString()],["index_state","uninitialized"],["indexed_with_version","unknown"]],t=this.db.prepare("INSERT OR IGNORE INTO meta (key, value) VALUES (?, ?)");for(let[s,n]of e)t.run(s,n);}catch(e){d.error("ensureSchema failed",{error:errorMeta(e)});let t=errorMeta(e).message,s=e instanceof Error?e.cause:void 0,n=s!==void 0?String(s):"",r=n&&n!==t?` (cause: ${n})`:"";throw new b.SchemaError({message:`Failed to create database schema: ${t}${r}`,missing:e instanceof Error?[t,n].filter(Boolean):[t]},{cause:e})}}checkFtsAvailability(){try{return this.db.exec("SELECT * FROM nodes_fts WHERE nodes_fts MATCH 'test' LIMIT 1"),!0}catch{return false}}isFtsAvailable(){return this.ftsAvailable}insertNode(e){let t={...e,file_path:l(e.file_path)};this.db.prepare(`
|
|
71
71
|
INSERT OR REPLACE INTO nodes (id, name, ast_type, language, file_path, start_line, start_col, end_line, end_col, text, created_at)
|
|
72
72
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
73
|
-
`).run(t.id,t.name,t.ast_type,t.language,t.file_path,t.start_line,t.start_col,t.end_line,t.end_col,t.text,t.created_at),this.ftsAvailable&&this.updateFtsNode(t);}insertNodes(e){if(e.length===0)return;let t=e.map(r=>({...r,file_path:
|
|
73
|
+
`).run(t.id,t.name,t.ast_type,t.language,t.file_path,t.start_line,t.start_col,t.end_line,t.end_col,t.text,t.created_at),this.ftsAvailable&&this.updateFtsNode(t);}insertNodes(e){if(e.length===0)return;let t=e.map(r=>({...r,file_path:l(r.file_path)})),s=this.db.prepare(`
|
|
74
74
|
INSERT OR REPLACE INTO nodes (id, name, ast_type, language, file_path, start_line, start_col, end_line, end_col, text, created_at)
|
|
75
75
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
76
|
-
`);this.db.transaction(r=>{for(let a of r)s.run(a.id,a.name,a.ast_type,a.language,a.file_path,a.start_line,a.start_col,a.end_line,a.end_col,a.text,a.created_at);this.ftsAvailable&&this.updateFtsNodesInternal(r);})(t);}updateFtsNodesInternal(e){let t=this.db.prepare("DELETE FROM nodes_fts WHERE rowid = ?"),s=this.db.prepare("SELECT rowid FROM nodes_fts WHERE id = ?"),n=this.db.prepare("INSERT INTO nodes_fts(id, name, ast_type, language, file_path, text) VALUES (?, ?, ?, ?, ?, ?)");for(let r of e)try{let a=s.get(r.id);a&&t.run(a.rowid),n.run(r.id,r.name,r.ast_type,r.language,r.file_path,r.text);}catch(a){
|
|
76
|
+
`);this.db.transaction(r=>{for(let a of r)s.run(a.id,a.name,a.ast_type,a.language,a.file_path,a.start_line,a.start_col,a.end_line,a.end_col,a.text,a.created_at);this.ftsAvailable&&this.updateFtsNodesInternal(r);})(t);}updateFtsNodesInternal(e){let t=this.db.prepare("DELETE FROM nodes_fts WHERE rowid = ?"),s=this.db.prepare("SELECT rowid FROM nodes_fts WHERE id = ?"),n=this.db.prepare("INSERT INTO nodes_fts(id, name, ast_type, language, file_path, text) VALUES (?, ?, ?, ?, ?, ?)");for(let r of e)try{let a=s.get(r.id);a&&t.run(a.rowid),n.run(r.id,r.name,r.ast_type,r.language,r.file_path,r.text);}catch(a){d.warn("FTS update failed for node",{nodeId:r.id,error:errorMeta(a)});}}updateFtsNode(e){try{let t=this.db.prepare("SELECT rowid FROM nodes_fts WHERE id = ?").get(e.id);t&&this.db.prepare("DELETE FROM nodes_fts WHERE rowid = ?").run(t.rowid),this.db.prepare("INSERT INTO nodes_fts(id, name, ast_type, language, file_path, text) VALUES (?, ?, ?, ?, ?, ?)").run(e.id,e.name,e.ast_type,e.language,e.file_path,e.text);}catch(t){d.warn("FTS update failed for node",{nodeId:e.id,error:errorMeta(t)});}}updateFtsNodes(e){let t=this.db.prepare("DELETE FROM nodes_fts WHERE rowid = ?"),s=this.db.prepare("SELECT rowid FROM nodes_fts WHERE id = ?"),n=this.db.prepare("INSERT INTO nodes_fts(id, name, ast_type, language, file_path, text) VALUES (?, ?, ?, ?, ?, ?)");this.db.transaction(a=>{for(let i of a)try{let o=s.get(i.id);o&&t.run(o.rowid),n.run(i.id,i.name,i.ast_type,i.language,i.file_path,i.text);}catch(o){d.warn("FTS update failed for node",{nodeId:i.id,error:errorMeta(o)});}})(e);}insertEdge(e){this.db.prepare(`
|
|
77
77
|
INSERT OR REPLACE INTO edges (id, source, target, relation, created_at)
|
|
78
78
|
VALUES (?, ?, ?, ?, ?)
|
|
79
79
|
`).run(e.id,e.source,e.target,e.relation,e.created_at);}insertEdges(e){if(e.length===0)return;let t=this.db.prepare(`
|
|
80
80
|
INSERT OR REPLACE INTO edges (id, source, target, relation, created_at)
|
|
81
81
|
VALUES (?, ?, ?, ?, ?)
|
|
82
|
-
`);this.db.transaction(n=>{for(let r of n)t.run(r.id,r.source,r.target,r.relation,r.created_at);})(e);}queryNodes(e){let t=[],s=[];e.filePath&&(t.push("file_path LIKE ?"),s.push(`%${
|
|
82
|
+
`);this.db.transaction(n=>{for(let r of n)t.run(r.id,r.source,r.target,r.relation,r.created_at);})(e);}queryNodes(e){let t=[],s=[];e.filePath&&(t.push("file_path LIKE ?"),s.push(`%${l(e.filePath)}%`)),e.astType&&(t.push("ast_type = ?"),s.push(e.astType)),e.name&&(t.push("name = ?"),s.push(e.name)),e.language&&(t.push("language = ?"),s.push(e.language));let n="SELECT * FROM nodes";t.length>0&&(n+=` WHERE ${t.join(" AND ")}`),n+=" ORDER BY file_path, start_line",e.limit&&(n+=" LIMIT ?",s.push(e.limit)),e.offset&&(n+=" OFFSET ?",s.push(e.offset));try{return this.db.prepare(n).all(...s)}catch(r){throw new b.DatabaseError({message:"Failed to query nodes",operation:"queryNodes"},{cause:r})}}findNodesByName(e){if(!e.name)return [];let t=e.limit??50,s=e.kind?`%${e.kind.toLowerCase()}%`:null,n=new Set,r=[],a=(o,c)=>{n.has(o.id)||(n.add(o.id),r.push({node:o,matchKind:c}));},i=(o,c)=>{e.file&&(e.file.includes("/")?(o.push("file_path = ?"),c.push(e.file)):(o.push("file_path LIKE '%/' || ?"),c.push(e.file))),s&&(o.push("LOWER(ast_type) LIKE ?"),c.push(s));};try{let o=["name = ?"],c=[e.name];i(o,c),c.push(t);let p=this.db.prepare(`SELECT * FROM nodes WHERE ${o.join(" AND ")} LIMIT ?`).all(...c);for(let u of p)a(u,"exact");if(p.length>0&&e.file)return r.slice(0,t);if(r.length<t){let u=this.db.prepare("SELECT * FROM nodes WHERE name LIKE ? LIMIT ?").all(`%${e.name}%`,t);for(let g of u)a(g,"qualified");}if(r.length>0&&e.file)return r.slice(0,t);if(r.length===0&&e.name){let u=["name LIKE ?"],g=[`%${e.name}%`];e.file&&(e.file.includes("/")?(u.push("file_path = ?"),g.push(e.file)):(u.push("file_path LIKE '%/' || ?"),g.push(e.file))),s&&(u.push("LOWER(ast_type) LIKE ?"),g.push(s)),u.push("?"),g.push(t);let f=this.db.prepare(`SELECT * FROM nodes WHERE ${u.join(" AND ")}`).all(...g);for(let _ of f)a(_,"substring");}return r.slice(0,t)}catch(o){throw new b.DatabaseError({message:"Failed to find nodes by name",operation:"findNodesByName"},{cause:o})}}queryEdges(e){let t=[],s=[];if(e.sourceOrTarget&&e.sourceOrTarget.length>0){let r=e.sourceOrTarget.map(()=>"?").join(",");t.push(`(source IN (${r}) OR target IN (${r}))`),s.push(...e.sourceOrTarget,...e.sourceOrTarget);}else e.source&&(t.push("source = ?"),s.push(e.source)),e.target&&(t.push("target = ?"),s.push(e.target));e.relation&&(t.push("relation = ?"),s.push(e.relation));let n="SELECT * FROM edges";t.length>0&&(n+=` WHERE ${t.join(" AND ")}`),n+=" ORDER BY created_at DESC",e.limit&&(n+=" LIMIT ?",s.push(e.limit)),e.offset&&(n+=" OFFSET ?",s.push(e.offset));try{return this.db.prepare(n).all(...s)}catch(r){throw new b.DatabaseError({message:"Failed to query edges",operation:"queryEdges"},{cause:r})}}queryAll(e,t){try{let s=this.db.prepare(e);return t?s.all(...t):s.all()}catch(s){throw new b.DatabaseError({message:"Failed to execute query",operation:"queryAll"},{cause:s})}}searchNodesFts(e,t=20){if(d.debug("searchNodesFts start",{query:e,limit:t,ftsAvailable:this.ftsAvailable}),!this.ftsAvailable)return d.debug("searchNodesFts skip - FTS not available"),[];try{let s=e.split(/\s+/).map(i=>`${i}*`).join(" ");d.debug("searchNodesFts query",{ftsQuery:s});let a=this.db.prepare(`
|
|
83
83
|
SELECT
|
|
84
84
|
nodes_fts.id,
|
|
85
85
|
nodes_fts.name,
|
|
@@ -97,62 +97,62 @@ import {a}from'./chunk-2YMB6W5S.mjs';import i from'zod';import {NamedError,Log,F
|
|
|
97
97
|
WHERE nodes_fts.text MATCH ?
|
|
98
98
|
ORDER BY score DESC
|
|
99
99
|
LIMIT ?
|
|
100
|
-
`).all(s,t);return
|
|
100
|
+
`).all(s,t);return d.debug("searchNodesFts done",{resultCount:a.length}),a}catch(s){return d.warn("searchNodesFts failed",{error:errorMeta(s)}),[]}}deleteNodesByFile(e){let t=l(e);if(this.ftsAvailable)try{let n=this.db.prepare("SELECT rowid FROM nodes_fts WHERE file_path = ?").all(t);for(let r of n)this.db.prepare("DELETE FROM nodes_fts WHERE rowid = ?").run(r.rowid);}catch(n){d.warn("FTS delete failed for file",{filePath:t,error:errorMeta(n)});}return this.db.prepare("DELETE FROM nodes WHERE file_path = ?").run(t).changes}deleteEdgesByFile(e){let t=l(e);return this.db.prepare(`
|
|
101
101
|
DELETE FROM edges
|
|
102
102
|
WHERE source IN (SELECT id FROM nodes WHERE file_path = ?)
|
|
103
103
|
OR target IN (SELECT id FROM nodes WHERE file_path = ?)
|
|
104
|
-
`).run(t,t).changes}getFileHash(e){return this.db.prepare("SELECT content_hash FROM file_hashes WHERE file_path = ?").get(
|
|
104
|
+
`).run(t,t).changes}getFileHash(e){return this.db.prepare("SELECT content_hash FROM file_hashes WHERE file_path = ?").get(l(e))?.content_hash??null}setFileHash(e,t){this.db.prepare(`
|
|
105
105
|
INSERT OR REPLACE INTO file_hashes (file_path, content_hash, last_modified)
|
|
106
106
|
VALUES (?, ?, ?)
|
|
107
|
-
`).run(
|
|
107
|
+
`).run(l(e),t,new Date().toISOString());}deleteFileHash(e){this.db.prepare("DELETE FROM file_hashes WHERE file_path = ?").run(l(e));}getAllFileHashes(){return this.db.prepare("SELECT * FROM file_hashes").all()}checkIntegrity(){let e=b=>this.db.prepare(b).get().c,t=b=>e(b),s={nodes:t("SELECT COUNT(*) as c FROM nodes"),edges:t("SELECT COUNT(*) as c FROM edges"),file_hashes:t("SELECT COUNT(*) as c FROM file_hashes"),fts:t("SELECT COUNT(*) as c FROM nodes_fts"),node_embeddings:t("SELECT COUNT(*) as c FROM node_embeddings"),embedding_cache:t("SELECT COUNT(*) as c FROM embedding_cache"),parse_errors:t("SELECT COUNT(*) as c FROM parse_errors"),unresolved_refs:t("SELECT COUNT(*) as c FROM unresolved_refs"),name_segment_vocab:t("SELECT COUNT(*) as c FROM name_segment_vocab"),project_metadata:t("SELECT COUNT(*) as c FROM project_metadata"),schema_migrations:t("SELECT COUNT(*) as c FROM schema_migrations"),meta:t("SELECT COUNT(*) as c FROM meta")},n=[],r=t(`
|
|
108
108
|
SELECT COUNT(*) as c FROM node_embeddings e
|
|
109
109
|
LEFT JOIN nodes n ON n.id = e.node_id WHERE n.id IS NULL
|
|
110
110
|
`);r>0&&n.push({severity:"error",message:`orphan node_embeddings: ${r}`});let a=t(`
|
|
111
111
|
SELECT COUNT(*) as c FROM edges e
|
|
112
112
|
WHERE e.relation != 'IMPORTS'
|
|
113
113
|
AND NOT EXISTS (SELECT 1 FROM nodes n WHERE n.id = e.source)
|
|
114
|
-
`);a>0&&n.push({severity:"error",message:`orphan edges (source): ${a}`});let
|
|
114
|
+
`);a>0&&n.push({severity:"error",message:`orphan edges (source): ${a}`});let i=t(`
|
|
115
115
|
SELECT COUNT(*) as c FROM edges e
|
|
116
116
|
WHERE e.relation NOT IN ('CALLS', 'IMPORTS')
|
|
117
117
|
AND NOT EXISTS (SELECT 1 FROM nodes n WHERE n.id = e.target)
|
|
118
|
-
`);
|
|
118
|
+
`);i>0&&n.push({severity:"error",message:`orphan edges (target): ${i}`});let o=t("SELECT COUNT(*) as c FROM edges WHERE source = target");o>0&&n.push({severity:"error",message:`self-loop edges: ${o} \u2014 re-run \`easbot codebase sync\` to filter (fixed in Wave 4 R3-2)`});t("SELECT COUNT(DISTINCT file_path) as c FROM nodes");let p=t(`
|
|
119
119
|
SELECT COUNT(*) as c FROM file_hashes fh
|
|
120
120
|
WHERE NOT EXISTS (SELECT 1 FROM nodes n WHERE n.file_path = fh.file_path)
|
|
121
|
-
`);
|
|
121
|
+
`);p>0&&n.push({severity:"warn",message:`orphan file_hashes (no nodes): ${p} \u2014 run \`easbot codebase sync\` to cleanup`});let u=t(`
|
|
122
122
|
SELECT COUNT(DISTINCT n.file_path) as c FROM nodes n
|
|
123
123
|
WHERE NOT EXISTS (SELECT 1 FROM file_hashes fh WHERE fh.file_path = n.file_path)
|
|
124
|
-
`);
|
|
124
|
+
`);u>0&&n.push({severity:"warn",message:`node files without hash: ${u}`});let g=t("SELECT COUNT(*) as c FROM nodes WHERE name IS NULL OR name = ''");g>0&&n.push({severity:"error",message:`nodes with null/empty name: ${g}`});let f=t("SELECT COUNT(*) as c FROM nodes WHERE ast_type IS NULL OR ast_type = ''");f>0&&n.push({severity:"error",message:`nodes with null/empty ast_type: ${f}`});let _=t("SELECT COUNT(*) as c FROM nodes WHERE language IS NULL OR language = ''");_>0&&n.push({severity:"error",message:`nodes with null/empty language: ${_}`});let O=t("SELECT COUNT(*) as c FROM nodes WHERE file_path IS NULL OR file_path = ''");O>0&&n.push({severity:"error",message:`nodes with null/empty file_path: ${O}`});let I=this.db.prepare("SELECT id, COUNT(*) as c FROM nodes GROUP BY id HAVING c > 1").all().length;I>0&&n.push({severity:"error",message:`duplicate node ids: ${I}`});let L=t("SELECT COUNT(*) as c FROM nodes WHERE file_path LIKE '%\\\\%'");L>0&&n.push({severity:"warn",message:`nodes with backslash in file_path: ${L}`});let C=t(`
|
|
125
125
|
SELECT COUNT(*) as c FROM nodes
|
|
126
126
|
WHERE start_line IS NOT NULL AND end_line IS NOT NULL AND start_line > end_line
|
|
127
|
-
`);
|
|
127
|
+
`);C>0&&n.push({severity:"error",message:`invalid line ranges: ${C}`});let F=this.db.prepare("SELECT id, COUNT(*) as c FROM edges GROUP BY id HAVING c > 1").all().length;F>0&&n.push({severity:"error",message:`duplicate edge ids: ${F}`});let M=t("SELECT COUNT(*) as c FROM nodes_fts_content");return M!==s.nodes&&n.push({severity:"error",message:`FTS content desync: ${M} vs ${s.nodes} (run \`easbot codebase recreate\` to rebuild)`}),s.parse_errors>100&&n.push({severity:"warn",message:`parse_errors > 100 (${s.parse_errors}) \u2014\u2014 many files failed to parse`}),{issues:n,stats:s}}getStatus(){let e=this.db.prepare("SELECT COUNT(*) as c FROM nodes").get(),t=this.db.prepare("SELECT COUNT(*) as c FROM edges").get(),s=this.db.prepare("SELECT COUNT(*) as c FROM file_hashes").get(),n=this.db.prepare("SELECT key, value FROM meta").all(),r={};for(let a of n)r[a.key]=a.value;return {nodeCount:e?.c??0,edgeCount:t?.c??0,indexedFiles:s?.c??0,dbPath:this.dbPath,meta:r,indexState:this.getIndexState(),extractionVersion:parseInt(this.getMeta("indexed_with_extraction_version")??"0",10),isStale:this.isIndexStale()}}setLastSync(){this.db.prepare(`
|
|
128
128
|
INSERT OR REPLACE INTO meta (key, value)
|
|
129
129
|
VALUES ('lastSync', ?)
|
|
130
|
-
`).run(new Date().toISOString());}getIndexState(){return this.getMeta("index_state")??"uninitialized"}setIndexState(e){this.setMeta("index_state",e),this.setMeta("last_index_state_change",new Date().toISOString());}markIndexed(e){this.setMeta("indexed_with_version",e),this.setMeta("indexed_with_extraction_version",String(
|
|
130
|
+
`).run(new Date().toISOString());}getIndexState(){return this.getMeta("index_state")??"uninitialized"}setIndexState(e){this.setMeta("index_state",e),this.setMeta("last_index_state_change",new Date().toISOString());}markIndexed(e){this.setMeta("indexed_with_version",e),this.setMeta("indexed_with_extraction_version",String(S)),this.setMeta("index_state","complete"),this.setMeta("last_index_state_change",new Date().toISOString());}isIndexStale(){let e=this.getMeta("indexed_with_extraction_version");if(!e)return false;let t=parseInt(e,10);return Number.isNaN(t)||t<S}detectAndMarkStaleOnInit(){if(this.isIndexStale()){let e=this.getMeta("indexed_with_extraction_version");d.warn("codebase db is stale",{recorded:e??"(none)",current:String(S),hint:"run `easbot codebase recreate` or `easbot codebase index --force` to rebuild"});let t=this.getIndexState();(t==="complete"||t==="partial")&&this.setIndexState("stale");}}getNodeCount(){return this.db.prepare("SELECT COUNT(*) as c FROM nodes").get()?.c??0}getEdgeCount(){return this.db.prepare("SELECT COUNT(*) as c FROM edges").get()?.c??0}getFileCount(){return this.db.prepare("SELECT COUNT(*) as c FROM file_hashes").get()?.c??0}getNodeById(e){return this.db.prepare("SELECT * FROM nodes WHERE id = ?").get(e)??null}getEdgeById(e){return this.db.prepare("SELECT * FROM edges WHERE id = ?").get(e)??null}clearAll(e={}){this.db.exec("DELETE FROM nodes"),this.db.exec("DELETE FROM edges"),this.db.exec("DELETE FROM file_hashes"),this.db.exec("DELETE FROM meta"),e.keepEmbeddings||(this.db.exec("DELETE FROM node_embeddings"),this.db.exec("DELETE FROM embedding_cache")),this.ftsAvailable&&this.db.exec("DELETE FROM nodes_fts");try{this.db.exec("DELETE FROM sqlite_sequence WHERE name IN ('nodes', 'edges', 'file_hashes', 'meta')");}catch{}}getCachedEmbedding(e){let s=this.db.prepare(`
|
|
131
131
|
SELECT embedding FROM embedding_cache WHERE content_hash = ?
|
|
132
132
|
`).get(e);return s?new Float32Array(s.embedding.buffer,s.embedding.byteOffset,s.embedding.length/4):null}getVectorDims(){let e=this.db.prepare("SELECT value FROM meta WHERE key = ?").get("vectorDims");return e?parseInt(e.value,10):void 0}ensureVectorDims(e){this.db.prepare("SELECT value FROM meta WHERE key = ?").get("vectorDims")||this.db.prepare("INSERT OR IGNORE INTO meta (key, value) VALUES (?, ?)").run("vectorDims",String(e));}cacheEmbedding(e,t){if(this.db.prepare("SELECT embedding FROM embedding_cache WHERE content_hash = ?").get(e))return;this.ensureVectorDims(t.length),this.db.prepare(`
|
|
133
133
|
INSERT OR REPLACE INTO embedding_cache (content_hash, embedding)
|
|
134
134
|
VALUES (?, ?)
|
|
135
|
-
`).run(e,t);}deleteEmbeddingsByFile(e){let t=
|
|
135
|
+
`).run(e,t);}deleteEmbeddingsByFile(e){let t=l(e);return this.db.prepare(`
|
|
136
136
|
DELETE FROM node_embeddings WHERE node_id IN (SELECT id FROM nodes WHERE file_path = ?)
|
|
137
137
|
`).run(t).changes}getAllNodeEmbeddings(){return this.db.prepare("SELECT node_id, embedding FROM node_embeddings").all()}storeNodeEmbeddings(e){if(e.length===0)return;this.ensureVectorDims(e[0].embedding.length);let t=this.db.prepare(`
|
|
138
138
|
INSERT OR REPLACE INTO node_embeddings (node_id, embedding_text, embedding)
|
|
139
139
|
VALUES (?, ?, ?)
|
|
140
|
-
`);this.db.transaction(n=>{for(let r of n)try{t.run(r.nodeId,r.embeddingText,r.embedding);}catch(a){
|
|
140
|
+
`);this.db.transaction(n=>{for(let r of n)try{t.run(r.nodeId,r.embeddingText,r.embedding);}catch(a){d.warn("Failed to store embedding for node",{nodeId:r.nodeId,error:errorMeta(a)});}})(e);}insertParseError(e){return this.db.prepare(`
|
|
141
141
|
INSERT INTO parse_errors (file_path, language, stage, message, line)
|
|
142
142
|
VALUES (?, ?, ?, ?, ?)
|
|
143
|
-
`).run(
|
|
143
|
+
`).run(l(e.filePath),e.language,e.stage,e.message,e.line??null).changes}insertUnresolvedRef(e){return this.db.prepare(`
|
|
144
144
|
INSERT INTO unresolved_refs
|
|
145
145
|
(from_node_id, reference_name, reference_kind, line, col, file_path, language, candidates)
|
|
146
146
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
147
|
-
`).run(e.fromNodeId??null,e.referenceName,e.referenceKind,e.line??null,e.col??null,
|
|
147
|
+
`).run(e.fromNodeId??null,e.referenceName,e.referenceKind,e.line??null,e.col??null,l(e.filePath),e.language,e.candidates?JSON.stringify(e.candidates):null).changes}insertUnresolvedRefsBatch(e){if(e.length===0)return 0;let s=`
|
|
148
148
|
INSERT INTO unresolved_refs
|
|
149
149
|
(from_node_id, reference_name, reference_kind, line, col, file_path, language, candidates)
|
|
150
150
|
VALUES ${e.map(()=>"(?, ?, ?, ?, ?, ?, ?, ?)").join(", ")}
|
|
151
|
-
`,n=[];for(let
|
|
151
|
+
`,n=[];for(let i of e)n.push(i.fromNodeId??null,i.referenceName,i.referenceKind,i.line??null,i.col??null,l(i.filePath),i.language,i.candidates?JSON.stringify(i.candidates):null);return this.db.prepare(s).run(...n).changes}insertNameSegment(e,t){return this.db.prepare(`
|
|
152
152
|
INSERT OR IGNORE INTO name_segment_vocab (segment, name) VALUES (?, ?)
|
|
153
153
|
`).run(e,t).changes}insertNameSegmentsBatch(e){if(e.length===0)return 0;let s=`
|
|
154
154
|
INSERT OR IGNORE INTO name_segment_vocab (segment, name) VALUES ${e.map(()=>"(?, ?)").join(", ")}
|
|
155
|
-
`,n=[];for(let
|
|
155
|
+
`,n=[];for(let i of e)n.push(i.segment,i.name);return this.db.prepare(s).run(...n).changes}setProjectMetadata(e,t){let s=e==="worktree"||e==="project"?l(t):t;return this.db.prepare(`
|
|
156
156
|
INSERT OR REPLACE INTO project_metadata (key, value, updated_at)
|
|
157
157
|
VALUES (?, ?, CURRENT_TIMESTAMP)
|
|
158
|
-
`).run(e,s).changes}getNodeIdsByFile(e){let t=e.replace(/\\/g,"/");return this.db.prepare("SELECT id FROM nodes WHERE file_path = ?").all(t).map(n=>n.id)}deleteFtsByFile(e){let t=e.replace(/\\/g,"/"),s=this.getNodeIdsByFile(t);if(s.length===0)return 0;let n=this.db.prepare("DELETE FROM nodes_fts WHERE id = ?");return this.db.transaction(a=>{for(let
|
|
158
|
+
`).run(e,s).changes}getNodeIdsByFile(e){let t=e.replace(/\\/g,"/");return this.db.prepare("SELECT id FROM nodes WHERE file_path = ?").all(t).map(n=>n.id)}deleteFtsByFile(e){let t=e.replace(/\\/g,"/"),s=this.getNodeIdsByFile(t);if(s.length===0)return 0;let n=this.db.prepare("DELETE FROM nodes_fts WHERE id = ?");return this.db.transaction(a=>{for(let i of a)n.run(i);})(s),s.length}initialize(){if(this.closed)throw new b.DatabaseError({message:"Cannot initialize closed database",operation:"initialize"})}close(){if(!this.closed){this.closed=true;try{this.db.close();}catch(e){d.warn("Database close error",{error:errorMeta(e)});}}}isClosed(){return this.closed}getDbPath(){return this.dbPath}transaction(e){return this.db.transaction(e)()}getMeta(e){if(!this.db)throw new NameErrors.OperationFailedError({message:"Database not initialized",operation:"db-not-initialized"});return this.db.prepare("SELECT value FROM meta WHERE key = ?").get(e)?.value??null}setMeta(e,t){if(!this.db)throw new NameErrors.OperationFailedError({message:"Database not initialized",operation:"db-not-initialized"});this.db.prepare("INSERT OR REPLACE INTO meta (key, value) VALUES (?, ?)").run(e,t);}countSqliteObjects(){if(!this.db)throw new NameErrors.OperationFailedError({message:"Database not initialized",operation:"db-not-initialized"});return this.db.prepare("SELECT COUNT(*) as n FROM sqlite_master WHERE type IN ('table', 'index', 'trigger', 'view')").get()?.n??0}deleteMeta(e){if(!this.db)throw new NameErrors.OperationFailedError({message:"Database not initialized",operation:"db-not-initialized"});this.db.prepare("DELETE FROM meta WHERE key = ?").run(e);}};function G(E){return E.isClosed()}function j(E){return E.getDbPath()}function Q(E,e){return E.transaction(e)}export{N as a,P as b,v as c,w as d,S as e,U as f,G as g,j as h,Q as i};
|