mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-10-10 01:42:44 +08:00
refactor: align project directory architecture
This commit is contained in:
@@ -6,13 +6,12 @@ mod fixtures;
|
||||
use std::sync::Arc;
|
||||
|
||||
use cursor_server::{
|
||||
client::{session, ClientCommand, ClientEvent, CommitCause},
|
||||
model::{
|
||||
ConversationId, ModelSpec, PreparedRun, PromptSpec, RunAction, RunId, RunKind,
|
||||
ToolDefinition, ToolResult,
|
||||
},
|
||||
provider::{FinishReason, ModelEvent},
|
||||
run::{RunEngine, RunOutcome},
|
||||
run::{session, ClientCommand, ClientEvent, CommitCause, RunEngine, RunOutcome},
|
||||
};
|
||||
use tokio::{sync::oneshot, time::Duration};
|
||||
use tokio_util::sync::CancellationToken;
|
||||
@@ -94,7 +93,7 @@ async fn inserted_messages_wait_for_the_next_model_call_without_interrupting_the
|
||||
let (delivered, mut delivery) = oneshot::channel();
|
||||
commands
|
||||
.send(ClientCommand::InsertMessages(
|
||||
cursor_server::client::MessageInsertion {
|
||||
cursor_server::run::MessageInsertion {
|
||||
messages: vec![cursor_server::model::RuntimeEvent {
|
||||
event_id: "background:finished".into(),
|
||||
text: "background work finished".into(),
|
||||
|
||||
@@ -32,7 +32,7 @@ async fn generic_run_registry_cancels_the_previous_client_for_a_conversation() {
|
||||
conversation.clone(),
|
||||
cursor_server::model::RunId::new("first"),
|
||||
first.clone(),
|
||||
cursor_server::client::session(1).1.commands,
|
||||
cursor_server::run::session(1).1.commands,
|
||||
)
|
||||
.await;
|
||||
registry
|
||||
@@ -40,7 +40,7 @@ async fn generic_run_registry_cancels_the_previous_client_for_a_conversation() {
|
||||
conversation.clone(),
|
||||
cursor_server::model::RunId::new("second"),
|
||||
second.clone(),
|
||||
cursor_server::client::session(1).1.commands,
|
||||
cursor_server::run::session(1).1.commands,
|
||||
)
|
||||
.await;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
use cursor_server::{
|
||||
client::ClientEvent,
|
||||
config::{ProviderConfig, ProviderKind},
|
||||
model::{
|
||||
ContentPart, ModelInvocation, ModelLatency, ModelRequest, ModelSpec, ProjectedContent,
|
||||
@@ -9,7 +8,7 @@ use cursor_server::{
|
||||
FinishReason, ModelEvent, OpenAiChatProvider, OpenAiResponsesProvider, Provider,
|
||||
ProviderStream,
|
||||
},
|
||||
run::{consume_model_cycle, RunFailure},
|
||||
run::{consume_model_cycle, ClientEvent, RunFailure},
|
||||
};
|
||||
use futures_util::{stream, StreamExt};
|
||||
use serde_json::{json, Value};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use axum::{http::StatusCode, response::IntoResponse, routing::get, Router};
|
||||
use cursor_server::web::{HtmlEngine, JsonEngine, WebSearch};
|
||||
use cursor_server::search::{HtmlEngine, JsonEngine, WebSearch};
|
||||
use tokio::net::TcpListener;
|
||||
|
||||
const RESULT_SELECTOR: &str = ".result";
|
||||
@@ -106,7 +106,7 @@ async fn json_engines_use_declared_result_fields() {
|
||||
#[ignore = "live public search smoke test"]
|
||||
async fn built_in_search_returns_live_results() {
|
||||
let _ = tracing_subscriber::fmt()
|
||||
.with_env_filter("cursor_server::web=debug")
|
||||
.with_env_filter("cursor_server::search=debug")
|
||||
.try_init();
|
||||
let results = WebSearch::built_in()
|
||||
.search("Rust programming language")
|
||||
|
||||
Reference in New Issue
Block a user