@kya-os/cli 1.0.0-beta ā 1.0.0-beta-0.2
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/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +62 -61
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/claim.js +3 -3
- package/dist/commands/claim.js.map +1 -1
- package/dist/commands/env.d.ts +1 -1
- package/dist/commands/env.js +90 -89
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +48 -26
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/rotate.js +5 -5
- package/dist/commands/rotate.js.map +1 -1
- package/dist/components/agent-avatar.d.ts +28 -0
- package/dist/components/agent-avatar.d.ts.map +1 -0
- package/dist/components/agent-avatar.js +98 -0
- package/dist/components/agent-avatar.js.map +1 -0
- package/dist/components/agent-card.d.ts.map +1 -1
- package/dist/components/agent-card.js +5 -5
- package/dist/components/agent-card.js.map +1 -1
- package/dist/components/agent-table.d.ts +7 -0
- package/dist/components/agent-table.d.ts.map +1 -1
- package/dist/components/agent-table.js +223 -97
- package/dist/components/agent-table.js.map +1 -1
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/welcome.d.ts +5 -1
- package/dist/components/welcome.d.ts.map +1 -1
- package/dist/components/welcome.js +44 -10
- package/dist/components/welcome.js.map +1 -1
- package/dist/utils/env-manager.d.ts +3 -3
- package/dist/utils/env-manager.d.ts.map +1 -1
- package/dist/utils/env-manager.js +3 -3
- package/dist/utils/env-manager.js.map +1 -1
- package/dist/utils/prompts.d.ts +1 -0
- package/dist/utils/prompts.d.ts.map +1 -1
- package/dist/utils/prompts.js +15 -0
- package/dist/utils/prompts.js.map +1 -1
- package/dist/utils/validation.d.ts +9 -9
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +14 -10
- package/dist/utils/validation.js.map +1 -1
- package/package.json +4 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AASA,UAAU,YAAY;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAWD,wBAAsB,KAAK,CAAC,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AASA,UAAU,YAAY;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAWD,wBAAsB,KAAK,CAAC,OAAO,EAAE,YAAY,iBA0MhD"}
|
package/dist/commands/check.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import chalk from
|
|
2
|
-
import ora from
|
|
3
|
-
import { existsSync, readFileSync } from
|
|
4
|
-
import { join } from
|
|
5
|
-
import { EnvManager } from
|
|
6
|
-
import { detectPlatform } from
|
|
7
|
-
import { showSuccess, showWarning } from
|
|
8
|
-
import { cliEffects } from
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import ora from "ora";
|
|
3
|
+
import { existsSync, readFileSync } from "fs";
|
|
4
|
+
import { join } from "path";
|
|
5
|
+
import { EnvManager } from "../utils/env-manager.js";
|
|
6
|
+
import { detectPlatform } from "../utils/platform-detector.js";
|
|
7
|
+
import { showSuccess, showWarning } from "../utils/prompts.js";
|
|
8
|
+
import { cliEffects } from "../effects/cli-integration.js";
|
|
9
9
|
export async function check(options) {
|
|
10
|
-
console.log(chalk.cyan(
|
|
10
|
+
console.log(chalk.cyan("\nš Checking MCP-I Configuration\n"));
|
|
11
11
|
const envManager = new EnvManager();
|
|
12
12
|
let hasIssues = false;
|
|
13
13
|
// 1. Check for identity files
|
|
14
|
-
console.log(chalk.bold(
|
|
15
|
-
const identityFile = join(process.cwd(),
|
|
14
|
+
console.log(chalk.bold("š Identity Files:"));
|
|
15
|
+
const identityFile = join(process.cwd(), ".mcp-identity.json");
|
|
16
16
|
const hasIdentityFile = existsSync(identityFile);
|
|
17
17
|
if (hasIdentityFile) {
|
|
18
|
-
console.log(` ā ${chalk.green(
|
|
18
|
+
console.log(` ā ${chalk.green(".mcp-identity.json")} found`);
|
|
19
19
|
if (options.verbose) {
|
|
20
20
|
try {
|
|
21
|
-
const identity = JSON.parse(readFileSync(identityFile,
|
|
21
|
+
const identity = JSON.parse(readFileSync(identityFile, "utf-8"));
|
|
22
22
|
console.log(` DID: ${chalk.gray(identity.did)}`);
|
|
23
23
|
console.log(` Agent: ${chalk.gray(identity.agentSlug)}`);
|
|
24
24
|
console.log(` Registered: ${chalk.gray(identity.registeredAt)}`);
|
|
25
25
|
}
|
|
26
26
|
catch (error) {
|
|
27
|
-
console.log(` ${chalk.red(
|
|
27
|
+
console.log(` ${chalk.red("Error reading file")}`);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
|
-
console.log(` ā ${chalk.red(
|
|
32
|
+
console.log(` ā ${chalk.red(".mcp-identity.json")} not found`);
|
|
33
33
|
hasIssues = true;
|
|
34
34
|
}
|
|
35
35
|
// 2. Check environment files
|
|
36
|
-
console.log(`\n${chalk.bold(
|
|
36
|
+
console.log(`\n${chalk.bold("š Environment Files:")}`);
|
|
37
37
|
const platformInfo = detectPlatform();
|
|
38
|
-
const envFiles = [
|
|
38
|
+
const envFiles = [".env", ".env.local", ".env.production"];
|
|
39
39
|
let foundEnvFile = false;
|
|
40
40
|
for (const file of envFiles) {
|
|
41
41
|
if (existsSync(join(process.cwd(), file))) {
|
|
@@ -45,122 +45,123 @@ export async function check(options) {
|
|
|
45
45
|
const vars = envManager.readEnvFile(file);
|
|
46
46
|
const { valid, missing } = envManager.validateVariables(vars);
|
|
47
47
|
if (valid) {
|
|
48
|
-
console.log(` ${chalk.gray(
|
|
48
|
+
console.log(` ${chalk.gray("All required variables present")}`);
|
|
49
49
|
}
|
|
50
50
|
else {
|
|
51
|
-
console.log(` ${chalk.yellow(`Missing: ${missing.join(
|
|
51
|
+
console.log(` ${chalk.yellow(`Missing: ${missing.join(", ")}`)}`);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
if (!foundEnvFile) {
|
|
57
|
-
console.log(` ā ${chalk.red(
|
|
57
|
+
console.log(` ā ${chalk.red("No environment files found")}`);
|
|
58
58
|
hasIssues = true;
|
|
59
59
|
}
|
|
60
60
|
// 3. Check environment variables
|
|
61
|
-
console.log(`\n${chalk.bold(
|
|
61
|
+
console.log(`\n${chalk.bold("š Environment Variables:")}`);
|
|
62
62
|
const processVars = envManager.getFromProcess();
|
|
63
63
|
const { valid, missing } = envManager.validateVariables(processVars);
|
|
64
64
|
if (valid) {
|
|
65
|
-
console.log(` ā ${chalk.green(
|
|
65
|
+
console.log(` ā ${chalk.green("All required variables set")}`);
|
|
66
66
|
if (options.verbose) {
|
|
67
|
-
console.log(
|
|
67
|
+
console.log("\n" + envManager.formatForDisplay(processVars));
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
else {
|
|
71
|
-
console.log(` ā ${chalk.red(`Missing variables: ${missing.join(
|
|
71
|
+
console.log(` ā ${chalk.red(`Missing variables: ${missing.join(", ")}`)}`);
|
|
72
72
|
hasIssues = true;
|
|
73
73
|
}
|
|
74
74
|
// 4. Check .gitignore
|
|
75
|
-
console.log(`\n${chalk.bold(
|
|
76
|
-
const sensitiveFiles = [
|
|
75
|
+
console.log(`\n${chalk.bold("š« Git Security:")}`);
|
|
76
|
+
const sensitiveFiles = [".env", ".env.local", ".mcp-identity.json"];
|
|
77
77
|
const { missing: notIgnored } = envManager.checkGitignore(sensitiveFiles);
|
|
78
78
|
if (notIgnored.length === 0) {
|
|
79
|
-
console.log(` ā ${chalk.green(
|
|
79
|
+
console.log(` ā ${chalk.green("All sensitive files in .gitignore")}`);
|
|
80
80
|
}
|
|
81
81
|
else {
|
|
82
|
-
console.log(` ā ${chalk.red(
|
|
83
|
-
console.log(` ${chalk.yellow(
|
|
82
|
+
console.log(` ā ${chalk.red("Not in .gitignore:")} ${notIgnored.join(", ")}`);
|
|
83
|
+
console.log(` ${chalk.yellow("Run: npx kya-os init --force to fix")}`);
|
|
84
84
|
hasIssues = true;
|
|
85
85
|
}
|
|
86
86
|
// 5. Test registry connection (if we have identity)
|
|
87
|
-
if (processVars.
|
|
88
|
-
console.log(`\n${chalk.bold(
|
|
89
|
-
const spinner = ora(
|
|
87
|
+
if (processVars.MCP_IDENTITY_AGENT_DID && options.verbose) {
|
|
88
|
+
console.log(`\n${chalk.bold("š Registry Connection:")}`);
|
|
89
|
+
const spinner = ora("Testing connection to knowthat.ai...").start();
|
|
90
90
|
try {
|
|
91
|
-
const response = await fetch(
|
|
91
|
+
const response = await fetch("https://knowthat.ai/api/health");
|
|
92
92
|
if (response.ok) {
|
|
93
|
-
spinner.succeed(
|
|
93
|
+
spinner.succeed("Connected to knowthat.ai");
|
|
94
94
|
// Try to fetch agent info
|
|
95
95
|
if (processVars.MCP_IDENTITY_AGENT_SLUG) {
|
|
96
96
|
const agentResponse = await fetch(`https://knowthat.ai/api/agents/${processVars.MCP_IDENTITY_AGENT_SLUG}`);
|
|
97
97
|
if (agentResponse.ok) {
|
|
98
98
|
spinner.stop();
|
|
99
|
-
const agent = await agentResponse.json();
|
|
99
|
+
const agent = (await agentResponse.json());
|
|
100
100
|
// Show agent details with Decrypt effect
|
|
101
|
-
const agentDetailsText = ` ā ${chalk.green(
|
|
101
|
+
const agentDetailsText = ` ā ${chalk.green("Agent found in registry")}\n` +
|
|
102
102
|
` Name: ${chalk.gray(agent.name)}\n` +
|
|
103
103
|
` Status: ${chalk.gray(agent.status)}\n` +
|
|
104
104
|
` Profile: ${chalk.cyan(`https://knowthat.ai/agents/${processVars.MCP_IDENTITY_AGENT_SLUG}`)}`;
|
|
105
|
-
await cliEffects.showCustomEffect(
|
|
105
|
+
await cliEffects.showCustomEffect("decrypt", agentDetailsText, {
|
|
106
106
|
config: {
|
|
107
107
|
duration: 2000,
|
|
108
|
-
ciphertextColors: [
|
|
109
|
-
finalColor:
|
|
110
|
-
typingSpeed: 2
|
|
111
|
-
}
|
|
108
|
+
ciphertextColors: ["00ff00", "00ff80", "80ff00"],
|
|
109
|
+
finalColor: "ffffff",
|
|
110
|
+
typingSpeed: 2,
|
|
111
|
+
},
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
else if (agentResponse.status === 404) {
|
|
115
|
-
console.log(` ā ${chalk.yellow(
|
|
115
|
+
console.log(` ā ${chalk.yellow("Agent not found in registry")}`);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
else {
|
|
120
|
-
spinner.fail(
|
|
120
|
+
spinner.fail("Failed to connect to knowthat.ai");
|
|
121
121
|
hasIssues = true;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
catch (error) {
|
|
125
|
-
spinner.fail(
|
|
125
|
+
spinner.fail("Network error connecting to knowthat.ai");
|
|
126
126
|
hasIssues = true;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
// 6. Platform-specific checks
|
|
130
|
-
console.log(`\n${chalk.bold(
|
|
130
|
+
console.log(`\n${chalk.bold("š Platform Configuration:")}`);
|
|
131
131
|
console.log(` Platform: ${chalk.cyan(platformInfo.platform)}`);
|
|
132
|
-
if (platformInfo.platform ===
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
console.log(` ${chalk.
|
|
132
|
+
if (platformInfo.platform === "vercel" ||
|
|
133
|
+
platformInfo.platform === "nextjs") {
|
|
134
|
+
if (!processVars.MCP_IDENTITY_AGENT_DID) {
|
|
135
|
+
console.log(` ${chalk.yellow("ā ļø Remember to add environment variables to Vercel Dashboard")}`);
|
|
136
|
+
console.log(` ${chalk.gray("Run: npx kya-os env copy")}`);
|
|
136
137
|
}
|
|
137
138
|
}
|
|
138
139
|
// Summary
|
|
139
|
-
console.log(`\n${chalk.bold(
|
|
140
|
+
console.log(`\n${chalk.bold("š Summary:")}`);
|
|
140
141
|
if (!hasIssues) {
|
|
141
|
-
showSuccess(
|
|
142
|
-
if (processVars.
|
|
142
|
+
showSuccess("MCP-I is properly configured!");
|
|
143
|
+
if (processVars.MCP_IDENTITY_AGENT_DID) {
|
|
143
144
|
// Show identity summary with Decrypt effect
|
|
144
|
-
let summaryText = `\nšÆ Your agent DID: ${chalk.green(processVars.
|
|
145
|
+
let summaryText = `\nšÆ Your agent DID: ${chalk.green(processVars.MCP_IDENTITY_AGENT_DID)}`;
|
|
145
146
|
if (processVars.MCP_IDENTITY_AGENT_SLUG) {
|
|
146
147
|
summaryText += `\nš Agent profile: ${chalk.cyan(`https://knowthat.ai/agents/${processVars.MCP_IDENTITY_AGENT_SLUG}`)}`;
|
|
147
148
|
}
|
|
148
|
-
await cliEffects.showCustomEffect(
|
|
149
|
+
await cliEffects.showCustomEffect("decrypt", summaryText, {
|
|
149
150
|
config: {
|
|
150
151
|
duration: 2500,
|
|
151
|
-
ciphertextColors: [
|
|
152
|
-
finalColor:
|
|
152
|
+
ciphertextColors: ["008000", "00cb00", "00ff00"],
|
|
153
|
+
finalColor: "eda000",
|
|
153
154
|
typingSpeed: 1,
|
|
154
155
|
useGradient: true,
|
|
155
|
-
gradientDirection:
|
|
156
|
-
}
|
|
156
|
+
gradientDirection: "horizontal",
|
|
157
|
+
},
|
|
157
158
|
});
|
|
158
159
|
}
|
|
159
160
|
}
|
|
160
161
|
else {
|
|
161
|
-
showWarning(
|
|
162
|
-
console.log(
|
|
163
|
-
console.log(chalk.cyan(
|
|
162
|
+
showWarning("Some configuration issues found");
|
|
163
|
+
console.log("\nTo fix issues, run:");
|
|
164
|
+
console.log(chalk.cyan(" npx kya-os init"));
|
|
164
165
|
}
|
|
165
166
|
}
|
|
166
167
|
//# sourceMappingURL=check.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/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AAQ,EAAE,QAAQ,CAAC;oBAChD,UAAU,EAAE,QAAQ;oBACpB,WAAW,EAAE,CAAC;oBACd,WAAW,EAAE,IAAI;oBACjB,iBAAiB,EAAE,YAAY;iBAChC;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;SAAM,CAAC;QACN,WAAW,CAAC,iCAAiC,CAAC,CAAC;QAC/C,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;QACrC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC"}
|
package/dist/commands/claim.js
CHANGED
|
@@ -8,7 +8,7 @@ export async function claim() {
|
|
|
8
8
|
// Check for existing identity
|
|
9
9
|
const envManager = new EnvManager();
|
|
10
10
|
const processVars = envManager.getFromProcess();
|
|
11
|
-
if (!processVars.
|
|
11
|
+
if (!processVars.MCP_IDENTITY_AGENT_DID) {
|
|
12
12
|
showError('No MCP-I identity found. Run "npx kya-os init" first.');
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
@@ -20,7 +20,7 @@ export async function claim() {
|
|
|
20
20
|
const { editUrl, claimUrl } = await identity.requestEditAccess();
|
|
21
21
|
spinner.succeed("URLs retrieved successfully!");
|
|
22
22
|
console.log(`\n${chalk.bold("š Agent Information:")}`);
|
|
23
|
-
console.log(` DID: ${chalk.gray(processVars.
|
|
23
|
+
console.log(` DID: ${chalk.gray(processVars.MCP_IDENTITY_AGENT_DID)}`);
|
|
24
24
|
if (processVars.MCP_IDENTITY_AGENT_SLUG) {
|
|
25
25
|
console.log(` Profile: ${chalk.cyan(`https://knowthat.ai/agents/${processVars.MCP_IDENTITY_AGENT_SLUG}`)}`);
|
|
26
26
|
}
|
|
@@ -39,7 +39,7 @@ export async function claim() {
|
|
|
39
39
|
console.log(` ${chalk.cyan(editUrl)}`);
|
|
40
40
|
console.log(` ${chalk.gray("(Requires authentication after claiming)")}`);
|
|
41
41
|
// Check if agent is draft
|
|
42
|
-
if (processVars.
|
|
42
|
+
if (processVars.MCP_IDENTITY_AGENT_DID?.includes("localhost")) {
|
|
43
43
|
showInfo("This is a development/draft agent. It won't appear in public directories.");
|
|
44
44
|
}
|
|
45
45
|
showSuccess("Management URLs ready!");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claim.js","sourceRoot":"","sources":["../../src/commands/claim.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEpE,MAAM,CAAC,KAAK,UAAU,KAAK;IACzB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAExD,8BAA8B;IAC9B,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IACpC,MAAM,WAAW,GAAG,UAAU,CAAC,cAAc,EAAE,CAAC;IAEhD,IAAI,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"claim.js","sourceRoot":"","sources":["../../src/commands/claim.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEpE,MAAM,CAAC,KAAK,UAAU,KAAK;IACzB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAExD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,CAAC,SAAS,CAAC,EAAE,CAAC;YAC9C,SAAS,CAAC,gDAAgD,CAAC,CAAC;QAC9D,CAAC;aAAM,CAAC;YACN,SAAS,CAAC,KAAK,CAAC,OAAO,IAAI,+BAA+B,CAAC,CAAC;YAE5D,uBAAuB;YACvB,IAAI,WAAW,CAAC,uBAAuB,EAAE,CAAC;gBACxC,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,gCAAgC,CAAC,EAAE,CAAC,CAAC;gBACjE,OAAO,CAAC,GAAG,CACT,GAAG,KAAK,CAAC,IAAI,CACX,8BAA8B,WAAW,CAAC,uBAAuB,EAAE,CACpE,EAAE,CACJ,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/commands/env.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function env(subcommand:
|
|
1
|
+
export declare function env(subcommand: "show" | "copy" | "verify"): Promise<void>;
|
|
2
2
|
//# sourceMappingURL=env.d.ts.map
|
package/dist/commands/env.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import chalk from
|
|
2
|
-
import { exec } from
|
|
3
|
-
import { promisify } from
|
|
4
|
-
import { EnvManager } from
|
|
5
|
-
import { detectPlatform } from
|
|
6
|
-
import { showSuccess, showError } from
|
|
7
|
-
import { cliEffects } from
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import { exec } from "child_process";
|
|
3
|
+
import { promisify } from "util";
|
|
4
|
+
import { EnvManager } from "../utils/env-manager.js";
|
|
5
|
+
import { detectPlatform } from "../utils/platform-detector.js";
|
|
6
|
+
import { showSuccess, showError } from "../utils/prompts.js";
|
|
7
|
+
import { cliEffects } from "../effects/cli-integration.js";
|
|
8
8
|
const execAsync = promisify(exec);
|
|
9
9
|
export async function env(subcommand) {
|
|
10
10
|
const envManager = new EnvManager();
|
|
11
11
|
switch (subcommand) {
|
|
12
|
-
case
|
|
12
|
+
case "show":
|
|
13
13
|
await showEnv(envManager);
|
|
14
14
|
break;
|
|
15
|
-
case
|
|
15
|
+
case "copy":
|
|
16
16
|
await copyEnv(envManager);
|
|
17
17
|
break;
|
|
18
|
-
case
|
|
18
|
+
case "verify":
|
|
19
19
|
await verifyEnv(envManager);
|
|
20
20
|
break;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
async function showEnv(envManager) {
|
|
24
|
-
console.log(chalk.cyan(
|
|
24
|
+
console.log(chalk.cyan("\nš MCP-I Environment Variables\n"));
|
|
25
25
|
// Try to get from multiple sources
|
|
26
26
|
let vars = envManager.getFromProcess();
|
|
27
|
-
if (!vars.
|
|
27
|
+
if (!vars.MCP_IDENTITY_AGENT_DID) {
|
|
28
28
|
// Try reading from files
|
|
29
|
-
const files = [
|
|
29
|
+
const files = [".env.local", ".env", ".env.production"];
|
|
30
30
|
for (const file of files) {
|
|
31
31
|
const fileVars = envManager.readEnvFile(file);
|
|
32
|
-
if (fileVars.
|
|
32
|
+
if (fileVars.MCP_IDENTITY_AGENT_DID) {
|
|
33
33
|
vars = fileVars;
|
|
34
34
|
console.log(chalk.gray(`(from ${file})\n`));
|
|
35
35
|
break;
|
|
@@ -37,66 +37,66 @@ async function showEnv(envManager) {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
40
|
-
console.log(chalk.gray(
|
|
40
|
+
console.log(chalk.gray("(from process.env)\n"));
|
|
41
41
|
}
|
|
42
|
-
if (!vars.
|
|
43
|
-
showError(
|
|
44
|
-
console.log(
|
|
45
|
-
console.log(chalk.cyan(
|
|
42
|
+
if (!vars.MCP_IDENTITY_AGENT_DID) {
|
|
43
|
+
showError("No MCP-I environment variables found");
|
|
44
|
+
console.log("Run the following to initialize:");
|
|
45
|
+
console.log(chalk.cyan(" npx kya-os init"));
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
// Display variables with binary matrix effect
|
|
49
49
|
const varsDisplay = envManager.formatForDisplay(vars, true);
|
|
50
|
-
await cliEffects.showCustomEffect(
|
|
50
|
+
await cliEffects.showCustomEffect("binarypath", varsDisplay, {
|
|
51
51
|
config: {
|
|
52
52
|
duration: 3000,
|
|
53
53
|
streamCount: 8,
|
|
54
|
-
binaryColors: [
|
|
55
|
-
revealColor:
|
|
56
|
-
streamDelay: 50
|
|
57
|
-
}
|
|
54
|
+
binaryColors: ["008800", "00ff00"],
|
|
55
|
+
revealColor: "00ff00",
|
|
56
|
+
streamDelay: 50,
|
|
57
|
+
},
|
|
58
58
|
});
|
|
59
59
|
// Platform-specific instructions
|
|
60
60
|
const platform = detectPlatform();
|
|
61
|
-
console.log(chalk.bold(
|
|
62
|
-
if (platform.platform ===
|
|
63
|
-
console.log(
|
|
64
|
-
console.log(
|
|
65
|
-
console.log(
|
|
66
|
-
console.log(
|
|
67
|
-
}
|
|
68
|
-
else if (platform.platform ===
|
|
69
|
-
console.log(
|
|
70
|
-
console.log(
|
|
71
|
-
console.log(
|
|
72
|
-
console.log(
|
|
73
|
-
}
|
|
74
|
-
else if (platform.platform ===
|
|
75
|
-
console.log(
|
|
76
|
-
console.log(
|
|
77
|
-
console.log(
|
|
78
|
-
console.log(
|
|
61
|
+
console.log(chalk.bold("\nš Platform-specific usage:\n"));
|
|
62
|
+
if (platform.platform === "vercel" || platform.platform === "nextjs") {
|
|
63
|
+
console.log("For Vercel deployment:");
|
|
64
|
+
console.log("1. Copy these variables: " + chalk.cyan("npx kya-os env copy"));
|
|
65
|
+
console.log("2. Go to Vercel Dashboard ā Settings ā Environment Variables");
|
|
66
|
+
console.log("3. Add each variable for Production/Preview/Development as needed");
|
|
67
|
+
}
|
|
68
|
+
else if (platform.platform === "lambda") {
|
|
69
|
+
console.log("For AWS Lambda:");
|
|
70
|
+
console.log("1. Add to your Lambda function configuration");
|
|
71
|
+
console.log("2. Or use AWS Systems Manager Parameter Store");
|
|
72
|
+
console.log("3. Or add to your serverless.yml/SAM template");
|
|
73
|
+
}
|
|
74
|
+
else if (platform.platform === "docker") {
|
|
75
|
+
console.log("For Docker:");
|
|
76
|
+
console.log("1. Add to docker-compose.yml under environment:");
|
|
77
|
+
console.log("2. Or use --env-file with docker run");
|
|
78
|
+
console.log("3. Or build args in Dockerfile");
|
|
79
79
|
}
|
|
80
80
|
else {
|
|
81
|
-
console.log(
|
|
81
|
+
console.log("Add these to your deployment platform's environment configuration.");
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
async function copyEnv(envManager) {
|
|
85
|
-
console.log(chalk.cyan(
|
|
85
|
+
console.log(chalk.cyan("\nš Copying MCP-I Environment Variables\n"));
|
|
86
86
|
// Get variables
|
|
87
87
|
let vars = envManager.getFromProcess();
|
|
88
|
-
if (!vars.
|
|
89
|
-
const files = [
|
|
88
|
+
if (!vars.MCP_IDENTITY_AGENT_DID) {
|
|
89
|
+
const files = [".env.local", ".env"];
|
|
90
90
|
for (const file of files) {
|
|
91
91
|
const fileVars = envManager.readEnvFile(file);
|
|
92
|
-
if (fileVars.
|
|
92
|
+
if (fileVars.MCP_IDENTITY_AGENT_DID) {
|
|
93
93
|
vars = fileVars;
|
|
94
94
|
break;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
if (!vars.
|
|
99
|
-
showError(
|
|
98
|
+
if (!vars.MCP_IDENTITY_AGENT_DID) {
|
|
99
|
+
showError("No MCP-I environment variables found");
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
102
|
// Format for clipboard (no masking)
|
|
@@ -106,25 +106,25 @@ async function copyEnv(envManager) {
|
|
|
106
106
|
// Detect OS and use appropriate command
|
|
107
107
|
const platform = process.platform;
|
|
108
108
|
let command;
|
|
109
|
-
if (platform ===
|
|
110
|
-
command =
|
|
109
|
+
if (platform === "darwin") {
|
|
110
|
+
command = "pbcopy";
|
|
111
111
|
}
|
|
112
|
-
else if (platform ===
|
|
113
|
-
command =
|
|
112
|
+
else if (platform === "win32") {
|
|
113
|
+
command = "clip";
|
|
114
114
|
}
|
|
115
115
|
else {
|
|
116
116
|
// Linux - try xclip first, then xsel
|
|
117
117
|
try {
|
|
118
|
-
await execAsync(
|
|
119
|
-
command =
|
|
118
|
+
await execAsync("which xclip");
|
|
119
|
+
command = "xclip -selection clipboard";
|
|
120
120
|
}
|
|
121
121
|
catch {
|
|
122
122
|
try {
|
|
123
|
-
await execAsync(
|
|
124
|
-
command =
|
|
123
|
+
await execAsync("which xsel");
|
|
124
|
+
command = "xsel --clipboard --input";
|
|
125
125
|
}
|
|
126
126
|
catch {
|
|
127
|
-
throw new Error(
|
|
127
|
+
throw new Error("No clipboard utility found. Install xclip or xsel.");
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
}
|
|
@@ -135,87 +135,88 @@ async function copyEnv(envManager) {
|
|
|
135
135
|
proc.stdin.end();
|
|
136
136
|
}
|
|
137
137
|
await new Promise((resolve, reject) => {
|
|
138
|
-
proc.on(
|
|
138
|
+
proc.on("exit", (code) => {
|
|
139
139
|
if (code === 0)
|
|
140
140
|
resolve(null);
|
|
141
141
|
else
|
|
142
142
|
reject(new Error(`Clipboard command failed with code ${code}`));
|
|
143
143
|
});
|
|
144
|
-
proc.on(
|
|
144
|
+
proc.on("error", reject);
|
|
145
145
|
});
|
|
146
|
-
showSuccess(
|
|
147
|
-
console.log(
|
|
148
|
-
console.log(
|
|
149
|
-
console.log(
|
|
150
|
-
console.log(
|
|
146
|
+
showSuccess("Environment variables copied to clipboard!");
|
|
147
|
+
console.log("\nNext steps:");
|
|
148
|
+
console.log("1. Paste into your deployment platform's environment configuration");
|
|
149
|
+
console.log("2. Make sure to save/apply the changes");
|
|
150
|
+
console.log("\n" +
|
|
151
|
+
chalk.yellow("ā ļø Keep these values secure - they contain your private key!"));
|
|
151
152
|
}
|
|
152
153
|
catch (error) {
|
|
153
154
|
showError(`Failed to copy to clipboard: ${error.message}`);
|
|
154
|
-
console.log(
|
|
155
|
-
console.log(chalk.gray(
|
|
155
|
+
console.log("\nManual copy:\n");
|
|
156
|
+
console.log(chalk.gray("ā".repeat(60)));
|
|
156
157
|
console.log(formatted);
|
|
157
|
-
console.log(chalk.gray(
|
|
158
|
+
console.log(chalk.gray("ā".repeat(60)));
|
|
158
159
|
}
|
|
159
160
|
}
|
|
160
161
|
async function verifyEnv(envManager) {
|
|
161
|
-
console.log(chalk.cyan(
|
|
162
|
+
console.log(chalk.cyan("\nā
Verifying MCP-I Environment\n"));
|
|
162
163
|
// Check process.env
|
|
163
164
|
const processVars = envManager.getFromProcess();
|
|
164
165
|
const { valid: processValid, missing: processMissing } = envManager.validateVariables(processVars);
|
|
165
|
-
console.log(chalk.bold(
|
|
166
|
+
console.log(chalk.bold("Process Environment:"));
|
|
166
167
|
if (processValid) {
|
|
167
|
-
console.log(` ā ${chalk.green(
|
|
168
|
+
console.log(` ā ${chalk.green("All variables present in process.env")}`);
|
|
168
169
|
}
|
|
169
170
|
else {
|
|
170
|
-
console.log(` ā ${chalk.red(
|
|
171
|
+
console.log(` ā ${chalk.red("Missing from process.env:")} ${processMissing.join(", ")}`);
|
|
171
172
|
}
|
|
172
173
|
// Check files
|
|
173
|
-
console.log(chalk.bold(
|
|
174
|
-
const files = [
|
|
174
|
+
console.log(chalk.bold("\nEnvironment Files:"));
|
|
175
|
+
const files = [".env", ".env.local", ".env.production"];
|
|
175
176
|
let foundValidFile = false;
|
|
176
177
|
for (const file of files) {
|
|
177
178
|
const fileVars = envManager.readEnvFile(file);
|
|
178
|
-
if (fileVars.
|
|
179
|
+
if (fileVars.MCP_IDENTITY_AGENT_DID) {
|
|
179
180
|
const { valid, missing } = envManager.validateVariables(fileVars);
|
|
180
181
|
if (valid) {
|
|
181
182
|
console.log(` ā ${chalk.green(file)} - All variables present`);
|
|
182
183
|
foundValidFile = true;
|
|
183
184
|
}
|
|
184
185
|
else {
|
|
185
|
-
console.log(` ā ļø ${chalk.yellow(file)} - Missing: ${missing.join(
|
|
186
|
+
console.log(` ā ļø ${chalk.yellow(file)} - Missing: ${missing.join(", ")}`);
|
|
186
187
|
}
|
|
187
188
|
}
|
|
188
189
|
}
|
|
189
190
|
if (!foundValidFile && !processValid) {
|
|
190
|
-
console.log(` ā ${chalk.red(
|
|
191
|
+
console.log(` ā ${chalk.red("No valid environment configuration found")}`);
|
|
191
192
|
}
|
|
192
193
|
// Platform-specific checks
|
|
193
194
|
const platform = detectPlatform();
|
|
194
|
-
console.log(chalk.bold(
|
|
195
|
-
if (platform.platform ===
|
|
195
|
+
console.log(chalk.bold("\nPlatform-Specific:"));
|
|
196
|
+
if (platform.platform === "vercel" || platform.platform === "nextjs") {
|
|
196
197
|
if (process.env.VERCEL) {
|
|
197
|
-
console.log(` ā ${chalk.green(
|
|
198
|
+
console.log(` ā ${chalk.green("Running on Vercel")}`);
|
|
198
199
|
if (processValid) {
|
|
199
|
-
console.log(` ā ${chalk.green(
|
|
200
|
+
console.log(` ā ${chalk.green("Environment variables configured in Vercel")}`);
|
|
200
201
|
}
|
|
201
202
|
else {
|
|
202
|
-
console.log(` ā ${chalk.red(
|
|
203
|
+
console.log(` ā ${chalk.red("Environment variables not found - add to Vercel Dashboard")}`);
|
|
203
204
|
}
|
|
204
205
|
}
|
|
205
206
|
else {
|
|
206
|
-
console.log(` ā¹ļø ${chalk.blue(
|
|
207
|
+
console.log(` ā¹ļø ${chalk.blue("Local development - using .env.local")}`);
|
|
207
208
|
}
|
|
208
209
|
}
|
|
209
210
|
// Summary
|
|
210
|
-
console.log(chalk.bold(
|
|
211
|
+
console.log(chalk.bold("\nSummary:"));
|
|
211
212
|
if (processValid || foundValidFile) {
|
|
212
|
-
showSuccess(
|
|
213
|
+
showSuccess("Environment configuration is valid!");
|
|
213
214
|
}
|
|
214
215
|
else {
|
|
215
|
-
showError(
|
|
216
|
-
console.log(
|
|
217
|
-
console.log(
|
|
218
|
-
console.log(
|
|
216
|
+
showError("Environment configuration issues found");
|
|
217
|
+
console.log("\nTo fix:");
|
|
218
|
+
console.log("1. Run: " + chalk.cyan("npx kya-os init"));
|
|
219
|
+
console.log("2. Or manually create .env file with required variables");
|
|
219
220
|
}
|
|
220
221
|
}
|
|
221
222
|
//# sourceMappingURL=env.js.map
|