zugzbot 1.0.29 → 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.
- package/.opencode/plugins/plugin_tui.tsx +9 -7
- package/bin/init.js +26 -1
- package/package.json +1 -1
|
@@ -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 = "
|
|
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
|
|
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
|
|
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');
|