@subvalue/cli 0.1.2 → 0.1.4

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 (40) hide show
  1. package/PRE_RELEASE.md +6 -6
  2. package/README.md +7 -5
  3. package/dist/PRICING.md +15 -16
  4. package/dist/packages/cli/src/index.js +109 -20
  5. package/dist/packages/cli/src/protocol.js +13 -0
  6. package/dist/packages/cli/src/runtime.js +44 -14
  7. package/dist/packages/cli/src/server.js +306 -62
  8. package/dist/packages/core/src/calendar.js +47 -0
  9. package/dist/packages/core/src/coverage.js +12 -0
  10. package/dist/packages/core/src/demo.js +61 -9
  11. package/dist/packages/core/src/metadata.js +52 -9
  12. package/dist/packages/core/src/pricing/current.js +346 -297
  13. package/dist/packages/core/src/pricing/index.js +373 -73
  14. package/dist/packages/core/src/providers/claude/index.js +93 -21
  15. package/dist/packages/core/src/providers/codex/index.js +213 -46
  16. package/dist/packages/core/src/scanner.js +226 -46
  17. package/dist/packages/core/src/security.js +127 -34
  18. package/dist/packages/core/src/storage.js +215 -47
  19. package/dist/packages/core/src/subscriptions.js +146 -21
  20. package/dist/packages/core/src/summary.js +409 -51
  21. package/dist/packages/core/src/types.js +71 -17
  22. package/dist/packages/core/src/usage-json.js +166 -47
  23. package/dist/packages/receipt/src/index.js +387 -80
  24. package/dist/packages/ui/src/brand.js +48 -3
  25. package/dist/public/app.css +2280 -56
  26. package/dist/public/apps/web/src/landing.js +200 -8
  27. package/dist/public/apps/web/src/main.js +1143 -63
  28. package/dist/public/index.html +24 -1
  29. package/dist/public/landing.css +3235 -70
  30. package/dist/public/landing.html +21 -1
  31. package/dist/public/logo/wordmark-monochrome.svg +1 -0
  32. package/dist/public/logo/wordmark.svg +1 -0
  33. package/dist/public/packages/core/src/calendar.js +47 -0
  34. package/dist/public/packages/core/src/coverage.js +12 -0
  35. package/dist/public/packages/core/src/subscriptions.js +146 -21
  36. package/dist/public/packages/receipt/src/index.js +387 -80
  37. package/dist/public/packages/ui/src/brand.js +48 -3
  38. package/dist/public/privacy.css +197 -6
  39. package/dist/public/privacy.html +1 -1
  40. package/package.json +1 -1
@@ -1,326 +1,375 @@
1
-
1
+
2
2
  // Official standard text/code tariff snapshot, checked 2026-10-05.
3
3
  // These prices are deliberately not backdated to unverified history.
4
- const rows =[
5
- {
6
- "model": "gpt-5.5",
7
- "input": 5,
8
- "cached": 0.5,
9
- "write": null,
10
- "output": 30,
11
- "long": true
12
- },
13
- {
14
- "model": "gpt-5.5-pro",
15
- "input": 30,
16
- "cached": null,
17
- "write": null,
18
- "output": 180,
19
- "long": true
20
- },
21
- {
22
- "model": "gpt-5.4",
23
- "input": 2.5,
24
- "cached": 0.25,
25
- "write": null,
26
- "output": 15,
27
- "long": true
28
- },
29
- {
30
- "model": "gpt-5.4-mini",
31
- "input": 0.75,
32
- "cached": 0.075,
33
- "write": null,
34
- "output": 4.5,
35
- "long": false
36
- },
37
- {
38
- "model": "gpt-5.4-nano",
39
- "input": 0.2,
40
- "cached": 0.02,
41
- "write": null,
42
- "output": 1.25,
43
- "long": false
44
- },
45
- {
46
- "model": "gpt-5.4-pro",
47
- "input": 30,
48
- "cached": null,
49
- "write": null,
50
- "output": 180,
51
- "long": true
52
- },
53
- {
54
- "model": "gpt-5.2",
55
- "input": 1.75,
56
- "cached": 0.175,
57
- "write": null,
58
- "output": 14,
59
- "long": false
60
- },
61
- {
62
- "model": "gpt-5.2-pro",
63
- "input": 21,
64
- "cached": null,
65
- "write": null,
66
- "output": 168,
67
- "long": false
68
- },
69
- {
70
- "model": "gpt-5.1",
71
- "input": 1.25,
72
- "cached": 0.125,
73
- "write": null,
74
- "output": 10,
75
- "long": false
76
- },
77
- {
78
- "model": "gpt-5",
79
- "input": 1.25,
80
- "cached": 0.125,
81
- "write": null,
82
- "output": 10,
83
- "long": false
84
- },
85
- {
86
- "model": "gpt-5-mini",
87
- "input": 0.25,
88
- "cached": 0.025,
89
- "write": null,
90
- "output": 2,
91
- "long": false
4
+ const rows
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+ = [
13
+ {
14
+ model: 'gpt-5.5',
15
+ input: 5,
16
+ cached: 0.5,
17
+ write: null,
18
+ output: 30,
19
+ long: true,
20
+ },
21
+ {
22
+ model: 'gpt-5.5-pro',
23
+ input: 30,
24
+ cached: null,
25
+ write: null,
26
+ output: 180,
27
+ long: true,
28
+ },
29
+ {
30
+ model: 'gpt-5.4',
31
+ input: 2.5,
32
+ cached: 0.25,
33
+ write: null,
34
+ output: 15,
35
+ long: true,
36
+ },
37
+ {
38
+ model: 'gpt-5.4-mini',
39
+ input: 0.75,
40
+ cached: 0.075,
41
+ write: null,
42
+ output: 4.5,
43
+ long: false,
44
+ },
45
+ {
46
+ model: 'gpt-5.4-nano',
47
+ input: 0.2,
48
+ cached: 0.02,
49
+ write: null,
50
+ output: 1.25,
51
+ long: false,
52
+ },
53
+ {
54
+ model: 'gpt-5.4-pro',
55
+ input: 30,
56
+ cached: null,
57
+ write: null,
58
+ output: 180,
59
+ long: true,
60
+ },
61
+ {
62
+ model: 'gpt-5.2',
63
+ input: 1.75,
64
+ cached: 0.175,
65
+ write: null,
66
+ output: 14,
67
+ long: false,
68
+ },
69
+ {
70
+ model: 'gpt-5.2-pro',
71
+ input: 21,
72
+ cached: null,
73
+ write: null,
74
+ output: 168,
75
+ long: false,
76
+ },
77
+ {
78
+ model: 'gpt-5.1',
79
+ input: 1.25,
80
+ cached: 0.125,
81
+ write: null,
82
+ output: 10,
83
+ long: false,
84
+ },
85
+ {
86
+ model: 'gpt-5',
87
+ input: 1.25,
88
+ cached: 0.125,
89
+ write: null,
90
+ output: 10,
91
+ long: false,
92
+ },
93
+ {
94
+ model: 'gpt-5-mini',
95
+ input: 0.25,
96
+ cached: 0.025,
97
+ write: null,
98
+ output: 2,
99
+ long: false,
100
+ },
101
+ {
102
+ model: 'gpt-5-nano',
103
+ input: 0.05,
104
+ cached: 0.005,
105
+ write: null,
106
+ output: 0.4,
107
+ long: false,
108
+ },
109
+ {
110
+ model: 'gpt-5-pro',
111
+ input: 15,
112
+ cached: null,
113
+ write: null,
114
+ output: 120,
115
+ long: false,
92
116
  },
93
117
  {
94
- "model": "gpt-5-nano",
95
- "input": 0.05,
96
- "cached": 0.005,
97
- "write": null,
98
- "output": 0.4,
99
- "long": false
118
+ model: 'gpt-4.1',
119
+ input: 2,
120
+ cached: 0.5,
121
+ write: null,
122
+ output: 8,
123
+ long: false,
100
124
  },
101
125
  {
102
- "model": "gpt-5-pro",
103
- "input": 15,
104
- "cached": null,
105
- "write": null,
106
- "output": 120,
107
- "long": false
126
+ model: 'gpt-4.1-mini',
127
+ input: 0.4,
128
+ cached: 0.1,
129
+ write: null,
130
+ output: 1.6,
131
+ long: false,
108
132
  },
109
133
  {
110
- "model": "gpt-4.1",
111
- "input": 2,
112
- "cached": 0.5,
113
- "write": null,
114
- "output": 8,
115
- "long": false
134
+ model: 'gpt-4.1-nano',
135
+ input: 0.1,
136
+ cached: 0.025,
137
+ write: null,
138
+ output: 0.4,
139
+ long: false,
116
140
  },
117
141
  {
118
- "model": "gpt-4.1-mini",
119
- "input": 0.4,
120
- "cached": 0.1,
121
- "write": null,
122
- "output": 1.6,
123
- "long": false
142
+ model: 'gpt-4o',
143
+ input: 2.5,
144
+ cached: 1.25,
145
+ write: null,
146
+ output: 10,
147
+ long: false,
124
148
  },
125
149
  {
126
- "model": "gpt-4.1-nano",
127
- "input": 0.1,
128
- "cached": 0.025,
129
- "write": null,
130
- "output": 0.4,
131
- "long": false
150
+ model: 'gpt-4o-2024-05-13',
151
+ input: 5,
152
+ cached: null,
153
+ write: null,
154
+ output: 15,
155
+ long: false,
132
156
  },
133
157
  {
134
- "model": "gpt-4o",
135
- "input": 2.5,
136
- "cached": 1.25,
137
- "write": null,
138
- "output": 10,
139
- "long": false
158
+ model: 'gpt-4o-mini',
159
+ input: 0.15,
160
+ cached: 0.075,
161
+ write: null,
162
+ output: 0.6,
163
+ long: false,
140
164
  },
141
165
  {
142
- "model": "gpt-4o-2024-05-13",
143
- "input": 5,
144
- "cached": null,
145
- "write": null,
146
- "output": 15,
147
- "long": false
166
+ model: 'o1',
167
+ input: 15,
168
+ cached: 7.5,
169
+ write: null,
170
+ output: 60,
171
+ long: false,
148
172
  },
149
173
  {
150
- "model": "gpt-4o-mini",
151
- "input": 0.15,
152
- "cached": 0.075,
153
- "write": null,
154
- "output": 0.6,
155
- "long": false
174
+ model: 'o1-pro',
175
+ input: 150,
176
+ cached: null,
177
+ write: null,
178
+ output: 600,
179
+ long: false,
156
180
  },
157
181
  {
158
- "model": "o1",
159
- "input": 15,
160
- "cached": 7.5,
161
- "write": null,
162
- "output": 60,
163
- "long": false
182
+ model: 'o3-pro',
183
+ input: 20,
184
+ cached: null,
185
+ write: null,
186
+ output: 80,
187
+ long: false,
164
188
  },
165
189
  {
166
- "model": "o1-pro",
167
- "input": 150,
168
- "cached": null,
169
- "write": null,
170
- "output": 600,
171
- "long": false
190
+ model: 'o3',
191
+ input: 2,
192
+ cached: 0.5,
193
+ write: null,
194
+ output: 8,
195
+ long: false,
172
196
  },
173
197
  {
174
- "model": "o3-pro",
175
- "input": 20,
176
- "cached": null,
177
- "write": null,
178
- "output": 80,
179
- "long": false
198
+ model: 'o4-mini',
199
+ input: 1.1,
200
+ cached: 0.275,
201
+ write: null,
202
+ output: 4.4,
203
+ long: false,
180
204
  },
181
205
  {
182
- "model": "o3",
183
- "input": 2,
184
- "cached": 0.5,
185
- "write": null,
186
- "output": 8,
187
- "long": false
188
- },
206
+ model: 'o3-mini',
207
+ input: 1.1,
208
+ cached: 0.55,
209
+ write: null,
210
+ output: 4.4,
211
+ long: false,
212
+ },
189
213
  {
190
- "model": "o4-mini",
191
- "input": 1.1,
192
- "cached": 0.275,
193
- "write": null,
194
- "output": 4.4,
195
- "long": false
214
+ model: 'gpt-4-turbo-2024-04-09',
215
+ input: 10,
216
+ cached: null,
217
+ write: null,
218
+ output: 30,
219
+ long: false,
220
+ },
221
+ {
222
+ model: 'gpt-4-0613',
223
+ input: 30,
224
+ cached: null,
225
+ write: null,
226
+ output: 60,
227
+ long: false,
228
+ },
229
+ {
230
+ model: 'gpt-3.5-turbo',
231
+ input: 0.5,
232
+ cached: null,
233
+ write: null,
234
+ output: 1.5,
235
+ long: false,
236
+ },
237
+ {
238
+ model: 'gpt-3.5-turbo-0125',
239
+ input: 0.5,
240
+ cached: null,
241
+ write: null,
242
+ output: 1.5,
243
+ long: false,
244
+ },
245
+ {
246
+ model: 'gpt-3.5-turbo-1106',
247
+ input: 1,
248
+ cached: null,
249
+ write: null,
250
+ output: 2,
251
+ long: false,
252
+ },
253
+ {
254
+ model: 'gpt-3.5-turbo-instruct',
255
+ input: 1.5,
256
+ cached: null,
257
+ write: null,
258
+ output: 2,
259
+ long: false,
260
+ },
261
+ {
262
+ model: 'davinci-002',
263
+ input: 2,
264
+ cached: null,
265
+ write: null,
266
+ output: 2,
267
+ long: false,
268
+ },
269
+ {
270
+ model: 'babbage-002',
271
+ input: 0.4,
272
+ cached: null,
273
+ write: null,
274
+ output: 0.4,
275
+ long: false,
276
+ },
277
+ {
278
+ model: 'gpt-5-codex',
279
+ input: 1.25,
280
+ cached: 0.125,
281
+ output: 10,
282
+ write: null,
283
+ long: false,
284
+ source: 'https://developers.openai.com/api/docs/models/gpt-5-codex',
285
+ },
286
+ {
287
+ model: 'gpt-5.1-codex',
288
+ input: 1.25,
289
+ cached: 0.125,
290
+ output: 10,
291
+ write: null,
292
+ long: false,
293
+ source: 'https://developers.openai.com/api/docs/models/gpt-5.1-codex',
294
+ },
295
+ {
296
+ model: 'gpt-5.1-codex-max',
297
+ input: 1.25,
298
+ cached: 0.125,
299
+ output: 10,
300
+ write: null,
301
+ long: false,
302
+ source: 'https://developers.openai.com/api/docs/models/gpt-5.1-codex-max',
303
+ },
304
+ {
305
+ model: 'gpt-5.1-codex-mini',
306
+ input: 0.25,
307
+ cached: 0.025,
308
+ output: 2,
309
+ write: null,
310
+ long: false,
311
+ source: 'https://developers.openai.com/api/docs/models/gpt-5.1-codex-mini',
312
+ },
313
+ {
314
+ model: 'gpt-5.2-codex',
315
+ input: 1.75,
316
+ cached: 0.175,
317
+ output: 14,
318
+ write: null,
319
+ long: false,
320
+ source: 'https://developers.openai.com/api/docs/models/gpt-5.2-codex',
321
+ },
322
+ {
323
+ model: 'codex-mini-latest',
324
+ input: 1.5,
325
+ cached: 0.375,
326
+ output: 6,
327
+ write: null,
328
+ long: false,
329
+ source: 'https://developers.openai.com/api/docs/models/codex-mini-latest',
330
+ },
331
+ {
332
+ model: 'gpt-5.6-cyber',
333
+ input: 12.5,
334
+ cached: 1.25,
335
+ write: 15.625,
336
+ output: 75,
337
+ long: false,
338
+ source: 'https://developers.openai.com/api/docs/pricing',
339
+ },
340
+ {
341
+ model: 'chat-latest',
342
+ input: 5,
343
+ cached: 0.5,
344
+ write: null,
345
+ output: 30,
346
+ long: false,
347
+ source: 'https://developers.openai.com/api/docs/pricing',
196
348
  },
197
- {
198
- "model": "o3-mini",
199
- "input": 1.1,
200
- "cached": 0.55,
201
- "write": null,
202
- "output": 4.4,
203
- "long": false
204
- },
205
- {
206
- "model": "gpt-4-turbo-2024-04-09",
207
- "input": 10,
208
- "cached": null,
209
- "write": null,
210
- "output": 30,
211
- "long": false
212
- },
213
- {
214
- "model": "gpt-4-0613",
215
- "input": 30,
216
- "cached": null,
217
- "write": null,
218
- "output": 60,
219
- "long": false
220
- },
221
- {
222
- "model": "gpt-3.5-turbo",
223
- "input": 0.5,
224
- "cached": null,
225
- "write": null,
226
- "output": 1.5,
227
- "long": false
228
- },
229
- {
230
- "model": "gpt-3.5-turbo-0125",
231
- "input": 0.5,
232
- "cached": null,
233
- "write": null,
234
- "output": 1.5,
235
- "long": false
236
- },
237
- {
238
- "model": "gpt-3.5-turbo-1106",
239
- "input": 1,
240
- "cached": null,
241
- "write": null,
242
- "output": 2,
243
- "long": false
244
- },
245
- {
246
- "model": "gpt-3.5-turbo-instruct",
247
- "input": 1.5,
248
- "cached": null,
249
- "write": null,
250
- "output": 2,
251
- "long": false
252
- },
253
- {
254
- "model": "davinci-002",
255
- "input": 2,
256
- "cached": null,
257
- "write": null,
258
- "output": 2,
259
- "long": false
260
- },
261
- {
262
- "model": "babbage-002",
263
- "input": 0.4,
264
- "cached": null,
265
- "write": null,
266
- "output": 0.4,
267
- "long": false
268
- },
269
- {
270
- "model": "gpt-5-codex",
271
- "input": 1.25,
272
- "cached": 0.125,
273
- "output": 10,
274
- "write": null,
275
- "long": false,
276
- "source": "https://developers.openai.com/api/docs/models/gpt-5-codex"
277
- },
278
- {
279
- "model": "gpt-5.1-codex",
280
- "input": 1.25,
281
- "cached": 0.125,
282
- "output": 10,
283
- "write": null,
284
- "long": false,
285
- "source": "https://developers.openai.com/api/docs/models/gpt-5.1-codex"
286
- },
287
- {
288
- "model": "gpt-5.1-codex-max",
289
- "input": 1.25,
290
- "cached": 0.125,
291
- "output": 10,
292
- "write": null,
293
- "long": false,
294
- "source": "https://developers.openai.com/api/docs/models/gpt-5.1-codex-max"
295
- },
296
- {
297
- "model": "gpt-5.1-codex-mini",
298
- "input": 0.25,
299
- "cached": 0.025,
300
- "output": 2,
301
- "write": null,
302
- "long": false,
303
- "source": "https://developers.openai.com/api/docs/models/gpt-5.1-codex-mini"
304
- },
305
- {
306
- "model": "gpt-5.2-codex",
307
- "input": 1.75,
308
- "cached": 0.175,
309
- "output": 14,
310
- "write": null,
311
- "long": false,
312
- "source": "https://developers.openai.com/api/docs/models/gpt-5.2-codex"
313
- },
314
- {
315
- "model": "codex-mini-latest",
316
- "input": 1.5,
317
- "cached": 0.375,
318
- "output": 6,
319
- "write": null,
320
- "long": false,
321
- "source": "https://developers.openai.com/api/docs/models/codex-mini-latest"
322
- },
323
- {"model":"gpt-5.6-cyber","input":12.5,"cached":1.25,"write":15.625,"output":75,"long":false,"source":"https://developers.openai.com/api/docs/pricing"},
324
- {"model":"chat-latest","input":5,"cached":0.5,"write":null,"output":30,"long":false,"source":"https://developers.openai.com/api/docs/pricing"}
325
349
  ];
326
- export const currentPrices =rows.map(r=>({provider:'codex',model:r.model,effective_from:'2026-10-05T00:00:00.000Z',effective_until:null,input:r.input,cached_input:r.cached,cache_write:r.write,cache_write_5m:null,cache_write_1h:null,output:r.output,source:r.source??'https://developers.openai.com/api/docs/pricing',verified_at:'2026-10-05T00:00:00.000Z',...(r.model==='gpt-5.6-cyber'?{max_verified_context:272000}:{}),...(r.long?{context_threshold:272000,long_context:{input:r.input*2,cached_input:r.cached===null?null:r.cached*2,cache_write:null,output:r.output*1.5}}:{})}));
350
+ export const currentPrices = rows.map((r) => ({
351
+ provider: 'codex',
352
+ model: r.model,
353
+ effective_from: '2026-10-05T00:00:00.000Z',
354
+ effective_until: null,
355
+ input: r.input,
356
+ cached_input: r.cached,
357
+ cache_write: r.write,
358
+ cache_write_5m: null,
359
+ cache_write_1h: null,
360
+ output: r.output,
361
+ source: r.source ?? 'https://developers.openai.com/api/docs/pricing',
362
+ verified_at: '2026-10-05T00:00:00.000Z',
363
+ ...(r.model === 'gpt-5.6-cyber' ? { max_verified_context: 272000 } : {}),
364
+ ...(r.long
365
+ ? {
366
+ context_threshold: 272000,
367
+ long_context: {
368
+ input: r.input * 2,
369
+ cached_input: r.cached === null ? null : r.cached * 2,
370
+ cache_write: null,
371
+ output: r.output * 1.5,
372
+ },
373
+ }
374
+ : {}),
375
+ }));