icoa-cli 2.19.222 → 2.19.223
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/lib/hint-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a0b(a,b){a=a-(
|
|
1
|
+
function a0b(a,b){a=a-(0x31*-0x7a+0x117b+0x74e);const c=a0a();let d=c[a];if(a0b['rYoRiu']===undefined){var e=function(i){const j='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let l='',m='';for(let n=0x1933*0x1+0x60*-0x6+-0x16f3,o,p,q=-0x840+0x1*0x1b6b+-0x132b;p=i['charAt'](q++);~p&&(o=n%(0x1de4+0x1663+-0x3443)?o*(0x1f*0x6d+0x850+-0x1*0x1543)+p:p,n++%(-0x1e65*0x1+-0x1*0xdb2+0x64d*0x7))?l+=String['fromCharCode'](-0x23b*-0x11+0xbac+-0x613*0x8&o>>(-(-0xc7*0xf+-0xf*-0x191+-0x1*0xbd4)*n&0xe0b+-0xaa*0xe+-0x4b9)):0x1*-0x26ad+-0x11*-0xa1+-0xc7*-0x24){p=j['indexOf'](p);}for(let r=-0x833*0x4+-0x13*-0xfe+0xff*0xe,s=l['length'];r<s;r++){m+='%'+('00'+l['charCodeAt'](r)['toString'](-0x212+-0x211*-0x11+-0x20ff))['slice'](-(0x5d*0x53+0x6*-0x359+-0x1*0xa0f));}return decodeURIComponent(m);};a0b['mjjTlZ']=e,a0b['TccFUu']={},a0b['rYoRiu']=!![];}const f=c[0x128*-0x16+0x168e+-0x1*-0x2e2],g=a+f,h=a0b['TccFUu'][g];return!h?(d=a0b['mjjTlZ'](d),a0b['TccFUu'][g]=d):d=h,d;}(function(a,b){const v=a0b,c=a();while(!![]){try{const d=parseInt(v(0x17d))/(-0x24d8*-0x1+-0x20db+-0x3fc)*(-parseInt(v(0x173))/(-0x1c2b+0x1b9a+-0x1*-0x93))+parseInt(v(0x176))/(-0x80+-0x1b2e+0x3*0x93b)+-parseInt(v(0x172))/(0x1075*-0x1+0x1e09+-0xf8*0xe)+-parseInt(v(0x175))/(0x1*0xb30+-0x1e11+0x12e6)*(-parseInt(v(0x17b))/(0x1486+-0x29*-0xd8+0x2b*-0x148))+parseInt(v(0x186))/(-0x7f9+0x5e*-0x2e+0x18e4)+parseInt(v(0x17e))/(-0xd*0x241+0x1a1c+0x339)*(parseInt(v(0x17f))/(0x4*-0x7ae+0x1*-0xead+0x16b7*0x2))+-parseInt(v(0x185))/(0x112e+-0xf*-0x9f+-0x1a75);if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a0a,-0x27229+-0x8ebaf+0x1a448f));function a0a(){const x=['mtq2nZe5ndbsCMfZrhC','nZm5ntuYmu5nsxHQua','BwvZC2fNzq','zxHHBuLK','Ahr0Chm6lY9WCMfJDgLJzs5Py29HmJaYnI5HDq','l2HPBNq','y2f0y2G','ndC1oda4zu1pBfH0','mZq2mJq1ngnAz3vHsa','C3rHDhvZ','mZyYnZm1uLv5whPk','mZGWnZm1mvrewhniBq','zgf0yq','y3rMzfvYBa','C3vJy2vZCW','Dg9Rzw4','nML1vw1cuq','B2jQzwn0','muPUvxHkDa','mtuXnJyXodrAuMnfEwW','oxzqsfveCq','BgfUz3vHz2u','DgLTzw91Da','l2fWAs9Py29Hl2v4yw1ZlW','AgLUDcbbueKGDw5YzwfJAgfIBgu','C3rYAw5NAwz5'];a0a=function(){return x;};return a0a();}import{getConfig as a0c}from'./config.js';export async function requestHint(d){const w=a0b,f=a0c(),g=f[w(0x178)]||w(0x16f),h=d['lang']||f[w(0x180)]||'en',j=d['timeoutMs']??0x1a15*0x1+0x27b7+-0x228c,k=[g+w(0x182)+d[w(0x188)]+'/hint',g+':9090/api/icoa/exams/'+d[w(0x188)]+w(0x170)];let l=null;for(const p of k)try{const q=await fetch(p,{'method':'POST','headers':{'Content-Type':'application/json','User-Agent':'icoa-cli'},'body':JSON[w(0x184)]({'token':d[w(0x17a)],'question':d['question'],'level':d['level'],'lang':h}),'signal':AbortSignal[w(0x181)](j)}),r=await q['json']()[w(0x171)](()=>({}));if(!q['ok']||!(0x1*0x1b6b+-0x20d9+0x6b*0xd)===r[w(0x179)]){if(l={'status':q[w(0x174)],'message':r?.[w(0x187)]||'hint\x20request\x20failed\x20('+q['status']+')'},q['status']>=-0x1a01+0x1*-0xca6+0x47*0x91&&q[w(0x174)]<-0x1852+0x8cd+0x1179)throw l;continue;}return r[w(0x177)];}catch(u){if(u&&w(0x17c)==typeof u&&w(0x174)in u)throw u;l={'status':0x0,'message':u?.['message']||'network\x20error'};}const m={};m[w(0x174)]=0x0,m[w(0x187)]=w(0x183);throw l||m;}
|
package/dist/lib/learn-render.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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 c(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,a){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(" ║")),a)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))+c(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 h=0===g?e("continue_start",s):`${e("continue_resume",s)} ${l.currentCard}`;console.log(chalk.bold.green(" continue")+chalk.gray(" "+h)),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 a(o,l){const r=n(),t=o.module,c=l.modules.find(o=>o.number===t),a=c?c.name:e("unknown_module",r),s=e("module",r).replace(":","").trim(),g=`${e("card",r)} ${o.number} / ${l.totalCards} · ${s} ${t} · ${a}`;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(),c=o(l,t);a(c,r),y(),g(chalk.bold.yellow(c.title)),g(chalk.gray("─".repeat(Math.min(c.title.length,64)))),y();for(const o of c.body){for(const e of i(o,60))""===e?y():g(" "+e);y()}if(c.icoaConnection){g(chalk.magenta(" "+e("icoa_connection",t)+" 📌")),g(chalk.gray(" "+"─".repeat(20)));for(const o of i(c.icoaConnection,60))g(" "+chalk.magenta(o));y()}if(l.check){const o=t.startsWith("zh"),e=o?l._zh?.checkStatement??l.check.statement:l.check.statement;g(chalk.cyan(" 🤔 "+(o?"快速理解检查 (输 y 或 n):":"Quick comprehension check (type y or n):"))),g(chalk.gray(" "+"─".repeat(20)));for(const o of i(e,60))g(" "+chalk.white(o));y()}s(),l.check?console.log(chalk.gray(" ")+chalk.bold.green("y")+chalk.gray(" / ")+chalk.bold.green("n")+chalk.gray(" "+(t.startsWith("zh")?"回答上面问题":"answer the check above"))):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 renderCheckFeedback(o,l,r){const t=n(),c=t.startsWith("zh");if(console.log(),r)console.log(chalk.green(" ✓ ")+chalk.white(c?"答对了。":"Correct."));else{const e="y"===o.check?.answer?c?"是":"Yes":c?"否":"No";console.log(chalk.yellow(" ✗ ")+chalk.white((c?"正确答案是 ":"Actually ")+e+". "+(c?"回去再看一遍上面那段。":"Re-read the paragraph above.")))}console.log(),console.log(chalk.gray(" ")+chalk.bold.green("ok")+chalk.gray(" / ")+chalk.bold.green("next")+chalk.gray(" "+e("continue_to_next",t))),console.log()}export function renderMCQCard(l,r){const t=n(),c=o(l,t);a(c,r),y(),g(chalk.bold.yellow("🎯 "+c.title)),g(chalk.gray("─".repeat(Math.min(c.title.length+4,64)))),y();for(const o of i(c.question,60))g(" "+o);y();for(const o of["A","B","C","D"])g(chalk.cyan(` ${o}.`)+" "+chalk.white(c.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,c){const a=n(),s=o(l,a);console.log(),t?console.log(" "+chalk.bold.green(e("correct",a)+" ")+chalk.gray(`${e("one_point",a)} · ${r} = ${s.options[r]}`)):console.log(" "+chalk.bold.red(e("not_quite",a)+" ")+chalk.gray(`${e("you_chose",a)} ${r}; ${e("answer_is",a)} ${s.answer}.`)),console.log(),console.log(chalk.gray(" "+e("explanation",a)));for(const o of i(s.explanation,60))console.log(chalk.gray(" "+o));const g=Object.values(c.mcqResults),y=g.filter(o=>o.correct).length;console.log(),console.log(chalk.gray(" "+e("mcq_accuracy_so_far",a)+" ")+chalk.white(`${y}/${g.length}`)),console.log(),console.log(chalk.gray(" "+e("press_ok_continue",a)+" ")+chalk.bold.green("ok")+chalk.gray(" "+e("to_continue",a))),console.log()}export function renderPracticalCard(l,r){const t=n(),c=o(l,t);a(c,r),y(),g(chalk.bold.yellow("🛠 "+c.title)),g(chalk.gray("─".repeat(Math.min(c.title.length+4,64)))),y();for(const o of i(c.task,60))g(" "+o);if(c.starterCode){y(),g(chalk.gray(" "+e("starter_code",t))),y();for(const o of c.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(),c=o(l,t);a(c,r),y(),g(chalk.bold.yellow("🎬 "+c.title)),y();for(const o of i(c.description,60))g(" "+o);y(),g(chalk.gray(" "+e("sim_requires",t))),y(),s(),console.log(chalk.gray(" ")+chalk.bold.cyan("sim")+chalk.gray(" "+e("sim_launch_desc",t))),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 renderMilestone(l,t){const c=n(),a=o(l,c),s=l.number===t.totalCards;console.log(),console.log(chalk.bold.yellow(" ╭"+r("═"))),console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+chalk.white(" "+e("milestone_header",c))),console.log(chalk.bold.yellow(" ║"));const g=` ${a.badge} ${a.emoji}`;console.log(chalk.bold.yellow(" ║ ")+chalk.bold.green(g)),console.log(chalk.bold.yellow(" ║ ")+chalk.gray(" ─".repeat(Math.max(1,Math.floor(a.badge.length/2+2))))),console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+" "+chalk.gray(e("in_wild_corresponds",c)));for(const o of i(a.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",c)));for(const o of i(a.unlockedNext,60))console.log(chalk.bold.yellow(" ║ ")+" "+chalk.white(o));console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ╰"+r("═"))),console.log(),s?(console.log(chalk.gray(" "+e("demo_complete",c))),console.log(),console.log(chalk.gray(" "+e("unlock_full",c)+" ")+chalk.white(e("curriculum_name",c))+chalk.gray(",")),console.log(chalk.gray(" "+e("contact_team_leader",c)+" ")+chalk.bold.yellow("EA")+chalk.gray(" "+e("learn_token",c))),console.log(chalk.gray(" "+e("or_email",c)+" ")+chalk.cyan("asra@icoa2026.au")+chalk.gray(" "+e("for_partnership",c))),console.log(),console.log(chalk.gray(" "+e("type_quit",c)+" ")+chalk.bold.green("quit")+chalk.gray(" "+e("to_exit",c)+" ")+chalk.bold.green("status")+chalk.gray(" "+e("for_dashboard",c)))):(console.log(chalk.gray(" ")+chalk.bold.green("ok")+chalk.gray(" / ")+chalk.bold.green("next")+chalk.gray(" "+e("continue_to_next",c))),console.log(chalk.gray(" status "+e("status_full",c))),console.log(chalk.gray(" quit "+e("quit_desc",c)))),console.log()}export function renderStatus(o,l){const r=n(),a=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(a,i)+chalk.gray(` (${a}/${i})`)),g(" "+chalk.gray(e("streak",r)+" ")+c(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 h=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(`${h} ${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()}
|
|
1
|
+
import chalk from"chalk";import{localized as o}from"./learn-curricula.js";import{t as e}from"./learn-i18n.js";import{getConfig as n}from"./config.js";function l(){return(n().language||"en").toLowerCase()}function t(o="─"){return o.repeat(66)}function r(o,e,n=20){const l=e>0?o/e:0,t=Math.floor(l*n),r=n-t;return`${chalk.green("█".repeat(t))+chalk.gray("░".repeat(r))} ${(100*l).toFixed(1)}%`}function c(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,n,a){const s=l(),g=n.cardsCompleted.length,y=o.totalCards,i=y-g,d=o.modules.find(o=>n.currentCard>=o.cardRange[0]&&n.currentCard<=o.cardRange[1]);if(console.log(),console.log(chalk.cyan(" ╭"+t("═"))),console.log(chalk.cyan(" ║")),console.log(chalk.cyan(" ║ ")+chalk.bold.white(" "+e("academy_title",s))),console.log(chalk.cyan(" ║")),a)console.log(chalk.cyan(" ║ ")+chalk.white(" "+e("welcome_new_demo",s)));else{const o=new Date(n.lastSeenAt),l=Math.floor((Date.now()-o.getTime())/36e5),t=l<1?e("just_now",s):l<24?`${l}${e("ago_hours",s)}`:`${Math.floor(l/24)}${e("ago_days",s)}`;console.log(chalk.cyan(" ║ ")+chalk.white(` ${e("welcome_back",s)} ${t}`))}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))+r(g,y)+chalk.gray(` (${g}/${y})`)),console.log(chalk.cyan(" ║ ")+" "+chalk.gray(e("streak",s).padEnd(11))+c(n.streakDays)),i>0&&n.currentCard<=y&&console.log(chalk.cyan(" ║ ")+" "+chalk.gray(e("next_card",s).padEnd(11))+chalk.white(`#${n.currentCard} ${e("of",s)} ${y}`)),console.log(chalk.cyan(" ║")),console.log(chalk.cyan(" ╰"+t("═"))),console.log(),console.log(chalk.gray(" ─────────────────────────────────────────────"));const h=0===g?e("continue_start",s):`${e("continue_resume",s)} ${n.currentCard}`;console.log(chalk.bold.green(" continue")+chalk.gray(" "+h)),console.log(chalk.yellow(" status")+chalk.gray(" "+e("status_full",s))),n.bookmarks.length>0&&console.log(chalk.yellow(" bookmarks")+chalk.gray(` ${n.bookmarks.length} ${e("bookmarks_desc",s)}`)),console.log(chalk.gray(" quit")+chalk.gray(" "+e("quit_desc",s))),console.log(chalk.gray(" ─────────────────────────────────────────────")),console.log()}function a(o,n){const t=l(),r=o.module,c=n.modules.find(o=>o.number===r),a=c?c.name:e("unknown_module",t),s=e("module",t).replace(":","").trim(),g=`${e("card",t)} ${o.number} / ${n.totalCards} · ${s} ${r} · ${a}`;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(" ╰"+t())),console.log()}function g(o){console.log(chalk.cyan(" │ ")+chalk.white(o))}function y(){console.log(chalk.cyan(" │"))}const i=/[┌┐└┘├┤┬┴┼─│╔╗╚╝═║╠╣╦╩╬▓▒░█]/;function d(o){return/^(?: {4}|\t)/.test(o)||i.test(o)||/ {3,}/.test(o)}function u(o,e){const n=[];for(const l of o.split("\n")){if(""===l){n.push("");continue}if(d(l)){n.push(l);continue}let o="";for(const t of l.split(" "))(o+" "+t).trim().length>e?(n.push(o.trim()),o=t):o=(o+" "+t).trim();o&&n.push(o)}return n}export function renderKnowledgeCard(n,t){const r=l(),c=o(n,r);a(c,t),y(),g(chalk.bold.yellow(c.title)),g(chalk.gray("─".repeat(Math.min(c.title.length,64)))),y();for(const o of c.body){for(const e of u(o,60))""===e?y():g(" "+e);y()}if(c.icoaConnection){g(chalk.magenta(" "+e("icoa_connection",r)+" 📌")),g(chalk.gray(" "+"─".repeat(20)));for(const o of u(c.icoaConnection,60))g(" "+chalk.magenta(o));y()}if(n.check){const o=r.startsWith("zh"),e=o?n._zh?.checkStatement??n.check.statement:n.check.statement;g(chalk.cyan(" 🤔 "+(o?"快速理解检查 (输 y 或 n):":"Quick comprehension check (type y or n):"))),g(chalk.gray(" "+"─".repeat(20)));for(const o of u(e,60))g(" "+chalk.white(o));y()}s(),n.check?console.log(chalk.gray(" ")+chalk.bold.green("y")+chalk.gray(" / ")+chalk.bold.green("n")+chalk.gray(" "+(r.startsWith("zh")?"回答上面问题":"answer the check above"))):console.log(chalk.gray(" ")+chalk.bold.green("ok")+chalk.gray(" / ")+chalk.bold.green("next")+chalk.gray(" "+e("continue_to_next",r))),console.log(chalk.gray(" bookmark "+e("bookmark_desc",r))),console.log(chalk.gray(" back "+e("back_desc",r))),console.log(chalk.gray(" quit "+e("quit_desc",r))),console.log()}export function renderCheckFeedback(o,n,t){const r=l(),c=r.startsWith("zh");if(console.log(),t)console.log(chalk.green(" ✓ ")+chalk.white(c?"答对了。":"Correct."));else{const e="y"===o.check?.answer?c?"是":"Yes":c?"否":"No";console.log(chalk.yellow(" ✗ ")+chalk.white((c?"正确答案是 ":"Actually ")+e+". "+(c?"回去再看一遍上面那段。":"Re-read the paragraph above.")))}console.log(),console.log(chalk.gray(" ")+chalk.bold.green("ok")+chalk.gray(" / ")+chalk.bold.green("next")+chalk.gray(" "+e("continue_to_next",r))),console.log()}export function renderMCQCard(n,t){const r=l(),c=o(n,r);a(c,t),y(),g(chalk.bold.yellow("🎯 "+c.title)),g(chalk.gray("─".repeat(Math.min(c.title.length+4,64)))),y();for(const o of u(c.question,60))g(" "+o);y();for(const o of["A","B","C","D"])g(chalk.cyan(` ${o}.`)+" "+chalk.white(c.options[o]));y(),s(),console.log(chalk.gray(" "+(r.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",r))),console.log()}export function renderMCQFeedback(n,t,r,c){const a=l(),s=o(n,a);console.log(),r?console.log(" "+chalk.bold.green(e("correct",a)+" ")+chalk.gray(`${e("one_point",a)} · ${t} = ${s.options[t]}`)):console.log(" "+chalk.bold.red(e("not_quite",a)+" ")+chalk.gray(`${e("you_chose",a)} ${t}; ${e("answer_is",a)} ${s.answer}.`)),console.log(),console.log(chalk.gray(" "+e("explanation",a)));for(const o of u(s.explanation,60))console.log(chalk.gray(" "+o));const g=Object.values(c.mcqResults),y=g.filter(o=>o.correct).length;console.log(),console.log(chalk.gray(" "+e("mcq_accuracy_so_far",a)+" ")+chalk.white(`${y}/${g.length}`)),console.log(),console.log(chalk.gray(" "+e("press_ok_continue",a)+" ")+chalk.bold.green("ok")+chalk.gray(" "+e("to_continue",a))),console.log()}export function renderPracticalCard(n,t){const r=l(),c=o(n,r);a(c,t),y(),g(chalk.bold.yellow("🛠 "+c.title)),g(chalk.gray("─".repeat(Math.min(c.title.length+4,64)))),y();for(const o of u(c.task,60))g(" "+o);if(c.starterCode){y(),g(chalk.gray(" "+e("starter_code",r))),y();for(const o of c.starterCode.split("\n"))g(" "+chalk.cyan(o))}y(),s(),console.log(chalk.gray(" "+e("try_in_sandbox",r)+" ")+chalk.bold.cyan("!python3")+chalk.gray(" "+e("drops_into_python",r))),console.log(chalk.gray(" "+e("when_done",r))),console.log(chalk.gray(" ")+chalk.bold.green("done")+chalk.gray(" "+e("done_desc",r))),console.log(chalk.gray(" ")+chalk.bold.yellow("skip")+chalk.gray(" "+e("skip_desc",r))),console.log()}export function renderPracticalSuccess(n){const t=l(),r=o(n,t);console.log(),console.log(" "+chalk.bold.green(e("practical_recorded",t))),console.log(),console.log(chalk.gray(" "+e("reference_answer",t)));for(const o of u(r.successHint,60))console.log(chalk.gray(" "+o));console.log(),console.log(chalk.gray(" "+e("press_ok_continue",t)+" ")+chalk.bold.green("ok")+chalk.gray(" "+e("to_continue",t))),console.log()}export function renderSimDemoCard(n,t){const r=l(),c=o(n,r);a(c,t),y(),g(chalk.bold.yellow("🎬 "+c.title)),y();for(const o of u(c.description,60))g(" "+o);y(),g(chalk.gray(" "+e("sim_requires",r))),y(),s(),console.log(chalk.gray(" ")+chalk.bold.cyan("sim")+chalk.gray(" "+e("sim_launch_desc",r))),console.log(chalk.gray(" ")+chalk.bold.green("ok")+chalk.gray(" / ")+chalk.bold.green("next")+chalk.gray(" "+e("continue_to_next",r))),console.log(chalk.gray(" bookmark "+e("bookmark_desc",r))),console.log(chalk.gray(" back "+e("back_desc",r))),console.log(chalk.gray(" quit "+e("quit_desc",r))),console.log()}export function renderMilestone(n,r){const c=l(),a=o(n,c),s=n.number===r.totalCards;console.log(),console.log(chalk.bold.yellow(" ╭"+t("═"))),console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+chalk.white(" "+e("milestone_header",c))),console.log(chalk.bold.yellow(" ║"));const g=` ${a.badge} ${a.emoji}`;console.log(chalk.bold.yellow(" ║ ")+chalk.bold.green(g)),console.log(chalk.bold.yellow(" ║ ")+chalk.gray(" ─".repeat(Math.max(1,Math.floor(a.badge.length/2+2))))),console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+" "+chalk.gray(e("in_wild_corresponds",c)));for(const o of u(a.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",c)));for(const o of u(a.unlockedNext,60))console.log(chalk.bold.yellow(" ║ ")+" "+chalk.white(o));console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ╰"+t("═"))),console.log(),s?(console.log(chalk.gray(" "+e("demo_complete",c))),console.log(),console.log(chalk.gray(" "+e("unlock_full",c)+" ")+chalk.white(e("curriculum_name",c))+chalk.gray(",")),console.log(chalk.gray(" "+e("contact_team_leader",c)+" ")+chalk.bold.yellow("EA")+chalk.gray(" "+e("learn_token",c))),console.log(chalk.gray(" "+e("or_email",c)+" ")+chalk.cyan("asra@icoa2026.au")+chalk.gray(" "+e("for_partnership",c))),console.log(),console.log(chalk.gray(" "+e("type_quit",c)+" ")+chalk.bold.green("quit")+chalk.gray(" "+e("to_exit",c)+" ")+chalk.bold.green("status")+chalk.gray(" "+e("for_dashboard",c)))):(console.log(chalk.gray(" ")+chalk.bold.green("ok")+chalk.gray(" / ")+chalk.bold.green("next")+chalk.gray(" "+e("continue_to_next",c))),console.log(chalk.gray(" status "+e("status_full",c))),console.log(chalk.gray(" quit "+e("quit_desc",c)))),console.log()}export function renderStatus(o,n){const t=l(),a=n.cardsCompleted.length,i=o.totalCards,d=Object.values(n.mcqResults),u=d.filter(o=>o.correct).length;console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(e("status_title",t))+" "+chalk.cyan("─".repeat(25))),y(),g(" "+chalk.gray(e("total_progress",t)+" ")+r(a,i)+chalk.gray(` (${a}/${i})`)),g(" "+chalk.gray(e("streak",t)+" ")+c(n.streakDays)+chalk.gray(` (${e("longest",t)} ${n.longestStreak})`)),g(" "+chalk.gray(e("mcq_accuracy",t)+" ")+chalk.white(`${u}/${d.length}`)),g(" "+chalk.gray(e("practicals_done",t)+" ")+chalk.white(`${n.practicalsCompleted.length}`)),g(" "+chalk.gray(e("bookmarked",t)+" ")+chalk.white(`${n.bookmarks.length}`)),y();const h=e("module",t).replace(":","").trim();for(const e of o.modules){const[o,l]=e.cardRange,t=n.cardsCompleted.filter(e=>e>=o&&e<=l).length,r=l-o+1;g(" "+(t===r?chalk.green("✓"):t>0?chalk.yellow("▶"):chalk.gray("□"))+" "+chalk.gray(`${h} ${e.number}: `)+chalk.white(`${t}/${r}`)+chalk.gray(" "+e.name))}if(y(),n.achievements.length>0){g(" "+chalk.gray(e("achievements",t)));for(const o of n.achievements)g(" "+chalk.bold.yellow("★ ")+chalk.white(o))}else g(" "+chalk.gray(e("achievements_none",t)));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.223",
|
|
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": {
|