@uipath/delegate-stdio 1.202.1 → 1.203.0-preview.20261005112239

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/LICENSE CHANGED
@@ -1,204 +1,204 @@
1
-
2
- Apache License
3
- Version 2.0, January 2004
4
- http://www.apache.org/licenses/
5
-
6
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
- 1. Definitions.
9
-
10
- "License" shall mean the terms and conditions for use, reproduction,
11
- and distribution as defined by Sections 1 through 9 of this document.
12
-
13
- "Licensor" shall mean the copyright owner or entity authorized by
14
- the copyright owner that is granting the License.
15
-
16
- "Legal Entity" shall mean the union of the acting entity and all
17
- other entities that control, are controlled by, or are under common
18
- control with that entity. For the purposes of this definition,
19
- "control" means (i) the power, direct or indirect, to cause the
20
- direction or management of such entity, whether by contract or
21
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
- outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
- "You" (or "Your") shall mean an individual or Legal Entity
25
- exercising permissions granted by this License.
26
-
27
- "Source" form shall mean the preferred form for making modifications,
28
- including but not limited to software source code, documentation
29
- source, and configuration files.
30
-
31
- "Object" form shall mean any form resulting from mechanical
32
- transformation or translation of a Source form, including but
33
- not limited to compiled object code, generated documentation,
34
- and conversions to other media types.
35
-
36
- "Work" shall mean the work of authorship, whether in Source or
37
- Object form, made available under the License, as indicated by a
38
- copyright notice that is included in or attached to the work
39
- (an example is provided in the Appendix below).
40
-
41
- "Derivative Works" shall mean any work, whether in Source or Object
42
- form, that is based on (or derived from) the Work and for which the
43
- editorial revisions, annotations, elaborations, or other modifications
44
- represent, as a whole, an original work of authorship. For the purposes
45
- of this License, Derivative Works shall not include works that remain
46
- separable from, or merely link (or bind by name) to the interfaces of,
47
- the Work and Derivative Works thereof.
48
-
49
- "Contribution" shall mean any work of authorship, including
50
- the original version of the Work and any modifications or additions
51
- to that Work or Derivative Works thereof, that is intentionally
52
- submitted to Licensor for inclusion in the Work by the copyright owner
53
- or by an individual or Legal Entity authorized to submit on behalf of
54
- the copyright owner. For the purposes of this definition, "submitted"
55
- means any form of electronic, verbal, or written communication sent
56
- to the Licensor or its representatives, including but not limited to
57
- communication on electronic mailing lists, source code control systems,
58
- and issue tracking systems that are managed by, or on behalf of, the
59
- Licensor for the purpose of discussing and improving the Work, but
60
- excluding communication that is conspicuously marked or otherwise
61
- designated in writing by the copyright owner as "Not a Contribution."
62
-
63
- "Contributor" shall mean Licensor and any individual or Legal Entity
64
- on behalf of whom a Contribution has been received by Licensor and
65
- subsequently incorporated within the Work.
66
-
67
- 2. Grant of Copyright License. Subject to the terms and conditions of
68
- this License, each Contributor hereby grants to You a perpetual,
69
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
- copyright license to reproduce, prepare Derivative Works of,
71
- publicly display, publicly perform, sublicense, and distribute the
72
- Work and such Derivative Works in Source or Object form.
73
-
74
- 3. Grant of Patent License. Subject to the terms and conditions of
75
- this License, each Contributor hereby grants to You a perpetual,
76
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
- (except as stated in this section) patent license to make, have made,
78
- use, offer to sell, sell, import, and otherwise transfer the Work,
79
- where such license applies only to those patent claims licensable
80
- by such Contributor that are necessarily infringed by their
81
- Contribution(s) alone or by combination of their Contribution(s)
82
- with the Work to which such Contribution(s) was submitted. If You
83
- institute patent litigation against any entity (including a
84
- cross-claim or counterclaim in a lawsuit) alleging that the Work
85
- or a Contribution incorporated within the Work constitutes direct
86
- or contributory patent infringement, then any patent licenses
87
- granted to You under this License for that Work shall terminate
88
- as of the date such litigation is filed.
89
-
90
- 4. Redistribution. You may reproduce and distribute copies of the
91
- Work or Derivative Works thereof in any medium, with or without
92
- modifications, and in Source or Object form, provided that You
93
- meet the following conditions:
94
-
95
- (a) You must give any other recipients of the Work or
96
- Derivative Works a copy of this License; and
97
-
98
- (b) You must cause any modified files to carry prominent notices
99
- stating that You changed the files; and
100
-
101
- (c) You must retain, in the Source form of any Derivative Works
102
- that You distribute, all copyright, patent, trademark, and
103
- attribution notices from the Source form of the Work,
104
- excluding those notices that do not pertain to any part of
105
- the Derivative Works; and
106
-
107
- (d) If the Work includes a "NOTICE" text file as part of its
108
- distribution, then any Derivative Works that You distribute must
109
- include a readable copy of the attribution notices contained
110
- within such NOTICE file, excluding those notices that do not
111
- pertain to any part of the Derivative Works, in at least one
112
- of the following places: within a NOTICE text file distributed
113
- as part of the Derivative Works; within the Source form or
114
- documentation, if provided along with the Derivative Works; or,
115
- within a display generated by the Derivative Works, if and
116
- wherever such third-party notices normally appear. The contents
117
- of the NOTICE file are for informational purposes only and
118
- do not modify the License. You may add Your own attribution
119
- notices within Derivative Works that You distribute, alongside
120
- or as an addendum to the NOTICE text from the Work, provided
121
- that such additional attribution notices cannot be construed
122
- as modifying the License.
123
-
124
- You may add Your own copyright statement to Your modifications and
125
- may provide additional or different license terms and conditions
126
- for use, reproduction, or distribution of Your modifications, or
127
- for any such Derivative Works as a whole, provided Your use,
128
- reproduction, and distribution of the Work otherwise complies with
129
- the conditions stated in this License.
130
-
131
- 5. Submission of Contributions. Unless You explicitly state otherwise,
132
- any Contribution intentionally submitted for inclusion in the Work
133
- by You to the Licensor shall be under the terms and conditions of
134
- this License, without any additional terms or conditions.
135
- Notwithstanding the above, nothing herein shall supersede or modify
136
- the terms of any separate license agreement you may have executed
137
- with Licensor regarding such Contributions.
138
-
139
- 6. Trademarks. This License does not grant permission to use the trade
140
- names, trademarks, service marks, or product names of the Licensor,
141
- except as required for reasonable and customary use in describing the
142
- origin of the Work and reproducing the content of the NOTICE file.
143
-
144
- 7. Disclaimer of Warranty. Unless required by applicable law or
145
- agreed to in writing, Licensor provides the Work (and each
146
- Contributor provides its Contributions) on an "AS IS" BASIS,
147
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
- implied, including, without limitation, any warranties or conditions
149
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
- PARTICULAR PURPOSE. You are solely responsible for determining the
151
- appropriateness of using or redistributing the Work and assume any
152
- risks associated with Your exercise of permissions under this License.
153
-
154
- 8. Limitation of Liability. In no event and under no legal theory,
155
- whether in tort (including negligence), contract, or otherwise,
156
- unless required by applicable law (such as deliberate and grossly
157
- negligent acts) or agreed to in writing, shall any Contributor be
158
- liable to You for damages, including any direct, indirect, special,
159
- incidental, or consequential damages of any character arising as a
160
- result of this License or out of the use or inability to use the
161
- Work (including but not limited to damages for loss of goodwill,
162
- work stoppage, computer failure or malfunction, or any and all
163
- other commercial damages or losses), even if such Contributor
164
- has been advised of the possibility of such damages.
165
-
166
- 9. Accepting Warranty or Additional Liability. While redistributing
167
- the Work or Derivative Works thereof, You may choose to offer,
168
- and charge a fee for, acceptance of support, warranty, indemnity,
169
- or other liability obligations and/or rights consistent with this
170
- License. However, in accepting such obligations, You may act only
171
- on Your own behalf and on Your sole responsibility, not on behalf
172
- of any other Contributor, and only if You agree to indemnify,
173
- defend, and hold each Contributor harmless for any liability
174
- incurred by, or claims asserted against, such Contributor by reason
175
- of your accepting any such warranty or additional liability.
176
-
177
- END OF TERMS AND CONDITIONS
178
-
179
- APPENDIX: How to apply the Apache License to your work.
180
-
181
- To apply the Apache License to your work, attach the following
182
- boilerplate notice, with the fields enclosed by brackets "[]"
183
- replaced with your own identifying information. (Don't include
184
- the brackets!) The text should be enclosed in the appropriate
185
- comment syntax for the file format. We also recommend that a
186
- file or class name and description of purpose be included on the
187
- same "printed page" as the copyright notice for easier
188
- identification within third-party archives.
189
-
190
- Copyright 2026 UiPath Inc.
191
-
192
- Licensed under the Apache License, Version 2.0 (the "License");
193
- you may not use this file except in compliance with the License.
194
- You may obtain a copy of the License at
195
-
196
- http://www.apache.org/licenses/LICENSE-2.0
197
-
198
- Unless required by applicable law or agreed to in writing, software
199
- distributed under the License is distributed on an "AS IS" BASIS,
200
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
- See the License for the specific language governing permissions and
202
- limitations under the License.
203
-
204
- Copyright 2026 UiPath Inc.
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 UiPath Inc.
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
203
+
204
+ Copyright 2026 UiPath Inc.
package/README.md CHANGED
@@ -1,83 +1,92 @@
1
- # @uipath/delegate-stdio
2
-
3
- Run a UiPath Delegate agent as a subprocess speaking newline-delimited JSON over stdio. Any host process, in any language, can spawn it, write commands to stdin, and read events/results from stdout — the same shape as an LSP server or an MCP stdio transport. (The primary consumer today is the Python [coder_eval](https://github.com/UiPath/coder_eval) harness, whose built-in `delegate-sdk` agent drives this host.)
4
-
5
- - **Platforms**: macOS arm64, Windows x64, Linux x64 (text-and-file tools only on Linux — computer use is unavailable there).
6
-
7
- ---
8
-
9
- ## Install
10
-
11
- ```bash
12
- npm install @uipath/delegate-stdio
13
- ```
14
-
15
- That is the complete install. [`@uipath/delegate-sdk`](https://www.npmjs.com/package/@uipath/delegate-sdk) is a regular npm dependency of this package — it (and your platform's `@uipath/delegate-runtime-*` interop binaries) installs transitively. There is **no separate SDK to set up**; this package is not a bridge to an externally-installed SDK, it ships the whole runnable agent host.
16
-
17
- ## Quick start
18
-
19
- ```bash
20
- npx @uipath/delegate-cli login --env production # once — browser OAuth → ~/.aria/sdk-auth.json
21
- printf '%s\n' \
22
- '{"cmd":"init","options":{"env":"production","workingDirectory":"/abs/path/to/workdir"}}' \
23
- '{"cmd":"send","prompt":"list the files in the working directory","sessionId":null}' \
24
- '{"cmd":"destroy"}' \
25
- | node node_modules/@uipath/delegate-stdio/dist/delegate_stdio.mjs 2> host.log
26
- ```
27
-
28
- Every response is one JSON object per line on stdout; diagnostics go to stderr.
29
-
30
- ## Protocol
31
-
32
- ```
33
- stdin (commands) stdout (responses)
34
- {"cmd":"init","options":{...}} -> {"type":"init_ok"}
35
- {"cmd":"send","prompt":"...", {"type":"event","event":{...}} (zero or more)
36
- "sessionId":null,"maxSteps":N} {"type":"result","response":"...","sessionId":"...",
37
- "assistantStepCount":N,"maxStepsReached":bool,
38
- "usage":{...},"turnUsages":[{...}],"model":"..."}
39
- {"cmd":"destroy"} -> {"type":"destroyed"}
40
- {"type":"error","message":"...","stack":"..."}
41
- ```
42
-
43
- `init.options` is forwarded to `DelegateAgent.initialize()`. Host-specific keys:
44
-
45
- | Key | Purpose |
46
- |---|---|
47
- | `env` | Cloud environment slug (`alpha` / `staging` / `production`). The backend URL is composed from the saved login's (or env's) org/tenant slugs plus this value. |
48
- | `effort` | Reasoning effort (`low` / `medium` / `high` / `xhigh` / `max`), forwarded as `user_config.effort` on every chat request. |
49
- | `workingDirectory` | Absolute task-sandbox path. The host `chdir()`s into it and the SDK seeds the shell tools' default cwd from it; ignored with a log line when the directory does not exist. |
50
- | `shellPathPrepend` | Directories prepended to `PATH` for every shell-tool command so mock CLIs shadow the real ones; entries that are not existing directories are dropped with a log line. |
51
- | `projectId` / `sessionId` | Wiki routing: bind sessions to a project (`<workingDirectory>/projects/<id>/wiki`) or pin the session id so the per-session wiki dir is deterministic. |
52
- | `maxSteps` (on `send`) | Cap on agent-loop steps for that turn; the `result` reports `maxStepsReached`. |
53
-
54
- `tool_result` events carry the SDK's `toolResult` payload verbatim plus `toolId` for call/result correlation. `result.usage.input_tokens` follows the Anthropic convention: cache reads/writes are excluded and reported separately as `cache_read_input_tokens` / `cache_creation_input_tokens` (the latter stays 0 for providers that never report cache writes). `result.turnUsages` lists the same buckets per backend round-trip (one entry per LLM generation; their sum is `usage`), so hosts can attribute tokens to individual generations; it is omitted when no usage was recorded.
55
-
56
- ## Auth & environment
57
-
58
- | Var | Purpose |
59
- |---|---|
60
- | `AUTH_TOKEN` / `TENANT_ID` / `ORG_ID` | Bearer auth (else falls back to the saved login in `~/.aria/sdk-auth.json`). |
61
- | `USER_ID` | `X-UiPath-Internal-UserId` for `service.internal` (S2S) tokens. |
62
- | `ORG_LOGICAL_NAME` / `TENANT_NAME` | Org/tenant slugs for the `env`-derived backend URL when no saved login provides them. |
63
- | `DELEGATE_AUTH_TOKEN_FILE` | `PATH`-style list of token files (uip `.auth` format or a raw token) an external process keeps fresh; the first readable one is re-read at every turn and before each TTL boundary and applied live. |
64
- | `BACKEND_URL` / `INTEROP_URL` | Pin the agent-service / interop endpoints directly. Host precedence: `backendUrl` option > `BACKEND_URL` > `env`. With `INTEROP_URL` set the SDK connects to an externally managed interop instead of spawning its own from the bundled runtime. |
65
- | `LLMGW_CLIENT_ID` / `LLMGW_CLIENT_SECRET` / `LLMGW_URL` | Arm proactive S2S token refresh for long-running hosts. |
66
- | `USE_LLM_GATEWAY_FOR_FIREWORKS` | Per-request Fireworks transport header (`true`/`false`, `1`/`0`, `yes`/`no`, `on`/`off`); honored by the backend only where that routing is enabled. Unset/unrecognized → header omitted. |
67
- | `DELEGATE_STDIO_VERBOSE=1` | Trace every frame, agent event, and auth/init/token-refresh step to stderr. `DELEGATE_STDIO_LOG_MAX_CHARS` (default 50 000) caps each traced value. |
68
-
69
- The `X-UiPath-Internal-*` headers (plus the optional `X-UiPath-Use-Llm-Gateway-For-Fireworks` routing header) are passed to the SDK via `initConfig.requestHeaders`; the SDK stamps them on both the REST (createSession) and SSE (send-message) transports from inside its own bundle.
70
-
71
- ## Run from a checkout
72
-
73
- ```bash
74
- npm install # pulls @uipath/delegate-sdk + the matching runtime, plus the build tooling
75
- npm run build # -> dist/delegate_stdio.mjs (esbuild, SDK kept external; minified + obfuscated, no source map)
76
- node dist/delegate_stdio.mjs < commands.jsonl > responses.jsonl 2> debug.log
77
- ```
78
-
79
- ---
80
-
81
- ## License
82
-
83
- Apache-2.0. See [LICENSE](./LICENSE).
1
+ # @uipath/delegate-stdio
2
+
3
+ Run a UiPath Delegate agent as a subprocess speaking newline-delimited JSON over stdio. Any host process, in any language, can spawn it, write commands to stdin, and read events/results from stdout — the same shape as an LSP server or an MCP stdio transport. (The primary consumer today is the Python [coder_eval](https://github.com/UiPath/coder_eval) harness, whose built-in `delegate` agent drives this host. It finds a global `npm install -g @uipath/delegate-stdio` by itself.)
4
+
5
+ - **Platforms**: macOS arm64, Windows x64, Linux x64 (text-and-file tools only on Linux — computer use is unavailable there).
6
+
7
+ ---
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm install @uipath/delegate-stdio
13
+ ```
14
+
15
+ That is the complete install. [`@uipath/delegate-sdk`](https://www.npmjs.com/package/@uipath/delegate-sdk) is a regular npm dependency of this package — it (and your platform's `@uipath/delegate-runtime-*` interop binaries) installs transitively. There is **no separate SDK to set up**; this package is not a bridge to an externally-installed SDK, it ships the whole runnable agent host.
16
+
17
+ ## Quick start
18
+
19
+ ```bash
20
+ npx @uipath/delegate-cli login --env production # once — browser OAuth → ~/.aria/sdk-auth.json
21
+ printf '%s\n' \
22
+ '{"cmd":"init","options":{"env":"production","workingDirectory":"/abs/path/to/workdir"}}' \
23
+ '{"cmd":"send","prompt":"list the files in the working directory","sessionId":null}' \
24
+ '{"cmd":"destroy"}' \
25
+ | node node_modules/@uipath/delegate-stdio/dist/delegate_stdio.mjs 2> host.log
26
+ ```
27
+
28
+ Every response is one JSON object per line on stdout; diagnostics go to stderr.
29
+
30
+ ## Protocol
31
+
32
+ ```
33
+ stdin (commands) stdout (responses)
34
+ {"cmd":"init","options":{...}} -> {"type":"init_ok"}
35
+ {"cmd":"send","prompt":"...", {"type":"event","event":{...}} (zero or more)
36
+ "sessionId":null,"maxSteps":N} {"type":"usage","usage":{...}} (one per backend round-trip)
37
+ {"type":"result","response":"...","sessionId":"...",
38
+ "assistantStepCount":N,"maxStepsReached":bool,
39
+ "usage":{...},"turnUsages":[{...}],"model":"..."}
40
+ {"cmd":"destroy"} -> {"type":"destroyed"}
41
+ {"type":"error","message":"...","stack":"..."}
42
+ ```
43
+
44
+ `init.options` is forwarded to `DelegateAgent.initialize()`. Host-specific keys:
45
+
46
+ | Key | Purpose |
47
+ |---|---|
48
+ | `auth` | Credentials: `accessToken`, `tenantId`, `organizationId`, `userId`, `orgLogicalName`, `tenantName`. Each field has priority over its environment variable (see the table below), and a field you leave out still comes from the environment. With this option a harness can keep the credentials out of the host's environment, which every shell command the agent runs inherits. Verbose logs show only the names of the fields you set. |
49
+ | `env` | Cloud environment slug (`alpha` / `staging` / `production`). The backend URL is composed from the org/tenant slugs (the `auth` option, the environment, or the saved login) plus this value. |
50
+ | `backendUrl` | Full agent-service URL. Has priority over `BACKEND_URL` and `env`. |
51
+ | `effort` | Reasoning effort (`low` / `medium` / `high` / `xhigh` / `max`), forwarded as `user_config.effort` on every chat request. |
52
+ | `workingDirectory` | Absolute task-sandbox path. The host `chdir()`s into it and the SDK seeds the shell tools' default cwd from it; ignored with a log line when the directory does not exist. |
53
+ | `shellPathPrepend` | Directories prepended to `PATH` for every shell-tool command so mock CLIs shadow the real ones; entries that are not existing directories are dropped with a log line. |
54
+ | `projectId` / `sessionId` | Wiki routing: bind sessions to a project (`<workingDirectory>/projects/<id>/wiki`) or pin the session id so the per-session wiki dir is deterministic. |
55
+ | `maxSteps` (on `send`) | Cap on agent-loop steps for that turn; the `result` reports `maxStepsReached`. |
56
+
57
+ Some SDK defaults are different here. `enableComputerUse`, `enableConnections`, `enableSkills`, `enableMemory` (the machine's Delegate long-term memories) and `validateModel` (the model-catalog check at init) are off unless `init.options` turns them on. `agentName` is always `aria-autopilot`. The SDK's `turn_start` events are not forwarded.
58
+
59
+ `tool_result` events carry the SDK's `toolResult` payload verbatim plus `toolId` for call/result correlation. `result.usage.input_tokens` follows the Anthropic convention: cache reads/writes are excluded and reported separately as `cache_read_input_tokens` / `cache_creation_input_tokens` (the latter stays 0 for providers that never report cache writes). `result.turnUsages` lists the same buckets per backend round-trip (one entry per LLM generation; their sum is `usage`), so hosts can attribute tokens to individual generations; it is omitted when no usage was recorded.
60
+
61
+ The same per-round-trip buckets also arrive while the turn runs, as one `usage` frame per round-trip. A round-trip's frame is written before the next `event`, so it precedes every tool result that round-trip caused, and before the turn's `result` or `error`. A host that ends a turn early (for example, by killing the process at a turn cap) still has the usage of every round-trip that finished. A reader that does not know the frame type can skip it.
62
+
63
+ ## Auth & environment
64
+
65
+ Credential precedence, field by field: the `auth` init option, then these environment variables, then the saved login in `~/.aria/sdk-auth.json`.
66
+
67
+ | Var | Purpose |
68
+ |---|---|
69
+ | `AUTH_TOKEN` / `TENANT_ID` / `ORG_ID` | Bearer auth, when the `auth` option does not give `accessToken` / `tenantId` / `organizationId`. Without all three, the host falls back to the saved login. |
70
+ | `USER_ID` | `X-UiPath-Internal-UserId` for `service.internal` (S2S) tokens (`auth.userId` has priority). |
71
+ | `ORG_LOGICAL_NAME` / `TENANT_NAME` | Org/tenant slugs for the `env`-derived backend URL when no saved login provides them (`auth.orgLogicalName` / `auth.tenantName` have priority, also over the saved login's slugs). |
72
+ | `DELEGATE_AUTH_TOKEN_FILE` | `PATH`-style list of token files (uip `.auth` format or a raw token) an external process keeps fresh; the first readable one is re-read at every turn and before each TTL boundary and applied live. |
73
+ | `BACKEND_URL` / `INTEROP_URL` | Pin the agent-service / interop endpoints directly. Host precedence: `backendUrl` option > `BACKEND_URL` > `env`. With `INTEROP_URL` set the SDK connects to an externally managed interop instead of spawning its own from the bundled runtime. |
74
+ | `LLMGW_CLIENT_ID` / `LLMGW_CLIENT_SECRET` / `LLMGW_URL` | Arm proactive S2S token refresh for long-running hosts. |
75
+ | `USE_LLM_GATEWAY_FOR_FIREWORKS` | Per-request Fireworks transport header (`true`/`false`, `1`/`0`, `yes`/`no`, `on`/`off`); honored by the backend only where that routing is enabled. Unset/unrecognized → header omitted. |
76
+ | `DELEGATE_STDIO_VERBOSE=1` | Trace every frame, agent event, and auth/init/token-refresh step to stderr. `DELEGATE_STDIO_LOG_MAX_CHARS` (default 50 000) caps each traced value. |
77
+
78
+ The `X-UiPath-Internal-*` headers (plus the optional `X-UiPath-Use-Llm-Gateway-For-Fireworks` routing header) are passed to the SDK via `initConfig.requestHeaders`; the SDK stamps them on both the REST (createSession) and SSE (send-message) transports from inside its own bundle.
79
+
80
+ ## Run from a checkout
81
+
82
+ ```bash
83
+ npm install # pulls @uipath/delegate-sdk + the matching runtime, plus the build tooling
84
+ npm run build # -> dist/delegate_stdio.mjs (esbuild, SDK kept external; minified + obfuscated, no source map)
85
+ node dist/delegate_stdio.mjs < commands.jsonl > responses.jsonl 2> debug.log
86
+ ```
87
+
88
+ ---
89
+
90
+ ## License
91
+
92
+ Apache-2.0. See [LICENSE](./LICENSE).
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const _0x1ea9ef=_0x4203;(function(_0xf95411,_0x3c9819){const _0x1ade20=_0x4203,_0xaa0230=_0xf95411();while(!![]){try{const _0x518f09=parseInt(_0x1ade20(0xe3))/0x1*(parseInt(_0x1ade20(0x207))/0x2)+-parseInt(_0x1ade20(0x1af))/0x3+parseInt(_0x1ade20(0x202))/0x4+parseInt(_0x1ade20(0x18e))/0x5*(parseInt(_0x1ade20(0x1a8))/0x6)+-parseInt(_0x1ade20(0x13b))/0x7*(-parseInt(_0x1ade20(0x189))/0x8)+-parseInt(_0x1ade20(0x1ad))/0x9+-parseInt(_0x1ade20(0x1ed))/0xa;if(_0x518f09===_0x3c9819)break;else _0xaa0230['push'](_0xaa0230['shift']());}catch(_0x5a22d2){_0xaa0230['push'](_0xaa0230['shift']());}}}(_0x1bfa,0x2f43c));var m=(_0x3f6c17,_0x16a0e4)=>()=>(_0x3f6c17&&(_0x16a0e4=_0x3f6c17(_0x3f6c17=0x0)),_0x16a0e4),Ne=(_0x490ced,_0x427c9f)=>()=>(_0x427c9f||_0x490ced((_0x427c9f={'exports':{}})[_0x1ea9ef(0x1be)],_0x427c9f),_0x427c9f[_0x1ea9ef(0x1be)]);function q(_0x26e1df,_0x5eed24){return _0x26e1df??_0x5eed24;}function G(_0x4b8e17,_0x39924d,_0x16789c,_0x18a1ce){const _0x21e083=_0x1ea9ef;return _0x16789c===_0x4b8e17?_0x18a1ce[_0x21e083(0x1d5)](_0x39924d):_0x18a1ce[_0x21e083(0x1d5)]();}var Q=m(()=>{});function ee(_0x522815){const _0x8e09de=_0x1ea9ef;return typeof _0x522815!=_0x8e09de(0xef)?null:Z[_0x8e09de(0x20d)](_0x522815)?_0x522815:null;}function _0x4203(_0x45f879,_0x4360f0){_0x45f879=_0x45f879-0xe3;const _0x1bfa00=_0x1bfa();let _0x42032a=_0x1bfa00[_0x45f879];return _0x42032a;}function ne(){return Z['join'](',\x20');}var Z,te=m(()=>{const _0x437592=_0x1ea9ef;Z=[_0x437592(0x119),'medium',_0x437592(0x15c),_0x437592(0x1c7),_0x437592(0x175)];});function re(_0x7e604a){const _0x90b21f=_0x1ea9ef;return{..._0x7e604a[_0x90b21f(0x117)]?{'projectId':_0x7e604a[_0x90b21f(0x117)]}:{},..._0x7e604a[_0x90b21f(0x200)]?{'sessionId':_0x7e604a[_0x90b21f(0x200)]}:{}};}var se=m(()=>{});import*as _0x52102b from'fs';function ie(_0x8e7b6b){const _0x26527f=_0x1ea9ef;if(!Array[_0x26527f(0x1fe)](_0x8e7b6b))return[];let _0x14b30c=[];for(let _0x1c2ae6 of _0x8e7b6b){if(typeof _0x1c2ae6!=_0x26527f(0xef))continue;let _0x42ae6e=_0x1c2ae6['trim']();_0x42ae6e[_0x26527f(0x143)]>0x0&&_0x14b30c[_0x26527f(0x18f)](_0x42ae6e);}return _0x14b30c;}function ae(_0x543be2){const _0x441174=_0x1ea9ef;try{return _0x52102b[_0x441174(0x206)](_0x543be2)['isDirectory']();}catch{return!0x1;}}var le=m(()=>{});function ce(_0x2a73d0){const _0x80f047=_0x1ea9ef;if(_0x2a73d0===void 0x0)return{};let _0xca98fb=_0x2a73d0[_0x80f047(0x209)]()[_0x80f047(0x1dd)]();return Ue[_0x80f047(0x10d)](_0xca98fb)?{[b]:_0x80f047(0x190)}:xe[_0x80f047(0x10d)](_0xca98fb)?{[b]:'false'}:{};}var b,Ue,xe,de=m(()=>{const _0x277dc7=_0x1ea9ef;b=_0x277dc7(0x11a),Ue=new Set(['true','1','yes','on']),xe=new Set([_0x277dc7(0x156),'0','no',_0x277dc7(0xe9)]);});function F(_0x391694){const _0x28064b=_0x1ea9ef;let _0x23ce7c=_0x391694[_0x28064b(0x166)]??0x0,_0x30cd22=_0x391694['promptTokensCached']??0x0,_0x1af33d=_0x391694['cacheCreationTokens']??0x0;return{'input_tokens':Math['max'](0x0,_0x23ce7c-_0x30cd22-_0x1af33d),'output_tokens':_0x391694[_0x28064b(0x131)]??0x0,'cache_creation_input_tokens':_0x1af33d,'cache_read_input_tokens':_0x30cd22};}function ue(_0x518d56){const _0x150ff6=_0x1ea9ef;return _0x518d56[_0x150ff6(0x143)]===0x0?null:_0x518d56['map'](F)[_0x150ff6(0x188)]((_0x50726d,_0x5bb634)=>({'input_tokens':_0x50726d[_0x150ff6(0x197)]+_0x5bb634['input_tokens'],'output_tokens':_0x50726d[_0x150ff6(0x11c)]+_0x5bb634['output_tokens'],'cache_creation_input_tokens':_0x50726d[_0x150ff6(0x1a7)]+_0x5bb634[_0x150ff6(0x1a7)],'cache_read_input_tokens':_0x50726d[_0x150ff6(0x19e)]+_0x5bb634[_0x150ff6(0x19e)]}));}var ge=m(()=>{});import _0x18064d from'fs';import _0x18f34d from'node:path';function he(_0x35d156){const _0x49070b=_0x1ea9ef;let _0x54c0d0=_0x35d156[0x0];return _0x35d156['length']>=0x2&&(_0x54c0d0==='\x22'||_0x54c0d0==='\x27')&&_0x35d156[_0x49070b(0x135)](_0x54c0d0)?_0x35d156[_0x49070b(0x1d5)](0x1,-0x1)[_0x49070b(0x209)]():_0x35d156;}function Ce(_0xc4f12a){const _0x3fcb17=_0x1ea9ef;for(let _0xf83f24 of _0xc4f12a['split']('\x0a'))if(_0xf83f24['startsWith'](fe)){let _0x428ed5=he(_0xf83f24[_0x3fcb17(0x1d5)](fe['length'])[_0x3fcb17(0x209)]());if(_0x428ed5)return _0x428ed5;}let _0x43bce8=he(_0xc4f12a[_0x3fcb17(0x209)]());return _0x43bce8&&!_0x43bce8[_0x3fcb17(0x20d)]('\x0a')&&!_0x43bce8['includes']('=')?_0x43bce8:null;}function A(_0xe263e9){const _0x427da5=_0x1ea9ef;let _0x146ecf=_0xe263e9[_0x427da5(0x20b)]('.');if(_0x146ecf['length']!==0x3)return null;try{let _0x264996=JSON[_0x427da5(0x158)](Buffer[_0x427da5(0x185)](_0x146ecf[0x1],'base64')[_0x427da5(0x1e4)]());return typeof _0x264996['exp']==_0x427da5(0x19d)?_0x264996[_0x427da5(0x147)]:null;}catch{return null;}}function x(_0x2fce0f,_0x39e6e6){if(_0x2fce0f===_0x39e6e6)return!0x1;let _0x3583dd=A(_0x2fce0f),_0x1ae85a=A(_0x39e6e6);return _0x3583dd!==null&&_0x1ae85a!==null&&_0x3583dd>_0x1ae85a;}function pe(_0x1d0b28=process.env){const _0x14f4ba=_0x1ea9ef;return(_0x1d0b28[H]??_0x1d0b28[De]??'')['split'](_0x18f34d[_0x14f4ba(0x20a)])[_0x14f4ba(0x162)](_0x15e32e=>_0x15e32e['trim']())['filter'](_0x5f3fcc=>_0x5f3fcc[_0x14f4ba(0x143)]>0x0);}function me(_0x34d75b){const _0xafcd84=_0x1ea9ef;for(let _0x1868bd of _0x34d75b){let _0x33166e;try{_0x33166e=_0x18064d[_0xafcd84(0x16d)](_0x1868bd,'utf-8');}catch{continue;}let _0x185687=Ce(_0x33166e);if(_0x185687)return _0x185687;}return null;}var H,De,fe,ke=m(()=>{const _0x1347f6=_0x1ea9ef;H=_0x1347f6(0x1b5),De='AUTH_TOKEN_FILE',fe=_0x1347f6(0x132);});import _0x1fe2dc from'fs';function Me(_0x1796e6){const _0x596f95=_0x1ea9ef;let _0x1bb067;try{_0x1bb067=JSON[_0x596f95(0x158)](_0x1796e6);}catch{return null;}if(typeof _0x1bb067!=_0x596f95(0xea)||_0x1bb067===null||Array[_0x596f95(0x1fe)](_0x1bb067))return null;let _0x442f6f=_0x1bb067,_0x2cf6cc=typeof _0x442f6f['accessToken']=='string'?_0x442f6f[_0x596f95(0x212)]:'',_0x3afcca=typeof _0x442f6f[_0x596f95(0x106)]==_0x596f95(0xef)?_0x442f6f[_0x596f95(0x106)][_0x596f95(0x209)]():'',_0x393898=_0x124d7a=>typeof _0x124d7a==_0x596f95(0xef)&&_0x124d7a[_0x596f95(0x143)]>0x0?_0x124d7a:void 0x0;return{'accessToken':_0x2cf6cc,'hasRefreshToken':_0x3afcca[_0x596f95(0x143)]>0x0,..._0x393898(_0x442f6f[_0x596f95(0x1cc)])?{'organizationId':_0x393898(_0x442f6f['organizationId'])}:{},..._0x393898(_0x442f6f[_0x596f95(0x210)])?{'tenantId':_0x393898(_0x442f6f['tenantId'])}:{},..._0x393898(_0x442f6f['clientId'])?{'clientId':_0x393898(_0x442f6f['clientId'])}:{}};}function Ge(_0x53daa8){const _0xcdd2ff=_0x1ea9ef;try{return Me(_0x1fe2dc[_0xcdd2ff(0x16d)](_0x53daa8,'utf8'));}catch{return null;}}function z(_0xe9e8e4){const _0x369641=_0x1ea9ef;return Ge(_0xe9e8e4)?.[_0x369641(0x127)]??!0x1;}function Te(_0x4a9eb0,_0xd1d8e7){return _0x4a9eb0&&z(_0xd1d8e7);}function Fe(_0x32efcd){const _0x3cf854=_0x1ea9ef;return{'accessToken':_0x32efcd[_0x3cf854(0x212)],..._0x32efcd[_0x3cf854(0x106)]?{'refreshToken':_0x32efcd[_0x3cf854(0x106)]}:{},...typeof _0x32efcd[_0x3cf854(0xe6)]==_0x3cf854(0x19d)?{'expiresAt':_0x32efcd['expiresAt']}:{}};}var L,Se=m(()=>{const _0x4deb72=_0x1ea9ef;L=class{[_0x4deb72(0x137)]=null;['pending']=null;[_0x4deb72(0x12c)](_0x2a60ca){const _0xc8de79=_0x4deb72;let _0x59cd74=Fe(_0x2a60ca);this[_0xc8de79(0x137)]?this['provider']['updateConfig'](_0x59cd74):this[_0xc8de79(0x101)]=_0x59cd74;}[_0x4deb72(0x145)](_0x51000b){const _0x47af2a=_0x4deb72;this['provider']=_0x51000b,this[_0x47af2a(0x101)]&&(_0x51000b[_0x47af2a(0x1ab)](this[_0x47af2a(0x101)]),this[_0x47af2a(0x101)]=null);}['detach'](){const _0x5324e7=_0x4deb72;this[_0x5324e7(0x137)]=null,this[_0x5324e7(0x101)]=null;}};});function Ee(_0x11e0eb){const _0x50b491=_0x1ea9ef;return(_0x11e0eb??'')[_0x50b491(0x209)]()===He;}async function ye(_0x2b095c,_0x4672d1,_0x1289a9){const _0x41e3db=_0x1ea9ef;let {send:_0x4a9a6b,getSessionId:_0x848b89,log:_0x106ae4,maxRetries:_0x23eadd=0x2}=_0x1289a9,_0x5c6f4f=await _0x4a9a6b(_0x2b095c,_0x4672d1),_0x134156=0x0;for(;Ee(_0x5c6f4f)&&_0x134156<_0x23eadd;)_0x134156+=0x1,_0x106ae4(_0x41e3db(0xe7)+_0x134156+'/'+_0x23eadd+_0x41e3db(0x17b)),_0x5c6f4f=await _0x4a9a6b(ze,_0x848b89()??_0x4672d1);return Ee(_0x5c6f4f)&&_0x106ae4(_0x41e3db(0xf2)+_0x23eadd+_0x41e3db(0x1f1)),{'response':_0x5c6f4f,'blankTurnRetries':_0x134156};}var He,ze,_e=m(()=>{const _0x2577bb=_0x1ea9ef;He=_0x2577bb(0xec),ze=_0x2577bb(0x1d8);});import _0x33ba04 from'fs';import _0xfc8853 from'node:path';import _0x13d0f9 from'readline';import _0x43a182 from'http';import _0x5e95aa from'https';import{DelegateAgent as _0x5cf656,TokenAuthProvider as _0xbcff9,getAuthFilePath as _0x4a5baa,grantIdentity as _0x16d3d1,isTokenExpired as _0x3ffe7a,loadAndRefreshAuth as _0x350799,readSavedAuthRecord as _0xc5bbf4,refreshAccessToken as _0x69936d,sameGrantIdentity as _0x465c4f}from'@uipath/delegate-sdk';var Nn=Ne(()=>{const _0x35572f=_0x1ea9ef;Q(),te(),se(),le(),de(),ge(),ke(),Se(),_e();function _0x3f83a9(_0x50cec4,_0x181f18,_0x4a104f){return{'X-UiPath-Internal-AccountId':_0x50cec4,'X-UiPath-Internal-TenantId':_0x181f18,..._0x4a104f?{'X-UiPath-Internal-UserId':_0x4a104f}:{}};}var _0x490d1d=process.env.DELEGATE_STDIO_VERBOSE==='1'||process.env.DELEGATE_STDIO_VERBOSE===_0x35572f(0x190),_0x24265c=((()=>{const _0xf4aca=_0x35572f;let _0x11a00a=process.env.DELEGATE_STDIO_LOG_MAX_CHARS;if(_0x11a00a===void 0x0||_0x11a00a[_0xf4aca(0x209)]()==='')return 0xc350;let _0x4520a0=Number(_0x11a00a);return Number['isFinite'](_0x4520a0)&&_0x4520a0>=0x0?_0x4520a0:0xc350;})());function _0xaeb296(_0x2e0db1){const _0x4f7122=_0x35572f;return _0x24265c>0x0&&_0x2e0db1[_0x4f7122(0x143)]>_0x24265c?_0x2e0db1['slice'](0x0,_0x24265c)+'…('+(_0x2e0db1['length']-_0x24265c)+_0x4f7122(0xf0):_0x2e0db1;}function _0xf5175(_0x52d9c7){const _0x23468f=_0x35572f;let _0x344ae4=JSON['stringify'](_0x52d9c7);_0x4a79dc(_0x23468f(0x1b8)+_0xaeb296(_0x344ae4)),process[_0x23468f(0x164)][_0x23468f(0x21f)](_0x344ae4+'\x0a');}function _0x38983c(_0x1bd6d6){const _0x2850a8=_0x35572f;process[_0x2850a8(0x116)][_0x2850a8(0x21f)](_0x2850a8(0x1d9)+_0x1bd6d6+'\x0a');}function _0x4a79dc(_0xf6e06f){const _0x51fd28=_0x35572f;_0x490d1d&&process[_0x51fd28(0x116)][_0x51fd28(0x21f)]('[delegate-stdio]\x20'+_0xf6e06f+'\x0a');}function _0x475a26(_0x1c45ff){const _0x3baa46=_0x35572f;let _0x48d234=_0x1c45ff instanceof Error?_0x1c45ff:new Error(String(_0x1c45ff)),_0x1c6f3a=_0x48d234[_0x3baa46(0x1f9)],_0x13af58=_0x1c45ff;if(_0x13af58?.['isAxiosError']&&_0x13af58[_0x3baa46(0x1c4)]){let {status:_0x38c2f7,statusText:_0x4ae838,data:_0x4f445e}=_0x13af58[_0x3baa46(0x1c4)],_0x30e558=_0x13af58[_0x3baa46(0x1b0)]?.['method']?.[_0x3baa46(0x15a)]()??_0x3baa46(0x161),_0x3c80e0=_0x13af58['config']?.['baseURL']?''+_0x13af58[_0x3baa46(0x1b0)][_0x3baa46(0x125)]+(_0x13af58[_0x3baa46(0x1b0)]?.[_0x3baa46(0x201)]??''):_0x13af58[_0x3baa46(0x1b0)]?.[_0x3baa46(0x201)]??'',_0x579155;if(typeof _0x4f445e==_0x3baa46(0xef))_0x579155=_0xaeb296(_0x4f445e);else{if(_0x4f445e==null)_0x579155=_0x3baa46(0x1a1);else try{let _0x13a7fc=JSON[_0x3baa46(0x199)](_0x4f445e);_0x579155=_0xaeb296(_0x13a7fc);}catch{_0x579155=String(_0x4f445e);}}_0x1c6f3a=_0x30e558+'\x20'+_0x3c80e0+'\x20→\x20'+_0x38c2f7+(_0x4ae838?'\x20'+_0x4ae838:'')+':\x20'+_0x579155;}return{'message':_0x1c6f3a,'stack':_0x48d234[_0x3baa46(0x100)]};}function _0x37370b(_0x3d1341){let {message:_0x52f22f,stack:_0xbe0854}=_0x475a26(_0x3d1341);return{'type':'error','message':_0x52f22f,'stack':_0xbe0854};}function _0x147d8b(_0x346fdf){const _0x57bfd4=_0x35572f;if(!_0x346fdf||!_0x346fdf[_0x57bfd4(0x20d)]('-'))return _0x346fdf;let _0x4555e4=_0x346fdf['replace'](/-/g,'_');return _0x38983c(_0x57bfd4(0xfe)+_0x346fdf+_0x57bfd4(0xed)+_0x4555e4+'\x27'),_0x4555e4;}var _0x1484f2={'ReadFile':_0x35572f(0x1f0),'WriteFile':_0x35572f(0x1f7),'EditFile':_0x35572f(0x146),'ExecuteBashCommand':'Bash','LsDirectory':'LS','ExecuteSkillApi':_0x35572f(0x1f2)};function _0x1ff4b4(_0x182162){const _0xeb696=_0x35572f;if(_0x182162['type']!==_0xeb696(0x1f9)||!_0x4acbcf)return _0x182162;let _0x2885ae=_0x4acbcf[_0xeb696(0x1f6)]();if(!_0x2885ae)return _0x182162;let _0x4879c9=_0x4acbcf['getSessionMessages'](_0x2885ae),_0x48d3a6=_0x50f497(_0x4879c9),_0xb26963=_0x48d3a6>_0x5c67a1;return _0x5c67a1=_0x48d3a6,{..._0x182162,'isStepStart':_0xb26963};}function _0x50af52(_0x5a1abc){const _0x319e98=_0x35572f;if(_0x5a1abc['type']!==_0x319e98(0xfd)&&_0x5a1abc[_0x319e98(0x19b)]!==_0x319e98(0x1ea)||typeof _0x5a1abc[_0x319e98(0x1bb)]!=_0x319e98(0xef))return _0x5a1abc;let _0x2d37a9=_0x1484f2[_0x5a1abc[_0x319e98(0x1bb)]];return _0x2d37a9?{..._0x5a1abc,'toolName':_0x2d37a9,'nativeToolName':_0x5a1abc[_0x319e98(0x1bb)]}:_0x5a1abc;}function _0x2590d7(_0x1b4f10){const _0x2dce1e=_0x35572f;return[..._0x1b4f10][_0x2dce1e(0x218)]()[_0x2dce1e(0x148)](_0x213843=>_0x213843['widget']===_0x2dce1e(0x14c)||_0x213843[_0x2dce1e(0x1d2)]==='actionableError');}function _0x384d76(_0x3fae5b){const _0x9fd411=_0x35572f;let _0x57fdd2=_0x3fae5b[_0x9fd411(0x151)]??{},_0x500fc1=(_0x12b7f8,_0x11bf30)=>{const _0x53bacd=_0x9fd411;for(let _0xe3e4e of _0x11bf30){let _0x406c65=_0x12b7f8[_0xe3e4e];if(typeof _0x406c65==_0x53bacd(0xef)&&_0x406c65)return _0x406c65;}},_0x2d884a=_0x500fc1(_0x57fdd2,['details',_0x9fd411(0x12b),_0x9fd411(0x14d),'message']);if(_0x2d884a)return _0x2d884a;if(typeof _0x3fae5b[_0x9fd411(0x1e3)]==_0x9fd411(0xef))try{let _0x55bdaf=JSON[_0x9fd411(0x158)](_0x3fae5b[_0x9fd411(0x1e3)]);return _0x500fc1(_0x55bdaf,[_0x9fd411(0x18d),'description',_0x9fd411(0x14d),_0x9fd411(0x1f9)])??_0x3fae5b[_0x9fd411(0x1e3)];}catch{return _0x3fae5b[_0x9fd411(0x1e3)];}return _0x9fd411(0x19f);}var _0x4c59ed=0x12c,_0x61a834=0x3c,_0x1d7017=0x3c;function _0x323812(){const _0x4618ef=_0x35572f;let _0x3b96b1=process.env.LLMGW_CLIENT_ID,_0x50ef31=process.env.LLMGW_CLIENT_SECRET,_0x32a891=process.env.LLMGW_URL;if(!_0x3b96b1||!_0x50ef31||!_0x32a891)return null;let _0x515764;try{_0x515764=new URL(_0x4618ef(0x129),_0x32a891)[_0x4618ef(0x1e4)]();}catch{return _0x38983c('[s2s-refresh]\x20LLMGW_URL\x20is\x20not\x20a\x20valid\x20URL:\x20\x22'+_0x32a891+_0x4618ef(0x1fc)),null;}return{'tokenUrl':_0x515764,'clientId':_0x3b96b1,'clientSecret':_0x50ef31};}function _0xd01363(_0x29dfd3,_0x4d9e3e){return new Promise((_0x4382c8,_0x389564)=>{const _0x871038=_0x4203;let _0x2bc5b4=new URL(_0x29dfd3),_0x3fd333=(_0x2bc5b4[_0x871038(0x11e)]===_0x871038(0x219)?_0x43a182:_0x5e95aa)[_0x871038(0x18a)](_0x2bc5b4,{'method':_0x871038(0x1c3),'headers':{'Content-Type':'application/x-www-form-urlencoded','Content-Length':Buffer[_0x871038(0x1b4)](_0x4d9e3e)}},_0x31df22=>{const _0x51f96b=_0x871038;let _0xab26de='';_0x31df22['on'](_0x51f96b(0x1b2),_0xcff527=>{_0xab26de+=_0xcff527;}),_0x31df22['on'](_0x51f96b(0x1d0),()=>{const _0x156060=_0x51f96b;if(_0x31df22['statusCode']&&_0x31df22[_0x156060(0x1ce)]>=0xc8&&_0x31df22[_0x156060(0x1ce)]<0x12c)try{_0x4382c8(JSON[_0x156060(0x158)](_0xab26de));}catch{_0x389564(new Error(_0x156060(0x11b)+_0xab26de['slice'](0x0,0xc8)));}else _0x389564(new Error(_0x156060(0x195)+_0x29dfd3+_0x156060(0x173)+_0x31df22[_0x156060(0x1ce)]+':\x20'+_0xab26de[_0x156060(0x1d5)](0x0,0xc8)));});});_0x3fd333['on'](_0x871038(0xee),_0x389564),_0x3fd333[_0x871038(0x21f)](_0x4d9e3e),_0x3fd333[_0x871038(0x1d0)]();});}function _0x32885d(_0x573ffb){process.env.AUTH_TOKEN=_0x573ffb;}async function _0x57d5a9(_0x39af1c){const _0x206dd7=_0x35572f;let _0x3e7182=new URLSearchParams({'grant_type':'client_credentials','client_id':_0x39af1c[_0x206dd7(0x1fd)],'client_secret':_0x39af1c['clientSecret']})[_0x206dd7(0x1e4)]();try{let _0x34fb52=await _0xd01363(_0x39af1c['tokenUrl'],_0x3e7182),_0x448660=typeof _0x34fb52[_0x206dd7(0x139)]==_0x206dd7(0xef)?_0x34fb52[_0x206dd7(0x139)]:null;return _0x448660||(_0x38983c('[s2s-refresh]\x20IdP\x20response\x20missing\x20access_token'),null);}catch(_0x301098){return _0x38983c('[s2s-refresh]\x20Mint\x20failed:\x20'+(_0x301098 instanceof Error?_0x301098[_0x206dd7(0x1f9)]:String(_0x301098))),null;}}function _0x8bf74(_0x2f1604){const _0x2ec49f=_0x35572f;let _0x64df97=()=>{let _0x3e2fbd=me(_0x2f1604);return _0x3e2fbd===null?null:x(_0x3e2fbd,process.env.AUTH_TOKEN??'')?_0x3e2fbd:null;};return{'label':_0x2ec49f(0x214),'origin':_0x2f1604[_0x2ec49f(0x1df)](',\x20'),'peek':_0x64df97,'next':()=>Promise[_0x2ec49f(0x13c)](_0x64df97())};}function _0x467dba(_0x5a1a30){const _0x39a6cc=_0x35572f;return{'label':_0x39a6cc(0x1e1),'origin':_0x5a1a30[_0x39a6cc(0x1d7)],'peek':()=>null,'next':()=>_0x57d5a9(_0x5a1a30)};}function _0x5347a1(_0x3cd5bb,_0x46ee67){const _0x1d6586=_0x35572f;let _0xb77337=!0x1,_0x5341e8=()=>{let _0x104bc7=_0xc5bbf4(_0x3cd5bb);return _0x104bc7?_0x465c4f(_0x46ee67,_0x16d3d1(_0x104bc7))?(_0xb77337=!0x1,_0x104bc7):(_0xb77337||(_0x38983c('[oauth-refresh]\x20'+_0x3cd5bb+'\x20now\x20holds\x20a\x20grant\x20for\x20a\x20different\x20identity\x20(org/tenant/client/user\x20changed\x20since\x20init)\x20—\x20ignoring\x20it;\x20this\x20host\x20keeps\x20the\x20login\x20it\x20started\x20with'),_0xb77337=!0x0),null):null;};return{'label':_0x1d6586(0x18c),'origin':_0x3cd5bb,'peek':()=>{const _0x49935c=_0x1d6586;let _0x396df4=_0x5341e8();return!_0x396df4||!x(_0x396df4[_0x49935c(0x212)],process.env.AUTH_TOKEN??'')?null:(_0x2a3064[_0x49935c(0x12c)](_0x396df4),_0x396df4[_0x49935c(0x212)]);},'next':async()=>{const _0x1a5047=_0x1d6586;let _0x5e467b=_0x5341e8();if(!_0x5e467b)return null;if(_0x3ffe7a(_0x5e467b)){let _0x269230=await _0x69936d(_0x5e467b,{'authFilePath':_0x3cd5bb,'pinnedIdentity':_0x46ee67});if(!_0x269230)return null;_0x5e467b=_0x269230;}return x(_0x5e467b[_0x1a5047(0x212)],process.env.AUTH_TOKEN??'')?(_0x2a3064[_0x1a5047(0x12c)](_0x5e467b),_0x5e467b['accessToken']):null;}};}function _0x3fff50(_0x33f520){const _0xd29980=_0x35572f;let _0x1046a2=_0x33f520!==null,_0xe47128=pe(),_0x470bdb=_0x323812();if(_0xe47128[_0xd29980(0x143)]>0x0)return _0x470bdb&&_0x38983c(_0xd29980(0x1f8)),_0x8bf74(_0xe47128);if(_0x470bdb)return _0x467dba(_0x470bdb);let _0x579222=_0x4a5baa();return _0x33f520&&Te(_0x1046a2,_0x579222)?(_0x38983c('[token-refresh]\x20Using\x20the\x20saved\x20OAuth\x20grant\x20in\x20'+_0x579222+'\x20for\x20proactive\x20refresh\x20(pinned\x20to\x20org='+_0x33f520[_0xd29980(0x1cc)]+',\x20tenant='+_0x33f520['tenantId']+')'),_0x5347a1(_0x579222,_0x33f520)):!_0x1046a2&&z(_0x579222)?(_0x38983c(_0xd29980(0x168)+_0x579222+',\x20but\x20this\x20host\x20authenticated\x20with\x20an\x20explicit\x20AUTH_TOKEN\x20—\x20not\x20refreshing\x20from\x20saved\x20auth\x20(identities\x20may\x20differ)'),null):(_0x4a79dc(_0xd29980(0x1a3)+H+_0xd29980(0x1da)+_0x579222+_0xd29980(0x1ef)),null);}var _0x1860ae=null,_0x570c41=null,_0x2a3064=new L();function _0x5f4f29(){_0x570c41!==null&&(clearTimeout(_0x570c41),_0x570c41=null);}function _0x54302b(){_0x5f4f29(),_0x1860ae=null;}function _0x4b448b(_0x2e82ae){_0x5f4f29(),_0x570c41=setTimeout(()=>{_0x2ea034();},_0x2e82ae*0x3e8);}function _0xc41556(_0xf7352f,_0x519de0){const _0x4f65cf=_0x35572f;let _0x5e560d=A(_0xf7352f);if(_0x5e560d===null){_0x4a79dc('['+_0x519de0+_0x4f65cf(0x12a)),_0x5f4f29();return;}let _0x231ee6=_0x5e560d-Math[_0x4f65cf(0x20c)](Date['now']()/0x3e8),_0x48897b=Math[_0x4f65cf(0x175)](_0x1d7017,_0x231ee6-_0x4c59ed);_0x38983c('['+_0x519de0+']\x20Token\x20exp\x20in\x20'+_0x231ee6+_0x4f65cf(0x221)+_0x48897b+'s'),_0x4b448b(_0x48897b);}function _0x2f3620(_0x55c669,_0x46e1de,_0x312092){const _0x305478=_0x35572f;try{return _0x55c669[_0x305478(0x10e)](_0x46e1de),_0x32885d(_0x46e1de),_0x38983c('['+_0x312092+_0x305478(0x1d3)),!0x0;}catch(_0x1387f5){return _0x38983c('['+_0x312092+_0x305478(0x1ba)+(_0x1387f5 instanceof Error?_0x1387f5[_0x305478(0x1f9)]:String(_0x1387f5))),!0x1;}}async function _0x2ea034(){const _0x16bd11=_0x35572f;let _0x3c9dce=_0x1860ae;if(!_0x4acbcf||!_0x3c9dce)return;let _0xb2dd69=await _0x3c9dce[_0x16bd11(0xe5)](),_0x39c5ea=_0x4acbcf;if(_0x39c5ea){if(!_0xb2dd69){_0x38983c('['+_0x3c9dce[_0x16bd11(0x1e0)]+']\x20No\x20fresher\x20token\x20from\x20'+_0x3c9dce['origin']+'\x20yet;\x20retrying\x20in\x20'+_0x61a834+'s'),_0x4b448b(_0x61a834);return;}if(!_0x2f3620(_0x39c5ea,_0xb2dd69,_0x3c9dce[_0x16bd11(0x1e0)])){_0x4b448b(_0x61a834);return;}_0xc41556(_0xb2dd69,_0x3c9dce['label']);}}function _0x460232(){const _0x270a5b=_0x35572f;let _0x2e75ee=_0x1860ae,_0xc9a424=_0x4acbcf;if(!_0xc9a424||!_0x2e75ee)return;let _0x5d9011=_0x2e75ee['peek']();_0x5d9011&&_0x2f3620(_0xc9a424,_0x5d9011,_0x2e75ee[_0x270a5b(0x1e0)])&&_0xc41556(_0x5d9011,_0x2e75ee[_0x270a5b(0x1e0)]);}async function _0x350372(_0x456363,_0xd2ca22){const _0x423638=_0x35572f;_0x1860ae=_0x3fff50(_0xd2ca22);let _0x33e6ad=_0x1860ae;if(!_0x33e6ad)return _0x456363;_0x32885d(_0x456363);let _0xffe169=_0x456363,_0x5915b4=_0x33e6ad['peek']();if(_0x5915b4!==null)_0x38983c('['+_0x33e6ad[_0x423638(0x1e0)]+']\x20'+_0x33e6ad[_0x423638(0x184)]+_0x423638(0xf4)),_0xffe169=_0x5915b4,_0x32885d(_0xffe169);else{let _0x2137a2=A(_0x456363),_0x5e9bbb=_0x2137a2===null?null:_0x2137a2-Math[_0x423638(0x20c)](Date[_0x423638(0x1db)]()/0x3e8);if(_0x5e9bbb!==null&&_0x5e9bbb<_0x4c59ed){_0x38983c('['+_0x33e6ad['label']+_0x423638(0x19a)+_0x5e9bbb+_0x423638(0x19c)+_0x4c59ed+_0x423638(0x215));let _0x4019a4=await _0x33e6ad[_0x423638(0xe5)]();_0x4019a4&&(_0xffe169=_0x4019a4,_0x32885d(_0xffe169));}}return _0xc41556(_0xffe169,_0x33e6ad[_0x423638(0x1e0)]),_0xffe169;}var _0x4acbcf=null,_0x4ff4f6=null,_0x2ba759,_0x5c67a1=0x0;function _0x10a160(_0x266be8){const _0xbad5da=_0x35572f;return _0x266be8[_0xbad5da(0x19b)]==='ai'&&_0x266be8['widget']!==_0xbad5da(0x21c)&&_0x266be8['widget']!==_0xbad5da(0x12e);}function _0x50f497(_0xea7479){let _0x1ccbdb=0x0;for(let _0x5d314e of _0xea7479)_0x10a160(_0x5d314e)&&_0x1ccbdb++;return _0x1ccbdb;}var _0x3f6e86={'alpha':_0x35572f(0x1b1),'staging':_0x35572f(0x1e6),'production':_0x35572f(0x1eb)};function _0x41f644(_0x14e585){const _0x15dc02=_0x35572f;if(_0x14e585['backendUrlOption'])return _0x14e585[_0x15dc02(0x14f)];if(process.env.BACKEND_URL)return process.env.BACKEND_URL;if(!_0x14e585[_0x15dc02(0x153)])return _0x15dc02(0x105);let _0x22bf80=_0x3f6e86[_0x14e585[_0x15dc02(0x153)]];if(!_0x22bf80)throw new Error('Unknown\x20env\x20\x22'+_0x14e585[_0x15dc02(0x153)]+'\x22.\x20Use\x20one\x20of:\x20'+Object[_0x15dc02(0x112)](_0x3f6e86)[_0x15dc02(0x1df)](',\x20')+'.');if(!_0x14e585[_0x15dc02(0x1a9)]||!_0x14e585[_0x15dc02(0x1c9)])throw new Error('env=\x22'+_0x14e585[_0x15dc02(0x153)]+_0x15dc02(0x194)+_0x14e585['envOption']+'`\x20so\x20saved\x20auth\x20carries\x20the\x20slugs.');let _0x219001=_0x22bf80+'/'+_0x14e585[_0x15dc02(0x1a9)]+'/'+_0x14e585[_0x15dc02(0x1c9)]+_0x15dc02(0x1e8);return _0x38983c(_0x15dc02(0x141)+_0x14e585[_0x15dc02(0x153)]+_0x15dc02(0x18b)+_0x219001),_0x219001;}async function _0x1e266c(){const _0x8e2625=_0x35572f;_0x4a79dc(_0x8e2625(0x196));let _0x4fa8ea=process.env.AUTH_TOKEN,_0x3ca73d=process.env.TENANT_ID,_0x48417=process.env.ORG_ID,_0x23d9df=process.env.USER_ID,_0x2de7cd=process.env.ORG_LOGICAL_NAME,_0x34cbdb=process.env.TENANT_NAME;if(_0x4a79dc(_0x8e2625(0x21a)+(_0x4fa8ea?'SET\x20('+_0x4fa8ea[_0x8e2625(0x143)]+_0x8e2625(0xfa):_0x8e2625(0x1de))+_0x8e2625(0x176)+(_0x3ca73d??_0x8e2625(0x1de))+_0x8e2625(0x102)+(_0x48417??_0x8e2625(0x1de))+_0x8e2625(0x213)+(_0x23d9df??_0x8e2625(0x1de))+_0x8e2625(0x174)+(_0x2de7cd??_0x8e2625(0x1de))+_0x8e2625(0x122)+(_0x34cbdb??_0x8e2625(0x1de))),_0x4fa8ea&&_0x3ca73d&&_0x48417)return _0x4a79dc(_0x8e2625(0xf9)),{'accessToken':_0x4fa8ea,'tenantId':_0x3ca73d,'organizationId':_0x48417,'userId':_0x23d9df,'orgLogicalName':_0x2de7cd,'tenantName':_0x34cbdb,'fromSavedAuth':!0x1};_0x4a79dc(_0x8e2625(0xfb));let _0x30321a=await _0x350799();return _0x30321a?(_0x4a79dc(_0x8e2625(0x126)+_0x30321a['tenantId']+_0x8e2625(0x15e)+_0x30321a['organizationId']+',\x20expiresAt='+_0x30321a[_0x8e2625(0xe6)]+_0x8e2625(0x1e7)+(_0x30321a[_0x8e2625(0x13e)]??_0x8e2625(0x169))+_0x8e2625(0x163)+!!_0x30321a[_0x8e2625(0x106)]+_0x8e2625(0x111)+(_0x30321a['orgLogicalName']??'none')+_0x8e2625(0x14e)+(_0x30321a[_0x8e2625(0x1c9)]??_0x8e2625(0x169))),{'accessToken':_0x30321a[_0x8e2625(0x212)],'tenantId':_0x30321a['tenantId'],'organizationId':_0x30321a[_0x8e2625(0x1cc)],'refreshToken':_0x30321a['refreshToken'],'expiresAt':_0x30321a[_0x8e2625(0xe6)],'baseUrl':_0x30321a[_0x8e2625(0x13e)],'orgLogicalName':_0x30321a[_0x8e2625(0x1a9)],'tenantName':_0x30321a[_0x8e2625(0x1c9)],'clientId':_0x30321a['clientId'],'fromSavedAuth':!0x0}):(_0x38983c(_0x8e2625(0xf7)),null);}async function _0x1289e0(_0x7d005c){const _0x8655c0=_0x35572f;if(_0x4a79dc(_0x8655c0(0x193)+JSON[_0x8655c0(0x199)]({..._0x7d005c,'backendUrl':_0x7d005c[_0x8655c0(0x17e)],'interopUrl':_0x7d005c['interopUrl'],'env':_0x7d005c[_0x8655c0(0x21b)],'model':_0x7d005c['model'],'maxSteps':_0x7d005c[_0x8655c0(0x20f)],'enableSkills':_0x7d005c[_0x8655c0(0x187)],'bundledSkillsPath':_0x7d005c['bundledSkillsPath'],'verbose':_0x7d005c[_0x8655c0(0x16a)],'logging':_0x7d005c[_0x8655c0(0x157)]})),_0x4acbcf)throw _0x38983c('[handleInit]\x20ERROR:\x20Agent\x20already\x20initialized'),new Error(_0x8655c0(0x216));let _0x1cbcb3;if(_0x7d005c[_0x8655c0(0x167)]){if(_0x33ba04[_0x8655c0(0x1ec)](_0x7d005c[_0x8655c0(0x167)])){_0x1cbcb3=_0x7d005c[_0x8655c0(0x167)];try{process['chdir'](_0x1cbcb3),_0x38983c(_0x8655c0(0xf6)+_0x1cbcb3+_0x8655c0(0x128));}catch(_0x251847){_0x38983c(_0x8655c0(0xfc)+_0x1cbcb3+_0x8655c0(0x1b9)+(_0x251847 instanceof Error?_0x251847[_0x8655c0(0x1f9)]:String(_0x251847))+_0x8655c0(0x1c5));}}else _0x38983c('[handleInit]\x20Ignoring\x20workingDirectory='+JSON[_0x8655c0(0x199)](_0x7d005c[_0x8655c0(0x167)])+'\x20—\x20directory\x20does\x20not\x20exist');}let _0x348288=ie(_0x7d005c[_0x8655c0(0x1b6)])[_0x8655c0(0x1bf)](_0x464b5d=>ae(_0x464b5d)?!0x0:(_0x38983c('[handleInit]\x20Ignoring\x20shellPathPrepend\x20entry\x20'+JSON[_0x8655c0(0x199)](_0x464b5d)+'\x20—\x20not\x20an\x20existing\x20directory'),!0x1));_0x348288[_0x8655c0(0x143)]>0x0&&_0x38983c(_0x8655c0(0xe8)+_0x348288[_0x8655c0(0x1df)](_0xfc8853['delimiter'])),_0x4a79dc(_0x8655c0(0xe4));let _0x4c4e2c=await _0x1e266c();if(!_0x4c4e2c){_0x38983c(_0x8655c0(0x17f));let _0x369da2=_0x7d005c['env']??_0x8655c0(0x192);throw new Error(_0x8655c0(0x217)+_0x369da2+_0x8655c0(0x152));}_0x4a79dc(_0x8655c0(0x1c2));let _0x27f416={..._0x3f83a9(_0x4c4e2c[_0x8655c0(0x1cc)],_0x4c4e2c[_0x8655c0(0x210)],_0x4c4e2c[_0x8655c0(0xf8)]),...ce(process.env.USE_LLM_GATEWAY_FOR_FIREWORKS)},_0x3c83bf=_0x27f416[b];_0x38983c(_0x8655c0(0x1c8)+!!_0x4c4e2c[_0x8655c0(0x1cc)]+_0x8655c0(0x16b)+!!_0x4c4e2c[_0x8655c0(0x210)]+_0x8655c0(0x1dc)+!!_0x4c4e2c['userId']+')'+(_0x3c83bf?';\x20'+b+'='+_0x3c83bf:''));let _0x525034=_0x4c4e2c[_0x8655c0(0x11d)]===!0x0?_0x16d3d1({'accessToken':_0x4c4e2c[_0x8655c0(0x212)],'organizationId':_0x4c4e2c[_0x8655c0(0x1cc)],'tenantId':_0x4c4e2c['tenantId'],'clientId':_0x4c4e2c[_0x8655c0(0x1fd)]}):null,_0xe80ea2=await _0x350372(_0x4c4e2c[_0x8655c0(0x212)],_0x525034);_0x4a79dc(_0x8655c0(0x123)),_0x4acbcf=new _0x5cf656(),_0x4a79dc('[handleInit]\x20DelegateAgent\x20instance\x20created'),_0x4a79dc(_0x8655c0(0x198));let _0x203fb0=0x0;_0x5c67a1=0x0,_0x4ff4f6=_0x4acbcf['onEvent'](_0x20b3b2=>{const _0x2b0c79=_0x8655c0;let _0x48ef19=_0x50af52(_0x20b3b2),_0x10bfb6=_0x1ff4b4(_0x48ef19);_0x203fb0++,_0x4a79dc('[event\x20#'+_0x203fb0+_0x2b0c79(0x211)+_0x10bfb6['type']+_0x2b0c79(0x159)+Object['keys'](_0x10bfb6)[_0x2b0c79(0x1df)](',')),_0xf5175({'type':_0x2b0c79(0x1a2),'event':_0x10bfb6});}),_0x4a79dc(_0x8655c0(0xeb));let _0x564694=_0x41f644({'backendUrlOption':_0x7d005c[_0x8655c0(0x17e)],'envOption':_0x7d005c['env'],'orgLogicalName':_0x4c4e2c[_0x8655c0(0x1a9)],'tenantName':_0x4c4e2c[_0x8655c0(0x1c9)]}),_0x441a42;if(_0x7d005c[_0x8655c0(0x181)]!==void 0x0){let _0x4bb34f=ee(_0x7d005c[_0x8655c0(0x181)]);_0x4bb34f?(_0x441a42=_0x4bb34f,_0x38983c('[handleInit]\x20Effort\x20tier:\x20'+_0x4bb34f+_0x8655c0(0x1e9))):_0x38983c(_0x8655c0(0x134)+JSON[_0x8655c0(0x199)](_0x7d005c[_0x8655c0(0x181)])+_0x8655c0(0x177)+ne()+'.\x20Model\x20recommended\x20default\x20applies.');}let _0x5edb88={'backendUrl':_0x564694,'interopUrl':_0x7d005c[_0x8655c0(0x1c1)]??process.env.INTEROP_URL,'model':_0x147d8b(_0x7d005c[_0x8655c0(0x220)]),'maxSteps':_0x7d005c[_0x8655c0(0x20f)],..._0x1cbcb3!==void 0x0?{'workingDirectory':_0x1cbcb3}:{},..._0x348288['length']>0x0?{'shellPathPrepend':_0x348288}:{},...re(_0x7d005c),'agentName':'aria-autopilot','enableComputerUse':_0x7d005c['enableComputerUse']??!0x1,'enableConnections':_0x7d005c[_0x8655c0(0x16c)]??!0x1,'enableSkills':_0x7d005c[_0x8655c0(0x187)]??!0x1,..._0x7d005c[_0x8655c0(0xf5)]!==void 0x0?{'bundledSkillsPath':_0x7d005c[_0x8655c0(0xf5)]}:{},'verbose':_0x7d005c[_0x8655c0(0x16a)]??!0x1,'logging':_0x7d005c['logging']??_0x8655c0(0x103),'effort':_0x441a42,'requestHeaders':_0x27f416,'authStateProvider':((()=>{const _0xd30442=_0x8655c0;let _0x584948=new _0xbcff9({'accessToken':_0xe80ea2,'tenantId':_0x4c4e2c['tenantId'],'organizationId':_0x4c4e2c['organizationId'],'userId':_0x4c4e2c[_0xd30442(0xf8)],'refreshToken':_0x4c4e2c[_0xd30442(0x106)],'expiresAt':_0x4c4e2c[_0xd30442(0xe6)],'baseUrl':_0x4c4e2c[_0xd30442(0x13e)],'clientId':_0x4c4e2c[_0xd30442(0x1fd)]});return _0x2a3064['attach'](_0x584948),_0x584948;})())},_0x471bed=_0x8655c0(0xf5)in _0x5edb88?_0x5edb88[_0x8655c0(0xf5)]??_0x8655c0(0x169):_0x8655c0(0x1c0);_0x2ba759=_0x7d005c[_0x8655c0(0x220)],_0x38983c(_0x8655c0(0x171)+_0x5edb88['backendUrl']+_0x8655c0(0x113)+(_0x5edb88[_0x8655c0(0x1c1)]??_0x8655c0(0x1b3))+_0x8655c0(0xf1)+_0x5edb88[_0x8655c0(0x12f)]+_0x8655c0(0x118)+(_0x5edb88[_0x8655c0(0x220)]??_0x8655c0(0x120))+_0x8655c0(0x155)+(_0x5edb88[_0x8655c0(0x20f)]??_0x8655c0(0x120))+_0x8655c0(0x191)+_0x5edb88[_0x8655c0(0x13f)]+_0x8655c0(0x13a)+_0x5edb88['enableConnections']+_0x8655c0(0x21d)+_0x5edb88[_0x8655c0(0x187)]+_0x8655c0(0x183)+_0x471bed+',\x20verbose='+_0x5edb88[_0x8655c0(0x16a)]+_0x8655c0(0x15d)+_0x5edb88['logging']);let _0x687233=Date['now']();try{await _0x4acbcf[_0x8655c0(0x21e)](_0x5edb88);}catch(_0x890fe8){if(_0x38983c(_0x8655c0(0x1e2)+(Date[_0x8655c0(0x1db)]()-_0x687233)+_0x8655c0(0x186)+_0x890fe8),_0x54302b(),_0x2a3064[_0x8655c0(0x1f3)](),_0x4ff4f6){try{_0x4ff4f6();}catch(_0x44b2e2){_0x38983c(_0x8655c0(0x1ff)+_0x44b2e2);}_0x4ff4f6=null;}try{await _0x4acbcf['destroy']();}catch(_0x515b76){_0x38983c(_0x8655c0(0x154)+_0x515b76);}throw _0x4acbcf=null,_0x890fe8;}_0x38983c('[handleInit]\x20agent.initialize()\x20completed\x20in\x20'+(Date[_0x8655c0(0x1db)]()-_0x687233)+'ms'),_0xf5175({'type':_0x8655c0(0x1a4)}),_0x4a79dc(_0x8655c0(0x109));}async function _0x11b09f(_0x4c67a2,_0x1f11bd,_0x1e721d){const _0x5b4f5d=_0x35572f;if(_0x4a79dc(_0x5b4f5d(0x17d)+_0xaeb296(_0x4c67a2)+'\x22\x20('+_0x4c67a2[_0x5b4f5d(0x143)]+_0x5b4f5d(0x1a6)+(_0x1f11bd??_0x5b4f5d(0x16e))+_0x5b4f5d(0x155)+(_0x1e721d??'unbounded')),!_0x4acbcf)throw _0x38983c(_0x5b4f5d(0x1ee)),new Error(_0x5b4f5d(0x121));_0x460232(),_0x4acbcf[_0x5b4f5d(0x149)](_0x1e721d);let _0x184f3d=typeof _0x1e721d==_0x5b4f5d(0x19d)&&_0x1e721d>0x0?_0x1e721d:0x0,_0x3860ff=q(_0x1f11bd,_0x4acbcf[_0x5b4f5d(0x1f6)]()),_0x3ecfa4=_0x3860ff?_0x4acbcf[_0x5b4f5d(0x1ae)](_0x3860ff):[],_0x4f0b26=_0x3ecfa4[_0x5b4f5d(0x143)],_0x469836=_0x3860ff?_0x4acbcf[_0x5b4f5d(0x1f5)](_0x3860ff)[_0x5b4f5d(0x143)]:0x0;_0x5c67a1=_0x50f497(_0x3ecfa4),_0x4a79dc('[handleSend]\x20Calling\x20agent.sendMessage()...');let _0x1c774c=Date['now'](),_0x335718=_0x4acbcf,{response:_0x43dd07,blankTurnRetries:_0x6e4758}=await ye(_0x4c67a2,_0x1f11bd??void 0x0,{'send':(_0x453c83,_0x1e17f7)=>_0x335718[_0x5b4f5d(0x16f)](_0x453c83,_0x1e17f7),'getSessionId':()=>_0x335718['getSessionId']()??void 0x0,'log':_0x38983c}),_0x203ae1=Date['now']()-_0x1c774c,_0x50f459=_0x4acbcf['getSessionId']();_0x4a79dc('[handleSend]\x20agent.sendMessage()\x20completed\x20in\x20'+_0x203ae1+'ms'),_0x4a79dc(_0x5b4f5d(0x15b)+(_0x43dd07?.[_0x5b4f5d(0x143)]??0x0)+'\x20chars,\x20sessionId='+_0x50f459),_0x4a79dc('[handleSend]\x20Response\x20preview:\x20\x22'+_0xaeb296(_0x43dd07??'')+'\x22');let _0x3dab87=_0x50f459?_0x4acbcf[_0x5b4f5d(0x1ae)](_0x50f459):[],_0x5f2637=G(_0x3860ff,_0x4f0b26,_0x50f459,_0x3dab87),_0x1d12d9=_0x2590d7(_0x5f2637),_0x7f2941=_0x50f459?_0x4acbcf['getTurnUsageHistory'](_0x50f459):[],_0x411e35=G(_0x3860ff,_0x469836,_0x50f459,_0x7f2941),_0x38402f=ue(_0x411e35),_0x2a6a92=_0x411e35[_0x5b4f5d(0x143)]>0x0?_0x411e35[_0x5b4f5d(0x143)]:_0x50f497(_0x5f2637),_0x23c8b0=_0x184f3d>0x0&&_0x2a6a92>=_0x184f3d;if(_0x1d12d9){let _0x4a7d40=_0x384d76(_0x1d12d9);_0x38983c('[handleSend]\x20Actionable\x20error\x20detected\x20this\x20turn:\x20'+_0x4a7d40),_0xf5175({'type':_0x5b4f5d(0xee),'message':_0x5b4f5d(0x1d1)+_0x4a7d40}),_0x4a79dc(_0x5b4f5d(0x115));return;}_0xf5175({'type':'result','response':_0x43dd07,'sessionId':_0x50f459,'durationMs':_0x203ae1,'assistantStepCount':_0x2a6a92,'maxStepsReached':_0x23c8b0,'usage':_0x38402f,..._0x411e35[_0x5b4f5d(0x143)]>0x0?{'turnUsages':_0x411e35['map'](F)}:{},..._0x6e4758>0x0?{'blankTurnRetries':_0x6e4758}:{},'model':_0x2ba759}),_0x4a79dc(_0x5b4f5d(0x165)+_0x2a6a92+',\x20maxStepsReached='+_0x23c8b0+',\x20usage='+(_0x38402f?_0x38402f['input_tokens']+'/'+_0x38402f[_0x5b4f5d(0x11c)]:'none')+_0x5b4f5d(0x136)+_0x411e35[_0x5b4f5d(0x143)]+_0x5b4f5d(0x1ac)+_0x6e4758+')');}async function _0x299a4e(){const _0x2d1840=_0x35572f;if(_0x4a79dc('[handleDestroy]\x20Called'),_0x54302b(),_0x4ff4f6){_0x4a79dc('[handleDestroy]\x20Unsubscribing\x20from\x20events...');try{_0x4ff4f6(),_0x4a79dc(_0x2d1840(0x17a));}catch(_0x83bf6b){_0x38983c('[handleDestroy]\x20unsubscribeEvents\x20failed:\x20'+_0x83bf6b);}_0x4ff4f6=null;}else _0x4a79dc(_0x2d1840(0x1cb));if(_0x4acbcf){_0x4a79dc(_0x2d1840(0x11f));try{await _0x4acbcf[_0x2d1840(0x140)](),_0x4a79dc(_0x2d1840(0x208));}catch(_0x105563){_0x38983c(_0x2d1840(0x14b)+_0x105563);}_0x4acbcf=null,_0x2a3064[_0x2d1840(0x1f3)]();}else _0x4a79dc('[handleDestroy]\x20No\x20agent\x20to\x20destroy');_0x2ba759=void 0x0,_0x5c67a1=0x0,_0xf5175({'type':'destroyed'}),_0x4a79dc('[handleDestroy]\x20destroyed\x20message\x20sent');}async function _0xdf44d4(_0x3018e2){const _0x1fc09d=_0x35572f;let _0x8147aa=_0x3018e2['trim']();if(!_0x8147aa)return _0x4a79dc('[dispatch]\x20Received\x20empty\x20line,\x20skipping'),!0x1;_0x4a79dc(_0x1fc09d(0x1b7)+_0x8147aa[_0x1fc09d(0x143)]+'\x20chars):\x20'+_0xaeb296(_0x8147aa));let _0x3c621e;try{_0x3c621e=JSON['parse'](_0x8147aa);}catch(_0x4333db){return _0x38983c(_0x1fc09d(0x1c6)+_0x4333db),_0xf5175(_0x37370b(_0x1fc09d(0x13d)+_0x4333db)),!0x1;}_0x4a79dc('[dispatch]\x20Parsed\x20command:\x20cmd='+_0x3c621e[_0x1fc09d(0xff)]+_0x1fc09d(0x1bd)+!!_0x3c621e[_0x1fc09d(0x178)]+_0x1fc09d(0x1d4)+!!_0x3c621e['prompt']+',\x20sessionId='+(_0x3c621e[_0x1fc09d(0x200)]??_0x1fc09d(0x16e)));try{switch(_0x3c621e[_0x1fc09d(0xff)]){case'init':return _0x4a79dc(_0x1fc09d(0x1fa)),await _0x1289e0(_0x3c621e[_0x1fc09d(0x178)]??{}),_0x4a79dc(_0x1fc09d(0x172)),!0x1;case'send':if(typeof _0x3c621e[_0x1fc09d(0x1a0)]!=_0x1fc09d(0xef))throw _0x38983c(_0x1fc09d(0x10a)+typeof _0x3c621e['prompt']),new Error(_0x1fc09d(0x150));return _0x4a79dc(_0x1fc09d(0x180)),await _0x11b09f(_0x3c621e[_0x1fc09d(0x1a0)],_0x3c621e[_0x1fc09d(0x200)]??null,_0x3c621e[_0x1fc09d(0x20f)]),_0x4a79dc(_0x1fc09d(0x110)),!0x1;case _0x1fc09d(0x140):return _0x4a79dc(_0x1fc09d(0x1bc)),await _0x299a4e(),_0x4a79dc(_0x1fc09d(0x1aa)),!0x0;default:throw _0x38983c(_0x1fc09d(0x1fb)+_0x3c621e['cmd']),new Error(_0x1fc09d(0x138)+_0x3c621e['cmd']);}}catch(_0x3f350a){return _0x38983c(_0x1fc09d(0x182)+_0x3c621e['cmd']+_0x1fc09d(0x130)+(_0x3f350a instanceof Error?_0x3f350a[_0x1fc09d(0x1f9)]:String(_0x3f350a))),_0x3f350a instanceof Error&&_0x3f350a[_0x1fc09d(0x100)]&&_0x38983c(_0x1fc09d(0x133)+_0x3f350a[_0x1fc09d(0x100)]),_0xf5175(_0x37370b(_0x3f350a)),!0x1;}}async function _0x242591(){const _0x467aed=_0x35572f;_0x38983c(_0x467aed(0x170)+process[_0x467aed(0x204)]+',\x20pid='+process[_0x467aed(0x1cd)]+_0x467aed(0x1cf)+_0x490d1d+')'),_0x4a79dc('[main]\x20platform='+process[_0x467aed(0x15f)]+_0x467aed(0x205)+process[_0x467aed(0x14a)]+_0x467aed(0x1a5)+process['cwd']()),_0x4a79dc(_0x467aed(0x1ca)+(process.env.BACKEND_URL??_0x467aed(0x10b))+_0x467aed(0x10f)+(process.env.INTEROP_URL??_0x467aed(0x10b))),_0x4a79dc(_0x467aed(0x1e5)+(process.env.AUTH_TOKEN?_0x467aed(0x17c):_0x467aed(0x10b))+_0x467aed(0x176)+(process.env.TENANT_ID??_0x467aed(0x10b))+_0x467aed(0x102)+(process.env.ORG_ID??_0x467aed(0x10b))+_0x467aed(0x213)+(process.env.USER_ID??_0x467aed(0x10b)));let _0x1d89e7=_0x13d0f9[_0x467aed(0x114)]({'input':process[_0x467aed(0x203)],'terminal':!0x1});_0x4a79dc(_0x467aed(0x1d6));let _0x1cf1b2=Promise[_0x467aed(0x13c)](),_0x1743d4=0x0;_0x1d89e7['on']('line',_0x8a4eda=>{const _0x3e8c88=_0x467aed;_0x1743d4++,_0x4a79dc('[main]\x20stdin\x20line\x20#'+_0x1743d4+_0x3e8c88(0x179)+_0x8a4eda[_0x3e8c88(0x143)]+_0x3e8c88(0xfa)),_0x1cf1b2=_0x1cf1b2[_0x3e8c88(0x108)](async()=>{const _0x200a64=_0x3e8c88;_0x4a79dc(_0x200a64(0x20e)+_0x1743d4+_0x200a64(0x124)),await _0xdf44d4(_0x8a4eda)&&(_0x4a79dc('[main]\x20dispatch\x20returned\x20shouldExit=true,\x20closing\x20readline'),_0x1d89e7[_0x200a64(0x10c)]());});}),_0x1d89e7['on']('close',()=>{const _0x44b1e8=_0x467aed;_0x4a79dc('[main]\x20readline\x20closed,\x20draining\x20pending\x20commands\x20and\x20exiting...'),_0x1cf1b2[_0x44b1e8(0x142)](()=>{const _0x138a08=_0x44b1e8;_0x4a79dc(_0x138a08(0xf3)),process[_0x138a08(0x12d)](0x0);});}),process['on'](_0x467aed(0x107),_0x37e5b2=>{const _0x3ef6f4=_0x467aed;_0x38983c(_0x3ef6f4(0x160)+(_0x37e5b2[_0x3ef6f4(0x100)]??_0x37e5b2)),_0xf5175(_0x37370b(_0x37e5b2)),process[_0x3ef6f4(0x12d)](0x1);}),process['on'](_0x467aed(0x144),_0x3c35de=>{const _0x15b36a=_0x467aed;_0x38983c(_0x15b36a(0x104)+String(_0x3c35de)),_0xf5175(_0x37370b(_0x3c35de)),process[_0x15b36a(0x12d)](0x1);}),_0x4a79dc('[main]\x20Event\x20handlers\x20registered,\x20host\x20is\x20ready');}_0x4a79dc('[bootstrap]\x20Calling\x20main()...'),_0x242591()['catch'](_0x510b6d=>{const _0x518aa3=_0x35572f;_0x38983c(_0x518aa3(0x1f4)+(_0x510b6d[_0x518aa3(0x100)]??_0x510b6d)),process[_0x518aa3(0x12d)](0x1);});});export default Nn();function _0x1bfa(){const _0x3d788b=['logging','parse',',\x20keys=','toUpperCase','[handleSend]\x20Response\x20length:\x20','high',',\x20logging=',',\x20orgId=','platform','[main]\x20uncaughtException:\x20','REQUEST','map',',\x20hasRefreshToken=','stdout','[handleSend]\x20result\x20written\x20to\x20stdout\x20(steps=','promptTokens','workingDirectory','[token-refresh]\x20A\x20renewable\x20grant\x20exists\x20in\x20','none','verbose',',\x20tenantId\x20set=','enableConnections','readFileSync','null','sendMessage','[main]\x20Host\x20starting\x20(Node\x20','[handleInit]\x20Calling\x20agent.initialize()\x20with\x20config:\x20backendUrl=','[dispatch]\x20handleInit\x20completed','\x20returned\x20HTTP\x20',',\x20ORG_LOGICAL_NAME=','max',',\x20TENANT_ID=','\x20—\x20not\x20one\x20of\x20','options','\x20received\x20(','[handleDestroy]\x20Events\x20unsubscribed\x20successfully','\x20on\x20the\x20same\x20session','SET','[handleSend]\x20Called\x20with\x20prompt=\x22','backendUrl','[handleInit]\x20ERROR:\x20No\x20auth\x20resolved','[dispatch]\x20Dispatching\x20to\x20handleSend...','effort','[dispatch]\x20ERROR:\x20Command\x20\x27',',\x20bundledSkillsPath=','origin','from','ms;\x20rolling\x20back\x20partial\x20state:\x20','enableSkills','reduce','23992shbGks','request','\x20->\x20','oauth-refresh','details','242085stMxcl','push','true',',\x20enableComputerUse=','alpha','[handleInit]\x20Called\x20with\x20options:\x20','\x22\x20requires\x20org/tenant\x20slugs.\x20Set\x20ORG_LOGICAL_NAME\x20and\x20TENANT_NAME\x20env\x20vars,\x20or\x20run\x20`delegate-cli\x20login\x20--env\x20','Token\x20endpoint\x20','[resolveAuth]\x20Starting\x20auth\x20resolution...','input_tokens','[handleInit]\x20Subscribing\x20to\x20agent\x20events...','stringify',']\x20Inherited\x20token\x20has\x20','type','s\x20remaining\x20(<','number','cache_read_input_tokens','Unknown\x20backend\x20error\x20(no\x20details\x20in\x20actionable_error\x20message)','prompt','<no\x20response\x20body>','event','[token-refresh]\x20No\x20','init_ok',',\x20CWD=','\x20chars),\x20sessionId=','cache_creation_input_tokens','18Paixff','orgLogicalName','[dispatch]\x20handleDestroy\x20completed,\x20will\x20exit','updateConfig',',\x20blankTurnRetries=','1917288hXFUNM','getSessionMessages','509949ebGizr','config','https://alpha.uipath.com','data','auto-spawn\x20(bundled\x20runtime)','byteLength','DELEGATE_AUTH_TOKEN_FILE','shellPathPrepend','[dispatch]\x20Received\x20line\x20(','[writeLine]\x20>>>\x20',')\x20failed:\x20',']\x20agent.updateToken()\x20threw:\x20','toolName','[dispatch]\x20Dispatching\x20to\x20handleDestroy...',',\x20hasOptions=','exports','filter','inherit-default','interopUrl','[handleInit]\x20Auth\x20resolved\x20successfully','POST','response','\x20—\x20shell\x20tools\x20still\x20default\x20there\x20via\x20the\x20SDK','[dispatch]\x20ERROR:\x20Failed\x20to\x20parse\x20JSON:\x20','xhigh','[handleInit]\x20Request\x20headers\x20prepared:\x20X-UiPath-Internal-*\x20(orgId\x20set=','tenantName','[main]\x20Env:\x20BACKEND_URL=','[handleDestroy]\x20No\x20event\x20subscription\x20to\x20clean\x20up','organizationId','pid','statusCode',',\x20debug=','end','Delegate\x20backend\x20error:\x20','widget',']\x20Fresh\x20token\x20applied\x20via\x20agent.updateToken()\x20+\x20process.env.AUTH_TOKEN',',\x20hasPrompt=','slice','[main]\x20readline\x20interface\x20created,\x20waiting\x20for\x20commands\x20on\x20stdin...','tokenUrl','Your\x20previous\x20reply\x20was\x20empty.\x20Continue\x20the\x20task\x20from\x20where\x20you\x20left\x20off\x20and\x20complete\x20it.','[delegate-stdio]\x20',',\x20no\x20LLMGW_CLIENT_ID/LLMGW_CLIENT_SECRET/LLMGW_URL,\x20and\x20no\x20renewable\x20grant\x20in\x20','now',',\x20userId\x20set=','toLowerCase','NOT\x20SET','join','label','s2s-refresh','[handleInit]\x20agent.initialize()\x20threw\x20after\x20','content','toString','[main]\x20Env:\x20AUTH_TOKEN=','https://staging.uipath.com',',\x20baseUrl=','/delegate_','\x20(forwarded\x20as\x20user_config.effort\x20on\x20every\x20chat\x20request)','tool_result','https://cloud.uipath.com','existsSync','3020100tSnZbX','[handleSend]\x20ERROR:\x20Agent\x20not\x20initialized','\x20—\x20proactive\x20refresh\x20disabled','Read','\x20retries;\x20returning\x20the\x20apology\x20so\x20the\x20turn\x20is\x20graded\x20on\x20its\x20partial\x20work','Skill','detach','[bootstrap]\x20main()\x20failed:\x20','getTurnUsageHistory','getSessionId','Write','[token-refresh]\x20A\x20token\x20file\x20and\x20LLMGW_*\x20S2S\x20creds\x20are\x20both\x20configured;\x20the\x20token\x20file\x20wins','message','[dispatch]\x20Dispatching\x20to\x20handleInit...','[dispatch]\x20ERROR:\x20Unknown\x20command:\x20','\x22\x20—\x20disabling\x20S2S\x20refresh','clientId','isArray','[handleInit]\x20unsubscribeEvents\x20failed\x20during\x20rollback:\x20','sessionId','url','1305128hrZvpN','stdin','version',',\x20arch=','statSync','1730CsuduS','[handleDestroy]\x20Agent\x20destroyed\x20successfully','trim','delimiter','split','floor','includes','[main]\x20Processing\x20line\x20#','maxSteps','tenantId',']\x20type=','accessToken',',\x20USER_ID=','file-refresh','s);\x20fetching\x20a\x20fresh\x20one\x20before\x20init','Agent\x20already\x20initialized','Auth\x20required:\x20set\x20AUTH_TOKEN/TENANT_ID/ORG_ID\x20env\x20vars\x20or\x20run\x20`delegate-cli\x20login\x20--env\x20','reverse','http:','[resolveAuth]\x20Env\x20vars:\x20AUTH_TOKEN=','env','agent_thought',',\x20enableSkills=','initialize','write','model','s;\x20next\x20refresh\x20in\x20','273zoiRWT','[handleInit]\x20Resolving\x20auth...','next','expiresAt','[blank-turn]\x20backend\x20returned\x20a\x20blank-completion\x20apology;\x20retrying\x20','[handleInit]\x20Shell\x20PATH\x20prepend:\x20','off','object','[handleInit]\x20Event\x20subscription\x20active','I\x20apologize,\x20but\x20I\x20didn\x27t\x20receive\x20a\x20complete\x20response.\x20Please\x20try\x20again.','\x27\x20->\x20\x27','error','string','\x20more\x20chars)',',\x20agentName=','[blank-turn]\x20still\x20blank\x20after\x20','[main]\x20All\x20commands\x20drained,\x20exiting\x20with\x20code\x200','\x20holds\x20a\x20fresher\x20token\x20than\x20the\x20inherited\x20one;\x20using\x20it\x20for\x20init','bundledSkillsPath','[handleInit]\x20Working\x20directory:\x20','[resolveAuth]\x20No\x20auth\x20available\x20(env\x20vars\x20and\x20saved\x20auth\x20both\x20failed)','userId','[resolveAuth]\x20Using\x20env\x20var\x20auth','\x20chars)','[resolveAuth]\x20Env\x20vars\x20incomplete,\x20trying\x20loadAndRefreshAuth()...','[handleInit]\x20process.chdir(','tool_call','[normalizeModelId]\x20Rewriting\x20model\x20\x27','cmd','stack','pending',',\x20ORG_ID=','info','[main]\x20unhandledRejection:\x20','http://localhost:5002','refreshToken','uncaughtException','then','[handleInit]\x20init_ok\x20sent\x20to\x20stdout','[dispatch]\x20ERROR:\x20send\x20prompt\x20is\x20not\x20a\x20string,\x20got\x20','not\x20set','close','has','updateToken',',\x20INTEROP_URL=','[dispatch]\x20handleSend\x20completed',',\x20orgLogicalName=','keys',',\x20interopUrl=','createInterface','[handleSend]\x20error\x20written\x20to\x20stdout','stderr','projectId',',\x20model=','low','X-UiPath-Use-Llm-Gateway-For-Fireworks','Token\x20endpoint\x20returned\x20non-JSON:\x20','output_tokens','fromSavedAuth','protocol','[handleDestroy]\x20Destroying\x20agent...','default','Agent\x20not\x20initialized;\x20send\x20`init`\x20first.',',\x20TENANT_NAME=','[handleInit]\x20Creating\x20DelegateAgent\x20instance...','...','baseURL','[resolveAuth]\x20Loaded\x20saved\x20auth:\x20tenantId=','hasRefreshToken','\x20(process.chdir\x20applied)','/identity_/connect/token',']\x20Token\x20has\x20no\x20decodable\x20exp\x20—\x20skipping\x20schedule','description','sync','exit','followUpsRenderer','agentName','\x27\x20threw:\x20','completionTokens','UIPATH_ACCESS_TOKEN=','[dispatch]\x20Stack:\x20','[handleInit]\x20Ignoring\x20effort=','endsWith',',\x20turnUsages=','provider','Unknown\x20cmd:\x20','access_token',',\x20enableConnections=','399FpLOKs','resolve','Invalid\x20JSON\x20command:\x20','baseUrl','enableComputerUse','destroy','[resolveBackendUrl]\x20env=','finally','length','unhandledRejection','attach','Edit','exp','find','setMaxSteps','arch','[handleDestroy]\x20agent.destroy()\x20failed:\x20','actionable_error','rawMessage',',\x20tenantName=','backendUrlOption','send:\x20`prompt`\x20must\x20be\x20a\x20string','meta','`\x20(writes\x20~/.aria/sdk-auth.json).','envOption','[handleInit]\x20agent.destroy()\x20failed\x20during\x20rollback:\x20',',\x20maxSteps=','false'];_0x1bfa=function(){return _0x3d788b;};return _0x1bfa();}
2
+ const _0x2e478b=_0x328e;(function(_0x2144f7,_0x21134c){const _0x5a7666=_0x328e,_0x48864b=_0x2144f7();while(!![]){try{const _0x40ffc8=-parseInt(_0x5a7666(0x15b))/0x1+-parseInt(_0x5a7666(0x257))/0x2*(parseInt(_0x5a7666(0x1a0))/0x3)+-parseInt(_0x5a7666(0x249))/0x4*(-parseInt(_0x5a7666(0x1ba))/0x5)+-parseInt(_0x5a7666(0x2bc))/0x6+parseInt(_0x5a7666(0x293))/0x7*(parseInt(_0x5a7666(0x274))/0x8)+parseInt(_0x5a7666(0x29f))/0x9+parseInt(_0x5a7666(0x193))/0xa*(parseInt(_0x5a7666(0x2ac))/0xb);if(_0x40ffc8===_0x21134c)break;else _0x48864b['push'](_0x48864b['shift']());}catch(_0x226c21){_0x48864b['push'](_0x48864b['shift']());}}}(_0x4a1c,0x1af73));var p=(_0x1e7891,_0x3281d0)=>()=>(_0x1e7891&&(_0x3281d0=_0x1e7891(_0x1e7891=0x0)),_0x3281d0),He=(_0x2f9fb9,_0x501314)=>()=>(_0x501314||_0x2f9fb9((_0x501314={'exports':{}})[_0x2e478b(0x264)],_0x501314),_0x501314[_0x2e478b(0x264)]);function ne(_0xc29e63,_0xd32440){return _0xc29e63??_0xd32440;}function te(_0x44e9a0,_0x3c8800,_0x602c8b,_0x1e566d){const _0x328a5d=_0x2e478b;return _0x602c8b===_0x44e9a0?_0x1e566d[_0x328a5d(0x1d5)](_0x3c8800):_0x1e566d[_0x328a5d(0x1d5)]();}function _0x328e(_0x2d747b,_0x5d37b8){_0x2d747b=_0x2d747b-0x15a;const _0x4a1c6a=_0x4a1c();let _0x328ea0=_0x4a1c6a[_0x2d747b];return _0x328ea0;}var re=p(()=>{});function se(_0x237256){const _0x3266bf=_0x2e478b;return typeof _0x237256!=_0x3266bf(0x1c7)?null:oe[_0x3266bf(0x268)](_0x237256)?_0x237256:null;}function ie(){return oe['join'](',\x20');}var oe,ae=p(()=>{const _0x35863f=_0x2e478b;oe=['low','medium',_0x35863f(0x20b),'xhigh',_0x35863f(0x246)];});function le(_0x83ab1a){const _0x1118a8=_0x2e478b;return{..._0x83ab1a[_0x1118a8(0x1d4)]?{'projectId':_0x83ab1a[_0x1118a8(0x1d4)]}:{},..._0x83ab1a['sessionId']?{'sessionId':_0x83ab1a[_0x1118a8(0x25c)]}:{}};}var ce=p(()=>{});function de(_0x2f2c99){const _0x432507=_0x2e478b;return{'enableMemory':_0x2f2c99[_0x432507(0x2ba)]??!0x1,'validateModel':_0x2f2c99[_0x432507(0x23e)]??!0x1};}function ue(_0x3a64df){const _0xdb5874=_0x2e478b;return _0x3a64df[_0xdb5874(0x1a1)]!==_0xdb5874(0x1df);}var ge=p(()=>{});import*as _0x2fdd38 from'fs';function he(_0x26810a){const _0x4a3018=_0x2e478b;if(!Array[_0x4a3018(0x253)](_0x26810a))return[];let _0x16b1e1=[];for(let _0x42164d of _0x26810a){if(typeof _0x42164d!='string')continue;let _0x4be4ad=_0x42164d[_0x4a3018(0x22f)]();_0x4be4ad[_0x4a3018(0x19c)]>0x0&&_0x16b1e1['push'](_0x4be4ad);}return _0x16b1e1;}function pe(_0x1d7901){const _0x2e2b70=_0x2e478b;try{return _0x2fdd38['statSync'](_0x1d7901)[_0x2e2b70(0x2c1)]();}catch{return!0x1;}}var me=p(()=>{});function ke(_0x1d224c){const _0x4c9278=_0x2e478b;if(_0x1d224c===void 0x0)return{};let _0x18803b=_0x1d224c[_0x4c9278(0x22f)]()[_0x4c9278(0x1a9)]();return Ke[_0x4c9278(0x180)](_0x18803b)?{[v]:_0x4c9278(0x221)}:Be[_0x4c9278(0x180)](_0x18803b)?{[v]:'false'}:{};}var v,Ke,Be,Te=p(()=>{const _0x33ffb4=_0x2e478b;v=_0x33ffb4(0x2b4),Ke=new Set([_0x33ffb4(0x221),'1','yes','on']),Be=new Set([_0x33ffb4(0x298),'0','no',_0x33ffb4(0x260)]);});function H(_0x49ef26){const _0x2757c0=_0x2e478b;if(typeof _0x49ef26!='object'||_0x49ef26===null)return{};let _0x282966=_0x49ef26,_0x4ebbb4={};for(let _0x57cd7f of Se){let _0x24be87=_0x282966[_0x57cd7f];typeof _0x24be87=='string'&&_0x24be87[_0x2757c0(0x22f)]()!==''&&(_0x4ebbb4[_0x57cd7f]=_0x24be87[_0x2757c0(0x22f)]());}return _0x4ebbb4;}function je(_0x5291c8){const _0x39a6fd=_0x2e478b;if(typeof _0x5291c8!='object'||_0x5291c8===null)return _0x5291c8;let {options:_0x1e8bc6}=_0x5291c8;return typeof _0x1e8bc6!=_0x39a6fd(0x188)||_0x1e8bc6===null||!(_0x39a6fd(0x2a7)in _0x1e8bc6)?_0x5291c8:{..._0x5291c8,'options':{..._0x1e8bc6,'auth':Object[_0x39a6fd(0x2bb)](H(_0x1e8bc6[_0x39a6fd(0x2a7)]))}};}function Ee(_0x341df3){const _0x412f32=_0x2e478b;try{let _0x2148a5=JSON[_0x412f32(0x2ad)](_0x341df3);return{'command':_0x2148a5,'logText':JSON['stringify'](je(_0x2148a5))};}catch(_0x49139d){return{'error':_0x49139d,'logText':_0x412f32(0x229)};}}function Ie(_0xc320ad,_0x2b70a0){let _0x1599e6={};for(let _0xb6c6c0 of Se){let _0x3724d2=_0xc320ad[_0xb6c6c0]??_0x2b70a0[ye[_0xb6c6c0]];_0x3724d2!==void 0x0&&(_0x1599e6[_0xb6c6c0]=_0x3724d2);}return _0x1599e6;}var ye,Se,be=p(()=>{const _0x1317be=_0x2e478b;ye={'accessToken':_0x1317be(0x1ee),'tenantId':'TENANT_ID','organizationId':_0x1317be(0x21b),'userId':_0x1317be(0x168),'orgLogicalName':_0x1317be(0x247),'tenantName':'TENANT_NAME'},Se=Object[_0x1317be(0x2bb)](ye);});function L(_0x35b547){const _0x525aa9=_0x2e478b;let _0x4ea034=_0x35b547[_0x525aa9(0x189)]??0x0,_0x913fca=_0x35b547[_0x525aa9(0x195)]??0x0,_0x4c0ae8=_0x35b547[_0x525aa9(0x203)]??0x0;return{'input_tokens':Math[_0x525aa9(0x246)](0x0,_0x4ea034-_0x913fca-_0x4c0ae8),'output_tokens':_0x35b547[_0x525aa9(0x167)]??0x0,'cache_creation_input_tokens':_0x4c0ae8,'cache_read_input_tokens':_0x913fca};}function _0x4a1c(){const _0x16bc0b=[']\x20No\x20fresher\x20token\x20from\x20','28RcJhhI','backendUrl','detach','statusCode','\x20—\x20not\x20one\x20of\x20','reduce','tenantId','stringify','next','finally','isArray','write',',\x20bundledSkillsPath=','\x22\x20(','3290BsymeA','backendUrlOption','reverse','[handleInit]\x20agent.initialize()\x20threw\x20after\x20','<no\x20response\x20body>','sessionId','\x20(forwarded\x20as\x20user_config.effort\x20on\x20every\x20chat\x20request)','[token-refresh]\x20A\x20token\x20file\x20and\x20LLMGW_*\x20S2S\x20creds\x20are\x20both\x20configured;\x20the\x20token\x20file\x20wins','exp','off','SET','options','join','exports',',\x20usage=',',\x20hasOptions=','existsSync','includes','usage','protocol','uncaughtException','Read','\x20->\x20',',\x20CWD=','[handleSend]\x20ERROR:\x20Agent\x20not\x20initialized','[dispatch]\x20Received\x20line\x20(','[handleInit]\x20Creating\x20DelegateAgent\x20instance...',',\x20maxStepsReached=','getSessionMessages','80992rwDhMi','[blank-turn]\x20backend\x20returned\x20a\x20blank-completion\x20apology;\x20retrying\x20','shellPathPrepend','stdin','[handleInit]\x20Working\x20directory:\x20','[handleDestroy]\x20unsubscribeEvents\x20failed:\x20','[handleDestroy]\x20No\x20agent\x20to\x20destroy','content','.\x20Model\x20recommended\x20default\x20applies.','peek','\x20—\x20proactive\x20refresh\x20disabled','clientSecret','[resolveAuth]\x20Init\x20auth\x20option\x20fields:\x20','[handleInit]\x20Ignoring\x20effort=','effort','Write','s;\x20next\x20refresh\x20in\x20','toUpperCase','organizationId','cache_creation_input_tokens','endsWith','[main]\x20Processing\x20line\x20#',',\x20tenantName=','application/x-www-form-urlencoded','[resolveBackendUrl]\x20env=','\x27\x20threw:\x20','[handleInit]\x20Ignoring\x20shellPathPrepend\x20entry\x20','provider','\x20chars),\x20sessionId=','\x20—\x20shell\x20tools\x20still\x20default\x20there\x20via\x20the\x20SDK','https://staging.uipath.com','63lubOok','...','POST','url','\x20chars)','false','version','accessToken','maxSteps','\x22.\x20Use\x20one\x20of:\x20',',\x20enableSkills=','onEvent','1792206bsSNdM','replace','exit','logging',']\x20agent.updateToken()\x20threw:\x20','[main]\x20dispatch\x20returned\x20shouldExit=true,\x20closing\x20readline','Token\x20endpoint\x20','[handleSend]\x20Actionable\x20error\x20detected\x20this\x20turn:\x20','auth','actionableError',',\x20logging=','https://cloud.uipath.com','[delegate-stdio]\x20','237457yTVIqK','parse',',\x20turnUsages=','clientId','auto-spawn\x20(bundled\x20runtime)','Auth\x20required:\x20pass\x20`auth`\x20(accessToken/tenantId/organizationId)\x20in\x20the\x20init\x20options,\x20set\x20AUTH_TOKEN/TENANT_ID/ORG_ID\x20env\x20vars,\x20or\x20run\x20`delegate-cli\x20login\x20--env\x20','baseURL','attach','X-UiPath-Use-Llm-Gateway-For-Fireworks','getTurnUsageHistory','[main]\x20readline\x20closed,\x20draining\x20pending\x20commands\x20and\x20exiting...','chdir','Token\x20endpoint\x20returned\x20non-JSON:\x20','command','enableMemory','keys','1073310rOklon','Bash','[token-refresh]\x20A\x20renewable\x20grant\x20exists\x20in\x20','orgLogicalName',',\x20sessionId=','isDirectory','stack','\x27\x20->\x20\x27','116096knyqEW','[handleSend]\x20Response\x20length:\x20','[main]\x20platform=','createInterface',',\x20keys=','error','message','widget','enableComputerUse','[resolveAuth]\x20Starting\x20auth\x20resolution...','map','base64','completionTokens','USER_ID','Delegate\x20backend\x20error:\x20','[handleDestroy]\x20destroyed\x20message\x20sent','[dispatch]\x20Dispatching\x20to\x20handleInit...','[handleDestroy]\x20Events\x20unsubscribed\x20successfully','\x22\x20—\x20disabling\x20S2S\x20refresh',',\x20model=','tool_call','s\x20remaining\x20(<','config','init','\x20yet;\x20retrying\x20in\x20','[resolveAuth]\x20No\x20auth\x20available\x20(init\x20option,\x20env\x20vars\x20and\x20saved\x20auth\x20all\x20failed)','workingDirectory','response','Agent\x20not\x20initialized;\x20send\x20`init`\x20first.',',\x20userId\x20set=','\x20received\x20(','stderr','send:\x20`prompt`\x20must\x20be\x20a\x20string','sync','delimiter','sendMessage','[writeLine]\x20>>>\x20','has','[main]\x20Env:\x20AUTH_TOKEN=','[handleSend]\x20Calling\x20agent.sendMessage()...',',\x20USER_ID=','[handleSend]\x20agent.sendMessage()\x20completed\x20in\x20','http://localhost:5002','logText','model','object','promptTokens','updateConfig','access_token','\x20—\x20directory\x20does\x20not\x20exist','utf-8',')\x20failed:\x20','[resolveAuth]\x20Using\x20init-option\x20/\x20env\x20var\x20auth','initialize','[handleDestroy]\x20Called','Your\x20previous\x20reply\x20was\x20empty.\x20Continue\x20the\x20task\x20from\x20where\x20you\x20left\x20off\x20and\x20complete\x20it.','30mDEAcs','[main]\x20readline\x20interface\x20created,\x20waiting\x20for\x20commands\x20on\x20stdin...','promptTokensCached',',\x20validateModel=',',\x20organizationId=','[normalizeModelId]\x20Rewriting\x20model\x20\x27','[oauth-refresh]\x20','[handleSend]\x20result\x20written\x20to\x20stdout\x20(steps=','enableSkills','length','getSessionId','destroy',',\x20agentName=','198MzRZXd','type',',\x20enableConnections=','baseUrl','[s2s-refresh]\x20Mint\x20failed:\x20','[handleDestroy]\x20No\x20event\x20subscription\x20to\x20clean\x20up','send','[handleInit]\x20Effort\x20tier:\x20','SET\x20(','toLowerCase','updateToken','\x20now\x20holds\x20a\x20grant\x20for\x20a\x20different\x20identity\x20(org/tenant/client/user\x20changed\x20since\x20init)\x20—\x20ignoring\x20it;\x20this\x20host\x20keeps\x20the\x20login\x20it\x20started\x20with','[dispatch]\x20ERROR:\x20Command\x20\x27','[main]\x20stdin\x20line\x20#','resolve','[main]\x20Host\x20starting\x20(Node\x20','s2s-refresh','[handleInit]\x20Called\x20with\x20options:\x20','split','description','[handleInit]\x20init_ok\x20sent\x20to\x20stdout','init_ok','fromSavedAuth','Unknown\x20cmd:\x20',',\x20tenantId=','[handleSend]\x20Called\x20with\x20prompt=\x22','113565pHxuZb','[token-refresh]\x20Using\x20the\x20saved\x20OAuth\x20grant\x20in\x20','cmd','\x20—\x20not\x20an\x20existing\x20directory','event','[bootstrap]\x20main()\x20failed:\x20','platform','agent_thought','\x20holds\x20a\x20fresher\x20token\x20than\x20the\x20inherited\x20one;\x20using\x20it\x20for\x20init','[handleInit]\x20Subscribing\x20to\x20agent\x20events...','[handleInit]\x20Event\x20subscription\x20active','readFileSync','`\x20so\x20saved\x20auth\x20carries\x20the\x20slugs.','string',',\x20baseUrl=','origin','output_tokens','cache_read_input_tokens','[dispatch]\x20ERROR:\x20Failed\x20to\x20parse\x20JSON:\x20','\x20more\x20chars)','AUTH_TOKEN_FILE','now','[handleDestroy]\x20agent.destroy()\x20failed:\x20',',\x20tenant=',',\x20debug=','[main]\x20uncaughtException:\x20','projectId','slice','env','refreshToken','text','[s2s-refresh]\x20LLMGW_URL\x20is\x20not\x20a\x20valid\x20URL:\x20\x22','null','stdout','toString','expiresAt','[handleInit]\x20ERROR:\x20No\x20auth\x20resolved','turn_start','[resolveAuth]\x20Loaded\x20saved\x20auth:\x20tenantId=','utf8','[event\x20#','result','interopUrl','filter',',\x20userId=','[handleInit]\x20DelegateAgent\x20instance\x20created','startsWith','ms;\x20rolling\x20back\x20partial\x20state:\x20','tokenUrl','/identity_/connect/token','floor','[token-refresh]\x20No\x20','AUTH_TOKEN','destroyed',',\x20but\x20this\x20host\x20authenticated\x20with\x20an\x20explicit\x20AUTH_TOKEN\x20—\x20not\x20refreshing\x20from\x20saved\x20auth\x20(identities\x20may\x20differ)','tenantName','info','label','find',',\x20blankTurnRetries=','tool_result','`\x20(writes\x20~/.aria/sdk-auth.json).','not\x20set','[handleSend]\x20error\x20written\x20to\x20stdout','[dispatch]\x20handleDestroy\x20completed,\x20will\x20exit',',\x20expiresAt=','[handleInit]\x20Ignoring\x20workingDirectory=','[bootstrap]\x20Calling\x20main()...','REQUEST','\x20retries;\x20returning\x20the\x20apology\x20so\x20the\x20turn\x20is\x20graded\x20on\x20its\x20partial\x20work','byteLength','Invalid\x20JSON\x20command:\x20','NOT\x20SET','cacheCreationTokens',',\x20interopUrl=','isFinite','unhandledRejection',',\x20orgLogicalName=','toolName','unbounded',',\x20no\x20LLMGW_CLIENT_ID/LLMGW_CLIENT_SECRET/LLMGW_URL,\x20and\x20no\x20renewable\x20grant\x20in\x20','high',',\x20hasRefreshToken=','[main]\x20unhandledRejection:\x20','end','\x20returned\x20HTTP\x20',',\x20orgId=','aria-autopilot','[handleInit]\x20ERROR:\x20Agent\x20already\x20initialized','default','close','none',',\x20hasPrompt=','\x22\x20requires\x20org/tenant\x20slugs.\x20Set\x20ORG_LOGICAL_NAME\x20and\x20TENANT_NAME\x20env\x20vars,\x20or\x20run\x20`delegate-cli\x20login\x20--env\x20','failed','[handleInit]\x20Calling\x20agent.initialize()\x20with\x20config:\x20backendUrl=','pending','ORG_ID','setMaxSteps',']\x20type=',';\x20resolved:\x20accessToken=','arch','enableConnections','true','verbose','prompt',',\x20ORG_ID=','\x20chars,\x20sessionId=','[main]\x20Env:\x20BACKEND_URL=','[resolveAuth]\x20Init\x20option\x20/\x20env\x20vars\x20incomplete,\x20trying\x20loadAndRefreshAuth()...','rawMessage','not\x20valid\x20JSON,\x20content\x20not\x20logged','Edit','number','[handleInit]\x20Auth\x20resolved\x20successfully','envOption','/delegate_','trim',']\x20Token\x20has\x20no\x20decodable\x20exp\x20—\x20skipping\x20schedule','details','\x20for\x20proactive\x20refresh\x20(pinned\x20to\x20org=','[dispatch]\x20Stack:\x20',',\x20maxSteps=','[blank-turn]\x20still\x20blank\x20after\x20',']\x20Inherited\x20token\x20has\x20','bundledSkillsPath','[dispatch]\x20Parsed\x20command:\x20cmd=','userId','line','agentName',',\x20enableComputerUse=',']\x20Fresh\x20token\x20applied\x20via\x20agent.updateToken()\x20+\x20process.env.AUTH_TOKEN','validateModel','[handleInit]\x20Request\x20headers\x20prepared:\x20X-UiPath-Internal-*\x20(orgId\x20set=','UIPATH_ACCESS_TOKEN=','[main]\x20Event\x20handlers\x20registered,\x20host\x20is\x20ready','[s2s-refresh]\x20IdP\x20response\x20missing\x20access_token','followUpsRenderer','\x20chars):\x20','isAxiosError','max','ORG_LOGICAL_NAME'];_0x4a1c=function(){return _0x16bc0b;};return _0x4a1c();}function Ae(_0x3e4bb9){const _0x57f52d=_0x2e478b;return _0x3e4bb9[_0x57f52d(0x19c)]===0x0?null:_0x3e4bb9[_0x57f52d(0x165)](L)[_0x57f52d(0x24e)]((_0xf69a1e,_0x4145b2)=>({'input_tokens':_0xf69a1e['input_tokens']+_0x4145b2['input_tokens'],'output_tokens':_0xf69a1e[_0x57f52d(0x1ca)]+_0x4145b2['output_tokens'],'cache_creation_input_tokens':_0xf69a1e[_0x57f52d(0x287)]+_0x4145b2[_0x57f52d(0x287)],'cache_read_input_tokens':_0xf69a1e[_0x57f52d(0x1cb)]+_0x4145b2[_0x57f52d(0x1cb)]}));}function _e(_0x2e9597,_0x1de5b9){let _0x48e3ec=0x0;return()=>{const _0x3778d6=_0x328e;let _0x46051f=_0x2e9597();for(;_0x48e3ec<_0x46051f[_0x3778d6(0x19c)];_0x48e3ec++)_0x1de5b9(L(_0x46051f[_0x48e3ec]));};}var ve=p(()=>{});import _0x45e5be from'fs';import _0x188f9a from'node:path';function $e(_0x1bd1f2){const _0x3c6e5e=_0x2e478b;let _0x53544c=_0x1bd1f2[0x0];return _0x1bd1f2[_0x3c6e5e(0x19c)]>=0x2&&(_0x53544c==='\x22'||_0x53544c==='\x27')&&_0x1bd1f2[_0x3c6e5e(0x288)](_0x53544c)?_0x1bd1f2[_0x3c6e5e(0x1d5)](0x1,-0x1)[_0x3c6e5e(0x22f)]():_0x1bd1f2;}function Ve(_0x4f97d9){const _0x4d0563=_0x2e478b;for(let _0x172d39 of _0x4f97d9['split']('\x0a'))if(_0x172d39[_0x4d0563(0x1e8)](we)){let _0xadd7de=$e(_0x172d39[_0x4d0563(0x1d5)](we[_0x4d0563(0x19c)])[_0x4d0563(0x22f)]());if(_0xadd7de)return _0xadd7de;}let _0x4e4acf=$e(_0x4f97d9[_0x4d0563(0x22f)]());return _0x4e4acf&&!_0x4e4acf[_0x4d0563(0x268)]('\x0a')&&!_0x4e4acf['includes']('=')?_0x4e4acf:null;}function w(_0x7e955){const _0x249adc=_0x2e478b;let _0x4d9e18=_0x7e955[_0x249adc(0x1b2)]('.');if(_0x4d9e18[_0x249adc(0x19c)]!==0x3)return null;try{let _0x2aca9d=JSON[_0x249adc(0x2ad)](Buffer['from'](_0x4d9e18[0x1],_0x249adc(0x166))[_0x249adc(0x1dc)]());return typeof _0x2aca9d[_0x249adc(0x25f)]==_0x249adc(0x22b)?_0x2aca9d['exp']:null;}catch{return null;}}function O(_0x47aadb,_0x354646){if(_0x47aadb===_0x354646)return!0x1;let _0x2367d5=w(_0x47aadb),_0x1cc071=w(_0x354646);return _0x2367d5!==null&&_0x1cc071!==null&&_0x2367d5>_0x1cc071;}function Re(_0x3329ab=process.env){const _0x284a33=_0x2e478b;return(_0x3329ab[K]??_0x3329ab[Ye]??'')[_0x284a33(0x1b2)](_0x188f9a[_0x284a33(0x17d)])[_0x284a33(0x165)](_0x173152=>_0x173152['trim']())['filter'](_0x12fe22=>_0x12fe22[_0x284a33(0x19c)]>0x0);}function Ne(_0x46b5d1){const _0x2a9165=_0x2e478b;for(let _0xcc314f of _0x46b5d1){let _0x21b471;try{_0x21b471=_0x45e5be[_0x2a9165(0x1c5)](_0xcc314f,_0x2a9165(0x18d));}catch{continue;}let _0x1675d3=Ve(_0x21b471);if(_0x1675d3)return _0x1675d3;}return null;}var K,Ye,we,xe=p(()=>{const _0x24f639=_0x2e478b;K='DELEGATE_AUTH_TOKEN_FILE',Ye=_0x24f639(0x1ce),we=_0x24f639(0x240);});import _0x106369 from'fs';function qe(_0xae323b){const _0x54bfe4=_0x2e478b;let _0x26192c;try{_0x26192c=JSON['parse'](_0xae323b);}catch{return null;}if(typeof _0x26192c!=_0x54bfe4(0x188)||_0x26192c===null||Array[_0x54bfe4(0x253)](_0x26192c))return null;let _0x515ac3=_0x26192c,_0xa211de=typeof _0x515ac3['accessToken']==_0x54bfe4(0x1c7)?_0x515ac3[_0x54bfe4(0x29a)]:'',_0x1d0ee4=typeof _0x515ac3[_0x54bfe4(0x1d7)]==_0x54bfe4(0x1c7)?_0x515ac3[_0x54bfe4(0x1d7)]['trim']():'',_0x2d80ef=_0x16c487=>typeof _0x16c487==_0x54bfe4(0x1c7)&&_0x16c487[_0x54bfe4(0x19c)]>0x0?_0x16c487:void 0x0;return{'accessToken':_0xa211de,'hasRefreshToken':_0x1d0ee4[_0x54bfe4(0x19c)]>0x0,..._0x2d80ef(_0x515ac3['organizationId'])?{'organizationId':_0x2d80ef(_0x515ac3[_0x54bfe4(0x286)])}:{},..._0x2d80ef(_0x515ac3[_0x54bfe4(0x24f)])?{'tenantId':_0x2d80ef(_0x515ac3['tenantId'])}:{},..._0x2d80ef(_0x515ac3[_0x54bfe4(0x2af)])?{'clientId':_0x2d80ef(_0x515ac3[_0x54bfe4(0x2af)])}:{}};}function Qe(_0xbf31fa){const _0x42e2d4=_0x2e478b;try{return qe(_0x106369[_0x42e2d4(0x1c5)](_0xbf31fa,_0x42e2d4(0x1e1)));}catch{return null;}}function B(_0x7081e6){return Qe(_0x7081e6)?.['hasRefreshToken']??!0x1;}function Ue(_0x54b2bf,_0x255fad){return _0x54b2bf&&B(_0x255fad);}function Ze(_0x45dd35){const _0x54dfab=_0x2e478b;return{'accessToken':_0x45dd35[_0x54dfab(0x29a)],..._0x45dd35['refreshToken']?{'refreshToken':_0x45dd35['refreshToken']}:{},...typeof _0x45dd35['expiresAt']==_0x54dfab(0x22b)?{'expiresAt':_0x45dd35[_0x54dfab(0x1dd)]}:{}};}var D,Le=p(()=>{const _0x4f9e82=_0x2e478b;D=class{[_0x4f9e82(0x28f)]=null;['pending']=null;[_0x4f9e82(0x17c)](_0x40c584){const _0x433d19=_0x4f9e82;let _0x1235cf=Ze(_0x40c584);this['provider']?this['provider'][_0x433d19(0x18a)](_0x1235cf):this[_0x433d19(0x21a)]=_0x1235cf;}[_0x4f9e82(0x2b3)](_0x2f4b0e){const _0x5230e7=_0x4f9e82;this[_0x5230e7(0x28f)]=_0x2f4b0e,this[_0x5230e7(0x21a)]&&(_0x2f4b0e[_0x5230e7(0x18a)](this[_0x5230e7(0x21a)]),this[_0x5230e7(0x21a)]=null);}[_0x4f9e82(0x24b)](){const _0x38baa6=_0x4f9e82;this['provider']=null,this[_0x38baa6(0x21a)]=null;}};});function Oe(_0x415d20){const _0x19d295=_0x2e478b;return(_0x415d20??'')[_0x19d295(0x22f)]()===en;}async function De(_0xb8b542,_0xf7859c,_0x4f3e3b){const _0x5af560=_0x2e478b;let {send:_0x5e8eff,getSessionId:_0x3d3978,log:_0xab4e57,maxRetries:_0x12b435=0x2}=_0x4f3e3b,_0x22cc67=await _0x5e8eff(_0xb8b542,_0xf7859c),_0x6bcb75=0x0;for(;Oe(_0x22cc67['text'])&&_0x6bcb75<_0x12b435;)_0x6bcb75+=0x1,_0xab4e57(_0x5af560(0x275)+_0x6bcb75+'/'+_0x12b435+'\x20on\x20the\x20same\x20session'),_0x22cc67=await _0x5e8eff(nn,_0x3d3978()??_0xf7859c);return Oe(_0x22cc67[_0x5af560(0x1d8)])&&_0xab4e57(_0x5af560(0x235)+_0x12b435+_0x5af560(0x1ff)),{'response':_0x22cc67['text'],'failed':_0x22cc67[_0x5af560(0x218)],'blankTurnRetries':_0x6bcb75};}var en,nn,Ce=p(()=>{const _0x4a2d06=_0x2e478b;en='I\x20apologize,\x20but\x20I\x20didn\x27t\x20receive\x20a\x20complete\x20response.\x20Please\x20try\x20again.',nn=_0x4a2d06(0x192);});import _0x4522cd from'fs';import _0x366827 from'node:path';import _0x397012 from'readline';import _0x30b40e from'http';import _0x52f633 from'https';import{DelegateAgent as _0x26bb84,TokenAuthProvider as _0x132d09,getAuthFilePath as _0x1c679a,grantIdentity as _0x47c57d,isTokenExpired as _0x44c5f7,loadAndRefreshAuth as _0xc6e58e,readSavedAuthRecord as _0x1cdc34,refreshAccessToken as _0x12d269,sameGrantIdentity as _0x3131a2}from'@uipath/delegate-sdk';var Kn=He(()=>{const _0x1b4679=_0x2e478b;re(),ae(),ce(),ge(),me(),Te(),be(),ve(),xe(),Le(),Ce();function _0x116c07(_0x3ef322,_0x71a08,_0x735c4a){return{'X-UiPath-Internal-AccountId':_0x3ef322,'X-UiPath-Internal-TenantId':_0x71a08,..._0x735c4a?{'X-UiPath-Internal-UserId':_0x735c4a}:{}};}var _0xdb8d7c=process.env.DELEGATE_STDIO_VERBOSE==='1'||process.env.DELEGATE_STDIO_VERBOSE===_0x1b4679(0x221),_0x422942=((()=>{const _0xd34c1c=_0x1b4679;let _0x7fab97=process.env.DELEGATE_STDIO_LOG_MAX_CHARS;if(_0x7fab97===void 0x0||_0x7fab97[_0xd34c1c(0x22f)]()==='')return 0xc350;let _0x4f3262=Number(_0x7fab97);return Number[_0xd34c1c(0x205)](_0x4f3262)&&_0x4f3262>=0x0?_0x4f3262:0xc350;})());function _0x49e430(_0x11e21c){const _0x33ab0d=_0x1b4679;return _0x422942>0x0&&_0x11e21c[_0x33ab0d(0x19c)]>_0x422942?_0x11e21c['slice'](0x0,_0x422942)+'…('+(_0x11e21c[_0x33ab0d(0x19c)]-_0x422942)+_0x33ab0d(0x1cd):_0x11e21c;}function _0x47f76c(_0x457dbc){const _0x249cd9=_0x1b4679;let _0x3f218b=JSON[_0x249cd9(0x250)](_0x457dbc);_0x19d29f(_0x249cd9(0x17f)+_0x49e430(_0x3f218b)),process[_0x249cd9(0x1db)][_0x249cd9(0x254)](_0x3f218b+'\x0a');}function _0x37af0b(_0x39dfd0){const _0x25091f=_0x1b4679;process['stderr'][_0x25091f(0x254)]('[delegate-stdio]\x20'+_0x39dfd0+'\x0a');}function _0x19d29f(_0x5bd109){const _0x42dca3=_0x1b4679;_0xdb8d7c&&process[_0x42dca3(0x17a)][_0x42dca3(0x254)](_0x42dca3(0x2ab)+_0x5bd109+'\x0a');}function _0x13e79e(_0x2fe6d0){const _0xce873=_0x1b4679;let _0x498384=_0x2fe6d0 instanceof Error?_0x2fe6d0:new Error(String(_0x2fe6d0)),_0x2a0987=_0x498384[_0xce873(0x161)],_0x2997ea=_0x2fe6d0;if(_0x2997ea?.[_0xce873(0x245)]&&_0x2997ea['response']){let {status:_0x2010ba,statusText:_0x2981ab,data:_0x53f5d6}=_0x2997ea[_0xce873(0x176)],_0x4c7407=_0x2997ea[_0xce873(0x171)]?.['method']?.[_0xce873(0x285)]()??_0xce873(0x1fe),_0x1b6c95=_0x2997ea[_0xce873(0x171)]?.[_0xce873(0x2b2)]?''+_0x2997ea['config'][_0xce873(0x2b2)]+(_0x2997ea[_0xce873(0x171)]?.[_0xce873(0x296)]??''):_0x2997ea['config']?.[_0xce873(0x296)]??'',_0x5a42ac;if(typeof _0x53f5d6==_0xce873(0x1c7))_0x5a42ac=_0x49e430(_0x53f5d6);else{if(_0x53f5d6==null)_0x5a42ac=_0xce873(0x25b);else try{let _0x402a9e=JSON[_0xce873(0x250)](_0x53f5d6);_0x5a42ac=_0x49e430(_0x402a9e);}catch{_0x5a42ac=String(_0x53f5d6);}}_0x2a0987=_0x4c7407+'\x20'+_0x1b6c95+'\x20→\x20'+_0x2010ba+(_0x2981ab?'\x20'+_0x2981ab:'')+':\x20'+_0x5a42ac;}return{'message':_0x2a0987,'stack':_0x498384[_0xce873(0x2c2)]};}function _0x413c0e(_0x2c0417){const _0x25a1fc=_0x1b4679;let {message:_0x100e5a,stack:_0x36be54}=_0x13e79e(_0x2c0417);return{'type':_0x25a1fc(0x160),'message':_0x100e5a,'stack':_0x36be54};}function _0xe71e6a(_0x512b40){const _0x457a94=_0x1b4679;if(!_0x512b40||!_0x512b40[_0x457a94(0x268)]('-'))return _0x512b40;let _0x321f51=_0x512b40[_0x457a94(0x2a0)](/-/g,'_');return _0x37af0b(_0x457a94(0x198)+_0x512b40+_0x457a94(0x15a)+_0x321f51+'\x27'),_0x321f51;}var _0x482d60={'ReadFile':_0x1b4679(0x26c),'WriteFile':_0x1b4679(0x283),'EditFile':_0x1b4679(0x22a),'ExecuteBashCommand':_0x1b4679(0x2bd),'LsDirectory':'LS','ExecuteSkillApi':'Skill'};function _0x488904(_0x585b89){const _0x99502a=_0x1b4679;if(_0x585b89[_0x99502a(0x1a1)]!==_0x99502a(0x161)||!_0x43c644)return _0x585b89;let _0x1724e5=_0x43c644['getSessionId']();if(!_0x1724e5)return _0x585b89;let _0x16a814=_0x43c644[_0x99502a(0x273)](_0x1724e5),_0x3854e4=_0x575468(_0x16a814),_0x181870=_0x3854e4>_0x2f5904;return _0x2f5904=_0x3854e4,{..._0x585b89,'isStepStart':_0x181870};}function _0x27894f(_0xfb0597){const _0x2ba241=_0x1b4679;if(_0xfb0597['type']!==_0x2ba241(0x16f)&&_0xfb0597[_0x2ba241(0x1a1)]!==_0x2ba241(0x1f6)||typeof _0xfb0597[_0x2ba241(0x208)]!='string')return _0xfb0597;let _0x55ca68=_0x482d60[_0xfb0597['toolName']];return _0x55ca68?{..._0xfb0597,'toolName':_0x55ca68,'nativeToolName':_0xfb0597[_0x2ba241(0x208)]}:_0xfb0597;}function _0x3b9c6b(_0x78265){const _0x277825=_0x1b4679;return[..._0x78265][_0x277825(0x259)]()[_0x277825(0x1f4)](_0x12de32=>_0x12de32[_0x277825(0x162)]==='actionable_error'||_0x12de32[_0x277825(0x162)]===_0x277825(0x2a8));}function _0x33fa71(_0x1fb018){const _0x29bb48=_0x1b4679;let _0x5e0cd9=_0x1fb018['meta']??{},_0x536fb3=(_0x22ae5b,_0x762504)=>{const _0x4c5284=_0x328e;for(let _0x40338f of _0x762504){let _0xd130c4=_0x22ae5b[_0x40338f];if(typeof _0xd130c4==_0x4c5284(0x1c7)&&_0xd130c4)return _0xd130c4;}},_0x12cc71=_0x536fb3(_0x5e0cd9,[_0x29bb48(0x231),_0x29bb48(0x1b3),_0x29bb48(0x228),_0x29bb48(0x161)]);if(_0x12cc71)return _0x12cc71;if(typeof _0x1fb018['content']==_0x29bb48(0x1c7))try{let _0x5d925a=JSON[_0x29bb48(0x2ad)](_0x1fb018[_0x29bb48(0x27b)]);return _0x536fb3(_0x5d925a,[_0x29bb48(0x231),_0x29bb48(0x1b3),'rawMessage','message'])??_0x1fb018[_0x29bb48(0x27b)];}catch{return _0x1fb018[_0x29bb48(0x27b)];}return'Unknown\x20backend\x20error\x20(no\x20details\x20in\x20actionable_error\x20message)';}var _0x218618=0x12c,_0x3d3c20=0x3c,_0x4aa736=0x3c;function _0x3847bb(){const _0x5d3def=_0x1b4679;let _0x4b4a27=process.env.LLMGW_CLIENT_ID,_0x3570b3=process.env.LLMGW_CLIENT_SECRET,_0x2dff42=process.env.LLMGW_URL;if(!_0x4b4a27||!_0x3570b3||!_0x2dff42)return null;let _0x10b4a8;try{_0x10b4a8=new URL(_0x5d3def(0x1eb),_0x2dff42)[_0x5d3def(0x1dc)]();}catch{return _0x37af0b(_0x5d3def(0x1d9)+_0x2dff42+_0x5d3def(0x16d)),null;}return{'tokenUrl':_0x10b4a8,'clientId':_0x4b4a27,'clientSecret':_0x3570b3};}function _0x203576(_0x4d4603,_0x5b27da){return new Promise((_0x59cbb0,_0x5384a5)=>{const _0x244c1e=_0x328e;let _0x24c0a2=new URL(_0x4d4603),_0x3a792e=(_0x24c0a2[_0x244c1e(0x26a)]==='http:'?_0x30b40e:_0x52f633)['request'](_0x24c0a2,{'method':_0x244c1e(0x295),'headers':{'Content-Type':_0x244c1e(0x28b),'Content-Length':Buffer[_0x244c1e(0x200)](_0x5b27da)}},_0x5d0c1a=>{const _0x18a947=_0x244c1e;let _0x886cc5='';_0x5d0c1a['on']('data',_0x4c65a9=>{_0x886cc5+=_0x4c65a9;}),_0x5d0c1a['on'](_0x18a947(0x20e),()=>{const _0x40a432=_0x18a947;if(_0x5d0c1a[_0x40a432(0x24c)]&&_0x5d0c1a[_0x40a432(0x24c)]>=0xc8&&_0x5d0c1a[_0x40a432(0x24c)]<0x12c)try{_0x59cbb0(JSON[_0x40a432(0x2ad)](_0x886cc5));}catch{_0x5384a5(new Error(_0x40a432(0x2b8)+_0x886cc5['slice'](0x0,0xc8)));}else _0x5384a5(new Error(_0x40a432(0x2a5)+_0x4d4603+_0x40a432(0x20f)+_0x5d0c1a[_0x40a432(0x24c)]+':\x20'+_0x886cc5['slice'](0x0,0xc8)));});});_0x3a792e['on']('error',_0x5384a5),_0x3a792e[_0x244c1e(0x254)](_0x5b27da),_0x3a792e[_0x244c1e(0x20e)]();});}function _0x3db34c(_0x1ee3ae){process.env.AUTH_TOKEN=_0x1ee3ae;}async function _0x3def15(_0x4618e2){const _0x3177a5=_0x1b4679;let _0x1398a9=new URLSearchParams({'grant_type':'client_credentials','client_id':_0x4618e2[_0x3177a5(0x2af)],'client_secret':_0x4618e2[_0x3177a5(0x27f)]})[_0x3177a5(0x1dc)]();try{let _0x5dcbe6=await _0x203576(_0x4618e2[_0x3177a5(0x1ea)],_0x1398a9),_0x2dee90=typeof _0x5dcbe6['access_token']==_0x3177a5(0x1c7)?_0x5dcbe6[_0x3177a5(0x18b)]:null;return _0x2dee90||(_0x37af0b(_0x3177a5(0x242)),null);}catch(_0x52face){return _0x37af0b(_0x3177a5(0x1a4)+(_0x52face instanceof Error?_0x52face[_0x3177a5(0x161)]:String(_0x52face))),null;}}function _0x2c53f9(_0x14df79){const _0x3f9106=_0x1b4679;let _0x2a5851=()=>{let _0x5f376d=Ne(_0x14df79);return _0x5f376d===null?null:O(_0x5f376d,process.env.AUTH_TOKEN??'')?_0x5f376d:null;};return{'label':'file-refresh','origin':_0x14df79[_0x3f9106(0x263)](',\x20'),'peek':_0x2a5851,'next':()=>Promise[_0x3f9106(0x1ae)](_0x2a5851())};}function _0x51964a(_0x234d40){const _0x38f005=_0x1b4679;return{'label':_0x38f005(0x1b0),'origin':_0x234d40['tokenUrl'],'peek':()=>null,'next':()=>_0x3def15(_0x234d40)};}function _0x2d28c2(_0x3fa85e,_0x3f5bf2){let _0x54333e=!0x1,_0xa77c1=()=>{const _0x23a4bf=_0x328e;let _0x3d4d79=_0x1cdc34(_0x3fa85e);return _0x3d4d79?_0x3131a2(_0x3f5bf2,_0x47c57d(_0x3d4d79))?(_0x54333e=!0x1,_0x3d4d79):(_0x54333e||(_0x37af0b(_0x23a4bf(0x199)+_0x3fa85e+_0x23a4bf(0x1ab)),_0x54333e=!0x0),null):null;};return{'label':'oauth-refresh','origin':_0x3fa85e,'peek':()=>{const _0x4fc194=_0x328e;let _0x2099dd=_0xa77c1();return!_0x2099dd||!O(_0x2099dd[_0x4fc194(0x29a)],process.env.AUTH_TOKEN??'')?null:(_0x4f58ce['sync'](_0x2099dd),_0x2099dd['accessToken']);},'next':async()=>{const _0x39cdad=_0x328e;let _0x4b420c=_0xa77c1();if(!_0x4b420c)return null;if(_0x44c5f7(_0x4b420c)){let _0x2d1c0b=await _0x12d269(_0x4b420c,{'authFilePath':_0x3fa85e,'pinnedIdentity':_0x3f5bf2});if(!_0x2d1c0b)return null;_0x4b420c=_0x2d1c0b;}return O(_0x4b420c['accessToken'],process.env.AUTH_TOKEN??'')?(_0x4f58ce[_0x39cdad(0x17c)](_0x4b420c),_0x4b420c[_0x39cdad(0x29a)]):null;}};}function _0x3b99cc(_0x3bcd6c){const _0x24d9bb=_0x1b4679;let _0x469f5e=_0x3bcd6c!==null,_0x343e01=Re(),_0x41936c=_0x3847bb();if(_0x343e01['length']>0x0)return _0x41936c&&_0x37af0b(_0x24d9bb(0x25e)),_0x2c53f9(_0x343e01);if(_0x41936c)return _0x51964a(_0x41936c);let _0x54d386=_0x1c679a();return _0x3bcd6c&&Ue(_0x469f5e,_0x54d386)?(_0x37af0b(_0x24d9bb(0x1bb)+_0x54d386+_0x24d9bb(0x232)+_0x3bcd6c[_0x24d9bb(0x286)]+_0x24d9bb(0x1d1)+_0x3bcd6c['tenantId']+')'),_0x2d28c2(_0x54d386,_0x3bcd6c)):!_0x469f5e&&B(_0x54d386)?(_0x37af0b(_0x24d9bb(0x2be)+_0x54d386+_0x24d9bb(0x1f0)),null):(_0x19d29f(_0x24d9bb(0x1ed)+K+_0x24d9bb(0x20a)+_0x54d386+_0x24d9bb(0x27e)),null);}var _0x28861c=null,_0x66430c=null,_0x4f58ce=new D();function _0x536268(){_0x66430c!==null&&(clearTimeout(_0x66430c),_0x66430c=null);}function _0x52e49(){_0x536268(),_0x28861c=null;}function _0x3b07c4(_0x49098c){_0x536268(),_0x66430c=setTimeout(()=>{_0x4d1048();},_0x49098c*0x3e8);}function _0x344ce1(_0x3fea0e,_0x273ff9){const _0x40896=_0x1b4679;let _0x394c96=w(_0x3fea0e);if(_0x394c96===null){_0x19d29f('['+_0x273ff9+_0x40896(0x230)),_0x536268();return;}let _0x1ab975=_0x394c96-Math[_0x40896(0x1ec)](Date[_0x40896(0x1cf)]()/0x3e8),_0x5f4049=Math[_0x40896(0x246)](_0x4aa736,_0x1ab975-_0x218618);_0x37af0b('['+_0x273ff9+']\x20Token\x20exp\x20in\x20'+_0x1ab975+_0x40896(0x284)+_0x5f4049+'s'),_0x3b07c4(_0x5f4049);}function _0x53b234(_0x1a9dd1,_0x35eafd,_0x55c468){const _0x5b1bd5=_0x1b4679;try{return _0x1a9dd1[_0x5b1bd5(0x1aa)](_0x35eafd),_0x3db34c(_0x35eafd),_0x37af0b('['+_0x55c468+_0x5b1bd5(0x23d)),!0x0;}catch(_0x2d3f68){return _0x37af0b('['+_0x55c468+_0x5b1bd5(0x2a3)+(_0x2d3f68 instanceof Error?_0x2d3f68[_0x5b1bd5(0x161)]:String(_0x2d3f68))),!0x1;}}async function _0x4d1048(){const _0x3a3acf=_0x1b4679;let _0x3cf2a6=_0x28861c;if(!_0x43c644||!_0x3cf2a6)return;let _0x5d7afc=await _0x3cf2a6['next'](),_0x4c848c=_0x43c644;if(_0x4c848c){if(!_0x5d7afc){_0x37af0b('['+_0x3cf2a6[_0x3a3acf(0x1f3)]+_0x3a3acf(0x248)+_0x3cf2a6['origin']+_0x3a3acf(0x173)+_0x3d3c20+'s'),_0x3b07c4(_0x3d3c20);return;}if(!_0x53b234(_0x4c848c,_0x5d7afc,_0x3cf2a6[_0x3a3acf(0x1f3)])){_0x3b07c4(_0x3d3c20);return;}_0x344ce1(_0x5d7afc,_0x3cf2a6['label']);}}function _0xf71eb9(){const _0x1a6859=_0x1b4679;let _0x291fdc=_0x28861c,_0x16245f=_0x43c644;if(!_0x16245f||!_0x291fdc)return;let _0x527999=_0x291fdc[_0x1a6859(0x27d)]();_0x527999&&_0x53b234(_0x16245f,_0x527999,_0x291fdc[_0x1a6859(0x1f3)])&&_0x344ce1(_0x527999,_0x291fdc['label']);}async function _0x57990a(_0x59c495,_0x34d97b){const _0x29a284=_0x1b4679;_0x28861c=_0x3b99cc(_0x34d97b);let _0x3f11ff=_0x28861c;if(!_0x3f11ff)return _0x59c495;_0x3db34c(_0x59c495);let _0x22c0ef=_0x59c495,_0x19fd68=_0x3f11ff[_0x29a284(0x27d)]();if(_0x19fd68!==null)_0x37af0b('['+_0x3f11ff[_0x29a284(0x1f3)]+']\x20'+_0x3f11ff[_0x29a284(0x1c9)]+_0x29a284(0x1c2)),_0x22c0ef=_0x19fd68,_0x3db34c(_0x22c0ef);else{let _0x3b2ee9=w(_0x59c495),_0x1fa8f9=_0x3b2ee9===null?null:_0x3b2ee9-Math['floor'](Date[_0x29a284(0x1cf)]()/0x3e8);if(_0x1fa8f9!==null&&_0x1fa8f9<_0x218618){_0x37af0b('['+_0x3f11ff[_0x29a284(0x1f3)]+_0x29a284(0x236)+_0x1fa8f9+_0x29a284(0x170)+_0x218618+'s);\x20fetching\x20a\x20fresh\x20one\x20before\x20init');let _0x30387f=await _0x3f11ff[_0x29a284(0x251)]();_0x30387f&&(_0x22c0ef=_0x30387f,_0x3db34c(_0x22c0ef));}}return _0x344ce1(_0x22c0ef,_0x3f11ff[_0x29a284(0x1f3)]),_0x22c0ef;}var _0x43c644=null,_0x1b8c3b=null,_0x152def,_0x2f5904=0x0,_0x5bbee0=null;function _0x4e4e22(_0x86eb){const _0x2bd03d=_0x1b4679;return _0x86eb['type']==='ai'&&_0x86eb[_0x2bd03d(0x162)]!==_0x2bd03d(0x1c1)&&_0x86eb[_0x2bd03d(0x162)]!==_0x2bd03d(0x243);}function _0x575468(_0x90626a){let _0x31dc25=0x0;for(let _0x417afc of _0x90626a)_0x4e4e22(_0x417afc)&&_0x31dc25++;return _0x31dc25;}var _0x5c7510={'alpha':'https://alpha.uipath.com','staging':_0x1b4679(0x292),'production':_0x1b4679(0x2aa)};function _0x1b4b41(_0x2dea69){const _0x15de4e=_0x1b4679;if(_0x2dea69[_0x15de4e(0x258)])return _0x2dea69['backendUrlOption'];if(process.env.BACKEND_URL)return process.env.BACKEND_URL;if(!_0x2dea69[_0x15de4e(0x22d)])return _0x15de4e(0x185);let _0x33130d=_0x5c7510[_0x2dea69[_0x15de4e(0x22d)]];if(!_0x33130d)throw new Error('Unknown\x20env\x20\x22'+_0x2dea69['envOption']+_0x15de4e(0x29c)+Object[_0x15de4e(0x2bb)](_0x5c7510)[_0x15de4e(0x263)](',\x20')+'.');if(!_0x2dea69[_0x15de4e(0x2bf)]||!_0x2dea69[_0x15de4e(0x1f1)])throw new Error('env=\x22'+_0x2dea69[_0x15de4e(0x22d)]+_0x15de4e(0x217)+_0x2dea69[_0x15de4e(0x22d)]+_0x15de4e(0x1c6));let _0x46fa56=_0x33130d+'/'+_0x2dea69[_0x15de4e(0x2bf)]+'/'+_0x2dea69['tenantName']+_0x15de4e(0x22e);return _0x37af0b(_0x15de4e(0x28c)+_0x2dea69['envOption']+_0x15de4e(0x26d)+_0x46fa56),_0x46fa56;}async function _0x247964(_0x3fe9b0){const _0x3ea183=_0x1b4679;_0x19d29f(_0x3ea183(0x164));let {accessToken:_0x26ea27,tenantId:_0x558885,organizationId:_0x15237a,userId:_0x29e885,orgLogicalName:_0x144f9f,tenantName:_0x467d1b}=Ie(_0x3fe9b0,process.env);if(_0x19d29f(_0x3ea183(0x280)+(Object[_0x3ea183(0x2bb)](_0x3fe9b0)[_0x3ea183(0x263)](',\x20')||_0x3ea183(0x215))+_0x3ea183(0x21e)+(_0x26ea27?_0x3ea183(0x1a8)+_0x26ea27[_0x3ea183(0x19c)]+_0x3ea183(0x297):'NOT\x20SET')+_0x3ea183(0x1b8)+(_0x558885??_0x3ea183(0x202))+_0x3ea183(0x197)+(_0x15237a??_0x3ea183(0x202))+_0x3ea183(0x1e6)+(_0x29e885??_0x3ea183(0x202))+_0x3ea183(0x207)+(_0x144f9f??'NOT\x20SET')+_0x3ea183(0x28a)+(_0x467d1b??'NOT\x20SET')),_0x26ea27&&_0x558885&&_0x15237a)return _0x19d29f(_0x3ea183(0x18f)),{'accessToken':_0x26ea27,'tenantId':_0x558885,'organizationId':_0x15237a,'userId':_0x29e885,'orgLogicalName':_0x144f9f,'tenantName':_0x467d1b,'fromSavedAuth':!0x1};_0x19d29f(_0x3ea183(0x227));let _0x141c55=await _0xc6e58e();return _0x141c55?(_0x19d29f(_0x3ea183(0x1e0)+_0x141c55[_0x3ea183(0x24f)]+_0x3ea183(0x210)+_0x141c55[_0x3ea183(0x286)]+_0x3ea183(0x1fb)+_0x141c55[_0x3ea183(0x1dd)]+_0x3ea183(0x1c8)+(_0x141c55['baseUrl']??_0x3ea183(0x215))+_0x3ea183(0x20c)+!!_0x141c55[_0x3ea183(0x1d7)]+_0x3ea183(0x207)+(_0x141c55[_0x3ea183(0x2bf)]??_0x3ea183(0x215))+_0x3ea183(0x28a)+(_0x141c55[_0x3ea183(0x1f1)]??_0x3ea183(0x215))),{'accessToken':_0x141c55[_0x3ea183(0x29a)],'tenantId':_0x141c55[_0x3ea183(0x24f)],'organizationId':_0x141c55[_0x3ea183(0x286)],'refreshToken':_0x141c55[_0x3ea183(0x1d7)],'expiresAt':_0x141c55['expiresAt'],'baseUrl':_0x141c55[_0x3ea183(0x1a3)],'orgLogicalName':_0x3fe9b0[_0x3ea183(0x2bf)]??_0x141c55[_0x3ea183(0x2bf)],'tenantName':_0x3fe9b0[_0x3ea183(0x1f1)]??_0x141c55['tenantName'],'clientId':_0x141c55[_0x3ea183(0x2af)],'fromSavedAuth':!0x0}):(_0x37af0b(_0x3ea183(0x174)),null);}async function _0x53f8c6(_0x30e522){const _0x5261ac=_0x1b4679;let _0x86caac=H(_0x30e522[_0x5261ac(0x2a7)]);if(_0x19d29f(_0x5261ac(0x1b1)+JSON[_0x5261ac(0x250)]({..._0x30e522,'auth':Object[_0x5261ac(0x2bb)](_0x86caac),'backendUrl':_0x30e522[_0x5261ac(0x24a)],'interopUrl':_0x30e522[_0x5261ac(0x1e4)],'env':_0x30e522[_0x5261ac(0x1d6)],'model':_0x30e522[_0x5261ac(0x187)],'maxSteps':_0x30e522[_0x5261ac(0x29b)],'enableSkills':_0x30e522['enableSkills'],'bundledSkillsPath':_0x30e522[_0x5261ac(0x237)],'verbose':_0x30e522[_0x5261ac(0x222)],'logging':_0x30e522[_0x5261ac(0x2a2)]})),_0x43c644)throw _0x37af0b(_0x5261ac(0x212)),new Error('Agent\x20already\x20initialized');let _0x23762f;if(_0x30e522[_0x5261ac(0x175)]){if(_0x4522cd[_0x5261ac(0x267)](_0x30e522['workingDirectory'])){_0x23762f=_0x30e522[_0x5261ac(0x175)];try{process[_0x5261ac(0x2b7)](_0x23762f),_0x37af0b(_0x5261ac(0x278)+_0x23762f+'\x20(process.chdir\x20applied)');}catch(_0xb1748){_0x37af0b('[handleInit]\x20process.chdir('+_0x23762f+_0x5261ac(0x18e)+(_0xb1748 instanceof Error?_0xb1748[_0x5261ac(0x161)]:String(_0xb1748))+_0x5261ac(0x291));}}else _0x37af0b(_0x5261ac(0x1fc)+JSON[_0x5261ac(0x250)](_0x30e522['workingDirectory'])+_0x5261ac(0x18c));}let _0x2dcb23=he(_0x30e522[_0x5261ac(0x276)])[_0x5261ac(0x1e5)](_0x2c38fa=>pe(_0x2c38fa)?!0x0:(_0x37af0b(_0x5261ac(0x28e)+JSON['stringify'](_0x2c38fa)+_0x5261ac(0x1bd)),!0x1));_0x2dcb23[_0x5261ac(0x19c)]>0x0&&_0x37af0b('[handleInit]\x20Shell\x20PATH\x20prepend:\x20'+_0x2dcb23[_0x5261ac(0x263)](_0x366827[_0x5261ac(0x17d)])),_0x19d29f('[handleInit]\x20Resolving\x20auth...');let _0x12120b=await _0x247964(_0x86caac);if(!_0x12120b){_0x37af0b(_0x5261ac(0x1de));let _0x97e095=_0x30e522['env']??'alpha';throw new Error(_0x5261ac(0x2b1)+_0x97e095+_0x5261ac(0x1f7));}_0x19d29f(_0x5261ac(0x22c));let _0x2fdeac={..._0x116c07(_0x12120b[_0x5261ac(0x286)],_0x12120b['tenantId'],_0x12120b[_0x5261ac(0x239)]),...ke(process.env.USE_LLM_GATEWAY_FOR_FIREWORKS)},_0x39c9b3=_0x2fdeac[v];_0x37af0b(_0x5261ac(0x23f)+!!_0x12120b[_0x5261ac(0x286)]+',\x20tenantId\x20set='+!!_0x12120b['tenantId']+_0x5261ac(0x178)+!!_0x12120b['userId']+')'+(_0x39c9b3?';\x20'+v+'='+_0x39c9b3:''));let _0x43c0fa=_0x12120b[_0x5261ac(0x1b6)]===!0x0?_0x47c57d({'accessToken':_0x12120b[_0x5261ac(0x29a)],'organizationId':_0x12120b[_0x5261ac(0x286)],'tenantId':_0x12120b['tenantId'],'clientId':_0x12120b[_0x5261ac(0x2af)]}):null,_0x2be8fb=await _0x57990a(_0x12120b[_0x5261ac(0x29a)],_0x43c0fa);_0x19d29f(_0x5261ac(0x271)),_0x43c644=new _0x26bb84(),_0x19d29f(_0x5261ac(0x1e7)),_0x19d29f(_0x5261ac(0x1c3));let _0x9047c7=0x0;_0x2f5904=0x0,_0x1b8c3b=_0x43c644[_0x5261ac(0x29e)](_0x255ec9=>{const _0x11678e=_0x5261ac;if(!ue(_0x255ec9))return;let _0x1c9797=_0x27894f(_0x255ec9),_0x1a9349=_0x488904(_0x1c9797);_0x9047c7++,_0x19d29f(_0x11678e(0x1e2)+_0x9047c7+_0x11678e(0x21d)+_0x1a9349['type']+_0x11678e(0x15f)+Object[_0x11678e(0x2bb)](_0x1a9349)['join'](',')),_0x5bbee0?.(),_0x47f76c({'type':_0x11678e(0x1be),'event':_0x1a9349});}),_0x19d29f(_0x5261ac(0x1c4));let _0x309a1a=_0x1b4b41({'backendUrlOption':_0x30e522[_0x5261ac(0x24a)],'envOption':_0x30e522[_0x5261ac(0x1d6)],'orgLogicalName':_0x12120b[_0x5261ac(0x2bf)],'tenantName':_0x12120b[_0x5261ac(0x1f1)]}),_0x128781;if(_0x30e522[_0x5261ac(0x282)]!==void 0x0){let _0x3c3704=se(_0x30e522['effort']);_0x3c3704?(_0x128781=_0x3c3704,_0x37af0b(_0x5261ac(0x1a7)+_0x3c3704+_0x5261ac(0x25d))):_0x37af0b(_0x5261ac(0x281)+JSON[_0x5261ac(0x250)](_0x30e522[_0x5261ac(0x282)])+_0x5261ac(0x24d)+ie()+_0x5261ac(0x27c));}let _0x57b2f8={'backendUrl':_0x309a1a,'interopUrl':_0x30e522[_0x5261ac(0x1e4)]??process.env.INTEROP_URL,'model':_0xe71e6a(_0x30e522[_0x5261ac(0x187)]),'maxSteps':_0x30e522['maxSteps'],..._0x23762f!==void 0x0?{'workingDirectory':_0x23762f}:{},..._0x2dcb23[_0x5261ac(0x19c)]>0x0?{'shellPathPrepend':_0x2dcb23}:{},...le(_0x30e522),'agentName':_0x5261ac(0x211),'enableComputerUse':_0x30e522[_0x5261ac(0x163)]??!0x1,'enableConnections':_0x30e522[_0x5261ac(0x220)]??!0x1,'enableSkills':_0x30e522[_0x5261ac(0x19b)]??!0x1,...de(_0x30e522),..._0x30e522[_0x5261ac(0x237)]!==void 0x0?{'bundledSkillsPath':_0x30e522[_0x5261ac(0x237)]}:{},'verbose':_0x30e522[_0x5261ac(0x222)]??!0x1,'logging':_0x30e522[_0x5261ac(0x2a2)]??_0x5261ac(0x1f2),'effort':_0x128781,'requestHeaders':_0x2fdeac,'authStateProvider':((()=>{const _0x22c737=_0x5261ac;let _0x561491=new _0x132d09({'accessToken':_0x2be8fb,'tenantId':_0x12120b[_0x22c737(0x24f)],'organizationId':_0x12120b[_0x22c737(0x286)],'userId':_0x12120b['userId'],'refreshToken':_0x12120b['refreshToken'],'expiresAt':_0x12120b[_0x22c737(0x1dd)],'baseUrl':_0x12120b[_0x22c737(0x1a3)],'clientId':_0x12120b['clientId']});return _0x4f58ce[_0x22c737(0x2b3)](_0x561491),_0x561491;})())},_0xfc5476=_0x5261ac(0x237)in _0x57b2f8?_0x57b2f8[_0x5261ac(0x237)]??_0x5261ac(0x215):'inherit-default';_0x152def=_0x30e522[_0x5261ac(0x187)],_0x37af0b(_0x5261ac(0x219)+_0x57b2f8[_0x5261ac(0x24a)]+_0x5261ac(0x204)+(_0x57b2f8[_0x5261ac(0x1e4)]??_0x5261ac(0x2b0))+_0x5261ac(0x19f)+_0x57b2f8[_0x5261ac(0x23b)]+_0x5261ac(0x16e)+(_0x57b2f8[_0x5261ac(0x187)]??_0x5261ac(0x213))+_0x5261ac(0x234)+(_0x57b2f8['maxSteps']??_0x5261ac(0x213))+_0x5261ac(0x23c)+_0x57b2f8[_0x5261ac(0x163)]+_0x5261ac(0x1a2)+_0x57b2f8[_0x5261ac(0x220)]+_0x5261ac(0x29d)+_0x57b2f8['enableSkills']+',\x20enableMemory='+_0x57b2f8[_0x5261ac(0x2ba)]+_0x5261ac(0x196)+_0x57b2f8['validateModel']+_0x5261ac(0x255)+_0xfc5476+',\x20verbose='+_0x57b2f8['verbose']+_0x5261ac(0x2a9)+_0x57b2f8['logging']);let _0x1c474c=Date[_0x5261ac(0x1cf)]();try{await _0x43c644[_0x5261ac(0x190)](_0x57b2f8);}catch(_0x2f7fc8){if(_0x37af0b(_0x5261ac(0x25a)+(Date['now']()-_0x1c474c)+_0x5261ac(0x1e9)+_0x2f7fc8),_0x52e49(),_0x4f58ce['detach'](),_0x1b8c3b){try{_0x1b8c3b();}catch(_0xb42aaa){_0x37af0b('[handleInit]\x20unsubscribeEvents\x20failed\x20during\x20rollback:\x20'+_0xb42aaa);}_0x1b8c3b=null;}try{await _0x43c644[_0x5261ac(0x19e)]();}catch(_0x237407){_0x37af0b('[handleInit]\x20agent.destroy()\x20failed\x20during\x20rollback:\x20'+_0x237407);}throw _0x43c644=null,_0x2f7fc8;}_0x37af0b('[handleInit]\x20agent.initialize()\x20completed\x20in\x20'+(Date['now']()-_0x1c474c)+'ms'),_0x47f76c({'type':_0x5261ac(0x1b5)}),_0x19d29f(_0x5261ac(0x1b4));}async function _0x5a4b7c(_0x58c604,_0x16ee85,_0x2da0c6){const _0x23d52b=_0x1b4679;if(_0x19d29f(_0x23d52b(0x1b9)+_0x49e430(_0x58c604)+_0x23d52b(0x256)+_0x58c604['length']+_0x23d52b(0x290)+(_0x16ee85??'null')+',\x20maxSteps='+(_0x2da0c6??_0x23d52b(0x209))),!_0x43c644)throw _0x37af0b(_0x23d52b(0x26f)),new Error(_0x23d52b(0x177));_0xf71eb9(),_0x43c644[_0x23d52b(0x21c)](_0x2da0c6);let _0x332333=typeof _0x2da0c6==_0x23d52b(0x22b)&&_0x2da0c6>0x0?_0x2da0c6:0x0,_0x4d556f=ne(_0x16ee85,_0x43c644[_0x23d52b(0x19d)]()),_0x5b2e9f=_0x4d556f?_0x43c644[_0x23d52b(0x273)](_0x4d556f):[],_0x4f9991=_0x4d556f?_0x43c644[_0x23d52b(0x2b5)](_0x4d556f)['length']:0x0;_0x2f5904=_0x575468(_0x5b2e9f);let _0x28f4cd=_0x43c644,_0x1c0874=()=>{const _0x5812a0=_0x23d52b;let _0x317a1c=_0x28f4cd[_0x5812a0(0x19d)](),_0x18c24f=_0x317a1c?_0x28f4cd[_0x5812a0(0x2b5)](_0x317a1c):[];return te(_0x4d556f,_0x4f9991,_0x317a1c,_0x18c24f);},_0x2ecde7=_e(_0x1c0874,_0x151f0b=>_0x47f76c({'type':_0x23d52b(0x269),'usage':_0x151f0b}));_0x5bbee0=_0x2ecde7,_0x19d29f(_0x23d52b(0x182));let _0x18da71=Date[_0x23d52b(0x1cf)](),_0x3aff3a=[],_0x3f62e4,_0x162bbd,_0x480006;try{({response:_0x3f62e4,failed:_0x162bbd,blankTurnRetries:_0x480006}=await De(_0x58c604,_0x16ee85??void 0x0,{'send':async(_0x463e50,_0x5c54c0)=>{const _0x19dafb=_0x23d52b;let _0x171405=await _0x28f4cd[_0x19dafb(0x17e)](_0x463e50,{'sessionId':_0x5c54c0});return _0x3aff3a['push'](..._0x171405['messages']),_0x171405;},'getSessionId':()=>_0x28f4cd[_0x23d52b(0x19d)]()??void 0x0,'log':_0x37af0b}));}finally{_0x2ecde7(),_0x5bbee0=null;}let _0x4527a3=Date[_0x23d52b(0x1cf)]()-_0x18da71,_0x3fdf9b=_0x43c644[_0x23d52b(0x19d)]();_0x19d29f(_0x23d52b(0x184)+_0x4527a3+'ms'),_0x19d29f(_0x23d52b(0x15c)+(_0x3f62e4?.[_0x23d52b(0x19c)]??0x0)+_0x23d52b(0x225)+_0x3fdf9b),_0x19d29f('[handleSend]\x20Response\x20preview:\x20\x22'+_0x49e430(_0x3f62e4??'')+'\x22');let _0x3b0ba4=_0x3b9c6b(_0x3aff3a),_0x2b026f=_0x1c0874(),_0x279c53=Ae(_0x2b026f),_0x2455c6=_0x2b026f['length']>0x0?_0x2b026f[_0x23d52b(0x19c)]:_0x575468(_0x3aff3a),_0xa5ae6d=_0x332333>0x0&&_0x2455c6>=_0x332333;if(_0x3b0ba4||_0x162bbd){let _0x37f09c=_0x3b0ba4?_0x33fa71(_0x3b0ba4):_0x3f62e4;_0x37af0b(_0x23d52b(0x2a6)+_0x37f09c),_0x47f76c({'type':_0x23d52b(0x160),'message':_0x23d52b(0x169)+_0x37f09c}),_0x19d29f(_0x23d52b(0x1f9));return;}_0x47f76c({'type':_0x23d52b(0x1e3),'response':_0x3f62e4,'sessionId':_0x3fdf9b,'durationMs':_0x4527a3,'assistantStepCount':_0x2455c6,'maxStepsReached':_0xa5ae6d,'usage':_0x279c53,..._0x2b026f[_0x23d52b(0x19c)]>0x0?{'turnUsages':_0x2b026f['map'](L)}:{},..._0x480006>0x0?{'blankTurnRetries':_0x480006}:{},'model':_0x152def}),_0x19d29f(_0x23d52b(0x19a)+_0x2455c6+_0x23d52b(0x272)+_0xa5ae6d+_0x23d52b(0x265)+(_0x279c53?_0x279c53['input_tokens']+'/'+_0x279c53[_0x23d52b(0x1ca)]:_0x23d52b(0x215))+_0x23d52b(0x2ae)+_0x2b026f['length']+_0x23d52b(0x1f5)+_0x480006+')');}async function _0x5881fb(){const _0x5abc69=_0x1b4679;if(_0x19d29f(_0x5abc69(0x191)),_0x52e49(),_0x1b8c3b){_0x19d29f('[handleDestroy]\x20Unsubscribing\x20from\x20events...');try{_0x1b8c3b(),_0x19d29f(_0x5abc69(0x16c));}catch(_0xbccd10){_0x37af0b(_0x5abc69(0x279)+_0xbccd10);}_0x1b8c3b=null;}else _0x19d29f(_0x5abc69(0x1a5));if(_0x43c644){_0x19d29f('[handleDestroy]\x20Destroying\x20agent...');try{await _0x43c644[_0x5abc69(0x19e)](),_0x19d29f('[handleDestroy]\x20Agent\x20destroyed\x20successfully');}catch(_0x4ded66){_0x37af0b(_0x5abc69(0x1d0)+_0x4ded66);}_0x43c644=null,_0x4f58ce['detach']();}else _0x19d29f(_0x5abc69(0x27a));_0x152def=void 0x0,_0x2f5904=0x0,_0x47f76c({'type':_0x5abc69(0x1ef)}),_0x19d29f(_0x5abc69(0x16a));}async function _0x33f9a4(_0x152973){const _0x384d9b=_0x1b4679;let _0x30041d=_0x152973[_0x384d9b(0x22f)]();if(!_0x30041d)return _0x19d29f('[dispatch]\x20Received\x20empty\x20line,\x20skipping'),!0x1;let _0x298002=Ee(_0x30041d);if(_0x19d29f(_0x384d9b(0x270)+_0x30041d[_0x384d9b(0x19c)]+_0x384d9b(0x244)+_0x49e430(_0x298002[_0x384d9b(0x186)])),'error'in _0x298002)return _0x37af0b(_0x384d9b(0x1cc)+_0x298002[_0x384d9b(0x160)]),_0x47f76c(_0x413c0e(_0x384d9b(0x201)+_0x298002[_0x384d9b(0x160)])),!0x1;let _0x312b5d=_0x298002[_0x384d9b(0x2b9)];_0x19d29f(_0x384d9b(0x238)+_0x312b5d[_0x384d9b(0x1bc)]+_0x384d9b(0x266)+!!_0x312b5d['options']+_0x384d9b(0x216)+!!_0x312b5d[_0x384d9b(0x223)]+_0x384d9b(0x2c0)+(_0x312b5d[_0x384d9b(0x25c)]??_0x384d9b(0x1da)));try{switch(_0x312b5d[_0x384d9b(0x1bc)]){case _0x384d9b(0x172):return _0x19d29f(_0x384d9b(0x16b)),await _0x53f8c6(_0x312b5d[_0x384d9b(0x262)]??{}),_0x19d29f('[dispatch]\x20handleInit\x20completed'),!0x1;case _0x384d9b(0x1a6):if(typeof _0x312b5d[_0x384d9b(0x223)]!=_0x384d9b(0x1c7))throw _0x37af0b('[dispatch]\x20ERROR:\x20send\x20prompt\x20is\x20not\x20a\x20string,\x20got\x20'+typeof _0x312b5d[_0x384d9b(0x223)]),new Error(_0x384d9b(0x17b));return _0x19d29f('[dispatch]\x20Dispatching\x20to\x20handleSend...'),await _0x5a4b7c(_0x312b5d[_0x384d9b(0x223)],_0x312b5d[_0x384d9b(0x25c)]??null,_0x312b5d[_0x384d9b(0x29b)]),_0x19d29f('[dispatch]\x20handleSend\x20completed'),!0x1;case'destroy':return _0x19d29f('[dispatch]\x20Dispatching\x20to\x20handleDestroy...'),await _0x5881fb(),_0x19d29f(_0x384d9b(0x1fa)),!0x0;default:throw _0x37af0b('[dispatch]\x20ERROR:\x20Unknown\x20command:\x20'+_0x312b5d[_0x384d9b(0x1bc)]),new Error(_0x384d9b(0x1b7)+_0x312b5d[_0x384d9b(0x1bc)]);}}catch(_0x2f3691){return _0x37af0b(_0x384d9b(0x1ac)+_0x312b5d[_0x384d9b(0x1bc)]+_0x384d9b(0x28d)+(_0x2f3691 instanceof Error?_0x2f3691['message']:String(_0x2f3691))),_0x2f3691 instanceof Error&&_0x2f3691[_0x384d9b(0x2c2)]&&_0x37af0b(_0x384d9b(0x233)+_0x2f3691[_0x384d9b(0x2c2)]),_0x47f76c(_0x413c0e(_0x2f3691)),!0x1;}}async function _0x504f47(){const _0x41fe6e=_0x1b4679;_0x37af0b(_0x41fe6e(0x1af)+process[_0x41fe6e(0x299)]+',\x20pid='+process['pid']+_0x41fe6e(0x1d2)+_0xdb8d7c+')'),_0x19d29f(_0x41fe6e(0x15d)+process[_0x41fe6e(0x1c0)]+',\x20arch='+process[_0x41fe6e(0x21f)]+_0x41fe6e(0x26e)+process['cwd']()),_0x19d29f(_0x41fe6e(0x226)+(process.env.BACKEND_URL??_0x41fe6e(0x1f8))+',\x20INTEROP_URL='+(process.env.INTEROP_URL??'not\x20set')),_0x19d29f(_0x41fe6e(0x181)+(process.env.AUTH_TOKEN?_0x41fe6e(0x261):_0x41fe6e(0x1f8))+',\x20TENANT_ID='+(process.env.TENANT_ID??_0x41fe6e(0x1f8))+_0x41fe6e(0x224)+(process.env.ORG_ID??_0x41fe6e(0x1f8))+_0x41fe6e(0x183)+(process.env.USER_ID??_0x41fe6e(0x1f8)));let _0x16b1e5=_0x397012[_0x41fe6e(0x15e)]({'input':process[_0x41fe6e(0x277)],'terminal':!0x1});_0x19d29f(_0x41fe6e(0x194));let _0x24198b=Promise[_0x41fe6e(0x1ae)](),_0xbc4c3b=0x0;_0x16b1e5['on'](_0x41fe6e(0x23a),_0x2e5781=>{const _0x1c9f78=_0x41fe6e;_0xbc4c3b++,_0x19d29f(_0x1c9f78(0x1ad)+_0xbc4c3b+_0x1c9f78(0x179)+_0x2e5781[_0x1c9f78(0x19c)]+_0x1c9f78(0x297)),_0x24198b=_0x24198b['then'](async()=>{const _0x4cac66=_0x1c9f78;_0x19d29f(_0x4cac66(0x289)+_0xbc4c3b+_0x4cac66(0x294)),await _0x33f9a4(_0x2e5781)&&(_0x19d29f(_0x4cac66(0x2a4)),_0x16b1e5[_0x4cac66(0x214)]());});}),_0x16b1e5['on'](_0x41fe6e(0x214),()=>{const _0x360c36=_0x41fe6e;_0x19d29f(_0x360c36(0x2b6)),_0x24198b[_0x360c36(0x252)](()=>{const _0x5abedf=_0x360c36;_0x19d29f('[main]\x20All\x20commands\x20drained,\x20exiting\x20with\x20code\x200'),process[_0x5abedf(0x2a1)](0x0);});}),process['on'](_0x41fe6e(0x26b),_0x387cf7=>{const _0x5d47dc=_0x41fe6e;_0x37af0b(_0x5d47dc(0x1d3)+(_0x387cf7[_0x5d47dc(0x2c2)]??_0x387cf7)),_0x47f76c(_0x413c0e(_0x387cf7)),process['exit'](0x1);}),process['on'](_0x41fe6e(0x206),_0x37b404=>{const _0x3027f8=_0x41fe6e;_0x37af0b(_0x3027f8(0x20d)+String(_0x37b404)),_0x47f76c(_0x413c0e(_0x37b404)),process[_0x3027f8(0x2a1)](0x1);}),_0x19d29f(_0x41fe6e(0x241));}_0x19d29f(_0x1b4679(0x1fd)),_0x504f47()['catch'](_0x4b7ae0=>{const _0x1e4aaf=_0x1b4679;_0x37af0b(_0x1e4aaf(0x1bf)+(_0x4b7ae0[_0x1e4aaf(0x2c2)]??_0x4b7ae0)),process[_0x1e4aaf(0x2a1)](0x1);});});export default Kn();
package/package.json CHANGED
@@ -1,40 +1,40 @@
1
- {
2
- "name": "@uipath/delegate-stdio",
3
- "version": "1.202.1",
4
- "description": "Run a UiPath Delegate agent as a subprocess speaking JSON-Lines over stdio. Self-contained: installing this package pulls in @uipath/delegate-sdk — no separate SDK install.",
5
- "license": "Apache-2.0",
6
- "type": "commonjs",
7
- "main": "dist/delegate_stdio.mjs",
8
- "exports": {
9
- ".": {
10
- "import": "./dist/delegate_stdio.mjs"
11
- }
12
- },
13
- "bin": {
14
- "delegate-stdio": "./dist/delegate_stdio.mjs"
15
- },
16
- "publishConfig": {
17
- "registry": "https://npm.pkg.github.com/"
18
- },
19
- "files": [
20
- "dist",
21
- "README.md",
22
- "LICENSE"
23
- ],
24
- "scripts": {
25
- "build": "node build.mjs",
26
- "prepublishOnly": "npm run build",
27
- "publish:internal": "npm publish --@uipath:registry=https://npm.pkg.github.com/ --ignore-scripts",
28
- "publish:npmjs": "npm publish --@uipath:registry=https://registry.npmjs.org/ --access public --ignore-scripts"
29
- },
30
- "dependencies": {
31
- "@uipath/delegate-sdk": "1.202.1"
32
- },
33
- "devDependencies": {
34
- "@types/node": "^22.0.0",
35
- "esbuild": "^0.25.0",
36
- "javascript-obfuscator": "5.3.0",
37
- "pathe": "^2.0.3",
38
- "typescript": "^5.6.0"
39
- }
40
- }
1
+ {
2
+ "name": "@uipath/delegate-stdio",
3
+ "version": "1.203.0-preview.20261005112239",
4
+ "description": "Run a UiPath Delegate agent as a subprocess speaking JSON-Lines over stdio. Self-contained: installing this package pulls in @uipath/delegate-sdk — no separate SDK install.",
5
+ "license": "Apache-2.0",
6
+ "type": "commonjs",
7
+ "main": "dist/delegate_stdio.mjs",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/delegate_stdio.mjs"
11
+ }
12
+ },
13
+ "bin": {
14
+ "delegate-stdio": "./dist/delegate_stdio.mjs"
15
+ },
16
+ "publishConfig": {
17
+ "registry": "https://npm.pkg.github.com/"
18
+ },
19
+ "files": [
20
+ "dist",
21
+ "README.md",
22
+ "LICENSE"
23
+ ],
24
+ "scripts": {
25
+ "build": "node build.mjs",
26
+ "prepublishOnly": "npm run build",
27
+ "publish:internal": "npm publish --@uipath:registry=https://npm.pkg.github.com/ --ignore-scripts",
28
+ "publish:npmjs": "npm publish --@uipath:registry=https://registry.npmjs.org/ --access public --ignore-scripts"
29
+ },
30
+ "dependencies": {
31
+ "@uipath/delegate-sdk": "1.203.0-preview.20261005112239"
32
+ },
33
+ "devDependencies": {
34
+ "@types/node": "^22.0.0",
35
+ "esbuild": "^0.25.0",
36
+ "javascript-obfuscator": "5.3.0",
37
+ "pathe": "^2.0.3",
38
+ "typescript": "^5.6.0"
39
+ }
40
+ }