@uipath/cli 1.205.0-preview.276 → 1.206.0-preview.279

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 (76) hide show
  1. package/dist/{applicationinsights-s28k1t0d.js → applicationinsights-pwe8sf3y.js} +1269 -1269
  2. package/dist/{browser-strategy-6atc7v8s.js → browser-strategy-p5fhwxqj.js} +6 -7
  3. package/dist/cli-q6fp9ccp.js +23 -0
  4. package/dist/contentStore-c51xqdn2.js +41 -0
  5. package/dist/environmentInfo-fn0za9jw.js +71 -0
  6. package/dist/feedbackPrompts-t1enxv1x.js +144 -0
  7. package/dist/handlers-93z27zrr.js +805 -0
  8. package/dist/index-16d4evd1.js +1051 -0
  9. package/dist/index-1vyte4ma.js +14 -0
  10. package/dist/index-21kns9qg.js +10 -0
  11. package/dist/{index-yhj4pgvt.js → index-2j7ss97f.js} +331 -2595
  12. package/dist/index-2k8rhmad.js +274 -0
  13. package/dist/{index-30618bjs.js → index-2mm750yx.js} +174 -234
  14. package/dist/{index-622x1qb5.js → index-3fvbddpw.js} +7092 -7092
  15. package/dist/{index-d3w0wn6k.js → index-5gce5wfd.js} +16 -16
  16. package/dist/index-5j0bfd3e.js +4744 -0
  17. package/dist/index-68xmrb9x.js +237 -0
  18. package/dist/index-6wj58qka.js +59 -0
  19. package/dist/index-898c4tfz.js +668 -0
  20. package/dist/index-8gr7ny79.js +365 -0
  21. package/dist/index-99emfvtm.js +13 -0
  22. package/dist/{index-pj3g8ftz.js → index-9db5vwx9.js} +2429 -1693
  23. package/dist/index-ayg25v46.js +151 -0
  24. package/dist/index-bf0e4evz.js +6180 -0
  25. package/dist/index-bpqx6f8h.js +92 -0
  26. package/dist/index-bpxh3fqv.js +392 -0
  27. package/dist/index-cc653qc1.js +1327 -0
  28. package/dist/{index-m5nwse9v.js → index-cj4v0jct.js} +21 -69
  29. package/dist/{index-469jgr1w.js → index-dsj3jrm0.js} +105 -106
  30. package/dist/{index-1yh8g550.js → index-epsr41wx.js} +8 -12
  31. package/dist/{index-yb4er9vd.js → index-jjejkkg4.js} +474 -528
  32. package/dist/index-kg1xrq51.js +171 -0
  33. package/dist/index-m8vqyv3g.js +72 -0
  34. package/dist/index-mzqm6xfh.js +45 -0
  35. package/dist/index-nsrrst23.js +44 -0
  36. package/dist/{index-h8cph72k.js → index-nzr4mx5p.js} +2 -22
  37. package/dist/index-p9s0gyrw.js +72 -0
  38. package/dist/index-qadhm1gn.js +271 -0
  39. package/dist/index-qwbyt2q5.js +95 -0
  40. package/dist/index-rbna3w6k.js +200 -0
  41. package/dist/index-rr5hdtcy.js +95 -0
  42. package/dist/{index-qa9gftnj.js → index-xd2w5pct.js} +3 -3
  43. package/dist/index-xpdtagqw.js +30 -0
  44. package/dist/{index-925304r7.js → index-y085rpen.js} +29 -25
  45. package/dist/index-y5ncb93a.js +240 -0
  46. package/dist/index-y7d0cth0.js +93 -0
  47. package/dist/{index-hdxtgckw.js → index-z070caqq.js} +56 -12
  48. package/dist/index-zdqbp34f.js +14 -0
  49. package/dist/index.js +38 -36
  50. package/dist/install-3gw33jcf.js +558 -0
  51. package/dist/{jmespath-e4a59c8w.js → jmespath-ab6tdc42.js} +1 -1
  52. package/dist/js-yaml-0c4svjwq.js +36 -0
  53. package/dist/{mcp-jssaz3wr.js → mcp-s50h6d56.js} +236 -472
  54. package/dist/{node-strategy-ggx3nmyj.js → node-strategy-p1n8wr5s.js} +16 -19
  55. package/dist/project-context-285hydnd.js +94 -0
  56. package/dist/prompt-hxbzt92e.js +13 -0
  57. package/dist/{server-nfjr7xrb.js → server-gkr3c7hv.js} +28 -43
  58. package/dist/skillCatalog-fvw4wgw1.js +22 -0
  59. package/dist/skillsService-20es18vs.js +29 -0
  60. package/dist/{stdio-tmngemcz.js → stdio-kpsab5bz.js} +2 -4
  61. package/dist/{telemetry-drain-r92f0e4r.js → telemetry-drain-bw59e8f5.js} +8 -9
  62. package/dist/tree-j4w7p0pg.js +17 -0
  63. package/dist/updateService-pq7pkd42.js +522 -0
  64. package/dist/updateService.skills-4t1s7z45.js +22 -0
  65. package/dist/updateService.tools-f7tr6kc6.js +16 -0
  66. package/package.json +2 -2
  67. package/dist/cli-r7998zeh.js +0 -19
  68. package/dist/index-0gctz400.js +0 -17
  69. package/dist/index-2dp7m4r8.js +0 -9867
  70. package/dist/index-4cq44eth.js +0 -19427
  71. package/dist/index-7tshyfxx.js +0 -157
  72. package/dist/index-g8ck9tv6.js +0 -2
  73. package/dist/index-ngs0a2he.js +0 -15
  74. package/dist/index-yc4kw997.js +0 -13
  75. package/dist/js-yaml-69tsdrrf.js +0 -37
  76. package/dist/updateService-nrmb1tsc.js +0 -14
@@ -0,0 +1,365 @@
1
+ import {
2
+ getFileSystem2
3
+ } from "./index-z070caqq.js";
4
+ import {
5
+ catchError,
6
+ RESULTS,
7
+ getOutputSink,
8
+ logger,
9
+ OutputFormatter,
10
+ processContext,
11
+ wasInteractiveFlagPassed,
12
+ canPrompt
13
+ } from "./index-9db5vwx9.js";
14
+ import {
15
+ resolvePinnedVersion,
16
+ formatVersionPin
17
+ } from "./index-qadhm1gn.js";
18
+ import {
19
+ ALL_AGENTS,
20
+ AGENT_DEFS,
21
+ getSkillsDir,
22
+ skillOwnerOf,
23
+ installSkill,
24
+ installExtraFolders,
25
+ isCommandFile,
26
+ installSkillCommands,
27
+ uninstallSkill,
28
+ rejectIfGlobalOnly
29
+ } from "./index-898c4tfz.js";
30
+ import {
31
+ DEFAULT_SOURCE2,
32
+ resolveSkillSource2,
33
+ getContentStore2,
34
+ getAvailableSkills2,
35
+ addToGitignore2,
36
+ readManifest2,
37
+ updateManifestAfterInstall2,
38
+ removeFromManifest2,
39
+ readExtraFiles2,
40
+ recordExtraFiles2
41
+ } from "./index-cc653qc1.js";
42
+ import {
43
+ promptAgentSelection2
44
+ } from "./index-xpdtagqw.js";
45
+ import {
46
+ SKILL_CATALOG_SKILL_NAME2,
47
+ writeSkillCatalog2
48
+ } from "./index-2k8rhmad.js";
49
+
50
+ // src/commands/skills/skillsService.ts
51
+ class SkillsError2 extends Error {
52
+ instructions;
53
+ result;
54
+ constructor(message, instructions, result = "Failure") {
55
+ super(message);
56
+ this.name = "SkillsError";
57
+ this.instructions = instructions;
58
+ this.result = result;
59
+ }
60
+ }
61
+ var NO_AGENT_DETECTED_REASON = "NoAgentDetected";
62
+ function sourceOf(resolved) {
63
+ return resolved.source ?? DEFAULT_SOURCE2;
64
+ }
65
+ function resolveSkillsTargetVersion2(source) {
66
+ if (!source.isDefault)
67
+ return;
68
+ const pin = resolvePinnedVersion();
69
+ return pin ? formatVersionPin(pin) : undefined;
70
+ }
71
+ async function resolveRootDir2(options) {
72
+ const fs = getFileSystem2();
73
+ const explicitPath = options.path?.trim();
74
+ const isLocal = !!options.local || !!explicitPath;
75
+ if (!explicitPath) {
76
+ return { isLocal, rootDir: isLocal ? fs.env.cwd() : fs.env.homedir() };
77
+ }
78
+ const rootDir = fs.path.resolve(explicitPath);
79
+ const stat = await fs.stat(rootDir);
80
+ if (!stat?.isDirectory()) {
81
+ OutputFormatter.error({
82
+ Result: RESULTS.ValidationError,
83
+ Message: `Path does not exist or is not a directory: ${rootDir}`,
84
+ Instructions: "Pass --path pointing to an existing project directory."
85
+ });
86
+ return null;
87
+ }
88
+ return { isLocal, rootDir };
89
+ }
90
+ function handlePromptCancellation(err, operation) {
91
+ if (err instanceof Error && err.name === "ExitPromptError") {
92
+ logger.warn(`${operation.charAt(0).toUpperCase() + operation.slice(1)} cancelled.`);
93
+ throw Object.assign(new Error("cancelled"), { exitCode: 130 });
94
+ }
95
+ throw err;
96
+ }
97
+ function canRenderPicker() {
98
+ const caps = getOutputSink().capabilities;
99
+ return canPrompt() && caps.isInteractive && caps.canReadInput;
100
+ }
101
+ async function resolveSkillsContext2(options, operation) {
102
+ const root = await resolveRootDir2(options);
103
+ if (!root)
104
+ return null;
105
+ const { isLocal, rootDir } = root;
106
+ const source = resolveSkillSource2(options.repo, options.branch);
107
+ let agents;
108
+ const wantsPicker = wasInteractiveFlagPassed() && !options.agent;
109
+ if (wantsPicker) {
110
+ if (!canRenderPicker()) {
111
+ OutputFormatter.error({
112
+ Result: RESULTS.Failure,
113
+ Message: "Interactive mode requested but prompting is disabled.",
114
+ Instructions: `Run in an interactive terminal, or pass --agent <agent> (one of: ${ALL_AGENTS.join(", ")}).`,
115
+ ErrorCode: "invalid_argument",
116
+ Retry: "RetryWillNotFix"
117
+ });
118
+ processContext.exit(1);
119
+ return null;
120
+ }
121
+ const detected = await detectInstalledAgents(isLocal, source.isDefault);
122
+ const [agentErr, selected] = await catchError(promptAgentSelection2(operation, isLocal, detected, source.isDefault));
123
+ if (agentErr)
124
+ handlePromptCancellation(agentErr, operation);
125
+ agents = selected;
126
+ } else if (options.agent) {
127
+ const agent = options.agent.trim().toLowerCase();
128
+ if (!ALL_AGENTS.includes(agent)) {
129
+ OutputFormatter.error({
130
+ Result: RESULTS.ValidationError,
131
+ Message: `Unknown agent: ${agent}`,
132
+ Instructions: `Available agents: ${ALL_AGENTS.join(", ")}`
133
+ });
134
+ return null;
135
+ }
136
+ if (rejectIfGlobalOnly(agent, isLocal, operation, source.isDefault))
137
+ return null;
138
+ agents = [agent];
139
+ } else {
140
+ const detected = await detectInstalledAgents(isLocal, source.isDefault);
141
+ if (detected.length > 0) {
142
+ logger.info(`Detected installed agents: ${detected.join(", ")}. ` + "Installing skills for all of them. Pass --agent to target one.");
143
+ agents = detected;
144
+ } else if (options.skipIfNoAgent) {
145
+ return {
146
+ rootDir,
147
+ storePath: "",
148
+ selectedSkills: [],
149
+ agents: [],
150
+ isLocal,
151
+ source,
152
+ skipped: {
153
+ reason: NO_AGENT_DETECTED_REASON,
154
+ message: "No supported agent was found on PATH.",
155
+ instructions: `Install a supported agent CLI or re-run with --agent <agent> (one of: ${ALL_AGENTS.join(", ")}).`
156
+ }
157
+ };
158
+ } else if (!canRenderPicker()) {
159
+ OutputFormatter.error({
160
+ Result: RESULTS.Failure,
161
+ Message: "No agents detected and prompting is disabled.",
162
+ Instructions: `No supported agent was found on PATH. Pass --agent <agent> (one of: ${ALL_AGENTS.join(", ")}), or run from an interactive terminal with --interactive to select.`,
163
+ ErrorCode: "configuration_error",
164
+ Retry: "RetryWillNotFix",
165
+ Data: { Reason: NO_AGENT_DETECTED_REASON }
166
+ });
167
+ processContext.exit(1);
168
+ return null;
169
+ } else {
170
+ const [agentErr, selected] = await catchError(promptAgentSelection2(operation, isLocal, [], source.isDefault));
171
+ if (agentErr)
172
+ handlePromptCancellation(agentErr, operation);
173
+ agents = selected;
174
+ }
175
+ }
176
+ const targetVersion = resolveSkillsTargetVersion2(source);
177
+ const storePath = await getContentStore2(rootDir, source, targetVersion);
178
+ const shadowedSkills = [];
179
+ const availableSkills = await getAvailableSkills2(storePath, shadowedSkills);
180
+ const selectedSkills = availableSkills.filter((skill) => skill.name !== SKILL_CATALOG_SKILL_NAME2);
181
+ if (selectedSkills.length === 0) {
182
+ OutputFormatter.error({
183
+ Result: RESULTS.ConfigError,
184
+ Message: "No skills found in content store.",
185
+ Instructions: "Check that the @uipath/skills package contains skills in the skills/ directory."
186
+ });
187
+ return null;
188
+ }
189
+ return {
190
+ rootDir,
191
+ storePath,
192
+ selectedSkills,
193
+ shadowedSkills,
194
+ agents,
195
+ isLocal,
196
+ source,
197
+ force: options.force
198
+ };
199
+ }
200
+ async function detectInstalledAgents(isLocal, isDefaultSource = true) {
201
+ const candidates = ALL_AGENTS.filter((a) => !(isLocal && isDefaultSource && AGENT_DEFS[a].globalOnly));
202
+ const results = await Promise.all(candidates.map(async (a) => {
203
+ const detect = AGENT_DEFS[a].detect;
204
+ if (!detect)
205
+ return null;
206
+ const [, found] = await catchError(detect());
207
+ return found ? a : null;
208
+ }));
209
+ return results.filter((a) => a !== null);
210
+ }
211
+ async function runOneAgent(agent, operation, resolved) {
212
+ const { rootDir, storePath, selectedSkills, isLocal } = resolved;
213
+ const source = sourceOf(resolved);
214
+ const isDefaultSource = source.isDefault;
215
+ const def = AGENT_DEFS[agent];
216
+ const customHook = isDefaultSource ? operation === "update" ? def.update ?? def.install : def.install : undefined;
217
+ if (customHook) {
218
+ const [installError] = await catchError(customHook({
219
+ skills: selectedSkills,
220
+ rootDir,
221
+ storePath,
222
+ isLocal,
223
+ force: resolved.force
224
+ }));
225
+ if (installError) {
226
+ return Object.assign(new Error(`Failed to ${operation} skills for ${agent}: ${installError.message}`), {
227
+ instructions: installError.instructions
228
+ });
229
+ }
230
+ return {
231
+ installedIds: selectedSkills.map((s) => `${agent}:${s.name}`),
232
+ installedNames: selectedSkills.map((s) => s.name),
233
+ conflicts: [],
234
+ extraFiles: []
235
+ };
236
+ }
237
+ const owner = skillOwnerOf(source);
238
+ const skillsDir = getSkillsDir(agent, rootDir, isLocal);
239
+ const installedIds = [];
240
+ const installedNames = [];
241
+ const conflicts = [];
242
+ for (const skill of selectedSkills) {
243
+ const [installError, outcome] = await catchError(installSkill(agent, skill, skillsDir, owner));
244
+ if (installError) {
245
+ return new Error(`Failed to install ${skill.name} for ${agent}: ${installError.message}`);
246
+ }
247
+ if (!outcome.installed) {
248
+ conflicts.push({
249
+ agent,
250
+ name: skill.name,
251
+ ownedBy: outcome.conflictOwner ?? "another source"
252
+ });
253
+ continue;
254
+ }
255
+ installedIds.push(`${agent}:${skill.name}`);
256
+ installedNames.push(skill.name);
257
+ }
258
+ const [, priorOwned] = await catchError(readExtraFiles2(storePath, agent));
259
+ const ownedCommands = (priorOwned ?? []).filter((rel) => isCommandFile(agent, rel));
260
+ const ownedExtra = (priorOwned ?? []).filter((rel) => !isCommandFile(agent, rel));
261
+ const [extraFoldersError, extraFolderFiles] = await catchError(installExtraFolders(agent, storePath, skillsDir, ownedExtra));
262
+ if (extraFoldersError) {
263
+ return new Error(`Failed to install extra folders for ${agent}: ${extraFoldersError.message}`);
264
+ }
265
+ const installedSkills = selectedSkills.filter((s) => installedNames.includes(s.name));
266
+ const [commandsError, commandFiles] = await catchError(installSkillCommands(agent, installedSkills, skillsDir, ownedCommands));
267
+ if (commandsError) {
268
+ return new Error(`Failed to install slash commands for ${agent}: ${commandsError.message}`);
269
+ }
270
+ const extraFiles = [...extraFolderFiles, ...commandFiles];
271
+ if (isDefaultSource) {
272
+ const installedSet = new Set(installedNames);
273
+ const [catalogError] = await catchError(writeSkillCatalog2(skillsDir, selectedSkills.filter((s) => installedSet.has(s.name)), {
274
+ agent,
275
+ scope: isLocal ? "local" : "global",
276
+ generatedAt: new Date().toISOString()
277
+ }));
278
+ if (catalogError) {
279
+ return new Error(`Failed to write skill catalog for ${agent}: ${catalogError.message}`);
280
+ }
281
+ }
282
+ return { installedIds, installedNames, conflicts, extraFiles };
283
+ }
284
+ async function runAgentInstalls2(resolved, operation = "install") {
285
+ const { rootDir, storePath, agents, isLocal } = resolved;
286
+ const installed = [];
287
+ const conflicts = [];
288
+ const succeededAgents = [];
289
+ const installedByAgent = new Map;
290
+ const extraFilesByAgent = new Map;
291
+ const failures = [];
292
+ for (const agent of agents) {
293
+ const result = await runOneAgent(agent, operation, resolved);
294
+ if (result instanceof Error) {
295
+ failures.push({ agent, error: result });
296
+ continue;
297
+ }
298
+ installed.push(...result.installedIds);
299
+ conflicts.push(...result.conflicts);
300
+ installedByAgent.set(agent, result.installedNames);
301
+ extraFilesByAgent.set(agent, result.extraFiles);
302
+ succeededAgents.push(agent);
303
+ }
304
+ if (succeededAgents.length > 0) {
305
+ for (const agent of succeededAgents) {
306
+ const names = installedByAgent.get(agent) ?? [];
307
+ if (names.length > 0) {
308
+ const [manifestError] = await catchError(updateManifestAfterInstall2(storePath, names, [agent]));
309
+ if (manifestError) {
310
+ throw new SkillsError2(`Failed to update manifest: ${manifestError.message}`, "Check that the content store is intact and you have write permissions.");
311
+ }
312
+ }
313
+ const [extraError] = await catchError(recordExtraFiles2(storePath, agent, extraFilesByAgent.get(agent) ?? []));
314
+ if (extraError) {
315
+ throw new SkillsError2(`Failed to record installed folders: ${extraError.message}`, "Check that the content store is intact and you have write permissions.");
316
+ }
317
+ }
318
+ if (isLocal) {
319
+ const [gitignoreError] = await catchError(addToGitignore2(rootDir, `${sourceOf(resolved).storeName}/`));
320
+ if (gitignoreError) {
321
+ throw new SkillsError2(`Failed to update .gitignore: ${gitignoreError.message}`, "Check that you have write permissions to the project directory.");
322
+ }
323
+ }
324
+ }
325
+ if (failures.length > 0) {
326
+ const summary = failures.map((f) => f.error.message).join("; ");
327
+ const succeededNote = succeededAgents.length > 0 ? ` (${succeededAgents.join(", ")} succeeded)` : "";
328
+ const specific = failures.map((f) => f.error.instructions).filter((i) => !!i);
329
+ throw new SkillsError2(`${summary}${succeededNote}`, specific.length > 0 ? specific.join(" ") : "Check that each failed agent's CLI is installed and on PATH. Re-run for the failed agents only — the manifest already reflects the agents that succeeded.");
330
+ }
331
+ return { installed, conflicts };
332
+ }
333
+ async function cleanupStaleSkills2(resolved) {
334
+ const { storePath, rootDir, agents, isLocal } = resolved;
335
+ const isDefaultSource = sourceOf(resolved).isDefault;
336
+ const [manifestErr, manifest] = await catchError(readManifest2(storePath));
337
+ if (manifestErr || !manifest || Object.keys(manifest.skills).length === 0)
338
+ return;
339
+ const discovery = { hadReadErrors: false };
340
+ const availableNames = (await getAvailableSkills2(storePath, undefined, discovery)).map((s) => s.name);
341
+ if (discovery.hadReadErrors) {
342
+ logger.debug("Skipping stale-skill cleanup: skill discovery was incomplete.");
343
+ return;
344
+ }
345
+ const staleNames = Object.keys(manifest.skills).filter((s) => !availableNames.includes(s));
346
+ if (staleNames.length === 0)
347
+ return;
348
+ const owner = skillOwnerOf(sourceOf(resolved));
349
+ for (const name of staleNames) {
350
+ for (const agent of agents) {
351
+ if (isDefaultSource && AGENT_DEFS[agent].uninstall)
352
+ continue;
353
+ const skillsDir = getSkillsDir(agent, rootDir, isLocal);
354
+ const [err] = await catchError(uninstallSkill(name, skillsDir, owner));
355
+ if (err) {
356
+ logger.debug(`Failed to clean up stale skill ${name} for ${agent}: ${err.message}`);
357
+ }
358
+ }
359
+ await catchError(removeFromManifest2(storePath, [name], agents));
360
+ }
361
+ }
362
+
363
+ export { SkillsError2, resolveSkillsTargetVersion2, resolveRootDir2, resolveSkillsContext2, runAgentInstalls2, cleanupStaleSkills2 };
364
+
365
+ //# debugId=12E927CE7D024CB564756E2164756E21
@@ -0,0 +1,13 @@
1
+ // ../auth/src/constants.ts
2
+ var UIPATH_HOME_DIR2 = ".uipath";
3
+ var AUTH_FILENAME = ".auth";
4
+ var DEFAULT_BASE_URL = "https://cloud.uipath.com";
5
+ var DEFAULT_AUTH_TIMEOUT_MS2 = 5 * 60 * 1000;
6
+ var AUTH_TIMEOUT_ERROR_CODE2 = "EAUTHTIMEOUT";
7
+ var AUTH_CANCELLED_ERROR_CODE2 = "EAUTHCANCELLED";
8
+ var AUTH_RECLAIMED_ERROR_CODE2 = "EAUTHRECLAIMED";
9
+ var DEFAULT_REDIRECT_URI = "http://localhost:8104/oidc/login";
10
+
11
+ export { UIPATH_HOME_DIR2, AUTH_FILENAME, DEFAULT_BASE_URL, DEFAULT_AUTH_TIMEOUT_MS2, AUTH_TIMEOUT_ERROR_CODE2, AUTH_CANCELLED_ERROR_CODE2, AUTH_RECLAIMED_ERROR_CODE2, DEFAULT_REDIRECT_URI };
12
+
13
+ //# debugId=056E9CDCB7772FA664756E2164756E21