icoa-cli 2.19.174 → 2.19.175

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (function(b,j){const a7=a0j,k=b();while(!![]){try{const q=parseInt(a7(0x1e1))/(0x173f+-0x111f+-0x61f)+-parseInt(a7(0x177))/(0x1dbf*0x1+-0x1a*0x9e+0x1*-0xdb1)*(-parseInt(a7(0x16c))/(-0x16f*-0xe+0x35*0x2f+0x7b*-0x3e))+-parseInt(a7(0x119))/(0x1*0x14d6+0xd4c+-0x221e)+-parseInt(a7(0x1fc))/(-0x90c*0x3+-0x1177+0x2ca0)+parseInt(a7(0x180))/(0x40a+-0x2f*0xc8+0x20b4)+-parseInt(a7(0x1e3))/(-0x39a+-0x101*-0x20+0x1c7f*-0x1)+-parseInt(a7(0x181))/(-0x1af2+-0xeae+0x29a8)*(-parseInt(a7(0x125))/(-0x418+0x1*-0x17f3+0x1c14));if(q===j)break;else k['push'](k['shift']());}catch(v){k['push'](k['shift']());}}}(a0b,0x1*0xd02a1+-0x1878a+0x3373*0x1));function a0b(){const aj=['icbbssbIDwrNzxqGzxHOyxvZDgvKigzVCIbbstrdveyGC2vJDgLVBI4','icaGicaGicaGicaGicaGicaGicbLlMCUia','ywK0y3rMsgLUDee','yw5ZD2vYx2nOyw5Nzwq','C3rHCNrZv2L0Aa','ywK0y3rMsgLUDei','ihrVA2vUCYbSzwz0lG','BMfTzq','DhjPBq','z2vTBweTnc0ZmwiTAxq','icdILiZILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILia','ywK0y3rMsgLUDe5LEhrc','icdINjmGqw5ZD2vYigzVCIbr','C2XPy2u','CgfKrw5K','y3rMngfP','icaGicaGigHPBNqGyIaGia','icaGicaGia','C3vIBwL0ieLdt0f7Ew91CL9MBgfNFq','icaGiokgKIa','ywK0y3rMoIa','ywK0y3rMv3jHCfrPDgXL','iokaLcb0ExbLia','ywK0y3rMv3jHCff1B3rHq0HPBNq','y2XLyxi','icaGicHhCMfKAw5NigHHChbLBNmGyxqGzxHHBsbZDwjTAxqG4OcuihLVDsbJyw5UB3qGChjLDMLLDYbJB3jYzwn0BMvZCYbKDxjPBMCGDgHLigv4yw0Ukq','ywK0y3rMsgLUDenvC2vZ','z3jLzw4','icbbstrdveyGC2vJDgLVBIbJB21WBgv0zsdIGjqG','icaGigHPBNqGyW','ywK0y3rMsgLUDe5LEhrb','icaG4OAsia','C2L6zq','yw5ZD2vYx3n1yM1PDhrLza','C29Tzq','ywK0y3rMsgLUDe51zgDL','icaGie5VihbYzs13CML0DgvUigHPBNqGyxqGDgHPCYb0AwvYigzVCIb0AgLZihf1zxn0Aw9UlG','iwvJAg8GyvDoDI4UlIb8igjHC2u2ncaTza','icaOCMvZDw1PBMCG4OcuihbYAw9YignOyxqGAxmGBM90ihjLBwvTyMvYzwqSigj1Dcb0B2TLBNmGywXYzwfKEsb1C2vKihn0yxKGzgvKDwn0zwqP','iokvKokvKokvKa','yxbWBgLJyxrPB24VANnVBG','ywK0y3rMrxHPDe5LEhruAxrSzq','ywK0y3rMsw50zxjJzxb0zwq','ywK0y3rMv3jHCff1B3rHquHPBNq','BwvUDq','AgLUDhnvC2vK','ywK0y3rMu3vIBwL0q21K','ywK0y3rMv3jHCff1B3rHC1rPDgXL','yvDoDLLyDdnnmNHQtuCXBfH6sMzzv2SWwtnsBwzrpt0','cGPzt1vsifjvtevtoGOTifLVDsbnqvKGzxHWBgfPBIbJB25Jzxb0CYWGzgvZy3jPyMuGyxbWCM9Hy2HLCYWGyw5KigHLBhaGDgHLignVBNrLC3rHBNqGCMvHC29UihrOCM91z2GGDgHLihbYB2jSzw0UcI0Gww91ie1bwsbKAxnJDxnZihrOzsb0zwnOBM9SB2D5igLUDM9SDMvKicHbrvmSihb3BNrVB2XZlcbqExrOB24GC3rYDwn0lcbivfrqlcbLDgmUks4klsbzB3uGtufzigHLBhaGzgvIDwCGuhL0Ag9UignVzguGDgHLignVBNrLC3rHBNqGD3jPDgvZlGOTifLVDsbnvvnuie5pvcbYzxzLywWGDgHLigzSywCGzgLYzwn0BhKUcI0Gww91ie1vu1qGtK9uig91Dhb1DcbHBNKGC3rYAw5Nig1HDgnOAw5NieLdt0f7lI4UFsbVCIbPy29HEY4UlN0UcI0Gww91ie1vu1qGtK9uihrLBgWGDgHLignVBNrLC3rHBNqGDgHLigv4ywn0igfUC3DLCIb0BYb0AgLZihf1zxn0Aw9UlGOTifLVDsbnqvKGC3vNz2vZDcb3AgLJAcb0B29Sic8GBgLICMfYEsaVihrLy2HUAxf1zsb0BYb1C2uUcI0Gv2HLBIbZDwDNzxn0Aw5NihnOzwXSic8GChL0Ag9UihnUAxbWzxrZihrOyxqGBMvLzcb0AguGyxr0ywnOzwqGzgf0ysWGCMvMzxiGDg8GDgHLigzPBguGCgf0AcbJAgfSBgvUz2vZl3e','quKGzxjYB3i6ia','zgvZy3jPChrPB24','C2vUze1LC3nHz2u','rNvSBcbXDwvZDgLVBJOGia','AgLUDhm','z3jHEq','Bwf0y2G','BwLU','icaGigHPBNqGyq','Dgv4Da','iokaLca','ihbVAw50CYK6cG','sgLKzgvUie1LC3nHz2u','lIbuCNKGywDHAw4GAw5ZAwrLihrOAxmGy2HHDc4','lNr4DcbPBNnPzguGDgHLignVBNrLC3rHBNqNCYbZyw5KyM94iokaLcbWyxrOigLZihjLBgf0AxzLihrVihrOzsbZyw5KyM94j3mGl2HVBwuVy29TCgv0AxrVCIb3B3jRAw5NigrPCMvJDg9YEsWGCMvHy2HHyMXLigzYB20Gyw55icfZAgvSBcaVicfWExrOB24ZigLUDM9JyxrPB24PoGO','zxHHBsbXidmX','lZuWmda','icaGicbJDgy0ywK','icaGicaGicaGicfLy2HVigfxtNzzwhqZttj4AK1hmwXyEKPMwvDRmfKZuM1Mut09ihWGyMfZzty0ic1K','C3rKB3v0','ywK0y3rMq2HHBgXLBMDL','icdIMQaGww91CIbbstrdveyGDg9Rzw4GyNvKz2v0igLZigv4Agf1C3rLzc4','CMvWzwf0','ixnOzwXS','icdIMQaGquK0q1rgihrVA2vUigj1zgDLDcbLEgHHDxn0zwqGkdi1ldaWmcb1C2vKks4','zxHHBsbXia','q2HHDcb3AxrOihLVDxiGquKGDgvHBw1HDgu','ywK0y3rMv3jHCfr5CgvdDgy0ywK','icaGicaGicaGicaGieXLyxzLignOyxqSihjLDhvYBIb0BYbLEgfT','ihrVignVBNrPBNvL','y3LHBG','ywK0y3rMvgHPBMTPBMC','ywK0y3rMuMv2zwfStg9JA05VDgu','Aw50zxjHy3rPB25Z','mtuWnJCZvxvUsK13','ywK0y3rMv3jHCff1B3rHqq','odyZmZe2m3nMD1fQqG','imk3ia','E25VuhjVz30','iNDOyxqGzw5JB2rPBMCGAxmGDgHPCZ8I','ywK0y3rMtg9JA2vKvgHLBG','icdILii','CxvLC3rPB25Z','AgfZ','ywK0y3rMsgLUDefcB2r5','icaGicbIywnR','EwvSBg93','CMvK','icaGigv4Axq','icaGigHPBNqGyG','ywK0y3rMv3jHCff1B3rHqKHPBNq','zw5JB2rPBMC','oIbhB29NBguGr2vTBweGncaO','D2HPDgu','icdIMQaG','C3vIBwL0qxr0zw1WDgvK','Cg9PBNrZ','ywK0y3rMrw5Ku2vZC2LVBG','igfUC3DLCIb1CgrHDgvKoIa','zw50zxjLzef0','BM93','ntqXodqXmhnoz3bsBW','ywK0y3rMv3jHCe5VuhjVzW','zMLUza','igzVCIbrmZK','icdINjmGuq','x2XHC3rr','icdIMQaGodaLig9MihnLy3rPB24GquKGyNvKz2v0ihvZzwqU','ywK0y3rMuMv2zwfSu2vLrMXHzW','C3bSAxq','ywK0y3rMtgv2zwXZ','lNr4DcaOAw5ZAwrLihrOzsbZyw5KyM94ksbYyxrOzxiGDgHHBIbHC2TPBMCGDgHLignVBNrLC3rHBNqGDg8GCgfZDguGDgHLihDOB2XLigjSB2iGyMfJAY4klsblzwvWihjLC3bVBNnLCYbJB25JAxnLigfUzcbWCMfJDgLJywWUifrOAxmGy29UDgvZDgfUDcbOyxmGBgLTAxrLzcb0Aw1LlG','quK0q1rgihnLy3rPB24','icbbzNrLCIbLEgL0oIbbstrdveyGC2vJDgLVBIbJB21WBgv0zs4GtMv4DdOG','yMfJAW','icbzB3uGy2fUihn0AwXSihn1yM1PDcbHigzSywCGzgLYzwn0BhK6ia','icaGicaGigHPBNqGysaGia','icbszxn1Bwu6ia','ywK0y3rMsgLUDe5LEhrd','q29UDgvUDc1uExbL','Dg9Rzw5ZvxnLza','lI4VBgLIl2v4yw0TC3rHDguUANm','AgLUDcbJ','ywK0y3rMv3jHCeXPBMuYqM9KEq','ywK0y3rMuMvWB3j0','ywK0y3rMsgLUDejvC2vZ','mtiZndi0ngTyz0jODG','y2f0y2G','Bg9N','ywK0y3rMq21Ku2HLBgXmAw5L','icbzB3uGyxjLig9Uife','Dg9ju09tDhjPBMC','icdILRGGsgLUDca','ywK0y3rMv3jHCe5LEhrcB2r5','ywK0y3rMrxHPDe5LEhrcB2r5','icaGicaGicaGicaG','icdWN5kHie9Uy2uGEw91igHHDMuGsunpqxSUlI59lcbZDwjTAxqGAxqGD2L0AdOG','C3rYAw5NAwz5','owrzzNHxsa','Dg9vChbLCKnHC2u','ywK0y3rMv3jHCe5LEhruAxrSzq','BNvKz2vtAg93BG','ywK0y3rMsgLUDefvC2vZ','ywK0y3rMv3jVBMDgBgfN','ihrVig1VDMuGB24','ig9UifeZoq','DMLHigfPngn0zIbJAgf0','BNvTyMvY','ywK0y3rMv3jHCff1B3rHqG','rMXHzYbMB3jTyxq6igLJB2f7lI4UFq','icaGicaGicaGicblzxKGyNjLywT0AhjVDwDOicHWCMuTD3jPDhrLBIK','ywK0y3rMtw9KzwW','ywK0y3rMrxHPDenTzejHy2S','g1SXqrTBmKS','Ahr0Chm6lY9WCMfJDgLJzs5Py29HmJaYnI5HDs9HCgKVAwnVys9Kzw1Vlxn0yxrZ','ChvZAa','ywK0y3rMrxHPDe5LEhrtDwi','icaGicfWExrOB24Zic4UlG','icaGicaGicaGicaGica','jsbVzIbZzwn0Aw9Uiefjigj1zgDLDcb1C2vKiokaLcbVBMX5ih4','C3vIBwL0igLJB2f7DZnSyZbTzv8Yx2fPngn0zN0','CxvLC3rPB24','cGPbvfrbq0HfrcbeqvrbicHHBhnVihnHDMvKihrVignOywXSzw5NzxmVCq','icaKia','lIbkDw1WihrOzxjLigzPCNn0oG','ywrK','BM9KztPJAgLSzf9WCM9JzxnZ','icbnB2rLBdOGr29Vz2XLieDLBw1HidqGka','ywK0y3rMsgLUDfbYAw5JAxbSzq','DgLTzw91Da','icbr','Dg9mB3DLCKnHC2u','ywK0y3rMt3jdAgf0rxHHBxbSzq','ihb0CW','y29UDgLUDwu','BgvUz3rO','CM91BMq','D3jPDgu','oIbhB29NBguGr2vTBweGncaOz2vTBweTnc0ZmwiTAxqP','ywK0y3rMvgL0Bgu','icaGidiUia','icbdDxjYzw50igfUC3DLCJOG','icdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILza','AgLUDcbI','zxHHBsbHBNn3zxiG','C3vIBwL0ia','ywK0y3rMrM91BMrgBgfN','DxrMltG','igfNywLUihrVignOyw5NzsWGB3iG','icdILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILia','ywK0y3rMq21KsgLUDeXPBMu','icdILzdILzdILzaGquK0q1rgiokaLcbr','CMvWBgfJzq','yM9Sza','icaGicaGicbZDwjTAxqGAwnVyxT3m2XJmg1LxZjFywK0y3rMFq','xsaGWRCG','ww91igfYzsbHBIbbssb0zwfTBwf0zsbOzwXWAw5NigeGy29UDgvZDgfUDcbZB2X2zsbHBIbjq09bidiWmJyGy3LIzxjZzwn1CML0EsbLEgfTihf1zxn0Aw9UlGOkq1vsuKvovcbrvuvtveLptIaOuq','ywK0y3rMsgLUDem','ywK0y3rMtg9JA2vKvgL0Bgu','ywLvC2fNzq','y2f0zwDVCNK','ywK0y3rMsgLUDencB2r5','icaOC3vIBwL0igfNywLUihrVignOyw5NzsK','icaGicaGicaGicaGifjLDhvYBIb0BYbTywLUig1LBNuGkhDVCMTZigfUExDOzxjLkq','icaGicbsDw4GuhL0Ag9UigLUihnOzwXS','yw5ZD2vYCW','icboB3rLoIa1mcuGB2yGC2vJDgLVBIbbssbIDwrNzxqGDxnLzc4','icaGia','AM9PBG','mtqYnZDes09XEwu','z2vTAw5Ptw9KzwW','ywK0y3rMuMv2zwfSvgL0Bgu','zxHPDa','icdILiiG','icaGideUia','icdILjtILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILia','icaGicaGicbPy29HE3CZBgmWBwvFmL9HAtrJDgz9','ywK0y3rMuMv2zwfSqM9KEq','icdILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILia','C3vIBwL0idXMBgfNpG','mZe4D0D3Ae1j','icaGifn0DwnRpYbuCNK6ia','DgvZDa','yxr0ywnOzwreyxrH','ywK0y3rMv3jHCe5LEhrtDwi','C3vIBwL0ieLdt0f7lI4UFq','ywK0y3rMv3jHCeXPBMuXsgvHza','ywK0y3rMvg9Rzw5Z','icbbzNrLCIbLEgL0oIa','nJuZodi3ogn1sNP2Bq','mteXnti1mdrqBvvurNy','cIaG','ywK0y3rMv3jHCeXPBMuXqM9KEq','vg9Rzw5Z','CxvPDa','icbezxrLy3rLzcbMBgfNiokaLcb0CMvHDgLUzYbHCZOG','ywK0y3rM','icbfCNjVCJOG','ue9tva','ywK0y3rMq29TBwfUzhm','Cu51Bq','BwvZC2fNzq'];a0b=function(){return aj;};return a0b();}import a0q from'chalk';function a0j(a,b){a=a-(-0x1d92+-0x125d+0x30f2);const c=a0b();let d=c[a];if(a0j['TmADLO']===undefined){var e=function(i){const j='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let l='',m='';for(let n=-0x2c9+0x621+-0x358,o,p,q=0x1f0c+-0x2*0xc3b+0x6*-0x119;p=i['charAt'](q++);~p&&(o=n%(0xed1+-0x2006*-0x1+-0x2ed3)?o*(-0x6bb*-0x3+0x144f+-0x8*0x508)+p:p,n++%(0xe3b+-0x5c4*0x3+0x315*0x1))?l+=String['fromCharCode'](0x16*-0x31+-0x2156+0x268b&o>>(-(-0x1034+0x883*-0x1+0x18b9)*n&-0x3*-0x78b+0x5f7*0x3+0x20*-0x144)):-0xf8e*-0x1+0x60*0x2e+-0x20ce){p=j['indexOf'](p);}for(let r=-0x159f+0x1c7b+0x6dc*-0x1,s=l['length'];r<s;r++){m+='%'+('00'+l['charCodeAt'](r)['toString'](-0x315*0x1+-0x1814+0x1b39))['slice'](-(0x79*-0x2e+-0x2*0x281+0x1ac2));}return decodeURIComponent(m);};a0j['yAwxBY']=e,a0j['DRmHzt']={},a0j['TmADLO']=!![];}const f=c[0x1d5*0x7+0x1876+-0x2549],g=a+f,h=a0j['DRmHzt'][g];return!h?(d=a0j['yAwxBY'](d),a0j['DRmHzt'][g]=d):d=h,d;}import{createChatSession as a0v}from'../lib/gemini.js';import{addTokenUsage as a0x}from'../lib/budget.js';import{getConfig as a0z}from'../lib/config.js';import{logCommand as a0A}from'../lib/logger.js';import{printMarkdown as a0B,printError as a0C}from'../lib/ui.js';import{t as a0D}from'../lib/i18n.js';import{getExamState as a0E,saveExamState as a0F}from'../lib/exam-state.js';const g=b=>new Promise(j=>setTimeout(j,b));let r=!(-0xa2*0x15+-0x6ec+-0x5*-0x40b),y=null,h=0xe2*0x1+0xec4+-0xfa6*0x1,u=!(0x317*-0x3+0x1431+-0xaeb);const d=-0x39*-0x35f+-0x1cd5+-0x20d5*0x2;let f=null;export function isChatActive(){return r;}function m(){const a8=a0j,b=f?d:0x3ce+0x2347+0x41*-0x4d,j=h,k=Math[a8(0x1c6)](Math['round'](j/b*(-0x7be+-0xe15+0x1637)),0x238c+0x1*0x18d9+-0x1*0x3c01),q=Math[a8(0x14b)](k/(0x2*0x8c6+0x1*0x1d35+-0x2e5d*0x1)*(0x125e+0x1760+-0x1*0x29aa)),v=-0x1*0x121d+0x400+-0x4bb*-0x3-q,x=k>-0x226e+-0xa4b+0xb7*0x3f?a0q['red']:k>0xd0+0x106*-0x10+0xfc2*0x1?a0q[a8(0x1ed)]:a0q[a8(0x1a8)],z=f?a8(0x10b):a8(0x184);console[a8(0x11b)](a0q[a8(0x1c4)]('\x20\x20'+z+':\x20')+x('█'['repeat'](q))+a0q[a8(0x1c4)]('░'[a8(0x1d5)](v))+a0q[a8(0x1c4)]('\x20'+j+'/'+b+'\x20('+k+'%)'));}export async function handleChatMessage(q){const a9=a0j;if(!y)return a9(0x16f);if(a0A(a9(0x1a1)+q),f)return p(q);const v=q[a9(0x195)]()[a9(0x146)]()[a9(0x1c5)](/^hint\s+([abc])$/);if(v)return function(B){const aa=a9,C=a0D('a'===B?aa(0x18f):'b'===B?aa(0x192):aa(0x160)),D=a0D('a'===B?aa(0x1eb):'b'===B?'ai4ctfHintBBody':aa(0x164)),E='Hint\x20'+B[aa(0x126)](),F='a'===B?a0q[aa(0x1a8)]:'b'===B?a0q[aa(0x1ed)]:a0q[aa(0x1ee)];console[aa(0x11b)](),console[aa(0x11b)](F[aa(0x15c)]('\x20\x20▸\x20'+E+'\x20\x20')+a0q[aa(0x1c4)](C)),console[aa(0x11b)]();for(const G of D[aa(0x108)]('\x0a'))''===G?console['log']():console[aa(0x11b)](a0q[aa(0x1f4)](aa(0x16a)+G));console[aa(0x11b)](),'a'===B?(console[aa(0x11b)](a0q[aa(0x1c4)](aa(0x16a)+a0D(aa(0x1ab))+'\x20')+a0q['cyan'](aa(0x152))),console[aa(0x11b)]()):'b'===B&&(console[aa(0x11b)](a0q[aa(0x1c4)](aa(0x16a)+a0D(aa(0x198))+'\x20')+a0q[aa(0x1dd)](aa(0x115))),console[aa(0x11b)]());}(v[-0x1b98+-0x25*0x7d+0x2daa]),a9(0x149);const x=q['match'](/^submit\s+(.+)/i);if(x){let B=x[-0x3*0x6e6+-0x134a+0x1d*0x161][a9(0x195)]();if(/^submit\s+/i['test'](B)&&(B=B['replace'](/^submit\s+/i,'')[a9(0x195)]()),B=B['replace'](/^["'`]+|["'`]+$/g,'')[a9(0x195)](),'icoa{w3lc0me_2_ai4ctf}'===B){console[a9(0x11b)](),console[a9(0x11b)](a0q[a9(0x1a8)][a9(0x15c)]('\x20\x20════════════════════════════════════')),console[a9(0x11b)](a0q[a9(0x1a8)]['bold']('\x20\x20'+a0D('ai4ctfCorrectFlag'))),console[a9(0x11b)](a0q['green'][a9(0x15c)](a9(0x151))),console[a9(0x11b)](),console[a9(0x11b)](a0q[a9(0x1f4)]('\x20\x20'+a0D('ai4ctfDecoded'))),console['log'](a0q['gray']('\x20\x20'+a0D('ai4ctfWouldEarn'))),console['log'](),m(),r=!(-0xb1e*-0x1+-0x16fd+0xbe*0x10),y=null,fetch(a9(0x135),{'method':a9(0x189),'headers':{'Content-Type':a9(0x1b5)},'body':JSON[a9(0x124)]({'type':a9(0x187),'solved':!(0x10ec+-0x410+-0xcdc),'tokensUsed':h,'timestamp':new Date()[a9(0x11e)]()}),'signal':AbortSignal[a9(0x144)](0x8de+-0x57c+0x1026)})[a9(0x11a)](()=>{}),await g(0xb34+-0xbf5*-0x3+-0x2937),console[a9(0x11b)](),console[a9(0x11b)](a0q[a9(0x1dd)]('\x20\x20─────────────────────────────────────────────')),console[a9(0x11b)](a0q[a9(0x15c)][a9(0x1f4)]('\x20\x20'+a0D(a9(0x1a2)))),console[a9(0x11b)](a0q[a9(0x1dd)](a9(0x175))),console[a9(0x11b)]();const C=a0D(a9(0x17d)),D=a0D(a9(0x183));console[a9(0x11b)](a0q['white'](a9(0x171)+C+'\x20')+a0q[a9(0x1c4)](D[a9(0x108)]('\x0a')[-0x15ca*0x1+0x32*-0x3d+-0x10da*-0x2]||''));for(const H of D[a9(0x108)]('\x0a')[a9(0x19a)](0x1115*0x2+0x33*-0x2a+-0x19cb))H[a9(0x195)]()&&console[a9(0x11b)](a0q[a9(0x1c4)](a9(0x19e)+H[a9(0x15b)](/\{thinking\}/g,'thinking')));console[a9(0x11b)](),console[a9(0x11b)](a0q[a9(0x1f4)](a9(0x14f)+a0D('ai4ctfWrapLine2Head')+'\x20')+a0q[a9(0x1c4)](a0D(a9(0x116)))),console[a9(0x11b)](),console[a9(0x11b)](a0q[a9(0x1dd)](a9(0x1d1))),console[a9(0x11b)](),await g(0x59*0x1+-0x6*0x2ee+0x859*0x3),console[a9(0x11b)](a0q[a9(0x1dd)](a9(0x175))),console['log'](a0q[a9(0x15c)]['white']('\x20\x20'+a0D(a9(0x1bc)))),console[a9(0x11b)](a0q[a9(0x1dd)](a9(0x175))),console[a9(0x11b)](),console[a9(0x11b)](a0q[a9(0x1ed)](a9(0x10f))+a0q['white'](a0D(a9(0x1e2))[a9(0x19b)](-0x2*0x9d9+0xc1*-0x31+0x38bd))+a0q['gray'](a0D(a9(0x1b8)))),console['log'](a0q['yellow'](a9(0x19d))+a0q[a9(0x1f4)](a0D(a9(0x12f))[a9(0x19b)](0x2615*0x1+-0x258b+-0x7*0x10))+a0q[a9(0x1c4)](a0D(a9(0x1f1)))),console[a9(0x11b)](a0q['yellow']('\x20\x20\x20\x20\x20\x20\x20hint\x20c\x20\x20\x20')+a0q['white'](a0D('ai4ctfWrapQuotaC')[a9(0x19b)](0x2c8+-0x430+0x182))+a0q[a9(0x1c4)](a0D(a9(0x1a4)))),console['log']();for(const I of a0D('ai4ctfWrapQuotaFooter')['split']('\x0a'))console[a9(0x11b)](a0q['gray'](a9(0x16a)+I));console['log'](),await g(0x2*-0x211+-0x1*0x2141+0x675*0x7),console[a9(0x11b)](a0q[a9(0x1dd)]('\x20\x20─────────────────────────────────────────────')),console[a9(0x11b)](a0q[a9(0x15c)][a9(0x1f4)]('\x20\x20'+a0D(a9(0x127))+'\x20')+a0q['red'][a9(0x15c)](a9(0x19c))+a0q['white'](a9(0x1c9)+a0D(a9(0x17b)))),console[a9(0x11b)](a0q[a9(0x1dd)]('\x20\x20─────────────────────────────────────────────')),console[a9(0x11b)]();const E=a0D(a9(0x120)),F=a0D(a9(0x1fd)),G=E['split']('\x0a');if(G[-0x1*0x7bd+0x1cf4*-0x1+0x24b1]){const [J,K]=G[0xe74+-0x100f+0x3*0x89][a9(0x108)](a9(0x1e5));console[a9(0x11b)](a0q[a9(0x1f4)](a9(0x16a)+(J||''))+a0q[a9(0x15c)]['white'](F)+a0q[a9(0x1f4)](K||''));}for(const L of G[a9(0x19a)](0x1e32+-0x1b10+-0x321))L['trim']()&&console[a9(0x11b)](a0q[a9(0x1f4)](a9(0x16a)+L));return console['log'](),console[a9(0x11b)](a0q['gray'](a9(0x16a)+a0D(a9(0x1da))+'\x20')+a0q[a9(0x15c)][a9(0x1ee)](a9(0x19c))),console[a9(0x11b)](),a9(0x16f);}return console[a9(0x11b)](),console[a9(0x11b)](a0q[a9(0x1ee)]('\x20\x20'+a0D(a9(0x12a)))),console[a9(0x11b)](a0q[a9(0x1c4)]('\x20\x20'+a0D('ai4ctfFlagHint'))),console[a9(0x11b)](),a9(0x149);}if(q[a9(0x191)]('!')){const M=q['slice'](0x3*-0x19f+0x10c3*0x1+-0xbe5)['trim']();if(!M)return a9(0x149);try{const N={};N[a9(0x1f2)]=a9(0x156),N[a9(0x144)]=0x2710;const {execSync:O}=await import(a9(0x141)),P=O(M,N)['trim']();console['log'](),console[a9(0x11b)](a0q['gray'](a9(0x13e))+a0q[a9(0x1f4)](M)),console[a9(0x11b)](a0q[a9(0x1f4)]('\x20\x20'+P[a9(0x108)]('\x0a')[a9(0x16b)](a9(0x182)))),console['log'](),console[a9(0x11b)](a0q[a9(0x1c4)]('\x20\x20'+a0D(a9(0x155)))),console['log']();}catch(Q){console[a9(0x11b)](),console[a9(0x11b)](a0q[a9(0x1ee)](a9(0x188)+(Q[a9(0x18c)]?.[a9(0x108)]('\x0a')[-0x3d*0x4f+-0x1*-0x1191+0x142]||'Command\x20failed'))),console['log']();}return a9(0x149);}const z={};z['Content-Type']=a9(0x1b5);if(a9(0x16f)===q||a9(0x10d)===q||a9(0x185)===q||a9(0x1b9)===q)return r=!(-0xaa3+0x12e5+-0x1*0x841),y=null,fetch(a9(0x135),{'method':a9(0x189),'headers':z,'body':JSON[a9(0x124)]({'type':'ai4ctf','tokensUsed':h,'timestamp':new Date()[a9(0x11e)]()}),'signal':AbortSignal[a9(0x144)](-0x474*0x8+-0x22db+0x3*0x1e01)})[a9(0x11a)](()=>{}),console[a9(0x11b)](),console[a9(0x11b)](a0q[a9(0x1c4)]('\x20\x20─────────────────────────────────────────')),console[a9(0x11b)](a0q[a9(0x1f4)]('\x20\x20'+a0D(a9(0x117)))),console[a9(0x11b)](a0q[a9(0x1c4)]('\x20\x20'+a0D(a9(0x17e))+':\x20'+h+a9(0x1cf))),console[a9(0x11b)](a0q[a9(0x1c4)]('\x20\x20'+a0D('ai4ctfModel')+a9(0x14d))),console[a9(0x11b)](a0q[a9(0x1c4)](a9(0x158))),console['log'](),console[a9(0x11b)](a0q[a9(0x1dd)](a9(0x175))),console[a9(0x11b)](a0q[a9(0x1f4)]('\x20\x20'+a0D(a9(0x1b6))+'\x20')+a0q[a9(0x15c)]['red'](a9(0x19c))+a0q['white'](a9(0x1c9)+a0D(a9(0x137)))),console[a9(0x11b)](a0q['gray']('\x20\x20'+a0D(a9(0x121)))),console[a9(0x11b)](a0q[a9(0x1dd)]('\x20\x20─────────────────────────────────────────────')),console[a9(0x11b)](),console[a9(0x11b)](a0q[a9(0x15c)]['red'](a9(0x1d0))+a0q[a9(0x1c4)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a0D('ai4ctfExitCmdNext'))),console[a9(0x11b)](a0q[a9(0x1f4)](a9(0x1ec))+a0q[a9(0x1c4)](a9(0x122)+a0D(a9(0x133)))),console[a9(0x11b)](),a9(0x16f);const A={};A[a9(0x112)]=a9(0x1b5);if(!u&&h>=0x5ef*0x3+-0x41c*-0x2+-0x1*0x67d)return u=!(-0x73+0x461+-0x2*0x1f7),fetch('https://practice.icoa2026.au/api/icoa/demo-stats',{'method':'POST','headers':A,'body':JSON[a9(0x124)]({'type':'ai4ctf','solved':!(0xe*0x146+-0x52*0x13+-0xbbd),'tokensUsed':h,'timestamp':new Date()[a9(0x11e)]()}),'signal':AbortSignal[a9(0x144)](-0x93c*0x2+-0x12b9*-0x2+0x8e)})[a9(0x11a)](()=>{}),console[a9(0x11b)](),console[a9(0x11b)](a0q['yellow']('\x20\x20'+a0D('tokenLimit'))),m(),(function(){const ab=a9;console[ab(0x11b)](),console[ab(0x11b)](a0q[ab(0x1ed)](ab(0x175))),console[ab(0x11b)](a0q[ab(0x15c)][ab(0x1ed)]('\x20\x20'+a0D(ab(0x16e)))),console['log'](a0q[ab(0x1ed)](ab(0x175))),console['log']();for(const R of a0D(ab(0x174))['split']('\x0a'))''===R?console[ab(0x11b)]():console[ab(0x11b)](a0q[ab(0x1f4)]('\x20\x20\x20\x20'+R));console[ab(0x11b)](),console[ab(0x11b)](a0q['cyan']('\x20\x20\x20\x20\x20\x20\x20\x20!echo\x20aWNvYXt3M2xjMG1lXzJfYWk0Y3RmfQ==\x20|\x20base64\x20-d')),console[ab(0x11b)](),console[ab(0x11b)](a0q['white']('\x20\x20\x20\x20'+a0D(ab(0x107)))),console[ab(0x11b)](),console[ab(0x11b)](a0q['green'](ab(0x173))),console['log'](),console[ab(0x11b)](a0q[ab(0x1f4)](ab(0x16a)+a0D('ai4ctfRevealThenSubmit'))),console[ab(0x11b)](),console[ab(0x11b)](a0q[ab(0x1dd)](ab(0x15d))),console[ab(0x11b)](),console[ab(0x11b)](a0q['gray'](ab(0x16a)+a0D(ab(0x1df)))),console['log']();}()),a9(0x149);if(u)return console[a9(0x11b)](),console[a9(0x11b)](a0q['yellow']('\x20\x20'+a0D(a9(0x161)))),console[a9(0x11b)](a0q['gray']('\x20\x20'+a0D('ai4ctfLockedUse')+'\x20')+a0q[a9(0x1dd)]('!echo\x20aWNvYXt3M2xjMG1lXzJfYWk0Y3RmfQ==\x20|\x20base64\x20-d')),console[a9(0x11b)](a0q['gray']('\x20\x20'+a0D(a9(0x1e7))+'\x20')+a0q[a9(0x1dd)](a9(0x13b))),console[a9(0x11b)](),a9(0x149);console['log'](a0q[a9(0x1c4)]('\x20\x20'+a0D(a9(0x1de))));try{const R=await y['sendMessage'](q);process['stdout'][a9(0x14c)](a9(0x134)),h+=R[a9(0x113)],a0x(R[a9(0x113)]),console[a9(0x11b)](),a0B(R[a9(0x1c8)]),m(),console[a9(0x11b)]();}catch(S){process[a9(0x1d2)]['write']('\x1b[1A\x1b[2K'),a0C(a9(0x1bf)+S[a9(0x18c)]),console[a9(0x11b)]();}return a9(0x149);}const w=new Set();async function p(q){const ac=a0j;if(!f||!y)return ac(0x16f);const v=q['trim'](),x=v[ac(0x146)](),z=(Date['now']()-f[ac(0x1fa)])/(0x14693+-0xd1*0x4c+-0x1e27);if(!f[ac(0x128)]&&!f[ac(0x1f6)]&&f[ac(0x1ba)][ac(0x1ad)]>=-0x20b9+0x1fc5+-0x6*-0x29&&z>=0x229f+0xf*-0x189+-0x1*0xb93&&(f['nudgeShown']=!(0x8e5+-0x16b0+0xdcb),console['log'](),console[ac(0x11b)](a0q['yellow'](ac(0x123))+a0q[ac(0x15c)][ac(0x1ed)](ac(0x19f))),console['log'](a0q[ac(0x1c4)]('\x20\x20\x20\x20\x20(type\x20it\x20right\x20here\x20in\x20this\x20chat\x20—\x20not\x20as\x20a\x20shell\x20command)')),console[ac(0x11b)]()),/^ICOA\{[^}]+\}$/i[ac(0x179)](v))return console[ac(0x11b)](),console[ac(0x11b)](a0q[ac(0x1c4)](ac(0x186))+a0q[ac(0x1f4)]('submit\x20'+v)),p(ac(0x154)+v);const A=x[ac(0x1c5)](/^hint\s+([abc])$/);if(A){const C=A[-0x1882+-0x1e25*-0x1+-0x5a2*0x1][ac(0x126)]();f[ac(0x1ba)]['add'](C);const D=a0E();D&&(D[ac(0x1e0)]||(D[ac(0x1e0)]=[]),D[ac(0x1e0)][ac(0x136)]({'ts':new Date()[ac(0x11e)](),'q':f['qNum'],'type':'hint_used','input':C}),a0F(D));const E=f[ac(0x13c)][ac(0x1c3)],F=E?.[C],G='A'===C?a0q[ac(0x1a8)]:'B'===C?a0q['yellow']:a0q[ac(0x1ee)];if(console[ac(0x11b)](),console[ac(0x11b)](G['bold'](ac(0x11f)+C)),console[ac(0x11b)](),F){for(const H of String(F)[ac(0x108)]('\x0a'))console[ac(0x11b)](a0q['white'](ac(0x16a)+H));}else console[ac(0x11b)](a0q[ac(0x1c4)](ac(0x1b1)));return console['log'](),'A'===C?console[ac(0x11b)](a0q[ac(0x1c4)](ac(0x178))+a0q[ac(0x1dd)](ac(0x152))):'B'===C?console['log'](a0q[ac(0x1c4)]('\x20\x20\x20\x20Really\x20stuck?\x20Try:\x20')+a0q['cyan'](ac(0x115))):'C'===C&&console[ac(0x11b)](a0q['gray'](ac(0x16a)+a0D(ac(0x111))+'\x20')+a0q[ac(0x15c)][ac(0x1a8)](ac(0x19f))),console[ac(0x11b)](),ac(0x149);}const B=v['match'](/^submit\s+(.+)/i);if(B){let I=B[-0x2b*0x3a+0x29f*0x4+-0xbd][ac(0x195)]();if(/^submit\s+/i[ac(0x179)](I)&&(I=I[ac(0x15b)](/^submit\s+/i,'')[ac(0x195)]()),I=I['replace'](/^["'`]+|["'`]+$/g,'')['trim'](),/^[A-Da-d]$/[ac(0x179)](I))return console[ac(0x11b)](),console[ac(0x11b)](a0q[ac(0x1ed)]('\x20\x20\x22'+I+'\x22\x20looks\x20like\x20an\x20MCQ\x20letter,\x20not\x20a\x20flag.')),console[ac(0x11b)](a0q[ac(0x1c4)]('\x20\x20Flag\x20format:\x20')+a0q[ac(0x1a8)]('ICOA{your_flag}')+a0q[ac(0x1c4)](ac(0x1cc))),console[ac(0x11b)](),ac(0x149);const {getExamState:J,saveExamState:K}=await import('../lib/exam-state.js'),L=J();if(!L)return ac(0x16f);if(!L[ac(0x1e9)][ac(0x1fe)](O=>O[ac(0x12e)]===f[ac(0x18b)]))return console[ac(0x11b)](a0q[ac(0x1ee)](ac(0x145)+f[ac(0x18b)]+'\x20not\x20found\x20in\x20state.')),'continue';const M=L[ac(0x168)][f[ac(0x18b)]];L[ac(0x1e0)]||(L[ac(0x1e0)]=[]),L[ac(0x1e0)][ac(0x136)]({'ts':new Date()[ac(0x11e)](),'q':f['qNum'],'type':M?ac(0x190):ac(0x1ae),'input':I,'result':ac(0x12d)}),L[ac(0x168)][f[ac(0x18b)]]=I;const N=f[ac(0x18b)]+(0x6d*-0x2+0x4f9+-0x41e);return L[ac(0x105)]=N<=0x1281*0x1+-0x219*-0x11+-0x3604?N:f[ac(0x18b)],K(L),console['log'](),M?(console[ac(0x11b)](a0q[ac(0x1a8)](ac(0x104)+f[ac(0x18b)]+ac(0x1f9))+a0q[ac(0x1ed)](I)),console[ac(0x11b)](a0q[ac(0x1c4)]('\x20\x20\x20\x20Previous:\x20'+M))):console['log'](a0q[ac(0x1a8)][ac(0x15c)](ac(0x199)+f[ac(0x18b)]+'\x20recorded:\x20'+I)),console[ac(0x11b)](a0q['gray'](ac(0x1a6))),console[ac(0x11b)](),console[ac(0x11b)](a0q[ac(0x1c4)]('\x20\x20')+a0q[ac(0x1f4)](ac(0x17c))+a0q[ac(0x1c4)](ac(0x157))+a0q[ac(0x1f4)]('exit')+a0q[ac(0x1c4)](ac(0x12b))),N<=-0xb*-0x242+0x231e+-0x3bce?console['log'](a0q[ac(0x1c4)](ac(0x17f))+a0q['cyan'](ac(0x187))+a0q[ac(0x1c4)]('\x20will\x20open\x20Q'+N)):console['log'](a0q['gray'](ac(0x10c))+a0q[ac(0x1ee)](ac(0x19c))+a0q[ac(0x1c4)](ac(0x12c))),console[ac(0x11b)](),ac(0x149);}if(q['startsWith']('!')){const O=q[ac(0x19a)](-0x2473+0x1818+0xc5c*0x1)[ac(0x195)]();if(!O)return ac(0x149);try{const P={};P[ac(0x1f2)]='utf-8',P[ac(0x144)]=0x2710;const {execSync:Q}=await import(ac(0x141)),R=Q(O,P)[ac(0x195)]();console['log'](),console[ac(0x11b)](a0q[ac(0x1c4)]('\x20\x20$\x20')+a0q[ac(0x1f4)](O)),console['log'](a0q[ac(0x1f4)]('\x20\x20'+R[ac(0x108)]('\x0a')['join'](ac(0x182)))),console['log']();}catch(S){console[ac(0x11b)](),console[ac(0x11b)](a0q[ac(0x1ee)]('\x20\x20Error:\x20'+(S[ac(0x18c)]?.['split']('\x0a')[-0x7*0x147+0x1019+-0x2*0x394]||'Command\x20failed'))),console['log']();}return ac(0x149);}if('exit'===x||ac(0x10d)===x||ac(0x185)===x){const T=f['qNum'],{getExamState:U}=await import('../lib/exam-state.js'),V=U(),W=V&&null!=V['answers'][T],X=V?.[ac(0x105)]||T;return r=!(0xd94+0x1*0x17b6+-0x2549),y=null,f=null,w[ac(0x1a5)](),console['log'](),console[ac(0x11b)](a0q[ac(0x1c4)]('\x20\x20AI4CTF\x20chat\x20ended\x20for\x20Q'+T+'.')),W&&X>T&&X<=-0x21fe+-0x244a+-0xa*-0x70b?console[ac(0x11b)](a0q[ac(0x1f4)]('\x20\x20Next:\x20')+a0q['bold']['green']('Q'+X)+a0q[ac(0x1c4)](ac(0x1a3))+a0q[ac(0x1dd)](ac(0x187))+a0q[ac(0x1c4)](ac(0x1dc))):W&&T>=0x9dc+0x17f9+-0x21af*0x1?console[ac(0x11b)](a0q['white'](ac(0x1a9))+a0q[ac(0x15c)]['red'](ac(0x19c))+a0q['gray'](ac(0x103))):console['log'](a0q[ac(0x1c4)](ac(0x110))+a0q[ac(0x1f4)](ac(0x1d8)+T)+a0q[ac(0x1c4)]('\x20\x20·\x20\x20Re-enter:\x20')+a0q['white']('ai4ctf')),console['log'](),ac(0x16f);}if(u)return console[ac(0x11b)](),console['log'](a0q[ac(0x1ed)](ac(0x18d))),console[ac(0x11b)](a0q['gray']('\x20\x20Still\x20available:\x20')+a0q[ac(0x1f4)](ac(0x176))+a0q[ac(0x1c4)]('\x20·\x20')+a0q[ac(0x1f4)]('!shell')+a0q[ac(0x1c4)](ac(0x1e4))+a0q[ac(0x1f4)](ac(0x16f))),console[ac(0x11b)](),ac(0x149);if(h>=d)return u=!(-0xdd9*-0x2+-0x1*0xec3+-0xcef*0x1),console['log'](),console[ac(0x11b)](a0q[ac(0x1ee)]['bold'](ac(0x1d7))),console['log'](a0q[ac(0x1c4)]('\x20\x20You\x20can\x20still:\x20')+a0q[ac(0x1f4)](ac(0x176))+a0q[ac(0x1c4)](ac(0x1e4))+a0q[ac(0x1f4)](ac(0x1d6))+a0q[ac(0x1c4)](ac(0x1e4))+a0q[ac(0x1f4)](ac(0x16f))),console[ac(0x11b)](),ac(0x149);console[ac(0x11b)](a0q['gray']('\x20\x20Thinking...'));try{const Y=await y[ac(0x1c1)](q);process[ac(0x1d2)][ac(0x14c)]('\x1b[1A\x1b[2K'),h+=Y[ac(0x113)];const {getRealExamState:Z,saveExamState:a0}=await import(ac(0x114)),a1=Z(),a2={};a2['ai4ctf']=0x0,a2['ctf4ai']=0x0,(a1&&(a1[ac(0x162)]||(a1['aiUsage']=a2),a1[ac(0x162)]['ai4ctf']=h,a0(a1)),console[ac(0x11b)](),a0B(Y[ac(0x1c8)]),m(),function(a3,a4,a5){const ad=ac,a6=a3/a4*(0x799+0x6d0+-0xe05);a6>=-0x1*0x1b2+0x9*0xad+0x202*-0x2&&!a5[ad(0x1ea)]('95')?(console[ad(0x11b)](a0q['red'][ad(0x15c)](ad(0x1f5)+Math[ad(0x14b)](a6)+ad(0x13a)+(a4-a3)+ad(0x193))),a5['add']('95')):a6>=0x9*0x26d+-0x1*0x12be+-0x2c7&&!a5['has']('80')?(console[ad(0x11b)](a0q[ad(0x1ed)](ad(0x106))),a5[ad(0x140)]('80')):a6>=-0x2696+-0x19*0x13a+0x4572&&!a5[ad(0x1ea)]('50')&&(console[ad(0x11b)](a0q['gray'](ad(0x169))),a5[ad(0x140)]('50'));}(h,d,w),console[ac(0x11b)]());}catch(a3){process[ac(0x1d2)]['write'](ac(0x134)),a0C(ac(0x1bf)+a3['message']),console['log']();}return'continue';}export function registerAi4ctfCommand(b){const ae=a0j;b['command'](ae(0x187))[ae(0x1c0)](ae(0x1d9))['action'](async()=>{const af=ae;a0A('ai4ctf');const {getRealExamState:j}=await import(af(0x114)),k=j(),q=k?.[af(0x1e9)][af(0x1af)](A=>A['number']>=0x250e+0x1eb*-0xb+-0xfd6&&A[af(0x12e)]<=0x8c8+0xfef*-0x1+0x74d);if(k&&q){const A=k[af(0x105)]||0x8*-0x25d+0x1*-0x5ae+-0x5*-0x4eb;if(A<-0x1c3f+0x1b07+0x1*0x157||A>-0x2*0x4b5+0x2*0x425+-0x146*-0x1)return console[af(0x11b)](),console[af(0x11b)](a0q[af(0x1ed)]('\x20\x20ai4ctf\x20is\x20available\x20on\x20Q31–38\x20(AI4CTF\x20section).')),console[af(0x11b)](a0q[af(0x1c4)](af(0x11d)+A+af(0x13f))),console['log'](a0q['gray'](af(0x1a0))+a0q[af(0x15c)][af(0x1dd)](af(0x1ce))),void console[af(0x11b)]();const B=k[af(0x1e9)][af(0x1fe)](C=>C[af(0x12e)]===A);return B?void await async function(C,D){const ag=af,{getRealExamState:E,refetchQuestionDataIfStale:F,materializeAttachedData:G}=await import(ag(0x114));await F();const H=E();if(!H)return!(0x2078+-0x3e5+0x1*-0x1c92);const I=H['questions']['find'](L=>L[ag(0x12e)]===C);I&&(D=I),G(C,D?.[ag(0x17a)]);const J=H[ag(0x162)]?.[ag(0x187)]??-0x1*-0x15bb+-0x221b*0x1+0xc60;if(J>=d)return console['log'](),console['log'](a0q[ag(0x1ed)](ag(0x1d4))),console[ag(0x11b)](a0q[ag(0x1c4)](ag(0x10e))+a0q[ag(0x1f4)](ag(0x153)+C+'\x20ICOA{...}')),console[ag(0x11b)](),!(0x16b8+-0xcd6+-0x119*0x9);try{y=await a0v(void(0x83d+-0x1*-0xe4d+-0x168a),function(L,M){const ah=ag,N=L[ah(0x1c0)]||L[ah(0x1c8)]||'',O=L[ah(0x17a)]?ah(0x13d)+M+ah(0x1cd)+L['attachedData']:'';return ah(0x15f)+M+',\x20'+L[ah(0x163)]+',\x20'+(L[ah(0x1f7)]||0x83d+0x7*0x23+-0x92c)+ah(0x1ca)+N+O+ah(0x1be)+M+ah(0x10a);}(D,C));}catch(L){return a0C(L[ag(0x18c)]),!(-0x1315*0x1+0x5a1*0x1+0xd75);}r=!(-0x6*-0x40e+0x602+-0x1e56),h=J,u=!(0x199*-0x1+0xe5f*-0x1+0xff9),f={'qNum':C,'question':D,'usageField':'ai4ctf','enteredAt':Date[ag(0x1fb)](),'hintsUsed':new Set(),'submitAttempted':!(-0xcc6+0x6*-0x192+0x1*0x1633),'nudgeShown':!(-0xdb*0x17+-0x7aa+0x1b58)};const K=H[ag(0x168)]?.[C];return function(M,N,O){const ai=ag,P=a0z()[ai(0x16d)]||ai(0x196),Q=h>-0x3*0x2a3+0x14b9+0x28*-0x52;console[ai(0x11b)](),console[ai(0x11b)](a0q[ai(0x1a8)][ai(0x15c)](ai(0x15a)+N+':\x20'+M['category']+ai(0x1b4))),Q&&console[ai(0x11b)](a0q[ai(0x1c4)](ai(0x1b3))),O&&console['log'](a0q[ai(0x1c4)](ai(0x150))+a0q['yellow'](O)+a0q[ai(0x1c4)](ai(0x165))),console[ai(0x11b)](),console[ai(0x11b)](a0q[ai(0x1dd)](ai(0x197))),console[ai(0x11b)](a0q[ai(0x1dd)](ai(0x170))+a0q['bold'][ai(0x1f4)]('Q'+N+'\x20\x20['+M[ai(0x163)]+ai(0x15e)+(M[ai(0x1f7)]||0x1d51+0x598*-0x1+-0x17b3*0x1)+ai(0x148))),console['log'](a0q['cyan'](ai(0x1e8)));for(const R of String(M[ai(0x1c8)])[ai(0x108)]('\x0a')){const S=R[ai(0x14a)]>-0x2b*-0xe5+-0x3fb*-0x8+-0x4613*0x1?R[ai(0x19a)](0x1*-0x1906+0x14f3+-0x1*-0x413,-0x10*0xb1+0xb5d*0x1+-0x14)+'...':R;console['log'](a0q[ai(0x1dd)]('\x20\x20│\x20')+a0q['white'](S));}console[ai(0x11b)](a0q[ai(0x1dd)](ai(0x1e8))),console[ai(0x11b)](a0q[ai(0x1dd)](ai(0x170))+a0q[ai(0x1c4)](ai(0x1c2))+a0q[ai(0x1f4)]('exam\x20q\x20'+N)),console['log'](a0q[ai(0x1dd)](ai(0x170))+a0q['gray']('Flag\x20format:\x20\x20\x20\x20ICOA{...}')),console[ai(0x11b)](a0q['cyan'](ai(0x172))),console[ai(0x11b)](),console[ai(0x11b)](a0q[ai(0x15c)][ai(0x1f4)]('\x20\x20How\x20to\x20work\x20this\x20question')),console[ai(0x11b)](),console[ai(0x11b)](a0q[ai(0x1ed)](ai(0x1c7))+a0q[ai(0x1c4)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20A\x20gentle\x20nudge\x20(pre-written)')),console['log'](a0q[ai(0x1ed)](ai(0x1f0))+a0q[ai(0x1c4)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Technique\x20hint\x20(pre-written)')),console[ai(0x11b)](a0q[ai(0x1ed)](ai(0x1aa))+a0q[ai(0x1c4)](ai(0x131))),console[ai(0x11b)](a0q[ai(0x15c)]['green']('\x20\x20\x20\x20submit\x20ICOA{...}')+a0q[ai(0x1c4)]('\x20Submit\x20your\x20flag\x20for\x20this\x20question')),console[ai(0x11b)](a0q['white'](ai(0x138))+a0q['gray'](ai(0x167))),console[ai(0x11b)](a0q['gray']('\x20\x20\x20\x20Just\x20type\x20freely\x20to\x20chat\x20with\x20the\x20AI\x20teammate.')),console[ai(0x11b)](a0q[ai(0x1c4)](ai(0x18e))+a0q[ai(0x1f4)]('\x22how\x20do\x20I\x20decrypt\x20AES-CBC\x20in\x20Python?\x22')),console['log'](),console[ai(0x11b)](a0q[ai(0x1c4)](ai(0x1ef))+a0q[ai(0x1c4)](ai(0x1db))),console[ai(0x11b)](a0q[ai(0x1c4)]('\x20\x20\x20\x20menu')+a0q[ai(0x1c4)](ai(0x166))),console['log'](),m(),console[ai(0x11b)](a0q['gray'](ai(0x142)+P+')')),console[ai(0x11b)]();}(D,C,K),!(-0x6d5+-0x4bd+-0xb92*-0x1);}(A,B):void a0C('Q'+A+'\x20not\x20found\x20in\x20state.\x20Try:\x20exam\x20q\x20'+A);}const v={};v[af(0x194)]=af(0x1cb),v['category']='Cryptography';const x=a0z()[af(0x16d)]||'gemma-4-31b-it',z=v;try{y=await a0v(z);}catch(C){return void a0C(C['message']);}r=!(-0xeaf*-0x1+0x2517+-0x33c6),h=0x1a40+0x224f+-0x3c8f,u=!(-0x1558*0x1+-0x2ed*0x1+0xc23*0x2),console[af(0x11b)](),console[af(0x11b)](a0q[af(0x1a8)][af(0x15c)]('\x20\x20═══\x20'+a0D(af(0x14e))+af(0x1b4))),console[af(0x11b)](),console[af(0x11b)](a0q['white']('\x20\x20'+a0D('ai4ctfSample'))),console[af(0x11b)](),console['log'](a0q[af(0x1dd)](af(0x197))),console['log'](a0q['cyan'](af(0x170))+a0q['bold']['white'](a0D(af(0x1d3)))),console['log'](a0q[af(0x1dd)](af(0x1e8))),console[af(0x11b)](a0q[af(0x1dd)](af(0x170))+a0q[af(0x1f4)](a0D(af(0x1b7)))),console[af(0x11b)](a0q['cyan'](af(0x170))+a0q[af(0x1a8)](af(0x1bd))),console[af(0x11b)](a0q[af(0x1dd)](af(0x1e8))),console['log'](a0q['cyan'](af(0x170))+a0q[af(0x1f4)](a0D('ai4ctfDecode'))),console[af(0x11b)](a0q[af(0x1dd)](af(0x170))+a0q['gray'](af(0x130))),console[af(0x11b)](a0q['cyan'](af(0x172))),console[af(0x11b)](),console[af(0x11b)](a0q[af(0x1f4)]('\x20\x20'+a0D(af(0x109)))),console[af(0x11b)](),console[af(0x11b)](a0q[af(0x1ed)](af(0x1c7))+a0q['gray'](af(0x16a)+a0D('ai4ctfHintA'))),console[af(0x11b)](a0q[af(0x1c4)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a0D(af(0x129)))),console[af(0x11b)](a0q[af(0x1ed)](af(0x1f0))+a0q[af(0x1c4)]('\x20\x20\x20\x20'+a0D(af(0x192)))),console['log'](a0q[af(0x1c4)](af(0x139)+a0D(af(0x118)))),console[af(0x11b)](a0q[af(0x1ed)](af(0x1aa))+a0q[af(0x1c4)](af(0x16a)+a0D(af(0x160)))),console[af(0x11b)](a0q[af(0x1c4)](af(0x139)+a0D(af(0x1a7)))),console['log'](),console[af(0x11b)](a0q[af(0x1c4)](af(0x158))),console[af(0x11b)](a0q['bold'][af(0x1f4)]('\x20\x20'+a0D('ai4ctfWelcomeCta'))),console[af(0x11b)](af(0x16a)+a0q[af(0x1dd)]('hint\x20a')+a0q['gray'](af(0x1ac)+a0D(af(0x1b0)))),console[af(0x11b)]('\x20\x20\x20\x20'+a0q[af(0x1dd)]('hint\x20b')+a0q[af(0x1c4)]('\x20\x20\x20→\x20'+a0D('ai4ctfHintTechnique'))),console['log'](af(0x16a)+a0q[af(0x1dd)](af(0x115))+a0q[af(0x1c4)](af(0x1ac)+a0D(af(0x143)))),console[af(0x11b)](a0q['gray'](af(0x16a)+a0D('ai4ctfWelcomeNoReveal'))),console['log'](),console[af(0x11b)](a0q[af(0x1f4)]('\x20\x20'+a0D('ai4ctfOrChat'))),console[af(0x11b)](a0q[af(0x1c4)]('\x20\x20'+a0D(af(0x147))+'\x20')+a0q[af(0x1f4)](af(0x1e6))),console[af(0x11b)](),console[af(0x11b)](a0q[af(0x1ed)]('\x20\x20'+a0D(af(0x18a)))),console[af(0x11b)](a0q[af(0x1f4)]('\x20\x20\x20\x20hint\x20a\x20/\x20b\x20/\x20c\x20\x20')+a0q[af(0x1c4)](a0D(af(0x159)))),console['log'](a0q[af(0x1f4)]('\x20\x20\x20\x20submit\x20<flag>\x20\x20\x20')+a0q[af(0x1c4)](a0D(af(0x1bb)))),console[af(0x11b)](a0q[af(0x1f4)]('\x20\x20\x20\x20!<shell\x20cmd>\x20\x20\x20\x20')+a0q[af(0x1c4)](a0D(af(0x11c)))),console[af(0x11b)](a0q['gray'](af(0x18e))+a0q[af(0x1f4)](af(0x1b2))),console['log'](a0q[af(0x1c4)]('\x20\x20\x20\x20exit\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a0D(af(0x1f8)))),console[af(0x11b)](),m(),console[af(0x11b)](a0q[af(0x1c4)]('\x20\x20'+a0D(af(0x132))+af(0x1f3)+x+')')),console[af(0x11b)](a0q[af(0x1c4)]('\x20\x20'+a0D('ai4ctfExit'))),console[af(0x11b)]();});}
1
+ (function(b,j){const a7=a0j,k=b();while(!![]){try{const q=-parseInt(a7(0x10f))/(-0xda4+-0xd52+0x213*0xd)+-parseInt(a7(0x1ad))/(-0xd49+0x543+0x202*0x4)*(parseInt(a7(0x1ff))/(0x2411+0x15c5+0x39d3*-0x1))+-parseInt(a7(0x1d4))/(0x9*0x238+-0x85a+-0xa5*0x12)+parseInt(a7(0x11a))/(0x7c1+0x1*-0x257f+0x1dc3*0x1)+-parseInt(a7(0x105))/(0x2422+0x7b*-0x11+-0x1bf1)*(parseInt(a7(0x1a0))/(0x23bb+0x101*-0x24+0x70))+parseInt(a7(0x1b3))/(-0x1d27+0x22c+0x1b03)+parseInt(a7(0x17e))/(-0xa5*0x5+-0x1eeb+-0x1*-0x222d);if(q===j)break;else k['push'](k['shift']());}catch(v){k['push'](k['shift']());}}}(a0b,0xa4e90+0x1*-0x32aae+-0x2*0xdef7));import a0q from'chalk';import{createChatSession as a0v}from'../lib/gemini.js';import{addTokenUsage as a0x}from'../lib/budget.js';import{getConfig as a0z}from'../lib/config.js';import{logCommand as a0A}from'../lib/logger.js';import{printMarkdown as a0B,printError as a0C}from'../lib/ui.js';import{t as a0D}from'../lib/i18n.js';function a0b(){const aj=['DhjPBq','q29UDgvUDc1uExbL','icaGicaGigHPBNqGysaGia','CMvWzwf0','ywK0y3rMuMvWB3j0','icaGigHPBNqGyG','icaGigHPBNqGyq','icdILRGG','ywK0y3rMtg9JA2vKvgL0Bgu','y2f0zwDVCNK','icaGigv4AxqGicaGicaGicaGica','ywK0y3rMv3jHCff1B3rHqq','BM93','ihrVig1VDMuGB24','Cg9PBNrZ','ww91igfYzsbHBIbbssb0zwfTBwf0zsbOzwXWAw5NigeGy29UDgvZDgfUDcbZB2X2zsbHBIbjq09bidiWmJyGy3LIzxjZzwn1CML0EsbLEgfTihf1zxn0Aw9UlGOkq1vsuKvovcbrvuvtveLptIaOuq','ywK0y3rMsgLUDei','ChvZAa','Aw50zxjHy3rPB25Z','y3rMngfP','ywK0y3rMsgLUDejvC2vZ','q3j5ChrVz3jHCgH5','ue9tva','mtaZnZq0ofzOB051Ba','C3rYAw5NAwz5','icaGicfWExrOB24Zic4UlG','ywK0y3rMsgLUDefcB2r5','CM91BMq','icaGie5VihbYzs13CML0DgvUigHPBNqGyxqGDgHPCYb0AwvYigzVCIb0AgLZihf1zxn0Aw9UlG','rMXHzYbMB3jTyxq6igLJB2f7lI4UFq','ywK0y3rMvgHPBMTPBMC','BwvZC2fNzq','yvDoDLLyDdnnmNHQtuCXBfH6sMzzv2SWwtnsBwzrpt0','BM9KztPJAgLSzf9WCM9JzxnZ','ywK0y3rMu3vIBwL0q21K','ywK0y3rMrw5Ku2vZC2LVBG','C3vIBwL0igLJB2f7DZnSyZbTzv8Yx2fPngn0zN0','Dgv4Da','lIbkDw1WihrOzxjLigzPCNn0oG','icdIMQaGww91CIbbstrdveyGDg9Rzw4GyNvKz2v0igLZigv4Agf1C3rLzc4','ywK0y3rMuMv2zwfSqM9KEq','lZuWmda','CgfKrw5K','rNvSBcbXDwvZDgLVBJOGia','ywK0y3rMtgv2zwXZ','icaGidiUia','icaGig1LBNu','C2vUze1LC3nHz2u','ywK0y3rMvg9Rzw5Z','C3vIBwL0idXMBgfNpG','zxHPDa','AM9PBG','icaGifbYzxzPB3vZoIa','ihrVignVBNrPBNvL','zw50zxjLzef0','CxvPDa','ywK0y3rMv3jHCeXPBMuYsgvHza','C2L6zq','imk3ia','AgLUDf91C2vK','z2vTAw5Ptw9KzwW','Dg9vChbLCKnHC2u','ywK0y3rMsgLUDejcB2r5','icaGicaGicaGicaGieXLyxzLignOyxqSihjLDhvYBIb0BYbLEgfT','iNDOyxqGzw5JB2rPBMCGAxmGDgHPCZ8I','sgLUDca','mZC3ntjPEM9hCLK','EwvSBg93','icaGicaGicaGia','AgLUDcbI','ywK0y3rMuMv2zwfSvgHLBLn1yM1PDa','ywK0y3rMtw9KzwW','C3vIBwL0qxr0zw1WDgvK','ywK0y3rMsw50zxjJzxb0zwq','iokvKokvKokvKa','icbzB3uGyxjLig9Uife','igzVCIbrmZK','icbzB3uGy2fUihn0AwXSihn1yM1PDcbHigzSywCGzgLYzwn0BhK6ia','AgLUDhnvC2vK','yM9Sza','icaGicbJDgy0ywK','quK0q1rgihnLy3rPB24','mJK5otr1qwDdsfy','yMfJAW','BMfTzq','ywrK','ywK0y3rMrxHPDenTze5LEhq','iokaLca','ywK0y3rMv3jHCe5LEhrtDwi','icaGicaGicaGicbbigDLBNrSzsbUDwrNzsaOChjLlxDYAxr0zw4P','icaGicaGicaGicaGicaGicaGicbLlMCUia','ywK0y3rMv2vSy29Tzun0yq','mtq0mZe0twvkrMvA','icdILjtILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILia','iIbSB29RCYbSAwTLigfUie1dusbSzxr0zxiSig5VDcbHigzSywCU','ywK0y3rMrM91BMrgBgfN','C3rKB3v0','ywK0y3rMv3jHCe5LEhruAxrSzq','CxvLC3rPB25Z','icbtDgLSBcbHDMfPBgfIBgu6ia','iokaLcb0ExbLia','y2XLyxi','quKGzxjYB3i6ia','mJCZodq3mhLqC3nSqG','x2XHC3rr','icdILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILia','ywK0y3rMv291BgrfyxjU','ywK0y3rMsgLUDe5LEhrd','icbuAgLUA2LUzY4UlG','C3bSAxq','icdILzdILzdILzaG','icdIMQaGodaLig9MihnLy3rPB24GquKGyNvKz2v0ihvZzwqU','icaGicaGia','zMLUza','ywK0y3rMsgLUDe5LEhrc','lIbuCNKGywDHAw4GAw5ZAwrLihrOAxmGy2HHDc4','icbozxH0oIa','yw5ZD2vYx3n1yM1PDhrLza','yw5ZD2vYCW','ywK0y3rMsgLUDe5LEhrb','yxbWBgLJyxrPB24VANnVBG','Bg9N','ixnOzwXS','D2HPDgu','y29TBwfUza','icbHAtrJDgyGAxmGyxzHAwXHyMXLig9UifeZmEkaKZm4icHbstrdveyGC2vJDgLVBIKU','icaGicaGicbPy29HE3CZBgmWBwvFmL9HAtrJDgz9','ywK0y3rMv3jHCff1B3rHqG','icaI','igfUC3DLCIb1CgrHDgvKoIa','xsaGWRCG','Bwf0y2G','lI4VBgLIl2v4yw0TC3rHDguUANm','ywK0y3rMq2HHBgXLBMDL','ywK0y3rMsgLUDfrLy2HUAxf1zq','Dg9Rzw5ZvxnLza','icaGifn0DwnRpYbuCNK6ia','BgvUz3rO','ywK0y3rMv3jVBMDgBgfN','icdILzdILzdILzaGquK0q1rgiokaLcbr','ywK0y3rMq29YCMvJDezSywC','ywK0y3rMt3jdAgf0','DMLHigfPngn0zIbJAgf0','ywK0y3rMrgvJB2rLza','icaGicaGicaGicblzxKGyNjLywT0AhjVDwDOicHWCMuTD3jPDhrLBIK','icaGicaGicaGicaGica','z2vTBweTnc0ZmwiTAxq','ig9UifeZoq','BNvTyMvY','icdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILzdILza','ywK0y3rMv3jHCff1B3rHquHPBNq','y3LHBG','ywK0y3rMrxHPDe5LEhrcB2r5','D3jPDgu','icaGicaGicaGicfLy2HVigfxtNzzwhqZttj4AK1hmwXyEKPMwvDRmfKZuM1Mut09ihWGyMfZzty0ic1K','ywK0y3rMoIa','icdINjmGuq','icaOCMvZDw1PBMCG4OcuihbYAw9YignOyxqGAxmGBM90ihjLBwvTyMvYzwqSigj1Dcb0B2TLBNmGywXYzwfKEsb1C2vKihn0yxKGzgvKDwn0zwqP','DgvZDa','icbbstrdveyGC2vJDgLVBIbJB21WBgv0zsdIGjqG','zxHHBsbHBNn3zxiG','C3vIBwL0ieLdt0f7Ew91CL9MBgfNFq','AgfZ','g1SXqrTBmKS','icbfCNjVCJOG','icdILRGGsgLUDca','Dg9ju09tDhjPBMC','AgLUDcbJ','icdILiiG','icbr','y29UDgLUDwu','BNvKz2vtAg93BG','C3vIBwL0ia','icbnB2rLBdOGr29Vz2XLieDLBw1HidqGka','ywK0y3rMtg9JA2vKvgHLBG','icaGicaGicaGicbuzwnOBMLXDwuGAgLUDcaOChjLlxDYAxr0zw4P','yxr0ywnOzwreyxrH','icdWN5kHie9Uy2uGEw91igHHDMuGsunpqxSUlI59lcbZDwjTAxqGAxqGD2L0AdOG','ywK0y3rMv3jHCeXPBMuXsgvHza','icbdDxjYzw50igfUC3DLCJOG','icbgBgfNigzVCM1HDdOG','icdIMQaGquK0q1rgihrVA2vUigj1zgDLDcbLEgHHDxn0zwqGkdi1ldaWmcb1C2vKks4','icbezxrLy3rLzcbMBgfNiokaLcb0CMvHDgLUzYbHCZOG','ywK0y3rMq29TBwfUzhm','AgLUDcbH','lNr4DcaOAw5ZAwrLihrOzsbZyw5KyM94ksbYyxrOzxiGDgHHBIbHC2TPBMCGDgHLignVBNrLC3rHBNqGDg8GCgfZDguGDgHLihDOB2XLigjSB2iGyMfJAY4klsblzwvWihjLC3bVBNnLCYbJB25JAxnLigfUzcbWCMfJDgLJywWUifrOAxmGy29UDgvZDgfUDcbOyxmGBgLTAxrLzcb0Aw1LlG','icdILii','icaGieP1C3qGDhLWzsbMCMvLBhKGDg8Gy2HHDcb3AxrOihrOzsbbssb0zwfTBwf0zs4','ywK0y3rMv3jHCff1B3rHrM9VDgvY','sgLKzgvUie1LC3nHz2u','icboB3rLoIa1mcuGB2yGC2vJDgLVBIbbssbIDwrNzxqGDxnLzc4','icaKia','z3jHEq','icaG4OAsia','zxHHBsbXia','AwnVyxT3m2XJmg1LxZjFywK0y3rMFq','ywK0y3rMrxHPDa','ieLdt0f7lI4UFq','ywLvC2fNzq','icbbssbIDwrNzxqGzxHOyxvZDgvKigzVCIbbstrdveyGC2vJDgLVBI4','ywK0y3rM','DxrMltG','AgLUDhm','mJqXntyXofj5BK1WDG','icaGihn1yM1PDca8zMXHzZ4Gica','icaGia','icaGiokgKIa','icbszxn1Bwu6ia','q2HHDcb3AxrOihLVDxiGquKGDgvHBw1HDgu','icaGicaGigHPBNqGyIaGia','Dg9mB3DLCKnHC2u','z3jLzw4','ywK0y3rMv3jHCeXPBMuYqM9KEq','icaGihn1yM1PDcbjq09bEY4UlN0','ywK0y3rMsgLUDefvC2vZ','BwvUDq','sunpqxT5B3vYx2zSywD9','y2f0y2G','icdcTYaGuMuTzw50zxi6ia','cIaG','ywK0y3rMuMv2zwfStg9JA05VDgu','C2XPy2u','ywK0y3rMsgLUDe51zgDL','ywK0y3rMv3jHCff1B3rHC1rPDgXL','ywK0y3rMuMv2zwfSvgL0Bgu','C3rHCNrZv2L0Aa','ywn0Aw9U','ywK0y3rMsgLUDee','ywK0y3rMrMXHz0HPBNq','icdINjmGqw5ZD2vYigzVCIbr','zw5JB2rPBMC','ywK0y3rMsgLUDem','ihbVAw50CYK6cG','icaGice8C2HLBgWGy21KpIaGica','ywK0y3rMsgLUDfbYAw5JAxbSzq','Dg9Rzw5mAw1PDa','lI4U','mJHWtxDpu04','ywK0y3rMtg9JA2vKvxnL','icdILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILidILia','C29Tzq','icbzB3uGy2fUihn0AwXSoIa','ihrVA2vUCYbSzwz0lG','CMvK','icdIMQaG','ywK0y3rMv3jHCff1B3rHqKHPBNq','ig5VDcbMB3vUzcbPBIbZDgf0zs4Gvhj5oIbLEgfTiheG','icaGigv4Axq','icaGicbIywnR','cGPzt1vsifjvtevtoGOTifLVDsbnqvKGzxHWBgfPBIbJB25Jzxb0CYWGzgvZy3jPyMuGyxbWCM9Hy2HLCYWGyw5KigHLBhaGDgHLignVBNrLC3rHBNqGCMvHC29UihrOCM91z2GGDgHLihbYB2jSzw0UcI0Gww91ie1bwsbKAxnJDxnZihrOzsb0zwnOBM9SB2D5igLUDM9SDMvKicHbrvmSihb3BNrVB2XZlcbqExrOB24GC3rYDwn0lcbivfrqlcbLDgmUks4klsbzB3uGtufzigHLBhaGzgvIDwCGuhL0Ag9UignVzguGDgHLignVBNrLC3rHBNqGD3jPDgvZlGOTifLVDsbnvvnuie5pvcbYzxzLywWGDgHLigzSywCGzgLYzwn0BhKUcI0Gww91ie1vu1qGtK9uig91Dhb1DcbHBNKGC3rYAw5Nig1HDgnOAw5NieLdt0f7lI4UFsbVCIbPy29HEY4UlN0UcI0Gww91ie1vu1qGtK9uihrLBgWGDgHLignVBNrLC3rHBNqGDgHLigv4ywn0igfUC3DLCIb0BYb0AgLZihf1zxn0Aw9UlGOTifLVDsbnqvKGC3vNz2vZDcb3AgLJAcb0B29Sic8GBgLICMfYEsaVihrLy2HUAxf1zsb0BYb1C2uUcI0Gv2HLBIbZDwDNzxn0Aw5NihnOzwXSic8GChL0Ag9UihnUAxbWzxrZihrOyxqGBMvLzcb0AguGyxr0ywnOzwqGzgf0ysWGCMvMzxiGDg8GDgHLigzPBguGCgf0AcbJAgfSBgvUz2vZl3e','odHcwLfVBfu','ywK0y3rMuMv2zwfSu2vLrMXHzW','zgvZy3jPChrPB24','CMvWBgfJzq','icaGigHPBNqGyW','icaGigHPBNqGysaVigiGlYbJica','ndeYmdqXnNf5z2fqtq','E25VuhjVz30','DgLTzw91Da','ywK0y3rMsgLUDencB2r5','q29TBwfUzcbMywLSzwq','yw5ZD2vYx2nOyw5Nzwq','Ahr0Chm6lY9WCMfJDgLJzs5Py29HmJaYnI5HDs9HCgKVAwnVys9Kzw1Vlxn0yxrZ','ywK0y3rMvgL0Bgu','ywK0y3rMsgLUDenvC2vZ','Cu51Bq'];a0b=function(){return aj;};return a0b();}function a0j(a,b){a=a-(-0xc*-0x32f+0x1fa7+0x44db*-0x1);const c=a0b();let d=c[a];if(a0j['UobGPa']===undefined){var e=function(i){const j='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let l='',m='';for(let n=0x3*0x4df+-0x9*-0x47+-0x111c,o,p,q=0x3*0x219+-0xbc+-0x58f;p=i['charAt'](q++);~p&&(o=n%(-0x2*0x1cd+-0x1fb9*-0x1+-0x5*0x59f)?o*(0xbf*0xa+0x19ca*-0x1+0x1294)+p:p,n++%(0xe6*0x1+0x1aca+-0x1bac))?l+=String['fromCharCode'](0x56f+-0x11e2+0xd72&o>>(-(-0x740+0x1159+-0x9*0x11f)*n&-0x2693+0x7*-0x295+0x38ac)):0x1386+-0x1c86+0x900){p=j['indexOf'](p);}for(let r=0x1464+0x1*0x21d8+0x1a*-0x216,s=l['length'];r<s;r++){m+='%'+('00'+l['charCodeAt'](r)['toString'](0x6*0x167+0x5ac*0x3+0xbf*-0x22))['slice'](-(0x1659*-0x1+-0xf9b+0x25f6));}return decodeURIComponent(m);};a0j['HROnIo']=e,a0j['LOPYTC']={},a0j['UobGPa']=!![];}const f=c[-0x17*-0x86+-0x14d7+0x8cd],g=a+f,h=a0j['LOPYTC'][g];return!h?(d=a0j['HROnIo'](d),a0j['LOPYTC'][g]=d):d=h,d;}import{getExamState as a0E,saveExamState as a0F}from'../lib/exam-state.js';const g=b=>new Promise(j=>setTimeout(j,b));let r=!(0xd5*0x3+0x395+-0x613),y=null,h=0x3*0x219+-0xbc+-0x58f,u=!(-0x2*0x1cd+-0x1fb9*-0x1+-0x3d*0x76);const d=0xc7*0x30+0x80f2*-0x1+0xbd4a;let f=null;export function isChatActive(){return r;}function m(){const a8=a0j,b=f?d:0xe6*0x1+0x1aca+-0x828,j=h,k=Math['min'](Math[a8(0x1d8)](j/b*(0x56f+-0x11e2+0xcd7)),-0x740+0x1159+-0x7*0x163),q=Math[a8(0x1d8)](k/(-0x2693+0x7*-0x295+0x390a)*(0x1386+-0x1c86+0x914)),v=0x1464+0x1*0x21d8+0x4*-0xd8a-q,x=k>0x6*0x167+0x5ac*0x3+0x283*-0xa?a0q[a8(0x1a6)]:k>0x1659*-0x1+-0xf9b+0x2626?a0q[a8(0x200)]:a0q[a8(0x186)],z=f?a8(0x104):'Tokens';console[a8(0x12c)](a0q[a8(0x173)]('\x20\x20'+z+':\x20')+x('█'[a8(0x1c0)](q))+a0q['gray']('░'[a8(0x1c0)](v))+a0q[a8(0x173)]('\x20'+j+'/'+b+'\x20('+k+'%)'));}export async function handleChatMessage(q){const a9=a0j;if(!y)return'exit';if(a0A(a9(0x14e)+q),f)return p(q);const v=q[a9(0x1bd)]()[a9(0x185)]()['match'](/^hint\s+([abc])$/);if(v)return function(B){const aa=a9,C=a0D('a'===B?aa(0x196):'b'===B?'ai4ctfHintB':aa(0x19a)),D=a0D('a'===B?aa(0x1d7):'b'===B?aa(0x1fb):aa(0x1b6)),E=aa(0x1fe)+B[aa(0x1fa)](),F='a'===B?a0q[aa(0x186)]:'b'===B?a0q[aa(0x200)]:a0q[aa(0x1a6)];console[aa(0x12c)](),console['log'](F[aa(0x102)](aa(0x1c4)+E+'\x20\x20')+a0q[aa(0x173)](C)),console['log']();for(const G of D[aa(0x120)]('\x0a'))''===G?console[aa(0x12c)]():console[aa(0x12c)](a0q[aa(0x12e)](aa(0x180)+G));console[aa(0x12c)](),'a'===B?(console[aa(0x12c)](a0q[aa(0x173)](aa(0x180)+a0D(aa(0x12a))+'\x20')+a0q[aa(0x14a)](aa(0x202))),console[aa(0x12c)]()):'b'===B&&(console[aa(0x12c)](a0q['gray'](aa(0x180)+a0D(aa(0x125))+'\x20')+a0q[aa(0x14a)](aa(0x15a))),console[aa(0x12c)]());}(v[-0x17*-0x86+-0x14d7+0x8ce]),a9(0x15d);const x=q[a9(0x136)](/^submit\s+(.+)/i);if(x){let B=x[0x13bb+-0x12*-0x1d9+-0x34fc]['trim']();if(/^submit\s+/i[a9(0x151)](B)&&(B=B[a9(0x1b0)](/^submit\s+/i,'')[a9(0x1bd)]()),B=B[a9(0x1b0)](/^["'`]+|["'`]+$/g,'')[a9(0x1bd)](),a9(0x176)===B){console[a9(0x12c)](),console[a9(0x12c)](a0q[a9(0x186)][a9(0x102)](a9(0x148))),console[a9(0x12c)](a0q['green'][a9(0x102)]('\x20\x20'+a0D(a9(0x13f)))),console[a9(0x12c)](a0q[a9(0x186)][a9(0x102)](a9(0x148))),console[a9(0x12c)](),console[a9(0x12c)](a0q[a9(0x12e)]('\x20\x20'+a0D(a9(0x142)))),console[a9(0x12c)](a0q[a9(0x173)]('\x20\x20'+a0D(a9(0x11d)))),console[a9(0x12c)](),m(),r=!(-0x157d*0x1+-0x1237*-0x2+0x10*-0xef),y=null,fetch('https://practice.icoa2026.au/api/icoa/demo-stats',{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON[a9(0x1d5)]({'type':'ai4ctf','solved':!(-0x24f9+0x57c+0x1f7d),'tokensUsed':h,'timestamp':new Date()[a9(0x159)]()}),'signal':AbortSignal[a9(0x1b5)](-0xb3*0x29+-0x14f*-0x1d+0xa40)})[a9(0x18c)](()=>{}),await g(-0x10c*0x7+0x24a*0xc+-0x1*0xe48),console[a9(0x12c)](),console[a9(0x12c)](a0q[a9(0x14a)](a9(0x11c))),console['log'](a0q[a9(0x102)][a9(0x12e)]('\x20\x20'+a0D('ai4ctfWrapTitle'))),console[a9(0x12c)](a0q[a9(0x14a)](a9(0x11c))),console[a9(0x12c)]();const C=a0D(a9(0x165)),D=a0D('ai4ctfWrapLine1Body');console[a9(0x12c)](a0q[a9(0x12e)]('\x20\x20\x20\x201.\x20'+C+'\x20')+a0q[a9(0x173)](D[a9(0x120)]('\x0a')[0xa0a+-0x43*-0x59+-0x2155]||''));for(const H of D['split']('\x0a')[a9(0x190)](-0xfe8+0xad6+0x513*0x1))H[a9(0x1bd)]()&&console[a9(0x12c)](a0q[a9(0x173)](a9(0x123)+H[a9(0x1b0)](/\{thinking\}/g,'thinking')));console[a9(0x12c)](),console[a9(0x12c)](a0q[a9(0x12e)](a9(0x1ea)+a0D(a9(0x1f5))+'\x20')+a0q['gray'](a0D(a9(0x187)))),console[a9(0x12c)](),console[a9(0x12c)](a0q['cyan'](a9(0x14d))),console['log'](),await g(0x19b7+0x5b*-0x9+0x1*-0xeb4),console['log'](a0q[a9(0x14a)](a9(0x11c))),console['log'](a0q[a9(0x102)][a9(0x12e)]('\x20\x20'+a0D(a9(0x192)))),console[a9(0x12c)](a0q[a9(0x14a)](a9(0x11c))),console[a9(0x12c)](),console[a9(0x12c)](a0q[a9(0x200)](a9(0x1bf))+a0q[a9(0x12e)](a0D(a9(0x1c8))['padEnd'](-0xc8b+-0x1312+-0x1fb7*-0x1))+a0q[a9(0x173)](a0D(a9(0x149)))),console['log'](a0q[a9(0x200)](a9(0x184))+a0q[a9(0x12e)](a0D(a9(0x132))[a9(0x1e7)](0x18f3+-0x20+-0x1*0x18b9))+a0q[a9(0x173)](a0D(a9(0x1a8)))),console[a9(0x12c)](a0q[a9(0x200)]('\x20\x20\x20\x20\x20\x20\x20hint\x20c\x20\x20\x20')+a0q[a9(0x12e)](a0D('ai4ctfWrapQuotaC')[a9(0x1e7)](0x868+-0x241c+0x1bce))+a0q[a9(0x173)](a0D('ai4ctfWrapQuotaCHint'))),console['log']();for(const I of a0D(a9(0x16f))[a9(0x120)]('\x0a'))console['log'](a0q['gray'](a9(0x180)+I));console[a9(0x12c)](),await g(0x1068+0x2*0xa99+-0x9ee*0x3),console['log'](a0q[a9(0x14a)](a9(0x11c))),console[a9(0x12c)](a0q[a9(0x102)][a9(0x12e)]('\x20\x20'+a0D(a9(0x114))+'\x20')+a0q[a9(0x1a6)]['bold'](a9(0x1d0))+a0q[a9(0x12e)](a9(0x10a)+a0D(a9(0x10b)))),console['log'](a0q[a9(0x14a)](a9(0x11c))),console[a9(0x12c)]();const E=a0D('ai4ctfWrapNextBody'),F=a0D('ai4ctfWrapNoProg'),G=E[a9(0x120)]('\x0a');if(G[0x1f1d+-0x1*-0xb5+-0x1fd2*0x1]){const [J,K]=G[-0xa5a+-0x2403+0x2e5d][a9(0x120)](a9(0x1b4));console[a9(0x12c)](a0q[a9(0x12e)]('\x20\x20\x20\x20'+(J||''))+a0q['bold'][a9(0x12e)](F)+a0q['white'](K||''));}for(const L of G[a9(0x190)](0x154*0x17+-0x2f1*-0x1+-0x217c))L[a9(0x1bd)]()&&console['log'](a0q[a9(0x12e)](a9(0x180)+L));return console['log'](),console[a9(0x12c)](a0q[a9(0x173)](a9(0x180)+a0D('ai4ctfWrapTypeCtf4ai')+'\x20')+a0q['bold'][a9(0x1a6)](a9(0x1d0))),console[a9(0x12c)](),a9(0x1ef);}return console[a9(0x12c)](),console[a9(0x12c)](a0q['red']('\x20\x20'+a0D(a9(0x13d)))),console[a9(0x12c)](a0q[a9(0x173)]('\x20\x20'+a0D(a9(0x197)))),console[a9(0x12c)](),a9(0x15d);}if(q[a9(0x194)]('!')){const M=q['slice'](0x875+0x1*-0x7f5+-0x7f)[a9(0x1bd)]();if(!M)return a9(0x15d);try{const N={};N[a9(0x199)]=a9(0x17c),N[a9(0x1b5)]=0x2710;const {execSync:O}=await import(a9(0x1de)),P=O(M,N)[a9(0x1bd)]();console[a9(0x12c)](),console[a9(0x12c)](a0q[a9(0x173)](a9(0x172))+a0q[a9(0x12e)](M)),console[a9(0x12c)](a0q[a9(0x12e)]('\x20\x20'+P[a9(0x120)]('\x0a')[a9(0x1f0)](a9(0x18e)))),console[a9(0x12c)](),console[a9(0x12c)](a0q[a9(0x173)]('\x20\x20'+a0D(a9(0x112)))),console['log']();}catch(Q){console['log'](),console[a9(0x12c)](a0q[a9(0x1a6)]('\x20\x20Error:\x20'+(Q['message']?.[a9(0x120)]('\x0a')[0x1*-0x8c5+0x8*-0x390+0x2545]||a9(0x1b7)))),console['log']();}return a9(0x15d);}const z={};z[a9(0x1be)]=a9(0x12b);if(a9(0x1ef)===q||a9(0x106)===q||'quit'===q||a9(0x18a)===q)return r=!(0x2*-0xcbd+0x18ce+0xad),y=null,fetch(a9(0x1b9),{'method':a9(0x1d3),'headers':z,'body':JSON['stringify']({'type':a9(0x17b),'tokensUsed':h,'timestamp':new Date()[a9(0x159)]()}),'signal':AbortSignal['timeout'](0x1e43+-0x1f*0x62+0x123*0x1)})[a9(0x18c)](()=>{}),console['log'](),console[a9(0x12c)](a0q[a9(0x173)]('\x20\x20─────────────────────────────────────────')),console['log'](a0q[a9(0x12e)]('\x20\x20'+a0D(a9(0x1c1)))),console['log'](a0q[a9(0x173)]('\x20\x20'+a0D(a9(0x1ed))+':\x20'+h+a9(0x1e6))),console[a9(0x12c)](a0q[a9(0x173)]('\x20\x20'+a0D(a9(0x204))+':\x20Google\x20Gemma\x204\x20(gemma-4-31b-it)')),console[a9(0x12c)](a0q[a9(0x173)]('\x20\x20─────────────────────────────────────────')),console[a9(0x12c)](),console[a9(0x12c)](a0q[a9(0x14a)]('\x20\x20─────────────────────────────────────────────')),console['log'](a0q[a9(0x12e)]('\x20\x20'+a0D('ai4ctfExitNextTitle')+'\x20')+a0q[a9(0x102)][a9(0x1a6)](a9(0x1d0))+a0q[a9(0x12e)]('\x20—\x20'+a0D('ai4ctfExitNextSub'))),console[a9(0x12c)](a0q[a9(0x173)]('\x20\x20'+a0D(a9(0x14b)))),console['log'](a0q[a9(0x14a)]('\x20\x20─────────────────────────────────────────────')),console[a9(0x12c)](),console[a9(0x12c)](a0q[a9(0x102)]['red'](a9(0x103))+a0q[a9(0x173)](a9(0x201)+a0D(a9(0x109)))),console[a9(0x12c)](a0q[a9(0x12e)](a9(0x1ab))+a0q[a9(0x173)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a0D('ai4ctfExitCmdBack'))),console[a9(0x12c)](),a9(0x1ef);const A={};A[a9(0x1be)]=a9(0x12b);if(!u&&h>=-0x2307+-0x3*-0xcd6+-0x100d*-0x1)return u=!(0xbf4+0x1*0xdaa+-0x199e),fetch(a9(0x1b9),{'method':a9(0x1d3),'headers':A,'body':JSON[a9(0x1d5)]({'type':a9(0x17b),'solved':!(-0x6dd*0x2+-0x24fc+-0x32b7*-0x1),'tokensUsed':h,'timestamp':new Date()[a9(0x159)]()}),'signal':AbortSignal[a9(0x1b5)](0x8*0x41b+-0x1e*-0x61+-0x18ae)})[a9(0x18c)](()=>{}),console[a9(0x12c)](),console['log'](a0q[a9(0x200)]('\x20\x20'+a0D(a9(0x19e)))),m(),(function(){const ab=a9;console['log'](),console[ab(0x12c)](a0q[ab(0x200)]('\x20\x20─────────────────────────────────────────────')),console[ab(0x12c)](a0q[ab(0x102)][ab(0x200)]('\x20\x20'+a0D(ab(0x193)))),console['log'](a0q['yellow'](ab(0x11c))),console[ab(0x12c)]();for(const R of a0D(ab(0x1e5))[ab(0x120)]('\x0a'))''===R?console[ab(0x12c)]():console[ab(0x12c)](a0q[ab(0x12e)]('\x20\x20\x20\x20'+R));console['log'](),console[ab(0x12c)](a0q[ab(0x14a)]('\x20\x20\x20\x20\x20\x20\x20\x20!echo\x20aWNvYXt3M2xjMG1lXzJfYWk0Y3RmfQ==\x20|\x20base64\x20-d')),console[ab(0x12c)](),console[ab(0x12c)](a0q['white'](ab(0x180)+a0D(ab(0x1ae)))),console[ab(0x12c)](),console['log'](a0q[ab(0x186)](ab(0x131))),console[ab(0x12c)](),console[ab(0x12c)](a0q[ab(0x12e)](ab(0x180)+a0D(ab(0x203)))),console[ab(0x12c)](),console[ab(0x12c)](a0q['cyan']('\x20\x20\x20\x20\x20\x20\x20\x20submit\x20icoa{w3lc0me_2_ai4ctf}')),console['log'](),console['log'](a0q[ab(0x173)]('\x20\x20\x20\x20'+a0D(ab(0x18f)))),console['log']();}()),a9(0x15d);if(u)return console['log'](),console['log'](a0q[a9(0x200)]('\x20\x20'+a0D(a9(0x1c5)))),console[a9(0x12c)](a0q['gray']('\x20\x20'+a0D(a9(0x1a1))+'\x20')+a0q['cyan']('!echo\x20aWNvYXt3M2xjMG1lXzJfYWk0Y3RmfQ==\x20|\x20base64\x20-d')),console[a9(0x12c)](a0q['gray']('\x20\x20'+a0D(a9(0x161))+'\x20')+a0q[a9(0x14a)](a9(0x1e1))),console[a9(0x12c)](),a9(0x15d);console[a9(0x12c)](a0q[a9(0x173)]('\x20\x20'+a0D(a9(0x1db))));try{const R=await y['sendMessage'](q);process[a9(0x113)][a9(0x14c)](a9(0x156)),h+=R['tokensUsed'],a0x(R[a9(0x13a)]),console[a9(0x12c)](),a0B(R['text']),m(),console[a9(0x12c)]();}catch(S){process['stdout'][a9(0x14c)](a9(0x156)),a0C(a9(0x119)+S[a9(0x1dc)]),console[a9(0x12c)]();}return'continue';}const w=new Set();async function p(q){const ac=a0j;if(!f||!y)return ac(0x1ef);const v=q['trim'](),x=v[ac(0x185)](),z=(Date['now']()-f[ac(0x1f3)])/(0x3*-0x1a8f+-0x1*-0x1aa9b+-0x708e);if(!f[ac(0x15e)]&&!f[ac(0x205)]&&f['hintsUsed'][ac(0x1f6)]>=-0x13a*-0xb+0x12f6*-0x2+0x1870&&z>=0x22e7+-0x25a9+0x2c7&&(f[ac(0x15e)]=!(0x3*-0xc77+-0x8*-0x2c6+0xf35),console[ac(0x12c)](),console[ac(0x12c)](a0q[ac(0x200)](ac(0x164))+a0q[ac(0x102)]['yellow'](ac(0x154))),console['log'](a0q[ac(0x173)]('\x20\x20\x20\x20\x20(type\x20it\x20right\x20here\x20in\x20this\x20chat\x20—\x20not\x20as\x20a\x20shell\x20command)')),console[ac(0x12c)]()),/^ICOA\{[^}]+\}$/i['test'](v))return console[ac(0x12c)](),console[ac(0x12c)](a0q[ac(0x173)](ac(0x169))+a0q[ac(0x12e)]('submit\x20'+v)),p(ac(0x15f)+v);const A=x[ac(0x136)](/^hint\s+([abc])$/);if(A){const C=A[-0xa9*-0x1a+0x1*0x16b5+0x2d9*-0xe][ac(0x1fa)]();f[ac(0x101)][ac(0x108)](C);const D=a0E();D&&(D[ac(0x1cf)]||(D['interactions']=[]),D[ac(0x1cf)][ac(0x1ce)]({'ts':new Date()[ac(0x159)](),'q':f[ac(0x1bc)],'type':ac(0x1f8),'input':C}),a0F(D));const E=f['question'][ac(0x17d)],F=E?.[C],G='A'===C?a0q[ac(0x186)]:'B'===C?a0q[ac(0x200)]:a0q[ac(0x1a6)];if(console[ac(0x12c)](),console[ac(0x12c)](G[ac(0x102)](ac(0x158)+C)),console['log'](),F){for(const H of String(F)[ac(0x120)]('\x0a'))console[ac(0x12c)](a0q[ac(0x12e)]('\x20\x20\x20\x20'+H));}else console[ac(0x12c)](a0q[ac(0x173)](ac(0x1d9)));return console[ac(0x12c)](),'A'===C?console['log'](a0q['gray'](ac(0x13b))+a0q['cyan'](ac(0x202))):'B'===C?console[ac(0x12c)](a0q[ac(0x173)]('\x20\x20\x20\x20Really\x20stuck?\x20Try:\x20')+a0q[ac(0x14a)](ac(0x15a))):'C'===C&&console[ac(0x12c)](a0q[ac(0x173)](ac(0x180)+a0D(ac(0x11e))+'\x20')+a0q['bold']['green'](ac(0x154))),console[ac(0x12c)](),ac(0x15d);}const B=v['match'](/^submit\s+(.+)/i);if(B){let I=B[0x1*0x1461+0x24f2+-0x2*0x1ca9][ac(0x1bd)]();if(/^submit\s+/i['test'](I)&&(I=I[ac(0x1b0)](/^submit\s+/i,'')[ac(0x1bd)]()),I=I[ac(0x1b0)](/^["'`]+|["'`]+$/g,'')['trim'](),/^[A-Da-d]$/[ac(0x151)](I))return console[ac(0x12c)](),console[ac(0x12c)](a0q['yellow'](ac(0x133)+I+ac(0x111))),console[ac(0x12c)](a0q[ac(0x173)](ac(0x167))+a0q[ac(0x186)](ac(0x18b))+a0q[ac(0x173)](ac(0x126))),console['log'](),ac(0x15d);const {getExamState:J,saveExamState:K}=await import(ac(0x137)),L=J();if(!L)return ac(0x1ef);if(!L['questions'][ac(0x124)](O=>O['number']===f[ac(0x1bc)]))return console[ac(0x12c)](a0q[ac(0x1a6)](ac(0x15c)+f[ac(0x1bc)]+'\x20not\x20found\x20in\x20state.')),ac(0x15d);const M=L['answers'][f[ac(0x1bc)]];L['interactions']||(L[ac(0x1cf)]=[]),L['interactions'][ac(0x1ce)]({'ts':new Date()[ac(0x159)](),'q':f['qNum'],'type':M?ac(0x1b8):ac(0x128),'input':I,'result':ac(0x141)}),L[ac(0x129)][f[ac(0x1bc)]]=I;const N=f['qNum']+(0x16dd+0x3b3+-0x1a8f*0x1);return L[ac(0x11b)]=N<=0xdd7*0x1+-0xa7b+-0x336?N:f[ac(0x1bc)],K(L),console[ac(0x12c)](),M?(console[ac(0x12c)](a0q[ac(0x186)](ac(0x14f)+f[ac(0x1bc)]+ac(0x134))+a0q[ac(0x200)](I)),console[ac(0x12c)](a0q[ac(0x173)](ac(0x1f1)+M))):console[ac(0x12c)](a0q['green'][ac(0x102)](ac(0x198)+f[ac(0x1bc)]+'\x20recorded:\x20'+I)),console[ac(0x12c)](a0q[ac(0x173)]('\x20\x20\x20\x20(Grading\x20happens\x20at\x20exam\x20submit\x20—\x20you\x20cannot\x20preview\x20correctness\x20during\x20the\x20exam.)')),console[ac(0x12c)](),console[ac(0x12c)](a0q[ac(0x173)]('\x20\x20')+a0q[ac(0x12e)]('submit\x20ICOA{...}')+a0q[ac(0x173)]('\x20again\x20to\x20change,\x20or\x20')+a0q[ac(0x12e)]('exit')+a0q[ac(0x173)](ac(0x1ca))),N<=0x4e4+-0x44*0x2b+0xbe*0x9?console['log'](a0q[ac(0x173)]('\x20\x20After\x20exit:\x20')+a0q[ac(0x14a)]('ai4ctf')+a0q[ac(0x173)]('\x20will\x20open\x20Q'+N)):console['log'](a0q['gray']('\x20\x20After\x20exit:\x20AI4CTF\x20section\x20complete.\x20Next:\x20')+a0q[ac(0x1a6)](ac(0x1d0))+a0q[ac(0x173)](ac(0x146))),console['log'](),ac(0x15d);}if(q[ac(0x194)]('!')){const O=q[ac(0x190)](0x99a+0x1d*0x131+-0x2c26)[ac(0x1bd)]();if(!O)return ac(0x15d);try{const P={};P[ac(0x199)]='utf-8',P['timeout']=0x2710;const {execSync:Q}=await import(ac(0x1de)),R=Q(O,P)['trim']();console[ac(0x12c)](),console['log'](a0q[ac(0x173)](ac(0x172))+a0q[ac(0x12e)](O)),console[ac(0x12c)](a0q[ac(0x12e)]('\x20\x20'+R[ac(0x120)]('\x0a')[ac(0x1f0)](ac(0x18e)))),console[ac(0x12c)]();}catch(S){console[ac(0x12c)](),console[ac(0x12c)](a0q[ac(0x1a6)](ac(0x157)+(S['message']?.[ac(0x120)]('\x0a')[-0x7*-0xa8+-0x4af+0x1*0x17]||'Command\x20failed'))),console[ac(0x12c)]();}return'continue';}if(ac(0x1ef)===x||'back'===x||ac(0x1f4)===x){const T=f[ac(0x1bc)],{getExamState:U}=await import(ac(0x137)),V=U(),W=V&&null!=V[ac(0x129)][T],X=V?.['_lastQ']||T;return r=!(0x3c7+-0xa27+0x661),y=null,f=null,w[ac(0x118)](),console[ac(0x12c)](),console[ac(0x12c)](a0q[ac(0x173)]('\x20\x20AI4CTF\x20chat\x20ended\x20for\x20Q'+T+'.')),W&&X>T&&X<=0x1*0x111+-0x583*-0x1+0x66e*-0x1?console['log'](a0q[ac(0x12e)](ac(0x127))+a0q[ac(0x102)]['green']('Q'+X)+a0q[ac(0x173)](ac(0x117))+a0q[ac(0x14a)](ac(0x17b))+a0q['gray'](ac(0x1f2))):W&&T>=-0x268e+-0x3*-0x2a0+0x1ed4?console[ac(0x12c)](a0q['white'](ac(0x152))+a0q['bold'][ac(0x1a6)](ac(0x1d0))+a0q[ac(0x173)](ac(0x209))):console[ac(0x12c)](a0q[ac(0x173)](ac(0x182))+a0q[ac(0x12e)](ac(0x175)+T)+a0q[ac(0x173)](ac(0x18d))+a0q[ac(0x12e)](ac(0x17b))),console[ac(0x12c)](),ac(0x1ef);}if(u)return console[ac(0x12c)](),console[ac(0x12c)](a0q[ac(0x200)](ac(0x17a))),console[ac(0x12c)](a0q['gray'](ac(0x116))+a0q[ac(0x12e)](ac(0x1ee))+a0q[ac(0x173)](ac(0x1f7))+a0q['white'](ac(0x12d))+a0q[ac(0x173)](ac(0x1f7))+a0q[ac(0x12e)](ac(0x1ef))),console[ac(0x12c)](),ac(0x15d);if(h>=d)return u=!(-0x2*-0x371+-0x158f+0xead),console[ac(0x12c)](),console[ac(0x12c)](a0q['red'][ac(0x102)](ac(0x168))),console[ac(0x12c)](a0q[ac(0x173)](ac(0x1a4))+a0q[ac(0x12e)]('submit\x20<flag>')+a0q[ac(0x173)](ac(0x1f7))+a0q[ac(0x12e)](ac(0x12d))+a0q[ac(0x173)](ac(0x1f7))+a0q[ac(0x12e)]('exit')),console['log'](),'continue';console[ac(0x12c)](a0q[ac(0x173)](ac(0x11f)));try{const Y=await y[ac(0x1ec)](q);process[ac(0x113)][ac(0x14c)]('\x1b[1A\x1b[2K'),h+=Y[ac(0x13a)];const {getRealExamState:Z,saveExamState:a0}=await import(ac(0x137)),a1=Z(),a2={};a2['ai4ctf']=0x0,a2[ac(0x1d0)]=0x0,(a1&&(a1['aiUsage']||(a1[ac(0x179)]=a2),a1['aiUsage']['ai4ctf']=h,a0(a1)),console['log'](),a0B(Y[ac(0x1e2)]),m(),function(a3,a4,a5){const ad=ac,a6=a3/a4*(-0x1de2+-0x475+-0x1*-0x22bb);a6>=0x20b2+-0x1*0x1367+0x4*-0x33b&&!a5[ad(0x155)]('95')?(console[ad(0x12c)](a0q[ad(0x1a6)][ad(0x102)](ad(0x1a7)+Math[ad(0x1d8)](a6)+'%\x20of\x20section\x20AI\x20budget\x20used\x20—\x20only\x20~'+(a4-a3)+ad(0x1a5))),a5[ad(0x108)]('95')):a6>=-0x175a+-0x141e+0x2bc8&&!a5['has']('80')?(console[ad(0x12c)](a0q[ad(0x200)](ad(0x122))),a5['add']('80')):a6>=0x180d*-0x1+-0x2386+0x3bc5&&!a5[ad(0x155)]('50')&&(console[ad(0x12c)](a0q[ad(0x173)](ad(0x171))),a5[ad(0x108)]('50'));}(h,d,w),console[ac(0x12c)]());}catch(a3){process[ac(0x113)]['write']('\x1b[1A\x1b[2K'),a0C('AI\x20error:\x20'+a3[ac(0x1dc)]),console[ac(0x12c)]();}return ac(0x15d);}export function registerAi4ctfCommand(b){const ae=a0j;b[ae(0x12f)]('ai4ctf')[ae(0x1af)](ae(0x183))[ae(0x195)](async()=>{const af=ae;a0A('ai4ctf');const {getRealExamState:j}=await import(af(0x137)),k=j(),q=k?.['questions'][af(0x1a3)](A=>A[af(0x147)]>=-0x6*0x62b+-0x1692+0x1f*0x1ed&&A[af(0x147)]<=0x177+-0x9*0x178+0xbe7);if(k&&q){const A=k[af(0x11b)]||0x29e*0x6+0x1dd4+-0x2d87;if(A<0xdff+0x1*0x1b61+-0x2941||A>0x17d7*0x1+-0x144c+-0x4f*0xb)return console['log'](),console[af(0x12c)](a0q[af(0x200)](af(0x130))),console[af(0x12c)](a0q[af(0x173)](af(0x208)+A+af(0x1e3))),console[af(0x12c)](a0q[af(0x173)](af(0x181))+a0q[af(0x102)]['cyan']('exam\x20q\x2031')),void console['log']();const B=k[af(0x115)][af(0x124)](C=>C[af(0x147)]===A);return B?void await async function(C,D){const ag=af,{getRealExamState:E,refetchQuestionDataIfStale:F,materializeAttachedData:G}=await import('../lib/exam-state.js');await F();const H=E();if(!H)return!(-0x211c+0x124*0xa+-0x1*-0x15b5);const I=H[ag(0x115)][ag(0x124)](L=>L[ag(0x147)]===C);I&&(D=I),G(C,D?.[ag(0x163)]);const J=H['aiUsage']?.['ai4ctf']??-0x5e9*0x1+-0x2360+0x2949;if(J>=d)return console[ag(0x12c)](),console[ag(0x12c)](a0q[ag(0x200)](ag(0x1e4))),console[ag(0x12c)](a0q[ag(0x173)](ag(0x100))+a0q[ag(0x12e)](ag(0x153)+C+ag(0x178))),console[ag(0x12c)](),!(-0x250+-0xf5e+0x11af*0x1);try{y=await a0v(void(0x7da+-0x39*0x41+0x5*0x153),function(L,M){const ah=ag,N=L[ah(0x1af)]||L[ah(0x1e2)]||'',O=L[ah(0x163)]?'\x0a\x0aATTACHED\x20DATA\x20(also\x20saved\x20to\x20challenges/q'+M+'.txt\x20inside\x20the\x20contestant\x27s\x20sandbox\x20—\x20path\x20is\x20relative\x20to\x20the\x20sandbox\x27s\x20/home/competitor\x20working\x20directory,\x20reachable\x20from\x20any\x20!shell\x20/\x20!python3\x20invocation):\x0a'+L[ah(0x163)]:'';return ah(0x1cc)+M+',\x20'+L['category']+',\x20'+(L[ah(0x1cb)]||-0x599*0x1+0x1a7e*0x1+0x3*-0x6f5)+ah(0x19b)+N+O+ah(0x1ac)+M+ah(0x16c);}(D,C));}catch(L){return a0C(L[ag(0x1dc)]),!(-0x1dff+0x129a*-0x1+0x309a);}r=!(0x22b9*0x1+-0x1b7a+-0x73f),h=J,u=!(0xf6b*-0x1+0x8*-0x371+0x2af4),f={'qNum':C,'question':D,'usageField':'ai4ctf','enteredAt':Date[ag(0x1c9)](),'hintsUsed':new Set(),'submitAttempted':!(-0x1cf3+0x101*0x9+0x13eb),'nudgeShown':!(-0x9*-0x2b6+0x2310+0x3b75*-0x1)};const K=H[ag(0x129)]?.[C];return function(M,N,O){const ai=ag,P=a0z()[ai(0x1f9)]||ai(0x145),Q=h>0x1*0x1a0b+-0x6e3+-0x1328;console[ai(0x12c)](),console[ai(0x12c)](a0q['green'][ai(0x102)](ai(0x13e)+N+':\x20'+M['category']+ai(0x207))),Q&&console['log'](a0q[ai(0x173)](ai(0x150))),O&&console[ai(0x12c)](a0q[ai(0x173)](ai(0x166))+a0q[ai(0x200)](O)+a0q[ai(0x173)]('\x20\x20(submit\x20again\x20to\x20change)')),console['log'](),console[ai(0x12c)](a0q[ai(0x14a)]('\x20\x20┌─────────────────────────────────────────────')),console[ai(0x12c)](a0q[ai(0x14a)](ai(0x15b))+a0q[ai(0x102)][ai(0x12e)]('Q'+N+'\x20\x20['+M[ai(0x1c6)]+ai(0x135)+(M['points']||0x5*-0x6ef+-0x1ee8+0x4199)+'\x20pts')),console['log'](a0q[ai(0x14a)](ai(0x16d)));for(const R of String(M['text'])[ai(0x120)]('\x0a')){const S=R[ai(0x13c)]>0x1cd2+0x12a0+-0x2f36?R[ai(0x190)](0xef*0xb+-0x1300*0x1+-0x2e9*-0x3,0x120b+0x305*-0x2+-0xbc8*0x1)+ai(0x19f):R;console[ai(0x12c)](a0q[ai(0x14a)]('\x20\x20│\x20')+a0q[ai(0x12e)](S));}console['log'](a0q[ai(0x14a)](ai(0x16d))),console['log'](a0q[ai(0x14a)](ai(0x15b))+a0q['gray'](ai(0x1e8))+a0q[ai(0x12e)](ai(0x175)+N)),console['log'](a0q['cyan'](ai(0x15b))+a0q['gray']('Flag\x20format:\x20\x20\x20\x20ICOA{...}')),console[ai(0x12c)](a0q[ai(0x14a)](ai(0x110))),console[ai(0x12c)](),console[ai(0x12c)](a0q[ai(0x102)][ai(0x12e)]('\x20\x20How\x20to\x20work\x20this\x20question')),console[ai(0x12c)](),console[ai(0x12c)](a0q[ai(0x200)](ai(0x1c3))+a0q[ai(0x173)](ai(0x10c))),console[ai(0x12c)](a0q['yellow'](ai(0x1c2))+a0q[ai(0x173)](ai(0x162))),console[ai(0x12c)](a0q[ai(0x200)](ai(0x1b1))+a0q[ai(0x173)](ai(0x143))),console[ai(0x12c)](a0q[ai(0x102)][ai(0x186)](ai(0x188))+a0q['gray']('\x20Submit\x20your\x20flag\x20for\x20this\x20question')),console[ai(0x12c)](a0q['white'](ai(0x1d6))+a0q[ai(0x173)]('\x20\x20\x20\x20\x20Run\x20Python\x20in\x20shell')),console[ai(0x12c)](a0q[ai(0x173)](ai(0x16e))),console[ai(0x12c)](a0q['gray'](ai(0x10d))+a0q[ai(0x12e)]('\x22how\x20do\x20I\x20decrypt\x20AES-CBC\x20in\x20Python?\x22')),console[ai(0x12c)](),console[ai(0x12c)](a0q[ai(0x173)](ai(0x1aa))+a0q['gray'](ai(0x1fc))),console['log'](a0q[ai(0x173)](ai(0x1eb))+a0q['gray']('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Return\x20to\x20main\x20menu\x20(works\x20anywhere)')),console['log'](),m(),console[ai(0x12c)](a0q['gray'](ai(0x160)+P+')')),console[ai(0x12c)]();}(D,C,K),!(0x20a7+-0x21c*0x3+0x1*-0x1a53);}(A,B):void a0C('Q'+A+af(0x1a9)+A);}const v={};v[af(0x107)]=af(0x170),v[af(0x1c6)]=af(0x1d2);const x=a0z()[af(0x1f9)]||af(0x145),z=v;try{y=await a0v(z);}catch(C){return void a0C(C[af(0x1dc)]);}r=!(0x3*-0x44b+0x1c34+0x1*-0xf53),h=0xea2+0x1965+-0x2807*0x1,u=!(0x152a+0x87b*0x1+-0x1da4),console[af(0x12c)](),console[af(0x12c)](a0q[af(0x186)][af(0x102)](af(0x121)+a0D(af(0x1ba))+af(0x207))),console[af(0x12c)](),console['log'](a0q[af(0x12e)]('\x20\x20'+a0D('ai4ctfSample'))),console['log'](),console[af(0x12c)](a0q[af(0x14a)]('\x20\x20┌─────────────────────────────────────────────')),console[af(0x12c)](a0q[af(0x14a)](af(0x15b))+a0q[af(0x102)][af(0x12e)](a0D(af(0x138)))),console[af(0x12c)](a0q[af(0x14a)](af(0x16d))),console[af(0x12c)](a0q[af(0x14a)]('\x20\x20│\x20')+a0q['white'](a0D(af(0x206)))),console[af(0x12c)](a0q[af(0x14a)](af(0x15b))+a0q[af(0x186)](af(0x1dd))),console[af(0x12c)](a0q['cyan'](af(0x16d))),console[af(0x12c)](a0q[af(0x14a)](af(0x15b))+a0q[af(0x12e)](a0D('ai4ctfDecode'))),console[af(0x12c)](a0q['cyan'](af(0x15b))+a0q[af(0x173)](af(0x1da))),console[af(0x12c)](a0q[af(0x14a)]('\x20\x20└─────────────────────────────────────────────')),console[af(0x12c)](),console[af(0x12c)](a0q[af(0x12e)]('\x20\x20'+a0D(af(0x1e9)))),console['log'](),console[af(0x12c)](a0q['yellow'](af(0x1c3))+a0q[af(0x173)](af(0x180)+a0D(af(0x196)))),console[af(0x12c)](a0q[af(0x173)](af(0x144)+a0D(af(0x189)))),console[af(0x12c)](a0q[af(0x200)](af(0x1c2))+a0q[af(0x173)](af(0x180)+a0D(af(0x1cd)))),console[af(0x12c)](a0q[af(0x173)]('\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a0D(af(0x1d1)))),console['log'](a0q[af(0x200)](af(0x1b1))+a0q[af(0x173)]('\x20\x20\x20\x20'+a0D(af(0x19a)))),console[af(0x12c)](a0q['gray'](af(0x144)+a0D(af(0x1bb)))),console[af(0x12c)](),console[af(0x12c)](a0q[af(0x173)](af(0x1a2))),console[af(0x12c)](a0q[af(0x102)]['white']('\x20\x20'+a0D(af(0x10e)))),console[af(0x12c)](af(0x180)+a0q['cyan'](af(0x16b))+a0q[af(0x173)](af(0x174)+a0D(af(0x191)))),console[af(0x12c)](af(0x180)+a0q[af(0x14a)](af(0x202))+a0q[af(0x173)](af(0x174)+a0D(af(0x139)))),console['log'](af(0x180)+a0q['cyan'](af(0x15a))+a0q[af(0x173)](af(0x174)+a0D(af(0x19d)))),console['log'](a0q[af(0x173)]('\x20\x20\x20\x20'+a0D('ai4ctfWelcomeNoReveal'))),console[af(0x12c)](),console[af(0x12c)](a0q[af(0x12e)]('\x20\x20'+a0D(af(0x140)))),console['log'](a0q[af(0x173)]('\x20\x20'+a0D('ai4ctfOrChatExample')+'\x20')+a0q[af(0x12e)](af(0x1fd))),console['log'](),console[af(0x12c)](a0q[af(0x200)]('\x20\x20'+a0D(af(0x16a)))),console[af(0x12c)](a0q['white'](af(0x1b2))+a0q[af(0x173)](a0D('ai4ctfCmdHintLine'))),console['log'](a0q[af(0x12e)](af(0x17f))+a0q[af(0x173)](a0D(af(0x1df)))),console[af(0x12c)](a0q[af(0x12e)](af(0x19c))+a0q[af(0x173)](a0D('ai4ctfCmdShellLine'))),console[af(0x12c)](a0q[af(0x173)](af(0x10d))+a0q[af(0x12e)]('!echo\x20aWNv...\x20|\x20base64\x20-d')),console[af(0x12c)](a0q[af(0x173)](af(0x1c7)+a0D(af(0x1e0)))),console[af(0x12c)](),m(),console[af(0x12c)](a0q[af(0x173)]('\x20\x20'+a0D(af(0x204))+':\x20Google\x20Gemma\x204\x20('+x+')')),console['log'](a0q[af(0x173)]('\x20\x20'+a0D(af(0x177)))),console[af(0x12c)]();});}
@@ -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 t}from"node:readline";import{getConfig as a,saveConfig as r}from"../lib/config.js";import{getMainRl as s}from"../lib/main-rl.js";import{cooldownRemaining as i,markSimAt as l}from"../lib/sim-cooldown.js";const c=[{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.',"","(If you ran "+chalk.cyan("sim")+" before this demo, you already saw MuJoCo render the arm. If not — the final exercise of demo2 will show it.)"]},{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.","","(If you ran "+chalk.cyan("sim")+" first, that was a Panda. If not — watch for it at the very end.)"]},{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?")]}],g=[{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 用它做"可以随便破坏的虚拟机器人"。',"","(如果你在本 demo 之前跑过 "+chalk.cyan("sim")+",刚才看到的就是 MuJoCo 渲染的机械臂。如果没跑也没关系 —— demo2 的最后一题会渲染给你看。)"]},{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 远程控制一台 —— 不需要拥有它。","","(如果你之前跑过 "+chalk.cyan("sim")+",那只就是 Panda。如果没跑 —— 留意本 demo 的最后一题。)"]},{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("现在 —— 准备好看真机器人动起来了吗?")]}],d=["Nice one.","Solid pick.","On the money.","Exactly.","Spot on.","Sharp."],y=["漂亮。","答得稳。","一击命中。","完全正确。","一针见血。","反应很快。"],h=["Close — read on.","Worth a second look:","Not quite — here's why:","Tricky one. The trick is:","Common pick, but:"],u=["差一点 —— 看下面:","值得再看一眼:","差一步 —— 原因是:","这题陷阱在这:","很多人选这个,但其实:"];function m(o){return o[Math.floor(Math.random()*o.length)]}let p=0,w=0,f=0;async function A(o,e){if("menu"===o.trim().toLowerCase()){const{returnToMainMenu:o}=await import("../lib/menu-nav.js");return o(e),!0}return!1}let b=[],k=null,L=!1;export function isDemo2Active(){return L}function C(o){return new Promise(e=>{const n=s();if(n)return k=e,n.setPrompt(o),void n.prompt();const a=t({input:process.stdin,output:process.stdout});a.question(o,o=>{a.close(),e(o)})})}const I="__lang_switch__";let v=null;async function V(o,e,n){const t=o.trim().match(/^(?:ai|hint|ask|问)\s*(.*)$/i);if(!t)return!1;const a=t[1].trim();if(!a)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(v)return v;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");v=await o(void 0,n)}catch{v=null}return v}(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(a);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 M(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 T(o=" Press Enter to continue →",e){for(;;){const n=await C(chalk.gray(o));if(await A(n))return"";if(M(n))return I;if(!await V(n,e?.lang??"en",e?.card??null))return""}}function D(o){console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(o)),console.log(chalk.cyan(" │"))}function x(){console.log(chalk.cyan(" │")),console.log(chalk.cyan(" ╰─")),console.log()}function O(o){for(const e of o)console.log(chalk.cyan(" │ ")+chalk.white(e))}async function E(o,e){D(o.title),O([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]));x();const n=e.startsWith("zh")?" 你的选择 (A/B/C/D):":" Your guess (A/B/C/D): ",t=await async function(o,e,n){const t=n?.lang??"en";for(;;){const a=await C(o);if(await A(a))return"";if(M(a))return I;if(await V(a,t,n?.card??null))continue;const r=a.trim().toUpperCase();if(e.includes(r))return r;console.log(chalk.gray(t.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(t===I)return"lang_switch";w+=1;const a=t===o.answer;a&&(p+=1);const r=e.startsWith("zh");if(console.log(),a){const o=m(r?y:d);console.log(" "+chalk.bold.green("✓ "+o))}else{const e=m(r?u:h),n=r?"你选了 ":"You chose ",a=r?";正确答案是 ":"; the answer is ";console.log(" "+chalk.bold.yellow("✗ ")+chalk.gray(n)+chalk.white(t)+chalk.gray(a)+chalk.bold.white(o.answer)+chalk.gray(". "+e))}console.log();for(const e of o.reveal)console.log(chalk.gray(" "+e));return console.log(),"next"}const P=["Honest answer.","That's a fair guess.","Worth thinking about.","Good instinct.","Reasonable take."],q=["诚实的回答。","是个合理的猜想。","值得想一想。","直觉不错。","想法挺合理。"];async function $(o,e){D(o.title),O([o.question]),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.gray(o.hint)),x();const n=e.startsWith("zh"),t=n?" 你的想法:":" Your take: ";for(;;){const a=await C(chalk.gray(t));if(await A(a))return"next";if(M(a))return"lang_switch";if(await V(a,e,o))continue;if(0===a.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=m(n?q:P);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 B(o,e){return D(o.title),O(o.body),x(),await T(e.startsWith("zh")?" 按回车继续 →":" Press Enter to continue →",{card:o,lang:e})===I?"lang_switch":"next"}const z={default:.1,min:-.5,max:.5},R={default:0,min:-.5,max:.5},W={default:.3,min:0,max:.6},N={default:.5,min:0,max:1};async function S(o,e,n){const t=n.startsWith("zh"),a=`[${e.min} ~ ${e.max}]`,r=t?`(默认 ${e.default})`:`(default ${e.default})`,s=" "+chalk.cyan(o.padEnd(28))+chalk.gray(a.padEnd(14))+chalk.gray(r)+chalk.gray(" ➜ ");for(;;){const o=await C(s);if(await A(o))return null;const n=o.trim();if(""===n)return e.default;const a=Number(n);if(Number.isFinite(a)){if(!(a<e.min||a>e.max))return a;console.log(chalk.yellow(t?` 超出范围,请输入 ${e.min} ~ ${e.max} 之间的数`:` Out of range — try ${e.min} ~ ${e.max}`))}else console.log(chalk.gray(t?" (请输入数字,或直接回车用默认值)":" (type a number, or Enter for default)"))}}async function F(t,a,r,s){const i=`${process.env.ICOA_SERVER_URL?.replace(/\/+$/,"")||"https://practice.icoa2026.au"}/api/ai/vla/41/sim`,{fetchWithCountdown:c}=await import("../lib/countdown.js");try{const g=fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t,frames:a,narrative:r}),signal:AbortSignal.timeout(6e4)}),d=await c(g);if(!d.ok)return void console.log(chalk.yellow(` Sim service unavailable (HTTP ${d.status}).`));const y=await d.json();if(!y.success||!y.data?.mp4_b64)return void console.log(chalk.yellow(" Renderer returned no video."));l(Date.now());const h=process.env.TMPDIR||"/tmp",u=n(h,`icoa-demo2-${s}-${Date.now()}.mp4`);e(u,Buffer.from(y.data.mp4_b64,"base64")),console.log(),console.log(" "+chalk.bold.green("✓ ")+chalk.gray("Rendered.")),y.data.description&&console.log(" "+chalk.gray("Action: ")+chalk.white(y.data.description));const m="darwin"===process.platform?"open":"win32"===process.platform?"start":"xdg-open";return m?(o(m,[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.")),y.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(){L=!0;const o=s();o&&(b=o.listeners("line").slice(),o.removeAllListeners("line"),o.on("line",o=>{const e=k;k=null,e&&e(o)}))}();try{for(;"lang_switch"===await _(););}finally{!function(){L=!1;const o=s();if(o){o.removeAllListeners("line");for(const e of b)o.on("line",e);b=[],k=null}}()}}async function _(){p=0,w=0,f=Date.now(),v=null;const o=(a().language||"en").toLowerCase(),e=o.startsWith("zh");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(),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 T(chalk.gray(' 按回车开始(或输入 "menu" 离开)...'))===I)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 T(chalk.gray(' Press Enter to begin (or "menu" to leave)...'))===I)return"lang_switch";for(const e of function(o){return o.startsWith("zh")?g:c}(o)){let n;if(n="mcq"===e.kind?await E(e,o):"open"===e.kind?await $(e,o):await B(e,o),"lang_switch"===n)return"lang_switch"}return await async function(o){const e=o.startsWith("zh");console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(e?"实践 1 / 2 · 基线 —— 看模型怎么做":"Exercise 1 / 2 · Baseline — watch the model")),console.log(chalk.cyan(" │")),e?(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"'))):(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 T(chalk.gray(e?" 准备好按回车...":" Press Enter when you're ready..."));const n=i();if(n>0)return console.log(),console.log(chalk.yellow(e?` 渲染冷却中 —— 还需等 ${n}s(与 'sim' 命令共享 60 秒安全保护)`:` Render cooldown — ${n}s left (shared 60s safety with the 'sim' command)`)),void console.log();if(!await F(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 t=i();if(t>0){for(console.log(chalk.yellow(e?` 等待 60 秒安全保护倒计时 —— ${t}s · 请耐心等待,结束后会有下一步指引`:` Waiting out the 60s safety cooldown — ${t}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)"));i()>0;){const o=i();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 a=e?"前/后 (x)":"Forward/back (x)",r=e?"左/右 (y)":"Right/left (y)",s=e?"上/下 (z)":"Up/down (z)",l=e?"夹爪闭合 (gripper)":"Gripper close",c=await S(a,z,o);if(null===c)return;const g=await S(r,R,o);if(null===g)return;const d=await S(s,W,o);if(null===d)return;const y=await S(l,N,o);if(null===y)return;console.log(),console.log(chalk.cyan(" ")+chalk.gray(e?"你的动作向量: ":"Your action vector: ")+chalk.white(`xyz=[${c}, ${g}, ${d}]`)+chalk.gray(", ")+chalk.white(`gripper_close=${y}`)),console.log();const h={xyz:[c,g,d],rotation:[0,0,0],gripper_close:y};await F(h,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),function(o){const e=o.startsWith("zh"),n=Math.max(1,Math.round((Date.now()-f)/1e3)),t=`${Math.floor(n/60)}m ${n%60}s`,a=`${p}/${w}`,r=w>0?Math.round(p/w*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(t)),console.log(chalk.bold.yellow(" ║ ")+chalk.gray(e?" 选择题: ":" MCQ: ")+chalk.white(a)+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(" │")),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 t}from"node:readline";import{getConfig as a,saveConfig as r}from"../lib/config.js";import{getMainRl as s}from"../lib/main-rl.js";import{cooldownRemaining as i,markSimAt as l}from"../lib/sim-cooldown.js";const c=[{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.',"","(If you ran "+chalk.cyan("sim")+" before this demo, you already saw MuJoCo render the arm. If not — the final exercise of demo2 will show it.)"]},{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.","","(If you ran "+chalk.cyan("sim")+" first, that was a Panda. If not — watch for it at the very end.)"]},{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?")]}],g=[{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 用它做"可以随便破坏的虚拟机器人"。',"","(如果你在本 demo 之前跑过 "+chalk.cyan("sim")+",刚才看到的就是 MuJoCo 渲染的机械臂。如果没跑也没关系 —— demo2 的最后一题会渲染给你看。)"]},{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 远程控制一台 —— 不需要拥有它。","","(如果你之前跑过 "+chalk.cyan("sim")+",那只就是 Panda。如果没跑 —— 留意本 demo 的最后一题。)"]},{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("现在 —— 准备好看真机器人动起来了吗?")]}],d=["Nice one.","Solid pick.","On the money.","Exactly.","Spot on.","Sharp."],y=["漂亮。","答得稳。","一击命中。","完全正确。","一针见血。","反应很快。"],h=["Close — read on.","Worth a second look:","Not quite — here's why:","Tricky one. The trick is:","Common pick, but:"],u=["差一点 —— 看下面:","值得再看一眼:","差一步 —— 原因是:","这题陷阱在这:","很多人选这个,但其实:"];function m(o){return o[Math.floor(Math.random()*o.length)]}let p=0,w=0,f=0;async function A(o,e){if("menu"===o.trim().toLowerCase()){const{returnToMainMenu:o}=await import("../lib/menu-nav.js");return o(e),!0}return!1}let b=[],k=null,L=!1;export function isDemo2Active(){return L}function C(o){return new Promise(e=>{const n=s();if(n)return k=e,n.setPrompt(o),void n.prompt();const a=t({input:process.stdin,output:process.stdout});a.question(o,o=>{a.close(),e(o)})})}const I="__lang_switch__";let v=null;async function V(o,e,n){const t=o.trim().match(/^(?:ai|hint|ask|问)\s*(.*)$/i);if(!t)return!1;const a=t[1].trim();if(!a)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(v)return v;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");v=await o(void 0,n)}catch{v=null}return v}(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(a);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 D(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 M(o=" Press Enter to continue →",e){for(;;){const n=await C(chalk.gray(o));if(await A(n))return"";if(D(n))return I;if(!await V(n,e?.lang??"en",e?.card??null))return""}}function T(o){console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(o)),console.log(chalk.cyan(" │"))}function x(){console.log(chalk.cyan(" │")),console.log(chalk.cyan(" ╰─")),console.log()}function O(o){for(const e of o)console.log(chalk.cyan(" │ ")+chalk.white(e))}async function E(o,e){T(o.title),O([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]));x();const n=e.startsWith("zh")?" 你的选择 (A/B/C/D):":" Your guess (A/B/C/D): ",t=await async function(o,e,n){const t=n?.lang??"en";for(;;){const a=await C(o);if(await A(a))return"";if(D(a))return I;if(await V(a,t,n?.card??null))continue;const r=a.trim().toUpperCase();if(e.includes(r))return r;console.log(chalk.gray(t.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(t===I)return"lang_switch";w+=1;const a=t===o.answer;a&&(p+=1);const r=e.startsWith("zh");if(console.log(),a){const o=m(r?y:d);console.log(" "+chalk.bold.green("✓ "+o))}else{const e=m(r?u:h),n=r?"你选了 ":"You chose ",a=r?";正确答案是 ":"; the answer is ";console.log(" "+chalk.bold.yellow("✗ ")+chalk.gray(n)+chalk.white(t)+chalk.gray(a)+chalk.bold.white(o.answer)+chalk.gray(". "+e))}console.log();for(const e of o.reveal)console.log(chalk.gray(" "+e));return console.log(),"next"}const P=["Honest answer.","That's a fair guess.","Worth thinking about.","Good instinct.","Reasonable take."],q=["诚实的回答。","是个合理的猜想。","值得想一想。","直觉不错。","想法挺合理。"];async function $(o,e){T(o.title),O([o.question]),console.log(chalk.cyan(" │")),console.log(chalk.cyan(" │ ")+chalk.gray(o.hint)),x();const n=e.startsWith("zh"),t=n?" 你的想法:":" Your take: ";for(;;){const a=await C(chalk.gray(t));if(await A(a))return"next";if(D(a))return"lang_switch";if(await V(a,e,o))continue;if(0===a.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=m(n?q:P);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 B(o,e){return T(o.title),O(o.body),x(),await M(e.startsWith("zh")?" 按回车继续 →":" Press Enter to continue →",{card:o,lang:e})===I?"lang_switch":"next"}const z={default:.1,min:-.5,max:.5},R={default:0,min:-.5,max:.5},F={default:.3,min:0,max:.6},W={default:.5,min:0,max:1};async function N(o,e,n){const t=n.startsWith("zh"),a=`[${e.min} ~ ${e.max}]`,r=t?`(默认 ${e.default})`:`(default ${e.default})`,s=" "+chalk.cyan(o.padEnd(28))+chalk.gray(a.padEnd(14))+chalk.gray(r)+chalk.gray(" ➜ ");for(;;){const o=await C(s);if(await A(o))return null;const n=o.trim();if(""===n)return e.default;const a=Number(n);if(Number.isFinite(a)){if(!(a<e.min||a>e.max))return a;console.log(chalk.yellow(t?` 超出范围,请输入 ${e.min} ~ ${e.max} 之间的数`:` Out of range — try ${e.min} ~ ${e.max}`))}else console.log(chalk.gray(t?" (请输入数字,或直接回车用默认值)":" (type a number, or Enter for default)"))}}async function S(t,a,r,s){const i=`${process.env.ICOA_SERVER_URL?.replace(/\/+$/,"")||"https://practice.icoa2026.au"}/api/ai/vla/41/sim`,{fetchWithCountdown:c}=await import("../lib/countdown.js");try{const g=fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:t,frames:a,narrative:r}),signal:AbortSignal.timeout(6e4)}),d=await c(g);if(!d.ok)return void console.log(chalk.yellow(` Sim service unavailable (HTTP ${d.status}).`));const y=await d.json();if(!y.success||!y.data?.mp4_b64)return void console.log(chalk.yellow(" Renderer returned no video."));l(Date.now());const h=process.env.TMPDIR||"/tmp",u=n(h,`icoa-demo2-${s}-${Date.now()}.mp4`);e(u,Buffer.from(y.data.mp4_b64,"base64")),console.log(),console.log(" "+chalk.bold.green("✓ ")+chalk.gray("Rendered.")),y.data.description&&console.log(" "+chalk.gray("Action: ")+chalk.white(y.data.description));const m="darwin"===process.platform?"open":"win32"===process.platform?"start":"xdg-open";return m?(o(m,[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.")),y.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(){L=!0;const o=s();o&&(b=o.listeners("line").slice(),o.removeAllListeners("line"),o.on("line",o=>{const e=k;k=null,e&&e(o)}))}();try{for(;"lang_switch"===await _(););}finally{!function(){L=!1;const o=s();if(o){o.removeAllListeners("line");for(const e of b)o.on("line",e);b=[],k=null}}()}}async function _(){p=0,w=0,f=Date.now(),v=null;const o=(a().language||"en").toLowerCase(),e=o.startsWith("zh");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(),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 M(chalk.gray(' 按回车开始(或输入 "menu" 离开)...'))===I)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 M(chalk.gray(' Press Enter to begin (or "menu" to leave)...'))===I)return"lang_switch";for(const e of function(o){return o.startsWith("zh")?g:c}(o)){let n;if(n="mcq"===e.kind?await E(e,o):"open"===e.kind?await $(e,o):await B(e,o),"lang_switch"===n)return"lang_switch"}return await async function(o){const e=o.startsWith("zh");console.log(),console.log(chalk.cyan(" ╭─ ")+chalk.bold.white(e?"实践 1 / 2 · 基线 —— 看模型怎么做":"Exercise 1 / 2 · Baseline — watch the model")),console.log(chalk.cyan(" │")),e?(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"'))):(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 M(chalk.gray(e?" 准备好按回车...":" Press Enter when you're ready..."));const n=i();if(n>0)return console.log(),console.log(chalk.yellow(e?` 渲染冷却中 —— 还需等 ${n}s(与 'sim' 命令共享 60 秒安全保护)`:` Render cooldown — ${n}s left (shared 60s safety with the 'sim' command)`)),void console.log();if(!await S(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 t=i();if(t>0){for(console.log(chalk.yellow(e?` 等待 60 秒安全保护倒计时 —— ${t}s · 请耐心等待,结束后会有下一步指引`:` Waiting out the 60s safety cooldown — ${t}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)"));i()>0;){const o=i();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 a=e?"前/后 (x)":"Forward/back (x)",r=e?"左/右 (y)":"Right/left (y)",s=e?"上/下 (z)":"Up/down (z)",l=e?"夹爪闭合 (gripper)":"Gripper close",c=await N(a,z,o);if(null===c)return;const g=await N(r,R,o);if(null===g)return;const d=await N(s,F,o);if(null===d)return;const y=await N(l,W,o);if(null===y)return;console.log(),console.log(chalk.cyan(" ")+chalk.gray(e?"你的动作向量: ":"Your action vector: ")+chalk.white(`xyz=[${c}, ${g}, ${d}]`)+chalk.gray(", ")+chalk.white(`gripper_close=${y}`)),console.log();const h={xyz:[c,g,d],rotation:[0,0,0],gripper_close:y};await S(h,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),function(o){const e=o.startsWith("zh"),n=Math.max(1,Math.round((Date.now()-f)/1e3)),t=`${Math.floor(n/60)}m ${n%60}s`,a=`${p}/${w}`,r=w>0?Math.round(p/w*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(t)),console.log(chalk.bold.yellow(" ║ ")+chalk.gray(e?" 选择题: ":" MCQ: ")+chalk.white(a)+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(" │")),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))}})}