@pga-ai/cli 0.8.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/README.md +449 -0
- package/dist/commands/benchmark.d.ts +2 -0
- package/dist/commands/benchmark.d.ts.map +1 -0
- package/dist/commands/benchmark.js +6 -0
- package/dist/commands/benchmark.js.map +1 -0
- package/dist/commands/chat.d.ts +6 -0
- package/dist/commands/chat.d.ts.map +1 -0
- package/dist/commands/chat.js +67 -0
- package/dist/commands/chat.js.map +1 -0
- package/dist/commands/config.d.ts +2 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +5 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/create.d.ts +2 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +5 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/doctor.d.ts +4 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +223 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/evolve.d.ts +2 -0
- package/dist/commands/evolve.d.ts.map +1 -0
- package/dist/commands/evolve.js +6 -0
- package/dist/commands/evolve.js.map +1 -0
- package/dist/commands/export.d.ts +2 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +6 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/import.d.ts +2 -0
- package/dist/commands/import.d.ts.map +1 -0
- package/dist/commands/import.js +6 -0
- package/dist/commands/import.js.map +1 -0
- package/dist/commands/init.d.ts +7 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +415 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list.d.ts +2 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +5 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/metrics.d.ts +2 -0
- package/dist/commands/metrics.d.ts.map +1 -0
- package/dist/commands/metrics.js +5 -0
- package/dist/commands/metrics.js.map +1 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +5 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +133 -0
- package/dist/index.js.map +1 -0
- package/package.json +63 -0
package/README.md
ADDED
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
# @pga-ai/cli
|
|
2
|
+
|
|
3
|
+
Interactive command-line interface for GSEP (Genomic Self-Evolving Prompts).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Global Installation (Recommended)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @pga-ai/cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Local Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install --save-dev @pga-ai/cli
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Initialize a new GSEP project
|
|
23
|
+
pga init
|
|
24
|
+
|
|
25
|
+
# Create a genome
|
|
26
|
+
pga create --name my-assistant
|
|
27
|
+
|
|
28
|
+
# Start an interactive chat session
|
|
29
|
+
pga chat
|
|
30
|
+
|
|
31
|
+
# Run benchmarks
|
|
32
|
+
pga benchmark <genome-id>
|
|
33
|
+
|
|
34
|
+
# View metrics
|
|
35
|
+
pga metrics
|
|
36
|
+
|
|
37
|
+
# Check system health
|
|
38
|
+
pga status
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Commands
|
|
42
|
+
|
|
43
|
+
### `pga init`
|
|
44
|
+
|
|
45
|
+
Initialize a new GSEP project with templates.
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pga init # Interactive template selection
|
|
49
|
+
pga init --template basic # Basic template
|
|
50
|
+
pga init --template advanced # Advanced with monitoring
|
|
51
|
+
pga init --template enterprise # Enterprise-ready
|
|
52
|
+
pga init --dir ./my-project # Specify directory
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Templates:**
|
|
56
|
+
- **basic** - Simple GSEP setup with Claude
|
|
57
|
+
- **advanced** - Multi-model support + monitoring
|
|
58
|
+
- **enterprise** - Production-ready with PostgreSQL
|
|
59
|
+
|
|
60
|
+
### `pga create`
|
|
61
|
+
|
|
62
|
+
Create a new genome.
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pga create # Interactive mode
|
|
66
|
+
pga create --name my-assistant # With name
|
|
67
|
+
pga create --model claude-sonnet-4.5 # Specify model
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### `pga chat`
|
|
71
|
+
|
|
72
|
+
Start an interactive chat session.
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
pga chat # Select genome interactively
|
|
76
|
+
pga chat <genome-id> # Chat with specific genome
|
|
77
|
+
pga chat --user john-doe # Specify user ID
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Chat Commands:**
|
|
81
|
+
- Type your message and press Enter
|
|
82
|
+
- `exit` or `quit` to end session
|
|
83
|
+
|
|
84
|
+
### `pga list`
|
|
85
|
+
|
|
86
|
+
List all genomes.
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
pga list # Table format
|
|
90
|
+
pga list --format json # JSON output
|
|
91
|
+
pga list --sort fitness # Sort by field
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### `pga evolve`
|
|
95
|
+
|
|
96
|
+
Manually trigger genome evolution.
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
pga evolve <genome-id> # Auto-select layer
|
|
100
|
+
pga evolve <genome-id> --layer 2 # Specific layer
|
|
101
|
+
pga evolve <genome-id> --gene response_style # Specific gene
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### `pga benchmark`
|
|
105
|
+
|
|
106
|
+
Run evaluation benchmarks.
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
pga benchmark # Interactive genome selection
|
|
110
|
+
pga benchmark <genome-id> # Benchmark specific genome
|
|
111
|
+
pga benchmark --tasks debug-1,impl-1 # Specific tasks
|
|
112
|
+
pga benchmark --compare <genome-id> # Compare two genomes
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### `pga metrics`
|
|
116
|
+
|
|
117
|
+
View performance and cost metrics.
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
pga metrics # Last 24 hours
|
|
121
|
+
pga metrics --period 1h # Last hour
|
|
122
|
+
pga metrics --period 7d # Last 7 days
|
|
123
|
+
pga metrics --export metrics.json # Export to file
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### `pga status`
|
|
127
|
+
|
|
128
|
+
Show system health status.
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
pga status # Current status
|
|
132
|
+
pga status --watch # Watch mode (updates every 5s)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### `pga config`
|
|
136
|
+
|
|
137
|
+
Configure GSEP settings.
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
pga config --list # List all settings
|
|
141
|
+
pga config --get api_key # Get specific value
|
|
142
|
+
pga config --set model=claude-sonnet-4.5 # Set value
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### `pga export`
|
|
146
|
+
|
|
147
|
+
Export genome or data.
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
pga export <genome-id> # Default JSON
|
|
151
|
+
pga export <genome-id> -o backup.json # Specify output
|
|
152
|
+
pga export <genome-id> --format yaml # YAML format
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### `pga import`
|
|
156
|
+
|
|
157
|
+
Import genome from file.
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
pga import backup.json # Import genome
|
|
161
|
+
pga import backup.json --name restored # With custom name
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### `pga doctor`
|
|
165
|
+
|
|
166
|
+
Run diagnostics and check for issues.
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
pga doctor # Run all checks
|
|
170
|
+
pga doctor --fix # Attempt to fix issues
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**Checks:**
|
|
174
|
+
- Node.js version (requires 20+)
|
|
175
|
+
- TypeScript installation
|
|
176
|
+
- GSEP core package
|
|
177
|
+
- Environment variables
|
|
178
|
+
|
|
179
|
+
## Project Templates
|
|
180
|
+
|
|
181
|
+
### Basic Template
|
|
182
|
+
|
|
183
|
+
Simple GSEP setup for getting started quickly.
|
|
184
|
+
|
|
185
|
+
**Includes:**
|
|
186
|
+
- TypeScript configuration
|
|
187
|
+
- Claude adapter
|
|
188
|
+
- Basic genome configuration
|
|
189
|
+
- Example chat implementation
|
|
190
|
+
|
|
191
|
+
```typescript
|
|
192
|
+
import { PGA } from '@pga-ai/core';
|
|
193
|
+
import { ClaudeAdapter } from '@pga-ai/adapters-llm-anthropic';
|
|
194
|
+
|
|
195
|
+
const pga = new PGA({
|
|
196
|
+
llmAdapter: new ClaudeAdapter({
|
|
197
|
+
apiKey: process.env.ANTHROPIC_API_KEY!,
|
|
198
|
+
}),
|
|
199
|
+
});
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Advanced Template
|
|
203
|
+
|
|
204
|
+
Multi-model support with monitoring.
|
|
205
|
+
|
|
206
|
+
**Includes:**
|
|
207
|
+
- Claude + OpenAI adapters
|
|
208
|
+
- MetricsCollector integration
|
|
209
|
+
- Performance tracking
|
|
210
|
+
- Cost monitoring
|
|
211
|
+
- Alert configuration
|
|
212
|
+
|
|
213
|
+
```typescript
|
|
214
|
+
import { PGA, MetricsCollector } from '@pga-ai/core';
|
|
215
|
+
import { ClaudeAdapter } from '@pga-ai/adapters-llm-anthropic';
|
|
216
|
+
import { OpenAIAdapter } from '@pga-ai/adapters-llm-openai';
|
|
217
|
+
|
|
218
|
+
const metrics = new MetricsCollector({
|
|
219
|
+
alertThresholds: {
|
|
220
|
+
maxCostPerHour: 50,
|
|
221
|
+
maxErrorRate: 0.05,
|
|
222
|
+
},
|
|
223
|
+
});
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Enterprise Template
|
|
227
|
+
|
|
228
|
+
Production-ready with all features.
|
|
229
|
+
|
|
230
|
+
**Includes:**
|
|
231
|
+
- PostgreSQL storage adapter
|
|
232
|
+
- Comprehensive monitoring
|
|
233
|
+
- Evaluation framework
|
|
234
|
+
- Health monitoring
|
|
235
|
+
- Audit logging
|
|
236
|
+
- Graceful shutdown handling
|
|
237
|
+
|
|
238
|
+
```typescript
|
|
239
|
+
import { PGA, MetricsCollector, Evaluator } from '@pga-ai/core';
|
|
240
|
+
import { ClaudeAdapter } from '@pga-ai/adapters-llm-anthropic';
|
|
241
|
+
import { PostgresAdapter } from '@pga-ai/adapters-storage-postgres';
|
|
242
|
+
|
|
243
|
+
const storage = new PostgresAdapter({
|
|
244
|
+
connectionString: process.env.DATABASE_URL!,
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
const pga = new PGA({
|
|
248
|
+
llmAdapter: new ClaudeAdapter({
|
|
249
|
+
apiKey: process.env.ANTHROPIC_API_KEY!,
|
|
250
|
+
}),
|
|
251
|
+
storageAdapter: storage,
|
|
252
|
+
});
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
## Configuration
|
|
256
|
+
|
|
257
|
+
The CLI uses environment variables for configuration:
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
# Required
|
|
261
|
+
ANTHROPIC_API_KEY=your-api-key
|
|
262
|
+
|
|
263
|
+
# Optional
|
|
264
|
+
OPENAI_API_KEY=your-openai-key
|
|
265
|
+
DATABASE_URL=postgresql://localhost/pga
|
|
266
|
+
PGA_CONFIG_DIR=~/.pga
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## Examples
|
|
270
|
+
|
|
271
|
+
### Initialize and Run a Project
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
# 1. Create new project
|
|
275
|
+
pga init --template advanced
|
|
276
|
+
|
|
277
|
+
# 2. Navigate to project
|
|
278
|
+
cd my-pga-project
|
|
279
|
+
|
|
280
|
+
# 3. Install dependencies
|
|
281
|
+
npm install
|
|
282
|
+
|
|
283
|
+
# 4. Configure environment
|
|
284
|
+
cp .env.example .env
|
|
285
|
+
# Edit .env with your API keys
|
|
286
|
+
|
|
287
|
+
# 5. Run the application
|
|
288
|
+
npm run dev
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Create and Test a Genome
|
|
292
|
+
|
|
293
|
+
```bash
|
|
294
|
+
# Create genome
|
|
295
|
+
pga create --name coding-assistant
|
|
296
|
+
|
|
297
|
+
# Run benchmark
|
|
298
|
+
pga benchmark <genome-id>
|
|
299
|
+
|
|
300
|
+
# Chat with genome
|
|
301
|
+
pga chat <genome-id>
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### Monitor Production System
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
# Check system status
|
|
308
|
+
pga status --watch
|
|
309
|
+
|
|
310
|
+
# View metrics
|
|
311
|
+
pga metrics --period 24h
|
|
312
|
+
|
|
313
|
+
# Export metrics for analysis
|
|
314
|
+
pga metrics --export daily-metrics.json
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### Genome Backup and Restore
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
# Export genome
|
|
321
|
+
pga export genome-123 -o backup.json
|
|
322
|
+
|
|
323
|
+
# Import genome
|
|
324
|
+
pga import backup.json --name restored-genome
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
## Global Options
|
|
328
|
+
|
|
329
|
+
Available for all commands:
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
-v, --verbose # Enable verbose output
|
|
333
|
+
--no-color # Disable colored output
|
|
334
|
+
--help # Show help for command
|
|
335
|
+
--version # Show CLI version
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
## Best Practices
|
|
339
|
+
|
|
340
|
+
### 1. Use Templates
|
|
341
|
+
|
|
342
|
+
Start with a template that matches your use case:
|
|
343
|
+
- **Prototyping** → Basic
|
|
344
|
+
- **Development** → Advanced
|
|
345
|
+
- **Production** → Enterprise
|
|
346
|
+
|
|
347
|
+
### 2. Version Control
|
|
348
|
+
|
|
349
|
+
Always commit your `package.json` and `tsconfig.json`:
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
git add package.json tsconfig.json src/
|
|
353
|
+
git commit -m "Initialize GSEP project"
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
### 3. Environment Variables
|
|
357
|
+
|
|
358
|
+
Never commit `.env` files:
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
# In .gitignore
|
|
362
|
+
.env
|
|
363
|
+
*.env.local
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### 4. Regular Backups
|
|
367
|
+
|
|
368
|
+
Export genomes regularly:
|
|
369
|
+
|
|
370
|
+
```bash
|
|
371
|
+
pga export <genome-id> -o backups/genome-$(date +%Y%m%d).json
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### 5. Monitoring
|
|
375
|
+
|
|
376
|
+
Use `doctor` command to check for issues:
|
|
377
|
+
|
|
378
|
+
```bash
|
|
379
|
+
pga doctor
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
## Troubleshooting
|
|
383
|
+
|
|
384
|
+
### Command Not Found
|
|
385
|
+
|
|
386
|
+
```bash
|
|
387
|
+
# Ensure global installation
|
|
388
|
+
npm install -g @pga-ai/cli
|
|
389
|
+
|
|
390
|
+
# Or use npx
|
|
391
|
+
npx @pga-ai/cli init
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
### Permission Errors
|
|
395
|
+
|
|
396
|
+
```bash
|
|
397
|
+
# macOS/Linux
|
|
398
|
+
sudo npm install -g @pga-ai/cli
|
|
399
|
+
|
|
400
|
+
# Or use user directory
|
|
401
|
+
npm config set prefix ~/.npm-global
|
|
402
|
+
export PATH=~/.npm-global/bin:$PATH
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
### TypeScript Errors
|
|
406
|
+
|
|
407
|
+
```bash
|
|
408
|
+
# Install TypeScript globally
|
|
409
|
+
npm install -g typescript
|
|
410
|
+
|
|
411
|
+
# Or locally
|
|
412
|
+
npm install --save-dev typescript
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
## Development
|
|
416
|
+
|
|
417
|
+
To contribute to the CLI:
|
|
418
|
+
|
|
419
|
+
```bash
|
|
420
|
+
# Clone repository
|
|
421
|
+
git clone https://github.com/pga-ai/pga-platform
|
|
422
|
+
|
|
423
|
+
# Navigate to CLI package
|
|
424
|
+
cd packages/cli
|
|
425
|
+
|
|
426
|
+
# Install dependencies
|
|
427
|
+
npm install
|
|
428
|
+
|
|
429
|
+
# Build
|
|
430
|
+
npm run build
|
|
431
|
+
|
|
432
|
+
# Test locally
|
|
433
|
+
npm link
|
|
434
|
+
pga --help
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
## License
|
|
438
|
+
|
|
439
|
+
MIT
|
|
440
|
+
|
|
441
|
+
## Author
|
|
442
|
+
|
|
443
|
+
**Luis Alfredo Velasquez Duran** (Germany, 2025)
|
|
444
|
+
|
|
445
|
+
## Links
|
|
446
|
+
|
|
447
|
+
- [GSEP Core](../../core/README.md)
|
|
448
|
+
- [Documentation](https://gsepcore.com/docs)
|
|
449
|
+
- [GitHub](https://github.com/pga-ai/pga-platform)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benchmark.d.ts","sourceRoot":"","sources":["../../src/commands/benchmark.ts"],"names":[],"mappings":"AAIA,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAIzF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benchmark.js","sourceRoot":"","sources":["../../src/commands/benchmark.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,QAA4B,EAAE,OAAY;IACtE,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IACpC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/commands/chat.ts"],"names":[],"mappings":"AAUA,UAAU,WAAW;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA8E5F"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import inquirer from 'inquirer';
|
|
3
|
+
import ora from 'ora';
|
|
4
|
+
export async function chat(genomeId, options) {
|
|
5
|
+
console.log(chalk.bold('\n💬 Interactive Chat Session\n'));
|
|
6
|
+
if (!genomeId) {
|
|
7
|
+
const answers = await inquirer.prompt([
|
|
8
|
+
{
|
|
9
|
+
type: 'input',
|
|
10
|
+
name: 'genomeId',
|
|
11
|
+
message: 'Enter genome ID:',
|
|
12
|
+
validate: (input) => {
|
|
13
|
+
if (!input.trim()) {
|
|
14
|
+
return 'Genome ID is required';
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
]);
|
|
20
|
+
genomeId = answers.genomeId;
|
|
21
|
+
}
|
|
22
|
+
const userId = options.user || 'cli-user';
|
|
23
|
+
console.log(chalk.gray(`Genome: ${genomeId}`));
|
|
24
|
+
console.log(chalk.gray(`User: ${userId}`));
|
|
25
|
+
console.log(chalk.gray('Type "exit" or "quit" to end the session\n'));
|
|
26
|
+
while (true) {
|
|
27
|
+
const { message } = await inquirer.prompt([
|
|
28
|
+
{
|
|
29
|
+
type: 'input',
|
|
30
|
+
name: 'message',
|
|
31
|
+
message: chalk.cyan('You:'),
|
|
32
|
+
validate: (input) => {
|
|
33
|
+
if (!input.trim()) {
|
|
34
|
+
return 'Message cannot be empty';
|
|
35
|
+
}
|
|
36
|
+
return true;
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
]);
|
|
40
|
+
if (message.toLowerCase() === 'exit' || message.toLowerCase() === 'quit') {
|
|
41
|
+
console.log(chalk.yellow('\nEnding chat session. Goodbye!\n'));
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
const spinner = ora('Thinking...').start();
|
|
45
|
+
try {
|
|
46
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
47
|
+
spinner.stop();
|
|
48
|
+
const response = `[This is a placeholder response. Connect to GSEP instance to get real responses]
|
|
49
|
+
|
|
50
|
+
Your message: "${message}"
|
|
51
|
+
|
|
52
|
+
To connect this CLI to a live GSEP instance:
|
|
53
|
+
1. Initialize a GSEP instance in your application
|
|
54
|
+
2. Expose it via API or IPC
|
|
55
|
+
3. Configure the CLI to connect to it
|
|
56
|
+
|
|
57
|
+
For now, this command demonstrates the interactive chat interface.`;
|
|
58
|
+
console.log(chalk.green('AI:'), chalk.white(response));
|
|
59
|
+
console.log();
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
spinner.fail(chalk.red('Failed to get response'));
|
|
63
|
+
console.error(error);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=chat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../src/commands/chat.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,UAAU,CAAC;AACh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","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,OAAY;IACrC,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;IAC5C,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAIA,wBAAsB,MAAM,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAGxD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,OAAY;IACrC,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAmBA,wBAAsB,MAAM,CAAC,QAAQ,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA8DvE"}
|