@uipath/cli 1.206.0-preview.301 → 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-cd7gxxmj.js → contentStore-z3t1yt3n.js} +7 -6
  6. package/dist/{environmentInfo-mbanfdjh.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-hweqs8nn.js → index-2g332j2f.js} +8 -12
  12. package/dist/index-319vtrwd.js +264 -0
  13. package/dist/{index-nn9v5yjd.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-7wmyb1v6.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-h9f8kms8.js → index-kmacaa53.js} +2130 -834
  31. package/dist/{index-ckp8r4dh.js → index-mb62swmp.js} +2 -2
  32. package/dist/{index-24ffa480.js → index-md27nny8.js} +7 -10
  33. package/dist/{index-zj63x8ca.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-3aymb07j.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-dst4pf6j.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-8emxd7jz.js → prompt-66bnttv7.js} +5 -5
  50. package/dist/{server-pzt8qbff.js → server-pxfn9w9m.js} +5 -5
  51. package/dist/{skillCatalog-ppk9wtx1.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-5679d26y.js +0 -23
  61. package/dist/index-3qp7d08f.js +0 -240
  62. package/dist/index-3zf0ywpb.js +0 -95
  63. package/dist/index-753mncpq.js +0 -271
  64. package/dist/index-7sm7r2tj.js +0 -45
  65. package/dist/skillsService-mzk0y9kz.js +0 -29
  66. package/dist/tree-4dhk82fh.js +0 -17
  67. package/dist/updateService-7bygdrjv.js +0 -522
  68. package/dist/updateService.skills-3rpemp0h.js +0 -22
  69. package/dist/updateService.tools-3zfct9yk.js +0 -16
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getFileSystem2
3
- } from "./index-z070caqq.js";
3
+ } from "./index-p64w2wrt.js";
4
4
  import {
5
5
  catchError
6
- } from "./index-fdztq951.js";
6
+ } from "./index-zhp702kh.js";
7
7
 
8
8
  // src/commands/skills/agents/detect.ts
9
9
  import { spawn } from "node:child_process";
@@ -1,13 +1,16 @@
1
1
  import {
2
2
  getFileSystem2
3
- } from "./index-z070caqq.js";
3
+ } from "./index-p64w2wrt.js";
4
4
  import {
5
5
  catchError
6
- } from "./index-fdztq951.js";
6
+ } from "./index-zhp702kh.js";
7
+ import {
8
+ asRecord
9
+ } from "./index-jk7em40j.js";
7
10
  import {
8
11
  REPO_URL2,
9
12
  parseSkillMd2
10
- } from "./index-dst4pf6j.js";
13
+ } from "./index-z3q16ts7.js";
11
14
 
12
15
  // src/commands/skills/skillCatalog.ts
13
16
  var SKILL_CATALOG_SCHEMA_VERSION = 1;
@@ -30,12 +33,6 @@ var SEARCH_STOPWORDS = new Set([
30
33
  "to",
31
34
  "with"
32
35
  ]);
33
- function asRecord(value) {
34
- if (!value || typeof value !== "object" || Array.isArray(value)) {
35
- return;
36
- }
37
- return value;
38
- }
39
36
  function markdownEscape(value) {
40
37
  return value.replace(/\\/g, "\\\\").replace(/\|/g, "\\|").replace(/\r?\n/g, " ");
41
38
  }
@@ -271,4 +268,4 @@ function searchSkillCatalog2(catalog, query) {
271
268
 
272
269
  export { SKILL_CATALOG_SKILL_NAME2, buildSkillCatalog2, writeSkillCatalog2, removeSkillCatalog2, searchSkillCatalog2 };
273
270
 
274
- //# debugId=B9335E32C99170BD64756E2164756E21
271
+ //# debugId=6590C4CE1970C31C64756E2164756E21
@@ -3,7 +3,7 @@ var package_default = {
3
3
  name: "@uipath/cli",
4
4
  author: "UiPath",
5
5
  license: "SEE LICENSE IN LICENSE.txt",
6
- version: "1.206.0-preview.301",
6
+ version: "1.207.0-preview.305",
7
7
  description: "Cross platform CLI for UiPath",
8
8
  repository: {
9
9
  type: "git",
@@ -69,4 +69,4 @@ var package_default = {
69
69
 
70
70
  export { package_default };
71
71
 
72
- //# debugId=8DFB22A0654C1CE164756E2164756E21
72
+ //# debugId=BFEF1333A7B3871964756E2164756E21
@@ -0,0 +1,331 @@
1
+ import {
2
+ getFileSystem2
3
+ } from "./index-p64w2wrt.js";
4
+ import {
5
+ catchError,
6
+ OutputFormatter,
7
+ TELEMETRY_ARG_VALUE_WITHHELD
8
+ } from "./index-zhp702kh.js";
9
+ import {
10
+ validatePins,
11
+ versionLinePrefix,
12
+ skillsPinFor,
13
+ sortedByName
14
+ } from "./index-v7yphxb8.js";
15
+ import {
16
+ withConfigLock,
17
+ readConfigFileAt,
18
+ writeConfigFileAt,
19
+ configPathForMessage,
20
+ replaceCachedVersions,
21
+ resolveConfigWriteTargetAsync,
22
+ classifyError,
23
+ reportFreezeFailure,
24
+ FreezeFailureError,
25
+ freezeFailureError,
26
+ reportFreezeFailureError
27
+ } from "./index-5ygg5mrs.js";
28
+ import {
29
+ toolPackageName,
30
+ describeCandidateFailure,
31
+ getEffectiveRegistry,
32
+ toolService
33
+ } from "./index-xw81b1gn.js";
34
+ import {
35
+ asRecord,
36
+ STORE_NAME,
37
+ readStoreSkillsVersion,
38
+ readInstalledSkillsVersion
39
+ } from "./index-jk7em40j.js";
40
+ import {
41
+ package_default
42
+ } from "./index-nex3q8cg.js";
43
+
44
+ // src/commands/config/codes.ts
45
+ var CONFIG_CODES = {
46
+ ConfigFrozen: "ConfigFrozen",
47
+ ConfigUnfrozen: "ConfigUnfrozen",
48
+ ConfigFreezeDrift: "ConfigFreezeDrift",
49
+ ConfigFreezeOnStudio: "ConfigFreezeOnStudio",
50
+ ConfigFreezeInvalidPins: "ConfigFreezeInvalidPins",
51
+ ConfigFreezeInvalidConfig: "ConfigFreezeInvalidConfig",
52
+ ConfigChannelOffPin: "ConfigChannelOffPin",
53
+ ConfigFrozenEdit: "ConfigFrozenEdit",
54
+ ConfigUnknownKey: "ConfigUnknownKey",
55
+ ConfigMovedKey: "ConfigMovedKey",
56
+ ConfigInvalidValue: "ConfigInvalidValue",
57
+ ConfigFileRead: "ConfigFileRead",
58
+ ConfigFileWrite: "ConfigFileWrite",
59
+ ConfigFileBadPath: "ConfigFileBadPath",
60
+ ConfigFileNotFound: "ConfigFileNotFound",
61
+ ConfigExported: "ConfigExported",
62
+ ConfigExportExists: "ConfigExportExists",
63
+ ConfigExportNoConfig: "ConfigExportNoConfig",
64
+ ConfigExportBadOutputFile: "ConfigExportBadOutputFile",
65
+ ConfigExportWrite: "ConfigExportWrite",
66
+ ConfigImported: "ConfigImported",
67
+ ConfigImportBadInput: "ConfigImportBadInput",
68
+ ConfigImportNotFound: "ConfigImportNotFound",
69
+ ConfigImportInvalid: "ConfigImportInvalid",
70
+ ConfigImportRead: "ConfigImportRead",
71
+ ConfigImportFailed: "ConfigImportFailed",
72
+ ConfigFreezeToolLookup: "ConfigFreezeToolLookup",
73
+ ConfigFreezeAllNothingFound: "ConfigFreezeAllNothingFound",
74
+ ConfigFreezeNoTool: "ConfigFreezeNoTool"
75
+ };
76
+
77
+ // src/commands/config/configFile.ts
78
+ function homeConfigWarning(path, action) {
79
+ return `${configPathForMessage(path)} is the home config, so ${action.doing} applies to every repo without a .uipath/config.json of its own. To ${action.onlyThisRepo}, create an empty .uipath/config.json at its root, then run '${action.command}' there.`;
80
+ }
81
+ function configFileTelemetryProperties(options) {
82
+ return options.configFile !== undefined ? { configFile: TELEMETRY_ARG_VALUE_WITHHELD } : {};
83
+ }
84
+
85
+ class FileReadError extends Error {
86
+ readError;
87
+ constructor(readError) {
88
+ super(readError.message);
89
+ this.readError = readError;
90
+ this.name = "FileReadError";
91
+ }
92
+ }
93
+ async function readConfigFileOrReadError(path) {
94
+ const [readError, fileConfig] = await catchError(readConfigFileAt(path));
95
+ if (readError)
96
+ throw new FileReadError(readError);
97
+ return fileConfig;
98
+ }
99
+ function valueText(value) {
100
+ return typeof value === "string" ? value : JSON.stringify(value);
101
+ }
102
+ function setUpdateChannel(fileConfig, channel, source) {
103
+ const replaced = fileConfig.core;
104
+ const core = asRecord(replaced) ?? {};
105
+ const previous = core.updateChannel;
106
+ fileConfig.core = { ...core, updateChannel: channel };
107
+ if (replaced !== undefined && asRecord(replaced) === undefined) {
108
+ return `The config's core ${valueText(replaced)} is not an object, so it is replaced; its updateChannel is set to ${channel}, the channel of ${source}.`;
109
+ }
110
+ if (previous === undefined) {
111
+ return `The config's updateChannel is set to ${channel}, the channel of ${source}.`;
112
+ }
113
+ return previous !== channel ? `The config's updateChannel changes from ${valueText(previous)} to ${channel}, the channel of ${source}.` : undefined;
114
+ }
115
+ function readVersions(fileConfig) {
116
+ const versionsBlock = asRecord(fileConfig.versions) ?? {};
117
+ const tools = asRecord(versionsBlock.tools);
118
+ return {
119
+ ...versionsBlock.cli !== undefined && {
120
+ cli: valueText(versionsBlock.cli)
121
+ },
122
+ ...versionsBlock.skills !== undefined && {
123
+ skills: valueText(versionsBlock.skills)
124
+ },
125
+ ...tools && {
126
+ tools: Object.fromEntries(Object.entries(tools).map(([name, pin]) => [
127
+ name,
128
+ valueText(pin)
129
+ ]))
130
+ }
131
+ };
132
+ }
133
+ async function reportConfigFileError(error, path, configFile) {
134
+ if (error instanceof FreezeFailureError) {
135
+ reportFreezeFailureError(error);
136
+ return;
137
+ }
138
+ if (!(error instanceof FileReadError)) {
139
+ const cause = await classifyError(error);
140
+ reportFreezeFailure("fileWrite", { path, cause }, { Code: CONFIG_CODES.ConfigFileWrite });
141
+ return;
142
+ }
143
+ reportFreezeFailureError(await configFileReadFailure(error.readError, path, configFile));
144
+ }
145
+ async function configFileReadFailure(readError, path, configFile) {
146
+ const cause = await classifyError(readError);
147
+ const { code } = readError;
148
+ if (typeof code === "string")
149
+ cause.message = code;
150
+ const [, stats] = await catchError(getFileSystem2().stat(path));
151
+ const folder = code === "EISDIR" || stats?.isDirectory() === true;
152
+ return freezeFailureError("fileRead", { path, cause, folder, configFile }, { Code: CONFIG_CODES.ConfigFileRead });
153
+ }
154
+ function configFilePathFailure(error) {
155
+ return freezeFailureError("configFilePath", error, {
156
+ Code: error.problem === "missing" ? CONFIG_CODES.ConfigFileNotFound : CONFIG_CODES.ConfigFileBadPath
157
+ });
158
+ }
159
+
160
+ // src/services/forcedUpdate.ts
161
+ function canonical(value) {
162
+ return JSON.stringify(value, (_key, nested) => nested !== null && typeof nested === "object" && !Array.isArray(nested) ? Object.fromEntries(Object.entries(nested).sort(([a], [b]) => a.localeCompare(b))) : nested);
163
+ }
164
+ async function writeVersions(path, fileConfig, versions) {
165
+ validatePins(versions, asRecord(fileConfig.core)?.updateChannel);
166
+ fileConfig.versions = versions;
167
+ await writeConfigFileAt(path, fileConfig);
168
+ replaceCachedVersions(versions, asRecord(fileConfig.core)?.updateChannel);
169
+ }
170
+ async function editToolPins(edit) {
171
+ const { path } = await resolveConfigWriteTargetAsync();
172
+ const tools = await withConfigLock(path, async () => {
173
+ const fileConfig = await readConfigFileAt(path);
174
+ const current = readVersions(fileConfig);
175
+ if (current.cli === undefined) {
176
+ throw new Error("The config has no versions.cli, so the pin was not written.");
177
+ }
178
+ const edited = sortedByName(edit(current.tools ?? {}));
179
+ await writeVersions(path, fileConfig, {
180
+ ...current,
181
+ cli: current.cli,
182
+ tools: edited
183
+ });
184
+ return edited;
185
+ });
186
+ return { path, tools };
187
+ }
188
+ async function writeToolPin2(packageName, version) {
189
+ const { path, tools } = await editToolPins(({ [packageName]: _old, ...tools }) => version === undefined ? tools : { ...tools, [packageName]: version });
190
+ return { path, pin: tools[packageName] };
191
+ }
192
+ async function removeToolPins2(packageNames) {
193
+ const { path } = await editToolPins((tools) => Object.fromEntries(Object.entries(tools).filter(([name]) => !packageNames.includes(name))));
194
+ return path;
195
+ }
196
+ function installedAfter(report, discovered) {
197
+ const installed = new Map(discovered.map((tool) => [tool.packageName, tool.version]));
198
+ for (const entry of report.Tools ?? []) {
199
+ if (entry.status !== "failed" && entry.to !== undefined) {
200
+ installed.set(toolPackageName(entry.name), entry.to);
201
+ }
202
+ }
203
+ return installed;
204
+ }
205
+ function isOnLine(pin, linePrefix) {
206
+ return versionLinePrefix(pin) === linePrefix;
207
+ }
208
+ async function lookUpMissingPins(pinned, { installed, linePrefix, channel }, warnings) {
209
+ const moved = new Map;
210
+ const dropped = new Set;
211
+ for (const [name, pin] of Object.entries(pinned)) {
212
+ if (installed.has(name))
213
+ continue;
214
+ let failure;
215
+ const candidate = await toolService.resolveInstallCandidate(name, linePrefix, channel, (lookupFailure) => {
216
+ failure = lookupFailure;
217
+ });
218
+ if (candidate || !failure || failure.kind === "not-found") {
219
+ moved.set(name, candidate?.version);
220
+ continue;
221
+ }
222
+ const { message } = describeCandidateFailure(name, linePrefix, failure, await getEffectiveRegistry(name));
223
+ if (isOnLine(pin, linePrefix)) {
224
+ warnings.push(`${message} The freeze keeps ${name} at ${pin}.`);
225
+ continue;
226
+ }
227
+ dropped.add(name);
228
+ warnings.push(`${message} ${name} ${pin} is not on the ${linePrefix}x line, so it is removed from the freeze.`);
229
+ }
230
+ return { moved, dropped };
231
+ }
232
+ function toolPinsAfter({ installed, moved, dropped, linePrefix, channel }, current, warnings) {
233
+ const tools = {};
234
+ for (const [name, version] of installed) {
235
+ if (version.startsWith(linePrefix)) {
236
+ tools[name] = version;
237
+ continue;
238
+ }
239
+ const outcome = current.tools?.[name] === undefined ? "it is not frozen" : "it is removed from the freeze";
240
+ warnings.push(`${name} ${version} is not on the ${linePrefix}x line, so ${outcome}.`);
241
+ }
242
+ for (const [name, pin] of Object.entries(current.tools ?? {})) {
243
+ if (installed.has(name) || dropped.has(name))
244
+ continue;
245
+ if (!moved.has(name) && !isOnLine(pin, linePrefix)) {
246
+ warnings.push(`${name} ${pin} is not on the ${linePrefix}x line, so it is removed from the freeze.`);
247
+ continue;
248
+ }
249
+ const version = moved.has(name) ? moved.get(name) : pin;
250
+ if (version !== undefined) {
251
+ tools[name] = version;
252
+ continue;
253
+ }
254
+ warnings.push(`${name} has no ${channel} build on the ${linePrefix}x line, so it is removed from the freeze.`);
255
+ }
256
+ return tools;
257
+ }
258
+ async function skillsPinAfter({ skills, linePrefix }, current, warnings) {
259
+ const decision = await skillsPinFor(skills, current.skills, linePrefix);
260
+ if (decision.reason === "installedOffLine") {
261
+ warnings.push(`@uipath/skills ${decision.installed} is not on the ${linePrefix}x line, so it is not frozen. The skills follow the line of the CLI pin.`);
262
+ }
263
+ if (decision.reason === "pinOffLine") {
264
+ warnings.push(`The skills pin ${decision.pin} is not on the ${linePrefix}x line and no skills are installed, so it is removed from the freeze. The skills follow the line of the CLI pin.`);
265
+ }
266
+ return "skills" in decision ? decision.skills : undefined;
267
+ }
268
+ async function versionsAfter(moves, current, warnings) {
269
+ const tools = toolPinsAfter(moves, current, warnings);
270
+ const skills = await skillsPinAfter(moves, current, warnings);
271
+ return {
272
+ cli: moves.cli,
273
+ ...skills !== undefined && { skills },
274
+ tools: sortedByName(tools)
275
+ };
276
+ }
277
+ async function updatedSkillsVersion(report) {
278
+ const sections = (report.Skills?.Sections ?? []).filter(({ error }) => error === undefined);
279
+ const section = sections.find(({ scope }) => scope === "local") ?? sections.find(({ scope }) => scope === "global");
280
+ if (!section)
281
+ return readInstalledSkillsVersion();
282
+ const fs = getFileSystem2();
283
+ return readStoreSkillsVersion(fs.path.join(section.rootDir, STORE_NAME));
284
+ }
285
+ async function writeBackVersions2(report, discovered) {
286
+ const cli = report.Cli?.action === "updated" && report.Cli.available ? report.Cli.available : package_default.version;
287
+ const afterUpdate = {
288
+ cli,
289
+ linePrefix: versionLinePrefix(cli),
290
+ channel: report.Channel,
291
+ installed: installedAfter(report, discovered),
292
+ skills: await updatedSkillsVersion(report)
293
+ };
294
+ const { path } = await resolveConfigWriteTargetAsync();
295
+ const warnings = [];
296
+ const pinned = readVersions(await readConfigFileAt(path)).tools ?? {};
297
+ const moves = {
298
+ ...afterUpdate,
299
+ ...await lookUpMissingPins(pinned, afterUpdate, warnings)
300
+ };
301
+ const { versions, changed } = await withConfigLock(path, async () => {
302
+ const fileConfig = await readConfigFileAt(path);
303
+ const current = readVersions(fileConfig);
304
+ if (fileConfig.versions === undefined) {
305
+ warnings.length = 0;
306
+ warnings.push("The versions block was removed while the update ran, so nothing was written back.");
307
+ return {
308
+ versions: await versionsAfter(moves, current, []),
309
+ changed: false
310
+ };
311
+ }
312
+ const written = await versionsAfter(moves, current, warnings);
313
+ const fileChannel = asRecord(fileConfig.core)?.updateChannel;
314
+ const channelMoved = fileChannel !== undefined && fileChannel !== report.Channel;
315
+ if (canonical(written) === canonical(current) && !channelMoved) {
316
+ return { versions: written, changed: false };
317
+ }
318
+ const channelWarning = setUpdateChannel(fileConfig, report.Channel, "this update");
319
+ await writeVersions(path, fileConfig, written);
320
+ if (channelWarning !== undefined)
321
+ warnings.push(channelWarning);
322
+ return { versions: written, changed: true };
323
+ });
324
+ for (const warning of warnings)
325
+ OutputFormatter.log({ Warning: warning });
326
+ return { path, versions, changed };
327
+ }
328
+
329
+ export { CONFIG_CODES, homeConfigWarning, configFileTelemetryProperties, FileReadError, readConfigFileOrReadError, valueText, setUpdateChannel, readVersions, reportConfigFileError, configFileReadFailure, configFilePathFailure, writeToolPin2, removeToolPins2, writeBackVersions2 };
330
+
331
+ //# debugId=467FB99008347A1D64756E2164756E21
@@ -0,0 +1,14 @@
1
+ // src/utils/samePath.ts
2
+ function samePath(a, b) {
3
+ const norm = (p) => {
4
+ let forward = p.replaceAll("\\", "/");
5
+ while (forward.endsWith("/"))
6
+ forward = forward.slice(0, -1);
7
+ return process.platform === "win32" ? forward.toLowerCase() : forward;
8
+ };
9
+ return norm(a) === norm(b);
10
+ }
11
+
12
+ export { samePath };
13
+
14
+ //# debugId=7CE141C2A3D9EA9F64756E2164756E21
@@ -47,12 +47,26 @@ class NodeFileSystem {
47
47
  throw error;
48
48
  }
49
49
  }
50
- async writeFile(filePath, data) {
50
+ async writeFile(filePath, data, options) {
51
51
  const dir = path.dirname(filePath);
52
52
  if (dir) {
53
53
  await fs.mkdir(dir, { recursive: true });
54
54
  }
55
- await fs.writeFile(filePath, data);
55
+ if (options?.mode === undefined || process.platform === "win32") {
56
+ if (options?.exclusive) {
57
+ await fs.writeFile(filePath, data, { flag: "wx" });
58
+ } else {
59
+ await fs.writeFile(filePath, data);
60
+ }
61
+ return;
62
+ }
63
+ const handle = await fs.open(filePath, options.exclusive ? "wx" : "w", options.mode);
64
+ try {
65
+ await handle.chmod(options.mode);
66
+ await handle.writeFile(data);
67
+ } finally {
68
+ await handle.close();
69
+ }
56
70
  }
57
71
  async appendFile(filePath, data) {
58
72
  const dir = path.dirname(filePath);
@@ -87,7 +101,8 @@ class NodeFileSystem {
87
101
  isDirectory: () => stats.isDirectory(),
88
102
  size: stats.size,
89
103
  mtimeMs: stats.mtimeMs,
90
- ctimeMs: stats.ctimeMs
104
+ ctimeMs: stats.ctimeMs,
105
+ mode: stats.mode
91
106
  };
92
107
  } catch (error) {
93
108
  if (this.isEnoent(error))
@@ -98,8 +113,13 @@ class NodeFileSystem {
98
113
  async exists(filePath) {
99
114
  return existsSync(filePath);
100
115
  }
101
- async mkdir(dirPath) {
102
- await fs.mkdir(dirPath, { recursive: true });
116
+ async mkdir(dirPath, options) {
117
+ await fs.mkdir(dirPath, { recursive: true, mode: options?.mode });
118
+ }
119
+ async chmod(targetPath, mode) {
120
+ if (process.platform === "win32")
121
+ return;
122
+ await fs.chmod(targetPath, mode);
103
123
  }
104
124
  async acquireLock(lockPath) {
105
125
  const canonicalPath = await this.canonicalizeLockTarget(lockPath);
@@ -249,7 +269,7 @@ class NodeFileSystem {
249
269
  async getTempDir() {
250
270
  return await fs.mkdtemp(path.join(os.tmpdir(), "uipath-fs-"));
251
271
  }
252
- async copyDirectory(sourcePath, destPath) {
272
+ async copyDirectory(sourcePath, destPath, options) {
253
273
  const sourceStats = await this.stat(sourcePath);
254
274
  if (!sourceStats) {
255
275
  throw new Error(`Source directory does not exist: ${sourcePath}`);
@@ -266,7 +286,9 @@ class NodeFileSystem {
266
286
  if (!entryStats)
267
287
  continue;
268
288
  if (entryStats.isDirectory()) {
269
- await this.copyDirectory(srcEntry, destEntry);
289
+ if (options?.skipDirectoryNames?.includes(entry))
290
+ continue;
291
+ await this.copyDirectory(srcEntry, destEntry, options);
270
292
  } else if (entryStats.isFile()) {
271
293
  const content = await this.readFile(srcEntry);
272
294
  if (content !== null) {
@@ -290,4 +312,4 @@ var getFileSystemAsync2 = async () => fsInstance;
290
312
 
291
313
  export { getFileSystem2, getFileSystemAsync2 };
292
314
 
293
- //# debugId=69A68E101956586864756E2164756E21
315
+ //# debugId=B7362B128856D2D464756E2164756E21
@@ -1,9 +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
- } from "./index-fdztq951.js";
6
+ } from "./index-zhp702kh.js";
7
+ import {
8
+ readStoreSkillsVersion
9
+ } from "./index-jk7em40j.js";
7
10
  import {
8
11
  resolveSkillSource2,
9
12
  fetchSkillsTo2,
@@ -11,18 +14,18 @@ import {
11
14
  getAvailableSkills2,
12
15
  MANIFEST_NAME2,
13
16
  readManifest2
14
- } from "./index-dst4pf6j.js";
17
+ } from "./index-z3q16ts7.js";
15
18
  import {
16
19
  ALL_AGENTS
17
- } from "./index-hweqs8nn.js";
20
+ } from "./index-2g332j2f.js";
18
21
  import {
19
22
  SkillsError2,
20
23
  runAgentInstalls2,
21
24
  cleanupStaleSkills2
22
- } from "./index-nn9v5yjd.js";
25
+ } from "./index-3vkb4j13.js";
23
26
  import {
24
27
  getSkillsSourceFailureDetails
25
- } from "./index-wg3cne7n.js";
28
+ } from "./index-xxms6rt8.js";
26
29
 
27
30
  // src/services/updateService.skills.ts
28
31
  import { randomUUID } from "node:crypto";
@@ -99,7 +102,8 @@ async function runSkillsUpdate2(opts) {
99
102
  const [sectionErr, section] = await catchError(updateOneSection(opts, candidate, source));
100
103
  if (sectionErr) {
101
104
  const skillsErr = sectionErr instanceof SkillsError2 ? sectionErr : null;
102
- const instructions = skillsErr?.instructions ?? getSkillsSourceFailureDetails(sectionErr).instructions;
105
+ const details = getSkillsSourceFailureDetails(sectionErr);
106
+ const instructions = skillsErr?.instructions ?? details.instructions;
103
107
  sections.push({
104
108
  rootDir: candidate.rootDir,
105
109
  scope: candidate.scope,
@@ -111,7 +115,9 @@ async function runSkillsUpdate2(opts) {
111
115
  error: {
112
116
  result: skillsErr?.result ?? "Failure",
113
117
  message: sectionErr.message,
114
- instructions
118
+ instructions,
119
+ errorCode: skillsErr ? undefined : details.errorCode,
120
+ retry: skillsErr ? undefined : details.retry
115
121
  }
116
122
  });
117
123
  continue;
@@ -124,7 +130,9 @@ async function runSkillsUpdate2(opts) {
124
130
  async function updateOneSection(opts, candidate, source) {
125
131
  const fs = getFileSystem2();
126
132
  const isLocal = candidate.scope === "local";
127
- const previousManifest = await readManifest2(fs.path.join(candidate.rootDir, source.storeName));
133
+ const previousStore = fs.path.join(candidate.rootDir, source.storeName);
134
+ const previousManifest = await readManifest2(previousStore);
135
+ const from = await readStoreSkillsVersion(previousStore);
128
136
  const previousSkills = Object.keys(previousManifest.skills);
129
137
  let agents;
130
138
  if (opts.agent) {
@@ -152,7 +160,7 @@ async function updateOneSection(opts, candidate, source) {
152
160
  try {
153
161
  await fs.mkdir(tmpRoot);
154
162
  const tmpStore = fs.path.join(tmpRoot, "store");
155
- await fetchSkillsTo2(tmpStore, tmpRoot, source, opts.targetVersion);
163
+ await fetchSkillsTo2(tmpStore, tmpRoot, source, opts.targetVersion, opts.skillsVersion);
156
164
  const remoteSkills = await getAvailableSkills2(tmpStore);
157
165
  const remoteNames = remoteSkills.map((s) => s.name);
158
166
  return {
@@ -162,13 +170,14 @@ async function updateOneSection(opts, candidate, source) {
162
170
  skills: remoteNames,
163
171
  added: remoteNames.filter((n) => !previousSkills.includes(n)),
164
172
  removed: previousSkills.filter((n) => !remoteNames.includes(n)),
165
- refreshed: 0
173
+ refreshed: 0,
174
+ ...versionMove(from, await readStoreSkillsVersion(tmpStore))
166
175
  };
167
176
  } finally {
168
177
  await catchError(fs.rm(tmpRoot));
169
178
  }
170
179
  }
171
- const storePath = await getContentStore2(candidate.rootDir, source, opts.targetVersion);
180
+ const storePath = await getContentStore2(candidate.rootDir, source, opts.targetVersion, opts.skillsVersion);
172
181
  const availableSkills = await getAvailableSkills2(storePath);
173
182
  const availableNames = availableSkills.map((s) => s.name);
174
183
  const added = availableNames.filter((n) => !previousSkills.includes(n));
@@ -191,10 +200,17 @@ async function updateOneSection(opts, candidate, source) {
191
200
  skills: availableNames,
192
201
  added,
193
202
  removed,
194
- refreshed: installed.length
203
+ refreshed: installed.length,
204
+ ...versionMove(from, await readStoreSkillsVersion(storePath))
205
+ };
206
+ }
207
+ function versionMove(from, to) {
208
+ return {
209
+ ...from !== undefined && { from },
210
+ ...to !== undefined && { to }
195
211
  };
196
212
  }
197
213
 
198
214
  export { runSkillsUpdate2 };
199
215
 
200
- //# debugId=88AF4A5DB1FF04D064756E2164756E21
216
+ //# debugId=73D09576CD8237C364756E2164756E21