Description
Extend the agent loop to detect fenced bash code blocks in LLM output, execute them, and feed results back to the LLM for a final response.
Parent: #3
Branch
feat/m2/shell-execution
Files
crates/zeph-core/src/context.rs — context builder (system + skills + history + message)
crates/zeph-core/src/agent.rs — shell detection, execution, re-query loop
crates/zeph-core/Cargo.toml — add zeph-skills dependency
Detection Logic
- LLM returns response text
- Scan for
```bash\n...\n``` blocks
- If found: execute via
tokio::process::Command
- Capture stdout + stderr
- Send back to LLM: "Command output:\n{stdout}\n\nFormat a response for the user."
- Return final response to user
Acceptance Criteria
Depends On
#13 (Skill registry), #14 (Prompt formatter), #15 (Bundled skills), #11 (CLI agent loop)
Description
Extend the agent loop to detect fenced bash code blocks in LLM output, execute them, and feed results back to the LLM for a final response.
Parent: #3
Branch
feat/m2/shell-executionFiles
crates/zeph-core/src/context.rs— context builder (system + skills + history + message)crates/zeph-core/src/agent.rs— shell detection, execution, re-query loopcrates/zeph-core/Cargo.toml— add zeph-skills dependencyDetection Logic
```bash\n...\n```blockstokio::process::CommandAcceptance Criteria
Depends On
#13 (Skill registry), #14 (Prompt formatter), #15 (Bundled skills), #11 (CLI agent loop)