mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-11-30 15:55:49 +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.
29 lines
762 B
Rust
29 lines
762 B
Rust
//! Implements local application control endpoints.
|
|
use axum::{extract::State, Json};
|
|
|
|
use crate::{
|
|
local_app::{CursorHarnessStatus, SetEnabled},
|
|
Result,
|
|
};
|
|
|
|
use super::ControlService;
|
|
|
|
pub async fn status(State(service): State<ControlService>) -> Result<Json<CursorHarnessStatus>> {
|
|
Ok(Json(service.cursor_harness().status().await?))
|
|
}
|
|
|
|
pub async fn initialize_ca(
|
|
State(service): State<ControlService>,
|
|
) -> Result<Json<CursorHarnessStatus>> {
|
|
Ok(Json(service.cursor_harness().initialize_ca().await?))
|
|
}
|
|
|
|
pub async fn set_enabled(
|
|
State(service): State<ControlService>,
|
|
Json(input): Json<SetEnabled>,
|
|
) -> Result<Json<CursorHarnessStatus>> {
|
|
Ok(Json(
|
|
service.cursor_harness().set_enabled(input.enabled).await?,
|
|
))
|
|
}
|