icoa-cli 2.13.2 → 2.13.4
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/lang.js +9 -0
- package/dist/lib/gemini.js +3 -3
- package/dist/repl.js +8 -1
- package/package.json +1 -1
package/dist/commands/lang.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import { getConfig, saveConfig } from '../lib/config.js';
|
|
3
|
+
import { getExamState } from '../lib/exam-state.js';
|
|
3
4
|
import { logCommand } from '../lib/logger.js';
|
|
4
5
|
import { printSuccess, printError, printInfo } from '../lib/ui.js';
|
|
5
6
|
import { SUPPORTED_LANGUAGES } from '../types/index.js';
|
|
@@ -48,5 +49,13 @@ export function registerLangCommand(program) {
|
|
|
48
49
|
}
|
|
49
50
|
saveConfig({ language: code });
|
|
50
51
|
printSuccess(`Language set to: ${LANG_NAMES[code] || code}`);
|
|
52
|
+
// If exam in progress, show current question to resume
|
|
53
|
+
const state = getExamState();
|
|
54
|
+
if (state) {
|
|
55
|
+
const currentQ = state._lastQ || 1;
|
|
56
|
+
console.log();
|
|
57
|
+
console.log(chalk.gray(` Exam in progress — resuming Q${currentQ}:`));
|
|
58
|
+
console.log(chalk.white(` Type: exam q ${currentQ}`));
|
|
59
|
+
}
|
|
51
60
|
});
|
|
52
61
|
}
|
package/dist/lib/gemini.js
CHANGED
|
@@ -80,7 +80,7 @@ export async function generateHint(level, question, context) {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
const config = getConfig();
|
|
83
|
-
const modelName = config.geminiModel || '
|
|
83
|
+
const modelName = config.geminiModel || 'gemma-4-31b-it';
|
|
84
84
|
const ai = getClient(apiKey);
|
|
85
85
|
const response = await ai.models.generateContent({
|
|
86
86
|
model: modelName,
|
|
@@ -115,7 +115,7 @@ ${text}`;
|
|
|
115
115
|
catch {
|
|
116
116
|
// Fallback to flash if pro not available
|
|
117
117
|
const config = getConfig();
|
|
118
|
-
const fallback = config.geminiModel || '
|
|
118
|
+
const fallback = config.geminiModel || 'gemma-4-31b-it';
|
|
119
119
|
const response = await ai.models.generateContent({
|
|
120
120
|
model: fallback,
|
|
121
121
|
contents: prompt,
|
|
@@ -165,7 +165,7 @@ export async function createChatSession(context) {
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
const config = getConfig();
|
|
168
|
-
const modelName = config.geminiModel || '
|
|
168
|
+
const modelName = config.geminiModel || 'gemma-4-31b-it';
|
|
169
169
|
const ai = getClient(apiKey);
|
|
170
170
|
let systemPrompt = CHAT_SYSTEM_PROMPT;
|
|
171
171
|
if (context) {
|
package/dist/repl.js
CHANGED
|
@@ -417,7 +417,14 @@ export async function startRepl(program, resumeMode) {
|
|
|
417
417
|
const selectionCommands = ['exam', 'demo', 'next', 'prev', 'setup', 'lang', 'ref'];
|
|
418
418
|
const organizerCommands = ['join', 'exam', 'demo', 'next', 'prev', 'logout', 'setup', 'lang', 'ref', 'ctf'];
|
|
419
419
|
if (mode === 'selection' && !selectionCommands.includes(cmd)) {
|
|
420
|
-
console.log(chalk.gray(' Not available in Selection mode.
|
|
420
|
+
console.log(chalk.gray(' Not available in Selection mode.'));
|
|
421
|
+
if (examState) {
|
|
422
|
+
const currentQ = examState._lastQ || 1;
|
|
423
|
+
console.log(chalk.white(` Resume exam: exam q ${currentQ}`) + chalk.gray(' · ') + chalk.white('A/B/C/D') + chalk.gray(' to answer'));
|
|
424
|
+
}
|
|
425
|
+
else {
|
|
426
|
+
console.log(chalk.gray(' Try: demo · setup to switch mode'));
|
|
427
|
+
}
|
|
421
428
|
console.log();
|
|
422
429
|
rl.prompt();
|
|
423
430
|
return;
|