@mofeng2223/dsh-claude-provider 0.4.4 → 0.4.6

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.
Files changed (2) hide show
  1. package/lib/client.js +290 -260
  2. package/package.json +3 -3
package/lib/client.js CHANGED
@@ -56,7 +56,7 @@ window.__ModuleLoader__.load({
56
56
  }
57
57
  //#endregion
58
58
  //#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-border-l4);border-radius:16px;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);color:var(--dsw-alias-label-secondary);border-radius:4px;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;height:36px;font:inherit;cursor:pointer;border:none;border-radius:18px;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;height:36px;color:var(--dsw-alias-state-error-primary);font:inherit;cursor:pointer;background:0 0;border:none;border-radius:18px;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:14px;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-alias-border-l3);outline:none}.zGbnIq_editor{background:var(--dsw-alias-bg-module-platform);border-radius:12px;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;height:28px;color:var(--dsw-alias-label-tertiary);font:inherit;cursor:pointer;background:0 0;border:none;border-radius:14px;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{flex-wrap:wrap;gap:10px;display:flex}.zGbnIq_addButton{border:1px dashed var(--dsw-alias-border-l3);border-radius:16px;flex:1 1 0;gap:6px;min-width:180px;height:44px}.zGbnIq_addCard,.zGbnIq_setupCard{background:var(--dsw-alias-bg-module-platform);border-radius:12px;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{cursor:pointer;width:fit-content;color:var(--dsw-alias-label-secondary);border-radius:6px;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:10px;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;width:28px;height:28px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:6px;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(auto-fit,minmax(160px,1fr));gap:8px;padding:8px 4px 2px;display:grid}.zGbnIq_modelField{flex-direction:column;gap:4px;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);text-align:center;border-radius:8px;padding:12px}.zGbnIq_addModelButton{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);height:28px;color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;background:0 0;border-radius:14px;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);width:100%;height:32px;font:inherit;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);border-radius:8px;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-brand-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:6px}.zGbnIq_candidateLabel{cursor:pointer;align-items:center;gap:8px;padding:6px 8px;display:flex}.zGbnIq_candidateId{font-family:var(--ds-font-family-code);overflow-wrap:anywhere;flex:auto;font-size:13px}.zGbnIq_candidateEmpty{color:var(--dsw-alias-label-secondary);text-align:center;margin:24px 0;font-size:13px;line-height:20px}";
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-border-l4);border-radius:16px;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);color:var(--dsw-alias-label-secondary);border-radius:4px;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;height:36px;font:inherit;cursor:pointer;border:none;border-radius:18px;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;height:36px;color:var(--dsw-alias-state-error-primary);font:inherit;cursor:pointer;background:0 0;border:none;border-radius:18px;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:14px;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-alias-border-l3);outline:none}.zGbnIq_editor{background:var(--dsw-alias-bg-module-platform);border-radius:12px;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;height:28px;color:var(--dsw-alias-label-tertiary);font:inherit;cursor:pointer;background:0 0;border:none;border-radius:14px;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{flex-wrap:wrap;gap:10px;display:flex}.zGbnIq_addButton{border:1px dashed var(--dsw-alias-border-l3);border-radius:16px;flex:1 1 0;gap:6px;min-width:180px;height:44px}.zGbnIq_addCard,.zGbnIq_setupCard{background:var(--dsw-alias-bg-module-platform);border-radius:12px;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{cursor:pointer;width:fit-content;color:var(--dsw-alias-label-secondary);border-radius:6px;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:10px;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;width:28px;height:28px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:6px;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);text-align:center;border-radius:8px;padding:12px}.zGbnIq_addModelButton{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l3);height:28px;color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;background:0 0;border-radius:14px;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);width:100%;height:32px;font:inherit;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);border-radius:8px;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-brand-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:6px}.zGbnIq_candidateLabel{cursor:pointer;align-items:center;gap:8px;padding:6px 8px;display:flex}.zGbnIq_candidateId{font-family:var(--ds-font-family-code);overflow-wrap:anywhere;flex:auto;font-size:13px}.zGbnIq_candidateEmpty{color:var(--dsw-alias-label-secondary);text-align:center;margin:24px 0;font-size:13px;line-height:20px}";
60
60
  const tagId$3 = "@mofeng2223/dsh-claude-provider/ModelsSection.module.css";
61
61
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
62
62
  const tag = document.createElement("style");
@@ -112,6 +112,8 @@ window.__ModuleLoader__.load({
112
112
  "modelEntry": "zGbnIq_modelEntry",
113
113
  "modelField": "zGbnIq_modelField",
114
114
  "modelFieldLabel": "zGbnIq_modelFieldLabel",
115
+ "modelInputChoices": "zGbnIq_modelInputChoices",
116
+ "modelInputTypes": "zGbnIq_modelInputTypes",
115
117
  "modelList": "zGbnIq_modelList",
116
118
  "modelListHead": "zGbnIq_modelListHead",
117
119
  "modelRow": "zGbnIq_modelRow",
@@ -159,6 +161,132 @@ window.__ModuleLoader__.load({
159
161
  });
160
162
  }
161
163
  //#endregion
164
+ //#region lib/types/client/ModelInputTypes.js
165
+ /**
166
+ * Edit a nonempty set of input types, displaying inherited types before an override exists.
167
+ * @param props - model declaration and row replacement action.
168
+ * @returns the labeled text and image checkboxes.
169
+ */
170
+ function ModelInputTypes({ model, field, position, disabled, fallback, t, onChange }) {
171
+ const modalities = model[field];
172
+ const selected = Array.isArray(modalities) && modalities.length > 0 ? modalities : fallback ?? ["text"];
173
+ return (0, react_jsx_runtime.jsxs)("fieldset", {
174
+ className: ModelsSection_module_css_default["modelInputTypes"],
175
+ "aria-label": `${t("modelInputTypes")} ${String(position)}`,
176
+ children: [(0, react_jsx_runtime.jsx)("legend", {
177
+ className: ModelsSection_module_css_default["modelFieldLabel"],
178
+ children: t("modelInputTypes")
179
+ }), (0, react_jsx_runtime.jsx)("div", {
180
+ className: ModelsSection_module_css_default["modelInputChoices"],
181
+ children: ["text", "image"].map((modality) => (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Checkbox, {
182
+ label: t(modality === "text" ? "modelInputText" : "modelInputImage"),
183
+ checked: selected.includes(modality),
184
+ disabled: disabled || selected.length === 1 && selected.includes(modality),
185
+ onChange: (checked) => {
186
+ const nextSelected = ["text", "image"].filter((value) => value === modality ? checked : selected.includes(value));
187
+ const next = {
188
+ ...model,
189
+ [field]: nextSelected
190
+ };
191
+ if (field === "inputModalities" && !nextSelected.includes("image")) {
192
+ Reflect.deleteProperty(next, "imagePixelBudget");
193
+ Reflect.deleteProperty(next, "imageMaxBytes");
194
+ }
195
+ onChange(next);
196
+ }
197
+ }, modality))
198
+ })]
199
+ });
200
+ }
201
+ //#endregion
202
+ //#region lib/types/client/ModelRow.js
203
+ /**
204
+ * Render consistent model identity, capacity, and input-type controls.
205
+ * @param props - drafted fields and their owning editor's actions.
206
+ * @returns one expandable model entry.
207
+ */
208
+ function ModelRow(props) {
209
+ const { model, position, t, disabled } = props;
210
+ return (0, react_jsx_runtime.jsxs)("div", {
211
+ className: ModelsSection_module_css_default["modelEntry"],
212
+ children: [(0, react_jsx_runtime.jsxs)("div", {
213
+ className: ModelsSection_module_css_default["modelRow"],
214
+ children: [
215
+ ["id", "name"].map((field) => (0, react_jsx_runtime.jsx)("input", {
216
+ className: ModelsSection_module_css_default["input"],
217
+ type: "text",
218
+ value: typeof model[field] === "string" ? model[field] : "",
219
+ placeholder: t(field === "id" ? "modelId" : "modelName"),
220
+ "aria-label": `${t(field === "id" ? "modelId" : "modelName")} ${String(position)}`,
221
+ disabled,
222
+ onChange: (event) => {
223
+ const value = event.target.value;
224
+ props.onFieldChange(field, field === "name" && value === "" ? void 0 : value);
225
+ },
226
+ onBlur: field === "id" ? (event) => props.onIdBlur?.(event.target.value) : void 0
227
+ }, field)),
228
+ (0, react_jsx_runtime.jsx)("button", {
229
+ type: "button",
230
+ className: ModelsSection_module_css_default["iconButton"],
231
+ "aria-label": `${t("modelAdvanced")} ${String(position)}`,
232
+ "aria-expanded": props.expanded,
233
+ title: t("modelAdvanced"),
234
+ onClick: props.onToggle,
235
+ children: props.expanded ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, {}) : (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutline14, {})
236
+ }),
237
+ (0, react_jsx_runtime.jsx)("button", {
238
+ type: "button",
239
+ className: `${ModelsSection_module_css_default["iconButton"]} ${ModelsSection_module_css_default["iconButtonDanger"]}`,
240
+ "aria-label": `${t("removeModel")} ${String(position)}`,
241
+ title: t("removeModel"),
242
+ disabled,
243
+ onClick: props.onRemove,
244
+ children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutline16, { size: 14 })
245
+ })
246
+ ]
247
+ }), props.expanded ? (0, react_jsx_runtime.jsxs)("div", {
248
+ className: ModelsSection_module_css_default["modelAdvanced"],
249
+ children: [["contextWindow", "maxTokens"].map((field) => (0, react_jsx_runtime.jsxs)("label", {
250
+ className: ModelsSection_module_css_default["modelField"],
251
+ children: [(0, react_jsx_runtime.jsx)("span", {
252
+ className: ModelsSection_module_css_default["modelFieldLabel"],
253
+ children: t(field)
254
+ }), (0, react_jsx_runtime.jsx)("input", {
255
+ className: ModelsSection_module_css_default["input"],
256
+ type: "text",
257
+ inputMode: "numeric",
258
+ value: props[field].value,
259
+ placeholder: props[field].placeholder,
260
+ "aria-label": `${t(field)} ${String(position)}`,
261
+ disabled,
262
+ onChange: (event) => {
263
+ props[field].onChange(event.target.value);
264
+ },
265
+ onBlur: props[field].onBlur
266
+ })]
267
+ }, field)), (0, react_jsx_runtime.jsx)(ModelInputTypes, {
268
+ model,
269
+ field: props.inputField,
270
+ position,
271
+ fallback: props.inputFallback,
272
+ disabled: disabled || props.inputLoading === true,
273
+ t,
274
+ onChange: props.onChange
275
+ }), props.thinkingPresets ? (0, react_jsx_runtime.jsxs)("label", {
276
+ className: ModelsSection_module_css_default["modelField"],
277
+ children: [t("thinkingPreset"), (0, react_jsx_runtime.jsxs)("select", {
278
+ className: ModelsSection_module_css_default["input"],
279
+ value: thinkingPresetOf(model),
280
+ "aria-label": t("thinkingPreset") + " " + position,
281
+ disabled,
282
+ onChange: (event) => props.onChange({ ...model, reasoningEfforts: reasoningEffortsForPreset(event.target.value) }),
283
+ children: ["toggle", "four", "five"].map((preset) => (0, react_jsx_runtime.jsx)("option", { value: preset, children: t({ toggle: "thinkingPresetToggle", four: "thinkingPresetFour", five: "thinkingPresetFive" }[preset]) }, preset))
284
+ })]
285
+ }) : null]
286
+ }) : null]
287
+ });
288
+ }
289
+ //#endregion
162
290
  //#region lib/types/client/DeepSeekModelsEditor.js
163
291
  /**
164
292
  * Curated editor for the direct DeepSeek adapter's advisory model catalog.
@@ -253,7 +381,7 @@ window.__ModuleLoader__.load({
253
381
  }
254
382
  /**
255
383
  * Render the direct DeepSeek adapter's model catalog: id and display name on
256
- * each row, capacities behind the row's own disclosure.
384
+ * each row, capacities and input types behind the row's own disclosure.
257
385
  * @param props - effective rows plus the array-level override actions.
258
386
  * @returns the catalog editor.
259
387
  */
@@ -321,29 +449,16 @@ window.__ModuleLoader__.load({
321
449
  return next;
322
450
  });
323
451
  };
324
- /** One capacity field of one row, rendered inside the row's disclosure. */
325
- const capacityField = (model, index, field, fallback) => (0, react_jsx_runtime.jsxs)("label", {
326
- className: ModelsSection_module_css_default["modelField"],
327
- children: [(0, react_jsx_runtime.jsx)("span", {
328
- className: ModelsSection_module_css_default["modelFieldLabel"],
329
- children: props.t(field === "contextWindow" ? "contextWindow" : "maxTokens")
330
- }), (0, react_jsx_runtime.jsx)("input", {
331
- className: ModelsSection_module_css_default["input"],
332
- type: "text",
333
- inputMode: "numeric",
334
- value: capacityText(model, index, field),
335
- placeholder: fallback === void 0 ? props.t(field === "contextWindow" ? "contextWindowPlaceholder" : "maxTokensPlaceholder") : formatCapacity(fallback),
336
- "aria-label": `${props.t(field === "contextWindow" ? "contextWindow" : "maxTokens")} ${String(index + 1)}`,
337
- disabled: props.disabled,
338
- onChange: (event) => {
339
- const text = event.target.value;
340
- setEditing((current) => new Map(current).set(`${String(index)}:${field}`, text));
341
- update(index, field, parseCapacity(text));
342
- },
343
- onBlur: () => {
344
- settleCapacity(index, field);
345
- }
346
- })]
452
+ const capacityInput = (model, index, field, fallback) => ({
453
+ value: capacityText(model, index, field),
454
+ placeholder: fallback === void 0 ? props.t(field === "contextWindow" ? "contextWindowPlaceholder" : "maxTokensPlaceholder") : formatCapacity(fallback),
455
+ onChange: (text) => {
456
+ setEditing((current) => new Map(current).set(`${String(index)}:${field}`, text));
457
+ update(index, field, parseCapacity(text));
458
+ },
459
+ onBlur: () => {
460
+ settleCapacity(index, field);
461
+ }
347
462
  });
348
463
  return (0, react_jsx_runtime.jsxs)("section", {
349
464
  className: ModelsSection_module_css_default["modelCatalog"],
@@ -373,64 +488,31 @@ window.__ModuleLoader__.load({
373
488
  children: props.t("modelsEmpty")
374
489
  }) : (0, react_jsx_runtime.jsx)("div", {
375
490
  className: ModelsSection_module_css_default["modelList"],
376
- children: props.models.map((model, index) => (0, react_jsx_runtime.jsxs)("div", {
377
- className: ModelsSection_module_css_default["modelEntry"],
378
- children: [(0, react_jsx_runtime.jsxs)("div", {
379
- className: ModelsSection_module_css_default["modelRow"],
380
- children: [
381
- (0, react_jsx_runtime.jsx)("input", {
382
- className: ModelsSection_module_css_default["input"],
383
- type: "text",
384
- value: typeof model["id"] === "string" ? model["id"] : "",
385
- placeholder: props.t("modelId"),
386
- "aria-label": `${props.t("modelId")} ${String(index + 1)}`,
387
- disabled: props.disabled,
388
- onChange: (event) => {
389
- update(index, "id", event.target.value);
390
- },
391
- onBlur: (event) => {
392
- const trimmed = event.target.value.trim();
393
- if (trimmed !== event.target.value) update(index, "id", trimmed);
394
- }
395
- }),
396
- (0, react_jsx_runtime.jsx)("input", {
397
- className: ModelsSection_module_css_default["input"],
398
- type: "text",
399
- value: typeof model["name"] === "string" ? model["name"] : "",
400
- placeholder: props.t("modelName"),
401
- "aria-label": `${props.t("modelName")} ${String(index + 1)}`,
402
- disabled: props.disabled,
403
- onChange: (event) => {
404
- update(index, "name", event.target.value === "" ? void 0 : event.target.value);
405
- }
406
- }),
407
- (0, react_jsx_runtime.jsx)("button", {
408
- type: "button",
409
- className: ModelsSection_module_css_default["iconButton"],
410
- "aria-label": `${props.t("modelAdvanced")} ${String(index + 1)}`,
411
- "aria-expanded": expanded.has(index),
412
- title: props.t("modelAdvanced"),
413
- onClick: () => {
414
- toggle(index);
415
- },
416
- children: expanded.has(index) ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, {}) : (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutline14, {})
417
- }),
418
- (0, react_jsx_runtime.jsx)("button", {
419
- type: "button",
420
- className: `${ModelsSection_module_css_default["iconButton"]} ${ModelsSection_module_css_default["iconButtonDanger"]}`,
421
- "aria-label": `${props.t("removeModel")} ${String(index + 1)}`,
422
- title: props.t("removeModel"),
423
- disabled: props.disabled,
424
- onClick: () => {
425
- remove(index);
426
- },
427
- children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutline16, { size: 14 })
428
- })
429
- ]
430
- }), expanded.has(index) ? (0, react_jsx_runtime.jsxs)("div", {
431
- className: ModelsSection_module_css_default["modelAdvanced"],
432
- children: [capacityField(model, index, "contextWindow", props.defaultContextWindow), capacityField(model, index, "maxTokens", props.defaultMaxTokens)]
433
- }) : null]
491
+ children: props.models.map((model, index) => (0, react_jsx_runtime.jsx)(ModelRow, {
492
+ model,
493
+ position: index + 1,
494
+ inputField: "inputModalities",
495
+ expanded: expanded.has(index),
496
+ disabled: props.disabled,
497
+ t: props.t,
498
+ contextWindow: capacityInput(model, index, "contextWindow", props.defaultContextWindow),
499
+ maxTokens: capacityInput(model, index, "maxTokens", props.defaultMaxTokens),
500
+ onFieldChange: (field, value) => {
501
+ update(index, field, value);
502
+ },
503
+ onIdBlur: (value) => {
504
+ const trimmed = value.trim();
505
+ if (trimmed !== value) update(index, "id", trimmed);
506
+ },
507
+ onChange: (next) => {
508
+ props.onChange(props.models.map((row, at) => at === index ? next : row));
509
+ },
510
+ onToggle: () => {
511
+ toggle(index);
512
+ },
513
+ onRemove: () => {
514
+ remove(index);
515
+ }
434
516
  }, index))
435
517
  }),
436
518
  (0, react_jsx_runtime.jsxs)("button", {
@@ -472,44 +554,6 @@ window.__ModuleLoader__.load({
472
554
  const value = model[key];
473
555
  return typeof value === "number" ? value : void 0;
474
556
  }
475
- /** Disclosure chevron; rotates to point down while its row is open. */
476
- function IconChevron({ open }) {
477
- return (0, react_jsx_runtime.jsx)("svg", {
478
- width: "14",
479
- height: "14",
480
- viewBox: "0 0 16 16",
481
- fill: "none",
482
- "aria-hidden": true,
483
- style: {
484
- transform: open ? "rotate(90deg)" : void 0,
485
- transition: "transform 120ms ease"
486
- },
487
- children: (0, react_jsx_runtime.jsx)("path", {
488
- d: "M6 3.5L10.5 8L6 12.5",
489
- stroke: "currentColor",
490
- strokeWidth: "1.5",
491
- strokeLinecap: "round",
492
- strokeLinejoin: "round"
493
- })
494
- });
495
- }
496
- /** Removal glyph for one model row. */
497
- function IconTrash() {
498
- return (0, react_jsx_runtime.jsx)("svg", {
499
- width: "14",
500
- height: "14",
501
- viewBox: "0 0 16 16",
502
- fill: "none",
503
- "aria-hidden": true,
504
- children: (0, react_jsx_runtime.jsx)("path", {
505
- d: "M2.5 4h11M6.5 4V2.5h3V4M4 4l.7 9a1 1 0 001 .9h4.6a1 1 0 001-.9L12 4M6.5 6.8v4.4M9.5 6.8v4.4",
506
- stroke: "currentColor",
507
- strokeWidth: "1.3",
508
- strokeLinecap: "round",
509
- strokeLinejoin: "round"
510
- })
511
- });
512
- }
513
557
  /**
514
558
  * What an empty capacity field is worth, shown as its placeholder so a row left
515
559
  * blank does not read as a model with no capacity at all.
@@ -535,13 +579,14 @@ window.__ModuleLoader__.load({
535
579
  function capacitySpelling(value) {
536
580
  return value === void 0 ? "" : formatCapacity(value);
537
581
  }
538
- /** Adopt a candidate, keeping whatever capacities the provider disclosed. */
582
+ /** Adopt a candidate, preserving disclosed capacities and input types. */
539
583
  function adopt(candidate) {
540
584
  return {
541
585
  id: candidate.id,
542
586
  ...candidate.name === void 0 ? {} : { name: candidate.name },
543
587
  ...candidate.contextWindow === void 0 ? {} : { contextWindow: candidate.contextWindow },
544
- ...candidate.maxTokens === void 0 ? {} : { maxTokens: candidate.maxTokens }
588
+ ...candidate.maxTokens === void 0 ? {} : { maxTokens: candidate.maxTokens },
589
+ ...candidate.inputModalities === void 0 ? {} : { input: [...candidate.inputModalities] }
545
590
  };
546
591
  }
547
592
  /**
@@ -551,8 +596,31 @@ window.__ModuleLoader__.load({
551
596
  */
552
597
  function ModelListEditor(props) {
553
598
  const { models, onChange, probe, operations, t, disabled } = props;
599
+ const { catalogProvider } = props;
554
600
  const [busy, setBusy] = (0, react.useState)(false);
555
601
  const [failure, setFailure] = (0, react.useState)(void 0);
602
+ const [inheritedCatalog, setInheritedCatalog] = (0, react.useState)(void 0);
603
+ (0, react.useEffect)(() => {
604
+ if (catalogProvider === void 0) return;
605
+ let current = true;
606
+ operations.discoverModels(probe.settingsNs, { provider: catalogProvider }).then((answer) => {
607
+ if (!current) return;
608
+ setInheritedCatalog({
609
+ provider: catalogProvider,
610
+ models: answer.kind === "found" ? answer.models : []
611
+ });
612
+ setFailure(answer.kind === "refused" ? answer.message : void 0);
613
+ });
614
+ return () => {
615
+ current = false;
616
+ };
617
+ }, [
618
+ catalogProvider,
619
+ operations,
620
+ probe.settingsNs
621
+ ]);
622
+ const catalog = inheritedCatalog?.provider === catalogProvider ? inheritedCatalog?.models : void 0;
623
+ const inputDefaults = (0, react.useMemo)(() => new Map(catalog?.map((model) => [model.id, model.inputModalities])), [catalog]);
556
624
  const [candidates, setCandidates] = (0, react.useState)(void 0);
557
625
  const [picked, setPicked] = (0, react.useState)(/* @__PURE__ */ new Set());
558
626
  const [candidateQuery, setCandidateQuery] = (0, react.useState)("");
@@ -608,6 +676,10 @@ window.__ModuleLoader__.load({
608
676
  return;
609
677
  }
610
678
  const found = answer.models;
679
+ if (catalogProvider !== void 0) setInheritedCatalog({
680
+ provider: catalogProvider,
681
+ models: found
682
+ });
611
683
  if (found.length === 0) {
612
684
  setFailure(t("fetchEmpty"));
613
685
  return;
@@ -696,125 +768,61 @@ window.__ModuleLoader__.load({
696
768
  className: ModelsSection_module_css_default["modelEmpty"],
697
769
  children: t("modelsEmpty")
698
770
  }) : null,
699
- models.map((model, index) => (0, react_jsx_runtime.jsxs)("div", {
700
- className: ModelsSection_module_css_default["modelEntry"],
701
- children: [(0, react_jsx_runtime.jsxs)("div", {
702
- className: ModelsSection_module_css_default["modelRow"],
703
- children: [
704
- (0, react_jsx_runtime.jsx)("input", {
705
- className: ModelsSection_module_css_default["input"],
706
- type: "text",
707
- value: textOf(model, "id"),
708
- placeholder: t("modelId"),
709
- "aria-label": `${t("modelId")} ${index + 1}`,
710
- disabled,
711
- onChange: (event) => {
712
- patch(index, { id: event.target.value });
713
- }
714
- }),
715
- (0, react_jsx_runtime.jsx)("input", {
716
- className: ModelsSection_module_css_default["input"],
717
- type: "text",
718
- value: textOf(model, "name"),
719
- placeholder: t("modelName"),
720
- "aria-label": `${t("modelName")} ${index + 1}`,
721
- disabled,
722
- onChange: (event) => {
723
- patch(index, { name: event.target.value === "" ? void 0 : event.target.value });
724
- }
725
- }),
726
- (0, react_jsx_runtime.jsx)("button", {
727
- type: "button",
728
- className: ModelsSection_module_css_default["iconButton"],
729
- "aria-label": `${t("modelAdvanced")} ${index + 1}`,
730
- "aria-expanded": expanded.has(index),
731
- title: t("modelAdvanced"),
732
- onClick: () => {
733
- toggleExpanded(index);
734
- },
735
- children: (0, react_jsx_runtime.jsx)(IconChevron, { open: expanded.has(index) })
736
- }),
737
- (0, react_jsx_runtime.jsx)("button", {
738
- type: "button",
739
- className: `${ModelsSection_module_css_default["iconButton"]} ${ModelsSection_module_css_default["iconButtonDanger"]}`,
740
- "aria-label": `${t("removeModel")} ${index + 1}`,
741
- title: t("removeModel"),
742
- disabled,
743
- onClick: () => {
744
- onChange(models.filter((_model, at) => at !== index));
745
- setExpanded((current) => {
746
- const next = /* @__PURE__ */ new Set();
747
- for (const at of current) if (at < index) next.add(at);
748
- else if (at > index) next.add(at - 1);
749
- return next;
750
- });
751
- setEditing((current) => reindexOnRemove(current, index));
752
- },
753
- children: (0, react_jsx_runtime.jsx)(IconTrash, {})
754
- })
755
- ]
756
- }), expanded.has(index) ? (0, react_jsx_runtime.jsxs)("div", {
757
- className: ModelsSection_module_css_default["modelAdvanced"],
758
- children: [(0, react_jsx_runtime.jsxs)("label", {
759
- className: ModelsSection_module_css_default["modelField"],
760
- children: [(0, react_jsx_runtime.jsx)("span", {
761
- className: ModelsSection_module_css_default["modelFieldLabel"],
762
- children: t("modelContextWindow")
763
- }), (0, react_jsx_runtime.jsx)("input", {
764
- className: ModelsSection_module_css_default["input"],
765
- type: "text",
766
- inputMode: "numeric",
767
- value: capacityText(model, index, "contextWindow"),
768
- placeholder: CAPACITY_HINT.contextWindow,
769
- "aria-label": `${t("modelContextWindow")} ${index + 1}`,
770
- disabled,
771
- onChange: (event) => {
772
- editCapacity(index, "contextWindow", event.target.value);
773
- }
774
- })]
775
- }), (0, react_jsx_runtime.jsxs)("label", {
776
- className: ModelsSection_module_css_default["modelField"],
777
- children: [(0, react_jsx_runtime.jsx)("span", {
778
- className: ModelsSection_module_css_default["modelFieldLabel"],
779
- children: t("modelMaxTokens")
780
- }), (0, react_jsx_runtime.jsx)("input", {
781
- className: ModelsSection_module_css_default["input"],
782
- type: "text",
783
- inputMode: "numeric",
784
- value: capacityText(model, index, "maxTokens"),
785
- placeholder: CAPACITY_HINT.maxTokens,
786
- "aria-label": `${t("modelMaxTokens")} ${index + 1}`,
787
- disabled,
788
- onChange: (event) => {
789
- editCapacity(index, "maxTokens", event.target.value);
790
- }
791
- })]
792
- }), props.thinkingPresets ? (0, react_jsx_runtime.jsxs)("label", {
793
- className: ModelsSection_module_css_default["modelField"],
794
- children: [(0, react_jsx_runtime.jsx)("span", {
795
- className: ModelsSection_module_css_default["modelFieldLabel"],
796
- children: t("thinkingPreset")
797
- }), (0, react_jsx_runtime.jsxs)("select", {
798
- className: `${ModelsSection_module_css_default["input"]} ${ModelsSection_module_css_default["selectInput"]}`,
799
- value: thinkingPresetOf(model),
800
- "aria-label": `${t("thinkingPreset")} ${index + 1}`,
801
- disabled,
802
- onChange: (event) => {
803
- patch(index, { reasoningEfforts: reasoningEffortsForPreset(event.target.value) });
804
- },
805
- children: [(0, react_jsx_runtime.jsx)("option", { value: "toggle", children: t("thinkingPresetToggle") }), (0, react_jsx_runtime.jsx)("option", { value: "four", children: t("thinkingPresetFour") }), (0, react_jsx_runtime.jsx)("option", { value: "five", children: t("thinkingPresetFive") })]
806
- })]
807
- }) : null]
808
- }) : null]
809
- }, index)),
810
- (0, react_jsx_runtime.jsx)("button", {
771
+ (0, react_jsx_runtime.jsx)("div", {
772
+ className: ModelsSection_module_css_default["modelList"],
773
+ children: models.map((model, index) => (0, react_jsx_runtime.jsx)(ModelRow, {
774
+ model,
775
+ position: index + 1,
776
+ inputField: "input",
777
+ thinkingPresets: props.thinkingPresets,
778
+ inputFallback: props.thinkingPresets && CLAUDE_KNOWN_MODELS[model.id] ? ["text", "image"] : inputDefaults.get(textOf(model, "id")) ?? props.defaultInput,
779
+ inputLoading: catalogProvider !== void 0 && catalog === void 0,
780
+ expanded: expanded.has(index),
781
+ disabled,
782
+ t,
783
+ contextWindow: {
784
+ value: capacityText(model, index, "contextWindow"),
785
+ placeholder: CAPACITY_HINT.contextWindow,
786
+ onChange: (text) => {
787
+ editCapacity(index, "contextWindow", text);
788
+ }
789
+ },
790
+ maxTokens: {
791
+ value: capacityText(model, index, "maxTokens"),
792
+ placeholder: CAPACITY_HINT.maxTokens,
793
+ onChange: (text) => {
794
+ editCapacity(index, "maxTokens", text);
795
+ }
796
+ },
797
+ onFieldChange: (field, value) => {
798
+ patch(index, { [field]: value });
799
+ },
800
+ onChange: (next) => {
801
+ onChange(models.map((row, at) => at === index ? next : row));
802
+ },
803
+ onToggle: () => {
804
+ toggleExpanded(index);
805
+ },
806
+ onRemove: () => {
807
+ onChange(models.filter((_model, at) => at !== index));
808
+ setExpanded((current) => {
809
+ const next = /* @__PURE__ */ new Set();
810
+ for (const at of current) if (at < index) next.add(at);
811
+ else if (at > index) next.add(at - 1);
812
+ return next;
813
+ });
814
+ setEditing((current) => reindexOnRemove(current, index));
815
+ }
816
+ }, index))
817
+ }),
818
+ (0, react_jsx_runtime.jsxs)("button", {
811
819
  type: "button",
812
820
  className: ModelsSection_module_css_default["addModelButton"],
813
821
  disabled,
814
822
  onClick: () => {
815
823
  onChange([...models, props.thinkingPresets ? withDefaultClaudeReasoning({ id: "" }) : { id: "" }]);
816
824
  },
817
- children: t("addModel")
825
+ children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPlusOutline16, { size: 14 }), t("addModel")]
818
826
  }),
819
827
  failure !== void 0 ? (0, react_jsx_runtime.jsx)("p", {
820
828
  className: ModelsSection_module_css_default["error"],
@@ -1435,8 +1443,6 @@ window.__ModuleLoader__.load({
1435
1443
  * path ops against the stored section — the card names only the fields it can
1436
1444
  * see instead of rebuilding the whole subtree from a partial descriptor.
1437
1445
  */
1438
- /** The public DeepSeek endpoint shown as the deepseek base-URL placeholder. */
1439
- const DEEPSEEK_PUBLIC_BASE_URL = "https://api.deepseek.com";
1440
1446
  /** A user-section subtree as a plain draft object (absent → empty). */
1441
1447
  function draftAt(schema, namespace, path) {
1442
1448
  const subtree = schema.getPath(namespace.user, path);
@@ -1627,6 +1633,7 @@ window.__ModuleLoader__.load({
1627
1633
  const models = modelDrafts(modelsOverridden ? customModels : inheritedModels());
1628
1634
  const defaultContextWindow = schema.getPath(fallback, ["defaultContextWindow"]);
1629
1635
  const defaultMaxTokens = schema.getPath(fallback, ["maxTokens"]);
1636
+ const defaultInput = schema.getPath(fallback, ["defaultInput"]);
1630
1637
  const keyPlaceholder = keyLocked ? t("keyEnvLocked") : keyState?.configured === true && props.credentialRequired !== true ? t("keyStored") : family === "pi-ai" ? t("keyPlaceholderNative") : t("keyPlaceholder");
1631
1638
  /** What both family editors take: the rows, whose layer owns them, and the two writes. */
1632
1639
  const catalogProps = {
@@ -1695,20 +1702,29 @@ window.__ModuleLoader__.load({
1695
1702
  }) : null,
1696
1703
  (0, react_jsx_runtime.jsxs)("div", {
1697
1704
  className: ModelsSection_module_css_default["field"],
1698
- children: [(0, react_jsx_runtime.jsx)("span", {
1699
- className: ModelsSection_module_css_default["fieldLabel"],
1700
- children: t("baseUrl")
1701
- }), (0, react_jsx_runtime.jsx)("input", {
1702
- className: ModelsSection_module_css_default["input"],
1703
- type: "text",
1704
- value: stringAt(draft, "baseURL") ?? "",
1705
- placeholder: family === "deepseek" ? DEEPSEEK_PUBLIC_BASE_URL : stringAt(fallback, "baseURL") ?? t("baseUrlDefault"),
1706
- "aria-label": t("baseUrl"),
1707
- disabled,
1708
- onChange: (event) => {
1709
- setField("baseURL", event.target.value === "" ? void 0 : event.target.value);
1710
- }
1711
- })]
1705
+ children: [
1706
+ (0, react_jsx_runtime.jsx)("span", {
1707
+ className: ModelsSection_module_css_default["fieldLabel"],
1708
+ children: t("baseUrl")
1709
+ }),
1710
+ (0, react_jsx_runtime.jsx)("input", {
1711
+ className: ModelsSection_module_css_default["input"],
1712
+ type: "text",
1713
+ value: stringAt(draft, "baseURL") ?? "",
1714
+ placeholder: family === "deepseek" ? t(stringAt(fallback, "protocol") === "messages" ? "deepSeekMessagesBaseUrl" : "deepSeekChatBaseUrl") : stringAt(fallback, "baseURL") ?? t("baseUrlDefault"),
1715
+ "aria-describedby": family === "deepseek" ? `${props.provider}-endpoint-hint` : void 0,
1716
+ "aria-label": t("baseUrl"),
1717
+ disabled,
1718
+ onChange: (event) => {
1719
+ setField("baseURL", event.target.value === "" ? void 0 : event.target.value);
1720
+ }
1721
+ }),
1722
+ family === "deepseek" ? (0, react_jsx_runtime.jsx)("span", {
1723
+ id: `${props.provider}-endpoint-hint`,
1724
+ className: ModelsSection_module_css_default["advancedHint"],
1725
+ children: t("deepSeekEndpointHint")
1726
+ }) : null
1727
+ ]
1712
1728
  }),
1713
1729
  ownsIdentity ? (0, react_jsx_runtime.jsxs)("div", {
1714
1730
  className: ModelsSection_module_css_default["field"],
@@ -1738,6 +1754,8 @@ window.__ModuleLoader__.load({
1738
1754
  defaultMaxTokens: typeof defaultMaxTokens === "number" ? defaultMaxTokens : void 0
1739
1755
  }) : (0, react_jsx_runtime.jsx)(ModelListEditor, {
1740
1756
  ...catalogProps,
1757
+ catalogProvider: props.declared === true ? void 0 : props.provider,
1758
+ defaultInput: Array.isArray(defaultInput) ? defaultInput : void 0,
1741
1759
  probe,
1742
1760
  probeBlocked: keyFailure,
1743
1761
  thinkingPresets: props.thinkingPresets === true,
@@ -1901,10 +1919,14 @@ window.__ModuleLoader__.load({
1901
1919
  if (preset === "four") return { ...CLAUDE_FOUR_EFFORTS };
1902
1920
  return { ...CLAUDE_FIVE_EFFORTS };
1903
1921
  }
1922
+ function withKnownClaudeInput(model) {
1923
+ if (!CLAUDE_KNOWN_MODELS[model?.id] || (Array.isArray(model.input) && model.input.length > 0)) return { ...model };
1924
+ return { ...model, input: ["text", "image"] };
1925
+ }
1904
1926
  function withFetchedClaudeMetadata(model) {
1905
1927
  const known = CLAUDE_KNOWN_MODELS[model?.id];
1906
1928
  if (known === undefined) return withDefaultClaudeReasoning(model);
1907
- return { ...model, contextWindow: known.contextWindow, maxTokens: known.maxTokens, reasoningEfforts: reasoningEffortsForPreset(known.preset) };
1929
+ return { ...withKnownClaudeInput(model), contextWindow: known.contextWindow, maxTokens: known.maxTokens, reasoningEfforts: reasoningEffortsForPreset(known.preset) };
1908
1930
  }
1909
1931
  function thinkingPresetOf(model) {
1910
1932
  const efforts = model?.reasoningEfforts;
@@ -1921,7 +1943,7 @@ window.__ModuleLoader__.load({
1921
1943
  : { ...model, reasoningEfforts: reasoningEffortsForPreset("five") };
1922
1944
  }
1923
1945
  function withNativeClaudeModel(model) {
1924
- const next = withDefaultClaudeReasoning(model);
1946
+ const next = withKnownClaudeInput(withDefaultClaudeReasoning(model));
1925
1947
  const efforts = next.reasoningEfforts;
1926
1948
  const adaptive = efforts !== null && typeof efforts === "object" && !Array.isArray(efforts)
1927
1949
  && ["low", "medium", "high", "max"].every((level) => typeof efforts[level] === "string" && efforts[level].length > 0);
@@ -2857,6 +2879,9 @@ window.__ModuleLoader__.load({
2857
2879
  customized: "Customized settings",
2858
2880
  baseUrl: "Base URL",
2859
2881
  baseUrlDefault: "Provider default",
2882
+ deepSeekChatBaseUrl: "https://api.deepseek.com",
2883
+ deepSeekMessagesBaseUrl: "https://api.deepseek.com/anthropic",
2884
+ deepSeekEndpointHint: "Use an endpoint compatible with the configured connection.",
2860
2885
  models: "Models",
2861
2886
  modelsInherited: "Using the adapter defaults",
2862
2887
  modelsCustomized: "Customized model catalog",
@@ -2869,7 +2894,10 @@ window.__ModuleLoader__.load({
2869
2894
  contextWindowPlaceholder: "Uses the provider default",
2870
2895
  maxTokens: "Max output tokens",
2871
2896
  maxTokensPlaceholder: "Uses the provider default",
2872
- modelAdvanced: "Capacities",
2897
+ modelAdvanced: "Model options",
2898
+ modelInputTypes: "Input types",
2899
+ modelInputText: "Text",
2900
+ modelInputImage: "Image",
2873
2901
  addModel: "Add model",
2874
2902
  removeModel: "Delete model",
2875
2903
  modelsEmpty: "No models will be shown in the selector. Unlisted IDs can still be sent directly.",
@@ -2884,8 +2912,6 @@ window.__ModuleLoader__.load({
2884
2912
  advancedHint: "Other fields live in settings.yaml; edit that section directly.",
2885
2913
  modelCapacityInvalid: "A capacity must be a number, optionally suffixed K or M.",
2886
2914
  modelDuplicate: "Each model ID may appear once.",
2887
- modelContextWindow: "Context window",
2888
- modelMaxTokens: "Max output tokens",
2889
2915
  fetchModels: "Fetch available models",
2890
2916
  fetching: "Asking the provider…",
2891
2917
  fetchNeedsBaseUrl: "Enter the base URL first, then fetch.",
@@ -2973,6 +2999,9 @@ window.__ModuleLoader__.load({
2973
2999
  customized: "自定义设置",
2974
3000
  baseUrl: "API 地址",
2975
3001
  baseUrlDefault: "提供方默认",
3002
+ deepSeekChatBaseUrl: "https://api.deepseek.com",
3003
+ deepSeekMessagesBaseUrl: "https://api.deepseek.com/anthropic",
3004
+ deepSeekEndpointHint: "请填写与当前连接配置兼容的 API 地址。",
2976
3005
  models: "模型目录",
2977
3006
  modelsInherited: "正在使用适配器默认模型",
2978
3007
  modelsCustomized: "已自定义模型目录",
@@ -2985,7 +3014,10 @@ window.__ModuleLoader__.load({
2985
3014
  contextWindowPlaceholder: "使用提供方默认值",
2986
3015
  maxTokens: "最大输出 token 数",
2987
3016
  maxTokensPlaceholder: "使用提供方默认值",
2988
- modelAdvanced: "容量",
3017
+ modelAdvanced: "模型选项",
3018
+ modelInputTypes: "输入类型",
3019
+ modelInputText: "文本",
3020
+ modelInputImage: "图片",
2989
3021
  addModel: "添加模型",
2990
3022
  removeModel: "删除模型",
2991
3023
  modelsEmpty: "模型选择器中将不显示任何模型;目录外 ID 仍可直接发送。",
@@ -3000,8 +3032,6 @@ window.__ModuleLoader__.load({
3000
3032
  advancedHint: "其余字段在 settings.yaml 中,请直接编辑对应段。",
3001
3033
  modelCapacityInvalid: "容量需为数字,可加 K 或 M 后缀。",
3002
3034
  modelDuplicate: "每个模型 ID 只能出现一次。",
3003
- modelContextWindow: "上下文窗口",
3004
- modelMaxTokens: "最大输出 token",
3005
3035
  fetchModels: "获取可用模型",
3006
3036
  fetching: "正在询问提供方…",
3007
3037
  fetchNeedsBaseUrl: "请先填写 API 地址,再获取。",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mofeng2223/dsh-claude-provider",
3
- "version": "0.4.4",
4
- "description": "Custom Claude provider support for DeepSeek Harness 0.1.5-rc.2",
3
+ "version": "0.4.6",
4
+ "description": "Custom Claude provider support for DeepSeek Harness 0.1.6-alpha.2",
5
5
  "author": "mofeng2223",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -60,6 +60,6 @@
60
60
  }
61
61
  },
62
62
  "devDependencies": {
63
- "@deepseek-ai/dsh-client-ui-settings-models": "0.1.5-rc.2"
63
+ "@deepseek-ai/dsh-client-ui-settings-models": "0.1.6-alpha.2"
64
64
  }
65
65
  }