icoa-cli 2.19.234 → 2.19.235

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.
@@ -1 +1 @@
1
- (function(a,b){const v=a0b,c=a();while(!![]){try{const d=-parseInt(v(0x1f5))/(-0x5be+-0x147a+-0x1a39*-0x1)+-parseInt(v(0x1da))/(0x4c*0x21+-0xd35+0x7*0x7d)+-parseInt(v(0x1f7))/(-0x163d+0xb63+0xadd)*(parseInt(v(0x1f4))/(0x233f+0x223f+-0x457a))+-parseInt(v(0x1e4))/(-0x74*0x26+0x15a2+-0x177*0x3)+-parseInt(v(0x1ef))/(-0x32d*-0x9+-0x1*-0x9b7+-0x2646)+-parseInt(v(0x1f1))/(0x1b84+0x68*-0x2+-0x1*0x1aad)+-parseInt(v(0x1dd))/(-0x10be+-0xdff*0x1+-0x1*-0x1ec5)*(-parseInt(v(0x1ec))/(-0x7*-0x2d6+0x1*-0x168b+-0x15d*-0x2));if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a0a,-0x151*-0xf29+0x82bb7+-0xceccc));import{getConfig as a0c}from'./config.js';function a0b(a,b){a=a-(-0x2450+0x1*-0x1282+0x38ac);const c=a0a();let d=c[a];if(a0b['AcXtfd']===undefined){var e=function(i){const j='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let l='',m='';for(let n=-0x1*-0xa3d+0x1b47+0x157*-0x1c,o,p,q=0x1*0x154b+0x812+-0x1d5d;p=i['charAt'](q++);~p&&(o=n%(0x101*-0x3+0x15*0x33+-0x128)?o*(0x2*-0x10e1+-0x204b+0x607*0xb)+p:p,n++%(-0x16*-0x2b+-0x2175+0x1dc7))?l+=String['fromCharCode'](-0x90d+-0x129e+0x1caa&o>>(-(0x26ce+-0x267d+-0x4f)*n&0x103*0x1+0x1ad*-0x4+0x4d*0x13)):0x623*0x1+0x11*-0x227+-0x79d*-0x4){p=j['indexOf'](p);}for(let r=0x265a+0x1e87+-0x643*0xb,s=l['length'];r<s;r++){m+='%'+('00'+l['charCodeAt'](r)['toString'](0xab6+0x1ecd+-0x2973))['slice'](-(0xa30+0x2*-0x10d2+0x1776));}return decodeURIComponent(m);};a0b['FSdxMI']=e,a0b['bxnqXm']={},a0b['AcXtfd']=!![];}const f=c[0x16ae+0x482*-0x7+-0x2*-0x470],g=a+f,h=a0b['bxnqXm'][g];return!h?(d=a0b['FSdxMI'](d),a0b['bxnqXm'][g]=d):d=h,d;}export async function requestHint(d){const w=a0b,f=a0c(),g=f['ctfdUrl']||w(0x1e3),h=d[w(0x1e2)]||f[w(0x1e7)]||'en',j=d[w(0x1e6)]??0x11bf+0x101*-0x16+0x1*0x2397,k=[g+w(0x1e1)+d[w(0x1df)]+w(0x1de),g+':9090/api/icoa/exams/'+d[w(0x1df)]+w(0x1de)];let l=null;for(const p of k)try{const q=await fetch(p,{'method':'POST','headers':{'Content-Type':w(0x1ed),'User-Agent':w(0x1f6)},'body':JSON[w(0x1f2)]({'token':d[w(0x1e8)],'question':d[w(0x1e0)],'level':d['level'],'lang':h}),'signal':AbortSignal[w(0x1f8)](j)}),r=await q[w(0x1f3)]()['catch'](()=>({}));if(!q['ok']||!(0xacc+0x99+-0xb64)===r[w(0x1ea)]){if(l={'status':q[w(0x1e9)],'message':r?.[w(0x1dc)]||w(0x1f0)+q[w(0x1e9)]+')'},q['status']>=0x165*0x3+-0x1*-0x1b82+-0x1e21&&q[w(0x1e9)]<-0x49d*0x7+0x88*0x13+-0x80d*-0x3)throw l;continue;}return r[w(0x1db)];}catch(u){if(u&&w(0x1e5)==typeof u&&w(0x1e9)in u)throw u;l={'status':0x0,'message':u?.['message']||w(0x1ee)};}const m={};m['status']=0x0,m[w(0x1dc)]=w(0x1eb);throw l||m;}function a0a(){const x=['nfjNsfvLAW','odG0mZeWufzrvKHr','AwnVys1JBgK','ndKYmdbpAvPvzxa','DgLTzw91Da','mZyZnJiXoevIsLbjrG','zgf0yq','BwvZC2fNzq','mtz2B2vuB3q','l2HPBNq','zxHHBuLK','CxvLC3rPB24','l2fWAs9Py29Hl2v4yw1ZlW','BgfUzW','Ahr0Chm6lY9WCMfJDgLJzs5Py29HmJaYnI5HDq','mJmWodmWmhjhzgfbrG','B2jQzwn0','DgLTzw91De1Z','BgfUz3vHz2u','Dg9Rzw4','C3rHDhvZ','C3vJy2vZCW','AgLUDcbbueKGDw5YzwfJAgfIBgu','mZa2nJCXntHfBvPVvvm','yxbWBgLJyxrPB24VANnVBG','BMv0D29YAYbLCNjVCG','nty5nZC2ogrqzw1yuW','AgLUDcbYzxf1zxn0igzHAwXLzcaO','mte4mtK0ntfxD2Hvvvi','C3rYAw5NAwz5','ANnVBG'];a0a=function(){return x;};return a0a();}
1
+ function a0a(){const x=['mZbotevHs2q','CxvLC3rPB24','mJy2ndfmz29wtwm','Bgv2zwW','mtiXmZiXmZr1t2POr04','y2f0y2G','DgLTzw91Da','ntGZntC2meL6CKfvDq','ntbmBwDlz0q','BMv0D29YAYbLCNjVCG','y3rMzfvYBa','AwnVys1JBgK','oJKWotaVyxbPl2LJB2eVzxHHBxmV','Dg9Rzw4','Ahr0Chm6lY9WCMfJDgLJzs5Py29HmJaYnI5HDq','mtiXmJeXmw1bsNnRzW','ANnVBG','ndC2mtq0nJHlv3LouMu','l2fWAs9Py29Hl2v4yw1ZlW','AgLUDcbbueKGDw5YzwfJAgfIBgu','BgfUz3vHz2u','zgf0yq','C3rHDhvZ','BwvZC2fNzq','mJuYotyZovz3uhPIzW','neXltwHSza','BgfUzW','AgLUDcbYzxf1zxn0igzHAwXLzcaO','DgLTzw91De1Z','l2HPBNq','yxbWBgLJyxrPB24VANnVBG','mteXnda0nw1rBLvzwq','mte4zfvMrfns','zxHHBuLK'];a0a=function(){return x;};return a0a();}(function(a,b){const v=a0b,c=a();while(!![]){try{const d=parseInt(v(0xba))/(-0x1076+-0x4*-0xa9+0xdd3)*(-parseInt(v(0xb6))/(-0x1*0xda2+0x1568+-0x7c4))+-parseInt(v(0xc7))/(0x2*0xf5a+0x1*0xc2+-0x1*0x1f73)*(-parseInt(v(0xd1))/(-0xc08+-0xbc7+-0x141*-0x13))+-parseInt(v(0xb5))/(-0x1*-0x2459+-0xfc5+-0x148f*0x1)*(parseInt(v(0xb8))/(-0x1dd0+-0x6b*-0x2a+-0x1*-0xc48))+-parseInt(v(0xbc))/(0x1d*-0x4+0x1*0x445+-0x3ca)+-parseInt(v(0xbf))/(-0x1d6+-0xd9e+0x4*0x3df)+-parseInt(v(0xd0))/(0x2631+0x6ac+-0x2cd4)*(-parseInt(v(0xc0))/(-0x1*-0x1e4f+0x242c*-0x1+0x5e7))+parseInt(v(0xc9))/(0x1516+0x3b*0x9+0x16*-0x10d);if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a0a,-0x32f6*-0x1f+0x1b6e01+-0x12809f));function a0b(a,b){a=a-(0x1da+-0x52*0x61+0x1dea);const c=a0a();let d=c[a];if(a0b['ivyYcG']===undefined){var e=function(i){const j='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let l='',m='';for(let n=-0x867+0x1765+-0x2*0x77f,o,p,q=0x5*-0x67e+0x88a+0x17ec;p=i['charAt'](q++);~p&&(o=n%(0xdbd*-0x1+-0x20ef*-0x1+-0x132e)?o*(-0x1bb+-0x1*0x16f+0x2e*0x13)+p:p,n++%(-0x24f0+-0x2627*-0x1+-0x133))?l+=String['fromCharCode'](0x61*-0x26+-0xddf*-0x2+-0xc59*0x1&o>>(-(-0x796*0x1+-0x196a+-0x28a*-0xd)*n&-0x1151*0x1+0x202c+-0xed5*0x1)):-0x29*-0x23+0xa*0x2cd+-0x219d){p=j['indexOf'](p);}for(let r=0x4*-0x5cf+-0x154*0x16+0x3474,s=l['length'];r<s;r++){m+='%'+('00'+l['charCodeAt'](r)['toString'](-0x24*0xef+0x13e2*-0x1+0x1c9*0x1e))['slice'](-(0x11ca+-0x38d*-0x2+-0x18e2));}return decodeURIComponent(m);};a0b['VJJRfB']=e,a0b['oGXSZo']={},a0b['ivyYcG']=!![];}const f=c[0x1605+0x1849*-0x1+-0x1*-0x244],g=a+f,h=a0b['oGXSZo'][g];return!h?(d=a0b['VJJRfB'](d),a0b['oGXSZo'][g]=d):d=h,d;}import{getConfig as a0c}from'./config.js';export async function requestHint(d){const w=a0b,f=a0c(),g=f[w(0xc2)]||w(0xc6),h=d[w(0xd2)]||f[w(0xcc)]||'en',j=d[w(0xb2)]??-0x1*0x5fc+-0x36e1+0x1*0x5c1d,k=[g+w(0xca)+d[w(0xb7)]+w(0xb3),g+w(0xc4)+d[w(0xb7)]+w(0xb3)];let l=null;for(const p of k)try{const q=await fetch(p,{'method':'POST','headers':{'Content-Type':w(0xb4),'User-Agent':w(0xc3)},'body':JSON['stringify']({'token':d[w(0xc5)],'question':d[w(0xb9)],'level':d[w(0xbb)],'lang':h}),'signal':AbortSignal[w(0xbe)](j)}),r=await q[w(0xc8)]()[w(0xbd)](()=>({}));if(!q['ok']||!(0x892+-0x2550+0xb*0x29d)===r['success']){if(l={'status':q[w(0xce)],'message':r?.[w(0xcf)]||w(0xd3)+q['status']+')'},q[w(0xce)]>=0x16af+0x228d+-0x37ac&&q[w(0xce)]<-0x1*0x16f+0x95*-0x29+0x1b40)throw l;continue;}return r[w(0xcd)];}catch(u){if(u&&'object'==typeof u&&w(0xce)in u)throw u;l={'status':0x0,'message':u?.[w(0xcf)]||w(0xc1)};}const m={};m['status']=0x0,m[w(0xcf)]=w(0xcb);throw l||m;}
@@ -1 +1 @@
1
- import chalk from"chalk";import o from"string-width";import{localized as e}from"./learn-curricula.js";import{t as n}from"./learn-i18n.js";import{getConfig as l}from"./config.js";import{renderCharts as t,detectCaps as r}from"./render-card.js";function c(){return(l().language||"en").toLowerCase()}const s=64;function a(o="─"){return o.repeat(66)}function g(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 i(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,e,l){const t=c(),r=e.cardsCompleted.length,s=o.totalCards,y=s-r,d=o.modules.find(o=>e.currentCard>=o.cardRange[0]&&e.currentCard<=o.cardRange[1]);if(console.log(),console.log(chalk.cyan(" ╭"+a("═"))),console.log(chalk.cyan(" ║")),console.log(chalk.cyan(" ║ ")+chalk.bold.white(" "+n("academy_title",t))),console.log(chalk.cyan(" ║")),l)console.log(chalk.cyan(" ║ ")+chalk.white(" "+n("welcome_new_demo",t)));else{const o=new Date(e.lastSeenAt),l=Math.floor((Date.now()-o.getTime())/36e5),r=l<1?n("just_now",t):l<24?`${l}${n("ago_hours",t)}`:`${Math.floor(l/24)}${n("ago_days",t)}`;console.log(chalk.cyan(" ║ ")+chalk.white(` ${n("welcome_back",t)} ${r}`))}console.log(chalk.cyan(" ║"));const u=d?`${d.number}. ${d.name}`:"—";console.log(chalk.cyan(" ║ ")+" "+chalk.gray(n("module",t).padEnd(11))+chalk.white(u)),console.log(chalk.cyan(" ║ ")+" "+chalk.gray(n("progress",t).padEnd(11))+g(r,s)+chalk.gray(` (${r}/${s})`)),console.log(chalk.cyan(" ║ ")+" "+chalk.gray(n("streak",t).padEnd(11))+i(e.streakDays)),y>0&&e.currentCard<=s&&console.log(chalk.cyan(" ║ ")+" "+chalk.gray(n("next_card",t).padEnd(11))+chalk.white(`#${e.currentCard} ${n("of",t)} ${s}`)),console.log(chalk.cyan(" ║")),console.log(chalk.cyan(" ╰"+a("═"))),console.log(),console.log(chalk.gray(" ─────────────────────────────────────────────"));const h=0===r?n("continue_start",t):`${n("continue_resume",t)} ${e.currentCard}`;console.log(chalk.bold.green(" continue")+chalk.gray(" "+h)),console.log(chalk.yellow(" status")+chalk.gray(" "+n("status_full",t))),e.bookmarks.length>0&&console.log(chalk.yellow(" bookmarks")+chalk.gray(` ${e.bookmarks.length} ${n("bookmarks_desc",t)}`)),console.log(chalk.gray(" quit")+chalk.gray(" "+n("quit_desc",t))),console.log(chalk.gray(" ─────────────────────────────────────────────")),console.log()}function y(o,e){const l=c(),t=o.module,r=e.modules.find(o=>o.number===t),a=r?r.name:n("unknown_module",l),g=n("module",l).replace(":","").trim(),i=`${n("card",l)} ${o.number} / ${e.totalCards} · ${g} ${t} · ${a}`;console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(i)+" "+chalk.cyan("─".repeat(Math.max(0,s-i.length-4))))}function d(){console.log(chalk.cyan(" ╰"+a())),console.log()}function u(o){console.log(chalk.cyan(" │ ")+chalk.white(o))}function h(){console.log(chalk.cyan(" │"))}const m=/[┌┐└┘├┤┬┴┼─│╔╗╚╝═║╠╣╦╩╬▓▒░█]/;function f(o){return/^(?: {4}|\t)/.test(o)||m.test(o)||/ {3,}/.test(o)}function b(e,n){const l=[];let t="",r=0,c=!1;for(const s of function(e){const n=[],l=e=>{let l="";const t=()=>{l&&(n.push({t:"atom",s:l}),l="")};for(const r of e)" "===r?(t(),n.push({t:"space"})):2===o(r)?(t(),n.push({t:"wide",s:r})):l+=r;t()},t=/`[^`]*`/g;let r,c=0;for(;null!==(r=t.exec(e));)l(e.slice(c,r.index)),n.push({t:"code",s:r[0]}),c=r.index+r[0].length;return l(e.slice(c)),n}(e)){if("space"===s.t){""!==t&&(c=!0);continue}const e=s.s,a=o("code"===s.t?e.replace(/`/g,""):e),g=c?1:0,i="atom"===s.t&&e.length<=2&&/^[.,;:!?)\]}…'"]+$/.test(e);""!==t&&!i&&r+g+a>n?(l.push(t),t=e,r=a,c=!1):(c&&(t+=" ",r+=1,c=!1),t+=e,r+=a)}return t&&l.push(t),l}const p=/\b(?:Common bug|Common mistake|Common error|Pitfall|Gotcha|Footgun)\b[::]?|\b(?:Warning|Caution)\b[::]|(?:常见错误|常见陷阱|常见误区|陷阱|注意|警告|误区)[::]/gi;function w(o,e){const n=e?chalk.bold.white:chalk.white;let l,t="",r=0;for(p.lastIndex=0;null!==(l=p.exec(o));)l.index>r&&(t+=n(o.slice(r,l.index))),t+=chalk.bold.yellow(l[0]),r=l.index+l[0].length;return r<o.length&&(t+=n(o.slice(r))),t}function _(o,e=!1){let n="",l=0;const t=/`([^`]*)`/g;let r;for(;null!==(r=t.exec(o));)r.index>l&&(n+=w(o.slice(l,r.index),e)),n+=chalk.cyan(r[1]),l=r.index+r[0].length;return l<o.length&&(n+=w(o.slice(l),e)),n}function $(o,e=!1){let n=!1;for(const l of o.split("\n"))if(/^\s*```/.test(l))n=!n;else if(n)console.log(chalk.cyan(" │ ")+chalk.cyan(` ${l}`));else if(""!==l)if(f(l))console.log(chalk.cyan(" │ ")+chalk.white(l));else for(const o of b(l,60))console.log(chalk.cyan(" │ ")+` ${_(o,e)}`);else h()}function k(o,e){const n=[];for(const l of o.split("\n")){if(""===l){n.push("");continue}if(f(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(l,a){const g=c(),i=e(l,g);y(i,a),h();const m=b(i.title,60);for(const o of m)u(chalk.bold.yellow(o));u(chalk.gray("─".repeat(Math.min(Math.max(...m.map(e=>o(e))),s))));const f=!!(l.chart_ids&&l.chart_ids.length>0);if(f&&t(l.chart_ids.slice(0,1),a.charts,r()),i.key_point&&""!==i.key_point.trim()?(f||h(),function(o,e,n){const l=c().startsWith("zh"),t=r().cols,a="-".repeat(Math.min(s,Math.max(24,t-6))),g=l?"要点":"KEY POINT",i=l?`第 ${e} / ${n} 张`:`Card ${e} / ${n}`;console.log(chalk.cyan(" │ ")+chalk.green(a)),console.log(chalk.cyan(" │ ")+chalk.green(`${g} · ${i}`));for(const e of b(o,60))console.log(chalk.cyan(" │ ")+chalk.bold.green(" "+e));console.log(chalk.cyan(" │ ")+chalk.green(a)),h()}(i.key_point,i.number,a.totalCards)):f||h(),i.body.filter(o=>null!=o&&""!==o.trim()).forEach((o,e)=>{const n=0===e?o.match(/^([\s\S]*?(?:[.!?](?=\s|$)|[。!?]))(\s[\s\S]*)?$/):null;if(n&&n[1].trim().length<=180){$(n[1],!0);const o=n[2]?.trimStart();o&&$(o,!1)}else $(o,!1);h()}),i.icoaConnection){u(chalk.magenta(" "+n("icoa_connection",g))),u(chalk.gray(" "+"─".repeat(20)));for(const o of b(i.icoaConnection,60))u(" "+chalk.magenta(o));h()}if(l.check){const o=g.startsWith("zh"),e=l._zh?.checkStatement??l._zh?.check?.statement,n=o?e??l.check.statement:l.check.statement;u(chalk.cyan(" 🤔 "+(o?"快速理解检查 (输 y 或 n):":"Quick comprehension check (type y or n):"))),u(chalk.gray(" "+"─".repeat(20)));for(const o of b(n,60))u(" "+chalk.white(o));h()}d(),function(o,e){const n=c().startsWith("zh"),l=r().cols,t="-".repeat(Math.min(s,Math.max(24,l-6))),a=chalk.gray(" "),g=[];o.check?(g.push(chalk.bold.green("[y]")+chalk.gray(n?" 是":" yes")),g.push(chalk.bold.green("[n]")+chalk.gray(n?" 否":" no"))):g.push(chalk.bold.green("[ok]")+chalk.gray(n?" 继续":" next")),g.push(chalk.bold.yellow("[e]")+chalk.gray(n?" 报告问题":" report")),g.push(chalk.bold.cyan("[b]")+chalk.gray(n?" 上一张":" back")),g.push(chalk.bold.cyan("[card N]")+chalk.gray(n?" 跳转":" jump")),g.push(chalk.gray("[quit]")+chalk.gray(n?" 退出":" quit")),console.log(chalk.gray(" "+t)),console.log(chalk.gray(" "+(n?`第 ${o.number} / ${e.totalCards} 张`:`Card ${o.number} / ${e.totalCards}`))),console.log(" "+g.join(a)),console.log(chalk.gray(" "+t)),console.log(chalk.gray(" "+(n?"e = 报告本卡错误,不算作答;提交后回到本题继续":"e = report a problem with this card (not an answer); you return here after"))),console.log(chalk.gray(" "+(n?"更多: bookmark · status · lang zh/en":"more: bookmark · status · lang zh/en"))),console.log()}(l,a)}export function renderCheckFeedback(o,e,n,l=!1){const t=c().startsWith("zh");if(console.log(),n)console.log(chalk.green(" ✓ ")+chalk.white(t?"答对了。":"Correct."));else if(console.log(chalk.yellow(" ✗ ")+chalk.white(t?"记下了,继续。":"Noted — moving on.")),l){const e="y"===o.check?.answer?t?"是":"Yes":t?"否":"No";console.log(chalk.gray(" "+(t?"正确答案: ":"Answer: ")+e+". "+(t?"回看上面那段。":"Re-read the paragraph above.")))}console.log()}export function renderPhaseComplete(o,e,n,l){const t=c().startsWith("zh"),[r,s]=n.cardRange,a=e.checkResults||{};let g=0,i=0;for(let o=r;o<=s;o++){const e=a[String(o)];e&&(g++,e.correct&&i++)}const y="-".repeat(48);console.log(),console.log(chalk.bold.yellow(" "+y)),console.log(chalk.bold.yellow(" "+(t?`阶段 ${n.number} 完成`:`Phase ${n.number} complete`))+chalk.gray(" · ")+chalk.white(n.name));const d=g>0&&i===g?chalk.bold.green:chalk.bold.white;console.log(chalk.gray(" "+(t?"理解检查得分: ":"comprehension score: "))+d(`${i}/${g}`)+chalk.gray(0===g?t?" (本阶段未作答 y/n)":" (no y/n answered)":"")),l&&console.log(chalk.gray(" "+(t?"下一阶段: ":"next: "))+chalk.bold.cyan(t?`阶段 ${l.number}`:`Phase ${l.number}`)+chalk.gray(" · ")+chalk.white(l.name)),console.log(chalk.bold.yellow(" "+y))}export function renderCurriculumComplete(o,e){const n=c().startsWith("zh"),l=e.checkResults||{},t="-".repeat(48);let r=0,s=0;console.log(),console.log(chalk.bold.green(" "+t)),console.log(chalk.bold.green(" 🏆 "+(n?`${o.name} — 全部完成!`:`${o.name} — complete!`))),console.log(chalk.bold.green(" "+t));for(const e of o.modules){const[o,t]=e.cardRange;let c=0,a=0;for(let e=o;e<=t;e++){const o=l[String(e)];o&&(c++,o.correct&&a++)}r+=c,s+=a;const g=c>0&&a===c?chalk.green:chalk.white;console.log(chalk.gray(" "+(n?`阶段 ${e.number}`:`Phase ${e.number}`).padEnd(8))+g(`${a}/${c}`.padEnd(7))+chalk.gray(e.name))}console.log(chalk.bold.green(" "+t)),console.log(chalk.bold.green(" "+(n?"总分 / overall: ":"Overall: "))+chalk.bold.white(`${s}/${r}`)),console.log(chalk.bold.green(" "+t)),console.log()}export function renderMCQCard(o,l){const t=c(),r=e(o,t);y(r,l),h(),u(chalk.bold.yellow("🎯 "+r.title)),u(chalk.gray("─".repeat(Math.min(r.title.length+4,s)))),h();for(const o of k(r.question,60))u(" "+o);h();for(const o of["A","B","C","D"])u(chalk.cyan(` ${o}.`)+" "+chalk.white(r.options[o]));h(),d(),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(" "+n("type_to_answer",t))),console.log()}export function renderMCQFeedback(o,l,t,r){const s=c(),a=e(o,s);console.log(),t?console.log(" "+chalk.bold.green(n("correct",s)+" ")+chalk.gray(`${n("one_point",s)} · ${l} = ${a.options[l]}`)):console.log(" "+chalk.bold.red(n("not_quite",s)+" ")+chalk.gray(`${n("you_chose",s)} ${l}; ${n("answer_is",s)} ${a.answer}.`)),console.log(),console.log(chalk.gray(" "+n("explanation",s)));for(const o of k(a.explanation,60))console.log(chalk.gray(" "+o));const g=Object.values(r.mcqResults),i=g.filter(o=>o.correct).length;console.log(),console.log(chalk.gray(" "+n("mcq_accuracy_so_far",s)+" ")+chalk.white(`${i}/${g.length}`)),console.log(),t||(console.log(chalk.gray(" "+n("press_ok_continue",s)+" ")+chalk.bold.green("ok")+chalk.gray(" "+n("to_continue",s))),console.log())}export function renderPracticalCard(o,l){const t=c(),r=e(o,t);y(r,l),h(),u(chalk.bold.yellow("🛠 "+r.title)),u(chalk.gray("─".repeat(Math.min(r.title.length+4,s)))),h();for(const o of k(r.task,60))u(" "+o);if(r.starterCode){h(),u(chalk.gray(" "+n("starter_code",t))),h();for(const o of r.starterCode.split("\n"))u(" "+chalk.cyan(o))}h(),d(),console.log(chalk.gray(" "+n("try_in_sandbox",t)+" ")+chalk.bold.cyan("!python3")+chalk.gray(" "+n("drops_into_python",t))),console.log(chalk.gray(" "+n("when_done",t))),console.log(chalk.gray(" ")+chalk.bold.green("done")+chalk.gray(" "+n("done_desc",t))),console.log(chalk.gray(" ")+chalk.bold.yellow("skip")+chalk.gray(" "+n("skip_desc",t))),console.log(chalk.gray(" card N jump to a card by number")),console.log()}export function renderPracticalSuccess(o){const l=c(),t=e(o,l);console.log(),console.log(" "+chalk.bold.green(n("practical_recorded",l))),console.log(),console.log(chalk.gray(" "+n("reference_answer",l)));for(const o of k(t.successHint,60))console.log(chalk.gray(" "+o));console.log(),console.log(chalk.gray(" "+n("press_ok_continue",l)+" ")+chalk.bold.green("ok")+chalk.gray(" "+n("to_continue",l))),console.log()}export function renderSimDemoCard(o,l){const t=c(),r=e(o,t);y(r,l),h(),u(chalk.bold.yellow("🎬 "+r.title)),h();for(const o of k(r.description,60))u(" "+o);h(),u(chalk.gray(" "+n("sim_requires",t))),h(),d(),console.log(chalk.gray(" ")+chalk.bold.cyan("sim")+chalk.gray(" "+n("sim_launch_desc",t))),console.log(chalk.gray(" ")+chalk.bold.green("ok")+chalk.gray(" / ")+chalk.bold.green("next")+chalk.gray(" "+n("continue_to_next",t))),console.log(chalk.gray(" bookmark "+n("bookmark_desc",t))),console.log(chalk.gray(" back "+n("back_desc",t))),console.log(chalk.gray(" card N jump to a card by number")),console.log(chalk.gray(" quit "+n("quit_desc",t))),console.log()}export function renderMilestone(o,l){const t=c(),r=e(o,t),s=o.number===l.totalCards;console.log(),console.log(chalk.bold.yellow(" ╭"+a("═"))),console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+chalk.white(" "+n("milestone_header",t))),console.log(chalk.bold.yellow(" ║"));const g=` ${r.badge} ${r.emoji}`;console.log(chalk.bold.yellow(" ║ ")+chalk.bold.green(g)),console.log(chalk.bold.yellow(" ║ ")+chalk.gray(" ─".repeat(Math.max(1,Math.floor(r.badge.length/2+2))))),console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+" "+chalk.gray(n("in_wild_corresponds",t)));for(const o of k(r.realWorldLevel,60))console.log(chalk.bold.yellow(" ║ ")+" "+chalk.white(o));console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+" "+chalk.gray(n("whats_next",t)));for(const o of k(r.unlockedNext,60))console.log(chalk.bold.yellow(" ║ ")+" "+chalk.white(o));console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ╰"+a("═"))),console.log(),s?(console.log(chalk.gray(" "+n("demo_complete",t))),console.log(),console.log(chalk.gray(" "+n("unlock_full",t)+" ")+chalk.white(n("curriculum_name",t))+chalk.gray(",")),console.log(chalk.gray(" "+n("contact_team_leader",t)+" ")+chalk.bold.yellow("EA")+chalk.gray(" "+n("learn_token",t))),console.log(chalk.gray(" "+n("or_email",t)+" ")+chalk.cyan("asra@icoa2026.au")+chalk.gray(" "+n("for_partnership",t))),console.log(),console.log(chalk.gray(" "+n("type_quit",t)+" ")+chalk.bold.green("quit")+chalk.gray(" "+n("to_exit",t)+" ")+chalk.bold.green("status")+chalk.gray(" "+n("for_dashboard",t)))):(console.log(chalk.gray(" ")+chalk.bold.green("ok")+chalk.gray(" / ")+chalk.bold.green("next")+chalk.gray(" "+n("continue_to_next",t))),console.log(chalk.gray(" status "+n("status_full",t))),console.log(chalk.gray(" card N jump to a card by number")),console.log(chalk.gray(" quit "+n("quit_desc",t)))),console.log()}export function renderStatus(o,e){const l=c(),t=e.cardsCompleted.length,r=o.totalCards,s=Object.values(e.mcqResults),a=s.filter(o=>o.correct).length;console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(n("status_title",l))+" "+chalk.cyan("─".repeat(25))),h(),u(" "+chalk.gray(n("total_progress",l)+" ")+g(t,r)+chalk.gray(` (${t}/${r})`)),u(" "+chalk.gray(n("streak",l)+" ")+i(e.streakDays)+chalk.gray(` (${n("longest",l)} ${e.longestStreak})`)),u(" "+chalk.gray(n("mcq_accuracy",l)+" ")+chalk.white(`${a}/${s.length}`)),u(" "+chalk.gray(n("practicals_done",l)+" ")+chalk.white(`${e.practicalsCompleted.length}`)),u(" "+chalk.gray(n("bookmarked",l)+" ")+chalk.white(`${e.bookmarks.length}`)),h();const y=n("module",l).replace(":","").trim();for(const n of o.modules){const[o,l]=n.cardRange,t=e.cardsCompleted.filter(e=>e>=o&&e<=l).length,r=l-o+1;u(" "+(t===r?chalk.green("✓"):t>0?chalk.yellow("▶"):chalk.gray("□"))+" "+chalk.gray(`${y} ${n.number}: `)+chalk.white(`${t}/${r}`)+chalk.gray(" "+n.name))}if(h(),e.achievements.length>0){u(" "+chalk.gray(n("achievements",l)));for(const o of e.achievements)u(" "+chalk.bold.yellow("★ ")+chalk.white(o))}else u(" "+chalk.gray(n("achievements_none",l)));h(),d()}
1
+ import chalk from"chalk";import o from"string-width";import{localized as e}from"./learn-curricula.js";import{t as n}from"./learn-i18n.js";import{getConfig as l}from"./config.js";import{renderCharts as t,detectCaps as r}from"./render-card.js";function c(){return(l().language||"en").toLowerCase()}const s=64;function a(o="─"){return o.repeat(66)}function g(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 i(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,e,l){const t=c(),r=e.cardsCompleted.length,s=o.totalCards,y=s-r,d=o.modules.find(o=>e.currentCard>=o.cardRange[0]&&e.currentCard<=o.cardRange[1]);if(console.log(),console.log(chalk.cyan(" ╭"+a("═"))),console.log(chalk.cyan(" ║")),console.log(chalk.cyan(" ║ ")+chalk.bold.white(" "+n("academy_title",t))),console.log(chalk.cyan(" ║")),l)console.log(chalk.cyan(" ║ ")+chalk.white(" "+n("welcome_new_demo",t)));else{const o=new Date(e.lastSeenAt),l=Math.floor((Date.now()-o.getTime())/36e5),r=l<1?n("just_now",t):l<24?`${l}${n("ago_hours",t)}`:`${Math.floor(l/24)}${n("ago_days",t)}`;console.log(chalk.cyan(" ║ ")+chalk.white(` ${n("welcome_back",t)} ${r}`))}console.log(chalk.cyan(" ║"));const u=d?`${d.number}. ${d.name}`:"—";console.log(chalk.cyan(" ║ ")+" "+chalk.gray(n("module",t).padEnd(11))+chalk.white(u)),console.log(chalk.cyan(" ║ ")+" "+chalk.gray(n("progress",t).padEnd(11))+g(r,s)+chalk.gray(` (${r}/${s})`)),console.log(chalk.cyan(" ║ ")+" "+chalk.gray(n("streak",t).padEnd(11))+i(e.streakDays)),y>0&&e.currentCard<=s&&console.log(chalk.cyan(" ║ ")+" "+chalk.gray(n("next_card",t).padEnd(11))+chalk.white(`#${e.currentCard} ${n("of",t)} ${s}`)),console.log(chalk.cyan(" ║")),console.log(chalk.cyan(" ╰"+a("═"))),console.log(),console.log(chalk.gray(" ─────────────────────────────────────────────"));const h=0===r?n("continue_start",t):`${n("continue_resume",t)} ${e.currentCard}`;console.log(chalk.bold.green(" continue")+chalk.gray(" "+h)),console.log(chalk.yellow(" status")+chalk.gray(" "+n("status_full",t))),e.bookmarks.length>0&&console.log(chalk.yellow(" bookmarks")+chalk.gray(` ${e.bookmarks.length} ${n("bookmarks_desc",t)}`)),console.log(chalk.gray(" quit")+chalk.gray(" "+n("quit_desc",t))),console.log(chalk.gray(" ─────────────────────────────────────────────")),console.log()}function y(o,e){const l=c(),t=o.module,r=e.modules.find(o=>o.number===t),a=r?r.name:n("unknown_module",l),g=n("module",l).replace(":","").trim(),i=`${n("card",l)} ${o.number} / ${e.totalCards} · ${g} ${t} · ${a}`;console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(i)+" "+chalk.cyan("─".repeat(Math.max(0,s-i.length-4))))}function d(){console.log(chalk.cyan(" ╰"+a())),console.log()}function u(o){console.log(chalk.cyan(" │ ")+chalk.white(o))}function h(){console.log(chalk.cyan(" │"))}const m=/[┌┐└┘├┤┬┴┼─│╔╗╚╝═║╠╣╦╩╬▓▒░█]/;function f(o){return/^(?: {4}|\t)/.test(o)||m.test(o)||/ {3,}/.test(o)}function b(e,n){const l=[];let t="",r=0,c=!1;for(const s of function(e){const n=[],l=e=>{let l="";const t=()=>{l&&(n.push({t:"atom",s:l}),l="")};for(const r of e)" "===r?(t(),n.push({t:"space"})):2===o(r)?(t(),n.push({t:"wide",s:r})):l+=r;t()},t=/`[^`]*`/g;let r,c=0;for(;null!==(r=t.exec(e));)l(e.slice(c,r.index)),n.push({t:"code",s:r[0]}),c=r.index+r[0].length;return l(e.slice(c)),n}(e)){if("space"===s.t){""!==t&&(c=!0);continue}const e=s.s,a=o("code"===s.t?e.replace(/`/g,""):e),g=c?1:0,i="atom"===s.t&&e.length<=2&&/^[.,;:!?)\]}…'"]+$/.test(e);""!==t&&!i&&r+g+a>n?(l.push(t),t=e,r=a,c=!1):(c&&(t+=" ",r+=1,c=!1),t+=e,r+=a)}return t&&l.push(t),l}const p=/\b(?:Common bug|Common mistake|Common error|Pitfall|Gotcha|Footgun)\b[::]?|\b(?:Warning|Caution)\b[::]|(?:常见错误|常见陷阱|常见误区|陷阱|注意|警告|误区)[::]/gi;function w(o,e){const n=e?chalk.bold.white:chalk.white;let l,t="",r=0;for(p.lastIndex=0;null!==(l=p.exec(o));)l.index>r&&(t+=n(o.slice(r,l.index))),t+=chalk.bold.yellow(l[0]),r=l.index+l[0].length;return r<o.length&&(t+=n(o.slice(r))),t}function _(o,e=!1){let n="",l=0;const t=/`([^`]*)`/g;let r;for(;null!==(r=t.exec(o));)r.index>l&&(n+=w(o.slice(l,r.index),e)),n+=chalk.cyan(r[1]),l=r.index+r[0].length;return l<o.length&&(n+=w(o.slice(l),e)),n}function $(o,e=!1){let n=!1;for(const l of o.split("\n"))if(/^\s*```/.test(l))n=!n;else if(n)console.log(chalk.cyan(" │ ")+chalk.cyan(` ${l}`));else if(""!==l)if(f(l))console.log(chalk.cyan(" │ ")+chalk.white(l));else for(const o of b(l,60))console.log(chalk.cyan(" │ ")+` ${_(o,e)}`);else h()}function k(o,e){const n=[];for(const l of o.split("\n")){if(""===l){n.push("");continue}if(f(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(l,a){const g=c(),i=e(l,g);y(i,a),h();const m=b(i.title,60);for(const o of m)u(chalk.bold.yellow(o));u(chalk.gray("─".repeat(Math.min(Math.max(...m.map(e=>o(e))),s))));const f=!!(l.chart_ids&&l.chart_ids.length>0);if(f&&t(l.chart_ids.slice(0,1),a.charts,r()),i.key_point&&""!==i.key_point.trim()?(f||h(),function(o,e,n){const l=c().startsWith("zh"),t=r().cols,a="-".repeat(Math.min(s,Math.max(24,t-6))),g=l?"要点":"KEY POINT",i=l?`第 ${e} / ${n} 张`:`Card ${e} / ${n}`;console.log(chalk.cyan(" │ ")+chalk.green(a)),console.log(chalk.cyan(" │ ")+chalk.green(`${g} · ${i}`));for(const e of b(o,60))console.log(chalk.cyan(" │ ")+chalk.bold.green(" "+e));console.log(chalk.cyan(" │ ")+chalk.green(a)),h()}(i.key_point,i.number,a.totalCards)):f||h(),i.body.filter(o=>null!=o&&""!==o.trim()).forEach((o,e)=>{const n=0===e?o.match(/^([\s\S]*?(?:[.!?](?=\s|$)|[。!?]))(\s[\s\S]*)?$/):null;if(n&&n[1].trim().length<=180){$(n[1],!0);const o=n[2]?.trimStart();o&&$(o,!1)}else $(o,!1);h()}),i.icoaConnection){u(chalk.magenta(" "+n("icoa_connection",g))),u(chalk.gray(" "+"─".repeat(20)));for(const o of b(i.icoaConnection,60))u(" "+chalk.magenta(o));h()}if(l.check){const o=g.startsWith("zh"),e=l._zh?.checkStatement??l._zh?.check?.statement,n=o?e??l.check.statement:l.check.statement;u(chalk.cyan(" 🤔 "+(o?"请回答 (输 y 或 n):":"Quick comprehension check (type y or n):"))),u(chalk.gray(" "+"─".repeat(20)));for(const o of b(n,60))u(" "+chalk.white(o));h()}d(),function(o,e){const n=c().startsWith("zh"),l=r().cols,t="-".repeat(Math.min(s,Math.max(24,l-6))),a=chalk.gray(" "),g=[];o.check?(g.push(chalk.bold.green("[y]")+chalk.gray(n?" 是":" yes")),g.push(chalk.bold.green("[n]")+chalk.gray(n?" 否":" no"))):g.push(chalk.bold.green("[ok]")+chalk.gray(n?" 继续":" next")),g.push(chalk.bold.yellow("[e]")+chalk.gray(n?" 报告问题":" report")),g.push(chalk.bold.cyan("[b]")+chalk.gray(n?" 上一张":" back")),g.push(chalk.bold.cyan("[card N]")+chalk.gray(n?" 跳转":" jump")),g.push(chalk.gray("[quit]")+chalk.gray(n?" 退出":" quit")),console.log(chalk.gray(" "+t)),console.log(chalk.gray(" "+(n?`第 ${o.number} / ${e.totalCards} 张`:`Card ${o.number} / ${e.totalCards}`))),console.log(" "+g.join(a)),console.log(chalk.gray(" "+t)),console.log(chalk.gray(" "+(n?"e = 报告本卡错误,不算作答;提交后回到本题继续":"e = report a problem with this card (not an answer); you return here after"))),console.log(chalk.gray(" "+(n?"更多: bookmark · status · lang zh/en":"more: bookmark · status · lang zh/en"))),console.log()}(l,a)}export function renderCheckFeedback(o,e,n,l=!1){const t=c().startsWith("zh");if(console.log(),n)console.log(chalk.green(" ✓ ")+chalk.white(t?"答对了。":"Correct."));else if(console.log(chalk.yellow(" ✗ ")+chalk.white(t?"记下了,继续。":"Noted — moving on.")),l){const e="y"===o.check?.answer?t?"是":"Yes":t?"否":"No";console.log(chalk.gray(" "+(t?"正确答案: ":"Answer: ")+e+". "+(t?"回看上面那段。":"Re-read the paragraph above.")))}console.log()}export function renderPhaseComplete(o,e,n,l){const t=c().startsWith("zh"),[r,s]=n.cardRange,a=e.checkResults||{};let g=0,i=0;for(let o=r;o<=s;o++){const e=a[String(o)];e&&(g++,e.correct&&i++)}const y="-".repeat(48);console.log(),console.log(chalk.bold.yellow(" "+y)),console.log(chalk.bold.yellow(" "+(t?`阶段 ${n.number} 完成`:`Phase ${n.number} complete`))+chalk.gray(" · ")+chalk.white(n.name));const d=g>0&&i===g?chalk.bold.green:chalk.bold.white;console.log(chalk.gray(" "+(t?"理解检查得分: ":"comprehension score: "))+d(`${i}/${g}`)+chalk.gray(0===g?t?" (本阶段未作答 y/n)":" (no y/n answered)":"")),l&&console.log(chalk.gray(" "+(t?"下一阶段: ":"next: "))+chalk.bold.cyan(t?`阶段 ${l.number}`:`Phase ${l.number}`)+chalk.gray(" · ")+chalk.white(l.name)),console.log(chalk.bold.yellow(" "+y))}export function renderCurriculumComplete(o,e){const n=c().startsWith("zh"),l=e.checkResults||{},t="-".repeat(48);let r=0,s=0;console.log(),console.log(chalk.bold.green(" "+t)),console.log(chalk.bold.green(" 🏆 "+(n?`${o.name} — 全部完成!`:`${o.name} — complete!`))),console.log(chalk.bold.green(" "+t));for(const e of o.modules){const[o,t]=e.cardRange;let c=0,a=0;for(let e=o;e<=t;e++){const o=l[String(e)];o&&(c++,o.correct&&a++)}r+=c,s+=a;const g=c>0&&a===c?chalk.green:chalk.white;console.log(chalk.gray(" "+(n?`阶段 ${e.number}`:`Phase ${e.number}`).padEnd(8))+g(`${a}/${c}`.padEnd(7))+chalk.gray(e.name))}console.log(chalk.bold.green(" "+t)),console.log(chalk.bold.green(" "+(n?"总分 / overall: ":"Overall: "))+chalk.bold.white(`${s}/${r}`)),console.log(chalk.bold.green(" "+t)),console.log()}export function renderMCQCard(o,l){const t=c(),r=e(o,t);y(r,l),h(),u(chalk.bold.yellow("🎯 "+r.title)),u(chalk.gray("─".repeat(Math.min(r.title.length+4,s)))),h();for(const o of k(r.question,60))u(" "+o);h();for(const o of["A","B","C","D"])u(chalk.cyan(` ${o}.`)+" "+chalk.white(r.options[o]));h(),d(),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(" "+n("type_to_answer",t))),console.log()}export function renderMCQFeedback(o,l,t,r){const s=c(),a=e(o,s);console.log(),t?console.log(" "+chalk.bold.green(n("correct",s)+" ")+chalk.gray(`${n("one_point",s)} · ${l} = ${a.options[l]}`)):console.log(" "+chalk.bold.red(n("not_quite",s)+" ")+chalk.gray(`${n("you_chose",s)} ${l}; ${n("answer_is",s)} ${a.answer}.`)),console.log(),console.log(chalk.gray(" "+n("explanation",s)));for(const o of k(a.explanation,60))console.log(chalk.gray(" "+o));const g=Object.values(r.mcqResults),i=g.filter(o=>o.correct).length;console.log(),console.log(chalk.gray(" "+n("mcq_accuracy_so_far",s)+" ")+chalk.white(`${i}/${g.length}`)),console.log(),t||(console.log(chalk.gray(" "+n("press_ok_continue",s)+" ")+chalk.bold.green("ok")+chalk.gray(" "+n("to_continue",s))),console.log())}export function renderPracticalCard(o,l){const t=c(),r=e(o,t);y(r,l),h(),u(chalk.bold.yellow("🛠 "+r.title)),u(chalk.gray("─".repeat(Math.min(r.title.length+4,s)))),h();for(const o of k(r.task,60))u(" "+o);if(r.starterCode){h(),u(chalk.gray(" "+n("starter_code",t))),h();for(const o of r.starterCode.split("\n"))u(" "+chalk.cyan(o))}h(),d(),console.log(chalk.gray(" "+n("try_in_sandbox",t)+" ")+chalk.bold.cyan("!python3")+chalk.gray(" "+n("drops_into_python",t))),console.log(chalk.gray(" "+n("when_done",t))),console.log(chalk.gray(" ")+chalk.bold.green("done")+chalk.gray(" "+n("done_desc",t))),console.log(chalk.gray(" ")+chalk.bold.yellow("skip")+chalk.gray(" "+n("skip_desc",t))),console.log(chalk.gray(" card N jump to a card by number")),console.log()}export function renderPracticalSuccess(o){const l=c(),t=e(o,l);console.log(),console.log(" "+chalk.bold.green(n("practical_recorded",l))),console.log(),console.log(chalk.gray(" "+n("reference_answer",l)));for(const o of k(t.successHint,60))console.log(chalk.gray(" "+o));console.log(),console.log(chalk.gray(" "+n("press_ok_continue",l)+" ")+chalk.bold.green("ok")+chalk.gray(" "+n("to_continue",l))),console.log()}export function renderSimDemoCard(o,l){const t=c(),r=e(o,t);y(r,l),h(),u(chalk.bold.yellow("🎬 "+r.title)),h();for(const o of k(r.description,60))u(" "+o);h(),u(chalk.gray(" "+n("sim_requires",t))),h(),d(),console.log(chalk.gray(" ")+chalk.bold.cyan("sim")+chalk.gray(" "+n("sim_launch_desc",t))),console.log(chalk.gray(" ")+chalk.bold.green("ok")+chalk.gray(" / ")+chalk.bold.green("next")+chalk.gray(" "+n("continue_to_next",t))),console.log(chalk.gray(" bookmark "+n("bookmark_desc",t))),console.log(chalk.gray(" back "+n("back_desc",t))),console.log(chalk.gray(" card N jump to a card by number")),console.log(chalk.gray(" quit "+n("quit_desc",t))),console.log()}export function renderMilestone(o,l){const t=c(),r=e(o,t),s=o.number===l.totalCards;console.log(),console.log(chalk.bold.yellow(" ╭"+a("═"))),console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+chalk.white(" "+n("milestone_header",t))),console.log(chalk.bold.yellow(" ║"));const g=` ${r.badge} ${r.emoji}`;console.log(chalk.bold.yellow(" ║ ")+chalk.bold.green(g)),console.log(chalk.bold.yellow(" ║ ")+chalk.gray(" ─".repeat(Math.max(1,Math.floor(r.badge.length/2+2))))),console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+" "+chalk.gray(n("in_wild_corresponds",t)));for(const o of k(r.realWorldLevel,60))console.log(chalk.bold.yellow(" ║ ")+" "+chalk.white(o));console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+" "+chalk.gray(n("whats_next",t)));for(const o of k(r.unlockedNext,60))console.log(chalk.bold.yellow(" ║ ")+" "+chalk.white(o));console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ╰"+a("═"))),console.log(),s?(console.log(chalk.gray(" "+n("demo_complete",t))),console.log(),console.log(chalk.gray(" "+n("unlock_full",t)+" ")+chalk.white(n("curriculum_name",t))+chalk.gray(",")),console.log(chalk.gray(" "+n("contact_team_leader",t)+" ")+chalk.bold.yellow("EA")+chalk.gray(" "+n("learn_token",t))),console.log(chalk.gray(" "+n("or_email",t)+" ")+chalk.cyan("asra@icoa2026.au")+chalk.gray(" "+n("for_partnership",t))),console.log(),console.log(chalk.gray(" "+n("type_quit",t)+" ")+chalk.bold.green("quit")+chalk.gray(" "+n("to_exit",t)+" ")+chalk.bold.green("status")+chalk.gray(" "+n("for_dashboard",t)))):(console.log(chalk.gray(" ")+chalk.bold.green("ok")+chalk.gray(" / ")+chalk.bold.green("next")+chalk.gray(" "+n("continue_to_next",t))),console.log(chalk.gray(" status "+n("status_full",t))),console.log(chalk.gray(" card N jump to a card by number")),console.log(chalk.gray(" quit "+n("quit_desc",t)))),console.log()}export function renderStatus(o,e){const l=c(),t=e.cardsCompleted.length,r=o.totalCards,s=Object.values(e.mcqResults),a=s.filter(o=>o.correct).length;console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(n("status_title",l))+" "+chalk.cyan("─".repeat(25))),h(),u(" "+chalk.gray(n("total_progress",l)+" ")+g(t,r)+chalk.gray(` (${t}/${r})`)),u(" "+chalk.gray(n("streak",l)+" ")+i(e.streakDays)+chalk.gray(` (${n("longest",l)} ${e.longestStreak})`)),u(" "+chalk.gray(n("mcq_accuracy",l)+" ")+chalk.white(`${a}/${s.length}`)),u(" "+chalk.gray(n("practicals_done",l)+" ")+chalk.white(`${e.practicalsCompleted.length}`)),u(" "+chalk.gray(n("bookmarked",l)+" ")+chalk.white(`${e.bookmarks.length}`)),h();const y=n("module",l).replace(":","").trim();for(const n of o.modules){const[o,l]=n.cardRange,t=e.cardsCompleted.filter(e=>e>=o&&e<=l).length,r=l-o+1;u(" "+(t===r?chalk.green("✓"):t>0?chalk.yellow("▶"):chalk.gray("□"))+" "+chalk.gray(`${y} ${n.number}: `)+chalk.white(`${t}/${r}`)+chalk.gray(" "+n.name))}if(h(),e.achievements.length>0){u(" "+chalk.gray(n("achievements",l)));for(const o of e.achievements)u(" "+chalk.bold.yellow("★ ")+chalk.white(o))}else u(" "+chalk.gray(n("achievements_none",l)));h(),d()}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icoa-cli",
3
- "version": "2.19.234",
3
+ "version": "2.19.235",
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": {