@kaitranntt/ccs 7.76.0-dev.6 → 7.77.0-dev.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/dist/cliproxy/binary/platform-detector.d.ts +4 -3
- package/dist/cliproxy/binary/platform-detector.d.ts.map +1 -1
- package/dist/cliproxy/binary/platform-detector.js +12 -7
- package/dist/cliproxy/binary/platform-detector.js.map +1 -1
- package/dist/cliproxy/types/platform-types.d.ts +2 -2
- package/dist/cliproxy/types/platform-types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Platform Detector for CLIProxyAPI Binary Downloads
|
|
3
3
|
*
|
|
4
4
|
* Detects OS and architecture to determine correct binary asset.
|
|
5
|
-
* Supports 6 platforms: darwin/linux/windows x amd64/
|
|
5
|
+
* Supports 6 platforms: darwin/linux/windows x amd64/aarch64
|
|
6
6
|
*/
|
|
7
|
-
import { PlatformInfo, CLIProxyBackend } from '../types';
|
|
7
|
+
import { PlatformInfo, SupportedArch, CLIProxyBackend } from '../types';
|
|
8
8
|
/** Backend configuration */
|
|
9
9
|
export declare const BACKEND_CONFIG: {
|
|
10
10
|
readonly original: {
|
|
@@ -53,6 +53,7 @@ export declare const CLIPROXY_FAULTY_RANGE: {
|
|
|
53
53
|
};
|
|
54
54
|
/** @deprecated Use CLIPROXY_FALLBACK_VERSION instead */
|
|
55
55
|
export declare const CLIPROXY_VERSION: "6.9.45";
|
|
56
|
+
export declare function mapNodeArchToReleaseArch(nodeArch: string): SupportedArch | undefined;
|
|
56
57
|
/**
|
|
57
58
|
* Detect current platform and return binary info
|
|
58
59
|
* @param version Optional version for binaryName (defaults to backend fallback)
|
|
@@ -99,7 +100,7 @@ export declare function getFallbackVersion(backend?: CLIProxyBackend): string;
|
|
|
99
100
|
export declare function isPlatformSupported(): boolean;
|
|
100
101
|
/**
|
|
101
102
|
* Get human-readable platform description
|
|
102
|
-
* @returns Description string (e.g., "macOS
|
|
103
|
+
* @returns Description string (e.g., "macOS ARM64")
|
|
103
104
|
*/
|
|
104
105
|
export declare function getPlatformDescription(): string;
|
|
105
106
|
//# sourceMappingURL=platform-detector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-detector.d.ts","sourceRoot":"","sources":["../../../src/cliproxy/binary/platform-detector.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,YAAY,
|
|
1
|
+
{"version":3,"file":"platform-detector.d.ts","sourceRoot":"","sources":["../../../src/cliproxy/binary/platform-detector.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,YAAY,EAEZ,aAAa,EAEb,eAAe,EAChB,MAAM,UAAU,CAAC;AAElB,4BAA4B;AAC5B,eAAO,MAAM,cAAc;;;;;;;;;;;;;CAajB,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,eAA4B,CAAC;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,UAAkD,CAAC;AAEzF;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,cAAc,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB;;;CAAuC,CAAC;AAE1E,wDAAwD;AACxD,eAAO,MAAM,gBAAgB,UAA4B,CAAC;AAgB1D,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAEpF;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,GAAE,eAAiC,GACzC,YAAY,CA+Bd;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,eAAiC,GAAG,MAAM,CAIpF;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,eAAiC,GAAG,MAAM,CAEvF;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,GAAE,eAAiC,GACzC,MAAM,CAKR;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,GAAE,eAAiC,GACzC,MAAM,CAIR;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,eAAiC,GAAG,MAAM,CAErF;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAO7C;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAU/C"}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Platform Detector for CLIProxyAPI Binary Downloads
|
|
4
4
|
*
|
|
5
5
|
* Detects OS and architecture to determine correct binary asset.
|
|
6
|
-
* Supports 6 platforms: darwin/linux/windows x amd64/
|
|
6
|
+
* Supports 6 platforms: darwin/linux/windows x amd64/aarch64
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.getPlatformDescription = exports.isPlatformSupported = exports.getFallbackVersion = exports.getChecksumsUrl = exports.getDownloadUrl = exports.getArchiveBinaryName = exports.getExecutableName = exports.detectPlatform = exports.CLIPROXY_VERSION = exports.CLIPROXY_FAULTY_RANGE = exports.CLIPROXY_MAX_STABLE_VERSION = exports.CLIPROXY_FALLBACK_VERSION = exports.DEFAULT_BACKEND = exports.BACKEND_CONFIG = void 0;
|
|
9
|
+
exports.getPlatformDescription = exports.isPlatformSupported = exports.getFallbackVersion = exports.getChecksumsUrl = exports.getDownloadUrl = exports.getArchiveBinaryName = exports.getExecutableName = exports.detectPlatform = exports.mapNodeArchToReleaseArch = exports.CLIPROXY_VERSION = exports.CLIPROXY_FAULTY_RANGE = exports.CLIPROXY_MAX_STABLE_VERSION = exports.CLIPROXY_FALLBACK_VERSION = exports.DEFAULT_BACKEND = exports.BACKEND_CONFIG = void 0;
|
|
10
10
|
/** Backend configuration */
|
|
11
11
|
exports.BACKEND_CONFIG = {
|
|
12
12
|
original: {
|
|
@@ -62,8 +62,12 @@ const OS_MAP = {
|
|
|
62
62
|
};
|
|
63
63
|
const ARCH_MAP = {
|
|
64
64
|
x64: 'amd64',
|
|
65
|
-
arm64: '
|
|
65
|
+
arm64: 'aarch64',
|
|
66
66
|
};
|
|
67
|
+
function mapNodeArchToReleaseArch(nodeArch) {
|
|
68
|
+
return ARCH_MAP[nodeArch];
|
|
69
|
+
}
|
|
70
|
+
exports.mapNodeArchToReleaseArch = mapNodeArchToReleaseArch;
|
|
67
71
|
/**
|
|
68
72
|
* Detect current platform and return binary info
|
|
69
73
|
* @param version Optional version for binaryName (defaults to backend fallback)
|
|
@@ -74,13 +78,13 @@ function detectPlatform(version, backend = exports.DEFAULT_BACKEND) {
|
|
|
74
78
|
const nodePlatform = process.platform;
|
|
75
79
|
const nodeArch = process.arch;
|
|
76
80
|
const os = OS_MAP[nodePlatform];
|
|
77
|
-
const arch =
|
|
81
|
+
const arch = mapNodeArchToReleaseArch(nodeArch);
|
|
78
82
|
if (!os) {
|
|
79
83
|
throw new Error(`Unsupported operating system: ${nodePlatform}\n` +
|
|
80
84
|
`Supported: macOS (darwin), Linux, Windows`);
|
|
81
85
|
}
|
|
82
86
|
if (!arch) {
|
|
83
|
-
throw new Error(`Unsupported CPU architecture: ${nodeArch}\n` + `Supported: x64 (amd64), arm64`);
|
|
87
|
+
throw new Error(`Unsupported CPU architecture: ${nodeArch}\n` + `Supported: x64 (amd64), arm64 (aarch64)`);
|
|
84
88
|
}
|
|
85
89
|
const config = exports.BACKEND_CONFIG[backend];
|
|
86
90
|
const ver = version || config.fallbackVersion;
|
|
@@ -164,13 +168,14 @@ function isPlatformSupported() {
|
|
|
164
168
|
exports.isPlatformSupported = isPlatformSupported;
|
|
165
169
|
/**
|
|
166
170
|
* Get human-readable platform description
|
|
167
|
-
* @returns Description string (e.g., "macOS
|
|
171
|
+
* @returns Description string (e.g., "macOS ARM64")
|
|
168
172
|
*/
|
|
169
173
|
function getPlatformDescription() {
|
|
170
174
|
try {
|
|
171
175
|
const platform = detectPlatform();
|
|
172
176
|
const osName = platform.os === 'darwin' ? 'macOS' : platform.os === 'linux' ? 'Linux' : 'Windows';
|
|
173
|
-
|
|
177
|
+
const archName = platform.arch === 'aarch64' ? 'ARM64' : platform.arch;
|
|
178
|
+
return `${osName} ${archName}`;
|
|
174
179
|
}
|
|
175
180
|
catch {
|
|
176
181
|
return `${process.platform} ${process.arch} (unsupported)`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-detector.js","sourceRoot":"","sources":["../../../src/cliproxy/binary/platform-detector.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAUH,4BAA4B;AACf,QAAA,cAAc,GAAG;IAC5B,QAAQ,EAAE;QACR,IAAI,EAAE,2BAA2B;QACjC,YAAY,EAAE,aAAa;QAC3B,UAAU,EAAE,eAAe;QAC3B,eAAe,EAAE,QAAQ;KAC1B;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,4BAA4B;QAClC,YAAY,EAAE,iBAAiB;QAC/B,UAAU,EAAE,oBAAoB;QAChC,eAAe,EAAE,UAAU;KAC5B;CACO,CAAC;AAEX;;;;;;GAMG;AACU,QAAA,eAAe,GAAoB,UAAU,CAAC;AAE3D;;;;;GAKG;AACU,QAAA,yBAAyB,GAAG,sBAAc,CAAC,uBAAe,CAAC,CAAC,eAAe,CAAC;AAEzF;;;;;GAKG;AACU,QAAA,2BAA2B,GAAG,WAAW,CAAC;AAEvD;;;;GAIG;AACU,QAAA,qBAAqB,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC;AAE1E,wDAAwD;AAC3C,QAAA,gBAAgB,GAAG,iCAAyB,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,GAA4C;IACtD,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,SAAS;CACjB,CAAC;AAEF,MAA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AC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;QACrF,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;QACvE,OAAO,GAAG,MAAM,IAAI,QAAQ,EAAE,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,gBAAgB,CAAC;IAC7D,CAAC;AACH,CAAC;AAVD,wDAUC"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/** Supported operating systems */
|
|
5
5
|
export type SupportedOS = 'darwin' | 'linux' | 'windows';
|
|
6
|
-
/** Supported CPU
|
|
7
|
-
export type SupportedArch = 'amd64' | 'arm64';
|
|
6
|
+
/** Supported CPU architecture labels from Node.js and CLIProxy release assets */
|
|
7
|
+
export type SupportedArch = 'amd64' | 'arm64' | 'aarch64';
|
|
8
8
|
/** Archive extension based on platform */
|
|
9
9
|
export type ArchiveExtension = 'tar.gz' | 'zip';
|
|
10
10
|
/** Platform detection result */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-types.d.ts","sourceRoot":"","sources":["../../../src/cliproxy/types/platform-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,kCAAkC;AAClC,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;AAEzD,
|
|
1
|
+
{"version":3,"file":"platform-types.d.ts","sourceRoot":"","sources":["../../../src/cliproxy/types/platform-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,kCAAkC;AAClC,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;AAEzD,iFAAiF;AACjF,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;AAE1D,0CAA0C;AAC1C,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEhD,gCAAgC;AAChC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,WAAW,CAAC;IAChB,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,gBAAgB,CAAC;CAC7B"}
|