@the-agenticflow/openflows 0.1.0 → 0.1.1
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/package.json +1 -1
- package/scripts/install.js +25 -33
package/package.json
CHANGED
package/scripts/install.js
CHANGED
|
@@ -126,44 +126,36 @@ async function main() {
|
|
|
126
126
|
try {
|
|
127
127
|
await download(downloadUrl, tmpFile);
|
|
128
128
|
await extractTarGz(tmpFile, BIN_DIR);
|
|
129
|
+
} catch (err) {
|
|
130
|
+
// For x86_64 Linux, try musl fallback
|
|
131
|
+
if (platform === 'x86_64-unknown-linux-gnu') {
|
|
132
|
+
const muslArchiveName = `openflows-${tag}-x86_64-unknown-linux-musl.tar.gz`;
|
|
133
|
+
const muslDownloadUrl = `https://github.com/${REPO}/releases/download/${tag}/${muslArchiveName}`;
|
|
134
|
+
const muslTmpFile = path.join(os.tmpdir(), muslArchiveName);
|
|
135
|
+
console.log(`[@the-agenticflow/openflows] Trying musl fallback...`);
|
|
136
|
+
await download(muslDownloadUrl, muslTmpFile);
|
|
137
|
+
await extractTarGz(muslTmpFile, BIN_DIR);
|
|
138
|
+
fs.unlinkSync(muslTmpFile);
|
|
139
|
+
} else {
|
|
140
|
+
throw err;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
129
143
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
144
|
+
// Rename binaries to match expected names
|
|
145
|
+
const binaries = ['agentflow', 'agentflow-setup', 'agentflow-dashboard', 'agentflow-doctor'];
|
|
146
|
+
for (const bin of binaries) {
|
|
147
|
+
const src = path.join(BIN_DIR, bin);
|
|
148
|
+
const dst = path.join(BIN_DIR, `${bin}-bin`);
|
|
149
|
+
if (fs.existsSync(src)) {
|
|
150
|
+
fs.renameSync(src, dst);
|
|
151
|
+
fs.chmodSync(dst, 0o755);
|
|
139
152
|
}
|
|
153
|
+
}
|
|
140
154
|
|
|
155
|
+
if (fs.existsSync(tmpFile)) {
|
|
141
156
|
fs.unlinkSync(tmpFile);
|
|
142
|
-
console.log(`[openflows] Installation complete!`);
|
|
143
|
-
} catch (err) {
|
|
144
|
-
console.error(`[openflows] Failed to download binary: ${err.message}`);
|
|
145
|
-
console.error('[openflows] Falling back to building from source...');
|
|
146
|
-
|
|
147
|
-
// Fallback: build from source
|
|
148
|
-
try {
|
|
149
|
-
execSync('cargo build --release -p openflows', { stdio: 'inherit', cwd: path.join(__dirname, '..') });
|
|
150
|
-
const releaseDir = path.join(__dirname, '..', 'target', 'release');
|
|
151
|
-
const binaries = ['openflows', 'openflows-setup', 'openflows-dashboard', 'openflows-doctor'];
|
|
152
|
-
for (const bin of binaries) {
|
|
153
|
-
const src = path.join(releaseDir, bin);
|
|
154
|
-
const dst = path.join(BIN_DIR, `${bin}-bin`);
|
|
155
|
-
if (fs.existsSync(src)) {
|
|
156
|
-
fs.copyFileSync(src, dst);
|
|
157
|
-
fs.chmodSync(dst, 0o755);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
console.log('[openflows] Built from source successfully!');
|
|
161
|
-
} catch (buildErr) {
|
|
162
|
-
console.error(`[openflows] Build failed: ${buildErr.message}`);
|
|
163
|
-
console.error('[openflows] Please ensure Rust is installed: https://rustup.rs/');
|
|
164
|
-
process.exit(1);
|
|
165
|
-
}
|
|
166
157
|
}
|
|
158
|
+
console.log(`[openflows] Installation complete!`);
|
|
167
159
|
}
|
|
168
160
|
|
|
169
161
|
main();
|