@clwnd/opencode 0.3.0 → 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 +7 -3
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -332,7 +332,7 @@ function parseToolResult(resultText) {
|
|
|
332
332
|
function defaultSocketPath() {
|
|
333
333
|
const runtime = process.env.XDG_RUNTIME_DIR;
|
|
334
334
|
if (runtime) return `${runtime}/clwnd/clwnd.sock`;
|
|
335
|
-
return "/tmp/clwnd.sock";
|
|
335
|
+
return "/tmp/clwnd/clwnd.sock";
|
|
336
336
|
}
|
|
337
337
|
var SOCK_PATH = (process.env.CLWND_SOCKET ?? defaultSocketPath()) + ".http";
|
|
338
338
|
function streamCall(msg) {
|
|
@@ -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
|
});
|