icoa-cli 2.14.4 → 2.15.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/ctf4ai-demo.js +14 -8
- package/dist/commands/exam.js +25 -28
- package/dist/commands/lang.js +2 -1
- package/package.json +1 -1
|
@@ -91,19 +91,25 @@ export function registerCtf4aiDemoCommand(program) {
|
|
|
91
91
|
console.log();
|
|
92
92
|
console.log(chalk.red.bold(' ═══ CTF4AI Demo — Hack the AI ═══'));
|
|
93
93
|
console.log();
|
|
94
|
-
console.log(chalk.white(' Challenge:
|
|
94
|
+
console.log(chalk.white(' Challenge: Make the AI Say a Forbidden Word'));
|
|
95
|
+
console.log();
|
|
96
|
+
console.log(chalk.gray(' In the real world, AI systems have safety rules.'));
|
|
97
|
+
console.log(chalk.gray(' Your job: find a way to trick the AI into breaking them!'));
|
|
95
98
|
console.log();
|
|
96
99
|
console.log(chalk.gray(' ┌─────────────────────────────────────────────────┐'));
|
|
97
|
-
console.log(chalk.gray(' │') + chalk.white(' The AI
|
|
98
|
-
console.log(chalk.gray(' │') + chalk.white(' Your mission: make it say "koala"
|
|
100
|
+
console.log(chalk.gray(' │') + chalk.white(' The AI must NEVER say the word "koala". ') + chalk.gray('│'));
|
|
101
|
+
console.log(chalk.gray(' │') + chalk.white(' Your mission: make it say "koala" anyway! ') + chalk.gray('│'));
|
|
99
102
|
console.log(chalk.gray(' │') + chalk.white(' ') + chalk.gray('│'));
|
|
100
|
-
console.log(chalk.gray(' │') + chalk.
|
|
101
|
-
console.log(chalk.gray(' │') + chalk.gray('
|
|
103
|
+
console.log(chalk.gray(' │') + chalk.yellow(' Ideas to try: ') + chalk.gray('│'));
|
|
104
|
+
console.log(chalk.gray(' │') + chalk.gray(' · Ask about Australian animals ') + chalk.gray('│'));
|
|
105
|
+
console.log(chalk.gray(' │') + chalk.gray(' · Ask it to write a story or poem ') + chalk.gray('│'));
|
|
106
|
+
console.log(chalk.gray(' │') + chalk.gray(' · Ask it to translate or spell something ') + chalk.gray('│'));
|
|
107
|
+
console.log(chalk.gray(' │') + chalk.gray(' · Be creative — there is no wrong approach! ') + chalk.gray('│'));
|
|
102
108
|
console.log(chalk.gray(' └─────────────────────────────────────────────────┘'));
|
|
103
109
|
console.log();
|
|
104
|
-
console.log(chalk.gray(`
|
|
105
|
-
console.log(chalk.gray(` AI Model: ${modelName}`));
|
|
106
|
-
console.log(chalk.gray(' Type "exit" to quit.'));
|
|
110
|
+
console.log(chalk.gray(` Conversation budget: ~${Math.round(CTF4AI_TOKEN_LIMIT / 4)} words (${CTF4AI_TOKEN_LIMIT} tokens)`));
|
|
111
|
+
console.log(chalk.gray(` AI Model: Google Gemma 4 (${modelName})`));
|
|
112
|
+
console.log(chalk.gray(' Type "exit" to quit anytime.'));
|
|
107
113
|
console.log();
|
|
108
114
|
try {
|
|
109
115
|
// Create chat with restrictive system prompt
|
package/dist/commands/exam.js
CHANGED
|
@@ -327,7 +327,7 @@ export function registerExamCommand(program) {
|
|
|
327
327
|
exam
|
|
328
328
|
.command('help')
|
|
329
329
|
.description('Eliminate one wrong option (limited uses)')
|
|
330
|
-
.action(() => {
|
|
330
|
+
.action(async () => {
|
|
331
331
|
logCommand('exam help');
|
|
332
332
|
const state = getExamState();
|
|
333
333
|
if (!state) {
|
|
@@ -351,8 +351,8 @@ export function registerExamCommand(program) {
|
|
|
351
351
|
// Check: already used 2 helps on this question
|
|
352
352
|
if (qHelps >= 2) {
|
|
353
353
|
console.log();
|
|
354
|
-
console.log(chalk.yellow(' 🙈
|
|
355
|
-
console.log(chalk.gray('
|
|
354
|
+
console.log(chalk.yellow(' 🙈 Max 2 helps per question — you already have a 50/50!'));
|
|
355
|
+
console.log(chalk.gray(' Trust your instinct and pick one!'));
|
|
356
356
|
console.log();
|
|
357
357
|
printQuestion(q, state.answers[q.number]);
|
|
358
358
|
return;
|
|
@@ -405,9 +405,8 @@ export function registerExamCommand(program) {
|
|
|
405
405
|
printQuestion(q, state.answers[q.number]);
|
|
406
406
|
};
|
|
407
407
|
if (state.session.examId === 'demo-free') {
|
|
408
|
-
import('../lib/demo-exam.js')
|
|
409
|
-
|
|
410
|
-
});
|
|
408
|
+
const { DEMO_ANSWERS } = await import('../lib/demo-exam.js');
|
|
409
|
+
doEliminate(DEMO_ANSWERS[currentQ]);
|
|
411
410
|
}
|
|
412
411
|
else {
|
|
413
412
|
// For server exams, we don't know the answer — eliminate random non-selected option
|
|
@@ -486,7 +485,7 @@ export function registerExamCommand(program) {
|
|
|
486
485
|
saveExamState(state);
|
|
487
486
|
const answered = Object.keys(state.answers).length;
|
|
488
487
|
const total = state.session.questionCount;
|
|
489
|
-
printSuccess(`Q${num}: ${c}
|
|
488
|
+
printSuccess(`Q${num}: ${c} ✓ (${answered}/${total} answered)`);
|
|
490
489
|
// Auto-show next question
|
|
491
490
|
if (num < state.questions.length) {
|
|
492
491
|
const nextQ = state.questions[num]; // 0-indexed: questions[num] = question num+1
|
|
@@ -573,7 +572,7 @@ export function registerExamCommand(program) {
|
|
|
573
572
|
if (unanswered > 0) {
|
|
574
573
|
msg += chalk.yellow(` ${unanswered} unanswered.`);
|
|
575
574
|
}
|
|
576
|
-
msg += '
|
|
575
|
+
msg += ' You cannot change answers after this.';
|
|
577
576
|
const proceed = await confirm({ message: chalk.white(msg), default: false, theme: { prefix: '', style: { message: (t) => t, defaultAnswer: (t) => chalk.green(t) } } });
|
|
578
577
|
if (!proceed)
|
|
579
578
|
return;
|
|
@@ -612,21 +611,19 @@ export function registerExamCommand(program) {
|
|
|
612
611
|
console.log(chalk.cyan(' ═══════════════════════════════════════'));
|
|
613
612
|
console.log();
|
|
614
613
|
// ─── Dual-track introduction ───
|
|
615
|
-
console.log(chalk.white('
|
|
614
|
+
console.log(chalk.white(' Nice work! ICOA has ') + chalk.bold('TWO') + chalk.white(' competition tracks:'));
|
|
615
|
+
console.log();
|
|
616
|
+
console.log(chalk.green.bold(' AI4CTF') + chalk.white(' — Solve problems with AI help'));
|
|
617
|
+
console.log(chalk.gray(' The AI is your teammate. Ask questions, get hints,'));
|
|
618
|
+
console.log(chalk.gray(' work together to solve cybersecurity challenges.'));
|
|
616
619
|
console.log();
|
|
617
|
-
console.log(chalk.
|
|
618
|
-
console.log(chalk.gray('
|
|
619
|
-
console.log(chalk.gray('
|
|
620
|
-
console.log(chalk.gray(' │') + chalk.gray(' hint a (50x) · hint b (10x) · hint c (2x) ') + chalk.gray('│'));
|
|
621
|
-
console.log(chalk.gray(' │') + chalk.gray(' ') + chalk.gray('│'));
|
|
622
|
-
console.log(chalk.gray(' │') + chalk.red.bold(' CTF4AI') + chalk.gray(' [Day 2] AI is your target ') + chalk.gray('│'));
|
|
623
|
-
console.log(chalk.gray(' │') + chalk.gray(' Hack, trick, and red-team AI systems. ') + chalk.gray('│'));
|
|
624
|
-
console.log(chalk.gray(' │') + chalk.gray(' Prompt injection, adversarial ML, and more. ') + chalk.gray('│'));
|
|
625
|
-
console.log(chalk.gray(' └─────────────────────────────────────────────────┘'));
|
|
620
|
+
console.log(chalk.red.bold(' CTF4AI') + chalk.white(' — Hack the AI itself'));
|
|
621
|
+
console.log(chalk.gray(' Can you trick the AI into breaking its own rules?'));
|
|
622
|
+
console.log(chalk.gray(' Try to make it say a forbidden word!'));
|
|
626
623
|
console.log();
|
|
627
624
|
console.log(chalk.white(' Try them now:'));
|
|
628
|
-
console.log(chalk.green.bold(' ai4ctf') + chalk.gray(' Chat with your AI teammate'));
|
|
629
|
-
console.log(chalk.red.bold(' ctf4ai') + chalk.gray('
|
|
625
|
+
console.log(chalk.green.bold(' ai4ctf') + chalk.gray(' Chat with your AI teammate (try this first!)'));
|
|
626
|
+
console.log(chalk.red.bold(' ctf4ai') + chalk.gray(' Challenge: make AI say "koala"'));
|
|
630
627
|
console.log();
|
|
631
628
|
}
|
|
632
629
|
catch (err) {
|
|
@@ -779,18 +776,18 @@ export function registerExamCommand(program) {
|
|
|
779
776
|
console.log();
|
|
780
777
|
printHeader('ICOA Demo Exam — Free Practice');
|
|
781
778
|
console.log();
|
|
782
|
-
console.log(chalk.white(' Free practice
|
|
783
|
-
console.log(chalk.white(' 30 questions ·
|
|
779
|
+
console.log(chalk.white(' Free practice · No account needed · No time limit'));
|
|
780
|
+
console.log(chalk.white(' 30 questions · Pick one answer per question'));
|
|
784
781
|
console.log();
|
|
785
782
|
console.log(chalk.gray(' ┌─────────────────────────────────────────────────┐'));
|
|
786
|
-
console.log(chalk.gray(' │') + chalk.white('
|
|
787
|
-
console.log(chalk.gray(' │') + chalk.white(' Type
|
|
788
|
-
console.log(chalk.gray(' │') + chalk.white(' Type ') + chalk.yellow('help') + chalk.white('
|
|
789
|
-
console.log(chalk.gray(' │') + chalk.white(' Type ') + chalk.yellow('next') + chalk.white('/') + chalk.yellow('prev') + chalk.white('
|
|
783
|
+
console.log(chalk.gray(' │') + chalk.white(' How to play: ') + chalk.gray('│'));
|
|
784
|
+
console.log(chalk.gray(' │') + chalk.white(' Type ') + chalk.yellow('A') + chalk.white(', ') + chalk.yellow('B') + chalk.white(', ') + chalk.yellow('C') + chalk.white(' or ') + chalk.yellow('D') + chalk.white(' to answer ') + chalk.gray('│'));
|
|
785
|
+
console.log(chalk.gray(' │') + chalk.white(' Type ') + chalk.yellow('help') + chalk.white(' Remove a wrong answer (5 uses) ') + chalk.gray('│'));
|
|
786
|
+
console.log(chalk.gray(' │') + chalk.white(' Type ') + chalk.yellow('next') + chalk.white('/') + chalk.yellow('prev') + chalk.white(' Move between questions ') + chalk.gray('│'));
|
|
787
|
+
console.log(chalk.gray(' │') + chalk.white(' You can change answers anytime before submitting ') + chalk.gray('│'));
|
|
788
|
+
console.log(chalk.gray(' │') + chalk.white(' Running low on help? Type ') + chalk.yellow('more help') + chalk.white(' for +3 ') + chalk.gray('│'));
|
|
790
789
|
console.log(chalk.gray(' └─────────────────────────────────────────────────┘'));
|
|
791
790
|
console.log();
|
|
792
|
-
console.log(chalk.gray(' For real exams, your proctor will provide credentials.'));
|
|
793
|
-
console.log();
|
|
794
791
|
const proceed = await confirm({
|
|
795
792
|
message: chalk.white('Start demo exam now?'),
|
|
796
793
|
default: true,
|
package/dist/commands/lang.js
CHANGED
|
@@ -44,7 +44,8 @@ export function registerLangCommand(program) {
|
|
|
44
44
|
}
|
|
45
45
|
if (!SUPPORTED_LANGUAGES.includes(code)) {
|
|
46
46
|
printError(`Unsupported language: ${code}`);
|
|
47
|
-
|
|
47
|
+
const supported = SUPPORTED_LANGUAGES.map((l) => `${l} (${LANG_NAMES[l]?.split(' ')[0] || l})`).join(', ');
|
|
48
|
+
printInfo(`Supported: ${supported}`);
|
|
48
49
|
return;
|
|
49
50
|
}
|
|
50
51
|
saveConfig({ language: code });
|