@preplabsai/rovara-code 0.1.0

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/agentx.mjs ADDED
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env node
2
+
3
+ // packages/cli/src/node-version.ts
4
+ var NODE_ENGINE_RANGE = ">=22.19.0";
5
+ var CLOUDSHELL_NODE_VERSION = "22.23.3";
6
+ var CLOUDSHELL_NODE_INSTALL_COMMAND = String.raw`V=v${CLOUDSHELL_NODE_VERSION} A=$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/') && F=node-$V-linux-$A.tar.gz && D=$HOME/.local/node22 && rm -rf "$D.new" && mkdir -p "$D.new" && (cd "$D.new" && curl -fSL --progress-bar -O "https://nodejs.org/dist/$V/$F" && curl -fsSL "https://nodejs.org/dist/$V/SHASUMS256.txt" | grep " $F\$" | sha256sum -c - && tar -xzf "$F" --strip-components=1 && rm "$F") && rm -rf "$D" && mv "$D.new" "$D" && (grep -qs 'local/node22/bin' ~/.bashrc || echo 'export PATH="$HOME/.local/node22/bin:$PATH"' >> ~/.bashrc) && export PATH="$D/bin:$PATH" && node --version`;
7
+ function parseVersion(text) {
8
+ const match = /^v?(\d+)\.(\d+)\.(\d+)/.exec(text);
9
+ if (match === null) return void 0;
10
+ return [Number(match[1]), Number(match[2]), Number(match[3])];
11
+ }
12
+ function isBelow(version, floor) {
13
+ for (let index = 0; index < floor.length; index += 1) {
14
+ const part = version[index] || 0;
15
+ const floorPart = floor[index] || 0;
16
+ if (part !== floorPart) return part < floorPart;
17
+ }
18
+ return false;
19
+ }
20
+ var FLOOR = parseVersion(NODE_ENGINE_RANGE.replace(/^>=/, "")) || [0, 0, 0];
21
+ function floorText() {
22
+ return FLOOR[2] === 0 ? `${FLOOR[0]}.${FLOOR[1]}` : FLOOR.join(".");
23
+ }
24
+ function nodeVersionProblem(nodeVersion, env) {
25
+ const version = parseVersion(nodeVersion);
26
+ if (version === void 0 || !isBelow(version, FLOOR)) return void 0;
27
+ const first = `Rovara Code needs Node ${floorText()} or newer; this is Node ${nodeVersion}.`;
28
+ if (env.AWS_EXECUTION_ENV !== "CloudShell") {
29
+ return `${first} Install Node 22 from https://nodejs.org, then run rovara again.`;
30
+ }
31
+ return [
32
+ `${first} In AWS CloudShell, run this command in its default Bash shell, then run rovara again:`,
33
+ "",
34
+ ` ${CLOUDSHELL_NODE_INSTALL_COMMAND}`,
35
+ "",
36
+ "It installs Node 22 in your own CloudShell home folder only; nothing else in your AWS account is affected."
37
+ ].join("\n");
38
+ }
39
+ function startCli(start) {
40
+ const problem = nodeVersionProblem(start.nodeVersion, start.env);
41
+ if (problem !== void 0) {
42
+ start.writeError(`${problem}
43
+ `);
44
+ return Promise.resolve(1);
45
+ }
46
+ return start.loadCli().then((cli) => cli.executeCli());
47
+ }
48
+
49
+ // packages/cli/src/bin.ts
50
+ startCli({
51
+ nodeVersion: process.versions.node,
52
+ env: process.env,
53
+ writeError: (text) => {
54
+ process.stderr.write(text);
55
+ },
56
+ loadCli: () => import("./agentx-cli.mjs")
57
+ }).then(
58
+ (code) => {
59
+ process.exitCode = code;
60
+ },
61
+ (error) => {
62
+ process.exitCode = 1;
63
+ throw error;
64
+ }
65
+ );
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@preplabsai/rovara-code",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "bin": {
6
+ "rovara": "bin/agentx.mjs",
7
+ "agentx": "bin/agentx.mjs"
8
+ },
9
+ "engines": {
10
+ "node": ">=22.19.0"
11
+ },
12
+ "license": "FSL-1.1-ALv2",
13
+ "files": [
14
+ "bin",
15
+ "README.md",
16
+ "LICENSE",
17
+ "THIRD_PARTY_NOTICES"
18
+ ],
19
+ "description": "Rovara Code installer and administration CLI",
20
+ "homepage": "https://rovara-dev.github.io/",
21
+ "publishConfig": {
22
+ "access": "public",
23
+ "registry": "https://registry.npmjs.org/"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/PrepLabsAI/Rovara.git"
28
+ }
29
+ }