@uipath/delegate-stdio 1.202.1 → 1.203.0

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 _0x3ff29a=_0x4b0c;(function(_0x82f154,_0x52be57){const _0x3d8220=_0x4b0c,_0xffe90=_0x82f154();while(!![]){try{const _0x9f414f=-parseInt(_0x3d8220(0x162))/0x1*(parseInt(_0x3d8220(0x173))/0x2)+-parseInt(_0x3d8220(0x136))/0x3*(parseInt(_0x3d8220(0xf1))/0x4)+-parseInt(_0x3d8220(0x1b4))/0x5+parseInt(_0x3d8220(0x1bc))/0x6*(parseInt(_0x3d8220(0xe4))/0x7)+parseInt(_0x3d8220(0x151))/0x8*(parseInt(_0x3d8220(0x19d))/0x9)+parseInt(_0x3d8220(0xbb))/0xa*(-parseInt(_0x3d8220(0x18d))/0xb)+-parseInt(_0x3d8220(0x1c1))/0xc*(-parseInt(_0x3d8220(0x1b9))/0xd);if(_0x9f414f===_0x52be57)break;else _0xffe90['push'](_0xffe90['shift']());}catch(_0x180e5a){_0xffe90['push'](_0xffe90['shift']());}}}(_0x590f,0xa35ef));var p=(_0x4ef852,_0x26b68e)=>()=>(_0x4ef852&&(_0x26b68e=_0x4ef852(_0x4ef852=0x0)),_0x26b68e),He=(_0x38c7da,_0x5a8bb1)=>()=>(_0x5a8bb1||_0x38c7da((_0x5a8bb1={'exports':{}})[_0x3ff29a(0x1cb)],_0x5a8bb1),_0x5a8bb1[_0x3ff29a(0x1cb)]);function ne(_0x30f965,_0x4d0f6d){return _0x30f965??_0x4d0f6d;}function te(_0x182e84,_0x15699d,_0x5c884d,_0x21c9ec){const _0x5e8e4d=_0x3ff29a;return _0x5c884d===_0x182e84?_0x21c9ec[_0x5e8e4d(0x1f6)](_0x15699d):_0x21c9ec[_0x5e8e4d(0x1f6)]();}var re=p(()=>{});function se(_0x4be7d4){const _0x4a1b6f=_0x3ff29a;return typeof _0x4be7d4!=_0x4a1b6f(0x10f)?null:oe['includes'](_0x4be7d4)?_0x4be7d4:null;}function ie(){const _0x536bb4=_0x3ff29a;return oe[_0x536bb4(0x197)](',\x20');}var oe,ae=p(()=>{const _0x173b44=_0x3ff29a;oe=[_0x173b44(0x169),_0x173b44(0xe5),_0x173b44(0x18c),_0x173b44(0x186),_0x173b44(0x1cd)];});function le(_0x33a8f4){const _0x5a0e07=_0x3ff29a;return{..._0x33a8f4[_0x5a0e07(0xb1)]?{'projectId':_0x33a8f4[_0x5a0e07(0xb1)]}:{},..._0x33a8f4[_0x5a0e07(0x1bb)]?{'sessionId':_0x33a8f4['sessionId']}:{}};}var ce=p(()=>{});function de(_0x42eb10){const _0x3179bf=_0x3ff29a;return{'enableMemory':_0x42eb10[_0x3179bf(0x16d)]??!0x1,'validateModel':_0x42eb10[_0x3179bf(0x140)]??!0x1};}function ue(_0x3dc066){const _0x13c496=_0x3ff29a;return _0x3dc066[_0x13c496(0x1d5)]!=='turn_start';}var ge=p(()=>{});import*as _0x4a543a from'fs';function he(_0xca0349){const _0x269a2d=_0x3ff29a;if(!Array[_0x269a2d(0x17e)](_0xca0349))return[];let _0x8c0cae=[];for(let _0x2a161e of _0xca0349){if(typeof _0x2a161e!=_0x269a2d(0x10f))continue;let _0x17d1f0=_0x2a161e[_0x269a2d(0x147)]();_0x17d1f0[_0x269a2d(0x180)]>0x0&&_0x8c0cae[_0x269a2d(0xed)](_0x17d1f0);}return _0x8c0cae;}function pe(_0x32e614){const _0x5a739f=_0x3ff29a;try{return _0x4a543a[_0x5a739f(0xab)](_0x32e614)[_0x5a739f(0x1e1)]();}catch{return!0x1;}}var me=p(()=>{});function ke(_0x2b69f7){const _0x49a2a2=_0x3ff29a;if(_0x2b69f7===void 0x0)return{};let _0x11cb51=_0x2b69f7[_0x49a2a2(0x147)]()['toLowerCase']();return Ke['has'](_0x11cb51)?{[v]:_0x49a2a2(0xb0)}:Be['has'](_0x11cb51)?{[v]:_0x49a2a2(0xd1)}:{};}var v,Ke,Be,Te=p(()=>{const _0x1d2fbf=_0x3ff29a;v=_0x1d2fbf(0x161),Ke=new Set(['true','1',_0x1d2fbf(0x102),'on']),Be=new Set([_0x1d2fbf(0xd1),'0','no',_0x1d2fbf(0xc1)]);});function H(_0x519769){const _0x4ebbc3=_0x3ff29a;if(typeof _0x519769!='object'||_0x519769===null)return{};let _0x56c12f=_0x519769,_0x1db0a3={};for(let _0x2453be of Se){let _0x1dd257=_0x56c12f[_0x2453be];typeof _0x1dd257==_0x4ebbc3(0x10f)&&_0x1dd257[_0x4ebbc3(0x147)]()!==''&&(_0x1db0a3[_0x2453be]=_0x1dd257[_0x4ebbc3(0x147)]());}return _0x1db0a3;}function je(_0x4c8c9d){const _0x2614bc=_0x3ff29a;if(typeof _0x4c8c9d!=_0x2614bc(0x10a)||_0x4c8c9d===null)return _0x4c8c9d;let {options:_0x4875fd}=_0x4c8c9d;return typeof _0x4875fd!=_0x2614bc(0x10a)||_0x4875fd===null||!(_0x2614bc(0xcf)in _0x4875fd)?_0x4c8c9d:{..._0x4c8c9d,'options':{..._0x4875fd,'auth':Object[_0x2614bc(0x1e9)](H(_0x4875fd[_0x2614bc(0xcf)]))}};}function Ee(_0x224560){const _0x32052d=_0x3ff29a;try{let _0x1e83cf=JSON[_0x32052d(0xea)](_0x224560);return{'command':_0x1e83cf,'logText':JSON[_0x32052d(0x1ba)](je(_0x1e83cf))};}catch(_0x46e0f5){return{'error':_0x46e0f5,'logText':'not\x20valid\x20JSON,\x20content\x20not\x20logged'};}}function Ie(_0x127d0e,_0x9c2cce){let _0x7f7121={};for(let _0x2151bb of Se){let _0x56f16a=_0x127d0e[_0x2151bb]??_0x9c2cce[ye[_0x2151bb]];_0x56f16a!==void 0x0&&(_0x7f7121[_0x2151bb]=_0x56f16a);}return _0x7f7121;}var ye,Se,be=p(()=>{const _0x3514fb=_0x3ff29a;ye={'accessToken':_0x3514fb(0x1d1),'tenantId':'TENANT_ID','organizationId':'ORG_ID','userId':_0x3514fb(0x150),'orgLogicalName':_0x3514fb(0xb7),'tenantName':_0x3514fb(0x181)},Se=Object[_0x3514fb(0x1e9)](ye);});function L(_0x5e49ae){const _0x33ad5f=_0x3ff29a;let _0x135cbe=_0x5e49ae['promptTokens']??0x0,_0x5d0674=_0x5e49ae['promptTokensCached']??0x0,_0x200d80=_0x5e49ae[_0x33ad5f(0x116)]??0x0;return{'input_tokens':Math['max'](0x0,_0x135cbe-_0x5d0674-_0x200d80),'output_tokens':_0x5e49ae[_0x33ad5f(0x16c)]??0x0,'cache_creation_input_tokens':_0x200d80,'cache_read_input_tokens':_0x5d0674};}function Ae(_0x433ed0){const _0x29e722=_0x3ff29a;return _0x433ed0[_0x29e722(0x180)]===0x0?null:_0x433ed0[_0x29e722(0xf9)](L)[_0x29e722(0x159)]((_0x2fdf3e,_0x25f3a4)=>({'input_tokens':_0x2fdf3e[_0x29e722(0x11e)]+_0x25f3a4[_0x29e722(0x11e)],'output_tokens':_0x2fdf3e['output_tokens']+_0x25f3a4['output_tokens'],'cache_creation_input_tokens':_0x2fdf3e['cache_creation_input_tokens']+_0x25f3a4[_0x29e722(0x128)],'cache_read_input_tokens':_0x2fdf3e[_0x29e722(0x164)]+_0x25f3a4[_0x29e722(0x164)]}));}function _e(_0x560bc2,_0x30d503){let _0x2f3d33=0x0;return()=>{let _0x139d48=_0x560bc2();for(;_0x2f3d33<_0x139d48['length'];_0x2f3d33++)_0x30d503(L(_0x139d48[_0x2f3d33]));};}function _0x590f(){const _0x3cfe7e=['tool_call','content','Token\x20endpoint\x20',',\x20hasOptions=','[dispatch]\x20handleInit\x20completed','[main]\x20unhandledRejection:\x20','isArray','refreshToken','length','TENANT_NAME',',\x20orgLogicalName=','[writeLine]\x20>>>\x20','error','env','xhigh','null','\x20—\x20shell\x20tools\x20still\x20default\x20there\x20via\x20the\x20SDK','provider',',\x20agentName=','default','high','27401SbiZLw','tenantName','reverse','Write','usage','accessToken','[handleInit]\x20ERROR:\x20Agent\x20already\x20initialized','getTurnUsageHistory',',\x20CWD=','stderr','join','baseURL','[blank-turn]\x20backend\x20returned\x20a\x20blank-completion\x20apology;\x20retrying\x20','delimiter',',\x20verbose=',',\x20USER_ID=','5319pehdqf','SET\x20(','s);\x20fetching\x20a\x20fresh\x20one\x20before\x20init','peek','https://cloud.uipath.com','[handleInit]\x20unsubscribeEvents\x20failed\x20during\x20rollback:\x20','cwd',',\x20pid=','agent_thought','text','\x20on\x20the\x20same\x20session','shellPathPrepend',']\x20Inherited\x20token\x20has\x20','failed','[handleInit]\x20Auth\x20resolved\x20successfully','application/x-www-form-urlencoded','write','Token\x20endpoint\x20returned\x20non-JSON:\x20','stack','enableConnections','exp',',\x20enableConnections=','sync','1165650PQyNwd','next',',\x20maxSteps=','[resolveAuth]\x20Starting\x20auth\x20resolution...','url','53417NbUFpJ','stringify','sessionId','210acGKqb','[resolveAuth]\x20No\x20auth\x20available\x20(init\x20option,\x20env\x20vars\x20and\x20saved\x20auth\x20all\x20failed)','[handleInit]\x20Creating\x20DelegateAgent\x20instance...','[s2s-refresh]\x20LLMGW_URL\x20is\x20not\x20a\x20valid\x20URL:\x20\x22','initialize','132ooMIyr','[event\x20#',',\x20maxStepsReached=','[resolveAuth]\x20Init\x20option\x20/\x20env\x20vars\x20incomplete,\x20trying\x20loadAndRefreshAuth()...','send:\x20`prompt`\x20must\x20be\x20a\x20string',',\x20logging=','[main]\x20readline\x20interface\x20created,\x20waiting\x20for\x20commands\x20on\x20stdin...','attach','[handleSend]\x20result\x20written\x20to\x20stdout\x20(steps=','byteLength','exports',',\x20enableComputerUse=','max','\x27\x20->\x20\x27','bundledSkillsPath',',\x20organizationId=','AUTH_TOKEN','<no\x20response\x20body>','destroyed','messages','type','config','filter','options',',\x20debug=','backendUrl','output_tokens','\x20chars),\x20sessionId=','[normalizeModelId]\x20Rewriting\x20model\x20\x27','detach','expiresAt','[main]\x20Event\x20handlers\x20registered,\x20host\x20is\x20ready','isDirectory','\x20—\x20not\x20an\x20existing\x20directory','[dispatch]\x20ERROR:\x20Command\x20\x27','stdin','event','Unknown\x20backend\x20error\x20(no\x20details\x20in\x20actionable_error\x20message)','data','\x22\x20(','keys','unhandledRejection','Skill',']\x20type=',',\x20sessionId=','getSessionId','enableComputerUse','`\x20so\x20saved\x20auth\x20carries\x20the\x20slugs.','now','workingDirectory','clientSecret','close','http:','slice','Bash',',\x20userId=','Read','command','widget','resolve',',\x20expiresAt=','\x22\x20requires\x20org/tenant\x20slugs.\x20Set\x20ORG_LOGICAL_NAME\x20and\x20TENANT_NAME\x20env\x20vars,\x20or\x20run\x20`delegate-cli\x20login\x20--env\x20','platform','[main]\x20Host\x20starting\x20(Node\x20','\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','Agent\x20not\x20initialized;\x20send\x20`init`\x20first.',',\x20interopUrl=','isFinite','http://localhost:5002',',\x20hasRefreshToken=','orgLogicalName','Agent\x20already\x20initialized','statSync','number','unbounded','client_credentials','[handleSend]\x20agent.sendMessage()\x20completed\x20in\x20','true','projectId',',\x20enableMemory=','toString','protocol','s;\x20next\x20refresh\x20in\x20','catch','ORG_LOGICAL_NAME','[handleInit]\x20Called\x20with\x20options:\x20',',\x20tenantId=','getSessionMessages','730YbIbkt','[handleDestroy]\x20Destroying\x20agent...',']\x20Fresh\x20token\x20applied\x20via\x20agent.updateToken()\x20+\x20process.env.AUTH_TOKEN','startsWith','tokenUrl','[handleDestroy]\x20Events\x20unsubscribed\x20successfully','off','details','tenantId','[main]\x20Env:\x20BACKEND_URL=','[handleInit]\x20Ignoring\x20shellPathPrepend\x20entry\x20','[main]\x20stdin\x20line\x20#','existsSync',',\x20bundledSkillsPath=','env=\x22','Your\x20previous\x20reply\x20was\x20empty.\x20Continue\x20the\x20task\x20from\x20where\x20you\x20left\x20off\x20and\x20complete\x20it.','[handleSend]\x20ERROR:\x20Agent\x20not\x20initialized','method','[oauth-refresh]\x20','exit','auth','includes','false','AUTH_TOKEN_FILE','[dispatch]\x20handleDestroy\x20completed,\x20will\x20exit','uncaughtException','end',',\x20userId\x20set=','sendMessage','toolName','fromSavedAuth','[handleInit]\x20agent.initialize()\x20completed\x20in\x20','[handleSend]\x20Response\x20preview:\x20\x22','createInterface','NOT\x20SET','destroy','utf8',',\x20tenant=',',\x20INTEROP_URL=','ms;\x20rolling\x20back\x20partial\x20state:\x20',',\x20turnUsages=','172739htJZrO','medium','statusCode','/delegate_','label','\x20holds\x20a\x20fresher\x20token\x20than\x20the\x20inherited\x20one;\x20using\x20it\x20for\x20init','parse',',\x20usage=','endsWith','push','[handleSend]\x20Actionable\x20error\x20detected\x20this\x20turn:\x20','DELEGATE_AUTH_TOKEN_FILE','\x20→\x20','4uwtNnW','agentName','send','cmd','[handleInit]\x20agent.initialize()\x20threw\x20after\x20','https://staging.uipath.com','.\x20Model\x20recommended\x20default\x20applies.','[handleSend]\x20Response\x20length:\x20','map','UIPATH_ACCESS_TOKEN=','[handleDestroy]\x20agent.destroy()\x20failed:\x20','init_ok','\x20chars):\x20','\x27\x20threw:\x20','[handleInit]\x20agent.destroy()\x20failed\x20during\x20rollback:\x20','hasRefreshToken','[resolveBackendUrl]\x20env=','yes','\x22\x20—\x20disabling\x20S2S\x20refresh','[dispatch]\x20Dispatching\x20to\x20handleInit...','clientId','[s2s-refresh]\x20Mint\x20failed:\x20','isAxiosError','message','envOption','object','actionableError','updateConfig','\x20(process.chdir\x20applied)','\x20->\x20','string',',\x20blankTurnRetries=','maxSteps','[main]\x20Env:\x20AUTH_TOKEN=','Unknown\x20cmd:\x20','tool_result','organizationId','cacheCreationTokens','\x20retries;\x20returning\x20the\x20apology\x20so\x20the\x20turn\x20is\x20graded\x20on\x20its\x20partial\x20work','effort','[token-refresh]\x20Using\x20the\x20saved\x20OAuth\x20grant\x20in\x20','[handleSend]\x20error\x20written\x20to\x20stdout','`\x20(writes\x20~/.aria/sdk-auth.json).','none','[handleDestroy]\x20unsubscribeEvents\x20failed:\x20','input_tokens','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','response',']\x20agent.updateToken()\x20threw:\x20','toUpperCase','prompt',',\x20baseUrl=','[resolveAuth]\x20Using\x20init-option\x20/\x20env\x20var\x20auth',',\x20but\x20this\x20host\x20authenticated\x20with\x20an\x20explicit\x20AUTH_TOKEN\x20—\x20not\x20refreshing\x20from\x20saved\x20auth\x20(identities\x20may\x20differ)','readFileSync','cache_creation_input_tokens','[dispatch]\x20Received\x20line\x20(','enableSkills','\x22.\x20Use\x20one\x20of:\x20','then','model','...','[handleInit]\x20Ignoring\x20workingDirectory=','aria-autopilot','arch','userId','followUpsRenderer','[dispatch]\x20Stack:\x20','\x20received\x20(','1749927TilhUo','pid','Edit','[dispatch]\x20ERROR:\x20send\x20prompt\x20is\x20not\x20a\x20string,\x20got\x20',']\x20No\x20fresher\x20token\x20from\x20',',\x20validateModel=',',\x20tenantName=','[main]\x20platform=','setMaxSteps','utf-8','validateModel','[main]\x20dispatch\x20returned\x20shouldExit=true,\x20closing\x20readline','finally','https://alpha.uipath.com','[token-refresh]\x20A\x20token\x20file\x20and\x20LLMGW_*\x20S2S\x20creds\x20are\x20both\x20configured;\x20the\x20token\x20file\x20wins','[delegate-stdio]\x20','Invalid\x20JSON\x20command:\x20','trim','info','\x20—\x20directory\x20does\x20not\x20exist',')\x20failed:\x20','[dispatch]\x20Dispatching\x20to\x20handleSend...','from','stdout',',\x20arch=','[handleInit]\x20Shell\x20PATH\x20prepend:\x20','USER_ID','14032RVJpBP','[dispatch]\x20Received\x20empty\x20line,\x20skipping',',\x20TENANT_ID=','\x20chars)','s\x20remaining\x20(<','access_token','result','/identity_/connect/token','reduce','[main]\x20All\x20commands\x20drained,\x20exiting\x20with\x20code\x200',',\x20model=','[handleInit]\x20Working\x20directory:\x20','not\x20set','rawMessage',',\x20no\x20LLMGW_CLIENT_ID/LLMGW_CLIENT_SECRET/LLMGW_URL,\x20and\x20no\x20renewable\x20grant\x20in\x20','split','X-UiPath-Use-Llm-Gateway-For-Fireworks','1qobxIy',',\x20orgId=','cache_read_input_tokens','description','\x20—\x20not\x20one\x20of\x20','[blank-turn]\x20still\x20blank\x20after\x20','floor','low','interopUrl','meta','completionTokens','enableMemory','backendUrlOption','[token-refresh]\x20No\x20','[handleInit]\x20Subscribing\x20to\x20agent\x20events...','logging','[handleDestroy]\x20Unsubscribing\x20from\x20events...','556118CXCDFS','pending','alpha','baseUrl','Unknown\x20env\x20\x22'];_0x590f=function(){return _0x3cfe7e;};return _0x590f();}var ve=p(()=>{});import _0x14b008 from'fs';import _0x14ab0d from'node:path';function $e(_0xc63fa6){const _0x14974b=_0x3ff29a;let _0x39a964=_0xc63fa6[0x0];return _0xc63fa6['length']>=0x2&&(_0x39a964==='\x22'||_0x39a964==='\x27')&&_0xc63fa6[_0x14974b(0xec)](_0x39a964)?_0xc63fa6['slice'](0x1,-0x1)[_0x14974b(0x147)]():_0xc63fa6;}function Ve(_0x556db4){const _0x18ee23=_0x3ff29a;for(let _0xfe2a88 of _0x556db4[_0x18ee23(0x160)]('\x0a'))if(_0xfe2a88[_0x18ee23(0xbe)](we)){let _0x5f417b=$e(_0xfe2a88[_0x18ee23(0x1f6)](we[_0x18ee23(0x180)])[_0x18ee23(0x147)]());if(_0x5f417b)return _0x5f417b;}let _0x125b7c=$e(_0x556db4['trim']());return _0x125b7c&&!_0x125b7c[_0x18ee23(0xd0)]('\x0a')&&!_0x125b7c[_0x18ee23(0xd0)]('=')?_0x125b7c:null;}function w(_0x1a1979){const _0x5f0c11=_0x3ff29a;let _0x2b55a6=_0x1a1979[_0x5f0c11(0x160)]('.');if(_0x2b55a6['length']!==0x3)return null;try{let _0x28aa96=JSON[_0x5f0c11(0xea)](Buffer[_0x5f0c11(0x14c)](_0x2b55a6[0x1],'base64')[_0x5f0c11(0xb3)]());return typeof _0x28aa96[_0x5f0c11(0x1b1)]=='number'?_0x28aa96[_0x5f0c11(0x1b1)]:null;}catch{return null;}}function O(_0x591ff6,_0x72c899){if(_0x591ff6===_0x72c899)return!0x1;let _0x23b7ec=w(_0x591ff6),_0x25f525=w(_0x72c899);return _0x23b7ec!==null&&_0x25f525!==null&&_0x23b7ec>_0x25f525;}function Re(_0x3e8984=process.env){const _0x250335=_0x3ff29a;return(_0x3e8984[K]??_0x3e8984[Ye]??'')[_0x250335(0x160)](_0x14ab0d[_0x250335(0x19a)])[_0x250335(0xf9)](_0x5c6426=>_0x5c6426[_0x250335(0x147)]())[_0x250335(0x1d7)](_0x541d59=>_0x541d59[_0x250335(0x180)]>0x0);}function Ne(_0x170d20){const _0x365fe5=_0x3ff29a;for(let _0x1b543c of _0x170d20){let _0x46a00d;try{_0x46a00d=_0x14b008['readFileSync'](_0x1b543c,_0x365fe5(0x13f));}catch{continue;}let _0x28af96=Ve(_0x46a00d);if(_0x28af96)return _0x28af96;}return null;}var K,Ye,we,xe=p(()=>{const _0xcf83d2=_0x3ff29a;K=_0xcf83d2(0xef),Ye=_0xcf83d2(0xd2),we=_0xcf83d2(0xfa);});import _0x4d5227 from'fs';function qe(_0x2fece9){const _0x3a0bfb=_0x3ff29a;let _0x53bf6b;try{_0x53bf6b=JSON[_0x3a0bfb(0xea)](_0x2fece9);}catch{return null;}if(typeof _0x53bf6b!=_0x3a0bfb(0x10a)||_0x53bf6b===null||Array['isArray'](_0x53bf6b))return null;let _0x10b744=_0x53bf6b,_0x13a30a=typeof _0x10b744[_0x3a0bfb(0x192)]==_0x3a0bfb(0x10f)?_0x10b744[_0x3a0bfb(0x192)]:'',_0xed9389=typeof _0x10b744[_0x3a0bfb(0x17f)]==_0x3a0bfb(0x10f)?_0x10b744[_0x3a0bfb(0x17f)][_0x3a0bfb(0x147)]():'',_0x1c2f95=_0x37fd02=>typeof _0x37fd02=='string'&&_0x37fd02[_0x3a0bfb(0x180)]>0x0?_0x37fd02:void 0x0;return{'accessToken':_0x13a30a,'hasRefreshToken':_0xed9389['length']>0x0,..._0x1c2f95(_0x10b744[_0x3a0bfb(0x115)])?{'organizationId':_0x1c2f95(_0x10b744[_0x3a0bfb(0x115)])}:{},..._0x1c2f95(_0x10b744[_0x3a0bfb(0xc3)])?{'tenantId':_0x1c2f95(_0x10b744[_0x3a0bfb(0xc3)])}:{},..._0x1c2f95(_0x10b744[_0x3a0bfb(0x105)])?{'clientId':_0x1c2f95(_0x10b744[_0x3a0bfb(0x105)])}:{}};}function Qe(_0x13a1dc){const _0x2ede04=_0x3ff29a;try{return qe(_0x4d5227[_0x2ede04(0x127)](_0x13a1dc,_0x2ede04(0xdf)));}catch{return null;}}function B(_0x52bed7){const _0x5b965f=_0x3ff29a;return Qe(_0x52bed7)?.[_0x5b965f(0x100)]??!0x1;}function Ue(_0x234852,_0xaebbb){return _0x234852&&B(_0xaebbb);}function Ze(_0x51e5a9){const _0x417eee=_0x3ff29a;return{'accessToken':_0x51e5a9[_0x417eee(0x192)],..._0x51e5a9[_0x417eee(0x17f)]?{'refreshToken':_0x51e5a9[_0x417eee(0x17f)]}:{},...typeof _0x51e5a9[_0x417eee(0x1df)]==_0x417eee(0xac)?{'expiresAt':_0x51e5a9[_0x417eee(0x1df)]}:{}};}var D,Le=p(()=>{const _0x2d84c5=_0x3ff29a;D=class{[_0x2d84c5(0x189)]=null;[_0x2d84c5(0x174)]=null;[_0x2d84c5(0x1b3)](_0x185f67){const _0xbbd57b=_0x2d84c5;let _0x2c34c4=Ze(_0x185f67);this[_0xbbd57b(0x189)]?this[_0xbbd57b(0x189)]['updateConfig'](_0x2c34c4):this[_0xbbd57b(0x174)]=_0x2c34c4;}[_0x2d84c5(0x1c8)](_0x380d51){const _0x15710b=_0x2d84c5;this[_0x15710b(0x189)]=_0x380d51,this[_0x15710b(0x174)]&&(_0x380d51[_0x15710b(0x10c)](this['pending']),this[_0x15710b(0x174)]=null);}[_0x2d84c5(0x1de)](){this['provider']=null,this['pending']=null;}};});function Oe(_0x3536fa){const _0x81b84c=_0x3ff29a;return(_0x3536fa??'')[_0x81b84c(0x147)]()===en;}async function De(_0x4f6e7e,_0x4ff330,_0x31acb8){const _0x2b1bf5=_0x3ff29a;let {send:_0xdbe0f8,getSessionId:_0x15a8ed,log:_0x630f14,maxRetries:_0x22065b=0x2}=_0x31acb8,_0x252855=await _0xdbe0f8(_0x4f6e7e,_0x4ff330),_0x27f2e1=0x0;for(;Oe(_0x252855[_0x2b1bf5(0x1a6)])&&_0x27f2e1<_0x22065b;)_0x27f2e1+=0x1,_0x630f14(_0x2b1bf5(0x199)+_0x27f2e1+'/'+_0x22065b+_0x2b1bf5(0x1a7)),_0x252855=await _0xdbe0f8(nn,_0x15a8ed()??_0x4ff330);return Oe(_0x252855[_0x2b1bf5(0x1a6)])&&_0x630f14(_0x2b1bf5(0x167)+_0x22065b+_0x2b1bf5(0x117)),{'response':_0x252855['text'],'failed':_0x252855[_0x2b1bf5(0x1aa)],'blankTurnRetries':_0x27f2e1};}var en,nn,Ce=p(()=>{const _0x4217ed=_0x3ff29a;en='I\x20apologize,\x20but\x20I\x20didn\x27t\x20receive\x20a\x20complete\x20response.\x20Please\x20try\x20again.',nn=_0x4217ed(0xca);});import _0x30fde4 from'fs';import _0x543f25 from'node:path';import _0x4cf908 from'readline';import _0x32e977 from'http';import _0x404369 from'https';function _0x4b0c(_0x1d5a55,_0x36444b){_0x1d5a55=_0x1d5a55-0xab;const _0x590fce=_0x590f();let _0x4b0c0d=_0x590fce[_0x1d5a55];return _0x4b0c0d;}import{DelegateAgent as _0x33ba6c,TokenAuthProvider as _0x36ff24,getAuthFilePath as _0x169fbb,grantIdentity as _0x3cf7e5,isTokenExpired as _0x409019,loadAndRefreshAuth as _0x20fb46,readSavedAuthRecord as _0x2b4044,refreshAccessToken as _0x344c97,sameGrantIdentity as _0x50b7ef}from'@uipath/delegate-sdk';var Kn=He(()=>{const _0x415a4f=_0x3ff29a;re(),ae(),ce(),ge(),me(),Te(),be(),ve(),xe(),Le(),Ce();function _0x290b44(_0x301b56,_0x1b3d2a,_0x2a01f1){return{'X-UiPath-Internal-AccountId':_0x301b56,'X-UiPath-Internal-TenantId':_0x1b3d2a,..._0x2a01f1?{'X-UiPath-Internal-UserId':_0x2a01f1}:{}};}var _0x42574c=process.env.DELEGATE_STDIO_VERBOSE==='1'||process.env.DELEGATE_STDIO_VERBOSE===_0x415a4f(0xb0),_0x3e23ec=((()=>{const _0x46bfae=_0x415a4f;let _0x500806=process.env.DELEGATE_STDIO_LOG_MAX_CHARS;if(_0x500806===void 0x0||_0x500806[_0x46bfae(0x147)]()==='')return 0xc350;let _0x1c668c=Number(_0x500806);return Number[_0x46bfae(0x204)](_0x1c668c)&&_0x1c668c>=0x0?_0x1c668c:0xc350;})());function _0x1b8454(_0x173ac7){const _0x4646d8=_0x415a4f;return _0x3e23ec>0x0&&_0x173ac7[_0x4646d8(0x180)]>_0x3e23ec?_0x173ac7[_0x4646d8(0x1f6)](0x0,_0x3e23ec)+'…('+(_0x173ac7[_0x4646d8(0x180)]-_0x3e23ec)+'\x20more\x20chars)':_0x173ac7;}function _0x944896(_0x599e07){const _0x8fb741=_0x415a4f;let _0x3d3d16=JSON['stringify'](_0x599e07);_0x1d325e(_0x8fb741(0x183)+_0x1b8454(_0x3d3d16)),process[_0x8fb741(0x14d)][_0x8fb741(0x1ad)](_0x3d3d16+'\x0a');}function _0x2d1c69(_0x1b1720){const _0x758c98=_0x415a4f;process[_0x758c98(0x196)][_0x758c98(0x1ad)](_0x758c98(0x145)+_0x1b1720+'\x0a');}function _0x1d325e(_0x407eef){const _0x3528ae=_0x415a4f;_0x42574c&&process[_0x3528ae(0x196)][_0x3528ae(0x1ad)]('[delegate-stdio]\x20'+_0x407eef+'\x0a');}function _0x329c3f(_0x8baa4f){const _0x301786=_0x415a4f;let _0x5079dc=_0x8baa4f instanceof Error?_0x8baa4f:new Error(String(_0x8baa4f)),_0x5c26e7=_0x5079dc['message'],_0x479451=_0x8baa4f;if(_0x479451?.[_0x301786(0x107)]&&_0x479451['response']){let {status:_0x5ae8ae,statusText:_0x2a00c4,data:_0x266e55}=_0x479451[_0x301786(0x120)],_0x336844=_0x479451['config']?.[_0x301786(0xcc)]?.[_0x301786(0x122)]()??'REQUEST',_0x167525=_0x479451[_0x301786(0x1d6)]?.['baseURL']?''+_0x479451[_0x301786(0x1d6)][_0x301786(0x198)]+(_0x479451[_0x301786(0x1d6)]?.[_0x301786(0x1b8)]??''):_0x479451[_0x301786(0x1d6)]?.[_0x301786(0x1b8)]??'',_0x29c4bf;if(typeof _0x266e55==_0x301786(0x10f))_0x29c4bf=_0x1b8454(_0x266e55);else{if(_0x266e55==null)_0x29c4bf=_0x301786(0x1d2);else try{let _0x1b7a47=JSON[_0x301786(0x1ba)](_0x266e55);_0x29c4bf=_0x1b8454(_0x1b7a47);}catch{_0x29c4bf=String(_0x266e55);}}_0x5c26e7=_0x336844+'\x20'+_0x167525+_0x301786(0xf0)+_0x5ae8ae+(_0x2a00c4?'\x20'+_0x2a00c4:'')+':\x20'+_0x29c4bf;}return{'message':_0x5c26e7,'stack':_0x5079dc[_0x301786(0x1af)]};}function _0x5952ea(_0x20fa6a){const _0x2da5a1=_0x415a4f;let {message:_0x4c4ef2,stack:_0x27c7a0}=_0x329c3f(_0x20fa6a);return{'type':_0x2da5a1(0x184),'message':_0x4c4ef2,'stack':_0x27c7a0};}function _0x28a42f(_0x4df774){const _0x59bcec=_0x415a4f;if(!_0x4df774||!_0x4df774[_0x59bcec(0xd0)]('-'))return _0x4df774;let _0xfb7e4f=_0x4df774['replace'](/-/g,'_');return _0x2d1c69(_0x59bcec(0x1dd)+_0x4df774+_0x59bcec(0x1ce)+_0xfb7e4f+'\x27'),_0xfb7e4f;}var _0x49a77e={'ReadFile':_0x415a4f(0x1f9),'WriteFile':_0x415a4f(0x190),'EditFile':_0x415a4f(0x138),'ExecuteBashCommand':_0x415a4f(0x1f7),'LsDirectory':'LS','ExecuteSkillApi':_0x415a4f(0x1eb)};function _0x306601(_0x463f81){const _0x493b40=_0x415a4f;if(_0x463f81[_0x493b40(0x1d5)]!==_0x493b40(0x108)||!_0x349d4d)return _0x463f81;let _0x12b703=_0x349d4d[_0x493b40(0x1ee)]();if(!_0x12b703)return _0x463f81;let _0x5231cd=_0x349d4d[_0x493b40(0xba)](_0x12b703),_0x3d6c7e=_0x7d2cd(_0x5231cd),_0x90701e=_0x3d6c7e>_0x106556;return _0x106556=_0x3d6c7e,{..._0x463f81,'isStepStart':_0x90701e};}function _0x56e670(_0x1eb3b9){const _0x447ae8=_0x415a4f;if(_0x1eb3b9[_0x447ae8(0x1d5)]!==_0x447ae8(0x178)&&_0x1eb3b9[_0x447ae8(0x1d5)]!==_0x447ae8(0x114)||typeof _0x1eb3b9[_0x447ae8(0xd8)]!='string')return _0x1eb3b9;let _0x506eee=_0x49a77e[_0x1eb3b9[_0x447ae8(0xd8)]];return _0x506eee?{..._0x1eb3b9,'toolName':_0x506eee,'nativeToolName':_0x1eb3b9[_0x447ae8(0xd8)]}:_0x1eb3b9;}function _0x22a394(_0x5603bd){const _0x40830c=_0x415a4f;return[..._0x5603bd][_0x40830c(0x18f)]()['find'](_0x8309c=>_0x8309c['widget']==='actionable_error'||_0x8309c[_0x40830c(0x1fb)]===_0x40830c(0x10b));}function _0x13639f(_0x2be1e7){const _0x54f87c=_0x415a4f;let _0x544ba5=_0x2be1e7[_0x54f87c(0x16b)]??{},_0x4af071=(_0x4bea43,_0x2c1592)=>{const _0xb90f5d=_0x54f87c;for(let _0x35c80f of _0x2c1592){let _0x15520c=_0x4bea43[_0x35c80f];if(typeof _0x15520c==_0xb90f5d(0x10f)&&_0x15520c)return _0x15520c;}},_0x5b29e8=_0x4af071(_0x544ba5,[_0x54f87c(0xc2),_0x54f87c(0x165),'rawMessage','message']);if(_0x5b29e8)return _0x5b29e8;if(typeof _0x2be1e7[_0x54f87c(0x179)]=='string')try{let _0x50053a=JSON[_0x54f87c(0xea)](_0x2be1e7[_0x54f87c(0x179)]);return _0x4af071(_0x50053a,[_0x54f87c(0xc2),_0x54f87c(0x165),_0x54f87c(0x15e),'message'])??_0x2be1e7['content'];}catch{return _0x2be1e7['content'];}return _0x54f87c(0x1e6);}var _0x233d62=0x12c,_0x3d8dde=0x3c,_0x568597=0x3c;function _0x3e0d5a(){const _0x1cc4f5=_0x415a4f;let _0x1f4f21=process.env.LLMGW_CLIENT_ID,_0x416419=process.env.LLMGW_CLIENT_SECRET,_0x346e89=process.env.LLMGW_URL;if(!_0x1f4f21||!_0x416419||!_0x346e89)return null;let _0x36e758;try{_0x36e758=new URL(_0x1cc4f5(0x158),_0x346e89)[_0x1cc4f5(0xb3)]();}catch{return _0x2d1c69(_0x1cc4f5(0x1bf)+_0x346e89+_0x1cc4f5(0x103)),null;}return{'tokenUrl':_0x36e758,'clientId':_0x1f4f21,'clientSecret':_0x416419};}function _0xf3a93a(_0x36ce73,_0x18de5e){return new Promise((_0x15ba56,_0x441e7c)=>{const _0x59dfde=_0x4b0c;let _0x1eec7c=new URL(_0x36ce73),_0xa0ce6e=(_0x1eec7c[_0x59dfde(0xb4)]===_0x59dfde(0x1f5)?_0x32e977:_0x404369)['request'](_0x1eec7c,{'method':'POST','headers':{'Content-Type':_0x59dfde(0x1ac),'Content-Length':Buffer[_0x59dfde(0x1ca)](_0x18de5e)}},_0x3ab162=>{const _0x542841=_0x59dfde;let _0x794ce9='';_0x3ab162['on'](_0x542841(0x1e7),_0x136fe6=>{_0x794ce9+=_0x136fe6;}),_0x3ab162['on']('end',()=>{const _0x37ff89=_0x542841;if(_0x3ab162[_0x37ff89(0xe6)]&&_0x3ab162[_0x37ff89(0xe6)]>=0xc8&&_0x3ab162['statusCode']<0x12c)try{_0x15ba56(JSON[_0x37ff89(0xea)](_0x794ce9));}catch{_0x441e7c(new Error(_0x37ff89(0x1ae)+_0x794ce9['slice'](0x0,0xc8)));}else _0x441e7c(new Error(_0x37ff89(0x17a)+_0x36ce73+'\x20returned\x20HTTP\x20'+_0x3ab162['statusCode']+':\x20'+_0x794ce9[_0x37ff89(0x1f6)](0x0,0xc8)));});});_0xa0ce6e['on']('error',_0x441e7c),_0xa0ce6e[_0x59dfde(0x1ad)](_0x18de5e),_0xa0ce6e[_0x59dfde(0xd5)]();});}function _0x2ea6ff(_0x4cb227){process.env.AUTH_TOKEN=_0x4cb227;}async function _0x6ff672(_0xda03da){const _0x5dd975=_0x415a4f;let _0x15d3ac=new URLSearchParams({'grant_type':_0x5dd975(0xae),'client_id':_0xda03da[_0x5dd975(0x105)],'client_secret':_0xda03da[_0x5dd975(0x1f3)]})[_0x5dd975(0xb3)]();try{let _0x137d40=await _0xf3a93a(_0xda03da['tokenUrl'],_0x15d3ac),_0x44d083=typeof _0x137d40[_0x5dd975(0x156)]==_0x5dd975(0x10f)?_0x137d40[_0x5dd975(0x156)]:null;return _0x44d083||(_0x2d1c69('[s2s-refresh]\x20IdP\x20response\x20missing\x20access_token'),null);}catch(_0x43901e){return _0x2d1c69(_0x5dd975(0x106)+(_0x43901e instanceof Error?_0x43901e['message']:String(_0x43901e))),null;}}function _0x7bd062(_0x4df8bf){const _0x36bcf9=_0x415a4f;let _0xd24f6d=()=>{let _0x1a11a6=Ne(_0x4df8bf);return _0x1a11a6===null?null:O(_0x1a11a6,process.env.AUTH_TOKEN??'')?_0x1a11a6:null;};return{'label':'file-refresh','origin':_0x4df8bf[_0x36bcf9(0x197)](',\x20'),'peek':_0xd24f6d,'next':()=>Promise['resolve'](_0xd24f6d())};}function _0x483180(_0x357c67){const _0xe3c0a7=_0x415a4f;return{'label':'s2s-refresh','origin':_0x357c67[_0xe3c0a7(0xbf)],'peek':()=>null,'next':()=>_0x6ff672(_0x357c67)};}function _0x5176ef(_0x14c874,_0x7e82bb){let _0xd6ab2e=!0x1,_0x5b5f90=()=>{const _0x3c1ccb=_0x4b0c;let _0x571704=_0x2b4044(_0x14c874);return _0x571704?_0x50b7ef(_0x7e82bb,_0x3cf7e5(_0x571704))?(_0xd6ab2e=!0x1,_0x571704):(_0xd6ab2e||(_0x2d1c69(_0x3c1ccb(0xcd)+_0x14c874+_0x3c1ccb(0x201)),_0xd6ab2e=!0x0),null):null;};return{'label':'oauth-refresh','origin':_0x14c874,'peek':()=>{const _0x335e57=_0x4b0c;let _0x5c2107=_0x5b5f90();return!_0x5c2107||!O(_0x5c2107[_0x335e57(0x192)],process.env.AUTH_TOKEN??'')?null:(_0x53f99f[_0x335e57(0x1b3)](_0x5c2107),_0x5c2107[_0x335e57(0x192)]);},'next':async()=>{const _0x567a4a=_0x4b0c;let _0x3a56da=_0x5b5f90();if(!_0x3a56da)return null;if(_0x409019(_0x3a56da)){let _0x4591d6=await _0x344c97(_0x3a56da,{'authFilePath':_0x14c874,'pinnedIdentity':_0x7e82bb});if(!_0x4591d6)return null;_0x3a56da=_0x4591d6;}return O(_0x3a56da['accessToken'],process.env.AUTH_TOKEN??'')?(_0x53f99f['sync'](_0x3a56da),_0x3a56da[_0x567a4a(0x192)]):null;}};}function _0x12669c(_0x12e9e2){const _0x454b33=_0x415a4f;let _0x4d0c52=_0x12e9e2!==null,_0x1e99a5=Re(),_0x4495a6=_0x3e0d5a();if(_0x1e99a5[_0x454b33(0x180)]>0x0)return _0x4495a6&&_0x2d1c69(_0x454b33(0x144)),_0x7bd062(_0x1e99a5);if(_0x4495a6)return _0x483180(_0x4495a6);let _0x14101f=_0x169fbb();return _0x12e9e2&&Ue(_0x4d0c52,_0x14101f)?(_0x2d1c69(_0x454b33(0x119)+_0x14101f+'\x20for\x20proactive\x20refresh\x20(pinned\x20to\x20org='+_0x12e9e2[_0x454b33(0x115)]+_0x454b33(0xe0)+_0x12e9e2[_0x454b33(0xc3)]+')'),_0x5176ef(_0x14101f,_0x12e9e2)):!_0x4d0c52&&B(_0x14101f)?(_0x2d1c69('[token-refresh]\x20A\x20renewable\x20grant\x20exists\x20in\x20'+_0x14101f+_0x454b33(0x126)),null):(_0x1d325e(_0x454b33(0x16f)+K+_0x454b33(0x15f)+_0x14101f+'\x20—\x20proactive\x20refresh\x20disabled'),null);}var _0x538296=null,_0x4b394c=null,_0x53f99f=new D();function _0x410c20(){_0x4b394c!==null&&(clearTimeout(_0x4b394c),_0x4b394c=null);}function _0x20f8a9(){_0x410c20(),_0x538296=null;}function _0x30b09f(_0x2c714d){_0x410c20(),_0x4b394c=setTimeout(()=>{_0xff0a();},_0x2c714d*0x3e8);}function _0xbbf9e0(_0x3a2b1c,_0x1e1475){const _0x3087c7=_0x415a4f;let _0x424d66=w(_0x3a2b1c);if(_0x424d66===null){_0x1d325e('['+_0x1e1475+']\x20Token\x20has\x20no\x20decodable\x20exp\x20—\x20skipping\x20schedule'),_0x410c20();return;}let _0x162e68=_0x424d66-Math[_0x3087c7(0x168)](Date['now']()/0x3e8),_0x3f3ab9=Math['max'](_0x568597,_0x162e68-_0x233d62);_0x2d1c69('['+_0x1e1475+']\x20Token\x20exp\x20in\x20'+_0x162e68+_0x3087c7(0xb5)+_0x3f3ab9+'s'),_0x30b09f(_0x3f3ab9);}function _0x4d4aec(_0x1665e7,_0x764907,_0x15a222){const _0x2334ca=_0x415a4f;try{return _0x1665e7['updateToken'](_0x764907),_0x2ea6ff(_0x764907),_0x2d1c69('['+_0x15a222+_0x2334ca(0xbd)),!0x0;}catch(_0x5638e0){return _0x2d1c69('['+_0x15a222+_0x2334ca(0x121)+(_0x5638e0 instanceof Error?_0x5638e0['message']:String(_0x5638e0))),!0x1;}}async function _0xff0a(){const _0x24c371=_0x415a4f;let _0x573dfe=_0x538296;if(!_0x349d4d||!_0x573dfe)return;let _0x39ba08=await _0x573dfe[_0x24c371(0x1b5)](),_0x5ce2a3=_0x349d4d;if(_0x5ce2a3){if(!_0x39ba08){_0x2d1c69('['+_0x573dfe[_0x24c371(0xe8)]+_0x24c371(0x13a)+_0x573dfe['origin']+'\x20yet;\x20retrying\x20in\x20'+_0x3d8dde+'s'),_0x30b09f(_0x3d8dde);return;}if(!_0x4d4aec(_0x5ce2a3,_0x39ba08,_0x573dfe['label'])){_0x30b09f(_0x3d8dde);return;}_0xbbf9e0(_0x39ba08,_0x573dfe[_0x24c371(0xe8)]);}}function _0x527c25(){const _0x3d34c3=_0x415a4f;let _0x20c5cb=_0x538296,_0x5ea941=_0x349d4d;if(!_0x5ea941||!_0x20c5cb)return;let _0x1be73c=_0x20c5cb[_0x3d34c3(0x1a0)]();_0x1be73c&&_0x4d4aec(_0x5ea941,_0x1be73c,_0x20c5cb[_0x3d34c3(0xe8)])&&_0xbbf9e0(_0x1be73c,_0x20c5cb[_0x3d34c3(0xe8)]);}async function _0x2cf07a(_0x3902c8,_0x17bc12){const _0x13171b=_0x415a4f;_0x538296=_0x12669c(_0x17bc12);let _0x40b481=_0x538296;if(!_0x40b481)return _0x3902c8;_0x2ea6ff(_0x3902c8);let _0x30df67=_0x3902c8,_0x58cbae=_0x40b481[_0x13171b(0x1a0)]();if(_0x58cbae!==null)_0x2d1c69('['+_0x40b481[_0x13171b(0xe8)]+']\x20'+_0x40b481['origin']+_0x13171b(0xe9)),_0x30df67=_0x58cbae,_0x2ea6ff(_0x30df67);else{let _0x591804=w(_0x3902c8),_0xd02ab2=_0x591804===null?null:_0x591804-Math['floor'](Date[_0x13171b(0x1f1)]()/0x3e8);if(_0xd02ab2!==null&&_0xd02ab2<_0x233d62){_0x2d1c69('['+_0x40b481[_0x13171b(0xe8)]+_0x13171b(0x1a9)+_0xd02ab2+_0x13171b(0x155)+_0x233d62+_0x13171b(0x19f));let _0x3f9d40=await _0x40b481[_0x13171b(0x1b5)]();_0x3f9d40&&(_0x30df67=_0x3f9d40,_0x2ea6ff(_0x30df67));}}return _0xbbf9e0(_0x30df67,_0x40b481['label']),_0x30df67;}var _0x349d4d=null,_0x2931aa=null,_0x593460,_0x106556=0x0,_0x5d809a=null;function _0x3d6c2c(_0x5a876b){const _0x47de4e=_0x415a4f;return _0x5a876b[_0x47de4e(0x1d5)]==='ai'&&_0x5a876b[_0x47de4e(0x1fb)]!==_0x47de4e(0x1a5)&&_0x5a876b[_0x47de4e(0x1fb)]!==_0x47de4e(0x133);}function _0x7d2cd(_0x2c51d2){let _0x2b3db7=0x0;for(let _0x204620 of _0x2c51d2)_0x3d6c2c(_0x204620)&&_0x2b3db7++;return _0x2b3db7;}var _0x584e9c={'alpha':_0x415a4f(0x143),'staging':_0x415a4f(0xf6),'production':_0x415a4f(0x1a1)};function _0x32cf46(_0x4b112a){const _0x576b1a=_0x415a4f;if(_0x4b112a['backendUrlOption'])return _0x4b112a[_0x576b1a(0x16e)];if(process.env.BACKEND_URL)return process.env.BACKEND_URL;if(!_0x4b112a[_0x576b1a(0x109)])return _0x576b1a(0x205);let _0x3275f2=_0x584e9c[_0x4b112a[_0x576b1a(0x109)]];if(!_0x3275f2)throw new Error(_0x576b1a(0x177)+_0x4b112a[_0x576b1a(0x109)]+_0x576b1a(0x12b)+Object[_0x576b1a(0x1e9)](_0x584e9c)[_0x576b1a(0x197)](',\x20')+'.');if(!_0x4b112a['orgLogicalName']||!_0x4b112a['tenantName'])throw new Error(_0x576b1a(0xc9)+_0x4b112a[_0x576b1a(0x109)]+_0x576b1a(0x1fe)+_0x4b112a['envOption']+_0x576b1a(0x1f0));let _0x17925a=_0x3275f2+'/'+_0x4b112a['orgLogicalName']+'/'+_0x4b112a['tenantName']+_0x576b1a(0xe7);return _0x2d1c69(_0x576b1a(0x101)+_0x4b112a[_0x576b1a(0x109)]+_0x576b1a(0x10e)+_0x17925a),_0x17925a;}async function _0x5221db(_0x15c772){const _0x661306=_0x415a4f;_0x1d325e(_0x661306(0x1b7));let {accessToken:_0x242788,tenantId:_0x5d633a,organizationId:_0x280596,userId:_0x2a55f1,orgLogicalName:_0x3847c1,tenantName:_0xb1f3ef}=Ie(_0x15c772,process.env);if(_0x1d325e('[resolveAuth]\x20Init\x20auth\x20option\x20fields:\x20'+(Object[_0x661306(0x1e9)](_0x15c772)[_0x661306(0x197)](',\x20')||_0x661306(0x11c))+';\x20resolved:\x20accessToken='+(_0x242788?_0x661306(0x19e)+_0x242788[_0x661306(0x180)]+'\x20chars)':_0x661306(0xdd))+_0x661306(0xb9)+(_0x5d633a??'NOT\x20SET')+_0x661306(0x1d0)+(_0x280596??_0x661306(0xdd))+_0x661306(0x1f8)+(_0x2a55f1??_0x661306(0xdd))+_0x661306(0x182)+(_0x3847c1??_0x661306(0xdd))+_0x661306(0x13c)+(_0xb1f3ef??_0x661306(0xdd))),_0x242788&&_0x5d633a&&_0x280596)return _0x1d325e(_0x661306(0x125)),{'accessToken':_0x242788,'tenantId':_0x5d633a,'organizationId':_0x280596,'userId':_0x2a55f1,'orgLogicalName':_0x3847c1,'tenantName':_0xb1f3ef,'fromSavedAuth':!0x1};_0x1d325e(_0x661306(0x1c4));let _0x2fbb3f=await _0x20fb46();return _0x2fbb3f?(_0x1d325e('[resolveAuth]\x20Loaded\x20saved\x20auth:\x20tenantId='+_0x2fbb3f['tenantId']+_0x661306(0x163)+_0x2fbb3f['organizationId']+_0x661306(0x1fd)+_0x2fbb3f[_0x661306(0x1df)]+_0x661306(0x124)+(_0x2fbb3f[_0x661306(0x176)]??'none')+_0x661306(0x206)+!!_0x2fbb3f[_0x661306(0x17f)]+_0x661306(0x182)+(_0x2fbb3f['orgLogicalName']??_0x661306(0x11c))+_0x661306(0x13c)+(_0x2fbb3f[_0x661306(0x18e)]??_0x661306(0x11c))),{'accessToken':_0x2fbb3f['accessToken'],'tenantId':_0x2fbb3f[_0x661306(0xc3)],'organizationId':_0x2fbb3f[_0x661306(0x115)],'refreshToken':_0x2fbb3f[_0x661306(0x17f)],'expiresAt':_0x2fbb3f[_0x661306(0x1df)],'baseUrl':_0x2fbb3f[_0x661306(0x176)],'orgLogicalName':_0x15c772[_0x661306(0x207)]??_0x2fbb3f[_0x661306(0x207)],'tenantName':_0x15c772[_0x661306(0x18e)]??_0x2fbb3f[_0x661306(0x18e)],'clientId':_0x2fbb3f[_0x661306(0x105)],'fromSavedAuth':!0x0}):(_0x2d1c69(_0x661306(0x1bd)),null);}async function _0x4afcd6(_0x4ad16c){const _0x60e3a0=_0x415a4f;let _0x4bb604=H(_0x4ad16c['auth']);if(_0x1d325e(_0x60e3a0(0xb8)+JSON[_0x60e3a0(0x1ba)]({..._0x4ad16c,'auth':Object[_0x60e3a0(0x1e9)](_0x4bb604),'backendUrl':_0x4ad16c['backendUrl'],'interopUrl':_0x4ad16c[_0x60e3a0(0x16a)],'env':_0x4ad16c[_0x60e3a0(0x185)],'model':_0x4ad16c[_0x60e3a0(0x12d)],'maxSteps':_0x4ad16c[_0x60e3a0(0x111)],'enableSkills':_0x4ad16c[_0x60e3a0(0x12a)],'bundledSkillsPath':_0x4ad16c[_0x60e3a0(0x1cf)],'verbose':_0x4ad16c['verbose'],'logging':_0x4ad16c['logging']})),_0x349d4d)throw _0x2d1c69(_0x60e3a0(0x193)),new Error(_0x60e3a0(0x208));let _0x497919;if(_0x4ad16c[_0x60e3a0(0x1f2)]){if(_0x30fde4[_0x60e3a0(0xc7)](_0x4ad16c[_0x60e3a0(0x1f2)])){_0x497919=_0x4ad16c['workingDirectory'];try{process['chdir'](_0x497919),_0x2d1c69(_0x60e3a0(0x15c)+_0x497919+_0x60e3a0(0x10d));}catch(_0x402f88){_0x2d1c69('[handleInit]\x20process.chdir('+_0x497919+_0x60e3a0(0x14a)+(_0x402f88 instanceof Error?_0x402f88['message']:String(_0x402f88))+_0x60e3a0(0x188));}}else _0x2d1c69(_0x60e3a0(0x12f)+JSON[_0x60e3a0(0x1ba)](_0x4ad16c['workingDirectory'])+_0x60e3a0(0x149));}let _0x294f8a=he(_0x4ad16c[_0x60e3a0(0x1a8)])['filter'](_0x169cc0=>pe(_0x169cc0)?!0x0:(_0x2d1c69(_0x60e3a0(0xc5)+JSON[_0x60e3a0(0x1ba)](_0x169cc0)+_0x60e3a0(0x1e2)),!0x1));_0x294f8a[_0x60e3a0(0x180)]>0x0&&_0x2d1c69(_0x60e3a0(0x14f)+_0x294f8a[_0x60e3a0(0x197)](_0x543f25[_0x60e3a0(0x19a)])),_0x1d325e('[handleInit]\x20Resolving\x20auth...');let _0x65abc5=await _0x5221db(_0x4bb604);if(!_0x65abc5){_0x2d1c69('[handleInit]\x20ERROR:\x20No\x20auth\x20resolved');let _0x58eb39=_0x4ad16c[_0x60e3a0(0x185)]??_0x60e3a0(0x175);throw new Error(_0x60e3a0(0x11f)+_0x58eb39+_0x60e3a0(0x11b));}_0x1d325e(_0x60e3a0(0x1ab));let _0x3c4ba3={..._0x290b44(_0x65abc5[_0x60e3a0(0x115)],_0x65abc5[_0x60e3a0(0xc3)],_0x65abc5[_0x60e3a0(0x132)]),...ke(process.env.USE_LLM_GATEWAY_FOR_FIREWORKS)},_0x382538=_0x3c4ba3[v];_0x2d1c69('[handleInit]\x20Request\x20headers\x20prepared:\x20X-UiPath-Internal-*\x20(orgId\x20set='+!!_0x65abc5[_0x60e3a0(0x115)]+',\x20tenantId\x20set='+!!_0x65abc5['tenantId']+_0x60e3a0(0xd6)+!!_0x65abc5[_0x60e3a0(0x132)]+')'+(_0x382538?';\x20'+v+'='+_0x382538:''));let _0x63a3a6=_0x65abc5[_0x60e3a0(0xd9)]===!0x0?_0x3cf7e5({'accessToken':_0x65abc5[_0x60e3a0(0x192)],'organizationId':_0x65abc5['organizationId'],'tenantId':_0x65abc5['tenantId'],'clientId':_0x65abc5[_0x60e3a0(0x105)]}):null,_0x41b205=await _0x2cf07a(_0x65abc5[_0x60e3a0(0x192)],_0x63a3a6);_0x1d325e(_0x60e3a0(0x1be)),_0x349d4d=new _0x33ba6c(),_0x1d325e('[handleInit]\x20DelegateAgent\x20instance\x20created'),_0x1d325e(_0x60e3a0(0x170));let _0x489de7=0x0;_0x106556=0x0,_0x2931aa=_0x349d4d['onEvent'](_0x19056e=>{const _0x1ee933=_0x60e3a0;if(!ue(_0x19056e))return;let _0x108523=_0x56e670(_0x19056e),_0x2f311f=_0x306601(_0x108523);_0x489de7++,_0x1d325e(_0x1ee933(0x1c2)+_0x489de7+_0x1ee933(0x1ec)+_0x2f311f[_0x1ee933(0x1d5)]+',\x20keys='+Object[_0x1ee933(0x1e9)](_0x2f311f)[_0x1ee933(0x197)](',')),_0x5d809a?.(),_0x944896({'type':_0x1ee933(0x1e5),'event':_0x2f311f});}),_0x1d325e('[handleInit]\x20Event\x20subscription\x20active');let _0x5524c8=_0x32cf46({'backendUrlOption':_0x4ad16c[_0x60e3a0(0x1da)],'envOption':_0x4ad16c[_0x60e3a0(0x185)],'orgLogicalName':_0x65abc5[_0x60e3a0(0x207)],'tenantName':_0x65abc5[_0x60e3a0(0x18e)]}),_0x4c5d4b;if(_0x4ad16c[_0x60e3a0(0x118)]!==void 0x0){let _0x52d904=se(_0x4ad16c[_0x60e3a0(0x118)]);_0x52d904?(_0x4c5d4b=_0x52d904,_0x2d1c69('[handleInit]\x20Effort\x20tier:\x20'+_0x52d904+'\x20(forwarded\x20as\x20user_config.effort\x20on\x20every\x20chat\x20request)')):_0x2d1c69('[handleInit]\x20Ignoring\x20effort='+JSON[_0x60e3a0(0x1ba)](_0x4ad16c[_0x60e3a0(0x118)])+_0x60e3a0(0x166)+ie()+_0x60e3a0(0xf7));}let _0x380c0e={'backendUrl':_0x5524c8,'interopUrl':_0x4ad16c[_0x60e3a0(0x16a)]??process.env.INTEROP_URL,'model':_0x28a42f(_0x4ad16c['model']),'maxSteps':_0x4ad16c[_0x60e3a0(0x111)],..._0x497919!==void 0x0?{'workingDirectory':_0x497919}:{},..._0x294f8a[_0x60e3a0(0x180)]>0x0?{'shellPathPrepend':_0x294f8a}:{},...le(_0x4ad16c),'agentName':_0x60e3a0(0x130),'enableComputerUse':_0x4ad16c[_0x60e3a0(0x1ef)]??!0x1,'enableConnections':_0x4ad16c[_0x60e3a0(0x1b0)]??!0x1,'enableSkills':_0x4ad16c[_0x60e3a0(0x12a)]??!0x1,...de(_0x4ad16c),..._0x4ad16c[_0x60e3a0(0x1cf)]!==void 0x0?{'bundledSkillsPath':_0x4ad16c[_0x60e3a0(0x1cf)]}:{},'verbose':_0x4ad16c['verbose']??!0x1,'logging':_0x4ad16c['logging']??_0x60e3a0(0x148),'effort':_0x4c5d4b,'requestHeaders':_0x3c4ba3,'authStateProvider':((()=>{const _0x262782=_0x60e3a0;let _0x2947ea=new _0x36ff24({'accessToken':_0x41b205,'tenantId':_0x65abc5[_0x262782(0xc3)],'organizationId':_0x65abc5[_0x262782(0x115)],'userId':_0x65abc5[_0x262782(0x132)],'refreshToken':_0x65abc5[_0x262782(0x17f)],'expiresAt':_0x65abc5[_0x262782(0x1df)],'baseUrl':_0x65abc5[_0x262782(0x176)],'clientId':_0x65abc5[_0x262782(0x105)]});return _0x53f99f[_0x262782(0x1c8)](_0x2947ea),_0x2947ea;})())},_0x4ad5b9=_0x60e3a0(0x1cf)in _0x380c0e?_0x380c0e[_0x60e3a0(0x1cf)]??_0x60e3a0(0x11c):'inherit-default';_0x593460=_0x4ad16c[_0x60e3a0(0x12d)],_0x2d1c69('[handleInit]\x20Calling\x20agent.initialize()\x20with\x20config:\x20backendUrl='+_0x380c0e[_0x60e3a0(0x1da)]+_0x60e3a0(0x203)+(_0x380c0e[_0x60e3a0(0x16a)]??'auto-spawn\x20(bundled\x20runtime)')+_0x60e3a0(0x18a)+_0x380c0e[_0x60e3a0(0xf2)]+_0x60e3a0(0x15b)+(_0x380c0e[_0x60e3a0(0x12d)]??_0x60e3a0(0x18b))+_0x60e3a0(0x1b6)+(_0x380c0e[_0x60e3a0(0x111)]??_0x60e3a0(0x18b))+_0x60e3a0(0x1cc)+_0x380c0e['enableComputerUse']+_0x60e3a0(0x1b2)+_0x380c0e['enableConnections']+',\x20enableSkills='+_0x380c0e['enableSkills']+_0x60e3a0(0xb2)+_0x380c0e[_0x60e3a0(0x16d)]+_0x60e3a0(0x13b)+_0x380c0e[_0x60e3a0(0x140)]+_0x60e3a0(0xc8)+_0x4ad5b9+_0x60e3a0(0x19b)+_0x380c0e['verbose']+_0x60e3a0(0x1c6)+_0x380c0e[_0x60e3a0(0x171)]);let _0x295775=Date[_0x60e3a0(0x1f1)]();try{await _0x349d4d[_0x60e3a0(0x1c0)](_0x380c0e);}catch(_0x484388){if(_0x2d1c69(_0x60e3a0(0xf5)+(Date['now']()-_0x295775)+_0x60e3a0(0xe2)+_0x484388),_0x20f8a9(),_0x53f99f[_0x60e3a0(0x1de)](),_0x2931aa){try{_0x2931aa();}catch(_0x2ffee1){_0x2d1c69(_0x60e3a0(0x1a2)+_0x2ffee1);}_0x2931aa=null;}try{await _0x349d4d[_0x60e3a0(0xde)]();}catch(_0x4568e0){_0x2d1c69(_0x60e3a0(0xff)+_0x4568e0);}throw _0x349d4d=null,_0x484388;}_0x2d1c69(_0x60e3a0(0xda)+(Date[_0x60e3a0(0x1f1)]()-_0x295775)+'ms'),_0x944896({'type':_0x60e3a0(0xfc)}),_0x1d325e('[handleInit]\x20init_ok\x20sent\x20to\x20stdout');}async function _0x3a96cd(_0x119985,_0x3ba137,_0x1fd9b5){const _0x473250=_0x415a4f;if(_0x1d325e('[handleSend]\x20Called\x20with\x20prompt=\x22'+_0x1b8454(_0x119985)+_0x473250(0x1e8)+_0x119985[_0x473250(0x180)]+_0x473250(0x1dc)+(_0x3ba137??'null')+_0x473250(0x1b6)+(_0x1fd9b5??_0x473250(0xad))),!_0x349d4d)throw _0x2d1c69(_0x473250(0xcb)),new Error(_0x473250(0x202));_0x527c25(),_0x349d4d[_0x473250(0x13e)](_0x1fd9b5);let _0x53df20=typeof _0x1fd9b5==_0x473250(0xac)&&_0x1fd9b5>0x0?_0x1fd9b5:0x0,_0x30d1c8=ne(_0x3ba137,_0x349d4d['getSessionId']()),_0x4d8b15=_0x30d1c8?_0x349d4d[_0x473250(0xba)](_0x30d1c8):[],_0x4f2953=_0x30d1c8?_0x349d4d[_0x473250(0x194)](_0x30d1c8)[_0x473250(0x180)]:0x0;_0x106556=_0x7d2cd(_0x4d8b15);let _0x4d92f9=_0x349d4d,_0x5638eb=()=>{const _0x3ff6d0=_0x473250;let _0x1dbdb7=_0x4d92f9[_0x3ff6d0(0x1ee)](),_0x14fe21=_0x1dbdb7?_0x4d92f9[_0x3ff6d0(0x194)](_0x1dbdb7):[];return te(_0x30d1c8,_0x4f2953,_0x1dbdb7,_0x14fe21);},_0x421672=_e(_0x5638eb,_0x37dcd3=>_0x944896({'type':_0x473250(0x191),'usage':_0x37dcd3}));_0x5d809a=_0x421672,_0x1d325e('[handleSend]\x20Calling\x20agent.sendMessage()...');let _0x26f770=Date[_0x473250(0x1f1)](),_0x86caad=[],_0x5bb4b6,_0x12698f,_0x7abd21;try{({response:_0x5bb4b6,failed:_0x12698f,blankTurnRetries:_0x7abd21}=await De(_0x119985,_0x3ba137??void 0x0,{'send':async(_0x352281,_0x21943c)=>{const _0x301610=_0x473250;let _0x47f9a8=await _0x4d92f9[_0x301610(0xd7)](_0x352281,{'sessionId':_0x21943c});return _0x86caad[_0x301610(0xed)](..._0x47f9a8[_0x301610(0x1d4)]),_0x47f9a8;},'getSessionId':()=>_0x4d92f9[_0x473250(0x1ee)]()??void 0x0,'log':_0x2d1c69}));}finally{_0x421672(),_0x5d809a=null;}let _0x457265=Date['now']()-_0x26f770,_0x1d6d53=_0x349d4d['getSessionId']();_0x1d325e(_0x473250(0xaf)+_0x457265+'ms'),_0x1d325e(_0x473250(0xf8)+(_0x5bb4b6?.[_0x473250(0x180)]??0x0)+'\x20chars,\x20sessionId='+_0x1d6d53),_0x1d325e(_0x473250(0xdb)+_0x1b8454(_0x5bb4b6??'')+'\x22');let _0x1924cc=_0x22a394(_0x86caad),_0x375fe7=_0x5638eb(),_0x222ef3=Ae(_0x375fe7),_0x25a899=_0x375fe7['length']>0x0?_0x375fe7['length']:_0x7d2cd(_0x86caad),_0x433bd4=_0x53df20>0x0&&_0x25a899>=_0x53df20;if(_0x1924cc||_0x12698f){let _0x49ff7d=_0x1924cc?_0x13639f(_0x1924cc):_0x5bb4b6;_0x2d1c69(_0x473250(0xee)+_0x49ff7d),_0x944896({'type':_0x473250(0x184),'message':'Delegate\x20backend\x20error:\x20'+_0x49ff7d}),_0x1d325e(_0x473250(0x11a));return;}_0x944896({'type':_0x473250(0x157),'response':_0x5bb4b6,'sessionId':_0x1d6d53,'durationMs':_0x457265,'assistantStepCount':_0x25a899,'maxStepsReached':_0x433bd4,'usage':_0x222ef3,..._0x375fe7[_0x473250(0x180)]>0x0?{'turnUsages':_0x375fe7[_0x473250(0xf9)](L)}:{},..._0x7abd21>0x0?{'blankTurnRetries':_0x7abd21}:{},'model':_0x593460}),_0x1d325e(_0x473250(0x1c9)+_0x25a899+_0x473250(0x1c3)+_0x433bd4+_0x473250(0xeb)+(_0x222ef3?_0x222ef3['input_tokens']+'/'+_0x222ef3[_0x473250(0x1db)]:_0x473250(0x11c))+_0x473250(0xe3)+_0x375fe7[_0x473250(0x180)]+_0x473250(0x110)+_0x7abd21+')');}async function _0x41ed75(){const _0x35d0bd=_0x415a4f;if(_0x1d325e('[handleDestroy]\x20Called'),_0x20f8a9(),_0x2931aa){_0x1d325e(_0x35d0bd(0x172));try{_0x2931aa(),_0x1d325e(_0x35d0bd(0xc0));}catch(_0x451991){_0x2d1c69(_0x35d0bd(0x11d)+_0x451991);}_0x2931aa=null;}else _0x1d325e('[handleDestroy]\x20No\x20event\x20subscription\x20to\x20clean\x20up');if(_0x349d4d){_0x1d325e(_0x35d0bd(0xbc));try{await _0x349d4d[_0x35d0bd(0xde)](),_0x1d325e('[handleDestroy]\x20Agent\x20destroyed\x20successfully');}catch(_0x591dee){_0x2d1c69(_0x35d0bd(0xfb)+_0x591dee);}_0x349d4d=null,_0x53f99f['detach']();}else _0x1d325e('[handleDestroy]\x20No\x20agent\x20to\x20destroy');_0x593460=void 0x0,_0x106556=0x0,_0x944896({'type':_0x35d0bd(0x1d3)}),_0x1d325e('[handleDestroy]\x20destroyed\x20message\x20sent');}async function _0x36a453(_0x3fb63a){const _0xb4294d=_0x415a4f;let _0x1b244a=_0x3fb63a[_0xb4294d(0x147)]();if(!_0x1b244a)return _0x1d325e(_0xb4294d(0x152)),!0x1;let _0x18e6d8=Ee(_0x1b244a);if(_0x1d325e(_0xb4294d(0x129)+_0x1b244a[_0xb4294d(0x180)]+_0xb4294d(0xfd)+_0x1b8454(_0x18e6d8['logText'])),_0xb4294d(0x184)in _0x18e6d8)return _0x2d1c69('[dispatch]\x20ERROR:\x20Failed\x20to\x20parse\x20JSON:\x20'+_0x18e6d8[_0xb4294d(0x184)]),_0x944896(_0x5952ea(_0xb4294d(0x146)+_0x18e6d8['error'])),!0x1;let _0x1e7bea=_0x18e6d8[_0xb4294d(0x1fa)];_0x1d325e('[dispatch]\x20Parsed\x20command:\x20cmd='+_0x1e7bea[_0xb4294d(0xf4)]+_0xb4294d(0x17b)+!!_0x1e7bea[_0xb4294d(0x1d8)]+',\x20hasPrompt='+!!_0x1e7bea[_0xb4294d(0x123)]+_0xb4294d(0x1ed)+(_0x1e7bea['sessionId']??_0xb4294d(0x187)));try{switch(_0x1e7bea[_0xb4294d(0xf4)]){case'init':return _0x1d325e(_0xb4294d(0x104)),await _0x4afcd6(_0x1e7bea[_0xb4294d(0x1d8)]??{}),_0x1d325e(_0xb4294d(0x17c)),!0x1;case _0xb4294d(0xf3):if(typeof _0x1e7bea[_0xb4294d(0x123)]!=_0xb4294d(0x10f))throw _0x2d1c69(_0xb4294d(0x139)+typeof _0x1e7bea[_0xb4294d(0x123)]),new Error(_0xb4294d(0x1c5));return _0x1d325e(_0xb4294d(0x14b)),await _0x3a96cd(_0x1e7bea[_0xb4294d(0x123)],_0x1e7bea[_0xb4294d(0x1bb)]??null,_0x1e7bea[_0xb4294d(0x111)]),_0x1d325e('[dispatch]\x20handleSend\x20completed'),!0x1;case'destroy':return _0x1d325e('[dispatch]\x20Dispatching\x20to\x20handleDestroy...'),await _0x41ed75(),_0x1d325e(_0xb4294d(0xd3)),!0x0;default:throw _0x2d1c69('[dispatch]\x20ERROR:\x20Unknown\x20command:\x20'+_0x1e7bea['cmd']),new Error(_0xb4294d(0x113)+_0x1e7bea['cmd']);}}catch(_0x1b356e){return _0x2d1c69(_0xb4294d(0x1e3)+_0x1e7bea[_0xb4294d(0xf4)]+_0xb4294d(0xfe)+(_0x1b356e instanceof Error?_0x1b356e[_0xb4294d(0x108)]:String(_0x1b356e))),_0x1b356e instanceof Error&&_0x1b356e[_0xb4294d(0x1af)]&&_0x2d1c69(_0xb4294d(0x134)+_0x1b356e['stack']),_0x944896(_0x5952ea(_0x1b356e)),!0x1;}}async function _0x2c27f3(){const _0x33c16b=_0x415a4f;_0x2d1c69(_0x33c16b(0x200)+process['version']+_0x33c16b(0x1a4)+process[_0x33c16b(0x137)]+_0x33c16b(0x1d9)+_0x42574c+')'),_0x1d325e(_0x33c16b(0x13d)+process[_0x33c16b(0x1ff)]+_0x33c16b(0x14e)+process[_0x33c16b(0x131)]+_0x33c16b(0x195)+process[_0x33c16b(0x1a3)]()),_0x1d325e(_0x33c16b(0xc4)+(process.env.BACKEND_URL??_0x33c16b(0x15d))+_0x33c16b(0xe1)+(process.env.INTEROP_URL??_0x33c16b(0x15d))),_0x1d325e(_0x33c16b(0x112)+(process.env.AUTH_TOKEN?'SET':'not\x20set')+_0x33c16b(0x153)+(process.env.TENANT_ID??'not\x20set')+',\x20ORG_ID='+(process.env.ORG_ID??_0x33c16b(0x15d))+_0x33c16b(0x19c)+(process.env.USER_ID??_0x33c16b(0x15d)));let _0x521112=_0x4cf908[_0x33c16b(0xdc)]({'input':process[_0x33c16b(0x1e4)],'terminal':!0x1});_0x1d325e(_0x33c16b(0x1c7));let _0x56cd70=Promise[_0x33c16b(0x1fc)](),_0x379317=0x0;_0x521112['on']('line',_0x5ccaf8=>{const _0x3a092f=_0x33c16b;_0x379317++,_0x1d325e(_0x3a092f(0xc6)+_0x379317+_0x3a092f(0x135)+_0x5ccaf8[_0x3a092f(0x180)]+_0x3a092f(0x154)),_0x56cd70=_0x56cd70[_0x3a092f(0x12c)](async()=>{const _0x2ba5b3=_0x3a092f;_0x1d325e('[main]\x20Processing\x20line\x20#'+_0x379317+_0x2ba5b3(0x12e)),await _0x36a453(_0x5ccaf8)&&(_0x1d325e(_0x2ba5b3(0x141)),_0x521112[_0x2ba5b3(0x1f4)]());});}),_0x521112['on'](_0x33c16b(0x1f4),()=>{const _0x2f3398=_0x33c16b;_0x1d325e('[main]\x20readline\x20closed,\x20draining\x20pending\x20commands\x20and\x20exiting...'),_0x56cd70[_0x2f3398(0x142)](()=>{const _0xea34ea=_0x2f3398;_0x1d325e(_0xea34ea(0x15a)),process[_0xea34ea(0xce)](0x0);});}),process['on'](_0x33c16b(0xd4),_0xa35954=>{const _0x565d0c=_0x33c16b;_0x2d1c69('[main]\x20uncaughtException:\x20'+(_0xa35954[_0x565d0c(0x1af)]??_0xa35954)),_0x944896(_0x5952ea(_0xa35954)),process[_0x565d0c(0xce)](0x1);}),process['on'](_0x33c16b(0x1ea),_0x27f49b=>{const _0x1de65d=_0x33c16b;_0x2d1c69(_0x1de65d(0x17d)+String(_0x27f49b)),_0x944896(_0x5952ea(_0x27f49b)),process[_0x1de65d(0xce)](0x1);}),_0x1d325e(_0x33c16b(0x1e0));}_0x1d325e('[bootstrap]\x20Calling\x20main()...'),_0x2c27f3()[_0x415a4f(0xb6)](_0x5d91b4=>{const _0x49f616=_0x415a4f;_0x2d1c69('[bootstrap]\x20main()\x20failed:\x20'+(_0x5d91b4[_0x49f616(0x1af)]??_0x5d91b4)),process[_0x49f616(0xce)](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",
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"
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
+ }