@paircode/tool-project-info 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/bin/tool-project-info.exe +0 -0
- package/index.js +160 -0
- package/package.json +22 -0
|
Binary file
|
package/index.js
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════════════════════════
|
|
2
|
+
// tool-project-info — 项目知识库(project_info_write/read/list/search/delete/explore)
|
|
3
|
+
//
|
|
4
|
+
// 生成来源(2026-08-16):内置 Go 工具组 → 磁盘外置插件(tool_plugin_gen.go
|
|
5
|
+
// 自动生成,schema 完整外置拷贝)。api 声明在插件,execute 调 ctx.binary 复用本插件目录 bin/ 下的独立二进制(源码 plugins-src/plugins/<name>/,改实现重编译即更换)。
|
|
6
|
+
// 工具清单:project_info_write、project_info_read、project_info_list、project_info_tree、project_info_search、project_info_delete、project_info_explore
|
|
7
|
+
// ═══════════════════════════════════════════════════════════════
|
|
8
|
+
const tools = [
|
|
9
|
+
{
|
|
10
|
+
"name": "project_info_write",
|
|
11
|
+
"description": "写入/更新项目知识库的一篇(.pair/project-info/\u003c路径\u003e.md)——记录项目架构/模块职责/数据流/设计决策等结构化理解,跨会话复用、你和用户都能看。★树形路径:顶层分支 目标/架构/实现/关键点/设计思想,根条目用 概览(如 架构/模块-agent / 设计思想/决策-渲染架构);兼容参考项目 notes/ 前缀路径(自动映射分支+镜像 .agents/notes/)。",
|
|
12
|
+
"usageGuide": "写入/更新项目知识库条目,跨会话复用。★知识库是树:顶层分支 = 目标/架构/实现/关键点/设计思想(根为 概览)——路径带分支前缀(如 架构/模块-agent / 设计思想/决策-渲染架构)。也可用参考项目风格路径 notes/implemented/architecture/x(自动归入树分支 架构/x 并镜像 .agents/notes/)。读完关键文件后立即写入,积累项目的结构化理解。比记在脑子里可靠(持久化+跨会话可见)。多项目工作区可用 project 参数指定目标项目。",
|
|
13
|
+
"parameters": {
|
|
14
|
+
"properties": {
|
|
15
|
+
"content": {
|
|
16
|
+
"description": "Markdown 正文(首行用 # 标题)",
|
|
17
|
+
"type": "string"
|
|
18
|
+
},
|
|
19
|
+
"path": {
|
|
20
|
+
"description": "条目路径(中文,带顶层分支前缀:目标/架构/实现/关键点/设计思想,如 架构/模块-agent),不含 .md;用 / 嵌套为细节篇",
|
|
21
|
+
"type": "string"
|
|
22
|
+
},
|
|
23
|
+
"project": {
|
|
24
|
+
"description": "可选:目标项目(工作区项目目录名如 wb-ui,或相对主项目的路径/绝对路径)。省略 = 主项目。多项目工作区:gou-ide、wb-ui、ref 等。",
|
|
25
|
+
"type": "string"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"required": [
|
|
29
|
+
"path",
|
|
30
|
+
"content"
|
|
31
|
+
],
|
|
32
|
+
"type": "object"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "project_info_read",
|
|
37
|
+
"description": "读取知识库某篇的全文(按路径,如 概览 / 模块-agent)。渐进式披露的细节层。",
|
|
38
|
+
"usageGuide": "读取知识库某篇全文。渐进式披露:先 project_info_list 看总览,再用此工具读具体细则。比翻目录更方便(自动解析路径+内容格式化)。",
|
|
39
|
+
"parameters": {
|
|
40
|
+
"properties": {
|
|
41
|
+
"path": {
|
|
42
|
+
"description": "条目路径,不含 .md",
|
|
43
|
+
"type": "string"
|
|
44
|
+
},
|
|
45
|
+
"project": {
|
|
46
|
+
"description": "可选:目标项目(工作区项目目录名如 wb-ui,或相对主项目的路径/绝对路径)。省略 = 主项目。多项目工作区:gou-ide、wb-ui、ref 等。",
|
|
47
|
+
"type": "string"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"required": [
|
|
51
|
+
"path"
|
|
52
|
+
],
|
|
53
|
+
"type": "object"
|
|
54
|
+
},
|
|
55
|
+
"readOnly": true
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "project_info_list",
|
|
59
|
+
"description": "列出知识库所有条目的【总览】(路径 + 标题 + 分级)。渐进式披露的总览层。",
|
|
60
|
+
"usageGuide": "列出知识库所有条目的总览(路径+标题+分级)。新项目先调此工具查看已有哪些文档,避免重复写入。",
|
|
61
|
+
"parameters": {
|
|
62
|
+
"properties": {
|
|
63
|
+
"project": {
|
|
64
|
+
"description": "可选:目标项目(工作区项目目录名如 wb-ui,或相对主项目的路径/绝对路径)。省略 = 主项目。多项目工作区:gou-ide、wb-ui、ref 等。",
|
|
65
|
+
"type": "string"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"type": "object"
|
|
69
|
+
},
|
|
70
|
+
"readOnly": true
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "project_info_tree",
|
|
74
|
+
"description": "返回知识库完整树形结构(缩进树:目标/架构/实现/关键点/设计思想 分支 + 条目)。人可读的树形导航。",
|
|
75
|
+
"usageGuide": "查看知识库完整树形结构(分支/子类/条目缩进树)。比 project_info_list 更直观:先看树定位条目,再 project_info_read 读全文。",
|
|
76
|
+
"parameters": {
|
|
77
|
+
"properties": {
|
|
78
|
+
"project": {
|
|
79
|
+
"description": "可选:目标项目(工作区项目目录名如 wb-ui,或相对主项目的路径/绝对路径)。省略 = 主项目。多项目工作区:gou-ide、wb-ui、ref 等。",
|
|
80
|
+
"type": "string"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"type": "object"
|
|
84
|
+
},
|
|
85
|
+
"readOnly": true
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"name": "project_info_search",
|
|
89
|
+
"description": "按关键词搜索知识库(匹配路径/标题/正文),返回命中条目。",
|
|
90
|
+
"usageGuide": "按关键词搜索知识库(匹配路径/标题/正文)。想查某个模块/概念是否已有文档时优先用此工具。",
|
|
91
|
+
"parameters": {
|
|
92
|
+
"properties": {
|
|
93
|
+
"project": {
|
|
94
|
+
"description": "可选:目标项目(工作区项目目录名如 wb-ui,或相对主项目的路径/绝对路径)。省略 = 主项目。多项目工作区:gou-ide、wb-ui、ref 等。",
|
|
95
|
+
"type": "string"
|
|
96
|
+
},
|
|
97
|
+
"query": {
|
|
98
|
+
"description": "关键词",
|
|
99
|
+
"type": "string"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"required": [
|
|
103
|
+
"query"
|
|
104
|
+
],
|
|
105
|
+
"type": "object"
|
|
106
|
+
},
|
|
107
|
+
"readOnly": true
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "project_info_delete",
|
|
111
|
+
"description": "删除知识库某篇(按路径)。",
|
|
112
|
+
"usageGuide": "删除知识库某篇(按路径)。知识库条目过时/错误时用此工具清理。删除前建议先 project_info_read 确认。",
|
|
113
|
+
"parameters": {
|
|
114
|
+
"properties": {
|
|
115
|
+
"path": {
|
|
116
|
+
"description": "条目路径,不含 .md",
|
|
117
|
+
"type": "string"
|
|
118
|
+
},
|
|
119
|
+
"project": {
|
|
120
|
+
"description": "可选:目标项目(工作区项目目录名如 wb-ui,或相对主项目的路径/绝对路径)。省略 = 主项目。多项目工作区:gou-ide、wb-ui、ref 等。",
|
|
121
|
+
"type": "string"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"required": [
|
|
125
|
+
"path"
|
|
126
|
+
],
|
|
127
|
+
"type": "object"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "project_info_explore",
|
|
132
|
+
"description": "返回项目目录结构概览(根目录关键文件、顶层目录及文件数)——构建知识库的起点;据此用 read_file 读关键文件分析,再 project_info_write 写入 概览/模块-*/决策-*。",
|
|
133
|
+
"usageGuide": "扫描项目目录结构概览——构建知识库的起点。新项目首次接触时先调此工具了解项目全貌,再用 read_file 读关键文件,最后 project_info_write 写入结构化理解。",
|
|
134
|
+
"parameters": {
|
|
135
|
+
"properties": {},
|
|
136
|
+
"type": "object"
|
|
137
|
+
},
|
|
138
|
+
"readOnly": true
|
|
139
|
+
}
|
|
140
|
+
];
|
|
141
|
+
|
|
142
|
+
return {
|
|
143
|
+
name: 'tool-project-info',
|
|
144
|
+
purpose: '项目知识库(project_info_write/read/list/search/delete/explore)(自动生成,迁移自内置 Go 工具组)',
|
|
145
|
+
apply(ctx) {
|
|
146
|
+
for (const t of tools) {
|
|
147
|
+
ctx.tools.register({
|
|
148
|
+
name: t.name,
|
|
149
|
+
description: t.description,
|
|
150
|
+
usageGuide: t.usageGuide,
|
|
151
|
+
category: t.category,
|
|
152
|
+
readOnly: t.readOnly,
|
|
153
|
+
requiresApproval: t.requiresApproval,
|
|
154
|
+
systemTool: t.systemTool,
|
|
155
|
+
parameters: t.parameters,
|
|
156
|
+
execute: (args) => ctx.binary.exec(t.name, args || {}),
|
|
157
|
+
})
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"main": "index.js",
|
|
3
|
+
"name": "@paircode/tool-project-info",
|
|
4
|
+
"scope": "global",
|
|
5
|
+
"type": "plugin",
|
|
6
|
+
"version": "1.0.0",
|
|
7
|
+
"description": "项目知识库(project_info_write/read/list/search/delete/explore)(自动生成,迁移自内置 Go 工具组)",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"paircode"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"index.js",
|
|
17
|
+
"client.js",
|
|
18
|
+
"assets",
|
|
19
|
+
"bin",
|
|
20
|
+
"package.json"
|
|
21
|
+
]
|
|
22
|
+
}
|