dsh-codearts 1.4.8 → 1.4.10
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 +32 -0
- package/README.en.md +9 -0
- package/README.md +7 -0
- package/lib/{auth-BRlNY6dB.mjs → auth-BaxN0iKC.mjs} +1 -1
- package/lib/bin.mjs +3 -3
- package/lib/client/index.d.cts +8 -0
- package/lib/client/index.js +469 -119
- package/lib/index.d.mts +67 -3
- package/lib/index.mjs +342 -25
- package/lib/keeper-main.mjs +1 -1
- package/lib/{upstream-CgQXomCI.mjs → upstream-BX6-klXI.mjs} +137 -9
- package/lib/{version-qgKLf1Cq.mjs → version-CUnRcNkz.mjs} +3 -3
- package/package.json +1 -1
package/lib/client/index.js
CHANGED
|
@@ -92,38 +92,76 @@ const DEFAULT_DOCK_FLAGS = {
|
|
|
92
92
|
*
|
|
93
93
|
* @module dsh-codearts/client/dock-store
|
|
94
94
|
*/
|
|
95
|
-
let snapshot = {
|
|
95
|
+
let snapshot$1 = {
|
|
96
96
|
dock: DEFAULT_DOCK_FLAGS,
|
|
97
97
|
writable: false,
|
|
98
98
|
loaded: false
|
|
99
99
|
};
|
|
100
|
-
const listeners = /* @__PURE__ */ new Set();
|
|
100
|
+
const listeners$1 = /* @__PURE__ */ new Set();
|
|
101
101
|
function dockSnapshot() {
|
|
102
|
-
return snapshot;
|
|
102
|
+
return snapshot$1;
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
105
|
* 写入新值。`patch.dock` 只给变化的键也行:缺省键用 DEFAULT_DOCK_FLAGS 补齐,
|
|
106
106
|
* 老后端少字段时不会把已经打开的开关注销成 undefined。
|
|
107
107
|
*/
|
|
108
108
|
function publishDock(patch) {
|
|
109
|
-
const dock = patch.dock === void 0 ? snapshot.dock : {
|
|
109
|
+
const dock = patch.dock === void 0 ? snapshot$1.dock : {
|
|
110
110
|
...DEFAULT_DOCK_FLAGS,
|
|
111
111
|
...patch.dock
|
|
112
112
|
};
|
|
113
|
-
const writable = patch.writable ?? snapshot.writable;
|
|
114
|
-
if (dock === snapshot.dock && writable === snapshot.writable && snapshot.loaded) return;
|
|
115
|
-
snapshot = {
|
|
113
|
+
const writable = patch.writable ?? snapshot$1.writable;
|
|
114
|
+
if (dock === snapshot$1.dock && writable === snapshot$1.writable && snapshot$1.loaded) return;
|
|
115
|
+
snapshot$1 = {
|
|
116
116
|
dock,
|
|
117
117
|
writable,
|
|
118
118
|
loaded: true
|
|
119
119
|
};
|
|
120
|
-
for (const listener of [...listeners]) try {
|
|
120
|
+
for (const listener of [...listeners$1]) try {
|
|
121
121
|
listener();
|
|
122
122
|
} catch (error) {
|
|
123
123
|
console.error("[dsh-codearts] dock-store listener failed:", error);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
function subscribeDock(listener) {
|
|
127
|
+
listeners$1.add(listener);
|
|
128
|
+
return () => {
|
|
129
|
+
listeners$1.delete(listener);
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/client/concurrency-store.ts
|
|
134
|
+
let snapshot = {
|
|
135
|
+
default: 2,
|
|
136
|
+
caps: {},
|
|
137
|
+
writable: false,
|
|
138
|
+
loaded: false
|
|
139
|
+
};
|
|
140
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
141
|
+
function concurrencySnapshot() {
|
|
142
|
+
return snapshot;
|
|
143
|
+
}
|
|
144
|
+
function publishConcurrency(patch) {
|
|
145
|
+
const next = {
|
|
146
|
+
default: patch.default ?? snapshot.default,
|
|
147
|
+
caps: patch.caps ?? snapshot.caps,
|
|
148
|
+
writable: patch.writable ?? snapshot.writable,
|
|
149
|
+
loaded: true
|
|
150
|
+
};
|
|
151
|
+
if (next.default === snapshot.default && next.writable === snapshot.writable && snapshot.loaded && sameCaps(next.caps, snapshot.caps)) return;
|
|
152
|
+
snapshot = next;
|
|
153
|
+
for (const listener of [...listeners]) try {
|
|
154
|
+
listener();
|
|
155
|
+
} catch (error) {
|
|
156
|
+
console.error("[dsh-codearts] concurrency-store listener failed:", error);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function sameCaps(a, b) {
|
|
160
|
+
const keys = Object.keys(a);
|
|
161
|
+
if (keys.length !== Object.keys(b).length) return false;
|
|
162
|
+
return keys.every((key) => a[key] === b[key]);
|
|
163
|
+
}
|
|
164
|
+
function subscribeConcurrency(listener) {
|
|
127
165
|
listeners.add(listener);
|
|
128
166
|
return () => {
|
|
129
167
|
listeners.delete(listener);
|
|
@@ -146,7 +184,7 @@ function latencyP95Label(latency) {
|
|
|
146
184
|
}
|
|
147
185
|
//#endregion
|
|
148
186
|
//#region \0dsh-css:/home/runner/work/dsh-codearts/dsh-codearts/src/client/CodeArtsPluginCard.module.css.mjs
|
|
149
|
-
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_accountGrid{grid-template-columns:repeat(auto-fit,minmax(320px,1fr));align-items:start;gap:10px;display:grid}.xoziZG_accountGrid>*{min-width:0}.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;display:inline-flex}.xoziZG_accountHint{color:var(--dsw-alias-label-tertiary);margin:0;padding:0 12px 12px;font-size:12px;line-height:18px}.xoziZG_accountMenuAnchor{display:inline-flex;position:relative}.xoziZG_accountMenu{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;min-width:132px;padding:4px;display:flex;position:absolute;top:calc(100% + 4px);right:0;box-shadow:0 6px 20px #0000002e}.xoziZG_accountMenuItem{appearance:none;text-align:left;border-radius:var(--dsw-radius-sm);font:inherit;color:var(--dsw-alias-label-primary);cursor:pointer;background:0 0;border:0;padding:7px 10px;font-size:12px;line-height:18px}.xoziZG_accountMenuItem:hover{background:var(--dsw-alias-interactive-bg-hover)}.xoziZG_accountClear{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;margin-top:12px;display:flex}.xoziZG_accountClearHint{min-width:200px;color:var(--dsw-alias-label-tertiary);flex:1;margin:0;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_groupHead{border-top:.5px solid var(--dsw-alias-border-l2);align-items:baseline;gap:8px;margin-top:24px;padding-top:12px;display:flex}.xoziZG_groupHeadFirst{border-top:none;padding-top:0}.xoziZG_groupLabel{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:600}.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_choiceTail{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:6px;margin-left:auto;display:inline-flex}.xoziZG_modelMeta{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.xoziZG_choiceRow{border-radius:var(--dsw-radius-sm);flex-wrap:wrap;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;position:relative}.xoziZG_modelCheck{flex:0 auto}.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}";
|
|
187
|
+
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_accountGrid{grid-template-columns:repeat(auto-fit,minmax(320px,1fr));align-items:start;gap:10px;display:grid}.xoziZG_accountGrid>*{min-width:0}.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;display:inline-flex}.xoziZG_accountHint{color:var(--dsw-alias-label-tertiary);margin:0;padding:0 12px 12px;font-size:12px;line-height:18px}.xoziZG_accountMenuAnchor{display:inline-flex;position:relative}.xoziZG_accountMenu{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;min-width:132px;padding:4px;display:flex;position:absolute;top:calc(100% + 4px);right:0;box-shadow:0 6px 20px #0000002e}.xoziZG_accountMenuItem{appearance:none;text-align:left;border-radius:var(--dsw-radius-sm);font:inherit;color:var(--dsw-alias-label-primary);cursor:pointer;background:0 0;border:0;padding:7px 10px;font-size:12px;line-height:18px}.xoziZG_accountMenuItem:hover{background:var(--dsw-alias-interactive-bg-hover)}.xoziZG_accountClear{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;margin-top:12px;display:flex}.xoziZG_accountClearHint{min-width:200px;color:var(--dsw-alias-label-tertiary);flex:1;margin:0;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_groupHead{border-top:.5px solid var(--dsw-alias-border-l2);align-items:baseline;gap:8px;margin-top:24px;padding-top:12px;display:flex}.xoziZG_groupHeadFirst{border-top:none;padding-top:0}.xoziZG_groupLabel{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:600}.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_choiceTail{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:6px;margin-left:auto;display:inline-flex}.xoziZG_modelMeta{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-variant-numeric:tabular-nums;font-size:11px;line-height:16px}.xoziZG_choiceRow{border-radius:var(--dsw-radius-sm);flex-wrap:wrap;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;position:relative}.xoziZG_modelCheck{flex:0 auto}.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_windowSection{border-top:.5px solid var(--dsw-alias-border-l2);flex-direction:column;gap:8px;padding-top:8px;display:flex}.xoziZG_accountConcurrencyInline{align-items:center;gap:6px;margin-top:2px;display:inline-flex}.xoziZG_accountConcurrencyLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.xoziZG_concurrencyStepper{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);align-items:center;display:inline-flex;overflow:hidden}.xoziZG_concurrencyButton{width:24px;height:20px;font:inherit;color:var(--dsw-alias-label-primary);cursor:pointer;background:0 0;border:none;padding:0;font-size:13px;line-height:1}.xoziZG_concurrencyButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.xoziZG_concurrencyButton:disabled{opacity:.4;cursor:not-allowed}.xoziZG_concurrencyValue{text-align:center;font-variant-numeric:tabular-nums;min-width:20px;color:var(--dsw-alias-label-primary);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}";
|
|
150
188
|
const tagId$1 = "dsh-codearts/CodeArtsPluginCard.module.css";
|
|
151
189
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
|
|
152
190
|
const tag = document.createElement("style");
|
|
@@ -156,123 +194,129 @@ if (typeof document !== "undefined" && document.querySelector("style[data-plugin
|
|
|
156
194
|
document.head.appendChild(tag);
|
|
157
195
|
}
|
|
158
196
|
var CodeArtsPluginCard_module_css_default = {
|
|
159
|
-
"
|
|
160
|
-
"
|
|
161
|
-
"
|
|
162
|
-
"windowHint": "xoziZG_windowHint",
|
|
163
|
-
"manualSummary": "xoziZG_manualSummary",
|
|
164
|
-
"balance": "xoziZG_balance",
|
|
165
|
-
"modelMeta": "xoziZG_modelMeta",
|
|
166
|
-
"manualForm": "xoziZG_manualForm",
|
|
167
|
-
"windowInput": "xoziZG_windowInput",
|
|
168
|
-
"windowButtonOpen": "xoziZG_windowButtonOpen",
|
|
169
|
-
"groupLabel": "xoziZG_groupLabel",
|
|
170
|
-
"tabPanel": "xoziZG_tabPanel",
|
|
197
|
+
"creditRow": "xoziZG_creditRow",
|
|
198
|
+
"manual": "xoziZG_manual",
|
|
199
|
+
"trendTip": "xoziZG_trendTip",
|
|
171
200
|
"choiceTail": "xoziZG_choiceTail",
|
|
201
|
+
"skeletonRow": "xoziZG_skeletonRow",
|
|
202
|
+
"windowUnit": "xoziZG_windowUnit",
|
|
203
|
+
"modelRow": "xoziZG_modelRow",
|
|
204
|
+
"balanceUnit": "xoziZG_balanceUnit",
|
|
172
205
|
"modelFill": "xoziZG_modelFill",
|
|
173
|
-
"
|
|
206
|
+
"statLabel": "xoziZG_statLabel",
|
|
207
|
+
"bar": "xoziZG_bar",
|
|
174
208
|
"area": "xoziZG_area",
|
|
175
|
-
"
|
|
176
|
-
"
|
|
177
|
-
"
|
|
178
|
-
"
|
|
179
|
-
"
|
|
180
|
-
"
|
|
181
|
-
"choiceRow": "xoziZG_choiceRow",
|
|
209
|
+
"count": "xoziZG_count",
|
|
210
|
+
"usageFill": "xoziZG_usageFill",
|
|
211
|
+
"accountConcurrencyInline": "xoziZG_accountConcurrencyInline",
|
|
212
|
+
"concurrencyValue": "xoziZG_concurrencyValue",
|
|
213
|
+
"heatCell": "xoziZG_heatCell",
|
|
214
|
+
"accountConcurrencyLabel": "xoziZG_accountConcurrencyLabel",
|
|
182
215
|
"usageTipSep": "xoziZG_usageTipSep",
|
|
183
|
-
"
|
|
184
|
-
"
|
|
216
|
+
"heatHours": "xoziZG_heatHours",
|
|
217
|
+
"tabs": "xoziZG_tabs",
|
|
218
|
+
"accountMenu": "xoziZG_accountMenu",
|
|
219
|
+
"modelRequests": "xoziZG_modelRequests",
|
|
220
|
+
"windowButton": "xoziZG_windowButton",
|
|
221
|
+
"windowPopoverRow": "xoziZG_windowPopoverRow",
|
|
222
|
+
"skeleton": "xoziZG_skeleton",
|
|
223
|
+
"tabPanel": "xoziZG_tabPanel",
|
|
224
|
+
"manualSummary": "xoziZG_manualSummary",
|
|
225
|
+
"windowPopoverHead": "xoziZG_windowPopoverHead",
|
|
226
|
+
"name": "xoziZG_name",
|
|
227
|
+
"header": "xoziZG_header",
|
|
228
|
+
"desc": "xoziZG_desc",
|
|
229
|
+
"accountMenuAnchor": "xoziZG_accountMenuAnchor",
|
|
230
|
+
"expiryRow": "xoziZG_expiryRow",
|
|
231
|
+
"doctorList": "xoziZG_doctorList",
|
|
232
|
+
"statGrid": "xoziZG_statGrid",
|
|
233
|
+
"accountInfo": "xoziZG_accountInfo",
|
|
234
|
+
"body": "xoziZG_body",
|
|
235
|
+
"manualForm": "xoziZG_manualForm",
|
|
236
|
+
"windowPopover": "xoziZG_windowPopover",
|
|
237
|
+
"card": "xoziZG_card",
|
|
238
|
+
"heatLegendChip": "xoziZG_heatLegendChip",
|
|
239
|
+
"doctorRow": "xoziZG_doctorRow",
|
|
240
|
+
"modelMeta": "xoziZG_modelMeta",
|
|
241
|
+
"heatAxisSlot": "xoziZG_heatAxisSlot",
|
|
242
|
+
"modelTrack": "xoziZG_modelTrack",
|
|
243
|
+
"windowButtonOpen": "xoziZG_windowButtonOpen",
|
|
244
|
+
"creditLink": "xoziZG_creditLink",
|
|
185
245
|
"balanceMeta": "xoziZG_balanceMeta",
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
"
|
|
246
|
+
"statCard": "xoziZG_statCard",
|
|
247
|
+
"statValue": "xoziZG_statValue",
|
|
248
|
+
"modelCheck": "xoziZG_modelCheck",
|
|
249
|
+
"creditFooter": "xoziZG_creditFooter",
|
|
250
|
+
"link": "xoziZG_link",
|
|
251
|
+
"accountCard": "xoziZG_accountCard",
|
|
252
|
+
"groupHead": "xoziZG_groupHead",
|
|
253
|
+
"accountRow": "xoziZG_accountRow",
|
|
254
|
+
"creditRows": "xoziZG_creditRows",
|
|
189
255
|
"statusLine": "xoziZG_statusLine",
|
|
190
|
-
"
|
|
191
|
-
"
|
|
256
|
+
"windowInput": "xoziZG_windowInput",
|
|
257
|
+
"concurrencyButton": "xoziZG_concurrencyButton",
|
|
258
|
+
"windowAnchor": "xoziZG_windowAnchor",
|
|
259
|
+
"groupHeadFirst": "xoziZG_groupHeadFirst",
|
|
260
|
+
"sectionHead": "xoziZG_sectionHead",
|
|
192
261
|
"modelTokens": "xoziZG_modelTokens",
|
|
262
|
+
"headText": "xoziZG_headText",
|
|
263
|
+
"creditBlock": "xoziZG_creditBlock",
|
|
264
|
+
"heatHourCell": "xoziZG_heatHourCell",
|
|
265
|
+
"modelShare": "xoziZG_modelShare",
|
|
266
|
+
"error": "xoziZG_error",
|
|
267
|
+
"balance": "xoziZG_balance",
|
|
268
|
+
"actions": "xoziZG_actions",
|
|
269
|
+
"choiceRow": "xoziZG_choiceRow",
|
|
193
270
|
"accountHint": "xoziZG_accountHint",
|
|
194
|
-
"modelRow": "xoziZG_modelRow",
|
|
195
|
-
"accountNameRow": "xoziZG_accountNameRow",
|
|
196
|
-
"creditHint": "xoziZG_creditHint",
|
|
197
|
-
"creditRows": "xoziZG_creditRows",
|
|
198
|
-
"avatar": "xoziZG_avatar",
|
|
199
|
-
"modelTrack": "xoziZG_modelTrack",
|
|
200
|
-
"statSub": "xoziZG_statSub",
|
|
201
|
-
"doctorRow": "xoziZG_doctorRow",
|
|
202
|
-
"check": "xoziZG_check",
|
|
203
|
-
"windowCaret": "xoziZG_windowCaret",
|
|
204
271
|
"usageTip": "xoziZG_usageTip",
|
|
205
|
-
"
|
|
206
|
-
"
|
|
272
|
+
"windowButtonSet": "xoziZG_windowButtonSet",
|
|
273
|
+
"windowHint": "xoziZG_windowHint",
|
|
274
|
+
"hint": "xoziZG_hint",
|
|
275
|
+
"danger": "xoziZG_danger",
|
|
276
|
+
"sectionLabel": "xoziZG_sectionLabel",
|
|
277
|
+
"usageTipRow": "xoziZG_usageTipRow",
|
|
278
|
+
"field": "xoziZG_field",
|
|
279
|
+
"doctorName": "xoziZG_doctorName",
|
|
280
|
+
"groupLabel": "xoziZG_groupLabel",
|
|
207
281
|
"windowRange": "xoziZG_windowRange",
|
|
208
|
-
"
|
|
209
|
-
"
|
|
210
|
-
"
|
|
282
|
+
"claimAllRow": "xoziZG_claimAllRow",
|
|
283
|
+
"accountClearHint": "xoziZG_accountClearHint",
|
|
284
|
+
"section": "xoziZG_section",
|
|
285
|
+
"accountToggle": "xoziZG_accountToggle",
|
|
286
|
+
"meta": "xoziZG_meta",
|
|
211
287
|
"accountEntry": "xoziZG_accountEntry",
|
|
212
|
-
"windowPopoverHead": "xoziZG_windowPopoverHead",
|
|
213
|
-
"tabs": "xoziZG_tabs",
|
|
214
|
-
"actions": "xoziZG_actions",
|
|
215
|
-
"modelShare": "xoziZG_modelShare",
|
|
216
|
-
"windowPopoverRow": "xoziZG_windowPopoverRow",
|
|
217
|
-
"creditLink": "xoziZG_creditLink",
|
|
218
288
|
"heatWeekday": "xoziZG_heatWeekday",
|
|
219
|
-
"
|
|
220
|
-
"
|
|
221
|
-
"
|
|
222
|
-
"
|
|
223
|
-
"
|
|
224
|
-
"
|
|
225
|
-
"
|
|
289
|
+
"expiryLabel": "xoziZG_expiryLabel",
|
|
290
|
+
"accountToolbar": "xoziZG_accountToolbar",
|
|
291
|
+
"creditHint": "xoziZG_creditHint",
|
|
292
|
+
"heatAxis": "xoziZG_heatAxis",
|
|
293
|
+
"heatLegend": "xoziZG_heatLegend",
|
|
294
|
+
"barFill": "xoziZG_barFill",
|
|
295
|
+
"check": "xoziZG_check",
|
|
226
296
|
"choices": "xoziZG_choices",
|
|
227
|
-
"
|
|
228
|
-
"
|
|
229
|
-
"
|
|
230
|
-
"
|
|
231
|
-
"
|
|
232
|
-
"
|
|
233
|
-
"
|
|
234
|
-
"balanceRow": "xoziZG_balanceRow",
|
|
297
|
+
"windowPopoverValue": "xoziZG_windowPopoverValue",
|
|
298
|
+
"concurrencyStepper": "xoziZG_concurrencyStepper",
|
|
299
|
+
"modelName": "xoziZG_modelName",
|
|
300
|
+
"windowCaret": "xoziZG_windowCaret",
|
|
301
|
+
"modelChart": "xoziZG_modelChart",
|
|
302
|
+
"avatar": "xoziZG_avatar",
|
|
303
|
+
"accountClear": "xoziZG_accountClear",
|
|
235
304
|
"updated": "xoziZG_updated",
|
|
236
|
-
"balanceUnit": "xoziZG_balanceUnit",
|
|
237
|
-
"skeletonRow": "xoziZG_skeletonRow",
|
|
238
|
-
"count": "xoziZG_count",
|
|
239
305
|
"accountGrid": "xoziZG_accountGrid",
|
|
240
|
-
"
|
|
241
|
-
"heatLegendChip": "xoziZG_heatLegendChip",
|
|
306
|
+
"statSub": "xoziZG_statSub",
|
|
242
307
|
"skeletonBreath": "xoziZG_skeletonBreath",
|
|
243
|
-
"
|
|
244
|
-
"
|
|
245
|
-
"
|
|
246
|
-
"windowButtonSet": "xoziZG_windowButtonSet",
|
|
247
|
-
"usageBar": "xoziZG_usageBar",
|
|
248
|
-
"accountClear": "xoziZG_accountClear",
|
|
249
|
-
"accountCard": "xoziZG_accountCard",
|
|
250
|
-
"windowPopover": "xoziZG_windowPopover",
|
|
251
|
-
"windowInputSet": "xoziZG_windowInputSet",
|
|
252
|
-
"manual": "xoziZG_manual",
|
|
308
|
+
"accountMenuItem": "xoziZG_accountMenuItem",
|
|
309
|
+
"heatGrid": "xoziZG_heatGrid",
|
|
310
|
+
"fieldLabel": "xoziZG_fieldLabel",
|
|
253
311
|
"usageTipName": "xoziZG_usageTipName",
|
|
254
|
-
"
|
|
255
|
-
"
|
|
256
|
-
"
|
|
257
|
-
"
|
|
258
|
-
"
|
|
259
|
-
"
|
|
260
|
-
"
|
|
261
|
-
"
|
|
262
|
-
"statCard": "xoziZG_statCard",
|
|
263
|
-
"statValue": "xoziZG_statValue",
|
|
264
|
-
"trendTip": "xoziZG_trendTip",
|
|
265
|
-
"headText": "xoziZG_headText",
|
|
266
|
-
"section": "xoziZG_section",
|
|
267
|
-
"accountMenuAnchor": "xoziZG_accountMenuAnchor",
|
|
268
|
-
"sectionHead": "xoziZG_sectionHead",
|
|
269
|
-
"heatHourCell": "xoziZG_heatHourCell",
|
|
270
|
-
"heatAxis": "xoziZG_heatAxis",
|
|
271
|
-
"windowButton": "xoziZG_windowButton",
|
|
272
|
-
"doctorList": "xoziZG_doctorList",
|
|
273
|
-
"link": "xoziZG_link",
|
|
274
|
-
"creditFooter": "xoziZG_creditFooter",
|
|
275
|
-
"accountClearHint": "xoziZG_accountClearHint"
|
|
312
|
+
"windowInputSet": "xoziZG_windowInputSet",
|
|
313
|
+
"windowSection": "xoziZG_windowSection",
|
|
314
|
+
"balanceRow": "xoziZG_balanceRow",
|
|
315
|
+
"accountNameRow": "xoziZG_accountNameRow",
|
|
316
|
+
"accountName": "xoziZG_accountName",
|
|
317
|
+
"usageBar": "xoziZG_usageBar",
|
|
318
|
+
"modelSpec": "xoziZG_modelSpec",
|
|
319
|
+
"accountRowActions": "xoziZG_accountRowActions"
|
|
276
320
|
};
|
|
277
321
|
//#endregion
|
|
278
322
|
//#region src/client/CodeArtsPluginCard.tsx
|
|
@@ -371,6 +415,39 @@ function windowStopIndex(tokens) {
|
|
|
371
415
|
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;
|
|
372
416
|
return best;
|
|
373
417
|
}
|
|
418
|
+
/**
|
|
419
|
+
* 输出上限的档位(issue #15)。
|
|
420
|
+
*
|
|
421
|
+
* 和窗口刻度分开:输出上限的常见值集中在 8K~128K,把 2M 那几档摆进来只会让
|
|
422
|
+
* 前半段挤成一团。企业自定义模型实测的 131072 必须在列表里 —— 否则「开覆盖
|
|
423
|
+
* 越过 65536 的墙」这件事在滑块上根本点不出来(输入框仍可填任意值)。
|
|
424
|
+
*/
|
|
425
|
+
const OUTPUT_STOPS = [
|
|
426
|
+
1024,
|
|
427
|
+
2048,
|
|
428
|
+
4096,
|
|
429
|
+
8e3,
|
|
430
|
+
8192,
|
|
431
|
+
16e3,
|
|
432
|
+
16384,
|
|
433
|
+
32e3,
|
|
434
|
+
32768,
|
|
435
|
+
65536,
|
|
436
|
+
98304,
|
|
437
|
+
131072,
|
|
438
|
+
196608,
|
|
439
|
+
262144
|
|
440
|
+
];
|
|
441
|
+
/** 卡片上并发调节的上限。服务端允许到 16,界面按套餐留到 8 就够用了。 */
|
|
442
|
+
const MAX_CONCURRENCY_UI = 8;
|
|
443
|
+
/** 当前值落在哪个输出档位上(不在刻度里就取最近的)。 */
|
|
444
|
+
function outputStopIndex(tokens) {
|
|
445
|
+
const fallback = OUTPUT_STOPS.indexOf(65536);
|
|
446
|
+
if (tokens === void 0 || !Number.isFinite(tokens) || tokens <= 0) return fallback;
|
|
447
|
+
let best = 0;
|
|
448
|
+
for (let i = 1; i < OUTPUT_STOPS.length; i += 1) if (Math.abs(OUTPUT_STOPS[i] - tokens) < Math.abs(OUTPUT_STOPS[best] - tokens)) best = i;
|
|
449
|
+
return best;
|
|
450
|
+
}
|
|
374
451
|
/** 体检里一条检查的标题。账号级检查按 id 找回备注名,别让用户对着哈希猜。 */
|
|
375
452
|
function doctorCheckLabel(id, accounts, t) {
|
|
376
453
|
if (id.startsWith("account:")) {
|
|
@@ -1128,10 +1205,15 @@ function CodeArtsPluginCard({ t }) {
|
|
|
1128
1205
|
/** 正在保存窗口的模型 id。 */
|
|
1129
1206
|
const [windowSaving, setWindowSaving] = (0, react.useState)(null);
|
|
1130
1207
|
const [windowError, setWindowError] = (0, react.useState)(null);
|
|
1208
|
+
/** 正在编辑的输出上限草稿(issue #15),语义与窗口草稿一致。 */
|
|
1209
|
+
const [outputDrafts, setOutputDrafts] = (0, react.useState)({});
|
|
1210
|
+
/** 正在保存输出上限的模型 id。 */
|
|
1211
|
+
const [outputSaving, setOutputSaving] = (0, react.useState)(null);
|
|
1131
1212
|
/** 弹层展开的模型 id(同一时间只开一个,行内只留一个按钮)。 */
|
|
1132
1213
|
const [windowOpenFor, setWindowOpenFor] = (0, react.useState)(null);
|
|
1133
1214
|
/** 正在提交窗口值的模型 id(state 更新有延迟,去重用 ref)。 */
|
|
1134
1215
|
const windowCommitInFlight = (0, react.useRef)(/* @__PURE__ */ new Set());
|
|
1216
|
+
const outputCommitInFlight = (0, react.useRef)(/* @__PURE__ */ new Set());
|
|
1135
1217
|
const [refreshing, setRefreshing] = (0, react.useState)(false);
|
|
1136
1218
|
const [refreshMsg, setRefreshMsg] = (0, react.useState)(null);
|
|
1137
1219
|
/** 正在实测的模型 id;同一时间只测一个,避免把上游并发槽位占满。 */
|
|
@@ -1157,6 +1239,12 @@ function CodeArtsPluginCard({ t }) {
|
|
|
1157
1239
|
/** 对话底部那一行的两个显隐开关(后端 = 插件 settings 里的两个布尔)。 */
|
|
1158
1240
|
const [dock, setDock] = (0, react.useState)(() => dockSnapshot().dock);
|
|
1159
1241
|
const [dockWritable, setDockWritable] = (0, react.useState)(() => dockSnapshot().writable);
|
|
1242
|
+
/** 每个账号各自的并发上限(issue #16):卡片上点一下就能改,改完立即生效。 */
|
|
1243
|
+
const [concurrencyDefault, setConcurrencyDefault] = (0, react.useState)(() => concurrencySnapshot().default);
|
|
1244
|
+
const [concurrencyCaps, setConcurrencyCaps] = (0, react.useState)(() => concurrencySnapshot().caps);
|
|
1245
|
+
const [concurrencyWritable, setConcurrencyWritable] = (0, react.useState)(() => concurrencySnapshot().writable);
|
|
1246
|
+
const [concurrencySavingId, setConcurrencySavingId] = (0, react.useState)(null);
|
|
1247
|
+
const [concurrencyError, setConcurrencyError] = (0, react.useState)(null);
|
|
1160
1248
|
/**
|
|
1161
1249
|
* 正在保存的开关(按键记录)。
|
|
1162
1250
|
*
|
|
@@ -1189,6 +1277,72 @@ function CodeArtsPluginCard({ t }) {
|
|
|
1189
1277
|
publishDock({ writable: data.writable === true });
|
|
1190
1278
|
} catch {}
|
|
1191
1279
|
}
|
|
1280
|
+
async function refreshConcurrency() {
|
|
1281
|
+
try {
|
|
1282
|
+
const res = await fetch("/api/codearts/concurrency", { headers: { Accept: "application/json" } });
|
|
1283
|
+
if (!res.ok) return;
|
|
1284
|
+
const data = await res.json();
|
|
1285
|
+
publishConcurrency({
|
|
1286
|
+
...typeof data.default === "number" ? { default: data.default } : {},
|
|
1287
|
+
...typeof data.caps === "object" && data.caps !== null ? { caps: data.caps } : {},
|
|
1288
|
+
writable: data.writable === true
|
|
1289
|
+
});
|
|
1290
|
+
} catch {}
|
|
1291
|
+
}
|
|
1292
|
+
/**
|
|
1293
|
+
* 改某个账号的并发:点一下就写,先按新值渲染、失败再退回去。
|
|
1294
|
+
*
|
|
1295
|
+
* 不做「攒草稿再保存」——用户点完必须马上看到结果(issue #16 的诉求就是「傻瓜式」)。
|
|
1296
|
+
* 写成功后池里这个号的上限立刻生效,其他号不受影响。
|
|
1297
|
+
*/
|
|
1298
|
+
async function saveAccountConcurrency(accountId, next) {
|
|
1299
|
+
const previous = concurrencyCaps;
|
|
1300
|
+
if (previous[accountId] === next || concurrencySavingId !== null) return;
|
|
1301
|
+
setConcurrencyCaps({
|
|
1302
|
+
...previous,
|
|
1303
|
+
[accountId]: next
|
|
1304
|
+
});
|
|
1305
|
+
setConcurrencySavingId(accountId);
|
|
1306
|
+
setConcurrencyError(null);
|
|
1307
|
+
try {
|
|
1308
|
+
const res = await fetch("/api/codearts/concurrency", {
|
|
1309
|
+
method: "POST",
|
|
1310
|
+
headers: {
|
|
1311
|
+
"Content-Type": "application/json",
|
|
1312
|
+
Accept: "application/json"
|
|
1313
|
+
},
|
|
1314
|
+
body: JSON.stringify({
|
|
1315
|
+
id: accountId,
|
|
1316
|
+
value: next
|
|
1317
|
+
})
|
|
1318
|
+
});
|
|
1319
|
+
const data = await res.json().catch(() => ({}));
|
|
1320
|
+
if (!res.ok) throw new Error(data.error ?? `HTTP ${res.status}`);
|
|
1321
|
+
publishConcurrency({
|
|
1322
|
+
...typeof data.default === "number" ? { default: data.default } : {},
|
|
1323
|
+
...typeof data.caps === "object" && data.caps !== null ? { caps: { ...data.caps } } : {},
|
|
1324
|
+
writable: true
|
|
1325
|
+
});
|
|
1326
|
+
setStatus((current) => {
|
|
1327
|
+
if (current?.usage === void 0) return current;
|
|
1328
|
+
return {
|
|
1329
|
+
...current,
|
|
1330
|
+
usage: {
|
|
1331
|
+
...current.usage,
|
|
1332
|
+
slots: current.usage.slots.map((slot) => slot.id === accountId ? {
|
|
1333
|
+
...slot,
|
|
1334
|
+
max: next
|
|
1335
|
+
} : slot)
|
|
1336
|
+
}
|
|
1337
|
+
};
|
|
1338
|
+
});
|
|
1339
|
+
} catch (error) {
|
|
1340
|
+
setConcurrencyCaps(previous);
|
|
1341
|
+
setConcurrencyError(error instanceof Error ? error.message : String(error));
|
|
1342
|
+
} finally {
|
|
1343
|
+
setConcurrencySavingId(null);
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1192
1346
|
/**
|
|
1193
1347
|
* 改一个开关:先按新值渲染,写失败再退回去。
|
|
1194
1348
|
*
|
|
@@ -1339,11 +1493,18 @@ function CodeArtsPluginCard({ t }) {
|
|
|
1339
1493
|
}, []);
|
|
1340
1494
|
(0, react.useEffect)(() => {
|
|
1341
1495
|
refreshDock();
|
|
1496
|
+
refreshConcurrency();
|
|
1342
1497
|
}, []);
|
|
1343
1498
|
(0, react.useEffect)(() => subscribeDock(() => {
|
|
1344
1499
|
setDock(dockSnapshot().dock);
|
|
1345
1500
|
setDockWritable(dockSnapshot().writable);
|
|
1346
1501
|
}), []);
|
|
1502
|
+
(0, react.useEffect)(() => subscribeConcurrency(() => {
|
|
1503
|
+
const snap = concurrencySnapshot();
|
|
1504
|
+
setConcurrencyDefault(snap.default);
|
|
1505
|
+
setConcurrencyCaps(snap.caps);
|
|
1506
|
+
setConcurrencyWritable(snap.writable);
|
|
1507
|
+
}), []);
|
|
1347
1508
|
(0, react.useEffect)(() => {
|
|
1348
1509
|
if (status?.status === "signed-in") refreshSelection();
|
|
1349
1510
|
}, [status?.status]);
|
|
@@ -1543,6 +1704,79 @@ function CodeArtsPluginCard({ t }) {
|
|
|
1543
1704
|
return next;
|
|
1544
1705
|
});
|
|
1545
1706
|
}
|
|
1707
|
+
/** 输出上限输入框里该显示的值:编辑中优先显示草稿,否则显示服务端生效值。 */
|
|
1708
|
+
function outputValueText(choice) {
|
|
1709
|
+
const draft = outputDrafts[choice.id];
|
|
1710
|
+
if (draft !== void 0) return draft;
|
|
1711
|
+
return String(choice.maxTokensOverride ?? choice.maxTokens ?? "");
|
|
1712
|
+
}
|
|
1713
|
+
function outputNumberValue(choice) {
|
|
1714
|
+
const parsed = Number(outputValueText(choice));
|
|
1715
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : void 0;
|
|
1716
|
+
}
|
|
1717
|
+
function setOutputDraft(id, value) {
|
|
1718
|
+
setOutputDrafts((current) => ({
|
|
1719
|
+
...current,
|
|
1720
|
+
[id]: value
|
|
1721
|
+
}));
|
|
1722
|
+
}
|
|
1723
|
+
function clearOutputDraft(id) {
|
|
1724
|
+
setOutputDrafts((current) => {
|
|
1725
|
+
if (!(id in current)) return current;
|
|
1726
|
+
const next = { ...current };
|
|
1727
|
+
delete next[id];
|
|
1728
|
+
return next;
|
|
1729
|
+
});
|
|
1730
|
+
}
|
|
1731
|
+
/**
|
|
1732
|
+
* 提交一个模型的输出上限(滑块松手、回车、收起弹层都走这里)。
|
|
1733
|
+
*
|
|
1734
|
+
* 与窗口同一套规则:空值 / 非法值 / 填回上游声明值 = 删除覆盖(issue #15)。
|
|
1735
|
+
*/
|
|
1736
|
+
async function commitOutput(choice, raw) {
|
|
1737
|
+
if (outputCommitInFlight.current.has(choice.id)) return;
|
|
1738
|
+
const base = choice.maxTokensDiscovered ?? choice.maxTokens;
|
|
1739
|
+
const text = raw.trim();
|
|
1740
|
+
let target = null;
|
|
1741
|
+
if (text !== "") {
|
|
1742
|
+
const parsed = Math.floor(Number(text));
|
|
1743
|
+
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
1744
|
+
clearOutputDraft(choice.id);
|
|
1745
|
+
return;
|
|
1746
|
+
}
|
|
1747
|
+
target = base !== void 0 && parsed === base ? null : parsed;
|
|
1748
|
+
}
|
|
1749
|
+
const before = choice.maxTokensOverride ?? null;
|
|
1750
|
+
if (target === before) {
|
|
1751
|
+
clearOutputDraft(choice.id);
|
|
1752
|
+
return;
|
|
1753
|
+
}
|
|
1754
|
+
outputCommitInFlight.current.add(choice.id);
|
|
1755
|
+
setOutputSaving(choice.id);
|
|
1756
|
+
setWindowError(null);
|
|
1757
|
+
try {
|
|
1758
|
+
const res = await fetch("/api/codearts/max-tokens", {
|
|
1759
|
+
method: "POST",
|
|
1760
|
+
headers: {
|
|
1761
|
+
"Content-Type": "application/json",
|
|
1762
|
+
Accept: "application/json"
|
|
1763
|
+
},
|
|
1764
|
+
body: JSON.stringify({
|
|
1765
|
+
id: choice.id,
|
|
1766
|
+
tokens: target
|
|
1767
|
+
})
|
|
1768
|
+
});
|
|
1769
|
+
const data = await res.json().catch(() => null);
|
|
1770
|
+
if (!res.ok) throw new Error(data?.error ?? `HTTP ${res.status}`);
|
|
1771
|
+
if (data !== null && data.selection !== void 0) setSelection(data.selection);
|
|
1772
|
+
} catch (err) {
|
|
1773
|
+
setWindowError(err instanceof Error ? err.message : String(err));
|
|
1774
|
+
} finally {
|
|
1775
|
+
clearOutputDraft(choice.id);
|
|
1776
|
+
outputCommitInFlight.current.delete(choice.id);
|
|
1777
|
+
setOutputSaving(null);
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1546
1780
|
/**
|
|
1547
1781
|
* 提交一个模型的窗口值(滑块松手、回车、收起弹层都走这里)。
|
|
1548
1782
|
*
|
|
@@ -1603,9 +1837,12 @@ function CodeArtsPluginCard({ t }) {
|
|
|
1603
1837
|
const id = windowOpenFor;
|
|
1604
1838
|
setWindowOpenFor(null);
|
|
1605
1839
|
if (id === null) return;
|
|
1606
|
-
const draft = windowDrafts[id];
|
|
1607
1840
|
const choice = (selection?.choices ?? []).find((entry) => entry.id === id);
|
|
1608
|
-
if (
|
|
1841
|
+
if (choice === void 0) return;
|
|
1842
|
+
const draft = windowDrafts[id];
|
|
1843
|
+
if (draft !== void 0) commitWindow(choice, draft);
|
|
1844
|
+
const outputDraft = outputDrafts[id];
|
|
1845
|
+
if (outputDraft !== void 0) commitOutput(choice, outputDraft);
|
|
1609
1846
|
}
|
|
1610
1847
|
/**
|
|
1611
1848
|
* 实测某个模型现在能不能调用。
|
|
@@ -1958,6 +2195,7 @@ function CodeArtsPluginCard({ t }) {
|
|
|
1958
2195
|
children: accounts.map((account) => {
|
|
1959
2196
|
const accountLine = accountMeta(account);
|
|
1960
2197
|
const credit = creditFor(account.id);
|
|
2198
|
+
const accountCap = concurrencyCaps[account.id] ?? concurrencyDefault;
|
|
1961
2199
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1962
2200
|
className: CodeArtsPluginCard_module_css_default.accountEntry,
|
|
1963
2201
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -1997,6 +2235,41 @@ function CodeArtsPluginCard({ t }) {
|
|
|
1997
2235
|
n: formatCount(status?.usage?.byAccountToday[account.id]?.requests ?? 0),
|
|
1998
2236
|
failed: formatCount(status?.usage?.failuresByAccountToday?.[account.id] ?? 0)
|
|
1999
2237
|
})
|
|
2238
|
+
}),
|
|
2239
|
+
concurrencyWritable && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2240
|
+
className: CodeArtsPluginCard_module_css_default.accountConcurrencyInline,
|
|
2241
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2242
|
+
className: CodeArtsPluginCard_module_css_default.accountConcurrencyLabel,
|
|
2243
|
+
title: t("concurrencyHint"),
|
|
2244
|
+
children: t("concurrencyLabel")
|
|
2245
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
2246
|
+
className: CodeArtsPluginCard_module_css_default.concurrencyStepper,
|
|
2247
|
+
role: "group",
|
|
2248
|
+
"aria-label": `${accountName(account)} ${t("concurrencyLabel")}`,
|
|
2249
|
+
children: [
|
|
2250
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2251
|
+
type: "button",
|
|
2252
|
+
className: CodeArtsPluginCard_module_css_default.concurrencyButton,
|
|
2253
|
+
"aria-label": t("concurrencyLess"),
|
|
2254
|
+
disabled: concurrencySavingId !== null || accountCap <= 1,
|
|
2255
|
+
onClick: () => void saveAccountConcurrency(account.id, accountCap - 1),
|
|
2256
|
+
children: "−"
|
|
2257
|
+
}),
|
|
2258
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2259
|
+
className: CodeArtsPluginCard_module_css_default.concurrencyValue,
|
|
2260
|
+
"aria-live": "polite",
|
|
2261
|
+
children: accountCap
|
|
2262
|
+
}),
|
|
2263
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2264
|
+
type: "button",
|
|
2265
|
+
className: CodeArtsPluginCard_module_css_default.concurrencyButton,
|
|
2266
|
+
"aria-label": t("concurrencyMore"),
|
|
2267
|
+
disabled: concurrencySavingId !== null || accountCap >= MAX_CONCURRENCY_UI,
|
|
2268
|
+
onClick: () => void saveAccountConcurrency(account.id, accountCap + 1),
|
|
2269
|
+
children: "+"
|
|
2270
|
+
})
|
|
2271
|
+
]
|
|
2272
|
+
})]
|
|
2000
2273
|
})
|
|
2001
2274
|
]
|
|
2002
2275
|
}),
|
|
@@ -2083,6 +2356,14 @@ function CodeArtsPluginCard({ t }) {
|
|
|
2083
2356
|
accounts.length > 1 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2084
2357
|
className: CodeArtsPluginCard_module_css_default.accountHint,
|
|
2085
2358
|
children: t("accountsRotateHint")
|
|
2359
|
+
}),
|
|
2360
|
+
concurrencyWritable && accounts.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2361
|
+
className: CodeArtsPluginCard_module_css_default.accountHint,
|
|
2362
|
+
children: t("concurrencyShortHint")
|
|
2363
|
+
}),
|
|
2364
|
+
concurrencyError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2365
|
+
className: CodeArtsPluginCard_module_css_default.error,
|
|
2366
|
+
children: concurrencyError
|
|
2086
2367
|
})
|
|
2087
2368
|
]
|
|
2088
2369
|
}),
|
|
@@ -2163,7 +2444,7 @@ function CodeArtsPluginCard({ t }) {
|
|
|
2163
2444
|
className: [
|
|
2164
2445
|
CodeArtsPluginCard_module_css_default.windowButton,
|
|
2165
2446
|
windowOpenFor === choice.id ? CodeArtsPluginCard_module_css_default.windowButtonOpen : "",
|
|
2166
|
-
choice.contextWindowOverride === void 0 ? "" : CodeArtsPluginCard_module_css_default.windowButtonSet
|
|
2447
|
+
choice.contextWindowOverride === void 0 && choice.maxTokensOverride === void 0 ? "" : CodeArtsPluginCard_module_css_default.windowButtonSet
|
|
2167
2448
|
].filter(Boolean).join(" "),
|
|
2168
2449
|
"aria-expanded": windowOpenFor === choice.id,
|
|
2169
2450
|
"aria-label": t("modelWindowLabel", { model: modelName(choice) }),
|
|
@@ -2233,6 +2514,59 @@ function CodeArtsPluginCard({ t }) {
|
|
|
2233
2514
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2234
2515
|
className: CodeArtsPluginCard_module_css_default.windowHint,
|
|
2235
2516
|
children: t("modelWindowHint", { value: formatWindow(choice.contextWindowDiscovered ?? choice.contextWindow) })
|
|
2517
|
+
}),
|
|
2518
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2519
|
+
className: CodeArtsPluginCard_module_css_default.windowSection,
|
|
2520
|
+
children: [
|
|
2521
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2522
|
+
className: CodeArtsPluginCard_module_css_default.windowPopoverHead,
|
|
2523
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("modelOutputHeading") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2524
|
+
className: CodeArtsPluginCard_module_css_default.windowPopoverValue,
|
|
2525
|
+
children: outputValueText(choice) || "—"
|
|
2526
|
+
})]
|
|
2527
|
+
}),
|
|
2528
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2529
|
+
type: "range",
|
|
2530
|
+
className: CodeArtsPluginCard_module_css_default.windowRange,
|
|
2531
|
+
min: 0,
|
|
2532
|
+
max: OUTPUT_STOPS.length - 1,
|
|
2533
|
+
step: 1,
|
|
2534
|
+
value: outputStopIndex(outputNumberValue(choice)),
|
|
2535
|
+
"aria-label": t("modelOutputLabel", { model: modelName(choice) }),
|
|
2536
|
+
disabled: !selection.writable || outputSaving === choice.id,
|
|
2537
|
+
onChange: (e) => setOutputDraft(choice.id, String(OUTPUT_STOPS[Number(e.target.value)] ?? "")),
|
|
2538
|
+
onPointerUp: (e) => void commitOutput(choice, String(OUTPUT_STOPS[Number(e.currentTarget.value)] ?? "")),
|
|
2539
|
+
onKeyUp: (e) => void commitOutput(choice, String(OUTPUT_STOPS[Number(e.currentTarget.value)] ?? ""))
|
|
2540
|
+
}),
|
|
2541
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2542
|
+
className: CodeArtsPluginCard_module_css_default.windowPopoverRow,
|
|
2543
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
2544
|
+
type: "number",
|
|
2545
|
+
className: choice.maxTokensOverride === void 0 ? CodeArtsPluginCard_module_css_default.windowInput : `${CodeArtsPluginCard_module_css_default.windowInput} ${CodeArtsPluginCard_module_css_default.windowInputSet}`,
|
|
2546
|
+
value: outputValueText(choice),
|
|
2547
|
+
min: 1,
|
|
2548
|
+
step: 1024,
|
|
2549
|
+
inputMode: "numeric",
|
|
2550
|
+
placeholder: t("modelWindowFollow"),
|
|
2551
|
+
"aria-label": t("modelOutputLabel", { model: modelName(choice) }),
|
|
2552
|
+
disabled: !selection.writable || outputSaving === choice.id,
|
|
2553
|
+
onChange: (e) => setOutputDraft(choice.id, e.target.value),
|
|
2554
|
+
onKeyDown: (e) => {
|
|
2555
|
+
if (e.key === "Enter") {
|
|
2556
|
+
e.preventDefault();
|
|
2557
|
+
closeWindow();
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2561
|
+
className: CodeArtsPluginCard_module_css_default.windowUnit,
|
|
2562
|
+
children: "tokens"
|
|
2563
|
+
})]
|
|
2564
|
+
}),
|
|
2565
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2566
|
+
className: CodeArtsPluginCard_module_css_default.windowHint,
|
|
2567
|
+
children: t("modelOutputHint", { value: formatWindow(choice.maxTokensDiscovered ?? choice.maxTokens) })
|
|
2568
|
+
})
|
|
2569
|
+
]
|
|
2236
2570
|
})
|
|
2237
2571
|
]
|
|
2238
2572
|
})]
|
|
@@ -3289,14 +3623,14 @@ if (typeof document !== "undefined" && document.querySelector("style[data-plugin
|
|
|
3289
3623
|
document.head.appendChild(tag);
|
|
3290
3624
|
}
|
|
3291
3625
|
var CodeArtsPanel_module_css_default = {
|
|
3626
|
+
"title": "Z66cgG_title",
|
|
3627
|
+
"back": "Z66cgG_back",
|
|
3292
3628
|
"head": "Z66cgG_head",
|
|
3629
|
+
"backCaret": "Z66cgG_backCaret",
|
|
3293
3630
|
"body": "Z66cgG_body",
|
|
3294
|
-
"page": "Z66cgG_page",
|
|
3295
3631
|
"icon": "Z66cgG_icon",
|
|
3296
|
-
"
|
|
3297
|
-
"
|
|
3298
|
-
"title": "Z66cgG_title",
|
|
3299
|
-
"desc": "Z66cgG_desc"
|
|
3632
|
+
"desc": "Z66cgG_desc",
|
|
3633
|
+
"page": "Z66cgG_page"
|
|
3300
3634
|
};
|
|
3301
3635
|
//#endregion
|
|
3302
3636
|
//#region src/client/CodeArtsPanel.tsx
|
|
@@ -3542,7 +3876,15 @@ const zh = {
|
|
|
3542
3876
|
modelWindowTitle: "上下文窗口:上游标称 {value} token。点击可拖动滑块或直接输入",
|
|
3543
3877
|
modelWindowHeading: "上下文窗口",
|
|
3544
3878
|
modelWindowFollow: "跟随上游",
|
|
3545
|
-
modelWindowHint: "上游标称 {value}
|
|
3879
|
+
modelWindowHint: "上游标称 {value}。拖动立即生效;输入后按回车或收起弹层生效;清空或填回标称值 = 跟随上游",
|
|
3880
|
+
modelOutputLabel: "设置 {model} 的输出上限",
|
|
3881
|
+
modelOutputHeading: "输出上限",
|
|
3882
|
+
modelOutputHint: "上游声明 {value}。拖动立即生效;输入后按回车或收起弹层生效;清空或填回声明值 = 跟随上游",
|
|
3883
|
+
concurrencyLabel: "并发",
|
|
3884
|
+
concurrencyLess: "减少并发",
|
|
3885
|
+
concurrencyMore: "增加并发",
|
|
3886
|
+
concurrencyHint: "这个账号的并发上限 —— 上游个人免费版 3 个会话、企业版 5 个;留 1 个给网页端,所以个人建议 2、企业建议 5。点一下立即生效,只影响这个号。",
|
|
3887
|
+
concurrencyShortHint: "并发上限按账号独立设置;个人 3 / 企业 5 个会话,留 1 个给网页端。",
|
|
3546
3888
|
accountPaused: "已暂停",
|
|
3547
3889
|
accountPinned: "已置顶",
|
|
3548
3890
|
accountEnabled: "启用",
|
|
@@ -3761,7 +4103,15 @@ const en = {
|
|
|
3761
4103
|
modelWindowTitle: "Context window: upstream reports {value} tokens. Click to drag the slider or type a value",
|
|
3762
4104
|
modelWindowHeading: "Context window",
|
|
3763
4105
|
modelWindowFollow: "Follow upstream",
|
|
3764
|
-
modelWindowHint: "Upstream reports {value}.
|
|
4106
|
+
modelWindowHint: "Upstream reports {value}. Dragging applies immediately; typed values apply on Enter or when the popover closes; clear the field or type the upstream value to follow it",
|
|
4107
|
+
modelOutputLabel: "Set the output limit for {model}",
|
|
4108
|
+
modelOutputHeading: "Output limit",
|
|
4109
|
+
modelOutputHint: "Upstream declares {value}. Dragging applies immediately; typed values apply on Enter or when the popover closes; clear the field or type the declared value to follow it",
|
|
4110
|
+
concurrencyLabel: "Concurrency",
|
|
4111
|
+
concurrencyLess: "Decrease concurrency",
|
|
4112
|
+
concurrencyMore: "Increase concurrency",
|
|
4113
|
+
concurrencyHint: "Concurrency cap for this account — upstream allows 3 sessions on the free tier and 5 on enterprise; keep 1 for the web console (2 for personal, 5 for enterprise). Clicking applies immediately and only affects this account.",
|
|
4114
|
+
concurrencyShortHint: "Concurrency is per account; the free tier allows 3 sessions, enterprise 5 — keep 1 for the web console.",
|
|
3765
4115
|
accountPaused: "Paused",
|
|
3766
4116
|
accountPinned: "Pinned",
|
|
3767
4117
|
accountEnabled: "Enabled",
|