snow-ai 0.3.26 → 0.3.27
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/dist/api/systemPrompt.js +44 -24
- package/dist/hooks/useCommandPanel.js +34 -2
- package/dist/mcp/todo.js +76 -28
- package/dist/ui/components/TodoTree.js +2 -0
- package/package.json +1 -1
package/dist/api/systemPrompt.js
CHANGED
|
@@ -101,30 +101,50 @@ const SYSTEM_PROMPT_TEMPLATE = `You are Snow AI CLI, an intelligent command-line
|
|
|
101
101
|
|
|
102
102
|
**Golden Rule: Read what you need to write correct code, nothing more.**
|
|
103
103
|
|
|
104
|
-
### 📋 TODO Management -
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
|
|
113
|
-
**
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
**
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
104
|
+
### 📋 TODO Management - STRONGLY RECOMMENDED for Better Results!
|
|
105
|
+
|
|
106
|
+
**🎯 DEFAULT BEHAVIOR: Use TODO for ALL multi-step tasks (3+ steps)**
|
|
107
|
+
|
|
108
|
+
**✨ WHY TODO IS ESSENTIAL:**
|
|
109
|
+
- 📊 **Track progress** - Never lose your place in complex work
|
|
110
|
+
- ✅ **Ensure completeness** - Verify all steps are done
|
|
111
|
+
- 🎯 **Stay focused** - Clear roadmap prevents confusion
|
|
112
|
+
- 💪 **Build confidence** - Users see structured progress
|
|
113
|
+
- 🚀 **Better quality** - Systematic approach reduces errors
|
|
114
|
+
|
|
115
|
+
**⚡ WHEN TO USE TODO (Default for most tasks):**
|
|
116
|
+
- ✅ **ANY multi-file modification** (always use)
|
|
117
|
+
- ✅ **ANY feature implementation** (always use)
|
|
118
|
+
- ✅ **ANY refactoring task** (always use)
|
|
119
|
+
- ✅ **Bug fixes touching 2+ files** (recommended)
|
|
120
|
+
- ✅ **User requests with multiple requirements** (always use)
|
|
121
|
+
- ✅ **Unfamiliar codebase changes** (recommended)
|
|
122
|
+
- ⚠️ **SKIP ONLY for**: Single-file trivial edits (1-2 lines)
|
|
123
|
+
|
|
124
|
+
**🔧 USAGE RULES (Critical):**
|
|
125
|
+
1. **⚠️ PARALLEL CALLS ONLY**: ALWAYS call TODO tools with action tools in the SAME function call block
|
|
126
|
+
2. **Immediate updates**: Mark completed while performing work (not after)
|
|
127
|
+
3. **Right sizing**: 3-7 main tasks, add subtasks if needed
|
|
128
|
+
4. **Lifecycle Management**:
|
|
129
|
+
- New task = Create TODO at start
|
|
130
|
+
- Major requirement change = Delete old + create new
|
|
131
|
+
- Minor adjustment = Use todo-add or todo-update
|
|
132
|
+
- **CRITICAL**: Keep using TODO throughout the entire conversation!
|
|
133
|
+
|
|
134
|
+
**✅ CORRECT PATTERNS (Do this):**
|
|
135
|
+
- ✅ todo-create + filesystem-read → Plan while gathering info
|
|
136
|
+
- ✅ todo-update(completed) + filesystem-edit → Update as you work
|
|
137
|
+
- ✅ todo-get + filesystem-read → Check status while reading
|
|
138
|
+
- ✅ todo-add + filesystem-edit → Add new task while working
|
|
139
|
+
|
|
140
|
+
**❌ FORBIDDEN PATTERNS (NEVER do this - WILL FAIL):**
|
|
141
|
+
- ❌ todo-create alone, wait for result, then work → VIOLATION! Call together!
|
|
142
|
+
- ❌ todo-update alone, wait, then continue → VIOLATION! Update while working!
|
|
143
|
+
- ❌ todo-get alone just to check → VIOLATION! Call with other tools!
|
|
144
|
+
- ❌ Skipping TODO for multi-file tasks → VIOLATION! Always use TODO!
|
|
145
|
+
- ❌ **Abandoning TODO mid-conversation** → VIOLATION! Keep using throughout dialogue!
|
|
146
|
+
|
|
147
|
+
**💡 BEST PRACTICE: Start every non-trivial task with todo-create + initial action in parallel!**
|
|
128
148
|
|
|
129
149
|
## 🛠️ Available Tools
|
|
130
150
|
|
|
@@ -53,8 +53,40 @@ export function useCommandPanel(buffer, isProcessing = false) {
|
|
|
53
53
|
if (!text.startsWith('/'))
|
|
54
54
|
return [];
|
|
55
55
|
const query = text.slice(1).toLowerCase();
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
// Filter and sort commands by priority
|
|
57
|
+
// Priority order:
|
|
58
|
+
// 1. Command starts with query (highest)
|
|
59
|
+
// 2. Command contains query
|
|
60
|
+
// 3. Description starts with query
|
|
61
|
+
// 4. Description contains query (lowest)
|
|
62
|
+
const filtered = commands
|
|
63
|
+
.filter(command => command.name.toLowerCase().includes(query) ||
|
|
64
|
+
command.description.toLowerCase().includes(query))
|
|
65
|
+
.map(command => {
|
|
66
|
+
const nameLower = command.name.toLowerCase();
|
|
67
|
+
const descLower = command.description.toLowerCase();
|
|
68
|
+
let priority = 4; // Default: description contains query
|
|
69
|
+
if (nameLower.startsWith(query)) {
|
|
70
|
+
priority = 1; // Command starts with query
|
|
71
|
+
}
|
|
72
|
+
else if (nameLower.includes(query)) {
|
|
73
|
+
priority = 2; // Command contains query
|
|
74
|
+
}
|
|
75
|
+
else if (descLower.startsWith(query)) {
|
|
76
|
+
priority = 3; // Description starts with query
|
|
77
|
+
}
|
|
78
|
+
return { command, priority };
|
|
79
|
+
})
|
|
80
|
+
.sort((a, b) => {
|
|
81
|
+
// Sort by priority (lower number = higher priority)
|
|
82
|
+
if (a.priority !== b.priority) {
|
|
83
|
+
return a.priority - b.priority;
|
|
84
|
+
}
|
|
85
|
+
// If same priority, sort alphabetically by name
|
|
86
|
+
return a.command.name.localeCompare(b.command.name);
|
|
87
|
+
})
|
|
88
|
+
.map(item => item.command);
|
|
89
|
+
return filtered;
|
|
58
90
|
}, [buffer]);
|
|
59
91
|
// Update command panel state
|
|
60
92
|
const updateCommandPanelState = useCallback((text) => {
|
package/dist/mcp/todo.js
CHANGED
|
@@ -213,36 +213,43 @@ export class TodoService {
|
|
|
213
213
|
return [
|
|
214
214
|
{
|
|
215
215
|
name: 'todo-create',
|
|
216
|
-
description:
|
|
216
|
+
description: `✅ RECOMMENDED: Create TODO list for structured task execution. Use this for ALL multi-step tasks!
|
|
217
217
|
|
|
218
|
-
|
|
219
|
-
|
|
218
|
+
⚠️ MANDATORY RULE - PARALLEL CALLS ONLY:
|
|
219
|
+
🚫 NEVER call todo-create alone! MUST call with other tools in the SAME function call block.
|
|
220
|
+
✅ ALWAYS: todo-create + filesystem-read (or other action tool) in parallel
|
|
221
|
+
❌ FORBIDDEN: Call todo-create, wait for result, then call other tools
|
|
220
222
|
|
|
221
|
-
##
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
223
|
+
## 🎯 DEFAULT USAGE - Use TODO by default for:
|
|
224
|
+
✅ ANY multi-file changes (always create TODO first)
|
|
225
|
+
✅ ANY feature implementation (plan with TODO)
|
|
226
|
+
✅ ANY refactoring work (track with TODO)
|
|
227
|
+
✅ Bug fixes involving 2+ files (use TODO)
|
|
228
|
+
✅ Tasks with 3+ distinct steps (create TODO)
|
|
229
|
+
⚠️ SKIP ONLY: Single-file trivial edits (1-2 lines)
|
|
226
230
|
|
|
227
|
-
##
|
|
228
|
-
-
|
|
229
|
-
-
|
|
230
|
-
-
|
|
231
|
-
-
|
|
231
|
+
## 🚀 WHY CREATE TODO:
|
|
232
|
+
- Ensures all requirements are addressed
|
|
233
|
+
- Prevents missing critical steps
|
|
234
|
+
- Provides clear progress tracking
|
|
235
|
+
- Improves code quality through systematic approach
|
|
236
|
+
- Builds user confidence with visible structure
|
|
232
237
|
|
|
233
|
-
##
|
|
234
|
-
1. **NEW
|
|
235
|
-
2. **
|
|
236
|
-
3.
|
|
238
|
+
## 📋 WHEN TO CALL:
|
|
239
|
+
1. **NEW TASK**: Create TODO immediately when starting work (with parallel action)
|
|
240
|
+
2. **NEW REQUIREMENT**: Delete old todos, create fresh list (with parallel action)
|
|
241
|
+
3. **BEST PRACTICE**: Call todo-create + filesystem-read in parallel
|
|
237
242
|
|
|
238
|
-
## CREATION GUIDELINES:
|
|
239
|
-
-
|
|
240
|
-
-
|
|
241
|
-
-
|
|
242
|
-
-
|
|
243
|
+
## ⚡ CREATION GUIDELINES:
|
|
244
|
+
- Break work into 3-7 clear, actionable tasks
|
|
245
|
+
- Order by logical dependencies
|
|
246
|
+
- Be specific (e.g., "Modify validateInput in form.ts" not "fix validation")
|
|
247
|
+
- Include verification step if critical
|
|
243
248
|
|
|
244
|
-
##
|
|
245
|
-
This REPLACES the entire TODO list.
|
|
249
|
+
## ⚠️ LIFECYCLE:
|
|
250
|
+
This REPLACES the entire TODO list. For adding tasks to existing list, use "todo-add" instead.
|
|
251
|
+
|
|
252
|
+
## 💡 REMEMBER: MUST call with other tools - never alone!`,
|
|
246
253
|
inputSchema: {
|
|
247
254
|
type: 'object',
|
|
248
255
|
properties: {
|
|
@@ -270,7 +277,19 @@ This REPLACES the entire TODO list. Never use it to "add more tasks" - use "todo
|
|
|
270
277
|
},
|
|
271
278
|
{
|
|
272
279
|
name: 'todo-get',
|
|
273
|
-
description: `Get current TODO list with task IDs, status, and hierarchy.
|
|
280
|
+
description: `Get current TODO list with task IDs, status, and hierarchy.
|
|
281
|
+
|
|
282
|
+
⚠️ MANDATORY RULE - PARALLEL CALLS ONLY:
|
|
283
|
+
🚫 NEVER call todo-get alone! MUST call with other tools in the SAME function call block.
|
|
284
|
+
✅ ALWAYS: todo-get + filesystem-read/terminal-execute/etc in parallel
|
|
285
|
+
❌ FORBIDDEN: Call todo-get alone to check status
|
|
286
|
+
|
|
287
|
+
## 🔄 WHEN TO USE IN DIALOGUE:
|
|
288
|
+
- **User provides additional info**: Use todo-get + filesystem-read to check what's done
|
|
289
|
+
- **User requests modifications**: Check current progress before adding/updating tasks
|
|
290
|
+
- **Continuing work**: Always check status first to avoid redoing completed tasks
|
|
291
|
+
|
|
292
|
+
USAGE: Combine with filesystem-read, terminal-execute, or other actions to check progress while working.`,
|
|
274
293
|
inputSchema: {
|
|
275
294
|
type: 'object',
|
|
276
295
|
properties: {},
|
|
@@ -278,7 +297,17 @@ This REPLACES the entire TODO list. Never use it to "add more tasks" - use "todo
|
|
|
278
297
|
},
|
|
279
298
|
{
|
|
280
299
|
name: 'todo-update',
|
|
281
|
-
description: `Update TODO status/content
|
|
300
|
+
description: `Update TODO status/content - USE THIS FREQUENTLY to track progress!
|
|
301
|
+
|
|
302
|
+
⚠️ MANDATORY RULE - PARALLEL CALLS ONLY:
|
|
303
|
+
🚫 NEVER call todo-update alone! MUST call with other tools in the SAME function call block.
|
|
304
|
+
✅ ALWAYS: todo-update + filesystem-edit/terminal-execute/etc in parallel
|
|
305
|
+
❌ FORBIDDEN: Call todo-update, wait for result, then proceed
|
|
306
|
+
|
|
307
|
+
BEST PRACTICE: Mark "completed" ONLY after task is verified.
|
|
308
|
+
Example: todo-update(task1, completed) + filesystem-edit(task2) → Update while working!
|
|
309
|
+
|
|
310
|
+
💡 This ensures efficient workflow and prevents unnecessary wait times.`,
|
|
282
311
|
inputSchema: {
|
|
283
312
|
type: 'object',
|
|
284
313
|
properties: {
|
|
@@ -301,7 +330,19 @@ This REPLACES the entire TODO list. Never use it to "add more tasks" - use "todo
|
|
|
301
330
|
},
|
|
302
331
|
{
|
|
303
332
|
name: 'todo-add',
|
|
304
|
-
description: `Add task to existing TODO
|
|
333
|
+
description: `Add new task to existing TODO list when requirements expand.
|
|
334
|
+
|
|
335
|
+
⚠️ MANDATORY RULE - PARALLEL CALLS ONLY:
|
|
336
|
+
🚫 NEVER call todo-add alone! MUST call with other tools in the SAME function call block.
|
|
337
|
+
✅ ALWAYS: todo-add + filesystem-edit/filesystem-read/etc in parallel
|
|
338
|
+
❌ FORBIDDEN: Call todo-add alone to add task
|
|
339
|
+
|
|
340
|
+
USE WHEN:
|
|
341
|
+
- User adds new requirements during work
|
|
342
|
+
- You discover additional necessary steps
|
|
343
|
+
- Breaking down a complex task into subtasks
|
|
344
|
+
|
|
345
|
+
DO NOT use for initial planning - use todo-create instead.`,
|
|
305
346
|
inputSchema: {
|
|
306
347
|
type: 'object',
|
|
307
348
|
properties: {
|
|
@@ -319,7 +360,14 @@ This REPLACES the entire TODO list. Never use it to "add more tasks" - use "todo
|
|
|
319
360
|
},
|
|
320
361
|
{
|
|
321
362
|
name: 'todo-delete',
|
|
322
|
-
description: `Delete TODO item
|
|
363
|
+
description: `Delete TODO item from the list.
|
|
364
|
+
|
|
365
|
+
⚠️ MANDATORY RULE - PARALLEL CALLS ONLY:
|
|
366
|
+
🚫 NEVER call todo-delete alone! MUST call with other tools in the SAME function call block.
|
|
367
|
+
✅ ALWAYS: todo-delete + filesystem-edit/todo-get/etc in parallel
|
|
368
|
+
❌ FORBIDDEN: Call todo-delete alone
|
|
369
|
+
|
|
370
|
+
NOTE: Deleting a parent task will cascade delete all its children automatically.`,
|
|
323
371
|
inputSchema: {
|
|
324
372
|
type: 'object',
|
|
325
373
|
properties: {
|