Skip to content

Commit 64e2883

Browse files
wan9chiclaude
andcommitted
feat(runner-protocol): IPC protocol + Rust transport
Add three new crates that together define the runner-tool IPC: - `vite_task_ipc_shared` — message types + wire format shared by both ends. Spawned tools tell the runner what they read, wrote, or cared about; the runner uses that to decide what to fingerprint in the cache. - `vite_task_server` — async server hosted in the runner. One server instance per task execution. - `vite_task_client` — synchronous blocking client used by spawned tools. The sync API is deliberate: most tools are JS, called one-method-at-a-time, and don't want a runtime imposed on them. The two sides are wired together end-to-end in `vite_task_server/tests/integration.rs`, so this PR is independently reviewable as "does the wire format and transport work correctly?" without depending on runner internals. Design notes: `docs/runner-task-ipc/`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5833b37 commit 64e2883

23 files changed

Lines changed: 1874 additions & 1 deletion

File tree

Cargo.lock

Lines changed: 67 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ fspy_shared = { path = "crates/fspy_shared" }
8080
fspy_shared_unix = { path = "crates/fspy_shared_unix" }
8181
futures = "0.3.31"
8282
futures-util = "0.3.31"
83+
interprocess = "2"
8384
jsonc-parser = { version = "0.32.0", features = ["serde"] }
8485
libc = "0.2.185"
8586
libtest-mimic = "0.8.2"
@@ -149,8 +150,11 @@ vite_shell = { path = "crates/vite_shell" }
149150
vite_str = { path = "crates/vite_str" }
150151
vite_task = { path = "crates/vite_task" }
151152
vite_task_bin = { path = "crates/vite_task_bin" }
153+
vite_task_client = { path = "crates/vite_task_client" }
152154
vite_task_graph = { path = "crates/vite_task_graph" }
155+
vite_task_ipc_shared = { path = "crates/vite_task_ipc_shared" }
153156
vite_task_plan = { path = "crates/vite_task_plan" }
157+
vite_task_server = { path = "crates/vite_task_server" }
154158
vite_workspace = { path = "crates/vite_workspace" }
155159
vt100 = "0.16.2"
156160
wax = "0.7.0"
@@ -168,6 +172,10 @@ ignored = [
168172
# These are artifact dependencies. They are not directly `use`d in Rust code.
169173
"fspy_preload_unix",
170174
"fspy_preload_windows",
175+
# Registered in the workspace dependency table so downstream PRs in the
176+
# runner-aware-tools stack can pick it up via `workspace = true` without
177+
# touching this file. No in-tree consumer in this PR.
178+
"vite_task_server",
171179
]
172180

173181
[profile.dev]

crates/native_str/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use wincode::{
3737
/// **Not portable across platforms.** The binary representation is platform-specific.
3838
/// Deserializing a `NativeStr` serialized on a different platform leads to unspecified
3939
/// behavior (garbage data), but is not unsafe. Designed for same-platform IPC only.
40-
#[derive(TransparentWrapper, PartialEq, Eq)]
40+
#[derive(TransparentWrapper, PartialEq, Eq, PartialOrd, Ord)]
4141
#[repr(transparent)]
4242
pub struct NativeStr {
4343
// On unix, this is the raw bytes of the OsStr.

crates/vite_task_client/Cargo.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[package]
2+
name = "vite_task_client"
3+
version = "0.0.0"
4+
edition.workspace = true
5+
license.workspace = true
6+
publish = false
7+
rust-version.workspace = true
8+
9+
[dependencies]
10+
interprocess = { workspace = true }
11+
native_str = { workspace = true }
12+
vite_path = { workspace = true }
13+
vite_task_ipc_shared = { workspace = true }
14+
wincode = { workspace = true, features = ["derive"] }
15+
16+
[lints]
17+
workspace = true
18+
19+
[lib]
20+
doctest = false
21+
test = false

crates/vite_task_client/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# vite_task_client
2+
3+
IPC client that connects from tool processes to the task runner to report inputs/outputs, request env values, and disable caching.

0 commit comments

Comments
 (0)