chore(opencode): move the OpenCode pin to 2.2.5 from a workspace catalog

Manager builds against and requires OpenCode 2.2.5. Every @opencode
package, plus effect and the OpenTUI/solid dependencies they share,
resolves from one pnpm workspace catalog instead of separate pins.

The built-against version and the supported floor are now separate
settings, so a future OpenCode release can move the pin before raising
the floor. Docker and the dev setup script read the floor from its own
argument.

ocm-cli moves to 0.6.0 on the same 2.2.5 and OpenTUI 0.8 baseline. A
linked server on a different version is still connectable and now shows
a neutral version notice instead of an unsupported badge.
This commit is contained in:
Chris Scott committed 2026-11-06 09:26:56 -05:00
1 parent dc0220843e
commit 807c7cb896
20 files changed
+583 -562

No files matched your search

+10 -6
View File
@@ -10,11 +10,12 @@ to the local working tree.
| ocm | OpenCode Manager | Local OpenCode |
|---|---|---|
| 0.6.x | >= 0.19.0 | >= 2.2.3, < 3 |
| 0.5.x | >= 0.19.0 | >= 2.2.0, < 3 |
| 0.4.x | >= 0.19.0 | >= 2.0.15, < 3 |
| 0.3.x | >= 0.19.0 | >= 2.0.15, < 3 |
ocm 0.5.x, 0.4.x and 0.3.x attach through the repo-scoped Manager proxy
ocm 0.6.x, 0.5.x, 0.4.x and 0.3.x attach through the repo-scoped Manager proxy
(`/api/opencode-proxy/repos/:repoId`), load the plugin from the OpenCode 2
`cli.json` `plugins` list, and move sessions with OpenCode 2 session
export/import. Older Managers lack that route; `ocm` then fails with
@@ -24,10 +25,13 @@ Use ocm 0.2.x with OpenCode Manager < 0.19.0 and OpenCode 1.x, installed pinned
`@opencode-manager/ocm-cli@0.2`. ocm is published together with each OpenCode Manager
release.
From ocm 0.5.0, the TUI plugin is built against `@opencode/plugin` 2.2.x and
OpenTUI 0.7, so it requires a local OpenCode >= 2.2.0: OpenCode 2.2.0 refuses
plugins built for OpenTUI 0.6, and older OpenCode builds may refuse the OpenTUI
0.7 peers. Stay on ocm 0.4.x with a local OpenCode older than 2.2.0.
From ocm 0.6.0, the TUI plugin is built against `@opencode/plugin` 2.2.5 and
OpenTUI 0.8, so it requires a local OpenCode >= 2.2.3. OpenCode 2.2.0 through
2.2.2 ship OpenTUI 0.7; stay on ocm 0.5.x with those builds. ocm 0.5.0 itself
is built against `@opencode/plugin` 2.2.1 and OpenTUI 0.7 and requires a local
OpenCode >= 2.2.0: OpenCode 2.2.0 refuses plugins built for OpenTUI 0.6, and
older OpenCode builds may refuse the 0.7 peers. Stay on ocm 0.4.x with a local
OpenCode older than 2.2.0.
ocm 0.5.0 removes `/ocm-goal`; session goals use OpenCode's built-in `/goal`
command, and OpenCode Manager no longer serves `/api/internal/session-goals`.
@@ -320,7 +324,7 @@ global installs); the plugin surface is TUI-only.
## Requirements
- macOS or Linux (Windows is unsupported)
- OpenCode >= 2.2.0 (same major, 2.x) available on `PATH` for the TUI plugin
- OpenCode >= 2.2.3 (same major, 2.x) available on `PATH` for the TUI plugin
- Node available on `PATH` (runs the `ocm` binary)
- OpenCode Manager >= 0.19.0
- `git` and `tar` (with gzip support, i.e. the `-z` flag) available on `PATH`
+9 -9
View File
@@ -1,6 +1,6 @@
{
"name": "@opencode-manager/ocm-cli",
"version": "0.5.0",
"version": "0.6.0",
"description": "OpenCode Manager CLI: attach a local OpenCode TUI to a Manager-hosted repo.",
"license": "MIT",
"repository": {
@@ -18,9 +18,9 @@
}
},
"peerDependencies": {
"@opencode/theme": ">=2.2.1 <3.0.0",
"@opentui/core": ">=0.7.0 <0.8.0",
"@opentui/solid": ">=0.7.0 <0.8.0",
"@opencode/theme": ">=2.2.5 <3.0.0",
"@opentui/core": ">=0.8.0 <0.9.0",
"@opentui/solid": ">=0.8.0 <0.9.0",
"solid-js": ">=1.9.0"
},
"peerDependenciesMeta": {
@@ -58,16 +58,16 @@
},
"devDependencies": {
"@eslint/js": "^9.36.0",
"@opencode/plugin": "2.2.1",
"@opencode/theme": "2.2.1",
"@opencode-manager/shared": "workspace:*",
"@opentui/core": "0.7.0",
"@opentui/solid": "0.7.0",
"@opencode/plugin": "catalog:",
"@opencode/theme": "catalog:",
"@opentui/core": "catalog:",
"@opentui/solid": "catalog:",
"@types/bun": "^1.3.14",
"@types/node": "^22.0.0",
"eslint": "^9.39.1",
"jsonc-parser": "^3.3.1",
"solid-js": "1.9.12",
"solid-js": "catalog:",
"typescript": "^5.5.0",
"typescript-eslint": "^8.45.0",
"uqr": "^0.1.3",
+33 -13
View File
@@ -1,6 +1,6 @@
import { readFileSync } from 'node:fs'
import { join } from 'node:path'
import { parseSemver } from '@opencode-manager/shared/utils'
import { compareSemver, parseSemver } from '@opencode-manager/shared/utils'
import { describe, expect, it } from 'vitest'
interface PackageManifest {
@@ -20,21 +20,40 @@ function readManifest(path: string): PackageManifest {
}
/**
* Derives the minor-line peer range for a plugin's exact dependency pin.
* Reads the version of a dependency installed in ocm-cli's node_modules.
*/
function installedVersion(name: string): string {
return readManifest(join(__dirname, '..', 'node_modules', name, 'package.json')).version
}
/**
* Derives the minor-line peer range for an exact dependency version.
*
* A `0.x.y` pin is constrained to its minor line; a pin at major `1` or above
* A `0.x.y` version is constrained to its minor line; a version at major `1` or above
* is constrained to its major line.
*/
function deriveMinorLineRange(pin: string): string {
const parsed = parseSemver(pin)
function deriveMinorLineRange(version: string): string {
const parsed = parseSemver(version)
if (!parsed || parsed.prerelease.length > 0) {
throw new Error(`Cannot derive a peer range from pin "${pin}"`)
throw new Error(`Cannot derive a peer range from version "${version}"`)
}
const { major, minor } = parsed
if (major === 0) {
return `>=0.${minor}.0 <0.${minor + 1}.0`
}
return `>=${pin} <${major + 1}.0.0`
return `>=${version} <${major + 1}.0.0`
}
/**
* Asserts that an installed version satisfies a plugin peer declaration,
* accepting both an exact peer pin and an open `>=` floor.
*/
function expectVersionSatisfiesPeer(version: string, peer: string): void {
if (peer.startsWith('>=')) {
expect(compareSemver(version, peer.slice(2).trim())).toBeGreaterThanOrEqual(0)
return
}
expect(version).toBe(peer)
}
const ocmManifest = readManifest(join(__dirname, '..', 'package.json'))
@@ -44,15 +63,16 @@ const pluginManifest = readManifest(
describe('ocm-cli package compatibility with the installed @opencode/plugin', () => {
for (const name of PINNED_PACKAGES) {
it(`${name} matches the plugin peer pin`, () => {
const pluginPin = pluginManifest.peerDependencies[name]
expect(ocmManifest.devDependencies[name]).toBe(pluginPin)
expect(ocmManifest.peerDependencies[name]).toBe(deriveMinorLineRange(pluginPin))
it(`${name} satisfies the plugin peer and derives the published peer range`, () => {
const version = installedVersion(name)
expectVersionSatisfiesPeer(version, pluginManifest.peerDependencies[name]!)
expect(ocmManifest.devDependencies[name]).toBe('catalog:')
expect(ocmManifest.peerDependencies[name]).toBe(deriveMinorLineRange(version))
expect(ocmManifest.peerDependenciesMeta[name]?.optional).toBe(true)
})
}
it('@opencode/plugin devDependency matches the installed plugin version', () => {
expect(ocmManifest.devDependencies['@opencode/plugin']).toBe(pluginManifest.version)
it('resolves @opencode/plugin from the workspace catalog', () => {
expect(ocmManifest.devDependencies['@opencode/plugin']).toBe('catalog:')
})
})