@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 CHANGED
@@ -1,3 +1,7 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/adiled/clwnd/main/clwnd.gif" alt="clwnd" />
3
+ </p>
4
+
1
5
  ```
2
6
  curl -fsSL https://raw.githubusercontent.com/adiled/clwnd/main/install | bash
3
7
  ```
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: u?.input_tokens ?? u?.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
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clwnd/opencode",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "clwnd for opencode",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",