@gotza02/seq-thinking 1.1.23 → 1.1.24

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # MCP Sequential Thinking with Swarm Coordination
2
2
 
3
- [![Version](https://img.shields.io/badge/version-1.1.23-blue.svg)](https://www.npmjs.com/package/@gotza02/seq-thinking)
3
+ [![Version](https://img.shields.io/badge/version-1.1.24-blue.svg)](https://www.npmjs.com/package/@gotza02/seq-thinking)
4
4
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
5
5
  [![Node.js](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg)](https://nodejs.org/)
6
6
 
@@ -14,6 +14,7 @@
14
14
  * **🔄 Auto-Fallback และความทนทาน**: สลับผู้ให้บริการอัตโนมัติหากผู้ใดผู้หนึ่งล้มเหลว (เช่น `gemini` -> `claude`) รวมถึงลอจิกการ retry สำหรับการดำเนินการงานที่ยืดหยุ่น
15
15
  * **💾 การเก็บข้อมูลและการกู้คืน**: บันทึกเซสชัน สถานะเอเจนต์ และงานไปยังดิสก์อัตโนมัติ รวมถึงระบบกู้คืนที่คืนค่างานที่ถูกขัดจังหวะให้กลับสู่สถานะ pending เมื่อรีสตาร์ท
16
16
  * **🔍 การแก้ไขตนเอง**: ตรวจจับ logical fallacies และการลดลงของความมั่นใจแบบ proactive พร้อมกระตุ้นการดำเนินการแก้ไข
17
+ * **🛡️ Security-First**: ป้องกัน Shell Injection และ Path Traversal ด้วยการใช้ execFile และ Zod validation
17
18
 
18
19
  ## 📦 เริ่มต้นใช้งานอย่างรวดเร็ว (NPX)
19
20
 
@@ -22,7 +23,7 @@
22
23
  **ข้อกำหนดเบื้องต้น:** Node.js v18 หรือสูงกว่า
23
24
 
24
25
  ```bash
25
- npx -y @gotza02/seq-thinking
26
+ npx -y @gotza02/seq-thinking@latest
26
27
  ```
27
28
 
28
29
  ## ⚙️ การตั้งค่า MCP
@@ -36,7 +37,7 @@ npx -y @gotza02/seq-thinking
36
37
  "mcpServers": {
37
38
  "advanced-thinking": {
38
39
  "command": "npx",
39
- "args": ["-y", "@gotza02/seq-thinking"],
40
+ "args": ["-y", "@gotza02/seq-thinking@latest"],
40
41
  "env": {
41
42
  "provider": "gemini,claude",
42
43
  "MOCK_LLM": "false",
@@ -48,6 +49,27 @@ npx -y @gotza02/seq-thinking
48
49
  }
49
50
  ```
50
51
 
52
+ **สำหรับ Cline** (`~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json`):
53
+
54
+ ```json
55
+ {
56
+ "mcpServers": {
57
+ "advanced-thinking": {
58
+ "command": "npx",
59
+ "args": ["-y", "@gotza02/seq-thinking@latest"],
60
+ "env": {
61
+ "provider": "gemini,claude,kimi",
62
+ "MOCK_LLM": "false",
63
+ "LOG_LEVEL": "INFO",
64
+ "MCP_DATA_DIR": "./data"
65
+ },
66
+ "disabled": false,
67
+ "autoApprove": []
68
+ }
69
+ }
70
+ }
71
+ ```
72
+
51
73
  ### ตัวแปรสภาพแวดล้อม (Environment Variables)
52
74
 
53
75
  | ตัวแปร | คำอธิบาย | ค่าเริ่มต้น | ตัวอย่าง |
@@ -70,13 +92,82 @@ npx -y @gotza02/seq-thinking
70
92
 
71
93
  ### 1. `advanced_sequential_thinking`
72
94
  เครื่องยนต์การคิดหลัก
73
- * **Operations:** `initialize`, `add_thought`, `branch_thought`, `self_correct`, `complete_session`, ฯลฯ
74
- * **กรณีใช้งาน:** การแก้ปัญหาเชิงลึกแบบเป็นขั้นตอนพร้อมความสามารถในการย้อนกลับ
95
+
96
+ **Operations:**
97
+ | Operation | คำอธิบาย |
98
+ |-----------|---------|
99
+ | `initialize` | สร้างเซสชันการคิดใหม่ |
100
+ | `add_thought` | เพิ่มความคิดลงในเซสชัน |
101
+ | `branch_thought` | สร้างกิ่งการคิดใหม่ (parallel hypothesis) |
102
+ | `merge_branches` | รวมกิ่งกลับเข้าด้วยกัน |
103
+ | `prune_branch` | ตัดกิ่งที่ไม่จำเป็น |
104
+ | `revise_thought` | แก้ไขความคิดเดิม |
105
+ | `self_correct` | ตรวจสอบและแก้ไข logical fallacies |
106
+ | `add_meta_thought` | เพิ่มความคิดเชิงเมตา |
107
+ | `delegate_to_swarm` | มอบหมายให้ Swarm Agents ประมวลผล |
108
+ | `complete_session` | ปิดเซสชัน |
109
+
110
+ **กรณีใช้งาน:** การแก้ปัญหาเชิงลึกแบบเป็นขั้นตอนพร้อมความสามารถในการย้อนกลับ
75
111
 
76
112
  ### 2. `swarm_agent_coordination`
77
- ผู้จัดการทีมงาน
78
- * **Operations:** `register_agent`, `assign_task`, `reach_consensus`, `resolve_conflict`
79
- * **กรณีใช้งาน:** มอบหมายงานย่อยให้กับ "ผู้เชี่ยวชาญเสมือน" เฉพาะทาง (เช่น ขอให้เอเจนต์ "Critic" ตรวจสอบแผน)
113
+ ผู้จัดการทีมงาน Swarm Agents
114
+
115
+ **Agent Types:**
116
+ | Type | บทบาท | ความสามารถ |
117
+ |------|-------|-----------|
118
+ | **Reasoner** | ให้เหตุผล | Chain of Thought, Tree of Thought, Analogical, Abductive |
119
+ | **Critic** | ตรวจสอบ | Logical, Factual, Bias, Safety |
120
+ | **Synthesizer** | สังเคราะห์ | Consensus, Creative, Conflict Resolution |
121
+ | **Meta-Reasoning** | คิดเชิงเมตา | วิเคราะห์กระบวนการคิด |
122
+ | **Specialist** | ผู้เชี่ยวชาญ | ตาม capabilities ที่กำหนด |
123
+ | **Utility** | ทั่วไป | งานทั่วไปที่ไม่ต้องการความเชี่ยวชาญพิเศษ |
124
+
125
+ **Operations:**
126
+ - `register_agent` - ลงทะเบียน agent ใหม่
127
+ - `assign_task` - มอบหมายงานให้ agent
128
+ - `reach_consensus` - ให้ agents ลงมติร่วมกัน
129
+ - `identify_conflict` - ระบุความขัดแย้ง
130
+ - `resolve_conflict` - แก้ไขความขัดแย้ง
131
+ - `broadcast_message` - ส่งข้อความ broadcast
132
+ - `send_direct_message` - ส่งข้อความโดยตรง
133
+ - `get_swarm_stats` - ดูสถิติ swarm
134
+
135
+ **กรณีใช้งาน:** มอบหมายงานย่อยให้กับ "ผู้เชี่ยวชาญเสมือน" เฉพาะทาง (เช่น ขอให้เอเจนต์ "Critic" ตรวจสอบแผน)
136
+
137
+ ## 🏗️ สถาปัตยกรรม
138
+
139
+ ```
140
+ ┌─────────────────────────────────────────────────────────────────────┐
141
+ │ MCP Server Layer │
142
+ │ ┌─────────────────────────┐ ┌─────────────────────────────────┐ │
143
+ │ │ Sequential Thinking │ │ Swarm Coordination │ │
144
+ │ │ - SessionManager │ │ - AgentRegistry │ │
145
+ │ │ - ThoughtGraph (DAG) │ │ - TaskQueueManager │ │
146
+ │ │ - MetaReasoningEngine │ │ - MessageBroker │ │
147
+ │ │ - SelfCorrectionEngine │ │ - ConsensusEngine │ │
148
+ │ │ - AdaptiveGranularity │ │ - ConflictResolver │ │
149
+ │ └─────────────────────────┘ └─────────────────────────────────┘ │
150
+ └─────────────────────────────────────────────────────────────────────┘
151
+
152
+ ┌─────────────────────┼───────────────────────┐
153
+ ▼ ▼ ▼
154
+ ┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
155
+ │ Persistence │ │ Mutex/Locking │ │ LLM Adapter │
156
+ │ (Disk Storage) │ │ (Concurrency) │ │ (Multi-Provider) │
157
+ └──────────────────┘ └──────────────────┘ └──────────────────┘
158
+ ```
159
+
160
+ ### องค์ประกอบสำคัญ
161
+
162
+ | Component | หน้าที่ |
163
+ |-----------|---------|
164
+ | **ThoughtGraph** | จัดการโครงสร้าง DAG (Directed Acyclic Graph) ของความคิด |
165
+ | **SessionManager** | จัดการเซสชัน พร้อมบันทึกและโหลดกลับอัตโนมัติ |
166
+ | **SwarmCoordinator** | ประสานงาน agents ทั้งหมด |
167
+ | **AgentRegistry** | ลงทะเบียนและค้นหา agents ตามความสามารถ |
168
+ | **TaskQueueManager** | จัดการคิวงานพร้อม Task Journaling และ Recovery |
169
+ | **Mutex** | ป้องกัน race conditions ในการมอบหมายงาน |
170
+ | **LLMAdapter** | เชื่อมต่อกับ CLI tools (Gemini, Claude, Kimi, OpenCode) |
80
171
 
81
172
  ## 👨‍💻 การพัฒนาและการติดตั้งในเครื่อง
82
173
 
@@ -96,18 +187,63 @@ npm run build
96
187
  # รันการทดสอบ
97
188
  export MOCK_LLM=true
98
189
  npm test
190
+
191
+ # รันในโหมด development
192
+ npm run dev
99
193
  ```
100
194
 
101
- ## 🏗️ สถาปัตยกรรม
195
+ ## 🐛 การแก้ไขปัญหา (Troubleshooting)
196
+
197
+ ### ปัญหา: `kimi chat` หรือ `No such command 'chat'`
198
+
199
+ **สาเหตุ:** ใช้เวอร์ชันเก่าที่ยังใช้คำสั่ง `kimi chat` (ซึ่งไม่มีใน Kimi CLI)
200
+
201
+ **แก้ไข:**
202
+ ```bash
203
+ # 1. อัปเดตเป็นเวอร์ชันล่าสุด
204
+ npx -y @gotza02/seq-thinking@latest
205
+
206
+ # 2. หรือล้าง cache ของ npx
207
+ npx clear-npx-cache
208
+
209
+ # 3. หรือใช้โค้ดในเครื่องโดยตรง
210
+ node cli.js
211
+ ```
212
+
213
+ ### ปัญหา: Multiple MCP Server Processes
214
+
215
+ **สาเหตุ:** มีหลาย process รันอยู่พร้อมกัน
216
+
217
+ **แก้ไข:**
218
+ ```bash
219
+ # หยุดทุก seq-thinking processes
220
+ pkill -f "seq-thinking"
221
+
222
+ # ตรวจสอบอีกครั้ง
223
+ ps aux | grep seq-thinking
224
+ ```
102
225
 
103
- ระบบถูกสร้างบนสถาปัตยกรรมแบบโมดูลาร์:
104
- * **Orchestration Layer:** จัดการสถานะ การควบคุม flow และการจัดการข้อผิดพลาด
105
- * **Swarm Coordinator:** มอบหมายงานตามความสามารถและความพร้อมของเอเจนต์
106
- * **Thought Graph:** กราฟแบบ directed acyclic graph (DAG) ที่แสดงกระบวนการให้เหตุผล
107
- * **LLM Adapter:** อินเทอร์เฟซแบบรวมศูนย์สำหรับสื่อสารกับโมเดลต่างๆ ที่ใช้ CLI
226
+ ### ปัญหา: Provider ไม่ทำงาน
227
+
228
+ **สาเหตุ:** CLI tool ไม่ได้ติดตั้งหรือไม่ได้ login
229
+
230
+ **แก้ไข:**
231
+ ```bash
232
+ # ตรวจสอบว่า CLI ติดตั้งแล้ว
233
+ which gemini # หรือ claude, kimi, opencode
234
+
235
+ # ทดสอบด้วย Mock mode
236
+ export MOCK_LLM=true
237
+ npx -y @gotza02/seq-thinking
238
+ ```
108
239
 
109
240
  ## 📝 ประวัติการเปลี่ยนแปลง (Changelog)
110
241
 
242
+ ### v1.1.24 (2026-02-04)
243
+ - **เอกสาร:** อัปเดต README ด้วยรายละเอียดเพิ่มเติมเกี่ยวกับ Architecture, Swarm Agent Types, และ Troubleshooting
244
+ - **เอกสาร:** เพิ่มตัวอย่างการตั้งค่าสำหรับ Cline
245
+ - **ปรับปรุง:** เพิ่มความชัดเจนในการใช้ `@latest` tag สำหรับ npx
246
+
111
247
  ### v1.1.23 (2026-02-04)
112
248
  - **Security (สำคัญ):** แก้ไขช่องโหว่ Shell Injection โดยใช้ execFile แทน exec
113
249
  - **Security (สำคัญ):** แก้ไขช่องโหว่ Path Traversal โดยเพิ่มการตรวจสอบ ID
@@ -37,7 +37,7 @@ export declare const DEFAULT_LOG_LEVEL = "INFO";
37
37
  /** Default data directory */
38
38
  export declare const DEFAULT_DATA_DIR = "./data";
39
39
  /** Package version - MUST match package.json */
40
- export declare const VERSION = "1.1.23";
40
+ export declare const VERSION = "1.1.24";
41
41
  /** Regex pattern for valid IDs (alphanumeric, hyphen, underscore) */
42
42
  export declare const ID_REGEX: RegExp;
43
43
  /** Regex pattern for complex terms that need higher granularity */
package/dist/constants.js CHANGED
@@ -52,7 +52,7 @@ export const DEFAULT_LOG_LEVEL = 'INFO';
52
52
  /** Default data directory */
53
53
  export const DEFAULT_DATA_DIR = './data';
54
54
  /** Package version - MUST match package.json */
55
- export const VERSION = '1.1.23';
55
+ export const VERSION = '1.1.24';
56
56
  // ============================================================================
57
57
  // Validation
58
58
  // ============================================================================
@@ -111,7 +111,7 @@ export class MCPServer {
111
111
  else {
112
112
  Logger.setLevel(1); // LogLevel.INFO
113
113
  }
114
- this.server = new Server({ name: 'mcp-sequential-thinking', version: '1.1.23' }, { capabilities: { tools: {} } });
114
+ this.server = new Server({ name: 'mcp-sequential-thinking', version: '1.1.24' }, { capabilities: { tools: {} } });
115
115
  this.sessionManager = new SessionManager(this.dataDir);
116
116
  this.swarmCoordinator = new SwarmCoordinator(this.dataDir);
117
117
  this.setupHandlers();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gotza02/seq-thinking",
3
- "version": "1.1.23",
3
+ "version": "1.1.24",
4
4
  "description": "Advanced Sequential Thinking MCP Tool with Swarm Agent Coordination",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",