@clwnd/opencode 0.3.1 → 0.3.2
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/README.md +4 -0
- package/dist/index.js +6 -2
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -643,13 +643,17 @@ var ClwndModel = class {
|
|
|
643
643
|
emit({ type: "reasoning-end", id: reasoningId });
|
|
644
644
|
}
|
|
645
645
|
const u = msg.usage;
|
|
646
|
+
const cacheRead = u?.cache_read_input_tokens ?? 0;
|
|
647
|
+
const cacheWrite = u?.cache_creation_input_tokens ?? 0;
|
|
648
|
+
const inputBase = u?.input_tokens ?? u?.inputTokens ?? 0;
|
|
646
649
|
emit({
|
|
647
650
|
type: "finish",
|
|
648
651
|
finishReason: msg.finishReason ?? "stop",
|
|
649
652
|
usage: {
|
|
650
|
-
inputTokens:
|
|
653
|
+
inputTokens: inputBase + cacheRead + cacheWrite,
|
|
651
654
|
outputTokens: u?.output_tokens ?? u?.outputTokens,
|
|
652
|
-
totalTokens: void 0
|
|
655
|
+
totalTokens: void 0,
|
|
656
|
+
cache: { read: cacheRead, write: cacheWrite }
|
|
653
657
|
},
|
|
654
658
|
providerMetadata: msg.providerMetadata ?? {}
|
|
655
659
|
});
|