sprag-cli 3.123.0 → 3.123.2

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/docs/DATA.ko.md CHANGED
@@ -1,4 +1,4 @@
1
- # Sprag 이 보내는 데이터
1
+ # Sprag가 보내는 데이터
2
2
 
3
3
  [← README](../README.ko.md) · [English](./DATA.md)
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprag-cli",
3
- "version": "3.123.0",
3
+ "version": "3.123.2",
4
4
  "description": "The delegation layer for Claude Code and Codex: each task goes to the model and effort that fits it, down to cheaper models for lookups and up to higher effort when a cheaper run would miss, backed by public replay cases, with a live statusline and team rules for Pro and Enterprise.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -680,18 +680,41 @@ function buildCapWarnSeg(capWarn, c, isIcon, g, color, mode) {
680
680
  // unused ticks are dimmed, the second which pair of tick glyphs to draw.
681
681
  if (!capWarn) return null;
682
682
  const pct = Math.round(capWarn.usedPct);
683
- const clock = formatResetClock(capWarn.resetsAt);
684
- // Text mode has no glyph vocabulary, so it names the thing instead of
685
- // borrowing an emoji it otherwise avoids.
686
- const clockTail = clock ? (isIcon ? ` ${g.reset} ${clock}` : ` resets ${clock}`) : '';
683
+ // The chip replaces the window's always-on segment, so it carries the same
684
+ // facts: a budget window keeps its `$used/$limit`, its `(user)` source mark
685
+ // and its countdown reset. Without them a 94% budget chip showed neither the
686
+ // money nor a usable reset ("Sun 10:55" for a reset nine days out).
687
+ const { tail, money, src } = windowSegParts(labelForKey(capWarn.key), capWarn, isIcon, g);
687
688
  if (isIcon) {
688
689
  // Gauge keeps shape parity with the always-on usage segment — the
689
690
  // cap-warn is just the same gauge "filled to alarm". Visual continuity
690
691
  // helps the eye understand "this is the 5H bar I was watching, just red now."
691
692
  const bar = gaugeColored(pct, c, RED, color, mode);
692
- return `${c(BOLD)}${c(RED)}${g.capWarn} ${capWarn.label} ${bar} ${pct}%${clockTail}${c(RESET)}`;
693
+ return `${c(BOLD)}${c(RED)}${g.capWarn} ${capWarn.label}${src} ${bar} ${pct}%${money}${tail}${c(RESET)}`;
693
694
  }
694
- return `${c(BOLD)}${c(RED)}${capWarn.label} cap ${pct}%${clockTail}${c(RESET)}`;
695
+ return `${c(BOLD)}${c(RED)}${capWarn.label}${src} cap ${pct}%${money}${tail}${c(RESET)}`;
696
+ }
697
+
698
+ /**
699
+ * What a rate-limit window shows next to its percent, shared by the always-on
700
+ * segment and the cap-warn chip so the two never drift apart.
701
+ * - `tail`: the reset, as a wall-clock time or, for windows whose labels ask
702
+ * for it (budgets), the time left. Text mode names it instead of using 🔄.
703
+ * - `money`: ` $used/$limit` when the window carries dollar amounts.
704
+ * - `src`: ` (user)` when a LiteLLM gauge is drawn from the internal user
705
+ * limit, which is not the limit that blocks requests.
706
+ */
707
+ function windowSegParts(labels, info, isIcon, g) {
708
+ const clock = labels.resetStyle === 'countdown'
709
+ ? formatResetIn(info.resetsAt)
710
+ : formatResetClock(info.resetsAt);
711
+ const tail = clock ? (isIcon ? ` ${g.reset} ${clock}` : ` resets ${clock}`) : '';
712
+ const money =
713
+ Number.isFinite(info.maxBudget) && info.maxBudget > 0
714
+ ? ` ${formatMoney(Number(info.spend) || 0)}/${formatMoney(info.maxBudget)}`
715
+ : '';
716
+ const src = info.source === 'user' ? ' (user)' : '';
717
+ return { tail, money, src };
695
718
  }
696
719
 
697
720
  // Room Claude Code keeps for its own padding around the statusline. A guess
@@ -1156,10 +1179,6 @@ function buildUsageSeg({ labels, info, tone, suppressed }, c, isIcon, verbose, g
1156
1179
  // nothing ("Thu 00:00" — which Thursday?). Those windows report how long is
1157
1180
  // left instead. Short windows keep the clock, which is the more useful form
1158
1181
  // when the reset is later today.
1159
- const clock = labels.resetStyle === 'countdown'
1160
- ? formatResetIn(info.resetsAt)
1161
- : formatResetClock(info.resetsAt);
1162
- const tail = clock ? (isIcon ? ` ${g.reset} ${clock}` : ` resets ${clock}`) : '';
1163
1182
  // `cap` reads as a rate-limit ceiling rather than a duration. Icon mode
1164
1183
  // leans on the icon to identify the window (✦ = session/now, 📅 = week),
1165
1184
  // so the 5H label is empty while the 7D label spells out "weekly". Text and
@@ -1169,14 +1188,11 @@ function buildUsageSeg({ labels, info, tone, suppressed }, c, isIcon, verbose, g
1169
1188
  // and the gauge stays the same width as the percent climbs.
1170
1189
  // LiteLLM 예산 윈도우는 퍼센트만으로는 감이 안 오므로(예산 크기를 모름)
1171
1190
  // 금액을 함께 보여 준다: `💳 budget ▰▱ 34% $34/$100`.
1172
- const money =
1173
- Number.isFinite(info.maxBudget) && info.maxBudget > 0
1174
- ? ` ${formatMoney(Number(info.spend) || 0)}/${formatMoney(info.maxBudget)}`
1175
- : '';
1176
1191
  // LiteLLM 의 internal user 한도는 차단 판정에 쓰이는 값이 아니라서, 팀
1177
1192
  // 멤버십 한도와 수백 배 어긋나는 배포가 있습니다. 그 한도로 그린 게이지는
1178
1193
  // 출처를 밝혀 두어야 사용자가 정확한 값으로 오해하지 않습니다.
1179
- const src = info.source === 'user' ? ' (user)' : '';
1194
+ // 리셋 시각, 금액, 출처는 cap-warn 칩과 같은 함수로 만듭니다.
1195
+ const { tail, money, src } = windowSegParts(labels, info, isIcon, g);
1180
1196
  if (isIcon) {
1181
1197
  const labelPart = labels.usageLabel ? `${labels.usageLabel}${src} ` : '';
1182
1198
  const bar = gaugeColored(pct, c, tone, color, mode);