zugzbot 1.0.28 → 1.0.30

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.
@@ -41,6 +41,7 @@ Eres el coordinador principal del arnés de desarrollo SDD (Spec-Driven Developm
41
41
  - **Ruta de Capturas**: Guarda cualquier screenshot de Playwright en `.openspec/ts-<nombre>.png`.
42
42
  - **Sistema de Memoria (Brain)**: Consulta el cerebro con `sdd_get_initial_session_data` al inicio (F0/F1) para entender el historial del proyecto. Guarda los aprendizajes clave al final en `<completion>` con `brain_save_memory`.
43
43
  - **Modo Autopiloto (`/loop`)**: Si se detecta `loopMode: true` o comando `/loop`, autotomará el 100% de las decisiones recomendadas por defecto. Tienes PROHIBIDO usar la tool `question` en autopiloto.
44
+ - **Modo Libre / Fast-Track**: Si detectas que el estado es `F2_IMPLEMENTATION` y el contrato activo contiene `fast-track` (Modo Libre), reconócelo como el estado normal de Modo Libre/Fast-Track para consultas generales y ediciones libres de código. NO reportes esto como un estado inválido, roto o stale, ni te quejes de que falta el contrato. En su lugar, dale la bienvenida al usuario, explícale que tiene libertad total para programar o consultar, y ofrécele opcionalmente guiarle en un flujo estructurado de desarrollo formal (F0->F4) si lo desea.
44
45
  </constraints>
45
46
 
46
47
  <workflow>
@@ -12,17 +12,19 @@ const PluginTuiSidebar: TuiPlugin = async (api) => {
12
12
  const [sessionIds, setSessionIds] = createSignal<string[]>([props.session_id])
13
13
 
14
14
  const getZugzbotVersion = (): string => {
15
- const fallback = "2.0.18"
15
+ const fallback = "1.0.30"
16
16
  try {
17
+ // 1. Try reading the dynamic version.json written during install
18
+ const versionJsonPath = path.join(process.cwd(), ".opencode/version.json")
19
+ if (fs.existsSync(versionJsonPath)) {
20
+ const data = JSON.parse(fs.readFileSync(versionJsonPath, "utf-8"))
21
+ if (data && data.version) return data.version
22
+ }
23
+ // 2. Fallback to package.json in dev mode
17
24
  const localPkgPath = path.join(process.cwd(), "package.json")
18
25
  if (fs.existsSync(localPkgPath)) {
19
26
  const pkg = JSON.parse(fs.readFileSync(localPkgPath, "utf-8"))
20
- if (pkg.name === "zugzbot-sdd") return pkg.version
21
- }
22
- const depPkgPath = path.join(process.cwd(), "node_modules/zugzbot-sdd/package.json")
23
- if (fs.existsSync(depPkgPath)) {
24
- const pkg = JSON.parse(fs.readFileSync(depPkgPath, "utf-8"))
25
- return pkg.version || fallback
27
+ if (pkg.name === "zugzbot") return pkg.version
26
28
  }
27
29
  } catch { }
28
30
  return fallback
package/bin/init.js CHANGED
@@ -19,6 +19,18 @@ const bold = '\x1b[1m';
19
19
  const pkgRoot = join(__dirname, '..');
20
20
  const targetDir = process.cwd();
21
21
 
22
+ // Load dynamic version from package.json
23
+ let pkgVersion = '1.0.30';
24
+ try {
25
+ const pkgJsonPath = join(pkgRoot, 'package.json');
26
+ if (fs.existsSync(pkgJsonPath)) {
27
+ const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8'));
28
+ pkgVersion = pkg.version || pkgVersion;
29
+ }
30
+ } catch (e) {
31
+ // ignore
32
+ }
33
+
22
34
  const banner = `
23
35
  ${bold}${orange}███████╗██╗ ██╗ ██████╗ ███████╗
24
36
  ╚══███╔╝██║ ██║██╔════╝ ╚══███╔╝
@@ -26,7 +38,7 @@ ${bold}${orange}███████╗██╗ ██╗ ██████
26
38
  ███╔╝ ██║ ██║██║ ██║ ███╔╝
27
39
  ███████╗╚██████╔╝╚██████╔╝███████╗
28
40
  ╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝${reset}
29
- ${bold}${yellow} Harness Installer v1.0.7${reset}\n`;
41
+ ${bold}${yellow} Harness Installer v${pkgVersion}${reset}\n`;
30
42
 
31
43
  console.log(banner);
32
44
  console.log(`${bold}${cyan}🔍 Detectando entorno de trabajo...${reset}`);
@@ -88,6 +100,19 @@ for (const item of itemsToCopy) {
88
100
  console.error(`${red}❌ Error copying ${item.name}: ${error.message}${reset}`);
89
101
  }
90
102
  }
103
+
104
+ // Write .opencode/version.json dynamically with the installed package version
105
+ try {
106
+ const versionJsonPath = join(targetDir, '.opencode/version.json');
107
+ const targetOpencodeDir = join(targetDir, '.opencode');
108
+ if (!fs.existsSync(targetOpencodeDir)) {
109
+ fs.mkdirSync(targetOpencodeDir, { recursive: true });
110
+ }
111
+ fs.writeFileSync(versionJsonPath, JSON.stringify({ version: pkgVersion }, null, 2), 'utf8');
112
+ } catch (error) {
113
+ console.error(`${red}❌ Error writing version metadata: ${error.message}${reset}`);
114
+ }
115
+
91
116
  // Ensure .openspec/ is ignored in the target's .gitignore to avoid propagating local state
92
117
  try {
93
118
  const gitignorePath = join(targetDir, '.gitignore');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zugzbot",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
4
4
  "description": "Fácil instalador del arnés SDD de Zugzbot para proyectos OpenCode",
5
5
  "type": "module",
6
6
  "bin": {