openclaw-yunjia-cli 0.0.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/lib/compat.mjs ADDED
@@ -0,0 +1,45 @@
1
+ // lib/compat.mjs
2
+ // Compatibility matrix for openclaw-inspur-yunjia plugin.
3
+
4
+ export const COMPAT_MATRIX = [
5
+ {
6
+ distTag: 'latest',
7
+ openclawRange: { gte: '2026.3.22' },
8
+ label: '0.1.x (>=2026.3.22)',
9
+ },
10
+ ];
11
+
12
+ export function parseVersion(v) {
13
+ const m = String(v).match(/(\d+)\.(\d+)\.(\d+)/);
14
+ if (!m) return null;
15
+ return [Number(m[1]), Number(m[2]), Number(m[3])];
16
+ }
17
+
18
+ export function compareVersions(a, b) {
19
+ const va = parseVersion(a);
20
+ const vb = parseVersion(b);
21
+ if (!va || !vb) return NaN;
22
+ for (let i = 0; i < 3; i++) {
23
+ if (va[i] !== vb[i]) return va[i] - vb[i];
24
+ }
25
+ return 0;
26
+ }
27
+
28
+ export function satisfiesRange(version, range) {
29
+ if (range.gte && compareVersions(version, range.gte) < 0) return false;
30
+ if (range.lt && compareVersions(version, range.lt) >= 0) return false;
31
+ return true;
32
+ }
33
+
34
+ export function findCompatEntry(openclawVersion) {
35
+ return COMPAT_MATRIX.find(entry =>
36
+ satisfiesRange(openclawVersion, entry.openclawRange)
37
+ ) || null;
38
+ }
39
+
40
+ export function formatRange(range) {
41
+ const parts = [];
42
+ if (range.gte) parts.push(`>=${range.gte}`);
43
+ if (range.lt) parts.push(`<${range.lt}`);
44
+ return parts.join(' ');
45
+ }
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "openclaw-yunjia-cli",
3
+ "version": "0.0.1",
4
+ "description": "Lightweight installer for the OpenClaw Inspur Yunjia (浪潮云加) channel plugin",
5
+ "license": "MIT",
6
+ "author": "Inspur CCS",
7
+ "type": "module",
8
+ "bin": {
9
+ "openclaw-yunjia-cli": "./cli.mjs",
10
+ "yunjia-installer": "./cli.mjs"
11
+ },
12
+ "files": [
13
+ "cli.mjs",
14
+ "lib/"
15
+ ],
16
+ "scripts": {},
17
+ "dependencies": {
18
+ "qrcode": "^1.5.4"
19
+ },
20
+ "peerDependencies": {
21
+ "openclaw": ">=2026.3.22"
22
+ },
23
+ "peerDependenciesMeta": {
24
+ "openclaw": {
25
+ "optional": true
26
+ }
27
+ },
28
+ "engines": {
29
+ "node": ">=20"
30
+ }
31
+ }