@uipath/cli 1.205.0-preview.277 → 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.
- package/dist/{applicationinsights-s28k1t0d.js → applicationinsights-pwe8sf3y.js} +1269 -1269
- package/dist/{browser-strategy-6atc7v8s.js → browser-strategy-p5fhwxqj.js} +6 -7
- package/dist/cli-q6fp9ccp.js +23 -0
- package/dist/contentStore-c51xqdn2.js +41 -0
- package/dist/environmentInfo-fn0za9jw.js +71 -0
- package/dist/feedbackPrompts-t1enxv1x.js +144 -0
- package/dist/handlers-93z27zrr.js +805 -0
- package/dist/index-16d4evd1.js +1051 -0
- package/dist/index-1vyte4ma.js +14 -0
- package/dist/index-21kns9qg.js +10 -0
- package/dist/{index-j2tzs5k6.js → index-2j7ss97f.js} +331 -2595
- package/dist/index-2k8rhmad.js +274 -0
- package/dist/{index-30618bjs.js → index-2mm750yx.js} +174 -234
- package/dist/{index-622x1qb5.js → index-3fvbddpw.js} +7092 -7092
- package/dist/{index-d3w0wn6k.js → index-5gce5wfd.js} +16 -16
- package/dist/index-5j0bfd3e.js +4744 -0
- package/dist/index-68xmrb9x.js +237 -0
- package/dist/index-6wj58qka.js +59 -0
- package/dist/index-898c4tfz.js +668 -0
- package/dist/index-8gr7ny79.js +365 -0
- package/dist/index-99emfvtm.js +13 -0
- package/dist/{index-pj3g8ftz.js → index-9db5vwx9.js} +2429 -1693
- package/dist/index-ayg25v46.js +151 -0
- package/dist/index-bf0e4evz.js +6180 -0
- package/dist/index-bpqx6f8h.js +92 -0
- package/dist/index-bpxh3fqv.js +392 -0
- package/dist/index-cc653qc1.js +1327 -0
- package/dist/{index-m5nwse9v.js → index-cj4v0jct.js} +21 -69
- package/dist/{index-469jgr1w.js → index-dsj3jrm0.js} +105 -106
- package/dist/{index-1yh8g550.js → index-epsr41wx.js} +8 -12
- package/dist/{index-yb4er9vd.js → index-jjejkkg4.js} +474 -528
- package/dist/index-kg1xrq51.js +171 -0
- package/dist/index-m8vqyv3g.js +72 -0
- package/dist/index-mzqm6xfh.js +45 -0
- package/dist/index-nsrrst23.js +44 -0
- package/dist/{index-h8cph72k.js → index-nzr4mx5p.js} +2 -22
- package/dist/index-p9s0gyrw.js +72 -0
- package/dist/index-qadhm1gn.js +271 -0
- package/dist/index-qwbyt2q5.js +95 -0
- package/dist/index-rbna3w6k.js +200 -0
- package/dist/index-rr5hdtcy.js +95 -0
- package/dist/{index-qa9gftnj.js → index-xd2w5pct.js} +3 -3
- package/dist/index-xpdtagqw.js +30 -0
- package/dist/{index-925304r7.js → index-y085rpen.js} +29 -25
- package/dist/index-y5ncb93a.js +240 -0
- package/dist/index-y7d0cth0.js +93 -0
- package/dist/{index-hdxtgckw.js → index-z070caqq.js} +56 -12
- package/dist/index-zdqbp34f.js +14 -0
- package/dist/index.js +38 -36
- package/dist/install-3gw33jcf.js +558 -0
- package/dist/{jmespath-e4a59c8w.js → jmespath-ab6tdc42.js} +1 -1
- package/dist/js-yaml-0c4svjwq.js +36 -0
- package/dist/{mcp-jssaz3wr.js → mcp-s50h6d56.js} +236 -472
- package/dist/{node-strategy-ggx3nmyj.js → node-strategy-p1n8wr5s.js} +16 -19
- package/dist/project-context-285hydnd.js +94 -0
- package/dist/prompt-hxbzt92e.js +13 -0
- package/dist/{server-9k50dfg6.js → server-gkr3c7hv.js} +28 -43
- package/dist/skillCatalog-fvw4wgw1.js +22 -0
- package/dist/skillsService-20es18vs.js +29 -0
- package/dist/{stdio-tmngemcz.js → stdio-kpsab5bz.js} +2 -4
- package/dist/{telemetry-drain-r92f0e4r.js → telemetry-drain-bw59e8f5.js} +8 -9
- package/dist/tree-j4w7p0pg.js +17 -0
- package/dist/updateService-pq7pkd42.js +522 -0
- package/dist/updateService.skills-4t1s7z45.js +22 -0
- package/dist/updateService.tools-f7tr6kc6.js +16 -0
- package/package.json +2 -2
- package/dist/cli-yw4s6t8k.js +0 -19
- package/dist/index-0gctz400.js +0 -17
- package/dist/index-4cq44eth.js +0 -19427
- package/dist/index-7tshyfxx.js +0 -157
- package/dist/index-e3bean3d.js +0 -9867
- package/dist/index-g8ck9tv6.js +0 -2
- package/dist/index-ngs0a2he.js +0 -15
- package/dist/index-yc4kw997.js +0 -13
- package/dist/js-yaml-69tsdrrf.js +0 -37
- package/dist/updateService-22p6d8dm.js +0 -14
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import {
|
|
2
|
+
catchError,
|
|
3
|
+
logger,
|
|
4
|
+
OUTPUT_FORMATS,
|
|
5
|
+
UIPATH_HOME_DIR,
|
|
6
|
+
CONFIG_FILENAME
|
|
7
|
+
} from "./index-9db5vwx9.js";
|
|
8
|
+
import {
|
|
9
|
+
string,
|
|
10
|
+
array,
|
|
11
|
+
object,
|
|
12
|
+
_enum
|
|
13
|
+
} from "./index-bf0e4evz.js";
|
|
14
|
+
|
|
15
|
+
// src/services/channels.ts
|
|
16
|
+
var CHANNELS = ["stable", "preview", "dev"];
|
|
17
|
+
var VALID_CHANNELS = new Set(CHANNELS);
|
|
18
|
+
var HIDDEN_CHANNELS = ["dev"];
|
|
19
|
+
var PUBLIC_CHANNELS = CHANNELS.filter((channel) => !HIDDEN_CHANNELS.includes(channel));
|
|
20
|
+
var CHANNEL_PLACEHOLDER = `<${PUBLIC_CHANNELS.join("|")}>`;
|
|
21
|
+
|
|
22
|
+
// src/config/configLock.ts
|
|
23
|
+
import { randomUUID } from "node:crypto";
|
|
24
|
+
async function withConfigLock(targetPath, fn) {
|
|
25
|
+
const { getFileSystemAsync } = await import("./index-21kns9qg.js");
|
|
26
|
+
const fs = await getFileSystemAsync();
|
|
27
|
+
const dir = fs.path.dirname(targetPath);
|
|
28
|
+
const [mkdirErr] = await catchError(fs.mkdir(dir));
|
|
29
|
+
if (mkdirErr) {
|
|
30
|
+
throw new Error(`Could not create config directory ${dir}: ${mkdirErr.message}`);
|
|
31
|
+
}
|
|
32
|
+
const release = await fs.acquireLock(targetPath);
|
|
33
|
+
try {
|
|
34
|
+
return await fn();
|
|
35
|
+
} finally {
|
|
36
|
+
await catchError(release());
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async function readConfigFileAt(path) {
|
|
40
|
+
const { getFileSystem } = await import("./index-21kns9qg.js");
|
|
41
|
+
const fs = getFileSystem();
|
|
42
|
+
if (!await fs.exists(path)) {
|
|
43
|
+
return {};
|
|
44
|
+
}
|
|
45
|
+
const content = await fs.readFile(path, "utf-8");
|
|
46
|
+
if (content === null) {
|
|
47
|
+
return {};
|
|
48
|
+
}
|
|
49
|
+
const parsed = JSON.parse(content);
|
|
50
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
51
|
+
return {};
|
|
52
|
+
}
|
|
53
|
+
return parsed;
|
|
54
|
+
}
|
|
55
|
+
async function writeConfigFileAt(path, config) {
|
|
56
|
+
const { getFileSystem } = await import("./index-21kns9qg.js");
|
|
57
|
+
const fs = getFileSystem();
|
|
58
|
+
const dir = fs.path.dirname(path);
|
|
59
|
+
await fs.mkdir(dir);
|
|
60
|
+
const tempPath = `${path}.${randomUUID()}.tmp`;
|
|
61
|
+
await fs.writeFile(tempPath, JSON.stringify(config, null, 4));
|
|
62
|
+
const [renameErr] = await catchError(fs.rename(tempPath, path));
|
|
63
|
+
if (renameErr) {
|
|
64
|
+
await catchError(fs.rm(tempPath));
|
|
65
|
+
throw renameErr;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// src/config/loadConfig.ts
|
|
70
|
+
var VERSION_PIN_RE = /^(\d+)\.(\d+)(?:\.(\d+))?$/;
|
|
71
|
+
var ConfigSchema = object({
|
|
72
|
+
core: object({
|
|
73
|
+
output: _enum(OUTPUT_FORMATS).optional(),
|
|
74
|
+
logLevel: _enum(["error", "warn", "info", "debug"]).optional(),
|
|
75
|
+
interactive: _enum(["never", "auto", "always"]).optional(),
|
|
76
|
+
updateChannel: _enum(CHANNELS).optional(),
|
|
77
|
+
version: string().regex(VERSION_PIN_RE, "must be major.minor or major.minor.patch (e.g. 1.2 or 1.2.3)").optional()
|
|
78
|
+
}).optional(),
|
|
79
|
+
auth: object({
|
|
80
|
+
scopes: array(string().min(1)).optional(),
|
|
81
|
+
authority: string().url().optional()
|
|
82
|
+
}).optional()
|
|
83
|
+
});
|
|
84
|
+
var formatZodError = (error) => {
|
|
85
|
+
const issues = error.issues.map((issue) => {
|
|
86
|
+
const path = issue.path.join(".") || "config";
|
|
87
|
+
let message = issue.message;
|
|
88
|
+
if (message.includes("Required")) {
|
|
89
|
+
message = "is required";
|
|
90
|
+
} else if (message.includes("Expected string")) {
|
|
91
|
+
message = "must be a string";
|
|
92
|
+
} else if (message.includes("Invalid url")) {
|
|
93
|
+
message = "must be a valid URL";
|
|
94
|
+
} else if (message.includes("String must contain at least 1 character")) {
|
|
95
|
+
message = "cannot be empty";
|
|
96
|
+
}
|
|
97
|
+
return ` • ${path}: ${message}`;
|
|
98
|
+
});
|
|
99
|
+
return `Configuration validation failed:
|
|
100
|
+
` + issues.join(`
|
|
101
|
+
`) + `
|
|
102
|
+
|
|
103
|
+
Please check your config file and fix the errors above.`;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
class ConfigValidationError extends Error {
|
|
107
|
+
constructor(message) {
|
|
108
|
+
super(message);
|
|
109
|
+
this.name = "ConfigValidationError";
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
var validateConfig = (parsed) => {
|
|
113
|
+
const result = ConfigSchema.safeParse(parsed);
|
|
114
|
+
if (!result.success) {
|
|
115
|
+
throw new ConfigValidationError(formatZodError(result.error));
|
|
116
|
+
}
|
|
117
|
+
return result.data;
|
|
118
|
+
};
|
|
119
|
+
var CREDENTIAL_AUTH_KEYS = ["clientId", "clientSecret"];
|
|
120
|
+
var LEGACY_TOOLS_KEYS = ["registryUrl", "localToolPaths"];
|
|
121
|
+
var CLEANUP_BLOCKS = [
|
|
122
|
+
["auth", CREDENTIAL_AUTH_KEYS],
|
|
123
|
+
["tools", LEGACY_TOOLS_KEYS]
|
|
124
|
+
];
|
|
125
|
+
var hasKeysIn = (parsed, block, keys) => {
|
|
126
|
+
const blockConfig = parsed?.[block];
|
|
127
|
+
return typeof blockConfig === "object" && blockConfig !== null && keys.some((key) => (key in blockConfig));
|
|
128
|
+
};
|
|
129
|
+
var cachedConfig = null;
|
|
130
|
+
var deleteKeysFrom = async (absolutePath, blocks) => {
|
|
131
|
+
await withConfigLock(absolutePath, async () => {
|
|
132
|
+
const fileConfig = await readConfigFileAt(absolutePath);
|
|
133
|
+
const blocksWithKeys = blocks.filter(([block, keys]) => hasKeysIn(fileConfig, block, keys));
|
|
134
|
+
if (blocksWithKeys.length === 0)
|
|
135
|
+
return;
|
|
136
|
+
for (const [block, keys] of blocksWithKeys) {
|
|
137
|
+
const blockConfig = fileConfig[block];
|
|
138
|
+
for (const key of keys)
|
|
139
|
+
delete blockConfig[key];
|
|
140
|
+
if (Object.keys(blockConfig).length === 0)
|
|
141
|
+
delete fileConfig[block];
|
|
142
|
+
}
|
|
143
|
+
await writeConfigFileAt(absolutePath, fileConfig);
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
var cleanUpConfigKeys = async (parsed, absolutePath) => {
|
|
147
|
+
const blocksWithKeys = CLEANUP_BLOCKS.filter(([block, keys]) => hasKeysIn(parsed, block, keys));
|
|
148
|
+
if (blocksWithKeys.length === 0)
|
|
149
|
+
return;
|
|
150
|
+
const [removeErr] = await catchError(deleteKeysFrom(absolutePath, blocksWithKeys));
|
|
151
|
+
if (removeErr) {
|
|
152
|
+
const paths = blocksWithKeys.flatMap(([block, keys]) => keys.map((key) => `${block}.${key}`));
|
|
153
|
+
logger.debug(`Could not remove ${paths.join(" / ")}: ${removeErr.message}`);
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
var getCachedConfig = () => cachedConfig ?? {};
|
|
157
|
+
var getFs = async () => {
|
|
158
|
+
const { getFileSystemAsync } = await import("./index-21kns9qg.js");
|
|
159
|
+
return getFileSystemAsync();
|
|
160
|
+
};
|
|
161
|
+
var LOCAL_CONFIG_REL = `${UIPATH_HOME_DIR}/${CONFIG_FILENAME}`;
|
|
162
|
+
var resolveConfigFilePathAsync = async (explicitPath) => {
|
|
163
|
+
const fs = await getFs();
|
|
164
|
+
if (explicitPath !== undefined) {
|
|
165
|
+
const absolutePath = fs.path.resolve(fs.env.cwd(), explicitPath);
|
|
166
|
+
const fileExists = await fs.exists(absolutePath);
|
|
167
|
+
return {
|
|
168
|
+
absolutePath,
|
|
169
|
+
exists: fileExists,
|
|
170
|
+
source: "explicit",
|
|
171
|
+
errorMessage: fileExists ? undefined : `Config file not found: ${absolutePath}`
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
const homeDir = fs.env.homedir();
|
|
175
|
+
let searchDir = fs.env.cwd();
|
|
176
|
+
while (searchDir !== homeDir) {
|
|
177
|
+
const candidate = fs.path.join(searchDir, LOCAL_CONFIG_REL);
|
|
178
|
+
if (await fs.exists(candidate)) {
|
|
179
|
+
return { absolutePath: candidate, exists: true, source: "local" };
|
|
180
|
+
}
|
|
181
|
+
const parent = fs.path.dirname(searchDir);
|
|
182
|
+
if (parent === searchDir) {
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
searchDir = parent;
|
|
186
|
+
}
|
|
187
|
+
const globalPath = fs.path.join(homeDir, UIPATH_HOME_DIR, CONFIG_FILENAME);
|
|
188
|
+
if (await fs.exists(globalPath)) {
|
|
189
|
+
return { absolutePath: globalPath, exists: true, source: "global" };
|
|
190
|
+
}
|
|
191
|
+
return { absolutePath: undefined, exists: false, source: "none" };
|
|
192
|
+
};
|
|
193
|
+
var loadConfigAsync = async () => {
|
|
194
|
+
if (cachedConfig) {
|
|
195
|
+
return cachedConfig;
|
|
196
|
+
}
|
|
197
|
+
const fs = await getFs();
|
|
198
|
+
const { absolutePath, exists: fileExists } = await resolveConfigFilePathAsync();
|
|
199
|
+
if (!absolutePath || !fileExists) {
|
|
200
|
+
cachedConfig = {};
|
|
201
|
+
return cachedConfig;
|
|
202
|
+
}
|
|
203
|
+
const [readErr, content] = await catchError(fs.readFile(absolutePath, "utf-8"));
|
|
204
|
+
if (readErr) {
|
|
205
|
+
logger.warn(`Failed to load config from ${absolutePath}:`, readErr.message);
|
|
206
|
+
cachedConfig = {};
|
|
207
|
+
return cachedConfig;
|
|
208
|
+
}
|
|
209
|
+
if (content === null) {
|
|
210
|
+
cachedConfig = {};
|
|
211
|
+
return cachedConfig;
|
|
212
|
+
}
|
|
213
|
+
const [parseErr, parsed] = await catchError(Promise.resolve().then(() => JSON.parse(content)));
|
|
214
|
+
if (parseErr) {
|
|
215
|
+
if (parseErr instanceof SyntaxError) {
|
|
216
|
+
throw new Error(`Invalid JSON in config file: ${absolutePath}
|
|
217
|
+
Error: ${parseErr.message}
|
|
218
|
+
|
|
219
|
+
Please ensure your config file contains valid JSON.`);
|
|
220
|
+
}
|
|
221
|
+
throw parseErr;
|
|
222
|
+
}
|
|
223
|
+
await cleanUpConfigKeys(parsed, absolutePath);
|
|
224
|
+
cachedConfig = validateConfig(parsed);
|
|
225
|
+
return cachedConfig;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
// src/services/versionPin.ts
|
|
229
|
+
function isValidVersionPin(raw) {
|
|
230
|
+
return VERSION_PIN_RE.test(raw.trim());
|
|
231
|
+
}
|
|
232
|
+
function parseVersionPin(raw) {
|
|
233
|
+
if (raw === undefined)
|
|
234
|
+
return null;
|
|
235
|
+
const match = VERSION_PIN_RE.exec(raw.trim());
|
|
236
|
+
if (!match)
|
|
237
|
+
return null;
|
|
238
|
+
const pin = {
|
|
239
|
+
major: Number(match[1]),
|
|
240
|
+
minor: Number(match[2])
|
|
241
|
+
};
|
|
242
|
+
if (match[3] !== undefined)
|
|
243
|
+
pin.patch = Number(match[3]);
|
|
244
|
+
return pin;
|
|
245
|
+
}
|
|
246
|
+
function majorOf(version) {
|
|
247
|
+
const [rawMajor] = version.trim().split(/[.\-+]/);
|
|
248
|
+
if (rawMajor === undefined || !/^\d+$/.test(rawMajor))
|
|
249
|
+
return null;
|
|
250
|
+
return Number(rawMajor);
|
|
251
|
+
}
|
|
252
|
+
function resolvePinnedVersion() {
|
|
253
|
+
return parseVersionPin(getCachedConfig().core?.version);
|
|
254
|
+
}
|
|
255
|
+
function isExactPin(pin) {
|
|
256
|
+
return pin.patch !== undefined;
|
|
257
|
+
}
|
|
258
|
+
function pinnedPrefix(pin) {
|
|
259
|
+
return `${pin.major}.${pin.minor}.`;
|
|
260
|
+
}
|
|
261
|
+
function versionLinePrefix(version) {
|
|
262
|
+
const [major, minor] = version.split(".");
|
|
263
|
+
return `${major}.${minor}.`;
|
|
264
|
+
}
|
|
265
|
+
function formatVersionPin(pin) {
|
|
266
|
+
return isExactPin(pin) ? `${pin.major}.${pin.minor}.${pin.patch}` : `${pin.major}.${pin.minor}`;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export { VALID_CHANNELS, HIDDEN_CHANNELS, PUBLIC_CHANNELS, CHANNEL_PLACEHOLDER, withConfigLock, readConfigFileAt, writeConfigFileAt, getCachedConfig, resolveConfigFilePathAsync, loadConfigAsync, isValidVersionPin, majorOf, resolvePinnedVersion, isExactPin, pinnedPrefix, versionLinePrefix, formatVersionPin };
|
|
270
|
+
|
|
271
|
+
//# debugId=80E9FBD5B9D5F2D564756E2164756E21
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {
|
|
2
|
+
logger
|
|
3
|
+
} from "./index-9db5vwx9.js";
|
|
4
|
+
|
|
5
|
+
// src/system-ca.ts
|
|
6
|
+
function installSystemCaTrust(tlsModule) {
|
|
7
|
+
const getCertificates = tlsModule.getCACertificates;
|
|
8
|
+
const setDefaultCertificates = tlsModule.setDefaultCACertificates;
|
|
9
|
+
if (typeof getCertificates !== "function" || typeof setDefaultCertificates !== "function") {
|
|
10
|
+
return "unsupported";
|
|
11
|
+
}
|
|
12
|
+
try {
|
|
13
|
+
const system = getCertificates.call(tlsModule, "system");
|
|
14
|
+
if (!Array.isArray(system) || system.length === 0) {
|
|
15
|
+
return "empty";
|
|
16
|
+
}
|
|
17
|
+
const current = getCertificates.call(tlsModule, "default") ?? [];
|
|
18
|
+
setDefaultCertificates.call(tlsModule, [...current, ...system]);
|
|
19
|
+
return "applied";
|
|
20
|
+
} catch {
|
|
21
|
+
return "error";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
var loadNodeTls = async () => await import("node:tls");
|
|
25
|
+
var cachedResult = "deferred";
|
|
26
|
+
var inFlight;
|
|
27
|
+
async function ensureSystemCaTrustAsync(loadTls = loadNodeTls) {
|
|
28
|
+
if (cachedResult !== "deferred") {
|
|
29
|
+
return cachedResult;
|
|
30
|
+
}
|
|
31
|
+
inFlight ??= (async () => {
|
|
32
|
+
cachedResult = installSystemCaTrust(await loadTls());
|
|
33
|
+
logger.debug(`OS certificate-store trust: ${cachedResult}`);
|
|
34
|
+
return cachedResult;
|
|
35
|
+
})();
|
|
36
|
+
return inFlight;
|
|
37
|
+
}
|
|
38
|
+
var NODE_USE_SYSTEM_CA_ENV = "NODE_USE_SYSTEM_CA";
|
|
39
|
+
function withSystemCaEnv(env = process.env) {
|
|
40
|
+
const alreadySet = Object.keys(env).some((key) => process.platform === "win32" ? key.toUpperCase() === NODE_USE_SYSTEM_CA_ENV : key === NODE_USE_SYSTEM_CA_ENV);
|
|
41
|
+
return alreadySet ? env : { ...env, [NODE_USE_SYSTEM_CA_ENV]: "1" };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// src/services/childEnv.ts
|
|
45
|
+
function mergeEnvCaseInsensitive(base, overrides) {
|
|
46
|
+
const overridden = new Set(Object.keys(overrides).map((key) => key.toLowerCase()));
|
|
47
|
+
const merged = {};
|
|
48
|
+
for (const [key, value] of Object.entries(base)) {
|
|
49
|
+
if (!overridden.has(key.toLowerCase()))
|
|
50
|
+
merged[key] = value;
|
|
51
|
+
}
|
|
52
|
+
return { ...merged, ...overrides };
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// src/services/registryTls.ts
|
|
56
|
+
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.";
|
|
57
|
+
var TLS_TRUST_CODES = new Set([
|
|
58
|
+
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
59
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
60
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
61
|
+
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
62
|
+
"UNABLE_TO_GET_ISSUER_CERT",
|
|
63
|
+
"CERT_UNTRUSTED"
|
|
64
|
+
]);
|
|
65
|
+
var NPM_FETCH_RETRY_ENV = {
|
|
66
|
+
npm_config_fetch_retries: "2",
|
|
67
|
+
npm_config_fetch_retry_mintimeout: "2000",
|
|
68
|
+
npm_config_fetch_retry_maxtimeout: "8000"
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
class RegistryTlsError extends Error {
|
|
72
|
+
code;
|
|
73
|
+
instructions = REGISTRY_TLS_INSTRUCTIONS;
|
|
74
|
+
constructor(context, code) {
|
|
75
|
+
super(`${context}: the registry's TLS certificate is not trusted (${code})`);
|
|
76
|
+
this.code = code;
|
|
77
|
+
this.name = "RegistryTlsError";
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function isRegistryTlsError(error) {
|
|
81
|
+
return error instanceof Error && error.name === "RegistryTlsError" && typeof error.code === "string";
|
|
82
|
+
}
|
|
83
|
+
function npmTlsErrorCode(stderr, stdout) {
|
|
84
|
+
const pattern = /(?:npm (?:error|ERR!) code |"code":\s*")([A-Z0-9_]+)/g;
|
|
85
|
+
for (const match of `${stderr}
|
|
86
|
+
${stdout}`.matchAll(pattern)) {
|
|
87
|
+
if (TLS_TRUST_CODES.has(match[1]))
|
|
88
|
+
return match[1];
|
|
89
|
+
}
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export { ensureSystemCaTrustAsync, withSystemCaEnv, mergeEnvCaseInsensitive, REGISTRY_TLS_INSTRUCTIONS, NPM_FETCH_RETRY_ENV, RegistryTlsError, isRegistryTlsError, npmTlsErrorCode };
|
|
94
|
+
|
|
95
|
+
//# debugId=07F73CD766A13C9164756E2164756E21
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getFileSystem2
|
|
3
|
+
} from "./index-z070caqq.js";
|
|
4
|
+
import {
|
|
5
|
+
catchError
|
|
6
|
+
} from "./index-9db5vwx9.js";
|
|
7
|
+
import {
|
|
8
|
+
resolveSkillSource2,
|
|
9
|
+
fetchSkillsTo2,
|
|
10
|
+
getContentStore2,
|
|
11
|
+
getAvailableSkills2,
|
|
12
|
+
MANIFEST_NAME2,
|
|
13
|
+
readManifest2
|
|
14
|
+
} from "./index-cc653qc1.js";
|
|
15
|
+
import {
|
|
16
|
+
ALL_AGENTS
|
|
17
|
+
} from "./index-898c4tfz.js";
|
|
18
|
+
import {
|
|
19
|
+
SkillsError2,
|
|
20
|
+
runAgentInstalls2,
|
|
21
|
+
cleanupStaleSkills2
|
|
22
|
+
} from "./index-8gr7ny79.js";
|
|
23
|
+
import {
|
|
24
|
+
getSkillsSourceFailureDetails
|
|
25
|
+
} from "./index-6wj58qka.js";
|
|
26
|
+
|
|
27
|
+
// src/services/updateService.skills.ts
|
|
28
|
+
import { randomUUID } from "node:crypto";
|
|
29
|
+
async function runSkillsUpdate2(opts) {
|
|
30
|
+
const fs = getFileSystem2();
|
|
31
|
+
const source = resolveSkillSource2(opts.repo, opts.branch);
|
|
32
|
+
const explicitPath = opts.path?.trim();
|
|
33
|
+
const resolvedPath = explicitPath ? fs.path.resolve(explicitPath) : undefined;
|
|
34
|
+
if (opts.agent !== undefined) {
|
|
35
|
+
const a = opts.agent.trim().toLowerCase();
|
|
36
|
+
if (!ALL_AGENTS.includes(a)) {
|
|
37
|
+
const scope = resolvedPath || opts.local === true ? "local" : "global";
|
|
38
|
+
const rootDir = resolvedPath ?? (scope === "local" ? fs.env.cwd() : fs.env.homedir());
|
|
39
|
+
return {
|
|
40
|
+
sections: [
|
|
41
|
+
{
|
|
42
|
+
rootDir,
|
|
43
|
+
scope,
|
|
44
|
+
agents: [],
|
|
45
|
+
skills: [],
|
|
46
|
+
added: [],
|
|
47
|
+
removed: [],
|
|
48
|
+
refreshed: 0,
|
|
49
|
+
error: {
|
|
50
|
+
result: "ValidationError",
|
|
51
|
+
message: `Unknown agent: ${a}`,
|
|
52
|
+
instructions: `Available agents: ${ALL_AGENTS.join(", ")}`
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (resolvedPath) {
|
|
60
|
+
const stat = await fs.stat(resolvedPath);
|
|
61
|
+
if (!stat?.isDirectory()) {
|
|
62
|
+
return {
|
|
63
|
+
sections: [
|
|
64
|
+
{
|
|
65
|
+
rootDir: resolvedPath,
|
|
66
|
+
scope: "local",
|
|
67
|
+
agents: [],
|
|
68
|
+
skills: [],
|
|
69
|
+
added: [],
|
|
70
|
+
removed: [],
|
|
71
|
+
refreshed: 0,
|
|
72
|
+
error: {
|
|
73
|
+
result: "ValidationError",
|
|
74
|
+
message: `Path does not exist or is not a directory: ${resolvedPath}`,
|
|
75
|
+
instructions: "Pass --path pointing to an existing project directory."
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const candidates = [];
|
|
83
|
+
if (resolvedPath) {
|
|
84
|
+
candidates.push({ rootDir: resolvedPath, scope: "local" });
|
|
85
|
+
} else {
|
|
86
|
+
if (opts.local !== true) {
|
|
87
|
+
candidates.push({ rootDir: fs.env.homedir(), scope: "global" });
|
|
88
|
+
}
|
|
89
|
+
if (opts.local !== false) {
|
|
90
|
+
candidates.push({ rootDir: fs.env.cwd(), scope: "local" });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const sections = [];
|
|
94
|
+
for (const candidate of candidates) {
|
|
95
|
+
const manifestPath = fs.path.join(candidate.rootDir, source.storeName, MANIFEST_NAME2);
|
|
96
|
+
const hasManifest = await fs.exists(manifestPath);
|
|
97
|
+
if (!resolvedPath && opts.local === undefined && !hasManifest)
|
|
98
|
+
continue;
|
|
99
|
+
const [sectionErr, section] = await catchError(updateOneSection(opts, candidate, source));
|
|
100
|
+
if (sectionErr) {
|
|
101
|
+
const skillsErr = sectionErr instanceof SkillsError2 ? sectionErr : null;
|
|
102
|
+
const instructions = skillsErr?.instructions ?? getSkillsSourceFailureDetails(sectionErr).instructions;
|
|
103
|
+
sections.push({
|
|
104
|
+
rootDir: candidate.rootDir,
|
|
105
|
+
scope: candidate.scope,
|
|
106
|
+
agents: [],
|
|
107
|
+
skills: [],
|
|
108
|
+
added: [],
|
|
109
|
+
removed: [],
|
|
110
|
+
refreshed: 0,
|
|
111
|
+
error: {
|
|
112
|
+
result: skillsErr?.result ?? "Failure",
|
|
113
|
+
message: sectionErr.message,
|
|
114
|
+
instructions
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
if (section)
|
|
120
|
+
sections.push(section);
|
|
121
|
+
}
|
|
122
|
+
return { sections };
|
|
123
|
+
}
|
|
124
|
+
async function updateOneSection(opts, candidate, source) {
|
|
125
|
+
const fs = getFileSystem2();
|
|
126
|
+
const isLocal = candidate.scope === "local";
|
|
127
|
+
const previousManifest = await readManifest2(fs.path.join(candidate.rootDir, source.storeName));
|
|
128
|
+
const previousSkills = Object.keys(previousManifest.skills);
|
|
129
|
+
let agents;
|
|
130
|
+
if (opts.agent) {
|
|
131
|
+
const a = opts.agent.trim().toLowerCase();
|
|
132
|
+
if (!ALL_AGENTS.includes(a)) {
|
|
133
|
+
throw new SkillsError2(`Unknown agent: ${a}`, `Available agents: ${ALL_AGENTS.join(", ")}`, "ValidationError");
|
|
134
|
+
}
|
|
135
|
+
agents = [a];
|
|
136
|
+
} else {
|
|
137
|
+
const fromManifest = new Set;
|
|
138
|
+
for (const entry of Object.values(previousManifest.skills)) {
|
|
139
|
+
for (const a of entry.agents) {
|
|
140
|
+
if (ALL_AGENTS.includes(a)) {
|
|
141
|
+
fromManifest.add(a);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
agents = [...fromManifest];
|
|
146
|
+
if (agents.length === 0) {
|
|
147
|
+
throw new SkillsError2(`No agents recorded in manifest at ${candidate.rootDir}; pass --agent explicitly.`, `Run 'uip skills install --agent <agent>' first, or pass --agent. Available agents: ${ALL_AGENTS.join(", ")}.`, "ConfigError");
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (opts.dryRun) {
|
|
151
|
+
const tmpRoot = fs.path.join(fs.env.tmpdir(), `uipath-skills-dryrun-${randomUUID()}`);
|
|
152
|
+
try {
|
|
153
|
+
await fs.mkdir(tmpRoot);
|
|
154
|
+
const tmpStore = fs.path.join(tmpRoot, "store");
|
|
155
|
+
await fetchSkillsTo2(tmpStore, tmpRoot, source, opts.targetVersion);
|
|
156
|
+
const remoteSkills = await getAvailableSkills2(tmpStore);
|
|
157
|
+
const remoteNames = remoteSkills.map((s) => s.name);
|
|
158
|
+
return {
|
|
159
|
+
rootDir: candidate.rootDir,
|
|
160
|
+
scope: candidate.scope,
|
|
161
|
+
agents,
|
|
162
|
+
skills: remoteNames,
|
|
163
|
+
added: remoteNames.filter((n) => !previousSkills.includes(n)),
|
|
164
|
+
removed: previousSkills.filter((n) => !remoteNames.includes(n)),
|
|
165
|
+
refreshed: 0
|
|
166
|
+
};
|
|
167
|
+
} finally {
|
|
168
|
+
await catchError(fs.rm(tmpRoot));
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
const storePath = await getContentStore2(candidate.rootDir, source, opts.targetVersion);
|
|
172
|
+
const availableSkills = await getAvailableSkills2(storePath);
|
|
173
|
+
const availableNames = availableSkills.map((s) => s.name);
|
|
174
|
+
const added = availableNames.filter((n) => !previousSkills.includes(n));
|
|
175
|
+
const removed = previousSkills.filter((n) => !availableNames.includes(n));
|
|
176
|
+
const resolved = {
|
|
177
|
+
rootDir: candidate.rootDir,
|
|
178
|
+
storePath,
|
|
179
|
+
selectedSkills: availableSkills,
|
|
180
|
+
agents,
|
|
181
|
+
isLocal,
|
|
182
|
+
source,
|
|
183
|
+
force: opts.force
|
|
184
|
+
};
|
|
185
|
+
const { installed } = await runAgentInstalls2(resolved, "update");
|
|
186
|
+
await cleanupStaleSkills2(resolved);
|
|
187
|
+
return {
|
|
188
|
+
rootDir: candidate.rootDir,
|
|
189
|
+
scope: candidate.scope,
|
|
190
|
+
agents,
|
|
191
|
+
skills: availableNames,
|
|
192
|
+
added,
|
|
193
|
+
removed,
|
|
194
|
+
refreshed: installed.length
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export { runSkillsUpdate2 };
|
|
199
|
+
|
|
200
|
+
//# debugId=88AF4A5DB1FF04D064756E2164756E21
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {
|
|
2
|
+
dist_default4
|
|
3
|
+
} from "./index-5j0bfd3e.js";
|
|
4
|
+
import {
|
|
5
|
+
isBrowser2
|
|
6
|
+
} from "./index-zdqbp34f.js";
|
|
7
|
+
|
|
8
|
+
// src/services/promptSelect.ts
|
|
9
|
+
var promptSelect = async (options, message) => {
|
|
10
|
+
try {
|
|
11
|
+
return await dist_default4({
|
|
12
|
+
message,
|
|
13
|
+
choices: options.map((name, value) => ({ name, value }))
|
|
14
|
+
});
|
|
15
|
+
} catch (error) {
|
|
16
|
+
if (error instanceof Error && error.name === "ExitPromptError") {
|
|
17
|
+
const cancellation = Object.assign(new Error("Selection cancelled by user"), {
|
|
18
|
+
exitCode: 130,
|
|
19
|
+
terminalSignal: "SIGINT"
|
|
20
|
+
});
|
|
21
|
+
cancellation.name = "ExitPromptError";
|
|
22
|
+
throw cancellation;
|
|
23
|
+
}
|
|
24
|
+
throw error;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// src/services/auth.ts
|
|
29
|
+
class NodeAuth {
|
|
30
|
+
async interactiveLogin(options) {
|
|
31
|
+
const { interactiveLogin } = await import("./index-y7d0cth0.js");
|
|
32
|
+
return await interactiveLogin({
|
|
33
|
+
...options,
|
|
34
|
+
selectFromList: promptSelect
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
async clientCredentialsLogin(options) {
|
|
38
|
+
const { clientCredentialsLogin } = await import("./index-y7d0cth0.js");
|
|
39
|
+
return await clientCredentialsLogin(options);
|
|
40
|
+
}
|
|
41
|
+
async getLoginStatus(options) {
|
|
42
|
+
const { getLoginStatusAsync } = await import("./index-y7d0cth0.js");
|
|
43
|
+
return getLoginStatusAsync(options);
|
|
44
|
+
}
|
|
45
|
+
async fetchTenants(baseUrl, accessToken, organizationId) {
|
|
46
|
+
const { fetchTenantsAndOrganizations } = await import("./index-y7d0cth0.js");
|
|
47
|
+
return fetchTenantsAndOrganizations(baseUrl, accessToken, organizationId);
|
|
48
|
+
}
|
|
49
|
+
async saveTenantSelection(envFilePath, tenantName, tenantId) {
|
|
50
|
+
const { saveEnvFileAsync } = await import("./index-y7d0cth0.js");
|
|
51
|
+
await saveEnvFileAsync({
|
|
52
|
+
envPath: envFilePath,
|
|
53
|
+
data: {
|
|
54
|
+
UIPATH_TENANT_NAME: tenantName,
|
|
55
|
+
UIPATH_TENANT_ID: tenantId
|
|
56
|
+
},
|
|
57
|
+
merge: true
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
class BrowserAuth {
|
|
63
|
+
async interactiveLogin(options) {
|
|
64
|
+
const { interactiveLogin } = await import("./index-y7d0cth0.js");
|
|
65
|
+
return await interactiveLogin(options);
|
|
66
|
+
}
|
|
67
|
+
async clientCredentialsLogin(options) {
|
|
68
|
+
const { clientCredentialsLogin } = await import("./index-y7d0cth0.js");
|
|
69
|
+
return await clientCredentialsLogin(options);
|
|
70
|
+
}
|
|
71
|
+
async getLoginStatus(options) {
|
|
72
|
+
const { getLoginStatusAsync } = await import("./index-y7d0cth0.js");
|
|
73
|
+
return getLoginStatusAsync(options);
|
|
74
|
+
}
|
|
75
|
+
async fetchTenants(baseUrl, accessToken, organizationId) {
|
|
76
|
+
const { fetchTenantsAndOrganizations } = await import("./index-y7d0cth0.js");
|
|
77
|
+
return fetchTenantsAndOrganizations(baseUrl, accessToken, organizationId);
|
|
78
|
+
}
|
|
79
|
+
async saveTenantSelection(envFilePath, tenantName, tenantId) {
|
|
80
|
+
const { saveEnvFileAsync } = await import("./index-y7d0cth0.js");
|
|
81
|
+
await saveEnvFileAsync({
|
|
82
|
+
envPath: envFilePath,
|
|
83
|
+
data: {
|
|
84
|
+
UIPATH_TENANT_NAME: tenantName,
|
|
85
|
+
UIPATH_TENANT_ID: tenantId
|
|
86
|
+
},
|
|
87
|
+
merge: true
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
var auth = isBrowser2() ? new BrowserAuth : new NodeAuth;
|
|
92
|
+
|
|
93
|
+
export { auth };
|
|
94
|
+
|
|
95
|
+
//# debugId=3AC60F438922B2DA64756E2164756E21
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
function isPromiseLike(value) {
|
|
3
3
|
return value !== null && typeof value === "object" && typeof value.then === "function";
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function catchError2(fnOrPromise) {
|
|
6
6
|
if (isPromiseLike(fnOrPromise)) {
|
|
7
7
|
return settlePromiseLike(fnOrPromise);
|
|
8
8
|
}
|
|
@@ -26,6 +26,6 @@ function settlePromiseLike(thenable) {
|
|
|
26
26
|
]);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
export {
|
|
29
|
+
export { catchError2 };
|
|
30
30
|
|
|
31
|
-
//# debugId=
|
|
31
|
+
//# debugId=5BBFFF71F3FAF6A164756E2164756E21
|