Repository navigation
Description
Overview
Define the ImportService protobuf service, implement the handler in nodespaced, and migrate commands/import.rs in the Tauri app to a thin gRPC proxy.
Problem Statement
commands/import.rs handles bulk markdown import with smart collection routing and a two-phase async pipeline (parse → background DB write). This currently runs in the Tauri process, meaning imports are unavailable from the CLI or agent tools, and the import background task is killed when the UI window closes. Under ADR-031 this moves to nodespaced so imports run headlessly from any client.
Proposed Solution
Define ImportService in the nodespace proto with server-streaming progress RPCs, implement the handler in nodespaced preserving the two-phase pipeline and collection routing logic, and replace direct calls in commands/import.rs with ImportServiceClient gRPC calls.
Technical Specifications
Proto addition (packages/daemon/proto/nodespace.proto)
service ImportService {
rpc ImportMarkdown(ImportMarkdownRequest) returns (stream ImportProgressEvent);
rpc ImportMarkdownFiles(ImportMarkdownFilesRequest) returns (stream ImportProgressEvent);
}Reference Files
packages/desktop-app/src-tauri/src/commands/import.rs— current implementation including collection routing logic to preservepackages/daemon/src/services/node_service.rs— follow this handler patternpackages/daemon/src/main.rs— registerImportServicealongsideNodeService
Implementation Details
packages/daemon/src/services/import_service.rs— new handler; preserves smart collection routing (archived/, decisions/, lessons/, etc.) and two-phase pipeline- Background import task spawned in daemon Tokio runtime; progress events streamed via gRPC server-streaming RPC
commands/import.rssubscribes to progress stream and forwards to Tauri frontend events- CLI:
nodespace import <file>subcommand (wired in Implement nodespace CLI binary with node subcommands #1116)
Acceptance Criteria
-
ImportServiceproto defined and compiled via tonic-build - nodespaced handler implements two-phase import with smart collection routing preserved
- Progress streamed back via gRPC server-streaming RPC
-
commands/import.rsproxies via gRPC; no directpackages/coreimports remain - Import completes if Tauri window is closed mid-import
-
nodespace import <file>CLI subcommand works -
cargo buildsucceeds -
bun run test:allpasses -
bun run quality:fixpasses
Dependencies
- Migrate Tauri command handlers to thin gRPC proxy wrappers #1113
- Implement nodespace CLI binary with node subcommands #1116
Related Issues
- Migrate Tauri command handlers to thin gRPC proxy wrappers #1113 (establishes gRPC client pattern in Tauri)
- Implement nodespace CLI binary with node subcommands #1116 (nodespace CLI binary for import subcommand)
Activity
WIP: gRPC proxy migration for #1113 — Phases 2-4 of 5 complete
malibio commentedon May 18, 2026
Implementation complete. Tests: 128 files / 3918 passing. cargo build --workspace clean. Ready for review.
Add ImportService gRPC: proto definition, nodespaced handler, and Tau…
Add ImportService gRPC: proto definition, nodespaced handler, and Tau…