agentswarm-cli 1.3.15 → 1.4.6
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/bin/{agency → agentswarm} +16 -5
- package/package.json +15 -14
- package/postinstall.mjs +27 -22
|
@@ -18,13 +18,22 @@ function run(target) {
|
|
|
18
18
|
process.exit(code)
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
const envPath = process.env.
|
|
21
|
+
const envPath = process.env.AGENTSWARM_BIN_PATH
|
|
22
22
|
if (envPath) {
|
|
23
23
|
run(envPath)
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const scriptPath = fs.realpathSync(fileURLToPath(import.meta.url))
|
|
27
27
|
const scriptDir = path.dirname(scriptPath)
|
|
28
|
+
const packageJsonPath = path.join(scriptDir, "..", "package.json")
|
|
29
|
+
const scope = (() => {
|
|
30
|
+
try {
|
|
31
|
+
const pkg = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"))
|
|
32
|
+
return typeof pkg.platformScope === "string" ? pkg.platformScope : ""
|
|
33
|
+
} catch {
|
|
34
|
+
return ""
|
|
35
|
+
}
|
|
36
|
+
})()
|
|
28
37
|
const cached = path.join(scriptDir, ".agentswarm")
|
|
29
38
|
if (fs.existsSync(cached)) {
|
|
30
39
|
run(cached)
|
|
@@ -49,8 +58,8 @@ let arch = archMap[os.arch()]
|
|
|
49
58
|
if (!arch) {
|
|
50
59
|
arch = os.arch()
|
|
51
60
|
}
|
|
52
|
-
const base = "
|
|
53
|
-
const binary = platform === "windows" ? "
|
|
61
|
+
const base = "agentswarm-cli-" + platform + "-" + arch
|
|
62
|
+
const binary = platform === "windows" ? "agentswarm.exe" : "agentswarm"
|
|
54
63
|
|
|
55
64
|
function supportsAvx2() {
|
|
56
65
|
if (arch !== "x64") return false
|
|
@@ -143,12 +152,14 @@ const names = (() => {
|
|
|
143
152
|
return [base]
|
|
144
153
|
})()
|
|
145
154
|
|
|
155
|
+
const packageNames = scope ? names.map((name) => `${scope}/${name}`) : names
|
|
156
|
+
|
|
146
157
|
function findBinary(startDir) {
|
|
147
158
|
let current = startDir
|
|
148
159
|
for (;;) {
|
|
149
160
|
const modules = path.join(current, "node_modules")
|
|
150
161
|
if (fs.existsSync(modules)) {
|
|
151
|
-
for (const name of
|
|
162
|
+
for (const name of packageNames) {
|
|
152
163
|
const candidate = path.join(modules, name, "bin", binary)
|
|
153
164
|
if (fs.existsSync(candidate)) return candidate
|
|
154
165
|
}
|
|
@@ -165,7 +176,7 @@ const resolved = findBinary(scriptDir)
|
|
|
165
176
|
if (!resolved) {
|
|
166
177
|
console.error(
|
|
167
178
|
"It seems that your package manager failed to install the right version of the agentswarm-cli package for your platform. You can try manually installing " +
|
|
168
|
-
|
|
179
|
+
packageNames.map((name) => `"${name}"`).join(" or ") +
|
|
169
180
|
" package",
|
|
170
181
|
)
|
|
171
182
|
process.exit(1)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentswarm-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Agent Swarm CLI for the terminal.",
|
|
@@ -17,25 +17,26 @@
|
|
|
17
17
|
"terminal"
|
|
18
18
|
],
|
|
19
19
|
"bin": {
|
|
20
|
-
"agentswarm": "./bin/
|
|
20
|
+
"agentswarm": "./bin/agentswarm"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
|
|
24
24
|
},
|
|
25
25
|
"optionalDependencies": {
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
26
|
+
"@vrsen/agentswarm-cli-linux-arm64-musl": "1.4.6",
|
|
27
|
+
"@vrsen/agentswarm-cli-windows-x64": "1.4.6",
|
|
28
|
+
"@vrsen/agentswarm-cli-windows-arm64": "1.4.6",
|
|
29
|
+
"@vrsen/agentswarm-cli-darwin-x64": "1.4.6",
|
|
30
|
+
"@vrsen/agentswarm-cli-linux-x64": "1.4.6",
|
|
31
|
+
"@vrsen/agentswarm-cli-darwin-arm64": "1.4.6",
|
|
32
|
+
"@vrsen/agentswarm-cli-linux-x64-musl": "1.4.6",
|
|
33
|
+
"@vrsen/agentswarm-cli-linux-x64-baseline": "1.4.6",
|
|
34
|
+
"@vrsen/agentswarm-cli-linux-x64-baseline-musl": "1.4.6",
|
|
35
|
+
"@vrsen/agentswarm-cli-darwin-x64-baseline": "1.4.6",
|
|
36
|
+
"@vrsen/agentswarm-cli-linux-arm64": "1.4.6",
|
|
37
|
+
"@vrsen/agentswarm-cli-windows-x64-baseline": "1.4.6"
|
|
38
38
|
},
|
|
39
|
+
"platformScope": "@vrsen",
|
|
39
40
|
"publishConfig": {
|
|
40
41
|
"access": "public"
|
|
41
42
|
}
|
package/postinstall.mjs
CHANGED
|
@@ -9,6 +9,8 @@ import { createRequire } from "module"
|
|
|
9
9
|
|
|
10
10
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
11
11
|
const require = createRequire(import.meta.url)
|
|
12
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"), "utf8"))
|
|
13
|
+
const scope = pkg.platformScope || ""
|
|
12
14
|
|
|
13
15
|
function detectPlatformAndArch() {
|
|
14
16
|
// Map platform names
|
|
@@ -50,8 +52,8 @@ function detectPlatformAndArch() {
|
|
|
50
52
|
|
|
51
53
|
function findBinary() {
|
|
52
54
|
const { platform, arch } = detectPlatformAndArch()
|
|
53
|
-
const binaryName = platform === "windows" ? "
|
|
54
|
-
const base = `
|
|
55
|
+
const binaryName = platform === "windows" ? "agentswarm.exe" : "agentswarm"
|
|
56
|
+
const base = `agentswarm-cli-${platform}-${arch}`
|
|
55
57
|
const baseline = arch === "x64" && !supportsAvx2(platform, arch)
|
|
56
58
|
const names = packageNames(platform, arch, base, baseline)
|
|
57
59
|
|
|
@@ -119,26 +121,31 @@ function supportsAvx2(platform, arch) {
|
|
|
119
121
|
}
|
|
120
122
|
|
|
121
123
|
function packageNames(platform, arch, base, baseline) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
if (
|
|
126
|
-
if (
|
|
127
|
-
|
|
124
|
+
const names = (() => {
|
|
125
|
+
if (platform === "linux") {
|
|
126
|
+
const musl = isMusl()
|
|
127
|
+
if (arch === "x64") {
|
|
128
|
+
if (musl) {
|
|
129
|
+
if (baseline) return [`${base}-baseline-musl`, `${base}-musl`, `${base}-baseline`, base]
|
|
130
|
+
return [`${base}-musl`, `${base}-baseline-musl`, base, `${base}-baseline`]
|
|
131
|
+
}
|
|
132
|
+
if (baseline) return [`${base}-baseline`, base, `${base}-baseline-musl`, `${base}-musl`]
|
|
133
|
+
return [base, `${base}-baseline`, `${base}-musl`, `${base}-baseline-musl`]
|
|
128
134
|
}
|
|
129
|
-
if (
|
|
130
|
-
return [base, `${base}-
|
|
135
|
+
if (musl) return [`${base}-musl`, base]
|
|
136
|
+
return [base, `${base}-musl`]
|
|
131
137
|
}
|
|
132
|
-
if (musl) return [`${base}-musl`, base]
|
|
133
|
-
return [base, `${base}-musl`]
|
|
134
|
-
}
|
|
135
138
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
if (arch === "x64") {
|
|
140
|
+
if (baseline) return [`${base}-baseline`, base]
|
|
141
|
+
return [base, `${base}-baseline`]
|
|
142
|
+
}
|
|
140
143
|
|
|
141
|
-
|
|
144
|
+
return [base]
|
|
145
|
+
})()
|
|
146
|
+
|
|
147
|
+
if (!scope) return names
|
|
148
|
+
return names.map((name) => `${scope}/${name}`)
|
|
142
149
|
}
|
|
143
150
|
|
|
144
151
|
function isMusl() {
|
|
@@ -181,9 +188,7 @@ async function main() {
|
|
|
181
188
|
}
|
|
182
189
|
}
|
|
183
190
|
|
|
184
|
-
|
|
185
|
-
main()
|
|
186
|
-
} catch (error) {
|
|
191
|
+
await main().catch((error) => {
|
|
187
192
|
console.error("Postinstall script error:", error.message)
|
|
188
193
|
process.exit(0)
|
|
189
|
-
}
|
|
194
|
+
})
|