@neuvertex/nv-tools 0.0.0-stage → 0.4.23
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 +33 -2
- package/package.json +23 -4
- package/postinstall.js +54 -0
- package/tools.lock.json +7 -0
package/README.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @neuvertex/nv-tools: the laptop side of NeuVertex
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
```sh
|
|
4
|
+
npm install -g @neuvertex/nv-tools # nv, and the tools its signed lock pins
|
|
5
|
+
nv login
|
|
6
|
+
nv service enable --accept-work # this computer takes the platform work you start
|
|
7
|
+
nv tools status # every tool: version, in use, verified
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
This package carries no binaries. It depends on `@neuvertex/nv` (the same
|
|
11
|
+
version) and ships `tools.lock.json`: for nv-harnessd, NeuRelay, nv-virtlib and
|
|
12
|
+
nv-python (Python 3.12 with the plugin runtime's packages), per platform, the
|
|
13
|
+
version, size, sha256 and an Ed25519 signature by the NeuVertex component key
|
|
14
|
+
(the key that signs the NeuApp catalog and plugins), and a signature over the
|
|
15
|
+
whole lock. The payloads come from the platform registry's tools channel, so
|
|
16
|
+
npm and the desktop app install the same bytes; anything that does not match
|
|
17
|
+
the lock is refused and the version installed before is kept.
|
|
18
|
+
|
|
19
|
+
Everything goes into `~/.neuvertex/tools/<tool>/<version>/` with a `current`
|
|
20
|
+
pointer; no administrator rights. `NV_HARNESSD_BIN`, `NV_NEURELAY_BIN` and
|
|
21
|
+
`NV_VIRTLIB_BIN` still win.
|
|
22
|
+
|
|
23
|
+
The install step runs `nv tools install` and never fails the npm install: if
|
|
24
|
+
you are not signed in yet (or offline), it prints the command to run instead.
|
|
25
|
+
`NV_TOOLS_SKIP_INSTALL=1` skips it.
|
|
26
|
+
|
|
27
|
+
- `nv tools update`: the newest lock; only while the local harness runs nothing.
|
|
28
|
+
- `nv tools rollback [TOOL]`: back to the version before.
|
|
29
|
+
- `nv tools install --from nv-tools-<version>-<platform>.tar.gz`: offline, from a signed bundle.
|
|
30
|
+
- `HTTPS_PROXY` is honoured.
|
|
31
|
+
- `nv tools doctor`: the tools, the login service, the seam, your sign-in, accepting work.
|
|
32
|
+
|
|
33
|
+
Supported: macOS (Apple silicon and Intel), Linux x64 and arm64. Accepting
|
|
34
|
+
work on Windows comes later (the harness seam is a Unix socket today).
|
package/package.json
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neuvertex/nv-tools",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"description": "nv and the NeuVertex laptop tools (nv-harnessd, NeuRelay, nv-virtlib, nv-python) from a signed lock.",
|
|
4
|
+
"version": "0.4.23",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"homepage": "https://neuvertex.ai",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://dev.azure.com/neuvertex-ai/NV-Harness"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"postinstall": "node postinstall.js"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"tools.lock.json",
|
|
16
|
+
"postinstall.js",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=18"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@neuvertex/nv": "0.4.23"
|
|
24
|
+
}
|
|
25
|
+
}
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// After `npm install -g @neuvertex/nv-tools`: install the tools its
|
|
3
|
+
// tools.lock.json pins (nv tools install --lock <this package's lock>).
|
|
4
|
+
//
|
|
5
|
+
// Never fails the npm install: when the tools cannot be installed now (not
|
|
6
|
+
// signed in yet, offline, npm running as root, no nv), it says why and prints
|
|
7
|
+
// the command to run. `nv service enable --accept-work` runs `nv tools ensure`
|
|
8
|
+
// itself, so nothing is lost. NV_TOOLS_SKIP_INSTALL=1 skips this step.
|
|
9
|
+
"use strict";
|
|
10
|
+
|
|
11
|
+
const { spawnSync } = require("child_process");
|
|
12
|
+
const path = require("path");
|
|
13
|
+
|
|
14
|
+
function nvShim() {
|
|
15
|
+
try {
|
|
16
|
+
return require.resolve("@neuvertex/nv/bin/nv.js");
|
|
17
|
+
} catch (_) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function main() {
|
|
23
|
+
const lock = path.join(__dirname, "tools.lock.json");
|
|
24
|
+
const cmd = `nv tools install --lock "${lock}"`;
|
|
25
|
+
const tell = (why) =>
|
|
26
|
+
console.error(`nv-tools: ${why}.\n The tools were not installed now. Sign in (nv login) and run:\n ${cmd}\n (nv service enable --accept-work installs them too.)`);
|
|
27
|
+
if (process.env.NV_TOOLS_SKIP_INSTALL === "1") {
|
|
28
|
+
console.error(`nv-tools: NV_TOOLS_SKIP_INSTALL=1; install the tools later with: ${cmd}`);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
// sudo npm -g: the tools belong in the user's own ~/.neuvertex, not root's.
|
|
32
|
+
if (process.platform !== "win32" && typeof process.getuid === "function" && process.getuid() === 0 && process.env.SUDO_USER) {
|
|
33
|
+
tell("npm runs as root (sudo), and the tools belong in your own home folder");
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const shim = nvShim();
|
|
37
|
+
if (!shim) {
|
|
38
|
+
tell("@neuvertex/nv is not installed beside this package");
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const r = spawnSync(process.execPath, [shim, "tools", "install", "--lock", lock], { stdio: "inherit", timeout: 15 * 60 * 1000 });
|
|
42
|
+
if (r.error) tell(`nv could not run (${r.error.message})`);
|
|
43
|
+
else if (r.status !== 0) tell(`nv tools install stopped (exit ${r.status === null ? r.signal : r.status})`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (require.main === module) {
|
|
47
|
+
try {
|
|
48
|
+
main();
|
|
49
|
+
} catch (e) {
|
|
50
|
+
console.error(`nv-tools: ${e && e.message}; install the tools with: nv tools install`);
|
|
51
|
+
}
|
|
52
|
+
process.exit(0);
|
|
53
|
+
}
|
|
54
|
+
module.exports = { main };
|