chainlesschain 0.166.150 → 0.166.156
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -6
- package/package.json +2 -2
- package/src/assets/linux-subreaper/linux-arm64/manifest.json +1 -1
- package/src/assets/linux-subreaper/linux-x64/manifest.json +1 -1
- package/src/assets/web-panel/.build-hash +1 -1
- package/src/assets/web-panel/assets/{AIOps-bYMRw36k.js → AIOps-CraNGNgc.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-xprOFj7C.js → ActionButton-C0jn6sgg.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-BRZ6F3vk.js → Analytics-DVrR_wjl.js} +1 -1
- package/src/assets/web-panel/assets/{AppLayout-C_volo3Y.js → AppLayout-CeKP8mgC.js} +1 -1
- package/src/assets/web-panel/assets/{Artifacts-Db0iD_H2.js → Artifacts-OHCS9wLN.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-Bzp7NOA9.js → Audit-C77b6pDl.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-CPa5KqjU.js → BackgroundAgents-CefiwCgM.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-BraBbkcd.js → Backup-B-5KmWNA.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-D8LlXxCM.js → BaseInput-C3bJ1Qlc.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-FWtdQ7HW.js → Chat-DBahPz9B.js} +1 -1
- package/src/assets/web-panel/assets/{ChatBubbleRenderer-DtxhjGV3.js → ChatBubbleRenderer-J4BVVrXZ.js} +1 -1
- package/src/assets/web-panel/assets/{Checkbox-BoCeVuib.js → Checkbox-w856fzfY.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-C58CW3JB.js → Codegen-XKmsL_C3.js} +1 -1
- package/src/assets/web-panel/assets/{Col-BlkVpYfD.js → Col-B37-gr7d.js} +1 -1
- package/src/assets/web-panel/assets/{Community-BmQ95FuI.js → Community-DdahlN0f.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-BzWphLgo.js → Compact-oKnoE-9_.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-CG1Plf7v.js → Compliance-CnCRlOB_.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-CS8_XrAS.js → Cowork-D3Vr5R3E.js} +1 -1
- package/src/assets/web-panel/assets/{Cron-C1m-mGo0.js → Cron-X46CdLRQ.js} +1 -1
- package/src/assets/web-panel/assets/{Crosschain-TU1UPo_V.js → Crosschain-CV3_6jVw.js} +1 -1
- package/src/assets/web-panel/assets/{DID-bhbIsq__.js → DID-Kr6H4WKr.js} +1 -1
- package/src/assets/web-panel/assets/{Dashboard-B0wCsqTw.js → Dashboard-Bj4usrhx.js} +1 -1
- package/src/assets/web-panel/assets/{Dropdown-CVokY3lt.js → Dropdown-V3DPV21D.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-CfatTKx0.js → EmailListRenderer-8MCX0Y4b.js} +1 -1
- package/src/assets/web-panel/assets/{EvolutionSettings-DnT_Uiag.js → EvolutionSettings-SUoykpjc.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-Dyahx8jQ.js → FamilyGuardDashboard-C0iE0T9x.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-DuJ39hyj.js → Federation-CSU3kpK2.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-V4Ic5oQ_.js → FormItemContext-Bcv2XJNw.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-UlZdAl_W.js → GenericCardRenderer-PdEqwQZd.js} +1 -1
- package/src/assets/web-panel/assets/{Git-B_363OIs.js → Git-CVZ0MSRN.js} +1 -1
- package/src/assets/web-panel/assets/{Governance-C61_SW_q.js → Governance-CF64-eGc.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-CU80t_tb.js → Inference-DJ1J40Th.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-BEtPQz8C.js → KnowledgeGraph-Cf3ULXmf.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-CXqWvdFk.js → Logs-DM_RbXG_.js} +1 -1
- package/src/assets/web-panel/assets/{MarkdownRenderer-BFgkiBfA.js → MarkdownRenderer-B2wey_j8.js} +1 -1
- package/src/assets/web-panel/assets/{Marketplace-oKgzevz2.js → Marketplace-tqdANxLa.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-DHcNKyfb.js → McpTools-BiSYAtKB.js} +1 -1
- package/src/assets/web-panel/assets/{Memory-DEVpDL-x.js → Memory-hOvA-Tqp.js} +1 -1
- package/src/assets/web-panel/assets/{MobileBridge-D92T6ztp.js → MobileBridge-CIpwBK6G.js} +1 -1
- package/src/assets/web-panel/assets/{MobileProjects-B2Y7xpPw.js → MobileProjects-DMpV98oD.js} +1 -1
- package/src/assets/web-panel/assets/{Mtc-VOiGefD2.js → Mtc-CVoJZMuY.js} +1 -1
- package/src/assets/web-panel/assets/{MtcAudit-CAnmf1Im.js → MtcAudit-Dz9YsrvV.js} +1 -1
- package/src/assets/web-panel/assets/{Multisig-BCPOmJxC.js → Multisig-CamW3sTK.js} +1 -1
- package/src/assets/web-panel/assets/{NLProgramming-DYFqTLhe.js → NLProgramming-DlZo8q6W.js} +1 -1
- package/src/assets/web-panel/assets/{Notes--N-8WbHM.js → Notes-DZJSYibx.js} +1 -1
- package/src/assets/web-panel/assets/{NotificationSettings-Dka_XX0P.js → NotificationSettings-BSlIIGOM.js} +1 -1
- package/src/assets/web-panel/assets/{OrderTableRenderer-CIVkknQY.js → OrderTableRenderer-Bo9vImgU.js} +1 -1
- package/src/assets/web-panel/assets/{Organization-MToqvn2N.js → Organization-B1sBf0Kk.js} +1 -1
- package/src/assets/web-panel/assets/{Overflow-DgYLr6Hh.js → Overflow-CD8GUNOV.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-DiRHC93-.js → P2P-CeaIuSa9.js} +1 -1
- package/src/assets/web-panel/assets/{PdhVaultBrowser-Cw8MYDt-.js → PdhVaultBrowser-DCOkcRse.js} +2 -2
- package/src/assets/web-panel/assets/{Permissions-JhxdHQqC.js → Permissions-DQCZnN_y.js} +1 -1
- package/src/assets/web-panel/assets/{PersonalDataHub-CcEeur_W.js → PersonalDataHub-D_9PtVvT.js} +1 -1
- package/src/assets/web-panel/assets/{Pipeline-Dau0R1tw.js → Pipeline-BawUxj0i.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-UF1HoZ-q.js → Privacy-CPyw19Ai.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-DyPmrkmp.js → ProjectInit-GDtYLbL6.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectSettings-DZ4DQBbI.js → ProjectSettings-DhmGKXVL.js} +1 -1
- package/src/assets/web-panel/assets/{Projects-BRhaPrL4.js → Projects-O2spSrud.js} +1 -1
- package/src/assets/web-panel/assets/Providers-CNKCrJbY.css +1 -0
- package/src/assets/web-panel/assets/Providers-lEDu4Qdj.js +1 -0
- package/src/assets/web-panel/assets/{QrScannerModal-Dgvs6EGu.js → QrScannerModal-Dcqm-i6j.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-DqKybfXf.js → QuickAsk-C6uPAeAE.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-BGQDw5cu.js → Recommend-ClVlhga7.js} +1 -1
- package/src/assets/web-panel/assets/{RemoteSession-KE-6VZN0.js → RemoteSession-2raJDKUb.js} +1 -1
- package/src/assets/web-panel/assets/{Reputation-Ifxvbk7U.js → Reputation-BYWC8k3t.js} +1 -1
- package/src/assets/web-panel/assets/{Row-DoD3nauz.js → Row-Bv7Y68ai.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-BlMKhrqt.js → RssFeed-Ba54MKvz.js} +1 -1
- package/src/assets/web-panel/assets/{Search-D4MaHzRS.js → Search-B9EkRkZK.js} +1 -1
- package/src/assets/web-panel/assets/{Security-DMpqDgSc.js → Security-DuXQGU4o.js} +1 -1
- package/src/assets/web-panel/assets/{Services-C9yzBSd8.js → Services-DJnCtY8x.js} +1 -1
- package/src/assets/web-panel/assets/{Skeleton-h8kJILZh.js → Skeleton-BVDdtf_S.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-jXdYN4vu.js → Skills-DGkYCesm.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-Cuk7apSe.js → Sla-CHND6lwC.js} +1 -1
- package/src/assets/web-panel/assets/{SpeechSettings-B5hPI4N_.js → SpeechSettings-Bg0Bgy9c.js} +1 -1
- package/src/assets/web-panel/assets/{SyncSettings-MGyaOfUD.js → SyncSettings-DwtcZ2Ml.js} +1 -1
- package/src/assets/web-panel/assets/{Tasks-BSqf89Jx.js → Tasks-BoHc0cP2.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-BYjHba7u.js → Templates-DAMs4m8X.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-CEkhV7yX.js → Tenant-DkVQbOzT.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-D2deCxuf.js → Terminal-BTOLM8Yu.js} +1 -1
- package/src/assets/web-panel/assets/{TimelineRenderer-C8YVFoC3.js → TimelineRenderer-BO5ZyxUU.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-DN-S9EsT.js → Tokens-D0LjCtSA.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-F6LwAuyn.js → Trigger-DgGXg9VB.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-Cx8jhn1i.js → Trust-BAEQrND-.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-BN--f0JV.js → UkeySign-TtBclFRw.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-i32OtN88.js → VideoEditing-ByxvpIpS.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-DQImHu1X.js → Wallet-CTa7jqur.js} +1 -1
- package/src/assets/web-panel/assets/{WebAuthn-5waEqMup.js → WebAuthn-oHbCSjrD.js} +1 -1
- package/src/assets/web-panel/assets/{WorkflowEditor-Bh0xyyOO.js → WorkflowEditor-DQKQAdUS.js} +1 -1
- package/src/assets/web-panel/assets/{chat-EXJ3Usf5.js → chat-BcCU2FuK.js} +1 -1
- package/src/assets/web-panel/assets/{colors-Cdoap8Z7.js → colors-BcXAFjHT.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-QPjKEhW_.js → compact-item-GhZzQppm.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-BOGUY650.js → createContext-Bc6nwTUy.js} +1 -1
- package/src/assets/web-panel/assets/{hasIn-DRN_I25i.js → hasIn-DRH8Xt0Y.js} +1 -1
- package/src/assets/web-panel/assets/{index-BoDNVZfc.js → index-60aCmptm.js} +1 -1
- package/src/assets/web-panel/assets/{index-B_J_PUwW.js → index-B7hScRVB.js} +1 -1
- package/src/assets/web-panel/assets/{index-BeRxNc4x.js → index-BDIN9KWp.js} +1 -1
- package/src/assets/web-panel/assets/{index-DAuglUM-.js → index-BEQha9Ur.js} +1 -1
- package/src/assets/web-panel/assets/{index-BFh62a_Z.js → index-BFFyqn3k.js} +1 -1
- package/src/assets/web-panel/assets/{index-jo9saD-R.js → index-BOquBdmK.js} +1 -1
- package/src/assets/web-panel/assets/{index-9hwjpOFE.js → index-BQ6b5kJR.js} +1 -1
- package/src/assets/web-panel/assets/{index-BvX72fLD.js → index-BaUmYzDB.js} +1 -1
- package/src/assets/web-panel/assets/{index-Dusibyek.js → index-Bb5XCEKT.js} +1 -1
- package/src/assets/web-panel/assets/{index-D_pIGWDh.js → index-BdOccG1D.js} +1 -1
- package/src/assets/web-panel/assets/{index-shByGhT7.js → index-Bebe5WYu.js} +1 -1
- package/src/assets/web-panel/assets/index-BlS3EjXM.js +1 -0
- package/src/assets/web-panel/assets/{index-DULwfIin.js → index-BsRmNZCk.js} +1 -1
- package/src/assets/web-panel/assets/{index-15P436aq.js → index-CB1Thk9t.js} +1 -1
- package/src/assets/web-panel/assets/{index-B_pCKR-k.js → index-CSHz8UnK.js} +1 -1
- package/src/assets/web-panel/assets/{index-_fW5KelD.js → index-Cexk6Y1r.js} +1 -1
- package/src/assets/web-panel/assets/{index-BRo2j8Jz.js → index-CtC-B6Zy.js} +1 -1
- package/src/assets/web-panel/assets/{index-DID83zEQ.js → index-D08s-CJ_.js} +1 -1
- package/src/assets/web-panel/assets/{index-DzUL46rU.js → index-D6B_ELy6.js} +1 -1
- package/src/assets/web-panel/assets/{index-CXP_MepL.js → index-D6pWvvp-.js} +1 -1
- package/src/assets/web-panel/assets/{index-BmVIyCgf.js → index-D9QfJDQg.js} +1 -1
- package/src/assets/web-panel/assets/{index-DISFHFjT.js → index-DCCEt-pU.js} +1 -1
- package/src/assets/web-panel/assets/{index-iYCp3otx.js → index-DCgr2bDL.js} +1 -1
- package/src/assets/web-panel/assets/{index-DBb3W3bA.js → index-DNi_t23H.js} +1 -1
- package/src/assets/web-panel/assets/{index-DfXsHnc0.js → index-DOBzu5UO.js} +1 -1
- package/src/assets/web-panel/assets/{index-BFXhCqpm.js → index-DOtNt1m7.js} +1 -1
- package/src/assets/web-panel/assets/{index-FBoQQHLy.js → index-DQnXn3vs.js} +1 -1
- package/src/assets/web-panel/assets/{index-Lwktngzr.js → index-DXip1xUj.js} +1 -1
- package/src/assets/web-panel/assets/{index-C33cfAQE.js → index-DoRIPzwv.js} +1 -1
- package/src/assets/web-panel/assets/index-DwIMwROa.js +1 -0
- package/src/assets/web-panel/assets/{index-hmILMYKF.js → index-Dzh9Ud2R.js} +3 -3
- package/src/assets/web-panel/assets/{index-kc4lgpMy.js → index-DzhMohzV.js} +1 -1
- package/src/assets/web-panel/assets/{index-6KPTDWDG.js → index-IW9dUJK_.js} +1 -1
- package/src/assets/web-panel/assets/{index-6nTP4-QK.js → index-WrMfehhj.js} +1 -1
- package/src/assets/web-panel/assets/{index-DNpnprSx.js → index-gvsatTPZ.js} +1 -1
- package/src/assets/web-panel/assets/{index-CafxYv7t.js → index-lEDZUWRO.js} +1 -1
- package/src/assets/web-panel/assets/{index-CVJG_i6e.js → index-mqlLcSgP.js} +1 -1
- package/src/assets/web-panel/assets/{index-L3zdSmTh.js → index-owU4npmQ.js} +1 -1
- package/src/assets/web-panel/assets/{index-CKfdYM3I.js → index-wnmY4P7_.js} +1 -1
- package/src/assets/web-panel/assets/{initDefaultProps-Bno49hyl.js → initDefaultProps-DfHPrIA5.js} +1 -1
- package/src/assets/web-panel/assets/{motion-Cs9KpFRZ.js → motion-CCzrK3c5.js} +1 -1
- package/src/assets/web-panel/assets/{move-DN2kt6Fk.js → move-B2uu6I9f.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-IXnfFKcF.js → mtc-parser-DtFu2-C_.js} +1 -1
- package/src/assets/web-panel/assets/{omit-ULuXK3m0.js → omit-BFjLuAHb.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-B3f1sg_2.js → pickAttrs-DfsjYq45.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-CB3ISXbH.js → placementArrow-CDdYIVXw.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-BhRD48Wz.js → responsiveObserve-CfrplFjn.js} +1 -1
- package/src/assets/web-panel/assets/{slide-B4qkLP8K.js → slide-DHNX5Xwt.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-KfItOu2F.js → statusUtils-BI-C3SSk.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-BeLQUf-Z.js → styleChecker-C5Y3Oyy2.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-CPIJfd28.js → useFlexGapSupport-atF45w0U.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-CUBjOVdy.js → useFs-C4M8-xm9.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-DEKScTxs.js → usePersonalDataHub-jjZdnfs_.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-DhNnfLeH.js → vnode-BRTSCmU3.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-D5rdpCyb.js → zoom-BaS5ZYRC.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/data/changelog.json +78 -0
- package/src/lib/evolution/evolution-artifact-ports.js +304 -0
- package/src/lib/evolution/evolution-file-retained-segment-backend.js +291 -0
- package/src/lib/evolution/evolution-file-witness.js +46 -4
- package/src/lib/evolution/evolution-immutable-ledger-segment-store.js +112 -0
- package/src/lib/evolution/evolution-ledger-manifest-chain.js +65 -1
- package/src/lib/evolution/evolution-ledger-manifest-witness-adapter.js +19 -2
- package/src/lib/evolution/evolution-ledger-v2-journal.js +115 -0
- package/src/lib/evolution/evolution-ledger-v2-manifest-backend.js +242 -1
- package/src/lib/evolution/evolution-ledger.js +215 -27
- package/src/lib/evolution/evolution-witness-contracts.js +5 -0
- package/src/lib/evolution/evolution-witness-segments.js +2 -0
- package/src/lib/evolution/rrsi-observed-text-index.js +171 -9
- package/src/lib/evolution/rrsi-tenant-index-anchor-history.js +20 -0
- package/src/lib/lk-account-api.cjs +14 -2
- package/src/lib/lk-model-catalog.json +919 -467
- package/src/lib/llm-channel-presets.js +27 -8
- package/src/lib/llm-connection-config.js +6 -1
- package/src/lib/llm-connection-resolution.js +3 -1
- package/src/lib/llm-onboarding-catalog.json +16 -16
- package/src/lib/read-file-loop-guard.js +36 -12
- package/src/assets/web-panel/assets/Providers-DVyNl0mO.css +0 -1
- package/src/assets/web-panel/assets/Providers-TFpSkyej.js +0 -1
- package/src/assets/web-panel/assets/index-BFYVw5aJ.js +0 -1
- package/src/assets/web-panel/assets/index-wtySft9h.js +0 -1
|
@@ -3,13 +3,29 @@ import catalog from "./lk-model-catalog.json" with { type: "json" };
|
|
|
3
3
|
|
|
4
4
|
export const LK_MODELS = catalog.models;
|
|
5
5
|
|
|
6
|
+
// Keep existing saved connections usable when the provider renames a public
|
|
7
|
+
// alias. New UI selections always use the current catalog IDs.
|
|
8
|
+
export const LK_MODEL_ALIASES = Object.freeze({
|
|
9
|
+
"tt-6.1-sol": "gpt-6.1-sol",
|
|
10
|
+
"tt-6-luna": "gpt-6-luna",
|
|
11
|
+
"fb-5-2": "claude-fable-5-2",
|
|
12
|
+
"gem-3.8-flash": "gemini-3.8-flash",
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export function canonicalLkModel(model) {
|
|
16
|
+
const value = typeof model === "string" ? model.trim() : "";
|
|
17
|
+
return Object.hasOwn(LK_MODEL_ALIASES, value)
|
|
18
|
+
? LK_MODEL_ALIASES[value]
|
|
19
|
+
: value;
|
|
20
|
+
}
|
|
21
|
+
|
|
6
22
|
export const LK_CHANNEL = {
|
|
7
23
|
id: "lk",
|
|
8
24
|
name: "LK API",
|
|
9
|
-
documentationUrl: "https://
|
|
10
|
-
pricingUrl: "https://
|
|
25
|
+
documentationUrl: "https://chainlesschain.net/apidoc",
|
|
26
|
+
pricingUrl: "https://chainlesschain.net/api/pricing",
|
|
11
27
|
addresses: {
|
|
12
|
-
primary: "https://api.
|
|
28
|
+
primary: "https://api.vv666.ai",
|
|
13
29
|
backup: "https://api.lk666.ai",
|
|
14
30
|
},
|
|
15
31
|
protocols: {
|
|
@@ -17,19 +33,19 @@ export const LK_CHANNEL = {
|
|
|
17
33
|
label: "OpenAI 兼容",
|
|
18
34
|
provider: "custom",
|
|
19
35
|
basePath: "/v1",
|
|
20
|
-
defaultModel: "
|
|
36
|
+
defaultModel: "gpt-6.1-sol",
|
|
21
37
|
},
|
|
22
38
|
anthropic: {
|
|
23
39
|
label: "Anthropic 兼容 (FB-5.2)",
|
|
24
40
|
provider: "anthropic",
|
|
25
41
|
basePath: "/v1",
|
|
26
|
-
defaultModel: "
|
|
42
|
+
defaultModel: "claude-opus-5-5",
|
|
27
43
|
},
|
|
28
44
|
gemini: {
|
|
29
45
|
label: "Gemini 兼容",
|
|
30
46
|
provider: "gemini",
|
|
31
47
|
basePath: "/v1beta",
|
|
32
|
-
defaultModel: "
|
|
48
|
+
defaultModel: "gemini-4-carbon",
|
|
33
49
|
},
|
|
34
50
|
},
|
|
35
51
|
endpoints: {
|
|
@@ -74,7 +90,10 @@ export function resolveLkConnection(
|
|
|
74
90
|
? LK_CHANNEL.addresses[address]
|
|
75
91
|
: null;
|
|
76
92
|
if (!definition || !origin) throw new Error("Unknown LK protocol or address");
|
|
77
|
-
const
|
|
93
|
+
const selectedModel = canonicalLkModel(
|
|
94
|
+
model || definition.defaultModel || "",
|
|
95
|
+
);
|
|
96
|
+
const knownModel = LK_MODELS.find((entry) => entry.id === selectedModel);
|
|
78
97
|
if (
|
|
79
98
|
knownModel &&
|
|
80
99
|
(knownModel.type !== "chat" ||
|
|
@@ -87,6 +106,6 @@ export function resolveLkConnection(
|
|
|
87
106
|
return {
|
|
88
107
|
provider: definition.provider,
|
|
89
108
|
baseUrl: origin + basePath,
|
|
90
|
-
model:
|
|
109
|
+
model: selectedModel,
|
|
91
110
|
};
|
|
92
111
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { BUILT_IN_PROVIDERS } from "./llm-providers.js";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { normalizeOllamaBaseUrl } from "./ollama-base-url.js";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
canonicalLkModel,
|
|
6
|
+
isLkEndpoint,
|
|
7
|
+
resolveLkConnection,
|
|
8
|
+
} from "./llm-channel-presets.js";
|
|
5
9
|
import {
|
|
6
10
|
setSecretConfigValue,
|
|
7
11
|
updateConfigAtomically,
|
|
@@ -73,6 +77,7 @@ export function normalizeLlmConnection(input) {
|
|
|
73
77
|
);
|
|
74
78
|
value.baseUrl = url.href.replace(/\/+$/, "");
|
|
75
79
|
if (isLkEndpoint(value.baseUrl)) {
|
|
80
|
+
value.model = canonicalLkModel(value.model);
|
|
76
81
|
const expected = resolveLkConnection(
|
|
77
82
|
["custom", "openai"].includes(value.provider) ? "openai" : value.provider,
|
|
78
83
|
"primary",
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
normalizeProviderBaseUrl,
|
|
6
6
|
} from "./provider-protocol.js";
|
|
7
7
|
import { resolveApiKeyFromHelper } from "./api-key-helper.js";
|
|
8
|
+
import { canonicalLkModel, isLkEndpoint } from "./llm-channel-presets.js";
|
|
8
9
|
|
|
9
10
|
const DEFAULT_PROVIDER = "ollama";
|
|
10
11
|
const DEFAULT_OLLAMA_BASE_URL = "http://localhost:11434";
|
|
@@ -63,12 +64,13 @@ export function resolveLlmConnection(
|
|
|
63
64
|
normalizeLlmEndpoint(provider, sourceBaseUrl) === normalizedBaseUrl
|
|
64
65
|
);
|
|
65
66
|
});
|
|
66
|
-
|
|
67
|
+
let model =
|
|
67
68
|
(nonEmpty(options.model) && options.model) ||
|
|
68
69
|
endpointSources.find((source) => nonEmpty(source.model))?.model ||
|
|
69
70
|
defaultModel ||
|
|
70
71
|
definition?.models?.[0] ||
|
|
71
72
|
null;
|
|
73
|
+
if (isLkEndpoint(baseUrl)) model = canonicalLkModel(model);
|
|
72
74
|
assertCustomProviderConnection(provider, { baseUrl, model });
|
|
73
75
|
let apiKey =
|
|
74
76
|
(nonEmpty(options.apiKey) && options.apiKey) ||
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
"accountVerified": false,
|
|
7
7
|
"providers": [
|
|
8
8
|
{
|
|
9
|
-
"id": "
|
|
10
|
-
"label": "
|
|
11
|
-
"cliLabel": "
|
|
12
|
-
"baseUrl": "
|
|
13
|
-
"defaultModel": "
|
|
14
|
-
"needsKey":
|
|
15
|
-
"visionModel": "
|
|
9
|
+
"id": "custom",
|
|
10
|
+
"label": "Local compute / OpenAI compatible (LEXDATA / vLLM / SGLang)",
|
|
11
|
+
"cliLabel": "本地算力平台 / OpenAI 兼容 (力数/vLLM/SGLang等)",
|
|
12
|
+
"baseUrl": "",
|
|
13
|
+
"defaultModel": "",
|
|
14
|
+
"needsKey": false,
|
|
15
|
+
"visionModel": ""
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"id": "ollama",
|
|
@@ -23,6 +23,15 @@
|
|
|
23
23
|
"needsKey": false,
|
|
24
24
|
"visionModel": ""
|
|
25
25
|
},
|
|
26
|
+
{
|
|
27
|
+
"id": "volcengine",
|
|
28
|
+
"label": "Volcengine / Doubao (volcengine)",
|
|
29
|
+
"cliLabel": "Volcengine (火山引擎/豆包)",
|
|
30
|
+
"baseUrl": "https://ark.cn-beijing.volces.com/api/v3",
|
|
31
|
+
"defaultModel": "deepseek-v4-1-flash-economy-261017",
|
|
32
|
+
"needsKey": true,
|
|
33
|
+
"visionModel": "doubao-seed-2-0-lite-260215"
|
|
34
|
+
},
|
|
26
35
|
{
|
|
27
36
|
"id": "anthropic",
|
|
28
37
|
"label": "Anthropic Claude",
|
|
@@ -118,15 +127,6 @@
|
|
|
118
127
|
"defaultModel": "gemini-2.0-flash",
|
|
119
128
|
"needsKey": true,
|
|
120
129
|
"isProxy": true
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"id": "custom",
|
|
124
|
-
"label": "Local compute / OpenAI compatible (LEXDATA / vLLM / SGLang)",
|
|
125
|
-
"cliLabel": "本地算力平台 / OpenAI 兼容 (力数/vLLM/SGLang等)",
|
|
126
|
-
"baseUrl": "",
|
|
127
|
-
"defaultModel": "",
|
|
128
|
-
"needsKey": false,
|
|
129
|
-
"visionModel": ""
|
|
130
130
|
}
|
|
131
131
|
]
|
|
132
132
|
}
|
|
@@ -521,24 +521,48 @@ export class ReadFileLoopGuard {
|
|
|
521
521
|
if (result?.readProgress?.newContent === true) this.batch.advanced = true;
|
|
522
522
|
if (result?.readProgress?.newContent === false) this.batch.duplicates++;
|
|
523
523
|
} else if (
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
hostToolOutputIdentity(result)?.chars >= 8000)
|
|
524
|
+
tool === "run_code" ||
|
|
525
|
+
tool === "run_shell" ||
|
|
526
|
+
tool === "check_shell"
|
|
528
527
|
) {
|
|
529
528
|
// Arbitrary code may just dump the same file again. Compare returned
|
|
530
529
|
// evidence, not code spelling or timings. Never cache/skip execution:
|
|
531
530
|
// identical stdout does not imply identical filesystem side effects.
|
|
531
|
+
// Foreground shell output is normalized to `output`, while background
|
|
532
|
+
// polling exposes the same evidence as stdout/stderr. Inspect all
|
|
533
|
+
// supported fields so check_shell cannot bypass the repeated-output
|
|
534
|
+
// backstop merely by using a different transport shape.
|
|
535
|
+
const outputParts = [
|
|
536
|
+
result?.output,
|
|
537
|
+
result?.stdout,
|
|
538
|
+
result?.stderr,
|
|
539
|
+
].filter((value) => typeof value === "string");
|
|
540
|
+
const output = outputParts.length ? outputParts.join("\n") : null;
|
|
532
541
|
const identity = hostToolOutputIdentity(result);
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
if (
|
|
537
|
-
|
|
538
|
-
|
|
542
|
+
// A JSON-cloned preview has no host-owned identity. Treat a short
|
|
543
|
+
// untrusted preview as fresh evidence so it cannot preserve a previous
|
|
544
|
+
// duplicate batch count or borrow the original output fingerprint.
|
|
545
|
+
if (
|
|
546
|
+
output !== null &&
|
|
547
|
+
output.length < 8000 &&
|
|
548
|
+
!(identity?.chars >= 8000)
|
|
549
|
+
) {
|
|
539
550
|
this.batch.advanced = true;
|
|
540
|
-
|
|
541
|
-
|
|
551
|
+
}
|
|
552
|
+
if (
|
|
553
|
+
output !== null &&
|
|
554
|
+
(output.length >= 8000 || identity?.chars >= 8000)
|
|
555
|
+
) {
|
|
556
|
+
const fingerprint = identity
|
|
557
|
+
? `${identity.chars}:${identity.digest}`
|
|
558
|
+
: createHash("sha256").update(output).digest("hex");
|
|
559
|
+
if (this.largeOutputs.has(fingerprint)) this.batch.duplicates++;
|
|
560
|
+
else {
|
|
561
|
+
this.largeOutputs.add(fingerprint);
|
|
562
|
+
this.batch.advanced = true;
|
|
563
|
+
while (this.largeOutputs.size > 64)
|
|
564
|
+
this.largeOutputs.delete(this.largeOutputs.values().next().value);
|
|
565
|
+
}
|
|
542
566
|
}
|
|
543
567
|
} else if (actionable && !EXPLORATION_TOOLS.has(tool)) {
|
|
544
568
|
this.batch.substantive = true;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.providers-grid[data-v-e55b9eae]{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px}.provider-card[data-v-e55b9eae]{border:1px solid var(--border-color)!important;transition:border-color .2s}.provider-card[data-v-e55b9eae]:hover{border-color:var(--text-muted)!important}.provider-card.active[data-v-e55b9eae]{border-color:#52c41a!important;background:#29a27014!important}.section-title[data-v-e55b9eae]{color:var(--text-primary, #ccc);font-size:16px;font-weight:500;margin:0}.config-card[data-v-e55b9eae]{border-radius:8px}.config-card[data-v-e55b9eae] .ant-card-body{padding:24px}.config-form[data-v-e55b9eae] .ant-form-item-label>label{color:var(--text-secondary, #aaa);font-size:13px}.config-form[data-v-e55b9eae] .ant-input,.config-form[data-v-e55b9eae] .ant-input-password input,.config-form[data-v-e55b9eae] .ant-input-number,.config-form[data-v-e55b9eae] .ant-select-selector{background:var(--bg-card-hover, #1a1a1a)!important;border-color:var(--border-color, #333)!important;color:var(--text-primary, #e0e0e0)!important}.config-form[data-v-e55b9eae] .ant-input::placeholder,.config-form[data-v-e55b9eae] .ant-input-password input::placeholder{color:var(--text-muted, #555)!important}.config-form[data-v-e55b9eae] .ant-input-number-input,.config-form[data-v-e55b9eae] .ant-select-selection-item{color:var(--text-primary, #e0e0e0)!important}.config-form[data-v-e55b9eae] .ant-select-arrow{color:var(--text-muted, #555)}.config-form[data-v-e55b9eae] .ant-slider-rail{background:var(--border-color, #333)}.config-form[data-v-e55b9eae] .ant-slider-track{background:#1890ff}.config-form[data-v-e55b9eae] .ant-slider-handle{border-color:#1890ff}.config-form[data-v-e55b9eae] .ant-input-password-icon{color:var(--text-muted, #555)}.config-grid[data-v-e55b9eae]{display:grid;grid-template-columns:repeat(2,1fr);gap:0 24px}@media(max-width:640px){.config-grid[data-v-e55b9eae]{grid-template-columns:1fr}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{E as Co,r as K,f as Q,a as Ko,w as bo,K as h,L as y,Q as _,N as n,c as s,O as f,R as u,S as I,M as z,F as J,P as x,o as To,u as o,Y as So,Z as Io,j as no}from"./vendor-BXcBOG8b.js";import{u as oo,_ as Uo,d as Z}from"./index-hmILMYKF.js";import{a as Oo,b as Vo}from"./parsers-DftYMnlk.js";import{R as uo}from"./icons-DlxlFL4g.js";const Do=Co("providers",()=>{const d=K(!1),i=K(null),p=K([]),t=K([]),g=K(null);async function a(){const c=oo();d.value=!0;try{const{output:k}=await c.execute("llm providers",15e3);p.value=Oo(k);const w=p.value.find(m=>m.active);w&&(g.value=w.name);const{output:T}=await c.execute("llm models",15e3);t.value=Vo(T)}catch(k){console.error("Failed to load providers:",k)}finally{d.value=!1}}async function S(c){await oo().execute(`llm switch ${c}`,1e4),p.value.forEach(w=>w.active=w.name===c),g.value=c}async function P(c){const k=oo();i.value=c;try{const{output:w,exitCode:T}=await k.execute("llm test",3e4),m=p.value.find($=>$.name===c);return m&&(m.status=T===0?"ok":"error"),T===0}catch{const w=p.value.find(T=>T.name===c);return w&&(w.status="error"),!1}finally{i.value=null}}return{loading:d,testing:i,providers:p,localModels:t,activeProvider:g,loadProviders:a,switchProvider:S,testProvider:P}});async function vo(d){await d.waitConnected?.(8e3);const i=await d.sendRaw({type:"llm-config-get"},15e3);if(i?.success!==!0||!i.config)throw new Error("无法读取连接配置");return i.config}async function Lo(d,i){await d.waitConnected?.(8e3);const p=await d.sendRaw({type:"llm-configure",connection:i},15e3);if(p?.success!==!0)throw new Error(p?.message||"连接保存失败");return p.config}const $o={id:"lk",name:"LK API",documentationUrl:"https://quexuan.net/apidoc",pricingUrl:"https://quexuan.net/api/pricing",addresses:{primary:"https://api.lk888.ai",backup:"https://api.lk666.ai"},protocols:{openai:{label:"OpenAI 兼容",provider:"custom",basePath:"/v1",defaultModel:"tt-6-luna"},anthropic:{label:"Anthropic 兼容 (FB-5.2)",provider:"anthropic",basePath:"/v1",defaultModel:"fb-5-2"},gemini:{label:"Gemini 兼容",provider:"gemini",basePath:"/v1beta",defaultModel:"gem-3.8-flash"}},endpoints:{chat:"/v1/chat/completions",responses:"/v1/responses",models:"/v1/models",images:"/v1/images/generations",imageEdits:"/v1/images/edits",messages:"/v1/messages",gemini:"/v1beta/models/{model}:generateContent",mediaGenerate:"/v1/media/generate",mediaStatus:"/v1/media/status?task_id={task_id}",mediaModels:"/v1/media/models",skills:"/v1/skills",skillsModels:"/v1/skills/models",pricing:"/v1/skills/models/{model_name}/pricing",balance:"/v1/skills/balance",usage:"/v1/skills/usage",taskStatus:"/v1/skills/task-status",feedback:"/v1/skills/feedback"}},qo=JSON.parse('[{"id":"gem-3.8-flash","label":"GEM 3.8 flash","type":"chat","protocol":"gemini","compatibleProtocols":["gemini"]},{"id":"gem-4-carbon","label":"GEM 4 carbon","type":"chat","protocol":"gemini","compatibleProtocols":["gemini"]},{"id":"tt-6-luna","label":"TT-6 luna","type":"chat","protocol":"openai","compatibleProtocols":["openai","openai_responses"]},{"id":"kimi-k3","label":"Kimi K3","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"tt-6.1-terra","label":"TT-6.1 terra","type":"chat","protocol":"openai","compatibleProtocols":["openai","openai_responses"]},{"id":"fb-5-2","label":"FB-5.2","type":"chat","protocol":"anthropic","compatibleProtocols":["anthropic"]},{"id":"hk-5-5","label":"HK-5.5","type":"chat","protocol":"anthropic","compatibleProtocols":["anthropic"]},{"id":"gem-4-argon","label":"GEM 4 argon","type":"chat","protocol":"gemini","compatibleProtocols":["gemini"]},{"id":"tt-6.1-sol","label":"TT-6.1 sol","type":"chat","protocol":"openai","compatibleProtocols":["openai","openai_responses"]},{"id":"tt-6-astra","label":"TT-6 astra","type":"chat","protocol":"openai","compatibleProtocols":["openai","openai_responses"]},{"id":"gem-3.5-flash","label":"GEM 3.5 flash","type":"chat","protocol":"gemini","compatibleProtocols":["gemini"]},{"id":"tt-5.6-sol","label":"TT-5.6 sol","type":"chat","protocol":"openai","compatibleProtocols":["openai","openai_responses"]},{"id":"gem-3.1-pro","label":"GEM 3.1 Pro","type":"chat","protocol":"gemini","compatibleProtocols":["gemini"]},{"id":"op-5-5","label":"OP-5.5","type":"chat","protocol":"anthropic","compatibleProtocols":["anthropic"]},{"id":"kimi-k3.1-pro","label":"Kimi K3.1 Pro","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"gem-3.7-flash","label":"GEM 3.7 flash","type":"chat","protocol":"gemini","compatibleProtocols":["gemini"]},{"id":"tt-5.5","label":"TT-5.5","type":"chat","protocol":"openai","compatibleProtocols":["openai","openai_responses"]},{"id":"deepseek-v4.1-flash","label":"DS-V4.1-Flash","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"MiniMax-M3.1-Flash","label":"MiniMax-M3.1-Flash","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"fb-5","label":"FB-5","type":"chat","protocol":"anthropic","compatibleProtocols":["anthropic"]},{"id":"tt-5.6-luna","label":"TT-5.6 luna","type":"chat","protocol":"openai","compatibleProtocols":["openai","openai_responses"]},{"id":"tt-5.4","label":"TT-5.4","type":"chat","protocol":"openai","compatibleProtocols":["openai","openai_responses"]},{"id":"gem-3.6-flash","label":"GEM 3.6 flash","type":"chat","protocol":"gemini","compatibleProtocols":["gemini"]},{"id":"deepseek-v4-pro","label":"DS-V4-Pro","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"tt-6-sol","label":"TT-6 sol","type":"chat","protocol":"openai","compatibleProtocols":["openai","openai_responses"]},{"id":"doubao-seed-2-1-pro-260628","label":"豆包 Seed 2.1 Pro","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"fb-5-1","label":"FB-5.1","type":"chat","protocol":"anthropic","compatibleProtocols":["anthropic"]},{"id":"op-5","label":"OP-5","type":"chat","protocol":"anthropic","compatibleProtocols":["anthropic"]},{"id":"qwen3.8-max","label":"千问 3.8 Max","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"tt-5.6-terra","label":"TT-5.6 terra","type":"chat","protocol":"openai","compatibleProtocols":["openai","openai_responses"]},{"id":"op-4-8","label":"OP-4.8","type":"chat","protocol":"anthropic","compatibleProtocols":["anthropic"]},{"id":"glm-5.3","label":"GLM-5.3","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"gem-3-pro","label":"GEM 3 Pro","type":"chat","protocol":"gemini","compatibleProtocols":["gemini"]},{"id":"op-4-6","label":"OP-4.6","type":"chat","protocol":"anthropic","compatibleProtocols":["anthropic"]},{"id":"sn-5-5","label":"SN-5.5","type":"chat","protocol":"anthropic","compatibleProtocols":["anthropic"]},{"id":"doubao-seed-2-0-pro-260215","label":"豆包 Seed 2.0 Pro","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"deepseek-v4-flash","label":"DS-V4-Flash","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"glm-5.3-flash","label":"GLM-5.3 Flash","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"gk-4.6","label":"GK-4.6","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"sn-5","label":"SN-5","type":"chat","protocol":"anthropic","compatibleProtocols":["anthropic"]},{"id":"deepseek-v4-flash-vision-exp","label":"DS-V4-Flash-Vision-Exp","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"qwen3.8-max-0902","label":"千问 3.8 Max 0902","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"op-4-7","label":"OP-4.7","type":"chat","protocol":"anthropic","compatibleProtocols":["anthropic"]},{"id":"deepseek-v4-pro-0813","label":"DS-V4-Pro-0813","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"gk-4.7","label":"GK-4.7","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"tt-5.4-mini","label":"TT-5.4 mini","type":"chat","protocol":"openai","compatibleProtocols":["openai","openai_responses"]},{"id":"doubao-seed-2-1-turbo-260628","label":"豆包 Seed 2.1 Turbo","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"qwen3.8-flash","label":"千问 3.8 Flash","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"kimi-k2.6","label":"Kimi K2.6","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"glm-5.3-flashx","label":"GLM-5.3 FlashX","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"tt-4o","label":"TT-4o","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"glm-5.2","label":"GLM-5.2","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"tt-5.2","label":"TT-5.2 Codex","type":"chat","protocol":"openai","compatibleProtocols":["openai","openai_responses"]},{"id":"hk-4.5","label":"HK-4.5","type":"chat","protocol":"anthropic","compatibleProtocols":["anthropic"]},{"id":"sn-4-6","label":"SN-4.6","type":"chat","protocol":"anthropic","compatibleProtocols":["anthropic"]},{"id":"MiniMax-M3","label":"MiniMax-M3","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"gk-4.5","label":"GK-4.5","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"qwen3.7-max","label":"千问 3.7 Max","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"gem-3.1-flash","label":"GEM 3.1 flash","type":"chat","protocol":"gemini","compatibleProtocols":["gemini"]},{"id":"kimi/kimi-k2.7-code-highspeed","label":"Kimi K2.7 Code 高速版","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"deepseek-v4-flash-0731","label":"DS-V4-Flash-0731","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"op-4-5","label":"OP-4.5","type":"chat","protocol":"anthropic","compatibleProtocols":["anthropic"]},{"id":"kimi/kimi-k2.7-code","label":"Kimi K2.7 Code","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"deepseek-v3.2","label":"DS-V3.2","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"doubao-seed-evolving","label":"豆包 Seed Evolving","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"gk-4-20","label":"GK-4-20","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"stepfun/step-3.7-flash","label":"Step 3.7 Flash","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"mimo-v2.5-pro","label":"mimo-v2.5-pro","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"mimo-v2.6-pro","label":"mimo-v2.6-pro","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"gem-3.5-flash-lite","label":"GEM 3.5 flash lite","type":"chat","protocol":"gemini","compatibleProtocols":["gemini"]},{"id":"qwen3.5-plus","label":"千问 3.5 Plus","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"gem-3-flash","label":"GEM 3 flash","type":"chat","protocol":"gemini","compatibleProtocols":["gemini"]},{"id":"qwen3.5-flash","label":"千问 3.5 Flash","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"qwen3.6-plus","label":"千问 3.6 Plus","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"tt-5.4-nano","label":"TT-5.4 nano","type":"chat","protocol":"openai","compatibleProtocols":["openai","openai_responses"]},{"id":"qwen3.8-flash-next","label":"千问 3.8 Flash Next","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"qwen3.7-plus","label":"千问 3.7 Plus","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"MiniMax-M2.7","label":"MiniMax-M2.7","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"doubao-seed-character-260628","label":"豆包·虚拟陪伴","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"gk-4.3","label":"GK-4.3","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"doubao-seed-1-8-251228","label":"豆包 Seed 1.8","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"qwen3.6-flash","label":"千问 3.6 Flash","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"gk-build-0.1","label":"GK-build-0.1","type":"chat","protocol":"openai","compatibleProtocols":["openai"]},{"id":"tt-image-2.5","label":"TT Image 2.5","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"tt-image-2.5-token","label":"TT Image 2.5 官转","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"tt-image-2","label":"TT Image 2","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"tt-image-2.6","label":"TT Image 2.6","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"tt-image-2.6-guan","label":"TT Image 2.6 官转","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"minimax-h3-image","label":"MiniMax H3 图像","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"doubao-seedream-5-5-261028","label":"即梦 5.5","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"banana-2.1","label":"纳米香蕉 2.1 按次","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"banana-2.1-token","label":"纳米香蕉 2.1 官转","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"tt-image-2-token","label":"TT Image 2 官转","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"banana-pro","label":"纳米香蕉 Pro","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"banana-2","label":"纳米香蕉 2","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"doubao-seedream-5-0-pro-260628","label":"即梦 5.0 Pro","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"banana-pro-token","label":"纳米香蕉 Pro Token版","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"gk-image-2.0","label":"GK Image 2.0","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"banana-2-token","label":"纳米香蕉 2 Token版","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"mj_imagine","label":"Midjourney","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"vidu-image-2","label":"VIDU Iamge 2","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"doubao-seedream-5-0-260128","label":"即梦 5.0","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"wan2.7-image","label":"万相 2.7 图像","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"doubao-seedream-4-5-251128","label":"即梦 4.5","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"kling-v3-omni","label":"可灵-V3-Omni","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"qwen-image","label":"千问-image-max","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"wan2.6-image","label":"万相 2.6 图像","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"kling-v3","label":"可灵-V3","type":"image","protocol":"media","compatibleProtocols":["media"]},{"id":"seedance-2.0-anci","label":"SD 2.0 按次","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"seedance-2.5-guanfang-anmiao","label":"SD 2.5 满血版 按秒","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"gk-video-3.5","label":"GK-video-3.5","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"kling-v4-video","label":"可灵-V4-video","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"muse-video","label":"Muse Video","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"seedance-2.5-anci","label":"SD 2.5 按次","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"wand-vega-video-1.5","label":"Vega Video 1.5","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"omni-flash-1.2","label":"omni-flash-1.2","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"wand-vega-video-1.0","label":"Vega Video 1.0","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"seedance-2.5-guanfang","label":"SD 2.5 满血版","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"viduq4-preview","label":"Vidu Q4 Preview","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"kwvideo-v2-ref","label":"SD 2.0 参考生","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"minimax-h3","label":"MiniMax H3","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"seedance-2.0-guanfang","label":"SD 2.0 满血版","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"seedance-2.0-guanfang-anmiao","label":"SD 2.0 满血版 按秒","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"hailuo-h3-cankaosheng","label":"海螺 H3 参考生","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"omni_flash-10s","label":"Omni Flash 10秒","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"omni-flash","label":"omni-flash","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"kling-v3-omni-cankao","label":"可灵-Omni 参考生","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"wan3.0-video-quannengcankao","label":"万相3.0 全能参考","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"seedance-2.5-anmiao-quannengcankao","label":"SD 2.5 全能参考 按秒","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"doubao-seedance-2-5-cankaosheng","label":"SD 2.5 参考生","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"gk-video-3","label":"GK-video-3","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"wan3.0","label":"万相 3.0","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"hailuo-h3-shouweizhen","label":"海螺 H3 首尾帧","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"hailuo-h3-quannengcankao","label":"海螺 H3 全能参考","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"kwvideo-v2-quannengcankao","label":"SD 2.0 全能参考","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"kling-avatar-image2video","label":"可灵-数字人","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"hailuo-h3","label":"海螺 H3 文生视频","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"seedance-2.0-anmiao-quannengcankao","label":"SD 2.0 全能参考 按秒","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"seedance-2.5-anmiao","label":"SD 2.5 参考生 按秒","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"seedance-2.0-anmiao-cankaosheng","label":"SD 2.0 参考生 按秒","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"happyhorse-r2v","label":"快乐马-参考生","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"video-enhance","label":"视频超分","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"doubao-seedance-2-5-260628","label":"SD 2.5 文生","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"omni-1.1","label":"Omni 1.1","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"doubao-seedance-2-5-quannengcankao","label":"SD 2.5 全能参考","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"kling-v3-video","label":"可灵-V3-video","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"kwvideo-v2","label":"SD 2.0 首尾帧","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"viduq3","label":"Vidu Q3","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"viduq3-turbo-cankaosheng","label":"Vidu Q3 Turbo 参考生","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"wan3.0-video","label":"万相3.0 文生视频","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"seedance-2.0-anmiao","label":"SD 2.0 首尾帧 按秒","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"viduq3-drama","label":"Vidu Q3 Drama","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"wan3.0-video-cankaosheng","label":"万相3.0 参考生","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"kling-v3-omni-videoref","label":"可灵-Omni 视频参考","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"happyhorse-video-edit","label":"快乐马-视频编辑","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"hailuo-h3-max-shouweizhen","label":"海螺 H3 Max 首尾帧","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"hailuo-h3-max","label":"海螺 H3 Max 文生视频","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"kling-motion-control-v3","label":"可灵-动作控制 V3","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"seedance-2.5-anmiao-shouweizhen","label":"SD 2.5 首尾帧 按秒","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"pixverse-v6-shouweizhen","label":"Pix V6 首尾帧","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"minimax-h3-max","label":"MiniMax H3 Max","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"vidu-mv","label":"VIDU-音乐MV","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"vo3.1","label":"VO3.1","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"kling-motion-control","label":"可灵-动作控制","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"doubao-seedance-2-5-shouweizhen","label":"SD 2.5 首尾帧","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"kling-v3-omni-shouweizhen","label":"可灵-Omni 首尾帧","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"happyhorse-1.1-r2v","label":"快乐马1.1-参考生","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"happyhorse-1.1-t2v","label":"快乐马1.1-文生视频","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"omni_flash-10s-fl","label":"Omni Flash 首尾帧","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"wan2.2-animate-mix","label":"万相-视频换人","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"wan3.0-video-shouweizhen","label":"万相3.0 首尾帧","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"wan2.6-cankaosheng","label":"万相 2.6 参考生","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"seedance-2.5-anmiao-wensheng","label":"SD 2.5 文生 按秒","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"viduq3-turbo","label":"Vidu Q3 Turbo","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"happyhorse-t2v","label":"快乐马-文生视频","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"happyhorse-i2v","label":"快乐马-首帧","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"wan2.7-shouweizhen","label":"万相 2.7 首尾帧","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"pixverse-c1-cankaosheng","label":"Pix C1 参考生","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"pixverse-c1-shouweizhen","label":"Pix C1 首尾帧","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"viduq3-cankaosheng","label":"Vidu Q3 参考生","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"wan2.6-shouzheng","label":"万相 2.6 首帧","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"wan2.7-cankaosheng","label":"万相 2.7 参考生","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"vidu-jieshuoman","label":"VIDU-解说漫","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"happyhorse-1.1-i2v","label":"快乐马1.1-首帧","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"pixverse-v5.6-shouweizhen","label":"Pix V5.6 首尾帧","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"pixverse-v5.6-r2v","label":"Pix V5.6 参考生","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"viduq2-cankaosheng","label":"Vidu Q2 参考生","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"wan2.7-xuxie","label":"万相 2.7 视频续写","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"hailuo-h3-zaishengcheng","label":"海螺 H3 视频升2K","type":"video","protocol":"media","compatibleProtocols":["media"]},{"id":"suno-v6","label":"Suno 音乐生成 6","type":"audio","protocol":"media","compatibleProtocols":["media"]},{"id":"speech-2.8","label":"海螺 语音克隆 2.8","type":"audio","protocol":"media","compatibleProtocols":["media"]},{"id":"suno-v4.5","label":"Suno 音乐生成 4.5","type":"audio","protocol":"media","compatibleProtocols":["media"]},{"id":"music-2.5+","label":"海螺 音乐生成 2.5+","type":"audio","protocol":"media","compatibleProtocols":["media"]},{"id":"doubao-tts-2.0","label":"豆包 语音合成 2.0","type":"audio","protocol":"media","compatibleProtocols":["media"]},{"id":"gem-3.1-tts","label":"GEM-3.1-TTS","type":"audio","protocol":"media","compatibleProtocols":["media"]},{"id":"music-2.5","label":"海螺 音乐生成 2.5","type":"audio","protocol":"media","compatibleProtocols":["media"]},{"id":"gem-2.5-tts","label":"GEM-2.5-TTS","type":"audio","protocol":"media","compatibleProtocols":["media"]}]'),go={channel:$o,models:qo},j=go.channel,ho=go.models,zo=d=>String(d||"").trim().replace(/\/+$/,"");function yo(d,i,p){const t=Object.hasOwn(j.protocols,d)&&j.protocols[d],g=Object.hasOwn(j.addresses,i)&&j.addresses[i];if(!t||!g)throw new Error("请选择有效的 LK 协议与地址");const a=p||t.defaultModel,S=ho.find(P=>P.id===a);if(S&&(S.type!=="chat"||!S.compatibleProtocols.includes(d)))throw new Error("此 LK 模型不支持当前对话协议");return{provider:t.provider,model:a,baseUrl:g+t.basePath}}function eo(d){const i=d.provider==="custom"||d.provider==="openai"?"openai":d.provider,p=j.protocols[i];if(!p||!Object.hasOwn(j.protocols,i))return null;for(const[t,g]of Object.entries(j.addresses))if(zo(d.baseUrl)===g+p.basePath)return{protocol:i,address:t};return null}const W=d=>String(d||"").trim().replace(/\/+$/,""),ro=["provider","model","baseUrl","visionModel"],so=(d,i)=>ro.every(p=>p==="baseUrl"?W(d[p])===W(i[p]):String(d[p]||"")===String(i[p]||""));function Go(d,i,p){const t=K(!1),g=K(!1),a=K(!1),S=K(!1),P=K(null),c=K([]),k=K("manual"),w=K("openai"),T=K("primary"),m=Ko({provider:void 0,model:"",baseUrl:"",visionModel:"",apiKey:"",temperature:.7,maxTokens:4096,allowHttp:!1}),$=Q(()=>ho.filter(r=>r.type==="chat"&&r.compatibleProtocols.includes(w.value)).map(r=>({value:r.id,label:`${r.label} (${r.id})`}))),v=Q(()=>P.value&&m.provider===P.value.provider&&W(m.baseUrl)===W(P.value.baseUrl)),q=Q(()=>G.value?"此渠道密钥已保存 · 留空自动恢复":"输入此渠道的 API Key"),G=Q(()=>v.value&&P.value?.hasKey||c.value.some(r=>r.hasKey&&(eo(m)&&r.channel==="lk"||r.provider===m.provider&&W(r.baseUrl)===W(m.baseUrl)))),E=Q(()=>!P.value||!so(m,P.value)||!!m.apiKey.trim()),F=Q(()=>{try{const r=new URL(m.baseUrl);return r.protocol==="http:"&&!["localhost","127.0.0.1","[::1]"].includes(r.hostname)}catch{return!1}});function H(r){const b={};for(const e of[...ro,"hasKey","temperature","maxTokens"])b[e]=r[e];P.value=b,c.value=r.savedConnections||c.value,Object.assign(m,{provider:b.provider,model:b.model||"",baseUrl:b.baseUrl||"",visionModel:b.visionModel||"",apiKey:"",allowHttp:!1,temperature:b.temperature??.7,maxTokens:b.maxTokens??4096});const C=eo(b);k.value=C?"lk":"manual",C&&(w.value=C.protocol,T.value=C.address)}function N(r=!1){const b=yo(w.value,T.value,r?m.model:void 0);Object.assign(m,b,{apiKey:"",visionModel:"",allowHttp:!1})}function M(){if(m.apiKey="",k.value==="lk"){const r=c.value.find(b=>b.channel==="lk");r?X(r):N()}}function O(){m.apiKey="";const r=c.value.find(b=>b.provider===m.provider&&b.channel!=="lk");r&&X(r)}function X(r){Object.assign(m,{provider:r.provider,model:r.model,baseUrl:r.baseUrl,visionModel:r.visionModel||"",apiKey:"",allowHttp:!1});const b=eo(r);k.value=b?"lk":"manual",b&&(w.value=b.protocol,T.value=b.address)}function ao(){P.value&&H(P.value)}async function lo(){t.value=!0;try{H(await vo(d)),a.value=!0,p.success("配置已加载")}catch(r){a.value=!1,p.error(`加载配置失败: ${r.message}`)}finally{t.value=!1}}async function to(){if(!a.value||g.value)return;g.value=!0;const r=E.value,b=Object.fromEntries(ro.map(U=>[U,String(m[U]||"").trim()]));b.apiKey=m.apiKey.trim(),b.allowHttp=m.allowHttp===!0;const C=[];let e=0;try{const U=eo(b);if(U&&(yo(U.protocol,U.address,b.model),!b.apiKey&&!G.value))throw new Error("新 LK 地址需要填写渠道 API Key");for(const D of["temperature","maxTokens"]){const V=m[D];if(!Number.isFinite(V)||(D==="temperature"?V<0||V>2:!Number.isInteger(V)||V<256||V>128e3))throw new Error("请填写有效的温度和最大输出长度")}if(r){const D=await Lo(d,b);if(!D||!so(D,b))throw new Error("连接保存结果未确认,请重新加载配置");e++}for(const D of["temperature","maxTokens"]){const V=m[D];if(V!==P.value[D])try{const Y=await d.execute(`config set llm.${D} ${V}`,1e4);if(Y.exitCode!==void 0&&Y.exitCode!==0)throw new Error("写入失败");e++}catch{C.push(D)}}const A=await vo(d);if(r&&(!so(A,b)||b.apiKey&&!A.hasKey))throw new Error("保存后回读的连接不一致,请重新加载配置");H(A),C.length?p.warning(`部分参数保存失败: ${C.join(", ")}`):e?p.success("配置已保存并回读确认"):p.info("没有检测到配置变更"),r&&(S.value=!0,await i.loadProviders())}catch(U){p.error(`保存配置失败: ${U.message}`)}finally{g.value=!1}}async function io(){if(!a.value||E.value||g.value)return;await i.testProvider(m.provider)?p.success("已保存连接测试成功"):p.warning("连接测试失败,请核对账户权限、余额和协议")}return{configForm:m,configLoading:t,configSaving:g,configReady:a,showRestartHint:S,channel:k,lkProtocol:w,lkAddress:T,lkChannel:j,lkModelOptions:$,keyPlaceholder:q,savedConnections:c,selectSavedConnection:X,connectionDirty:E,remoteHttp:F,applyLk:N,handleChannelChange:M,handleProviderChange:O,loadConfig:lo,saveConfig:to,resetForm:ao,testSavedConnection:io}}const Eo={style:{"margin-top":"16px"}},Fo={__name:"LkAccount",props:{disabled:Boolean,connectionId:String},setup(d){const i=d,p=oo(),t=K(!1),g=K(""),a=K(null),S=K(1),P=K("key");let c=0;bo(()=>[i.connectionId,i.disabled],()=>{c++,a.value=null,g.value=""}),bo([S,P],()=>{c++,a.value=null,g.value=""});const k=$=>$??"未知",w=[{title:"分组",dataIndex:"name"},{title:"计费方式",dataIndex:"billingMethod"},{title:"基础价格",dataIndex:"basePrice"},{title:"输入 / 百万 Token",dataIndex:"inputPerMillion"},{title:"输出 / 百万 Token",dataIndex:"outputPerMillion"},{title:"状态",key:"state"}],T=[{title:"任务",dataIndex:"taskId"},{title:"模型",dataIndex:"model"},{title:"分组",dataIndex:"group"},{title:"状态",dataIndex:"state"},{title:"实扣算力",dataIndex:"cost"},{title:"退款",key:"refund"},{title:"时间",dataIndex:"createdAt"}];async function m($){if(t.value||i.disabled)return;const v=++c;t.value=!0,g.value="",a.value=null;try{await p.waitConnected?.(8e3);const q=await p.sendRaw({type:"llm-account",days:S.value,scope:P.value,limit:20,offset:$},2e4);if(!q?.success||!q.account)throw new Error;v===c&&(a.value=q.account)}catch{v===c&&(g.value="查询失败,请确认已保存 LK 连接及 Key 后刷新")}finally{t.value=!1}}return($,v)=>{const q=h("a-select"),G=h("a-button"),E=h("a-space"),F=h("a-alert"),H=h("a-table"),N=h("a-card");return y(),_(N,{title:"LK 动态价格与实际账单",style:{"margin-top":"24px"}},{default:n(()=>[s(E,{wrap:"",style:{"margin-bottom":"16px"}},{default:n(()=>[s(q,{value:S.value,"onUpdate:value":v[0]||(v[0]=M=>S.value=M),options:[{value:1,label:"最近 1 天"},{value:7,label:"最近 7 天"},{value:30,label:"最近 30 天"}]},null,8,["value"]),s(q,{value:P.value,"onUpdate:value":v[1]||(v[1]=M=>P.value=M),options:[{value:"key",label:"当前 Key API 用量"},{value:"user",label:"账户全部 Key API 用量"}]},null,8,["value"]),s(G,{loading:t.value,disabled:d.disabled,onClick:v[2]||(v[2]=M=>m(0))},{default:n(()=>[...v[5]||(v[5]=[f("刷新价格与余额",-1)])]),_:1},8,["loading","disabled"])]),_:1}),v[8]||(v[8]=u("p",null," 使用已保存连接的 Key 查询。金额单位为算力,价格为算力 / 百万 Token;不自动折算充值现金成本。 ",-1)),g.value?(y(),_(F,{key:0,type:"error",message:g.value},null,8,["message"])):I("",!0),a.value?(y(),z(J,{key:1},[u("p",null," 查询时间:"+x(a.value.fetchedAt)+" · "+x(a.value.origin)+" · "+x(a.value.model),1),u("p",null,[u("strong",null,"账户余额:"+x(k(a.value.balance?.balance))+" 算力",1),f(" · Key 已用:"+x(k(a.value.balance?.quota?.used))+" · Key 剩余:"+x(a.value.balance?.quota?.unlimited?"不限额":k(a.value.balance?.quota?.remaining)),1)]),u("p",null," 最近 "+x(a.value.days)+" 天"+x(a.value.scope==="user"?"全部 Key":"当前 Key")+" API 实扣:"+x(k(a.value.usage?.total?.cost))+" 算力 · 请求 "+x(k(a.value.usage?.total?.count))+" 次 ",1),a.value.partial?(y(),_(F,{key:0,type:"warning",message:Object.entries(a.value.errors).map(([M,O])=>`${M}: ${O}`).join(";")},null,8,["message"])):I("",!0),a.value.pricing?.available===!1?(y(),_(F,{key:1,type:"warning",message:"当前 Key 无此模型权限,价格仅供参考"})):I("",!0),a.value.pricing?(y(),_(H,{key:2,size:"small",pagination:!1,columns:w,"data-source":a.value.pricing?.groups||[],"row-key":(M,O)=>O,scroll:{x:650}},{bodyCell:n(({column:M,record:O})=>[M.key==="state"?(y(),z(J,{key:0},[f(x(O.active?"启用":"停用")+" / "+x(O.allowed?"Key 可用":"Key 不可用"),1)],64)):(y(),z(J,{key:1},[f(x(O[M.dataIndex]??"未知"),1)],64))]),_:1},8,["data-source","row-key"])):I("",!0),u("p",Eo," 平台账单("+x(a.value.records?.total??"未知")+" 条) ",1),s(H,{size:"small",pagination:!1,columns:T,"data-source":a.value.records?.rows||[],"row-key":"taskId",scroll:{x:750}},{bodyCell:n(({column:M,record:O})=>[M.key==="refund"?(y(),z(J,{key:0},[f(x(O.refunded?`已退 ${k(O.refundedAmount)}`:"—"),1)],64)):(y(),z(J,{key:1},[f(x(O[M.dataIndex]??"未知"),1)],64))]),_:1},8,["data-source"]),s(E,{style:{"margin-top":"12px"}},{default:n(()=>[s(G,{disabled:t.value||d.disabled||!a.value.records?.offset,onClick:v[3]||(v[3]=M=>m(Math.max(0,a.value.records.offset-20)))},{default:n(()=>[...v[6]||(v[6]=[f("上一页",-1)])]),_:1},8,["disabled"]),s(G,{disabled:t.value||d.disabled||!a.value.records||a.value.records.offset+a.value.records.rows.length>=a.value.records.total,onClick:v[4]||(v[4]=M=>m(a.value.records.offset+20))},{default:n(()=>[...v[7]||(v[7]=[f("下一页",-1)])]),_:1},8,["disabled"])]),_:1})],64)):I("",!0),v[9]||(v[9]=u("p",{style:{"margin-top":"16px"}}," 当前价格已含时段折扣;实际路由分组以账单为准。运行中的费用可能仍为预扣,退款已计入实扣金额。账单保留四位,小额显示 0 不代表免费。账户余额还包括其他 Key 和网页等消费。 ",-1)),v[10]||(v[10]=u("p",null," 模型实际返回的 Token 用量在 Token 统计中查看。平台账单不返回 Token 数,暂不将本地请求与账单逐条关联。 ",-1))]),_:1})}}},Ho={style:{display:"flex","align-items":"center","justify-content":"space-between","margin-bottom":"24px"}},jo={key:1,style:{"text-align":"center",padding:"60px"}},Ao={key:2},Ro={class:"providers-grid"},No={style:{display:"flex","align-items":"center",gap:"12px","margin-bottom":"12px"}},Bo={style:{"font-size":"24px"}},Qo={style:{flex:"1"}},Jo={style:{color:"#e0e0e0","font-weight":"500"}},Wo={style:{color:"var(--text-secondary)","font-size":"11px","font-family":"monospace"}},Xo={style:{display:"flex",gap:"8px","justify-content":"flex-end"}},Yo={key:0,style:{"margin-top":"24px"}},Zo={style:{color:"#ccc","font-family":"monospace","font-size":"13px"}},oe={style:{display:"flex","align-items":"center","justify-content":"space-between","margin-bottom":"16px"}},ee={class:"config-grid"},ae={style:{display:"flex","align-items":"center",gap:"12px"}},le=["href"],te=["href"],ie={style:{display:"flex",gap:"12px","justify-content":"flex-end","margin-top":"16px"}},ne={__name:"Providers",setup(d){const i=Do(),p=oo(),{configForm:t,configLoading:g,configSaving:a,configReady:S,showRestartHint:P,channel:c,lkProtocol:k,lkAddress:w,lkChannel:T,lkModelOptions:m,keyPlaceholder:$,savedConnections:v,selectSavedConnection:q,connectionDirty:G,remoteHttp:E,applyLk:F,handleChannelChange:H,handleProviderChange:N,loadConfig:M,saveConfig:O,resetForm:X,testSavedConnection:ao}=Go(p,i,Z),lo=["ollama","openai","anthropic","volcengine","deepseek","gemini","groq","mistral","custom","zhipu"],to={ollama:"Ollama(本地)",openai:"OpenAI",anthropic:"Anthropic",volcengine:"火山引擎(豆包)",deepseek:"DeepSeek",gemini:"Google Gemini",groq:"Groq",mistral:"Mistral",custom:"Custom(自定义)",zhipu:"智谱 AI"},io=lo.map(C=>({value:C,label:to[C]||C}));async function r(C){try{await i.switchProvider(C),Z.success(`已切换到 ${C}`)}catch(e){Z.error(`切换失败: ${e.message}`)}}async function b(C){await i.testProvider(C)?Z.success(`${C} 连接正常`):Z.warning(`${C} 连接失败,请检查配置`)}return To(()=>{i.loadProviders(),M()}),(C,e)=>{const U=h("a-button"),A=h("a-alert"),D=h("a-spin"),V=h("a-tag"),Y=h("a-badge"),po=h("a-card"),fo=h("a-list-item"),Po=h("a-list"),ko=h("a-divider"),B=h("a-select"),L=h("a-form-item"),co=h("a-input"),xo=h("a-input-password"),wo=h("a-slider"),mo=h("a-input-number"),_o=h("a-checkbox"),Mo=h("a-form");return y(),z("div",null,[u("div",Ho,[e[18]||(e[18]=u("div",null,[u("h2",{class:"page-title"},"LLM 配置"),u("p",{class:"page-sub"},"管理 AI 服务提供商")],-1)),s(U,{type:"primary",ghost:"",loading:o(i).loading,onClick:e[0]||(e[0]=l=>o(i).loadProviders())},{icon:n(()=>[s(o(uo))]),default:n(()=>[e[17]||(e[17]=f(" 刷新 ",-1))]),_:1},8,["loading"])]),o(i).activeProvider?(y(),_(A,{key:0,type:"success",style:{"margin-bottom":"20px",background:"rgba(41, 162, 112, 0.08)","border-color":"rgba(41, 162, 112, 0.3)"},"show-icon":""},{message:n(()=>[u("span",null,[e[19]||(e[19]=f("当前激活:",-1)),u("strong",null,x(o(i).activeProvider),1)])]),_:1})):I("",!0),o(i).loading?(y(),z("div",jo,[s(D,{size:"large"}),e[20]||(e[20]=u("div",{style:{color:"var(--text-muted)","margin-top":"12px"}}," 加载 LLM 信息中... ",-1))])):(y(),z("div",Ao,[u("div",Ro,[(y(!0),z(J,null,So(o(i).providers,l=>(y(),_(po,{key:l.name,class:Io(["provider-card",{active:l.active}]),style:{background:"var(--bg-card)"},size:"small"},{default:n(()=>[u("div",No,[u("span",Bo,x(l.icon),1),u("div",Qo,[u("div",Jo,x(l.label),1),u("div",Wo,x(l.name),1)]),u("div",null,[l.active?(y(),_(V,{key:0,color:"green"},{default:n(()=>[...e[21]||(e[21]=[f("活跃",-1)])]),_:1})):l.status==="ok"?(y(),_(Y,{key:1,status:"success",text:""})):l.status==="error"?(y(),_(Y,{key:2,status:"error",text:""})):I("",!0)])]),u("div",Xo,[s(U,{size:"small",style:{background:"var(--bg-card-hover)","border-color":"var(--border-color)"},loading:o(i).testing===l.name,onClick:R=>b(l.name)},{default:n(()=>[...e[22]||(e[22]=[f(" 测试 ",-1)])]),_:1},8,["loading","onClick"]),l.active?(y(),_(V,{key:1,color:"green",style:{margin:"0","line-height":"24px"}},{default:n(()=>[...e[24]||(e[24]=[f("当前",-1)])]),_:1})):(y(),_(U,{key:0,size:"small",type:"primary",ghost:"",onClick:R=>r(l.name)},{default:n(()=>[...e[23]||(e[23]=[f(" 切换 ",-1)])]),_:1},8,["onClick"]))])]),_:2},1032,["class"]))),128))]),o(i).localModels.length?(y(),z("div",Yo,[e[25]||(e[25]=u("h3",{style:{color:"#ccc","font-size":"15px","margin-bottom":"12px"}}," 本地模型(Ollama) ",-1)),s(Po,{"data-source":o(i).localModels,size:"small",style:{background:"var(--bg-card)","border-radius":"8px",border:"1px solid var(--border-color)"}},{renderItem:n(({item:l})=>[s(fo,{style:{padding:"10px 16px","border-color":"#252525"}},{actions:n(()=>[s(V,{color:"cyan",style:{"font-size":"10px"}},{default:n(()=>[f(x(l.size||"local"),1)]),_:2},1024)]),default:n(()=>[u("span",Zo,x(l.name),1)]),_:2},1024)]),_:1},8,["data-source"])])):I("",!0),s(ko,{style:{"border-color":"var(--border-color)",margin:"32px 0 24px"}}),o(P)?(y(),_(A,{key:1,type:"warning","show-icon":"",closable:"",style:{"margin-bottom":"16px"},message:"新的模型连接已保存",description:"新建聊天或 Agent 会话后使用新连接。正在进行的请求和会话请完成或停止后再切换。",onClose:e[1]||(e[1]=l=>P.value=!1)})):I("",!0),u("div",oe,[e[27]||(e[27]=u("h3",{class:"section-title"},"LLM 参数设置",-1)),s(U,{size:"small",loading:o(g),onClick:o(M),style:{background:"var(--bg-card-hover)","border-color":"var(--border-color)"}},{icon:n(()=>[s(o(uo))]),default:n(()=>[e[26]||(e[26]=f(" 加载配置 ",-1))]),_:1},8,["loading","onClick"])]),s(po,{class:"config-card",style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:n(()=>[s(Mo,{model:o(t),layout:"vertical",class:"config-form"},{default:n(()=>[u("div",ee,[o(v).length?(y(),_(L,{key:0,label:"已保存渠道(自动恢复凭证)"},{default:n(()=>[s(B,{placeholder:"选择之前保存的渠道",disabled:o(a)||o(g),options:o(v).map((l,R)=>({value:R,label:`${l.provider} · ${l.baseUrl} · ${l.model}`})),onChange:e[2]||(e[2]=l=>o(q)(o(v)[l]))},null,8,["disabled","options"])]),_:1})):I("",!0),s(L,{label:"服务渠道"},{default:n(()=>[s(B,{value:o(c),"onUpdate:value":e[3]||(e[3]=l=>no(c)?c.value=l:null),disabled:o(a)||o(g),options:[{value:"manual",label:"官方服务 / 自定义渠道"},{value:"lk",label:"LK API 聚合平台"}],onChange:o(H)},null,8,["value","disabled","onChange"])]),_:1}),o(c)==="lk"?(y(),_(L,{key:1,label:"LK 兼容协议"},{default:n(()=>[s(B,{value:o(k),"onUpdate:value":e[4]||(e[4]=l=>no(k)?k.value=l:null),disabled:o(a)||o(g),options:Object.entries(o(T).protocols).map(([l,R])=>({value:l,label:R.label})),onChange:e[5]||(e[5]=l=>o(F)(!1))},null,8,["value","disabled","options"])]),_:1})):I("",!0),o(c)==="lk"?(y(),_(L,{key:2,label:"主备地址(同一服务,手动切换)"},{default:n(()=>[s(B,{value:o(w),"onUpdate:value":e[6]||(e[6]=l=>no(w)?w.value=l:null),disabled:o(a)||o(g),options:Object.entries(o(T).addresses).map(([l,R])=>({value:l,label:R})),onChange:e[7]||(e[7]=l=>o(F)(!0))},null,8,["value","disabled","options"])]),_:1})):I("",!0),o(c)==="lk"?(y(),_(L,{key:3,label:"LK 对话模型目录"},{default:n(()=>[s(B,{value:o(t).model,"onUpdate:value":e[8]||(e[8]=l=>o(t).model=l),"show-search":"","option-filter-prop":"label",disabled:o(a)||o(g),options:o(m)},null,8,["value","disabled","options"])]),_:1})):I("",!0),o(c)!=="lk"?(y(),_(L,{key:4,label:"Provider(提供商)"},{default:n(()=>[s(B,{value:o(t).provider,"onUpdate:value":e[9]||(e[9]=l=>o(t).provider=l),placeholder:"选择 LLM 提供商",options:o(io),style:{width:"100%"},disabled:o(a),onChange:o(N)},null,8,["value","options","disabled","onChange"])]),_:1})):I("",!0),s(L,{label:"Model(模型名称)"},{default:n(()=>[s(co,{value:o(t).model,"onUpdate:value":e[10]||(e[10]=l=>o(t).model=l),placeholder:"例如 doubao-seed-1-6-251015","allow-clear":"",disabled:o(a)},null,8,["value","disabled"])]),_:1}),s(L,{label:"API Key"},{default:n(()=>[s(xo,{value:o(t).apiKey,"onUpdate:value":e[11]||(e[11]=l=>o(t).apiKey=l),placeholder:o($),autocomplete:"new-password",disabled:o(a)},null,8,["value","placeholder","disabled"])]),_:1}),s(L,{label:"Base URL"},{default:n(()=>[s(co,{value:o(t).baseUrl,"onUpdate:value":e[12]||(e[12]=l=>o(t).baseUrl=l),readonly:o(c)==="lk",placeholder:"例如 https://ark.cn-beijing.volces.com/api/v3","allow-clear":"",disabled:o(a)},null,8,["value","readonly","disabled"])]),_:1}),s(L,{label:"Temperature(温度)"},{default:n(()=>[u("div",ae,[s(wo,{value:o(t).temperature,"onUpdate:value":e[13]||(e[13]=l=>o(t).temperature=l),min:0,max:2,step:.1,style:{flex:"1"},disabled:o(a)},null,8,["value","disabled"]),s(mo,{value:o(t).temperature,"onUpdate:value":e[14]||(e[14]=l=>o(t).temperature=l),min:0,max:2,step:.1,precision:1,style:{width:"80px"},disabled:o(a)},null,8,["value","disabled"])])]),_:1}),s(L,{label:"Max Tokens(最大输出长度)"},{default:n(()=>[s(mo,{value:o(t).maxTokens,"onUpdate:value":e[15]||(e[15]=l=>o(t).maxTokens=l),min:256,max:128e3,step:256,style:{width:"100%"},placeholder:"4096",disabled:o(a)},null,8,["value","disabled"])]),_:1})]),o(c)==="lk"?(y(),_(A,{key:0,type:"info","show-icon":"",style:{"margin-bottom":"16px"}},{message:n(()=>[...e[28]||(e[28]=[f("模型按协议筛选,支持填写新别名。首次配置填写 LK Key,主备和协议切换会恢复已存凭证。",-1)])]),description:n(()=>[e[29]||(e[29]=f(" 目录包含 197 个模型,其中 83 个用于对话;实际可用性以账户权限为准。 媒体接口提供文档参考。",-1)),u("a",{href:o(T).documentationUrl,target:"_blank",rel:"noopener noreferrer"},"开发文档",8,le),e[30]||(e[30]=f(" · ",-1)),u("a",{href:o(T).pricingUrl,target:"_blank",rel:"noopener noreferrer"},"定价",8,te)]),_:1})):I("",!0),o(E)?(y(),_(_o,{key:1,checked:o(t).allowHttp,"onUpdate:checked":e[16]||(e[16]=l=>o(t).allowHttp=l),disabled:o(a)},{default:n(()=>[...e[31]||(e[31]=[f(" 允许以未加密 HTTP 访问此远程接口 ",-1)])]),_:1},8,["checked","disabled"])):I("",!0),e[35]||(e[35]=u("p",{style:{color:"var(--text-muted)"}}," 密钥留空会恢复该渠道已保存的凭证。首次配置新服务时填写其自己的 Key。测试连接会发送一次简短请求,可能产生费用。 ",-1)),u("div",ie,[s(U,{onClick:o(X),disabled:o(a),style:{background:"var(--bg-card-hover)","border-color":"var(--border-color)"}},{default:n(()=>[...e[32]||(e[32]=[f(" 重置 ",-1)])]),_:1},8,["onClick","disabled"]),s(U,{disabled:!o(S)||o(G)||o(a),loading:o(i).testing===o(t).provider,onClick:o(ao)},{default:n(()=>[...e[33]||(e[33]=[f("测试已保存连接",-1)])]),_:1},8,["disabled","loading","onClick"]),s(U,{type:"primary",loading:o(a),disabled:!o(S)||o(g),onClick:o(O)},{default:n(()=>[...e[34]||(e[34]=[f(" 保存配置 ",-1)])]),_:1},8,["loading","disabled","onClick"])])]),_:1},8,["model"])]),_:1}),o(c)==="lk"?(y(),_(Fo,{key:2,disabled:!o(S)||o(G)||o(a)||o(g),"connection-id":`${o(t).provider}:${o(t).baseUrl}:${o(t).model}`},null,8,["disabled","connection-id"])):I("",!0)]))])}}},ce=Uo(ne,[["__scopeId","data-v-e55b9eae"]]);export{ce as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as o}from"./Col-BlkVpYfD.js";import{$ as t}from"./index-hmILMYKF.js";import"./index-DID83zEQ.js";import"./vendor-BXcBOG8b.js";import"./icons-DlxlFL4g.js";const s=t(o);export{s as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as o}from"./Row-DoD3nauz.js";import{$ as t}from"./index-hmILMYKF.js";import"./responsiveObserve-BhRD48Wz.js";import"./vendor-BXcBOG8b.js";import"./useFlexGapSupport-CPIJfd28.js";import"./styleChecker-BeLQUf-Z.js";import"./index-DID83zEQ.js";import"./icons-DlxlFL4g.js";const l=t(o);export{l as default};
|