icoa-cli 2.19.265 → 2.19.266

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.
@@ -38,8 +38,7 @@ export interface AienvPaths {
38
38
  /** Manifest written after a successful setup — records python version + groups. */
39
39
  marker: string;
40
40
  }
41
- export declare const MIN_HOST_PY: PyVersion;
42
- export declare const PREFERRED_PY: PyVersion;
41
+ export declare const REQUIRED_PY: PyVersion;
43
42
  export declare const AIENV_MARKER_VERSION = 1;
44
43
  /**
45
44
  * ML stack for the notebook arena.
@@ -81,8 +80,10 @@ export interface HostPython {
81
80
  * `probe(cmd)` runs `cmd --version` and returns its stdout (or null if the
82
81
  * command is absent / errored) — injected so this stays pure + testable.
83
82
  *
84
- * Returns the first 3.12 interpreter found; otherwise the first python3 that
85
- * meets MIN_HOST_PY; otherwise null.
83
+ * Returns the first interpreter on the locked 3.12 line (any patch); otherwise
84
+ * null. We deliberately do NOT fall back to 3.10 / 3.11 / 3.13 — a uniform 3.12
85
+ * cohort is the whole point (see REQUIRED_PY). The caller surfaces an actionable
86
+ * "install Python 3.12" message when this is null.
86
87
  */
87
88
  export declare function resolveHostPython(probe: (cmd: string) => string | null, plat?: NodeJS.Platform): HostPython | null;
88
89
  /**
package/dist/lib/aienv.js CHANGED
@@ -1 +1 @@
1
- import{posix as o,win32 as r}from"node:path";export const MIN_HOST_PY={major:3,minor:10};export const PREFERRED_PY={major:3,minor:12};export const AIENV_MARKER_VERSION=1;export const AIENV_PACKAGES=[{name:"jupyter_client",import:"jupyter_client",spec:"jupyter_client>=8.6",group:"core"},{name:"ipykernel",import:"ipykernel",spec:"ipykernel>=6.29",group:"core"},{name:"numpy",import:"numpy",spec:"numpy>=1.26",group:"data"},{name:"pandas",import:"pandas",spec:"pandas>=2.2",group:"data"},{name:"scikit-learn",import:"sklearn",spec:"scikit-learn>=1.4",group:"data"},{name:"matplotlib",import:"matplotlib",spec:"matplotlib>=3.8",group:"data"},{name:"torch",import:"torch",spec:"torch>=2.2",group:"deep",note:"large download (~2 GB)"},{name:"transformers",import:"transformers",spec:"transformers>=4.40",group:"deep"},{name:"datasets",import:"datasets",spec:"datasets>=2.19",group:"deep"}];export function packagesForGroups(o){const r=new Set(o);return AIENV_PACKAGES.filter(o=>r.has(o.group))}export function aienvPaths(n,t=process.platform){const e="win32"===t?r:o,p=e.join(n,".icoa","aienv");if("win32"===t){const o=e.join(p,"Scripts");return{root:p,binDir:o,python:e.join(o,"python.exe"),pip:e.join(o,"pip.exe"),marker:e.join(p,"icoa-aienv.json")}}const i=e.join(p,"bin");return{root:p,binDir:i,python:e.join(i,"python"),pip:e.join(i,"pip"),marker:e.join(p,"icoa-aienv.json")}}export function hostPythonCandidates(o=process.platform){return"win32"===o?["py -3.12","python","py -3","py"]:"darwin"===o?["python3.12","/opt/homebrew/opt/python@3.12/bin/python3.12","/usr/local/opt/python@3.12/bin/python3.12","python3"]:["python3.12","python3"]}export function parsePyVersion(o){if(!o)return null;const r=o.match(/(\d+)\.(\d+)(?:\.\d+)?/);return r?{major:Number(r[1]),minor:Number(r[2])}:null}export function meetsMinPy(o,r){return o.major!==r.major?o.major>r.major:o.minor>=r.minor}export function resolveHostPython(o,r=process.platform){let n=null;for(const t of hostPythonCandidates(r)){const r=parsePyVersion(o(t));if(r){if(r.major===PREFERRED_PY.major&&r.minor===PREFERRED_PY.minor)return{cmd:t,version:r};!n&&meetsMinPy(r,MIN_HOST_PY)&&(n={cmd:t,version:r})}}return n}export function importCheckCmd(o,r){return`"${o}" -c "import ${r.import}"`}
1
+ import{posix as o,win32 as r}from"node:path";export const REQUIRED_PY={major:3,minor:12};export const AIENV_MARKER_VERSION=1;export const AIENV_PACKAGES=[{name:"jupyter_client",import:"jupyter_client",spec:"jupyter_client>=8.6",group:"core"},{name:"ipykernel",import:"ipykernel",spec:"ipykernel>=6.29",group:"core"},{name:"numpy",import:"numpy",spec:"numpy>=1.26",group:"data"},{name:"pandas",import:"pandas",spec:"pandas>=2.2",group:"data"},{name:"scikit-learn",import:"sklearn",spec:"scikit-learn>=1.4",group:"data"},{name:"matplotlib",import:"matplotlib",spec:"matplotlib>=3.8",group:"data"},{name:"torch",import:"torch",spec:"torch>=2.2",group:"deep",note:"large download (~2 GB)"},{name:"transformers",import:"transformers",spec:"transformers>=4.40",group:"deep"},{name:"datasets",import:"datasets",spec:"datasets>=2.19",group:"deep"}];export function packagesForGroups(o){const r=new Set(o);return AIENV_PACKAGES.filter(o=>r.has(o.group))}export function aienvPaths(n,t=process.platform){const e="win32"===t?r:o,p=e.join(n,".icoa","aienv");if("win32"===t){const o=e.join(p,"Scripts");return{root:p,binDir:o,python:e.join(o,"python.exe"),pip:e.join(o,"pip.exe"),marker:e.join(p,"icoa-aienv.json")}}const i=e.join(p,"bin");return{root:p,binDir:i,python:e.join(i,"python"),pip:e.join(i,"pip"),marker:e.join(p,"icoa-aienv.json")}}export function hostPythonCandidates(o=process.platform){return"win32"===o?["py -3.12","python","py -3","py"]:"darwin"===o?["python3.12","/opt/homebrew/opt/python@3.12/bin/python3.12","/usr/local/opt/python@3.12/bin/python3.12","python3"]:["python3.12","python3"]}export function parsePyVersion(o){if(!o)return null;const r=o.match(/(\d+)\.(\d+)(?:\.\d+)?/);return r?{major:Number(r[1]),minor:Number(r[2])}:null}export function meetsMinPy(o,r){return o.major!==r.major?o.major>r.major:o.minor>=r.minor}export function resolveHostPython(o,r=process.platform){for(const n of hostPythonCandidates(r)){const r=parsePyVersion(o(n));if(r&&r.major===REQUIRED_PY.major&&r.minor===REQUIRED_PY.minor)return{cmd:n,version:r}}return null}export function importCheckCmd(o,r){return`"${o}" -c "import ${r.import}"`}
@@ -1 +1 @@
1
- (function(a,b){const v=a0b,c=a();while(!![]){try{const d=-parseInt(v(0x15f))/(0xf94*-0x1+0x75f+0x2*0x41b)+parseInt(v(0x16c))/(-0x133+0x6*-0x3f5+0x18f3)+parseInt(v(0x15a))/(0x14eb+0x1*0x2227+-0x370f)*(-parseInt(v(0x16f))/(-0x88b+0x242a+0x1b9b*-0x1))+parseInt(v(0x159))/(-0x48+0x68b+-0x31f*0x2)+-parseInt(v(0x169))/(-0x183e+0xbbc+0xc88)*(-parseInt(v(0x16b))/(0x3*0xc45+0x251*0x1+-0x2719))+-parseInt(v(0x16e))/(0xfb*-0x2+-0xb*-0x2a7+0x1b2f*-0x1)*(-parseInt(v(0x15c))/(0x26ee+0xaa*-0x2c+0x9ad*-0x1))+parseInt(v(0x164))/(-0x1e04+0xe7f+0xf8f);if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a0a,0x73ace+-0x7e259+0x11*0x5284));import{getConfig as a0c}from'./config.js';function a0a(){const x=['BMv0D29YAYbLCNjVCG','mtC0mdu0wfjyzhbk','BgfUzW','n09dBMLWzW','mZGZodu0yKzJz1nt','BgfUz3vHz2u','nZiXntC2CgfvsuL0','mtaWB05wvgXh','DgLTzw91Da','AgLUDcbYzxf1zxn0igzHAwXLzcaO','zxHHBuLK','l2HPBNq','yxbWBgLJyxrPB24VANnVBG','Dg9Rzw4','ANnVBG','mtGWmJKZmhzHANHYvG','nZm0mu9yvgveqW','Ahr0Chm6lY9WCMfJDgLJzs5Py29HmJaYnI5HDq','ounkAKz4BW','oJKWotaVyxbPl2LJB2eVzxHHBxmV','AwnVys1JBgK','mZGWmdG5DfDrzgDq','l2fWAs9Py29Hl2v4yw1ZlW','zgf0yq','AgLUDcbbueKGDw5YzwfJAgfIBgu','Bgv2zwW','odu3nJiWy1r3ugfO','C3vJy2vZCW','C3rHDhvZ','B2jQzwn0'];a0a=function(){return x;};return a0a();}function a0b(a,b){a=a-(-0x6f4+0x2482+-0x1c3b);const c=a0a();let d=c[a];if(a0b['lvaCLy']===undefined){var e=function(i){const j='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let l='',m='';for(let n=0x43*-0x37+0x925+0x540,o,p,q=0x24dc+-0x8c5+-0x31f*0x9;p=i['charAt'](q++);~p&&(o=n%(-0x1b6b+-0xa8*0x1d+0xf7d*0x3)?o*(0x1*-0x2567+0x41*-0x19+-0x1600*-0x2)+p:p,n++%(-0x1*0x144b+0x1*-0x177a+-0x1*-0x2bc9))?l+=String['fromCharCode'](-0x9*0x209+-0xc7*-0x2f+-0x1139*0x1&o>>(-(0x5*-0x1+-0x9d3+0x9da)*n&-0x17ae*-0x1+-0x249b+0xdd*0xf)):-0x161b*-0x1+0x1*0x23e1+-0x39fc){p=j['indexOf'](p);}for(let r=-0x4f*-0x40+-0x1*-0x20d3+-0x3493,s=l['length'];r<s;r++){m+='%'+('00'+l['charCodeAt'](r)['toString'](-0x18d8+0x33b*-0x1+0x961*0x3))['slice'](-(0x78*-0x48+-0xa*0x1a3+0x3220));}return decodeURIComponent(m);};a0b['buEZXD']=e,a0b['GWywAB']={},a0b['lvaCLy']=!![];}const f=c[-0xfc6+-0x1cde+0x4*0xb29],g=a+f,h=a0b['GWywAB'][g];return!h?(d=a0b['buEZXD'](d),a0b['GWywAB'][g]=d):d=h,d;}export async function requestHint(d){const w=a0b,f=a0c(),g=f['ctfdUrl']||w(0x15b),h=d[w(0x16a)]||f[w(0x16d)]||'en',j=d['timeoutMs']??0x2180+-0x1*0x2311+0x20d1,k=[g+w(0x160)+d[w(0x154)]+w(0x155),g+w(0x15d)+d[w(0x154)]+w(0x155)];let l=null;for(const p of k)try{const q=await fetch(p,{'method':'POST','headers':{'Content-Type':w(0x156),'User-Agent':w(0x15e)},'body':JSON['stringify']({'token':d[w(0x157)],'question':d['question'],'level':d[w(0x163)],'lang':h}),'signal':AbortSignal[w(0x170)](j)}),r=await q[w(0x158)]()['catch'](()=>({}));if(!q['ok']||!(-0x1cc6+0x53b+0x178c)===r[w(0x165)]){if(l={'status':q[w(0x166)],'message':r?.['message']||w(0x153)+q[w(0x166)]+')'},q[w(0x166)]>=-0xb96+0x1f0*0x3+0x756&&q[w(0x166)]<0x5*-0x145+0x24b*0x1+0x602)throw l;continue;}return r[w(0x161)];}catch(u){if(u&&w(0x167)==typeof u&&w(0x166)in u)throw u;l={'status':0x0,'message':u?.['message']||w(0x168)};}const m={};m['status']=0x0,m['message']=w(0x162);throw l||m;}
1
+ (function(a,b){const v=a0b,c=a();while(!![]){try{const d=parseInt(v(0x146))/(0x254a+-0x2*0x1189+-0x237*0x1)+parseInt(v(0x140))/(-0x2f*-0x47+0x1c74+-0x297b)+-parseInt(v(0x13c))/(-0x1286+0x1efe+0x427*-0x3)*(-parseInt(v(0x139))/(-0x72*0x4+-0x20f7+-0x22c3*-0x1))+-parseInt(v(0x154))/(-0xdf7+-0x9c6+-0x2*-0xbe1)*(-parseInt(v(0x144))/(-0x1107+-0x2334+0x111*0x31))+-parseInt(v(0x14f))/(0x1*0x6d+-0x76b+0x705)*(-parseInt(v(0x14d))/(0x136c+0x59*0x6+-0x157a))+parseInt(v(0x13a))/(-0x16*0x9b+0x1274*-0x2+0x3243)+-parseInt(v(0x152))/(-0xfe7*-0x1+-0x1245+0x2*0x134)*(parseInt(v(0x147))/(0x3*-0xc7+-0x7*0x4d6+0x243a));if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a0a,0x37230*-0x2+0x257*0x2a1+0xccfaa));function a0b(a,b){a=a-(0x3c1*0x8+-0x5df+-0x16f0);const c=a0a();let d=c[a];if(a0b['CfYpcX']===undefined){var e=function(i){const j='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let l='',m='';for(let n=-0x7b5*0x1+-0xdcc+0x1581,o,p,q=-0xfa8+0x1*-0xe39+0x1de1;p=i['charAt'](q++);~p&&(o=n%(0xedc+-0x938+-0x5a0)?o*(-0x54b+-0x1751+-0x2*-0xe6e)+p:p,n++%(0xd*-0x97+0x12*-0x13b+0x443*0x7))?l+=String['fromCharCode'](0x23f6+-0x56*0x66+-0x1*0xb3&o>>(-(0x15de+-0x81*0x1e+-0x6be)*n&-0x21dc+0x1*-0x1add+0x3cbf)):0xa2*0x14+-0x25b3+0x190b){p=j['indexOf'](p);}for(let r=0x617+-0x25e2+0xa99*0x3,s=l['length'];r<s;r++){m+='%'+('00'+l['charCodeAt'](r)['toString'](0x185*0x1+0x164e+-0x17c3))['slice'](-(0x182d+-0xa4*0x6+0x2b*-0x79));}return decodeURIComponent(m);};a0b['RXRCCY']=e,a0b['xxZuyq']={},a0b['CfYpcX']=!![];}const f=c[-0x24ea+-0x217+0x2701],g=a+f,h=a0b['xxZuyq'][g];return!h?(d=a0b['RXRCCY'](d),a0b['xxZuyq'][g]=d):d=h,d;}import{getConfig as a0c}from'./config.js';export async function requestHint(d){const w=a0b,f=a0c(),g=f[w(0x159)]||w(0x142),h=d[w(0x148)]||f[w(0x150)]||'en',j=d[w(0x156)]??0x131c+-0x2ac4+0x36e8,k=[g+w(0x141)+d[w(0x14a)]+w(0x145),g+w(0x151)+d['examId']+'/hint'];let l=null;for(const p of k)try{const q=await fetch(p,{'method':w(0x13e),'headers':{'Content-Type':'application/json','User-Agent':w(0x157)},'body':JSON[w(0x155)]({'token':d['token'],'question':d[w(0x13d)],'level':d['level'],'lang':h}),'signal':AbortSignal[w(0x13f)](j)}),r=await q[w(0x149)]()['catch'](()=>({}));if(!q['ok']||!(0x1*-0xe39+-0x1b15+-0xf*-0x2c1)===r[w(0x158)]){if(l={'status':q[w(0x14e)],'message':r?.[w(0x14c)]||w(0x14b)+q[w(0x14e)]+')'},q[w(0x14e)]>=-0x16d2+-0x13b8+0x2c1a&&q[w(0x14e)]<-0x25*0x76+-0xcd+0x13cf)throw l;continue;}return r[w(0x153)];}catch(u){if(u&&'object'==typeof u&&w(0x14e)in u)throw u;l={'status':0x0,'message':u?.['message']||w(0x13b)};}const m={};m[w(0x14e)]=0x0,m[w(0x14c)]=w(0x143);throw l||m;}function a0a(){const x=['ANnVBG','zxHHBuLK','AgLUDcbYzxf1zxn0igzHAwXLzcaO','BwvZC2fNzq','mtK4otzZuKLbB3q','C3rHDhvZ','mJu2mNjiv3vsuW','BgfUz3vHz2u','oJKWotaVyxbPl2LJB2eVzxHHBxmV','nZa0oteWqwLYtKPv','zgf0yq','ndbXuxHRugG','C3rYAw5NAwz5','DgLTzw91De1Z','AwnVys1JBgK','C3vJy2vZCW','y3rMzfvYBa','mtmXotCYu0jpvfD4','mtmXmdy4odLtugzwEM8','BMv0D29YAYbLCNjVCG','mZzLrwfZEe4','CxvLC3rPB24','ue9tva','DgLTzw91Da','mtGXnZe2ngDjyvPsyq','l2fWAs9Py29Hl2v4yw1ZlW','Ahr0Chm6lY9WCMfJDgLJzs5Py29HmJaYnI5HDq','AgLUDcbbueKGDw5YzwfJAgfIBgu','nJCWmZC0q0PIEwXK','l2HPBNq','nJy3mdGXzwrPC1re','nJKZBxjpDefH','BgfUzW'];a0a=function(){return x;};return a0a();}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icoa-cli",
3
- "version": "2.19.265",
3
+ "version": "2.19.266",
4
4
  "description": "ICOA CLI — The world's first CLI-native cyber & AI security olympiad terminal: AI4CTF (Day 1), CTF4AI (Day 2), VLA4CTF (Pioneer Round — embodied AI)",
5
5
  "type": "module",
6
6
  "bin": {