icoa-cli 1.9.0 → 1.9.1
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/commands/env.js +33 -17
- package/dist/index.js +1 -1
- package/dist/repl.js +1 -1
- package/package.json +1 -1
package/dist/commands/env.js
CHANGED
|
@@ -61,9 +61,9 @@ const SYSTEM_TOOLS = [
|
|
|
61
61
|
{ name: 'as', check: CMD('as'), category: 'Compilers & Build' },
|
|
62
62
|
{ name: 'ld', check: CMD('ld'), category: 'Compilers & Build' },
|
|
63
63
|
{ name: 'pkg-config', check: CMD('pkg-config'), brew: 'pkg-config', apt: 'pkg-config', category: 'Compilers & Build' },
|
|
64
|
-
// Python (3)
|
|
65
|
-
{ name: 'python3', check: W ? 'python --version' : 'python3 --version', brew: 'python@3.12', apt: 'python3', choco: 'python312', category: 'Python Runtime' },
|
|
66
|
-
{ name: 'pip3', check: W ? 'pip --version' : 'pip3 --version', category: 'Python Runtime' },
|
|
64
|
+
// Python (3) — prefer brew 3.12 on macOS
|
|
65
|
+
{ name: 'python3', check: process.platform === 'darwin' ? '/opt/homebrew/opt/python@3.12/bin/python3.12 --version' : (W ? 'python --version' : 'python3 --version'), brew: 'python@3.12', apt: 'python3', choco: 'python312', category: 'Python Runtime' },
|
|
66
|
+
{ name: 'pip3', check: process.platform === 'darwin' ? '/opt/homebrew/opt/python@3.12/bin/pip3.12 --version' : (W ? 'pip --version' : 'pip3 --version'), category: 'Python Runtime' },
|
|
67
67
|
{ name: 'python3-venv', check: W ? 'python -c "import venv"' : 'python3 -c "import venv"', apt: 'python3-venv', category: 'Python Runtime' },
|
|
68
68
|
// Networking (12)
|
|
69
69
|
{ name: 'curl', check: CMD('curl'), brew: 'curl', apt: 'curl', choco: 'curl', category: 'Networking' },
|
|
@@ -160,8 +160,8 @@ function isInstalled(check) {
|
|
|
160
160
|
function getVersion(name) {
|
|
161
161
|
// Version commands for each tool
|
|
162
162
|
const versionCmds = {
|
|
163
|
-
'python3': 'python3 --version',
|
|
164
|
-
'pip3': 'pip3 --version',
|
|
163
|
+
'python3': process.platform === 'darwin' ? '/opt/homebrew/opt/python@3.12/bin/python3.12 --version' : 'python3 --version',
|
|
164
|
+
'pip3': process.platform === 'darwin' ? '/opt/homebrew/opt/python@3.12/bin/pip3.12 --version' : 'pip3 --version',
|
|
165
165
|
'gcc': 'gcc --version',
|
|
166
166
|
'g++': 'g++ --version',
|
|
167
167
|
'make': 'make --version',
|
|
@@ -237,6 +237,13 @@ function getNodeInfo() {
|
|
|
237
237
|
return `Node.js ${process.version}`;
|
|
238
238
|
}
|
|
239
239
|
function getPythonMajorMinor() {
|
|
240
|
+
// On macOS, prefer brew Python 3.12
|
|
241
|
+
if (process.platform === 'darwin') {
|
|
242
|
+
try {
|
|
243
|
+
return execSync('/opt/homebrew/opt/python@3.12/bin/python3.12 -c "import sys; print(f\'{sys.version_info.major}.{sys.version_info.minor}\')"', { encoding: 'utf-8' }).trim();
|
|
244
|
+
}
|
|
245
|
+
catch { /* fall through */ }
|
|
246
|
+
}
|
|
240
247
|
try {
|
|
241
248
|
return execSync('python3 -c "import sys; print(f\'{sys.version_info.major}.{sys.version_info.minor}\')"', { encoding: 'utf-8' }).trim();
|
|
242
249
|
}
|
|
@@ -244,6 +251,20 @@ function getPythonMajorMinor() {
|
|
|
244
251
|
return '';
|
|
245
252
|
}
|
|
246
253
|
}
|
|
254
|
+
function getPythonFullVersion() {
|
|
255
|
+
if (process.platform === 'darwin') {
|
|
256
|
+
try {
|
|
257
|
+
return execSync('/opt/homebrew/opt/python@3.12/bin/python3.12 --version', { encoding: 'utf-8' }).trim().replace('Python ', '');
|
|
258
|
+
}
|
|
259
|
+
catch { /* fall through */ }
|
|
260
|
+
}
|
|
261
|
+
try {
|
|
262
|
+
return execSync('python3 --version', { encoding: 'utf-8' }).trim().replace('Python ', '');
|
|
263
|
+
}
|
|
264
|
+
catch {
|
|
265
|
+
return '';
|
|
266
|
+
}
|
|
267
|
+
}
|
|
247
268
|
export function registerEnvCommand(program) {
|
|
248
269
|
const envCmd = program.command('env').description('Manage competition environment');
|
|
249
270
|
envCmd.command('status').alias('check').description('Check all 109 tools').action(() => showStatus());
|
|
@@ -261,19 +282,14 @@ function showStatus() {
|
|
|
261
282
|
console.log(chalk.gray(' Package: ') + chalk.white(pm));
|
|
262
283
|
console.log(chalk.gray(' Target: ') + chalk.white(`Python ${PYTHON_TARGET}.x`));
|
|
263
284
|
console.log(chalk.gray(' ─────────────────────────────────────────────'));
|
|
264
|
-
// Python version check
|
|
285
|
+
// Python version check — use brew 3.12 on macOS
|
|
265
286
|
const pyVer = getPythonMajorMinor();
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
console.log(chalk.yellow(` ~ Python ${fullVer}`) + chalk.gray(' (3.12.x recommended for full compatibility)'));
|
|
273
|
-
}
|
|
274
|
-
else {
|
|
275
|
-
console.log(chalk.red(` ✗ Python ${fullVer}`) + chalk.gray(' (3.12.x required — some tools may not work)'));
|
|
276
|
-
}
|
|
287
|
+
const fullVer = getPythonFullVersion();
|
|
288
|
+
if (pyVer === '3.12') {
|
|
289
|
+
console.log(chalk.green(` ✓ Python ${fullVer}`) + chalk.gray(' (recommended)'));
|
|
290
|
+
}
|
|
291
|
+
else if (pyVer) {
|
|
292
|
+
console.log(chalk.yellow(` ~ Python ${fullVer}`) + chalk.gray(' (3.12.x recommended)'));
|
|
277
293
|
}
|
|
278
294
|
else {
|
|
279
295
|
console.log(chalk.red(' ✗ Python 3 not found'));
|
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 v1.9.
|
|
39
|
+
${chalk.gray('CLI-Native Competition Terminal v1.9.1')}
|
|
40
40
|
|
|
41
41
|
${LINE}
|
|
42
42
|
`;
|
package/dist/repl.js
CHANGED
|
@@ -8,7 +8,7 @@ import { ensureSandbox, runInSandbox, isDockerAvailable } from './lib/sandbox.js
|
|
|
8
8
|
import { logCommand } from './lib/logger.js';
|
|
9
9
|
import { startLogSync, stopLogSync } from './lib/log-sync.js';
|
|
10
10
|
const INTERCEPT = '__REPL_NO_EXIT__';
|
|
11
|
-
const VERSION = '1.9.
|
|
11
|
+
const VERSION = '1.9.1';
|
|
12
12
|
export async function startRepl(program, resumeMode) {
|
|
13
13
|
const config = getConfig();
|
|
14
14
|
const connected = isConnected();
|