icoa-cli 2.19.5 → 2.19.7

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.
@@ -1,5 +1,4 @@
1
1
  import chalk from 'chalk';
2
- import { input, password as passwordPrompt } from '@inquirer/prompts';
3
2
  import { CTFdClient } from '../lib/ctfd-client.js';
4
3
  import { getConfig, saveConfig, getBudget } from '../lib/config.js';
5
4
  import { logCommand, logSubmission } from '../lib/logger.js';
@@ -30,8 +29,45 @@ export function registerCtfCommands(program) {
30
29
  logCommand(`ctf join ${url}`);
31
30
  console.log();
32
31
  printInfo(`Connecting to ${chalk.bold(url)}`);
33
- const username = await input({ message: chalk.white('Username:'), theme: { prefix: '', style: { message: (t) => t } } });
34
- const password = await passwordPrompt({ message: chalk.white('Password:'), mask: '*', theme: { prefix: '', style: { message: (t) => t } } });
32
+ // Read username and password using raw stdin (avoids REPL readline conflict)
33
+ function rawInput(prompt, mask) {
34
+ return new Promise((resolve) => {
35
+ process.stdout.write(chalk.white(prompt));
36
+ if (process.stdin.isTTY)
37
+ process.stdin.setRawMode?.(true);
38
+ let buf = '';
39
+ const onData = (ch) => {
40
+ const c = ch.toString();
41
+ if (c === '\n' || c === '\r') {
42
+ if (process.stdin.isTTY)
43
+ process.stdin.setRawMode?.(false);
44
+ process.stdin.removeListener('data', onData);
45
+ process.stdout.write('\n');
46
+ resolve(buf);
47
+ }
48
+ else if (c === '\x7f' || c === '\b') {
49
+ if (buf.length > 0) {
50
+ buf = buf.slice(0, -1);
51
+ process.stdout.write('\b \b');
52
+ }
53
+ }
54
+ else if (c === '\x03') {
55
+ if (process.stdin.isTTY)
56
+ process.stdin.setRawMode?.(false);
57
+ process.stdin.removeListener('data', onData);
58
+ process.stdout.write('\n');
59
+ resolve('');
60
+ }
61
+ else {
62
+ buf += c;
63
+ process.stdout.write(mask || c);
64
+ }
65
+ };
66
+ process.stdin.on('data', onData);
67
+ });
68
+ }
69
+ const username = await rawInput(' Username: ');
70
+ const password = await rawInput(' Password: ', '*');
35
71
  let token = '';
36
72
  let sessionCookie = '';
37
73
  let csrfNonce = '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icoa-cli",
3
- "version": "2.19.5",
3
+ "version": "2.19.7",
4
4
  "description": "ICOA CLI — The world's first CLI-native CTF competition terminal",
5
5
  "type": "module",
6
6
  "bin": {