icoa-cli 2.19.159 → 2.19.161
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/ai4ctf.js +1 -1
- package/dist/commands/exam.js +1 -1
- package/dist/lib/learn-curricula.d.ts +35 -0
- package/dist/lib/learn-curricula.js +1 -1
- package/dist/lib/learn-i18n.d.ts +8 -0
- package/dist/lib/learn-i18n.js +1 -0
- package/dist/lib/learn-phases.d.ts +4 -0
- package/dist/lib/learn-phases.js +1 -1
- package/dist/lib/learn-render.js +1 -1
- package/package.json +1 -1
package/dist/lib/learn-render.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import chalk from"chalk";function
|
|
1
|
+
import chalk from"chalk";import{localized as o}from"./learn-curricula.js";import{t as e}from"./learn-i18n.js";import{getConfig as l}from"./config.js";function n(){return(l().language||"en").toLowerCase()}function r(o="─"){return o.repeat(66)}function t(o,e,l=20){const n=e>0?o/e:0,r=Math.floor(n*l),t=l-r;return`${chalk.green("█".repeat(r))+chalk.gray("░".repeat(t))} ${(100*n).toFixed(1)}%`}function a(o){return o>=30?chalk.red("🔥🔥🔥 "+o+" days"):o>=7?chalk.yellow("🔥 "+o+" days"):o>=1?chalk.gray("· "+o+" day"+(o>1?"s":"")):chalk.gray("—")}export function renderWelcome(o,l,c){const s=n(),g=l.cardsCompleted.length,y=o.totalCards,i=y-g,d=o.modules.find(o=>l.currentCard>=o.cardRange[0]&&l.currentCard<=o.cardRange[1]);if(console.log(),console.log(chalk.cyan(" ╭"+r("═"))),console.log(chalk.cyan(" ║")),console.log(chalk.cyan(" ║ ")+chalk.bold.white(" "+e("academy_title",s))),console.log(chalk.cyan(" ║")),c)console.log(chalk.cyan(" ║ ")+chalk.white(" "+e("welcome_new_demo",s)));else{const o=new Date(l.lastSeenAt),n=Math.floor((Date.now()-o.getTime())/36e5),r=n<1?e("just_now",s):n<24?`${n}${e("ago_hours",s)}`:`${Math.floor(n/24)}${e("ago_days",s)}`;console.log(chalk.cyan(" ║ ")+chalk.white(` ${e("welcome_back",s)} ${r}`))}console.log(chalk.cyan(" ║"));const u=d?`${d.number}. ${d.name}`:"—";console.log(chalk.cyan(" ║ ")+" "+chalk.gray(e("module",s).padEnd(11))+chalk.white(u)),console.log(chalk.cyan(" ║ ")+" "+chalk.gray(e("progress",s).padEnd(11))+t(g,y)+chalk.gray(` (${g}/${y})`)),console.log(chalk.cyan(" ║ ")+" "+chalk.gray(e("streak",s).padEnd(11))+a(l.streakDays)),i>0&&l.currentCard<=y&&console.log(chalk.cyan(" ║ ")+" "+chalk.gray(e("next_card",s).padEnd(11))+chalk.white(`#${l.currentCard} ${e("of",s)} ${y}`)),console.log(chalk.cyan(" ║")),console.log(chalk.cyan(" ╰"+r("═"))),console.log(),console.log(chalk.gray(" ─────────────────────────────────────────────"));const m=0===g?e("continue_start",s):`${e("continue_resume",s)} ${l.currentCard}`;console.log(chalk.bold.green(" continue")+chalk.gray(" "+m)),console.log(chalk.yellow(" status")+chalk.gray(" "+e("status_full",s))),l.bookmarks.length>0&&console.log(chalk.yellow(" bookmarks")+chalk.gray(` ${l.bookmarks.length} ${e("bookmarks_desc",s)}`)),console.log(chalk.gray(" quit")+chalk.gray(" "+e("quit_desc",s))),console.log(chalk.gray(" ─────────────────────────────────────────────")),console.log()}function c(o,l){const r=n(),t=o.module,a=l.modules.find(o=>o.number===t),c=a?a.name:e("unknown_module",r),s=e("module",r).replace(":","").trim(),g=`${e("card",r)} ${o.number} / ${l.totalCards} · ${s} ${t} · ${c}`;console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(g)+" "+chalk.cyan("─".repeat(Math.max(0,64-g.length-4))))}function s(){console.log(chalk.cyan(" ╰"+r())),console.log()}function g(o){console.log(chalk.cyan(" │ ")+chalk.white(o))}function y(){console.log(chalk.cyan(" │"))}function i(o,e){const l=[];for(const n of o.split("\n")){if(""===n){l.push("");continue}let o="";for(const r of n.split(" "))(o+" "+r).trim().length>e?(l.push(o.trim()),o=r):o=(o+" "+r).trim();o&&l.push(o)}return l}export function renderKnowledgeCard(l,r){const t=n(),a=o(l,t);c(a,r),y(),g(chalk.bold.yellow(a.title)),g(chalk.gray("─".repeat(Math.min(a.title.length,64)))),y();for(const o of a.body){for(const e of i(o,60))""===e?y():g(" "+e);y()}if(a.icoaConnection){g(chalk.magenta(" "+e("icoa_connection",t)+" 📌")),g(chalk.gray(" "+"─".repeat(20)));for(const o of i(a.icoaConnection,60))g(" "+chalk.magenta(o));y()}s(),console.log(chalk.gray(" ")+chalk.bold.green("ok")+chalk.gray(" / ")+chalk.bold.green("next")+chalk.gray(" "+e("continue_to_next",t))),console.log(chalk.gray(" bookmark "+e("bookmark_desc",t))),console.log(chalk.gray(" back "+e("back_desc",t))),console.log(chalk.gray(" quit "+e("quit_desc",t))),console.log()}export function renderMCQCard(l,r){const t=n(),a=o(l,t);c(a,r),y(),g(chalk.bold.yellow("🎯 "+a.title)),g(chalk.gray("─".repeat(Math.min(a.title.length+4,64)))),y();for(const o of i(a.question,60))g(" "+o);y();for(const o of["A","B","C","D"])g(chalk.cyan(` ${o}.`)+" "+chalk.white(a.options[o]));y(),s(),console.log(chalk.gray(" "+(t.startsWith("zh")?"输入 ":"Type "))+chalk.bold.green("A")+chalk.gray(" / ")+chalk.bold.green("B")+chalk.gray(" / ")+chalk.bold.green("C")+chalk.gray(" / ")+chalk.bold.green("D")+chalk.gray(" "+e("type_to_answer",t))),console.log()}export function renderMCQFeedback(l,r,t,a){const c=n(),s=o(l,c);console.log(),t?console.log(" "+chalk.bold.green(e("correct",c)+" ")+chalk.gray(`${e("one_point",c)} · ${r} = ${s.options[r]}`)):console.log(" "+chalk.bold.red(e("not_quite",c)+" ")+chalk.gray(`${e("you_chose",c)} ${r}; ${e("answer_is",c)} ${s.answer}.`)),console.log(),console.log(chalk.gray(" "+e("explanation",c)));for(const o of i(s.explanation,60))console.log(chalk.gray(" "+o));const g=Object.values(a.mcqResults),y=g.filter(o=>o.correct).length;console.log(),console.log(chalk.gray(" "+e("mcq_accuracy_so_far",c)+" ")+chalk.white(`${y}/${g.length}`)),console.log(),console.log(chalk.gray(" "+e("press_ok_continue",c)+" ")+chalk.bold.green("ok")+chalk.gray(" "+e("to_continue",c))),console.log()}export function renderPracticalCard(l,r){const t=n(),a=o(l,t);c(a,r),y(),g(chalk.bold.yellow("🛠 "+a.title)),g(chalk.gray("─".repeat(Math.min(a.title.length+4,64)))),y();for(const o of i(a.task,60))g(" "+o);if(a.starterCode){y(),g(chalk.gray(" "+e("starter_code",t))),y();for(const o of a.starterCode.split("\n"))g(" "+chalk.cyan(o))}y(),s(),console.log(chalk.gray(" "+e("try_in_sandbox",t)+" ")+chalk.bold.cyan("!python3")+chalk.gray(" "+e("drops_into_python",t))),console.log(chalk.gray(" "+e("when_done",t))),console.log(chalk.gray(" ")+chalk.bold.green("done")+chalk.gray(" "+e("done_desc",t))),console.log(chalk.gray(" ")+chalk.bold.yellow("skip")+chalk.gray(" "+e("skip_desc",t))),console.log()}export function renderPracticalSuccess(l){const r=n(),t=o(l,r);console.log(),console.log(" "+chalk.bold.green(e("practical_recorded",r))),console.log(),console.log(chalk.gray(" "+e("reference_answer",r)));for(const o of i(t.successHint,60))console.log(chalk.gray(" "+o));console.log(),console.log(chalk.gray(" "+e("press_ok_continue",r)+" ")+chalk.bold.green("ok")+chalk.gray(" "+e("to_continue",r))),console.log()}export function renderSimDemoCard(l,r){const t=n(),a=o(l,t);c(a,r),y(),g(chalk.bold.yellow("🎬 "+a.title)),y();for(const o of i(a.description,60))g(" "+o);y(),g(chalk.gray(" ┌────────────────────────────────────────────")),g(chalk.gray(" │ ")+chalk.cyan("sim")+chalk.gray(" "+e("sim_launch_desc",t))),g(chalk.gray(" │ "+e("sim_play_action",t)+" ")+chalk.white(`"${a.simAction}"`)),g(chalk.gray(" │ ")+chalk.cyan("ok")+chalk.gray(" "+e("sim_skip_desc",t))),g(chalk.gray(" └────────────────────────────────────────────")),g(chalk.gray(" "+e("sim_requires",t))),y(),s()}export function renderMilestone(l,t){const a=n(),c=o(l,a);console.log(),console.log(chalk.bold.yellow(" ╭"+r("═"))),console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+chalk.white(" "+e("milestone_header",a))),console.log(chalk.bold.yellow(" ║"));const s=` ${c.badge} ${c.emoji}`;console.log(chalk.bold.yellow(" ║ ")+chalk.bold.green(s)),console.log(chalk.bold.yellow(" ║ ")+chalk.gray(" ─".repeat(Math.max(1,Math.floor(c.badge.length/2+2))))),console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+" "+chalk.gray(e("in_wild_corresponds",a)));for(const o of i(c.realWorldLevel,60))console.log(chalk.bold.yellow(" ║ ")+" "+chalk.white(o));console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+" "+chalk.gray(e("whats_next",a)));for(const o of i(c.unlockedNext,60))console.log(chalk.bold.yellow(" ║ ")+" "+chalk.white(o));console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ╰"+r("═"))),console.log(),console.log(chalk.gray(" "+e("demo_complete",a))),console.log(),console.log(chalk.gray(" "+e("unlock_full",a)+" ")+chalk.white(e("curriculum_name",a))+chalk.gray(",")),console.log(chalk.gray(" "+e("contact_team_leader",a)+" ")+chalk.bold.yellow("EA")+chalk.gray(" "+e("learn_token",a))),console.log(chalk.gray(" "+e("or_email",a)+" ")+chalk.cyan("asra@icoa2026.au")+chalk.gray(" "+e("for_partnership",a))),console.log(),console.log(chalk.gray(" "+e("type_quit",a)+" ")+chalk.bold.green("quit")+chalk.gray(" "+e("to_exit",a)+" ")+chalk.bold.green("status")+chalk.gray(" "+e("for_dashboard",a))),console.log()}export function renderStatus(o,l){const r=n(),c=l.cardsCompleted.length,i=o.totalCards,d=Object.values(l.mcqResults),u=d.filter(o=>o.correct).length;console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(e("status_title",r))+" "+chalk.cyan("─".repeat(25))),y(),g(" "+chalk.gray(e("total_progress",r)+" ")+t(c,i)+chalk.gray(` (${c}/${i})`)),g(" "+chalk.gray(e("streak",r)+" ")+a(l.streakDays)+chalk.gray(` (${e("longest",r)} ${l.longestStreak})`)),g(" "+chalk.gray(e("mcq_accuracy",r)+" ")+chalk.white(`${u}/${d.length}`)),g(" "+chalk.gray(e("practicals_done",r)+" ")+chalk.white(`${l.practicalsCompleted.length}`)),g(" "+chalk.gray(e("bookmarked",r)+" ")+chalk.white(`${l.bookmarks.length}`)),y();const m=e("module",r).replace(":","").trim();for(const e of o.modules){const[o,n]=e.cardRange,r=l.cardsCompleted.filter(e=>e>=o&&e<=n).length,t=n-o+1;g(" "+(r===t?chalk.green("✓"):r>0?chalk.yellow("▶"):chalk.gray("□"))+" "+chalk.gray(`${m} ${e.number}: `)+chalk.white(`${r}/${t}`)+chalk.gray(" "+e.name))}if(y(),l.achievements.length>0){g(" "+chalk.gray(e("achievements",r)));for(const o of l.achievements)g(" "+chalk.bold.yellow("★ ")+chalk.white(o))}else g(" "+chalk.gray(e("achievements_none",r)));y(),s()}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "icoa-cli",
|
|
3
|
-
"version": "2.19.
|
|
3
|
+
"version": "2.19.161",
|
|
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": {
|