Repository navigation
Description
Overview
Establish the protobuf schema and build infrastructure for nodespaced, the background daemon that will own all NodeSpace services. This is the foundation for ADR-031 (daemon-client architecture): every other daemon and CLI issue depends on this build pipeline being in place.
Problem Statement
NodeSpace currently uses Tauri commands for all IPC between the UI and backend. ADR-031 replaces this with gRPC — nodespaced runs a gRPC server, and the Tauri app, CLI, and agent tools all connect as pure gRPC clients. Before any of that can be built, the proto definitions and the tonic/prost build pipeline must exist.
Proposed Solution
Create a packages/daemon/ Rust crate with the proto definitions, a build.rs that compiles them via tonic-build, and a protoc-bin-vendored dependency so there is no system protoc requirement.
Acceptance Criteria
-
packages/daemon/crate exists and is added to the Cargo workspace -
proto/node_service.protodefinesNodeServicewith all methods listed in Technical Specifications -
proto/agent_session_service.protodefinesAgentSessionServicewith all methods listed in Technical Specifications -
build.rsusestonic-build+protoc-bin-vendoredto compile protos at build time - Generated Rust types compile without errors (
cargo build -p daemon) - No system
protocrequired — vendored binary used automatically -
cargo test -p daemonpasses - Code passes
bun run quality:fix
Technical Specifications
New files
packages/daemon/Cargo.toml— crate manifestpackages/daemon/build.rs— tonic-build invocationpackages/daemon/proto/node_service.proto— NodeService definitionpackages/daemon/proto/agent_session_service.proto— AgentSessionService definitionpackages/daemon/src/lib.rs— re-exports generated codeCargo.toml(workspace root) — addpackages/daemonmember
NodeService proto
syntax = "proto3";
package nodespace;
service NodeService {
rpc CreateNode(CreateNodeRequest) returns (NodeResponse);
rpc GetNode(GetNodeRequest) returns (NodeResponse);
rpc UpdateNode(UpdateNodeRequest) returns (NodeResponse);
rpc DeleteNode(DeleteNodeRequest) returns (DeleteNodeResponse);
rpc GetChildren(GetChildrenRequest) returns (NodeListResponse);
rpc SearchNodes(SearchRequest) returns (NodeListResponse);
rpc WatchNodes(WatchRequest) returns (stream NodeEvent);
rpc Chat(stream ChatRequest) returns (stream ChatResponse);
}AgentSessionService proto
syntax = "proto3";
package nodespace;
service AgentSessionService {
rpc LaunchSession(LaunchSessionRequest) returns (LaunchSessionResponse);
rpc StreamOutput(StreamOutputRequest) returns (stream OutputChunk);
rpc WriteInput(WriteInputRequest) returns (WriteInputResponse);
rpc ResizeTerminal(ResizeRequest) returns (ResizeResponse);
rpc TerminateSession(TerminateSessionRequest) returns (TerminateSessionResponse);
rpc ListSessions(ListSessionsRequest) returns (ListSessionsResponse);
}Cargo dependencies
[dependencies]
tonic = "0.12"
prost = "0.13"
[build-dependencies]
tonic-build = "0.12"
protoc-bin-vendored = "3"build.rs pattern
fn main() -> Result<(), Box<dyn std::error::Error>> {
let protoc = protoc_bin_vendored::protoc_bin_path().unwrap();
std::env::set_var("PROTOC", protoc);
tonic_build::compile_protos("proto/node_service.proto")?;
tonic_build::compile_protos("proto/agent_session_service.proto")?;
Ok(())
}Message types to define
All request/response message types for each RPC method, matching the field shapes used by packages/core/src/ops/ (NodeId as string UUID, content as string, node_type as string enum).
Non-Goals
- Implementing the gRPC server handlers (next issue)
- Migrating Tauri commands (later issue)
- CLI binary (later issue)
Activity
malibio commentedon May 17, 2026
Baseline before starting: Frontend tests could not run due to missing .svelte-kit/tsconfig.json in worktree environment (worktree limitation). Rust-only issue — primary correctness signal is cargo build/test/clippy for the new daemon crate. Proceeding with implementation.
Add packages/daemon: protobuf schema and tonic/prost build pipeline (#…
Implement nodespaced binary: gRPC server and NodeService handlers (#1131
WIP: gRPC proxy migration for #1113 — Phases 2-4 of 5 complete
Add packages/daemon: protobuf schema and tonic/prost build pipeline (#…
Implement nodespaced binary: gRPC server and NodeService handlers (#1131