feat: plan.json tools, ripgrep-style search, writable_paths permissions - #1
Open
itech001 wants to merge 1 commit into
Open
feat: plan.json tools, ripgrep-style search, writable_paths permissions#1itech001 wants to merge 1 commit into
itech001 wants to merge 1 commit into
Conversation
- Planning Phase: generate structured plan.json (Plan/PlanStep structs) with read_plan and update_plan built-in tools for agent to track step status (pending/in_progress/done/skipped) during execution - Filesystem Tools: rewrite glob and grep using the ignore crate (ripgrep's engine), respecting .gitignore and skipping hidden files; add result limits to prevent memory exhaustion - Permission System: default all paths read-only, only writable_paths whitelist allows writes (glob-based); legacy permissions array kept as fallback; add --writable-paths CLI flag - Agent dir loading already single-source (only --agent-dir, no home directory scanning) - no change needed
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four improvements to agent-runner's planning, filesystem tools, permission system, and agent loading.
Changes
1. Planning Phase → structured
plan.jsonsrc/agent/planner.rs: AddedPlanandPlanStepstructs (Serialize/Deserialize),parse_plan()to convert LLM plan text into structured steps, andsave_plan_json()to persistplan.json(replacesplan.md)src/tools/plan.rs(new): Two built-in tools for the agent to interact with the plan during execution:read_plan— readsplan.jsonso the agent can review all steps and their current statusupdate_plan— updates a step's status (pending/in_progress/done/skipped) and optional descriptionsrc/main.rs: Registers both tools,--plan-onlynow printsplan.jsoncontent, reportplanfield points toplan.json2. Filesystem Tools → ripgrep engine (
ignorecrate)src/tools/filesystem.rs: Rewroteglobandgrepusing theignorecrate (ripgrep's underlying library):.gitignore,.git/info/exclude, and global gitignoreglobusesglobsetfor pattern matching (**,*,?)grepretains optionalglobfile filter viaglobset::GlobMatcherglobcrate dependency withglobset+ignore3. Permission System → default read-only +
writable_pathssrc/permissions.rs: Rewritten permission logic:ls,read_file,glob,grep): allowed everywhere by defaultwrite_file,edit_file,execute): only allowed on paths matchingwritable_pathsglob patterns; denied otherwisepermissionsarray kept as fallback for advanced allow/deny rulesworking_dir, strips.components) for consistent matchingsrc/config.rs: Addedwritable_paths: Vec<String>toConfigsrc/main.rs: Added--writable-pathsCLI flag (comma-separated), merged with config values4. Agent dir loading — already single-source (no change needed)
agent_dir.rsonly reads from--agent-dir(AGENTS.md, agent-runner.json, skills/). No home directory scanning, nodirscrate dependency.Verification
cargo build --release— compiles successfully (exit code 0)cargo test— 5/5 permission tests passloop_configvar, unusedPathimport inrun_log.rs)Files Changed
agent-runner/Cargo.toml— replacedglobwithignore+globsetagent-runner/Cargo.lock— updated lockfileagent-runner/src/agent/planner.rs— Plan/PlanStep structs, parse_plan, save_plan_jsonagent-runner/src/tools/plan.rs— new ReadPlanTool + UpdatePlanToolagent-runner/src/tools/mod.rs— register plan moduleagent-runner/src/tools/filesystem.rs— rewritten glob/grep with ignore crateagent-runner/src/permissions.rs— default read-only + writable_paths + testsagent-runner/src/config.rs— writable_paths fieldagent-runner/src/main.rs— register tools, CLI flag, plan flowREADME.md— updated docsweb-site/index.html— updated feature cards, tools, config example