neuralosd 0.0.0-stage → 2.0.9

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 CHANGED
@@ -1,3 +1,13 @@
1
- # Temporary Holding Version
1
+ # neuralosd (npm launcher)
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Installs the **neuralOSd** verified agent-runtime binaries from the official
4
+ GitHub releases for your platform.
5
+
6
+ ```bash
7
+ npx neuralosd install # base runtime → ~/.neuralosd/bin
8
+ neuralosd serve --instance-dir ./my-instance
9
+ ```
10
+
11
+ Variants: `npx neuralosd install boxlite` · `npx neuralosd install msb`.
12
+
13
+ Documentation: https://drolu.github.io/neuralosd/
@@ -0,0 +1,104 @@
1
+ #!/usr/bin/env node
2
+ // neuralosd CLI — installs the neuralOSd gateway/runtime binaries
3
+ // from the official GitHub releases for the current platform.
4
+
5
+ import { chmod, mkdir, writeFile } from "node:fs/promises";
6
+ import { readFileSync } from "node:fs";
7
+ import { createWriteStream } from "node:fs";
8
+ import { pipeline } from "node:stream/promises";
9
+ import { homedir, platform, arch } from "node:os";
10
+ import path from "node:path";
11
+ import { Readable } from "node:stream";
12
+
13
+ // Derived from package.json at runtime: a hardcoded literal here shipped
14
+ // stale binaries in the reactorpro launcher — drift is structurally impossible.
15
+ const VERSION = JSON.parse(
16
+ readFileSync(new URL("../package.json", import.meta.url), "utf8"),
17
+ ).version;
18
+ const OWNER = "DrOlu";
19
+ const REPO = "neuralosd";
20
+ const INSTALL_DIR = path.join(homedir(), ".neuralosd", "bin");
21
+
22
+ // npm platform key → release asset naming
23
+ const TARGETS = {
24
+ "darwin-arm64": { asset: "macos-arm64", ext: "" },
25
+ "darwin-x64": { asset: "macos-x64", ext: "" },
26
+ "linux-x64": { asset: "linux-x64", ext: "" },
27
+ "linux-arm64": { asset: "linux-arm64", ext: "" },
28
+ "win32-x64": { asset: "windows-x64", ext: ".exe" },
29
+ };
30
+
31
+ const VARIANTS = ["base", "boxlite", "msb"];
32
+
33
+ function usage() {
34
+ console.log(`neuralosd v${VERSION} — neuralOSd CLI
35
+
36
+ Usage:
37
+ neuralosd install [variant] Download + install neuralOSd (base | boxlite | msb; default base)
38
+ neuralosd --version Print the CLI version
39
+ neuralosd help Show this help
40
+
41
+ Binaries are downloaded from the official GitHub releases (v${VERSION})
42
+ and installed into ${INSTALL_DIR}.`);
43
+ }
44
+
45
+ function resolveTarget() {
46
+ const key = `${platform()}-${arch()}`;
47
+ const target = TARGETS[key];
48
+ if (!target) return null;
49
+ return { ...target, key };
50
+ }
51
+
52
+ function assetName(variant, target) {
53
+ const base = variant === "base" ? "neuralosd" : `neuralosd-${variant}`;
54
+ return `${base}-${target.asset}${target.ext}`;
55
+ }
56
+
57
+ async function downloadTo(url, destPath) {
58
+ const response = await fetch(url, { redirect: "follow" });
59
+ if (!response.ok || !response.body) {
60
+ throw new Error(`download failed (HTTP ${response.status}) for ${url}`);
61
+ }
62
+ await pipeline(Readable.fromWeb(response.body), createWriteStream(destPath));
63
+ if (platform() !== "win32") await chmod(destPath, 0o755);
64
+ }
65
+
66
+ async function install(variant) {
67
+ const target = resolveTarget();
68
+ if (!target) {
69
+ console.error(`Unsupported platform: ${platform()}-${arch()}`);
70
+ process.exitCode = 1;
71
+ return;
72
+ }
73
+ const name = assetName(variant, target);
74
+ const url = `https://github.com/${OWNER}/${REPO}/releases/download/v${VERSION}/${name}`;
75
+ const suffix = variant === "base" ? "" : `-${variant}`;
76
+ const destPath = path.join(INSTALL_DIR, `neuralosd${suffix}${target.ext}`);
77
+ await mkdir(INSTALL_DIR, { recursive: true });
78
+ process.stdout.write(`Installing neuralOSd ${variant} v${VERSION} (${target.key}) → ${destPath}\n`);
79
+ try {
80
+ await downloadTo(url, destPath);
81
+ } catch (error) {
82
+ console.error(error.message);
83
+ console.error(`Check the release exists: https://github.com/${OWNER}/${REPO}/releases/tag/v${VERSION}`);
84
+ process.exitCode = 1;
85
+ return;
86
+ }
87
+ process.stdout.write(`Done. Binary at ${destPath}\n`);
88
+ if (platform() === "win32") {
89
+ process.stdout.write(`Run it: ${destPath}\n`);
90
+ } else {
91
+ process.stdout.write(`Run it: ${destPath} serve --instance-dir <dir>\n`);
92
+ }
93
+ }
94
+
95
+ const [cmd, ...rest] = process.argv.slice(2);
96
+ const variant = VARIANTS.includes(rest[0]) ? rest[0] : "base";
97
+
98
+ if (cmd === "install") {
99
+ await install(variant);
100
+ } else if (cmd === "--version" || cmd === "-v" || cmd === "version") {
101
+ console.log(`neuralosd v${VERSION}`);
102
+ } else {
103
+ usage();
104
+ }
package/package.json CHANGED
@@ -1,6 +1,34 @@
1
1
  {
2
2
  "name": "neuralosd",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "2.0.9",
4
+ "description": "neuralOSd CLI — installer for the verified agent-runtime binaries (gateway/runtime for neuralOS instances).",
5
+ "license": "Apache-2.0",
6
+ "author": "Hyperspace Technologies <agent@superagent.ng>",
7
+ "homepage": "https://drolu.github.io/neuralosd/",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/DrOlu/neuralosd.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/DrOlu/neuralosd/issues"
14
+ },
15
+ "keywords": [
16
+ "neuralosd",
17
+ "neuralos",
18
+ "ai-agent",
19
+ "agent-runtime",
20
+ "data-answers",
21
+ "on-device"
22
+ ],
23
+ "type": "module",
24
+ "bin": {
25
+ "neuralosd": "bin/neuralosd.mjs"
26
+ },
27
+ "files": [
28
+ "bin/",
29
+ "README.md"
30
+ ],
31
+ "engines": {
32
+ "node": ">=18"
33
+ }
34
+ }