aifastdb-devplan 1.0.0
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/LICENSE +21 -0
- package/README.md +112 -0
- package/dist/dev-plan-store.d.ts +656 -0
- package/dist/dev-plan-store.d.ts.map +1 -0
- package/dist/dev-plan-store.js +1685 -0
- package/dist/dev-plan-store.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-server/index.d.ts +26 -0
- package/dist/mcp-server/index.d.ts.map +1 -0
- package/dist/mcp-server/index.js +1004 -0
- package/dist/mcp-server/index.js.map +1 -0
- package/package.json +47 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 aifastdb
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# aifastdb-devplan
|
|
2
|
+
|
|
3
|
+
AI-powered development plan management MCP server, powered by [aifastdb](https://github.com/aifastdb/aifastdb).
|
|
4
|
+
|
|
5
|
+
## 功能
|
|
6
|
+
|
|
7
|
+
- **11 种标准文档片段类型**:overview, api_design, technical_notes 等
|
|
8
|
+
- **两级任务层级**:主任务 (MainTask) + 子任务 (SubTask)
|
|
9
|
+
- **功能模块注册表**:按模块维度聚合任务和文档
|
|
10
|
+
- **Git Commit 锚定**:完成任务时记录 Git commit hash,支持回滚检测
|
|
11
|
+
- **自动进度统计**:完成子任务时自动更新主任务进度
|
|
12
|
+
- **Markdown 导出**:生成开发计划的 Markdown 文档
|
|
13
|
+
|
|
14
|
+
## 安装
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install aifastdb-devplan
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 使用方式
|
|
21
|
+
|
|
22
|
+
### 方式 A:作为 MCP Server(推荐)
|
|
23
|
+
|
|
24
|
+
在 `.cursor/mcp.json` 或 `claude_desktop_config.json` 中配置:
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"mcpServers": {
|
|
29
|
+
"aifastdb-devplan": {
|
|
30
|
+
"command": "npx",
|
|
31
|
+
"args": ["aifastdb-devplan"]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 方式 B:作为 npm 包编程使用
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import { DevPlanStore, createDevPlan } from 'aifastdb-devplan';
|
|
41
|
+
|
|
42
|
+
const plan = createDevPlan('my-project');
|
|
43
|
+
|
|
44
|
+
// 创建主任务
|
|
45
|
+
plan.createMainTask({
|
|
46
|
+
projectName: 'my-project',
|
|
47
|
+
taskId: 'phase-1',
|
|
48
|
+
title: '阶段一:基础搭建',
|
|
49
|
+
priority: 'P0',
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// 添加子任务
|
|
53
|
+
plan.addSubTask({
|
|
54
|
+
projectName: 'my-project',
|
|
55
|
+
taskId: 'T1.1',
|
|
56
|
+
parentTaskId: 'phase-1',
|
|
57
|
+
title: '初始化项目结构',
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// 完成任务(自动更新主任务进度 + Git commit 锚定)
|
|
61
|
+
plan.completeSubTask('T1.1');
|
|
62
|
+
|
|
63
|
+
// 查看进度
|
|
64
|
+
const progress = plan.getProgress();
|
|
65
|
+
console.log(progress);
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## MCP 工具列表(18 个)
|
|
69
|
+
|
|
70
|
+
| 工具 | 说明 |
|
|
71
|
+
|------|------|
|
|
72
|
+
| `devplan_init` | 初始化开发计划 |
|
|
73
|
+
| `devplan_save_section` | 保存/更新文档片段 |
|
|
74
|
+
| `devplan_get_section` | 读取文档片段 |
|
|
75
|
+
| `devplan_list_sections` | 列出所有文档片段 |
|
|
76
|
+
| `devplan_create_main_task` | 创建主任务 |
|
|
77
|
+
| `devplan_add_sub_task` | 添加子任务 |
|
|
78
|
+
| `devplan_upsert_task` | 幂等导入任务(防重复) |
|
|
79
|
+
| `devplan_complete_task` | 完成任务(自动更新进度) |
|
|
80
|
+
| `devplan_list_tasks` | 列出任务(支持跨主任务查询) |
|
|
81
|
+
| `devplan_get_progress` | 获取项目进度概览 |
|
|
82
|
+
| `devplan_export_markdown` | 导出 Markdown 文档 |
|
|
83
|
+
| `devplan_sync_git` | 同步 Git 历史(回滚检测) |
|
|
84
|
+
| `devplan_create_module` | 创建功能模块 |
|
|
85
|
+
| `devplan_list_modules` | 列出功能模块 |
|
|
86
|
+
| `devplan_get_module` | 获取模块详情 |
|
|
87
|
+
| `devplan_update_module` | 更新模块信息 |
|
|
88
|
+
|
|
89
|
+
## 数据存储
|
|
90
|
+
|
|
91
|
+
数据以 JSONL 格式存储在项目内的 `.devplan/` 目录中:
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
.devplan/{projectName}/
|
|
95
|
+
├── documents.jsonl # 文档片段
|
|
96
|
+
├── tasks.jsonl # 主任务 + 子任务
|
|
97
|
+
└── modules.jsonl # 功能模块
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
存储路径解析优先级:
|
|
101
|
+
1. `AIFASTDB_DEVPLAN_PATH` 环境变量
|
|
102
|
+
2. 项目内 `.devplan/` 目录(通过 `.git` / `package.json` 定位)
|
|
103
|
+
3. `~/.aifastdb/dev-plans/`(兜底)
|
|
104
|
+
|
|
105
|
+
## 依赖
|
|
106
|
+
|
|
107
|
+
- [aifastdb](https://github.com/aifastdb/aifastdb) — 存储引擎
|
|
108
|
+
- [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/sdk) — MCP 协议支持
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
MIT
|