gaia-framework 1.53.0 → 1.53.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 +2 -2
- package/bin/gaia-framework.js +46 -35
- package/gaia-install.sh +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# GAIA — Generative Agile Intelligence Architecture
|
|
2
2
|
|
|
3
|
-
[]()
|
|
4
4
|
[]()
|
|
5
5
|
[]()
|
|
6
6
|
[]()
|
|
@@ -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.
|
|
463
|
+
framework_version: "1.49.0"
|
|
464
464
|
user_name: "your-name"
|
|
465
465
|
project_name: "your-project"
|
|
466
466
|
```
|
package/bin/gaia-framework.js
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
// Clones the GAIA repo, delegates to gaia-install.sh, and cleans up.
|
|
6
6
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
8
|
+
const { execSync, execFileSync } = require("child_process");
|
|
9
|
+
const { mkdtempSync, rmSync, existsSync, realpathSync } = require("fs");
|
|
10
|
+
const { join } = require("path");
|
|
11
|
+
const { tmpdir } = require("os");
|
|
12
12
|
|
|
13
13
|
const REPO_URL = "https://github.com/jlouage/Gaia-framework.git";
|
|
14
14
|
const SCRIPT_NAME = "gaia-install.sh";
|
|
@@ -18,24 +18,30 @@ let tempDir = null;
|
|
|
18
18
|
|
|
19
19
|
// ─── Helpers ────────────────────────────────────────────────────────────────
|
|
20
20
|
|
|
21
|
+
function toPosixPath(p) {
|
|
22
|
+
if (!IS_WINDOWS) return p;
|
|
23
|
+
// Convert C:\foo\bar to /c/foo/bar for Git Bash
|
|
24
|
+
return p.replace(/\\/g, "/").replace(/^([A-Za-z]):/, (_, letter) => "/" + letter.toLowerCase());
|
|
25
|
+
}
|
|
26
|
+
|
|
21
27
|
function findBash() {
|
|
22
28
|
if (!IS_WINDOWS) return "bash";
|
|
23
29
|
|
|
24
30
|
// Try bash in PATH first (WSL, Git Bash in PATH, etc.)
|
|
25
31
|
try {
|
|
26
|
-
|
|
32
|
+
execSync("bash --version", { stdio: "ignore" });
|
|
27
33
|
return "bash";
|
|
28
34
|
} catch {}
|
|
29
35
|
|
|
30
36
|
// Try Git for Windows default locations
|
|
31
37
|
const gitBashPaths = [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
join(process.env.ProgramFiles || "C:\\Program Files", "Git", "bin", "bash.exe"),
|
|
39
|
+
join(process.env["ProgramFiles(x86)"] || "C:\\Program Files (x86)", "Git", "bin", "bash.exe"),
|
|
40
|
+
join(process.env.LOCALAPPDATA || "", "Programs", "Git", "bin", "bash.exe"),
|
|
35
41
|
];
|
|
36
42
|
|
|
37
43
|
for (const p of gitBashPaths) {
|
|
38
|
-
if (
|
|
44
|
+
if (existsSync(p)) return p;
|
|
39
45
|
}
|
|
40
46
|
|
|
41
47
|
return null;
|
|
@@ -51,9 +57,9 @@ function info(message) {
|
|
|
51
57
|
}
|
|
52
58
|
|
|
53
59
|
function cleanup() {
|
|
54
|
-
if (tempDir &&
|
|
60
|
+
if (tempDir && existsSync(tempDir)) {
|
|
55
61
|
try {
|
|
56
|
-
|
|
62
|
+
rmSync(tempDir, { recursive: true, force: true });
|
|
57
63
|
} catch {
|
|
58
64
|
// Best-effort cleanup
|
|
59
65
|
}
|
|
@@ -62,7 +68,7 @@ function cleanup() {
|
|
|
62
68
|
|
|
63
69
|
function ensureGit() {
|
|
64
70
|
try {
|
|
65
|
-
|
|
71
|
+
execSync("git --version", { stdio: "ignore" });
|
|
66
72
|
} catch {
|
|
67
73
|
fail(
|
|
68
74
|
"git is required but was not found.\n" +
|
|
@@ -72,7 +78,8 @@ function ensureGit() {
|
|
|
72
78
|
}
|
|
73
79
|
|
|
74
80
|
function readPackageVersion(pkgPath) {
|
|
75
|
-
const
|
|
81
|
+
const { readFileSync } = require("fs");
|
|
82
|
+
const raw = readFileSync(pkgPath, "utf8");
|
|
76
83
|
const pkg = JSON.parse(raw);
|
|
77
84
|
if (!pkg.version) {
|
|
78
85
|
throw new Error(`No version field found in ${pkgPath}`);
|
|
@@ -110,15 +117,7 @@ Examples:
|
|
|
110
117
|
|
|
111
118
|
// ─── Main ───────────────────────────────────────────────────────────────────
|
|
112
119
|
|
|
113
|
-
function main(
|
|
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
|
-
|
|
120
|
+
function main() {
|
|
122
121
|
const args = process.argv.slice(2);
|
|
123
122
|
|
|
124
123
|
// Handle help / no args
|
|
@@ -144,7 +143,11 @@ function main(deps) {
|
|
|
144
143
|
ensureGit();
|
|
145
144
|
|
|
146
145
|
// Clone the repo to a temp directory
|
|
147
|
-
tempDir =
|
|
146
|
+
tempDir = mkdtempSync(join(tmpdir(), "gaia-framework-"));
|
|
147
|
+
// Resolve 8.3 short names to long paths on Windows (e.g., ELIASN~1 → Elias Nasser)
|
|
148
|
+
if (IS_WINDOWS) {
|
|
149
|
+
try { tempDir = realpathSync(tempDir); } catch {}
|
|
150
|
+
}
|
|
148
151
|
|
|
149
152
|
// Register cleanup for all exit scenarios
|
|
150
153
|
process.on("exit", cleanup);
|
|
@@ -154,7 +157,7 @@ function main(deps) {
|
|
|
154
157
|
info("Cloning GAIA framework from GitHub...");
|
|
155
158
|
|
|
156
159
|
try {
|
|
157
|
-
|
|
160
|
+
execSync(`git clone --depth 1 ${REPO_URL} "${tempDir}"`, {
|
|
158
161
|
stdio: ["ignore", "ignore", "pipe"],
|
|
159
162
|
});
|
|
160
163
|
} catch (err) {
|
|
@@ -165,16 +168,16 @@ function main(deps) {
|
|
|
165
168
|
}
|
|
166
169
|
|
|
167
170
|
// Locate the installer script
|
|
168
|
-
const scriptPath =
|
|
169
|
-
if (!
|
|
171
|
+
const scriptPath = join(tempDir, SCRIPT_NAME);
|
|
172
|
+
if (!existsSync(scriptPath)) {
|
|
170
173
|
fail(`Installer script not found in cloned repo: ${SCRIPT_NAME}`);
|
|
171
174
|
}
|
|
172
175
|
|
|
173
176
|
// Build the shell command: inject --source pointing to the temp clone
|
|
174
177
|
// so the shell script doesn't need to clone again
|
|
175
178
|
const passthrough = args.slice(0);
|
|
176
|
-
// Insert --source right after the command
|
|
177
|
-
passthrough.splice(1, 0, "--source", tempDir);
|
|
179
|
+
// Insert --source right after the command (convert to POSIX for bash on Windows)
|
|
180
|
+
passthrough.splice(1, 0, "--source", toPosixPath(tempDir));
|
|
178
181
|
|
|
179
182
|
// Locate bash (critical for Windows support)
|
|
180
183
|
const bashPath = findBash();
|
|
@@ -189,17 +192,25 @@ function main(deps) {
|
|
|
189
192
|
info("Running installer...\n");
|
|
190
193
|
|
|
191
194
|
try {
|
|
192
|
-
|
|
195
|
+
// Convert all passthrough args that look like paths (contain backslash or drive letter)
|
|
196
|
+
const posixArgs = passthrough.map(a => IS_WINDOWS && /[\\:]/.test(a) && !a.startsWith("--") ? toPosixPath(a) : a);
|
|
197
|
+
const posixScript = toPosixPath(scriptPath);
|
|
198
|
+
|
|
199
|
+
// Debug: on Windows, log the resolved paths if --verbose is passed
|
|
200
|
+
if (IS_WINDOWS && args.includes("--verbose")) {
|
|
201
|
+
info(`Bash: ${bashPath}`);
|
|
202
|
+
info(`Script (Windows): ${scriptPath}`);
|
|
203
|
+
info(`Script (POSIX): ${posixScript}`);
|
|
204
|
+
info(`Temp dir: ${tempDir}`);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
execFileSync(bashPath, [posixScript, ...posixArgs], {
|
|
193
208
|
stdio: "inherit",
|
|
194
|
-
env: { ...process.env, GAIA_SOURCE: tempDir },
|
|
209
|
+
env: { ...process.env, GAIA_SOURCE: toPosixPath(tempDir) },
|
|
195
210
|
});
|
|
196
211
|
} catch (err) {
|
|
197
212
|
process.exit(err.status || 1);
|
|
198
213
|
}
|
|
199
214
|
}
|
|
200
215
|
|
|
201
|
-
|
|
202
|
-
main();
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
module.exports = { findBash, ensureGit, showUsage, fail, info, cleanup, readPackageVersion, main };
|
|
216
|
+
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.53.
|
|
9
|
+
readonly VERSION="1.53.2"
|
|
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.53.
|
|
3
|
+
"version": "1.53.2",
|
|
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",
|
|
10
10
|
"test:watch": "vitest",
|
|
11
11
|
"test:coverage": "vitest run --coverage",
|
|
12
12
|
"test:unit": "vitest run test/unit",
|