@uipath/rpa-tool 1.199.1 → 1.200.0
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/executor-tool.js +27499 -0
- package/dist/packager-tool.js +12031 -27209
- package/dist/tool.js +1256 -378
- package/package.json +13 -10
package/dist/tool.js
CHANGED
|
@@ -18503,7 +18503,7 @@ import process43 from "node:process";
|
|
|
18503
18503
|
import { execFile as execFile33 } from "node:child_process";
|
|
18504
18504
|
import process53 from "node:process";
|
|
18505
18505
|
import { promisify as promisify43 } from "node:util";
|
|
18506
|
-
import { execFile as execFile43, execFileSync as
|
|
18506
|
+
import { execFile as execFile43, execFileSync as execFileSync7 } from "node:child_process";
|
|
18507
18507
|
import { promisify as promisify53 } from "node:util";
|
|
18508
18508
|
import { execFile as execFile53 } from "node:child_process";
|
|
18509
18509
|
import process73 from "node:process";
|
|
@@ -19319,7 +19319,7 @@ import process44 from "node:process";
|
|
|
19319
19319
|
import { execFile as execFile34 } from "node:child_process";
|
|
19320
19320
|
import process54 from "node:process";
|
|
19321
19321
|
import { promisify as promisify44 } from "node:util";
|
|
19322
|
-
import { execFile as execFile44, execFileSync as
|
|
19322
|
+
import { execFile as execFile44, execFileSync as execFileSync8 } from "node:child_process";
|
|
19323
19323
|
import { promisify as promisify54 } from "node:util";
|
|
19324
19324
|
import { execFile as execFile54 } from "node:child_process";
|
|
19325
19325
|
import process74 from "node:process";
|
|
@@ -32272,7 +32272,7 @@ function withTrailingSeparator(p) {
|
|
|
32272
32272
|
}
|
|
32273
32273
|
|
|
32274
32274
|
// src/tool.ts
|
|
32275
|
-
import { resolve as
|
|
32275
|
+
import { resolve as resolve14 } from "node:path";
|
|
32276
32276
|
|
|
32277
32277
|
// node_modules/@uipath/common/dist/index.js
|
|
32278
32278
|
import { createRequire as createRequire2 } from "node:module";
|
|
@@ -40614,6 +40614,9 @@ var filterSlot = singleton("OutputFilter");
|
|
|
40614
40614
|
function getOutputFormat() {
|
|
40615
40615
|
return formatSlot.get("json");
|
|
40616
40616
|
}
|
|
40617
|
+
function getOutputFormatExplicit() {
|
|
40618
|
+
return formatExplicitSlot.get(false) ?? false;
|
|
40619
|
+
}
|
|
40617
40620
|
function getOutputFilter() {
|
|
40618
40621
|
return filterSlot.get();
|
|
40619
40622
|
}
|
|
@@ -42404,7 +42407,7 @@ var {
|
|
|
42404
42407
|
// package.json
|
|
42405
42408
|
var package_default = {
|
|
42406
42409
|
name: "@uipath/rpa-tool",
|
|
42407
|
-
version: "1.
|
|
42410
|
+
version: "1.200.0",
|
|
42408
42411
|
description: "Tool for creating and managing UiPath RPA projects",
|
|
42409
42412
|
keywords: [
|
|
42410
42413
|
"uipcli-tool",
|
|
@@ -42414,7 +42417,9 @@ var package_default = {
|
|
|
42414
42417
|
type: "module",
|
|
42415
42418
|
main: "./dist/tool.js",
|
|
42416
42419
|
exports: {
|
|
42417
|
-
".": "./dist/tool.js"
|
|
42420
|
+
".": "./dist/tool.js",
|
|
42421
|
+
"./packager-tool": "./dist/packager-tool.js",
|
|
42422
|
+
"./executor-tool": "./dist/executor-tool.js"
|
|
42418
42423
|
},
|
|
42419
42424
|
private: false,
|
|
42420
42425
|
maintainers: [
|
|
@@ -42437,7 +42442,7 @@ var package_default = {
|
|
|
42437
42442
|
registry: "https://npm.pkg.github.com"
|
|
42438
42443
|
},
|
|
42439
42444
|
scripts: {
|
|
42440
|
-
build: "bunx tsc --noEmit && bun build ./src/packager-tool.ts --outdir dist --format esm --target node --external applicationinsights && bun build ./src/tool.ts --outdir dist --format esm --target node --external '*/packager-tool.js' --external applicationinsights && bun build ./src/index.ts --outdir dist --format esm --target node --external '*/tool.js' --external applicationinsights",
|
|
42445
|
+
build: "bunx tsc --noEmit && bun build ./src/packager-tool.ts --outdir dist --format esm --target node --external applicationinsights && bun build ./src/executor-tool.ts --outdir dist --format esm --target node --external applicationinsights && bun build ./src/tool.ts --outdir dist --format esm --target node --external '*/packager-tool.js' --external applicationinsights && bun build ./src/index.ts --outdir dist --format esm --target node --external '*/tool.js' --external applicationinsights",
|
|
42441
42446
|
package: "bun run build && bun pm pack",
|
|
42442
42447
|
"generate-docs": "bun run scripts/generate-docs.ts",
|
|
42443
42448
|
"bump-uipath-alpha": "bun run scripts/bump-uipath-alpha.ts",
|
|
@@ -42452,9 +42457,10 @@ var package_default = {
|
|
|
42452
42457
|
"@types/node": "^25.6.0",
|
|
42453
42458
|
"@uipath/auth": "1.200.0-preview.118",
|
|
42454
42459
|
"@uipath/common": "1.200.0-preview.118",
|
|
42455
|
-
"@uipath/coreipc": "2.5.
|
|
42460
|
+
"@uipath/coreipc": "2.5.2",
|
|
42456
42461
|
"@uipath/filesystem": "1.200.0-preview.118",
|
|
42457
42462
|
"@uipath/packager-tool-workflowcompiler": "1.200.0-preview.118",
|
|
42463
|
+
"@uipath/project-executor": "1.200.0-preview.118",
|
|
42458
42464
|
"@uipath/project-packager": "1.200.0-preview.118",
|
|
42459
42465
|
"@uipath/solution-sdk": "1.200.0-preview.118",
|
|
42460
42466
|
"@uipath/solutionpackager-tool-core": "1.200.0-preview.118",
|
|
@@ -42683,7 +42689,7 @@ var registerListInstancesCommand = (program3) => {
|
|
|
42683
42689
|
};
|
|
42684
42690
|
|
|
42685
42691
|
// src/commands/packager/analyze.ts
|
|
42686
|
-
import { isAbsolute as isAbsolute6, join as
|
|
42692
|
+
import { isAbsolute as isAbsolute6, join as join14 } from "node:path";
|
|
42687
42693
|
|
|
42688
42694
|
// src/telemetry/studio-shaped-props.ts
|
|
42689
42695
|
import { readFileSync } from "node:fs";
|
|
@@ -42935,7 +42941,7 @@ import {
|
|
|
42935
42941
|
basename as basename6,
|
|
42936
42942
|
dirname as dirname6,
|
|
42937
42943
|
isAbsolute as isAbsolute5,
|
|
42938
|
-
join as
|
|
42944
|
+
join as join13,
|
|
42939
42945
|
relative as relative5,
|
|
42940
42946
|
resolve as resolve6
|
|
42941
42947
|
} from "node:path";
|
|
@@ -42949,7 +42955,8 @@ async function loadPackagerTool() {
|
|
|
42949
42955
|
_warn(...args);
|
|
42950
42956
|
};
|
|
42951
42957
|
try {
|
|
42952
|
-
await import("./packager-tool.js");
|
|
42958
|
+
const { registerPackagerFactories } = await import("./packager-tool.js");
|
|
42959
|
+
registerPackagerFactories();
|
|
42953
42960
|
} catch {} finally {
|
|
42954
42961
|
console.warn = _warn;
|
|
42955
42962
|
}
|
|
@@ -43021,10 +43028,222 @@ function writeFeedsFile(feeds) {
|
|
|
43021
43028
|
}
|
|
43022
43029
|
|
|
43023
43030
|
// src/resolution/robot-bin-resolver.ts
|
|
43024
|
-
import { join as
|
|
43031
|
+
import { join as join8, posix, win32 } from "node:path";
|
|
43032
|
+
|
|
43033
|
+
// src/resolution/paths.ts
|
|
43034
|
+
import { join as join7, normalize } from "node:path";
|
|
43035
|
+
var DEFAULT_TIMEOUT_MS2 = 60000;
|
|
43036
|
+
var POLL_INTERVAL_MS = 1000;
|
|
43037
|
+
var INTEROP_MANIFEST = "interop-manifest.json";
|
|
43038
|
+
var STUDIO_EXE = "UiPath.Studio.exe";
|
|
43039
|
+
var STUDIO_SUBDIR = "Studio";
|
|
43040
|
+
var ROBOT_SUBDIR = "Robot";
|
|
43041
|
+
var HELM_EXE = process.platform === "win32" ? "UiPath.Studio.Helm.exe" : "UiPath.Studio.Helm";
|
|
43042
|
+
function normalizePath(path4) {
|
|
43043
|
+
return normalize(path4).replace(/[\\/]+$/, "").toLowerCase();
|
|
43044
|
+
}
|
|
43045
|
+
|
|
43046
|
+
// src/resolution/robot-bin-resolver.ts
|
|
43047
|
+
var LOCAL_ROBOT_FEEDS_ENV = "UIPATH_LOCAL_ROBOT_FEEDS";
|
|
43048
|
+
function robotNugetConfigPath(robotDir) {
|
|
43049
|
+
return join8(robotDir, "NuGet.config");
|
|
43050
|
+
}
|
|
43051
|
+
var ROBOT_WINDOWS_MARKER = "UiRobot.exe";
|
|
43052
|
+
var ROBOT_MACOS_MARKER = "UiRobot.dll";
|
|
43053
|
+
var MACOS_ASSISTANT_ROBOT_PATH = "/Applications/UiPath Assistant.app/Contents/Robot";
|
|
43054
|
+
var REGISTRY_HIVES = [
|
|
43055
|
+
"HKCU\\Software\\UiPath\\UiPath Studio",
|
|
43056
|
+
"HKLM\\Software\\UiPath\\UiPath Studio"
|
|
43057
|
+
];
|
|
43058
|
+
function queryRegistryValue(valueName, deps) {
|
|
43059
|
+
for (const hive of REGISTRY_HIVES) {
|
|
43060
|
+
try {
|
|
43061
|
+
const output = deps.executeCommand("reg", [
|
|
43062
|
+
"query",
|
|
43063
|
+
hive,
|
|
43064
|
+
"/v",
|
|
43065
|
+
valueName
|
|
43066
|
+
]);
|
|
43067
|
+
const match = output.match(new RegExp(`${valueName}\\s+REG_SZ\\s+(.+)`));
|
|
43068
|
+
if (match)
|
|
43069
|
+
return match[1].trim();
|
|
43070
|
+
} catch {}
|
|
43071
|
+
}
|
|
43072
|
+
return;
|
|
43073
|
+
}
|
|
43074
|
+
function resolveRobotComponentDir(installRoot, deps) {
|
|
43075
|
+
const nested = win32.join(installRoot, ROBOT_SUBDIR);
|
|
43076
|
+
return deps.fileExists(win32.join(nested, ROBOT_WINDOWS_MARKER)) ? nested : installRoot;
|
|
43077
|
+
}
|
|
43078
|
+
function resolveRobotDir(cliPath, deps) {
|
|
43079
|
+
if (cliPath) {
|
|
43080
|
+
deps.log(`Using --robot-dir: ${cliPath}`);
|
|
43081
|
+
return cliPath;
|
|
43082
|
+
}
|
|
43083
|
+
const envPath = process.env.UIPATH_ROBOT_DIR;
|
|
43084
|
+
if (envPath) {
|
|
43085
|
+
deps.log(`Using UIPATH_ROBOT_DIR: ${envPath}`);
|
|
43086
|
+
return envPath;
|
|
43087
|
+
}
|
|
43088
|
+
if (process.platform === "win32") {
|
|
43089
|
+
const robotDir = queryRegistryValue("RobotDir", deps);
|
|
43090
|
+
if (robotDir) {
|
|
43091
|
+
deps.log(`Resolved robot dir from registry: ${robotDir}`);
|
|
43092
|
+
return robotDir;
|
|
43093
|
+
}
|
|
43094
|
+
const installRoot = queryRegistryValue("InstallDir", deps);
|
|
43095
|
+
if (installRoot) {
|
|
43096
|
+
const dir = resolveRobotComponentDir(installRoot, deps);
|
|
43097
|
+
deps.log(`Resolved robot dir from registry: ${dir}`);
|
|
43098
|
+
return dir;
|
|
43099
|
+
}
|
|
43100
|
+
}
|
|
43101
|
+
if (process.platform === "darwin") {
|
|
43102
|
+
if (deps.fileExists(posix.join(MACOS_ASSISTANT_ROBOT_PATH, ROBOT_MACOS_MARKER))) {
|
|
43103
|
+
deps.log(`Found robot at well-known path: ${MACOS_ASSISTANT_ROBOT_PATH}`);
|
|
43104
|
+
return MACOS_ASSISTANT_ROBOT_PATH;
|
|
43105
|
+
}
|
|
43106
|
+
}
|
|
43107
|
+
deps.log("Robot dir not resolved — Robot must already be running");
|
|
43108
|
+
return null;
|
|
43109
|
+
}
|
|
43110
|
+
var DOTNET_ROLL_FORWARD_ENV = {
|
|
43111
|
+
DOTNET_ROLL_FORWARD: "Major"
|
|
43112
|
+
};
|
|
43113
|
+
var MIN_BUNDLED_DOTNET_MAJOR = 8;
|
|
43114
|
+
var DOTNET_ROOT_ENV = "UIPATH_DOTNET_ROOT";
|
|
43115
|
+
var RUNTIMES_SUBDIR = "Runtimes";
|
|
43116
|
+
var dotnetExeName = () => process.platform === "win32" ? "dotnet.exe" : "dotnet";
|
|
43117
|
+
var layoutPath = () => process.platform === "win32" ? win32 : posix;
|
|
43118
|
+
function detectDotnetRuntimeMajor(dotnetRoot, deps) {
|
|
43119
|
+
let entries;
|
|
43120
|
+
try {
|
|
43121
|
+
entries = deps.readDir(layoutPath().join(dotnetRoot, "shared", "Microsoft.NETCore.App"));
|
|
43122
|
+
} catch {
|
|
43123
|
+
return;
|
|
43124
|
+
}
|
|
43125
|
+
let max;
|
|
43126
|
+
for (const entry of entries) {
|
|
43127
|
+
const match = /^(\d+)\./.exec(entry);
|
|
43128
|
+
if (!match)
|
|
43129
|
+
continue;
|
|
43130
|
+
const major = Number.parseInt(match[1], 10);
|
|
43131
|
+
if (!Number.isNaN(major) && (max === undefined || major > max)) {
|
|
43132
|
+
max = major;
|
|
43133
|
+
}
|
|
43134
|
+
}
|
|
43135
|
+
return max;
|
|
43136
|
+
}
|
|
43137
|
+
function* rootsAtOrUnder(dir, deps) {
|
|
43138
|
+
if (deps.fileExists(layoutPath().join(dir, dotnetExeName()))) {
|
|
43139
|
+
yield dir;
|
|
43140
|
+
return;
|
|
43141
|
+
}
|
|
43142
|
+
let entries;
|
|
43143
|
+
try {
|
|
43144
|
+
entries = deps.readDir(dir);
|
|
43145
|
+
} catch {
|
|
43146
|
+
return;
|
|
43147
|
+
}
|
|
43148
|
+
for (const entry of entries.sort((a, b) => b.localeCompare(a, undefined, { numeric: true }))) {
|
|
43149
|
+
yield layoutPath().join(dir, entry);
|
|
43150
|
+
}
|
|
43151
|
+
}
|
|
43152
|
+
function* dotnetRootCandidates(robotDir, deps) {
|
|
43153
|
+
const declaredRoot = process.env[DOTNET_ROOT_ENV];
|
|
43154
|
+
if (declaredRoot) {
|
|
43155
|
+
deps.log(`Using ${DOTNET_ROOT_ENV}: ${declaredRoot}`);
|
|
43156
|
+
yield* rootsAtOrUnder(declaredRoot, deps);
|
|
43157
|
+
}
|
|
43158
|
+
if (process.platform !== "win32") {
|
|
43159
|
+
yield layoutPath().join(robotDir, "dotnet");
|
|
43160
|
+
return;
|
|
43161
|
+
}
|
|
43162
|
+
yield robotDir;
|
|
43163
|
+
yield* rootsAtOrUnder(win32.resolve(robotDir, "..", "..", RUNTIMES_SUBDIR), deps);
|
|
43164
|
+
}
|
|
43165
|
+
function resolveBundledDotnet(robotDir, deps) {
|
|
43166
|
+
if (!robotDir)
|
|
43167
|
+
return;
|
|
43168
|
+
for (const dotnetRoot of dotnetRootCandidates(robotDir, deps)) {
|
|
43169
|
+
const exePath = layoutPath().join(dotnetRoot, dotnetExeName());
|
|
43170
|
+
if (!deps.fileExists(exePath))
|
|
43171
|
+
continue;
|
|
43172
|
+
const runtimeMajor = detectDotnetRuntimeMajor(dotnetRoot, deps);
|
|
43173
|
+
if (runtimeMajor === undefined || runtimeMajor < MIN_BUNDLED_DOTNET_MAJOR) {
|
|
43174
|
+
const reason = runtimeMajor === undefined ? "could not determine its .NET runtime version" : `highest .NET runtime major ${runtimeMajor} is below the required ${MIN_BUNDLED_DOTNET_MAJOR}`;
|
|
43175
|
+
deps.log(`Ignoring bundled dotnet at ${exePath}: ${reason}.`);
|
|
43176
|
+
continue;
|
|
43177
|
+
}
|
|
43178
|
+
return {
|
|
43179
|
+
exePath,
|
|
43180
|
+
env: {
|
|
43181
|
+
DOTNET_ROOT: dotnetRoot,
|
|
43182
|
+
DOTNET_MULTILEVEL_LOOKUP: "0",
|
|
43183
|
+
...DOTNET_ROLL_FORWARD_ENV
|
|
43184
|
+
}
|
|
43185
|
+
};
|
|
43186
|
+
}
|
|
43187
|
+
deps.log("No usable delivered dotnet found. Falling back to the system dotnet on PATH.");
|
|
43188
|
+
return;
|
|
43189
|
+
}
|
|
43190
|
+
|
|
43191
|
+
// src/resolution/feed-control.ts
|
|
43192
|
+
function resolveBundledFeedEnv(robotDir) {
|
|
43193
|
+
if (!robotDir || process.env[LOCAL_ROBOT_FEEDS_ENV]) {
|
|
43194
|
+
return {};
|
|
43195
|
+
}
|
|
43196
|
+
return { [LOCAL_ROBOT_FEEDS_ENV]: robotNugetConfigPath(robotDir) };
|
|
43197
|
+
}
|
|
43198
|
+
async function composeOrchestratorFeedsEnv(compose, log) {
|
|
43199
|
+
if (process.env[ORCHESTRATOR_RESTORE_FEEDS_ENV] || !compose) {
|
|
43200
|
+
return {};
|
|
43201
|
+
}
|
|
43202
|
+
const feedsPath = await compose(log);
|
|
43203
|
+
if (!feedsPath) {
|
|
43204
|
+
return {};
|
|
43205
|
+
}
|
|
43206
|
+
return { [ORCHESTRATOR_RESTORE_FEEDS_ENV]: feedsPath };
|
|
43207
|
+
}
|
|
43208
|
+
function toSessionConnection(status) {
|
|
43209
|
+
if (status.loginStatus !== "Logged in" || !status.accessToken || !status.baseUrl) {
|
|
43210
|
+
return;
|
|
43211
|
+
}
|
|
43212
|
+
let base = status.baseUrl;
|
|
43213
|
+
while (base.endsWith("/")) {
|
|
43214
|
+
base = base.slice(0, -1);
|
|
43215
|
+
}
|
|
43216
|
+
const segments = [];
|
|
43217
|
+
if (status.organizationName) {
|
|
43218
|
+
segments.push(status.organizationName);
|
|
43219
|
+
if (status.tenantName) {
|
|
43220
|
+
segments.push(status.tenantName);
|
|
43221
|
+
}
|
|
43222
|
+
}
|
|
43223
|
+
const cloudUrl = segments.length ? `${base}/${segments.join("/")}` : base;
|
|
43224
|
+
return {
|
|
43225
|
+
accessToken: status.accessToken,
|
|
43226
|
+
cloudUrl,
|
|
43227
|
+
tenantId: status.tenantId
|
|
43228
|
+
};
|
|
43229
|
+
}
|
|
43230
|
+
async function resolveSessionConnection() {
|
|
43231
|
+
try {
|
|
43232
|
+
const auth = await Promise.resolve().then(() => (init_dist(), exports_dist));
|
|
43233
|
+
const status = await auth.getLoginStatusAsync({
|
|
43234
|
+
ensureTokenValidityMinutes: 5
|
|
43235
|
+
});
|
|
43236
|
+
if (status.loginStatus && status.loginStatus !== "Logged in" && status.loginStatus !== "Logged out") {
|
|
43237
|
+
logger.warn(`Tenant Orchestrator feeds skipped: the login session is '${status.loginStatus}' — run 'uip login' to restore it.`);
|
|
43238
|
+
}
|
|
43239
|
+
return toSessionConnection(status);
|
|
43240
|
+
} catch {
|
|
43241
|
+
return;
|
|
43242
|
+
}
|
|
43243
|
+
}
|
|
43025
43244
|
|
|
43026
43245
|
// src/resolution/resolver-deps.ts
|
|
43027
|
-
import { execFileSync as
|
|
43246
|
+
import { execFileSync as execFileSync6, spawn } from "node:child_process";
|
|
43028
43247
|
import { existsSync as existsSync4, readdirSync as readdirSync4, readFileSync as readFileSync5 } from "node:fs";
|
|
43029
43248
|
import { createRequire as createRequire4 } from "node:module";
|
|
43030
43249
|
|
|
@@ -43466,20 +43685,51 @@ function adaptRemoteDebugConfigServiceProxy(proxy) {
|
|
|
43466
43685
|
};
|
|
43467
43686
|
}
|
|
43468
43687
|
|
|
43688
|
+
class RemoteUiaSessionConfigServiceProxy {
|
|
43689
|
+
EnsureRemoteUiaSession() {
|
|
43690
|
+
throw null;
|
|
43691
|
+
}
|
|
43692
|
+
StopRemoteUiaSession() {
|
|
43693
|
+
throw null;
|
|
43694
|
+
}
|
|
43695
|
+
}
|
|
43696
|
+
__legacyDecorateClassTS([
|
|
43697
|
+
import_coreipc2.ipc.$operation
|
|
43698
|
+
], RemoteUiaSessionConfigServiceProxy.prototype, "EnsureRemoteUiaSession", null);
|
|
43699
|
+
__legacyDecorateClassTS([
|
|
43700
|
+
import_coreipc2.ipc.$operation
|
|
43701
|
+
], RemoteUiaSessionConfigServiceProxy.prototype, "StopRemoteUiaSession", null);
|
|
43702
|
+
RemoteUiaSessionConfigServiceProxy = __legacyDecorateClassTS([
|
|
43703
|
+
import_coreipc2.ipc.$service({ endpoint: "IRemoteUiaSessionConfigService" })
|
|
43704
|
+
], RemoteUiaSessionConfigServiceProxy);
|
|
43705
|
+
function adaptRemoteUiaSessionConfigServiceProxy(proxy) {
|
|
43706
|
+
return {
|
|
43707
|
+
ensureRemoteUiaSession: () => proxy.EnsureRemoteUiaSession(),
|
|
43708
|
+
stopRemoteUiaSession: () => proxy.StopRemoteUiaSession()
|
|
43709
|
+
};
|
|
43710
|
+
}
|
|
43711
|
+
|
|
43469
43712
|
class RunServiceProxy {
|
|
43470
43713
|
ExecuteCommand(command, filePath, inputArgumentsJson, inputVariablesJson, logLevel, profiling) {
|
|
43471
43714
|
throw null;
|
|
43472
43715
|
}
|
|
43716
|
+
ApplyFileChanges(fileChangesJson) {
|
|
43717
|
+
throw null;
|
|
43718
|
+
}
|
|
43473
43719
|
}
|
|
43474
43720
|
__legacyDecorateClassTS([
|
|
43475
43721
|
import_coreipc2.ipc.$operation
|
|
43476
43722
|
], RunServiceProxy.prototype, "ExecuteCommand", null);
|
|
43723
|
+
__legacyDecorateClassTS([
|
|
43724
|
+
import_coreipc2.ipc.$operation
|
|
43725
|
+
], RunServiceProxy.prototype, "ApplyFileChanges", null);
|
|
43477
43726
|
RunServiceProxy = __legacyDecorateClassTS([
|
|
43478
43727
|
import_coreipc2.ipc.$service({ endpoint: "IRunService" })
|
|
43479
43728
|
], RunServiceProxy);
|
|
43480
43729
|
function adaptRunServiceProxy(proxy) {
|
|
43481
43730
|
return {
|
|
43482
|
-
executeCommand: (command, filePath, inputArgumentsJson, inputVariablesJson, logLevel, profiling) => proxy.ExecuteCommand(command, filePath, inputArgumentsJson, inputVariablesJson, logLevel, profiling)
|
|
43731
|
+
executeCommand: (command, filePath, inputArgumentsJson, inputVariablesJson, logLevel, profiling) => proxy.ExecuteCommand(command, filePath, inputArgumentsJson, inputVariablesJson, logLevel, profiling),
|
|
43732
|
+
applyFileChanges: (fileChangesJson) => proxy.ApplyFileChanges(fileChangesJson)
|
|
43483
43733
|
};
|
|
43484
43734
|
}
|
|
43485
43735
|
|
|
@@ -43605,6 +43855,7 @@ class StudioServices {
|
|
|
43605
43855
|
objectRepository;
|
|
43606
43856
|
package;
|
|
43607
43857
|
remoteDebugConfig;
|
|
43858
|
+
remoteUiaSessionConfig;
|
|
43608
43859
|
run;
|
|
43609
43860
|
studioLifecycle;
|
|
43610
43861
|
testing;
|
|
@@ -43623,6 +43874,7 @@ class StudioServices {
|
|
|
43623
43874
|
this.objectRepository = adaptObjectRepositoryServiceProxy(import_coreipc2.ipc.proxy.withAddress(addr).withService(ObjectRepositoryServiceProxy));
|
|
43624
43875
|
this.package = adaptPackageServiceProxy(import_coreipc2.ipc.proxy.withAddress(addr).withService(PackageServiceProxy));
|
|
43625
43876
|
this.remoteDebugConfig = adaptRemoteDebugConfigServiceProxy(import_coreipc2.ipc.proxy.withAddress(addr).withService(RemoteDebugConfigServiceProxy));
|
|
43877
|
+
this.remoteUiaSessionConfig = adaptRemoteUiaSessionConfigServiceProxy(import_coreipc2.ipc.proxy.withAddress(addr).withService(RemoteUiaSessionConfigServiceProxy));
|
|
43626
43878
|
this.run = adaptRunServiceProxy(import_coreipc2.ipc.proxy.withAddress(addr).withService(RunServiceProxy));
|
|
43627
43879
|
this.studioLifecycle = adaptStudioLifecycleServiceProxy(import_coreipc2.ipc.proxy.withAddress(addr).withService(StudioLifecycleServiceProxy));
|
|
43628
43880
|
this.testing = adaptTestingServiceProxy(import_coreipc2.ipc.proxy.withAddress(addr).withService(TestingServiceProxy));
|
|
@@ -43783,6 +44035,9 @@ class HelmRunCallbackProxy {
|
|
|
43783
44035
|
OnDebugStateChanged(state, localsJson) {
|
|
43784
44036
|
throw null;
|
|
43785
44037
|
}
|
|
44038
|
+
OnProfilingEntry(entryJson) {
|
|
44039
|
+
throw null;
|
|
44040
|
+
}
|
|
43786
44041
|
}
|
|
43787
44042
|
__legacyDecorateClassTS([
|
|
43788
44043
|
import_coreipc4.ipc.$operation
|
|
@@ -43790,6 +44045,9 @@ __legacyDecorateClassTS([
|
|
|
43790
44045
|
__legacyDecorateClassTS([
|
|
43791
44046
|
import_coreipc4.ipc.$operation
|
|
43792
44047
|
], HelmRunCallbackProxy.prototype, "OnDebugStateChanged", null);
|
|
44048
|
+
__legacyDecorateClassTS([
|
|
44049
|
+
import_coreipc4.ipc.$operation
|
|
44050
|
+
], HelmRunCallbackProxy.prototype, "OnProfilingEntry", null);
|
|
43793
44051
|
HelmRunCallbackProxy = __legacyDecorateClassTS([
|
|
43794
44052
|
import_coreipc4.ipc.$service({ endpoint: "IHelmRunCallback" })
|
|
43795
44053
|
], HelmRunCallbackProxy);
|
|
@@ -43797,16 +44055,23 @@ class HelmRunServiceProxy {
|
|
|
43797
44055
|
ExecuteCommand(request) {
|
|
43798
44056
|
throw null;
|
|
43799
44057
|
}
|
|
44058
|
+
ApplyFileChanges(request) {
|
|
44059
|
+
throw null;
|
|
44060
|
+
}
|
|
43800
44061
|
}
|
|
43801
44062
|
__legacyDecorateClassTS([
|
|
43802
44063
|
import_coreipc4.ipc.$operation
|
|
43803
44064
|
], HelmRunServiceProxy.prototype, "ExecuteCommand", null);
|
|
44065
|
+
__legacyDecorateClassTS([
|
|
44066
|
+
import_coreipc4.ipc.$operation
|
|
44067
|
+
], HelmRunServiceProxy.prototype, "ApplyFileChanges", null);
|
|
43804
44068
|
HelmRunServiceProxy = __legacyDecorateClassTS([
|
|
43805
44069
|
import_coreipc4.ipc.$service({ endpoint: "IHelmRunService" })
|
|
43806
44070
|
], HelmRunServiceProxy);
|
|
43807
44071
|
function adaptHelmRunServiceProxy(proxy) {
|
|
43808
44072
|
return {
|
|
43809
|
-
executeCommand: (request) => proxy.ExecuteCommand({ Payload: request })
|
|
44073
|
+
executeCommand: (request) => proxy.ExecuteCommand({ Payload: request }),
|
|
44074
|
+
applyFileChanges: (request) => proxy.ApplyFileChanges(request)
|
|
43810
44075
|
};
|
|
43811
44076
|
}
|
|
43812
44077
|
|
|
@@ -43865,6 +44130,30 @@ function adaptRemoteDebugConfigServiceProxy2(proxy) {
|
|
|
43865
44130
|
};
|
|
43866
44131
|
}
|
|
43867
44132
|
|
|
44133
|
+
class RemoteUiaSessionConfigServiceProxy2 {
|
|
44134
|
+
EnsureRemoteUiaSession() {
|
|
44135
|
+
throw null;
|
|
44136
|
+
}
|
|
44137
|
+
StopRemoteUiaSession() {
|
|
44138
|
+
throw null;
|
|
44139
|
+
}
|
|
44140
|
+
}
|
|
44141
|
+
__legacyDecorateClassTS([
|
|
44142
|
+
import_coreipc4.ipc.$operation
|
|
44143
|
+
], RemoteUiaSessionConfigServiceProxy2.prototype, "EnsureRemoteUiaSession", null);
|
|
44144
|
+
__legacyDecorateClassTS([
|
|
44145
|
+
import_coreipc4.ipc.$operation
|
|
44146
|
+
], RemoteUiaSessionConfigServiceProxy2.prototype, "StopRemoteUiaSession", null);
|
|
44147
|
+
RemoteUiaSessionConfigServiceProxy2 = __legacyDecorateClassTS([
|
|
44148
|
+
import_coreipc4.ipc.$service({ endpoint: "IRemoteUiaSessionConfigService" })
|
|
44149
|
+
], RemoteUiaSessionConfigServiceProxy2);
|
|
44150
|
+
function adaptRemoteUiaSessionConfigServiceProxy2(proxy) {
|
|
44151
|
+
return {
|
|
44152
|
+
ensureRemoteUiaSession: () => proxy.EnsureRemoteUiaSession(),
|
|
44153
|
+
stopRemoteUiaSession: () => proxy.StopRemoteUiaSession()
|
|
44154
|
+
};
|
|
44155
|
+
}
|
|
44156
|
+
|
|
43868
44157
|
class HelmServices {
|
|
43869
44158
|
authContext;
|
|
43870
44159
|
build;
|
|
@@ -43873,6 +44162,7 @@ class HelmServices {
|
|
|
43873
44162
|
run;
|
|
43874
44163
|
validation;
|
|
43875
44164
|
remoteDebugConfig;
|
|
44165
|
+
remoteUiaSessionConfig;
|
|
43876
44166
|
constructor(pipeName) {
|
|
43877
44167
|
trackPipe(pipeName);
|
|
43878
44168
|
const addr = import_coreipc4.ipc.namedPipe(pipeName);
|
|
@@ -43883,6 +44173,7 @@ class HelmServices {
|
|
|
43883
44173
|
this.run = adaptHelmRunServiceProxy(import_coreipc4.ipc.proxy.withAddress(addr).withService(HelmRunServiceProxy));
|
|
43884
44174
|
this.validation = adaptHelmValidationServiceProxy(import_coreipc4.ipc.proxy.withAddress(addr).withService(HelmValidationServiceProxy));
|
|
43885
44175
|
this.remoteDebugConfig = adaptRemoteDebugConfigServiceProxy2(import_coreipc4.ipc.proxy.withAddress(addr).withService(RemoteDebugConfigServiceProxy2));
|
|
44176
|
+
this.remoteUiaSessionConfig = adaptRemoteUiaSessionConfigServiceProxy2(import_coreipc4.ipc.proxy.withAddress(addr).withService(RemoteUiaSessionConfigServiceProxy2));
|
|
43886
44177
|
}
|
|
43887
44178
|
}
|
|
43888
44179
|
|
|
@@ -43897,7 +44188,7 @@ import {
|
|
|
43897
44188
|
unlinkSync as unlinkSync3,
|
|
43898
44189
|
writeSync as writeSync2
|
|
43899
44190
|
} from "node:fs";
|
|
43900
|
-
import { join as
|
|
44191
|
+
import { join as join10 } from "node:path";
|
|
43901
44192
|
|
|
43902
44193
|
// src/resolution/helm-run-slot.ts
|
|
43903
44194
|
import {
|
|
@@ -43916,62 +44207,35 @@ import {
|
|
|
43916
44207
|
writeSync
|
|
43917
44208
|
} from "node:fs";
|
|
43918
44209
|
import { homedir as homedir3 } from "node:os";
|
|
43919
|
-
import { join as
|
|
43920
|
-
|
|
43921
|
-
// src/resolution/instance-matching.ts
|
|
43922
|
-
import { normalize } from "node:path";
|
|
43923
|
-
function normalizePath(path4) {
|
|
43924
|
-
return normalize(path4).replace(/[\\/]+$/, "").toLowerCase();
|
|
43925
|
-
}
|
|
43926
|
-
function matchByProject(instances, projectDir) {
|
|
43927
|
-
const target = normalizePath(projectDir);
|
|
43928
|
-
return instances.find((i) => i.projectDirectory && normalizePath(i.projectDirectory) === target);
|
|
43929
|
-
}
|
|
43930
|
-
function findAvailableInstance(instances) {
|
|
43931
|
-
return instances.find((i) => i.ipcEndpointName && i.executionStatus === "Available" /* Available */);
|
|
43932
|
-
}
|
|
43933
|
-
function findIdleInstance(instances) {
|
|
43934
|
-
return instances.find((i) => i.ipcEndpointName && !i.projectDirectory && i.executionStatus === "Available" /* Available */);
|
|
43935
|
-
}
|
|
43936
|
-
function filterByBackend(instances, preference) {
|
|
43937
|
-
switch (preference) {
|
|
43938
|
-
case "helm" /* Helm */:
|
|
43939
|
-
return instances.filter((i) => i.backendType === "Helm" /* Helm */);
|
|
43940
|
-
case "studio" /* Studio */:
|
|
43941
|
-
return instances.filter((i) => i.backendType !== "Helm" /* Helm */);
|
|
43942
|
-
case "any" /* Any */:
|
|
43943
|
-
return instances;
|
|
43944
|
-
}
|
|
43945
|
-
}
|
|
43946
|
-
|
|
43947
|
-
// src/resolution/helm-run-slot.ts
|
|
44210
|
+
import { join as join9 } from "node:path";
|
|
43948
44211
|
var DEFAULT_MAX_SLOTS = 3;
|
|
43949
44212
|
var READY_MARKER = ".ready";
|
|
43950
44213
|
var STAGING_DIR = ".staging";
|
|
43951
44214
|
var STALE_LOCK_MS = 5 * 60000;
|
|
43952
44215
|
var RECENT_USE_MS = 60000;
|
|
43953
44216
|
var STALE_STAGING_MS = 10 * 60000;
|
|
43954
|
-
var
|
|
44217
|
+
var POLL_INTERVAL_MS2 = 250;
|
|
43955
44218
|
var MAX_WAIT_MS = 180000;
|
|
43956
44219
|
function resolveHelmCacheRoot() {
|
|
43957
44220
|
const override = process.env.UIPATH_HELM_CACHE_DIR;
|
|
43958
44221
|
if (override)
|
|
43959
44222
|
return override;
|
|
43960
44223
|
if (process.platform === "win32") {
|
|
43961
|
-
const base = process.env.LOCALAPPDATA ??
|
|
43962
|
-
return
|
|
44224
|
+
const base = process.env.LOCALAPPDATA ?? join9(homedir3(), "AppData", "Local");
|
|
44225
|
+
return join9(base, "UiPath", "Helm");
|
|
43963
44226
|
}
|
|
43964
44227
|
if (process.platform === "darwin") {
|
|
43965
|
-
return
|
|
44228
|
+
return join9(homedir3(), "Library", "Caches", "UiPath", "Helm");
|
|
43966
44229
|
}
|
|
43967
|
-
const xdg = process.env.XDG_CACHE_HOME ??
|
|
43968
|
-
return
|
|
44230
|
+
const xdg = process.env.XDG_CACHE_HOME ?? join9(homedir3(), ".cache");
|
|
44231
|
+
return join9(xdg, "uipath", "helm");
|
|
43969
44232
|
}
|
|
43970
44233
|
function slotName(version) {
|
|
43971
|
-
|
|
44234
|
+
const safeVersion = version.replace(/[\\/]/g, "_");
|
|
44235
|
+
return `${safeVersion}-${process.platform}-${process.arch}`;
|
|
43972
44236
|
}
|
|
43973
44237
|
function helmSlotDir(root, version) {
|
|
43974
|
-
return
|
|
44238
|
+
return join9(root, slotName(version));
|
|
43975
44239
|
}
|
|
43976
44240
|
function touch(path4) {
|
|
43977
44241
|
try {
|
|
@@ -44006,14 +44270,14 @@ function releaseLock(lockPath) {
|
|
|
44006
44270
|
} catch {}
|
|
44007
44271
|
}
|
|
44008
44272
|
function publishSlot(sourceToolsDir, slot, root, version, log) {
|
|
44009
|
-
const stagingRoot =
|
|
44273
|
+
const stagingRoot = join9(root, STAGING_DIR);
|
|
44010
44274
|
mkdirSync2(stagingRoot, { recursive: true });
|
|
44011
|
-
const staging =
|
|
44275
|
+
const staging = join9(stagingRoot, `${slotName(version)}-${process.pid}-${Date.now().toString(36)}`);
|
|
44012
44276
|
rmSync2(staging, { recursive: true, force: true });
|
|
44013
44277
|
log(`Materializing Helm slot ${slot} from ${sourceToolsDir}`);
|
|
44014
44278
|
cpSync(sourceToolsDir, staging, { recursive: true });
|
|
44015
44279
|
const now = new Date;
|
|
44016
|
-
const markerFd = openSync2(
|
|
44280
|
+
const markerFd = openSync2(join9(staging, READY_MARKER), "w");
|
|
44017
44281
|
writeSync(markerFd, now.getTime().toString());
|
|
44018
44282
|
closeSync2(markerFd);
|
|
44019
44283
|
rmSync2(slot, { recursive: true, force: true });
|
|
@@ -44024,14 +44288,14 @@ function publishSlot(sourceToolsDir, slot, root, version, log) {
|
|
|
44024
44288
|
}
|
|
44025
44289
|
}
|
|
44026
44290
|
function evictSlots(root, targetSlot, liveBinDirs, maxSlots, log) {
|
|
44027
|
-
const entries = readdirSync3(root, { withFileTypes: true }).filter((e) => e.isDirectory() && e.name !== STAGING_DIR).map((e) =>
|
|
44291
|
+
const entries = readdirSync3(root, { withFileTypes: true }).filter((e) => e.isDirectory() && e.name !== STAGING_DIR).map((e) => join9(root, e.name)).filter((dir) => existsSync3(join9(dir, READY_MARKER)));
|
|
44028
44292
|
if (entries.length <= maxSlots)
|
|
44029
44293
|
return;
|
|
44030
44294
|
const targetNorm = normalizePath(targetSlot);
|
|
44031
44295
|
const now = Date.now();
|
|
44032
44296
|
const readyMtime = (dir) => {
|
|
44033
44297
|
try {
|
|
44034
|
-
return statSync2(
|
|
44298
|
+
return statSync2(join9(dir, READY_MARKER)).mtimeMs;
|
|
44035
44299
|
} catch {
|
|
44036
44300
|
return 0;
|
|
44037
44301
|
}
|
|
@@ -44056,7 +44320,7 @@ function evictSlots(root, targetSlot, liveBinDirs, maxSlots, log) {
|
|
|
44056
44320
|
}
|
|
44057
44321
|
}
|
|
44058
44322
|
function cleanupStale(root) {
|
|
44059
|
-
const stagingRoot =
|
|
44323
|
+
const stagingRoot = join9(root, STAGING_DIR);
|
|
44060
44324
|
let entries;
|
|
44061
44325
|
try {
|
|
44062
44326
|
entries = readdirSync3(stagingRoot);
|
|
@@ -44065,7 +44329,7 @@ function cleanupStale(root) {
|
|
|
44065
44329
|
}
|
|
44066
44330
|
const now = Date.now();
|
|
44067
44331
|
for (const name of entries) {
|
|
44068
|
-
const dir =
|
|
44332
|
+
const dir = join9(stagingRoot, name);
|
|
44069
44333
|
const parts = name.split("-");
|
|
44070
44334
|
const pid = Number.parseInt(parts[parts.length - 2] ?? "", 10);
|
|
44071
44335
|
try {
|
|
@@ -44083,14 +44347,14 @@ async function ensureHelmSlot(opts) {
|
|
|
44083
44347
|
const root = opts.cacheRoot ?? resolveHelmCacheRoot();
|
|
44084
44348
|
const maxSlots = opts.maxSlots ?? DEFAULT_MAX_SLOTS;
|
|
44085
44349
|
const slot = helmSlotDir(root, opts.version);
|
|
44086
|
-
const readyPath =
|
|
44350
|
+
const readyPath = join9(slot, READY_MARKER);
|
|
44087
44351
|
const fromSource = () => ({
|
|
44088
44352
|
toolsDir: opts.sourceToolsDir,
|
|
44089
|
-
helmExePath:
|
|
44353
|
+
helmExePath: join9(opts.sourceToolsDir, opts.helmExeName)
|
|
44090
44354
|
});
|
|
44091
44355
|
const fromSlot = () => {
|
|
44092
44356
|
touch(readyPath);
|
|
44093
|
-
return { toolsDir: slot, helmExePath:
|
|
44357
|
+
return { toolsDir: slot, helmExePath: join9(slot, opts.helmExeName) };
|
|
44094
44358
|
};
|
|
44095
44359
|
if (existsSync3(readyPath)) {
|
|
44096
44360
|
log(`Using cached Helm slot: ${slot}`);
|
|
@@ -44102,7 +44366,7 @@ async function ensureHelmSlot(opts) {
|
|
|
44102
44366
|
log(`Cannot create Helm cache root ${root}; running from source.`);
|
|
44103
44367
|
return fromSource();
|
|
44104
44368
|
}
|
|
44105
|
-
const lockPath =
|
|
44369
|
+
const lockPath = join9(root, `${slotName(opts.version)}.lock`);
|
|
44106
44370
|
const deadline = Date.now() + MAX_WAIT_MS;
|
|
44107
44371
|
while (true) {
|
|
44108
44372
|
if (existsSync3(readyPath))
|
|
@@ -44124,7 +44388,7 @@ async function ensureHelmSlot(opts) {
|
|
|
44124
44388
|
log("Timed out waiting for Helm slot; running from source.");
|
|
44125
44389
|
return fromSource();
|
|
44126
44390
|
}
|
|
44127
|
-
await sleep(
|
|
44391
|
+
await sleep(POLL_INTERVAL_MS2);
|
|
44128
44392
|
}
|
|
44129
44393
|
if (!existsSync3(readyPath))
|
|
44130
44394
|
return fromSource();
|
|
@@ -44141,10 +44405,10 @@ async function ensureHelmSlot(opts) {
|
|
|
44141
44405
|
var LOCK_SUBDIR = "project-locks";
|
|
44142
44406
|
var STALE_LOCK_MS2 = 5 * 60000;
|
|
44143
44407
|
var DEFAULT_MAX_WAIT_MS = 120000;
|
|
44144
|
-
var
|
|
44408
|
+
var POLL_INTERVAL_MS3 = 250;
|
|
44145
44409
|
function lockFilePath(root, lockKey) {
|
|
44146
44410
|
const hash = createHash2("sha256").update(lockKey).digest("hex").slice(0, 32);
|
|
44147
|
-
return
|
|
44411
|
+
return join10(root, LOCK_SUBDIR, `${hash}.lock`);
|
|
44148
44412
|
}
|
|
44149
44413
|
function tryAcquireLock2(lockPath, log) {
|
|
44150
44414
|
let fd;
|
|
@@ -44195,7 +44459,7 @@ async function withProjectSpawnLock(lockKey, fn, options = {}) {
|
|
|
44195
44459
|
const root = options.cacheRoot ?? resolveHelmCacheRoot();
|
|
44196
44460
|
const maxWaitMs = options.maxWaitMs ?? DEFAULT_MAX_WAIT_MS;
|
|
44197
44461
|
try {
|
|
44198
|
-
mkdirSync3(
|
|
44462
|
+
mkdirSync3(join10(root, LOCK_SUBDIR), { recursive: true });
|
|
44199
44463
|
} catch {
|
|
44200
44464
|
log(`Cannot create project-lock directory under ${root}; proceeding without cross-process lock.`);
|
|
44201
44465
|
return fn();
|
|
@@ -44208,7 +44472,7 @@ async function withProjectSpawnLock(lockKey, fn, options = {}) {
|
|
|
44208
44472
|
log("Timed out waiting for the project spawn lock; proceeding without it.");
|
|
44209
44473
|
return fn();
|
|
44210
44474
|
}
|
|
44211
|
-
await sleep(
|
|
44475
|
+
await sleep(POLL_INTERVAL_MS3);
|
|
44212
44476
|
}
|
|
44213
44477
|
} catch (err) {
|
|
44214
44478
|
log(`Project spawn lock unavailable (${err instanceof Error ? err.message : String(err)}); proceeding without it.`);
|
|
@@ -44221,6 +44485,72 @@ async function withProjectSpawnLock(lockKey, fn, options = {}) {
|
|
|
44221
44485
|
}
|
|
44222
44486
|
}
|
|
44223
44487
|
|
|
44488
|
+
// src/resolution/runtime-arch.ts
|
|
44489
|
+
import { execFileSync as execFileSync5 } from "node:child_process";
|
|
44490
|
+
var PROBE_TIMEOUT_MS = 1e4;
|
|
44491
|
+
var DOTNET_TO_NODE_ARCH = {
|
|
44492
|
+
x64: "x64",
|
|
44493
|
+
arm64: "arm64",
|
|
44494
|
+
x86: "ia32",
|
|
44495
|
+
arm: "arm"
|
|
44496
|
+
};
|
|
44497
|
+
var PATH_DOTNET = "dotnet";
|
|
44498
|
+
function parseRuntimeArch(info) {
|
|
44499
|
+
const rid = /\b(?:win\d*|osx|linux|freebsd)(?:-musl)?-(x64|arm64|x86|arm)\b/.exec(info);
|
|
44500
|
+
const label = /^\s*Architecture:\s*(\S+)/m.exec(info);
|
|
44501
|
+
const arch3 = rid?.[1] ?? label?.[1];
|
|
44502
|
+
return arch3 ? DOTNET_TO_NODE_ARCH[arch3] ?? arch3 : undefined;
|
|
44503
|
+
}
|
|
44504
|
+
function probeDotnetInfo(dotnetPath = PATH_DOTNET) {
|
|
44505
|
+
return execFileSync5(dotnetPath, ["--info"], {
|
|
44506
|
+
encoding: "utf-8",
|
|
44507
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
44508
|
+
timeout: PROBE_TIMEOUT_MS,
|
|
44509
|
+
env: { ...process.env, DOTNET_CLI_UI_LANGUAGE: "en" }
|
|
44510
|
+
});
|
|
44511
|
+
}
|
|
44512
|
+
var pinnedDotnetPath;
|
|
44513
|
+
function getPinnedDotnetPath() {
|
|
44514
|
+
return pinnedDotnetPath;
|
|
44515
|
+
}
|
|
44516
|
+
var NODE_LOOKUP_HINT = process.platform === "win32" ? "where.exe node" : "command -v -a node";
|
|
44517
|
+
var REMEDY = "npm selects the Helm binaries from the architecture of the node that " + "installs the CLI, and that install is usually automatic — so start from " + `the node your PATH resolves (\`${NODE_LOOKUP_HINT}\`) and make sure the ` + "CLI is installed by a node whose architecture matches your dotnet " + "(`npm uninstall -g @uipath/rpa-tool && npm install -g @uipath/rpa-tool`). " + "Installing a .NET runtime that matches the Helm binaries works too.";
|
|
44518
|
+
function measure(origin, path4, probe) {
|
|
44519
|
+
try {
|
|
44520
|
+
return { origin, path: path4, arch: parseRuntimeArch(probe(path4)) };
|
|
44521
|
+
} catch {
|
|
44522
|
+
return { origin, path: path4 };
|
|
44523
|
+
}
|
|
44524
|
+
}
|
|
44525
|
+
function findRuntimeArchMismatch(opts) {
|
|
44526
|
+
if (process.env.HELM_LOCAL_DIR) {
|
|
44527
|
+
return null;
|
|
44528
|
+
}
|
|
44529
|
+
const probe = opts?.probe ?? probeDotnetInfo;
|
|
44530
|
+
const pinned = opts?.dotnetPath;
|
|
44531
|
+
const helmArch = process.arch;
|
|
44532
|
+
const hosting = pinned ? measure("bundled with the Robot install", pinned, probe) : measure("on PATH", PATH_DOTNET, probe);
|
|
44533
|
+
if (hosting.arch === helmArch) {
|
|
44534
|
+
return null;
|
|
44535
|
+
}
|
|
44536
|
+
const others = pinned ? [measure("on PATH", PATH_DOTNET, probe)] : [];
|
|
44537
|
+
const alsoProbed = others.length ? ` Also probed: ${others.map((r) => `dotnet ${r.origin} (${r.arch ?? "could not be read"})`).join(", ")}.` : "";
|
|
44538
|
+
const resolved = `The Helm binaries this CLI resolved are ${process.platform}-${helmArch}`;
|
|
44539
|
+
const host = `the dotnet hosting them (${hosting.origin}: ${hosting.path})`;
|
|
44540
|
+
return hosting.arch === undefined ? {
|
|
44541
|
+
helmArch,
|
|
44542
|
+
hosting,
|
|
44543
|
+
probed: [hosting, ...others],
|
|
44544
|
+
summary: `${resolved}, and ${host} could not be interrogated. Their ` + "assemblies are ReadyToRun images, which only a runtime of " + "the same architecture can load, so an architecture " + `mismatch is the likeliest cause.${alsoProbed}`,
|
|
44545
|
+
remedy: "Compare the two: `dotnet --info` reports the runtime's " + `architecture, which must be ${helmArch}. ${REMEDY}`
|
|
44546
|
+
} : {
|
|
44547
|
+
helmArch,
|
|
44548
|
+
hosting,
|
|
44549
|
+
probed: [hosting, ...others],
|
|
44550
|
+
summary: `${resolved}, but ${host} is ${hosting.arch}. Their ` + "assemblies are ReadyToRun images, so a runtime of another " + `architecture cannot load them.${alsoProbed}`,
|
|
44551
|
+
remedy: REMEDY
|
|
44552
|
+
};
|
|
44553
|
+
}
|
|
44224
44554
|
// src/resolution/resolver-deps.ts
|
|
44225
44555
|
var defaultResolverDeps = {
|
|
44226
44556
|
readInstanceStatus(processId) {
|
|
@@ -44240,7 +44570,7 @@ var defaultResolverDeps = {
|
|
|
44240
44570
|
isProcessAlive,
|
|
44241
44571
|
discoverInstances,
|
|
44242
44572
|
executeCommand(command, args) {
|
|
44243
|
-
return
|
|
44573
|
+
return execFileSync6(command, args, {
|
|
44244
44574
|
encoding: "utf-8",
|
|
44245
44575
|
stdio: ["pipe", "pipe", "ignore"]
|
|
44246
44576
|
}).trim();
|
|
@@ -44291,179 +44621,11 @@ var defaultResolverDeps = {
|
|
|
44291
44621
|
},
|
|
44292
44622
|
withProjectSpawnLock(lockKey, fn, log) {
|
|
44293
44623
|
return withProjectSpawnLock(lockKey, fn, { log });
|
|
44624
|
+
},
|
|
44625
|
+
probeDotnetInfo(dotnetPath) {
|
|
44626
|
+
return probeDotnetInfo(dotnetPath);
|
|
44294
44627
|
}
|
|
44295
44628
|
};
|
|
44296
|
-
var DEFAULT_TIMEOUT_MS2 = 60000;
|
|
44297
|
-
var POLL_INTERVAL_MS3 = 1000;
|
|
44298
|
-
var INTEROP_MANIFEST = "interop-manifest.json";
|
|
44299
|
-
var STUDIO_EXE = "UiPath.Studio.exe";
|
|
44300
|
-
var STUDIO_SUBDIR = "Studio";
|
|
44301
|
-
var ROBOT_SUBDIR = "Robot";
|
|
44302
|
-
var HELM_EXE = process.platform === "win32" ? "UiPath.Studio.Helm.exe" : "UiPath.Studio.Helm";
|
|
44303
|
-
|
|
44304
|
-
// src/resolution/robot-bin-resolver.ts
|
|
44305
|
-
var LOCAL_ROBOT_FEEDS_ENV = "UIPATH_LOCAL_ROBOT_FEEDS";
|
|
44306
|
-
function robotNugetConfigPath(robotDir) {
|
|
44307
|
-
return join9(robotDir, "NuGet.config");
|
|
44308
|
-
}
|
|
44309
|
-
var ROBOT_WINDOWS_MARKER = "UiRobot.exe";
|
|
44310
|
-
var ROBOT_MACOS_MARKER = "UiRobot.dll";
|
|
44311
|
-
var MACOS_ASSISTANT_ROBOT_PATH = "/Applications/UiPath Assistant.app/Contents/Robot";
|
|
44312
|
-
var REGISTRY_HIVES = [
|
|
44313
|
-
"HKCU\\Software\\UiPath\\UiPath Studio",
|
|
44314
|
-
"HKLM\\Software\\UiPath\\UiPath Studio"
|
|
44315
|
-
];
|
|
44316
|
-
function queryRegistryValue(valueName, deps) {
|
|
44317
|
-
for (const hive of REGISTRY_HIVES) {
|
|
44318
|
-
try {
|
|
44319
|
-
const output = deps.executeCommand("reg", [
|
|
44320
|
-
"query",
|
|
44321
|
-
hive,
|
|
44322
|
-
"/v",
|
|
44323
|
-
valueName
|
|
44324
|
-
]);
|
|
44325
|
-
const match = output.match(new RegExp(`${valueName}\\s+REG_SZ\\s+(.+)`));
|
|
44326
|
-
if (match)
|
|
44327
|
-
return match[1].trim();
|
|
44328
|
-
} catch {}
|
|
44329
|
-
}
|
|
44330
|
-
return;
|
|
44331
|
-
}
|
|
44332
|
-
function resolveRobotComponentDir(installRoot, deps) {
|
|
44333
|
-
const nested = win32.join(installRoot, ROBOT_SUBDIR);
|
|
44334
|
-
return deps.fileExists(win32.join(nested, ROBOT_WINDOWS_MARKER)) ? nested : installRoot;
|
|
44335
|
-
}
|
|
44336
|
-
function resolveRobotDir(cliPath, deps) {
|
|
44337
|
-
if (cliPath) {
|
|
44338
|
-
deps.log(`Using --robot-dir: ${cliPath}`);
|
|
44339
|
-
return cliPath;
|
|
44340
|
-
}
|
|
44341
|
-
const envPath = process.env.UIPATH_ROBOT_DIR;
|
|
44342
|
-
if (envPath) {
|
|
44343
|
-
deps.log(`Using UIPATH_ROBOT_DIR: ${envPath}`);
|
|
44344
|
-
return envPath;
|
|
44345
|
-
}
|
|
44346
|
-
if (process.platform === "win32") {
|
|
44347
|
-
const robotDir = queryRegistryValue("RobotDir", deps);
|
|
44348
|
-
if (robotDir) {
|
|
44349
|
-
deps.log(`Resolved robot dir from registry: ${robotDir}`);
|
|
44350
|
-
return robotDir;
|
|
44351
|
-
}
|
|
44352
|
-
const installRoot = queryRegistryValue("InstallDir", deps);
|
|
44353
|
-
if (installRoot) {
|
|
44354
|
-
const dir = resolveRobotComponentDir(installRoot, deps);
|
|
44355
|
-
deps.log(`Resolved robot dir from registry: ${dir}`);
|
|
44356
|
-
return dir;
|
|
44357
|
-
}
|
|
44358
|
-
}
|
|
44359
|
-
if (process.platform === "darwin") {
|
|
44360
|
-
if (deps.fileExists(posix.join(MACOS_ASSISTANT_ROBOT_PATH, ROBOT_MACOS_MARKER))) {
|
|
44361
|
-
deps.log(`Found robot at well-known path: ${MACOS_ASSISTANT_ROBOT_PATH}`);
|
|
44362
|
-
return MACOS_ASSISTANT_ROBOT_PATH;
|
|
44363
|
-
}
|
|
44364
|
-
}
|
|
44365
|
-
deps.log("Robot dir not resolved — Robot must already be running");
|
|
44366
|
-
return null;
|
|
44367
|
-
}
|
|
44368
|
-
var DOTNET_ROLL_FORWARD_ENV = {
|
|
44369
|
-
DOTNET_ROLL_FORWARD: "Major"
|
|
44370
|
-
};
|
|
44371
|
-
var MIN_BUNDLED_DOTNET_MAJOR = 8;
|
|
44372
|
-
function detectDotnetRuntimeMajor(dotnetRoot, deps) {
|
|
44373
|
-
let entries;
|
|
44374
|
-
try {
|
|
44375
|
-
entries = deps.readDir(join9(dotnetRoot, "shared", "Microsoft.NETCore.App"));
|
|
44376
|
-
} catch {
|
|
44377
|
-
return;
|
|
44378
|
-
}
|
|
44379
|
-
let max;
|
|
44380
|
-
for (const entry of entries) {
|
|
44381
|
-
const match = /^(\d+)\./.exec(entry);
|
|
44382
|
-
if (!match)
|
|
44383
|
-
continue;
|
|
44384
|
-
const major = Number.parseInt(match[1], 10);
|
|
44385
|
-
if (!Number.isNaN(major) && (max === undefined || major > max)) {
|
|
44386
|
-
max = major;
|
|
44387
|
-
}
|
|
44388
|
-
}
|
|
44389
|
-
return max;
|
|
44390
|
-
}
|
|
44391
|
-
function resolveBundledDotnet(robotDir, deps) {
|
|
44392
|
-
if (!robotDir)
|
|
44393
|
-
return;
|
|
44394
|
-
const exePath = process.platform === "win32" ? join9(robotDir, "dotnet.exe") : join9(robotDir, "dotnet", "dotnet");
|
|
44395
|
-
if (!deps.fileExists(exePath))
|
|
44396
|
-
return;
|
|
44397
|
-
const dotnetRoot = process.platform === "win32" ? robotDir : join9(robotDir, "dotnet");
|
|
44398
|
-
const runtimeMajor = detectDotnetRuntimeMajor(dotnetRoot, deps);
|
|
44399
|
-
if (runtimeMajor === undefined || runtimeMajor < MIN_BUNDLED_DOTNET_MAJOR) {
|
|
44400
|
-
const reason = runtimeMajor === undefined ? "could not determine its .NET runtime version" : `highest .NET runtime major ${runtimeMajor} is below the required ${MIN_BUNDLED_DOTNET_MAJOR}`;
|
|
44401
|
-
deps.log(`Ignoring bundled dotnet at ${exePath}: ${reason}. ` + `Falling back to the system dotnet so Helm can find a compatible runtime.`);
|
|
44402
|
-
return;
|
|
44403
|
-
}
|
|
44404
|
-
return {
|
|
44405
|
-
exePath,
|
|
44406
|
-
env: {
|
|
44407
|
-
DOTNET_ROOT: dotnetRoot,
|
|
44408
|
-
DOTNET_MULTILEVEL_LOOKUP: "0",
|
|
44409
|
-
...DOTNET_ROLL_FORWARD_ENV
|
|
44410
|
-
}
|
|
44411
|
-
};
|
|
44412
|
-
}
|
|
44413
|
-
|
|
44414
|
-
// src/resolution/feed-control.ts
|
|
44415
|
-
function resolveBundledFeedEnv(robotDir) {
|
|
44416
|
-
if (!robotDir || process.env[LOCAL_ROBOT_FEEDS_ENV]) {
|
|
44417
|
-
return {};
|
|
44418
|
-
}
|
|
44419
|
-
return { [LOCAL_ROBOT_FEEDS_ENV]: robotNugetConfigPath(robotDir) };
|
|
44420
|
-
}
|
|
44421
|
-
async function composeOrchestratorFeedsEnv(compose, log) {
|
|
44422
|
-
if (process.env[ORCHESTRATOR_RESTORE_FEEDS_ENV] || !compose) {
|
|
44423
|
-
return {};
|
|
44424
|
-
}
|
|
44425
|
-
const feedsPath = await compose(log);
|
|
44426
|
-
if (!feedsPath) {
|
|
44427
|
-
return {};
|
|
44428
|
-
}
|
|
44429
|
-
return { [ORCHESTRATOR_RESTORE_FEEDS_ENV]: feedsPath };
|
|
44430
|
-
}
|
|
44431
|
-
function toSessionConnection(status) {
|
|
44432
|
-
if (status.loginStatus !== "Logged in" || !status.accessToken || !status.baseUrl) {
|
|
44433
|
-
return;
|
|
44434
|
-
}
|
|
44435
|
-
let base = status.baseUrl;
|
|
44436
|
-
while (base.endsWith("/")) {
|
|
44437
|
-
base = base.slice(0, -1);
|
|
44438
|
-
}
|
|
44439
|
-
const segments = [];
|
|
44440
|
-
if (status.organizationName) {
|
|
44441
|
-
segments.push(status.organizationName);
|
|
44442
|
-
if (status.tenantName) {
|
|
44443
|
-
segments.push(status.tenantName);
|
|
44444
|
-
}
|
|
44445
|
-
}
|
|
44446
|
-
const cloudUrl = segments.length ? `${base}/${segments.join("/")}` : base;
|
|
44447
|
-
return {
|
|
44448
|
-
accessToken: status.accessToken,
|
|
44449
|
-
cloudUrl,
|
|
44450
|
-
tenantId: status.tenantId
|
|
44451
|
-
};
|
|
44452
|
-
}
|
|
44453
|
-
async function resolveSessionConnection() {
|
|
44454
|
-
try {
|
|
44455
|
-
const auth = await Promise.resolve().then(() => (init_dist(), exports_dist));
|
|
44456
|
-
const status = await auth.getLoginStatusAsync({
|
|
44457
|
-
ensureTokenValidityMinutes: 5
|
|
44458
|
-
});
|
|
44459
|
-
if (status.loginStatus && status.loginStatus !== "Logged in" && status.loginStatus !== "Logged out") {
|
|
44460
|
-
logger.warn(`Tenant Orchestrator feeds skipped: the login session is '${status.loginStatus}' — run 'uip login' to restore it.`);
|
|
44461
|
-
}
|
|
44462
|
-
return toSessionConnection(status);
|
|
44463
|
-
} catch {
|
|
44464
|
-
return;
|
|
44465
|
-
}
|
|
44466
|
-
}
|
|
44467
44629
|
|
|
44468
44630
|
// src/telemetry/failure-classification.ts
|
|
44469
44631
|
var NUGET_MISSING = /\bNU110[12]\b/;
|
|
@@ -44518,6 +44680,27 @@ function asTypeName(value) {
|
|
|
44518
44680
|
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
44519
44681
|
}
|
|
44520
44682
|
|
|
44683
|
+
// src/commands/packager/runtime-arch-mismatch.ts
|
|
44684
|
+
var STARTUP_CRASH = /Unhandled exception\./;
|
|
44685
|
+
var LOADER_FAULT = /BadImageFormatException|FileLoadException/;
|
|
44686
|
+
var HOST_ARCH_FAULT = /Bad CPU type in executable|ENOEXEC|EBADARCH|spawn\S*\s+\S.*\sUNKNOWN/;
|
|
44687
|
+
function looksLikeStartupFailure(rawMessage) {
|
|
44688
|
+
return STARTUP_CRASH.test(rawMessage) && LOADER_FAULT.test(rawMessage) || HOST_ARCH_FAULT.test(rawMessage);
|
|
44689
|
+
}
|
|
44690
|
+
function detectRuntimeArchMismatchFailure(label, rawMessage, probe = probeDotnetInfo) {
|
|
44691
|
+
if (!looksLikeStartupFailure(rawMessage)) {
|
|
44692
|
+
return null;
|
|
44693
|
+
}
|
|
44694
|
+
const mismatch = findRuntimeArchMismatch({
|
|
44695
|
+
dotnetPath: getPinnedDotnetPath(),
|
|
44696
|
+
probe
|
|
44697
|
+
});
|
|
44698
|
+
if (mismatch === null) {
|
|
44699
|
+
return null;
|
|
44700
|
+
}
|
|
44701
|
+
return new FailureOutput("ConfigError", `${label} failed: ${mismatch.summary.charAt(0).toLowerCase()}${mismatch.summary.slice(1)} ` + "The loader error above is that mismatch, not a problem with the project.", mismatch.remedy, undefined, "configuration_error", "RetryWillNotFix");
|
|
44702
|
+
}
|
|
44703
|
+
|
|
44521
44704
|
// src/commands/packager/packager-shared.ts
|
|
44522
44705
|
var LOG_LEVEL_NAMES = ["Debug", "Info", "Warn", "Error"];
|
|
44523
44706
|
var GOVERNANCE_FILE_TYPES = ["Default", "AutomationOps", "Studio"];
|
|
@@ -44530,7 +44713,7 @@ var OUTPUT_TYPES = [
|
|
|
44530
44713
|
"Template"
|
|
44531
44714
|
];
|
|
44532
44715
|
function addCommonPackagerOptions(cmd) {
|
|
44533
|
-
return cmd.addOption(new Option2("--log-level <level>", "Log level").choices(LOG_LEVEL_NAMES).default("Warn")).option("--exclude-configured-sources", "Exclude user/machine configured NuGet sources").option("--nuget-sources-config-path <path>", "Path to NuGet sources configuration file").addOption(new Option2("--format <format>", "Output format").choices(["table", "json", "yaml", "plain"]).argParser((val) => val.toLowerCase()).default("json"));
|
|
44716
|
+
return cmd.option("--project-dir <path>", "Path to the UiPath project directory. Alternative to the positional argument; defaults to the current directory.").addOption(new Option2("--log-level <level>", "Log level").choices(LOG_LEVEL_NAMES).default("Warn")).option("--exclude-configured-sources", "Exclude user/machine configured NuGet sources").option("--nuget-sources-config-path <path>", "Path to NuGet sources configuration file").addOption(new Option2("--format <format>", "Output format").choices(["table", "json", "yaml", "plain"]).argParser((val) => val.toLowerCase()).default("json"));
|
|
44534
44717
|
}
|
|
44535
44718
|
async function createPackager() {
|
|
44536
44719
|
await loadPackagerTool();
|
|
@@ -44563,6 +44746,9 @@ function emitAnalyzerFailureResult(projectDir, action, result) {
|
|
|
44563
44746
|
}
|
|
44564
44747
|
emitAnalyzeResult(projectDir, action, { errorCount: summary.errorCount }, summary.ruleIds);
|
|
44565
44748
|
}
|
|
44749
|
+
function resolvePackagerProjectDir(positional, option, defaultProjectDir) {
|
|
44750
|
+
return positional ?? option ?? defaultProjectDir ?? process.cwd();
|
|
44751
|
+
}
|
|
44566
44752
|
function resolveProjectInput(projectDir) {
|
|
44567
44753
|
const abs = resolve6(projectDir);
|
|
44568
44754
|
let stats;
|
|
@@ -44613,8 +44799,8 @@ function createTemporaryFeedsConfig(feeds) {
|
|
|
44613
44799
|
if (feeds.length === 0) {
|
|
44614
44800
|
return;
|
|
44615
44801
|
}
|
|
44616
|
-
const directory = mkdtempSync2(
|
|
44617
|
-
const path4 =
|
|
44802
|
+
const directory = mkdtempSync2(join13(tmpdir7(), "rpa-tool-nuget-"));
|
|
44803
|
+
const path4 = join13(directory, "nuget-feeds.json");
|
|
44618
44804
|
try {
|
|
44619
44805
|
writeFileSync2(path4, JSON.stringify(feeds));
|
|
44620
44806
|
} catch (error) {
|
|
@@ -44699,14 +44885,14 @@ async function runPackagerCommand(opts, config) {
|
|
|
44699
44885
|
return false;
|
|
44700
44886
|
}
|
|
44701
44887
|
const projectDir = resolve6(rawProjectDir);
|
|
44702
|
-
|
|
44888
|
+
const resolvedOpts = { ...opts, projectDir };
|
|
44703
44889
|
const LOGGER_LEVELS = {
|
|
44704
44890
|
Debug: LogLevel.DEBUG,
|
|
44705
44891
|
Info: LogLevel.INFO,
|
|
44706
44892
|
Warn: LogLevel.WARN,
|
|
44707
44893
|
Error: LogLevel.ERROR
|
|
44708
44894
|
};
|
|
44709
|
-
const requestedLevel = LOGGER_LEVELS[
|
|
44895
|
+
const requestedLevel = LOGGER_LEVELS[resolvedOpts.logLevel];
|
|
44710
44896
|
if (requestedLevel !== undefined && requestedLevel < logger.getLevel()) {
|
|
44711
44897
|
configureLogger({ level: requestedLevel });
|
|
44712
44898
|
}
|
|
@@ -44717,17 +44903,17 @@ async function runPackagerCommand(opts, config) {
|
|
|
44717
44903
|
}
|
|
44718
44904
|
try {
|
|
44719
44905
|
const packager = await createPackager();
|
|
44720
|
-
const setupInput = resolveProjectInput(
|
|
44906
|
+
const setupInput = resolveProjectInput(projectDir);
|
|
44721
44907
|
const inputPath = await packager.setupAsync(setupInput);
|
|
44722
|
-
const options = await buildBaseOptions(
|
|
44908
|
+
const options = await buildBaseOptions(resolvedOpts);
|
|
44723
44909
|
options.inputPath = inputPath;
|
|
44724
44910
|
options.connection = await resolveSessionConnection();
|
|
44725
|
-
const { path: feedsPath, temp } = await assembleFeedsConfig(
|
|
44911
|
+
const { path: feedsPath, temp } = await assembleFeedsConfig(resolvedOpts);
|
|
44726
44912
|
temporaryFeedsConfig = temp;
|
|
44727
44913
|
if (feedsPath) {
|
|
44728
44914
|
options.nuGetSourcesConfigPath = feedsPath;
|
|
44729
44915
|
}
|
|
44730
|
-
const result = await config.execute(packager, options,
|
|
44916
|
+
const result = await config.execute(packager, options, resolvedOpts);
|
|
44731
44917
|
const succeeded = config.isSuccessfulResult ? config.isSuccessfulResult(result) : result.isSuccess;
|
|
44732
44918
|
if (succeeded) {
|
|
44733
44919
|
const data = config.formatSuccess?.(result) ?? { Success: true };
|
|
@@ -44739,7 +44925,7 @@ async function runPackagerCommand(opts, config) {
|
|
|
44739
44925
|
} catch {}
|
|
44740
44926
|
const rawFailure = result.message ?? (result.errorCode ? `Error code: ${result.errorCode}` : "Unknown error");
|
|
44741
44927
|
const lockFailure = detectLockedProjectFilesFailure(config.label, rawFailure);
|
|
44742
|
-
const failure = lockFailure ?? new FailureOutput("Failure", `${config.label} failed: ${rawFailure}`, config.hint);
|
|
44928
|
+
const failure = lockFailure ?? detectRuntimeArchMismatchFailure(config.label, rawFailure) ?? new FailureOutput("Failure", `${config.label} failed: ${rawFailure}`, config.hint);
|
|
44743
44929
|
failure.TelemetryErrorClass = classifyFailure({
|
|
44744
44930
|
errorCode: result.errorCode,
|
|
44745
44931
|
message: rawFailure,
|
|
@@ -44750,7 +44936,7 @@ async function runPackagerCommand(opts, config) {
|
|
|
44750
44936
|
} catch (error) {
|
|
44751
44937
|
const rawFailure = error instanceof Error ? error.message : String(error);
|
|
44752
44938
|
const lockFailure = detectLockedProjectFilesFailure(config.label, rawFailure);
|
|
44753
|
-
const failure = lockFailure ?? new FailureOutput("Failure", `${config.label} failed: ${rawFailure}`, config.hint);
|
|
44939
|
+
const failure = lockFailure ?? detectRuntimeArchMismatchFailure(config.label, rawFailure) ?? new FailureOutput("Failure", `${config.label} failed: ${rawFailure}`, config.hint);
|
|
44754
44940
|
failure.TelemetryErrorClass = classifyFailure({
|
|
44755
44941
|
message: rawFailure,
|
|
44756
44942
|
isFileLock: lockFailure !== null
|
|
@@ -44763,11 +44949,12 @@ async function runPackagerCommand(opts, config) {
|
|
|
44763
44949
|
}
|
|
44764
44950
|
|
|
44765
44951
|
// src/commands/packager/analyze.ts
|
|
44766
|
-
function registerAnalyzeCommand(program4) {
|
|
44952
|
+
function registerAnalyzeCommand(program4, defaultProjectDir) {
|
|
44767
44953
|
const cmd = program4.command("analyze").description("Validate and analyze a UiPath project");
|
|
44768
|
-
cmd.argument("
|
|
44769
|
-
addCommonPackagerOptions(cmd).option("--skip-analyze", "Skip the analysis step").option("--default-severity <level>", "Default severity for analysis rules").option("--governance-file-path <path>", "Path to governance/policy rules file").addOption(new Option2("--governance-file-type <type>", "Type of governance file").choices(GOVERNANCE_FILE_TYPES)).option("--detailed-log-path <path>", "Path where detailed log file is written").option("--repository-path <path>", "Repository root for resolving relative project paths (Pipeline Analyze parity)").option("--policy-file <path>", "Analyzer policy file. Alias for --governance-file-path (Pipeline Analyze parity).").addOption(new Option2("--policy-file-type <type>", "Policy file type. Alias for --governance-file-type. " + "Defaults to AutomationOps when a policy/governance file is provided; otherwise the packager default is used.").choices(GOVERNANCE_FILE_TYPES)).trackedAction(processContext, async (
|
|
44770
|
-
|
|
44954
|
+
cmd.argument("[project-dir]", "Path to the UiPath project directory, project.json file, or .uip archive. Defaults to --project-dir, or the current directory.");
|
|
44955
|
+
addCommonPackagerOptions(cmd).option("--skip-analyze", "Skip the analysis step").option("--default-severity <level>", "Default severity for analysis rules").option("--governance-file-path <path>", "Path to governance/policy rules file").addOption(new Option2("--governance-file-type <type>", "Type of governance file").choices(GOVERNANCE_FILE_TYPES)).option("--detailed-log-path <path>", "Path where detailed log file is written").option("--repository-path <path>", "Repository root for resolving relative project paths (Pipeline Analyze parity)").option("--policy-file <path>", "Analyzer policy file. Alias for --governance-file-path (Pipeline Analyze parity).").addOption(new Option2("--policy-file-type <type>", "Policy file type. Alias for --governance-file-type. " + "Defaults to AutomationOps when a policy/governance file is provided; otherwise the packager default is used.").choices(GOVERNANCE_FILE_TYPES)).trackedAction(processContext, async (projectDirArg, opts) => {
|
|
44956
|
+
const projectDir = resolveProjectDir(projectDirArg, opts, defaultProjectDir);
|
|
44957
|
+
opts.projectDir = projectDir;
|
|
44771
44958
|
const success = await runPackagerCommand(opts, {
|
|
44772
44959
|
label: "Analyze",
|
|
44773
44960
|
hint: "Check project path and governance configuration.",
|
|
@@ -44795,7 +44982,7 @@ function registerAnalyzeCommand(program4) {
|
|
|
44795
44982
|
formatSuccess: (result) => {
|
|
44796
44983
|
const findings = extractFindings(result);
|
|
44797
44984
|
const summary = summarizeFindings(findings);
|
|
44798
|
-
emitAnalyzeResult(
|
|
44985
|
+
emitAnalyzeResult(projectDir, "analyze", {
|
|
44799
44986
|
errorCount: summary.Critical + summary.Error,
|
|
44800
44987
|
findingCount: findings.length,
|
|
44801
44988
|
warningCount: summary.Warning,
|
|
@@ -44810,19 +44997,20 @@ function registerAnalyzeCommand(program4) {
|
|
|
44810
44997
|
});
|
|
44811
44998
|
if (!success)
|
|
44812
44999
|
processContext.exit(1);
|
|
44813
|
-
}, (
|
|
44814
|
-
const dir = resolveProjectDir(
|
|
45000
|
+
}, (projectDirArg, opts) => {
|
|
45001
|
+
const dir = resolveProjectDir(projectDirArg, opts, defaultProjectDir);
|
|
44815
45002
|
return buildStudioShapedProps(dir, {
|
|
44816
45003
|
action: "analyze",
|
|
44817
45004
|
...getProjectShapeProps(dir)
|
|
44818
45005
|
});
|
|
44819
45006
|
});
|
|
44820
45007
|
}
|
|
44821
|
-
function resolveProjectDir(projectDir, opts) {
|
|
44822
|
-
|
|
44823
|
-
|
|
45008
|
+
function resolveProjectDir(projectDir, opts, defaultProjectDir) {
|
|
45009
|
+
const dir = resolvePackagerProjectDir(projectDir, opts.projectDir, defaultProjectDir);
|
|
45010
|
+
if (!opts.repositoryPath || isAbsolute6(dir)) {
|
|
45011
|
+
return dir;
|
|
44824
45012
|
}
|
|
44825
|
-
return
|
|
45013
|
+
return join14(opts.repositoryPath, dir);
|
|
44826
45014
|
}
|
|
44827
45015
|
function resolveGovernanceFileType(opts) {
|
|
44828
45016
|
if (opts.policyFileType)
|
|
@@ -44958,10 +45146,11 @@ function isRecord3(value) {
|
|
|
44958
45146
|
}
|
|
44959
45147
|
|
|
44960
45148
|
// src/commands/packager/build.ts
|
|
44961
|
-
function registerBuildCommand(program4) {
|
|
45149
|
+
function registerBuildCommand(program4, defaultProjectDir) {
|
|
44962
45150
|
const cmd = program4.command("build").description("Build (compile) a UiPath project");
|
|
44963
|
-
cmd.argument("
|
|
44964
|
-
addCommonPackagerOptions(cmd).option("--skip-analyze", "Skip the analysis step").option("--governance-file-path <path>", "Path to governance/policy rules file").addOption(new Option2("--governance-file-type <type>", "Type of governance file").choices(GOVERNANCE_FILE_TYPES)).option("--detailed-log-path <path>", "Path where detailed log file is written").trackedAction(processContext, async (
|
|
45151
|
+
cmd.argument("[project-dir]", "Path to the UiPath project directory. Defaults to --project-dir, or the current directory.");
|
|
45152
|
+
addCommonPackagerOptions(cmd).option("--skip-analyze", "Skip the analysis step").option("--governance-file-path <path>", "Path to governance/policy rules file").addOption(new Option2("--governance-file-type <type>", "Type of governance file").choices(GOVERNANCE_FILE_TYPES)).option("--detailed-log-path <path>", "Path where detailed log file is written").trackedAction(processContext, async (projectDirArg, opts) => {
|
|
45153
|
+
const projectDir = resolvePackagerProjectDir(projectDirArg, opts.projectDir, defaultProjectDir);
|
|
44965
45154
|
opts.projectDir = projectDir;
|
|
44966
45155
|
const success = await runPackagerCommand(opts, {
|
|
44967
45156
|
label: "Build",
|
|
@@ -44981,14 +45170,17 @@ function registerBuildCommand(program4) {
|
|
|
44981
45170
|
}
|
|
44982
45171
|
return packager.buildProjectAsync(options);
|
|
44983
45172
|
},
|
|
44984
|
-
onFailure: (result) => emitAnalyzerFailureResult(
|
|
45173
|
+
onFailure: (result) => emitAnalyzerFailureResult(projectDir, "build", result)
|
|
44985
45174
|
});
|
|
44986
45175
|
if (!success)
|
|
44987
45176
|
processContext.exit(1);
|
|
44988
|
-
}, (
|
|
44989
|
-
|
|
44990
|
-
|
|
44991
|
-
|
|
45177
|
+
}, (projectDirArg, opts) => {
|
|
45178
|
+
const dir = resolvePackagerProjectDir(projectDirArg, opts.projectDir, defaultProjectDir);
|
|
45179
|
+
return buildStudioShapedProps(dir, {
|
|
45180
|
+
action: "build",
|
|
45181
|
+
...getProjectShapeProps(dir)
|
|
45182
|
+
});
|
|
45183
|
+
});
|
|
44992
45184
|
}
|
|
44993
45185
|
|
|
44994
45186
|
// src/commands/packager/cleanup.ts
|
|
@@ -45004,16 +45196,17 @@ function isUipArchive(projectDir) {
|
|
|
45004
45196
|
return false;
|
|
45005
45197
|
}
|
|
45006
45198
|
}
|
|
45007
|
-
function registerCleanupCommand(program4) {
|
|
45199
|
+
function registerCleanupCommand(program4, defaultProjectDir) {
|
|
45008
45200
|
const cmd = program4.command("cleanup").description("Remove unused items from a UiPath project (modifies the project sources in place). Pass --dry-run to only detect unused items.");
|
|
45009
|
-
cmd.argument("
|
|
45201
|
+
cmd.argument("[project-dir]", "Path to the UiPath project directory, project.json file, or .uip archive (archives require --dry-run). Defaults to --project-dir, or the current directory.");
|
|
45010
45202
|
addCommonPackagerOptions(cmd).option("--dry-run", "Detect unused items but do not modify any project files.").option("--skip-imports", "Do not clean up now-unused references to removed items in the project's files.").trackedAction(processContext, async (projectDir, opts) => {
|
|
45011
|
-
|
|
45012
|
-
|
|
45203
|
+
const dir = resolvePackagerProjectDir(projectDir, opts.projectDir, defaultProjectDir);
|
|
45204
|
+
if (!opts.dryRun && isUipArchive(dir)) {
|
|
45205
|
+
OutputFormatter.error(new FailureOutput("Failure", `Cleanup failed: in-place cleanup of a .uip archive is not supported — changes would be written to a temporary extraction and then discarded, leaving '${dir}' unchanged.`, "Re-run with --dry-run to only detect unused items, or point at the project directory to modify it in place."));
|
|
45013
45206
|
processContext.exit(1);
|
|
45014
45207
|
return;
|
|
45015
45208
|
}
|
|
45016
|
-
opts.projectDir =
|
|
45209
|
+
opts.projectDir = dir;
|
|
45017
45210
|
const success = await runPackagerCommand(opts, {
|
|
45018
45211
|
label: "Cleanup",
|
|
45019
45212
|
hint: "Check the project path and that the current login has access to the tenant.",
|
|
@@ -45044,10 +45237,17 @@ function registerCleanupCommand(program4) {
|
|
|
45044
45237
|
|
|
45045
45238
|
// src/commands/packager/pack.ts
|
|
45046
45239
|
import { isAbsolute as isAbsolute7, resolve as resolve8 } from "node:path";
|
|
45047
|
-
function registerPackCommand(program4) {
|
|
45240
|
+
function registerPackCommand(program4, defaultProjectDir) {
|
|
45048
45241
|
const cmd = program4.command("pack").description("Pack a UiPath project into a .nupkg (compiles, validates, and bundles).");
|
|
45049
|
-
cmd.argument("
|
|
45050
|
-
addCommonPackagerOptions(cmd).option("--package-id <id>", "NuGet package ID").option("--package-version <version>", "NuGet package version").option("--package-author <author>", "NuGet package author").option("--package-description <desc>", "NuGet package description").option("--skip-analyze", "Skip the analysis step").option("--skip-dependency-optimization", "Skip dependency optimization").option("--include-sources", "Include source files in the package").option("--split-packages", "Split into multiple packages").option("--governance-file-path <path>", "Path to governance/policy rules file").addOption(new Option2("--governance-file-type <type>", "Type of governance file").choices(GOVERNANCE_FILE_TYPES)).option("--detailed-log-path <path>", "Path where detailed log file is written").option("--signing-certificate-path <path>", "Path to .pfx certificate file").option("--signing-certificate-password <password>", "Certificate password").option("--signing-timestamp-server <url>", "Timestamp server URL").addOption(new Option2("--output-type <type>", "Package output type (Pipeline Build parity)").choices(OUTPUT_TYPES)).option("--project-url <url>", "Project URL package metadata").option("--repository-type <type>", "Repository type package metadata").option("--repository-url <url>", "Repository URL package metadata").option("--repository-branch <branch>", "Repository branch package metadata").option("--repository-commit <commit>", "Repository commit package metadata").option("--release-notes <text>", "Package release notes").trackedAction(processContext, async (
|
|
45242
|
+
cmd.argument("[project-dir]", "Path to the UiPath project directory, project.json file, or .uip archive. Defaults to --project-dir, or the current directory.").argument("[output-path]", "Directory where .nupkg is written. Required — pass it here or as --output-path.");
|
|
45243
|
+
addCommonPackagerOptions(cmd).option("--output-path <path>", "Directory where .nupkg is written. Alternative to the positional argument; required when the positional is omitted.").option("--package-id <id>", "NuGet package ID").option("--package-version <version>", "NuGet package version").option("--package-author <author>", "NuGet package author").option("--package-description <desc>", "NuGet package description").option("--skip-analyze", "Skip the analysis step").option("--skip-dependency-optimization", "Skip dependency optimization").option("--include-sources", "Include source files in the package").option("--split-packages", "Split into multiple packages").option("--governance-file-path <path>", "Path to governance/policy rules file").addOption(new Option2("--governance-file-type <type>", "Type of governance file").choices(GOVERNANCE_FILE_TYPES)).option("--detailed-log-path <path>", "Path where detailed log file is written").option("--signing-certificate-path <path>", "Path to .pfx certificate file").option("--signing-certificate-password <password>", "Certificate password").option("--signing-timestamp-server <url>", "Timestamp server URL").addOption(new Option2("--output-type <type>", "Package output type (Pipeline Build parity)").choices(OUTPUT_TYPES)).option("--project-url <url>", "Project URL package metadata").option("--repository-type <type>", "Repository type package metadata").option("--repository-url <url>", "Repository URL package metadata").option("--repository-branch <branch>", "Repository branch package metadata").option("--repository-commit <commit>", "Repository commit package metadata").option("--release-notes <text>", "Package release notes").trackedAction(processContext, async (projectDirArg, outputPathArg, opts) => {
|
|
45244
|
+
const outputPath = outputPathArg ?? opts.outputPath;
|
|
45245
|
+
if (!outputPath) {
|
|
45246
|
+
OutputFormatter.error(new FailureOutput("Failure", "Pack failed: an output path is required.", "Pass it as the second argument (`pack <project-dir> <output-path>`) or as `--output-path <path>`. It must be a directory outside the project tree."));
|
|
45247
|
+
processContext.exit(1);
|
|
45248
|
+
return;
|
|
45249
|
+
}
|
|
45250
|
+
const projectDir = resolvePackagerProjectDir(projectDirArg, opts.projectDir, defaultProjectDir);
|
|
45051
45251
|
opts.projectDir = projectDir;
|
|
45052
45252
|
opts.outputPath = outputPath;
|
|
45053
45253
|
const absoluteOutputPath = absolutePath(outputPath);
|
|
@@ -45110,7 +45310,7 @@ function registerPackCommand(program4) {
|
|
|
45110
45310
|
const firstPackage = packages[0] ?? "";
|
|
45111
45311
|
const packagePath = firstPackage ? absolutePath(firstPackage) : "";
|
|
45112
45312
|
const packageMetadata = inferPackageMetadata(packagePath, opts.packageVersion);
|
|
45113
|
-
emitPackResult(
|
|
45313
|
+
emitPackResult(projectDir, packageMetadata);
|
|
45114
45314
|
return {
|
|
45115
45315
|
Success: true,
|
|
45116
45316
|
Packages: packages,
|
|
@@ -45121,14 +45321,17 @@ function registerPackCommand(program4) {
|
|
|
45121
45321
|
OutputType: opts.outputType ?? ""
|
|
45122
45322
|
};
|
|
45123
45323
|
},
|
|
45124
|
-
onFailure: (result) => emitAnalyzerFailureResult(
|
|
45324
|
+
onFailure: (result) => emitAnalyzerFailureResult(projectDir, "pack", result)
|
|
45125
45325
|
});
|
|
45126
45326
|
if (!success)
|
|
45127
45327
|
processContext.exit(1);
|
|
45128
|
-
}, (
|
|
45129
|
-
|
|
45130
|
-
|
|
45131
|
-
|
|
45328
|
+
}, (projectDirArg, _outputPathArg, opts) => {
|
|
45329
|
+
const dir = resolvePackagerProjectDir(projectDirArg, opts.projectDir, defaultProjectDir);
|
|
45330
|
+
return buildStudioShapedProps(dir, {
|
|
45331
|
+
action: "pack",
|
|
45332
|
+
...getProjectShapeProps(dir)
|
|
45333
|
+
});
|
|
45334
|
+
});
|
|
45132
45335
|
}
|
|
45133
45336
|
function absolutePath(filePath) {
|
|
45134
45337
|
return isAbsolute7(filePath) ? filePath : resolve8(filePath);
|
|
@@ -45170,22 +45373,23 @@ function packageFileStem(packagePath) {
|
|
|
45170
45373
|
// src/commands/packager/restore.ts
|
|
45171
45374
|
import { mkdtempSync as mkdtempSync3 } from "node:fs";
|
|
45172
45375
|
import { tmpdir as tmpdir8 } from "node:os";
|
|
45173
|
-
import { join as
|
|
45174
|
-
function registerRestoreCommand(program4) {
|
|
45376
|
+
import { join as join15 } from "node:path";
|
|
45377
|
+
function registerRestoreCommand(program4, defaultProjectDir) {
|
|
45175
45378
|
const cmd = program4.command("restore").description("Restore NuGet dependencies for a UiPath project. " + "With outputPath, additionally assembles " + "dependencies in that directory for CI/CD and air-gapped workflows where " + "dependencies must be shipped across an isolation boundary. " + "When provided, outputPath must be OUTSIDE the project directory tree.");
|
|
45176
|
-
cmd.argument("
|
|
45379
|
+
cmd.argument("[project-dir]", "Path to the UiPath project directory. Defaults to --project-dir, or the current directory.").argument("[output-path]", "Optional target directory for assembled dependencies. Must be OUTSIDE the project directory tree. Omit to restore into the shared NuGet cache only. A single positional binds to project-dir, so pass both to set an output path.");
|
|
45177
45380
|
addCommonPackagerOptions(cmd).trackedAction(processContext, async (projectDir, outputPath, opts) => {
|
|
45178
|
-
|
|
45381
|
+
const dir = resolvePackagerProjectDir(projectDir, opts.projectDir, defaultProjectDir);
|
|
45382
|
+
if (outputPath !== undefined && isWithinOrEqual(dir, outputPath)) {
|
|
45179
45383
|
OutputFormatter.error(new FailureOutput("Failure", `Restore failed: outputPath ('${outputPath}') must not be the project directory or a descendant of it.`, "Choose a target directory outside the project tree — e.g. a sibling folder used as an air-gap cache. Omit outputPath entirely to restore into the shared NuGet cache only."));
|
|
45180
45384
|
processContext.exit(1);
|
|
45181
45385
|
return;
|
|
45182
45386
|
}
|
|
45183
|
-
opts.projectDir =
|
|
45387
|
+
opts.projectDir = dir;
|
|
45184
45388
|
const success = await runPackagerCommand(opts, {
|
|
45185
45389
|
label: "Restore",
|
|
45186
45390
|
hint: "Check project path and NuGet configuration.",
|
|
45187
45391
|
execute: async (packager, options) => {
|
|
45188
|
-
options.outputPath = outputPath ?? mkdtempSync3(
|
|
45392
|
+
options.outputPath = outputPath ?? mkdtempSync3(join15(tmpdir8(), "rpa-tool-restore-"));
|
|
45189
45393
|
return packager.restoreProjectAsync(options);
|
|
45190
45394
|
}
|
|
45191
45395
|
});
|
|
@@ -45907,6 +46111,7 @@ var CLI_DERIVED_COMMANDS = [
|
|
|
45907
46111
|
"logLevel",
|
|
45908
46112
|
"skipBuild",
|
|
45909
46113
|
"profiling",
|
|
46114
|
+
"profilingMode",
|
|
45910
46115
|
"remote"
|
|
45911
46116
|
]
|
|
45912
46117
|
},
|
|
@@ -45921,6 +46126,7 @@ var CLI_DERIVED_COMMANDS = [
|
|
|
45921
46126
|
"logLevel",
|
|
45922
46127
|
"skipBuild",
|
|
45923
46128
|
"profiling",
|
|
46129
|
+
"profilingMode",
|
|
45924
46130
|
"remote",
|
|
45925
46131
|
"breakpoints"
|
|
45926
46132
|
]
|
|
@@ -45934,7 +46140,8 @@ var CLI_DERIVED_COMMANDS = [
|
|
|
45934
46140
|
"inputArguments",
|
|
45935
46141
|
"inputVariables",
|
|
45936
46142
|
"logLevel",
|
|
45937
|
-
"profiling"
|
|
46143
|
+
"profiling",
|
|
46144
|
+
"profilingMode"
|
|
45938
46145
|
]
|
|
45939
46146
|
},
|
|
45940
46147
|
{
|
|
@@ -45946,7 +46153,8 @@ var CLI_DERIVED_COMMANDS = [
|
|
|
45946
46153
|
"inputArguments",
|
|
45947
46154
|
"inputVariables",
|
|
45948
46155
|
"logLevel",
|
|
45949
|
-
"profiling"
|
|
46156
|
+
"profiling",
|
|
46157
|
+
"profilingMode"
|
|
45950
46158
|
]
|
|
45951
46159
|
},
|
|
45952
46160
|
{
|
|
@@ -46008,7 +46216,7 @@ var CLI_DERIVED_COMMANDS = [
|
|
|
46008
46216
|
{
|
|
46009
46217
|
path: ["debug", "state"],
|
|
46010
46218
|
baseTool: ToolName.RunFile,
|
|
46011
|
-
description: "State of the active debug session — Running, Paused, Suspended, Completed, or None. " + "Pass --wait-timeout-seconds to long-poll a running session for its next stable state
|
|
46219
|
+
description: "State of the active debug session — Running, Paused, Suspended, Completed, or None. " + "Pass --wait-timeout-seconds to long-poll a running session for its next stable state " + "(Helm backend only; on the Studio backend this is always an instant probe).",
|
|
46012
46220
|
lockedArgs: { command: "GetDebugState", filePath: "" },
|
|
46013
46221
|
visibleArgs: ["waitTimeoutSeconds"]
|
|
46014
46222
|
},
|
|
@@ -46019,6 +46227,13 @@ var CLI_DERIVED_COMMANDS = [
|
|
|
46019
46227
|
lockedArgs: { command: "SetBreakpoints", filePath: "" },
|
|
46020
46228
|
visibleArgs: ["breakpoints"]
|
|
46021
46229
|
},
|
|
46230
|
+
{
|
|
46231
|
+
path: ["debug", "apply-file-changes"],
|
|
46232
|
+
baseTool: ToolName.RunFile,
|
|
46233
|
+
description: "Apply on-disk activity-property edits to the paused debug session via hot-reload, so the " + "current execution picks them up without a restart. Edit the workflow file first, then name what " + "you changed with --file-changes. Returns { applied, rejected, debugState }: applied edits are live " + "(continue-retry re-runs a faulted activity with the fix), rejected ones need a session restart.",
|
|
46234
|
+
lockedArgs: { command: "ApplyFileChanges", filePath: "" },
|
|
46235
|
+
visibleArgs: ["fileChanges"]
|
|
46236
|
+
},
|
|
46022
46237
|
{
|
|
46023
46238
|
path: ["debug", "toggle-breakpoint"],
|
|
46024
46239
|
baseTool: ToolName.RunFile,
|
|
@@ -46269,7 +46484,7 @@ function addFlagToCommand(sub3, flag) {
|
|
|
46269
46484
|
}
|
|
46270
46485
|
|
|
46271
46486
|
// src/resolution/helm-npm-resolver.ts
|
|
46272
|
-
import { dirname as dirname7, join as
|
|
46487
|
+
import { dirname as dirname7, join as join16 } from "node:path";
|
|
46273
46488
|
function helmPackageName() {
|
|
46274
46489
|
const key = `${process.platform}-${process.arch}`;
|
|
46275
46490
|
switch (key) {
|
|
@@ -46292,7 +46507,7 @@ function helmPackageName() {
|
|
|
46292
46507
|
function resolveHelmFromNpm(deps) {
|
|
46293
46508
|
const localDir = process.env.HELM_LOCAL_DIR;
|
|
46294
46509
|
if (localDir) {
|
|
46295
|
-
const helmExePath2 =
|
|
46510
|
+
const helmExePath2 = join16(localDir, HELM_EXE);
|
|
46296
46511
|
if (deps.fileExists(helmExePath2)) {
|
|
46297
46512
|
deps.log(`Using local Helm from HELM_LOCAL_DIR: ${localDir}`);
|
|
46298
46513
|
return { toolsDir: localDir, helmExePath: helmExePath2 };
|
|
@@ -46306,10 +46521,10 @@ function resolveHelmFromNpm(deps) {
|
|
|
46306
46521
|
packageJsonPath = deps.resolveModule(`${packageName}/package.json`);
|
|
46307
46522
|
} catch (err2) {
|
|
46308
46523
|
const detail = err2 instanceof Error ? err2.message : String(err2);
|
|
46309
|
-
throw new Error(`Helm binary package '${packageName}' is not installed. It installs ` + "automatically as an optionalDependency of @uipath/rpa-tool
|
|
46524
|
+
throw new Error(`Helm binary package '${packageName}' is not installed. It installs ` + "automatically as an optionalDependency of @uipath/rpa-tool, gated " + "on the platform and architecture of the node that runs the " + `install — this process is ${process.platform}/${process.arch}, so ` + "a CLI installed by a node of another architecture leaves a package " + "this lookup cannot see. Check which node your PATH resolves " + `(\`${NODE_LOOKUP_HINT}\`) and reinstall the CLI with the same one ` + "you run it with. Otherwise, if you installed with --omit=optional or " + "--no-optional, reinstall without that flag, or " + `set HELM_LOCAL_DIR to a Helm tools directory. (${detail})`);
|
|
46310
46525
|
}
|
|
46311
|
-
const toolsDir =
|
|
46312
|
-
const helmExePath =
|
|
46526
|
+
const toolsDir = join16(dirname7(packageJsonPath), "tools");
|
|
46527
|
+
const helmExePath = join16(toolsDir, HELM_EXE);
|
|
46313
46528
|
if (!deps.fileExists(helmExePath)) {
|
|
46314
46529
|
throw new Error(`Helm binary not found at ${helmExePath} inside package ` + `'${packageName}'. The package may be corrupt or incomplete.`);
|
|
46315
46530
|
}
|
|
@@ -46320,8 +46535,29 @@ function resolveHelmFromNpm(deps) {
|
|
|
46320
46535
|
deps.log(`Resolved Helm from npm package: ${toolsDir} (v${version ?? "?"})`);
|
|
46321
46536
|
return { toolsDir, helmExePath, version };
|
|
46322
46537
|
}
|
|
46538
|
+
// src/resolution/instance-matching.ts
|
|
46539
|
+
function matchByProject(instances, projectDir) {
|
|
46540
|
+
const target = normalizePath(projectDir);
|
|
46541
|
+
return instances.find((i2) => i2.projectDirectory && normalizePath(i2.projectDirectory) === target);
|
|
46542
|
+
}
|
|
46543
|
+
function findAvailableInstance(instances) {
|
|
46544
|
+
return instances.find((i2) => i2.ipcEndpointName && i2.executionStatus === "Available" /* Available */);
|
|
46545
|
+
}
|
|
46546
|
+
function findIdleInstance(instances) {
|
|
46547
|
+
return instances.find((i2) => i2.ipcEndpointName && !i2.projectDirectory && i2.executionStatus === "Available" /* Available */);
|
|
46548
|
+
}
|
|
46549
|
+
function filterByBackend(instances, preference) {
|
|
46550
|
+
switch (preference) {
|
|
46551
|
+
case "helm" /* Helm */:
|
|
46552
|
+
return instances.filter((i2) => i2.backendType === "Helm" /* Helm */);
|
|
46553
|
+
case "studio" /* Studio */:
|
|
46554
|
+
return instances.filter((i2) => i2.backendType !== "Helm" /* Helm */);
|
|
46555
|
+
case "any" /* Any */:
|
|
46556
|
+
return instances;
|
|
46557
|
+
}
|
|
46558
|
+
}
|
|
46323
46559
|
// src/resolution/studio-bin-resolver.ts
|
|
46324
|
-
import { join as
|
|
46560
|
+
import { join as join17, win32 as win322 } from "node:path";
|
|
46325
46561
|
function getProcessExecutablePath(pid, deps) {
|
|
46326
46562
|
const exePath = deps.executeCommand("powershell", [
|
|
46327
46563
|
"-NoProfile",
|
|
@@ -46416,7 +46652,7 @@ function getStudioFileVersion(binDir, deps) {
|
|
|
46416
46652
|
}
|
|
46417
46653
|
}
|
|
46418
46654
|
function readManifest(binDir, filename, deps) {
|
|
46419
|
-
const manifestPath =
|
|
46655
|
+
const manifestPath = join17(binDir, filename);
|
|
46420
46656
|
try {
|
|
46421
46657
|
const content = deps.readFile(manifestPath);
|
|
46422
46658
|
return JSON.parse(content);
|
|
@@ -46429,7 +46665,7 @@ function readInteropManifest(binDir, deps) {
|
|
|
46429
46665
|
return readManifest(binDir, INTEROP_MANIFEST, deps);
|
|
46430
46666
|
}
|
|
46431
46667
|
function validateInteropSupport(binDir, deps) {
|
|
46432
|
-
const manifestPath =
|
|
46668
|
+
const manifestPath = join17(binDir, INTEROP_MANIFEST);
|
|
46433
46669
|
if (!deps.fileExists(manifestPath)) {
|
|
46434
46670
|
const version = getStudioFileVersion(binDir, deps);
|
|
46435
46671
|
throw new Error(`Studio ${version} does not support rpa-tool. Please upgrade to the latest version of UiPath Studio.`);
|
|
@@ -46438,7 +46674,7 @@ function validateInteropSupport(binDir, deps) {
|
|
|
46438
46674
|
|
|
46439
46675
|
// src/resolution/studio-startup.ts
|
|
46440
46676
|
import { chmodSync, statSync as statSync6 } from "node:fs";
|
|
46441
|
-
import { join as
|
|
46677
|
+
import { join as join18 } from "node:path";
|
|
46442
46678
|
async function waitForInstanceAvailability(processId, deps, timeoutMs = DEFAULT_TIMEOUT_MS2) {
|
|
46443
46679
|
const deadline = Date.now() + timeoutMs;
|
|
46444
46680
|
let pollCount = 0;
|
|
@@ -46460,20 +46696,20 @@ async function waitForInstanceAvailability(processId, deps, timeoutMs = DEFAULT_
|
|
|
46460
46696
|
wasStarted: false
|
|
46461
46697
|
};
|
|
46462
46698
|
}
|
|
46463
|
-
await deps.sleep(
|
|
46699
|
+
await deps.sleep(POLL_INTERVAL_MS);
|
|
46464
46700
|
}
|
|
46465
46701
|
throw new Error(`Studio instance (PID ${processId}) did not become Available within ${timeoutMs / 1000}s after ${pollCount} polls`);
|
|
46466
46702
|
}
|
|
46467
46703
|
async function startStudioAndWait(binDir, deps, timeoutMs = DEFAULT_TIMEOUT_MS2) {
|
|
46468
46704
|
const existingPids = new Set(deps.discoverInstances().instances.map((i2) => i2.processId));
|
|
46469
46705
|
deps.log(`Existing Studio PIDs: [${[...existingPids].join(", ")}]`);
|
|
46470
|
-
const exePath =
|
|
46706
|
+
const exePath = join18(binDir, STUDIO_EXE);
|
|
46471
46707
|
deps.log(`Starting Studio: ${exePath}`);
|
|
46472
46708
|
deps.spawnDetached(exePath, []);
|
|
46473
46709
|
const deadline = Date.now() + timeoutMs;
|
|
46474
46710
|
let pollCount = 0;
|
|
46475
46711
|
while (Date.now() < deadline) {
|
|
46476
|
-
await deps.sleep(
|
|
46712
|
+
await deps.sleep(POLL_INTERVAL_MS);
|
|
46477
46713
|
pollCount++;
|
|
46478
46714
|
const { instances } = deps.discoverInstances();
|
|
46479
46715
|
const allPids = instances.map((i2) => i2.processId);
|
|
@@ -46519,7 +46755,7 @@ async function startHelmAndWait(deps, timeoutMs = DEFAULT_TIMEOUT_MS2, options)
|
|
|
46519
46755
|
const bundledDotnet = resolveBundledDotnet(robotDir, deps);
|
|
46520
46756
|
const dotnetEnv = bundledDotnet?.env ?? DOTNET_ROLL_FORWARD_ENV;
|
|
46521
46757
|
if (bundledDotnet) {
|
|
46522
|
-
deps.log(`Bundled dotnet found
|
|
46758
|
+
deps.log(`Bundled dotnet found, setting DOTNET_ROOT=${bundledDotnet.env.DOTNET_ROOT}`);
|
|
46523
46759
|
} else {
|
|
46524
46760
|
deps.log("No bundled dotnet; launching Helm on PATH dotnet with DOTNET_ROLL_FORWARD=Major.");
|
|
46525
46761
|
}
|
|
@@ -46541,7 +46777,7 @@ async function startHelmAndWait(deps, timeoutMs = DEFAULT_TIMEOUT_MS2, options)
|
|
|
46541
46777
|
const deadline = Date.now() + timeoutMs;
|
|
46542
46778
|
let pollCount = 0;
|
|
46543
46779
|
while (Date.now() < deadline) {
|
|
46544
|
-
await deps.sleep(
|
|
46780
|
+
await deps.sleep(POLL_INTERVAL_MS);
|
|
46545
46781
|
pollCount++;
|
|
46546
46782
|
const { instances } = deps.discoverInstances();
|
|
46547
46783
|
const allPids = instances.map((i2) => i2.processId);
|
|
@@ -46564,10 +46800,20 @@ async function startHelmAndWait(deps, timeoutMs = DEFAULT_TIMEOUT_MS2, options)
|
|
|
46564
46800
|
};
|
|
46565
46801
|
}
|
|
46566
46802
|
}
|
|
46567
|
-
|
|
46803
|
+
const archMismatch = deps.probeDotnetInfo ? findRuntimeArchMismatch({
|
|
46804
|
+
dotnetPath: bundledDotnet?.exePath,
|
|
46805
|
+
probe: deps.probeDotnetInfo
|
|
46806
|
+
}) : null;
|
|
46807
|
+
throw new Error(`Helm did not become ready within ${timeoutMs / 1000}s after ${pollCount} polls. ` + (archMismatch ? `${archMismatch.summary} ${archMismatch.remedy}` : `Check that ${exePath} can start successfully.`));
|
|
46568
46808
|
}
|
|
46569
46809
|
|
|
46570
46810
|
// src/resolution/resolve.ts
|
|
46811
|
+
var DEBUG_SESSION_TOOLS = new Set([
|
|
46812
|
+
"StartDebugging",
|
|
46813
|
+
"StepInto",
|
|
46814
|
+
"StepOver",
|
|
46815
|
+
"StepOut"
|
|
46816
|
+
]);
|
|
46571
46817
|
async function tryMatchInstance(instances, options, requiresProject, deps) {
|
|
46572
46818
|
if (!requiresProject) {
|
|
46573
46819
|
const available = findAvailableInstance(instances);
|
|
@@ -46585,7 +46831,7 @@ async function tryMatchInstance(instances, options, requiresProject, deps) {
|
|
|
46585
46831
|
const projectMatch = matchByProject(instances, options.projectDir);
|
|
46586
46832
|
if (projectMatch) {
|
|
46587
46833
|
const isAvailable = projectMatch.ipcEndpointName && projectMatch.executionStatus === "Available" /* Available */;
|
|
46588
|
-
const isDebugging = projectMatch.ipcEndpointName && projectMatch.executionStatus === "ToolExecution" /* ToolExecution */ && projectMatch.activeToolName
|
|
46834
|
+
const isDebugging = projectMatch.ipcEndpointName && projectMatch.executionStatus === "ToolExecution" /* ToolExecution */ && DEBUG_SESSION_TOOLS.has(projectMatch.activeToolName ?? "");
|
|
46589
46835
|
if (isAvailable || isDebugging) {
|
|
46590
46836
|
deps.log(`Matched by project directory (${isDebugging ? "Debugging" : "Available"}): PID ${projectMatch.processId}`);
|
|
46591
46837
|
return {
|
|
@@ -46740,14 +46986,32 @@ async function startFresh(options, allInstances, deps) {
|
|
|
46740
46986
|
});
|
|
46741
46987
|
}
|
|
46742
46988
|
var DEFAULT_MAX_ATTEMPTS = 3;
|
|
46989
|
+
var PIPE_RECONNECT_ATTEMPTS = 5;
|
|
46990
|
+
var PIPE_RECONNECT_DELAY_MS = 200;
|
|
46991
|
+
function isPipeMissingError(err2) {
|
|
46992
|
+
return err2?.code === "ENOENT";
|
|
46993
|
+
}
|
|
46994
|
+
async function invokeWithPipeReconnect(operation, instance, deps) {
|
|
46995
|
+
for (let attempt = 1;; attempt++) {
|
|
46996
|
+
try {
|
|
46997
|
+
return await operation(instance);
|
|
46998
|
+
} catch (err2) {
|
|
46999
|
+
const isTransient = isPipeMissingError(err2) && attempt < PIPE_RECONNECT_ATTEMPTS && deps.isProcessAlive(instance.processId);
|
|
47000
|
+
if (!isTransient)
|
|
47001
|
+
throw err2;
|
|
47002
|
+
deps.log(`Pipe ${instance.ipcEndpointName} not accepting yet (ENOENT) but ` + `PID ${instance.processId} is alive; reconnecting ` + `(attempt ${attempt}/${PIPE_RECONNECT_ATTEMPTS})`);
|
|
47003
|
+
await deps.sleep(PIPE_RECONNECT_DELAY_MS);
|
|
47004
|
+
}
|
|
47005
|
+
}
|
|
47006
|
+
}
|
|
46743
47007
|
async function withStaleInstanceRetry(operation, options, deps = defaultResolverDeps, maxAttempts = DEFAULT_MAX_ATTEMPTS) {
|
|
46744
47008
|
const excludePids = new Set(options.excludePids);
|
|
46745
47009
|
for (let attempt = 1;attempt <= maxAttempts; attempt++) {
|
|
46746
47010
|
const instance = await resolveStudioInstance({ ...options, excludePids }, deps);
|
|
46747
47011
|
try {
|
|
46748
|
-
return await operation
|
|
47012
|
+
return await invokeWithPipeReconnect(operation, instance, deps);
|
|
46749
47013
|
} catch (err2) {
|
|
46750
|
-
const isRetryable = err2
|
|
47014
|
+
const isRetryable = isPipeMissingError(err2) || isStaleDependenciesError(err2);
|
|
46751
47015
|
if (isRetryable && attempt < maxAttempts) {
|
|
46752
47016
|
const reason = err2.code === "ENOENT" ? "ENOENT" : "stale dependencies";
|
|
46753
47017
|
excludePids.add(instance.processId);
|
|
@@ -46769,6 +47033,7 @@ function isStaleDependenciesError(err2) {
|
|
|
46769
47033
|
}
|
|
46770
47034
|
// src/studio_interop/HelmAuthContextProvider.ts
|
|
46771
47035
|
var DISABLE_AUTH_PUSH_ENV = "UIPATH_HELM_DISABLE_AUTH_PUSH";
|
|
47036
|
+
var ORG_SCOPED_SERVICES = ["studio", "apps", "authz"];
|
|
46772
47037
|
function isAuthPushDisabled() {
|
|
46773
47038
|
const value = process.env[DISABLE_AUTH_PUSH_ENV];
|
|
46774
47039
|
return value != null && value !== "" && value !== "0" && value.toLowerCase() !== "false";
|
|
@@ -46823,7 +47088,8 @@ class HelmAuthContextProvider {
|
|
|
46823
47088
|
organizationName: status.organizationName ?? "",
|
|
46824
47089
|
tenantId: status.tenantId ?? "",
|
|
46825
47090
|
tenantName,
|
|
46826
|
-
serviceUrls
|
|
47091
|
+
serviceUrls,
|
|
47092
|
+
orgScopedServices: ORG_SCOPED_SERVICES
|
|
46827
47093
|
});
|
|
46828
47094
|
} catch (err2) {
|
|
46829
47095
|
console.error(`[HelmAuthContextProvider] failed to push auth context: ${err2 instanceof Error ? err2.message : String(err2)}`);
|
|
@@ -46901,8 +47167,13 @@ var interop_manifest_default = {
|
|
|
46901
47167
|
"setRemoteDebuggingEnabled",
|
|
46902
47168
|
"getRemoteDebugConfig"
|
|
46903
47169
|
],
|
|
47170
|
+
IRemoteUiaSessionConfigService: [
|
|
47171
|
+
"ensureRemoteUiaSession",
|
|
47172
|
+
"stopRemoteUiaSession"
|
|
47173
|
+
],
|
|
46904
47174
|
IRunService: [
|
|
46905
|
-
"executeCommand"
|
|
47175
|
+
"executeCommand",
|
|
47176
|
+
"applyFileChanges"
|
|
46906
47177
|
],
|
|
46907
47178
|
IStudioInteropService: [
|
|
46908
47179
|
"listTools",
|
|
@@ -47200,7 +47471,7 @@ function createInterpolator(values) {
|
|
|
47200
47471
|
|
|
47201
47472
|
// src/external-cli/discovery.ts
|
|
47202
47473
|
import { existsSync as existsSync7, readFileSync as readFileSync8 } from "node:fs";
|
|
47203
|
-
import { join as
|
|
47474
|
+
import { join as join19 } from "node:path";
|
|
47204
47475
|
|
|
47205
47476
|
class MissingAllDependenciesError extends Error {
|
|
47206
47477
|
projectDir;
|
|
@@ -47235,7 +47506,7 @@ var defaultDeps = {
|
|
|
47235
47506
|
readFile: (path4) => readFileSync8(path4, "utf-8")
|
|
47236
47507
|
};
|
|
47237
47508
|
function discoverPackageRoot(params, deps = defaultDeps) {
|
|
47238
|
-
const depsFile =
|
|
47509
|
+
const depsFile = join19(params.projectDir, ".local", "AllDependencies.json");
|
|
47239
47510
|
if (!deps.fileExists(depsFile)) {
|
|
47240
47511
|
throw new MissingAllDependenciesError(params.projectDir, depsFile);
|
|
47241
47512
|
}
|
|
@@ -47245,7 +47516,7 @@ function discoverPackageRoot(params, deps = defaultDeps) {
|
|
|
47245
47516
|
if (packageFolders.length === 0) {
|
|
47246
47517
|
throw new Error("No packageFolders found in AllDependencies.json.");
|
|
47247
47518
|
}
|
|
47248
|
-
const packageRoot =
|
|
47519
|
+
const packageRoot = join19(packageFolders[0], library.path);
|
|
47249
47520
|
if (!deps.fileExists(packageRoot)) {
|
|
47250
47521
|
throw new PackageRootMissingError(packageRoot);
|
|
47251
47522
|
}
|
|
@@ -47271,7 +47542,7 @@ import {
|
|
|
47271
47542
|
statSync as statSync7,
|
|
47272
47543
|
writeFileSync as writeFileSync3
|
|
47273
47544
|
} from "node:fs";
|
|
47274
|
-
import { dirname as dirname8, join as
|
|
47545
|
+
import { dirname as dirname8, join as join20 } from "node:path";
|
|
47275
47546
|
var defaultDeps2 = {
|
|
47276
47547
|
fileExists: existsSync8,
|
|
47277
47548
|
readFile: (path4) => readFileSync9(path4, "utf-8"),
|
|
@@ -47282,8 +47553,8 @@ var defaultDeps2 = {
|
|
|
47282
47553
|
getModifiedTime: (path4) => statSync7(path4).mtimeMs
|
|
47283
47554
|
};
|
|
47284
47555
|
function discoverPackageRootCached(params, deps = defaultDeps2) {
|
|
47285
|
-
const cacheFilePath =
|
|
47286
|
-
const allDepsPath =
|
|
47556
|
+
const cacheFilePath = join20(params.projectDir, ".local", "rpa-tool", `${params.commandName}.json`);
|
|
47557
|
+
const allDepsPath = join20(params.projectDir, ".local", "AllDependencies.json");
|
|
47287
47558
|
let entry;
|
|
47288
47559
|
if (deps.fileExists(cacheFilePath)) {
|
|
47289
47560
|
try {
|
|
@@ -47379,9 +47650,9 @@ function spawnCapture(exePath, args, env) {
|
|
|
47379
47650
|
}
|
|
47380
47651
|
|
|
47381
47652
|
// src/external-cli/manifest-reader.ts
|
|
47382
|
-
import { execFileSync as
|
|
47653
|
+
import { execFileSync as execFileSync9 } from "node:child_process";
|
|
47383
47654
|
import { existsSync as existsSync9, readFileSync as readFileSync10 } from "node:fs";
|
|
47384
|
-
import { join as
|
|
47655
|
+
import { join as join21 } from "node:path";
|
|
47385
47656
|
|
|
47386
47657
|
// src/external-cli/manifest-platform.ts
|
|
47387
47658
|
function isOnPlatform(entry, platformKey) {
|
|
@@ -47432,7 +47703,7 @@ var defaultDeps3 = {
|
|
|
47432
47703
|
};
|
|
47433
47704
|
function isRosettaTranslated() {
|
|
47434
47705
|
try {
|
|
47435
|
-
return
|
|
47706
|
+
return execFileSync9("sysctl", ["-in", "sysctl.proc_translated"], {
|
|
47436
47707
|
encoding: "utf-8"
|
|
47437
47708
|
}).trim() === "1";
|
|
47438
47709
|
} catch {
|
|
@@ -47480,7 +47751,7 @@ function resolveExecutableRelativePath(manifest, manifestPath, platformKey) {
|
|
|
47480
47751
|
throw new Error(`Manifest ${manifestPath} declares neither 'tool.executable' nor 'tool.executables'.`);
|
|
47481
47752
|
}
|
|
47482
47753
|
function readCliManifest(packageRoot, deps = defaultDeps3) {
|
|
47483
|
-
const manifestPath =
|
|
47754
|
+
const manifestPath = join21(packageRoot, MANIFEST_FILENAME);
|
|
47484
47755
|
if (!deps.fileExists(manifestPath)) {
|
|
47485
47756
|
throw new Error(`CLI manifest not found at ${manifestPath}. ` + `Ensure the package includes a ${MANIFEST_FILENAME} file.`);
|
|
47486
47757
|
}
|
|
@@ -47495,7 +47766,7 @@ function readCliManifest(packageRoot, deps = defaultDeps3) {
|
|
|
47495
47766
|
}
|
|
47496
47767
|
const platformKey = (deps.getPlatformKey ?? getCurrentPlatformKey)();
|
|
47497
47768
|
const relExe = resolveExecutableRelativePath(manifest, manifestPath, platformKey);
|
|
47498
|
-
const exePath =
|
|
47769
|
+
const exePath = join21(packageRoot, relExe);
|
|
47499
47770
|
if (!deps.fileExists(exePath)) {
|
|
47500
47771
|
throw new Error(`Executable not found at ${exePath} as declared in ${manifestPath}.`);
|
|
47501
47772
|
}
|
|
@@ -47593,6 +47864,10 @@ function registerCommand(parent, exePath, projectDir, cmd, config, deps, command
|
|
|
47593
47864
|
addFlagToCommand2(sub3, flag, interpolate);
|
|
47594
47865
|
}
|
|
47595
47866
|
attachWrapperOptions(sub3);
|
|
47867
|
+
const manifestDeclaresRemote = sub3.options.some((o) => o.long === "--remote");
|
|
47868
|
+
if (config.supportsRemote && !manifestDeclaresRemote) {
|
|
47869
|
+
sub3.addOption(new Option2("--remote", "Run against the remote unattended robot configured with `rpa remote configure` " + "instead of the local machine. The remote design-experience session is started on first use and reused."));
|
|
47870
|
+
}
|
|
47596
47871
|
const usagePattern = buildUsagePattern(flags, positionals);
|
|
47597
47872
|
if (usagePattern)
|
|
47598
47873
|
sub3.usage(usagePattern);
|
|
@@ -47601,15 +47876,27 @@ function registerCommand(parent, exePath, projectDir, cmd, config, deps, command
|
|
|
47601
47876
|
const opts = actionArgs[actionArgs.length - 2] ?? {};
|
|
47602
47877
|
const positionalValues = actionArgs.slice(0, actionArgs.length - 2);
|
|
47603
47878
|
const effectiveProjectDir = opts.projectDir ?? projectDir;
|
|
47604
|
-
const
|
|
47605
|
-
|
|
47606
|
-
|
|
47879
|
+
const argvFormat = opts.format ?? defaultFormat;
|
|
47880
|
+
const requestedFormat = argvFormat ?? hostRequestedFormat();
|
|
47881
|
+
if (requestedFormat && !supportsFormat) {
|
|
47882
|
+
const flag = argvFormat ? "--format" : "--output";
|
|
47883
|
+
OutputFormatter.error(new FailureOutput("Failure", `Command '${currentPath.join(" ")}' does not support ${flag}.`, `'${config.commandName}' relays this command's output from the external CLI ` + `unchanged, so its format cannot be changed. Re-run without ${flag}.`));
|
|
47884
|
+
processContext.exit(1);
|
|
47885
|
+
return;
|
|
47886
|
+
}
|
|
47887
|
+
if (opts.remote === true) {
|
|
47888
|
+
if (!deps.setupRemoteSession) {
|
|
47889
|
+
throw new Error("'--remote' is not available in this context (no Studio/Helm session).");
|
|
47890
|
+
}
|
|
47891
|
+
await deps.setupRemoteSession(effectiveProjectDir);
|
|
47607
47892
|
}
|
|
47608
47893
|
const run = async () => {
|
|
47609
47894
|
const env = deps.resolveEnv?.();
|
|
47610
47895
|
if (supportsFormat) {
|
|
47611
47896
|
const { format: _stripped, ...forwardOpts } = opts;
|
|
47612
47897
|
const args = buildArgs(currentPath, positionalValues, forwardOpts, cmd, config, effectiveProjectDir, "json");
|
|
47898
|
+
if (opts.remote === true && !manifestDeclaresRemote)
|
|
47899
|
+
args.push("--remote");
|
|
47613
47900
|
const result = await deps.spawnCapture(exePath, args, env);
|
|
47614
47901
|
renderCapturedOutput(result);
|
|
47615
47902
|
if (result.exitCode !== 0) {
|
|
@@ -47617,6 +47904,8 @@ function registerCommand(parent, exePath, projectDir, cmd, config, deps, command
|
|
|
47617
47904
|
}
|
|
47618
47905
|
} else {
|
|
47619
47906
|
const args = buildArgs(currentPath, positionalValues, opts, cmd, config, effectiveProjectDir);
|
|
47907
|
+
if (opts.remote === true && !manifestDeclaresRemote)
|
|
47908
|
+
args.push("--remote");
|
|
47620
47909
|
const exitCode = await deps.spawnForward(exePath, args, env);
|
|
47621
47910
|
if (exitCode !== 0) {
|
|
47622
47911
|
processContext.exit(exitCode);
|
|
@@ -47730,6 +48019,9 @@ function addFlagToCommand2(sub3, flag, interpolate) {
|
|
|
47730
48019
|
opt.hideHelp();
|
|
47731
48020
|
sub3.addOption(opt);
|
|
47732
48021
|
}
|
|
48022
|
+
function hostRequestedFormat() {
|
|
48023
|
+
return getOutputFormatExplicit() ? getOutputFormat() : undefined;
|
|
48024
|
+
}
|
|
47733
48025
|
function commandSupportsFormat(cmd, config) {
|
|
47734
48026
|
if (!config.injectFormat)
|
|
47735
48027
|
return false;
|
|
@@ -47773,7 +48065,17 @@ function resolveDeps(_projectDir, config, partial, session, runtime) {
|
|
|
47773
48065
|
openProject: partial?.openProject ?? (session ? (dir, operation) => session.execute(async () => {
|
|
47774
48066
|
await operation();
|
|
47775
48067
|
}, { projectDir: dir, backend: "helm" /* Helm */ }) : undefined),
|
|
47776
|
-
resolveEnv: partial?.resolveEnv ?? buildBundledDotnetEnvResolver(runtime)
|
|
48068
|
+
resolveEnv: partial?.resolveEnv ?? buildBundledDotnetEnvResolver(runtime),
|
|
48069
|
+
setupRemoteSession: partial?.setupRemoteSession ?? (session ? (dir) => session.execute(async (instance) => {
|
|
48070
|
+
if (instance.backendType !== "Helm" /* Helm */) {
|
|
48071
|
+
throw new Error("'--remote' for this tool is only supported on the Helm backend.");
|
|
48072
|
+
}
|
|
48073
|
+
const json3 = await instance.helmServices.remoteUiaSessionConfig.ensureRemoteUiaSession();
|
|
48074
|
+
const result = JSON.parse(json3);
|
|
48075
|
+
if (result.success !== true) {
|
|
48076
|
+
throw new Error(result.error ?? "Failed to set up the remote UIA session.");
|
|
48077
|
+
}
|
|
48078
|
+
}, { projectDir: dir, backend: "helm" /* Helm */ }) : undefined)
|
|
47777
48079
|
};
|
|
47778
48080
|
}
|
|
47779
48081
|
function buildBundledDotnetEnvResolver(runtime) {
|
|
@@ -47871,7 +48173,10 @@ class CloudClient {
|
|
|
47871
48173
|
auth.getTenantName()
|
|
47872
48174
|
]);
|
|
47873
48175
|
return `${environment}/${organizationName}/${tenantName}`;
|
|
47874
|
-
}, {
|
|
48176
|
+
}, {
|
|
48177
|
+
requiresProject: false,
|
|
48178
|
+
backend: "helm" /* Helm */
|
|
48179
|
+
}).catch((e) => {
|
|
47875
48180
|
this._cachedBaseUrl = null;
|
|
47876
48181
|
throw e;
|
|
47877
48182
|
});
|
|
@@ -47894,7 +48199,10 @@ class CloudClient {
|
|
|
47894
48199
|
Authorization: accessToken,
|
|
47895
48200
|
"X-Uipath-Tenantid": tenantId
|
|
47896
48201
|
};
|
|
47897
|
-
}, {
|
|
48202
|
+
}, {
|
|
48203
|
+
requiresProject: false,
|
|
48204
|
+
backend: "helm" /* Helm */
|
|
48205
|
+
}).then((headers2) => {
|
|
47898
48206
|
this._authExpiresAt = parseJwtExpiration(headers2.Authorization);
|
|
47899
48207
|
return headers2;
|
|
47900
48208
|
}).catch((e) => {
|
|
@@ -48290,6 +48598,7 @@ function configureRemoteRobotTool(session) {
|
|
|
48290
48598
|
|
|
48291
48599
|
// src/tools/local/create-project.ts
|
|
48292
48600
|
init_dist3();
|
|
48601
|
+
import { resolve as resolve10 } from "node:path";
|
|
48293
48602
|
|
|
48294
48603
|
// node_modules/@uipath/solution-sdk/dist/index.js
|
|
48295
48604
|
import { createRequire as createRequire7 } from "node:module";
|
|
@@ -48310,7 +48619,7 @@ import process45 from "node:process";
|
|
|
48310
48619
|
import { execFile as execFile35 } from "node:child_process";
|
|
48311
48620
|
import process55 from "node:process";
|
|
48312
48621
|
import { promisify as promisify45 } from "node:util";
|
|
48313
|
-
import { execFile as execFile45, execFileSync as
|
|
48622
|
+
import { execFile as execFile45, execFileSync as execFileSync10 } from "node:child_process";
|
|
48314
48623
|
import { promisify as promisify55 } from "node:util";
|
|
48315
48624
|
import { execFile as execFile55 } from "node:child_process";
|
|
48316
48625
|
import { promisify as promisify65 } from "node:util";
|
|
@@ -59379,7 +59688,7 @@ function createProjectTool(session) {
|
|
|
59379
59688
|
},
|
|
59380
59689
|
location: {
|
|
59381
59690
|
type: "string",
|
|
59382
|
-
description: "Parent directory where the project folder will be created"
|
|
59691
|
+
description: "Parent directory where the project folder will be created. " + "Relative paths resolve against the CLI's working directory."
|
|
59383
59692
|
},
|
|
59384
59693
|
description: {
|
|
59385
59694
|
type: "string",
|
|
@@ -59420,7 +59729,7 @@ function createProjectTool(session) {
|
|
|
59420
59729
|
const request = {
|
|
59421
59730
|
templateId: args.templateId ?? "BlankTemplate",
|
|
59422
59731
|
name: args.name,
|
|
59423
|
-
location: args.location ?? process.cwd(),
|
|
59732
|
+
location: resolve10(args.location ?? process.cwd()),
|
|
59424
59733
|
description: args.description ?? undefined,
|
|
59425
59734
|
expressionLanguage: args.expressionLanguage ?? undefined,
|
|
59426
59735
|
targetFramework: args.targetFramework ?? undefined,
|
|
@@ -59479,12 +59788,12 @@ function createProjectTool(session) {
|
|
|
59479
59788
|
}
|
|
59480
59789
|
|
|
59481
59790
|
// src/tools/local/diff.ts
|
|
59482
|
-
import { isAbsolute as isAbsolute9, resolve as
|
|
59791
|
+
import { isAbsolute as isAbsolute9, resolve as resolve11 } from "node:path";
|
|
59483
59792
|
function toAbsoluteFilePath(filePath, projectDir) {
|
|
59484
59793
|
if (isAbsolute9(filePath)) {
|
|
59485
59794
|
return filePath;
|
|
59486
59795
|
}
|
|
59487
|
-
return projectDir ?
|
|
59796
|
+
return projectDir ? resolve11(projectDir, filePath) : resolve11(filePath);
|
|
59488
59797
|
}
|
|
59489
59798
|
function diffTool(session) {
|
|
59490
59799
|
return createToolHandler(session, {
|
|
@@ -60027,7 +60336,7 @@ function getDefaultActivityXamlTool(session) {
|
|
|
60027
60336
|
|
|
60028
60337
|
// src/tools/local/get-errors.ts
|
|
60029
60338
|
import { existsSync as existsSync11 } from "node:fs";
|
|
60030
|
-
import { isAbsolute as isAbsolute10, resolve as
|
|
60339
|
+
import { isAbsolute as isAbsolute10, resolve as resolve12 } from "node:path";
|
|
60031
60340
|
var SEVERITIES = ["error", "warning", "info", "verbose"];
|
|
60032
60341
|
var LEVEL_BY_NAME = Object.fromEntries(SEVERITIES.map((name, i3) => [name, i3 + 1]));
|
|
60033
60342
|
var NAME_BY_LEVEL = Object.fromEntries(SEVERITIES.map((name, i3) => [i3 + 1, name]));
|
|
@@ -60085,7 +60394,7 @@ function resolveTargetedFile(filePath, projectDir) {
|
|
|
60085
60394
|
if (isAbsolute10(filePath)) {
|
|
60086
60395
|
return filePath;
|
|
60087
60396
|
}
|
|
60088
|
-
return projectDir !== undefined ?
|
|
60397
|
+
return projectDir !== undefined ? resolve12(projectDir, filePath) : undefined;
|
|
60089
60398
|
}
|
|
60090
60399
|
function getErrorsTool(session) {
|
|
60091
60400
|
return createToolHandler(session, {
|
|
@@ -61079,7 +61388,7 @@ function listWorkflowExamplesTool(client) {
|
|
|
61079
61388
|
definition: {
|
|
61080
61389
|
name: ToolName.ListWorkflowExamples,
|
|
61081
61390
|
title: "List Workflow Examples",
|
|
61082
|
-
description: "List RPA workflow examples
|
|
61391
|
+
description: "List RPA workflow examples, optionally narrowed by service tags " + "(e.g. confluence, jira, salesforce, outlook, gmail, slack) or by path " + "prefix. With no filters it returns the first `limit` examples in the " + "catalogue. Each match can be retrieved by key via `workflow-examples get`.",
|
|
61083
61392
|
requiresProject: false,
|
|
61084
61393
|
inputSchema: {
|
|
61085
61394
|
type: "object",
|
|
@@ -61087,7 +61396,7 @@ function listWorkflowExamplesTool(client) {
|
|
|
61087
61396
|
tags: {
|
|
61088
61397
|
type: "array",
|
|
61089
61398
|
items: { type: "string" },
|
|
61090
|
-
description: "Service tags to filter examples by. " + 'Use lowercase service names, e.g. ["web"] or ["confluence"] or ["salesforce", "outlook"].' + "The more tags provided, the more narrowed-down the search results will be (AND logic)."
|
|
61399
|
+
description: "Service tags to filter examples by; omit to list without a tag filter. " + 'Use lowercase service names, e.g. ["web"] or ["confluence"] or ["salesforce", "outlook"].' + "The more tags provided, the more narrowed-down the search results will be (AND logic)."
|
|
61091
61400
|
},
|
|
61092
61401
|
prefix: {
|
|
61093
61402
|
type: "string",
|
|
@@ -61098,28 +61407,13 @@ function listWorkflowExamplesTool(client) {
|
|
|
61098
61407
|
description: "Maximum number of examples to return. Defaults to 10, max 100.",
|
|
61099
61408
|
default: 10
|
|
61100
61409
|
}
|
|
61101
|
-
}
|
|
61102
|
-
required: ["tags"]
|
|
61410
|
+
}
|
|
61103
61411
|
}
|
|
61104
61412
|
},
|
|
61105
61413
|
async execute(args) {
|
|
61106
|
-
const tags = args.tags;
|
|
61414
|
+
const tags = args.tags ?? [];
|
|
61107
61415
|
const prefix = args.prefix;
|
|
61108
61416
|
const limit = args.limit || 10;
|
|
61109
|
-
if (!tags || tags.length === 0) {
|
|
61110
|
-
return {
|
|
61111
|
-
content: [
|
|
61112
|
-
{
|
|
61113
|
-
type: "text",
|
|
61114
|
-
text: JSON.stringify({
|
|
61115
|
-
success: false,
|
|
61116
|
-
errorMessage: "At least one tag is required."
|
|
61117
|
-
})
|
|
61118
|
-
}
|
|
61119
|
-
],
|
|
61120
|
-
isError: true
|
|
61121
|
-
};
|
|
61122
|
-
}
|
|
61123
61417
|
try {
|
|
61124
61418
|
const params = buildSearchQueryParams(tags, prefix, limit);
|
|
61125
61419
|
const response = await client.get(`${AGENTIC_LOOP_PATH}/v1/blobs/${CONTAINER_NAME}?${params}`);
|
|
@@ -61128,7 +61422,7 @@ function listWorkflowExamplesTool(client) {
|
|
|
61128
61422
|
content: [
|
|
61129
61423
|
{
|
|
61130
61424
|
type: "text",
|
|
61131
|
-
text: `No workflow examples found
|
|
61425
|
+
text: `No workflow examples found${describeFilters(tags, prefix)}`
|
|
61132
61426
|
}
|
|
61133
61427
|
]
|
|
61134
61428
|
};
|
|
@@ -61168,6 +61462,13 @@ function listWorkflowExamplesTool(client) {
|
|
|
61168
61462
|
}
|
|
61169
61463
|
};
|
|
61170
61464
|
}
|
|
61465
|
+
function describeFilters(tags, prefix) {
|
|
61466
|
+
const filters = [
|
|
61467
|
+
tags.length > 0 ? `tags: ${tags.join(", ")}` : null,
|
|
61468
|
+
prefix ? `prefix: ${prefix}` : null
|
|
61469
|
+
].filter((filter) => filter !== null);
|
|
61470
|
+
return filters.length > 0 ? ` for ${filters.join(", ")}` : ".";
|
|
61471
|
+
}
|
|
61171
61472
|
function buildSearchQueryParams(tags, prefix, limit) {
|
|
61172
61473
|
const params = new URLSearchParams;
|
|
61173
61474
|
for (const tag of tags) {
|
|
@@ -61240,11 +61541,221 @@ function openProjectTool(session) {
|
|
|
61240
61541
|
});
|
|
61241
61542
|
}
|
|
61242
61543
|
|
|
61544
|
+
// src/executor/RpaExecutorService.ts
|
|
61545
|
+
init_dist3();
|
|
61546
|
+
|
|
61547
|
+
// node_modules/@uipath/project-executor/dist/index.js
|
|
61548
|
+
var RunTarget;
|
|
61549
|
+
((RunTarget2) => {
|
|
61550
|
+
RunTarget2["Online"] = "Online";
|
|
61551
|
+
RunTarget2["Local"] = "Local";
|
|
61552
|
+
})(RunTarget ||= {});
|
|
61553
|
+
var RunStatus;
|
|
61554
|
+
((RunStatus2) => {
|
|
61555
|
+
RunStatus2["Pending"] = "Pending";
|
|
61556
|
+
RunStatus2["Running"] = "Running";
|
|
61557
|
+
RunStatus2["Succeeded"] = "Succeeded";
|
|
61558
|
+
RunStatus2["Faulted"] = "Faulted";
|
|
61559
|
+
RunStatus2["Cancelled"] = "Cancelled";
|
|
61560
|
+
RunStatus2["Suspended"] = "Suspended";
|
|
61561
|
+
RunStatus2["Unknown"] = "Unknown";
|
|
61562
|
+
})(RunStatus ||= {});
|
|
61563
|
+
var TERMINAL_RUN_STATUSES = [
|
|
61564
|
+
"Succeeded",
|
|
61565
|
+
"Faulted",
|
|
61566
|
+
"Cancelled"
|
|
61567
|
+
];
|
|
61568
|
+
function isTerminalRunStatus(status) {
|
|
61569
|
+
return TERMINAL_RUN_STATUSES.includes(status);
|
|
61570
|
+
}
|
|
61571
|
+
var RunErrorCode;
|
|
61572
|
+
((RunErrorCode2) => {
|
|
61573
|
+
RunErrorCode2["None"] = "None";
|
|
61574
|
+
RunErrorCode2["InvalidInput"] = "InvalidInput";
|
|
61575
|
+
RunErrorCode2["UnsupportedProjectType"] = "UnsupportedProjectType";
|
|
61576
|
+
RunErrorCode2["Unauthorized"] = "Unauthorized";
|
|
61577
|
+
RunErrorCode2["PrepareFailed"] = "PrepareFailed";
|
|
61578
|
+
RunErrorCode2["StartFailed"] = "StartFailed";
|
|
61579
|
+
RunErrorCode2["ExecutionFailed"] = "ExecutionFailed";
|
|
61580
|
+
RunErrorCode2["Timeout"] = "Timeout";
|
|
61581
|
+
RunErrorCode2["Cancelled"] = "Cancelled";
|
|
61582
|
+
RunErrorCode2["Unknown"] = "Unknown";
|
|
61583
|
+
})(RunErrorCode ||= {});
|
|
61584
|
+
|
|
61585
|
+
class RunResult {
|
|
61586
|
+
status;
|
|
61587
|
+
errorCode;
|
|
61588
|
+
rawStatus;
|
|
61589
|
+
message;
|
|
61590
|
+
jobKey;
|
|
61591
|
+
instanceId;
|
|
61592
|
+
runId;
|
|
61593
|
+
traceId;
|
|
61594
|
+
steps;
|
|
61595
|
+
output;
|
|
61596
|
+
url;
|
|
61597
|
+
details;
|
|
61598
|
+
constructor(status, errorCode2 = "None", message) {
|
|
61599
|
+
this.status = status;
|
|
61600
|
+
this.errorCode = errorCode2;
|
|
61601
|
+
this.message = message;
|
|
61602
|
+
}
|
|
61603
|
+
get isSuccess() {
|
|
61604
|
+
return this.status === "Succeeded" && this.errorCode === "None";
|
|
61605
|
+
}
|
|
61606
|
+
get isTerminal() {
|
|
61607
|
+
return isTerminalRunStatus(this.status);
|
|
61608
|
+
}
|
|
61609
|
+
static succeeded(init = {}) {
|
|
61610
|
+
return Object.assign(new RunResult("Succeeded", "None"), init);
|
|
61611
|
+
}
|
|
61612
|
+
static failed(errorCode2, message, init = {}) {
|
|
61613
|
+
return Object.assign(new RunResult("Faulted", errorCode2, message), init);
|
|
61614
|
+
}
|
|
61615
|
+
}
|
|
61616
|
+
var noopExecutorLogger = {
|
|
61617
|
+
info: () => {},
|
|
61618
|
+
warn: () => {},
|
|
61619
|
+
error: () => {}
|
|
61620
|
+
};
|
|
61621
|
+
class ExecutorsFactoryRepository {
|
|
61622
|
+
factoryMap = new Map;
|
|
61623
|
+
onConflict;
|
|
61624
|
+
constructor(onConflict) {
|
|
61625
|
+
this.onConflict = onConflict ?? ((message) => console.warn(message));
|
|
61626
|
+
}
|
|
61627
|
+
registerProjectExecutorFactory(factory) {
|
|
61628
|
+
for (const projectType of factory.supportedTypes) {
|
|
61629
|
+
const existing = this.factoryMap.get(projectType);
|
|
61630
|
+
if (existing) {
|
|
61631
|
+
if (existing.constructor?.name !== factory.constructor?.name) {
|
|
61632
|
+
this.onConflict(`Executor factory conflict for project type '${projectType}': ` + `'${existing.constructor?.name}' already registered, ` + `ignoring '${factory.constructor?.name}'.`);
|
|
61633
|
+
}
|
|
61634
|
+
continue;
|
|
61635
|
+
}
|
|
61636
|
+
this.factoryMap.set(projectType, factory);
|
|
61637
|
+
}
|
|
61638
|
+
}
|
|
61639
|
+
canHandleProject(projectType) {
|
|
61640
|
+
return this.factoryMap.has(projectType);
|
|
61641
|
+
}
|
|
61642
|
+
getProjectExecutorFactory(projectType) {
|
|
61643
|
+
const factory = this.factoryMap.get(projectType);
|
|
61644
|
+
if (!factory) {
|
|
61645
|
+
throw new Error(`No executor is registered for project type '${projectType}'. ` + `Registered types: ${this.registeredTypes.join(", ") || "none"}.`);
|
|
61646
|
+
}
|
|
61647
|
+
return factory;
|
|
61648
|
+
}
|
|
61649
|
+
get registeredTypes() {
|
|
61650
|
+
return [...this.factoryMap.keys()];
|
|
61651
|
+
}
|
|
61652
|
+
reset() {
|
|
61653
|
+
this.factoryMap.clear();
|
|
61654
|
+
}
|
|
61655
|
+
}
|
|
61656
|
+
var REGISTRY_KEY2 = Symbol.for("@uipath/project-executor/executorsFactoryRepository");
|
|
61657
|
+
var _global2 = globalThis;
|
|
61658
|
+
if (!_global2[REGISTRY_KEY2]) {
|
|
61659
|
+
_global2[REGISTRY_KEY2] = new ExecutorsFactoryRepository;
|
|
61660
|
+
}
|
|
61661
|
+
var executorsFactoryRepository = _global2[REGISTRY_KEY2];
|
|
61662
|
+
|
|
61663
|
+
class ProjectExecutor {
|
|
61664
|
+
fileSystem;
|
|
61665
|
+
logger;
|
|
61666
|
+
constructor(fileSystem, logger4) {
|
|
61667
|
+
this.fileSystem = fileSystem;
|
|
61668
|
+
this.logger = logger4;
|
|
61669
|
+
}
|
|
61670
|
+
runAsync(_options, _cancellationToken) {
|
|
61671
|
+
return Promise.resolve(RunResult.failed("UnsupportedProjectType", `${this.constructor.name} does not support run.`));
|
|
61672
|
+
}
|
|
61673
|
+
async resolveDefaultEntryPoint(projectPath) {
|
|
61674
|
+
const entryPointsFile = this.fileSystem.path.join(projectPath, ENTRY_POINTS_FILE_NAME);
|
|
61675
|
+
try {
|
|
61676
|
+
const raw = await this.fileSystem.readFile(entryPointsFile, "utf-8");
|
|
61677
|
+
if (!raw) {
|
|
61678
|
+
return;
|
|
61679
|
+
}
|
|
61680
|
+
const declared = JSON.parse(raw).entryPoints;
|
|
61681
|
+
return this.firstDeclaredEntryPoint(declared);
|
|
61682
|
+
} catch (error) {
|
|
61683
|
+
this.logger.warn(`Could not read the default entry point from ${entryPointsFile}: ${error instanceof Error ? error.message : String(error)}`);
|
|
61684
|
+
return;
|
|
61685
|
+
}
|
|
61686
|
+
}
|
|
61687
|
+
asEntryPoint(value) {
|
|
61688
|
+
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
61689
|
+
}
|
|
61690
|
+
firstDeclaredEntryPoint(entryPoints) {
|
|
61691
|
+
if (!Array.isArray(entryPoints)) {
|
|
61692
|
+
return;
|
|
61693
|
+
}
|
|
61694
|
+
for (const entry of entryPoints) {
|
|
61695
|
+
const filePath = this.asEntryPoint(entry?.filePath);
|
|
61696
|
+
if (filePath) {
|
|
61697
|
+
return filePath;
|
|
61698
|
+
}
|
|
61699
|
+
}
|
|
61700
|
+
return;
|
|
61701
|
+
}
|
|
61702
|
+
dispose() {
|
|
61703
|
+
return Promise.resolve();
|
|
61704
|
+
}
|
|
61705
|
+
}
|
|
61706
|
+
var ENTRY_POINTS_FILE_NAME = "entry-points.json";
|
|
61707
|
+
|
|
61708
|
+
class ProjectRunner {
|
|
61709
|
+
fileSystem;
|
|
61710
|
+
logger;
|
|
61711
|
+
registry;
|
|
61712
|
+
constructor(deps) {
|
|
61713
|
+
this.fileSystem = deps.fileSystem;
|
|
61714
|
+
this.logger = deps.logger ?? noopExecutorLogger;
|
|
61715
|
+
this.registry = deps.registry ?? executorsFactoryRepository;
|
|
61716
|
+
}
|
|
61717
|
+
canRun(projectType) {
|
|
61718
|
+
return this.registry.canHandleProject(projectType);
|
|
61719
|
+
}
|
|
61720
|
+
get runnableTypes() {
|
|
61721
|
+
return this.registry.registeredTypes;
|
|
61722
|
+
}
|
|
61723
|
+
async runAsync(options, cancellationToken) {
|
|
61724
|
+
const { projectType, name } = options.project;
|
|
61725
|
+
if (!this.canRun(projectType)) {
|
|
61726
|
+
const known = this.runnableTypes.join(", ") || "none";
|
|
61727
|
+
return RunResult.failed("UnsupportedProjectType", `No executor is registered for project type '${projectType}' ` + `(project '${name}'). Runnable types: ${known}.`);
|
|
61728
|
+
}
|
|
61729
|
+
let executor;
|
|
61730
|
+
try {
|
|
61731
|
+
const factory = this.registry.getProjectExecutorFactory(projectType);
|
|
61732
|
+
executor = await factory.createAsync(this.logger, this.fileSystem);
|
|
61733
|
+
this.logger.info(`Running ${name} (${projectType}) on ${options.target}.`);
|
|
61734
|
+
return await executor.runAsync(options, cancellationToken);
|
|
61735
|
+
} catch (error) {
|
|
61736
|
+
return RunResult.failed("Unknown", messageOf(error));
|
|
61737
|
+
} finally {
|
|
61738
|
+
try {
|
|
61739
|
+
await executor?.dispose();
|
|
61740
|
+
} catch (error) {
|
|
61741
|
+
this.logger.warn(`Failed to dispose the ${projectType} executor: ${messageOf(error)}`);
|
|
61742
|
+
}
|
|
61743
|
+
}
|
|
61744
|
+
}
|
|
61745
|
+
}
|
|
61746
|
+
function messageOf(error) {
|
|
61747
|
+
return error instanceof Error ? error.message : String(error);
|
|
61748
|
+
}
|
|
61749
|
+
|
|
61243
61750
|
// src/studio_interop/HelmRunService.ts
|
|
61244
61751
|
var import_coreipc6 = __toESM(require_coreipc(), 1);
|
|
61245
61752
|
|
|
61246
61753
|
// src/studio_interop/HelmRunCallbackHandler.ts
|
|
61754
|
+
var FILE_MARKER_REFRESH_INTERVAL = 50;
|
|
61755
|
+
|
|
61247
61756
|
class HelmRunCallbackHandler {
|
|
61757
|
+
lastMarkedFile;
|
|
61758
|
+
entriesSinceFileMarker = 0;
|
|
61248
61759
|
OnLogEntry(_source, level, message) {
|
|
61249
61760
|
const formatted = tryFormatLogMessage(message);
|
|
61250
61761
|
getOutputSink().writeOut(`[${level}] ${formatted}
|
|
@@ -61274,6 +61785,36 @@ class HelmRunCallbackHandler {
|
|
|
61274
61785
|
}
|
|
61275
61786
|
return true;
|
|
61276
61787
|
}
|
|
61788
|
+
OnProfilingEntry(entryJson) {
|
|
61789
|
+
getOutputSink().writeOut(`[Profiling] ${this.formatProfilingEntry(entryJson)}
|
|
61790
|
+
`);
|
|
61791
|
+
return true;
|
|
61792
|
+
}
|
|
61793
|
+
formatProfilingEntry(entryJson) {
|
|
61794
|
+
try {
|
|
61795
|
+
const entry = JSON.parse(entryJson);
|
|
61796
|
+
const name = entry.displayName ?? entry.id ?? "activity";
|
|
61797
|
+
const idRef = entry.idRef ? ` (${entry.idRef})` : "";
|
|
61798
|
+
const duration = typeof entry.duration === "number" ? ` ${entry.duration}ms` : "";
|
|
61799
|
+
const failed = entry.failed ? " [failed]" : "";
|
|
61800
|
+
const file = this.fileMarker(entry.workflowFile);
|
|
61801
|
+
return `${name}${idRef}${duration}${failed}${file}`;
|
|
61802
|
+
} catch {
|
|
61803
|
+
return entryJson;
|
|
61804
|
+
}
|
|
61805
|
+
}
|
|
61806
|
+
fileMarker(workflowFile) {
|
|
61807
|
+
if (typeof workflowFile !== "string" || workflowFile.length === 0) {
|
|
61808
|
+
return "";
|
|
61809
|
+
}
|
|
61810
|
+
if (workflowFile !== this.lastMarkedFile || this.entriesSinceFileMarker >= FILE_MARKER_REFRESH_INTERVAL) {
|
|
61811
|
+
this.lastMarkedFile = workflowFile;
|
|
61812
|
+
this.entriesSinceFileMarker = 0;
|
|
61813
|
+
return ` [${workflowFile}]`;
|
|
61814
|
+
}
|
|
61815
|
+
this.entriesSinceFileMarker++;
|
|
61816
|
+
return "";
|
|
61817
|
+
}
|
|
61277
61818
|
}
|
|
61278
61819
|
function tryFormatLogMessage(message) {
|
|
61279
61820
|
try {
|
|
@@ -61292,14 +61833,13 @@ class HelmRunService {
|
|
|
61292
61833
|
constructor(session) {
|
|
61293
61834
|
this.session = session;
|
|
61294
61835
|
}
|
|
61295
|
-
async runFile(filePath, inputArguments, logLevel, command = "StartExecution", skipBuild = false, profiling = false, folderPath, waitTimeoutSeconds, breakpointsJson) {
|
|
61836
|
+
async runFile(filePath, inputArguments, logLevel, command = "StartExecution", skipBuild = false, profiling = false, profilingMode, folderPath, waitTimeoutSeconds, breakpointsJson) {
|
|
61296
61837
|
const isStartCommand = START_COMMANDS.has(command);
|
|
61297
|
-
|
|
61838
|
+
const streaming = profilingMode === "stream";
|
|
61839
|
+
this.session.log(`[helm-run] ${isStartCommand ? "Starting pipeline" : "Sending debug command"}: ${command}${skipBuild ? " [skip-build]" : ""}${profiling ? " [profiling]" : ""}${streaming ? " [profiling-stream]" : ""}${folderPath ? ` [folder=${folderPath}]` : ""}`);
|
|
61298
61840
|
const t0 = performance.now();
|
|
61299
61841
|
const rawResult = await this.session.execute((inst) => {
|
|
61300
|
-
|
|
61301
|
-
import_coreipc6.ipc.callback.forAddress(import_coreipc6.ipc.namedPipe(inst.ipcEndpointName)).forService("IHelmRunCallback").is(new HelmRunCallbackHandler);
|
|
61302
|
-
}
|
|
61842
|
+
import_coreipc6.ipc.callback.forAddress(import_coreipc6.ipc.namedPipe(inst.ipcEndpointName)).forService("IHelmRunCallback").is(new HelmRunCallbackHandler);
|
|
61303
61843
|
return inst.helmServices.run.executeCommand({
|
|
61304
61844
|
command,
|
|
61305
61845
|
filePath,
|
|
@@ -61307,6 +61847,7 @@ class HelmRunService {
|
|
|
61307
61847
|
logLevel,
|
|
61308
61848
|
skipBuild,
|
|
61309
61849
|
profiling,
|
|
61850
|
+
profilingMode,
|
|
61310
61851
|
folderPath,
|
|
61311
61852
|
waitTimeoutSeconds,
|
|
61312
61853
|
breakpointsJson
|
|
@@ -61318,6 +61859,290 @@ class HelmRunService {
|
|
|
61318
61859
|
}
|
|
61319
61860
|
}
|
|
61320
61861
|
|
|
61862
|
+
// src/executor/rpa-run-contract.ts
|
|
61863
|
+
var RPA_PROJECT_TYPES = [
|
|
61864
|
+
"Process",
|
|
61865
|
+
"Library",
|
|
61866
|
+
"Tests",
|
|
61867
|
+
"WebApp"
|
|
61868
|
+
];
|
|
61869
|
+
var HELM_LOG_LEVELS = [
|
|
61870
|
+
"Verbose",
|
|
61871
|
+
"Trace",
|
|
61872
|
+
"Information",
|
|
61873
|
+
"Warning",
|
|
61874
|
+
"Error",
|
|
61875
|
+
"Critical"
|
|
61876
|
+
];
|
|
61877
|
+
var HELM_PROFILING_MODES = ["endOfRun", "stream"];
|
|
61878
|
+
var DEFAULT_LOG_LEVEL4 = "Information";
|
|
61879
|
+
function readProviderOptions(raw) {
|
|
61880
|
+
const source = raw ?? {};
|
|
61881
|
+
const logLevel = source.logLevel;
|
|
61882
|
+
const profilingMode = source.profilingMode;
|
|
61883
|
+
return {
|
|
61884
|
+
logLevel: HELM_LOG_LEVELS.includes(logLevel) ? logLevel : DEFAULT_LOG_LEVEL4,
|
|
61885
|
+
skipBuild: source.skipBuild === true,
|
|
61886
|
+
profiling: source.profiling === true,
|
|
61887
|
+
profilingMode: HELM_PROFILING_MODES.includes(profilingMode) ? profilingMode : undefined,
|
|
61888
|
+
runner: isHelmRunner(source.runner) ? source.runner : undefined,
|
|
61889
|
+
inputArgumentsJson: typeof source.inputArgumentsJson === "string" ? source.inputArgumentsJson : undefined
|
|
61890
|
+
};
|
|
61891
|
+
}
|
|
61892
|
+
function isHelmRunner(value) {
|
|
61893
|
+
return typeof value === "object" && value !== null && typeof value.runFile === "function";
|
|
61894
|
+
}
|
|
61895
|
+
function parseHelmRunPayload(raw) {
|
|
61896
|
+
let parsed;
|
|
61897
|
+
try {
|
|
61898
|
+
parsed = JSON.parse(raw);
|
|
61899
|
+
} catch {
|
|
61900
|
+
return;
|
|
61901
|
+
}
|
|
61902
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
61903
|
+
return;
|
|
61904
|
+
}
|
|
61905
|
+
const fields = parsed;
|
|
61906
|
+
return {
|
|
61907
|
+
hasErrors: resultHasErrors(raw),
|
|
61908
|
+
errorMessage: asString2(fields.errorMessage ?? fields.ErrorMessage),
|
|
61909
|
+
output: asString2(fields.output ?? fields.Output),
|
|
61910
|
+
profiling: fields.profiling ?? fields.Profiling
|
|
61911
|
+
};
|
|
61912
|
+
}
|
|
61913
|
+
function asString2(value) {
|
|
61914
|
+
return typeof value === "string" ? value : undefined;
|
|
61915
|
+
}
|
|
61916
|
+
|
|
61917
|
+
// src/executor/rpa-project-executor.ts
|
|
61918
|
+
var FALLBACK_ENTRY_POINT = "Main.xaml";
|
|
61919
|
+
var START_EXECUTION = "StartExecution";
|
|
61920
|
+
var defaultRunnerFactory = (projectDir, timeoutMs) => new HelmRunService(new StudioSession({
|
|
61921
|
+
projectDir,
|
|
61922
|
+
timeoutMs,
|
|
61923
|
+
requiresProject: true
|
|
61924
|
+
}));
|
|
61925
|
+
|
|
61926
|
+
class RpaProjectExecutor extends ProjectExecutor {
|
|
61927
|
+
createRunner;
|
|
61928
|
+
constructor(fileSystem, logger4, createRunner = defaultRunnerFactory) {
|
|
61929
|
+
super(fileSystem, logger4);
|
|
61930
|
+
this.createRunner = createRunner;
|
|
61931
|
+
}
|
|
61932
|
+
async runAsync(options, cancellationToken) {
|
|
61933
|
+
const { project } = options;
|
|
61934
|
+
if (options.target !== RunTarget.Local) {
|
|
61935
|
+
return RunResult.failed(RunErrorCode.InvalidInput, `RPA projects execute on this machine through Studio, so they need target '${RunTarget.Local}'; got '${options.target}'.`);
|
|
61936
|
+
}
|
|
61937
|
+
if (!project.projectPath) {
|
|
61938
|
+
return RunResult.failed(RunErrorCode.InvalidInput, "Running an RPA project requires the project directory.");
|
|
61939
|
+
}
|
|
61940
|
+
if (cancellationToken?.aborted) {
|
|
61941
|
+
return RunResult.failed(RunErrorCode.Cancelled, "Run cancelled before it started.");
|
|
61942
|
+
}
|
|
61943
|
+
const entryPoint = options.entryPoint ?? await this.resolveDefaultEntryPoint(project.projectPath) ?? FALLBACK_ENTRY_POINT;
|
|
61944
|
+
const knobs = readProviderOptions(options.providerOptions);
|
|
61945
|
+
this.logger.info(`Running '${project.name}' (${project.projectType}) locally: ${entryPoint}`);
|
|
61946
|
+
const runner = knobs.runner ?? this.createRunner(project.projectPath, options.timeoutMs);
|
|
61947
|
+
options.callbacks?.onStatusChange?.(RunStatus.Running);
|
|
61948
|
+
let outcome;
|
|
61949
|
+
try {
|
|
61950
|
+
outcome = await this.withCancellation(runner, entryPoint, cancellationToken, () => runner.runFile(entryPoint, knobs.inputArgumentsJson ?? serializeInputArguments(options.inputArguments), knobs.logLevel, START_EXECUTION, knobs.skipBuild, knobs.profiling, knobs.profilingMode, options.connection?.folderPath));
|
|
61951
|
+
} catch (error) {
|
|
61952
|
+
if (cancellationToken?.aborted) {
|
|
61953
|
+
return RunResult.failed(RunErrorCode.Cancelled, "Run cancelled.");
|
|
61954
|
+
}
|
|
61955
|
+
return RunResult.failed(RunErrorCode.StartFailed, `Could not run '${project.name}' locally: ${messageOf2(error)}`, { details: { runnerError: messageOf2(error), entryPoint } });
|
|
61956
|
+
}
|
|
61957
|
+
if (cancellationToken?.aborted) {
|
|
61958
|
+
return RunResult.failed(RunErrorCode.Cancelled, "Run cancelled.");
|
|
61959
|
+
}
|
|
61960
|
+
return this.toRunResult(outcome, entryPoint);
|
|
61961
|
+
}
|
|
61962
|
+
async withCancellation(runner, entryPoint, cancellationToken, start) {
|
|
61963
|
+
if (!cancellationToken) {
|
|
61964
|
+
return start();
|
|
61965
|
+
}
|
|
61966
|
+
const onAbort = () => {
|
|
61967
|
+
runner.runFile(entryPoint, "", "Information", "Stop", true, false).catch((error) => {
|
|
61968
|
+
this.logger.warn(`Could not stop the run after cancellation: ${messageOf2(error)}`);
|
|
61969
|
+
});
|
|
61970
|
+
};
|
|
61971
|
+
cancellationToken.addEventListener("abort", onAbort, { once: true });
|
|
61972
|
+
try {
|
|
61973
|
+
return await start();
|
|
61974
|
+
} finally {
|
|
61975
|
+
cancellationToken.removeEventListener("abort", onAbort);
|
|
61976
|
+
}
|
|
61977
|
+
}
|
|
61978
|
+
async resolveDefaultEntryPoint(projectPath) {
|
|
61979
|
+
return await this.mainFromProjectFile(projectPath) ?? await super.resolveDefaultEntryPoint(projectPath);
|
|
61980
|
+
}
|
|
61981
|
+
async mainFromProjectFile(projectPath) {
|
|
61982
|
+
const projectFile = this.fileSystem.path.join(projectPath, "project.json");
|
|
61983
|
+
try {
|
|
61984
|
+
const raw = await this.fileSystem.readFile(projectFile, "utf-8");
|
|
61985
|
+
if (!raw) {
|
|
61986
|
+
return;
|
|
61987
|
+
}
|
|
61988
|
+
const main = JSON.parse(raw).main;
|
|
61989
|
+
return typeof main === "string" && main.length > 0 ? main : undefined;
|
|
61990
|
+
} catch (error) {
|
|
61991
|
+
this.logger.warn(`Could not read the entry point from ${projectFile}: ${messageOf2(error)}`);
|
|
61992
|
+
return;
|
|
61993
|
+
}
|
|
61994
|
+
}
|
|
61995
|
+
toRunResult(outcome, entryPoint) {
|
|
61996
|
+
const payload = outcome.runResult;
|
|
61997
|
+
const passthrough = { rawResult: payload };
|
|
61998
|
+
if (outcome.error !== undefined) {
|
|
61999
|
+
passthrough.runnerError = outcome.error;
|
|
62000
|
+
}
|
|
62001
|
+
if (payload === null) {
|
|
62002
|
+
return RunResult.failed(RunErrorCode.Unknown, outcome.error ?? "Studio returned no result for the run.", { details: { ...passthrough, entryPoint } });
|
|
62003
|
+
}
|
|
62004
|
+
const parsed = parseHelmRunPayload(payload);
|
|
62005
|
+
if (!parsed) {
|
|
62006
|
+
return RunResult.failed(RunErrorCode.Unknown, `Studio returned an unreadable run result: ${payload}`, { details: { ...passthrough, entryPoint } });
|
|
62007
|
+
}
|
|
62008
|
+
const details = { ...passthrough, entryPoint };
|
|
62009
|
+
if (parsed.profiling != null) {
|
|
62010
|
+
details.profiling = parsed.profiling;
|
|
62011
|
+
}
|
|
62012
|
+
if (parsed.output) {
|
|
62013
|
+
details.output = parsed.output;
|
|
62014
|
+
}
|
|
62015
|
+
if (parsed.hasErrors) {
|
|
62016
|
+
const message = parsed.errorMessage ?? "The run finished with errors.";
|
|
62017
|
+
const result2 = RunResult.failed(isPreExecutionFailure(message) ? RunErrorCode.PrepareFailed : RunErrorCode.ExecutionFailed, message, { details });
|
|
62018
|
+
result2.rawStatus = "Faulted";
|
|
62019
|
+
return result2;
|
|
62020
|
+
}
|
|
62021
|
+
const result = RunResult.succeeded({ details });
|
|
62022
|
+
result.rawStatus = "Completed";
|
|
62023
|
+
result.output = parseOutputArguments(parsed.output);
|
|
62024
|
+
return result;
|
|
62025
|
+
}
|
|
62026
|
+
}
|
|
62027
|
+
function messageOf2(error) {
|
|
62028
|
+
return error instanceof Error ? error.message : String(error);
|
|
62029
|
+
}
|
|
62030
|
+
function serializeInputArguments(inputArguments) {
|
|
62031
|
+
return inputArguments && Object.keys(inputArguments).length > 0 ? JSON.stringify(inputArguments) : "";
|
|
62032
|
+
}
|
|
62033
|
+
function parseOutputArguments(output) {
|
|
62034
|
+
if (!output) {
|
|
62035
|
+
return;
|
|
62036
|
+
}
|
|
62037
|
+
try {
|
|
62038
|
+
const parsed = JSON.parse(output);
|
|
62039
|
+
return parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : undefined;
|
|
62040
|
+
} catch {
|
|
62041
|
+
return;
|
|
62042
|
+
}
|
|
62043
|
+
}
|
|
62044
|
+
function isPreExecutionFailure(message) {
|
|
62045
|
+
return /^(Validation failed|Build failed)/i.test(message);
|
|
62046
|
+
}
|
|
62047
|
+
|
|
62048
|
+
// src/executor/rpa-executor-factory.ts
|
|
62049
|
+
class RpaExecutorFactory {
|
|
62050
|
+
supportedTypes = RPA_PROJECT_TYPES;
|
|
62051
|
+
createAsync(logger4, fileSystem) {
|
|
62052
|
+
return Promise.resolve(new RpaProjectExecutor(fileSystem, logger4));
|
|
62053
|
+
}
|
|
62054
|
+
}
|
|
62055
|
+
|
|
62056
|
+
// src/executor-tool.ts
|
|
62057
|
+
var createExecutorFactory = () => new RpaExecutorFactory;
|
|
62058
|
+
|
|
62059
|
+
// src/executor/register-rpa-executor.ts
|
|
62060
|
+
function ensureRpaExecutorRegistered(registry = executorsFactoryRepository) {
|
|
62061
|
+
registry.registerProjectExecutorFactory(createExecutorFactory());
|
|
62062
|
+
}
|
|
62063
|
+
|
|
62064
|
+
// src/executor/RpaExecutorService.ts
|
|
62065
|
+
class RpaExecutorService {
|
|
62066
|
+
helmRunner;
|
|
62067
|
+
fileSystem;
|
|
62068
|
+
logger;
|
|
62069
|
+
constructor(helmRunner, deps = {}) {
|
|
62070
|
+
this.helmRunner = helmRunner;
|
|
62071
|
+
this.fileSystem = deps.fileSystem ?? new NodeFileSystem3;
|
|
62072
|
+
this.logger = deps.logger ?? logger;
|
|
62073
|
+
}
|
|
62074
|
+
async runAsync(request) {
|
|
62075
|
+
ensureRpaExecutorRegistered();
|
|
62076
|
+
const projectRunner = new ProjectRunner({
|
|
62077
|
+
fileSystem: this.fileSystem,
|
|
62078
|
+
logger: this.logger
|
|
62079
|
+
});
|
|
62080
|
+
const result = await projectRunner.runAsync({
|
|
62081
|
+
project: {
|
|
62082
|
+
name: this.fileSystem.path.basename(request.projectDir),
|
|
62083
|
+
projectType: await this.resolveProjectType(request.projectDir),
|
|
62084
|
+
projectPath: request.projectDir
|
|
62085
|
+
},
|
|
62086
|
+
entryPoint: request.filePath,
|
|
62087
|
+
target: RunTarget.Local,
|
|
62088
|
+
connection: {
|
|
62089
|
+
baseUrl: "",
|
|
62090
|
+
accessToken: "",
|
|
62091
|
+
organizationId: "",
|
|
62092
|
+
organizationName: "",
|
|
62093
|
+
folderPath: request.folderPath
|
|
62094
|
+
},
|
|
62095
|
+
providerOptions: {
|
|
62096
|
+
logLevel: request.logLevel,
|
|
62097
|
+
skipBuild: request.skipBuild,
|
|
62098
|
+
profiling: request.profiling,
|
|
62099
|
+
profilingMode: request.profilingMode,
|
|
62100
|
+
runner: this.helmRunner,
|
|
62101
|
+
inputArgumentsJson: request.inputArgumentsJson
|
|
62102
|
+
}
|
|
62103
|
+
});
|
|
62104
|
+
const rawResult = asRawResult(result.details?.rawResult);
|
|
62105
|
+
const error = asText(result.details?.runnerError);
|
|
62106
|
+
return {
|
|
62107
|
+
toolResult: this.toToolResult(rawResult, error),
|
|
62108
|
+
rawResult,
|
|
62109
|
+
error
|
|
62110
|
+
};
|
|
62111
|
+
}
|
|
62112
|
+
toToolResult(rawResult, error) {
|
|
62113
|
+
return {
|
|
62114
|
+
content: [
|
|
62115
|
+
{
|
|
62116
|
+
type: "text",
|
|
62117
|
+
text: rawResult ?? JSON.stringify({
|
|
62118
|
+
success: false,
|
|
62119
|
+
errorMessage: error ?? "Helm run returned no result"
|
|
62120
|
+
})
|
|
62121
|
+
}
|
|
62122
|
+
],
|
|
62123
|
+
isError: rawResult === null || resultHasErrors(rawResult)
|
|
62124
|
+
};
|
|
62125
|
+
}
|
|
62126
|
+
async resolveProjectType(projectDir) {
|
|
62127
|
+
const fallback = RPA_PROJECT_TYPES[0];
|
|
62128
|
+
try {
|
|
62129
|
+
const raw = await this.fileSystem.readFile(this.fileSystem.path.join(projectDir, "project.json"), "utf-8");
|
|
62130
|
+
if (!raw)
|
|
62131
|
+
return fallback;
|
|
62132
|
+
const outputType = JSON.parse(raw).designOptions?.outputType;
|
|
62133
|
+
return RPA_PROJECT_TYPES.includes(outputType) ? outputType : fallback;
|
|
62134
|
+
} catch {
|
|
62135
|
+
return fallback;
|
|
62136
|
+
}
|
|
62137
|
+
}
|
|
62138
|
+
}
|
|
62139
|
+
function asRawResult(value) {
|
|
62140
|
+
return typeof value === "string" ? value : null;
|
|
62141
|
+
}
|
|
62142
|
+
function asText(value) {
|
|
62143
|
+
return typeof value === "string" ? value : undefined;
|
|
62144
|
+
}
|
|
62145
|
+
|
|
61321
62146
|
// src/telemetry/run-result-telemetry.ts
|
|
61322
62147
|
var TERMINAL_RUN_COMMAND = "StartExecution";
|
|
61323
62148
|
function buildRunResultTelemetry(input) {
|
|
@@ -61423,7 +62248,7 @@ function runFileTool(session) {
|
|
|
61423
62248
|
},
|
|
61424
62249
|
command: {
|
|
61425
62250
|
type: "string",
|
|
61426
|
-
description: "The actual command to run. Can be either one of the following: " + '- StartExecution: runs the workflow specified by the "filePath" and with the specified "inputArguments".' + '- StartDebugging: starts a debugging session for the workflow specified by the "filePath" and with the specified "inputArguments". ' + "Returns at the first stable state instead of blocking until the run ends: check the DebugState field of the result — " + "'Paused' (stopped at an activity; DebugDetails has the activity and locals), " + "'Suspended' (stopped on an exception; DebugDetails has the exception and locals — choose Continue/ContinueRetry/ContinueIgnore/Stop), " + "or 'Completed' (ran to the end; normal run result)." + "- Break: during debugging, breaks/pauses execution at the next activity and returns the paused state with locals." + "- Continue: during debugging, resumes execution if in a paused state." + "- Resume: during debugging, resumes execution if in a suspended state." + "- ContinueRetry: during debugging, resumes execution if in a paused state. If paused on exception, retry current activity execution." + "- ContinueIgnore: during debugging, resumes execution if in a paused state. If paused on exception, ignore the exception." + '- StepInto: when
|
|
62251
|
+
description: "The actual command to run. Can be either one of the following: " + '- StartExecution: runs the workflow specified by the "filePath" and with the specified "inputArguments".' + '- StartDebugging: starts a debugging session for the workflow specified by the "filePath" and with the specified "inputArguments". ' + "Returns at the first stable state instead of blocking until the run ends: check the DebugState field of the result — " + "'Paused' (stopped at an activity; DebugDetails has the activity and locals), " + "'Suspended' (stopped on an exception; DebugDetails has the exception and locals — choose Continue/ContinueRetry/ContinueIgnore/Stop), " + "or 'Completed' (ran to the end; normal run result)." + "- Break: during debugging, breaks/pauses execution at the next activity and returns the paused state with locals." + "- Continue: during debugging, resumes execution if in a paused state." + "- Resume: during debugging, resumes execution if in a suspended state." + "- ContinueRetry: during debugging, resumes execution if in a paused state. If paused on exception, retry current activity execution." + "- ContinueIgnore: during debugging, resumes execution if in a paused state. If paused on exception, ignore the exception." + '- StepInto: with no active session, starts a debug session paused before the first activity; when a session is already paused or suspended, resumes debugging in a step-by-step fashion with the "Step Into" behavior.' + '- StepOver: with no active session, starts a debug session paused before the first activity; when a session is already paused or suspended, resumes debugging in a step-by-step fashion with the "Step Over" behavior.' + '- StepOut: with no active session, starts a debug session paused before the first activity; when a session is already paused or suspended, resumes debugging in a step-by-step fashion with the "Step Out" behavior.' + "All resume/step commands return at the NEXT stable state (Paused/Suspended/Completed), so each call tells you where execution now " + "stands via DebugState/DebugDetails; if no stable state is reached within waitTimeoutSeconds, they return DebugState 'Running' instead of hanging." + "- GetDebugState: reports the current debug session state without side effects ('None' when no session is active). " + "Pass waitTimeoutSeconds to long-poll a running session for its next stable state (Helm backend only; " + "on the Studio backend GetDebugState is always an instant probe)." + `- SetBreakpoints: replaces the active debug session's whole breakpoint set with the "breakpoints" parameter. ` + 'To set breakpoints for a new session, pass "breakpoints" directly on StartDebugging instead. ' + "Helm backend only — the Studio backend debugs against the breakpoints held in the designer, so use " + "ToggleBreakpoint there." + "- ApplyFileChanges: while paused/suspended in a debug session, reconciles your on-disk activity-property edits " + "into the running session via hot-reload, so the paused execution picks them up without a restart (e.g. the faulted " + "activity re-executes on ContinueRetry with your fix). Edit the workflow file on disk first, then call " + 'ApplyFileChanges naming what you changed via the "fileChanges" parameter. Returns { applied, rejected, debugState } ' + "instead of a run result: 'applied' edits are live in the session; 'rejected' edits (each with a reason) need a " + "session restart to take effect — structural (non-hot-reloadable) changes are rejected." + "- Stop: stops the current debugging or execution session." + "- ToggleBreakpoint: toggles a breakpoint at the currently focused activity (if .xaml workflow) or line (if .cs coded workflow). " + "If no activity or line is in focus, toggles a breakpoint at the entire currently opened workflow." + "IMPORTANT: " + "- For .xaml workflows, the toggle cycles through three states: enabled breakpoint -> disabled breakpoint -> no breakpoint." + "- For .cs coded workflows, the toggle cycles through two states: breakpoint -> no breakpoint." + "- RestartFromTop: during debugging, restarts execution." + "- ForceSessionEnded: forces the current session to end." + "- TestActivity: isolates and executes the currently focused activity. " + 'Use "inputVariables" to set workflow variable expressions and "inputArguments" to set project argument expressions.' + "- StartDebuggingFromHere: starts a debugging session from the currently focused activity, " + 'skipping all preceding activities. Use "inputVariables" to set workflow variable expressions and "inputArguments" to set project argument expressions.' + "Defaults to StartExecution if not specified.",
|
|
61427
62252
|
enum: [
|
|
61428
62253
|
"StartExecution",
|
|
61429
62254
|
"StartDebugging",
|
|
@@ -61437,6 +62262,7 @@ function runFileTool(session) {
|
|
|
61437
62262
|
"StepOut",
|
|
61438
62263
|
"GetDebugState",
|
|
61439
62264
|
"SetBreakpoints",
|
|
62265
|
+
"ApplyFileChanges",
|
|
61440
62266
|
"Stop",
|
|
61441
62267
|
"ToggleBreakpoint",
|
|
61442
62268
|
"RestartFromTop",
|
|
@@ -61480,6 +62306,12 @@ function runFileTool(session) {
|
|
|
61480
62306
|
description: "When true, collect per-activity profiling data for the run and return it as a " + "Profiling field on the result. Only effective for start commands (StartExecution, " + "StartDebugging, TestActivity, StartDebuggingFromHere); ignored for stepping/breakpoint " + "commands. Requires a Studio Develop profile with the 'EnableProfiling' flag set; if " + "profiling is unavailable, the run still completes and the Profiling field is omitted.",
|
|
61481
62307
|
default: false
|
|
61482
62308
|
},
|
|
62309
|
+
profilingMode: {
|
|
62310
|
+
type: "string",
|
|
62311
|
+
enum: ["endOfRun", "stream"],
|
|
62312
|
+
description: "Real-time profiling delivery for start commands. Profiling data is collected " + "only when --profiling is set or when this is 'stream' (stream turns collection " + "on). 'endOfRun' (default) affects delivery only: when profiling is enabled it " + "returns the summary once at completion. 'stream' additionally forwards each " + "per-activity entry live as a [Profiling] line showing the activity display name, " + "its stable design-time idRef, timings, and the source workflow file whenever it " + "changes (ids/idRefs are only unique within one file); the exhaustive per-activity " + "data is also written to the run's *.uistat file. Helm backend only; ignored for " + "non-start commands and when running remote.",
|
|
62313
|
+
default: "endOfRun"
|
|
62314
|
+
},
|
|
61483
62315
|
remote: {
|
|
61484
62316
|
type: "boolean",
|
|
61485
62317
|
description: "Run/debug on the configured remote agent (Orchestrator unattended robot) " + "instead of locally. Configure the target first with `rpa remote configure`. " + "Only affects start commands (StartExecution, StartDebugging, " + "StartDebuggingFromHere, TestActivity). Works with both Studio and Helm backends.",
|
|
@@ -61491,9 +62323,15 @@ function runFileTool(session) {
|
|
|
61491
62323
|
contentSchema: { type: "array" },
|
|
61492
62324
|
description: "Activity breakpoints for XAML debugging (a JSON array; one object per " + "breakpoint). Used by StartDebugging (initial set) and SetBreakpoints " + "(replaces the running session's whole set). Each breakpoint has: " + "workflowFile (required; workflow path relative to the project root), " + "activityIdRef (the target activity's sap2010:WorkflowViewState.IdRef " + "attribute value from the XAML — the stable way to address an activity) " + "or activityId (runtime id), plus optional condition (VB/C# expression; " + "breaks only when True), hitCount (break only on exactly the Nth hit), " + "and enabled (defaults to true). May be supplied as repeatable " + "comma-separated key=value items — one array item per occurrence: " + "--breakpoints 'workflowFile=Main.xaml,activityIdRef=Assign_1' " + "--breakpoints 'workflowFile=Main.xaml,activityIdRef=Click_2,hitCount:=3' " + "— or from a JSON file using '@breakpoints.json' or --breakpoints-file. " + "When execution pauses at a breakpoint, the result carries DebugState " + "'Paused' with the activity and locals in DebugDetails. Helm backend only."
|
|
61493
62325
|
},
|
|
62326
|
+
fileChanges: {
|
|
62327
|
+
type: "string",
|
|
62328
|
+
contentMediaType: "application/json",
|
|
62329
|
+
contentSchema: { type: "array" },
|
|
62330
|
+
description: "Activity-property edits to reconcile into a paused debug session (a JSON array; one " + "object per edited property). Only used by the ApplyFileChanges command. Each entry has: " + "workflowFile (required; workflow path relative to the project root), activityIdRef (the " + "target activity's sap2010:WorkflowViewState.IdRef attribute value from the XAML — the " + "stable way to address an activity), and propertyName (the edited property, e.g. Target). " + "Edit the workflow file on disk first, then call ApplyFileChanges naming what you changed. " + "May be supplied as repeatable comma-separated key=value items — one array item per " + "occurrence: --file-changes 'workflowFile=Main.xaml,activityIdRef=Click_2,propertyName=Target' " + "— or from a JSON file using '@changes.json' or --file-changes-file."
|
|
62331
|
+
},
|
|
61494
62332
|
waitTimeoutSeconds: {
|
|
61495
62333
|
type: "number",
|
|
61496
|
-
description: "Maximum seconds a mid-session debug command (Continue, Step*, Break, " + "GetDebugState) waits for the next stable state before returning " + "DebugState 'Running'. Defaults to 120 (0 for GetDebugState, making it " + "an instant probe). Ignored for start commands. Helm backend only."
|
|
62334
|
+
description: "Maximum seconds a mid-session debug command (Continue, Step*, Break, " + "GetDebugState) waits for the next stable state before returning " + "DebugState 'Running'. Defaults to 120 (0 for GetDebugState, making it " + "an instant probe). Ignored for start commands, which wait for the run. " + "Helm backend only: the Studio backend applies its own fixed 120s bound " + "to mid-session commands and ignores an explicit value."
|
|
61497
62335
|
},
|
|
61498
62336
|
folderPath: {
|
|
61499
62337
|
type: "string",
|
|
@@ -61510,10 +62348,13 @@ function runFileTool(session) {
|
|
|
61510
62348
|
const logLevel = args.logLevel ?? "Trace";
|
|
61511
62349
|
const skipBuild = args.skipBuild ?? false;
|
|
61512
62350
|
const profiling = args.profiling ?? false;
|
|
62351
|
+
const profilingMode = args.profilingMode;
|
|
61513
62352
|
const remote = args.remote ?? false;
|
|
61514
62353
|
const folderPath = args.folderPath;
|
|
61515
62354
|
const waitTimeoutSeconds = args.waitTimeoutSeconds;
|
|
61516
62355
|
const breakpoints = toJsonText(args.breakpoints);
|
|
62356
|
+
const fileChanges = toJsonText(args.fileChanges);
|
|
62357
|
+
const runInputArguments = inputArguments ?? "";
|
|
61517
62358
|
for (const [name, value] of [
|
|
61518
62359
|
["inputArguments", inputArguments],
|
|
61519
62360
|
["inputVariables", inputVariables]
|
|
@@ -61531,6 +62372,16 @@ function runFileTool(session) {
|
|
|
61531
62372
|
}
|
|
61532
62373
|
}
|
|
61533
62374
|
}
|
|
62375
|
+
if (command === "ApplyFileChanges" && !fileChanges) {
|
|
62376
|
+
return invalidInputResult("ApplyFileChanges requires --file-changes: one or more " + "workflowFile=...,activityIdRef=...,propertyName=... descriptors.");
|
|
62377
|
+
}
|
|
62378
|
+
if (fileChanges) {
|
|
62379
|
+
try {
|
|
62380
|
+
JSON.parse(fileChanges);
|
|
62381
|
+
} catch {
|
|
62382
|
+
return invalidInputResult("Invalid JSON for fileChanges");
|
|
62383
|
+
}
|
|
62384
|
+
}
|
|
61534
62385
|
try {
|
|
61535
62386
|
let isHelm = false;
|
|
61536
62387
|
await session2.execute((instance) => {
|
|
@@ -61540,6 +62391,18 @@ function runFileTool(session) {
|
|
|
61540
62391
|
requiresProject: true,
|
|
61541
62392
|
backend: remote ? "any" /* Any */ : "helm" /* Helm */
|
|
61542
62393
|
});
|
|
62394
|
+
if (command === "ApplyFileChanges") {
|
|
62395
|
+
const applyJson = isHelm ? await session2.execute((instance) => instance.helmServices.run.applyFileChanges({
|
|
62396
|
+
fileChangesJson: fileChanges ?? ""
|
|
62397
|
+
}), {
|
|
62398
|
+
requiresProject: true,
|
|
62399
|
+
backend: "helm" /* Helm */
|
|
62400
|
+
}) : await session2.execute((instance) => instance.services.run.applyFileChanges(fileChanges ?? ""), { requiresProject: true });
|
|
62401
|
+
return {
|
|
62402
|
+
content: [{ type: "text", text: applyJson }],
|
|
62403
|
+
isError: false
|
|
62404
|
+
};
|
|
62405
|
+
}
|
|
61543
62406
|
if (isHelm) {
|
|
61544
62407
|
if (START_COMMANDS2.has(command)) {
|
|
61545
62408
|
try {
|
|
@@ -61554,7 +62417,21 @@ function runFileTool(session) {
|
|
|
61554
62417
|
}
|
|
61555
62418
|
}
|
|
61556
62419
|
const helmRun = new HelmRunService(session2);
|
|
61557
|
-
|
|
62420
|
+
if (command === "StartExecution" && projectDir) {
|
|
62421
|
+
const outcome = await new RpaExecutorService(helmRun).runAsync({
|
|
62422
|
+
projectDir,
|
|
62423
|
+
filePath,
|
|
62424
|
+
inputArgumentsJson: runInputArguments,
|
|
62425
|
+
logLevel,
|
|
62426
|
+
skipBuild,
|
|
62427
|
+
profiling,
|
|
62428
|
+
profilingMode,
|
|
62429
|
+
folderPath
|
|
62430
|
+
});
|
|
62431
|
+
emitRunResult(command, outcome.rawResult, outcome.error, projectDir);
|
|
62432
|
+
return outcome.toolResult;
|
|
62433
|
+
}
|
|
62434
|
+
const helmResult = await helmRun.runFile(filePath, runInputArguments, logLevel, command, skipBuild, profiling, profilingMode, folderPath, waitTimeoutSeconds, breakpoints);
|
|
61558
62435
|
emitRunResult(command, helmResult.runResult, helmResult.error, projectDir);
|
|
61559
62436
|
return {
|
|
61560
62437
|
content: [
|
|
@@ -61581,7 +62458,7 @@ function runFileTool(session) {
|
|
|
61581
62458
|
}
|
|
61582
62459
|
}
|
|
61583
62460
|
}
|
|
61584
|
-
const result = await session2.execute((instance) => instance.services.run.executeCommand(command, filePath,
|
|
62461
|
+
const result = await session2.execute((instance) => instance.services.run.executeCommand(command, filePath, runInputArguments, inputVariables ?? "", logLevel, profiling), { requiresProject: true });
|
|
61585
62462
|
emitRunResult(command, result, undefined, projectDir);
|
|
61586
62463
|
return {
|
|
61587
62464
|
content: [
|
|
@@ -61770,18 +62647,18 @@ function stopExecutionTool(hostStudioPid) {
|
|
|
61770
62647
|
// src/tools/local/tm-config.ts
|
|
61771
62648
|
import { existsSync as existsSync12 } from "node:fs";
|
|
61772
62649
|
import { mkdir as mkdir6, readFile as readFile6, writeFile as writeFile6 } from "node:fs/promises";
|
|
61773
|
-
import { dirname as dirname10, join as
|
|
62650
|
+
import { dirname as dirname10, join as join23, resolve as resolve13 } from "node:path";
|
|
61774
62651
|
var TM_DATA_DIR = ".tmh";
|
|
61775
62652
|
var TM_CONFIG_FILE = "config.json";
|
|
61776
62653
|
var PROJECT_FILE2 = "project.json";
|
|
61777
62654
|
function resolveProjectDir2(projectDir) {
|
|
61778
|
-
return
|
|
62655
|
+
return resolve13(projectDir ?? process.cwd());
|
|
61779
62656
|
}
|
|
61780
62657
|
function tmConfigPath(projectDir) {
|
|
61781
|
-
return
|
|
62658
|
+
return join23(projectDir, TM_DATA_DIR, TM_CONFIG_FILE);
|
|
61782
62659
|
}
|
|
61783
62660
|
function assertIsProject(projectDir) {
|
|
61784
|
-
if (!existsSync12(
|
|
62661
|
+
if (!existsSync12(join23(projectDir, PROJECT_FILE2))) {
|
|
61785
62662
|
throw new Error(`No UiPath project found at '${projectDir}' (missing ${PROJECT_FILE2}). ` + `Pass --project-dir pointing at the project root.`);
|
|
61786
62663
|
}
|
|
61787
62664
|
}
|
|
@@ -61813,7 +62690,7 @@ function isSameTestManagerServer(a, b) {
|
|
|
61813
62690
|
}
|
|
61814
62691
|
var TM_LIVE_RELOAD_STUDIO_VERSION = "26.0.197";
|
|
61815
62692
|
function normalizeDir(path4) {
|
|
61816
|
-
return
|
|
62693
|
+
return resolve13(path4).replace(/[\\/]+$/, "").toLowerCase();
|
|
61817
62694
|
}
|
|
61818
62695
|
function findOpenStudioInstance(projectDir, instances) {
|
|
61819
62696
|
const target = normalizeDir(projectDir);
|
|
@@ -62296,7 +63173,7 @@ var registerCommands = async (program5, options) => {
|
|
|
62296
63173
|
hostStudioPid: process.env.UIPATH_STUDIO_PID ? parseInt(process.env.UIPATH_STUDIO_PID, 10) : undefined,
|
|
62297
63174
|
timeoutSeconds: parseInt(extractArg(process.argv, "timeout", "300") ?? "300", 10)
|
|
62298
63175
|
};
|
|
62299
|
-
resolved.projectDir =
|
|
63176
|
+
resolved.projectDir = resolve14(resolved.projectDir);
|
|
62300
63177
|
mirrorRobotDirToEnv(resolved.robotDir);
|
|
62301
63178
|
if (!options) {
|
|
62302
63179
|
const displayDefaults = {
|
|
@@ -62322,11 +63199,11 @@ var registerCommands = async (program5, options) => {
|
|
|
62322
63199
|
const session = createSession(resolved, resolverDeps);
|
|
62323
63200
|
registerListInstancesCommand(program5);
|
|
62324
63201
|
registerStartStudioCommand(program5, resolved);
|
|
62325
|
-
registerRestoreCommand(program5);
|
|
62326
|
-
registerAnalyzeCommand(program5);
|
|
62327
|
-
registerBuildCommand(program5);
|
|
62328
|
-
registerPackCommand(program5);
|
|
62329
|
-
registerCleanupCommand(program5);
|
|
63202
|
+
registerRestoreCommand(program5, resolved.projectDir);
|
|
63203
|
+
registerAnalyzeCommand(program5, resolved.projectDir);
|
|
63204
|
+
registerBuildCommand(program5, resolved.projectDir);
|
|
63205
|
+
registerPackCommand(program5, resolved.projectDir);
|
|
63206
|
+
registerCleanupCommand(program5, resolved.projectDir);
|
|
62330
63207
|
const format = extractArg(process.argv, "format");
|
|
62331
63208
|
await registerExternalCliCommands(program5, resolved.projectDir, {
|
|
62332
63209
|
commandName: "uia",
|
|
@@ -62334,7 +63211,8 @@ var registerCommands = async (program5, options) => {
|
|
|
62334
63211
|
packageId: "UiPath.UIAutomation.CLI",
|
|
62335
63212
|
minVersion: "26.4.1-preview",
|
|
62336
63213
|
injectProjectDir: "project-dir",
|
|
62337
|
-
injectFormat: "format"
|
|
63214
|
+
injectFormat: "format",
|
|
63215
|
+
supportsRemote: true
|
|
62338
63216
|
}, undefined, session, format, { resolverDeps, robotDir: resolved.robotDir });
|
|
62339
63217
|
const toolProvider = resolveToolProvider(resolved, session);
|
|
62340
63218
|
await registerMcpCommands(program5, toolProvider);
|