zugzbot 1.0.26 → 1.0.27

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.
@@ -12,14 +12,20 @@ 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.27"
16
16
  try {
17
+ // Try to read from our dynamic version metadata file
18
+ const localVersionPath = path.join(process.cwd(), ".opencode/version.json")
19
+ if (fs.existsSync(localVersionPath)) {
20
+ const versionData = JSON.parse(fs.readFileSync(localVersionPath, "utf-8"))
21
+ if (versionData && versionData.version) return versionData.version
22
+ }
17
23
  const localPkgPath = path.join(process.cwd(), "package.json")
18
24
  if (fs.existsSync(localPkgPath)) {
19
25
  const pkg = JSON.parse(fs.readFileSync(localPkgPath, "utf-8"))
20
- if (pkg.name === "zugzbot-sdd") return pkg.version
26
+ if (pkg.name === "zugzbot" || pkg.name === "zugzbot-sdd") return pkg.version
21
27
  }
22
- const depPkgPath = path.join(process.cwd(), "node_modules/zugzbot-sdd/package.json")
28
+ const depPkgPath = path.join(process.cwd(), "node_modules/zugzbot/package.json")
23
29
  if (fs.existsSync(depPkgPath)) {
24
30
  const pkg = JSON.parse(fs.readFileSync(depPkgPath, "utf-8"))
25
31
  return pkg.version || fallback
@@ -191,24 +191,6 @@ export const SddBridgePlugin: Plugin = async ({ project, client, $, directory, w
191
191
  writeMetrics(metrics)
192
192
  }
193
193
 
194
- // Ensure .openspec/active-brief.md exists physically on load to prevent OpenCode startup crash on raw workspaces
195
- const activeBriefPath = path.resolve(projectRoot, ".openspec/active-brief.md")
196
- if (!fs.existsSync(activeBriefPath)) {
197
- try {
198
- const openspecDir = path.dirname(activeBriefPath)
199
- if (!fs.existsSync(openspecDir)) {
200
- fs.mkdirSync(openspecDir, { recursive: true })
201
- }
202
- fs.writeFileSync(
203
- activeBriefPath,
204
- "# SDD Active Brief\n\nNo hay ninguna sesión activa o el spec actual no ha sido iniciado.\n",
205
- "utf8"
206
- )
207
- } catch (e) {
208
- // best-effort
209
- }
210
- }
211
-
212
194
  // Helper to synchronize models automatically from models.json
213
195
  const syncModelsFromConfig = () => {
214
196
  try {
package/bin/init.js CHANGED
@@ -19,14 +19,23 @@ const bold = '\x1b[1m';
19
19
  const pkgRoot = join(__dirname, '..');
20
20
  const targetDir = process.cwd();
21
21
 
22
+ // Read version from package.json dynamically
23
+ let version = '1.0.27';
24
+ try {
25
+ const pkg = JSON.parse(fs.readFileSync(join(pkgRoot, 'package.json'), 'utf8'));
26
+ version = pkg.version || version;
27
+ } catch (e) {
28
+ // fallback
29
+ }
30
+
22
31
  const banner = `
23
32
  ${bold}${orange}███████╗██╗ ██╗ ██████╗ ███████╗
24
33
  ╚══███╔╝██║ ██║██╔════╝ ╚══███╔╝
25
34
  ███╔╝ ██║ ██║██║ ███╗ ███╔╝
26
- ███╔╝ ██║ ██║██║ ██║ ███╔╝
35
+ ███╔╝ ██║ ██║██║ ██║ ███╔╝
27
36
  ███████╗╚██████╔╝╚██████╔╝███████╗
28
37
  ╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝${reset}
29
- ${bold}${yellow} Harness Installer v1.0.7${reset}\n`;
38
+ ${bold}${yellow} Harness Installer v${version}${reset}\n`;
30
39
 
31
40
  console.log(banner);
32
41
  console.log(`${bold}${cyan}🔍 Detectando entorno de trabajo...${reset}`);
@@ -88,6 +97,15 @@ for (const item of itemsToCopy) {
88
97
  console.error(`${red}❌ Error copying ${item.name}: ${error.message}${reset}`);
89
98
  }
90
99
  }
100
+
101
+ // Write version metadata to target's .opencode/version.json
102
+ try {
103
+ const versionPath = join(targetDir, '.opencode', 'version.json');
104
+ fs.writeFileSync(versionPath, JSON.stringify({ version }, null, 2), 'utf8');
105
+ } catch (error) {
106
+ // silent best-effort
107
+ }
108
+
91
109
  // Ensure .openspec/ is ignored in the target's .gitignore to avoid propagating local state
92
110
  try {
93
111
  const gitignorePath = join(targetDir, '.gitignore');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zugzbot",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "Fácil instalador del arnés SDD de Zugzbot para proyectos OpenCode",
5
5
  "type": "module",
6
6
  "bin": {