icoa-cli 2.19.711 → 2.19.712
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/lib/boot-entry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{spawnSync as
|
|
1
|
+
import{spawnSync as t}from"node:child_process";import{ENTRIES as e,loadSite as n,readEntryChoice as r,recommend as o,setEntry as s}from"./site.js";function i(t,e){const n=[...e].sort((t,e)=>t-e);return{key:t,ms:n.length?n[Math.floor(n.length/2)]:null,ok:n.length}}export function shouldAutoCheck(t){if("0"===t.env.ICOA_ENTRY_AUTO)return!1;if(!t.tty)return!1;if("user"===t.by||t.venue)return!1;if(t.env.ICOA_LEARN_SERVER?.trim()||t.env.ICOA_EXAM_SERVER?.trim())return!1;const e=t.argv.slice(2);return!e.some(t=>"--version"===t||"-V"===t||"--help"===t||"-h"===t)&&"entry"!==e[0]&&t.now-t.at>864e5}!function(){try{const a=r();if(!shouldAutoCheck({argv:process.argv,env:process.env,tty:!!process.stdout.isTTY,by:a.by,at:a.at,venue:n().ok,now:Date.now()}))return;const c=t(process.execPath,["-e","\nconst [d, r, cap] = [process.argv[1], process.argv[2], Number(process.argv[3])];\nconst end = Date.now() + cap;\nconst one = async (b) => { const t = Date.now(); const left = end - t; if (left < 50) return null; try {\n const x = await fetch(b + '/api/icoa/server-time?t=' + t + Math.random(), { signal: AbortSignal.timeout(left) });\n await x.arrayBuffer(); return x.ok ? Date.now() - t : null; } catch { return null; } };\nconst door = async (b) => { const got = []; if ((await one(b)) === null) return got;\n for (let i = 0; i < 3; i++) { const v = await one(b); if (v !== null) got.push(v); } return got; };\nPromise.all([door(d), door(r)]).then(([a, b]) => { console.log(JSON.stringify({ direct: a, relay: b })); process.exit(0); });\n",e.direct.base,e.relay.base,String(2500)],{encoding:"utf8",timeout:4e3,stdio:["ignore","pipe","ignore"]}),u=JSON.parse((c.stdout||"").trim()||"{}"),l=i("direct",u.direct??[]),f=i("relay",u.relay??[]);if(null===l.ms&&null===f.ms)return;s(o(l,f,a.entry),"auto")}catch{}}();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "icoa-cli",
|
|
3
|
-
"version": "2.19.
|
|
3
|
+
"version": "2.19.712",
|
|
4
4
|
"description": "ICOA CLI — AI-native competition runtime of the International Cyber Olympiad in AI: learn, practise, and compete in AI & cybersecurity from the terminal (AI4CTF · CTF4AI · CTF4EAI)",
|
|
5
5
|
"author": "Charlie Zhu",
|
|
6
6
|
"type": "module",
|