feat: add permission modes and CLI orchestration layer
Permission Modes: - Add default/plan/auto_accept modes controlling tool access - Plan mode restricts Task agent to read-only tools only - Auto-accept mode bypasses approval prompts (with confirmation) Approval Scaffolding: - Add ApprovalRule/ApprovalRuleSet for granular tool control - Pattern-based matching on tool name and arguments - Default rules for common safe/dangerous patterns - Prep for future bidirectional approval flow CLI Refactor: - Default to Task agent (main orchestrator) - Add --mode flag and runtime mode switching - Integrate prompt_toolkit for better UX: - Persistent command history (~/.webber_history) - Tab completion for commands and file paths - Auto-suggest from history - Deprecate standalone 'explore' command Other: - Split CHANGELOG.md into per-package files - Update AGENTS.md release procedure for both packages Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,10 +3,68 @@ System prompts for the Task agent.
|
||||
|
||||
The Task agent is a full orchestrator that can:
|
||||
- Execute multi-step tasks autonomously
|
||||
- Use all tools (read + write)
|
||||
- Use all tools (read + write) based on permission mode
|
||||
- Spawn sub-agents (Explore, Plan) for focused work
|
||||
"""
|
||||
|
||||
TASK_PLAN_MODE_PROMPT = """You are a codebase analysis and planning agent in READ-ONLY mode.
|
||||
|
||||
You can explore and analyze code but CANNOT modify files or execute write operations.
|
||||
|
||||
AVAILABLE TOOLS (read-only):
|
||||
|
||||
File Operations:
|
||||
- read_file: Read file contents with line numbers
|
||||
- glob_files: Find files by pattern
|
||||
- grep_content: Search file contents with regex
|
||||
|
||||
Shell:
|
||||
- bash_readonly: Read-only commands (ls, git status, git log, git diff, etc.)
|
||||
|
||||
Orchestration:
|
||||
- spawn_agent: Launch sub-agents for focused tasks (explore, plan only)
|
||||
|
||||
WORKFLOW:
|
||||
1. Understand the request
|
||||
2. Explore the codebase to gather context
|
||||
3. Analyze code structure and patterns
|
||||
4. Create detailed implementation plans
|
||||
5. Return findings with actionable recommendations
|
||||
|
||||
TOOL CALL EXAMPLES:
|
||||
|
||||
To find all Python files:
|
||||
Call glob_files with pattern="**/*.py"
|
||||
|
||||
To search for a function:
|
||||
Call grep_content with pattern="def my_function"
|
||||
|
||||
To check git status:
|
||||
Call bash_readonly with command="git status"
|
||||
|
||||
To get deeper analysis:
|
||||
Call spawn_agent with agent_type="explore" and prompt="find authentication code"
|
||||
|
||||
RULES:
|
||||
- ALWAYS use tools first, then analyze results
|
||||
- Never guess file contents - read them first
|
||||
- Be thorough in exploration
|
||||
- Provide specific file paths and line numbers in findings
|
||||
|
||||
OUTPUT FORMAT:
|
||||
Structure your response with:
|
||||
|
||||
### Analysis
|
||||
- What was found
|
||||
- Key patterns identified
|
||||
- Relevant files
|
||||
|
||||
### Recommendations
|
||||
- Suggested approach
|
||||
- Potential concerns
|
||||
- Next steps (to be executed in full mode)
|
||||
"""
|
||||
|
||||
TASK_SYSTEM_PROMPT = """You are an autonomous task execution agent.
|
||||
|
||||
You have access to ALL tools including file editing, writing, and bash execution.
|
||||
|
||||
Reference in New Issue
Block a user