shine-code-submit 1.0.8 → 1.0.10
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/.claude-plugin/plugin.json +1 -1
- package/dist/install.cjs +1 -1
- package/package.json +1 -1
- package/src/daemon/server.ts +9 -3
- package/src/daemon/token-cache.ts +2 -2
- package/src/daemon/transcript.ts +27 -0
- package/src/daemon/ui-assets.ts +1 -1
- package/ui/.build/app.js +1 -1
- package/ui/lib/util.ts +3 -3
package/ui/lib/util.ts
CHANGED
|
@@ -50,11 +50,11 @@ export function fmtTokens(n: number): string {
|
|
|
50
50
|
return trimZero((n / 1_000_000_000_000).toFixed(2)) + "T";
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
/**
|
|
54
|
-
*
|
|
53
|
+
/** 计费输入 token = 未缓存输入 + 缓存写×1.25 + 缓存读×0.1(Anthropic 计费口径,对齐官方/智谱后台)。
|
|
54
|
+
* cache_creation 加价 1.25x,cache_read 命中折扣 0.1x;Math.round 避免浮点。 */
|
|
55
55
|
export function realInput(u?: TokenUsage | null): number {
|
|
56
56
|
if (!u) return 0;
|
|
57
|
-
return u.input + u.cacheCreation + u.cacheRead;
|
|
57
|
+
return Math.round(u.input + u.cacheCreation * 1.25 + u.cacheRead * 0.1);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
/** token 用量简写:↑真实输入 ↓输出(真实输入 = 未缓存 + 缓存写 + 缓存读)。无值返回空串。 */
|