dsh-codearts 1.4.0 → 1.4.2
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/CHANGELOG.md +58 -0
- package/README.en.md +8 -2
- package/README.md +6 -2
- package/lib/{auth-Ch0vYSAo.mjs → auth-CsAz93vO.mjs} +1 -1
- package/lib/bin.mjs +3 -3
- package/lib/client/index.d.cts +6 -0
- package/lib/client/index.js +348 -96
- package/lib/index.d.mts +44 -6
- package/lib/index.mjs +156 -20
- package/lib/{keeper-MHeAp_eV.mjs → keeper-DJLwIiR4.mjs} +82 -7
- package/lib/keeper-main.mjs +62 -12
- package/lib/{upstream-CVtspzAv.mjs → upstream-BsoeSKrY.mjs} +90 -15
- package/lib/{version-BjBwEMks.mjs → version-DLMVdsWB.mjs} +8 -7
- package/package.json +1 -1
package/lib/client/index.js
CHANGED
|
@@ -145,7 +145,7 @@ function latencyP95Label(latency) {
|
|
|
145
145
|
}
|
|
146
146
|
//#endregion
|
|
147
147
|
//#region \0dsh-css:/home/runner/work/dsh-codearts/dsh-codearts/src/client/CodeArtsPluginCard.module.css.mjs
|
|
148
|
-
const css$1 = ".xoziZG_card{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-settings-card-fill);box-sizing:border-box;width:100%;max-width:none}.xoziZG_header{align-items:flex-start;gap:12px;padding:14px 16px;display:flex}.xoziZG_headText{flex-direction:column;flex:1;gap:6px;min-width:0;display:flex}.xoziZG_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:22px}.xoziZG_desc{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:20px}.xoziZG_statusLine{color:var(--dsw-alias-label-primary);align-items:center;gap:6px;font-size:14px;font-weight:500;line-height:22px;display:inline-flex}.xoziZG_meta{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:12px;line-height:18px}.xoziZG_body{border-top:.5px solid var(--dsw-alias-border-l2);margin:0 16px;padding:4px 0 16px}.xoziZG_tabs{margin-top:12px}.xoziZG_tabPanel{padding-top:2px}.xoziZG_accountToolbar{gap:8px;margin-top:12px;display:flex}.xoziZG_accountToolbar>*{flex:1}.xoziZG_manualForm{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);margin-top:12px;padding:12px}.xoziZG_accountCard{flex-direction:column;gap:10px;margin-top:12px;display:flex}.xoziZG_accountEntry{border:.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-2)}.xoziZG_accountRow{align-items:center;gap:10px;padding:12px;display:flex}.xoziZG_claimAllRow{border-top:.5px solid var(--dsw-alias-border-l2);justify-content:flex-end;padding:10px 12px 0;display:flex}.xoziZG_avatar{background:var(--dsw-alias-bg-layer-3);width:32px;height:32px;color:var(--dsw-alias-label-primary);border-radius:50%;flex:none;justify-content:center;align-items:center;font-size:14px;font-weight:600;display:inline-flex}.xoziZG_accountInfo{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.xoziZG_accountNameRow{align-items:center;gap:6px;min-width:0;display:flex}.xoziZG_accountName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:600;line-height:20px;overflow:hidden}.xoziZG_accountRowActions{flex-wrap:wrap;flex:none;justify-content:flex-end;align-items:center;gap:6px;display:flex}.xoziZG_accountToggle{align-items:center;gap:6px;display:inline-flex}.xoziZG_accountToggleLabel{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-size:12px;line-height:20px}.xoziZG_accountHint{color:var(--dsw-alias-label-tertiary);margin:0;padding:0 12px 12px;font-size:12px;line-height:18px}.xoziZG_creditBlock{border-top:.5px solid var(--dsw-alias-border-l2);padding:12px}.xoziZG_balanceRow{flex-wrap:wrap;align-items:baseline;gap:6px;display:flex}.xoziZG_balance{color:var(--dsw-alias-label-primary);letter-spacing:-.02em;font-variant-numeric:tabular-nums;font-size:28px;font-weight:600;line-height:34px}.xoziZG_balanceUnit{color:var(--dsw-alias-label-secondary);font-size:12px}.xoziZG_balanceMeta{color:var(--dsw-alias-label-tertiary);margin-left:2px;font-size:12px}.xoziZG_updated{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;margin-left:auto;font-size:12px}.xoziZG_creditRows{flex-direction:column;gap:4px;margin-top:8px;display:flex}.xoziZG_creditRow{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;justify-content:space-between;align-items:baseline;gap:12px;font-size:12px;line-height:18px;display:flex}.xoziZG_usageBar{background:var(--dsw-alias-border-l2);border-radius:2px;height:4px;margin-top:4px;display:block;overflow:hidden}.xoziZG_usageFill{background:var(--dsw-alias-brand-primary);border-radius:2px;height:100%;transition:width .2s;display:block}.xoziZG_expiryRow{margin-top:2px}.xoziZG_expiryLabel{color:var(--dsw-alias-state-warn-label)}.xoziZG_bar{background:var(--dsw-alias-bg-layer-3);border-radius:2px;height:4px;margin-top:6px;display:block;overflow:hidden}.xoziZG_barFill{background:var(--dsw-alias-state-warn-primary);border-radius:2px;height:100%;display:block}.xoziZG_creditLink{margin-top:8px;display:inline-block}.xoziZG_creditFooter{border-top:.5px solid var(--dsw-alias-border-l2);justify-content:space-between;align-items:center;gap:8px;margin-top:12px;padding-top:10px;display:flex}.xoziZG_creditHint{color:var(--dsw-alias-label-tertiary);margin:8px 0 0;font-size:12px;line-height:18px}.xoziZG_section{margin-top:16px}.xoziZG_sectionHead{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.xoziZG_sectionLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;font-weight:500}.xoziZG_count{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;flex:none;font-size:12px}.xoziZG_hint{color:var(--dsw-alias-label-secondary);margin:8px 0 0;font-size:13px;line-height:20px}.xoziZG_error{color:var(--dsw-alias-state-error-primary);margin:10px 0 0;font-size:13px;line-height:20px}.xoziZG_actions{flex-wrap:wrap;align-items:center;gap:8px;margin-top:12px;display:flex}.xoziZG_danger{color:var(--dsw-alias-state-error-primary)}.xoziZG_link{appearance:none;color:var(--dsw-alias-brand-text);font:inherit;text-align:left;word-break:break-all;cursor:pointer;background:0 0;border:none;padding:0;font-size:12px}.xoziZG_link:hover{text-decoration:underline}.xoziZG_choices{flex-direction:column;gap:2px;margin-top:8px;display:flex}.xoziZG_choiceRow{border-radius:var(--dsw-radius-sm);align-items:center;gap:8px;margin:0 -6px;padding:5px 6px;display:flex}.xoziZG_choiceRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.xoziZG_statGrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:10px 0 14px;display:grid}.xoziZG_statCard{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);flex-direction:column;gap:1px;padding:8px 10px;display:flex}.xoziZG_statLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.xoziZG_statValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-size:15px;line-height:20px}.xoziZG_statSub{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.xoziZG_modelChart{flex-direction:column;gap:2px;margin-top:8px;display:flex}.xoziZG_modelRow{font-variant-numeric:tabular-nums;border-radius:6px;grid-template-columns:minmax(0,1.2fr) minmax(48px,1fr) 56px 52px 64px;align-items:center;gap:8px;padding:4px 0;display:grid;position:relative}.xoziZG_modelRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.xoziZG_usageTip{z-index:5;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-3);min-width:180px;max-width:260px;color:var(--dsw-alias-label-secondary);text-align:left;font-variant-numeric:tabular-nums;pointer-events:none;padding:8px 10px;font-size:12px;line-height:1.9;position:absolute;bottom:calc(100% + 6px);right:0;box-shadow:0 10px 28px #00000073}.xoziZG_usageTip[data-float=true]{z-index:40;position:fixed;bottom:auto;right:auto}.xoziZG_usageTipName{max-width:240px;color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.xoziZG_usageTipSep{background:var(--dsw-alias-border-l2);height:1px;margin:4px 0}.xoziZG_usageTipRow{justify-content:space-between;gap:24px;display:flex}.xoziZG_usageTipRow span:last-child{color:var(--dsw-alias-label-primary);font-weight:600}.xoziZG_modelName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:18px;overflow:hidden}.xoziZG_modelTrack{background:var(--dsw-alias-border-l2);border-radius:4px;height:8px;display:block;overflow:hidden}.xoziZG_modelFill{background:var(--dsw-alias-brand-primary);border-radius:4px;height:100%;transition:width .16s;display:block}.xoziZG_modelTokens,.xoziZG_modelShare,.xoziZG_modelRequests{color:var(--dsw-alias-label-secondary);text-align:right;white-space:nowrap;font-size:11px;line-height:16px}.xoziZG_modelRequests{color:var(--dsw-alias-label-tertiary)}.xoziZG_heatGrid{grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin:8px 0 2px;display:grid}.xoziZG_heatWeekday{color:var(--dsw-alias-label-tertiary);text-align:center;font-size:10px;line-height:14px}.xoziZG_heatCell{background:color-mix(in srgb, var(--dsw-alias-label-primary) 6%, transparent);height:36px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;border:0;border-radius:8px;outline:0;justify-content:center;align-items:center;font-size:12px;transition:background .12s ease-out;display:flex}.xoziZG_heatCell[data-tone=empty]{color:var(--dsw-alias-label-tertiary)}.xoziZG_heatCell[data-tone=pad]{background:0 0}.xoziZG_heatCell[data-tone=out]{color:var(--dsw-alias-label-tertiary);opacity:.45;background:0 0}.xoziZG_heatCell[data-tone=lv1]{color:#0f1115;background:#ddf4e7}.xoziZG_heatCell[data-tone=lv2]{color:#0f1115;background:#b3e8cc}.xoziZG_heatCell[data-tone=lv3]{color:#0f1115;background:#7dd8ac}.xoziZG_heatCell[data-tone=lv4]{color:#fff;background:#40c584}.xoziZG_heatCell[data-tone=lv5]{color:#fff;background:#16a34a}.xoziZG_heatCell[data-today=true]{box-shadow:inset 0 -2px 0 0 var(--heat-today-mark,#16a34a);font-weight:700}.xoziZG_heatCell[data-today=true][data-tone=lv4],.xoziZG_heatCell[data-today=true][data-tone=lv5]{--heat-today-mark:#fff}.xoziZG_heatHours{grid-template-columns:repeat(24,minmax(0,1fr));gap:3px;margin:8px 0 0;display:grid}.xoziZG_heatHourCell{background:color-mix(in srgb, var(--dsw-alias-label-primary) 6%, transparent);border-radius:4px;height:26px;transition:background .12s ease-out}.xoziZG_heatHourCell[data-tone=lv1]{background:#ddf4e7}.xoziZG_heatHourCell[data-tone=lv2]{background:#b3e8cc}.xoziZG_heatHourCell[data-tone=lv3]{background:#7dd8ac}.xoziZG_heatHourCell[data-tone=lv4]{background:#40c584}.xoziZG_heatHourCell[data-tone=lv5]{background:#16a34a}.xoziZG_heatAxis{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;grid-template-columns:repeat(24,minmax(0,1fr));gap:3px;font-size:10px;line-height:14px;display:grid}.xoziZG_heatAxisSlot{text-align:center;white-space:nowrap;overflow:hidden}.xoziZG_heatLegend{color:var(--dsw-alias-label-tertiary);justify-content:flex-start;align-items:center;gap:3px;margin:0 0 6px;font-size:10px;display:flex}.xoziZG_heatLegendChip{border-radius:3px;width:10px;height:10px}.xoziZG_heatLegendChip[data-tone=lv1]{background:#ddf4e7}.xoziZG_heatLegendChip[data-tone=lv2]{background:#b3e8cc}.xoziZG_heatLegendChip[data-tone=lv3]{background:#7dd8ac}.xoziZG_heatLegendChip[data-tone=lv4]{background:#40c584}.xoziZG_heatLegendChip[data-tone=lv5]{background:#16a34a}.xoziZG_trendTip{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;margin:2px 0 0;font-size:11px;line-height:16px}.xoziZG_check{flex:1;min-width:0}.xoziZG_check>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.xoziZG_manual{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);margin-top:12px;padding:0 12px}.xoziZG_manual[open]{padding-bottom:12px}.xoziZG_manualSummary{color:var(--dsw-alias-label-secondary);cursor:pointer;align-items:center;gap:6px;padding:9px 0;font-size:13px;list-style:none;display:flex}.xoziZG_manualSummary::-webkit-details-marker{display:none}.xoziZG_field{flex-direction:column;gap:5px;margin-top:10px;display:flex}.xoziZG_fieldLabel{color:var(--dsw-alias-label-tertiary);font-size:12px}.xoziZG_area{box-sizing:border-box;resize:vertical;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;color:var(--dsw-alias-label-primary);padding:6px 8px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px;line-height:20px}.xoziZG_area::placeholder{color:var(--dsw-alias-label-dimmed)}.xoziZG_area:focus{border-color:var(--dsw-alias-state-business-primary);outline:none}.xoziZG_skeleton{flex-direction:column;gap:10px;padding:4px 0;display:flex}.xoziZG_skeletonRow{border-radius:var(--dsw-radius-sm,4px);background:var(--dsw-alias-border-l2);height:12px;animation:1.4s ease-in-out infinite xoziZG_skeletonBreath}.xoziZG_skeletonRow:nth-child(2){width:72%}.xoziZG_skeletonRow:nth-child(3){width:46%}@keyframes xoziZG_skeletonBreath{0%,to{opacity:.45}50%{opacity:.9}}@media (prefers-reduced-motion:reduce){.xoziZG_skeletonRow{animation:none}}.xoziZG_modelSpec{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.xoziZG_doctorList{flex-direction:column;gap:2px;margin-top:8px;display:flex}.xoziZG_doctorRow{align-items:center;gap:8px;padding:4px 0;display:flex}.xoziZG_doctorName{color:var(--dsw-alias-label-secondary);flex:none;font-size:12px;line-height:18px}.xoziZG_doctorRow .xoziZG_meta{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}";
|
|
148
|
+
const css$1 = ".xoziZG_card{border:.5px solid var(--dsw-alias-settings-card-stroke);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-settings-card-fill);box-sizing:border-box;width:100%;max-width:none}.xoziZG_header{align-items:flex-start;gap:12px;padding:14px 16px;display:flex}.xoziZG_headText{flex-direction:column;flex:1;gap:6px;min-width:0;display:flex}.xoziZG_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:22px}.xoziZG_desc{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:20px}.xoziZG_statusLine{color:var(--dsw-alias-label-primary);align-items:center;gap:6px;font-size:14px;font-weight:500;line-height:22px;display:inline-flex}.xoziZG_meta{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:12px;line-height:18px}.xoziZG_body{border-top:.5px solid var(--dsw-alias-border-l2);margin:0 16px;padding:4px 0 16px}.xoziZG_tabs{margin-top:12px}.xoziZG_tabPanel{padding-top:2px}.xoziZG_accountToolbar{gap:8px;margin-top:12px;display:flex}.xoziZG_accountToolbar>*{flex:1}.xoziZG_manualForm{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);margin-top:12px;padding:12px}.xoziZG_accountCard{flex-direction:column;gap:10px;margin-top:12px;display:flex}.xoziZG_accountEntry{border:.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-2)}.xoziZG_accountRow{align-items:center;gap:10px;padding:12px;display:flex}.xoziZG_claimAllRow{border-top:.5px solid var(--dsw-alias-border-l2);justify-content:flex-end;padding:10px 12px 0;display:flex}.xoziZG_avatar{background:var(--dsw-alias-bg-layer-3);width:32px;height:32px;color:var(--dsw-alias-label-primary);border-radius:50%;flex:none;justify-content:center;align-items:center;font-size:14px;font-weight:600;display:inline-flex}.xoziZG_accountInfo{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.xoziZG_accountNameRow{align-items:center;gap:6px;min-width:0;display:flex}.xoziZG_accountName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:600;line-height:20px;overflow:hidden}.xoziZG_accountRowActions{flex-wrap:wrap;flex:none;justify-content:flex-end;align-items:center;gap:6px;display:flex}.xoziZG_accountToggle{align-items:center;gap:6px;display:inline-flex}.xoziZG_accountToggleLabel{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-size:12px;line-height:20px}.xoziZG_accountHint{color:var(--dsw-alias-label-tertiary);margin:0;padding:0 12px 12px;font-size:12px;line-height:18px}.xoziZG_creditBlock{border-top:.5px solid var(--dsw-alias-border-l2);padding:12px}.xoziZG_balanceRow{flex-wrap:wrap;align-items:baseline;gap:6px;display:flex}.xoziZG_balance{color:var(--dsw-alias-label-primary);letter-spacing:-.02em;font-variant-numeric:tabular-nums;font-size:28px;font-weight:600;line-height:34px}.xoziZG_balanceUnit{color:var(--dsw-alias-label-secondary);font-size:12px}.xoziZG_balanceMeta{color:var(--dsw-alias-label-tertiary);margin-left:2px;font-size:12px}.xoziZG_updated{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;margin-left:auto;font-size:12px}.xoziZG_creditRows{flex-direction:column;gap:4px;margin-top:8px;display:flex}.xoziZG_creditRow{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;justify-content:space-between;align-items:baseline;gap:12px;font-size:12px;line-height:18px;display:flex}.xoziZG_usageBar{background:var(--dsw-alias-border-l2);border-radius:2px;height:4px;margin-top:4px;display:block;overflow:hidden}.xoziZG_usageFill{background:var(--dsw-alias-brand-primary);border-radius:2px;height:100%;transition:width .2s;display:block}.xoziZG_expiryRow{margin-top:2px}.xoziZG_expiryLabel{color:var(--dsw-alias-state-warn-label)}.xoziZG_bar{background:var(--dsw-alias-bg-layer-3);border-radius:2px;height:4px;margin-top:6px;display:block;overflow:hidden}.xoziZG_barFill{background:var(--dsw-alias-state-warn-primary);border-radius:2px;height:100%;display:block}.xoziZG_creditLink{margin-top:8px;display:inline-block}.xoziZG_creditFooter{border-top:.5px solid var(--dsw-alias-border-l2);justify-content:space-between;align-items:center;gap:8px;margin-top:12px;padding-top:10px;display:flex}.xoziZG_creditHint{color:var(--dsw-alias-label-tertiary);margin:8px 0 0;font-size:12px;line-height:18px}.xoziZG_section{margin-top:16px}.xoziZG_sectionHead{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.xoziZG_sectionLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;font-weight:500}.xoziZG_count{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;flex:none;font-size:12px}.xoziZG_hint{color:var(--dsw-alias-label-secondary);margin:8px 0 0;font-size:13px;line-height:20px}.xoziZG_error{color:var(--dsw-alias-state-error-primary);margin:10px 0 0;font-size:13px;line-height:20px}.xoziZG_actions{flex-wrap:wrap;align-items:center;gap:8px;margin-top:12px;display:flex}.xoziZG_danger{color:var(--dsw-alias-state-error-primary)}.xoziZG_link{appearance:none;color:var(--dsw-alias-brand-text);font:inherit;text-align:left;word-break:break-all;cursor:pointer;background:0 0;border:none;padding:0;font-size:12px}.xoziZG_link:hover{text-decoration:underline}.xoziZG_choices{flex-direction:column;gap:2px;margin-top:8px;display:flex}.xoziZG_choiceRow{border-radius:var(--dsw-radius-sm);align-items:center;gap:8px;margin:0 -6px;padding:5px 6px;display:flex}.xoziZG_choiceRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.xoziZG_statGrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:10px 0 14px;display:grid}.xoziZG_statCard{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);flex-direction:column;gap:1px;padding:8px 10px;display:flex}.xoziZG_statLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.xoziZG_statValue{color:var(--dsw-alias-label-primary);font-variant-numeric:tabular-nums;font-size:15px;line-height:20px}.xoziZG_statSub{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.xoziZG_modelChart{flex-direction:column;gap:2px;margin-top:8px;display:flex}.xoziZG_modelRow{font-variant-numeric:tabular-nums;border-radius:6px;grid-template-columns:minmax(0,1.2fr) minmax(48px,1fr) 56px 52px 64px;align-items:center;gap:8px;padding:4px 0;display:grid;position:relative}.xoziZG_modelRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.xoziZG_usageTip{z-index:5;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-3);min-width:180px;max-width:260px;color:var(--dsw-alias-label-secondary);text-align:left;font-variant-numeric:tabular-nums;pointer-events:none;padding:8px 10px;font-size:12px;line-height:1.9;position:absolute;bottom:calc(100% + 6px);right:0;box-shadow:0 10px 28px #00000073}.xoziZG_usageTip[data-float=true]{z-index:40;position:fixed;bottom:auto;right:auto}.xoziZG_usageTipName{max-width:240px;color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.xoziZG_usageTipSep{background:var(--dsw-alias-border-l2);height:1px;margin:4px 0}.xoziZG_usageTipRow{justify-content:space-between;gap:24px;display:flex}.xoziZG_usageTipRow span:last-child{color:var(--dsw-alias-label-primary);font-weight:600}.xoziZG_modelName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:18px;overflow:hidden}.xoziZG_modelTrack{background:var(--dsw-alias-border-l2);border-radius:4px;height:8px;display:block;overflow:hidden}.xoziZG_modelFill{background:var(--dsw-alias-brand-primary);border-radius:4px;height:100%;transition:width .16s;display:block}.xoziZG_modelTokens,.xoziZG_modelShare,.xoziZG_modelRequests{color:var(--dsw-alias-label-secondary);text-align:right;white-space:nowrap;font-size:11px;line-height:16px}.xoziZG_modelRequests{color:var(--dsw-alias-label-tertiary)}.xoziZG_heatGrid{grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin:8px 0 2px;display:grid}.xoziZG_heatWeekday{color:var(--dsw-alias-label-tertiary);text-align:center;font-size:10px;line-height:14px}.xoziZG_heatCell{background:color-mix(in srgb, var(--dsw-alias-label-primary) 6%, transparent);height:36px;color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;border:0;border-radius:8px;outline:0;justify-content:center;align-items:center;font-size:12px;transition:background .12s ease-out;display:flex}.xoziZG_heatCell[data-tone=empty]{color:var(--dsw-alias-label-tertiary)}.xoziZG_heatCell[data-tone=pad]{background:0 0}.xoziZG_heatCell[data-tone=out]{color:var(--dsw-alias-label-tertiary);opacity:.45;background:0 0}.xoziZG_heatCell[data-tone=lv1]{color:#0f1115;background:#ddf4e7}.xoziZG_heatCell[data-tone=lv2]{color:#0f1115;background:#b3e8cc}.xoziZG_heatCell[data-tone=lv3]{color:#0f1115;background:#7dd8ac}.xoziZG_heatCell[data-tone=lv4]{color:#fff;background:#40c584}.xoziZG_heatCell[data-tone=lv5]{color:#fff;background:#16a34a}.xoziZG_heatCell[data-today=true]{box-shadow:inset 0 -2px 0 0 var(--heat-today-mark,#16a34a);font-weight:700}.xoziZG_heatCell[data-today=true][data-tone=lv4],.xoziZG_heatCell[data-today=true][data-tone=lv5]{--heat-today-mark:#fff}.xoziZG_heatHours{grid-template-columns:repeat(24,minmax(0,1fr));gap:3px;margin:8px 0 0;display:grid}.xoziZG_heatHourCell{background:color-mix(in srgb, var(--dsw-alias-label-primary) 6%, transparent);border-radius:4px;height:26px;transition:background .12s ease-out}.xoziZG_heatHourCell[data-tone=lv1]{background:#ddf4e7}.xoziZG_heatHourCell[data-tone=lv2]{background:#b3e8cc}.xoziZG_heatHourCell[data-tone=lv3]{background:#7dd8ac}.xoziZG_heatHourCell[data-tone=lv4]{background:#40c584}.xoziZG_heatHourCell[data-tone=lv5]{background:#16a34a}.xoziZG_heatAxis{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;grid-template-columns:repeat(24,minmax(0,1fr));gap:3px;font-size:10px;line-height:14px;display:grid}.xoziZG_heatAxisSlot{text-align:center;white-space:nowrap;overflow:hidden}.xoziZG_heatLegend{color:var(--dsw-alias-label-tertiary);justify-content:flex-start;align-items:center;gap:3px;margin:0 0 6px;font-size:10px;display:flex}.xoziZG_heatLegendChip{border-radius:3px;width:10px;height:10px}.xoziZG_heatLegendChip[data-tone=lv1]{background:#ddf4e7}.xoziZG_heatLegendChip[data-tone=lv2]{background:#b3e8cc}.xoziZG_heatLegendChip[data-tone=lv3]{background:#7dd8ac}.xoziZG_heatLegendChip[data-tone=lv4]{background:#40c584}.xoziZG_heatLegendChip[data-tone=lv5]{background:#16a34a}.xoziZG_trendTip{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;margin:2px 0 0;font-size:11px;line-height:16px}.xoziZG_check{flex:1;min-width:0}.xoziZG_check>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.xoziZG_manual{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-md);margin-top:12px;padding:0 12px}.xoziZG_manual[open]{padding-bottom:12px}.xoziZG_manualSummary{color:var(--dsw-alias-label-secondary);cursor:pointer;align-items:center;gap:6px;padding:9px 0;font-size:13px;list-style:none;display:flex}.xoziZG_manualSummary::-webkit-details-marker{display:none}.xoziZG_field{flex-direction:column;gap:5px;margin-top:10px;display:flex}.xoziZG_fieldLabel{color:var(--dsw-alias-label-tertiary);font-size:12px}.xoziZG_area{box-sizing:border-box;resize:vertical;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;color:var(--dsw-alias-label-primary);padding:6px 8px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px;line-height:20px}.xoziZG_area::placeholder{color:var(--dsw-alias-label-dimmed)}.xoziZG_area:focus{border-color:var(--dsw-alias-state-business-primary);outline:none}.xoziZG_skeleton{flex-direction:column;gap:10px;padding:4px 0;display:flex}.xoziZG_skeletonRow{border-radius:var(--dsw-radius-sm,4px);background:var(--dsw-alias-border-l2);height:12px;animation:1.4s ease-in-out infinite xoziZG_skeletonBreath}.xoziZG_skeletonRow:nth-child(2){width:72%}.xoziZG_skeletonRow:nth-child(3){width:46%}@keyframes xoziZG_skeletonBreath{0%,to{opacity:.45}50%{opacity:.9}}@media (prefers-reduced-motion:reduce){.xoziZG_skeletonRow{animation:none}}.xoziZG_modelSpec{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.xoziZG_windowAnchor{flex:none;margin-left:auto;position:relative}.xoziZG_windowButton{font:inherit;color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-variant-numeric:tabular-nums;border-radius:var(--dsw-radius-sm);cursor:pointer;background:0 0;border:.5px solid #0000;align-items:center;gap:3px;padding:1px 4px;font-size:11px;line-height:16px;display:inline-flex}.xoziZG_windowButton:hover,.xoziZG_windowButtonOpen{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover);border-color:var(--dsw-alias-border-l3)}.xoziZG_windowButtonSet{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-state-business-primary);font-weight:500}.xoziZG_windowCaret{opacity:.7;font-size:9px;line-height:1}.xoziZG_windowPopover{z-index:40;background:var(--dsw-alias-bg-layer-2);border:.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md);flex-direction:column;gap:8px;width:208px;padding:10px;display:flex;position:absolute;top:calc(100% + 4px);right:0;box-shadow:0 6px 20px #0000002e}.xoziZG_windowPopoverHead{color:var(--dsw-alias-label-secondary);justify-content:space-between;align-items:baseline;gap:8px;font-size:11px;line-height:16px;display:flex}.xoziZG_windowPopoverValue{font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-primary)}.xoziZG_windowRange{cursor:pointer;width:100%;height:16px;accent-color:var(--dsw-alias-brand-primary);margin:0}.xoziZG_windowRange:disabled{cursor:not-allowed;opacity:.5}.xoziZG_windowPopoverRow{align-items:center;gap:6px;display:flex}.xoziZG_windowUnit{color:var(--dsw-alias-label-tertiary);font-size:11px}.xoziZG_windowInput{min-width:0;font:inherit;font-variant-numeric:tabular-nums;text-align:right;color:var(--dsw-alias-label-primary);border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);-moz-appearance:textfield;appearance:textfield;background:0 0;flex:1;padding:2px 6px;font-size:11px;line-height:16px}.xoziZG_windowInput::-webkit-outer-spin-button,.xoziZG_windowInput::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.xoziZG_windowInput:focus{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-brand-primary);outline:none}.xoziZG_windowInputSet{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-state-business-primary);font-weight:500}.xoziZG_windowHint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:10px;line-height:15px}.xoziZG_doctorList{flex-direction:column;gap:2px;margin-top:8px;display:flex}.xoziZG_doctorRow{align-items:center;gap:8px;padding:4px 0;display:flex}.xoziZG_doctorName{color:var(--dsw-alias-label-secondary);flex:none;font-size:12px;line-height:18px}.xoziZG_doctorRow .xoziZG_meta{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}";
|
|
149
149
|
const tagId$1 = "dsh-codearts/CodeArtsPluginCard.module.css";
|
|
150
150
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
|
|
151
151
|
const tag = document.createElement("style");
|
|
@@ -155,98 +155,112 @@ if (typeof document !== "undefined" && document.querySelector("style[data-plugin
|
|
|
155
155
|
document.head.appendChild(tag);
|
|
156
156
|
}
|
|
157
157
|
var CodeArtsPluginCard_module_css_default = {
|
|
158
|
-
"
|
|
159
|
-
"
|
|
160
|
-
"
|
|
158
|
+
"usageTipName": "xoziZG_usageTipName",
|
|
159
|
+
"accountInfo": "xoziZG_accountInfo",
|
|
160
|
+
"modelSpec": "xoziZG_modelSpec",
|
|
161
|
+
"header": "xoziZG_header",
|
|
162
|
+
"sectionLabel": "xoziZG_sectionLabel",
|
|
163
|
+
"heatWeekday": "xoziZG_heatWeekday",
|
|
164
|
+
"balanceMeta": "xoziZG_balanceMeta",
|
|
165
|
+
"accountRow": "xoziZG_accountRow",
|
|
166
|
+
"statGrid": "xoziZG_statGrid",
|
|
167
|
+
"danger": "xoziZG_danger",
|
|
168
|
+
"accountHint": "xoziZG_accountHint",
|
|
169
|
+
"creditFooter": "xoziZG_creditFooter",
|
|
170
|
+
"creditLink": "xoziZG_creditLink",
|
|
171
|
+
"sectionHead": "xoziZG_sectionHead",
|
|
172
|
+
"bar": "xoziZG_bar",
|
|
173
|
+
"accountName": "xoziZG_accountName",
|
|
161
174
|
"usageTipSep": "xoziZG_usageTipSep",
|
|
162
|
-
"
|
|
163
|
-
"heatHours": "xoziZG_heatHours",
|
|
175
|
+
"check": "xoziZG_check",
|
|
164
176
|
"balance": "xoziZG_balance",
|
|
165
|
-
"
|
|
166
|
-
"
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"
|
|
177
|
+
"usageBar": "xoziZG_usageBar",
|
|
178
|
+
"choiceRow": "xoziZG_choiceRow",
|
|
179
|
+
"statCard": "xoziZG_statCard",
|
|
180
|
+
"heatAxis": "xoziZG_heatAxis",
|
|
181
|
+
"statSub": "xoziZG_statSub",
|
|
182
|
+
"accountToggle": "xoziZG_accountToggle",
|
|
183
|
+
"accountToggleLabel": "xoziZG_accountToggleLabel",
|
|
184
|
+
"modelFill": "xoziZG_modelFill",
|
|
185
|
+
"windowButton": "xoziZG_windowButton",
|
|
170
186
|
"heatLegend": "xoziZG_heatLegend",
|
|
171
|
-
"
|
|
172
|
-
"accountNameRow": "xoziZG_accountNameRow",
|
|
173
|
-
"heatCell": "xoziZG_heatCell",
|
|
187
|
+
"windowAnchor": "xoziZG_windowAnchor",
|
|
174
188
|
"desc": "xoziZG_desc",
|
|
175
|
-
"
|
|
176
|
-
"danger": "xoziZG_danger",
|
|
177
|
-
"modelSpec": "xoziZG_modelSpec",
|
|
178
|
-
"creditRow": "xoziZG_creditRow",
|
|
179
|
-
"doctorRow": "xoziZG_doctorRow",
|
|
189
|
+
"balanceRow": "xoziZG_balanceRow",
|
|
180
190
|
"updated": "xoziZG_updated",
|
|
181
|
-
"
|
|
191
|
+
"creditRows": "xoziZG_creditRows",
|
|
182
192
|
"modelRequests": "xoziZG_modelRequests",
|
|
193
|
+
"heatLegendChip": "xoziZG_heatLegendChip",
|
|
183
194
|
"skeleton": "xoziZG_skeleton",
|
|
184
|
-
"
|
|
185
|
-
"
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
"
|
|
189
|
-
"
|
|
190
|
-
"
|
|
191
|
-
"creditFooter": "xoziZG_creditFooter",
|
|
195
|
+
"usageFill": "xoziZG_usageFill",
|
|
196
|
+
"statusLine": "xoziZG_statusLine",
|
|
197
|
+
"windowPopover": "xoziZG_windowPopover",
|
|
198
|
+
"creditRow": "xoziZG_creditRow",
|
|
199
|
+
"accountEntry": "xoziZG_accountEntry",
|
|
200
|
+
"modelName": "xoziZG_modelName",
|
|
201
|
+
"meta": "xoziZG_meta",
|
|
192
202
|
"expiryRow": "xoziZG_expiryRow",
|
|
193
|
-
"
|
|
203
|
+
"choices": "xoziZG_choices",
|
|
204
|
+
"balanceUnit": "xoziZG_balanceUnit",
|
|
205
|
+
"heatAxisSlot": "xoziZG_heatAxisSlot",
|
|
206
|
+
"heatCell": "xoziZG_heatCell",
|
|
207
|
+
"manualSummary": "xoziZG_manualSummary",
|
|
208
|
+
"accountCard": "xoziZG_accountCard",
|
|
209
|
+
"hint": "xoziZG_hint",
|
|
210
|
+
"heatHourCell": "xoziZG_heatHourCell",
|
|
211
|
+
"barFill": "xoziZG_barFill",
|
|
212
|
+
"modelChart": "xoziZG_modelChart",
|
|
213
|
+
"usageTip": "xoziZG_usageTip",
|
|
214
|
+
"modelTokens": "xoziZG_modelTokens",
|
|
215
|
+
"trendTip": "xoziZG_trendTip",
|
|
216
|
+
"skeletonRow": "xoziZG_skeletonRow",
|
|
217
|
+
"windowButtonSet": "xoziZG_windowButtonSet",
|
|
218
|
+
"windowCaret": "xoziZG_windowCaret",
|
|
219
|
+
"modelTrack": "xoziZG_modelTrack",
|
|
194
220
|
"section": "xoziZG_section",
|
|
195
|
-
"
|
|
196
|
-
"
|
|
197
|
-
"
|
|
198
|
-
"
|
|
199
|
-
"
|
|
221
|
+
"statValue": "xoziZG_statValue",
|
|
222
|
+
"headText": "xoziZG_headText",
|
|
223
|
+
"accountToolbar": "xoziZG_accountToolbar",
|
|
224
|
+
"manualForm": "xoziZG_manualForm",
|
|
225
|
+
"body": "xoziZG_body",
|
|
226
|
+
"heatGrid": "xoziZG_heatGrid",
|
|
227
|
+
"windowButtonOpen": "xoziZG_windowButtonOpen",
|
|
200
228
|
"avatar": "xoziZG_avatar",
|
|
201
|
-
"
|
|
202
|
-
"
|
|
229
|
+
"error": "xoziZG_error",
|
|
230
|
+
"windowPopoverHead": "xoziZG_windowPopoverHead",
|
|
231
|
+
"windowPopoverRow": "xoziZG_windowPopoverRow",
|
|
232
|
+
"windowUnit": "xoziZG_windowUnit",
|
|
233
|
+
"creditBlock": "xoziZG_creditBlock",
|
|
234
|
+
"accountNameRow": "xoziZG_accountNameRow",
|
|
235
|
+
"windowHint": "xoziZG_windowHint",
|
|
203
236
|
"doctorList": "xoziZG_doctorList",
|
|
204
|
-
"
|
|
205
|
-
"
|
|
206
|
-
"
|
|
207
|
-
"
|
|
208
|
-
"
|
|
209
|
-
"
|
|
210
|
-
"barFill": "xoziZG_barFill",
|
|
237
|
+
"name": "xoziZG_name",
|
|
238
|
+
"creditHint": "xoziZG_creditHint",
|
|
239
|
+
"fieldLabel": "xoziZG_fieldLabel",
|
|
240
|
+
"windowPopoverValue": "xoziZG_windowPopoverValue",
|
|
241
|
+
"tabs": "xoziZG_tabs",
|
|
242
|
+
"claimAllRow": "xoziZG_claimAllRow",
|
|
211
243
|
"count": "xoziZG_count",
|
|
212
|
-
"
|
|
213
|
-
"
|
|
214
|
-
"
|
|
215
|
-
"
|
|
216
|
-
"
|
|
217
|
-
"
|
|
218
|
-
"
|
|
244
|
+
"statLabel": "xoziZG_statLabel",
|
|
245
|
+
"windowRange": "xoziZG_windowRange",
|
|
246
|
+
"windowInput": "xoziZG_windowInput",
|
|
247
|
+
"windowInputSet": "xoziZG_windowInputSet",
|
|
248
|
+
"tabPanel": "xoziZG_tabPanel",
|
|
249
|
+
"doctorName": "xoziZG_doctorName",
|
|
250
|
+
"modelShare": "xoziZG_modelShare",
|
|
251
|
+
"accountRowActions": "xoziZG_accountRowActions",
|
|
219
252
|
"skeletonBreath": "xoziZG_skeletonBreath",
|
|
220
|
-
"
|
|
221
|
-
"
|
|
222
|
-
"bar": "xoziZG_bar",
|
|
223
|
-
"creditHint": "xoziZG_creditHint",
|
|
253
|
+
"expiryLabel": "xoziZG_expiryLabel",
|
|
254
|
+
"manual": "xoziZG_manual",
|
|
224
255
|
"actions": "xoziZG_actions",
|
|
225
|
-
"statValue": "xoziZG_statValue",
|
|
226
|
-
"statLabel": "xoziZG_statLabel",
|
|
227
256
|
"card": "xoziZG_card",
|
|
228
|
-
"modelFill": "xoziZG_modelFill",
|
|
229
|
-
"accountInfo": "xoziZG_accountInfo",
|
|
230
|
-
"accountRow": "xoziZG_accountRow",
|
|
231
|
-
"usageFill": "xoziZG_usageFill",
|
|
232
|
-
"modelTrack": "xoziZG_modelTrack",
|
|
233
|
-
"manualForm": "xoziZG_manualForm",
|
|
234
|
-
"balanceUnit": "xoziZG_balanceUnit",
|
|
235
|
-
"statusLine": "xoziZG_statusLine",
|
|
236
|
-
"link": "xoziZG_link",
|
|
237
|
-
"sectionHead": "xoziZG_sectionHead",
|
|
238
257
|
"field": "xoziZG_field",
|
|
239
|
-
"
|
|
240
|
-
"
|
|
241
|
-
"
|
|
242
|
-
"
|
|
243
|
-
"
|
|
244
|
-
"
|
|
245
|
-
"tabPanel": "xoziZG_tabPanel",
|
|
246
|
-
"modelChart": "xoziZG_modelChart",
|
|
247
|
-
"usageBar": "xoziZG_usageBar",
|
|
248
|
-
"statSub": "xoziZG_statSub",
|
|
249
|
-
"heatAxisSlot": "xoziZG_heatAxisSlot"
|
|
258
|
+
"modelRow": "xoziZG_modelRow",
|
|
259
|
+
"doctorRow": "xoziZG_doctorRow",
|
|
260
|
+
"area": "xoziZG_area",
|
|
261
|
+
"link": "xoziZG_link",
|
|
262
|
+
"usageTipRow": "xoziZG_usageTipRow",
|
|
263
|
+
"heatHours": "xoziZG_heatHours"
|
|
250
264
|
};
|
|
251
265
|
//#endregion
|
|
252
266
|
//#region src/client/CodeArtsPluginCard.tsx
|
|
@@ -314,6 +328,37 @@ function formatWindow(tokens) {
|
|
|
314
328
|
if (tokens >= 1024) return `${Math.round(tokens / 1024)}K`;
|
|
315
329
|
return String(tokens);
|
|
316
330
|
}
|
|
331
|
+
/**
|
|
332
|
+
* 窗口滑块的刻度。
|
|
333
|
+
*
|
|
334
|
+
* 不按 token 线性拖动:8K 到 2M 线性铺开的话,前 90% 的行程都在 100K 以下,最该调
|
|
335
|
+
* 的那一段(目录标称 1M、实际只有 49 万)反而只有几像素。刻度按「人眼能分辨的档」摆,
|
|
336
|
+
* 输入框仍然可以填任意值。
|
|
337
|
+
*/
|
|
338
|
+
const WINDOW_STOPS = [
|
|
339
|
+
8192,
|
|
340
|
+
16384,
|
|
341
|
+
32768,
|
|
342
|
+
65536,
|
|
343
|
+
131072,
|
|
344
|
+
196608,
|
|
345
|
+
262144,
|
|
346
|
+
393216,
|
|
347
|
+
491520,
|
|
348
|
+
524288,
|
|
349
|
+
774e3,
|
|
350
|
+
1048576,
|
|
351
|
+
1572864,
|
|
352
|
+
2097152
|
|
353
|
+
];
|
|
354
|
+
/** 当前值落在哪个刻度上(不在刻度里就取最近的)。 */
|
|
355
|
+
function windowStopIndex(tokens) {
|
|
356
|
+
const fallback = WINDOW_STOPS.indexOf(1048576);
|
|
357
|
+
if (tokens === void 0 || !Number.isFinite(tokens) || tokens <= 0) return fallback;
|
|
358
|
+
let best = 0;
|
|
359
|
+
for (let i = 1; i < WINDOW_STOPS.length; i += 1) if (Math.abs(WINDOW_STOPS[i] - tokens) < Math.abs(WINDOW_STOPS[best] - tokens)) best = i;
|
|
360
|
+
return best;
|
|
361
|
+
}
|
|
317
362
|
/** 体检里一条检查的标题。账号级检查按 id 找回备注名,别让用户对着哈希猜。 */
|
|
318
363
|
function doctorCheckLabel(id, accounts, t) {
|
|
319
364
|
if (id.startsWith("account:")) {
|
|
@@ -1066,6 +1111,15 @@ function CodeArtsPluginCard({ t }) {
|
|
|
1066
1111
|
const [savingModels, setSavingModels] = (0, react.useState)(false);
|
|
1067
1112
|
const [savedModels, setSavedModels] = (0, react.useState)(false);
|
|
1068
1113
|
const [modelError, setModelError] = (0, react.useState)(null);
|
|
1114
|
+
/** 正在编辑的窗口值(拖动/输入过程中不提交,松手或失焦才写后端)。 */
|
|
1115
|
+
const [windowDrafts, setWindowDrafts] = (0, react.useState)({});
|
|
1116
|
+
/** 正在保存窗口的模型 id。 */
|
|
1117
|
+
const [windowSaving, setWindowSaving] = (0, react.useState)(null);
|
|
1118
|
+
const [windowError, setWindowError] = (0, react.useState)(null);
|
|
1119
|
+
/** 弹层展开的模型 id(同一时间只开一个,行内只留一个按钮)。 */
|
|
1120
|
+
const [windowOpenFor, setWindowOpenFor] = (0, react.useState)(null);
|
|
1121
|
+
/** 正在提交窗口值的模型 id(state 更新有延迟,去重用 ref)。 */
|
|
1122
|
+
const windowCommitInFlight = (0, react.useRef)(/* @__PURE__ */ new Set());
|
|
1069
1123
|
const [refreshing, setRefreshing] = (0, react.useState)(false);
|
|
1070
1124
|
const [refreshMsg, setRefreshMsg] = (0, react.useState)(null);
|
|
1071
1125
|
/** 正在实测的模型 id;同一时间只测一个,避免把上游并发槽位占满。 */
|
|
@@ -1279,6 +1333,30 @@ function CodeArtsPluginCard({ t }) {
|
|
|
1279
1333
|
(0, react.useEffect)(() => {
|
|
1280
1334
|
if (status?.status === "signed-in") refreshSelection();
|
|
1281
1335
|
}, [status?.status]);
|
|
1336
|
+
(0, react.useEffect)(() => {
|
|
1337
|
+
if (windowOpenFor === null) return;
|
|
1338
|
+
function onPointerDown(event) {
|
|
1339
|
+
const target = event.target;
|
|
1340
|
+
if (target instanceof Element && target.closest("[data-window-anchor]") !== null) return;
|
|
1341
|
+
closeWindow();
|
|
1342
|
+
}
|
|
1343
|
+
function onKeyDown(event) {
|
|
1344
|
+
if (event.key === "Escape") {
|
|
1345
|
+
event.stopPropagation();
|
|
1346
|
+
closeWindow();
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
document.addEventListener("click", onPointerDown);
|
|
1350
|
+
document.addEventListener("keydown", onKeyDown);
|
|
1351
|
+
return () => {
|
|
1352
|
+
document.removeEventListener("click", onPointerDown);
|
|
1353
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
1354
|
+
};
|
|
1355
|
+
}, [
|
|
1356
|
+
windowOpenFor,
|
|
1357
|
+
windowDrafts,
|
|
1358
|
+
selection
|
|
1359
|
+
]);
|
|
1282
1360
|
async function saveToken(e) {
|
|
1283
1361
|
e.preventDefault();
|
|
1284
1362
|
setBusy(true);
|
|
@@ -1406,6 +1484,95 @@ function CodeArtsPluginCard({ t }) {
|
|
|
1406
1484
|
setSavingModels(false);
|
|
1407
1485
|
}
|
|
1408
1486
|
}
|
|
1487
|
+
/** 输入框里该显示的窗口值:编辑中优先显示草稿,否则显示服务端生效值。 */
|
|
1488
|
+
function windowValueText(choice) {
|
|
1489
|
+
const draft = windowDrafts[choice.id];
|
|
1490
|
+
if (draft !== void 0) return draft;
|
|
1491
|
+
const value = choice.contextWindowOverride ?? choice.contextWindow;
|
|
1492
|
+
return value === void 0 ? "" : String(value);
|
|
1493
|
+
}
|
|
1494
|
+
function windowNumberValue(choice) {
|
|
1495
|
+
const parsed = Number(windowValueText(choice));
|
|
1496
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : void 0;
|
|
1497
|
+
}
|
|
1498
|
+
function setWindowDraft(id, value) {
|
|
1499
|
+
setWindowDrafts((current) => ({
|
|
1500
|
+
...current,
|
|
1501
|
+
[id]: value
|
|
1502
|
+
}));
|
|
1503
|
+
}
|
|
1504
|
+
function clearWindowDraft(id) {
|
|
1505
|
+
setWindowDrafts((current) => {
|
|
1506
|
+
if (!(id in current)) return current;
|
|
1507
|
+
const next = { ...current };
|
|
1508
|
+
delete next[id];
|
|
1509
|
+
return next;
|
|
1510
|
+
});
|
|
1511
|
+
}
|
|
1512
|
+
/**
|
|
1513
|
+
* 提交一个模型的窗口值(滑块松手、回车、收起弹层都走这里)。
|
|
1514
|
+
*
|
|
1515
|
+
* 空值 / 非法值 / 填回上游标称值 = 删除覆盖。这样不需要额外的「重置」按钮 ——
|
|
1516
|
+
* 清空就是重置,和 Qoder 那种「跟随默认」是一个意思,只是少一次点击。
|
|
1517
|
+
*/
|
|
1518
|
+
async function commitWindow(choice, raw) {
|
|
1519
|
+
if (windowCommitInFlight.current.has(choice.id)) return;
|
|
1520
|
+
const base = choice.contextWindowDiscovered ?? choice.contextWindow;
|
|
1521
|
+
const text = raw.trim();
|
|
1522
|
+
let target = null;
|
|
1523
|
+
if (text !== "") {
|
|
1524
|
+
const parsed = Math.floor(Number(text));
|
|
1525
|
+
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
1526
|
+
clearWindowDraft(choice.id);
|
|
1527
|
+
return;
|
|
1528
|
+
}
|
|
1529
|
+
target = base !== void 0 && parsed === base ? null : parsed;
|
|
1530
|
+
}
|
|
1531
|
+
const before = choice.contextWindowOverride ?? null;
|
|
1532
|
+
if (target === before) {
|
|
1533
|
+
clearWindowDraft(choice.id);
|
|
1534
|
+
return;
|
|
1535
|
+
}
|
|
1536
|
+
windowCommitInFlight.current.add(choice.id);
|
|
1537
|
+
setWindowSaving(choice.id);
|
|
1538
|
+
setWindowError(null);
|
|
1539
|
+
try {
|
|
1540
|
+
const res = await fetch("/api/codearts/context-window", {
|
|
1541
|
+
method: "POST",
|
|
1542
|
+
headers: {
|
|
1543
|
+
"Content-Type": "application/json",
|
|
1544
|
+
Accept: "application/json"
|
|
1545
|
+
},
|
|
1546
|
+
body: JSON.stringify({
|
|
1547
|
+
id: choice.id,
|
|
1548
|
+
window: target
|
|
1549
|
+
})
|
|
1550
|
+
});
|
|
1551
|
+
const data = await res.json().catch(() => null);
|
|
1552
|
+
if (!res.ok) throw new Error(data?.error ?? `HTTP ${res.status}`);
|
|
1553
|
+
if (data !== null && data.selection !== void 0) setSelection(data.selection);
|
|
1554
|
+
} catch (err) {
|
|
1555
|
+
setWindowError(err instanceof Error ? err.message : String(err));
|
|
1556
|
+
} finally {
|
|
1557
|
+
clearWindowDraft(choice.id);
|
|
1558
|
+
windowCommitInFlight.current.delete(choice.id);
|
|
1559
|
+
setWindowSaving(null);
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
/**
|
|
1563
|
+
* 收起弹层;输入框里还有没提交的草稿就先提交。
|
|
1564
|
+
*
|
|
1565
|
+
* 不靠输入框 onBlur 提交:点外面收起时输入框会被卸载,blur 未必来得及触发,
|
|
1566
|
+
* 用户刚敲的数字就白丢了。收起是唯一的「提交时机」,逻辑放一处就不会漏。
|
|
1567
|
+
*/
|
|
1568
|
+
function closeWindow() {
|
|
1569
|
+
const id = windowOpenFor;
|
|
1570
|
+
setWindowOpenFor(null);
|
|
1571
|
+
if (id === null) return;
|
|
1572
|
+
const draft = windowDrafts[id];
|
|
1573
|
+
const choice = (selection?.choices ?? []).find((entry) => entry.id === id);
|
|
1574
|
+
if (draft !== void 0 && choice !== void 0) commitWindow(choice, draft);
|
|
1575
|
+
}
|
|
1409
1576
|
/**
|
|
1410
1577
|
* 实测某个模型现在能不能调用。
|
|
1411
1578
|
*
|
|
@@ -1710,14 +1877,14 @@ function CodeArtsPluginCard({ t }) {
|
|
|
1710
1877
|
className: CodeArtsPluginCard_module_css_default.accountToolbar,
|
|
1711
1878
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
1712
1879
|
variant: "outline",
|
|
1713
|
-
size: "
|
|
1880
|
+
size: "md",
|
|
1714
1881
|
"aria-expanded": manualOpen,
|
|
1715
1882
|
disabled: busy,
|
|
1716
1883
|
onClick: () => setManualOpen((open) => !open),
|
|
1717
1884
|
children: t("pasteTokenAdd")
|
|
1718
1885
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
1719
1886
|
variant: "primary",
|
|
1720
|
-
size: "
|
|
1887
|
+
size: "md",
|
|
1721
1888
|
disabled: busy || loginPending,
|
|
1722
1889
|
onClick: () => void startOAuthLogin(),
|
|
1723
1890
|
children: loginPending ? t("signingIn") : t("addAccount")
|
|
@@ -1930,16 +2097,87 @@ function CodeArtsPluginCard({ t }) {
|
|
|
1930
2097
|
onChange: (on) => setModel(choice.id, on),
|
|
1931
2098
|
label: modelName(choice)
|
|
1932
2099
|
}),
|
|
1933
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
1934
|
-
className: CodeArtsPluginCard_module_css_default.
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
2100
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2101
|
+
className: CodeArtsPluginCard_module_css_default.windowAnchor,
|
|
2102
|
+
"data-window-anchor": true,
|
|
2103
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
2104
|
+
type: "button",
|
|
2105
|
+
className: [
|
|
2106
|
+
CodeArtsPluginCard_module_css_default.windowButton,
|
|
2107
|
+
windowOpenFor === choice.id ? CodeArtsPluginCard_module_css_default.windowButtonOpen : "",
|
|
2108
|
+
choice.contextWindowOverride === void 0 ? "" : CodeArtsPluginCard_module_css_default.windowButtonSet
|
|
2109
|
+
].filter(Boolean).join(" "),
|
|
2110
|
+
"aria-expanded": windowOpenFor === choice.id,
|
|
2111
|
+
"aria-label": t("modelWindowLabel", { model: modelName(choice) }),
|
|
2112
|
+
title: t("modelWindowTitle", {
|
|
2113
|
+
model: modelName(choice),
|
|
2114
|
+
value: formatWindow(choice.contextWindowDiscovered ?? choice.contextWindow)
|
|
2115
|
+
}),
|
|
2116
|
+
onClick: () => setWindowOpenFor((current) => current === choice.id ? null : choice.id),
|
|
2117
|
+
children: [t("modelSpec", {
|
|
2118
|
+
context: formatWindow(windowNumberValue(choice)),
|
|
2119
|
+
output: formatWindow(choice.maxTokens)
|
|
2120
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2121
|
+
className: CodeArtsPluginCard_module_css_default.windowCaret,
|
|
2122
|
+
"aria-hidden": "true",
|
|
2123
|
+
children: "▾"
|
|
2124
|
+
})]
|
|
2125
|
+
}), windowOpenFor === choice.id && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2126
|
+
className: CodeArtsPluginCard_module_css_default.windowPopover,
|
|
2127
|
+
role: "dialog",
|
|
2128
|
+
"aria-label": t("modelWindowLabel", { model: modelName(choice) }),
|
|
2129
|
+
children: [
|
|
2130
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2131
|
+
className: CodeArtsPluginCard_module_css_default.windowPopoverHead,
|
|
2132
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("modelWindowHeading") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2133
|
+
className: CodeArtsPluginCard_module_css_default.windowPopoverValue,
|
|
2134
|
+
children: windowValueText(choice) || "—"
|
|
2135
|
+
})]
|
|
2136
|
+
}),
|
|
2137
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2138
|
+
type: "range",
|
|
2139
|
+
className: CodeArtsPluginCard_module_css_default.windowRange,
|
|
2140
|
+
min: 0,
|
|
2141
|
+
max: WINDOW_STOPS.length - 1,
|
|
2142
|
+
step: 1,
|
|
2143
|
+
value: windowStopIndex(windowNumberValue(choice)),
|
|
2144
|
+
"aria-label": t("modelWindowLabel", { model: modelName(choice) }),
|
|
2145
|
+
disabled: !selection.writable || windowSaving === choice.id,
|
|
2146
|
+
onChange: (e) => setWindowDraft(choice.id, String(WINDOW_STOPS[Number(e.target.value)] ?? "")),
|
|
2147
|
+
onPointerUp: (e) => void commitWindow(choice, String(WINDOW_STOPS[Number(e.currentTarget.value)] ?? "")),
|
|
2148
|
+
onKeyUp: (e) => void commitWindow(choice, String(WINDOW_STOPS[Number(e.currentTarget.value)] ?? ""))
|
|
2149
|
+
}),
|
|
2150
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2151
|
+
className: CodeArtsPluginCard_module_css_default.windowPopoverRow,
|
|
2152
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2153
|
+
type: "number",
|
|
2154
|
+
className: choice.contextWindowOverride === void 0 ? CodeArtsPluginCard_module_css_default.windowInput : `${CodeArtsPluginCard_module_css_default.windowInput} ${CodeArtsPluginCard_module_css_default.windowInputSet}`,
|
|
2155
|
+
value: windowValueText(choice),
|
|
2156
|
+
min: 1,
|
|
2157
|
+
step: 1024,
|
|
2158
|
+
inputMode: "numeric",
|
|
2159
|
+
autoFocus: true,
|
|
2160
|
+
placeholder: t("modelWindowFollow"),
|
|
2161
|
+
"aria-label": t("modelWindowLabel", { model: modelName(choice) }),
|
|
2162
|
+
disabled: !selection.writable || windowSaving === choice.id,
|
|
2163
|
+
onChange: (e) => setWindowDraft(choice.id, e.target.value),
|
|
2164
|
+
onKeyDown: (e) => {
|
|
2165
|
+
if (e.key === "Enter") {
|
|
2166
|
+
e.preventDefault();
|
|
2167
|
+
closeWindow();
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2171
|
+
className: CodeArtsPluginCard_module_css_default.windowUnit,
|
|
2172
|
+
children: "tokens"
|
|
2173
|
+
})]
|
|
2174
|
+
}),
|
|
2175
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2176
|
+
className: CodeArtsPluginCard_module_css_default.windowHint,
|
|
2177
|
+
children: t("modelWindowHint", { value: formatWindow(choice.contextWindowDiscovered ?? choice.contextWindow) })
|
|
2178
|
+
})
|
|
2179
|
+
]
|
|
2180
|
+
})]
|
|
1943
2181
|
}),
|
|
1944
2182
|
choice.benefit === true && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tag, {
|
|
1945
2183
|
tone: choice.blocked === true ? "warning" : "success",
|
|
@@ -2002,6 +2240,10 @@ function CodeArtsPluginCard({ t }) {
|
|
|
2002
2240
|
modelError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2003
2241
|
className: CodeArtsPluginCard_module_css_default.error,
|
|
2004
2242
|
children: modelError
|
|
2243
|
+
}),
|
|
2244
|
+
windowError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2245
|
+
className: CodeArtsPluginCard_module_css_default.error,
|
|
2246
|
+
children: windowError
|
|
2005
2247
|
})
|
|
2006
2248
|
]
|
|
2007
2249
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
@@ -2945,14 +3187,14 @@ if (typeof document !== "undefined" && document.querySelector("style[data-plugin
|
|
|
2945
3187
|
document.head.appendChild(tag);
|
|
2946
3188
|
}
|
|
2947
3189
|
var CodeArtsPanel_module_css_default = {
|
|
2948
|
-
"icon": "Z66cgG_icon",
|
|
2949
|
-
"desc": "Z66cgG_desc",
|
|
2950
|
-
"back": "Z66cgG_back",
|
|
2951
|
-
"backCaret": "Z66cgG_backCaret",
|
|
2952
3190
|
"page": "Z66cgG_page",
|
|
2953
3191
|
"body": "Z66cgG_body",
|
|
3192
|
+
"back": "Z66cgG_back",
|
|
3193
|
+
"icon": "Z66cgG_icon",
|
|
3194
|
+
"desc": "Z66cgG_desc",
|
|
3195
|
+
"title": "Z66cgG_title",
|
|
2954
3196
|
"head": "Z66cgG_head",
|
|
2955
|
-
"
|
|
3197
|
+
"backCaret": "Z66cgG_backCaret"
|
|
2956
3198
|
};
|
|
2957
3199
|
//#endregion
|
|
2958
3200
|
//#region src/client/CodeArtsPanel.tsx
|
|
@@ -3192,6 +3434,11 @@ const zh = {
|
|
|
3192
3434
|
usageStatLatencyEmpty: "还没有成功请求",
|
|
3193
3435
|
modelSpec: "{context} 上下文 · {output} 输出",
|
|
3194
3436
|
modelSpecTitle: "上游返回的上下文窗口 {context} token,最大输出 {output} token",
|
|
3437
|
+
modelWindowLabel: "设置 {model} 的上下文窗口",
|
|
3438
|
+
modelWindowTitle: "上下文窗口:上游标称 {value} token。点击可拖动滑块或直接输入",
|
|
3439
|
+
modelWindowHeading: "上下文窗口",
|
|
3440
|
+
modelWindowFollow: "跟随上游",
|
|
3441
|
+
modelWindowHint: "上游标称 {value}。拖动或输入后立即生效;清空或填回标称值 = 跟随上游",
|
|
3195
3442
|
accountPaused: "已暂停",
|
|
3196
3443
|
accountPinned: "已置顶",
|
|
3197
3444
|
accountEnabled: "启用",
|
|
@@ -3280,7 +3527,7 @@ const zh = {
|
|
|
3280
3527
|
displayKeeperToggle: "开启常驻保活进程(默认关闭)",
|
|
3281
3528
|
displayKeeperRunning: "后台进程运行中 · PID {pid} · 最近心跳 {time}",
|
|
3282
3529
|
displayKeeperStarting: "后台进程正在启动……稍等几秒刷新这一页。",
|
|
3283
|
-
displayKeeperDown: "
|
|
3530
|
+
displayKeeperDown: "后台进程没有在跑(可能被你结束、为更新让路或启动失败)。{message}",
|
|
3284
3531
|
displayKeeperStop: "结束进程",
|
|
3285
3532
|
displayKeeperStopping: "正在结束……",
|
|
3286
3533
|
displayKeeperStopped: "后台进程已结束,保活开关已同时关闭。",
|
|
@@ -3399,6 +3646,11 @@ const en = {
|
|
|
3399
3646
|
usageStatLatencyEmpty: "No successful request yet",
|
|
3400
3647
|
modelSpec: "{context} ctx · {output} out",
|
|
3401
3648
|
modelSpecTitle: "Context window {context} tokens, max output {output} tokens reported upstream",
|
|
3649
|
+
modelWindowLabel: "Set the context window for {model}",
|
|
3650
|
+
modelWindowTitle: "Context window: upstream reports {value} tokens. Click to drag the slider or type a value",
|
|
3651
|
+
modelWindowHeading: "Context window",
|
|
3652
|
+
modelWindowFollow: "Follow upstream",
|
|
3653
|
+
modelWindowHint: "Upstream reports {value}. Changes apply immediately; clear the field or type the upstream value to follow it",
|
|
3402
3654
|
accountPaused: "Paused",
|
|
3403
3655
|
accountPinned: "Pinned",
|
|
3404
3656
|
accountEnabled: "Enabled",
|
|
@@ -3487,7 +3739,7 @@ const en = {
|
|
|
3487
3739
|
displayKeeperToggle: "Run the keep-alive background process (off by default)",
|
|
3488
3740
|
displayKeeperRunning: "Background process running · PID {pid} · last heartbeat {time}",
|
|
3489
3741
|
displayKeeperStarting: "The background process is starting… refresh this page in a few seconds.",
|
|
3490
|
-
displayKeeperDown: "The background process is not running (stopped by you, or it failed to start)
|
|
3742
|
+
displayKeeperDown: "The background process is not running (stopped by you, stepped aside for an update, or it failed to start). {message}",
|
|
3491
3743
|
displayKeeperStop: "Stop process",
|
|
3492
3744
|
displayKeeperStopping: "Stopping…",
|
|
3493
3745
|
displayKeeperStopped: "Background process stopped and the keep-alive switch turned off.",
|