@uipath/test-manager-tool 1.206.0-preview.301 → 1.207.0-preview.305

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,7 +9,7 @@ import {
9
9
  singleton,
10
10
  getGlobalTelemetryProperties,
11
11
  isProjectTelemetryDisabled
12
- } from "./tool-6mpkbszw.js";
12
+ } from "./tool-f4ytsjzn.js";
13
13
  import {
14
14
  __toESM,
15
15
  __commonJS,
@@ -2139,12 +2139,26 @@ class NodeFileSystem {
2139
2139
  throw error;
2140
2140
  }
2141
2141
  }
2142
- async writeFile(filePath, data) {
2142
+ async writeFile(filePath, data, options) {
2143
2143
  const dir = path.dirname(filePath);
2144
2144
  if (dir) {
2145
2145
  await fs.mkdir(dir, { recursive: true });
2146
2146
  }
2147
- await fs.writeFile(filePath, data);
2147
+ if (options?.mode === undefined || process.platform === "win32") {
2148
+ if (options?.exclusive) {
2149
+ await fs.writeFile(filePath, data, { flag: "wx" });
2150
+ } else {
2151
+ await fs.writeFile(filePath, data);
2152
+ }
2153
+ return;
2154
+ }
2155
+ const handle = await fs.open(filePath, options.exclusive ? "wx" : "w", options.mode);
2156
+ try {
2157
+ await handle.chmod(options.mode);
2158
+ await handle.writeFile(data);
2159
+ } finally {
2160
+ await handle.close();
2161
+ }
2148
2162
  }
2149
2163
  async appendFile(filePath, data) {
2150
2164
  const dir = path.dirname(filePath);
@@ -2179,7 +2193,8 @@ class NodeFileSystem {
2179
2193
  isDirectory: () => stats.isDirectory(),
2180
2194
  size: stats.size,
2181
2195
  mtimeMs: stats.mtimeMs,
2182
- ctimeMs: stats.ctimeMs
2196
+ ctimeMs: stats.ctimeMs,
2197
+ mode: stats.mode
2183
2198
  };
2184
2199
  } catch (error) {
2185
2200
  if (this.isEnoent(error))
@@ -2190,8 +2205,13 @@ class NodeFileSystem {
2190
2205
  async exists(filePath) {
2191
2206
  return existsSync(filePath);
2192
2207
  }
2193
- async mkdir(dirPath) {
2194
- await fs.mkdir(dirPath, { recursive: true });
2208
+ async mkdir(dirPath, options) {
2209
+ await fs.mkdir(dirPath, { recursive: true, mode: options?.mode });
2210
+ }
2211
+ async chmod(targetPath, mode) {
2212
+ if (process.platform === "win32")
2213
+ return;
2214
+ await fs.chmod(targetPath, mode);
2195
2215
  }
2196
2216
  async acquireLock(lockPath) {
2197
2217
  const canonicalPath = await this.canonicalizeLockTarget(lockPath);
@@ -2341,7 +2361,7 @@ class NodeFileSystem {
2341
2361
  async getTempDir() {
2342
2362
  return await fs.mkdtemp(path.join(os.tmpdir(), "uipath-fs-"));
2343
2363
  }
2344
- async copyDirectory(sourcePath, destPath) {
2364
+ async copyDirectory(sourcePath, destPath, options) {
2345
2365
  const sourceStats = await this.stat(sourcePath);
2346
2366
  if (!sourceStats) {
2347
2367
  throw new Error(`Source directory does not exist: ${sourcePath}`);
@@ -2358,7 +2378,9 @@ class NodeFileSystem {
2358
2378
  if (!entryStats)
2359
2379
  continue;
2360
2380
  if (entryStats.isDirectory()) {
2361
- await this.copyDirectory(srcEntry, destEntry);
2381
+ if (options?.skipDirectoryNames?.includes(entry))
2382
+ continue;
2383
+ await this.copyDirectory(srcEntry, destEntry, options);
2362
2384
  } else if (entryStats.isFile()) {
2363
2385
  const content = await this.readFile(srcEntry);
2364
2386
  if (content !== null) {
@@ -2415,9 +2437,7 @@ async function withinProjectIdentityBudget(work, onTimeout) {
2415
2437
  }
2416
2438
  }
2417
2439
 
2418
- // ../common/src/telemetry/pseudonymize.ts
2419
- var PSEUDONYM_DOMAIN = "uipath-cli/telemetry/pseudonym/v1:";
2420
- var PSEUDONYM_HEX_LENGTH = 32;
2440
+ // ../common/src/sha256.ts
2421
2441
  var SHA256_K = new Uint32Array([
2422
2442
  1116352408,
2423
2443
  1899447441,
@@ -2497,7 +2517,7 @@ var SHA256_INITIAL_STATE = new Uint32Array([
2497
2517
  function rotr(value, bits) {
2498
2518
  return (value >>> bits | value << 32 - bits) >>> 0;
2499
2519
  }
2500
- function sha256Hex(input) {
2520
+ function sha256Words(input) {
2501
2521
  const bytes = new TextEncoder().encode(input);
2502
2522
  const paddedLength = bytes.length + 9 + 63 >> 6 << 6;
2503
2523
  const buffer = new Uint8Array(paddedLength);
@@ -2553,12 +2573,19 @@ function sha256Hex(input) {
2553
2573
  state[6] = state[6] + g >>> 0;
2554
2574
  state[7] = state[7] + h >>> 0;
2555
2575
  }
2576
+ return state;
2577
+ }
2578
+ function sha256Hex(input) {
2556
2579
  let hex = "";
2557
- for (const word of state) {
2580
+ for (const word of sha256Words(input)) {
2558
2581
  hex += word.toString(16).padStart(8, "0");
2559
2582
  }
2560
2583
  return hex;
2561
2584
  }
2585
+
2586
+ // ../common/src/telemetry/pseudonymize.ts
2587
+ var PSEUDONYM_DOMAIN = "uipath-cli/telemetry/pseudonym/v1:";
2588
+ var PSEUDONYM_HEX_LENGTH = 32;
2562
2589
  function resolveSha256Hex() {
2563
2590
  try {
2564
2591
  const nodeCrypto = __require("node:crypto");
@@ -2924,13 +2951,25 @@ function settlePromiseLike(thenable) {
2924
2951
  return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [toError(error), undefined]);
2925
2952
  }
2926
2953
 
2954
+ // ../common/src/result-types.ts
2955
+ var RESULTS = {
2956
+ Success: "Success",
2957
+ Failure: "Failure",
2958
+ ConfigError: "ConfigError",
2959
+ AuthenticationError: "AuthenticationError",
2960
+ ValidationError: "ValidationError",
2961
+ TimeoutError: "TimeoutError"
2962
+ };
2963
+
2927
2964
  // ../common/src/error-codes.ts
2928
2965
  var CLI_ERROR_CODES = [
2929
2966
  "invalid_argument",
2967
+ "confirmation_required",
2930
2968
  "authentication_required",
2931
2969
  "permission_denied",
2932
2970
  "local_permission_denied",
2933
2971
  "not_found",
2972
+ "not_enabled",
2934
2973
  "rate_limited",
2935
2974
  "network_error",
2936
2975
  "timeout",
@@ -2969,6 +3008,12 @@ function carriedRetry(error) {
2969
3008
  const retry = error.retry;
2970
3009
  return isRetryHint(retry) ? retry : undefined;
2971
3010
  }
3011
+ function carriedResult(error) {
3012
+ if (!error || typeof error !== "object")
3013
+ return;
3014
+ const result = error.result;
3015
+ return typeof result === "string" && result !== RESULTS.Success && Object.values(RESULTS).includes(result) ? result : undefined;
3016
+ }
2972
3017
  function defaultRetryForErrorCode(errorCode) {
2973
3018
  switch (errorCode) {
2974
3019
  case "network_error":
@@ -3107,6 +3152,12 @@ function localPermissionInstructions(code, path) {
3107
3152
  const remedy = onWindows ? "Re-run from an elevated terminal, close any program holding " + "the file open, or grant your user access to the path." : "Grant this user (or the sandbox the command runs in) access " + "to the path, or run the command outside the sandbox.";
3108
3153
  return `The operating system denied access to ${target} (${code}). This is ` + "a local permission problem, not a UiPath service error — retrying " + `without a permission change will not help. ${remedy}`;
3109
3154
  }
3155
+ function carriedInstructions(error) {
3156
+ if (!error || typeof error !== "object")
3157
+ return;
3158
+ const e = error;
3159
+ return typeof e.instructions === "string" ? e.instructions : undefined;
3160
+ }
3110
3161
  function describeConnectivityError(error) {
3111
3162
  for (const cur of walkErrorGraph(error)) {
3112
3163
  const code = typeof cur.code === "string" ? cur.code : undefined;
@@ -3361,6 +3412,8 @@ async function extractErrorDetails2(error, options) {
3361
3412
  }
3362
3413
  if (parsedBody?.errorCode && typeof parsedBody.errorCode === "string") {
3363
3414
  context.errorCode = parsedBody.errorCode;
3415
+ } else if (typeof parsedBody?.errorCode === "number") {
3416
+ context.errorCode = String(parsedBody.errorCode);
3364
3417
  } else if (parsedBody?.code && typeof parsedBody.code === "string") {
3365
3418
  context.errorCode = parsedBody.code;
3366
3419
  }
@@ -3500,16 +3553,6 @@ function instructionsFor(ctx, err) {
3500
3553
  }
3501
3554
  }
3502
3555
 
3503
- // ../common/src/result-types.ts
3504
- var RESULTS = {
3505
- Success: "Success",
3506
- Failure: "Failure",
3507
- ConfigError: "ConfigError",
3508
- AuthenticationError: "AuthenticationError",
3509
- ValidationError: "ValidationError",
3510
- TimeoutError: "TimeoutError"
3511
- };
3512
-
3513
3556
  // ../../node_modules/commander/index.js
3514
3557
  var exports_commander = {};
3515
3558
  __exportCjs(exports_commander, {
@@ -3599,9 +3642,6 @@ var CONSOLE_FALLBACK = {
3599
3642
  function getOutputSink() {
3600
3643
  return outputStorage.getStore() ?? sinkSlot.get() ?? CONSOLE_FALLBACK;
3601
3644
  }
3602
- function setGlobalSink(sink) {
3603
- sinkSlot.set(sink);
3604
- }
3605
3645
 
3606
3646
  // ../common/src/logger.ts
3607
3647
  var logFilePathSlot = singleton("logFilePath");
@@ -3611,13 +3651,6 @@ function setGlobalLogFilePath(path) {
3611
3651
  function getGlobalLogFilePath() {
3612
3652
  return logFilePathSlot.get("");
3613
3653
  }
3614
- var LogLevel;
3615
- ((LogLevel) => {
3616
- LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG";
3617
- LogLevel[LogLevel["INFO"] = 1] = "INFO";
3618
- LogLevel[LogLevel["WARN"] = 2] = "WARN";
3619
- LogLevel[LogLevel["ERROR"] = 3] = "ERROR";
3620
- })(LogLevel ||= {});
3621
3654
  var DEFAULT_LOG_LEVEL = 2 /* WARN */;
3622
3655
 
3623
3656
  class SimpleLogger {
@@ -3795,20 +3828,6 @@ var logger = SimpleLogger.getInstance();
3795
3828
  function getLogFilePath() {
3796
3829
  return logger.getLogFilePath();
3797
3830
  }
3798
- function configureLogger(config) {
3799
- if (config.level !== undefined) {
3800
- logger.setLevel(config.level);
3801
- }
3802
- if (config.sink !== undefined) {
3803
- setGlobalSink(config.sink);
3804
- }
3805
- if (config.fileLogging !== undefined) {
3806
- logger.setFileLogging(config.fileLogging);
3807
- }
3808
- if (config.logFile !== undefined) {
3809
- logger.setLogFile(config.logFile);
3810
- }
3811
- }
3812
3831
 
3813
3832
  // ../common/src/timings.ts
3814
3833
  var TIMINGS_ENV_VAR = "UIP_TIMINGS";
@@ -3948,7 +3967,10 @@ var AUTH_ERROR_CODES = new Set([
3948
3967
  var LOCAL_PERMISSION_CLI_ERROR_CODES = new Set([
3949
3968
  "local_permission_denied"
3950
3969
  ]);
3951
- var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
3970
+ var VALIDATION_ERROR_CODES = new Set([
3971
+ "invalid_argument",
3972
+ "confirmation_required"
3973
+ ]);
3952
3974
  var NETWORK_HTTP_ERROR_CODES = new Set([
3953
3975
  "network_error",
3954
3976
  "rate_limited",
@@ -4174,6 +4196,103 @@ var CommonTelemetryEvents = {
4174
4196
  ShipSucceeded: "Cli.ShipSucceeded"
4175
4197
  };
4176
4198
 
4199
+ // ../common/src/telemetry/trace-context.ts
4200
+ var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
4201
+ var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
4202
+ function getProcessEnv() {
4203
+ return globalThis.process?.env;
4204
+ }
4205
+ function parseInboundTraceparent(value) {
4206
+ if (!value) {
4207
+ return;
4208
+ }
4209
+ const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
4210
+ if (!match) {
4211
+ return;
4212
+ }
4213
+ const [, traceId, parentSpanId] = match;
4214
+ if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
4215
+ return;
4216
+ }
4217
+ return { traceId, parentSpanId };
4218
+ }
4219
+ function getInboundTraceContext() {
4220
+ return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
4221
+ }
4222
+
4223
+ // ../common/src/telemetry/session-id.ts
4224
+ var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
4225
+ var SESSION_ID_MAX_LENGTH = 64;
4226
+ var RANDOM_SESSION_ID_LENGTH = 32;
4227
+ var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
4228
+ var CONTROL_CHARACTERS = /\p{Cc}/gu;
4229
+ var INHERITED_SESSION_SOURCES = [
4230
+ { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
4231
+ { envVar: "CODEX_THREAD_ID", source: "codex" },
4232
+ { envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
4233
+ { envVar: "TERM_SESSION_ID", source: "terminal" },
4234
+ { envVar: "WT_SESSION", source: "terminal" }
4235
+ ];
4236
+ var telemetrySessionSlot = singleton("TelemetrySession");
4237
+ var telemetryOperationIdSlot = singleton("TelemetryOperationId");
4238
+ function getProcessEnv2() {
4239
+ return globalThis.process?.env;
4240
+ }
4241
+ function normalizeSessionId(value) {
4242
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
4243
+ return;
4244
+ }
4245
+ const cleaned = String(value).replace(CONTROL_CHARACTERS, "").trim().slice(0, SESSION_ID_MAX_LENGTH);
4246
+ return cleaned || undefined;
4247
+ }
4248
+ function getConfiguredTelemetrySessionId() {
4249
+ return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
4250
+ }
4251
+ function getInheritedSession(env) {
4252
+ for (const candidate of INHERITED_SESSION_SOURCES) {
4253
+ const handle = normalizeSessionId(env[candidate.envVar]);
4254
+ if (handle) {
4255
+ return { id: handle, source: candidate.source };
4256
+ }
4257
+ }
4258
+ return;
4259
+ }
4260
+ function generateRandomSession() {
4261
+ const bytes = new Uint8Array(RANDOM_SESSION_ID_LENGTH / 2);
4262
+ crypto.getRandomValues(bytes);
4263
+ let hex = "";
4264
+ for (const byte of bytes) {
4265
+ hex += byte.toString(16).padStart(2, "0");
4266
+ }
4267
+ return { id: hex, source: "random" };
4268
+ }
4269
+ function resolveTelemetrySession() {
4270
+ const existing = telemetrySessionSlot.get();
4271
+ if (existing) {
4272
+ return existing;
4273
+ }
4274
+ const declaredHandle = getConfiguredTelemetrySessionId();
4275
+ const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
4276
+ telemetrySessionSlot.set(resolved);
4277
+ return resolved;
4278
+ }
4279
+ function getTelemetrySessionId() {
4280
+ return resolveTelemetrySession().id;
4281
+ }
4282
+ function getTelemetrySessionSource() {
4283
+ return resolveTelemetrySession().source;
4284
+ }
4285
+ function getTelemetryOperationId() {
4286
+ const existing = telemetryOperationIdSlot.get();
4287
+ if (existing) {
4288
+ return existing;
4289
+ }
4290
+ const inboundTraceId = getInboundTraceContext()?.traceId;
4291
+ const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
4292
+ telemetryOperationIdSlot.set(generated);
4293
+ return generated;
4294
+ }
4295
+
4177
4296
  // ../common/src/registry.ts
4178
4297
  import { execFileSync } from "node:child_process";
4179
4298
  function readRegistryValue(keyPath, valueName) {
@@ -4253,6 +4372,31 @@ function formatMessage(category, name, properties) {
4253
4372
  }
4254
4373
  return message;
4255
4374
  }
4375
+
4376
+ // ../common/src/telemetry/debug-telemetry-provider.ts
4377
+ class DebugTelemetryProvider {
4378
+ async trackEvent({ name }) {
4379
+ logger.debug(`[Telemetry] Event: ${name}`);
4380
+ }
4381
+ async trackException({ error }) {
4382
+ logger.error(`[Telemetry] Exception: ${error.message}`);
4383
+ }
4384
+ async trackRequest({
4385
+ name,
4386
+ durationMs,
4387
+ success
4388
+ }) {
4389
+ logger.debug(`[Telemetry] Request: ${name} (${durationMs}ms, ${success ? "ok" : "fail"})`);
4390
+ }
4391
+ async trackDependency({
4392
+ name,
4393
+ type,
4394
+ durationMs,
4395
+ success
4396
+ }) {
4397
+ logger.debug(`[Telemetry] Dependency: ${name} [${type}] (${durationMs}ms, ${success ? "ok" : "fail"})`);
4398
+ }
4399
+ }
4256
4400
  // ../common/src/telemetry/detect-agent.ts
4257
4401
  var KNOWN_AGENTS = [
4258
4402
  { envVar: "CLAUDECODE", value: "1", id: "claude-code" },
@@ -4395,102 +4539,6 @@ class NodeContextStorage {
4395
4539
  return this.storage.getStore();
4396
4540
  }
4397
4541
  }
4398
- // ../common/src/telemetry/trace-context.ts
4399
- var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
4400
- var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
4401
- function getProcessEnv() {
4402
- return globalThis.process?.env;
4403
- }
4404
- function parseInboundTraceparent(value) {
4405
- if (!value) {
4406
- return;
4407
- }
4408
- const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
4409
- if (!match) {
4410
- return;
4411
- }
4412
- const [, traceId, parentSpanId] = match;
4413
- if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
4414
- return;
4415
- }
4416
- return { traceId, parentSpanId };
4417
- }
4418
- function getInboundTraceContext() {
4419
- return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
4420
- }
4421
-
4422
- // ../common/src/telemetry/session-id.ts
4423
- var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
4424
- var SESSION_ID_MAX_LENGTH = 64;
4425
- var RANDOM_SESSION_ID_LENGTH = 32;
4426
- var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
4427
- var CONTROL_CHARACTERS = /\p{Cc}/gu;
4428
- var INHERITED_SESSION_SOURCES = [
4429
- { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
4430
- { envVar: "CODEX_THREAD_ID", source: "codex" },
4431
- { envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
4432
- { envVar: "TERM_SESSION_ID", source: "terminal" },
4433
- { envVar: "WT_SESSION", source: "terminal" }
4434
- ];
4435
- var telemetrySessionSlot = singleton("TelemetrySession");
4436
- var telemetryOperationIdSlot = singleton("TelemetryOperationId");
4437
- function getProcessEnv2() {
4438
- return globalThis.process?.env;
4439
- }
4440
- function normalizeSessionId(value) {
4441
- if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
4442
- return;
4443
- }
4444
- const cleaned = String(value).replace(CONTROL_CHARACTERS, "").trim().slice(0, SESSION_ID_MAX_LENGTH);
4445
- return cleaned || undefined;
4446
- }
4447
- function getConfiguredTelemetrySessionId() {
4448
- return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
4449
- }
4450
- function getInheritedSession(env) {
4451
- for (const candidate of INHERITED_SESSION_SOURCES) {
4452
- const handle = normalizeSessionId(env[candidate.envVar]);
4453
- if (handle) {
4454
- return { id: handle, source: candidate.source };
4455
- }
4456
- }
4457
- return;
4458
- }
4459
- function generateRandomSession() {
4460
- const bytes = new Uint8Array(RANDOM_SESSION_ID_LENGTH / 2);
4461
- crypto.getRandomValues(bytes);
4462
- let hex = "";
4463
- for (const byte of bytes) {
4464
- hex += byte.toString(16).padStart(2, "0");
4465
- }
4466
- return { id: hex, source: "random" };
4467
- }
4468
- function resolveTelemetrySession() {
4469
- const existing = telemetrySessionSlot.get();
4470
- if (existing) {
4471
- return existing;
4472
- }
4473
- const declaredHandle = getConfiguredTelemetrySessionId();
4474
- const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
4475
- telemetrySessionSlot.set(resolved);
4476
- return resolved;
4477
- }
4478
- function getTelemetrySessionId() {
4479
- return resolveTelemetrySession().id;
4480
- }
4481
- function getTelemetrySessionSource() {
4482
- return resolveTelemetrySession().source;
4483
- }
4484
- function getTelemetryOperationId() {
4485
- const existing = telemetryOperationIdSlot.get();
4486
- if (existing) {
4487
- return existing;
4488
- }
4489
- const inboundTraceId = getInboundTraceContext()?.traceId;
4490
- const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
4491
- telemetryOperationIdSlot.set(generated);
4492
- return generated;
4493
- }
4494
4542
  // ../common/src/telemetry/span-clock.ts
4495
4543
  function startSpanClock() {
4496
4544
  const started = performance.now();
@@ -4695,6 +4743,7 @@ var MAX_SPOOL_AGE_MS = 72 * 60 * 60 * 1000;
4695
4743
  // ../common/src/telemetry/telemetry-init.ts
4696
4744
  var telemetryInstanceSlot = singleton("TelemetryService");
4697
4745
  var DEFAULT_AI_CONNECTION_STRING = atob("SW5zdHJ1bWVudGF0aW9uS2V5PTliZDM3NDgyLTgxMGUtNDQyYS1hYWE2LWQzOGVmNjVjNjY3NDtJbmdlc3Rpb25FbmRwb2ludD1odHRwczovL3dlc3RldXJvcGUtNS5pbi5hcHBsaWNhdGlvbmluc2lnaHRzLmF6dXJlLmNvbS87TGl2ZUVuZHBvaW50PWh0dHBzOi8vd2VzdGV1cm9wZS5saXZlZGlhZ25vc3RpY3MubW9uaXRvci5henVyZS5jb20vO0FwcGxpY2F0aW9uSWQ9MzU2OTdlZjEtOGJkMC00ZjE5LWEyN2MtZDg3Y2NhYzY2ZDJj");
4746
+ var browserProviderSlot = singleton("BrowserAppInsightsTelemetryProvider");
4698
4747
  function getGlobalTelemetryInstance() {
4699
4748
  const existing = telemetryInstanceSlot.get();
4700
4749
  if (existing && typeof existing === "object" && "trackEvent" in existing && typeof existing.trackEvent === "function") {
@@ -4928,7 +4977,7 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
4928
4977
  const pagedRows = extractPagedRows(data.Data);
4929
4978
  const items = pagedRows ?? (Array.isArray(data.Data) ? data.Data : [data.Data]);
4930
4979
  items.forEach((item) => {
4931
- const values = Object.values(item).map((v) => v ?? "").join("\t");
4980
+ const values = item === null || typeof item !== "object" ? String(item ?? "") : Object.values(item).map((v) => v ?? "").join("\t");
4932
4981
  logFn(values);
4933
4982
  });
4934
4983
  } else {
@@ -4943,7 +4992,8 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
4943
4992
  default: {
4944
4993
  const hasData = "Data" in data && data.Data != null;
4945
4994
  const pagedRows = hasData ? extractPagedRows(data.Data) : null;
4946
- const rows = pagedRows ? pagedRows : Array.isArray(data.Data) ? data.Data : null;
4995
+ const resolvedRows = pagedRows ? pagedRows : Array.isArray(data.Data) ? data.Data : null;
4996
+ const rows = resolvedRows && isPrimitiveArray(resolvedRows) ? resolvedRows.map((entry) => ({ Value: entry })) : resolvedRows;
4947
4997
  if (hasData && !(rows !== null && rows.length === 0)) {
4948
4998
  const logValue = data.Log;
4949
4999
  if (rows !== null) {
@@ -5000,6 +5050,9 @@ function printTable(data, logFn, externalLogValue, tableRowStyle) {
5000
5050
  function isPlainObjectArray(value) {
5001
5051
  return Array.isArray(value) && value.length > 0 && value.every(isPlainRecord);
5002
5052
  }
5053
+ function isPrimitiveArray(value) {
5054
+ return Array.isArray(value) && value.length > 0 && value.every((entry) => entry === null || typeof entry !== "object");
5055
+ }
5003
5056
  function isNonEmptyPlainObject(value) {
5004
5057
  return isPlainRecord(value) && Object.keys(value).length > 0;
5005
5058
  }
@@ -5346,12 +5399,12 @@ class FilterEvaluationError extends Error {
5346
5399
  instructions;
5347
5400
  retry = "RetryWillNotFix";
5348
5401
  result = RESULTS.ValidationError;
5349
- constructor(filter, cause) {
5402
+ constructor(filter, cause, hint) {
5350
5403
  const underlying = cause instanceof Error ? cause.message : String(cause);
5351
- super(`Filter '${filter}' failed to evaluate: ${underlying}`);
5404
+ super(`Filter '${filter}' failed to evaluate: ${underlying}` + (hint ? ` ${hint.detail}` : ""));
5352
5405
  this.name = "FilterEvaluationError";
5353
5406
  this.filter = filter;
5354
- this.instructions = `The --output-filter expression '${filter}' failed at evaluation time. ` + "Note that --output-filter operates on the 'Data' field of the envelope, not the full object. " + "For example, on a list result use 'length(@)' instead of 'Data | length(@)'.";
5407
+ this.instructions = (hint ? `${hint.instructions} ` : "") + `The --output-filter expression '${filter}' failed at evaluation time. ` + "Note that --output-filter operates on the 'Data' field of the envelope, not the full object. " + "For example, on a list result use 'length(@)' instead of 'Data | length(@)'.";
5355
5408
  }
5356
5409
  }
5357
5410
 
@@ -5473,6 +5526,93 @@ function nameList(names, cap = 12) {
5473
5526
  const rest = names.length - shown.length;
5474
5527
  return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
5475
5528
  }
5529
+ function notFieldsOn(names, scope) {
5530
+ return `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
5531
+ }
5532
+ function failingFieldRead(ast, isList, fn, argIndex) {
5533
+ const [left, right, condition] = ast.children ?? [];
5534
+ let scopes = [];
5535
+ if (!isList) {
5536
+ scopes = [ast];
5537
+ } else if (ast.type === "FilterProjection" && left?.type === "Identity") {
5538
+ scopes = [condition, right];
5539
+ } else if (ast.type === "Projection" && (left?.type === "Identity" || left?.type === "Flatten" && left.children?.[0]?.type === "Identity")) {
5540
+ scopes = [right];
5541
+ }
5542
+ const reads = new Set;
5543
+ let tracked = 0;
5544
+ const visit = (node) => {
5545
+ if (!node)
5546
+ return;
5547
+ switch (node.type) {
5548
+ case "Function": {
5549
+ const arg = node.children?.[argIndex - 1];
5550
+ if (node.name === fn && arg?.type === "Field" && arg.name) {
5551
+ reads.add(arg.name);
5552
+ tracked++;
5553
+ }
5554
+ node.children?.forEach(visit);
5555
+ return;
5556
+ }
5557
+ case "AndExpression":
5558
+ case "OrExpression":
5559
+ case "NotExpression":
5560
+ case "Comparator":
5561
+ case "MultiSelectList":
5562
+ case "MultiSelectHash":
5563
+ node.children?.forEach(visit);
5564
+ return;
5565
+ case "KeyValuePair":
5566
+ visit(node.value);
5567
+ return;
5568
+ }
5569
+ };
5570
+ scopes.forEach(visit);
5571
+ const calls = (node) => {
5572
+ if (node === null || typeof node !== "object")
5573
+ return 0;
5574
+ const own = node.type === "Function" && node.name === fn ? 1 : 0;
5575
+ const next = node.type === "KeyValuePair" ? [node.value] : node.children ?? [];
5576
+ return own + next.reduce((sum, child) => sum + calls(child), 0);
5577
+ };
5578
+ return reads.size === 1 && tracked === calls(ast) ? [...reads][0] : undefined;
5579
+ }
5580
+ function fieldExpression(name) {
5581
+ return /^[A-Za-z_]\w*$/.test(name) ? name : JSON.stringify(name);
5582
+ }
5583
+ function evaluationHint(codec, filter, data, cause) {
5584
+ const underlying = cause instanceof Error ? cause.message : String(cause);
5585
+ const failure = /\b(\w+)\(\) expected argument (\d+) to be type (\S+) but received type null\b/.exec(underlying);
5586
+ if (!failure)
5587
+ return;
5588
+ const [, fn, position, expected] = failure;
5589
+ const name = failingFieldRead(codec.compile(filter), Array.isArray(data), fn, Number(position));
5590
+ if (name === undefined)
5591
+ return;
5592
+ const present = availableFields(data);
5593
+ if (present.length === 0)
5594
+ return;
5595
+ const scope = `${countRecords(data)} record(s)`;
5596
+ if (!present.includes(name)) {
5597
+ return {
5598
+ detail: `${notFieldsOn([name], scope)}. Available fields: ${nameList(present)}.`,
5599
+ instructions: "Use a field the records have; names are case-sensitive."
5600
+ };
5601
+ }
5602
+ const records = Array.isArray(data) ? data : [data];
5603
+ const unset = records.filter((r) => r?.[name] == null).length;
5604
+ const field = fieldExpression(name);
5605
+ let fallback;
5606
+ if (expected.split(",").includes("string")) {
5607
+ fallback = "''";
5608
+ } else if (expected.split(",").includes("array")) {
5609
+ fallback = "`[]`";
5610
+ }
5611
+ return {
5612
+ detail: `\`${name}\` is null or missing on ${unset} of the ${scope} it read.`,
5613
+ instructions: fallback ? `Give it a default where ${fn}() reads it, e.g. \`${field} || ${fallback}\`.` : `Filter out the records where \`${name}\` is null before ${fn}() reads it.`
5614
+ };
5615
+ }
5476
5616
  function buildFilterWarning(filter, data, outcome) {
5477
5617
  const present = availableFields(data);
5478
5618
  const refs = referencedFields(filter);
@@ -5480,7 +5620,7 @@ function buildFilterWarning(filter, data, outcome) {
5480
5620
  const unchecked = refs.nested.filter((name) => !present.includes(name));
5481
5621
  const count = countRecords(data);
5482
5622
  const scope = `${count} record(s)`;
5483
- const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
5623
+ const isNotAField = (names) => notFieldsOn(names, scope);
5484
5624
  const soundness = unchecked.length > 0 ? `${nameList(unchecked)} ${unchecked.length === 1 ? "reads" : "read"} below the top level, so ${unchecked.length === 1 ? "it was" : "they were"} not checked against the record keys` : refs.top.length > 0 ? "every field it names exists" : "";
5485
5625
  const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
5486
5626
  let detail;
@@ -5531,7 +5671,8 @@ function applyFilter(data, filter, onWarning) {
5531
5671
  try {
5532
5672
  result = codec.search(data, filter);
5533
5673
  } catch (err) {
5534
- throw new FilterEvaluationError(filter, err);
5674
+ const [, hint] = catchError(() => evaluationHint(codec, filter, data, err));
5675
+ throw new FilterEvaluationError(filter, err, hint);
5535
5676
  }
5536
5677
  const inputCount = countRecords(data);
5537
5678
  const warn = (outcome) => {
@@ -6422,7 +6563,7 @@ Command.prototype.trackedAction = function(context, fn, properties) {
6422
6563
  logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
6423
6564
  const typed = error;
6424
6565
  const customInstructions = typeof typed.instructions === "string" ? typed.instructions : undefined;
6425
- const customResult = typeof typed.result === "string" && typed.result !== RESULTS.Success && Object.values(RESULTS).includes(typed.result) ? typed.result : undefined;
6566
+ const customResult = carriedResult(error);
6426
6567
  const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
6427
6568
  const classified = cancellationExitCode === undefined ? await extractErrorDetails2(error) : undefined;
6428
6569
  const finalResult = customResult ?? classified?.result ?? RESULTS.Failure;
@@ -6493,6 +6634,46 @@ Command.prototype.trackedAction = function(context, fn, properties) {
6493
6634
  }
6494
6635
  });
6495
6636
  };
6637
+
6638
+ // ../common/src/packager-tool-import.ts
6639
+ var REGISTER_EXPORT = "registerPackagerFactories";
6640
+ async function importPackagerTool(specifier) {
6641
+ const [importError, mod] = await catchError(import(specifier));
6642
+ if (importError)
6643
+ return importError;
6644
+ const register = mod?.[REGISTER_EXPORT];
6645
+ if (typeof register !== "function") {
6646
+ logger.debug(`'${specifier}' has no '${REGISTER_EXPORT}' export — treating it as a ` + "legacy entry point that registered its factories at import.");
6647
+ return;
6648
+ }
6649
+ const [registerError] = catchError(() => {
6650
+ register();
6651
+ });
6652
+ return registerError;
6653
+ }
6654
+
6655
+ // ../common/src/tool-provider.ts
6656
+ var factorySlot = singleton("PackagerFactoryProvider");
6657
+ async function ensurePackagerFactory(verb, packageName) {
6658
+ const provider = factorySlot.get();
6659
+ if (provider) {
6660
+ await provider(verb);
6661
+ return;
6662
+ }
6663
+ const importError = packageName ? await loadPackagerTool(`${packageName}/packager-tool`) : undefined;
6664
+ if (packageName && !importError)
6665
+ return;
6666
+ throw new Error(packageName ? `Packing this project type needs '${packageName}'. Install it.` : `Packing this project type needs the packager factory for '${verb}', and no package provides it.`, { cause: importError });
6667
+ }
6668
+ async function loadPackagerTool(specifier) {
6669
+ const error = await importPackagerTool(specifier);
6670
+ if (error) {
6671
+ logger.debug(`No packager factory provider registered; import of '${specifier}' failed: ${error.message}`);
6672
+ return error;
6673
+ }
6674
+ logger.debug(`No packager factory provider registered; loaded '${specifier}' directly.`);
6675
+ return;
6676
+ }
6496
6677
  // ../common/src/classified-failure.ts
6497
6678
  function notSupportedFailure(operation, instructions, context) {
6498
6679
  return {
@@ -6545,14 +6726,17 @@ async function mapWithConcurrency(items, limit, fn) {
6545
6726
  return results;
6546
6727
  }
6547
6728
  // ../common/src/confirmation.ts
6548
- function requireConfirmation(flags, operation) {
6729
+ function requireConfirmation(flags, operation, options) {
6549
6730
  if (flags.yes === true || flags.force === true) {
6550
6731
  return true;
6551
6732
  }
6733
+ const message = options?.reversible ? `Confirmation required: this will ${operation}.` : `Confirmation required: this will ${operation} and cannot be undone.`;
6552
6734
  OutputFormatter.error({
6553
6735
  Result: RESULTS.Failure,
6554
- Message: `Confirmation required: this will ${operation} and cannot be undone.`,
6555
- Instructions: "Re-run with --yes to confirm."
6736
+ Message: message,
6737
+ Instructions: options?.instructions ?? "Re-run with --yes to confirm.",
6738
+ ErrorCode: "confirmation_required",
6739
+ Retry: "RetryWillNotFix"
6556
6740
  });
6557
6741
  processContext.exit(1);
6558
6742
  return false;
@@ -7394,6 +7578,8 @@ var FAILURE_STATUSES = new Set([
7394
7578
  "canceled",
7395
7579
  "stopped"
7396
7580
  ]);
7581
+ // ../common/src/relayed-output.ts
7582
+ var RELAYED_OUTPUT_SYMBOL = Symbol.for("@uipath/common/relayed-output");
7397
7583
  // ../common/src/screen-logger.ts
7398
7584
  var ScreenLogger;
7399
7585
  ((ScreenLogger) => {
@@ -7409,8 +7595,6 @@ function quoteForShell(value) {
7409
7595
  }
7410
7596
  // ../common/src/telemetry/ship-succeeded.ts
7411
7597
  var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
7412
- // ../common/src/tool-provider.ts
7413
- var factorySlot = singleton("PackagerFactoryProvider");
7414
7598
  // ../auth/src/catch-error.ts
7415
7599
  function isPromiseLike2(value) {
7416
7600
  return value !== null && typeof value === "object" && typeof value.then === "function";
@@ -7601,6 +7785,8 @@ var readTokenScopes = (accessToken) => accessToken ? pickScopes(decodeClaims(acc
7601
7785
  // ../auth/src/constants.ts
7602
7786
  var UIPATH_HOME_DIR = ".uipath";
7603
7787
  var AUTH_FILENAME = ".auth";
7788
+ var AUTH_FILE_MODE = 384;
7789
+ var AUTH_DIR_MODE = 448;
7604
7790
  var DEFAULT_BASE_URL = "https://cloud.uipath.com";
7605
7791
  var DEFAULT_AUTH_TIMEOUT_MS2 = 5 * 60 * 1000;
7606
7792
 
@@ -8265,6 +8451,38 @@ var loadEnvFileAsync = async ({ envPath }) => {
8265
8451
  }
8266
8452
  return parseEnvContent(content);
8267
8453
  };
8454
+ var findAuthHomeDir = (fs, dir) => {
8455
+ let current = dir;
8456
+ for (;; ) {
8457
+ if (fs.path.basename(current) === UIPATH_HOME_DIR)
8458
+ return current;
8459
+ const parent = fs.path.dirname(current);
8460
+ if (parent === current)
8461
+ return;
8462
+ current = parent;
8463
+ }
8464
+ };
8465
+ var TEMP_FILE_ATTEMPTS = 5;
8466
+ var isFileExists = (error) => error instanceof Error && error.code === "EEXIST";
8467
+ var writeTempFile = async (fs, targetPath, content) => {
8468
+ for (let attempt = 1;; attempt++) {
8469
+ const tempPath = `${targetPath}.${crypto.randomUUID()}.tmp`;
8470
+ try {
8471
+ await fs.writeFile(tempPath, content, {
8472
+ mode: AUTH_FILE_MODE,
8473
+ exclusive: true
8474
+ });
8475
+ return tempPath;
8476
+ } catch (error) {
8477
+ if (!isFileExists(error)) {
8478
+ await fs.rm(tempPath).catch(() => {});
8479
+ throw error;
8480
+ }
8481
+ if (attempt === TEMP_FILE_ATTEMPTS)
8482
+ throw error;
8483
+ }
8484
+ }
8485
+ };
8268
8486
  var saveEnvFileAsync = async ({
8269
8487
  envPath,
8270
8488
  data,
@@ -8292,10 +8510,18 @@ var saveEnvFileAsync = async ({
8292
8510
  `)}
8293
8511
  `;
8294
8512
  const dir = fs.path.dirname(absolutePath);
8295
- await fs.mkdir(dir);
8296
- const tempPath = `${absolutePath}.tmp`;
8297
- await fs.writeFile(tempPath, content);
8298
- await fs.rename(tempPath, absolutePath);
8513
+ await fs.mkdir(dir, { mode: AUTH_DIR_MODE });
8514
+ const authHomeDir = findAuthHomeDir(fs, dir);
8515
+ if (authHomeDir !== undefined) {
8516
+ await fs.chmod?.(authHomeDir, AUTH_DIR_MODE);
8517
+ }
8518
+ const tempPath = await writeTempFile(fs, absolutePath, content);
8519
+ try {
8520
+ await fs.rename(tempPath, absolutePath);
8521
+ } catch (error) {
8522
+ await fs.rm(tempPath).catch(() => {});
8523
+ throw error;
8524
+ }
8299
8525
  };
8300
8526
 
8301
8527
  // ../auth/src/loginStatus.ts
@@ -8890,6 +9116,6 @@ var TENANT_SELECTION_CODES = new Set([
8890
9116
  TENANT_SELECTION_REQUIRED_CODE,
8891
9117
  INVALID_TENANT_CODE
8892
9118
  ]);
8893
- export { getFileSystem, catchError, isCliErrorCode, isRetryHint, isHtmlDocument, extractErrorDetails2, extractErrorMessage, instructionsFor, RESULTS, notSupportedFailure, InvalidArgumentError, Command, Option, getOutputSink, LogLevel, logger, configureLogger, EXIT_CODES, Pagination, SuccessOutput, OutputFormatter, processContext, mapWithConcurrency, requireConfirmation, isGuid, resolveDeprecatedOptionAlias, warnDeprecatedOptionAlias, addDeprecatedOptionAlias, createHiddenDeprecatedTenantOption, parseLimit, parseOffset, parseBoundedInt, PollOutcome, ErrorDecision, mapPollFailure, pollUntil, quoteForShell, resolveSessionIdentity, getAuthContext };
9119
+ export { NodeFileSystem, getFileSystem, projectKey, PROJECT_IDENTITY_LOOKUP_BUDGET_MS, withinProjectIdentityBudget, catchError, RESULTS, isCliErrorCode, isRetryHint, carriedErrorCode, carriedInstructions, isHtmlDocument, classifyThrownError, extractErrorDetails2, extractErrorMessage, instructionsFor, notSupportedFailure, InvalidArgumentError, Command, Option, getOutputSink, logger, DebugTelemetryProvider, NodeContextStorage, TelemetryService, EXIT_CODES, exitCodeForResult, Pagination, SuccessOutput, OutputFormatter, processContext, mapWithConcurrency, requireConfirmation, isGuid, resolveDeprecatedOptionAlias, warnDeprecatedOptionAlias, addDeprecatedOptionAlias, createHiddenDeprecatedTenantOption, parseLimit, parseOffset, parseBoundedInt, PollOutcome, ErrorDecision, mapPollFailure, pollUntil, quoteForShell, ensurePackagerFactory, resolveSessionIdentity, getAuthContext };
8894
9120
 
8895
- //# debugId=419B0C1C8F7A1A8264756E2164756E21
9121
+ //# debugId=19C1553EDE777C9F64756E2164756E21