@goodandready/dsh-subscriptions 0.4.11 → 0.4.13

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/index.js CHANGED
@@ -380,6 +380,16 @@ export function apply(ctx, config) {
380
380
 
381
381
  ctx.effect(() => {
382
382
  syncAdapter().catch(() => { /* first paint */ })
383
+ // #75: eager refresh usage на старте, чтобы windows (5h/7d) появились в blob сразу
384
+ // и активная подписка в чипе сразу показывала 5h/7d/..., а не ждала probeInterval.
385
+ const eager = async () => {
386
+ try {
387
+ for (const slot of normalizeSlots(live().slots)) {
388
+ store.refreshUsage(slot.provider).catch(() => {})
389
+ }
390
+ } catch {}
391
+ }
392
+ eager()
383
393
  return () => {
384
394
  if (handle) {
385
395
  try { handle() } catch { /* ignore */ }
package/lib/usage.js CHANGED
@@ -58,13 +58,14 @@ const WINDOW_LABELS = {
58
58
  weekly_limit_7_days: { ru: "7д", en: "7d" },
59
59
  primary: { ru: "осн.", en: "primary" },
60
60
  secondary: { ru: "втор.", en: "secondary" },
61
- primary_window: { ru: "осн.", en: "primary" },
62
- secondary_window: { ru: "втор.", en: "secondary" },
61
+ // codex: vendor API отдаёт primary_window/secondary_window для UI читаем как 5h/7d
62
+ primary_window: { ru: "", en: "5h" },
63
+ secondary_window: { ru: "7д", en: "7d" },
63
64
  monthly: { ru: "месяц", en: "month" },
64
65
  credits: { ru: "кредиты", en: "credits" },
65
66
  }
66
67
 
67
- function windowLabel(id) {
68
+ export function windowLabel(id) {
68
69
  const known = WINDOW_LABELS[id]
69
70
  return known || { ru: id, en: id }
70
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-subscriptions",
3
- "version": "0.4.11",
3
+ "version": "0.4.13",
4
4
  "description": "Use ChatGPT Codex, Claude, Grok, and Antigravity subscriptions as DeepSeek Harness LLM providers via OAuth.",
5
5
  "license": "MIT",
6
6
  "type": "module",