icoa-cli 2.19.566 → 2.19.568

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
- import chalk from"chalk";import e from"string-width";import{localized as o}from"./learn-curricula.js";import{t as n}from"./learn-i18n.js";import{getConfig as t}from"./config.js";import{icoaBannerLines as r}from"./banner.js";import{renderCharts as l,detectCaps as a}from"./render-card.js";import{replyChipLabel as s}from"./learn-replies.js";function c(){return(t().language||"en").toLowerCase()}let g="normal";export function resolveLearnWidth(e){return"normal"===e.learnWidth||"wide"===e.learnWidth||"wider"===e.learnWidth||"widest"===e.learnWidth?e.learnWidth:e.learnWide?"wide":"normal"}export function setLearnWidth(e){g=e}export function learnWidthCap(e=g){return"widest"===e?160:"wider"===e?120:"wide"===e?96:64}export function learnW(){const e=process.stdout.columns||69,o=Math.max(40,Math.min(64,e-5));return"normal"===g?o:Math.max(o,Math.min(e-6,learnWidthCap()))}const i=learnW;function d(e="─"){return e.repeat(i()+2)}function h(o,n){if(e(o)<=n)return o;let t=o;for(;t.length>0&&e(t)>Math.max(1,n-1);)t=t.slice(0,-1);return t.trimEnd()+"…"}function y(e,o,n=20){const t=o>0?e/o:0,r=Math.floor(t*n),l=n-r;return`${chalk.green("█".repeat(r))+chalk.gray("░".repeat(l))} ${(100*t).toFixed(1)}%`}function u(e){return e>=30?chalk.red("🔥🔥🔥 "+e+" days"):e>=7?chalk.yellow("🔥 "+e+" days"):e>=1?chalk.gray("· "+e+" day"+(e>1?"s":"")):chalk.gray("—")}export function renderWelcome(e,o,t){const r=c(),l=o.cardsCompleted.length,a=e.totalCards,s=a-l,g=e.modules.find(e=>o.currentCard>=e.cardRange[0]&&o.currentCard<=e.cardRange[1]),p=/demo/i.test(e.id);if(console.log(),console.log(chalk.cyan(" ╭"+d("═"))),console.log(chalk.cyan(" ║")),console.log(chalk.cyan(" ║ ")+chalk.bold.white(" "+(e.name?.trim()||n("academy_title",r)))),console.log(chalk.cyan(" ║")),t)console.log(chalk.cyan(" ║ ")+chalk.white(" "+n(p?"welcome_new_demo":"welcome_new",r)));else{const e=new Date(o.lastSeenAt),t=Math.floor((Date.now()-e.getTime())/36e5),l=t<1?n("just_now",r):t<24?`${t}${n("ago_hours",r)}`:`${Math.floor(t/24)}${n("ago_days",r)}`;console.log(chalk.cyan(" ║ ")+chalk.white(` ${n("welcome_back",r)} ${l}`))}console.log(chalk.cyan(" ║"));const m=h(g?`${g.number}. ${g.name}`:"—",i()-14);console.log(chalk.cyan(" ║ ")+" "+chalk.gray(n("module",r).padEnd(11))+chalk.white(m)),console.log(chalk.cyan(" ║ ")+" "+chalk.gray(n("progress",r).padEnd(11))+y(l,a,Math.max(6,Math.min(20,i()-26-`${l}/${a}`.length)))+chalk.gray(` (${l}/${a})`)),console.log(chalk.cyan(" ║ ")+" "+chalk.gray(n("streak",r).padEnd(11))+u(o.streakDays)),s>0&&o.currentCard<=a&&console.log(chalk.cyan(" ║ ")+" "+chalk.gray(n("next_card",r).padEnd(11))+chalk.white(`#${o.currentCard} ${n("of",r)} ${a}`)),console.log(chalk.cyan(" ║")),console.log(chalk.cyan(" ╰"+d("═"))),console.log(),console.log(chalk.gray(" ─────────────────────────────────────────────"));const b=0===l?n("continue_start",r):`${n("continue_resume",r)} ${o.currentCard}`;console.log(chalk.bold.green(" continue")+chalk.gray(" "+b)),console.log(chalk.yellow(" status")+chalk.gray(" "+n("status_full",r))),o.bookmarks.length>0&&console.log(chalk.yellow(" bookmarks")+chalk.gray(` ${o.bookmarks.length} ${n("bookmarks_desc",r)}`)),console.log(chalk.gray(" quit")+chalk.gray(" "+n("quit_desc",r))),console.log(chalk.gray(" ─────────────────────────────────────────────")),console.log()}function p(o,t){const r=c(),l=o.module,a=t.modules.find(e=>e.number===l),s=a?a.name:n("unknown_module",r),g=n("module",r).replace(":","").trim(),d=h(`${n("card",r)} ${o.number} / ${t.totalCards} · ${g} ${l} · ${s}`,i()-4);console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(d)+" "+chalk.cyan("─".repeat(Math.max(0,i()-e(d)-4))))}function m(){console.log(chalk.cyan(" ╰"+d())),console.log()}function b(e){console.log(chalk.cyan(" │ ")+chalk.white(e))}function f(){console.log(chalk.cyan(" │"))}const $=/[┌┐└┘├┤┬┴┼─│╔╗╚╝═║╠╣╦╩╬▓▒░█]/;function w(e){return/^(?: {4}|\t)/.test(e)||$.test(e)||/ {3,}/.test(e)}export function wrapMixed(o,n){const t=[];let r="",l=0,a=!1;for(const s of function(o){const n=[],t=o=>{let t="";const r=()=>{t&&(n.push({t:"atom",s:t}),t="")};for(const l of o)" "===l?(r(),n.push({t:"space"})):2===e(l)?(r(),n.push({t:"wide",s:l})):t+=l;r()},r=/`[^`]*`/g;let l,a=0;for(;null!==(l=r.exec(o));)t(o.slice(a,l.index)),n.push({t:"code",s:l[0]}),a=l.index+l[0].length;return t(o.slice(a)),n}(o)){if("space"===s.t){""!==r&&(a=!0);continue}const o=s.s,c=e("code"===s.t?o.replace(/`/g,""):o),g=a?1:0,i="atom"===s.t&&o.length<=2&&/^[.,;:!?)\]}…'"]+$/.test(o);""!==r&&!i&&l+g+c>n?(t.push(r),r=o,l=c,a=!1):(a&&(r+=" ",l+=1,a=!1),r+=o,l+=c)}return r&&t.push(r),t}const _=/\b(?:Common bug|Common mistake|Common error|Pitfall|Gotcha|Footgun)\b[::]?|\b(?:Warning|Caution)\b[::]|(?:常见错误|常见陷阱|常见误区|陷阱|注意|警告|误区)[::]/gi;function k(e,o){const n=o?chalk.bold.white:chalk.white;let t,r="",l=0;for(_.lastIndex=0;null!==(t=_.exec(e));)t.index>l&&(r+=n(e.slice(l,t.index))),r+=chalk.bold.yellow(t[0]),l=t.index+t[0].length;return l<e.length&&(r+=n(e.slice(l))),r}function x(e,o=!1){let n="",t=0;const r=/`([^`]*)`/g;let l;for(;null!==(l=r.exec(e));)l.index>t&&(n+=k(e.slice(t,l.index),o)),n+=chalk.cyan(l[1]),t=l.index+l[0].length;return t<e.length&&(n+=k(e.slice(t),o)),n}function C(e,o=!1){let n=!1;for(const t of e.split("\n"))if(/^\s*```/.test(t))n=!n;else if(n)console.log(chalk.cyan(" │ ")+chalk.cyan(` ${t}`));else if(""!==t)if(w(t))console.log(chalk.cyan(" │ ")+chalk.white(t));else for(const e of wrapMixed(t,i()-4))console.log(chalk.cyan(" │ ")+` ${x(e,o)}`);else f()}function v(e,o){const n=[];for(const t of e.split("\n")){if(""===t){n.push("");continue}if(w(t)){n.push(t);continue}let e="";for(const r of t.split(" "))(e+" "+r).trim().length>o?(n.push(e.trim()),e=r):e=(e+" "+r).trim();e&&n.push(e)}return n}let M=!1;export function setLearnAiEnabled(e){M=e}let S=new Set;export function setLearnPqsViewCards(e){S=e}let W=new Map;export function setLearnHonorRanks(e){W=e}const A=["①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩"];let j=[];export function setLearnReplies(e){j=e}let z=[];export function setLearnFaqs(e){z=e}let R=null;export function setLearnHometask(e){R=e}let P="full";export function setLearnFooterProfile(e){P=e}let q=null;export function setLearnFooterExtra(e){q=e}function E(){const e=q?.();e&&console.log(chalk.gray(" "+e))}let L=null;export function setLearnPracticeChips(e){L=e}let N=!1;export function setLearnShellLane(e){N=e}let T=null;export function setLearnPracticeCount(e){T=e}export function renderHonorWall(e){const o=c().startsWith("zh"),{totals:n,chapters:t}=e,r=n.gold+n.silver+n.bronze,l=(e,o)=>o>0?chalk.bold.white(`${e}×${o}`):chalk.gray(`${e}×0`);if(console.log(chalk.gray(" ─────────────────────────────────────────")),console.log(chalk.bold.white(o?" 🏅 奖牌墙 ":" 🏅 Medal wall ")+l("🥇",n.gold)+chalk.gray(" · ")+l("🥈",n.silver)+chalk.gray(" · ")+l("🥉",n.bronze)+chalk.gray(o?" (永久 — 挂上墙就不会摘下)":" (permanent — once earned, never removed)")),0===r){const n=null!=e.floor?`${e.floor}+`:o?"高分":"a high score";return console.log(chalk.gray(o?` 还没有奖牌 — 单卡提问评分 ${n} 并进入该卡前三,即可永久挂墙 🥇🥈🥉`:` No medals yet — score ${n} on a card and hold its top-3 to hang one 🥇🥈🥉`)),void console.log(chalk.gray(" ─────────────────────────────────────────"))}const a=t.map(e=>{const o=`Ch${e.chapter}`,n=(e.gold>0?`🥇${e.gold}`:"")+(e.silver>0?`🥈${e.silver}`:"")+(e.bronze>0?`🥉${e.bronze}`:"");return n?chalk.white(`${o} ${n}`):chalk.gray(`${o} —`)}).join(chalk.gray(" "));console.log(" "+a);const s=t.flatMap(e=>e.cards.map(o=>({...o,chapter:e.chapter})));s.sort((e,o)=>e.rank-o.rank||e.chapter-o.chapter||e.card-o.card);for(const e of s.slice(0,24)){const n=(e.since||"").slice(0,10);console.log(chalk.white(` ${e.icon} `)+chalk.gray(`Ch${e.chapter} · `)+chalk.white(o?`第 ${e.card} 张`:`card ${e.card}`)+chalk.gray(` · ${e.score}`)+(n?chalk.gray(o?` · 始于 ${n}`:` · since ${n}`):""))}s.length>24&&console.log(chalk.gray(o?` …还有 ${s.length-24} 枚`:` …and ${s.length-24} more`)),console.log(chalk.gray(" ─────────────────────────────────────────"))}export function renderKnowledgeCard(t,r){const d=c(),h=o(t,d);p(h,r),f();const y=wrapMixed(h.title,i()-4);for(const e of y)b(chalk.bold.yellow(e));b(chalk.gray("─".repeat(Math.min(Math.max(...y.map(o=>e(o))),i()))));const u=!!(t.chart_ids&&t.chart_ids.length>0);if(u&&l(t.chart_ids.slice(0,1),r.charts,a()),h.key_point&&""!==h.key_point.trim()?(u||f(),function(e,o,n){const t=c().startsWith("zh"),r=a().cols,l="-".repeat(Math.min(i(),Math.max(24,r-6))),s=t?"要点":"KEY POINT",g=t?`第 ${o} / ${n} 张`:`Card ${o} / ${n}`;console.log(chalk.cyan(" │ ")+chalk.green(l)),console.log(chalk.cyan(" │ ")+chalk.green(`${s} · ${g}`));for(const o of wrapMixed(e,i()-4))console.log(chalk.cyan(" │ ")+chalk.bold.green(" "+o));console.log(chalk.cyan(" │ ")+chalk.green(l)),f()}(h.key_point,h.number,r.totalCards)):u||f(),h.body.filter(e=>null!=e&&""!==e.trim()).forEach((e,o)=>{const n=0===o?e.match(/^([\s\S]*?(?:[.!?](?=\s|$)|[。!?]))(\s[\s\S]*)?$/):null;if(n&&n[1].trim().length<=180){C(n[1],!0);const e=n[2]?.trimStart();e&&C(e,!1)}else C(e,!1);f()}),h.icoaConnection){b(chalk.magenta(" "+n("icoa_connection",d))),b(chalk.gray(" "+"─".repeat(20)));for(const e of wrapMixed(h.icoaConnection,i()-4))b(" "+chalk.magenta(e));f()}if(t.check){const e=d.startsWith("zh"),o=t._zh?.checkStatement??t._zh?.check?.statement,n=e?o??t.check.statement:t.check.statement;for(const o of wrapMixed(e?"请回答 (输 y 或 n):":"Quick comprehension check (type y or n):",i()-8))b(chalk.cyan(" 🤔 "+o));b(chalk.gray(" "+"─".repeat(20)));for(const e of wrapMixed(n,i()-4))b(" "+chalk.white(e));f()}m(),function(o,n){const t=c().startsWith("zh"),r=a().cols,l="-".repeat(Math.min(i(),Math.max(24,r-6))),d=chalk.gray(" ");if("minimal"===P){const e=L?L(o.number):null;console.log(chalk.gray(" "+l)),console.log(chalk.gray(" "+(t?`第 ${o.number} / ${n.totalCards} 张`:`Card ${o.number} / ${n.totalCards}`))+(e?chalk.gray(t?" · 本卡练习 ":" · practice ")+e:""));const r=[];if(o.check?(r.push(chalk.bold.green("[y]")+chalk.gray(t?" 是":" yes")),r.push(chalk.bold.green("[n]")+chalk.gray(t?" 否":" no"))):r.push(chalk.bold.green("[ok]")+chalk.gray(t?" 下一张":" next")),e){const o=Math.max(1,(e.match(/\[\d\]/g)??[]).length),n=Array.from({length:o},(e,o)=>`[${o+1}]`).join("");r.push(chalk.bold.cyan(n)+chalk.gray(t?" 练习":" practice"))}return N&&r.push(chalk.bold.magenta("[sh]")+chalk.gray(t?" 实验台":" shell")),o.flow&&o.flow.length>0&&r.push(chalk.bold.magenta("[flow]")+chalk.gray(t?" 互动走一遍":" walk it")),r.push(chalk.bold.cyan("[b]")+chalk.gray(t?" 上一张":" back")),r.push(chalk.bold.yellow("[e]")+chalk.gray(t?" 求助":" help")),r.push(chalk.gray("[quit]")+(t?chalk.gray(" 退出"):"")),console.log(" "+r.join(d)),E(),void console.log()}const h=[];o.check?(h.push(chalk.bold.green("[y]")+chalk.gray(t?" 是":" yes")),h.push(chalk.bold.green("[n]")+chalk.gray(t?" 否":" no"))):h.push(chalk.bold.green("[ok]")+chalk.gray(t?" 继续":" next")),o.flow&&o.flow.length>0&&h.push(chalk.bold.magenta("[flow]")+chalk.gray(t?" 互动走一遍":" walk it")),M&&(h.push(chalk.bold.magenta("[/ai]")+chalk.gray(t?" 🐼 熊猫导师":" 🐼 Panda tutor")),h.push(chalk.bold.magenta("[/submit]")+chalk.gray(t?" 提问评分":" prompt score")));const y=W.get(o.number);var u;h.push(chalk.bold.magenta(y?`[/honors ${u=y,A[u-1]??`#${u}`}]`:"[/honors]")+chalk.gray(t?" 排行":" board")),"normal"===g?h.push(chalk.bold.cyan("[wide]")+chalk.gray(t?" 宽屏":" widen")):("wide"===g?h.push(chalk.bold.cyan("[wider]")+chalk.gray(t?" 更宽":" wider")):"wider"===g?(h.push(chalk.bold.cyan("[widest]")+chalk.gray(t?" 最宽":" widest")),h.push(chalk.bold.cyan("[wide]")+chalk.gray(t?" 回宽屏":" back to wide"))):h.push(chalk.bold.cyan("[wider]")+chalk.gray(t?" 回 wider":" back to wider")),h.push(chalk.bold.cyan("[normal]")+chalk.gray(t?" 标准":" standard")));const p=s(j,z,o.number,t),m=p.startsWith("💬");if(h.push((m?chalk.bold.yellow("[r]"):chalk.gray("[r]"))+(m?chalk.bold.white(` ${p}`):chalk.gray(` ${p}`))),h.push(chalk.bold.yellow("[e]")+chalk.gray(t?" 提问或报告":" ask or report")),R){const e=R,o=`${e.done}/${e.total}`,n=e.completedAt?chalk.bold.green:chalk.bold.cyan;h.push(n("[task]")+chalk.gray(t?` 本周 ${o}`:` week ${o}`))}h.push(chalk.bold.cyan("[b]")+chalk.gray(t?" 上一张":" back")),h.push(chalk.bold.cyan("[card N]")+chalk.gray(t?" 跳转":" jump")),h.push(chalk.gray("[reload]")+(t?chalk.gray(" 刷新"):"")),h.push(chalk.gray("[quit]")+(t?chalk.gray(" 退出"):""));const b=e(l);console.log(chalk.gray(" "+l)),console.log(chalk.gray(" "+(t?`第 ${o.number} / ${n.totalCards} 张`:`Card ${o.number} / ${n.totalCards}`)));let f="",$=0;for(const o of h){const n=e(o);f&&$+2+n>b?(console.log(" "+f),f=o,$=n):(f=f?f+d+o:o,$=f===o?n:$+2+n)}f&&console.log(" "+f),console.log(" "+chalk.magenta("✍ ")+chalk.magenta("[/py]")+chalk.gray(t?" Python 草稿本":" Python scratchpad")+d+chalk.magenta("[/pylist]")+chalk.gray(t?" 我的草稿":" my files")),console.log(chalk.gray(" "+l));const w=[t?"e = 就这张卡提问,或报告问题":"e = ask about this card, or report a problem",t?"更多: bookmark / unbookmark · status · lang zh/en · link":"more: bookmark / unbookmark · status · lang zh/en · link"];for(const e of w)for(const o of wrapMixed(e,b))console.log(chalk.gray(" "+o));E(),console.log()}(t,r)}export function renderCheckFeedback(e,o,n,t=!1){const r=c().startsWith("zh");if(console.log(),n)console.log(chalk.green(" ✓ ")+chalk.white(r?"答对了。":"Correct."));else if(console.log(chalk.yellow(" ✗ ")+chalk.white(r?"记下了,继续。":"Noted — moving on.")),t){const o="y"===e.check?.answer?r?"是":"Yes":r?"否":"No";console.log(chalk.gray(" "+(r?"正确答案: ":"Answer: ")+o+". "+(r?"回看上面那段。":"Re-read the paragraph above.")))}const l=r?e._zh?.solution??e.solution:e.solution;if(l&&l.length>0){console.log(),console.log(chalk.cyan(" 📝 "+(r?"解答:":"Worked solution:")));for(const e of l){for(const o of wrapMixed(e,i()-4))console.log(chalk.white(" "+o));console.log()}}console.log()}function O(e){return[chalk.white(" "+(e?"编著:Charlie Zhu":"Created & edited by Charlie Zhu")),chalk.gray(" "+(e?"ICOA 2026 创始人 · 课程总架构师":"Founder & Chief Curriculum Architect · ICOA 2026"))]}export function renderPhaseComplete(e,o,n,t,l,a){const s=c().startsWith("zh"),[g,d]=n.cardRange,h=o.checkResults||{};let y=0,u=0;for(let e=g;e<=d;e++){const o=h[String(e)];o&&(y++,o.correct&&u++)}const p="-".repeat(48);console.log();for(const e of r(" "))console.log(e);console.log(),console.log(chalk.bold.yellow(" "+p)),console.log(chalk.bold.yellow(" "+(s?`阶段 ${n.number} 完成`:`Phase ${n.number} complete`))+chalk.gray(" · ")+chalk.white(n.name));const m=y>0&&u===y?chalk.bold.green:chalk.bold.white;console.log(chalk.gray(" "+(s?"理解检查得分: ":"comprehension score: "))+m(`${u}/${y}`)+chalk.gray(0===y?s?" (本阶段未作答 y/n)":" (no y/n answered)":""));const b=String(d).length;let f=!1,$=0,w=0,_=0,k=0;for(let o=g;o<=d;o++){const n=e.cards.find(e=>e.number===o);if(!n)continue;const t=n,r=t.title??t.badge??"",l=(s?t._zh?.title??t._zh?.badge??r:r)||"",a=null!=n.check,c=h[String(o)];let g;g=c?c.correct?chalk.green("✓"):chalk.red("✗"):a?chalk.gray("○"):chalk.gray("·");const d=T?T(o):null;d&&(f=!0);const y=d?(d.solved>=d.total?chalk.green:d.solved>0?chalk.yellow:chalk.gray)(` ⚔${d.solved}/${d.total}`):"";d&&($++,d.solved>=d.total&&w++,_+=d.solved,k+=d.total);const u=wrapMixed(l,i()-10-b-(d?6:0)),p=u[0]+(u.length>1?"…":"");console.log(chalk.gray(` ${String(o).padStart(b)} `)+g+y+chalk.white(" "+p))}if(console.log(chalk.gray(s?" ✓ 答对 · ✗ 答错 · ○ 未作答 · 无 y/n 的卡不计分":" ✓ correct · ✗ wrong · ○ unanswered · cards without a y/n are unscored")),f&&console.log(chalk.bold.cyan(" ⚔ "+(s?"卡片练习: ":"practice: "))+(w>=$?chalk.bold.green:chalk.bold.white)(`${w}/${$}`)+chalk.gray(s?` 卡全完成 · ${_}/${k} 题 AC · 行内 ⚔已过/共(绿 完成 · 黄 部分 · 灰 未碰)`:` cards complete · ${_}/${k} problems AC · ⚔solved/total per row (green done · yellow partial · gray untouched)`)),l){const e=e=>"green"===e?chalk.bold.green:"blue"===e?chalk.bold.cyan:"yellow"===e?chalk.bold.yellow:chalk.bold.red;console.log(chalk.bold.magenta(" ⭐ "+(s?"提问得分 (best): ":"Prompt scores (best): "))+(0===l.length?chalk.gray(s?"本阶段尚未提问 — 用 /ai 研究,再 /submit 评分":"none this phase — research with /ai, then /submit"):l.map(o=>chalk.gray((s?"卡":"#")+o.card+" ")+e(o.tier)(String(o.score))).join(chalk.gray(" · "))))}if(a&&!a.configured){const o=d-g+1>12,n="fill"===e.practiceMode;console.log(chalk.gray(o?s?" 🔒 本阶段通关标准制作中 — 很快更新(360 层第二阶段标准设计中)":" 🔒 Pass criteria for this phase are in production — coming soon (360-tier second-stage standard in design)":n?s?" 🔒 本阶段 3 场判分赛制作中 — 很快更新;赛场挂在卡 4 / 8 / 12,3 场全过解锁下一阶段(本轨无 research)":" 🔒 This phase’s 3 judged arenas are in production — coming soon; they hang on cards 4 / 8 / 12 and all 3 unlock the next phase (no research on this track)":s?" 🔒 本阶段通关标准制作中 — 很快更新(标准范式:3 场练习赛 + 3 卡研究)":" 🔒 Pass criteria for this phase are in production — coming soon (standard: 3 arenas + 3 research cards)"))}if(a?.configured&&a.contest){const e=a.contest;if(e.slots&&e.slots.length>0)for(const o of e.slots){const e=chalk.bold.cyan(` ⚔ ${s?"练习赛":"arena"} ${n.number}-${o.slot}: `);o.passed?console.log(e+chalk.bold.green(`${o.best_ac}/${o.n} AC ✅`)):0===o.attempts?console.log(e+chalk.white(s?`${o.n} 题 · 过 ${o.need} 题 — `:`${o.n} problems · AC ${o.need} — `)+chalk.bold.green(`contest ${o.slot}`)):console.log(e+chalk.yellow(s?`最好 ${o.best_ac}/${o.n}(需 ${o.need})· 已试 ${o.attempts} 次 — `:`best ${o.best_ac}/${o.n} (need ${o.need}) · ${o.attempts} attempt(s) — `)+chalk.bold.green(`contest ${o.slot}`))}else{const o=chalk.bold.cyan(" ⚖ "+(s?"判分赛: ":"Contest: "));e.passed?console.log(o+chalk.bold.green(`${e.best_ac}/${e.n} AC ✅ `+(s?"已过关":"passed"))):0===e.attempts?console.log(o+chalk.white(s?`${e.n} 题 · 过 ${e.need} 题解锁 — 输入 `:`${e.n} problems · AC ${e.need} to pass — type `)+chalk.bold.green("contest")+chalk.white(s?" 开始":" to start")):console.log(o+chalk.yellow(s?`最好 ${e.best_ac}/${e.n} AC(需 ${e.need})· 已试 ${e.attempts} 次 — 输入 `:`best ${e.best_ac}/${e.n} AC (need ${e.need}) · ${e.attempts} attempt(s) — type `)+chalk.bold.green("contest")+chalk.yellow(s?" 再战":" to retry"))}}t&&console.log(chalk.gray(" "+(s?"下一阶段: ":"next: "))+chalk.bold.cyan(s?`阶段 ${t.number}`:`Phase ${t.number}`)+chalk.gray(" · ")+chalk.white(t.name)),console.log(chalk.bold.yellow(" "+p));for(const e of O(s))console.log(e)}export function renderCurriculumComplete(e,o){const n=c().startsWith("zh"),t=o.checkResults||{},l="-".repeat(48);let a=0,s=0;console.log();for(const e of r(" "))console.log(e);console.log(),console.log(chalk.bold.green(" "+l)),console.log(chalk.bold.green(" 🏆 "+(n?`${e.name} — 全部完成!`:`${e.name} — complete!`))),console.log(chalk.bold.green(" "+l));for(const o of e.modules){const[e,r]=o.cardRange;let l=0,c=0;for(let o=e;o<=r;o++){const e=t[String(o)];e&&(l++,e.correct&&c++)}a+=l,s+=c;const g=l>0&&c===l?chalk.green:chalk.white;console.log(chalk.gray(" "+(n?`阶段 ${o.number}`:`Phase ${o.number}`).padEnd(8))+g(`${c}/${l}`.padEnd(7))+chalk.gray(o.name))}console.log(chalk.bold.green(" "+l)),console.log(chalk.bold.green(" "+(n?"总分 / overall: ":"Overall: "))+chalk.bold.white(`${s}/${a}`)),console.log(chalk.bold.green(" "+l));for(const e of O(n))console.log(e);console.log()}export function renderMCQCard(e,t){const r=c(),l=o(e,r);p(l,t),f(),b(chalk.bold.yellow("🎯 "+l.title)),b(chalk.gray("─".repeat(Math.min(l.title.length+4,i())))),f();for(const e of v(l.question,i()-4))b(" "+e);f();for(const e of["A","B","C","D"])b(chalk.cyan(` ${e}.`)+" "+chalk.white(l.options[e]));f(),m(),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(" "+n("type_to_answer",r))),console.log(chalk.gray(" ")+chalk.bold.cyan("back")+chalk.gray(r.startsWith("zh")?" 上一张 · ":" previous card · ")+chalk.bold.cyan("card N")+chalk.gray(r.startsWith("zh")?" 跳转":" jump")),console.log()}export function renderMCQFeedback(e,t,r,l){const a=c(),s=o(e,a);console.log(),r?console.log(" "+chalk.bold.green(n("correct",a)+" ")+chalk.gray(`${n("one_point",a)} · ${t} = ${s.options[t]}`)):console.log(" "+chalk.bold.red(n("not_quite",a)+" ")+chalk.gray(`${n("you_chose",a)} ${t}; ${n("answer_is",a)} ${s.answer}.`)),console.log(),console.log(chalk.gray(" "+n("explanation",a)));for(const e of v(s.explanation,i()-4))console.log(chalk.gray(" "+e));const g=Object.values(l.mcqResults),d=g.filter(e=>e.correct).length;console.log(),console.log(chalk.gray(" "+n("mcq_accuracy_so_far",a)+" ")+chalk.white(`${d}/${g.length}`)),console.log(),r||(console.log(chalk.gray(" "+n("press_ok_continue",a)+" ")+chalk.bold.green("ok")+chalk.gray(" "+n("to_continue",a))),console.log())}export function renderPracticalCard(e,t){const r=c(),l=o(e,r);p(l,t),f(),b(chalk.bold.yellow("🛠 "+l.title)),b(chalk.gray("─".repeat(Math.min(l.title.length+4,i())))),f();for(const e of v(l.task,i()-4))b(" "+e);if(l.starterCode){f(),b(chalk.gray(" "+n("starter_code",r))),f();for(const e of l.starterCode.split("\n"))b(" "+chalk.cyan(e))}f(),m(),console.log(chalk.gray(" "+n("try_in_sandbox",r)+" ")+chalk.bold.cyan("!python3")+chalk.gray(" "+n("drops_into_python",r))),console.log(chalk.gray(" "+n("when_done",r))),console.log(chalk.gray(" ")+chalk.bold.green("done")+chalk.gray(" "+n("done_desc",r))),console.log(chalk.gray(" ")+chalk.bold.yellow("skip")+chalk.gray(" "+n("skip_desc",r))),console.log(chalk.gray(" back previous card")),console.log(chalk.gray(" card N jump to a card by number")),console.log()}export function renderPracticalSuccess(e){const t=c(),r=o(e,t);console.log(),console.log(" "+chalk.bold.green(n("practical_recorded",t))),console.log(),console.log(chalk.gray(" "+n("reference_answer",t)));for(const e of v(r.successHint,i()-4))console.log(chalk.gray(" "+e));console.log(),console.log(chalk.gray(" "+n("press_ok_continue",t)+" ")+chalk.bold.green("ok")+chalk.gray(" "+n("to_continue",t))),console.log()}export function renderSimDemoCard(e,t){const r=c(),l=o(e,r);p(l,t),f(),b(chalk.bold.yellow("🎬 "+l.title)),f();for(const e of v(l.description,i()-4))b(" "+e);f(),b(chalk.gray(" "+n("sim_requires",r))),f(),m(),console.log(chalk.gray(" ")+chalk.bold.cyan("sim")+chalk.gray(" "+n("sim_launch_desc",r))),console.log(chalk.gray(" ")+chalk.bold.green("ok")+chalk.gray(" / ")+chalk.bold.green("next")+chalk.gray(" "+n("continue_to_next",r))),console.log(chalk.gray(" bookmark "+n("bookmark_desc",r))),console.log(chalk.gray(" back "+n("back_desc",r))),console.log(chalk.gray(" back previous card")),console.log(chalk.gray(" card N jump to a card by number")),console.log(chalk.gray(" quit "+n("quit_desc",r))),console.log()}export function renderArenaTaskCard(e,n){const t=c(),r=t.startsWith("zh"),l=o(e,t);p(l,n),f(),b(chalk.bold.cyan("🏟 "+l.title)),b(chalk.gray(" "+l.origin+" · "+l.domain+" · "+l.metric)),f();for(const e of l.statement){for(const o of v(e,i()-4))b(" "+o);f()}b(chalk.bold.green(r?" 核心要点 — baseline → 解法的关键变化":" CORE DELTA — baseline → solution"));for(const e of l.core_delta)for(const o of v("• "+e,i()-6))b(" "+chalk.white(o));f(),b(chalk.gray((r?" 提交格式: ":" Submission: ")+l.submission_format)),l.hints&&b(chalk.gray(r?" 本题有 5 级提示 (a–e),进入 arena 后逐级解锁。":" 5 progressive hints (a–e) unlock inside the arena.")),f(),m(),console.log(chalk.gray(" ")+chalk.bold.cyan("arena "+l.task_id)+chalk.gray(r?" 动手做这道题(下载 / 提示 / 提交 / 榜单)":" open the arena (download / hints / submit / board)")),console.log(chalk.gray(" ")+chalk.bold.green("ok")+chalk.gray(" / ")+chalk.bold.green("next")+chalk.gray(r?" 继续下一张":" continue to next")),console.log(chalk.gray(" back "+(r?"上一张":"previous"))),console.log(chalk.gray(" back previous card")),console.log(chalk.gray(" card N jump to a card by number")),console.log(chalk.gray(" quit "+(r?"退出":"exit"))),console.log()}export function renderComingSoonCard(e,n){const t=c(),r=t.startsWith("zh"),l=o(e,t);p(l,n),f(),b(chalk.bold.yellow("🔜 "+l.title)),f();const a=l.note||(r?"这道竞技场题目正在编写中,敬请期待。":"This arena task is coming soon.");for(const e of v(a,i()-4))b(" "+chalk.gray(e));f(),m(),console.log(chalk.gray(" ")+chalk.bold.green("ok")+chalk.gray(" / ")+chalk.bold.green("next")+chalk.gray(r?" 继续":" continue")),console.log(chalk.gray(" back previous card")),console.log(chalk.gray(" card N jump to a card by number")),console.log(chalk.gray(" quit "+(r?"退出":"exit"))),console.log()}export function renderMilestone(e,t){const r=c(),l=o(e,r),a=e.number===t.totalCards;console.log(),console.log(chalk.bold.yellow(" ╭"+d("═"))),console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+chalk.white(" "+n("milestone_header",r))),console.log(chalk.bold.yellow(" ║"));const s=` ${l.badge} ${l.emoji}`;console.log(chalk.bold.yellow(" ║ ")+chalk.bold.green(s)),console.log(chalk.bold.yellow(" ║ ")+chalk.gray(" ─".repeat(Math.max(1,Math.floor(l.badge.length/2+2))))),console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+" "+chalk.gray(n("in_wild_corresponds",r)));for(const e of v(l.realWorldLevel,i()-4))console.log(chalk.bold.yellow(" ║ ")+" "+chalk.white(e));console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+" "+chalk.gray(n("whats_next",r)));for(const e of v(l.unlockedNext,i()-4))console.log(chalk.bold.yellow(" ║ ")+" "+chalk.white(e));console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ╰"+d("═"))),console.log(),a?(console.log(chalk.gray(" "+n("demo_complete",r))),console.log(),console.log(chalk.gray(" "+n("unlock_full",r)+" ")+chalk.white(n("curriculum_name",r))+chalk.gray(",")),console.log(chalk.gray(" "+n("contact_team_leader",r)+" ")+chalk.bold.yellow("EA")+chalk.gray(" "+n("learn_token",r))),console.log(chalk.gray(" "+n("or_email",r)+" ")+chalk.cyan("australia@icoa2026.au")+chalk.gray(" "+n("for_partnership",r))),console.log(),console.log(chalk.gray(" "+n("type_quit",r)+" ")+chalk.bold.green("quit")+chalk.gray(" "+n("to_exit",r)+" ")+chalk.bold.green("status")+chalk.gray(" "+n("for_dashboard",r)))):(console.log(chalk.gray(" ")+chalk.bold.green("ok")+chalk.gray(" / ")+chalk.bold.green("next")+chalk.gray(" "+n("continue_to_next",r))),console.log(chalk.gray(" status "+n("status_full",r))),console.log(chalk.gray(" back previous card")),console.log(chalk.gray(" card N jump to a card by number")),console.log(chalk.gray(" quit "+n("quit_desc",r)))),console.log()}export function renderStatus(o,t,r={}){const l=c(),a=l.startsWith("zh"),s=t.cardsCompleted.length,g=o.totalCards,d=t.checkResults||{},p=r.gate??null,$=!!r.gated,w=r.focus??"current",_=r.posForSlot??(e=>4===e?10:4*e),k=t.currentCard,x=o.modules.find(e=>k>=e.cardRange[0]&&k<=e.cardRange[1]),C=(o,n)=>o+" ".repeat(Math.max(0,n-e((e=>e.replace(/\x1b\[[0-9;]*m/g,""))(o))));console.log();const v=`${o.name} — ${a?"状态":"Status"}`;console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(v)+" "+chalk.cyan("─".repeat(Math.max(4,i()-2-e(v))))),f(),b(" "+chalk.gray(n("total_progress",l)+" ")+y(s,g)+chalk.gray(` (${s}/${g})`)+chalk.gray(" "+n("streak",l)+" ")+u(t.streakDays));{let n=0,l=0,s=0,c=0,g=0,h=0,y=!1;for(const e of o.modules){for(let t=e.cardRange[0];t<=e.cardRange[1];t++){const e=T?T(t):null;e&&(n++,e.solved>=e.total&&l++);const r=o.cards.find(e=>e.number===t);null!=r?.check&&(s++,d[String(t)]?.correct&&c++)}const t=p?.phases.find(o=>o.phase===e.number);if(t?.configured)for(const e of t.contest?.slots??[])g++,e.passed&&h++;t?.research&&(y=!0)}const u=(e,o)=>(e>=o?chalk.green:chalk.white)(`${e}/${o}`),m=[];n&&m.push(chalk.gray(a?"⚔ 练习卡 ":"⚔ practice cards ")+u(l,n)),g&&m.push(chalk.gray(a?"赛场 ":"arena ")+u(h,g)),s&&m.push(chalk.gray(a?"✓ 自测 ":"✓ checks ")+u(c,s)),m.length&&b(" "+m.join(chalk.gray(" "))),r._anyResearch=y;{let n=0;const r=[];let l=0,c=0,y=0;for(const e of o.modules)for(let a=e.cardRange[0];a<=e.cardRange[1];a++){c++,t.cardsCompleted.includes(a)&&l++;const e=o.cards.find(e=>e.number===a);null!=e?.check&&d[String(a)]&&y++;const s=T?T(a):null;s&&s.solved<s.total&&(n+=s.total-s.solved,r.push(a))}const u=a?"▸ 通关还差 ":"▸ to finish ",p=[];if(l<c&&p.push(chalk.gray(a?"卡片 ":"cards ")+chalk.white(""+(c-l))+chalk.gray(a?" 张未读":" unread")),s&&y<s&&p.push(chalk.gray("✓ ")+chalk.white(""+(s-y))+chalk.gray(a?" 题自测未答":" checks unanswered")),n>0){const o=a?`练习还差 ${n} 题`:`${n} practice problem${n>1?"s":""}`,t=a?"(卡 ":" (cards ",l=")",s=" │ ⚔ ",c=i()-e(s)-e(u)-e(o)-e(t+l),g=e=>{const o=[];let n=0;for(const t of r){const r=String(t).length+(o.length?3:0);if(n+r>e)break;n+=r,o.push(t)}return o};let d=g(c);d.length<r.length&&(d=g(c-e(` +${r.length}`))),!d.length&&r.length&&(d=[r[0]]);const h=r.length-d.length,y=d.join(" · ")+(h>0?` +${h}`:"");p.push(chalk.gray("⚔ ")+chalk.white(o)+chalk.gray(t+y+l))}g&&h<g&&p.push(chalk.gray(a?"赛 ":"arena ")+chalk.white(""+(g-h))+chalk.gray(a?" 场未过":" to pass"));const m=l>0;m&&p.length?p.forEach((o,n)=>b(" "+(0===n?chalk.bold.yellow(u):" ".repeat(e(u)))+o)):m&&!p.length&&b(" "+chalk.bold.green(a?"✅ 通关条件已全部达成":"✅ every completion gate met"))}}f();const M=e=>a?`阶段 ${e}`:`Phase ${e}`,S=Math.max(10,Math.min(28,i()-54));for(const e of o.modules){const[n,r]=e.cardRange,l=r-n+1,s=t.cardsCompleted.filter(e=>e>=n&&e<=r).length,c=$&&!!p&&e.number>p.unlocked_through_phase,g=p?.phases.find(o=>o.phase===e.number);let y=0,u=0,m=0;const f=[],v=[];let W=0,A=0,j=0;const z=[];for(let e=n;e<=r;e++){const n=o.cards.find(o=>o.number===e);if(null!=n?.check){y++;const o=d[String(e)];o?(u++,o.correct?m++:v.push(e)):f.push(e)}const t=T?T(e):null;t&&(W++,j+=t.solved,t.solved>=t.total?A++:z.push(`${e}:${t.solved}/${t.total}`))}const R=g?.configured?g.contest?.slots??[]:[],P=e=>e.passed?chalk.green("✅"):e.attempts>0?chalk.yellow("❌"):chalk.gray("⬜"),q=s>=l&&(0===y||m===y)&&(0===W||A===W)&&(0===R.length||R.every(e=>e.passed))&&(!g?.research||g.research.passed),E=s>0||u>0||j>0||R.some(e=>e.attempts>0),L=c?chalk.gray("🔒"):q?chalk.green("✅"):e.number===x?.number?chalk.bold.cyan("▶ "):E?chalk.yellow("▶ "):chalk.gray("⬜"),N=h(e.name,S),O=[];if(O.push((s>=l?chalk.green:chalk.white)(`${s}/${l}`)+chalk.gray(a?"卡":"c")),y>0&&O.push(chalk.gray("✓")+(m===y?chalk.green:chalk.white)(`${m}/${y}`)),W>0&&O.push(chalk.gray("⚔")+(A===W?chalk.green:chalk.white)(`${A}/${W}`)+chalk.gray(a?"卡":"c")),R.length>0&&O.push(chalk.gray(a?"赛":"arena ")+R.map(P).join("")),g?.research&&O.push(chalk.gray("⭐")+(g.research.passed?chalk.green:chalk.white)(`${g.research.good_cards}/${g.research.need_cards}`)),b(" "+L+" "+chalk.white(C(M(e.number),a?5:8))+chalk.gray(C(N,S+1))+O.join(chalk.gray(" · "))),c||"all"!==w&&w!==e.number&&("current"!==w||e.number!==x?.number)){if(!c&&E&&!q){const o=[],t=R.filter(e=>!e.passed).map(o=>(o.attempts>0?chalk.yellow:chalk.gray)(`${e.number}-${o.slot}@${a?"卡":"card "}${n+_(o.slot)-1}`));t.length&&o.push(chalk.gray(a?"赛 ":"arena ")+t.join(chalk.gray(" · ")));const r=(e,o)=>e.slice(0,8).join(o)+(e.length>8?chalk.gray(" +"+(e.length-8)):"");z.length&&o.push(chalk.gray("⚔ ")+chalk.white(r(z," "))),v.length&&o.push(chalk.red("✗ ")+chalk.white(r(v.map(String),","))),f.length&&o.push(chalk.gray("○ ")+chalk.white(r(f.map(String),","))),g?.research&&!g.research.passed&&o.push(chalk.gray(`⭐ ${g.research.good_cards}/${g.research.need_cards}`)),o.forEach((e,o)=>b(chalk.gray(0===o?a?" 待办: ":" todo: ":" ")+e))}}else{const t=String(r).length;for(let s=n;s<=r;s++){const r=o.cards.find(e=>e.number===s);if(!r)continue;const c=r,g=c.title??c.badge??"",h=(a?c._zh?.title??c._zh?.badge??g:g)||"",y=null!=r.check,u=d[String(s)],p=u?u.correct?chalk.green("✓"):chalk.red("✗"):y?chalk.gray("○"):chalk.gray("·"),m=T?T(s):null,f=m?(m.solved>=m.total?chalk.green:m.solved>0?chalk.yellow:chalk.gray)(`⚔${m.solved}/${m.total}`):" ",$=s===k?chalk.bold.cyan("▶"):" ",w=wrapMixed(h,Math.max(16,i()-14-t)),x=w[0]+(w.length>1?"…":"");b(` ${$} `+chalk.gray(String(s).padStart(t))+" "+p+" "+C(f,5)+" "+chalk.white(x));const v=12===l?R.find(e=>n+_(e.slot)-1===s):void 0;if(v){const o=chalk.gray(` ${" ".repeat(t)} ⚔ ${a?"练习赛":"arena"} ${e.number}-${v.slot}: `);v.passed?b(o+chalk.bold.green(`${v.best_ac}/${v.n} AC ✅`)):0===v.attempts?b(o+chalk.gray("⬜ ")+chalk.white(a?`未开始 · ${v.n} 题 · 过 ${v.need} 题 → `:`not started · ${v.n} problems · AC ${v.need} → `)+chalk.bold.green(`contest ${v.slot}`)):b(o+chalk.yellow(a?`❌ 最好 ${v.best_ac}/${v.n}(需 ${v.need})· 已试 ${v.attempts} 次 → `:`❌ best ${v.best_ac}/${v.n} (need ${v.need}) · ${v.attempts} attempt(s) → `)+chalk.bold.green(`contest ${v.slot}`))}}if(12!==l)for(const o of R){const n=chalk.gray(` ⚔ ${a?"练习赛":"arena"} ${e.number}-${o.slot}: `);o.passed?b(n+chalk.bold.green(`${o.best_ac}/${o.n} AC ✅`)):0===o.attempts?b(n+chalk.gray("⬜ ")+chalk.white(a?`未开始 · ${o.n} 题 · 过 ${o.need} 题 → `:`not started · ${o.n} problems · AC ${o.need} → `)+chalk.bold.green(`contest ${o.slot}`)):b(n+chalk.yellow(a?`❌ 最好 ${o.best_ac}/${o.n}(需 ${o.need})· 已试 ${o.attempts} 次 → `:`❌ best ${o.best_ac}/${o.n} (need ${o.need}) · ${o.attempts} attempt(s) → `)+chalk.bold.green(`contest ${o.slot}`))}g?.research&&!g.research.passed&&b(chalk.gray(a?` ⭐ 研究: ${g.research.good_cards}/${g.research.need_cards} 卡达 ${g.research.min_score} 分 — /ai 研究后 /submit`:` ⭐ research: ${g.research.good_cards}/${g.research.need_cards} cards at ${g.research.min_score}+ — /ai then /submit`)),g&&!g.configured&&b(chalk.gray(a?" 🔒 本阶段通关标准制作中 — 很快更新":" 🔒 pass criteria for this phase in production — coming soon"))}}f(),b(chalk.gray(a?" ✓ 答对 ✗ 答错 ○ 未答 · ⚔ 练习 已过/共 · 赛 ✅ 过 ❌ 试过 ⬜ 未碰"+(r._anyResearch?" · ⭐ 研究":""):" ✓ right ✗ wrong ○ unanswered · ⚔ practice solved/total"+(r._anyResearch?" · ⭐ research":""))),b(chalk.gray(a?" 展开某阶段: ":" arena ✅ passed ❌ tried ⬜ untouched · expand: ")+chalk.bold.green("status all")+chalk.gray(" / ")+chalk.bold.green("status N")),t.achievements.length>0&&b(" "+chalk.gray(n("achievements",l)+" ")+t.achievements.map(e=>chalk.bold.yellow("★ ")+chalk.white(e)).join(chalk.gray(" · "))),f(),m()}function F(e){try{Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)}catch{}}export function renderArenaIntro(){const e=c().startsWith("zh"),o=!!process.stdout.isTTY&&!/^(C|POSIX)$/i.test(process.env.LANG||"")&&!process.env.ICOA_TEST_BOOT_MODE,n=e?[chalk.bold.yellow(" ⚔ 你读完 4 张卡了 — 前面是第一个检查点。"),chalk.white(" ⚔ 每 4 张卡有一场判分赛:")+chalk.bold.yellow("卡 4 / 8 / 12")+chalk.white(",一个阶段共 3 场。"),chalk.white(" · 敲 ")+chalk.bold.green("contest 1")+chalk.white(" 开始 — 计时器同时开始,题目在赛场里读。"),chalk.white(" · 判分机会真的跑你的代码,不是对答案。"),chalk.white(" · 3 场全过 → 解锁下一阶段。"),chalk.gray(" ▸ 现在不想打?敲 ")+chalk.bold.green("next")+chalk.gray(" 继续读卡,赛场一直在那儿等你。")]:[chalk.bold.yellow(" ⚔ Four cards down — a checkpoint is waiting."),chalk.white(" ⚔ Every 4 cards there is a judged arena: ")+chalk.bold.yellow("cards 4 / 8 / 12")+chalk.white(", three per phase."),chalk.white(" · Type ")+chalk.bold.green("contest 1")+chalk.white(" to start — the clock starts with it; the problems are read inside."),chalk.white(" · The judge really runs your code. It is not an answer key."),chalk.white(" · Pass all three → the next phase unlocks."),chalk.gray(" ▸ Not now? Type ")+chalk.bold.green("next")+chalk.gray(" and keep reading — the arena waits for you.")];console.log();for(const e of n)console.log(e),o&&F(200);console.log()}
1
+ import chalk from"chalk";import e from"string-width";import{localized as o}from"./learn-curricula.js";import{t as n}from"./learn-i18n.js";import{getConfig as t}from"./config.js";import{icoaBannerLines as r}from"./banner.js";import{renderCharts as l,detectCaps as a}from"./render-card.js";import{replyChipLabel as s}from"./learn-replies.js";function c(){return(t().language||"en").toLowerCase()}let g="normal";export function resolveLearnWidth(e){return"normal"===e.learnWidth||"wide"===e.learnWidth||"wider"===e.learnWidth||"widest"===e.learnWidth?e.learnWidth:e.learnWide?"wide":"normal"}export function setLearnWidth(e){g=e}export function learnWidthCap(e=g){return"widest"===e?160:"wider"===e?120:"wide"===e?96:64}export function learnW(){const e=process.stdout.columns||69,o=Math.max(40,Math.min(64,e-5));return"normal"===g?o:Math.max(o,Math.min(e-6,learnWidthCap()))}const i=learnW;function d(e="─"){return e.repeat(i()+2)}function h(o,n){if(e(o)<=n)return o;let t=o;for(;t.length>0&&e(t)>Math.max(1,n-1);)t=t.slice(0,-1);return t.trimEnd()+"…"}function y(e,o,n=20){const t=o>0?e/o:0,r=Math.floor(t*n),l=n-r;return`${chalk.green("█".repeat(r))+chalk.gray("░".repeat(l))} ${(100*t).toFixed(1)}%`}function u(e){return e>=30?chalk.red("🔥🔥🔥 "+e+" days"):e>=7?chalk.yellow("🔥 "+e+" days"):e>=1?chalk.gray("· "+e+" day"+(e>1?"s":"")):chalk.gray("—")}export function renderWelcome(e,o,t){const r=c(),l=o.cardsCompleted.length,a=e.totalCards,s=a-l,g=e.modules.find(e=>o.currentCard>=e.cardRange[0]&&o.currentCard<=e.cardRange[1]),p=/demo/i.test(e.id);if(console.log(),console.log(chalk.cyan(" ╭"+d("═"))),console.log(chalk.cyan(" ║")),console.log(chalk.cyan(" ║ ")+chalk.bold.white(" "+(e.name?.trim()||n("academy_title",r)))),console.log(chalk.cyan(" ║")),t)console.log(chalk.cyan(" ║ ")+chalk.white(" "+n(p?"welcome_new_demo":"welcome_new",r)));else{const e=new Date(o.lastSeenAt),t=Math.floor((Date.now()-e.getTime())/36e5),l=t<1?n("just_now",r):t<24?`${t}${n("ago_hours",r)}`:`${Math.floor(t/24)}${n("ago_days",r)}`;console.log(chalk.cyan(" ║ ")+chalk.white(` ${n("welcome_back",r)} ${l}`))}console.log(chalk.cyan(" ║"));const m=h(g?`${g.number}. ${g.name}`:"—",i()-14);console.log(chalk.cyan(" ║ ")+" "+chalk.gray(n("module",r).padEnd(11))+chalk.white(m)),console.log(chalk.cyan(" ║ ")+" "+chalk.gray(n("progress",r).padEnd(11))+y(l,a,Math.max(6,Math.min(20,i()-26-`${l}/${a}`.length)))+chalk.gray(` (${l}/${a})`)),console.log(chalk.cyan(" ║ ")+" "+chalk.gray(n("streak",r).padEnd(11))+u(o.streakDays)),s>0&&o.currentCard<=a&&console.log(chalk.cyan(" ║ ")+" "+chalk.gray(n("next_card",r).padEnd(11))+chalk.white(`#${o.currentCard} ${n("of",r)} ${a}`)),console.log(chalk.cyan(" ║")),console.log(chalk.cyan(" ╰"+d("═"))),console.log(),console.log(chalk.gray(" ─────────────────────────────────────────────"));const b=0===l?n("continue_start",r):`${n("continue_resume",r)} ${o.currentCard}`;console.log(chalk.bold.green(" continue")+chalk.gray(" "+b)),console.log(chalk.yellow(" status")+chalk.gray(" "+n("status_full",r))),o.bookmarks.length>0&&console.log(chalk.yellow(" bookmarks")+chalk.gray(` ${o.bookmarks.length} ${n("bookmarks_desc",r)}`)),console.log(chalk.gray(" quit")+chalk.gray(" "+n("quit_desc",r))),console.log(chalk.gray(" ─────────────────────────────────────────────")),console.log()}function p(o,t){const r=c(),l=o.module,a=t.modules.find(e=>e.number===l),s=a?a.name:n("unknown_module",r),g=n("module",r).replace(":","").trim(),d=h(`${n("card",r)} ${o.number} / ${t.totalCards} · ${g} ${l} · ${s}`,i()-4);console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(d)+" "+chalk.cyan("─".repeat(Math.max(0,i()-e(d)-4))))}function m(){console.log(chalk.cyan(" ╰"+d())),console.log()}function b(e){console.log(chalk.cyan(" │ ")+chalk.white(e))}function f(){console.log(chalk.cyan(" │"))}const $=/[┌┐└┘├┤┬┴┼─│╔╗╚╝═║╠╣╦╩╬▓▒░█]/;function w(e){return/^(?: {4}|\t)/.test(e)||$.test(e)||/ {3,}/.test(e)}export function wrapMixed(o,n){const t=[];let r="",l=0,a=!1;for(const s of function(o){const n=[],t=o=>{let t="";const r=()=>{t&&(n.push({t:"atom",s:t}),t="")};for(const l of o)" "===l?(r(),n.push({t:"space"})):2===e(l)?(r(),n.push({t:"wide",s:l})):t+=l;r()},r=/`[^`]*`/g;let l,a=0;for(;null!==(l=r.exec(o));)t(o.slice(a,l.index)),n.push({t:"code",s:l[0]}),a=l.index+l[0].length;return t(o.slice(a)),n}(o)){if("space"===s.t){""!==r&&(a=!0);continue}const o=s.s,c=e("code"===s.t?o.replace(/`/g,""):o),g=a?1:0,i="atom"===s.t&&o.length<=2&&/^[.,;:!?)\]}…'"]+$/.test(o);""!==r&&!i&&l+g+c>n?(t.push(r),r=o,l=c,a=!1):(a&&(r+=" ",l+=1,a=!1),r+=o,l+=c)}return r&&t.push(r),t}const _=/\b(?:Common bug|Common mistake|Common error|Pitfall|Gotcha|Footgun)\b[::]?|\b(?:Warning|Caution)\b[::]|(?:常见错误|常见陷阱|常见误区|陷阱|注意|警告|误区)[::]/gi;function k(e,o){const n=o?chalk.bold.white:chalk.white;let t,r="",l=0;for(_.lastIndex=0;null!==(t=_.exec(e));)t.index>l&&(r+=n(e.slice(l,t.index))),r+=chalk.bold.yellow(t[0]),l=t.index+t[0].length;return l<e.length&&(r+=n(e.slice(l))),r}function x(e,o=!1){let n="",t=0;const r=/`([^`]*)`/g;let l;for(;null!==(l=r.exec(e));)l.index>t&&(n+=k(e.slice(t,l.index),o)),n+=chalk.cyan(l[1]),t=l.index+l[0].length;return t<e.length&&(n+=k(e.slice(t),o)),n}function C(e,o=!1){let n=!1;for(const t of e.split("\n"))if(/^\s*```/.test(t))n=!n;else if(n)console.log(chalk.cyan(" │ ")+chalk.cyan(` ${t}`));else if(""!==t)if(w(t))console.log(chalk.cyan(" │ ")+chalk.white(t));else for(const e of wrapMixed(t,i()-4))console.log(chalk.cyan(" │ ")+` ${x(e,o)}`);else f()}function v(e,o){const n=[];for(const t of e.split("\n")){if(""===t){n.push("");continue}if(w(t)){n.push(t);continue}let e="";for(const r of t.split(" "))(e+" "+r).trim().length>o?(n.push(e.trim()),e=r):e=(e+" "+r).trim();e&&n.push(e)}return n}let M=!1;export function setLearnAiEnabled(e){M=e}let S=new Set;export function setLearnPqsViewCards(e){S=e}let A=new Map;export function setLearnHonorRanks(e){A=e}const W=["①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩"];let j=[];export function setLearnReplies(e){j=e}let z=[];export function setLearnFaqs(e){z=e}let R=null;export function setLearnHometask(e){R=e}let P="full";export function setLearnFooterProfile(e){P=e}let L=null;export function setLearnFooterExtra(e){L=e}function q(){const e=L?.();e&&console.log(chalk.gray(" "+e))}let E=null;export function setLearnPracticeChips(e){E=e}let N=!1;export function setLearnShellLane(e){N=e}let T=!1;export function setLearnArenaLane(e){T=e}let O=null;export function setLearnPracticeCount(e){O=e}export function renderHonorWall(e){const o=c().startsWith("zh"),{totals:n,chapters:t}=e,r=n.gold+n.silver+n.bronze,l=(e,o)=>o>0?chalk.bold.white(`${e}×${o}`):chalk.gray(`${e}×0`);if(console.log(chalk.gray(" ─────────────────────────────────────────")),console.log(chalk.bold.white(o?" 🏅 奖牌墙 ":" 🏅 Medal wall ")+l("🥇",n.gold)+chalk.gray(" · ")+l("🥈",n.silver)+chalk.gray(" · ")+l("🥉",n.bronze)+chalk.gray(o?" (永久 — 挂上墙就不会摘下)":" (permanent — once earned, never removed)")),0===r){const n=null!=e.floor?`${e.floor}+`:o?"高分":"a high score";return console.log(chalk.gray(o?` 还没有奖牌 — 单卡提问评分 ${n} 并进入该卡前三,即可永久挂墙 🥇🥈🥉`:` No medals yet — score ${n} on a card and hold its top-3 to hang one 🥇🥈🥉`)),void console.log(chalk.gray(" ─────────────────────────────────────────"))}const a=t.map(e=>{const o=`Ch${e.chapter}`,n=(e.gold>0?`🥇${e.gold}`:"")+(e.silver>0?`🥈${e.silver}`:"")+(e.bronze>0?`🥉${e.bronze}`:"");return n?chalk.white(`${o} ${n}`):chalk.gray(`${o} —`)}).join(chalk.gray(" "));console.log(" "+a);const s=t.flatMap(e=>e.cards.map(o=>({...o,chapter:e.chapter})));s.sort((e,o)=>e.rank-o.rank||e.chapter-o.chapter||e.card-o.card);for(const e of s.slice(0,24)){const n=(e.since||"").slice(0,10);console.log(chalk.white(` ${e.icon} `)+chalk.gray(`Ch${e.chapter} · `)+chalk.white(o?`第 ${e.card} 张`:`card ${e.card}`)+chalk.gray(` · ${e.score}`)+(n?chalk.gray(o?` · 始于 ${n}`:` · since ${n}`):""))}s.length>24&&console.log(chalk.gray(o?` …还有 ${s.length-24} 枚`:` …and ${s.length-24} more`)),console.log(chalk.gray(" ─────────────────────────────────────────"))}export function renderKnowledgeCard(t,r){const d=c(),h=o(t,d);p(h,r),f();const y=wrapMixed(h.title,i()-4);for(const e of y)b(chalk.bold.yellow(e));b(chalk.gray("─".repeat(Math.min(Math.max(...y.map(o=>e(o))),i()))));const u=!!(t.chart_ids&&t.chart_ids.length>0);if(u&&l(t.chart_ids.slice(0,1),r.charts,a()),h.key_point&&""!==h.key_point.trim()?(u||f(),function(e,o,n){const t=c().startsWith("zh"),r=a().cols,l="-".repeat(Math.min(i(),Math.max(24,r-6))),s=t?"要点":"KEY POINT",g=t?`第 ${o} / ${n} 张`:`Card ${o} / ${n}`;console.log(chalk.cyan(" │ ")+chalk.green(l)),console.log(chalk.cyan(" │ ")+chalk.green(`${s} · ${g}`));for(const o of wrapMixed(e,i()-4))console.log(chalk.cyan(" │ ")+chalk.bold.green(" "+o));console.log(chalk.cyan(" │ ")+chalk.green(l)),f()}(h.key_point,h.number,r.totalCards)):u||f(),h.body.filter(e=>null!=e&&""!==e.trim()).forEach((e,o)=>{const n=0===o?e.match(/^([\s\S]*?(?:[.!?](?=\s|$)|[。!?]))(\s[\s\S]*)?$/):null;if(n&&n[1].trim().length<=180){C(n[1],!0);const e=n[2]?.trimStart();e&&C(e,!1)}else C(e,!1);f()}),h.icoaConnection){b(chalk.magenta(" "+n("icoa_connection",d))),b(chalk.gray(" "+"─".repeat(20)));for(const e of wrapMixed(h.icoaConnection,i()-4))b(" "+chalk.magenta(e));f()}if(t.check){const e=d.startsWith("zh"),o=t._zh?.checkStatement??t._zh?.check?.statement,n=e?o??t.check.statement:t.check.statement;for(const o of wrapMixed(e?"请回答 (输 y 或 n):":"Quick comprehension check (type y or n):",i()-8))b(chalk.cyan(" 🤔 "+o));b(chalk.gray(" "+"─".repeat(20)));for(const e of wrapMixed(n,i()-4))b(" "+chalk.white(e));f()}m(),function(o,n){const t=c().startsWith("zh"),r=a().cols,l="-".repeat(Math.min(i(),Math.max(24,r-6))),d=chalk.gray(" ");if("minimal"===P){const e=E?E(o.number):null;console.log(chalk.gray(" "+l)),console.log(chalk.gray(" "+(t?`第 ${o.number} / ${n.totalCards} 张`:`Card ${o.number} / ${n.totalCards}`))+(e?chalk.gray(t?" · 本卡练习 ":" · practice ")+e:""));const r=[];if(o.check?(r.push(chalk.bold.green("[y]")+chalk.gray(t?" 是":" yes")),r.push(chalk.bold.green("[n]")+chalk.gray(t?" 否":" no"))):r.push(chalk.bold.green("[ok]")+chalk.gray(t?" 下一张":" next")),e){const o=Math.max(1,(e.match(/\[\d\]/g)??[]).length),n=Array.from({length:o},(e,o)=>`[${o+1}]`).join("");r.push(chalk.bold.cyan(n)+chalk.gray(t?" 练习":" practice"))}return N&&r.push(chalk.bold.magenta("[sh]")+chalk.gray(t?" 实验台":" shell")),T&&r.push(chalk.bold.magenta("[battle]")+chalk.gray(t?" 进竞技场":" arena")),o.flow&&o.flow.length>0&&r.push(chalk.bold.magenta("[flow]")+chalk.gray(t?" 互动走一遍":" walk it")),r.push(chalk.bold.cyan("[b]")+chalk.gray(t?" 上一张":" back")),r.push(chalk.bold.yellow("[e]")+chalk.gray(t?" 求助":" help")),r.push(chalk.gray("[quit]")+(t?chalk.gray(" 退出"):"")),console.log(" "+r.join(d)),q(),void console.log()}const h=[];o.check?(h.push(chalk.bold.green("[y]")+chalk.gray(t?" 是":" yes")),h.push(chalk.bold.green("[n]")+chalk.gray(t?" 否":" no"))):h.push(chalk.bold.green("[ok]")+chalk.gray(t?" 继续":" next")),o.flow&&o.flow.length>0&&h.push(chalk.bold.magenta("[flow]")+chalk.gray(t?" 互动走一遍":" walk it")),M&&(h.push(chalk.bold.magenta("[/ai]")+chalk.gray(t?" 🐼 熊猫导师":" 🐼 Panda tutor")),h.push(chalk.bold.magenta("[/submit]")+chalk.gray(t?" 提问评分":" prompt score")));const y=A.get(o.number);var u;h.push(chalk.bold.magenta(y?`[/honors ${u=y,W[u-1]??`#${u}`}]`:"[/honors]")+chalk.gray(t?" 排行":" board")),"normal"===g?h.push(chalk.bold.cyan("[wide]")+chalk.gray(t?" 宽屏":" widen")):("wide"===g?h.push(chalk.bold.cyan("[wider]")+chalk.gray(t?" 更宽":" wider")):"wider"===g?(h.push(chalk.bold.cyan("[widest]")+chalk.gray(t?" 最宽":" widest")),h.push(chalk.bold.cyan("[wide]")+chalk.gray(t?" 回宽屏":" back to wide"))):h.push(chalk.bold.cyan("[wider]")+chalk.gray(t?" 回 wider":" back to wider")),h.push(chalk.bold.cyan("[normal]")+chalk.gray(t?" 标准":" standard")));const p=s(j,z,o.number,t),m=p.startsWith("💬");if(h.push((m?chalk.bold.yellow("[r]"):chalk.gray("[r]"))+(m?chalk.bold.white(` ${p}`):chalk.gray(` ${p}`))),h.push(chalk.bold.yellow("[e]")+chalk.gray(t?" 提问或报告":" ask or report")),R){const e=R,o=`${e.done}/${e.total}`,n=e.completedAt?chalk.bold.green:chalk.bold.cyan;h.push(n("[task]")+chalk.gray(t?` 本周 ${o}`:` week ${o}`))}h.push(chalk.bold.cyan("[b]")+chalk.gray(t?" 上一张":" back")),h.push(chalk.bold.cyan("[card N]")+chalk.gray(t?" 跳转":" jump")),h.push(chalk.gray("[reload]")+(t?chalk.gray(" 刷新"):"")),h.push(chalk.gray("[quit]")+(t?chalk.gray(" 退出"):""));const b=e(l);console.log(chalk.gray(" "+l)),console.log(chalk.gray(" "+(t?`第 ${o.number} / ${n.totalCards} 张`:`Card ${o.number} / ${n.totalCards}`)));let f="",$=0;for(const o of h){const n=e(o);f&&$+2+n>b?(console.log(" "+f),f=o,$=n):(f=f?f+d+o:o,$=f===o?n:$+2+n)}f&&console.log(" "+f),console.log(" "+chalk.magenta("✍ ")+chalk.magenta("[/py]")+chalk.gray(t?" Python 草稿本":" Python scratchpad")+d+chalk.magenta("[/pylist]")+chalk.gray(t?" 我的草稿":" my files")),console.log(chalk.gray(" "+l));const w=[t?"e = 就这张卡提问,或报告问题":"e = ask about this card, or report a problem",t?"更多: bookmark / unbookmark · status · lang zh/en · link":"more: bookmark / unbookmark · status · lang zh/en · link"];for(const e of w)for(const o of wrapMixed(e,b))console.log(chalk.gray(" "+o));q(),console.log()}(t,r)}export function renderCheckFeedback(e,o,n,t=!1){const r=c().startsWith("zh");if(console.log(),n)console.log(chalk.green(" ✓ ")+chalk.white(r?"答对了。":"Correct."));else if(console.log(chalk.yellow(" ✗ ")+chalk.white(r?"记下了,继续。":"Noted — moving on.")),t){const o="y"===e.check?.answer?r?"是":"Yes":r?"否":"No";console.log(chalk.gray(" "+(r?"正确答案: ":"Answer: ")+o+". "+(r?"回看上面那段。":"Re-read the paragraph above.")))}const l=r?e._zh?.solution??e.solution:e.solution;if(l&&l.length>0){console.log(),console.log(chalk.cyan(" 📝 "+(r?"解答:":"Worked solution:")));for(const e of l){for(const o of wrapMixed(e,i()-4))console.log(chalk.white(" "+o));console.log()}}console.log()}function F(e){return[chalk.white(" "+(e?"编著:Charlie Zhu":"Created & edited by Charlie Zhu")),chalk.gray(" "+(e?"ICOA 2026 创始人 · 课程总架构师":"Founder & Chief Curriculum Architect · ICOA 2026"))]}export function renderPhaseComplete(e,o,n,t,l,a){const s=c().startsWith("zh"),[g,d]=n.cardRange,h=o.checkResults||{};let y=0,u=0;for(let e=g;e<=d;e++){const o=h[String(e)];o&&(y++,o.correct&&u++)}const p="-".repeat(48);console.log();for(const e of r(" "))console.log(e);console.log(),console.log(chalk.bold.yellow(" "+p)),console.log(chalk.bold.yellow(" "+(s?`阶段 ${n.number} 完成`:`Phase ${n.number} complete`))+chalk.gray(" · ")+chalk.white(n.name));const m=y>0&&u===y?chalk.bold.green:chalk.bold.white;console.log(chalk.gray(" "+(s?"理解检查得分: ":"comprehension score: "))+m(`${u}/${y}`)+chalk.gray(0===y?s?" (本阶段未作答 y/n)":" (no y/n answered)":""));const b=String(d).length;let f=!1,$=0,w=0,_=0,k=0;for(let o=g;o<=d;o++){const n=e.cards.find(e=>e.number===o);if(!n)continue;const t=n,r=t.title??t.badge??"",l=(s?t._zh?.title??t._zh?.badge??r:r)||"",a=null!=n.check,c=h[String(o)];let g;g=c?c.correct?chalk.green("✓"):chalk.red("✗"):a?chalk.gray("○"):chalk.gray("·");const d=O?O(o):null;d&&(f=!0);const y=d?(d.solved>=d.total?chalk.green:d.solved>0?chalk.yellow:chalk.gray)(` ⚔${d.solved}/${d.total}`):"";d&&($++,d.solved>=d.total&&w++,_+=d.solved,k+=d.total);const u=wrapMixed(l,i()-10-b-(d?6:0)),p=u[0]+(u.length>1?"…":"");console.log(chalk.gray(` ${String(o).padStart(b)} `)+g+y+chalk.white(" "+p))}if(console.log(chalk.gray(s?" ✓ 答对 · ✗ 答错 · ○ 未作答 · 无 y/n 的卡不计分":" ✓ correct · ✗ wrong · ○ unanswered · cards without a y/n are unscored")),f&&console.log(chalk.bold.cyan(" ⚔ "+(s?"卡片练习: ":"practice: "))+(w>=$?chalk.bold.green:chalk.bold.white)(`${w}/${$}`)+chalk.gray(s?` 卡全完成 · ${_}/${k} 题 AC · 行内 ⚔已过/共(绿 完成 · 黄 部分 · 灰 未碰)`:` cards complete · ${_}/${k} problems AC · ⚔solved/total per row (green done · yellow partial · gray untouched)`)),l){const e=e=>"green"===e?chalk.bold.green:"blue"===e?chalk.bold.cyan:"yellow"===e?chalk.bold.yellow:chalk.bold.red;console.log(chalk.bold.magenta(" ⭐ "+(s?"提问得分 (best): ":"Prompt scores (best): "))+(0===l.length?chalk.gray(s?"本阶段尚未提问 — 用 /ai 研究,再 /submit 评分":"none this phase — research with /ai, then /submit"):l.map(o=>chalk.gray((s?"卡":"#")+o.card+" ")+e(o.tier)(String(o.score))).join(chalk.gray(" · "))))}if(a&&!a.configured){const o=d-g+1>12,n="fill"===e.practiceMode;console.log(chalk.gray(o?s?" 🔒 本阶段通关标准制作中 — 很快更新(360 层第二阶段标准设计中)":" 🔒 Pass criteria for this phase are in production — coming soon (360-tier second-stage standard in design)":n?s?" 🔒 本阶段 3 场判分赛制作中 — 很快更新;赛场挂在卡 4 / 8 / 12,3 场全过解锁下一阶段(本轨无 research)":" 🔒 This phase’s 3 judged arenas are in production — coming soon; they hang on cards 4 / 8 / 12 and all 3 unlock the next phase (no research on this track)":s?" 🔒 本阶段通关标准制作中 — 很快更新(标准范式:3 场练习赛 + 3 卡研究)":" 🔒 Pass criteria for this phase are in production — coming soon (standard: 3 arenas + 3 research cards)"))}if(a?.configured&&a.contest){const e=a.contest;if(e.slots&&e.slots.length>0)for(const o of e.slots){const e=chalk.bold.cyan(` ⚔ ${s?"练习赛":"arena"} ${n.number}-${o.slot}: `);o.passed?console.log(e+chalk.bold.green(`${o.best_ac}/${o.n} AC ✅`)):0===o.attempts?console.log(e+chalk.white(s?`${o.n} 题 · 过 ${o.need} 题 — `:`${o.n} problems · AC ${o.need} — `)+chalk.bold.green(`contest ${o.slot}`)):console.log(e+chalk.yellow(s?`最好 ${o.best_ac}/${o.n}(需 ${o.need})· 已试 ${o.attempts} 次 — `:`best ${o.best_ac}/${o.n} (need ${o.need}) · ${o.attempts} attempt(s) — `)+chalk.bold.green(`contest ${o.slot}`))}else{const o=chalk.bold.cyan(" ⚖ "+(s?"判分赛: ":"Contest: "));e.passed?console.log(o+chalk.bold.green(`${e.best_ac}/${e.n} AC ✅ `+(s?"已过关":"passed"))):0===e.attempts?console.log(o+chalk.white(s?`${e.n} 题 · 过 ${e.need} 题解锁 — 输入 `:`${e.n} problems · AC ${e.need} to pass — type `)+chalk.bold.green("contest")+chalk.white(s?" 开始":" to start")):console.log(o+chalk.yellow(s?`最好 ${e.best_ac}/${e.n} AC(需 ${e.need})· 已试 ${e.attempts} 次 — 输入 `:`best ${e.best_ac}/${e.n} AC (need ${e.need}) · ${e.attempts} attempt(s) — type `)+chalk.bold.green("contest")+chalk.yellow(s?" 再战":" to retry"))}}t&&console.log(chalk.gray(" "+(s?"下一阶段: ":"next: "))+chalk.bold.cyan(s?`阶段 ${t.number}`:`Phase ${t.number}`)+chalk.gray(" · ")+chalk.white(t.name)),console.log(chalk.bold.yellow(" "+p));for(const e of F(s))console.log(e)}export function renderCurriculumComplete(e,o){const n=c().startsWith("zh"),t=o.checkResults||{},l="-".repeat(48);let a=0,s=0;console.log();for(const e of r(" "))console.log(e);console.log(),console.log(chalk.bold.green(" "+l)),console.log(chalk.bold.green(" 🏆 "+(n?`${e.name} — 全部完成!`:`${e.name} — complete!`))),console.log(chalk.bold.green(" "+l));for(const o of e.modules){const[e,r]=o.cardRange;let l=0,c=0;for(let o=e;o<=r;o++){const e=t[String(o)];e&&(l++,e.correct&&c++)}a+=l,s+=c;const g=l>0&&c===l?chalk.green:chalk.white;console.log(chalk.gray(" "+(n?`阶段 ${o.number}`:`Phase ${o.number}`).padEnd(8))+g(`${c}/${l}`.padEnd(7))+chalk.gray(o.name))}console.log(chalk.bold.green(" "+l)),console.log(chalk.bold.green(" "+(n?"总分 / overall: ":"Overall: "))+chalk.bold.white(`${s}/${a}`)),console.log(chalk.bold.green(" "+l));for(const e of F(n))console.log(e);console.log()}export function renderMCQCard(e,t){const r=c(),l=o(e,r);p(l,t),f(),b(chalk.bold.yellow("🎯 "+l.title)),b(chalk.gray("─".repeat(Math.min(l.title.length+4,i())))),f();for(const e of v(l.question,i()-4))b(" "+e);f();for(const e of["A","B","C","D"])b(chalk.cyan(` ${e}.`)+" "+chalk.white(l.options[e]));f(),m(),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(" "+n("type_to_answer",r))),console.log(chalk.gray(" ")+chalk.bold.cyan("back")+chalk.gray(r.startsWith("zh")?" 上一张 · ":" previous card · ")+chalk.bold.cyan("card N")+chalk.gray(r.startsWith("zh")?" 跳转":" jump")),console.log()}export function renderMCQFeedback(e,t,r,l){const a=c(),s=o(e,a);console.log(),r?console.log(" "+chalk.bold.green(n("correct",a)+" ")+chalk.gray(`${n("one_point",a)} · ${t} = ${s.options[t]}`)):console.log(" "+chalk.bold.red(n("not_quite",a)+" ")+chalk.gray(`${n("you_chose",a)} ${t}; ${n("answer_is",a)} ${s.answer}.`)),console.log(),console.log(chalk.gray(" "+n("explanation",a)));for(const e of v(s.explanation,i()-4))console.log(chalk.gray(" "+e));const g=Object.values(l.mcqResults),d=g.filter(e=>e.correct).length;console.log(),console.log(chalk.gray(" "+n("mcq_accuracy_so_far",a)+" ")+chalk.white(`${d}/${g.length}`)),console.log(),r||(console.log(chalk.gray(" "+n("press_ok_continue",a)+" ")+chalk.bold.green("ok")+chalk.gray(" "+n("to_continue",a))),console.log())}export function renderPracticalCard(e,t){const r=c(),l=o(e,r);p(l,t),f(),b(chalk.bold.yellow("🛠 "+l.title)),b(chalk.gray("─".repeat(Math.min(l.title.length+4,i())))),f();for(const e of v(l.task,i()-4))b(" "+e);if(l.starterCode){f(),b(chalk.gray(" "+n("starter_code",r))),f();for(const e of l.starterCode.split("\n"))b(" "+chalk.cyan(e))}f(),m(),console.log(chalk.gray(" "+n("try_in_sandbox",r)+" ")+chalk.bold.cyan("!python3")+chalk.gray(" "+n("drops_into_python",r))),console.log(chalk.gray(" "+n("when_done",r))),console.log(chalk.gray(" ")+chalk.bold.green("done")+chalk.gray(" "+n("done_desc",r))),console.log(chalk.gray(" ")+chalk.bold.yellow("skip")+chalk.gray(" "+n("skip_desc",r))),console.log(chalk.gray(" back previous card")),console.log(chalk.gray(" card N jump to a card by number")),console.log()}export function renderPracticalSuccess(e){const t=c(),r=o(e,t);console.log(),console.log(" "+chalk.bold.green(n("practical_recorded",t))),console.log(),console.log(chalk.gray(" "+n("reference_answer",t)));for(const e of v(r.successHint,i()-4))console.log(chalk.gray(" "+e));console.log(),console.log(chalk.gray(" "+n("press_ok_continue",t)+" ")+chalk.bold.green("ok")+chalk.gray(" "+n("to_continue",t))),console.log()}export function renderSimDemoCard(e,t){const r=c(),l=o(e,r);p(l,t),f(),b(chalk.bold.yellow("🎬 "+l.title)),f();for(const e of v(l.description,i()-4))b(" "+e);f(),b(chalk.gray(" "+n("sim_requires",r))),f(),m(),console.log(chalk.gray(" ")+chalk.bold.cyan("sim")+chalk.gray(" "+n("sim_launch_desc",r))),console.log(chalk.gray(" ")+chalk.bold.green("ok")+chalk.gray(" / ")+chalk.bold.green("next")+chalk.gray(" "+n("continue_to_next",r))),console.log(chalk.gray(" bookmark "+n("bookmark_desc",r))),console.log(chalk.gray(" back "+n("back_desc",r))),console.log(chalk.gray(" back previous card")),console.log(chalk.gray(" card N jump to a card by number")),console.log(chalk.gray(" quit "+n("quit_desc",r))),console.log()}export function renderArenaTaskCard(e,n){const t=c(),r=t.startsWith("zh"),l=o(e,t);p(l,n),f(),b(chalk.bold.cyan("🏟 "+l.title)),b(chalk.gray(" "+l.origin+" · "+l.domain+" · "+l.metric)),f();for(const e of l.statement){for(const o of v(e,i()-4))b(" "+o);f()}b(chalk.bold.green(r?" 核心要点 — baseline → 解法的关键变化":" CORE DELTA — baseline → solution"));for(const e of l.core_delta)for(const o of v("• "+e,i()-6))b(" "+chalk.white(o));f(),b(chalk.gray((r?" 提交格式: ":" Submission: ")+l.submission_format)),l.hints&&b(chalk.gray(r?" 本题有 5 级提示 (a–e),进入 arena 后逐级解锁。":" 5 progressive hints (a–e) unlock inside the arena.")),f(),m(),console.log(chalk.gray(" ")+chalk.bold.cyan("arena "+l.task_id)+chalk.gray(r?" 动手做这道题(下载 / 提示 / 提交 / 榜单)":" open the arena (download / hints / submit / board)")),console.log(chalk.gray(" ")+chalk.bold.green("ok")+chalk.gray(" / ")+chalk.bold.green("next")+chalk.gray(r?" 继续下一张":" continue to next")),console.log(chalk.gray(" back "+(r?"上一张":"previous"))),console.log(chalk.gray(" back previous card")),console.log(chalk.gray(" card N jump to a card by number")),console.log(chalk.gray(" quit "+(r?"退出":"exit"))),console.log()}export function renderComingSoonCard(e,n){const t=c(),r=t.startsWith("zh"),l=o(e,t);p(l,n),f(),b(chalk.bold.yellow("🔜 "+l.title)),f();const a=l.note||(r?"这道竞技场题目正在编写中,敬请期待。":"This arena task is coming soon.");for(const e of v(a,i()-4))b(" "+chalk.gray(e));f(),m(),console.log(chalk.gray(" ")+chalk.bold.green("ok")+chalk.gray(" / ")+chalk.bold.green("next")+chalk.gray(r?" 继续":" continue")),console.log(chalk.gray(" back previous card")),console.log(chalk.gray(" card N jump to a card by number")),console.log(chalk.gray(" quit "+(r?"退出":"exit"))),console.log()}export function renderMilestone(e,t){const r=c(),l=o(e,r),a=e.number===t.totalCards;console.log(),console.log(chalk.bold.yellow(" ╭"+d("═"))),console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+chalk.white(" "+n("milestone_header",r))),console.log(chalk.bold.yellow(" ║"));const s=` ${l.badge} ${l.emoji}`;console.log(chalk.bold.yellow(" ║ ")+chalk.bold.green(s)),console.log(chalk.bold.yellow(" ║ ")+chalk.gray(" ─".repeat(Math.max(1,Math.floor(l.badge.length/2+2))))),console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+" "+chalk.gray(n("in_wild_corresponds",r)));for(const e of v(l.realWorldLevel,i()-4))console.log(chalk.bold.yellow(" ║ ")+" "+chalk.white(e));console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+" "+chalk.gray(n("whats_next",r)));for(const e of v(l.unlockedNext,i()-4))console.log(chalk.bold.yellow(" ║ ")+" "+chalk.white(e));console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ╰"+d("═"))),console.log(),a?(console.log(chalk.gray(" "+n("demo_complete",r))),console.log(),console.log(chalk.gray(" "+n("unlock_full",r)+" ")+chalk.white(n("curriculum_name",r))+chalk.gray(",")),console.log(chalk.gray(" "+n("contact_team_leader",r)+" ")+chalk.bold.yellow("EA")+chalk.gray(" "+n("learn_token",r))),console.log(chalk.gray(" "+n("or_email",r)+" ")+chalk.cyan("australia@icoa2026.au")+chalk.gray(" "+n("for_partnership",r))),console.log(),console.log(chalk.gray(" "+n("type_quit",r)+" ")+chalk.bold.green("quit")+chalk.gray(" "+n("to_exit",r)+" ")+chalk.bold.green("status")+chalk.gray(" "+n("for_dashboard",r)))):(console.log(chalk.gray(" ")+chalk.bold.green("ok")+chalk.gray(" / ")+chalk.bold.green("next")+chalk.gray(" "+n("continue_to_next",r))),console.log(chalk.gray(" status "+n("status_full",r))),console.log(chalk.gray(" back previous card")),console.log(chalk.gray(" card N jump to a card by number")),console.log(chalk.gray(" quit "+n("quit_desc",r)))),console.log()}export function renderStatus(o,t,r={}){const l=c(),a=l.startsWith("zh"),s=t.cardsCompleted.length,g=o.totalCards,d=t.checkResults||{},p=r.gate??null,$=!!r.gated,w=r.focus??"current",_=r.posForSlot??(e=>4===e?10:4*e),k=t.currentCard,x=o.modules.find(e=>k>=e.cardRange[0]&&k<=e.cardRange[1]),C=(o,n)=>o+" ".repeat(Math.max(0,n-e((e=>e.replace(/\x1b\[[0-9;]*m/g,""))(o))));console.log();const v=`${o.name} — ${a?"状态":"Status"}`;console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(v)+" "+chalk.cyan("─".repeat(Math.max(4,i()-2-e(v))))),f(),b(" "+chalk.gray(n("total_progress",l)+" ")+y(s,g)+chalk.gray(` (${s}/${g})`)+chalk.gray(" "+n("streak",l)+" ")+u(t.streakDays));{let n=0,l=0,s=0,c=0,g=0,h=0,y=!1;for(const e of o.modules){for(let t=e.cardRange[0];t<=e.cardRange[1];t++){const e=O?O(t):null;e&&(n++,e.solved>=e.total&&l++);const r=o.cards.find(e=>e.number===t);null!=r?.check&&(s++,d[String(t)]?.correct&&c++)}const t=p?.phases.find(o=>o.phase===e.number);if(t?.configured)for(const e of t.contest?.slots??[])g++,e.passed&&h++;t?.research&&(y=!0)}const u=(e,o)=>(e>=o?chalk.green:chalk.white)(`${e}/${o}`),m=[];n&&m.push(chalk.gray(a?"⚔ 练习卡 ":"⚔ practice cards ")+u(l,n)),g&&m.push(chalk.gray(a?"赛场 ":"arena ")+u(h,g)),s&&m.push(chalk.gray(a?"✓ 自测 ":"✓ checks ")+u(c,s)),m.length&&b(" "+m.join(chalk.gray(" "))),r._anyResearch=y;{let n=0;const r=[];let l=0,c=0,y=0;for(const e of o.modules)for(let a=e.cardRange[0];a<=e.cardRange[1];a++){c++,t.cardsCompleted.includes(a)&&l++;const e=o.cards.find(e=>e.number===a);null!=e?.check&&d[String(a)]&&y++;const s=O?O(a):null;s&&s.solved<s.total&&(n+=s.total-s.solved,r.push(a))}const u=a?"▸ 通关还差 ":"▸ to finish ",p=[];if(l<c&&p.push(chalk.gray(a?"卡片 ":"cards ")+chalk.white(""+(c-l))+chalk.gray(a?" 张未读":" unread")),s&&y<s&&p.push(chalk.gray("✓ ")+chalk.white(""+(s-y))+chalk.gray(a?" 题自测未答":" checks unanswered")),n>0){const o=a?`练习还差 ${n} 题`:`${n} practice problem${n>1?"s":""}`,t=a?"(卡 ":" (cards ",l=")",s=" │ ⚔ ",c=i()-e(s)-e(u)-e(o)-e(t+l),g=e=>{const o=[];let n=0;for(const t of r){const r=String(t).length+(o.length?3:0);if(n+r>e)break;n+=r,o.push(t)}return o};let d=g(c);d.length<r.length&&(d=g(c-e(` +${r.length}`))),!d.length&&r.length&&(d=[r[0]]);const h=r.length-d.length,y=d.join(" · ")+(h>0?` +${h}`:"");p.push(chalk.gray("⚔ ")+chalk.white(o)+chalk.gray(t+y+l))}g&&h<g&&p.push(chalk.gray(a?"赛 ":"arena ")+chalk.white(""+(g-h))+chalk.gray(a?" 场未过":" to pass"));const m=l>0;m&&p.length?p.forEach((o,n)=>b(" "+(0===n?chalk.bold.yellow(u):" ".repeat(e(u)))+o)):m&&!p.length&&b(" "+chalk.bold.green(a?"✅ 通关条件已全部达成":"✅ every completion gate met"))}}f();const M=e=>a?`阶段 ${e}`:`Phase ${e}`,S=Math.max(10,Math.min(28,i()-54));for(const e of o.modules){const[n,r]=e.cardRange,l=r-n+1,s=t.cardsCompleted.filter(e=>e>=n&&e<=r).length,c=$&&!!p&&e.number>p.unlocked_through_phase,g=p?.phases.find(o=>o.phase===e.number);let y=0,u=0,m=0;const f=[],v=[];let A=0,W=0,j=0;const z=[];for(let e=n;e<=r;e++){const n=o.cards.find(o=>o.number===e);if(null!=n?.check){y++;const o=d[String(e)];o?(u++,o.correct?m++:v.push(e)):f.push(e)}const t=O?O(e):null;t&&(A++,j+=t.solved,t.solved>=t.total?W++:z.push(`${e}:${t.solved}/${t.total}`))}const R=g?.configured?g.contest?.slots??[]:[],P=e=>e.passed?chalk.green("✅"):e.attempts>0?chalk.yellow("❌"):chalk.gray("⬜"),L=s>=l&&(0===y||m===y)&&(0===A||W===A)&&(0===R.length||R.every(e=>e.passed))&&(!g?.research||g.research.passed),q=s>0||u>0||j>0||R.some(e=>e.attempts>0),E=c?chalk.gray("🔒"):L?chalk.green("✅"):e.number===x?.number?chalk.bold.cyan("▶ "):q?chalk.yellow("▶ "):chalk.gray("⬜"),N=h(e.name,S),T=[];if(T.push((s>=l?chalk.green:chalk.white)(`${s}/${l}`)+chalk.gray(a?"卡":"c")),y>0&&T.push(chalk.gray("✓")+(m===y?chalk.green:chalk.white)(`${m}/${y}`)),A>0&&T.push(chalk.gray("⚔")+(W===A?chalk.green:chalk.white)(`${W}/${A}`)+chalk.gray(a?"卡":"c")),R.length>0&&T.push(chalk.gray(a?"赛":"arena ")+R.map(P).join("")),g?.research&&T.push(chalk.gray("⭐")+(g.research.passed?chalk.green:chalk.white)(`${g.research.good_cards}/${g.research.need_cards}`)),b(" "+E+" "+chalk.white(C(M(e.number),a?5:8))+chalk.gray(C(N,S+1))+T.join(chalk.gray(" · "))),c||"all"!==w&&w!==e.number&&("current"!==w||e.number!==x?.number)){if(!c&&q&&!L){const o=[],t=R.filter(e=>!e.passed).map(o=>(o.attempts>0?chalk.yellow:chalk.gray)(`${e.number}-${o.slot}@${a?"卡":"card "}${n+_(o.slot)-1}`));t.length&&o.push(chalk.gray(a?"赛 ":"arena ")+t.join(chalk.gray(" · ")));const r=(e,o)=>e.slice(0,8).join(o)+(e.length>8?chalk.gray(" +"+(e.length-8)):"");z.length&&o.push(chalk.gray("⚔ ")+chalk.white(r(z," "))),v.length&&o.push(chalk.red("✗ ")+chalk.white(r(v.map(String),","))),f.length&&o.push(chalk.gray("○ ")+chalk.white(r(f.map(String),","))),g?.research&&!g.research.passed&&o.push(chalk.gray(`⭐ ${g.research.good_cards}/${g.research.need_cards}`)),o.forEach((e,o)=>b(chalk.gray(0===o?a?" 待办: ":" todo: ":" ")+e))}}else{const t=String(r).length;for(let s=n;s<=r;s++){const r=o.cards.find(e=>e.number===s);if(!r)continue;const c=r,g=c.title??c.badge??"",h=(a?c._zh?.title??c._zh?.badge??g:g)||"",y=null!=r.check,u=d[String(s)],p=u?u.correct?chalk.green("✓"):chalk.red("✗"):y?chalk.gray("○"):chalk.gray("·"),m=O?O(s):null,f=m?(m.solved>=m.total?chalk.green:m.solved>0?chalk.yellow:chalk.gray)(`⚔${m.solved}/${m.total}`):" ",$=s===k?chalk.bold.cyan("▶"):" ",w=wrapMixed(h,Math.max(16,i()-14-t)),x=w[0]+(w.length>1?"…":"");b(` ${$} `+chalk.gray(String(s).padStart(t))+" "+p+" "+C(f,5)+" "+chalk.white(x));const v=12===l?R.find(e=>n+_(e.slot)-1===s):void 0;if(v){const o=chalk.gray(` ${" ".repeat(t)} ⚔ ${a?"练习赛":"arena"} ${e.number}-${v.slot}: `);v.passed?b(o+chalk.bold.green(`${v.best_ac}/${v.n} AC ✅`)):0===v.attempts?b(o+chalk.gray("⬜ ")+chalk.white(a?`未开始 · ${v.n} 题 · 过 ${v.need} 题 → `:`not started · ${v.n} problems · AC ${v.need} → `)+chalk.bold.green(`contest ${v.slot}`)):b(o+chalk.yellow(a?`❌ 最好 ${v.best_ac}/${v.n}(需 ${v.need})· 已试 ${v.attempts} 次 → `:`❌ best ${v.best_ac}/${v.n} (need ${v.need}) · ${v.attempts} attempt(s) → `)+chalk.bold.green(`contest ${v.slot}`))}}if(12!==l)for(const o of R){const n=chalk.gray(` ⚔ ${a?"练习赛":"arena"} ${e.number}-${o.slot}: `);o.passed?b(n+chalk.bold.green(`${o.best_ac}/${o.n} AC ✅`)):0===o.attempts?b(n+chalk.gray("⬜ ")+chalk.white(a?`未开始 · ${o.n} 题 · 过 ${o.need} 题 → `:`not started · ${o.n} problems · AC ${o.need} → `)+chalk.bold.green(`contest ${o.slot}`)):b(n+chalk.yellow(a?`❌ 最好 ${o.best_ac}/${o.n}(需 ${o.need})· 已试 ${o.attempts} 次 → `:`❌ best ${o.best_ac}/${o.n} (need ${o.need}) · ${o.attempts} attempt(s) → `)+chalk.bold.green(`contest ${o.slot}`))}g?.research&&!g.research.passed&&b(chalk.gray(a?` ⭐ 研究: ${g.research.good_cards}/${g.research.need_cards} 卡达 ${g.research.min_score} 分 — /ai 研究后 /submit`:` ⭐ research: ${g.research.good_cards}/${g.research.need_cards} cards at ${g.research.min_score}+ — /ai then /submit`)),g&&!g.configured&&b(chalk.gray(a?" 🔒 本阶段通关标准制作中 — 很快更新":" 🔒 pass criteria for this phase in production — coming soon"))}}f(),b(chalk.gray(a?" ✓ 答对 ✗ 答错 ○ 未答 · ⚔ 练习 已过/共 · 赛 ✅ 过 ❌ 试过 ⬜ 未碰"+(r._anyResearch?" · ⭐ 研究":""):" ✓ right ✗ wrong ○ unanswered · ⚔ practice solved/total"+(r._anyResearch?" · ⭐ research":""))),b(chalk.gray(a?" 展开某阶段: ":" arena ✅ passed ❌ tried ⬜ untouched · expand: ")+chalk.bold.green("status all")+chalk.gray(" / ")+chalk.bold.green("status N")),t.achievements.length>0&&b(" "+chalk.gray(n("achievements",l)+" ")+t.achievements.map(e=>chalk.bold.yellow("★ ")+chalk.white(e)).join(chalk.gray(" · "))),f(),m()}function D(e){try{Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)}catch{}}export function renderArenaIntro(){const e=c().startsWith("zh"),o=!!process.stdout.isTTY&&!/^(C|POSIX)$/i.test(process.env.LANG||"")&&!process.env.ICOA_TEST_BOOT_MODE,n=e?[chalk.bold.yellow(" ⚔ 你读完 4 张卡了 — 前面是第一个检查点。"),chalk.white(" ⚔ 每 4 张卡有一场判分赛:")+chalk.bold.yellow("卡 4 / 8 / 12")+chalk.white(",一个阶段共 3 场。"),chalk.white(" · 敲 ")+chalk.bold.green("contest 1")+chalk.white(" 开始 — 计时器同时开始,题目在赛场里读。"),chalk.white(" · 判分机会真的跑你的代码,不是对答案。"),chalk.white(" · 3 场全过 → 解锁下一阶段。"),chalk.gray(" ▸ 现在不想打?敲 ")+chalk.bold.green("next")+chalk.gray(" 继续读卡,赛场一直在那儿等你。")]:[chalk.bold.yellow(" ⚔ Four cards down — a checkpoint is waiting."),chalk.white(" ⚔ Every 4 cards there is a judged arena: ")+chalk.bold.yellow("cards 4 / 8 / 12")+chalk.white(", three per phase."),chalk.white(" · Type ")+chalk.bold.green("contest 1")+chalk.white(" to start — the clock starts with it; the problems are read inside."),chalk.white(" · The judge really runs your code. It is not an answer key."),chalk.white(" · Pass all three → the next phase unlocks."),chalk.gray(" ▸ Not now? Type ")+chalk.bold.green("next")+chalk.gray(" and keep reading — the arena waits for you.")];console.log();for(const e of n)console.log(e),o&&D(200);console.log()}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icoa-cli",
3
- "version": "2.19.566",
3
+ "version": "2.19.568",
4
4
  "description": "ICOA CLI — AI-native competition runtime of the International Cyber Olympiad in AI: learn, practise, and compete in AI & cybersecurity from the terminal (AI4CTF · CTF4AI · CTF4EAI)",
5
5
  "author": "Charlie Zhu",
6
6
  "type": "module",