@uipath/codedagent-tool 1.201.0-preview.133 → 1.202.0-preview.134
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +148 -34
- package/dist/{index-2fj08e7n.js → index-gpd94m28.js} +27 -27
- package/dist/{index-w03qc9m8.js → index-sby22td6.js} +4 -4
- package/dist/index.js +4 -7
- package/dist/init.js +3 -6
- package/dist/{js-yaml-4ypbq2tt.js → js-yaml-b2jq67kn.js} +16 -16
- package/dist/{tool-0v6na3yp.js → tool-1de529jm.js} +9 -7
- package/dist/{tool-8cz4vese.js → tool-bd0jh9dt.js} +45 -19
- package/dist/{tool-26zbdsea.js → tool-s19cqcj0.js} +1643 -554
- package/dist/tool.js +6 -9
- package/package.json +2 -2
- package/dist/browser-strategy-yccf8mtd.js +0 -99
- package/dist/node-strategy-12qfy0nv.js +0 -348
- package/dist/tool-5arsyj36.js +0 -11
- package/dist/tool-7eva0peq.js +0 -265
- package/dist/tool-9qecd4wb.js +0 -14
package/README.md
CHANGED
|
@@ -1,19 +1,36 @@
|
|
|
1
1
|
# Coded Agent Tool
|
|
2
2
|
|
|
3
|
-
A command-line tool over [uipath-python](https://github.com/UiPath/uipath-python)
|
|
3
|
+
A command-line tool over [uipath-python](https://github.com/UiPath/uipath-python), installed as the `codedagent` tool in the `uip` CLI.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- Automatic Python version detection
|
|
8
8
|
- Python path caching for improved performance
|
|
9
9
|
- Package installation verification
|
|
10
|
-
-
|
|
10
|
+
- A fixed whitelist of project commands forwarded to the Python `uipath` CLI
|
|
11
11
|
|
|
12
12
|
## Commands
|
|
13
13
|
|
|
14
|
+
`setup` and `review` run natively in the CLI. Every other command is forwarded to
|
|
15
|
+
the Python `uipath` CLI, which owns its own arguments and `--help` output.
|
|
16
|
+
|
|
17
|
+
The forwarded set is a fixed whitelist (`WHITELISTED_COMMANDS` in `src/config.ts`);
|
|
18
|
+
anything outside it is rejected before it reaches Python:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
$ uip codedagent exec --output json
|
|
22
|
+
{
|
|
23
|
+
"Result": "ValidationError",
|
|
24
|
+
"ErrorCode": "invalid_argument",
|
|
25
|
+
"Message": "error: unknown command 'exec'",
|
|
26
|
+
"Instructions": "Run 'uip --help' to list available commands.",
|
|
27
|
+
"Retry": "RetryWillNotFix"
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
14
31
|
### setup
|
|
15
32
|
|
|
16
|
-
Detects Python installation
|
|
33
|
+
Detects the Python installation, locates the `uipath` executable, and caches both.
|
|
17
34
|
|
|
18
35
|
```bash
|
|
19
36
|
uip codedagent setup [options]
|
|
@@ -22,82 +39,179 @@ uip codedagent setup [options]
|
|
|
22
39
|
Options:
|
|
23
40
|
- `--force` - Force re-detection of Python even if cached
|
|
24
41
|
|
|
25
|
-
|
|
42
|
+
If the current directory contains a `.venv` but no virtual environment is
|
|
43
|
+
activated, `setup` stops and tells you to activate it first.
|
|
44
|
+
|
|
45
|
+
### review
|
|
26
46
|
|
|
27
|
-
|
|
47
|
+
Reviews a coded agent project against the deterministic rule set. Returns a
|
|
48
|
+
verdict (PASS/FAIL), score (0-100), grade (A+...F), and a list of issues.
|
|
28
49
|
|
|
29
50
|
```bash
|
|
30
|
-
uip codedagent
|
|
51
|
+
uip codedagent review [path]
|
|
31
52
|
```
|
|
32
53
|
|
|
33
54
|
Options:
|
|
34
|
-
- `--
|
|
55
|
+
- `--checks <categories>` - Comma-separated rule categories to run (default: all).
|
|
56
|
+
Known categories: `evals`, `schema`, `tools`, `guardrails`, `code`, `general`.
|
|
57
|
+
|
|
58
|
+
### Project commands
|
|
59
|
+
|
|
60
|
+
Forwarded to the Python `uipath` CLI. Run `uip codedagent <command> --help` to see
|
|
61
|
+
each command's own options.
|
|
62
|
+
|
|
63
|
+
| Command | Description |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| `add` | Create a local resource. |
|
|
66
|
+
| `debug` | Debug the project interactively. |
|
|
67
|
+
| `deploy` | Pack and publish the project. |
|
|
68
|
+
| `dev` | Launch UiPath Developer Console. |
|
|
69
|
+
| `eval` | Run an evaluation set against the agent. |
|
|
70
|
+
| `init` | Initialize or regenerate the project. |
|
|
71
|
+
| `invoke` | Invoke an agent published in my workspace. |
|
|
72
|
+
| `list-models` | List available LLM models. |
|
|
73
|
+
| `new` | Scaffold a quick-start project. |
|
|
74
|
+
| `pack` | Pack the project. |
|
|
75
|
+
| `publish` | Publish the package. |
|
|
76
|
+
| `pull` | Pull remote project files from Studio Web. |
|
|
77
|
+
| `push` | Push local project files to Studio Web. |
|
|
78
|
+
| `register` | Register a local resource. |
|
|
79
|
+
| `run` | Execute the project. |
|
|
80
|
+
|
|
81
|
+
The wrapper adds no flags of its own, and forwards the arguments you typed with
|
|
82
|
+
one exception: `--force` is always stripped before forwarding, because the Python
|
|
83
|
+
CLI does not accept it. It is a real option on `setup`, which runs natively.
|
|
84
|
+
|
|
85
|
+
Two forwarded commands need something set up first:
|
|
86
|
+
|
|
87
|
+
**`push` requires a project id.** Set `UIPATH_PROJECT_ID` in the environment, or in
|
|
88
|
+
a `.env` file in the current directory:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
echo "UIPATH_PROJECT_ID=<id>" >> .env
|
|
92
|
+
uip codedagent push
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**`deploy -w` / `publish -w` require a workspace scope.** Publishing to the personal
|
|
96
|
+
workspace calls Orchestrator `GetCurrentUserExtended`, so the login token needs
|
|
97
|
+
either the umbrella `OrchestratorApiUserAccess` scope or the granular
|
|
98
|
+
`OR.Users.Read`. Re-run `uip login` to pick it up, or publish to the tenant feed
|
|
99
|
+
with `-t` / `--tenant` to skip the lookup entirely.
|
|
100
|
+
|
|
101
|
+
`dev` takes a positional `terminal|web`. It used to take an `--interactive` flag,
|
|
102
|
+
which the Python CLI replaced with that positional in `uipath` 2.13.
|
|
103
|
+
|
|
104
|
+
### Guards and exit codes
|
|
105
|
+
|
|
106
|
+
These checks run in the CLI wrapper before anything is forwarded to Python, so CI
|
|
107
|
+
and the VS Code extension can branch on the result envelope rather than parsing a
|
|
108
|
+
Python error:
|
|
35
109
|
|
|
36
|
-
|
|
110
|
+
| Situation | `Result` | Exit code |
|
|
111
|
+
| --- | --- | --- |
|
|
112
|
+
| Command outside the whitelist | `ValidationError` | 3 |
|
|
113
|
+
| Python not configured (`setup` never run) | `ConfigError` | 1 |
|
|
114
|
+
| `push` without `UIPATH_PROJECT_ID` | `ConfigError` | 1 |
|
|
115
|
+
| `deploy` / `publish -w` without the workspace scope | `ConfigError` | 1 |
|
|
116
|
+
| `setup` with an unactivated `.venv` | `Failure` | 1 |
|
|
117
|
+
|
|
118
|
+
The Python-not-configured guard runs first, so it fires regardless of whether the
|
|
119
|
+
command's other prerequisites are met.
|
|
37
120
|
|
|
38
121
|
## Configuration
|
|
39
122
|
|
|
40
123
|
### Static Configuration
|
|
41
124
|
|
|
42
|
-
The following settings are configured in the code
|
|
125
|
+
The following settings are configured in the code:
|
|
43
126
|
|
|
44
127
|
#### Python Versions
|
|
45
128
|
|
|
46
|
-
|
|
129
|
+
Accepted versions: `3.14`, `3.13`, `3.12`, `3.11`
|
|
130
|
+
|
|
131
|
+
This is an allowlist, not a priority order. `setup` walks a list of candidate
|
|
132
|
+
commands and takes the first one whose reported `major.minor` is accepted:
|
|
133
|
+
|
|
134
|
+
- **Windows** - `python`, `python3`, then `python<version>` for each accepted
|
|
135
|
+
version, then `py -<version>` for each, then `py`.
|
|
136
|
+
- **Linux/macOS** - `python<version>` for each accepted version, then `python3`,
|
|
137
|
+
then `python`.
|
|
138
|
+
|
|
139
|
+
So on Windows a bare `python` on `PATH` wins whenever its version is accepted, no
|
|
140
|
+
matter which versions sit earlier in the list; the list order only sequences the
|
|
141
|
+
`python<version>` and `py -<version>` fallbacks. On Linux/macOS those
|
|
142
|
+
version-specific candidates come first, so there the list order does act as a
|
|
143
|
+
preference.
|
|
47
144
|
|
|
48
|
-
Override with `PYTHON_TOOL_PYTHON_VERSIONS` environment variable
|
|
145
|
+
Override with the `PYTHON_TOOL_PYTHON_VERSIONS` environment variable, which
|
|
146
|
+
replaces the list entirely:
|
|
49
147
|
|
|
50
148
|
```bash
|
|
51
149
|
# Windows
|
|
52
|
-
set PYTHON_TOOL_PYTHON_VERSIONS=3.13,3.12,3.11
|
|
150
|
+
set PYTHON_TOOL_PYTHON_VERSIONS=3.14,3.13,3.12,3.11
|
|
53
151
|
|
|
54
152
|
# Linux/macOS
|
|
55
|
-
export PYTHON_TOOL_PYTHON_VERSIONS=3.13,3.12,3.11
|
|
153
|
+
export PYTHON_TOOL_PYTHON_VERSIONS=3.14,3.13,3.12,3.11
|
|
56
154
|
```
|
|
57
155
|
|
|
58
156
|
### Cache File
|
|
59
157
|
|
|
60
|
-
|
|
158
|
+
`setup` writes `~/.uipath/.uipath-python-cache.json`, shared with
|
|
159
|
+
`context-grounding-tool` — the other `uipath-python-bridge` consumer. It stores:
|
|
61
160
|
- Detected Python path
|
|
62
161
|
- Python version
|
|
63
|
-
- Package name
|
|
64
162
|
- Last validation timestamp
|
|
163
|
+
- Package name
|
|
164
|
+
- Resolved `uipath` executable path
|
|
165
|
+
- Installed package version
|
|
65
166
|
|
|
66
|
-
If the cached
|
|
167
|
+
If the cached path no longer exists, `setup` re-detects automatically. The
|
|
168
|
+
forwarded commands do not re-detect - they fail with a `ConfigError` pointing back
|
|
169
|
+
at `setup`:
|
|
67
170
|
|
|
68
171
|
```
|
|
69
|
-
uip codedagent
|
|
70
|
-
|
|
71
|
-
|
|
172
|
+
$ uip codedagent run --output json
|
|
173
|
+
{
|
|
174
|
+
"Result": "ConfigError",
|
|
175
|
+
"Message": "uipath executable not found. Please install it using 'pip install uipath' or 'uv add uipath'.",
|
|
176
|
+
"Instructions": "Run 'uip codedagent setup' first to configure the environment. If you are using a virtual environment, activate it first.",
|
|
177
|
+
"ErrorCode": "configuration_error",
|
|
178
|
+
"Retry": "RetryWillNotFix"
|
|
179
|
+
}
|
|
72
180
|
```
|
|
73
181
|
|
|
74
182
|
## Examples
|
|
75
183
|
|
|
76
184
|
```bash
|
|
77
|
-
#
|
|
185
|
+
# Detect Python and verify the uipath package is installed
|
|
78
186
|
uip codedagent setup
|
|
79
187
|
|
|
80
188
|
# Force re-detection
|
|
81
189
|
uip codedagent setup --force
|
|
82
190
|
|
|
83
|
-
#
|
|
84
|
-
|
|
85
|
-
uip codedagent
|
|
191
|
+
# Scaffold a project, then initialize it
|
|
192
|
+
uip codedagent new my-agent
|
|
193
|
+
uip codedagent init
|
|
194
|
+
|
|
195
|
+
# Execute the project
|
|
196
|
+
uip codedagent run
|
|
86
197
|
|
|
87
|
-
#
|
|
198
|
+
# See a forwarded command's own options
|
|
88
199
|
uip codedagent run --help
|
|
89
|
-
uip codedagent run command --option value
|
|
90
200
|
|
|
91
|
-
#
|
|
92
|
-
uip codedagent
|
|
201
|
+
# Launch the developer console in the browser
|
|
202
|
+
uip codedagent dev web
|
|
93
203
|
|
|
94
|
-
#
|
|
95
|
-
|
|
96
|
-
|
|
204
|
+
# Review a project, schema and eval rules only
|
|
205
|
+
uip codedagent review . --checks schema,evals
|
|
206
|
+
|
|
207
|
+
# Push local files to Studio Web
|
|
208
|
+
echo "UIPATH_PROJECT_ID=<id>" >> .env
|
|
209
|
+
uip codedagent push
|
|
210
|
+
|
|
211
|
+
# Publish to the tenant feed instead of the personal workspace
|
|
212
|
+
uip codedagent deploy --tenant
|
|
97
213
|
|
|
98
|
-
#
|
|
99
|
-
export PYTHON_TOOL_PYTHON_VERSIONS=3.
|
|
100
|
-
export CLOUD_TOOL_PACKAGE_NAME=uipath-python
|
|
214
|
+
# Restrict Python detection to a single version
|
|
215
|
+
export PYTHON_TOOL_PYTHON_VERSIONS=3.13
|
|
101
216
|
uip codedagent setup
|
|
102
|
-
uip codedagent run --version
|
|
103
217
|
```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./tool-
|
|
1
|
+
import"./tool-1de529jm.js";
|
|
2
2
|
|
|
3
3
|
// ../../node_modules/@jmespath-community/jmespath/dist/index.mjs
|
|
4
4
|
var isObject = (obj) => {
|
|
@@ -2027,32 +2027,32 @@ var jmespath = {
|
|
|
2027
2027
|
TYPE_STRING
|
|
2028
2028
|
};
|
|
2029
2029
|
export {
|
|
2030
|
-
|
|
2031
|
-
tokenize,
|
|
2032
|
-
search,
|
|
2033
|
-
registerFunction,
|
|
2034
|
-
register,
|
|
2035
|
-
jmespath,
|
|
2036
|
-
isRegistered,
|
|
2037
|
-
getRegisteredFunctions,
|
|
2038
|
-
getCustomFunctions,
|
|
2039
|
-
jmespath as default,
|
|
2040
|
-
compile,
|
|
2041
|
-
clearCustomFunctions,
|
|
2042
|
-
TreeInterpreter2 as TreeInterpreter,
|
|
2043
|
-
TYPE_STRING,
|
|
2044
|
-
TYPE_OBJECT,
|
|
2045
|
-
TYPE_NUMBER,
|
|
2046
|
-
TYPE_NULL,
|
|
2047
|
-
TYPE_EXPREF,
|
|
2048
|
-
TYPE_BOOLEAN,
|
|
2049
|
-
TYPE_ARRAY_STRING,
|
|
2050
|
-
TYPE_ARRAY_OBJECT,
|
|
2051
|
-
TYPE_ARRAY_NUMBER,
|
|
2052
|
-
TYPE_ARRAY_ARRAY,
|
|
2053
|
-
TYPE_ARRAY,
|
|
2030
|
+
Scope,
|
|
2054
2031
|
TYPE_ANY,
|
|
2055
|
-
|
|
2032
|
+
TYPE_ARRAY,
|
|
2033
|
+
TYPE_ARRAY_ARRAY,
|
|
2034
|
+
TYPE_ARRAY_NUMBER,
|
|
2035
|
+
TYPE_ARRAY_OBJECT,
|
|
2036
|
+
TYPE_ARRAY_STRING,
|
|
2037
|
+
TYPE_BOOLEAN,
|
|
2038
|
+
TYPE_EXPREF,
|
|
2039
|
+
TYPE_NULL,
|
|
2040
|
+
TYPE_NUMBER,
|
|
2041
|
+
TYPE_OBJECT,
|
|
2042
|
+
TYPE_STRING,
|
|
2043
|
+
TreeInterpreter2 as TreeInterpreter,
|
|
2044
|
+
clearCustomFunctions,
|
|
2045
|
+
compile,
|
|
2046
|
+
jmespath as default,
|
|
2047
|
+
getCustomFunctions,
|
|
2048
|
+
getRegisteredFunctions,
|
|
2049
|
+
isRegistered,
|
|
2050
|
+
jmespath,
|
|
2051
|
+
register,
|
|
2052
|
+
registerFunction,
|
|
2053
|
+
search,
|
|
2054
|
+
tokenize,
|
|
2055
|
+
unregisterFunction
|
|
2056
2056
|
};
|
|
2057
2057
|
|
|
2058
|
-
//# debugId=
|
|
2058
|
+
//# debugId=046020B702C7051664756E2164756E21
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./tool-
|
|
1
|
+
import"./tool-1de529jm.js";
|
|
2
2
|
|
|
3
3
|
// ../../node_modules/open/index.js
|
|
4
4
|
import process7 from "node:process";
|
|
@@ -626,9 +626,9 @@ defineLazyProperty(apps, "safari", () => detectPlatformBinary({
|
|
|
626
626
|
}));
|
|
627
627
|
var open_default = open;
|
|
628
628
|
export {
|
|
629
|
-
|
|
629
|
+
apps,
|
|
630
630
|
open_default as default,
|
|
631
|
-
|
|
631
|
+
openApp
|
|
632
632
|
};
|
|
633
633
|
|
|
634
|
-
//# debugId=
|
|
634
|
+
//# debugId=42C9AEC59ECC644E64756E2164756E21
|
package/dist/index.js
CHANGED
|
@@ -2,14 +2,11 @@
|
|
|
2
2
|
import {
|
|
3
3
|
metadata,
|
|
4
4
|
registerCommands
|
|
5
|
-
} from "./tool-
|
|
5
|
+
} from "./tool-bd0jh9dt.js";
|
|
6
6
|
import {
|
|
7
7
|
Command
|
|
8
|
-
} from "./tool-
|
|
9
|
-
import"./tool-
|
|
10
|
-
import"./tool-7eva0peq.js";
|
|
11
|
-
import"./tool-5arsyj36.js";
|
|
12
|
-
import"./tool-0v6na3yp.js";
|
|
8
|
+
} from "./tool-s19cqcj0.js";
|
|
9
|
+
import"./tool-1de529jm.js";
|
|
13
10
|
|
|
14
11
|
// src/index.ts
|
|
15
12
|
var program = new Command;
|
|
@@ -17,4 +14,4 @@ program.name(metadata.name).version(metadata.version).description(metadata.descr
|
|
|
17
14
|
await registerCommands(program);
|
|
18
15
|
program.parse(process.argv);
|
|
19
16
|
|
|
20
|
-
//# debugId=
|
|
17
|
+
//# debugId=8E1A7BFAC0CD464264756E2164756E21
|
package/dist/init.js
CHANGED
|
@@ -2,11 +2,8 @@ import {
|
|
|
2
2
|
COMMAND_RULES,
|
|
3
3
|
codedAgentCommandPreflight,
|
|
4
4
|
runUipathPythonCommand
|
|
5
|
-
} from "./tool-
|
|
6
|
-
import"./tool-
|
|
7
|
-
import"./tool-7eva0peq.js";
|
|
8
|
-
import"./tool-5arsyj36.js";
|
|
9
|
-
import"./tool-0v6na3yp.js";
|
|
5
|
+
} from "./tool-s19cqcj0.js";
|
|
6
|
+
import"./tool-1de529jm.js";
|
|
10
7
|
|
|
11
8
|
// src/services/codedagent-init-service.ts
|
|
12
9
|
async function codedagentInitAsync(options) {
|
|
@@ -37,4 +34,4 @@ export {
|
|
|
37
34
|
codedagentInitAsync
|
|
38
35
|
};
|
|
39
36
|
|
|
40
|
-
//# debugId=
|
|
37
|
+
//# debugId=7838E7CC8362043A64756E2164756E21
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./tool-
|
|
1
|
+
import"./tool-1de529jm.js";
|
|
2
2
|
|
|
3
3
|
// ../../node_modules/js-yaml/dist/js-yaml.mjs
|
|
4
4
|
function getDefaultExportFromCjs(x) {
|
|
@@ -3125,21 +3125,21 @@ var {
|
|
|
3125
3125
|
safeDump
|
|
3126
3126
|
} = yaml;
|
|
3127
3127
|
export {
|
|
3128
|
-
|
|
3129
|
-
safeLoadAll,
|
|
3130
|
-
safeLoad,
|
|
3131
|
-
safeDump,
|
|
3132
|
-
loadAll,
|
|
3133
|
-
load,
|
|
3134
|
-
dump,
|
|
3135
|
-
yaml as default,
|
|
3136
|
-
YAMLException,
|
|
3137
|
-
Type,
|
|
3138
|
-
Schema,
|
|
3139
|
-
JSON_SCHEMA,
|
|
3140
|
-
FAILSAFE_SCHEMA,
|
|
3128
|
+
CORE_SCHEMA,
|
|
3141
3129
|
DEFAULT_SCHEMA,
|
|
3142
|
-
|
|
3130
|
+
FAILSAFE_SCHEMA,
|
|
3131
|
+
JSON_SCHEMA,
|
|
3132
|
+
Schema,
|
|
3133
|
+
Type,
|
|
3134
|
+
YAMLException,
|
|
3135
|
+
yaml as default,
|
|
3136
|
+
dump,
|
|
3137
|
+
load,
|
|
3138
|
+
loadAll,
|
|
3139
|
+
safeDump,
|
|
3140
|
+
safeLoad,
|
|
3141
|
+
safeLoadAll,
|
|
3142
|
+
types
|
|
3143
3143
|
};
|
|
3144
3144
|
|
|
3145
|
-
//# debugId=
|
|
3145
|
+
//# debugId=3FF8535573D0966A64756E2164756E21
|
|
@@ -19,12 +19,14 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
19
19
|
}
|
|
20
20
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
21
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
|
+
for (let key of __getOwnPropNames(mod))
|
|
24
|
+
if (!__hasOwnProp.call(to, key))
|
|
25
|
+
__defProp(to, key, {
|
|
26
|
+
get: __accessProp.bind(mod, key),
|
|
27
|
+
enumerable: true
|
|
28
|
+
});
|
|
29
|
+
}
|
|
28
30
|
if (canCache)
|
|
29
31
|
cache.set(mod, to);
|
|
30
32
|
return to;
|
|
@@ -34,4 +36,4 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
|
34
36
|
|
|
35
37
|
export { __toESM, __commonJS, __require };
|
|
36
38
|
|
|
37
|
-
//# debugId=
|
|
39
|
+
//# debugId=4A15A0D6FCDB684764756E2164756E21
|
|
@@ -8,20 +8,18 @@ import {
|
|
|
8
8
|
createExecuteCommand,
|
|
9
9
|
createSetupCommand,
|
|
10
10
|
extractErrorMessageSync,
|
|
11
|
+
getFileSystem,
|
|
11
12
|
processContext,
|
|
12
13
|
trackShipSucceeded
|
|
13
|
-
} from "./tool-
|
|
14
|
-
import {
|
|
15
|
-
getFileSystem
|
|
16
|
-
} from "./tool-7eva0peq.js";
|
|
14
|
+
} from "./tool-s19cqcj0.js";
|
|
17
15
|
import {
|
|
18
16
|
__require
|
|
19
|
-
} from "./tool-
|
|
17
|
+
} from "./tool-1de529jm.js";
|
|
20
18
|
// package.json
|
|
21
19
|
var package_default = {
|
|
22
20
|
name: "@uipath/codedagent-tool",
|
|
23
21
|
license: "MIT",
|
|
24
|
-
version: "1.
|
|
22
|
+
version: "1.202.0-preview.134",
|
|
25
23
|
description: "Build, run, deploy, and manage AI Agents.",
|
|
26
24
|
keywords: [
|
|
27
25
|
"cli-tool",
|
|
@@ -1002,9 +1000,9 @@ var init_is_in_ssh = __esm(() => {
|
|
|
1002
1000
|
});
|
|
1003
1001
|
var exports_open = {};
|
|
1004
1002
|
__export(exports_open, {
|
|
1005
|
-
|
|
1003
|
+
apps: () => apps,
|
|
1006
1004
|
default: () => open_default,
|
|
1007
|
-
|
|
1005
|
+
openApp: () => openApp
|
|
1008
1006
|
});
|
|
1009
1007
|
function detectArchBinary(binary) {
|
|
1010
1008
|
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
@@ -1553,7 +1551,7 @@ class InvalidBaseUrlError extends Error {
|
|
|
1553
1551
|
super(`Invalid base URL: "${url}"
|
|
1554
1552
|
` + `Reason: ${reason}
|
|
1555
1553
|
|
|
1556
|
-
` + `Expected format: an https:// URL, e.g. https://cloud.uipath.com (commercial), https://govcloud.uipath.us (Public Sector), or your Automation Suite host (https://<your-host>).
|
|
1554
|
+
` + `Expected format: an https:// URL (or bare host — https:// is assumed), e.g. https://cloud.uipath.com (commercial), https://govcloud.uipath.us (Public Sector), or your Automation Suite host (https://<your-host>).
|
|
1557
1555
|
` + `You can specify the URL via:
|
|
1558
1556
|
` + ` • --authority flag
|
|
1559
1557
|
` + ` • UIPATH_URL environment variable
|
|
@@ -1574,10 +1572,16 @@ var normalizeAndValidateBaseUrl = (rawUrl) => {
|
|
|
1574
1572
|
while (baseUrl.endsWith("/")) {
|
|
1575
1573
|
baseUrl = baseUrl.slice(0, -1);
|
|
1576
1574
|
}
|
|
1575
|
+
const hasScheme = /^[a-z][a-z0-9+.-]*:\/\//i.test(baseUrl);
|
|
1576
|
+
const [hostCandidate] = baseUrl.split(/[/?#]/, 1);
|
|
1577
|
+
if (!hasScheme && hostCandidate.includes(".")) {
|
|
1578
|
+
baseUrl = `https://${baseUrl}`;
|
|
1579
|
+
}
|
|
1577
1580
|
const resolvedBaseUrl = baseUrl;
|
|
1578
1581
|
const [urlError, url] = catchError2(() => new URL(resolvedBaseUrl));
|
|
1579
1582
|
if (urlError) {
|
|
1580
|
-
|
|
1583
|
+
const shapeHint = !hasScheme && !hostCandidate.includes(".") ? ` "${rawUrl.trim()}" is not a URL or a host name. Pass the full authority URL — https://<host>, or just <host> (https:// is assumed).` : ` ${urlError instanceof Error ? urlError.message : "Unknown error"}`;
|
|
1584
|
+
throw new InvalidBaseUrlError(baseUrl, `Malformed URL.${shapeHint}`);
|
|
1581
1585
|
}
|
|
1582
1586
|
if (url.protocol !== "https:") {
|
|
1583
1587
|
throw new InvalidBaseUrlError(baseUrl, `Authority must use https:// scheme, got ${url.protocol}//. OIDC token exchange requires TLS end-to-end.`);
|
|
@@ -1855,6 +1859,17 @@ var requireEnv = (name) => {
|
|
|
1855
1859
|
}
|
|
1856
1860
|
return value;
|
|
1857
1861
|
};
|
|
1862
|
+
var OPAQUE_TOKEN_BASE_URL_VAR = "UIPATH_URL";
|
|
1863
|
+
var resolveBaseUrl = (rawUrl, failureContext) => {
|
|
1864
|
+
const [baseUrlError, baseUrl] = catchError2(() => normalizeAndValidateBaseUrl(rawUrl));
|
|
1865
|
+
if (baseUrlError) {
|
|
1866
|
+
if (baseUrlError instanceof InvalidBaseUrlError) {
|
|
1867
|
+
throw baseUrlError;
|
|
1868
|
+
}
|
|
1869
|
+
throw new EnvAuthConfigError(`${failureContext}: ` + `${baseUrlError instanceof Error ? baseUrlError.message : String(baseUrlError)}`);
|
|
1870
|
+
}
|
|
1871
|
+
return baseUrl;
|
|
1872
|
+
};
|
|
1858
1873
|
var readAuthFromEnv = () => {
|
|
1859
1874
|
const accessToken = requireEnv(ENV_AUTH_VARS.token);
|
|
1860
1875
|
const organizationName = requireEnv(ENV_AUTH_VARS.organizationName);
|
|
@@ -1863,19 +1878,29 @@ var readAuthFromEnv = () => {
|
|
|
1863
1878
|
const tenantId = requireEnv(ENV_AUTH_VARS.tenantId);
|
|
1864
1879
|
const [parseError, payload] = catchError2(() => parseJWT(accessToken));
|
|
1865
1880
|
if (parseError) {
|
|
1866
|
-
|
|
1881
|
+
const parseErrorMessage = parseError instanceof Error ? parseError.message : String(parseError);
|
|
1882
|
+
const rawUrl = process.env[OPAQUE_TOKEN_BASE_URL_VAR];
|
|
1883
|
+
if (!rawUrl) {
|
|
1884
|
+
throw new EnvAuthConfigError(`${ENV_AUTH_VARS.token} is not a JWT (treating it as an opaque token, ` + `e.g. a Personal Access Token). Set ${OPAQUE_TOKEN_BASE_URL_VAR} to the ` + `UiPath base URL if this is a PAT, or fix the token if it was meant to ` + `be a JWT (parse error: ${parseErrorMessage}).`);
|
|
1885
|
+
}
|
|
1886
|
+
const baseUrl2 = resolveBaseUrl(rawUrl, `Failed to validate ${OPAQUE_TOKEN_BASE_URL_VAR}`);
|
|
1887
|
+
return {
|
|
1888
|
+
loginStatus: "Logged in",
|
|
1889
|
+
accessToken,
|
|
1890
|
+
baseUrl: baseUrl2,
|
|
1891
|
+
organizationName,
|
|
1892
|
+
organizationId,
|
|
1893
|
+
tenantName,
|
|
1894
|
+
tenantId,
|
|
1895
|
+
source: "env-vars",
|
|
1896
|
+
hint: "Token is opaque (not a JWT) - expiration and identity cannot be " + "determined locally. Commands will fail with 401 once it is revoked or " + `expired. If this was meant to be a JWT instead of a PAT, note: ${parseErrorMessage}`
|
|
1897
|
+
};
|
|
1867
1898
|
}
|
|
1868
1899
|
const iss = payload.iss;
|
|
1869
1900
|
if (typeof iss !== "string" || iss.length === 0) {
|
|
1870
1901
|
throw new EnvAuthConfigError(`${ENV_AUTH_VARS.token} has no 'iss' claim; cannot determine ` + `the UiPath server. Ensure the token was issued by a UiPath identity server.`);
|
|
1871
1902
|
}
|
|
1872
|
-
const
|
|
1873
|
-
if (baseUrlError) {
|
|
1874
|
-
if (baseUrlError instanceof InvalidBaseUrlError) {
|
|
1875
|
-
throw baseUrlError;
|
|
1876
|
-
}
|
|
1877
|
-
throw new EnvAuthConfigError(`Failed to derive server URL from token 'iss' claim: ` + `${baseUrlError instanceof Error ? baseUrlError.message : String(baseUrlError)}`);
|
|
1878
|
-
}
|
|
1903
|
+
const baseUrl = resolveBaseUrl(iss, "Failed to derive server URL from token 'iss' claim");
|
|
1879
1904
|
const expiration = getTokenExpiration(accessToken);
|
|
1880
1905
|
const loginStatus = expiration && expiration <= new Date ? "Expired" : "Logged in";
|
|
1881
1906
|
const identity = resolveSessionIdentity(accessToken);
|
|
@@ -2771,6 +2796,7 @@ function errorMessage(error) {
|
|
|
2771
2796
|
}
|
|
2772
2797
|
init_constants();
|
|
2773
2798
|
init_src();
|
|
2799
|
+
init_constants();
|
|
2774
2800
|
var IDENTIFIER_STATUSES = new Set([400, 403, 404]);
|
|
2775
2801
|
var TENANT_SELECTION_REQUIRED_CODE = "TENANT_SELECTION_REQUIRED";
|
|
2776
2802
|
var INVALID_TENANT_CODE = "INVALID_TENANT";
|
|
@@ -3182,4 +3208,4 @@ var registerCommands = async (program) => {
|
|
|
3182
3208
|
|
|
3183
3209
|
export { metadata, registerCommands };
|
|
3184
3210
|
|
|
3185
|
-
//# debugId=
|
|
3211
|
+
//# debugId=FFE144F0AB98834464756E2164756E21
|