@uipath/delegate-cli 0.1.5 → 0.1.7

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/README.md CHANGED
@@ -34,8 +34,13 @@ delegate-cli [flags] "<prompt>" Send a prompt to the agent
34
34
  delegate-cli [flags] - Read the prompt from stdin (also implied when stdin is piped)
35
35
  Explicit `-` waits for EOF; the implicit form gives up after 2 s
36
36
  of silence so a missing prompt errors instead of hanging
37
- delegate-cli login [--env NAME] OAuth browser login (--env required on FIRST login;
38
- afterwards defaults to the saved login's cloud)
37
+ delegate-cli login [--env NAME] [--tenant NAME]
38
+ OAuth browser login (--env required on FIRST login;
39
+ afterwards defaults to the saved login's cloud;
40
+ --tenant picks a tenant by name, otherwise a
41
+ re-login keeps the saved tenant)
42
+ delegate-cli tenant [NAME] List the organization's tenants, or switch the saved
43
+ login to NAME — no browser round-trip
39
44
  delegate-cli logout Remove the saved CLI login
40
45
  delegate-cli whoami Show the current login (org, tenant, token expiry)
41
46
  delegate-cli models [--env NAME] List LLM models available on the tenant
@@ -54,6 +59,7 @@ delegate-cli --help
54
59
  |---|---|---|
55
60
  | `--env <name>` | saved login's cloud | `alpha` / `staging` / `production` / `localhost`. Composes the backend URL from saved org/tenant slugs; localhost → `http://localhost:5002`. Omitted → the cloud you logged into (`delegate-cli login`). With no saved login and no `--backend` / `BACKEND_URL` either, commands error — the CLI never guesses an environment. |
56
61
  | `--backend <url>` | — | Full backend URL — overrides `--env` and `BACKEND_URL`. |
62
+ | `--tenant <name>` | saved login's tenant, else the org's first | (`login` only) Tenant to sign into, matched by name case-insensitively. Without it a re-login keeps the tenant of the saved login on that cloud. An unknown name fails and lists the tenants that exist; on any other command the flag is refused — switch an existing login with `delegate-cli tenant <name>`. |
57
63
  | `--model <id>` | `gemini_3_6_flash` | LLM id (use `delegate-cli models` to discover). Also via `MODEL` env. |
58
64
  | `--headless` | off | Skip interop. Text-only prompts. |
59
65
  | `--keep-alive` | off | Reuse / leave interop running across invocations. Skips the 10–20 s cold start on the next call. |
@@ -132,6 +138,10 @@ Flags/env present at `install` time are persisted into the OS entry.
132
138
 
133
139
  `delegate-cli login --env <env>` runs OAuth PKCE in your browser and saves to `~/.aria/sdk-auth.json`. The first login must name the environment; from then on that cloud is the default — `delegate-cli login` re-logs into it, and prompts/`models` target it unless `--env`/`--backend` say otherwise.
134
140
 
141
+ The browser step only picks the organization (Identity asks when your account belongs to several). The tenant comes from the CLI: the organization's first tenant unless `--tenant <name>` names another, and a re-login on the same cloud keeps the saved tenant. The login output lists the organization's other tenants, and `delegate-cli whoami` shows the active one.
142
+
143
+ To change tenant afterwards, run `delegate-cli tenant <name>` — no browser: tokens are issued per organization, so the command only lists the organization's tenants, matches the name case-insensitively, and rewrites the tenant id and slug in `~/.aria/sdk-auth.json`. `delegate-cli tenant` alone lists the tenants and marks the current one. It works on the CLI's own login only: with `AUTH_TOKEN` env-var auth the tenant is `TENANT_ID`/`TENANT_SLUG`, and the Delegate desktop app's fallback file keeps the tenant chosen in the app.
144
+
135
145
  `delegate-cli whoami` shows the active identity (auth source, org/tenant, token expiry). It is strictly read-only: no backend call, and no token refresh either — so an expired token is reported as expired instead of being silently rotated behind an inspection command. The `Source:` line names the file the credential actually came from, which may be the Delegate desktop app's `~/.aria/auth.json` (the SDK's read-only fallback).
136
146
 
137
147
  `delegate-cli logout` deletes the saved CLI login and never the desktop app's file. When that fallback is what you are authenticating with, it says so rather than reporting nothing to remove — sign out in the Delegate app to clear it.
package/dist/cli.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const _0x49cf1e=_0x254e;(function(_0x52d314,_0x125f95){const _0x31ee13=_0x254e,_0x437dcb=_0x52d314();while(!![]){try{const _0x19703e=parseInt(_0x31ee13(0x1c3))/0x1*(parseInt(_0x31ee13(0x197))/0x2)+-parseInt(_0x31ee13(0x1a4))/0x3*(parseInt(_0x31ee13(0x1b8))/0x4)+-parseInt(_0x31ee13(0x1ab))/0x5*(-parseInt(_0x31ee13(0x1f7))/0x6)+parseInt(_0x31ee13(0x185))/0x7*(parseInt(_0x31ee13(0x1ed))/0x8)+-parseInt(_0x31ee13(0x183))/0x9+parseInt(_0x31ee13(0x1fd))/0xa*(parseInt(_0x31ee13(0x1df))/0xb)+-parseInt(_0x31ee13(0x203))/0xc*(parseInt(_0x31ee13(0x1d1))/0xd);if(_0x19703e===_0x125f95)break;else _0x437dcb['push'](_0x437dcb['shift']());}catch(_0x2a5d98){_0x437dcb['push'](_0x437dcb['shift']());}}}(_0x55d1,0x98c58));const __dirname=import.meta.dirname;import _0x3014ad from'fs';import _0x32396f from'path';import{DelegateAgent as _0x1cd5bb,InteropProcess as _0x3e47ad,buildDelegateServiceUrl as _0x5e1b6b,getAuthFilePath as _0x4799a3,loadAndRefreshAuth as _0x3b77a6,runHostCommand as _0xecfd96,runLoginFlow as _0x2c7266}from'@uipath/delegate-sdk';var I={'alpha':'https://alpha.uipath.com','staging':_0x49cf1e(0x1dc),'production':_0x49cf1e(0x1da)},R=[_0x49cf1e(0x189),'models','host','logout',_0x49cf1e(0x1aa)];function O(_0x11ae69){const _0x5a12d1=_0x49cf1e;let _0xcc1db9={'subcommand':'','prompt':'','keepAlive':!0x1,'cleanup':!0x1,'headless':!0x1,'noConnections':!0x1,'noSecurity':!0x1,'quiet':!0x1,'preloadSkills':[],'help':!0x1,'version':!0x1};R[_0x5a12d1(0x202)](_0x11ae69[0x0])&&(_0xcc1db9[_0x5a12d1(0x200)]=_0x11ae69[0x0],_0x11ae69=_0x11ae69[_0x5a12d1(0x19c)](0x1));let _0x58036=[];for(let _0x585477=0x0;_0x585477<_0x11ae69[_0x5a12d1(0x1b3)];_0x585477++){let _0x3bcfc5=_0x11ae69[_0x585477];switch(_0x3bcfc5){case'--keep-alive':_0xcc1db9['keepAlive']=!0x0;break;case'--cleanup':_0xcc1db9[_0x5a12d1(0x1c4)]=!0x0;break;case'--headless':_0xcc1db9[_0x5a12d1(0x205)]=!0x0;break;case _0x5a12d1(0x1d8):_0xcc1db9[_0x5a12d1(0x18e)]=!0x0;break;case _0x5a12d1(0x1bb):_0xcc1db9['noSecurity']=!0x0;break;case _0x5a12d1(0x1f6):case'-q':_0xcc1db9[_0x5a12d1(0x1ef)]=!0x0;break;case _0x5a12d1(0x174):_0xcc1db9['backendUrl']=_0x11ae69[++_0x585477];break;case _0x5a12d1(0x1c8):_0xcc1db9[_0x5a12d1(0x1f8)]=_0x11ae69[++_0x585477];break;case _0x5a12d1(0x1db):_0xcc1db9[_0x5a12d1(0x1fb)]=_0x11ae69[++_0x585477];break;case _0x5a12d1(0x1ad):_0xcc1db9[_0x5a12d1(0x198)]=_0x11ae69[++_0x585477];break;case _0x5a12d1(0x184):_0xcc1db9[_0x5a12d1(0x188)]=_0x11ae69[++_0x585477];break;case _0x5a12d1(0x18d):{let _0x1784dd=_0x11ae69[++_0x585477];(!_0x1784dd||_0x1784dd[_0x5a12d1(0x19a)]('--'))&&(console['error']('--preload-skill\x20requires\x20a\x20skill\x20name.'),process[_0x5a12d1(0x1d9)](0x2)),_0xcc1db9[_0x5a12d1(0x1b6)]['push'](_0x1784dd);break;}case _0x5a12d1(0x1cb):{let _0x173105=_0x11ae69[++_0x585477];['alpha',_0x5a12d1(0x1e0),'production',_0x5a12d1(0x179)]['includes'](_0x173105)||(console[_0x5a12d1(0x1e8)](_0x5a12d1(0x1c2)+_0x173105+_0x5a12d1(0x187)),process[_0x5a12d1(0x1d9)](0x2)),_0xcc1db9[_0x5a12d1(0x1a2)]=_0x173105;break;}case'-h':case _0x5a12d1(0x1b9):_0xcc1db9[_0x5a12d1(0x1e5)]=!0x0;break;case'-v':case'--version':_0xcc1db9[_0x5a12d1(0x1eb)]=!0x0;break;default:_0x3bcfc5[_0x5a12d1(0x19a)]('--')&&(console[_0x5a12d1(0x1e8)]('Unknown\x20flag:\x20'+_0x3bcfc5),process[_0x5a12d1(0x1d9)](0x2)),_0x58036[_0x5a12d1(0x1f5)](_0x3bcfc5);}}return _0xcc1db9[_0x5a12d1(0x18c)]=_0x58036['join']('\x20'),_0xcc1db9;}function w(_0x35f98d,_0x30a305,_0x5292ca){const _0x9bfd70=_0x49cf1e;if(_0x5292ca)return _0x5292ca;if(process.env.BACKEND_URL)return process.env.BACKEND_URL;if(!_0x35f98d){if(_0x30a305?.[_0x9bfd70(0x1b5)]&&_0x30a305?.[_0x9bfd70(0x1a0)]&&_0x30a305?.[_0x9bfd70(0x182)])return _0x5e1b6b(_0x30a305['baseUrl'],_0x30a305[_0x9bfd70(0x1a0)],_0x30a305['tenantName']);throw new Error(_0x9bfd70(0x1d5));}if(_0x35f98d==='localhost')return'http://localhost:5002';let _0x149cb8=I[_0x35f98d],_0x22a746=_0x30a305?.[_0x9bfd70(0x1a0)],_0x2130ff=_0x30a305?.['tenantName'];if(!_0x22a746||!_0x2130ff)throw new Error(_0x9bfd70(0x175)+_0x35f98d+_0x9bfd70(0x1be)+_0x35f98d+_0x9bfd70(0x1af));return _0x5e1b6b(_0x149cb8,_0x22a746,_0x2130ff);}function C(){const _0xa524ef=_0x49cf1e;let _0x1a48a5=_0xa524ef(0x1ae)[_0xa524ef(0x1a5)]();console[_0xa524ef(0x1f3)](_0x1a48a5);}function P(){const _0x619a1d=_0x49cf1e;try{return JSON[_0x619a1d(0x1bd)](_0x3014ad[_0x619a1d(0x1fc)](_0x32396f[_0x619a1d(0x1bf)](__dirname,'..','package.json'),_0x619a1d(0x199)))[_0x619a1d(0x1eb)]||_0x619a1d(0x1d4);}catch{return'unknown';}}var $=0x7d0;async function m(_0x538507,_0x4a81a2){const _0x467213=_0x49cf1e;let _0x13567=_0x4a81a2?[_0x4a81a2]:[];for await(let _0x418d23 of _0x538507)_0x13567['push'](Buffer['from'](_0x418d23));return Buffer['concat'](_0x13567)['toString'](_0x467213(0x199))['trim']();}function x(_0xcf2b4a,_0x358343){return new Promise(_0x4ef1b6=>{const _0x2c6bab=_0x254e;let _0x29697f=_0x5ca3ee=>{const _0x3bd0a2=_0x254e;clearTimeout(_0x2d3c12),_0xcf2b4a['off'](_0x3bd0a2(0x17e),_0x403d80),_0xcf2b4a[_0x3bd0a2(0x1e7)](_0x3bd0a2(0x17c),_0x8d190f),_0xcf2b4a[_0x3bd0a2(0x1e7)](_0x3bd0a2(0x1e8),_0x8d190f),_0xcf2b4a[_0x3bd0a2(0x1ec)](),_0x4ef1b6(_0x5ca3ee);},_0x403d80=_0x547ca4=>_0x29697f(Buffer[_0x2c6bab(0x1f2)](_0x547ca4)),_0x8d190f=()=>_0x29697f(null),_0x2d3c12=setTimeout(()=>_0x29697f(null),_0x358343);_0xcf2b4a['on'](_0x2c6bab(0x17e),_0x403d80),_0xcf2b4a['on'](_0x2c6bab(0x17c),_0x8d190f),_0xcf2b4a['on'](_0x2c6bab(0x1e8),_0x8d190f),_0xcf2b4a[_0x2c6bab(0x17a)]();});}async function M(_0x481666,_0x2037bf,_0x389223=$){const _0x12b25f=_0x49cf1e;let _0xeb6396=_0x481666==='-';if(!_0xeb6396&&_0x481666)return _0x481666;if(!_0xeb6396&&_0x2037bf[_0x12b25f(0x1de)])return'';if(_0xeb6396)return m(_0x2037bf,null);let _0x46fd24=await x(_0x2037bf,_0x389223);return _0x46fd24?m(_0x2037bf,_0x46fd24):'';}function S(){const _0x19ecf0=_0x49cf1e;return _0x32396f[_0x19ecf0(0x1bf)](process.env.HOME||process.env.USERPROFILE||'',_0x19ecf0(0x206),_0x19ecf0(0x1e2));}function A(_0x49644a){const _0x52f5f1=_0x49cf1e;try{let _0x379ece=JSON['parse'](_0x3014ad[_0x52f5f1(0x1fc)](_0x49644a,_0x52f5f1(0x199)));return!_0x379ece[_0x52f5f1(0x1cf)]||!_0x379ece['tenantId']||!_0x379ece[_0x52f5f1(0x207)]?null:_0x379ece;}catch{return null;}}function y(){let _0x1cd725=[{'file':_0x4799a3(),'isDesktopFallback':!0x1},{'file':S(),'isDesktopFallback':!0x0}];for(let _0xff4ec4 of _0x1cd725){let _0xd25816=A(_0xff4ec4['file']);if(_0xd25816)return{..._0xff4ec4,'auth':_0xd25816};}return null;}async function B(){const _0xb69d4a=_0x49cf1e;let _0x1d74d1=_0x4799a3();if(!_0x3014ad['existsSync'](_0x1d74d1)){let _0x2df4f4=S();console['log'](A(_0x2df4f4)?_0xb69d4a(0x1b4)+_0x2df4f4+_0xb69d4a(0x1e1):_0xb69d4a(0x186));return;}_0x3014ad[_0xb69d4a(0x1b1)](_0x1d74d1),console[_0xb69d4a(0x1f3)]('Removed\x20'+_0x1d74d1);}function _0x55d1(){const _0x4a9212=['✓\x20Done\x0a','content','catch','keepAlive','--backend','--env\x20','\x0aUse\x20with:\x20delegate-cli\x20--model\x20<id>\x20\x22<prompt>\x22\x0a','SIGINT','file','localhost','resume','status','end','sendMessage','data','MODELS','lastType','No\x20models\x20available\x20for\x20this\x20product/tenant.\x0a','tenantName','273510yUMsef','--worker-id','3321038DQiSxH','No\x20CLI\x20login\x20found\x20—\x20nothing\x20to\x20remove.','.\x20Use\x20alpha\x20|\x20staging\x20|\x20production\x20|\x20localhost.','workerId','login','Missing\x20prompt.\x20Pass\x20it\x20as\x20an\x20argument,\x20pipe\x20it\x20via\x20stdin,\x20or\x20run\x20`delegate-cli\x20--help`.','finally','prompt','--preload-skill','noConnections','stdout','\x20(Delegate\x20desktop\x20app\x20fallback)','expiresAt','object','stop','tenantId','Base\x20URL:\x20\x20\x20\x20\x20','map','499384TLGYng','interopPath','utf-8','startsWith','write','slice','stderr','backendUrl','tool','orgLogicalName','isDesktopFallback','env','tool_call','435QBkVYE','trim','toolName','X-Uipath-Tenantid','isArray','floor','whoami','23905UvchQl','host','--interop','\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\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\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--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','`\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).','entries','rmSync','🔧\x20','length','No\x20CLI\x20login\x20found.\x20Note:\x20the\x20CLI\x20is\x20currently\x20authenticating\x20via\x20the\x20Delegate\x20desktop\x20app\x27s\x20','baseUrl','preloadSkills','799f56b8-4aed-4a0f-8640-659dae4a9e0e','26008TMqnIj','--help','description','--no-security','\x0a🤔\x20','parse','\x20needs\x20org/tenant\x20slugs.\x20Either:\x0a\x20\x20-\x20run\x20`delegate-cli\x20login\x20--env\x20','join','type','):\x0a\x0a','Invalid\x20--env:\x20','2MIpiVE','cleanup','round','toISOString','Interop\x20stopped\x20(if\x20it\x20was\x20running).','--model','done','--env\x20localhost\x20has\x20no\x20OAuth\x20flow;\x20pick\x20alpha,\x20staging,\x20or\x20production.','--env','\x20→\x20','name','destroy','accessToken','\x0aStopping…\x20(Ctrl+C\x20again\x20to\x20force\x20exit)\x0a','11858587HLeVym',']\x20Backend\x20URL:\x20','GET\x20','unknown','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).','\x20\x20\x20\x20','argv','--no-connections','exit','https://cloud.uipath.com','--runner-url','https://staging.uipath.com','message','isTTY','6064432FApwJb','staging','\x20—\x20sign\x20out\x20in\x20the\x20Delegate\x20app\x20to\x20clear\x20that.','auth.json','Source:\x20\x20\x20\x20\x20\x20\x20','initialize','help','Tenant:\x20\x20\x20\x20\x20\x20\x20','off','error','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.','once','version','pause','16TubwaH','[saved\x20login]\x20Backend\x20URL:\x20','quiet','\x20(in\x20','onEvent','from','log','logout','push','--quiet','642jBsTvt','model','test','/v1/config','runnerUrl','readFileSync','10egMPgS','stdin','thinking','subcommand','Token:\x20\x20\x20\x20\x20\x20\x20\x20expired\x20','includes','12XnyvxJ','First\x20login\x20requires\x20--env.\x20Usage:\x20delegate-cli\x20login\x20--env\x20<alpha|staging|production>','headless','.aria','organizationId'];_0x55d1=function(){return _0x4a9212;};return _0x55d1();}async function F(){const _0x4c1b5d=_0x49cf1e;let _0xb7119d=E(),_0x44e835,_0x53bee0;if(_0xb7119d)_0x44e835=_0xb7119d,_0x53bee0='environment\x20variables\x20(AUTH_TOKEN/TENANT_ID/ORG_ID)';else{let _0x312840=y();if(!_0x312840)throw new Error(T);_0x44e835=_0x312840['auth'],_0x53bee0=_0x312840[_0x4c1b5d(0x1a1)]?_0x312840[_0x4c1b5d(0x178)]+_0x4c1b5d(0x190):_0x312840[_0x4c1b5d(0x178)];}let _0x5e7559=[_0x4c1b5d(0x1e3)+_0x53bee0,_0x4c1b5d(0x195)+(_0x44e835[_0x4c1b5d(0x1b5)]??_0x4c1b5d(0x1d4)),'Organization:\x20'+(_0x44e835[_0x4c1b5d(0x1a0)]??'unknown\x20slug')+'\x20('+_0x44e835['organizationId']+')',_0x4c1b5d(0x1e6)+(_0x44e835[_0x4c1b5d(0x182)]??'unknown\x20slug')+'\x20('+_0x44e835['tenantId']+')'];if(_0x44e835[_0x4c1b5d(0x191)]){let _0x3a31b3=_0x44e835[_0x4c1b5d(0x191)]-Math[_0x4c1b5d(0x1a9)](Date['now']()/0x3e8),_0x47bf06=new Date(_0x44e835['expiresAt']*0x3e8)[_0x4c1b5d(0x1c6)]();_0x5e7559[_0x4c1b5d(0x1f5)](_0x3a31b3>0x0?'Token:\x20\x20\x20\x20\x20\x20\x20\x20expires\x20'+_0x47bf06+_0x4c1b5d(0x1f0)+Math[_0x4c1b5d(0x1c5)](_0x3a31b3/0x3c)+'\x20min)':_0x4c1b5d(0x201)+_0x47bf06);}process[_0x4c1b5d(0x18f)][_0x4c1b5d(0x19b)](_0x5e7559[_0x4c1b5d(0x1bf)]('\x0a')+'\x0a');}var T=_0x49cf1e(0x1e9);function E(){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 U(){let _0x3f315d=E();if(_0x3f315d)return _0x3f315d;let _0x377b58=await _0x3b77a6();if(_0x377b58)return _0x377b58;throw new Error(T);}async function q(){const _0x4baaab=_0x49cf1e;await new _0x3e47ad()[_0x4baaab(0x193)]({'force':!0x0}),console[_0x4baaab(0x1f3)](_0x4baaab(0x1c7));}var G=_0x49cf1e(0x1b7);function N(_0xe0458d,_0x1059ef,_0x1adb23){const _0x6c3640=_0x49cf1e;_0xe0458d?process[_0x6c3640(0x19d)][_0x6c3640(0x19b)]('[env='+_0xe0458d+_0x6c3640(0x1d2)+_0x1adb23+'\x0a'):!_0x1059ef&&!process.env.BACKEND_URL&&process[_0x6c3640(0x19d)]['write'](_0x6c3640(0x1ee)+_0x1adb23+'\x0a');}async function j(_0x47d6cc){const _0x4e8f5a=_0x49cf1e;let _0x436ff4=await U(),_0x16ee4b=w(_0x47d6cc[_0x4e8f5a(0x1a2)],_0x436ff4,_0x47d6cc[_0x4e8f5a(0x19e)]);N(_0x47d6cc[_0x4e8f5a(0x1a2)],_0x47d6cc[_0x4e8f5a(0x19e)],_0x16ee4b);let _0x1d23c5=_0x16ee4b+_0x4e8f5a(0x1fa),_0x31fe74={'Authorization':'Bearer\x20'+_0x436ff4[_0x4e8f5a(0x1cf)],'X-UiPath-ConsumingProductId':G};_0x436ff4[_0x4e8f5a(0x194)]&&(_0x31fe74[_0x4e8f5a(0x1a7)]=_0x436ff4[_0x4e8f5a(0x194)]),_0x436ff4[_0x4e8f5a(0x207)]&&(_0x31fe74['X-Uipath-Organizationid']=_0x436ff4[_0x4e8f5a(0x207)]);let _0x9abbe0=await fetch(_0x1d23c5,{'headers':_0x31fe74});if(!_0x9abbe0['ok'])throw new Error(_0x4e8f5a(0x1d3)+_0x1d23c5+_0x4e8f5a(0x1cc)+_0x9abbe0[_0x4e8f5a(0x17b)]+'\x20'+_0x9abbe0['statusText']);let _0x24b463=(await _0x9abbe0['json']())?.[_0x4e8f5a(0x17f)],_0x45a9a9=Array[_0x4e8f5a(0x1a8)](_0x24b463)?_0x24b463:_0x24b463&&typeof _0x24b463==_0x4e8f5a(0x192)?Object[_0x4e8f5a(0x1b0)](_0x24b463)[_0x4e8f5a(0x196)](([_0x1db8a4,_0x1eac8d])=>({'id':_0x1db8a4,'name':_0x1eac8d})):[];if(_0x45a9a9['length']===0x0){process[_0x4e8f5a(0x19d)][_0x4e8f5a(0x19b)](_0x4e8f5a(0x181));return;}process[_0x4e8f5a(0x18f)][_0x4e8f5a(0x19b)]('\x0aAvailable\x20models\x20('+_0x45a9a9[_0x4e8f5a(0x1b3)]+_0x4e8f5a(0x1c1));for(let _0x3dd9ab of _0x45a9a9){let _0x40d4e2=_0x3dd9ab['name']&&_0x3dd9ab[_0x4e8f5a(0x1cd)]!==_0x3dd9ab['id']?'\x20('+_0x3dd9ab[_0x4e8f5a(0x1cd)]+')':'';process[_0x4e8f5a(0x18f)][_0x4e8f5a(0x19b)]('\x20\x20'+_0x3dd9ab['id']+_0x40d4e2+'\x0a'),_0x3dd9ab['description']&&process[_0x4e8f5a(0x18f)][_0x4e8f5a(0x19b)](_0x4e8f5a(0x1d6)+_0x3dd9ab[_0x4e8f5a(0x1ba)]+'\x0a');}process['stdout'][_0x4e8f5a(0x19b)](_0x4e8f5a(0x176));}async function z(_0x355f9d){const _0x2c76f8=_0x49cf1e;if(_0x355f9d['env']===_0x2c76f8(0x179)&&(console[_0x2c76f8(0x1e8)](_0x2c76f8(0x1ca)),process['exit'](0x2)),_0x355f9d[_0x2c76f8(0x1a2)]){await _0x2c7266({'env':_0x355f9d[_0x2c76f8(0x1a2)]});return;}let _0x21f778=y();if(_0x21f778?.['auth']['baseUrl']){await _0x2c7266({'baseUrl':_0x21f778['auth'][_0x2c76f8(0x1b5)]});return;}console[_0x2c76f8(0x1e8)](_0x2c76f8(0x204)),process['exit'](0x2);}function K(_0x137a06){const _0x1f2120=_0x49cf1e;return _0x137a06?.['response']?.['status']===0x191||/401/['test'](String(_0x137a06?.[_0x1f2120(0x1dd)]??''));}var a={'lastType':null,'quiet':!0x1},k=_0x121839=>{const _0x5b5057=_0x49cf1e;switch(_0x121839[_0x5b5057(0x1c0)]){case _0x5b5057(0x1ff):_0x121839[_0x5b5057(0x209)]&&!a[_0x5b5057(0x1ef)]&&(a['lastType']!==_0x5b5057(0x1ff)&&process[_0x5b5057(0x19d)][_0x5b5057(0x19b)](_0x5b5057(0x1bc)),process['stderr']['write'](_0x121839[_0x5b5057(0x209)]),a[_0x5b5057(0x180)]=_0x5b5057(0x1ff));break;case _0x5b5057(0x1a3):a['lastType']!==null&&process[_0x5b5057(0x19d)]['write']('\x0a'),process[_0x5b5057(0x19d)][_0x5b5057(0x19b)](_0x5b5057(0x1b2)+(_0x121839[_0x5b5057(0x1a6)]??_0x5b5057(0x19f))+'\x0a'),a[_0x5b5057(0x180)]=_0x5b5057(0x1a3);break;case _0x5b5057(0x1dd):_0x121839[_0x5b5057(0x209)]&&(a[_0x5b5057(0x180)]!==_0x5b5057(0x1dd)&&a[_0x5b5057(0x180)]!==null&&process['stdout']['write']('\x0a'),process[_0x5b5057(0x18f)][_0x5b5057(0x19b)](_0x121839['content']),a[_0x5b5057(0x180)]='message');break;case _0x5b5057(0x1e8):a['lastType']!==null&&process[_0x5b5057(0x19d)][_0x5b5057(0x19b)]('\x0a'),process[_0x5b5057(0x19d)][_0x5b5057(0x19b)]('✗\x20'+(_0x121839['error']??_0x121839[_0x5b5057(0x1dd)]??_0x5b5057(0x1e8))+'\x0a'),a['lastType']='error';break;case _0x5b5057(0x1c9):(a[_0x5b5057(0x180)]==='message'||a[_0x5b5057(0x180)]===_0x5b5057(0x1ff))&&process['stdout'][_0x5b5057(0x19b)]('\x0a'),process[_0x5b5057(0x19d)][_0x5b5057(0x19b)](_0x5b5057(0x208)),a[_0x5b5057(0x180)]=_0x5b5057(0x1c9);break;}};function _0x254e(_0x5ad5f5,_0x2165c2){_0x5ad5f5=_0x5ad5f5-0x172;const _0x55d133=_0x55d1();let _0x254e27=_0x55d133[_0x5ad5f5];return _0x254e27;}async function H(_0x57f281){const _0x3774a6=_0x49cf1e;let _0x486f84=await M(_0x57f281[_0x3774a6(0x18c)],process[_0x3774a6(0x1fe)]);_0x486f84||(console[_0x3774a6(0x1e8)](_0x3774a6(0x18a)),process['exit'](0x2)),a[_0x3774a6(0x1ef)]=_0x57f281[_0x3774a6(0x1ef)];let _0x5107cf=await U(),_0xaff493=new _0x1cd5bb();_0xaff493[_0x3774a6(0x1f1)](k);let _0x4916a4=w(_0x57f281['env'],_0x5107cf,_0x57f281[_0x3774a6(0x19e)]);N(_0x57f281['env'],_0x57f281[_0x3774a6(0x19e)],_0x4916a4);let _0x4a0e3f={'backendUrl':_0x4916a4,'auth':_0x5107cf,'enableComputerUse':!_0x57f281['headless'],'autoSpawnInterop':!_0x57f281['headless'],'enableConnections':!_0x57f281[_0x3774a6(0x18e)],'enableSecurity':!_0x57f281['noSecurity'],'keepInteropAlive':_0x57f281[_0x3774a6(0x173)],..._0x57f281[_0x3774a6(0x1b6)][_0x3774a6(0x1b3)]>0x0?{'preloadSkills':_0x57f281[_0x3774a6(0x1b6)]}:{},..._0x57f281[_0x3774a6(0x1f8)]||process.env.MODEL?{'model':_0x57f281['model']||process.env.MODEL}:{}},_0xf42d40=!0x1,_0x16f1d0=!0x1,_0x8dd9c9=()=>{const _0x4990de=_0x3774a6;_0x16f1d0&&process[_0x4990de(0x1d9)](0x82),_0x16f1d0=!0x0,process[_0x4990de(0x19d)][_0x4990de(0x19b)](_0x4990de(0x1d0)),_0xf42d40?_0xaff493[_0x4990de(0x1ce)]()[_0x4990de(0x18b)](()=>process['exit'](0x82)):process[_0x4990de(0x1d9)](0x82);};process[_0x3774a6(0x1ea)](_0x3774a6(0x177),_0x8dd9c9),await _0xaff493[_0x3774a6(0x1e4)](_0x4a0e3f),_0xf42d40=!0x0;try{await _0xaff493['sendMessage'](_0x486f84);}catch(_0x38745f){if(K(_0x38745f)&&process[_0x3774a6(0x1fe)]['isTTY']&&_0x57f281[_0x3774a6(0x1a2)]!=='localhost'&&(_0x57f281['env']||_0x5107cf[_0x3774a6(0x1b5)])){process[_0x3774a6(0x19d)][_0x3774a6(0x19b)]('\x0a⚠️\x20\x20Auth\x20expired.\x20Opening\x20browser\x20to\x20re-login…\x0a');let _0x3510a6=await _0x2c7266(_0x57f281[_0x3774a6(0x1a2)]?{'env':_0x57f281[_0x3774a6(0x1a2)]}:{'baseUrl':_0x5107cf[_0x3774a6(0x1b5)]});await _0xaff493[_0x3774a6(0x1ce)](),_0xaff493=new _0x1cd5bb(),_0xaff493[_0x3774a6(0x1f1)](k),await _0xaff493[_0x3774a6(0x1e4)]({..._0x4a0e3f,'auth':_0x3510a6}),await _0xaff493[_0x3774a6(0x17d)](_0x486f84);}else throw _0x38745f;}finally{process[_0x3774a6(0x1e7)](_0x3774a6(0x177),_0x8dd9c9),await _0xaff493[_0x3774a6(0x1ce)]();}}async function W(){const _0x120557=_0x49cf1e;let _0xe8c8f9=O(process[_0x120557(0x1d7)][_0x120557(0x19c)](0x2));if(_0xe8c8f9[_0x120557(0x1e5)]){C();return;}if(_0xe8c8f9['version']){console['log'](P());return;}if(_0xe8c8f9[_0x120557(0x200)]===_0x120557(0x189)){await z(_0xe8c8f9);return;}if(_0xe8c8f9[_0x120557(0x200)]===_0x120557(0x1f4)){await B();return;}if(_0xe8c8f9['subcommand']===_0x120557(0x1aa)){await F();return;}if(_0xe8c8f9[_0x120557(0x200)]==='models'){await j(_0xe8c8f9);return;}if(_0xe8c8f9['subcommand']===_0x120557(0x1ac)){await _0xecfd96(_0xe8c8f9[_0x120557(0x18c)],{'runnerUrl':_0xe8c8f9['runnerUrl'],'backendUrl':_0xe8c8f9[_0x120557(0x19e)],'interopPath':_0xe8c8f9[_0x120557(0x198)],'workerId':_0xe8c8f9[_0x120557(0x188)]});return;}if(_0xe8c8f9[_0x120557(0x1c4)]){await q();return;}await H(_0xe8c8f9);}var J=process.env.NODE_ENV===_0x49cf1e(0x1f9)||!!process.env.JEST_WORKER_ID;J||W()[_0x49cf1e(0x172)](_0x12b5b9=>{const _0x17b691=_0x49cf1e;console[_0x17b691(0x1e8)](_0x12b5b9['stack']||_0x12b5b9['message']||_0x12b5b9),process[_0x17b691(0x1d9)](0x1);});export{$ as IMPLICIT_STDIN_IDLE_MS,W as main,O as parseArgs,P as readCliVersion,M as resolvePrompt};
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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/delegate-cli",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
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.5"
25
+ "@uipath/delegate-sdk": "0.1.7"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/node": "^22.0.0",