Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Anything else gets a qualified lowercase name, such as Rust's built-in test harn
- Behavior changes ship with tests in the same change. Preserve behavior tests during refactors.
- The Plugin crate depends on `runvil-plugin-sdk` and outside libraries alone, and writes no `unsafe`. The SDK owns the C boundary.
- A tool reaches files only through `Source` (`crates/plugin-std/src/source.rs`), which the call's `ToolCall` implements, so every file operation goes through the Host and the run's policy applies to it. A test runs a tool's own code over the SDK's `testing::Files` tree, or over `FakeSource` (`crates/plugin-std/src/fake.rs`) for what that tree cannot hold.
- A tool that changes files says so with `ToolInfo::changes_files`, so the Host runs each of its calls by itself among the calls of one model reply.
- A tool that changes files says so with `ToolInfo::with_changes_files`, so the Host runs each of its calls by itself among the calls of one model reply.
- A tool's description and parameter schema come from its JSON file under `crates/plugin-std/schemas`. `EDITS.md` beside them records every difference from Cursor's definition, and a change to a JSON file changes `EDITS.md` with it.
- A tool that does a long job awaits `next_step()` after each bounded slice of work, as Grep does every 32 files or directories, so that no step of its call works for long and the Host can abandon the call between two steps.
- A Plugin shares its process with the Host, so nothing here installs process-global state, such as a panic hook (`clippy.toml` bans `std::panic::set_hook`), and nothing starts a thread that outlives the Plugin's unload. What every run shares lives in the Plugin instance and never in a `static`, so an unload frees it.
Expand Down
10 changes: 6 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ edition = "2024"
license = "BSL-1.0"

[workspace.dependencies]
# The Plugin SDK at contract 0.8, pinned to a commit. A Host loads this
# The Plugin SDK at contract 0.9, pinned to a commit. A Host loads this
# Plugin only when its Harness speaks the same contract version.
runvil-plugin-sdk = { version = "0.8.0", git = "https://github.com/cppalliance/runvil-plugin-api", rev = "f2d42cc41b0f28f81ac73193f21c2eacfafc11d9" }
runvil-plugin-sdk = { version = "0.9.0", git = "https://github.com/cppalliance/runvil-plugin-api", rev = "4c10a7d4d26c11e6a3055c6f6c4b5657f1bf2faa" }
# Each tool's definition is embedded JSON, and a call's arguments arrive
# as JSON text.
serde = { version = "1", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The Plugin inserts one Pack, `runvil/std`, which gives a run the standard file t
cargo build -p plugin-std --release
```

This writes `plugin_std.dll` (Windows), `libplugin_std.so` (Linux), or `libplugin_std.dylib` (macOS) to `target/release`. That one file goes in the Host's Plugin directory. The Plugin speaks contract 0.8, the version that the pin of `runvil-plugin-sdk` in `Cargo.toml` names, and a Host loads it only when its Harness speaks the same version.
This writes `plugin_std.dll` (Windows), `libplugin_std.so` (Linux), or `libplugin_std.dylib` (macOS) to `target/release`. That one file goes in the Host's Plugin directory. The Plugin speaks contract 0.9, the version that the pin of `runvil-plugin-sdk` in `Cargo.toml` names, and a Host loads it only when its Harness speaks the same version.

A Host can also link the crate in. It turns the `dll` feature off, so the crate exports no symbol, and passes `runvil_plugin_sdk::entry::<plugin_std::Std>` to the Harness's `insert_plugin`.

Expand Down
2 changes: 1 addition & 1 deletion crates/plugin-std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
//! through. Grep alone accepts `-n` when it is `true`, because Cursor's
//! definition once declared it.
//! - A tool that changes files is flagged with
//! [`ToolInfo::changes_files`](runvil_plugin_sdk::ToolInfo::changes_files),
//! [`ToolInfo::with_changes_files`](runvil_plugin_sdk::ToolInfo::with_changes_files),
//! and a test holds the flags in place.

mod check;
Expand Down
6 changes: 2 additions & 4 deletions crates/plugin-std/src/pack-tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fn the_specs_are_the_seven_the_crate_names_in_order() {
}

#[test]
fn an_instance_names_each_tool_by_its_segment_with_its_schema_as_json_text() {
fn an_instance_names_each_tool_by_its_segment_with_its_input_schema() {
let definitions: Arc<[Definition]> = spec::load().expect("every definition parses").into();
let pack = StdPack::new(Arc::clone(&definitions));
assert_eq!(pack.tools.len(), definitions.len());
Expand All @@ -82,9 +82,7 @@ fn an_instance_names_each_tool_by_its_segment_with_its_schema_as_json_text() {
Some(definition.wire_name.as_str())
);
assert_eq!(tool.description, definition.description);
let parameters: serde_json::Value =
serde_json::from_str(&tool.parameters).expect("the schema is JSON text");
assert_eq!(parameters, definition.parameters, "{}", tool.name);
assert_eq!(tool.input_schema, definition.parameters, "{}", tool.name);
}
}

Expand Down
6 changes: 3 additions & 3 deletions crates/plugin-std/src/pack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ impl StdPack {
let tool = ToolInfo::new(
definition.segment,
definition.description.clone(),
definition.parameters.to_string(),
definition.parameters.clone(),
)
.wire_name(definition.wire_name.clone());
.with_wire_name(definition.wire_name.clone());
if changes_files(definition.segment) {
tool.changes_files()
tool.with_changes_files(true)
} else {
tool
}
Expand Down
Loading
Loading