@gotza02/sequential-thinking 2026.1.28 → 2026.2.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/README.md +118 -176
- package/dist/graph.js +25 -0
- package/dist/graph.test.js +0 -0
- package/dist/graph_repro.test.js +0 -0
- package/dist/index.js +13 -431
- package/dist/lib.js +0 -0
- package/dist/notes.js +77 -0
- package/dist/repro_search.test.js +79 -0
- package/dist/server.test.js +0 -0
- package/dist/tools/filesystem.js +152 -0
- package/dist/tools/graph.js +79 -0
- package/dist/tools/notes.js +55 -0
- package/dist/tools/thinking.js +113 -0
- package/dist/tools/web.js +134 -0
- package/dist/utils.js +35 -0
- package/dist/verify_edit.test.js +66 -0
- package/dist/verify_notes.test.js +36 -0
- package/dist/verify_viz.test.js +25 -0
- package/package.json +4 -3
- package/dist/verify_new_tools.test.js +0 -67
package/README.md
CHANGED
|
@@ -1,185 +1,155 @@
|
|
|
1
1
|
# Sequential Thinking MCP Server
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
MCP Server นี้ถูกออกแบบมาเพื่อช่วยให้ AI สามารถคิดวิเคราะห์แก้ปัญหาได้อย่างเป็นระบบ (Sequential Thinking) ผ่านกระบวนการคิดแบบทีละขั้นตอน (Step-by-step), การแตกแขนงความคิด (Tree of Thoughts) และการทบทวนตัวเอง (Self-Reflexion)
|
|
4
4
|
|
|
5
|
-
## Features
|
|
5
|
+
## ฟีเจอร์หลัก (Features)
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
7
|
+
- **การวิเคราะห์ตามลำดับ (Sequential Analysis)**: ย่อยปัญหาที่ซับซ้อนให้เป็นขั้นตอนย่อยๆ ที่จัดการได้ง่าย
|
|
8
|
+
- **การให้เหตุผลแบบวนซ้ำ (Iterative Reasoning)**: คิดทีละขั้นตอนอย่างมีโครงสร้าง และปรับปรุงผลลัพธ์ผ่านการวนรอบ
|
|
9
|
+
- **แตกแขนงความคิด (Tree of Thoughts)**: สร้างและประเมินทางเลือกหลายๆ ทาง (เช่น กลยุทธ์แบบระมัดระวัง, แบบสมดุล, หรือแบบกล้าเสี่ยง)
|
|
10
|
+
- **การวิจารณ์ตัวเอง (Self-Critique)**: ตรวจสอบความเสี่ยง ข้อผิดพลาด และอคติในกระบวนการคิดอย่างสม่ำเสมอ
|
|
11
|
+
- **รวมความคิด (Branch Merging)**: สังเคราะห์และรวบรวมข้อมูลเชิงลึกจากเส้นทางการคิดที่แตกต่างกัน
|
|
12
|
+
- **การทดสอบสมมติฐาน (Hypothesis Testing)**: ตั้งสมมติฐานและตรวจสอบความถูกต้องด้วยหลักฐานหรือตรรกะ
|
|
13
|
+
- **ประเมินทางเลือก (Option Evaluation)**: ให้คะแนนและชั่งน้ำหนักทางเลือกต่างๆ (`evaluation`) เพื่อช่วยตัดสินใจ
|
|
14
|
+
- **ทบทวนตัวเอง (Self-Reflexion)**: ย้อนกลับไปแก้ไขความคิดก่อนหน้า (`reflexion`) เพื่อปรับปรุงความแม่นยำ
|
|
15
|
+
- **ปรับเปลี่ยนแบบไดนามิก (Dynamic Adjustment)**: ปรับจำนวนขั้นตอนการคิดเพิ่มหรือลดได้ตามความเหมาะสมของสถานการณ์
|
|
16
16
|
|
|
17
|
-
## System Instruction
|
|
17
|
+
## คำแนะนำระบบสำหรับ AI (System Instruction)
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
เมื่อเชื่อมต่อกับ Server นี้ AI ควรปฏิบัติตามแนวทางต่อไปนี้เพื่อให้แก้ปัญหาได้ดีที่สุด:
|
|
20
20
|
|
|
21
|
-
1.
|
|
22
|
-
2.
|
|
23
|
-
3.
|
|
24
|
-
4.
|
|
25
|
-
5.
|
|
21
|
+
1. **การคิดแบบวนซ้ำ (Iterative Thinking)**: ใช้เครื่องมือ `sequentialthinking` สำหรับงานที่ซับซ้อน **อย่า** พยายามตอบทันที ให้แตกปัญหาเป็นขั้นตอน ตั้งสมมติฐาน และประเมินผล
|
|
22
|
+
2. **สำรวจบริบท (Context Discovery)**: ก่อนแก้ไขโค้ด ให้ใช้ `build_project_graph` ตามด้วย `get_project_graph_summary` เพื่อเข้าใจโครงสร้างโปรเจกต์เสมอ และใช้ `get_file_relationships` เพื่อดูความสัมพันธ์ของไฟล์
|
|
23
|
+
3. **ตรวจสอบข้อเท็จจริง (Fact Verification)**: ใช้ `web_search` เพื่อตรวจสอบข้อมูลล่าสุด, เวอร์ชั่นของ Library หรือเอกสาร และใช้ `fetch` เพื่อดึงข้อมูลดิบเมื่อจำเป็น
|
|
24
|
+
4. **รันคำสั่ง (Local Execution)**: ใช้ `shell_execute` เพื่อรัน Test, Linter หรือ Build เพื่อตรวจสอบความถูกต้องของการแก้ไข อ่านไฟล์ด้วย `read_file` ก่อนเขียนทับเสมอ
|
|
25
|
+
5. **ความต่อเนื่อง (Persistence)**: กระบวนการคิดจะถูกบันทึกอัตโนมัติ หากทำงานค้างไว้ สามารถย้อนกลับมาดูไฟล์ `thoughts_history.json` ได้
|
|
26
26
|
|
|
27
|
-
## Detailed Tool Guide
|
|
27
|
+
## คู่มือการใช้งานเครื่องมือ (Detailed Tool Guide)
|
|
28
28
|
|
|
29
|
-
### 🧠 Cognitive Tools
|
|
29
|
+
### 🧠 เครื่องมือช่วยคิด (Cognitive Tools)
|
|
30
30
|
|
|
31
31
|
#### `sequentialthinking`
|
|
32
|
-
|
|
32
|
+
หัวใจหลักสำหรับการแก้ปัญหาอย่างมีโครงสร้าง บังคับให้คิดวิเคราะห์ทีละขั้นตอนก่อนจะสรุปผล
|
|
33
33
|
|
|
34
34
|
**Inputs:**
|
|
35
|
-
- `thought` (string, required):
|
|
36
|
-
- `thoughtNumber` (integer, required):
|
|
37
|
-
- `totalThoughts` (integer, required):
|
|
38
|
-
- `nextThoughtNeeded` (boolean, required): `true`
|
|
39
|
-
- `thoughtType` (enum):
|
|
40
|
-
- `analysis`:
|
|
41
|
-
- `generation`:
|
|
42
|
-
- `evaluation`:
|
|
43
|
-
- `reflexion`:
|
|
44
|
-
- `selection`:
|
|
45
|
-
- `isRevision` (boolean):
|
|
46
|
-
- `revisesThought` (integer):
|
|
47
|
-
- `branchFromThought` (integer):
|
|
48
|
-
- `branchId` (string):
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
- `thought` (string, required): เนื้อหาของความคิดในขั้นตอนนี้
|
|
36
|
+
- `thoughtNumber` (integer, required): ลำดับขั้นตอนปัจจุบัน (เริ่มที่ 1)
|
|
37
|
+
- `totalThoughts` (integer, required): จำนวนขั้นตอนที่คาดว่าจะใช้ (ปรับเปลี่ยนได้ตลอด)
|
|
38
|
+
- `nextThoughtNeeded` (boolean, required): `true` ถ้าต้องคิดต่อ, `false` เมื่อได้คำตอบสุดท้ายแล้ว
|
|
39
|
+
- `thoughtType` (enum): ประเภทของความคิด:
|
|
40
|
+
- `analysis`: วิเคราะห์แยกแยะปัญหา
|
|
41
|
+
- `generation`: ระดมสมองหาทางออก
|
|
42
|
+
- `evaluation`: ประเมินทางเลือก (ใช้คู่กับ `score`)
|
|
43
|
+
- `reflexion`: ทบทวนความคิดก่อนหน้า (ใช้คู่กับ `isRevision`)
|
|
44
|
+
- `selection`: เลือกเส้นทางที่จะไปต่อ
|
|
45
|
+
- `isRevision` (boolean): `true` ถ้ากำลังแก้ไขข้อผิดพลาดก่อนหน้า
|
|
46
|
+
- `revisesThought` (integer): ระบุหมายเลขขั้นตอนที่กำลังแก้ไข
|
|
47
|
+
- `branchFromThought` (integer): หมายเลขขั้นตอนแม่ ถ้าต้องการแตกกิ่งความคิดใหม่
|
|
48
|
+
- `branchId` (string): ชื่อระบุของกิ่งความคิดนั้น (Branch ID)
|
|
49
|
+
|
|
50
|
+
**ข้อแนะนำ:** ใช้เครื่องมือนี้กับงานทุกอย่างที่ไม่ใช่คำถามพื้นฐาน อย่าเพิ่งรีบตอบ ให้คิดก่อน
|
|
51
51
|
|
|
52
52
|
#### `clear_thought_history`
|
|
53
|
-
|
|
53
|
+
ล้างประวัติการคิดทั้งหมด ใช้เมื่อต้องการเริ่มงานใหม่หรือเคลียร์ Context
|
|
54
54
|
|
|
55
55
|
#### `summarize_history`
|
|
56
|
-
|
|
56
|
+
ย่อรวมความคิดหลายๆ ขั้นตอนให้เป็นสรุปเดียว จำเป็นมากสำหรับการคิดที่ยาวนาน เพื่อประหยัด Token
|
|
57
57
|
|
|
58
58
|
**Inputs:**
|
|
59
|
-
- `startIndex` (integer):
|
|
60
|
-
- `endIndex` (integer):
|
|
61
|
-
- `summary` (string):
|
|
59
|
+
- `startIndex` (integer): จุดเริ่มต้นที่จะสรุป
|
|
60
|
+
- `endIndex` (integer): จุดสิ้นสุดที่จะสรุป
|
|
61
|
+
- `summary` (string): ข้อความสรุป
|
|
62
62
|
|
|
63
|
-
### 🌐 External Knowledge
|
|
63
|
+
### 🌐 ความรู้ภายนอก (External Knowledge)
|
|
64
64
|
|
|
65
65
|
#### `web_search`
|
|
66
|
-
|
|
66
|
+
ค้นหาข้อมูลแบบ Real-time จากอินเทอร์เน็ต
|
|
67
67
|
|
|
68
68
|
**Inputs:**
|
|
69
|
-
- `query` (string, required):
|
|
69
|
+
- `query` (string, required): คำค้นหา
|
|
70
70
|
- `provider` (enum, optional):
|
|
71
|
-
- `brave`:
|
|
72
|
-
- `exa`: AI
|
|
73
|
-
- `google`: Google Custom Search (
|
|
71
|
+
- `brave`: ค้นหาเว็บทั่วไป (ต้องมี `BRAVE_API_KEY`)
|
|
72
|
+
- `exa`: ค้นหาเชิงลึกด้วย AI (ต้องมี `EXA_API_KEY`)
|
|
73
|
+
- `google`: Google Custom Search (ต้องมี `GOOGLE_SEARCH_API_KEY` & `GOOGLE_SEARCH_CX`)
|
|
74
74
|
|
|
75
75
|
#### `fetch`
|
|
76
|
-
|
|
76
|
+
ดึงข้อมูล HTTP Request จาก URL โดยตรง มีประโยชน์มากสำหรับดึง HTML, JSON หรือ Text จากแหล่งข้อมูลที่เจอผ่าน Search
|
|
77
77
|
|
|
78
78
|
**Inputs:**
|
|
79
|
-
- `url` (string, required):
|
|
80
|
-
- `method`: `GET` (default), `POST`, `PUT`, `DELETE
|
|
81
|
-
- `headers`: JSON
|
|
82
|
-
- `body`: Request
|
|
79
|
+
- `url` (string, required): URL เป้าหมาย
|
|
80
|
+
- `method`: `GET` (default), `POST`, `PUT`, `DELETE`
|
|
81
|
+
- `headers`: JSON Object สำหรับ Headers
|
|
82
|
+
- `body`: Request Body สำหรับ POST/PUT
|
|
83
83
|
|
|
84
84
|
#### `read_webpage`
|
|
85
|
-
|
|
85
|
+
อ่านหน้าเว็บและแปลงเป็น Markdown ที่สะอาด (ตัดโฆษณาและเมนูออก) เหมาะสำหรับอ่านบทความหรือ Document เพื่อประหยัด Token
|
|
86
86
|
|
|
87
87
|
**Inputs:**
|
|
88
|
-
- `url` (string, required):
|
|
88
|
+
- `url` (string, required): URL ที่จะอ่าน
|
|
89
89
|
|
|
90
|
-
### 🏗 Codebase Intelligence
|
|
90
|
+
### 🏗 ความฉลาดด้านโค้ด (Codebase Intelligence)
|
|
91
91
|
|
|
92
92
|
#### `build_project_graph`
|
|
93
|
-
|
|
93
|
+
**รันคำสั่งนี้เป็นอันดับแรก** เมื่อเริ่มโปรเจกต์ใหม่ มันจะสแกนโฟลเดอร์และสร้างแผนผังความสัมพันธ์ (Dependency Graph) โดยใช้ TypeScript AST Analysis รวมถึงดึงข้อมูล **Exported Symbols** (Functions, Classes, Variables) ออกมาด้วย
|
|
94
94
|
|
|
95
95
|
**Inputs:**
|
|
96
|
-
- `path` (string, optional):
|
|
96
|
+
- `path` (string, optional): โฟลเดอร์ราก (Default คือ `.`)
|
|
97
97
|
|
|
98
98
|
#### `get_project_graph_summary`
|
|
99
|
-
|
|
99
|
+
ดูภาพรวมโครงสร้างโปรเจกต์และไฟล์ที่ถูกอ้างอิงถึงบ่อยที่สุด
|
|
100
100
|
|
|
101
|
-
#### `
|
|
102
|
-
|
|
101
|
+
#### `get_project_graph_visualization`
|
|
102
|
+
สร้าง Mermaid Diagram String แสดงความสัมพันธ์ของไฟล์ในโปรเจกต์ สามารถนำไปแสดงผลใน Markdown Viewer ได้
|
|
103
103
|
|
|
104
|
-
|
|
105
|
-
- `filePath` (string, required): Path to the file (e.g., `src/index.ts`).
|
|
106
|
-
**Returns:**
|
|
107
|
-
- `imports`: What this file needs.
|
|
108
|
-
- `importedBy`: Who relies on this file.
|
|
109
|
-
|
|
110
|
-
#### `search_code`
|
|
111
|
-
Searches for a text pattern across all code files in the project. Useful for finding usage examples or specific logic.
|
|
112
|
-
|
|
113
|
-
**Inputs:**
|
|
114
|
-
- `pattern` (string, required): Text to search for.
|
|
115
|
-
- `path` (string, optional): Root directory (defaults to `.`).
|
|
116
|
-
|
|
117
|
-
### 🛠 System Operations
|
|
104
|
+
### 🛠 การจัดการระบบ (System Operations)
|
|
118
105
|
|
|
119
106
|
#### `read_file`
|
|
120
|
-
|
|
107
|
+
อ่านเนื้อหาไฟล์ **ควรอ่านไฟล์ก่อนแก้ไขเสมอ**
|
|
121
108
|
|
|
122
109
|
**Inputs:**
|
|
123
|
-
- `path` (string, required):
|
|
110
|
+
- `path` (string, required): Path ของไฟล์
|
|
124
111
|
|
|
125
112
|
#### `write_file`
|
|
126
|
-
|
|
113
|
+
สร้างหรือเขียนทับไฟล์
|
|
127
114
|
|
|
128
115
|
**Inputs:**
|
|
129
|
-
- `path` (string, required):
|
|
130
|
-
- `content` (string, required):
|
|
116
|
+
- `path` (string, required): Path ของไฟล์
|
|
117
|
+
- `content` (string, required): เนื้อหาที่จะเขียน
|
|
131
118
|
|
|
132
|
-
#### `
|
|
133
|
-
|
|
119
|
+
#### `edit_file`
|
|
120
|
+
แก้ไขข้อความบางส่วนในไฟล์ (Search & Replace) เหมาะสำหรับการแก้ไขจุดเล็กๆ โดยไม่ต้องเขียนทับทั้งไฟล์
|
|
134
121
|
|
|
135
122
|
**Inputs:**
|
|
136
|
-
- `
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
To optimize your AI agent's performance with these tools, we recommend adding the following instructions to its system prompt:
|
|
123
|
+
- `path` (string, required): Path ของไฟล์
|
|
124
|
+
- `oldText` (string, required): ข้อความเดิมที่ต้องการเปลี่ยน (ต้องตรงเป๊ะ)
|
|
125
|
+
- `newText` (string, required): ข้อความใหม่
|
|
126
|
+
- `allowMultiple` (boolean, optional): อนุญาตให้เปลี่ยนหลายจุดพร้อมกัน (Default: false)
|
|
142
127
|
|
|
143
|
-
|
|
144
|
-
|
|
128
|
+
#### `manage_notes`
|
|
129
|
+
จัดการความจำระยะยาว (Long-term Memory) / บันทึกช่วยจำ ใช้เก็บข้อมูลสำคัญ กฎ หรือสิ่งที่เรียนรู้เพื่อให้จำได้ข้าม Session
|
|
145
130
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
* **Context:** Before reading a file, check its context with `get_file_relationships`. This prevents "hallucinating" imports or breaking existing dependencies.
|
|
154
|
-
|
|
155
|
-
3. **External Verification**
|
|
156
|
-
* **Docs & Facts:** If you need to use a library you aren't 100% sure about, use `web_search` to check the documentation.
|
|
157
|
-
|
|
158
|
-
4. **Safety & Persistence**
|
|
159
|
-
* **Files:** Always `read_file` before `write_file`.
|
|
160
|
-
* **History:** Your thoughts are saved. If you get stuck, review your previous thoughts.
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
## Usage
|
|
131
|
+
**Inputs:**
|
|
132
|
+
- `action` (enum, required): 'add', 'list', 'search', 'update', 'delete'
|
|
133
|
+
- `title` (string): หัวข้อ
|
|
134
|
+
- `content` (string): เนื้อหา
|
|
135
|
+
- `tags` (array): แท็กจัดหมวดหมู่
|
|
136
|
+
- `searchQuery` (string): คำค้นหา (สำหรับ action: search)
|
|
137
|
+
- `noteId` (string): ID ของโน้ต (สำหรับ update/delete)
|
|
164
138
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
- Analysis that might need course correction
|
|
169
|
-
- Problems where the full scope might not be clear initially
|
|
170
|
-
- Tasks that need to maintain context over multiple steps
|
|
171
|
-
- Situations where irrelevant information needs to be filtered out
|
|
139
|
+
#### `shell_execute`
|
|
140
|
+
รันคำสั่ง Shell (เช่น `npm test`, `npm run build`, `ls`)
|
|
141
|
+
**คำเตือน:** ใช้ด้วยความระมัดระวัง หลีกเลี่ยงคำสั่งที่ลบข้อมูลหรือเปิดเผยความลับ
|
|
172
142
|
|
|
173
|
-
## Configuration
|
|
143
|
+
## การตั้งค่า (Configuration)
|
|
174
144
|
|
|
175
145
|
### Environment Variables
|
|
176
|
-
- `THOUGHT_DELAY_MS`: (Optional)
|
|
177
|
-
- `DISABLE_THOUGHT_LOGGING`: (Optional)
|
|
178
|
-
- `THOUGHTS_STORAGE_PATH`: (Optional) Path
|
|
146
|
+
- `THOUGHT_DELAY_MS`: (Optional) เวลาหน่วง (ms) ก่อนประมวลผลความคิดถัดไป เพื่อป้องกัน Rate Limit (Default: `0`)
|
|
147
|
+
- `DISABLE_THOUGHT_LOGGING`: (Optional) ตั้งเป็น `true` เพื่อปิดการแสดงผล Log สีสวยงาม
|
|
148
|
+
- `THOUGHTS_STORAGE_PATH`: (Optional) Path ของไฟล์ประวัติการคิด (Default: `thoughts_history.json`)
|
|
179
149
|
|
|
180
|
-
###
|
|
150
|
+
### การใช้งานกับ Claude Desktop
|
|
181
151
|
|
|
182
|
-
|
|
152
|
+
เพิ่ม Config นี้ใน `claude_desktop_config.json`:
|
|
183
153
|
|
|
184
154
|
#### npx
|
|
185
155
|
|
|
@@ -203,81 +173,53 @@ Add this to your `claude_desktop_config.json`. You can configure API keys direct
|
|
|
203
173
|
}
|
|
204
174
|
```
|
|
205
175
|
|
|
206
|
-
###
|
|
176
|
+
### การติดตั้งกับ VS Code
|
|
207
177
|
|
|
208
|
-
|
|
178
|
+
คลิกปุ่มด้านล่างเพื่อติดตั้งด่วน...
|
|
209
179
|
|
|
210
180
|
[](https://insiders.vscode.dev/redirect/mcp/install?name=sequentialthinking&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40gotza02%2Fsequential-thinking%22%5D%7D)
|
|
211
181
|
|
|
212
|
-
##
|
|
182
|
+
## การ Build และ Test
|
|
213
183
|
|
|
214
184
|
```bash
|
|
215
185
|
npm install
|
|
216
186
|
npm run build
|
|
217
187
|
```
|
|
218
188
|
|
|
219
|
-
## Testing
|
|
220
|
-
|
|
221
189
|
```bash
|
|
222
190
|
npm test
|
|
223
191
|
```
|
|
224
192
|
|
|
225
|
-
## Recent Updates
|
|
226
|
-
- **Robustness**:
|
|
227
|
-
- Implemented **Atomic Writes** for `thoughts_history.json` to prevent file corruption.
|
|
228
|
-
- Added **Internal Locking** to handle concurrent save requests gracefully.
|
|
229
|
-
- Added **API Retry Logic** with exponential backoff for all search and web tools (handles HTTP 429/5xx).
|
|
230
|
-
- Improved HTTP requests with browser-like headers (User-Agent) to reduce blocking.
|
|
231
|
-
- **New Tools**:
|
|
232
|
-
- `summarize_history`: Archive and condense long reasoning chains.
|
|
233
|
-
- **Graph Enhancements**:
|
|
234
|
-
- Added **Symbol Extraction**: The project graph now tracks exported functions, classes, and variables.
|
|
235
|
-
|
|
236
|
-
## Recent Updates (v2026.1.27)
|
|
237
|
-
- **New Tools**:
|
|
238
|
-
- `read_webpage`: Convert webpages to Markdown for efficient reading.
|
|
239
|
-
- `search_code`: Recursive text search in code files.
|
|
240
|
-
- `clear_thought_history`: Reset the thinking process.
|
|
241
|
-
|
|
242
|
-
## Recent Updates (v2026.1.26)
|
|
243
|
-
|
|
244
|
-
- **Rate Limiting**:
|
|
245
|
-
- Added `THOUGHT_DELAY_MS` environment variable to introduce a delay between thought steps. This helps prevent request flooding and rate limit issues.
|
|
246
|
-
|
|
247
|
-
## Recent Updates (v2026.1.24)
|
|
248
|
-
|
|
249
|
-
- **Bug Fixes**:
|
|
250
|
-
- Fixed `get_file_relationships` to correctly resolve absolute imports and imports from project root (e.g., `src/utils`), ensuring the dependency graph is complete for projects using path aliases or absolute paths.
|
|
193
|
+
## ประวัติการอัปเดต (Recent Updates)
|
|
251
194
|
|
|
252
|
-
|
|
195
|
+
### v2026.2.0 (Latest)
|
|
196
|
+
- **Refactoring**: ปรับโครงสร้างโค้ดครั้งใหญ่ แยกการทำงานเป็นโมดูล (`src/tools/`) เพื่อให้อ่านง่ายและรองรับการขยายตัวในอนาคต
|
|
253
197
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
## Recent Updates (v2026.1.21)
|
|
258
|
-
|
|
259
|
-
- **Performance & Accuracy**:
|
|
260
|
-
- Replaced Regex-based code analysis with **TypeScript Compiler API (AST)** for 100% accurate import/export detection.
|
|
261
|
-
- Improved `web_search` robustness and error handling.
|
|
262
|
-
- **Persistence**:
|
|
263
|
-
- Implemented **File-based Persistence** for the thinking process. Your thoughts are now saved to `thoughts_history.json` automatically.
|
|
264
|
-
- Switched to **Asynchronous File I/O** to prevent server blocking.
|
|
265
|
-
- **Bug Fixes**:
|
|
266
|
-
- Fixed duplicate import entries in the project graph.
|
|
267
|
-
- Resolved memory growth issues in long-running sessions.
|
|
198
|
+
### v2026.1.31
|
|
199
|
+
- **New Tools**:
|
|
200
|
+
- `manage_notes`: ระบบความจำระยะยาวสำหรับเก็บข้อมูลข้าม Session
|
|
268
201
|
|
|
269
|
-
|
|
202
|
+
### v2026.1.30
|
|
203
|
+
- **New Tools**:
|
|
204
|
+
- `get_project_graph_visualization`: สร้าง Mermaid Diagram แสดงโครงสร้างโปรเจกต์
|
|
270
205
|
|
|
271
|
-
|
|
272
|
-
|
|
206
|
+
### v2026.1.29
|
|
207
|
+
- **New Tools**:
|
|
208
|
+
- `edit_file`: แก้ไขไฟล์เฉพาะจุดโดยไม่ต้องเขียนทับทั้งหมด
|
|
273
209
|
|
|
274
|
-
|
|
210
|
+
### v2026.1.28
|
|
211
|
+
- **Robustness**:
|
|
212
|
+
- เพิ่ม **Atomic Writes** สำหรับ `thoughts_history.json` ป้องกันไฟล์เสีย
|
|
213
|
+
- เพิ่ม **API Retry Logic** (Exponential Backoff) สำหรับเครื่องมือ Web Search ทั้งหมด
|
|
214
|
+
- **New Tools**:
|
|
215
|
+
- `summarize_history`: ย่อประวัติการคิด
|
|
275
216
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
-
|
|
279
|
-
-
|
|
217
|
+
### v2026.1.27
|
|
218
|
+
- **New Tools**:
|
|
219
|
+
- `read_webpage`: อ่านหน้าเว็บเป็น Markdown
|
|
220
|
+
- `search_code`: ค้นหาข้อความในไฟล์โค้ดแบบ Recursive
|
|
221
|
+
- `clear_thought_history`: ล้างประวัติการคิด
|
|
280
222
|
|
|
281
223
|
## License
|
|
282
224
|
|
|
283
|
-
|
|
225
|
+
MIT License
|
package/dist/graph.js
CHANGED
|
@@ -186,4 +186,29 @@ export class ProjectKnowledgeGraph {
|
|
|
186
186
|
}))
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
|
+
toMermaid() {
|
|
190
|
+
const lines = ['graph TD'];
|
|
191
|
+
const fileToId = new Map();
|
|
192
|
+
let idCounter = 0;
|
|
193
|
+
// Assign IDs
|
|
194
|
+
for (const [filePath, _] of this.nodes) {
|
|
195
|
+
const relative = path.relative(this.rootDir, filePath);
|
|
196
|
+
const id = `N${idCounter++}`;
|
|
197
|
+
fileToId.set(filePath, id);
|
|
198
|
+
// Escape quotes in label
|
|
199
|
+
const label = relative.replace(/"/g, "'");
|
|
200
|
+
lines.push(` ${id}["${label}"]`);
|
|
201
|
+
}
|
|
202
|
+
// Add Edges
|
|
203
|
+
for (const [filePath, node] of this.nodes) {
|
|
204
|
+
const sourceId = fileToId.get(filePath);
|
|
205
|
+
for (const importPath of node.imports) {
|
|
206
|
+
const targetId = fileToId.get(importPath);
|
|
207
|
+
if (sourceId && targetId) {
|
|
208
|
+
lines.push(` ${sourceId} --> ${targetId}`);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return lines.join('\\n');
|
|
213
|
+
}
|
|
189
214
|
}
|
package/dist/graph.test.js
CHANGED
|
File without changes
|
package/dist/graph_repro.test.js
CHANGED
|
File without changes
|