@mofeng2223/dsh-claude-provider 0.5.9 → 0.6.0
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 +4 -8
- package/README.zh-CN.md +4 -8
- package/lib/client.js +640 -265
- package/package.json +3 -3
- package/src/index.js +4 -0
package/lib/client.js
CHANGED
|
@@ -6,7 +6,6 @@ window.__ModuleLoader__.load({
|
|
|
6
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
8
|
let react = require("react");
|
|
9
|
-
let react_dom = require("react-dom");
|
|
10
9
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
11
10
|
let _deepseek_ai_dsh_client_store = require("@deepseek-ai/dsh-client-store");
|
|
12
11
|
//#region lib/types/client/apiKey.js
|
|
@@ -56,7 +55,7 @@ window.__ModuleLoader__.load({
|
|
|
56
55
|
}
|
|
57
56
|
//#endregion
|
|
58
57
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-settings-models/src/client/ModelsSection.module.css.mjs
|
|
59
|
-
const css$3 = ".zGbnIq_section{max-width:720px;color:var(--dsw-alias-label-primary);flex-direction:column;gap:12px;display:flex}.zGbnIq_title{color:var(--dsw-alias-label-primary);margin:0;font-size:16px;font-weight:500;line-height:24px}.zGbnIq_intro{color:var(--dsw-alias-label-tertiary);margin:0;font-size:14px;line-height:22px}.zGbnIq_notice{color:var(--dsw-alias-state-warn-label);margin:0;font-size:12px;line-height:18px}.zGbnIq_savedNotice{color:var(--dsw-alias-state-success-primary);margin:0;font-size:12px;line-height:18px}.zGbnIq_rows{flex-direction:column;gap:8px;margin:12px 0 0;padding:0;list-style:none;display:flex}.zGbnIq_rowCard{border:.5px solid var(--dsw-alias-settings-card-stroke);background:var(--dsw-alias-settings-card-fill);border-radius:var(--dsw-radius-xl);flex-direction:column;gap:12px;padding:12px 14px;display:flex}.zGbnIq_rowHead{align-items:center;gap:10px;display:flex}.zGbnIq_rowIdentity{align-items:center;gap:6px;min-width:0;display:inline-flex}.zGbnIq_rowName{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:500;line-height:22px}.zGbnIq_rowTag{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-xs);color:var(--dsw-alias-label-secondary);flex:none;padding:1px 6px;font-size:11px;line-height:16px}.zGbnIq_credentialDot{box-sizing:border-box;corner-shape:round;border-radius:50%;flex:none;width:8px;height:8px;display:inline-block}.zGbnIq_credentialDotConfigured{background:var(--dsw-alias-state-success-primary)}.zGbnIq_credentialDotMissing{background:var(--dsw-alias-state-error-primary)}.zGbnIq_rowActions{align-items:center;gap:4px;margin-left:auto;display:inline-flex}.zGbnIq_primaryButton,.zGbnIq_secondaryButton,.zGbnIq_addButton{box-sizing:border-box;border-radius:var(--dsw-radius-md);height:36px;font:inherit;cursor:pointer;border:none;justify-content:center;align-items:center;gap:4px;padding:0 14px;font-size:14px;line-height:22px;display:inline-flex}.zGbnIq_primaryButton{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground)}.zGbnIq_primaryButton:hover:not(:disabled){background:var(--dsw-alias-button-primary-hover)}.zGbnIq_secondaryButton,.zGbnIq_addButton{border:.5px solid var(--dsw-alias-border-l3);color:var(--dsw-alias-label-primary);background:0 0}.zGbnIq_secondaryButton:hover:not(:disabled),.zGbnIq_addButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.zGbnIq_secondaryButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-solid)}.zGbnIq_dangerButton{box-sizing:border-box;border-radius:var(--dsw-radius-md);height:36px;color:var(--dsw-alias-state-error-primary);font:inherit;cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0 14px;font-size:14px;line-height:22px;display:inline-flex}.zGbnIq_dangerButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-danger)}.zGbnIq_rowActions .zGbnIq_secondaryButton,.zGbnIq_rowActions .zGbnIq_dangerButton{border-radius:var(--dsw-radius-sm);height:28px;padding:0 10px;font-size:12px;line-height:18px}.zGbnIq_primaryButton:disabled,.zGbnIq_secondaryButton:disabled,.zGbnIq_dangerButton:disabled,.zGbnIq_addButton:disabled,.zGbnIq_linkButton:disabled,.zGbnIq_addModelButton:disabled{opacity:.4;cursor:default}.zGbnIq_primaryButton:focus-visible,.zGbnIq_secondaryButton:focus-visible,.zGbnIq_dangerButton:focus-visible,.zGbnIq_addButton:focus-visible,.zGbnIq_linkButton:focus-visible,.zGbnIq_addModelButton:focus-visible,.zGbnIq_iconButton:focus-visible,.zGbnIq_customizedSummary:focus-visible{box-shadow:0 0 0 2px var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline:none}.zGbnIq_editor{border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-module-platform);flex-direction:column;gap:14px;padding:14px 16px;display:flex}.zGbnIq_editorHeader{align-items:baseline;gap:8px;display:flex}.zGbnIq_editorTitle{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:500;line-height:22px}.zGbnIq_editorRoute{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}.zGbnIq_field{flex-direction:column;gap:6px;display:flex}.zGbnIq_fieldLabel{color:var(--dsw-alias-label-secondary);align-items:center;gap:10px;font-size:12px;font-weight:500;line-height:18px;display:inline-flex}.zGbnIq_linkButton{box-sizing:border-box;border-radius:var(--dsw-radius-sm);height:28px;color:var(--dsw-alias-label-tertiary);font:inherit;cursor:pointer;background:0 0;border:none;align-items:center;padding:0 10px;font-size:12px;line-height:18px;display:inline-flex}.zGbnIq_linkButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary)}.zGbnIq_advancedHint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.zGbnIq_editorActions{justify-content:flex-end;gap:8px;display:flex}.zGbnIq_addBlock{flex-direction:column;gap:12px;display:flex}.zGbnIq_addActions{display:flex}.zGbnIq_addButton{border:1px dashed var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);flex:1 1 0;gap:6px;min-width:180px;height:44px}.zGbnIq_addModes{flex-direction:column;align-items:flex-start;gap:8px;display:flex}.zGbnIq_addPanel{flex-direction:column;gap:14px;display:flex}.zGbnIq_addPanel[hidden]{display:none}.zGbnIq_addCard,.zGbnIq_setupCard{border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-module-platform);flex-direction:column;gap:14px;padding:14px 16px;list-style:none;display:flex}.zGbnIq_addCard .zGbnIq_editor,.zGbnIq_setupCard .zGbnIq_editor{background:0 0;padding:0}.zGbnIq_customized{border-top:.5px solid var(--dsw-alias-border-l2);padding-top:10px}.zGbnIq_customizedSummary{border-radius:var(--dsw-radius-sm);cursor:pointer;width:fit-content;color:var(--dsw-alias-label-secondary);align-items:center;gap:6px;margin-left:-4px;padding:2px 4px;font-size:12px;font-weight:500;line-height:18px;list-style:none;display:flex}.zGbnIq_customizedSummary::-webkit-details-marker{display:none}.zGbnIq_customizedSummary:before{content:\"\";border-bottom:1.5px solid;border-right:1.5px solid;width:5px;height:5px;transition:transform .12s;transform:rotate(-45deg)translate(-1px,-1px)}.zGbnIq_customized[open]>.zGbnIq_customizedSummary:before{transform:rotate(45deg)translate(-1px,-1px)}.zGbnIq_customizedSummary:hover{color:var(--dsw-alias-label-primary)}.zGbnIq_customizedBody{flex-direction:column;gap:12px;padding-top:12px;display:flex}.zGbnIq_modelCatalog{border-top:.5px solid var(--dsw-alias-border-l2);flex-direction:column;gap:10px;padding-top:12px;display:flex}.zGbnIq_modelCatalogHeading{flex-direction:column;gap:2px;display:flex}.zGbnIq_modelCatalogTitle{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:500;line-height:18px}.zGbnIq_modelCatalogMeta,.zGbnIq_modelEmpty{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.zGbnIq_modelList{flex-direction:column;gap:8px;display:flex}.zGbnIq_modelListHead{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.zGbnIq_modelEntry{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-lg);padding:6px}.zGbnIq_modelRow{grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) auto auto;align-items:center;gap:6px;display:grid}.zGbnIq_iconButton{box-sizing:border-box;border-radius:var(--dsw-radius-sm);width:28px;height:28px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;display:inline-flex}.zGbnIq_iconButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.zGbnIq_iconButton:disabled{cursor:default;opacity:.4}.zGbnIq_iconButtonDanger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-danger);color:var(--dsw-alias-state-error-primary)}.zGbnIq_modelAdvanced{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:8px 4px 2px;display:grid}.zGbnIq_modelField{flex-direction:column;gap:4px;min-width:0;display:flex}.zGbnIq_modelInputTypes{border:none;grid-column:1/-1;min-width:0;margin:0;padding:0}.zGbnIq_modelInputTypes legend{margin-bottom:4px;padding:0}.zGbnIq_modelInputChoices{flex-wrap:wrap;align-items:center;gap:16px;min-height:32px;display:flex}.zGbnIq_modelFieldLabel{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}.zGbnIq_modelEmpty{border:1px dashed var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);text-align:center;padding:12px}.zGbnIq_addModelButton{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);height:28px;color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;background:0 0;align-self:flex-start;align-items:center;gap:4px;padding:0 10px;font-size:12px;line-height:18px;display:inline-flex}.zGbnIq_addModelButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.zGbnIq_input{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);width:100%;height:32px;font:inherit;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);padding:0 10px;font-size:14px;line-height:22px}select.zGbnIq_input{cursor:pointer;max-width:240px}.zGbnIq_input:focus{border-color:var(--dsw-alias-state-business-primary);outline:none}.zGbnIq_input::placeholder{color:var(--dsw-alias-label-dimmed)}.zGbnIq_input:disabled{opacity:.6;cursor:default}.zGbnIq_selectInput{appearance:none;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2381858C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");background-position:right 12px center;background-repeat:no-repeat;background-size:12px 12px;padding-right:32px}.zGbnIq_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px;line-height:18px}.zGbnIq_deleteDialog{width:min(480px,100%)}.zGbnIq_deleteConfirm:not(:disabled){border-color:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-state-error-primary)}.zGbnIq_deleteConfirm:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-danger)}.zGbnIq_hiddenLabel{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.zGbnIq_customizedSummary:before,.zGbnIq_switchThumb{transition:none}}.zGbnIq_fetchDialog{--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);max-width:520px}.zGbnIq_candidateToolbar{align-items:center;gap:8px;margin-bottom:6px;display:flex}.zGbnIq_candidateSearch{flex:240px;min-width:0}.zGbnIq_candidateList{flex-direction:column;gap:2px;max-height:320px;margin:0;padding:0;list-style:none;display:flex;overflow-y:auto}.zGbnIq_candidate{border-radius:var(--dsw-radius-md)}.zGbnIq_candidateLabel{cursor:pointer;align-items:center;gap:8px;padding:6px 8px;display:flex}.zGbnIq_candidateId{min-width:0;font-family:var(--ds-font-family-code);text-overflow:ellipsis;white-space:nowrap;flex:auto;font-size:13px;overflow:hidden}.zGbnIq_candidateEmpty{color:var(--dsw-alias-label-secondary);text-align:center;margin:24px 0;font-size:13px;line-height:20px}";
|
|
58
|
+
const css$3 = ".zGbnIq_section{max-width:720px;color:var(--dsw-alias-label-primary);flex-direction:column;gap:12px;display:flex}.zGbnIq_title{color:var(--dsw-alias-label-primary);margin:0;font-size:16px;font-weight:500;line-height:24px}.zGbnIq_intro{color:var(--dsw-alias-label-tertiary);margin:0;font-size:14px;line-height:22px}.zGbnIq_notice{color:var(--dsw-alias-state-warn-label);margin:0;font-size:12px;line-height:18px}.zGbnIq_savedNotice{color:var(--dsw-alias-state-success-primary);margin:0;font-size:12px;line-height:18px}.zGbnIq_rows{flex-direction:column;gap:8px;margin:12px 0 0;padding:0;list-style:none;display:flex}.zGbnIq_rowCard{border:.5px solid var(--dsw-alias-settings-card-stroke);background:var(--dsw-alias-settings-card-fill);border-radius:var(--dsw-radius-xl);flex-direction:column;gap:12px;padding:12px 14px;display:flex}.zGbnIq_rowHead{align-items:center;gap:10px;display:flex}.zGbnIq_rowIdentity{align-items:center;gap:6px;min-width:0;display:inline-flex}.zGbnIq_rowName{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:500;line-height:22px}.zGbnIq_rowTag{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-xs);color:var(--dsw-alias-label-secondary);flex:none;padding:1px 6px;font-size:11px;line-height:16px}.zGbnIq_credentialDot{box-sizing:border-box;corner-shape:round;border-radius:50%;flex:none;width:8px;height:8px;display:inline-block}.zGbnIq_credentialDotConfigured{background:var(--dsw-alias-state-success-primary)}.zGbnIq_credentialDotMissing{background:var(--dsw-alias-state-error-primary)}.zGbnIq_accountStatus{color:var(--dsw-alias-state-success-primary);flex:none;align-items:center;gap:6px;font-size:13px;line-height:20px;display:inline-flex}.zGbnIq_rowActions{align-items:center;gap:4px;margin-left:auto;display:inline-flex}.zGbnIq_primaryButton,.zGbnIq_secondaryButton,.zGbnIq_addButton{box-sizing:border-box;border-radius:var(--dsw-radius-md);height:36px;font:inherit;cursor:pointer;border:none;justify-content:center;align-items:center;gap:4px;padding:0 14px;font-size:14px;line-height:22px;display:inline-flex}.zGbnIq_primaryButton{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground)}.zGbnIq_primaryButton:hover:not(:disabled){background:var(--dsw-alias-button-primary-hover)}.zGbnIq_secondaryButton,.zGbnIq_addButton{border:.5px solid var(--dsw-alias-border-l3);color:var(--dsw-alias-label-primary);background:0 0}.zGbnIq_secondaryButton:hover:not(:disabled),.zGbnIq_addButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.zGbnIq_secondaryButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-solid)}.zGbnIq_dangerButton{box-sizing:border-box;border-radius:var(--dsw-radius-md);height:36px;color:var(--dsw-alias-state-error-primary);font:inherit;cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0 14px;font-size:14px;line-height:22px;display:inline-flex}.zGbnIq_dangerButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-danger)}.zGbnIq_rowActions .zGbnIq_secondaryButton,.zGbnIq_rowActions .zGbnIq_dangerButton{border-radius:var(--dsw-radius-sm);height:28px;padding:0 10px;font-size:12px;line-height:18px}.zGbnIq_primaryButton:disabled,.zGbnIq_secondaryButton:disabled,.zGbnIq_dangerButton:disabled,.zGbnIq_addButton:disabled,.zGbnIq_linkButton:disabled,.zGbnIq_addModelButton:disabled{opacity:.4;cursor:default}.zGbnIq_primaryButton:focus-visible,.zGbnIq_secondaryButton:focus-visible,.zGbnIq_dangerButton:focus-visible,.zGbnIq_addButton:focus-visible,.zGbnIq_linkButton:focus-visible,.zGbnIq_addModelButton:focus-visible,.zGbnIq_iconButton:focus-visible,.zGbnIq_customizedSummary:focus-visible{box-shadow:0 0 0 2px var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline:none}.zGbnIq_editor{border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-module-platform);flex-direction:column;gap:14px;padding:14px 16px;display:flex}.zGbnIq_editorHeader{align-items:baseline;gap:8px;display:flex}.zGbnIq_editorTitle{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:500;line-height:22px}.zGbnIq_editorRoute{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}.zGbnIq_field{flex-direction:column;gap:6px;display:flex}.zGbnIq_fieldLabel{color:var(--dsw-alias-label-secondary);align-items:center;gap:10px;font-size:12px;font-weight:500;line-height:18px;display:inline-flex}.zGbnIq_helpButton{border:.5px solid var(--dsw-alias-border-l3);corner-shape:round;width:16px;height:16px;color:var(--dsw-alias-label-tertiary);font:inherit;text-align:center;cursor:help;background:0 0;border-radius:50%;padding:0;font-size:11px;line-height:15px}.zGbnIq_helpButton:hover,.zGbnIq_helpButton:focus-visible{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-tertiary)}.zGbnIq_linkButton{box-sizing:border-box;border-radius:var(--dsw-radius-sm);height:28px;color:var(--dsw-alias-label-tertiary);font:inherit;cursor:pointer;background:0 0;border:none;align-items:center;padding:0 10px;font-size:12px;line-height:18px;display:inline-flex}.zGbnIq_linkButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary)}.zGbnIq_advancedHint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.zGbnIq_editorActions{justify-content:flex-end;gap:8px;display:flex}.zGbnIq_addBlock{flex-direction:column;gap:12px;display:flex}.zGbnIq_addActions{display:flex}.zGbnIq_addButton{border:1px dashed var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);flex:1 1 0;gap:6px;min-width:180px;height:44px}.zGbnIq_addModes{flex-direction:column;align-items:flex-start;gap:8px;display:flex}.zGbnIq_addPanel{flex-direction:column;gap:14px;display:flex}.zGbnIq_addPanel[hidden]{display:none}.zGbnIq_addCard,.zGbnIq_setupCard{border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-module-platform);flex-direction:column;gap:14px;padding:14px 16px;list-style:none;display:flex}.zGbnIq_addCard .zGbnIq_editor,.zGbnIq_setupCard .zGbnIq_editor{background:0 0;padding:0}.zGbnIq_customized{border-top:.5px solid var(--dsw-alias-border-l2);padding-top:10px}.zGbnIq_customizedSummary{border-radius:var(--dsw-radius-sm);cursor:pointer;width:fit-content;color:var(--dsw-alias-label-secondary);align-items:center;gap:6px;margin-left:-4px;padding:2px 4px;font-size:12px;font-weight:500;line-height:18px;list-style:none;display:flex}.zGbnIq_customizedSummary::-webkit-details-marker{display:none}.zGbnIq_customizedSummary:before{content:\"\";border-bottom:1.5px solid;border-right:1.5px solid;width:5px;height:5px;transition:transform .12s;transform:rotate(-45deg)translate(-1px,-1px)}.zGbnIq_customized[open]>.zGbnIq_customizedSummary:before{transform:rotate(45deg)translate(-1px,-1px)}.zGbnIq_customizedSummary:hover{color:var(--dsw-alias-label-primary)}.zGbnIq_customizedBody{flex-direction:column;gap:12px;padding-top:12px;display:flex}.zGbnIq_modelCatalog{border-top:.5px solid var(--dsw-alias-border-l2);flex-direction:column;gap:10px;padding-top:12px;display:flex}.zGbnIq_modelCatalogHeading{flex-direction:column;gap:2px;display:flex}.zGbnIq_modelCatalogTitle{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:500;line-height:18px}.zGbnIq_modelCatalogMeta,.zGbnIq_modelEmpty{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.zGbnIq_modelList{flex-direction:column;gap:8px;display:flex}.zGbnIq_modelListHead{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.zGbnIq_modelEntry{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-lg);padding:6px}.zGbnIq_modelRow{grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) auto auto;align-items:center;gap:6px;display:grid}.zGbnIq_iconButton{box-sizing:border-box;border-radius:var(--dsw-radius-sm);width:28px;height:28px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;display:inline-flex}.zGbnIq_iconButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.zGbnIq_iconButton:disabled{cursor:default;opacity:.4}.zGbnIq_iconButtonDanger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-danger);color:var(--dsw-alias-state-error-primary)}.zGbnIq_modelAdvanced{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:8px 4px 2px;display:grid}.zGbnIq_modelField{flex-direction:column;gap:4px;min-width:0;display:flex}.zGbnIq_modelInputTypes{border:none;grid-column:1/-1;min-width:0;margin:0;padding:0}.zGbnIq_modelInputTypes legend{margin-bottom:4px;padding:0}.zGbnIq_modelInputChoices{flex-wrap:wrap;align-items:center;gap:16px;min-height:32px;display:flex}.zGbnIq_modelFieldLabel{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}.zGbnIq_modelReasoning{flex-direction:column;grid-column:1/-1;gap:6px;min-width:0;display:flex}.zGbnIq_modelReasoningLabel{align-items:center;gap:6px;display:inline-flex}.zGbnIq_modelReasoningHead{justify-content:space-between;align-items:center;gap:8px;display:flex}.zGbnIq_modelReasoningRow{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;align-items:center;gap:6px;display:grid}.zGbnIq_modelReasoningRow .zGbnIq_selectInput{max-width:none}.zGbnIq_modelReasoningValueInput{font-family:var(--ds-font-family-code);font-size:13px}.zGbnIq_modelEmpty{border:1px dashed var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);text-align:center;padding:12px}.zGbnIq_addModelButton{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);height:28px;color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;background:0 0;align-self:flex-start;align-items:center;gap:4px;padding:0 10px;font-size:12px;line-height:18px;display:inline-flex}.zGbnIq_addModelButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.zGbnIq_input{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);width:100%;height:32px;font:inherit;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);padding:0 10px;font-size:14px;line-height:22px}select.zGbnIq_input{cursor:pointer;max-width:240px}.zGbnIq_input:focus{border-color:var(--dsw-alias-state-business-primary);outline:none}.zGbnIq_input::placeholder{color:var(--dsw-alias-label-dimmed)}.zGbnIq_input:disabled{opacity:.6;cursor:default}.zGbnIq_keyInput{position:relative}.zGbnIq_keyInputFilled{padding-right:40px}.zGbnIq_keyToggle{border-radius:var(--dsw-radius-md);width:32px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0;display:inline-flex;position:absolute;inset:1px 1px 1px auto}.zGbnIq_keyToggle:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.zGbnIq_keyToggle:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:-2px}.zGbnIq_keyToggle:disabled{opacity:.6;cursor:default}.zGbnIq_selectInput{appearance:none;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2381858C' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");background-position:right 12px center;background-repeat:no-repeat;background-size:12px 12px;padding-right:32px}.zGbnIq_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px;line-height:18px}.zGbnIq_deleteDialog{width:min(480px,100%)}.zGbnIq_deleteConfirm:not(:disabled){border-color:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-state-error-primary)}.zGbnIq_deleteConfirm:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-danger)}.zGbnIq_hiddenLabel{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.zGbnIq_customizedSummary:before,.zGbnIq_switchThumb{transition:none}}.zGbnIq_fetchDialog{--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);max-width:520px}.zGbnIq_candidateToolbar{align-items:center;gap:8px;margin-bottom:6px;display:flex}.zGbnIq_candidateSearch{flex:240px;min-width:0}.zGbnIq_candidateList{flex-direction:column;gap:2px;max-height:320px;margin:0;padding:0;list-style:none;display:flex;overflow-y:auto}.zGbnIq_candidate{border-radius:var(--dsw-radius-md)}.zGbnIq_candidateLabel{cursor:pointer;align-items:center;gap:8px;padding:6px 8px;display:flex}.zGbnIq_candidateId{min-width:0;font-family:var(--ds-font-family-code);text-overflow:ellipsis;white-space:nowrap;flex:auto;font-size:13px;overflow:hidden}.zGbnIq_candidateEmpty{color:var(--dsw-alias-label-secondary);text-align:center;margin:24px 0;font-size:13px;line-height:20px}";
|
|
60
59
|
const tagId$3 = "@mofeng2223/dsh-claude-provider/ModelsSection.module.css";
|
|
61
60
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
|
|
62
61
|
const tag = document.createElement("style");
|
|
@@ -66,6 +65,7 @@ window.__ModuleLoader__.load({
|
|
|
66
65
|
document.head.appendChild(tag);
|
|
67
66
|
}
|
|
68
67
|
var ModelsSection_module_css_default = {
|
|
68
|
+
"accountStatus": "zGbnIq_accountStatus",
|
|
69
69
|
"addActions": "zGbnIq_addActions",
|
|
70
70
|
"addBlock": "zGbnIq_addBlock",
|
|
71
71
|
"addButton": "zGbnIq_addButton",
|
|
@@ -99,11 +99,15 @@ window.__ModuleLoader__.load({
|
|
|
99
99
|
"fetchDialog": "zGbnIq_fetchDialog",
|
|
100
100
|
"field": "zGbnIq_field",
|
|
101
101
|
"fieldLabel": "zGbnIq_fieldLabel",
|
|
102
|
+
"helpButton": "zGbnIq_helpButton",
|
|
102
103
|
"hiddenLabel": "zGbnIq_hiddenLabel",
|
|
103
104
|
"iconButton": "zGbnIq_iconButton",
|
|
104
105
|
"iconButtonDanger": "zGbnIq_iconButtonDanger",
|
|
105
106
|
"input": "zGbnIq_input",
|
|
106
107
|
"intro": "zGbnIq_intro",
|
|
108
|
+
"keyInput": "zGbnIq_keyInput",
|
|
109
|
+
"keyInputFilled": "zGbnIq_keyInputFilled",
|
|
110
|
+
"keyToggle": "zGbnIq_keyToggle",
|
|
107
111
|
"linkButton": "zGbnIq_linkButton",
|
|
108
112
|
"modelAdvanced": "zGbnIq_modelAdvanced",
|
|
109
113
|
"modelCatalog": "zGbnIq_modelCatalog",
|
|
@@ -118,6 +122,11 @@ window.__ModuleLoader__.load({
|
|
|
118
122
|
"modelInputTypes": "zGbnIq_modelInputTypes",
|
|
119
123
|
"modelList": "zGbnIq_modelList",
|
|
120
124
|
"modelListHead": "zGbnIq_modelListHead",
|
|
125
|
+
"modelReasoning": "zGbnIq_modelReasoning",
|
|
126
|
+
"modelReasoningHead": "zGbnIq_modelReasoningHead",
|
|
127
|
+
"modelReasoningLabel": "zGbnIq_modelReasoningLabel",
|
|
128
|
+
"modelReasoningRow": "zGbnIq_modelReasoningRow",
|
|
129
|
+
"modelReasoningValueInput": "zGbnIq_modelReasoningValueInput",
|
|
121
130
|
"modelRow": "zGbnIq_modelRow",
|
|
122
131
|
"notice": "zGbnIq_notice",
|
|
123
132
|
"primaryButton": "zGbnIq_primaryButton",
|
|
@@ -137,6 +146,55 @@ window.__ModuleLoader__.load({
|
|
|
137
146
|
"title": "zGbnIq_title"
|
|
138
147
|
};
|
|
139
148
|
//#endregion
|
|
149
|
+
//#region lib/types/client/ApiKeyInput.js
|
|
150
|
+
/** Write-only credential input with the same reveal behavior as masked conversation text. */
|
|
151
|
+
const EYE_CONTOUR = "M1.5 8C2.9 5.25 5.25 3.5 8 3.5C10.75 3.5 13.1 5.25 14.5 8C13.1 10.75 10.75 12.5 8 12.5C5.25 12.5 2.9 10.75 1.5 8Z";
|
|
152
|
+
const EYE_PATH = `${EYE_CONTOUR}M10 8C10 9.1 9.1 10 8 10C6.9 10 6 9.1 6 8C6 6.9 6.9 6 8 6C9.1 6 10 6.9 10 8Z`;
|
|
153
|
+
const EYE_OFF_PATH = `${EYE_CONTOUR}M2.5 2.5L13.5 13.5`;
|
|
154
|
+
/**
|
|
155
|
+
* Reveal only a nonempty draft; a different value starts masked, as in SecretText.
|
|
156
|
+
* @param props - current draft, input attributes, and translated control labels.
|
|
157
|
+
* @returns a password input with an optional reveal button.
|
|
158
|
+
*/
|
|
159
|
+
function ApiKeyInput({ value, t, ...props }) {
|
|
160
|
+
const [revealedValue, setRevealedValue] = (0, react.useState)();
|
|
161
|
+
const revealed = value.length > 0 && revealedValue === value;
|
|
162
|
+
return (0, react_jsx_runtime.jsxs)("div", {
|
|
163
|
+
className: ModelsSection_module_css_default["keyInput"],
|
|
164
|
+
children: [(0, react_jsx_runtime.jsx)("input", {
|
|
165
|
+
...props,
|
|
166
|
+
className: `${ModelsSection_module_css_default["input"]} ${value.length > 0 ? ModelsSection_module_css_default["keyInputFilled"] : ""}`,
|
|
167
|
+
type: revealed ? "text" : "password",
|
|
168
|
+
autoComplete: "new-password",
|
|
169
|
+
value,
|
|
170
|
+
onChange: (event) => {
|
|
171
|
+
setRevealedValue(void 0);
|
|
172
|
+
props.onChange?.(event);
|
|
173
|
+
}
|
|
174
|
+
}), value.length === 0 ? null : (0, react_jsx_runtime.jsx)("button", {
|
|
175
|
+
type: "button",
|
|
176
|
+
className: ModelsSection_module_css_default["keyToggle"],
|
|
177
|
+
"aria-label": t(revealed ? "keyHide" : "keyReveal"),
|
|
178
|
+
"aria-pressed": revealed,
|
|
179
|
+
disabled: props.disabled,
|
|
180
|
+
onClick: () => {
|
|
181
|
+
setRevealedValue(revealed ? void 0 : value);
|
|
182
|
+
},
|
|
183
|
+
children: (0, react_jsx_runtime.jsx)("svg", {
|
|
184
|
+
width: "16",
|
|
185
|
+
height: "16",
|
|
186
|
+
viewBox: "0 0 16 16",
|
|
187
|
+
fill: "none",
|
|
188
|
+
stroke: "currentColor",
|
|
189
|
+
strokeWidth: 1.3,
|
|
190
|
+
strokeLinecap: "round",
|
|
191
|
+
"aria-hidden": "true",
|
|
192
|
+
children: (0, react_jsx_runtime.jsx)("path", { d: revealed ? EYE_OFF_PATH : EYE_PATH })
|
|
193
|
+
})
|
|
194
|
+
})]
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
//#endregion
|
|
140
198
|
//#region lib/types/client/EditorFooter.js
|
|
141
199
|
/**
|
|
142
200
|
* Render one provider card's action row.
|
|
@@ -201,6 +259,224 @@ window.__ModuleLoader__.load({
|
|
|
201
259
|
});
|
|
202
260
|
}
|
|
203
261
|
//#endregion
|
|
262
|
+
//#region lib/types/client/ModelReasoningEfforts.js
|
|
263
|
+
/** Reasoning-level declarations for a model on a hand-declared pi-ai route. */
|
|
264
|
+
/** Levels a model offers when the switch is turned on, where the schema lists them: Off plus the common OpenAI-compatible trio. */
|
|
265
|
+
const INITIAL_LEVELS = [
|
|
266
|
+
"off",
|
|
267
|
+
"low",
|
|
268
|
+
"medium",
|
|
269
|
+
"high"
|
|
270
|
+
];
|
|
271
|
+
/** The wire value a level sends unless its row says otherwise; `null` is the Off entry that sends nothing. */
|
|
272
|
+
function defaultValue(level) {
|
|
273
|
+
return level === "off" ? null : level;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Whether pi-ai accepts a stored value: a non-empty string, or nothing for Off.
|
|
277
|
+
* @param level - the declared level.
|
|
278
|
+
* @param wire - the value stored for it.
|
|
279
|
+
* @returns whether the adapter would resolve the entry.
|
|
280
|
+
*/
|
|
281
|
+
function acceptedValue(level, wire) {
|
|
282
|
+
return typeof wire === "string" ? wire.length > 0 : wire === null && level === "off";
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Read the declared levels from a row in their stored order, including a key
|
|
286
|
+
* the offered levels do not name, so an edit never drops it.
|
|
287
|
+
* @param model - model row as drafted.
|
|
288
|
+
* @returns the entries; empty for a valueless field, which pi-ai refuses, and
|
|
289
|
+
* `undefined` when the field is absent or `false`.
|
|
290
|
+
*/
|
|
291
|
+
function readEfforts(model) {
|
|
292
|
+
const value = model["reasoningEfforts"];
|
|
293
|
+
if (value === null) return [];
|
|
294
|
+
if (typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
295
|
+
return Object.entries(value);
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Replace a row's declared levels, preserving every other field.
|
|
299
|
+
* @param model - model row as drafted.
|
|
300
|
+
* @param entries - the levels to write in row order, or `undefined` to remove the field.
|
|
301
|
+
* @returns the replacement row.
|
|
302
|
+
*/
|
|
303
|
+
function withEfforts(model, entries) {
|
|
304
|
+
const next = { ...model };
|
|
305
|
+
if (entries === void 0) {
|
|
306
|
+
Reflect.deleteProperty(next, "reasoningEfforts");
|
|
307
|
+
return next;
|
|
308
|
+
}
|
|
309
|
+
next["reasoningEfforts"] = Object.fromEntries(entries);
|
|
310
|
+
return next;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Mirror the pi-ai refusals of a hand-declared `reasoningEfforts`, so a card
|
|
314
|
+
* names the row instead of failing at the write.
|
|
315
|
+
* @param value - drafted `models` value, or `undefined` while inherited.
|
|
316
|
+
* @returns the first refused row, or `undefined` when the adapter will accept every row.
|
|
317
|
+
*/
|
|
318
|
+
function validateReasoningEfforts(value) {
|
|
319
|
+
for (const [index, model] of modelDrafts(value).entries()) {
|
|
320
|
+
const entries = readEfforts(model);
|
|
321
|
+
if (entries === void 0) continue;
|
|
322
|
+
if (entries.some(([level, wire]) => !acceptedValue(level, wire))) return {
|
|
323
|
+
index,
|
|
324
|
+
key: "modelReasoningValueRequired"
|
|
325
|
+
};
|
|
326
|
+
if (!entries.some(([level]) => level !== "off")) return {
|
|
327
|
+
index,
|
|
328
|
+
key: "modelReasoningNeedsLevel"
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Edit the `reasoningEfforts` a hand-declared pi-ai model offers: a switch,
|
|
334
|
+
* then one row per level pairing the level with the value sent for it. Every
|
|
335
|
+
* row is read from the model, so a reused instance shows its new model.
|
|
336
|
+
* @param props - model declaration and row replacement action.
|
|
337
|
+
* @returns the reasoning-level group.
|
|
338
|
+
*/
|
|
339
|
+
function ModelReasoningEfforts({ model, levels, position, disabled, t, onChange, claude, adaptiveFallback }) {
|
|
340
|
+
const entries = readEfforts(model);
|
|
341
|
+
const [typing, setTyping] = (0, react.useState)(void 0);
|
|
342
|
+
const label = `${t("modelReasoning")} ${String(position)}`;
|
|
343
|
+
const used = entries?.map(([level]) => level) ?? [];
|
|
344
|
+
const write = (next) => {
|
|
345
|
+
onChange(withEfforts(model, next));
|
|
346
|
+
};
|
|
347
|
+
const replaceAt = (current, index, entry) => current.map((existing, at) => at === index ? entry : existing);
|
|
348
|
+
const changeLevel = (current, index, from, wire, to) => {
|
|
349
|
+
write(replaceAt(current, index, [to, typeof wire === "string" && wire.length > 0 && wire !== from && from !== "off" && to !== "off" ? wire : defaultValue(to)]));
|
|
350
|
+
};
|
|
351
|
+
const addLevel = (current) => {
|
|
352
|
+
const highest = Math.max(-1, ...used.map((level) => levels.indexOf(level)));
|
|
353
|
+
const level = levels.find((candidate, index) => index > highest && !used.includes(candidate)) ?? levels.find((candidate) => !used.includes(candidate));
|
|
354
|
+
/* v8 ignore next -- the add button is disabled once every level has a row */
|
|
355
|
+
if (level === void 0) return;
|
|
356
|
+
write([...current, [level, defaultValue(level)]]);
|
|
357
|
+
};
|
|
358
|
+
const editValue = (current, index, level, text) => {
|
|
359
|
+
setTyping({
|
|
360
|
+
level,
|
|
361
|
+
text
|
|
362
|
+
});
|
|
363
|
+
const trimmed = text.trim();
|
|
364
|
+
write(replaceAt(current, index, [level, trimmed.length === 0 ? defaultValue(level) : trimmed]));
|
|
365
|
+
};
|
|
366
|
+
const leaveValue = (current, index, level, wire) => {
|
|
367
|
+
setTyping(void 0);
|
|
368
|
+
if (!acceptedValue(level, wire)) write(replaceAt(current, index, [level, defaultValue(level)]));
|
|
369
|
+
};
|
|
370
|
+
const choicesFor = (level) => [...levels.includes(level) ? [] : [level], ...levels.filter((choice) => choice === level || !used.includes(choice))];
|
|
371
|
+
const initialEntries = claude ? Object.entries(reasoningEffortsForPreset(CLAUDE_KNOWN_MODELS[model.id]?.preset ?? "five")) : INITIAL_LEVELS.filter((level) => levels.includes(level)).map((level) => [level, defaultValue(level)]);
|
|
372
|
+
const refused = entries?.some(([level, wire]) => !acceptedValue(level, wire)) === true;
|
|
373
|
+
const missingLevel = entries !== void 0 && !used.some((level) => level !== "off");
|
|
374
|
+
return (0, react_jsx_runtime.jsxs)("div", {
|
|
375
|
+
className: ModelsSection_module_css_default["modelReasoning"],
|
|
376
|
+
role: "group",
|
|
377
|
+
"aria-label": label,
|
|
378
|
+
children: [(0, react_jsx_runtime.jsxs)("div", {
|
|
379
|
+
className: ModelsSection_module_css_default["modelReasoningHead"],
|
|
380
|
+
children: [(0, react_jsx_runtime.jsxs)("span", {
|
|
381
|
+
className: `${ModelsSection_module_css_default["modelFieldLabel"]} ${ModelsSection_module_css_default["modelReasoningLabel"]}`,
|
|
382
|
+
children: [t("modelReasoning"), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
383
|
+
label: t("modelReasoningHelpText"),
|
|
384
|
+
side: "right",
|
|
385
|
+
delayMs: 0,
|
|
386
|
+
focusDelayMs: 0,
|
|
387
|
+
portal: true,
|
|
388
|
+
openOnClick: true,
|
|
389
|
+
children: (0, react_jsx_runtime.jsx)("button", {
|
|
390
|
+
type: "button",
|
|
391
|
+
className: ModelsSection_module_css_default["helpButton"],
|
|
392
|
+
"aria-label": t("modelReasoningHelp"),
|
|
393
|
+
children: "?"
|
|
394
|
+
})
|
|
395
|
+
})]
|
|
396
|
+
}), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Switch, {
|
|
397
|
+
checked: entries !== void 0,
|
|
398
|
+
label,
|
|
399
|
+
disabled,
|
|
400
|
+
onChange: (on) => {
|
|
401
|
+
write(on ? initialEntries : void 0);
|
|
402
|
+
}
|
|
403
|
+
})]
|
|
404
|
+
}), claude ? (0, react_jsx_runtime.jsx)(ClaudeAdaptiveThinking, { model, inherited: adaptiveFallback, position, disabled, t, onChange }) : null, entries === void 0 ? null : (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
405
|
+
entries.length > 0 ? (0, react_jsx_runtime.jsxs)("div", {
|
|
406
|
+
className: ModelsSection_module_css_default["modelReasoningRow"],
|
|
407
|
+
"aria-hidden": "true",
|
|
408
|
+
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
409
|
+
className: ModelsSection_module_css_default["modelFieldLabel"],
|
|
410
|
+
children: t("modelReasoningLevel")
|
|
411
|
+
}), (0, react_jsx_runtime.jsx)("span", {
|
|
412
|
+
className: ModelsSection_module_css_default["modelFieldLabel"],
|
|
413
|
+
children: t("modelReasoningValue")
|
|
414
|
+
})]
|
|
415
|
+
}) : null,
|
|
416
|
+
entries.map(([level, wire], index) => (0, react_jsx_runtime.jsxs)("div", {
|
|
417
|
+
className: ModelsSection_module_css_default["modelReasoningRow"],
|
|
418
|
+
children: [
|
|
419
|
+
(0, react_jsx_runtime.jsx)("select", {
|
|
420
|
+
className: `${ModelsSection_module_css_default["input"]} ${ModelsSection_module_css_default["selectInput"]}`,
|
|
421
|
+
value: level,
|
|
422
|
+
"aria-label": `${t("modelReasoningLevel")} ${String(index + 1)}`,
|
|
423
|
+
disabled,
|
|
424
|
+
onChange: (event) => {
|
|
425
|
+
changeLevel(entries, index, level, wire, event.target.value);
|
|
426
|
+
},
|
|
427
|
+
children: choicesFor(level).map((choice) => (0, react_jsx_runtime.jsx)("option", {
|
|
428
|
+
value: choice,
|
|
429
|
+
children: choice
|
|
430
|
+
}, choice))
|
|
431
|
+
}),
|
|
432
|
+
(0, react_jsx_runtime.jsx)("input", {
|
|
433
|
+
className: `${ModelsSection_module_css_default["input"]} ${ModelsSection_module_css_default["modelReasoningValueInput"]}`,
|
|
434
|
+
type: "text",
|
|
435
|
+
value: typing?.level === level ? typing.text : typeof wire === "string" ? wire : "",
|
|
436
|
+
placeholder: level === "off" ? t("modelReasoningOffValuePlaceholder") : level,
|
|
437
|
+
"aria-label": `${level} ${t("modelReasoningValue")}`,
|
|
438
|
+
"aria-invalid": !acceptedValue(level, wire),
|
|
439
|
+
disabled: disabled || level === "off",
|
|
440
|
+
onChange: (event) => {
|
|
441
|
+
editValue(entries, index, level, event.target.value);
|
|
442
|
+
},
|
|
443
|
+
onBlur: () => {
|
|
444
|
+
leaveValue(entries, index, level, wire);
|
|
445
|
+
}
|
|
446
|
+
}),
|
|
447
|
+
(0, react_jsx_runtime.jsx)("button", {
|
|
448
|
+
type: "button",
|
|
449
|
+
className: `${ModelsSection_module_css_default["iconButton"]} ${ModelsSection_module_css_default["iconButtonDanger"]}`,
|
|
450
|
+
"aria-label": `${t("modelReasoningRemove")} ${level}`,
|
|
451
|
+
title: t("modelReasoningRemove"),
|
|
452
|
+
disabled,
|
|
453
|
+
onClick: () => {
|
|
454
|
+
write(entries.filter((_entry, at) => at !== index));
|
|
455
|
+
},
|
|
456
|
+
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutlineRegular, { size: 14 })
|
|
457
|
+
})
|
|
458
|
+
]
|
|
459
|
+
}, index)),
|
|
460
|
+
refused ? (0, react_jsx_runtime.jsx)("p", {
|
|
461
|
+
className: ModelsSection_module_css_default["error"],
|
|
462
|
+
children: t("modelReasoningValueRequired")
|
|
463
|
+
}) : missingLevel ? (0, react_jsx_runtime.jsx)("p", {
|
|
464
|
+
className: ModelsSection_module_css_default["error"],
|
|
465
|
+
children: t("modelReasoningNeedsLevel")
|
|
466
|
+
}) : null,
|
|
467
|
+
(0, react_jsx_runtime.jsxs)("button", {
|
|
468
|
+
type: "button",
|
|
469
|
+
className: ModelsSection_module_css_default["addModelButton"],
|
|
470
|
+
disabled: disabled || levels.every((level) => used.includes(level)),
|
|
471
|
+
onClick: () => {
|
|
472
|
+
addLevel(entries);
|
|
473
|
+
},
|
|
474
|
+
children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPlusOutlineRegular, { size: 14 }), t("modelReasoningAdd")]
|
|
475
|
+
})
|
|
476
|
+
] })]
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
//#endregion
|
|
204
480
|
//#region lib/types/client/ModelRow.js
|
|
205
481
|
/**
|
|
206
482
|
* Render consistent model identity, capacity, and input-type controls.
|
|
@@ -248,43 +524,46 @@ window.__ModuleLoader__.load({
|
|
|
248
524
|
]
|
|
249
525
|
}), props.expanded ? (0, react_jsx_runtime.jsxs)("div", {
|
|
250
526
|
className: ModelsSection_module_css_default["modelAdvanced"],
|
|
251
|
-
children: [
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
527
|
+
children: [
|
|
528
|
+
["contextWindow", "maxTokens"].map((field) => (0, react_jsx_runtime.jsxs)("label", {
|
|
529
|
+
className: ModelsSection_module_css_default["modelField"],
|
|
530
|
+
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
531
|
+
className: ModelsSection_module_css_default["modelFieldLabel"],
|
|
532
|
+
children: t(field)
|
|
533
|
+
}), (0, react_jsx_runtime.jsx)("input", {
|
|
534
|
+
className: ModelsSection_module_css_default["input"],
|
|
535
|
+
type: "text",
|
|
536
|
+
inputMode: "numeric",
|
|
537
|
+
value: props[field].value,
|
|
538
|
+
placeholder: props[field].placeholder,
|
|
539
|
+
"aria-label": `${t(field)} ${String(position)}`,
|
|
540
|
+
disabled,
|
|
541
|
+
onChange: (event) => {
|
|
542
|
+
props[field].onChange(event.target.value);
|
|
543
|
+
},
|
|
544
|
+
onBlur: props[field].onBlur
|
|
545
|
+
})]
|
|
546
|
+
}, field)),
|
|
547
|
+
(0, react_jsx_runtime.jsx)(ModelInputTypes, {
|
|
548
|
+
model,
|
|
549
|
+
field: props.inputField,
|
|
550
|
+
position,
|
|
551
|
+
fallback: props.inputFallback,
|
|
552
|
+
disabled: disabled || props.inputLoading === true,
|
|
553
|
+
t,
|
|
554
|
+
onChange: props.onChange
|
|
555
|
+
}),
|
|
556
|
+
props.reasoningLevels !== void 0 && props.reasoningLevels.length > 0 ? (0, react_jsx_runtime.jsx)(ModelReasoningEfforts, {
|
|
557
|
+
model,
|
|
558
|
+
levels: props.reasoningLevels,
|
|
559
|
+
claude: props.thinkingPresets === true,
|
|
560
|
+
adaptiveFallback: props.adaptiveFallback,
|
|
561
|
+
position,
|
|
283
562
|
disabled,
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
})
|
|
287
|
-
|
|
563
|
+
t,
|
|
564
|
+
onChange: props.onChange
|
|
565
|
+
}) : null
|
|
566
|
+
]
|
|
288
567
|
}) : null]
|
|
289
568
|
});
|
|
290
569
|
}
|
|
@@ -660,10 +939,10 @@ window.__ModuleLoader__.load({
|
|
|
660
939
|
onChange(models.map((model, at) => {
|
|
661
940
|
if (at !== index) return model;
|
|
662
941
|
const cleared = new Set(Object.entries(next).filter(([, value]) => value === void 0 || value === "").map(([key]) => key));
|
|
663
|
-
return Object.fromEntries(Object.entries({
|
|
942
|
+
return carryClaudeDraft(model, Object.fromEntries(Object.entries({
|
|
664
943
|
...model,
|
|
665
944
|
...next
|
|
666
|
-
}).filter(([key]) => !cleared.has(key)));
|
|
945
|
+
}).filter(([key]) => !cleared.has(key))));
|
|
667
946
|
}));
|
|
668
947
|
};
|
|
669
948
|
const fetchModels = async () => {
|
|
@@ -782,6 +1061,8 @@ window.__ModuleLoader__.load({
|
|
|
782
1061
|
thinkingPresets: props.thinkingPresets,
|
|
783
1062
|
inputFallback: props.thinkingPresets && CLAUDE_KNOWN_MODELS[model.id] ? ["text", "image"] : inputDefaults.get(textOf(model, "id")) ?? props.defaultInput,
|
|
784
1063
|
inputLoading: catalogProvider !== void 0 && catalog === void 0,
|
|
1064
|
+
reasoningLevels: props.reasoningLevels,
|
|
1065
|
+
adaptiveFallback: props.adaptiveFallback,
|
|
785
1066
|
expanded: expanded.has(index),
|
|
786
1067
|
disabled,
|
|
787
1068
|
t,
|
|
@@ -799,6 +1080,11 @@ window.__ModuleLoader__.load({
|
|
|
799
1080
|
editCapacity(index, "maxTokens", text);
|
|
800
1081
|
}
|
|
801
1082
|
},
|
|
1083
|
+
onIdBlur: () => {
|
|
1084
|
+
if (!props.thinkingPresets) return;
|
|
1085
|
+
const next = finishClaudeDraft(model);
|
|
1086
|
+
if (next !== model) onChange(models.map((row, at) => at === index ? next : row));
|
|
1087
|
+
},
|
|
802
1088
|
onFieldChange: (field, value) => {
|
|
803
1089
|
patch(index, { [field]: value });
|
|
804
1090
|
},
|
|
@@ -825,7 +1111,7 @@ window.__ModuleLoader__.load({
|
|
|
825
1111
|
className: ModelsSection_module_css_default["addModelButton"],
|
|
826
1112
|
disabled,
|
|
827
1113
|
onClick: () => {
|
|
828
|
-
onChange([...models, props.thinkingPresets ?
|
|
1114
|
+
onChange([...models, props.thinkingPresets ? newClaudeModel() : { id: "" }]);
|
|
829
1115
|
},
|
|
830
1116
|
children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPlusOutlineRegular, { size: 14 }), t("addModel")]
|
|
831
1117
|
}),
|
|
@@ -926,6 +1212,9 @@ window.__ModuleLoader__.load({
|
|
|
926
1212
|
settingsPath: [...entry.settingsPath],
|
|
927
1213
|
active: active.has(entry.provider),
|
|
928
1214
|
...entry.declared === void 0 ? {} : { declared: entry.declared },
|
|
1215
|
+
...entry.defaultBaseURL === void 0 ? {} : { defaultBaseURL: entry.defaultBaseURL },
|
|
1216
|
+
...entry.baseURLEnv === void 0 ? {} : { baseURLEnv: entry.baseURLEnv },
|
|
1217
|
+
...entry.nativeAuth === void 0 ? {} : { nativeAuth: entry.nativeAuth },
|
|
929
1218
|
...entry.error === void 0 ? {} : { error: entry.error }
|
|
930
1219
|
}));
|
|
931
1220
|
for (const provider of registered) {
|
|
@@ -969,6 +1258,26 @@ window.__ModuleLoader__.load({
|
|
|
969
1258
|
if (list?.type !== "union" || list.list === void 0) return [];
|
|
970
1259
|
return list.list.map((entry) => entry.value).filter((value) => typeof value === "string");
|
|
971
1260
|
}
|
|
1261
|
+
/**
|
|
1262
|
+
* The reasoning levels a hand-declared route's models may declare, read out of
|
|
1263
|
+
* the owning namespace's own schema for the same reason as
|
|
1264
|
+
* {@link protocolChoices}: the levels the page offers and the keys the
|
|
1265
|
+
* adapter accepts in `reasoningEfforts` come from the same `Config`.
|
|
1266
|
+
* @param namespace - the namespace view whose schema declares the profile shape.
|
|
1267
|
+
* @param schema - settings schema operations.
|
|
1268
|
+
* @returns the levels in the schema's escalation order, or an empty list when the schema has none.
|
|
1269
|
+
*/
|
|
1270
|
+
function reasoningLevelChoices(namespace, schema) {
|
|
1271
|
+
if (namespace === void 0) return [];
|
|
1272
|
+
const path = [
|
|
1273
|
+
"providers",
|
|
1274
|
+
PROBE_ROUTE,
|
|
1275
|
+
"models",
|
|
1276
|
+
"0",
|
|
1277
|
+
"reasoningEfforts"
|
|
1278
|
+
];
|
|
1279
|
+
return (((schema.nodeAtPath(schema.rehydrate(namespace.schema), path)?.list ?? []).find((branch) => branch.type === "dict")?.sKey)?.list ?? []).map((entry) => entry.value).filter((value) => typeof value === "string");
|
|
1280
|
+
}
|
|
972
1281
|
/** The credential reference a resolved profile names (its `apiKeyEnv` field). */
|
|
973
1282
|
function apiKeyEnvOf(namespace, path, schema) {
|
|
974
1283
|
if (namespace === void 0) return void 0;
|
|
@@ -1053,7 +1362,9 @@ window.__ModuleLoader__.load({
|
|
|
1053
1362
|
}
|
|
1054
1363
|
const mirrored = this.describeFace.getSnapshot();
|
|
1055
1364
|
if (mirrored.view === void 0) {
|
|
1056
|
-
|
|
1365
|
+
/* v8 ignore next -- SettingsDescribeFace.ensure settles with a view or the read's error */
|
|
1366
|
+
if (mirrored.error === null) throw new Error("settings describe settled with neither a view nor an error");
|
|
1367
|
+
this.failLoad(mirrored.error);
|
|
1057
1368
|
return;
|
|
1058
1369
|
}
|
|
1059
1370
|
const providers = joinProviderDirectory(registered.value, declared.value);
|
|
@@ -1074,13 +1385,16 @@ window.__ModuleLoader__.load({
|
|
|
1074
1385
|
const catalog = await this.ctx.remote.session.modelCatalog();
|
|
1075
1386
|
for (const row of rows) if (row.entry.provider === "deepseek-account") row.accountAvailable = catalog.ok && catalog.value.groups.some((group) => group.id === "deepseek-account" && group.models.length > 0);
|
|
1076
1387
|
}
|
|
1077
|
-
const refs = [...new Set(rows.filter((row) => row.entry.provider !== "deepseek-account").
|
|
1078
|
-
|
|
1388
|
+
const refs = [...new Set(rows.filter((row) => row.entry.provider !== "deepseek-account").flatMap((row) => row.apiKeyEnv === void 0 ? [deriveKeyRef(row.entry.provider), ...row.entry.nativeAuth?.env ?? []] : [row.apiKeyEnv]))];
|
|
1389
|
+
const credentials = {};
|
|
1079
1390
|
let credentialError = null;
|
|
1080
|
-
|
|
1081
|
-
const response = await this.ctx.remote.credentials.describe(refs);
|
|
1082
|
-
if (response.ok) credentials
|
|
1083
|
-
else
|
|
1391
|
+
for (let index = 0; index < refs.length; index += 64) {
|
|
1392
|
+
const response = await this.ctx.remote.credentials.describe(refs.slice(index, index + 64));
|
|
1393
|
+
if (response.ok) Object.assign(credentials, response.value);
|
|
1394
|
+
else {
|
|
1395
|
+
credentialError = response.error.message;
|
|
1396
|
+
break;
|
|
1397
|
+
}
|
|
1084
1398
|
}
|
|
1085
1399
|
if (generation !== this.generation) return;
|
|
1086
1400
|
this.store.update((s) => {
|
|
@@ -1095,7 +1409,11 @@ window.__ModuleLoader__.load({
|
|
|
1095
1409
|
return {
|
|
1096
1410
|
...row,
|
|
1097
1411
|
...named === void 0 ? {} : { credential: named },
|
|
1098
|
-
...derived === void 0 ? {} : { derivedCredential: derived }
|
|
1412
|
+
...derived === void 0 ? {} : { derivedCredential: derived },
|
|
1413
|
+
...credentialError === null ? { credentialChecks: Object.fromEntries((row.apiKeyEnv === void 0 ? row.entry.nativeAuth?.env ?? [] : [row.apiKeyEnv]).flatMap((ref) => {
|
|
1414
|
+
const info = credentials[ref];
|
|
1415
|
+
return info === void 0 ? [] : [[ref, info]];
|
|
1416
|
+
})) } : {}
|
|
1099
1417
|
};
|
|
1100
1418
|
});
|
|
1101
1419
|
s.namespaces = namespaces;
|
|
@@ -1215,11 +1533,12 @@ window.__ModuleLoader__.load({
|
|
|
1215
1533
|
* and at least one model — are required here rather than at load, so the
|
|
1216
1534
|
* failure names the field while the user is still looking at it.
|
|
1217
1535
|
*
|
|
1218
|
-
* There is deliberately no reasoning-effort control, here or
|
|
1219
|
-
* card: effort is a per-MODEL capability, and the models under
|
|
1220
|
-
* disagree about it, so a provider-scoped control can only be set
|
|
1221
|
-
* some of them reject.
|
|
1222
|
-
*
|
|
1536
|
+
* There is deliberately no provider-scoped reasoning-effort control, here or
|
|
1537
|
+
* on the editor card: effort is a per-MODEL capability, and the models under
|
|
1538
|
+
* one provider disagree about it, so a provider-scoped control can only be set
|
|
1539
|
+
* to a value some of them reject. Each model row of a hand-declared route
|
|
1540
|
+
* declares its own `reasoningEfforts` instead, and the composer's model picker
|
|
1541
|
+
* offers each model those levels.
|
|
1223
1542
|
*/
|
|
1224
1543
|
/** The settings namespace a hand-declared provider is written into. */
|
|
1225
1544
|
const NS$1 = "llm-pi-ai";
|
|
@@ -1246,7 +1565,7 @@ window.__ModuleLoader__.load({
|
|
|
1246
1565
|
* @returns the creation card.
|
|
1247
1566
|
*/
|
|
1248
1567
|
function CustomProviderCard(props) {
|
|
1249
|
-
const { taken, protocols, operations, t, onBusyChange } = props;
|
|
1568
|
+
const { taken, protocols, reasoningLevels, operations, t, onBusyChange } = props;
|
|
1250
1569
|
const [openedAt] = (0, react.useState)(() => props.revision);
|
|
1251
1570
|
const [route, setRoute] = (0, react.useState)("");
|
|
1252
1571
|
const [displayName, setDisplayName] = (0, react.useState)("");
|
|
@@ -1279,7 +1598,7 @@ window.__ModuleLoader__.load({
|
|
|
1279
1598
|
const routeTaken = taken.includes(route);
|
|
1280
1599
|
const normalizedBaseURL = baseURL.trim();
|
|
1281
1600
|
const baseUrlInvalid = baseURL.length > 0 && !isHttpUrl(normalizedBaseURL);
|
|
1282
|
-
const modelFailure = validateDeepSeekModels(models);
|
|
1601
|
+
const modelFailure = validateDeepSeekModels(models) ?? validateReasoningEfforts(models);
|
|
1283
1602
|
const keyFailure = apiKeyFailure(keyDraft);
|
|
1284
1603
|
const keyValue = keyDraft.trim();
|
|
1285
1604
|
const ready = route.length > 0 && !routeInvalid && !routeTaken && normalizedBaseURL.length > 0 && !baseUrlInvalid && models.length > 0 && modelFailure === void 0 && keyFailure === void 0;
|
|
@@ -1300,7 +1619,7 @@ window.__ModuleLoader__.load({
|
|
|
1300
1619
|
const written = await operations.writeSettings(NS$1, [{
|
|
1301
1620
|
op: "set",
|
|
1302
1621
|
path: ["providers", route],
|
|
1303
|
-
value: profile
|
|
1622
|
+
value: isAdaptiveClaude ? withNativeClaudeProfile(profile) : profile
|
|
1304
1623
|
}], openedAt);
|
|
1305
1624
|
if (written.kind !== "written") return written.kind === "conflict" ? t("conflict") : written.message;
|
|
1306
1625
|
setCommitted(true);
|
|
@@ -1335,11 +1654,6 @@ window.__ModuleLoader__.load({
|
|
|
1335
1654
|
return (0, react_jsx_runtime.jsxs)("div", {
|
|
1336
1655
|
className: ModelsSection_module_css_default["editor"],
|
|
1337
1656
|
children: [
|
|
1338
|
-
isAdaptiveClaude ? (0, react_jsx_runtime.jsxs)("p", {
|
|
1339
|
-
className: ModelsSection_module_css_default["savedNotice"],
|
|
1340
|
-
role: "status",
|
|
1341
|
-
children: [t("adaptiveClaudeEnabled"), " ", (0, react_jsx_runtime.jsx)(ClaudeThinkingHelp, { t })]
|
|
1342
|
-
}) : null,
|
|
1343
1657
|
(0, react_jsx_runtime.jsxs)("div", {
|
|
1344
1658
|
className: ModelsSection_module_css_default["field"],
|
|
1345
1659
|
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
@@ -1429,10 +1743,8 @@ window.__ModuleLoader__.load({
|
|
|
1429
1743
|
className: ModelsSection_module_css_default["fieldLabel"],
|
|
1430
1744
|
children: t("keyInput")
|
|
1431
1745
|
}),
|
|
1432
|
-
(0, react_jsx_runtime.jsx)(
|
|
1433
|
-
|
|
1434
|
-
type: "password",
|
|
1435
|
-
autoComplete: "new-password",
|
|
1746
|
+
(0, react_jsx_runtime.jsx)(ApiKeyInput, {
|
|
1747
|
+
t,
|
|
1436
1748
|
value: keyDraft,
|
|
1437
1749
|
placeholder: t("keyPlaceholder"),
|
|
1438
1750
|
"aria-label": t("keyInput"),
|
|
@@ -1450,6 +1762,7 @@ window.__ModuleLoader__.load({
|
|
|
1450
1762
|
(0, react_jsx_runtime.jsx)(ModelListEditor, {
|
|
1451
1763
|
models,
|
|
1452
1764
|
onChange: setModels,
|
|
1765
|
+
reasoningLevels,
|
|
1453
1766
|
probe: {
|
|
1454
1767
|
settingsNs: NS$1,
|
|
1455
1768
|
baseURL: normalizedBaseURL,
|
|
@@ -1565,7 +1878,6 @@ window.__ModuleLoader__.load({
|
|
|
1565
1878
|
const { namespace, schema, settingsPath, operations, t } = props;
|
|
1566
1879
|
const [draft, setDraft] = (0, react.useState)(() => draftAt(schema, namespace, settingsPath));
|
|
1567
1880
|
const [keyDraft, setKeyDraft] = (0, react.useState)("");
|
|
1568
|
-
const [keyState, setKeyState] = (0, react.useState)(void 0);
|
|
1569
1881
|
const [busy, setBusy] = (0, react.useState)(false);
|
|
1570
1882
|
const [listBusy, setListBusy] = (0, react.useState)(false);
|
|
1571
1883
|
const { onBusyChange } = props;
|
|
@@ -1587,30 +1899,13 @@ window.__ModuleLoader__.load({
|
|
|
1587
1899
|
]);
|
|
1588
1900
|
const fallback = schema.getPath(namespace.value, settingsPath);
|
|
1589
1901
|
const disabled = props.readOnly || busy;
|
|
1590
|
-
const
|
|
1591
|
-
const layout = accountProvider ? "deepseek" : layoutOf(namespace.ns);
|
|
1902
|
+
const layout = layoutOf(namespace.ns);
|
|
1592
1903
|
const keyRef = refFor(schema, namespace, settingsPath, props.provider);
|
|
1593
1904
|
const protocols = (0, react.useMemo)(() => layout === "pi-ai" ? protocolChoices(namespace, schema) : [], [
|
|
1594
1905
|
layout,
|
|
1595
1906
|
namespace,
|
|
1596
1907
|
schema
|
|
1597
1908
|
]);
|
|
1598
|
-
(0, react.useEffect)(() => {
|
|
1599
|
-
if (accountProvider) return;
|
|
1600
|
-
let stale = false;
|
|
1601
|
-
setKeyState(void 0);
|
|
1602
|
-
operations.describeCredential(keyRef).then((described) => {
|
|
1603
|
-
if (stale) return;
|
|
1604
|
-
setKeyState(described);
|
|
1605
|
-
});
|
|
1606
|
-
return () => {
|
|
1607
|
-
stale = true;
|
|
1608
|
-
};
|
|
1609
|
-
}, [
|
|
1610
|
-
operations,
|
|
1611
|
-
keyRef,
|
|
1612
|
-
accountProvider
|
|
1613
|
-
]);
|
|
1614
1909
|
const stringAt = (source, key) => {
|
|
1615
1910
|
const value = schema.getPath(source, [key]);
|
|
1616
1911
|
return typeof value === "string" && value.trim().length > 0 ? value : void 0;
|
|
@@ -1619,7 +1914,15 @@ window.__ModuleLoader__.load({
|
|
|
1619
1914
|
const value = next === void 0 || next.trim().length === 0 ? void 0 : next;
|
|
1620
1915
|
setDraft((current) => value === void 0 ? schema.deletePath(current, [key]) : schema.setPath(current, [key], value));
|
|
1621
1916
|
};
|
|
1622
|
-
const
|
|
1917
|
+
const reasoningLevels = (0, react.useMemo)(() => layout === "pi-ai" && props.declared === true ? reasoningLevelChoices(namespace, schema) : [], [
|
|
1918
|
+
layout,
|
|
1919
|
+
props.declared,
|
|
1920
|
+
namespace,
|
|
1921
|
+
schema
|
|
1922
|
+
]);
|
|
1923
|
+
const editsReasoning = reasoningLevels.length > 0;
|
|
1924
|
+
const validateModels = (value) => validateDeepSeekModels(value) ?? (editsReasoning ? validateReasoningEfforts(value) : void 0);
|
|
1925
|
+
const modelFailure = validateModels(schema.getPath(draft, ["models"]));
|
|
1623
1926
|
const keyFailure = apiKeyFailure(keyDraft);
|
|
1624
1927
|
const keyValue = keyDraft.trim();
|
|
1625
1928
|
const shownKeyFailure = (props.credentialRequired === true && keyDraft.length > 0 && keyValue.length === 0 ? "keyRequired" : void 0) ?? keyFailure;
|
|
@@ -1643,7 +1946,7 @@ window.__ModuleLoader__.load({
|
|
|
1643
1946
|
const credentialDraft = layout === "pi-ai" && stringAt(draft, "apiKeyEnv") === void 0 && stringAt(fallback, "apiKeyEnv") === void 0 && keyValue.length > 0 ? schema.setPath(draft, ["apiKeyEnv"], keyRef) : draft;
|
|
1644
1947
|
const next = props.thinkingPresets === true ? withNativeClaudeProfile(credentialDraft) : credentialDraft;
|
|
1645
1948
|
if (props.credentialOnly !== true) {
|
|
1646
|
-
const failure =
|
|
1949
|
+
const failure = validateModels(schema.getPath(next, ["models"]));
|
|
1647
1950
|
/* v8 ignore next 3 -- unreachable from the card: the same failure disables submit */
|
|
1648
1951
|
if (failure !== void 0) return `${t("model")} ${String(failure.index + 1)}: ${t(failure.key)}`;
|
|
1649
1952
|
}
|
|
@@ -1693,7 +1996,6 @@ window.__ModuleLoader__.load({
|
|
|
1693
1996
|
props.t("settingsPathUnresolvable")
|
|
1694
1997
|
]
|
|
1695
1998
|
});
|
|
1696
|
-
const keyLocked = keyState?.writable === false;
|
|
1697
1999
|
/**
|
|
1698
2000
|
* The catalog beneath the user layer: what the composition entry pinned, or
|
|
1699
2001
|
* else the schema default that `resolve` would supply. The effective value
|
|
@@ -1717,7 +2019,38 @@ window.__ModuleLoader__.load({
|
|
|
1717
2019
|
const defaultContextWindow = schema.getPath(fallback, ["defaultContextWindow"]);
|
|
1718
2020
|
const defaultMaxTokens = schema.getPath(fallback, ["maxTokens"]);
|
|
1719
2021
|
const defaultInput = schema.getPath(fallback, ["defaultInput"]);
|
|
1720
|
-
const
|
|
2022
|
+
const baseURL = stringAt(fallback, "baseURL") ?? props.defaultBaseURL;
|
|
2023
|
+
const endpointEnv = props.baseURLEnv ?? [];
|
|
2024
|
+
const endpointHint = family === "deepseek" ? t("deepSeekEndpointHint") : baseURL === void 0 && endpointEnv.length > 0 ? t("baseUrlEnvironment").replace("{env}", () => endpointEnv.join(", ")) : void 0;
|
|
2025
|
+
const namedRef = stringAt(fallback, "apiKeyEnv");
|
|
2026
|
+
const nativeAuth = namedRef === void 0 ? props.nativeAuth : void 0;
|
|
2027
|
+
const authRefs = namedRef === void 0 ? (nativeAuth?.env ?? []).filter((ref) => !endpointEnv.includes(ref)) : [namedRef];
|
|
2028
|
+
const visibleRefs = authRefs.filter((ref) => !ref.toLowerCase().includes("oauth"));
|
|
2029
|
+
const keyHint = visibleRefs[0];
|
|
2030
|
+
const checkedRefs = authRefs.map((ref) => [ref, props.credentialChecks?.[ref] ?? (ref === namedRef ? props.credential : void 0)]);
|
|
2031
|
+
const detected = checkedRefs.find(([, info]) => info?.configured === true);
|
|
2032
|
+
const detectedRef = detected?.[0];
|
|
2033
|
+
const detectedVisibleRef = detectedRef === void 0 || !visibleRefs.includes(detectedRef) ? void 0 : detectedRef;
|
|
2034
|
+
const missingRefs = checkedRefs.length > 0 && checkedRefs.every(([, info]) => info?.configured === false);
|
|
2035
|
+
const savedCredential = detected?.[1]?.source === "file";
|
|
2036
|
+
const credentialHint = keyDraft.length > 0 || savedCredential || keyHint === void 0 || props.credentialRequired === true ? void 0 : t(detectedRef === void 0 ? missingRefs ? "keyFallbackMissing" : "keyFallbackUnchecked" : detectedVisibleRef === void 0 ? "keyFallbackDetectedHidden" : "keyFallbackDetected").replace("{hint}", () => detectedVisibleRef ?? keyHint);
|
|
2037
|
+
const keyHelp = visibleRefs.length === 0 ? void 0 : t("keyHelp").replace("{env}", () => visibleRefs.join(" / "));
|
|
2038
|
+
const authHelp = keyHelp === void 0 ? null : (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
2039
|
+
label: keyHelp,
|
|
2040
|
+
side: "right",
|
|
2041
|
+
delayMs: 0,
|
|
2042
|
+
focusDelayMs: 0,
|
|
2043
|
+
portal: true,
|
|
2044
|
+
openOnClick: true,
|
|
2045
|
+
children: (0, react_jsx_runtime.jsx)("button", {
|
|
2046
|
+
type: "button",
|
|
2047
|
+
className: ModelsSection_module_css_default["helpButton"],
|
|
2048
|
+
"aria-label": t("authHelp"),
|
|
2049
|
+
children: "?"
|
|
2050
|
+
})
|
|
2051
|
+
});
|
|
2052
|
+
const keylessNativeAuth = nativeAuth?.env.length === 0 && nativeAuth.oauth;
|
|
2053
|
+
const keyPlaceholder = keyHint === void 0 || props.credentialRequired === true ? t("keyPlaceholder") : t(savedCredential ? "keyPlaceholderSaved" : "keyPlaceholderFallback").replace("{hint}", () => keyHint);
|
|
1721
2054
|
/** What both family editors take: the rows, whose layer owns them, and the two writes. */
|
|
1722
2055
|
const catalogProps = {
|
|
1723
2056
|
models,
|
|
@@ -1731,33 +2064,32 @@ window.__ModuleLoader__.load({
|
|
|
1731
2064
|
setDraft((current) => schema.deletePath(current, ["models"]));
|
|
1732
2065
|
}
|
|
1733
2066
|
};
|
|
1734
|
-
|
|
1735
|
-
...catalogProps,
|
|
1736
|
-
defaultContextWindow: typeof defaultContextWindow === "number" ? defaultContextWindow : void 0,
|
|
1737
|
-
defaultMaxTokens: typeof defaultMaxTokens === "number" ? defaultMaxTokens : void 0
|
|
1738
|
-
});
|
|
1739
|
-
return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsxs)("div", {
|
|
2067
|
+
return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [keylessNativeAuth ? null : (0, react_jsx_runtime.jsxs)("div", {
|
|
1740
2068
|
className: ModelsSection_module_css_default["field"],
|
|
1741
2069
|
children: [
|
|
1742
|
-
(0, react_jsx_runtime.
|
|
2070
|
+
(0, react_jsx_runtime.jsxs)("span", {
|
|
1743
2071
|
className: ModelsSection_module_css_default["fieldLabel"],
|
|
1744
|
-
children: t("keyInput")
|
|
2072
|
+
children: [t("keyInput"), authHelp]
|
|
1745
2073
|
}),
|
|
1746
|
-
(0, react_jsx_runtime.jsx)(
|
|
1747
|
-
|
|
1748
|
-
type: "password",
|
|
1749
|
-
autoComplete: "new-password",
|
|
2074
|
+
(0, react_jsx_runtime.jsx)(ApiKeyInput, {
|
|
2075
|
+
t,
|
|
1750
2076
|
value: keyDraft,
|
|
1751
2077
|
placeholder: keyPlaceholder,
|
|
1752
2078
|
"aria-label": t("keyInput"),
|
|
1753
2079
|
"aria-invalid": shownKeyFailure !== void 0,
|
|
2080
|
+
"aria-describedby": credentialHint === void 0 ? void 0 : `${props.provider}-credential-hint`,
|
|
1754
2081
|
required: props.credentialRequired === true,
|
|
1755
2082
|
autoFocus: props.autoFocusCredential === true,
|
|
1756
|
-
disabled
|
|
2083
|
+
disabled,
|
|
1757
2084
|
onChange: (event) => {
|
|
1758
2085
|
setKeyDraft(event.target.value);
|
|
1759
2086
|
}
|
|
1760
2087
|
}),
|
|
2088
|
+
credentialHint === void 0 ? null : (0, react_jsx_runtime.jsx)("p", {
|
|
2089
|
+
id: `${props.provider}-credential-hint`,
|
|
2090
|
+
className: ModelsSection_module_css_default[missingRefs ? "notice" : detectedRef === void 0 ? "advancedHint" : "savedNotice"],
|
|
2091
|
+
children: credentialHint
|
|
2092
|
+
}),
|
|
1761
2093
|
shownKeyFailure === void 0 ? null : (0, react_jsx_runtime.jsx)("p", {
|
|
1762
2094
|
className: ModelsSection_module_css_default["error"],
|
|
1763
2095
|
children: t(shownKeyFailure)
|
|
@@ -1799,19 +2131,19 @@ window.__ModuleLoader__.load({
|
|
|
1799
2131
|
className: ModelsSection_module_css_default["input"],
|
|
1800
2132
|
type: "text",
|
|
1801
2133
|
value: stringAt(draft, "baseURL") ?? "",
|
|
1802
|
-
placeholder: family === "deepseek" ? t("deepSeekBaseUrl") :
|
|
1803
|
-
"aria-describedby":
|
|
2134
|
+
placeholder: family === "deepseek" ? t("deepSeekBaseUrl") : baseURL === void 0 ? t(endpointEnv.length > 0 ? "baseUrlConfigured" : "baseUrlDefault") : t("baseUrlPlaceholder").replace("{url}", () => baseURL),
|
|
2135
|
+
"aria-describedby": endpointHint === void 0 ? void 0 : `${props.provider}-endpoint-hint`,
|
|
1804
2136
|
"aria-label": t("baseUrl"),
|
|
1805
2137
|
disabled,
|
|
1806
2138
|
onChange: (event) => {
|
|
1807
2139
|
setField("baseURL", event.target.value === "" ? void 0 : event.target.value);
|
|
1808
2140
|
}
|
|
1809
2141
|
}),
|
|
1810
|
-
|
|
2142
|
+
endpointHint === void 0 ? null : (0, react_jsx_runtime.jsx)("span", {
|
|
1811
2143
|
id: `${props.provider}-endpoint-hint`,
|
|
1812
2144
|
className: ModelsSection_module_css_default["advancedHint"],
|
|
1813
|
-
children:
|
|
1814
|
-
})
|
|
2145
|
+
children: endpointHint
|
|
2146
|
+
})
|
|
1815
2147
|
]
|
|
1816
2148
|
}),
|
|
1817
2149
|
ownsIdentity ? (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -1843,10 +2175,12 @@ window.__ModuleLoader__.load({
|
|
|
1843
2175
|
}) : (0, react_jsx_runtime.jsx)(ModelListEditor, {
|
|
1844
2176
|
...catalogProps,
|
|
1845
2177
|
catalogProvider: props.declared === true ? void 0 : props.provider,
|
|
2178
|
+
reasoningLevels,
|
|
1846
2179
|
defaultInput: Array.isArray(defaultInput) ? defaultInput : void 0,
|
|
1847
2180
|
probe,
|
|
1848
2181
|
probeBlocked: keyFailure,
|
|
1849
2182
|
thinkingPresets: props.thinkingPresets === true,
|
|
2183
|
+
adaptiveFallback: schema.getPath(draft, ["compat", "forceAdaptiveThinking"]),
|
|
1850
2184
|
operations,
|
|
1851
2185
|
onBusyChange: setListBusy
|
|
1852
2186
|
})
|
|
@@ -1922,12 +2256,17 @@ window.__ModuleLoader__.load({
|
|
|
1922
2256
|
* post-apply reload.
|
|
1923
2257
|
*/
|
|
1924
2258
|
/** Render an editor for either the setup posture or an expanded provider row. */
|
|
1925
|
-
function renderProviderEditor({ target, ...props }) {
|
|
2259
|
+
function renderProviderEditor({ target, row, ...props }) {
|
|
1926
2260
|
return (0, react_jsx_runtime.jsx)(ProviderEditor, {
|
|
1927
2261
|
provider: target.provider,
|
|
1928
2262
|
displayName: target.displayName,
|
|
1929
2263
|
settingsPath: target.settingsPath,
|
|
1930
2264
|
...target.declared === true ? { declared: true } : {},
|
|
2265
|
+
...target.defaultBaseURL === void 0 ? {} : { defaultBaseURL: target.defaultBaseURL },
|
|
2266
|
+
...target.baseURLEnv === void 0 ? {} : { baseURLEnv: target.baseURLEnv },
|
|
2267
|
+
...target.nativeAuth === void 0 ? {} : { nativeAuth: target.nativeAuth },
|
|
2268
|
+
...row.credential === void 0 ? {} : { credential: row.credential },
|
|
2269
|
+
...row.credentialChecks === void 0 ? {} : { credentialChecks: row.credentialChecks },
|
|
1931
2270
|
...props
|
|
1932
2271
|
});
|
|
1933
2272
|
}
|
|
@@ -1992,9 +2331,14 @@ window.__ModuleLoader__.load({
|
|
|
1992
2331
|
settingsNs: row.entry.settingsNs,
|
|
1993
2332
|
settingsPath: row.entry.settingsPath,
|
|
1994
2333
|
...credentialRef === void 0 ? {} : { credentialRef },
|
|
1995
|
-
...row.entry.declared === true ? { declared: true } : {}
|
|
2334
|
+
...row.entry.declared === true ? { declared: true } : {},
|
|
2335
|
+
...row.entry.defaultBaseURL === void 0 ? {} : { defaultBaseURL: row.entry.defaultBaseURL },
|
|
2336
|
+
...row.entry.baseURLEnv === void 0 ? {} : { baseURLEnv: row.entry.baseURLEnv },
|
|
2337
|
+
...row.entry.nativeAuth === void 0 ? {} : { nativeAuth: row.entry.nativeAuth }
|
|
1996
2338
|
};
|
|
1997
2339
|
}
|
|
2340
|
+
// BEGIN CLAUDE HELPERS
|
|
2341
|
+
// These helpers are inserted into the upstream client module by build-client.mjs.
|
|
1998
2342
|
const CLAUDE_DISCOVERY_API = "mofeng-anthropic-models";
|
|
1999
2343
|
const CLAUDE_PROVIDER_SETTINGS_NS = "dsh-claude-provider";
|
|
2000
2344
|
const CLAUDE_PROVIDER_TYPE = "claude-adaptive";
|
|
@@ -2007,120 +2351,131 @@ window.__ModuleLoader__.load({
|
|
|
2007
2351
|
"claude-haiku-5-5": Object.freeze({ contextWindow: 1000000, maxTokens: 128000, preset: "five" }),
|
|
2008
2352
|
"claude-haiku-4-5-20251001": Object.freeze({ contextWindow: 200000, maxTokens: 64000, preset: "toggle" }),
|
|
2009
2353
|
"claude-haiku-4-5": Object.freeze({ contextWindow: 200000, maxTokens: 64000, preset: "toggle" }),
|
|
2354
|
+
"claude-opus-4-5-20251101": Object.freeze({ contextWindow: 200000, maxTokens: 64000, preset: "toggle" }),
|
|
2355
|
+
"claude-opus-4-5": Object.freeze({ contextWindow: 200000, maxTokens: 64000, preset: "toggle" }),
|
|
2010
2356
|
"claude-opus-4-6": Object.freeze({ contextWindow: 1000000, maxTokens: 128000, preset: "four" }),
|
|
2011
2357
|
"claude-opus-4-7": Object.freeze({ contextWindow: 1000000, maxTokens: 128000, preset: "five" }),
|
|
2012
2358
|
"claude-opus-4-8": Object.freeze({ contextWindow: 1000000, maxTokens: 128000, preset: "five" }),
|
|
2013
2359
|
"claude-opus-5": Object.freeze({ contextWindow: 1000000, maxTokens: 128000, preset: "five" }),
|
|
2014
2360
|
"claude-opus-5-5": Object.freeze({ contextWindow: 1000000, maxTokens: 128000, preset: "five" }),
|
|
2361
|
+
"claude-sonnet-4-5-20250929": Object.freeze({ contextWindow: 200000, maxTokens: 64000, preset: "toggle" }),
|
|
2362
|
+
"claude-sonnet-4-5": Object.freeze({ contextWindow: 200000, maxTokens: 64000, preset: "toggle" }),
|
|
2015
2363
|
"claude-sonnet-4-6": Object.freeze({ contextWindow: 1000000, maxTokens: 64000, preset: "four" }),
|
|
2016
2364
|
"claude-sonnet-5-5": Object.freeze({ contextWindow: 1000000, maxTokens: 128000, preset: "five" }),
|
|
2017
2365
|
"claude-sonnet-5": Object.freeze({ contextWindow: 1000000, maxTokens: 128000, preset: "five" })
|
|
2018
2366
|
});
|
|
2367
|
+
const CLAUDE_PENDING_MODELS = new WeakSet();
|
|
2368
|
+
|
|
2019
2369
|
function reasoningEffortsForPreset(preset) {
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2370
|
+
if (preset === "toggle") return { ...CLAUDE_TOGGLE_EFFORTS };
|
|
2371
|
+
if (preset === "four") return { ...CLAUDE_FOUR_EFFORTS };
|
|
2372
|
+
return { ...CLAUDE_FIVE_EFFORTS };
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
function claudeAdaptiveEnabled(model, inherited) {
|
|
2376
|
+
const known = CLAUDE_KNOWN_MODELS[model?.id];
|
|
2377
|
+
if (known?.preset === "toggle") return false;
|
|
2378
|
+
const explicit = model?.compat?.forceAdaptiveThinking;
|
|
2379
|
+
if (typeof explicit === "boolean") return explicit;
|
|
2380
|
+
if (typeof inherited === "boolean") return inherited;
|
|
2381
|
+
return known !== undefined && known.preset !== "toggle";
|
|
2382
|
+
}
|
|
2383
|
+
|
|
2384
|
+
function withClaudeAdaptive(model, enabled) {
|
|
2385
|
+
return { ...model, compat: { ...model.compat, forceAdaptiveThinking: enabled } };
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2388
|
+
// Defaults are applied only when adopting a new model, never when saving an edit.
|
|
2389
|
+
function withDefaultClaudeReasoning(model) {
|
|
2390
|
+
const known = CLAUDE_KNOWN_MODELS[model.id];
|
|
2391
|
+
const next = Object.hasOwn(model, "reasoningEfforts") ? { ...model } : {
|
|
2392
|
+
...model, reasoningEfforts: reasoningEffortsForPreset(known?.preset ?? "five")
|
|
2393
|
+
};
|
|
2394
|
+
return typeof next.compat?.forceAdaptiveThinking === "boolean" ? next
|
|
2395
|
+
: withClaudeAdaptive(next, known?.preset !== "toggle");
|
|
2023
2396
|
}
|
|
2397
|
+
|
|
2024
2398
|
function withKnownClaudeInput(model) {
|
|
2025
|
-
|
|
2026
|
-
|
|
2399
|
+
if (!CLAUDE_KNOWN_MODELS[model?.id] || Array.isArray(model.input)) return { ...model };
|
|
2400
|
+
return { ...model, input: ["text", "image"] };
|
|
2027
2401
|
}
|
|
2402
|
+
|
|
2028
2403
|
function withFetchedClaudeMetadata(model) {
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2404
|
+
const known = CLAUDE_KNOWN_MODELS[model?.id];
|
|
2405
|
+
return withDefaultClaudeReasoning(withKnownClaudeInput({
|
|
2406
|
+
...model,
|
|
2407
|
+
...known === undefined ? {} : {
|
|
2408
|
+
contextWindow: model.contextWindow ?? known.contextWindow,
|
|
2409
|
+
maxTokens: model.maxTokens ?? known.maxTokens
|
|
2410
|
+
}
|
|
2411
|
+
}));
|
|
2032
2412
|
}
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
}
|
|
2039
|
-
return "five";
|
|
2413
|
+
|
|
2414
|
+
function newClaudeModel() {
|
|
2415
|
+
const model = { id: "" };
|
|
2416
|
+
CLAUDE_PENDING_MODELS.add(model);
|
|
2417
|
+
return model;
|
|
2040
2418
|
}
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
: { ...model, reasoningEfforts: reasoningEffortsForPreset("five") };
|
|
2419
|
+
|
|
2420
|
+
function carryClaudeDraft(model, next) {
|
|
2421
|
+
if (CLAUDE_PENDING_MODELS.has(model)) CLAUDE_PENDING_MODELS.add(next);
|
|
2422
|
+
return next;
|
|
2046
2423
|
}
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
&& ["low", "medium", "high", "max"].every((level) => typeof efforts[level] === "string" && efforts[level].length > 0);
|
|
2052
|
-
const compat = { ...(next.compat ?? {}) };
|
|
2053
|
-
if (adaptive) compat.forceAdaptiveThinking = true;
|
|
2054
|
-
else Reflect.deleteProperty(compat, "forceAdaptiveThinking");
|
|
2055
|
-
const { compat: _compat, ...rest } = next;
|
|
2056
|
-
return { ...rest, ...Object.keys(compat).length === 0 ? {} : { compat } };
|
|
2424
|
+
|
|
2425
|
+
function finishClaudeDraft(model) {
|
|
2426
|
+
return CLAUDE_PENDING_MODELS.has(model) && model.id.trim().length > 0
|
|
2427
|
+
? withFetchedClaudeMetadata(model) : model;
|
|
2057
2428
|
}
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
const models = Array.isArray(profile?.models) ? profile.models.map(withNativeClaudeModel) : profile?.models;
|
|
2063
|
-
return {
|
|
2064
|
-
...rest,
|
|
2065
|
-
api: "anthropic-messages",
|
|
2066
|
-
...Object.keys(compat).length === 0 ? {} : { compat },
|
|
2067
|
-
...models === void 0 ? {} : { models },
|
|
2068
|
-
reasoning: "high"
|
|
2069
|
-
};
|
|
2429
|
+
|
|
2430
|
+
function withNativeClaudeModel(model, inherited) {
|
|
2431
|
+
const next = finishClaudeDraft(model);
|
|
2432
|
+
return withClaudeAdaptive(next, claudeAdaptiveEnabled(next, inherited));
|
|
2070
2433
|
}
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
const top = below + height <= window.innerHeight - 12 ? below : Math.max(12, rect.top - height - 8);
|
|
2087
|
-
setPosition({ left, top, width });
|
|
2088
|
-
};
|
|
2089
|
-
place();
|
|
2090
|
-
window.addEventListener("resize", place);
|
|
2091
|
-
window.addEventListener("scroll", place, true);
|
|
2092
|
-
return () => {
|
|
2093
|
-
window.removeEventListener("resize", place);
|
|
2094
|
-
window.removeEventListener("scroll", place, true);
|
|
2095
|
-
};
|
|
2096
|
-
}, [open]);
|
|
2097
|
-
const tooltip = open && typeof document !== "undefined" ? (0, react_dom.createPortal)((0, react_jsx_runtime.jsx)("span", {
|
|
2098
|
-
ref: tooltipRef,
|
|
2099
|
-
className: "mofeng-thinking-tooltip",
|
|
2100
|
-
role: "tooltip",
|
|
2101
|
-
style: position,
|
|
2102
|
-
children: props.t("adaptiveClaudeHelp").split("\n").map((line, index) => (0, react_jsx_runtime.jsx)("span", { children: line }, index))
|
|
2103
|
-
}), document.body) : null;
|
|
2104
|
-
return (0, react_jsx_runtime.jsxs)(react.Fragment, {
|
|
2105
|
-
children: [(0, react_jsx_runtime.jsxs)("span", {
|
|
2106
|
-
ref: anchorRef,
|
|
2107
|
-
className: "mofeng-thinking-help",
|
|
2108
|
-
"aria-label": props.t("adaptiveClaudeHelpLabel"),
|
|
2109
|
-
tabIndex: 0,
|
|
2110
|
-
onMouseEnter: () => setOpen(true),
|
|
2111
|
-
onMouseLeave: () => setOpen(false),
|
|
2112
|
-
onFocus: () => setOpen(true),
|
|
2113
|
-
onBlur: () => setOpen(false),
|
|
2114
|
-
children: ["!", tooltip]
|
|
2115
|
-
}), (0, react_jsx_runtime.jsx)("style", {
|
|
2116
|
-
children: ".mofeng-thinking-help{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border:1px solid currentColor;border-radius:50%;font-size:11px;font-weight:700;line-height:1;cursor:help;vertical-align:middle}.mofeng-thinking-tooltip{position:fixed;z-index:2147483647;display:flex;flex-direction:column;gap:5px;box-sizing:border-box;padding:9px 12px;border:1px solid rgba(255,255,255,.18);border-radius:7px;background:#25282d;color:#f5f6f7;font-size:13px;font-weight:400;line-height:1.45;text-align:left;box-shadow:0 6px 20px rgba(0,0,0,.26);pointer-events:none}.mofeng-thinking-tooltip>span{display:block;white-space:normal;overflow-wrap:anywhere}"
|
|
2117
|
-
})]
|
|
2118
|
-
});
|
|
2434
|
+
|
|
2435
|
+
function withNativeClaudeProfile(profile) {
|
|
2436
|
+
const { compat: currentCompat, ...rest } = profile;
|
|
2437
|
+
const compat = { ...currentCompat };
|
|
2438
|
+
Reflect.deleteProperty(compat, "forceAdaptiveThinking");
|
|
2439
|
+
const models = Array.isArray(profile.models)
|
|
2440
|
+
? profile.models.map(model => withNativeClaudeModel(model, currentCompat?.forceAdaptiveThinking))
|
|
2441
|
+
: profile.models;
|
|
2442
|
+
const next = { ...rest, ...Object.keys(compat).length ? { compat } : {}, ...models === undefined ? {} : { models } };
|
|
2443
|
+
// A provider-wide default must not refer to a level the edited models no longer offer.
|
|
2444
|
+
if (typeof next.reasoning === "string" && Array.isArray(models)
|
|
2445
|
+
&& models.some(model => !Object.hasOwn(model.reasoningEfforts ?? {}, next.reasoning))) {
|
|
2446
|
+
Reflect.deleteProperty(next, "reasoning");
|
|
2447
|
+
}
|
|
2448
|
+
return next;
|
|
2119
2449
|
}
|
|
2450
|
+
|
|
2120
2451
|
function isClaudeProvider(row, state) {
|
|
2121
|
-
|
|
2122
|
-
|
|
2452
|
+
const namespace = state.namespaces.get(CLAUDE_PROVIDER_SETTINGS_NS);
|
|
2453
|
+
return namespace?.value?.providerTypes?.[row.entry.provider] === CLAUDE_PROVIDER_TYPE;
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
function ClaudeAdaptiveThinking({ model, inherited, position, disabled, t, onChange }) {
|
|
2457
|
+
const label = `${t("claudeAdaptiveThinking")} ${position}`;
|
|
2458
|
+
return react_jsx_runtime.jsxs("div", {
|
|
2459
|
+
className: ModelsSection_module_css_default["modelReasoningHead"],
|
|
2460
|
+
style: { marginTop: 4, marginBottom: 12 },
|
|
2461
|
+
children: [react_jsx_runtime.jsxs("span", {
|
|
2462
|
+
className: `${ModelsSection_module_css_default["modelFieldLabel"]} ${ModelsSection_module_css_default["modelReasoningLabel"]}`,
|
|
2463
|
+
children: [t("claudeAdaptiveThinking"), react_jsx_runtime.jsx(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
2464
|
+
label: t("claudeAdaptiveHelp"), side: "right", delayMs: 0, focusDelayMs: 0, portal: true, openOnClick: true,
|
|
2465
|
+
children: react_jsx_runtime.jsx("button", {
|
|
2466
|
+
type: "button", className: ModelsSection_module_css_default["helpButton"],
|
|
2467
|
+
"aria-label": t("claudeAdaptiveHelpLabel"), children: "?"
|
|
2468
|
+
})
|
|
2469
|
+
})]
|
|
2470
|
+
}), react_jsx_runtime.jsx(_deepseek_ai_dsh_client_ui_primitives.Switch, {
|
|
2471
|
+
checked: claudeAdaptiveEnabled(model, inherited), label,
|
|
2472
|
+
disabled: disabled || CLAUDE_KNOWN_MODELS[model.id]?.preset === "toggle",
|
|
2473
|
+
onChange: enabled => onChange(withClaudeAdaptive(model, enabled))
|
|
2474
|
+
})]
|
|
2475
|
+
});
|
|
2123
2476
|
}
|
|
2477
|
+
|
|
2478
|
+
// END CLAUDE HELPERS
|
|
2124
2479
|
/** Stable visible and accessible identity for one provider target. */
|
|
2125
2480
|
function providerTargetLabel(target) {
|
|
2126
2481
|
return target.provider === target.displayName ? target.provider : `${target.displayName} (${target.provider})`;
|
|
@@ -2281,6 +2636,7 @@ window.__ModuleLoader__.load({
|
|
|
2281
2636
|
});
|
|
2282
2637
|
const piAi = state.namespaces.get("llm-pi-ai");
|
|
2283
2638
|
const protocols = protocolChoices(piAi, schema);
|
|
2639
|
+
const reasoningLevels = reasoningLevelChoices(piAi, schema);
|
|
2284
2640
|
const catalogOffered = configurable.length > 0;
|
|
2285
2641
|
const catalogEnabled = addable.length > 0;
|
|
2286
2642
|
const customOffered = piAi !== void 0;
|
|
@@ -2343,9 +2699,10 @@ window.__ModuleLoader__.load({
|
|
|
2343
2699
|
error,
|
|
2344
2700
|
renderProviderEditor({
|
|
2345
2701
|
target,
|
|
2702
|
+
row,
|
|
2703
|
+
thinkingPresets: isClaudeProvider(row, state),
|
|
2346
2704
|
namespace,
|
|
2347
2705
|
schema,
|
|
2348
|
-
thinkingPresets: isClaudeProvider(row, state),
|
|
2349
2706
|
operations,
|
|
2350
2707
|
t,
|
|
2351
2708
|
readOnly: !state.writable,
|
|
@@ -2384,6 +2741,13 @@ window.__ModuleLoader__.load({
|
|
|
2384
2741
|
className: ModelsSection_module_css_default["rowTag"],
|
|
2385
2742
|
children: t("claudeTypeTag")
|
|
2386
2743
|
}) : null,
|
|
2744
|
+
row.entry.provider === "deepseek-account" ? (0, react_jsx_runtime.jsxs)("span", {
|
|
2745
|
+
className: ModelsSection_module_css_default["accountStatus"],
|
|
2746
|
+
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
2747
|
+
className: `${ModelsSection_module_css_default["credentialDot"]} ${ModelsSection_module_css_default["credentialDotConfigured"]}`,
|
|
2748
|
+
"aria-hidden": "true"
|
|
2749
|
+
}), t("accountSignedIn")]
|
|
2750
|
+
}) : null,
|
|
2387
2751
|
credentialConfigured ? (0, react_jsx_runtime.jsx)("span", {
|
|
2388
2752
|
className: `${ModelsSection_module_css_default["credentialDot"]} ${ModelsSection_module_css_default["credentialDotConfigured"]}`,
|
|
2389
2753
|
role: "img",
|
|
@@ -2398,7 +2762,7 @@ window.__ModuleLoader__.load({
|
|
|
2398
2762
|
]
|
|
2399
2763
|
}), (0, react_jsx_runtime.jsxs)("span", {
|
|
2400
2764
|
className: ModelsSection_module_css_default["rowActions"],
|
|
2401
|
-
children: [(0, react_jsx_runtime.jsx)("button", {
|
|
2765
|
+
children: [row.entry.provider === "deepseek-account" ? null : (0, react_jsx_runtime.jsx)("button", {
|
|
2402
2766
|
type: "button",
|
|
2403
2767
|
className: ModelsSection_module_css_default["secondaryButton"],
|
|
2404
2768
|
"aria-label": providerCopy(t("editProvider"), target),
|
|
@@ -2433,9 +2797,10 @@ window.__ModuleLoader__.load({
|
|
|
2433
2797
|
}, { entryKey: row.entry.settingsNs }),
|
|
2434
2798
|
open ? renderProviderEditor({
|
|
2435
2799
|
target,
|
|
2800
|
+
row,
|
|
2801
|
+
thinkingPresets: isClaudeProvider(row, state),
|
|
2436
2802
|
namespace,
|
|
2437
2803
|
schema,
|
|
2438
|
-
thinkingPresets: isClaudeProvider(row, state),
|
|
2439
2804
|
operations,
|
|
2440
2805
|
t,
|
|
2441
2806
|
readOnly: !state.writable,
|
|
@@ -2525,6 +2890,10 @@ window.__ModuleLoader__.load({
|
|
|
2525
2890
|
schema,
|
|
2526
2891
|
settingsPath: draft.target.settingsPath,
|
|
2527
2892
|
operations,
|
|
2893
|
+
...draft.target.defaultBaseURL === void 0 ? {} : { defaultBaseURL: draft.target.defaultBaseURL },
|
|
2894
|
+
...draft.target.baseURLEnv === void 0 ? {} : { baseURLEnv: draft.target.baseURLEnv },
|
|
2895
|
+
...draft.target.nativeAuth === void 0 ? {} : { nativeAuth: draft.target.nativeAuth },
|
|
2896
|
+
...addRow?.credentialChecks === void 0 ? {} : { credentialChecks: addRow.credentialChecks },
|
|
2528
2897
|
t,
|
|
2529
2898
|
readOnly: !state.writable,
|
|
2530
2899
|
onClose: (changed) => {
|
|
@@ -2550,6 +2919,7 @@ window.__ModuleLoader__.load({
|
|
|
2550
2919
|
children: (0, react_jsx_runtime.jsx)(CustomProviderCard, {
|
|
2551
2920
|
taken: state.rows.map((row) => row.entry.provider),
|
|
2552
2921
|
protocols,
|
|
2922
|
+
reasoningLevels,
|
|
2553
2923
|
revision: piAi.revision,
|
|
2554
2924
|
operations,
|
|
2555
2925
|
t,
|
|
@@ -2573,6 +2943,7 @@ window.__ModuleLoader__.load({
|
|
|
2573
2943
|
providerType: CLAUDE_PROVIDER_TYPE,
|
|
2574
2944
|
taken: state.rows.map((row) => row.entry.provider),
|
|
2575
2945
|
protocols,
|
|
2946
|
+
reasoningLevels,
|
|
2576
2947
|
revision: piAi.revision,
|
|
2577
2948
|
operations,
|
|
2578
2949
|
t,
|
|
@@ -2891,16 +3262,14 @@ window.__ModuleLoader__.load({
|
|
|
2891
3262
|
//#endregion
|
|
2892
3263
|
//#region lib/types/client/welcome-store.js
|
|
2893
3264
|
/**
|
|
2894
|
-
* Welcome-notice state derived from the welcome settings scope
|
|
2895
|
-
* the
|
|
2896
|
-
* remote browser's memory-mode scope never answers and the acknowledgement
|
|
2897
|
-
* stays process-local here.
|
|
3265
|
+
* Welcome-notice state derived from the welcome settings scope: the notice
|
|
3266
|
+
* follows the Host section and records its acknowledgement through it.
|
|
2898
3267
|
*/
|
|
2899
3268
|
/* v8 ignore next 3 -- closed-union default only defends future source widening */
|
|
2900
3269
|
function assertNever(_value) {
|
|
2901
3270
|
throw new Error("unexpected welcome settings status");
|
|
2902
3271
|
}
|
|
2903
|
-
/** Coordinates durable Host acknowledgement
|
|
3272
|
+
/** Coordinates the durable Host acknowledgement. */
|
|
2904
3273
|
var WelcomeNoticeStore = class {
|
|
2905
3274
|
scope;
|
|
2906
3275
|
/** uSES-safe state source shared by the registered welcome step. */
|
|
@@ -2909,13 +3278,8 @@ window.__ModuleLoader__.load({
|
|
|
2909
3278
|
acknowledged: false,
|
|
2910
3279
|
error: null
|
|
2911
3280
|
});
|
|
2912
|
-
localAcknowledged = false;
|
|
2913
3281
|
saving = false;
|
|
2914
3282
|
following;
|
|
2915
|
-
/**
|
|
2916
|
-
* @param scope - the welcome settings namespace scope; its memory mode is
|
|
2917
|
-
* what keeps a remote browser process-local.
|
|
2918
|
-
*/
|
|
2919
3283
|
constructor(scope) {
|
|
2920
3284
|
this.scope = scope;
|
|
2921
3285
|
}
|
|
@@ -2931,17 +3295,12 @@ window.__ModuleLoader__.load({
|
|
|
2931
3295
|
return Promise.resolve();
|
|
2932
3296
|
}
|
|
2933
3297
|
/**
|
|
2934
|
-
* Persist this copy version
|
|
2935
|
-
*
|
|
2936
|
-
*
|
|
2937
|
-
* @returns true when the
|
|
3298
|
+
* Persist this copy version through the scope. Success is judged against the
|
|
3299
|
+
* state the write left behind, so a refused or failed write reports false
|
|
3300
|
+
* after its recovery read settles.
|
|
3301
|
+
* @returns true when the Host holds the acknowledgement.
|
|
2938
3302
|
*/
|
|
2939
3303
|
async acknowledge() {
|
|
2940
|
-
if (this.scope.getSnapshot().mode === "memory") {
|
|
2941
|
-
this.localAcknowledged = true;
|
|
2942
|
-
this.derive();
|
|
2943
|
-
return true;
|
|
2944
|
-
}
|
|
2945
3304
|
this.saving = true;
|
|
2946
3305
|
this.store.update((state) => {
|
|
2947
3306
|
state.status = "saving";
|
|
@@ -2968,14 +3327,6 @@ window.__ModuleLoader__.load({
|
|
|
2968
3327
|
derive() {
|
|
2969
3328
|
if (this.saving) return;
|
|
2970
3329
|
const scope = this.scope.getSnapshot();
|
|
2971
|
-
if (scope.mode === "memory") {
|
|
2972
|
-
this.store.update((state) => {
|
|
2973
|
-
state.status = "ready";
|
|
2974
|
-
state.acknowledged = this.localAcknowledged;
|
|
2975
|
-
state.error = null;
|
|
2976
|
-
});
|
|
2977
|
-
return;
|
|
2978
|
-
}
|
|
2979
3330
|
switch (scope.status) {
|
|
2980
3331
|
case "loading":
|
|
2981
3332
|
this.store.update((state) => {
|
|
@@ -3020,10 +3371,6 @@ window.__ModuleLoader__.load({
|
|
|
3020
3371
|
*/
|
|
3021
3372
|
function createModelsOperations(ctx) {
|
|
3022
3373
|
return {
|
|
3023
|
-
describeCredential: async (ref) => {
|
|
3024
|
-
const response = await ctx.remote.credentials.describe([ref]);
|
|
3025
|
-
return response.ok ? response.value[ref] : void 0;
|
|
3026
|
-
},
|
|
3027
3374
|
storeCredential: async (ref, value) => {
|
|
3028
3375
|
const response = await ctx.remote.credentials.set(ref, value);
|
|
3029
3376
|
return response.ok ? void 0 : response.error.message;
|
|
@@ -3111,19 +3458,30 @@ window.__ModuleLoader__.load({
|
|
|
3111
3458
|
savedProvider: "Saved {provider}.",
|
|
3112
3459
|
credentialConfigured: "API key configured",
|
|
3113
3460
|
credentialMissing: "API key missing",
|
|
3461
|
+
accountSignedIn: "Signed in",
|
|
3114
3462
|
readOnly: "The settings document is read-only in this deployment.",
|
|
3115
3463
|
loadFailed: "Loading the provider directory failed",
|
|
3116
3464
|
conflict: "Someone else changed these settings while this card was open. Close it and reopen to edit the current values.",
|
|
3117
3465
|
retry: "Retry",
|
|
3118
3466
|
keyInput: "API key",
|
|
3467
|
+
keyReveal: "Show secret",
|
|
3468
|
+
keyHide: "Hide secret",
|
|
3119
3469
|
keyPlaceholder: "Enter your API key",
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3470
|
+
keyPlaceholderFallback: "Leave blank to use env as auth ({hint})",
|
|
3471
|
+
keyPlaceholderSaved: "Leave blank to use saved credentials",
|
|
3472
|
+
keyFallbackMissing: "Env var not detected. Enter an API key, or configure {hint} in your env.",
|
|
3473
|
+
keyFallbackDetected: "Env var detected. ({hint})",
|
|
3474
|
+
keyFallbackDetectedHidden: "Env var detected.",
|
|
3475
|
+
keyFallbackUnchecked: "Environment credential status has not been confirmed.",
|
|
3476
|
+
keyHelp: "Saved credentials are used first. Environment fallbacks shown here, in order: {env}. Sources are launch environment, $cwd/.env, then $DSH_HOME/.env.",
|
|
3477
|
+
authHelp: "Authentication details",
|
|
3123
3478
|
customized: "Customized settings",
|
|
3124
3479
|
baseUrl: "Base URL",
|
|
3125
|
-
baseUrlDefault: "
|
|
3126
|
-
|
|
3480
|
+
baseUrlDefault: "No default endpoint",
|
|
3481
|
+
baseUrlEnvironment: "Provider endpoint configuration: {env}",
|
|
3482
|
+
baseUrlConfigured: "Provider-configured endpoint",
|
|
3483
|
+
baseUrlPlaceholder: "{url}",
|
|
3484
|
+
deepSeekBaseUrl: "https://api.deepseek.com/anthropic (Default to use DEEPSEEK_BASE_URL)",
|
|
3127
3485
|
deepSeekEndpointHint: "Use an API endpoint compatible with Anthropic Messages.",
|
|
3128
3486
|
models: "Models",
|
|
3129
3487
|
modelsInherited: "Using the adapter defaults",
|
|
@@ -3141,6 +3499,16 @@ window.__ModuleLoader__.load({
|
|
|
3141
3499
|
modelInputTypes: "Input types",
|
|
3142
3500
|
modelInputText: "Text",
|
|
3143
3501
|
modelInputImage: "Image",
|
|
3502
|
+
modelReasoning: "Reasoning levels",
|
|
3503
|
+
modelReasoningLevel: "Level",
|
|
3504
|
+
modelReasoningValue: "API value",
|
|
3505
|
+
modelReasoningHelp: "About reasoning levels",
|
|
3506
|
+
modelReasoningHelpText: "The API value is sent in the request's reasoning-effort field, such as OpenAI's reasoning_effort. It defaults to the level name; where the model provider's API documentation specifies a different value, follow it. Off turns reasoning off and needs no value; a value already written in the configuration is kept and sent.",
|
|
3507
|
+
modelReasoningNeedsLevel: "Add at least one level besides Off, or turn reasoning levels off.",
|
|
3508
|
+
modelReasoningValueRequired: "Every level besides Off needs an API value, and no value can be empty.",
|
|
3509
|
+
modelReasoningAdd: "Add level",
|
|
3510
|
+
modelReasoningRemove: "Delete level",
|
|
3511
|
+
modelReasoningOffValuePlaceholder: "Turns reasoning off",
|
|
3144
3512
|
addModel: "Add model",
|
|
3145
3513
|
removeModel: "Delete model",
|
|
3146
3514
|
modelsEmpty: "No models will be shown in the selector. Unlisted IDs can still be sent directly.",
|
|
@@ -3169,17 +3537,10 @@ window.__ModuleLoader__.load({
|
|
|
3169
3537
|
customTag: "Custom",
|
|
3170
3538
|
claudeCustomAdd: "Add Claude provider",
|
|
3171
3539
|
claudeCustomTitle: "Claude provider",
|
|
3172
|
-
claudeTypeUnavailable: "Claude provider type storage is unavailable.",
|
|
3173
3540
|
claudeTypeTag: "Claude provider",
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
adaptiveClaudeHelp: "Five (low / medium / high / xhigh / max): Haiku 5.5, Fable 5.1, Fable 5, Opus 5, Opus 4.8, Opus 4.7, Sonnet 5\nFour (low / medium / high / max): Opus 4.6, Sonnet 4.6\nOn / Off: Haiku 4.5",
|
|
3178
|
-
adaptiveClaudeTag: "Claude configured",
|
|
3179
|
-
thinkingPreset: "Thinking mode",
|
|
3180
|
-
thinkingPresetToggle: "On / Off",
|
|
3181
|
-
thinkingPresetFour: "Four levels",
|
|
3182
|
-
thinkingPresetFive: "Five levels (default)",
|
|
3541
|
+
claudeAdaptiveThinking: "Adaptive thinking",
|
|
3542
|
+
claudeAdaptiveHelpLabel: "Adaptive thinking help",
|
|
3543
|
+
claudeAdaptiveHelp: "For Anthropic-compatible models that support adaptive thinking. When enabled, the model adjusts its thinking based on task complexity and your selected reasoning level. When disabled, it uses the thinking token limit associated with that level.",
|
|
3183
3544
|
customRoute: "Provider ID",
|
|
3184
3545
|
customRouteHint: "Lowercase identifier, starting with a letter, that uniquely names this provider in requests and as its credential name.",
|
|
3185
3546
|
customRouteInvalid: "Start with a lowercase letter; then lowercase letters, digits, and dashes.",
|
|
@@ -3240,19 +3601,30 @@ window.__ModuleLoader__.load({
|
|
|
3240
3601
|
savedProvider: "已保存 {provider}。",
|
|
3241
3602
|
credentialConfigured: "API 密钥已配置",
|
|
3242
3603
|
credentialMissing: "API 密钥缺失",
|
|
3604
|
+
accountSignedIn: "已登录",
|
|
3243
3605
|
readOnly: "当前部署的设置文档为只读。",
|
|
3244
3606
|
loadFailed: "加载提供商目录失败",
|
|
3245
3607
|
conflict: "这张卡片打开期间,这些设置已被其他地方改动。请关闭后重新打开,在当前值上编辑。",
|
|
3246
3608
|
retry: "重试",
|
|
3247
3609
|
keyInput: "API 密钥",
|
|
3610
|
+
keyReveal: "显示密钥",
|
|
3611
|
+
keyHide: "隐藏密钥",
|
|
3248
3612
|
keyPlaceholder: "输入 API 密钥",
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3613
|
+
keyPlaceholderFallback: "留空使用环境认证({hint})",
|
|
3614
|
+
keyPlaceholderSaved: "留空使用已保存凭据",
|
|
3615
|
+
keyFallbackMissing: "未检测到环境变量。请填写 API 密钥,或设置环境变量 {hint}。",
|
|
3616
|
+
keyFallbackDetected: "已检测到环境变量({hint})",
|
|
3617
|
+
keyFallbackDetectedHidden: "已检测到环境变量",
|
|
3618
|
+
keyFallbackUnchecked: "环境凭据状态尚未确认",
|
|
3619
|
+
keyHelp: "优先使用已保存的凭据。此处显示的环境后备按以下顺序排列:{env}。来源依次为启动环境、$cwd/.env、$DSH_HOME/.env。",
|
|
3620
|
+
authHelp: "认证说明",
|
|
3252
3621
|
customized: "自定义设置",
|
|
3253
3622
|
baseUrl: "API 地址",
|
|
3254
|
-
baseUrlDefault: "
|
|
3255
|
-
|
|
3623
|
+
baseUrlDefault: "没有默认地址",
|
|
3624
|
+
baseUrlEnvironment: "提供方地址配置:{env}",
|
|
3625
|
+
baseUrlConfigured: "由提供方配置地址",
|
|
3626
|
+
baseUrlPlaceholder: "{url}",
|
|
3627
|
+
deepSeekBaseUrl: "https://api.deepseek.com/anthropic(默认使用环境 DEEPSEEK_BASE_URL)",
|
|
3256
3628
|
deepSeekEndpointHint: "请填写兼容 Anthropic Messages 协议的 API 地址。",
|
|
3257
3629
|
models: "模型目录",
|
|
3258
3630
|
modelsInherited: "正在使用适配器默认模型",
|
|
@@ -3270,6 +3642,16 @@ window.__ModuleLoader__.load({
|
|
|
3270
3642
|
modelInputTypes: "输入类型",
|
|
3271
3643
|
modelInputText: "文本",
|
|
3272
3644
|
modelInputImage: "图片",
|
|
3645
|
+
modelReasoning: "推理等级",
|
|
3646
|
+
modelReasoningLevel: "档位",
|
|
3647
|
+
modelReasoningValue: "API 参数值",
|
|
3648
|
+
modelReasoningHelp: "推理等级说明",
|
|
3649
|
+
modelReasoningHelpText: "API 参数值会写入请求的推理强度字段(如 OpenAI 的 reasoning_effort),默认与档位名相同;如有不同,以模型提供商的 API 文档为准。Off 表示关闭思考,不需要填写参数值;配置中已写入的值会保留并发送。",
|
|
3650
|
+
modelReasoningNeedsLevel: "至少添加一个 Off 以外的档位;不需要思考请关闭推理等级。",
|
|
3651
|
+
modelReasoningValueRequired: "Off 以外的档位都需要填写 API 参数值,且参数值不能为空字符串。",
|
|
3652
|
+
modelReasoningAdd: "添加档位",
|
|
3653
|
+
modelReasoningRemove: "删除档位",
|
|
3654
|
+
modelReasoningOffValuePlaceholder: "关闭思考",
|
|
3273
3655
|
addModel: "添加模型",
|
|
3274
3656
|
removeModel: "删除模型",
|
|
3275
3657
|
modelsEmpty: "模型选择器中将不显示任何模型;目录外 ID 仍可直接发送。",
|
|
@@ -3298,17 +3680,10 @@ window.__ModuleLoader__.load({
|
|
|
3298
3680
|
customTag: "自定义",
|
|
3299
3681
|
claudeCustomAdd: "添加 Claude 提供方",
|
|
3300
3682
|
claudeCustomTitle: "Claude 提供方",
|
|
3301
|
-
claudeTypeUnavailable: "Claude 提供方类型存储不可用。",
|
|
3302
3683
|
claudeTypeTag: "Claude 提供方",
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
adaptiveClaudeHelp: "五档(低 / 中 / 高 / 超高 / 最大):Haiku 5.5、Fable 5.1、Fable 5、Opus 5、Opus 4.8、Opus 4.7、Sonnet 5\n四档(低 / 中 / 高 / 最大):Opus 4.6、Sonnet 4.6\n开启 / 关闭:Haiku 4.5",
|
|
3307
|
-
adaptiveClaudeTag: "Claude 已适配",
|
|
3308
|
-
thinkingPreset: "思考模式",
|
|
3309
|
-
thinkingPresetToggle: "开启 / 关闭",
|
|
3310
|
-
thinkingPresetFour: "四档",
|
|
3311
|
-
thinkingPresetFive: "五档(默认)",
|
|
3684
|
+
claudeAdaptiveThinking: "自适应思考",
|
|
3685
|
+
claudeAdaptiveHelpLabel: "自适应思考说明",
|
|
3686
|
+
claudeAdaptiveHelp: "适用于支持自适应思考的 Anthropic 兼容模型。开启后,模型根据任务难度和你选择的推理等级自动调整思考量;关闭后,改用该等级对应的思考 token 数量上限。",
|
|
3312
3687
|
customRoute: "Provider ID",
|
|
3313
3688
|
customRouteHint: "以小写字母开头的标识,在请求中唯一标识该提供商,并用于派生凭据名。",
|
|
3314
3689
|
customRouteInvalid: "需以小写字母开头,之后可用小写字母、数字和短横线。",
|