@clwnd/opencode 0.18.6 → 0.18.7

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.
Files changed (3) hide show
  1. package/dist/index.js +17 -0
  2. package/package.json +1 -1
  3. package/tui.tsx +26 -2
package/dist/index.js CHANGED
@@ -1462,6 +1462,23 @@ var clwndPlugin = async (input) => {
1462
1462
  }
1463
1463
  }
1464
1464
  },
1465
+ // Suppress OC's builtin tools that clwnd has replaced. We can't remove
1466
+ // them from OC's registry, but we can rewrite their descriptions so the
1467
+ // model never picks them. Without this, the model sees "edit", "write",
1468
+ // "glob", "grep" in the active tool list, tries to call them, and gets
1469
+ // an invalid-tool bounce because Claude CLI has --disallowedTools'd them.
1470
+ "tool.definition": async (input2, output) => {
1471
+ const replaced = {
1472
+ edit: "DISABLED \u2014 use do_code instead.",
1473
+ write: "DISABLED \u2014 use do_code for code files, do_noncode for non-code files.",
1474
+ glob: "DISABLED \u2014 use read with a glob pattern or directory path instead.",
1475
+ grep: "DISABLED \u2014 use read with the pattern parameter instead."
1476
+ };
1477
+ if (replaced[input2.toolID]) {
1478
+ output.description = replaced[input2.toolID];
1479
+ output.parameters = { type: "object", properties: {} };
1480
+ }
1481
+ },
1465
1482
  "chat.headers": async (ctx, output) => {
1466
1483
  output.headers["x-clwnd-agent"] = typeof ctx.agent === "string" ? ctx.agent : ctx.agent?.name ?? JSON.stringify(ctx.agent);
1467
1484
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clwnd/opencode",
3
- "version": "0.18.6",
3
+ "version": "0.18.7",
4
4
  "description": "clwnd for opencode",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/tui.tsx CHANGED
@@ -2,6 +2,17 @@
2
2
  import type { TuiPlugin, TuiPluginModule } from "@opencode-ai/plugin/tui"
3
3
  import { createSignal, onCleanup, createMemo, Show } from "solid-js"
4
4
 
5
+ const VERSION = (() => {
6
+ try {
7
+ const fs = require("fs")
8
+ const path = require("path")
9
+ const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"), "utf8"))
10
+ return pkg.version ?? "?"
11
+ } catch {
12
+ return "?"
13
+ }
14
+ })()
15
+
5
16
  interface DaemonData {
6
17
  status: "connected" | "disconnected"
7
18
  procs: number
@@ -73,10 +84,23 @@ function SidebarView(props: { api: any; session_id: string }) {
73
84
  return `saved: ${String(d.readDedup)} dedup · ${String(d.bashCapped)} capped`
74
85
  })
75
86
 
87
+ // green = active procs, secondary = idle (connected, nothing running), muted = disconnected
88
+ const dotColor = createMemo(() => {
89
+ const d = data()
90
+ if (d.status === "disconnected") return theme().textMuted
91
+ if (d.procs > 0) return theme().success
92
+ return theme().secondary
93
+ })
94
+
76
95
  return (
77
96
  <box>
78
- <text fg={theme().text}><b>clwnd</b></text>
79
- <text fg={data().status === "connected" ? theme().success : theme().error}>{statusLine()}</text>
97
+ <text fg={theme().textMuted}>
98
+ <span style={{ fg: dotColor() }}>{"•"}</span>
99
+ {" "}
100
+ <b>{"clwnd"}</b>
101
+ {" "}
102
+ <span>{VERSION}</span>
103
+ </text>
80
104
  <text fg={theme().textMuted}>{procsLine()}</text>
81
105
  <Show when={savingsLine() !== ""}>
82
106
  <text fg={theme().textMuted}>{savingsLine()}</text>