MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / load_all

Method load_all

crates/opencode-session/src/instruction.rs:272–294  ·  view source on GitHub ↗

Load all instructions: global files, project files, and config entries. `project_dir` - the project root directory (cwd) `config_instructions` - entries from `config.instructions` (file paths, glob patterns, or URLs)

(
        &mut self,
        project_dir: &Path,
        config_instructions: &[String],
    )

Source from the content-addressed store, hash-verified

270 /// * `config_instructions` - entries from `config.instructions` (file paths,
271 /// glob patterns, or URLs)
272 pub async fn load_all(
273 &mut self,
274 project_dir: &Path,
275 config_instructions: &[String],
276 ) -> Vec<InstructionFile> {
277 let mut result = Vec::new();
278
279 // 1. Project-level instruction files (findUp from cwd)
280 if !is_project_config_disabled() {
281 result.extend(self.load_project_instructions(project_dir));
282 }
283
284 // 2. Global instruction files
285 result.extend(self.load_global_instructions());
286
287 // 3. Config-specified instructions (files, globs, URLs)
288 result.extend(
289 self.load_config_instructions(project_dir, config_instructions)
290 .await,
291 );
292
293 result
294 }
295 /// Load project-level instruction files by walking up from `project_dir`
296 /// to the worktree root, looking for well-known files.
297 ///

Callers 2

load_plugin_auth_storeFunction · 0.45

Calls 5

newFunction · 0.85

Tested by 1