@uipath/delegate-cli 0.1.6 → 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 +12 -2
- package/dist/cli.mjs +1 -1
- package/package.json +2 -2
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]
|
|
38
|
-
|
|
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 _0x2f0b42=_0x52d9;(function(_0x1ad841,_0x979da7){const _0x145c7a=_0x52d9,_0x76ed51=_0x1ad841();while(!![]){try{const _0x87d2fc=-parseInt(_0x145c7a(0x229))/0x1+parseInt(_0x145c7a(0x1c0))/0x2+-parseInt(_0x145c7a(0x1e4))/0x3+-parseInt(_0x145c7a(0x1ca))/0x4*(-parseInt(_0x145c7a(0x236))/0x5)+-parseInt(_0x145c7a(0x1f9))/0x6*(-parseInt(_0x145c7a(0x1f6))/0x7)+-parseInt(_0x145c7a(0x215))/0x8+-parseInt(_0x145c7a(0x1ec))/0x9*(-parseInt(_0x145c7a(0x1d9))/0xa);if(_0x87d2fc===_0x979da7)break;else _0x76ed51['push'](_0x76ed51['shift']());}catch(_0x3da134){_0x76ed51['push'](_0x76ed51['shift']());}}}(_0x4c16,0xbf9a0));const __dirname=import.meta.dirname;import _0x19202a from'fs';import _0x33fcfd from'path';import{DelegateAgent as _0x2bb8b8,InteropProcess as _0x3c4eec,buildDelegateServiceUrl as _0x52483c,getAuthFilePath as _0x556aeb,loadAndRefreshAuth as _0x191ceb,runHostCommand as _0x562e79,runLoginFlow as _0x2ee80d}from'@uipath/delegate-sdk';var I={'alpha':_0x2f0b42(0x211),'staging':'https://staging.uipath.com','production':_0x2f0b42(0x213)},R=['login',_0x2f0b42(0x24f),_0x2f0b42(0x230),_0x2f0b42(0x217),_0x2f0b42(0x203)];function O(_0x523f15){const _0x26c0aa=_0x2f0b42;let _0x34e719={'subcommand':'','prompt':'','keepAlive':!0x1,'cleanup':!0x1,'headless':!0x1,'noConnections':!0x1,'noSecurity':!0x1,'quiet':!0x1,'preloadSkills':[],'help':!0x1,'version':!0x1};R[_0x26c0aa(0x24b)](_0x523f15[0x0])&&(_0x34e719[_0x26c0aa(0x1fd)]=_0x523f15[0x0],_0x523f15=_0x523f15[_0x26c0aa(0x207)](0x1));let _0x3caa2a=[];for(let _0x2d784b=0x0;_0x2d784b<_0x523f15[_0x26c0aa(0x204)];_0x2d784b++){let _0x5c4b3f=_0x523f15[_0x2d784b];switch(_0x5c4b3f){case'--keep-alive':_0x34e719[_0x26c0aa(0x1e8)]=!0x0;break;case'--cleanup':_0x34e719[_0x26c0aa(0x22d)]=!0x0;break;case'--headless':_0x34e719[_0x26c0aa(0x1de)]=!0x0;break;case _0x26c0aa(0x237):_0x34e719[_0x26c0aa(0x228)]=!0x0;break;case _0x26c0aa(0x205):_0x34e719[_0x26c0aa(0x242)]=!0x0;break;case _0x26c0aa(0x233):case'-q':_0x34e719[_0x26c0aa(0x21e)]=!0x0;break;case'--backend':_0x34e719[_0x26c0aa(0x247)]=_0x523f15[++_0x2d784b];break;case _0x26c0aa(0x202):_0x34e719[_0x26c0aa(0x20d)]=_0x523f15[++_0x2d784b];break;case'--runner-url':_0x34e719[_0x26c0aa(0x235)]=_0x523f15[++_0x2d784b];break;case _0x26c0aa(0x21d):_0x34e719[_0x26c0aa(0x1f1)]=_0x523f15[++_0x2d784b];break;case'--worker-id':_0x34e719[_0x26c0aa(0x1c2)]=_0x523f15[++_0x2d784b];break;case'--preload-skill':{let _0x1d6d05=_0x523f15[++_0x2d784b];(!_0x1d6d05||_0x1d6d05['startsWith']('--'))&&(console['error'](_0x26c0aa(0x1bc)),process[_0x26c0aa(0x1ef)](0x2)),_0x34e719[_0x26c0aa(0x1d2)][_0x26c0aa(0x206)](_0x1d6d05);break;}case _0x26c0aa(0x218):{let _0x2d699b=_0x523f15[++_0x2d784b];['alpha',_0x26c0aa(0x20e),_0x26c0aa(0x1c5),_0x26c0aa(0x1e1)]['includes'](_0x2d699b)||(console[_0x26c0aa(0x212)]('Invalid\x20--env:\x20'+_0x2d699b+_0x26c0aa(0x249)),process[_0x26c0aa(0x1ef)](0x2)),_0x34e719['env']=_0x2d699b;break;}case'-h':case _0x26c0aa(0x1da):_0x34e719[_0x26c0aa(0x24c)]=!0x0;break;case'-v':case'--version':_0x34e719[_0x26c0aa(0x1e5)]=!0x0;break;default:_0x5c4b3f[_0x26c0aa(0x1c3)]('--')&&(console[_0x26c0aa(0x212)](_0x26c0aa(0x20f)+_0x5c4b3f),process[_0x26c0aa(0x1ef)](0x2)),_0x3caa2a[_0x26c0aa(0x206)](_0x5c4b3f);}}return _0x34e719[_0x26c0aa(0x22e)]=_0x3caa2a[_0x26c0aa(0x22b)]('\x20'),_0x34e719;}function w(_0x1000c6,_0x174fff,_0x457515){const _0xfce530=_0x2f0b42;if(_0x457515)return _0x457515;if(process.env.BACKEND_URL)return process.env.BACKEND_URL;if(!_0x1000c6){if(_0x174fff?.[_0xfce530(0x1ed)]&&_0x174fff?.[_0xfce530(0x1d0)]&&_0x174fff?.[_0xfce530(0x1cc)])return _0x52483c(_0x174fff[_0xfce530(0x1ed)],_0x174fff[_0xfce530(0x1d0)],_0x174fff[_0xfce530(0x1cc)]);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(_0x1000c6==='localhost')return _0xfce530(0x1db);let _0x113a7a=I[_0x1000c6],_0x3aec1c=_0x174fff?.['orgLogicalName'],_0x8d426=_0x174fff?.[_0xfce530(0x1cc)];if(!_0x3aec1c||!_0x8d426)throw new Error('--env\x20'+_0x1000c6+'\x20needs\x20org/tenant\x20slugs.\x20Either:\x0a\x20\x20-\x20run\x20`delegate-cli\x20login\x20--env\x20'+_0x1000c6+_0xfce530(0x22f));return _0x52483c(_0x113a7a,_0x3aec1c,_0x8d426);}function C(){const _0x3a7767=_0x2f0b42;let _0x5f057d='\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'[_0x3a7767(0x1e6)]();console[_0x3a7767(0x227)](_0x5f057d);}function P(){const _0x5794b0=_0x2f0b42;try{return JSON[_0x5794b0(0x1bd)](_0x19202a[_0x5794b0(0x1cf)](_0x33fcfd[_0x5794b0(0x22b)](__dirname,'..','package.json'),_0x5794b0(0x1c1)))['version']||_0x5794b0(0x224);}catch{return _0x5794b0(0x224);}}var $=0x7d0;async function m(_0xced5a0,_0x26ef51){const _0x1b54a2=_0x2f0b42;let _0x2b29e7=_0x26ef51?[_0x26ef51]:[];for await(let _0x4f61e0 of _0xced5a0)_0x2b29e7[_0x1b54a2(0x206)](Buffer[_0x1b54a2(0x241)](_0x4f61e0));return Buffer[_0x1b54a2(0x1d3)](_0x2b29e7)[_0x1b54a2(0x214)](_0x1b54a2(0x1c1))[_0x1b54a2(0x1e6)]();}function x(_0x206a2c,_0x1bfb9f){return new Promise(_0xad8ab6=>{const _0x402d4c=_0x52d9;let _0x2a366d=_0x31e8c1=>{const _0xabc40=_0x52d9;clearTimeout(_0x2f6f26),_0x206a2c[_0xabc40(0x1f4)](_0xabc40(0x1dd),_0xc1436b),_0x206a2c['off'](_0xabc40(0x201),_0x5921ac),_0x206a2c['off'](_0xabc40(0x212),_0x5921ac),_0x206a2c[_0xabc40(0x1fc)](),_0xad8ab6(_0x31e8c1);},_0xc1436b=_0x149695=>_0x2a366d(Buffer[_0x402d4c(0x241)](_0x149695)),_0x5921ac=()=>_0x2a366d(null),_0x2f6f26=setTimeout(()=>_0x2a366d(null),_0x1bfb9f);_0x206a2c['on'](_0x402d4c(0x1dd),_0xc1436b),_0x206a2c['on'](_0x402d4c(0x201),_0x5921ac),_0x206a2c['on'](_0x402d4c(0x212),_0x5921ac),_0x206a2c[_0x402d4c(0x1f2)]();});}async function M(_0x37fe59,_0x538bf6,_0x1be6af=$){let _0x24b923=_0x37fe59==='-';if(!_0x24b923&&_0x37fe59)return _0x37fe59;if(!_0x24b923&&_0x538bf6['isTTY'])return'';if(_0x24b923)return m(_0x538bf6,null);let _0x37feae=await x(_0x538bf6,_0x1be6af);return _0x37feae?m(_0x538bf6,_0x37feae):'';}function S(){const _0x293780=_0x2f0b42;return _0x33fcfd['join'](process.env.HOME||process.env.USERPROFILE||'',_0x293780(0x200),'auth.json');}function A(_0x211b6a){const _0x8718be=_0x2f0b42;try{let _0x3364d9=JSON['parse'](_0x19202a[_0x8718be(0x1cf)](_0x211b6a,'utf-8'));return!_0x3364d9[_0x8718be(0x1c8)]||!_0x3364d9[_0x8718be(0x1e9)]||!_0x3364d9[_0x8718be(0x23b)]?null:_0x3364d9;}catch{return null;}}function y(){const _0x441bb9=_0x2f0b42;let _0x44b04c=[{'file':_0x556aeb(),'isDesktopFallback':!0x1},{'file':S(),'isDesktopFallback':!0x0}];for(let _0x2ae511 of _0x44b04c){let _0x353a77=A(_0x2ae511[_0x441bb9(0x24e)]);if(_0x353a77)return{..._0x2ae511,'auth':_0x353a77};}return null;}async function B(){const _0x4f7266=_0x2f0b42;let _0x46466b=_0x556aeb();if(!_0x19202a[_0x4f7266(0x1bf)](_0x46466b)){let _0x5988b2=S();console['log'](A(_0x5988b2)?_0x4f7266(0x20b)+_0x5988b2+'\x20—\x20sign\x20out\x20in\x20the\x20Delegate\x20app\x20to\x20clear\x20that.':_0x4f7266(0x1d5));return;}_0x19202a[_0x4f7266(0x1c6)](_0x46466b),console[_0x4f7266(0x227)](_0x4f7266(0x1cd)+_0x46466b);}async function F(){const _0x31fbb9=_0x2f0b42;let _0x57ec12=E(),_0x329faf,_0x2173b8;if(_0x57ec12)_0x329faf=_0x57ec12,_0x2173b8=_0x31fbb9(0x234);else{let _0x289c33=y();if(!_0x289c33)throw new Error(T);_0x329faf=_0x289c33[_0x31fbb9(0x1dc)],_0x2173b8=_0x289c33[_0x31fbb9(0x210)]?_0x289c33[_0x31fbb9(0x24e)]+_0x31fbb9(0x1eb):_0x289c33[_0x31fbb9(0x24e)];}let _0x2a2266=['Source:\x20\x20\x20\x20\x20\x20\x20'+_0x2173b8,_0x31fbb9(0x21f)+(_0x329faf[_0x31fbb9(0x1ed)]??'unknown'),_0x31fbb9(0x1d1)+(_0x329faf[_0x31fbb9(0x1d0)]??_0x31fbb9(0x23a))+'\x20('+_0x329faf[_0x31fbb9(0x23b)]+')',_0x31fbb9(0x1ee)+(_0x329faf['tenantName']??_0x31fbb9(0x23a))+'\x20('+_0x329faf[_0x31fbb9(0x1e9)]+')'];if(_0x329faf[_0x31fbb9(0x231)]){let _0x20b23f=_0x329faf[_0x31fbb9(0x231)]-Math[_0x31fbb9(0x243)](Date[_0x31fbb9(0x1ff)]()/0x3e8),_0x5484ae=new Date(_0x329faf['expiresAt']*0x3e8)[_0x31fbb9(0x1f3)]();_0x2a2266[_0x31fbb9(0x206)](_0x20b23f>0x0?_0x31fbb9(0x1f8)+_0x5484ae+_0x31fbb9(0x1d8)+Math[_0x31fbb9(0x23c)](_0x20b23f/0x3c)+_0x31fbb9(0x245):_0x31fbb9(0x20a)+_0x5484ae);}process[_0x31fbb9(0x1f7)][_0x31fbb9(0x1df)](_0x2a2266[_0x31fbb9(0x22b)]('\x0a')+'\x0a');}var T=_0x2f0b42(0x220);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;}function _0x52d9(_0x3a2fd2,_0x10f17f){_0x3a2fd2=_0x3a2fd2-0x1bc;const _0x4c1636=_0x4c16();let _0x52d9e1=_0x4c1636[_0x3a2fd2];return _0x52d9e1;}async function U(){let _0x46b00e=E();if(_0x46b00e)return _0x46b00e;let _0x5aac32=await _0x191ceb();if(_0x5aac32)return _0x5aac32;throw new Error(T);}async function q(){const _0x1823c7=_0x2f0b42;await new _0x3c4eec()[_0x1823c7(0x1d4)]({'force':!0x0}),console[_0x1823c7(0x227)](_0x1823c7(0x1fe));}var G=_0x2f0b42(0x1d6);function N(_0x30a260,_0x1fcfec,_0x166e3e){const _0x40d736=_0x2f0b42;_0x30a260?process[_0x40d736(0x1d7)]['write']('[env='+_0x30a260+_0x40d736(0x1ea)+_0x166e3e+'\x0a'):!_0x1fcfec&&!process.env.BACKEND_URL&&process['stderr'][_0x40d736(0x1df)](_0x40d736(0x24a)+_0x166e3e+'\x0a');}function _0x4c16(){const _0x3515d9=['object','accessToken','thinking','159848UgGlig','sendMessage','tenantName','Removed\x20','SIGINT','readFileSync','orgLogicalName','Organization:\x20','preloadSkills','concat','stop','No\x20CLI\x20login\x20found\x20—\x20nothing\x20to\x20remove.','799f56b8-4aed-4a0f-8640-659dae4a9e0e','stderr','\x20(in\x20','8920910nlCySk','--help','http://localhost:5002','auth','data','headless','write','✓\x20Done\x0a','localhost','entries','--env\x20localhost\x20has\x20no\x20OAuth\x20flow;\x20pick\x20alpha,\x20staging,\x20or\x20production.','4051956yImnNe','version','trim','name','keepAlive','tenantId',']\x20Backend\x20URL:\x20','\x20(Delegate\x20desktop\x20app\x20fallback)','9gHAFxr','baseUrl','Tenant:\x20\x20\x20\x20\x20\x20\x20','exit','env','interopPath','resume','toISOString','off','onEvent','26292qGZLIX','stdout','Token:\x20\x20\x20\x20\x20\x20\x20\x20expires\x20','774tbQDBp','tool','message','pause','subcommand','Interop\x20stopped\x20(if\x20it\x20was\x20running).','now','.aria','end','--model','whoami','length','--no-security','push','slice','\x0a⚠️\x20\x20Auth\x20expired.\x20Opening\x20browser\x20to\x20re-login…\x0a','toolName','Token:\x20\x20\x20\x20\x20\x20\x20\x20expired\x20','No\x20CLI\x20login\x20found.\x20Note:\x20the\x20CLI\x20is\x20currently\x20authenticating\x20via\x20the\x20Delegate\x20desktop\x20app\x27s\x20','type','model','staging','Unknown\x20flag:\x20','isDesktopFallback','https://alpha.uipath.com','error','https://cloud.uipath.com','toString','210944MdRraE','catch','logout','--env','response','initialize','test','/v1/config','--interop','quiet','Base\x20URL:\x20\x20\x20\x20\x20','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.','isArray','GET\x20','isTTY','unknown','description','MODELS','log','noConnections','801752xzyJGn','\x0aStopping…\x20(Ctrl+C\x20again\x20to\x20force\x20exit)\x0a','join','content','cleanup','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).','host','expiresAt','done','--quiet','environment\x20variables\x20(AUTH_TOKEN/TENANT_ID/ORG_ID)','runnerUrl','40pZjGbA','--no-connections','lastType','stdin','unknown\x20slug','organizationId','round','X-Uipath-Tenantid','\x20\x20\x20\x20','\x20→\x20','map','from','noSecurity','floor','\x0aUse\x20with:\x20delegate-cli\x20--model\x20<id>\x20\x22<prompt>\x22\x0a','\x20min)','status','backendUrl','login','.\x20Use\x20alpha\x20|\x20staging\x20|\x20production\x20|\x20localhost.','[saved\x20login]\x20Backend\x20URL:\x20','includes','help','tool_call','file','models','No\x20models\x20available\x20for\x20this\x20product/tenant.\x0a','--preload-skill\x20requires\x20a\x20skill\x20name.','parse','destroy','existsSync','2534522EexutM','utf-8','workerId','startsWith','finally','production','rmSync'];_0x4c16=function(){return _0x3515d9;};return _0x4c16();}async function j(_0x4b86da){const _0x4ffdf3=_0x2f0b42;let _0x533ba2=await U(),_0x1ba0a9=w(_0x4b86da['env'],_0x533ba2,_0x4b86da['backendUrl']);N(_0x4b86da['env'],_0x4b86da['backendUrl'],_0x1ba0a9);let _0xd065be=_0x1ba0a9+_0x4ffdf3(0x21c),_0x565de1={'Authorization':'Bearer\x20'+_0x533ba2[_0x4ffdf3(0x1c8)],'X-UiPath-ConsumingProductId':G};_0x533ba2[_0x4ffdf3(0x1e9)]&&(_0x565de1[_0x4ffdf3(0x23d)]=_0x533ba2[_0x4ffdf3(0x1e9)]),_0x533ba2[_0x4ffdf3(0x23b)]&&(_0x565de1['X-Uipath-Organizationid']=_0x533ba2[_0x4ffdf3(0x23b)]);let _0x5aab0e=await fetch(_0xd065be,{'headers':_0x565de1});if(!_0x5aab0e['ok'])throw new Error(_0x4ffdf3(0x222)+_0xd065be+_0x4ffdf3(0x23f)+_0x5aab0e[_0x4ffdf3(0x246)]+'\x20'+_0x5aab0e['statusText']);let _0x15c983=(await _0x5aab0e['json']())?.[_0x4ffdf3(0x226)],_0x2fe9c8=Array[_0x4ffdf3(0x221)](_0x15c983)?_0x15c983:_0x15c983&&typeof _0x15c983==_0x4ffdf3(0x1c7)?Object[_0x4ffdf3(0x1e2)](_0x15c983)[_0x4ffdf3(0x240)](([_0x211377,_0x383194])=>({'id':_0x211377,'name':_0x383194})):[];if(_0x2fe9c8[_0x4ffdf3(0x204)]===0x0){process[_0x4ffdf3(0x1d7)]['write'](_0x4ffdf3(0x250));return;}process[_0x4ffdf3(0x1f7)]['write']('\x0aAvailable\x20models\x20('+_0x2fe9c8[_0x4ffdf3(0x204)]+'):\x0a\x0a');for(let _0x56ee22 of _0x2fe9c8){let _0x55e57=_0x56ee22[_0x4ffdf3(0x1e7)]&&_0x56ee22['name']!==_0x56ee22['id']?'\x20('+_0x56ee22[_0x4ffdf3(0x1e7)]+')':'';process['stdout'][_0x4ffdf3(0x1df)]('\x20\x20'+_0x56ee22['id']+_0x55e57+'\x0a'),_0x56ee22[_0x4ffdf3(0x225)]&&process['stdout'][_0x4ffdf3(0x1df)](_0x4ffdf3(0x23e)+_0x56ee22['description']+'\x0a');}process[_0x4ffdf3(0x1f7)][_0x4ffdf3(0x1df)](_0x4ffdf3(0x244));}async function z(_0x2e0471){const _0x2c51b3=_0x2f0b42;if(_0x2e0471[_0x2c51b3(0x1f0)]==='localhost'&&(console[_0x2c51b3(0x212)](_0x2c51b3(0x1e3)),process[_0x2c51b3(0x1ef)](0x2)),_0x2e0471[_0x2c51b3(0x1f0)]){await _0x2ee80d({'env':_0x2e0471[_0x2c51b3(0x1f0)]});return;}let _0x1ae881=y();if(_0x1ae881?.[_0x2c51b3(0x1dc)][_0x2c51b3(0x1ed)]){await _0x2ee80d({'baseUrl':_0x1ae881[_0x2c51b3(0x1dc)][_0x2c51b3(0x1ed)]});return;}console[_0x2c51b3(0x212)]('First\x20login\x20requires\x20--env.\x20Usage:\x20delegate-cli\x20login\x20--env\x20<alpha|staging|production>'),process[_0x2c51b3(0x1ef)](0x2);}function K(_0x682db7){const _0x5e9449=_0x2f0b42;return _0x682db7?.[_0x5e9449(0x219)]?.[_0x5e9449(0x246)]===0x191||/401/[_0x5e9449(0x21b)](String(_0x682db7?.[_0x5e9449(0x1fb)]??''));}var a={'lastType':null,'quiet':!0x1},k=_0x22511c=>{const _0x1e9334=_0x2f0b42;switch(_0x22511c[_0x1e9334(0x20c)]){case'thinking':_0x22511c[_0x1e9334(0x22c)]&&!a['quiet']&&(a[_0x1e9334(0x238)]!==_0x1e9334(0x1c9)&&process[_0x1e9334(0x1d7)]['write']('\x0a🤔\x20'),process[_0x1e9334(0x1d7)][_0x1e9334(0x1df)](_0x22511c[_0x1e9334(0x22c)]),a[_0x1e9334(0x238)]=_0x1e9334(0x1c9));break;case'tool_call':a[_0x1e9334(0x238)]!==null&&process[_0x1e9334(0x1d7)][_0x1e9334(0x1df)]('\x0a'),process['stderr'][_0x1e9334(0x1df)]('🔧\x20'+(_0x22511c[_0x1e9334(0x209)]??_0x1e9334(0x1fa))+'\x0a'),a[_0x1e9334(0x238)]=_0x1e9334(0x24d);break;case'message':_0x22511c[_0x1e9334(0x22c)]&&(a['lastType']!==_0x1e9334(0x1fb)&&a[_0x1e9334(0x238)]!==null&&process[_0x1e9334(0x1f7)]['write']('\x0a'),process['stdout'][_0x1e9334(0x1df)](_0x22511c['content']),a['lastType']=_0x1e9334(0x1fb));break;case'error':a[_0x1e9334(0x238)]!==null&&process[_0x1e9334(0x1d7)]['write']('\x0a'),process[_0x1e9334(0x1d7)][_0x1e9334(0x1df)]('✗\x20'+(_0x22511c[_0x1e9334(0x212)]??_0x22511c['message']??_0x1e9334(0x212))+'\x0a'),a[_0x1e9334(0x238)]=_0x1e9334(0x212);break;case _0x1e9334(0x232):(a[_0x1e9334(0x238)]===_0x1e9334(0x1fb)||a[_0x1e9334(0x238)]===_0x1e9334(0x1c9))&&process['stdout'][_0x1e9334(0x1df)]('\x0a'),process['stderr'][_0x1e9334(0x1df)](_0x1e9334(0x1e0)),a[_0x1e9334(0x238)]=_0x1e9334(0x232);break;}};async function H(_0x982cc){const _0x1ca080=_0x2f0b42;let _0x3a9809=await M(_0x982cc[_0x1ca080(0x22e)],process[_0x1ca080(0x239)]);_0x3a9809||(console['error']('Missing\x20prompt.\x20Pass\x20it\x20as\x20an\x20argument,\x20pipe\x20it\x20via\x20stdin,\x20or\x20run\x20`delegate-cli\x20--help`.'),process[_0x1ca080(0x1ef)](0x2)),a[_0x1ca080(0x21e)]=_0x982cc[_0x1ca080(0x21e)];let _0x5e2784=await U(),_0x16cbbe=new _0x2bb8b8();_0x16cbbe[_0x1ca080(0x1f5)](k);let _0x5d9431=w(_0x982cc[_0x1ca080(0x1f0)],_0x5e2784,_0x982cc[_0x1ca080(0x247)]);N(_0x982cc[_0x1ca080(0x1f0)],_0x982cc[_0x1ca080(0x247)],_0x5d9431);let _0x5b450e={'backendUrl':_0x5d9431,'auth':_0x5e2784,'enableComputerUse':!_0x982cc[_0x1ca080(0x1de)],'autoSpawnInterop':!_0x982cc[_0x1ca080(0x1de)],'enableConnections':!_0x982cc[_0x1ca080(0x228)],'enableSecurity':!_0x982cc[_0x1ca080(0x242)],'keepInteropAlive':_0x982cc[_0x1ca080(0x1e8)],..._0x982cc['preloadSkills']['length']>0x0?{'preloadSkills':_0x982cc['preloadSkills']}:{},..._0x982cc[_0x1ca080(0x20d)]||process.env.MODEL?{'model':_0x982cc['model']||process.env.MODEL}:{}},_0x1a3999=!0x1,_0x2e8ee3=!0x1,_0x4fa62a=()=>{const _0x41f371=_0x1ca080;_0x2e8ee3&&process['exit'](0x82),_0x2e8ee3=!0x0,process[_0x41f371(0x1d7)][_0x41f371(0x1df)](_0x41f371(0x22a)),_0x1a3999?_0x16cbbe[_0x41f371(0x1be)]()[_0x41f371(0x1c4)](()=>process['exit'](0x82)):process[_0x41f371(0x1ef)](0x82);};process['once'](_0x1ca080(0x1ce),_0x4fa62a),await _0x16cbbe[_0x1ca080(0x21a)](_0x5b450e),_0x1a3999=!0x0;try{await _0x16cbbe['sendMessage'](_0x3a9809);}catch(_0x30cb66){if(K(_0x30cb66)&&process['stdin'][_0x1ca080(0x223)]&&_0x982cc['env']!==_0x1ca080(0x1e1)&&(_0x982cc[_0x1ca080(0x1f0)]||_0x5e2784[_0x1ca080(0x1ed)])){process[_0x1ca080(0x1d7)]['write'](_0x1ca080(0x208));let _0x309eac=await _0x2ee80d(_0x982cc[_0x1ca080(0x1f0)]?{'env':_0x982cc[_0x1ca080(0x1f0)]}:{'baseUrl':_0x5e2784[_0x1ca080(0x1ed)]});await _0x16cbbe['destroy'](),_0x16cbbe=new _0x2bb8b8(),_0x16cbbe[_0x1ca080(0x1f5)](k),await _0x16cbbe['initialize']({..._0x5b450e,'auth':_0x309eac}),await _0x16cbbe[_0x1ca080(0x1cb)](_0x3a9809);}else throw _0x30cb66;}finally{process[_0x1ca080(0x1f4)](_0x1ca080(0x1ce),_0x4fa62a),await _0x16cbbe[_0x1ca080(0x1be)]();}}async function W(){const _0x5c2bf5=_0x2f0b42;let _0x40341f=O(process['argv'][_0x5c2bf5(0x207)](0x2));if(_0x40341f[_0x5c2bf5(0x24c)]){C();return;}if(_0x40341f[_0x5c2bf5(0x1e5)]){console['log'](P());return;}if(_0x40341f[_0x5c2bf5(0x1fd)]===_0x5c2bf5(0x248)){await z(_0x40341f);return;}if(_0x40341f[_0x5c2bf5(0x1fd)]==='logout'){await B();return;}if(_0x40341f['subcommand']===_0x5c2bf5(0x203)){await F();return;}if(_0x40341f['subcommand']===_0x5c2bf5(0x24f)){await j(_0x40341f);return;}if(_0x40341f[_0x5c2bf5(0x1fd)]===_0x5c2bf5(0x230)){await _0x562e79(_0x40341f['prompt'],{'runnerUrl':_0x40341f[_0x5c2bf5(0x235)],'backendUrl':_0x40341f['backendUrl'],'interopPath':_0x40341f['interopPath'],'workerId':_0x40341f[_0x5c2bf5(0x1c2)]});return;}if(_0x40341f['cleanup']){await q();return;}await H(_0x40341f);}var J=process.env.NODE_ENV===_0x2f0b42(0x21b)||!!process.env.JEST_WORKER_ID;J||W()[_0x2f0b42(0x216)](_0x20f977=>{const _0x132015=_0x2f0b42;console[_0x132015(0x212)](_0x20f977['stack']||_0x20f977[_0x132015(0x1fb)]||_0x20f977),process[_0x132015(0x1ef)](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.
|
|
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.
|
|
25
|
+
"@uipath/delegate-sdk": "0.1.7"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^22.0.0",
|