snow-flow 9.0.6 → 9.0.9

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.
Files changed (40) hide show
  1. package/package.json +2 -1
  2. package/postinstall.cjs +65 -11
  3. package/bunfig.toml +0 -2
  4. package/script/postinstall.mjs +0 -135
  5. package/script/preinstall.mjs +0 -45
  6. package/snow-code-config.example.json +0 -39
  7. package/src/acp/README.md +0 -164
  8. package/src/agent/generate.txt +0 -75
  9. package/src/dag/README.md +0 -473
  10. package/src/session/prompt/anthropic-20250930.txt +0 -166
  11. package/src/session/prompt/anthropic.txt +0 -235
  12. package/src/session/prompt/anthropic_spoof.txt +0 -1
  13. package/src/session/prompt/beast.txt +0 -200
  14. package/src/session/prompt/build-switch.txt +0 -5
  15. package/src/session/prompt/codex.txt +0 -353
  16. package/src/session/prompt/copilot-gpt-5.txt +0 -143
  17. package/src/session/prompt/gemini.txt +0 -217
  18. package/src/session/prompt/initialize.txt +0 -8
  19. package/src/session/prompt/plan.txt +0 -8
  20. package/src/session/prompt/qwen.txt +0 -141
  21. package/src/session/prompt/summarize-turn.txt +0 -5
  22. package/src/session/prompt/summarize.txt +0 -10
  23. package/src/session/prompt/title.txt +0 -24
  24. package/src/tool/bash.txt +0 -121
  25. package/src/tool/edit.txt +0 -10
  26. package/src/tool/glob.txt +0 -6
  27. package/src/tool/grep.txt +0 -8
  28. package/src/tool/ls.txt +0 -1
  29. package/src/tool/lsp-diagnostics.txt +0 -1
  30. package/src/tool/lsp-hover.txt +0 -1
  31. package/src/tool/multiedit.txt +0 -41
  32. package/src/tool/patch.txt +0 -1
  33. package/src/tool/read.txt +0 -12
  34. package/src/tool/task.txt +0 -76
  35. package/src/tool/todoread.txt +0 -14
  36. package/src/tool/todowrite.txt +0 -167
  37. package/src/tool/webfetch.txt +0 -14
  38. package/src/tool/websearch.txt +0 -11
  39. package/src/tool/write.txt +0 -8
  40. package/test-codespace-detection.js +0 -51
@@ -1,41 +0,0 @@
1
- This is a tool for making multiple edits to a single file in one operation. It is built on top of the Edit tool and allows you to perform multiple find-and-replace operations efficiently. Prefer this tool over the Edit tool when you need to make multiple edits to the same file.
2
-
3
- Before using this tool:
4
-
5
- 1. Use the Read tool to understand the file's contents and context
6
- 2. Verify the directory path is correct
7
-
8
- To make multiple file edits, provide the following:
9
- 1. file_path: The absolute path to the file to modify (must be absolute, not relative)
10
- 2. edits: An array of edit operations to perform, where each edit contains:
11
- - oldString: The text to replace (must match the file contents exactly, including all whitespace and indentation)
12
- - newString: The edited text to replace the oldString
13
- - replaceAll: Replace all occurrences of oldString. This parameter is optional and defaults to false.
14
-
15
- IMPORTANT:
16
- - All edits are applied in sequence, in the order they are provided
17
- - Each edit operates on the result of the previous edit
18
- - All edits must be valid for the operation to succeed - if any edit fails, none will be applied
19
- - This tool is ideal when you need to make several changes to different parts of the same file
20
-
21
- CRITICAL REQUIREMENTS:
22
- 1. All edits follow the same requirements as the single Edit tool
23
- 2. The edits are atomic - either all succeed or none are applied
24
- 3. Plan your edits carefully to avoid conflicts between sequential operations
25
-
26
- WARNING:
27
- - The tool will fail if edits.oldString doesn't match the file contents exactly (including whitespace)
28
- - The tool will fail if edits.oldString and edits.newString are the same
29
- - Since edits are applied in sequence, ensure that earlier edits don't affect the text that later edits are trying to find
30
-
31
- When making edits:
32
- - Ensure all edits result in idiomatic, correct code
33
- - Do not leave the code in a broken state
34
- - Always use absolute file paths (starting with /)
35
- - Only use emojis if the user explicitly requests it. Avoid adding emojis to files unless asked.
36
- - Use replaceAll for replacing and renaming strings across the file. This parameter is useful if you want to rename a variable for instance.
37
-
38
- If you want to create a new file, use:
39
- - A new file path, including dir name if needed
40
- - First edit: empty oldString and the new file's contents as newString
41
- - Subsequent edits: normal edit operations on the created content
@@ -1 +0,0 @@
1
- do not use
package/src/tool/read.txt DELETED
@@ -1,12 +0,0 @@
1
- Reads a file from the local filesystem. You can access any file directly by using this tool.
2
- Assume this tool is able to read all files on the machine. If the User provides a path to a file assume that path is valid. It is okay to read a file that does not exist; an error will be returned.
3
-
4
- Usage:
5
- - The filePath parameter must be an absolute path, not a relative path
6
- - By default, it reads up to 2000 lines starting from the beginning of the file
7
- - You can optionally specify a line offset and limit (especially handy for long files), but it's recommended to read the whole file by not providing these parameters
8
- - Any lines longer than 2000 characters will be truncated
9
- - Results are returned using cat -n format, with line numbers starting at 1
10
- - You have the capability to call multiple tools in a single response. It is always better to speculatively read multiple files as a batch that are potentially useful.
11
- - If you read a file that exists but has empty contents you will receive a system reminder warning in place of file contents.
12
- - You can read image files using this tool.
package/src/tool/task.txt DELETED
@@ -1,76 +0,0 @@
1
- Launch a new agent to handle complex, multi-step tasks autonomously.
2
-
3
- Available agent types and the tools they have access to:
4
- {agents}
5
-
6
- When using the Task tool, you must specify a subagent_type parameter to select which agent type to use.
7
-
8
- When to use the Task tool:
9
- - When you are instructed to execute custom slash commands. Use the Task tool with the slash command invocation as the entire prompt. The slash command can take arguments. For example: Task(description="Check the file", prompt="/check-file path/to/file.py")
10
-
11
- When NOT to use the Task tool:
12
- - If you want to read a specific file path, use the Read or Glob tool instead of the Task tool, to find the match more quickly
13
- - If you are searching for a specific class definition like "class Foo", use the Glob tool instead, to find the match more quickly
14
- - If you are searching for code within a specific file or set of 2-3 files, use the Read tool instead of the Task tool, to find the match more quickly
15
- - Other tasks that are not related to the agent descriptions above
16
-
17
-
18
- Usage notes:
19
- 1. Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses
20
- 2. When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.
21
- 3. Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.
22
- 4. The agent's outputs should generally be trusted
23
- 5. Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent
24
- 6. If the agent description mentions that it should be used proactively, then you should try your best to use it without the user having to ask for it first. Use your judgement.
25
-
26
- Advanced: Task Dependencies (DAG Execution)
27
- For complex multi-step workflows with dependencies, you can specify task_id and dependencies:
28
-
29
- - task_id: Optional unique identifier for this task (used for tracking and dependency references)
30
- - dependencies: Optional array of task_ids that must complete before this task starts
31
-
32
- Example with dependencies:
33
- Task(subagent_type="general", description="Research phase", prompt="Research best practices", task_id="research")
34
- Task(subagent_type="build", description="Implementation", prompt="Implement based on research", task_id="implement", dependencies=["research"])
35
- Task(subagent_type="plan", description="Testing", prompt="Test implementation", task_id="test", dependencies=["implement"])
36
-
37
- When using dependencies:
38
- - Tasks with no dependencies execute first (in parallel if multiple)
39
- - Tasks with dependencies wait for all dependencies to complete
40
- - Use the dag-orchestrator agent for complex multi-agent coordination with automatic dependency management
41
-
42
- Example usage (NOTE: The agents below are fictional examples for illustration only - use the actual agents listed above):
43
-
44
- <example_agent_descriptions>
45
- "code-reviewer": use this agent after you are done writing a signficant piece of code
46
- "greeting-responder": use this agent when to respond to user greetings with a friendly joke
47
- </example_agent_description>
48
-
49
- <example>
50
- user: "Please write a function that checks if a number is prime"
51
- assistant: Sure let me write a function that checks if a number is prime
52
- assistant: First let me use the Write tool to write a function that checks if a number is prime
53
- assistant: I'm going to use the Write tool to write the following code:
54
- <code>
55
- function isPrime(n) {
56
- if (n <= 1) return false
57
- for (let i = 2; i * i <= n; i++) {
58
- if (n % i === 0) return false
59
- }
60
- return true
61
- }
62
- </code>
63
- <commentary>
64
- Since a signficant piece of code was written and the task was completed, now use the code-reviewer agent to review the code
65
- </commentary>
66
- assistant: Now let me use the code-reviewer agent to review the code
67
- assistant: Uses the Task tool to launch the code-reviewer agent
68
- </example>
69
-
70
- <example>
71
- user: "Hello"
72
- <commentary>
73
- Since the user is greeting, use the greeting-responder agent to respond with a friendly joke
74
- </commentary>
75
- assistant: "I'm going to use the Task tool to launch the with the greeting-responder agent"
76
- </example>
@@ -1,14 +0,0 @@
1
- Use this tool to read the current to-do list for the session. This tool should be used proactively and frequently to ensure that you are aware of
2
- the status of the current task list. You should make use of this tool as often as possible, especially in the following situations:
3
- - At the beginning of conversations to see what's pending
4
- - Before starting new tasks to prioritize work
5
- - When the user asks about previous tasks or plans
6
- - Whenever you're uncertain about what to do next
7
- - After completing tasks to update your understanding of remaining work
8
- - After every few messages to ensure you're on track
9
-
10
- Usage:
11
- - This tool takes in no parameters. So leave the input blank or empty. DO NOT include a dummy object, placeholder string or a key like "input" or "empty". LEAVE IT BLANK.
12
- - Returns a list of todo items with their status, priority, and content
13
- - Use this information to track progress and plan next steps
14
- - If no todos exist yet, an empty list will be returned
@@ -1,167 +0,0 @@
1
- Use this tool to create and manage a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.
2
- It also helps the user understand the progress of the task and overall progress of their requests.
3
-
4
- ## When to Use This Tool
5
- Use this tool proactively in these scenarios:
6
-
7
- 1. Complex multi-step tasks - When a task requires 3 or more distinct steps or actions
8
- 2. Non-trivial and complex tasks - Tasks that require careful planning or multiple operations
9
- 3. User explicitly requests todo list - When the user directly asks you to use the todo list
10
- 4. User provides multiple tasks - When users provide a list of things to be done (numbered or comma-separated)
11
- 5. After receiving new instructions - Immediately capture user requirements as todos. Feel free to edit the todo list based on new information.
12
- 6. After completing a task - Mark it complete and add any new follow-up tasks
13
- 7. When you start working on a new task, mark the todo as in_progress. Ideally you should only have one todo as in_progress at a time. Complete existing tasks before starting new ones.
14
-
15
- ## When NOT to Use This Tool
16
-
17
- Skip using this tool when:
18
- 1. There is only a single, straightforward task
19
- 2. The task is trivial and tracking it provides no organizational benefit
20
- 3. The task can be completed in less than 3 trivial steps
21
- 4. The task is purely conversational or informational
22
-
23
- NOTE that you should not use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly.
24
-
25
- ## Examples of When to Use the Todo List
26
-
27
- <example>
28
- User: I want to add a dark mode toggle to the application settings. Make sure you run the tests and build when you're done!
29
- Assistant: I'll help add a dark mode toggle to your application settings. Let me create a todo list to track this implementation.
30
- *Creates todo list with the following items:*
31
- 1. Create dark mode toggle component in Settings page
32
- 2. Add dark mode state management (context/store)
33
- 3. Implement CSS-in-JS styles for dark theme
34
- 4. Update existing components to support theme switching
35
- 5. Run tests and build process, addressing any failures or errors that occur
36
- *Begins working on the first task*
37
-
38
- <reasoning>
39
- The assistant used the todo list because:
40
- 1. Adding dark mode is a multi-step feature requiring UI, state management, and styling changes
41
- 2. The user explicitly requested tests and build be run afterward
42
- 3. The assistant inferred that tests and build need to pass by adding "Ensure tests and build succeed" as the final task
43
- </reasoning>
44
- </example>
45
-
46
- <example>
47
- User: Help me rename the function getCwd to getCurrentWorkingDirectory across my project
48
- Assistant: Let me first search through your codebase to find all occurrences of 'getCwd'.
49
- *Uses grep or search tools to locate all instances of getCwd in the codebase*
50
- Assistant: I've found 15 instances of 'getCwd' across 8 different files. Let me create a todo list to track these changes.
51
- *Creates todo list with specific items for each file that needs updating*
52
-
53
- <reasoning>
54
- The assistant used the todo list because:
55
- 1. First, the assistant searched to understand the scope of the task
56
- 2. Upon finding multiple occurrences across different files, it determined this was a complex task with multiple steps
57
- 3. The todo list helps ensure every instance is tracked and updated systematically
58
- 4. This approach prevents missing any occurrences and maintains code consistency
59
- </reasoning>
60
- </example>
61
-
62
-
63
- <example>
64
- User: I need to implement these features for my e-commerce site: user registration, product catalog, shopping cart, and checkout flow.
65
- Assistant: I'll help implement these features. First, let's add all the features to the todo list.
66
- *Creates a todo list breaking down each feature into specific tasks based on the project architecture*
67
- Assistant: Let's start with user registration. This will involve creating database models, API endpoints, and frontend forms that integrate with your existing authentication system.
68
-
69
- <reasoning>
70
- The assistant used the todo list because:
71
- 1. The user provided multiple complex features to implement in a comma separated list
72
- 2. The todo list helps organize these large features into manageable tasks
73
- 3. This approach allows for tracking progress across the entire implementation
74
- </reasoning>
75
- </example>
76
-
77
- <example>
78
- User: Can you help optimize my React application? It's rendering slowly and has performance issues.</user>
79
- Assistant: I'll help optimize your React application. First, let me examine your codebase to identify potential performance bottlenecks.
80
- *Reviews component structure, render patterns, state management, and data fetching*
81
- Assistant: After analyzing your codebase, I've identified several performance issues. Let me create a todo list to track our optimization efforts.
82
- *Creates todo list with items like: 1) Implement memoization for expensive calculations in ProductList, 2) Add virtualization for long lists in Dashboard, 3) Optimize image loading in Gallery component, 4) Fix state update loops in ShoppingCart, 5) Review bundle size and implement code splitting*
83
- Let's start by implementing memoization for the expensive calculations in your ProductList component.</assistant>
84
-
85
- <reasoning>
86
- The assistant used the todo list because:
87
- 1. First, the assistant examined the codebase to identify specific performance issues
88
- 2. Based on this analysis, it identified multiple optimization opportunities
89
- 3. Performance optimization is a non-trivial task requiring multiple steps
90
- 4. The todo list helps methodically track improvements across different components
91
- 5. This systematic approach ensures all performance bottlenecks are addressed
92
- </reasoning>
93
- </example>
94
-
95
- ## Examples of When NOT to Use the Todo List
96
-
97
- <example>
98
- User: How do I print 'Hello World' in Python?
99
- Assistant: In Python, you can print "Hello World" with this simple code:
100
-
101
- python
102
- print("Hello World")
103
-
104
- This will output the text "Hello World" to the console when executed.</assistant>
105
-
106
- <reasoning>
107
- The assistant did not use the todo list because this is a single, trivial task that can be completed in one step. There's no need to track multiple tasks or steps for such a straightforward request.
108
- </reasoning>
109
- </example>
110
-
111
- <example>
112
- User: What does the git status command do?
113
- Assistant: The git status command shows the current state of your working directory and staging area. It displays which changes have been staged, which haven't, and which files aren't being tracked by Git. This is a fundamental command for understanding the current state of your repository before making commits.
114
-
115
- <reasoning>
116
- The assistant did not use the todo list because this is an informational request with no actual coding task to complete. The user is simply asking for an explanation, not for the assistant to perform multiple steps or tasks.
117
- </reasoning>
118
- </example>
119
-
120
- <example>
121
- User: Can you add a comment to the calculateTotal function to explain what it does?
122
- Assistant: Sure, let me add a comment to the calculateTotal function to explain what it does.
123
- * Uses the Edit tool to add a comment to the calculateTotal function *
124
-
125
- <reasoning>
126
- The assistant did not use the todo list because this is a single, straightforward task confined to one location in the code. Adding a comment doesn't require tracking multiple steps or systematic organization.
127
- </reasoning>
128
- </example>
129
-
130
- <example>
131
- User: Run npm install for me and tell me what happens.
132
- Assistant: I'll run the npm install command for you.
133
-
134
- *Executes: npm install*
135
-
136
- The command completed successfully. Here's the output:
137
- [Output of npm install command]
138
-
139
- All dependencies have been installed according to your package.json file.
140
-
141
- <reasoning>
142
- The assistant did not use the todo list because this is a single command execution with immediate results. There are no multiple steps to track or organize, making the todo list unnecessary for this straightforward task.
143
- </reasoning>
144
- </example>
145
-
146
- ## Task States and Management
147
-
148
- 1. **Task States**: Use these states to track progress:
149
- - pending: Task not yet started
150
- - in_progress: Currently working on (limit to ONE task at a time)
151
- - completed: Task finished successfully
152
- - cancelled: Task no longer needed
153
-
154
- 2. **Task Management**:
155
- - Update task status in real-time as you work
156
- - Mark tasks complete IMMEDIATELY after finishing (don't batch completions)
157
- - Only have ONE task in_progress at any time
158
- - Complete current tasks before starting new ones
159
- - Cancel tasks that become irrelevant
160
-
161
- 3. **Task Breakdown**:
162
- - Create specific, actionable items
163
- - Break complex tasks into smaller, manageable steps
164
- - Use clear, descriptive task names
165
-
166
- When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully.
167
-
@@ -1,14 +0,0 @@
1
- - Fetches content from a specified URL
2
- - Takes a URL and a prompt as input
3
- - Fetches the URL content, converts HTML to markdown
4
- - Returns the model's response about the content
5
- - Use this tool when you need to retrieve and analyze web content
6
-
7
- Usage notes:
8
- - IMPORTANT: if another tool is present that offers better web fetching capabilities, is more targeted to the task, or has fewer restrictions, prefer using that tool instead of this one.
9
- - The URL must be a fully-formed valid URL
10
- - HTTP URLs will be automatically upgraded to HTTPS
11
- - The prompt should describe what information you want to extract from the page
12
- - This tool is read-only and does not modify any files
13
- - Results may be summarized if the content is very large
14
- - Includes a self-cleaning 15-minute cache for faster responses when repeatedly accessing the same URL
@@ -1,11 +0,0 @@
1
-
2
- - Allows snow-code to search the web and use the results to inform responses
3
- - Provides up-to-date information for current events and recent data
4
- - Returns search result information formatted as search result blocks
5
- - Use this tool for accessing information beyond Claude's knowledge cutoff
6
- - Searches are performed automatically within a single API call
7
-
8
- Usage notes:
9
- - Domain filtering is supported to include or block specific websites
10
- - Web search is only available in the US
11
-
@@ -1,8 +0,0 @@
1
- Writes a file to the local filesystem.
2
-
3
- Usage:
4
- - This tool will overwrite the existing file if there is one at the provided path.
5
- - If this is an existing file, you MUST use the Read tool first to read the file's contents. This tool will fail if you did not read the file first.
6
- - ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.
7
- - NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User.
8
- - Only use emojis if the user explicitly requests it. Avoid writing emojis to files unless asked.
@@ -1,51 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Test script for Codespace detection
4
- * Run this in both local and Codespaces environments
5
- */
6
-
7
- console.log('šŸ” Codespace Detection Test\n');
8
-
9
- const relevantEnvVars = [
10
- 'CODESPACES',
11
- 'CODESPACE_NAME',
12
- 'GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN',
13
- 'GITHUB_CODESPACE_TOKEN',
14
- 'CODESPACE_VSCODE_FOLDER',
15
- 'GITHUB_USER',
16
- 'REMOTE_CONTAINERS',
17
- 'VSCODE_REMOTE_CONTAINERS_SESSION'
18
- ];
19
-
20
- console.log('Environment Variables:');
21
- console.log('='.repeat(60));
22
- relevantEnvVars.forEach(varName => {
23
- const value = process.env[varName];
24
- console.log(`${varName.padEnd(40)} = ${value || '(not set)'}`);
25
- });
26
-
27
- console.log('\n' + '='.repeat(60));
28
-
29
- // Current detection logic
30
- const hasCodespacesEnv = process.env.CODESPACES === 'true';
31
- const hasCodespaceName = !!process.env.CODESPACE_NAME;
32
- const hasForwardingDomain = !!process.env.GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN;
33
-
34
- console.log('\nDetection Results:');
35
- console.log(` CODESPACES === 'true' : ${hasCodespacesEnv}`);
36
- console.log(` CODESPACE_NAME present : ${hasCodespaceName}`);
37
- console.log(` PORT_FORWARDING_DOMAIN present : ${hasForwardingDomain}`);
38
-
39
- const isCodespace = hasCodespacesEnv || (hasCodespaceName && hasForwardingDomain);
40
-
41
- console.log('\nšŸŽÆ Final Detection Result:');
42
- console.log(` Is Codespace? ${isCodespace ? 'āœ… YES' : 'āŒ NO'}`);
43
-
44
- if (isCodespace && hasForwardingDomain) {
45
- const domain = process.env.GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN;
46
- const name = process.env.CODESPACE_NAME;
47
- console.log(`\nšŸ“” Forwarded URL would be:`);
48
- console.log(` https://${name}-3005.${domain}/callback`);
49
- }
50
-
51
- console.log('\n');