opencode-apex 0.2.0 → 0.2.1
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 +9 -0
- package/README.md +4 -2
- package/core/compat.ts +10 -2
- package/docs/TROUBLESHOOTING.md +5 -4
- package/index.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.1] — 2026-10-23
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- El aviso de versiones desalineadas recomendaba `opencode plugin update`, que en OpenCode
|
|
8
|
+
2.1 solo gestiona plugins de TUI (`Plugin is not configured` para los de servidor). Ahora
|
|
9
|
+
indica el procedimiento que funciona: con OpenCode parado, borrar
|
|
10
|
+
`~/.cache/opencode/npm/opencode-apex@*` y arrancarlo.
|
|
11
|
+
|
|
3
12
|
## [0.2.0] — 2026-10-23
|
|
4
13
|
|
|
5
14
|
Automatizaciones que sobreviven a la descarga de plugins de OpenCode V2: todo entra por
|
package/README.md
CHANGED
|
@@ -32,8 +32,10 @@ Desde npm, en `opencode.json` (OpenCode instala el paquete y sus dependencias):
|
|
|
32
32
|
|
|
33
33
|
En desarrollo, apunta por ruta de directorio (`"package": "/ruta/a/opencode-apex"`) y `bun install` en él.
|
|
34
34
|
|
|
35
|
-
Requiere OpenCode **≥ 2.1**.
|
|
36
|
-
|
|
35
|
+
Requiere OpenCode **≥ 2.1**. La caché npm de plugins no se refresca sola: para actualizar apex
|
|
36
|
+
(o tras actualizar OpenCode), con OpenCode parado borra `~/.cache/opencode/npm/opencode-apex@*` y
|
|
37
|
+
arráncalo. En 2.1, `opencode plugin update` solo gestiona plugins de TUI. apex avisa al cargar si
|
|
38
|
+
quedó desalineado.
|
|
37
39
|
|
|
38
40
|
## Configuración
|
|
39
41
|
|
package/core/compat.ts
CHANGED
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
* en caché, un gestor que no hoistea), los efectos de una no se entienden con la otra
|
|
8
8
|
* y el fallo llega críptico (`Schema.isStartsWith is not a function`, "missing TypeId").
|
|
9
9
|
* Aquí se detecta al cargar y se dice qué hacer.
|
|
10
|
+
*
|
|
11
|
+
* La caché npm de plugins de OpenCode no se refresca sola: tras actualizar OpenCode,
|
|
12
|
+
* apex sigue con las dependencias de cuando se instaló hasta que se reinstala.
|
|
10
13
|
*/
|
|
11
14
|
|
|
12
15
|
import { readFileSync, realpathSync } from "node:fs"
|
|
@@ -51,6 +54,11 @@ function readPackage(dir: string): { name?: string; version?: string } | null {
|
|
|
51
54
|
}
|
|
52
55
|
}
|
|
53
56
|
|
|
57
|
+
/** Cómo forzar que OpenCode reinstale apex y sus dependencias. */
|
|
58
|
+
const REINSTALL =
|
|
59
|
+
"con OpenCode parado, borra ~/.cache/opencode/npm/opencode-apex@* y arráncalo " +
|
|
60
|
+
"(en 2.1 `opencode plugin update` solo gestiona plugins de TUI)"
|
|
61
|
+
|
|
54
62
|
/** major.minor numérico, o null si no se puede leer. */
|
|
55
63
|
function minor(version: string | undefined): [number, number] | null {
|
|
56
64
|
const match = /^(\d+)\.(\d+)/.exec(version ?? "")
|
|
@@ -81,13 +89,13 @@ export function compatibilityWarnings(
|
|
|
81
89
|
if (ownEffect && pluginEffect && ownEffect.dir !== pluginEffect.dir) {
|
|
82
90
|
warnings.push(
|
|
83
91
|
`dos copias de effect: apex usa ${ownEffect.version} y @opencode/plugin ${pluginEffect.version}. ` +
|
|
84
|
-
`Reinstala el plugin
|
|
92
|
+
`Reinstala el plugin: ${REINSTALL}.`,
|
|
85
93
|
)
|
|
86
94
|
}
|
|
87
95
|
if (plugin && newerMinor(hostVersion, plugin.version)) {
|
|
88
96
|
warnings.push(
|
|
89
97
|
`OpenCode ${hostVersion} es más nuevo que @opencode/plugin ${plugin.version} instalado con apex. ` +
|
|
90
|
-
`
|
|
98
|
+
`Reinstálalo para alinear versiones: ${REINSTALL}.`,
|
|
91
99
|
)
|
|
92
100
|
}
|
|
93
101
|
return warnings
|
package/docs/TROUBLESHOOTING.md
CHANGED
|
@@ -220,12 +220,13 @@ console.log(await loadConfig('<proyecto>/.opencode/opencode-apex.jsonc')); // ->
|
|
|
220
220
|
- si OpenCode (`ctx.app.version`) es de un minor más nuevo que el `@opencode/plugin`
|
|
221
221
|
instalado. Pasa tras actualizar OpenCode, porque la caché npm de plugins no se
|
|
222
222
|
refresca sola.
|
|
223
|
-
En ambos casos, la solución es
|
|
223
|
+
En ambos casos, la solución es reinstalarlo (ver abajo).
|
|
224
224
|
4. **`prepublishOnly` → `scripts/check-install.mjs`**: empaqueta, instala como OpenCode
|
|
225
225
|
(npm, `--ignore-scripts`) en un directorio temporal y falla si hay más de una copia de
|
|
226
226
|
effect o si el plugin no se importa. Una dependencia desalineada no llega a publicarse.
|
|
227
|
-
- **Tras actualizar OpenCode
|
|
228
|
-
`~/.cache/opencode/npm/opencode-apex@*`
|
|
229
|
-
|
|
227
|
+
- **Tras actualizar OpenCode** (o para pasar a una apex nueva): con OpenCode parado, borra
|
|
228
|
+
`~/.cache/opencode/npm/opencode-apex@*` y arráncalo. Reinstala apex con el
|
|
229
|
+
`@opencode/plugin` nuevo. En 2.1.1, `opencode plugin update` responde
|
|
230
|
+
`Plugin is not configured` para los plugins de servidor: solo gestiona los de TUI (`cli.json`).
|
|
230
231
|
- **Rotura de API (OpenCode 3.x)**: el rango `^2` no la absorbe a propósito. Eso exige
|
|
231
232
|
revisar el código, no solo las dependencias.
|
package/index.ts
CHANGED
|
@@ -26,7 +26,7 @@ import { registerSkills } from "./core/skills.js"
|
|
|
26
26
|
import { compatibilityWarnings } from "./core/compat.js"
|
|
27
27
|
|
|
28
28
|
// Plugin version
|
|
29
|
-
const VERSION = "0.2.
|
|
29
|
+
const VERSION = "0.2.1"
|
|
30
30
|
|
|
31
31
|
interface ModuleConfigs {
|
|
32
32
|
redact: RedactConfig & { enabled: boolean }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-apex",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Modular monolithic plugin for OpenCode V2 — redaction, events, advisor permissions, guard meta-permissions, external browser over CDP",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|