icoa-cli 2.1.0 → 2.1.2

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
@@ -36,7 +36,7 @@ ${LINE}
36
36
  ${chalk.white('Sydney, Australia')} ${chalk.gray('Jun 27 - Jul 2, 2026')}
37
37
  ${chalk.cyan.underline('https://icoa2026.au')}
38
38
 
39
- ${chalk.gray('CLI-Native Competition Terminal v2.1.0')}
39
+ ${chalk.gray('CLI-Native Competition Terminal v2.1.2')}
40
40
 
41
41
  ${LINE}
42
42
  `;
package/dist/repl.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createInterface } from 'node:readline';
2
- import { spawn } from 'node:child_process';
2
+ import { spawn, execSync as execSyncFn } from 'node:child_process';
3
3
  import chalk from 'chalk';
4
4
  import { isConnected, getConfig } from './lib/config.js';
5
5
  import { isActivated, activateToken, isFreeCommand, isDeviceMatch, recordExit, recordResume, isFirstRunOrUpgrade, markVersionSeen } from './lib/access.js';
@@ -27,7 +27,7 @@ const BLOCKED_COMMANDS = new Set([
27
27
  'iptables', 'ufw', // firewall
28
28
  ]);
29
29
  const INTERCEPT = '__REPL_NO_EXIT__';
30
- const VERSION = '2.1.0';
30
+ const VERSION = '2.1.2';
31
31
  export async function startRepl(program, resumeMode) {
32
32
  const config = getConfig();
33
33
  const connected = isConnected();
@@ -65,11 +65,9 @@ export async function startRepl(program, resumeMode) {
65
65
  });
66
66
  if (yes) {
67
67
  console.log();
68
- // Trigger env setup
68
+ // Trigger env setup — use `icoa` command directly
69
69
  const { execSync: ex } = await import('node:child_process');
70
- const { fileURLToPath } = await import('node:url');
71
- const indexPath = fileURLToPath(new URL('../index.js', import.meta.url));
72
- ex(`node "${indexPath}" env setup`, { stdio: 'inherit' });
70
+ ex('icoa env setup', { stdio: 'inherit' });
73
71
  }
74
72
  }
75
73
  catch {
@@ -223,7 +221,7 @@ export async function startRepl(program, resumeMode) {
223
221
  rl.prompt();
224
222
  return;
225
223
  }
226
- // Force Python 3.12 — rewrite python3/python to 3.12 binaries
224
+ // Force Python 3.12 — rewrite python/python3 to correct binary
227
225
  let resolvedInput = input;
228
226
  if (process.platform === 'darwin') {
229
227
  const py12 = '/opt/homebrew/opt/python@3.12/bin/python3.12';
@@ -231,6 +229,19 @@ export async function startRepl(program, resumeMode) {
231
229
  .replace(/^python3?\s/, `${py12} `)
232
230
  .replace(/^(python3|python)$/, py12);
233
231
  }
232
+ else {
233
+ // Linux/WSL: python → python3 (or python3.12 if available)
234
+ const py12 = (() => { try {
235
+ execSyncFn('which python3.12', { stdio: 'ignore' });
236
+ return 'python3.12';
237
+ }
238
+ catch {
239
+ return 'python3';
240
+ } })();
241
+ resolvedInput = resolvedInput
242
+ .replace(/^python\s/, `${py12} `)
243
+ .replace(/^python$/, py12);
244
+ }
234
245
  // Ensure workspace directory
235
246
  const cwd = ensureWorkspace();
236
247
  // Route to Docker sandbox if available, otherwise system shell (in workspace)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icoa-cli",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "ICOA CLI — The world's first CLI-native CTF competition terminal",
5
5
  "type": "module",
6
6
  "bin": {