@jxgame2020/dsh-token-quota 0.1.19 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -28,6 +28,10 @@ Zero changes to the DSH core repo: no core file is modified, no official bundle
28
28
 
29
29
  ## 安装 / Installation
30
30
 
31
+ > **版本要求 / Version requirement**:`0.1.19+` 需要 DSH **≥ 0.1.5**(新 API:`SettingsProvider.installSection`、`ctx.remote.session`)。DSH 0.1.0-rc.7 及更早版本请使用 `@jxgame2020/dsh-token-quota@0.1.18`。
32
+ >
33
+ > **Version requirement**: `0.1.19+` requires DSH **≥ 0.1.5** (new APIs: `SettingsProvider.installSection`, `ctx.remote.session`). For DSH 0.1.0-rc.7 and earlier, install `@jxgame2020/dsh-token-quota@0.1.18`.
34
+
31
35
  ### 方式一:npm 安装(推荐)/ Option A: npm install (recommended)
32
36
 
33
37
  在你的 web profile(`~/.dsh/profiles/web`)下安装依赖:
@@ -36,11 +40,15 @@ Install the dependency in your web profile (`~/.dsh/profiles/web`):
36
40
 
37
41
  ```bash
38
42
  cd ~/.dsh/profiles/web
39
- npm install @jxgame2020/dsh-token-quota
43
+ npm install @jxgame2020/dsh-token-quota --omit=peer
40
44
  ```
41
45
 
42
- > 用 pnpm 管理 profile 的话:`pnpm add @jxgame2020/dsh-token-quota`。
43
- > With pnpm: `pnpm add @jxgame2020/dsh-token-quota`.
46
+ > **为什么 `--omit=peer` / Why `--omit=peer`**:插件运行时所需的 `@deepseek-ai/*` 由 DSH 宿主提供,不需要安装在 profile 里;npm 上这些包的最新 tag 是互不兼容的旧 rc 版本,自动安装 peer 会触发 ERESOLVE 冲突。0.1.20+ 已将这些 peer 全部标记为 optional,直接 `npm install @jxgame2020/dsh-token-quota` 通常也能成功;若仍报 `ERESOLVE`,加上 `--omit=peer` 即可。
47
+ >
48
+ > The plugin's `@deepseek-ai/*` dependencies are provided by the DSH host at runtime — they must NOT be installed into the profile (npm's latest tags for them are mutually-incompatible old rc versions, so auto-installing peers raises ERESOLVE). Since 0.1.20 all those peers are marked optional, so plain `npm install` usually works; if you still hit `ERESOLVE`, append `--omit=peer`.
49
+
50
+ > 用 pnpm 管理 profile 的话:`pnpm add @jxgame2020/dsh-token-quota`(pnpm 默认不装 peer,无需额外参数)。
51
+ > With pnpm: `pnpm add @jxgame2020/dsh-token-quota` (pnpm does not auto-install peers — no extra flag needed).
44
52
 
45
53
  在 `cordis.patch.yml` 中挂载插件:
46
54
 
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.19" ? upgrade : null;
82
+ const normalized = upgrade !== null && upgrade.latestVersion !== "" && upgrade.latestVersion !== "0.1.21" ? 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
- "panel": "NPLLIq_panel",
189
- "rowHeader": "NPLLIq_rowHeader",
190
- "upgradeCommandRow": "NPLLIq_upgradeCommandRow",
191
- "logToolbar": "NPLLIq_logToolbar",
192
- "gearBtn": "NPLLIq_gearBtn",
193
- "logPagerInfo": "NPLLIq_logPagerInfo",
188
+ "upgradeClose": "NPLLIq_upgradeClose",
194
189
  "fillWarn": "NPLLIq_fillWarn",
195
- "headerText": "NPLLIq_headerText",
196
- "dialogLabel": "NPLLIq_dialogLabel",
197
- "dialogBtn": "NPLLIq_dialogBtn",
198
- "monitorHint": "NPLLIq_monitorHint",
199
- "logPagerPages": "NPLLIq_logPagerPages",
190
+ "tab": "NPLLIq_tab",
191
+ "logClearDate": "NPLLIq_logClearDate",
200
192
  "subtitle": "NPLLIq_subtitle",
201
- "upgradeCommands": "NPLLIq_upgradeCommands",
202
- "dialogActions": "NPLLIq_dialogActions",
203
- "title": "NPLLIq_title",
204
- "fillOver": "NPLLIq_fillOver",
193
+ "upgradeBannerText": "NPLLIq_upgradeBannerText",
194
+ "fillIdle": "NPLLIq_fillIdle",
195
+ "dialogTitle": "NPLLIq_dialogTitle",
196
+ "logPagerPages": "NPLLIq_logPagerPages",
197
+ "logPageSizeSelect": "NPLLIq_logPageSizeSelect",
198
+ "logUsedCol": "NPLLIq_logUsedCol",
199
+ "controls": "NPLLIq_controls",
200
+ "monitorHint": "NPLLIq_monitorHint",
201
+ "dialogOverlay": "NPLLIq_dialogOverlay",
202
+ "resetRow": "NPLLIq_resetRow",
203
+ "logClearDialog": "NPLLIq_logClearDialog",
204
+ "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
+ "checkBtn": "NPLLIq_checkBtn",
205
213
  "monitorRow": "NPLLIq_monitorRow",
206
- "panelDimStrong": "NPLLIq_panelDimStrong",
207
- "currentBadge": "NPLLIq_currentBadge",
208
- "checkUpdatesRow": "NPLLIq_checkUpdatesRow",
214
+ "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",
226
+ "upgradeCommands": "NPLLIq_upgradeCommands",
227
+ "dialogBtnPrimary": "NPLLIq_dialogBtnPrimary",
209
228
  "input": "NPLLIq_input",
229
+ "upgradeHint": "NPLLIq_upgradeHint",
230
+ "logTable": "NPLLIq_logTable",
231
+ "title": "NPLLIq_title",
232
+ "headerActions": "NPLLIq_headerActions",
233
+ "bar": "NPLLIq_bar",
234
+ "logDialog": "NPLLIq_logDialog",
235
+ "logPagerControls": "NPLLIq_logPagerControls",
210
236
  "checkErrorHint": "NPLLIq_checkErrorHint",
211
- "dialogOverlay": "NPLLIq_dialogOverlay",
212
- "tabLabel": "NPLLIq_tabLabel",
213
- "upgradeClose": "NPLLIq_upgradeClose",
214
- "dialogClose": "NPLLIq_dialogClose",
237
+ "fillOver": "NPLLIq_fillOver",
215
238
  "logScroll": "NPLLIq_logScroll",
216
- "fullNotice": "NPLLIq_fullNotice",
217
- "settingsBtn": "NPLLIq_settingsBtn",
239
+ "panelDim": "NPLLIq_panelDim",
240
+ "logDayCol": "NPLLIq_logDayCol",
218
241
  "upgradeBanner": "NPLLIq_upgradeBanner",
219
- "upgradeBannerFlash": "NPLLIq_upgradeBannerFlash",
220
- "logPager": "NPLLIq_logPager",
221
- "logPageSizeSelect": "NPLLIq_logPageSizeSelect",
222
- "rowName": "NPLLIq_rowName",
223
- "logClearDate": "NPLLIq_logClearDate",
224
242
  "collapse": "NPLLIq_collapse",
225
- "bar": "NPLLIq_bar",
226
- "controls": "NPLLIq_controls",
227
- "copyBtnDone": "NPLLIq_copyBtnDone",
228
- "body": "NPLLIq_body",
229
- "logPagerBtn": "NPLLIq_logPagerBtn",
230
- "notice": "NPLLIq_notice",
231
- "monitorName": "NPLLIq_monitorName",
232
- "logClearBtn": "NPLLIq_logClearBtn",
233
- "dialogBody": "NPLLIq_dialogBody",
234
- "resetRow": "NPLLIq_resetRow",
235
- "dialogHint": "NPLLIq_dialogHint",
236
- "panelDim": "NPLLIq_panelDim",
237
- "logDialog": "NPLLIq_logDialog",
238
- "tab": "NPLLIq_tab",
239
- "upgradeHint": "NPLLIq_upgradeHint",
243
+ "version": "NPLLIq_version",
244
+ "copyBtn": "NPLLIq_copyBtn",
245
+ "panel": "NPLLIq_panel",
246
+ "upgradeBannerFlash": "NPLLIq_upgradeBannerFlash",
247
+ "dialogClose": "NPLLIq_dialogClose",
248
+ "monitorList": "NPLLIq_monitorList",
240
249
  "header": "NPLLIq_header",
241
- "switch": "NPLLIq_switch",
250
+ "monitorName": "NPLLIq_monitorName",
251
+ "checkUpdatesRow": "NPLLIq_checkUpdatesRow",
252
+ "notice": "NPLLIq_notice",
253
+ "rowName": "NPLLIq_rowName",
254
+ "settingsBtn": "NPLLIq_settingsBtn",
255
+ "dialogActions": "NPLLIq_dialogActions",
256
+ "upgradeCommandRow": "NPLLIq_upgradeCommandRow",
242
257
  "noticeError": "NPLLIq_noticeError",
243
- "upgradeCommand": "NPLLIq_upgradeCommand",
258
+ "dialogSection": "NPLLIq_dialogSection",
259
+ "dialogHeader": "NPLLIq_dialogHeader",
244
260
  "row": "NPLLIq_row",
245
- "rowMeta": "NPLLIq_rowMeta",
246
- "checkUpdatesLabel": "NPLLIq_checkUpdatesLabel",
261
+ "logPager": "NPLLIq_logPager",
247
262
  "dialog": "NPLLIq_dialog",
248
- "dialogHeader": "NPLLIq_dialogHeader",
249
- "logModelCol": "NPLLIq_logModelCol",
250
- "logUsedCol": "NPLLIq_logUsedCol",
251
- "logSearch": "NPLLIq_logSearch",
252
- "logPagerControls": "NPLLIq_logPagerControls",
253
- "fillIdle": "NPLLIq_fillIdle",
254
- "monitorList": "NPLLIq_monitorList",
255
- "upgradeBannerText": "NPLLIq_upgradeBannerText",
256
- "dialogBtnPrimary": "NPLLIq_dialogBtnPrimary",
257
- "version": "NPLLIq_version",
258
- "dialogTitle": "NPLLIq_dialogTitle",
259
- "dialogSection": "NPLLIq_dialogSection",
260
- "checkBtn": "NPLLIq_checkBtn",
261
263
  "save": "NPLLIq_save",
262
- "selectBtn": "NPLLIq_selectBtn",
263
- "logDayCol": "NPLLIq_logDayCol",
264
- "resetSelect": "NPLLIq_resetSelect",
265
- "copyBtn": "NPLLIq_copyBtn",
266
- "logClearDialog": "NPLLIq_logClearDialog",
267
- "radioRow": "NPLLIq_radioRow",
264
+ "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",
268
271
  "versionNew": "NPLLIq_versionNew",
269
- "tabIcon": "NPLLIq_tabIcon",
270
- "logTable": "NPLLIq_logTable",
271
- "logHeader": "NPLLIq_logHeader",
272
- "headerActions": "NPLLIq_headerActions"
272
+ "headerText": "NPLLIq_headerText"
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.19",
574
+ "0.1.21",
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.19"]
580
+ children: ["v", "0.1.21"]
581
581
  })]
582
582
  }), (0, react_jsx_runtime.jsx)("div", {
583
583
  className: TokenQuotaPanel_module_css_default.subtitle,
@@ -1278,12 +1278,14 @@ window.__ModuleLoader__.load({
1278
1278
  const TOKEN_QUOTA_NAMESPACE = "token-quota";
1279
1279
  /** Snapshot pull cadence in milliseconds. */
1280
1280
  const POLL_INTERVAL_MS = 3e3;
1281
- /** Required services: slot registry, sessions, locale, settings scope. */
1281
+ /** Required services: slot registry, sessions, locale, settings scope, and the Host remote faces. */
1282
1282
  const inject = [
1283
1283
  "slots",
1284
1284
  "sessions",
1285
1285
  "locale",
1286
- "settingsScope"
1286
+ "settingsScope",
1287
+ "remote",
1288
+ "remote.session"
1287
1289
  ];
1288
1290
  /**
1289
1291
  * Client plugin body: poll the Host snapshot route, run the full-quota
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.19";
456
+ const current = "0.1.21";
457
457
  let latest;
458
458
  try {
459
459
  const response = await fetch(REGISTRY_LATEST_URL, {
@@ -24,7 +24,7 @@ declare module '@deepseek-ai/dsh-client-ui-slots' {
24
24
  'token-quota': TokenQuotaKey;
25
25
  }
26
26
  }
27
- /** Required services: slot registry, sessions, locale, settings scope. */
27
+ /** Required services: slot registry, sessions, locale, settings scope, and the Host remote faces. */
28
28
  export declare const inject: string[];
29
29
  /**
30
30
  * Client plugin body: poll the Host snapshot route, run the full-quota
@@ -8,8 +8,8 @@ const NS = 'token-quota';
8
8
  const TOKEN_QUOTA_NAMESPACE = 'token-quota';
9
9
  /** Snapshot pull cadence in milliseconds. */
10
10
  const POLL_INTERVAL_MS = 3000;
11
- /** Required services: slot registry, sessions, locale, settings scope. */
12
- export const inject = ['slots', 'sessions', 'locale', 'settingsScope'];
11
+ /** Required services: slot registry, sessions, locale, settings scope, and the Host remote faces. */
12
+ export const inject = ['slots', 'sessions', 'locale', 'settingsScope', 'remote', 'remote.session'];
13
13
  /**
14
14
  * Client plugin body: poll the Host snapshot route, run the full-quota
15
15
  * strategy, wire the injected face (directory load, limit write, model
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.19",
4
+ "version": "0.1.21",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -152,6 +152,21 @@
152
152
  },
153
153
  "@deepseek-ai/schemastery": {
154
154
  "optional": true
155
+ },
156
+ "@deepseek-ai/dsh-api-gateway": {
157
+ "optional": true
158
+ },
159
+ "@deepseek-ai/dsh-api-session-controller": {
160
+ "optional": true
161
+ },
162
+ "@deepseek-ai/dsh-client-store": {
163
+ "optional": true
164
+ },
165
+ "@deepseek-ai/dsh-client-ui-renderer": {
166
+ "optional": true
167
+ },
168
+ "@deepseek-ai/dsh-client-ui-session": {
169
+ "optional": true
155
170
  }
156
171
  }
157
172
  }