@projectservan8n/cnapse 0.5.7 → 0.5.8
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/index.js +57 -28
- package/package.json +1 -1
- package/src/index.tsx +60 -29
package/dist/index.js
CHANGED
|
@@ -2352,16 +2352,19 @@ async function main() {
|
|
|
2352
2352
|
const key = args[2];
|
|
2353
2353
|
if (!provider || !key) {
|
|
2354
2354
|
console.log("Usage: cnapse auth <provider> <api-key>");
|
|
2355
|
-
console.log("Providers: openrouter, anthropic, openai");
|
|
2355
|
+
console.log("Providers: openrouter, anthropic, openai, telegram");
|
|
2356
2356
|
process.exit(1);
|
|
2357
2357
|
}
|
|
2358
|
-
if (!["openrouter", "anthropic", "openai"].includes(provider)) {
|
|
2358
|
+
if (!["openrouter", "anthropic", "openai", "telegram"].includes(provider)) {
|
|
2359
2359
|
console.log(`Invalid provider: ${provider}`);
|
|
2360
|
-
console.log("Valid providers: openrouter, anthropic, openai");
|
|
2360
|
+
console.log("Valid providers: openrouter, anthropic, openai, telegram");
|
|
2361
2361
|
process.exit(1);
|
|
2362
2362
|
}
|
|
2363
2363
|
setApiKey(provider, key);
|
|
2364
2364
|
console.log(`\u2713 ${provider} API key saved`);
|
|
2365
|
+
if (provider === "telegram") {
|
|
2366
|
+
console.log("Start the bot with: cnapse, then /telegram or Ctrl+T");
|
|
2367
|
+
}
|
|
2365
2368
|
process.exit(0);
|
|
2366
2369
|
}
|
|
2367
2370
|
case "config": {
|
|
@@ -2408,32 +2411,58 @@ async function main() {
|
|
|
2408
2411
|
case "help":
|
|
2409
2412
|
case "--help":
|
|
2410
2413
|
case "-h": {
|
|
2414
|
+
const cyan = "\x1B[36m";
|
|
2415
|
+
const green = "\x1B[32m";
|
|
2416
|
+
const yellow = "\x1B[33m";
|
|
2417
|
+
const magenta = "\x1B[35m";
|
|
2418
|
+
const bold = "\x1B[1m";
|
|
2419
|
+
const dim = "\x1B[2m";
|
|
2420
|
+
const reset = "\x1B[0m";
|
|
2411
2421
|
console.log(`
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
cnapse
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2422
|
+
${cyan}${bold}\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
2423
|
+
\u2551 \u2551
|
|
2424
|
+
\u2551 ${magenta}\u2588\u2588\u2588\u2588\u2588\u2588\u2557 ${cyan}\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557${reset}${cyan}${bold} \u2551
|
|
2425
|
+
\u2551 ${magenta}\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D ${cyan}\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D${reset}${cyan}${bold} \u2551
|
|
2426
|
+
\u2551 ${magenta}\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2557${cyan}\u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2557${reset}${cyan}${bold} \u2551
|
|
2427
|
+
\u2551 ${magenta}\u2588\u2588\u2551 \u255A\u2550\u2550\u2550\u2550\u255D${cyan}\u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D${reset}${cyan}${bold} \u2551
|
|
2428
|
+
\u2551 ${magenta}\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557 ${cyan}\u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557${reset}${cyan}${bold} \u2551
|
|
2429
|
+
\u2551 ${magenta} \u255A\u2550\u2550\u2550\u2550\u2550\u255D ${cyan}\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D${reset}${cyan}${bold} \u2551
|
|
2430
|
+
\u2551 \u2551
|
|
2431
|
+
\u2551 ${reset}${dim}Autonomous PC Intelligence${reset}${cyan}${bold} \u2551
|
|
2432
|
+
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D${reset}
|
|
2433
|
+
|
|
2434
|
+
${yellow}${bold}USAGE${reset}
|
|
2435
|
+
${green}cnapse${reset} Start interactive chat
|
|
2436
|
+
${green}cnapse init${reset} Interactive setup wizard
|
|
2437
|
+
${green}cnapse config${reset} Interactive configuration
|
|
2438
|
+
${green}cnapse config show${reset} Show current configuration
|
|
2439
|
+
${green}cnapse auth <provider> <key>${reset} Set API key
|
|
2440
|
+
${green}cnapse help${reset} Show this help
|
|
2441
|
+
|
|
2442
|
+
${yellow}${bold}PROVIDERS${reset}
|
|
2443
|
+
${cyan}ollama${reset} Local AI ${dim}(default, free, private)${reset}
|
|
2444
|
+
${cyan}openrouter${reset} OpenRouter API ${dim}(many models, pay-per-use)${reset}
|
|
2445
|
+
${cyan}anthropic${reset} Anthropic Claude ${dim}(best reasoning)${reset}
|
|
2446
|
+
${cyan}openai${reset} OpenAI GPT ${dim}(reliable)${reset}
|
|
2447
|
+
${cyan}telegram${reset} Telegram bot token ${dim}(remote control)${reset}
|
|
2448
|
+
|
|
2449
|
+
${yellow}${bold}QUICK START${reset}
|
|
2450
|
+
${dim}# Interactive setup - easiest way${reset}
|
|
2451
|
+
${green}cnapse init${reset}
|
|
2452
|
+
|
|
2453
|
+
${dim}# Manual setup with OpenRouter${reset}
|
|
2454
|
+
${green}cnapse auth openrouter sk-or-v1-xxxxx${reset}
|
|
2455
|
+
${green}cnapse config set provider openrouter${reset}
|
|
2456
|
+
|
|
2457
|
+
${dim}# Add Telegram for remote control${reset}
|
|
2458
|
+
${green}cnapse auth telegram YOUR_BOT_TOKEN${reset}
|
|
2459
|
+
|
|
2460
|
+
${yellow}${bold}IN-APP SHORTCUTS${reset}
|
|
2461
|
+
${cyan}Ctrl+H${reset} Help menu ${cyan}Ctrl+P${reset} Change provider
|
|
2462
|
+
${cyan}Ctrl+E${reset} Screen watch ${cyan}Ctrl+T${reset} Toggle Telegram
|
|
2463
|
+
${cyan}Ctrl+L${reset} Clear chat ${cyan}Ctrl+C${reset} Exit
|
|
2464
|
+
|
|
2465
|
+
${dim}GitHub: https://github.com/projectservan8n/C-napse${reset}
|
|
2437
2466
|
`);
|
|
2438
2467
|
process.exit(0);
|
|
2439
2468
|
}
|
package/package.json
CHANGED
package/src/index.tsx
CHANGED
|
@@ -13,23 +13,26 @@ async function main() {
|
|
|
13
13
|
|
|
14
14
|
switch (command) {
|
|
15
15
|
case 'auth': {
|
|
16
|
-
const provider = args[1] as 'openrouter' | 'anthropic' | 'openai';
|
|
16
|
+
const provider = args[1] as 'openrouter' | 'anthropic' | 'openai' | 'telegram';
|
|
17
17
|
const key = args[2];
|
|
18
18
|
|
|
19
19
|
if (!provider || !key) {
|
|
20
20
|
console.log('Usage: cnapse auth <provider> <api-key>');
|
|
21
|
-
console.log('Providers: openrouter, anthropic, openai');
|
|
21
|
+
console.log('Providers: openrouter, anthropic, openai, telegram');
|
|
22
22
|
process.exit(1);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
if (!['openrouter', 'anthropic', 'openai'].includes(provider)) {
|
|
25
|
+
if (!['openrouter', 'anthropic', 'openai', 'telegram'].includes(provider)) {
|
|
26
26
|
console.log(`Invalid provider: ${provider}`);
|
|
27
|
-
console.log('Valid providers: openrouter, anthropic, openai');
|
|
27
|
+
console.log('Valid providers: openrouter, anthropic, openai, telegram');
|
|
28
28
|
process.exit(1);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
setApiKey(provider, key);
|
|
32
32
|
console.log(`✓ ${provider} API key saved`);
|
|
33
|
+
if (provider === 'telegram') {
|
|
34
|
+
console.log('Start the bot with: cnapse, then /telegram or Ctrl+T');
|
|
35
|
+
}
|
|
33
36
|
process.exit(0);
|
|
34
37
|
}
|
|
35
38
|
|
|
@@ -84,32 +87,60 @@ async function main() {
|
|
|
84
87
|
case 'help':
|
|
85
88
|
case '--help':
|
|
86
89
|
case '-h': {
|
|
90
|
+
// Colorful help using ANSI escape codes
|
|
91
|
+
const cyan = '\x1b[36m';
|
|
92
|
+
const green = '\x1b[32m';
|
|
93
|
+
const yellow = '\x1b[33m';
|
|
94
|
+
const magenta = '\x1b[35m';
|
|
95
|
+
const bold = '\x1b[1m';
|
|
96
|
+
const dim = '\x1b[2m';
|
|
97
|
+
const reset = '\x1b[0m';
|
|
98
|
+
|
|
87
99
|
console.log(`
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
cnapse
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
100
|
+
${cyan}${bold}╔═══════════════════════════════════════════════════════════╗
|
|
101
|
+
║ ║
|
|
102
|
+
║ ${magenta}██████╗ ${cyan}███╗ ██╗ █████╗ ██████╗ ███████╗███████╗${reset}${cyan}${bold} ║
|
|
103
|
+
║ ${magenta}██╔════╝ ${cyan}████╗ ██║██╔══██╗██╔══██╗██╔════╝██╔════╝${reset}${cyan}${bold} ║
|
|
104
|
+
║ ${magenta}██║ █████╗${cyan}██╔██╗ ██║███████║██████╔╝███████╗█████╗${reset}${cyan}${bold} ║
|
|
105
|
+
║ ${magenta}██║ ╚════╝${cyan}██║╚██╗██║██╔══██║██╔═══╝ ╚════██║██╔══╝${reset}${cyan}${bold} ║
|
|
106
|
+
║ ${magenta}╚██████╗ ${cyan}██║ ╚████║██║ ██║██║ ███████║███████╗${reset}${cyan}${bold} ║
|
|
107
|
+
║ ${magenta} ╚═════╝ ${cyan}╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝ ╚══════╝╚══════╝${reset}${cyan}${bold} ║
|
|
108
|
+
║ ║
|
|
109
|
+
║ ${reset}${dim}Autonomous PC Intelligence${reset}${cyan}${bold} ║
|
|
110
|
+
╚═══════════════════════════════════════════════════════════╝${reset}
|
|
111
|
+
|
|
112
|
+
${yellow}${bold}USAGE${reset}
|
|
113
|
+
${green}cnapse${reset} Start interactive chat
|
|
114
|
+
${green}cnapse init${reset} Interactive setup wizard
|
|
115
|
+
${green}cnapse config${reset} Interactive configuration
|
|
116
|
+
${green}cnapse config show${reset} Show current configuration
|
|
117
|
+
${green}cnapse auth <provider> <key>${reset} Set API key
|
|
118
|
+
${green}cnapse help${reset} Show this help
|
|
119
|
+
|
|
120
|
+
${yellow}${bold}PROVIDERS${reset}
|
|
121
|
+
${cyan}ollama${reset} Local AI ${dim}(default, free, private)${reset}
|
|
122
|
+
${cyan}openrouter${reset} OpenRouter API ${dim}(many models, pay-per-use)${reset}
|
|
123
|
+
${cyan}anthropic${reset} Anthropic Claude ${dim}(best reasoning)${reset}
|
|
124
|
+
${cyan}openai${reset} OpenAI GPT ${dim}(reliable)${reset}
|
|
125
|
+
${cyan}telegram${reset} Telegram bot token ${dim}(remote control)${reset}
|
|
126
|
+
|
|
127
|
+
${yellow}${bold}QUICK START${reset}
|
|
128
|
+
${dim}# Interactive setup - easiest way${reset}
|
|
129
|
+
${green}cnapse init${reset}
|
|
130
|
+
|
|
131
|
+
${dim}# Manual setup with OpenRouter${reset}
|
|
132
|
+
${green}cnapse auth openrouter sk-or-v1-xxxxx${reset}
|
|
133
|
+
${green}cnapse config set provider openrouter${reset}
|
|
134
|
+
|
|
135
|
+
${dim}# Add Telegram for remote control${reset}
|
|
136
|
+
${green}cnapse auth telegram YOUR_BOT_TOKEN${reset}
|
|
137
|
+
|
|
138
|
+
${yellow}${bold}IN-APP SHORTCUTS${reset}
|
|
139
|
+
${cyan}Ctrl+H${reset} Help menu ${cyan}Ctrl+P${reset} Change provider
|
|
140
|
+
${cyan}Ctrl+E${reset} Screen watch ${cyan}Ctrl+T${reset} Toggle Telegram
|
|
141
|
+
${cyan}Ctrl+L${reset} Clear chat ${cyan}Ctrl+C${reset} Exit
|
|
142
|
+
|
|
143
|
+
${dim}GitHub: https://github.com/projectservan8n/C-napse${reset}
|
|
113
144
|
`);
|
|
114
145
|
process.exit(0);
|
|
115
146
|
}
|