@ferroxlabs/wayland-core 0.9.6-rc.1

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.
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ // Thin launcher for `npx @ferroxlabs/wayland-core` / global installs. Resolves
4
+ // the platform binary and execs it transparently (stdio inherited, exit code
5
+ // relayed). Hosts that embed the engine should call binaryPath() and spawn the
6
+ // binary directly instead of going through this shim.
7
+ const { spawnSync } = require("node:child_process");
8
+ const { binaryPath } = require("../index.js");
9
+
10
+ let bin;
11
+ try {
12
+ bin = binaryPath();
13
+ } catch (err) {
14
+ console.error(err.message);
15
+ process.exit(1);
16
+ }
17
+
18
+ const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
19
+ if (result.error) {
20
+ console.error("wayland-core: failed to launch: " + result.error.message);
21
+ process.exit(1);
22
+ }
23
+ process.exit(result.status === null ? 1 : result.status);
package/index.js ADDED
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ // Resolve the platform-correct wayland-core binary that npm installed as an
3
+ // optional dependency. Programmatic entry point: a host (e.g. AionCLI) calls
4
+ // require("@ferroxlabs/wayland-core").binaryPath() and spawns it directly.
5
+ const fs = require("node:fs");
6
+ const path = require("node:path");
7
+
8
+ const PLATFORM_PACKAGES = {
9
+ "darwin-arm64": "@ferroxlabs/wayland-core-darwin-arm64",
10
+ "darwin-x64": "@ferroxlabs/wayland-core-darwin-x64",
11
+ "linux-arm64": "@ferroxlabs/wayland-core-linux-arm64",
12
+ "linux-x64": "@ferroxlabs/wayland-core-linux-x64",
13
+ "win32-arm64": "@ferroxlabs/wayland-core-win32-arm64",
14
+ "win32-x64": "@ferroxlabs/wayland-core-win32-x64",
15
+ };
16
+
17
+ function binaryName() {
18
+ return process.platform === "win32" ? "wayland-core.exe" : "wayland-core";
19
+ }
20
+
21
+ /**
22
+ * Absolute path to the platform-correct wayland-core binary.
23
+ * Throws an actionable error if the platform is unsupported or its package was
24
+ * not installed (e.g. install ran with --no-optional / --ignore-optional).
25
+ */
26
+ function binaryPath() {
27
+ const key = process.platform + "-" + process.arch;
28
+ const pkg = PLATFORM_PACKAGES[key];
29
+ if (!pkg) {
30
+ throw new Error("wayland-core: unsupported platform " + key);
31
+ }
32
+ let pkgJson;
33
+ try {
34
+ pkgJson = require.resolve(pkg + "/package.json");
35
+ } catch (e) {
36
+ throw new Error(
37
+ "wayland-core: platform package " + pkg + " is not installed. It should " +
38
+ "have been pulled in automatically as an optional dependency — reinstall " +
39
+ "without --no-optional / --ignore-optional."
40
+ );
41
+ }
42
+ const p = path.join(path.dirname(pkgJson), "bin", binaryName());
43
+ if (!fs.existsSync(p)) {
44
+ throw new Error("wayland-core: binary missing at " + p);
45
+ }
46
+ return p;
47
+ }
48
+
49
+ module.exports = { binaryPath };
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@ferroxlabs/wayland-core",
3
+ "version": "0.9.6-rc.1",
4
+ "description": "wayland-core — multi-provider AI agent engine. Platform-resolving launcher; the matching native binary installs automatically per os/cpu.",
5
+ "license": "Apache-2.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/ferroxlabs/wayland-core.git"
9
+ },
10
+ "bin": {
11
+ "wayland-core": "bin/wayland-core.js"
12
+ },
13
+ "main": "index.js",
14
+ "files": [
15
+ "bin/",
16
+ "index.js"
17
+ ],
18
+ "optionalDependencies": {
19
+ "@ferroxlabs/wayland-core-darwin-arm64": "0.9.6-rc.1",
20
+ "@ferroxlabs/wayland-core-darwin-x64": "0.9.6-rc.1",
21
+ "@ferroxlabs/wayland-core-linux-arm64": "0.9.6-rc.1",
22
+ "@ferroxlabs/wayland-core-linux-x64": "0.9.6-rc.1",
23
+ "@ferroxlabs/wayland-core-win32-arm64": "0.9.6-rc.1",
24
+ "@ferroxlabs/wayland-core-win32-x64": "0.9.6-rc.1"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ }
29
+ }