mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-10-04 02:52:55 +08:00
- 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.
19 lines
571 B
Rust
19 lines
571 B
Rust
//! 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)
|
|
}
|