Files
cursor-byok/server/src/run/command.rs
T
leookun 44e2d8057a 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.
2026-08-30 01:33:39 +08:00

36 lines
720 B
Rust

//! Defines Run commands and their explicit delivery results.
use tokio::sync::oneshot;
use crate::model::{CanonicalMessage, ToolResult};
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CommandResult {
Applied,
Duplicate,
RunClosing,
RunEnded,
StaleTarget,
}
#[derive(Debug)]
pub struct MessageBatch {
pub event_id: String,
pub messages: Vec<CanonicalMessage>,
pub result: oneshot::Sender<CommandResult>,
}
impl MessageBatch {
pub fn complete(self, result: CommandResult) {
let _ = self.result.send(result);
}
}
#[derive(Debug)]
pub enum RunCommand {
ToolResult(ToolResult),
InsertMessages(MessageBatch),
BreakMessages(MessageBatch),
Cancel,
}