@uipath/delegate-stdio 1.202.1 → 1.204.0-preview.20261005123254

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 _0x460213=_0x5b62;(function(_0x590f7d,_0x7ed49e){const _0x828ab6=_0x5b62,_0x4d4489=_0x590f7d();while(!![]){try{const _0x5faa14=parseInt(_0x828ab6(0x14a))/0x1+parseInt(_0x828ab6(0x234))/0x2*(-parseInt(_0x828ab6(0x145))/0x3)+parseInt(_0x828ab6(0x1ca))/0x4*(-parseInt(_0x828ab6(0x21f))/0x5)+parseInt(_0x828ab6(0x25d))/0x6+-parseInt(_0x828ab6(0x1c2))/0x7*(parseInt(_0x828ab6(0x21d))/0x8)+-parseInt(_0x828ab6(0x18e))/0x9*(-parseInt(_0x828ab6(0x27a))/0xa)+parseInt(_0x828ab6(0x12b))/0xb*(-parseInt(_0x828ab6(0x258))/0xc);if(_0x5faa14===_0x7ed49e)break;else _0x4d4489['push'](_0x4d4489['shift']());}catch(_0x5feffe){_0x4d4489['push'](_0x4d4489['shift']());}}}(_0xa036,0xd7cf6));var p=(_0x325a7e,_0x4587d5)=>()=>(_0x325a7e&&(_0x4587d5=_0x325a7e(_0x325a7e=0x0)),_0x4587d5),He=(_0x3cb2cd,_0x2c70dc)=>()=>(_0x2c70dc||_0x3cb2cd((_0x2c70dc={'exports':{}})[_0x460213(0x238)],_0x2c70dc),_0x2c70dc[_0x460213(0x238)]);function ne(_0x193c5d,_0x27ae60){return _0x193c5d??_0x27ae60;}function te(_0x101d31,_0x5c5db5,_0x1214d9,_0x2edb4f){const _0x67cc3=_0x460213;return _0x1214d9===_0x101d31?_0x2edb4f[_0x67cc3(0x1b7)](_0x5c5db5):_0x2edb4f[_0x67cc3(0x1b7)]();}var re=p(()=>{});function se(_0x565aba){const _0x2080d9=_0x460213;return typeof _0x565aba!=_0x2080d9(0x18c)?null:oe['includes'](_0x565aba)?_0x565aba:null;}function ie(){const _0x5a0b96=_0x460213;return oe[_0x5a0b96(0x27c)](',\x20');}var oe,ae=p(()=>{const _0xa30334=_0x460213;oe=[_0xa30334(0x163),_0xa30334(0x270),_0xa30334(0x22b),_0xa30334(0x1be),_0xa30334(0x177)];});function le(_0xd1e0fa){const _0x5dc27f=_0x460213;return{..._0xd1e0fa[_0x5dc27f(0x271)]?{'projectId':_0xd1e0fa[_0x5dc27f(0x271)]}:{},..._0xd1e0fa[_0x5dc27f(0x12e)]?{'sessionId':_0xd1e0fa[_0x5dc27f(0x12e)]}:{}};}var ce=p(()=>{});function de(_0x3ae474){const _0x30a221=_0x460213;return{'enableMemory':_0x3ae474[_0x30a221(0x1b2)]??!0x1,'validateModel':_0x3ae474['validateModel']??!0x1};}function ue(_0x440770){const _0x1d5b41=_0x460213;return _0x440770[_0x1d5b41(0x25f)]!==_0x1d5b41(0x1f0);}var ge=p(()=>{});import*as _0x42b8b8 from'fs';function he(_0x56b77a){const _0x40fa45=_0x460213;if(!Array[_0x40fa45(0x21e)](_0x56b77a))return[];let _0x4bd4fe=[];for(let _0x4d7748 of _0x56b77a){if(typeof _0x4d7748!=_0x40fa45(0x18c))continue;let _0xa37a79=_0x4d7748[_0x40fa45(0x136)]();_0xa37a79[_0x40fa45(0x140)]>0x0&&_0x4bd4fe[_0x40fa45(0x1a7)](_0xa37a79);}return _0x4bd4fe;}function pe(_0x3258d0){const _0x15d9c7=_0x460213;try{return _0x42b8b8[_0x15d9c7(0x13d)](_0x3258d0)[_0x15d9c7(0x186)]();}catch{return!0x1;}}var me=p(()=>{});function ke(_0x2c77c8){const _0xe2617=_0x460213;if(_0x2c77c8===void 0x0)return{};let _0x3d3538=_0x2c77c8[_0xe2617(0x136)]()[_0xe2617(0x230)]();return Ke[_0xe2617(0x245)](_0x3d3538)?{[v]:_0xe2617(0x1bd)}:Be['has'](_0x3d3538)?{[v]:_0xe2617(0x24a)}:{};}var v,Ke,Be,Te=p(()=>{const _0x5ef23d=_0x460213;v=_0x5ef23d(0x142),Ke=new Set([_0x5ef23d(0x1bd),'1',_0x5ef23d(0x1ee),'on']),Be=new Set([_0x5ef23d(0x24a),'0','no',_0x5ef23d(0x1a6)]);});function H(_0x102150){const _0x2352c7=_0x460213;if(typeof _0x102150!=_0x2352c7(0x205)||_0x102150===null)return{};let _0x7c2f1c=_0x102150,_0x16f72c={};for(let _0x1f8f28 of Se){let _0x504b2b=_0x7c2f1c[_0x1f8f28];typeof _0x504b2b==_0x2352c7(0x18c)&&_0x504b2b[_0x2352c7(0x136)]()!==''&&(_0x16f72c[_0x1f8f28]=_0x504b2b[_0x2352c7(0x136)]());}return _0x16f72c;}function je(_0x4e91eb){const _0x55ab8a=_0x460213;if(typeof _0x4e91eb!='object'||_0x4e91eb===null)return _0x4e91eb;let {options:_0x2e1ee0}=_0x4e91eb;return typeof _0x2e1ee0!='object'||_0x2e1ee0===null||!(_0x55ab8a(0x1d8)in _0x2e1ee0)?_0x4e91eb:{..._0x4e91eb,'options':{..._0x2e1ee0,'auth':Object[_0x55ab8a(0x1f4)](H(_0x2e1ee0['auth']))}};}function Ee(_0x31aa27){const _0x86d4ee=_0x460213;try{let _0x41614c=JSON[_0x86d4ee(0x22d)](_0x31aa27);return{'command':_0x41614c,'logText':JSON['stringify'](je(_0x41614c))};}catch(_0x2ddaee){return{'error':_0x2ddaee,'logText':_0x86d4ee(0x169)};}}function Ie(_0x19deda,_0x2f56bb){let _0x4b106e={};for(let _0x313783 of Se){let _0x18e239=_0x19deda[_0x313783]??_0x2f56bb[ye[_0x313783]];_0x18e239!==void 0x0&&(_0x4b106e[_0x313783]=_0x18e239);}return _0x4b106e;}var ye,Se,be=p(()=>{const _0x1fed59=_0x460213;ye={'accessToken':'AUTH_TOKEN','tenantId':_0x1fed59(0x26a),'organizationId':_0x1fed59(0x229),'userId':_0x1fed59(0x1e7),'orgLogicalName':'ORG_LOGICAL_NAME','tenantName':_0x1fed59(0x18f)},Se=Object[_0x1fed59(0x1f4)](ye);});function L(_0xd7a34b){const _0x30176d=_0x460213;let _0x4e89db=_0xd7a34b[_0x30176d(0x1bf)]??0x0,_0xf5f63c=_0xd7a34b[_0x30176d(0x15f)]??0x0,_0x382abc=_0xd7a34b[_0x30176d(0x23d)]??0x0;return{'input_tokens':Math[_0x30176d(0x177)](0x0,_0x4e89db-_0xf5f63c-_0x382abc),'output_tokens':_0xd7a34b[_0x30176d(0x1ce)]??0x0,'cache_creation_input_tokens':_0x382abc,'cache_read_input_tokens':_0xf5f63c};}function Ae(_0x597631){const _0xc9f8d0=_0x460213;return _0x597631[_0xc9f8d0(0x140)]===0x0?null:_0x597631[_0xc9f8d0(0x218)](L)[_0xc9f8d0(0x20b)]((_0x44ce62,_0x38628d)=>({'input_tokens':_0x44ce62[_0xc9f8d0(0x249)]+_0x38628d[_0xc9f8d0(0x249)],'output_tokens':_0x44ce62[_0xc9f8d0(0x24d)]+_0x38628d[_0xc9f8d0(0x24d)],'cache_creation_input_tokens':_0x44ce62[_0xc9f8d0(0x154)]+_0x38628d[_0xc9f8d0(0x154)],'cache_read_input_tokens':_0x44ce62[_0xc9f8d0(0x1a3)]+_0x38628d[_0xc9f8d0(0x1a3)]}));}function _e(_0x5469e6,_0x51990a){let _0x422fd9=0x0;return()=>{let _0x5be333=_0x5469e6();for(;_0x422fd9<_0x5be333['length'];_0x422fd9++)_0x51990a(L(_0x5be333[_0x422fd9]));};}var ve=p(()=>{});import _0x119b62 from'fs';import _0x2e55cd from'node:path';function $e(_0x5ccf74){const _0x1a4276=_0x460213;let _0x1929fc=_0x5ccf74[0x0];return _0x5ccf74[_0x1a4276(0x140)]>=0x2&&(_0x1929fc==='\x22'||_0x1929fc==='\x27')&&_0x5ccf74['endsWith'](_0x1929fc)?_0x5ccf74[_0x1a4276(0x1b7)](0x1,-0x1)[_0x1a4276(0x136)]():_0x5ccf74;}function Ve(_0x3a4486){const _0x5c1721=_0x460213;for(let _0xe0a05c of _0x3a4486[_0x5c1721(0x151)]('\x0a'))if(_0xe0a05c[_0x5c1721(0x251)](we)){let _0x530d91=$e(_0xe0a05c[_0x5c1721(0x1b7)](we[_0x5c1721(0x140)])[_0x5c1721(0x136)]());if(_0x530d91)return _0x530d91;}let _0x180b5c=$e(_0x3a4486[_0x5c1721(0x136)]());return _0x180b5c&&!_0x180b5c['includes']('\x0a')&&!_0x180b5c[_0x5c1721(0x236)]('=')?_0x180b5c:null;}function w(_0xc97532){const _0x4fca76=_0x460213;let _0x2a818a=_0xc97532[_0x4fca76(0x151)]('.');if(_0x2a818a[_0x4fca76(0x140)]!==0x3)return null;try{let _0x8a9a19=JSON['parse'](Buffer[_0x4fca76(0x263)](_0x2a818a[0x1],_0x4fca76(0x1fd))[_0x4fca76(0x132)]());return typeof _0x8a9a19[_0x4fca76(0x278)]==_0x4fca76(0x1ae)?_0x8a9a19[_0x4fca76(0x278)]:null;}catch{return null;}}function O(_0x1ea330,_0x518b41){if(_0x1ea330===_0x518b41)return!0x1;let _0x8878ae=w(_0x1ea330),_0x220784=w(_0x518b41);return _0x8878ae!==null&&_0x220784!==null&&_0x8878ae>_0x220784;}function Re(_0x504c8b=process.env){const _0x3420b2=_0x460213;return(_0x504c8b[K]??_0x504c8b[Ye]??'')['split'](_0x2e55cd[_0x3420b2(0x1cb)])[_0x3420b2(0x218)](_0x2c62d6=>_0x2c62d6[_0x3420b2(0x136)]())[_0x3420b2(0x184)](_0x516403=>_0x516403[_0x3420b2(0x140)]>0x0);}function _0xa036(){const _0x394727=['shellPathPrepend','[handleInit]\x20Event\x20subscription\x20active','cacheCreationTokens','destroyed','Unknown\x20cmd:\x20','backendUrl','[handleInit]\x20unsubscribeEvents\x20failed\x20during\x20rollback:\x20','[main]\x20readline\x20interface\x20created,\x20waiting\x20for\x20commands\x20on\x20stdin...','widget','[dispatch]\x20ERROR:\x20Unknown\x20command:\x20','has','[resolveBackendUrl]\x20env=','[main]\x20platform=','request','input_tokens','false','pending','[handleSend]\x20ERROR:\x20Agent\x20not\x20initialized','output_tokens','\x20→\x20','[handleInit]\x20Ignoring\x20effort=','[handleInit]\x20Calling\x20agent.initialize()\x20with\x20config:\x20backendUrl=','startsWith',',\x20sessionId=','tool_call','\x20on\x20the\x20same\x20session','bundledSkillsPath','init','messages','156IxUgxm','Read','data','[dispatch]\x20Dispatching\x20to\x20handleDestroy...','[handleInit]\x20Called\x20with\x20options:\x20','8514684nskqJN','[main]\x20Event\x20handlers\x20registered,\x20host\x20is\x20ready','type','[handleInit]\x20Ignoring\x20shellPathPrepend\x20entry\x20','s;\x20next\x20refresh\x20in\x20','[dispatch]\x20Dispatching\x20to\x20handleInit...','from','\x20for\x20proactive\x20refresh\x20(pinned\x20to\x20org=','replace','[handleInit]\x20init_ok\x20sent\x20to\x20stdout','\x20chars),\x20sessionId=','isAxiosError','\x22.\x20Use\x20one\x20of:\x20','TENANT_ID','byteLength',',\x20ORG_ID=','[token-refresh]\x20A\x20renewable\x20grant\x20exists\x20in\x20','`\x20(writes\x20~/.aria/sdk-auth.json).','find','medium','projectId','[bootstrap]\x20main()\x20failed:\x20',',\x20pid=','version','[bootstrap]\x20Calling\x20main()...','\x20chars,\x20sessionId=','[handleDestroy]\x20Events\x20unsubscribed\x20successfully','exp','init_ok','13784210mWYoOy','maxSteps','join','message','stack',',\x20hasPrompt=','[handleInit]\x20Auth\x20resolved\x20successfully','Agent\x20not\x20initialized;\x20send\x20`init`\x20first.','finally','\x20->\x20','[handleSend]\x20Response\x20preview:\x20\x22','[dispatch]\x20handleInit\x20completed','cmd','[delegate-stdio]\x20','AUTH_TOKEN_FILE','url','config','attach','[blank-turn]\x20still\x20blank\x20after\x20','571252ctespS','exit','baseURL','sessionId',',\x20tenant=','[dispatch]\x20Dispatching\x20to\x20handleSend...','tokenUrl','toString',',\x20model=','stdin','\x20chars):\x20','trim','[event\x20#','destroy','http://localhost:5002','event','utf8','default','statSync','[dispatch]\x20Received\x20empty\x20line,\x20skipping','http:','length','unbounded','X-UiPath-Use-Llm-Gateway-For-Fireworks','[handleDestroy]\x20Unsubscribing\x20from\x20events...','Unknown\x20env\x20\x22','68763Mlmaaz','[handleSend]\x20Response\x20length:\x20','[handleSend]\x20agent.sendMessage()\x20completed\x20in\x20','[handleInit]\x20Subscribing\x20to\x20agent\x20events...','[resolveAuth]\x20No\x20auth\x20available\x20(init\x20option,\x20env\x20vars\x20and\x20saved\x20auth\x20all\x20failed)','177856KlCcQM','enableConnections','meta','[handleDestroy]\x20No\x20agent\x20to\x20destroy',',\x20userId=','validateModel','Token\x20endpoint\x20returned\x20non-JSON:\x20','split','not\x20set','Agent\x20already\x20initialized','cache_creation_input_tokens','cwd','[dispatch]\x20ERROR:\x20Command\x20\x27','\x20received\x20(','[dispatch]\x20Received\x20line\x20(','clientId','updateConfig','client_credentials','\x20chars)',',\x20orgLogicalName=','\x20—\x20not\x20an\x20existing\x20directory','promptTokensCached','utf-8','[handleInit]\x20Ignoring\x20workingDirectory=','[handleInit]\x20ERROR:\x20Agent\x20already\x20initialized','low','stdout','tool_result','end','env=\x22',',\x20bundledSkillsPath=','not\x20valid\x20JSON,\x20content\x20not\x20logged',',\x20hasOptions=','application/x-www-form-urlencoded','[handleInit]\x20Creating\x20DelegateAgent\x20instance...','[handleDestroy]\x20Destroying\x20agent...',',\x20tenantName=','send','userId',',\x20TENANT_ID=',']\x20Fresh\x20token\x20applied\x20via\x20agent.updateToken()\x20+\x20process.env.AUTH_TOKEN','pid','Unknown\x20backend\x20error\x20(no\x20details\x20in\x20actionable_error\x20message)',',\x20orgId=','[main]\x20Host\x20starting\x20(Node\x20','max','existsSync','DELEGATE_AUTH_TOKEN_FILE','access_token',',\x20but\x20this\x20host\x20authenticated\x20with\x20an\x20explicit\x20AUTH_TOKEN\x20—\x20not\x20refreshing\x20from\x20saved\x20auth\x20(identities\x20may\x20differ)','prompt','I\x20apologize,\x20but\x20I\x20didn\x27t\x20receive\x20a\x20complete\x20response.\x20Please\x20try\x20again.',',\x20expiresAt=','baseUrl',',\x20agentName=','options','refreshToken','[main]\x20Env:\x20BACKEND_URL=','filter','error','isDirectory','[resolveAuth]\x20Using\x20init-option\x20/\x20env\x20var\x20auth','uncaughtException','Write',',\x20organizationId=','response','string','readFileSync','9PQLesV','TENANT_NAME','setMaxSteps',',\x20logging=','backendUrlOption','agentName','Bash','\x20(process.chdir\x20applied)','[handleInit]\x20DelegateAgent\x20instance\x20created','[handleInit]\x20Request\x20headers\x20prepared:\x20X-UiPath-Internal-*\x20(orgId\x20set=','null','[handleSend]\x20Calling\x20agent.sendMessage()...','[handleSend]\x20Called\x20with\x20prompt=\x22','tenantName','accessToken','[handleDestroy]\x20Called','alpha',',\x20arch=','\x22\x20(','`\x20so\x20saved\x20auth\x20carries\x20the\x20slugs.','\x27\x20threw:\x20','cache_read_input_tokens','env','[handleDestroy]\x20destroyed\x20message\x20sent','off','push','content','statusCode','model','rawMessage','https://staging.uipath.com','[s2s-refresh]\x20Mint\x20failed:\x20','number','[blank-turn]\x20backend\x20returned\x20a\x20blank-completion\x20apology;\x20retrying\x20',',\x20tenantId\x20set=','[handleDestroy]\x20Agent\x20destroyed\x20successfully','enableMemory','[token-refresh]\x20Using\x20the\x20saved\x20OAuth\x20grant\x20in\x20','text',']\x20type=','method','slice','\x20—\x20not\x20one\x20of\x20','[resolveAuth]\x20Init\x20auth\x20option\x20fields:\x20','https://cloud.uipath.com','toolName','label','true','xhigh','promptTokens','getSessionMessages','/delegate_','7OiCWCW','enableComputerUse',',\x20turnUsages=','workingDirectory','getTurnUsageHistory','detach','peek','POST','171148kkguVA','delimiter',']\x20Token\x20has\x20no\x20decodable\x20exp\x20—\x20skipping\x20schedule','actionableError','completionTokens','enableSkills','now','[dispatch]\x20ERROR:\x20send\x20prompt\x20is\x20not\x20a\x20string,\x20got\x20','ms;\x20rolling\x20back\x20partial\x20state:\x20',',\x20USER_ID=','hasRefreshToken','agent_thought','s);\x20fetching\x20a\x20fresh\x20one\x20before\x20init','[main]\x20Processing\x20line\x20#','auth','command',',\x20hasRefreshToken=',',\x20maxSteps=','organizationId','failed','info','\x20returned\x20HTTP\x20','[dispatch]\x20ERROR:\x20Failed\x20to\x20parse\x20JSON:\x20','aria-autopilot','floor','orgLogicalName','interopUrl','[main]\x20uncaughtException:\x20','tenantId','USER_ID',',\x20blankTurnRetries=','inherit-default','[s2s-refresh]\x20LLMGW_URL\x20is\x20not\x20a\x20valid\x20URL:\x20\x22','resolve','[main]\x20dispatch\x20returned\x20shouldExit=true,\x20closing\x20readline','protocol','yes','[handleInit]\x20agent.initialize()\x20threw\x20after\x20','turn_start','onEvent','[handleInit]\x20agent.destroy()\x20failed\x20during\x20rollback:\x20','sync','keys','Skill','then','\x20more\x20chars)','[handleInit]\x20agent.initialize()\x20completed\x20in\x20',',\x20INTEROP_URL=','line','initialize',',\x20enableComputerUse=','base64','[handleDestroy]\x20No\x20event\x20subscription\x20to\x20clean\x20up',',\x20userId\x20set=',',\x20no\x20LLMGW_CLIENT_ID/LLMGW_CLIENT_SECRET/LLMGW_URL,\x20and\x20no\x20renewable\x20grant\x20in\x20','next','stringify',';\x20resolved:\x20accessToken=',',\x20validateModel=','object','write','Token\x20endpoint\x20','logging','createInterface','verbose','reduce','getSessionId','arch','https://alpha.uipath.com','[handleInit]\x20Shell\x20PATH\x20prepend:\x20','[s2s-refresh]\x20IdP\x20response\x20missing\x20access_token','envOption','[normalizeModelId]\x20Rewriting\x20model\x20\x27','provider','description','NOT\x20SET','close',',\x20maxStepsReached=','map','[main]\x20stdin\x20line\x20#','details','\x27\x20->\x20\x27','s2s-refresh','1183992zfnhPy','isArray','100BZGgcv','\x20holds\x20a\x20fresher\x20token\x20than\x20the\x20inherited\x20one;\x20using\x20it\x20for\x20init',')\x20failed:\x20','oauth-refresh','[handleInit]\x20Working\x20directory:\x20','effort','...','SET\x20(','chdir','logText','ORG_ID',',\x20baseUrl=','high','expiresAt','parse','[writeLine]\x20>>>\x20',',\x20enableMemory=','toLowerCase','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','\x20—\x20shell\x20tools\x20still\x20default\x20there\x20via\x20the\x20SDK','UIPATH_ACCESS_TOKEN=','36tdpnys','[main]\x20All\x20commands\x20drained,\x20exiting\x20with\x20code\x200','includes','none','exports','usage','platform'];_0xa036=function(){return _0x394727;};return _0xa036();}function Ne(_0x5c2669){const _0x6cefa4=_0x460213;for(let _0x2d6a81 of _0x5c2669){let _0x266357;try{_0x266357=_0x119b62[_0x6cefa4(0x18d)](_0x2d6a81,_0x6cefa4(0x160));}catch{continue;}let _0x54719a=Ve(_0x266357);if(_0x54719a)return _0x54719a;}return null;}var K,Ye,we,xe=p(()=>{const _0x39d23b=_0x460213;K=_0x39d23b(0x179),Ye=_0x39d23b(0x126),we=_0x39d23b(0x233);});import _0x1896ad from'fs';function qe(_0x414ddd){const _0x527647=_0x460213;let _0x1acfe1;try{_0x1acfe1=JSON[_0x527647(0x22d)](_0x414ddd);}catch{return null;}if(typeof _0x1acfe1!='object'||_0x1acfe1===null||Array[_0x527647(0x21e)](_0x1acfe1))return null;let _0x5c7aca=_0x1acfe1,_0x8df28b=typeof _0x5c7aca[_0x527647(0x19c)]==_0x527647(0x18c)?_0x5c7aca['accessToken']:'',_0x161f68=typeof _0x5c7aca[_0x527647(0x182)]==_0x527647(0x18c)?_0x5c7aca[_0x527647(0x182)][_0x527647(0x136)]():'',_0x20b012=_0x3ed8f1=>typeof _0x3ed8f1==_0x527647(0x18c)&&_0x3ed8f1['length']>0x0?_0x3ed8f1:void 0x0;return{'accessToken':_0x8df28b,'hasRefreshToken':_0x161f68[_0x527647(0x140)]>0x0,..._0x20b012(_0x5c7aca[_0x527647(0x1dc)])?{'organizationId':_0x20b012(_0x5c7aca[_0x527647(0x1dc)])}:{},..._0x20b012(_0x5c7aca[_0x527647(0x1e6)])?{'tenantId':_0x20b012(_0x5c7aca[_0x527647(0x1e6)])}:{},..._0x20b012(_0x5c7aca['clientId'])?{'clientId':_0x20b012(_0x5c7aca[_0x527647(0x159)])}:{}};}function Qe(_0x1afc08){const _0x5d6562=_0x460213;try{return qe(_0x1896ad[_0x5d6562(0x18d)](_0x1afc08,_0x5d6562(0x13b)));}catch{return null;}}function B(_0x50b163){const _0x4c5a56=_0x460213;return Qe(_0x50b163)?.[_0x4c5a56(0x1d4)]??!0x1;}function Ue(_0x5e881d,_0x1dca8e){return _0x5e881d&&B(_0x1dca8e);}function Ze(_0x298637){const _0x47f80b=_0x460213;return{'accessToken':_0x298637['accessToken'],..._0x298637[_0x47f80b(0x182)]?{'refreshToken':_0x298637[_0x47f80b(0x182)]}:{},...typeof _0x298637['expiresAt']=='number'?{'expiresAt':_0x298637[_0x47f80b(0x22c)]}:{}};}var D,Le=p(()=>{const _0x518eb5=_0x460213;D=class{[_0x518eb5(0x213)]=null;[_0x518eb5(0x24b)]=null;[_0x518eb5(0x1f3)](_0xed12d0){const _0x2d4402=_0x518eb5;let _0x593e84=Ze(_0xed12d0);this[_0x2d4402(0x213)]?this['provider'][_0x2d4402(0x15a)](_0x593e84):this[_0x2d4402(0x24b)]=_0x593e84;}[_0x518eb5(0x129)](_0x5e513b){const _0x59fdb1=_0x518eb5;this[_0x59fdb1(0x213)]=_0x5e513b,this[_0x59fdb1(0x24b)]&&(_0x5e513b['updateConfig'](this[_0x59fdb1(0x24b)]),this['pending']=null);}[_0x518eb5(0x1c7)](){const _0x1a1800=_0x518eb5;this[_0x1a1800(0x213)]=null,this['pending']=null;}};});function Oe(_0x3ed61b){const _0x36a833=_0x460213;return(_0x3ed61b??'')[_0x36a833(0x136)]()===en;}async function De(_0x437650,_0x7cb98a,_0x5bae38){const _0x7bb410=_0x460213;let {send:_0x5d2ffa,getSessionId:_0x2bed01,log:_0x327a7e,maxRetries:_0x2dee1d=0x2}=_0x5bae38,_0x1ed044=await _0x5d2ffa(_0x437650,_0x7cb98a),_0xb1ee97=0x0;for(;Oe(_0x1ed044['text'])&&_0xb1ee97<_0x2dee1d;)_0xb1ee97+=0x1,_0x327a7e(_0x7bb410(0x1af)+_0xb1ee97+'/'+_0x2dee1d+_0x7bb410(0x254)),_0x1ed044=await _0x5d2ffa(nn,_0x2bed01()??_0x7cb98a);return Oe(_0x1ed044[_0x7bb410(0x1b4)])&&_0x327a7e(_0x7bb410(0x12a)+_0x2dee1d+'\x20retries;\x20returning\x20the\x20apology\x20so\x20the\x20turn\x20is\x20graded\x20on\x20its\x20partial\x20work'),{'response':_0x1ed044['text'],'failed':_0x1ed044[_0x7bb410(0x1dd)],'blankTurnRetries':_0xb1ee97};}var en,nn,Ce=p(()=>{const _0x160d3e=_0x460213;en=_0x160d3e(0x17d),nn='Your\x20previous\x20reply\x20was\x20empty.\x20Continue\x20the\x20task\x20from\x20where\x20you\x20left\x20off\x20and\x20complete\x20it.';});function _0x5b62(_0x1f66cc,_0x5b6b31){_0x1f66cc=_0x1f66cc-0x121;const _0xa03673=_0xa036();let _0x5b6204=_0xa03673[_0x1f66cc];return _0x5b6204;}import _0x1d0df2 from'fs';import _0x45d848 from'node:path';import _0x18870b from'readline';import _0x75695b from'http';import _0x2188c3 from'https';import{DelegateAgent as _0x2271aa,TokenAuthProvider as _0x143cf4,getAuthFilePath as _0x33a98e,grantIdentity as _0x58214b,isTokenExpired as _0x59c81e,loadAndRefreshAuth as _0x35f603,readSavedAuthRecord as _0x76dcb4,refreshAccessToken as _0x41f78b,sameGrantIdentity as _0x28c7ac}from'@uipath/delegate-sdk';var Kn=He(()=>{const _0x479d6c=_0x460213;re(),ae(),ce(),ge(),me(),Te(),be(),ve(),xe(),Le(),Ce();function _0xfb09fa(_0x580554,_0x8fdd44,_0x5f544f){return{'X-UiPath-Internal-AccountId':_0x580554,'X-UiPath-Internal-TenantId':_0x8fdd44,..._0x5f544f?{'X-UiPath-Internal-UserId':_0x5f544f}:{}};}var _0x27d496=process.env.DELEGATE_STDIO_VERBOSE==='1'||process.env.DELEGATE_STDIO_VERBOSE===_0x479d6c(0x1bd),_0x516d95=((()=>{const _0x53efb8=_0x479d6c;let _0x21fc80=process.env.DELEGATE_STDIO_LOG_MAX_CHARS;if(_0x21fc80===void 0x0||_0x21fc80[_0x53efb8(0x136)]()==='')return 0xc350;let _0xe71ae4=Number(_0x21fc80);return Number['isFinite'](_0xe71ae4)&&_0xe71ae4>=0x0?_0xe71ae4:0xc350;})());function _0x2320dc(_0x5b8f8b){const _0x588e31=_0x479d6c;return _0x516d95>0x0&&_0x5b8f8b['length']>_0x516d95?_0x5b8f8b[_0x588e31(0x1b7)](0x0,_0x516d95)+'…('+(_0x5b8f8b[_0x588e31(0x140)]-_0x516d95)+_0x588e31(0x1f7):_0x5b8f8b;}function _0x160448(_0x59be8c){const _0x421ad4=_0x479d6c;let _0x403e2e=JSON[_0x421ad4(0x202)](_0x59be8c);_0x1badb3(_0x421ad4(0x22e)+_0x2320dc(_0x403e2e)),process[_0x421ad4(0x164)][_0x421ad4(0x206)](_0x403e2e+'\x0a');}function _0x544816(_0x112884){const _0x1216e7=_0x479d6c;process['stderr']['write'](_0x1216e7(0x125)+_0x112884+'\x0a');}function _0x1badb3(_0x2c553f){const _0x148c5b=_0x479d6c;_0x27d496&&process['stderr'][_0x148c5b(0x206)](_0x148c5b(0x125)+_0x2c553f+'\x0a');}function _0x4344c9(_0x4d7b43){const _0xca1897=_0x479d6c;let _0x18d971=_0x4d7b43 instanceof Error?_0x4d7b43:new Error(String(_0x4d7b43)),_0x5e80c5=_0x18d971[_0xca1897(0x27d)],_0xadeb8c=_0x4d7b43;if(_0xadeb8c?.[_0xca1897(0x268)]&&_0xadeb8c['response']){let {status:_0x44f6fa,statusText:_0x26818c,data:_0x5504f7}=_0xadeb8c[_0xca1897(0x18b)],_0x34ee54=_0xadeb8c[_0xca1897(0x128)]?.[_0xca1897(0x1b6)]?.['toUpperCase']()??'REQUEST',_0x55e498=_0xadeb8c[_0xca1897(0x128)]?.[_0xca1897(0x12d)]?''+_0xadeb8c[_0xca1897(0x128)][_0xca1897(0x12d)]+(_0xadeb8c['config']?.[_0xca1897(0x127)]??''):_0xadeb8c['config']?.['url']??'',_0x410ed1;if(typeof _0x5504f7==_0xca1897(0x18c))_0x410ed1=_0x2320dc(_0x5504f7);else{if(_0x5504f7==null)_0x410ed1='<no\x20response\x20body>';else try{let _0x4fa6ac=JSON[_0xca1897(0x202)](_0x5504f7);_0x410ed1=_0x2320dc(_0x4fa6ac);}catch{_0x410ed1=String(_0x5504f7);}}_0x5e80c5=_0x34ee54+'\x20'+_0x55e498+_0xca1897(0x24e)+_0x44f6fa+(_0x26818c?'\x20'+_0x26818c:'')+':\x20'+_0x410ed1;}return{'message':_0x5e80c5,'stack':_0x18d971[_0xca1897(0x27e)]};}function _0x185758(_0x3853c9){const _0x8e4fe3=_0x479d6c;let {message:_0x2551d8,stack:_0x23d70f}=_0x4344c9(_0x3853c9);return{'type':_0x8e4fe3(0x185),'message':_0x2551d8,'stack':_0x23d70f};}function _0x36de6f(_0x302cfb){const _0x479b4e=_0x479d6c;if(!_0x302cfb||!_0x302cfb[_0x479b4e(0x236)]('-'))return _0x302cfb;let _0x8ca84c=_0x302cfb[_0x479b4e(0x265)](/-/g,'_');return _0x544816(_0x479b4e(0x212)+_0x302cfb+_0x479b4e(0x21b)+_0x8ca84c+'\x27'),_0x8ca84c;}var _0x35fbde={'ReadFile':_0x479d6c(0x259),'WriteFile':_0x479d6c(0x189),'EditFile':'Edit','ExecuteBashCommand':_0x479d6c(0x194),'LsDirectory':'LS','ExecuteSkillApi':_0x479d6c(0x1f5)};function _0x1822f7(_0x552308){const _0x1e9400=_0x479d6c;if(_0x552308[_0x1e9400(0x25f)]!==_0x1e9400(0x27d)||!_0x8032a7)return _0x552308;let _0x5913dc=_0x8032a7[_0x1e9400(0x20c)]();if(!_0x5913dc)return _0x552308;let _0xd69524=_0x8032a7['getSessionMessages'](_0x5913dc),_0x38a9f9=_0x5185c5(_0xd69524),_0x1e0a3e=_0x38a9f9>_0x2edc20;return _0x2edc20=_0x38a9f9,{..._0x552308,'isStepStart':_0x1e0a3e};}function _0x1e98d8(_0x1e2506){const _0x4fca99=_0x479d6c;if(_0x1e2506[_0x4fca99(0x25f)]!==_0x4fca99(0x253)&&_0x1e2506[_0x4fca99(0x25f)]!==_0x4fca99(0x165)||typeof _0x1e2506['toolName']!=_0x4fca99(0x18c))return _0x1e2506;let _0xfc483d=_0x35fbde[_0x1e2506[_0x4fca99(0x1bb)]];return _0xfc483d?{..._0x1e2506,'toolName':_0xfc483d,'nativeToolName':_0x1e2506[_0x4fca99(0x1bb)]}:_0x1e2506;}function _0x26a635(_0xc1aaf8){const _0x1fc3f5=_0x479d6c;return[..._0xc1aaf8]['reverse']()[_0x1fc3f5(0x26f)](_0x27b83d=>_0x27b83d['widget']==='actionable_error'||_0x27b83d[_0x1fc3f5(0x243)]===_0x1fc3f5(0x1cd));}function _0x83dcc5(_0x50a82f){const _0x5a0b1b=_0x479d6c;let _0x302e73=_0x50a82f[_0x5a0b1b(0x14c)]??{},_0x8093ca=(_0x4a303d,_0x44f475)=>{const _0x35b71b=_0x5a0b1b;for(let _0x26ec82 of _0x44f475){let _0x1fbd89=_0x4a303d[_0x26ec82];if(typeof _0x1fbd89==_0x35b71b(0x18c)&&_0x1fbd89)return _0x1fbd89;}},_0xaf5af5=_0x8093ca(_0x302e73,[_0x5a0b1b(0x21a),_0x5a0b1b(0x214),_0x5a0b1b(0x1ab),'message']);if(_0xaf5af5)return _0xaf5af5;if(typeof _0x50a82f[_0x5a0b1b(0x1a8)]==_0x5a0b1b(0x18c))try{let _0x4697d2=JSON['parse'](_0x50a82f['content']);return _0x8093ca(_0x4697d2,[_0x5a0b1b(0x21a),_0x5a0b1b(0x214),'rawMessage',_0x5a0b1b(0x27d)])??_0x50a82f[_0x5a0b1b(0x1a8)];}catch{return _0x50a82f[_0x5a0b1b(0x1a8)];}return _0x5a0b1b(0x174);}var _0x2f1369=0x12c,_0x3f424b=0x3c,_0x1a49ac=0x3c;function _0x128b20(){const _0x202c4c=_0x479d6c;let _0x41ebf3=process.env.LLMGW_CLIENT_ID,_0x1a8e7f=process.env.LLMGW_CLIENT_SECRET,_0x48d217=process.env.LLMGW_URL;if(!_0x41ebf3||!_0x1a8e7f||!_0x48d217)return null;let _0x30e0ab;try{_0x30e0ab=new URL('/identity_/connect/token',_0x48d217)[_0x202c4c(0x132)]();}catch{return _0x544816(_0x202c4c(0x1ea)+_0x48d217+'\x22\x20—\x20disabling\x20S2S\x20refresh'),null;}return{'tokenUrl':_0x30e0ab,'clientId':_0x41ebf3,'clientSecret':_0x1a8e7f};}function _0x318d63(_0x2deef9,_0x21e759){return new Promise((_0x3b5fa6,_0x40fdc1)=>{const _0x576f15=_0x5b62;let _0x36cf0d=new URL(_0x2deef9),_0x49e29a=(_0x36cf0d[_0x576f15(0x1ed)]===_0x576f15(0x13f)?_0x75695b:_0x2188c3)[_0x576f15(0x248)](_0x36cf0d,{'method':_0x576f15(0x1c9),'headers':{'Content-Type':_0x576f15(0x16b),'Content-Length':Buffer[_0x576f15(0x26b)](_0x21e759)}},_0x5d0182=>{const _0x1f355c=_0x576f15;let _0x589cfe='';_0x5d0182['on'](_0x1f355c(0x25a),_0x3b5c9d=>{_0x589cfe+=_0x3b5c9d;}),_0x5d0182['on'](_0x1f355c(0x166),()=>{const _0x2c19a8=_0x1f355c;if(_0x5d0182['statusCode']&&_0x5d0182[_0x2c19a8(0x1a9)]>=0xc8&&_0x5d0182[_0x2c19a8(0x1a9)]<0x12c)try{_0x3b5fa6(JSON[_0x2c19a8(0x22d)](_0x589cfe));}catch{_0x40fdc1(new Error(_0x2c19a8(0x150)+_0x589cfe[_0x2c19a8(0x1b7)](0x0,0xc8)));}else _0x40fdc1(new Error(_0x2c19a8(0x207)+_0x2deef9+_0x2c19a8(0x1df)+_0x5d0182[_0x2c19a8(0x1a9)]+':\x20'+_0x589cfe['slice'](0x0,0xc8)));});});_0x49e29a['on'](_0x576f15(0x185),_0x40fdc1),_0x49e29a[_0x576f15(0x206)](_0x21e759),_0x49e29a['end']();});}function _0x15daae(_0x57cb97){process.env.AUTH_TOKEN=_0x57cb97;}async function _0x56f904(_0x1025b3){const _0x5317b9=_0x479d6c;let _0x399047=new URLSearchParams({'grant_type':_0x5317b9(0x15b),'client_id':_0x1025b3[_0x5317b9(0x159)],'client_secret':_0x1025b3['clientSecret']})['toString']();try{let _0x32e356=await _0x318d63(_0x1025b3[_0x5317b9(0x131)],_0x399047),_0x4ec619=typeof _0x32e356[_0x5317b9(0x17a)]=='string'?_0x32e356[_0x5317b9(0x17a)]:null;return _0x4ec619||(_0x544816(_0x5317b9(0x210)),null);}catch(_0x4968c4){return _0x544816(_0x5317b9(0x1ad)+(_0x4968c4 instanceof Error?_0x4968c4['message']:String(_0x4968c4))),null;}}function _0x968467(_0x297e9f){const _0x2252a2=_0x479d6c;let _0x506aba=()=>{let _0x49458a=Ne(_0x297e9f);return _0x49458a===null?null:O(_0x49458a,process.env.AUTH_TOKEN??'')?_0x49458a:null;};return{'label':'file-refresh','origin':_0x297e9f[_0x2252a2(0x27c)](',\x20'),'peek':_0x506aba,'next':()=>Promise['resolve'](_0x506aba())};}function _0x17c821(_0x246e06){const _0x49189a=_0x479d6c;return{'label':_0x49189a(0x21c),'origin':_0x246e06['tokenUrl'],'peek':()=>null,'next':()=>_0x56f904(_0x246e06)};}function _0x2ccbad(_0x5200a5,_0x42dc26){const _0x236692=_0x479d6c;let _0x5b77ae=!0x1,_0x307e10=()=>{let _0x6e73fa=_0x76dcb4(_0x5200a5);return _0x6e73fa?_0x28c7ac(_0x42dc26,_0x58214b(_0x6e73fa))?(_0x5b77ae=!0x1,_0x6e73fa):(_0x5b77ae||(_0x544816('[oauth-refresh]\x20'+_0x5200a5+'\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'),_0x5b77ae=!0x0),null):null;};return{'label':_0x236692(0x222),'origin':_0x5200a5,'peek':()=>{const _0x4641ae=_0x236692;let _0x51cec7=_0x307e10();return!_0x51cec7||!O(_0x51cec7[_0x4641ae(0x19c)],process.env.AUTH_TOKEN??'')?null:(_0xbf47ac[_0x4641ae(0x1f3)](_0x51cec7),_0x51cec7['accessToken']);},'next':async()=>{const _0x5abcc0=_0x236692;let _0x13a649=_0x307e10();if(!_0x13a649)return null;if(_0x59c81e(_0x13a649)){let _0x27b77c=await _0x41f78b(_0x13a649,{'authFilePath':_0x5200a5,'pinnedIdentity':_0x42dc26});if(!_0x27b77c)return null;_0x13a649=_0x27b77c;}return O(_0x13a649[_0x5abcc0(0x19c)],process.env.AUTH_TOKEN??'')?(_0xbf47ac[_0x5abcc0(0x1f3)](_0x13a649),_0x13a649[_0x5abcc0(0x19c)]):null;}};}function _0x220e8c(_0x2f01cc){const _0x5912b8=_0x479d6c;let _0x52d9fd=_0x2f01cc!==null,_0x4d0ab6=Re(),_0x385ddb=_0x128b20();if(_0x4d0ab6[_0x5912b8(0x140)]>0x0)return _0x385ddb&&_0x544816('[token-refresh]\x20A\x20token\x20file\x20and\x20LLMGW_*\x20S2S\x20creds\x20are\x20both\x20configured;\x20the\x20token\x20file\x20wins'),_0x968467(_0x4d0ab6);if(_0x385ddb)return _0x17c821(_0x385ddb);let _0x244a94=_0x33a98e();return _0x2f01cc&&Ue(_0x52d9fd,_0x244a94)?(_0x544816(_0x5912b8(0x1b3)+_0x244a94+_0x5912b8(0x264)+_0x2f01cc['organizationId']+_0x5912b8(0x12f)+_0x2f01cc[_0x5912b8(0x1e6)]+')'),_0x2ccbad(_0x244a94,_0x2f01cc)):!_0x52d9fd&&B(_0x244a94)?(_0x544816(_0x5912b8(0x26d)+_0x244a94+_0x5912b8(0x17b)),null):(_0x1badb3('[token-refresh]\x20No\x20'+K+_0x5912b8(0x200)+_0x244a94+'\x20—\x20proactive\x20refresh\x20disabled'),null);}var _0x4ddd6b=null,_0x27339d=null,_0xbf47ac=new D();function _0x43bb31(){_0x27339d!==null&&(clearTimeout(_0x27339d),_0x27339d=null);}function _0x1d0edb(){_0x43bb31(),_0x4ddd6b=null;}function _0x4aa2a8(_0x3c2e01){_0x43bb31(),_0x27339d=setTimeout(()=>{_0x518def();},_0x3c2e01*0x3e8);}function _0x457196(_0xebeb63,_0xfa9fbf){const _0x21725e=_0x479d6c;let _0xe48c43=w(_0xebeb63);if(_0xe48c43===null){_0x1badb3('['+_0xfa9fbf+_0x21725e(0x1cc)),_0x43bb31();return;}let _0x164912=_0xe48c43-Math[_0x21725e(0x1e2)](Date[_0x21725e(0x1d0)]()/0x3e8),_0xe9e235=Math[_0x21725e(0x177)](_0x1a49ac,_0x164912-_0x2f1369);_0x544816('['+_0xfa9fbf+']\x20Token\x20exp\x20in\x20'+_0x164912+_0x21725e(0x261)+_0xe9e235+'s'),_0x4aa2a8(_0xe9e235);}function _0x4857ce(_0x4032dc,_0x4b7f2f,_0x590f49){const _0x2f0021=_0x479d6c;try{return _0x4032dc['updateToken'](_0x4b7f2f),_0x15daae(_0x4b7f2f),_0x544816('['+_0x590f49+_0x2f0021(0x172)),!0x0;}catch(_0x51b5bc){return _0x544816('['+_0x590f49+']\x20agent.updateToken()\x20threw:\x20'+(_0x51b5bc instanceof Error?_0x51b5bc['message']:String(_0x51b5bc))),!0x1;}}async function _0x518def(){const _0x45805c=_0x479d6c;let _0x59e801=_0x4ddd6b;if(!_0x8032a7||!_0x59e801)return;let _0x4f1ca4=await _0x59e801[_0x45805c(0x201)](),_0x2b184d=_0x8032a7;if(_0x2b184d){if(!_0x4f1ca4){_0x544816('['+_0x59e801[_0x45805c(0x1bc)]+']\x20No\x20fresher\x20token\x20from\x20'+_0x59e801['origin']+'\x20yet;\x20retrying\x20in\x20'+_0x3f424b+'s'),_0x4aa2a8(_0x3f424b);return;}if(!_0x4857ce(_0x2b184d,_0x4f1ca4,_0x59e801[_0x45805c(0x1bc)])){_0x4aa2a8(_0x3f424b);return;}_0x457196(_0x4f1ca4,_0x59e801[_0x45805c(0x1bc)]);}}function _0x423117(){const _0x41cb96=_0x479d6c;let _0xf526ab=_0x4ddd6b,_0x5d718e=_0x8032a7;if(!_0x5d718e||!_0xf526ab)return;let _0x2e6206=_0xf526ab['peek']();_0x2e6206&&_0x4857ce(_0x5d718e,_0x2e6206,_0xf526ab['label'])&&_0x457196(_0x2e6206,_0xf526ab[_0x41cb96(0x1bc)]);}async function _0x1dda9f(_0x4af7c3,_0x492718){const _0x4902f9=_0x479d6c;_0x4ddd6b=_0x220e8c(_0x492718);let _0x4b7f24=_0x4ddd6b;if(!_0x4b7f24)return _0x4af7c3;_0x15daae(_0x4af7c3);let _0x1f59ae=_0x4af7c3,_0x455c78=_0x4b7f24[_0x4902f9(0x1c8)]();if(_0x455c78!==null)_0x544816('['+_0x4b7f24[_0x4902f9(0x1bc)]+']\x20'+_0x4b7f24['origin']+_0x4902f9(0x220)),_0x1f59ae=_0x455c78,_0x15daae(_0x1f59ae);else{let _0x71c34a=w(_0x4af7c3),_0x438b3b=_0x71c34a===null?null:_0x71c34a-Math[_0x4902f9(0x1e2)](Date[_0x4902f9(0x1d0)]()/0x3e8);if(_0x438b3b!==null&&_0x438b3b<_0x2f1369){_0x544816('['+_0x4b7f24[_0x4902f9(0x1bc)]+']\x20Inherited\x20token\x20has\x20'+_0x438b3b+'s\x20remaining\x20(<'+_0x2f1369+_0x4902f9(0x1d6));let _0x42b515=await _0x4b7f24[_0x4902f9(0x201)]();_0x42b515&&(_0x1f59ae=_0x42b515,_0x15daae(_0x1f59ae));}}return _0x457196(_0x1f59ae,_0x4b7f24['label']),_0x1f59ae;}var _0x8032a7=null,_0x16ac93=null,_0x4a0d7c,_0x2edc20=0x0,_0x2f5dbd=null;function _0x4318fb(_0x5a28ea){const _0x380cf5=_0x479d6c;return _0x5a28ea['type']==='ai'&&_0x5a28ea[_0x380cf5(0x243)]!==_0x380cf5(0x1d5)&&_0x5a28ea[_0x380cf5(0x243)]!=='followUpsRenderer';}function _0x5185c5(_0x37aa2b){let _0xabcc93=0x0;for(let _0x89e291 of _0x37aa2b)_0x4318fb(_0x89e291)&&_0xabcc93++;return _0xabcc93;}var _0x5dcde3={'alpha':_0x479d6c(0x20e),'staging':_0x479d6c(0x1ac),'production':_0x479d6c(0x1ba)};function _0x315f5b(_0x1c18b6){const _0x2203fc=_0x479d6c;if(_0x1c18b6[_0x2203fc(0x192)])return _0x1c18b6[_0x2203fc(0x192)];if(process.env.BACKEND_URL)return process.env.BACKEND_URL;if(!_0x1c18b6['envOption'])return _0x2203fc(0x139);let _0x5e165d=_0x5dcde3[_0x1c18b6['envOption']];if(!_0x5e165d)throw new Error(_0x2203fc(0x144)+_0x1c18b6[_0x2203fc(0x211)]+_0x2203fc(0x269)+Object['keys'](_0x5dcde3)['join'](',\x20')+'.');if(!_0x1c18b6['orgLogicalName']||!_0x1c18b6[_0x2203fc(0x19b)])throw new Error(_0x2203fc(0x167)+_0x1c18b6['envOption']+'\x22\x20requires\x20org/tenant\x20slugs.\x20Set\x20ORG_LOGICAL_NAME\x20and\x20TENANT_NAME\x20env\x20vars,\x20or\x20run\x20`delegate-cli\x20login\x20--env\x20'+_0x1c18b6[_0x2203fc(0x211)]+_0x2203fc(0x1a1));let _0x23375a=_0x5e165d+'/'+_0x1c18b6[_0x2203fc(0x1e3)]+'/'+_0x1c18b6[_0x2203fc(0x19b)]+_0x2203fc(0x1c1);return _0x544816(_0x2203fc(0x246)+_0x1c18b6[_0x2203fc(0x211)]+_0x2203fc(0x121)+_0x23375a),_0x23375a;}async function _0x5f4a21(_0x576c72){const _0x1610a8=_0x479d6c;_0x1badb3('[resolveAuth]\x20Starting\x20auth\x20resolution...');let {accessToken:_0x56c9ef,tenantId:_0x501ba9,organizationId:_0x3bcbff,userId:_0x7c7116,orgLogicalName:_0x56109,tenantName:_0x3f29ef}=Ie(_0x576c72,process.env);if(_0x1badb3(_0x1610a8(0x1b9)+(Object[_0x1610a8(0x1f4)](_0x576c72)[_0x1610a8(0x27c)](',\x20')||_0x1610a8(0x237))+_0x1610a8(0x203)+(_0x56c9ef?_0x1610a8(0x226)+_0x56c9ef[_0x1610a8(0x140)]+_0x1610a8(0x15c):'NOT\x20SET')+',\x20tenantId='+(_0x501ba9??_0x1610a8(0x215))+_0x1610a8(0x18a)+(_0x3bcbff??'NOT\x20SET')+_0x1610a8(0x14e)+(_0x7c7116??'NOT\x20SET')+_0x1610a8(0x15d)+(_0x56109??_0x1610a8(0x215))+_0x1610a8(0x16e)+(_0x3f29ef??_0x1610a8(0x215))),_0x56c9ef&&_0x501ba9&&_0x3bcbff)return _0x1badb3(_0x1610a8(0x187)),{'accessToken':_0x56c9ef,'tenantId':_0x501ba9,'organizationId':_0x3bcbff,'userId':_0x7c7116,'orgLogicalName':_0x56109,'tenantName':_0x3f29ef,'fromSavedAuth':!0x1};_0x1badb3('[resolveAuth]\x20Init\x20option\x20/\x20env\x20vars\x20incomplete,\x20trying\x20loadAndRefreshAuth()...');let _0x4d500f=await _0x35f603();return _0x4d500f?(_0x1badb3('[resolveAuth]\x20Loaded\x20saved\x20auth:\x20tenantId='+_0x4d500f[_0x1610a8(0x1e6)]+_0x1610a8(0x175)+_0x4d500f[_0x1610a8(0x1dc)]+_0x1610a8(0x17e)+_0x4d500f[_0x1610a8(0x22c)]+_0x1610a8(0x22a)+(_0x4d500f[_0x1610a8(0x17f)]??_0x1610a8(0x237))+_0x1610a8(0x1da)+!!_0x4d500f['refreshToken']+',\x20orgLogicalName='+(_0x4d500f[_0x1610a8(0x1e3)]??'none')+',\x20tenantName='+(_0x4d500f[_0x1610a8(0x19b)]??_0x1610a8(0x237))),{'accessToken':_0x4d500f[_0x1610a8(0x19c)],'tenantId':_0x4d500f[_0x1610a8(0x1e6)],'organizationId':_0x4d500f[_0x1610a8(0x1dc)],'refreshToken':_0x4d500f[_0x1610a8(0x182)],'expiresAt':_0x4d500f[_0x1610a8(0x22c)],'baseUrl':_0x4d500f[_0x1610a8(0x17f)],'orgLogicalName':_0x576c72[_0x1610a8(0x1e3)]??_0x4d500f[_0x1610a8(0x1e3)],'tenantName':_0x576c72['tenantName']??_0x4d500f['tenantName'],'clientId':_0x4d500f[_0x1610a8(0x159)],'fromSavedAuth':!0x0}):(_0x544816(_0x1610a8(0x149)),null);}async function _0x4dd99a(_0x1d935a){const _0x5b4863=_0x479d6c;let _0x434618=H(_0x1d935a[_0x5b4863(0x1d8)]);if(_0x1badb3(_0x5b4863(0x25c)+JSON['stringify']({..._0x1d935a,'auth':Object[_0x5b4863(0x1f4)](_0x434618),'backendUrl':_0x1d935a[_0x5b4863(0x240)],'interopUrl':_0x1d935a['interopUrl'],'env':_0x1d935a[_0x5b4863(0x1a4)],'model':_0x1d935a[_0x5b4863(0x1aa)],'maxSteps':_0x1d935a[_0x5b4863(0x27b)],'enableSkills':_0x1d935a[_0x5b4863(0x1cf)],'bundledSkillsPath':_0x1d935a['bundledSkillsPath'],'verbose':_0x1d935a[_0x5b4863(0x20a)],'logging':_0x1d935a[_0x5b4863(0x208)]})),_0x8032a7)throw _0x544816(_0x5b4863(0x162)),new Error(_0x5b4863(0x153));let _0x5d025a;if(_0x1d935a[_0x5b4863(0x1c5)]){if(_0x1d0df2[_0x5b4863(0x178)](_0x1d935a[_0x5b4863(0x1c5)])){_0x5d025a=_0x1d935a[_0x5b4863(0x1c5)];try{process[_0x5b4863(0x227)](_0x5d025a),_0x544816(_0x5b4863(0x223)+_0x5d025a+_0x5b4863(0x195));}catch(_0x4fea04){_0x544816('[handleInit]\x20process.chdir('+_0x5d025a+_0x5b4863(0x221)+(_0x4fea04 instanceof Error?_0x4fea04[_0x5b4863(0x27d)]:String(_0x4fea04))+_0x5b4863(0x232));}}else _0x544816(_0x5b4863(0x161)+JSON[_0x5b4863(0x202)](_0x1d935a[_0x5b4863(0x1c5)])+'\x20—\x20directory\x20does\x20not\x20exist');}let _0x1e60e8=he(_0x1d935a[_0x5b4863(0x23b)])['filter'](_0x2f9aec=>pe(_0x2f9aec)?!0x0:(_0x544816(_0x5b4863(0x260)+JSON[_0x5b4863(0x202)](_0x2f9aec)+_0x5b4863(0x15e)),!0x1));_0x1e60e8['length']>0x0&&_0x544816(_0x5b4863(0x20f)+_0x1e60e8[_0x5b4863(0x27c)](_0x45d848['delimiter'])),_0x1badb3('[handleInit]\x20Resolving\x20auth...');let _0x32fe0d=await _0x5f4a21(_0x434618);if(!_0x32fe0d){_0x544816('[handleInit]\x20ERROR:\x20No\x20auth\x20resolved');let _0x26df8f=_0x1d935a['env']??_0x5b4863(0x19e);throw new Error(_0x5b4863(0x231)+_0x26df8f+_0x5b4863(0x26e));}_0x1badb3(_0x5b4863(0x280));let _0x4cfb94={..._0xfb09fa(_0x32fe0d[_0x5b4863(0x1dc)],_0x32fe0d[_0x5b4863(0x1e6)],_0x32fe0d['userId']),...ke(process.env.USE_LLM_GATEWAY_FOR_FIREWORKS)},_0x4ef15f=_0x4cfb94[v];_0x544816(_0x5b4863(0x197)+!!_0x32fe0d[_0x5b4863(0x1dc)]+_0x5b4863(0x1b0)+!!_0x32fe0d['tenantId']+_0x5b4863(0x1ff)+!!_0x32fe0d['userId']+')'+(_0x4ef15f?';\x20'+v+'='+_0x4ef15f:''));let _0x181f2a=_0x32fe0d['fromSavedAuth']===!0x0?_0x58214b({'accessToken':_0x32fe0d[_0x5b4863(0x19c)],'organizationId':_0x32fe0d[_0x5b4863(0x1dc)],'tenantId':_0x32fe0d[_0x5b4863(0x1e6)],'clientId':_0x32fe0d[_0x5b4863(0x159)]}):null,_0x4c99a0=await _0x1dda9f(_0x32fe0d['accessToken'],_0x181f2a);_0x1badb3(_0x5b4863(0x16c)),_0x8032a7=new _0x2271aa(),_0x1badb3(_0x5b4863(0x196)),_0x1badb3(_0x5b4863(0x148));let _0x105967=0x0;_0x2edc20=0x0,_0x16ac93=_0x8032a7[_0x5b4863(0x1f1)](_0xd1d762=>{const _0x194ffe=_0x5b4863;if(!ue(_0xd1d762))return;let _0x186a16=_0x1e98d8(_0xd1d762),_0x2baad2=_0x1822f7(_0x186a16);_0x105967++,_0x1badb3(_0x194ffe(0x137)+_0x105967+_0x194ffe(0x1b5)+_0x2baad2[_0x194ffe(0x25f)]+',\x20keys='+Object[_0x194ffe(0x1f4)](_0x2baad2)[_0x194ffe(0x27c)](',')),_0x2f5dbd?.(),_0x160448({'type':_0x194ffe(0x13a),'event':_0x2baad2});}),_0x1badb3(_0x5b4863(0x23c));let _0x26c849=_0x315f5b({'backendUrlOption':_0x1d935a[_0x5b4863(0x240)],'envOption':_0x1d935a[_0x5b4863(0x1a4)],'orgLogicalName':_0x32fe0d[_0x5b4863(0x1e3)],'tenantName':_0x32fe0d[_0x5b4863(0x19b)]}),_0x5344e1;if(_0x1d935a[_0x5b4863(0x224)]!==void 0x0){let _0x14ad19=se(_0x1d935a[_0x5b4863(0x224)]);_0x14ad19?(_0x5344e1=_0x14ad19,_0x544816('[handleInit]\x20Effort\x20tier:\x20'+_0x14ad19+'\x20(forwarded\x20as\x20user_config.effort\x20on\x20every\x20chat\x20request)')):_0x544816(_0x5b4863(0x24f)+JSON[_0x5b4863(0x202)](_0x1d935a['effort'])+_0x5b4863(0x1b8)+ie()+'.\x20Model\x20recommended\x20default\x20applies.');}let _0x5615d9={'backendUrl':_0x26c849,'interopUrl':_0x1d935a[_0x5b4863(0x1e4)]??process.env.INTEROP_URL,'model':_0x36de6f(_0x1d935a[_0x5b4863(0x1aa)]),'maxSteps':_0x1d935a['maxSteps'],..._0x5d025a!==void 0x0?{'workingDirectory':_0x5d025a}:{},..._0x1e60e8['length']>0x0?{'shellPathPrepend':_0x1e60e8}:{},...le(_0x1d935a),'agentName':_0x5b4863(0x1e1),'enableComputerUse':_0x1d935a[_0x5b4863(0x1c3)]??!0x1,'enableConnections':_0x1d935a[_0x5b4863(0x14b)]??!0x1,'enableSkills':_0x1d935a['enableSkills']??!0x1,...de(_0x1d935a),..._0x1d935a[_0x5b4863(0x255)]!==void 0x0?{'bundledSkillsPath':_0x1d935a[_0x5b4863(0x255)]}:{},'verbose':_0x1d935a[_0x5b4863(0x20a)]??!0x1,'logging':_0x1d935a[_0x5b4863(0x208)]??_0x5b4863(0x1de),'effort':_0x5344e1,'requestHeaders':_0x4cfb94,'authStateProvider':((()=>{const _0xce138d=_0x5b4863;let _0x22908d=new _0x143cf4({'accessToken':_0x4c99a0,'tenantId':_0x32fe0d['tenantId'],'organizationId':_0x32fe0d[_0xce138d(0x1dc)],'userId':_0x32fe0d[_0xce138d(0x170)],'refreshToken':_0x32fe0d[_0xce138d(0x182)],'expiresAt':_0x32fe0d[_0xce138d(0x22c)],'baseUrl':_0x32fe0d[_0xce138d(0x17f)],'clientId':_0x32fe0d[_0xce138d(0x159)]});return _0xbf47ac[_0xce138d(0x129)](_0x22908d),_0x22908d;})())},_0x170f78=_0x5b4863(0x255)in _0x5615d9?_0x5615d9[_0x5b4863(0x255)]??_0x5b4863(0x237):_0x5b4863(0x1e9);_0x4a0d7c=_0x1d935a[_0x5b4863(0x1aa)],_0x544816(_0x5b4863(0x250)+_0x5615d9[_0x5b4863(0x240)]+',\x20interopUrl='+(_0x5615d9['interopUrl']??'auto-spawn\x20(bundled\x20runtime)')+_0x5b4863(0x180)+_0x5615d9[_0x5b4863(0x193)]+_0x5b4863(0x133)+(_0x5615d9[_0x5b4863(0x1aa)]??_0x5b4863(0x13c))+_0x5b4863(0x1db)+(_0x5615d9['maxSteps']??_0x5b4863(0x13c))+_0x5b4863(0x1fc)+_0x5615d9['enableComputerUse']+',\x20enableConnections='+_0x5615d9[_0x5b4863(0x14b)]+',\x20enableSkills='+_0x5615d9[_0x5b4863(0x1cf)]+_0x5b4863(0x22f)+_0x5615d9[_0x5b4863(0x1b2)]+_0x5b4863(0x204)+_0x5615d9[_0x5b4863(0x14f)]+_0x5b4863(0x168)+_0x170f78+',\x20verbose='+_0x5615d9[_0x5b4863(0x20a)]+_0x5b4863(0x191)+_0x5615d9[_0x5b4863(0x208)]);let _0x228e56=Date[_0x5b4863(0x1d0)]();try{await _0x8032a7[_0x5b4863(0x1fb)](_0x5615d9);}catch(_0x13624f){if(_0x544816(_0x5b4863(0x1ef)+(Date[_0x5b4863(0x1d0)]()-_0x228e56)+_0x5b4863(0x1d2)+_0x13624f),_0x1d0edb(),_0xbf47ac['detach'](),_0x16ac93){try{_0x16ac93();}catch(_0x844815){_0x544816(_0x5b4863(0x241)+_0x844815);}_0x16ac93=null;}try{await _0x8032a7[_0x5b4863(0x138)]();}catch(_0x2a627d){_0x544816(_0x5b4863(0x1f2)+_0x2a627d);}throw _0x8032a7=null,_0x13624f;}_0x544816(_0x5b4863(0x1f8)+(Date[_0x5b4863(0x1d0)]()-_0x228e56)+'ms'),_0x160448({'type':_0x5b4863(0x279)}),_0x1badb3(_0x5b4863(0x266));}async function _0x4c9d4e(_0x23d4aa,_0x5b469f,_0x42db42){const _0x13c459=_0x479d6c;if(_0x1badb3(_0x13c459(0x19a)+_0x2320dc(_0x23d4aa)+_0x13c459(0x1a0)+_0x23d4aa[_0x13c459(0x140)]+_0x13c459(0x267)+(_0x5b469f??'null')+_0x13c459(0x1db)+(_0x42db42??_0x13c459(0x141))),!_0x8032a7)throw _0x544816(_0x13c459(0x24c)),new Error(_0x13c459(0x281));_0x423117(),_0x8032a7[_0x13c459(0x190)](_0x42db42);let _0x16cd60=typeof _0x42db42=='number'&&_0x42db42>0x0?_0x42db42:0x0,_0x5b1a3e=ne(_0x5b469f,_0x8032a7[_0x13c459(0x20c)]()),_0x3d7a51=_0x5b1a3e?_0x8032a7[_0x13c459(0x1c0)](_0x5b1a3e):[],_0x2c857a=_0x5b1a3e?_0x8032a7[_0x13c459(0x1c6)](_0x5b1a3e)[_0x13c459(0x140)]:0x0;_0x2edc20=_0x5185c5(_0x3d7a51);let _0x11882e=_0x8032a7,_0x5f25ee=()=>{const _0x19a15b=_0x13c459;let _0x19bcd8=_0x11882e[_0x19a15b(0x20c)](),_0x474248=_0x19bcd8?_0x11882e['getTurnUsageHistory'](_0x19bcd8):[];return te(_0x5b1a3e,_0x2c857a,_0x19bcd8,_0x474248);},_0x114a1e=_e(_0x5f25ee,_0x16a134=>_0x160448({'type':_0x13c459(0x239),'usage':_0x16a134}));_0x2f5dbd=_0x114a1e,_0x1badb3(_0x13c459(0x199));let _0x4d2ee1=Date[_0x13c459(0x1d0)](),_0x667552=[],_0x47597a,_0x30a45c,_0x52db7f;try{({response:_0x47597a,failed:_0x30a45c,blankTurnRetries:_0x52db7f}=await De(_0x23d4aa,_0x5b469f??void 0x0,{'send':async(_0x2bec94,_0x382cb4)=>{const _0x1072ee=_0x13c459;let _0x29a822=await _0x11882e['sendMessage'](_0x2bec94,{'sessionId':_0x382cb4});return _0x667552[_0x1072ee(0x1a7)](..._0x29a822[_0x1072ee(0x257)]),_0x29a822;},'getSessionId':()=>_0x11882e[_0x13c459(0x20c)]()??void 0x0,'log':_0x544816}));}finally{_0x114a1e(),_0x2f5dbd=null;}let _0x1e4935=Date[_0x13c459(0x1d0)]()-_0x4d2ee1,_0x3455ea=_0x8032a7[_0x13c459(0x20c)]();_0x1badb3(_0x13c459(0x147)+_0x1e4935+'ms'),_0x1badb3(_0x13c459(0x146)+(_0x47597a?.[_0x13c459(0x140)]??0x0)+_0x13c459(0x276)+_0x3455ea),_0x1badb3(_0x13c459(0x122)+_0x2320dc(_0x47597a??'')+'\x22');let _0x424057=_0x26a635(_0x667552),_0xdfb0ab=_0x5f25ee(),_0x400538=Ae(_0xdfb0ab),_0x4ebd8e=_0xdfb0ab[_0x13c459(0x140)]>0x0?_0xdfb0ab[_0x13c459(0x140)]:_0x5185c5(_0x667552),_0x1c20f1=_0x16cd60>0x0&&_0x4ebd8e>=_0x16cd60;if(_0x424057||_0x30a45c){let _0x1a8b85=_0x424057?_0x83dcc5(_0x424057):_0x47597a;_0x544816('[handleSend]\x20Actionable\x20error\x20detected\x20this\x20turn:\x20'+_0x1a8b85),_0x160448({'type':_0x13c459(0x185),'message':'Delegate\x20backend\x20error:\x20'+_0x1a8b85}),_0x1badb3('[handleSend]\x20error\x20written\x20to\x20stdout');return;}_0x160448({'type':'result','response':_0x47597a,'sessionId':_0x3455ea,'durationMs':_0x1e4935,'assistantStepCount':_0x4ebd8e,'maxStepsReached':_0x1c20f1,'usage':_0x400538,..._0xdfb0ab[_0x13c459(0x140)]>0x0?{'turnUsages':_0xdfb0ab[_0x13c459(0x218)](L)}:{},..._0x52db7f>0x0?{'blankTurnRetries':_0x52db7f}:{},'model':_0x4a0d7c}),_0x1badb3('[handleSend]\x20result\x20written\x20to\x20stdout\x20(steps='+_0x4ebd8e+_0x13c459(0x217)+_0x1c20f1+',\x20usage='+(_0x400538?_0x400538[_0x13c459(0x249)]+'/'+_0x400538[_0x13c459(0x24d)]:'none')+_0x13c459(0x1c4)+_0xdfb0ab['length']+_0x13c459(0x1e8)+_0x52db7f+')');}async function _0x2ff092(){const _0x4762a7=_0x479d6c;if(_0x1badb3(_0x4762a7(0x19d)),_0x1d0edb(),_0x16ac93){_0x1badb3(_0x4762a7(0x143));try{_0x16ac93(),_0x1badb3(_0x4762a7(0x277));}catch(_0x3c6af6){_0x544816('[handleDestroy]\x20unsubscribeEvents\x20failed:\x20'+_0x3c6af6);}_0x16ac93=null;}else _0x1badb3(_0x4762a7(0x1fe));if(_0x8032a7){_0x1badb3(_0x4762a7(0x16d));try{await _0x8032a7['destroy'](),_0x1badb3(_0x4762a7(0x1b1));}catch(_0x56c6ac){_0x544816('[handleDestroy]\x20agent.destroy()\x20failed:\x20'+_0x56c6ac);}_0x8032a7=null,_0xbf47ac[_0x4762a7(0x1c7)]();}else _0x1badb3(_0x4762a7(0x14d));_0x4a0d7c=void 0x0,_0x2edc20=0x0,_0x160448({'type':_0x4762a7(0x23e)}),_0x1badb3(_0x4762a7(0x1a5));}async function _0x37e855(_0x42d650){const _0x2fcaee=_0x479d6c;let _0x42bed4=_0x42d650[_0x2fcaee(0x136)]();if(!_0x42bed4)return _0x1badb3(_0x2fcaee(0x13e)),!0x1;let _0x148a7a=Ee(_0x42bed4);if(_0x1badb3(_0x2fcaee(0x158)+_0x42bed4[_0x2fcaee(0x140)]+_0x2fcaee(0x135)+_0x2320dc(_0x148a7a[_0x2fcaee(0x228)])),_0x2fcaee(0x185)in _0x148a7a)return _0x544816(_0x2fcaee(0x1e0)+_0x148a7a[_0x2fcaee(0x185)]),_0x160448(_0x185758('Invalid\x20JSON\x20command:\x20'+_0x148a7a[_0x2fcaee(0x185)])),!0x1;let _0x644219=_0x148a7a[_0x2fcaee(0x1d9)];_0x1badb3('[dispatch]\x20Parsed\x20command:\x20cmd='+_0x644219['cmd']+_0x2fcaee(0x16a)+!!_0x644219[_0x2fcaee(0x181)]+_0x2fcaee(0x27f)+!!_0x644219[_0x2fcaee(0x17c)]+_0x2fcaee(0x252)+(_0x644219['sessionId']??_0x2fcaee(0x198)));try{switch(_0x644219['cmd']){case _0x2fcaee(0x256):return _0x1badb3(_0x2fcaee(0x262)),await _0x4dd99a(_0x644219[_0x2fcaee(0x181)]??{}),_0x1badb3(_0x2fcaee(0x123)),!0x1;case _0x2fcaee(0x16f):if(typeof _0x644219[_0x2fcaee(0x17c)]!=_0x2fcaee(0x18c))throw _0x544816(_0x2fcaee(0x1d1)+typeof _0x644219['prompt']),new Error('send:\x20`prompt`\x20must\x20be\x20a\x20string');return _0x1badb3(_0x2fcaee(0x130)),await _0x4c9d4e(_0x644219[_0x2fcaee(0x17c)],_0x644219['sessionId']??null,_0x644219[_0x2fcaee(0x27b)]),_0x1badb3('[dispatch]\x20handleSend\x20completed'),!0x1;case _0x2fcaee(0x138):return _0x1badb3(_0x2fcaee(0x25b)),await _0x2ff092(),_0x1badb3('[dispatch]\x20handleDestroy\x20completed,\x20will\x20exit'),!0x0;default:throw _0x544816(_0x2fcaee(0x244)+_0x644219[_0x2fcaee(0x124)]),new Error(_0x2fcaee(0x23f)+_0x644219[_0x2fcaee(0x124)]);}}catch(_0x1ea573){return _0x544816(_0x2fcaee(0x156)+_0x644219[_0x2fcaee(0x124)]+_0x2fcaee(0x1a2)+(_0x1ea573 instanceof Error?_0x1ea573[_0x2fcaee(0x27d)]:String(_0x1ea573))),_0x1ea573 instanceof Error&&_0x1ea573[_0x2fcaee(0x27e)]&&_0x544816('[dispatch]\x20Stack:\x20'+_0x1ea573[_0x2fcaee(0x27e)]),_0x160448(_0x185758(_0x1ea573)),!0x1;}}async function _0x395903(){const _0x3834cd=_0x479d6c;_0x544816(_0x3834cd(0x176)+process[_0x3834cd(0x274)]+_0x3834cd(0x273)+process[_0x3834cd(0x173)]+',\x20debug='+_0x27d496+')'),_0x1badb3(_0x3834cd(0x247)+process[_0x3834cd(0x23a)]+_0x3834cd(0x19f)+process[_0x3834cd(0x20d)]+',\x20CWD='+process[_0x3834cd(0x155)]()),_0x1badb3(_0x3834cd(0x183)+(process.env.BACKEND_URL??'not\x20set')+_0x3834cd(0x1f9)+(process.env.INTEROP_URL??_0x3834cd(0x152))),_0x1badb3('[main]\x20Env:\x20AUTH_TOKEN='+(process.env.AUTH_TOKEN?'SET':'not\x20set')+_0x3834cd(0x171)+(process.env.TENANT_ID??'not\x20set')+_0x3834cd(0x26c)+(process.env.ORG_ID??_0x3834cd(0x152))+_0x3834cd(0x1d3)+(process.env.USER_ID??_0x3834cd(0x152)));let _0x98611d=_0x18870b[_0x3834cd(0x209)]({'input':process[_0x3834cd(0x134)],'terminal':!0x1});_0x1badb3(_0x3834cd(0x242));let _0x165605=Promise[_0x3834cd(0x1eb)](),_0x4d0ffa=0x0;_0x98611d['on'](_0x3834cd(0x1fa),_0x18046f=>{const _0x4e66e=_0x3834cd;_0x4d0ffa++,_0x1badb3(_0x4e66e(0x219)+_0x4d0ffa+_0x4e66e(0x157)+_0x18046f['length']+_0x4e66e(0x15c)),_0x165605=_0x165605[_0x4e66e(0x1f6)](async()=>{const _0x255a20=_0x4e66e;_0x1badb3(_0x255a20(0x1d7)+_0x4d0ffa+_0x255a20(0x225)),await _0x37e855(_0x18046f)&&(_0x1badb3(_0x255a20(0x1ec)),_0x98611d[_0x255a20(0x216)]());});}),_0x98611d['on'](_0x3834cd(0x216),()=>{const _0x2fe022=_0x3834cd;_0x1badb3('[main]\x20readline\x20closed,\x20draining\x20pending\x20commands\x20and\x20exiting...'),_0x165605[_0x2fe022(0x282)](()=>{const _0x18b6bb=_0x2fe022;_0x1badb3(_0x18b6bb(0x235)),process[_0x18b6bb(0x12c)](0x0);});}),process['on'](_0x3834cd(0x188),_0x1af51f=>{const _0x57e8aa=_0x3834cd;_0x544816(_0x57e8aa(0x1e5)+(_0x1af51f[_0x57e8aa(0x27e)]??_0x1af51f)),_0x160448(_0x185758(_0x1af51f)),process['exit'](0x1);}),process['on']('unhandledRejection',_0xa5439f=>{const _0x10c6ef=_0x3834cd;_0x544816('[main]\x20unhandledRejection:\x20'+String(_0xa5439f)),_0x160448(_0x185758(_0xa5439f)),process[_0x10c6ef(0x12c)](0x1);}),_0x1badb3(_0x3834cd(0x25e));}_0x1badb3(_0x479d6c(0x275)),_0x395903()['catch'](_0x18600a=>{const _0x5f50f0=_0x479d6c;_0x544816(_0x5f50f0(0x272)+(_0x18600a['stack']??_0x18600a)),process['exit'](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.204.0-preview.20261005123254",
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.204.0-preview.20261005123254"
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
+ }