@yaks/spend 0.0.0-stage → 0.2.36
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/LICENSE +202 -0
- package/README.md +159 -2
- package/_dist/graph.d.ts +26 -0
- package/_dist/graph.d.ts.map +1 -0
- package/_dist/mod.d.ts +11 -0
- package/_dist/mod.d.ts.map +1 -0
- package/_dist/routes.d.ts +10 -0
- package/_dist/routes.d.ts.map +1 -0
- package/_dist/service.d.ts +41 -0
- package/_dist/service.d.ts.map +1 -0
- package/_dist/tally.d.ts +111 -0
- package/_dist/tally.d.ts.map +1 -0
- package/_dist/tools.d.ts +52 -0
- package/_dist/tools.d.ts.map +1 -0
- package/_dist/use.d.ts +31 -0
- package/_dist/use.d.ts.map +1 -0
- package/_dist/views.d.ts +27 -0
- package/_dist/views.d.ts.map +1 -0
- package/_dist/vocab.d.ts +7 -0
- package/_dist/vocab.d.ts.map +1 -0
- package/_dist/window.d.ts +132 -0
- package/_dist/window.d.ts.map +1 -0
- package/_dist/words.d.ts +40 -0
- package/_dist/words.d.ts.map +1 -0
- package/budget.js +131 -0
- package/budget.js.map +1 -0
- package/budget.ts +128 -0
- package/day.js +336 -0
- package/day.js.map +1 -0
- package/day.ts +364 -0
- package/deno.json +1 -0
- package/graph.js +59 -0
- package/graph.js.map +1 -0
- package/graph.ts +61 -0
- package/mod.js +11 -0
- package/mod.js.map +1 -0
- package/mod.ts +34 -0
- package/package.json +57 -4
- package/page.js +352 -0
- package/page.js.map +1 -0
- package/page.ts +491 -0
- package/routes.js +22 -0
- package/routes.js.map +1 -0
- package/routes.ts +19 -0
- package/service.js +124 -0
- package/service.js.map +1 -0
- package/service.ts +149 -0
- package/tally.js +385 -0
- package/tally.js.map +1 -0
- package/tally.ts +424 -0
- package/tools.js +243 -0
- package/tools.js.map +1 -0
- package/tools.ts +357 -0
- package/use.js +172 -0
- package/use.js.map +1 -0
- package/use.ts +226 -0
- package/views.js +79 -0
- package/views.js.map +1 -0
- package/views.ts +96 -0
- package/vocab.js +17 -0
- package/vocab.js.map +1 -0
- package/vocab.json +237 -0
- package/vocab.ts +18 -0
- package/window.js +259 -0
- package/window.js.map +1 -0
- package/window.ts +336 -0
- package/words.js +47 -0
- package/words.js.map +1 -0
- package/words.ts +77 -0
package/page.js
ADDED
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the tokens went, as the browsing app draws it: the plan limits
|
|
3
|
+
* against their pace, then a span's tally (the Claude plan's week by
|
|
4
|
+
* default, beside the week before it) by part of the context, session, task,
|
|
5
|
+
* large entry and model. A day's row is the same tally for its day. Every
|
|
6
|
+
* number comes from the `spend` rows the duty keeps (./service.ts); nothing
|
|
7
|
+
* here reads a request. Rows a tally names are drawn by name through the
|
|
8
|
+
* shared renderers.
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/ /* @ts-types="npm:@types/react@19.3.0" */ import { createElement as h, Fragment } from "react";
|
|
12
|
+
import { and, eq, ge, lt, parse, stringify } from "@yaks/query";
|
|
13
|
+
import { labelOf } from "@yaks/model";
|
|
14
|
+
import { partQuery } from "@yaks/session/parts";
|
|
15
|
+
import { mention, useNamed } from "@yaks/inspect";
|
|
16
|
+
import { Head, Loading, Meter, Section, Table } from "@yaks/ui";
|
|
17
|
+
import { merged, ranked, spendOf } from "./tally.js";
|
|
18
|
+
import { accountNames, after, current, limitRates, limitsOf, paceOf, rates, span, unpricedRates } from "./window.js";
|
|
19
|
+
import { dollars, percent, tokens } from "./words.js";
|
|
20
|
+
let { Body, Cell, Heading, Row } = Table;
|
|
21
|
+
let TOP = 15;
|
|
22
|
+
let sum = (ns)=>ns.slice(0, 4).reduce((a, b)=>a + b, 0);
|
|
23
|
+
let waiting = (got, what)=>got?.error ? /*#__PURE__*/ h(Section.Sub, {
|
|
24
|
+
role: 'alert'
|
|
25
|
+
}, got.error) : !got?.ready ? /*#__PURE__*/ h(Loading, {}, `Loading ${what}…`) : null;
|
|
26
|
+
// The models a figure was built without a price for: it is missing them, not
|
|
27
|
+
// zero, so it says so in place of a number.
|
|
28
|
+
let Unpriced = ({ io, models })=>{
|
|
29
|
+
useNamed(io, models);
|
|
30
|
+
return /*#__PURE__*/ h(Fragment, {}, 'unpriced: ', ...models.flatMap((m, i)=>[
|
|
31
|
+
i ? ', ' : '',
|
|
32
|
+
mention(io, m)
|
|
33
|
+
]));
|
|
34
|
+
};
|
|
35
|
+
// A plan limit and its pace, on one line.
|
|
36
|
+
let Limits = ({ io, limits, now, worth, unpriced })=>/*#__PURE__*/ h(Section, {}, /*#__PURE__*/ h(Section.Title, {}, 'Plan limits'), /*#__PURE__*/ h(Section.Sub, {}, 'Each bar is what is used; the mark is how much of its window is gone, which is what an even spend would have used by now. The week % beside each row below is an estimate of its share of its plan’s weekly limit: the week’s used % over the dollars, at list price, its requests ran up since the week began. A request paid per token uses no plan.'), /*#__PURE__*/ h(Table, {
|
|
37
|
+
cols: [
|
|
38
|
+
'key',
|
|
39
|
+
null,
|
|
40
|
+
'prose'
|
|
41
|
+
]
|
|
42
|
+
}, /*#__PURE__*/ h(Body, {}, limits.filter((l)=>current(l, now)).map((l)=>{
|
|
43
|
+
let pace = paceOf(l, now);
|
|
44
|
+
return /*#__PURE__*/ h(Row, {
|
|
45
|
+
key: `${l.of} ${l.model ?? ''} ${l.window}`
|
|
46
|
+
}, /*#__PURE__*/ h(Cell, {
|
|
47
|
+
mod: 'key'
|
|
48
|
+
}, `${l.name} ${l.window == 10080 ? 'week' : 'five hours'}`), /*#__PURE__*/ h(Cell, {}, /*#__PURE__*/ h(Meter, {
|
|
49
|
+
value: l.used / 100,
|
|
50
|
+
mark: pace
|
|
51
|
+
})), /*#__PURE__*/ h(Cell, {
|
|
52
|
+
mod: 'prose'
|
|
53
|
+
}, `${Math.round(l.used)}% used, ${Math.round(pace * 100)}% of it gone${l.resets ? `, resets ${l.resets.slice(0, 16).replace('T', ' ')} UTC` : ''}`, l.window == 10080 && !l.model && unpriced.has(l.of) ? /*#__PURE__*/ h(Fragment, {}, '; 1% of it is ', /*#__PURE__*/ h(Unpriced, {
|
|
54
|
+
io,
|
|
55
|
+
models: unpriced.get(l.of)
|
|
56
|
+
})) : l.window == 10080 && worth.get(l) ? `; 1% of it is about ${dollars(1 / worth.get(l))} at list price` : ''));
|
|
57
|
+
}))));
|
|
58
|
+
let shareOf = (io, s, rate, unpriced, names)=>(row, key, spent)=>{
|
|
59
|
+
let billed = Object.entries(s.plans).map(([p, plan])=>[
|
|
60
|
+
p,
|
|
61
|
+
plan[row]?.[key] ?? 0
|
|
62
|
+
]);
|
|
63
|
+
let rated = billed.filter(([p, n])=>n && rate.has(p));
|
|
64
|
+
let named = (p)=>rate.size > 1 ? ` ${names.get(p) ?? p}` : '';
|
|
65
|
+
return rated.length ? rated.flatMap(([p, d], i)=>[
|
|
66
|
+
i ? ' · ' : '',
|
|
67
|
+
unpriced.has(p) ? /*#__PURE__*/ h(Unpriced, {
|
|
68
|
+
io,
|
|
69
|
+
models: unpriced.get(p)
|
|
70
|
+
}) : percent(d * rate.get(p)),
|
|
71
|
+
named(p)
|
|
72
|
+
]) : billed.some(([, n])=>n) ? 'no reading' : spent ? 'per token' : '';
|
|
73
|
+
};
|
|
74
|
+
// A ranking: each row's name, a bar of its share of the costliest, its
|
|
75
|
+
// dollars and what else the caller says about it.
|
|
76
|
+
let Ranking = ({ title, sub, row, rows, at, name, more, heads, share, paid = (_, n)=>dollars(n) })=>{
|
|
77
|
+
let most = rows[0]?.[1][at] || 1;
|
|
78
|
+
let shared = share ? [
|
|
79
|
+
'num'
|
|
80
|
+
] : [];
|
|
81
|
+
return /*#__PURE__*/ h(Section, {}, /*#__PURE__*/ h(Section.Title, {}, title, ' ', /*#__PURE__*/ h(Section.Count, {}, String(rows.length))), /*#__PURE__*/ h(Section.Sub, {}, sub), /*#__PURE__*/ h(Table, {
|
|
82
|
+
cols: [
|
|
83
|
+
null,
|
|
84
|
+
null,
|
|
85
|
+
'num',
|
|
86
|
+
...shared,
|
|
87
|
+
...heads.map(()=>'num')
|
|
88
|
+
]
|
|
89
|
+
}, /*#__PURE__*/ h(Table.Head, {}, /*#__PURE__*/ h(Row, {}, /*#__PURE__*/ h(Heading, {}, ''), /*#__PURE__*/ h(Heading, {}, ''), /*#__PURE__*/ h(Heading, {
|
|
90
|
+
mod: [
|
|
91
|
+
'num',
|
|
92
|
+
'desc'
|
|
93
|
+
]
|
|
94
|
+
}, 'dollars'), share ? /*#__PURE__*/ h(Heading, {
|
|
95
|
+
mod: 'num'
|
|
96
|
+
}, 'week %') : null, ...heads.map((k)=>/*#__PURE__*/ h(Heading, {
|
|
97
|
+
key: k,
|
|
98
|
+
mod: 'num'
|
|
99
|
+
}, k)))), /*#__PURE__*/ h(Body, {}, rows.map(([k, ns])=>/*#__PURE__*/ h(Row, {
|
|
100
|
+
key: k
|
|
101
|
+
}, /*#__PURE__*/ h(Cell, {}, name(k)), /*#__PURE__*/ h(Cell, {}, /*#__PURE__*/ h(Meter, {
|
|
102
|
+
value: ns[at] / most,
|
|
103
|
+
width: 10
|
|
104
|
+
})), /*#__PURE__*/ h(Cell, {
|
|
105
|
+
mod: 'num'
|
|
106
|
+
}, paid(k, ns[at])), share && row ? /*#__PURE__*/ h(Cell, {
|
|
107
|
+
mod: 'num'
|
|
108
|
+
}, share(row, k, ns[at])) : null, ...more(ns, k).map((s, i)=>/*#__PURE__*/ h(Cell, {
|
|
109
|
+
key: i,
|
|
110
|
+
mod: 'num'
|
|
111
|
+
}, s)))))));
|
|
112
|
+
};
|
|
113
|
+
// What each account ran up, beside its share of its own plan's week and the
|
|
114
|
+
// week before; what billed no plan is the last row, paid by the token.
|
|
115
|
+
let Accounts = ({ io, s, before, rate, unpriced, names })=>{
|
|
116
|
+
let rows = {};
|
|
117
|
+
for (let [k, p] of Object.entries(s.plans))rows[k] = [
|
|
118
|
+
p.dollars
|
|
119
|
+
];
|
|
120
|
+
for (let k of Object.keys(before.plans))rows[k] ??= [
|
|
121
|
+
0
|
|
122
|
+
];
|
|
123
|
+
let billed = Object.values(rows).reduce((n, [d])=>n + d, 0);
|
|
124
|
+
if (s.dollars - billed > 0.005) rows[''] = [
|
|
125
|
+
s.dollars - billed
|
|
126
|
+
];
|
|
127
|
+
let was = (k)=>k ? before.plans[k]?.dollars ?? 0 : before.dollars - Object.values(before.plans).reduce((n, p)=>n + p.dollars, 0);
|
|
128
|
+
return /*#__PURE__*/ h(Ranking, {
|
|
129
|
+
title: 'Accounts',
|
|
130
|
+
sub: 'What each account’s requests ran up at list price, and their share of that account’s own weekly limit. A request paid by the token bills no account.',
|
|
131
|
+
rows: ranked(rows, 0),
|
|
132
|
+
at: 0,
|
|
133
|
+
name: (k)=>/*#__PURE__*/ h('span', {}, k ? names.get(k) ?? k : 'paid by the token'),
|
|
134
|
+
more: (ns, k)=>[
|
|
135
|
+
!k ? '' : unpriced.has(k) ? /*#__PURE__*/ h(Unpriced, {
|
|
136
|
+
io,
|
|
137
|
+
models: unpriced.get(k)
|
|
138
|
+
}) : rate.has(k) ? percent(ns[0] * rate.get(k)) : 'no reading',
|
|
139
|
+
dollars(was(k))
|
|
140
|
+
],
|
|
141
|
+
heads: [
|
|
142
|
+
'week %',
|
|
143
|
+
'week before'
|
|
144
|
+
]
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
// A part's name, linked to the entries it is made of that were written in
|
|
148
|
+
// the span the tally covers, where a query names them.
|
|
149
|
+
let part = (io, [from, to])=>(k)=>{
|
|
150
|
+
let q = partQuery(k);
|
|
151
|
+
return q ? /*#__PURE__*/ h('a', {
|
|
152
|
+
href: io.find(stringify(and(q, ...from == to ? [
|
|
153
|
+
eq('created.at', from)
|
|
154
|
+
] : [
|
|
155
|
+
ge('created.at', from),
|
|
156
|
+
lt('created.at', after(to))
|
|
157
|
+
])))
|
|
158
|
+
}, k) : /*#__PURE__*/ h('span', {}, k);
|
|
159
|
+
};
|
|
160
|
+
/** A tally of the days from one to another, ranked, beside an earlier one to
|
|
161
|
+
* read it against. */ let Breakdown = ({ io, s, span, before, share })=>{
|
|
162
|
+
let top = (rows)=>rows.slice(0, TOP);
|
|
163
|
+
let sessions = top(ranked(s.sessions, 1));
|
|
164
|
+
let tasks = top(ranked(s.tasks, 1));
|
|
165
|
+
let entries = top(ranked(s.entries, 1)).slice(0, 10);
|
|
166
|
+
let models = ranked(s.models, 4);
|
|
167
|
+
useNamed(io, [
|
|
168
|
+
...sessions,
|
|
169
|
+
...tasks,
|
|
170
|
+
...entries,
|
|
171
|
+
...models
|
|
172
|
+
].map(([k])=>k));
|
|
173
|
+
let named = (k)=>k ? mention(io, k) : /*#__PURE__*/ h('span', {}, 'none');
|
|
174
|
+
let was = (k)=>before ? [
|
|
175
|
+
dollars(before.parts[k]?.[4] ?? 0)
|
|
176
|
+
] : [];
|
|
177
|
+
return /*#__PURE__*/ h(Fragment, {}, /*#__PURE__*/ h(Ranking, {
|
|
178
|
+
title: 'What the context was made of',
|
|
179
|
+
row: 'parts',
|
|
180
|
+
share,
|
|
181
|
+
sub: 'Each part of what the requests carried, at what it cost as it was paid: read from the cache, written to it, sent fresh, or generated. A part is paid for on every request it rides in. The totals are measured; the split across parts is estimated from their sizes.',
|
|
182
|
+
rows: ranked(s.parts, 4).slice(0, 30),
|
|
183
|
+
at: 4,
|
|
184
|
+
name: part(io, span),
|
|
185
|
+
more: (ns, k)=>[
|
|
186
|
+
tokens(ns[0]),
|
|
187
|
+
tokens(ns[1]),
|
|
188
|
+
tokens(ns[2]),
|
|
189
|
+
tokens(ns[3]),
|
|
190
|
+
...was(k)
|
|
191
|
+
],
|
|
192
|
+
heads: [
|
|
193
|
+
'read',
|
|
194
|
+
'written',
|
|
195
|
+
'fresh',
|
|
196
|
+
'generated',
|
|
197
|
+
...before ? [
|
|
198
|
+
'week before'
|
|
199
|
+
] : []
|
|
200
|
+
]
|
|
201
|
+
}), /*#__PURE__*/ h(Ranking, {
|
|
202
|
+
title: 'Sessions',
|
|
203
|
+
row: 'sessions',
|
|
204
|
+
share,
|
|
205
|
+
sub: 'Each session by what its requests cost; a subagent is a session of its own.',
|
|
206
|
+
rows: sessions,
|
|
207
|
+
at: 1,
|
|
208
|
+
name: named,
|
|
209
|
+
more: (ns)=>[
|
|
210
|
+
String(ns[2]),
|
|
211
|
+
tokens(ns[0])
|
|
212
|
+
],
|
|
213
|
+
heads: [
|
|
214
|
+
'requests',
|
|
215
|
+
'tokens'
|
|
216
|
+
]
|
|
217
|
+
}), /*#__PURE__*/ h(Ranking, {
|
|
218
|
+
title: 'Tasks',
|
|
219
|
+
row: 'tasks',
|
|
220
|
+
share,
|
|
221
|
+
sub: 'Each session split evenly across the tasks it claimed, commented on, filed or finished, and a subagent across the tasks its brief names, else as the session that started it.',
|
|
222
|
+
rows: tasks,
|
|
223
|
+
at: 1,
|
|
224
|
+
name: named,
|
|
225
|
+
more: (ns)=>[
|
|
226
|
+
tokens(ns[0])
|
|
227
|
+
],
|
|
228
|
+
heads: [
|
|
229
|
+
'tokens'
|
|
230
|
+
]
|
|
231
|
+
}), /*#__PURE__*/ h(Ranking, {
|
|
232
|
+
title: 'Entries carried most',
|
|
233
|
+
row: 'entries',
|
|
234
|
+
share,
|
|
235
|
+
sub: 'What one entry of a transcript cost as it was carried, request after request.',
|
|
236
|
+
rows: entries,
|
|
237
|
+
at: 1,
|
|
238
|
+
name: named,
|
|
239
|
+
more: (ns)=>[
|
|
240
|
+
tokens(ns[0])
|
|
241
|
+
],
|
|
242
|
+
heads: [
|
|
243
|
+
'tokens'
|
|
244
|
+
]
|
|
245
|
+
}), /*#__PURE__*/ h(Ranking, {
|
|
246
|
+
title: 'Models',
|
|
247
|
+
row: 'models',
|
|
248
|
+
share,
|
|
249
|
+
sub: 'At the price the provider reported, else at the model’s list price.',
|
|
250
|
+
rows: models,
|
|
251
|
+
at: 4,
|
|
252
|
+
paid: (k, n)=>s.unpriced.includes(k) ? /*#__PURE__*/ h(Unpriced, {
|
|
253
|
+
io,
|
|
254
|
+
models: [
|
|
255
|
+
k
|
|
256
|
+
]
|
|
257
|
+
}) : dollars(n),
|
|
258
|
+
name: named,
|
|
259
|
+
more: (ns)=>[
|
|
260
|
+
String(ns[5]),
|
|
261
|
+
tokens(sum(ns))
|
|
262
|
+
],
|
|
263
|
+
heads: [
|
|
264
|
+
'requests',
|
|
265
|
+
'tokens'
|
|
266
|
+
]
|
|
267
|
+
}));
|
|
268
|
+
};
|
|
269
|
+
let facts = (s)=>[
|
|
270
|
+
dollars(s.dollars),
|
|
271
|
+
`${s.requests.toLocaleString('en-US')} requests`,
|
|
272
|
+
`${tokens(sum(s.tokens))} tokens`
|
|
273
|
+
];
|
|
274
|
+
/** The page: the limits, then the span the Claude week covers, beside the
|
|
275
|
+
* week before. */ export let Page = ({ io, got })=>{
|
|
276
|
+
let now = Date.now();
|
|
277
|
+
let providers = new Map((got.providers?.rows ?? []).map((b)=>[
|
|
278
|
+
b.entity.eid,
|
|
279
|
+
String(b.provider.name ?? '')
|
|
280
|
+
]));
|
|
281
|
+
let names = new Map([
|
|
282
|
+
...(got.models?.rows ?? []).map((b)=>[
|
|
283
|
+
b.entity.eid,
|
|
284
|
+
labelOf(b.model)
|
|
285
|
+
]),
|
|
286
|
+
...providers,
|
|
287
|
+
...accountNames(got.accounts?.rows ?? [], providers)
|
|
288
|
+
]);
|
|
289
|
+
let limits = limitsOf(got.limits?.rows ?? [], names);
|
|
290
|
+
let days = (got.days?.rows ?? []).map(spendOf).filter((s)=>!!s);
|
|
291
|
+
let [from, to] = span(limits, now);
|
|
292
|
+
let within = (a, b)=>days.filter((d)=>d.day >= a && d.day <= b);
|
|
293
|
+
let week = merged(within(from, to));
|
|
294
|
+
let before = merged(within(after(from, -7), after(from, -1)));
|
|
295
|
+
let rate = rates(limits, days, now);
|
|
296
|
+
let worth = limitRates(limits, days, now);
|
|
297
|
+
let unpriced = unpricedRates(limits, days, now);
|
|
298
|
+
return /*#__PURE__*/ h('article', {}, /*#__PURE__*/ h(Head, {}, /*#__PURE__*/ h(Head.Title, {}, 'Where the tokens went'), /*#__PURE__*/ h(Head.Sub, {}, `${from} to ${to} (UTC): this Claude plan week so far, beside the week before. Tallied from every model request every ten minutes.`), /*#__PURE__*/ h(Head.Facts, {}, ...facts(week), `the week before ${dollars(before.dollars)}`)), waiting(got.limits, 'the plan limits') ?? /*#__PURE__*/ h(Limits, {
|
|
299
|
+
io,
|
|
300
|
+
limits,
|
|
301
|
+
now,
|
|
302
|
+
worth,
|
|
303
|
+
unpriced
|
|
304
|
+
}), waiting(got.days, 'the tallies') ?? (Object.keys(week.plans).length ? /*#__PURE__*/ h(Accounts, {
|
|
305
|
+
io,
|
|
306
|
+
s: week,
|
|
307
|
+
before,
|
|
308
|
+
rate,
|
|
309
|
+
unpriced,
|
|
310
|
+
names
|
|
311
|
+
}) : null), waiting(got.days, 'the tallies') ?? /*#__PURE__*/ h(Breakdown, {
|
|
312
|
+
io,
|
|
313
|
+
s: week,
|
|
314
|
+
span: [
|
|
315
|
+
from,
|
|
316
|
+
to
|
|
317
|
+
],
|
|
318
|
+
before,
|
|
319
|
+
share: rate.size ? shareOf(io, week, rate, unpriced, names) : undefined
|
|
320
|
+
}));
|
|
321
|
+
};
|
|
322
|
+
/** A day's page: its tally. */ export let DayPage = ({ e, io })=>{
|
|
323
|
+
let s = spendOf(e);
|
|
324
|
+
return /*#__PURE__*/ h('article', {}, /*#__PURE__*/ h(Head, {}, /*#__PURE__*/ h(Head.Title, {}, `Where the tokens went on ${s?.day ?? ''}`), /*#__PURE__*/ h(Head.Sub, {}, 'One UTC day, tallied from its model requests.'), s ? /*#__PURE__*/ h(Head.Facts, {}, ...facts(s)) : null), s ? /*#__PURE__*/ h(Breakdown, {
|
|
325
|
+
io,
|
|
326
|
+
s,
|
|
327
|
+
span: [
|
|
328
|
+
s.day,
|
|
329
|
+
s.day
|
|
330
|
+
]
|
|
331
|
+
}) : null);
|
|
332
|
+
};
|
|
333
|
+
/** The views this package draws in the browsing app. */ export let inspectViews = [
|
|
334
|
+
{
|
|
335
|
+
view: 'Spend.Page',
|
|
336
|
+
match: true,
|
|
337
|
+
asks: ()=>({
|
|
338
|
+
days: '.spend * .order=-spend.day .limit=21',
|
|
339
|
+
limits: '.rate_limit *',
|
|
340
|
+
providers: '.provider *',
|
|
341
|
+
accounts: '.account *',
|
|
342
|
+
models: '.model *'
|
|
343
|
+
}),
|
|
344
|
+
Render: Page
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
view: 'Full',
|
|
348
|
+
match: parse('.spend'),
|
|
349
|
+
Render: DayPage
|
|
350
|
+
}
|
|
351
|
+
];
|
|
352
|
+
//# sourceMappingURL=page.js.map
|
package/page.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.js","sources":["./page.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;CAUC,GACD,uCAAuC,GAAG,SAAS,iBAAiB,CAAC,EAAE,QAAQ,gBAAoD;AACnI,SAAS,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,2BAAgC;AAC1E,SAAS,OAAO,2BAAgC;AAChD,SAAS,SAAS,mCAAwC;AAC1D,SAAS,OAAO,EAAc,QAAQ,6BAA6C;AACnF,SAAS,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,wBAA6B;AAC1E,SAAS,MAAM,EAAE,MAAM,EAAyB,OAAO,qBAAoB;AAC3E,SACE,YAAY,EACZ,KAAK,EACL,OAAO,EAEP,UAAU,EACV,QAAQ,EACR,MAAM,EACN,KAAK,EACL,IAAI,EACJ,aAAa,sBACK;AACpB,SAAS,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAoB;AAErD,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG;AACnC,IAAI,MAAM;AAEV,IAAI,MAAM,CAAC,KAAiB,GAAG,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC,GAAG,IAAM,I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