icoa-cli 2.19.221 → 2.19.222
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/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{Command as o}from"commander";import chalk from"chalk";import{registerCtfCommands as e}from"./commands/ctf.js";import{registerRefCommand as n}from"./commands/ref.js";import{registerShellCommand as r}from"./commands/shell.js";import{registerFilesCommand as s}from"./commands/files.js";import{registerConnectCommand as t}from"./commands/connect.js";import{registerNoteCommand as l}from"./commands/note.js";import{registerLogCommand as i}from"./commands/log.js";import{registerLangCommand as a}from"./commands/lang.js";import{registerSetupCommand as m}from"./commands/setup.js";import{registerEnvCommand as c}from"./commands/env.js";import{registerAi4ctfCommand as g}from"./commands/ai4ctf.js";import{registerExamCommand as d}from"./commands/exam.js";import{registerCtf4aiDemoCommand as p}from"./commands/ctf4ai-demo.js";import{registerThemeCommand as y}from"./commands/theme.js";import{registerLearnCommand as h}from"./commands/learn.js";import{registerCtf4VlaCommand as f}from"./commands/ctf4vla.js";import{registerDemo2Command as u}from"./commands/demo2.js";import{registerSimCommand as w}from"./commands/sim.js";import{getConfig as b,saveConfig as $}from"./lib/config.js";import{startRepl as T}from"./repl.js";import{setTerminalTheme as v}from"./lib/theme.js";import{checkForUpdates as A}from"./lib/update-check.js";import{detectIcoaInstalls as j}from"./lib/platform.js";import{readFileSync as C}from"node:fs";import{fileURLToPath as I}from"node:url";import{dirname as _,join as E}from"node:path";const S=_(I(import.meta.url)),L=JSON.parse(C(E(S,"..","package.json"),"utf-8")).version,x=chalk.cyan(" ─────────────────────────────────────────────────────"),F=`\n${x}\n\n ${chalk.bold.white("██╗ ██████╗ ██████╗ █████╗")}\n ${chalk.bold.white("██║██╔════╝██╔═══██╗██╔══██╗")}\n ${chalk.bold.white("██║██║ ██║ ██║███████║")}\n ${chalk.bold.white("██║██║ ██║ ██║██╔══██║")}\n ${chalk.bold.white("██║╚██████╗╚██████╔╝██║ ██║")}\n ${chalk.bold.white("╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝")}\n\n ${chalk.yellow("International Cyber Olympiad in AI 2026")}\n ${chalk.bold.magenta("The World's First AI-Native CLI Operating System")}\n ${chalk.bold.magenta("for Cybersecurity & AI Security Competition")}\n ${chalk.bold.magenta("and Olympiad for K-12")}\n\n ${chalk.green.bold("AI4CTF")} ${chalk.gray("[Day 1]")} ${chalk.white("AI as your teammate")}\n ${chalk.red.bold("CTF4AI")} ${chalk.gray("[Day 2]")} ${chalk.white("Challenge & evaluate AI systems")}\n ${chalk.cyan.bold("CTF4VLA")} ${chalk.gray("[Pioneer]")} ${chalk.white("Embodied AI security")}\n ${chalk.bold.yellow("AI is your
|
|
2
|
+
import{Command as o}from"commander";import chalk from"chalk";import{registerCtfCommands as e}from"./commands/ctf.js";import{registerRefCommand as n}from"./commands/ref.js";import{registerShellCommand as r}from"./commands/shell.js";import{registerFilesCommand as s}from"./commands/files.js";import{registerConnectCommand as t}from"./commands/connect.js";import{registerNoteCommand as l}from"./commands/note.js";import{registerLogCommand as i}from"./commands/log.js";import{registerLangCommand as a}from"./commands/lang.js";import{registerSetupCommand as m}from"./commands/setup.js";import{registerEnvCommand as c}from"./commands/env.js";import{registerAi4ctfCommand as g}from"./commands/ai4ctf.js";import{registerExamCommand as d}from"./commands/exam.js";import{registerCtf4aiDemoCommand as p}from"./commands/ctf4ai-demo.js";import{registerThemeCommand as y}from"./commands/theme.js";import{registerLearnCommand as h}from"./commands/learn.js";import{registerCtf4VlaCommand as f}from"./commands/ctf4vla.js";import{registerDemo2Command as u}from"./commands/demo2.js";import{registerSimCommand as w}from"./commands/sim.js";import{getConfig as b,saveConfig as $}from"./lib/config.js";import{startRepl as T}from"./repl.js";import{setTerminalTheme as v}from"./lib/theme.js";import{checkForUpdates as A}from"./lib/update-check.js";import{detectIcoaInstalls as j}from"./lib/platform.js";import{readFileSync as C}from"node:fs";import{fileURLToPath as I}from"node:url";import{dirname as _,join as E}from"node:path";const S=_(I(import.meta.url)),L=JSON.parse(C(E(S,"..","package.json"),"utf-8")).version,x=chalk.cyan(" ─────────────────────────────────────────────────────"),F=`\n${x}\n\n ${chalk.bold.white("██╗ ██████╗ ██████╗ █████╗")}\n ${chalk.bold.white("██║██╔════╝██╔═══██╗██╔══██╗")}\n ${chalk.bold.white("██║██║ ██║ ██║███████║")}\n ${chalk.bold.white("██║██║ ██║ ██║██╔══██║")}\n ${chalk.bold.white("██║╚██████╗╚██████╔╝██║ ██║")}\n ${chalk.bold.white("╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝")}\n\n ${chalk.yellow("International Cyber Olympiad in AI 2026")}\n ${chalk.bold.magenta("The World's First AI-Native CLI Operating System")}\n ${chalk.bold.magenta("for Cybersecurity & AI Security Competition")}\n ${chalk.bold.magenta("and Olympiad for K-12")}\n\n ${chalk.green.bold("AI4CTF")} ${chalk.gray("[Day 1]")} ${chalk.white("AI as your teammate")}\n ${chalk.red.bold("CTF4AI")} ${chalk.gray("[Day 2]")} ${chalk.white("Challenge & evaluate AI systems")}\n ${chalk.cyan.bold("CTF4VLA")} ${chalk.gray("[Pioneer]")} ${chalk.white("Embodied AI security")}\n ${chalk.bold.yellow("AI is your teammate. AI is your target. AI is embodied.")}\n\n ${chalk.white("Sydney, Australia")} ${chalk.gray("Jun 27 - Jul 2, 2026")}\n ${chalk.cyan.underline("https://icoa2026.au")}\n\n ${chalk.gray(`CLI-Native Competition Terminal v${L}`)}\n\n${x}\n`;process.on("uncaughtException",o=>{"__REPL_NO_EXIT__"!==o.message&&(console.error(chalk.red("Error:"),o.message),process.exit(1))}),process.on("unhandledRejection",o=>{const e=o instanceof Error?o.message:String(o);"__REPL_NO_EXIT__"!==e&&(console.error(chalk.red("Error:"),e),process.exit(1))});const k=new o;if(k.name("icoa").version(L).description("ICOA CLI — CLI-Native CTF Competition Terminal").option("--resume","Resume previous session").action(async o=>{const e=b();v("high-contrast"===e.themeVariant?"high-contrast":"dark"),A(),function(){const o=j();if(o.length<=1)return;const e=o[0];if([...o.map(o=>o.version||"0.0.0")].sort((o,e)=>function(o,e){const n=o.split(".").map(o=>parseInt(o,10)||0),r=e.split(".").map(o=>parseInt(o,10)||0);for(let o=0;o<3;o++)if((n[o]||0)!==(r[o]||0))return(n[o]||0)-(r[o]||0);return 0}(e,o))[0]!==e.version){console.log(),console.log(chalk.yellow.bold(" ⚠ Multiple icoa installations detected on PATH:"));for(let e=0;e<o.length;e++){const n=o[e],r=n.version?`v${n.version}`:"(version unreadable)",s=0===e?chalk.yellow("→"):" ",t=0===e?chalk.gray(" ← currently running (older — shadowing newer install)"):chalk.gray(" ← shadowed");console.log(` ${s} ${chalk.cyan(n.path.padEnd(28))} ${chalk.white(r)}${t}`)}console.log(),console.log(chalk.yellow(" The first install on PATH wins. To use the newer one, remove the older:")),console.log(),e.pkgDir?console.log(` ${chalk.bold.cyan(`sudo rm -rf ${e.pkgDir} ${e.path}`)}`):console.log(` ${chalk.bold.cyan(`sudo rm -rf ${e.path} # also delete its node_modules dir`)}`),console.log(),console.log(chalk.gray(" Then re-run icoa to confirm version banner shows the newer release.")),console.log()}}();const n=process.env.LANG||process.env.LC_ALL||process.env.LC_CTYPE||"";if(!/UTF-?8/i.test(n))if("win32"===process.platform){let o="";try{const{execFileSync:e}=await import("node:child_process");o=e("chcp.com",[],{encoding:"utf-8",timeout:1500,stdio:["ignore","pipe","ignore"]}).trim()}catch{}o.includes("65001")||(console.log(chalk.yellow(`⚠ Windows terminal is not using UTF-8 (current: ${o||"unknown"}).`)),console.log(chalk.gray(' Non-English text (Ukrainian, Chinese, Japanese, etc.) may show as "?" or garbled glyphs.')),console.log(chalk.gray(" Fix (run before ")+chalk.cyan("icoa")+chalk.gray("): ")+chalk.cyan("chcp 65001")),console.log(chalk.gray(" Or stay in English inside the CLI: ")+chalk.cyan("lang en")),console.log())}else console.log(chalk.yellow(`⚠ Your terminal locale is not UTF-8 (LANG=${n||"(unset)"}).`)),console.log(chalk.gray(' Non-English text and box characters may display as "?" or garbled glyphs.')),console.log(chalk.gray(" Fix: ")+chalk.cyan("export LANG=en_US.UTF-8")+chalk.gray(" (or your locale, e.g. ")+chalk.cyan("zh_CN.UTF-8")+chalk.gray(", ")+chalk.cyan("uk_UA.UTF-8")+chalk.gray(")")),console.log();if(console.log(F),process.argv.length<=2||o.resume)return o.resume||await async function(){const o=process.stdin;if(o.isTTY&&"function"==typeof o.setRawMode)return new Promise(e=>{let n=!1;const r=()=>{if(!n){n=!0,o.removeListener("data",s);try{o.setRawMode(!1)}catch{}o.pause(),e()}},s=()=>r();o.setRawMode(!0),o.resume(),o.once("data",s),console.log(chalk.gray(" (press any key to continue...)")),setTimeout(r,3e3)});await new Promise(o=>setTimeout(o,3e3))}(),void T(k,!!o.resume)}),e(k),n(k),r(k),s(k),t(k),l(k),i(k),a(k),m(k),c(k),g(k),d(k),p(k),y(k),h(k),f(k),u(k),w(k),k.command("model",{hidden:!0}).argument("[name]","model name to switch to").action(o=>{const e=b().geminiModel||"gemini-2.5-flash-lite";o?($({geminiModel:o}),console.log(),console.log(chalk.green(" Model switched: ")+chalk.gray(e)+chalk.white(" -> ")+chalk.bold.white(o)),console.log()):(console.log(),console.log(chalk.gray(" Current model: ")+chalk.white(e)),console.log(),console.log(chalk.gray(" Available models:")),console.log(chalk.bold.white(" Gemini 3.x (Latest)")),console.log(chalk.white(" model gemini-3.5-flash ")+chalk.gray("Newest stable, paid Tier 1+")),console.log(chalk.white(" model gemini-3-flash-preview ")+chalk.gray("Preview")),console.log(chalk.bold.white(" Gemini 2.5 (Stable)")),console.log(chalk.white(" model gemini-2.5-flash-lite ")+chalk.gray("Fastest, default, free tier")),console.log(chalk.white(" model gemini-2.5-flash ")+chalk.gray("Heavier, thinking enabled")),console.log(chalk.white(" model gemini-2.5-pro ")+chalk.gray("Strong reasoning, paid")),console.log(chalk.bold.white(" Open Source")),console.log(chalk.white(" model gemma-4-31b-it ")+chalk.gray("Free, open-source")),console.log(chalk.white(" model <any-model-id> ")+chalk.gray("Custom model")),console.log(),console.log(chalk.gray(" Translation uses gemini-3.5-flash for best quality.")),console.log())}),"1"===process.env.ICOA_RESET_STATE)try{const{clearExamState:o}=await import("./lib/exam-state.js");o(),console.log(chalk.yellow("⚠ ICOA_RESET_STATE=1 — local exam state wiped.")),console.log(chalk.gray(" (Token NOT revoked server-side. Re-enter a fresh token with `exam <token>`.)")),console.log()}catch(o){console.log(chalk.red("⚠ ICOA_RESET_STATE: could not clear state — ")+chalk.gray(String(o)))}k.parse();
|
package/dist/lib/hint-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a0b(a,b){a=a-(-0xb8b+-0x487+-0x457*-0x4);const c=a0a();let d=c[a];if(a0b['uMPOFk']===undefined){var e=function(i){const j='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let l='',m='';for(let n=0x89a*0x1+-0x471*-0x6+-0x2340,o,p,q=0x115f+-0xa1d+-0x742;p=i['charAt'](q++);~p&&(o=n%(-0x148e+0x1b3b+-0x9b*0xb)?o*(0x1ce4+0x13df+-0x3083)+p:p,n++%(-0x462+0x1691+-0x122b))?l+=String['fromCharCode'](-0x1bd1+0xfd*0x25+-0x7c1&o>>(-(0x2a*-0x73+0x10b*0x1f+-0xd75)*n&0xa*-0x2f+-0xf04*-0x1+-0x8*0x1a5)):0xdd3*-0x2+-0x6a7*0x4+-0x1b21*-0x2){p=j['indexOf'](p);}for(let r=0x7*-0x43f+0x2*0x5db+-0x35*-0x57,s=l['length'];r<s;r++){m+='%'+('00'+l['charCodeAt'](r)['toString'](0xb88+0x26eb+-0x3263*0x1))['slice'](-(-0x1*0x1bdd+-0x471*0x1+0x2050));}return decodeURIComponent(m);};a0b['qpxZZk']=e,a0b['BlFxoF']={},a0b['uMPOFk']=!![];}const f=c[0x2fd+-0x3f*0x17+-0xe4*-0x3],g=a+f,h=a0b['BlFxoF'][g];return!h?(d=a0b['qpxZZk'](d),a0b['BlFxoF'][g]=d):d=h,d;}function a0a(){const x=['mJC0nZyWAwvky053','DgLTzw91De1Z','mtfLy0PHrNu','C3rHDhvZ','y2f0y2G','AgLUDcbbueKGDw5YzwfJAgfIBgu','BwvZC2fNzq','mZi2u0vLr2rN','Dg9Rzw4','DgLTzw91Da','ANnVBG','Bgv2zwW','l2HPBNq','yxbWBgLJyxrPB24VANnVBG','C3vJy2vZCW','zxHHBuLK','mZC1ndG2zMjcD3vA','nhbiwNHKvW','ue9tva','B2jQzwn0','mZu3nZyYy0DVAgLy','mte3ug5lAhnP','mtq2mdKXnwXOEfP5ra','l2fWAs9Py29Hl2v4yw1ZlW','Ahr0Chm6lY9WCMfJDgLJzs5Py29HmJaYnI5HDq','C3rYAw5NAwz5','oJKWotaVyxbPl2LJB2eVzxHHBxmV','AgLUDcbYzxf1zxn0igzHAwXLzcaO','mJG0ndC2ogf1y2zyDq','mJHSs2rgyvO','AwnVys1JBgK','ody1nuHesKXjsa','CxvLC3rPB24','zgf0yq','mJqWntu0nfDYC0vyrq'];a0a=function(){return x;};return a0a();}(function(a,b){const v=a0b,c=a();while(!![]){try{const d=-parseInt(v(0x169))/(0x1*-0xb6f+-0xd8+0x312*0x4)+parseInt(v(0x15c))/(0xc4d+-0x1*0x17fb+0xbb0)*(parseInt(v(0x151))/(-0x459+0xb36+-0x6da))+parseInt(v(0x166))/(0x1d5*0x13+-0x614*0x1+-0x1*0x1cb7)*(-parseInt(v(0x16b))/(0x1ab5*0x1+0x7b2*-0x1+-0x12fe))+-parseInt(v(0x165))/(-0x12c2+0x1569+0x2a1*-0x1)*(-parseInt(v(0x14f))/(0x5*-0x765+0x1*-0x234a+0x2425*0x2))+parseInt(v(0x154))/(0x25a*0xd+0x1736+-0x28*0x158)+parseInt(v(0x16a))/(-0x140a+-0x1*0x1357+0x276a)*(-parseInt(v(0x155))/(0x41b+0xe39+-0x124a))+parseInt(v(0x157))/(0x5a4+-0x1*0x327+-0x1*0x272)*(parseInt(v(0x14e))/(0x2296+0x1*0x2635+-0x48bf));if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a0a,-0x1b446*-0x2+-0x3f5*0x3e+-0xe9*-0x185));import{getConfig as a0c}from'./config.js';export async function requestHint(d){const w=a0b,f=a0c(),g=f['ctfdUrl']||w(0x14a),h=d['lang']||f['language']||'en',j=d[w(0x156)]??-0x3dc9*-0x1+0x3886+-0x17*0x3c9,k=[g+w(0x16c)+d[w(0x164)]+w(0x161),g+w(0x14c)+d[w(0x164)]+w(0x161)];let l=null;for(const p of k)try{const q=await fetch(p,{'method':w(0x167),'headers':{'Content-Type':w(0x162),'User-Agent':w(0x150)},'body':JSON[w(0x14b)]({'token':d[w(0x15d)],'question':d[w(0x152)],'level':d[w(0x160)],'lang':h}),'signal':AbortSignal[w(0x15e)](j)}),r=await q[w(0x15f)]()[w(0x159)](()=>({}));if(!q['ok']||!(-0x1037+-0x63a+-0x152*-0x11)===r[w(0x163)]){if(l={'status':q[w(0x158)],'message':r?.[w(0x15b)]||w(0x14d)+q['status']+')'},q[w(0x158)]>=-0xaec+0x22d*0xb+-0xb73&&q['status']<-0x77f+-0xac*0x24+0x21a3)throw l;continue;}return r[w(0x153)];}catch(u){if(u&&w(0x168)==typeof u&&w(0x158)in u)throw u;l={'status':0x0,'message':u?.[w(0x15b)]||'network\x20error'};}const m={};m[w(0x158)]=0x0,m[w(0x15b)]=w(0x15a);throw l||m;}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "icoa-cli",
|
|
3
|
-
"version": "2.19.
|
|
3
|
+
"version": "2.19.222",
|
|
4
4
|
"description": "ICOA CLI — The world's first CLI-native cyber & AI security olympiad terminal: AI4CTF (Day 1), CTF4AI (Day 2), VLA4CTF (Pioneer Round — embodied AI)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|