mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-10-04 19:31:28 +08:00
feat: initialize server structure and database schema
- Added initial server setup with Cargo.toml defining dependencies and project structure. - Created build.rs for generating protobuf bindings and validating wire contracts. - Established database schema with initial migration files for conversations, messages, and runs. - Introduced tools and prompts for Cursor functionality, enhancing user interaction capabilities.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
//! Provides isolated stores and canonical message fixtures for tests.
|
||||
#![allow(dead_code)]
|
||||
|
||||
use cursor_server::{
|
||||
model::{CanonicalMessage, Origin, Role},
|
||||
store::Store,
|
||||
};
|
||||
|
||||
pub async fn temp_store() -> (tempfile::TempDir, Store) {
|
||||
let directory = tempfile::tempdir().unwrap();
|
||||
let url = format!("sqlite://{}", directory.path().join("test.db").display());
|
||||
let store = Store::connect(&url).await.unwrap();
|
||||
(directory, store)
|
||||
}
|
||||
|
||||
pub fn user(id: &str, text: &str) -> CanonicalMessage {
|
||||
CanonicalMessage::text(id, Role::User, Origin::User, text)
|
||||
}
|
||||
Reference in New Issue
Block a user