opencode-goal-mode 0.3.4 → 0.3.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.3.5
4
+
5
+ - Verified the package against the **current** OpenCode plugin API
6
+ (`@opencode-ai/plugin@1.17.6`, matching OpenCode 1.17.6, now the dev pin): all
7
+ guard hooks (`chat.message`/`params`, `tool.execute.before`/`after`,
8
+ `experimental.chat.system.transform`/`text.complete`/`session.compacting`)
9
+ exist; the guard plugin loads with zero errors; and in a real OpenCode the
10
+ agent list shows `goal` as the only user-selectable agent with 26 subagents and
11
+ reviewer `edit`/`task: deny` applied. The enforcement core is unchanged and
12
+ fully intact.
13
+ - Declared `@opentui/solid`, `solid-js`, `@opencode-ai/plugin` as **optional**
14
+ peer dependencies (the TUI runtime the sidebar uses).
15
+ - Docs: stated the sidebar's verification status honestly — the experimental TUI
16
+ banner is verified to load and to render in a real headless OpenTUI test, but
17
+ its live in-session render depends on your OpenCode build's file-based
18
+ TUI-plugin support; it never errors and never affects the enforcement core.
19
+
3
20
  ## v0.3.4
4
21
 
5
22
  Critical fixes found by testing against a real OpenCode (1.17.6) install — the
package/README.md CHANGED
@@ -41,8 +41,9 @@ opencode agent list | grep goal
41
41
  The `goal` agent writes a contract, delegates research/review to subagents, and
42
42
  **cannot** answer `Goal Completed` until every required review gate passes — the
43
43
  guard rewrites a premature claim to `Goal Not Completed`. Try a destructive
44
- command mid-session (e.g. `rm -rf build`) and watch it get blocked. The active
45
- goal shows in the sidebar in yellow.
44
+ command mid-session (e.g. `rm -rf build`) and watch it get blocked. If your
45
+ OpenCode build supports TUI plugins, the active goal also appears in the sidebar
46
+ in yellow (experimental — see [TUI integration](#tui-integration)).
46
47
 
47
48
  That's it. Everything below is detail.
48
49
 
@@ -174,14 +175,21 @@ enforcement and writes its state to disk, and an experimental TUI plugin
174
175
  - **Sidebar goal banner (experimental).** The current goal renders in shining
175
176
  yellow in the sidebar (`sidebar_content` slot), with a `passing/total gates ·
176
177
  dirty/ready` status line, and updates as reviews land. When a task is running
177
- but **no goal is set**, it shows a clean grey `No goal` and nothing else. It
178
- requires a TUI-plugin-capable OpenCode (one exposing `api.slots.register`); on
179
- any older runtime it silently no-ops, so it can never break your TUI. Set
178
+ but **no goal is set**, it shows a clean grey `No goal`. Set
180
179
  `sidebarBanner: false` (or `GOAL_GUARD_SIDEBAR_BANNER=0`) to disable,
181
180
  `sidebarColor` to recolour the goal, or `sidebarMutedColor` for the "No goal"
182
- line. It is rendered-and-asserted headlessly by the
183
- [visual test](tools/visual-test/README.md) (`npm run test:visual`); still worth
184
- a glance in your own TUI.
181
+ line.
182
+
183
+ **Verification status, honestly:** the component is rendered and asserted
184
+ (text + exact colours) by a real headless OpenTUI renderer in the
185
+ [visual test](tools/visual-test/README.md) (`npm run test:visual`, 17/17), and
186
+ OpenCode discovers and boots it as a plugin without error. It needs a recent
187
+ OpenCode that mounts file-based TUI plugins into the `sidebar_content` slot and
188
+ provides the `@opentui/solid` runtime; on a build without that, it simply does
189
+ not appear (it never errors or breaks the TUI — the enforcement core is a
190
+ separate server plugin and is unaffected). The banner appears in a **session**
191
+ view, not the home screen. If it doesn't show, that's the TUI-plugin runtime,
192
+ not Goal Mode's enforcement.
185
193
  - **Toasts.** Review verdicts and completion-unlock events surface as toasts
186
194
  (`toastOnReview`), and blocked destructive commands / premature completions
187
195
  toast as before (`toastOnBlock`).
@@ -4,10 +4,10 @@
4
4
  <text x="20" y="47" font-size="12" fill="#656d76">Microseconds to classify one command. Both are negligible for a tool-call guard.</text>
5
5
  <text x="218" y="87" font-size="12" text-anchor="end" fill="#1f2328">Legacy regex guard</text>
6
6
  <rect x="230" y="70" width="420" height="22" rx="3" fill="#eaeef2"/>
7
- <rect x="230" y="70" width="212.3" height="22" rx="3" fill="#9aa0a6"/>
8
- <text x="450.3" y="87" font-size="12" font-weight="600" fill="#1f2328">0.81 µs</text>
7
+ <rect x="230" y="70" width="217.1" height="22" rx="3" fill="#9aa0a6"/>
8
+ <text x="455.1" y="87" font-size="12" font-weight="600" fill="#1f2328">0.75 µs</text>
9
9
  <text x="218" y="125" font-size="12" text-anchor="end" fill="#1f2328">Goal Mode analyzer</text>
10
10
  <rect x="230" y="108" width="420" height="22" rx="3" fill="#eaeef2"/>
11
11
  <rect x="230" y="108" width="300.0" height="22" rx="3" fill="#2da44e"/>
12
- <text x="538.0" y="125" font-size="12" font-weight="600" fill="#1f2328">1.14 µs</text>
12
+ <text x="538.0" y="125" font-size="12" font-weight="600" fill="#1f2328">1.03 µs</text>
13
13
  </svg>
@@ -75,8 +75,8 @@
75
75
  "safeFalsePos": 5
76
76
  }
77
77
  },
78
- "opsPerSec": 1238863,
79
- "usPerCommand": 0.81
78
+ "opsPerSec": 1341168,
79
+ "usPerCommand": 0.75
80
80
  },
81
81
  "current": {
82
82
  "detectionRate": 100,
@@ -111,8 +111,8 @@
111
111
  "safeFalsePos": 0
112
112
  }
113
113
  },
114
- "opsPerSec": 876672,
115
- "usPerCommand": 1.14
114
+ "opsPerSec": 970526,
115
+ "usPerCommand": 1.03
116
116
  }
117
117
  },
118
118
  "completionFixtures": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-goal-mode",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Strict Goal Mode agents, commands, and guard plugin for OpenCode.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -82,8 +82,18 @@
82
82
  "registry": "https://registry.npmjs.org/"
83
83
  },
84
84
  "devDependencies": {
85
- "@opencode-ai/plugin": "1.15.13",
85
+ "@opencode-ai/plugin": "1.17.6",
86
86
  "fast-check": "^4.8.0",
87
87
  "yaml": "^2.6.1"
88
+ },
89
+ "peerDependencies": {
90
+ "@opencode-ai/plugin": ">=1.15.0",
91
+ "@opentui/solid": "*",
92
+ "solid-js": "*"
93
+ },
94
+ "peerDependenciesMeta": {
95
+ "@opencode-ai/plugin": { "optional": true },
96
+ "@opentui/solid": { "optional": true },
97
+ "solid-js": { "optional": true }
88
98
  }
89
99
  }