@hanzo/ui 8.27.54 → 8.27.55
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/dist/backends/gui/progress.cjs +2 -2
- package/dist/backends/gui/progress.d.ts +3 -1
- package/dist/backends/gui/progress.d.ts.map +1 -1
- package/dist/backends/gui/progress.js +2 -2
- package/dist/backends/gui/progress.js.map +1 -1
- package/dist/gallery.cjs +17 -1
- package/dist/gallery.d.ts.map +1 -1
- package/dist/gallery.html +21 -4
- package/dist/gallery.js +17 -1
- package/dist/gallery.js.map +1 -1
- package/dist/marketing/rows.cjs +5 -11
- package/dist/marketing/rows.d.ts +2 -1
- package/dist/marketing/rows.d.ts.map +1 -1
- package/dist/marketing/rows.js +5 -11
- package/dist/marketing/rows.js.map +1 -1
- package/dist/models/ModelSelector.cjs +7 -3
- package/dist/models/ModelSelector.d.ts +9 -1
- package/dist/models/ModelSelector.d.ts.map +1 -1
- package/dist/models/ModelSelector.js +7 -3
- package/dist/models/ModelSelector.js.map +1 -1
- package/dist/product/LimitedBanner.cjs +22 -0
- package/dist/product/LimitedBanner.d.ts +10 -0
- package/dist/product/LimitedBanner.d.ts.map +1 -0
- package/dist/product/LimitedBanner.js +20 -0
- package/dist/product/LimitedBanner.js.map +1 -0
- package/dist/product/UsageMeter.cjs +48 -0
- package/dist/product/UsageMeter.d.ts +18 -0
- package/dist/product/UsageMeter.d.ts.map +1 -0
- package/dist/product/UsageMeter.js +45 -0
- package/dist/product/UsageMeter.js.map +1 -0
- package/dist/product/index.cjs +6 -0
- package/dist/product/index.d.ts +4 -0
- package/dist/product/index.d.ts.map +1 -1
- package/dist/product/index.js +6 -0
- package/dist/product/index.js.map +1 -1
- package/dist/product/limits.cjs +246 -0
- package/dist/product/limits.d.ts +113 -0
- package/dist/product/limits.d.ts.map +1 -0
- package/dist/product/limits.js +233 -0
- package/dist/product/limits.js.map +1 -0
- package/dist/product/pure.cjs +17 -0
- package/dist/product/pure.d.ts +1 -0
- package/dist/product/pure.d.ts.map +1 -1
- package/dist/product/pure.js +3 -0
- package/dist/product/pure.js.map +1 -1
- package/dist/product/useLimits.cjs +124 -0
- package/dist/product/useLimits.d.ts +27 -0
- package/dist/product/useLimits.d.ts.map +1 -0
- package/dist/product/useLimits.js +120 -0
- package/dist/product/useLimits.js.map +1 -0
- package/dist/styles.css +17 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type LimitClass, type Limits } from './limits.js';
|
|
2
|
+
/** The status rung each state paints its bar in. */
|
|
3
|
+
export declare const STATE_COLOR: {
|
|
4
|
+
readonly ok: '$good';
|
|
5
|
+
readonly near: '$yellow10';
|
|
6
|
+
readonly limited: '$bad';
|
|
7
|
+
};
|
|
8
|
+
export interface UsageMeterProps {
|
|
9
|
+
limits: Limits;
|
|
10
|
+
/** Which classes to draw, in order; those the limits do not name are skipped. */
|
|
11
|
+
classes?: readonly LimitClass[];
|
|
12
|
+
/** `sm` for a composer's foot, `md` for a page. */
|
|
13
|
+
size?: 'sm' | 'md';
|
|
14
|
+
/** The clock resets are read against; tests pin it. */
|
|
15
|
+
now?: number;
|
|
16
|
+
}
|
|
17
|
+
export declare function UsageMeter({ limits, classes, size, now }: UsageMeterProps): import("react").JSX.Element | null;
|
|
18
|
+
//# sourceMappingURL=UsageMeter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UsageMeter.d.ts","sourceRoot":"","sources":["../../src/product/UsageMeter.tsx"],"names":[],"mappings":"AAUA,OAAO,EAA+C,KAAK,UAAU,EAAqC,KAAK,MAAM,EAAE,MAAM,UAAU,CAAA;AAEvI,oDAAoD;AACpD,eAAO,MAAM,WAAW;iBAAS,OAAO;mBAAQ,WAAW;sBAAW,MAAM;CAAgD,CAAA;AAiC5H,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,iFAAiF;IACjF,OAAO,CAAC,EAAE,SAAS,UAAU,EAAE,CAAA;IAC/B,mDAAmD;IACnD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IAClB,uDAAuD;IACvD,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,OAAiB,EAAE,IAAW,EAAE,GAAG,EAAE,EAAE,eAAe,sCAgD1F"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* UsageMeter — one row per class of model: its name, a bar of the percent used
|
|
5
|
+
* in its state's colour, and when it resets. Shares only; no amount or count is
|
|
6
|
+
* ever drawn. A class with a short window carries it as a second, slimmer bar.
|
|
7
|
+
*/
|
|
8
|
+
import { Text, XStack, YStack } from '@hanzo/gui';
|
|
9
|
+
import { Progress } from '../backends/gui/progress.js';
|
|
10
|
+
import { slot } from '../backends/gui/slot.js';
|
|
11
|
+
import { CLASSES, CLASS_LABEL, when } from './limits.js';
|
|
12
|
+
/** The status rung each state paints its bar in. */
|
|
13
|
+
export const STATE_COLOR = { ok: '$good', near: '$yellow10', limited: '$bad' };
|
|
14
|
+
/** What a class row says under its bar about who pays now. */
|
|
15
|
+
function caption(c) {
|
|
16
|
+
if (c.state === 'limited' && c.paying === 'none')
|
|
17
|
+
return 'Paused';
|
|
18
|
+
if (c.paying === 'prepaid')
|
|
19
|
+
return 'Paid from prepaid credit';
|
|
20
|
+
if (c.paying === 'credits')
|
|
21
|
+
return 'Paid from credits';
|
|
22
|
+
if (c.state === 'near')
|
|
23
|
+
return 'Almost used';
|
|
24
|
+
return '';
|
|
25
|
+
}
|
|
26
|
+
function Session({ label, w, now }) {
|
|
27
|
+
const resets = when(w.resets_at, now);
|
|
28
|
+
return (_jsxs(XStack, { items: "center", gap: "$2", minW: 0, "data-state": w.state, ...slot('usage-meter-window'), children: [_jsx(Text, { fontSize: "$1", color: "$soft", shrink: 0, children: "Session" }), _jsx(Progress, { value: w.percent, height: 4, flex: 1, minW: 0, indicatorColor: STATE_COLOR[w.state], "aria-label": `${label} session: ${w.percent}% used` }), _jsxs(Text, { fontSize: "$1", color: "$soft", shrink: 0, fontVariant: ['tabular-nums'], children: [w.percent, "%", resets ? ` · Resets ${resets}` : ''] })] }));
|
|
29
|
+
}
|
|
30
|
+
export function UsageMeter({ limits, classes = CLASSES, size = 'md', now }) {
|
|
31
|
+
const rows = classes.flatMap((c) => {
|
|
32
|
+
const k = limits.classes[c];
|
|
33
|
+
return k ? [{ c, k }] : [];
|
|
34
|
+
});
|
|
35
|
+
if (!rows.length)
|
|
36
|
+
return null;
|
|
37
|
+
const sm = size === 'sm';
|
|
38
|
+
return (_jsx(YStack, { gap: sm ? '$2.5' : '$5', width: "100%", minW: 0, ...slot('usage-meter'), children: rows.map(({ c, k }) => {
|
|
39
|
+
const label = CLASS_LABEL[c];
|
|
40
|
+
const resets = when(k.resets_at, now);
|
|
41
|
+
const note = caption(k);
|
|
42
|
+
return (_jsxs(YStack, { gap: sm ? '$1.5' : '$2', minW: 0, "data-class": c, "data-state": k.state, ...slot('usage-meter-row'), children: [_jsxs(XStack, { justify: "space-between", items: "baseline", gap: "$3", minW: 0, children: [_jsx(Text, { fontSize: sm ? '$2' : '$3', color: "$ink", fontWeight: "500", numberOfLines: 1, children: label }), _jsxs(Text, { fontSize: sm ? '$2' : '$3', color: "$ink", fontVariant: ['tabular-nums'], shrink: 0, children: [k.percent, "% used"] })] }), _jsx(Progress, { value: k.percent, height: sm ? 4 : 8, minW: 0, indicatorColor: STATE_COLOR[k.state], "aria-label": `${label}: ${k.percent}% used` }), resets || note ? (_jsxs(XStack, { justify: "space-between", gap: "$3", flexWrap: "wrap", minW: 0, children: [_jsx(Text, { fontSize: sm ? '$1' : '$2', color: "$soft", children: resets ? `Resets ${resets}` : '' }), note ? (_jsx(Text, { fontSize: sm ? '$1' : '$2', color: k.state === 'limited' ? '$bad' : '$soft', children: note })) : null] })) : null, k.window ? _jsx(Session, { label: label, w: k.window, now: now }) : null] }, c));
|
|
43
|
+
}) }));
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=UsageMeter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UsageMeter.js","sourceRoot":"","sources":["../../src/product/UsageMeter.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;GAIG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAoF,MAAM,UAAU,CAAA;AAEvI,oDAAoD;AACpD,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAgD,CAAA;AAE5H,8DAA8D;AAC9D,SAAS,OAAO,CAAC,CAAa;IAC5B,IAAI,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM;QAAE,OAAO,QAAQ,CAAA;IACjE,IAAI,CAAC,CAAC,MAAM,KAAK,SAAS;QAAE,OAAO,0BAA0B,CAAA;IAC7D,IAAI,CAAC,CAAC,MAAM,KAAK,SAAS;QAAE,OAAO,mBAAmB,CAAA;IACtD,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;QAAE,OAAO,aAAa,CAAA;IAC5C,OAAO,EAAE,CAAA;AACX,CAAC;AAED,SAAS,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAmD;IACjF,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;IACrC,OAAO,CACL,MAAC,MAAM,IAAC,KAA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CAAC,CAAC,EAClB,IAAI,EAAE,CAAC,EACP,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,gBACxB,GAAG,KAAK,KAAK,CAAC,CAAC,OAAO,QAAQ,GAC1C,EACD,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAChB,MAAC,MAAM,IAAC,OAAO,EAAC,eAAe,EAAC,GAAG,EAAC,IAAI,EAAC,QAAQ,EAAC,MAAM,EAAC,IAAI,EAAE,CAAC,aAC9D,KAAC,IAAI,IAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAC,OAAO,YAC5C,MAAM,CAAC,CAAC,CAAC,UAAU,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,GAC5B,EACN,IAAI,CAAC,CAAC,CAAC,CACN,KAAC,IAAI,IAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,YAC9E,IAAI,GACA,CACR,CAAC,CAAC,CAAC,IAAI,IACD,CACV,CAAC,CAAC,CAAC,IAAI,EACP,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAC,OAAO,IAAC,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC,CAAC,CAAC,IAAI,KA5BxD,CAAC,CA6BL,CACV,CAAA;QACH,CAAC,CAAC,GACK,CACV,CAAA;AACH,CAAC"}
|
package/dist/product/index.cjs
CHANGED
|
@@ -202,3 +202,9 @@ var data_1 = require("@hanzo/data");
|
|
|
202
202
|
Object.defineProperty(exports, "tokens", { enumerable: true, get: function () { return data_1.tokens; } });
|
|
203
203
|
Object.defineProperty(exports, "TAG_TONES", { enumerable: true, get: function () { return data_1.TAG_TONES; } });
|
|
204
204
|
Object.defineProperty(exports, "tagTone", { enumerable: true, get: function () { return data_1.tagTone; } });
|
|
205
|
+
// Plan usage limits — `GET /v1/ai/limits` and the served-call headers, held by
|
|
206
|
+
// `useLimits`; `UsageMeter` draws a class's share, `LimitedBanner` a pause.
|
|
207
|
+
__exportStar(require("./limits.cjs"), exports);
|
|
208
|
+
__exportStar(require("./useLimits.cjs"), exports);
|
|
209
|
+
__exportStar(require("./UsageMeter.cjs"), exports);
|
|
210
|
+
__exportStar(require("./LimitedBanner.cjs"), exports);
|
package/dist/product/index.d.ts
CHANGED
|
@@ -64,4 +64,8 @@ export * from './accent.js';
|
|
|
64
64
|
export * from './color.js';
|
|
65
65
|
export * from './social/index.js';
|
|
66
66
|
export { tokens, TAG_TONES, tagTone, type TagTone } from '@hanzo/data';
|
|
67
|
+
export * from './limits.js';
|
|
68
|
+
export * from './useLimits.js';
|
|
69
|
+
export * from './UsageMeter.js';
|
|
70
|
+
export * from './LimitedBanner.js';
|
|
67
71
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/product/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAA;AAKxB,OAAO,EACL,MAAM,EACN,aAAa,EACb,SAAS,EACT,SAAS,IAAI,eAAe,EAC5B,QAAQ,EACR,OAAO,EACP,SAAS,EACT,UAAU,EACV,UAAU,EACV,KAAK,GACN,MAAM,UAAU,CAAA;AAGjB,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAK/D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,cAAc,mBAAmB,CAAA;AAKjC,OAAO,EACL,UAAU,EACV,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,eAAe,GACrB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,KAAK,EACL,KAAK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5B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AAGvB,cAAc,QAAQ,CAAA;AACtB,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAM5B,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAG3B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,eAAe,CAAA;AAM7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAK/B,cAAc,cAAc,CAAA;AAc5B,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AASvB,cAAc,UAAU,CAAA;AAKxB,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAA;AAItE,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA"}
|
package/dist/product/index.js
CHANGED
|
@@ -155,4 +155,10 @@ export * from './social/index.js';
|
|
|
155
155
|
// @hanzo/data) — the theme this layer renders against. Design-token PRIMITIVES
|
|
156
156
|
// (colors, dark/light, radii, spacing) are the runtime-free `@hanzo/ui/core`.
|
|
157
157
|
export { tokens, TAG_TONES, tagTone } from '@hanzo/data';
|
|
158
|
+
// Plan usage limits — `GET /v1/ai/limits` and the served-call headers, held by
|
|
159
|
+
// `useLimits`; `UsageMeter` draws a class's share, `LimitedBanner` a pause.
|
|
160
|
+
export * from './limits.js';
|
|
161
|
+
export * from './useLimits.js';
|
|
162
|
+
export * from './UsageMeter.js';
|
|
163
|
+
export * from './LimitedBanner.js';
|
|
158
164
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/product/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,EAAE;AACF,2EAA2E;AAC3E,gFAAgF;AAChF,iFAAiF;AACjF,gFAAgF;AAChF,wEAAwE;AACxE,EAAE;AACF,kFAAkF;AAClF,6EAA6E;AAE7E,kFAAkF;AAClF,gEAAgE;AAChE,cAAc,UAAU,CAAA;AAExB,2EAA2E;AAC3E,+EAA+E;AAC/E,4CAA4C;AAC5C,OAAO,EACL,MAAM,EACN,aAAa,EACb,SAAS,EACT,SAAS,IAAI,eAAe,EAC5B,QAAQ,EACR,OAAO,EACP,SAAS,EACT,UAAU,EACV,UAAU,EACV,KAAK,GACN,MAAM,UAAU,CAAA;AAEjB,6EAA6E;AAC7E,OAAO,EAAE,KAAK,IAAI,SAAS,EAAqB,MAAM,SAAS,CAAA;AAE/D,+EAA+E;AAC/E,8EAA8E;AAC9E,qCAAqC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,cAAc,mBAAmB,CAAA;AAEjC,gFAAgF;AAChF,iFAAiF;AACjF,4EAA4E;AAC5E,OAAO,EACL,UAAU,GAIX,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,KAAK,EACL,KAAK,EACL,GAAG,EACH,MAAM,EACN,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,IAAI,GAKL,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,UAAU,EACV,UAAU,EACV,OAAO,EACP,UAAU,GAMX,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAwD,MAAM,gBAAgB,CAAA;AAE/G,gFAAgF;AAChF,6EAA6E;AAC7E,mFA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AAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Plan usage limits — `GET /v1/ai/limits`, the served-call headers and the
|
|
3
|
+
// billing refusals, read into one shape. Shares only: a percent per class and
|
|
4
|
+
// when it resets, never an amount or a count.
|
|
5
|
+
//
|
|
6
|
+
// Classes: `premium` is third-party frontier models, `ours` is Hanzo models
|
|
7
|
+
// (zen, enso, kai, jev), `free` is the free lane. State is `ok` below 80 %,
|
|
8
|
+
// `near` from 80 to 99 %, and `limited` when the class is used up and nothing
|
|
9
|
+
// else pays.
|
|
10
|
+
//
|
|
11
|
+
// No React, no gui: this loads in Node and in a server component.
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.worst = exports.CLASS_LABEL = exports.CLASSES = void 0;
|
|
14
|
+
exports.actionsOf = actionsOf;
|
|
15
|
+
exports.limitsOf = limitsOf;
|
|
16
|
+
exports.servedOf = servedOf;
|
|
17
|
+
exports.refusalOf = refusalOf;
|
|
18
|
+
exports.classOf = classOf;
|
|
19
|
+
exports.overlay = overlay;
|
|
20
|
+
exports.classesLabel = classesLabel;
|
|
21
|
+
exports.when = when;
|
|
22
|
+
exports.noticeOf = noticeOf;
|
|
23
|
+
exports.nearOf = nearOf;
|
|
24
|
+
exports.CLASSES = ['premium', 'ours', 'free'];
|
|
25
|
+
exports.CLASS_LABEL = {
|
|
26
|
+
premium: 'Premium models',
|
|
27
|
+
ours: 'Hanzo models',
|
|
28
|
+
free: 'Free models',
|
|
29
|
+
};
|
|
30
|
+
const STATES = ['ok', 'near', 'limited'];
|
|
31
|
+
const PAYERS = ['plan', 'prepaid', 'credits', 'none'];
|
|
32
|
+
const PAID = ['plan', 'prepaid', 'credits', 'free'];
|
|
33
|
+
const RANK = { ok: 0, near: 1, limited: 2 };
|
|
34
|
+
const text = (v) => (typeof v === 'string' ? v : null);
|
|
35
|
+
const one = (set, v) => typeof v === 'string' && set.includes(v) ? v : null;
|
|
36
|
+
const record = (v) => v && typeof v === 'object' && !Array.isArray(v) ? v : null;
|
|
37
|
+
/** The worse of two states. */
|
|
38
|
+
const worst = (a, b) => (RANK[b] > RANK[a] ? b : a);
|
|
39
|
+
exports.worst = worst;
|
|
40
|
+
/** A percent as the bar draws it: a whole number from 0 to 100. */
|
|
41
|
+
const share = (v) => typeof v === 'number' && Number.isFinite(v) ? Math.min(100, Math.max(0, Math.round(v))) : null;
|
|
42
|
+
function windowOf(v) {
|
|
43
|
+
const o = record(v);
|
|
44
|
+
const percent = share(o?.percent);
|
|
45
|
+
if (percent === null)
|
|
46
|
+
return null;
|
|
47
|
+
return {
|
|
48
|
+
percent,
|
|
49
|
+
state: one(STATES, o?.state) ?? (percent >= 80 ? 'near' : 'ok'),
|
|
50
|
+
resets_at: text(o?.resets_at),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function classOfBody(v) {
|
|
54
|
+
const w = windowOf(v);
|
|
55
|
+
if (!w)
|
|
56
|
+
return null;
|
|
57
|
+
const o = record(v);
|
|
58
|
+
const short = windowOf(o?.window);
|
|
59
|
+
return { ...w, paying: one(PAYERS, o?.paying) ?? 'plan', ...(short ? { window: short } : {}) };
|
|
60
|
+
}
|
|
61
|
+
function actionsOf(v) {
|
|
62
|
+
if (!Array.isArray(v))
|
|
63
|
+
return [];
|
|
64
|
+
return v.flatMap((a) => {
|
|
65
|
+
const o = record(a);
|
|
66
|
+
const kind = one(['upgrade', 'topup'], o?.kind);
|
|
67
|
+
const url = text(o?.url);
|
|
68
|
+
if (!kind || !url)
|
|
69
|
+
return [];
|
|
70
|
+
const plan = text(o?.plan);
|
|
71
|
+
return [{ kind, label: text(o?.label) || (kind === 'upgrade' ? 'Upgrade' : 'Add prepaid credit'), url, ...(plan ? { plan } : {}) }];
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
const classList = (v) => Array.isArray(v) ? v.flatMap((c) => (one(exports.CLASSES, c) ? [c] : [])) : [];
|
|
75
|
+
/**
|
|
76
|
+
* `GET /v1/ai/limits`, checked field by field. A body without a string `plan`
|
|
77
|
+
* is not an answer; a class without a numeric percent is left out rather than
|
|
78
|
+
* drawn full or empty.
|
|
79
|
+
*/
|
|
80
|
+
function limitsOf(body) {
|
|
81
|
+
const o = record(body);
|
|
82
|
+
const plan = text(o?.plan);
|
|
83
|
+
if (plan === null)
|
|
84
|
+
return null;
|
|
85
|
+
const classes = {};
|
|
86
|
+
const raw = record(o?.classes);
|
|
87
|
+
for (const c of exports.CLASSES) {
|
|
88
|
+
const got = classOfBody(raw?.[c]);
|
|
89
|
+
if (got)
|
|
90
|
+
classes[c] = got;
|
|
91
|
+
}
|
|
92
|
+
const lim = record(o?.limited);
|
|
93
|
+
const limited = lim
|
|
94
|
+
? { reason: text(lim.reason) ?? '', classes: classList(lim.classes), message: text(lim.message) ?? '' }
|
|
95
|
+
: undefined;
|
|
96
|
+
const state = one(STATES, o?.state) ??
|
|
97
|
+
Object.values(classes).reduce((s, c) => (0, exports.worst)(s, c ? (0, exports.worst)(c.state, c.window?.state ?? 'ok') : 'ok'), 'ok');
|
|
98
|
+
return {
|
|
99
|
+
plan,
|
|
100
|
+
period_start: text(o?.period_start) ?? undefined,
|
|
101
|
+
period_end: text(o?.period_end) ?? undefined,
|
|
102
|
+
state,
|
|
103
|
+
classes,
|
|
104
|
+
...(limited ? { limited } : {}),
|
|
105
|
+
actions: actionsOf(o?.actions),
|
|
106
|
+
upgrade: text(o?.upgrade) ?? undefined,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/** The usage headers on a served call, or null when it carries none. */
|
|
110
|
+
function servedOf(headers) {
|
|
111
|
+
const usage = one(STATES, headers.get('x-hanzo-usage'));
|
|
112
|
+
const fallback = headers.get('x-hanzo-fallback') || null;
|
|
113
|
+
if (!usage && !fallback)
|
|
114
|
+
return null;
|
|
115
|
+
return {
|
|
116
|
+
state: usage ?? 'limited',
|
|
117
|
+
class: one(exports.CLASSES, headers.get('x-hanzo-usage-class')),
|
|
118
|
+
paidBy: one(PAID, headers.get('x-hanzo-paid-by')),
|
|
119
|
+
fallback,
|
|
120
|
+
reason: headers.get('x-hanzo-usage-reason') || null,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/** A billing refusal's envelope, or null for any other error. */
|
|
124
|
+
function refusalOf(body, status, retryAfter) {
|
|
125
|
+
const e = record(record(body)?.error);
|
|
126
|
+
if (!e || e.type !== 'billing_error')
|
|
127
|
+
return null;
|
|
128
|
+
const retry = retryAfter ? Number(retryAfter) : NaN;
|
|
129
|
+
return {
|
|
130
|
+
status,
|
|
131
|
+
code: text(e.code) ?? '',
|
|
132
|
+
message: text(e.message) ?? '',
|
|
133
|
+
class: one(exports.CLASSES, e.class),
|
|
134
|
+
resets_at: text(e.resets_at),
|
|
135
|
+
actions: actionsOf(e.actions),
|
|
136
|
+
retry: Number.isFinite(retry) ? retry : null,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Which class a model id bills to. Hanzo's own families are `ours`, anything
|
|
141
|
+
* naming the free lane is `free`, and every other model is `premium`.
|
|
142
|
+
*/
|
|
143
|
+
function classOf(id) {
|
|
144
|
+
const bare = id.toLowerCase().replace(/^hanzo\//, '');
|
|
145
|
+
if (bare === 'free' || /(^|[-/:])free($|[-/:])/.test(bare))
|
|
146
|
+
return 'free';
|
|
147
|
+
if (/^(zen|enso|kai|jev)([-.:/0-9]|$)/.test(bare))
|
|
148
|
+
return 'ours';
|
|
149
|
+
return 'premium';
|
|
150
|
+
}
|
|
151
|
+
/** The limits with what served calls said since they were read laid over them. */
|
|
152
|
+
function overlay(limits, heard) {
|
|
153
|
+
if (!limits)
|
|
154
|
+
return null;
|
|
155
|
+
const classes = { ...limits.classes };
|
|
156
|
+
const { served, refusal } = heard;
|
|
157
|
+
if (served?.class && classes[served.class]) {
|
|
158
|
+
const c = classes[served.class];
|
|
159
|
+
classes[served.class] = { ...c, state: served.state };
|
|
160
|
+
}
|
|
161
|
+
if (refusal?.class && classes[refusal.class]) {
|
|
162
|
+
const c = classes[refusal.class];
|
|
163
|
+
classes[refusal.class] = { ...c, state: 'limited', paying: 'none', resets_at: refusal.resets_at ?? c.resets_at };
|
|
164
|
+
}
|
|
165
|
+
const state = Object.values(classes).reduce((s, c) => (0, exports.worst)(s, c ? (0, exports.worst)(c.state, c.window?.state ?? 'ok') : 'ok'), heard.served || heard.refusal ? 'ok' : limits.state);
|
|
166
|
+
return { ...limits, classes, state: (0, exports.worst)(state, refusal ? 'limited' : 'ok') };
|
|
167
|
+
}
|
|
168
|
+
/** The binding reset of a class: its short window's when that is the one used up. */
|
|
169
|
+
const resetOf = (c) => !c ? null : c.window && RANK[c.window.state] > RANK[c.state] ? c.window.resets_at : c.resets_at;
|
|
170
|
+
const earliest = (all) => all.reduce((a, b) => (!b ? a : !a || Date.parse(b) < Date.parse(a) ? b : a), null);
|
|
171
|
+
/** "Premium models", "Premium and Hanzo models". */
|
|
172
|
+
function classesLabel(classes) {
|
|
173
|
+
const names = exports.CLASSES.filter((c) => classes.includes(c)).map((c) => exports.CLASS_LABEL[c].replace(/ models$/, ''));
|
|
174
|
+
if (!names.length)
|
|
175
|
+
return 'Models';
|
|
176
|
+
const last = names.pop();
|
|
177
|
+
return `${names.length ? `${names.join(', ')} and ${last}` : last} models`;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* When a reset lands, as a sentence says it: a time for one within a day
|
|
181
|
+
* ("5:00 PM"), else a date ("Oct 30"), periods being UTC days. "" for none.
|
|
182
|
+
*/
|
|
183
|
+
function when(iso, now = Date.now()) {
|
|
184
|
+
const t = iso ? Date.parse(iso) : NaN;
|
|
185
|
+
if (Number.isNaN(t))
|
|
186
|
+
return '';
|
|
187
|
+
const d = new Date(t);
|
|
188
|
+
return t - now < 86_400_000
|
|
189
|
+
? d.toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit' })
|
|
190
|
+
: d.toLocaleDateString('en-US', { timeZone: 'UTC', month: 'short', day: 'numeric' });
|
|
191
|
+
}
|
|
192
|
+
const PLAIN = {
|
|
193
|
+
paid_plan_required: 'Premium models need a paid plan.',
|
|
194
|
+
free_plan_cap: "You've used the free plan's usage for now.",
|
|
195
|
+
insufficient_balance: 'Your prepaid credit has run out.',
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* What to tell a reader whose usage is paused or refused, or null when nothing
|
|
199
|
+
* is. A plan's included usage being used up reads as a pause until the reset;
|
|
200
|
+
* any other reason is the server's own message. A fallback reply adds the free
|
|
201
|
+
* model it was answered on, named by `name`.
|
|
202
|
+
*/
|
|
203
|
+
function noticeOf(limits, heard, name = (id) => id, now = Date.now()) {
|
|
204
|
+
const { served, refusal } = heard;
|
|
205
|
+
const fallback = served?.fallback ?? null;
|
|
206
|
+
const classes = new Set(limits?.limited?.classes ?? []);
|
|
207
|
+
for (const c of exports.CLASSES)
|
|
208
|
+
if (c !== 'free' && limits?.classes[c]?.state === 'limited')
|
|
209
|
+
classes.add(c);
|
|
210
|
+
if (refusal?.class)
|
|
211
|
+
classes.add(refusal.class);
|
|
212
|
+
if (fallback && served?.class && served.class !== 'free')
|
|
213
|
+
classes.add(served.class);
|
|
214
|
+
if (!refusal && !fallback && !limits?.limited && limits?.state !== 'limited')
|
|
215
|
+
return null;
|
|
216
|
+
const list = exports.CLASSES.filter((c) => classes.has(c));
|
|
217
|
+
const reason = refusal?.code || limits?.limited?.reason || served?.reason || '';
|
|
218
|
+
const resets = earliest([...list.map((c) => resetOf(limits?.classes[c])), refusal?.resets_at ?? null]);
|
|
219
|
+
const paused = reason === 'plan_allowance_used' || (!reason && list.length > 0);
|
|
220
|
+
const until = when(resets, now);
|
|
221
|
+
const said = paused
|
|
222
|
+
? `${classesLabel(list)} are paused${until ? ` until ${until}` : ''}.`
|
|
223
|
+
: refusal?.message || limits?.limited?.message || PLAIN[reason] || 'Usage is paused for now.';
|
|
224
|
+
return {
|
|
225
|
+
reason,
|
|
226
|
+
classes: list,
|
|
227
|
+
message: fallback ? `${said} You're chatting on ${name(fallback)}.` : said,
|
|
228
|
+
actions: limits?.actions.length ? limits.actions : (refusal?.actions ?? []),
|
|
229
|
+
resets_at: resets,
|
|
230
|
+
fallback,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
/** The one-line note for a class close to its included usage, or null. */
|
|
234
|
+
function nearOf(limits, now = Date.now()) {
|
|
235
|
+
if (!limits || limits.state === 'limited')
|
|
236
|
+
return null;
|
|
237
|
+
const near = exports.CLASSES.filter((c) => {
|
|
238
|
+
const k = limits.classes[c];
|
|
239
|
+
return c !== 'free' && k && (k.state === 'near' || k.window?.state === 'near');
|
|
240
|
+
});
|
|
241
|
+
if (!near.length)
|
|
242
|
+
return null;
|
|
243
|
+
const until = when(earliest(near.map((c) => resetOf(limits.classes[c]))), now);
|
|
244
|
+
const what = classesLabel(near).replace(/ models$/, '').replace('Premium', 'premium');
|
|
245
|
+
return `You're close to your plan's included ${what} model usage.${until ? ` Resets ${until}.` : ''}`;
|
|
246
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
export type LimitState = 'ok' | 'near' | 'limited';
|
|
2
|
+
export type LimitClass = 'premium' | 'ours' | 'free';
|
|
3
|
+
export type LimitPayer = 'plan' | 'prepaid' | 'credits' | 'none';
|
|
4
|
+
export type PaidBy = 'plan' | 'prepaid' | 'credits' | 'free';
|
|
5
|
+
export type LimitReason = 'plan_allowance_used' | 'paid_plan_required' | 'free_plan_cap' | 'insufficient_balance';
|
|
6
|
+
/** A share of one window: percent used, its state, and when it starts over. */
|
|
7
|
+
export interface LimitWindow {
|
|
8
|
+
percent: number;
|
|
9
|
+
state: LimitState;
|
|
10
|
+
resets_at: string | null;
|
|
11
|
+
}
|
|
12
|
+
/** One class over the billing period, who pays for it now, and its short window if any. */
|
|
13
|
+
export interface ClassLimit extends LimitWindow {
|
|
14
|
+
paying: LimitPayer;
|
|
15
|
+
window?: LimitWindow;
|
|
16
|
+
}
|
|
17
|
+
export interface LimitAction {
|
|
18
|
+
kind: 'upgrade' | 'topup';
|
|
19
|
+
label: string;
|
|
20
|
+
plan?: string;
|
|
21
|
+
url: string;
|
|
22
|
+
}
|
|
23
|
+
export interface Limited {
|
|
24
|
+
reason: string;
|
|
25
|
+
classes: LimitClass[];
|
|
26
|
+
message: string;
|
|
27
|
+
}
|
|
28
|
+
export interface Limits {
|
|
29
|
+
/** The plan slug, or "" for a caller with no plan. */
|
|
30
|
+
plan: string;
|
|
31
|
+
period_start?: string;
|
|
32
|
+
period_end?: string;
|
|
33
|
+
state: LimitState;
|
|
34
|
+
classes: Partial<Record<LimitClass, ClassLimit>>;
|
|
35
|
+
limited?: Limited;
|
|
36
|
+
actions: LimitAction[];
|
|
37
|
+
upgrade?: string;
|
|
38
|
+
}
|
|
39
|
+
/** What a served call's headers say. */
|
|
40
|
+
export interface Served {
|
|
41
|
+
state: LimitState;
|
|
42
|
+
class: LimitClass | null;
|
|
43
|
+
paidBy: PaidBy | null;
|
|
44
|
+
/** The free model that answered in place of the one asked for. */
|
|
45
|
+
fallback: string | null;
|
|
46
|
+
reason: string | null;
|
|
47
|
+
}
|
|
48
|
+
/** A billing refusal: `{"error":{"type":"billing_error",…}}` on a 402 or 429. */
|
|
49
|
+
export interface Refusal {
|
|
50
|
+
status: number;
|
|
51
|
+
code: string;
|
|
52
|
+
message: string;
|
|
53
|
+
class: LimitClass | null;
|
|
54
|
+
resets_at: string | null;
|
|
55
|
+
actions: LimitAction[];
|
|
56
|
+
/** Seconds, from Retry-After on a 429. */
|
|
57
|
+
retry: number | null;
|
|
58
|
+
}
|
|
59
|
+
/** What the reader is told when a class is paused or refused. */
|
|
60
|
+
export interface LimitNotice {
|
|
61
|
+
reason: string;
|
|
62
|
+
classes: LimitClass[];
|
|
63
|
+
message: string;
|
|
64
|
+
actions: LimitAction[];
|
|
65
|
+
resets_at: string | null;
|
|
66
|
+
fallback: string | null;
|
|
67
|
+
}
|
|
68
|
+
export declare const CLASSES: readonly LimitClass[];
|
|
69
|
+
export declare const CLASS_LABEL: Record<LimitClass, string>;
|
|
70
|
+
/** The worse of two states. */
|
|
71
|
+
export declare const worst: (a: LimitState, b: LimitState) => LimitState;
|
|
72
|
+
export declare function actionsOf(v: unknown): LimitAction[];
|
|
73
|
+
/**
|
|
74
|
+
* `GET /v1/ai/limits`, checked field by field. A body without a string `plan`
|
|
75
|
+
* is not an answer; a class without a numeric percent is left out rather than
|
|
76
|
+
* drawn full or empty.
|
|
77
|
+
*/
|
|
78
|
+
export declare function limitsOf(body: unknown): Limits | null;
|
|
79
|
+
/** The usage headers on a served call, or null when it carries none. */
|
|
80
|
+
export declare function servedOf(headers: {
|
|
81
|
+
get(name: string): string | null;
|
|
82
|
+
}): Served | null;
|
|
83
|
+
/** A billing refusal's envelope, or null for any other error. */
|
|
84
|
+
export declare function refusalOf(body: unknown, status: number, retryAfter?: string | null): Refusal | null;
|
|
85
|
+
/**
|
|
86
|
+
* Which class a model id bills to. Hanzo's own families are `ours`, anything
|
|
87
|
+
* naming the free lane is `free`, and every other model is `premium`.
|
|
88
|
+
*/
|
|
89
|
+
export declare function classOf(id: string): LimitClass;
|
|
90
|
+
/** The headers and refusal heard since the limits were last read. */
|
|
91
|
+
export interface Heard {
|
|
92
|
+
served: Served | null;
|
|
93
|
+
refusal: Refusal | null;
|
|
94
|
+
}
|
|
95
|
+
/** The limits with what served calls said since they were read laid over them. */
|
|
96
|
+
export declare function overlay(limits: Limits | null, heard: Heard): Limits | null;
|
|
97
|
+
/** "Premium models", "Premium and Hanzo models". */
|
|
98
|
+
export declare function classesLabel(classes: LimitClass[]): string;
|
|
99
|
+
/**
|
|
100
|
+
* When a reset lands, as a sentence says it: a time for one within a day
|
|
101
|
+
* ("5:00 PM"), else a date ("Oct 30"), periods being UTC days. "" for none.
|
|
102
|
+
*/
|
|
103
|
+
export declare function when(iso: string | null | undefined, now?: number): string;
|
|
104
|
+
/**
|
|
105
|
+
* What to tell a reader whose usage is paused or refused, or null when nothing
|
|
106
|
+
* is. A plan's included usage being used up reads as a pause until the reset;
|
|
107
|
+
* any other reason is the server's own message. A fallback reply adds the free
|
|
108
|
+
* model it was answered on, named by `name`.
|
|
109
|
+
*/
|
|
110
|
+
export declare function noticeOf(limits: Limits | null, heard: Heard, name?: (id: string) => string, now?: number): LimitNotice | null;
|
|
111
|
+
/** The one-line note for a class close to its included usage, or null. */
|
|
112
|
+
export declare function nearOf(limits: Limits | null, now?: number): string | null;
|
|
113
|
+
//# sourceMappingURL=limits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../src/product/limits.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAAA;AAClD,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAA;AACpD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAA;AAChE,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAA;AAC5D,MAAM,MAAM,WAAW,GAAG,qBAAqB,GAAG,oBAAoB,GAAG,eAAe,GAAG,sBAAsB,CAAA;AAEjH,+EAA+E;AAC/E,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,UAAU,CAAA;IACjB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,2FAA2F;AAC3F,MAAM,WAAW,UAAW,SAAQ,WAAW;IAC7C,MAAM,EAAE,UAAU,CAAA;IAClB,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,GAAG,OAAO,CAAA;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAA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