@uipath/codedapp-tool 1.206.0-preview.303 → 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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getFileSystem
3
- } from "./packager-tool-0ajs8pnk.js";
3
+ } from "./packager-tool-9thx6ae9.js";
4
4
  import {
5
5
  __toESM,
6
6
  __commonJS,
@@ -2182,13 +2182,15 @@ var ProjectDimensions = {
2182
2182
  SolutionKey: "SolutionKey",
2183
2183
  SolutionProjectKey: "SolutionProjectKey",
2184
2184
  SolutionIdentityStatus: "SolutionIdentityStatus",
2185
- PreviousSolutionKey: "PreviousSolutionKey"
2185
+ PreviousSolutionKey: "PreviousSolutionKey",
2186
+ PreviousProjectKey: "PreviousProjectKey"
2186
2187
  };
2187
2188
  var GUID_KEY_DIMENSIONS = new Set([
2188
2189
  ProjectDimensions.ProjectKey,
2189
2190
  ProjectDimensions.SolutionKey,
2190
2191
  ProjectDimensions.SolutionProjectKey,
2191
- ProjectDimensions.PreviousSolutionKey
2192
+ ProjectDimensions.PreviousSolutionKey,
2193
+ ProjectDimensions.PreviousProjectKey
2192
2194
  ]);
2193
2195
  var ShipDimensions = {
2194
2196
  ShipKind: "ShipKind",
@@ -2342,9 +2344,7 @@ async function withinProjectIdentityBudget(work, onTimeout) {
2342
2344
  }
2343
2345
  }
2344
2346
 
2345
- // ../common/src/telemetry/pseudonymize.ts
2346
- var PSEUDONYM_DOMAIN = "uipath-cli/telemetry/pseudonym/v1:";
2347
- var PSEUDONYM_HEX_LENGTH = 32;
2347
+ // ../common/src/sha256.ts
2348
2348
  var SHA256_K = new Uint32Array([
2349
2349
  1116352408,
2350
2350
  1899447441,
@@ -2424,7 +2424,7 @@ var SHA256_INITIAL_STATE = new Uint32Array([
2424
2424
  function rotr(value, bits) {
2425
2425
  return (value >>> bits | value << 32 - bits) >>> 0;
2426
2426
  }
2427
- function sha256Hex(input) {
2427
+ function sha256Words(input) {
2428
2428
  const bytes = new TextEncoder().encode(input);
2429
2429
  const paddedLength = bytes.length + 9 + 63 >> 6 << 6;
2430
2430
  const buffer = new Uint8Array(paddedLength);
@@ -2480,12 +2480,19 @@ function sha256Hex(input) {
2480
2480
  state[6] = state[6] + g >>> 0;
2481
2481
  state[7] = state[7] + h >>> 0;
2482
2482
  }
2483
+ return state;
2484
+ }
2485
+ function sha256Hex(input) {
2483
2486
  let hex = "";
2484
- for (const word of state) {
2487
+ for (const word of sha256Words(input)) {
2485
2488
  hex += word.toString(16).padStart(8, "0");
2486
2489
  }
2487
2490
  return hex;
2488
2491
  }
2492
+
2493
+ // ../common/src/telemetry/pseudonymize.ts
2494
+ var PSEUDONYM_DOMAIN = "uipath-cli/telemetry/pseudonym/v1:";
2495
+ var PSEUDONYM_HEX_LENGTH = 32;
2489
2496
  function resolveSha256Hex() {
2490
2497
  try {
2491
2498
  const nodeCrypto = __require("node:crypto");
@@ -2881,13 +2888,25 @@ function settlePromiseLike(thenable) {
2881
2888
  return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [toError(error), undefined]);
2882
2889
  }
2883
2890
 
2891
+ // ../common/src/result-types.ts
2892
+ var RESULTS = {
2893
+ Success: "Success",
2894
+ Failure: "Failure",
2895
+ ConfigError: "ConfigError",
2896
+ AuthenticationError: "AuthenticationError",
2897
+ ValidationError: "ValidationError",
2898
+ TimeoutError: "TimeoutError"
2899
+ };
2900
+
2884
2901
  // ../common/src/error-codes.ts
2885
2902
  var CLI_ERROR_CODES = [
2886
2903
  "invalid_argument",
2904
+ "confirmation_required",
2887
2905
  "authentication_required",
2888
2906
  "permission_denied",
2889
2907
  "local_permission_denied",
2890
2908
  "not_found",
2909
+ "not_enabled",
2891
2910
  "rate_limited",
2892
2911
  "network_error",
2893
2912
  "timeout",
@@ -2926,6 +2945,12 @@ function carriedRetry(error) {
2926
2945
  const retry = error.retry;
2927
2946
  return isRetryHint(retry) ? retry : undefined;
2928
2947
  }
2948
+ function carriedResult(error) {
2949
+ if (!error || typeof error !== "object")
2950
+ return;
2951
+ const result = error.result;
2952
+ return typeof result === "string" && result !== RESULTS.Success && Object.values(RESULTS).includes(result) ? result : undefined;
2953
+ }
2929
2954
  function defaultRetryForErrorCode(errorCode) {
2930
2955
  switch (errorCode) {
2931
2956
  case "network_error":
@@ -3315,6 +3340,8 @@ async function extractErrorDetails(error, options) {
3315
3340
  }
3316
3341
  if (parsedBody?.errorCode && typeof parsedBody.errorCode === "string") {
3317
3342
  context.errorCode = parsedBody.errorCode;
3343
+ } else if (typeof parsedBody?.errorCode === "number") {
3344
+ context.errorCode = String(parsedBody.errorCode);
3318
3345
  } else if (parsedBody?.code && typeof parsedBody.code === "string") {
3319
3346
  context.errorCode = parsedBody.code;
3320
3347
  }
@@ -3376,16 +3403,6 @@ async function extractErrorMessage(error, options) {
3376
3403
  return message;
3377
3404
  }
3378
3405
 
3379
- // ../common/src/result-types.ts
3380
- var RESULTS = {
3381
- Success: "Success",
3382
- Failure: "Failure",
3383
- ConfigError: "ConfigError",
3384
- AuthenticationError: "AuthenticationError",
3385
- ValidationError: "ValidationError",
3386
- TimeoutError: "TimeoutError"
3387
- };
3388
-
3389
3406
  // ../common/src/output-context.ts
3390
3407
  function createStorage() {
3391
3408
  const [error, mod] = catchError(() => __require("node:async_hooks"));
@@ -3741,7 +3758,10 @@ var AUTH_ERROR_CODES = new Set([
3741
3758
  var LOCAL_PERMISSION_CLI_ERROR_CODES = new Set([
3742
3759
  "local_permission_denied"
3743
3760
  ]);
3744
- var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
3761
+ var VALIDATION_ERROR_CODES = new Set([
3762
+ "invalid_argument",
3763
+ "confirmation_required"
3764
+ ]);
3745
3765
  var NETWORK_HTTP_ERROR_CODES = new Set([
3746
3766
  "network_error",
3747
3767
  "rate_limited",
@@ -3967,6 +3987,109 @@ var CommonTelemetryEvents = {
3967
3987
  ShipSucceeded: "Cli.ShipSucceeded"
3968
3988
  };
3969
3989
 
3990
+ // ../common/src/telemetry/global-telemetry-properties.ts
3991
+ var telemetryPropsSlot = singleton("TelemetryDefaultProps");
3992
+ function getGlobalTelemetryProperties() {
3993
+ return telemetryPropsSlot.get();
3994
+ }
3995
+
3996
+ // ../common/src/telemetry/trace-context.ts
3997
+ var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
3998
+ var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
3999
+ function getProcessEnv() {
4000
+ return globalThis.process?.env;
4001
+ }
4002
+ function parseInboundTraceparent(value) {
4003
+ if (!value) {
4004
+ return;
4005
+ }
4006
+ const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
4007
+ if (!match) {
4008
+ return;
4009
+ }
4010
+ const [, traceId, parentSpanId] = match;
4011
+ if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
4012
+ return;
4013
+ }
4014
+ return { traceId, parentSpanId };
4015
+ }
4016
+ function getInboundTraceContext() {
4017
+ return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
4018
+ }
4019
+
4020
+ // ../common/src/telemetry/session-id.ts
4021
+ var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
4022
+ var SESSION_ID_MAX_LENGTH = 64;
4023
+ var RANDOM_SESSION_ID_LENGTH = 32;
4024
+ var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
4025
+ var CONTROL_CHARACTERS = /\p{Cc}/gu;
4026
+ var INHERITED_SESSION_SOURCES = [
4027
+ { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
4028
+ { envVar: "CODEX_THREAD_ID", source: "codex" },
4029
+ { envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
4030
+ { envVar: "TERM_SESSION_ID", source: "terminal" },
4031
+ { envVar: "WT_SESSION", source: "terminal" }
4032
+ ];
4033
+ var telemetrySessionSlot = singleton("TelemetrySession");
4034
+ var telemetryOperationIdSlot = singleton("TelemetryOperationId");
4035
+ function getProcessEnv2() {
4036
+ return globalThis.process?.env;
4037
+ }
4038
+ function normalizeSessionId(value) {
4039
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
4040
+ return;
4041
+ }
4042
+ const cleaned = String(value).replace(CONTROL_CHARACTERS, "").trim().slice(0, SESSION_ID_MAX_LENGTH);
4043
+ return cleaned || undefined;
4044
+ }
4045
+ function getConfiguredTelemetrySessionId() {
4046
+ return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
4047
+ }
4048
+ function getInheritedSession(env) {
4049
+ for (const candidate of INHERITED_SESSION_SOURCES) {
4050
+ const handle = normalizeSessionId(env[candidate.envVar]);
4051
+ if (handle) {
4052
+ return { id: handle, source: candidate.source };
4053
+ }
4054
+ }
4055
+ return;
4056
+ }
4057
+ function generateRandomSession() {
4058
+ const bytes = new Uint8Array(RANDOM_SESSION_ID_LENGTH / 2);
4059
+ crypto.getRandomValues(bytes);
4060
+ let hex = "";
4061
+ for (const byte of bytes) {
4062
+ hex += byte.toString(16).padStart(2, "0");
4063
+ }
4064
+ return { id: hex, source: "random" };
4065
+ }
4066
+ function resolveTelemetrySession() {
4067
+ const existing = telemetrySessionSlot.get();
4068
+ if (existing) {
4069
+ return existing;
4070
+ }
4071
+ const declaredHandle = getConfiguredTelemetrySessionId();
4072
+ const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
4073
+ telemetrySessionSlot.set(resolved);
4074
+ return resolved;
4075
+ }
4076
+ function getTelemetrySessionId() {
4077
+ return resolveTelemetrySession().id;
4078
+ }
4079
+ function getTelemetrySessionSource() {
4080
+ return resolveTelemetrySession().source;
4081
+ }
4082
+ function getTelemetryOperationId() {
4083
+ const existing = telemetryOperationIdSlot.get();
4084
+ if (existing) {
4085
+ return existing;
4086
+ }
4087
+ const inboundTraceId = getInboundTraceContext()?.traceId;
4088
+ const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
4089
+ telemetryOperationIdSlot.set(generated);
4090
+ return generated;
4091
+ }
4092
+
3970
4093
  // ../common/src/registry.ts
3971
4094
  import { execFileSync } from "node:child_process";
3972
4095
  function readRegistryValue(keyPath, valueName) {
@@ -4188,108 +4311,6 @@ class NodeContextStorage {
4188
4311
  return this.storage.getStore();
4189
4312
  }
4190
4313
  }
4191
- // ../common/src/telemetry/trace-context.ts
4192
- var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
4193
- var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
4194
- function getProcessEnv() {
4195
- return globalThis.process?.env;
4196
- }
4197
- function parseInboundTraceparent(value) {
4198
- if (!value) {
4199
- return;
4200
- }
4201
- const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
4202
- if (!match) {
4203
- return;
4204
- }
4205
- const [, traceId, parentSpanId] = match;
4206
- if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
4207
- return;
4208
- }
4209
- return { traceId, parentSpanId };
4210
- }
4211
- function getInboundTraceContext() {
4212
- return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
4213
- }
4214
-
4215
- // ../common/src/telemetry/session-id.ts
4216
- var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
4217
- var SESSION_ID_MAX_LENGTH = 64;
4218
- var RANDOM_SESSION_ID_LENGTH = 32;
4219
- var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
4220
- var CONTROL_CHARACTERS = /\p{Cc}/gu;
4221
- var INHERITED_SESSION_SOURCES = [
4222
- { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
4223
- { envVar: "CODEX_THREAD_ID", source: "codex" },
4224
- { envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
4225
- { envVar: "TERM_SESSION_ID", source: "terminal" },
4226
- { envVar: "WT_SESSION", source: "terminal" }
4227
- ];
4228
- var telemetrySessionSlot = singleton("TelemetrySession");
4229
- var telemetryOperationIdSlot = singleton("TelemetryOperationId");
4230
- function getProcessEnv2() {
4231
- return globalThis.process?.env;
4232
- }
4233
- function normalizeSessionId(value) {
4234
- if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
4235
- return;
4236
- }
4237
- const cleaned = String(value).replace(CONTROL_CHARACTERS, "").trim().slice(0, SESSION_ID_MAX_LENGTH);
4238
- return cleaned || undefined;
4239
- }
4240
- function getConfiguredTelemetrySessionId() {
4241
- return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
4242
- }
4243
- function getInheritedSession(env) {
4244
- for (const candidate of INHERITED_SESSION_SOURCES) {
4245
- const handle = normalizeSessionId(env[candidate.envVar]);
4246
- if (handle) {
4247
- return { id: handle, source: candidate.source };
4248
- }
4249
- }
4250
- return;
4251
- }
4252
- function generateRandomSession() {
4253
- const bytes = new Uint8Array(RANDOM_SESSION_ID_LENGTH / 2);
4254
- crypto.getRandomValues(bytes);
4255
- let hex = "";
4256
- for (const byte of bytes) {
4257
- hex += byte.toString(16).padStart(2, "0");
4258
- }
4259
- return { id: hex, source: "random" };
4260
- }
4261
- function resolveTelemetrySession() {
4262
- const existing = telemetrySessionSlot.get();
4263
- if (existing) {
4264
- return existing;
4265
- }
4266
- const declaredHandle = getConfiguredTelemetrySessionId();
4267
- const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
4268
- telemetrySessionSlot.set(resolved);
4269
- return resolved;
4270
- }
4271
- function getTelemetrySessionId() {
4272
- return resolveTelemetrySession().id;
4273
- }
4274
- function getTelemetrySessionSource() {
4275
- return resolveTelemetrySession().source;
4276
- }
4277
- function getTelemetryOperationId() {
4278
- const existing = telemetryOperationIdSlot.get();
4279
- if (existing) {
4280
- return existing;
4281
- }
4282
- const inboundTraceId = getInboundTraceContext()?.traceId;
4283
- const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
4284
- telemetryOperationIdSlot.set(generated);
4285
- return generated;
4286
- }
4287
- // ../common/src/telemetry/global-telemetry-properties.ts
4288
- var telemetryPropsSlot = singleton("TelemetryDefaultProps");
4289
- function getGlobalTelemetryProperties() {
4290
- return telemetryPropsSlot.get();
4291
- }
4292
-
4293
4314
  // ../common/src/telemetry/span-clock.ts
4294
4315
  function startSpanClock() {
4295
4316
  const started = performance.now();
@@ -4503,6 +4524,7 @@ var MAX_SPOOL_AGE_MS = 72 * 60 * 60 * 1000;
4503
4524
  // ../common/src/telemetry/telemetry-init.ts
4504
4525
  var telemetryInstanceSlot = singleton("TelemetryService");
4505
4526
  var DEFAULT_AI_CONNECTION_STRING = atob("SW5zdHJ1bWVudGF0aW9uS2V5PTliZDM3NDgyLTgxMGUtNDQyYS1hYWE2LWQzOGVmNjVjNjY3NDtJbmdlc3Rpb25FbmRwb2ludD1odHRwczovL3dlc3RldXJvcGUtNS5pbi5hcHBsaWNhdGlvbmluc2lnaHRzLmF6dXJlLmNvbS87TGl2ZUVuZHBvaW50PWh0dHBzOi8vd2VzdGV1cm9wZS5saXZlZGlhZ25vc3RpY3MubW9uaXRvci5henVyZS5jb20vO0FwcGxpY2F0aW9uSWQ9MzU2OTdlZjEtOGJkMC00ZjE5LWEyN2MtZDg3Y2NhYzY2ZDJj");
4527
+ var browserProviderSlot = singleton("BrowserAppInsightsTelemetryProvider");
4506
4528
  function getGlobalTelemetryInstance() {
4507
4529
  const existing = telemetryInstanceSlot.get();
4508
4530
  if (existing && typeof existing === "object" && "trackEvent" in existing && typeof existing.trackEvent === "function") {
@@ -4689,7 +4711,7 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
4689
4711
  const pagedRows = extractPagedRows(data.Data);
4690
4712
  const items = pagedRows ?? (Array.isArray(data.Data) ? data.Data : [data.Data]);
4691
4713
  items.forEach((item) => {
4692
- const values = Object.values(item).map((v) => v ?? "").join("\t");
4714
+ const values = item === null || typeof item !== "object" ? String(item ?? "") : Object.values(item).map((v) => v ?? "").join("\t");
4693
4715
  logFn(values);
4694
4716
  });
4695
4717
  } else {
@@ -4704,7 +4726,8 @@ function printOutput(data, format = "json", logFn, asciiSafe = false, tableRowSt
4704
4726
  default: {
4705
4727
  const hasData = "Data" in data && data.Data != null;
4706
4728
  const pagedRows = hasData ? extractPagedRows(data.Data) : null;
4707
- const rows = pagedRows ? pagedRows : Array.isArray(data.Data) ? data.Data : null;
4729
+ const resolvedRows = pagedRows ? pagedRows : Array.isArray(data.Data) ? data.Data : null;
4730
+ const rows = resolvedRows && isPrimitiveArray(resolvedRows) ? resolvedRows.map((entry) => ({ Value: entry })) : resolvedRows;
4708
4731
  if (hasData && !(rows !== null && rows.length === 0)) {
4709
4732
  const logValue = data.Log;
4710
4733
  if (rows !== null) {
@@ -4761,6 +4784,9 @@ function printTable(data, logFn, externalLogValue, tableRowStyle) {
4761
4784
  function isPlainObjectArray(value) {
4762
4785
  return Array.isArray(value) && value.length > 0 && value.every(isPlainRecord);
4763
4786
  }
4787
+ function isPrimitiveArray(value) {
4788
+ return Array.isArray(value) && value.length > 0 && value.every((entry) => entry === null || typeof entry !== "object");
4789
+ }
4764
4790
  function isNonEmptyPlainObject(value) {
4765
4791
  return isPlainRecord(value) && Object.keys(value).length > 0;
4766
4792
  }
@@ -5107,12 +5133,12 @@ class FilterEvaluationError extends Error {
5107
5133
  instructions;
5108
5134
  retry = "RetryWillNotFix";
5109
5135
  result = RESULTS.ValidationError;
5110
- constructor(filter, cause) {
5136
+ constructor(filter, cause, hint) {
5111
5137
  const underlying = cause instanceof Error ? cause.message : String(cause);
5112
- super(`Filter '${filter}' failed to evaluate: ${underlying}`);
5138
+ super(`Filter '${filter}' failed to evaluate: ${underlying}` + (hint ? ` ${hint.detail}` : ""));
5113
5139
  this.name = "FilterEvaluationError";
5114
5140
  this.filter = filter;
5115
- 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(@)'.";
5141
+ 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(@)'.";
5116
5142
  }
5117
5143
  }
5118
5144
 
@@ -5248,6 +5274,93 @@ function nameList(names, cap = 12) {
5248
5274
  const rest = names.length - shown.length;
5249
5275
  return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
5250
5276
  }
5277
+ function notFieldsOn(names, scope) {
5278
+ return `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
5279
+ }
5280
+ function failingFieldRead(ast, isList, fn, argIndex) {
5281
+ const [left, right, condition] = ast.children ?? [];
5282
+ let scopes = [];
5283
+ if (!isList) {
5284
+ scopes = [ast];
5285
+ } else if (ast.type === "FilterProjection" && left?.type === "Identity") {
5286
+ scopes = [condition, right];
5287
+ } else if (ast.type === "Projection" && (left?.type === "Identity" || left?.type === "Flatten" && left.children?.[0]?.type === "Identity")) {
5288
+ scopes = [right];
5289
+ }
5290
+ const reads = new Set;
5291
+ let tracked = 0;
5292
+ const visit = (node) => {
5293
+ if (!node)
5294
+ return;
5295
+ switch (node.type) {
5296
+ case "Function": {
5297
+ const arg = node.children?.[argIndex - 1];
5298
+ if (node.name === fn && arg?.type === "Field" && arg.name) {
5299
+ reads.add(arg.name);
5300
+ tracked++;
5301
+ }
5302
+ node.children?.forEach(visit);
5303
+ return;
5304
+ }
5305
+ case "AndExpression":
5306
+ case "OrExpression":
5307
+ case "NotExpression":
5308
+ case "Comparator":
5309
+ case "MultiSelectList":
5310
+ case "MultiSelectHash":
5311
+ node.children?.forEach(visit);
5312
+ return;
5313
+ case "KeyValuePair":
5314
+ visit(node.value);
5315
+ return;
5316
+ }
5317
+ };
5318
+ scopes.forEach(visit);
5319
+ const calls = (node) => {
5320
+ if (node === null || typeof node !== "object")
5321
+ return 0;
5322
+ const own = node.type === "Function" && node.name === fn ? 1 : 0;
5323
+ const next = node.type === "KeyValuePair" ? [node.value] : node.children ?? [];
5324
+ return own + next.reduce((sum, child) => sum + calls(child), 0);
5325
+ };
5326
+ return reads.size === 1 && tracked === calls(ast) ? [...reads][0] : undefined;
5327
+ }
5328
+ function fieldExpression(name) {
5329
+ return /^[A-Za-z_]\w*$/.test(name) ? name : JSON.stringify(name);
5330
+ }
5331
+ function evaluationHint(codec, filter, data, cause) {
5332
+ const underlying = cause instanceof Error ? cause.message : String(cause);
5333
+ const failure = /\b(\w+)\(\) expected argument (\d+) to be type (\S+) but received type null\b/.exec(underlying);
5334
+ if (!failure)
5335
+ return;
5336
+ const [, fn, position, expected] = failure;
5337
+ const name = failingFieldRead(codec.compile(filter), Array.isArray(data), fn, Number(position));
5338
+ if (name === undefined)
5339
+ return;
5340
+ const present = availableFields(data);
5341
+ if (present.length === 0)
5342
+ return;
5343
+ const scope = `${countRecords(data)} record(s)`;
5344
+ if (!present.includes(name)) {
5345
+ return {
5346
+ detail: `${notFieldsOn([name], scope)}. Available fields: ${nameList(present)}.`,
5347
+ instructions: "Use a field the records have; names are case-sensitive."
5348
+ };
5349
+ }
5350
+ const records = Array.isArray(data) ? data : [data];
5351
+ const unset = records.filter((r) => r?.[name] == null).length;
5352
+ const field = fieldExpression(name);
5353
+ let fallback;
5354
+ if (expected.split(",").includes("string")) {
5355
+ fallback = "''";
5356
+ } else if (expected.split(",").includes("array")) {
5357
+ fallback = "`[]`";
5358
+ }
5359
+ return {
5360
+ detail: `\`${name}\` is null or missing on ${unset} of the ${scope} it read.`,
5361
+ 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.`
5362
+ };
5363
+ }
5251
5364
  function buildFilterWarning(filter, data, outcome) {
5252
5365
  const present = availableFields(data);
5253
5366
  const refs = referencedFields(filter);
@@ -5255,7 +5368,7 @@ function buildFilterWarning(filter, data, outcome) {
5255
5368
  const unchecked = refs.nested.filter((name) => !present.includes(name));
5256
5369
  const count = countRecords(data);
5257
5370
  const scope = `${count} record(s)`;
5258
- const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
5371
+ const isNotAField = (names) => notFieldsOn(names, scope);
5259
5372
  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" : "";
5260
5373
  const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
5261
5374
  let detail;
@@ -5306,7 +5419,8 @@ function applyFilter(data, filter, onWarning) {
5306
5419
  try {
5307
5420
  result = codec.search(data, filter);
5308
5421
  } catch (err) {
5309
- throw new FilterEvaluationError(filter, err);
5422
+ const [, hint] = catchError(() => evaluationHint(codec, filter, data, err));
5423
+ throw new FilterEvaluationError(filter, err, hint);
5310
5424
  }
5311
5425
  const inputCount = countRecords(data);
5312
5426
  const warn = (outcome) => {
@@ -5520,6 +5634,163 @@ var OutputFormatter;
5520
5634
  OutputFormatter.formatToString = formatToString;
5521
5635
  })(OutputFormatter ||= {});
5522
5636
 
5637
+ // ../common/src/project-telemetry.ts
5638
+ var RESOLVER = Symbol.for("@uipath/common/projectTelemetryResolver");
5639
+ var CAPTURE = Symbol.for("@uipath/common/projectTelemetryCapture");
5640
+ var CONTEXT_RESOLVER = Symbol.for("@uipath/common/projectContextTelemetryResolver");
5641
+ var RULES = Symbol.for("@uipath/common/projectTargetRules");
5642
+ function logSkipped(what, error) {
5643
+ logger.debug(`[project-telemetry] ${what} skipped: ${error instanceof Error ? error.message : String(error)}`);
5644
+ }
5645
+ function bounded(work, what) {
5646
+ return withinProjectIdentityBudget(work, () => logSkipped(what, `no answer within ${PROJECT_IDENTITY_LOOKUP_BUDGET_MS} ms`));
5647
+ }
5648
+ async function identityWithContext(command, identity) {
5649
+ const props = projectIdentityProperties(identity);
5650
+ if (!identity.projectDirectory || isProjectTelemetryDisabled())
5651
+ return props;
5652
+ for (let node = command;node; node = node.parent ?? undefined) {
5653
+ const resolver = node[CONTEXT_RESOLVER];
5654
+ if (typeof resolver !== "function")
5655
+ continue;
5656
+ try {
5657
+ return {
5658
+ ...await resolver(identity.projectDirectory),
5659
+ ...props
5660
+ };
5661
+ } catch (error) {
5662
+ logSkipped("solution context lookup", error);
5663
+ return props;
5664
+ }
5665
+ }
5666
+ return props;
5667
+ }
5668
+ function configureProjectTelemetry(command, resolver) {
5669
+ command[RESOLVER] = resolver;
5670
+ }
5671
+ function getProjectTelemetryResolver(command) {
5672
+ for (let node = command;node; node = node.parent) {
5673
+ const resolver = node[RESOLVER];
5674
+ if (typeof resolver === "function")
5675
+ return resolver;
5676
+ }
5677
+ return;
5678
+ }
5679
+ function getProjectTelemetryCapture(command) {
5680
+ const capture = command?.[CAPTURE];
5681
+ return capture !== null && typeof capture === "object" ? capture : undefined;
5682
+ }
5683
+ function attachProjectTelemetryCapture(command, capture) {
5684
+ command[CAPTURE] = capture;
5685
+ }
5686
+ async function setProjectTelemetryTarget(command, target) {
5687
+ const capture = getProjectTelemetryCapture(command);
5688
+ if (!capture)
5689
+ return;
5690
+ const [error] = await catchError(() => capture.setTarget(target));
5691
+ if (error)
5692
+ logSkipped("project identity target", error);
5693
+ }
5694
+ function createProjectCommandResolver(root, rules, read) {
5695
+ return createIdentityCommandResolver(root, rules, async (target, command) => identityWithContext(command, await read(target)));
5696
+ }
5697
+ function createIdentityCommandResolver(root, rules, read) {
5698
+ const record = root;
5699
+ record[RULES] = [...ruleSets(root), rules];
5700
+ return async ({ command, args, phase, target, success }) => {
5701
+ const parts = [];
5702
+ for (let node = command;node && node !== root; node = node.parent) {
5703
+ parts.unshift(node.name());
5704
+ }
5705
+ const rule = rules[parts.join(" ")] ?? rules[parts[0]];
5706
+ if (!rule || rule.create && phase === "before")
5707
+ return;
5708
+ if (rule.create && !success)
5709
+ return;
5710
+ if (phase === "after" && !rule.create && target === undefined)
5711
+ return;
5712
+ const opts = command.opts();
5713
+ let selected = target;
5714
+ for (const name of rule.options ?? []) {
5715
+ if (selected === undefined && typeof opts[name] === "string")
5716
+ selected = opts[name];
5717
+ }
5718
+ for (const name of rule.arguments ?? []) {
5719
+ const index = command.registeredArguments.findIndex((arg) => arg.name() === name);
5720
+ if (selected === undefined && index >= 0 && typeof args[index] === "string")
5721
+ selected = args[index];
5722
+ }
5723
+ selected ??= rule.defaultTarget;
5724
+ if (selected === undefined)
5725
+ return;
5726
+ return read(selected, command);
5727
+ };
5728
+ }
5729
+
5730
+ class ProjectTelemetrySession {
5731
+ resolver;
5732
+ command;
5733
+ target;
5734
+ props = {};
5735
+ explicit = false;
5736
+ input;
5737
+ constructor(resolver, command) {
5738
+ this.resolver = resolver;
5739
+ this.command = command;
5740
+ }
5741
+ async setTarget(path) {
5742
+ this.target = path;
5743
+ if (this.input) {
5744
+ await this.resolve({
5745
+ ...this.input,
5746
+ phase: "after",
5747
+ success: true
5748
+ });
5749
+ this.explicit = true;
5750
+ }
5751
+ }
5752
+ async setIdentity(identity) {
5753
+ try {
5754
+ const props = await bounded(identityWithContext(this.command, identity), "project identity capture");
5755
+ if (props !== undefined)
5756
+ this.setProperties(props);
5757
+ } catch (error) {
5758
+ logSkipped("project identity capture", error);
5759
+ }
5760
+ }
5761
+ setProperties(properties) {
5762
+ try {
5763
+ this.props = { ...properties };
5764
+ this.explicit = true;
5765
+ } catch (error) {
5766
+ logSkipped("project identity properties", error);
5767
+ }
5768
+ }
5769
+ properties() {
5770
+ return { ...this.props };
5771
+ }
5772
+ async resolve(input) {
5773
+ this.input = input;
5774
+ if (this.explicit)
5775
+ return;
5776
+ try {
5777
+ const props = await bounded(this.resolver({
5778
+ ...input,
5779
+ target: this.target
5780
+ }), `project identity (${input.phase})`);
5781
+ if (props !== undefined) {
5782
+ this.props = props;
5783
+ }
5784
+ } catch (error) {
5785
+ logSkipped(`project identity (${input.phase})`, error);
5786
+ }
5787
+ }
5788
+ }
5789
+ function ruleSets(root) {
5790
+ const sets = root[RULES];
5791
+ return Array.isArray(sets) ? sets : [];
5792
+ }
5793
+
5523
5794
  // ../common/src/pass-through-tail.ts
5524
5795
  function maybeOption(arg) {
5525
5796
  return arg.length > 1 && arg[0] === "-";
@@ -5640,108 +5911,6 @@ function tokenizeTail(cmd, tail) {
5640
5911
  return { tokens, firstUnknown, sentinel };
5641
5912
  }
5642
5913
 
5643
- // ../common/src/project-telemetry.ts
5644
- var RESOLVER = Symbol.for("@uipath/common/projectTelemetryResolver");
5645
- var CAPTURE = Symbol.for("@uipath/common/projectTelemetryCapture");
5646
- var CONTEXT_RESOLVER = Symbol.for("@uipath/common/projectContextTelemetryResolver");
5647
- var RULES = Symbol.for("@uipath/common/projectTargetRules");
5648
- function logSkipped(what, error) {
5649
- logger.debug(`[project-telemetry] ${what} skipped: ${error instanceof Error ? error.message : String(error)}`);
5650
- }
5651
- function bounded(work, what) {
5652
- return withinProjectIdentityBudget(work, () => logSkipped(what, `no answer within ${PROJECT_IDENTITY_LOOKUP_BUDGET_MS} ms`));
5653
- }
5654
- async function identityWithContext(command, identity) {
5655
- const props = projectIdentityProperties(identity);
5656
- if (!identity.projectDirectory || isProjectTelemetryDisabled())
5657
- return props;
5658
- for (let node = command;node; node = node.parent ?? undefined) {
5659
- const resolver = node[CONTEXT_RESOLVER];
5660
- if (typeof resolver !== "function")
5661
- continue;
5662
- try {
5663
- return {
5664
- ...await resolver(identity.projectDirectory),
5665
- ...props
5666
- };
5667
- } catch (error) {
5668
- logSkipped("solution context lookup", error);
5669
- return props;
5670
- }
5671
- }
5672
- return props;
5673
- }
5674
- function getProjectTelemetryResolver(command) {
5675
- for (let node = command;node; node = node.parent) {
5676
- const resolver = node[RESOLVER];
5677
- if (typeof resolver === "function")
5678
- return resolver;
5679
- }
5680
- return;
5681
- }
5682
- function attachProjectTelemetryCapture(command, capture) {
5683
- command[CAPTURE] = capture;
5684
- }
5685
- class ProjectTelemetrySession {
5686
- resolver;
5687
- command;
5688
- target;
5689
- props = {};
5690
- explicit = false;
5691
- input;
5692
- constructor(resolver, command) {
5693
- this.resolver = resolver;
5694
- this.command = command;
5695
- }
5696
- async setTarget(path) {
5697
- this.target = path;
5698
- if (this.input) {
5699
- await this.resolve({
5700
- ...this.input,
5701
- phase: "after",
5702
- success: true
5703
- });
5704
- this.explicit = true;
5705
- }
5706
- }
5707
- async setIdentity(identity) {
5708
- try {
5709
- const props = await bounded(identityWithContext(this.command, identity), "project identity capture");
5710
- if (props !== undefined)
5711
- this.setProperties(props);
5712
- } catch (error) {
5713
- logSkipped("project identity capture", error);
5714
- }
5715
- }
5716
- setProperties(properties) {
5717
- try {
5718
- this.props = { ...properties };
5719
- this.explicit = true;
5720
- } catch (error) {
5721
- logSkipped("project identity properties", error);
5722
- }
5723
- }
5724
- properties() {
5725
- return { ...this.props };
5726
- }
5727
- async resolve(input) {
5728
- this.input = input;
5729
- if (this.explicit)
5730
- return;
5731
- try {
5732
- const props = await bounded(this.resolver({
5733
- ...input,
5734
- target: this.target
5735
- }), `project identity (${input.phase})`);
5736
- if (props !== undefined) {
5737
- this.props = props;
5738
- }
5739
- } catch (error) {
5740
- logSkipped(`project identity (${input.phase})`, error);
5741
- }
5742
- }
5743
- }
5744
-
5745
5914
  // ../common/src/telemetry/command-attribution.ts
5746
5915
  var LEGACY_SKILL_NAMESPACE = "uipath:";
5747
5916
  var MAX_SKILL_NAME_LENGTH = 80;
@@ -6197,7 +6366,7 @@ Command.prototype.trackedAction = function(context, fn, properties) {
6197
6366
  logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
6198
6367
  const typed = error;
6199
6368
  const customInstructions = typeof typed.instructions === "string" ? typed.instructions : undefined;
6200
- const customResult = typeof typed.result === "string" && typed.result !== RESULTS.Success && Object.values(RESULTS).includes(typed.result) ? typed.result : undefined;
6369
+ const customResult = carriedResult(error);
6201
6370
  const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
6202
6371
  const classified = cancellationExitCode === undefined ? await extractErrorDetails(error) : undefined;
6203
6372
  const finalResult = customResult ?? classified?.result ?? RESULTS.Failure;
@@ -6270,19 +6439,28 @@ Command.prototype.trackedAction = function(context, fn, properties) {
6270
6439
  };
6271
6440
 
6272
6441
  // ../common/src/confirmation.ts
6273
- function requireConfirmation(flags, operation) {
6442
+ function requireConfirmation(flags, operation, options) {
6274
6443
  if (flags.yes === true || flags.force === true) {
6275
6444
  return true;
6276
6445
  }
6446
+ const message = options?.reversible ? `Confirmation required: this will ${operation}.` : `Confirmation required: this will ${operation} and cannot be undone.`;
6277
6447
  OutputFormatter.error({
6278
6448
  Result: RESULTS.Failure,
6279
- Message: `Confirmation required: this will ${operation} and cannot be undone.`,
6280
- Instructions: "Re-run with --yes to confirm."
6449
+ Message: message,
6450
+ Instructions: options?.instructions ?? "Re-run with --yes to confirm.",
6451
+ ErrorCode: "confirmation_required",
6452
+ Retry: "RetryWillNotFix"
6281
6453
  });
6282
6454
  processContext.exit(1);
6283
6455
  return false;
6284
6456
  }
6285
6457
 
6458
+ // ../common/src/guid.ts
6459
+ var GUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
6460
+ function isGuid(value) {
6461
+ return GUID_REGEX.test(value);
6462
+ }
6463
+
6286
6464
  // ../common/src/mime-types.ts
6287
6465
  var OCTET_STREAM = "application/octet-stream";
6288
6466
  var MIME_TYPES_BY_EXTENSION = Object.freeze({
@@ -6431,6 +6609,11 @@ function installSdkUserAgentHeader(BaseApiClass, userAgent) {
6431
6609
  installRequestHeaderForwarding(BaseApiClass, userAgentPatchKey(userAgent), (headers) => addSdkUserAgentHeader(headers, userAgent));
6432
6610
  }
6433
6611
 
6612
+ // ../common/src/shell-quote.ts
6613
+ function quoteForShell(value) {
6614
+ return `'${value.replace(/'/g, "'\\''")}'`;
6615
+ }
6616
+
6434
6617
  // ../common/src/telemetry/ship-succeeded.ts
6435
6618
  var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
6436
6619
  function getShippedKeys() {
@@ -6719,11 +6902,6 @@ var RESERVED_KEYWORDS_LOWER = new Set([
6719
6902
  "writeonly",
6720
6903
  "xor"
6721
6904
  ]);
6722
- // ../common/src/guid.ts
6723
- var GUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
6724
- function isGuid(value) {
6725
- return GUID_REGEX.test(value);
6726
- }
6727
6905
  // ../common/src/host-global-options.ts
6728
6906
  var HOST_GLOBAL_OPTIONS_WITH_VALUE = [
6729
6907
  "--output",
@@ -6790,6 +6968,8 @@ var FAILURE_STATUSES = new Set([
6790
6968
  "canceled",
6791
6969
  "stopped"
6792
6970
  ]);
6971
+ // ../common/src/relayed-output.ts
6972
+ var RELAYED_OUTPUT_SYMBOL = Symbol.for("@uipath/common/relayed-output");
6793
6973
  // ../common/src/screen-logger.ts
6794
6974
  var ScreenLogger;
6795
6975
  ((ScreenLogger) => {
@@ -6799,10 +6979,6 @@ var ScreenLogger;
6799
6979
  }
6800
6980
  ScreenLogger.progress = progress;
6801
6981
  })(ScreenLogger ||= {});
6802
- // ../common/src/shell-quote.ts
6803
- function quoteForShell(value) {
6804
- return `'${value.replace(/'/g, "'\\''")}'`;
6805
- }
6806
6982
  // ../common/src/solution-project-types.ts
6807
6983
  var LIBRARY_NOT_A_PROJECT = "A library cannot be a project inside a solution — it is a reusable .nupkg that other projects consume as a NuGet dependency, not a deployable unit. Build and publish it on its own ('uip rpa pack <project-dir> <output-path>', then 'uip or libraries upload --file <nupkg-path>'), and reference it from a project's dependencies. To make the published library part of this solution, add it as a resource instead: 'uip solution resources add --source remote --kind Library --name <library-name>'.";
6808
6984
  function unsupportedSolutionProjectType(projectType) {
@@ -6813,6 +6989,6 @@ function unsupportedSolutionProjectType(projectType) {
6813
6989
  }
6814
6990
  // ../common/src/tool-provider.ts
6815
6991
  var factorySlot = singleton("PackagerFactoryProvider");
6816
- export { CommandDimensions, ShipDimensions, catchError, carriedErrorCode, carriedRetry, describeConnectivityError, extractErrorDetails, extractErrorMessage, RESULTS, InvalidArgumentError, Command, Option, getOutputSink, logger, telemetry, EXIT_CODES, pascalCaseDataKeys, ConfigurationError, isConfigurationError, OutputFormatter, processContext, requireConfirmation, isGuid, canPrompt, mimeTypeForFileName, registerPackageMetadataOptions, mapPackageMetadataOptions, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, quoteForShell, unsupportedSolutionProjectType, trackShipSucceeded };
6992
+ export { CommandDimensions, ShipDimensions, catchError, RESULTS, carriedErrorCode, carriedRetry, describeConnectivityError, extractErrorDetails, extractErrorMessage, InvalidArgumentError, Command, Option, getOutputSink, logger, telemetry, EXIT_CODES, pascalCaseDataKeys, ConfigurationError, isConfigurationError, OutputFormatter, configureProjectTelemetry, getProjectTelemetryCapture, setProjectTelemetryTarget, createProjectCommandResolver, processContext, requireConfirmation, isGuid, canPrompt, mimeTypeForFileName, registerPackageMetadataOptions, mapPackageMetadataOptions, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, quoteForShell, unsupportedSolutionProjectType, trackShipSucceeded };
6817
6993
 
6818
- //# debugId=EA093A7A5EBD221264756E2164756E21
6994
+ //# debugId=5FCCC4A751A23A8764756E2164756E21