@kya-os/cli 0.1.0-beta.1 ā 0.1.0-beta.10
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/README.md +210 -34
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +73 -57
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/claim.js +33 -39
- package/dist/commands/claim.js.map +1 -1
- package/dist/commands/cli-experience-demo-simple.d.ts +14 -0
- package/dist/commands/cli-experience-demo-simple.d.ts.map +1 -0
- package/dist/commands/cli-experience-demo-simple.js +119 -0
- package/dist/commands/cli-experience-demo-simple.js.map +1 -0
- package/dist/commands/cli-experience-demo.d.ts +14 -0
- package/dist/commands/cli-experience-demo.d.ts.map +1 -0
- package/dist/commands/cli-experience-demo.js +172 -0
- package/dist/commands/cli-experience-demo.js.map +1 -0
- package/dist/commands/effects-demo.d.ts +10 -0
- package/dist/commands/effects-demo.d.ts.map +1 -0
- package/dist/commands/effects-demo.js +292 -0
- package/dist/commands/effects-demo.js.map +1 -0
- package/dist/commands/env.d.ts.map +1 -1
- package/dist/commands/env.js +55 -51
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +527 -102
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/rotate.d.ts.map +1 -1
- package/dist/commands/rotate.js +81 -60
- package/dist/commands/rotate.js.map +1 -1
- package/dist/dev.d.ts +7 -0
- package/dist/dev.d.ts.map +1 -0
- package/dist/dev.js +9 -0
- package/dist/dev.js.map +1 -0
- package/dist/effects/__tests__/effects.test.d.ts +5 -0
- package/dist/effects/__tests__/effects.test.d.ts.map +1 -0
- package/dist/effects/__tests__/effects.test.js +206 -0
- package/dist/effects/__tests__/effects.test.js.map +1 -0
- package/dist/effects/animation-engine.d.ts +173 -0
- package/dist/effects/animation-engine.d.ts.map +1 -0
- package/dist/effects/animation-engine.js +254 -0
- package/dist/effects/animation-engine.js.map +1 -0
- package/dist/effects/cli-integration.d.ts +86 -0
- package/dist/effects/cli-integration.d.ts.map +1 -0
- package/dist/effects/cli-integration.js +309 -0
- package/dist/effects/cli-integration.js.map +1 -0
- package/dist/effects/config.d.ts +95 -0
- package/dist/effects/config.d.ts.map +1 -0
- package/dist/effects/config.js +216 -0
- package/dist/effects/config.js.map +1 -0
- package/dist/effects/effect-runner.d.ts +69 -0
- package/dist/effects/effect-runner.d.ts.map +1 -0
- package/dist/effects/effect-runner.js +255 -0
- package/dist/effects/effect-runner.js.map +1 -0
- package/dist/effects/gradient.d.ts +131 -0
- package/dist/effects/gradient.d.ts.map +1 -0
- package/dist/effects/gradient.js +236 -0
- package/dist/effects/gradient.js.map +1 -0
- package/dist/effects/implementations/beams.d.ts +80 -0
- package/dist/effects/implementations/beams.d.ts.map +1 -0
- package/dist/effects/implementations/beams.js +221 -0
- package/dist/effects/implementations/beams.js.map +1 -0
- package/dist/effects/implementations/binary-path.d.ts +88 -0
- package/dist/effects/implementations/binary-path.d.ts.map +1 -0
- package/dist/effects/implementations/binary-path.js +296 -0
- package/dist/effects/implementations/binary-path.js.map +1 -0
- package/dist/effects/implementations/blackhole.d.ts +98 -0
- package/dist/effects/implementations/blackhole.d.ts.map +1 -0
- package/dist/effects/implementations/blackhole.js +394 -0
- package/dist/effects/implementations/blackhole.js.map +1 -0
- package/dist/effects/implementations/burn.d.ts +74 -0
- package/dist/effects/implementations/burn.d.ts.map +1 -0
- package/dist/effects/implementations/burn.js +234 -0
- package/dist/effects/implementations/burn.js.map +1 -0
- package/dist/effects/implementations/decrypt.d.ts +115 -0
- package/dist/effects/implementations/decrypt.d.ts.map +1 -0
- package/dist/effects/implementations/decrypt.js +394 -0
- package/dist/effects/implementations/decrypt.js.map +1 -0
- package/dist/effects/implementations/test.d.ts +113 -0
- package/dist/effects/implementations/test.d.ts.map +1 -0
- package/dist/effects/implementations/test.js +552 -0
- package/dist/effects/implementations/test.js.map +1 -0
- package/dist/effects/implementations/waves.d.ts +78 -0
- package/dist/effects/implementations/waves.d.ts.map +1 -0
- package/dist/effects/implementations/waves.js +278 -0
- package/dist/effects/implementations/waves.js.map +1 -0
- package/dist/effects/index.d.ts +37 -0
- package/dist/effects/index.d.ts.map +1 -0
- package/dist/effects/index.js +79 -0
- package/dist/effects/index.js.map +1 -0
- package/dist/effects/motion-engine.d.ts +168 -0
- package/dist/effects/motion-engine.d.ts.map +1 -0
- package/dist/effects/motion-engine.js +353 -0
- package/dist/effects/motion-engine.js.map +1 -0
- package/dist/effects/safe-executor.d.ts +55 -0
- package/dist/effects/safe-executor.d.ts.map +1 -0
- package/dist/effects/safe-executor.js +210 -0
- package/dist/effects/safe-executor.js.map +1 -0
- package/dist/effects/template/effect-template.d.ts +97 -0
- package/dist/effects/template/effect-template.d.ts.map +1 -0
- package/dist/effects/template/effect-template.js +208 -0
- package/dist/effects/template/effect-template.js.map +1 -0
- package/dist/effects/types.d.ts +199 -0
- package/dist/effects/types.d.ts.map +1 -0
- package/dist/effects/types.js +80 -0
- package/dist/effects/types.js.map +1 -0
- package/dist/effects/utils.d.ts +104 -0
- package/dist/effects/utils.d.ts.map +1 -0
- package/dist/effects/utils.js +280 -0
- package/dist/effects/utils.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +52 -51
- package/dist/index.js.map +1 -1
- package/dist/utils/env-manager.d.ts +66 -2
- package/dist/utils/env-manager.d.ts.map +1 -1
- package/dist/utils/env-manager.js +355 -65
- package/dist/utils/env-manager.js.map +1 -1
- package/dist/utils/platform-detector.js +15 -19
- package/dist/utils/platform-detector.js.map +1 -1
- package/dist/utils/prompts.js +21 -34
- package/dist/utils/prompts.js.map +1 -1
- package/package.json +10 -5
package/README.md
CHANGED
|
@@ -1,80 +1,256 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @kya-os/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Command-line interface for KYA-OS MCP-I setup and management. Create verifiable AI agent identities with beautiful terminal animations.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
8
|
+
npm install -g @kya-os/cli
|
|
9
|
+
# or use directly with npx
|
|
10
|
+
npx @kya-os/cli init
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
##
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Initialize KYA-OS in your project
|
|
17
|
+
npx @kya-os/cli init
|
|
18
|
+
|
|
19
|
+
# Check your setup status
|
|
20
|
+
npx @kya-os/cli check
|
|
12
21
|
|
|
13
|
-
|
|
22
|
+
# See the full CLI experience demo
|
|
23
|
+
npx @kya-os/cli cli-demo
|
|
24
|
+
```
|
|
14
25
|
|
|
15
26
|
## Features
|
|
16
27
|
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
28
|
+
- š **Zero-config setup** - Auto-detects your project type (Next.js, Node.js, etc.)
|
|
29
|
+
- šØ **Beautiful animations** - Terminal effects for key operations
|
|
30
|
+
- š **Secure by default** - Encrypted key storage, automatic rotation support
|
|
31
|
+
- š **Platform agnostic** - Works with Vercel, AWS, Docker, and more
|
|
32
|
+
- ā” **Developer friendly** - Clear error messages, helpful suggestions
|
|
22
33
|
|
|
23
34
|
## Commands
|
|
24
35
|
|
|
25
36
|
### `init`
|
|
26
|
-
|
|
37
|
+
|
|
38
|
+
Initialize MCP-I in your project with an interactive setup wizard.
|
|
27
39
|
|
|
28
40
|
```bash
|
|
29
|
-
|
|
41
|
+
kya-os init
|
|
30
42
|
```
|
|
31
43
|
|
|
44
|
+
Options:
|
|
45
|
+
- `-n, --name <name>` - Agent name
|
|
46
|
+
- `-d, --description <description>` - Agent description
|
|
47
|
+
- `-r, --repository <url>` - Repository URL
|
|
48
|
+
- `-p, --platform <platform>` - Target platform (auto-detected if not specified)
|
|
49
|
+
- `--skip-registration` - Skip agent registration (create files only)
|
|
50
|
+
- `--force` - Overwrite existing configuration
|
|
51
|
+
|
|
32
52
|
### `check`
|
|
33
|
-
|
|
53
|
+
|
|
54
|
+
Check MCP-I setup status and verify configuration.
|
|
34
55
|
|
|
35
56
|
```bash
|
|
36
|
-
|
|
57
|
+
kya-os check
|
|
37
58
|
```
|
|
38
59
|
|
|
60
|
+
Options:
|
|
61
|
+
- `-v, --verbose` - Show detailed information
|
|
62
|
+
|
|
39
63
|
### `env`
|
|
40
|
-
|
|
64
|
+
|
|
65
|
+
Manage environment variables for different deployment targets.
|
|
41
66
|
|
|
42
67
|
```bash
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
68
|
+
# Show required environment variables
|
|
69
|
+
kya-os env show
|
|
70
|
+
|
|
71
|
+
# Copy environment variables to clipboard
|
|
72
|
+
kya-os env copy
|
|
73
|
+
|
|
74
|
+
# Verify environment variables are set correctly
|
|
75
|
+
kya-os env verify
|
|
46
76
|
```
|
|
47
77
|
|
|
48
78
|
### `rotate`
|
|
49
|
-
|
|
79
|
+
|
|
80
|
+
Rotate identity keys with automatic grace period handling.
|
|
50
81
|
|
|
51
82
|
```bash
|
|
52
|
-
|
|
83
|
+
kya-os rotate
|
|
53
84
|
```
|
|
54
85
|
|
|
86
|
+
Options:
|
|
87
|
+
- `-f, --force` - Force rotation without confirmation
|
|
88
|
+
- `-r, --reason <reason>` - Reason for rotation
|
|
89
|
+
|
|
55
90
|
### `claim`
|
|
56
|
-
|
|
91
|
+
|
|
92
|
+
Get agent claim/edit URLs for the KYA-OS directory.
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
kya-os claim
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### `effects-demo`
|
|
99
|
+
|
|
100
|
+
Explore all available terminal effects and animations.
|
|
57
101
|
|
|
58
102
|
```bash
|
|
59
|
-
|
|
103
|
+
kya-os effects-demo
|
|
104
|
+
|
|
105
|
+
# Run a specific effect
|
|
106
|
+
kya-os effects-demo --effect burn --text "Hello World"
|
|
107
|
+
|
|
108
|
+
# List all effects
|
|
109
|
+
kya-os effects-demo --list
|
|
110
|
+
|
|
111
|
+
# Run without animations
|
|
112
|
+
kya-os effects-demo --disable
|
|
60
113
|
```
|
|
61
114
|
|
|
62
|
-
|
|
115
|
+
### `cli-demo`
|
|
116
|
+
|
|
117
|
+
Experience the full KYA-OS CLI initialization flow with animations.
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
kya-os cli-demo
|
|
121
|
+
|
|
122
|
+
# Run at increased speed
|
|
123
|
+
kya-os cli-demo --fast
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Terminal Effects
|
|
127
|
+
|
|
128
|
+
The CLI includes several stunning terminal effects:
|
|
129
|
+
|
|
130
|
+
- **š„ Burn** - Text burns away dramatically
|
|
131
|
+
- **⨠Beams** - Light beams illuminate the text
|
|
132
|
+
- **š» Binary Path** - Matrix-style binary rain reveals text
|
|
133
|
+
- **š Decrypt** - Movie-style decryption animation
|
|
134
|
+
- **š Blackhole** - Text gets sucked into a void
|
|
135
|
+
- **š Waves** - Wave patterns flow across text
|
|
136
|
+
|
|
137
|
+
Effects automatically disable in CI/CD environments or when `KYA_EFFECTS_ENABLED=false`.
|
|
138
|
+
|
|
139
|
+
## Environment Variables
|
|
140
|
+
|
|
141
|
+
The CLI respects the following environment variables:
|
|
142
|
+
|
|
143
|
+
- `KYA_API_URL` - KYA-OS API endpoint (default: https://api.knowthat.ai)
|
|
144
|
+
- `KYA_API_KEY` - API key for authentication
|
|
145
|
+
- `KYA_ENV` - Environment (development/staging/production)
|
|
146
|
+
- `KYA_EFFECTS_ENABLED` - Enable/disable terminal effects (default: true)
|
|
147
|
+
- `NO_COLOR` - Disable all colors (respects NO_COLOR standard)
|
|
148
|
+
|
|
149
|
+
## Configuration
|
|
150
|
+
|
|
151
|
+
The CLI stores configuration in `.kya-os/` directory in your project root:
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
.kya-os/
|
|
155
|
+
āāā config.json # Agent configuration
|
|
156
|
+
āāā identity.json # Identity information (DID, keys)
|
|
157
|
+
āāā .gitignore # Ensures secrets aren't committed
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Platform-Specific Guides
|
|
161
|
+
|
|
162
|
+
### Vercel
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
# Initialize with Vercel auto-detection
|
|
166
|
+
npx @kya-os/cli init
|
|
167
|
+
|
|
168
|
+
# Copy environment variables for Vercel dashboard
|
|
169
|
+
npx @kya-os/cli env copy
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### AWS Lambda
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
# Initialize for AWS
|
|
176
|
+
npx @kya-os/cli init --platform aws
|
|
177
|
+
|
|
178
|
+
# Generate CloudFormation template
|
|
179
|
+
npx @kya-os/cli env show --format cloudformation
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Docker
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# Initialize for Docker
|
|
186
|
+
npx @kya-os/cli init --platform docker
|
|
187
|
+
|
|
188
|
+
# Generate docker-compose.yml snippet
|
|
189
|
+
npx @kya-os/cli env show --format docker-compose
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Development
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
# Install dependencies
|
|
196
|
+
npm install
|
|
197
|
+
|
|
198
|
+
# Run in development mode
|
|
199
|
+
npm run dev
|
|
200
|
+
|
|
201
|
+
# Build for production
|
|
202
|
+
npm run build
|
|
203
|
+
|
|
204
|
+
# Run effects demo in development
|
|
205
|
+
npm run dev:effects
|
|
206
|
+
|
|
207
|
+
# Test effects performance
|
|
208
|
+
npm run test:effects
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Creating New Effects
|
|
212
|
+
|
|
213
|
+
1. Copy the effect template:
|
|
214
|
+
```bash
|
|
215
|
+
cp src/effects/template/effect-template.ts src/effects/implementations/my-effect.ts
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
2. Implement your effect logic
|
|
219
|
+
|
|
220
|
+
3. Register in `src/effects/index.ts`
|
|
221
|
+
|
|
222
|
+
4. Test with:
|
|
223
|
+
```bash
|
|
224
|
+
npm run dev:effects -- --effect my-effect --text "Test"
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
See `src/effects/template/README.md` for detailed instructions.
|
|
228
|
+
|
|
229
|
+
## Troubleshooting
|
|
230
|
+
|
|
231
|
+
### Effects not showing
|
|
232
|
+
|
|
233
|
+
- Check if running in TTY: `test -t 1 && echo "TTY available"`
|
|
234
|
+
- Ensure `KYA_EFFECTS_ENABLED` is not set to `false`
|
|
235
|
+
- Try running with `--disable` flag to confirm it works without effects
|
|
236
|
+
|
|
237
|
+
### Module not found errors
|
|
63
238
|
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
- ā
AWS Lambda
|
|
67
|
-
- ā
Docker
|
|
68
|
-
- ā
Edge Functions
|
|
239
|
+
- Run `npm run build` to ensure all files are compiled
|
|
240
|
+
- Check that you're using Node.js 16+ with ESM support
|
|
69
241
|
|
|
70
|
-
|
|
242
|
+
### Permission denied
|
|
71
243
|
|
|
72
|
-
-
|
|
73
|
-
-
|
|
244
|
+
- On macOS/Linux: Use `sudo npm install -g @kya-os/cli`
|
|
245
|
+
- Or use npx: `npx @kya-os/cli` (no installation needed)
|
|
74
246
|
|
|
75
|
-
##
|
|
247
|
+
## Contributing
|
|
76
248
|
|
|
77
|
-
|
|
249
|
+
1. Fork the repository
|
|
250
|
+
2. Create your feature branch (`git checkout -b feature/amazing-effect`)
|
|
251
|
+
3. Commit your changes (`git commit -m 'Add amazing effect'`)
|
|
252
|
+
4. Push to the branch (`git push origin feature/amazing-effect`)
|
|
253
|
+
5. Open a Pull Request
|
|
78
254
|
|
|
79
255
|
## License
|
|
80
256
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"
|
|
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,iBAuLhD"}
|
package/dist/commands/check.js
CHANGED
|
@@ -1,97 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const platform_detector_1 = require("../utils/platform-detector");
|
|
13
|
-
const prompts_1 = require("../utils/prompts");
|
|
14
|
-
async function check(options) {
|
|
15
|
-
console.log(chalk_1.default.cyan('\nš Checking MCP-I Configuration\n'));
|
|
16
|
-
const envManager = new env_manager_1.EnvManager();
|
|
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
|
+
export async function check(options) {
|
|
10
|
+
console.log(chalk.cyan('\nš Checking MCP-I Configuration\n'));
|
|
11
|
+
const envManager = new EnvManager();
|
|
17
12
|
let hasIssues = false;
|
|
18
13
|
// 1. Check for identity files
|
|
19
|
-
console.log(
|
|
20
|
-
const identityFile =
|
|
21
|
-
const hasIdentityFile =
|
|
14
|
+
console.log(chalk.bold('š Identity Files:'));
|
|
15
|
+
const identityFile = join(process.cwd(), '.mcp-identity.json');
|
|
16
|
+
const hasIdentityFile = existsSync(identityFile);
|
|
22
17
|
if (hasIdentityFile) {
|
|
23
|
-
console.log(` ā ${
|
|
18
|
+
console.log(` ā ${chalk.green('.mcp-identity.json')} found`);
|
|
24
19
|
if (options.verbose) {
|
|
25
20
|
try {
|
|
26
|
-
const identity = JSON.parse(
|
|
27
|
-
console.log(` DID: ${
|
|
28
|
-
console.log(` Agent: ${
|
|
29
|
-
console.log(` Registered: ${
|
|
21
|
+
const identity = JSON.parse(readFileSync(identityFile, 'utf-8'));
|
|
22
|
+
console.log(` DID: ${chalk.gray(identity.did)}`);
|
|
23
|
+
console.log(` Agent: ${chalk.gray(identity.agentSlug)}`);
|
|
24
|
+
console.log(` Registered: ${chalk.gray(identity.registeredAt)}`);
|
|
30
25
|
}
|
|
31
26
|
catch (error) {
|
|
32
|
-
console.log(` ${
|
|
27
|
+
console.log(` ${chalk.red('Error reading file')}`);
|
|
33
28
|
}
|
|
34
29
|
}
|
|
35
30
|
}
|
|
36
31
|
else {
|
|
37
|
-
console.log(` ā ${
|
|
32
|
+
console.log(` ā ${chalk.red('.mcp-identity.json')} not found`);
|
|
38
33
|
hasIssues = true;
|
|
39
34
|
}
|
|
40
35
|
// 2. Check environment files
|
|
41
|
-
console.log(`\n${
|
|
42
|
-
const platformInfo =
|
|
36
|
+
console.log(`\n${chalk.bold('š Environment Files:')}`);
|
|
37
|
+
const platformInfo = detectPlatform();
|
|
43
38
|
const envFiles = ['.env', '.env.local', '.env.production'];
|
|
44
39
|
let foundEnvFile = false;
|
|
45
40
|
for (const file of envFiles) {
|
|
46
|
-
if (
|
|
47
|
-
console.log(` ā ${
|
|
41
|
+
if (existsSync(join(process.cwd(), file))) {
|
|
42
|
+
console.log(` ā ${chalk.green(file)} found`);
|
|
48
43
|
foundEnvFile = true;
|
|
49
44
|
if (options.verbose) {
|
|
50
45
|
const vars = envManager.readEnvFile(file);
|
|
51
46
|
const { valid, missing } = envManager.validateVariables(vars);
|
|
52
47
|
if (valid) {
|
|
53
|
-
console.log(` ${
|
|
48
|
+
console.log(` ${chalk.gray('All required variables present')}`);
|
|
54
49
|
}
|
|
55
50
|
else {
|
|
56
|
-
console.log(` ${
|
|
51
|
+
console.log(` ${chalk.yellow(`Missing: ${missing.join(', ')}`)}`);
|
|
57
52
|
}
|
|
58
53
|
}
|
|
59
54
|
}
|
|
60
55
|
}
|
|
61
56
|
if (!foundEnvFile) {
|
|
62
|
-
console.log(` ā ${
|
|
57
|
+
console.log(` ā ${chalk.red('No environment files found')}`);
|
|
63
58
|
hasIssues = true;
|
|
64
59
|
}
|
|
65
60
|
// 3. Check environment variables
|
|
66
|
-
console.log(`\n${
|
|
61
|
+
console.log(`\n${chalk.bold('š Environment Variables:')}`);
|
|
67
62
|
const processVars = envManager.getFromProcess();
|
|
68
63
|
const { valid, missing } = envManager.validateVariables(processVars);
|
|
69
64
|
if (valid) {
|
|
70
|
-
console.log(` ā ${
|
|
65
|
+
console.log(` ā ${chalk.green('All required variables set')}`);
|
|
71
66
|
if (options.verbose) {
|
|
72
67
|
console.log('\n' + envManager.formatForDisplay(processVars));
|
|
73
68
|
}
|
|
74
69
|
}
|
|
75
70
|
else {
|
|
76
|
-
console.log(` ā ${
|
|
71
|
+
console.log(` ā ${chalk.red(`Missing variables: ${missing.join(', ')}`)}`);
|
|
77
72
|
hasIssues = true;
|
|
78
73
|
}
|
|
79
74
|
// 4. Check .gitignore
|
|
80
|
-
console.log(`\n${
|
|
75
|
+
console.log(`\n${chalk.bold('š« Git Security:')}`);
|
|
81
76
|
const sensitiveFiles = ['.env', '.env.local', '.mcp-identity.json'];
|
|
82
77
|
const { missing: notIgnored } = envManager.checkGitignore(sensitiveFiles);
|
|
83
78
|
if (notIgnored.length === 0) {
|
|
84
|
-
console.log(` ā ${
|
|
79
|
+
console.log(` ā ${chalk.green('All sensitive files in .gitignore')}`);
|
|
85
80
|
}
|
|
86
81
|
else {
|
|
87
|
-
console.log(` ā ${
|
|
88
|
-
console.log(` ${
|
|
82
|
+
console.log(` ā ${chalk.red('Not in .gitignore:')} ${notIgnored.join(', ')}`);
|
|
83
|
+
console.log(` ${chalk.yellow('Run: npx kya-os init --force to fix')}`);
|
|
89
84
|
hasIssues = true;
|
|
90
85
|
}
|
|
91
86
|
// 5. Test registry connection (if we have identity)
|
|
92
87
|
if (processVars.MCP_IDENTITY_DID && options.verbose) {
|
|
93
|
-
console.log(`\n${
|
|
94
|
-
const spinner = (
|
|
88
|
+
console.log(`\n${chalk.bold('š Registry Connection:')}`);
|
|
89
|
+
const spinner = ora('Testing connection to knowthat.ai...').start();
|
|
95
90
|
try {
|
|
96
91
|
const response = await fetch('https://knowthat.ai/api/health');
|
|
97
92
|
if (response.ok) {
|
|
@@ -100,14 +95,24 @@ async function check(options) {
|
|
|
100
95
|
if (processVars.MCP_IDENTITY_AGENT_SLUG) {
|
|
101
96
|
const agentResponse = await fetch(`https://knowthat.ai/api/agents/${processVars.MCP_IDENTITY_AGENT_SLUG}`);
|
|
102
97
|
if (agentResponse.ok) {
|
|
103
|
-
|
|
98
|
+
spinner.stop();
|
|
104
99
|
const agent = await agentResponse.json();
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
100
|
+
// Show agent details with Decrypt effect
|
|
101
|
+
const agentDetailsText = ` ā ${chalk.green('Agent found in registry')}\n` +
|
|
102
|
+
` Name: ${chalk.gray(agent.name)}\n` +
|
|
103
|
+
` Status: ${chalk.gray(agent.status)}\n` +
|
|
104
|
+
` Profile: ${chalk.cyan(`https://knowthat.ai/agents/${processVars.MCP_IDENTITY_AGENT_SLUG}`)}`;
|
|
105
|
+
await cliEffects.showCustomEffect('decrypt', agentDetailsText, {
|
|
106
|
+
config: {
|
|
107
|
+
duration: 2000,
|
|
108
|
+
ciphertextColors: ['00ff00', '00ff80', '80ff00'],
|
|
109
|
+
finalColor: 'ffffff',
|
|
110
|
+
typingSpeed: 2
|
|
111
|
+
}
|
|
112
|
+
});
|
|
108
113
|
}
|
|
109
114
|
else if (agentResponse.status === 404) {
|
|
110
|
-
console.log(` ā ${
|
|
115
|
+
console.log(` ā ${chalk.yellow('Agent not found in registry')}`);
|
|
111
116
|
}
|
|
112
117
|
}
|
|
113
118
|
}
|
|
@@ -122,29 +127,40 @@ async function check(options) {
|
|
|
122
127
|
}
|
|
123
128
|
}
|
|
124
129
|
// 6. Platform-specific checks
|
|
125
|
-
console.log(`\n${
|
|
126
|
-
console.log(` Platform: ${
|
|
130
|
+
console.log(`\n${chalk.bold('š Platform Configuration:')}`);
|
|
131
|
+
console.log(` Platform: ${chalk.cyan(platformInfo.platform)}`);
|
|
127
132
|
if (platformInfo.platform === 'vercel' || platformInfo.platform === 'nextjs') {
|
|
128
133
|
if (!processVars.MCP_IDENTITY_DID) {
|
|
129
|
-
console.log(` ${
|
|
130
|
-
console.log(` ${
|
|
134
|
+
console.log(` ${chalk.yellow('ā ļø Remember to add environment variables to Vercel Dashboard')}`);
|
|
135
|
+
console.log(` ${chalk.gray('Run: npx kya-os env copy')}`);
|
|
131
136
|
}
|
|
132
137
|
}
|
|
133
138
|
// Summary
|
|
134
|
-
console.log(`\n${
|
|
139
|
+
console.log(`\n${chalk.bold('š Summary:')}`);
|
|
135
140
|
if (!hasIssues) {
|
|
136
|
-
|
|
141
|
+
showSuccess('MCP-I is properly configured!');
|
|
137
142
|
if (processVars.MCP_IDENTITY_DID) {
|
|
138
|
-
|
|
143
|
+
// Show identity summary with Decrypt effect
|
|
144
|
+
let summaryText = `\nšÆ Your agent DID: ${chalk.green(processVars.MCP_IDENTITY_DID)}`;
|
|
139
145
|
if (processVars.MCP_IDENTITY_AGENT_SLUG) {
|
|
140
|
-
|
|
146
|
+
summaryText += `\nš Agent profile: ${chalk.cyan(`https://knowthat.ai/agents/${processVars.MCP_IDENTITY_AGENT_SLUG}`)}`;
|
|
141
147
|
}
|
|
148
|
+
await cliEffects.showCustomEffect('decrypt', summaryText, {
|
|
149
|
+
config: {
|
|
150
|
+
duration: 2500,
|
|
151
|
+
ciphertextColors: ['008000', '00cb00', '00ff00'],
|
|
152
|
+
finalColor: 'eda000',
|
|
153
|
+
typingSpeed: 1,
|
|
154
|
+
useGradient: true,
|
|
155
|
+
gradientDirection: 'horizontal'
|
|
156
|
+
}
|
|
157
|
+
});
|
|
142
158
|
}
|
|
143
159
|
}
|
|
144
160
|
else {
|
|
145
|
-
|
|
161
|
+
showWarning('Some configuration issues found');
|
|
146
162
|
console.log('\nTo fix issues, run:');
|
|
147
|
-
console.log(
|
|
163
|
+
console.log(chalk.cyan(' npx kya-os init'));
|
|
148
164
|
}
|
|
149
165
|
}
|
|
150
166
|
//# sourceMappingURL=check.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAexD,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,OAAqB;IAC/C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC,CAAC;IAE/D,MAAM,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IACpC,IAAI,SAAS,GAAG,KAAK,CAAC;IAEtB,8BAA8B;IAC9B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC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AAC,aAAa,CAAC,EAAE,CAAC,CAAC;IAE9C,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,WAAW,CAAC,+BAA+B,CAAC,CAAC;QAE7C,IAAI,WAAW,CAAC,gBAAgB,EAAE,CAAC;YACjC,4CAA4C;YAC5C,IAAI,WAAW,GAAG,wBAAwB,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAEtF,IAAI,WAAW,CAAC,uBAAuB,EAAE,CAAC;gBACxC,WAAW,IAAI,uBAAuB,KAAK,CAAC,IAAI,CAAC,8BAA8B,WAAW,CAAC,uBAAuB,EAAE,CAAC,EAAE,CAAC;YAC1H,CAAC;YAED,MAAM,UAAU,CAAC,gBAAgB,CAAC,SAAS,EAAE,WAAW,EAAE;gBACxD,MAAM,EAAE;oBACN,QAAQ,EAAE,IAAI;oBACd,gBAAgB,EAAE,CAAC,QAAQ,EAAE,QAAQ,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
|
@@ -1,69 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const ora_1 = __importDefault(require("ora"));
|
|
9
|
-
const mcp_i_1 = require("@kya-os/mcp-i");
|
|
10
|
-
const env_manager_1 = require("../utils/env-manager");
|
|
11
|
-
const prompts_1 = require("../utils/prompts");
|
|
12
|
-
async function claim() {
|
|
13
|
-
console.log(chalk_1.default.cyan('\nšÆ Agent Management URLs\n'));
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import ora from 'ora';
|
|
3
|
+
import { MCPIdentity } from '@kya-os/mcp-i';
|
|
4
|
+
import { EnvManager } from '../utils/env-manager.js';
|
|
5
|
+
import { showSuccess, showError, showInfo } from '../utils/prompts.js';
|
|
6
|
+
export async function claim() {
|
|
7
|
+
console.log(chalk.cyan('\nšÆ Agent Management URLs\n'));
|
|
14
8
|
// Check for existing identity
|
|
15
|
-
const envManager = new
|
|
9
|
+
const envManager = new EnvManager();
|
|
16
10
|
const processVars = envManager.getFromProcess();
|
|
17
11
|
if (!processVars.MCP_IDENTITY_DID) {
|
|
18
|
-
|
|
12
|
+
showError('No MCP-I identity found. Run "npx kya-os init" first.');
|
|
19
13
|
return;
|
|
20
14
|
}
|
|
21
|
-
const spinner = (
|
|
15
|
+
const spinner = ora('Retrieving management URLs...').start();
|
|
22
16
|
try {
|
|
23
17
|
// Initialize identity
|
|
24
|
-
const identity = await
|
|
18
|
+
const identity = await MCPIdentity.init();
|
|
25
19
|
// Request edit access
|
|
26
20
|
const { editUrl, claimUrl } = await identity.requestEditAccess();
|
|
27
21
|
spinner.succeed('URLs retrieved successfully!');
|
|
28
|
-
console.log(`\n${
|
|
29
|
-
console.log(` DID: ${
|
|
22
|
+
console.log(`\n${chalk.bold('š Agent Information:')}`);
|
|
23
|
+
console.log(` DID: ${chalk.gray(processVars.MCP_IDENTITY_DID)}`);
|
|
30
24
|
if (processVars.MCP_IDENTITY_AGENT_SLUG) {
|
|
31
|
-
console.log(` Profile: ${
|
|
25
|
+
console.log(` Profile: ${chalk.cyan(`https://knowthat.ai/agents/${processVars.MCP_IDENTITY_AGENT_SLUG}`)}`);
|
|
32
26
|
}
|
|
33
27
|
if (claimUrl) {
|
|
34
|
-
console.log(`\n${
|
|
35
|
-
console.log(` ${
|
|
36
|
-
console.log(`\n ${
|
|
37
|
-
console.log(` ${
|
|
38
|
-
console.log(` ${
|
|
39
|
-
console.log(` ${
|
|
40
|
-
console.log(` ${
|
|
41
|
-
console.log(` ${
|
|
42
|
-
|
|
28
|
+
console.log(`\n${chalk.bold('šÆ Claim Your Agent:')}`);
|
|
29
|
+
console.log(` ${chalk.cyan(claimUrl)}`);
|
|
30
|
+
console.log(`\n ${chalk.gray('Use this link to:')}`);
|
|
31
|
+
console.log(` ${chalk.gray('⢠Set up your account')}`);
|
|
32
|
+
console.log(` ${chalk.gray('⢠Edit agent details')}`);
|
|
33
|
+
console.log(` ${chalk.gray('⢠Add logos and descriptions')}`);
|
|
34
|
+
console.log(` ${chalk.gray('⢠Manage directory listings')}`);
|
|
35
|
+
console.log(` ${chalk.gray('⢠View analytics')}`);
|
|
36
|
+
showInfo('This is a one-time claim link. Once claimed, use the edit URL.');
|
|
43
37
|
}
|
|
44
|
-
console.log(`\n${
|
|
45
|
-
console.log(` ${
|
|
46
|
-
console.log(` ${
|
|
38
|
+
console.log(`\n${chalk.bold('āļø Edit Your Agent:')}`);
|
|
39
|
+
console.log(` ${chalk.cyan(editUrl)}`);
|
|
40
|
+
console.log(` ${chalk.gray('(Requires authentication after claiming)')}`);
|
|
47
41
|
// Check if agent is draft
|
|
48
42
|
if (processVars.MCP_IDENTITY_DID?.includes('localhost')) {
|
|
49
|
-
|
|
43
|
+
showInfo('This is a development/draft agent. It won\'t appear in public directories.');
|
|
50
44
|
}
|
|
51
|
-
|
|
45
|
+
showSuccess('Management URLs ready!');
|
|
52
46
|
}
|
|
53
47
|
catch (error) {
|
|
54
48
|
spinner.fail('Failed to retrieve URLs');
|
|
55
49
|
if (error.message?.includes('429')) {
|
|
56
|
-
|
|
50
|
+
showError('Rate limit exceeded. Please try again in a few minutes.');
|
|
57
51
|
}
|
|
58
52
|
else if (error.message?.includes('Network')) {
|
|
59
|
-
|
|
53
|
+
showError('Network error. Check your internet connection.');
|
|
60
54
|
}
|
|
61
55
|
else {
|
|
62
|
-
|
|
56
|
+
showError(error.message || 'Failed to get management URLs');
|
|
63
57
|
// Provide fallback URL
|
|
64
58
|
if (processVars.MCP_IDENTITY_AGENT_SLUG) {
|
|
65
|
-
console.log(`\n${
|
|
66
|
-
console.log(`${
|
|
59
|
+
console.log(`\n${chalk.gray('You can try visiting directly:')}`);
|
|
60
|
+
console.log(`${chalk.cyan(`https://knowthat.ai/agents/${processVars.MCP_IDENTITY_AGENT_SLUG}`)}`);
|
|
67
61
|
}
|
|
68
62
|
}
|
|
69
63
|
}
|