neuralosd 3.5.0 → 3.5.3

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Hyperspace Technologies
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,13 +1,19 @@
1
1
  # neuralosd (npm launcher)
2
2
 
3
3
  Installs the **neuralOSd** verified agent-runtime binaries from the official
4
- GitHub releases for your platform.
4
+ GitHub releases for your platform, then hands every other command to the
5
+ installed binary.
5
6
 
6
7
  ```bash
7
- npx neuralosd install # base runtime → ~/.neuralosd/bin
8
- neuralosd serve --instance-dir ./my-instance
8
+ npx neuralosd install # base runtime → ~/.neuralosd/bin
9
+ npx neuralosd serve --instance-dir ./my-instance
10
+ npx neuralosd ask --instance-dir ./my-instance "how many rows"
11
+ npx neuralosd update --check # verified self-update
9
12
  ```
10
13
 
14
+ The first non-installer command installs the base binary if it is missing,
15
+ then runs it with your arguments and exits with its status.
16
+
11
17
  Variants: `npx neuralosd install boxlite` · `npx neuralosd install msb`.
12
18
 
13
19
  Documentation: https://drolu.github.io/neuralosd/
package/bin/neuralosd.mjs CHANGED
@@ -3,8 +3,9 @@
3
3
  // from the official GitHub releases for the current platform.
4
4
 
5
5
  import { chmod, mkdir, writeFile } from "node:fs/promises";
6
- import { readFileSync } from "node:fs";
6
+ import { existsSync, readFileSync } from "node:fs";
7
7
  import { createWriteStream } from "node:fs";
8
+ import { spawnSync } from "node:child_process";
8
9
  import { pipeline } from "node:stream/promises";
9
10
  import { homedir, platform, arch } from "node:os";
10
11
  import path from "node:path";
@@ -68,7 +69,7 @@ async function install(variant) {
68
69
  if (!target) {
69
70
  console.error(`Unsupported platform: ${platform()}-${arch()}`);
70
71
  process.exitCode = 1;
71
- return;
72
+ return false;
72
73
  }
73
74
  const name = assetName(variant, target);
74
75
  const url = `https://github.com/${OWNER}/${REPO}/releases/download/v${VERSION}/${name}`;
@@ -82,7 +83,7 @@ async function install(variant) {
82
83
  console.error(error.message);
83
84
  console.error(`Check the release exists: https://github.com/${OWNER}/${REPO}/releases/tag/v${VERSION}`);
84
85
  process.exitCode = 1;
85
- return;
86
+ return false;
86
87
  }
87
88
  process.stdout.write(`Done. Binary at ${destPath}\n`);
88
89
  if (platform() === "win32") {
@@ -90,6 +91,30 @@ async function install(variant) {
90
91
  } else {
91
92
  process.stdout.write(`Run it: ${destPath} serve --instance-dir <dir>\n`);
92
93
  }
94
+ return true;
95
+ }
96
+
97
+ function binaryPath(variant = "base") {
98
+ const suffix = variant === "base" ? "" : `-${variant}`;
99
+ return path.join(INSTALL_DIR, `neuralosd${suffix}${platform() === "win32" ? ".exe" : ""}`);
100
+ }
101
+
102
+ // `npx neuralosd serve ...` is the documented entry point: install the base
103
+ // binary on first use, then hand the whole argument vector to it. Before
104
+ // this, every command except install/version printed usage and exited 0 —
105
+ // a silent no-op that looked like success.
106
+ async function passthrough(args) {
107
+ const bin = binaryPath("base");
108
+ if (!existsSync(bin)) {
109
+ console.error(`neuralOSd is not installed yet — installing v${VERSION} first.`);
110
+ if (!(await install("base"))) return 1;
111
+ }
112
+ const result = spawnSync(bin, args, { stdio: "inherit" });
113
+ if (result.error) {
114
+ console.error(`cannot run ${bin}: ${result.error.message}`);
115
+ return 1;
116
+ }
117
+ return result.status === null ? 1 : result.status;
93
118
  }
94
119
 
95
120
  const [cmd, ...rest] = process.argv.slice(2);
@@ -99,6 +124,8 @@ if (cmd === "install") {
99
124
  await install(variant);
100
125
  } else if (cmd === "--version" || cmd === "-v" || cmd === "version") {
101
126
  console.log(`neuralosd v${VERSION}`);
102
- } else {
127
+ } else if (cmd === "help" || cmd === "-h" || cmd === "--help" || !cmd) {
103
128
  usage();
129
+ } else {
130
+ process.exitCode = await passthrough([cmd, ...rest]);
104
131
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "neuralosd",
3
- "version": "3.5.0",
3
+ "version": "3.5.3",
4
4
  "description": "neuralOSd CLI — installer for the verified agent-runtime binaries (gateway/runtime for neuralOS instances).",
5
- "license": "Apache-2.0",
5
+ "license": "MIT",
6
6
  "author": "Hyperspace Technologies <agent@superagent.ng>",
7
7
  "homepage": "https://drolu.github.io/neuralosd/",
8
8
  "repository": {
@@ -26,7 +26,8 @@
26
26
  },
27
27
  "files": [
28
28
  "bin/",
29
- "README.md"
29
+ "README.md",
30
+ "LICENSE"
30
31
  ],
31
32
  "engines": {
32
33
  "node": ">=18"