icoa-cli 2.19.264 → 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.
- package/dist/commands/ai4ctf.js +1 -1
- package/dist/commands/aienv.js +1 -1
- package/dist/commands/arena.js +1 -1
- package/dist/commands/ctf4ai-demo.js +1 -1
- package/dist/commands/ctf4vla.js +1 -1
- package/dist/commands/demo2.js +1 -1
- package/dist/commands/exam.js +1 -1
- package/dist/lib/aienv.d.ts +5 -4
- package/dist/lib/aienv.js +1 -1
- package/dist/lib/arena-submit.d.ts +23 -0
- package/dist/lib/arena-submit.js +1 -0
- package/dist/lib/hint-client.js +1 -1
- package/package.json +1 -1
package/dist/lib/aienv.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
85
|
-
*
|
|
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
|
|
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}"`}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* arena-submit — pure builder for an arena submission payload (Phase 3 of the
|
|
3
|
+
* CLI notebook arena). The all-in-CLI loop: a student computes in `icoa ipynb`,
|
|
4
|
+
* saves a local predictions.csv, and submits it here.
|
|
5
|
+
*
|
|
6
|
+
* If the input is a path that exists on disk, we send its CONTENT inline
|
|
7
|
+
* (`predictions_csv`) — this is what makes local submission work against a
|
|
8
|
+
* REMOTE server (prod can't read the student's disk, so a bare path is useless;
|
|
9
|
+
* the legacy Google-Drive link existed only to get the file TO the server).
|
|
10
|
+
* Otherwise we fall back to the Drive link (`gdrive_url`). Kept pure (fs deps
|
|
11
|
+
* injected) so the routing decision is unit-tested.
|
|
12
|
+
*/
|
|
13
|
+
export interface SubmitPayload {
|
|
14
|
+
arena_token: string;
|
|
15
|
+
predictions_csv?: string;
|
|
16
|
+
gdrive_url?: string;
|
|
17
|
+
source: 'local' | 'gdrive';
|
|
18
|
+
}
|
|
19
|
+
export interface SubmitFsDeps {
|
|
20
|
+
exists: (path: string) => boolean;
|
|
21
|
+
read: (path: string) => string;
|
|
22
|
+
}
|
|
23
|
+
export declare function buildSubmitPayload(input: string, arenaToken: string, deps: SubmitFsDeps): SubmitPayload;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function buildSubmitPayload(e,r,t){let i=e.trim();return i.startsWith("file://")&&(i=i.slice(7)),i&&t.exists(i)?{arena_token:r,predictions_csv:t.read(i),source:"local"}:{arena_token:r,gdrive_url:e.trim(),source:"gdrive"}}
|
package/dist/lib/hint-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
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.
|
|
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": {
|