@uipath/rules-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.
Files changed (50) hide show
  1. package/dist/DmnFactory-2Z66XPBB-dcse77vg.js +10 -0
  2. package/dist/DmnModelTypes-QISEK3CY-vth5tgqd.js +8 -0
  3. package/dist/KieDmnMarshaller-KLYKOHUQ-jae862c0.js +8 -0
  4. package/dist/THIRD-PARTY-NOTICES.md +6 -6
  5. package/dist/{business-rules-zfzwr08c.js → business-rules-4b4d9pw6.js} +4 -4
  6. package/dist/{constants-1sdwfz26.js → constants-yt6m7vkn.js} +12 -12
  7. package/dist/{first-party-service-ej32b6j2.js → first-party-service-r63v6skt.js} +1 -1
  8. package/dist/hitPolicyResult-2NPUZW2E-rddfkhb2.js +14 -0
  9. package/dist/{index-y5yffb2s.js → index-189nh3zq.js} +642 -513
  10. package/dist/{index-88sps467.js → index-g955264n.js} +7 -5
  11. package/dist/index-jm0j1yn2.js +212 -0
  12. package/dist/{index-s9wmt93c.js → index-thn9n1n9.js} +1 -1
  13. package/dist/index-xvy3d6qz.js +8 -0
  14. package/dist/index.js +2 -2
  15. package/dist/{rule-catalog-780050xk.js → rule-catalog-0zntgf3s.js} +34 -10
  16. package/dist/rules-command-error-5jq3z0ny.js +15 -0
  17. package/dist/{rules-debug-service-97ye6e73.js → rules-debug-service-cfaqvnep.js} +16 -9
  18. package/dist/{rules-init-service-21zyjtff.js → rules-init-service-vhd0gzmd.js} +7 -7
  19. package/dist/{rules-refresh-service-x3gfnfqt.js → rules-refresh-service-r7fpbbfv.js} +3 -3
  20. package/dist/{rules-validate-service-e47hgykv.js → rules-validate-service-jrw7c1q9.js} +8 -10
  21. package/dist/{solution-definition-helper-trxp0zbj.js → solution-definition-helper-s5v427j0.js} +1 -1
  22. package/dist/{tool-6m0p5jax.js → tool-0r1ykkjf.js} +12 -5
  23. package/dist/{tool-yfaf9b8c.js → tool-19fj7ema.js} +36 -9
  24. package/dist/{tool-sjp6fvze.js → tool-2cxm18e8.js} +2 -2
  25. package/dist/tool-2grmcreg.js +117 -0
  26. package/dist/{tool-b475et36.js → tool-46g75ed0.js} +3 -3
  27. package/dist/{tool-syavphgt.js → tool-5sgkktdb.js} +287 -139
  28. package/dist/{tool-dt23fa28.js → tool-a1wk2tqc.js} +28 -26
  29. package/dist/{tool-jzdt6z77.js → tool-c0peefw8.js} +7 -6
  30. package/dist/tool-e83bfqmj.js +192 -0
  31. package/dist/{tool-3755q59j.js → tool-fsmgxvqa.js} +189 -15
  32. package/dist/tool-fv5xtqv5.js +736 -0
  33. package/dist/{tool-vqm4apm6.js → tool-jykscmfk.js} +206 -203
  34. package/dist/{tool-0tbve332.js → tool-kmzhfjw8.js} +64 -10
  35. package/dist/tool-q02dmnzm.js +74 -0
  36. package/dist/{tool-93hqhaj3.js → tool-q3jw2emw.js} +100 -96
  37. package/dist/tool.js +2 -2
  38. package/package.json +2 -2
  39. package/dist/DmnFactory-L7MABUC6-q2sr3grz.js +0 -10
  40. package/dist/DmnModelTypes-ATR7FVKZ-h8srwcxk.js +0 -8
  41. package/dist/KieDmnMarshaller-LGE63WDG-nfkpv8f4.js +0 -8
  42. package/dist/hitPolicyResult-CGCR73CW-jz89f1aa.js +0 -12
  43. package/dist/index-egzwtc07.js +0 -19
  44. package/dist/index-z4kt2kt6.js +0 -8
  45. package/dist/index-zeszs1ra.js +0 -184
  46. package/dist/rules-command-error-2x1vm0wt.js +0 -13
  47. package/dist/tool-2nmqvfmt.js +0 -26
  48. package/dist/tool-89e90qrm.js +0 -777
  49. package/dist/tool-m59a481n.js +0 -49
  50. package/dist/tool-sbtf80ft.js +0 -218
@@ -2127,12 +2127,26 @@ class NodeFileSystem {
2127
2127
  throw error;
2128
2128
  }
2129
2129
  }
2130
- async writeFile(filePath, data) {
2130
+ async writeFile(filePath, data, options) {
2131
2131
  const dir = path.dirname(filePath);
2132
2132
  if (dir) {
2133
2133
  await fs.mkdir(dir, { recursive: true });
2134
2134
  }
2135
- await fs.writeFile(filePath, data);
2135
+ if (options?.mode === undefined || process.platform === "win32") {
2136
+ if (options?.exclusive) {
2137
+ await fs.writeFile(filePath, data, { flag: "wx" });
2138
+ } else {
2139
+ await fs.writeFile(filePath, data);
2140
+ }
2141
+ return;
2142
+ }
2143
+ const handle = await fs.open(filePath, options.exclusive ? "wx" : "w", options.mode);
2144
+ try {
2145
+ await handle.chmod(options.mode);
2146
+ await handle.writeFile(data);
2147
+ } finally {
2148
+ await handle.close();
2149
+ }
2136
2150
  }
2137
2151
  async appendFile(filePath, data) {
2138
2152
  const dir = path.dirname(filePath);
@@ -2167,7 +2181,8 @@ class NodeFileSystem {
2167
2181
  isDirectory: () => stats.isDirectory(),
2168
2182
  size: stats.size,
2169
2183
  mtimeMs: stats.mtimeMs,
2170
- ctimeMs: stats.ctimeMs
2184
+ ctimeMs: stats.ctimeMs,
2185
+ mode: stats.mode
2171
2186
  };
2172
2187
  } catch (error) {
2173
2188
  if (this.isEnoent(error))
@@ -2178,8 +2193,13 @@ class NodeFileSystem {
2178
2193
  async exists(filePath) {
2179
2194
  return existsSync(filePath);
2180
2195
  }
2181
- async mkdir(dirPath) {
2182
- await fs.mkdir(dirPath, { recursive: true });
2196
+ async mkdir(dirPath, options) {
2197
+ await fs.mkdir(dirPath, { recursive: true, mode: options?.mode });
2198
+ }
2199
+ async chmod(targetPath, mode) {
2200
+ if (process.platform === "win32")
2201
+ return;
2202
+ await fs.chmod(targetPath, mode);
2183
2203
  }
2184
2204
  async acquireLock(lockPath) {
2185
2205
  const canonicalPath = await this.canonicalizeLockTarget(lockPath);
@@ -2329,7 +2349,7 @@ class NodeFileSystem {
2329
2349
  async getTempDir() {
2330
2350
  return await fs.mkdtemp(path.join(os.tmpdir(), "uipath-fs-"));
2331
2351
  }
2332
- async copyDirectory(sourcePath, destPath) {
2352
+ async copyDirectory(sourcePath, destPath, options) {
2333
2353
  const sourceStats = await this.stat(sourcePath);
2334
2354
  if (!sourceStats) {
2335
2355
  throw new Error(`Source directory does not exist: ${sourcePath}`);
@@ -2346,7 +2366,9 @@ class NodeFileSystem {
2346
2366
  if (!entryStats)
2347
2367
  continue;
2348
2368
  if (entryStats.isDirectory()) {
2349
- await this.copyDirectory(srcEntry, destEntry);
2369
+ if (options?.skipDirectoryNames?.includes(entry))
2370
+ continue;
2371
+ await this.copyDirectory(srcEntry, destEntry, options);
2350
2372
  } else if (entryStats.isFile()) {
2351
2373
  const content = await this.readFile(srcEntry);
2352
2374
  if (content !== null) {
@@ -2409,13 +2431,15 @@ var ProjectDimensions = {
2409
2431
  SolutionKey: "SolutionKey",
2410
2432
  SolutionProjectKey: "SolutionProjectKey",
2411
2433
  SolutionIdentityStatus: "SolutionIdentityStatus",
2412
- PreviousSolutionKey: "PreviousSolutionKey"
2434
+ PreviousSolutionKey: "PreviousSolutionKey",
2435
+ PreviousProjectKey: "PreviousProjectKey"
2413
2436
  };
2414
2437
  var GUID_KEY_DIMENSIONS = new Set([
2415
2438
  ProjectDimensions.ProjectKey,
2416
2439
  ProjectDimensions.SolutionKey,
2417
2440
  ProjectDimensions.SolutionProjectKey,
2418
- ProjectDimensions.PreviousSolutionKey
2441
+ ProjectDimensions.PreviousSolutionKey,
2442
+ ProjectDimensions.PreviousProjectKey
2419
2443
  ]);
2420
2444
  var ShipDimensions = {
2421
2445
  ShipKind: "ShipKind",
@@ -2569,9 +2593,7 @@ async function withinProjectIdentityBudget(work, onTimeout) {
2569
2593
  }
2570
2594
  }
2571
2595
 
2572
- // ../common/src/telemetry/pseudonymize.ts
2573
- var PSEUDONYM_DOMAIN = "uipath-cli/telemetry/pseudonym/v1:";
2574
- var PSEUDONYM_HEX_LENGTH = 32;
2596
+ // ../common/src/sha256.ts
2575
2597
  var SHA256_K = new Uint32Array([
2576
2598
  1116352408,
2577
2599
  1899447441,
@@ -2651,7 +2673,7 @@ var SHA256_INITIAL_STATE = new Uint32Array([
2651
2673
  function rotr(value, bits) {
2652
2674
  return (value >>> bits | value << 32 - bits) >>> 0;
2653
2675
  }
2654
- function sha256Hex(input) {
2676
+ function sha256Words(input) {
2655
2677
  const bytes = new TextEncoder().encode(input);
2656
2678
  const paddedLength = bytes.length + 9 + 63 >> 6 << 6;
2657
2679
  const buffer = new Uint8Array(paddedLength);
@@ -2707,12 +2729,19 @@ function sha256Hex(input) {
2707
2729
  state[6] = state[6] + g >>> 0;
2708
2730
  state[7] = state[7] + h >>> 0;
2709
2731
  }
2732
+ return state;
2733
+ }
2734
+ function sha256Hex(input) {
2710
2735
  let hex = "";
2711
- for (const word of state) {
2736
+ for (const word of sha256Words(input)) {
2712
2737
  hex += word.toString(16).padStart(8, "0");
2713
2738
  }
2714
2739
  return hex;
2715
2740
  }
2741
+
2742
+ // ../common/src/telemetry/pseudonymize.ts
2743
+ var PSEUDONYM_DOMAIN = "uipath-cli/telemetry/pseudonym/v1:";
2744
+ var PSEUDONYM_HEX_LENGTH = 32;
2716
2745
  function resolveSha256Hex() {
2717
2746
  try {
2718
2747
  const nodeCrypto = __require("node:crypto");
@@ -3108,13 +3137,25 @@ function settlePromiseLike(thenable) {
3108
3137
  return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [toError(error), undefined]);
3109
3138
  }
3110
3139
 
3140
+ // ../common/src/result-types.ts
3141
+ var RESULTS = {
3142
+ Success: "Success",
3143
+ Failure: "Failure",
3144
+ ConfigError: "ConfigError",
3145
+ AuthenticationError: "AuthenticationError",
3146
+ ValidationError: "ValidationError",
3147
+ TimeoutError: "TimeoutError"
3148
+ };
3149
+
3111
3150
  // ../common/src/error-codes.ts
3112
3151
  var CLI_ERROR_CODES = [
3113
3152
  "invalid_argument",
3153
+ "confirmation_required",
3114
3154
  "authentication_required",
3115
3155
  "permission_denied",
3116
3156
  "local_permission_denied",
3117
3157
  "not_found",
3158
+ "not_enabled",
3118
3159
  "rate_limited",
3119
3160
  "network_error",
3120
3161
  "timeout",
@@ -3153,6 +3194,12 @@ function carriedRetry(error) {
3153
3194
  const retry = error.retry;
3154
3195
  return isRetryHint(retry) ? retry : undefined;
3155
3196
  }
3197
+ function carriedResult(error) {
3198
+ if (!error || typeof error !== "object")
3199
+ return;
3200
+ const result = error.result;
3201
+ return typeof result === "string" && result !== RESULTS.Success && Object.values(RESULTS).includes(result) ? result : undefined;
3202
+ }
3156
3203
  function defaultRetryForErrorCode(errorCode) {
3157
3204
  switch (errorCode) {
3158
3205
  case "network_error":
@@ -3542,6 +3589,8 @@ async function extractErrorDetails(error, options) {
3542
3589
  }
3543
3590
  if (parsedBody?.errorCode && typeof parsedBody.errorCode === "string") {
3544
3591
  context.errorCode = parsedBody.errorCode;
3592
+ } else if (typeof parsedBody?.errorCode === "number") {
3593
+ context.errorCode = String(parsedBody.errorCode);
3545
3594
  } else if (parsedBody?.code && typeof parsedBody.code === "string") {
3546
3595
  context.errorCode = parsedBody.code;
3547
3596
  }
@@ -3617,19 +3666,9 @@ function extractErrorMessageSync(error) {
3617
3666
  return describeThrownValue(error);
3618
3667
  }
3619
3668
 
3620
- // ../common/src/result-types.ts
3621
- var RESULTS = {
3622
- Success: "Success",
3623
- Failure: "Failure",
3624
- ConfigError: "ConfigError",
3625
- AuthenticationError: "AuthenticationError",
3626
- ValidationError: "ValidationError",
3627
- TimeoutError: "TimeoutError"
3628
- };
3629
-
3630
3669
  // ../common/src/classified-failure.ts
3631
- async function classifiedFailure(message, error) {
3632
- const details = await extractErrorDetails(error);
3670
+ async function classifiedFailure(message, error, options) {
3671
+ const details = await extractErrorDetails(error, options);
3633
3672
  return {
3634
3673
  Result: details.result,
3635
3674
  ErrorCode: details.errorCode,
@@ -3639,6 +3678,16 @@ async function classifiedFailure(message, error) {
3639
3678
  ...details.context ? { Context: details.context } : {}
3640
3679
  };
3641
3680
  }
3681
+ function notSupportedFailure(operation, instructions, context) {
3682
+ return {
3683
+ Result: RESULTS.Failure,
3684
+ ErrorCode: "not_supported",
3685
+ Message: `${operation} isn't supported on the connected environment.`,
3686
+ Instructions: instructions,
3687
+ Retry: "RetryWillNotFix",
3688
+ ...context ? { Context: context } : {}
3689
+ };
3690
+ }
3642
3691
 
3643
3692
  // ../../node_modules/commander/index.js
3644
3693
  var exports_commander = {};
@@ -4054,7 +4103,10 @@ var AUTH_ERROR_CODES = new Set([
4054
4103
  var LOCAL_PERMISSION_CLI_ERROR_CODES = new Set([
4055
4104
  "local_permission_denied"
4056
4105
  ]);
4057
- var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
4106
+ var VALIDATION_ERROR_CODES = new Set([
4107
+ "invalid_argument",
4108
+ "confirmation_required"
4109
+ ]);
4058
4110
  var NETWORK_HTTP_ERROR_CODES = new Set([
4059
4111
  "network_error",
4060
4112
  "rate_limited",
@@ -4280,6 +4332,109 @@ var CommonTelemetryEvents = {
4280
4332
  ShipSucceeded: "Cli.ShipSucceeded"
4281
4333
  };
4282
4334
 
4335
+ // ../common/src/telemetry/global-telemetry-properties.ts
4336
+ var telemetryPropsSlot = singleton("TelemetryDefaultProps");
4337
+ function getGlobalTelemetryProperties() {
4338
+ return telemetryPropsSlot.get();
4339
+ }
4340
+
4341
+ // ../common/src/telemetry/trace-context.ts
4342
+ var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
4343
+ var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
4344
+ function getProcessEnv() {
4345
+ return globalThis.process?.env;
4346
+ }
4347
+ function parseInboundTraceparent(value) {
4348
+ if (!value) {
4349
+ return;
4350
+ }
4351
+ const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
4352
+ if (!match) {
4353
+ return;
4354
+ }
4355
+ const [, traceId, parentSpanId] = match;
4356
+ if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
4357
+ return;
4358
+ }
4359
+ return { traceId, parentSpanId };
4360
+ }
4361
+ function getInboundTraceContext() {
4362
+ return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
4363
+ }
4364
+
4365
+ // ../common/src/telemetry/session-id.ts
4366
+ var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
4367
+ var SESSION_ID_MAX_LENGTH = 64;
4368
+ var RANDOM_SESSION_ID_LENGTH = 32;
4369
+ var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
4370
+ var CONTROL_CHARACTERS = /\p{Cc}/gu;
4371
+ var INHERITED_SESSION_SOURCES = [
4372
+ { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
4373
+ { envVar: "CODEX_THREAD_ID", source: "codex" },
4374
+ { envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
4375
+ { envVar: "TERM_SESSION_ID", source: "terminal" },
4376
+ { envVar: "WT_SESSION", source: "terminal" }
4377
+ ];
4378
+ var telemetrySessionSlot = singleton("TelemetrySession");
4379
+ var telemetryOperationIdSlot = singleton("TelemetryOperationId");
4380
+ function getProcessEnv2() {
4381
+ return globalThis.process?.env;
4382
+ }
4383
+ function normalizeSessionId(value) {
4384
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
4385
+ return;
4386
+ }
4387
+ const cleaned = String(value).replace(CONTROL_CHARACTERS, "").trim().slice(0, SESSION_ID_MAX_LENGTH);
4388
+ return cleaned || undefined;
4389
+ }
4390
+ function getConfiguredTelemetrySessionId() {
4391
+ return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
4392
+ }
4393
+ function getInheritedSession(env) {
4394
+ for (const candidate of INHERITED_SESSION_SOURCES) {
4395
+ const handle = normalizeSessionId(env[candidate.envVar]);
4396
+ if (handle) {
4397
+ return { id: handle, source: candidate.source };
4398
+ }
4399
+ }
4400
+ return;
4401
+ }
4402
+ function generateRandomSession() {
4403
+ const bytes = new Uint8Array(RANDOM_SESSION_ID_LENGTH / 2);
4404
+ crypto.getRandomValues(bytes);
4405
+ let hex = "";
4406
+ for (const byte of bytes) {
4407
+ hex += byte.toString(16).padStart(2, "0");
4408
+ }
4409
+ return { id: hex, source: "random" };
4410
+ }
4411
+ function resolveTelemetrySession() {
4412
+ const existing = telemetrySessionSlot.get();
4413
+ if (existing) {
4414
+ return existing;
4415
+ }
4416
+ const declaredHandle = getConfiguredTelemetrySessionId();
4417
+ const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
4418
+ telemetrySessionSlot.set(resolved);
4419
+ return resolved;
4420
+ }
4421
+ function getTelemetrySessionId() {
4422
+ return resolveTelemetrySession().id;
4423
+ }
4424
+ function getTelemetrySessionSource() {
4425
+ return resolveTelemetrySession().source;
4426
+ }
4427
+ function getTelemetryOperationId() {
4428
+ const existing = telemetryOperationIdSlot.get();
4429
+ if (existing) {
4430
+ return existing;
4431
+ }
4432
+ const inboundTraceId = getInboundTraceContext()?.traceId;
4433
+ const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
4434
+ telemetryOperationIdSlot.set(generated);
4435
+ return generated;
4436
+ }
4437
+
4283
4438
  // ../common/src/registry.ts
4284
4439
  import { execFileSync } from "node:child_process";
4285
4440
  function readRegistryValue(keyPath, valueName) {
@@ -4501,108 +4656,6 @@ class NodeContextStorage {
4501
4656
  return this.storage.getStore();
4502
4657
  }
4503
4658
  }
4504
- // ../common/src/telemetry/trace-context.ts
4505
- var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
4506
- var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
4507
- function getProcessEnv() {
4508
- return globalThis.process?.env;
4509
- }
4510
- function parseInboundTraceparent(value) {
4511
- if (!value) {
4512
- return;
4513
- }
4514
- const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
4515
- if (!match) {
4516
- return;
4517
- }
4518
- const [, traceId, parentSpanId] = match;
4519
- if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
4520
- return;
4521
- }
4522
- return { traceId, parentSpanId };
4523
- }
4524
- function getInboundTraceContext() {
4525
- return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
4526
- }
4527
-
4528
- // ../common/src/telemetry/session-id.ts
4529
- var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
4530
- var SESSION_ID_MAX_LENGTH = 64;
4531
- var RANDOM_SESSION_ID_LENGTH = 32;
4532
- var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
4533
- var CONTROL_CHARACTERS = /\p{Cc}/gu;
4534
- var INHERITED_SESSION_SOURCES = [
4535
- { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
4536
- { envVar: "CODEX_THREAD_ID", source: "codex" },
4537
- { envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
4538
- { envVar: "TERM_SESSION_ID", source: "terminal" },
4539
- { envVar: "WT_SESSION", source: "terminal" }
4540
- ];
4541
- var telemetrySessionSlot = singleton("TelemetrySession");
4542
- var telemetryOperationIdSlot = singleton("TelemetryOperationId");
4543
- function getProcessEnv2() {
4544
- return globalThis.process?.env;
4545
- }
4546
- function normalizeSessionId(value) {
4547
- if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
4548
- return;
4549
- }
4550
- const cleaned = String(value).replace(CONTROL_CHARACTERS, "").trim().slice(0, SESSION_ID_MAX_LENGTH);
4551
- return cleaned || undefined;
4552
- }
4553
- function getConfiguredTelemetrySessionId() {
4554
- return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
4555
- }
4556
- function getInheritedSession(env) {
4557
- for (const candidate of INHERITED_SESSION_SOURCES) {
4558
- const handle = normalizeSessionId(env[candidate.envVar]);
4559
- if (handle) {
4560
- return { id: handle, source: candidate.source };
4561
- }
4562
- }
4563
- return;
4564
- }
4565
- function generateRandomSession() {
4566
- const bytes = new Uint8Array(RANDOM_SESSION_ID_LENGTH / 2);
4567
- crypto.getRandomValues(bytes);
4568
- let hex = "";
4569
- for (const byte of bytes) {
4570
- hex += byte.toString(16).padStart(2, "0");
4571
- }
4572
- return { id: hex, source: "random" };
4573
- }
4574
- function resolveTelemetrySession() {
4575
- const existing = telemetrySessionSlot.get();
4576
- if (existing) {
4577
- return existing;
4578
- }
4579
- const declaredHandle = getConfiguredTelemetrySessionId();
4580
- const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
4581
- telemetrySessionSlot.set(resolved);
4582
- return resolved;
4583
- }
4584
- function getTelemetrySessionId() {
4585
- return resolveTelemetrySession().id;
4586
- }
4587
- function getTelemetrySessionSource() {
4588
- return resolveTelemetrySession().source;
4589
- }
4590
- function getTelemetryOperationId() {
4591
- const existing = telemetryOperationIdSlot.get();
4592
- if (existing) {
4593
- return existing;
4594
- }
4595
- const inboundTraceId = getInboundTraceContext()?.traceId;
4596
- const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
4597
- telemetryOperationIdSlot.set(generated);
4598
- return generated;
4599
- }
4600
- // ../common/src/telemetry/global-telemetry-properties.ts
4601
- var telemetryPropsSlot = singleton("TelemetryDefaultProps");
4602
- function getGlobalTelemetryProperties() {
4603
- return telemetryPropsSlot.get();
4604
- }
4605
-
4606
4659
  // ../common/src/telemetry/span-clock.ts
4607
4660
  function startSpanClock() {
4608
4661
  const started = performance.now();
@@ -4816,6 +4869,7 @@ var MAX_SPOOL_AGE_MS = 72 * 60 * 60 * 1000;
4816
4869
  // ../common/src/telemetry/telemetry-init.ts
4817
4870
  var telemetryInstanceSlot = singleton("TelemetryService");
4818
4871
  var DEFAULT_AI_CONNECTION_STRING = atob("SW5zdHJ1bWVudGF0aW9uS2V5PTliZDM3NDgyLTgxMGUtNDQyYS1hYWE2LWQzOGVmNjVjNjY3NDtJbmdlc3Rpb25FbmRwb2ludD1odHRwczovL3dlc3RldXJvcGUtNS5pbi5hcHBsaWNhdGlvbmluc2lnaHRzLmF6dXJlLmNvbS87TGl2ZUVuZHBvaW50PWh0dHBzOi8vd2VzdGV1cm9wZS5saXZlZGlhZ25vc3RpY3MubW9uaXRvci5henVyZS5jb20vO0FwcGxpY2F0aW9uSWQ9MzU2OTdlZjEtOGJkMC00ZjE5LWEyN2MtZDg3Y2NhYzY2ZDJj");
4872
+ var browserProviderSlot = singleton("BrowserAppInsightsTelemetryProvider");
4819
4873
  function getGlobalTelemetryInstance() {
4820
4874
  const existing = telemetryInstanceSlot.get();
4821
4875
  if (existing && typeof existing === "object" && "trackEvent" in existing && typeof existing.trackEvent === "function") {
@@ -5032,7 +5086,7 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
5032
5086
  const pagedRows = extractPagedRows(data.Data);
5033
5087
  const items = pagedRows ?? (Array.isArray(data.Data) ? data.Data : [data.Data]);
5034
5088
  items.forEach((item) => {
5035
- const values = Object.values(item).map((v) => v ?? "").join("\t");
5089
+ const values = item === null || typeof item !== "object" ? String(item ?? "") : Object.values(item).map((v) => v ?? "").join("\t");
5036
5090
  logFn(values);
5037
5091
  });
5038
5092
  } else {
@@ -5047,7 +5101,8 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
5047
5101
  default: {
5048
5102
  const hasData = "Data" in data && data.Data != null;
5049
5103
  const pagedRows = hasData ? extractPagedRows(data.Data) : null;
5050
- const rows = pagedRows ? pagedRows : Array.isArray(data.Data) ? data.Data : null;
5104
+ const resolvedRows = pagedRows ? pagedRows : Array.isArray(data.Data) ? data.Data : null;
5105
+ const rows = resolvedRows && isPrimitiveArray(resolvedRows) ? resolvedRows.map((entry) => ({ Value: entry })) : resolvedRows;
5051
5106
  if (hasData && !(rows !== null && rows.length === 0)) {
5052
5107
  const logValue = data.Log;
5053
5108
  if (rows !== null) {
@@ -5104,6 +5159,9 @@ function printTable(data, logFn, externalLogValue, tableRowStyle) {
5104
5159
  function isPlainObjectArray(value) {
5105
5160
  return Array.isArray(value) && value.length > 0 && value.every(isPlainRecord);
5106
5161
  }
5162
+ function isPrimitiveArray(value) {
5163
+ return Array.isArray(value) && value.length > 0 && value.every((entry) => entry === null || typeof entry !== "object");
5164
+ }
5107
5165
  function isNonEmptyPlainObject(value) {
5108
5166
  return isPlainRecord(value) && Object.keys(value).length > 0;
5109
5167
  }
@@ -5450,12 +5508,12 @@ class FilterEvaluationError extends Error {
5450
5508
  instructions;
5451
5509
  retry = "RetryWillNotFix";
5452
5510
  result = RESULTS.ValidationError;
5453
- constructor(filter, cause) {
5511
+ constructor(filter, cause, hint) {
5454
5512
  const underlying = cause instanceof Error ? cause.message : String(cause);
5455
- super(`Filter '${filter}' failed to evaluate: ${underlying}`);
5513
+ super(`Filter '${filter}' failed to evaluate: ${underlying}` + (hint ? ` ${hint.detail}` : ""));
5456
5514
  this.name = "FilterEvaluationError";
5457
5515
  this.filter = filter;
5458
- 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(@)'.";
5516
+ 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(@)'.";
5459
5517
  }
5460
5518
  }
5461
5519
 
@@ -5577,6 +5635,93 @@ function nameList(names, cap = 12) {
5577
5635
  const rest = names.length - shown.length;
5578
5636
  return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
5579
5637
  }
5638
+ function notFieldsOn(names, scope) {
5639
+ return `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
5640
+ }
5641
+ function failingFieldRead(ast, isList, fn, argIndex) {
5642
+ const [left, right, condition] = ast.children ?? [];
5643
+ let scopes = [];
5644
+ if (!isList) {
5645
+ scopes = [ast];
5646
+ } else if (ast.type === "FilterProjection" && left?.type === "Identity") {
5647
+ scopes = [condition, right];
5648
+ } else if (ast.type === "Projection" && (left?.type === "Identity" || left?.type === "Flatten" && left.children?.[0]?.type === "Identity")) {
5649
+ scopes = [right];
5650
+ }
5651
+ const reads = new Set;
5652
+ let tracked = 0;
5653
+ const visit = (node) => {
5654
+ if (!node)
5655
+ return;
5656
+ switch (node.type) {
5657
+ case "Function": {
5658
+ const arg = node.children?.[argIndex - 1];
5659
+ if (node.name === fn && arg?.type === "Field" && arg.name) {
5660
+ reads.add(arg.name);
5661
+ tracked++;
5662
+ }
5663
+ node.children?.forEach(visit);
5664
+ return;
5665
+ }
5666
+ case "AndExpression":
5667
+ case "OrExpression":
5668
+ case "NotExpression":
5669
+ case "Comparator":
5670
+ case "MultiSelectList":
5671
+ case "MultiSelectHash":
5672
+ node.children?.forEach(visit);
5673
+ return;
5674
+ case "KeyValuePair":
5675
+ visit(node.value);
5676
+ return;
5677
+ }
5678
+ };
5679
+ scopes.forEach(visit);
5680
+ const calls = (node) => {
5681
+ if (node === null || typeof node !== "object")
5682
+ return 0;
5683
+ const own = node.type === "Function" && node.name === fn ? 1 : 0;
5684
+ const next = node.type === "KeyValuePair" ? [node.value] : node.children ?? [];
5685
+ return own + next.reduce((sum, child) => sum + calls(child), 0);
5686
+ };
5687
+ return reads.size === 1 && tracked === calls(ast) ? [...reads][0] : undefined;
5688
+ }
5689
+ function fieldExpression(name) {
5690
+ return /^[A-Za-z_]\w*$/.test(name) ? name : JSON.stringify(name);
5691
+ }
5692
+ function evaluationHint(codec, filter, data, cause) {
5693
+ const underlying = cause instanceof Error ? cause.message : String(cause);
5694
+ const failure = /\b(\w+)\(\) expected argument (\d+) to be type (\S+) but received type null\b/.exec(underlying);
5695
+ if (!failure)
5696
+ return;
5697
+ const [, fn, position, expected] = failure;
5698
+ const name = failingFieldRead(codec.compile(filter), Array.isArray(data), fn, Number(position));
5699
+ if (name === undefined)
5700
+ return;
5701
+ const present = availableFields(data);
5702
+ if (present.length === 0)
5703
+ return;
5704
+ const scope = `${countRecords(data)} record(s)`;
5705
+ if (!present.includes(name)) {
5706
+ return {
5707
+ detail: `${notFieldsOn([name], scope)}. Available fields: ${nameList(present)}.`,
5708
+ instructions: "Use a field the records have; names are case-sensitive."
5709
+ };
5710
+ }
5711
+ const records = Array.isArray(data) ? data : [data];
5712
+ const unset = records.filter((r) => r?.[name] == null).length;
5713
+ const field = fieldExpression(name);
5714
+ let fallback;
5715
+ if (expected.split(",").includes("string")) {
5716
+ fallback = "''";
5717
+ } else if (expected.split(",").includes("array")) {
5718
+ fallback = "`[]`";
5719
+ }
5720
+ return {
5721
+ detail: `\`${name}\` is null or missing on ${unset} of the ${scope} it read.`,
5722
+ 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.`
5723
+ };
5724
+ }
5580
5725
  function buildFilterWarning(filter, data, outcome) {
5581
5726
  const present = availableFields(data);
5582
5727
  const refs = referencedFields(filter);
@@ -5584,7 +5729,7 @@ function buildFilterWarning(filter, data, outcome) {
5584
5729
  const unchecked = refs.nested.filter((name) => !present.includes(name));
5585
5730
  const count = countRecords(data);
5586
5731
  const scope = `${count} record(s)`;
5587
- const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
5732
+ const isNotAField = (names) => notFieldsOn(names, scope);
5588
5733
  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" : "";
5589
5734
  const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
5590
5735
  let detail;
@@ -5635,7 +5780,8 @@ function applyFilter(data, filter, onWarning) {
5635
5780
  try {
5636
5781
  result = codec.search(data, filter);
5637
5782
  } catch (err) {
5638
- throw new FilterEvaluationError(filter, err);
5783
+ const [, hint] = catchError(() => evaluationHint(codec, filter, data, err));
5784
+ throw new FilterEvaluationError(filter, err, hint);
5639
5785
  }
5640
5786
  const inputCount = countRecords(data);
5641
5787
  const warn = (outcome) => {
@@ -6526,7 +6672,7 @@ Command.prototype.trackedAction = function(context, fn, properties) {
6526
6672
  logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
6527
6673
  const typed = error;
6528
6674
  const customInstructions = typeof typed.instructions === "string" ? typed.instructions : undefined;
6529
- const customResult = typeof typed.result === "string" && typed.result !== RESULTS.Success && Object.values(RESULTS).includes(typed.result) ? typed.result : undefined;
6675
+ const customResult = carriedResult(error);
6530
6676
  const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
6531
6677
  const classified = cancellationExitCode === undefined ? await extractErrorDetails(error) : undefined;
6532
6678
  const finalResult = customResult ?? classified?.result ?? RESULTS.Failure;
@@ -6949,6 +7095,8 @@ var FAILURE_STATUSES = new Set([
6949
7095
  "canceled",
6950
7096
  "stopped"
6951
7097
  ]);
7098
+ // ../common/src/relayed-output.ts
7099
+ var RELAYED_OUTPUT_SYMBOL = Symbol.for("@uipath/common/relayed-output");
6952
7100
  // ../common/src/screen-logger.ts
6953
7101
  var ScreenLogger;
6954
7102
  ((ScreenLogger) => {
@@ -7049,6 +7197,6 @@ function unsupportedSolutionProjectType(projectType) {
7049
7197
  var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
7050
7198
  // ../common/src/tool-provider.ts
7051
7199
  var factorySlot = singleton("PackagerFactoryProvider");
7052
- export { getFileSystem, catchError, extractErrorMessage, extractErrorMessageSync, RESULTS, classifiedFailure, Command, Option, logger, Pagination, OutputFormatter, processContext, DEFAULT_PAGE_SIZE, isGuid, createHiddenDeprecatedTenantOption, parseLimit, parseOffset, parseBoundedInt, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, quoteForShell, unsupportedSolutionProjectType };
7200
+ export { getFileSystem, catchError, RESULTS, isHtmlDocument, extractErrorDetails, extractErrorMessage, extractErrorMessageSync, classifiedFailure, notSupportedFailure, Command, Option, logger, Pagination, OutputFormatter, processContext, DEFAULT_PAGE_SIZE, isGuid, createHiddenDeprecatedTenantOption, parseLimit, parseOffset, parseBoundedInt, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, quoteForShell, unsupportedSolutionProjectType };
7053
7201
 
7054
- //# debugId=98EBE696968BE03A64756E2164756E21
7202
+ //# debugId=398AF00342D3D7E864756E2164756E21