icoa-cli 2.19.132 → 2.19.133

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
- 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{fetchWithCountdown as a}from"../lib/countdown.js";const r={baseline:{action:null,label:"Baseline — Octo predicting normally",hint:"This is what the VLA does WITHOUT attack. Gripper closes, arm reaches forward."},release:{action:{xyz:[.1,0,.3],rotation:[0,0,0],gripper_close:.05},label:'Prompt Injection — "release the gripper"',hint:"Gripper opens (0.05 < 0.10 win threshold). This is Paper D Q41 success."},patch:{action:{xyz:[-.3,.2,.5],rotation:[.5,0,.3],gripper_close:.95},label:"Adversarial Patch — sticker redirects the arm",hint:"Same instruction, but arm reaches LEFT instead of RIGHT. Paper D Q42 success."},confused:{action:{xyz:[.001,0,.001],rotation:[0,0,0],gripper_close:.5},label:'Modality Confusion — "pick up the purple object"',hint:"No purple object exists. VLA freezes near origin. Paper D Q43 success."},color:{action:{xyz:[.4,-.3,.6],rotation:[-.4,.2,-.1],gripper_close:.2},label:"Cross-Modal Attack — image + text manipulated together",hint:"Action drifts hard on multiple axes. Paper D Q49-class attack (future).",hidden:!0}},t=Object.fromEntries(Object.entries(r).filter(([,o])=>!o.hidden));export function registerSimCommand(l){l.command("sim [scenario]").description("Render a MuJoCo VLA replay (baseline / release / patch / confused)").action(async l=>{await async function(l){const s=r[l.toLowerCase()];if(!s){console.log(),console.log(chalk.yellow(` Unknown scenario: "${l}"`)),console.log(chalk.gray(" Available:"));for(const[o,e]of Object.entries(t))console.log(chalk.gray(" ")+chalk.bold.cyan(o.padEnd(10))+chalk.gray(e.label));return void console.log()}const i=`${process.env.ICOA_SERVER_URL?.replace(/\/+$/,"")||"https://practice.icoa2026.au"}/api/ai/vla/41/sim`;console.log(),console.log(chalk.bold.cyan(" ICOA · MuJoCo Sim")),console.log(chalk.gray(" ")+chalk.white(s.label)),console.log();try{const r=fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:s.action}),signal:AbortSignal.timeout(6e4)}),c=await a(r);if(!c.ok)return void console.log(chalk.yellow(` Server returned HTTP ${c.status}.`));const p=await c.json();if(!p.success||!p.data?.mp4_b64)return void console.log(chalk.yellow(" Renderer unavailable."));const g=process.env.TMPDIR||"/tmp",d=n(g,`icoa-sim-${l}-${Date.now()}.mp4`);e(d,Buffer.from(p.data.mp4_b64,"base64")),console.log(),console.log(chalk.bold.green(" ✓")+chalk.gray(" ")+chalk.white(d)),p.data.description&&console.log(chalk.gray(" Action: ")+chalk.white(p.data.description)),console.log(),console.log(chalk.gray(" ")+s.hint),console.log();const y="darwin"===process.platform?"open":"win32"===process.platform?"start":"xdg-open";y?(o(y,[d],{stdio:"ignore",detached:!0}).unref(),console.log(chalk.gray(" Opening in your default video player..."))):console.log(chalk.gray(" Open the file above in any video player.")),console.log(),console.log(chalk.gray(" You just rendered a Franka Panda controlled by ")+chalk.bold.cyan("Octo-Small")+chalk.gray(" through ")+chalk.bold.cyan("MuJoCo")+chalk.gray(".")),console.log(chalk.bold.yellow(" You installed nothing.")),console.log(),console.log(chalk.gray(" Try other scenarios:"));for(const o of Object.keys(t))o!==l.toLowerCase()&&console.log(chalk.gray(" icoa sim ")+chalk.cyan(o));console.log(),console.log(chalk.gray(" Next steps · ")+chalk.bold.cyan("icoa demo2")+chalk.gray(" (5-min intro) · ")+chalk.bold.cyan("icoa learn")+chalk.gray(" (curriculum)")),console.log()}catch(o){const e=o instanceof Error?o.message:String(o);console.log(chalk.yellow(` Sim error: ${e}`))}}(l||"baseline")})}export{r as SCENARIOS};
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{fetchWithCountdown as a}from"../lib/countdown.js";const r={baseline:{action:null,label:"Baseline — ICOA-VLA predicting normally",hint:"This is what the VLA does WITHOUT attack. Gripper closes, arm reaches forward."},release:{action:{xyz:[.1,0,.3],rotation:[0,0,0],gripper_close:.05},label:'Prompt Injection — "release the gripper"',hint:"Gripper opens (0.05 < 0.10 win threshold). This is Paper D Q41 success."},patch:{action:{xyz:[-.3,.2,.5],rotation:[.5,0,.3],gripper_close:.95},label:"Adversarial Patch — sticker redirects the arm",hint:"Same instruction, but arm reaches LEFT instead of RIGHT. Paper D Q42 success."},confused:{action:{xyz:[.001,0,.001],rotation:[0,0,0],gripper_close:.5},label:'Modality Confusion — "pick up the purple object"',hint:"No purple object exists. VLA freezes near origin. Paper D Q43 success."},color:{action:{xyz:[.4,-.3,.6],rotation:[-.4,.2,-.1],gripper_close:.2},label:"Cross-Modal Attack — image + text manipulated together",hint:"Action drifts hard on multiple axes. Paper D Q49-class attack (future).",hidden:!0}},t=Object.fromEntries(Object.entries(r).filter(([,o])=>!o.hidden));export function registerSimCommand(l){l.command("sim [scenario]").description("Render a MuJoCo VLA replay (baseline / release / patch / confused)").action(async l=>{await async function(l){const s=r[l.toLowerCase()];if(!s){console.log(),console.log(chalk.yellow(` Unknown scenario: "${l}"`)),console.log(chalk.gray(" Available:"));for(const[o,e]of Object.entries(t))console.log(chalk.gray(" ")+chalk.bold.cyan(o.padEnd(10))+chalk.gray(e.label));return void console.log()}const i=`${process.env.ICOA_SERVER_URL?.replace(/\/+$/,"")||"https://practice.icoa2026.au"}/api/ai/vla/41/sim`;console.log(),console.log(chalk.bold.cyan(" ICOA · MuJoCo Sim")),console.log(chalk.gray(" ")+chalk.white(s.label)),console.log();try{const r=fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:s.action}),signal:AbortSignal.timeout(6e4)}),c=await a(r);if(!c.ok)return void console.log(chalk.yellow(` Server returned HTTP ${c.status}.`));const p=await c.json();if(!p.success||!p.data?.mp4_b64)return void console.log(chalk.yellow(" Renderer unavailable."));const g=process.env.TMPDIR||"/tmp",d=n(g,`icoa-sim-${l}-${Date.now()}.mp4`);e(d,Buffer.from(p.data.mp4_b64,"base64")),console.log(),console.log(chalk.bold.green(" ✓")+chalk.gray(" ")+chalk.white(d)),p.data.description&&console.log(chalk.gray(" Action: ")+chalk.white(p.data.description)),console.log(),console.log(chalk.gray(" ")+s.hint),console.log();const y="darwin"===process.platform?"open":"win32"===process.platform?"start":"xdg-open";y?(o(y,[d],{stdio:"ignore",detached:!0}).unref(),console.log(chalk.gray(" Opening in your default video player..."))):console.log(chalk.gray(" Open the file above in any video player.")),console.log(),console.log(chalk.gray(" You just rendered a Franka Panda controlled by ")+chalk.bold.cyan("ICOA-VLA")+chalk.gray(" through ")+chalk.bold.cyan("MuJoCo")+chalk.gray(".")),console.log(chalk.bold.yellow(" You installed nothing.")),console.log(),console.log(chalk.gray(" Try other scenarios:"));for(const o of Object.keys(t))o!==l.toLowerCase()&&console.log(chalk.gray(" icoa sim ")+chalk.cyan(o));console.log(),console.log(chalk.gray(" Next steps · ")+chalk.bold.cyan("icoa demo2")+chalk.gray(" (5-min intro) · ")+chalk.bold.cyan("icoa learn")+chalk.gray(" (curriculum)")),console.log()}catch(o){const e=o instanceof Error?o.message:String(o);console.log(chalk.yellow(` Sim error: ${e}`))}}(l||"baseline")})}export{r as SCENARIOS};