@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 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
- C-napse - Autonomous PC Intelligence
2413
-
2414
- Usage:
2415
- cnapse Start interactive chat
2416
- cnapse init Interactive setup wizard
2417
- cnapse config Interactive configuration
2418
- cnapse config show Show current configuration
2419
- cnapse config set <k> <v> Set config value
2420
- cnapse auth <provider> <key> Set API key
2421
- cnapse help Show this help
2422
-
2423
- Providers:
2424
- ollama - Local AI (default, free)
2425
- openrouter - OpenRouter API (many models)
2426
- anthropic - Anthropic Claude
2427
- openai - OpenAI GPT
2428
-
2429
- Quick Start:
2430
- cnapse init # Interactive setup
2431
- cnapse config # Change provider/model
2432
-
2433
- Manual Setup:
2434
- cnapse auth openrouter sk-or-xxxxx
2435
- cnapse config set provider openrouter
2436
- cnapse config set model qwen/qwen-2.5-coder-32b-instruct
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@projectservan8n/cnapse",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
4
4
  "description": "Autonomous PC intelligence - AI assistant for desktop automation",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
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
- C-napse - Autonomous PC Intelligence
89
-
90
- Usage:
91
- cnapse Start interactive chat
92
- cnapse init Interactive setup wizard
93
- cnapse config Interactive configuration
94
- cnapse config show Show current configuration
95
- cnapse config set <k> <v> Set config value
96
- cnapse auth <provider> <key> Set API key
97
- cnapse help Show this help
98
-
99
- Providers:
100
- ollama - Local AI (default, free)
101
- openrouter - OpenRouter API (many models)
102
- anthropic - Anthropic Claude
103
- openai - OpenAI GPT
104
-
105
- Quick Start:
106
- cnapse init # Interactive setup
107
- cnapse config # Change provider/model
108
-
109
- Manual Setup:
110
- cnapse auth openrouter sk-or-xxxxx
111
- cnapse config set provider openrouter
112
- cnapse config set model qwen/qwen-2.5-coder-32b-instruct
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
  }