icoa-cli 2.19.71 → 2.19.72
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/repl.js +8 -2
- package/package.json +1 -1
package/dist/repl.js
CHANGED
|
@@ -704,7 +704,11 @@ export async function startRepl(program, resumeMode) {
|
|
|
704
704
|
// ─── Mode-based command filtering ───
|
|
705
705
|
const selectionCommands = ['exam', 'demo', 'retry', 'nations', 'next', 'prev', 'continue', 'setup', 'lang', 'ref', 'ai4ctf', 'ctf4ai', 'mark', 'unmark', 'review', 'submit'];
|
|
706
706
|
const organizerCommands = ['join', 'exam', 'demo', 'retry', 'next', 'prev', 'logout', 'setup', 'lang', 'ref', 'ctf', 'mark', 'unmark', 'review', 'submit'];
|
|
707
|
-
|
|
707
|
+
// Selection mode allows shell commands prefixed with ! — contestants
|
|
708
|
+
// need !python3, !cat, !base64 etc. for practical questions (Q31-Q40).
|
|
709
|
+
// BLOCKED_COMMANDS check downstream still rejects dangerous ones.
|
|
710
|
+
const isShellCommand = input.startsWith('!') || cmd.startsWith('!');
|
|
711
|
+
if (mode === 'selection' && !isShellCommand && !selectionCommands.includes(cmd)) {
|
|
708
712
|
console.log(chalk.gray(' Not available in Selection mode.'));
|
|
709
713
|
if (examState) {
|
|
710
714
|
const currentQ = examState._lastQ || 1;
|
|
@@ -764,7 +768,9 @@ export async function startRepl(program, resumeMode) {
|
|
|
764
768
|
}
|
|
765
769
|
}
|
|
766
770
|
// Force Python 3.12 — rewrite python/python3 to correct binary
|
|
767
|
-
|
|
771
|
+
// Strip optional ! prefix that contestants use to disambiguate shell
|
|
772
|
+
// commands from CLI commands (e.g. !python3 vs cli's "python" command).
|
|
773
|
+
let resolvedInput = input.startsWith('!') ? input.slice(1).trim() : input;
|
|
768
774
|
if (process.platform === 'darwin') {
|
|
769
775
|
const py12 = '/opt/homebrew/opt/python@3.12/bin/python3.12';
|
|
770
776
|
resolvedInput = resolvedInput
|