quotacap 0.0.41 → 0.0.43

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.
Files changed (56) hide show
  1. package/dist/adapters/claude.js +16 -5
  2. package/dist/adapters/codex.d.ts +2 -1
  3. package/dist/adapters/codex.js +19 -8
  4. package/dist/adapters/goldens.d.ts +4 -0
  5. package/dist/adapters/goldens.js +20 -0
  6. package/dist/adapters/grok.d.ts +2 -1
  7. package/dist/adapters/grok.js +26 -12
  8. package/dist/adapters/index.d.ts +20 -6
  9. package/dist/adapters/index.js +96 -37
  10. package/dist/adapters/kimi.d.ts +2 -1
  11. package/dist/adapters/kimi.js +24 -13
  12. package/dist/adapters/muse.d.ts +2 -1
  13. package/dist/adapters/muse.js +30 -15
  14. package/dist/adapters/opencode-go.d.ts +1 -1
  15. package/dist/adapters/opencode-go.js +8 -1
  16. package/dist/adapters/pty.d.ts +7 -0
  17. package/dist/adapters/pty.js +32 -2
  18. package/dist/adapters/vt.d.ts +19 -0
  19. package/dist/adapters/vt.js +506 -0
  20. package/dist/cli/providers.js +2 -1
  21. package/dist/config.d.ts +12 -23
  22. package/dist/config.js +24 -0
  23. package/dist/diagnostics/bundle.d.ts +22 -0
  24. package/dist/diagnostics/bundle.js +125 -0
  25. package/dist/diagnostics/failure.d.ts +8 -1
  26. package/dist/diagnostics/failure.js +43 -2
  27. package/dist/format/rows.d.ts +1 -1
  28. package/dist/format/rows.js +9 -6
  29. package/dist/mcp/server.d.ts +2 -2
  30. package/dist/runtime/poll.d.ts +4 -0
  31. package/dist/runtime/poll.js +30 -1
  32. package/dist/runtime/service.js +3 -1
  33. package/dist/version.js +1 -1
  34. package/dist/web/src/App.js +1 -1
  35. package/dist/web/src/components/AdviceDrawer.js +1 -1
  36. package/dist/web/src/components/OpencodeGoBanner.d.ts +1 -1
  37. package/dist/web/src/components/OpencodeGoBanner.js +9 -2
  38. package/dist/web/src/components/PaceBar.d.ts +9 -4
  39. package/dist/web/src/components/PaceBar.js +26 -7
  40. package/dist/web/src/components/ProviderCard.js +2 -3
  41. package/dist/web/src/components/ProviderDrawer.js +3 -3
  42. package/dist/web/src/components/ProviderIcon.js +1 -1
  43. package/dist/web/src/components/ProviderRow.d.ts +1 -1
  44. package/dist/web/src/components/ProviderRow.js +2 -4
  45. package/dist/web/src/components/Recommendation.js +1 -1
  46. package/dist/web/src/components/ResetRail.js +1 -1
  47. package/dist/web/src/components/WindowsRow.d.ts +1 -1
  48. package/dist/web/src/components/WindowsRow.js +4 -4
  49. package/dist/web/src/components/settings/SettingsDrawer.js +1 -1
  50. package/dist/webAssets.js +1 -1
  51. package/dist/webHtml.js +1 -1
  52. package/package.json +5 -5
  53. package/web/dist/assets/{index-Dk6l5h27.css → index-C6ltEeGL.css} +1 -1
  54. package/web/dist/assets/index-DRDDTtxF.js +13 -0
  55. package/web/dist/index.html +2 -2
  56. package/web/dist/assets/index-BUK8xUHm.js +0 -12
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ageDuration, displayPlan } from "../state.js";
2
+ import { ageDuration } from "../state.js";
3
3
  import { Badge, PACE_TIPS, PaceBar, isEstimated, paceCells, resetClock, resetCountdown, timeLeft, } from "./PaceBar.js";
4
4
  import { ProviderIcon, providerTint } from "./ProviderIcon.js";
5
5
  import { lastClose } from "./ClosedWeeks.js";
@@ -20,7 +20,6 @@ export function ProviderCard({ provider, recommended, asOf, onSelect, }) {
20
20
  const updated = ageDuration(provider.ageMs);
21
21
  const resetsIn = quota ? timeLeft(quota.resetsAt, asOfMs) : null;
22
22
  const name = provider.displayName;
23
- const plan = displayPlan(quota?.plan);
24
23
  const last = lastClose(provider);
25
24
  return (_jsxs("article", { "data-testid": `provider-card-${provider.id}`, role: "button", tabIndex: 0, "aria-label": `${name} details`, onClick: () => onSelect(provider.id), onKeyDown: (e) => {
26
25
  // Space or Enter aimed at the windows chevron must not also open the drawer.
@@ -28,5 +27,5 @@ export function ProviderCard({ provider, recommended, asOf, onSelect, }) {
28
27
  e.preventDefault();
29
28
  onSelect(provider.id);
30
29
  }
31
- }, className: `pcard ${recommended ? "is-recommended is-top-pick" : ""}`, children: [_jsxs("div", { className: "pcard-head", children: [_jsx("span", { className: "picon", style: providerTint(provider.id), "aria-hidden": "true", children: _jsx(ProviderIcon, { id: provider.id, title: name }) }), _jsxs("div", { className: "who", children: [_jsxs("b", { children: [name, recommended && (_jsx("span", { className: "rec-icon", title: "Recommended for next session", role: "img", "aria-label": "recommended", children: _jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.3", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "m12 3-1.9 5.8a2 2 0 0 1-1.3 1.3L3 12l5.8 1.9a2 2 0 0 1 1.3 1.3L12 21l1.9-5.8a2 2 0 0 1 1.3-1.3L21 12l-5.8-1.9a2 2 0 0 1-1.3-1.3z" }) }) }))] }), plan && _jsx("span", { className: "pl", children: plan }), updated && _jsxs("span", { className: "src", children: ["Updated ", updated, " ago"] })] }), _jsx(Badge, { provider: provider })] }), _jsxs("div", { className: "pcard-body", children: [_jsx(PaceBar, { provider: provider, asOf: asOf }), _jsx(WindowsRow, { provider: provider, asOf: asOf, variant: "card" }), _jsxs("div", { className: "pstats", children: [_jsxs("div", { title: PACE_TIPS.avg, children: [_jsx("span", { className: "l", children: "Avg pace" }), _jsx("span", { className: "v", children: pace.avg })] }), _jsxs("div", { title: PACE_TIPS.recent, children: [_jsx("span", { className: "l", children: "24h pace" }), _jsx("span", { className: "v", children: pace.recent })] }), _jsxs("div", { title: PACE_TIPS.ideal, children: [_jsx("span", { className: "l", children: "Ideal pace" }), _jsx("span", { className: "v", children: advisory ? `${advisory.idealRate.toFixed(1)}%/day` : "—" })] }), _jsxs("div", { children: [_jsx("span", { className: "l", children: "Resets in" }), _jsx("span", { className: "v", children: resetsIn ? `${resetsIn}${isEstimated(provider) ? " (est.)" : ""}` : resetCountdown(provider, asOfMs) })] })] })] }), _jsxs("div", { className: "pcard-foot", children: [_jsxs("div", { className: "foot-meta", children: [_jsx("span", { children: resetsDate(provider) ?? resetCountdown(provider, asOfMs) }), last && (_jsxs("span", { className: "last-week", children: ["Last week ", last.leftoverPct, "% leftover", last.resetsAtEstimated ? " (est.)" : ""] }))] }), _jsx("span", { className: "rowbtn", "aria-hidden": "true", children: "Inspect" })] })] }));
30
+ }, className: `pcard ${recommended ? "is-recommended is-top-pick" : ""}`, children: [_jsxs("div", { className: "pcard-head", children: [_jsx("span", { className: "picon", style: providerTint(provider.id), "aria-hidden": "true", children: _jsx(ProviderIcon, { id: provider.id, title: name }) }), _jsxs("div", { className: "who", children: [_jsxs("b", { children: [name, recommended && (_jsx("span", { className: "rec-icon", title: "Recommended for next session", role: "img", "aria-label": "recommended", children: _jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.3", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "m12 3-1.9 5.8a2 2 0 0 1-1.3 1.3L3 12l5.8 1.9a2 2 0 0 1 1.3 1.3L12 21l1.9-5.8a2 2 0 0 1 1.3-1.3L21 12l-5.8-1.9a2 2 0 0 1-1.3-1.3z" }) }) }))] }), updated && _jsxs("span", { className: "src", children: ["Updated ", updated, " ago"] })] }), _jsx(Badge, { provider: provider })] }), _jsxs("div", { className: "pcard-body", children: [_jsx(PaceBar, { provider: provider, asOf: asOf }), _jsx(WindowsRow, { provider: provider, asOf: asOf, variant: "card" }), _jsxs("div", { className: "pstats", children: [_jsxs("div", { title: PACE_TIPS.avg, children: [_jsx("span", { className: "l", children: "Avg pace" }), _jsx("span", { className: "v", children: pace.avg })] }), _jsxs("div", { title: PACE_TIPS.recent, children: [_jsx("span", { className: "l", children: "24h pace" }), _jsx("span", { className: "v", children: pace.recent })] }), _jsxs("div", { title: PACE_TIPS.ideal, children: [_jsx("span", { className: "l", children: "Ideal pace" }), _jsx("span", { className: "v", children: advisory ? `${advisory.idealRate.toFixed(1)}%/day` : "—" })] }), _jsxs("div", { children: [_jsx("span", { className: "l", children: "Resets in" }), _jsx("span", { className: "v", children: resetsIn ? `${resetsIn}${isEstimated(provider) ? " (est.)" : ""}` : resetCountdown(provider, asOfMs) })] })] })] }), _jsxs("div", { className: "pcard-foot", children: [_jsxs("div", { className: "foot-meta", children: [_jsx("span", { children: resetsDate(provider) ?? resetCountdown(provider, asOfMs) }), last && (_jsxs("span", { className: "last-week", children: ["Last week ", last.leftoverPct, "% leftover", last.resetsAtEstimated ? " (est.)" : ""] }))] }), _jsx("span", { className: "rowbtn", "aria-hidden": "true", children: "Inspect" })] })] }));
32
31
  }
@@ -1,7 +1,7 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useRef, useState } from "react";
3
3
  import { ageDuration, displayPlan, providerSubtitle, shortWindowLabel } from "../state.js";
4
- import { Badge, PaceBar, barGeometry, isEstimated, paceBadge, paceFigures, resetClock, timeLeft, } from "./PaceBar.js";
4
+ import { Badge, PaceBar, barGeometry, isEstimated, paceBadge, paceFigures, resetClock, resetDateClock, timeLeft, } from "./PaceBar.js";
5
5
  import { ProviderIcon, providerTint } from "./ProviderIcon.js";
6
6
  import { ClosedWeeks } from "./ClosedWeeks.js";
7
7
  import { renameProvider } from "../api.js";
@@ -166,7 +166,7 @@ export function monthlyMeta(provider) {
166
166
  const q = provider.quota;
167
167
  if (q?.monthlyKind !== "included" || !q.monthlyResetsAt)
168
168
  return null;
169
- const clock = resetClock(q.monthlyResetsAt);
169
+ const clock = resetDateClock(q.monthlyResetsAt);
170
170
  const base = clock ? `Resets ${clock}` : "Reset unknown";
171
171
  const adv = provider.advisory;
172
172
  if (q.monthlyStatus === "exhausted" || (adv?.bindingWindow === "monthly" && adv.bindingRemaining === 0)) {
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /** Brand-mark paths from the signed-off concept. Unknown ids fall back to a letter. */
3
3
  const PATHS = {
4
4
  kimi: 'M12 7v5l3 2M12 12m-8.5 0a8.5 8.5 0 1 0 17 0a8.5 8.5 0 1 0-17 0',
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { type ProviderView } from "../state.js";
2
+ import type { ProviderView } from "../state.js";
3
3
  export declare function ProviderRow({ provider, recommended, asOf, onSelect, }: {
4
4
  provider: ProviderView;
5
5
  recommended: boolean;
@@ -1,5 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { displayPlan } from "../state.js";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
2
  import { Badge, PaceBar, forecastLine, paceLines, resetCellLines, } from "./PaceBar.js";
4
3
  import { lastClose } from "./ClosedWeeks.js";
5
4
  import { WindowsRow } from "./WindowsRow.js";
@@ -9,10 +8,9 @@ export function ProviderRow({ provider, recommended, asOf, onSelect, }) {
9
8
  const asOfMs = Date.parse(asOf);
10
9
  const lines = paceLines(advisory);
11
10
  const name = provider.displayName;
12
- const plan = displayPlan(quota?.plan);
13
11
  const reset = resetCellLines(provider, asOfMs);
14
12
  const last = lastClose(provider);
15
- return (_jsxs("div", { "data-testid": `provider-row-${provider.id}`, className: `lrow ${recommended ? "is-recommended is-top-pick" : ""}`, onClick: () => onSelect(provider.id), children: [_jsxs("div", { className: "prov", "data-label": "Provider", children: [_jsx("span", { className: "dot", style: { background: `var(--p-${provider.id.split(":")[0]}, var(--surface-raised))` }, "aria-hidden": "true" }), _jsxs("span", { children: [_jsxs("span", { className: "nm", children: [name, recommended && (_jsx("span", { className: "rec-icon", title: "Recommended for next session", role: "img", "aria-label": "recommended", children: _jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.3", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "m12 3-1.9 5.8a2 2 0 0 1-1.3 1.3L3 12l5.8 1.9a2 2 0 0 1 1.3 1.3L12 21l1.9-5.8a2 2 0 0 1 1.3-1.3L21 12l-5.8-1.9a2 2 0 0 1-1.3-1.3z" }) }) }))] }), plan && _jsx("span", { className: "pl", children: plan })] })] }), _jsx("div", { "data-label": "Used vs elapsed", children: quota ? (_jsxs(_Fragment, { children: [_jsx(PaceBar, { provider: provider, asOf: asOf }), _jsx(WindowsRow, { provider: provider, asOf: asOf, variant: "row" })] })) : "—" }), _jsxs("div", { "data-label": "Reset", className: "reset-cell", children: [_jsx("span", { className: "cell-b", children: reset.top }), reset.bottom && _jsx("span", { className: "cell-s", children: reset.bottom }), last && (_jsxs("span", { className: "cell-s", children: ["last week ", last.leftoverPct, "% leftover", last.resetsAtEstimated ? " (est.)" : ""] }))] }), _jsxs("div", { "data-label": "Pace", children: [_jsx(Badge, { provider: provider }), lines.length > 0 && (_jsx("div", { style: { marginTop: 2 }, children: lines.map((l) => (_jsxs("div", { className: "cell-s paceline", title: l.tip, children: [_jsx("span", { children: l.label }), _jsx("span", { className: "cell-b", children: l.value })] }, l.label))) }))] }), _jsx("button", { type: "button", className: "rowbtn", onClick: (e) => {
13
+ return (_jsxs("div", { "data-testid": `provider-row-${provider.id}`, className: `lrow ${recommended ? "is-recommended is-top-pick" : ""}`, onClick: () => onSelect(provider.id), children: [_jsxs("div", { className: "prov", "data-label": "Provider", children: [_jsx("span", { className: "dot", style: { background: `var(--p-${provider.id.split(":")[0]}, var(--surface-raised))` }, "aria-hidden": "true" }), _jsx("span", { children: _jsxs("span", { className: "nm", children: [name, recommended && (_jsx("span", { className: "rec-icon", title: "Recommended for next session", role: "img", "aria-label": "recommended", children: _jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.3", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "m12 3-1.9 5.8a2 2 0 0 1-1.3 1.3L3 12l5.8 1.9a2 2 0 0 1 1.3 1.3L12 21l1.9-5.8a2 2 0 0 1 1.3-1.3L21 12l-5.8-1.9a2 2 0 0 1-1.3-1.3z" }) }) }))] }) })] }), _jsx("div", { "data-label": "Used vs elapsed", children: quota ? (_jsxs(_Fragment, { children: [_jsx(PaceBar, { provider: provider, asOf: asOf }), _jsx(WindowsRow, { provider: provider, asOf: asOf, variant: "row" })] })) : "—" }), _jsxs("div", { "data-label": "Reset", className: "reset-cell", children: [_jsx("span", { className: "cell-b", children: reset.top }), reset.bottom && _jsx("span", { className: "cell-s", children: reset.bottom }), last && (_jsxs("span", { className: "cell-s", children: ["last week ", last.leftoverPct, "% leftover", last.resetsAtEstimated ? " (est.)" : ""] }))] }), _jsxs("div", { "data-label": "Pace", children: [_jsx(Badge, { provider: provider }), lines.length > 0 && (_jsx("div", { style: { marginTop: 2 }, children: lines.map((l) => (_jsxs("div", { className: "cell-s paceline", title: l.tip, children: [_jsx("span", { children: l.label }), _jsx("span", { className: "cell-b", children: l.value })] }, l.label))) }))] }), _jsx("button", { type: "button", className: "rowbtn", onClick: (e) => {
16
14
  e.stopPropagation();
17
15
  onSelect(provider.id);
18
16
  }, children: "Inspect" }), _jsx("span", { className: "sr-only", children: forecastLine(provider) })] }));
@@ -1,4 +1,4 @@
1
- import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { ageLabel } from "../state.js";
3
3
  import { timeLeft } from "./PaceBar.js";
4
4
  import { ProviderIcon, providerTint } from "./ProviderIcon.js";
@@ -1,4 +1,4 @@
1
- import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useRef, useState } from "react";
3
3
  import { paceBadge, resetClock, resetCountdown, timeLeft } from "./PaceBar.js";
4
4
  export const RAIL_DAYS = 7;
@@ -10,7 +10,7 @@ export interface WindowUnit {
10
10
  pct: number;
11
11
  /** Presentation-only heat: < 80 none, 80–99 hot, 100 or exhausted full. */
12
12
  heat: "" | "hot" | "full";
13
- /** Tag time outside the pill: "in 7d", or the weekday alone when the month is exhausted. */
13
+ /** Tag time outside the pill: "in 7d", or the weekday plus date when the month is exhausted. */
14
14
  time: string | null;
15
15
  /** Expanded card track's reset line. */
16
16
  reset: string | null;
@@ -1,6 +1,6 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from "react";
3
- import { resetClock, resetWeekday } from "./PaceBar.js";
3
+ import { resetDateClock, resetDay } from "./PaceBar.js";
4
4
  const MIN_MS = 60_000;
5
5
  const HOUR_MS = 60 * MIN_MS;
6
6
  const DAY_MS = 24 * HOUR_MS;
@@ -34,10 +34,10 @@ export function windowUnits(provider, asOfMs) {
34
34
  if (q.monthlyKind === "included" && typeof q.monthlyPct === "number" && q.monthlyResetsAt) {
35
35
  const exhausted = q.monthlyStatus === "exhausted";
36
36
  const left = windowCountdown(q.monthlyResetsAt, asOfMs);
37
- const clock = resetClock(q.monthlyResetsAt);
37
+ const clock = resetDateClock(q.monthlyResetsAt);
38
38
  units.push({ win: "month", tag: "Mth", cardLabel: "Monthly", rowLabel: "Month",
39
39
  pct: q.monthlyPct, heat: heatOf(q.monthlyPct, exhausted),
40
- time: exhausted ? resetWeekday(q.monthlyResetsAt) : left ? `in ${left}` : null,
40
+ time: exhausted ? resetDay(q.monthlyResetsAt) : left ? `in ${left}` : null,
41
41
  reset: exhausted ? (clock ? `resets ${clock}` : null) : left ? `in ${left}` : null });
42
42
  }
43
43
  return units;
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useRef, useState } from "react";
3
3
  import { ProvidersPanel } from "./ProvidersPanel.js";
4
4
  import { CliIntegrationPanel } from "./CliIntegrationPanel.js";