zugzbot 1.0.0 → 1.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/README.md +99 -23
- package/bin/init.js +8 -6
- package/package.json +2 -3
- package/.utils/docs_opencode/acp.md +0 -165
- package/.utils/docs_opencode/acp.pdf +0 -0
- package/.utils/docs_opencode/agents.md +0 -803
- package/.utils/docs_opencode/agents.pdf +0 -0
- package/.utils/docs_opencode/commands.md +0 -354
- package/.utils/docs_opencode/commands.pdf +0 -0
- package/.utils/docs_opencode/custom-tools.md +0 -209
- package/.utils/docs_opencode/custom-tools.pdf +0 -0
- package/.utils/docs_opencode/ecosystem.md +0 -81
- package/.utils/docs_opencode/ecosystem.pdf +0 -0
- package/.utils/docs_opencode/formatters.md +0 -142
- package/.utils/docs_opencode/formatters.pdf +0 -0
- package/.utils/docs_opencode/keybinds.md +0 -205
- package/.utils/docs_opencode/keybinds.pdf +0 -0
- package/.utils/docs_opencode/lsp.md +0 -202
- package/.utils/docs_opencode/lsp.pdf +0 -0
- package/.utils/docs_opencode/mcp-servers.md +0 -565
- package/.utils/docs_opencode/mcp-servers.pdf +0 -0
- package/.utils/docs_opencode/models.md +0 -234
- package/.utils/docs_opencode/models.pdf +0 -0
- package/.utils/docs_opencode/permissions.md +0 -248
- package/.utils/docs_opencode/permissions.pdf +0 -0
- package/.utils/docs_opencode/plugins.md +0 -409
- package/.utils/docs_opencode/plugins.pdf +0 -0
- package/.utils/docs_opencode/rules.md +0 -189
- package/.utils/docs_opencode/rules.pdf +0 -0
- package/.utils/docs_opencode/sdk.md +0 -522
- package/.utils/docs_opencode/sdk.pdf +0 -0
- package/.utils/docs_opencode/server.md +0 -324
- package/.utils/docs_opencode/server.pdf +0 -0
- package/.utils/docs_opencode/skills.md +0 -235
- package/.utils/docs_opencode/skills.pdf +0 -0
- package/.utils/docs_opencode/themes.md +0 -378
- package/.utils/docs_opencode/themes.pdf +0 -0
- package/.utils/docs_opencode/tools.md +0 -364
- package/.utils/docs_opencode/tools.pdf +0 -0
- package/.utils/export_opencode_session.py +0 -242
- package/.utils/toggle_model.py +0 -208
package/.utils/toggle_model.py
DELETED
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
import sys
|
|
3
|
-
import os
|
|
4
|
-
import json
|
|
5
|
-
import re
|
|
6
|
-
|
|
7
|
-
# ==============================================================================
|
|
8
|
-
# CONFIGURACIÓN DE MODELOS POR DEFECTO
|
|
9
|
-
# ==============================================================================
|
|
10
|
-
# Modelo global que se aplicará a todos los agentes por defecto.
|
|
11
|
-
# (Se puede cambiar ejecutando: python3 utils/toggle_model.py <nombre_modelo>)
|
|
12
|
-
GLOBAL_MODEL = "deepseek/deepseek-v4-flash"
|
|
13
|
-
|
|
14
|
-
# Personalización individual por agente.
|
|
15
|
-
# Escribe el nombre exacto del modelo si quieres que un agente use uno distinto.
|
|
16
|
-
# Si el valor está vacío (""), se usará el GLOBAL_MODEL.
|
|
17
|
-
PER_AGENT_MODELS = {
|
|
18
|
-
"sdd-orchestrator": "",
|
|
19
|
-
"sdd-spec-writer": "",
|
|
20
|
-
"sdd-coder": "",
|
|
21
|
-
"sdd-tester": "",
|
|
22
|
-
"sdd-deployer": "",
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
# ==============================================================================
|
|
26
|
-
# LISTA DE MODELOS DISPONIBLES EN OPENCODE
|
|
27
|
-
# ==============================================================================
|
|
28
|
-
AVAILABLE_MODELS = [
|
|
29
|
-
"opencode/big-pickle",
|
|
30
|
-
"opencode/deepseek-v4-flash-free",
|
|
31
|
-
"opencode/mimo-v2.5-free",
|
|
32
|
-
"opencode/nemotron-3-ultra-free",
|
|
33
|
-
"opencode/north-mini-code-free",
|
|
34
|
-
"deepseek/deepseek-chat",
|
|
35
|
-
"deepseek/deepseek-reasoner",
|
|
36
|
-
"deepseek/deepseek-v4-flash",
|
|
37
|
-
"deepseek/deepseek-v4-pro",
|
|
38
|
-
"google/gemini-2.5-flash",
|
|
39
|
-
"google/gemini-2.5-flash-image",
|
|
40
|
-
"google/gemini-2.5-flash-lite",
|
|
41
|
-
"google/gemini-2.5-flash-preview-tts",
|
|
42
|
-
"google/gemini-2.5-pro",
|
|
43
|
-
"google/gemini-2.5-pro-preview-tts",
|
|
44
|
-
"google/gemini-3-flash-preview",
|
|
45
|
-
"google/gemini-3-pro-image-preview",
|
|
46
|
-
"google/gemini-3.1-flash-image-preview",
|
|
47
|
-
"google/gemini-3.1-flash-lite",
|
|
48
|
-
"google/gemini-3.1-pro-preview",
|
|
49
|
-
"google/gemini-3.1-pro-preview-customtools",
|
|
50
|
-
"google/gemini-3.5-flash",
|
|
51
|
-
"google/gemini-embedding-001",
|
|
52
|
-
"google/gemini-flash-latest",
|
|
53
|
-
"google/gemini-flash-lite-latest",
|
|
54
|
-
"google/gemma-4-26b-a4b-it",
|
|
55
|
-
"google/gemma-4-31b-it",
|
|
56
|
-
"minimax/MiniMax-M2",
|
|
57
|
-
"minimax/MiniMax-M2.1",
|
|
58
|
-
"minimax/MiniMax-M2.5",
|
|
59
|
-
"minimax/MiniMax-M2.5-highspeed",
|
|
60
|
-
"minimax/MiniMax-M2.7",
|
|
61
|
-
"minimax/MiniMax-M2.7-highspeed",
|
|
62
|
-
"minimax/MiniMax-M3",
|
|
63
|
-
"minimax-coding-plan/MiniMax-M2",
|
|
64
|
-
"minimax-coding-plan/MiniMax-M2.1",
|
|
65
|
-
"minimax-coding-plan/MiniMax-M2.5",
|
|
66
|
-
"minimax-coding-plan/MiniMax-M2.5-highspeed",
|
|
67
|
-
"minimax-coding-plan/MiniMax-M2.7",
|
|
68
|
-
"minimax-coding-plan/MiniMax-M2.7-highspeed",
|
|
69
|
-
"minimax-coding-plan/MiniMax-M3",
|
|
70
|
-
]
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
def get_paths():
|
|
74
|
-
script_dir = os.path.dirname(os.path.abspath(__file__))
|
|
75
|
-
project_root = os.path.dirname(script_dir)
|
|
76
|
-
opencode_json = os.path.join(project_root, "opencode.json")
|
|
77
|
-
agents_dir = os.path.join(project_root, ".opencode", "agents")
|
|
78
|
-
return opencode_json, agents_dir
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
def search_model(query):
|
|
82
|
-
query = query.lower()
|
|
83
|
-
matches = [m for m in AVAILABLE_MODELS if query in m.lower()]
|
|
84
|
-
return matches
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
def apply_model(agent_models):
|
|
88
|
-
opencode_json, agents_dir = get_paths()
|
|
89
|
-
|
|
90
|
-
if not os.path.exists(opencode_json):
|
|
91
|
-
print(f"Error: No se encontró {opencode_json}", file=sys.stderr)
|
|
92
|
-
sys.exit(1)
|
|
93
|
-
|
|
94
|
-
# 1. Actualizar opencode.json
|
|
95
|
-
with open(opencode_json, 'r', encoding='utf-8') as f:
|
|
96
|
-
data = json.load(f)
|
|
97
|
-
|
|
98
|
-
agents_config = data.get("agent", {})
|
|
99
|
-
for agent_name, agent_cfg in agents_config.items():
|
|
100
|
-
if agent_name in agent_models:
|
|
101
|
-
agent_cfg["model"] = agent_models[agent_name]
|
|
102
|
-
|
|
103
|
-
with open(opencode_json, 'w', encoding='utf-8') as f:
|
|
104
|
-
json.dump(data, f, indent=2)
|
|
105
|
-
print(" -> opencode.json actualizado con éxito.")
|
|
106
|
-
|
|
107
|
-
# 2. Actualizar frontmatter de agentes (.md)
|
|
108
|
-
if os.path.exists(agents_dir):
|
|
109
|
-
for filename in os.listdir(agents_dir):
|
|
110
|
-
if filename.endswith(".md"):
|
|
111
|
-
# Quitar extensión .md para comparar con el nombre del agente
|
|
112
|
-
agent_name = filename[:-3]
|
|
113
|
-
if agent_name in agent_models:
|
|
114
|
-
target_model = agent_models[agent_name]
|
|
115
|
-
filepath = os.path.join(agents_dir, filename)
|
|
116
|
-
|
|
117
|
-
with open(filepath, 'r', encoding='utf-8') as f:
|
|
118
|
-
content = f.read()
|
|
119
|
-
|
|
120
|
-
frontmatter_pattern = re.compile(
|
|
121
|
-
r"^---$(.*?)^---$", re.MULTILINE | re.DOTALL
|
|
122
|
-
)
|
|
123
|
-
match = frontmatter_pattern.search(content)
|
|
124
|
-
if match:
|
|
125
|
-
frontmatter = match.group(1)
|
|
126
|
-
if "model:" in frontmatter:
|
|
127
|
-
new_frontmatter = re.sub(
|
|
128
|
-
r"^model:.*?$",
|
|
129
|
-
f"model: {target_model}",
|
|
130
|
-
frontmatter,
|
|
131
|
-
flags=re.MULTILINE,
|
|
132
|
-
)
|
|
133
|
-
new_content = content.replace(
|
|
134
|
-
frontmatter, new_frontmatter, 1
|
|
135
|
-
)
|
|
136
|
-
with open(filepath, 'w', encoding='utf-8') as f:
|
|
137
|
-
f.write(new_content)
|
|
138
|
-
print(f" -> {filename} actualizado a: {target_model}")
|
|
139
|
-
else:
|
|
140
|
-
print(f"Advertencia: Directorio de agentes {agents_dir} no existe.")
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
def print_available_models():
|
|
144
|
-
print("\nModelos disponibles:")
|
|
145
|
-
for m in AVAILABLE_MODELS:
|
|
146
|
-
print(f" - {m}")
|
|
147
|
-
print()
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
def main():
|
|
151
|
-
args = sys.argv[1:]
|
|
152
|
-
|
|
153
|
-
# Si se pide listar modelos
|
|
154
|
-
if args and args[0] in ("--list", "-l", "list"):
|
|
155
|
-
print_available_models()
|
|
156
|
-
sys.exit(0)
|
|
157
|
-
|
|
158
|
-
# Determinar el modelo global a usar
|
|
159
|
-
global_model_selected = GLOBAL_MODEL
|
|
160
|
-
if args:
|
|
161
|
-
query = args[0]
|
|
162
|
-
matches = search_model(query)
|
|
163
|
-
|
|
164
|
-
if not matches:
|
|
165
|
-
print(
|
|
166
|
-
f"Error: Ningún modelo coincide con '{query}'. Use 'list' para ver todos.",
|
|
167
|
-
file=sys.stderr,
|
|
168
|
-
)
|
|
169
|
-
sys.exit(1)
|
|
170
|
-
elif len(matches) == 1:
|
|
171
|
-
global_model_selected = matches[0]
|
|
172
|
-
else:
|
|
173
|
-
# Si hay múltiples coincidencias, tomamos la primera pero listamos las demás
|
|
174
|
-
global_model_selected = matches[0]
|
|
175
|
-
print(f"Coincidencias encontradas para '{query}':")
|
|
176
|
-
for m in matches:
|
|
177
|
-
print(f" * {m}")
|
|
178
|
-
print(
|
|
179
|
-
f"Seleccionando automáticamente la primera: {global_model_selected}\n"
|
|
180
|
-
)
|
|
181
|
-
|
|
182
|
-
# Construir el mapeo de modelos final para cada agente
|
|
183
|
-
final_agent_models = {}
|
|
184
|
-
print("Mapeo de modelos por agente:")
|
|
185
|
-
|
|
186
|
-
for agent_name in PER_AGENT_MODELS.keys():
|
|
187
|
-
# Si tiene override en el script, usarlo
|
|
188
|
-
custom_model = PER_AGENT_MODELS[agent_name]
|
|
189
|
-
if custom_model:
|
|
190
|
-
# Validar que el modelo custom existe
|
|
191
|
-
if custom_model not in AVAILABLE_MODELS:
|
|
192
|
-
print(
|
|
193
|
-
f"Advertencia: El modelo personalizado '{custom_model}' para '{agent_name}' no está en la lista oficial.",
|
|
194
|
-
file=sys.stderr,
|
|
195
|
-
)
|
|
196
|
-
final_agent_models[agent_name] = custom_model
|
|
197
|
-
print(f" * {agent_name} -> {custom_model} (personalizado)")
|
|
198
|
-
else:
|
|
199
|
-
final_agent_models[agent_name] = global_model_selected
|
|
200
|
-
print(f" * {agent_name} -> {global_model_selected} (global)")
|
|
201
|
-
|
|
202
|
-
print("\nAplicando cambios...")
|
|
203
|
-
apply_model(final_agent_models)
|
|
204
|
-
print("\nModelos configurados exitosamente! 🎉")
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
if __name__ == "__main__":
|
|
208
|
-
main()
|