ega-v9 1.0.2 → 1.0.3
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/cli/activation-success-message.d.ts +8 -0
- package/dist/cli/activation-success-message.js +40 -0
- package/dist/cli/register-command.js +8 -20
- package/dist/license/activation-required-message.d.ts +1 -0
- package/dist/license/activation-required-message.js +15 -0
- package/dist/license/public-key.d.ts +9 -0
- package/dist/license/public-key.js +29 -8
- package/package.json +5 -3
- package/scripts/postinstall-message.cjs +22 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type EGAActivationSuccessMessageInput = {
|
|
2
|
+
contactName: string;
|
|
3
|
+
companyName: string;
|
|
4
|
+
workEmail: string;
|
|
5
|
+
issuedAt: string;
|
|
6
|
+
expiresAt: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function buildActivationSuccessMessage(input: EGAActivationSuccessMessageInput): string;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildActivationSuccessMessage = buildActivationSuccessMessage;
|
|
4
|
+
function buildActivationSuccessMessage(input) {
|
|
5
|
+
return [
|
|
6
|
+
"",
|
|
7
|
+
"✓ Evaluation License Activated",
|
|
8
|
+
"",
|
|
9
|
+
`Contact Name: ${input.contactName}`,
|
|
10
|
+
`Company Name: ${input.companyName}`,
|
|
11
|
+
`Work Email: ${input.workEmail}`,
|
|
12
|
+
"",
|
|
13
|
+
`Issued: ${input.issuedAt}`,
|
|
14
|
+
`Expires: ${input.expiresAt}`,
|
|
15
|
+
"",
|
|
16
|
+
"✓ EGA V9 is now activated.",
|
|
17
|
+
"",
|
|
18
|
+
"You can start using Runtime Governance immediately.",
|
|
19
|
+
"",
|
|
20
|
+
"Need help or want to collaborate?",
|
|
21
|
+
"",
|
|
22
|
+
"Community Support",
|
|
23
|
+
"",
|
|
24
|
+
"GitHub Issues",
|
|
25
|
+
"https://github.com/paibyun9/EGA-V9/issues",
|
|
26
|
+
"",
|
|
27
|
+
"Use GitHub Issues for questions, bug reports,",
|
|
28
|
+
"feature requests, documentation feedback,",
|
|
29
|
+
"and independent reproducibility reports.",
|
|
30
|
+
"",
|
|
31
|
+
"Project Resources",
|
|
32
|
+
"",
|
|
33
|
+
"Live Demo",
|
|
34
|
+
"https://ega-v9.vercel.app/",
|
|
35
|
+
"",
|
|
36
|
+
"Official Website",
|
|
37
|
+
"https://lcm3.com/",
|
|
38
|
+
""
|
|
39
|
+
].join("\n");
|
|
40
|
+
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EGARegisterCommandError = void 0;
|
|
4
4
|
exports.runRegisterCommand = runRegisterCommand;
|
|
5
|
+
const activation_success_message_1 = require("./activation-success-message");
|
|
5
6
|
class EGARegisterCommandError extends Error {
|
|
6
7
|
constructor(code, message) {
|
|
7
8
|
super(`[${code}] ${message}`);
|
|
@@ -37,16 +38,6 @@ function formatDate(value) {
|
|
|
37
38
|
.toISOString()
|
|
38
39
|
.slice(0, 10);
|
|
39
40
|
}
|
|
40
|
-
function calculateDaysRemaining(expiresAt, now = new Date()) {
|
|
41
|
-
const expirationDate = new Date(expiresAt);
|
|
42
|
-
if (Number.isNaN(expirationDate.getTime())) {
|
|
43
|
-
return 0;
|
|
44
|
-
}
|
|
45
|
-
const dayMilliseconds = 24 * 60 * 60 * 1000;
|
|
46
|
-
return Math.max(0, Math.ceil((expirationDate.getTime() -
|
|
47
|
-
now.getTime()) /
|
|
48
|
-
dayMilliseconds));
|
|
49
|
-
}
|
|
50
41
|
async function runRegisterCommand(dependencies) {
|
|
51
42
|
dependencies.write("");
|
|
52
43
|
dependencies.write("Welcome to EGA V9");
|
|
@@ -87,16 +78,13 @@ async function runRegisterCommand(dependencies) {
|
|
|
87
78
|
overwrite: dependencies.overwrite ??
|
|
88
79
|
false
|
|
89
80
|
});
|
|
90
|
-
dependencies.write(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
dependencies.write(`License stored: ${licensePath}`);
|
|
98
|
-
dependencies.write("");
|
|
99
|
-
dependencies.write("Happy Building.");
|
|
81
|
+
dependencies.write((0, activation_success_message_1.buildActivationSuccessMessage)({
|
|
82
|
+
contactName,
|
|
83
|
+
companyName,
|
|
84
|
+
workEmail,
|
|
85
|
+
issuedAt: formatDate(license.issuedAt),
|
|
86
|
+
expiresAt: formatDate(license.expiresAt)
|
|
87
|
+
}));
|
|
100
88
|
return {
|
|
101
89
|
license,
|
|
102
90
|
licensePath
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function buildActivationRequiredMessage(): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildActivationRequiredMessage = buildActivationRequiredMessage;
|
|
4
|
+
function buildActivationRequiredMessage() {
|
|
5
|
+
return [
|
|
6
|
+
"EGA V9 is installed but not activated.",
|
|
7
|
+
"",
|
|
8
|
+
"Activate your FREE 90-Day Evaluation License.",
|
|
9
|
+
"No credit card required.",
|
|
10
|
+
"",
|
|
11
|
+
"Run:",
|
|
12
|
+
"",
|
|
13
|
+
" npx ega-v9 register"
|
|
14
|
+
].join("\n");
|
|
15
|
+
}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { KeyObject } from "crypto";
|
|
2
|
+
export declare const EGA_V9_LICENSE_PUBLIC_KEY_FINGERPRINT_SHA256 = "2caf94d33728abd5b61919a230cc2ef142762f98da036c3e2a02dfcdc536377d";
|
|
2
3
|
export declare class EGALicensePublicKeyError extends Error {
|
|
3
4
|
constructor(message: string);
|
|
4
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* Resolution order:
|
|
8
|
+
*
|
|
9
|
+
* 1. EGA_V9_LICENSE_PUBLIC_KEY_PEM or explicit argument
|
|
10
|
+
* for controlled development and testing.
|
|
11
|
+
* 2. Official EGA V9 Production Public Key bundled
|
|
12
|
+
* with the SDK for normal customer activation.
|
|
13
|
+
*/
|
|
5
14
|
export declare function loadEvaluationLicensePublicKey(publicKeyPem?: string | undefined): KeyObject;
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EGALicensePublicKeyError = void 0;
|
|
3
|
+
exports.EGALicensePublicKeyError = exports.EGA_V9_LICENSE_PUBLIC_KEY_FINGERPRINT_SHA256 = void 0;
|
|
4
4
|
exports.loadEvaluationLicensePublicKey = loadEvaluationLicensePublicKey;
|
|
5
5
|
const crypto_1 = require("crypto");
|
|
6
|
+
/**
|
|
7
|
+
* EGA V9 Production Root of Trust V1.
|
|
8
|
+
*
|
|
9
|
+
* Public verification material only.
|
|
10
|
+
* The corresponding Private Key must remain exclusively
|
|
11
|
+
* in the LCM License API secret environment.
|
|
12
|
+
*/
|
|
13
|
+
const OFFICIAL_EGA_V9_LICENSE_PUBLIC_KEY_PEM = "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAXyuVTginxHK4uxGvwXxc3yMUvmNA4c+NJyIOLvEZx+4=\n-----END PUBLIC KEY-----";
|
|
14
|
+
exports.EGA_V9_LICENSE_PUBLIC_KEY_FINGERPRINT_SHA256 = "2caf94d33728abd5b61919a230cc2ef142762f98da036c3e2a02dfcdc536377d";
|
|
6
15
|
class EGALicensePublicKeyError extends Error {
|
|
7
16
|
constructor(message) {
|
|
8
17
|
super(`[EGA_LICENSE_PUBLIC_KEY] ${message}`);
|
|
@@ -12,16 +21,28 @@ class EGALicensePublicKeyError extends Error {
|
|
|
12
21
|
}
|
|
13
22
|
}
|
|
14
23
|
exports.EGALicensePublicKeyError = EGALicensePublicKeyError;
|
|
24
|
+
/**
|
|
25
|
+
* Resolution order:
|
|
26
|
+
*
|
|
27
|
+
* 1. EGA_V9_LICENSE_PUBLIC_KEY_PEM or explicit argument
|
|
28
|
+
* for controlled development and testing.
|
|
29
|
+
* 2. Official EGA V9 Production Public Key bundled
|
|
30
|
+
* with the SDK for normal customer activation.
|
|
31
|
+
*/
|
|
15
32
|
function loadEvaluationLicensePublicKey(publicKeyPem = process.env
|
|
16
33
|
.EGA_V9_LICENSE_PUBLIC_KEY_PEM) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
publicKeyPem.trim()
|
|
20
|
-
|
|
21
|
-
throw new EGALicensePublicKeyError("The official EGA V9 Evaluation License public key is not configured.");
|
|
22
|
-
}
|
|
34
|
+
const selectedPublicKeyPem = typeof publicKeyPem === "string" &&
|
|
35
|
+
publicKeyPem.trim().length > 0
|
|
36
|
+
? publicKeyPem.trim()
|
|
37
|
+
: OFFICIAL_EGA_V9_LICENSE_PUBLIC_KEY_PEM;
|
|
23
38
|
try {
|
|
24
|
-
|
|
39
|
+
const publicKey = (0, crypto_1.createPublicKey)(selectedPublicKeyPem);
|
|
40
|
+
if (publicKey.type !== "public" ||
|
|
41
|
+
publicKey.asymmetricKeyType !==
|
|
42
|
+
"ed25519") {
|
|
43
|
+
throw new Error("Unsupported Public Key type.");
|
|
44
|
+
}
|
|
45
|
+
return publicKey;
|
|
25
46
|
}
|
|
26
47
|
catch {
|
|
27
48
|
throw new EGALicensePublicKeyError("The configured EGA V9 Evaluation License public key is invalid.");
|
package/package.json
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ega-v9",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "EGA V9 TypeScript SDK for replay, provenance, containment, and SCORP LOCK governance.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
9
|
"README.md",
|
|
10
|
-
"LICENSE"
|
|
10
|
+
"LICENSE",
|
|
11
|
+
"scripts/postinstall-message.cjs"
|
|
11
12
|
],
|
|
12
13
|
"scripts": {
|
|
13
14
|
"build": "tsc && node scripts/generate-esm-wrapper.cjs && node scripts/prepare-cli.cjs",
|
|
14
15
|
"test": "npm run build && node ../../scripts/testing/run-v1-test-suite.cjs",
|
|
15
|
-
"dev": "tsc --watch"
|
|
16
|
+
"dev": "tsc --watch",
|
|
17
|
+
"postinstall": "node scripts/postinstall-message.cjs"
|
|
16
18
|
},
|
|
17
19
|
"keywords": [
|
|
18
20
|
"ai-agents",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const message = [
|
|
4
|
+
"",
|
|
5
|
+
"────────────────────────────────────────────────────────",
|
|
6
|
+
"",
|
|
7
|
+
"✓ EGA V9 installed successfully.",
|
|
8
|
+
"",
|
|
9
|
+
"EGA V9 is installed but not activated.",
|
|
10
|
+
"",
|
|
11
|
+
"Activate your FREE 90-Day Evaluation License.",
|
|
12
|
+
"No credit card required.",
|
|
13
|
+
"",
|
|
14
|
+
"Run:",
|
|
15
|
+
"",
|
|
16
|
+
" npx ega-v9 register",
|
|
17
|
+
"",
|
|
18
|
+
"────────────────────────────────────────────────────────",
|
|
19
|
+
""
|
|
20
|
+
].join("\n");
|
|
21
|
+
|
|
22
|
+
process.stdout.write(message);
|