gencode-ai 0.1.1 → 0.1.2
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/.gencode/settings.local.json +7 -0
- package/README.md +11 -11
- package/dist/agent/agent.d.ts +42 -1
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/agent.js +82 -15
- package/dist/agent/agent.js.map +1 -1
- package/dist/cli/components/App.d.ts +8 -1
- package/dist/cli/components/App.d.ts.map +1 -1
- package/dist/cli/components/App.js +231 -29
- package/dist/cli/components/App.js.map +1 -1
- package/dist/cli/components/CommandSuggestions.d.ts.map +1 -1
- package/dist/cli/components/CommandSuggestions.js +2 -0
- package/dist/cli/components/CommandSuggestions.js.map +1 -1
- package/dist/cli/components/Header.d.ts +1 -1
- package/dist/cli/components/Header.d.ts.map +1 -1
- package/dist/cli/components/Header.js +4 -6
- package/dist/cli/components/Header.js.map +1 -1
- package/dist/cli/components/Logo.d.ts +1 -0
- package/dist/cli/components/Logo.d.ts.map +1 -1
- package/dist/cli/components/Logo.js +16 -3
- package/dist/cli/components/Logo.js.map +1 -1
- package/dist/cli/components/Messages.d.ts +4 -4
- package/dist/cli/components/Messages.d.ts.map +1 -1
- package/dist/cli/components/Messages.js +51 -25
- package/dist/cli/components/Messages.js.map +1 -1
- package/dist/cli/components/PermissionPrompt.d.ts +60 -0
- package/dist/cli/components/PermissionPrompt.d.ts.map +1 -0
- package/dist/cli/components/PermissionPrompt.js +192 -0
- package/dist/cli/components/PermissionPrompt.js.map +1 -0
- package/dist/cli/components/ProviderManager.js +3 -3
- package/dist/cli/components/ProviderManager.js.map +1 -1
- package/dist/cli/components/Spinner.d.ts +7 -2
- package/dist/cli/components/Spinner.d.ts.map +1 -1
- package/dist/cli/components/Spinner.js +116 -25
- package/dist/cli/components/Spinner.js.map +1 -1
- package/dist/cli/components/TodoList.d.ts +7 -0
- package/dist/cli/components/TodoList.d.ts.map +1 -0
- package/dist/cli/components/TodoList.js +34 -0
- package/dist/cli/components/TodoList.js.map +1 -0
- package/dist/cli/components/index.d.ts +1 -0
- package/dist/cli/components/index.d.ts.map +1 -1
- package/dist/cli/components/index.js +1 -0
- package/dist/cli/components/index.js.map +1 -1
- package/dist/cli/index.js +47 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/config/index.d.ts +13 -4
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +18 -3
- package/dist/config/index.js.map +1 -1
- package/dist/config/levels.d.ts +49 -0
- package/dist/config/levels.d.ts.map +1 -0
- package/dist/config/levels.js +222 -0
- package/dist/config/levels.js.map +1 -0
- package/dist/config/loader.d.ts +46 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +153 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/manager.d.ts +115 -15
- package/dist/config/manager.d.ts.map +1 -1
- package/dist/config/manager.js +260 -34
- package/dist/config/manager.js.map +1 -1
- package/dist/config/manager.test.d.ts +5 -0
- package/dist/config/manager.test.d.ts.map +1 -0
- package/dist/config/manager.test.js +192 -0
- package/dist/config/manager.test.js.map +1 -0
- package/dist/config/merger.d.ts +56 -0
- package/dist/config/merger.d.ts.map +1 -0
- package/dist/config/merger.js +177 -0
- package/dist/config/merger.js.map +1 -0
- package/dist/config/test-utils.d.ts +24 -0
- package/dist/config/test-utils.d.ts.map +1 -0
- package/dist/config/test-utils.js +55 -0
- package/dist/config/test-utils.js.map +1 -0
- package/dist/config/types.d.ts +78 -9
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js +52 -2
- package/dist/config/types.js.map +1 -1
- package/dist/memory/import-resolver.d.ts +46 -0
- package/dist/memory/import-resolver.d.ts.map +1 -0
- package/dist/memory/import-resolver.js +117 -0
- package/dist/memory/import-resolver.js.map +1 -0
- package/dist/memory/index.d.ts +7 -6
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +7 -5
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/init-prompt.d.ts +22 -0
- package/dist/memory/init-prompt.d.ts.map +1 -0
- package/dist/memory/init-prompt.js +103 -0
- package/dist/memory/init-prompt.js.map +1 -0
- package/dist/memory/memory-manager.d.ts +119 -0
- package/dist/memory/memory-manager.d.ts.map +1 -0
- package/dist/memory/memory-manager.js +587 -0
- package/dist/memory/memory-manager.js.map +1 -0
- package/dist/memory/rules-parser.d.ts +38 -0
- package/dist/memory/rules-parser.d.ts.map +1 -0
- package/dist/memory/rules-parser.js +69 -0
- package/dist/memory/rules-parser.js.map +1 -0
- package/dist/memory/test-utils.d.ts +20 -0
- package/dist/memory/test-utils.d.ts.map +1 -0
- package/dist/memory/test-utils.js +44 -0
- package/dist/memory/test-utils.js.map +1 -0
- package/dist/memory/types.d.ts +70 -63
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/memory/types.js +42 -2
- package/dist/memory/types.js.map +1 -1
- package/dist/permissions/audit.d.ts +82 -0
- package/dist/permissions/audit.d.ts.map +1 -0
- package/dist/permissions/audit.js +229 -0
- package/dist/permissions/audit.js.map +1 -0
- package/dist/permissions/index.d.ts +11 -1
- package/dist/permissions/index.d.ts.map +1 -1
- package/dist/permissions/index.js +15 -0
- package/dist/permissions/index.js.map +1 -1
- package/dist/permissions/manager.d.ts +149 -13
- package/dist/permissions/manager.d.ts.map +1 -1
- package/dist/permissions/manager.js +480 -35
- package/dist/permissions/manager.js.map +1 -1
- package/dist/permissions/manager.test.d.ts +5 -0
- package/dist/permissions/manager.test.d.ts.map +1 -0
- package/dist/permissions/manager.test.js +213 -0
- package/dist/permissions/manager.test.js.map +1 -0
- package/dist/permissions/persistence.d.ts +74 -0
- package/dist/permissions/persistence.d.ts.map +1 -0
- package/dist/permissions/persistence.js +248 -0
- package/dist/permissions/persistence.js.map +1 -0
- package/dist/permissions/persistence.test.d.ts +5 -0
- package/dist/permissions/persistence.test.d.ts.map +1 -0
- package/dist/permissions/persistence.test.js +171 -0
- package/dist/permissions/persistence.test.js.map +1 -0
- package/dist/permissions/prompt-matcher.d.ts +64 -0
- package/dist/permissions/prompt-matcher.d.ts.map +1 -0
- package/dist/permissions/prompt-matcher.js +415 -0
- package/dist/permissions/prompt-matcher.js.map +1 -0
- package/dist/permissions/prompt-matcher.test.d.ts +5 -0
- package/dist/permissions/prompt-matcher.test.d.ts.map +1 -0
- package/dist/permissions/prompt-matcher.test.js +107 -0
- package/dist/permissions/prompt-matcher.test.js.map +1 -0
- package/dist/permissions/types.d.ts +157 -0
- package/dist/permissions/types.d.ts.map +1 -1
- package/dist/permissions/types.js +43 -8
- package/dist/permissions/types.js.map +1 -1
- package/dist/prompts/index.d.ts +92 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +241 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/tools/builtin/bash.d.ts.map +1 -1
- package/dist/tools/builtin/bash.js +2 -1
- package/dist/tools/builtin/bash.js.map +1 -1
- package/dist/tools/builtin/edit.d.ts.map +1 -1
- package/dist/tools/builtin/edit.js +2 -1
- package/dist/tools/builtin/edit.js.map +1 -1
- package/dist/tools/builtin/glob.d.ts.map +1 -1
- package/dist/tools/builtin/glob.js +2 -1
- package/dist/tools/builtin/glob.js.map +1 -1
- package/dist/tools/builtin/grep.d.ts.map +1 -1
- package/dist/tools/builtin/grep.js +2 -1
- package/dist/tools/builtin/grep.js.map +1 -1
- package/dist/tools/builtin/read.d.ts.map +1 -1
- package/dist/tools/builtin/read.js +2 -1
- package/dist/tools/builtin/read.js.map +1 -1
- package/dist/tools/builtin/todowrite.d.ts +15 -0
- package/dist/tools/builtin/todowrite.d.ts.map +1 -0
- package/dist/tools/builtin/todowrite.js +88 -0
- package/dist/tools/builtin/todowrite.js.map +1 -0
- package/dist/tools/builtin/webfetch.d.ts.map +1 -1
- package/dist/tools/builtin/webfetch.js +2 -5
- package/dist/tools/builtin/webfetch.js.map +1 -1
- package/dist/tools/builtin/websearch.d.ts.map +1 -1
- package/dist/tools/builtin/websearch.js +2 -16
- package/dist/tools/builtin/websearch.js.map +1 -1
- package/dist/tools/builtin/write.d.ts.map +1 -1
- package/dist/tools/builtin/write.js +2 -1
- package/dist/tools/builtin/write.js.map +1 -1
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/types.d.ts +22 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js +8 -0
- package/dist/tools/types.js.map +1 -1
- package/docs/config-system-comparison.md +707 -0
- package/docs/memory-system.md +238 -0
- package/docs/permissions.md +368 -0
- package/docs/proposals/0005-todo-system.md +350 -85
- package/docs/proposals/0006-memory-system.md +11 -10
- package/docs/proposals/0012-ask-user-question.md +941 -206
- package/docs/proposals/0023-permission-enhancements.md +61 -2
- package/docs/proposals/0041-configuration-system.md +33 -2
- package/docs/proposals/0042-prompt-optimization.md +866 -0
- package/docs/proposals/README.md +6 -5
- package/jest.config.js +26 -0
- package/package.json +8 -2
- package/src/agent/agent.ts +111 -16
- package/src/cli/components/App.tsx +309 -36
- package/src/cli/components/CommandSuggestions.tsx +2 -0
- package/src/cli/components/Header.tsx +11 -17
- package/src/cli/components/Logo.tsx +76 -9
- package/src/cli/components/Messages.tsx +73 -53
- package/src/cli/components/PermissionPrompt.tsx +388 -0
- package/src/cli/components/ProviderManager.tsx +5 -5
- package/src/cli/components/Spinner.tsx +138 -25
- package/src/cli/components/TodoList.tsx +54 -0
- package/src/cli/components/index.ts +6 -0
- package/src/cli/index.tsx +54 -6
- package/src/config/index.ts +78 -4
- package/src/config/levels.test.ts +163 -0
- package/src/config/levels.ts +285 -0
- package/src/config/loader.test.ts +120 -0
- package/src/config/loader.ts +178 -0
- package/src/config/manager.test.ts +215 -0
- package/src/config/manager.ts +328 -40
- package/src/config/merger.test.ts +360 -0
- package/src/config/merger.ts +221 -0
- package/src/config/test-utils.ts +79 -0
- package/src/config/types.ts +152 -9
- package/src/memory/import-resolver.test.ts +117 -0
- package/src/memory/import-resolver.ts +149 -0
- package/src/memory/index.ts +11 -0
- package/src/memory/init-prompt.ts +113 -0
- package/src/memory/memory-manager.test.ts +198 -0
- package/src/memory/memory-manager.ts +716 -0
- package/src/memory/rules-parser.test.ts +182 -0
- package/src/memory/rules-parser.ts +82 -0
- package/src/memory/test-utils.ts +60 -0
- package/src/memory/types.ts +119 -0
- package/src/permissions/audit.ts +284 -0
- package/src/permissions/index.ts +20 -1
- package/src/permissions/manager.test.ts +260 -0
- package/src/permissions/manager.ts +592 -40
- package/src/permissions/persistence.test.ts +220 -0
- package/src/permissions/persistence.ts +301 -0
- package/src/permissions/prompt-matcher.test.ts +213 -0
- package/src/permissions/prompt-matcher.ts +472 -0
- package/src/permissions/types.ts +236 -8
- package/src/prompts/index.test.ts +279 -0
- package/src/prompts/index.ts +306 -0
- package/src/prompts/system/anthropic.txt +29 -0
- package/src/prompts/system/base.txt +124 -0
- package/src/prompts/system/gemini.txt +35 -0
- package/src/prompts/system/generic.txt +128 -0
- package/src/prompts/system/openai.txt +29 -0
- package/src/prompts/tools/bash.txt +60 -0
- package/src/prompts/tools/edit.txt +29 -0
- package/src/prompts/tools/glob.txt +35 -0
- package/src/prompts/tools/grep.txt +43 -0
- package/src/prompts/tools/read.txt +22 -0
- package/src/prompts/tools/todowrite.txt +71 -0
- package/src/prompts/tools/webfetch.txt +34 -0
- package/src/prompts/tools/websearch.txt +41 -0
- package/src/prompts/tools/write.txt +23 -0
- package/src/tools/builtin/bash.ts +2 -1
- package/src/tools/builtin/edit.ts +2 -1
- package/src/tools/builtin/glob.ts +2 -1
- package/src/tools/builtin/grep.ts +2 -1
- package/src/tools/builtin/read.ts +2 -1
- package/src/tools/builtin/todowrite.ts +102 -0
- package/src/tools/builtin/webfetch.ts +2 -5
- package/src/tools/builtin/websearch.ts +2 -16
- package/src/tools/builtin/write.ts +2 -1
- package/src/tools/index.ts +4 -0
- package/src/tools/types.ts +12 -0
- package/tsconfig.json +1 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
Executes a bash command in a persistent shell session with optional timeout.
|
|
2
|
+
|
|
3
|
+
IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO NOT use it for file operations (reading, writing, editing, searching, finding files) - use the specialized tools for those instead.
|
|
4
|
+
|
|
5
|
+
Before executing the command:
|
|
6
|
+
|
|
7
|
+
1. Directory Verification:
|
|
8
|
+
- If the command will create new directories or files, first use `ls` to verify the parent directory exists
|
|
9
|
+
- For example, before running "mkdir foo/bar", first use `ls foo` to check that "foo" exists
|
|
10
|
+
|
|
11
|
+
2. Command Execution:
|
|
12
|
+
- Always quote file paths that contain spaces with double quotes
|
|
13
|
+
- Examples of proper quoting:
|
|
14
|
+
- cd "/Users/name/My Documents" (correct)
|
|
15
|
+
- cd /Users/name/My Documents (incorrect - will fail)
|
|
16
|
+
|
|
17
|
+
Usage notes:
|
|
18
|
+
- The command argument is required
|
|
19
|
+
- You can specify an optional timeout in milliseconds (default: 30000, max: 600000)
|
|
20
|
+
- If output exceeds 30000 characters, it will be truncated
|
|
21
|
+
|
|
22
|
+
Avoid using these commands via Bash (use specialized tools instead):
|
|
23
|
+
- File search: Use Glob (NOT find or ls)
|
|
24
|
+
- Content search: Use Grep (NOT grep or rg)
|
|
25
|
+
- Read files: Use Read (NOT cat/head/tail)
|
|
26
|
+
- Edit files: Use Edit (NOT sed/awk)
|
|
27
|
+
- Write files: Use Write (NOT echo)
|
|
28
|
+
|
|
29
|
+
When issuing multiple commands:
|
|
30
|
+
- If independent, make multiple Bash calls in parallel
|
|
31
|
+
- If dependent, chain with && (e.g., `git add . && git commit -m "message"`)
|
|
32
|
+
- Use ; only when you don't care if earlier commands fail
|
|
33
|
+
|
|
34
|
+
# Git Operations
|
|
35
|
+
|
|
36
|
+
Only create commits when requested by the user. When committing:
|
|
37
|
+
|
|
38
|
+
Git Safety Protocol:
|
|
39
|
+
- NEVER update git config
|
|
40
|
+
- NEVER run destructive commands (push --force, hard reset) unless explicitly requested
|
|
41
|
+
- NEVER skip hooks (--no-verify) unless explicitly requested
|
|
42
|
+
- NEVER commit unless explicitly asked
|
|
43
|
+
|
|
44
|
+
Commit workflow:
|
|
45
|
+
1. Run git status and git diff in parallel to understand changes
|
|
46
|
+
2. Run git log to see recent commit message style
|
|
47
|
+
3. Add relevant files and create commit
|
|
48
|
+
4. Run git status to verify success
|
|
49
|
+
|
|
50
|
+
# Creating Pull Requests
|
|
51
|
+
|
|
52
|
+
Use the gh command for GitHub-related tasks. When creating PRs:
|
|
53
|
+
1. Check git status and branch state
|
|
54
|
+
2. Run git log and git diff to understand all changes
|
|
55
|
+
3. Push to remote if needed
|
|
56
|
+
4. Create PR with gh pr create
|
|
57
|
+
|
|
58
|
+
Important:
|
|
59
|
+
- NEVER use git commands with -i flag (interactive mode not supported)
|
|
60
|
+
- DO NOT push unless explicitly asked
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
Performs exact string replacements in files.
|
|
2
|
+
|
|
3
|
+
Usage:
|
|
4
|
+
- You must use the Read tool at least once before editing. This tool will error if you attempt an edit without reading the file first.
|
|
5
|
+
- 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.
|
|
6
|
+
- ALWAYS prefer editing existing files. NEVER write new files unless explicitly required.
|
|
7
|
+
|
|
8
|
+
Critical Rules:
|
|
9
|
+
- The edit will FAIL if old_string is not unique in the file
|
|
10
|
+
- Either provide a larger string with more surrounding context to make it unique, or use replace_all to change every instance
|
|
11
|
+
- Use replace_all for renaming variables or strings across the file
|
|
12
|
+
|
|
13
|
+
<example>
|
|
14
|
+
Changing a function name:
|
|
15
|
+
old_string: "function oldName("
|
|
16
|
+
new_string: "function newName("
|
|
17
|
+
</example>
|
|
18
|
+
|
|
19
|
+
<example>
|
|
20
|
+
Updating a variable value:
|
|
21
|
+
old_string: "const MAX_RETRIES = 3;"
|
|
22
|
+
new_string: "const MAX_RETRIES = 5;"
|
|
23
|
+
</example>
|
|
24
|
+
|
|
25
|
+
Best Practices:
|
|
26
|
+
- Include enough context to make old_string unique
|
|
27
|
+
- Preserve exact whitespace and indentation
|
|
28
|
+
- Test changes compile/work after editing
|
|
29
|
+
- Make minimal, focused changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Fast file pattern matching tool that works with any codebase size.
|
|
2
|
+
|
|
3
|
+
Supports glob patterns like "**/*.js" or "src/**/*.ts".
|
|
4
|
+
|
|
5
|
+
Returns matching file paths sorted by modification time.
|
|
6
|
+
|
|
7
|
+
Usage:
|
|
8
|
+
- Use this tool when you need to find files by name patterns
|
|
9
|
+
- Supports standard glob syntax:
|
|
10
|
+
- * matches any characters except /
|
|
11
|
+
- ** matches any characters including /
|
|
12
|
+
- ? matches a single character
|
|
13
|
+
- [abc] matches any of a, b, or c
|
|
14
|
+
- {a,b} matches either a or b
|
|
15
|
+
|
|
16
|
+
<example>
|
|
17
|
+
Find all TypeScript files:
|
|
18
|
+
pattern: "**/*.ts"
|
|
19
|
+
</example>
|
|
20
|
+
|
|
21
|
+
<example>
|
|
22
|
+
Find test files:
|
|
23
|
+
pattern: "**/*.test.{ts,js}"
|
|
24
|
+
</example>
|
|
25
|
+
|
|
26
|
+
<example>
|
|
27
|
+
Find files in a specific directory:
|
|
28
|
+
pattern: "src/components/**/*.tsx"
|
|
29
|
+
</example>
|
|
30
|
+
|
|
31
|
+
Best Practices:
|
|
32
|
+
- Use specific patterns to narrow results
|
|
33
|
+
- Combine with Read to examine matching files
|
|
34
|
+
- Call multiple globs in parallel if searching for different patterns
|
|
35
|
+
- Use Grep instead if you need to search file contents
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
A powerful search tool for finding patterns in file contents.
|
|
2
|
+
|
|
3
|
+
Supports full regex syntax (e.g., "log.*Error", "function\\s+\\w+").
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
- Use this tool for content search tasks
|
|
7
|
+
- NEVER invoke grep or rg as a Bash command - use this tool instead
|
|
8
|
+
- Filter files with glob parameter (e.g., "*.js", "**/*.tsx")
|
|
9
|
+
- Output modes:
|
|
10
|
+
- "content" shows matching lines
|
|
11
|
+
- "files_with_matches" shows only file paths (default)
|
|
12
|
+
- "count" shows match counts
|
|
13
|
+
|
|
14
|
+
<example>
|
|
15
|
+
Find all console.log statements:
|
|
16
|
+
pattern: "console\\.log"
|
|
17
|
+
glob: "**/*.ts"
|
|
18
|
+
output_mode: "content"
|
|
19
|
+
</example>
|
|
20
|
+
|
|
21
|
+
<example>
|
|
22
|
+
Find files containing a function:
|
|
23
|
+
pattern: "function handleSubmit"
|
|
24
|
+
output_mode: "files_with_matches"
|
|
25
|
+
</example>
|
|
26
|
+
|
|
27
|
+
<example>
|
|
28
|
+
Find TODO comments with context:
|
|
29
|
+
pattern: "TODO:"
|
|
30
|
+
output_mode: "content"
|
|
31
|
+
-C: 2 (show 2 lines before and after)
|
|
32
|
+
</example>
|
|
33
|
+
|
|
34
|
+
Pattern Syntax:
|
|
35
|
+
- Uses ripgrep syntax (not grep)
|
|
36
|
+
- Literal braces need escaping (use `interface\\{\\}` for `interface{}`)
|
|
37
|
+
- Use -i for case insensitive search
|
|
38
|
+
- Use multiline: true for patterns spanning multiple lines
|
|
39
|
+
|
|
40
|
+
Best Practices:
|
|
41
|
+
- Start with files_with_matches to find relevant files
|
|
42
|
+
- Then use content mode with context flags for details
|
|
43
|
+
- Combine with Read to see full file context
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Reads a file from the local filesystem. You can access any file directly by using this tool.
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
- The file_path parameter must be an absolute path, not a relative path
|
|
7
|
+
- By default, it reads up to 2000 lines starting from the beginning of the file
|
|
8
|
+
- 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
|
|
9
|
+
- Any lines longer than 2000 characters will be truncated
|
|
10
|
+
- Results are returned using cat -n format, with line numbers starting at 1
|
|
11
|
+
- 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.
|
|
12
|
+
- If you read a file that exists but has empty contents you will receive a system reminder warning in place of file contents.
|
|
13
|
+
|
|
14
|
+
<example>
|
|
15
|
+
user: What's in config.json?
|
|
16
|
+
assistant: [Uses Read tool with file_path="/path/to/config.json"]
|
|
17
|
+
</example>
|
|
18
|
+
|
|
19
|
+
When exploring a codebase:
|
|
20
|
+
- Read related files together in parallel
|
|
21
|
+
- Start with entry points and work outward
|
|
22
|
+
- Use Glob/Grep first if you're unsure which files to read
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
Use this tool to create and manage a structured task list for your current session.
|
|
2
|
+
|
|
3
|
+
This tool serves TWO purposes:
|
|
4
|
+
1. User visibility: Shows task progress in CLI so users understand what you're doing
|
|
5
|
+
2. Your external memory: The rendered result helps YOU remember your plan across turns
|
|
6
|
+
|
|
7
|
+
This helps you:
|
|
8
|
+
- Track progress and demonstrate thoroughness to the user
|
|
9
|
+
- Organize complex tasks into manageable steps
|
|
10
|
+
- Avoid forgetting tasks in long conversations
|
|
11
|
+
|
|
12
|
+
## When to Use This Tool
|
|
13
|
+
|
|
14
|
+
Use proactively in these scenarios:
|
|
15
|
+
|
|
16
|
+
1. Complex multi-step tasks - When a task requires 3 or more distinct steps
|
|
17
|
+
2. Non-trivial tasks - Tasks requiring careful planning or multiple operations
|
|
18
|
+
3. User provides multiple tasks - Numbered or comma-separated lists
|
|
19
|
+
4. After receiving instructions - Immediately capture requirements as todos
|
|
20
|
+
5. When starting a task - Mark it as in_progress BEFORE beginning work
|
|
21
|
+
6. After completing a task - Mark as completed and add any follow-up tasks discovered
|
|
22
|
+
|
|
23
|
+
## When NOT to Use This Tool
|
|
24
|
+
|
|
25
|
+
Skip for:
|
|
26
|
+
- Single, straightforward tasks
|
|
27
|
+
- Trivial tasks that can be completed in under 3 steps
|
|
28
|
+
- Purely conversational or informational requests
|
|
29
|
+
|
|
30
|
+
## Task States
|
|
31
|
+
|
|
32
|
+
- pending: Task not yet started
|
|
33
|
+
- in_progress: Currently working on (limit to ONE task at a time)
|
|
34
|
+
- completed: Task finished successfully
|
|
35
|
+
|
|
36
|
+
## Task Management Rules
|
|
37
|
+
|
|
38
|
+
- Update task status in real-time as you work
|
|
39
|
+
- Mark tasks complete IMMEDIATELY after finishing (don't batch completions)
|
|
40
|
+
- Exactly ONE task should be in_progress at any time
|
|
41
|
+
- Complete current tasks before starting new ones
|
|
42
|
+
- Remove tasks that are no longer relevant
|
|
43
|
+
|
|
44
|
+
## Completion Requirements
|
|
45
|
+
|
|
46
|
+
ONLY mark a task as completed when you have FULLY accomplished it.
|
|
47
|
+
|
|
48
|
+
Never mark completed if:
|
|
49
|
+
- Tests are failing
|
|
50
|
+
- Implementation is partial
|
|
51
|
+
- You encountered unresolved errors
|
|
52
|
+
- You couldn't find necessary files
|
|
53
|
+
|
|
54
|
+
If blocked, create a new task describing what needs to be resolved.
|
|
55
|
+
|
|
56
|
+
<example>
|
|
57
|
+
user: Run the build and fix any errors
|
|
58
|
+
assistant: Creating todo list:
|
|
59
|
+
1. Run the build [in_progress]
|
|
60
|
+
2. Fix any errors [pending]
|
|
61
|
+
|
|
62
|
+
Running build...
|
|
63
|
+
|
|
64
|
+
Found 3 errors. Updating todos:
|
|
65
|
+
1. Run the build [completed]
|
|
66
|
+
2. Fix error in auth.ts [in_progress]
|
|
67
|
+
3. Fix error in api.ts [pending]
|
|
68
|
+
4. Fix error in utils.ts [pending]
|
|
69
|
+
|
|
70
|
+
Starting with first error...
|
|
71
|
+
</example>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
Fetches content from a URL and processes it.
|
|
2
|
+
|
|
3
|
+
Takes a URL and a prompt as input:
|
|
4
|
+
1. Fetches the URL content
|
|
5
|
+
2. Converts HTML to markdown
|
|
6
|
+
3. Processes the content with the prompt using a fast model
|
|
7
|
+
4. Returns the model's response about the content
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
- The URL must be a fully-formed valid URL
|
|
11
|
+
- HTTP URLs will be automatically upgraded to HTTPS
|
|
12
|
+
- The prompt should describe what information you want to extract
|
|
13
|
+
|
|
14
|
+
<example>
|
|
15
|
+
Fetching documentation:
|
|
16
|
+
url: "https://docs.example.com/api"
|
|
17
|
+
prompt: "Extract the authentication methods and their parameters"
|
|
18
|
+
</example>
|
|
19
|
+
|
|
20
|
+
<example>
|
|
21
|
+
Reading a GitHub README:
|
|
22
|
+
url: "https://github.com/owner/repo"
|
|
23
|
+
prompt: "Summarize the project's main features and installation steps"
|
|
24
|
+
</example>
|
|
25
|
+
|
|
26
|
+
Behavior notes:
|
|
27
|
+
- Results may be summarized if content is very large
|
|
28
|
+
- Includes a 15-minute cache for faster repeated access
|
|
29
|
+
- When a URL redirects to a different host, the tool will inform you and provide the redirect URL - make a new WebFetch request with that URL
|
|
30
|
+
|
|
31
|
+
Best Practices:
|
|
32
|
+
- Be specific in your prompt about what information you need
|
|
33
|
+
- Use for documentation, tutorials, and reference material
|
|
34
|
+
- Combine with WebSearch to find relevant URLs first
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Search the web for current information.
|
|
2
|
+
|
|
3
|
+
Use this tool when you need:
|
|
4
|
+
- Up-to-date information beyond your knowledge cutoff
|
|
5
|
+
- Current documentation or release notes
|
|
6
|
+
- Recent solutions to technical problems
|
|
7
|
+
- Current best practices
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
- query: The search query (minimum 2 characters)
|
|
11
|
+
- num_results: Number of results to return (optional)
|
|
12
|
+
- allowed_domains: Only include results from these domains (optional)
|
|
13
|
+
- blocked_domains: Exclude results from these domains (optional)
|
|
14
|
+
|
|
15
|
+
<example>
|
|
16
|
+
Search for documentation:
|
|
17
|
+
query: "React useEffect cleanup function"
|
|
18
|
+
</example>
|
|
19
|
+
|
|
20
|
+
<example>
|
|
21
|
+
Search within specific domains:
|
|
22
|
+
query: "TypeScript strict mode configuration"
|
|
23
|
+
allowed_domains: ["typescriptlang.org", "github.com"]
|
|
24
|
+
</example>
|
|
25
|
+
|
|
26
|
+
IMPORTANT: After answering using search results, include a "Sources:" section with relevant URLs as markdown hyperlinks.
|
|
27
|
+
|
|
28
|
+
Example response format:
|
|
29
|
+
```
|
|
30
|
+
[Your answer based on search results]
|
|
31
|
+
|
|
32
|
+
Sources:
|
|
33
|
+
- [React Documentation](https://react.dev/...)
|
|
34
|
+
- [Stack Overflow Answer](https://stackoverflow.com/...)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Best Practices:
|
|
38
|
+
- Use specific, targeted queries
|
|
39
|
+
- Include technology versions when relevant (e.g., "React 18 hooks")
|
|
40
|
+
- Use allowed_domains to filter to authoritative sources
|
|
41
|
+
- Follow up with WebFetch for detailed page content
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
|
|
9
|
+
When to use Write vs Edit:
|
|
10
|
+
- Use Write for creating new files
|
|
11
|
+
- Use Write when you need to completely replace file contents
|
|
12
|
+
- Use Edit for making targeted changes to existing files
|
|
13
|
+
- Prefer Edit over Write for existing files as it's more precise
|
|
14
|
+
|
|
15
|
+
<example>
|
|
16
|
+
user: Create a new utility file
|
|
17
|
+
assistant: [Uses Write tool with file_path and content]
|
|
18
|
+
</example>
|
|
19
|
+
|
|
20
|
+
Important:
|
|
21
|
+
- Ensure the parent directory exists before writing
|
|
22
|
+
- Use appropriate file extensions
|
|
23
|
+
- Follow existing code style in the project
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
import { spawn } from 'child_process';
|
|
6
6
|
import type { Tool, ToolContext, ToolResult } from '../types.js';
|
|
7
7
|
import { BashInputSchema, type BashInput } from '../types.js';
|
|
8
|
+
import { loadToolDescription } from '../../prompts/index.js';
|
|
8
9
|
|
|
9
10
|
export const bashTool: Tool<BashInput> = {
|
|
10
11
|
name: 'Bash',
|
|
11
|
-
description: '
|
|
12
|
+
description: loadToolDescription('bash'),
|
|
12
13
|
parameters: BashInputSchema,
|
|
13
14
|
|
|
14
15
|
async execute(input: BashInput, context: ToolContext): Promise<ToolResult> {
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
import * as fs from 'fs/promises';
|
|
6
6
|
import type { Tool, ToolResult } from '../types.js';
|
|
7
7
|
import { EditInputSchema, type EditInput, resolvePath, getErrorMessage } from '../types.js';
|
|
8
|
+
import { loadToolDescription } from '../../prompts/index.js';
|
|
8
9
|
|
|
9
10
|
export const editTool: Tool<EditInput> = {
|
|
10
11
|
name: 'Edit',
|
|
11
|
-
description: '
|
|
12
|
+
description: loadToolDescription('edit'),
|
|
12
13
|
parameters: EditInputSchema,
|
|
13
14
|
|
|
14
15
|
async execute(input, context): Promise<ToolResult> {
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
import fastGlob from 'fast-glob';
|
|
6
6
|
import type { Tool, ToolResult } from '../types.js';
|
|
7
7
|
import { GlobInputSchema, type GlobInput, resolvePath, getErrorMessage } from '../types.js';
|
|
8
|
+
import { loadToolDescription } from '../../prompts/index.js';
|
|
8
9
|
|
|
9
10
|
const MAX_RESULTS = 100;
|
|
10
11
|
|
|
11
12
|
export const globTool: Tool<GlobInput> = {
|
|
12
13
|
name: 'Glob',
|
|
13
|
-
description: '
|
|
14
|
+
description: loadToolDescription('glob'),
|
|
14
15
|
parameters: GlobInputSchema,
|
|
15
16
|
|
|
16
17
|
async execute(input, context): Promise<ToolResult> {
|
|
@@ -7,12 +7,13 @@ import * as path from 'path';
|
|
|
7
7
|
import fastGlob from 'fast-glob';
|
|
8
8
|
import type { Tool, ToolResult } from '../types.js';
|
|
9
9
|
import { GrepInputSchema, type GrepInput, resolvePath, getErrorMessage } from '../types.js';
|
|
10
|
+
import { loadToolDescription } from '../../prompts/index.js';
|
|
10
11
|
|
|
11
12
|
const MAX_MATCHES = 50;
|
|
12
13
|
|
|
13
14
|
export const grepTool: Tool<GrepInput> = {
|
|
14
15
|
name: 'Grep',
|
|
15
|
-
description: '
|
|
16
|
+
description: loadToolDescription('grep'),
|
|
16
17
|
parameters: GrepInputSchema,
|
|
17
18
|
|
|
18
19
|
async execute(input, context): Promise<ToolResult> {
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
import * as fs from 'fs/promises';
|
|
6
6
|
import type { Tool, ToolResult } from '../types.js';
|
|
7
7
|
import { ReadInputSchema, type ReadInput, resolvePath, getErrorMessage } from '../types.js';
|
|
8
|
+
import { loadToolDescription } from '../../prompts/index.js';
|
|
8
9
|
|
|
9
10
|
export const readTool: Tool<ReadInput> = {
|
|
10
11
|
name: 'Read',
|
|
11
|
-
description: '
|
|
12
|
+
description: loadToolDescription('read'),
|
|
12
13
|
parameters: ReadInputSchema,
|
|
13
14
|
|
|
14
15
|
async execute(input, context): Promise<ToolResult> {
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TodoWrite Tool - Manage task list for tracking progress
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type { Tool, ToolResult, TodoItem } from '../types.js';
|
|
6
|
+
import { TodoWriteInputSchema, type TodoWriteInput } from '../types.js';
|
|
7
|
+
import { loadToolDescription } from '../../prompts/index.js';
|
|
8
|
+
|
|
9
|
+
// Global todo state - shared across tool invocations
|
|
10
|
+
let currentTodos: TodoItem[] = [];
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Get the current todo list
|
|
14
|
+
*/
|
|
15
|
+
export function getTodos(): TodoItem[] {
|
|
16
|
+
return [...currentTodos];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Clear all todos
|
|
21
|
+
*/
|
|
22
|
+
export function clearTodos(): void {
|
|
23
|
+
currentTodos = [];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Format todos for display
|
|
28
|
+
*/
|
|
29
|
+
function formatTodos(todos: TodoItem[]): string {
|
|
30
|
+
if (todos.length === 0) {
|
|
31
|
+
return 'Todo list is empty.';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const statusIcons: Record<string, string> = {
|
|
35
|
+
pending: '[ ]',
|
|
36
|
+
in_progress: '[>]',
|
|
37
|
+
completed: '[x]',
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const lines = todos.map((todo, index) => {
|
|
41
|
+
const icon = statusIcons[todo.status] || '[ ]';
|
|
42
|
+
return `${index + 1}. ${icon} ${todo.content}`;
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
return lines.join('\n');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Validate todo list rules
|
|
50
|
+
*/
|
|
51
|
+
function validateTodos(todos: TodoItem[]): string | null {
|
|
52
|
+
const inProgress = todos.filter((t) => t.status === 'in_progress');
|
|
53
|
+
if (inProgress.length > 1) {
|
|
54
|
+
return `Only one task should be in_progress at a time. Found ${inProgress.length} tasks in progress.`;
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const todowriteTool: Tool<TodoWriteInput> = {
|
|
60
|
+
name: 'TodoWrite',
|
|
61
|
+
description: loadToolDescription('todowrite'),
|
|
62
|
+
parameters: TodoWriteInputSchema,
|
|
63
|
+
|
|
64
|
+
async execute(input): Promise<ToolResult> {
|
|
65
|
+
try {
|
|
66
|
+
// Validate the todo list
|
|
67
|
+
const validationError = validateTodos(input.todos);
|
|
68
|
+
if (validationError) {
|
|
69
|
+
return {
|
|
70
|
+
success: false,
|
|
71
|
+
output: '',
|
|
72
|
+
error: validationError,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Update the global todo state (auto-generate id if missing)
|
|
77
|
+
currentTodos = input.todos.map((todo, index) => ({
|
|
78
|
+
...todo,
|
|
79
|
+
id: todo.id || `todo-${index + 1}`,
|
|
80
|
+
}));
|
|
81
|
+
|
|
82
|
+
// Count statistics
|
|
83
|
+
const pending = currentTodos.filter((t) => t.status === 'pending').length;
|
|
84
|
+
const inProgress = currentTodos.filter((t) => t.status === 'in_progress').length;
|
|
85
|
+
const completed = currentTodos.filter((t) => t.status === 'completed').length;
|
|
86
|
+
|
|
87
|
+
const summary = `Todos updated: ${completed} completed, ${inProgress} in progress, ${pending} pending`;
|
|
88
|
+
const formatted = formatTodos(currentTodos);
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
success: true,
|
|
92
|
+
output: `${summary}\n\n${formatted}`,
|
|
93
|
+
};
|
|
94
|
+
} catch (error) {
|
|
95
|
+
return {
|
|
96
|
+
success: false,
|
|
97
|
+
output: '',
|
|
98
|
+
error: `Failed to update todos: ${error instanceof Error ? error.message : String(error)}`,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
};
|
|
@@ -7,6 +7,7 @@ import { z } from 'zod';
|
|
|
7
7
|
import type { Tool, ToolContext, ToolResult } from '../types.js';
|
|
8
8
|
import { getErrorMessage } from '../types.js';
|
|
9
9
|
import { validateUrl } from '../utils/ssrf.js';
|
|
10
|
+
import { loadToolDescription } from '../../prompts/index.js';
|
|
10
11
|
|
|
11
12
|
// Constants
|
|
12
13
|
const MAX_RESPONSE_SIZE = 5 * 1024 * 1024; // 5MB
|
|
@@ -148,11 +149,7 @@ function truncateOutput(output: string): string {
|
|
|
148
149
|
*/
|
|
149
150
|
export const webfetchTool: Tool<WebFetchInput> = {
|
|
150
151
|
name: 'WebFetch',
|
|
151
|
-
description:
|
|
152
|
-
- Converts HTML to Markdown by default for easier reading
|
|
153
|
-
- Supports text, markdown, and html output formats
|
|
154
|
-
- Maximum response size: 5MB
|
|
155
|
-
- Timeout: 30 seconds (configurable up to 120 seconds)`,
|
|
152
|
+
description: loadToolDescription('webfetch'),
|
|
156
153
|
parameters: WebFetchInputSchema,
|
|
157
154
|
|
|
158
155
|
async execute(input: WebFetchInput, context: ToolContext): Promise<ToolResult> {
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
getCurrentSearchProviderName,
|
|
11
11
|
type SearchResult,
|
|
12
12
|
} from '../../providers/search/index.js';
|
|
13
|
+
import { loadToolDescription } from '../../prompts/index.js';
|
|
13
14
|
|
|
14
15
|
// Constants
|
|
15
16
|
const DEFAULT_NUM_RESULTS = 10;
|
|
@@ -62,22 +63,7 @@ function formatResults(results: SearchResult[], query: string): string {
|
|
|
62
63
|
*/
|
|
63
64
|
export const websearchTool: Tool<WebSearchInput> = {
|
|
64
65
|
name: 'WebSearch',
|
|
65
|
-
description:
|
|
66
|
-
|
|
67
|
-
Use this tool when you need:
|
|
68
|
-
- Up-to-date information beyond your knowledge cutoff
|
|
69
|
-
- Current documentation or release notes
|
|
70
|
-
- Recent solutions to technical problems
|
|
71
|
-
- Current best practices
|
|
72
|
-
|
|
73
|
-
IMPORTANT: After answering, include a "Sources:" section with all relevant URLs as markdown hyperlinks.
|
|
74
|
-
|
|
75
|
-
Example:
|
|
76
|
-
[Your answer]
|
|
77
|
-
|
|
78
|
-
Sources:
|
|
79
|
-
- [Title 1](https://url1)
|
|
80
|
-
- [Title 2](https://url2)`,
|
|
66
|
+
description: loadToolDescription('websearch'),
|
|
81
67
|
parameters: WebSearchInputSchema,
|
|
82
68
|
|
|
83
69
|
async execute(input: WebSearchInput, context: ToolContext): Promise<ToolResult> {
|
|
@@ -6,10 +6,11 @@ import * as fs from 'fs/promises';
|
|
|
6
6
|
import * as path from 'path';
|
|
7
7
|
import type { Tool, ToolResult } from '../types.js';
|
|
8
8
|
import { WriteInputSchema, type WriteInput, resolvePath, getErrorMessage } from '../types.js';
|
|
9
|
+
import { loadToolDescription } from '../../prompts/index.js';
|
|
9
10
|
|
|
10
11
|
export const writeTool: Tool<WriteInput> = {
|
|
11
12
|
name: 'Write',
|
|
12
|
-
description: '
|
|
13
|
+
description: loadToolDescription('write'),
|
|
13
14
|
parameters: WriteInputSchema,
|
|
14
15
|
|
|
15
16
|
async execute(input, context): Promise<ToolResult> {
|
package/src/tools/index.ts
CHANGED
|
@@ -14,6 +14,7 @@ export { globTool } from './builtin/glob.js';
|
|
|
14
14
|
export { grepTool } from './builtin/grep.js';
|
|
15
15
|
export { webfetchTool } from './builtin/webfetch.js';
|
|
16
16
|
export { websearchTool } from './builtin/websearch.js';
|
|
17
|
+
export { todowriteTool, getTodos, clearTodos } from './builtin/todowrite.js';
|
|
17
18
|
|
|
18
19
|
import { ToolRegistry } from './registry.js';
|
|
19
20
|
import { readTool } from './builtin/read.js';
|
|
@@ -24,6 +25,7 @@ import { globTool } from './builtin/glob.js';
|
|
|
24
25
|
import { grepTool } from './builtin/grep.js';
|
|
25
26
|
import { webfetchTool } from './builtin/webfetch.js';
|
|
26
27
|
import { websearchTool } from './builtin/websearch.js';
|
|
28
|
+
import { todowriteTool } from './builtin/todowrite.js';
|
|
27
29
|
|
|
28
30
|
/**
|
|
29
31
|
* Create a registry with all built-in tools
|
|
@@ -39,6 +41,7 @@ export function createDefaultRegistry(): ToolRegistry {
|
|
|
39
41
|
grepTool,
|
|
40
42
|
webfetchTool,
|
|
41
43
|
websearchTool,
|
|
44
|
+
todowriteTool,
|
|
42
45
|
]);
|
|
43
46
|
return registry;
|
|
44
47
|
}
|
|
@@ -55,4 +58,5 @@ export const builtinTools = [
|
|
|
55
58
|
grepTool,
|
|
56
59
|
webfetchTool,
|
|
57
60
|
websearchTool,
|
|
61
|
+
todowriteTool,
|
|
58
62
|
];
|
package/src/tools/types.ts
CHANGED
|
@@ -108,6 +108,18 @@ export const WebFetchInputSchema = z.object({
|
|
|
108
108
|
});
|
|
109
109
|
export type WebFetchInput = z.infer<typeof WebFetchInputSchema>;
|
|
110
110
|
|
|
111
|
+
export const TodoItemSchema = z.object({
|
|
112
|
+
content: z.string().min(1).describe('The task description'),
|
|
113
|
+
status: z.enum(['pending', 'in_progress', 'completed']).describe('Current status of the task'),
|
|
114
|
+
id: z.string().optional().describe('Unique task identifier'),
|
|
115
|
+
});
|
|
116
|
+
export type TodoItem = z.infer<typeof TodoItemSchema>;
|
|
117
|
+
|
|
118
|
+
export const TodoWriteInputSchema = z.object({
|
|
119
|
+
todos: z.array(TodoItemSchema).describe('The complete todo list to write'),
|
|
120
|
+
});
|
|
121
|
+
export type TodoWriteInput = z.infer<typeof TodoWriteInputSchema>;
|
|
122
|
+
|
|
111
123
|
// ============================================================================
|
|
112
124
|
// JSON Schema Conversion
|
|
113
125
|
// ============================================================================
|
package/tsconfig.json
CHANGED