@uipath/delegate-cli 0.1.1 → 0.1.2
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 +18 -14
- package/dist/cli.mjs +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -17,11 +17,11 @@ npm pulls the CLI, the SDK, and your platform's runtime package (Mac arm64, Win
|
|
|
17
17
|
## Quick start
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
npx delegate-cli login --env production # browser OAuth → ~/.aria/sdk-auth.json
|
|
21
|
-
npx delegate-cli
|
|
20
|
+
npx delegate-cli login --env production # once — browser OAuth → ~/.aria/sdk-auth.json
|
|
21
|
+
npx delegate-cli "take a screenshot and tell me what's open"
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
There is no
|
|
24
|
+
Commands default to the cloud you logged into; `--env` / `--backend` override per command. There is no hardcoded environment — with no saved login and no `--env`/`--backend`, commands error rather than guess.
|
|
25
25
|
|
|
26
26
|
If the access token expires mid-session in a TTY, the CLI opens the browser, re-logs in, and retries the prompt automatically.
|
|
27
27
|
|
|
@@ -34,10 +34,11 @@ 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
|
|
37
|
+
delegate-cli login [--env NAME] OAuth browser login (--env required on FIRST login;
|
|
38
|
+
afterwards defaults to the saved login's cloud)
|
|
38
39
|
delegate-cli logout Remove the saved CLI login
|
|
39
40
|
delegate-cli whoami Show the current login (org, tenant, token expiry)
|
|
40
|
-
delegate-cli models --env NAME
|
|
41
|
+
delegate-cli models [--env NAME] List LLM models available on the tenant
|
|
41
42
|
delegate-cli host [flags] Run this PC as a remote worker until Ctrl+C
|
|
42
43
|
delegate-cli host install [flags] Auto-start the host at login (macOS/Windows)
|
|
43
44
|
delegate-cli host uninstall Remove auto-start
|
|
@@ -51,7 +52,7 @@ delegate-cli --help
|
|
|
51
52
|
|
|
52
53
|
| Flag | Default | What it does |
|
|
53
54
|
|---|---|---|
|
|
54
|
-
| `--env <name>` |
|
|
55
|
+
| `--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. |
|
|
55
56
|
| `--backend <url>` | — | Full backend URL — overrides `--env` and `BACKEND_URL`. |
|
|
56
57
|
| `--model <id>` | `gemini_3_6_flash` | LLM id (use `delegate-cli models` to discover). Also via `MODEL` env. |
|
|
57
58
|
| `--headless` | off | Skip interop. Text-only prompts. |
|
|
@@ -69,21 +70,24 @@ delegate-cli --help
|
|
|
69
70
|
### Examples
|
|
70
71
|
|
|
71
72
|
```bash
|
|
72
|
-
#
|
|
73
|
-
npx delegate-cli
|
|
73
|
+
# Computer use against the saved login's cloud, suppress chatter
|
|
74
|
+
npx delegate-cli -q --no-connections "open Chrome and search UiPath"
|
|
75
|
+
|
|
76
|
+
# Target another environment for one command
|
|
77
|
+
npx delegate-cli --env staging "open the org dashboard"
|
|
74
78
|
|
|
75
79
|
# Pick a model
|
|
76
|
-
npx delegate-cli --
|
|
80
|
+
npx delegate-cli --model claude_opus_4_8 "explain quantum entanglement"
|
|
77
81
|
|
|
78
82
|
# Headless: no interop, fastest for text-only prompts
|
|
79
|
-
npx delegate-cli --headless
|
|
83
|
+
npx delegate-cli --headless "summarize the last release notes"
|
|
80
84
|
|
|
81
85
|
# Pipe the prompt from stdin
|
|
82
|
-
cat notes.md | npx delegate-cli --headless
|
|
86
|
+
cat notes.md | npx delegate-cli --headless -
|
|
83
87
|
|
|
84
88
|
# Iterate fast with persistent interop
|
|
85
|
-
npx delegate-cli --keep-alive
|
|
86
|
-
npx delegate-cli --keep-alive
|
|
89
|
+
npx delegate-cli --keep-alive "take a screenshot"
|
|
90
|
+
npx delegate-cli --keep-alive "now describe the active window" # < 1 s, no spawn
|
|
87
91
|
npx delegate-cli --cleanup # stop when done
|
|
88
92
|
|
|
89
93
|
# Override backend URL fully
|
|
@@ -126,7 +130,7 @@ Flags/env present at `install` time are persisted into the OS entry.
|
|
|
126
130
|
|
|
127
131
|
## Authentication
|
|
128
132
|
|
|
129
|
-
`delegate-cli login --env <env>` runs OAuth PKCE in your browser and saves to `~/.aria/sdk-auth.json`. The environment is
|
|
133
|
+
`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.
|
|
130
134
|
|
|
131
135
|
`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).
|
|
132
136
|
|
package/dist/cli.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const _0x5f3285=_0x5182;(function(_0x549c43,_0x135b0e){const _0x209138=_0x5182,_0x409309=_0x549c43();while(!![]){try{const _0x59fbbb=parseInt(_0x209138(0x115))/0x1*(-parseInt(_0x209138(0xbe))/0x2)+-parseInt(_0x209138(0xd4))/0x3*(parseInt(_0x209138(0xf3))/0x4)+-parseInt(_0x209138(0x146))/0x5*(-parseInt(_0x209138(0xdb))/0x6)+parseInt(_0x209138(0xfd))/0x7*(parseInt(_0x209138(0xbd))/0x8)+-parseInt(_0x209138(0x102))/0x9*(parseInt(_0x209138(0xe9))/0xa)+parseInt(_0x209138(0xc2))/0xb+parseInt(_0x209138(0x108))/0xc*(parseInt(_0x209138(0x116))/0xd);if(_0x59fbbb===_0x135b0e)break;else _0x409309['push'](_0x409309['shift']());}catch(_0x3360bf){_0x409309['push'](_0x409309['shift']());}}}(_0x37d5,0xa2af1));const __dirname=import.meta.dirname;import _0x5d6862 from'fs';import _0x121549 from'path';import{DelegateAgent as _0xdbc4c3,InteropProcess as _0x5e5bd4,buildDelegateServiceUrl as _0x3e0689,getAuthFilePath as _0x2a8d34,loadAndRefreshAuth as _0x5c40b0,runHostCommand as _0x46e093,runLoginFlow as _0x3fd9bf}from'@uipath/delegate-sdk';var L={'alpha':'https://alpha.uipath.com','staging':_0x5f3285(0x10c),'production':'https://cloud.uipath.com'},_=[_0x5f3285(0x122),'models','host',_0x5f3285(0xf8),_0x5f3285(0x101)];function I(_0x3a8288){const _0x40e368=_0x5f3285;let _0xab896={'subcommand':'','prompt':'','keepAlive':!0x1,'cleanup':!0x1,'headless':!0x1,'noConnections':!0x1,'noSecurity':!0x1,'quiet':!0x1,'preloadSkills':[],'help':!0x1,'version':!0x1};_[_0x40e368(0xcb)](_0x3a8288[0x0])&&(_0xab896[_0x40e368(0xdd)]=_0x3a8288[0x0],_0x3a8288=_0x3a8288[_0x40e368(0xfe)](0x1));let _0x3b2def=[];for(let _0x53f341=0x0;_0x53f341<_0x3a8288[_0x40e368(0xbc)];_0x53f341++){let _0x55cb90=_0x3a8288[_0x53f341];switch(_0x55cb90){case'--keep-alive':_0xab896['keepAlive']=!0x0;break;case _0x40e368(0xb8):_0xab896['cleanup']=!0x0;break;case _0x40e368(0x131):_0xab896['headless']=!0x0;break;case'--no-connections':_0xab896['noConnections']=!0x0;break;case _0x40e368(0xdc):_0xab896[_0x40e368(0xf4)]=!0x0;break;case'--quiet':case'-q':_0xab896[_0x40e368(0x148)]=!0x0;break;case _0x40e368(0xe4):_0xab896[_0x40e368(0xed)]=_0x3a8288[++_0x53f341];break;case _0x40e368(0xd2):_0xab896[_0x40e368(0x127)]=_0x3a8288[++_0x53f341];break;case _0x40e368(0xba):_0xab896[_0x40e368(0x135)]=_0x3a8288[++_0x53f341];break;case _0x40e368(0x12d):_0xab896[_0x40e368(0xfc)]=_0x3a8288[++_0x53f341];break;case _0x40e368(0xcc):_0xab896[_0x40e368(0xc0)]=_0x3a8288[++_0x53f341];break;case _0x40e368(0x114):{let _0x24fb05=_0x3a8288[++_0x53f341];(!_0x24fb05||_0x24fb05[_0x40e368(0x132)]('--'))&&(console[_0x40e368(0xb5)](_0x40e368(0xe7)),process[_0x40e368(0x11e)](0x2)),_0xab896[_0x40e368(0xf7)]['push'](_0x24fb05);break;}case'--env':{let _0x22757d=_0x3a8288[++_0x53f341];[_0x40e368(0xfb),_0x40e368(0x149),'production',_0x40e368(0xd5)][_0x40e368(0xcb)](_0x22757d)||(console[_0x40e368(0xb5)]('Invalid\x20--env:\x20'+_0x22757d+_0x40e368(0x10b)),process[_0x40e368(0x11e)](0x2)),_0xab896[_0x40e368(0x145)]=_0x22757d;break;}case'-h':case _0x40e368(0x13f):_0xab896[_0x40e368(0xe3)]=!0x0;break;case'-v':case _0x40e368(0x13a):_0xab896['version']=!0x0;break;default:_0x55cb90[_0x40e368(0x132)]('--')&&(console['error'](_0x40e368(0xf5)+_0x55cb90),process['exit'](0x2)),_0x3b2def[_0x40e368(0xbb)](_0x55cb90);}}return _0xab896['prompt']=_0x3b2def[_0x40e368(0xce)]('\x20'),_0xab896;}function w(_0x16ffb8,_0x481868,_0x1b2f7e){const _0x455cf4=_0x5f3285;if(_0x1b2f7e)return _0x1b2f7e;if(process.env.BACKEND_URL)return process.env.BACKEND_URL;if(!_0x16ffb8)throw new Error(_0x455cf4(0xca));if(_0x16ffb8==='localhost')return _0x455cf4(0xd8);let _0x5b7072=L[_0x16ffb8],_0x3fc661=_0x481868?.['orgLogicalName'],_0x18cb69=_0x481868?.[_0x455cf4(0xea)];if(!_0x3fc661||!_0x18cb69)throw new Error('--env\x20'+_0x16ffb8+'\x20needs\x20org/tenant\x20slugs.\x20Either:\x0a\x20\x20-\x20run\x20`delegate-cli\x20login\x20--env\x20'+_0x16ffb8+_0x455cf4(0x105));return _0x3e0689(_0x5b7072,_0x3fc661,_0x18cb69);}function R(){const _0x1ea2d6=_0x5f3285;let _0x109eb6=_0x1ea2d6(0x128)['trim']();console[_0x1ea2d6(0x12c)](_0x109eb6);}function O(){const _0x18f90c=_0x5f3285;try{return JSON[_0x18f90c(0xd9)](_0x5d6862['readFileSync'](_0x121549['join'](__dirname,'..','package.json'),_0x18f90c(0x12f)))['version']||_0x18f90c(0x10e);}catch{return _0x18f90c(0x10e);}}var P=0x7d0;function _0x5182(_0x4592f2,_0x40269f){_0x4592f2=_0x4592f2-0xb2;const _0x37d587=_0x37d5();let _0x51829c=_0x37d587[_0x4592f2];return _0x51829c;}async function f(_0xefc548,_0x5a9c94){const _0x374f71=_0x5f3285;let _0x4f1808=_0x5a9c94?[_0x5a9c94]:[];for await(let _0x47a1f5 of _0xefc548)_0x4f1808[_0x374f71(0xbb)](Buffer[_0x374f71(0xc3)](_0x47a1f5));return Buffer[_0x374f71(0xde)](_0x4f1808)[_0x374f71(0x13c)]('utf-8')[_0x374f71(0x130)]();}function C(_0x49083d,_0x5f086d){return new Promise(_0x5e104b=>{const _0x2a633a=_0x5182;let _0x1465a1=_0x1c433e=>{const _0xc60b05=_0x5182;clearTimeout(_0x29c03c),_0x49083d[_0xc60b05(0x125)](_0xc60b05(0x10d),_0x264b61),_0x49083d['off']('end',_0x26ab17),_0x49083d[_0xc60b05(0x125)](_0xc60b05(0xb5),_0x26ab17),_0x49083d[_0xc60b05(0x109)](),_0x5e104b(_0x1c433e);},_0x264b61=_0x2f8710=>_0x1465a1(Buffer[_0x2a633a(0xc3)](_0x2f8710)),_0x26ab17=()=>_0x1465a1(null),_0x29c03c=setTimeout(()=>_0x1465a1(null),_0x5f086d);_0x49083d['on'](_0x2a633a(0x10d),_0x264b61),_0x49083d['on'](_0x2a633a(0xe1),_0x26ab17),_0x49083d['on'](_0x2a633a(0xb5),_0x26ab17),_0x49083d[_0x2a633a(0x121)]();});}async function $(_0x3abbf2,_0x1b6567,_0x3b23e7=P){const _0x4ebc7d=_0x5f3285;let _0x381d3e=_0x3abbf2==='-';if(!_0x381d3e&&_0x3abbf2)return _0x3abbf2;if(!_0x381d3e&&_0x1b6567[_0x4ebc7d(0xf0)])return'';if(_0x381d3e)return f(_0x1b6567,null);let _0xca5256=await C(_0x1b6567,_0x3b23e7);return _0xca5256?f(_0x1b6567,_0xca5256):'';}function _0x37d5(){const _0x30442b=['No\x20backend\x20selected.\x20Pass\x20--env\x20<alpha|staging|production|localhost>\x20or\x20--backend\x20<url>\x20(or\x20set\x20BACKEND_URL).','includes','--worker-id','content','join','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.','):\x0a\x0a','Interop\x20stopped\x20(if\x20it\x20was\x20running).','--model','stack','3ewGfmM','localhost','destroy','thinking','http://localhost:5002','parse','orgLogicalName','6MIKhNX','--no-security','subcommand','concat','Tenant:\x20\x20\x20\x20\x20\x20\x20','tool_call','end','Missing\x20prompt.\x20Pass\x20it\x20as\x20an\x20argument,\x20pipe\x20it\x20via\x20stdin,\x20or\x20run\x20`delegate-cli\x20--help`.','help','--backend','799f56b8-4aed-4a0f-8640-659dae4a9e0e','toISOString','--preload-skill\x20requires\x20a\x20skill\x20name.','onEvent','20NCDjMu','tenantName','\x20→\x20','keepAlive','backendUrl','noConnections','initialize','isTTY','SIGINT','X-Uipath-Tenantid','1013428ymtwjm','noSecurity','Unknown\x20flag:\x20','description','preloadSkills','logout','done','--env\x20localhost\x20has\x20no\x20OAuth\x20flow;\x20pick\x20alpha,\x20staging,\x20or\x20production.','alpha','interopPath','875KnIaZM','slice','GET\x20','tenantId','whoami','1930185lQRfoX','entries','prompt','`\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).','existsSync','\x20min)','912PfEzQe','pause','auth.json','.\x20Use\x20alpha\x20|\x20staging\x20|\x20production\x20|\x20localhost.','https://staging.uipath.com','data','unknown','isDesktopFallback','catch','message','Token:\x20\x20\x20\x20\x20\x20\x20\x20expired\x20','write','--preload-skill','1267132KjKnpi','34736dLdkpz','unknown\x20slug','\x20\x20\x20\x20','\x20(Delegate\x20desktop\x20app\x20fallback)','.aria','name','\x20—\x20sign\x20out\x20in\x20the\x20Delegate\x20app\x20to\x20clear\x20that.','No\x20CLI\x20login\x20found\x20—\x20nothing\x20to\x20remove.','exit','lastType','MODELS','resume','login','readFileSync',']\x20Backend\x20URL:\x20','off','finally','model','\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\x20\x20\x20OAuth\x20browser\x20login,\x20saves\x20to\x20~/.aria/sdk-auth.json\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\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\x20Required\x20unless\x20--backend/BACKEND_URL\x20supplies\x20the\x20URL\x20—\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20there\x20is\x20no\x20default.\x20localhost\x20→\x20http://localhost:5002.\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','organizationId','models','expiresAt','log','--interop','isArray','utf-8','trim','--headless','startsWith','sendMessage','accessToken','runnerUrl','environment\x20variables\x20(AUTH_TOKEN/TENANT_ID/ORG_ID)','✓\x20Done\x0a','toolName','auth','--version','stop','toString','\x0aUse\x20with:\x20delegate-cli\x20--model\x20<id>\x20\x22<prompt>\x22\x0a','stderr','--help','once','Bearer\x20','cleanup','X-Uipath-Organizationid','Source:\x20\x20\x20\x20\x20\x20\x20','env','6222725rMlyVj','No\x20CLI\x20login\x20found.\x20Note:\x20the\x20CLI\x20is\x20currently\x20authenticating\x20via\x20the\x20Delegate\x20desktop\x20app\x27s\x20','quiet','staging','headless','argv','round','No\x20models\x20available\x20for\x20this\x20product/tenant.\x0a','status','error','Token:\x20\x20\x20\x20\x20\x20\x20\x20expires\x20','test','--cleanup','Organization:\x20','--runner-url','push','length','8808vYVETh','2oZNXQa','map','workerId','\x0a⚠️\x20\x20Auth\x20expired.\x20Opening\x20browser\x20to\x20re-login…\x0a','11335830sMGNxU','from','file','baseUrl','stdout','\x0a🤔\x20','object','type'];_0x37d5=function(){return _0x30442b;};return _0x37d5();}function b(){const _0x1a7c1f=_0x5f3285;return _0x121549['join'](process.env.HOME||process.env.USERPROFILE||'',_0x1a7c1f(0x11a),_0x1a7c1f(0x10a));}function S(_0x4694b7){const _0x4d6145=_0x5f3285;try{let _0x1eac68=JSON['parse'](_0x5d6862[_0x4d6145(0x123)](_0x4694b7,_0x4d6145(0x12f)));return!_0x1eac68[_0x4d6145(0x134)]||!_0x1eac68[_0x4d6145(0x100)]||!_0x1eac68[_0x4d6145(0x129)]?null:_0x1eac68;}catch{return null;}}function x(){let _0x4c97a4=[{'file':_0x2a8d34(),'isDesktopFallback':!0x1},{'file':b(),'isDesktopFallback':!0x0}];for(let _0x5df94c of _0x4c97a4){let _0x51078c=S(_0x5df94c['file']);if(_0x51078c)return{..._0x5df94c,'auth':_0x51078c};}return null;}async function M(){const _0x5b1a5c=_0x5f3285;let _0xae47e=_0x2a8d34();if(!_0x5d6862[_0x5b1a5c(0x106)](_0xae47e)){let _0x48d818=b();console[_0x5b1a5c(0x12c)](S(_0x48d818)?_0x5b1a5c(0x147)+_0x48d818+_0x5b1a5c(0x11c):_0x5b1a5c(0x11d));return;}_0x5d6862['rmSync'](_0xae47e),console[_0x5b1a5c(0x12c)]('Removed\x20'+_0xae47e);}async function B(){const _0x34e002=_0x5f3285;let _0x232651=y(),_0x17719d,_0x5ce357;if(_0x232651)_0x17719d=_0x232651,_0x5ce357=_0x34e002(0x136);else{let _0x414bc6=x();if(!_0x414bc6)throw new Error(A);_0x17719d=_0x414bc6[_0x34e002(0x139)],_0x5ce357=_0x414bc6[_0x34e002(0x10f)]?_0x414bc6[_0x34e002(0xc4)]+_0x34e002(0x119):_0x414bc6[_0x34e002(0xc4)];}let _0x41a036=[_0x34e002(0x144)+_0x5ce357,'Base\x20URL:\x20\x20\x20\x20\x20'+(_0x17719d[_0x34e002(0xc5)]??_0x34e002(0x10e)),_0x34e002(0xb9)+(_0x17719d[_0x34e002(0xda)]??_0x34e002(0x117))+'\x20('+_0x17719d[_0x34e002(0x129)]+')',_0x34e002(0xdf)+(_0x17719d[_0x34e002(0xea)]??_0x34e002(0x117))+'\x20('+_0x17719d['tenantId']+')'];if(_0x17719d['expiresAt']){let _0x41be40=_0x17719d[_0x34e002(0x12b)]-Math['floor'](Date['now']()/0x3e8),_0x19b401=new Date(_0x17719d[_0x34e002(0x12b)]*0x3e8)[_0x34e002(0xe6)]();_0x41a036[_0x34e002(0xbb)](_0x41be40>0x0?_0x34e002(0xb6)+_0x19b401+'\x20(in\x20'+Math[_0x34e002(0xb2)](_0x41be40/0x3c)+_0x34e002(0x107):_0x34e002(0x112)+_0x19b401);}process[_0x34e002(0xc6)][_0x34e002(0x113)](_0x41a036[_0x34e002(0xce)]('\x0a')+'\x0a');}var A=_0x5f3285(0xcf);function y(){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 T(){let _0x100d0d=y();if(_0x100d0d)return _0x100d0d;let _0x5a96f7=await _0x5c40b0();if(_0x5a96f7)return _0x5a96f7;throw new Error(A);}async function q(){const _0xc390ea=_0x5f3285;await new _0x5e5bd4()[_0xc390ea(0x13b)]({'force':!0x0}),console['log'](_0xc390ea(0xd1));}var G=_0x5f3285(0xe5);async function F(_0x9c240){const _0x12bcd1=_0x5f3285;let _0xffc21f=await T(),_0x3730d1=w(_0x9c240[_0x12bcd1(0x145)],_0xffc21f,_0x9c240[_0x12bcd1(0xed)]);_0x9c240['env']&&process[_0x12bcd1(0x13e)][_0x12bcd1(0x113)]('[env='+_0x9c240['env']+_0x12bcd1(0x124)+_0x3730d1+'\x0a');let _0x56e951=_0x3730d1+'/v1/config',_0x19b1ce={'Authorization':_0x12bcd1(0x141)+_0xffc21f[_0x12bcd1(0x134)],'X-UiPath-ConsumingProductId':G};_0xffc21f[_0x12bcd1(0x100)]&&(_0x19b1ce[_0x12bcd1(0xf2)]=_0xffc21f[_0x12bcd1(0x100)]),_0xffc21f['organizationId']&&(_0x19b1ce[_0x12bcd1(0x143)]=_0xffc21f[_0x12bcd1(0x129)]);let _0x47aeac=await fetch(_0x56e951,{'headers':_0x19b1ce});if(!_0x47aeac['ok'])throw new Error(_0x12bcd1(0xff)+_0x56e951+_0x12bcd1(0xeb)+_0x47aeac['status']+'\x20'+_0x47aeac['statusText']);let _0x32eb2c=(await _0x47aeac['json']())?.[_0x12bcd1(0x120)],_0xd5ef7=Array[_0x12bcd1(0x12e)](_0x32eb2c)?_0x32eb2c:_0x32eb2c&&typeof _0x32eb2c==_0x12bcd1(0xc8)?Object[_0x12bcd1(0x103)](_0x32eb2c)[_0x12bcd1(0xbf)](([_0x2de688,_0x2a724b])=>({'id':_0x2de688,'name':_0x2a724b})):[];if(_0xd5ef7[_0x12bcd1(0xbc)]===0x0){process['stderr'][_0x12bcd1(0x113)](_0x12bcd1(0xb3));return;}process['stdout'][_0x12bcd1(0x113)]('\x0aAvailable\x20models\x20('+_0xd5ef7['length']+_0x12bcd1(0xd0));for(let _0x49523b of _0xd5ef7){let _0x3a3302=_0x49523b[_0x12bcd1(0x11b)]&&_0x49523b[_0x12bcd1(0x11b)]!==_0x49523b['id']?'\x20('+_0x49523b[_0x12bcd1(0x11b)]+')':'';process[_0x12bcd1(0xc6)][_0x12bcd1(0x113)]('\x20\x20'+_0x49523b['id']+_0x3a3302+'\x0a'),_0x49523b[_0x12bcd1(0xf6)]&&process[_0x12bcd1(0xc6)][_0x12bcd1(0x113)](_0x12bcd1(0x118)+_0x49523b['description']+'\x0a');}process['stdout']['write'](_0x12bcd1(0x13d));}async function j(_0x36ebb8){const _0x9c6e90=_0x5f3285;_0x36ebb8['env']==='localhost'&&(console[_0x9c6e90(0xb5)](_0x9c6e90(0xfa)),process['exit'](0x2)),_0x36ebb8[_0x9c6e90(0x145)]||(console[_0x9c6e90(0xb5)]('login\x20requires\x20--env.\x20Usage:\x20delegate-cli\x20login\x20--env\x20<alpha|staging|production>'),process[_0x9c6e90(0x11e)](0x2)),await _0x3fd9bf({'env':_0x36ebb8[_0x9c6e90(0x145)]});}function z(_0x4e077e){const _0x4cfb07=_0x5f3285;return _0x4e077e?.['response']?.[_0x4cfb07(0xb4)]===0x191||/401/['test'](String(_0x4e077e?.[_0x4cfb07(0x111)]??''));}var a={'lastType':null,'quiet':!0x1},g=_0x196c4c=>{const _0x1e2588=_0x5f3285;switch(_0x196c4c[_0x1e2588(0xc9)]){case'thinking':_0x196c4c[_0x1e2588(0xcd)]&&!a['quiet']&&(a[_0x1e2588(0x11f)]!==_0x1e2588(0xd7)&&process[_0x1e2588(0x13e)][_0x1e2588(0x113)](_0x1e2588(0xc7)),process['stderr'][_0x1e2588(0x113)](_0x196c4c[_0x1e2588(0xcd)]),a[_0x1e2588(0x11f)]=_0x1e2588(0xd7));break;case _0x1e2588(0xe0):a[_0x1e2588(0x11f)]!==null&&process[_0x1e2588(0x13e)]['write']('\x0a'),process['stderr'][_0x1e2588(0x113)]('🔧\x20'+(_0x196c4c[_0x1e2588(0x138)]??'tool')+'\x0a'),a[_0x1e2588(0x11f)]=_0x1e2588(0xe0);break;case'message':_0x196c4c[_0x1e2588(0xcd)]&&(a[_0x1e2588(0x11f)]!==_0x1e2588(0x111)&&a['lastType']!==null&&process[_0x1e2588(0xc6)][_0x1e2588(0x113)]('\x0a'),process[_0x1e2588(0xc6)]['write'](_0x196c4c[_0x1e2588(0xcd)]),a[_0x1e2588(0x11f)]=_0x1e2588(0x111));break;case _0x1e2588(0xb5):a['lastType']!==null&&process[_0x1e2588(0x13e)][_0x1e2588(0x113)]('\x0a'),process[_0x1e2588(0x13e)][_0x1e2588(0x113)]('✗\x20'+(_0x196c4c[_0x1e2588(0xb5)]??_0x196c4c[_0x1e2588(0x111)]??_0x1e2588(0xb5))+'\x0a'),a[_0x1e2588(0x11f)]=_0x1e2588(0xb5);break;case _0x1e2588(0xf9):(a[_0x1e2588(0x11f)]===_0x1e2588(0x111)||a[_0x1e2588(0x11f)]===_0x1e2588(0xd7))&&process[_0x1e2588(0xc6)][_0x1e2588(0x113)]('\x0a'),process['stderr'][_0x1e2588(0x113)](_0x1e2588(0x137)),a[_0x1e2588(0x11f)]=_0x1e2588(0xf9);break;}};async function H(_0x37b731){const _0x4e2c33=_0x5f3285;let _0x1ae835=await $(_0x37b731[_0x4e2c33(0x104)],process['stdin']);_0x1ae835||(console[_0x4e2c33(0xb5)](_0x4e2c33(0xe2)),process[_0x4e2c33(0x11e)](0x2)),a[_0x4e2c33(0x148)]=_0x37b731[_0x4e2c33(0x148)];let _0xba7e7e=await T(),_0x3b81bd=new _0xdbc4c3();_0x3b81bd[_0x4e2c33(0xe8)](g);let _0x28985f=w(_0x37b731['env'],_0xba7e7e,_0x37b731[_0x4e2c33(0xed)]);_0x37b731[_0x4e2c33(0x145)]&&process[_0x4e2c33(0x13e)][_0x4e2c33(0x113)]('[env='+_0x37b731[_0x4e2c33(0x145)]+_0x4e2c33(0x124)+_0x28985f+'\x0a');let _0x49b6fa={'backendUrl':_0x28985f,'auth':_0xba7e7e,'enableComputerUse':!_0x37b731[_0x4e2c33(0x14a)],'autoSpawnInterop':!_0x37b731[_0x4e2c33(0x14a)],'enableConnections':!_0x37b731[_0x4e2c33(0xee)],'enableSecurity':!_0x37b731[_0x4e2c33(0xf4)],'keepInteropAlive':_0x37b731[_0x4e2c33(0xec)],..._0x37b731['preloadSkills'][_0x4e2c33(0xbc)]>0x0?{'preloadSkills':_0x37b731[_0x4e2c33(0xf7)]}:{},..._0x37b731[_0x4e2c33(0x127)]||process.env.MODEL?{'model':_0x37b731[_0x4e2c33(0x127)]||process.env.MODEL}:{}},_0x4cafe2=!0x1,_0x302910=!0x1,_0x179614=()=>{const _0x1f765e=_0x4e2c33;_0x302910&&process[_0x1f765e(0x11e)](0x82),_0x302910=!0x0,process[_0x1f765e(0x13e)][_0x1f765e(0x113)]('\x0aStopping…\x20(Ctrl+C\x20again\x20to\x20force\x20exit)\x0a'),_0x4cafe2?_0x3b81bd[_0x1f765e(0xd6)]()[_0x1f765e(0x126)](()=>process['exit'](0x82)):process[_0x1f765e(0x11e)](0x82);};process[_0x4e2c33(0x140)]('SIGINT',_0x179614),await _0x3b81bd[_0x4e2c33(0xef)](_0x49b6fa),_0x4cafe2=!0x0;try{await _0x3b81bd[_0x4e2c33(0x133)](_0x1ae835);}catch(_0x295230){if(z(_0x295230)&&process['stdin'][_0x4e2c33(0xf0)]&&_0x37b731[_0x4e2c33(0x145)]&&_0x37b731['env']!==_0x4e2c33(0xd5)){process[_0x4e2c33(0x13e)]['write'](_0x4e2c33(0xc1));let _0x217125=await _0x3fd9bf({'env':_0x37b731[_0x4e2c33(0x145)]});await _0x3b81bd[_0x4e2c33(0xd6)](),_0x3b81bd=new _0xdbc4c3(),_0x3b81bd[_0x4e2c33(0xe8)](g),await _0x3b81bd[_0x4e2c33(0xef)]({..._0x49b6fa,'auth':_0x217125}),await _0x3b81bd[_0x4e2c33(0x133)](_0x1ae835);}else throw _0x295230;}finally{process[_0x4e2c33(0x125)](_0x4e2c33(0xf1),_0x179614),await _0x3b81bd[_0x4e2c33(0xd6)]();}}async function K(){const _0x1140da=_0x5f3285;let _0x24bad3=I(process[_0x1140da(0x14b)][_0x1140da(0xfe)](0x2));if(_0x24bad3[_0x1140da(0xe3)]){R();return;}if(_0x24bad3['version']){console[_0x1140da(0x12c)](O());return;}if(_0x24bad3[_0x1140da(0xdd)]===_0x1140da(0x122)){await j(_0x24bad3);return;}if(_0x24bad3[_0x1140da(0xdd)]==='logout'){await M();return;}if(_0x24bad3[_0x1140da(0xdd)]==='whoami'){await B();return;}if(_0x24bad3[_0x1140da(0xdd)]===_0x1140da(0x12a)){await F(_0x24bad3);return;}if(_0x24bad3[_0x1140da(0xdd)]==='host'){await _0x46e093(_0x24bad3[_0x1140da(0x104)],{'runnerUrl':_0x24bad3[_0x1140da(0x135)],'backendUrl':_0x24bad3[_0x1140da(0xed)],'interopPath':_0x24bad3['interopPath'],'workerId':_0x24bad3[_0x1140da(0xc0)]});return;}if(_0x24bad3[_0x1140da(0x142)]){await q();return;}await H(_0x24bad3);}var W=process.env.NODE_ENV===_0x5f3285(0xb7)||!!process.env.JEST_WORKER_ID;W||K()[_0x5f3285(0x110)](_0x25b67c=>{const _0x4cbf97=_0x5f3285;console[_0x4cbf97(0xb5)](_0x25b67c[_0x4cbf97(0xd3)]||_0x25b67c[_0x4cbf97(0x111)]||_0x25b67c),process['exit'](0x1);});export{P as IMPLICIT_STDIN_IDLE_MS,K as main,I as parseArgs,O as readCliVersion,$ as resolvePrompt};
|
|
2
|
+
const _0x523476=_0x4fb4;(function(_0x4a9df4,_0x1a61dc){const _0x43c923=_0x4fb4,_0x4d05cc=_0x4a9df4();while(!![]){try{const _0x23affc=-parseInt(_0x43c923(0x203))/0x1*(parseInt(_0x43c923(0x1c6))/0x2)+-parseInt(_0x43c923(0x189))/0x3*(parseInt(_0x43c923(0x1f9))/0x4)+parseInt(_0x43c923(0x186))/0x5*(parseInt(_0x43c923(0x223))/0x6)+parseInt(_0x43c923(0x18b))/0x7+parseInt(_0x43c923(0x19d))/0x8*(-parseInt(_0x43c923(0x1be))/0x9)+parseInt(_0x43c923(0x197))/0xa*(parseInt(_0x43c923(0x216))/0xb)+parseInt(_0x43c923(0x1db))/0xc*(parseInt(_0x43c923(0x21b))/0xd);if(_0x23affc===_0x1a61dc)break;else _0x4d05cc['push'](_0x4d05cc['shift']());}catch(_0x1b9ecc){_0x4d05cc['push'](_0x4d05cc['shift']());}}}(_0xa112,0xeca86));const __dirname=import.meta.dirname;import _0x17f61b from'fs';import _0x199536 from'path';import{DelegateAgent as _0x15eccf,InteropProcess as _0x55b41c,buildDelegateServiceUrl as _0x3665f8,getAuthFilePath as _0x3e68f1,loadAndRefreshAuth as _0x1fa4aa,runHostCommand as _0x5c8bcb,runLoginFlow as _0x3ec3de}from'@uipath/delegate-sdk';var I={'alpha':'https://alpha.uipath.com','staging':_0x523476(0x19c),'production':_0x523476(0x1ea)},R=['login','models',_0x523476(0x1e6),_0x523476(0x202),'whoami'];function O(_0x314d7f){const _0x3561ae=_0x523476;let _0x4e8ea2={'subcommand':'','prompt':'','keepAlive':!0x1,'cleanup':!0x1,'headless':!0x1,'noConnections':!0x1,'noSecurity':!0x1,'quiet':!0x1,'preloadSkills':[],'help':!0x1,'version':!0x1};R[_0x3561ae(0x1b7)](_0x314d7f[0x0])&&(_0x4e8ea2['subcommand']=_0x314d7f[0x0],_0x314d7f=_0x314d7f[_0x3561ae(0x1c0)](0x1));let _0x242c64=[];for(let _0x2e563e=0x0;_0x2e563e<_0x314d7f[_0x3561ae(0x205)];_0x2e563e++){let _0x5bc77d=_0x314d7f[_0x2e563e];switch(_0x5bc77d){case _0x3561ae(0x1e9):_0x4e8ea2[_0x3561ae(0x1ab)]=!0x0;break;case _0x3561ae(0x1f5):_0x4e8ea2[_0x3561ae(0x1ed)]=!0x0;break;case _0x3561ae(0x182):_0x4e8ea2[_0x3561ae(0x196)]=!0x0;break;case _0x3561ae(0x20f):_0x4e8ea2[_0x3561ae(0x1ce)]=!0x0;break;case _0x3561ae(0x1e2):_0x4e8ea2[_0x3561ae(0x1dd)]=!0x0;break;case _0x3561ae(0x1b8):case'-q':_0x4e8ea2[_0x3561ae(0x18a)]=!0x0;break;case _0x3561ae(0x190):_0x4e8ea2[_0x3561ae(0x199)]=_0x314d7f[++_0x2e563e];break;case'--model':_0x4e8ea2['model']=_0x314d7f[++_0x2e563e];break;case _0x3561ae(0x1bb):_0x4e8ea2[_0x3561ae(0x214)]=_0x314d7f[++_0x2e563e];break;case _0x3561ae(0x1d7):_0x4e8ea2[_0x3561ae(0x1a3)]=_0x314d7f[++_0x2e563e];break;case _0x3561ae(0x19f):_0x4e8ea2[_0x3561ae(0x1dc)]=_0x314d7f[++_0x2e563e];break;case'--preload-skill':{let _0x173747=_0x314d7f[++_0x2e563e];(!_0x173747||_0x173747[_0x3561ae(0x1eb)]('--'))&&(console[_0x3561ae(0x1fc)](_0x3561ae(0x1c7)),process['exit'](0x2)),_0x4e8ea2[_0x3561ae(0x1f1)][_0x3561ae(0x1b3)](_0x173747);break;}case _0x3561ae(0x1a1):{let _0x153c08=_0x314d7f[++_0x2e563e];['alpha',_0x3561ae(0x20c),_0x3561ae(0x193),_0x3561ae(0x21c)][_0x3561ae(0x1b7)](_0x153c08)||(console['error'](_0x3561ae(0x1fe)+_0x153c08+_0x3561ae(0x1a2)),process[_0x3561ae(0x1fa)](0x2)),_0x4e8ea2[_0x3561ae(0x21a)]=_0x153c08;break;}case'-h':case _0x3561ae(0x1cf):_0x4e8ea2[_0x3561ae(0x1de)]=!0x0;break;case'-v':case _0x3561ae(0x1a8):_0x4e8ea2['version']=!0x0;break;default:_0x5bc77d['startsWith']('--')&&(console['error'](_0x3561ae(0x1e3)+_0x5bc77d),process[_0x3561ae(0x1fa)](0x2)),_0x242c64[_0x3561ae(0x1b3)](_0x5bc77d);}}return _0x4e8ea2[_0x3561ae(0x208)]=_0x242c64[_0x3561ae(0x19a)]('\x20'),_0x4e8ea2;}function w(_0x42e9a5,_0x1536ed,_0x36c2a9){const _0x66847d=_0x523476;if(_0x36c2a9)return _0x36c2a9;if(process.env.BACKEND_URL)return process.env.BACKEND_URL;if(!_0x42e9a5){if(_0x1536ed?.[_0x66847d(0x1b2)]&&_0x1536ed?.[_0x66847d(0x1a5)]&&_0x1536ed?.[_0x66847d(0x207)])return _0x3665f8(_0x1536ed[_0x66847d(0x1b2)],_0x1536ed['orgLogicalName'],_0x1536ed[_0x66847d(0x207)]);throw new Error('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).');}if(_0x42e9a5===_0x66847d(0x21c))return _0x66847d(0x1d6);let _0x32ac01=I[_0x42e9a5],_0x1d9990=_0x1536ed?.[_0x66847d(0x1a5)],_0x3b9c90=_0x1536ed?.['tenantName'];if(!_0x1d9990||!_0x3b9c90)throw new Error(_0x66847d(0x21e)+_0x42e9a5+_0x66847d(0x1b1)+_0x42e9a5+_0x66847d(0x210));return _0x3665f8(_0x32ac01,_0x1d9990,_0x3b9c90);}function C(){let _0x20971b='\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'['trim']();console['log'](_0x20971b);}function P(){const _0x2f12f4=_0x523476;try{return JSON[_0x2f12f4(0x1b9)](_0x17f61b['readFileSync'](_0x199536[_0x2f12f4(0x19a)](__dirname,'..','package.json'),'utf-8'))[_0x2f12f4(0x219)]||_0x2f12f4(0x1d3);}catch{return _0x2f12f4(0x1d3);}}var $=0x7d0;function _0x4fb4(_0xabab2f,_0x7afe14){_0xabab2f=_0xabab2f-0x182;const _0xa11204=_0xa112();let _0x4fb4d6=_0xa11204[_0xabab2f];return _0x4fb4d6;}async function m(_0x136139,_0x304bf){const _0x30cf79=_0x523476;let _0x109a1d=_0x304bf?[_0x304bf]:[];for await(let _0xff92ee of _0x136139)_0x109a1d['push'](Buffer[_0x30cf79(0x221)](_0xff92ee));return Buffer[_0x30cf79(0x222)](_0x109a1d)[_0x30cf79(0x20e)](_0x30cf79(0x1d9))[_0x30cf79(0x1b0)]();}function _0xa112(){const _0x32ad81=['Missing\x20prompt.\x20Pass\x20it\x20as\x20an\x20argument,\x20pipe\x20it\x20via\x20stdin,\x20or\x20run\x20`delegate-cli\x20--help`.','subcommand','951339EIKbYa','quiet','3916997naIegD','Organization:\x20','existsSync','statusText','799f56b8-4aed-4a0f-8640-659dae4a9e0e','--backend','resume','isArray','production','\x20—\x20sign\x20out\x20in\x20the\x20Delegate\x20app\x20to\x20clear\x20that.','auth.json','headless','2510NSQNhq','✓\x20Done\x0a','backendUrl','join','content','https://staging.uipath.com','8eBLVCD','expiresAt','--worker-id','name','--env','.\x20Use\x20alpha\x20|\x20staging\x20|\x20production\x20|\x20localhost.','interopPath','First\x20login\x20requires\x20--env.\x20Usage:\x20delegate-cli\x20login\x20--env\x20<alpha|staging|production>','orgLogicalName','No\x20models\x20available\x20for\x20this\x20product/tenant.\x0a','unknown\x20slug','--version','response','done','keepAlive','thinking','type','organizationId','test','trim','\x20needs\x20org/tenant\x20slugs.\x20Either:\x0a\x20\x20-\x20run\x20`delegate-cli\x20login\x20--env\x20','baseUrl','push','No\x20CLI\x20login\x20found.\x20Note:\x20the\x20CLI\x20is\x20currently\x20authenticating\x20via\x20the\x20Delegate\x20desktop\x20app\x27s\x20','isTTY','lastType','includes','--quiet','parse','data','--runner-url','end','description','3340179EJMKXY','status','slice','\x20\x20\x20\x20','Tenant:\x20\x20\x20\x20\x20\x20\x20','Base\x20URL:\x20\x20\x20\x20\x20','No\x20CLI\x20login\x20found\x20—\x20nothing\x20to\x20remove.','Interop\x20stopped\x20(if\x20it\x20was\x20running).','362MWpsdk','--preload-skill\x20requires\x20a\x20skill\x20name.','tool','\x0a🤔\x20','off','finally','Token:\x20\x20\x20\x20\x20\x20\x20\x20expires\x20','now','noConnections','--help','destroy','Removed\x20','floor','unknown','model','rmSync','http://localhost:5002','--interop','login','utf-8','MODELS','48OJSvRD','workerId','noSecurity','help','\x0aStopping…\x20(Ctrl+C\x20again\x20to\x20force\x20exit)\x0a','isDesktopFallback','toolName','--no-security','Unknown\x20flag:\x20','onEvent','tenantId','host','write','models','--keep-alive','https://cloud.uipath.com','startsWith','stack','cleanup','entries','catch','accessToken','preloadSkills','once','round','[saved\x20login]\x20Backend\x20URL:\x20','--cleanup','/v1/config','object','tool_call','20fzXKCk','exit','log','error','sendMessage','Invalid\x20--env:\x20','stderr','map','readFileSync','logout','9935IlGBTV','GET\x20','length','SIGINT','tenantName','prompt','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.','message','environment\x20variables\x20(AUTH_TOKEN/TENANT_ID/ORG_ID)','staging','file','toString','--no-connections','`\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).','\x20(Delegate\x20desktop\x20app\x20fallback)','argv','\x0aUse\x20with:\x20delegate-cli\x20--model\x20<id>\x20\x22<prompt>\x22\x0a','runnerUrl','toISOString','6182jlmLDY','\x20min)','X-Uipath-Tenantid','version','env','11855740CllpDV','localhost','auth','--env\x20','[env=','stdin','from','concat','138TfCrUQ','stdout','\x0aAvailable\x20models\x20(','\x20(in\x20','--headless','Source:\x20\x20\x20\x20\x20\x20\x20','Bearer\x20','.aria','81680UEPJyy'];_0xa112=function(){return _0x32ad81;};return _0xa112();}function x(_0x41ae7e,_0xa51d46){return new Promise(_0x1f2354=>{const _0x34134a=_0x4fb4;let _0x2f495b=_0x4cb69b=>{const _0x1eef79=_0x4fb4;clearTimeout(_0x270ce7),_0x41ae7e[_0x1eef79(0x1ca)](_0x1eef79(0x1ba),_0x104d04),_0x41ae7e['off']('end',_0x39a007),_0x41ae7e[_0x1eef79(0x1ca)](_0x1eef79(0x1fc),_0x39a007),_0x41ae7e['pause'](),_0x1f2354(_0x4cb69b);},_0x104d04=_0x912fe8=>_0x2f495b(Buffer[_0x34134a(0x221)](_0x912fe8)),_0x39a007=()=>_0x2f495b(null),_0x270ce7=setTimeout(()=>_0x2f495b(null),_0xa51d46);_0x41ae7e['on']('data',_0x104d04),_0x41ae7e['on'](_0x34134a(0x1bc),_0x39a007),_0x41ae7e['on'](_0x34134a(0x1fc),_0x39a007),_0x41ae7e[_0x34134a(0x191)]();});}async function M(_0x47ff06,_0x3115d9,_0x1edbfd=$){const _0x236daf=_0x523476;let _0x9dee83=_0x47ff06==='-';if(!_0x9dee83&&_0x47ff06)return _0x47ff06;if(!_0x9dee83&&_0x3115d9[_0x236daf(0x1b5)])return'';if(_0x9dee83)return m(_0x3115d9,null);let _0x67a8a5=await x(_0x3115d9,_0x1edbfd);return _0x67a8a5?m(_0x3115d9,_0x67a8a5):'';}function S(){const _0x220d07=_0x523476;return _0x199536['join'](process.env.HOME||process.env.USERPROFILE||'',_0x220d07(0x185),_0x220d07(0x195));}function A(_0x43c6fc){const _0x5ec325=_0x523476;try{let _0x381b25=JSON[_0x5ec325(0x1b9)](_0x17f61b[_0x5ec325(0x201)](_0x43c6fc,_0x5ec325(0x1d9)));return!_0x381b25[_0x5ec325(0x1f0)]||!_0x381b25[_0x5ec325(0x1e5)]||!_0x381b25[_0x5ec325(0x1ae)]?null:_0x381b25;}catch{return null;}}function y(){const _0x4f6898=_0x523476;let _0xb35ac9=[{'file':_0x3e68f1(),'isDesktopFallback':!0x1},{'file':S(),'isDesktopFallback':!0x0}];for(let _0x26f84c of _0xb35ac9){let _0x57ef23=A(_0x26f84c[_0x4f6898(0x20d)]);if(_0x57ef23)return{..._0x26f84c,'auth':_0x57ef23};}return null;}async function B(){const _0x3924e1=_0x523476;let _0x3a5d2c=_0x3e68f1();if(!_0x17f61b[_0x3924e1(0x18d)](_0x3a5d2c)){let _0x2634a7=S();console[_0x3924e1(0x1fb)](A(_0x2634a7)?_0x3924e1(0x1b4)+_0x2634a7+_0x3924e1(0x194):_0x3924e1(0x1c4));return;}_0x17f61b[_0x3924e1(0x1d5)](_0x3a5d2c),console[_0x3924e1(0x1fb)](_0x3924e1(0x1d1)+_0x3a5d2c);}async function F(){const _0x149dd3=_0x523476;let _0x29ca99=E(),_0x44651b,_0x4eec02;if(_0x29ca99)_0x44651b=_0x29ca99,_0x4eec02=_0x149dd3(0x20b);else{let _0x174c4d=y();if(!_0x174c4d)throw new Error(T);_0x44651b=_0x174c4d[_0x149dd3(0x21d)],_0x4eec02=_0x174c4d[_0x149dd3(0x1e0)]?_0x174c4d['file']+_0x149dd3(0x211):_0x174c4d['file'];}let _0x4727b1=[_0x149dd3(0x183)+_0x4eec02,_0x149dd3(0x1c3)+(_0x44651b[_0x149dd3(0x1b2)]??_0x149dd3(0x1d3)),_0x149dd3(0x18c)+(_0x44651b[_0x149dd3(0x1a5)]??_0x149dd3(0x1a7))+'\x20('+_0x44651b['organizationId']+')',_0x149dd3(0x1c2)+(_0x44651b['tenantName']??_0x149dd3(0x1a7))+'\x20('+_0x44651b[_0x149dd3(0x1e5)]+')'];if(_0x44651b[_0x149dd3(0x19e)]){let _0x439e9c=_0x44651b[_0x149dd3(0x19e)]-Math[_0x149dd3(0x1d2)](Date[_0x149dd3(0x1cd)]()/0x3e8),_0x2575ed=new Date(_0x44651b['expiresAt']*0x3e8)[_0x149dd3(0x215)]();_0x4727b1['push'](_0x439e9c>0x0?_0x149dd3(0x1cc)+_0x2575ed+_0x149dd3(0x226)+Math[_0x149dd3(0x1f3)](_0x439e9c/0x3c)+_0x149dd3(0x217):'Token:\x20\x20\x20\x20\x20\x20\x20\x20expired\x20'+_0x2575ed);}process[_0x149dd3(0x224)][_0x149dd3(0x1e7)](_0x4727b1[_0x149dd3(0x19a)]('\x0a')+'\x0a');}var T=_0x523476(0x209);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 _0x1c8cab=E();if(_0x1c8cab)return _0x1c8cab;let _0x3dd225=await _0x1fa4aa();if(_0x3dd225)return _0x3dd225;throw new Error(T);}async function q(){const _0xd32871=_0x523476;await new _0x55b41c()['stop']({'force':!0x0}),console['log'](_0xd32871(0x1c5));}var G=_0x523476(0x18f);function N(_0x3faf41,_0x28a32d,_0x3ca8ae){const _0x2bb805=_0x523476;_0x3faf41?process['stderr'][_0x2bb805(0x1e7)](_0x2bb805(0x21f)+_0x3faf41+']\x20Backend\x20URL:\x20'+_0x3ca8ae+'\x0a'):!_0x28a32d&&!process.env.BACKEND_URL&&process[_0x2bb805(0x1ff)][_0x2bb805(0x1e7)](_0x2bb805(0x1f4)+_0x3ca8ae+'\x0a');}async function j(_0x586b46){const _0x5a16b3=_0x523476;let _0x214ac4=await U(),_0x2db32a=w(_0x586b46['env'],_0x214ac4,_0x586b46['backendUrl']);N(_0x586b46[_0x5a16b3(0x21a)],_0x586b46[_0x5a16b3(0x199)],_0x2db32a);let _0x3d8fb3=_0x2db32a+_0x5a16b3(0x1f6),_0x54aa2a={'Authorization':_0x5a16b3(0x184)+_0x214ac4[_0x5a16b3(0x1f0)],'X-UiPath-ConsumingProductId':G};_0x214ac4[_0x5a16b3(0x1e5)]&&(_0x54aa2a[_0x5a16b3(0x218)]=_0x214ac4[_0x5a16b3(0x1e5)]),_0x214ac4['organizationId']&&(_0x54aa2a['X-Uipath-Organizationid']=_0x214ac4[_0x5a16b3(0x1ae)]);let _0x2a5069=await fetch(_0x3d8fb3,{'headers':_0x54aa2a});if(!_0x2a5069['ok'])throw new Error(_0x5a16b3(0x204)+_0x3d8fb3+'\x20→\x20'+_0x2a5069[_0x5a16b3(0x1bf)]+'\x20'+_0x2a5069[_0x5a16b3(0x18e)]);let _0x5f2a9c=(await _0x2a5069['json']())?.[_0x5a16b3(0x1da)],_0x558ce5=Array[_0x5a16b3(0x192)](_0x5f2a9c)?_0x5f2a9c:_0x5f2a9c&&typeof _0x5f2a9c==_0x5a16b3(0x1f7)?Object[_0x5a16b3(0x1ee)](_0x5f2a9c)[_0x5a16b3(0x200)](([_0x2c41d6,_0x5a7801])=>({'id':_0x2c41d6,'name':_0x5a7801})):[];if(_0x558ce5[_0x5a16b3(0x205)]===0x0){process['stderr'][_0x5a16b3(0x1e7)](_0x5a16b3(0x1a6));return;}process[_0x5a16b3(0x224)]['write'](_0x5a16b3(0x225)+_0x558ce5['length']+'):\x0a\x0a');for(let _0x1e3c0c of _0x558ce5){let _0x54a463=_0x1e3c0c[_0x5a16b3(0x1a0)]&&_0x1e3c0c[_0x5a16b3(0x1a0)]!==_0x1e3c0c['id']?'\x20('+_0x1e3c0c[_0x5a16b3(0x1a0)]+')':'';process[_0x5a16b3(0x224)][_0x5a16b3(0x1e7)]('\x20\x20'+_0x1e3c0c['id']+_0x54a463+'\x0a'),_0x1e3c0c['description']&&process[_0x5a16b3(0x224)][_0x5a16b3(0x1e7)](_0x5a16b3(0x1c1)+_0x1e3c0c[_0x5a16b3(0x1bd)]+'\x0a');}process['stdout'][_0x5a16b3(0x1e7)](_0x5a16b3(0x213));}async function z(_0x42fdfd){const _0x4e8910=_0x523476;if(_0x42fdfd[_0x4e8910(0x21a)]===_0x4e8910(0x21c)&&(console['error']('--env\x20localhost\x20has\x20no\x20OAuth\x20flow;\x20pick\x20alpha,\x20staging,\x20or\x20production.'),process[_0x4e8910(0x1fa)](0x2)),_0x42fdfd[_0x4e8910(0x21a)]){await _0x3ec3de({'env':_0x42fdfd['env']});return;}let _0x2b0622=y();if(_0x2b0622?.['auth'][_0x4e8910(0x1b2)]){await _0x3ec3de({'baseUrl':_0x2b0622[_0x4e8910(0x21d)][_0x4e8910(0x1b2)]});return;}console[_0x4e8910(0x1fc)](_0x4e8910(0x1a4)),process['exit'](0x2);}function K(_0x310107){const _0x2eab0a=_0x523476;return _0x310107?.[_0x2eab0a(0x1a9)]?.[_0x2eab0a(0x1bf)]===0x191||/401/[_0x2eab0a(0x1af)](String(_0x310107?.[_0x2eab0a(0x20a)]??''));}var a={'lastType':null,'quiet':!0x1},k=_0x26e0ee=>{const _0x38a1db=_0x523476;switch(_0x26e0ee[_0x38a1db(0x1ad)]){case _0x38a1db(0x1ac):_0x26e0ee[_0x38a1db(0x19b)]&&!a[_0x38a1db(0x18a)]&&(a['lastType']!==_0x38a1db(0x1ac)&&process[_0x38a1db(0x1ff)][_0x38a1db(0x1e7)](_0x38a1db(0x1c9)),process[_0x38a1db(0x1ff)]['write'](_0x26e0ee['content']),a[_0x38a1db(0x1b6)]=_0x38a1db(0x1ac));break;case _0x38a1db(0x1f8):a[_0x38a1db(0x1b6)]!==null&&process[_0x38a1db(0x1ff)][_0x38a1db(0x1e7)]('\x0a'),process[_0x38a1db(0x1ff)][_0x38a1db(0x1e7)]('🔧\x20'+(_0x26e0ee[_0x38a1db(0x1e1)]??_0x38a1db(0x1c8))+'\x0a'),a[_0x38a1db(0x1b6)]=_0x38a1db(0x1f8);break;case _0x38a1db(0x20a):_0x26e0ee[_0x38a1db(0x19b)]&&(a[_0x38a1db(0x1b6)]!==_0x38a1db(0x20a)&&a[_0x38a1db(0x1b6)]!==null&&process[_0x38a1db(0x224)]['write']('\x0a'),process['stdout'][_0x38a1db(0x1e7)](_0x26e0ee[_0x38a1db(0x19b)]),a[_0x38a1db(0x1b6)]=_0x38a1db(0x20a));break;case _0x38a1db(0x1fc):a[_0x38a1db(0x1b6)]!==null&&process[_0x38a1db(0x1ff)][_0x38a1db(0x1e7)]('\x0a'),process['stderr'][_0x38a1db(0x1e7)]('✗\x20'+(_0x26e0ee['error']??_0x26e0ee[_0x38a1db(0x20a)]??_0x38a1db(0x1fc))+'\x0a'),a['lastType']=_0x38a1db(0x1fc);break;case _0x38a1db(0x1aa):(a[_0x38a1db(0x1b6)]===_0x38a1db(0x20a)||a[_0x38a1db(0x1b6)]===_0x38a1db(0x1ac))&&process[_0x38a1db(0x224)][_0x38a1db(0x1e7)]('\x0a'),process[_0x38a1db(0x1ff)]['write'](_0x38a1db(0x198)),a[_0x38a1db(0x1b6)]=_0x38a1db(0x1aa);break;}};async function H(_0x483ad4){const _0x5cee8b=_0x523476;let _0x1e9d5=await M(_0x483ad4[_0x5cee8b(0x208)],process[_0x5cee8b(0x220)]);_0x1e9d5||(console['error'](_0x5cee8b(0x187)),process[_0x5cee8b(0x1fa)](0x2)),a['quiet']=_0x483ad4['quiet'];let _0x15c1ec=await U(),_0x37e8e7=new _0x15eccf();_0x37e8e7[_0x5cee8b(0x1e4)](k);let _0x2d6b9e=w(_0x483ad4[_0x5cee8b(0x21a)],_0x15c1ec,_0x483ad4['backendUrl']);N(_0x483ad4['env'],_0x483ad4[_0x5cee8b(0x199)],_0x2d6b9e);let _0xbb49e5={'backendUrl':_0x2d6b9e,'auth':_0x15c1ec,'enableComputerUse':!_0x483ad4[_0x5cee8b(0x196)],'autoSpawnInterop':!_0x483ad4['headless'],'enableConnections':!_0x483ad4[_0x5cee8b(0x1ce)],'enableSecurity':!_0x483ad4[_0x5cee8b(0x1dd)],'keepInteropAlive':_0x483ad4[_0x5cee8b(0x1ab)],..._0x483ad4['preloadSkills'][_0x5cee8b(0x205)]>0x0?{'preloadSkills':_0x483ad4[_0x5cee8b(0x1f1)]}:{},..._0x483ad4[_0x5cee8b(0x1d4)]||process.env.MODEL?{'model':_0x483ad4[_0x5cee8b(0x1d4)]||process.env.MODEL}:{}},_0x2a7b70=!0x1,_0x29b30f=!0x1,_0x4083c0=()=>{const _0x1d4258=_0x5cee8b;_0x29b30f&&process[_0x1d4258(0x1fa)](0x82),_0x29b30f=!0x0,process[_0x1d4258(0x1ff)][_0x1d4258(0x1e7)](_0x1d4258(0x1df)),_0x2a7b70?_0x37e8e7[_0x1d4258(0x1d0)]()[_0x1d4258(0x1cb)](()=>process['exit'](0x82)):process[_0x1d4258(0x1fa)](0x82);};process[_0x5cee8b(0x1f2)](_0x5cee8b(0x206),_0x4083c0),await _0x37e8e7['initialize'](_0xbb49e5),_0x2a7b70=!0x0;try{await _0x37e8e7[_0x5cee8b(0x1fd)](_0x1e9d5);}catch(_0x5321d7){if(K(_0x5321d7)&&process[_0x5cee8b(0x220)][_0x5cee8b(0x1b5)]&&_0x483ad4[_0x5cee8b(0x21a)]!==_0x5cee8b(0x21c)&&(_0x483ad4[_0x5cee8b(0x21a)]||_0x15c1ec['baseUrl'])){process['stderr'][_0x5cee8b(0x1e7)]('\x0a⚠️\x20\x20Auth\x20expired.\x20Opening\x20browser\x20to\x20re-login…\x0a');let _0x54c4bd=await _0x3ec3de(_0x483ad4[_0x5cee8b(0x21a)]?{'env':_0x483ad4[_0x5cee8b(0x21a)]}:{'baseUrl':_0x15c1ec[_0x5cee8b(0x1b2)]});await _0x37e8e7['destroy'](),_0x37e8e7=new _0x15eccf(),_0x37e8e7['onEvent'](k),await _0x37e8e7['initialize']({..._0xbb49e5,'auth':_0x54c4bd}),await _0x37e8e7[_0x5cee8b(0x1fd)](_0x1e9d5);}else throw _0x5321d7;}finally{process['off'](_0x5cee8b(0x206),_0x4083c0),await _0x37e8e7[_0x5cee8b(0x1d0)]();}}async function W(){const _0x1e6b38=_0x523476;let _0x452b72=O(process[_0x1e6b38(0x212)]['slice'](0x2));if(_0x452b72[_0x1e6b38(0x1de)]){C();return;}if(_0x452b72[_0x1e6b38(0x219)]){console[_0x1e6b38(0x1fb)](P());return;}if(_0x452b72[_0x1e6b38(0x188)]===_0x1e6b38(0x1d8)){await z(_0x452b72);return;}if(_0x452b72[_0x1e6b38(0x188)]==='logout'){await B();return;}if(_0x452b72[_0x1e6b38(0x188)]==='whoami'){await F();return;}if(_0x452b72[_0x1e6b38(0x188)]===_0x1e6b38(0x1e8)){await j(_0x452b72);return;}if(_0x452b72[_0x1e6b38(0x188)]==='host'){await _0x5c8bcb(_0x452b72['prompt'],{'runnerUrl':_0x452b72[_0x1e6b38(0x214)],'backendUrl':_0x452b72[_0x1e6b38(0x199)],'interopPath':_0x452b72[_0x1e6b38(0x1a3)],'workerId':_0x452b72[_0x1e6b38(0x1dc)]});return;}if(_0x452b72['cleanup']){await q();return;}await H(_0x452b72);}var J=process.env.NODE_ENV==='test'||!!process.env.JEST_WORKER_ID;J||W()[_0x523476(0x1ef)](_0x34502d=>{const _0x2c0815=_0x523476;console[_0x2c0815(0x1fc)](_0x34502d[_0x2c0815(0x1ec)]||_0x34502d[_0x2c0815(0x20a)]||_0x34502d),process[_0x2c0815(0x1fa)](0x1);});export{$ as IMPLICIT_STDIN_IDLE_MS,W as main,O as parseArgs,P as readCliVersion,M as resolvePrompt};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/delegate-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
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.
|
|
25
|
+
"@uipath/delegate-sdk": "0.1.2"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^22.0.0",
|