@riotlagrinta/riot 0.0.0-stage → 0.2.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.
- package/README.md +39 -2
- package/bin/riot.js +127 -0
- package/package.json +29 -4
package/README.md
CHANGED
|
@@ -1,3 +1,40 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @riotlagrinta/riot
|
|
2
|
+
|
|
3
|
+
Wrapper CLI multiplateforme permettant d'installer et d'exécuter **RIOT** via `npm` sur Windows, macOS et Linux.
|
|
4
|
+
|
|
5
|
+
## Installation globale (sur n'importe quelle machine)
|
|
6
|
+
|
|
7
|
+
1. Publier d'abord le dépôt Python sur GitHub (ou PyPI), puis publier ce package :
|
|
8
|
+
```bash
|
|
9
|
+
cd npm
|
|
10
|
+
npm login
|
|
11
|
+
npm publish --access public
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
2. Installer sur n'importe quelle autre machine :
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g @riotlagrinta/riot
|
|
17
|
+
riot
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Test local avant publication
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
cd npm
|
|
24
|
+
npm link
|
|
25
|
+
riot /pc
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Variables d'environnement utiles
|
|
29
|
+
|
|
30
|
+
- `RIOT_SOURCE` : URL Git ou chemin local du package Python RIOT.
|
|
31
|
+
- `RIOT_EXTRAS` : Extras optionnels à installer (`voice`, `browser`, `office`, `media`, `integrations`, `cuda`, `all`).
|
|
32
|
+
- `RIOT_CONFIG` : Chemin personnalisé vers `config.yaml` (par défaut `~/.riot/config.yaml`).
|
|
33
|
+
- `RIOT_PROJECTS_DIR` : Dossier racine des projets par défaut.
|
|
34
|
+
|
|
35
|
+
## Mise à jour du CLI
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
riot --update-cli
|
|
39
|
+
```
|
|
2
40
|
|
|
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.
|
package/bin/riot.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { spawnSync } = require("child_process");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
const os = require("os");
|
|
7
|
+
const path = require("path");
|
|
8
|
+
|
|
9
|
+
const DEFAULT_GIT_SOURCE =
|
|
10
|
+
"git+https://github.com/Riotlagrinta/riot.git";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Locate the `uv` binary in PATH or standard Astral install directories.
|
|
14
|
+
*/
|
|
15
|
+
function findUvBinary() {
|
|
16
|
+
const isWin = process.platform === "win32";
|
|
17
|
+
const binName = isWin ? "uv.exe" : "uv";
|
|
18
|
+
|
|
19
|
+
const check = spawnSync(binName, ["--version"], { stdio: "ignore", shell: false });
|
|
20
|
+
if (check.status === 0) {
|
|
21
|
+
return binName;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const home = os.homedir();
|
|
25
|
+
const candidates = isWin
|
|
26
|
+
? [
|
|
27
|
+
path.join(home, ".local", "bin", "uv.exe"),
|
|
28
|
+
path.join(home, ".cargo", "bin", "uv.exe"),
|
|
29
|
+
path.join(process.env.LOCALAPPDATA || "", "uv", "uv.exe"),
|
|
30
|
+
]
|
|
31
|
+
: [
|
|
32
|
+
path.join(home, ".local", "bin", "uv"),
|
|
33
|
+
path.join(home, ".cargo", "bin", "uv"),
|
|
34
|
+
"/opt/homebrew/bin/uv",
|
|
35
|
+
"/usr/local/bin/uv",
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
for (const candidate of candidates) {
|
|
39
|
+
if (candidate && fs.existsSync(candidate)) {
|
|
40
|
+
return candidate;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Install `uv` automatically via the official Astral installer when missing.
|
|
48
|
+
*/
|
|
49
|
+
function ensureUvInstalled() {
|
|
50
|
+
let uvBin = findUvBinary();
|
|
51
|
+
if (uvBin) return uvBin;
|
|
52
|
+
|
|
53
|
+
console.log("[RIOT] Outil 'uv' introuvable. Installation automatique de uv (gestionnaire Python léger)...");
|
|
54
|
+
const isWin = process.platform === "win32";
|
|
55
|
+
|
|
56
|
+
const installRes = isWin
|
|
57
|
+
? spawnSync(
|
|
58
|
+
"powershell.exe",
|
|
59
|
+
["-NoProfile", "-ExecutionPolicy", "ByPass", "-Command", "irm https://astral.sh/uv/install.ps1 | iex"],
|
|
60
|
+
{ stdio: "inherit" }
|
|
61
|
+
)
|
|
62
|
+
: spawnSync("sh", ["-c", "curl -LsSf https://astral.sh/uv/install.sh | sh"], { stdio: "inherit" });
|
|
63
|
+
|
|
64
|
+
if (installRes.status !== 0) {
|
|
65
|
+
console.error("[RIOT] Échec de l'installation automatique de 'uv'. Installez-le manuellement : https://docs.astral.sh/uv/");
|
|
66
|
+
process.exit(installRes.status || 1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
uvBin = findUvBinary();
|
|
70
|
+
if (!uvBin) {
|
|
71
|
+
console.error("[RIOT] 'uv' a été installé mais nécessite un rechargement du PATH. Relancez votre terminal puis tapez `riot`.");
|
|
72
|
+
process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
return uvBin;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function main() {
|
|
78
|
+
const rawArgs = process.argv.slice(2);
|
|
79
|
+
let upgrade = false;
|
|
80
|
+
const passThroughArgs = [];
|
|
81
|
+
|
|
82
|
+
for (const arg of rawArgs) {
|
|
83
|
+
if (arg === "--update-cli" || arg === "--upgrade") {
|
|
84
|
+
upgrade = true;
|
|
85
|
+
} else {
|
|
86
|
+
passThroughArgs.push(arg);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const uvBin = ensureUvInstalled();
|
|
91
|
+
|
|
92
|
+
// Check if running inside a local checkout (e.g. via `npm link` during development)
|
|
93
|
+
const localRepoRoot = path.resolve(__dirname, "..", "..");
|
|
94
|
+
const isLocalCheckout =
|
|
95
|
+
fs.existsSync(path.join(localRepoRoot, "pyproject.toml")) &&
|
|
96
|
+
fs.existsSync(path.join(localRepoRoot, "riot.py"));
|
|
97
|
+
|
|
98
|
+
let uvArgs;
|
|
99
|
+
if (isLocalCheckout && !process.env.RIOT_SOURCE) {
|
|
100
|
+
uvArgs = ["run", "--project", localRepoRoot, "riot", ...passThroughArgs];
|
|
101
|
+
} else {
|
|
102
|
+
const baseSource = process.env.RIOT_SOURCE || DEFAULT_GIT_SOURCE;
|
|
103
|
+
const extras = (process.env.RIOT_EXTRAS || "").trim();
|
|
104
|
+
const fromSpec = extras && !baseSource.includes("[") ? `${baseSource}[${extras}]` : baseSource;
|
|
105
|
+
|
|
106
|
+
uvArgs = ["tool", "run", "--python", ">=3.12"];
|
|
107
|
+
if (upgrade) {
|
|
108
|
+
uvArgs.push("--refresh");
|
|
109
|
+
}
|
|
110
|
+
uvArgs.push("--from", fromSpec, "riot", ...passThroughArgs);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const child = spawnSync(uvBin, uvArgs, {
|
|
114
|
+
stdio: "inherit",
|
|
115
|
+
env: process.env,
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
if (child.error) {
|
|
119
|
+
console.error(`[RIOT] Erreur de lancement : ${child.error.message}`);
|
|
120
|
+
process.exit(1);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
process.exit(typeof child.status === "number" ? child.status : 0);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
main();
|
|
127
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riotlagrinta/riot",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "RIOT — Copilote développeur, système et agent IA multiplateforme en ligne de commande.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"riot": "bin/riot.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin/",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
12
|
+
"keywords": [
|
|
13
|
+
"ai",
|
|
14
|
+
"cli",
|
|
15
|
+
"agent",
|
|
16
|
+
"copilot",
|
|
17
|
+
"developer-tools",
|
|
18
|
+
"riot",
|
|
19
|
+
"kelvix"
|
|
20
|
+
],
|
|
21
|
+
"author": "Kelvix",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=18.0.0"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/Riotlagrinta/riot.git"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|