@qilin-agent/client-ui-settings-models 3.1.4 → 3.1.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.
- package/README.i18n.yaml +4 -4
- package/README.md +8 -2
- package/README.zh.md +8 -2
- package/lib/client.js +498 -72
- package/lib/types/client/ApiKeyInput.d.ts +17 -0
- package/lib/types/client/CustomProviderCard.d.ts +8 -5
- package/lib/types/client/ModelListEditor.d.ts +6 -0
- package/lib/types/client/ModelReasoningEfforts.d.ts +43 -0
- package/lib/types/client/ModelRow.d.ts +2 -0
- package/lib/types/client/ProviderEditor.d.ts +13 -6
- package/lib/types/client/locales.d.ts +19 -0
- package/lib/types/client/store.d.ts +27 -4
- package/package.json +13 -13
package/lib/client.js
CHANGED
|
@@ -55,7 +55,7 @@ window.__ModuleLoader__.load({
|
|
|
55
55
|
}
|
|
56
56
|
//#endregion
|
|
57
57
|
//#region \0qilin-css:/home/runner/work/QiLin/QiLin/packages/client/ui-settings-models/src/client/ModelsSection.module.css.mjs
|
|
58
|
-
const css$2 = ".PF5DZW_section{color:var(--qilin-alias-label-primary);flex-direction:column;gap:12px;display:flex}.PF5DZW_title{color:var(--qilin-alias-label-primary);margin:0;font-size:16px;font-weight:500;line-height:24px}.PF5DZW_intro{color:var(--qilin-alias-label-tertiary);margin:0;font-size:14px;line-height:22px}.PF5DZW_notice{color:var(--qilin-alias-state-warn-label);margin:0;font-size:12px;line-height:18px}.PF5DZW_savedNotice{color:var(--qilin-alias-state-success-primary);margin:0;font-size:12px;line-height:18px}.PF5DZW_rows{flex-direction:column;gap:8px;margin:12px 0 0;padding:0;list-style:none;display:flex}.PF5DZW_rowCard{border:.5px solid var(--qilin-alias-border-l4);border-radius:16px;flex-direction:column;gap:12px;padding:12px 14px;display:flex}.PF5DZW_rowHead{align-items:center;gap:10px;display:flex}.PF5DZW_rowIdentity{align-items:center;gap:6px;min-width:0;display:inline-flex}.PF5DZW_rowName{color:var(--qilin-alias-label-primary);font-size:14px;font-weight:500;line-height:22px}.PF5DZW_rowTag{border:.5px solid var(--qilin-alias-border-l3);color:var(--qilin-alias-label-secondary);border-radius:4px;flex:none;padding:1px 6px;font-size:11px;line-height:16px}.PF5DZW_credentialDot{box-sizing:border-box;corner-shape:round;border-radius:50%;flex:none;width:8px;height:8px;display:inline-block}.PF5DZW_credentialDotConfigured{background:var(--qilin-alias-state-success-primary)}.PF5DZW_credentialDotMissing{background:var(--qilin-alias-state-error-primary)}.PF5DZW_rowActions{align-items:center;gap:4px;margin-left:auto;display:inline-flex}.PF5DZW_primaryButton,.PF5DZW_secondaryButton,.PF5DZW_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}.PF5DZW_primaryButton{background:var(--qilin-alias-button-primary-fill);color:var(--qilin-alias-label-primary-foreground)}.PF5DZW_primaryButton:hover:not(:disabled){background:var(--qilin-alias-button-primary-hover)}.PF5DZW_secondaryButton,.PF5DZW_addButton{border:.5px solid var(--qilin-alias-border-l3);color:var(--qilin-alias-label-primary);background:0 0}.PF5DZW_secondaryButton:hover:not(:disabled),.PF5DZW_addButton:hover:not(:disabled){background:var(--qilin-alias-interactive-bg-hover)}.PF5DZW_secondaryButton:hover:not(:disabled){background:var(--qilin-alias-interactive-bg-hover-solid)}.PF5DZW_dangerButton{box-sizing:border-box;height:36px;color:var(--qilin-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}.PF5DZW_dangerButton:hover:not(:disabled){background:var(--qilin-alias-interactive-bg-hover-danger)}.PF5DZW_rowActions .PF5DZW_secondaryButton,.PF5DZW_rowActions .PF5DZW_dangerButton{border-radius:14px;height:28px;padding:0 10px;font-size:12px;line-height:18px}.PF5DZW_primaryButton:disabled,.PF5DZW_secondaryButton:disabled,.PF5DZW_dangerButton:disabled,.PF5DZW_addButton:disabled,.PF5DZW_linkButton:disabled,.PF5DZW_addModelButton:disabled{opacity:.4;cursor:default}.PF5DZW_primaryButton:focus-visible,.PF5DZW_secondaryButton:focus-visible,.PF5DZW_dangerButton:focus-visible,.PF5DZW_addButton:focus-visible,.PF5DZW_linkButton:focus-visible,.PF5DZW_addModelButton:focus-visible,.PF5DZW_iconButton:focus-visible,.PF5DZW_customizedSummary:focus-visible{box-shadow:0 0 0 2px var(--qilin-focus-ring-color,var(--qilin-alias-state-business-primary));outline:none}.PF5DZW_editor{background:var(--qilin-alias-bg-module-platform);border-radius:12px;flex-direction:column;gap:14px;padding:14px 16px;display:flex}.PF5DZW_editorHeader{align-items:baseline;gap:8px;display:flex}.PF5DZW_editorTitle{color:var(--qilin-alias-label-primary);font-size:14px;font-weight:500;line-height:22px}.PF5DZW_editorRoute{color:var(--qilin-alias-label-tertiary);font-size:12px;line-height:18px}.PF5DZW_field{flex-direction:column;gap:6px;display:flex}.PF5DZW_fieldLabel{color:var(--qilin-alias-label-secondary);align-items:center;gap:10px;font-size:12px;font-weight:500;line-height:18px;display:inline-flex}.PF5DZW_linkButton{box-sizing:border-box;height:28px;color:var(--qilin-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}.PF5DZW_linkButton:hover:not(:disabled){background:var(--qilin-alias-interactive-bg-hover);color:var(--qilin-alias-label-secondary)}.PF5DZW_advancedHint{color:var(--qilin-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.PF5DZW_editorActions{justify-content:flex-end;gap:8px;display:flex}.PF5DZW_addBlock{flex-direction:column;gap:12px;display:flex}.PF5DZW_addActions{flex-wrap:wrap;gap:10px;display:flex}.PF5DZW_addButton{border:1px dashed var(--qilin-alias-border-l3);border-radius:16px;flex:1 1 0;gap:6px;min-width:180px;height:44px}.PF5DZW_addCard,.PF5DZW_setupCard{background:var(--qilin-alias-bg-module-platform);border-radius:12px;flex-direction:column;gap:14px;padding:14px 16px;list-style:none;display:flex}.PF5DZW_addCard .PF5DZW_editor,.PF5DZW_setupCard .PF5DZW_editor{background:0 0;padding:0}.PF5DZW_customized{border-top:.5px solid var(--qilin-alias-border-l2);padding-top:10px}.PF5DZW_customizedSummary{cursor:pointer;width:fit-content;color:var(--qilin-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}.PF5DZW_customizedSummary::-webkit-details-marker{display:none}.PF5DZW_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)}.PF5DZW_customized[open]>.PF5DZW_customizedSummary:before{transform:rotate(45deg)translate(-1px,-1px)}.PF5DZW_customizedSummary:hover{color:var(--qilin-alias-label-primary)}.PF5DZW_customizedBody{flex-direction:column;gap:12px;padding-top:12px;display:flex}.PF5DZW_modelCatalog{border-top:.5px solid var(--qilin-alias-border-l2);flex-direction:column;gap:10px;padding-top:12px;display:flex}.PF5DZW_modelCatalogHeading{flex-direction:column;gap:2px;display:flex}.PF5DZW_modelCatalogTitle{color:var(--qilin-alias-label-secondary);font-size:12px;font-weight:500;line-height:18px}.PF5DZW_modelCatalogMeta,.PF5DZW_modelEmpty{color:var(--qilin-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.PF5DZW_modelList{flex-direction:column;gap:8px;display:flex}.PF5DZW_modelListHead{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.PF5DZW_modelEntry{border:.5px solid var(--qilin-alias-border-l4);border-radius:10px;padding:6px}.PF5DZW_modelRow{grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) auto auto;align-items:center;gap:6px;display:grid}.PF5DZW_iconButton{box-sizing:border-box;width:28px;height:28px;color:var(--qilin-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;display:inline-flex}.PF5DZW_iconButton:hover:not(:disabled){background:var(--qilin-alias-interactive-bg-hover);color:var(--qilin-alias-label-primary)}.PF5DZW_iconButton:disabled{cursor:default;opacity:.4}.PF5DZW_iconButtonDanger:hover:not(:disabled){background:var(--qilin-alias-interactive-bg-hover-danger);color:var(--qilin-alias-state-error-primary)}.PF5DZW_modelAdvanced{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:8px 4px 2px;display:grid}.PF5DZW_modelField{flex-direction:column;gap:4px;min-width:0;display:flex}.PF5DZW_modelInputTypes{border:none;grid-column:1/-1;min-width:0;margin:0;padding:0}.PF5DZW_modelInputTypes legend{margin-bottom:4px;padding:0}.PF5DZW_modelInputChoices{flex-wrap:wrap;align-items:center;gap:16px;min-height:32px;display:flex}.PF5DZW_modelFieldLabel{color:var(--qilin-alias-label-tertiary);font-size:12px;line-height:18px}.PF5DZW_modelEmpty{border:1px dashed var(--qilin-alias-border-l3);text-align:center;border-radius:8px;padding:12px}.PF5DZW_addModelButton{box-sizing:border-box;border:.5px solid var(--qilin-alias-border-l3);height:28px;color:var(--qilin-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}.PF5DZW_addModelButton:hover:not(:disabled){background:var(--qilin-alias-interactive-bg-hover)}.PF5DZW_input{box-sizing:border-box;border:.5px solid var(--qilin-alias-border-l4);width:100%;height:32px;font:inherit;background:var(--qilin-alias-bg-layer-1);color:var(--qilin-alias-label-primary);border-radius:8px;padding:0 10px;font-size:14px;line-height:22px}select.PF5DZW_input{cursor:pointer;max-width:240px}.PF5DZW_input:focus{border-color:var(--qilin-alias-state-business-primary);outline:none}.PF5DZW_input::placeholder{color:var(--qilin-alias-label-dimmed)}.PF5DZW_input:disabled{opacity:.6;cursor:default}.PF5DZW_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}.PF5DZW_error{color:var(--qilin-alias-state-error-primary);margin:0;font-size:12px;line-height:18px}.PF5DZW_deleteDialog{width:min(480px,100%)}.PF5DZW_deleteConfirm:not(:disabled){border-color:var(--qilin-alias-state-error-primary);color:var(--qilin-alias-state-error-primary)}.PF5DZW_deleteConfirm:hover:not(:disabled){background:var(--qilin-alias-interactive-bg-hover-danger)}.PF5DZW_hiddenLabel{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.PF5DZW_customizedSummary:before,.PF5DZW_switchThumb{transition:none}}.PF5DZW_fetchDialog{--qilin-scrollbar-thumb:var(--qilin-alias-scrollbar-bg-l2);--qilin-scrollbar-thumb-hover:var(--qilin-alias-scrollbar-hover-l2);max-width:520px}.PF5DZW_candidateToolbar{align-items:center;gap:8px;margin-bottom:6px;display:flex}.PF5DZW_candidateSearch{flex:240px;min-width:0}.PF5DZW_candidateList{flex-direction:column;gap:2px;max-height:320px;margin:0;padding:0;list-style:none;display:flex;overflow-y:auto}.PF5DZW_candidate{border-radius:6px}.PF5DZW_candidateLabel{cursor:pointer;align-items:center;gap:8px;padding:6px 8px;display:flex}.PF5DZW_candidateId{font-family:var(--ds-font-family-code);overflow-wrap:anywhere;flex:auto;font-size:13px}.PF5DZW_candidateEmpty{color:var(--qilin-alias-label-secondary);text-align:center;margin:24px 0;font-size:13px;line-height:20px}";
|
|
58
|
+
const css$2 = ".PF5DZW_section{color:var(--qilin-alias-label-primary);flex-direction:column;gap:12px;display:flex}.PF5DZW_title{color:var(--qilin-alias-label-primary);margin:0;font-size:16px;font-weight:500;line-height:24px}.PF5DZW_intro{color:var(--qilin-alias-label-tertiary);margin:0;font-size:14px;line-height:22px}.PF5DZW_notice{color:var(--qilin-alias-state-warn-label);margin:0;font-size:12px;line-height:18px}.PF5DZW_savedNotice{color:var(--qilin-alias-state-success-primary);margin:0;font-size:12px;line-height:18px}.PF5DZW_rows{flex-direction:column;gap:8px;margin:12px 0 0;padding:0;list-style:none;display:flex}.PF5DZW_rowCard{border:.5px solid var(--qilin-alias-border-l4);border-radius:16px;flex-direction:column;gap:12px;padding:12px 14px;display:flex}.PF5DZW_rowHead{align-items:center;gap:10px;display:flex}.PF5DZW_rowIdentity{align-items:center;gap:6px;min-width:0;display:inline-flex}.PF5DZW_rowName{color:var(--qilin-alias-label-primary);font-size:14px;font-weight:500;line-height:22px}.PF5DZW_rowTag{border:.5px solid var(--qilin-alias-border-l3);color:var(--qilin-alias-label-secondary);border-radius:4px;flex:none;padding:1px 6px;font-size:11px;line-height:16px}.PF5DZW_credentialDot{box-sizing:border-box;corner-shape:round;border-radius:50%;flex:none;width:8px;height:8px;display:inline-block}.PF5DZW_credentialDotConfigured{background:var(--qilin-alias-state-success-primary)}.PF5DZW_credentialDotMissing{background:var(--qilin-alias-state-error-primary)}.PF5DZW_rowActions{align-items:center;gap:4px;margin-left:auto;display:inline-flex}.PF5DZW_primaryButton,.PF5DZW_secondaryButton,.PF5DZW_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}.PF5DZW_primaryButton{background:var(--qilin-alias-button-primary-fill);color:var(--qilin-alias-label-primary-foreground)}.PF5DZW_primaryButton:hover:not(:disabled){background:var(--qilin-alias-button-primary-hover)}.PF5DZW_secondaryButton,.PF5DZW_addButton{border:.5px solid var(--qilin-alias-border-l3);color:var(--qilin-alias-label-primary);background:0 0}.PF5DZW_secondaryButton:hover:not(:disabled),.PF5DZW_addButton:hover:not(:disabled){background:var(--qilin-alias-interactive-bg-hover)}.PF5DZW_secondaryButton:hover:not(:disabled){background:var(--qilin-alias-interactive-bg-hover-solid)}.PF5DZW_dangerButton{box-sizing:border-box;height:36px;color:var(--qilin-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}.PF5DZW_dangerButton:hover:not(:disabled){background:var(--qilin-alias-interactive-bg-hover-danger)}.PF5DZW_rowActions .PF5DZW_secondaryButton,.PF5DZW_rowActions .PF5DZW_dangerButton{border-radius:14px;height:28px;padding:0 10px;font-size:12px;line-height:18px}.PF5DZW_primaryButton:disabled,.PF5DZW_secondaryButton:disabled,.PF5DZW_dangerButton:disabled,.PF5DZW_addButton:disabled,.PF5DZW_linkButton:disabled,.PF5DZW_addModelButton:disabled{opacity:.4;cursor:default}.PF5DZW_primaryButton:focus-visible,.PF5DZW_secondaryButton:focus-visible,.PF5DZW_dangerButton:focus-visible,.PF5DZW_addButton:focus-visible,.PF5DZW_linkButton:focus-visible,.PF5DZW_addModelButton:focus-visible,.PF5DZW_iconButton:focus-visible,.PF5DZW_customizedSummary:focus-visible{box-shadow:0 0 0 2px var(--qilin-focus-ring-color,var(--qilin-alias-state-business-primary));outline:none}.PF5DZW_editor{background:var(--qilin-alias-bg-module-platform);border-radius:12px;flex-direction:column;gap:14px;padding:14px 16px;display:flex}.PF5DZW_editorHeader{align-items:baseline;gap:8px;display:flex}.PF5DZW_editorTitle{color:var(--qilin-alias-label-primary);font-size:14px;font-weight:500;line-height:22px}.PF5DZW_editorRoute{color:var(--qilin-alias-label-tertiary);font-size:12px;line-height:18px}.PF5DZW_field{flex-direction:column;gap:6px;display:flex}.PF5DZW_fieldLabel{color:var(--qilin-alias-label-secondary);align-items:center;gap:10px;font-size:12px;font-weight:500;line-height:18px;display:inline-flex}.PF5DZW_helpButton{border:.5px solid var(--qilin-alias-border-l3);corner-shape:round;width:16px;height:16px;color:var(--qilin-alias-label-tertiary);font:inherit;text-align:center;cursor:help;background:0 0;border-radius:50%;padding:0;font-size:11px;line-height:15px}.PF5DZW_helpButton:hover,.PF5DZW_helpButton:focus-visible{color:var(--qilin-alias-label-primary);border-color:var(--qilin-alias-label-tertiary)}.PF5DZW_linkButton{box-sizing:border-box;height:28px;color:var(--qilin-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}.PF5DZW_linkButton:hover:not(:disabled){background:var(--qilin-alias-interactive-bg-hover);color:var(--qilin-alias-label-secondary)}.PF5DZW_advancedHint{color:var(--qilin-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.PF5DZW_editorActions{justify-content:flex-end;gap:8px;display:flex}.PF5DZW_addBlock{flex-direction:column;gap:12px;display:flex}.PF5DZW_addActions{flex-wrap:wrap;gap:10px;display:flex}.PF5DZW_addButton{border:1px dashed var(--qilin-alias-border-l3);border-radius:16px;flex:1 1 0;gap:6px;min-width:180px;height:44px}.PF5DZW_addCard,.PF5DZW_setupCard{background:var(--qilin-alias-bg-module-platform);border-radius:12px;flex-direction:column;gap:14px;padding:14px 16px;list-style:none;display:flex}.PF5DZW_addCard .PF5DZW_editor,.PF5DZW_setupCard .PF5DZW_editor{background:0 0;padding:0}.PF5DZW_customized{border-top:.5px solid var(--qilin-alias-border-l2);padding-top:10px}.PF5DZW_customizedSummary{cursor:pointer;width:fit-content;color:var(--qilin-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}.PF5DZW_customizedSummary::-webkit-details-marker{display:none}.PF5DZW_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)}.PF5DZW_customized[open]>.PF5DZW_customizedSummary:before{transform:rotate(45deg)translate(-1px,-1px)}.PF5DZW_customizedSummary:hover{color:var(--qilin-alias-label-primary)}.PF5DZW_customizedBody{flex-direction:column;gap:12px;padding-top:12px;display:flex}.PF5DZW_modelCatalog{border-top:.5px solid var(--qilin-alias-border-l2);flex-direction:column;gap:10px;padding-top:12px;display:flex}.PF5DZW_modelCatalogHeading{flex-direction:column;gap:2px;display:flex}.PF5DZW_modelCatalogTitle{color:var(--qilin-alias-label-secondary);font-size:12px;font-weight:500;line-height:18px}.PF5DZW_modelCatalogMeta,.PF5DZW_modelEmpty{color:var(--qilin-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.PF5DZW_modelList{flex-direction:column;gap:8px;display:flex}.PF5DZW_modelListHead{justify-content:space-between;align-items:flex-start;gap:12px;display:flex}.PF5DZW_modelEntry{border:.5px solid var(--qilin-alias-border-l4);border-radius:10px;padding:6px}.PF5DZW_modelRow{grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) auto auto;align-items:center;gap:6px;display:grid}.PF5DZW_iconButton{box-sizing:border-box;width:28px;height:28px;color:var(--qilin-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:6px;justify-content:center;align-items:center;display:inline-flex}.PF5DZW_iconButton:hover:not(:disabled){background:var(--qilin-alias-interactive-bg-hover);color:var(--qilin-alias-label-primary)}.PF5DZW_iconButton:disabled{cursor:default;opacity:.4}.PF5DZW_iconButtonDanger:hover:not(:disabled){background:var(--qilin-alias-interactive-bg-hover-danger);color:var(--qilin-alias-state-error-primary)}.PF5DZW_modelAdvanced{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:8px 4px 2px;display:grid}.PF5DZW_modelField{flex-direction:column;gap:4px;min-width:0;display:flex}.PF5DZW_modelInputTypes{border:none;grid-column:1/-1;min-width:0;margin:0;padding:0}.PF5DZW_modelInputTypes legend{margin-bottom:4px;padding:0}.PF5DZW_modelInputChoices{flex-wrap:wrap;align-items:center;gap:16px;min-height:32px;display:flex}.PF5DZW_modelFieldLabel{color:var(--qilin-alias-label-tertiary);font-size:12px;line-height:18px}.PF5DZW_modelReasoning{flex-direction:column;grid-column:1/-1;gap:6px;min-width:0;display:flex}.PF5DZW_modelReasoningLabel{align-items:center;gap:6px;display:inline-flex}.PF5DZW_modelReasoningHead{justify-content:space-between;align-items:center;gap:8px;display:flex}.PF5DZW_modelReasoningRow{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;align-items:center;gap:6px;display:grid}.PF5DZW_modelReasoningRow .PF5DZW_selectInput{max-width:none}.PF5DZW_modelReasoningValueInput{font-family:var(--ds-font-family-code);font-size:13px}.PF5DZW_modelEmpty{border:1px dashed var(--qilin-alias-border-l3);text-align:center;border-radius:8px;padding:12px}.PF5DZW_addModelButton{box-sizing:border-box;border:.5px solid var(--qilin-alias-border-l3);height:28px;color:var(--qilin-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}.PF5DZW_addModelButton:hover:not(:disabled){background:var(--qilin-alias-interactive-bg-hover)}.PF5DZW_input{box-sizing:border-box;border:.5px solid var(--qilin-alias-border-l4);width:100%;height:32px;font:inherit;background:var(--qilin-alias-bg-layer-1);color:var(--qilin-alias-label-primary);border-radius:8px;padding:0 10px;font-size:14px;line-height:22px}select.PF5DZW_input{cursor:pointer;max-width:240px}.PF5DZW_input:focus{border-color:var(--qilin-alias-state-business-primary);outline:none}.PF5DZW_input::placeholder{color:var(--qilin-alias-label-dimmed)}.PF5DZW_input:disabled{opacity:.6;cursor:default}.PF5DZW_keyInput{position:relative}.PF5DZW_keyInputFilled{padding-right:40px}.PF5DZW_keyToggle{border-radius:var(--qilin-radius-md);width:32px;color:var(--qilin-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}.PF5DZW_keyToggle:hover:not(:disabled){color:var(--qilin-alias-label-primary)}.PF5DZW_keyToggle:focus-visible{outline:var(--qilin-focus-ring-width) solid var(--qilin-focus-ring-color,var(--qilin-alias-state-business-primary));outline-offset:-2px}.PF5DZW_keyToggle:disabled{opacity:.6;cursor:default}.PF5DZW_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}.PF5DZW_error{color:var(--qilin-alias-state-error-primary);margin:0;font-size:12px;line-height:18px}.PF5DZW_deleteDialog{width:min(480px,100%)}.PF5DZW_deleteConfirm:not(:disabled){border-color:var(--qilin-alias-state-error-primary);color:var(--qilin-alias-state-error-primary)}.PF5DZW_deleteConfirm:hover:not(:disabled){background:var(--qilin-alias-interactive-bg-hover-danger)}.PF5DZW_hiddenLabel{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.PF5DZW_customizedSummary:before,.PF5DZW_switchThumb{transition:none}}.PF5DZW_fetchDialog{--qilin-scrollbar-thumb:var(--qilin-alias-scrollbar-bg-l2);--qilin-scrollbar-thumb-hover:var(--qilin-alias-scrollbar-hover-l2);max-width:520px}.PF5DZW_candidateToolbar{align-items:center;gap:8px;margin-bottom:6px;display:flex}.PF5DZW_candidateSearch{flex:240px;min-width:0}.PF5DZW_candidateList{flex-direction:column;gap:2px;max-height:320px;margin:0;padding:0;list-style:none;display:flex;overflow-y:auto}.PF5DZW_candidate{border-radius:6px}.PF5DZW_candidateLabel{cursor:pointer;align-items:center;gap:8px;padding:6px 8px;display:flex}.PF5DZW_candidateId{font-family:var(--ds-font-family-code);overflow-wrap:anywhere;flex:auto;font-size:13px}.PF5DZW_candidateEmpty{color:var(--qilin-alias-label-secondary);text-align:center;margin:24px 0;font-size:13px;line-height:20px}";
|
|
59
59
|
const tagId$2 = "@qilin-agent/client-ui-settings-models/ModelsSection.module.css";
|
|
60
60
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
|
|
61
61
|
const tag = document.createElement("style");
|
|
@@ -96,11 +96,15 @@ window.__ModuleLoader__.load({
|
|
|
96
96
|
"fetchDialog": "PF5DZW_fetchDialog",
|
|
97
97
|
"field": "PF5DZW_field",
|
|
98
98
|
"fieldLabel": "PF5DZW_fieldLabel",
|
|
99
|
+
"helpButton": "PF5DZW_helpButton",
|
|
99
100
|
"hiddenLabel": "PF5DZW_hiddenLabel",
|
|
100
101
|
"iconButton": "PF5DZW_iconButton",
|
|
101
102
|
"iconButtonDanger": "PF5DZW_iconButtonDanger",
|
|
102
103
|
"input": "PF5DZW_input",
|
|
103
104
|
"intro": "PF5DZW_intro",
|
|
105
|
+
"keyInput": "PF5DZW_keyInput",
|
|
106
|
+
"keyInputFilled": "PF5DZW_keyInputFilled",
|
|
107
|
+
"keyToggle": "PF5DZW_keyToggle",
|
|
104
108
|
"linkButton": "PF5DZW_linkButton",
|
|
105
109
|
"modelAdvanced": "PF5DZW_modelAdvanced",
|
|
106
110
|
"modelCatalog": "PF5DZW_modelCatalog",
|
|
@@ -115,6 +119,11 @@ window.__ModuleLoader__.load({
|
|
|
115
119
|
"modelInputTypes": "PF5DZW_modelInputTypes",
|
|
116
120
|
"modelList": "PF5DZW_modelList",
|
|
117
121
|
"modelListHead": "PF5DZW_modelListHead",
|
|
122
|
+
"modelReasoning": "PF5DZW_modelReasoning",
|
|
123
|
+
"modelReasoningHead": "PF5DZW_modelReasoningHead",
|
|
124
|
+
"modelReasoningLabel": "PF5DZW_modelReasoningLabel",
|
|
125
|
+
"modelReasoningRow": "PF5DZW_modelReasoningRow",
|
|
126
|
+
"modelReasoningValueInput": "PF5DZW_modelReasoningValueInput",
|
|
118
127
|
"modelRow": "PF5DZW_modelRow",
|
|
119
128
|
"notice": "PF5DZW_notice",
|
|
120
129
|
"primaryButton": "PF5DZW_primaryButton",
|
|
@@ -134,6 +143,55 @@ window.__ModuleLoader__.load({
|
|
|
134
143
|
"title": "PF5DZW_title"
|
|
135
144
|
};
|
|
136
145
|
//#endregion
|
|
146
|
+
//#region lib/types/client/ApiKeyInput.js
|
|
147
|
+
/** Write-only credential input with the same reveal behavior as masked conversation text. */
|
|
148
|
+
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";
|
|
149
|
+
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`;
|
|
150
|
+
const EYE_OFF_PATH = `${EYE_CONTOUR}M2.5 2.5L13.5 13.5`;
|
|
151
|
+
/**
|
|
152
|
+
* Reveal only a nonempty draft; a different value starts masked, as in SecretText.
|
|
153
|
+
* @param props - current draft, input attributes, and translated control labels.
|
|
154
|
+
* @returns a password input with an optional reveal button.
|
|
155
|
+
*/
|
|
156
|
+
function ApiKeyInput({ value, t, ...props }) {
|
|
157
|
+
const [revealedValue, setRevealedValue] = (0, react.useState)();
|
|
158
|
+
const revealed = value.length > 0 && revealedValue === value;
|
|
159
|
+
return (0, react_jsx_runtime.jsxs)("div", {
|
|
160
|
+
className: ModelsSection_module_css_default["keyInput"],
|
|
161
|
+
children: [(0, react_jsx_runtime.jsx)("input", {
|
|
162
|
+
...props,
|
|
163
|
+
className: `${ModelsSection_module_css_default["input"]} ${value.length > 0 ? ModelsSection_module_css_default["keyInputFilled"] : ""}`,
|
|
164
|
+
type: revealed ? "text" : "password",
|
|
165
|
+
autoComplete: "new-password",
|
|
166
|
+
value,
|
|
167
|
+
onChange: (event) => {
|
|
168
|
+
setRevealedValue(void 0);
|
|
169
|
+
props.onChange?.(event);
|
|
170
|
+
}
|
|
171
|
+
}), value.length === 0 ? null : (0, react_jsx_runtime.jsx)("button", {
|
|
172
|
+
type: "button",
|
|
173
|
+
className: ModelsSection_module_css_default["keyToggle"],
|
|
174
|
+
"aria-label": t(revealed ? "keyHide" : "keyReveal"),
|
|
175
|
+
"aria-pressed": revealed,
|
|
176
|
+
disabled: props.disabled,
|
|
177
|
+
onClick: () => {
|
|
178
|
+
setRevealedValue(revealed ? void 0 : value);
|
|
179
|
+
},
|
|
180
|
+
children: (0, react_jsx_runtime.jsx)("svg", {
|
|
181
|
+
width: "16",
|
|
182
|
+
height: "16",
|
|
183
|
+
viewBox: "0 0 16 16",
|
|
184
|
+
fill: "none",
|
|
185
|
+
stroke: "currentColor",
|
|
186
|
+
strokeWidth: 1.3,
|
|
187
|
+
strokeLinecap: "round",
|
|
188
|
+
"aria-hidden": "true",
|
|
189
|
+
children: (0, react_jsx_runtime.jsx)("path", { d: revealed ? EYE_OFF_PATH : EYE_PATH })
|
|
190
|
+
})
|
|
191
|
+
})]
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
137
195
|
//#region lib/types/client/EditorFooter.js
|
|
138
196
|
/**
|
|
139
197
|
* Render one provider card's action row.
|
|
@@ -198,6 +256,224 @@ window.__ModuleLoader__.load({
|
|
|
198
256
|
});
|
|
199
257
|
}
|
|
200
258
|
//#endregion
|
|
259
|
+
//#region lib/types/client/ModelReasoningEfforts.js
|
|
260
|
+
/** Reasoning-level declarations for a model on a hand-declared pi-ai route. */
|
|
261
|
+
/** Levels a model offers when the switch is turned on, where the schema lists them: Off plus the common OpenAI-compatible trio. */
|
|
262
|
+
const INITIAL_LEVELS = [
|
|
263
|
+
"off",
|
|
264
|
+
"low",
|
|
265
|
+
"medium",
|
|
266
|
+
"high"
|
|
267
|
+
];
|
|
268
|
+
/** The wire value a level sends unless its row says otherwise; `null` is the Off entry that sends nothing. */
|
|
269
|
+
function defaultValue(level) {
|
|
270
|
+
return level === "off" ? null : level;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Whether pi-ai accepts a stored value: a non-empty string, or nothing for Off.
|
|
274
|
+
* @param level - the declared level.
|
|
275
|
+
* @param wire - the value stored for it.
|
|
276
|
+
* @returns whether the adapter would resolve the entry.
|
|
277
|
+
*/
|
|
278
|
+
function acceptedValue(level, wire) {
|
|
279
|
+
return typeof wire === "string" ? wire.length > 0 : wire === null && level === "off";
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Read the declared levels from a row in their stored order, including a key
|
|
283
|
+
* the offered levels do not name, so an edit never drops it.
|
|
284
|
+
* @param model - model row as drafted.
|
|
285
|
+
* @returns the entries; empty for a valueless field, which pi-ai refuses, and
|
|
286
|
+
* `undefined` when the field is absent or `false`.
|
|
287
|
+
*/
|
|
288
|
+
function readEfforts(model) {
|
|
289
|
+
const value = model["reasoningEfforts"];
|
|
290
|
+
if (value === null) return [];
|
|
291
|
+
if (typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
292
|
+
return Object.entries(value);
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Replace a row's declared levels, preserving every other field.
|
|
296
|
+
* @param model - model row as drafted.
|
|
297
|
+
* @param entries - the levels to write in row order, or `undefined` to remove the field.
|
|
298
|
+
* @returns the replacement row.
|
|
299
|
+
*/
|
|
300
|
+
function withEfforts(model, entries) {
|
|
301
|
+
const next = { ...model };
|
|
302
|
+
if (entries === void 0) {
|
|
303
|
+
Reflect.deleteProperty(next, "reasoningEfforts");
|
|
304
|
+
return next;
|
|
305
|
+
}
|
|
306
|
+
next["reasoningEfforts"] = Object.fromEntries(entries);
|
|
307
|
+
return next;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Mirror the pi-ai refusals of a hand-declared `reasoningEfforts`, so a card
|
|
311
|
+
* names the row instead of failing at the write.
|
|
312
|
+
* @param value - drafted `models` value, or `undefined` while inherited.
|
|
313
|
+
* @returns the first refused row, or `undefined` when the adapter will accept every row.
|
|
314
|
+
*/
|
|
315
|
+
function validateReasoningEfforts(value) {
|
|
316
|
+
for (const [index, model] of modelDrafts(value).entries()) {
|
|
317
|
+
const entries = readEfforts(model);
|
|
318
|
+
if (entries === void 0) continue;
|
|
319
|
+
if (entries.some(([level, wire]) => !acceptedValue(level, wire))) return {
|
|
320
|
+
index,
|
|
321
|
+
key: "modelReasoningValueRequired"
|
|
322
|
+
};
|
|
323
|
+
if (!entries.some(([level]) => level !== "off")) return {
|
|
324
|
+
index,
|
|
325
|
+
key: "modelReasoningNeedsLevel"
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Edit the `reasoningEfforts` a hand-declared pi-ai model offers: a switch,
|
|
331
|
+
* then one row per level pairing the level with the value sent for it. Every
|
|
332
|
+
* row is read from the model, so a reused instance shows its new model.
|
|
333
|
+
* @param props - model declaration and row replacement action.
|
|
334
|
+
* @returns the reasoning-level group.
|
|
335
|
+
*/
|
|
336
|
+
function ModelReasoningEfforts({ model, levels, position, disabled, t, onChange }) {
|
|
337
|
+
const entries = readEfforts(model);
|
|
338
|
+
const [typing, setTyping] = (0, react.useState)(void 0);
|
|
339
|
+
const label = `${t("modelReasoning")} ${String(position)}`;
|
|
340
|
+
const used = entries?.map(([level]) => level) ?? [];
|
|
341
|
+
const write = (next) => {
|
|
342
|
+
onChange(withEfforts(model, next));
|
|
343
|
+
};
|
|
344
|
+
const replaceAt = (current, index, entry) => current.map((existing, at) => at === index ? entry : existing);
|
|
345
|
+
const changeLevel = (current, index, from, wire, to) => {
|
|
346
|
+
write(replaceAt(current, index, [to, typeof wire === "string" && wire.length > 0 && wire !== from && from !== "off" && to !== "off" ? wire : defaultValue(to)]));
|
|
347
|
+
};
|
|
348
|
+
const addLevel = (current) => {
|
|
349
|
+
const highest = Math.max(-1, ...used.map((level) => levels.indexOf(level)));
|
|
350
|
+
const level = levels.find((candidate, index) => index > highest && !used.includes(candidate)) ?? levels.find((candidate) => !used.includes(candidate));
|
|
351
|
+
/* v8 ignore next -- the add button is disabled once every level has a row */
|
|
352
|
+
if (level === void 0) return;
|
|
353
|
+
write([...current, [level, defaultValue(level)]]);
|
|
354
|
+
};
|
|
355
|
+
const editValue = (current, index, level, text) => {
|
|
356
|
+
setTyping({
|
|
357
|
+
level,
|
|
358
|
+
text
|
|
359
|
+
});
|
|
360
|
+
const trimmed = text.trim();
|
|
361
|
+
write(replaceAt(current, index, [level, trimmed.length === 0 ? defaultValue(level) : trimmed]));
|
|
362
|
+
};
|
|
363
|
+
const leaveValue = (current, index, level, wire) => {
|
|
364
|
+
setTyping(void 0);
|
|
365
|
+
if (!acceptedValue(level, wire)) write(replaceAt(current, index, [level, defaultValue(level)]));
|
|
366
|
+
};
|
|
367
|
+
const choicesFor = (level) => [...levels.includes(level) ? [] : [level], ...levels.filter((choice) => choice === level || !used.includes(choice))];
|
|
368
|
+
const initialEntries = INITIAL_LEVELS.filter((level) => levels.includes(level)).map((level) => [level, defaultValue(level)]);
|
|
369
|
+
const refused = entries?.some(([level, wire]) => !acceptedValue(level, wire)) === true;
|
|
370
|
+
const missingLevel = entries !== void 0 && !used.some((level) => level !== "off");
|
|
371
|
+
return (0, react_jsx_runtime.jsxs)("div", {
|
|
372
|
+
className: ModelsSection_module_css_default["modelReasoning"],
|
|
373
|
+
role: "group",
|
|
374
|
+
"aria-label": label,
|
|
375
|
+
children: [(0, react_jsx_runtime.jsxs)("div", {
|
|
376
|
+
className: ModelsSection_module_css_default["modelReasoningHead"],
|
|
377
|
+
children: [(0, react_jsx_runtime.jsxs)("span", {
|
|
378
|
+
className: `${ModelsSection_module_css_default["modelFieldLabel"]} ${ModelsSection_module_css_default["modelReasoningLabel"]}`,
|
|
379
|
+
children: [t("modelReasoning"), (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.Tooltip, {
|
|
380
|
+
label: t("modelReasoningHelpText"),
|
|
381
|
+
side: "right",
|
|
382
|
+
delayMs: 0,
|
|
383
|
+
focusDelayMs: 0,
|
|
384
|
+
portal: true,
|
|
385
|
+
openOnClick: true,
|
|
386
|
+
children: (0, react_jsx_runtime.jsx)("button", {
|
|
387
|
+
type: "button",
|
|
388
|
+
className: ModelsSection_module_css_default["helpButton"],
|
|
389
|
+
"aria-label": t("modelReasoningHelp"),
|
|
390
|
+
children: "?"
|
|
391
|
+
})
|
|
392
|
+
})]
|
|
393
|
+
}), (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.Switch, {
|
|
394
|
+
checked: entries !== void 0,
|
|
395
|
+
label,
|
|
396
|
+
disabled,
|
|
397
|
+
onChange: (on) => {
|
|
398
|
+
write(on ? initialEntries : void 0);
|
|
399
|
+
}
|
|
400
|
+
})]
|
|
401
|
+
}), entries === void 0 ? null : (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
402
|
+
entries.length > 0 ? (0, react_jsx_runtime.jsxs)("div", {
|
|
403
|
+
className: ModelsSection_module_css_default["modelReasoningRow"],
|
|
404
|
+
"aria-hidden": "true",
|
|
405
|
+
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
406
|
+
className: ModelsSection_module_css_default["modelFieldLabel"],
|
|
407
|
+
children: t("modelReasoningLevel")
|
|
408
|
+
}), (0, react_jsx_runtime.jsx)("span", {
|
|
409
|
+
className: ModelsSection_module_css_default["modelFieldLabel"],
|
|
410
|
+
children: t("modelReasoningValue")
|
|
411
|
+
})]
|
|
412
|
+
}) : null,
|
|
413
|
+
entries.map(([level, wire], index) => (0, react_jsx_runtime.jsxs)("div", {
|
|
414
|
+
className: ModelsSection_module_css_default["modelReasoningRow"],
|
|
415
|
+
children: [
|
|
416
|
+
(0, react_jsx_runtime.jsx)("select", {
|
|
417
|
+
className: `${ModelsSection_module_css_default["input"]} ${ModelsSection_module_css_default["selectInput"]}`,
|
|
418
|
+
value: level,
|
|
419
|
+
"aria-label": `${t("modelReasoningLevel")} ${String(index + 1)}`,
|
|
420
|
+
disabled,
|
|
421
|
+
onChange: (event) => {
|
|
422
|
+
changeLevel(entries, index, level, wire, event.target.value);
|
|
423
|
+
},
|
|
424
|
+
children: choicesFor(level).map((choice) => (0, react_jsx_runtime.jsx)("option", {
|
|
425
|
+
value: choice,
|
|
426
|
+
children: choice
|
|
427
|
+
}, choice))
|
|
428
|
+
}),
|
|
429
|
+
(0, react_jsx_runtime.jsx)("input", {
|
|
430
|
+
className: `${ModelsSection_module_css_default["input"]} ${ModelsSection_module_css_default["modelReasoningValueInput"]}`,
|
|
431
|
+
type: "text",
|
|
432
|
+
value: typing?.level === level ? typing.text : typeof wire === "string" ? wire : "",
|
|
433
|
+
placeholder: level === "off" ? t("modelReasoningOffValuePlaceholder") : level,
|
|
434
|
+
"aria-label": `${level} ${t("modelReasoningValue")}`,
|
|
435
|
+
"aria-invalid": !acceptedValue(level, wire),
|
|
436
|
+
disabled: disabled || level === "off",
|
|
437
|
+
onChange: (event) => {
|
|
438
|
+
editValue(entries, index, level, event.target.value);
|
|
439
|
+
},
|
|
440
|
+
onBlur: () => {
|
|
441
|
+
leaveValue(entries, index, level, wire);
|
|
442
|
+
}
|
|
443
|
+
}),
|
|
444
|
+
(0, react_jsx_runtime.jsx)("button", {
|
|
445
|
+
type: "button",
|
|
446
|
+
className: `${ModelsSection_module_css_default["iconButton"]} ${ModelsSection_module_css_default["iconButtonDanger"]}`,
|
|
447
|
+
"aria-label": `${t("modelReasoningRemove")} ${level}`,
|
|
448
|
+
title: t("modelReasoningRemove"),
|
|
449
|
+
disabled,
|
|
450
|
+
onClick: () => {
|
|
451
|
+
write(entries.filter((_entry, at) => at !== index));
|
|
452
|
+
},
|
|
453
|
+
children: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconTrashOutlineRegular, { size: 14 })
|
|
454
|
+
})
|
|
455
|
+
]
|
|
456
|
+
}, index)),
|
|
457
|
+
refused ? (0, react_jsx_runtime.jsx)("p", {
|
|
458
|
+
className: ModelsSection_module_css_default["error"],
|
|
459
|
+
children: t("modelReasoningValueRequired")
|
|
460
|
+
}) : missingLevel ? (0, react_jsx_runtime.jsx)("p", {
|
|
461
|
+
className: ModelsSection_module_css_default["error"],
|
|
462
|
+
children: t("modelReasoningNeedsLevel")
|
|
463
|
+
}) : null,
|
|
464
|
+
(0, react_jsx_runtime.jsxs)("button", {
|
|
465
|
+
type: "button",
|
|
466
|
+
className: ModelsSection_module_css_default["addModelButton"],
|
|
467
|
+
disabled: disabled || levels.every((level) => used.includes(level)),
|
|
468
|
+
onClick: () => {
|
|
469
|
+
addLevel(entries);
|
|
470
|
+
},
|
|
471
|
+
children: [(0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconPlusOutlineRegular, { size: 14 }), t("modelReasoningAdd")]
|
|
472
|
+
})
|
|
473
|
+
] })]
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
//#endregion
|
|
201
477
|
//#region lib/types/client/ModelRow.js
|
|
202
478
|
/**
|
|
203
479
|
* Render consistent model identity, capacity, and input-type controls.
|
|
@@ -245,33 +521,44 @@ window.__ModuleLoader__.load({
|
|
|
245
521
|
]
|
|
246
522
|
}), props.expanded ? (0, react_jsx_runtime.jsxs)("div", {
|
|
247
523
|
className: ModelsSection_module_css_default["modelAdvanced"],
|
|
248
|
-
children: [
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
524
|
+
children: [
|
|
525
|
+
["contextWindow", "maxTokens"].map((field) => (0, react_jsx_runtime.jsxs)("label", {
|
|
526
|
+
className: ModelsSection_module_css_default["modelField"],
|
|
527
|
+
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
528
|
+
className: ModelsSection_module_css_default["modelFieldLabel"],
|
|
529
|
+
children: t(field)
|
|
530
|
+
}), (0, react_jsx_runtime.jsx)("input", {
|
|
531
|
+
className: ModelsSection_module_css_default["input"],
|
|
532
|
+
type: "text",
|
|
533
|
+
inputMode: "numeric",
|
|
534
|
+
value: props[field].value,
|
|
535
|
+
placeholder: props[field].placeholder,
|
|
536
|
+
"aria-label": `${t(field)} ${String(position)}`,
|
|
537
|
+
disabled,
|
|
538
|
+
onChange: (event) => {
|
|
539
|
+
props[field].onChange(event.target.value);
|
|
540
|
+
},
|
|
541
|
+
onBlur: props[field].onBlur
|
|
542
|
+
})]
|
|
543
|
+
}, field)),
|
|
544
|
+
(0, react_jsx_runtime.jsx)(ModelInputTypes, {
|
|
545
|
+
model,
|
|
546
|
+
field: props.inputField,
|
|
547
|
+
position,
|
|
548
|
+
fallback: props.inputFallback,
|
|
549
|
+
disabled: disabled || props.inputLoading === true,
|
|
550
|
+
t,
|
|
551
|
+
onChange: props.onChange
|
|
552
|
+
}),
|
|
553
|
+
props.reasoningLevels !== void 0 && props.reasoningLevels.length > 0 ? (0, react_jsx_runtime.jsx)(ModelReasoningEfforts, {
|
|
554
|
+
model,
|
|
555
|
+
levels: props.reasoningLevels,
|
|
556
|
+
position,
|
|
260
557
|
disabled,
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
})]
|
|
266
|
-
}, field)), (0, react_jsx_runtime.jsx)(ModelInputTypes, {
|
|
267
|
-
model,
|
|
268
|
-
field: props.inputField,
|
|
269
|
-
position,
|
|
270
|
-
fallback: props.inputFallback,
|
|
271
|
-
disabled: disabled || props.inputLoading === true,
|
|
272
|
-
t,
|
|
273
|
-
onChange: props.onChange
|
|
274
|
-
})]
|
|
558
|
+
t,
|
|
559
|
+
onChange: props.onChange
|
|
560
|
+
}) : null
|
|
561
|
+
]
|
|
275
562
|
}) : null]
|
|
276
563
|
});
|
|
277
564
|
}
|
|
@@ -765,6 +1052,7 @@ window.__ModuleLoader__.load({
|
|
|
765
1052
|
inputField: "input",
|
|
766
1053
|
inputFallback: inputDefaults.get(textOf(model, "id")) ?? props.defaultInput,
|
|
767
1054
|
inputLoading: catalogProvider !== void 0 && catalog === void 0,
|
|
1055
|
+
reasoningLevels: props.reasoningLevels,
|
|
768
1056
|
expanded: expanded.has(index),
|
|
769
1057
|
disabled,
|
|
770
1058
|
t,
|
|
@@ -908,6 +1196,9 @@ window.__ModuleLoader__.load({
|
|
|
908
1196
|
settingsPath: [...entry.settingsPath],
|
|
909
1197
|
active: active.has(entry.provider),
|
|
910
1198
|
...entry.declared === void 0 ? {} : { declared: entry.declared },
|
|
1199
|
+
...entry.defaultBaseURL === void 0 ? {} : { defaultBaseURL: entry.defaultBaseURL },
|
|
1200
|
+
...entry.baseURLEnv === void 0 ? {} : { baseURLEnv: entry.baseURLEnv },
|
|
1201
|
+
...entry.nativeAuth === void 0 ? {} : { nativeAuth: entry.nativeAuth },
|
|
911
1202
|
...entry.error === void 0 ? {} : { error: entry.error }
|
|
912
1203
|
}));
|
|
913
1204
|
for (const provider of registered) {
|
|
@@ -951,6 +1242,26 @@ window.__ModuleLoader__.load({
|
|
|
951
1242
|
if (list?.type !== "union" || list.list === void 0) return [];
|
|
952
1243
|
return list.list.map((entry) => entry.value).filter((value) => typeof value === "string");
|
|
953
1244
|
}
|
|
1245
|
+
/**
|
|
1246
|
+
* The reasoning levels a hand-declared route's models may declare, read out of
|
|
1247
|
+
* the owning namespace's own schema for the same reason as
|
|
1248
|
+
* {@link protocolChoices}: the levels the page offers and the keys the
|
|
1249
|
+
* adapter accepts in `reasoningEfforts` come from the same `Config`.
|
|
1250
|
+
* @param namespace - the namespace view whose schema declares the profile shape.
|
|
1251
|
+
* @param schema - settings schema operations.
|
|
1252
|
+
* @returns the levels in the schema's escalation order, or an empty list when the schema has none.
|
|
1253
|
+
*/
|
|
1254
|
+
function reasoningLevelChoices(namespace, schema) {
|
|
1255
|
+
if (namespace === void 0) return [];
|
|
1256
|
+
const path = [
|
|
1257
|
+
"providers",
|
|
1258
|
+
PROBE_ROUTE,
|
|
1259
|
+
"models",
|
|
1260
|
+
"0",
|
|
1261
|
+
"reasoningEfforts"
|
|
1262
|
+
];
|
|
1263
|
+
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");
|
|
1264
|
+
}
|
|
954
1265
|
/** The credential reference a resolved profile names (its `apiKeyEnv` field). */
|
|
955
1266
|
function apiKeyEnvOf(namespace, path, schema) {
|
|
956
1267
|
if (namespace === void 0) return void 0;
|
|
@@ -975,6 +1286,8 @@ window.__ModuleLoader__.load({
|
|
|
975
1286
|
});
|
|
976
1287
|
/** Latest load wins; an older response never overwrites a newer one. */
|
|
977
1288
|
generation = 0;
|
|
1289
|
+
/** Callers follow the current refresh's outcome, including callers whose read was superseded. */
|
|
1290
|
+
pendingLoads = /* @__PURE__ */ new Set();
|
|
978
1291
|
/**
|
|
979
1292
|
* @param ctx - the page plugin's context, whose `remote.llm` and
|
|
980
1293
|
* `remote.credentials` namespaces carry the directory and credential reads.
|
|
@@ -991,11 +1304,28 @@ window.__ModuleLoader__.load({
|
|
|
991
1304
|
* settings answer in parallel, then one batched credential describe over
|
|
992
1305
|
* every referenced ref. Provider failure or absence of an initial settings
|
|
993
1306
|
* answer keeps the last good rows and surfaces an error; a failed settings
|
|
994
|
-
* refresh reuses the mirror's held view.
|
|
995
|
-
*
|
|
1307
|
+
* refresh reuses the mirror's held view. Concurrent callers resolve only
|
|
1308
|
+
* after the current refresh publishes its ready or error snapshot.
|
|
1309
|
+
* @returns resolution after the current snapshot is published.
|
|
1310
|
+
* @throws the current read's unexpected rejection; superseded rejections are ignored.
|
|
996
1311
|
*/
|
|
997
|
-
|
|
1312
|
+
load() {
|
|
1313
|
+
const pending = Promise.withResolvers();
|
|
1314
|
+
this.pendingLoads.add(pending);
|
|
998
1315
|
const generation = ++this.generation;
|
|
1316
|
+
this.read(generation).then(() => {
|
|
1317
|
+
this.settleLoads(generation, (load) => {
|
|
1318
|
+
load.resolve();
|
|
1319
|
+
});
|
|
1320
|
+
}, (error) => {
|
|
1321
|
+
this.settleLoads(generation, (load) => {
|
|
1322
|
+
load.reject(error);
|
|
1323
|
+
});
|
|
1324
|
+
});
|
|
1325
|
+
return pending.promise;
|
|
1326
|
+
}
|
|
1327
|
+
/** Publish one joined answer; stale answers leave the current refresh in charge. */
|
|
1328
|
+
async read(generation) {
|
|
999
1329
|
this.store.update((s) => {
|
|
1000
1330
|
s.status = "loading";
|
|
1001
1331
|
s.error = null;
|
|
@@ -1005,17 +1335,18 @@ window.__ModuleLoader__.load({
|
|
|
1005
1335
|
this.ctx.remote.llm.listConfigurableProviders(),
|
|
1006
1336
|
this.describeFace.ensure()
|
|
1007
1337
|
]);
|
|
1338
|
+
if (generation !== this.generation) return;
|
|
1008
1339
|
if (!registered.ok) {
|
|
1009
|
-
this.failLoad(
|
|
1340
|
+
this.failLoad(registered.error.message);
|
|
1010
1341
|
return;
|
|
1011
1342
|
}
|
|
1012
1343
|
if (!declared.ok) {
|
|
1013
|
-
this.failLoad(
|
|
1344
|
+
this.failLoad(declared.error.message);
|
|
1014
1345
|
return;
|
|
1015
1346
|
}
|
|
1016
1347
|
const mirrored = this.describeFace.getSnapshot();
|
|
1017
1348
|
if (mirrored.view === void 0) {
|
|
1018
|
-
this.failLoad(
|
|
1349
|
+
this.failLoad(mirrored.error ?? "settings are unavailable in this browser");
|
|
1019
1350
|
return;
|
|
1020
1351
|
}
|
|
1021
1352
|
const providers = joinProviderDirectory(registered.value, declared.value);
|
|
@@ -1032,14 +1363,20 @@ window.__ModuleLoader__.load({
|
|
|
1032
1363
|
credential: void 0
|
|
1033
1364
|
};
|
|
1034
1365
|
});
|
|
1035
|
-
const refs = [...new Set(rows.
|
|
1036
|
-
|
|
1366
|
+
const refs = [...new Set(rows.flatMap((row) => row.apiKeyEnv === void 0 ? [deriveKeyRef(row.entry.provider), ...row.entry.nativeAuth?.env ?? []] : [row.apiKeyEnv]))];
|
|
1367
|
+
const credentials = {};
|
|
1037
1368
|
let credentialError = null;
|
|
1038
|
-
|
|
1039
|
-
const response = await this.ctx.remote.credentials.describe(refs);
|
|
1040
|
-
if (response.ok) credentials
|
|
1041
|
-
else
|
|
1369
|
+
for (let index = 0; index < refs.length; index += 64) {
|
|
1370
|
+
const response = await this.ctx.remote.credentials.describe(refs.slice(index, index + 64));
|
|
1371
|
+
if (response.ok) Object.assign(credentials, response.value);
|
|
1372
|
+
else {
|
|
1373
|
+
credentialError = response.error.message;
|
|
1374
|
+
break;
|
|
1375
|
+
}
|
|
1042
1376
|
}
|
|
1377
|
+
/* v8 ignore next -- the credential describe answers in one promise, so a read
|
|
1378
|
+
* superseded at the earlier generation check never reaches this second guard;
|
|
1379
|
+
* it stays for a future multi-batch describe where supersede windows reopen. */
|
|
1043
1380
|
if (generation !== this.generation) return;
|
|
1044
1381
|
this.store.update((s) => {
|
|
1045
1382
|
s.status = "ready";
|
|
@@ -1052,15 +1389,25 @@ window.__ModuleLoader__.load({
|
|
|
1052
1389
|
return {
|
|
1053
1390
|
...row,
|
|
1054
1391
|
...named === void 0 ? {} : { credential: named },
|
|
1055
|
-
...derived === void 0 ? {} : { derivedCredential: derived }
|
|
1392
|
+
...derived === void 0 ? {} : { derivedCredential: derived },
|
|
1393
|
+
...credentialError === null ? { credentialChecks: Object.fromEntries((row.apiKeyEnv === void 0 ? row.entry.nativeAuth?.env ?? [] : [row.apiKeyEnv]).flatMap((ref) => {
|
|
1394
|
+
const info = credentials[ref];
|
|
1395
|
+
return info === void 0 ? [] : [[ref, info]];
|
|
1396
|
+
})) } : {}
|
|
1056
1397
|
};
|
|
1057
1398
|
});
|
|
1058
1399
|
s.namespaces = namespaces;
|
|
1059
1400
|
});
|
|
1060
1401
|
}
|
|
1061
|
-
/**
|
|
1062
|
-
|
|
1402
|
+
/** Settle callers only while this read still owns the current refresh. */
|
|
1403
|
+
settleLoads(generation, settle) {
|
|
1063
1404
|
if (generation !== this.generation) return;
|
|
1405
|
+
const pending = [...this.pendingLoads];
|
|
1406
|
+
this.pendingLoads.clear();
|
|
1407
|
+
for (const load of pending) settle(load);
|
|
1408
|
+
}
|
|
1409
|
+
/** Publish one load's failure text; the caller checked the current generation. */
|
|
1410
|
+
failLoad(message) {
|
|
1064
1411
|
this.store.update((s) => {
|
|
1065
1412
|
s.status = "error";
|
|
1066
1413
|
s.error = message;
|
|
@@ -1162,11 +1509,12 @@ window.__ModuleLoader__.load({
|
|
|
1162
1509
|
* and at least one model — are required here rather than at load, so the
|
|
1163
1510
|
* failure names the field while the user is still looking at it.
|
|
1164
1511
|
*
|
|
1165
|
-
* There is deliberately no reasoning-effort control, here or
|
|
1166
|
-
* card: effort is a per-MODEL capability, and the models under
|
|
1167
|
-
* disagree about it, so a provider-scoped control can only be set
|
|
1168
|
-
* some of them reject.
|
|
1169
|
-
*
|
|
1512
|
+
* There is deliberately no provider-scoped reasoning-effort control, here or
|
|
1513
|
+
* on the editor card: effort is a per-MODEL capability, and the models under
|
|
1514
|
+
* one provider disagree about it, so a provider-scoped control can only be set
|
|
1515
|
+
* to a value some of them reject. Each model row of a hand-declared route
|
|
1516
|
+
* declares its own `reasoningEfforts` instead, and the composer's model picker
|
|
1517
|
+
* offers each model those levels.
|
|
1170
1518
|
*/
|
|
1171
1519
|
/** The settings namespace a hand-declared provider is written into. */
|
|
1172
1520
|
const NS$1 = "llm-pi-ai";
|
|
@@ -1193,7 +1541,7 @@ window.__ModuleLoader__.load({
|
|
|
1193
1541
|
* @returns the creation card.
|
|
1194
1542
|
*/
|
|
1195
1543
|
function CustomProviderCard(props) {
|
|
1196
|
-
const { taken, protocols, operations, t } = props;
|
|
1544
|
+
const { taken, protocols, reasoningLevels, operations, t } = props;
|
|
1197
1545
|
const [openedAt] = (0, react.useState)(() => props.revision);
|
|
1198
1546
|
const [route, setRoute] = (0, react.useState)("");
|
|
1199
1547
|
const [displayName, setDisplayName] = (0, react.useState)("");
|
|
@@ -1216,7 +1564,7 @@ window.__ModuleLoader__.load({
|
|
|
1216
1564
|
const routeTaken = taken.includes(route);
|
|
1217
1565
|
const normalizedBaseURL = baseURL.trim();
|
|
1218
1566
|
const baseUrlInvalid = baseURL.length > 0 && !isHttpUrl(normalizedBaseURL);
|
|
1219
|
-
const modelFailure = validateDeepSeekModels(models);
|
|
1567
|
+
const modelFailure = validateDeepSeekModels(models) ?? validateReasoningEfforts(models);
|
|
1220
1568
|
const keyFailure = apiKeyFailure(keyDraft);
|
|
1221
1569
|
const keyValue = keyDraft.trim();
|
|
1222
1570
|
const ready = route.length > 0 && !routeInvalid && !routeTaken && normalizedBaseURL.length > 0 && !baseUrlInvalid && models.length > 0 && modelFailure === void 0 && keyFailure === void 0;
|
|
@@ -1359,10 +1707,8 @@ window.__ModuleLoader__.load({
|
|
|
1359
1707
|
className: ModelsSection_module_css_default["fieldLabel"],
|
|
1360
1708
|
children: t("keyInput")
|
|
1361
1709
|
}),
|
|
1362
|
-
(0, react_jsx_runtime.jsx)(
|
|
1363
|
-
|
|
1364
|
-
type: "password",
|
|
1365
|
-
autoComplete: "off",
|
|
1710
|
+
(0, react_jsx_runtime.jsx)(ApiKeyInput, {
|
|
1711
|
+
t,
|
|
1366
1712
|
value: keyDraft,
|
|
1367
1713
|
placeholder: t("keyPlaceholder"),
|
|
1368
1714
|
"aria-label": t("keyInput"),
|
|
@@ -1380,6 +1726,7 @@ window.__ModuleLoader__.load({
|
|
|
1380
1726
|
(0, react_jsx_runtime.jsx)(ModelListEditor, {
|
|
1381
1727
|
models,
|
|
1382
1728
|
onChange: setModels,
|
|
1729
|
+
reasoningLevels,
|
|
1383
1730
|
probe: {
|
|
1384
1731
|
settingsNs: NS$1,
|
|
1385
1732
|
baseURL: normalizedBaseURL,
|
|
@@ -1430,11 +1777,12 @@ window.__ModuleLoader__.load({
|
|
|
1430
1777
|
* display name and wire protocol of a pi-ai route the adapter does not ship —
|
|
1431
1778
|
* the two fields the create card asked that route for, editable here for the
|
|
1432
1779
|
* same reason).
|
|
1433
|
-
*
|
|
1434
|
-
* the
|
|
1435
|
-
*
|
|
1436
|
-
*
|
|
1437
|
-
*
|
|
1780
|
+
* There is deliberately no provider-scoped reasoning-effort control, here or
|
|
1781
|
+
* on the editor card: effort is a per-MODEL capability, and the models under
|
|
1782
|
+
* one provider disagree about it, so a provider-scoped control can only be set
|
|
1783
|
+
* to a value some of them reject. Each model row of a hand-declared route
|
|
1784
|
+
* declares its own `reasoningEfforts` instead, and the composer's model picker
|
|
1785
|
+
* offers each model those levels. Everything else stays
|
|
1438
1786
|
* owned by `settings.yaml`. Profile edits land as minimal `settings.mutate`
|
|
1439
1787
|
* path ops against the stored section — the card names only the fields it can
|
|
1440
1788
|
* see instead of rebuilding the whole subtree from a partial descriptor.
|
|
@@ -1532,7 +1880,15 @@ window.__ModuleLoader__.load({
|
|
|
1532
1880
|
const value = next === void 0 || next.trim().length === 0 ? void 0 : next;
|
|
1533
1881
|
setDraft((current) => value === void 0 ? schema.deletePath(current, [key]) : schema.setPath(current, [key], value));
|
|
1534
1882
|
};
|
|
1535
|
-
const
|
|
1883
|
+
const reasoningLevels = (0, react.useMemo)(() => layout === "pi-ai" && props.declared === true ? reasoningLevelChoices(namespace, schema) : [], [
|
|
1884
|
+
layout,
|
|
1885
|
+
props.declared,
|
|
1886
|
+
namespace,
|
|
1887
|
+
schema
|
|
1888
|
+
]);
|
|
1889
|
+
const editsReasoning = reasoningLevels.length > 0;
|
|
1890
|
+
const validateModels = (value) => validateDeepSeekModels(value) ?? (editsReasoning ? validateReasoningEfforts(value) : void 0);
|
|
1891
|
+
const modelFailure = validateModels(schema.getPath(draft, ["models"]));
|
|
1536
1892
|
const keyFailure = apiKeyFailure(keyDraft);
|
|
1537
1893
|
const keyValue = keyDraft.trim();
|
|
1538
1894
|
const shownKeyFailure = (props.credentialRequired === true && keyDraft.length > 0 && keyValue.length === 0 ? "keyRequired" : void 0) ?? keyFailure;
|
|
@@ -1555,7 +1911,7 @@ window.__ModuleLoader__.load({
|
|
|
1555
1911
|
const ns = namespace.ns;
|
|
1556
1912
|
const next = layout === "pi-ai" && stringAt(draft, "apiKeyEnv") === void 0 && stringAt(fallback, "apiKeyEnv") === void 0 && keyValue.length > 0 ? schema.setPath(draft, ["apiKeyEnv"], keyRef) : draft;
|
|
1557
1913
|
if (props.credentialOnly !== true) {
|
|
1558
|
-
const failure =
|
|
1914
|
+
const failure = validateModels(schema.getPath(next, ["models"]));
|
|
1559
1915
|
/* v8 ignore next 3 -- unreachable from the card: the same failure disables submit */
|
|
1560
1916
|
if (failure !== void 0) return `${t("model")} ${String(failure.index + 1)}: ${t(failure.key)}`;
|
|
1561
1917
|
}
|
|
@@ -1629,7 +1985,22 @@ window.__ModuleLoader__.load({
|
|
|
1629
1985
|
const defaultContextWindow = schema.getPath(fallback, ["defaultContextWindow"]);
|
|
1630
1986
|
const defaultMaxTokens = schema.getPath(fallback, ["maxTokens"]);
|
|
1631
1987
|
const defaultInput = schema.getPath(fallback, ["defaultInput"]);
|
|
1632
|
-
const
|
|
1988
|
+
const namedRef = stringAt(fallback, "apiKeyEnv");
|
|
1989
|
+
const nativeAuth = namedRef === void 0 ? props.nativeAuth : void 0;
|
|
1990
|
+
const endpointEnv = props.baseURLEnv ?? [];
|
|
1991
|
+
const baseURL = stringAt(fallback, "baseURL");
|
|
1992
|
+
const endpointHint = family === "deepseek" ? t("deepSeekEndpointHint") : baseURL === void 0 && endpointEnv.length > 0 ? t("baseUrlEnvironment").replace("{env}", () => endpointEnv.join(", ")) : void 0;
|
|
1993
|
+
const authRefs = namedRef === void 0 ? (nativeAuth?.env ?? []).filter((ref) => !endpointEnv.includes(ref)) : [namedRef];
|
|
1994
|
+
const visibleRefs = authRefs.filter((ref) => !ref.toLowerCase().includes("oauth"));
|
|
1995
|
+
const keyHint = visibleRefs[0];
|
|
1996
|
+
const checkedRefs = authRefs.map((ref) => [ref, props.credentialChecks?.[ref] ?? (ref === keyRef ? keyState : void 0)]);
|
|
1997
|
+
const detected = checkedRefs.find(([, info]) => info?.configured === true);
|
|
1998
|
+
const detectedRef = detected?.[0];
|
|
1999
|
+
const detectedVisibleRef = detectedRef === void 0 || !visibleRefs.includes(detectedRef) ? void 0 : detectedRef;
|
|
2000
|
+
const missingRefs = checkedRefs.length > 0 && checkedRefs.every(([, info]) => info?.configured === false);
|
|
2001
|
+
const savedCredential = detected?.[1]?.source === "file";
|
|
2002
|
+
const credentialHint = keyDraft.length > 0 || savedCredential || keyHint === void 0 || props.credentialRequired === true || keyLocked ? void 0 : t(detectedRef === void 0 ? missingRefs ? "keyFallbackMissing" : "keyFallbackUnchecked" : detectedVisibleRef === void 0 ? "keyFallbackDetectedHidden" : "keyFallbackDetected").replace("{hint}", () => detectedVisibleRef ?? keyHint);
|
|
2003
|
+
const keyPlaceholder = keyLocked ? t("keyEnvLocked") : keyState?.configured === true && props.credentialRequired !== true ? t("keyStored") : savedCredential ? t("keyPlaceholderSaved") : family === "pi-ai" && keyHint !== void 0 && props.credentialRequired !== true ? t("keyPlaceholderNative") : t("keyPlaceholder");
|
|
1633
2004
|
/** What both family editors take: the rows, whose layer owns them, and the two writes. */
|
|
1634
2005
|
const catalogProps = {
|
|
1635
2006
|
models,
|
|
@@ -1650,14 +2021,13 @@ window.__ModuleLoader__.load({
|
|
|
1650
2021
|
className: ModelsSection_module_css_default["fieldLabel"],
|
|
1651
2022
|
children: t("keyInput")
|
|
1652
2023
|
}),
|
|
1653
|
-
(0, react_jsx_runtime.jsx)(
|
|
1654
|
-
|
|
1655
|
-
type: "password",
|
|
1656
|
-
autoComplete: "off",
|
|
2024
|
+
(0, react_jsx_runtime.jsx)(ApiKeyInput, {
|
|
2025
|
+
t,
|
|
1657
2026
|
value: keyDraft,
|
|
1658
2027
|
placeholder: keyPlaceholder,
|
|
1659
2028
|
"aria-label": t("keyInput"),
|
|
1660
2029
|
"aria-invalid": shownKeyFailure !== void 0,
|
|
2030
|
+
"aria-describedby": credentialHint === void 0 ? void 0 : `${props.provider}-credential-hint`,
|
|
1661
2031
|
required: props.credentialRequired === true,
|
|
1662
2032
|
autoFocus: props.autoFocusCredential === true,
|
|
1663
2033
|
disabled: disabled || keyLocked,
|
|
@@ -1665,6 +2035,11 @@ window.__ModuleLoader__.load({
|
|
|
1665
2035
|
setKeyDraft(event.target.value);
|
|
1666
2036
|
}
|
|
1667
2037
|
}),
|
|
2038
|
+
credentialHint === void 0 ? null : (0, react_jsx_runtime.jsx)("p", {
|
|
2039
|
+
id: `${props.provider}-credential-hint`,
|
|
2040
|
+
className: ModelsSection_module_css_default[missingRefs ? "notice" : detectedRef === void 0 ? "advancedHint" : "savedNotice"],
|
|
2041
|
+
children: credentialHint
|
|
2042
|
+
}),
|
|
1668
2043
|
shownKeyFailure === void 0 ? null : (0, react_jsx_runtime.jsx)("p", {
|
|
1669
2044
|
className: ModelsSection_module_css_default["error"],
|
|
1670
2045
|
children: t(shownKeyFailure)
|
|
@@ -1706,19 +2081,19 @@ window.__ModuleLoader__.load({
|
|
|
1706
2081
|
className: ModelsSection_module_css_default["input"],
|
|
1707
2082
|
type: "text",
|
|
1708
2083
|
value: stringAt(draft, "baseURL") ?? "",
|
|
1709
|
-
placeholder: family === "deepseek" ? t("deepSeekBaseUrl") :
|
|
1710
|
-
"aria-describedby":
|
|
2084
|
+
placeholder: family === "deepseek" ? t("deepSeekBaseUrl") : baseURL === void 0 ? t(endpointEnv.length > 0 ? "baseUrlConfigured" : "baseUrlDefault") : baseURL,
|
|
2085
|
+
"aria-describedby": endpointHint === void 0 ? void 0 : `${props.provider}-endpoint-hint`,
|
|
1711
2086
|
"aria-label": t("baseUrl"),
|
|
1712
2087
|
disabled,
|
|
1713
2088
|
onChange: (event) => {
|
|
1714
2089
|
setField("baseURL", event.target.value === "" ? void 0 : event.target.value);
|
|
1715
2090
|
}
|
|
1716
2091
|
}),
|
|
1717
|
-
|
|
2092
|
+
endpointHint === void 0 ? null : (0, react_jsx_runtime.jsx)("span", {
|
|
1718
2093
|
id: `${props.provider}-endpoint-hint`,
|
|
1719
2094
|
className: ModelsSection_module_css_default["advancedHint"],
|
|
1720
|
-
children:
|
|
1721
|
-
})
|
|
2095
|
+
children: endpointHint
|
|
2096
|
+
})
|
|
1722
2097
|
]
|
|
1723
2098
|
}),
|
|
1724
2099
|
ownsIdentity ? (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -1750,6 +2125,7 @@ window.__ModuleLoader__.load({
|
|
|
1750
2125
|
}) : (0, react_jsx_runtime.jsx)(ModelListEditor, {
|
|
1751
2126
|
...catalogProps,
|
|
1752
2127
|
catalogProvider: props.declared === true ? void 0 : props.provider,
|
|
2128
|
+
reasoningLevels,
|
|
1753
2129
|
defaultInput: Array.isArray(defaultInput) ? defaultInput : void 0,
|
|
1754
2130
|
probe,
|
|
1755
2131
|
probeBlocked: keyFailure,
|
|
@@ -1817,12 +2193,15 @@ window.__ModuleLoader__.load({
|
|
|
1817
2193
|
* re-renders from pushed invalidations or the post-apply reload.
|
|
1818
2194
|
*/
|
|
1819
2195
|
/** Render an editor for either the setup posture or an expanded provider row. */
|
|
1820
|
-
function renderProviderEditor({ target, ...props }) {
|
|
2196
|
+
function renderProviderEditor({ target, row, ...props }) {
|
|
1821
2197
|
return (0, react_jsx_runtime.jsx)(ProviderEditor, {
|
|
1822
2198
|
provider: target.provider,
|
|
1823
2199
|
displayName: target.displayName,
|
|
1824
2200
|
settingsPath: target.settingsPath,
|
|
1825
2201
|
...target.declared === true ? { declared: true } : {},
|
|
2202
|
+
...target.baseURLEnv === void 0 ? {} : { baseURLEnv: target.baseURLEnv },
|
|
2203
|
+
...target.nativeAuth === void 0 ? {} : { nativeAuth: target.nativeAuth },
|
|
2204
|
+
...row.credentialChecks === void 0 ? {} : { credentialChecks: row.credentialChecks },
|
|
1826
2205
|
...props
|
|
1827
2206
|
});
|
|
1828
2207
|
}
|
|
@@ -1882,7 +2261,9 @@ window.__ModuleLoader__.load({
|
|
|
1882
2261
|
settingsNs: row.entry.settingsNs,
|
|
1883
2262
|
settingsPath: row.entry.settingsPath,
|
|
1884
2263
|
...credentialRef === void 0 ? {} : { credentialRef },
|
|
1885
|
-
...row.entry.declared === true ? { declared: true } : {}
|
|
2264
|
+
...row.entry.declared === true ? { declared: true } : {},
|
|
2265
|
+
...row.entry.baseURLEnv === void 0 ? {} : { baseURLEnv: row.entry.baseURLEnv },
|
|
2266
|
+
...row.entry.nativeAuth === void 0 ? {} : { nativeAuth: row.entry.nativeAuth }
|
|
1886
2267
|
};
|
|
1887
2268
|
}
|
|
1888
2269
|
/** Stable visible and accessible identity for one provider target. */
|
|
@@ -2011,6 +2392,7 @@ window.__ModuleLoader__.load({
|
|
|
2011
2392
|
const addNamespace = addTarget === void 0 ? void 0 : state.namespaces.get(addTarget.settingsNs);
|
|
2012
2393
|
const addRow = addTarget === void 0 ? void 0 : state.rows.find((row) => row.entry.provider === addTarget.provider);
|
|
2013
2394
|
const protocols = protocolChoices(state.namespaces.get("llm-pi-ai"), schema);
|
|
2395
|
+
const reasoningLevels = reasoningLevelChoices(state.namespaces.get("llm-pi-ai"), schema);
|
|
2014
2396
|
return (0, react_jsx_runtime.jsxs)("div", {
|
|
2015
2397
|
className: ModelsSection_module_css_default["section"],
|
|
2016
2398
|
children: [
|
|
@@ -2050,6 +2432,7 @@ window.__ModuleLoader__.load({
|
|
|
2050
2432
|
error,
|
|
2051
2433
|
renderProviderEditor({
|
|
2052
2434
|
target,
|
|
2435
|
+
row,
|
|
2053
2436
|
namespace,
|
|
2054
2437
|
schema,
|
|
2055
2438
|
operations,
|
|
@@ -2135,6 +2518,7 @@ window.__ModuleLoader__.load({
|
|
|
2135
2518
|
}, { entryKey: row.entry.settingsNs }),
|
|
2136
2519
|
open ? renderProviderEditor({
|
|
2137
2520
|
target,
|
|
2521
|
+
row,
|
|
2138
2522
|
namespace,
|
|
2139
2523
|
schema,
|
|
2140
2524
|
operations,
|
|
@@ -2181,6 +2565,9 @@ window.__ModuleLoader__.load({
|
|
|
2181
2565
|
namespace: addNamespace,
|
|
2182
2566
|
schema,
|
|
2183
2567
|
settingsPath: addTarget.settingsPath,
|
|
2568
|
+
...addTarget.baseURLEnv === void 0 ? {} : { baseURLEnv: addTarget.baseURLEnv },
|
|
2569
|
+
...addTarget.nativeAuth === void 0 ? {} : { nativeAuth: addTarget.nativeAuth },
|
|
2570
|
+
...addRow?.credentialChecks === void 0 ? {} : { credentialChecks: addRow.credentialChecks },
|
|
2184
2571
|
operations,
|
|
2185
2572
|
t,
|
|
2186
2573
|
readOnly: !state.writable,
|
|
@@ -2199,6 +2586,7 @@ window.__ModuleLoader__.load({
|
|
|
2199
2586
|
children: (0, react_jsx_runtime.jsx)(CustomProviderCard, {
|
|
2200
2587
|
taken: state.rows.map((row) => row.entry.provider),
|
|
2201
2588
|
protocols,
|
|
2589
|
+
reasoningLevels,
|
|
2202
2590
|
/* v8 ignore next -- the card only opens from a button disabled without this namespace */
|
|
2203
2591
|
revision: state.namespaces.get("llm-pi-ai")?.revision ?? 0,
|
|
2204
2592
|
operations,
|
|
@@ -2529,13 +2917,22 @@ window.__ModuleLoader__.load({
|
|
|
2529
2917
|
conflict: "Someone else changed these settings while this card was open. Close it and reopen to edit the current values.",
|
|
2530
2918
|
retry: "Retry",
|
|
2531
2919
|
keyInput: "API key",
|
|
2920
|
+
keyReveal: "Show secret",
|
|
2921
|
+
keyHide: "Hide secret",
|
|
2532
2922
|
keyPlaceholder: "Enter your API key",
|
|
2533
2923
|
keyPlaceholderNative: "Enter an API key, or leave blank to use environment authentication",
|
|
2534
2924
|
keyStored: "Configured — enter a new value to replace",
|
|
2535
2925
|
keyEnvLocked: "Provided by the launch environment (read-only)",
|
|
2926
|
+
keyPlaceholderSaved: "Leave blank to use saved credentials",
|
|
2927
|
+
keyFallbackMissing: "Env var not detected. Enter an API key, or configure {hint} in your env.",
|
|
2928
|
+
keyFallbackDetected: "Env var detected. ({hint})",
|
|
2929
|
+
keyFallbackDetectedHidden: "Env var detected.",
|
|
2930
|
+
keyFallbackUnchecked: "Environment credential status has not been confirmed.",
|
|
2536
2931
|
customized: "Customized settings",
|
|
2537
2932
|
baseUrl: "Base URL",
|
|
2538
2933
|
baseUrlDefault: "Provider default",
|
|
2934
|
+
baseUrlEnvironment: "Provider endpoint configuration: {env}",
|
|
2935
|
+
baseUrlConfigured: "Provider-configured endpoint",
|
|
2539
2936
|
deepSeekBaseUrl: "https://api.deepseek.com/anthropic",
|
|
2540
2937
|
deepSeekEndpointHint: "Use an endpoint compatible with the configured connection.",
|
|
2541
2938
|
models: "Models",
|
|
@@ -2554,6 +2951,16 @@ window.__ModuleLoader__.load({
|
|
|
2554
2951
|
modelInputTypes: "Input types",
|
|
2555
2952
|
modelInputText: "Text",
|
|
2556
2953
|
modelInputImage: "Image",
|
|
2954
|
+
modelReasoning: "Reasoning levels",
|
|
2955
|
+
modelReasoningLevel: "Level",
|
|
2956
|
+
modelReasoningValue: "API value",
|
|
2957
|
+
modelReasoningHelp: "About reasoning levels",
|
|
2958
|
+
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.",
|
|
2959
|
+
modelReasoningNeedsLevel: "Add at least one level besides Off, or turn reasoning levels off.",
|
|
2960
|
+
modelReasoningValueRequired: "Every level besides Off needs an API value, and no value can be empty.",
|
|
2961
|
+
modelReasoningAdd: "Add level",
|
|
2962
|
+
modelReasoningRemove: "Delete level",
|
|
2963
|
+
modelReasoningOffValuePlaceholder: "Turns reasoning off",
|
|
2557
2964
|
addModel: "Add model",
|
|
2558
2965
|
removeModel: "Delete model",
|
|
2559
2966
|
modelsEmpty: "No models will be shown in the selector. Unlisted IDs can still be sent directly.",
|
|
@@ -2634,13 +3041,22 @@ window.__ModuleLoader__.load({
|
|
|
2634
3041
|
conflict: "这张卡片打开期间,这些设置已被其他地方改动。请关闭后重新打开,在当前值上编辑。",
|
|
2635
3042
|
retry: "重试",
|
|
2636
3043
|
keyInput: "API 密钥",
|
|
3044
|
+
keyReveal: "显示密钥",
|
|
3045
|
+
keyHide: "隐藏密钥",
|
|
2637
3046
|
keyPlaceholder: "输入 API 密钥",
|
|
2638
3047
|
keyPlaceholderNative: "输入 API 密钥,或留空使用环境认证",
|
|
2639
3048
|
keyStored: "已配置——输入新值可替换",
|
|
2640
3049
|
keyEnvLocked: "由启动环境提供(只读)",
|
|
3050
|
+
keyPlaceholderSaved: "留空使用已保存凭据",
|
|
3051
|
+
keyFallbackMissing: "未检测到环境变量。请填写 API 密钥,或设置环境变量 {hint}。",
|
|
3052
|
+
keyFallbackDetected: "已检测到环境变量({hint})",
|
|
3053
|
+
keyFallbackDetectedHidden: "已检测到环境变量",
|
|
3054
|
+
keyFallbackUnchecked: "环境凭据状态尚未确认",
|
|
2641
3055
|
customized: "自定义设置",
|
|
2642
3056
|
baseUrl: "API 地址",
|
|
2643
3057
|
baseUrlDefault: "提供方默认",
|
|
3058
|
+
baseUrlEnvironment: "提供方地址配置:{env}",
|
|
3059
|
+
baseUrlConfigured: "由提供方配置地址",
|
|
2644
3060
|
deepSeekBaseUrl: "https://api.deepseek.com/anthropic",
|
|
2645
3061
|
deepSeekEndpointHint: "请填写与当前连接配置兼容的 API 地址。",
|
|
2646
3062
|
models: "模型目录",
|
|
@@ -2659,6 +3075,16 @@ window.__ModuleLoader__.load({
|
|
|
2659
3075
|
modelInputTypes: "输入类型",
|
|
2660
3076
|
modelInputText: "文本",
|
|
2661
3077
|
modelInputImage: "图片",
|
|
3078
|
+
modelReasoning: "推理等级",
|
|
3079
|
+
modelReasoningLevel: "档位",
|
|
3080
|
+
modelReasoningValue: "API 参数值",
|
|
3081
|
+
modelReasoningHelp: "推理等级说明",
|
|
3082
|
+
modelReasoningHelpText: "API 参数值会写入请求的推理强度字段(如 OpenAI 的 reasoning_effort),默认与档位名相同;如有不同,以模型提供商的 API 文档为准。Off 表示关闭思考,不需要填写参数值;配置中已写入的值会保留并发送。",
|
|
3083
|
+
modelReasoningNeedsLevel: "至少添加一个 Off 以外的档位;不需要思考请关闭推理等级。",
|
|
3084
|
+
modelReasoningValueRequired: "Off 以外的档位都需要填写 API 参数值,且参数值不能为空字符串。",
|
|
3085
|
+
modelReasoningAdd: "添加档位",
|
|
3086
|
+
modelReasoningRemove: "删除档位",
|
|
3087
|
+
modelReasoningOffValuePlaceholder: "关闭思考",
|
|
2662
3088
|
addModel: "添加模型",
|
|
2663
3089
|
removeModel: "删除模型",
|
|
2664
3090
|
modelsEmpty: "模型选择器中将不显示任何模型;目录外 ID 仍可直接发送。",
|