@clwnd/opencode 0.18.6 → 0.18.8

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 +19 -0
  2. package/package.json +1 -1
  3. package/tui.tsx +26 -2
package/dist/index.js CHANGED
@@ -1021,9 +1021,12 @@ var ClwndModel = class {
1021
1021
  })();
1022
1022
  if (isBrokeredToolReturn(opts.prompt) && !isPermReturn) {
1023
1023
  trace("brokered.return", { sid });
1024
+ const textId = `brokered-${Date.now()}`;
1024
1025
  return {
1025
1026
  stream: new ReadableStream({
1026
1027
  start(controller) {
1028
+ controller.enqueue({ type: "text-start", id: textId });
1029
+ controller.enqueue({ type: "text-end", id: textId });
1027
1030
  controller.enqueue({ type: "finish", finishReason: { unified: "stop", raw: "stop" }, usage: zeroUsage() });
1028
1031
  controller.close();
1029
1032
  }
@@ -1462,6 +1465,22 @@ var clwndPlugin = async (input) => {
1462
1465
  }
1463
1466
  }
1464
1467
  },
1468
+ // Suppress OC's builtin tools that clwnd has replaced. We can't remove
1469
+ // them from OC's registry, but we can rewrite their descriptions so the
1470
+ // model never picks them. Without this, the model sees "edit", "write",
1471
+ // "glob", "grep" in the active tool list, tries to call them, and gets
1472
+ // an invalid-tool bounce because Claude CLI has --disallowedTools'd them.
1473
+ "tool.definition": async (input2, output) => {
1474
+ const replaced = {
1475
+ edit: "DISABLED \u2014 use do_code instead.",
1476
+ write: "DISABLED \u2014 use do_code for code files, do_noncode for non-code files.",
1477
+ glob: "DISABLED \u2014 use read with a glob pattern or directory path instead.",
1478
+ grep: "DISABLED \u2014 use read with the pattern parameter instead."
1479
+ };
1480
+ if (replaced[input2.toolID]) {
1481
+ output.description = replaced[input2.toolID];
1482
+ }
1483
+ },
1465
1484
  "chat.headers": async (ctx, output) => {
1466
1485
  output.headers["x-clwnd-agent"] = typeof ctx.agent === "string" ? ctx.agent : ctx.agent?.name ?? JSON.stringify(ctx.agent);
1467
1486
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clwnd/opencode",
3
- "version": "0.18.6",
3
+ "version": "0.18.8",
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>