@devflow-tools/database 0.17.4 → 0.17.6

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +24 -48
  3. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.17.6](https://github.com/shilongfeicool/dev-flow/compare/v0.17.5...v0.17.6) (2026-08-04)
7
+
8
+ **Note:** Version bump only for package @devflow-tools/database
9
+
10
+
11
+
12
+
13
+
6
14
  ## [0.17.4](https://github.com/shilongfeicool/dev-flow/compare/v0.17.3...v0.17.4) (2026-08-04)
7
15
 
8
16
 
package/README.md CHANGED
@@ -1,67 +1,43 @@
1
1
  # @devflow-tools/database
2
2
 
3
- DevFlow 数据库层 — 基于 better-sqlite3 SQLite + WAL 模式持久化存储,管理 runs、tool call events、skill executions、project stats 和 settings。
3
+ > 基于 better-sqlite3 的本地 SQLite/WAL 持久化层,承载运行、检索、记忆和遥测记录。(v0.17.6)
4
4
 
5
- ## Installation
5
+ [![npm version](https://img.shields.io/npm/v/%40devflow-tools%2Fdatabase.svg)](https://www.npmjs.com/package/@devflow-tools/database)
6
+
7
+ ## 安装
6
8
 
7
9
  ```bash
8
10
  npm install @devflow-tools/database
9
11
  ```
10
12
 
11
- ## Usage
13
+ ## 快速开始
12
14
 
13
15
  ```typescript
14
16
  import { DevFlowDatabase } from '@devflow-tools/database';
15
17
 
16
- const db = new DevFlowDatabase('/path/to/project');
18
+ const db = new DevFlowDatabase(process.cwd());
19
+ console.log(db);
20
+ ```
21
+
22
+ ## 公共 API / 命令
17
23
 
18
- // 记录 tool call 事件
19
- db.insertToolCallEvent({
20
- eventId: 'evt:123',
21
- executionId: 'exec:456',
22
- toolName: 'bash',
23
- command: 'npm test',
24
- exitCode: 0,
25
- durationMs: 1200,
26
- });
24
+ `DevFlowDatabase`、`openGlobalDevFlowDatabase`、`openGlobalDevFlowReadOnlyDatabase` task runtime、work queue、retrieval ledger、workflow worker 类型/映射器。
27
25
 
28
- // 查询事件
29
- const events = db.listToolCallEvents('exec:456');
30
26
 
31
- // 项目统计
32
- const stats = db.getProjectStats('/path/to/project');
33
- ```
27
+ ## 配置与运行时
28
+
29
+ 需要 Node.js 原生 better-sqlite3 能力;数据库文件默认位于项目 `.devflow/` 目录或全局 DevFlow 数据目录。
30
+
31
+ ## 版本与兼容性
32
+
33
+ - 当前包版本:`0.17.6`
34
+ - Node.js:未在 package manifest 声明更高版本时,使用 Node.js 18+;原生 SQLite/Playwright 能力请按对应依赖安装
35
+ - workspace 内部包应使用同一 DevFlow minor/patch 版本,避免类型和数据库 schema 不一致
36
+
37
+ ## 相关链接
34
38
 
35
- ## Features
36
-
37
- - **SQLite + WAL 模式** — 高并发读写的本地持久化存储
38
- - **runs 表** — AI agent 执行运行记录
39
- - **tool_call_events 表** — 每次 tool 调用的详细事件(exitCode、stderr、output、durationMs)
40
- - **skill_executions 表** — skill 执行生命周期管理(start → running → completed/failed)
41
- - **project_stats 表** — 项目维度的聚合统计
42
- - **settings 表** — KV 配置存储
43
-
44
- ## Tables
45
-
46
- | 表名 | 说明 |
47
- |------|------|
48
- | `runs` | Agent 运行记录(id、source、tool、status、token_used) |
49
- | `tool_call_events` | Tool 调用事件(event_id、execution_id、tool_name、command、exit_code、stderr、output、is_mcp_tool) |
50
- | `skill_executions` | Skill 执行记录(execution_id、skill_name、status、total_tool_calls、mcp_compliance_rate) |
51
- | `project_stats` | 项目聚合统计(total_runs、successful_runs、total_tokens) |
52
- | `settings` | KV 配置(key、value) |
53
-
54
- ## API
55
-
56
- - `new DevFlowDatabase(projectRoot)` — 构造函数,自动创建 `.devflow/devflow.db` 并初始化 schema
57
- - `.insertToolCallEvent(data)` — 记录工具调用事件
58
- - `.updateToolCallEvent(eventId, updates)` — 更新事件(如回填 output)
59
- - `.listToolCallEvents(executionId)` — 列出某次执行的所有事件
60
- - `.insertSkillExecution(data)` — 创建 skill 执行记录
61
- - `.updateSkillExecution(id, data)` — 更新 skill 执行状态
62
- - `.getProjectStats(root)` — 获取项目统计
63
- - `.upsertProjectStats(root, data)` — 更新或插入项目统计
64
- - `.getSetting(key)` / `.setSetting(key, value)` — KV 配置读写
39
+ - [DevFlow 仓库](https://github.com/shilongfeicool/dev-flow)
40
+ - [问题反馈](https://github.com/shilongfeicool/dev-flow/issues)
65
41
 
66
42
  ## License
67
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devflow-tools/database",
3
- "version": "0.17.4",
3
+ "version": "0.17.6",
4
4
  "description": "DevFlow SQLite database package",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,5 +13,5 @@
13
13
  "typescript": "^5.5.0",
14
14
  "vitest": "^2.0.0"
15
15
  },
16
- "gitHead": "b880054f9cef4ed62b4d02544257c9f5cbd811bc"
16
+ "gitHead": "669fea3aa72aa3fde14ed50d24c1fec4dfac088f"
17
17
  }