@apono-io/apono-mcp 0.1.2 → 0.2.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/lib/download.js +33 -2
- package/lib/paths.js +1 -1
- package/package.json +1 -1
package/lib/download.js
CHANGED
|
@@ -35,6 +35,17 @@ function getArch() {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
function validatePlatformArch(platform, arch) {
|
|
39
|
+
const unsupported = [
|
|
40
|
+
{ platform: "windows", arch: "armv7" },
|
|
41
|
+
];
|
|
42
|
+
for (const combo of unsupported) {
|
|
43
|
+
if (platform === combo.platform && arch === combo.arch) {
|
|
44
|
+
throw new Error(`Unsupported platform/architecture combination: ${platform}/${arch}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
38
49
|
function getArchiveExtension() {
|
|
39
50
|
return process.platform === "win32" ? "zip" : "tar.gz";
|
|
40
51
|
}
|
|
@@ -164,6 +175,7 @@ async function ensureBinary() {
|
|
|
164
175
|
|
|
165
176
|
const platformStr = getPlatform();
|
|
166
177
|
const archStr = getArch();
|
|
178
|
+
validatePlatformArch(platformStr, archStr);
|
|
167
179
|
const ext = getArchiveExtension();
|
|
168
180
|
const archiveName = `apono-agentic-cli_${latestVersion}_${platformStr}_${archStr}.${ext}`;
|
|
169
181
|
const downloadUrl = `${RELEASES_BASE_URL}/cli/v${latestVersion}/${archiveName}`;
|
|
@@ -189,8 +201,27 @@ async function ensureBinary() {
|
|
|
189
201
|
throw new Error(`Binary not found in archive at ${extractedBinary}`);
|
|
190
202
|
}
|
|
191
203
|
|
|
192
|
-
|
|
193
|
-
|
|
204
|
+
// Write to a temp file then atomically rename to avoid corruption
|
|
205
|
+
// if multiple processes run concurrently.
|
|
206
|
+
const tmpBinary = BINARY_PATH + ".tmp." + process.pid;
|
|
207
|
+
fs.copyFileSync(extractedBinary, tmpBinary);
|
|
208
|
+
fs.chmodSync(tmpBinary, 0o755);
|
|
209
|
+
|
|
210
|
+
// Remove macOS quarantine attribute so Gatekeeper doesn't block the binary
|
|
211
|
+
if (process.platform === "darwin") {
|
|
212
|
+
try {
|
|
213
|
+
execFileSync("xattr", ["-d", "com.apple.quarantine", tmpBinary], { timeout: 5000 });
|
|
214
|
+
} catch {
|
|
215
|
+
// Ignore — attribute may not exist
|
|
216
|
+
}
|
|
217
|
+
try {
|
|
218
|
+
execFileSync("xattr", ["-d", "com.apple.provenance", tmpBinary], { timeout: 5000 });
|
|
219
|
+
} catch {
|
|
220
|
+
// Ignore
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
fs.renameSync(tmpBinary, BINARY_PATH);
|
|
194
225
|
|
|
195
226
|
process.stderr.write(`Apono CLI v${latestVersion} installed to ${BINARY_PATH}\n`);
|
|
196
227
|
} finally {
|
package/lib/paths.js
CHANGED
|
@@ -5,7 +5,7 @@ const os = require("os");
|
|
|
5
5
|
|
|
6
6
|
const RELEASES_BASE_URL = "https://apono-agentic-releases.s3.amazonaws.com";
|
|
7
7
|
|
|
8
|
-
const BINARY_DIR = path.join(os.homedir(), ".
|
|
8
|
+
const BINARY_DIR = path.join(os.homedir(), ".local", "bin");
|
|
9
9
|
const BINARY_NAME = process.platform === "win32" ? "apono-agentic.exe" : "apono-agentic";
|
|
10
10
|
const BINARY_PATH = path.join(BINARY_DIR, BINARY_NAME);
|
|
11
11
|
|