1.7 KiB
1.7 KiB
Test Plan: Functions and Tools
Behaviors to test
Function declarations
- Functions::init loads from visible_tools config
- Tool declarations parsed from bash scripts (argc annotations)
- Tool declarations parsed from python scripts (docstrings)
- Tool declarations parsed from typescript (JSDoc + type inference)
- Each declaration has name, description, parameters
- Agent tools loaded via Functions::init_agent
- Global tools loaded via build_global_tool_declarations
Tool compilation
- Bash tools compiled to bin directory
- Python tools compiled to bin directory
- TypeScript tools compiled to bin directory
- clear_agent_bin_dir removes old binaries
- Tool file priority: .sh > .py > .ts > .js
User interaction functions
- append_user_interaction_functions adds user__ask/confirm/input/checkbox
- Only appended in REPL mode
- User interaction tools work at depth 0 (direct prompt)
- User interaction tools escalate at depth > 0
MCP meta functions
- append_mcp_meta_functions adds invoke/search/describe per server
- Meta functions removed when ToolScope rebuilt without those servers
- Function names follow mcp_invoke_ pattern
Function selection
- select_functions filters by role's enabled_tools
- "all" enables everything
- Specific tool names enabled selectively
- mapping_tools aliases resolved
- Agent functions included when agent active
- MCP meta functions included when servers active
Old code reference
src/function/mod.rs— Functions struct, init, init_agentsrc/config/paths.rs— agent_functions_file (priority)src/parsers/— bash, python, typescript parsers