cybara 1.0.1226 → 1.0.1231

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 ADDED
@@ -0,0 +1,51 @@
1
+ # Cybara
2
+
3
+ Self-hosted, open-source AI agent platform — the `cybara` command-line interface.
4
+
5
+ Cybara pairs a Bun agent runtime with a web dashboard, desktop and mobile apps, a broad tool layer, 25+ messaging-channel adapters, MCP support, and encrypted wallet controls — so agents can code, automate browsers, run messaging workflows, and execute on-chain operations under full operator control.
6
+
7
+ ## Install
8
+
9
+ Run it instantly with no install:
10
+
11
+ ```sh
12
+ npx cybara
13
+ # or
14
+ bunx cybara
15
+ ```
16
+
17
+ Or install globally:
18
+
19
+ ```sh
20
+ npm install -g cybara
21
+ # or
22
+ bun add -g cybara
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ ```sh
28
+ cybara # start the gateway (dashboard on http://localhost:4269)
29
+ cybara --help # list all commands
30
+ cybara --version # print the version
31
+ ```
32
+
33
+ ## How this package works
34
+
35
+ This package is a thin launcher. On install (or on first run) it downloads the matching prebuilt `cybara` binary for your platform from the official [GitHub release](https://github.com/metaspartan/cybara/releases) and verifies its SHA-256 checksum. Supported platforms:
36
+
37
+ - macOS — Apple Silicon (`arm64`) and Intel (`x64`)
38
+ - Linux — `x64` and `arm64`
39
+ - Windows — `x64`
40
+
41
+ The binary embeds the Bun runtime, so no separate Bun or Node runtime is required to run it.
42
+
43
+ ## Links
44
+
45
+ - Website: https://cybara.ai
46
+ - Source: https://github.com/metaspartan/cybara
47
+ - Issues: https://github.com/metaspartan/cybara/issues
48
+
49
+ ## License
50
+
51
+ MIT
package/bin/cybara.cjs CHANGED
@@ -2,21 +2,24 @@
2
2
  "use strict";
3
3
  const { spawnSync } = require("child_process");
4
4
  const { existsSync } = require("fs");
5
- const { join } = require("path");
5
+ const { download, binaryPath } = require("../scripts/download.cjs");
6
6
 
7
- const binaryName = process.platform === "win32" ? "cybara-bin.exe" : "cybara-bin";
8
- const binary = join(__dirname, binaryName);
9
-
10
- if (!existsSync(binary)) {
11
- console.error(
12
- "[cybara] Native binary not found. Reinstall to fetch it: npm install -g cybara"
13
- );
14
- process.exit(1);
7
+ async function main() {
8
+ const binary = binaryPath();
9
+ if (!existsSync(binary)) {
10
+ try {
11
+ await download({ silent: true });
12
+ } catch (error) {
13
+ console.error(`[cybara] Could not obtain the native binary: ${error.message}`);
14
+ process.exit(1);
15
+ }
16
+ }
17
+ const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
18
+ if (result.error) {
19
+ console.error(`[cybara] ${result.error.message}`);
20
+ process.exit(1);
21
+ }
22
+ process.exit(result.status === null ? 1 : result.status);
15
23
  }
16
24
 
17
- const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
18
- if (result.error) {
19
- console.error(`[cybara] ${result.error.message}`);
20
- process.exit(1);
21
- }
22
- process.exit(result.status === null ? 1 : result.status);
25
+ main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cybara",
3
- "version": "1.0.1226",
3
+ "version": "1.0.1231",
4
4
  "description": "Self-hosted, open-source AI agent platform — CLI",
5
5
  "bin": {
6
6
  "cybara": "bin/cybara.cjs"
@@ -10,7 +10,9 @@
10
10
  },
11
11
  "files": [
12
12
  "bin/cybara.cjs",
13
- "scripts/postinstall.cjs"
13
+ "scripts/download.cjs",
14
+ "scripts/postinstall.cjs",
15
+ "README.md"
14
16
  ],
15
17
  "keywords": [
16
18
  "ai",
@@ -20,11 +22,15 @@
20
22
  "mcp",
21
23
  "cybara"
22
24
  ],
25
+ "author": "Carsen Klock",
23
26
  "homepage": "https://cybara.ai",
24
27
  "repository": {
25
28
  "type": "git",
26
29
  "url": "git+https://github.com/metaspartan/cybara.git"
27
30
  },
31
+ "bugs": {
32
+ "url": "https://github.com/metaspartan/cybara/issues"
33
+ },
28
34
  "license": "MIT",
29
35
  "os": [
30
36
  "darwin",
@@ -37,5 +43,9 @@
37
43
  ],
38
44
  "engines": {
39
45
  "node": ">=18"
46
+ },
47
+ "publishConfig": {
48
+ "access": "public",
49
+ "provenance": true
40
50
  }
41
51
  }
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ const fs = require("fs");
3
+ const path = require("path");
4
+ const https = require("https");
5
+ const crypto = require("crypto");
6
+
7
+ const pkg = require(path.join(__dirname, "..", "package.json"));
8
+ const REPO = "metaspartan/cybara";
9
+
10
+ function slugFor(platform, arch) {
11
+ const map = {
12
+ "darwin:arm64": "darwin-arm64",
13
+ "darwin:x64": "darwin-x64",
14
+ "linux:arm64": "linux-arm64",
15
+ "linux:x64": "linux-x64",
16
+ "win32:x64": "windows-x64",
17
+ };
18
+ return map[`${platform}:${arch}`] || null;
19
+ }
20
+
21
+ function binaryPath() {
22
+ const name = process.platform === "win32" ? "cybara-bin.exe" : "cybara-bin";
23
+ return path.join(__dirname, "..", "bin", name);
24
+ }
25
+
26
+ function fetch(url) {
27
+ return new Promise((resolve, reject) => {
28
+ https
29
+ .get(url, { headers: { "User-Agent": "cybara-npm" } }, (res) => {
30
+ if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
31
+ res.resume();
32
+ resolve(fetch(res.headers.location));
33
+ return;
34
+ }
35
+ if (res.statusCode !== 200) {
36
+ res.resume();
37
+ reject(new Error(`HTTP ${res.statusCode} for ${url}`));
38
+ return;
39
+ }
40
+ const chunks = [];
41
+ res.on("data", (chunk) => chunks.push(chunk));
42
+ res.on("end", () => resolve(Buffer.concat(chunks)));
43
+ res.on("error", reject);
44
+ })
45
+ .on("error", reject);
46
+ });
47
+ }
48
+
49
+ async function download(options) {
50
+ const silent = options && options.silent;
51
+ const slug = slugFor(process.platform, process.arch);
52
+ if (!slug) {
53
+ throw new Error(`no prebuilt binary for ${process.platform}/${process.arch}`);
54
+ }
55
+ const isWindows = process.platform === "win32";
56
+ const asset = `cybara-v${pkg.version}-${slug}-cli${isWindows ? ".exe" : ""}`;
57
+ const base = `https://github.com/${REPO}/releases/download/v${pkg.version}`;
58
+
59
+ const payload = await fetch(`${base}/${asset}`);
60
+
61
+ let expected = null;
62
+ try {
63
+ const sidecar = (await fetch(`${base}/${asset}.sha256`)).toString("utf8").trim();
64
+ const first = sidecar.split(/\s+/)[0];
65
+ if (first) expected = first.toLowerCase();
66
+ } catch {
67
+ expected = null;
68
+ }
69
+ if (expected) {
70
+ const actual = crypto.createHash("sha256").update(payload).digest("hex");
71
+ if (actual !== expected) {
72
+ throw new Error(`checksum mismatch for ${asset}`);
73
+ }
74
+ }
75
+
76
+ const dest = binaryPath();
77
+ fs.mkdirSync(path.dirname(dest), { recursive: true });
78
+ fs.writeFileSync(dest, payload);
79
+ if (!isWindows) fs.chmodSync(dest, 0o755);
80
+ if (!silent) console.log(`[cybara] Installed ${asset}`);
81
+ return dest;
82
+ }
83
+
84
+ module.exports = { download, binaryPath };
@@ -1,86 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
- const fs = require("fs");
4
- const path = require("path");
5
- const https = require("https");
6
- const crypto = require("crypto");
3
+ const { download } = require("./download.cjs");
7
4
 
8
- const pkg = require(path.join(__dirname, "..", "package.json"));
9
- const version = pkg.version;
10
- const repo = "metaspartan/cybara";
11
-
12
- function slugFor(platform, arch) {
13
- const map = {
14
- "darwin:arm64": "darwin-arm64",
15
- "darwin:x64": "darwin-x64",
16
- "linux:arm64": "linux-arm64",
17
- "linux:x64": "linux-x64",
18
- "win32:x64": "windows-x64",
19
- };
20
- return map[`${platform}:${arch}`] || null;
21
- }
22
-
23
- function fetch(url) {
24
- return new Promise((resolve, reject) => {
25
- https
26
- .get(url, { headers: { "User-Agent": "cybara-npm" } }, (res) => {
27
- if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
28
- res.resume();
29
- resolve(fetch(res.headers.location));
30
- return;
31
- }
32
- if (res.statusCode !== 200) {
33
- res.resume();
34
- reject(new Error(`HTTP ${res.statusCode} for ${url}`));
35
- return;
36
- }
37
- const chunks = [];
38
- res.on("data", (chunk) => chunks.push(chunk));
39
- res.on("end", () => resolve(Buffer.concat(chunks)));
40
- res.on("error", reject);
41
- })
42
- .on("error", reject);
43
- });
44
- }
45
-
46
- async function main() {
47
- const slug = slugFor(process.platform, process.arch);
48
- if (!slug) {
49
- console.warn(
50
- `[cybara] No prebuilt binary for ${process.platform}/${process.arch}; skipping download.`
51
- );
52
- return;
53
- }
54
- const isWindows = process.platform === "win32";
55
- const asset = `cybara-v${version}-${slug}-cli${isWindows ? ".exe" : ""}`;
56
- const base = `https://github.com/${repo}/releases/download/v${version}`;
57
-
58
- const payload = await fetch(`${base}/${asset}`);
59
-
60
- let expected = null;
61
- try {
62
- const sidecar = (await fetch(`${base}/${asset}.sha256`)).toString("utf8").trim();
63
- const first = sidecar.split(/\s+/)[0];
64
- if (first) expected = first.toLowerCase();
65
- } catch {
66
- expected = null;
67
- }
68
- if (expected) {
69
- const actual = crypto.createHash("sha256").update(payload).digest("hex");
70
- if (actual !== expected) {
71
- throw new Error(`checksum mismatch for ${asset}`);
72
- }
73
- }
74
-
75
- const binDir = path.join(__dirname, "..", "bin");
76
- fs.mkdirSync(binDir, { recursive: true });
77
- const dest = path.join(binDir, isWindows ? "cybara-bin.exe" : "cybara-bin");
78
- fs.writeFileSync(dest, payload);
79
- if (!isWindows) fs.chmodSync(dest, 0o755);
80
- console.log(`[cybara] Installed ${asset}`);
81
- }
82
-
83
- main().catch((error) => {
84
- console.error(`[cybara] postinstall failed: ${error.message}`);
85
- process.exit(1);
5
+ download().catch((error) => {
6
+ console.warn(
7
+ `[cybara] Native binary will be fetched on first run (${error.message}).`
8
+ );
86
9
  });