mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-12-01 01:05:10 +08:00
feat(cursor): cli 接入本地模型路由与配置
- feat(服务配置): 本地响应配置并禁用 HTTP/2 传输 - feat(模型目录): 提供默认模型接口及本地路由凭据 - fix(待办状态): 基于检查点合并增量待办并保留未变更项 - fix(模型参数): 忽略未知参数以兼容新版 Cursor 请求 - test(本地路由): 覆盖模型元数据路由与凭据行为
This commit is contained in:
1 parent
543f618fee
commit
924b5e5926
10 files changed
+489
-11
No files matched your search
@@ -19,7 +19,9 @@ use crate::{
|
||||
connect,
|
||||
proto::{agent::v1 as agent, aiserver::v1 as ai},
|
||||
},
|
||||
services::{account, analytics, commit_message, knowledge, model_catalog, tab},
|
||||
services::{
|
||||
account, analytics, commit_message, knowledge, model_catalog, server_config, tab,
|
||||
},
|
||||
transport::{TransportParent, TransportRegistry},
|
||||
},
|
||||
Result,
|
||||
@@ -44,6 +46,14 @@ fn router_with_proxy(
|
||||
.route("/__byok-api__/healthz", get(health))
|
||||
.route("/agent.v1.AgentService/RunSSE", post(run_sse_handler))
|
||||
.route("/aiserver.v1.BidiService/BidiAppend", post(bidi_handler))
|
||||
.route(
|
||||
"/aiserver.v1.AiService/GetServerConfig",
|
||||
post(server_config::get),
|
||||
)
|
||||
.route(
|
||||
"/aiserver.v1.ServerConfigService/GetServerConfig",
|
||||
post(server_config::get),
|
||||
)
|
||||
.route(
|
||||
"/aiserver.v1.AiService/AvailableModels",
|
||||
post(model_catalog::available_models),
|
||||
@@ -64,6 +74,22 @@ fn router_with_proxy(
|
||||
"/aiserver.v1.NetworkService/IsConnected",
|
||||
post(is_connected),
|
||||
)
|
||||
.route(
|
||||
"/agent.v1.AgentService/GetDefaultModelForCli",
|
||||
post(model_catalog::default_model_for_cli),
|
||||
)
|
||||
.route(
|
||||
"/aiserver.v1.AiService/GetDefaultModelForCli",
|
||||
post(model_catalog::default_model_for_cli),
|
||||
)
|
||||
.route(
|
||||
"/aiserver.v1.AiService/GetDefaultModel",
|
||||
post(model_catalog::default_model),
|
||||
)
|
||||
.route(
|
||||
"/aiserver.v1.AiService/GetDefaultModelNudgeData",
|
||||
post(model_catalog::default_model_nudge),
|
||||
)
|
||||
.route(
|
||||
"/aiserver.v1.AuthService/GetEmail",
|
||||
post(account::get_email),
|
||||
|
||||
Reference in new issue
Block a user