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.
@@ -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 - For Complex Programming Tasks
105
-
106
- **🚫 CRITICAL: TODO tools MUST be called in parallel with other tools - NEVER call TODO tools alone!**
107
-
108
- **When to use TODO:**
109
- - Complex tasks with 5+ steps requiring tracking
110
- - Multi-file implementations needing coordination
111
- - User explicitly requests TODO
112
-
113
- **When to skip TODO:**
114
- - Simple 1-3 step tasks (just do them)
115
- - Single file edits or quick fixes
116
-
117
- **Usage rules:**
118
- 1. **Parallel calls only**: Always combine TODO with action tools (filesystem-edit, etc.)
119
- 2. **Action-focused**: "Fix parser.ts timeout" ✅, "Read parser.ts"
120
- 3. **Update immediately**: Mark completed right after task is done
121
- 4. **Keep minimal**: 3-7 tasks max, avoid over-planning
122
-
123
- **Example workflow:**
124
- - CORRECT: Call todo-create with filesystem-edit in parallel
125
- - CORRECT: Call todo-update with filesystem-edit in parallel
126
- - WRONG: Call todo-create alone, then wait, then call filesystem-edit
127
- - WRONG: Call todo-update alone, then wait, then proceed
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
- return commands.filter(command => command.name.toLowerCase().includes(query) ||
57
- command.description.toLowerCase().includes(query));
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: `Create a TODO list for complex multi-step tasks (optional planning tool).
216
+ description: `✅ RECOMMENDED: Create TODO list for structured task execution. Use this for ALL multi-step tasks!
217
217
 
218
- ## CORE PRINCIPLE - FOCUS ON EXECUTION:
219
- TODO lists are OPTIONAL helpers for complex tasks. Your PRIMARY goal is COMPLETING THE WORK, not maintaining perfect TODO lists. Use this tool only when it genuinely helps organize complex work - don't let TODO management slow you down.
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
- ## WHEN TO USE (Optional):
222
- - Complex tasks with 5+ distinct steps that benefit from tracking
223
- - Long-running tasks where progress visibility helps the user
224
- - Tasks with multiple dependencies that need careful ordering
225
- - User explicitly requests a TODO list
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
- ## WHEN TO SKIP:
228
- - Simple 1-3 step tasks (just do the work directly)
229
- - Straightforward file edits or single-function changes
230
- - Quick fixes or minor modifications
231
- - When TODO creation takes longer than just doing the task
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
- ## LIFECYCLE MANAGEMENT:
234
- 1. **NEW REQUEST = NEW TODO LIST**: Completely new requirement? Delete old todos first, then create new list.
235
- 2. **INCREMENTAL REQUEST = USE TODO-ADD**: Adding to existing requirement? Use "todo-add" instead.
236
- 3. Use this tool ONLY when starting fresh (new session or new requirement after cleanup).
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
- - Keep it simple and actionable
240
- - 3-7 main tasks is usually sufficient (don't over-plan)
241
- - Include verification steps only if critical
242
- - Order by dependencies
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
- ## WARNING:
245
- This REPLACES the entire TODO list. Never use it to "add more tasks" - use "todo-add" instead.`,
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. Call with other tools in parallel when needed.`,
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. MUST call with other tools - mark "completed" ONLY after task is verified and done.`,
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 (rare use). MUST call with other tools. Only for user-requested or complex tasks, not small steps.`,
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. MUST call with other tools. Deleting parent auto-deletes children (cascade).`,
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: {
@@ -23,6 +23,8 @@ export default function TodoTree({ todos }) {
23
23
  return '[✓]';
24
24
  case 'pending':
25
25
  return '[ ]';
26
+ default:
27
+ return '[ ]';
26
28
  }
27
29
  };
28
30
  const getStatusColor = (status) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-ai",
3
- "version": "0.3.26",
3
+ "version": "0.3.27",
4
4
  "description": "Intelligent Command Line Assistant powered by AI",
5
5
  "license": "MIT",
6
6
  "bin": {