opencode-codeops 2.0.0 → 2.0.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/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to CodeOps are recorded here.
4
4
 
5
+ ## 2.0.2 — 2026-10-06
6
+
7
+ ### Fixes
8
+
9
+ - release: make a no-op release dispatch succeed
10
+
11
+ ## 2.0.1 — 2026-10-06
12
+
13
+ ### Fixes
14
+
15
+ - installer: read plugins from the v2 configuration source list
16
+
5
17
  ## 2.0.0 — 2026-10-06
6
18
 
7
19
  ### Breaking Changes
@@ -184,11 +184,33 @@ function entrySpec(item) {
184
184
  return undefined
185
185
  }
186
186
 
187
+ /**
188
+ * Normalize the plugin entries from one configuration document.
189
+ *
190
+ * A document's `info` may carry the native `plugins` array or the legacy
191
+ * singular `plugin` array; both are read so mixed configurations are reported
192
+ * correctly.
193
+ *
194
+ * @param info - Configuration document info object
195
+ * @returns The document's plugin spec strings
196
+ */
197
+ function documentPlugins(info) {
198
+ if (!info || typeof info !== "object") return []
199
+ const raw = Array.isArray(info.plugins)
200
+ ? info.plugins
201
+ : Array.isArray(info.plugin)
202
+ ? info.plugin
203
+ : []
204
+ return raw.map(entrySpec).filter((spec) => typeof spec === "string")
205
+ }
206
+
187
207
  /**
188
208
  * Reads the resolved plugin list from OpenCode's effective config.
189
209
  *
190
- * OpenCode 2 uses `plugins`; the legacy singular `plugin` key is still read as
191
- * a fallback so mixed configs are reported correctly.
210
+ * OpenCode 2 prints the list of configuration sources, each with its document
211
+ * under `info`; OpenCode 1 printed one resolved config object. Both shapes are
212
+ * understood, and the legacy `plugin` key is read as a fallback so mixed
213
+ * configurations are reported correctly.
192
214
  *
193
215
  * @param details - Inspection inputs
194
216
  * @param details.cwd - Working directory
@@ -200,14 +222,17 @@ export function readConfiguredPlugin({ cwd, run = defaultRun } = {}) {
200
222
  const result = run("opencode", ["debug", "config"], { cwd })
201
223
  if (result.error || result.status !== 0) return undefined
202
224
 
203
- const config = JSON.parse(result.stdout)
204
- const raw = Array.isArray(config.plugins)
205
- ? config.plugins
206
- : Array.isArray(config.plugin)
207
- ? config.plugin
208
- : []
225
+ const parsed = JSON.parse(result.stdout)
226
+ const sources = Array.isArray(parsed) ? parsed : [parsed]
227
+ const specs = []
228
+ for (const source of sources) {
229
+ if (source && typeof source === "object" && "info" in source) {
230
+ specs.push(...documentPlugins(source.info))
231
+ }
232
+ }
233
+ if (specs.length > 0) return specs
209
234
 
210
- return raw.map(entrySpec).filter((spec) => typeof spec === "string")
235
+ return documentPlugins(parsed)
211
236
  } catch {
212
237
  return undefined
213
238
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-codeops",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "Specification-first engineering for complex systems — CodeOps plugin for OpenCode",
5
5
  "type": "module",
6
6
  "engines": {
@@ -482,8 +482,8 @@ export function main(argv) {
482
482
  if (command === "version" || command === "release") {
483
483
  if (!options.dryRun) assertCleanTree()
484
484
  if (!changedSinceLastTag()) {
485
- console.error("error: no changes since the last tag; nothing to release")
486
- return 1
485
+ console.log(`No changes since the last tag (${lastTag()}); nothing to release.`)
486
+ return 0
487
487
  }
488
488
 
489
489
  const commits = readCommits()