gaia-framework 1.51.0 → 1.53.0

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 CHANGED
@@ -460,7 +460,7 @@ The single source of truth is `_gaia/_config/global.yaml`:
460
460
 
461
461
  ```yaml
462
462
  framework_name: "GAIA"
463
- framework_version: "1.51.0"
463
+ framework_version: "1.53.0"
464
464
  user_name: "your-name"
465
465
  project_name: "your-project"
466
466
  ```
@@ -5,10 +5,10 @@
5
5
  // Clones the GAIA repo, delegates to gaia-install.sh, and cleans up.
6
6
  // ─────────────────────────────────────────────────────────────────────────────
7
7
 
8
- const { execSync, execFileSync } = require("child_process");
9
- const { mkdtempSync, rmSync, existsSync } = require("fs");
10
- const { join } = require("path");
11
- const { tmpdir } = require("os");
8
+ const childProcess = require("child_process");
9
+ const fs = require("fs");
10
+ const path = require("path");
11
+ const os = require("os");
12
12
 
13
13
  const REPO_URL = "https://github.com/jlouage/Gaia-framework.git";
14
14
  const SCRIPT_NAME = "gaia-install.sh";
@@ -23,19 +23,19 @@ function findBash() {
23
23
 
24
24
  // Try bash in PATH first (WSL, Git Bash in PATH, etc.)
25
25
  try {
26
- execSync("bash --version", { stdio: "ignore" });
26
+ childProcess.execSync("bash --version", { stdio: "ignore" });
27
27
  return "bash";
28
28
  } catch {}
29
29
 
30
30
  // Try Git for Windows default locations
31
31
  const gitBashPaths = [
32
- join(process.env.ProgramFiles || "C:\\Program Files", "Git", "bin", "bash.exe"),
33
- join(process.env["ProgramFiles(x86)"] || "C:\\Program Files (x86)", "Git", "bin", "bash.exe"),
34
- join(process.env.LOCALAPPDATA || "", "Programs", "Git", "bin", "bash.exe"),
32
+ path.join(process.env.ProgramFiles || "C:\\Program Files", "Git", "bin", "bash.exe"),
33
+ path.join(process.env["ProgramFiles(x86)"] || "C:\\Program Files (x86)", "Git", "bin", "bash.exe"),
34
+ path.join(process.env.LOCALAPPDATA || "", "Programs", "Git", "bin", "bash.exe"),
35
35
  ];
36
36
 
37
37
  for (const p of gitBashPaths) {
38
- if (existsSync(p)) return p;
38
+ if (fs.existsSync(p)) return p;
39
39
  }
40
40
 
41
41
  return null;
@@ -51,9 +51,9 @@ function info(message) {
51
51
  }
52
52
 
53
53
  function cleanup() {
54
- if (tempDir && existsSync(tempDir)) {
54
+ if (tempDir && fs.existsSync(tempDir)) {
55
55
  try {
56
- rmSync(tempDir, { recursive: true, force: true });
56
+ fs.rmSync(tempDir, { recursive: true, force: true });
57
57
  } catch {
58
58
  // Best-effort cleanup
59
59
  }
@@ -62,7 +62,7 @@ function cleanup() {
62
62
 
63
63
  function ensureGit() {
64
64
  try {
65
- execSync("git --version", { stdio: "ignore" });
65
+ childProcess.execSync("git --version", { stdio: "ignore" });
66
66
  } catch {
67
67
  fail(
68
68
  "git is required but was not found.\n" +
@@ -72,8 +72,7 @@ function ensureGit() {
72
72
  }
73
73
 
74
74
  function readPackageVersion(pkgPath) {
75
- const { readFileSync } = require("fs");
76
- const raw = readFileSync(pkgPath, "utf8");
75
+ const raw = fs.readFileSync(pkgPath, "utf8");
77
76
  const pkg = JSON.parse(raw);
78
77
  if (!pkg.version) {
79
78
  throw new Error(`No version field found in ${pkgPath}`);
@@ -111,7 +110,15 @@ Examples:
111
110
 
112
111
  // ─── Main ───────────────────────────────────────────────────────────────────
113
112
 
114
- function main() {
113
+ function main(deps) {
114
+ // Dependency injection for testability — defaults to real modules
115
+ const _exec = deps && deps.execSync || childProcess.execSync;
116
+ const _execFile = deps && deps.execFileSync || childProcess.execFileSync;
117
+ const _mkdtemp = deps && deps.mkdtempSync || fs.mkdtempSync;
118
+ const _exists = deps && deps.existsSync || fs.existsSync;
119
+ const _join = deps && deps.join || path.join;
120
+ const _tmpdir = deps && deps.tmpdir || os.tmpdir;
121
+
115
122
  const args = process.argv.slice(2);
116
123
 
117
124
  // Handle help / no args
@@ -137,7 +144,7 @@ function main() {
137
144
  ensureGit();
138
145
 
139
146
  // Clone the repo to a temp directory
140
- tempDir = mkdtempSync(join(tmpdir(), "gaia-framework-"));
147
+ tempDir = _mkdtemp(_join(_tmpdir(), "gaia-framework-"));
141
148
 
142
149
  // Register cleanup for all exit scenarios
143
150
  process.on("exit", cleanup);
@@ -147,7 +154,7 @@ function main() {
147
154
  info("Cloning GAIA framework from GitHub...");
148
155
 
149
156
  try {
150
- execSync(`git clone --depth 1 ${REPO_URL} "${tempDir}"`, {
157
+ _exec(`git clone --depth 1 ${REPO_URL} "${tempDir}"`, {
151
158
  stdio: ["ignore", "ignore", "pipe"],
152
159
  });
153
160
  } catch (err) {
@@ -158,8 +165,8 @@ function main() {
158
165
  }
159
166
 
160
167
  // Locate the installer script
161
- const scriptPath = join(tempDir, SCRIPT_NAME);
162
- if (!existsSync(scriptPath)) {
168
+ const scriptPath = _join(tempDir, SCRIPT_NAME);
169
+ if (!_exists(scriptPath)) {
163
170
  fail(`Installer script not found in cloned repo: ${SCRIPT_NAME}`);
164
171
  }
165
172
 
@@ -182,7 +189,7 @@ function main() {
182
189
  info("Running installer...\n");
183
190
 
184
191
  try {
185
- execFileSync(bashPath, [scriptPath, ...passthrough], {
192
+ _execFile(bashPath, [scriptPath, ...passthrough], {
186
193
  stdio: "inherit",
187
194
  env: { ...process.env, GAIA_SOURCE: tempDir },
188
195
  });
@@ -191,4 +198,8 @@ function main() {
191
198
  }
192
199
  }
193
200
 
194
- main();
201
+ if (require.main === module) {
202
+ main();
203
+ }
204
+
205
+ module.exports = { findBash, ensureGit, showUsage, fail, info, cleanup, readPackageVersion, main };
package/gaia-install.sh CHANGED
@@ -6,7 +6,7 @@ set -euo pipefail
6
6
  # Installs, updates, validates, and reports on GAIA installations.
7
7
  # ─────────────────────────────────────────────────────────────────────────────
8
8
 
9
- readonly VERSION="1.51.0"
9
+ readonly VERSION="1.53.0"
10
10
  readonly GITHUB_REPO="https://github.com/jlouage/Gaia-framework.git"
11
11
  readonly MANIFEST_REL="_gaia/_config/manifest.yaml"
12
12
 
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "gaia-framework",
3
- "version": "1.51.0",
3
+ "version": "1.53.0",
4
4
  "description": "GAIA — Generative Agile Intelligence Architecture installer",
5
5
  "bin": {
6
6
  "gaia-framework": "./bin/gaia-framework.js"
7
7
  },
8
8
  "scripts": {
9
- "test": "vitest run",
9
+ "test": "vitest run --coverage",
10
10
  "test:watch": "vitest",
11
11
  "test:coverage": "vitest run --coverage",
12
12
  "test:unit": "vitest run test/unit",