@uipath/delegate-cli 0.1.7 β†’ 0.1.8

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.
Files changed (2) hide show
  1. package/dist/cli.mjs +1 -1
  2. package/package.json +2 -2
package/dist/cli.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const _0x5b0762=_0x50bf;function _0x870b(){const _0x197ea2=['--preload-skill','description','--tenant','file','test','Source:\x20\x20\x20\x20\x20\x20\x20','quiet','.\x20Use\x20alpha\x20|\x20staging\x20|\x20production\x20|\x20localhost.','toString','slice','trim','from','Tenant\x20not\x20switched:\x20could\x20not\x20write\x20','tenantName','logout','--backend','initialize','thinking','name','\x0aAvailable\x20models\x20(','push','staging','data','http://localhost:5002','off','Invalid\x20--env:\x20','[saved\x20login]\x20Backend\x20URL:\x20','The\x20saved\x20CLI\x20login\x20could\x20not\x20be\x20refreshed.\x20Run\x20`delegate-cli\x20login`\x20again.','153tjFSEP','production','sendMessage','Missing\x20prompt.\x20Pass\x20it\x20as\x20an\x20argument,\x20pipe\x20it\x20via\x20stdin,\x20or\x20run\x20`delegate-cli\x20--help`.','\x0aπŸ€”\x20','\x20needs\x20org/tenant\x20slugs.\x20Either:\x0a\x20\x20-\x20run\x20`delegate-cli\x20login\x20--env\x20','accessToken','unknown\x20slug','length','\x0a⚠️\x20\x20Auth\x20expired.\x20Opening\x20browser\x20to\x20re-login…\x0a','πŸ”§\x20','toolName','noSecurity','\x20β€”\x20sign\x20out\x20in\x20the\x20Delegate\x20app\x20to\x20clear\x20that.','response','No\x20backend\x20selected.\x20Run\x20`delegate-cli\x20login\x20--env\x20<env>`\x20first\x20(commands\x20then\x20default\x20to\x20that\x20cloud),\x20or\x20pass\x20--env\x20<alpha|staging|production|localhost>\x20or\x20--backend\x20<url>\x20(or\x20set\x20BACKEND_URL).','includes','content','error','X-Uipath-Tenantid','--keep-alive','orgLogicalName','stderr','Auth\x20comes\x20from\x20AUTH_TOKEN/TENANT_ID/ORG_ID\x20β€”\x20set\x20TENANT_ID\x20and\x20TENANT_SLUG\x20to\x20change\x20the\x20tenant.','Token:\x20\x20\x20\x20\x20\x20\x20\x20expires\x20','GET\x20','subcommand','--help','env','stack','380BSIKCx','--runner-url','destroy','concat','βœ“\x20Done\x0a','\x0aUse\x20with:\x20delegate-cli\x20--model\x20<id>\x20\x22<prompt>\x22\x0a','Organization:\x20','localhost','tenantId','\x0adelegate-cli\x20β€”\x20Delegate\x20agent\x20CLI\x0a\x0aUsage:\x0a\x20\x20delegate-cli\x20[flags]\x20\x22<prompt>\x22\x20\x20\x20\x20\x20\x20Send\x20prompt\x20to\x20the\x20agent\x0a\x20\x20delegate-cli\x20[flags]\x20-\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Read\x20the\x20prompt\x20from\x20stdin\x20(also\x20implied\x20when\x20stdin\x20is\x20piped)\x0a\x20\x20delegate-cli\x20login\x20[--env\x20NAME]\x20[--tenant\x20NAME]\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20OAuth\x20browser\x20login\x20β†’\x20~/.aria/sdk-auth.json.\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20--env\x20required\x20on\x20FIRST\x20login;\x20afterwards\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20defaults\x20to\x20the\x20saved\x20login\x27s\x20cloud.\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20--tenant\x20picks\x20a\x20tenant\x20by\x20name;\x20without\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20it\x20a\x20re-login\x20keeps\x20the\x20saved\x20tenant\x0a\x20\x20delegate-cli\x20tenant\x20[NAME]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20List\x20the\x20organization\x27s\x20tenants,\x20or\x20switch\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20the\x20saved\x20login\x20to\x20NAME\x20(no\x20browser)\x0a\x20\x20delegate-cli\x20logout\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Remove\x20the\x20saved\x20CLI\x20login\x0a\x20\x20delegate-cli\x20whoami\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20the\x20current\x20login\x20(org,\x20tenant,\x20token\x20expiry)\x0a\x20\x20delegate-cli\x20models\x20[--env\x20NAME]\x20\x20\x20\x20\x20List\x20available\x20LLM\x20models\x20for\x20the\x20current\x20tenant\x0a\x20\x20delegate-cli\x20host\x20[flags]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Run\x20this\x20PC\x20as\x20a\x20remote\x20worker\x20until\x20Ctrl+C\x0a\x20\x20delegate-cli\x20host\x20install\x20[flags]\x20\x20\x20\x20Auto-start\x20the\x20host\x20at\x20login\x20(macOS\x20LaunchAgent\x20/\x20Windows\x20Scheduled\x20Task)\x0a\x20\x20delegate-cli\x20host\x20uninstall\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Remove\x20auto-start\x0a\x20\x20delegate-cli\x20host\x20status\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20auto-start\x20state\x0a\x20\x20delegate-cli\x20--cleanup\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Stop\x20running\x20interop\x0a\x0aFlags:\x0a\x20\x20--env\x20NAME\x20\x20\x20\x20\x20\x20\x20\x20alpha\x20|\x20staging\x20|\x20production\x20|\x20localhost\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Composes\x20backend\x20URL\x20from\x20saved\x20auth\x20(org/tenant\x20slugs).\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Omitted\x20β†’\x20the\x20cloud\x20you\x20logged\x20into\x20(delegate-cli\x20login).\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20localhost\x20β†’\x20http://localhost:5002.\x20No\x20saved\x20login\x20and\x20no\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20--env/--backend/BACKEND_URL\x20is\x20an\x20error\x20β€”\x20never\x20a\x20guess.\x0a\x20\x20--backend\x20URL\x20\x20\x20\x20\x20Full\x20backend\x20URL\x20β€”\x20escape\x20hatch\x20overrides\x20--env\x0a\x20\x20--tenant\x20NAME\x20\x20\x20\x20\x20(login)\x20Tenant\x20to\x20sign\x20into,\x20by\x20name\x20(case-insensitive).\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Default:\x20the\x20saved\x20login\x27s\x20tenant\x20on\x20that\x20cloud,\x20else\x20the\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20org\x27s\x20first\x20tenant.\x20Later:\x20delegate-cli\x20tenant\x20<name>\x0a\x20\x20--model\x20NAME\x20\x20\x20\x20\x20\x20LLM\x20model\x20id\x20(e.g.\x20claude_sonnet_5,\x20kimi_k2_7_code).\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Default:\x20gemini_3_6_flash.\x20Also\x20settable\x20via\x20MODEL\x20env\x20var.\x0a\x20\x20--keep-alive\x20\x20\x20\x20\x20\x20Reuse/leave\x20interop\x20running\x20across\x20invocations\x0a\x20\x20--headless\x20\x20\x20\x20\x20\x20\x20\x20Skip\x20interop\x20(text-only\x20prompts)\x0a\x20\x20--no-connections\x20\x20Disable\x20orchestrator\x20ConnectionService\x20(silences\x20404\x20warnings)\x0a\x20\x20--no-security\x20\x20\x20\x20\x20Disable\x20tool\x20security\x20wrapper\x20(use\x20only\x20for\x20debugging)\x0a\x20\x20--preload-skill\x20NAME\x20\x20Preload\x20a\x20skill\x20into\x20the\x20session\x20(repeatable).\x20The\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20skill\x27s\x20content\x20is\x20attached\x20before\x20the\x20first\x20model\x20turn\x20β€”\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20same\x20mechanism\x20as\x20project\x20preloaded\x20skills\x20in\x20the\x20app\x0a\x20\x20--runner-url\x20URL\x20\x20(host)\x20Runner\x20worker\x20WS\x20URL.\x20Required;\x20or\x20CONTROL_PLANE_WS_URL\x20env\x0a\x20\x20--interop\x20PATH\x20\x20\x20\x20(host)\x20Interop\x20binary\x20path;\x20or\x20INTEROP_EXECUTABLE_PATH\x20env.\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Absent\x20β†’\x20registration/discovery\x20only,\x20tool\x20execution\x20disabled\x0a\x20\x20--worker-id\x20ID\x20\x20\x20\x20(host)\x20Stable\x20worker\x20identity;\x20or\x20WORKER_ID\x20env.\x20Default:\x20hostname\x0a\x20\x20-q,\x20--quiet\x20\x20\x20\x20\x20\x20\x20Suppress\x20πŸ€”\x20thinking\x20output\x20to\x20stderr\x0a\x20\x20-h,\x20--help\x20\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x0a\x20\x20-v,\x20--version\x20\x20\x20\x20\x20Print\x20the\x20installed\x20CLI\x20version\x0a\x0aAuth:\x20prompts\x20auto-retry\x20on\x20401\x20by\x20opening\x20the\x20browser\x20to\x20re-login\x20(TTY\x20only).\x0a','82437PjWBKX','join','keepAlive','--env','lastType','368598hCMKPc','[env=','noConnections','--headless','isArray','expiresAt','isTTY','8326052GBXRhQ','preloadSkills','No\x20CLI\x20login\x20found.\x20Note:\x20the\x20CLI\x20is\x20currently\x20authenticating\x20via\x20the\x20Delegate\x20desktop\x20app\x27s\x20','resume','No\x20auth\x20found.\x20Set\x20AUTH_TOKEN/TENANT_ID/ORG_ID\x20env\x20vars,\x20or\x20run\x20`delegate-cli\x20login\x20--env\x20<alpha|staging|production>`\x20(interactive\x20browser\x20OAuth)\x20first.','done','statusText','https://alpha.uipath.com','workerId','\x0aStopping…\x20(Ctrl+C\x20again\x20to\x20force\x20exit)\x0a','package.json','tool','Token:\x20\x20\x20\x20\x20\x20\x20\x20expired\x20','alpha','message','organizationId','isDesktopFallback','\x20(current)','exit','\x20\x20\x20\x20','interopPath','`\x20(writes\x20slugs\x20to\x20~/.aria/sdk-auth.json),\x20or\x0a\x20\x20-\x20set\x20ORG_SLUG\x20and\x20TENANT_SLUG\x20env\x20vars\x20alongside\x20ORG_ID/TENANT_ID,\x20or\x0a\x20\x20-\x20pass\x20the\x20full\x20URL\x20via\x20--backend\x20(overrides\x20--env).','Removed\x20','status','origin','now','version','whoami','166585SRPTFB','auth.json','rmSync','--env\x20localhost\x20has\x20no\x20OAuth\x20flow;\x20pick\x20alpha,\x20staging,\x20or\x20production.','--no-security','headless','--no-connections','log','No\x20CLI\x20login\x20found.\x20Run\x20`delegate-cli\x20login\x20--env\x20<alpha|staging|production>`\x20first.','Bearer\x20','map','toISOString','--worker-id','json','--env\x20','Tenants\x20of\x20','1103773VyxPdj','pause','backendUrl','585432KEIWZz','MODELS','28bbhKpY','--cleanup','entries','--model','login','SIGINT','write','No\x20CLI\x20login\x20to\x20switch:\x20the\x20CLI\x20is\x20authenticating\x20via\x20the\x20Delegate\x20desktop\x20app\x27s\x20','3139170hpnmwE','Unknown\x20flag:\x20','Switch\x20with:\x20delegate-cli\x20tenant\x20<name>\x0a','startsWith','end','Interop\x20stopped\x20(if\x20it\x20was\x20running).','stdout','host',';\x20the\x20saved\x20login\x20still\x20uses\x20','\x20(Delegate\x20desktop\x20app\x20fallback)','existsSync','runnerUrl','2KfqhMX','stop','No\x20models\x20available\x20for\x20this\x20product/tenant.\x0a','unknown','prompt','baseUrl','once','stdin','model','cleanup','\x20min)','--tenant\x20requires\x20a\x20tenant\x20name.','help',')\x20β€”\x20saved\x20to\x20','--preload-skill\x20requires\x20a\x20skill\x20name.','utf-8','tenant'];_0x870b=function(){return _0x197ea2;};return _0x870b();}(function(_0x3ca82e,_0x3a6867){const _0xa4b617=_0x50bf,_0x45fb56=_0x3ca82e();while(!![]){try{const _0x5de5c0=-parseInt(_0xa4b617(0x147))/0x1*(-parseInt(_0xa4b617(0x198))/0x2)+-parseInt(_0xa4b617(0x18c))/0x3+-parseInt(_0xa4b617(0x184))/0x4*(-parseInt(_0xa4b617(0x16f))/0x5)+parseInt(_0xa4b617(0x14c))/0x6+-parseInt(_0xa4b617(0x153))/0x7+-parseInt(_0xa4b617(0x182))/0x8*(parseInt(_0xa4b617(0x1c5))/0x9)+parseInt(_0xa4b617(0x1e3))/0xa*(parseInt(_0xa4b617(0x17f))/0xb);if(_0x5de5c0===_0x3a6867)break;else _0x45fb56['push'](_0x45fb56['shift']());}catch(_0x74dcb5){_0x45fb56['push'](_0x45fb56['shift']());}}}(_0x870b,0xad66e));const __dirname=import.meta.dirname;import _0x2bf73f from'fs';import _0x3e4eda from'path';import{DelegateAgent as _0x13fc0e,InteropProcess as _0x3b545f,buildDelegateServiceUrl as _0x48d527,getAuthFilePath as _0x56cda5,listTenants as _0x1a9f9e,loadAndRefreshAuth as _0x38633e,loadAndRefreshSdkLogin as _0x2ac98f,runHostCommand as _0x53915a,runLoginFlow as _0x5bdfff,saveAuthData as _0x1aec0a,switchTenant as _0x355c20}from'@uipath/delegate-sdk';var m={'alpha':_0x5b0762(0x15a),'staging':'https://staging.uipath.com','production':'https://cloud.uipath.com'},P=['login',_0x5b0762(0x1a8),'models',_0x5b0762(0x193),_0x5b0762(0x1b7),_0x5b0762(0x16e)];function x(_0x34c757){const _0x19ad7d=_0x5b0762;let _0x4e81={'subcommand':'','prompt':'','keepAlive':!0x1,'cleanup':!0x1,'headless':!0x1,'noConnections':!0x1,'noSecurity':!0x1,'quiet':!0x1,'preloadSkills':[],'help':!0x1,'version':!0x1};P[_0x19ad7d(0x1d5)](_0x34c757[0x0])&&(_0x4e81[_0x19ad7d(0x1df)]=_0x34c757[0x0],_0x34c757=_0x34c757[_0x19ad7d(0x1b2)](0x1));let _0x21bccb=[];for(let _0x17687d=0x0;_0x17687d<_0x34c757[_0x19ad7d(0x1cd)];_0x17687d++){let _0x10316b=_0x34c757[_0x17687d];switch(_0x10316b){case _0x19ad7d(0x1d9):_0x4e81[_0x19ad7d(0x149)]=!0x0;break;case _0x19ad7d(0x185):_0x4e81[_0x19ad7d(0x1a1)]=!0x0;break;case _0x19ad7d(0x14f):_0x4e81[_0x19ad7d(0x174)]=!0x0;break;case _0x19ad7d(0x175):_0x4e81[_0x19ad7d(0x14e)]=!0x0;break;case _0x19ad7d(0x173):_0x4e81[_0x19ad7d(0x1d1)]=!0x0;break;case'--quiet':case'-q':_0x4e81[_0x19ad7d(0x1af)]=!0x0;break;case _0x19ad7d(0x1b8):_0x4e81['backendUrl']=_0x34c757[++_0x17687d];break;case _0x19ad7d(0x187):_0x4e81[_0x19ad7d(0x1a0)]=_0x34c757[++_0x17687d];break;case _0x19ad7d(0x1e4):_0x4e81['runnerUrl']=_0x34c757[++_0x17687d];break;case'--interop':_0x4e81[_0x19ad7d(0x167)]=_0x34c757[++_0x17687d];break;case _0x19ad7d(0x17b):_0x4e81['workerId']=_0x34c757[++_0x17687d];break;case _0x19ad7d(0x1a9):{let _0x4c1c9e=_0x34c757[++_0x17687d];(!_0x4c1c9e||_0x4c1c9e[_0x19ad7d(0x18f)]('--'))&&(console[_0x19ad7d(0x1d7)](_0x19ad7d(0x1a6)),process[_0x19ad7d(0x165)](0x2)),_0x4e81['preloadSkills'][_0x19ad7d(0x1bd)](_0x4c1c9e);break;}case _0x19ad7d(0x1ab):{let _0x48abe6=_0x34c757[++_0x17687d];(!_0x48abe6||_0x48abe6[_0x19ad7d(0x18f)]('--'))&&(console[_0x19ad7d(0x1d7)](_0x19ad7d(0x1a3)),process[_0x19ad7d(0x165)](0x2)),_0x4e81[_0x19ad7d(0x1a8)]=_0x48abe6;break;}case _0x19ad7d(0x14a):{let _0x377c84=_0x34c757[++_0x17687d];[_0x19ad7d(0x160),_0x19ad7d(0x1be),_0x19ad7d(0x1c6),_0x19ad7d(0x144)][_0x19ad7d(0x1d5)](_0x377c84)||(console[_0x19ad7d(0x1d7)](_0x19ad7d(0x1c2)+_0x377c84+_0x19ad7d(0x1b0)),process[_0x19ad7d(0x165)](0x2)),_0x4e81['env']=_0x377c84;break;}case'-h':case _0x19ad7d(0x1e0):_0x4e81['help']=!0x0;break;case'-v':case'--version':_0x4e81['version']=!0x0;break;default:_0x10316b[_0x19ad7d(0x18f)]('--')&&(console['error'](_0x19ad7d(0x18d)+_0x10316b),process[_0x19ad7d(0x165)](0x2)),_0x21bccb[_0x19ad7d(0x1bd)](_0x10316b);}}return _0x4e81[_0x19ad7d(0x1a8)]!==void 0x0&&_0x4e81[_0x19ad7d(0x1df)]!==_0x19ad7d(0x188)&&(console[_0x19ad7d(0x1d7)]('--tenant\x20applies\x20to\x20`delegate-cli\x20login`\x20only.\x20Switch\x20tenants\x20with:\x20delegate-cli\x20tenant\x20<name>'),process[_0x19ad7d(0x165)](0x2)),_0x4e81[_0x19ad7d(0x19c)]=_0x21bccb[_0x19ad7d(0x148)]('\x20'),_0x4e81;}function y(_0x65ad81,_0x5efa75,_0x50bed0){const _0x19b488=_0x5b0762;if(_0x50bed0)return _0x50bed0;if(process.env.BACKEND_URL)return process.env.BACKEND_URL;if(!_0x65ad81){if(_0x5efa75?.['baseUrl']&&_0x5efa75?.[_0x19b488(0x1da)]&&_0x5efa75?.[_0x19b488(0x1b6)])return _0x48d527(_0x5efa75[_0x19b488(0x19d)],_0x5efa75[_0x19b488(0x1da)],_0x5efa75[_0x19b488(0x1b6)]);throw new Error(_0x19b488(0x1d4));}if(_0x65ad81===_0x19b488(0x144))return _0x19b488(0x1c0);let _0x5a62ca=m[_0x65ad81],_0x42a736=_0x5efa75?.[_0x19b488(0x1da)],_0x38a647=_0x5efa75?.[_0x19b488(0x1b6)];if(!_0x42a736||!_0x38a647)throw new Error(_0x19b488(0x17d)+_0x65ad81+_0x19b488(0x1ca)+_0x65ad81+_0x19b488(0x168));return _0x48d527(_0x5a62ca,_0x42a736,_0x38a647);}function M(){const _0x2eacda=_0x5b0762;let _0x50f43f=_0x2eacda(0x146)[_0x2eacda(0x1b3)]();console[_0x2eacda(0x176)](_0x50f43f);}function B(){const _0x44d218=_0x5b0762;try{return JSON['parse'](_0x2bf73f['readFileSync'](_0x3e4eda[_0x44d218(0x148)](__dirname,'..',_0x44d218(0x15d)),_0x44d218(0x1a7)))[_0x44d218(0x16d)]||_0x44d218(0x19b);}catch{return _0x44d218(0x19b);}}var G=0x7d0;async function A(_0x5d7bca,_0x3a7972){const _0x3434b8=_0x5b0762;let _0x408d8d=_0x3a7972?[_0x3a7972]:[];for await(let _0x2c02b9 of _0x5d7bca)_0x408d8d['push'](Buffer[_0x3434b8(0x1b4)](_0x2c02b9));return Buffer[_0x3434b8(0x1e6)](_0x408d8d)[_0x3434b8(0x1b1)](_0x3434b8(0x1a7))[_0x3434b8(0x1b3)]();}function q(_0x4c73d4,_0x21247a){return new Promise(_0x3e488a=>{const _0xea44e5=_0x50bf;let _0x17937a=_0x285c00=>{const _0x228216=_0x50bf;clearTimeout(_0xcd7b2f),_0x4c73d4['off'](_0x228216(0x1bf),_0xe4beb9),_0x4c73d4[_0x228216(0x1c1)](_0x228216(0x190),_0x34794d),_0x4c73d4[_0x228216(0x1c1)](_0x228216(0x1d7),_0x34794d),_0x4c73d4[_0x228216(0x180)](),_0x3e488a(_0x285c00);},_0xe4beb9=_0x3b81f1=>_0x17937a(Buffer[_0xea44e5(0x1b4)](_0x3b81f1)),_0x34794d=()=>_0x17937a(null),_0xcd7b2f=setTimeout(()=>_0x17937a(null),_0x21247a);_0x4c73d4['on'](_0xea44e5(0x1bf),_0xe4beb9),_0x4c73d4['on'](_0xea44e5(0x190),_0x34794d),_0x4c73d4['on'](_0xea44e5(0x1d7),_0x34794d),_0x4c73d4[_0xea44e5(0x156)]();});}async function F(_0x694e16,_0x5ec1df,_0x133e55=G){const _0x3d33ec=_0x5b0762;let _0xd57110=_0x694e16==='-';if(!_0xd57110&&_0x694e16)return _0x694e16;if(!_0xd57110&&_0x5ec1df[_0x3d33ec(0x152)])return'';if(_0xd57110)return A(_0x5ec1df,null);let _0x4bf8b2=await q(_0x5ec1df,_0x133e55);return _0x4bf8b2?A(_0x5ec1df,_0x4bf8b2):'';}function v(){const _0x1b3839=_0x5b0762;return _0x3e4eda[_0x1b3839(0x148)](process.env.HOME||process.env.USERPROFILE||'','.aria',_0x1b3839(0x170));}function f(_0x429009){const _0x5e43d3=_0x5b0762;try{let _0x2f4393=JSON['parse'](_0x2bf73f['readFileSync'](_0x429009,_0x5e43d3(0x1a7)));return!_0x2f4393[_0x5e43d3(0x1cb)]||!_0x2f4393['tenantId']||!_0x2f4393[_0x5e43d3(0x162)]?null:_0x2f4393;}catch{return null;}}function j(){let _0x398e1c=[{'file':_0x56cda5(),'isDesktopFallback':!0x1},{'file':v(),'isDesktopFallback':!0x0}];for(let _0x4ca0c3 of _0x398e1c){let _0x13773a=f(_0x4ca0c3['file']);if(_0x13773a)return{..._0x4ca0c3,'auth':_0x13773a};}return null;}async function z(){const _0x3ef198=_0x5b0762;let _0x3832bd=_0x56cda5();if(!_0x2bf73f['existsSync'](_0x3832bd)){let _0xce97a0=v();console[_0x3ef198(0x176)](f(_0xce97a0)?_0x3ef198(0x155)+_0xce97a0+_0x3ef198(0x1d2):'No\x20CLI\x20login\x20found\x20β€”\x20nothing\x20to\x20remove.');return;}_0x2bf73f[_0x3ef198(0x171)](_0x3832bd),console[_0x3ef198(0x176)](_0x3ef198(0x169)+_0x3832bd);}async function H(){const _0x82297c=_0x5b0762;let _0x5162fc=k(),_0x3bf1af,_0x1202c1;if(_0x5162fc)_0x3bf1af=_0x5162fc,_0x1202c1='environment\x20variables\x20(AUTH_TOKEN/TENANT_ID/ORG_ID)';else{let _0x20d0f9=j();if(!_0x20d0f9)throw new Error(N);_0x3bf1af=_0x20d0f9['auth'],_0x1202c1=_0x20d0f9[_0x82297c(0x163)]?_0x20d0f9[_0x82297c(0x1ac)]+_0x82297c(0x195):_0x20d0f9[_0x82297c(0x1ac)];}let _0x4e6091=[_0x82297c(0x1ae)+_0x1202c1,'Base\x20URL:\x20\x20\x20\x20\x20'+(_0x3bf1af[_0x82297c(0x19d)]??'unknown'),_0x82297c(0x1e9)+(_0x3bf1af[_0x82297c(0x1da)]??_0x82297c(0x1cc))+'\x20('+_0x3bf1af['organizationId']+')','Tenant:\x20\x20\x20\x20\x20\x20\x20'+(_0x3bf1af[_0x82297c(0x1b6)]??_0x82297c(0x1cc))+'\x20('+_0x3bf1af[_0x82297c(0x145)]+')'];if(_0x3bf1af[_0x82297c(0x151)]){let _0x6f02a5=_0x3bf1af[_0x82297c(0x151)]-Math['floor'](Date[_0x82297c(0x16c)]()/0x3e8),_0x176abe=new Date(_0x3bf1af['expiresAt']*0x3e8)[_0x82297c(0x17a)]();_0x4e6091['push'](_0x6f02a5>0x0?_0x82297c(0x1dd)+_0x176abe+'\x20(in\x20'+Math['round'](_0x6f02a5/0x3c)+_0x82297c(0x1a2):_0x82297c(0x15f)+_0x176abe);}process['stdout'][_0x82297c(0x18a)](_0x4e6091['join']('\x0a')+'\x0a');}var N=_0x5b0762(0x157);function k(){return process.env.AUTH_TOKEN&&process.env.TENANT_ID&&process.env.ORG_ID?{'accessToken':process.env.AUTH_TOKEN,'tenantId':process.env.TENANT_ID,'organizationId':process.env.ORG_ID,'orgLogicalName':process.env.ORG_SLUG,'tenantName':process.env.TENANT_SLUG,'baseUrl':process.env.UIPATH_BASE_URL}:null;}async function E(){let _0x2323ce=k();if(_0x2323ce)return _0x2323ce;let _0xfef6fa=await _0x38633e();if(_0xfef6fa)return _0xfef6fa;throw new Error(N);}async function K(){const _0x5a327e=_0x5b0762;await new _0x3b545f()[_0x5a327e(0x199)]({'force':!0x0}),console['log'](_0x5a327e(0x191));}var W='799f56b8-4aed-4a0f-8640-659dae4a9e0e';function U(_0x293759,_0x1c3578,_0x297070){const _0x350fe4=_0x5b0762;_0x293759?process[_0x350fe4(0x1db)]['write'](_0x350fe4(0x14d)+_0x293759+']\x20Backend\x20URL:\x20'+_0x297070+'\x0a'):!_0x1c3578&&!process.env.BACKEND_URL&&process[_0x350fe4(0x1db)][_0x350fe4(0x18a)](_0x350fe4(0x1c3)+_0x297070+'\x0a');}async function J(_0x179095){const _0x40a2a8=_0x5b0762;let _0x222d9c=await E(),_0x1101e7=y(_0x179095[_0x40a2a8(0x1e1)],_0x222d9c,_0x179095[_0x40a2a8(0x181)]);U(_0x179095[_0x40a2a8(0x1e1)],_0x179095[_0x40a2a8(0x181)],_0x1101e7);let _0x172d73=_0x1101e7+'/v1/config',_0x31166d={'Authorization':_0x40a2a8(0x178)+_0x222d9c[_0x40a2a8(0x1cb)],'X-UiPath-ConsumingProductId':W};_0x222d9c[_0x40a2a8(0x145)]&&(_0x31166d[_0x40a2a8(0x1d8)]=_0x222d9c[_0x40a2a8(0x145)]),_0x222d9c[_0x40a2a8(0x162)]&&(_0x31166d['X-Uipath-Organizationid']=_0x222d9c[_0x40a2a8(0x162)]);let _0xa6ab33=await fetch(_0x172d73,{'headers':_0x31166d});if(!_0xa6ab33['ok'])throw new Error(_0x40a2a8(0x1de)+_0x172d73+'\x20β†’\x20'+_0xa6ab33[_0x40a2a8(0x16a)]+'\x20'+_0xa6ab33[_0x40a2a8(0x159)]);let _0x14bb3f=(await _0xa6ab33[_0x40a2a8(0x17c)]())?.[_0x40a2a8(0x183)],_0x4e6386=Array[_0x40a2a8(0x150)](_0x14bb3f)?_0x14bb3f:_0x14bb3f&&typeof _0x14bb3f=='object'?Object[_0x40a2a8(0x186)](_0x14bb3f)[_0x40a2a8(0x179)](([_0x5de3e7,_0x574552])=>({'id':_0x5de3e7,'name':_0x574552})):[];if(_0x4e6386[_0x40a2a8(0x1cd)]===0x0){process[_0x40a2a8(0x1db)]['write'](_0x40a2a8(0x19a));return;}process[_0x40a2a8(0x192)]['write'](_0x40a2a8(0x1bc)+_0x4e6386['length']+'):\x0a\x0a');for(let _0x254577 of _0x4e6386){let _0x2989dd=_0x254577[_0x40a2a8(0x1bb)]&&_0x254577[_0x40a2a8(0x1bb)]!==_0x254577['id']?'\x20('+_0x254577[_0x40a2a8(0x1bb)]+')':'';process[_0x40a2a8(0x192)]['write']('\x20\x20'+_0x254577['id']+_0x2989dd+'\x0a'),_0x254577['description']&&process[_0x40a2a8(0x192)]['write'](_0x40a2a8(0x166)+_0x254577[_0x40a2a8(0x1aa)]+'\x0a');}process[_0x40a2a8(0x192)][_0x40a2a8(0x18a)](_0x40a2a8(0x1e8));}async function X(_0x4467ef){const _0x858c1b=_0x5b0762;_0x4467ef[_0x858c1b(0x1e1)]===_0x858c1b(0x144)&&(console[_0x858c1b(0x1d7)](_0x858c1b(0x172)),process[_0x858c1b(0x165)](0x2));let _0x95871b=f(_0x56cda5());if(_0x4467ef[_0x858c1b(0x1e1)]){let _0x2f61d2=_0x4467ef['env'];await _0x5bdfff({'env':_0x2f61d2,'tenant':_0x4467ef[_0x858c1b(0x1a8)]??L(_0x95871b,m[_0x2f61d2])});return;}if(_0x95871b?.[_0x858c1b(0x19d)]){await _0x5bdfff({'baseUrl':_0x95871b[_0x858c1b(0x19d)],'tenant':_0x4467ef[_0x858c1b(0x1a8)]??_0x95871b['tenantName']});return;}console[_0x858c1b(0x1d7)]('First\x20login\x20requires\x20--env.\x20Usage:\x20delegate-cli\x20login\x20--env\x20<alpha|staging|production>'),process[_0x858c1b(0x165)](0x2);}function L(_0x3cc657,_0x43e972){const _0x5225fe=_0x5b0762;return _0x3cc657?.[_0x5225fe(0x19d)]&&V(_0x3cc657['baseUrl'],_0x43e972)?_0x3cc657['tenantName']:void 0x0;}function _0x50bf(_0x4a3dd2,_0x3b2484){_0x4a3dd2=_0x4a3dd2-0x144;const _0x870b12=_0x870b();let _0x50bf8f=_0x870b12[_0x4a3dd2];return _0x50bf8f;}function V(_0x256958,_0x1e8b58){const _0x57533e=_0x5b0762;try{return new URL(_0x256958)[_0x57533e(0x16b)]===new URL(_0x1e8b58)[_0x57533e(0x16b)];}catch{return!0x1;}}async function Y(_0x2a1b79){const _0x15c6dd=_0x5b0762;k()&&(console[_0x15c6dd(0x1d7)](_0x15c6dd(0x1dc)),process[_0x15c6dd(0x165)](0x2));let _0x1e4e35=await _0x2ac98f();if(_0x1e4e35||(console['error'](Q()),process['exit'](0x2)),_0x2a1b79[_0x15c6dd(0x1b3)]()){let _0x309882=await _0x355c20(_0x1e4e35,_0x2a1b79);_0x1aec0a(_0x309882)||(console[_0x15c6dd(0x1d7)](_0x15c6dd(0x1b5)+_0x56cda5()+_0x15c6dd(0x194)+_0x1e4e35[_0x15c6dd(0x1b6)]+'.'),process[_0x15c6dd(0x165)](0x1)),console[_0x15c6dd(0x176)]('Tenant:\x20'+_0x309882[_0x15c6dd(0x1b6)]+'\x20('+_0x309882[_0x15c6dd(0x145)]+_0x15c6dd(0x1a5)+_0x56cda5());return;}Z(await _0x1a9f9e(_0x1e4e35),_0x1e4e35);}function Q(){const _0x2afd0c=_0x5b0762;if(_0x2bf73f[_0x2afd0c(0x196)](_0x56cda5()))return _0x2afd0c(0x1c4);let _0x2d4e2d=v();return f(_0x2d4e2d)?_0x2afd0c(0x18b)+_0x2d4e2d+',\x20whose\x20tenant\x20is\x20chosen\x20in\x20the\x20app.\x20Run\x20`delegate-cli\x20login\x20--env\x20<env>`\x20for\x20a\x20CLI\x20login\x20of\x20your\x20own.':_0x2afd0c(0x177);}function Z(_0x451778,_0xe22c6f){const _0x45afe1=_0x5b0762;let _0x595555=_0x451778[_0x45afe1(0x179)](_0x319136=>_0x319136['id']===_0xe22c6f[_0x45afe1(0x145)]?'*\x20'+_0x319136[_0x45afe1(0x1bb)]+_0x45afe1(0x164):'\x20\x20'+_0x319136['name']);process[_0x45afe1(0x192)][_0x45afe1(0x18a)](_0x45afe1(0x17e)+(_0xe22c6f[_0x45afe1(0x1da)]??_0xe22c6f[_0x45afe1(0x162)])+':\x0a'+_0x595555[_0x45afe1(0x148)]('\x0a')+'\x0a'),_0x451778[_0x45afe1(0x1cd)]>0x1&&process[_0x45afe1(0x192)]['write'](_0x45afe1(0x18e));}function ee(_0xda19fa){const _0x1918c8=_0x5b0762;return _0xda19fa?.[_0x1918c8(0x1d3)]?.[_0x1918c8(0x16a)]===0x191||/401/[_0x1918c8(0x1ad)](String(_0xda19fa?.['message']??''));}var a={'lastType':null,'quiet':!0x1},S=_0x4cea0c=>{const _0xffeed4=_0x5b0762;switch(_0x4cea0c['type']){case _0xffeed4(0x1ba):_0x4cea0c['content']&&!a[_0xffeed4(0x1af)]&&(a['lastType']!==_0xffeed4(0x1ba)&&process[_0xffeed4(0x1db)]['write'](_0xffeed4(0x1c9)),process[_0xffeed4(0x1db)]['write'](_0x4cea0c[_0xffeed4(0x1d6)]),a[_0xffeed4(0x14b)]='thinking');break;case'tool_call':a[_0xffeed4(0x14b)]!==null&&process[_0xffeed4(0x1db)][_0xffeed4(0x18a)]('\x0a'),process['stderr']['write'](_0xffeed4(0x1cf)+(_0x4cea0c[_0xffeed4(0x1d0)]??_0xffeed4(0x15e))+'\x0a'),a[_0xffeed4(0x14b)]='tool_call';break;case _0xffeed4(0x161):_0x4cea0c[_0xffeed4(0x1d6)]&&(a['lastType']!==_0xffeed4(0x161)&&a[_0xffeed4(0x14b)]!==null&&process['stdout'][_0xffeed4(0x18a)]('\x0a'),process[_0xffeed4(0x192)][_0xffeed4(0x18a)](_0x4cea0c['content']),a[_0xffeed4(0x14b)]=_0xffeed4(0x161));break;case _0xffeed4(0x1d7):a[_0xffeed4(0x14b)]!==null&&process[_0xffeed4(0x1db)][_0xffeed4(0x18a)]('\x0a'),process[_0xffeed4(0x1db)][_0xffeed4(0x18a)]('βœ—\x20'+(_0x4cea0c[_0xffeed4(0x1d7)]??_0x4cea0c[_0xffeed4(0x161)]??_0xffeed4(0x1d7))+'\x0a'),a['lastType']=_0xffeed4(0x1d7);break;case _0xffeed4(0x158):(a[_0xffeed4(0x14b)]===_0xffeed4(0x161)||a['lastType']===_0xffeed4(0x1ba))&&process[_0xffeed4(0x192)][_0xffeed4(0x18a)]('\x0a'),process[_0xffeed4(0x1db)]['write'](_0xffeed4(0x1e7)),a[_0xffeed4(0x14b)]=_0xffeed4(0x158);break;}};async function ne(_0x314172){const _0x1a7bdf=_0x5b0762;let _0x375c3c=await F(_0x314172['prompt'],process[_0x1a7bdf(0x19f)]);_0x375c3c||(console['error'](_0x1a7bdf(0x1c8)),process[_0x1a7bdf(0x165)](0x2)),a['quiet']=_0x314172[_0x1a7bdf(0x1af)];let _0xcf94f4=await E(),_0x18eab3=new _0x13fc0e();_0x18eab3['onEvent'](S);let _0x3f884b=y(_0x314172['env'],_0xcf94f4,_0x314172[_0x1a7bdf(0x181)]);U(_0x314172[_0x1a7bdf(0x1e1)],_0x314172[_0x1a7bdf(0x181)],_0x3f884b);let _0x2c8eb8={'backendUrl':_0x3f884b,'auth':_0xcf94f4,'enableComputerUse':!_0x314172[_0x1a7bdf(0x174)],'autoSpawnInterop':!_0x314172[_0x1a7bdf(0x174)],'enableConnections':!_0x314172[_0x1a7bdf(0x14e)],'enableSecurity':!_0x314172[_0x1a7bdf(0x1d1)],'keepInteropAlive':_0x314172[_0x1a7bdf(0x149)],..._0x314172[_0x1a7bdf(0x154)]['length']>0x0?{'preloadSkills':_0x314172[_0x1a7bdf(0x154)]}:{},..._0x314172['model']||process.env.MODEL?{'model':_0x314172['model']||process.env.MODEL}:{}},_0x357147=!0x1,_0x39a0ea=!0x1,_0x54e240=()=>{const _0x3bbadb=_0x1a7bdf;_0x39a0ea&&process[_0x3bbadb(0x165)](0x82),_0x39a0ea=!0x0,process['stderr'][_0x3bbadb(0x18a)](_0x3bbadb(0x15c)),_0x357147?_0x18eab3[_0x3bbadb(0x1e5)]()['finally'](()=>process[_0x3bbadb(0x165)](0x82)):process[_0x3bbadb(0x165)](0x82);};process[_0x1a7bdf(0x19e)]('SIGINT',_0x54e240),await _0x18eab3[_0x1a7bdf(0x1b9)](_0x2c8eb8),_0x357147=!0x0;try{await _0x18eab3['sendMessage'](_0x375c3c);}catch(_0x58b777){if(ee(_0x58b777)&&process[_0x1a7bdf(0x19f)][_0x1a7bdf(0x152)]&&_0x314172[_0x1a7bdf(0x1e1)]!=='localhost'&&(_0x314172[_0x1a7bdf(0x1e1)]||_0xcf94f4['baseUrl'])){process[_0x1a7bdf(0x1db)]['write'](_0x1a7bdf(0x1ce));let _0x1375a7=await _0x5bdfff(_0x314172[_0x1a7bdf(0x1e1)]?{'env':_0x314172[_0x1a7bdf(0x1e1)],'tenant':L(_0xcf94f4,m[_0x314172[_0x1a7bdf(0x1e1)]])}:{'baseUrl':_0xcf94f4[_0x1a7bdf(0x19d)],'tenant':_0xcf94f4[_0x1a7bdf(0x1b6)]});await _0x18eab3['destroy'](),_0x18eab3=new _0x13fc0e(),_0x18eab3['onEvent'](S),await _0x18eab3[_0x1a7bdf(0x1b9)]({..._0x2c8eb8,'auth':_0x1375a7}),await _0x18eab3[_0x1a7bdf(0x1c7)](_0x375c3c);}else throw _0x58b777;}finally{process[_0x1a7bdf(0x1c1)](_0x1a7bdf(0x189),_0x54e240),await _0x18eab3['destroy']();}}async function te(){const _0x34ee6d=_0x5b0762;let _0x770f02=x(process['argv'][_0x34ee6d(0x1b2)](0x2));if(_0x770f02[_0x34ee6d(0x1a4)]){M();return;}if(_0x770f02[_0x34ee6d(0x16d)]){console['log'](B());return;}if(_0x770f02['subcommand']===_0x34ee6d(0x188)){await X(_0x770f02);return;}if(_0x770f02['subcommand']===_0x34ee6d(0x1a8)){await Y(_0x770f02[_0x34ee6d(0x19c)]);return;}if(_0x770f02[_0x34ee6d(0x1df)]==='logout'){await z();return;}if(_0x770f02['subcommand']===_0x34ee6d(0x16e)){await H();return;}if(_0x770f02['subcommand']==='models'){await J(_0x770f02);return;}if(_0x770f02[_0x34ee6d(0x1df)]===_0x34ee6d(0x193)){await _0x53915a(_0x770f02['prompt'],{'runnerUrl':_0x770f02[_0x34ee6d(0x197)],'backendUrl':_0x770f02[_0x34ee6d(0x181)],'interopPath':_0x770f02[_0x34ee6d(0x167)],'workerId':_0x770f02[_0x34ee6d(0x15b)]});return;}if(_0x770f02['cleanup']){await K();return;}await ne(_0x770f02);}var oe=process.env.NODE_ENV===_0x5b0762(0x1ad)||!!process.env.JEST_WORKER_ID;oe||te()['catch'](_0x1632e0=>{const _0x2302a3=_0x5b0762;console[_0x2302a3(0x1d7)](_0x1632e0[_0x2302a3(0x1e2)]||_0x1632e0[_0x2302a3(0x161)]||_0x1632e0),process['exit'](0x1);});export{G as IMPLICIT_STDIN_IDLE_MS,te as main,x as parseArgs,B as readCliVersion,F as resolvePrompt};
2
+ const _0x203660=_0x2bc1;function _0x2bc1(_0x5eb10a,_0x2484b7){_0x5eb10a=_0x5eb10a-0x149;const _0x47bc5c=_0x47bc();let _0x2bc1a7=_0x47bc5c[_0x5eb10a];return _0x2bc1a7;}(function(_0x3cdbea,_0x45b180){const _0x13bdf0=_0x2bc1,_0x50d4aa=_0x3cdbea();while(!![]){try{const _0x830a13=-parseInt(_0x13bdf0(0x1b9))/0x1+-parseInt(_0x13bdf0(0x1ee))/0x2*(parseInt(_0x13bdf0(0x16e))/0x3)+-parseInt(_0x13bdf0(0x160))/0x4+-parseInt(_0x13bdf0(0x191))/0x5+-parseInt(_0x13bdf0(0x1f4))/0x6+parseInt(_0x13bdf0(0x1ad))/0x7*(-parseInt(_0x13bdf0(0x17a))/0x8)+parseInt(_0x13bdf0(0x159))/0x9;if(_0x830a13===_0x45b180)break;else _0x50d4aa['push'](_0x50d4aa['shift']());}catch(_0x1f5704){_0x50d4aa['push'](_0x50d4aa['shift']());}}}(_0x47bc,0x3f8ba));const __dirname=import.meta.dirname;import _0x34a65f from'fs';import _0x547328 from'path';import{DelegateAgent as _0xf0320,InteropProcess as _0x1839de,buildDelegateServiceUrl as _0x53eb27,getAuthFilePath as _0x17ca9d,listTenants as _0x2455fb,loadAndRefreshAuth as _0x54275c,loadAndRefreshSdkLogin as _0x3b7ec8,runHostCommand as _0x176147,runLoginFlow as _0x447a5d,saveAuthData as _0x38a352,switchTenant as _0x53ab71}from'@uipath/delegate-sdk';var m={'alpha':_0x203660(0x1ab),'staging':_0x203660(0x199),'production':_0x203660(0x1b7)},P=[_0x203660(0x193),_0x203660(0x1b0),_0x203660(0x189),_0x203660(0x18d),_0x203660(0x1bc),_0x203660(0x1dc)];function x(_0x1f88cc){const _0x3fe376=_0x203660;let _0x1f962f={'subcommand':'','prompt':'','keepAlive':!0x1,'cleanup':!0x1,'headless':!0x1,'noConnections':!0x1,'noSecurity':!0x1,'quiet':!0x1,'preloadSkills':[],'help':!0x1,'version':!0x1};P[_0x3fe376(0x1b2)](_0x1f88cc[0x0])&&(_0x1f962f[_0x3fe376(0x19a)]=_0x1f88cc[0x0],_0x1f88cc=_0x1f88cc[_0x3fe376(0x153)](0x1));let _0x2af127=[];for(let _0x8d86a5=0x0;_0x8d86a5<_0x1f88cc[_0x3fe376(0x1e4)];_0x8d86a5++){let _0x2d9a21=_0x1f88cc[_0x8d86a5];switch(_0x2d9a21){case'--keep-alive':_0x1f962f[_0x3fe376(0x1ce)]=!0x0;break;case _0x3fe376(0x192):_0x1f962f[_0x3fe376(0x1d3)]=!0x0;break;case _0x3fe376(0x16f):_0x1f962f[_0x3fe376(0x14e)]=!0x0;break;case'--no-connections':_0x1f962f[_0x3fe376(0x1e5)]=!0x0;break;case _0x3fe376(0x16a):_0x1f962f[_0x3fe376(0x174)]=!0x0;break;case'--quiet':case'-q':_0x1f962f[_0x3fe376(0x1cb)]=!0x0;break;case _0x3fe376(0x1e1):_0x1f962f[_0x3fe376(0x1ec)]=_0x1f88cc[++_0x8d86a5];break;case _0x3fe376(0x1a3):_0x1f962f[_0x3fe376(0x1a4)]=_0x1f88cc[++_0x8d86a5];break;case _0x3fe376(0x152):_0x1f962f[_0x3fe376(0x1c1)]=_0x1f88cc[++_0x8d86a5];break;case _0x3fe376(0x167):_0x1f962f[_0x3fe376(0x156)]=_0x1f88cc[++_0x8d86a5];break;case _0x3fe376(0x14b):_0x1f962f[_0x3fe376(0x1d7)]=_0x1f88cc[++_0x8d86a5];break;case'--preload-skill':{let _0x170f5c=_0x1f88cc[++_0x8d86a5];(!_0x170f5c||_0x170f5c[_0x3fe376(0x1e8)]('--'))&&(console[_0x3fe376(0x1dd)](_0x3fe376(0x188)),process[_0x3fe376(0x16c)](0x2)),_0x1f962f['preloadSkills']['push'](_0x170f5c);break;}case _0x3fe376(0x172):{let _0x308504=_0x1f88cc[++_0x8d86a5];(!_0x308504||_0x308504[_0x3fe376(0x1e8)]('--'))&&(console[_0x3fe376(0x1dd)](_0x3fe376(0x14f)),process[_0x3fe376(0x16c)](0x2)),_0x1f962f[_0x3fe376(0x1b0)]=_0x308504;break;}case _0x3fe376(0x1c8):{let _0x3a64d1=_0x1f88cc[++_0x8d86a5];['alpha',_0x3fe376(0x18b),'production','localhost'][_0x3fe376(0x1b2)](_0x3a64d1)||(console[_0x3fe376(0x1dd)](_0x3fe376(0x175)+_0x3a64d1+_0x3fe376(0x18f)),process[_0x3fe376(0x16c)](0x2)),_0x1f962f[_0x3fe376(0x1cd)]=_0x3a64d1;break;}case'-h':case _0x3fe376(0x170):_0x1f962f[_0x3fe376(0x1a2)]=!0x0;break;case'-v':case _0x3fe376(0x1a7):_0x1f962f[_0x3fe376(0x176)]=!0x0;break;default:_0x2d9a21['startsWith']('--')&&(console[_0x3fe376(0x1dd)](_0x3fe376(0x182)+_0x2d9a21),process['exit'](0x2)),_0x2af127[_0x3fe376(0x1e2)](_0x2d9a21);}}return _0x1f962f[_0x3fe376(0x1b0)]!==void 0x0&&_0x1f962f[_0x3fe376(0x19a)]!=='login'&&(console[_0x3fe376(0x1dd)](_0x3fe376(0x186)),process[_0x3fe376(0x16c)](0x2)),_0x1f962f[_0x3fe376(0x14c)]=_0x2af127[_0x3fe376(0x185)]('\x20'),_0x1f962f;}function y(_0x382b6a,_0x3b2178,_0x752dc9){const _0x438e44=_0x203660;if(_0x752dc9)return _0x752dc9;if(process.env.BACKEND_URL)return process.env.BACKEND_URL;if(!_0x382b6a){if(_0x3b2178?.[_0x438e44(0x1d8)]&&_0x3b2178?.['orgLogicalName']&&_0x3b2178?.[_0x438e44(0x16b)])return _0x53eb27(_0x3b2178['baseUrl'],_0x3b2178['orgLogicalName'],_0x3b2178[_0x438e44(0x16b)]);throw new Error(_0x438e44(0x17e));}if(_0x382b6a===_0x438e44(0x15b))return'http://localhost:5002';let _0x5e2789=m[_0x382b6a],_0x4f1acd=_0x3b2178?.['orgLogicalName'],_0x252402=_0x3b2178?.['tenantName'];if(!_0x4f1acd||!_0x252402)throw new Error(_0x438e44(0x1b3)+_0x382b6a+'\x20needs\x20org/tenant\x20slugs.\x20Either:\x0a\x20\x20-\x20run\x20`delegate-cli\x20login\x20--env\x20'+_0x382b6a+_0x438e44(0x1a6));return _0x53eb27(_0x5e2789,_0x4f1acd,_0x252402);}function M(){const _0x502c3d=_0x203660;let _0x15deac=_0x502c3d(0x1bb)[_0x502c3d(0x197)]();console['log'](_0x15deac);}function B(){const _0x2ca875=_0x203660;try{return JSON[_0x2ca875(0x17d)](_0x34a65f[_0x2ca875(0x177)](_0x547328[_0x2ca875(0x185)](__dirname,'..',_0x2ca875(0x14a)),_0x2ca875(0x1ae)))['version']||_0x2ca875(0x1c0);}catch{return'unknown';}}var G=0x7d0;async function A(_0x9669f9,_0x33513c){const _0x184a58=_0x203660;let _0x5f2ad5=_0x33513c?[_0x33513c]:[];for await(let _0x27371b of _0x9669f9)_0x5f2ad5[_0x184a58(0x1e2)](Buffer[_0x184a58(0x1f0)](_0x27371b));return Buffer[_0x184a58(0x1f5)](_0x5f2ad5)[_0x184a58(0x1c9)](_0x184a58(0x1ae))[_0x184a58(0x197)]();}function q(_0x59d26c,_0x3dda43){return new Promise(_0x45c10b=>{const _0x3c7fd2=_0x2bc1;let _0x2b32db=_0x12af25=>{const _0x3ae6dd=_0x2bc1;clearTimeout(_0x186200),_0x59d26c[_0x3ae6dd(0x157)](_0x3ae6dd(0x1f2),_0x3b9d89),_0x59d26c['off'](_0x3ae6dd(0x194),_0xa6f435),_0x59d26c[_0x3ae6dd(0x157)]('error',_0xa6f435),_0x59d26c[_0x3ae6dd(0x1d1)](),_0x45c10b(_0x12af25);},_0x3b9d89=_0x2e3aad=>_0x2b32db(Buffer[_0x3c7fd2(0x1f0)](_0x2e3aad)),_0xa6f435=()=>_0x2b32db(null),_0x186200=setTimeout(()=>_0x2b32db(null),_0x3dda43);_0x59d26c['on']('data',_0x3b9d89),_0x59d26c['on']('end',_0xa6f435),_0x59d26c['on']('error',_0xa6f435),_0x59d26c[_0x3c7fd2(0x154)]();});}async function F(_0x59299b,_0x5dbbaf,_0x3ad473=G){let _0x37663c=_0x59299b==='-';if(!_0x37663c&&_0x59299b)return _0x59299b;if(!_0x37663c&&_0x5dbbaf['isTTY'])return'';if(_0x37663c)return A(_0x5dbbaf,null);let _0x183e56=await q(_0x5dbbaf,_0x3ad473);return _0x183e56?A(_0x5dbbaf,_0x183e56):'';}function v(){const _0x5ec814=_0x203660;return _0x547328[_0x5ec814(0x185)](process.env.HOME||process.env.USERPROFILE||'',_0x5ec814(0x18c),_0x5ec814(0x1b1));}function f(_0x39d956){const _0x39ac58=_0x203660;try{let _0x2b0b92=JSON[_0x39ac58(0x17d)](_0x34a65f['readFileSync'](_0x39d956,_0x39ac58(0x1ae)));return!_0x2b0b92[_0x39ac58(0x1d6)]||!_0x2b0b92['tenantId']||!_0x2b0b92[_0x39ac58(0x179)]?null:_0x2b0b92;}catch{return null;}}function j(){let _0x383a77=[{'file':_0x17ca9d(),'isDesktopFallback':!0x1},{'file':v(),'isDesktopFallback':!0x0}];for(let _0x290b7e of _0x383a77){let _0x4c953a=f(_0x290b7e['file']);if(_0x4c953a)return{..._0x290b7e,'auth':_0x4c953a};}return null;}async function z(){const _0x4b2fe2=_0x203660;let _0x1338ff=_0x17ca9d();if(!_0x34a65f[_0x4b2fe2(0x1de)](_0x1338ff)){let _0x80f962=v();console[_0x4b2fe2(0x163)](f(_0x80f962)?_0x4b2fe2(0x171)+_0x80f962+_0x4b2fe2(0x1bf):_0x4b2fe2(0x1e6));return;}_0x34a65f[_0x4b2fe2(0x14d)](_0x1338ff),console[_0x4b2fe2(0x163)](_0x4b2fe2(0x1a5)+_0x1338ff);}async function H(){const _0x21637b=_0x203660;let _0x2bf765=k(),_0x3df902,_0x2eab09;if(_0x2bf765)_0x3df902=_0x2bf765,_0x2eab09='environment\x20variables\x20(AUTH_TOKEN/TENANT_ID/ORG_ID)';else{let _0x346ca9=j();if(!_0x346ca9)throw new Error(N);_0x3df902=_0x346ca9[_0x21637b(0x19c)],_0x2eab09=_0x346ca9['isDesktopFallback']?_0x346ca9[_0x21637b(0x1c3)]+_0x21637b(0x1e3):_0x346ca9[_0x21637b(0x1c3)];}let _0x494794=[_0x21637b(0x19f)+_0x2eab09,'Base\x20URL:\x20\x20\x20\x20\x20'+(_0x3df902[_0x21637b(0x1d8)]??'unknown'),_0x21637b(0x1be)+(_0x3df902[_0x21637b(0x1af)]??'unknown\x20slug')+'\x20('+_0x3df902['organizationId']+')',_0x21637b(0x1cf)+(_0x3df902['tenantName']??_0x21637b(0x173))+'\x20('+_0x3df902['tenantId']+')'];if(_0x3df902[_0x21637b(0x187)]){let _0x4febba=_0x3df902[_0x21637b(0x187)]-Math[_0x21637b(0x1ed)](Date[_0x21637b(0x19d)]()/0x3e8),_0x1871e3=new Date(_0x3df902[_0x21637b(0x187)]*0x3e8)[_0x21637b(0x1c7)]();_0x494794[_0x21637b(0x1e2)](_0x4febba>0x0?_0x21637b(0x165)+_0x1871e3+'\x20(in\x20'+Math[_0x21637b(0x151)](_0x4febba/0x3c)+'\x20min)':_0x21637b(0x169)+_0x1871e3);}process[_0x21637b(0x180)][_0x21637b(0x1d0)](_0x494794['join']('\x0a')+'\x0a');}var N=_0x203660(0x1f1);function k(){return process.env.AUTH_TOKEN&&process.env.TENANT_ID&&process.env.ORG_ID?{'accessToken':process.env.AUTH_TOKEN,'tenantId':process.env.TENANT_ID,'organizationId':process.env.ORG_ID,'orgLogicalName':process.env.ORG_SLUG,'tenantName':process.env.TENANT_SLUG,'baseUrl':process.env.UIPATH_BASE_URL}:null;}async function E(){let _0x390e9f=k();if(_0x390e9f)return _0x390e9f;let _0x3f1180=await _0x54275c();if(_0x3f1180)return _0x3f1180;throw new Error(N);}async function K(){const _0x21eb7f=_0x203660;await new _0x1839de()[_0x21eb7f(0x17c)]({'force':!0x0}),console[_0x21eb7f(0x163)]('Interop\x20stopped\x20(if\x20it\x20was\x20running).');}var W=_0x203660(0x1ca);function U(_0x348181,_0x54b551,_0x355342){const _0x48cee8=_0x203660;_0x348181?process['stderr'][_0x48cee8(0x1d0)](_0x48cee8(0x1c2)+_0x348181+_0x48cee8(0x1a0)+_0x355342+'\x0a'):!_0x54b551&&!process.env.BACKEND_URL&&process[_0x48cee8(0x161)][_0x48cee8(0x1d0)](_0x48cee8(0x1d4)+_0x355342+'\x0a');}async function J(_0x403e61){const _0x3a6741=_0x203660;let _0x27b5eb=await E(),_0x402d7d=y(_0x403e61['env'],_0x27b5eb,_0x403e61[_0x3a6741(0x1ec)]);U(_0x403e61[_0x3a6741(0x1cd)],_0x403e61[_0x3a6741(0x1ec)],_0x402d7d);let _0x441f38=_0x402d7d+_0x3a6741(0x1a1),_0x21921e={'Authorization':_0x3a6741(0x1b6)+_0x27b5eb[_0x3a6741(0x1d6)],'X-UiPath-ConsumingProductId':W};_0x27b5eb[_0x3a6741(0x1c6)]&&(_0x21921e[_0x3a6741(0x1aa)]=_0x27b5eb[_0x3a6741(0x1c6)]),_0x27b5eb['organizationId']&&(_0x21921e['X-Uipath-Organizationid']=_0x27b5eb['organizationId']);let _0x2cffab=await fetch(_0x441f38,{'headers':_0x21921e});if(!_0x2cffab['ok'])throw new Error(_0x3a6741(0x1da)+_0x441f38+_0x3a6741(0x1bd)+_0x2cffab['status']+'\x20'+_0x2cffab[_0x3a6741(0x1c5)]);let _0x5645ca=(await _0x2cffab[_0x3a6741(0x1e9)]())?.[_0x3a6741(0x1b4)],_0x18b7d9=Array['isArray'](_0x5645ca)?_0x5645ca:_0x5645ca&&typeof _0x5645ca==_0x3a6741(0x162)?Object[_0x3a6741(0x1b5)](_0x5645ca)[_0x3a6741(0x149)](([_0x57aa58,_0x1a77bc])=>({'id':_0x57aa58,'name':_0x1a77bc})):[];if(_0x18b7d9[_0x3a6741(0x1e4)]===0x0){process[_0x3a6741(0x161)]['write'](_0x3a6741(0x17b));return;}process[_0x3a6741(0x180)][_0x3a6741(0x1d0)](_0x3a6741(0x18a)+_0x18b7d9['length']+_0x3a6741(0x1a8));for(let _0x56a6e8 of _0x18b7d9){let _0x245e99=_0x56a6e8[_0x3a6741(0x1d5)]&&_0x56a6e8[_0x3a6741(0x1d5)]!==_0x56a6e8['id']?'\x20('+_0x56a6e8['name']+')':'';process[_0x3a6741(0x180)][_0x3a6741(0x1d0)]('\x20\x20'+_0x56a6e8['id']+_0x245e99+'\x0a'),_0x56a6e8['description']&&process['stdout'][_0x3a6741(0x1d0)](_0x3a6741(0x1e0)+_0x56a6e8[_0x3a6741(0x1e7)]+'\x0a');}process['stdout'][_0x3a6741(0x1d0)]('\x0aUse\x20with:\x20delegate-cli\x20--model\x20<id>\x20\x22<prompt>\x22\x0a');}async function X(_0x2608f3){const _0x3261f2=_0x203660;_0x2608f3['env']===_0x3261f2(0x15b)&&(console[_0x3261f2(0x1dd)]('--env\x20localhost\x20has\x20no\x20OAuth\x20flow;\x20pick\x20alpha,\x20staging,\x20or\x20production.'),process[_0x3261f2(0x16c)](0x2));let _0x5931d9=f(_0x17ca9d());if(_0x2608f3[_0x3261f2(0x1cd)]){let _0x2d903b=_0x2608f3[_0x3261f2(0x1cd)];await _0x447a5d({'env':_0x2d903b,'tenant':_0x2608f3[_0x3261f2(0x1b0)]??L(_0x5931d9,m[_0x2d903b])});return;}if(_0x5931d9?.[_0x3261f2(0x1d8)]){await _0x447a5d({'baseUrl':_0x5931d9['baseUrl'],'tenant':_0x2608f3[_0x3261f2(0x1b0)]??_0x5931d9[_0x3261f2(0x16b)]});return;}console[_0x3261f2(0x1dd)]('First\x20login\x20requires\x20--env.\x20Usage:\x20delegate-cli\x20login\x20--env\x20<alpha|staging|production>'),process[_0x3261f2(0x16c)](0x2);}function L(_0x330f52,_0x31e6dc){return _0x330f52?.['baseUrl']&&V(_0x330f52['baseUrl'],_0x31e6dc)?_0x330f52['tenantName']:void 0x0;}function _0x47bc(){const _0xdd0966=['Bearer\x20','https://cloud.uipath.com','No\x20CLI\x20login\x20to\x20switch:\x20the\x20CLI\x20is\x20authenticating\x20via\x20the\x20Delegate\x20desktop\x20app\x27s\x20','95905ZnjIxp','Tenants\x20of\x20','\x0adelegate-cli\x20β€”\x20Delegate\x20agent\x20CLI\x0a\x0aUsage:\x0a\x20\x20delegate-cli\x20[flags]\x20\x22<prompt>\x22\x20\x20\x20\x20\x20\x20Send\x20prompt\x20to\x20the\x20agent\x0a\x20\x20delegate-cli\x20[flags]\x20-\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Read\x20the\x20prompt\x20from\x20stdin\x20(also\x20implied\x20when\x20stdin\x20is\x20piped)\x0a\x20\x20delegate-cli\x20login\x20[--env\x20NAME]\x20[--tenant\x20NAME]\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20OAuth\x20browser\x20login\x20β†’\x20~/.aria/sdk-auth.json.\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20--env\x20required\x20on\x20FIRST\x20login;\x20afterwards\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20defaults\x20to\x20the\x20saved\x20login\x27s\x20cloud.\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20--tenant\x20picks\x20a\x20tenant\x20by\x20name;\x20without\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20it\x20a\x20re-login\x20keeps\x20the\x20saved\x20tenant\x0a\x20\x20delegate-cli\x20tenant\x20[NAME]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20List\x20the\x20organization\x27s\x20tenants,\x20or\x20switch\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20the\x20saved\x20login\x20to\x20NAME\x20(no\x20browser)\x0a\x20\x20delegate-cli\x20logout\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Remove\x20the\x20saved\x20CLI\x20login\x0a\x20\x20delegate-cli\x20whoami\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20the\x20current\x20login\x20(org,\x20tenant,\x20token\x20expiry)\x0a\x20\x20delegate-cli\x20models\x20[--env\x20NAME]\x20\x20\x20\x20\x20List\x20available\x20LLM\x20models\x20for\x20the\x20current\x20tenant\x0a\x20\x20delegate-cli\x20host\x20[flags]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Run\x20this\x20PC\x20as\x20a\x20remote\x20worker\x20until\x20Ctrl+C\x0a\x20\x20delegate-cli\x20host\x20install\x20[flags]\x20\x20\x20\x20Auto-start\x20the\x20host\x20at\x20login\x20(macOS\x20LaunchAgent\x20/\x20Windows\x20Scheduled\x20Task)\x0a\x20\x20delegate-cli\x20host\x20uninstall\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Remove\x20auto-start\x0a\x20\x20delegate-cli\x20host\x20status\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20auto-start\x20state\x0a\x20\x20delegate-cli\x20--cleanup\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Stop\x20running\x20interop\x0a\x0aFlags:\x0a\x20\x20--env\x20NAME\x20\x20\x20\x20\x20\x20\x20\x20alpha\x20|\x20staging\x20|\x20production\x20|\x20localhost\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Composes\x20backend\x20URL\x20from\x20saved\x20auth\x20(org/tenant\x20slugs).\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Omitted\x20β†’\x20the\x20cloud\x20you\x20logged\x20into\x20(delegate-cli\x20login).\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20localhost\x20β†’\x20http://localhost:5002.\x20No\x20saved\x20login\x20and\x20no\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20--env/--backend/BACKEND_URL\x20is\x20an\x20error\x20β€”\x20never\x20a\x20guess.\x0a\x20\x20--backend\x20URL\x20\x20\x20\x20\x20Full\x20backend\x20URL\x20β€”\x20escape\x20hatch\x20overrides\x20--env\x0a\x20\x20--tenant\x20NAME\x20\x20\x20\x20\x20(login)\x20Tenant\x20to\x20sign\x20into,\x20by\x20name\x20(case-insensitive).\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Default:\x20the\x20saved\x20login\x27s\x20tenant\x20on\x20that\x20cloud,\x20else\x20the\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20org\x27s\x20first\x20tenant.\x20Later:\x20delegate-cli\x20tenant\x20<name>\x0a\x20\x20--model\x20NAME\x20\x20\x20\x20\x20\x20LLM\x20model\x20id\x20(e.g.\x20claude_sonnet_5,\x20kimi_k2_7_code).\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Default:\x20gemini_3_6_flash.\x20Also\x20settable\x20via\x20MODEL\x20env\x20var.\x0a\x20\x20--keep-alive\x20\x20\x20\x20\x20\x20Reuse/leave\x20interop\x20running\x20across\x20invocations\x0a\x20\x20--headless\x20\x20\x20\x20\x20\x20\x20\x20Skip\x20interop\x20(text-only\x20prompts)\x0a\x20\x20--no-connections\x20\x20Disable\x20orchestrator\x20ConnectionService\x20(silences\x20404\x20warnings)\x0a\x20\x20--no-security\x20\x20\x20\x20\x20Disable\x20tool\x20security\x20wrapper\x20(use\x20only\x20for\x20debugging)\x0a\x20\x20--preload-skill\x20NAME\x20\x20Preload\x20a\x20skill\x20into\x20the\x20session\x20(repeatable).\x20The\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20skill\x27s\x20content\x20is\x20attached\x20before\x20the\x20first\x20model\x20turn\x20β€”\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20same\x20mechanism\x20as\x20project\x20preloaded\x20skills\x20in\x20the\x20app\x0a\x20\x20--runner-url\x20URL\x20\x20(host)\x20Runner\x20worker\x20WS\x20URL.\x20Required;\x20or\x20CONTROL_PLANE_WS_URL\x20env\x0a\x20\x20--interop\x20PATH\x20\x20\x20\x20(host)\x20Interop\x20binary\x20path;\x20or\x20INTEROP_EXECUTABLE_PATH\x20env.\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Absent\x20β†’\x20registration/discovery\x20only,\x20tool\x20execution\x20disabled\x0a\x20\x20--worker-id\x20ID\x20\x20\x20\x20(host)\x20Stable\x20worker\x20identity;\x20or\x20WORKER_ID\x20env.\x20Default:\x20hostname\x0a\x20\x20-q,\x20--quiet\x20\x20\x20\x20\x20\x20\x20Suppress\x20πŸ€”\x20thinking\x20output\x20to\x20stderr\x0a\x20\x20-h,\x20--help\x20\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x0a\x20\x20-v,\x20--version\x20\x20\x20\x20\x20Print\x20the\x20installed\x20CLI\x20version\x0a\x0aAuth:\x20prompts\x20auto-retry\x20on\x20401\x20by\x20opening\x20the\x20browser\x20to\x20re-login\x20(TTY\x20only).\x0a','logout','\x20β†’\x20','Organization:\x20','\x20β€”\x20sign\x20out\x20in\x20the\x20Delegate\x20app\x20to\x20clear\x20that.','unknown','runnerUrl','[env=','file','content','statusText','tenantId','toISOString','--env','toString','799f56b8-4aed-4a0f-8640-659dae4a9e0e','quiet','sendMessage','env','keepAlive','Tenant:\x20\x20\x20\x20\x20\x20\x20','write','pause','tool','cleanup','[saved\x20login]\x20Backend\x20URL:\x20','name','accessToken','workerId','baseUrl','stdin','GET\x20','preloadSkills','whoami','error','existsSync','The\x20saved\x20CLI\x20login\x20could\x20not\x20be\x20refreshed.\x20Run\x20`delegate-cli\x20login`\x20again.','\x20\x20\x20\x20','--backend','push','\x20(Delegate\x20desktop\x20app\x20fallback)','length','noConnections','No\x20CLI\x20login\x20found\x20β€”\x20nothing\x20to\x20remove.','description','startsWith','json','πŸ”§\x20',',\x20whose\x20tenant\x20is\x20chosen\x20in\x20the\x20app.\x20Run\x20`delegate-cli\x20login\x20--env\x20<env>`\x20for\x20a\x20CLI\x20login\x20of\x20your\x20own.','backendUrl','floor','72154auNzIU','thinking','from','No\x20auth\x20found.\x20Set\x20AUTH_TOKEN/TENANT_ID/ORG_ID\x20env\x20vars,\x20or\x20run\x20`delegate-cli\x20login\x20--env\x20<alpha|staging|production>`\x20(interactive\x20browser\x20OAuth)\x20first.','data','stack','700560vSxYdk','concat','map','package.json','--worker-id','prompt','rmSync','headless','--tenant\x20requires\x20a\x20tenant\x20name.','once','round','--runner-url','slice','resume','toolName','interopPath','off','origin','15182550lptJJt','onEvent','localhost','finally','No\x20CLI\x20login\x20found.\x20Run\x20`delegate-cli\x20login\x20--env\x20<alpha|staging|production>`\x20first.','lastType','Missing\x20prompt.\x20Pass\x20it\x20as\x20an\x20argument,\x20pipe\x20it\x20via\x20stdin,\x20or\x20run\x20`delegate-cli\x20--help`.','605228SlXHDF','stderr','object','log','initialize','Token:\x20\x20\x20\x20\x20\x20\x20\x20expires\x20','\x0aπŸ€”\x20','--interop','response','Token:\x20\x20\x20\x20\x20\x20\x20\x20expired\x20','--no-security','tenantName','exit','SIGINT','9fgKTYJ','--headless','--help','No\x20CLI\x20login\x20found.\x20Note:\x20the\x20CLI\x20is\x20currently\x20authenticating\x20via\x20the\x20Delegate\x20desktop\x20app\x27s\x20','--tenant','unknown\x20slug','noSecurity','Invalid\x20--env:\x20','version','readFileSync','\x20(current)','organizationId','72blnBRU','No\x20models\x20available\x20for\x20this\x20product/tenant.\x0a','stop','parse','No\x20backend\x20selected.\x20Run\x20`delegate-cli\x20login\x20--env\x20<env>`\x20first\x20(commands\x20then\x20default\x20to\x20that\x20cloud),\x20or\x20pass\x20--env\x20<alpha|staging|production|localhost>\x20or\x20--backend\x20<url>\x20(or\x20set\x20BACKEND_URL).','\x0aStopping…\x20(Ctrl+C\x20again\x20to\x20force\x20exit)\x0a','stdout','isTTY','Unknown\x20flag:\x20','βœ“\x20Done\x0a','done','join','--tenant\x20applies\x20to\x20`delegate-cli\x20login`\x20only.\x20Switch\x20tenants\x20with:\x20delegate-cli\x20tenant\x20<name>','expiresAt','--preload-skill\x20requires\x20a\x20skill\x20name.','models','\x0aAvailable\x20models\x20(','staging','.aria','host','message','.\x20Use\x20alpha\x20|\x20staging\x20|\x20production\x20|\x20localhost.','tool_call','2481420mEasmy','--cleanup','login','end','argv','destroy','trim','status','https://staging.uipath.com','subcommand','test','auth','now','Tenant\x20not\x20switched:\x20could\x20not\x20write\x20','Source:\x20\x20\x20\x20\x20\x20\x20',']\x20Backend\x20URL:\x20','/v1/config','help','--model','model','Removed\x20','`\x20(writes\x20slugs\x20to\x20~/.aria/sdk-auth.json),\x20or\x0a\x20\x20-\x20set\x20ORG_SLUG\x20and\x20TENANT_SLUG\x20env\x20vars\x20alongside\x20ORG_ID/TENANT_ID,\x20or\x0a\x20\x20-\x20pass\x20the\x20full\x20URL\x20via\x20--backend\x20(overrides\x20--env).','--version','):\x0a\x0a',';\x20the\x20saved\x20login\x20still\x20uses\x20','X-Uipath-Tenantid','https://alpha.uipath.com','Auth\x20comes\x20from\x20AUTH_TOKEN/TENANT_ID/ORG_ID\x20β€”\x20set\x20TENANT_ID\x20and\x20TENANT_SLUG\x20to\x20change\x20the\x20tenant.','356363RPEYPU','utf-8','orgLogicalName','tenant','auth.json','includes','--env\x20','MODELS','entries'];_0x47bc=function(){return _0xdd0966;};return _0x47bc();}function V(_0xcf9d2f,_0x952345){const _0x28498d=_0x203660;try{return new URL(_0xcf9d2f)[_0x28498d(0x158)]===new URL(_0x952345)[_0x28498d(0x158)];}catch{return!0x1;}}async function Y(_0x3b96a4){const _0x30dc02=_0x203660;k()&&(console[_0x30dc02(0x1dd)](_0x30dc02(0x1ac)),process[_0x30dc02(0x16c)](0x2));let _0xdf7950=await _0x3b7ec8();if(_0xdf7950||(console['error'](Q()),process[_0x30dc02(0x16c)](0x2)),_0x3b96a4['trim']()){let _0x2b94e1=await _0x53ab71(_0xdf7950,_0x3b96a4);_0x38a352(_0x2b94e1)||(console[_0x30dc02(0x1dd)](_0x30dc02(0x19e)+_0x17ca9d()+_0x30dc02(0x1a9)+_0xdf7950[_0x30dc02(0x16b)]+'.'),process['exit'](0x1)),console[_0x30dc02(0x163)]('Tenant:\x20'+_0x2b94e1[_0x30dc02(0x16b)]+'\x20('+_0x2b94e1[_0x30dc02(0x1c6)]+')\x20β€”\x20saved\x20to\x20'+_0x17ca9d());return;}Z(await _0x2455fb(_0xdf7950),_0xdf7950);}function Q(){const _0x17e266=_0x203660;if(_0x34a65f[_0x17e266(0x1de)](_0x17ca9d()))return _0x17e266(0x1df);let _0x43bdc6=v();return f(_0x43bdc6)?_0x17e266(0x1b8)+_0x43bdc6+_0x17e266(0x1eb):_0x17e266(0x15d);}function Z(_0x326273,_0x4124be){const _0x4ed0b2=_0x203660;let _0x1fcf69=_0x326273[_0x4ed0b2(0x149)](_0x18d0f8=>_0x18d0f8['id']===_0x4124be['tenantId']?'*\x20'+_0x18d0f8[_0x4ed0b2(0x1d5)]+_0x4ed0b2(0x178):'\x20\x20'+_0x18d0f8[_0x4ed0b2(0x1d5)]);process['stdout'][_0x4ed0b2(0x1d0)](_0x4ed0b2(0x1ba)+(_0x4124be[_0x4ed0b2(0x1af)]??_0x4124be[_0x4ed0b2(0x179)])+':\x0a'+_0x1fcf69['join']('\x0a')+'\x0a'),_0x326273['length']>0x1&&process['stdout'][_0x4ed0b2(0x1d0)]('Switch\x20with:\x20delegate-cli\x20tenant\x20<name>\x0a');}function ee(_0x4985df){const _0x4639a9=_0x203660;return _0x4985df?.[_0x4639a9(0x168)]?.[_0x4639a9(0x198)]===0x191||/401/[_0x4639a9(0x19b)](String(_0x4985df?.['message']??''));}var a={'lastType':null,'quiet':!0x1},S=_0x13fdf6=>{const _0x45cc7b=_0x203660;switch(_0x13fdf6['type']){case'thinking':_0x13fdf6[_0x45cc7b(0x1c4)]&&!a[_0x45cc7b(0x1cb)]&&(a['lastType']!=='thinking'&&process['stderr'][_0x45cc7b(0x1d0)](_0x45cc7b(0x166)),process[_0x45cc7b(0x161)][_0x45cc7b(0x1d0)](_0x13fdf6['content']),a['lastType']=_0x45cc7b(0x1ef));break;case _0x45cc7b(0x190):a[_0x45cc7b(0x15e)]!==null&&process['stderr'][_0x45cc7b(0x1d0)]('\x0a'),process[_0x45cc7b(0x161)][_0x45cc7b(0x1d0)](_0x45cc7b(0x1ea)+(_0x13fdf6[_0x45cc7b(0x155)]??_0x45cc7b(0x1d2))+'\x0a'),a[_0x45cc7b(0x15e)]=_0x45cc7b(0x190);break;case _0x45cc7b(0x18e):_0x13fdf6[_0x45cc7b(0x1c4)]&&(a[_0x45cc7b(0x15e)]!==_0x45cc7b(0x18e)&&a['lastType']!==null&&process[_0x45cc7b(0x180)][_0x45cc7b(0x1d0)]('\x0a'),process[_0x45cc7b(0x180)]['write'](_0x13fdf6[_0x45cc7b(0x1c4)]),a['lastType']=_0x45cc7b(0x18e));break;case _0x45cc7b(0x1dd):a[_0x45cc7b(0x15e)]!==null&&process[_0x45cc7b(0x161)][_0x45cc7b(0x1d0)]('\x0a'),process[_0x45cc7b(0x161)][_0x45cc7b(0x1d0)]('βœ—\x20'+(_0x13fdf6['error']??_0x13fdf6[_0x45cc7b(0x18e)]??'error')+'\x0a'),a[_0x45cc7b(0x15e)]=_0x45cc7b(0x1dd);break;case'done':(a[_0x45cc7b(0x15e)]===_0x45cc7b(0x18e)||a[_0x45cc7b(0x15e)]==='thinking')&&process[_0x45cc7b(0x180)][_0x45cc7b(0x1d0)]('\x0a'),process[_0x45cc7b(0x161)][_0x45cc7b(0x1d0)](_0x45cc7b(0x183)),a[_0x45cc7b(0x15e)]=_0x45cc7b(0x184);break;}};async function ne(_0x2a95fd){const _0x2661c7=_0x203660;let _0x213ac1=await F(_0x2a95fd['prompt'],process[_0x2661c7(0x1d9)]);_0x213ac1||(console[_0x2661c7(0x1dd)](_0x2661c7(0x15f)),process[_0x2661c7(0x16c)](0x2)),a[_0x2661c7(0x1cb)]=_0x2a95fd['quiet'];let _0x11d8f1=await E(),_0x3b19ee=new _0xf0320();_0x3b19ee['onEvent'](S);let _0x18cc87=y(_0x2a95fd[_0x2661c7(0x1cd)],_0x11d8f1,_0x2a95fd['backendUrl']);U(_0x2a95fd[_0x2661c7(0x1cd)],_0x2a95fd[_0x2661c7(0x1ec)],_0x18cc87);let _0x1b0dd5={'backendUrl':_0x18cc87,'auth':_0x11d8f1,'enableComputerUse':!_0x2a95fd[_0x2661c7(0x14e)],'autoSpawnInterop':!_0x2a95fd['headless'],'enableConnections':!_0x2a95fd[_0x2661c7(0x1e5)],'enableSecurity':!_0x2a95fd['noSecurity'],'keepInteropAlive':_0x2a95fd[_0x2661c7(0x1ce)],..._0x2a95fd[_0x2661c7(0x1db)][_0x2661c7(0x1e4)]>0x0?{'preloadSkills':_0x2a95fd['preloadSkills']}:{},..._0x2a95fd[_0x2661c7(0x1a4)]||process.env.MODEL?{'model':_0x2a95fd[_0x2661c7(0x1a4)]||process.env.MODEL}:{}},_0xb49273=!0x1,_0x193c1b=!0x1,_0x19a9a4=()=>{const _0x44dbda=_0x2661c7;_0x193c1b&&process['exit'](0x82),_0x193c1b=!0x0,process[_0x44dbda(0x161)][_0x44dbda(0x1d0)](_0x44dbda(0x17f)),_0xb49273?_0x3b19ee[_0x44dbda(0x196)]()[_0x44dbda(0x15c)](()=>process[_0x44dbda(0x16c)](0x82)):process[_0x44dbda(0x16c)](0x82);};process[_0x2661c7(0x150)](_0x2661c7(0x16d),_0x19a9a4),await _0x3b19ee[_0x2661c7(0x164)](_0x1b0dd5),_0xb49273=!0x0;try{await _0x3b19ee[_0x2661c7(0x1cc)](_0x213ac1);}catch(_0x4df326){if(ee(_0x4df326)&&process[_0x2661c7(0x1d9)][_0x2661c7(0x181)]&&_0x2a95fd[_0x2661c7(0x1cd)]!==_0x2661c7(0x15b)&&(_0x2a95fd['env']||_0x11d8f1['baseUrl'])){process[_0x2661c7(0x161)][_0x2661c7(0x1d0)]('\x0a⚠️\x20\x20Auth\x20expired.\x20Opening\x20browser\x20to\x20re-login…\x0a');let _0x5c37ee=await _0x447a5d(_0x2a95fd[_0x2661c7(0x1cd)]?{'env':_0x2a95fd[_0x2661c7(0x1cd)],'tenant':L(_0x11d8f1,m[_0x2a95fd['env']])}:{'baseUrl':_0x11d8f1['baseUrl'],'tenant':_0x11d8f1[_0x2661c7(0x16b)]});await _0x3b19ee['destroy'](),_0x3b19ee=new _0xf0320(),_0x3b19ee[_0x2661c7(0x15a)](S),await _0x3b19ee[_0x2661c7(0x164)]({..._0x1b0dd5,'auth':_0x5c37ee}),await _0x3b19ee[_0x2661c7(0x1cc)](_0x213ac1);}else throw _0x4df326;}finally{process['off'](_0x2661c7(0x16d),_0x19a9a4),await _0x3b19ee[_0x2661c7(0x196)]();}}async function te(){const _0x4f02d9=_0x203660;let _0x1cd223=x(process[_0x4f02d9(0x195)][_0x4f02d9(0x153)](0x2));if(_0x1cd223[_0x4f02d9(0x1a2)]){M();return;}if(_0x1cd223[_0x4f02d9(0x176)]){console['log'](B());return;}if(_0x1cd223['subcommand']==='login'){await X(_0x1cd223);return;}if(_0x1cd223[_0x4f02d9(0x19a)]===_0x4f02d9(0x1b0)){await Y(_0x1cd223[_0x4f02d9(0x14c)]);return;}if(_0x1cd223[_0x4f02d9(0x19a)]===_0x4f02d9(0x1bc)){await z();return;}if(_0x1cd223[_0x4f02d9(0x19a)]==='whoami'){await H();return;}if(_0x1cd223[_0x4f02d9(0x19a)]==='models'){await J(_0x1cd223);return;}if(_0x1cd223[_0x4f02d9(0x19a)]==='host'){await _0x176147(_0x1cd223['prompt'],{'runnerUrl':_0x1cd223[_0x4f02d9(0x1c1)],'backendUrl':_0x1cd223['backendUrl'],'interopPath':_0x1cd223[_0x4f02d9(0x156)],'workerId':_0x1cd223[_0x4f02d9(0x1d7)]});return;}if(_0x1cd223[_0x4f02d9(0x1d3)]){await K();return;}await ne(_0x1cd223);}var oe=process.env.NODE_ENV===_0x203660(0x19b)||!!process.env.JEST_WORKER_ID;oe||te()['catch'](_0x4f19a8=>{const _0x59414f=_0x203660;console['error'](_0x4f19a8[_0x59414f(0x1f3)]||_0x4f19a8[_0x59414f(0x18e)]||_0x4f19a8),process[_0x59414f(0x16c)](0x1);});export{G as IMPLICIT_STDIN_IDLE_MS,te as main,x as parseArgs,B as readCliVersion,F as resolvePrompt};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/delegate-cli",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "UiPath Delegate CLI - drive the Delegate agent from the terminal. Wraps @uipath/delegate-sdk; installing this package pulls the SDK in β€” no separate install.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "commonjs",
@@ -22,7 +22,7 @@
22
22
  "publish:npmjs": "npm publish --@uipath:registry=https://registry.npmjs.org/ --access public --ignore-scripts"
23
23
  },
24
24
  "dependencies": {
25
- "@uipath/delegate-sdk": "0.1.7"
25
+ "@uipath/delegate-sdk": "0.1.8"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "^22.0.0",