Expand description
Embeddable code execution and code search tools for custom agent tool runners.
codemode is intentionally small:
CodeModeis the engineRequest/Responseare the typed boundary- package, environment, and native function providers customize behavior
The intended embedding path is:
use std::sync::Arc;
use codemode::{CodeMode, CodeModeConfig, SearchCode};
let codemode = Arc::new(
CodeMode::builder()
.with_config(CodeModeConfig::default().multithreaded(true))
.build()?
);
let response = codemode
.search_code(SearchCode {
query: "fetch".to_string(),
limit: Some(5),
})
.await?;
println!("{} matches", response.matches.len());Structs§
- Code
Mode - Embeddable codemode engine.
- Code
Mode Builder - Builder for
CodeMode. - Code
Mode Config - Configuration applied to a
CodeModeinstance. - Environment
Variable - Environment variable made available to the engine.
- Native
Function Registry - Named host functions exposed to JavaScript.
- Package
- JavaScript package made available to the engine.
- Package
Match - A package hit returned from
SearchCode. - RunCode
- Executes JavaScript code inside the codemode engine.
- RunCode
Result - Structured result of a
RunCoderequest. - Search
Code - Searches available packages/code exposed by package providers.
- Search
Code Result - Structured result of a
SearchCoderequest.
Enums§
- Code
Mode Error - Errors produced by the codemode engine and its extension points.
- Request
- Request handled by
CodeMode. - Response
- Response returned by
CodeMode.
Traits§
- Environment
Provider - Source of environment variables exposed to the engine.
- Native
Function - Async host function exposed to JavaScript by
CodeMode. - Package
Provider - Source of JavaScript packages available to the engine.
Type Aliases§
- Code
Mode Result - Result type used throughout
codemode.