@uipath/function-tool 1.203.0-preview.203 → 1.204.0-preview.206

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 CHANGED
@@ -14,7 +14,7 @@ into Studio Web.
14
14
  | Project | Needs |
15
15
  |---|---|
16
16
  | JS/TS | Node.js 20 or later. The CLI checks this for you on `new`. |
17
- | Python | The `uipath` Python CLI: `pip install uipath`, then `uipath auth login`. |
17
+ | Python | The `uipath` Python CLI: `pip install uipath`, then `uipath auth login`. Run `uip function setup` once so the CLI knows where to find it. |
18
18
 
19
19
  Everything else is installed for you.
20
20
 
@@ -82,6 +82,7 @@ signature changes. JS/TS needs no equivalent — it reads your types directly.
82
82
  | `publish` | Upload the `.nupkg` to an Orchestrator feed | both |
83
83
  | `push` | Sync the project into a Studio Web project | both |
84
84
  | `runtime-install` | Prepare a runner folder — used by the platform, rarely by hand | JS/TS |
85
+ | `setup` | Find your toolchains and remember where they are | both |
85
86
 
86
87
  `uip functions` still works as an alias for `uip function`.
87
88
 
@@ -106,6 +107,16 @@ Python scaffolds into the current directory.
106
107
  You only need `--language` for the first command in an empty directory. After
107
108
  that the project files say which language it is.
108
109
 
110
+ For Python, `new` is forwarded with `--type function`, so an agent framework
111
+ installed in the venv cannot claim the scaffold. The flag is sent only when the
112
+ installed `uipath new` advertises it, which the bridge checks with one
113
+ `uipath new --help` call.
114
+
115
+ `--type` is not an option this command takes: `uip function new` always
116
+ scaffolds a function, so passing one exits `1` with
117
+ `--type is not a valid option.` rather than being honoured or silently
118
+ overridden. For a coded agent, use `uip codedagent new`.
119
+
109
120
  ### `run [name]`
110
121
 
111
122
  ```sh
@@ -192,6 +203,26 @@ Uploads the files that changed, so it is safe to run repeatedly.
192
203
  > is never forwarded for either verb, and Python resolves the project from its
193
204
  > own config.
194
205
 
206
+ ### `setup`
207
+
208
+ ```sh
209
+ uip function setup
210
+ uip function setup --force # probe again, ignoring what was cached
211
+ ```
212
+
213
+ Finds Node.js for JS/TS, and Python plus the `uipath` package for Python, and
214
+ remembers where they are so later commands do not look again.
215
+
216
+ Missing Node is an error — JS/TS cannot run without it. Missing Python is
217
+ reported and then ignored, because a JS/TS-only project does not need it. The
218
+ Node half runs by itself before `new` for JS/TS, so you only run this by hand
219
+ to add Python or to repair a stale answer.
220
+
221
+ Python Functions commands fail with a `ConfigError` pointing back here until it
222
+ has run once; there is no fallback to whatever `uipath` happens to be on your
223
+ `PATH`. The Python answer is shared with `uip codedagent` and
224
+ `uip context-grounding`, so running any one of their setups configures them all.
225
+
195
226
  ## Troubleshooting
196
227
 
197
228
  **"No Functions project detected in this directory."** You are not in a project
@@ -205,6 +236,9 @@ wanted an empty project, that is `uip function new <name> --empty`.
205
236
  on your `PATH`. After installing it, `uip function setup --force` re-runs the
206
237
  check.
207
238
 
239
+ **"Python not configured" on a Python project.** `uip function setup` has not
240
+ run yet, or the interpreter it found has gone. Run `uip function setup --force`.
241
+
208
242
  **`run` cannot find a function you just added.** Names resolve through the
209
243
  project's function list, which `run` never regenerates. Run
210
244
  `uip function pack` once, or start `uip function serve`, to refresh it.
@@ -212,5 +246,9 @@ project's function list, which `run` never regenerates. Run
212
246
  ## Known issues
213
247
 
214
248
  - **`uip function new --language py` scaffolds an agent instead of a function**
215
- when `uipath-langchain` is installed. Tracked in
216
- [uipath-python#1543](https://github.com/UiPath/uipath-python/issues/1543).
249
+ when `uipath-langchain` is installed and the venv's `uipath` predates
250
+ `uipath new --type` — that core's scaffold follows the installed packages
251
+ ([uipath-python#1543](https://github.com/UiPath/uipath-python/issues/1543)).
252
+ Once the core has the option, the tool forwards `--type function`, which pins
253
+ the scaffold; upgrade the core to get that behavior. Check yours with
254
+ `uipath new --help`: a listed `--type` means the pin is in effect.
@@ -0,0 +1,157 @@
1
+ import {
2
+ AUTH_FLOW_ENV_VAR,
3
+ AuthProfileValidationError,
4
+ ClientCredentialsAuthenticationError,
5
+ CredentialSource,
6
+ DEFAULT_AUTH_FILENAME,
7
+ DEFAULT_AUTH_PROFILE,
8
+ DEFAULT_ENV_FILENAME,
9
+ ENFORCE_ROBOT_AUTH_VAR,
10
+ ENV_AUTH_ENABLE_VAR,
11
+ ENV_AUTH_VARS,
12
+ EnvAuthConfigError,
13
+ FederatedCredentialsAuthenticationError,
14
+ INVALID_TENANT_CODE,
15
+ InvalidBaseUrlError,
16
+ InvalidTenantError,
17
+ JWT_BEARER_ASSERTION_TYPE,
18
+ TENANT_SELECTION_REQUIRED_CODE,
19
+ TenantSelectionError,
20
+ TenantSelectionRequiredError,
21
+ TokenRefreshOAuthError,
22
+ authProfileExistsAsync,
23
+ authenticate,
24
+ clearActiveAuthProfile,
25
+ clearRefreshBreaker,
26
+ clientCredentialsLogin,
27
+ deleteAuthProfileAsync,
28
+ describeAuthProfilesAsync,
29
+ federatedCredentialsLogin,
30
+ fetchTenantsAndOrganizations,
31
+ getActiveAuthProfile,
32
+ getActiveAuthProfileFilePath,
33
+ getAuthContext,
34
+ getAuthEnv,
35
+ getAuthProfilesRootPath,
36
+ getLoginStatusAsync,
37
+ getLoginStatusWithDeps,
38
+ interactiveLogin,
39
+ interactiveLoginWithDeps,
40
+ isEnvAuthEnabled,
41
+ isRobotAuthEnforced,
42
+ isTenantSelectionError,
43
+ isTokenRefreshOAuthFailure,
44
+ listAuthProfileNamesAsync,
45
+ loadEnvFileAsync,
46
+ loadRefreshBreaker,
47
+ logout,
48
+ logoutWithDeps,
49
+ normalizeAuthProfileName,
50
+ parseAuthFlow,
51
+ parseJWT,
52
+ readAuthFromEnv,
53
+ readTokenScopes,
54
+ refreshAccessToken,
55
+ refreshTokenFingerprint,
56
+ registerRobotClientLoader,
57
+ resolveAuthProfileDirPath,
58
+ resolveAuthProfileFilePath,
59
+ resolveEnvFileLocationAsync,
60
+ resolveEnvFilePathAsync,
61
+ resolveSessionIdentity,
62
+ runWithAuthProfile,
63
+ saveEnvFileAsync,
64
+ saveRefreshBreaker,
65
+ selectTenantWithDeps,
66
+ setActiveAuthProfile,
67
+ setAuthFileConfig
68
+ } from "./packager-tool-4r3qztwy.js";
69
+ import {
70
+ isBrowser,
71
+ isNode
72
+ } from "./packager-tool-0gctz400.js";
73
+ import"./packager-tool-qa9gftnj.js";
74
+ import"./packager-tool-g0hcxnae.js";
75
+ import {
76
+ AUTH_CANCELLED_ERROR_CODE,
77
+ AUTH_RECLAIMED_ERROR_CODE,
78
+ AUTH_TIMEOUT_ERROR_CODE,
79
+ DEFAULT_AUTH_TIMEOUT_MS
80
+ } from "./packager-tool-yc4kw997.js";
81
+ import"./packager-tool-1de529jm.js";
82
+ export {
83
+ AUTH_CANCELLED_ERROR_CODE,
84
+ AUTH_FLOW_ENV_VAR,
85
+ AUTH_RECLAIMED_ERROR_CODE,
86
+ AUTH_TIMEOUT_ERROR_CODE,
87
+ AuthProfileValidationError,
88
+ ClientCredentialsAuthenticationError,
89
+ CredentialSource,
90
+ DEFAULT_AUTH_FILENAME,
91
+ DEFAULT_AUTH_PROFILE,
92
+ DEFAULT_AUTH_TIMEOUT_MS,
93
+ DEFAULT_ENV_FILENAME,
94
+ ENFORCE_ROBOT_AUTH_VAR,
95
+ ENV_AUTH_ENABLE_VAR,
96
+ ENV_AUTH_VARS,
97
+ EnvAuthConfigError,
98
+ FederatedCredentialsAuthenticationError,
99
+ INVALID_TENANT_CODE,
100
+ InvalidBaseUrlError,
101
+ InvalidTenantError,
102
+ JWT_BEARER_ASSERTION_TYPE,
103
+ TENANT_SELECTION_REQUIRED_CODE,
104
+ TenantSelectionError,
105
+ TenantSelectionRequiredError,
106
+ TokenRefreshOAuthError,
107
+ authProfileExistsAsync,
108
+ authenticate,
109
+ clearActiveAuthProfile,
110
+ clearRefreshBreaker,
111
+ clientCredentialsLogin,
112
+ deleteAuthProfileAsync,
113
+ describeAuthProfilesAsync,
114
+ federatedCredentialsLogin,
115
+ fetchTenantsAndOrganizations,
116
+ getActiveAuthProfile,
117
+ getActiveAuthProfileFilePath,
118
+ getAuthContext,
119
+ getAuthEnv,
120
+ getAuthProfilesRootPath,
121
+ getLoginStatusAsync,
122
+ getLoginStatusWithDeps,
123
+ interactiveLogin,
124
+ interactiveLoginWithDeps,
125
+ isBrowser,
126
+ isEnvAuthEnabled,
127
+ isNode,
128
+ isRobotAuthEnforced,
129
+ isTenantSelectionError,
130
+ isTokenRefreshOAuthFailure,
131
+ listAuthProfileNamesAsync,
132
+ loadEnvFileAsync,
133
+ loadRefreshBreaker,
134
+ logout,
135
+ logoutWithDeps,
136
+ normalizeAuthProfileName,
137
+ parseAuthFlow,
138
+ parseJWT,
139
+ readAuthFromEnv,
140
+ readTokenScopes,
141
+ refreshAccessToken,
142
+ refreshTokenFingerprint,
143
+ registerRobotClientLoader,
144
+ resolveAuthProfileDirPath,
145
+ resolveAuthProfileFilePath,
146
+ resolveEnvFileLocationAsync,
147
+ resolveEnvFilePathAsync,
148
+ resolveSessionIdentity,
149
+ runWithAuthProfile,
150
+ saveEnvFileAsync,
151
+ saveRefreshBreaker,
152
+ selectTenantWithDeps,
153
+ setActiveAuthProfile,
154
+ setAuthFileConfig
155
+ };
156
+
157
+ //# debugId=DC7911E6798428D864756E2164756E21