@jxgame2020/dsh-token-quota 0.1.21 → 0.1.22

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 CHANGED
@@ -79,7 +79,7 @@ window.__ModuleLoader__.load({
79
79
  d.dimWhenIdle = dimWhenIdle;
80
80
  },
81
81
  setUpgrade: (d, upgrade) => {
82
- const normalized = upgrade !== null && upgrade.latestVersion !== "" && upgrade.latestVersion !== "0.1.21" ? upgrade : null;
82
+ const normalized = upgrade !== null && upgrade.latestVersion !== "" && upgrade.latestVersion !== "0.1.22" ? upgrade : null;
83
83
  if (d.upgrade === null || d.upgrade.latestVersion !== normalized?.latestVersion) d.upgradeDismissed = false;
84
84
  d.upgrade = normalized;
85
85
  },
@@ -185,91 +185,91 @@ window.__ModuleLoader__.load({
185
185
  document.head.appendChild(tag);
186
186
  }
187
187
  var TokenQuotaPanel_module_css_default = {
188
- "upgradeClose": "NPLLIq_upgradeClose",
189
- "fillWarn": "NPLLIq_fillWarn",
190
- "tab": "NPLLIq_tab",
191
- "logClearDate": "NPLLIq_logClearDate",
192
- "subtitle": "NPLLIq_subtitle",
193
- "upgradeBannerText": "NPLLIq_upgradeBannerText",
194
- "fillIdle": "NPLLIq_fillIdle",
195
- "dialogTitle": "NPLLIq_dialogTitle",
196
- "logPagerPages": "NPLLIq_logPagerPages",
197
- "logPageSizeSelect": "NPLLIq_logPageSizeSelect",
198
188
  "logUsedCol": "NPLLIq_logUsedCol",
199
189
  "controls": "NPLLIq_controls",
200
- "monitorHint": "NPLLIq_monitorHint",
201
- "dialogOverlay": "NPLLIq_dialogOverlay",
202
- "resetRow": "NPLLIq_resetRow",
203
- "logClearDialog": "NPLLIq_logClearDialog",
190
+ "save": "NPLLIq_save",
191
+ "upgradeCommand": "NPLLIq_upgradeCommand",
192
+ "versionNew": "NPLLIq_versionNew",
193
+ "title": "NPLLIq_title",
194
+ "rowName": "NPLLIq_rowName",
195
+ "currentBadge": "NPLLIq_currentBadge",
204
196
  "resetSelect": "NPLLIq_resetSelect",
205
- "logModelCol": "NPLLIq_logModelCol",
206
- "dialogBody": "NPLLIq_dialogBody",
207
- "radioRow": "NPLLIq_radioRow",
208
- "logHeader": "NPLLIq_logHeader",
209
- "logClearBtn": "NPLLIq_logClearBtn",
210
- "switch": "NPLLIq_switch",
211
- "checkUpdatesLabel": "NPLLIq_checkUpdatesLabel",
212
197
  "checkBtn": "NPLLIq_checkBtn",
213
- "monitorRow": "NPLLIq_monitorRow",
198
+ "panel": "NPLLIq_panel",
199
+ "settingsBtn": "NPLLIq_settingsBtn",
200
+ "logPager": "NPLLIq_logPager",
201
+ "upgradeClose": "NPLLIq_upgradeClose",
214
202
  "logSearch": "NPLLIq_logSearch",
215
- "logPagerBtn": "NPLLIq_logPagerBtn",
216
- "selectBtn": "NPLLIq_selectBtn",
217
- "gearBtn": "NPLLIq_gearBtn",
218
- "body": "NPLLIq_body",
219
- "tabIcon": "NPLLIq_tabIcon",
220
- "copyBtnDone": "NPLLIq_copyBtnDone",
221
- "rowHeader": "NPLLIq_rowHeader",
222
- "dialogLabel": "NPLLIq_dialogLabel",
223
- "upgradeCommand": "NPLLIq_upgradeCommand",
224
- "dialogHint": "NPLLIq_dialogHint",
225
- "tabLabel": "NPLLIq_tabLabel",
203
+ "fullNotice": "NPLLIq_fullNotice",
204
+ "dialogClose": "NPLLIq_dialogClose",
205
+ "fillIdle": "NPLLIq_fillIdle",
206
+ "logPagerPages": "NPLLIq_logPagerPages",
207
+ "logClearBtn": "NPLLIq_logClearBtn",
208
+ "header": "NPLLIq_header",
209
+ "dialogOverlay": "NPLLIq_dialogOverlay",
210
+ "dialogHeader": "NPLLIq_dialogHeader",
226
211
  "upgradeCommands": "NPLLIq_upgradeCommands",
227
- "dialogBtnPrimary": "NPLLIq_dialogBtnPrimary",
228
- "input": "NPLLIq_input",
229
- "upgradeHint": "NPLLIq_upgradeHint",
230
- "logTable": "NPLLIq_logTable",
231
- "title": "NPLLIq_title",
212
+ "dialog": "NPLLIq_dialog",
213
+ "logHeader": "NPLLIq_logHeader",
214
+ "logPageSizeSelect": "NPLLIq_logPageSizeSelect",
215
+ "dialogActions": "NPLLIq_dialogActions",
216
+ "subtitle": "NPLLIq_subtitle",
217
+ "rowHeader": "NPLLIq_rowHeader",
218
+ "copyBtn": "NPLLIq_copyBtn",
232
219
  "headerActions": "NPLLIq_headerActions",
220
+ "selectBtn": "NPLLIq_selectBtn",
221
+ "upgradeHint": "NPLLIq_upgradeHint",
222
+ "resetRow": "NPLLIq_resetRow",
223
+ "logClearDate": "NPLLIq_logClearDate",
224
+ "input": "NPLLIq_input",
225
+ "copyBtnDone": "NPLLIq_copyBtnDone",
233
226
  "bar": "NPLLIq_bar",
227
+ "version": "NPLLIq_version",
228
+ "tabIcon": "NPLLIq_tabIcon",
229
+ "dialogTitle": "NPLLIq_dialogTitle",
234
230
  "logDialog": "NPLLIq_logDialog",
235
- "logPagerControls": "NPLLIq_logPagerControls",
236
231
  "checkErrorHint": "NPLLIq_checkErrorHint",
237
- "fillOver": "NPLLIq_fillOver",
232
+ "body": "NPLLIq_body",
233
+ "rowMeta": "NPLLIq_rowMeta",
234
+ "collapse": "NPLLIq_collapse",
235
+ "dialogSection": "NPLLIq_dialogSection",
236
+ "dialogBody": "NPLLIq_dialogBody",
238
237
  "logScroll": "NPLLIq_logScroll",
239
- "panelDim": "NPLLIq_panelDim",
240
- "logDayCol": "NPLLIq_logDayCol",
241
238
  "upgradeBanner": "NPLLIq_upgradeBanner",
242
- "collapse": "NPLLIq_collapse",
243
- "version": "NPLLIq_version",
244
- "copyBtn": "NPLLIq_copyBtn",
245
- "panel": "NPLLIq_panel",
246
- "upgradeBannerFlash": "NPLLIq_upgradeBannerFlash",
247
- "dialogClose": "NPLLIq_dialogClose",
248
- "monitorList": "NPLLIq_monitorList",
249
- "header": "NPLLIq_header",
250
- "monitorName": "NPLLIq_monitorName",
239
+ "row": "NPLLIq_row",
240
+ "panelDimStrong": "NPLLIq_panelDimStrong",
241
+ "monitorRow": "NPLLIq_monitorRow",
242
+ "tabLabel": "NPLLIq_tabLabel",
243
+ "upgradeBannerText": "NPLLIq_upgradeBannerText",
251
244
  "checkUpdatesRow": "NPLLIq_checkUpdatesRow",
245
+ "dialogLabel": "NPLLIq_dialogLabel",
246
+ "gearBtn": "NPLLIq_gearBtn",
247
+ "dialogBtnPrimary": "NPLLIq_dialogBtnPrimary",
252
248
  "notice": "NPLLIq_notice",
253
- "rowName": "NPLLIq_rowName",
254
- "settingsBtn": "NPLLIq_settingsBtn",
255
- "dialogActions": "NPLLIq_dialogActions",
249
+ "fillWarn": "NPLLIq_fillWarn",
250
+ "fillOver": "NPLLIq_fillOver",
251
+ "checkUpdatesLabel": "NPLLIq_checkUpdatesLabel",
252
+ "radioRow": "NPLLIq_radioRow",
253
+ "panelDim": "NPLLIq_panelDim",
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",
256
261
  "upgradeCommandRow": "NPLLIq_upgradeCommandRow",
262
+ "dialogHint": "NPLLIq_dialogHint",
263
+ "dialogBtn": "NPLLIq_dialogBtn",
264
+ "logTable": "NPLLIq_logTable",
265
+ "monitorList": "NPLLIq_monitorList",
257
266
  "noticeError": "NPLLIq_noticeError",
258
- "dialogSection": "NPLLIq_dialogSection",
259
- "dialogHeader": "NPLLIq_dialogHeader",
260
- "row": "NPLLIq_row",
261
- "logPager": "NPLLIq_logPager",
262
- "dialog": "NPLLIq_dialog",
263
- "save": "NPLLIq_save",
267
+ "tab": "NPLLIq_tab",
268
+ "monitorName": "NPLLIq_monitorName",
264
269
  "logPagerInfo": "NPLLIq_logPagerInfo",
265
- "logToolbar": "NPLLIq_logToolbar",
266
- "currentBadge": "NPLLIq_currentBadge",
267
- "dialogBtn": "NPLLIq_dialogBtn",
268
- "fullNotice": "NPLLIq_fullNotice",
269
- "rowMeta": "NPLLIq_rowMeta",
270
- "panelDimStrong": "NPLLIq_panelDimStrong",
271
- "versionNew": "NPLLIq_versionNew",
272
- "headerText": "NPLLIq_headerText"
270
+ "logPagerBtn": "NPLLIq_logPagerBtn",
271
+ "logClearDialog": "NPLLIq_logClearDialog",
272
+ "logToolbar": "NPLLIq_logToolbar"
273
273
  };
274
274
  //#endregion
275
275
  //#region lib/types/client/TokenQuotaPanel.js
@@ -571,13 +571,13 @@ window.__ModuleLoader__.load({
571
571
  title: t("upgradeAvailableHint"),
572
572
  children: [
573
573
  "v",
574
- "0.1.21",
574
+ "0.1.22",
575
575
  " → v",
576
576
  upgrade.latestVersion
577
577
  ]
578
578
  }) : (0, react_jsx_runtime.jsxs)("span", {
579
579
  className: TokenQuotaPanel_module_css_default.version,
580
- children: ["v", "0.1.21"]
580
+ children: ["v", "0.1.22"]
581
581
  })]
582
582
  }), (0, react_jsx_runtime.jsx)("div", {
583
583
  className: TokenQuotaPanel_module_css_default.subtitle,
@@ -1386,7 +1386,8 @@ window.__ModuleLoader__.load({
1386
1386
  const currentOf = (sessionId) => {
1387
1387
  const binding = sessions.binding(sessionId);
1388
1388
  if (binding === void 0) return null;
1389
- return binding.session.projections.faceOf("modelSelection").getSnapshot()?.lastUsed ?? null;
1389
+ const state = binding.session.projections.faceOf("modelSelection").getSnapshot();
1390
+ return state?.next ?? state?.lastUsed ?? null;
1390
1391
  };
1391
1392
  const refreshCurrent = () => {
1392
1393
  if (lastSessionId === void 0) return;
package/lib/index.js CHANGED
@@ -453,7 +453,7 @@ var TokenQuotaService = class TokenQuotaService extends Service {
453
453
  return this.upgradeCheck;
454
454
  }
455
455
  async doRefreshUpgrade() {
456
- const current = "0.1.21";
456
+ const current = "0.1.22";
457
457
  let latest;
458
458
  try {
459
459
  const response = await fetch(REGISTRY_LATEST_URL, {
@@ -140,7 +140,11 @@ export function apply(ctx) {
140
140
  return null;
141
141
  const face = binding.session.projections.faceOf('modelSelection');
142
142
  const state = face.getSnapshot();
143
- return state?.lastUsed ?? null;
143
+ // `next` (pending) is a selection made but not yet consumed by a request;
144
+ // `lastUsed` is the previous request's actual model. Show the pending
145
+ // selection first so the panel doesn't snap back before the next request
146
+ // retires it — matches ui-model-selection (`projected.next ?? default`).
147
+ return state?.next ?? state?.lastUsed ?? null;
144
148
  };
145
149
  const refreshCurrent = () => {
146
150
  if (lastSessionId === undefined)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jxgame2020/dsh-token-quota",
3
3
  "description": "Daily per-model token quota accounting, enforcement, and a floating quota panel for the DeepSeek Harness — a fully self-contained plugin (no core-Harness wiring, no generated RPC contract)",
4
- "version": "0.1.21",
4
+ "version": "0.1.22",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },