jeremychone / rust-devai

Command Agent runner to accelerate production coding. File based, fully customizable, NOT for building snake games.
Apache License 2.0
39 stars 7 forks source link

Add documentation for the `rhai`-based DSL #3

Open stephenlf opened 2 months ago

stephenlf commented 2 months ago

This crate registers 11 functions with the rhai runtime. These functions create a sort of "devai Agent" DSL. I propose these functions be documented, first in their "src/" definitions, then in a standalone usage guide.

$ grep 'FuncRegistration::new' ./src/ -r | sort | uniq
./src/script/rhai_modules/rhai_file.rs: FuncRegistration::new("list")
./src/script/rhai_modules/rhai_file.rs: FuncRegistration::new("load")
./src/script/rhai_modules/rhai_file.rs: FuncRegistration::new("save")
./src/script/rhai_modules/rhai_git.rs:  FuncRegistration::new("restore")
./src/script/rhai_modules/rhai_md.rs:   FuncRegistration::new("extract_blocks")
./src/script/rhai_modules/rhai_text.rs: FuncRegistration::new("escape_decode")
./src/script/rhai_modules/rhai_text.rs: FuncRegistration::new("escape_decode_if_needed")
./src/script/rhai_modules/rhai_text.rs: FuncRegistration::new("remove_first_line")
./src/script/rhai_modules/rhai_text.rs: FuncRegistration::new("remove_first_lines")
./src/script/rhai_modules/rhai_text.rs: FuncRegistration::new("remove_last_line")
./src/script/rhai_modules/rhai_text.rs: FuncRegistration::new("remove_last_lines")
jeremychone commented 2 months ago

Yes, my goal is to:

1) Add the documentation in the Rust file as normal Rust doc.

2) Write an internal command agent that will read those Rust files and recreate a .devai/doc/rhai-doc.md.

3) Later, after I implement the devai adhoc ... functionality, which simulates a chat with file output, I will create a command agent like .devai/defaults/devai-ask-doc.md that will load the rhai-doc and can answer DevAI questions.

But yes, you are right, this is missing, and I am using it as a forcing factor to complete steps 1 and 2. (Step 3 will be a bonus.)

jeremychone commented 2 months ago

@stephenlf wrong repo ...

jeremychone commented 2 months ago

Sorry, now, I am getting confused. It was the right repo. Sorry.