zugzbot 1.0.6 → 1.0.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 (63) hide show
  1. package/.opencode/commands/web.md +17 -0
  2. package/.opencode/plugins/sdd-bridge.ts +83 -1
  3. package/.utils/docs_opencode/acp.md +165 -0
  4. package/.utils/docs_opencode/acp.pdf +0 -0
  5. package/.utils/docs_opencode/agents.md +803 -0
  6. package/.utils/docs_opencode/agents.pdf +0 -0
  7. package/.utils/docs_opencode/commands.md +354 -0
  8. package/.utils/docs_opencode/commands.pdf +0 -0
  9. package/.utils/docs_opencode/custom-tools.md +209 -0
  10. package/.utils/docs_opencode/custom-tools.pdf +0 -0
  11. package/.utils/docs_opencode/ecosystem.md +81 -0
  12. package/.utils/docs_opencode/ecosystem.pdf +0 -0
  13. package/.utils/docs_opencode/formatters.md +142 -0
  14. package/.utils/docs_opencode/formatters.pdf +0 -0
  15. package/.utils/docs_opencode/keybinds.md +205 -0
  16. package/.utils/docs_opencode/keybinds.pdf +0 -0
  17. package/.utils/docs_opencode/lsp.md +202 -0
  18. package/.utils/docs_opencode/lsp.pdf +0 -0
  19. package/.utils/docs_opencode/mcp-servers.md +565 -0
  20. package/.utils/docs_opencode/mcp-servers.pdf +0 -0
  21. package/.utils/docs_opencode/models.md +234 -0
  22. package/.utils/docs_opencode/models.pdf +0 -0
  23. package/.utils/docs_opencode/permissions.md +248 -0
  24. package/.utils/docs_opencode/permissions.pdf +0 -0
  25. package/.utils/docs_opencode/plugins.md +409 -0
  26. package/.utils/docs_opencode/plugins.pdf +0 -0
  27. package/.utils/docs_opencode/rules.md +189 -0
  28. package/.utils/docs_opencode/rules.pdf +0 -0
  29. package/.utils/docs_opencode/sdk.md +522 -0
  30. package/.utils/docs_opencode/sdk.pdf +0 -0
  31. package/.utils/docs_opencode/server.md +324 -0
  32. package/.utils/docs_opencode/server.pdf +0 -0
  33. package/.utils/docs_opencode/skills.md +235 -0
  34. package/.utils/docs_opencode/skills.pdf +0 -0
  35. package/.utils/docs_opencode/themes.md +378 -0
  36. package/.utils/docs_opencode/themes.pdf +0 -0
  37. package/.utils/docs_opencode/tools.md +364 -0
  38. package/.utils/docs_opencode/tools.pdf +0 -0
  39. package/.utils/export_opencode_session.py +242 -0
  40. package/.utils/toggle_model.py +441 -0
  41. package/.utils/zugzweb/client/README.md +73 -0
  42. package/.utils/zugzweb/client/eslint.config.js +22 -0
  43. package/.utils/zugzweb/client/index.html +13 -0
  44. package/.utils/zugzweb/client/package-lock.json +3707 -0
  45. package/.utils/zugzweb/client/package.json +36 -0
  46. package/.utils/zugzweb/client/public/favicon.svg +1 -0
  47. package/.utils/zugzweb/client/public/icons.svg +24 -0
  48. package/.utils/zugzweb/client/src/App.tsx +1357 -0
  49. package/.utils/zugzweb/client/src/assets/hero.png +0 -0
  50. package/.utils/zugzweb/client/src/assets/react.svg +1 -0
  51. package/.utils/zugzweb/client/src/assets/vite.svg +1 -0
  52. package/.utils/zugzweb/client/src/index.css +185 -0
  53. package/.utils/zugzweb/client/src/main.tsx +10 -0
  54. package/.utils/zugzweb/client/tsconfig.app.json +25 -0
  55. package/.utils/zugzweb/client/tsconfig.json +7 -0
  56. package/.utils/zugzweb/client/tsconfig.node.json +24 -0
  57. package/.utils/zugzweb/client/vite.config.ts +11 -0
  58. package/.utils/zugzweb/daemon.js +297 -0
  59. package/README.md +40 -1
  60. package/bin/init.js +25 -6
  61. package/models.json +8 -0
  62. package/opencode.json +5 -7
  63. package/package.json +3 -1
@@ -0,0 +1,17 @@
1
+ ---
2
+ description: Inicia el centro de control web remoto de ZugzWeb
3
+ ---
4
+
5
+ # 🤖 PANEL DE CONTROL WEB REMOTO (ZUGZWEB)
6
+
7
+ Iniciando el servidor web local y abriendo el túnel seguro de Cloudflare en segundo plano para que puedas controlar y monitorear esta sesión de Opencode desde cualquier lugar del mundo (con internet)...
8
+
9
+ !`node .utils/zugzweb/daemon.js > /dev/null 2>&1 &`
10
+
11
+ ### 🌍 ¿Cómo ingresar de forma remota?
12
+ 1. El Daemon se ha levantado en segundo plano en el puerto **4097**.
13
+ 2. Un túnel seguro de Cloudflare Quick Tunnel se está abriendo automáticamente.
14
+ 3. **Revisa tu terminal local**: Verás un banner impreso en color verde brillante con la URL pública remota de tipo:
15
+ `👉 https://your-session-id.trycloudflare.com 👈`
16
+ 4. Abre esa URL en tu teléfono móvil o laptop remota.
17
+ 5. ¡Podrás enviar prompts, ver el pensamiento del agente, monitorear los costos en tiempo real y habilitar alertas del navegador!
@@ -209,6 +209,88 @@ export const SddBridgePlugin: Plugin = async ({ project, client, $, directory, w
209
209
  }
210
210
  }
211
211
 
212
+ // Helper to synchronize models automatically from models.json
213
+ const syncModelsFromConfig = () => {
214
+ try {
215
+ const modelsPath = path.resolve(projectRoot, "models.json")
216
+ const altModelsPath = path.resolve(projectRoot, ".opencode/models.json")
217
+ let selectedModelsPath = ""
218
+
219
+ if (fs.existsSync(modelsPath)) {
220
+ selectedModelsPath = modelsPath
221
+ } else if (fs.existsSync(altModelsPath)) {
222
+ selectedModelsPath = altModelsPath
223
+ } else {
224
+ return // No config file, do nothing silently
225
+ }
226
+
227
+ const modelsContent = fs.readFileSync(selectedModelsPath, "utf8")
228
+ const modelsData = JSON.parse(modelsContent)
229
+ const globalModel = modelsData.global || "deepseek/deepseek-v4-flash"
230
+
231
+ // 1. Update opencode.json
232
+ const opencodeJsonPath = path.resolve(projectRoot, "opencode.json")
233
+ if (fs.existsSync(opencodeJsonPath)) {
234
+ const opencodeContent = fs.readFileSync(opencodeJsonPath, "utf8")
235
+ const opencodeData = JSON.parse(opencodeContent)
236
+ let updated = false
237
+
238
+ if (opencodeData.agent && typeof opencodeData.agent === "object") {
239
+ for (const agentName of Object.keys(opencodeData.agent)) {
240
+ const configModel = modelsData[agentName]
241
+ const targetModel = configModel && configModel.trim() !== "" ? configModel : globalModel
242
+
243
+ if (opencodeData.agent[agentName].model !== targetModel) {
244
+ opencodeData.agent[agentName].model = targetModel
245
+ updated = true
246
+ }
247
+ }
248
+ }
249
+
250
+ if (updated) {
251
+ fs.writeFileSync(opencodeJsonPath, JSON.stringify(opencodeData, null, 2), "utf8")
252
+ logPhase("MODEL_SYNC", "Sincronizados modelos en opencode.json desde models.json")
253
+ }
254
+ }
255
+
256
+ // 2. Update agent markdown files (.opencode/agents/*.md)
257
+ const agentsDir = path.resolve(projectRoot, ".opencode/agents")
258
+ if (fs.existsSync(agentsDir)) {
259
+ const files = fs.readdirSync(agentsDir)
260
+ for (const file of files) {
261
+ if (file.endsWith(".md")) {
262
+ const agentName = file.slice(0, -3)
263
+ const configModel = modelsData[agentName]
264
+ const targetModel = configModel && configModel.trim() !== "" ? configModel : globalModel
265
+ const filepath = path.join(agentsDir, file)
266
+ const content = fs.readFileSync(filepath, "utf8")
267
+
268
+ const frontmatterPattern = /^---$([\s\S]*?)^---$/m
269
+ const match = frontmatterPattern.exec(content)
270
+ if (match) {
271
+ const frontmatter = match[1]
272
+ if (frontmatter.includes("model:")) {
273
+ const modelLinePattern = /^model:\s*(.*?)$/m
274
+ const modelLineMatch = modelLinePattern.exec(frontmatter)
275
+ if (modelLineMatch && modelLineMatch[1].trim() !== targetModel) {
276
+ const newFrontmatter = frontmatter.replace(modelLinePattern, `model: ${targetModel}`)
277
+ const newContent = content.replace(frontmatter, newFrontmatter)
278
+ fs.writeFileSync(filepath, newContent, "utf8")
279
+ logPhase("MODEL_SYNC", `Sincronizado agente ${file} a modelo: ${targetModel}`)
280
+ }
281
+ }
282
+ }
283
+ }
284
+ }
285
+ }
286
+ } catch (e) {
287
+ // Best-effort: don't crash on model sync failures
288
+ }
289
+ }
290
+
291
+ // Run model sync from models.json automatically on plugin load
292
+ syncModelsFromConfig()
293
+
212
294
  // Ensure metrics file matches current contract on plugin load
213
295
  maybeResetMetrics()
214
296
 
@@ -233,7 +315,7 @@ export const SddBridgePlugin: Plugin = async ({ project, client, $, directory, w
233
315
  const currentState = readState()
234
316
 
235
317
  // Enforce: No code edits allowed unless we are in the implementation phase (F2_IMPLEMENTATION)
236
- if (isWritingCode && !targetFilePath.includes("tests") && !targetFilePath.includes("specs") && !targetFilePath.includes(".opencode") && !targetFilePath.includes(".openspec") && !targetFilePath.includes("config.ts") && !targetFilePath.includes("config.js")) {
318
+ if (isWritingCode && !targetFilePath.includes("tests") && !targetFilePath.includes("specs") && !targetFilePath.includes(".opencode") && !targetFilePath.includes(".openspec") && !targetFilePath.includes(".utils") && !targetFilePath.includes("config.ts") && !targetFilePath.includes("config.js")) {
237
319
  if (currentState.phase !== "F2_IMPLEMENTATION") {
238
320
  throw new Error(
239
321
  `[SDD Contract Violation] No se permite escribir o editar código de la aplicación. Fase actual: '${currentState.phase}'. Debe transicionar a 'F2_IMPLEMENTATION' una vez que el contrato esté aprobado.`
@@ -0,0 +1,165 @@
1
+ # Soporte ACP
2
+
3
+ Utilice OpenCode en cualquier editor compatible con ACP.
4
+
5
+ OpenCode admite el [Agent Client Protocol](https://agentclientprotocol.com) o (ACP), lo que le permite usarlo directamente en editores e IDE compatibles.
6
+
7
+ > [!TIP]
8
+ > Para obtener una lista de editores y herramientas compatibles con ACP, consulte el [informe de progreso de ACP](https://zed.dev/blog/acp-progress-report#available-now).
9
+
10
+ ACP es un protocolo abierto que estandariza la comunicación entre editores de código y agentes de codificación de IA.
11
+
12
+ ---
13
+
14
+ ## [Configuración](#configuración)
15
+
16
+ Para usar OpenCode a través de ACP, configure su editor para ejecutar el comando `opencode acp`.
17
+
18
+ El comando inicia OpenCode como un subproceso compatible con ACP que se comunica con su editor a través de JSON-RPC a través de stdio.
19
+
20
+ A continuación se muestran ejemplos de editores populares que admiten ACP.
21
+
22
+ ---
23
+
24
+ ### [Zed](#zed)
25
+
26
+ Agregue a su configuración [Zed](https://zed.dev) (`~/.config/zed/settings.json`):
27
+
28
+ **File**: ~/.config/zed/settings.json
29
+
30
+ ```json
31
+ {
32
+ "agent_servers": {
33
+ "OpenCode": {
34
+ "command": "opencode",
35
+ "args": ["acp"]
36
+ }
37
+ }
38
+ }
39
+ ```
40
+
41
+ Para abrirlo, use la acción `agent: new thread` en la **Paleta de comandos**.
42
+
43
+ También puedes vincular un atajo de teclado editando tu `keymap.json`:
44
+
45
+ **File**: keymap.json
46
+
47
+ ```json
48
+ [
49
+ {
50
+ "bindings": {
51
+ "cmd-alt-o": [
52
+ "agent::NewExternalAgentThread",
53
+ {
54
+ "agent": {
55
+ "custom": {
56
+ "name": "OpenCode",
57
+ "command": {
58
+ "command": "opencode",
59
+ "args": ["acp"]
60
+ }
61
+ }
62
+ }
63
+ }
64
+ ]
65
+ }
66
+ }
67
+ ]
68
+ ```
69
+
70
+ ---
71
+
72
+ ### [JetBrains IDEs](#jetbrains-ides)
73
+
74
+ Agregue a su [JetBrains IDE](https://www.jetbrains.com/) acp.json de acuerdo con la [documentación](https://www.jetbrains.com/help/ai-assistant/acp.html):
75
+
76
+ **File**: acp.json
77
+
78
+ ```json
79
+ {
80
+ "agent_servers": {
81
+ "OpenCode": {
82
+ "command": "/absolute/path/bin/opencode",
83
+ "args": ["acp"]
84
+ }
85
+ }
86
+ }
87
+ ```
88
+
89
+ Para abrirlo, use el nuevo agente ‘OpenCode’ en el selector de agentes de AI Chat.
90
+
91
+ ---
92
+
93
+ ### [Avante.nvim](#avantenvim)
94
+
95
+ Agregue a su configuración [Avante.nvim](https://github.com/yetone/avante.nvim):
96
+
97
+ **File**:
98
+
99
+ ```lua
100
+ {
101
+ acp_providers = {
102
+ ["opencode"] = {
103
+ command = "opencode",
104
+ args = { "acp" }
105
+ }
106
+ }
107
+ }
108
+ ```
109
+
110
+ Si necesita pasar variables de entorno:
111
+
112
+ **File**:
113
+
114
+ ```lua
115
+ {
116
+ acp_providers = {
117
+ ["opencode"] = {
118
+ command = "opencode",
119
+ args = { "acp" },
120
+ env = {
121
+ OPENCODE_API_KEY = os.getenv("OPENCODE_API_KEY")
122
+ }
123
+ }
124
+ }
125
+ }
126
+ ```
127
+
128
+ ---
129
+
130
+ ### [CodeCompanion.nvim](#codecompanionnvim)
131
+
132
+ Para usar OpenCode como agente ACP en [CodeCompanion.nvim](https://github.com/olimorris/codecompanion.nvim), agregue lo siguiente a su configuración de Neovim:
133
+
134
+ **File**:
135
+
136
+ ```lua
137
+ require("codecompanion").setup({
138
+ interactions = {
139
+ chat = {
140
+ adapter = {
141
+ name = "opencode",
142
+ model = "claude-sonnet-4",
143
+ },
144
+ },
145
+ },
146
+ })
147
+ ```
148
+
149
+ Esta configuración configura CodeCompanion para usar OpenCode como agente ACP para el chat.
150
+
151
+ Si necesita pasar variables de entorno (como `OPENCODE_API_KEY`), consulte [Configuración de adaptadores: variables de entorno](https://codecompanion.olimorris.dev/getting-started#setting-an-api-key) en la documentación de CodeCompanion.nvim para obtener detalles completos.
152
+
153
+ ## [Soporte](#soporte)
154
+
155
+ OpenCode funciona igual a través de ACP que en la terminal. Todas las funciones son compatibles:
156
+
157
+ > [!NOTE]
158
+ > Algunos comandos de barra integrados como `/undo` y `/redo` no son compatibles actualmente.
159
+
160
+ - Herramientas integradas (operaciones de archivos, comandos de terminal, etc.)
161
+ - Herramientas personalizadas y comandos de barra
162
+ - Servidores MCP configurados en su configuración OpenCode
163
+ - Reglas específicas del proyecto de `AGENTS.md`
164
+ - Formateadores y linters personalizados
165
+ - Sistema de agentes y permisos.
Binary file