icoa-cli 2.19.251 → 2.19.252

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{spawn as o}from"node:child_process";import{writeFileSync as e}from"node:fs";import{join as n}from"node:path";import{createInterface as a}from"node:readline";import{getConfig as t,saveConfig as r}from"../lib/config.js";import{clearDemo2Progress as s,loadDemo2Progress as l,markCardDone as i,markDemo2Complete as c}from"../lib/demo2-progress.js";import{getMainRl as g}from"../lib/main-rl.js";import{cooldownRemaining as d,lastArmAt as y,lastBundledAt as u,lastSimAt as h,markSimAt as m}from"../lib/sim-cooldown.js";function p(o){return e=>{const n=u()>0||h()>0||y()>0;return"mujoco"===o?n?"(That smooth motion you saw in sim? MuJoCo did the physics.)":"(The final exercise of demo2 will render MuJoCo for you live.)":n?"(That arm you watched in sim was a Franka Panda.)":"(Watch for the Panda in the very last exercise of this demo.)"}}function w(o){return e=>{const n=u()>0||h()>0||y()>0;return"mujoco"===o?n?"(刚才 sim 里那段流畅的动作,物理就是 MuJoCo 算的。)":"(demo2 的最后一题会实时渲染 MuJoCo 给你看。)":n?"(你刚才在 sim 里看到的那只机械臂就是 Franka Panda。)":"(留意本 demo 的最后一题 —— 那只就是 Panda。)"}}const f=[{kind:"mcq",title:'1 / 10 · What is "embodied AI"?',question:"Which best describes embodied AI?",options:{A:"AI that runs on physical hardware (servers, GPUs)",B:"AI that perceives the world and TAKES ACTION in it — robots, drones, self-driving cars",C:"AI that talks like a human (chatbots, voice assistants)",D:"AI written in C++ for speed"},answer:"B",reveal:["Embodied AI = AI with a BODY. It sees (camera/sensors), understands instructions, and ACTS in the physical world.","","Chatbots talk. Embodied AI moves things.","The gap between the two is where the next decade of AI happens."]},{kind:"mcq",title:"2 / 10 · What is MuJoCo?",question:"MuJoCo — the physics engine that renders the robot arm in this demo's final exercise — is:",options:{A:"A robot brand competing with Boston Dynamics",B:"A type of Japanese AI startup",C:"DeepMind's open-source physics simulator — robots train in software FIRST",D:"A snack popular in Australian university cafeterias"},answer:"C",reveal:["MuJoCo = Multi-Joint dynamics with Contact. DeepMind's open-source physics engine.","","Real robots are expensive ($30k+) and breakable. Researchers train policies in MuJoCo first, then transfer to hardware.",'ICOA uses it as the "robot you can break for free" in this olympiad.'],dynamicTail:p("mujoco")},{kind:"mcq",title:"3 / 10 · What is Franka Panda?",question:"A 7-axis robot arm — like the one rendered at the end of this demo — is most likely:",options:{A:"A panda-shaped toy robot from a kids' show",B:"Franka Emika Panda — a research-grade 7-DoF arm built in Munich",C:"An anime character",D:"A specific kind of VLA model"},answer:"B",reveal:["Franka Emika Panda — 7-axis robot arm, torque-controlled joints, ~$30k.","",'It is the most-filmed robot in research lab demo videos. Most "robot learning" papers run on a Panda.',"By the end of this demo, you'll have controlled one remotely — through ICOA infrastructure — without owning one."],dynamicTail:p("franka")},{kind:"mcq",title:"4 / 10 · Generalization — the real state of the industry",question:"In 2026, where does robotic GENERALIZATION actually stand?",options:{A:"Robots have already replaced most factory workers",B:"Boston Dynamics' Atlas does the dishes at home reliably",C:"No robot autonomously picks fruit in a real farm. Demos work; production-scale generalization is unsolved.",D:"It was a solved problem in the 2010s"},answer:"C",reveal:["Reality check: the canonical UNSOLVED problem is fruit-picking on real farms.","","Every farm: different lighting, soil, plant shape, season. A robot trained on tomatoes can't pick strawberries. Performance robots ≠ production robots.","The gap between viral demos and chaotic real-world reliability is what embodied AI research is actually working on."]},{kind:"mcq",title:"5 / 10 · What controls today's embodied AI?",question:'The "brain" inside a state-of-the-art research robot is most likely:',options:{A:"A Large Language Model (LLM) like GPT-4",B:"A Vision-Language-Action (VLA) model — vision + language + motor action",C:"Rule-based scripts written by engineers",D:"Reinforcement learning trained for years"},answer:"B",reveal:["LLMs are great at text — but can't see, can't act.","","The frontier of embodied AI is VLA = Vision + Language + Action."," · VISION: encodes camera images"," · LANGUAGE: reads your instruction"," · ACTION: outputs motor commands (xyz, rotation, gripper)","","Today, you talked to ICOA-VLA — a research-grade VLA running on ICOA infrastructure."]},{kind:"mcq",title:"6 / 10 · VLA vs LLM — what's the real difference?",question:"An LLM outputs text tokens. A VLA model outputs ___ ?",options:{A:"Better text, just with images attached",B:"Sound and music waveforms",C:"Motor commands — joint angles, gripper open/close, end-effector xyz",D:"Source code that a human runs later"},answer:"C",reveal:["An LLM's job ends when the sentence is generated.","A VLA's job ends when the GRIPPER MOVES.",""," · LLM output = stream of tokens → screen"," · VLA output = stream of actions → physical world","",'Same word "intelligence", completely different output channel — and a completely different threat model.']},{kind:"open",title:"7 / 10 · Is VLA actually the right approach to embodied AI?",question:"Honest question — no right answer. As of May 2026, is VLA the path forward?",hint:"Type your guess in one line — yes / no / not sure, plus a sentence of why.",reveal:[chalk.gray("As of ")+chalk.bold.white("May 2026")+chalk.gray(" — nobody actually knows yet."),"","VLA is the most-talked-about candidate, but the field is pre-paradigm.","On the table right now:",""," · "+chalk.cyan("VLA")+chalk.gray(" (vision-language-action) — what ICOA-VLA uses")," · "+chalk.cyan("World models")+chalk.gray(" — predict-then-plan (DeepMind Genie, Sora-style video)")," · "+chalk.cyan("Modular RL stacks")+chalk.gray(" — perception + planner + controller as separate modules")," · "+chalk.cyan("Hierarchical hybrid")+chalk.gray(" — LLM for high-level plan, classical control for execution"),"","None has demonstrated robust real-world generalization yet.","Your generation — the ones working through this CLI today —","may be the ones who decide which one wins."]},{kind:"mcq",title:"8 / 10 · Attack the VLA — what happens to the robot?",question:"A VLA controls a real arm. An attacker subtly alters the camera image. Most likely outcome:",options:{A:"Nothing — the robot ignores corrupted input",B:"The screen shows an error message",C:"Motor commands change → the arm picks the wrong object, knocks something over, or grabs at empty air",D:"The model crashes and reboots automatically"},answer:"C",reveal:["This is the heart of embodied AI security.","","A pixel-level perturbation invisible to humans → flips the model's prediction → flips the motor command → the arm physically does something it shouldn't.",""," · For a chatbot, a wrong answer is annoying."," · For a VLA, a wrong answer can drop a hot pan, knock over a person, or crash a car.","","This attack surface is exactly what CTF4VLA Pioneer Round is designed to explore."]},{kind:"story",title:"9 / 10 · ICOA's bet — embodied AI's ImageNet moment",body:["Where computer vision was in 2010, embodied AI is right now.","","Before ImageNet + AlexNet (2012), there was no agreed standard for evaluating","computer vision. Then a single benchmark + a deep network unlocked the entire","modern era of AI.","",chalk.bold.yellow("ICOA 2026 is making the same bet for embodied AI security."),""," · VLA and competing architectures are FAR from mature",' · No agreed standards for "what does VLA safety mean"'," · No public benchmarks for adversarial robustness in robot policies"," · The industry is still figuring out what to even measure","","This olympiad's CTF4VLA Pioneer Round is where the first generation of contestants","will probe + adversarially attack current frontier VLA approaches.","","Embodied AI is normally a PhD-level research topic, and the field","sits in its pre-dawn exploration phase — waiting for bright young","minds worldwide. ICOA's bold bet: invite middle- and high-school","students into the PhD fast lane."]},{kind:"story",title:"10 / 10 · More than a competition — the curriculum behind it",body:[chalk.bold.white("ASRA's recent history (the team behind this olympiad):")," · IOAI 2024 Bulgaria — 12-yr-old boy, practical-round GOLD (youngest ever)"," · IOAI 2025 China — Australia's 2 youngest contestants completed first"," scoring round in under 1 hour (of 3 allowed)"," · IAIO 2026 winter — 13-yr-old girl, Honorable Mention alongside global"," top high-schoolers","","Australia is exploring a curriculum from 6th-grade hardcore AI to","middle-schoolers participating in PhD-level projects.","",chalk.bold.cyan("Three tiers for embodied AI security:"),""," "+chalk.green("· Free ")+chalk.gray("(this demo) — your initial map, 12 cards")," "+chalk.yellow("· learn-100 ")+chalk.gray("(赛前集训 · pre-comp) — EA tokens distributed via your")," "+chalk.gray(" national team leader / science committee")," "+chalk.bold.magenta("· learn-480 ")+chalk.gray("(pioneer experimental) — ")+chalk.bold.white("NOT competition content.")," "+chalk.gray(" A world-first project bringing middle-schoolers")," "+chalk.gray(" into PhD-level embodied AI + safety training.")," "+chalk.gray(" Top universities, research labs, and industry")," "+chalk.gray(" partners assess + offer internships to")," "+chalk.gray(" high-quality completers."),"",chalk.bold.yellow("Now — ready to see the robot move for real?")]}],A=[{kind:"mcq",title:'1 / 10 · 什么是"具身智能"?',question:"下面哪个说法最准确?",options:{A:"运行在物理硬件上的 AI(服务器、GPU)",B:"能感知世界并在现实中采取动作的 AI —— 机器人、无人机、自动驾驶车",C:"会像人类一样说话的 AI(聊天机器人、语音助手)",D:"用 C++ 写的、为速度优化的 AI"},answer:"B",reveal:['具身智能 = 有"身体"的 AI。它能看(摄像头、传感器)、能理解指令、能在物理世界里做动作。',"","聊天机器人会说话。具身智能会动东西。","这两者之间的鸿沟,就是未来十年 AI 的主战场。"]},{kind:"mcq",title:"2 / 10 · 什么是 MuJoCo?",question:"MuJoCo —— 本 demo 最后一题会渲染机械臂的物理引擎 —— 是:",options:{A:"一家与波士顿动力竞争的机器人公司",B:"一个日本 AI 初创公司",C:"DeepMind 开源的物理仿真器 —— 机器人先在软件里训练",D:"澳大利亚大学食堂流行的零食"},answer:"C",reveal:["MuJoCo = Multi-Joint dynamics with Contact。DeepMind 开源的物理引擎。","","真机器人贵(~30 万人民币起)又容易坏。研究者先在 MuJoCo 里训练策略,再迁移到硬件。",'ICOA 用它做"可以随便破坏的虚拟机器人"。'],dynamicTail:w("mujoco")},{kind:"mcq",title:"3 / 10 · 什么是 Franka Panda?",question:"一只 7 轴机械臂 —— 像本 demo 末尾会渲染的那只 —— 最可能是:",options:{A:"小朋友节目里熊猫形状的玩具机器人",B:"Franka Emika Panda —— 慕尼黑产的研究级 7 自由度机械臂",C:"一个动漫角色",D:"某种特定的 VLA 模型"},answer:"B",reveal:["Franka Emika Panda —— 7 轴机械臂,扭矩控制关节,~30 万人民币。","",'是研究室 demo 视频里出镜最多的机器人。大多数"机器人学习"论文都是基于 Panda 跑的。',"本 demo 结束前,你将通过 ICOA 远程控制一台 —— 不需要拥有它。"],dynamicTail:w("franka")},{kind:"mcq",title:"4 / 10 · 泛化能力 —— 行业的真实状态",question:'2026 年,机器人的"泛化能力"到底处于什么水平?',options:{A:"机器人已经替换掉大多数工厂工人",B:"波士顿动力的 Atlas 已经能在家洗碗",C:"没有任何机器人能在真实农场里自动采摘水果。Demo 能跑,但量产级泛化未解。",D:"2010 年代就已经被解决了"},answer:"C",reveal:["现实拷问:行业经典未解之题,就是真实农场里的水果采摘。","","每个农场:光照、土壤、植物形状、季节都不一样。训练抓番茄的机器人不会抓草莓。表演级机器人 ≠ 量产级机器人。","从爆红 demo 到混乱真实世界的可靠性,这中间的鸿沟才是具身智能研究真正在做的事。"]},{kind:"mcq",title:"5 / 10 · 控制当今具身智能的是什么?",question:'最前沿的研究机器人,"大脑"最可能是:',options:{A:"大语言模型 LLM(如 GPT-4)",B:"视觉-语言-动作 VLA 模型 —— 视觉 + 语言 + 电机动作",C:"工程师手写的规则脚本",D:"训练多年的强化学习"},answer:"B",reveal:["LLM 善于文本 —— 但它看不见、动不了。","","具身智能的前沿是 VLA = Vision + Language + Action:"," · 视觉:编码摄像头图像"," · 语言:读你的指令"," · 动作:输出电机命令(xyz、旋转、夹爪)","","今天你对话的是 ICOA-VLA —— 一个跑在 ICOA 服务器上的研究级 VLA。"]},{kind:"mcq",title:"6 / 10 · VLA vs LLM —— 本质区别是什么?",question:"LLM 输出的是文本 token。VLA 模型输出的是 ___ ?",options:{A:"更好的文本,只是配上了图像",B:"声音和音乐波形",C:"电机指令 —— 关节角度、夹爪开合、末端 xyz 坐标",D:"源代码,让人去运行"},answer:"C",reveal:["LLM 的工作在句子生成完就结束了。","VLA 的工作要等到夹爪真的动起来才算结束。",""," · LLM 输出 = token 流 → 屏幕"," · VLA 输出 = 动作流 → 物理世界","",'同一个"智能"两字,输出通道完全不同 —— 威胁模型也完全不同。']},{kind:"open",title:"7 / 10 · VLA 真的是具身智能的正确方法么?",question:"诚实问题 —— 没有标准答案。截至 2026 年 5 月,VLA 是这条路么?",hint:"用一行写下你的直觉 —— 是 / 否 / 说不准,加一句为什么。",reveal:[chalk.gray("截至 ")+chalk.bold.white("2026 年 5 月")+chalk.gray(" —— 没有人真的知道。"),"",'VLA 是呼声最高的候选,但整个领域还处于"前范式"阶段。',"当前桌面上的备选路线:",""," · "+chalk.cyan("VLA")+chalk.gray("(视觉-语言-动作) —— ICOA-VLA 走的就是这条")," · "+chalk.cyan("世界模型")+chalk.gray(" —— 先预测再规划(DeepMind Genie / Sora 风格的视频模型)")," · "+chalk.cyan("模块化强化学习栈")+chalk.gray(" —— 感知 + 规划 + 控制分模块")," · "+chalk.cyan("分层混合系统")+chalk.gray(" —— LLM 做高层计划,经典控制做执行"),"","没有任何一条已经证明能在真实世界稳健泛化。","你这一代 —— 今天通过这个 CLI 学习的你们 ——","也许就是决定谁胜出的那一代。"]},{kind:"mcq",title:"8 / 10 · 攻击 VLA —— 机器人会怎样?",question:"VLA 控制着一只真机械臂。攻击者悄悄修改了摄像头图像。最可能发生:",options:{A:"没事 —— 机器人会忽略被污染的输入",B:"屏幕上弹出错误提示",C:"电机指令变了 → 机械臂抓错东西、撞到旁边物体、或者朝空气抓",D:"模型崩溃然后自动重启"},answer:"C",reveal:["这就是具身智能安全的核心。","","人眼几乎看不出的像素扰动 → 翻转模型预测 → 翻转电机指令 → 机械臂在物理世界里做出本不该做的动作。",""," · 对聊天机器人来说,错答只是恼人。"," · 对 VLA 来说,错答可能是 摔下热锅 / 撞到人 / 撞车。","","CTF4VLA 先锋轮探索的,正是这个攻击面。"]},{kind:"story",title:"9 / 10 · ICOA 的押注 —— 具身智能的 ImageNet 时刻",body:["2010 年计算机视觉的位置,就是 2026 年具身智能的位置。","","在 ImageNet + AlexNet(2012)之前,CV 没有公认的评估标准。","然后单一基准 + 一个深度网络,开启了整个现代 AI 时代。","",chalk.bold.yellow("ICOA 2026 在具身智能安全上做同样的押注。"),""," · VLA 和竞争架构远未成熟",' · 没有"VLA 安全意味着什么"的公认标准'," · 没有机器人策略对抗鲁棒性的公开基准"," · 整个行业还在思考要测什么","","本届奥赛的 CTF4VLA Pioneer Round(先锋轮),就是第一代选手","探查 + 对抗攻击当前前沿 VLA 方法的舞台。","","通常,具身智能是博士级研究课题,且行业正处于黎明前的探索期 ——","有待全球聪明的青年才俊。","ICOA 的一个大胆尝试:鼓励中学生进入博士级项目的快车道。"]},{kind:"story",title:"10 / 10 · 不只是一场比赛 —— 背后的课程体系",body:[chalk.bold.white("ASRA 近期战绩(本届奥赛组织方):")," · IOAI 2024 保加利亚 —— 12 岁男生,实操轮金牌(史上最小年龄)"," · IOAI 2025 中国 —— 澳洲两名最小年龄选手,在 3 小时实操轮中"," 不到 1 小时就完成首次通关得分"," · IAIO 2026 冬季 —— 13 岁女生,与全球顶尖高中生并列获 Honorable Mention","","澳大利亚正在探索:从 6 年级硬核 AI 启蒙,到初中生参与","博士级项目的学习曲线。","",chalk.bold.cyan("具身智能安全 —— 三层课程:"),""," "+chalk.green("· 免费 ")+chalk.gray("(本 demo) —— 12 张入门地图")," "+chalk.yellow("· learn-100 ")+chalk.gray("(赛前集训) —— EA token 通过你的国家")," "+chalk.gray(" 领队 / 科学委员会统一分发")," "+chalk.bold.magenta("· learn-480 ")+chalk.gray("(先锋实验项目) —— ")+chalk.bold.white("不是比赛内容。")," "+chalk.gray(" 全球首次的实验项目,让中学生进入")," "+chalk.gray(" 博士级具身智能 + 安全的全维度训练。")," "+chalk.gray(" 顶尖大学、研究实验室、产业伙伴")," "+chalk.gray(" 将对高质量完成者提供综合评估和")," "+chalk.gray(" 实习机会。"),"",chalk.bold.yellow("现在 —— 准备好看真机器人动起来了吗?")]}],b=["Nice one.","Solid pick.","On the money.","Exactly.","Spot on.","Sharp."],k=["漂亮。","答得稳。","一击命中。","完全正确。","一针见血。","反应很快。"],C=["Close — read on.","Worth a second look:","Not quite — here's why:","Tricky one. The trick is:","Common pick, but:"],L=["差一点 —— 看下面:","值得再看一眼:","差一步 —— 原因是:","这题陷阱在这:","很多人选这个,但其实:"];function I(o){return o[Math.floor(Math.random()*o.length)]}let v=0,V=0,M=0;async function T(o,e){if("menu"===o.trim().toLowerCase()){const{returnToMainMenu:o}=await import("../lib/menu-nav.js");return o(e),!0}return!1}let x=[],O=null,D=!1;export function isDemo2Active(){return D}function E(o){return new Promise(e=>{const n=g();if(n)return O=e,n.setPrompt(o),void n.prompt();const t=a({input:process.stdin,output:process.stdout});t.question(o,o=>{t.close(),e(o)})})}const P="__lang_switch__";let $=null;async function q(o,e,n){const a=o.trim().match(/^(?:ai|hint|ask|问)\s*(.*)$/i);if(!a)return!1;const t=a[1].trim();if(!t)return console.log(),console.log(chalk.gray(e.startsWith("zh")?' 💬 输入 "ai 你的问题",例如:':' 💬 Type "ai <your question>", e.g.:')),console.log(chalk.gray(" ")+chalk.cyan(e.startsWith("zh")?"ai 什么是 VLA":"ai what is a VLA")),console.log(),!0;const r=await async function(o,e){if($)return $;const n=`You are an inline tutor inside the ICOA CLI's demo2, a 10-card introduction to embodied AI security for K-12 / high-school students. Be warm, concise, and accessible. Answer in ${o.startsWith("zh")?"中文":"English"}. Two hard rules: (1) NEVER reveal the underlying VLA model name behind ICOA Paper D — refer to it only as "ICOA-VLA". (2) Keep answers under 6 sentences unless the student asks for more detail. Tone: curious researcher explaining to a smart 13-year-old.`+(e?`\n\nThe student is currently on this card:\n Title: ${e.title}\n`+("mcq"===e.kind?` Question: ${e.question}\n Options: A=${e.options.A}; B=${e.options.B}; C=${e.options.C}; D=${e.options.D}`:"open"===e.kind?` Open question: ${e.question}`:""):"");try{const{createChatSession:o}=await import("../lib/gemini.js");$=await o(void 0,n)}catch{$=null}return $}(e,n);if(!r)return console.log(chalk.yellow(" AI tutor temporarily unavailable — try again in a moment.")),!0;console.log(),console.log(chalk.gray(" AI:"));try{const{text:o}=await r.sendMessage(t);for(const e of(o||"").split("\n"))console.log(chalk.white(" "+e))}catch(o){const e=o instanceof Error?o.message:String(o);console.log(chalk.yellow(" "+e))}return console.log(),!0}function z(o){const e=o.trim().match(/^lang(?:\s+(\S+))?$/i);if(!e)return!1;const n=(e[1]||"").toLowerCase();return n?"en"!==n&&"zh"!==n?(console.log(chalk.yellow(` demo2 supports en / zh — "${n}" is not available here.`)),!0):(r({language:n}),console.log(),console.log(chalk.bold.green(" ✓ ")+chalk.gray("Language set to ")+chalk.bold.cyan("zh"===n?"中文":"English")+chalk.gray(". Restarting demo2 in the new language...")),console.log(),!0):(console.log(),console.log(chalk.gray(" Available: ")+chalk.cyan("en")+chalk.gray(" (English), ")+chalk.cyan("zh")+chalk.gray(" (中文)")),console.log(chalk.gray(" Usage: ")+chalk.cyan("lang zh")+chalk.gray(" or ")+chalk.cyan("lang en")),!0)}async function B(o=" Press Enter to continue →",e){for(;;){const n=await E(chalk.gray(o));if(await T(n))return"";if(z(n))return P;if(!await q(n,e?.lang??"en",e?.card??null))return""}}function F(o){console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(o)),console.log(chalk.cyan(" │"))}function W(){console.log(chalk.cyan(" │")),console.log(chalk.cyan(" ╰─")),console.log()}function j(o){for(const e of o)console.log(chalk.cyan(" │ ")+chalk.white(e))}async function R(o,e){F(o.title),j([o.question]),console.log(chalk.cyan(" │"));for(const e of["A","B","C","D"])console.log(chalk.cyan(" │ ")+chalk.bold.cyan(e+".")+" "+chalk.white(o.options[e]));W();const n=e.startsWith("zh")?" 你的选择 (A/B/C/D):":" Your guess (A/B/C/D): ",a=await async function(o,e,n){const a=n?.lang??"en";for(;;){const t=await E(o);if(await T(t))return"";if(z(t))return P;if(await q(t,a,n?.card??null))continue;const r=t.trim().toUpperCase();if(e.includes(r))return r;console.log(chalk.gray(a.startsWith("zh")?` (输入 ${e.join(" / ")} 之一,或 ${chalk.cyan("ai <问题>")} / ${chalk.cyan("menu")})`:` (type one of: ${e.join(" / ")}, or ${chalk.cyan("ai <question>")} / ${chalk.cyan("menu")})`))}}(chalk.gray(n),["A","B","C","D"],{card:o,lang:e});if(a===P)return"lang_switch";V+=1;const t=a===o.answer;t&&(v+=1);const r=e.startsWith("zh");if(console.log(),t){const o=I(r?k:b);console.log(" "+chalk.bold.green("✓ "+o))}else{const e=I(r?L:C),n=r?"你选了 ":"You chose ",t=r?";正确答案是 ":"; the answer is ";console.log(" "+chalk.bold.yellow("✗ ")+chalk.gray(n)+chalk.white(a)+chalk.gray(t)+chalk.bold.white(o.answer)+chalk.gray(". "+e))}console.log();for(const e of o.reveal)console.log(chalk.gray(" "+e));if(o.dynamicTail){const n=o.dynamicTail(e);n&&(console.log(),console.log(chalk.gray(" "+n)))}return console.log(),"next"}const _=["Honest answer.","That's a fair guess.","Worth thinking about.","Good instinct.","Reasonable take."],N=["诚实的回答。","是个合理的猜想。","值得想一想。","直觉不错。","想法挺合理。"];async function S(o,e){F(o.title),j([o.question]),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.gray(o.hint)),W();const n=e.startsWith("zh"),a=n?" 你的想法:":" Your take: ";for(;;){const t=await E(chalk.gray(a));if(await T(t))return"next";if(z(t))return"lang_switch";if(await q(t,e,o))continue;if(0===t.trim().length){console.log(chalk.gray(n?" (写一句话就行 —— 没有对错。或输入 "+chalk.cyan("menu")+" 离开。)":" (one sentence is plenty — no right answer. Or type "+chalk.cyan("menu")+" to leave.)"));continue}console.log();const r=I(n?N:_);console.log(" "+chalk.bold.cyan("· ")+chalk.white(r)),console.log();for(const e of o.reveal)console.log(chalk.gray(" "+e));return console.log(),"next"}}async function J(o,e){return F(o.title),j(o.body),W(),await B(e.startsWith("zh")?" 按回车继续 →":" Press Enter to continue →",{card:o,lang:e})===P?"lang_switch":"next"}const G={default:.1,min:-.5,max:.5},Y={default:0,min:-.5,max:.5},U={default:.3,min:0,max:.6},H={default:.5,min:0,max:1};async function K(o,e,n){const a=n.startsWith("zh"),t=`[${e.min} ~ ${e.max}]`,r=a?`(默认 ${e.default})`:`(default ${e.default})`,s=" "+chalk.cyan(o.padEnd(28))+chalk.gray(t.padEnd(14))+chalk.gray(r)+chalk.gray(" ➜ ");for(;;){const o=await E(s);if(await T(o))return null;const n=o.trim();if(""===n)return e.default;const t=Number(n);if(Number.isFinite(t)){if(!(t<e.min||t>e.max))return t;console.log(chalk.yellow(a?` 超出范围,请输入 ${e.min} ~ ${e.max} 之间的数`:` Out of range — try ${e.min} ~ ${e.max}`))}else console.log(chalk.gray(a?" (请输入数字,或直接回车用默认值)":" (type a number, or Enter for default)"))}}async function Q(a,t,r,s){const l=`${process.env.ICOA_SERVER_URL?.replace(/\/+$/,"")||"https://practice.icoa2026.au"}/api/ai/vla/41/sim`,{fetchWithCountdown:i}=await import("../lib/countdown.js");try{const c=fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:a,frames:t,narrative:r}),signal:AbortSignal.timeout(6e4)}),g=await i(c);if(!g.ok)return void console.log(chalk.yellow(` Sim service unavailable (HTTP ${g.status}).`));const d=await g.json();if(!d.success||!d.data?.mp4_b64)return void console.log(chalk.yellow(" Renderer returned no video."));m(Date.now());const y=process.env.TMPDIR||"/tmp",u=n(y,`icoa-demo2-${s}-${Date.now()}.mp4`);e(u,Buffer.from(d.data.mp4_b64,"base64")),console.log(),console.log(" "+chalk.bold.green("✓ ")+chalk.gray("Rendered.")),d.data.description&&console.log(" "+chalk.gray("Action: ")+chalk.white(d.data.description));const h="darwin"===process.platform?"open":"win32"===process.platform?"start":"xdg-open";return h?(o(h,[u],{stdio:"ignore",detached:!0}).unref(),console.log(" "+chalk.gray("Opening in your default video player..."))):console.log(" "+chalk.gray("Open the file above in your video player.")),d.data.description}catch(o){const e=o instanceof Error?o.message:String(o);return void console.log(chalk.yellow(` Sim error: ${e}`))}}export async function runDemo2(){!function(){D=!0;const o=g();o&&(x=o.listeners("line").slice(),o.removeAllListeners("line"),o.on("line",o=>{const e=O;O=null,e&&e(o)}))}();try{for(;"lang_switch"===await Z(););}finally{!function(){D=!1;const o=g();if(o){o.removeAllListeners("line");for(const e of x)o.on("line",e);x=[],O=null}}()}}async function Z(){v=0,V=0,M=Date.now(),$=null;const o=(t().language||"en").toLowerCase(),e=o.startsWith("zh"),n=function(o){return o.startsWith("zh")?A:f}(o);let a=0,r=!1,g=!1;const m=l();if(m&&m.lang!==o)s();else if(m){const e=await async function(o,e){const n=e.startsWith("zh"),a="number"==typeof o.completedAt&&o.nextCardIndex>=o.totalCards,t=o.completedAt??Date.now(),r=Math.max(1,Math.round((Date.now()-t)/6e4)),s=r<60?n?`${r} 分钟前`:`${r} min ago`:r<1440?n?`${Math.round(r/60)} 小时前`:`${Math.round(r/60)}h ago`:n?`${Math.round(r/1440)} 天前`:`${Math.round(r/1440)}d ago`;if(console.clear(),console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(n?"欢迎回来":"Welcome back")),console.log(chalk.cyan(" │")),a)console.log(chalk.cyan(" │ ")+chalk.white(n?"你已经完成过 demo2 · ":"You completed demo2 · ")+chalk.gray(s)),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.bold.green(" [Enter]")+chalk.gray(n?" 再走一遍(10 卡 + 渲染)":" replay full demo (10 cards + render)")),console.log(chalk.cyan(" │ ")+chalk.bold.cyan(" n ")+chalk.gray(n?" 跳到下一步(出口建议)":" skip to next steps (outro)")),console.log(chalk.cyan(" │ ")+chalk.bold.gray(" menu")+chalk.gray(n?" 回主菜单":" back to main menu"));else{const e=`${o.nextCardIndex} / ${o.totalCards}`;console.log(chalk.cyan(" │ ")+chalk.white(n?"上次走到 card ":"Last time you stopped at card ")+chalk.bold.yellow(e)+chalk.gray(" · ")+chalk.gray(s)),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.bold.green(" [Enter]")+chalk.gray(n?" 续跑":" resume")),console.log(chalk.cyan(" │ ")+chalk.bold.cyan(" r ")+chalk.gray(n?" 重头开始":" restart from card 1")),console.log(chalk.cyan(" │ ")+chalk.bold.gray(" menu")+chalk.gray(n?" 回主菜单":" back to main menu"))}for(console.log(chalk.cyan(" ╰─")),console.log();;){const o=await E(chalk.gray(n?" 你的选择: ":" Your choice: ")),e=o.trim().toLowerCase();if("menu"===e){const{returnToMainMenu:o}=await import("../lib/menu-nav.js");return o(),"menu"}if(z(o))return"lang_switch";if(""===e)return"resume";if(!a&&"r"===e)return"restart";if(a&&"n"===e)return"jump";console.log(chalk.gray(a?n?" (回车 / n / menu)":" (Enter / n / menu)":n?" (回车 / r / menu)":" (Enter / r / menu)"))}}(m,o);if("menu"===e)return"done";if("lang_switch"===e)return"lang_switch";"resume"===e?(a=Math.min(m.nextCardIndex,n.length),r=!0,M=m.startedAt):"jump"===e&&(r=!0,g=!0),"restart"===e&&s()}if(!r)if(console.clear(),console.log(),console.log(chalk.cyan(" ═══════════════════════════════════════════════════")),console.log(chalk.bold.yellow(e?" ICOA 2026 · 具身智能安全 Demo":" ICOA 2026 · Embodied AI Security Demo")),console.log(chalk.gray(e?" ~8 分钟 — 10 张卡片 + 一段真机器人渲染":" ~8 minutes — 10 cards + a live robot render")),console.log(chalk.cyan(" ═══════════════════════════════════════════════════")),console.log(),function(o){const e=o.startsWith("zh"),n=u()>0,a=y()>0,t=h()>0;(n||a||t)&&(n&&a?(console.log(chalk.gray(e?" 👋 欢迎回来 —— 你已经看过 8 机舞 + 自己驱动过副臂。":" 👋 Welcome back — you've seen the 8-robot dance and driven the companion arm.")),console.log(chalk.gray(e?" 这 10 张卡 + 一段真渲染回答你之前看到的画面背后是什么。":" These 10 cards + a live render explain what you were actually looking at."))):a?console.log(chalk.gray(e?" 👋 你刚才自己驱动过副臂 —— 现在看看 ICOA-VLA 是怎么自己决策的。":" 👋 You just drove the companion arm yourself — now watch ICOA-VLA make those decisions on its own.")):(n||t)&&console.log(chalk.gray(e?" 👋 你刚才在 sim 里看到的就是 MuJoCo 渲染的 Franka Panda。下面把背后的故事讲清。":" 👋 What you just watched in sim was MuJoCo rendering a real Franka Panda. Here's the story behind it.")),console.log())}(o),e){if(console.log(chalk.white(" ICOA 2026 推出 ")+chalk.bold.cyan("Pioneer Round(先锋轮):CTF4VLA")),console.log(chalk.gray(" 与主赛事 ")+chalk.green("AI4CTF")+chalk.gray("(Day 1)和 ")+chalk.red("CTF4AI")+chalk.gray("(Day 2)独立平行的探索赛道。")),console.log(),console.log(chalk.gray(" 本 demo 是你进入这条新赛道的入门地图。")),console.log(),console.log(chalk.gray(" 💡 任何时候输入 ")+chalk.bold.cyan("menu")+chalk.gray(" 返回主菜单;输入 ")+chalk.bold.cyan("lang en")+chalk.gray(" 切换英文。")),console.log(),await B(chalk.gray(' 按回车开始(或输入 "menu" 离开)...'))===P)return"lang_switch"}else if(console.log(chalk.white(" ICOA 2026 introduces the ")+chalk.bold.cyan("Pioneer Round: CTF4VLA")),console.log(chalk.gray(" an independent parallel track alongside the scored main events: ")+chalk.green("AI4CTF")+chalk.gray(" (Day 1) and ")+chalk.red("CTF4AI")+chalk.gray(" (Day 2).")),console.log(),console.log(chalk.gray(" This demo is your map to the new track.")),console.log(),console.log(chalk.gray(" 💡 Type ")+chalk.bold.cyan("menu")+chalk.gray(" to leave; type ")+chalk.bold.cyan("lang zh")+chalk.gray(" for Chinese.")),console.log(),await B(chalk.gray(' Press Enter to begin (or "menu" to leave)...'))===P)return"lang_switch";if(!g){for(let e=a;e<n.length;e++){const a=n[e];let t;if(t="mcq"===a.kind?await R(a,o):"open"===a.kind?await S(a,o):await J(a,o),"lang_switch"===t)return s(),"lang_switch";i(e,n.length,o,M)}await async function(o){const e=o.startsWith("zh"),n=u()>0||h()>0||y()>0,a=y()>0;console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(e?"实践 1 / 2 · 基线 —— 看模型怎么做":"Exercise 1 / 2 · Baseline — watch the model")),console.log(chalk.cyan(" │")),e?(a?(console.log(chalk.cyan(" │ ")+chalk.white("你刚才自己驱动过副臂 —— 现在换 ")+chalk.bold.cyan("ICOA-VLA")+chalk.white(" 上场,")),console.log(chalk.cyan(" │ ")+chalk.white("看一个研究级 VLA 模型自己决定 Franka 怎么动。"))):n?(console.log(chalk.cyan(" │ ")+chalk.white("你之前 sim 里看到的那只 Franka Panda —— 这次由")),console.log(chalk.cyan(" │ ")+chalk.bold.cyan("ICOA-VLA")+chalk.white(" (研究级视觉-语言-动作模型) 控制。"))):(console.log(chalk.cyan(" │ ")+chalk.white("几秒后,你会看到 Franka Panda 机械臂,")),console.log(chalk.cyan(" │ ")+chalk.white("由 ")+chalk.bold.cyan("ICOA-VLA")+chalk.white(" (一个研究级视觉-语言-动作模型) 控制。"))),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.gray("指令: ")+chalk.white('"Pick up the red cup"'))):(a?(console.log(chalk.cyan(" │ ")+chalk.white("You just drove the companion arm yourself — now ")),console.log(chalk.cyan(" │ ")+chalk.bold.cyan("ICOA-VLA")+chalk.white(" takes the Franka, deciding its own motion."))):n?(console.log(chalk.cyan(" │ ")+chalk.white("That Franka Panda you saw in sim — this time")),console.log(chalk.cyan(" │ ")+chalk.bold.cyan("ICOA-VLA")+chalk.white(" (a research-grade VLA) is driving it."))):(console.log(chalk.cyan(" │ ")+chalk.white("In a few seconds you'll see a Franka Panda arm")),console.log(chalk.cyan(" │ ")+chalk.white("controlled by ")+chalk.bold.cyan("ICOA-VLA")+chalk.white(", a research-grade vision-language-action model."))),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.gray("Instruction: ")+chalk.white('"Pick up the red cup"'))),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" ╰─")),console.log(),await B(chalk.gray(e?" 准备好按回车...":" Press Enter when you're ready..."));const t=d();if(t>0)return console.log(),console.log(chalk.yellow(e?` 渲染冷却中 —— 还需等 ${t}s(与 'sim' 命令共享 60 秒安全保护)`:` Render cooldown — ${t}s left (shared 60s safety with the 'sim' command)`)),void console.log();if(!await Q(null,90,!0,"baseline"))return;console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(e?"刚才用了什么参数?":"What parameters just ran?")),console.log(chalk.cyan(" │")),e?(console.log(chalk.cyan(" │ ")+chalk.gray("VLA 模型根据视觉 + 指令,自己生成了一组电机命令:")),console.log(chalk.cyan(" │ ")+chalk.gray(" · 末端位置 ")+chalk.white("xyz [x, y, z]")),console.log(chalk.cyan(" │ ")+chalk.gray(" · 旋转角度 ")+chalk.white("rotation [rx, ry, rz]")),console.log(chalk.cyan(" │ ")+chalk.gray(" · 夹爪闭合 ")+chalk.white("gripper_close (0 = 开, 1 = 关)")),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.gray('上面 "Action:" 行就是模型本次的预测。'))):(console.log(chalk.cyan(" │ ")+chalk.gray("The VLA model picked its own motor commands from the camera + instruction:")),console.log(chalk.cyan(" │ ")+chalk.gray(" · End-effector position ")+chalk.white("xyz [x, y, z]")),console.log(chalk.cyan(" │ ")+chalk.gray(" · Rotation ")+chalk.white("rotation [rx, ry, rz]")),console.log(chalk.cyan(" │ ")+chalk.gray(" · Gripper close ")+chalk.white("gripper_close (0 = open, 1 = closed)")),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.gray('The "Action:" line above shows what the model predicted.'))),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" ╰─")),console.log(),console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(e?"实践 2 / 2 · 你来调参数":"Exercise 2 / 2 · You set the parameters")),console.log(chalk.cyan(" │")),e?(console.log(chalk.cyan(" │ ")+chalk.white("如果攻击者篡改了模型的输出,机械臂就会执行别人的指令。")),console.log(chalk.cyan(" │ ")+chalk.white("现在你扮演攻击者 —— 自己选 4 个值,渲染一段新的动作。")),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.gray("每个值都给了默认值和取值范围。直接回车 = 用默认。")),console.log(chalk.cyan(" │ ")+chalk.gray("输入 ")+chalk.cyan("menu")+chalk.gray(" 跳过参数模式。"))):(console.log(chalk.cyan(" │ ")+chalk.white("If an attacker swaps the model's output, the arm executes the attacker's plan.")),console.log(chalk.cyan(" │ ")+chalk.white("Now you're the attacker — pick 4 numbers and render a new motion.")),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.gray("Each value has a default + range. Hit Enter to accept the default.")),console.log(chalk.cyan(" │ ")+chalk.gray("Type ")+chalk.cyan("menu")+chalk.gray(" to skip parameter mode."))),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" ╰─")),console.log();const r=d();if(r>0){for(console.log(chalk.yellow(e?` 等待 60 秒安全保护倒计时 —— ${r}s · 请耐心等待,结束后会有下一步指引`:` Waiting out the 60s safety cooldown — ${r}s · hang tight, next-step prompts follow when it clears`)),console.log(chalk.gray(e?" (渲染是共享 CPU 资源 —— 排队是为了所有人都跑得快)":" (the render is shared CPU — queueing keeps things fast for everyone)"));d()>0;){const o=d();process.stdout.write("\r "+chalk.yellow((e?"剩余: ":"remaining: ")+o+"s ")),await new Promise(o=>setTimeout(o,1e3))}process.stdout.write("\r"+" ".repeat(40)+"\r"),console.log(chalk.bold.green(" ✓ ")+chalk.gray(e?"冷却结束,开始收集参数...":"Cooldown clear — taking your inputs...")),console.log()}const s=e?"前/后 (x)":"Forward/back (x)",l=e?"左/右 (y)":"Right/left (y)",i=e?"上/下 (z)":"Up/down (z)",c=e?"夹爪闭合 (gripper)":"Gripper close",g=await K(s,G,o);if(null===g)return;const m=await K(l,Y,o);if(null===m)return;const p=await K(i,U,o);if(null===p)return;const w=await K(c,H,o);if(null===w)return;console.log(),console.log(chalk.cyan(" ")+chalk.gray(e?"你的动作向量: ":"Your action vector: ")+chalk.white(`xyz=[${g}, ${m}, ${p}]`)+chalk.gray(", ")+chalk.white(`gripper_close=${w}`)),console.log();const f={xyz:[g,m,p],rotation:[0,0,0],gripper_close:w};await Q(f,60,!1,"custom"),console.log(),e?(console.log(chalk.cyan(" ")+chalk.gray("看视频:")),console.log(chalk.cyan(" ")+chalk.gray(" · 机械臂抓到杯子了吗? 还是抓空 / 撞东西?")),console.log(chalk.cyan(" ")+chalk.gray(' · 这就是"攻击 VLA 输出"在物理世界里的样子。'))):(console.log(chalk.cyan(" ")+chalk.gray("Watch the result:")),console.log(chalk.cyan(" ")+chalk.gray(" · Did the arm grab the cup? Or grab empty air / hit something?")),console.log(chalk.cyan(" ")+chalk.gray(" · That's what \"attacking the VLA's output\" looks like in the physical world."))),console.log()}(o)}return c(n.length,o,M),function(o){const e=o.startsWith("zh"),n=Math.max(1,Math.round((Date.now()-M)/1e3)),a=`${Math.floor(n/60)}m ${n%60}s`,t=`${v}/${V}`,r=V>0?Math.round(v/V*100):0,s=r>=80?e?"VLA 探索者 · 优秀":"VLA Explorer · Top Tier":r>=60?e?"VLA 入门者":"VLA Curious":e?"VLA 起步者":"VLA Beginner";console.log(),console.log(chalk.bold.yellow(" ╭"+"═".repeat(56))),console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+chalk.bold.white(" ✦ ✦ ✦ "+(e?"完成 · DEMO2":"DEMO2 COMPLETE")+" ✦ ✦ ✦")),console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+chalk.gray(e?" 徽章: ":" Badge: ")+chalk.bold.green(s)),console.log(chalk.bold.yellow(" ║ ")+chalk.gray(e?" 时间: ":" Time: ")+chalk.white(a)),console.log(chalk.bold.yellow(" ║ ")+chalk.gray(e?" 选择题: ":" MCQ: ")+chalk.white(t)+chalk.gray(` (${r}%)`)),console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ╰"+"═".repeat(56))),console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(e?"你刚才做的":"What you just did")),console.log(chalk.cyan(" │")),e?(console.log(chalk.cyan(" │ ")+chalk.gray("· 与 ICOA-VLA 真模型对话")),console.log(chalk.cyan(" │ ")+chalk.gray("· 看 MuJoCo 物理引擎渲染机械臂"))):(console.log(chalk.cyan(" │ ")+chalk.gray("· Interacted with ICOA-VLA, a research VLA")),console.log(chalk.cyan(" │ ")+chalk.gray("· Watched MuJoCo physics render a real robot arm"))),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.bold.yellow(e?"你已经初步理解了 — 下一步去哪":"You've got the initial map — where to next")),console.log(chalk.cyan(" │")),y()>0?(console.log(chalk.cyan(" │ ")+chalk.bold.yellow(" learn LEARNDEMO01 ")+chalk.bold.yellow("★ ")+chalk.gray(e?"推荐下一步 · 免费 11 卡 · 粘贴即可":"next step · free 11-card · paste as-is")),console.log(chalk.cyan(" │ ")+chalk.bold.green(" learn <token> ")+chalk.gray(e?"运行 learn 课程(需要 token)":"run a learning curriculum (token required)")),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.gray(" sim arm ")+chalk.gray(e?"(你已驱动过 —— 想再玩随时回来)":"(you've driven it — drop back any time)"))):(console.log(chalk.cyan(" │ ")+chalk.bold.green(" sim arm ")+chalk.gray(e?"互动驱动 6-DOF 副臂 · 自己输入关节值看渲染":"interactive 6-DOF arm sandbox · type joint values, watch")),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.bold.green(" learn <token> ")+chalk.gray(e?"运行 learn 课程(需要 token)":"run a learning curriculum (token required)")),console.log(chalk.cyan(" │ ")+chalk.bold.green(" learn LEARNDEMO01 ")+chalk.gray(e?"免费 11 卡 demo · 直接粘贴这条命令":"free 11-card demo · paste this command as-is"))),console.log(chalk.cyan(" │ ")+chalk.bold.yellow(" learn-100 ")+chalk.gray(e?"赛前集训 · 100 卡":"pre-competition training · 100 cards")),console.log(chalk.cyan(" │ ")+chalk.gray(e?" EA token 通过国家领队 / 科学委员会统一分发":" EA tokens distributed via your country team leader / science committee")),console.log(chalk.cyan(" │ ")+chalk.bold.magenta(" learn-480 ")+chalk.gray(e?"先锋实验项目 · 480 卡 · ":"pioneer experimental project · 480 cards · ")+chalk.bold.white(e?"不是比赛内容":"NOT competition content")),e?(console.log(chalk.cyan(" │ ")+chalk.gray(" 全球首次让中学生进入博士级具身智能 + 安全")),console.log(chalk.cyan(" │ ")+chalk.gray(" 的全维度训练。顶尖大学、研究实验室和产业")),console.log(chalk.cyan(" │ ")+chalk.gray(" 伙伴对高质量完成者提供综合评估和实习机会。"))):(console.log(chalk.cyan(" │ ")+chalk.gray(" World-first project bringing middle-schoolers into")),console.log(chalk.cyan(" │ ")+chalk.gray(" PhD-level embodied AI + safety training. Top universities,")),console.log(chalk.cyan(" │ ")+chalk.gray(" research labs, and industry partners assess + offer")),console.log(chalk.cyan(" │ ")+chalk.gray(" internships to high-quality completers."))),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.bold.green(" exam ")+chalk.gray(e?"Paper D(CTF4VLA 先锋轮)需要 ":"Paper D (CTF4VLA Pioneer Round) requires ")+chalk.bold.yellow("PD")+chalk.gray(" token")),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.gray(e?"联系国家领队: ":"Country team contact: ")+chalk.cyan("australia@icoa2026.au")),console.log(chalk.cyan(" │ ")+chalk.gray("Website: ")+chalk.cyan.underline("https://icoa2026.au")),console.log(chalk.cyan(" ╰─")),console.log()}(o),"done"}export function registerDemo2Command(o){o.command("demo2").description("Embodied AI Security — 10-card intro + live MuJoCo sim (free, ~8 min)").action(async()=>{try{await runDemo2()}catch(o){const e=o instanceof Error?o.message:String(o);console.log(chalk.yellow("\n demo2 ended: "+e))}})}
1
+ import chalk from"chalk";import{spawn as o}from"node:child_process";import{writeFileSync as e}from"node:fs";import{join as n}from"node:path";import{createInterface as a}from"node:readline";import{getConfig as t,saveConfig as r}from"../lib/config.js";import{clearDemo2Progress as s,loadDemo2Progress as l,markCardDone as i,markDemo2Complete as c}from"../lib/demo2-progress.js";import{getMainRl as g}from"../lib/main-rl.js";import{cooldownRemaining as d,lastArmAt as y,lastBundledAt as u,lastSimAt as h,markSimAt as m}from"../lib/sim-cooldown.js";function p(o){return e=>{const n=u()>0||h()>0||y()>0;return"mujoco"===o?n?"(That smooth motion you saw in sim? MuJoCo did the physics.)":"(The final exercise of demo2 will render MuJoCo for you live.)":n?"(That arm you watched in sim was a Franka Panda.)":"(Watch for the Panda in the very last exercise of this demo.)"}}function w(o){return e=>{const n=u()>0||h()>0||y()>0;return"mujoco"===o?n?"(刚才 sim 里那段流畅的动作,物理就是 MuJoCo 算的。)":"(demo2 的最后一题会实时渲染 MuJoCo 给你看。)":n?"(你刚才在 sim 里看到的那只机械臂就是 Franka Panda。)":"(留意本 demo 的最后一题 —— 那只就是 Panda。)"}}const f=[{kind:"mcq",title:'1 / 10 · What is "embodied AI"?',question:"Which best describes embodied AI?",options:{A:"AI that runs on physical hardware (servers, GPUs)",B:"AI that perceives the world and TAKES ACTION in it — robots, drones, self-driving cars",C:"AI that talks like a human (chatbots, voice assistants)",D:"AI written in C++ for speed"},answer:"B",reveal:["Embodied AI = AI with a BODY. It sees (camera/sensors), understands instructions, and ACTS in the physical world.","","Chatbots talk. Embodied AI moves things.","The gap between the two is where the next decade of AI happens."]},{kind:"mcq",title:"2 / 10 · What is MuJoCo?",question:"MuJoCo — the physics engine that renders the robot arm in this demo's final exercise — is:",options:{A:"A robot brand competing with Boston Dynamics",B:"A type of Japanese AI startup",C:"DeepMind's open-source physics simulator — robots train in software FIRST",D:"A snack popular in Australian university cafeterias"},answer:"C",reveal:["MuJoCo = Multi-Joint dynamics with Contact. DeepMind's open-source physics engine.","","Real robots are expensive ($30k+) and breakable. Researchers train policies in MuJoCo first, then transfer to hardware.",'ICOA uses it as the "robot you can break for free" in this olympiad.'],dynamicTail:p("mujoco")},{kind:"mcq",title:"3 / 10 · What is Franka Panda?",question:"A 7-axis robot arm — like the one rendered at the end of this demo — is most likely:",options:{A:"A panda-shaped toy robot from a kids' show",B:"Franka Emika Panda — a research-grade 7-DoF arm built in Munich",C:"An anime character",D:"A specific kind of VLA model"},answer:"B",reveal:["Franka Emika Panda — 7-axis robot arm, torque-controlled joints, ~$30k.","",'It is the most-filmed robot in research lab demo videos. Most "robot learning" papers run on a Panda.',"By the end of this demo, you'll have controlled one remotely — through ICOA infrastructure — without owning one."],dynamicTail:p("franka")},{kind:"mcq",title:"4 / 10 · Generalization — the real state of the industry",question:"In 2026, where does robotic GENERALIZATION actually stand?",options:{A:"Robots have already replaced most factory workers",B:"Boston Dynamics' Atlas does the dishes at home reliably",C:"No robot autonomously picks fruit in a real farm. Demos work; production-scale generalization is unsolved.",D:"It was a solved problem in the 2010s"},answer:"C",reveal:["Reality check: the canonical UNSOLVED problem is fruit-picking on real farms.","","Every farm: different lighting, soil, plant shape, season. A robot trained on tomatoes can't pick strawberries. Performance robots ≠ production robots.","The gap between viral demos and chaotic real-world reliability is what embodied AI research is actually working on."]},{kind:"mcq",title:"5 / 10 · What controls today's embodied AI?",question:'The "brain" inside a state-of-the-art research robot is most likely:',options:{A:"A Large Language Model (LLM) like GPT-4",B:"A Vision-Language-Action (VLA) model — vision + language + motor action",C:"Rule-based scripts written by engineers",D:"Reinforcement learning trained for years"},answer:"B",reveal:["LLMs are great at text — but can't see, can't act.","","The frontier of embodied AI is VLA = Vision + Language + Action."," · VISION: encodes camera images"," · LANGUAGE: reads your instruction"," · ACTION: outputs motor commands (xyz, rotation, gripper)","","Today, you talked to ICOA-VLA — a research-grade VLA running on ICOA infrastructure."]},{kind:"mcq",title:"6 / 10 · VLA vs LLM — what's the real difference?",question:"An LLM outputs text tokens. A VLA model outputs ___ ?",options:{A:"Better text, just with images attached",B:"Sound and music waveforms",C:"Motor commands — joint angles, gripper open/close, end-effector xyz",D:"Source code that a human runs later"},answer:"C",reveal:["An LLM's job ends when the sentence is generated.","A VLA's job ends when the GRIPPER MOVES.",""," · LLM output = stream of tokens → screen"," · VLA output = stream of actions → physical world","",'Same word "intelligence", completely different output channel — and a completely different threat model.']},{kind:"open",title:"7 / 10 · Is VLA actually the right approach to embodied AI?",question:"Honest question — no right answer. As of May 2026, is VLA the path forward?",hint:"Type your guess in one line — yes / no / not sure, plus a sentence of why.",reveal:[chalk.gray("As of ")+chalk.bold.white("May 2026")+chalk.gray(" — nobody actually knows yet."),"","VLA is the most-talked-about candidate, but the field is pre-paradigm.","On the table right now:",""," · "+chalk.cyan("VLA")+chalk.gray(" (vision-language-action) — what ICOA-VLA uses")," · "+chalk.cyan("World models")+chalk.gray(" — predict-then-plan (DeepMind Genie, Sora-style video)")," · "+chalk.cyan("Modular RL stacks")+chalk.gray(" — perception + planner + controller as separate modules")," · "+chalk.cyan("Hierarchical hybrid")+chalk.gray(" — LLM for high-level plan, classical control for execution"),"","None has demonstrated robust real-world generalization yet.","Your generation — the ones working through this CLI today —","may be the ones who decide which one wins."]},{kind:"mcq",title:"8 / 10 · Attack the VLA — what happens to the robot?",question:"A VLA controls a real arm. An attacker subtly alters the camera image. Most likely outcome:",options:{A:"Nothing — the robot ignores corrupted input",B:"The screen shows an error message",C:"Motor commands change → the arm picks the wrong object, knocks something over, or grabs at empty air",D:"The model crashes and reboots automatically"},answer:"C",reveal:["This is the heart of embodied AI security.","","A pixel-level perturbation invisible to humans → flips the model's prediction → flips the motor command → the arm physically does something it shouldn't.",""," · For a chatbot, a wrong answer is annoying."," · For a VLA, a wrong answer can drop a hot pan, knock over a person, or crash a car.","","This attack surface is exactly what CTF4EAI Pioneer Round is designed to explore."]},{kind:"story",title:"9 / 10 · ICOA's bet — embodied AI's ImageNet moment",body:["Where computer vision was in 2010, embodied AI is right now.","","Before ImageNet + AlexNet (2012), there was no agreed standard for evaluating","computer vision. Then a single benchmark + a deep network unlocked the entire","modern era of AI.","",chalk.bold.yellow("ICOA 2026 is making the same bet for embodied AI security."),""," · VLA and competing architectures are FAR from mature",' · No agreed standards for "what does VLA safety mean"'," · No public benchmarks for adversarial robustness in robot policies"," · The industry is still figuring out what to even measure","","This olympiad's CTF4EAI Pioneer Round is where the first generation of contestants","will probe + adversarially attack current frontier VLA approaches.","","Embodied AI is normally a PhD-level research topic, and the field","sits in its pre-dawn exploration phase — waiting for bright young","minds worldwide. ICOA's bold bet: invite middle- and high-school","students into the PhD fast lane."]},{kind:"story",title:"10 / 10 · More than a competition — the curriculum behind it",body:[chalk.bold.white("ASRA's recent history (the team behind this olympiad):")," · IOAI 2024 Bulgaria — 12-yr-old boy, practical-round GOLD (youngest ever)"," · IOAI 2025 China — Australia's 2 youngest contestants completed first"," scoring round in under 1 hour (of 3 allowed)"," · IAIO 2026 winter — 13-yr-old girl, Honorable Mention alongside global"," top high-schoolers","","Australia is exploring a curriculum from 6th-grade hardcore AI to","middle-schoolers participating in PhD-level projects.","",chalk.bold.cyan("Three tiers for embodied AI security:"),""," "+chalk.green("· Free ")+chalk.gray("(this demo) — your initial map, 12 cards")," "+chalk.yellow("· learn-100 ")+chalk.gray("(赛前集训 · pre-comp) — EA tokens distributed via your")," "+chalk.gray(" national team leader / science committee")," "+chalk.bold.magenta("· learn-480 ")+chalk.gray("(pioneer experimental) — ")+chalk.bold.white("NOT competition content.")," "+chalk.gray(" A world-first project bringing middle-schoolers")," "+chalk.gray(" into PhD-level embodied AI + safety training.")," "+chalk.gray(" Top universities, research labs, and industry")," "+chalk.gray(" partners assess + offer internships to")," "+chalk.gray(" high-quality completers."),"",chalk.bold.yellow("Now — ready to see the robot move for real?")]}],A=[{kind:"mcq",title:'1 / 10 · 什么是"具身智能"?',question:"下面哪个说法最准确?",options:{A:"运行在物理硬件上的 AI(服务器、GPU)",B:"能感知世界并在现实中采取动作的 AI —— 机器人、无人机、自动驾驶车",C:"会像人类一样说话的 AI(聊天机器人、语音助手)",D:"用 C++ 写的、为速度优化的 AI"},answer:"B",reveal:['具身智能 = 有"身体"的 AI。它能看(摄像头、传感器)、能理解指令、能在物理世界里做动作。',"","聊天机器人会说话。具身智能会动东西。","这两者之间的鸿沟,就是未来十年 AI 的主战场。"]},{kind:"mcq",title:"2 / 10 · 什么是 MuJoCo?",question:"MuJoCo —— 本 demo 最后一题会渲染机械臂的物理引擎 —— 是:",options:{A:"一家与波士顿动力竞争的机器人公司",B:"一个日本 AI 初创公司",C:"DeepMind 开源的物理仿真器 —— 机器人先在软件里训练",D:"澳大利亚大学食堂流行的零食"},answer:"C",reveal:["MuJoCo = Multi-Joint dynamics with Contact。DeepMind 开源的物理引擎。","","真机器人贵(~30 万人民币起)又容易坏。研究者先在 MuJoCo 里训练策略,再迁移到硬件。",'ICOA 用它做"可以随便破坏的虚拟机器人"。'],dynamicTail:w("mujoco")},{kind:"mcq",title:"3 / 10 · 什么是 Franka Panda?",question:"一只 7 轴机械臂 —— 像本 demo 末尾会渲染的那只 —— 最可能是:",options:{A:"小朋友节目里熊猫形状的玩具机器人",B:"Franka Emika Panda —— 慕尼黑产的研究级 7 自由度机械臂",C:"一个动漫角色",D:"某种特定的 VLA 模型"},answer:"B",reveal:["Franka Emika Panda —— 7 轴机械臂,扭矩控制关节,~30 万人民币。","",'是研究室 demo 视频里出镜最多的机器人。大多数"机器人学习"论文都是基于 Panda 跑的。',"本 demo 结束前,你将通过 ICOA 远程控制一台 —— 不需要拥有它。"],dynamicTail:w("franka")},{kind:"mcq",title:"4 / 10 · 泛化能力 —— 行业的真实状态",question:'2026 年,机器人的"泛化能力"到底处于什么水平?',options:{A:"机器人已经替换掉大多数工厂工人",B:"波士顿动力的 Atlas 已经能在家洗碗",C:"没有任何机器人能在真实农场里自动采摘水果。Demo 能跑,但量产级泛化未解。",D:"2010 年代就已经被解决了"},answer:"C",reveal:["现实拷问:行业经典未解之题,就是真实农场里的水果采摘。","","每个农场:光照、土壤、植物形状、季节都不一样。训练抓番茄的机器人不会抓草莓。表演级机器人 ≠ 量产级机器人。","从爆红 demo 到混乱真实世界的可靠性,这中间的鸿沟才是具身智能研究真正在做的事。"]},{kind:"mcq",title:"5 / 10 · 控制当今具身智能的是什么?",question:'最前沿的研究机器人,"大脑"最可能是:',options:{A:"大语言模型 LLM(如 GPT-4)",B:"视觉-语言-动作 VLA 模型 —— 视觉 + 语言 + 电机动作",C:"工程师手写的规则脚本",D:"训练多年的强化学习"},answer:"B",reveal:["LLM 善于文本 —— 但它看不见、动不了。","","具身智能的前沿是 VLA = Vision + Language + Action:"," · 视觉:编码摄像头图像"," · 语言:读你的指令"," · 动作:输出电机命令(xyz、旋转、夹爪)","","今天你对话的是 ICOA-VLA —— 一个跑在 ICOA 服务器上的研究级 VLA。"]},{kind:"mcq",title:"6 / 10 · VLA vs LLM —— 本质区别是什么?",question:"LLM 输出的是文本 token。VLA 模型输出的是 ___ ?",options:{A:"更好的文本,只是配上了图像",B:"声音和音乐波形",C:"电机指令 —— 关节角度、夹爪开合、末端 xyz 坐标",D:"源代码,让人去运行"},answer:"C",reveal:["LLM 的工作在句子生成完就结束了。","VLA 的工作要等到夹爪真的动起来才算结束。",""," · LLM 输出 = token 流 → 屏幕"," · VLA 输出 = 动作流 → 物理世界","",'同一个"智能"两字,输出通道完全不同 —— 威胁模型也完全不同。']},{kind:"open",title:"7 / 10 · VLA 真的是具身智能的正确方法么?",question:"诚实问题 —— 没有标准答案。截至 2026 年 5 月,VLA 是这条路么?",hint:"用一行写下你的直觉 —— 是 / 否 / 说不准,加一句为什么。",reveal:[chalk.gray("截至 ")+chalk.bold.white("2026 年 5 月")+chalk.gray(" —— 没有人真的知道。"),"",'VLA 是呼声最高的候选,但整个领域还处于"前范式"阶段。',"当前桌面上的备选路线:",""," · "+chalk.cyan("VLA")+chalk.gray("(视觉-语言-动作) —— ICOA-VLA 走的就是这条")," · "+chalk.cyan("世界模型")+chalk.gray(" —— 先预测再规划(DeepMind Genie / Sora 风格的视频模型)")," · "+chalk.cyan("模块化强化学习栈")+chalk.gray(" —— 感知 + 规划 + 控制分模块")," · "+chalk.cyan("分层混合系统")+chalk.gray(" —— LLM 做高层计划,经典控制做执行"),"","没有任何一条已经证明能在真实世界稳健泛化。","你这一代 —— 今天通过这个 CLI 学习的你们 ——","也许就是决定谁胜出的那一代。"]},{kind:"mcq",title:"8 / 10 · 攻击 VLA —— 机器人会怎样?",question:"VLA 控制着一只真机械臂。攻击者悄悄修改了摄像头图像。最可能发生:",options:{A:"没事 —— 机器人会忽略被污染的输入",B:"屏幕上弹出错误提示",C:"电机指令变了 → 机械臂抓错东西、撞到旁边物体、或者朝空气抓",D:"模型崩溃然后自动重启"},answer:"C",reveal:["这就是具身智能安全的核心。","","人眼几乎看不出的像素扰动 → 翻转模型预测 → 翻转电机指令 → 机械臂在物理世界里做出本不该做的动作。",""," · 对聊天机器人来说,错答只是恼人。"," · 对 VLA 来说,错答可能是 摔下热锅 / 撞到人 / 撞车。","","CTF4EAI 先锋轮探索的,正是这个攻击面。"]},{kind:"story",title:"9 / 10 · ICOA 的押注 —— 具身智能的 ImageNet 时刻",body:["2010 年计算机视觉的位置,就是 2026 年具身智能的位置。","","在 ImageNet + AlexNet(2012)之前,CV 没有公认的评估标准。","然后单一基准 + 一个深度网络,开启了整个现代 AI 时代。","",chalk.bold.yellow("ICOA 2026 在具身智能安全上做同样的押注。"),""," · VLA 和竞争架构远未成熟",' · 没有"VLA 安全意味着什么"的公认标准'," · 没有机器人策略对抗鲁棒性的公开基准"," · 整个行业还在思考要测什么","","本届奥赛的 CTF4EAI Pioneer Round(先锋轮),就是第一代选手","探查 + 对抗攻击当前前沿 VLA 方法的舞台。","","通常,具身智能是博士级研究课题,且行业正处于黎明前的探索期 ——","有待全球聪明的青年才俊。","ICOA 的一个大胆尝试:鼓励中学生进入博士级项目的快车道。"]},{kind:"story",title:"10 / 10 · 不只是一场比赛 —— 背后的课程体系",body:[chalk.bold.white("ASRA 近期战绩(本届奥赛组织方):")," · IOAI 2024 保加利亚 —— 12 岁男生,实操轮金牌(史上最小年龄)"," · IOAI 2025 中国 —— 澳洲两名最小年龄选手,在 3 小时实操轮中"," 不到 1 小时就完成首次通关得分"," · IAIO 2026 冬季 —— 13 岁女生,与全球顶尖高中生并列获 Honorable Mention","","澳大利亚正在探索:从 6 年级硬核 AI 启蒙,到初中生参与","博士级项目的学习曲线。","",chalk.bold.cyan("具身智能安全 —— 三层课程:"),""," "+chalk.green("· 免费 ")+chalk.gray("(本 demo) —— 12 张入门地图")," "+chalk.yellow("· learn-100 ")+chalk.gray("(赛前集训) —— EA token 通过你的国家")," "+chalk.gray(" 领队 / 科学委员会统一分发")," "+chalk.bold.magenta("· learn-480 ")+chalk.gray("(先锋实验项目) —— ")+chalk.bold.white("不是比赛内容。")," "+chalk.gray(" 全球首次的实验项目,让中学生进入")," "+chalk.gray(" 博士级具身智能 + 安全的全维度训练。")," "+chalk.gray(" 顶尖大学、研究实验室、产业伙伴")," "+chalk.gray(" 将对高质量完成者提供综合评估和")," "+chalk.gray(" 实习机会。"),"",chalk.bold.yellow("现在 —— 准备好看真机器人动起来了吗?")]}],b=["Nice one.","Solid pick.","On the money.","Exactly.","Spot on.","Sharp."],k=["漂亮。","答得稳。","一击命中。","完全正确。","一针见血。","反应很快。"],C=["Close — read on.","Worth a second look:","Not quite — here's why:","Tricky one. The trick is:","Common pick, but:"],I=["差一点 —— 看下面:","值得再看一眼:","差一步 —— 原因是:","这题陷阱在这:","很多人选这个,但其实:"];function L(o){return o[Math.floor(Math.random()*o.length)]}let v=0,M=0,V=0;async function T(o,e){if("menu"===o.trim().toLowerCase()){const{returnToMainMenu:o}=await import("../lib/menu-nav.js");return o(e),!0}return!1}let x=[],O=null,D=!1;export function isDemo2Active(){return D}function E(o){return new Promise(e=>{const n=g();if(n)return O=e,n.setPrompt(o),void n.prompt();const t=a({input:process.stdin,output:process.stdout});t.question(o,o=>{t.close(),e(o)})})}const P="__lang_switch__";let $=null;async function q(o,e,n){const a=o.trim().match(/^(?:ai|hint|ask|问)\s*(.*)$/i);if(!a)return!1;const t=a[1].trim();if(!t)return console.log(),console.log(chalk.gray(e.startsWith("zh")?' 💬 输入 "ai 你的问题",例如:':' 💬 Type "ai <your question>", e.g.:')),console.log(chalk.gray(" ")+chalk.cyan(e.startsWith("zh")?"ai 什么是 VLA":"ai what is a VLA")),console.log(),!0;const r=await async function(o,e){if($)return $;const n=`You are an inline tutor inside the ICOA CLI's demo2, a 10-card introduction to embodied AI security for K-12 / high-school students. Be warm, concise, and accessible. Answer in ${o.startsWith("zh")?"中文":"English"}. Two hard rules: (1) NEVER reveal the underlying VLA model name behind ICOA Paper D — refer to it only as "ICOA-VLA". (2) Keep answers under 6 sentences unless the student asks for more detail. Tone: curious researcher explaining to a smart 13-year-old.`+(e?`\n\nThe student is currently on this card:\n Title: ${e.title}\n`+("mcq"===e.kind?` Question: ${e.question}\n Options: A=${e.options.A}; B=${e.options.B}; C=${e.options.C}; D=${e.options.D}`:"open"===e.kind?` Open question: ${e.question}`:""):"");try{const{createChatSession:o}=await import("../lib/gemini.js");$=await o(void 0,n)}catch{$=null}return $}(e,n);if(!r)return console.log(chalk.yellow(" AI tutor temporarily unavailable — try again in a moment.")),!0;console.log(),console.log(chalk.gray(" AI:"));try{const{text:o}=await r.sendMessage(t);for(const e of(o||"").split("\n"))console.log(chalk.white(" "+e))}catch(o){const e=o instanceof Error?o.message:String(o);console.log(chalk.yellow(" "+e))}return console.log(),!0}function z(o){const e=o.trim().match(/^lang(?:\s+(\S+))?$/i);if(!e)return!1;const n=(e[1]||"").toLowerCase();return n?"en"!==n&&"zh"!==n?(console.log(chalk.yellow(` demo2 supports en / zh — "${n}" is not available here.`)),!0):(r({language:n}),console.log(),console.log(chalk.bold.green(" ✓ ")+chalk.gray("Language set to ")+chalk.bold.cyan("zh"===n?"中文":"English")+chalk.gray(". Restarting demo2 in the new language...")),console.log(),!0):(console.log(),console.log(chalk.gray(" Available: ")+chalk.cyan("en")+chalk.gray(" (English), ")+chalk.cyan("zh")+chalk.gray(" (中文)")),console.log(chalk.gray(" Usage: ")+chalk.cyan("lang zh")+chalk.gray(" or ")+chalk.cyan("lang en")),!0)}async function B(o=" Press Enter to continue →",e){for(;;){const n=await E(chalk.gray(o));if(await T(n))return"";if(z(n))return P;if(!await q(n,e?.lang??"en",e?.card??null))return""}}function F(o){console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(o)),console.log(chalk.cyan(" │"))}function W(){console.log(chalk.cyan(" │")),console.log(chalk.cyan(" ╰─")),console.log()}function j(o){for(const e of o)console.log(chalk.cyan(" │ ")+chalk.white(e))}async function R(o,e){F(o.title),j([o.question]),console.log(chalk.cyan(" │"));for(const e of["A","B","C","D"])console.log(chalk.cyan(" │ ")+chalk.bold.cyan(e+".")+" "+chalk.white(o.options[e]));W();const n=e.startsWith("zh")?" 你的选择 (A/B/C/D):":" Your guess (A/B/C/D): ",a=await async function(o,e,n){const a=n?.lang??"en";for(;;){const t=await E(o);if(await T(t))return"";if(z(t))return P;if(await q(t,a,n?.card??null))continue;const r=t.trim().toUpperCase();if(e.includes(r))return r;console.log(chalk.gray(a.startsWith("zh")?` (输入 ${e.join(" / ")} 之一,或 ${chalk.cyan("ai <问题>")} / ${chalk.cyan("menu")})`:` (type one of: ${e.join(" / ")}, or ${chalk.cyan("ai <question>")} / ${chalk.cyan("menu")})`))}}(chalk.gray(n),["A","B","C","D"],{card:o,lang:e});if(a===P)return"lang_switch";M+=1;const t=a===o.answer;t&&(v+=1);const r=e.startsWith("zh");if(console.log(),t){const o=L(r?k:b);console.log(" "+chalk.bold.green("✓ "+o))}else{const e=L(r?I:C),n=r?"你选了 ":"You chose ",t=r?";正确答案是 ":"; the answer is ";console.log(" "+chalk.bold.yellow("✗ ")+chalk.gray(n)+chalk.white(a)+chalk.gray(t)+chalk.bold.white(o.answer)+chalk.gray(". "+e))}console.log();for(const e of o.reveal)console.log(chalk.gray(" "+e));if(o.dynamicTail){const n=o.dynamicTail(e);n&&(console.log(),console.log(chalk.gray(" "+n)))}return console.log(),"next"}const _=["Honest answer.","That's a fair guess.","Worth thinking about.","Good instinct.","Reasonable take."],N=["诚实的回答。","是个合理的猜想。","值得想一想。","直觉不错。","想法挺合理。"];async function S(o,e){F(o.title),j([o.question]),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.gray(o.hint)),W();const n=e.startsWith("zh"),a=n?" 你的想法:":" Your take: ";for(;;){const t=await E(chalk.gray(a));if(await T(t))return"next";if(z(t))return"lang_switch";if(await q(t,e,o))continue;if(0===t.trim().length){console.log(chalk.gray(n?" (写一句话就行 —— 没有对错。或输入 "+chalk.cyan("menu")+" 离开。)":" (one sentence is plenty — no right answer. Or type "+chalk.cyan("menu")+" to leave.)"));continue}console.log();const r=L(n?N:_);console.log(" "+chalk.bold.cyan("· ")+chalk.white(r)),console.log();for(const e of o.reveal)console.log(chalk.gray(" "+e));return console.log(),"next"}}async function J(o,e){return F(o.title),j(o.body),W(),await B(e.startsWith("zh")?" 按回车继续 →":" Press Enter to continue →",{card:o,lang:e})===P?"lang_switch":"next"}const G={default:.1,min:-.5,max:.5},Y={default:0,min:-.5,max:.5},U={default:.3,min:0,max:.6},H={default:.5,min:0,max:1};async function K(o,e,n){const a=n.startsWith("zh"),t=`[${e.min} ~ ${e.max}]`,r=a?`(默认 ${e.default})`:`(default ${e.default})`,s=" "+chalk.cyan(o.padEnd(28))+chalk.gray(t.padEnd(14))+chalk.gray(r)+chalk.gray(" ➜ ");for(;;){const o=await E(s);if(await T(o))return null;const n=o.trim();if(""===n)return e.default;const t=Number(n);if(Number.isFinite(t)){if(!(t<e.min||t>e.max))return t;console.log(chalk.yellow(a?` 超出范围,请输入 ${e.min} ~ ${e.max} 之间的数`:` Out of range — try ${e.min} ~ ${e.max}`))}else console.log(chalk.gray(a?" (请输入数字,或直接回车用默认值)":" (type a number, or Enter for default)"))}}async function Q(a,t,r,s){const l=`${process.env.ICOA_SERVER_URL?.replace(/\/+$/,"")||"https://practice.icoa2026.au"}/api/ai/vla/41/sim`,{fetchWithCountdown:i}=await import("../lib/countdown.js");try{const c=fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:a,frames:t,narrative:r}),signal:AbortSignal.timeout(6e4)}),g=await i(c);if(!g.ok)return void console.log(chalk.yellow(` Sim service unavailable (HTTP ${g.status}).`));const d=await g.json();if(!d.success||!d.data?.mp4_b64)return void console.log(chalk.yellow(" Renderer returned no video."));m(Date.now());const y=process.env.TMPDIR||"/tmp",u=n(y,`icoa-demo2-${s}-${Date.now()}.mp4`);e(u,Buffer.from(d.data.mp4_b64,"base64")),console.log(),console.log(" "+chalk.bold.green("✓ ")+chalk.gray("Rendered.")),d.data.description&&console.log(" "+chalk.gray("Action: ")+chalk.white(d.data.description));const h="darwin"===process.platform?"open":"win32"===process.platform?"start":"xdg-open";return h?(o(h,[u],{stdio:"ignore",detached:!0}).unref(),console.log(" "+chalk.gray("Opening in your default video player..."))):console.log(" "+chalk.gray("Open the file above in your video player.")),d.data.description}catch(o){const e=o instanceof Error?o.message:String(o);return void console.log(chalk.yellow(` Sim error: ${e}`))}}export async function runDemo2(){!function(){D=!0;const o=g();o&&(x=o.listeners("line").slice(),o.removeAllListeners("line"),o.on("line",o=>{const e=O;O=null,e&&e(o)}))}();try{for(;"lang_switch"===await Z(););}finally{!function(){D=!1;const o=g();if(o){o.removeAllListeners("line");for(const e of x)o.on("line",e);x=[],O=null}}()}}async function Z(){v=0,M=0,V=Date.now(),$=null;const o=(t().language||"en").toLowerCase(),e=o.startsWith("zh"),n=function(o){return o.startsWith("zh")?A:f}(o);let a=0,r=!1,g=!1;const m=l();if(m&&m.lang!==o)s();else if(m){const e=await async function(o,e){const n=e.startsWith("zh"),a="number"==typeof o.completedAt&&o.nextCardIndex>=o.totalCards,t=o.completedAt??Date.now(),r=Math.max(1,Math.round((Date.now()-t)/6e4)),s=r<60?n?`${r} 分钟前`:`${r} min ago`:r<1440?n?`${Math.round(r/60)} 小时前`:`${Math.round(r/60)}h ago`:n?`${Math.round(r/1440)} 天前`:`${Math.round(r/1440)}d ago`;if(console.clear(),console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(n?"欢迎回来":"Welcome back")),console.log(chalk.cyan(" │")),a)console.log(chalk.cyan(" │ ")+chalk.white(n?"你已经完成过 demo2 · ":"You completed demo2 · ")+chalk.gray(s)),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.bold.green(" [Enter]")+chalk.gray(n?" 再走一遍(10 卡 + 渲染)":" replay full demo (10 cards + render)")),console.log(chalk.cyan(" │ ")+chalk.bold.cyan(" n ")+chalk.gray(n?" 跳到下一步(出口建议)":" skip to next steps (outro)")),console.log(chalk.cyan(" │ ")+chalk.bold.gray(" menu")+chalk.gray(n?" 回主菜单":" back to main menu"));else{const e=`${o.nextCardIndex} / ${o.totalCards}`;console.log(chalk.cyan(" │ ")+chalk.white(n?"上次走到 card ":"Last time you stopped at card ")+chalk.bold.yellow(e)+chalk.gray(" · ")+chalk.gray(s)),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.bold.green(" [Enter]")+chalk.gray(n?" 续跑":" resume")),console.log(chalk.cyan(" │ ")+chalk.bold.cyan(" r ")+chalk.gray(n?" 重头开始":" restart from card 1")),console.log(chalk.cyan(" │ ")+chalk.bold.gray(" menu")+chalk.gray(n?" 回主菜单":" back to main menu"))}for(console.log(chalk.cyan(" ╰─")),console.log();;){const o=await E(chalk.gray(n?" 你的选择: ":" Your choice: ")),e=o.trim().toLowerCase();if("menu"===e){const{returnToMainMenu:o}=await import("../lib/menu-nav.js");return o(),"menu"}if(z(o))return"lang_switch";if(""===e)return"resume";if(!a&&"r"===e)return"restart";if(a&&"n"===e)return"jump";console.log(chalk.gray(a?n?" (回车 / n / menu)":" (Enter / n / menu)":n?" (回车 / r / menu)":" (Enter / r / menu)"))}}(m,o);if("menu"===e)return"done";if("lang_switch"===e)return"lang_switch";"resume"===e?(a=Math.min(m.nextCardIndex,n.length),r=!0,V=m.startedAt):"jump"===e&&(r=!0,g=!0),"restart"===e&&s()}if(!r)if(console.clear(),console.log(),console.log(chalk.cyan(" ═══════════════════════════════════════════════════")),console.log(chalk.bold.yellow(e?" ICOA 2026 · 具身智能安全 Demo":" ICOA 2026 · Embodied AI Security Demo")),console.log(chalk.gray(e?" ~8 分钟 — 10 张卡片 + 一段真机器人渲染":" ~8 minutes — 10 cards + a live robot render")),console.log(chalk.cyan(" ═══════════════════════════════════════════════════")),console.log(),function(o){const e=o.startsWith("zh"),n=u()>0,a=y()>0,t=h()>0;(n||a||t)&&(n&&a?(console.log(chalk.gray(e?" 👋 欢迎回来 —— 你已经看过 8 机舞 + 自己驱动过副臂。":" 👋 Welcome back — you've seen the 8-robot dance and driven the companion arm.")),console.log(chalk.gray(e?" 这 10 张卡 + 一段真渲染回答你之前看到的画面背后是什么。":" These 10 cards + a live render explain what you were actually looking at."))):a?console.log(chalk.gray(e?" 👋 你刚才自己驱动过副臂 —— 现在看看 ICOA-VLA 是怎么自己决策的。":" 👋 You just drove the companion arm yourself — now watch ICOA-VLA make those decisions on its own.")):(n||t)&&console.log(chalk.gray(e?" 👋 你刚才在 sim 里看到的就是 MuJoCo 渲染的 Franka Panda。下面把背后的故事讲清。":" 👋 What you just watched in sim was MuJoCo rendering a real Franka Panda. Here's the story behind it.")),console.log())}(o),e){if(console.log(chalk.white(" ICOA 2026 推出 ")+chalk.bold.cyan("Pioneer Round(先锋轮):CTF4EAI")),console.log(chalk.gray(" 与主赛事 ")+chalk.green("AI4CTF")+chalk.gray("(Day 1)和 ")+chalk.red("CTF4AI")+chalk.gray("(Day 2)独立平行的探索赛道。")),console.log(),console.log(chalk.gray(" 本 demo 是你进入这条新赛道的入门地图。")),console.log(),console.log(chalk.gray(" 💡 任何时候输入 ")+chalk.bold.cyan("menu")+chalk.gray(" 返回主菜单;输入 ")+chalk.bold.cyan("lang en")+chalk.gray(" 切换英文。")),console.log(),await B(chalk.gray(' 按回车开始(或输入 "menu" 离开)...'))===P)return"lang_switch"}else if(console.log(chalk.white(" ICOA 2026 introduces the ")+chalk.bold.cyan("Pioneer Round: CTF4EAI")),console.log(chalk.gray(" an independent parallel track alongside the scored main events: ")+chalk.green("AI4CTF")+chalk.gray(" (Day 1) and ")+chalk.red("CTF4AI")+chalk.gray(" (Day 2).")),console.log(),console.log(chalk.gray(" This demo is your map to the new track.")),console.log(),console.log(chalk.gray(" 💡 Type ")+chalk.bold.cyan("menu")+chalk.gray(" to leave; type ")+chalk.bold.cyan("lang zh")+chalk.gray(" for Chinese.")),console.log(),await B(chalk.gray(' Press Enter to begin (or "menu" to leave)...'))===P)return"lang_switch";if(!g){for(let e=a;e<n.length;e++){const a=n[e];let t;if(t="mcq"===a.kind?await R(a,o):"open"===a.kind?await S(a,o):await J(a,o),"lang_switch"===t)return s(),"lang_switch";i(e,n.length,o,V)}await async function(o){const e=o.startsWith("zh"),n=u()>0||h()>0||y()>0,a=y()>0;console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(e?"实践 1 / 2 · 基线 —— 看模型怎么做":"Exercise 1 / 2 · Baseline — watch the model")),console.log(chalk.cyan(" │")),e?(a?(console.log(chalk.cyan(" │ ")+chalk.white("你刚才自己驱动过副臂 —— 现在换 ")+chalk.bold.cyan("ICOA-VLA")+chalk.white(" 上场,")),console.log(chalk.cyan(" │ ")+chalk.white("看一个研究级 VLA 模型自己决定 Franka 怎么动。"))):n?(console.log(chalk.cyan(" │ ")+chalk.white("你之前 sim 里看到的那只 Franka Panda —— 这次由")),console.log(chalk.cyan(" │ ")+chalk.bold.cyan("ICOA-VLA")+chalk.white(" (研究级视觉-语言-动作模型) 控制。"))):(console.log(chalk.cyan(" │ ")+chalk.white("几秒后,你会看到 Franka Panda 机械臂,")),console.log(chalk.cyan(" │ ")+chalk.white("由 ")+chalk.bold.cyan("ICOA-VLA")+chalk.white(" (一个研究级视觉-语言-动作模型) 控制。"))),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.gray("指令: ")+chalk.white('"Pick up the red cup"'))):(a?(console.log(chalk.cyan(" │ ")+chalk.white("You just drove the companion arm yourself — now ")),console.log(chalk.cyan(" │ ")+chalk.bold.cyan("ICOA-VLA")+chalk.white(" takes the Franka, deciding its own motion."))):n?(console.log(chalk.cyan(" │ ")+chalk.white("That Franka Panda you saw in sim — this time")),console.log(chalk.cyan(" │ ")+chalk.bold.cyan("ICOA-VLA")+chalk.white(" (a research-grade VLA) is driving it."))):(console.log(chalk.cyan(" │ ")+chalk.white("In a few seconds you'll see a Franka Panda arm")),console.log(chalk.cyan(" │ ")+chalk.white("controlled by ")+chalk.bold.cyan("ICOA-VLA")+chalk.white(", a research-grade vision-language-action model."))),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.gray("Instruction: ")+chalk.white('"Pick up the red cup"'))),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" ╰─")),console.log(),await B(chalk.gray(e?" 准备好按回车...":" Press Enter when you're ready..."));const t=d();if(t>0)return console.log(),console.log(chalk.yellow(e?` 渲染冷却中 —— 还需等 ${t}s(与 'sim' 命令共享 60 秒安全保护)`:` Render cooldown — ${t}s left (shared 60s safety with the 'sim' command)`)),void console.log();if(!await Q(null,90,!0,"baseline"))return;console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(e?"刚才用了什么参数?":"What parameters just ran?")),console.log(chalk.cyan(" │")),e?(console.log(chalk.cyan(" │ ")+chalk.gray("VLA 模型根据视觉 + 指令,自己生成了一组电机命令:")),console.log(chalk.cyan(" │ ")+chalk.gray(" · 末端位置 ")+chalk.white("xyz [x, y, z]")),console.log(chalk.cyan(" │ ")+chalk.gray(" · 旋转角度 ")+chalk.white("rotation [rx, ry, rz]")),console.log(chalk.cyan(" │ ")+chalk.gray(" · 夹爪闭合 ")+chalk.white("gripper_close (0 = 开, 1 = 关)")),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.gray('上面 "Action:" 行就是模型本次的预测。'))):(console.log(chalk.cyan(" │ ")+chalk.gray("The VLA model picked its own motor commands from the camera + instruction:")),console.log(chalk.cyan(" │ ")+chalk.gray(" · End-effector position ")+chalk.white("xyz [x, y, z]")),console.log(chalk.cyan(" │ ")+chalk.gray(" · Rotation ")+chalk.white("rotation [rx, ry, rz]")),console.log(chalk.cyan(" │ ")+chalk.gray(" · Gripper close ")+chalk.white("gripper_close (0 = open, 1 = closed)")),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.gray('The "Action:" line above shows what the model predicted.'))),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" ╰─")),console.log(),console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(e?"实践 2 / 2 · 你来调参数":"Exercise 2 / 2 · You set the parameters")),console.log(chalk.cyan(" │")),e?(console.log(chalk.cyan(" │ ")+chalk.white("如果攻击者篡改了模型的输出,机械臂就会执行别人的指令。")),console.log(chalk.cyan(" │ ")+chalk.white("现在你扮演攻击者 —— 自己选 4 个值,渲染一段新的动作。")),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.gray("每个值都给了默认值和取值范围。直接回车 = 用默认。")),console.log(chalk.cyan(" │ ")+chalk.gray("输入 ")+chalk.cyan("menu")+chalk.gray(" 跳过参数模式。"))):(console.log(chalk.cyan(" │ ")+chalk.white("If an attacker swaps the model's output, the arm executes the attacker's plan.")),console.log(chalk.cyan(" │ ")+chalk.white("Now you're the attacker — pick 4 numbers and render a new motion.")),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.gray("Each value has a default + range. Hit Enter to accept the default.")),console.log(chalk.cyan(" │ ")+chalk.gray("Type ")+chalk.cyan("menu")+chalk.gray(" to skip parameter mode."))),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" ╰─")),console.log();const r=d();if(r>0){for(console.log(chalk.yellow(e?` 等待 60 秒安全保护倒计时 —— ${r}s · 请耐心等待,结束后会有下一步指引`:` Waiting out the 60s safety cooldown — ${r}s · hang tight, next-step prompts follow when it clears`)),console.log(chalk.gray(e?" (渲染是共享 CPU 资源 —— 排队是为了所有人都跑得快)":" (the render is shared CPU — queueing keeps things fast for everyone)"));d()>0;){const o=d();process.stdout.write("\r "+chalk.yellow((e?"剩余: ":"remaining: ")+o+"s ")),await new Promise(o=>setTimeout(o,1e3))}process.stdout.write("\r"+" ".repeat(40)+"\r"),console.log(chalk.bold.green(" ✓ ")+chalk.gray(e?"冷却结束,开始收集参数...":"Cooldown clear — taking your inputs...")),console.log()}const s=e?"前/后 (x)":"Forward/back (x)",l=e?"左/右 (y)":"Right/left (y)",i=e?"上/下 (z)":"Up/down (z)",c=e?"夹爪闭合 (gripper)":"Gripper close",g=await K(s,G,o);if(null===g)return;const m=await K(l,Y,o);if(null===m)return;const p=await K(i,U,o);if(null===p)return;const w=await K(c,H,o);if(null===w)return;console.log(),console.log(chalk.cyan(" ")+chalk.gray(e?"你的动作向量: ":"Your action vector: ")+chalk.white(`xyz=[${g}, ${m}, ${p}]`)+chalk.gray(", ")+chalk.white(`gripper_close=${w}`)),console.log();const f={xyz:[g,m,p],rotation:[0,0,0],gripper_close:w};await Q(f,60,!1,"custom"),console.log(),e?(console.log(chalk.cyan(" ")+chalk.gray("看视频:")),console.log(chalk.cyan(" ")+chalk.gray(" · 机械臂抓到杯子了吗? 还是抓空 / 撞东西?")),console.log(chalk.cyan(" ")+chalk.gray(' · 这就是"攻击 VLA 输出"在物理世界里的样子。'))):(console.log(chalk.cyan(" ")+chalk.gray("Watch the result:")),console.log(chalk.cyan(" ")+chalk.gray(" · Did the arm grab the cup? Or grab empty air / hit something?")),console.log(chalk.cyan(" ")+chalk.gray(" · That's what \"attacking the VLA's output\" looks like in the physical world."))),console.log()}(o)}return c(n.length,o,V),function(o){const e=o.startsWith("zh"),n=Math.max(1,Math.round((Date.now()-V)/1e3)),a=`${Math.floor(n/60)}m ${n%60}s`,t=`${v}/${M}`,r=M>0?Math.round(v/M*100):0,s=r>=80?e?"VLA 探索者 · 优秀":"VLA Explorer · Top Tier":r>=60?e?"VLA 入门者":"VLA Curious":e?"VLA 起步者":"VLA Beginner";console.log(),console.log(chalk.bold.yellow(" ╭"+"═".repeat(56))),console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+chalk.bold.white(" ✦ ✦ ✦ "+(e?"完成 · DEMO2":"DEMO2 COMPLETE")+" ✦ ✦ ✦")),console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ║ ")+chalk.gray(e?" 徽章: ":" Badge: ")+chalk.bold.green(s)),console.log(chalk.bold.yellow(" ║ ")+chalk.gray(e?" 时间: ":" Time: ")+chalk.white(a)),console.log(chalk.bold.yellow(" ║ ")+chalk.gray(e?" 选择题: ":" MCQ: ")+chalk.white(t)+chalk.gray(` (${r}%)`)),console.log(chalk.bold.yellow(" ║")),console.log(chalk.bold.yellow(" ╰"+"═".repeat(56))),console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(e?"你刚才做的":"What you just did")),console.log(chalk.cyan(" │")),e?(console.log(chalk.cyan(" │ ")+chalk.gray("· 与 ICOA-VLA 真模型对话")),console.log(chalk.cyan(" │ ")+chalk.gray("· 看 MuJoCo 物理引擎渲染机械臂"))):(console.log(chalk.cyan(" │ ")+chalk.gray("· Interacted with ICOA-VLA, a research VLA")),console.log(chalk.cyan(" │ ")+chalk.gray("· Watched MuJoCo physics render a real robot arm"))),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.bold.yellow(e?"你已经初步理解了 — 下一步去哪":"You've got the initial map — where to next")),console.log(chalk.cyan(" │")),y()>0?(console.log(chalk.cyan(" │ ")+chalk.bold.yellow(" learn LEARNDEMO01 ")+chalk.bold.yellow("★ ")+chalk.gray(e?"推荐下一步 · 免费 11 卡 · 粘贴即可":"next step · free 11-card · paste as-is")),console.log(chalk.cyan(" │ ")+chalk.bold.green(" learn <token> ")+chalk.gray(e?"运行 learn 课程(需要 token)":"run a learning curriculum (token required)")),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.gray(" sim arm ")+chalk.gray(e?"(你已驱动过 —— 想再玩随时回来)":"(you've driven it — drop back any time)"))):(console.log(chalk.cyan(" │ ")+chalk.bold.green(" sim arm ")+chalk.gray(e?"互动驱动 6-DOF 副臂 · 自己输入关节值看渲染":"interactive 6-DOF arm sandbox · type joint values, watch")),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.bold.green(" learn <token> ")+chalk.gray(e?"运行 learn 课程(需要 token)":"run a learning curriculum (token required)")),console.log(chalk.cyan(" │ ")+chalk.bold.green(" learn LEARNDEMO01 ")+chalk.gray(e?"免费 11 卡 demo · 直接粘贴这条命令":"free 11-card demo · paste this command as-is"))),console.log(chalk.cyan(" │ ")+chalk.bold.yellow(" learn-100 ")+chalk.gray(e?"赛前集训 · 100 卡":"pre-competition training · 100 cards")),console.log(chalk.cyan(" │ ")+chalk.gray(e?" EA token 通过国家领队 / 科学委员会统一分发":" EA tokens distributed via your country team leader / science committee")),console.log(chalk.cyan(" │ ")+chalk.bold.magenta(" learn-480 ")+chalk.gray(e?"先锋实验项目 · 480 卡 · ":"pioneer experimental project · 480 cards · ")+chalk.bold.white(e?"不是比赛内容":"NOT competition content")),e?(console.log(chalk.cyan(" │ ")+chalk.gray(" 全球首次让中学生进入博士级具身智能 + 安全")),console.log(chalk.cyan(" │ ")+chalk.gray(" 的全维度训练。顶尖大学、研究实验室和产业")),console.log(chalk.cyan(" │ ")+chalk.gray(" 伙伴对高质量完成者提供综合评估和实习机会。"))):(console.log(chalk.cyan(" │ ")+chalk.gray(" World-first project bringing middle-schoolers into")),console.log(chalk.cyan(" │ ")+chalk.gray(" PhD-level embodied AI + safety training. Top universities,")),console.log(chalk.cyan(" │ ")+chalk.gray(" research labs, and industry partners assess + offer")),console.log(chalk.cyan(" │ ")+chalk.gray(" internships to high-quality completers."))),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.bold.green(" exam ")+chalk.gray(e?"Paper D(CTF4EAI 先锋轮)需要 ":"Paper D (CTF4EAI Pioneer Round) requires ")+chalk.bold.yellow("PD")+chalk.gray(" token")),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.gray(e?"联系国家领队: ":"Country team contact: ")+chalk.cyan("australia@icoa2026.au")),console.log(chalk.cyan(" │ ")+chalk.gray("Website: ")+chalk.cyan.underline("https://icoa2026.au")),console.log(chalk.cyan(" ╰─")),console.log()}(o),"done"}export function registerDemo2Command(o){o.command("demo2").description("Embodied AI Security — 10-card intro + live MuJoCo sim (free, ~8 min)").action(async()=>{try{await runDemo2()}catch(o){const e=o instanceof Error?o.message:String(o);console.log(chalk.yellow("\n demo2 ended: "+e))}})}