vibecanvas 0.0.2

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/vibecanvas ADDED
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawn } = require("child_process");
4
+ const { arch, platform } = require("os");
5
+
6
+ const os = platform();
7
+ const cpu = arch();
8
+ const pkgBase = ["vibecanvas", os === "win32" ? "windows" : os, cpu].join("-");
9
+ const attempts = [pkgBase, `${pkgBase}-baseline`, `${pkgBase}-musl`];
10
+
11
+ let binaryPath;
12
+
13
+ for (const pkgName of attempts) {
14
+ try {
15
+ binaryPath = require.resolve(`${pkgName}/bin/vibecanvas`);
16
+ break;
17
+ } catch {
18
+ // Try next package variant.
19
+ }
20
+ }
21
+
22
+ if (!binaryPath) {
23
+ console.error(`vibecanvas: no binary found for ${os}-${cpu}`);
24
+ console.error(`vibecanvas: tried ${attempts.join(", ")}`);
25
+ process.exit(1);
26
+ }
27
+
28
+ const child = spawn(binaryPath, process.argv.slice(2), {
29
+ stdio: "inherit",
30
+ env: process.env,
31
+ });
32
+
33
+ child.on("error", (error) => {
34
+ console.error(`vibecanvas: failed to start binary (${error.message})`);
35
+ process.exit(1);
36
+ });
37
+
38
+ child.on("exit", (code) => process.exit(code ?? 0));
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "vibecanvas",
3
+ "version": "0.0.2",
4
+ "description": "Run your agents in an infinite canvas",
5
+ "license": "MIT",
6
+ "bin": {
7
+ "vibecanvas": "./bin/vibecanvas"
8
+ },
9
+ "files": [
10
+ "bin",
11
+ "postinstall.mjs"
12
+ ],
13
+ "scripts": {
14
+ "postinstall": "node postinstall.mjs"
15
+ },
16
+ "optionalDependencies": {
17
+ "vibecanvas-darwin-arm64": "0.0.2",
18
+ "vibecanvas-darwin-x64": "0.0.2",
19
+ "vibecanvas-linux-arm64": "0.0.2",
20
+ "vibecanvas-linux-x64": "0.0.2",
21
+ "vibecanvas-linux-x64-baseline": "0.0.2",
22
+ "vibecanvas-linux-arm64-musl": "0.0.2",
23
+ "vibecanvas-linux-x64-musl": "0.0.2",
24
+ "vibecanvas-windows-x64": "0.0.2",
25
+ "vibecanvas-windows-x64-baseline": "0.0.2"
26
+ },
27
+ "engines": {
28
+ "node": ">=18"
29
+ },
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://github.com/vibecanvas/vibecanvas"
33
+ },
34
+ "homepage": "https://vibecanvas.net",
35
+ "keywords": [
36
+ "bun",
37
+ "devtools",
38
+ "visual",
39
+ "canvas",
40
+ "cli"
41
+ ]
42
+ }
@@ -0,0 +1,28 @@
1
+ import { platform, arch } from "os"
2
+ import { createRequire } from "module"
3
+
4
+ const require = createRequire(import.meta.url)
5
+
6
+ const os = platform()
7
+ const cpu = arch()
8
+ const baseName = ["vibecanvas", os === "win32" ? "windows" : os, cpu].join("-")
9
+
10
+ // Try to find the platform binary
11
+ const attempts = [baseName, `${baseName}-baseline`, `${baseName}-musl`]
12
+
13
+ let found = false
14
+ for (const pkgName of attempts) {
15
+ try {
16
+ require.resolve(`${pkgName}/package.json`)
17
+ console.log(`vibecanvas: found ${pkgName} binary`)
18
+ found = true
19
+ break
20
+ } catch {
21
+ // Try next
22
+ }
23
+ }
24
+
25
+ if (!found) {
26
+ console.warn(`vibecanvas: no binary for ${os}-${cpu}`)
27
+ console.warn(`vibecanvas: will try fallback at runtime`)
28
+ }