@robota-sdk/agent-cli 3.0.0-beta.81 → 3.0.0-beta.82

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/node/bin.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  ;(function(){var v=parseInt(process.versions.node.split('.')[0],10);if(v<22){process.stderr.write('\n✗ Node.js 22+ is required (current: '+process.version+')\n\nUpgrade:\n nvm: nvm install 22 && nvm use 22\n Volta: volta install node@22\n Download: https://nodejs.org/en/download\n\n');process.exit(1);}})();
3
- import{C as e,D as t,E as n,S as r,T as i,_ as a,b as o,c as s,d as c,f as l,g as u,h as d,l as f,m as p,o as m,p as h,t as g,u as _,v,w as y,x as b,y as x}from"./cli-core-Bah38oug.js";import{join as S}from"node:path";function C(e){if(e===`1`)return!0;if(e===`0`)return!1}function w(e){if(e.flag!==void 0)return{reducedMotion:e.flag,override:`flag`};let t=C(e.env);return t===void 0?{reducedMotion:e.settings}:{reducedMotion:t,override:`environment`}}function T(t,n,r){let i=e(t??{}),a=w({settings:i.reducedMotion,flag:n,env:r.ROBOTA_REDUCED_MOTION});return{appearance:i,reducedMotion:a.reducedMotion,...a.override===void 0?{}:{reducedMotionOverride:a.override}}}const E=S(`.robota`,`themes`),D=RegExp(`^[A-Za-z0-9._-]{1,24}$`,`u`);function O(e,t,n){return e.listDirectory(t,n).filter(e=>e.kind===`file`&&e.name.endsWith(`.json`)).map(r=>({fileName:r.name,text:e.readText(S(t,r.name),n)}))}function k(e,t){let n=`load ${t.source} themes`,i=r(t.root);for(let r of O(i,t.directory,n)){let n=r.fileName.slice(0,-5);if(!D.test(n)){let n=u(r.fileName);e.skipped.push({id:`${t.idPrefix}${n}`,fileName:v(r.fileName),reason:`$: the file name ${n} cannot be a theme id — use at most 24 characters from letters, digits, dot, dash and underscore`});continue}let i=`${t.idPrefix}${n}`;if(e.claimed.has(i)){e.skipped.push({id:i,fileName:r.fileName,reason:`$: the id "${i}" is already taken by a theme loaded earlier`});continue}if(r.text===void 0){e.skipped.push({id:i,fileName:r.fileName,reason:`$: the file could not be read`});continue}let a=h({id:i,fileName:r.fileName,source:t.source,text:r.text});a.ok?(e.claimed.add(i),e.themes.push(a.theme)):e.skipped.push({id:i,fileName:r.fileName,reason:a.error})}}function A(e,t,n,r){let a=s(e,t,r);try{return i(a,{settingsPath:f(t)}).map(e=>({name:e.manifest.name,pluginDir:e.pluginDir}))}catch(e){let t=x(a.join(`, `)),r=x(e instanceof Error?e.message:String(e));return n.skipped.push({id:`custom:<plugins>`,fileName:t,reason:`$: the plugin scopes could not be read — ${r}`}),[]}}function j(e){let t={themes:[],skipped:[],claimed:new Set};k(t,{root:e.userHome,directory:E,source:`user`,idPrefix:`custom:`});let n=e.plugins??A(e.cwd,e.userHome,t,e.projectAccess);for(let e of n){if(!D.test(e.name)){let n=u(e.name);t.skipped.push({id:`custom:${n}`,fileName:v(e.name),reason:`$: the plugin name ${n} cannot be part of a theme id — its themes are not loaded`});continue}k(t,{root:e.pluginDir,directory:`themes`,source:`plugin`,idPrefix:`custom:${e.name}:`})}return{themes:t.themes,skipped:t.skipped}}function M(e){let t=T(e.settings,e.reducedMotionFlag,e.env),n={reducedMotion:t.reducedMotion,...t.reducedMotionOverride===void 0?{}:{reducedMotionOverride:t.reducedMotionOverride}};if(!e.enabled)return{registry:void 0,cataloguePort:void 0,skipped:[],...n};let r=j({cwd:e.cwd,userHome:e.userHome,...e.projectAccess===void 0?{}:{projectAccess:e.projectAccess}}),i=p([..._(),...r.themes],r.skipped);return{registry:i,cataloguePort:d({registry:i,readAppearance:()=>T(y(f()),void 0,{}).appearance,...t.reducedMotionOverride===void 0?{}:{reducedMotionPin:{tier:t.reducedMotionOverride,reducedMotion:t.reducedMotion}}}),skipped:r.skipped,...n}}let N=null,P=!1;function F(){return P}const I=[`string-width`,`setCursorPosition`,`getStringWidth`,`slice`,`charCodeAt`];function L(e,t){if(!t)return`rethrow`;let n=e.message??``;return I.some(e=>n.includes(e))?`ime-hint`:`guard-owned`}function R(e){N=e}function z(e,t){try{if(N){N.getSession().reportBackgroundError(e,t);return}}catch{}process.stderr.write(`\n[robota] ${t}: ${e.message}\n`)}function B(){P||(P=!0,process.on(`unhandledRejection`,e=>{z(e instanceof Error?e:Error(String(e)),`unhandled rejection`)}),process.on(`uncaughtException`,e=>{z(e instanceof Error?e:Error(String(e)),`uncaught exception`)}))}async function V(e={}){return g(e,n,{renderApp:a,createDefaultTuiCliAdapter:c,createNodeKeybindingsSource:l,createThemeSurface:M,installTuiProcessGuards:B,setLiveChannel:R})}t(),process.on(`uncaughtException`,e=>{let t=L(e,F());if(t===`ime-hint`){process.stderr.write(`
3
+ import{C as e,D as t,E as n,S as r,T as i,_ as a,b as o,c as s,d as c,f as l,g as u,h as d,l as f,m as p,o as m,p as h,t as g,u as _,v,w as y,x as b,y as x}from"./cli-core-DWG6gqoq.js";import{join as S}from"node:path";function C(e){if(e===`1`)return!0;if(e===`0`)return!1}function w(e){if(e.flag!==void 0)return{reducedMotion:e.flag,override:`flag`};let t=C(e.env);return t===void 0?{reducedMotion:e.settings}:{reducedMotion:t,override:`environment`}}function T(e,t,n){let r=i(e??{}),a=w({settings:r.reducedMotion,flag:t,env:n.ROBOTA_REDUCED_MOTION});return{appearance:r,reducedMotion:a.reducedMotion,...a.override===void 0?{}:{reducedMotionOverride:a.override}}}const E=S(`.robota`,`themes`),D=RegExp(`^[A-Za-z0-9._-]{1,24}$`,`u`);function O(e,t,n){return e.listDirectory(t,n).filter(e=>e.kind===`file`&&e.name.endsWith(`.json`)).map(r=>({fileName:r.name,text:e.readText(S(t,r.name),n)}))}function k(e,t){let n=`load ${t.source} themes`,i=r(t.root);for(let r of O(i,t.directory,n)){let n=r.fileName.slice(0,-5);if(!D.test(n)){let n=u(r.fileName);e.skipped.push({id:`${t.idPrefix}${n}`,fileName:v(r.fileName),reason:`$: the file name ${n} cannot be a theme id — use at most 24 characters from letters, digits, dot, dash and underscore`});continue}let i=`${t.idPrefix}${n}`;if(e.claimed.has(i)){e.skipped.push({id:i,fileName:r.fileName,reason:`$: the id "${i}" is already taken by a theme loaded earlier`});continue}if(r.text===void 0){e.skipped.push({id:i,fileName:r.fileName,reason:`$: the file could not be read`});continue}let a=h({id:i,fileName:r.fileName,source:t.source,text:r.text});a.ok?(e.claimed.add(i),e.themes.push(a.theme)):e.skipped.push({id:i,fileName:r.fileName,reason:a.error})}}function A(t,n,r,i){let a=s(t,n,i);try{return e(a,{settingsPath:f(n)}).map(e=>({name:e.manifest.name,pluginDir:e.pluginDir}))}catch(e){let t=x(a.join(`, `)),n=x(e instanceof Error?e.message:String(e));return r.skipped.push({id:`custom:<plugins>`,fileName:t,reason:`$: the plugin scopes could not be read — ${n}`}),[]}}function j(e){let t={themes:[],skipped:[],claimed:new Set};k(t,{root:e.userHome,directory:E,source:`user`,idPrefix:`custom:`});let n=e.plugins??A(e.cwd,e.userHome,t,e.projectAccess);for(let e of n){if(!D.test(e.name)){let n=u(e.name);t.skipped.push({id:`custom:${n}`,fileName:v(e.name),reason:`$: the plugin name ${n} cannot be part of a theme id — its themes are not loaded`});continue}k(t,{root:e.pluginDir,directory:`themes`,source:`plugin`,idPrefix:`custom:${e.name}:`})}return{themes:t.themes,skipped:t.skipped}}function M(e){let t=T(e.settings,e.reducedMotionFlag,e.env),n={reducedMotion:t.reducedMotion,...t.reducedMotionOverride===void 0?{}:{reducedMotionOverride:t.reducedMotionOverride}};if(!e.enabled)return{registry:void 0,cataloguePort:void 0,skipped:[],...n};let r=j({cwd:e.cwd,userHome:e.userHome,...e.projectAccess===void 0?{}:{projectAccess:e.projectAccess}}),i=p([..._(),...r.themes],r.skipped);return{registry:i,cataloguePort:d({registry:i,readAppearance:()=>T(y(f()),void 0,{}).appearance,...t.reducedMotionOverride===void 0?{}:{reducedMotionPin:{tier:t.reducedMotionOverride,reducedMotion:t.reducedMotion}}}),skipped:r.skipped,...n}}let N=null,P=!1;function F(){return P}const I=[`string-width`,`setCursorPosition`,`getStringWidth`,`slice`,`charCodeAt`];function L(e,t){if(!t)return`rethrow`;let n=e.message??``;return I.some(e=>n.includes(e))?`ime-hint`:`guard-owned`}function R(e){N=e}function z(e,t){try{if(N){N.getSession().reportBackgroundError(e,t);return}}catch{}process.stderr.write(`\n[robota] ${t}: ${e.message}\n`)}function B(){P||(P=!0,process.on(`unhandledRejection`,e=>{z(e instanceof Error?e:Error(String(e)),`unhandled rejection`)}),process.on(`uncaughtException`,e=>{z(e instanceof Error?e:Error(String(e)),`uncaught exception`)}))}async function V(e={}){return g(e,n,{renderApp:a,createDefaultTuiCliAdapter:c,createNodeKeybindingsSource:l,createThemeSurface:M,installTuiProcessGuards:B,setLiveChannel:R})}t(),process.on(`uncaughtException`,e=>{let t=L(e,F());if(t===`ime-hint`){process.stderr.write(`
4
4
  [robota] CJK/IME input error — this is a known issue with macOS Terminal.app.
5
5
  Workaround: use iTerm2 (https://iterm2.com) or input your prompt in English.
6
6
  Alternatively, use headless mode: robota -p "your prompt here"