@uipath/cli 1.206.0-preview.303 → 1.207.0-preview.305

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.
Files changed (69) hide show
  1. package/README.md +48 -0
  2. package/dist/{browser-strategy-p5fhwxqj.js → browser-strategy-5rfwnk5q.js} +1 -1
  3. package/dist/cli-10857d67.js +28 -0
  4. package/dist/cliInstaller-3dxg6fbd.js +23 -0
  5. package/dist/{contentStore-w35jnkxk.js → contentStore-z3t1yt3n.js} +7 -6
  6. package/dist/{environmentInfo-nz3126q4.js → environmentInfo-dyhpheza.js} +6 -6
  7. package/dist/{feedbackPrompts-bx209g5v.js → feedbackPrompts-fc66gq0p.js} +3 -3
  8. package/dist/forcedUpdate-5hd8cp9x.js +21 -0
  9. package/dist/{handlers-jjwt24f2.js → handlers-rg3d62gb.js} +13 -9
  10. package/dist/index-2f6vv7yr.js +81 -0
  11. package/dist/{index-v3vx48v0.js → index-2g332j2f.js} +8 -12
  12. package/dist/index-319vtrwd.js +264 -0
  13. package/dist/{index-jqt7p70w.js → index-3vkb4j13.js} +26 -17
  14. package/dist/index-5j78gm9c.js +41 -0
  15. package/dist/index-5ygg5mrs.js +1272 -0
  16. package/dist/{index-99emfvtm.js → index-65pyx6c9.js} +4 -2
  17. package/dist/{index-rr5hdtcy.js → index-81197qe5.js} +15 -17
  18. package/dist/{index-2mm750yx.js → index-8n0z4r6f.js} +69 -13
  19. package/dist/{index-8zhmg5tz.js → index-8pk6n4t9.js} +2 -2
  20. package/dist/{index-cef72dzy.js → index-9v7334md.js} +1 -1
  21. package/dist/{index-nsrrst23.js → index-ack311y7.js} +12 -2
  22. package/dist/{index-2n2vr5w5.js → index-dt6mjnkf.js} +39 -57
  23. package/dist/{index-y7d0cth0.js → index-e82sznr2.js} +7 -7
  24. package/dist/index-ej6eeger.js +23 -0
  25. package/dist/index-evcsjfyy.js +248 -0
  26. package/dist/{index-bxc30q35.js → index-gk5pc8xr.js} +2 -2
  27. package/dist/{index-7q9kcs3w.js → index-h2ctqv68.js} +14 -5
  28. package/dist/index-jk7em40j.js +37 -0
  29. package/dist/{index-vhn8f5d2.js → index-kdr4xvby.js} +5 -5
  30. package/dist/{index-y7j0ant5.js → index-kmacaa53.js} +2130 -834
  31. package/dist/{index-ckp8r4dh.js → index-mb62swmp.js} +2 -2
  32. package/dist/{index-dxfqvgqg.js → index-md27nny8.js} +7 -10
  33. package/dist/{index-85fa5z1t.js → index-nex3q8cg.js} +2 -2
  34. package/dist/index-nyx7fh45.js +331 -0
  35. package/dist/index-nzfpbep9.js +14 -0
  36. package/dist/{index-z070caqq.js → index-p64w2wrt.js} +30 -8
  37. package/dist/{index-0pan2k7w.js → index-t6hrzpm7.js} +30 -14
  38. package/dist/index-v7yphxb8.js +118 -0
  39. package/dist/index-vrfbee4d.js +340 -0
  40. package/dist/{index-69mcde3n.js → index-xw81b1gn.js} +196 -81
  41. package/dist/{index-wg3cne7n.js → index-xxms6rt8.js} +24 -5
  42. package/dist/{index-21kns9qg.js → index-y7v9rkq9.js} +1 -1
  43. package/dist/{index-6wzpac34.js → index-z3q16ts7.js} +81 -58
  44. package/dist/{index-fdztq951.js → index-zhp702kh.js} +393 -82
  45. package/dist/index.js +23 -18
  46. package/dist/{install-kgcwdbqs.js → install-h76qyy1e.js} +6 -7
  47. package/dist/{node-strategy-p1n8wr5s.js → node-strategy-9t0ttffv.js} +2 -2
  48. package/dist/{project-context-caht70an.js → project-context-rc4ghykm.js} +13 -5
  49. package/dist/{prompt-tvxwpvxh.js → prompt-66bnttv7.js} +5 -5
  50. package/dist/{server-pge2gheb.js → server-pxfn9w9m.js} +5 -5
  51. package/dist/{skillCatalog-b3z68z4n.js → skillCatalog-7gh14b4s.js} +8 -7
  52. package/dist/skillsService-wz3c21qb.js +35 -0
  53. package/dist/{telemetry-drain-rt346cfz.js → telemetry-drain-8qr5tzmf.js} +2 -2
  54. package/dist/tree-fk9gwh4v.js +16 -0
  55. package/dist/updateService-ybs9274t.js +377 -0
  56. package/dist/updateService.cli-xtqp78g7.js +15 -0
  57. package/dist/updateService.skills-pgst1fyj.js +27 -0
  58. package/dist/updateService.tools-m58m2fbt.js +19 -0
  59. package/package.json +2 -2
  60. package/dist/cli-0p8c9t5r.js +0 -23
  61. package/dist/index-1n5v3afn.js +0 -45
  62. package/dist/index-3qp7d08f.js +0 -240
  63. package/dist/index-3zf0ywpb.js +0 -95
  64. package/dist/index-753mncpq.js +0 -271
  65. package/dist/skillsService-qzzqacmg.js +0 -29
  66. package/dist/tree-4dhk82fh.js +0 -17
  67. package/dist/updateService-b579ys6m.js +0 -522
  68. package/dist/updateService.skills-teejc562.js +0 -22
  69. package/dist/updateService.tools-3zfct9yk.js +0 -16
@@ -1,20 +1,52 @@
1
1
  import {
2
2
  getFileSystem2
3
- } from "./index-z070caqq.js";
3
+ } from "./index-p64w2wrt.js";
4
4
  import {
5
5
  catchError,
6
+ classifyThrownError,
7
+ extractErrorDetails,
6
8
  extractErrorMessageSync,
7
9
  logger
8
- } from "./index-fdztq951.js";
9
- import {
10
- withSystemCaEnv,
11
- mergeEnvCaseInsensitive,
12
- REGISTRY_TLS_INSTRUCTIONS,
13
- NPM_FETCH_RETRY_ENV,
14
- RegistryTlsError,
15
- isRegistryTlsError,
16
- npmTlsErrorCode
17
- } from "./index-3zf0ywpb.js";
10
+ } from "./index-zhp702kh.js";
11
+
12
+ // src/system-ca.ts
13
+ function installSystemCaTrust(tlsModule) {
14
+ const getCertificates = tlsModule.getCACertificates;
15
+ const setDefaultCertificates = tlsModule.setDefaultCACertificates;
16
+ if (typeof getCertificates !== "function" || typeof setDefaultCertificates !== "function") {
17
+ return "unsupported";
18
+ }
19
+ try {
20
+ const system = getCertificates.call(tlsModule, "system");
21
+ if (!Array.isArray(system) || system.length === 0) {
22
+ return "empty";
23
+ }
24
+ const current = getCertificates.call(tlsModule, "default") ?? [];
25
+ setDefaultCertificates.call(tlsModule, [...current, ...system]);
26
+ return "applied";
27
+ } catch {
28
+ return "error";
29
+ }
30
+ }
31
+ var loadNodeTls = async () => await import("node:tls");
32
+ var cachedResult = "deferred";
33
+ var inFlight;
34
+ async function ensureSystemCaTrustAsync(loadTls = loadNodeTls) {
35
+ if (cachedResult !== "deferred") {
36
+ return cachedResult;
37
+ }
38
+ inFlight ??= (async () => {
39
+ cachedResult = installSystemCaTrust(await loadTls());
40
+ logger.debug(`OS certificate-store trust: ${cachedResult}`);
41
+ return cachedResult;
42
+ })();
43
+ return inFlight;
44
+ }
45
+ var NODE_USE_SYSTEM_CA_ENV = "NODE_USE_SYSTEM_CA";
46
+ function withSystemCaEnv(env = process.env) {
47
+ const alreadySet = Object.keys(env).some((key) => process.platform === "win32" ? key.toUpperCase() === NODE_USE_SYSTEM_CA_ENV : key === NODE_USE_SYSTEM_CA_ENV);
48
+ return alreadySet ? env : { ...env, [NODE_USE_SYSTEM_CA_ENV]: "1" };
49
+ }
18
50
 
19
51
  // src/utils/globalNpmRoot.ts
20
52
  var NPM_ROOT_TIMEOUT_MS = 5000;
@@ -81,6 +113,121 @@ async function runNpmRootGlobal() {
81
113
  });
82
114
  }
83
115
 
116
+ // src/services/childEnv.ts
117
+ function mergeEnvCaseInsensitive(base, overrides) {
118
+ const overridden = new Set(Object.keys(overrides).map((key) => key.toLowerCase()));
119
+ const merged = {};
120
+ for (const [key, value] of Object.entries(base)) {
121
+ if (!overridden.has(key.toLowerCase()))
122
+ merged[key] = value;
123
+ }
124
+ return { ...merged, ...overrides };
125
+ }
126
+
127
+ // src/services/registryTls.ts
128
+ var REGISTRY_TLS_INSTRUCTIONS = "The registry's TLS certificate is not trusted. This is usually a " + "corporate proxy that re-signs HTTPS with its own root CA. On Node " + "22.19+ / 24.6+ uip already lets npm trust the OS certificate store, so " + "either that CA is not in the OS store or this Node is older: upgrade " + "Node, or point NODE_EXTRA_CA_CERTS (or `cafile` in .npmrc) at the CA's " + "PEM file. Then re-run.";
129
+ var TLS_TRUST_CODES = new Set([
130
+ "SELF_SIGNED_CERT_IN_CHAIN",
131
+ "DEPTH_ZERO_SELF_SIGNED_CERT",
132
+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
133
+ "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
134
+ "UNABLE_TO_GET_ISSUER_CERT",
135
+ "CERT_UNTRUSTED"
136
+ ]);
137
+ var NPM_FETCH_RETRY_ENV = {
138
+ npm_config_fetch_retries: "2",
139
+ npm_config_fetch_retry_mintimeout: "2000",
140
+ npm_config_fetch_retry_maxtimeout: "8000"
141
+ };
142
+
143
+ class RegistryTlsError extends Error {
144
+ code;
145
+ instructions = REGISTRY_TLS_INSTRUCTIONS;
146
+ constructor(context, code) {
147
+ super(`${context}: the registry's TLS certificate is not trusted (${code})`);
148
+ this.code = code;
149
+ this.name = "RegistryTlsError";
150
+ }
151
+ }
152
+ function isRegistryTlsError(error) {
153
+ return error instanceof Error && error.name === "RegistryTlsError" && typeof error.code === "string";
154
+ }
155
+ function npmTlsErrorCode(stderr, stdout) {
156
+ const pattern = /(?:npm (?:error|ERR!) code |"code":\s*")([A-Z0-9_]+)/g;
157
+ for (const match of `${stderr}
158
+ ${stdout}`.matchAll(pattern)) {
159
+ if (TLS_TRUST_CODES.has(match[1]))
160
+ return match[1];
161
+ }
162
+ return;
163
+ }
164
+
165
+ // src/services/tools-whitelist.ts
166
+ var TOOLS_WHITELIST = new Map([
167
+ ["@uipath/solution-tool", "solution"],
168
+ ["@uipath/agent-tool", "agent"],
169
+ ["@uipath/agenthub-tool", "agenthub"],
170
+ ["@uipath/conversational-tool", "conversational"],
171
+ ["@uipath/codedagent-tool", "codedagent"],
172
+ ["@uipath/context-grounding-tool", "context-grounding"],
173
+ ["@uipath/function-tool", "function"],
174
+ ["@uipath/codedapp-tool", "codedapp"],
175
+ ["@uipath/integrationservice-tool", "is"],
176
+ ["@uipath/eval-tool", "eval"],
177
+ ["@uipath/orchestrator-tool", "or"],
178
+ ["@uipath/rpa-tool", "rpa"],
179
+ ["@uipath/test-manager-tool", "tm"],
180
+ ["@uipath/api-workflow-tool", "api-workflow"],
181
+ ["@uipath/maestro-tool", "maestro"],
182
+ ["@uipath/rules-tool", "rules"],
183
+ ["@uipath/docsai-tool", "docsai"],
184
+ ["@uipath/vertical-solutions-tool", "vss"],
185
+ ["@uipath/rpa-legacy-tool", "rpa-legacy"],
186
+ ["@uipath/traces-tool", "traces"],
187
+ ["@uipath/explorer-engine-tool", "explorer-engine"],
188
+ ["@uipath/gov-tool", "gov"],
189
+ ["@uipath/admin-tool", "admin"],
190
+ ["@uipath/data-fabric-tool", "df"],
191
+ ["@uipath/insights-tool", "insights"],
192
+ ["@uipath/tasks-tool", "tasks"],
193
+ ["@uipath/aops-tool", "aops"],
194
+ ["@uipath/llmgw-tool", "llm-configuration"],
195
+ ["@uipath/llm-gateway-tool", "llm-gateway"],
196
+ ["@uipath/guardrails-tool", "guardrails"],
197
+ ["@uipath/model-hub-tool", "model-hub"],
198
+ ["@uipath/platform-tool", "platform"],
199
+ ["@uipath/ixp-tool", "ixp"],
200
+ ["@uipath/pm-tool", "pm"],
201
+ ["@uipath/coder-tool", "coder"],
202
+ ["@uipath/automation-hub-tool", "ah"]
203
+ ]);
204
+ var COMMAND_ALIASES = new Map([
205
+ ["orchestrator", "or"],
206
+ ["functions", "function"]
207
+ ]);
208
+ var ALIASES_BY_COMMAND = (() => {
209
+ const map = new Map;
210
+ for (const [alias, canonical] of COMMAND_ALIASES) {
211
+ const list = map.get(canonical) ?? [];
212
+ list.push(alias);
213
+ map.set(canonical, list);
214
+ }
215
+ return map;
216
+ })();
217
+ var WHITELIST_BY_COMMAND = (() => {
218
+ const map = new Map([...TOOLS_WHITELIST.entries()].map(([pkg, cmd]) => [cmd, pkg]));
219
+ for (const [alias, canonical] of COMMAND_ALIASES) {
220
+ const pkg = [...TOOLS_WHITELIST.entries()].find(([, cmd]) => cmd === canonical)?.[0];
221
+ if (pkg)
222
+ map.set(alias, pkg);
223
+ }
224
+ return map;
225
+ })();
226
+ var WHITELIST_BY_SHORT_NAME = new Map([...TOOLS_WHITELIST.keys()].map((pkg) => [
227
+ pkg.replace(/^@uipath\//, ""),
228
+ pkg
229
+ ]));
230
+
84
231
  // src/utils/toolsDirsEnv.ts
85
232
  var TOOLS_DIRS_ENV_VAR = "UIPATH_CLI_TOOLS_DIRS";
86
233
  var UNSAFE_PATH_CHARS = /["%\p{Cc}]/u;
@@ -254,71 +401,6 @@ async function warnIfTranslatedNodeAsync(host, readCpuModel) {
254
401
  logger.warn(describeTranslatedNode(detected));
255
402
  }
256
403
 
257
- // src/services/tools-whitelist.ts
258
- var TOOLS_WHITELIST = new Map([
259
- ["@uipath/solution-tool", "solution"],
260
- ["@uipath/agent-tool", "agent"],
261
- ["@uipath/agenthub-tool", "agenthub"],
262
- ["@uipath/conversational-tool", "conversational"],
263
- ["@uipath/codedagent-tool", "codedagent"],
264
- ["@uipath/context-grounding-tool", "context-grounding"],
265
- ["@uipath/function-tool", "function"],
266
- ["@uipath/codedapp-tool", "codedapp"],
267
- ["@uipath/integrationservice-tool", "is"],
268
- ["@uipath/eval-tool", "eval"],
269
- ["@uipath/orchestrator-tool", "or"],
270
- ["@uipath/rpa-tool", "rpa"],
271
- ["@uipath/test-manager-tool", "tm"],
272
- ["@uipath/api-workflow-tool", "api-workflow"],
273
- ["@uipath/maestro-tool", "maestro"],
274
- ["@uipath/rules-tool", "rules"],
275
- ["@uipath/docsai-tool", "docsai"],
276
- ["@uipath/vertical-solutions-tool", "vss"],
277
- ["@uipath/rpa-legacy-tool", "rpa-legacy"],
278
- ["@uipath/traces-tool", "traces"],
279
- ["@uipath/gov-tool", "gov"],
280
- ["@uipath/admin-tool", "admin"],
281
- ["@uipath/data-fabric-tool", "df"],
282
- ["@uipath/insights-tool", "insights"],
283
- ["@uipath/tasks-tool", "tasks"],
284
- ["@uipath/aops-tool", "aops"],
285
- ["@uipath/llmgw-tool", "llm-configuration"],
286
- ["@uipath/llm-gateway-tool", "llm-gateway"],
287
- ["@uipath/guardrails-tool", "guardrails"],
288
- ["@uipath/model-hub-tool", "model-hub"],
289
- ["@uipath/platform-tool", "platform"],
290
- ["@uipath/ixp-tool", "ixp"],
291
- ["@uipath/pm-tool", "pm"],
292
- ["@uipath/coder-tool", "coder"],
293
- ["@uipath/automation-hub-tool", "ah"]
294
- ]);
295
- var COMMAND_ALIASES = new Map([
296
- ["orchestrator", "or"],
297
- ["functions", "function"]
298
- ]);
299
- var ALIASES_BY_COMMAND = (() => {
300
- const map = new Map;
301
- for (const [alias, canonical] of COMMAND_ALIASES) {
302
- const list = map.get(canonical) ?? [];
303
- list.push(alias);
304
- map.set(canonical, list);
305
- }
306
- return map;
307
- })();
308
- var WHITELIST_BY_COMMAND = (() => {
309
- const map = new Map([...TOOLS_WHITELIST.entries()].map(([pkg, cmd]) => [cmd, pkg]));
310
- for (const [alias, canonical] of COMMAND_ALIASES) {
311
- const pkg = [...TOOLS_WHITELIST.entries()].find(([, cmd]) => cmd === canonical)?.[0];
312
- if (pkg)
313
- map.set(alias, pkg);
314
- }
315
- return map;
316
- })();
317
- var WHITELIST_BY_SHORT_NAME = new Map([...TOOLS_WHITELIST.keys()].map((pkg) => [
318
- pkg.replace(/^@uipath\//, ""),
319
- pkg
320
- ]));
321
-
322
404
  // src/services/toolService.ts
323
405
  var SEMVER_RE = /^\d+\.\d+\.\d+(-[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*)?(\+[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*)?$/;
324
406
  function isValidSemver(v) {
@@ -419,6 +501,12 @@ function isNpmViewMetadataError(error) {
419
501
  function resolveToolPackageName(arg) {
420
502
  return WHITELIST_BY_COMMAND.get(arg) ?? WHITELIST_BY_SHORT_NAME.get(arg) ?? arg;
421
503
  }
504
+ function toolPackageName(name) {
505
+ return name.startsWith("@") ? name : `@uipath/${name}`;
506
+ }
507
+ function toolShortName(packageName) {
508
+ return packageName.replace(/^@uipath\//, "");
509
+ }
422
510
  function asNpmViewMetadata(value) {
423
511
  if (!value || typeof value !== "object" || Array.isArray(value)) {
424
512
  return;
@@ -535,6 +623,32 @@ function describeCandidateFailure(packageName, versionPrefix, failure, registry)
535
623
  retry: "RetryWillNotFix"
536
624
  };
537
625
  }
626
+ function npmErrorCode(output) {
627
+ return /npm (?:error|ERR!) code ([A-Z0-9_]+)/.exec(output)?.[1];
628
+ }
629
+ function classifyNpmOutput(output) {
630
+ const npmCode = npmErrorCode(output);
631
+ if (npmCode === undefined)
632
+ return;
633
+ if (npmCode === "ETARGET") {
634
+ return { errorCode: "not_found", retry: "RetryWillNotFix" };
635
+ }
636
+ return classifyThrownError({ code: npmCode });
637
+ }
638
+ async function classifyInstallError(error) {
639
+ const details = await extractErrorDetails(error);
640
+ const { errorCode, retry } = details.errorCode === "unknown_error" && classifyNpmOutput(error.message) || details;
641
+ return { message: details.message, errorCode, retry };
642
+ }
643
+ function pickNpmFailureLine(output) {
644
+ const lines = output.split(`
645
+ `).map((line) => line.trim()).filter(Boolean);
646
+ if (lines.length === 0)
647
+ return "npm install failed";
648
+ if (!lines[0].startsWith("npm "))
649
+ return lines[0];
650
+ return lines.find((line) => /^npm (?:error|ERR!) code /.test(line)) ?? lines.find((line) => /^npm (?:error|ERR!)/.test(line)) ?? lines.find((line) => !/^npm warn/i.test(line)) ?? lines[0];
651
+ }
538
652
  var effectiveNpmConfigPromise = null;
539
653
  function readEffectiveNpmConfig() {
540
654
  effectiveNpmConfigPromise ??= (async () => {
@@ -607,7 +721,8 @@ function pickForChannel(versions, channel) {
607
721
  const tag = `-${channel}.`;
608
722
  return versions.find((v) => v.includes(tag)) ?? null;
609
723
  }
610
- async function isDevMode() {
724
+ var CLI_REPO_ROOT_PACKAGE_NAME = "cli";
725
+ async function isDevMode(repoName) {
611
726
  const [error, result] = await catchError((async () => {
612
727
  const fs = getFileSystem2();
613
728
  let dir = fs.env.cwd();
@@ -617,7 +732,7 @@ async function isDevMode() {
617
732
  const raw = await fs.readFile(pkgPath, "utf-8");
618
733
  if (raw) {
619
734
  const pkg = JSON.parse(raw);
620
- if (pkg.workspaces && pkg.private) {
735
+ if ((repoName === undefined || pkg.name === repoName) && pkg.workspaces && pkg.private) {
621
736
  const bunLockPath = fs.path.join(dir, "bun.lock");
622
737
  if (await fs.exists(bunLockPath)) {
623
738
  logger.debug(`Dev mode detected — found monorepo root at ${dir}`);
@@ -859,7 +974,7 @@ class NodeToolService {
859
974
  if (/E401|E403|ENEEDAUTH|need(s)? auth|authentication/i.test(stderr)) {
860
975
  return new Error(`Authentication required for ${packageName} (configure a token in .npmrc)`);
861
976
  }
862
- const detail = stderr.trim() || (codeOrError instanceof Error ? codeOrError.message : `exit ${codeOrError}`);
977
+ const detail = stderr.trim() ? pickNpmFailureLine(stderr) : codeOrError instanceof Error ? codeOrError.message : `exit ${codeOrError}`;
863
978
  return new Error(`npm view ${packageName} failed: ${detail}`);
864
979
  }
865
980
  async search(query) {
@@ -1046,6 +1161,6 @@ function truncateVersionsForDisplay(versions) {
1046
1161
  }
1047
1162
  var toolService = new NodeToolService;
1048
1163
 
1049
- export { getGlobalNpmUipathDir, refreshGlobalNpmUipathDir, TOOLS_DIRS_ENV_VAR, getEnvToolsDirsDeclaration, resolveNpmPrefixForToolsDir, InstallRefusedError, isBundledDistribution, TOOLS_WHITELIST, COMMAND_ALIASES, ALIASES_BY_COMMAND, WHITELIST_BY_COMMAND, WHITELIST_BY_SHORT_NAME, isValidSemver, compareSemver, validatePackageSpec, isNpmViewMetadataError, resolveToolPackageName, parsePackageSpec, describeCandidateFailure, getEffectiveRegistry, isDevMode, isPermissionError, HostOwnedToolError, truncateVersionsForDisplay, toolService };
1164
+ export { ensureSystemCaTrustAsync, withSystemCaEnv, getGlobalNpmUipathDir, refreshGlobalNpmUipathDir, TOOLS_DIRS_ENV_VAR, getEnvToolsDirsDeclaration, resolveNpmPrefixForToolsDir, InstallRefusedError, isBundledDistribution, mergeEnvCaseInsensitive, NPM_FETCH_RETRY_ENV, RegistryTlsError, isRegistryTlsError, npmTlsErrorCode, TOOLS_WHITELIST, COMMAND_ALIASES, ALIASES_BY_COMMAND, WHITELIST_BY_COMMAND, WHITELIST_BY_SHORT_NAME, isValidSemver, compareSemver, validatePackageSpec, isNpmViewMetadataError, resolveToolPackageName, toolPackageName, toolShortName, parsePackageSpec, describeCandidateFailure, npmErrorCode, classifyNpmOutput, classifyInstallError, pickNpmFailureLine, getEffectiveRegistry, CLI_REPO_ROOT_PACKAGE_NAME, isDevMode, isPermissionError, HostOwnedToolError, truncateVersionsForDisplay, toolService };
1050
1165
 
1051
- //# debugId=9245966C327ABCAE64756E2164756E21
1166
+ //# debugId=CB3F9AF7CC4649B364756E2164756E21
@@ -1,14 +1,19 @@
1
1
  import {
2
- isRegistryTlsError
3
- } from "./index-3zf0ywpb.js";
2
+ classifyThrownError
3
+ } from "./index-zhp702kh.js";
4
4
  import {
5
+ CONFIG_FROM_PINS_MACHINE
6
+ } from "./index-5ygg5mrs.js";
7
+ import {
8
+ isRegistryTlsError,
5
9
  isPermissionError
6
- } from "./index-69mcde3n.js";
10
+ } from "./index-xw81b1gn.js";
7
11
  import {
8
12
  isSkillsRegistryAuthError,
9
13
  isSkillsPackageMetadataError,
14
+ isSkillsPinNotPublishedError,
10
15
  isSkillsPackOutputError
11
- } from "./index-nsrrst23.js";
16
+ } from "./index-ack311y7.js";
12
17
 
13
18
  // src/commands/skills/errorMessages.ts
14
19
  function getSkillsSourceFailureDetails(error) {
@@ -40,6 +45,13 @@ function getSkillsSourceFailureDetails(error) {
40
45
  errorCode: "configuration_error"
41
46
  };
42
47
  }
48
+ if (isSkillsPinNotPublishedError(error)) {
49
+ return {
50
+ instructions: `Correct the pin on the machine that sets the pins: run 'uip config freeze --force' there. It pins the installed skills version, or drops a skills pin that the registry does not publish. ${CONFIG_FROM_PINS_MACHINE} Then run the command again.`,
51
+ retry: "RetryWillNotFix",
52
+ errorCode: "configuration_error"
53
+ };
54
+ }
43
55
  if (isSkillsPackOutputError(error)) {
44
56
  return {
45
57
  instructions: "Your npm version prints a `pack --json` shape this CLI cannot read. Update the CLI (`uip update`), or set UIP_SKILLS_PM=pnpm (or bun/yarn) to fetch skills with another package manager, which skips npm pack entirely.",
@@ -47,6 +59,13 @@ function getSkillsSourceFailureDetails(error) {
47
59
  errorCode: "configuration_error"
48
60
  };
49
61
  }
62
+ if (classifyThrownError(error).errorCode === "network_error") {
63
+ return {
64
+ instructions: "Check network access and any proxy or registry configuration in .npmrc, then run the command again.",
65
+ retry: "RetryLater",
66
+ errorCode: "network_error"
67
+ };
68
+ }
50
69
  return {
51
70
  instructions: "Check network connectivity and try again. Ensure the @uipath/skills package is available from the configured npm registry.",
52
71
  retry: "RetryLater",
@@ -56,4 +75,4 @@ function getSkillsSourceFailureDetails(error) {
56
75
 
57
76
  export { getSkillsSourceFailureDetails };
58
77
 
59
- //# debugId=09A62000F45C167B64756E2164756E21
78
+ //# debugId=E2E90478B98A603464756E2164756E21
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getFileSystem2,
3
3
  getFileSystemAsync2
4
- } from "./index-z070caqq.js";
4
+ } from "./index-p64w2wrt.js";
5
5
  export {
6
6
  getFileSystem2 as getFileSystem,
7
7
  getFileSystemAsync2 as getFileSystemAsync
@@ -1,11 +1,12 @@
1
1
  import {
2
2
  getFileSystem2
3
- } from "./index-z070caqq.js";
3
+ } from "./index-p64w2wrt.js";
4
4
  import {
5
5
  catchError,
6
+ describeConnectivityError,
6
7
  logger,
7
8
  UIPATH_HOME_DIR
8
- } from "./index-fdztq951.js";
9
+ } from "./index-zhp702kh.js";
9
10
  import {
10
11
  yaml
11
12
  } from "./index-5gce5wfd.js";
@@ -14,20 +15,28 @@ import {
14
15
  mergeEnvCaseInsensitive,
15
16
  NPM_FETCH_RETRY_ENV,
16
17
  RegistryTlsError,
17
- npmTlsErrorCode
18
- } from "./index-3zf0ywpb.js";
18
+ npmTlsErrorCode,
19
+ npmErrorCode
20
+ } from "./index-xw81b1gn.js";
21
+ import {
22
+ asRecord,
23
+ SOURCE_MARKER_NAME,
24
+ STORE_NAME,
25
+ readStoreSkillsVersion
26
+ } from "./index-jk7em40j.js";
19
27
  import {
20
28
  SkillSourceError,
21
29
  SkillsRegistryAuthError,
22
30
  SkillsPackageMetadataError,
31
+ SkillsPinNotPublishedError,
23
32
  SkillsPackOutputError
24
- } from "./index-nsrrst23.js";
33
+ } from "./index-ack311y7.js";
25
34
  import {
26
35
  commandOnPath
27
- } from "./index-ckp8r4dh.js";
36
+ } from "./index-mb62swmp.js";
28
37
  import {
29
38
  package_default
30
- } from "./index-85fa5z1t.js";
39
+ } from "./index-nex3q8cg.js";
31
40
 
32
41
  // src/commands/skills/contentStore.ts
33
42
  import { createHash, randomUUID } from "node:crypto";
@@ -37,8 +46,6 @@ import { gunzipSync } from "node:zlib";
37
46
  var SKILLS_PACKAGE_NAME = "@uipath/skills";
38
47
  var SKILLS_REGISTRY_URL = "https://registry.npmjs.org";
39
48
  var REPO_URL2 = "https://www.npmjs.com/package/@uipath/skills";
40
- var SOURCE_MARKER_NAME = ".uipath-skills-source.json";
41
- var STORE_NAME = `${UIPATH_HOME_DIR}/.skills`;
42
49
  var TAR_BLOCK_SIZE = 512;
43
50
  var NPM_VIEW_TIMEOUT_MS = 30000;
44
51
  var NPM_PACK_TIMEOUT_MS = 60000;
@@ -172,6 +179,28 @@ async function resolveLocalSkillsStore(fs) {
172
179
  const dir = dirname(pkgJsonPath);
173
180
  return await hasSkillsDir(dir) ? dir : undefined;
174
181
  }
182
+ async function localStoreIsOn(fs, storeDir, targetVersion, exactVersion) {
183
+ const storeVersion = await readStoreSkillsVersion(storeDir) ?? await readPackageVersion(fs, storeDir);
184
+ if (storeVersion === undefined)
185
+ return false;
186
+ return versionIsOnTarget(storeVersion, targetVersion, exactVersion);
187
+ }
188
+ function versionIsOnTarget(version, targetVersion, exactVersion) {
189
+ if (exactVersion)
190
+ return sameVersion(version, exactVersion);
191
+ if (!targetVersion)
192
+ return false;
193
+ const line = parseSemver(targetVersion);
194
+ return line !== null && matchesCliVersionLine(version, line);
195
+ }
196
+ async function readPackageVersion(fs, dir) {
197
+ const [readErr, text] = await catchError(fs.readFile(fs.path.join(dir, "package.json"), { encoding: "utf-8" }));
198
+ if (readErr || !text)
199
+ return;
200
+ const [parseErr, parsed] = catchError(() => JSON.parse(text));
201
+ const version = parseErr ? undefined : asRecord(parsed)?.version;
202
+ return typeof version === "string" ? version : undefined;
203
+ }
175
204
  async function removeStoreForSwap(fs, targetPath) {
176
205
  const [rmError] = await catchError(fs.rm(targetPath));
177
206
  if (!rmError)
@@ -205,7 +234,7 @@ async function copySkillsStore(fs, sourceDir, targetPath) {
205
234
  await fs.writeFile(manifestPath, savedManifest);
206
235
  }
207
236
  }
208
- async function fetchSkillsTo2(targetPath, rootDir, source = DEFAULT_SOURCE2, targetVersion) {
237
+ async function fetchSkillsTo2(targetPath, rootDir, source = DEFAULT_SOURCE2, targetVersion, exactVersion) {
209
238
  const fs = getFileSystem2();
210
239
  if (source.localDir) {
211
240
  await fetchSkillsFromLocalDir(targetPath, source.localDir);
@@ -215,10 +244,10 @@ async function fetchSkillsTo2(targetPath, rootDir, source = DEFAULT_SOURCE2, tar
215
244
  await fetchSkillsFromGit(targetPath, rootDir, source);
216
245
  return;
217
246
  }
218
- const [infoErr, resolved] = await catchError(resolveSkillsDownload(targetVersion));
247
+ const [infoErr, resolved] = await catchError(resolveSkillsDownload(targetVersion, exactVersion));
219
248
  if (infoErr || !resolved) {
220
249
  const localStore = await resolveLocalSkillsStore(fs);
221
- if (localStore) {
250
+ if (localStore && (!exactVersion && !targetVersion || await localStoreIsOn(fs, localStore, targetVersion, exactVersion))) {
222
251
  logger.info(`Could not resolve ${SKILLS_PACKAGE_NAME} from a registry (${infoErr?.message ?? "unknown error"}); using the locally-installed package at ${localStore}.`);
223
252
  await copySkillsStore(fs, localStore, targetPath);
224
253
  return;
@@ -240,9 +269,9 @@ async function fetchSkillsTo2(targetPath, rootDir, source = DEFAULT_SOURCE2, tar
240
269
  await catchError(fs.rm(tmpPath));
241
270
  }
242
271
  }
243
- async function resolveSkillsDownload(targetVersion) {
272
+ async function resolveSkillsDownload(targetVersion, exactVersion) {
244
273
  const pm = await resolvePackageManager();
245
- const packageInfo = await fetchMatchingSkillsPackageInfo(pm, targetVersion ?? package_default.version);
274
+ const packageInfo = await fetchMatchingSkillsPackageInfo(pm, targetVersion ?? package_default.version, exactVersion);
246
275
  return { pm, packageInfo };
247
276
  }
248
277
  async function fetchSkillsFromGit(targetPath, rootDir, source) {
@@ -459,40 +488,31 @@ async function flattenSingleTopLevelDir(fs, storePath) {
459
488
  }
460
489
  await fs.rm(nestedDir);
461
490
  }
462
- async function getContentStore2(rootDir, source = DEFAULT_SOURCE2, targetVersion) {
491
+ async function getContentStore2(rootDir, source = DEFAULT_SOURCE2, targetVersion, exactVersion) {
463
492
  const fs = getFileSystem2();
464
493
  const storePath = fs.path.join(rootDir, source.storeName);
465
- await fetchSkillsTo2(storePath, rootDir, source, targetVersion);
494
+ await fetchSkillsTo2(storePath, rootDir, source, targetVersion, exactVersion);
466
495
  return storePath;
467
496
  }
468
- async function getContentStoreForRead2(rootDir, source = DEFAULT_SOURCE2, targetVersion) {
497
+ async function getContentStoreForRead2(rootDir, source = DEFAULT_SOURCE2, targetVersion, exactVersion) {
469
498
  const fs = getFileSystem2();
470
499
  const storePath = fs.path.join(rootDir, source.storeName);
471
- if (source.isDefault && await storeMatchesVersionLine(fs, storePath, targetVersion)) {
500
+ if (source.isDefault && await storeMatchesTarget(fs, storePath, targetVersion, exactVersion)) {
472
501
  logger.debug(`Reading skills from the existing store at ${storePath} (no fetch).`);
473
502
  return storePath;
474
503
  }
475
- await fetchSkillsTo2(storePath, rootDir, source, targetVersion);
504
+ await fetchSkillsTo2(storePath, rootDir, source, targetVersion, exactVersion);
476
505
  return storePath;
477
506
  }
478
- async function storeMatchesVersionLine(fs, storePath, targetVersion) {
479
- const line = parseSemver(targetVersion ?? package_default.version) ?? parseVersionLine(targetVersion ?? package_default.version);
480
- if (!line)
481
- return false;
507
+ async function storeMatchesTarget(fs, storePath, targetVersion, exactVersion) {
482
508
  const skillsDir = fs.path.join(storePath, "skills");
483
509
  const [entriesErr, entries] = await catchError(fs.readdir(skillsDir));
484
510
  if (entriesErr || !entries?.length)
485
511
  return false;
486
- const [markerErr, markerText] = await catchError(fs.readFile(fs.path.join(storePath, SOURCE_MARKER_NAME), {
487
- encoding: "utf-8"
488
- }));
489
- if (markerErr || !markerText)
490
- return false;
491
- const [parseErr, marker] = catchError(() => JSON.parse(markerText));
492
- if (parseErr)
512
+ const version = await readStoreSkillsVersion(storePath);
513
+ if (version === undefined)
493
514
  return false;
494
- const version = asRecord(marker)?.version;
495
- return typeof version === "string" && matchesCliVersionLine(version, line);
515
+ return versionIsOnTarget(version, targetVersion ?? package_default.version, exactVersion);
496
516
  }
497
517
  async function readSkillFrontmatter(fs, skillMdPath) {
498
518
  const [err, content] = await catchError(fs.readFile(skillMdPath, { encoding: "utf-8" }));
@@ -673,12 +693,6 @@ async function recordExtraFiles2(storePath, agent, files) {
673
693
  manifest.extraFiles = Object.keys(extraFiles).length > 0 ? extraFiles : undefined;
674
694
  await writeManifest(storePath, manifest);
675
695
  }
676
- function asRecord(value) {
677
- if (!value || typeof value !== "object" || Array.isArray(value)) {
678
- return;
679
- }
680
- return value;
681
- }
682
696
  function isDecimalInteger(value) {
683
697
  return value.length > 0 && Array.from(value).every((char) => char >= "0" && char <= "9");
684
698
  }
@@ -785,6 +799,19 @@ function compareSemver(a, b) {
785
799
  return -1;
786
800
  return comparePrerelease(left.prerelease, right.prerelease);
787
801
  }
802
+ function sameVersion(a, b) {
803
+ return normalizeSemver(a) === normalizeSemver(b);
804
+ }
805
+ function normalizeSemver(version) {
806
+ const parsed = parseSemver(version);
807
+ if (!parsed)
808
+ return version;
809
+ const core = `${parsed.major}.${parsed.minor}.${parsed.patch}`;
810
+ if (parsed.prerelease === undefined)
811
+ return core;
812
+ const prerelease = parsed.prerelease.split(".").map((part) => isDecimalInteger(part) ? String(Number.parseInt(part, 10)) : part).join(".");
813
+ return `${core}-${prerelease}`;
814
+ }
788
815
  function matchesCliVersionLine(version, cliVersion) {
789
816
  const parsed = parseSemver(version);
790
817
  if (!parsed)
@@ -892,6 +919,10 @@ function mapPmError(pm, label, stderr, stdout, codeOrError) {
892
919
  if (/E401|E403|\b401\b|\b403\b|ENEEDAUTH|unauthor|forbidden|need(s)? auth|authentication/i.test(stderr)) {
893
920
  return new SkillsRegistryAuthError(`Authentication required for ${SKILLS_PACKAGE_NAME}. ${REGISTRY_AUTH_HINT}`);
894
921
  }
922
+ const npmCode = npmErrorCode(stderr);
923
+ if (npmCode !== undefined && describeConnectivityError({ code: npmCode })?.kind === "network") {
924
+ return Object.assign(new Error(`${pm} ${label} failed: the registry could not be reached (${npmCode})`), { code: npmCode });
925
+ }
895
926
  const detail = stderr.trim() || (codeOrError instanceof Error ? codeOrError.message : `exit ${codeOrError}`);
896
927
  return new Error(`${pm} ${label} failed: ${detail}`);
897
928
  }
@@ -946,12 +977,7 @@ async function pmListVersions(pm, cliVersion) {
946
977
  if (primary.length > 0)
947
978
  return primary;
948
979
  const lineSpec = `${SKILLS_PACKAGE_NAME}@~${cliVersion.major}.${cliVersion.minor}.0-0`;
949
- const [err, versions] = await catchError(queryVersions(pm, lineSpec));
950
- if (err) {
951
- logger.debug(`Line-scoped version lookup for ${lineSpec} failed: ${err.message}`);
952
- return [];
953
- }
954
- return versions;
980
+ return await queryVersions(pm, lineSpec);
955
981
  }
956
982
  async function pmResolveTarball(pm, version) {
957
983
  const spec = `${SKILLS_PACKAGE_NAME}@${version}`;
@@ -1046,13 +1072,13 @@ function registryFromTarball(tarballUrl) {
1046
1072
  const [urlError, parsedUrl] = catchError(() => new URL(tarballUrl));
1047
1073
  return urlError ? SKILLS_REGISTRY_URL : parsedUrl.origin;
1048
1074
  }
1049
- async function fetchMatchingSkillsPackageInfo(pm, targetVersion) {
1050
- const cliVersion = parseSemver(targetVersion) ?? parseVersionLine(targetVersion);
1075
+ async function fetchMatchingSkillsPackageInfo(pm, targetVersion, exactVersion) {
1076
+ const cliVersion = parseSemver(targetVersion);
1051
1077
  if (!cliVersion) {
1052
- throw new Error(`Invalid CLI version ${targetVersion}; expected major.minor or major.minor.patch`);
1078
+ throw new Error(`Invalid CLI version ${targetVersion}; expected major.minor.patch`);
1053
1079
  }
1054
1080
  const versions = await pmListVersions(pm, cliVersion);
1055
- const selectedVersion = pickMatchingSkillsVersion(versions, cliVersion);
1081
+ const selectedVersion = exactVersion ? pickExactSkillsVersion(versions, exactVersion) : pickMatchingSkillsVersion(versions, cliVersion);
1056
1082
  const tarballUrl = pm === "npm" || pm === "pnpm" ? requireSkillsTarballUrl(selectedVersion, coerceViewString(await pmViewJson(pm, [
1057
1083
  `${SKILLS_PACKAGE_NAME}@${selectedVersion}`,
1058
1084
  "dist.tarball"
@@ -1068,15 +1094,12 @@ function requireSkillsTarballUrl(selectedVersion, tarballUrl) {
1068
1094
  return tarballUrl;
1069
1095
  throw new SkillsPackageMetadataError(`npm view ${SKILLS_PACKAGE_NAME}@${selectedVersion} dist.tarball returned no usable tarball URL`);
1070
1096
  }
1071
- function parseVersionLine(version) {
1072
- const match = /^(\d+)\.(\d+)$/.exec(version.trim());
1073
- if (!match)
1074
- return null;
1075
- return {
1076
- major: Number.parseInt(match[1], 10),
1077
- minor: Number.parseInt(match[2], 10),
1078
- patch: 0
1079
- };
1097
+ function pickExactSkillsVersion(versions, exactVersion) {
1098
+ const selected = versions.find((v) => sameVersion(v, exactVersion));
1099
+ if (!selected) {
1100
+ throw new SkillsPinNotPublishedError(`versions.skills pins ${SKILLS_PACKAGE_NAME} ${exactVersion}, which is not published on the configured npm registry.`);
1101
+ }
1102
+ return selected;
1080
1103
  }
1081
1104
  function pickMatchingSkillsVersion(versions, cliVersion) {
1082
1105
  const matchingVersions = versions.filter((version) => matchesCliVersionLine(version, cliVersion));
@@ -1324,4 +1347,4 @@ async function extractNpmTarballToDir(tarData, destinationDir) {
1324
1347
 
1325
1348
  export { REPO_URL2, DEFAULT_SOURCE2, resolveSkillSource2, fetchSkillsTo2, getContentStore2, getContentStoreForRead2, getAvailableSkills2, parseSkillMd2, addToGitignore2, MANIFEST_NAME2, readManifest2, updateManifestAfterInstall2, removeFromManifest2, readExtraFiles2, recordExtraFiles2 };
1326
1349
 
1327
- //# debugId=A8E0E8E12341A80264756E2164756E21
1350
+ //# debugId=20801DA90CF9AE3F64756E2164756E21