Initial commit

This commit is contained in:
2026-01-26 18:04:07 +02:00
commit 0786cf0165
45 changed files with 12608 additions and 0 deletions

13
crates/shared/Cargo.toml Normal file
View File

@@ -0,0 +1,13 @@
[package]
name = "shared"
version = "0.1.0"
edition = "2021"
[dependencies]
prost = "0.14.3"
serde = { version = "1.0.228", features = ["derive"] }
tonic = "0.14.2"
tonic-prost = "0.14.2"
[build-dependencies]
tonic-prost-build = "0.14.2"

10
crates/shared/build.rs Normal file
View File

@@ -0,0 +1,10 @@
use std::env;
use std::path::PathBuf;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
tonic_prost_build::configure()
.file_descriptor_set_path(out_dir.join("ai_service_descriptor.bin"))
.compile_protos(&["proto/api.proto"], &["proto"])?;
Ok(())
}

View File

@@ -0,0 +1,14 @@
syntax = "proto3";
package ai_daemon;
service AiDaemon {
rpc Prompt (PromptRequest) returns (PromptResponse);
}
message PromptRequest {
string prompt = 1;
}
message PromptResponse {
string response = 1;
}

5
crates/shared/src/lib.rs Normal file
View File

@@ -0,0 +1,5 @@
pub mod ai {
tonic::include_proto!("ai_daemon");
pub const FILE_DESCRIPTOR_SET: &[u8] = tonic::include_file_descriptor_set!("ai_service_descriptor");
}