@sentriflow/core 0.4.1 → 0.5.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/package.json
CHANGED
|
@@ -13,7 +13,7 @@ import { resolve } from 'node:path';
|
|
|
13
13
|
/**
|
|
14
14
|
* Detected pack format
|
|
15
15
|
*/
|
|
16
|
-
export type PackFormat = 'grx2' | '
|
|
16
|
+
export type PackFormat = 'grx2' | 'unencrypted' | 'unknown';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Priority tiers by format.
|
|
@@ -21,13 +21,11 @@ export type PackFormat = 'grx2' | 'grpx' | 'unencrypted' | 'unknown';
|
|
|
21
21
|
*
|
|
22
22
|
* - unknown: 0 (fallback, should not occur in normal operation)
|
|
23
23
|
* - unencrypted: 100 (plain JS/TS modules)
|
|
24
|
-
* -
|
|
25
|
-
* - grx2: 300 (extended encrypted format)
|
|
24
|
+
* - grx2: 300 (GRX2 encrypted format)
|
|
26
25
|
*/
|
|
27
26
|
export const FORMAT_PRIORITIES: Record<PackFormat, number> = {
|
|
28
27
|
unknown: 0,
|
|
29
28
|
unencrypted: 100,
|
|
30
|
-
grpx: 200,
|
|
31
29
|
grx2: 300,
|
|
32
30
|
};
|
|
33
31
|
|
|
@@ -36,7 +34,6 @@ export const FORMAT_PRIORITIES: Record<PackFormat, number> = {
|
|
|
36
34
|
*/
|
|
37
35
|
const MAGIC_BYTES = {
|
|
38
36
|
GRX2: Buffer.from('GRX2', 'ascii'),
|
|
39
|
-
GRPX: Buffer.from('GRPX', 'ascii'),
|
|
40
37
|
} as const;
|
|
41
38
|
|
|
42
39
|
const MAGIC_BYTES_LENGTH = 4;
|
|
@@ -88,11 +85,6 @@ export async function detectPackFormat(filePath: string): Promise<PackFormat> {
|
|
|
88
85
|
return 'grx2';
|
|
89
86
|
}
|
|
90
87
|
|
|
91
|
-
// Check for GRPX magic bytes
|
|
92
|
-
if (buffer.equals(MAGIC_BYTES.GRPX)) {
|
|
93
|
-
return 'grpx';
|
|
94
|
-
}
|
|
95
|
-
|
|
96
88
|
// No magic bytes match - treat as unencrypted module
|
|
97
89
|
return 'unencrypted';
|
|
98
90
|
} catch (error) {
|