deepagents-cli 0.0.2__py3-none-any.whl → 0.0.3__py3-none-any.whl

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.

Potentially problematic release.


This version of deepagents-cli might be problematic. Click here for more details.

deepagents/prompts.py DELETED
@@ -1,327 +0,0 @@
1
- WRITE_TODOS_DESCRIPTION = """Use this tool to create and manage a structured task list for your current work 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
12
- 6. When you start working on a task - Mark it as in_progress BEFORE beginning work. Ideally you should only have one todo as in_progress at a time
13
- 7. After completing a task - Mark it as completed and add any new follow-up tasks discovered during implementation
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 plan a comprehensive marketing campaign for our new product launch, including social media, email marketing, and press releases.
48
- Assistant: I'll help you plan a comprehensive marketing campaign for your product launch. Let me create a todo list to organize all the components.
49
- *Creates todo list with the following items:*
50
- 1. Define target audience and key messaging
51
- 2. Create social media content calendar and posting schedule
52
- 3. Design email marketing sequence and automation flows
53
- 4. Draft press release and identify media contacts
54
- 5. Set up tracking and analytics for campaign performance
55
- 6. Create visual assets and brand materials
56
- 7. Coordinate launch timeline and deliverables
57
- *Begins working on the first task*
58
-
59
- <reasoning>
60
- The assistant used the todo list because:
61
- 1. Marketing campaign planning involves multiple distinct channels and activities
62
- 2. Each component requires careful coordination and planning
63
- 3. The systematic approach ensures all aspects of the launch are covered
64
- 4. Progress tracking helps maintain timeline and deliverables
65
- </reasoning>
66
- </example>
67
-
68
- <example>
69
- User: Help me rename the function getCwd to getCurrentWorkingDirectory across my project
70
- Assistant: Let me first search through your codebase to find all occurrences of 'getCwd'.
71
- *Uses search tools to locate all instances of getCwd in the codebase*
72
- Assistant: I've found 15 instances of 'getCwd' across 8 different files. Let me create a todo list to track these changes.
73
- *Creates todo list with specific items for each file that needs updating*
74
-
75
- <reasoning>
76
- The assistant used the todo list because:
77
- 1. First, the assistant searched to understand the scope of the task
78
- 2. Upon finding multiple occurrences across different files, it determined this was a complex task with multiple steps
79
- 3. The todo list helps ensure every instance is tracked and updated systematically
80
- 4. This approach prevents missing any occurrences and maintains consistency
81
- </reasoning>
82
- </example>
83
-
84
- <example>
85
- User: I need help organizing my home office: decluttering the desk, setting up a filing system, organizing digital files, and creating a daily workflow.
86
- Assistant: I'll help you organize your home office systematically. Let me create a todo list to track each area of organization.
87
- *Creates todo list with items like: 1) Sort and declutter desk items, 2) Set up physical filing system for documents, 3) Organize digital files and folders, 4) Create daily workflow and productivity systems, 5) Establish maintenance routines*
88
- Let's start with decluttering your desk space to create a clean foundation for the other organizational systems.
89
-
90
- <reasoning>
91
- The assistant used the todo list because:
92
- 1. The user provided multiple distinct organizational tasks
93
- 2. Each area requires different approaches and careful planning
94
- 3. Home organization benefits from systematic, step-by-step completion
95
- 4. Progress tracking ensures all areas are addressed thoroughly
96
- </reasoning>
97
- </example>
98
-
99
- ## Examples of When NOT to Use the Todo List
100
-
101
- <example>
102
- User: How do I print 'Hello World' in Python?
103
- Assistant: In Python, you can print "Hello World" with this simple code:
104
-
105
- python
106
- print("Hello World")
107
-
108
- This will output the text "Hello World" to the console when executed.</assistant>
109
-
110
- <reasoning>
111
- 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.
112
- </reasoning>
113
- </example>
114
-
115
- <example>
116
- User: What's the best way to water houseplants?
117
- Assistant: The best way to water houseplants depends on the specific plant type, but here are some general guidelines:
118
-
119
- - Check soil moisture by inserting your finger about 1-2 inches into the soil
120
- - Water thoroughly when the top inch feels dry, allowing water to drain from the bottom
121
- - Use room temperature water and water in the morning when possible
122
- - Avoid overwatering, which is more harmful than underwatering for most plants
123
-
124
- Different plants have different needs, so it's important to research your specific varieties for optimal care.
125
-
126
- <reasoning>
127
- The assistant did not use the todo list because this is an informational request with no actual tasks to complete. The user is simply asking for advice and explanation, not for the assistant to perform multiple steps or activities.
128
- </reasoning>
129
- </example>
130
-
131
- <example>
132
- User: Can you add a comment to the calculateTotal function to explain what it does?
133
- Assistant: Sure, let me add a comment to the calculateTotal function to explain what it does.
134
- * Uses the Edit tool to add a comment to the calculateTotal function *
135
-
136
- <reasoning>
137
- The assistant did not use the todo list because this is a single, straightforward task confined to one location. Adding a comment doesn't require tracking multiple steps or systematic organization.
138
- </reasoning>
139
- </example>
140
-
141
- <example>
142
- User: What time is it in Tokyo right now?
143
- Assistant: I'll check the current time in Tokyo for you.
144
-
145
- *Searches for current time in Tokyo*
146
-
147
- The current time in Tokyo, Japan is [current time]. Tokyo is in the Japan Standard Time (JST) zone, which is UTC+9.
148
-
149
- <reasoning>
150
- The assistant did not use the todo list because this is a single information lookup with immediate results. There are no multiple steps to track or organize, making the todo list unnecessary for this straightforward request.
151
- </reasoning>
152
- </example>
153
-
154
- ## Task States and Management
155
-
156
- 1. **Task States**: Use these states to track progress:
157
- - pending: Task not yet started
158
- - in_progress: Currently working on (limit to ONE task at a time)
159
- - completed: Task finished successfully
160
-
161
- 2. **Task Management**:
162
- - Update task status in real-time as you work
163
- - Mark tasks complete IMMEDIATELY after finishing (don't batch completions)
164
- - Only have ONE task in_progress at any time
165
- - Complete current tasks before starting new ones
166
- - Remove tasks that are no longer relevant from the list entirely
167
-
168
- 3. **Task Completion Requirements**:
169
- - ONLY mark a task as completed when you have FULLY accomplished it
170
- - If you encounter errors, blockers, or cannot finish, keep the task as in_progress
171
- - When blocked, create a new task describing what needs to be resolved
172
- - Never mark a task as completed if:
173
- - There are unresolved issues or errors
174
- - Work is partial or incomplete
175
- - You encountered blockers that prevent completion
176
- - You couldn't find necessary resources or dependencies
177
- - Quality standards haven't been met
178
-
179
- 4. **Task Breakdown**:
180
- - Create specific, actionable items
181
- - Break complex tasks into smaller, manageable steps
182
- - Use clear, descriptive task names
183
-
184
- When in doubt, use this tool. Being proactive with task management demonstrates attentiveness and ensures you complete all requirements successfully."""
185
-
186
- TASK_DESCRIPTION_PREFIX = """Launch a new agent to handle complex, multi-step tasks autonomously.
187
-
188
- Available agent types and the tools they have access to:
189
- - general-purpose: General-purpose agent for researching complex questions, searching for files and content, and executing multi-step tasks. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries use this agent to perform the search for you. (Tools: *)
190
- {other_agents}
191
- """
192
-
193
- TASK_DESCRIPTION_SUFFIX = """When using the Task tool, you must specify a subagent_type parameter to select which agent type to use.
194
-
195
- When to use the Agent tool:
196
- - When you are instructed to execute custom slash commands. Use the Agent 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")
197
-
198
- When NOT to use the Agent tool:
199
- - If you want to read a specific file path, use the Read or Glob tool instead of the Agent tool, to find the match more quickly
200
- - If you are searching for a specific term or definition within a known location, use the Glob tool instead, to find the match more quickly
201
- - If you are searching for content within a specific file or set of 2-3 files, use the Read tool instead of the Agent tool, to find the match more quickly
202
- - Other tasks that are not related to the agent descriptions above
203
-
204
-
205
- Usage notes:
206
- 1. Launch multiple agents concurrently whenever possible, to maximize performance; to do that, use a single message with multiple tool uses
207
- 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.
208
- 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.
209
- 4. The agent's outputs should generally be trusted
210
- 5. Clearly tell the agent whether you expect it to create content, perform analysis, or just do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent
211
- 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.
212
-
213
- Example usage:
214
-
215
- <example_agent_descriptions>
216
- "content-reviewer": use this agent after you are done creating significant content or documents
217
- "greeting-responder": use this agent when to respond to user greetings with a friendly joke
218
- "research-analyst": use this agent to conduct thorough research on complex topics
219
- </example_agent_description>
220
-
221
- <example>
222
- user: "Please write a function that checks if a number is prime"
223
- assistant: Sure let me write a function that checks if a number is prime
224
- assistant: First let me use the Write tool to write a function that checks if a number is prime
225
- assistant: I'm going to use the Write tool to write the following code:
226
- <code>
227
- function isPrime(n) {
228
- if (n <= 1) return false
229
- for (let i = 2; i * i <= n; i++) {
230
- if (n % i === 0) return false
231
- }
232
- return true
233
- }
234
- </code>
235
- <commentary>
236
- Since significant content was created and the task was completed, now use the content-reviewer agent to review the work
237
- </commentary>
238
- assistant: Now let me use the content-reviewer agent to review the code
239
- assistant: Uses the Task tool to launch with the content-reviewer agent
240
- </example>
241
-
242
- <example>
243
- user: "Can you help me research the environmental impact of different renewable energy sources and create a comprehensive report?"
244
- <commentary>
245
- This is a complex research task that would benefit from using the research-analyst agent to conduct thorough analysis
246
- </commentary>
247
- assistant: I'll help you research the environmental impact of renewable energy sources. Let me use the research-analyst agent to conduct comprehensive research on this topic.
248
- assistant: Uses the Task tool to launch with the research-analyst agent, providing detailed instructions about what research to conduct and what format the report should take
249
- </example>
250
-
251
- <example>
252
- user: "Hello"
253
- <commentary>
254
- Since the user is greeting, use the greeting-responder agent to respond with a friendly joke
255
- </commentary>
256
- assistant: "I'm going to use the Task tool to launch with the greeting-responder agent"
257
- </example>"""
258
- EDIT_DESCRIPTION = """Performs exact string replacements in files.
259
-
260
- Usage:
261
- - You must use your `Read` tool at least once in the conversation before editing. This tool will error if you attempt an edit without reading the file.
262
- - When editing text from Read tool output, ensure you preserve the exact indentation (tabs/spaces) as it appears AFTER the line number prefix. The line number prefix format is: spaces + line number + tab. Everything after that tab is the actual file content to match. Never include any part of the line number prefix in the old_string or new_string.
263
- - ALWAYS prefer editing existing files. NEVER write new files unless explicitly required.
264
- - Only use emojis if the user explicitly requests it. Avoid adding emojis to files unless asked.
265
- - The edit will FAIL if `old_string` is not unique in the file. Either provide a larger string with more surrounding context to make it unique or use `replace_all` to change every instance of `old_string`.
266
- - Use `replace_all` for replacing and renaming strings across the file. This parameter is useful if you want to rename a variable for instance."""
267
- TOOL_DESCRIPTION = """Reads a file from the local filesystem. You can access any file directly by using this tool.
268
- 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.
269
-
270
- Usage:
271
- - The file_path parameter must be an absolute path, not a relative path
272
- - By default, it reads up to 2000 lines starting from the beginning of the file
273
- - 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
274
- - Any lines longer than 2000 characters will be truncated
275
- - Results are returned using cat -n format, with line numbers starting at 1
276
- - 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.
277
- - If you read a file that exists but has empty contents you will receive a system reminder warning in place of file contents."""
278
-
279
- GLOB_DESCRIPTION = """Find files and directories using glob patterns (similar to Unix glob/find commands).
280
- This tool searches for files and directories that match specified patterns. It's ideal for finding files by name, extension, or path patterns.
281
- Usage:
282
- - pattern: Glob pattern to match (e.g., "*.py", "**/*.js", "src/**/test_*.py")
283
- - path: Directory to start search from (defaults to current directory ".")
284
- - max_results: Maximum number of results to return (defaults to 100)
285
- - include_dirs: Include directories in results (defaults to False, files only)
286
- - recursive: Enable recursive search (defaults to True)
287
- Glob Pattern Examples:
288
- - "*.py" - All Python files in current directory
289
- - "**/*.py" - All Python files recursively
290
- - "src/**/*.js" - All JS files under src/ directory recursively
291
- - "test_*.py" - Files starting with "test_" and ending with ".py"
292
- - "**/node_modules" - All node_modules directories
293
- - "*.{py,js,ts}" - Files with .py, .js, or .ts extensions
294
- Returns: List of matching file/directory paths, one per line
295
- CRITICAL: Always use absolute paths for the path parameter"""
296
-
297
- GREP_DESCRIPTION = """A powerful search tool that uses ripgrep (rg) for fast text pattern matching.
298
- This tool searches file contents for specified patterns and returns matching lines with context. It's ideal for finding specific content, functions, variables, or text across your codebase.
299
- Usage:
300
- - pattern: Text pattern to search for (supports regular expressions if regex=True)
301
- - files: List of file paths to search in, or single file path string
302
- - path: Directory to search in (alternative to files parameter)
303
- - file_pattern: Glob pattern for files to search (e.g., "*.py") when using path
304
- - max_results: Maximum number of matching lines to return (defaults to 50)
305
- - case_sensitive: Whether search should be case-sensitive (defaults to False)
306
- - context_lines: Number of lines to show before/after each match (defaults to 0)
307
- - regex: Treat pattern as regular expression (defaults to False)
308
- Examples:
309
- - Search for "TODO" in specific files: pattern="TODO", files=["main.py", "utils.py"]
310
- - Search in all Python files: pattern="def main", path=".", file_pattern="*.py"
311
- - Regex search: pattern=r"function\\s+\\w+", regex=True, file_pattern="*.js"
312
- - Case-sensitive search: pattern="ClassName", case_sensitive=True
313
- - With context: pattern="import", context_lines=2
314
- Returns: File paths with line numbers and matching lines, plus context if requested
315
- CRITICAL: Always use absolute paths for files and path parameters"""
316
-
317
- WRITE_DESCRIPTION = """Write a file to the local filesystem. Overwrites the existing file if there is one.
318
- Before using this tool:
319
- - Use the Read tool to understand the file's contents and context.
320
- - ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly instructed to do so.
321
- Directory Verification (only applicable when creating new files):
322
- Use the LS tool to verify the parent directory exists and is the correct location
323
- Usage:
324
- - file_path: Path to the file to write (absolute or relative path)
325
- - content: The content to write to the file
326
- The tool will automatically create parent directories if they don't exist.
327
- CRITICAL: Always use absolute paths (starting with /)"""
deepagents/skills.py DELETED
@@ -1,85 +0,0 @@
1
- """Helper utilities for working with skills."""
2
-
3
- import re
4
- from typing import TypedDict
5
-
6
-
7
- class SkillFiles(TypedDict):
8
- """Dictionary mapping relative paths to content."""
9
- pass # Key: path (str), Value: content (str | bytes)
10
-
11
-
12
- class SkillDefinition(TypedDict):
13
- """Single skill for virtual filesystem."""
14
- name: str
15
- files: SkillFiles
16
-
17
-
18
- class SkillMetadata(TypedDict):
19
- """Metadata extracted from a skill's YAML frontmatter."""
20
- name: str
21
- description: str
22
- version: str | None
23
- path: str
24
- source: str
25
-
26
-
27
- def parse_skill_frontmatter(content: str) -> dict[str, str]:
28
- """Parse YAML frontmatter from SKILL.md content.
29
-
30
- Args:
31
- content: The content of a SKILL.md file.
32
-
33
- Returns:
34
- Dictionary of parsed YAML frontmatter fields.
35
-
36
- Example:
37
- >>> content = '''---
38
- ... name: slack-gif-creator
39
- ... description: Create animated GIFs
40
- ... version: 1.0.0
41
- ... ---
42
- ... # Rest of content'''
43
- >>> parse_skill_frontmatter(content)
44
- {'name': 'slack-gif-creator', 'description': 'Create animated GIFs', 'version': '1.0.0'}
45
- """
46
- # Match YAML frontmatter between --- markers
47
- match = re.match(r'^---\s*\n(.*?)\n---\s*\n', content, re.DOTALL)
48
- if not match:
49
- return {}
50
-
51
- frontmatter_text = match.group(1)
52
- result = {}
53
-
54
- # Parse simple key: value pairs
55
- for line in frontmatter_text.split('\n'):
56
- line = line.strip()
57
- if ':' in line:
58
- key, value = line.split(':', 1)
59
- result[key.strip()] = value.strip()
60
-
61
- return result
62
-
63
-
64
- def load_skills(skills_dict: dict[str, dict[str, str | bytes]]) -> list[SkillDefinition]:
65
- """Convert a dictionary of skills to list[SkillDefinition] format.
66
-
67
- Args:
68
- skills_dict: Dictionary where keys are skill names and values are
69
- dictionaries mapping file paths to content.
70
-
71
- Returns:
72
- List of SkillDefinition objects.
73
-
74
- Example:
75
- >>> skills = load_skills({
76
- ... "api-wrapper": {
77
- ... "SKILL.md": "---\\nname: api-wrapper\\n---\\n...",
78
- ... "scripts/client.py": "import requests...",
79
- ... }
80
- ... })
81
- """
82
- return [
83
- {"name": name, "files": files}
84
- for name, files in skills_dict.items()
85
- ]
@@ -1,17 +0,0 @@
1
- deepagents/__init__.py,sha256=Id0SomviLAHNx3hXnLEk-fGwECqkIPpsPE4q1B_yj3U,576
2
- deepagents/cli.py,sha256=iRPhWbqlNqZKPplM-QnnO_8MI0vrEBmUcxplYJYoSlQ,20429
3
- deepagents/default_agent_prompt.md,sha256=oKbqWlvrYkPCLmrQNDw2QrlhNg8PkYL1jICkA7p-xuQ,5040
4
- deepagents/graph.py,sha256=U4jMriU3hAoPprt9aCoCBM8yBm7QGWp2T6atDdcJelg,7584
5
- deepagents/prompts.py,sha256=tGhbWGEqRlMfJfM7Q-DcUz1TOn6PgGm4RWVADe2DV6M,19507
6
- deepagents/skills.py,sha256=x0gX2CYG4R4TwvNFYaoXwiK7teccXav0Xuh6Uyh6pWg,2365
7
- deepagents/middleware/__init__.py,sha256=DDQHYER3fCYkt930C9StUmqZW8CwQnePWmVfUtvk2Ho,413
8
- deepagents/middleware/common.py,sha256=MLbBBBxDhhyrFcFc5lGmwAZcn_9Ax7SQZvL-TsHlT8E,953
9
- deepagents/middleware/filesystem.py,sha256=tZIDR77qi06qxCam_SUkL6YTdjjqgxNfxCeE_L9FoMM,43958
10
- deepagents/middleware/local_filesystem.py,sha256=df3VWCZwUjVarUt6lpxB57TE9w_Rf6usM2G1FCf4H7A,28504
11
- deepagents/middleware/subagents.py,sha256=hDb2eq8yOC0R93AWIsatSZ6ykz3-8THiudeIbjJq4FQ,23372
12
- deepagents_cli-0.0.2.dist-info/licenses/LICENSE,sha256=c__BaxUCK69leo2yEKynf8lWndu8iwYwge1CbyqAe-E,1071
13
- deepagents_cli-0.0.2.dist-info/METADATA,sha256=l83vs8loIxOgNAQAhEtziDOt1Qg7N3RatClLmE0iY3M,20480
14
- deepagents_cli-0.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
- deepagents_cli-0.0.2.dist-info/entry_points.txt,sha256=5qO2sNhal5xQqcexm2VtT981A29FBKt-75aE4gatH8Q,55
16
- deepagents_cli-0.0.2.dist-info/top_level.txt,sha256=drAzchOzPNePwpb3_pbPuvLuayXkN7SNqeIKMBWJoAo,11
17
- deepagents_cli-0.0.2.dist-info/RECORD,,