@jxgame2020/dsh-token-quota 0.1.22 → 0.1.24
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/lib/client.js +552 -72
- package/lib/index.js +129 -18
- package/lib/types/client/TokenQuotaPanel.d.ts +8 -2
- package/lib/types/client/TokenQuotaPanel.js +7 -4
- package/lib/types/client/index.js +54 -0
- package/lib/types/client/locales.d.ts +14 -0
- package/lib/types/client/locales.js +14 -0
- package/lib/types/client/music.d.ts +70 -0
- package/lib/types/client/music.js +298 -0
- package/lib/types/client/store.d.ts +8 -1
- package/lib/types/client/store.js +6 -0
- package/lib/types/index.d.ts +6 -0
- package/lib/types/index.js +95 -18
- package/lib/types/types.d.ts +57 -0
- package/lib/types/types.js +8 -0
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -37,6 +37,9 @@ window.__ModuleLoader__.load({
|
|
|
37
37
|
onFull: "stop",
|
|
38
38
|
checkUpdates: true,
|
|
39
39
|
dimWhenIdle: false,
|
|
40
|
+
musicEnabled: false,
|
|
41
|
+
musicVolume: .5,
|
|
42
|
+
musicStyle: "major",
|
|
40
43
|
upgrade: null,
|
|
41
44
|
upgradeDismissed: false,
|
|
42
45
|
checkingUpdates: false,
|
|
@@ -78,8 +81,17 @@ window.__ModuleLoader__.load({
|
|
|
78
81
|
setDimWhenIdle: (d, dimWhenIdle) => {
|
|
79
82
|
d.dimWhenIdle = dimWhenIdle;
|
|
80
83
|
},
|
|
84
|
+
setMusicEnabled: (d, enabled) => {
|
|
85
|
+
d.musicEnabled = enabled;
|
|
86
|
+
},
|
|
87
|
+
setMusicVolume: (d, volume) => {
|
|
88
|
+
d.musicVolume = volume;
|
|
89
|
+
},
|
|
90
|
+
setMusicStyle: (d, style) => {
|
|
91
|
+
d.musicStyle = style;
|
|
92
|
+
},
|
|
81
93
|
setUpgrade: (d, upgrade) => {
|
|
82
|
-
const normalized = upgrade !== null && upgrade.latestVersion !== "" && upgrade.latestVersion !== "0.1.
|
|
94
|
+
const normalized = upgrade !== null && upgrade.latestVersion !== "" && upgrade.latestVersion !== "0.1.24" ? upgrade : null;
|
|
83
95
|
if (d.upgrade === null || d.upgrade.latestVersion !== normalized?.latestVersion) d.upgradeDismissed = false;
|
|
84
96
|
d.upgrade = normalized;
|
|
85
97
|
},
|
|
@@ -175,7 +187,7 @@ window.__ModuleLoader__.load({
|
|
|
175
187
|
}
|
|
176
188
|
//#endregion
|
|
177
189
|
//#region \0dsh-css:/Users/jxgame/Desktop/works/deepseek-harness-package/dsh-token-quota/packages/token-quota/src/client/TokenQuotaPanel.module.css.mjs
|
|
178
|
-
const css = ".NPLLIq_panel{box-sizing:border-box;background:var(--dsw-alias-bg-overlay);border:1px solid var(--dsw-alias-border-l1);pointer-events:auto;z-index:40;opacity:1;border-radius:12px;flex-direction:column;width:320px;max-height:min(72vh,560px);transition:opacity .18s;display:flex;position:fixed;top:56px;right:12px;overflow:hidden;box-shadow:0 8px 28px #0000002e}.NPLLIq_panelDim{opacity:.55}.NPLLIq_panelDimStrong{opacity:.3}.NPLLIq_header{border-bottom:1px solid var(--dsw-alias-border-l1);cursor:grab;user-select:none;touch-action:none;justify-content:space-between;align-items:flex-start;gap:8px;padding:10px 12px;display:flex}.NPLLIq_header:active{cursor:grabbing}.NPLLIq_headerText{flex-direction:column;gap:2px;min-width:0;display:flex}.NPLLIq_title{color:var(--dsw-alias-label-primary);align-items:baseline;gap:6px;font-size:13px;font-weight:600;display:flex}.NPLLIq_version{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-size:10px;font-weight:500}.NPLLIq_versionNew{color:var(--dsw-alias-status-warning-foreground,#b56900);background:var(--dsw-alias-status-warning-background,#fff6d7);cursor:default;border-radius:4px;padding:1px 6px}.NPLLIq_subtitle{color:var(--dsw-alias-label-secondary);font-size:11px}.NPLLIq_collapse{color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:6px;flex:none;padding:2px 6px;font-size:11px}.NPLLIq_collapse:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1)}.NPLLIq_body{padding:4px 0;overflow-y:auto}.NPLLIq_row{border-bottom:1px solid var(--dsw-alias-border-l1);flex-direction:column;gap:6px;padding:8px 12px;display:flex}.NPLLIq_rowHeader{justify-content:space-between;align-items:center;gap:8px;display:flex}.NPLLIq_rowName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;align-items:center;gap:6px;font-size:12px;font-weight:500;display:inline-flex;overflow:hidden}.NPLLIq_currentBadge{color:var(--dsw-alias-state-success-primary);border:1px solid var(--dsw-alias-state-success-primary);border-radius:8px;flex:none;padding:1px 6px;font-size:10px}.NPLLIq_rowMeta{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;flex:none;font-size:11px}.NPLLIq_bar{background:var(--dsw-alias-bg-layer-1);border-radius:3px;height:6px;overflow:hidden}.NPLLIq_fillIdle{background:var(--dsw-alias-brand-primary);height:100%;transition:width .2s}.NPLLIq_fillWarn{background:var(--dsw-alias-state-warn-primary);height:100%;transition:width .2s}.NPLLIq_fillOver{background:var(--dsw-alias-state-error-primary);height:100%;transition:width .2s}.NPLLIq_controls{align-items:center;gap:6px;display:flex}.NPLLIq_input{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);min-width:0;color:var(--dsw-alias-label-primary);border-radius:6px;flex:1;padding:4px 8px;font-size:11px}.NPLLIq_input::placeholder{color:var(--dsw-alias-label-secondary)}.NPLLIq_save,.NPLLIq_switch{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);cursor:pointer;border-radius:6px;flex:none;padding:4px 10px;font-size:11px}.NPLLIq_save:hover,.NPLLIq_switch:hover:not(:disabled){background:var(--dsw-alias-bg-layer-2)}.NPLLIq_switch:disabled{opacity:.5;cursor:default}.NPLLIq_notice,.NPLLIq_noticeError{color:var(--dsw-alias-label-secondary);padding:10px 12px;font-size:12px}.NPLLIq_noticeError{color:var(--dsw-alias-state-error-primary)}.NPLLIq_tab{background:var(--dsw-alias-brand-primary);border:1px solid var(--dsw-alias-brand-primary);color:var(--dsw-alias-bg-overlay);pointer-events:auto;cursor:pointer;z-index:90;border-radius:10px;align-items:center;gap:6px;padding:9px 14px;font-size:12px;font-weight:600;display:inline-flex;position:fixed;top:56px;right:12px;box-shadow:0 6px 20px #00000040}.NPLLIq_tab:hover{filter:brightness(1.08)}.NPLLIq_tabIcon{font-size:12px;line-height:1}.NPLLIq_tabLabel{white-space:nowrap}.NPLLIq_headerActions{flex:none;align-items:center;gap:4px;display:flex}.NPLLIq_settingsBtn{color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:6px;flex:none;padding:2px 6px;font-size:11px}.NPLLIq_settingsBtn:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1)}.NPLLIq_selectBtn{border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-brand-primary);cursor:pointer;background:0 0;border-radius:6px;flex:none;padding:1px 6px;font-size:10px}.NPLLIq_selectBtn:hover{background:var(--dsw-alias-bg-layer-1)}.NPLLIq_gearBtn{color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;flex:none;margin-left:6px;padding:0 2px;font-size:12px;line-height:1}.NPLLIq_gearBtn:hover{color:var(--dsw-alias-label-primary)}.NPLLIq_fullNotice{color:var(--dsw-alias-state-error-primary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-state-error-primary);border-radius:8px;margin:6px 12px;padding:8px 10px;font-size:12px}.NPLLIq_upgradeBanner{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-divider-1,#0000001a);border-radius:8px;margin:6px 12px;padding:10px 30px 10px 10px;font-size:12px;position:relative}@keyframes NPLLIq_upgradeBannerFlash{0%,to{border-color:var(--dsw-alias-divider-1,#0000001a);box-shadow:0 0 #f0a02000}50%{border-color:var(--dsw-alias-status-warning-foreground,#b56900);box-shadow:0 0 0 5px #f0a02073}}.NPLLIq_upgradeBannerFlash{border-color:var(--dsw-alias-status-warning-foreground,#b56900);animation:.6s ease-in-out 4 NPLLIq_upgradeBannerFlash}.NPLLIq_upgradeBannerText{margin-bottom:6px;font-weight:600}.NPLLIq_upgradeCommands{flex-direction:column;gap:4px;display:flex}.NPLLIq_upgradeCommandRow{align-items:center;gap:6px;display:flex}.NPLLIq_upgradeCommand{background:var(--dsw-alias-bg-layer-2,#0000000a);white-space:nowrap;border-radius:4px;flex:1;min-width:0;padding:4px 6px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;overflow-x:auto}.NPLLIq_copyBtn{border:1px solid var(--dsw-alias-divider-1,#00000026);background:var(--dsw-alias-bg-layer-2,#0000000a);color:var(--dsw-alias-label-primary);cursor:pointer;border-radius:4px;flex:none;padding:3px 8px;font-size:11px;transition:transform 80ms,background .12s,color .12s}.NPLLIq_copyBtn:hover{background:var(--dsw-alias-bg-layer-3,#00000014)}.NPLLIq_copyBtn:active{transform:scale(.92)}.NPLLIq_copyBtnDone{background:var(--dsw-alias-status-success-background,#14963c1f);border-color:var(--dsw-alias-status-success-foreground,#0a7d32);color:var(--dsw-alias-status-success-foreground,#0a7d32);font-weight:600}.NPLLIq_upgradeHint{color:var(--dsw-alias-label-secondary);margin-top:6px;font-size:11px}.NPLLIq_upgradeClose{width:20px;height:20px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:4px;font-size:16px;line-height:1;position:absolute;top:4px;right:6px}.NPLLIq_upgradeClose:hover{background:var(--dsw-alias-bg-layer-2,#0000000a);color:var(--dsw-alias-label-primary)}.NPLLIq_checkUpdatesRow{justify-content:space-between;align-items:center;gap:12px;display:flex}.NPLLIq_checkUpdatesLabel{color:var(--dsw-alias-label-primary);cursor:pointer;align-items:center;gap:6px;font-size:12px;display:flex}.NPLLIq_checkUpdatesLabel input{margin:0}.NPLLIq_checkBtn{border:1px solid var(--dsw-alias-divider-1,#00000026);background:var(--dsw-alias-bg-layer-2,#0000000a);color:var(--dsw-alias-label-primary);cursor:pointer;white-space:nowrap;text-align:center;border-radius:4px;flex:none;min-width:72px;padding:4px 10px;font-size:12px}.NPLLIq_checkBtn:hover:not(:disabled){background:var(--dsw-alias-bg-layer-3,#00000014)}.NPLLIq_checkBtn:disabled{opacity:.6;cursor:default}.NPLLIq_checkErrorHint{color:var(--dsw-alias-state-error-primary,#c00);background:var(--dsw-alias-state-error-background,#ff00000f);border:1px solid var(--dsw-alias-state-error-border,#b4000040);word-break:break-all;border-radius:6px;margin-top:8px;padding:6px 8px;font-size:11px;line-height:1.4}.NPLLIq_dialog{z-index:100;box-sizing:border-box;background:var(--dsw-alias-bg-overlay);border:1px solid var(--dsw-alias-border-l1);border-radius:12px;flex-direction:column;gap:12px;width:280px;max-height:80vh;padding:14px;display:flex;position:fixed;top:50%;left:50%;overflow-y:auto;transform:translate(-50%,-50%);box-shadow:0 8px 28px #00000040}.NPLLIq_dialogTitle{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600}.NPLLIq_dialogSection{flex-direction:column;gap:6px;display:flex}.NPLLIq_dialogLabel{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:500}.NPLLIq_monitorHint{color:var(--dsw-alias-label-secondary);font-size:11px}.NPLLIq_dialogHint{color:var(--dsw-alias-label-secondary);margin-top:4px;font-size:11px;line-height:1.4}.NPLLIq_monitorList{flex-direction:column;gap:2px;max-height:180px;display:flex;overflow-y:auto}.NPLLIq_monitorRow{color:var(--dsw-alias-label-primary);cursor:pointer;border-radius:6px;align-items:center;gap:6px;padding:2px 4px;font-size:12px;display:flex}.NPLLIq_monitorRow:hover{background:var(--dsw-alias-bg-layer-1)}.NPLLIq_monitorName{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.NPLLIq_radioRow{color:var(--dsw-alias-label-primary);cursor:pointer;border-radius:6px;align-items:center;gap:6px;padding:3px 4px;font-size:12px;display:flex}.NPLLIq_radioRow:hover{background:var(--dsw-alias-bg-layer-1)}.NPLLIq_dialogActions{justify-content:flex-end;gap:6px;display:flex}.NPLLIq_dialogBtn,.NPLLIq_dialogBtnPrimary{border:1px solid var(--dsw-alias-border-l1);cursor:pointer;border-radius:6px;padding:4px 12px;font-size:11px}.NPLLIq_dialogBtn{background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary)}.NPLLIq_dialogBtnPrimary{background:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary);color:var(--dsw-alias-bg-overlay)}.NPLLIq_dialogHeader{z-index:2;background:var(--dsw-alias-bg-overlay);cursor:grab;user-select:none;touch-action:none;justify-content:space-between;align-items:center;gap:8px;margin:-14px -14px 0;padding:14px 14px 8px;display:flex;position:sticky;top:-14px}.NPLLIq_dialogHeader:active{cursor:grabbing}.NPLLIq_dialogClose{width:28px;height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:8px;flex:none;justify-content:center;align-items:center;font-size:18px;line-height:1;display:flex}.NPLLIq_dialogClose:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1)}.NPLLIq_resetRow{flex-wrap:wrap;align-items:center;gap:6px;display:flex}.NPLLIq_resetSelect{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);border-radius:6px;padding:3px 6px;font-size:12px}.NPLLIq_logTable{border-collapse:collapse;width:100%;font-size:11px}.NPLLIq_logTable th{text-align:left;color:var(--dsw-alias-label-secondary);border-bottom:1px solid var(--dsw-alias-border-l1);padding:4px 6px;font-weight:500}.NPLLIq_logTable td{color:var(--dsw-alias-label-primary);border-bottom:1px solid var(--dsw-alias-border-l1);font-variant-numeric:tabular-nums;padding:4px 6px}.NPLLIq_logDayCol{white-space:nowrap;color:var(--dsw-alias-label-secondary)}.NPLLIq_logModelCol{text-overflow:ellipsis;white-space:nowrap;max-width:160px;overflow:hidden}.NPLLIq_logUsedCol{text-align:right}.NPLLIq_logDialog{gap:0;width:380px;max-height:min(72vh,480px);padding:0}.NPLLIq_logHeader{background:var(--dsw-alias-bg-overlay);cursor:grab;user-select:none;touch-action:none;flex:none;justify-content:space-between;align-items:center;gap:8px;padding:14px 14px 8px;display:flex}.NPLLIq_logHeader:active{cursor:grabbing}.NPLLIq_logScroll{flex:1;min-height:0;padding:0 14px 14px;overflow:auto}.NPLLIq_logToolbar{flex:1;align-items:center;gap:6px;display:flex}.NPLLIq_logSearch{border:1px solid var(--dsw-alias-divider-1,#00000026);background:var(--dsw-alias-bg-layer-1,#0000000a);min-width:0;color:var(--dsw-alias-label-primary);border-radius:4px;flex:1;padding:3px 6px;font-size:11px}.NPLLIq_logSearch:focus{border-color:var(--dsw-alias-accent-1,#4a9eff);outline:none}.NPLLIq_logClearBtn{border:1px solid var(--dsw-alias-state-error-border,#b400004d);color:var(--dsw-alias-state-error-primary,#c00);cursor:pointer;white-space:nowrap;background:0 0;border-radius:4px;flex:none;padding:3px 8px;font-size:11px}.NPLLIq_logClearBtn:hover{background:var(--dsw-alias-state-error-background,#ff00000f)}.NPLLIq_logPager{border-top:1px solid var(--dsw-alias-divider-1,#00000014);background:var(--dsw-alias-bg-overlay);color:var(--dsw-alias-label-secondary);flex:none;justify-content:space-between;align-items:center;gap:8px;padding:6px 14px;font-size:11px;display:flex}.NPLLIq_logPagerInfo{white-space:nowrap}.NPLLIq_logPagerControls{align-items:center;gap:4px;display:flex}.NPLLIq_logPagerBtn{border:1px solid var(--dsw-alias-divider-1,#00000026);background:var(--dsw-alias-bg-layer-1,#0000000a);width:24px;height:24px;color:var(--dsw-alias-label-primary);cursor:pointer;border-radius:4px;font-size:13px;line-height:1}.NPLLIq_logPagerBtn:disabled{opacity:.4;cursor:default}.NPLLIq_logPagerPages{text-align:center;min-width:50px;color:var(--dsw-alias-label-secondary)}.NPLLIq_logPageSizeSelect{border:1px solid var(--dsw-alias-divider-1,#00000026);background:var(--dsw-alias-bg-layer-1,#0000000a);color:var(--dsw-alias-label-primary);cursor:pointer;border-radius:4px;padding:2px 4px;font-size:11px}.NPLLIq_dialogOverlay{z-index:100001;background:#0000004d;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.NPLLIq_logClearDialog{gap:0;width:320px;padding:16px}.NPLLIq_dialogBody{color:var(--dsw-alias-label-secondary);margin:6px 0 10px;font-size:12px;line-height:1.5}.NPLLIq_logClearDate{border:1px solid var(--dsw-alias-divider-1,#00000026);background:var(--dsw-alias-bg-layer-1,#0000000a);width:100%;color:var(--dsw-alias-label-primary);border-radius:6px;margin-bottom:12px;padding:6px 8px;font-size:13px}.NPLLIq_logClearDate:focus{border-color:var(--dsw-alias-accent-1,#4a9eff);outline:none}";
|
|
190
|
+
const css = ".NPLLIq_panel{box-sizing:border-box;background:var(--dsw-alias-bg-overlay);border:1px solid var(--dsw-alias-border-l1);pointer-events:auto;z-index:40;opacity:1;border-radius:12px;flex-direction:column;width:320px;max-height:min(72vh,560px);transition:opacity .18s;display:flex;position:fixed;top:56px;right:12px;overflow:hidden;box-shadow:0 8px 28px #0000002e}.NPLLIq_panelDim{opacity:.55}.NPLLIq_panelDimStrong{opacity:.3}.NPLLIq_header{border-bottom:1px solid var(--dsw-alias-border-l1);cursor:grab;user-select:none;touch-action:none;justify-content:space-between;align-items:flex-start;gap:8px;padding:10px 12px;display:flex}.NPLLIq_header:active{cursor:grabbing}.NPLLIq_headerText{flex-direction:column;gap:2px;min-width:0;display:flex}.NPLLIq_title{color:var(--dsw-alias-label-primary);align-items:baseline;gap:6px;font-size:13px;font-weight:600;display:flex}.NPLLIq_version{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-size:10px;font-weight:500}.NPLLIq_versionNew{color:var(--dsw-alias-status-warning-foreground,#b56900);background:var(--dsw-alias-status-warning-background,#fff6d7);cursor:default;border-radius:4px;padding:1px 6px}.NPLLIq_subtitle{color:var(--dsw-alias-label-secondary);font-size:11px}.NPLLIq_collapse{color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:6px;flex:none;padding:2px 6px;font-size:11px}.NPLLIq_collapse:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1)}.NPLLIq_body{padding:4px 0;overflow-y:auto}.NPLLIq_row{border-bottom:1px solid var(--dsw-alias-border-l1);flex-direction:column;gap:6px;padding:8px 12px;display:flex}.NPLLIq_rowHeader{justify-content:space-between;align-items:center;gap:8px;display:flex}.NPLLIq_rowName{color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;align-items:center;gap:6px;font-size:12px;font-weight:500;display:inline-flex;overflow:hidden}.NPLLIq_currentBadge{color:var(--dsw-alias-state-success-primary);border:1px solid var(--dsw-alias-state-success-primary);border-radius:8px;flex:none;padding:1px 6px;font-size:10px}.NPLLIq_rowMeta{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;flex:none;font-size:11px}.NPLLIq_bar{background:var(--dsw-alias-bg-layer-1);border-radius:3px;height:6px;overflow:hidden}.NPLLIq_fillIdle{background:var(--dsw-alias-brand-primary);height:100%;transition:width .2s}.NPLLIq_fillWarn{background:var(--dsw-alias-state-warn-primary);height:100%;transition:width .2s}.NPLLIq_fillOver{background:var(--dsw-alias-state-error-primary);height:100%;transition:width .2s}.NPLLIq_controls{align-items:center;gap:6px;display:flex}.NPLLIq_input{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);min-width:0;color:var(--dsw-alias-label-primary);border-radius:6px;flex:1;padding:4px 8px;font-size:11px}.NPLLIq_input::placeholder{color:var(--dsw-alias-label-secondary)}.NPLLIq_save,.NPLLIq_switch{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);cursor:pointer;border-radius:6px;flex:none;padding:4px 10px;font-size:11px}.NPLLIq_save:hover,.NPLLIq_switch:hover:not(:disabled){background:var(--dsw-alias-bg-layer-2)}.NPLLIq_switch:disabled{opacity:.5;cursor:default}.NPLLIq_notice,.NPLLIq_noticeError{color:var(--dsw-alias-label-secondary);padding:10px 12px;font-size:12px}.NPLLIq_noticeError{color:var(--dsw-alias-state-error-primary)}.NPLLIq_tab{background:var(--dsw-alias-brand-primary);border:1px solid var(--dsw-alias-brand-primary);color:var(--dsw-alias-bg-overlay);pointer-events:auto;cursor:pointer;z-index:90;border-radius:10px;align-items:center;gap:6px;padding:9px 14px;font-size:12px;font-weight:600;display:inline-flex;position:fixed;top:56px;right:12px;box-shadow:0 6px 20px #00000040}.NPLLIq_tab:hover{filter:brightness(1.08)}.NPLLIq_tabIcon{font-size:12px;line-height:1}.NPLLIq_tabLabel{white-space:nowrap}.NPLLIq_headerActions{flex:none;align-items:center;gap:4px;display:flex}.NPLLIq_settingsBtn{color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:6px;flex:none;padding:2px 6px;font-size:11px}.NPLLIq_settingsBtn:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1)}.NPLLIq_settingsBtnActive{color:var(--dsw-alias-brand-primary)}.NPLLIq_selectBtn{border:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-brand-primary);cursor:pointer;background:0 0;border-radius:6px;flex:none;padding:1px 6px;font-size:10px}.NPLLIq_selectBtn:hover{background:var(--dsw-alias-bg-layer-1)}.NPLLIq_gearBtn{color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;flex:none;margin-left:6px;padding:0 2px;font-size:12px;line-height:1}.NPLLIq_gearBtn:hover{color:var(--dsw-alias-label-primary)}.NPLLIq_fullNotice{color:var(--dsw-alias-state-error-primary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-state-error-primary);border-radius:8px;margin:6px 12px;padding:8px 10px;font-size:12px}.NPLLIq_upgradeBanner{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-divider-1,#0000001a);border-radius:8px;margin:6px 12px;padding:10px 30px 10px 10px;font-size:12px;position:relative}@keyframes NPLLIq_upgradeBannerFlash{0%,to{border-color:var(--dsw-alias-divider-1,#0000001a);box-shadow:0 0 #f0a02000}50%{border-color:var(--dsw-alias-status-warning-foreground,#b56900);box-shadow:0 0 0 5px #f0a02073}}.NPLLIq_upgradeBannerFlash{border-color:var(--dsw-alias-status-warning-foreground,#b56900);animation:.6s ease-in-out 4 NPLLIq_upgradeBannerFlash}.NPLLIq_upgradeBannerText{margin-bottom:6px;font-weight:600}.NPLLIq_upgradeCommands{flex-direction:column;gap:4px;display:flex}.NPLLIq_upgradeCommandRow{align-items:center;gap:6px;display:flex}.NPLLIq_upgradeCommand{background:var(--dsw-alias-bg-layer-2,#0000000a);white-space:nowrap;border-radius:4px;flex:1;min-width:0;padding:4px 6px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;overflow-x:auto}.NPLLIq_copyBtn{border:1px solid var(--dsw-alias-divider-1,#00000026);background:var(--dsw-alias-bg-layer-2,#0000000a);color:var(--dsw-alias-label-primary);cursor:pointer;border-radius:4px;flex:none;padding:3px 8px;font-size:11px;transition:transform 80ms,background .12s,color .12s}.NPLLIq_copyBtn:hover{background:var(--dsw-alias-bg-layer-3,#00000014)}.NPLLIq_copyBtn:active{transform:scale(.92)}.NPLLIq_copyBtnDone{background:var(--dsw-alias-status-success-background,#14963c1f);border-color:var(--dsw-alias-status-success-foreground,#0a7d32);color:var(--dsw-alias-status-success-foreground,#0a7d32);font-weight:600}.NPLLIq_upgradeHint{color:var(--dsw-alias-label-secondary);margin-top:6px;font-size:11px}.NPLLIq_upgradeClose{width:20px;height:20px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:4px;font-size:16px;line-height:1;position:absolute;top:4px;right:6px}.NPLLIq_upgradeClose:hover{background:var(--dsw-alias-bg-layer-2,#0000000a);color:var(--dsw-alias-label-primary)}.NPLLIq_checkUpdatesRow{justify-content:space-between;align-items:center;gap:12px;display:flex}.NPLLIq_checkUpdatesLabel{color:var(--dsw-alias-label-primary);cursor:pointer;align-items:center;gap:6px;font-size:12px;display:flex}.NPLLIq_checkUpdatesLabel input{margin:0}.NPLLIq_checkUpdatesLabel input[type=range]{min-width:90px;accent-color:var(--dsw-alias-brand-primary);flex:1}.NPLLIq_checkUpdatesLabel select{background:var(--dsw-alias-bg-layer-2,#0000000a);min-width:90px;color:var(--dsw-alias-label-primary);border:1px solid var(--dsw-alias-divider-1,#00000026);border-radius:4px;flex:1;padding:2px 4px;font-size:12px}.NPLLIq_checkBtn{border:1px solid var(--dsw-alias-divider-1,#00000026);background:var(--dsw-alias-bg-layer-2,#0000000a);color:var(--dsw-alias-label-primary);cursor:pointer;white-space:nowrap;text-align:center;border-radius:4px;flex:none;min-width:72px;padding:4px 10px;font-size:12px}.NPLLIq_checkBtn:hover:not(:disabled){background:var(--dsw-alias-bg-layer-3,#00000014)}.NPLLIq_checkBtn:disabled{opacity:.6;cursor:default}.NPLLIq_checkErrorHint{color:var(--dsw-alias-state-error-primary,#c00);background:var(--dsw-alias-state-error-background,#ff00000f);border:1px solid var(--dsw-alias-state-error-border,#b4000040);word-break:break-all;border-radius:6px;margin-top:8px;padding:6px 8px;font-size:11px;line-height:1.4}.NPLLIq_dialog{z-index:100;box-sizing:border-box;background:var(--dsw-alias-bg-overlay);border:1px solid var(--dsw-alias-border-l1);border-radius:12px;flex-direction:column;gap:12px;width:280px;max-height:80vh;padding:14px;display:flex;position:fixed;top:50%;left:50%;overflow-y:auto;transform:translate(-50%,-50%);box-shadow:0 8px 28px #00000040}.NPLLIq_dialogTitle{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600}.NPLLIq_dialogSection{flex-direction:column;gap:6px;display:flex}.NPLLIq_dialogLabel{color:var(--dsw-alias-label-primary);font-size:12px;font-weight:500}.NPLLIq_monitorHint{color:var(--dsw-alias-label-secondary);font-size:11px}.NPLLIq_dialogHint{color:var(--dsw-alias-label-secondary);margin-top:4px;font-size:11px;line-height:1.4}.NPLLIq_monitorList{flex-direction:column;gap:2px;max-height:180px;display:flex;overflow-y:auto}.NPLLIq_monitorRow{color:var(--dsw-alias-label-primary);cursor:pointer;border-radius:6px;align-items:center;gap:6px;padding:2px 4px;font-size:12px;display:flex}.NPLLIq_monitorRow:hover{background:var(--dsw-alias-bg-layer-1)}.NPLLIq_monitorName{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.NPLLIq_radioRow{color:var(--dsw-alias-label-primary);cursor:pointer;border-radius:6px;align-items:center;gap:6px;padding:3px 4px;font-size:12px;display:flex}.NPLLIq_radioRow:hover{background:var(--dsw-alias-bg-layer-1)}.NPLLIq_dialogActions{justify-content:flex-end;gap:6px;display:flex}.NPLLIq_dialogBtn,.NPLLIq_dialogBtnPrimary{border:1px solid var(--dsw-alias-border-l1);cursor:pointer;border-radius:6px;padding:4px 12px;font-size:11px}.NPLLIq_dialogBtn{background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary)}.NPLLIq_dialogBtnPrimary{background:var(--dsw-alias-brand-primary);border-color:var(--dsw-alias-brand-primary);color:var(--dsw-alias-bg-overlay)}.NPLLIq_dialogHeader{z-index:2;background:var(--dsw-alias-bg-overlay);cursor:grab;user-select:none;touch-action:none;justify-content:space-between;align-items:center;gap:8px;margin:-14px -14px 0;padding:14px 14px 8px;display:flex;position:sticky;top:-14px}.NPLLIq_dialogHeader:active{cursor:grabbing}.NPLLIq_dialogClose{width:28px;height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:8px;flex:none;justify-content:center;align-items:center;font-size:18px;line-height:1;display:flex}.NPLLIq_dialogClose:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1)}.NPLLIq_resetRow{flex-wrap:wrap;align-items:center;gap:6px;display:flex}.NPLLIq_resetSelect{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);border-radius:6px;padding:3px 6px;font-size:12px}.NPLLIq_logTable{border-collapse:collapse;width:100%;font-size:11px}.NPLLIq_logTable th{text-align:left;color:var(--dsw-alias-label-secondary);border-bottom:1px solid var(--dsw-alias-border-l1);padding:4px 6px;font-weight:500}.NPLLIq_logTable td{color:var(--dsw-alias-label-primary);border-bottom:1px solid var(--dsw-alias-border-l1);font-variant-numeric:tabular-nums;padding:4px 6px}.NPLLIq_logDayCol{white-space:nowrap;color:var(--dsw-alias-label-secondary)}.NPLLIq_logModelCol{text-overflow:ellipsis;white-space:nowrap;max-width:160px;overflow:hidden}.NPLLIq_logUsedCol{text-align:right}.NPLLIq_logDialog{gap:0;width:380px;max-height:min(72vh,480px);padding:0}.NPLLIq_logHeader{background:var(--dsw-alias-bg-overlay);cursor:grab;user-select:none;touch-action:none;flex:none;justify-content:space-between;align-items:center;gap:8px;padding:14px 14px 8px;display:flex}.NPLLIq_logHeader:active{cursor:grabbing}.NPLLIq_logScroll{flex:1;min-height:0;padding:0 14px 14px;overflow:auto}.NPLLIq_logToolbar{flex:1;align-items:center;gap:6px;display:flex}.NPLLIq_logSearch{border:1px solid var(--dsw-alias-divider-1,#00000026);background:var(--dsw-alias-bg-layer-1,#0000000a);min-width:0;color:var(--dsw-alias-label-primary);border-radius:4px;flex:1;padding:3px 6px;font-size:11px}.NPLLIq_logSearch:focus{border-color:var(--dsw-alias-accent-1,#4a9eff);outline:none}.NPLLIq_logClearBtn{border:1px solid var(--dsw-alias-state-error-border,#b400004d);color:var(--dsw-alias-state-error-primary,#c00);cursor:pointer;white-space:nowrap;background:0 0;border-radius:4px;flex:none;padding:3px 8px;font-size:11px}.NPLLIq_logClearBtn:hover{background:var(--dsw-alias-state-error-background,#ff00000f)}.NPLLIq_logPager{border-top:1px solid var(--dsw-alias-divider-1,#00000014);background:var(--dsw-alias-bg-overlay);color:var(--dsw-alias-label-secondary);flex:none;justify-content:space-between;align-items:center;gap:8px;padding:6px 14px;font-size:11px;display:flex}.NPLLIq_logPagerInfo{white-space:nowrap}.NPLLIq_logPagerControls{align-items:center;gap:4px;display:flex}.NPLLIq_logPagerBtn{border:1px solid var(--dsw-alias-divider-1,#00000026);background:var(--dsw-alias-bg-layer-1,#0000000a);width:24px;height:24px;color:var(--dsw-alias-label-primary);cursor:pointer;border-radius:4px;font-size:13px;line-height:1}.NPLLIq_logPagerBtn:disabled{opacity:.4;cursor:default}.NPLLIq_logPagerPages{text-align:center;min-width:50px;color:var(--dsw-alias-label-secondary)}.NPLLIq_logPageSizeSelect{border:1px solid var(--dsw-alias-divider-1,#00000026);background:var(--dsw-alias-bg-layer-1,#0000000a);color:var(--dsw-alias-label-primary);cursor:pointer;border-radius:4px;padding:2px 4px;font-size:11px}.NPLLIq_dialogOverlay{z-index:100001;background:#0000004d;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.NPLLIq_logClearDialog{gap:0;width:320px;padding:16px}.NPLLIq_dialogBody{color:var(--dsw-alias-label-secondary);margin:6px 0 10px;font-size:12px;line-height:1.5}.NPLLIq_logClearDate{border:1px solid var(--dsw-alias-divider-1,#00000026);background:var(--dsw-alias-bg-layer-1,#0000000a);width:100%;color:var(--dsw-alias-label-primary);border-radius:6px;margin-bottom:12px;padding:6px 8px;font-size:13px}.NPLLIq_logClearDate:focus{border-color:var(--dsw-alias-accent-1,#4a9eff);outline:none}";
|
|
179
191
|
const tagId = "@jxgame2020/dsh-token-quota/TokenQuotaPanel.module.css";
|
|
180
192
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
181
193
|
const tag = document.createElement("style");
|
|
@@ -185,91 +197,92 @@ window.__ModuleLoader__.load({
|
|
|
185
197
|
document.head.appendChild(tag);
|
|
186
198
|
}
|
|
187
199
|
var TokenQuotaPanel_module_css_default = {
|
|
188
|
-
"
|
|
189
|
-
"controls": "NPLLIq_controls",
|
|
190
|
-
"save": "NPLLIq_save",
|
|
191
|
-
"upgradeCommand": "NPLLIq_upgradeCommand",
|
|
192
|
-
"versionNew": "NPLLIq_versionNew",
|
|
193
|
-
"title": "NPLLIq_title",
|
|
194
|
-
"rowName": "NPLLIq_rowName",
|
|
200
|
+
"dialogBtn": "NPLLIq_dialogBtn",
|
|
195
201
|
"currentBadge": "NPLLIq_currentBadge",
|
|
202
|
+
"panelDim": "NPLLIq_panelDim",
|
|
203
|
+
"row": "NPLLIq_row",
|
|
204
|
+
"controls": "NPLLIq_controls",
|
|
205
|
+
"logSearch": "NPLLIq_logSearch",
|
|
206
|
+
"logPagerControls": "NPLLIq_logPagerControls",
|
|
207
|
+
"logModelCol": "NPLLIq_logModelCol",
|
|
208
|
+
"logUsedCol": "NPLLIq_logUsedCol",
|
|
209
|
+
"logTable": "NPLLIq_logTable",
|
|
210
|
+
"checkUpdatesRow": "NPLLIq_checkUpdatesRow",
|
|
211
|
+
"resetRow": "NPLLIq_resetRow",
|
|
212
|
+
"monitorName": "NPLLIq_monitorName",
|
|
196
213
|
"resetSelect": "NPLLIq_resetSelect",
|
|
197
|
-
"
|
|
198
|
-
"
|
|
199
|
-
"settingsBtn": "NPLLIq_settingsBtn",
|
|
200
|
-
"logPager": "NPLLIq_logPager",
|
|
214
|
+
"settingsBtnActive": "NPLLIq_settingsBtnActive",
|
|
215
|
+
"upgradeBannerText": "NPLLIq_upgradeBannerText",
|
|
201
216
|
"upgradeClose": "NPLLIq_upgradeClose",
|
|
202
|
-
"logSearch": "NPLLIq_logSearch",
|
|
203
217
|
"fullNotice": "NPLLIq_fullNotice",
|
|
218
|
+
"radioRow": "NPLLIq_radioRow",
|
|
219
|
+
"dialogHint": "NPLLIq_dialogHint",
|
|
220
|
+
"rowHeader": "NPLLIq_rowHeader",
|
|
204
221
|
"dialogClose": "NPLLIq_dialogClose",
|
|
205
|
-
"
|
|
206
|
-
"logPagerPages": "NPLLIq_logPagerPages",
|
|
207
|
-
"logClearBtn": "NPLLIq_logClearBtn",
|
|
208
|
-
"header": "NPLLIq_header",
|
|
209
|
-
"dialogOverlay": "NPLLIq_dialogOverlay",
|
|
210
|
-
"dialogHeader": "NPLLIq_dialogHeader",
|
|
222
|
+
"selectBtn": "NPLLIq_selectBtn",
|
|
211
223
|
"upgradeCommands": "NPLLIq_upgradeCommands",
|
|
224
|
+
"fillWarn": "NPLLIq_fillWarn",
|
|
225
|
+
"upgradeCommand": "NPLLIq_upgradeCommand",
|
|
226
|
+
"checkBtn": "NPLLIq_checkBtn",
|
|
212
227
|
"dialog": "NPLLIq_dialog",
|
|
213
|
-
"
|
|
214
|
-
"
|
|
228
|
+
"logDayCol": "NPLLIq_logDayCol",
|
|
229
|
+
"dialogBtnPrimary": "NPLLIq_dialogBtnPrimary",
|
|
230
|
+
"logPager": "NPLLIq_logPager",
|
|
231
|
+
"dialogOverlay": "NPLLIq_dialogOverlay",
|
|
232
|
+
"dialogSection": "NPLLIq_dialogSection",
|
|
233
|
+
"logClearDialog": "NPLLIq_logClearDialog",
|
|
234
|
+
"headerText": "NPLLIq_headerText",
|
|
235
|
+
"notice": "NPLLIq_notice",
|
|
236
|
+
"tabLabel": "NPLLIq_tabLabel",
|
|
215
237
|
"dialogActions": "NPLLIq_dialogActions",
|
|
216
238
|
"subtitle": "NPLLIq_subtitle",
|
|
217
|
-
"
|
|
218
|
-
"copyBtn": "NPLLIq_copyBtn",
|
|
239
|
+
"logClearDate": "NPLLIq_logClearDate",
|
|
219
240
|
"headerActions": "NPLLIq_headerActions",
|
|
220
|
-
"
|
|
241
|
+
"dialogTitle": "NPLLIq_dialogTitle",
|
|
242
|
+
"logClearBtn": "NPLLIq_logClearBtn",
|
|
243
|
+
"dialogBody": "NPLLIq_dialogBody",
|
|
244
|
+
"title": "NPLLIq_title",
|
|
221
245
|
"upgradeHint": "NPLLIq_upgradeHint",
|
|
222
|
-
"resetRow": "NPLLIq_resetRow",
|
|
223
|
-
"logClearDate": "NPLLIq_logClearDate",
|
|
224
|
-
"input": "NPLLIq_input",
|
|
225
|
-
"copyBtnDone": "NPLLIq_copyBtnDone",
|
|
226
|
-
"bar": "NPLLIq_bar",
|
|
227
246
|
"version": "NPLLIq_version",
|
|
228
|
-
"tabIcon": "NPLLIq_tabIcon",
|
|
229
|
-
"dialogTitle": "NPLLIq_dialogTitle",
|
|
230
|
-
"logDialog": "NPLLIq_logDialog",
|
|
231
|
-
"checkErrorHint": "NPLLIq_checkErrorHint",
|
|
232
247
|
"body": "NPLLIq_body",
|
|
233
|
-
"
|
|
234
|
-
"
|
|
235
|
-
"
|
|
236
|
-
"
|
|
248
|
+
"logPagerPages": "NPLLIq_logPagerPages",
|
|
249
|
+
"monitorList": "NPLLIq_monitorList",
|
|
250
|
+
"logHeader": "NPLLIq_logHeader",
|
|
251
|
+
"copyBtnDone": "NPLLIq_copyBtnDone",
|
|
252
|
+
"tab": "NPLLIq_tab",
|
|
253
|
+
"monitorHint": "NPLLIq_monitorHint",
|
|
254
|
+
"settingsBtn": "NPLLIq_settingsBtn",
|
|
255
|
+
"panelDimStrong": "NPLLIq_panelDimStrong",
|
|
256
|
+
"logToolbar": "NPLLIq_logToolbar",
|
|
257
|
+
"logPagerInfo": "NPLLIq_logPagerInfo",
|
|
237
258
|
"logScroll": "NPLLIq_logScroll",
|
|
259
|
+
"checkErrorHint": "NPLLIq_checkErrorHint",
|
|
260
|
+
"rowMeta": "NPLLIq_rowMeta",
|
|
261
|
+
"logPagerBtn": "NPLLIq_logPagerBtn",
|
|
262
|
+
"logPageSizeSelect": "NPLLIq_logPageSizeSelect",
|
|
263
|
+
"bar": "NPLLIq_bar",
|
|
264
|
+
"input": "NPLLIq_input",
|
|
265
|
+
"panel": "NPLLIq_panel",
|
|
266
|
+
"gearBtn": "NPLLIq_gearBtn",
|
|
267
|
+
"tabIcon": "NPLLIq_tabIcon",
|
|
238
268
|
"upgradeBanner": "NPLLIq_upgradeBanner",
|
|
239
|
-
"
|
|
240
|
-
"
|
|
269
|
+
"noticeError": "NPLLIq_noticeError",
|
|
270
|
+
"upgradeBannerFlash": "NPLLIq_upgradeBannerFlash",
|
|
271
|
+
"copyBtn": "NPLLIq_copyBtn",
|
|
272
|
+
"switch": "NPLLIq_switch",
|
|
273
|
+
"collapse": "NPLLIq_collapse",
|
|
241
274
|
"monitorRow": "NPLLIq_monitorRow",
|
|
242
|
-
"tabLabel": "NPLLIq_tabLabel",
|
|
243
|
-
"upgradeBannerText": "NPLLIq_upgradeBannerText",
|
|
244
|
-
"checkUpdatesRow": "NPLLIq_checkUpdatesRow",
|
|
245
275
|
"dialogLabel": "NPLLIq_dialogLabel",
|
|
246
|
-
"gearBtn": "NPLLIq_gearBtn",
|
|
247
|
-
"dialogBtnPrimary": "NPLLIq_dialogBtnPrimary",
|
|
248
|
-
"notice": "NPLLIq_notice",
|
|
249
|
-
"fillWarn": "NPLLIq_fillWarn",
|
|
250
276
|
"fillOver": "NPLLIq_fillOver",
|
|
251
|
-
"
|
|
252
|
-
"
|
|
253
|
-
"
|
|
254
|
-
"logDayCol": "NPLLIq_logDayCol",
|
|
255
|
-
"logModelCol": "NPLLIq_logModelCol",
|
|
256
|
-
"monitorHint": "NPLLIq_monitorHint",
|
|
257
|
-
"logPagerControls": "NPLLIq_logPagerControls",
|
|
258
|
-
"upgradeBannerFlash": "NPLLIq_upgradeBannerFlash",
|
|
259
|
-
"switch": "NPLLIq_switch",
|
|
260
|
-
"headerText": "NPLLIq_headerText",
|
|
277
|
+
"versionNew": "NPLLIq_versionNew",
|
|
278
|
+
"rowName": "NPLLIq_rowName",
|
|
279
|
+
"save": "NPLLIq_save",
|
|
261
280
|
"upgradeCommandRow": "NPLLIq_upgradeCommandRow",
|
|
262
|
-
"
|
|
263
|
-
"
|
|
264
|
-
"
|
|
265
|
-
"
|
|
266
|
-
"
|
|
267
|
-
"tab": "NPLLIq_tab",
|
|
268
|
-
"monitorName": "NPLLIq_monitorName",
|
|
269
|
-
"logPagerInfo": "NPLLIq_logPagerInfo",
|
|
270
|
-
"logPagerBtn": "NPLLIq_logPagerBtn",
|
|
271
|
-
"logClearDialog": "NPLLIq_logClearDialog",
|
|
272
|
-
"logToolbar": "NPLLIq_logToolbar"
|
|
281
|
+
"fillIdle": "NPLLIq_fillIdle",
|
|
282
|
+
"dialogHeader": "NPLLIq_dialogHeader",
|
|
283
|
+
"logDialog": "NPLLIq_logDialog",
|
|
284
|
+
"checkUpdatesLabel": "NPLLIq_checkUpdatesLabel",
|
|
285
|
+
"header": "NPLLIq_header"
|
|
273
286
|
};
|
|
274
287
|
//#endregion
|
|
275
288
|
//#region lib/types/client/TokenQuotaPanel.js
|
|
@@ -356,7 +369,7 @@ window.__ModuleLoader__.load({
|
|
|
356
369
|
* @param props - composed slot props.
|
|
357
370
|
* @returns the panel element tree.
|
|
358
371
|
*/
|
|
359
|
-
function TokenQuotaPanel({ t, load, setLimit, selectModel, setMonitored, setOnFull, setReset, setCheckUpdates, checkUpdatesNow, clearLogBefore, setDimWhenIdle, useStore, actions, useSessions }) {
|
|
372
|
+
function TokenQuotaPanel({ t, load, setLimit, selectModel, setMonitored, setOnFull, setReset, setCheckUpdates, checkUpdatesNow, clearLogBefore, setDimWhenIdle, setMusicEnabled, setMusicVolume, setMusicStyle, useStore, actions, useSessions }) {
|
|
360
373
|
const [collapsed, setCollapsed] = (0, react.useState)(false);
|
|
361
374
|
const [drafts, setDrafts] = (0, react.useState)({});
|
|
362
375
|
const [editingKey, setEditingKey] = (0, react.useState)(null);
|
|
@@ -387,6 +400,9 @@ window.__ModuleLoader__.load({
|
|
|
387
400
|
const onFull = useStore((s) => s.onFull);
|
|
388
401
|
const checkUpdates = useStore((s) => s.checkUpdates);
|
|
389
402
|
const dimWhenIdle = useStore((s) => s.dimWhenIdle);
|
|
403
|
+
const musicEnabled = useStore((s) => s.musicEnabled);
|
|
404
|
+
const musicVolume = useStore((s) => s.musicVolume);
|
|
405
|
+
const musicStyle = useStore((s) => s.musicStyle);
|
|
390
406
|
const upgrade = useStore((s) => s.upgrade);
|
|
391
407
|
const upgradeDismissed = useStore((s) => s.upgradeDismissed);
|
|
392
408
|
const checkingUpdates = useStore((s) => s.checkingUpdates);
|
|
@@ -571,13 +587,13 @@ window.__ModuleLoader__.load({
|
|
|
571
587
|
title: t("upgradeAvailableHint"),
|
|
572
588
|
children: [
|
|
573
589
|
"v",
|
|
574
|
-
"0.1.
|
|
590
|
+
"0.1.24",
|
|
575
591
|
" → v",
|
|
576
592
|
upgrade.latestVersion
|
|
577
593
|
]
|
|
578
594
|
}) : (0, react_jsx_runtime.jsxs)("span", {
|
|
579
595
|
className: TokenQuotaPanel_module_css_default.version,
|
|
580
|
-
children: ["v", "0.1.
|
|
596
|
+
children: ["v", "0.1.24"]
|
|
581
597
|
})]
|
|
582
598
|
}), (0, react_jsx_runtime.jsx)("div", {
|
|
583
599
|
className: TokenQuotaPanel_module_css_default.subtitle,
|
|
@@ -589,6 +605,15 @@ window.__ModuleLoader__.load({
|
|
|
589
605
|
event.stopPropagation();
|
|
590
606
|
},
|
|
591
607
|
children: [
|
|
608
|
+
(0, react_jsx_runtime.jsx)("button", {
|
|
609
|
+
type: "button",
|
|
610
|
+
className: `${TokenQuotaPanel_module_css_default.settingsBtn}${musicEnabled ? ` ${TokenQuotaPanel_module_css_default.settingsBtnActive}` : ""}`,
|
|
611
|
+
title: t("musicHint"),
|
|
612
|
+
onClick: () => {
|
|
613
|
+
setMusicEnabled(!musicEnabled);
|
|
614
|
+
},
|
|
615
|
+
children: musicEnabled ? "🔊" : "♪"
|
|
616
|
+
}),
|
|
592
617
|
(0, react_jsx_runtime.jsx)("button", {
|
|
593
618
|
type: "button",
|
|
594
619
|
className: TokenQuotaPanel_module_css_default.settingsBtn,
|
|
@@ -914,6 +939,60 @@ window.__ModuleLoader__.load({
|
|
|
914
939
|
children: t("dimWhenIdleHint")
|
|
915
940
|
})]
|
|
916
941
|
}),
|
|
942
|
+
(0, react_jsx_runtime.jsxs)("div", {
|
|
943
|
+
className: TokenQuotaPanel_module_css_default.dialogSection,
|
|
944
|
+
children: [
|
|
945
|
+
(0, react_jsx_runtime.jsxs)("label", {
|
|
946
|
+
className: TokenQuotaPanel_module_css_default.checkUpdatesLabel,
|
|
947
|
+
children: [(0, react_jsx_runtime.jsx)("input", {
|
|
948
|
+
type: "checkbox",
|
|
949
|
+
checked: musicEnabled,
|
|
950
|
+
onChange: (event) => {
|
|
951
|
+
setMusicEnabled(event.target.checked);
|
|
952
|
+
}
|
|
953
|
+
}), (0, react_jsx_runtime.jsx)("span", { children: t("musicLabel") })]
|
|
954
|
+
}),
|
|
955
|
+
(0, react_jsx_runtime.jsx)("div", {
|
|
956
|
+
className: TokenQuotaPanel_module_css_default.dialogHint,
|
|
957
|
+
children: t("musicHint")
|
|
958
|
+
}),
|
|
959
|
+
musicEnabled && (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsxs)("label", {
|
|
960
|
+
className: TokenQuotaPanel_module_css_default.checkUpdatesLabel,
|
|
961
|
+
children: [(0, react_jsx_runtime.jsx)("span", { children: t("musicVolume") }), (0, react_jsx_runtime.jsx)("input", {
|
|
962
|
+
type: "range",
|
|
963
|
+
min: 0,
|
|
964
|
+
max: 1,
|
|
965
|
+
step: .05,
|
|
966
|
+
value: musicVolume,
|
|
967
|
+
onChange: (event) => {
|
|
968
|
+
setMusicVolume(Number(event.target.value));
|
|
969
|
+
}
|
|
970
|
+
})]
|
|
971
|
+
}), (0, react_jsx_runtime.jsxs)("label", {
|
|
972
|
+
className: TokenQuotaPanel_module_css_default.checkUpdatesLabel,
|
|
973
|
+
children: [(0, react_jsx_runtime.jsx)("span", { children: t("musicStyle") }), (0, react_jsx_runtime.jsxs)("select", {
|
|
974
|
+
value: musicStyle,
|
|
975
|
+
onChange: (event) => {
|
|
976
|
+
setMusicStyle(event.target.value);
|
|
977
|
+
},
|
|
978
|
+
children: [
|
|
979
|
+
(0, react_jsx_runtime.jsx)("option", {
|
|
980
|
+
value: "major",
|
|
981
|
+
children: t("musicStyleMajor")
|
|
982
|
+
}),
|
|
983
|
+
(0, react_jsx_runtime.jsx)("option", {
|
|
984
|
+
value: "minor",
|
|
985
|
+
children: t("musicStyleMinor")
|
|
986
|
+
}),
|
|
987
|
+
(0, react_jsx_runtime.jsx)("option", {
|
|
988
|
+
value: "pentatonic",
|
|
989
|
+
children: t("musicStylePentatonic")
|
|
990
|
+
})
|
|
991
|
+
]
|
|
992
|
+
})]
|
|
993
|
+
})] })
|
|
994
|
+
]
|
|
995
|
+
}),
|
|
917
996
|
(0, react_jsx_runtime.jsxs)("div", {
|
|
918
997
|
className: TokenQuotaPanel_module_css_default.dialogSection,
|
|
919
998
|
children: [(0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -1129,6 +1208,332 @@ window.__ModuleLoader__.load({
|
|
|
1129
1208
|
});
|
|
1130
1209
|
}
|
|
1131
1210
|
//#endregion
|
|
1211
|
+
//#region lib/types/client/music.js
|
|
1212
|
+
/**
|
|
1213
|
+
* Live-composed soundtrack driven by host actions (turns, steps, tool calls,
|
|
1214
|
+
* etc.). Outputs through Web Audio (built-in synthesis) by default, and also
|
|
1215
|
+
* sends MIDI NoteOn/NoteOff to the first available MIDI output when one is
|
|
1216
|
+
* detected (both play simultaneously when MIDI is present — use the panel
|
|
1217
|
+
* volume for overall level, the MIDI output has its own gain on the receiver).
|
|
1218
|
+
*
|
|
1219
|
+
* The composition is intentionally simple: a fixed chord progression under a
|
|
1220
|
+
* scale-constrained melody, with one short musical gesture per host action.
|
|
1221
|
+
* It is meant as gentle ambience while waiting for LLM responses, not as a
|
|
1222
|
+
* full piece — everything stays in key so you can never hit a wrong note.
|
|
1223
|
+
*
|
|
1224
|
+
* @module @jxgame2020/dsh-token-quota/music
|
|
1225
|
+
*/
|
|
1226
|
+
/** Scale degrees in semitones from the root. */
|
|
1227
|
+
const SCALES = {
|
|
1228
|
+
major: [
|
|
1229
|
+
0,
|
|
1230
|
+
2,
|
|
1231
|
+
4,
|
|
1232
|
+
5,
|
|
1233
|
+
7,
|
|
1234
|
+
9,
|
|
1235
|
+
11
|
|
1236
|
+
],
|
|
1237
|
+
minor: [
|
|
1238
|
+
0,
|
|
1239
|
+
2,
|
|
1240
|
+
3,
|
|
1241
|
+
5,
|
|
1242
|
+
7,
|
|
1243
|
+
8,
|
|
1244
|
+
10
|
|
1245
|
+
],
|
|
1246
|
+
pentatonic: [
|
|
1247
|
+
0,
|
|
1248
|
+
2,
|
|
1249
|
+
4,
|
|
1250
|
+
7,
|
|
1251
|
+
9
|
|
1252
|
+
]
|
|
1253
|
+
};
|
|
1254
|
+
/**
|
|
1255
|
+
* Chord progression roots in semitones from the key centre. Loops — every
|
|
1256
|
+
* step advance moves one position forward.
|
|
1257
|
+
*/
|
|
1258
|
+
const CHORD_PROGRESSIONS = {
|
|
1259
|
+
major: [
|
|
1260
|
+
0,
|
|
1261
|
+
9,
|
|
1262
|
+
5,
|
|
1263
|
+
7
|
|
1264
|
+
],
|
|
1265
|
+
minor: [
|
|
1266
|
+
0,
|
|
1267
|
+
9,
|
|
1268
|
+
4,
|
|
1269
|
+
11
|
|
1270
|
+
],
|
|
1271
|
+
pentatonic: [
|
|
1272
|
+
0,
|
|
1273
|
+
7,
|
|
1274
|
+
2,
|
|
1275
|
+
9
|
|
1276
|
+
]
|
|
1277
|
+
};
|
|
1278
|
+
const CHORD_QUALITIES = {
|
|
1279
|
+
major: [
|
|
1280
|
+
"major",
|
|
1281
|
+
"minor",
|
|
1282
|
+
"major",
|
|
1283
|
+
"major"
|
|
1284
|
+
],
|
|
1285
|
+
minor: [
|
|
1286
|
+
"minor",
|
|
1287
|
+
"major",
|
|
1288
|
+
"major",
|
|
1289
|
+
"major"
|
|
1290
|
+
],
|
|
1291
|
+
pentatonic: [
|
|
1292
|
+
"major",
|
|
1293
|
+
"major",
|
|
1294
|
+
"major",
|
|
1295
|
+
"major"
|
|
1296
|
+
]
|
|
1297
|
+
};
|
|
1298
|
+
/**
|
|
1299
|
+
* Turn a MIDI note number into a frequency (Hz) using equal temperament at
|
|
1300
|
+
* A4 = 440 Hz.
|
|
1301
|
+
*/
|
|
1302
|
+
function midiToFreq(midi) {
|
|
1303
|
+
return 440 * Math.pow(2, (midi - 69) / 12);
|
|
1304
|
+
}
|
|
1305
|
+
/** Live-composed music engine driven by host actions. */
|
|
1306
|
+
var TokenQuotaMusic = class TokenQuotaMusic {
|
|
1307
|
+
audio = null;
|
|
1308
|
+
midiOutput = null;
|
|
1309
|
+
midiDetected = false;
|
|
1310
|
+
enabled = false;
|
|
1311
|
+
volume = .5;
|
|
1312
|
+
style = "major";
|
|
1313
|
+
/** Current position in the chord progression (advances per step). */
|
|
1314
|
+
chordIndex = 0;
|
|
1315
|
+
/** Step counter — used for melody degree selection. */
|
|
1316
|
+
stepCount = 0;
|
|
1317
|
+
/** Tool counter — used for tool-note pitch. */
|
|
1318
|
+
toolCount = 0;
|
|
1319
|
+
/**
|
|
1320
|
+
* Progress layer: while a request is in flight (thinking + streaming) the
|
|
1321
|
+
* engine ticks a quiet scale-walking background note every tick so the wait
|
|
1322
|
+
* is audible. Cleared on assistant/message, assistant/attempt or turn/end.
|
|
1323
|
+
*/
|
|
1324
|
+
progressTimer;
|
|
1325
|
+
/** Direction of the progress walk: +1 up the scale, -1 down. */
|
|
1326
|
+
progressDir = 1;
|
|
1327
|
+
/** Scale degree of the next progress note. */
|
|
1328
|
+
progressDegree = 0;
|
|
1329
|
+
/** Base MIDI note of the current key. C4 = middle C. */
|
|
1330
|
+
static BASE_MIDI = 60;
|
|
1331
|
+
/** Tick interval of the progress layer (ms). */
|
|
1332
|
+
static PROGRESS_TICK_MS = 750;
|
|
1333
|
+
/** True once the audio context has been started (needs a user gesture). */
|
|
1334
|
+
get started() {
|
|
1335
|
+
return this.audio !== null;
|
|
1336
|
+
}
|
|
1337
|
+
/**
|
|
1338
|
+
* Start the audio context and try to find a MIDI output.
|
|
1339
|
+
* Must be called inside a user gesture (the panel switch click) so the
|
|
1340
|
+
* AudioContext can resume. Safe to call multiple times.
|
|
1341
|
+
*/
|
|
1342
|
+
async ensureStarted() {
|
|
1343
|
+
if (this.audio !== null) return true;
|
|
1344
|
+
if (typeof window === "undefined") return false;
|
|
1345
|
+
try {
|
|
1346
|
+
this.audio = new AudioContext();
|
|
1347
|
+
await this.audio.resume();
|
|
1348
|
+
} catch {
|
|
1349
|
+
this.audio = null;
|
|
1350
|
+
return false;
|
|
1351
|
+
}
|
|
1352
|
+
if (!this.midiDetected && "requestMIDIAccess" in navigator) {
|
|
1353
|
+
this.midiDetected = true;
|
|
1354
|
+
try {
|
|
1355
|
+
const access = await navigator.requestMIDIAccess();
|
|
1356
|
+
for (const output of access.outputs.values()) {
|
|
1357
|
+
this.midiOutput = output;
|
|
1358
|
+
break;
|
|
1359
|
+
}
|
|
1360
|
+
} catch {
|
|
1361
|
+
this.midiOutput = null;
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
return true;
|
|
1365
|
+
}
|
|
1366
|
+
setEnabled(value) {
|
|
1367
|
+
this.enabled = value;
|
|
1368
|
+
if (!value) this.stopProgress();
|
|
1369
|
+
}
|
|
1370
|
+
setVolume(value) {
|
|
1371
|
+
this.volume = Math.max(0, Math.min(1, value));
|
|
1372
|
+
}
|
|
1373
|
+
setStyle(value) {
|
|
1374
|
+
this.style = value;
|
|
1375
|
+
}
|
|
1376
|
+
/** Start the quiet in-flight background loop (idempotent). */
|
|
1377
|
+
startProgress() {
|
|
1378
|
+
if (!this.audio || !this.enabled) return;
|
|
1379
|
+
if (this.progressTimer !== void 0) return;
|
|
1380
|
+
this.progressDegree = 0;
|
|
1381
|
+
this.progressDir = 1;
|
|
1382
|
+
const tick = () => {
|
|
1383
|
+
if (!this.audio || !this.enabled) return;
|
|
1384
|
+
const scale = SCALES[this.style];
|
|
1385
|
+
const degree = this.progressDegree % scale.length;
|
|
1386
|
+
const note = TokenQuotaMusic.BASE_MIDI + 12 + (scale[degree] ?? 0);
|
|
1387
|
+
this.playNote(note, .18, .22);
|
|
1388
|
+
const next = this.progressDegree + this.progressDir;
|
|
1389
|
+
if (next >= scale.length) {
|
|
1390
|
+
this.progressDir = -1;
|
|
1391
|
+
this.progressDegree = scale.length - 2;
|
|
1392
|
+
} else if (next < 0) {
|
|
1393
|
+
this.progressDir = 1;
|
|
1394
|
+
this.progressDegree = 0;
|
|
1395
|
+
} else this.progressDegree = next;
|
|
1396
|
+
};
|
|
1397
|
+
tick();
|
|
1398
|
+
this.progressTimer = setInterval(tick, TokenQuotaMusic.PROGRESS_TICK_MS);
|
|
1399
|
+
}
|
|
1400
|
+
/** Stop the in-flight background loop. */
|
|
1401
|
+
stopProgress() {
|
|
1402
|
+
if (this.progressTimer !== void 0) {
|
|
1403
|
+
clearInterval(this.progressTimer);
|
|
1404
|
+
this.progressTimer = void 0;
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
/** Handle one incoming host action and turn it into sound. */
|
|
1408
|
+
onAction(action) {
|
|
1409
|
+
if (!this.enabled || this.audio === null) return;
|
|
1410
|
+
const base = TokenQuotaMusic.BASE_MIDI;
|
|
1411
|
+
switch (action.type) {
|
|
1412
|
+
case "turn/start":
|
|
1413
|
+
this.stopProgress();
|
|
1414
|
+
this.chordIndex = 0;
|
|
1415
|
+
this.stepCount = 0;
|
|
1416
|
+
this.toolCount = 0;
|
|
1417
|
+
this.playChord(base, this.currentChordQuality(), 1.6, .55);
|
|
1418
|
+
break;
|
|
1419
|
+
case "step/start": {
|
|
1420
|
+
this.chordIndex = (this.chordIndex + 1) % CHORD_PROGRESSIONS[this.style].length;
|
|
1421
|
+
this.stepCount += 1;
|
|
1422
|
+
this.playNote(this.currentChordRoot(base) - 12, 1.2, .35);
|
|
1423
|
+
const root = this.currentChordRoot(base);
|
|
1424
|
+
const [d1, d2, d3] = this.arpeggioDegrees();
|
|
1425
|
+
setTimeout(() => this.playNote(root + d1, .2, .4), 0);
|
|
1426
|
+
setTimeout(() => this.playNote(root + d2, .2, .4), 80);
|
|
1427
|
+
setTimeout(() => this.playNote(root + d3, .35, .4), 160);
|
|
1428
|
+
break;
|
|
1429
|
+
}
|
|
1430
|
+
case "request/header": {
|
|
1431
|
+
this.startProgress();
|
|
1432
|
+
const degree = (this.stepCount * 2 + this.toolCount) % SCALES[this.style].length;
|
|
1433
|
+
const note = base + 12 + SCALES[this.style][degree];
|
|
1434
|
+
this.playNote(note, .18, .35);
|
|
1435
|
+
break;
|
|
1436
|
+
}
|
|
1437
|
+
case "tool/call":
|
|
1438
|
+
this.toolCount += 1;
|
|
1439
|
+
this.playNote(base + 24 + this.toolCount % 3 * 2, .12, .45);
|
|
1440
|
+
this.playNote(base - 12, .08, .25);
|
|
1441
|
+
break;
|
|
1442
|
+
case "tool/result":
|
|
1443
|
+
if (action.error) {
|
|
1444
|
+
this.playNote(base + 13, .18, .4);
|
|
1445
|
+
setTimeout(() => this.playNote(base + 12, .25, .4), 90);
|
|
1446
|
+
} else {
|
|
1447
|
+
this.playNote(base + 9, .14, .3);
|
|
1448
|
+
setTimeout(() => this.playNote(base + 11, .22, .3), 70);
|
|
1449
|
+
}
|
|
1450
|
+
break;
|
|
1451
|
+
case "assistant/attempt":
|
|
1452
|
+
this.stopProgress();
|
|
1453
|
+
this.playNote(base + 8, .18, .4);
|
|
1454
|
+
setTimeout(() => this.playNote(base + 7, .2, .4), 100);
|
|
1455
|
+
setTimeout(() => this.playNote(base + 5, .25, .4), 200);
|
|
1456
|
+
break;
|
|
1457
|
+
case "assistant/message":
|
|
1458
|
+
this.stopProgress();
|
|
1459
|
+
if (action.interrupted) this.playChord(base + 7, "dim", .9, .5);
|
|
1460
|
+
else this.playChord(this.currentChordRoot(base), this.currentChordQuality(), 1.1, .55);
|
|
1461
|
+
break;
|
|
1462
|
+
case "turn/end":
|
|
1463
|
+
this.stopProgress();
|
|
1464
|
+
this.playChord(base, this.style === "minor" ? "minor" : "major", 2.2, .65);
|
|
1465
|
+
this.chordIndex = 0;
|
|
1466
|
+
break;
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
currentChordRoot(base) {
|
|
1470
|
+
const prog = CHORD_PROGRESSIONS[this.style];
|
|
1471
|
+
return base + prog[this.chordIndex % prog.length];
|
|
1472
|
+
}
|
|
1473
|
+
currentChordQuality() {
|
|
1474
|
+
const q = CHORD_QUALITIES[this.style];
|
|
1475
|
+
return q[this.chordIndex % q.length] ?? "major";
|
|
1476
|
+
}
|
|
1477
|
+
/** Intervals of an ascending arpeggio from the chord root. */
|
|
1478
|
+
arpeggioDegrees() {
|
|
1479
|
+
return this.style === "pentatonic" ? [
|
|
1480
|
+
0,
|
|
1481
|
+
7,
|
|
1482
|
+
12
|
|
1483
|
+
] : this.currentChordQuality() === "major" ? [
|
|
1484
|
+
0,
|
|
1485
|
+
4,
|
|
1486
|
+
7
|
|
1487
|
+
] : [
|
|
1488
|
+
0,
|
|
1489
|
+
3,
|
|
1490
|
+
7
|
|
1491
|
+
];
|
|
1492
|
+
}
|
|
1493
|
+
/** Play one note: Web Audio + MIDI simultaneously when available. */
|
|
1494
|
+
playNote(midi, durationSec, velocity) {
|
|
1495
|
+
if (!this.audio) return;
|
|
1496
|
+
const now = this.audio.currentTime;
|
|
1497
|
+
const peak = this.volume * velocity * .5;
|
|
1498
|
+
if (peak <= 0) return;
|
|
1499
|
+
const osc = this.audio.createOscillator();
|
|
1500
|
+
osc.type = "sine";
|
|
1501
|
+
osc.frequency.value = midiToFreq(midi);
|
|
1502
|
+
const gain = this.audio.createGain();
|
|
1503
|
+
gain.gain.setValueAtTime(0, now);
|
|
1504
|
+
gain.gain.linearRampToValueAtTime(peak, now + .008);
|
|
1505
|
+
gain.gain.exponentialRampToValueAtTime(.001, now + durationSec);
|
|
1506
|
+
osc.connect(gain);
|
|
1507
|
+
gain.connect(this.audio.destination);
|
|
1508
|
+
osc.start(now);
|
|
1509
|
+
osc.stop(now + durationSec + .05);
|
|
1510
|
+
if (this.midiOutput !== null) {
|
|
1511
|
+
const vel = Math.max(1, Math.floor(velocity * 127));
|
|
1512
|
+
this.midiOutput.send([
|
|
1513
|
+
144,
|
|
1514
|
+
midi & 127,
|
|
1515
|
+
vel
|
|
1516
|
+
]);
|
|
1517
|
+
setTimeout(() => {
|
|
1518
|
+
this.midiOutput?.send([
|
|
1519
|
+
128,
|
|
1520
|
+
midi & 127,
|
|
1521
|
+
0
|
|
1522
|
+
]);
|
|
1523
|
+
}, durationSec * 1e3);
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
/** Play a three-note chord plus a bass octave below. */
|
|
1527
|
+
playChord(rootMidi, quality, durationSec, velocity) {
|
|
1528
|
+
const third = quality === "major" ? 4 : 3;
|
|
1529
|
+
const fifth = quality === "dim" ? 6 : 7;
|
|
1530
|
+
this.playNote(rootMidi, durationSec, velocity * .45);
|
|
1531
|
+
this.playNote(rootMidi + third, durationSec, velocity * .35);
|
|
1532
|
+
this.playNote(rootMidi + fifth, durationSec, velocity * .35);
|
|
1533
|
+
this.playNote(rootMidi - 12, durationSec * 1.15, velocity * .45);
|
|
1534
|
+
}
|
|
1535
|
+
};
|
|
1536
|
+
//#endregion
|
|
1132
1537
|
//#region lib/types/client/locales.js
|
|
1133
1538
|
/**
|
|
1134
1539
|
* Token-quota panel copy (zh + en). The panel is a product surface, so the
|
|
@@ -1198,6 +1603,13 @@ window.__ModuleLoader__.load({
|
|
|
1198
1603
|
checkUpdatesLabel: "自动检查更新",
|
|
1199
1604
|
dimWhenIdleLabel: "失焦时窗口透明",
|
|
1200
1605
|
dimWhenIdleHint: "鼠标移开面板时降低不透明度,输入文字时更透明;鼠标悬停恢复",
|
|
1606
|
+
musicLabel: "动作音乐",
|
|
1607
|
+
musicHint: "根据 Harness 动作实时作曲:请求开始、工具调用、回合结束等(需点击开关启动音频;检测到 MIDI 输出时同步发送 MIDI)",
|
|
1608
|
+
musicVolume: "音量",
|
|
1609
|
+
musicStyle: "风格",
|
|
1610
|
+
musicStyleMajor: "大调",
|
|
1611
|
+
musicStyleMinor: "小调",
|
|
1612
|
+
musicStylePentatonic: "五声",
|
|
1201
1613
|
checkUpdatesNow: "立即检查",
|
|
1202
1614
|
checkingUpdates: "检查中…",
|
|
1203
1615
|
checkUpToDate: "已是最新",
|
|
@@ -1265,6 +1677,13 @@ window.__ModuleLoader__.load({
|
|
|
1265
1677
|
checkUpdatesLabel: "Check for updates automatically",
|
|
1266
1678
|
dimWhenIdleLabel: "Dim panel when unfocused",
|
|
1267
1679
|
dimWhenIdleHint: "Fade the panel out when the pointer is away (more while typing); hover to restore",
|
|
1680
|
+
musicLabel: "Action music",
|
|
1681
|
+
musicHint: "Live-composes from Harness actions: request starts, tool calls, turn ends, etc. (click the switch to start audio; a detected MIDI output is driven as well)",
|
|
1682
|
+
musicVolume: "Volume",
|
|
1683
|
+
musicStyle: "Style",
|
|
1684
|
+
musicStyleMajor: "Major",
|
|
1685
|
+
musicStyleMinor: "Minor",
|
|
1686
|
+
musicStylePentatonic: "Pentatonic",
|
|
1268
1687
|
checkUpdatesNow: "Check now",
|
|
1269
1688
|
checkingUpdates: "Checking…",
|
|
1270
1689
|
checkUpToDate: "Up to date",
|
|
@@ -1309,6 +1728,21 @@ window.__ModuleLoader__.load({
|
|
|
1309
1728
|
let lastMonitored = null;
|
|
1310
1729
|
let lastOnFull = "stop";
|
|
1311
1730
|
let lastReset = null;
|
|
1731
|
+
const music = new TokenQuotaMusic();
|
|
1732
|
+
const sse = new EventSource("/token-quota/events");
|
|
1733
|
+
sse.addEventListener("action", (event) => {
|
|
1734
|
+
let action;
|
|
1735
|
+
try {
|
|
1736
|
+
action = JSON.parse(event.data);
|
|
1737
|
+
} catch {
|
|
1738
|
+
return;
|
|
1739
|
+
}
|
|
1740
|
+
if (lastSessionId !== void 0 && action.sessionId !== String(lastSessionId)) return;
|
|
1741
|
+
music.onAction(action);
|
|
1742
|
+
});
|
|
1743
|
+
ctx.effect(() => () => {
|
|
1744
|
+
sse.close();
|
|
1745
|
+
}, "token-quota-ui: music SSE");
|
|
1312
1746
|
const keyOf = (selection) => {
|
|
1313
1747
|
if (selection === null) return void 0;
|
|
1314
1748
|
return `${selection.provider}/${selection.model}`;
|
|
@@ -1418,6 +1852,18 @@ window.__ModuleLoader__.load({
|
|
|
1418
1852
|
bound?.setCheckUpdates(doc?.checkUpdates ?? true);
|
|
1419
1853
|
bound?.setDimWhenIdle(doc?.dimWhenIdle ?? false);
|
|
1420
1854
|
bound?.setReset(lastReset);
|
|
1855
|
+
const musicSettings = {
|
|
1856
|
+
enabled: false,
|
|
1857
|
+
volume: .5,
|
|
1858
|
+
style: "major",
|
|
1859
|
+
...doc?.music ?? {}
|
|
1860
|
+
};
|
|
1861
|
+
music.setEnabled(musicSettings.enabled);
|
|
1862
|
+
music.setVolume(musicSettings.volume);
|
|
1863
|
+
music.setStyle(musicSettings.style);
|
|
1864
|
+
bound?.setMusicEnabled(musicSettings.enabled);
|
|
1865
|
+
bound?.setMusicVolume(musicSettings.volume);
|
|
1866
|
+
bound?.setMusicStyle(musicSettings.style);
|
|
1421
1867
|
fetch("/token-quota", { headers: { accept: "application/json" } }).then((response) => {
|
|
1422
1868
|
if (!response.ok) {
|
|
1423
1869
|
bound?.setError(`quota route: ${String(response.status)}`);
|
|
@@ -1487,6 +1933,37 @@ window.__ModuleLoader__.load({
|
|
|
1487
1933
|
bound?.setDimWhenIdle(enabled);
|
|
1488
1934
|
scope.set("dimWhenIdle", enabled);
|
|
1489
1935
|
};
|
|
1936
|
+
const setMusicEnabled = (enabled) => {
|
|
1937
|
+
const current = {
|
|
1938
|
+
enabled: false,
|
|
1939
|
+
volume: .5,
|
|
1940
|
+
style: "major",
|
|
1941
|
+
...scope.getSnapshot().value?.music ?? {}
|
|
1942
|
+
};
|
|
1943
|
+
current.enabled = enabled;
|
|
1944
|
+
scope.set("music", current);
|
|
1945
|
+
if (enabled) music.ensureStarted();
|
|
1946
|
+
};
|
|
1947
|
+
const setMusicVolume = (volume) => {
|
|
1948
|
+
const current = {
|
|
1949
|
+
enabled: false,
|
|
1950
|
+
volume: .5,
|
|
1951
|
+
style: "major",
|
|
1952
|
+
...scope.getSnapshot().value?.music ?? {}
|
|
1953
|
+
};
|
|
1954
|
+
current.volume = Math.max(0, Math.min(1, volume));
|
|
1955
|
+
scope.set("music", current);
|
|
1956
|
+
};
|
|
1957
|
+
const setMusicStyle = (style) => {
|
|
1958
|
+
const current = {
|
|
1959
|
+
enabled: false,
|
|
1960
|
+
volume: .5,
|
|
1961
|
+
style: "major",
|
|
1962
|
+
...scope.getSnapshot().value?.music ?? {}
|
|
1963
|
+
};
|
|
1964
|
+
current.style = style;
|
|
1965
|
+
scope.set("music", current);
|
|
1966
|
+
};
|
|
1490
1967
|
/** Ask the Host to check the registry right now, then refresh the snapshot. */
|
|
1491
1968
|
const checkUpdatesNow = () => {
|
|
1492
1969
|
bound?.setCheckingUpdates(true);
|
|
@@ -1570,7 +2047,10 @@ window.__ModuleLoader__.load({
|
|
|
1570
2047
|
setCheckUpdates,
|
|
1571
2048
|
checkUpdatesNow,
|
|
1572
2049
|
clearLogBefore,
|
|
1573
|
-
setDimWhenIdle
|
|
2050
|
+
setDimWhenIdle,
|
|
2051
|
+
setMusicEnabled,
|
|
2052
|
+
setMusicVolume,
|
|
2053
|
+
setMusicStyle
|
|
1574
2054
|
};
|
|
1575
2055
|
};
|
|
1576
2056
|
ctx.slots.inject("shell.overlay", () => ctx.slots.register({
|