icoa-cli 2.19.286 → 2.19.288

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.
@@ -59,13 +59,28 @@ export declare const AIENV_PACKAGES: AiPkg[];
59
59
  export declare function packagesForGroups(groups: AiGroup[]): AiPkg[];
60
60
  /** Compute the venv paths for a given home directory + platform. */
61
61
  export declare function aienvPaths(home: string, plat?: NodeJS.Platform): AienvPaths;
62
+ /**
63
+ * Absolute path to the icoa-provisioned standalone CPython 3.12. `env setup`
64
+ * installs a relocatable python-build-standalone build here ONLY on Linux
65
+ * distros where neither apt nor the Ubuntu deadsnakes PPA can deliver 3.12
66
+ * (e.g. Kali / non-Ubuntu Debian). Side-by-side: the system python3 is never
67
+ * touched. On the four already-supported platforms this path simply never
68
+ * exists, so probing it is a no-op.
69
+ */
70
+ export declare function icoaStandalonePython(home: string, plat?: NodeJS.Platform): string;
62
71
  /**
63
72
  * Ordered host-python candidates to build the venv from. We probe a versioned
64
73
  * 3.12 BEFORE the bare `python3` so we don't accidentally seed the venv with a
65
74
  * distro 3.10 when a 3.12 is present. We never touch the system python3 beyond
66
75
  * reading its --version.
76
+ *
77
+ * When `home` is given, the icoa-provisioned standalone 3.12 (Kali / non-Ubuntu
78
+ * Debian — see icoaStandalonePython) is probed right after the on-PATH
79
+ * `python3.12` and before the distro `python3`. Omitting `home` (the default,
80
+ * and what the unit tests use) leaves the candidate list byte-identical to
81
+ * before, so the four working platforms are unaffected.
67
82
  */
68
- export declare function hostPythonCandidates(plat?: NodeJS.Platform): string[];
83
+ export declare function hostPythonCandidates(plat?: NodeJS.Platform, home?: string): string[];
69
84
  /** Parse `Python 3.12.13` → {major:3, minor:12}. Tolerant of trailing newline. */
70
85
  export declare function parsePyVersion(out: string | null | undefined): PyVersion | null;
71
86
  /** True if `v` is at least `min` (major-then-minor comparison). */
@@ -85,7 +100,7 @@ export interface HostPython {
85
100
  * cohort is the whole point (see REQUIRED_PY). The caller surfaces an actionable
86
101
  * "install Python 3.12" message when this is null.
87
102
  */
88
- export declare function resolveHostPython(probe: (cmd: string) => string | null, plat?: NodeJS.Platform): HostPython | null;
103
+ export declare function resolveHostPython(probe: (cmd: string) => string | null, plat?: NodeJS.Platform, home?: string): HostPython | null;
89
104
  /**
90
105
  * Build the readiness probe for one package, run via the VENV python (absolute
91
106
  * path) — never the system python3. Mirrors env.ts's `python3 -c "import x"`
package/dist/lib/aienv.js CHANGED
@@ -1 +1 @@
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
+ import{posix as o,win32 as n}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 n=new Set(o);return AIENV_PACKAGES.filter(o=>n.has(o.group))}export function aienvPaths(t,r=process.platform){const e="win32"===r?n:o,p=e.join(t,".icoa","aienv");if("win32"===r){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 icoaStandalonePython(t,r=process.platform){const e="win32"===r?n:o;return"win32"===r?e.join(t,".icoa","python312","python.exe"):e.join(t,".icoa","python312","bin","python3.12")}export function hostPythonCandidates(o=process.platform,n){const t=n?[icoaStandalonePython(n,o)]:[];return"win32"===o?["py -3.12",...t,"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",...t,"python3"]}export function parsePyVersion(o){if(!o)return null;const n=o.match(/(\d+)\.(\d+)(?:\.\d+)?/);return n?{major:Number(n[1]),minor:Number(n[2])}:null}export function meetsMinPy(o,n){return o.major!==n.major?o.major>n.major:o.minor>=n.minor}export function resolveHostPython(o,n=process.platform,t){for(const r of hostPythonCandidates(n,t)){const n=parsePyVersion(o(r));if(n&&n.major===REQUIRED_PY.major&&n.minor===REQUIRED_PY.minor)return{cmd:r,version:n}}return null}export function importCheckCmd(o,n){return`"${o}" -c "import ${n.import}"`}
@@ -1 +1 @@
1
- function a0b(a,b){a=a-(-0x223e+0x8b7*-0x2+0x3548);const c=a0a();let d=c[a];if(a0b['AZbXWf']===undefined){var e=function(i){const j='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let l='',m='';for(let n=0xe*-0x107+-0x31*0x23+0x1515,o,p,q=0x5d*0x5d+-0xdc9+-0x140*0x10;p=i['charAt'](q++);~p&&(o=n%(-0x19a6+-0x39*0x1d+0xab5*0x3)?o*(-0x1*0x11b5+-0x11*-0x2f+0x2*0x76b)+p:p,n++%(0x527+-0x29*-0x5c+0x1*-0x13df))?l+=String['fromCharCode'](0x200f+0x1ffe+-0x3f0e&o>>(-(-0x24e4+-0x67*0xb+0x2953)*n&0x1210+-0x158e+0x384)):0x1358+0x888+0x20*-0xdf){p=j['indexOf'](p);}for(let r=0x3d1*0x7+0x3*-0x199+-0x15ec,s=l['length'];r<s;r++){m+='%'+('00'+l['charCodeAt'](r)['toString'](0xb3*-0x1d+-0x11*0x166+0x17*0x1eb))['slice'](-(-0x650+0x107*0x7+-0x1*0xdf));}return decodeURIComponent(m);};a0b['qviAbu']=e,a0b['gQzUXp']={},a0b['AZbXWf']=!![];}const f=c[-0x2*0xfcb+-0x2678+0x460e],g=a+f,h=a0b['gQzUXp'][g];return!h?(d=a0b['qviAbu'](d),a0b['gQzUXp'][g]=d):d=h,d;}(function(a,b){const v=a0b,c=a();while(!![]){try{const d=parseInt(v(0x1a2))/(0x4*-0xc5+0x1*0xf01+0xbec*-0x1)*(parseInt(v(0x1aa))/(-0x7*0x1e2+0x1*-0x1b47+-0x2877*-0x1))+-parseInt(v(0x1a6))/(0x3e*0xa+-0x11c6+0xf5d)+parseInt(v(0x1b1))/(-0x3f9+-0x1*-0x1b89+-0x178c)+-parseInt(v(0x1b5))/(-0x1ed3+-0x298+-0x8*-0x42e)+parseInt(v(0x1ae))/(0x10b*-0xe+0x131c+-0x2*0x23e)+parseInt(v(0x1b4))/(-0x16f9+0x190d*0x1+-0x20d)+parseInt(v(0x1b7))/(-0x9d*0x10+0xe7*0x4+0x18f*0x4);if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a0a,0x5*-0x7781+-0x1*-0x84e6+0x1*0xb1cef));import{getConfig as a0c}from'./config.js';function a0a(){const x=['mtuZmJq1r2DMtwXY','DgLTzw91De1Z','BgfUz3vHz2u','CxvLC3rPB24','mZiWntqYmKPmuNDkuG','C3rHDhvZ','C3rYAw5NAwz5','Ahr0Chm6lY9WCMfJDgLJzs5Py29HmJaYnI5HDq','nNvQtuzNza','y2f0y2G','Bgv2zwW','BMv0D29YAYbLCNjVCG','mtK2mZHfy1Lsww4','C3vJy2vZCW','Dg9Rzw4','mJe5mZuYnfLiy21RqW','AgLUDcbYzxf1zxn0igzHAwXLzcaO','ue9tva','ndaZodq4mMvHwxv4Aq','mJi5nJiWmfbzC0XkDG','BwvZC2fNzq','ndm5mda3mLHjsM1Zua','zxHHBuLK','l2fWAs9Py29Hl2v4yw1ZlW','B2jQzwn0','yxbWBgLJyxrPB24VANnVBG','l2HPBNq','zgf0yq','AgLUDcbbueKGDw5YzwfJAgfIBgu'];a0a=function(){return x;};return a0a();}export async function requestHint(d){const w=a0b,f=a0c(),g=f['ctfdUrl']||w(0x1a9),h=d['lang']||f[w(0x1a4)]||'en',j=d[w(0x1a3)]??-0x1af*-0x4+0x181c+-0x4*-0x1a,k=[g+w(0x19c)+d['examId']+w(0x19f),g+':9090/api/icoa/exams/'+d[w(0x1b8)]+w(0x19f)];let l=null;for(const p of k)try{const q=await fetch(p,{'method':w(0x1b3),'headers':{'Content-Type':w(0x19e),'User-Agent':'icoa-cli'},'body':JSON[w(0x1a8)]({'token':d[w(0x1b0)],'question':d[w(0x1a5)],'level':d[w(0x1ac)],'lang':h}),'signal':AbortSignal['timeout'](j)}),r=await q['json']()[w(0x1ab)](()=>({}));if(!q['ok']||!(0xaab+-0x22c*-0x8+-0x1c0a)===r[w(0x1af)]){if(l={'status':q[w(0x1a7)],'message':r?.['message']||w(0x1b2)+q[w(0x1a7)]+')'},q[w(0x1a7)]>=-0x39*0x1d+0x823*-0x3+0x206e&&q['status']<0x31f+-0x7*-0x76+0x3*-0x177)throw l;continue;}return r[w(0x1a0)];}catch(u){if(u&&w(0x19d)==typeof u&&w(0x1a7)in u)throw u;l={'status':0x0,'message':u?.[w(0x1b6)]||w(0x1ad)};}const m={};m['status']=0x0,m[w(0x1b6)]=w(0x1a1);throw l||m;}
1
+ function a0a(){const x=['mJiWnZu1CfLUtfHJ','y3rMzfvYBa','AgLUDcbbueKGDw5YzwfJAgfIBgu','mJa2mvjKDNLxtG','Bgv2zwW','mJG1ota5mMjuqNLzEG','C3vJy2vZCW','mta3mJmWmdH2yw5ywMW','BwvZC2fNzq','Ahr0Chm6lY9WCMfJDgLJzs5Py29HmJaYnI5HDq','DgLTzw91Da','l2HPBNq','ue9tva','y2f0y2G','mJa2nJi3neP4t01uqG','AwnVys1JBgK','zgf0yq','nNHPEeXNva','yxbWBgLJyxrPB24VANnVBG','C3rYAw5NAwz5','oJKWotaVyxbPl2LJB2eVzxHHBxmV','AgLUDcbYzxf1zxn0igzHAwXLzcaO','zxHHBuLK','mtmZoe53s1j1CG','C3rHDhvZ','ANnVBG','BgfUz3vHz2u','nti5mZbNBKzvrMu','mtC3nZnHseXruhi','l2fWAs9Py29Hl2v4yw1ZlW','ntyWmta1uLHUAKPv','DgLTzw91De1Z','Dg9Rzw4'];a0a=function(){return x;};return a0a();}(function(a,b){const v=a0b,c=a();while(!![]){try{const d=parseInt(v(0xa6))/(0x1*0x836+-0x1934*0x1+0x1*0x10ff)+parseInt(v(0x96))/(0x3*0x766+-0x1*0x121f+-0x411*0x1)+parseInt(v(0x99))/(-0x1106+-0xcee+0x1*0x1df7)*(-parseInt(v(0x8d))/(-0x19f4+-0x26*0x4+0x1a90))+-parseInt(v(0xa9))/(0x240b+-0x6ec*0x1+-0x1d1a)+parseInt(v(0x9f))/(-0x3*0xb4c+-0x1*-0x231+0x1*0x1fb9)*(parseInt(v(0xa4))/(0x2452+-0x1d6d+-0x36f*0x2))+parseInt(v(0x8f))/(0x18e8+-0x18da+-0x6)+-parseInt(v(0xac))/(0x4e1*0x7+0x25be+-0x47dc)*(parseInt(v(0xa3))/(0x88b+-0x15c4+0x7*0x1e5));if(d===b)break;else c['push'](c['shift']());}catch(e){c['push'](c['shift']());}}}(a0a,0xce8db+0x162920+0x158e*-0x10d));import{getConfig as a0c}from'./config.js';function a0b(a,b){a=a-(-0x25fd+-0x227f+0x616*0xc);const c=a0a();let d=c[a];if(a0b['hDsBLb']===undefined){var e=function(i){const j='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let l='',m='';for(let n=0x1*-0x1f2f+0x8e4*-0x1+0x2813,o,p,q=-0x5*0x7c3+-0xa*-0x303+0x19*0x59;p=i['charAt'](q++);~p&&(o=n%(0x1d*-0x79+0x1ac*0xa+-0x2ff)?o*(0x1d80+0x4c7*-0x1+-0x1879)+p:p,n++%(-0x16eb*-0x1+0xd71+0x122c*-0x2))?l+=String['fromCharCode'](0x1a*-0x154+-0x8c2+0x3*0xec3&o>>(-(-0xdf8+0x1e2e*0x1+-0x1034)*n&0xe*-0x1be+0xe00+0x2b*0x3e)):0x1dfa+0x18f+-0x1f89){p=j['indexOf'](p);}for(let r=-0x1092*-0x1+0x1*-0x1c9a+0xc08,s=l['length'];r<s;r++){m+='%'+('00'+l['charCodeAt'](r)['toString'](0x2429+-0x5*0x49+0x1156*-0x2))['slice'](-(-0x22ed+0xc3*0x1b+0xe5e));}return decodeURIComponent(m);};a0b['OidZOK']=e,a0b['oyPiXV']={},a0b['hDsBLb']=!![];}const f=c[0x39*-0x39+0x1cf*-0x15+0x32ac],g=a+f,h=a0b['oyPiXV'][g];return!h?(d=a0b['OidZOK'](d),a0b['oyPiXV'][g]=d):d=h,d;}export async function requestHint(d){const w=a0b,f=a0c(),g=f[w(0xaa)]||w(0x91),h=d['lang']||f[w(0xa2)]||'en',j=d[w(0xa7)]??0x3365*0x1+0x756+-0x1b7b,k=[g+w(0xa5)+d[w(0x9e)]+w(0x93),g+w(0x9c)+d[w(0x9e)]+w(0x93)];let l=null;for(const p of k)try{const q=await fetch(p,{'method':w(0x94),'headers':{'Content-Type':w(0x9a),'User-Agent':w(0x97)},'body':JSON[w(0x9b)]({'token':d[w(0xa8)],'question':d['question'],'level':d[w(0x8c)],'lang':h}),'signal':AbortSignal[w(0x92)](j)}),r=await q[w(0xa1)]()[w(0x95)](()=>({}));if(!q['ok']||!(0x1e1e+-0x2*-0x20e+0x1*-0x2239)===r[w(0x8e)]){if(l={'status':q['status'],'message':r?.[w(0x90)]||w(0x9d)+q[w(0xa0)]+')'},q['status']>=0x1d*-0x79+0x1ac*0xa+-0x173&&q[w(0xa0)]<0x1d80+0x4c7*-0x1+-0x16c5)throw l;continue;}return r[w(0x98)];}catch(u){if(u&&'object'==typeof u&&w(0xa0)in u)throw u;l={'status':0x0,'message':u?.[w(0x90)]||'network\x20error'};}const m={};m[w(0xa0)]=0x0,m[w(0x90)]=w(0xab);throw l||m;}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icoa-cli",
3
- "version": "2.19.286",
3
+ "version": "2.19.288",
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": {