mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-12-01 09:15:33 +08:00
feat(console): dual-protocol provider presets + fix sub-path model discovery
Console — provider presets inside the model editor: - Preset chips for five coding-plan providers (Zhipu GLM / Kimi / DeepSeek / Volcengine Ark / MiniMax) rendered at the top of the add/edit model dialog - All five providers expose both an Anthropic-protocol and an OpenAI-protocol endpoint; a click fills the endpoint matching the current model type, and switching the type automatically swaps to the same provider's other endpoint (no stale URL/protocol mismatches) - Switching to a different provider clears the API key; switching protocols within the same provider keeps it - Fills base URL (full-request-URL form for irregular paths), request protocol, claude-cli custom headers for Anthropic endpoints, token limits, remark, and the default model id + display name; known preset model ids merge into the model-name combobox Server — model discovery for sub-path endpoints: - model_discovery_url previously replaced the whole path with /v1/models, which strips the /api/anthropic, /coding, /api/paas/v4 style prefixes every coding-plan provider uses, so discovery always 404'd for them. It now appends to the existing path and normalizes endpoint/version suffixes (/chat/completions, /responses, /messages, /v1, /v3, /v4) - Verified live against Zhipu (10 models) and Kimi (4 models) coding plans; existing tests updated to the append semantics plus new URL cases Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5450fc76e2
commit
75babb7334
13 files changed
+374
-51
No files matched your search
@@ -33,7 +33,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 88,
|
||||
"line": 137,
|
||||
"column": 40
|
||||
}
|
||||
]
|
||||
@@ -159,7 +159,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 118,
|
||||
"line": 167,
|
||||
"column": 16
|
||||
},
|
||||
{
|
||||
@@ -384,7 +384,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 105,
|
||||
"line": 154,
|
||||
"column": 16
|
||||
},
|
||||
{
|
||||
@@ -449,8 +449,8 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 90,
|
||||
"column": 283
|
||||
"line": 139,
|
||||
"column": 286
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -461,12 +461,12 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 79,
|
||||
"line": 128,
|
||||
"column": 59
|
||||
},
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 79,
|
||||
"line": 128,
|
||||
"column": 124
|
||||
}
|
||||
]
|
||||
@@ -676,17 +676,17 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 94,
|
||||
"line": 143,
|
||||
"column": 49
|
||||
},
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 96,
|
||||
"line": 145,
|
||||
"column": 50
|
||||
},
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 99,
|
||||
"line": 148,
|
||||
"column": 50
|
||||
}
|
||||
]
|
||||
@@ -762,7 +762,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 90,
|
||||
"line": 139,
|
||||
"column": 42
|
||||
}
|
||||
]
|
||||
@@ -812,7 +812,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 101,
|
||||
"line": 150,
|
||||
"column": 27
|
||||
},
|
||||
{
|
||||
@@ -922,7 +922,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 91,
|
||||
"line": 140,
|
||||
"column": 42
|
||||
}
|
||||
]
|
||||
@@ -1469,7 +1469,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 94,
|
||||
"line": 143,
|
||||
"column": 25
|
||||
},
|
||||
{
|
||||
@@ -1498,7 +1498,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 85,
|
||||
"line": 134,
|
||||
"column": 145
|
||||
}
|
||||
]
|
||||
@@ -1527,7 +1527,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 143,
|
||||
"line": 192,
|
||||
"column": 41
|
||||
}
|
||||
]
|
||||
@@ -1681,12 +1681,12 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 96,
|
||||
"line": 145,
|
||||
"column": 27
|
||||
},
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 99,
|
||||
"line": 148,
|
||||
"column": 27
|
||||
},
|
||||
{
|
||||
@@ -1715,7 +1715,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 92,
|
||||
"line": 141,
|
||||
"column": 69
|
||||
}
|
||||
]
|
||||
@@ -2266,7 +2266,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 112,
|
||||
"line": 161,
|
||||
"column": 16
|
||||
},
|
||||
{
|
||||
@@ -2369,8 +2369,8 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 90,
|
||||
"column": 295
|
||||
"line": 139,
|
||||
"column": 298
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2473,7 +2473,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 85,
|
||||
"line": 134,
|
||||
"column": 115
|
||||
}
|
||||
]
|
||||
@@ -2555,7 +2555,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 79,
|
||||
"line": 128,
|
||||
"column": 76
|
||||
}
|
||||
]
|
||||
@@ -2728,12 +2728,12 @@
|
||||
},
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 100,
|
||||
"line": 149,
|
||||
"column": 27
|
||||
},
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 100,
|
||||
"line": 149,
|
||||
"column": 58
|
||||
}
|
||||
]
|
||||
@@ -3000,7 +3000,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 86,
|
||||
"line": 135,
|
||||
"column": 61
|
||||
}
|
||||
]
|
||||
@@ -3039,7 +3039,7 @@
|
||||
},
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 91,
|
||||
"line": 140,
|
||||
"column": 25
|
||||
}
|
||||
]
|
||||
@@ -3445,12 +3445,12 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 97,
|
||||
"line": 146,
|
||||
"column": 27
|
||||
},
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 97,
|
||||
"line": 146,
|
||||
"column": 58
|
||||
}
|
||||
]
|
||||
@@ -3522,7 +3522,7 @@
|
||||
},
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 90,
|
||||
"line": 139,
|
||||
"column": 25
|
||||
}
|
||||
]
|
||||
@@ -3592,7 +3592,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 101,
|
||||
"line": 150,
|
||||
"column": 50
|
||||
}
|
||||
]
|
||||
@@ -3633,7 +3633,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 85,
|
||||
"line": 134,
|
||||
"column": 70
|
||||
}
|
||||
]
|
||||
@@ -3645,11 +3645,23 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/ui/Modal.tsx",
|
||||
"line": 95,
|
||||
"line": 97,
|
||||
"column": 135
|
||||
}
|
||||
]
|
||||
},
|
||||
"d58c88688e1a949d": {
|
||||
"source": "常用预设",
|
||||
"kind": "text",
|
||||
"placeholders": [],
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorPresetChips.tsx",
|
||||
"line": 8,
|
||||
"column": 37
|
||||
}
|
||||
]
|
||||
},
|
||||
"d86fa42c3848c680": {
|
||||
"source": "使用系统代理",
|
||||
"kind": "text",
|
||||
@@ -3710,12 +3722,17 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 27,
|
||||
"line": 29,
|
||||
"column": 19
|
||||
},
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 92,
|
||||
"line": 102,
|
||||
"column": 88
|
||||
},
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 141,
|
||||
"column": 54
|
||||
}
|
||||
]
|
||||
@@ -3940,7 +3957,7 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 85,
|
||||
"line": 134,
|
||||
"column": 54
|
||||
}
|
||||
]
|
||||
@@ -4010,12 +4027,12 @@
|
||||
"refs": [
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 75,
|
||||
"line": 124,
|
||||
"column": 25
|
||||
},
|
||||
{
|
||||
"file": "components/cursor/CursorModelEditor.tsx",
|
||||
"line": 75,
|
||||
"line": 124,
|
||||
"column": 55
|
||||
}
|
||||
]
|
||||
|
||||
@@ -251,6 +251,7 @@
|
||||
"d34335433395cd3a": "Start Cursor BYOK automatically after signing in.",
|
||||
"d3716cc5a2f5a810": "Server address",
|
||||
"d3d21191f32e79a5": "Processing…",
|
||||
"d58c88688e1a949d": "Presets",
|
||||
"d86fa42c3848c680": "Use system proxy",
|
||||
"d8c47e9776cf1082": "Main menu",
|
||||
"da521d1c1cbd36af": "Authorization is required to install the certificate",
|
||||
|
||||
@@ -251,6 +251,7 @@
|
||||
"d34335433395cd3a": "登录系统后自动启动 Cursor BYOK。",
|
||||
"d3716cc5a2f5a810": "服务器地址",
|
||||
"d3d21191f32e79a5": "处理中…",
|
||||
"d58c88688e1a949d": "常用预设",
|
||||
"d86fa42c3848c680": "使用系统代理",
|
||||
"d8c47e9776cf1082": "主菜单",
|
||||
"da521d1c1cbd36af": "需要授权安装证书",
|
||||
|
||||
Reference in new issue
Block a user