rainbo 0.1.17 → 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 +4 -4
- package/package.json +7 -7
- package/packaging/npm/postinstall.js +53 -39
package/README.md
CHANGED
|
@@ -113,7 +113,7 @@ when auto-update is available, verifies the new binary, and syncs repository
|
|
|
113
113
|
skills with:
|
|
114
114
|
|
|
115
115
|
```bash
|
|
116
|
-
npx skills add git@gitlab.clickzetta-inc.com:ee/rainbo.git -y -g
|
|
116
|
+
npx skills add git@gitlab.clickzetta-inc.com:ee/rainbo.git -y -g --agent '*'
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
Skill sync records detailed state in `skills-state.json` and updates installed
|
|
@@ -139,8 +139,8 @@ rainbo auth status
|
|
|
139
139
|
rainbo auth logout
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
-
Generate the connection URL from the logged-in Rainbo web UI user menu. `auth
|
|
143
|
-
connect` exchanges the one-time connection code for a revocable
|
|
142
|
+
Generate the Rainbo connection URL from the logged-in Rainbo web UI user menu. `auth
|
|
143
|
+
connect` exchanges the one-time connection code for a revocable bearer token
|
|
144
144
|
and stores it under `~/.config/rainbo/auth.json` on Unix-like systems or
|
|
145
145
|
`%APPDATA%\rainbo\auth.json` on Windows. Unix-like systems use `0600`
|
|
146
146
|
permissions for this file.
|
|
@@ -232,7 +232,7 @@ top-level `rainbo` meta package that depends on those platform packages.
|
|
|
232
232
|
Repository skills live in `skills/`. They can be installed from the repository:
|
|
233
233
|
|
|
234
234
|
```bash
|
|
235
|
-
npx skills add git@gitlab.clickzetta-inc.com:ee/rainbo.git -y -g
|
|
235
|
+
npx skills add git@gitlab.clickzetta-inc.com:ee/rainbo.git -y -g --agent '*'
|
|
236
236
|
```
|
|
237
237
|
|
|
238
238
|
`git@gitlab.clickzetta-inc.com:ee/rainbo.git` is the skills repository
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rainbo",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Rainbo command line tools for data migration workflows",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rainbo",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"node": ">=16"
|
|
27
27
|
},
|
|
28
28
|
"optionalDependencies": {
|
|
29
|
-
"@singdata/rainbo-cli-linux-x64": "0.1
|
|
30
|
-
"@singdata/rainbo-cli-linux-arm64": "0.1
|
|
31
|
-
"@singdata/rainbo-cli-darwin-x64": "0.1
|
|
32
|
-
"@singdata/rainbo-cli-darwin-arm64": "0.1
|
|
33
|
-
"@singdata/rainbo-cli-win32-x64": "0.1
|
|
34
|
-
"@singdata/rainbo-cli-win32-arm64": "0.1
|
|
29
|
+
"@singdata/rainbo-cli-linux-x64": "0.2.1",
|
|
30
|
+
"@singdata/rainbo-cli-linux-arm64": "0.2.1",
|
|
31
|
+
"@singdata/rainbo-cli-darwin-x64": "0.2.1",
|
|
32
|
+
"@singdata/rainbo-cli-darwin-arm64": "0.2.1",
|
|
33
|
+
"@singdata/rainbo-cli-win32-x64": "0.2.1",
|
|
34
|
+
"@singdata/rainbo-cli-win32-arm64": "0.2.1"
|
|
35
35
|
},
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"scripts": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const {
|
|
3
|
+
const { spawn } = require("child_process");
|
|
4
4
|
const fs = require("fs");
|
|
5
5
|
const path = require("path");
|
|
6
6
|
|
|
@@ -39,9 +39,9 @@ if (!fs.existsSync(launcher)) {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
process.stderr.write("\nrainbo installed. Syncing official Rainbo skills...\n");
|
|
42
|
-
const
|
|
42
|
+
const child = spawn(
|
|
43
43
|
process.execPath,
|
|
44
|
-
[launcher, "update", "--skills-only", "--force", "--format", "json"],
|
|
44
|
+
[launcher, "update", "--skills-only", "--force", "--format", "json", "--progress", "pretty"],
|
|
45
45
|
{
|
|
46
46
|
stdio: ["ignore", "pipe", "pipe"],
|
|
47
47
|
encoding: "utf8",
|
|
@@ -54,44 +54,58 @@ const result = spawnSync(
|
|
|
54
54
|
},
|
|
55
55
|
);
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
process.exit(0);
|
|
60
|
-
}
|
|
57
|
+
let stdout = "";
|
|
58
|
+
let stderr = "";
|
|
61
59
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
process.exit(0);
|
|
67
|
-
}
|
|
60
|
+
child.stdout.setEncoding("utf8");
|
|
61
|
+
child.stdout.on("data", (chunk) => {
|
|
62
|
+
stdout += chunk;
|
|
63
|
+
});
|
|
68
64
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const stderr = String(result.stderr || "").trim();
|
|
75
|
-
if (stdout) process.stderr.write(`${stdout}\n`);
|
|
76
|
-
if (stderr) process.stderr.write(`${stderr}\n`);
|
|
77
|
-
writeHint(`sync command returned non-JSON output: ${err.message}`);
|
|
78
|
-
process.exit(0);
|
|
79
|
-
}
|
|
65
|
+
child.stderr.setEncoding("utf8");
|
|
66
|
+
child.stderr.on("data", (chunk) => {
|
|
67
|
+
stderr += chunk;
|
|
68
|
+
process.stderr.write(chunk);
|
|
69
|
+
});
|
|
80
70
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
writeHint("sync command did not report skills_action");
|
|
84
|
-
process.exit(0);
|
|
85
|
-
}
|
|
86
|
-
if (action === "failed" || action === "fallback_failed") {
|
|
87
|
-
const warning = output.data.skills_warning || output.data.skills_detail || action;
|
|
88
|
-
writeHint(warning);
|
|
71
|
+
child.on("error", (err) => {
|
|
72
|
+
writeHint(err.message);
|
|
89
73
|
process.exit(0);
|
|
90
|
-
}
|
|
74
|
+
});
|
|
91
75
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
76
|
+
child.on("close", (status) => {
|
|
77
|
+
if (status !== 0) {
|
|
78
|
+
writeHint(`sync command exited with status ${status}`);
|
|
79
|
+
process.exit(0);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
let output;
|
|
83
|
+
try {
|
|
84
|
+
output = JSON.parse(stdout.trim());
|
|
85
|
+
} catch (err) {
|
|
86
|
+
const trimmedStdout = stdout.trim();
|
|
87
|
+
const trimmedStderr = stderr.trim();
|
|
88
|
+
if (trimmedStdout) process.stderr.write(`${trimmedStdout}\n`);
|
|
89
|
+
if (trimmedStderr) process.stderr.write(`${trimmedStderr}\n`);
|
|
90
|
+
writeHint(`sync command returned non-JSON output: ${err.message}`);
|
|
91
|
+
process.exit(0);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const action = output && output.data && output.data.skills_action;
|
|
95
|
+
if (!action) {
|
|
96
|
+
writeHint("sync command did not report skills_action");
|
|
97
|
+
process.exit(0);
|
|
98
|
+
}
|
|
99
|
+
if (action === "failed" || action === "fallback_failed") {
|
|
100
|
+
const warning = output.data.skills_warning || output.data.skills_detail || action;
|
|
101
|
+
writeHint(warning);
|
|
102
|
+
process.exit(0);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const lines = [
|
|
106
|
+
"",
|
|
107
|
+
"Rainbo skills synced.",
|
|
108
|
+
"",
|
|
109
|
+
];
|
|
110
|
+
process.stderr.write(`${lines.join("\n")}\n`);
|
|
111
|
+
});
|