@uipath/solution-sdk 1.205.0-preview.281 → 1.206.0-preview.282

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 (31) hide show
  1. package/dist/deployment-search.js +49 -19
  2. package/dist/{embedded-file-reader-z4becc02.js → embedded-file-reader-0228j82a.js} +1 -4
  3. package/dist/first-party-service-ahcc6xc6.js +8 -0
  4. package/dist/{index-y4vgqz1w.js → index-0b3srjv7.js} +98 -8
  5. package/dist/{index-78paj2kz.js → index-0drvtcm4.js} +12 -11
  6. package/dist/{index-asp9b472.js → index-bhnv4san.js} +582 -577
  7. package/dist/{index-hkexw5er.js → index-bpn15jyk.js} +35 -20
  8. package/dist/{index-gdtpsdn7.js → index-mm1x18d6.js} +223 -28
  9. package/dist/{index-sby22td6.js → index-nzr4mx5p.js} +2 -22
  10. package/dist/{index-enc2hqq5.js → index-tdffhvfs.js} +931 -502
  11. package/dist/index-txd1grjc.js +541 -0
  12. package/dist/{index-cs3g624n.js → index-xnrbg4x3.js} +6 -7
  13. package/dist/index-z2qk2qn6.js +24 -0
  14. package/dist/index.js +1310 -669
  15. package/dist/{jmespath-231m3hyn.js → jmespath-x4na7sj8.js} +1 -1
  16. package/dist/{js-yaml-88tdqrtd.js → js-yaml-a2bk27p6.js} +1 -3
  17. package/dist/package-search.js +18 -19
  18. package/dist/project-context.js +75 -0
  19. package/dist/resources/index.js +265 -237
  20. package/dist/scripts/generate-sdk.js +2 -2
  21. package/dist/solution-auth.js +6 -7
  22. package/dist/src/deployment-search.d.ts +30 -0
  23. package/dist/src/project-context.d.ts +9 -0
  24. package/dist/src/resources/providers/artefact-pair-binding-provider.d.ts +8 -2
  25. package/dist/src/resources/services/sync-resources-from-bindings.d.ts +14 -1
  26. package/package.json +6 -2
  27. package/dist/first-party-service-sd8yaf73.js +0 -27
  28. package/dist/index-1de529jm.js +0 -39
  29. package/dist/index-53w8skv5.js +0 -262
  30. package/dist/index-dqa169gp.js +0 -25
  31. package/dist/index-zmneg45c.js +0 -1184
@@ -1,11 +1,10 @@
1
1
  import {
2
- getFileSystem
3
- } from "./index-y4vgqz1w.js";
4
- import {
2
+ __toESM,
5
3
  __commonJS,
4
+ __exportCjs,
6
5
  __require,
7
- __toESM
8
- } from "./index-1de529jm.js";
6
+ getFileSystem
7
+ } from "./index-0b3srjv7.js";
9
8
 
10
9
  // ../../node_modules/commander/lib/error.js
11
10
  var require_error = __commonJS(function(exports) {
@@ -127,7 +126,7 @@ var require_help = __commonJS(function(exports) {
127
126
  this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;
128
127
  }
129
128
  visibleCommands(cmd) {
130
- const visibleCommands = cmd.commands.filter((cmd2) => !cmd2._hidden);
129
+ const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);
131
130
  const helpCommand = cmd._getHelpCommand();
132
131
  if (helpCommand && !helpCommand._hidden) {
133
132
  visibleCommands.push(helpCommand);
@@ -607,8 +606,8 @@ var require_option = __commonJS(function(exports) {
607
606
  }
608
607
  }
609
608
  function camelcase(str) {
610
- return str.split("-").reduce((str2, word) => {
611
- return str2 + word[0].toUpperCase() + word.slice(1);
609
+ return str.split("-").reduce((str, word) => {
610
+ return str + word[0].toUpperCase() + word.slice(1);
612
611
  });
613
612
  }
614
613
  function splitOptionFlags(flags) {
@@ -1179,44 +1178,44 @@ Expecting one of '${allowedValues.join("', '")}'`);
1179
1178
  });
1180
1179
  return source;
1181
1180
  }
1182
- _prepareUserArgs(argv, parseOptions) {
1183
- if (argv !== undefined && !Array.isArray(argv)) {
1181
+ _prepareUserArgs(argv2, parseOptions) {
1182
+ if (argv2 !== undefined && !Array.isArray(argv2)) {
1184
1183
  throw new Error("first parameter to parse must be array or undefined");
1185
1184
  }
1186
1185
  parseOptions = parseOptions || {};
1187
- if (argv === undefined && parseOptions.from === undefined) {
1186
+ if (argv2 === undefined && parseOptions.from === undefined) {
1188
1187
  if (process2.versions?.electron) {
1189
1188
  parseOptions.from = "electron";
1190
1189
  }
1191
- const execArgv = process2.execArgv ?? [];
1192
- if (execArgv.includes("-e") || execArgv.includes("--eval") || execArgv.includes("-p") || execArgv.includes("--print")) {
1190
+ const execArgv2 = process2.execArgv ?? [];
1191
+ if (execArgv2.includes("-e") || execArgv2.includes("--eval") || execArgv2.includes("-p") || execArgv2.includes("--print")) {
1193
1192
  parseOptions.from = "eval";
1194
1193
  }
1195
1194
  }
1196
- if (argv === undefined) {
1197
- argv = process2.argv;
1195
+ if (argv2 === undefined) {
1196
+ argv2 = process2.argv;
1198
1197
  }
1199
- this.rawArgs = argv.slice();
1198
+ this.rawArgs = argv2.slice();
1200
1199
  let userArgs;
1201
1200
  switch (parseOptions.from) {
1202
1201
  case undefined:
1203
1202
  case "node":
1204
- this._scriptPath = argv[1];
1205
- userArgs = argv.slice(2);
1203
+ this._scriptPath = argv2[1];
1204
+ userArgs = argv2.slice(2);
1206
1205
  break;
1207
1206
  case "electron":
1208
1207
  if (process2.defaultApp) {
1209
- this._scriptPath = argv[1];
1210
- userArgs = argv.slice(2);
1208
+ this._scriptPath = argv2[1];
1209
+ userArgs = argv2.slice(2);
1211
1210
  } else {
1212
- userArgs = argv.slice(1);
1211
+ userArgs = argv2.slice(1);
1213
1212
  }
1214
1213
  break;
1215
1214
  case "user":
1216
- userArgs = argv.slice(0);
1215
+ userArgs = argv2.slice(0);
1217
1216
  break;
1218
1217
  case "eval":
1219
- userArgs = argv.slice(1);
1218
+ userArgs = argv2.slice(1);
1220
1219
  break;
1221
1220
  default:
1222
1221
  throw new Error(`unexpected parse option { from: '${parseOptions.from}' }`);
@@ -1739,18 +1738,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
1739
1738
  this.error(message, { code: "commander.missingMandatoryOptionValue" });
1740
1739
  }
1741
1740
  _conflictingOption(option, conflictingOption) {
1742
- const findBestOptionFromValue = (option2) => {
1743
- const optionKey = option2.attributeName();
1741
+ const findBestOptionFromValue = (option) => {
1742
+ const optionKey = option.attributeName();
1744
1743
  const optionValue = this.getOptionValue(optionKey);
1745
1744
  const negativeOption = this.options.find((target) => target.negate && optionKey === target.attributeName());
1746
1745
  const positiveOption = this.options.find((target) => !target.negate && optionKey === target.attributeName());
1747
1746
  if (negativeOption && (negativeOption.presetArg === undefined && optionValue === false || negativeOption.presetArg !== undefined && optionValue === negativeOption.presetArg)) {
1748
1747
  return negativeOption;
1749
1748
  }
1750
- return positiveOption || option2;
1749
+ return positiveOption || option;
1751
1750
  };
1752
- const getErrorMessage = (option2) => {
1753
- const bestOption = findBestOptionFromValue(option2);
1751
+ const getErrorMessage = (option) => {
1752
+ const bestOption = findBestOptionFromValue(option);
1754
1753
  const optionKey = bestOption.attributeName();
1755
1754
  const source = this.getOptionValueSource(optionKey);
1756
1755
  if (source === "env") {
@@ -1904,10 +1903,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
1904
1903
  this._name = path.basename(filename, path.extname(filename));
1905
1904
  return this;
1906
1905
  }
1907
- executableDir(path2) {
1908
- if (path2 === undefined)
1906
+ executableDir(path) {
1907
+ if (path === undefined)
1909
1908
  return this._executableDir;
1910
- this._executableDir = path2;
1909
+ this._executableDir = path;
1911
1910
  return this;
1912
1911
  }
1913
1912
  helpInformation(contextOptions) {
@@ -2004,11 +2003,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
2004
2003
  }
2005
2004
  help(contextOptions) {
2006
2005
  this.outputHelp(contextOptions);
2007
- let exitCode = Number(process2.exitCode ?? 0);
2008
- if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) {
2009
- exitCode = 1;
2006
+ let exitCode2 = Number(process2.exitCode ?? 0);
2007
+ if (exitCode2 === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) {
2008
+ exitCode2 = 1;
2010
2009
  }
2011
- this._exit(exitCode, "commander.help", "(outputHelp)");
2010
+ this._exit(exitCode2, "commander.help", "(outputHelp)");
2012
2011
  }
2013
2012
  addHelpText(position, text) {
2014
2013
  const allowedValues = ["beforeAll", "before", "after", "afterAll"];
@@ -2080,25 +2079,216 @@ Expecting one of '${allowedValues.join("', '")}'`);
2080
2079
  exports.useColor = useColor;
2081
2080
  });
2082
2081
 
2083
- // ../../node_modules/commander/index.js
2084
- var require_commander = __commonJS(function(exports) {
2085
- var { Argument } = require_argument();
2086
- var { Command } = require_command();
2087
- var { CommanderError, InvalidArgumentError } = require_error();
2088
- var { Help } = require_help();
2089
- var { Option } = require_option();
2090
- exports.program = new Command;
2091
- exports.createCommand = (name) => new Command(name);
2092
- exports.createOption = (flags, description) => new Option(flags, description);
2093
- exports.createArgument = (name, description) => new Argument(name, description);
2094
- exports.Command = Command;
2095
- exports.Option = Option;
2096
- exports.Argument = Argument;
2097
- exports.Help = Help;
2098
- exports.CommanderError = CommanderError;
2099
- exports.InvalidArgumentError = InvalidArgumentError;
2100
- exports.InvalidOptionArgumentError = InvalidArgumentError;
2101
- });
2082
+ // ../common/src/telemetry/telemetry-dimensions.ts
2083
+ var BaseDimensions = {
2084
+ ApplicationName: "ApplicationName",
2085
+ ProductVersion: "ProductVersion",
2086
+ InstallationId: "InstallationId",
2087
+ CloudUserId: "CloudUserId",
2088
+ CloudTenantId: "CloudTenantId",
2089
+ CloudOrganizationId: "CloudOrganizationId",
2090
+ IsInternalUser: "IsInternalUser",
2091
+ Environment: "Environment",
2092
+ BaseUrl: "BaseUrl",
2093
+ Region: "Region",
2094
+ Agent: "Agent",
2095
+ AgentVersion: "AgentVersion",
2096
+ AgentModel: "AgentModel",
2097
+ ToolName: "ToolName",
2098
+ ToolVersion: "ToolVersion",
2099
+ ExecutionContext: "ExecutionContext",
2100
+ CiProvider: "CiProvider",
2101
+ SessionIdSource: "SessionIdSource",
2102
+ SessionId: "SessionId"
2103
+ };
2104
+ var CommandDimensions = {
2105
+ IsCommand: "IsCommand",
2106
+ IsReexec: "IsReexec",
2107
+ CommandName: "CommandName",
2108
+ ExitCode: "ExitCode",
2109
+ TerminalOutcome: "TerminalOutcome",
2110
+ ErrorClass: "ErrorClass",
2111
+ TerminalSignal: "TerminalSignal",
2112
+ ErrorMessage: "ErrorMessage",
2113
+ SkillName: "SkillName",
2114
+ ProductArea: "ProductArea",
2115
+ Mode: "Mode"
2116
+ };
2117
+ var ProjectDimensions = {
2118
+ ProjectKey: "ProjectKey",
2119
+ ProjectType: "ProjectType",
2120
+ ProjectIdentityStatus: "ProjectIdentityStatus",
2121
+ SolutionKey: "SolutionKey",
2122
+ SolutionProjectKey: "SolutionProjectKey",
2123
+ SolutionIdentityStatus: "SolutionIdentityStatus",
2124
+ PreviousSolutionKey: "PreviousSolutionKey"
2125
+ };
2126
+ var GUID_KEY_DIMENSIONS = new Set([
2127
+ ProjectDimensions.ProjectKey,
2128
+ ProjectDimensions.SolutionKey,
2129
+ ProjectDimensions.SolutionProjectKey,
2130
+ ProjectDimensions.PreviousSolutionKey
2131
+ ]);
2132
+ var ShipDimensions = {
2133
+ ShipKind: "ShipKind",
2134
+ Target: "Target",
2135
+ ProjectType: "ProjectType",
2136
+ ProjectTypes: "ProjectTypes",
2137
+ ArtifactCorrelationKey: "ArtifactCorrelationKey",
2138
+ PackageName: "PackageName",
2139
+ PackageVersion: "PackageVersion",
2140
+ PackageVersionKey: "PackageVersionKey",
2141
+ DeploymentKey: "DeploymentKey",
2142
+ SolutionId: "SolutionId",
2143
+ FolderKey: "FolderKey",
2144
+ FeedId: "FeedId"
2145
+ };
2146
+ var ErrorDimensions = {
2147
+ Result: "Result",
2148
+ ErrorCode: "ErrorCode",
2149
+ Retry: "Retry",
2150
+ ErrorMessage: "ErrorMessage",
2151
+ HttpStatus: "HttpStatus",
2152
+ UpstreamErrorCode: "UpstreamErrorCode"
2153
+ };
2154
+ var AuthDimensions = {
2155
+ AuthenticationMethod: "AuthenticationMethod",
2156
+ Success: "Success",
2157
+ Reason: "Reason"
2158
+ };
2159
+ var SkillsDimensions = {
2160
+ SchemaVersion: "SchemaVersion",
2161
+ AgentType: "AgentType",
2162
+ SkillsVersion: "SkillsVersion",
2163
+ UipSubcommand: "UipSubcommand",
2164
+ FileExtension: "FileExtension",
2165
+ SubagentModel: "SubagentModel",
2166
+ SubagentType: "SubagentType",
2167
+ PermissionMode: "PermissionMode",
2168
+ EffortLevel: "EffortLevel",
2169
+ SessionSource: "SessionSource",
2170
+ Outcome: "Outcome",
2171
+ DurationMs: "DurationMs",
2172
+ Source: "Source"
2173
+ };
2174
+ var PackagerDimensions = {
2175
+ ProjectId: "ProjectId",
2176
+ ProjectType: "ProjectType",
2177
+ SolutionId: "SolutionId"
2178
+ };
2179
+ var ScopeDimensions = {
2180
+ FolderId: "FolderId"
2181
+ };
2182
+ var ID_DIMENSIONS = new Set([
2183
+ BaseDimensions.CloudUserId,
2184
+ BaseDimensions.CloudTenantId,
2185
+ BaseDimensions.CloudOrganizationId,
2186
+ BaseDimensions.InstallationId,
2187
+ ShipDimensions.ArtifactCorrelationKey,
2188
+ ShipDimensions.PackageVersionKey,
2189
+ ShipDimensions.DeploymentKey,
2190
+ ShipDimensions.SolutionId,
2191
+ ShipDimensions.FolderKey,
2192
+ ShipDimensions.FeedId,
2193
+ PackagerDimensions.ProjectId
2194
+ ]);
2195
+ var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
2196
+ var RESERVED_DIMENSION_NAMES = new Set([
2197
+ ...Object.values(BaseDimensions),
2198
+ ...Object.values(CommandDimensions),
2199
+ ...Object.values(ShipDimensions),
2200
+ ...Object.values(ProjectDimensions),
2201
+ ...Object.values(ErrorDimensions),
2202
+ ...Object.values(AuthDimensions),
2203
+ ...Object.values(SkillsDimensions),
2204
+ ...Object.values(PackagerDimensions),
2205
+ ...Object.values(ScopeDimensions)
2206
+ ]);
2207
+ var CURATED_DIMENSIONS = new Set([
2208
+ BaseDimensions.ApplicationName,
2209
+ BaseDimensions.ProductVersion,
2210
+ BaseDimensions.InstallationId,
2211
+ BaseDimensions.CloudUserId,
2212
+ BaseDimensions.CloudTenantId,
2213
+ BaseDimensions.CloudOrganizationId,
2214
+ BaseDimensions.IsInternalUser,
2215
+ BaseDimensions.Environment,
2216
+ BaseDimensions.BaseUrl,
2217
+ BaseDimensions.Region,
2218
+ BaseDimensions.Agent,
2219
+ BaseDimensions.AgentVersion,
2220
+ BaseDimensions.ToolVersion,
2221
+ BaseDimensions.ExecutionContext,
2222
+ BaseDimensions.CiProvider,
2223
+ BaseDimensions.SessionIdSource,
2224
+ BaseDimensions.SessionId,
2225
+ ...Object.values(CommandDimensions),
2226
+ ...Object.values(ShipDimensions),
2227
+ ...Object.values(ProjectDimensions)
2228
+ ]);
2229
+ function lowercaseIdDimensionValues(properties) {
2230
+ let changed = false;
2231
+ const result = {
2232
+ ...properties
2233
+ };
2234
+ for (const key of Object.keys(result)) {
2235
+ const value = result[key];
2236
+ if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
2237
+ continue;
2238
+ }
2239
+ const lowered = value.toLowerCase();
2240
+ if (lowered !== value) {
2241
+ result[key] = lowered;
2242
+ changed = true;
2243
+ }
2244
+ }
2245
+ return changed ? result : properties;
2246
+ }
2247
+
2248
+ // ../common/src/telemetry/project-identity.ts
2249
+ function solutionIdentityProperties(identity) {
2250
+ const key = identity.id ? projectKey(identity.id) : undefined;
2251
+ return {
2252
+ [ProjectDimensions.SolutionIdentityStatus]: identity.status === "resolved" && !key ? "invalid" : identity.status,
2253
+ ...identity.status === "resolved" && key ? {
2254
+ [ProjectDimensions.SolutionKey]: key
2255
+ } : {}
2256
+ };
2257
+ }
2258
+ function projectKey(id) {
2259
+ if (typeof id !== "string")
2260
+ return;
2261
+ const key = id.trim().toLowerCase().replaceAll("-", "");
2262
+ return /^[0-9a-f]{32}$/.test(key) ? key : undefined;
2263
+ }
2264
+ function projectIdentityProperties(identity) {
2265
+ const key = identity.id ? projectKey(identity.id) : undefined;
2266
+ return {
2267
+ [ProjectDimensions.ProjectIdentityStatus]: identity.status === "resolved" && !key ? "invalid" : identity.status,
2268
+ [ProjectDimensions.ProjectType]: identity.projectType,
2269
+ ...identity.status === "resolved" && key ? {
2270
+ [ProjectDimensions.ProjectKey]: key
2271
+ } : {}
2272
+ };
2273
+ }
2274
+ var PROJECT_IDENTITY_LOOKUP_BUDGET_MS = 1000;
2275
+ async function withinProjectIdentityBudget(work, onTimeout) {
2276
+ work.catch(() => {
2277
+ return;
2278
+ });
2279
+ let timer;
2280
+ const expired = new Promise((resolve) => {
2281
+ timer = setTimeout(() => {
2282
+ onTimeout?.();
2283
+ resolve(undefined);
2284
+ }, PROJECT_IDENTITY_LOOKUP_BUDGET_MS);
2285
+ });
2286
+ try {
2287
+ return await Promise.race([work, expired]);
2288
+ } finally {
2289
+ clearTimeout(timer);
2290
+ }
2291
+ }
2102
2292
 
2103
2293
  // ../common/src/telemetry/pseudonymize.ts
2104
2294
  var PSEUDONYM_DOMAIN = "uipath-cli/telemetry/pseudonym/v1:";
@@ -2563,6 +2753,8 @@ function redactProperty(name, value) {
2563
2753
  if (isSensitiveName(name)) {
2564
2754
  return REDACTED;
2565
2755
  }
2756
+ if (GUID_KEY_DIMENSIONS.has(name))
2757
+ return projectKey(value);
2566
2758
  if (typeof value === "boolean" || typeof value === "number") {
2567
2759
  return value;
2568
2760
  }
@@ -2854,6 +3046,63 @@ function getLogFilePath() {
2854
3046
  return logger.getLogFilePath();
2855
3047
  }
2856
3048
 
3049
+ // ../common/src/error-codes.ts
3050
+ var CLI_ERROR_CODES = [
3051
+ "invalid_argument",
3052
+ "authentication_required",
3053
+ "permission_denied",
3054
+ "local_permission_denied",
3055
+ "not_found",
3056
+ "rate_limited",
3057
+ "network_error",
3058
+ "timeout",
3059
+ "server_error",
3060
+ "method_not_allowed",
3061
+ "not_supported",
3062
+ "configuration_error",
3063
+ "execution_failed",
3064
+ "unknown_error"
3065
+ ];
3066
+ var RETRY_HINTS = [
3067
+ "RetryWillNotFix",
3068
+ "RetryLater",
3069
+ "RetryAfter1Second",
3070
+ "RetryAfter10Seconds",
3071
+ "RetryAfter30Seconds",
3072
+ "RetryAfter60Seconds"
3073
+ ];
3074
+ var CLI_ERROR_CODE_VALUES = new Set(CLI_ERROR_CODES);
3075
+ var RETRY_HINT_VALUES = new Set(RETRY_HINTS);
3076
+ function isCliErrorCode(value) {
3077
+ return typeof value === "string" && CLI_ERROR_CODE_VALUES.has(value);
3078
+ }
3079
+ function isRetryHint(value) {
3080
+ return typeof value === "string" && RETRY_HINT_VALUES.has(value);
3081
+ }
3082
+ function carriedErrorCode(error) {
3083
+ if (!error || typeof error !== "object")
3084
+ return;
3085
+ const code = error.errorCode;
3086
+ return isCliErrorCode(code) ? code : undefined;
3087
+ }
3088
+ function carriedRetry(error) {
3089
+ if (!error || typeof error !== "object")
3090
+ return;
3091
+ const retry = error.retry;
3092
+ return isRetryHint(retry) ? retry : undefined;
3093
+ }
3094
+ function defaultRetryForErrorCode(errorCode) {
3095
+ switch (errorCode) {
3096
+ case "network_error":
3097
+ case "rate_limited":
3098
+ case "server_error":
3099
+ case "timeout":
3100
+ return "RetryLater";
3101
+ default:
3102
+ return "RetryWillNotFix";
3103
+ }
3104
+ }
3105
+
2857
3106
  // ../common/src/error-graph.ts
2858
3107
  function* walkErrorGraph(error) {
2859
3108
  const queue = [error];
@@ -2898,36 +3147,81 @@ function findHttpStatusInGraph(error) {
2898
3147
  return;
2899
3148
  }
2900
3149
 
2901
- // ../common/src/local-permission-codes.ts
2902
- var LOCAL_PERMISSION_ERROR_CODES = new Set([
2903
- "EACCES",
2904
- "EPERM",
2905
- "EROFS"
2906
- ]);
2907
-
2908
- // ../common/src/error-handler.ts
2909
- var DEFAULT_401 = "Unauthorized (401). The session is missing or expired, or its token carries no scope for this API. Run `uip login status --detailed` to see the session and its scopes.";
2910
- var DEFAULT_403 = "Forbidden (403). The account lacks permission for this operation, or the token carries no scope for this API. Run `uip login status --detailed` to see the token's scopes.";
2911
- var DEFAULT_405 = "Method Not Allowed (405). The endpoint may not exist or the base URL may be incorrect.";
2912
- var DEFAULT_413 = "Payload too large (413). The upload exceeded the server or CDN size limit. Reduce the package size — for example, exclude unused dependencies or remove large files from the project — and try again.";
2913
- var HTML_RESPONSE_MESSAGE = "Received HTML instead of the expected JSON response.";
2914
- var NETWORK_ERROR_CODES = new Set([
2915
- "ECONNREFUSED",
2916
- "ECONNRESET",
2917
- "ENOTFOUND",
2918
- "EAI_AGAIN",
2919
- "ETIMEDOUT",
2920
- "EPIPE",
2921
- "EHOSTUNREACH",
2922
- "ENETUNREACH",
2923
- "EAI_FAIL"
2924
- ]);
2925
- var TLS_ERROR_CODES = new Set([
2926
- "SELF_SIGNED_CERT_IN_CHAIN",
2927
- "DEPTH_ZERO_SELF_SIGNED_CERT",
2928
- "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
2929
- "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
2930
- "UNABLE_TO_GET_ISSUER_CERT",
3150
+ // ../common/src/http-status.ts
3151
+ function httpStatusOf(error) {
3152
+ if (!error || typeof error !== "object") {
3153
+ return;
3154
+ }
3155
+ if ("response" in error && error.response && typeof error.response === "object" && "status" in error.response && typeof error.response.status === "number") {
3156
+ return error.response.status;
3157
+ }
3158
+ return "status" in error && typeof error.status === "number" ? error.status : undefined;
3159
+ }
3160
+ function classifyHttpStatus(status) {
3161
+ if (status === undefined)
3162
+ return;
3163
+ if (status === 400 || status === 409 || status === 413 || status === 422) {
3164
+ return { errorCode: "invalid_argument", retry: "RetryWillNotFix" };
3165
+ }
3166
+ if (status === 401) {
3167
+ return {
3168
+ errorCode: "authentication_required",
3169
+ retry: "RetryWillNotFix"
3170
+ };
3171
+ }
3172
+ if (status === 403) {
3173
+ return { errorCode: "permission_denied", retry: "RetryWillNotFix" };
3174
+ }
3175
+ if (status === 404) {
3176
+ return { errorCode: "not_found", retry: "RetryWillNotFix" };
3177
+ }
3178
+ if (status === 405) {
3179
+ return { errorCode: "method_not_allowed", retry: "RetryWillNotFix" };
3180
+ }
3181
+ if (status === 408) {
3182
+ return { errorCode: "timeout", retry: "RetryLater" };
3183
+ }
3184
+ if (status === 429) {
3185
+ return { errorCode: "rate_limited", retry: "RetryLater" };
3186
+ }
3187
+ if (status >= 500 && status < 600) {
3188
+ return { errorCode: "server_error", retry: "RetryLater" };
3189
+ }
3190
+ return;
3191
+ }
3192
+
3193
+ // ../common/src/local-permission-codes.ts
3194
+ var LOCAL_PERMISSION_ERROR_CODES = new Set([
3195
+ "EACCES",
3196
+ "EPERM",
3197
+ "EROFS"
3198
+ ]);
3199
+
3200
+ // ../common/src/error-handler.ts
3201
+ var DEFAULT_401 = "Unauthorized (401). The session is missing or expired, or its token carries no scope for this API. Run `uip login status --detailed` to see the session and its scopes.";
3202
+ var DEFAULT_403 = "Forbidden (403). The account lacks permission for this operation, or the token carries no scope for this API. Run `uip login status --detailed` to see the token's scopes.";
3203
+ var DEFAULT_405 = "Method Not Allowed (405). The endpoint may not exist or the base URL may be incorrect.";
3204
+ var DEFAULT_413 = "Payload too large (413). The upload exceeded the server or CDN size limit. Reduce the package size — for example, exclude unused dependencies or remove large files from the project — and try again.";
3205
+ var CLOUDFLARE_BLOCK_403 = "Forbidden (403) by Cloudflare, in front of the service: the answer is a Cloudflare HTML page, not the service's JSON, so the service did not see the request and did not check the account's roles or the token's scopes. Cloudflare blocks a request when its content matches a firewall rule (text that looks like SQL or script code, for example) or when it comes from a network the firewall does not allow.";
3206
+ var CLOUDFLARE_BLOCK_403_INSTRUCTIONS = "If the request carries text that looks like code, change that text and try again. Otherwise send the time of the request and the Cloudflare Ray ID, when the message gives one, to the owner of the service or UiPath support.";
3207
+ var HTML_RESPONSE_MESSAGE = "Received HTML instead of the expected JSON response.";
3208
+ var NETWORK_ERROR_CODES = new Set([
3209
+ "ECONNREFUSED",
3210
+ "ECONNRESET",
3211
+ "ENOTFOUND",
3212
+ "EAI_AGAIN",
3213
+ "ETIMEDOUT",
3214
+ "EPIPE",
3215
+ "EHOSTUNREACH",
3216
+ "ENETUNREACH",
3217
+ "EAI_FAIL"
3218
+ ]);
3219
+ var TLS_ERROR_CODES = new Set([
3220
+ "SELF_SIGNED_CERT_IN_CHAIN",
3221
+ "DEPTH_ZERO_SELF_SIGNED_CERT",
3222
+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
3223
+ "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
3224
+ "UNABLE_TO_GET_ISSUER_CERT",
2931
3225
  "CERT_HAS_EXPIRED",
2932
3226
  "CERT_UNTRUSTED",
2933
3227
  "ERR_TLS_CERT_ALTNAME_INVALID"
@@ -2995,6 +3289,20 @@ function localPermissionPath(path, message) {
2995
3289
  return path;
2996
3290
  return message ? /'([^']+)'/.exec(message)?.[1] : undefined;
2997
3291
  }
3292
+ function readHeader(response, name) {
3293
+ const headers = response?.headers;
3294
+ if (!headers || typeof headers !== "object")
3295
+ return;
3296
+ if (typeof headers.get === "function") {
3297
+ const value = headers.get(name);
3298
+ if (value)
3299
+ return value;
3300
+ }
3301
+ const plain = headers;
3302
+ const key = Object.keys(plain).find((k) => k.toLowerCase() === name.toLowerCase());
3303
+ const value = key === undefined ? undefined : plain[key];
3304
+ return typeof value === "string" && value !== "" ? value : undefined;
3305
+ }
2998
3306
  function isHtmlDocument(body) {
2999
3307
  return /^\s*(<!doctype html|<html\b)/i.test(body);
3000
3308
  }
@@ -3011,36 +3319,9 @@ function retryHintForRetryAfter(seconds) {
3011
3319
  return "RetryAfter60Seconds";
3012
3320
  }
3013
3321
  function classifyError(status, error) {
3014
- if (status === 400 || status === 409 || status === 422) {
3015
- return { errorCode: "invalid_argument", retry: "RetryWillNotFix" };
3016
- }
3017
- if (status === 401) {
3018
- return {
3019
- errorCode: "authentication_required",
3020
- retry: "RetryWillNotFix"
3021
- };
3022
- }
3023
- if (status === 403) {
3024
- return { errorCode: "permission_denied", retry: "RetryWillNotFix" };
3025
- }
3026
- if (status === 404) {
3027
- return { errorCode: "not_found", retry: "RetryWillNotFix" };
3028
- }
3029
- if (status === 405) {
3030
- return { errorCode: "method_not_allowed", retry: "RetryWillNotFix" };
3031
- }
3032
- if (status === 413) {
3033
- return { errorCode: "invalid_argument", retry: "RetryWillNotFix" };
3034
- }
3035
- if (status === 408) {
3036
- return { errorCode: "timeout", retry: "RetryLater" };
3037
- }
3038
- if (status === 429) {
3039
- return { errorCode: "rate_limited", retry: "RetryLater" };
3040
- }
3041
- if (status !== undefined && status >= 500 && status < 600) {
3042
- return { errorCode: "server_error", retry: "RetryLater" };
3043
- }
3322
+ const byStatus = classifyHttpStatus(status);
3323
+ if (byStatus)
3324
+ return byStatus;
3044
3325
  if (status === undefined && describePermissionError(error)) {
3045
3326
  return {
3046
3327
  errorCode: "local_permission_denied",
@@ -3056,6 +3337,17 @@ function classifyError(status, error) {
3056
3337
  }
3057
3338
  return { errorCode: "unknown_error", retry: "RetryWillNotFix" };
3058
3339
  }
3340
+ function withCarriedClass(inferred, error) {
3341
+ const errorCode = carriedErrorCode(error);
3342
+ const retry = carriedRetry(error);
3343
+ if (errorCode === undefined || errorCode === inferred.errorCode) {
3344
+ return {
3345
+ errorCode: inferred.errorCode,
3346
+ retry: retry ?? inferred.retry
3347
+ };
3348
+ }
3349
+ return { errorCode, retry: retry ?? defaultRetryForErrorCode(errorCode) };
3350
+ }
3059
3351
  function formatHttpStatusMessage(status, rawMessage, extractedMessage, inferredStatus) {
3060
3352
  if (extractedMessage) {
3061
3353
  return `HTTP ${status}: ${extractedMessage}`;
@@ -3111,9 +3403,14 @@ async function extractErrorDetails(error, options) {
3111
3403
  const classificationStatus = status ?? findHttpStatusInGraph(error);
3112
3404
  const classification = classifyError(classificationStatus, error);
3113
3405
  let retry = classification.retry;
3406
+ const htmlForbidden = status === 403 && rawBody !== undefined && isHtmlDocument(rawBody);
3407
+ const rayId = htmlForbidden ? readHeader(response, "cf-ray") : undefined;
3408
+ const cloudflareBlock = htmlForbidden && (rayId !== undefined || /\bcloudflare\b/i.test(readHeader(response, "server") ?? ""));
3114
3409
  if (status === 401) {
3115
3410
  message = DEFAULT_401;
3116
3411
  result = "AuthenticationError";
3412
+ } else if (cloudflareBlock) {
3413
+ message = rayId ? `${CLOUDFLARE_BLOCK_403} Cloudflare Ray ID: ${rayId}.` : CLOUDFLARE_BLOCK_403;
3117
3414
  } else if (status === 403) {
3118
3415
  message = options?.forbiddenMessage ?? DEFAULT_403;
3119
3416
  result = "AuthenticationError";
@@ -3161,7 +3458,9 @@ async function extractErrorDetails(error, options) {
3161
3458
  }
3162
3459
  }
3163
3460
  let details = rawMessage;
3164
- if (rawBody) {
3461
+ if (htmlForbidden) {
3462
+ details = cloudflareBlock ? CLOUDFLARE_BLOCK_403_INSTRUCTIONS : HTML_RESPONSE_MESSAGE;
3463
+ } else if (rawBody) {
3165
3464
  if (parsedBody) {
3166
3465
  const extra = {};
3167
3466
  if (parsedBody.errorCode)
@@ -3195,6 +3494,8 @@ async function extractErrorDetails(error, options) {
3195
3494
  }
3196
3495
  if (parsedBody?.requestId && typeof parsedBody.requestId === "string") {
3197
3496
  context.requestId = parsedBody.requestId;
3497
+ } else if (cloudflareBlock && rayId) {
3498
+ context.requestId = rayId;
3198
3499
  }
3199
3500
  if (parsedBody?.traceId && typeof parsedBody.traceId === "string") {
3200
3501
  context.traceId = parsedBody.traceId;
@@ -3203,16 +3504,7 @@ async function extractErrorDetails(error, options) {
3203
3504
  context.path = permission.path;
3204
3505
  }
3205
3506
  if (status === 429) {
3206
- const resp = response;
3207
- const headersObj = resp?.headers;
3208
- let retryAfterValue;
3209
- if (headersObj && typeof headersObj === "object" && typeof headersObj.get === "function") {
3210
- retryAfterValue = headersObj.get("retry-after") ?? undefined;
3211
- }
3212
- if (!retryAfterValue && headersObj && typeof headersObj === "object") {
3213
- const headers = headersObj;
3214
- retryAfterValue = headers["retry-after"] ?? headers["Retry-After"];
3215
- }
3507
+ const retryAfterValue = readHeader(response, "retry-after");
3216
3508
  if (retryAfterValue) {
3217
3509
  const seconds = Number(retryAfterValue);
3218
3510
  if (!Number.isNaN(seconds)) {
@@ -3246,9 +3538,8 @@ async function extractErrorDetails(error, options) {
3246
3538
  }
3247
3539
  return {
3248
3540
  result,
3249
- errorCode: classification.errorCode,
3541
+ ...withCarriedClass({ errorCode: classification.errorCode, retry }, error),
3250
3542
  message,
3251
- retry,
3252
3543
  details,
3253
3544
  ...hasContext ? { context } : {},
3254
3545
  ...parsedErrors ? { parsedErrors } : {}
@@ -3258,9 +3549,179 @@ async function extractErrorMessage(error, options) {
3258
3549
  const { message } = await extractErrorDetails(error, options);
3259
3550
  return message;
3260
3551
  }
3552
+ // ../common/src/result-types.ts
3553
+ var RESULTS = {
3554
+ Success: "Success",
3555
+ Failure: "Failure",
3556
+ ConfigError: "ConfigError",
3557
+ AuthenticationError: "AuthenticationError",
3558
+ ValidationError: "ValidationError",
3559
+ TimeoutError: "TimeoutError"
3560
+ };
3561
+
3562
+ // ../common/src/classified-failure.ts
3563
+ var MAX_QUOTED_BODY_CHARS = 200;
3564
+ function summarizePlatformBody(body) {
3565
+ const trimmed = body.trim().replace(/\s+/g, " ");
3566
+ return trimmed.length > MAX_QUOTED_BODY_CHARS ? `${trimmed.slice(0, MAX_QUOTED_BODY_CHARS)}…` : trimmed;
3567
+ }
3568
+ // ../../node_modules/commander/index.js
3569
+ var exports_commander = {};
3570
+ __exportCjs(exports_commander, {
3571
+ program: () => $program,
3572
+ createCommand: () => $createCommand,
3573
+ createOption: () => $createOption,
3574
+ createArgument: () => $createArgument,
3575
+ Command: () => $Command,
3576
+ Option: () => $Option,
3577
+ Argument: () => $Argument,
3578
+ Help: () => $Help,
3579
+ CommanderError: () => $CommanderError,
3580
+ InvalidArgumentError: () => $InvalidArgumentError,
3581
+ InvalidOptionArgumentError: () => $InvalidOptionArgumentError
3582
+ }, {
3583
+ program: (value) => $program = value,
3584
+ createCommand: (value) => $createCommand = value,
3585
+ createOption: (value) => $createOption = value,
3586
+ createArgument: (value) => $createArgument = value,
3587
+ Command: (value) => $Command = value,
3588
+ Option: (value) => $Option = value,
3589
+ Argument: (value) => $Argument = value,
3590
+ Help: (value) => $Help = value,
3591
+ CommanderError: (value) => $CommanderError = value,
3592
+ InvalidArgumentError: (value) => $InvalidArgumentError = value,
3593
+ InvalidOptionArgumentError: (value) => $InvalidOptionArgumentError = value
3594
+ });
3595
+ var { Argument } = require_argument();
3596
+ var { Command } = require_command();
3597
+ var { CommanderError, InvalidArgumentError } = require_error();
3598
+ var { Help } = require_help();
3599
+ var { Option } = require_option();
3600
+ var $program = new Command;
3601
+ var $createCommand = (name) => new Command(name);
3602
+ var $createOption = (flags, description) => new Option(flags, description);
3603
+ var $createArgument = (name, description) => new Argument(name, description);
3604
+ var $Command = Command;
3605
+ var $Option = Option;
3606
+ var $Argument = Argument;
3607
+ var $Help = Help;
3608
+ var $CommanderError = CommanderError;
3609
+ var $InvalidArgumentError = InvalidArgumentError;
3610
+ var $InvalidOptionArgumentError = InvalidArgumentError;
3611
+
3612
+ // ../../node_modules/commander/esm.mjs
3613
+ var {
3614
+ program,
3615
+ createCommand,
3616
+ createArgument,
3617
+ createOption,
3618
+ CommanderError: CommanderError2,
3619
+ InvalidArgumentError: InvalidArgumentError2,
3620
+ InvalidOptionArgumentError,
3621
+ Command: Command2,
3622
+ Argument: Argument2,
3623
+ Option: Option2,
3624
+ Help: Help2
3625
+ } = exports_commander;
3626
+
3627
+ // ../common/src/command-examples.ts
3628
+ var examplesByCommand = new WeakMap;
3629
+ Command2.prototype.examples = function(examples) {
3630
+ examplesByCommand.set(this, examples);
3631
+ return this;
3632
+ };
3633
+ // ../common/src/preview.ts
3634
+ var previewSlot = singleton("PreviewBuild");
3635
+ function isPreviewBuild() {
3636
+ return previewSlot.get(false) ?? false;
3637
+ }
3638
+ Command2.prototype.previewCommand = function(nameAndArgs, opts) {
3639
+ if (isPreviewBuild()) {
3640
+ return this.command(nameAndArgs, opts);
3641
+ }
3642
+ return new Command2(nameAndArgs.split(/\s+/)[0] ?? nameAndArgs);
3643
+ };
3644
+
3645
+ // ../common/src/timings.ts
3646
+ var TIMINGS_ENV_VAR = "UIP_TIMINGS";
3647
+ function createStorage2() {
3648
+ const [error, mod] = catchError(() => __require("node:async_hooks"));
3649
+ if (error || typeof mod?.AsyncLocalStorage !== "function") {
3650
+ return {
3651
+ getStore: () => {
3652
+ return;
3653
+ },
3654
+ run: (_store, fn) => fn()
3655
+ };
3656
+ }
3657
+ return new mod.AsyncLocalStorage;
3658
+ }
3659
+ var storageSlot = singleton("TimingStorage");
3660
+ var stateSlot = singleton("Timings");
3661
+ var rootStartedSlot = singleton("TimingsRootStarted");
3662
+ var longLivedHostSlot = singleton("TimingsLongLivedHost");
3663
+ var storage = storageSlot.getOrInit(createStorage2, (value) => ("getStore" in value));
3664
+ function newState(baseline) {
3665
+ return { baseline, httpMs: 0, httpCalls: 0 };
3666
+ }
3667
+ function getState() {
3668
+ const scoped = storage.getStore();
3669
+ if (scoped) {
3670
+ return scoped;
3671
+ }
3672
+ const pinned = livePinnedState();
3673
+ if (pinned !== undefined) {
3674
+ return pinned;
3675
+ }
3676
+ return newState(processStartIsInvocationStart() ? 0 : performance.now());
3677
+ }
3678
+ function livePinnedState() {
3679
+ const pinned = stateSlot.get();
3680
+ return pinned !== undefined && "httpCalls" in pinned && !pinned.finished ? pinned : undefined;
3681
+ }
3682
+ function processStartIsInvocationStart() {
3683
+ return !rootStartedSlot.get(false) && !longLivedHostSlot.get(false);
3684
+ }
3685
+ function timingsEnabled() {
3686
+ if (typeof process === "undefined") {
3687
+ return false;
3688
+ }
3689
+ const value = process.env?.[TIMINGS_ENV_VAR];
3690
+ if (value === undefined) {
3691
+ return false;
3692
+ }
3693
+ const normalized = value.trim().toLowerCase();
3694
+ return normalized === "1" || normalized === "true";
3695
+ }
3696
+ function recordExitCode(exitCode) {
3697
+ if (!timingsEnabled()) {
3698
+ return;
3699
+ }
3700
+ getState().exitCode = exitCode;
3701
+ }
3702
+ function invocationStartedAt() {
3703
+ return new Date(performance.timeOrigin + getState().baseline);
3704
+ }
3705
+ function invocationElapsedMs() {
3706
+ return performance.now() - getState().baseline;
3707
+ }
3708
+ function markCommandStart() {
3709
+ if (!timingsEnabled()) {
3710
+ return;
3711
+ }
3712
+ getState().commandStart = performance.now();
3713
+ }
3714
+ function recordCommandDuration(durationMs) {
3715
+ if (!timingsEnabled()) {
3716
+ return;
3717
+ }
3718
+ getState().commandMs = durationMs;
3719
+ }
3720
+
3261
3721
  // ../common/src/exit-code.ts
3262
3722
  function setExitCode(code) {
3263
3723
  process.exitCode = code;
3724
+ recordExitCode(code);
3264
3725
  }
3265
3726
 
3266
3727
  // ../common/src/output-codecs.ts
@@ -3269,12 +3730,12 @@ var jmespathSlot = singleton("JmespathCodec");
3269
3730
  async function loadOutputCodecsAsync(needed) {
3270
3731
  const loads = [];
3271
3732
  if (needed.yaml && yamlSlot.get() === undefined) {
3272
- loads.push(import("./js-yaml-88tdqrtd.js").then((mod) => {
3733
+ loads.push(import("./js-yaml-a2bk27p6.js").then((mod) => {
3273
3734
  yamlSlot.set(mod);
3274
3735
  }));
3275
3736
  }
3276
3737
  if (needed.filter && jmespathSlot.get() === undefined) {
3277
- loads.push(import("./jmespath-231m3hyn.js").then((m)=>__toESM(m.default,1)).then((mod) => {
3738
+ loads.push(import("./jmespath-x4na7sj8.js").then((m)=>__toESM(m.default,1)).then((mod) => {
3278
3739
  jmespathSlot.set(mod);
3279
3740
  }));
3280
3741
  }
@@ -3299,155 +3760,6 @@ function getOutputFilter() {
3299
3760
  return filterSlot.get();
3300
3761
  }
3301
3762
 
3302
- // ../common/src/telemetry/telemetry-dimensions.ts
3303
- var BaseDimensions = {
3304
- ApplicationName: "ApplicationName",
3305
- ProductVersion: "ProductVersion",
3306
- InstallationId: "InstallationId",
3307
- CloudUserId: "CloudUserId",
3308
- CloudTenantId: "CloudTenantId",
3309
- CloudOrganizationId: "CloudOrganizationId",
3310
- IsInternalUser: "IsInternalUser",
3311
- Environment: "Environment",
3312
- BaseUrl: "BaseUrl",
3313
- Region: "Region",
3314
- Agent: "Agent",
3315
- AgentVersion: "AgentVersion",
3316
- AgentModel: "AgentModel",
3317
- ToolName: "ToolName",
3318
- ToolVersion: "ToolVersion",
3319
- ExecutionContext: "ExecutionContext",
3320
- CiProvider: "CiProvider",
3321
- SessionIdSource: "SessionIdSource",
3322
- SessionId: "SessionId"
3323
- };
3324
- var CommandDimensions = {
3325
- IsCommand: "IsCommand",
3326
- IsReexec: "IsReexec",
3327
- CommandName: "CommandName",
3328
- ExitCode: "ExitCode",
3329
- TerminalOutcome: "TerminalOutcome",
3330
- ErrorClass: "ErrorClass",
3331
- TerminalSignal: "TerminalSignal",
3332
- ErrorMessage: "ErrorMessage",
3333
- SkillName: "SkillName",
3334
- ProductArea: "ProductArea",
3335
- Mode: "Mode"
3336
- };
3337
- var ShipDimensions = {
3338
- ShipKind: "ShipKind",
3339
- Target: "Target",
3340
- ProjectType: "ProjectType",
3341
- ProjectTypes: "ProjectTypes",
3342
- ArtifactCorrelationKey: "ArtifactCorrelationKey",
3343
- PackageName: "PackageName",
3344
- PackageVersion: "PackageVersion",
3345
- PackageVersionKey: "PackageVersionKey",
3346
- DeploymentKey: "DeploymentKey",
3347
- SolutionId: "SolutionId",
3348
- FolderKey: "FolderKey",
3349
- FeedId: "FeedId"
3350
- };
3351
- var ErrorDimensions = {
3352
- Result: "Result",
3353
- ErrorCode: "ErrorCode",
3354
- Retry: "Retry",
3355
- ErrorMessage: "ErrorMessage",
3356
- HttpStatus: "HttpStatus",
3357
- UpstreamErrorCode: "UpstreamErrorCode"
3358
- };
3359
- var AuthDimensions = {
3360
- AuthenticationMethod: "AuthenticationMethod",
3361
- Success: "Success",
3362
- Reason: "Reason"
3363
- };
3364
- var SkillsDimensions = {
3365
- SchemaVersion: "SchemaVersion",
3366
- AgentType: "AgentType",
3367
- SkillsVersion: "SkillsVersion",
3368
- UipSubcommand: "UipSubcommand",
3369
- FileExtension: "FileExtension",
3370
- SubagentModel: "SubagentModel",
3371
- SubagentType: "SubagentType",
3372
- PermissionMode: "PermissionMode",
3373
- EffortLevel: "EffortLevel",
3374
- SessionSource: "SessionSource",
3375
- Outcome: "Outcome",
3376
- DurationMs: "DurationMs",
3377
- Source: "Source"
3378
- };
3379
- var PackagerDimensions = {
3380
- ProjectId: "ProjectId",
3381
- ProjectType: "ProjectType",
3382
- SolutionId: "SolutionId"
3383
- };
3384
- var ScopeDimensions = {
3385
- FolderId: "FolderId"
3386
- };
3387
- var ID_DIMENSIONS = new Set([
3388
- BaseDimensions.CloudUserId,
3389
- BaseDimensions.CloudTenantId,
3390
- BaseDimensions.CloudOrganizationId,
3391
- BaseDimensions.InstallationId,
3392
- ShipDimensions.ArtifactCorrelationKey,
3393
- ShipDimensions.PackageVersionKey,
3394
- ShipDimensions.DeploymentKey,
3395
- ShipDimensions.SolutionId,
3396
- ShipDimensions.FolderKey,
3397
- ShipDimensions.FeedId,
3398
- PackagerDimensions.ProjectId
3399
- ]);
3400
- var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
3401
- var RESERVED_DIMENSION_NAMES = new Set([
3402
- ...Object.values(BaseDimensions),
3403
- ...Object.values(CommandDimensions),
3404
- ...Object.values(ShipDimensions),
3405
- ...Object.values(ErrorDimensions),
3406
- ...Object.values(AuthDimensions),
3407
- ...Object.values(SkillsDimensions),
3408
- ...Object.values(PackagerDimensions),
3409
- ...Object.values(ScopeDimensions)
3410
- ]);
3411
- var CURATED_DIMENSIONS = new Set([
3412
- BaseDimensions.ApplicationName,
3413
- BaseDimensions.ProductVersion,
3414
- BaseDimensions.InstallationId,
3415
- BaseDimensions.CloudUserId,
3416
- BaseDimensions.CloudTenantId,
3417
- BaseDimensions.CloudOrganizationId,
3418
- BaseDimensions.IsInternalUser,
3419
- BaseDimensions.Environment,
3420
- BaseDimensions.BaseUrl,
3421
- BaseDimensions.Region,
3422
- BaseDimensions.Agent,
3423
- BaseDimensions.AgentVersion,
3424
- BaseDimensions.ToolVersion,
3425
- BaseDimensions.ExecutionContext,
3426
- BaseDimensions.CiProvider,
3427
- BaseDimensions.SessionIdSource,
3428
- BaseDimensions.SessionId,
3429
- ...Object.values(CommandDimensions),
3430
- ...Object.values(ShipDimensions)
3431
- ]);
3432
- function lowercaseIdDimensionValues(properties) {
3433
- let changed = false;
3434
- const result = {
3435
- ...properties
3436
- };
3437
- for (const key of Object.keys(result)) {
3438
- const value = result[key];
3439
- if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
3440
- continue;
3441
- }
3442
- const lowered = value.toLowerCase();
3443
- if (lowered !== value) {
3444
- result[key] = lowered;
3445
- changed = true;
3446
- }
3447
- }
3448
- return changed ? result : properties;
3449
- }
3450
-
3451
3763
  // ../common/src/telemetry/command-terminal.ts
3452
3764
  var recordedFailureSlot = singleton("CommandTelemetryFailure");
3453
3765
  var AUTH_ERROR_CODES = new Set([
@@ -3562,21 +3874,12 @@ function terminalSignalFor(input, outcome) {
3562
3874
  }
3563
3875
  const explicit = findStringInCauseChain(input.error, "terminalSignal") ?? findStringInCauseChain(input.error, "signal");
3564
3876
  if (explicit) {
3565
- return explicit;
3566
- }
3567
- return outcome === "cancelled" ? "SIGINT" : undefined;
3568
- }
3569
- function classifyHttpStatus(status) {
3570
- if (status === 401 || status === 403) {
3571
- return "auth";
3572
- }
3573
- if (status === 400 || status === 409 || status === 422) {
3574
- return "validation";
3575
- }
3576
- if (status === 408) {
3577
- return "timeout";
3877
+ return explicit;
3578
3878
  }
3579
- return "network_http";
3879
+ return outcome === "cancelled" ? "SIGINT" : undefined;
3880
+ }
3881
+ function classifyFailingHttpStatus(status) {
3882
+ return classifyFromErrorCode(classifyHttpStatus(status)?.errorCode) ?? "network_http";
3580
3883
  }
3581
3884
  function classifyFromResult(result) {
3582
3885
  switch (result) {
@@ -3656,7 +3959,7 @@ function classifyError2(input) {
3656
3959
  }
3657
3960
  const status = recorded?.context?.httpStatus ?? findHttpStatusInGraph(input.error);
3658
3961
  if (status !== undefined) {
3659
- return classifyHttpStatus(status);
3962
+ return classifyFailingHttpStatus(status);
3660
3963
  }
3661
3964
  return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
3662
3965
  }
@@ -3688,6 +3991,7 @@ function buildCommandTerminalTelemetryProperties(input) {
3688
3991
  var CommonTelemetryEvents = {
3689
3992
  Start: "Application.Start",
3690
3993
  Error: "Application.Error",
3994
+ ProjectActivity: "Cli.ProjectActivity",
3691
3995
  ShipSucceeded: "Cli.ShipSucceeded"
3692
3996
  };
3693
3997
 
@@ -4205,81 +4509,21 @@ class TelemetryService {
4205
4509
  return hex;
4206
4510
  }
4207
4511
  }
4208
- // ../common/src/timings.ts
4209
- var TIMINGS_ENV_VAR = "UIP_TIMINGS";
4210
- function createStorage2() {
4211
- const [error, mod] = catchError(() => __require("node:async_hooks"));
4212
- if (error || typeof mod?.AsyncLocalStorage !== "function") {
4213
- return {
4214
- getStore: () => {
4215
- return;
4216
- },
4217
- run: (_store, fn) => fn()
4218
- };
4219
- }
4220
- return new mod.AsyncLocalStorage;
4221
- }
4222
- var storageSlot = singleton("TimingStorage");
4223
- var stateSlot = singleton("Timings");
4224
- var rootStartedSlot = singleton("TimingsRootStarted");
4225
- var longLivedHostSlot = singleton("TimingsLongLivedHost");
4226
- var storage = storageSlot.getOrInit(createStorage2, (value) => ("getStore" in value));
4227
- function newState(baseline) {
4228
- return { baseline, httpMs: 0, httpCalls: 0 };
4229
- }
4230
- function getState() {
4231
- const scoped = storage.getStore();
4232
- if (scoped) {
4233
- return scoped;
4234
- }
4235
- const pinned = livePinnedState();
4236
- if (pinned !== undefined) {
4237
- return pinned;
4238
- }
4239
- return newState(processStartIsInvocationStart() ? 0 : performance.now());
4240
- }
4241
- function livePinnedState() {
4242
- const pinned = stateSlot.get();
4243
- return pinned !== undefined && "httpCalls" in pinned && !pinned.finished ? pinned : undefined;
4244
- }
4245
- function processStartIsInvocationStart() {
4246
- return !rootStartedSlot.get(false) && !longLivedHostSlot.get(false);
4247
- }
4248
- function timingsEnabled() {
4249
- if (typeof process === "undefined") {
4250
- return false;
4251
- }
4252
- const value = process.env?.[TIMINGS_ENV_VAR];
4253
- if (value === undefined) {
4254
- return false;
4255
- }
4256
- const normalized = value.trim().toLowerCase();
4257
- return normalized === "1" || normalized === "true";
4258
- }
4259
- function invocationStartedAt() {
4260
- return new Date(performance.timeOrigin + getState().baseline);
4261
- }
4262
- function invocationElapsedMs() {
4263
- return performance.now() - getState().baseline;
4264
- }
4265
- function markCommandStart() {
4266
- if (!timingsEnabled()) {
4267
- return;
4268
- }
4269
- getState().commandStart = performance.now();
4270
- }
4271
- function recordCommandDuration(durationMs) {
4272
- if (!timingsEnabled()) {
4273
- return;
4274
- }
4275
- getState().commandMs = durationMs;
4276
- }
4277
4512
  // ../common/src/telemetry/proxy-http-agent.ts
4278
4513
  var slot = singleton("ProxyAuthHttpsAgent");
4279
4514
 
4280
4515
  // ../common/src/telemetry/node-appinsights-telemetry-provider.ts
4281
4516
  var providerSlot = singleton("TelemetryProvider");
4282
4517
 
4518
+ // ../common/src/telemetry/telemetry-config.ts
4519
+ function isTelemetryDisabled() {
4520
+ const value = process.env.UIPATH_TELEMETRY_DISABLED;
4521
+ return value === "1" || value === "true";
4522
+ }
4523
+ function isProjectTelemetryDisabled() {
4524
+ return isTelemetryDisabled() || process.env.UIPATH_PROJECT_TELEMETRY_DISABLED === "1" || process.env.UIPATH_PROJECT_TELEMETRY_DISABLED === "true";
4525
+ }
4526
+
4283
4527
  // ../common/src/telemetry/telemetry-spool.ts
4284
4528
  var sidecarEntrySlot = singleton("TelemetrySidecarEntry");
4285
4529
  var MAX_SPOOL_AGE_MS = 72 * 60 * 60 * 1000;
@@ -4315,7 +4559,6 @@ var telemetry = new Proxy({}, {
4315
4559
  return typeof value === "function" ? value.bind(instance) : value;
4316
4560
  }
4317
4561
  });
4318
-
4319
4562
  // ../common/src/formatter.ts
4320
4563
  var ANSI_STYLES = {
4321
4564
  red: "\x1B[31m",
@@ -4325,46 +4568,6 @@ var ANSI_RESET = "\x1B[0m";
4325
4568
  function styleLine(line, style) {
4326
4569
  return style ? `${ANSI_STYLES[style]}${line}${ANSI_RESET}` : line;
4327
4570
  }
4328
- var CLI_ERROR_CODES = [
4329
- "invalid_argument",
4330
- "authentication_required",
4331
- "permission_denied",
4332
- "local_permission_denied",
4333
- "not_found",
4334
- "rate_limited",
4335
- "network_error",
4336
- "timeout",
4337
- "server_error",
4338
- "method_not_allowed",
4339
- "not_supported",
4340
- "configuration_error",
4341
- "execution_failed",
4342
- "unknown_error"
4343
- ];
4344
- var RETRY_HINTS = [
4345
- "RetryWillNotFix",
4346
- "RetryLater",
4347
- "RetryAfter1Second",
4348
- "RetryAfter10Seconds",
4349
- "RetryAfter30Seconds",
4350
- "RetryAfter60Seconds"
4351
- ];
4352
- var CLI_ERROR_CODE_VALUES = new Set(CLI_ERROR_CODES);
4353
- var RETRY_HINT_VALUES = new Set(RETRY_HINTS);
4354
- function isCliErrorCode(value) {
4355
- return typeof value === "string" && CLI_ERROR_CODE_VALUES.has(value);
4356
- }
4357
- function isRetryHint(value) {
4358
- return typeof value === "string" && RETRY_HINT_VALUES.has(value);
4359
- }
4360
- var RESULTS = {
4361
- Success: "Success",
4362
- Failure: "Failure",
4363
- ConfigError: "ConfigError",
4364
- AuthenticationError: "AuthenticationError",
4365
- ValidationError: "ValidationError",
4366
- TimeoutError: "TimeoutError"
4367
- };
4368
4571
  var EXIT_CODES = {
4369
4572
  Success: 0,
4370
4573
  Failure: 1,
@@ -4373,6 +4576,9 @@ var EXIT_CODES = {
4373
4576
  ValidationError: 3,
4374
4577
  TimeoutError: 4
4375
4578
  };
4579
+ function exitCodeForResult(result) {
4580
+ return EXIT_CODES[result] ?? EXIT_CODES.Failure;
4581
+ }
4376
4582
  function escapeNonAscii(jsonText) {
4377
4583
  return jsonText.replace(/[\u0080-\uffff]/g, (c) => {
4378
4584
  const hex = c.charCodeAt(0).toString(16).padStart(4, "0");
@@ -5048,8 +5254,8 @@ function carriesOnlyNulls(value) {
5048
5254
  }
5049
5255
  return false;
5050
5256
  }
5051
- function nameList(names, cap2 = 12) {
5052
- const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
5257
+ function nameList(names, cap = 12) {
5258
+ const shown = names.slice(0, cap).map((n) => `\`${n}\``);
5053
5259
  const rest = names.length - shown.length;
5054
5260
  return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
5055
5261
  }
@@ -5186,40 +5392,11 @@ function defaultErrorCodeForResult(result) {
5186
5392
  return "unknown_error";
5187
5393
  }
5188
5394
  }
5189
- function parseHttpStatusFromMessage2(message) {
5190
- const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
5191
- if (!match)
5192
- return;
5193
- const status = Number(match[1]);
5194
- return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
5195
- }
5196
- function defaultErrorCodeForHttpStatus(status) {
5197
- if (status === undefined)
5198
- return;
5199
- if (status === 400 || status === 409 || status === 422) {
5200
- return "invalid_argument";
5201
- }
5202
- if (status === 401)
5203
- return "authentication_required";
5204
- if (status === 403)
5205
- return "permission_denied";
5206
- if (status === 404)
5207
- return "not_found";
5208
- if (status === 405)
5209
- return "method_not_allowed";
5210
- if (status === 408)
5211
- return "timeout";
5212
- if (status === 429)
5213
- return "rate_limited";
5214
- if (status >= 500 && status < 600)
5215
- return "server_error";
5216
- return;
5217
- }
5218
5395
  var LOCAL_PERMISSION_TEXT_PATTERN = new RegExp(`(?:\\b|\\()(?:${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})(?::\\s|\\))`);
5219
5396
  function defaultErrorCodeForFailure(data) {
5220
5397
  if (data.Result === RESULTS.Failure) {
5221
- const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage2(data.Message);
5222
- const errorCode = defaultErrorCodeForHttpStatus(status);
5398
+ const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage(data.Message);
5399
+ const errorCode = classifyHttpStatus(status)?.errorCode;
5223
5400
  if (errorCode)
5224
5401
  return errorCode;
5225
5402
  if (status === undefined && (LOCAL_PERMISSION_TEXT_PATTERN.test(data.Message) || LOCAL_PERMISSION_TEXT_PATTERN.test(data.Instructions))) {
@@ -5228,17 +5405,6 @@ function defaultErrorCodeForFailure(data) {
5228
5405
  }
5229
5406
  return defaultErrorCodeForResult(data.Result);
5230
5407
  }
5231
- function defaultRetryForErrorCode(errorCode) {
5232
- switch (errorCode) {
5233
- case "network_error":
5234
- case "rate_limited":
5235
- case "server_error":
5236
- case "timeout":
5237
- return "RetryLater";
5238
- default:
5239
- return "RetryWillNotFix";
5240
- }
5241
- }
5242
5408
  var OutputFormatter;
5243
5409
  ((OutputFormatter) => {
5244
5410
  function success(data, options) {
@@ -5270,7 +5436,7 @@ var OutputFormatter;
5270
5436
  data.Log ??= getLogFilePath() || undefined;
5271
5437
  data.ErrorCode ??= defaultErrorCodeForFailure(data);
5272
5438
  data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
5273
- const exitCode = EXIT_CODES[data.Result] ?? 1;
5439
+ const exitCode = exitCodeForResult(data.Result);
5274
5440
  setExitCode(exitCode);
5275
5441
  recordCommandFailureTelemetry({
5276
5442
  result: data.Result,
@@ -5365,45 +5531,227 @@ var OutputFormatter;
5365
5531
  OutputFormatter.formatToString = formatToString;
5366
5532
  })(OutputFormatter ||= {});
5367
5533
 
5368
- // ../common/src/classified-failure.ts
5369
- var MAX_QUOTED_BODY_CHARS = 200;
5370
- function summarizePlatformBody(body) {
5371
- const trimmed = body.trim().replace(/\s+/g, " ");
5372
- return trimmed.length > MAX_QUOTED_BODY_CHARS ? `${trimmed.slice(0, MAX_QUOTED_BODY_CHARS)}…` : trimmed;
5534
+ // ../common/src/pass-through-tail.ts
5535
+ function maybeOption(arg) {
5536
+ return arg.length > 1 && arg[0] === "-";
5537
+ }
5538
+ function tokenizeTail(cmd, tail) {
5539
+ const find = (flag) => cmd.options.find((option) => option.long === flag || option.short === flag);
5540
+ const digitShort = cmd.options.some((option) => option.short !== undefined && /^-\d$/.test(option.short));
5541
+ const negativeNumber = (arg) => !digitShort && /^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(arg);
5542
+ const tokens = [];
5543
+ let firstUnknown = -1;
5544
+ let sentinel = -1;
5545
+ let variadic;
5546
+ let group;
5547
+ let groupIndex = 0;
5548
+ let i = 0;
5549
+ while (i < tail.length || group !== undefined) {
5550
+ const index = group === undefined ? i : groupIndex;
5551
+ const arg = group ?? tail[i++];
5552
+ group = undefined;
5553
+ if (arg === "--") {
5554
+ sentinel = index;
5555
+ tokens.push({ kind: "sentinel", index });
5556
+ for (let j = i;j < tail.length; j++) {
5557
+ tokens.push({
5558
+ kind: "operand",
5559
+ index: j,
5560
+ text: tail[j],
5561
+ literal: true
5562
+ });
5563
+ }
5564
+ break;
5565
+ }
5566
+ if (variadic && (!maybeOption(arg) || negativeNumber(arg))) {
5567
+ tokens.push({
5568
+ kind: "option",
5569
+ index,
5570
+ text: arg,
5571
+ option: variadic,
5572
+ value: arg
5573
+ });
5574
+ continue;
5575
+ }
5576
+ variadic = undefined;
5577
+ if (maybeOption(arg)) {
5578
+ const option = find(arg);
5579
+ if (option) {
5580
+ let value;
5581
+ if (option.required) {
5582
+ value = tail[i];
5583
+ if (value !== undefined)
5584
+ i++;
5585
+ } else if (option.optional) {
5586
+ const next = tail[i];
5587
+ if (next !== undefined && (!maybeOption(next) || negativeNumber(next))) {
5588
+ value = next;
5589
+ i++;
5590
+ }
5591
+ }
5592
+ tokens.push({
5593
+ kind: "option",
5594
+ index,
5595
+ text: arg,
5596
+ option,
5597
+ ...value === undefined ? {} : { value }
5598
+ });
5599
+ variadic = option.variadic ? option : undefined;
5600
+ continue;
5601
+ }
5602
+ }
5603
+ if (arg.length > 2 && arg[0] === "-" && arg[1] !== "-") {
5604
+ const option = find(`-${arg[1]}`);
5605
+ if (option) {
5606
+ if (option.required || option.optional) {
5607
+ tokens.push({
5608
+ kind: "option",
5609
+ index,
5610
+ text: arg,
5611
+ option,
5612
+ value: arg.slice(2)
5613
+ });
5614
+ } else {
5615
+ tokens.push({ kind: "option", index, text: arg, option });
5616
+ group = `-${arg.slice(2)}`;
5617
+ groupIndex = index;
5618
+ }
5619
+ continue;
5620
+ }
5621
+ }
5622
+ if (/^--[^=]+=/.test(arg)) {
5623
+ const equals = arg.indexOf("=");
5624
+ const option = find(arg.slice(0, equals));
5625
+ if (option && (option.required || option.optional)) {
5626
+ tokens.push({
5627
+ kind: "option",
5628
+ index,
5629
+ text: arg,
5630
+ option,
5631
+ value: arg.slice(equals + 1)
5632
+ });
5633
+ continue;
5634
+ }
5635
+ }
5636
+ if (maybeOption(arg) && !negativeNumber(arg)) {
5637
+ const equals = arg.startsWith("--") ? arg.indexOf("=") : -1;
5638
+ if (firstUnknown === -1)
5639
+ firstUnknown = index;
5640
+ tokens.push({
5641
+ kind: "unknown",
5642
+ index,
5643
+ text: arg,
5644
+ flag: equals > 0 ? arg.slice(0, equals) : arg,
5645
+ ...equals > 0 ? { inlineValue: arg.slice(equals + 1) } : {}
5646
+ });
5647
+ continue;
5648
+ }
5649
+ tokens.push({ kind: "operand", index, text: arg, literal: false });
5650
+ }
5651
+ return { tokens, firstUnknown, sentinel };
5373
5652
  }
5374
- // ../../node_modules/commander/esm.mjs
5375
- var import__ = __toESM(require_commander(), 1);
5376
- var {
5377
- program,
5378
- createCommand,
5379
- createArgument,
5380
- createOption,
5381
- CommanderError,
5382
- InvalidArgumentError,
5383
- InvalidOptionArgumentError,
5384
- Command,
5385
- Argument,
5386
- Option,
5387
- Help
5388
- } = import__.default;
5389
5653
 
5390
- // ../common/src/command-examples.ts
5391
- var examplesByCommand = new WeakMap;
5392
- Command.prototype.examples = function(examples) {
5393
- examplesByCommand.set(this, examples);
5394
- return this;
5395
- };
5396
- // ../common/src/preview.ts
5397
- var previewSlot = singleton("PreviewBuild");
5398
- function isPreviewBuild() {
5399
- return previewSlot.get(false) ?? false;
5654
+ // ../common/src/project-telemetry.ts
5655
+ var RESOLVER = Symbol.for("@uipath/common/projectTelemetryResolver");
5656
+ var CAPTURE = Symbol.for("@uipath/common/projectTelemetryCapture");
5657
+ var CONTEXT_RESOLVER = Symbol.for("@uipath/common/projectContextTelemetryResolver");
5658
+ var RULES = Symbol.for("@uipath/common/projectTargetRules");
5659
+ function logSkipped(what, error) {
5660
+ logger.debug(`[project-telemetry] ${what} skipped: ${error instanceof Error ? error.message : String(error)}`);
5661
+ }
5662
+ function bounded(work, what) {
5663
+ return withinProjectIdentityBudget(work, () => logSkipped(what, `no answer within ${PROJECT_IDENTITY_LOOKUP_BUDGET_MS} ms`));
5664
+ }
5665
+ async function identityWithContext(command, identity) {
5666
+ const props = projectIdentityProperties(identity);
5667
+ if (!identity.projectDirectory || isProjectTelemetryDisabled())
5668
+ return props;
5669
+ for (let node = command;node; node = node.parent ?? undefined) {
5670
+ const resolver = node[CONTEXT_RESOLVER];
5671
+ if (typeof resolver !== "function")
5672
+ continue;
5673
+ try {
5674
+ return {
5675
+ ...await resolver(identity.projectDirectory),
5676
+ ...props
5677
+ };
5678
+ } catch (error) {
5679
+ logSkipped("solution context lookup", error);
5680
+ return props;
5681
+ }
5682
+ }
5683
+ return props;
5400
5684
  }
5401
- Command.prototype.previewCommand = function(nameAndArgs, opts) {
5402
- if (isPreviewBuild()) {
5403
- return this.command(nameAndArgs, opts);
5685
+ function getProjectTelemetryResolver(command) {
5686
+ for (let node = command;node; node = node.parent) {
5687
+ const resolver = node[RESOLVER];
5688
+ if (typeof resolver === "function")
5689
+ return resolver;
5404
5690
  }
5405
- return new Command(nameAndArgs.split(/\s+/)[0] ?? nameAndArgs);
5406
- };
5691
+ return;
5692
+ }
5693
+ function attachProjectTelemetryCapture(command, capture) {
5694
+ command[CAPTURE] = capture;
5695
+ }
5696
+ class ProjectTelemetrySession {
5697
+ resolver;
5698
+ command;
5699
+ target;
5700
+ props = {};
5701
+ explicit = false;
5702
+ input;
5703
+ constructor(resolver, command) {
5704
+ this.resolver = resolver;
5705
+ this.command = command;
5706
+ }
5707
+ async setTarget(path) {
5708
+ this.target = path;
5709
+ if (this.input) {
5710
+ await this.resolve({
5711
+ ...this.input,
5712
+ phase: "after",
5713
+ success: true
5714
+ });
5715
+ this.explicit = true;
5716
+ }
5717
+ }
5718
+ async setIdentity(identity) {
5719
+ try {
5720
+ const props = await bounded(identityWithContext(this.command, identity), "project identity capture");
5721
+ if (props !== undefined)
5722
+ this.setProperties(props);
5723
+ } catch (error) {
5724
+ logSkipped("project identity capture", error);
5725
+ }
5726
+ }
5727
+ setProperties(properties) {
5728
+ try {
5729
+ this.props = { ...properties };
5730
+ this.explicit = true;
5731
+ } catch (error) {
5732
+ logSkipped("project identity properties", error);
5733
+ }
5734
+ }
5735
+ properties() {
5736
+ return { ...this.props };
5737
+ }
5738
+ async resolve(input) {
5739
+ this.input = input;
5740
+ if (this.explicit)
5741
+ return;
5742
+ try {
5743
+ const props = await bounded(this.resolver({
5744
+ ...input,
5745
+ target: this.target
5746
+ }), `project identity (${input.phase})`);
5747
+ if (props !== undefined) {
5748
+ this.props = props;
5749
+ }
5750
+ } catch (error) {
5751
+ logSkipped(`project identity (${input.phase})`, error);
5752
+ }
5753
+ }
5754
+ }
5407
5755
 
5408
5756
  // ../common/src/telemetry/command-attribution.ts
5409
5757
  var LEGACY_SKILL_NAMESPACE = "uipath:";
@@ -5666,6 +6014,8 @@ function recordableArgValue(value, choices) {
5666
6014
  function extractCommandParams(cmd) {
5667
6015
  const params = {};
5668
6016
  forEachSuppliedArgument(cmd, (name, value, choices, defaulted) => {
6017
+ if (name === undefined)
6018
+ return;
5669
6019
  const recordable = recordableArgValue(value, choices);
5670
6020
  params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = recordable === TELEMETRY_ARG_VALUE_WITHHELD && defaulted ? TELEMETRY_ARG_VALUE_DEFAULTED : recordable;
5671
6021
  });
@@ -5681,7 +6031,8 @@ function isDefaultedPositional(cmd, index) {
5681
6031
  function forEachSuppliedArgument(cmd, visit) {
5682
6032
  const registered = cmd.registeredArguments ?? [];
5683
6033
  const processed = cmd.processedArgs ?? [];
5684
- for (let i = 0;i < registered.length; i++) {
6034
+ const bound = boundPositionalCount(cmd);
6035
+ for (let i = 0;i < bound; i++) {
5685
6036
  const name = registered[i].name();
5686
6037
  if (name && processed[i] !== undefined) {
5687
6038
  visit(name, processed[i], registered[i].argChoices, isDefaultedPositional(cmd, i));
@@ -5696,6 +6047,71 @@ function forEachSuppliedArgument(cmd, visit) {
5696
6047
  visit(key, value, choicesByAttribute.get(key), isDefaultedOption(cmd, key));
5697
6048
  }
5698
6049
  }
6050
+ forEachPassThroughToken(cmd, bound, (name, value) => {
6051
+ visit(name, value, name === undefined ? undefined : choicesByAttribute.get(name), false);
6052
+ });
6053
+ }
6054
+ function boundPositionalCount(cmd) {
6055
+ const registered = cmd.registeredArguments ?? [];
6056
+ if (registered.some((argument) => argument.variadic)) {
6057
+ return registered.length;
6058
+ }
6059
+ if ((cmd.args ?? []).length <= registered.length) {
6060
+ return registered.length;
6061
+ }
6062
+ const firstFlag = tokenizeTail(cmd, (cmd.args ?? []).slice(1)).tokens.find((token) => token.kind !== "operand")?.index ?? -1;
6063
+ return firstFlag === -1 ? registered.length : Math.min(registered.length, firstFlag + 1);
6064
+ }
6065
+ function forEachPassThroughToken(cmd, bound, visit) {
6066
+ const registered = cmd.registeredArguments ?? [];
6067
+ const fillsPositionals = !registered.some((argument) => argument.variadic);
6068
+ const { tokens, firstUnknown } = tokenizeTail(cmd, (cmd.args ?? []).slice(bound));
6069
+ const repeated = new Map;
6070
+ let nextPositional = bound;
6071
+ for (const token of tokens) {
6072
+ const pastUnknown = firstUnknown !== -1 && token.index > firstUnknown;
6073
+ if (token.kind === "sentinel")
6074
+ continue;
6075
+ if (token.kind === "operand") {
6076
+ const claimable = !pastUnknown && fillsPositionals && nextPositional < registered.length;
6077
+ const name = claimable ? registered[nextPositional++].name() : undefined;
6078
+ visit(name || undefined, token.text);
6079
+ continue;
6080
+ }
6081
+ if (token.kind === "unknown") {
6082
+ const bare = token.flag.replace(/^-+/, "");
6083
+ const key = bare.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
6084
+ const keyable = token.flag.startsWith("--") || token.flag.length === 2;
6085
+ if (!pastUnknown && keyable && /^[a-z][a-z0-9-]*$/i.test(bare) && key) {
6086
+ visit(key, token.inlineValue ?? true);
6087
+ } else {
6088
+ visit(undefined, token.text);
6089
+ if (token.inlineValue !== undefined) {
6090
+ visit(undefined, token.inlineValue);
6091
+ } else if (!token.flag.startsWith("--") && token.flag.length > 2) {
6092
+ visit(undefined, token.flag.slice(2));
6093
+ }
6094
+ }
6095
+ continue;
6096
+ }
6097
+ if (pastUnknown) {
6098
+ visit(undefined, token.text);
6099
+ if (token.value !== undefined)
6100
+ visit(undefined, token.value);
6101
+ continue;
6102
+ }
6103
+ const option = token.option;
6104
+ const name = option.attributeName();
6105
+ const value = option.negate ? false : option.required || option.optional ? token.value ?? true : true;
6106
+ const previous = repeated.get(name);
6107
+ if (previous) {
6108
+ previous.push(value);
6109
+ visit(name, previous);
6110
+ } else {
6111
+ repeated.set(name, [value]);
6112
+ visit(name, value);
6113
+ }
6114
+ }
5699
6115
  }
5700
6116
  function withheldArgumentValues(cmd) {
5701
6117
  const values = [];
@@ -5746,7 +6162,7 @@ function implicitLimitViolation(cmd) {
5746
6162
  function exitCodeFromProcess(fallback) {
5747
6163
  return typeof process.exitCode === "number" ? process.exitCode : fallback;
5748
6164
  }
5749
- Command.prototype.trackedAction = function(context, fn, properties) {
6165
+ Command2.prototype.trackedAction = function(context, fn, properties) {
5750
6166
  const command = this;
5751
6167
  return this.action(async (...args) => {
5752
6168
  await loadOutputCodecsAsync({
@@ -5757,6 +6173,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5757
6173
  const telemetryName = commandTelemetryName(commandParts);
5758
6174
  const commandPath = commandInvocationPath(commandParts);
5759
6175
  const props = typeof properties === "function" ? properties(...args) : properties;
6176
+ const projectResolver = getProjectTelemetryResolver(command);
6177
+ const projectSession = projectResolver && !isProjectTelemetryDisabled() ? new ProjectTelemetrySession(projectResolver, command) : undefined;
5760
6178
  markCommandStart();
5761
6179
  const supplied = recordSuppliedArgumentValues(withheldArgumentValues(command));
5762
6180
  try {
@@ -5769,6 +6187,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5769
6187
  if (violation) {
5770
6188
  return Promise.reject(violation);
5771
6189
  }
6190
+ if (projectSession) {
6191
+ return projectSession.resolve({ command, args, phase: "before" }).then(() => {
6192
+ attachProjectTelemetryCapture(command, projectSession);
6193
+ return fn(...args);
6194
+ });
6195
+ }
5772
6196
  return fn(...args);
5773
6197
  }));
5774
6198
  if (error) {
@@ -5777,22 +6201,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5777
6201
  const typed = error;
5778
6202
  const customInstructions = typeof typed.instructions === "string" ? typed.instructions : undefined;
5779
6203
  const customResult = typeof typed.result === "string" && typed.result !== RESULTS.Success && Object.values(RESULTS).includes(typed.result) ? typed.result : undefined;
5780
- const finalResult = customResult ?? RESULTS.Failure;
6204
+ const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
6205
+ const classified = cancellationExitCode === undefined ? await extractErrorDetails(error) : undefined;
6206
+ const finalResult = customResult ?? classified?.result ?? RESULTS.Failure;
5781
6207
  const typedErrorCode = typed.errorCode ?? typed.ErrorCode;
5782
6208
  const customErrorCode = isCliErrorCode(typedErrorCode) ? typedErrorCode : undefined;
5783
6209
  const typedRetry = typed.retry ?? typed.Retry;
5784
6210
  const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
5785
6211
  const typedContext = typed.context ?? typed.Context;
5786
6212
  const customContext = isErrorContext(typedContext) ? typedContext : undefined;
5787
- const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
5788
6213
  fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
6214
+ const errorCode = customErrorCode ?? classified?.errorCode;
6215
+ const retry = customRetry ?? classified?.retry;
6216
+ const errorContext = customContext ?? classified?.context;
5789
6217
  OutputFormatter.error({
5790
6218
  Result: finalResult,
5791
- ...customErrorCode ? { ErrorCode: customErrorCode } : {},
6219
+ ...errorCode ? { ErrorCode: errorCode } : {},
5792
6220
  Message: errorMessage,
5793
6221
  Instructions: customInstructions ?? commandHelpHint(commandPath),
5794
- ...customRetry ? { Retry: customRetry } : {},
5795
- ...customContext ? { Context: customContext } : {}
6222
+ ...retry ? { Retry: retry } : {},
6223
+ ...errorContext ? { Context: errorContext } : {}
5796
6224
  });
5797
6225
  context.exit(fallbackExitCode);
5798
6226
  }
@@ -5801,6 +6229,14 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5801
6229
  const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
5802
6230
  const recordedFailure = takeRecordedCommandFailureTelemetry();
5803
6231
  const success = !error && exitCode === 0;
6232
+ if (projectSession) {
6233
+ await projectSession.resolve({
6234
+ command,
6235
+ args,
6236
+ phase: "after",
6237
+ success
6238
+ });
6239
+ }
5804
6240
  const terminalTelemetry = buildCommandTerminalTelemetryProperties({
5805
6241
  error,
5806
6242
  exitCode,
@@ -5818,6 +6254,7 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5818
6254
  }
5819
6255
  const baseProperties = redactProperties({
5820
6256
  ...commandParams,
6257
+ ...projectSession?.properties(),
5821
6258
  ...props,
5822
6259
  ...buildCommandTelemetryAttribution(commandPath, process.env.UIPATH_SKILL),
5823
6260
  ...buildAgentSessionTelemetry(process.env),
@@ -5828,6 +6265,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5828
6265
  });
5829
6266
  emitInvocationRequest(telemetryName, success, baseProperties);
5830
6267
  } finally {
6268
+ if (projectSession)
6269
+ attachProjectTelemetryCapture(command, undefined);
5831
6270
  releaseSuppliedArgumentValues(supplied);
5832
6271
  }
5833
6272
  });
@@ -6057,16 +6496,6 @@ var HOST_GLOBAL_FLAGS = [
6057
6496
  ];
6058
6497
  var VALUE_OPTIONS = new Set(HOST_GLOBAL_OPTIONS_WITH_VALUE);
6059
6498
  var BOOLEAN_FLAGS = new Set(HOST_GLOBAL_FLAGS);
6060
- // ../common/src/http-status.ts
6061
- function httpStatusOf(error) {
6062
- if (!error || typeof error !== "object") {
6063
- return;
6064
- }
6065
- if ("response" in error && error.response && typeof error.response === "object" && "status" in error.response && typeof error.response.status === "number") {
6066
- return error.response.status;
6067
- }
6068
- return "status" in error && typeof error.status === "number" ? error.status : undefined;
6069
- }
6070
6499
  // ../common/src/interactivity-context.ts
6071
6500
  var modeSlot = singleton("InteractivityMode");
6072
6501
  var interactiveFlagSlot = singleton("InteractiveFlag");
@@ -6238,6 +6667,6 @@ function unsupportedSolutionProjectType(projectType) {
6238
6667
  var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
6239
6668
  // ../common/src/tool-provider.ts
6240
6669
  var factorySlot = singleton("PackagerFactoryProvider");
6241
- export { getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, catchError, extractErrorMessage, logger, RESULTS, summarizePlatformBody, isGuid, httpStatusOf, quoteForShell, unsupportedSolutionProjectType };
6670
+ export { ProjectDimensions, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, solutionIdentityProperties, projectKey, catchError, httpStatusOf, extractErrorMessage, RESULTS, summarizePlatformBody, logger, isGuid, quoteForShell, unsupportedSolutionProjectType };
6242
6671
 
6243
- //# debugId=AFBD7517FAF4685764756E2164756E21
6672
+ //# debugId=575695BD3C43FD9164756E2164756E21