icoa-cli 2.1.7 → 2.2.0
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 +10 -0
- package/dist/index.js +1 -1
- package/dist/lib/ui.d.ts +2 -1
- package/dist/lib/ui.js +16 -0
- package/dist/repl.js +16 -1
- package/package.json +1 -1
package/dist/commands/env.js
CHANGED
|
@@ -289,6 +289,16 @@ function showStatus() {
|
|
|
289
289
|
console.log(chalk.gray(' Then run icoa inside WSL for 100% tool compatibility'));
|
|
290
290
|
}
|
|
291
291
|
console.log(chalk.gray(' ─────────────────────────────────────────────'));
|
|
292
|
+
// Node.js version check
|
|
293
|
+
const nodeVer = process.versions.node;
|
|
294
|
+
const nodeMajor = parseInt(nodeVer.split('.')[0]);
|
|
295
|
+
if (nodeMajor >= 20) {
|
|
296
|
+
console.log(chalk.green(` ✓ Node.js ${nodeVer}`));
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
console.log(chalk.red(` ✗ Node.js ${nodeVer}`) + chalk.gray(' (v20+ required)'));
|
|
300
|
+
console.log(chalk.gray(' Upgrade: https://nodejs.org/ or nvm install 22'));
|
|
301
|
+
}
|
|
292
302
|
// Python version check
|
|
293
303
|
const pyVer = getPythonMajorMinor();
|
|
294
304
|
const fullVer = getPythonFullVersion();
|
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.
|
|
39
|
+
${chalk.gray('CLI-Native Competition Terminal v2.2.0')}
|
|
40
40
|
|
|
41
41
|
${LINE}
|
|
42
42
|
`;
|
package/dist/lib/ui.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ export declare function printWarning(msg: string): void;
|
|
|
4
4
|
export declare function printInfo(msg: string): void;
|
|
5
5
|
export declare function printTable(headers: string[], rows: string[][]): void;
|
|
6
6
|
export declare function printMarkdown(text: string): void;
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function setReplMode(enabled: boolean): void;
|
|
8
|
+
export declare function createSpinner(text: string): any;
|
|
8
9
|
export declare function formatCountdown(targetDate: Date): string;
|
|
9
10
|
export declare function printHeader(title: string): void;
|
|
10
11
|
export declare function printKeyValue(key: string, value: string): void;
|
package/dist/lib/ui.js
CHANGED
|
@@ -32,7 +32,23 @@ export function printMarkdown(text) {
|
|
|
32
32
|
console.log(rendered);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
+
// In REPL mode, spinners conflict with readline — use simple log instead
|
|
36
|
+
let replMode = false;
|
|
37
|
+
export function setReplMode(enabled) { replMode = enabled; }
|
|
35
38
|
export function createSpinner(text) {
|
|
39
|
+
if (replMode) {
|
|
40
|
+
// Fake spinner that just logs — no terminal cursor manipulation
|
|
41
|
+
const fake = {
|
|
42
|
+
text,
|
|
43
|
+
start() { console.log(chalk.cyan(' ' + text)); return fake; },
|
|
44
|
+
stop() { return fake; },
|
|
45
|
+
succeed(msg) { console.log(chalk.green(' ✓ ' + msg)); return fake; },
|
|
46
|
+
fail(msg) { console.log(chalk.red(' ✗ ' + msg)); return fake; },
|
|
47
|
+
info(msg) { console.log(chalk.blue(' ℹ ' + msg)); return fake; },
|
|
48
|
+
warn(msg) { console.log(chalk.yellow(' ⚠ ' + msg)); return fake; },
|
|
49
|
+
};
|
|
50
|
+
return fake;
|
|
51
|
+
}
|
|
36
52
|
return ora({ text, color: 'cyan' });
|
|
37
53
|
}
|
|
38
54
|
export function formatCountdown(targetDate) {
|
package/dist/repl.js
CHANGED
|
@@ -3,6 +3,7 @@ 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';
|
|
6
|
+
import { setReplMode } from './lib/ui.js';
|
|
6
7
|
import { resetTerminalTheme } from './lib/theme.js';
|
|
7
8
|
import { ensureSandbox, runInSandbox, isDockerAvailable } from './lib/sandbox.js';
|
|
8
9
|
import { logCommand } from './lib/logger.js';
|
|
@@ -26,7 +27,7 @@ const BLOCKED_COMMANDS = new Set([
|
|
|
26
27
|
'iptables', 'ufw', // firewall
|
|
27
28
|
]);
|
|
28
29
|
const INTERCEPT = '__REPL_NO_EXIT__';
|
|
29
|
-
const VERSION = '2.
|
|
30
|
+
const VERSION = '2.2.0';
|
|
30
31
|
export async function startRepl(program, resumeMode) {
|
|
31
32
|
const config = getConfig();
|
|
32
33
|
const connected = isConnected();
|
|
@@ -137,6 +138,7 @@ export async function startRepl(program, resumeMode) {
|
|
|
137
138
|
terminal: true,
|
|
138
139
|
});
|
|
139
140
|
let processing = false;
|
|
141
|
+
setReplMode(true);
|
|
140
142
|
// Log sync disabled until server audit endpoint is configured
|
|
141
143
|
// startLogSync();
|
|
142
144
|
rl.prompt();
|
|
@@ -220,6 +222,19 @@ export async function startRepl(program, resumeMode) {
|
|
|
220
222
|
rl.prompt();
|
|
221
223
|
return;
|
|
222
224
|
}
|
|
225
|
+
// Block path escape attempts
|
|
226
|
+
if (/(?:^|\s)(?:\/(?!home\/|Users\/|tmp\/)|\.\.\/|~\/)/.test(input) && !input.startsWith('cd ')) {
|
|
227
|
+
// Allow relative paths within workspace, block absolute paths outside
|
|
228
|
+
const hasAbsPath = /(?:^|\s)\/(?!home\/\w+\/icoa-workspace|Users\/\w+\/icoa-workspace|tmp\/)/.test(input);
|
|
229
|
+
const hasParentPath = /\.\./.test(input);
|
|
230
|
+
if (hasAbsPath || hasParentPath) {
|
|
231
|
+
console.log(chalk.red(' Blocked: access outside workspace is not allowed.'));
|
|
232
|
+
console.log(chalk.gray(` Workspace: ${WORKSPACE}`));
|
|
233
|
+
console.log();
|
|
234
|
+
rl.prompt();
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
223
238
|
// Force Python 3.12 — rewrite python/python3 to correct binary
|
|
224
239
|
let resolvedInput = input;
|
|
225
240
|
if (process.platform === 'darwin') {
|