icoa-cli 1.3.1 → 1.3.3

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
@@ -13,27 +13,31 @@ import { registerLangCommand } from './commands/lang.js';
13
13
  import { registerSetupCommand } from './commands/setup.js';
14
14
  import { getConfig, saveConfig } from './lib/config.js';
15
15
  import { startRepl } from './repl.js';
16
+ import { checkTerminal } from './lib/terminal.js';
17
+ // Banner: each line between ║ ║ = exactly 58 visible chars
18
+ const B = chalk.cyan('║');
16
19
  const BANNER = `
17
20
  ${chalk.cyan('╔══════════════════════════════════════════════════════════╗')}
18
- ${chalk.cyan('║')} ${chalk.cyan('║')}
19
- ${chalk.cyan('║')} ${chalk.bold.white('██╗ ██████╗ ██████╗ █████╗')} ${chalk.cyan('║')}
20
- ${chalk.cyan('║')} ${chalk.bold.white('██║██╔════╝██╔═══██╗██╔══██╗')} ${chalk.cyan('║')}
21
- ${chalk.cyan('║')} ${chalk.bold.white('██║██║ ██║ ██║███████║')} ${chalk.cyan('║')}
22
- ${chalk.cyan('║')} ${chalk.bold.white('██║██║ ██║ ██║██╔══██║')} ${chalk.cyan('║')}
23
- ${chalk.cyan('║')} ${chalk.bold.white('██║╚██████╗╚██████╔╝██║ ██║')} ${chalk.cyan('║')}
24
- ${chalk.cyan('║')} ${chalk.bold.white('╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝')} ${chalk.cyan('║')}
25
- ${chalk.cyan('║')} ${chalk.cyan('║')}
26
- ${chalk.cyan('║')} ${chalk.yellow('International Cyber Olympiad in AI 2026')} ${chalk.cyan('║')}
27
- ${chalk.cyan('║')} ${chalk.bold.magenta("The World's First AI Security Olympiad")} ${chalk.cyan('║')}
28
- ${chalk.cyan('║')} ${chalk.cyan('║')}
29
- ${chalk.cyan('║')} ${chalk.green.bold('AI4CTF')} ${chalk.gray('Use AI to solve challenges')} ${chalk.cyan('║')}
30
- ${chalk.cyan('║')} ${chalk.red.bold('CTF4AI')} ${chalk.gray('Hack, attack & evaluate AI systems')} ${chalk.cyan('║')}
31
- ${chalk.cyan('║')} ${chalk.cyan('')}
32
- ${chalk.cyan('║')} ${chalk.white.bold('Sydney, Australia')} ${chalk.gray('Jun 27 - Jul 2, 2026')} ${chalk.cyan('║')}
33
- ${chalk.cyan('║')} ${chalk.cyan.underline('https://icoa2026.au')} ${chalk.cyan('')}
34
- ${chalk.cyan('║')} ${chalk.cyan('')}
35
- ${chalk.cyan('║')} ${chalk.gray('CLI-Native Competition Terminal v1.3.1')} ${chalk.cyan('║')}
36
- ${chalk.cyan('║')} ${chalk.cyan('')}
21
+ ${B} ${B}
22
+ ${B} ${chalk.bold.white('██╗ ██████╗ ██████╗ █████╗')} ${B}
23
+ ${B} ${chalk.bold.white('██║██╔════╝██╔═══██╗██╔══██╗')} ${B}
24
+ ${B} ${chalk.bold.white('██║██║ ██║ ██║███████║')} ${B}
25
+ ${B} ${chalk.bold.white('██║██║ ██║ ██║██╔══██║')} ${B}
26
+ ${B} ${chalk.bold.white('██║╚██████╗╚██████╔╝██║ ██║')} ${B}
27
+ ${B} ${chalk.bold.white('╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝')} ${B}
28
+ ${B} ${B}
29
+ ${B} ${chalk.yellow('International Cyber Olympiad in AI 2026')} ${B}
30
+ ${B} ${chalk.bold.magenta("The World's First AI Security Olympiad")} ${B}
31
+ ${B} ${B}
32
+ ${B} ${chalk.green.bold('AI4CTF')} ${chalk.gray('AI as your teammate')} ${B}
33
+ ${B} ${chalk.red.bold('CTF4AI')} ${chalk.gray('Hack & evaluate AI systems')} ${B}
34
+ ${B} ${chalk.bold.white('AI is your ally. AI is your target.')} ${B}
35
+ ${B} ${B}
36
+ ${B} ${chalk.white('Sydney, Australia')} ${chalk.gray('Jun 27 - Jul 2, 2026')} ${B}
37
+ ${B} ${chalk.cyan.underline('https://icoa2026.au')} ${B}
38
+ ${B} ${B}
39
+ ${B} ${chalk.gray('CLI-Native Competition Terminal v1.3.3')} ${B}
40
+ ${B} ${B}
37
41
  ${chalk.cyan('╚══════════════════════════════════════════════════════════╝')}
38
42
  `;
39
43
  // Global error handlers
@@ -58,6 +62,7 @@ program
58
62
  .option('--resume', 'Resume previous session')
59
63
  .action((opts) => {
60
64
  console.log(BANNER);
65
+ checkTerminal();
61
66
  // If running interactively (no extra args or --resume), start REPL
62
67
  if (process.argv.length <= 2 || opts.resume) {
63
68
  startRepl(program, !!opts.resume);
@@ -0,0 +1,7 @@
1
+ interface TerminalInfo {
2
+ name: string;
3
+ allowed: boolean;
4
+ }
5
+ export declare function detectTerminal(): TerminalInfo;
6
+ export declare function checkTerminal(): void;
7
+ export {};
@@ -0,0 +1,45 @@
1
+ import chalk from 'chalk';
2
+ export function detectTerminal() {
3
+ const termProgram = process.env.TERM_PROGRAM || '';
4
+ const platform = process.platform;
5
+ // macOS: only Apple Terminal
6
+ if (platform === 'darwin') {
7
+ if (termProgram === 'Apple_Terminal') {
8
+ return { name: 'macOS Terminal', allowed: true };
9
+ }
10
+ return { name: termProgram || 'Unknown macOS terminal', allowed: false };
11
+ }
12
+ // Linux: GNOME Terminal, or basic xterm/linux console
13
+ if (platform === 'linux') {
14
+ const isGnome = termProgram === 'gnome-terminal' ||
15
+ process.env.GNOME_TERMINAL_SERVICE !== undefined;
16
+ if (isGnome) {
17
+ return { name: 'GNOME Terminal', allowed: true };
18
+ }
19
+ // Also allow basic linux console (no TERM_PROGRAM, e.g. TTY)
20
+ if (!termProgram && (process.env.TERM === 'linux' || process.env.TERM === 'xterm')) {
21
+ return { name: 'Linux Console', allowed: true };
22
+ }
23
+ return { name: termProgram || 'Unknown Linux terminal', allowed: false };
24
+ }
25
+ // Windows: PowerShell
26
+ if (platform === 'win32') {
27
+ const isPowerShell = !!process.env.PSModulePath;
28
+ if (isPowerShell) {
29
+ return { name: 'PowerShell', allowed: true };
30
+ }
31
+ return { name: 'Windows CMD or other', allowed: false };
32
+ }
33
+ return { name: 'Unknown', allowed: false };
34
+ }
35
+ export function checkTerminal() {
36
+ const info = detectTerminal();
37
+ if (!info.allowed) {
38
+ console.log(chalk.yellow(` ⚠ Unsupported terminal: ${info.name}`));
39
+ console.log(chalk.gray(' Competition requires:'));
40
+ console.log(chalk.gray(' macOS → Terminal.app (system default)'));
41
+ console.log(chalk.gray(' Linux → GNOME Terminal (system default)'));
42
+ console.log(chalk.gray(' Windows → PowerShell (system default)'));
43
+ console.log();
44
+ }
45
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icoa-cli",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "ICOA CLI — The world's first CLI-native CTF competition terminal",
5
5
  "type": "module",
6
6
  "bin": {