@circuitorg/agent-cli 1.0.1 → 1.0.3
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/circuit +46 -0
- package/package.json +1 -1
package/circuit
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import fs from 'fs';
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
|
|
8
|
+
// Get __dirname equivalent in ES modules
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
11
|
+
|
|
12
|
+
function getBinaryName() {
|
|
13
|
+
const platform = process.platform;
|
|
14
|
+
const arch = process.arch;
|
|
15
|
+
|
|
16
|
+
if (platform === 'linux' && arch === 'x64') return 'circuit-linux-x64';
|
|
17
|
+
if (platform === 'linux' && arch === 'arm64') return 'circuit-linux-arm64';
|
|
18
|
+
if (platform === 'darwin' && arch === 'x64') return 'circuit-darwin-x64';
|
|
19
|
+
if (platform === 'darwin' && arch === 'arm64') return 'circuit-darwin-arm64';
|
|
20
|
+
if (platform === 'win32' && arch === 'x64') return 'circuit-win32-x64.exe';
|
|
21
|
+
|
|
22
|
+
console.error(`Unsupported platform: ${platform}-${arch}`);
|
|
23
|
+
console.error('Supported platforms: linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64');
|
|
24
|
+
if (platform === 'win32' && arch === 'arm64') {
|
|
25
|
+
console.error('Note: Windows ARM64 is not yet supported by Bun. Use x64 version via emulation.');
|
|
26
|
+
}
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const binaryName = getBinaryName();
|
|
31
|
+
const binaryPath = path.join(__dirname, binaryName);
|
|
32
|
+
|
|
33
|
+
if (!fs.existsSync(binaryPath)) {
|
|
34
|
+
console.error(`Binary not found: ${binaryPath}`);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
// Execute the appropriate binary with all arguments
|
|
40
|
+
execSync(`"${binaryPath}" ${process.argv.slice(2).join(' ')}`, {
|
|
41
|
+
stdio: 'inherit',
|
|
42
|
+
cwd: process.cwd()
|
|
43
|
+
});
|
|
44
|
+
} catch (error) {
|
|
45
|
+
process.exit(error.status || 1);
|
|
46
|
+
}
|