teapot-coding-agent 0.37.64 → 0.37.66
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/agent/agent.js +7 -2
- package/dist/model-meta.js +15 -1
- package/package.json +1 -1
- package/public/assets/{index-CU1sdkWx.js → index-B1INVhoI.js} +5 -5
- package/public/assets/{index-CU1sdkWx.js.map → index-B1INVhoI.js.map} +1 -1
- package/public/assets/{shiki-D7Yr8qBB.js → shiki-DwIYy5Qf.js} +2 -2
- package/public/assets/{shiki-D7Yr8qBB.js.map → shiki-DwIYy5Qf.js.map} +1 -1
- package/public/index.html +1 -1
package/dist/agent/agent.js
CHANGED
|
@@ -395,7 +395,10 @@ export class Agent {
|
|
|
395
395
|
const u = e.data;
|
|
396
396
|
const inTok = u.inputTokens ?? 0;
|
|
397
397
|
const cached = Math.min(u.cachedInputTokens ?? 0, inTok);
|
|
398
|
-
cost +=
|
|
398
|
+
cost +=
|
|
399
|
+
(inTok - cached) * p.prompt +
|
|
400
|
+
(u.outputTokens ?? 0) * p.completion +
|
|
401
|
+
cached * (p.cacheRead ?? p.prompt * 0.1);
|
|
399
402
|
}
|
|
400
403
|
this.stats.costUsd = cost;
|
|
401
404
|
}
|
|
@@ -1768,7 +1771,9 @@ export class Agent {
|
|
|
1768
1771
|
const uncached = Math.max(0, inTok - cached);
|
|
1769
1772
|
this.stats.costUsd =
|
|
1770
1773
|
(this.stats.costUsd ?? 0) +
|
|
1771
|
-
(uncached * p.prompt +
|
|
1774
|
+
(uncached * p.prompt +
|
|
1775
|
+
(res.usage.outputTokens ?? 0) * p.completion +
|
|
1776
|
+
cached * (p.cacheRead ?? p.prompt * 0.1));
|
|
1772
1777
|
}
|
|
1773
1778
|
this.lastUsage = {
|
|
1774
1779
|
input: res.usage.inputTokens ?? 0,
|
package/dist/model-meta.js
CHANGED
|
@@ -151,8 +151,22 @@ export function metaFrom(m) {
|
|
|
151
151
|
id: String(m.id ?? ""),
|
|
152
152
|
...(typeof m.name === "string" ? { name: m.name } : {}),
|
|
153
153
|
...(typeof m.limit?.context === "number" ? { contextLength: m.limit.context } : {}),
|
|
154
|
+
/**
|
|
155
|
+
* models.dev quotes USD per MILLION tokens; everything downstream multiplies by TOKENS.
|
|
156
|
+
*
|
|
157
|
+
* MEASURED: `claude-sonnet-4-5` is `{input: 3, output: 15}`, i.e. $3/$15 per million — so feeding
|
|
158
|
+
* those raw made a 892.6M-token session cost $15,239,168 instead of $15.31, and the picker badge
|
|
159
|
+
* read `150000/M`. Normalise here, at the single boundary, and keep the per-token convention the
|
|
160
|
+
* cost code and the badge already assume.
|
|
161
|
+
*/
|
|
154
162
|
...(m.cost && (typeof m.cost.input === "number" || typeof m.cost.output === "number")
|
|
155
|
-
? {
|
|
163
|
+
? {
|
|
164
|
+
pricing: {
|
|
165
|
+
prompt: Number(m.cost.input ?? 0) / 1e6,
|
|
166
|
+
completion: Number(m.cost.output ?? 0) / 1e6,
|
|
167
|
+
...(typeof m.cost.cache_read === "number" ? { cacheRead: m.cost.cache_read / 1e6 } : {}),
|
|
168
|
+
},
|
|
169
|
+
}
|
|
156
170
|
: {}),
|
|
157
171
|
...(input ? { modalities: { input, output: output ?? ["text"] } } : {}),
|
|
158
172
|
...(efforts ? { supportedEfforts: efforts } : {}),
|