MCPcopy Index your code
hub / github.com/AI45Lab/Code / program_repo_map

Function program_repo_map

core/src/program.rs:786–822  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

784}
785
786pub fn program_repo_map() -> ProgramTemplate {
787 let mut template = ProgramTemplate::new(
788 "program_repo_map",
789 "Map the repository shape with root listing and key project files.",
790 )
791 .with_parameter(ProgramParameter::optional(
792 "path",
793 "Workspace-relative path to map.",
794 serde_json::json!("."),
795 ))
796 .with_step(
797 ProgramStepTemplate::new("ls", serde_json::json!({ "path": "{{path}}" }))
798 .with_label("list_root"),
799 );
800
801 for pattern in [
802 "Cargo.toml",
803 "package.json",
804 "pyproject.toml",
805 "go.mod",
806 "README.md",
807 "AGENTS.md",
808 ] {
809 template = template.with_step(
810 ProgramStepTemplate::new(
811 "glob",
812 serde_json::json!({
813 "path": "{{path}}",
814 "pattern": pattern
815 }),
816 )
817 .with_label(format!("find_{pattern}")),
818 );
819 }
820
821 template
822}
823
824fn summarize_program_result(program: &Program, success: bool, completed_steps: usize) -> String {
825 let status = if success { "completed" } else { "stopped" };

Callers

nothing calls this directly

Calls 3

with_stepMethod · 0.80
with_parameterMethod · 0.80
with_labelMethod · 0.80

Tested by

no test coverage detected