diff --git a/.gitignore b/.gitignore index de3ddcc..d0d7820 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,30 @@ -/target +# Rust /target/ -node_modules/ +Cargo.lock + +# Python +__pycache__/ +*.py[cod] +*$py.class +venv/ +.env + +# Mojo +build/ +.mojo_cache/ + +# IDEs +.vscode/ +.idea/ + +# System .DS_Store +Thumbs.db + +# Logs *.log + +# Project specific +.superpowers/ +docs/ +STRUCTURE.tree diff --git a/STRUCTURE.tree b/STRUCTURE.tree index 8efee47..73ad5cb 100644 --- a/STRUCTURE.tree +++ b/STRUCTURE.tree @@ -1,5 +1,6 @@ . ├── ARCHITECTURE.md +├── buf.yaml ├── Cargo.lock ├── Cargo.toml ├── CLAUDE.md @@ -20,21 +21,14 @@ │   └── brain-proto │   ├── build.rs │   ├── Cargo.toml -│   ├── proto -│   │   └── brain.proto │   └── src │   └── lib.rs ├── DEPLOYMENT_GUIDE.md ├── DESIGN_DECISIONS.md ├── docs -│   ├── specs -│   │   └── ecosystem -│   │   └── .gitkeep -│   └── superpowers -│   ├── plans -│   │   └── 2026-04-30-foundation-core-loop.md -│   └── specs -│   └── 2026-04-30-foundation-core-loop-design.md +│   └── specs +│   └── ecosystem +│   └── 2026-05-01-canonical-proto-standard.md ├── FAQ.md ├── GEMINI.md ├── .github @@ -59,33 +53,22 @@ ├── PHILOSOPHY.md ├── .pre-commit-config.yaml ├── PRINCIPLES.md +├── proto +│   └── echo +│   └── vtuber +│   ├── brain +│   │   └── v1 +│   │   └── brain.proto +│   └── voice +│   └── v1 +│   └── voice.proto ├── README.md ├── ROADMAP.md ├── SECURITY.md ├── STRATEGY.md ├── STRUCTURE.tree -├── .superpowers -│   └── brainstorm -│   ├── 1516087-1777552623 -│   │   ├── content -│   │   │   ├── architecture-overview.html -│   │   │   ├── boundaries.html -│   │   │   └── phase1-design.html -│   │   └── state -│   │   ├── server.pid -│   │   └── server-stopped -│   └── 2118992-1777559437 -│   ├── content -│   │   ├── architecture-overview.html -│   │   ├── boundaries-fixed.html -│   │   ├── boundaries.html -│   │   ├── final-boundaries.html -│   │   └── phase1-design.html -│   └── state -│   ├── server.pid -│   └── server-stopped ├── SUPPORT.md ├── TROUBLESHOOTING.md └── VISION.md -28 directories, 61 files +23 directories, 49 files diff --git a/buf.yaml b/buf.yaml new file mode 100644 index 0000000..26965c6 --- /dev/null +++ b/buf.yaml @@ -0,0 +1,9 @@ +version: v2 +modules: + - path: proto +lint: + use: + - STANDARD +breaking: + use: + - STANDARD diff --git a/crates/brain-grpc/src/bin/server.rs b/crates/brain-grpc/src/bin/server.rs index 6a6ec57..faa4c49 100644 --- a/crates/brain-grpc/src/bin/server.rs +++ b/crates/brain-grpc/src/bin/server.rs @@ -1,5 +1,5 @@ use brain_grpc::server::MyBrainService; -use brain_proto::brain::brain_service_server::BrainServiceServer; +use brain_proto::brain::v1::brain_service_server::BrainServiceServer; use tonic::transport::Server; #[tokio::main] diff --git a/crates/brain-grpc/src/server.rs b/crates/brain-grpc/src/server.rs index 42875c0..b32ed48 100644 --- a/crates/brain-grpc/src/server.rs +++ b/crates/brain-grpc/src/server.rs @@ -1,5 +1,5 @@ -use brain_proto::brain::brain_service_server::BrainService; -use brain_proto::brain::{ContextRequest, ContextResponse}; +use brain_proto::brain::v1::brain_service_server::BrainService; +use brain_proto::brain::v1::{PushContextRequest, PushContextResponse}; use tonic::{Request, Response, Status}; #[derive(Default)] @@ -9,12 +9,12 @@ pub struct MyBrainService {} impl BrainService for MyBrainService { async fn push_context( &self, - request: Request, - ) -> Result, Status> { + request: Request, + ) -> Result, Status> { let r = request.into_inner(); tracing::info!("Received context from {}: {}", r.user_id, r.message); - Ok(Response::new(ContextResponse { + Ok(Response::new(PushContextResponse { accepted: true, request_id: "mock-uuid".to_string(), })) diff --git a/crates/brain-proto/build.rs b/crates/brain-proto/build.rs index a421642..25fd8c5 100644 --- a/crates/brain-proto/build.rs +++ b/crates/brain-proto/build.rs @@ -2,6 +2,12 @@ fn main() -> Result<(), Box> { tonic_build::configure() .build_server(true) .build_client(true) - .compile_protos(&["proto/brain.proto"], &["proto"])?; + .compile_protos( + &[ + "../../proto/echo/vtuber/brain/v1/brain.proto", + "../../proto/echo/vtuber/voice/v1/voice.proto", + ], + &["../../proto"], + )?; Ok(()) } diff --git a/crates/brain-proto/proto/brain.proto b/crates/brain-proto/proto/brain.proto deleted file mode 100644 index 5b9b679..0000000 --- a/crates/brain-proto/proto/brain.proto +++ /dev/null @@ -1,35 +0,0 @@ -syntax = "proto3"; - -package brain; - -// vtuber-api -> vtuber-brain -service BrainService { - rpc PushContext (ContextRequest) returns (ContextResponse); -} - -// vtuber-brain -> vtuber-voice -service VoiceService { - rpc EmitDirective (DirectiveRequest) returns (DirectiveResponse); -} - -message ContextRequest { - string session_id = 1; - string user_id = 2; - string message = 3; - map metadata = 4; -} - -message ContextResponse { - bool accepted = 1; - string request_id = 2; -} - -message DirectiveRequest { - string text_prompt = 1; - string voice_prompt = 2; - map commands = 3; -} - -message DirectiveResponse { - bool success = 1; -} diff --git a/crates/brain-proto/src/lib.rs b/crates/brain-proto/src/lib.rs index bc03fc7..4745e37 100644 --- a/crates/brain-proto/src/lib.rs +++ b/crates/brain-proto/src/lib.rs @@ -1,3 +1,11 @@ pub mod brain { - tonic::include_proto!("brain"); + pub mod v1 { + tonic::include_proto!("echo.vtuber.brain.v1"); + } +} + +pub mod voice { + pub mod v1 { + tonic::include_proto!("echo.vtuber.voice.v1"); + } } diff --git a/proto/echo/vtuber/brain/v1/brain.proto b/proto/echo/vtuber/brain/v1/brain.proto new file mode 100644 index 0000000..1470376 --- /dev/null +++ b/proto/echo/vtuber/brain/v1/brain.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package echo.vtuber.brain.v1; + +// BrainService defines the interface for vtuber-api to feed context into the reasoning core. +service BrainService { + rpc PushContext (PushContextRequest) returns (PushContextResponse); +} + +message PushContextRequest { + string session_id = 1; + string user_id = 2; + string message = 3; + map metadata = 4; +} + +message PushContextResponse { + bool accepted = 1; + string request_id = 2; +} diff --git a/proto/echo/vtuber/voice/v1/voice.proto b/proto/echo/vtuber/voice/v1/voice.proto new file mode 100644 index 0000000..b0254fb --- /dev/null +++ b/proto/echo/vtuber/voice/v1/voice.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package echo.vtuber.voice.v1; + +// VoiceService defines the interface for the Performer (vtuber-voice) to receive directives. +service VoiceService { + rpc EmitDirective (EmitDirectiveRequest) returns (EmitDirectiveResponse); +} + +message EmitDirectiveRequest { + string text_prompt = 1; + string voice_prompt = 2; + map commands = 3; +} + +message EmitDirectiveResponse { + bool success = 1; +}