@uipath/integrationservice-tool 1.205.0-preview.284 → 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.
@@ -1,11 +1,12 @@
1
1
  import {
2
2
  getFileSystem
3
- } from "./tool-fj5zzmeh.js";
3
+ } from "./tool-hdzdh357.js";
4
4
  import {
5
+ __toESM,
5
6
  __commonJS,
6
- __require,
7
- __toESM
8
- } from "./tool-1yh8g550.js";
7
+ __exportCjs,
8
+ __require
9
+ } from "./tool-6an893wm.js";
9
10
 
10
11
  // ../../node_modules/commander/lib/error.js
11
12
  var require_error = __commonJS(function(exports) {
@@ -127,7 +128,7 @@ var require_help = __commonJS(function(exports) {
127
128
  this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;
128
129
  }
129
130
  visibleCommands(cmd) {
130
- const visibleCommands = cmd.commands.filter((cmd2) => !cmd2._hidden);
131
+ const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);
131
132
  const helpCommand = cmd._getHelpCommand();
132
133
  if (helpCommand && !helpCommand._hidden) {
133
134
  visibleCommands.push(helpCommand);
@@ -607,8 +608,8 @@ var require_option = __commonJS(function(exports) {
607
608
  }
608
609
  }
609
610
  function camelcase(str) {
610
- return str.split("-").reduce((str2, word) => {
611
- return str2 + word[0].toUpperCase() + word.slice(1);
611
+ return str.split("-").reduce((str, word) => {
612
+ return str + word[0].toUpperCase() + word.slice(1);
612
613
  });
613
614
  }
614
615
  function splitOptionFlags(flags) {
@@ -1179,44 +1180,44 @@ Expecting one of '${allowedValues.join("', '")}'`);
1179
1180
  });
1180
1181
  return source;
1181
1182
  }
1182
- _prepareUserArgs(argv, parseOptions) {
1183
- if (argv !== undefined && !Array.isArray(argv)) {
1183
+ _prepareUserArgs(argv2, parseOptions) {
1184
+ if (argv2 !== undefined && !Array.isArray(argv2)) {
1184
1185
  throw new Error("first parameter to parse must be array or undefined");
1185
1186
  }
1186
1187
  parseOptions = parseOptions || {};
1187
- if (argv === undefined && parseOptions.from === undefined) {
1188
+ if (argv2 === undefined && parseOptions.from === undefined) {
1188
1189
  if (process2.versions?.electron) {
1189
1190
  parseOptions.from = "electron";
1190
1191
  }
1191
- const execArgv = process2.execArgv ?? [];
1192
- if (execArgv.includes("-e") || execArgv.includes("--eval") || execArgv.includes("-p") || execArgv.includes("--print")) {
1192
+ const execArgv2 = process2.execArgv ?? [];
1193
+ if (execArgv2.includes("-e") || execArgv2.includes("--eval") || execArgv2.includes("-p") || execArgv2.includes("--print")) {
1193
1194
  parseOptions.from = "eval";
1194
1195
  }
1195
1196
  }
1196
- if (argv === undefined) {
1197
- argv = process2.argv;
1197
+ if (argv2 === undefined) {
1198
+ argv2 = process2.argv;
1198
1199
  }
1199
- this.rawArgs = argv.slice();
1200
+ this.rawArgs = argv2.slice();
1200
1201
  let userArgs;
1201
1202
  switch (parseOptions.from) {
1202
1203
  case undefined:
1203
1204
  case "node":
1204
- this._scriptPath = argv[1];
1205
- userArgs = argv.slice(2);
1205
+ this._scriptPath = argv2[1];
1206
+ userArgs = argv2.slice(2);
1206
1207
  break;
1207
1208
  case "electron":
1208
1209
  if (process2.defaultApp) {
1209
- this._scriptPath = argv[1];
1210
- userArgs = argv.slice(2);
1210
+ this._scriptPath = argv2[1];
1211
+ userArgs = argv2.slice(2);
1211
1212
  } else {
1212
- userArgs = argv.slice(1);
1213
+ userArgs = argv2.slice(1);
1213
1214
  }
1214
1215
  break;
1215
1216
  case "user":
1216
- userArgs = argv.slice(0);
1217
+ userArgs = argv2.slice(0);
1217
1218
  break;
1218
1219
  case "eval":
1219
- userArgs = argv.slice(1);
1220
+ userArgs = argv2.slice(1);
1220
1221
  break;
1221
1222
  default:
1222
1223
  throw new Error(`unexpected parse option { from: '${parseOptions.from}' }`);
@@ -1739,18 +1740,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
1739
1740
  this.error(message, { code: "commander.missingMandatoryOptionValue" });
1740
1741
  }
1741
1742
  _conflictingOption(option, conflictingOption) {
1742
- const findBestOptionFromValue = (option2) => {
1743
- const optionKey = option2.attributeName();
1743
+ const findBestOptionFromValue = (option) => {
1744
+ const optionKey = option.attributeName();
1744
1745
  const optionValue = this.getOptionValue(optionKey);
1745
1746
  const negativeOption = this.options.find((target) => target.negate && optionKey === target.attributeName());
1746
1747
  const positiveOption = this.options.find((target) => !target.negate && optionKey === target.attributeName());
1747
1748
  if (negativeOption && (negativeOption.presetArg === undefined && optionValue === false || negativeOption.presetArg !== undefined && optionValue === negativeOption.presetArg)) {
1748
1749
  return negativeOption;
1749
1750
  }
1750
- return positiveOption || option2;
1751
+ return positiveOption || option;
1751
1752
  };
1752
- const getErrorMessage = (option2) => {
1753
- const bestOption = findBestOptionFromValue(option2);
1753
+ const getErrorMessage = (option) => {
1754
+ const bestOption = findBestOptionFromValue(option);
1754
1755
  const optionKey = bestOption.attributeName();
1755
1756
  const source = this.getOptionValueSource(optionKey);
1756
1757
  if (source === "env") {
@@ -1904,10 +1905,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
1904
1905
  this._name = path.basename(filename, path.extname(filename));
1905
1906
  return this;
1906
1907
  }
1907
- executableDir(path2) {
1908
- if (path2 === undefined)
1908
+ executableDir(path) {
1909
+ if (path === undefined)
1909
1910
  return this._executableDir;
1910
- this._executableDir = path2;
1911
+ this._executableDir = path;
1911
1912
  return this;
1912
1913
  }
1913
1914
  helpInformation(contextOptions) {
@@ -2004,11 +2005,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
2004
2005
  }
2005
2006
  help(contextOptions) {
2006
2007
  this.outputHelp(contextOptions);
2007
- let exitCode = Number(process2.exitCode ?? 0);
2008
- if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) {
2009
- exitCode = 1;
2008
+ let exitCode2 = Number(process2.exitCode ?? 0);
2009
+ if (exitCode2 === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) {
2010
+ exitCode2 = 1;
2010
2011
  }
2011
- this._exit(exitCode, "commander.help", "(outputHelp)");
2012
+ this._exit(exitCode2, "commander.help", "(outputHelp)");
2012
2013
  }
2013
2014
  addHelpText(position, text) {
2014
2015
  const allowedValues = ["beforeAll", "before", "after", "afterAll"];
@@ -2081,40 +2082,265 @@ Expecting one of '${allowedValues.join("', '")}'`);
2081
2082
  });
2082
2083
 
2083
2084
  // ../../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;
2085
+ var exports_commander = {};
2086
+ __exportCjs(exports_commander, {
2087
+ program: () => $program,
2088
+ createCommand: () => $createCommand,
2089
+ createOption: () => $createOption,
2090
+ createArgument: () => $createArgument,
2091
+ Command: () => $Command,
2092
+ Option: () => $Option,
2093
+ Argument: () => $Argument,
2094
+ Help: () => $Help,
2095
+ CommanderError: () => $CommanderError,
2096
+ InvalidArgumentError: () => $InvalidArgumentError,
2097
+ InvalidOptionArgumentError: () => $InvalidOptionArgumentError
2098
+ }, {
2099
+ program: (value) => $program = value,
2100
+ createCommand: (value) => $createCommand = value,
2101
+ createOption: (value) => $createOption = value,
2102
+ createArgument: (value) => $createArgument = value,
2103
+ Command: (value) => $Command = value,
2104
+ Option: (value) => $Option = value,
2105
+ Argument: (value) => $Argument = value,
2106
+ Help: (value) => $Help = value,
2107
+ CommanderError: (value) => $CommanderError = value,
2108
+ InvalidArgumentError: (value) => $InvalidArgumentError = value,
2109
+ InvalidOptionArgumentError: (value) => $InvalidOptionArgumentError = value
2101
2110
  });
2111
+ var { Argument } = require_argument();
2112
+ var { Command: Command2 } = require_command();
2113
+ var { CommanderError, InvalidArgumentError } = require_error();
2114
+ var { Help } = require_help();
2115
+ var { Option: Option2 } = require_option();
2116
+ var $program = new Command2;
2117
+ var $createCommand = (name) => new Command2(name);
2118
+ var $createOption = (flags, description) => new Option2(flags, description);
2119
+ var $createArgument = (name, description) => new Argument(name, description);
2120
+ var $Command = Command2;
2121
+ var $Option = Option2;
2122
+ var $Argument = Argument;
2123
+ var $Help = Help;
2124
+ var $CommanderError = CommanderError;
2125
+ var $InvalidArgumentError = InvalidArgumentError;
2126
+ var $InvalidOptionArgumentError = InvalidArgumentError;
2102
2127
 
2103
2128
  // ../../node_modules/commander/esm.mjs
2104
- var import__ = __toESM(require_commander(), 1);
2105
2129
  var {
2106
2130
  program,
2107
2131
  createCommand,
2108
2132
  createArgument,
2109
2133
  createOption,
2110
- CommanderError,
2111
- InvalidArgumentError,
2134
+ CommanderError: CommanderError2,
2135
+ InvalidArgumentError: InvalidArgumentError2,
2112
2136
  InvalidOptionArgumentError,
2113
2137
  Command,
2114
- Argument,
2138
+ Argument: Argument2,
2115
2139
  Option,
2116
- Help
2117
- } = import__.default;
2140
+ Help: Help2
2141
+ } = exports_commander;
2142
+
2143
+ // ../common/src/telemetry/telemetry-dimensions.ts
2144
+ var BaseDimensions = {
2145
+ ApplicationName: "ApplicationName",
2146
+ ProductVersion: "ProductVersion",
2147
+ InstallationId: "InstallationId",
2148
+ CloudUserId: "CloudUserId",
2149
+ CloudTenantId: "CloudTenantId",
2150
+ CloudOrganizationId: "CloudOrganizationId",
2151
+ IsInternalUser: "IsInternalUser",
2152
+ Environment: "Environment",
2153
+ BaseUrl: "BaseUrl",
2154
+ Region: "Region",
2155
+ Agent: "Agent",
2156
+ AgentVersion: "AgentVersion",
2157
+ AgentModel: "AgentModel",
2158
+ ToolName: "ToolName",
2159
+ ToolVersion: "ToolVersion",
2160
+ ExecutionContext: "ExecutionContext",
2161
+ CiProvider: "CiProvider",
2162
+ SessionIdSource: "SessionIdSource",
2163
+ SessionId: "SessionId"
2164
+ };
2165
+ var CommandDimensions = {
2166
+ IsCommand: "IsCommand",
2167
+ IsReexec: "IsReexec",
2168
+ CommandName: "CommandName",
2169
+ ExitCode: "ExitCode",
2170
+ TerminalOutcome: "TerminalOutcome",
2171
+ ErrorClass: "ErrorClass",
2172
+ TerminalSignal: "TerminalSignal",
2173
+ ErrorMessage: "ErrorMessage",
2174
+ SkillName: "SkillName",
2175
+ ProductArea: "ProductArea",
2176
+ Mode: "Mode"
2177
+ };
2178
+ var ProjectDimensions = {
2179
+ ProjectKey: "ProjectKey",
2180
+ ProjectType: "ProjectType",
2181
+ ProjectIdentityStatus: "ProjectIdentityStatus",
2182
+ SolutionKey: "SolutionKey",
2183
+ SolutionProjectKey: "SolutionProjectKey",
2184
+ SolutionIdentityStatus: "SolutionIdentityStatus",
2185
+ PreviousSolutionKey: "PreviousSolutionKey"
2186
+ };
2187
+ var GUID_KEY_DIMENSIONS = new Set([
2188
+ ProjectDimensions.ProjectKey,
2189
+ ProjectDimensions.SolutionKey,
2190
+ ProjectDimensions.SolutionProjectKey,
2191
+ ProjectDimensions.PreviousSolutionKey
2192
+ ]);
2193
+ var ShipDimensions = {
2194
+ ShipKind: "ShipKind",
2195
+ Target: "Target",
2196
+ ProjectType: "ProjectType",
2197
+ ProjectTypes: "ProjectTypes",
2198
+ ArtifactCorrelationKey: "ArtifactCorrelationKey",
2199
+ PackageName: "PackageName",
2200
+ PackageVersion: "PackageVersion",
2201
+ PackageVersionKey: "PackageVersionKey",
2202
+ DeploymentKey: "DeploymentKey",
2203
+ SolutionId: "SolutionId",
2204
+ FolderKey: "FolderKey",
2205
+ FeedId: "FeedId"
2206
+ };
2207
+ var ErrorDimensions = {
2208
+ Result: "Result",
2209
+ ErrorCode: "ErrorCode",
2210
+ Retry: "Retry",
2211
+ ErrorMessage: "ErrorMessage",
2212
+ HttpStatus: "HttpStatus",
2213
+ UpstreamErrorCode: "UpstreamErrorCode"
2214
+ };
2215
+ var AuthDimensions = {
2216
+ AuthenticationMethod: "AuthenticationMethod",
2217
+ Success: "Success",
2218
+ Reason: "Reason"
2219
+ };
2220
+ var SkillsDimensions = {
2221
+ SchemaVersion: "SchemaVersion",
2222
+ AgentType: "AgentType",
2223
+ SkillsVersion: "SkillsVersion",
2224
+ UipSubcommand: "UipSubcommand",
2225
+ FileExtension: "FileExtension",
2226
+ SubagentModel: "SubagentModel",
2227
+ SubagentType: "SubagentType",
2228
+ PermissionMode: "PermissionMode",
2229
+ EffortLevel: "EffortLevel",
2230
+ SessionSource: "SessionSource",
2231
+ Outcome: "Outcome",
2232
+ DurationMs: "DurationMs",
2233
+ Source: "Source"
2234
+ };
2235
+ var PackagerDimensions = {
2236
+ ProjectId: "ProjectId",
2237
+ ProjectType: "ProjectType",
2238
+ SolutionId: "SolutionId"
2239
+ };
2240
+ var ScopeDimensions = {
2241
+ FolderId: "FolderId"
2242
+ };
2243
+ var ID_DIMENSIONS = new Set([
2244
+ BaseDimensions.CloudUserId,
2245
+ BaseDimensions.CloudTenantId,
2246
+ BaseDimensions.CloudOrganizationId,
2247
+ BaseDimensions.InstallationId,
2248
+ ShipDimensions.ArtifactCorrelationKey,
2249
+ ShipDimensions.PackageVersionKey,
2250
+ ShipDimensions.DeploymentKey,
2251
+ ShipDimensions.SolutionId,
2252
+ ShipDimensions.FolderKey,
2253
+ ShipDimensions.FeedId,
2254
+ PackagerDimensions.ProjectId
2255
+ ]);
2256
+ var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
2257
+ var RESERVED_DIMENSION_NAMES = new Set([
2258
+ ...Object.values(BaseDimensions),
2259
+ ...Object.values(CommandDimensions),
2260
+ ...Object.values(ShipDimensions),
2261
+ ...Object.values(ProjectDimensions),
2262
+ ...Object.values(ErrorDimensions),
2263
+ ...Object.values(AuthDimensions),
2264
+ ...Object.values(SkillsDimensions),
2265
+ ...Object.values(PackagerDimensions),
2266
+ ...Object.values(ScopeDimensions)
2267
+ ]);
2268
+ var CURATED_DIMENSIONS = new Set([
2269
+ BaseDimensions.ApplicationName,
2270
+ BaseDimensions.ProductVersion,
2271
+ BaseDimensions.InstallationId,
2272
+ BaseDimensions.CloudUserId,
2273
+ BaseDimensions.CloudTenantId,
2274
+ BaseDimensions.CloudOrganizationId,
2275
+ BaseDimensions.IsInternalUser,
2276
+ BaseDimensions.Environment,
2277
+ BaseDimensions.BaseUrl,
2278
+ BaseDimensions.Region,
2279
+ BaseDimensions.Agent,
2280
+ BaseDimensions.AgentVersion,
2281
+ BaseDimensions.ToolVersion,
2282
+ BaseDimensions.ExecutionContext,
2283
+ BaseDimensions.CiProvider,
2284
+ BaseDimensions.SessionIdSource,
2285
+ BaseDimensions.SessionId,
2286
+ ...Object.values(CommandDimensions),
2287
+ ...Object.values(ShipDimensions),
2288
+ ...Object.values(ProjectDimensions)
2289
+ ]);
2290
+ function lowercaseIdDimensionValues(properties) {
2291
+ let changed = false;
2292
+ const result = {
2293
+ ...properties
2294
+ };
2295
+ for (const key of Object.keys(result)) {
2296
+ const value = result[key];
2297
+ if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
2298
+ continue;
2299
+ }
2300
+ const lowered = value.toLowerCase();
2301
+ if (lowered !== value) {
2302
+ result[key] = lowered;
2303
+ changed = true;
2304
+ }
2305
+ }
2306
+ return changed ? result : properties;
2307
+ }
2308
+
2309
+ // ../common/src/telemetry/project-identity.ts
2310
+ function projectKey(id) {
2311
+ if (typeof id !== "string")
2312
+ return;
2313
+ const key = id.trim().toLowerCase().replaceAll("-", "");
2314
+ return /^[0-9a-f]{32}$/.test(key) ? key : undefined;
2315
+ }
2316
+ function projectIdentityProperties(identity) {
2317
+ const key = identity.id ? projectKey(identity.id) : undefined;
2318
+ return {
2319
+ [ProjectDimensions.ProjectIdentityStatus]: identity.status === "resolved" && !key ? "invalid" : identity.status,
2320
+ [ProjectDimensions.ProjectType]: identity.projectType,
2321
+ ...identity.status === "resolved" && key ? {
2322
+ [ProjectDimensions.ProjectKey]: key
2323
+ } : {}
2324
+ };
2325
+ }
2326
+ var PROJECT_IDENTITY_LOOKUP_BUDGET_MS = 1000;
2327
+ async function withinProjectIdentityBudget(work, onTimeout) {
2328
+ work.catch(() => {
2329
+ return;
2330
+ });
2331
+ let timer;
2332
+ const expired = new Promise((resolve) => {
2333
+ timer = setTimeout(() => {
2334
+ onTimeout?.();
2335
+ resolve(undefined);
2336
+ }, PROJECT_IDENTITY_LOOKUP_BUDGET_MS);
2337
+ });
2338
+ try {
2339
+ return await Promise.race([work, expired]);
2340
+ } finally {
2341
+ clearTimeout(timer);
2342
+ }
2343
+ }
2118
2344
 
2119
2345
  // ../common/src/telemetry/pseudonymize.ts
2120
2346
  var PSEUDONYM_DOMAIN = "uipath-cli/telemetry/pseudonym/v1:";
@@ -2579,6 +2805,8 @@ function redactProperty(name, value) {
2579
2805
  if (isSensitiveName(name)) {
2580
2806
  return REDACTED;
2581
2807
  }
2808
+ if (GUID_KEY_DIMENSIONS.has(name))
2809
+ return projectKey(value);
2582
2810
  if (typeof value === "boolean" || typeof value === "number") {
2583
2811
  return value;
2584
2812
  }
@@ -2653,63 +2881,165 @@ function settlePromiseLike(thenable) {
2653
2881
  return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [toError(error), undefined]);
2654
2882
  }
2655
2883
 
2656
- // ../common/src/error-graph.ts
2657
- function* walkErrorGraph(error) {
2658
- const queue = [error];
2659
- const seen = new Set;
2660
- for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
2661
- const current = queue.shift();
2662
- if (current === null || typeof current !== "object")
2663
- continue;
2664
- if (seen.has(current))
2665
- continue;
2666
- seen.add(current);
2667
- const cur = current;
2668
- yield cur;
2669
- if (cur.cause !== undefined)
2670
- queue.push(cur.cause);
2671
- if (Array.isArray(cur.errors))
2672
- queue.push(...cur.errors);
2884
+ // ../common/src/http-status.ts
2885
+ function httpStatusOf(error) {
2886
+ if (!error || typeof error !== "object") {
2887
+ return;
2673
2888
  }
2674
- return;
2889
+ if ("response" in error && error.response && typeof error.response === "object" && "status" in error.response && typeof error.response.status === "number") {
2890
+ return error.response.status;
2891
+ }
2892
+ return "status" in error && typeof error.status === "number" ? error.status : undefined;
2675
2893
  }
2676
- function parseHttpStatusFromMessage(message) {
2677
- const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
2678
- if (!match)
2894
+ function classifyHttpStatus(status) {
2895
+ if (status === undefined)
2679
2896
  return;
2680
- const status = Number(match[1]);
2681
- return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
2682
- }
2683
- function findHttpStatusInGraph(error) {
2684
- for (const node of walkErrorGraph(error)) {
2685
- const response = node.response;
2686
- const explicit = typeof node.status === "number" ? node.status : response?.status;
2687
- if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
2688
- return explicit;
2689
- }
2690
- if (typeof node.message === "string") {
2691
- const parsed = parseHttpStatusFromMessage(node.message);
2692
- if (parsed !== undefined && parsed >= 400) {
2693
- return parsed;
2694
- }
2695
- }
2897
+ if (status === 400 || status === 409 || status === 413 || status === 422) {
2898
+ return { errorCode: "invalid_argument", retry: "RetryWillNotFix" };
2899
+ }
2900
+ if (status === 401) {
2901
+ return {
2902
+ errorCode: "authentication_required",
2903
+ retry: "RetryWillNotFix"
2904
+ };
2905
+ }
2906
+ if (status === 403) {
2907
+ return { errorCode: "permission_denied", retry: "RetryWillNotFix" };
2908
+ }
2909
+ if (status === 404) {
2910
+ return { errorCode: "not_found", retry: "RetryWillNotFix" };
2911
+ }
2912
+ if (status === 405) {
2913
+ return { errorCode: "method_not_allowed", retry: "RetryWillNotFix" };
2914
+ }
2915
+ if (status === 408) {
2916
+ return { errorCode: "timeout", retry: "RetryLater" };
2917
+ }
2918
+ if (status === 429) {
2919
+ return { errorCode: "rate_limited", retry: "RetryLater" };
2920
+ }
2921
+ if (status >= 500 && status < 600) {
2922
+ return { errorCode: "server_error", retry: "RetryLater" };
2696
2923
  }
2697
2924
  return;
2698
2925
  }
2699
2926
 
2700
- // ../common/src/local-permission-codes.ts
2701
- var LOCAL_PERMISSION_ERROR_CODES = new Set([
2702
- "EACCES",
2703
- "EPERM",
2704
- "EROFS"
2705
- ]);
2706
-
2707
- // ../common/src/error-handler.ts
2708
- 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.";
2709
- 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.";
2710
- var DEFAULT_405 = "Method Not Allowed (405). The endpoint may not exist or the base URL may be incorrect.";
2711
- 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.";
2712
- var HTML_RESPONSE_MESSAGE = "Received HTML instead of the expected JSON response.";
2927
+ // ../common/src/error-codes.ts
2928
+ var CLI_ERROR_CODES = [
2929
+ "invalid_argument",
2930
+ "authentication_required",
2931
+ "permission_denied",
2932
+ "local_permission_denied",
2933
+ "not_found",
2934
+ "rate_limited",
2935
+ "network_error",
2936
+ "timeout",
2937
+ "server_error",
2938
+ "method_not_allowed",
2939
+ "not_supported",
2940
+ "configuration_error",
2941
+ "execution_failed",
2942
+ "unknown_error"
2943
+ ];
2944
+ var RETRY_HINTS = [
2945
+ "RetryWillNotFix",
2946
+ "RetryLater",
2947
+ "RetryAfter1Second",
2948
+ "RetryAfter10Seconds",
2949
+ "RetryAfter30Seconds",
2950
+ "RetryAfter60Seconds"
2951
+ ];
2952
+ var CLI_ERROR_CODE_VALUES = new Set(CLI_ERROR_CODES);
2953
+ var RETRY_HINT_VALUES = new Set(RETRY_HINTS);
2954
+ function isCliErrorCode(value) {
2955
+ return typeof value === "string" && CLI_ERROR_CODE_VALUES.has(value);
2956
+ }
2957
+ function isRetryHint(value) {
2958
+ return typeof value === "string" && RETRY_HINT_VALUES.has(value);
2959
+ }
2960
+ function carriedErrorCode(error) {
2961
+ if (!error || typeof error !== "object")
2962
+ return;
2963
+ const code = error.errorCode;
2964
+ return isCliErrorCode(code) ? code : undefined;
2965
+ }
2966
+ function carriedRetry(error) {
2967
+ if (!error || typeof error !== "object")
2968
+ return;
2969
+ const retry = error.retry;
2970
+ return isRetryHint(retry) ? retry : undefined;
2971
+ }
2972
+ function defaultRetryForErrorCode(errorCode) {
2973
+ switch (errorCode) {
2974
+ case "network_error":
2975
+ case "rate_limited":
2976
+ case "server_error":
2977
+ case "timeout":
2978
+ return "RetryLater";
2979
+ default:
2980
+ return "RetryWillNotFix";
2981
+ }
2982
+ }
2983
+
2984
+ // ../common/src/error-graph.ts
2985
+ function* walkErrorGraph(error) {
2986
+ const queue = [error];
2987
+ const seen = new Set;
2988
+ for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
2989
+ const current = queue.shift();
2990
+ if (current === null || typeof current !== "object")
2991
+ continue;
2992
+ if (seen.has(current))
2993
+ continue;
2994
+ seen.add(current);
2995
+ const cur = current;
2996
+ yield cur;
2997
+ if (cur.cause !== undefined)
2998
+ queue.push(cur.cause);
2999
+ if (Array.isArray(cur.errors))
3000
+ queue.push(...cur.errors);
3001
+ }
3002
+ return;
3003
+ }
3004
+ function parseHttpStatusFromMessage(message) {
3005
+ const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
3006
+ if (!match)
3007
+ return;
3008
+ const status = Number(match[1]);
3009
+ return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
3010
+ }
3011
+ function findHttpStatusInGraph(error) {
3012
+ for (const node of walkErrorGraph(error)) {
3013
+ const response = node.response;
3014
+ const explicit = typeof node.status === "number" ? node.status : response?.status;
3015
+ if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
3016
+ return explicit;
3017
+ }
3018
+ if (typeof node.message === "string") {
3019
+ const parsed = parseHttpStatusFromMessage(node.message);
3020
+ if (parsed !== undefined && parsed >= 400) {
3021
+ return parsed;
3022
+ }
3023
+ }
3024
+ }
3025
+ return;
3026
+ }
3027
+
3028
+ // ../common/src/local-permission-codes.ts
3029
+ var LOCAL_PERMISSION_ERROR_CODES = new Set([
3030
+ "EACCES",
3031
+ "EPERM",
3032
+ "EROFS"
3033
+ ]);
3034
+
3035
+ // ../common/src/error-handler.ts
3036
+ 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.";
3037
+ 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.";
3038
+ var DEFAULT_405 = "Method Not Allowed (405). The endpoint may not exist or the base URL may be incorrect.";
3039
+ 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.";
3040
+ 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.";
3041
+ 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.";
3042
+ var HTML_RESPONSE_MESSAGE = "Received HTML instead of the expected JSON response.";
2713
3043
  var NETWORK_ERROR_CODES = new Set([
2714
3044
  "ECONNREFUSED",
2715
3045
  "ECONNRESET",
@@ -2794,6 +3124,20 @@ function localPermissionPath(path, message) {
2794
3124
  return path;
2795
3125
  return message ? /'([^']+)'/.exec(message)?.[1] : undefined;
2796
3126
  }
3127
+ function readHeader(response, name) {
3128
+ const headers = response?.headers;
3129
+ if (!headers || typeof headers !== "object")
3130
+ return;
3131
+ if (typeof headers.get === "function") {
3132
+ const value = headers.get(name);
3133
+ if (value)
3134
+ return value;
3135
+ }
3136
+ const plain = headers;
3137
+ const key = Object.keys(plain).find((k) => k.toLowerCase() === name.toLowerCase());
3138
+ const value = key === undefined ? undefined : plain[key];
3139
+ return typeof value === "string" && value !== "" ? value : undefined;
3140
+ }
2797
3141
  function isHtmlDocument(body) {
2798
3142
  return /^\s*(<!doctype html|<html\b)/i.test(body);
2799
3143
  }
@@ -2810,36 +3154,9 @@ function retryHintForRetryAfter(seconds) {
2810
3154
  return "RetryAfter60Seconds";
2811
3155
  }
2812
3156
  function classifyError(status, error) {
2813
- if (status === 400 || status === 409 || status === 422) {
2814
- return { errorCode: "invalid_argument", retry: "RetryWillNotFix" };
2815
- }
2816
- if (status === 401) {
2817
- return {
2818
- errorCode: "authentication_required",
2819
- retry: "RetryWillNotFix"
2820
- };
2821
- }
2822
- if (status === 403) {
2823
- return { errorCode: "permission_denied", retry: "RetryWillNotFix" };
2824
- }
2825
- if (status === 404) {
2826
- return { errorCode: "not_found", retry: "RetryWillNotFix" };
2827
- }
2828
- if (status === 405) {
2829
- return { errorCode: "method_not_allowed", retry: "RetryWillNotFix" };
2830
- }
2831
- if (status === 413) {
2832
- return { errorCode: "invalid_argument", retry: "RetryWillNotFix" };
2833
- }
2834
- if (status === 408) {
2835
- return { errorCode: "timeout", retry: "RetryLater" };
2836
- }
2837
- if (status === 429) {
2838
- return { errorCode: "rate_limited", retry: "RetryLater" };
2839
- }
2840
- if (status !== undefined && status >= 500 && status < 600) {
2841
- return { errorCode: "server_error", retry: "RetryLater" };
2842
- }
3157
+ const byStatus = classifyHttpStatus(status);
3158
+ if (byStatus)
3159
+ return byStatus;
2843
3160
  if (status === undefined && describePermissionError(error)) {
2844
3161
  return {
2845
3162
  errorCode: "local_permission_denied",
@@ -2855,6 +3172,17 @@ function classifyError(status, error) {
2855
3172
  }
2856
3173
  return { errorCode: "unknown_error", retry: "RetryWillNotFix" };
2857
3174
  }
3175
+ function withCarriedClass(inferred, error) {
3176
+ const errorCode = carriedErrorCode(error);
3177
+ const retry = carriedRetry(error);
3178
+ if (errorCode === undefined || errorCode === inferred.errorCode) {
3179
+ return {
3180
+ errorCode: inferred.errorCode,
3181
+ retry: retry ?? inferred.retry
3182
+ };
3183
+ }
3184
+ return { errorCode, retry: retry ?? defaultRetryForErrorCode(errorCode) };
3185
+ }
2858
3186
  function formatHttpStatusMessage(status, rawMessage, extractedMessage, inferredStatus) {
2859
3187
  if (extractedMessage) {
2860
3188
  return `HTTP ${status}: ${extractedMessage}`;
@@ -2910,9 +3238,14 @@ async function extractErrorDetails(error, options) {
2910
3238
  const classificationStatus = status ?? findHttpStatusInGraph(error);
2911
3239
  const classification = classifyError(classificationStatus, error);
2912
3240
  let retry = classification.retry;
3241
+ const htmlForbidden = status === 403 && rawBody !== undefined && isHtmlDocument(rawBody);
3242
+ const rayId = htmlForbidden ? readHeader(response, "cf-ray") : undefined;
3243
+ const cloudflareBlock = htmlForbidden && (rayId !== undefined || /\bcloudflare\b/i.test(readHeader(response, "server") ?? ""));
2913
3244
  if (status === 401) {
2914
3245
  message = DEFAULT_401;
2915
3246
  result = "AuthenticationError";
3247
+ } else if (cloudflareBlock) {
3248
+ message = rayId ? `${CLOUDFLARE_BLOCK_403} Cloudflare Ray ID: ${rayId}.` : CLOUDFLARE_BLOCK_403;
2916
3249
  } else if (status === 403) {
2917
3250
  message = options?.forbiddenMessage ?? DEFAULT_403;
2918
3251
  result = "AuthenticationError";
@@ -2960,7 +3293,9 @@ async function extractErrorDetails(error, options) {
2960
3293
  }
2961
3294
  }
2962
3295
  let details = rawMessage;
2963
- if (rawBody) {
3296
+ if (htmlForbidden) {
3297
+ details = cloudflareBlock ? CLOUDFLARE_BLOCK_403_INSTRUCTIONS : HTML_RESPONSE_MESSAGE;
3298
+ } else if (rawBody) {
2964
3299
  if (parsedBody) {
2965
3300
  const extra = {};
2966
3301
  if (parsedBody.errorCode)
@@ -2994,6 +3329,8 @@ async function extractErrorDetails(error, options) {
2994
3329
  }
2995
3330
  if (parsedBody?.requestId && typeof parsedBody.requestId === "string") {
2996
3331
  context.requestId = parsedBody.requestId;
3332
+ } else if (cloudflareBlock && rayId) {
3333
+ context.requestId = rayId;
2997
3334
  }
2998
3335
  if (parsedBody?.traceId && typeof parsedBody.traceId === "string") {
2999
3336
  context.traceId = parsedBody.traceId;
@@ -3002,16 +3339,7 @@ async function extractErrorDetails(error, options) {
3002
3339
  context.path = permission.path;
3003
3340
  }
3004
3341
  if (status === 429) {
3005
- const resp = response;
3006
- const headersObj = resp?.headers;
3007
- let retryAfterValue;
3008
- if (headersObj && typeof headersObj === "object" && typeof headersObj.get === "function") {
3009
- retryAfterValue = headersObj.get("retry-after") ?? undefined;
3010
- }
3011
- if (!retryAfterValue && headersObj && typeof headersObj === "object") {
3012
- const headers = headersObj;
3013
- retryAfterValue = headers["retry-after"] ?? headers["Retry-After"];
3014
- }
3342
+ const retryAfterValue = readHeader(response, "retry-after");
3015
3343
  if (retryAfterValue) {
3016
3344
  const seconds = Number(retryAfterValue);
3017
3345
  if (!Number.isNaN(seconds)) {
@@ -3045,9 +3373,8 @@ async function extractErrorDetails(error, options) {
3045
3373
  }
3046
3374
  return {
3047
3375
  result,
3048
- errorCode: classification.errorCode,
3376
+ ...withCarriedClass({ errorCode: classification.errorCode, retry }, error),
3049
3377
  message,
3050
- retry,
3051
3378
  details,
3052
3379
  ...hasContext ? { context } : {},
3053
3380
  ...parsedErrors ? { parsedErrors } : {}
@@ -3058,6 +3385,16 @@ async function extractErrorMessage(error, options) {
3058
3385
  return message;
3059
3386
  }
3060
3387
 
3388
+ // ../common/src/result-types.ts
3389
+ var RESULTS = {
3390
+ Success: "Success",
3391
+ Failure: "Failure",
3392
+ ConfigError: "ConfigError",
3393
+ AuthenticationError: "AuthenticationError",
3394
+ ValidationError: "ValidationError",
3395
+ TimeoutError: "TimeoutError"
3396
+ };
3397
+
3061
3398
  // ../common/src/output-context.ts
3062
3399
  function createStorage() {
3063
3400
  const [error, mod] = catchError(() => __require("node:async_hooks"));
@@ -3275,9 +3612,97 @@ function getLogFilePath() {
3275
3612
  return logger.getLogFilePath();
3276
3613
  }
3277
3614
 
3615
+ // ../common/src/timings.ts
3616
+ var TIMINGS_ENV_VAR = "UIP_TIMINGS";
3617
+ function createStorage2() {
3618
+ const [error, mod] = catchError(() => __require("node:async_hooks"));
3619
+ if (error || typeof mod?.AsyncLocalStorage !== "function") {
3620
+ return {
3621
+ getStore: () => {
3622
+ return;
3623
+ },
3624
+ run: (_store, fn) => fn()
3625
+ };
3626
+ }
3627
+ return new mod.AsyncLocalStorage;
3628
+ }
3629
+ var storageSlot = singleton("TimingStorage");
3630
+ var stateSlot = singleton("Timings");
3631
+ var rootStartedSlot = singleton("TimingsRootStarted");
3632
+ var longLivedHostSlot = singleton("TimingsLongLivedHost");
3633
+ var storage = storageSlot.getOrInit(createStorage2, (value) => ("getStore" in value));
3634
+ function newState(baseline) {
3635
+ return { baseline, httpMs: 0, httpCalls: 0 };
3636
+ }
3637
+ function getState() {
3638
+ const scoped = storage.getStore();
3639
+ if (scoped) {
3640
+ return scoped;
3641
+ }
3642
+ const pinned = livePinnedState();
3643
+ if (pinned !== undefined) {
3644
+ return pinned;
3645
+ }
3646
+ return newState(processStartIsInvocationStart() ? 0 : performance.now());
3647
+ }
3648
+ function livePinnedState() {
3649
+ const pinned = stateSlot.get();
3650
+ return pinned !== undefined && "httpCalls" in pinned && !pinned.finished ? pinned : undefined;
3651
+ }
3652
+ function processStartIsInvocationStart() {
3653
+ return !rootStartedSlot.get(false) && !longLivedHostSlot.get(false);
3654
+ }
3655
+ function timingsEnabled() {
3656
+ if (typeof process === "undefined") {
3657
+ return false;
3658
+ }
3659
+ const value = process.env?.[TIMINGS_ENV_VAR];
3660
+ if (value === undefined) {
3661
+ return false;
3662
+ }
3663
+ const normalized = value.trim().toLowerCase();
3664
+ return normalized === "1" || normalized === "true";
3665
+ }
3666
+ function recordExitCode(exitCode) {
3667
+ if (!timingsEnabled()) {
3668
+ return;
3669
+ }
3670
+ getState().exitCode = exitCode;
3671
+ }
3672
+ function invocationStartedAt() {
3673
+ return new Date(performance.timeOrigin + getState().baseline);
3674
+ }
3675
+ function invocationElapsedMs() {
3676
+ return performance.now() - getState().baseline;
3677
+ }
3678
+ function markCommandStart() {
3679
+ if (!timingsEnabled()) {
3680
+ return;
3681
+ }
3682
+ getState().commandStart = performance.now();
3683
+ }
3684
+ function recordCommandDuration(durationMs) {
3685
+ if (!timingsEnabled()) {
3686
+ return;
3687
+ }
3688
+ getState().commandMs = durationMs;
3689
+ }
3690
+
3278
3691
  // ../common/src/exit-code.ts
3279
3692
  function setExitCode(code) {
3280
3693
  process.exitCode = code;
3694
+ recordExitCode(code);
3695
+ }
3696
+ var GENERIC_FAILURE_EXIT_CODE = 1;
3697
+ function recordCommandExit(code) {
3698
+ if (code === GENERIC_FAILURE_EXIT_CODE && getExitCode() !== 0) {
3699
+ return;
3700
+ }
3701
+ setExitCode(code);
3702
+ }
3703
+ function getExitCode() {
3704
+ const code = process.exitCode;
3705
+ return typeof code === "number" ? code : 0;
3281
3706
  }
3282
3707
 
3283
3708
  // ../common/src/output-codecs.ts
@@ -3286,12 +3711,12 @@ var jmespathSlot = singleton("JmespathCodec");
3286
3711
  async function loadOutputCodecsAsync(needed) {
3287
3712
  const loads = [];
3288
3713
  if (needed.yaml && yamlSlot.get() === undefined) {
3289
- loads.push(import("./js-yaml-87cdx6bm.js").then((mod) => {
3714
+ loads.push(import("./js-yaml-a2bk27p6.js").then((mod) => {
3290
3715
  yamlSlot.set(mod);
3291
3716
  }));
3292
3717
  }
3293
3718
  if (needed.filter && jmespathSlot.get() === undefined) {
3294
- loads.push(import("./jmespath-e4a59c8w.js").then((m)=>__toESM(m.default,1)).then((mod) => {
3719
+ loads.push(import("./jmespath-wwym30dp.js").then((m)=>__toESM(m.default,1)).then((mod) => {
3295
3720
  jmespathSlot.set(mod);
3296
3721
  }));
3297
3722
  }
@@ -3316,155 +3741,6 @@ function getOutputFilter() {
3316
3741
  return filterSlot.get();
3317
3742
  }
3318
3743
 
3319
- // ../common/src/telemetry/telemetry-dimensions.ts
3320
- var BaseDimensions = {
3321
- ApplicationName: "ApplicationName",
3322
- ProductVersion: "ProductVersion",
3323
- InstallationId: "InstallationId",
3324
- CloudUserId: "CloudUserId",
3325
- CloudTenantId: "CloudTenantId",
3326
- CloudOrganizationId: "CloudOrganizationId",
3327
- IsInternalUser: "IsInternalUser",
3328
- Environment: "Environment",
3329
- BaseUrl: "BaseUrl",
3330
- Region: "Region",
3331
- Agent: "Agent",
3332
- AgentVersion: "AgentVersion",
3333
- AgentModel: "AgentModel",
3334
- ToolName: "ToolName",
3335
- ToolVersion: "ToolVersion",
3336
- ExecutionContext: "ExecutionContext",
3337
- CiProvider: "CiProvider",
3338
- SessionIdSource: "SessionIdSource",
3339
- SessionId: "SessionId"
3340
- };
3341
- var CommandDimensions = {
3342
- IsCommand: "IsCommand",
3343
- IsReexec: "IsReexec",
3344
- CommandName: "CommandName",
3345
- ExitCode: "ExitCode",
3346
- TerminalOutcome: "TerminalOutcome",
3347
- ErrorClass: "ErrorClass",
3348
- TerminalSignal: "TerminalSignal",
3349
- ErrorMessage: "ErrorMessage",
3350
- SkillName: "SkillName",
3351
- ProductArea: "ProductArea",
3352
- Mode: "Mode"
3353
- };
3354
- var ShipDimensions = {
3355
- ShipKind: "ShipKind",
3356
- Target: "Target",
3357
- ProjectType: "ProjectType",
3358
- ProjectTypes: "ProjectTypes",
3359
- ArtifactCorrelationKey: "ArtifactCorrelationKey",
3360
- PackageName: "PackageName",
3361
- PackageVersion: "PackageVersion",
3362
- PackageVersionKey: "PackageVersionKey",
3363
- DeploymentKey: "DeploymentKey",
3364
- SolutionId: "SolutionId",
3365
- FolderKey: "FolderKey",
3366
- FeedId: "FeedId"
3367
- };
3368
- var ErrorDimensions = {
3369
- Result: "Result",
3370
- ErrorCode: "ErrorCode",
3371
- Retry: "Retry",
3372
- ErrorMessage: "ErrorMessage",
3373
- HttpStatus: "HttpStatus",
3374
- UpstreamErrorCode: "UpstreamErrorCode"
3375
- };
3376
- var AuthDimensions = {
3377
- AuthenticationMethod: "AuthenticationMethod",
3378
- Success: "Success",
3379
- Reason: "Reason"
3380
- };
3381
- var SkillsDimensions = {
3382
- SchemaVersion: "SchemaVersion",
3383
- AgentType: "AgentType",
3384
- SkillsVersion: "SkillsVersion",
3385
- UipSubcommand: "UipSubcommand",
3386
- FileExtension: "FileExtension",
3387
- SubagentModel: "SubagentModel",
3388
- SubagentType: "SubagentType",
3389
- PermissionMode: "PermissionMode",
3390
- EffortLevel: "EffortLevel",
3391
- SessionSource: "SessionSource",
3392
- Outcome: "Outcome",
3393
- DurationMs: "DurationMs",
3394
- Source: "Source"
3395
- };
3396
- var PackagerDimensions = {
3397
- ProjectId: "ProjectId",
3398
- ProjectType: "ProjectType",
3399
- SolutionId: "SolutionId"
3400
- };
3401
- var ScopeDimensions = {
3402
- FolderId: "FolderId"
3403
- };
3404
- var ID_DIMENSIONS = new Set([
3405
- BaseDimensions.CloudUserId,
3406
- BaseDimensions.CloudTenantId,
3407
- BaseDimensions.CloudOrganizationId,
3408
- BaseDimensions.InstallationId,
3409
- ShipDimensions.ArtifactCorrelationKey,
3410
- ShipDimensions.PackageVersionKey,
3411
- ShipDimensions.DeploymentKey,
3412
- ShipDimensions.SolutionId,
3413
- ShipDimensions.FolderKey,
3414
- ShipDimensions.FeedId,
3415
- PackagerDimensions.ProjectId
3416
- ]);
3417
- var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
3418
- var RESERVED_DIMENSION_NAMES = new Set([
3419
- ...Object.values(BaseDimensions),
3420
- ...Object.values(CommandDimensions),
3421
- ...Object.values(ShipDimensions),
3422
- ...Object.values(ErrorDimensions),
3423
- ...Object.values(AuthDimensions),
3424
- ...Object.values(SkillsDimensions),
3425
- ...Object.values(PackagerDimensions),
3426
- ...Object.values(ScopeDimensions)
3427
- ]);
3428
- var CURATED_DIMENSIONS = new Set([
3429
- BaseDimensions.ApplicationName,
3430
- BaseDimensions.ProductVersion,
3431
- BaseDimensions.InstallationId,
3432
- BaseDimensions.CloudUserId,
3433
- BaseDimensions.CloudTenantId,
3434
- BaseDimensions.CloudOrganizationId,
3435
- BaseDimensions.IsInternalUser,
3436
- BaseDimensions.Environment,
3437
- BaseDimensions.BaseUrl,
3438
- BaseDimensions.Region,
3439
- BaseDimensions.Agent,
3440
- BaseDimensions.AgentVersion,
3441
- BaseDimensions.ToolVersion,
3442
- BaseDimensions.ExecutionContext,
3443
- BaseDimensions.CiProvider,
3444
- BaseDimensions.SessionIdSource,
3445
- BaseDimensions.SessionId,
3446
- ...Object.values(CommandDimensions),
3447
- ...Object.values(ShipDimensions)
3448
- ]);
3449
- function lowercaseIdDimensionValues(properties) {
3450
- let changed = false;
3451
- const result = {
3452
- ...properties
3453
- };
3454
- for (const key of Object.keys(result)) {
3455
- const value = result[key];
3456
- if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
3457
- continue;
3458
- }
3459
- const lowered = value.toLowerCase();
3460
- if (lowered !== value) {
3461
- result[key] = lowered;
3462
- changed = true;
3463
- }
3464
- }
3465
- return changed ? result : properties;
3466
- }
3467
-
3468
3744
  // ../common/src/telemetry/command-terminal.ts
3469
3745
  var recordedFailureSlot = singleton("CommandTelemetryFailure");
3470
3746
  var AUTH_ERROR_CODES = new Set([
@@ -3583,17 +3859,8 @@ function terminalSignalFor(input, outcome) {
3583
3859
  }
3584
3860
  return outcome === "cancelled" ? "SIGINT" : undefined;
3585
3861
  }
3586
- function classifyHttpStatus(status) {
3587
- if (status === 401 || status === 403) {
3588
- return "auth";
3589
- }
3590
- if (status === 400 || status === 409 || status === 422) {
3591
- return "validation";
3592
- }
3593
- if (status === 408) {
3594
- return "timeout";
3595
- }
3596
- return "network_http";
3862
+ function classifyFailingHttpStatus(status) {
3863
+ return classifyFromErrorCode(classifyHttpStatus(status)?.errorCode) ?? "network_http";
3597
3864
  }
3598
3865
  function classifyFromResult(result) {
3599
3866
  switch (result) {
@@ -3673,7 +3940,7 @@ function classifyError2(input) {
3673
3940
  }
3674
3941
  const status = recorded?.context?.httpStatus ?? findHttpStatusInGraph(input.error);
3675
3942
  if (status !== undefined) {
3676
- return classifyHttpStatus(status);
3943
+ return classifyFailingHttpStatus(status);
3677
3944
  }
3678
3945
  return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
3679
3946
  }
@@ -3705,6 +3972,7 @@ function buildCommandTerminalTelemetryProperties(input) {
3705
3972
  var CommonTelemetryEvents = {
3706
3973
  Start: "Application.Start",
3707
3974
  Error: "Application.Error",
3975
+ ProjectActivity: "Cli.ProjectActivity",
3708
3976
  ShipSucceeded: "Cli.ShipSucceeded"
3709
3977
  };
3710
3978
 
@@ -4222,87 +4490,21 @@ class TelemetryService {
4222
4490
  return hex;
4223
4491
  }
4224
4492
  }
4225
- // ../common/src/timings.ts
4226
- var TIMINGS_ENV_VAR = "UIP_TIMINGS";
4227
- function createStorage2() {
4228
- const [error, mod] = catchError(() => __require("node:async_hooks"));
4229
- if (error || typeof mod?.AsyncLocalStorage !== "function") {
4230
- return {
4231
- getStore: () => {
4232
- return;
4233
- },
4234
- run: (_store, fn) => fn()
4235
- };
4236
- }
4237
- return new mod.AsyncLocalStorage;
4238
- }
4239
- var storageSlot = singleton("TimingStorage");
4240
- var stateSlot = singleton("Timings");
4241
- var rootStartedSlot = singleton("TimingsRootStarted");
4242
- var longLivedHostSlot = singleton("TimingsLongLivedHost");
4243
- var storage = storageSlot.getOrInit(createStorage2, (value) => ("getStore" in value));
4244
- function newState(baseline) {
4245
- return { baseline, httpMs: 0, httpCalls: 0 };
4246
- }
4247
- function getState() {
4248
- const scoped = storage.getStore();
4249
- if (scoped) {
4250
- return scoped;
4251
- }
4252
- const pinned = livePinnedState();
4253
- if (pinned !== undefined) {
4254
- return pinned;
4255
- }
4256
- return newState(processStartIsInvocationStart() ? 0 : performance.now());
4257
- }
4258
- function livePinnedState() {
4259
- const pinned = stateSlot.get();
4260
- return pinned !== undefined && "httpCalls" in pinned && !pinned.finished ? pinned : undefined;
4261
- }
4262
- function processStartIsInvocationStart() {
4263
- return !rootStartedSlot.get(false) && !longLivedHostSlot.get(false);
4264
- }
4265
- function timingsEnabled() {
4266
- if (typeof process === "undefined") {
4267
- return false;
4268
- }
4269
- const value = process.env?.[TIMINGS_ENV_VAR];
4270
- if (value === undefined) {
4271
- return false;
4272
- }
4273
- const normalized = value.trim().toLowerCase();
4274
- return normalized === "1" || normalized === "true";
4275
- }
4276
- function recordExitCode(exitCode) {
4277
- if (!timingsEnabled()) {
4278
- return;
4279
- }
4280
- getState().exitCode = exitCode;
4281
- }
4282
- function invocationStartedAt() {
4283
- return new Date(performance.timeOrigin + getState().baseline);
4284
- }
4285
- function invocationElapsedMs() {
4286
- return performance.now() - getState().baseline;
4287
- }
4288
- function markCommandStart() {
4289
- if (!timingsEnabled()) {
4290
- return;
4291
- }
4292
- getState().commandStart = performance.now();
4293
- }
4294
- function recordCommandDuration(durationMs) {
4295
- if (!timingsEnabled()) {
4296
- return;
4297
- }
4298
- getState().commandMs = durationMs;
4299
- }
4300
4493
  // ../common/src/telemetry/proxy-http-agent.ts
4301
4494
  var slot = singleton("ProxyAuthHttpsAgent");
4302
4495
 
4303
4496
  // ../common/src/telemetry/node-appinsights-telemetry-provider.ts
4304
4497
  var providerSlot = singleton("TelemetryProvider");
4305
4498
 
4499
+ // ../common/src/telemetry/telemetry-config.ts
4500
+ function isTelemetryDisabled() {
4501
+ const value = process.env.UIPATH_TELEMETRY_DISABLED;
4502
+ return value === "1" || value === "true";
4503
+ }
4504
+ function isProjectTelemetryDisabled() {
4505
+ return isTelemetryDisabled() || process.env.UIPATH_PROJECT_TELEMETRY_DISABLED === "1" || process.env.UIPATH_PROJECT_TELEMETRY_DISABLED === "true";
4506
+ }
4507
+
4306
4508
  // ../common/src/telemetry/telemetry-spool.ts
4307
4509
  var sidecarEntrySlot = singleton("TelemetrySidecarEntry");
4308
4510
  var MAX_SPOOL_AGE_MS = 72 * 60 * 60 * 1000;
@@ -4338,56 +4540,15 @@ var telemetry = new Proxy({}, {
4338
4540
  return typeof value === "function" ? value.bind(instance) : value;
4339
4541
  }
4340
4542
  });
4341
-
4342
4543
  // ../common/src/formatter.ts
4343
4544
  var ANSI_STYLES = {
4344
- red: "\x1B[31m",
4345
- dim: "\x1B[2m"
4346
- };
4347
- var ANSI_RESET = "\x1B[0m";
4348
- function styleLine(line, style) {
4349
- return style ? `${ANSI_STYLES[style]}${line}${ANSI_RESET}` : line;
4350
- }
4351
- var CLI_ERROR_CODES = [
4352
- "invalid_argument",
4353
- "authentication_required",
4354
- "permission_denied",
4355
- "local_permission_denied",
4356
- "not_found",
4357
- "rate_limited",
4358
- "network_error",
4359
- "timeout",
4360
- "server_error",
4361
- "method_not_allowed",
4362
- "not_supported",
4363
- "configuration_error",
4364
- "execution_failed",
4365
- "unknown_error"
4366
- ];
4367
- var RETRY_HINTS = [
4368
- "RetryWillNotFix",
4369
- "RetryLater",
4370
- "RetryAfter1Second",
4371
- "RetryAfter10Seconds",
4372
- "RetryAfter30Seconds",
4373
- "RetryAfter60Seconds"
4374
- ];
4375
- var CLI_ERROR_CODE_VALUES = new Set(CLI_ERROR_CODES);
4376
- var RETRY_HINT_VALUES = new Set(RETRY_HINTS);
4377
- function isCliErrorCode(value) {
4378
- return typeof value === "string" && CLI_ERROR_CODE_VALUES.has(value);
4379
- }
4380
- function isRetryHint(value) {
4381
- return typeof value === "string" && RETRY_HINT_VALUES.has(value);
4382
- }
4383
- var RESULTS = {
4384
- Success: "Success",
4385
- Failure: "Failure",
4386
- ConfigError: "ConfigError",
4387
- AuthenticationError: "AuthenticationError",
4388
- ValidationError: "ValidationError",
4389
- TimeoutError: "TimeoutError"
4545
+ red: "\x1B[31m",
4546
+ dim: "\x1B[2m"
4390
4547
  };
4548
+ var ANSI_RESET = "\x1B[0m";
4549
+ function styleLine(line, style) {
4550
+ return style ? `${ANSI_STYLES[style]}${line}${ANSI_RESET}` : line;
4551
+ }
4391
4552
  var EXIT_CODES = {
4392
4553
  Success: 0,
4393
4554
  Failure: 1,
@@ -4396,6 +4557,9 @@ var EXIT_CODES = {
4396
4557
  ValidationError: 3,
4397
4558
  TimeoutError: 4
4398
4559
  };
4560
+ function exitCodeForResult(result) {
4561
+ return EXIT_CODES[result] ?? EXIT_CODES.Failure;
4562
+ }
4399
4563
  function escapeNonAscii(jsonText) {
4400
4564
  return jsonText.replace(/[\u0080-\uffff]/g, (c) => {
4401
4565
  const hex = c.charCodeAt(0).toString(16).padStart(4, "0");
@@ -5071,8 +5235,8 @@ function carriesOnlyNulls(value) {
5071
5235
  }
5072
5236
  return false;
5073
5237
  }
5074
- function nameList(names, cap2 = 12) {
5075
- const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
5238
+ function nameList(names, cap = 12) {
5239
+ const shown = names.slice(0, cap).map((n) => `\`${n}\``);
5076
5240
  const rest = names.length - shown.length;
5077
5241
  return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
5078
5242
  }
@@ -5209,40 +5373,11 @@ function defaultErrorCodeForResult(result) {
5209
5373
  return "unknown_error";
5210
5374
  }
5211
5375
  }
5212
- function parseHttpStatusFromMessage2(message) {
5213
- const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
5214
- if (!match)
5215
- return;
5216
- const status = Number(match[1]);
5217
- return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
5218
- }
5219
- function defaultErrorCodeForHttpStatus(status) {
5220
- if (status === undefined)
5221
- return;
5222
- if (status === 400 || status === 409 || status === 422) {
5223
- return "invalid_argument";
5224
- }
5225
- if (status === 401)
5226
- return "authentication_required";
5227
- if (status === 403)
5228
- return "permission_denied";
5229
- if (status === 404)
5230
- return "not_found";
5231
- if (status === 405)
5232
- return "method_not_allowed";
5233
- if (status === 408)
5234
- return "timeout";
5235
- if (status === 429)
5236
- return "rate_limited";
5237
- if (status >= 500 && status < 600)
5238
- return "server_error";
5239
- return;
5240
- }
5241
5376
  var LOCAL_PERMISSION_TEXT_PATTERN = new RegExp(`(?:\\b|\\()(?:${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})(?::\\s|\\))`);
5242
5377
  function defaultErrorCodeForFailure(data) {
5243
5378
  if (data.Result === RESULTS.Failure) {
5244
- const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage2(data.Message);
5245
- const errorCode = defaultErrorCodeForHttpStatus(status);
5379
+ const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage(data.Message);
5380
+ const errorCode = classifyHttpStatus(status)?.errorCode;
5246
5381
  if (errorCode)
5247
5382
  return errorCode;
5248
5383
  if (status === undefined && (LOCAL_PERMISSION_TEXT_PATTERN.test(data.Message) || LOCAL_PERMISSION_TEXT_PATTERN.test(data.Instructions))) {
@@ -5251,17 +5386,6 @@ function defaultErrorCodeForFailure(data) {
5251
5386
  }
5252
5387
  return defaultErrorCodeForResult(data.Result);
5253
5388
  }
5254
- function defaultRetryForErrorCode(errorCode) {
5255
- switch (errorCode) {
5256
- case "network_error":
5257
- case "rate_limited":
5258
- case "server_error":
5259
- case "timeout":
5260
- return "RetryLater";
5261
- default:
5262
- return "RetryWillNotFix";
5263
- }
5264
- }
5265
5389
  var OutputFormatter;
5266
5390
  ((OutputFormatter) => {
5267
5391
  function success(data, options) {
@@ -5293,7 +5417,7 @@ var OutputFormatter;
5293
5417
  data.Log ??= getLogFilePath() || undefined;
5294
5418
  data.ErrorCode ??= defaultErrorCodeForFailure(data);
5295
5419
  data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
5296
- const exitCode = EXIT_CODES[data.Result] ?? 1;
5420
+ const exitCode = exitCodeForResult(data.Result);
5297
5421
  setExitCode(exitCode);
5298
5422
  recordCommandFailureTelemetry({
5299
5423
  result: data.Result,
@@ -5388,6 +5512,228 @@ var OutputFormatter;
5388
5512
  OutputFormatter.formatToString = formatToString;
5389
5513
  })(OutputFormatter ||= {});
5390
5514
 
5515
+ // ../common/src/pass-through-tail.ts
5516
+ function maybeOption(arg) {
5517
+ return arg.length > 1 && arg[0] === "-";
5518
+ }
5519
+ function tokenizeTail(cmd, tail) {
5520
+ const find = (flag) => cmd.options.find((option) => option.long === flag || option.short === flag);
5521
+ const digitShort = cmd.options.some((option) => option.short !== undefined && /^-\d$/.test(option.short));
5522
+ const negativeNumber = (arg) => !digitShort && /^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(arg);
5523
+ const tokens = [];
5524
+ let firstUnknown = -1;
5525
+ let sentinel = -1;
5526
+ let variadic;
5527
+ let group;
5528
+ let groupIndex = 0;
5529
+ let i = 0;
5530
+ while (i < tail.length || group !== undefined) {
5531
+ const index = group === undefined ? i : groupIndex;
5532
+ const arg = group ?? tail[i++];
5533
+ group = undefined;
5534
+ if (arg === "--") {
5535
+ sentinel = index;
5536
+ tokens.push({ kind: "sentinel", index });
5537
+ for (let j = i;j < tail.length; j++) {
5538
+ tokens.push({
5539
+ kind: "operand",
5540
+ index: j,
5541
+ text: tail[j],
5542
+ literal: true
5543
+ });
5544
+ }
5545
+ break;
5546
+ }
5547
+ if (variadic && (!maybeOption(arg) || negativeNumber(arg))) {
5548
+ tokens.push({
5549
+ kind: "option",
5550
+ index,
5551
+ text: arg,
5552
+ option: variadic,
5553
+ value: arg
5554
+ });
5555
+ continue;
5556
+ }
5557
+ variadic = undefined;
5558
+ if (maybeOption(arg)) {
5559
+ const option = find(arg);
5560
+ if (option) {
5561
+ let value;
5562
+ if (option.required) {
5563
+ value = tail[i];
5564
+ if (value !== undefined)
5565
+ i++;
5566
+ } else if (option.optional) {
5567
+ const next = tail[i];
5568
+ if (next !== undefined && (!maybeOption(next) || negativeNumber(next))) {
5569
+ value = next;
5570
+ i++;
5571
+ }
5572
+ }
5573
+ tokens.push({
5574
+ kind: "option",
5575
+ index,
5576
+ text: arg,
5577
+ option,
5578
+ ...value === undefined ? {} : { value }
5579
+ });
5580
+ variadic = option.variadic ? option : undefined;
5581
+ continue;
5582
+ }
5583
+ }
5584
+ if (arg.length > 2 && arg[0] === "-" && arg[1] !== "-") {
5585
+ const option = find(`-${arg[1]}`);
5586
+ if (option) {
5587
+ if (option.required || option.optional) {
5588
+ tokens.push({
5589
+ kind: "option",
5590
+ index,
5591
+ text: arg,
5592
+ option,
5593
+ value: arg.slice(2)
5594
+ });
5595
+ } else {
5596
+ tokens.push({ kind: "option", index, text: arg, option });
5597
+ group = `-${arg.slice(2)}`;
5598
+ groupIndex = index;
5599
+ }
5600
+ continue;
5601
+ }
5602
+ }
5603
+ if (/^--[^=]+=/.test(arg)) {
5604
+ const equals = arg.indexOf("=");
5605
+ const option = find(arg.slice(0, equals));
5606
+ if (option && (option.required || option.optional)) {
5607
+ tokens.push({
5608
+ kind: "option",
5609
+ index,
5610
+ text: arg,
5611
+ option,
5612
+ value: arg.slice(equals + 1)
5613
+ });
5614
+ continue;
5615
+ }
5616
+ }
5617
+ if (maybeOption(arg) && !negativeNumber(arg)) {
5618
+ const equals = arg.startsWith("--") ? arg.indexOf("=") : -1;
5619
+ if (firstUnknown === -1)
5620
+ firstUnknown = index;
5621
+ tokens.push({
5622
+ kind: "unknown",
5623
+ index,
5624
+ text: arg,
5625
+ flag: equals > 0 ? arg.slice(0, equals) : arg,
5626
+ ...equals > 0 ? { inlineValue: arg.slice(equals + 1) } : {}
5627
+ });
5628
+ continue;
5629
+ }
5630
+ tokens.push({ kind: "operand", index, text: arg, literal: false });
5631
+ }
5632
+ return { tokens, firstUnknown, sentinel };
5633
+ }
5634
+
5635
+ // ../common/src/project-telemetry.ts
5636
+ var RESOLVER = Symbol.for("@uipath/common/projectTelemetryResolver");
5637
+ var CAPTURE = Symbol.for("@uipath/common/projectTelemetryCapture");
5638
+ var CONTEXT_RESOLVER = Symbol.for("@uipath/common/projectContextTelemetryResolver");
5639
+ var RULES = Symbol.for("@uipath/common/projectTargetRules");
5640
+ function logSkipped(what, error) {
5641
+ logger.debug(`[project-telemetry] ${what} skipped: ${error instanceof Error ? error.message : String(error)}`);
5642
+ }
5643
+ function bounded(work, what) {
5644
+ return withinProjectIdentityBudget(work, () => logSkipped(what, `no answer within ${PROJECT_IDENTITY_LOOKUP_BUDGET_MS} ms`));
5645
+ }
5646
+ async function identityWithContext(command, identity) {
5647
+ const props = projectIdentityProperties(identity);
5648
+ if (!identity.projectDirectory || isProjectTelemetryDisabled())
5649
+ return props;
5650
+ for (let node = command;node; node = node.parent ?? undefined) {
5651
+ const resolver = node[CONTEXT_RESOLVER];
5652
+ if (typeof resolver !== "function")
5653
+ continue;
5654
+ try {
5655
+ return {
5656
+ ...await resolver(identity.projectDirectory),
5657
+ ...props
5658
+ };
5659
+ } catch (error) {
5660
+ logSkipped("solution context lookup", error);
5661
+ return props;
5662
+ }
5663
+ }
5664
+ return props;
5665
+ }
5666
+ function getProjectTelemetryResolver(command) {
5667
+ for (let node = command;node; node = node.parent) {
5668
+ const resolver = node[RESOLVER];
5669
+ if (typeof resolver === "function")
5670
+ return resolver;
5671
+ }
5672
+ return;
5673
+ }
5674
+ function attachProjectTelemetryCapture(command, capture) {
5675
+ command[CAPTURE] = capture;
5676
+ }
5677
+ class ProjectTelemetrySession {
5678
+ resolver;
5679
+ command;
5680
+ target;
5681
+ props = {};
5682
+ explicit = false;
5683
+ input;
5684
+ constructor(resolver, command) {
5685
+ this.resolver = resolver;
5686
+ this.command = command;
5687
+ }
5688
+ async setTarget(path) {
5689
+ this.target = path;
5690
+ if (this.input) {
5691
+ await this.resolve({
5692
+ ...this.input,
5693
+ phase: "after",
5694
+ success: true
5695
+ });
5696
+ this.explicit = true;
5697
+ }
5698
+ }
5699
+ async setIdentity(identity) {
5700
+ try {
5701
+ const props = await bounded(identityWithContext(this.command, identity), "project identity capture");
5702
+ if (props !== undefined)
5703
+ this.setProperties(props);
5704
+ } catch (error) {
5705
+ logSkipped("project identity capture", error);
5706
+ }
5707
+ }
5708
+ setProperties(properties) {
5709
+ try {
5710
+ this.props = { ...properties };
5711
+ this.explicit = true;
5712
+ } catch (error) {
5713
+ logSkipped("project identity properties", error);
5714
+ }
5715
+ }
5716
+ properties() {
5717
+ return { ...this.props };
5718
+ }
5719
+ async resolve(input) {
5720
+ this.input = input;
5721
+ if (this.explicit)
5722
+ return;
5723
+ try {
5724
+ const props = await bounded(this.resolver({
5725
+ ...input,
5726
+ target: this.target
5727
+ }), `project identity (${input.phase})`);
5728
+ if (props !== undefined) {
5729
+ this.props = props;
5730
+ }
5731
+ } catch (error) {
5732
+ logSkipped(`project identity (${input.phase})`, error);
5733
+ }
5734
+ }
5735
+ }
5736
+
5391
5737
  // ../common/src/telemetry/command-attribution.ts
5392
5738
  var LEGACY_SKILL_NAMESPACE = "uipath:";
5393
5739
  var MAX_SKILL_NAME_LENGTH = 80;
@@ -5632,8 +5978,7 @@ var pollSignalSlot = singleton("PollSignal");
5632
5978
  var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
5633
5979
  var processContext = {
5634
5980
  exit: (code) => {
5635
- recordExitCode(code);
5636
- setExitCode(code);
5981
+ recordCommandExit(code);
5637
5982
  },
5638
5983
  get pollSignal() {
5639
5984
  return pollSignalSlot.get();
@@ -5658,6 +6003,8 @@ function recordableArgValue(value, choices) {
5658
6003
  function extractCommandParams(cmd) {
5659
6004
  const params = {};
5660
6005
  forEachSuppliedArgument(cmd, (name, value, choices, defaulted) => {
6006
+ if (name === undefined)
6007
+ return;
5661
6008
  const recordable = recordableArgValue(value, choices);
5662
6009
  params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = recordable === TELEMETRY_ARG_VALUE_WITHHELD && defaulted ? TELEMETRY_ARG_VALUE_DEFAULTED : recordable;
5663
6010
  });
@@ -5673,7 +6020,8 @@ function isDefaultedPositional(cmd, index) {
5673
6020
  function forEachSuppliedArgument(cmd, visit) {
5674
6021
  const registered = cmd.registeredArguments ?? [];
5675
6022
  const processed = cmd.processedArgs ?? [];
5676
- for (let i = 0;i < registered.length; i++) {
6023
+ const bound = boundPositionalCount(cmd);
6024
+ for (let i = 0;i < bound; i++) {
5677
6025
  const name = registered[i].name();
5678
6026
  if (name && processed[i] !== undefined) {
5679
6027
  visit(name, processed[i], registered[i].argChoices, isDefaultedPositional(cmd, i));
@@ -5688,6 +6036,71 @@ function forEachSuppliedArgument(cmd, visit) {
5688
6036
  visit(key, value, choicesByAttribute.get(key), isDefaultedOption(cmd, key));
5689
6037
  }
5690
6038
  }
6039
+ forEachPassThroughToken(cmd, bound, (name, value) => {
6040
+ visit(name, value, name === undefined ? undefined : choicesByAttribute.get(name), false);
6041
+ });
6042
+ }
6043
+ function boundPositionalCount(cmd) {
6044
+ const registered = cmd.registeredArguments ?? [];
6045
+ if (registered.some((argument) => argument.variadic)) {
6046
+ return registered.length;
6047
+ }
6048
+ if ((cmd.args ?? []).length <= registered.length) {
6049
+ return registered.length;
6050
+ }
6051
+ const firstFlag = tokenizeTail(cmd, (cmd.args ?? []).slice(1)).tokens.find((token) => token.kind !== "operand")?.index ?? -1;
6052
+ return firstFlag === -1 ? registered.length : Math.min(registered.length, firstFlag + 1);
6053
+ }
6054
+ function forEachPassThroughToken(cmd, bound, visit) {
6055
+ const registered = cmd.registeredArguments ?? [];
6056
+ const fillsPositionals = !registered.some((argument) => argument.variadic);
6057
+ const { tokens, firstUnknown } = tokenizeTail(cmd, (cmd.args ?? []).slice(bound));
6058
+ const repeated = new Map;
6059
+ let nextPositional = bound;
6060
+ for (const token of tokens) {
6061
+ const pastUnknown = firstUnknown !== -1 && token.index > firstUnknown;
6062
+ if (token.kind === "sentinel")
6063
+ continue;
6064
+ if (token.kind === "operand") {
6065
+ const claimable = !pastUnknown && fillsPositionals && nextPositional < registered.length;
6066
+ const name = claimable ? registered[nextPositional++].name() : undefined;
6067
+ visit(name || undefined, token.text);
6068
+ continue;
6069
+ }
6070
+ if (token.kind === "unknown") {
6071
+ const bare = token.flag.replace(/^-+/, "");
6072
+ const key = bare.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
6073
+ const keyable = token.flag.startsWith("--") || token.flag.length === 2;
6074
+ if (!pastUnknown && keyable && /^[a-z][a-z0-9-]*$/i.test(bare) && key) {
6075
+ visit(key, token.inlineValue ?? true);
6076
+ } else {
6077
+ visit(undefined, token.text);
6078
+ if (token.inlineValue !== undefined) {
6079
+ visit(undefined, token.inlineValue);
6080
+ } else if (!token.flag.startsWith("--") && token.flag.length > 2) {
6081
+ visit(undefined, token.flag.slice(2));
6082
+ }
6083
+ }
6084
+ continue;
6085
+ }
6086
+ if (pastUnknown) {
6087
+ visit(undefined, token.text);
6088
+ if (token.value !== undefined)
6089
+ visit(undefined, token.value);
6090
+ continue;
6091
+ }
6092
+ const option = token.option;
6093
+ const name = option.attributeName();
6094
+ const value = option.negate ? false : option.required || option.optional ? token.value ?? true : true;
6095
+ const previous = repeated.get(name);
6096
+ if (previous) {
6097
+ previous.push(value);
6098
+ visit(name, previous);
6099
+ } else {
6100
+ repeated.set(name, [value]);
6101
+ visit(name, value);
6102
+ }
6103
+ }
5691
6104
  }
5692
6105
  function withheldArgumentValues(cmd) {
5693
6106
  const values = [];
@@ -5749,6 +6162,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5749
6162
  const telemetryName = commandTelemetryName(commandParts);
5750
6163
  const commandPath = commandInvocationPath(commandParts);
5751
6164
  const props = typeof properties === "function" ? properties(...args) : properties;
6165
+ const projectResolver = getProjectTelemetryResolver(command);
6166
+ const projectSession = projectResolver && !isProjectTelemetryDisabled() ? new ProjectTelemetrySession(projectResolver, command) : undefined;
5752
6167
  markCommandStart();
5753
6168
  const supplied = recordSuppliedArgumentValues(withheldArgumentValues(command));
5754
6169
  try {
@@ -5761,6 +6176,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5761
6176
  if (violation) {
5762
6177
  return Promise.reject(violation);
5763
6178
  }
6179
+ if (projectSession) {
6180
+ return projectSession.resolve({ command, args, phase: "before" }).then(() => {
6181
+ attachProjectTelemetryCapture(command, projectSession);
6182
+ return fn(...args);
6183
+ });
6184
+ }
5764
6185
  return fn(...args);
5765
6186
  }));
5766
6187
  if (error) {
@@ -5769,22 +6190,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5769
6190
  const typed = error;
5770
6191
  const customInstructions = typeof typed.instructions === "string" ? typed.instructions : undefined;
5771
6192
  const customResult = typeof typed.result === "string" && typed.result !== RESULTS.Success && Object.values(RESULTS).includes(typed.result) ? typed.result : undefined;
5772
- const finalResult = customResult ?? RESULTS.Failure;
6193
+ const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
6194
+ const classified = cancellationExitCode === undefined ? await extractErrorDetails(error) : undefined;
6195
+ const finalResult = customResult ?? classified?.result ?? RESULTS.Failure;
5773
6196
  const typedErrorCode = typed.errorCode ?? typed.ErrorCode;
5774
6197
  const customErrorCode = isCliErrorCode(typedErrorCode) ? typedErrorCode : undefined;
5775
6198
  const typedRetry = typed.retry ?? typed.Retry;
5776
6199
  const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
5777
6200
  const typedContext = typed.context ?? typed.Context;
5778
6201
  const customContext = isErrorContext(typedContext) ? typedContext : undefined;
5779
- const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
5780
6202
  fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
6203
+ const errorCode = customErrorCode ?? classified?.errorCode;
6204
+ const retry = customRetry ?? classified?.retry;
6205
+ const errorContext = customContext ?? classified?.context;
5781
6206
  OutputFormatter.error({
5782
6207
  Result: finalResult,
5783
- ...customErrorCode ? { ErrorCode: customErrorCode } : {},
6208
+ ...errorCode ? { ErrorCode: errorCode } : {},
5784
6209
  Message: errorMessage,
5785
6210
  Instructions: customInstructions ?? commandHelpHint(commandPath),
5786
- ...customRetry ? { Retry: customRetry } : {},
5787
- ...customContext ? { Context: customContext } : {}
6211
+ ...retry ? { Retry: retry } : {},
6212
+ ...errorContext ? { Context: errorContext } : {}
5788
6213
  });
5789
6214
  context.exit(fallbackExitCode);
5790
6215
  }
@@ -5793,6 +6218,14 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5793
6218
  const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
5794
6219
  const recordedFailure = takeRecordedCommandFailureTelemetry();
5795
6220
  const success = !error && exitCode === 0;
6221
+ if (projectSession) {
6222
+ await projectSession.resolve({
6223
+ command,
6224
+ args,
6225
+ phase: "after",
6226
+ success
6227
+ });
6228
+ }
5796
6229
  const terminalTelemetry = buildCommandTerminalTelemetryProperties({
5797
6230
  error,
5798
6231
  exitCode,
@@ -5810,6 +6243,7 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5810
6243
  }
5811
6244
  const baseProperties = redactProperties({
5812
6245
  ...commandParams,
6246
+ ...projectSession?.properties(),
5813
6247
  ...props,
5814
6248
  ...buildCommandTelemetryAttribution(commandPath, process.env.UIPATH_SKILL),
5815
6249
  ...buildAgentSessionTelemetry(process.env),
@@ -5820,6 +6254,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5820
6254
  });
5821
6255
  emitInvocationRequest(telemetryName, success, baseProperties);
5822
6256
  } finally {
6257
+ if (projectSession)
6258
+ attachProjectTelemetryCapture(command, undefined);
5823
6259
  releaseSuppliedArgumentValues(supplied);
5824
6260
  }
5825
6261
  });
@@ -6022,11 +6458,31 @@ function interruptibleSleep(ms, signal) {
6022
6458
  function sanitizeMaxErrors(value) {
6023
6459
  if (value === undefined)
6024
6460
  return POLL_DEFAULTS.maxConsecutiveErrors;
6025
- if (!Number.isFinite(value) || value < 0)
6461
+ if (value < 0)
6026
6462
  return 0;
6027
6463
  return Math.floor(value);
6028
6464
  }
6465
+ function requireFinite(value, field) {
6466
+ if (value !== undefined && !Number.isFinite(value)) {
6467
+ throw new RangeError(`pollUntil: ${field} must be a finite number, got ${String(value)}.`);
6468
+ }
6469
+ }
6470
+ function assertFiniteSettings(options) {
6471
+ requireFinite(options.timeoutMs, "timeoutMs");
6472
+ if (typeof options.intervalMs === "number") {
6473
+ requireFinite(options.intervalMs, "intervalMs");
6474
+ }
6475
+ requireFinite(options.maxConsecutiveErrors, "maxConsecutiveErrors");
6476
+ requireFinite(options.logIntervalMs, "logIntervalMs");
6477
+ if (typeof options.backoff === "object" && options.backoff !== null) {
6478
+ requireFinite(options.backoff.initialMs, "backoff.initialMs");
6479
+ requireFinite(options.backoff.multiplier, "backoff.multiplier");
6480
+ requireFinite(options.backoff.maxMs, "backoff.maxMs");
6481
+ requireFinite(options.backoff.jitter, "backoff.jitter");
6482
+ }
6483
+ }
6029
6484
  function resolveConfig(options) {
6485
+ assertFiniteSettings(options);
6030
6486
  const timeoutMs = Math.max(0, options.timeoutMs ?? POLL_DEFAULTS.timeoutMs);
6031
6487
  const startTime = Date.now();
6032
6488
  return {
@@ -6589,16 +7045,6 @@ var HOST_GLOBAL_FLAGS = [
6589
7045
  ];
6590
7046
  var VALUE_OPTIONS = new Set(HOST_GLOBAL_OPTIONS_WITH_VALUE);
6591
7047
  var BOOLEAN_FLAGS = new Set(HOST_GLOBAL_FLAGS);
6592
- // ../common/src/http-status.ts
6593
- function httpStatusOf(error) {
6594
- if (!error || typeof error !== "object") {
6595
- return;
6596
- }
6597
- if ("response" in error && error.response && typeof error.response === "object" && "status" in error.response && typeof error.response.status === "number") {
6598
- return error.response.status;
6599
- }
6600
- return "status" in error && typeof error.status === "number" ? error.status : undefined;
6601
- }
6602
7048
  // ../common/src/mime-types.ts
6603
7049
  var MIME_TYPES_BY_EXTENSION = Object.freeze({
6604
7050
  pdf: "application/pdf",
@@ -6721,918 +7167,6 @@ function installSdkUserAgentHeader(BaseApiClass, userAgent) {
6721
7167
  var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
6722
7168
  // ../common/src/tool-provider.ts
6723
7169
  var factorySlot = singleton("PackagerFactoryProvider");
6724
- // ../../node_modules/fflate/esm/index.mjs
6725
- import { createRequire } from "module";
6726
- var require2 = createRequire("/");
6727
- var _a;
6728
- var Worker;
6729
- var isMarkedAsUntransferable;
6730
- try {
6731
- _a = require2("worker_threads"), Worker = _a.Worker, isMarkedAsUntransferable = _a.isMarkedAsUntransferable;
6732
- } catch (e) {}
6733
- var u8 = Uint8Array;
6734
- var u16 = Uint16Array;
6735
- var i32 = Int32Array;
6736
- var fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0]);
6737
- var fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0]);
6738
- var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
6739
- var freb = function(eb, start) {
6740
- var b = new u16(31);
6741
- for (var i = 0;i < 31; ++i) {
6742
- b[i] = start += 1 << eb[i - 1];
6743
- }
6744
- var r = new i32(b[30]);
6745
- for (var i = 1;i < 30; ++i) {
6746
- for (var j = b[i];j < b[i + 1]; ++j) {
6747
- r[j] = j - b[i] << 5 | i;
6748
- }
6749
- }
6750
- return { b, r };
6751
- };
6752
- var _a = freb(fleb, 2);
6753
- var fl = _a.b;
6754
- var revfl = _a.r;
6755
- fl[28] = 258, revfl[258] = 28;
6756
- var _b = freb(fdeb, 0);
6757
- var fd = _b.b;
6758
- var revfd = _b.r;
6759
- var rev = new u16(32768);
6760
- for (i = 0;i < 32768; ++i) {
6761
- x = (i & 43690) >> 1 | (i & 21845) << 1;
6762
- x = (x & 52428) >> 2 | (x & 13107) << 2;
6763
- x = (x & 61680) >> 4 | (x & 3855) << 4;
6764
- rev[i] = ((x & 65280) >> 8 | (x & 255) << 8) >> 1;
6765
- }
6766
- var x;
6767
- var i;
6768
- var hMap = function(cd, mb, r) {
6769
- var s = cd.length;
6770
- var i2 = 0;
6771
- var l = new u16(mb);
6772
- for (;i2 < s; ++i2) {
6773
- if (cd[i2])
6774
- ++l[cd[i2] - 1];
6775
- }
6776
- var le = new u16(mb);
6777
- for (i2 = 1;i2 < mb; ++i2) {
6778
- le[i2] = le[i2 - 1] + l[i2 - 1] << 1;
6779
- }
6780
- var co;
6781
- if (r) {
6782
- co = new u16(1 << mb);
6783
- var rvb = 15 - mb;
6784
- for (i2 = 0;i2 < s; ++i2) {
6785
- if (cd[i2]) {
6786
- var sv = i2 << 4 | cd[i2];
6787
- var r_1 = mb - cd[i2];
6788
- var v = le[cd[i2] - 1]++ << r_1;
6789
- for (var m = v | (1 << r_1) - 1;v <= m; ++v) {
6790
- co[rev[v] >> rvb] = sv;
6791
- }
6792
- }
6793
- }
6794
- } else {
6795
- co = new u16(s);
6796
- for (i2 = 0;i2 < s; ++i2) {
6797
- if (cd[i2]) {
6798
- co[i2] = rev[le[cd[i2] - 1]++] >> 15 - cd[i2];
6799
- }
6800
- }
6801
- }
6802
- return co;
6803
- };
6804
- var flt = new u8(288);
6805
- for (i = 0;i < 144; ++i)
6806
- flt[i] = 8;
6807
- var i;
6808
- for (i = 144;i < 256; ++i)
6809
- flt[i] = 9;
6810
- var i;
6811
- for (i = 256;i < 280; ++i)
6812
- flt[i] = 7;
6813
- var i;
6814
- for (i = 280;i < 288; ++i)
6815
- flt[i] = 8;
6816
- var i;
6817
- var fdt = new u8(32);
6818
- for (i = 0;i < 32; ++i)
6819
- fdt[i] = 5;
6820
- var i;
6821
- var flm = /* @__PURE__ */ hMap(flt, 9, 0);
6822
- var flrm = /* @__PURE__ */ hMap(flt, 9, 1);
6823
- var fdm = /* @__PURE__ */ hMap(fdt, 5, 0);
6824
- var fdrm = /* @__PURE__ */ hMap(fdt, 5, 1);
6825
- var max = function(a) {
6826
- var m = a[0];
6827
- for (var i2 = 1;i2 < a.length; ++i2) {
6828
- if (a[i2] > m)
6829
- m = a[i2];
6830
- }
6831
- return m;
6832
- };
6833
- var bits = function(d, p, m) {
6834
- var o = p / 8 | 0;
6835
- return (d[o] | d[o + 1] << 8) >> (p & 7) & m;
6836
- };
6837
- var bits16 = function(d, p) {
6838
- var o = p / 8 | 0;
6839
- return (d[o] | d[o + 1] << 8 | d[o + 2] << 16) >> (p & 7);
6840
- };
6841
- var shft = function(p) {
6842
- return (p + 7) / 8 | 0;
6843
- };
6844
- var slc = function(v, s, e) {
6845
- if (s == null || s < 0)
6846
- s = 0;
6847
- if (e == null || e > v.length)
6848
- e = v.length;
6849
- return new u8(v.subarray(s, e));
6850
- };
6851
- var ec = [
6852
- "unexpected EOF",
6853
- "invalid block type",
6854
- "invalid length/literal",
6855
- "invalid distance",
6856
- "stream finished",
6857
- "no stream handler",
6858
- ,
6859
- "no callback",
6860
- "invalid UTF-8 data",
6861
- "extra field too long",
6862
- "date not in range 1980-2099",
6863
- "filename too long",
6864
- "stream finishing",
6865
- "invalid zip data"
6866
- ];
6867
- var err = function(ind, msg, nt) {
6868
- var e = new Error(msg || ec[ind]);
6869
- e.code = ind;
6870
- if (Error.captureStackTrace)
6871
- Error.captureStackTrace(e, err);
6872
- if (!nt)
6873
- throw e;
6874
- return e;
6875
- };
6876
- var inflt = function(dat, st, buf, dict) {
6877
- var sl = dat.length, dl = dict ? dict.length : 0;
6878
- if (!sl || st.f && !st.l)
6879
- return buf || new u8(0);
6880
- var noBuf = !buf;
6881
- var resize = noBuf || st.i != 2;
6882
- var noSt = st.i;
6883
- if (noBuf)
6884
- buf = new u8(sl * 3);
6885
- var cbuf = function(l2) {
6886
- var bl = buf.length;
6887
- if (l2 > bl) {
6888
- var nbuf = new u8(Math.max(bl * 2, l2));
6889
- nbuf.set(buf);
6890
- buf = nbuf;
6891
- }
6892
- };
6893
- var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;
6894
- var tbts = sl * 8;
6895
- do {
6896
- if (!lm) {
6897
- final = bits(dat, pos, 1);
6898
- var type = bits(dat, pos + 1, 3);
6899
- pos += 3;
6900
- if (!type) {
6901
- var s = shft(pos) + 4, l = dat[s - 4] | dat[s - 3] << 8, t = s + l;
6902
- if (t > sl) {
6903
- if (noSt)
6904
- err(0);
6905
- break;
6906
- }
6907
- if (resize)
6908
- cbuf(bt + l);
6909
- buf.set(dat.subarray(s, t), bt);
6910
- st.b = bt += l, st.p = pos = t * 8, st.f = final;
6911
- continue;
6912
- } else if (type == 1)
6913
- lm = flrm, dm = fdrm, lbt = 9, dbt = 5;
6914
- else if (type == 2) {
6915
- var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;
6916
- var tl = hLit + bits(dat, pos + 5, 31) + 1;
6917
- pos += 14;
6918
- var ldt = new u8(tl);
6919
- var clt = new u8(19);
6920
- for (var i2 = 0;i2 < hcLen; ++i2) {
6921
- clt[clim[i2]] = bits(dat, pos + i2 * 3, 7);
6922
- }
6923
- pos += hcLen * 3;
6924
- var clb = max(clt), clbmsk = (1 << clb) - 1;
6925
- var clm = hMap(clt, clb, 1);
6926
- for (var i2 = 0;i2 < tl; ) {
6927
- var r = clm[bits(dat, pos, clbmsk)];
6928
- pos += r & 15;
6929
- var s = r >> 4;
6930
- if (s < 16) {
6931
- ldt[i2++] = s;
6932
- } else {
6933
- var c = 0, n = 0;
6934
- if (s == 16)
6935
- n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i2 - 1];
6936
- else if (s == 17)
6937
- n = 3 + bits(dat, pos, 7), pos += 3;
6938
- else if (s == 18)
6939
- n = 11 + bits(dat, pos, 127), pos += 7;
6940
- while (n--)
6941
- ldt[i2++] = c;
6942
- }
6943
- }
6944
- var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);
6945
- lbt = max(lt);
6946
- dbt = max(dt);
6947
- lm = hMap(lt, lbt, 1);
6948
- dm = hMap(dt, dbt, 1);
6949
- } else
6950
- err(1);
6951
- if (pos > tbts) {
6952
- if (noSt)
6953
- err(0);
6954
- break;
6955
- }
6956
- }
6957
- if (resize)
6958
- cbuf(bt + 131072);
6959
- var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;
6960
- var lpos = pos;
6961
- for (;; lpos = pos) {
6962
- var c = lm[bits16(dat, pos) & lms], sym = c >> 4;
6963
- pos += c & 15;
6964
- if (pos > tbts) {
6965
- if (noSt)
6966
- err(0);
6967
- break;
6968
- }
6969
- if (!c)
6970
- err(2);
6971
- if (sym < 256)
6972
- buf[bt++] = sym;
6973
- else if (sym == 256) {
6974
- lpos = pos, lm = null;
6975
- break;
6976
- } else {
6977
- var add = sym - 254;
6978
- if (sym > 264) {
6979
- var i2 = sym - 257, b = fleb[i2];
6980
- add = bits(dat, pos, (1 << b) - 1) + fl[i2];
6981
- pos += b;
6982
- }
6983
- var d = dm[bits16(dat, pos) & dms], dsym = d >> 4;
6984
- if (!d)
6985
- err(3);
6986
- pos += d & 15;
6987
- var dt = fd[dsym];
6988
- if (dsym > 3) {
6989
- var b = fdeb[dsym];
6990
- dt += bits16(dat, pos) & (1 << b) - 1, pos += b;
6991
- }
6992
- if (pos > tbts) {
6993
- if (noSt)
6994
- err(0);
6995
- break;
6996
- }
6997
- if (resize)
6998
- cbuf(bt + 131072);
6999
- var end = bt + add;
7000
- if (bt < dt) {
7001
- var shift = dl - dt, dend = Math.min(dt, end);
7002
- if (shift + bt < 0)
7003
- err(3);
7004
- for (;bt < dend; ++bt)
7005
- buf[bt] = dict[shift + bt];
7006
- }
7007
- for (;bt < end; ++bt)
7008
- buf[bt] = buf[bt - dt];
7009
- }
7010
- }
7011
- st.l = lm, st.p = lpos, st.b = bt, st.f = final;
7012
- if (lm)
7013
- final = 1, st.m = lbt, st.d = dm, st.n = dbt;
7014
- } while (!final);
7015
- return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt);
7016
- };
7017
- var wbits = function(d, p, v) {
7018
- v <<= p & 7;
7019
- var o = p / 8 | 0;
7020
- d[o] |= v;
7021
- d[o + 1] |= v >> 8;
7022
- };
7023
- var wbits16 = function(d, p, v) {
7024
- v <<= p & 7;
7025
- var o = p / 8 | 0;
7026
- d[o] |= v;
7027
- d[o + 1] |= v >> 8;
7028
- d[o + 2] |= v >> 16;
7029
- };
7030
- var hTree = function(d, mb) {
7031
- var t = [];
7032
- for (var i2 = 0;i2 < d.length; ++i2) {
7033
- if (d[i2])
7034
- t.push({ s: i2, f: d[i2] });
7035
- }
7036
- var s = t.length;
7037
- var t2 = t.slice();
7038
- if (!s)
7039
- return { t: et, l: 0 };
7040
- if (s == 1) {
7041
- var v = new u8(t[0].s + 1);
7042
- v[t[0].s] = 1;
7043
- return { t: v, l: 1 };
7044
- }
7045
- t.sort(function(a, b) {
7046
- return a.f - b.f;
7047
- });
7048
- t.push({ s: -1, f: 25001 });
7049
- var l = t[0], r = t[1], i0 = 0, i1 = 1, i22 = 2;
7050
- t[0] = { s: -1, f: l.f + r.f, l, r };
7051
- while (i1 != s - 1) {
7052
- l = t[t[i0].f < t[i22].f ? i0++ : i22++];
7053
- r = t[i0 != i1 && t[i0].f < t[i22].f ? i0++ : i22++];
7054
- t[i1++] = { s: -1, f: l.f + r.f, l, r };
7055
- }
7056
- var maxSym = t2[0].s;
7057
- for (var i2 = 1;i2 < s; ++i2) {
7058
- if (t2[i2].s > maxSym)
7059
- maxSym = t2[i2].s;
7060
- }
7061
- var tr = new u16(maxSym + 1);
7062
- var mbt = ln(t[i1 - 1], tr, 0);
7063
- if (mbt > mb) {
7064
- var i2 = 0, dt = 0;
7065
- var lft = mbt - mb, cst = 1 << lft;
7066
- t2.sort(function(a, b) {
7067
- return tr[b.s] - tr[a.s] || a.f - b.f;
7068
- });
7069
- for (;i2 < s; ++i2) {
7070
- var i2_1 = t2[i2].s;
7071
- if (tr[i2_1] > mb) {
7072
- dt += cst - (1 << mbt - tr[i2_1]);
7073
- tr[i2_1] = mb;
7074
- } else
7075
- break;
7076
- }
7077
- dt >>= lft;
7078
- while (dt > 0) {
7079
- var i2_2 = t2[i2].s;
7080
- if (tr[i2_2] < mb)
7081
- dt -= 1 << mb - tr[i2_2]++ - 1;
7082
- else
7083
- ++i2;
7084
- }
7085
- for (;i2 >= 0 && dt; --i2) {
7086
- var i2_3 = t2[i2].s;
7087
- if (tr[i2_3] == mb) {
7088
- --tr[i2_3];
7089
- ++dt;
7090
- }
7091
- }
7092
- mbt = mb;
7093
- }
7094
- return { t: new u8(tr), l: mbt };
7095
- };
7096
- var ln = function(n, l, d) {
7097
- return n.s == -1 ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1)) : l[n.s] = d;
7098
- };
7099
- var lc = function(c) {
7100
- var s = c.length;
7101
- while (s && !c[--s])
7102
- ;
7103
- var cl = new u16(++s);
7104
- var cli = 0, cln = c[0], cls = 1;
7105
- var w = function(v) {
7106
- cl[cli++] = v;
7107
- };
7108
- for (var i2 = 1;i2 <= s; ++i2) {
7109
- if (c[i2] == cln && i2 != s)
7110
- ++cls;
7111
- else {
7112
- if (!cln && cls > 2) {
7113
- for (;cls > 138; cls -= 138)
7114
- w(32754);
7115
- if (cls > 2) {
7116
- w(cls > 10 ? cls - 11 << 5 | 28690 : cls - 3 << 5 | 12305);
7117
- cls = 0;
7118
- }
7119
- } else if (cls > 3) {
7120
- w(cln), --cls;
7121
- for (;cls > 6; cls -= 6)
7122
- w(8304);
7123
- if (cls > 2)
7124
- w(cls - 3 << 5 | 8208), cls = 0;
7125
- }
7126
- while (cls--)
7127
- w(cln);
7128
- cls = 1;
7129
- cln = c[i2];
7130
- }
7131
- }
7132
- return { c: cl.subarray(0, cli), n: s };
7133
- };
7134
- var clen = function(cf, cl) {
7135
- var l = 0;
7136
- for (var i2 = 0;i2 < cl.length; ++i2)
7137
- l += cf[i2] * cl[i2];
7138
- return l;
7139
- };
7140
- var wfblk = function(out, pos, dat) {
7141
- var s = dat.length;
7142
- var o = shft(pos + 2);
7143
- out[o] = s & 255;
7144
- out[o + 1] = s >> 8;
7145
- out[o + 2] = out[o] ^ 255;
7146
- out[o + 3] = out[o + 1] ^ 255;
7147
- for (var i2 = 0;i2 < s; ++i2)
7148
- out[o + i2 + 4] = dat[i2];
7149
- return (o + 4 + s) * 8;
7150
- };
7151
- var wblk = function(dat, out, final, syms, lf, df, eb, li, bs, bl, p) {
7152
- wbits(out, p++, final);
7153
- ++lf[256];
7154
- var _a2 = hTree(lf, 15), dlt = _a2.t, mlb = _a2.l;
7155
- var _b2 = hTree(df, 15), ddt = _b2.t, mdb = _b2.l;
7156
- var _c = lc(dlt), lclt = _c.c, nlc = _c.n;
7157
- var _d = lc(ddt), lcdt = _d.c, ndc = _d.n;
7158
- var lcfreq = new u16(19);
7159
- for (var i2 = 0;i2 < lclt.length; ++i2)
7160
- ++lcfreq[lclt[i2] & 31];
7161
- for (var i2 = 0;i2 < lcdt.length; ++i2)
7162
- ++lcfreq[lcdt[i2] & 31];
7163
- var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l;
7164
- var nlcc = 19;
7165
- for (;nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)
7166
- ;
7167
- var flen = bl + 5 << 3;
7168
- var ftlen = clen(lf, flt) + clen(df, fdt) + eb;
7169
- var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18];
7170
- if (bs >= 0 && flen <= ftlen && flen <= dtlen)
7171
- return wfblk(out, p, dat.subarray(bs, bs + bl));
7172
- var lm, ll, dm, dl;
7173
- wbits(out, p, 1 + (dtlen < ftlen)), p += 2;
7174
- if (dtlen < ftlen) {
7175
- lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;
7176
- var llm = hMap(lct, mlcb, 0);
7177
- wbits(out, p, nlc - 257);
7178
- wbits(out, p + 5, ndc - 1);
7179
- wbits(out, p + 10, nlcc - 4);
7180
- p += 14;
7181
- for (var i2 = 0;i2 < nlcc; ++i2)
7182
- wbits(out, p + 3 * i2, lct[clim[i2]]);
7183
- p += 3 * nlcc;
7184
- var lcts = [lclt, lcdt];
7185
- for (var it = 0;it < 2; ++it) {
7186
- var clct = lcts[it];
7187
- for (var i2 = 0;i2 < clct.length; ++i2) {
7188
- var len = clct[i2] & 31;
7189
- wbits(out, p, llm[len]), p += lct[len];
7190
- if (len > 15)
7191
- wbits(out, p, clct[i2] >> 5 & 127), p += clct[i2] >> 12;
7192
- }
7193
- }
7194
- } else {
7195
- lm = flm, ll = flt, dm = fdm, dl = fdt;
7196
- }
7197
- for (var i2 = 0;i2 < li; ++i2) {
7198
- var sym = syms[i2];
7199
- if (sym > 255) {
7200
- var len = sym >> 18 & 31;
7201
- wbits16(out, p, lm[len + 257]), p += ll[len + 257];
7202
- if (len > 7)
7203
- wbits(out, p, sym >> 23 & 31), p += fleb[len];
7204
- var dst = sym & 31;
7205
- wbits16(out, p, dm[dst]), p += dl[dst];
7206
- if (dst > 3)
7207
- wbits16(out, p, sym >> 5 & 8191), p += fdeb[dst];
7208
- } else {
7209
- wbits16(out, p, lm[sym]), p += ll[sym];
7210
- }
7211
- }
7212
- wbits16(out, p, lm[256]);
7213
- return p + ll[256];
7214
- };
7215
- var deo = /* @__PURE__ */ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);
7216
- var et = /* @__PURE__ */ new u8(0);
7217
- var dflt = function(dat, lvl, plvl, pre, post, st) {
7218
- var s = st.z || dat.length;
7219
- var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);
7220
- var w = o.subarray(pre, o.length - post);
7221
- var lst = st.l;
7222
- var pos = (st.r || 0) & 7;
7223
- if (lvl) {
7224
- if (pos)
7225
- w[0] = st.r >> 3;
7226
- var opt = deo[lvl - 1];
7227
- var n = opt >> 13, c = opt & 8191;
7228
- var msk_1 = (1 << plvl) - 1;
7229
- var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1);
7230
- var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;
7231
- var hsh = function(i3) {
7232
- return (dat[i3] ^ dat[i3 + 1] << bs1_1 ^ dat[i3 + 2] << bs2_1) & msk_1;
7233
- };
7234
- var syms = new i32(25000);
7235
- var lf = new u16(288), df = new u16(32);
7236
- var lc_1 = 0, eb = 0, i2 = st.i || 0, li = 0, wi = st.w || 0, bs = 0;
7237
- for (;i2 + 2 < s; ++i2) {
7238
- var hv = hsh(i2);
7239
- var imod = i2 & 32767, pimod = head[hv];
7240
- prev[imod] = pimod;
7241
- head[hv] = imod;
7242
- if (wi <= i2) {
7243
- var rem = s - i2;
7244
- if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) {
7245
- pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i2 - bs, pos);
7246
- li = lc_1 = eb = 0, bs = i2;
7247
- for (var j = 0;j < 286; ++j)
7248
- lf[j] = 0;
7249
- for (var j = 0;j < 30; ++j)
7250
- df[j] = 0;
7251
- }
7252
- var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767;
7253
- if (rem > 2 && hv == hsh(i2 - dif)) {
7254
- var maxn = Math.min(n, rem) - 1;
7255
- var maxd = Math.min(32767, i2);
7256
- var ml = Math.min(258, rem);
7257
- while (dif <= maxd && --ch_1 && imod != pimod) {
7258
- if (dat[i2 + l] == dat[i2 + l - dif]) {
7259
- var nl = 0;
7260
- for (;nl < ml && dat[i2 + nl] == dat[i2 + nl - dif]; ++nl)
7261
- ;
7262
- if (nl > l) {
7263
- l = nl, d = dif;
7264
- if (nl > maxn)
7265
- break;
7266
- var mmd = Math.min(dif, nl - 2);
7267
- var md = 0;
7268
- for (var j = 0;j < mmd; ++j) {
7269
- var ti = i2 - dif + j & 32767;
7270
- var pti = prev[ti];
7271
- var cd = ti - pti & 32767;
7272
- if (cd > md)
7273
- md = cd, pimod = ti;
7274
- }
7275
- }
7276
- }
7277
- imod = pimod, pimod = prev[imod];
7278
- dif += imod - pimod & 32767;
7279
- }
7280
- }
7281
- if (d) {
7282
- syms[li++] = 268435456 | revfl[l] << 18 | revfd[d];
7283
- var lin = revfl[l] & 31, din = revfd[d] & 31;
7284
- eb += fleb[lin] + fdeb[din];
7285
- ++lf[257 + lin];
7286
- ++df[din];
7287
- wi = i2 + l;
7288
- ++lc_1;
7289
- } else {
7290
- syms[li++] = dat[i2];
7291
- ++lf[dat[i2]];
7292
- }
7293
- }
7294
- }
7295
- for (i2 = Math.max(i2, wi);i2 < s; ++i2) {
7296
- syms[li++] = dat[i2];
7297
- ++lf[dat[i2]];
7298
- }
7299
- pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i2 - bs, pos);
7300
- if (!lst) {
7301
- st.r = pos & 7 | w[pos / 8 | 0] << 3;
7302
- pos -= 7;
7303
- st.h = head, st.p = prev, st.i = i2, st.w = wi;
7304
- }
7305
- } else {
7306
- for (var i2 = st.w || 0;i2 < s + lst; i2 += 65535) {
7307
- var e = i2 + 65535;
7308
- if (e >= s) {
7309
- w[pos / 8 | 0] = lst;
7310
- e = s;
7311
- }
7312
- pos = wfblk(w, pos + 1, dat.subarray(i2, e));
7313
- }
7314
- st.i = s;
7315
- }
7316
- return slc(o, 0, pre + shft(pos) + post);
7317
- };
7318
- var crct = /* @__PURE__ */ function() {
7319
- var t = new Int32Array(256);
7320
- for (var i2 = 0;i2 < 256; ++i2) {
7321
- var c = i2, k = 9;
7322
- while (--k)
7323
- c = (c & 1 && -306674912) ^ c >>> 1;
7324
- t[i2] = c;
7325
- }
7326
- return t;
7327
- }();
7328
- var crc = function() {
7329
- var c = -1;
7330
- return {
7331
- p: function(d) {
7332
- var cr = c;
7333
- for (var i2 = 0;i2 < d.length; ++i2)
7334
- cr = crct[cr & 255 ^ d[i2]] ^ cr >>> 8;
7335
- c = cr;
7336
- },
7337
- d: function() {
7338
- return ~c;
7339
- }
7340
- };
7341
- };
7342
- var dopt = function(dat, opt, pre, post, st) {
7343
- if (!st) {
7344
- st = { l: 1 };
7345
- if (opt.dictionary) {
7346
- var dict = opt.dictionary.subarray(-32768);
7347
- var newDat = new u8(dict.length + dat.length);
7348
- newDat.set(dict);
7349
- newDat.set(dat, dict.length);
7350
- dat = newDat;
7351
- st.w = dict.length;
7352
- }
7353
- }
7354
- return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20 : 12 + opt.mem, pre, post, st);
7355
- };
7356
- var mrg = function(a, b) {
7357
- var o = {};
7358
- for (var k in a)
7359
- o[k] = a[k];
7360
- for (var k in b)
7361
- o[k] = b[k];
7362
- return o;
7363
- };
7364
- var b2 = function(d, b) {
7365
- return d[b] | d[b + 1] << 8;
7366
- };
7367
- var b4 = function(d, b) {
7368
- return (d[b] | d[b + 1] << 8 | d[b + 2] << 16 | d[b + 3] << 24) >>> 0;
7369
- };
7370
- var b8 = function(d, b) {
7371
- return b4(d, b) + b4(d, b + 4) * 4294967296;
7372
- };
7373
- var wbytes = function(d, b, v) {
7374
- for (;v; ++b)
7375
- d[b] = v, v >>>= 8;
7376
- };
7377
- function deflateSync(data, opts) {
7378
- return dopt(data, opts || {}, 0, 0);
7379
- }
7380
- function inflateSync(data, opts) {
7381
- return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary);
7382
- }
7383
- var fltn = function(d, p, t, o) {
7384
- for (var k in d) {
7385
- var val = d[k], n = p + k, op = o;
7386
- if (Array.isArray(val))
7387
- op = mrg(o, val[1]), val = val[0];
7388
- if (ArrayBuffer.isView(val))
7389
- t[n] = [val, op];
7390
- else {
7391
- t[n += "/"] = [new u8(0), op];
7392
- fltn(val, n, t, o);
7393
- }
7394
- }
7395
- };
7396
- var te = typeof TextEncoder != "undefined" && /* @__PURE__ */ new TextEncoder;
7397
- var td = typeof TextDecoder != "undefined" && /* @__PURE__ */ new TextDecoder;
7398
- var tds = 0;
7399
- try {
7400
- td.decode(et, { stream: true });
7401
- tds = 1;
7402
- } catch (e) {}
7403
- var dutf8 = function(d) {
7404
- for (var r = "", i2 = 0;; ) {
7405
- var c = d[i2++];
7406
- var eb = (c > 127) + (c > 223) + (c > 239);
7407
- if (i2 + eb > d.length)
7408
- return { s: r, r: slc(d, i2 - 1) };
7409
- if (!eb)
7410
- r += String.fromCharCode(c);
7411
- else if (eb == 3) {
7412
- c = ((c & 15) << 18 | (d[i2++] & 63) << 12 | (d[i2++] & 63) << 6 | d[i2++] & 63) - 65536, r += String.fromCharCode(55296 | c >> 10, 56320 | c & 1023);
7413
- } else if (eb & 1)
7414
- r += String.fromCharCode((c & 31) << 6 | d[i2++] & 63);
7415
- else
7416
- r += String.fromCharCode((c & 15) << 12 | (d[i2++] & 63) << 6 | d[i2++] & 63);
7417
- }
7418
- };
7419
- function strToU8(str, latin1) {
7420
- if (latin1) {
7421
- var ar_1 = new u8(str.length);
7422
- for (var i2 = 0;i2 < str.length; ++i2)
7423
- ar_1[i2] = str.charCodeAt(i2);
7424
- return ar_1;
7425
- }
7426
- if (te)
7427
- return te.encode(str);
7428
- var l = str.length;
7429
- var ar = new u8(str.length + (str.length >> 1));
7430
- var ai = 0;
7431
- var w = function(v) {
7432
- ar[ai++] = v;
7433
- };
7434
- for (var i2 = 0;i2 < l; ++i2) {
7435
- if (ai + 5 > ar.length) {
7436
- var n = new u8(ai + 8 + (l - i2 << 1));
7437
- n.set(ar);
7438
- ar = n;
7439
- }
7440
- var c = str.charCodeAt(i2);
7441
- if (c < 128 || latin1)
7442
- w(c);
7443
- else if (c < 2048)
7444
- w(192 | c >> 6), w(128 | c & 63);
7445
- else if (c > 55295 && c < 57344)
7446
- c = 65536 + (c & 1023 << 10) | str.charCodeAt(++i2) & 1023, w(240 | c >> 18), w(128 | c >> 12 & 63), w(128 | c >> 6 & 63), w(128 | c & 63);
7447
- else
7448
- w(224 | c >> 12), w(128 | c >> 6 & 63), w(128 | c & 63);
7449
- }
7450
- return slc(ar, 0, ai);
7451
- }
7452
- function strFromU8(dat, latin1) {
7453
- if (latin1) {
7454
- var r = "";
7455
- for (var i2 = 0;i2 < dat.length; i2 += 16384)
7456
- r += String.fromCharCode.apply(null, dat.subarray(i2, i2 + 16384));
7457
- return r;
7458
- } else if (td) {
7459
- return td.decode(dat);
7460
- } else {
7461
- var _a2 = dutf8(dat), s = _a2.s, r = _a2.r;
7462
- if (r.length)
7463
- err(8);
7464
- return s;
7465
- }
7466
- }
7467
- var slzh = function(d, b) {
7468
- return b + 30 + b2(d, b + 26) + b2(d, b + 28);
7469
- };
7470
- var zh = function(d, b, z) {
7471
- var fnl = b2(d, b + 28), efl = b2(d, b + 30), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl;
7472
- var _a2 = z64hs(d, es, efl, z, b4(d, b + 20), b4(d, b + 24), b4(d, b + 42)), sc = _a2[0], su = _a2[1], off = _a2[2];
7473
- return [b2(d, b + 10), sc, su, fn, es + efl + b2(d, b + 32), off];
7474
- };
7475
- var z64hs = function(d, b, l, z, sc, su, off) {
7476
- var nsc = sc == 4294967295, nsu = su == 4294967295, noff = off == 4294967295, e = b + l;
7477
- var nf = nsc + nsu + noff;
7478
- if (z && nf) {
7479
- for (;b + 4 < e; b += 4 + b2(d, b + 2)) {
7480
- if (b2(d, b) == 1) {
7481
- return [
7482
- nsc ? b8(d, b + 4 + 8 * nsu) : sc,
7483
- nsu ? b8(d, b + 4) : su,
7484
- noff ? b8(d, b + 4 + 8 * (nsu + nsc)) : off,
7485
- 1
7486
- ];
7487
- }
7488
- }
7489
- if (z < 2)
7490
- err(13);
7491
- }
7492
- return [sc, su, off, 0];
7493
- };
7494
- var exfl = function(ex) {
7495
- var le = 0;
7496
- if (ex) {
7497
- for (var k in ex) {
7498
- var l = ex[k].length;
7499
- if (l > 65535)
7500
- err(9);
7501
- le += l + 4;
7502
- }
7503
- }
7504
- return le;
7505
- };
7506
- var wzh = function(d, b, f, fn, u, c, ce, co) {
7507
- var fl2 = fn.length, ex = f.extra, col = co && co.length;
7508
- var exl = exfl(ex);
7509
- wbytes(d, b, ce != null ? 33639248 : 67324752), b += 4;
7510
- if (ce != null)
7511
- d[b++] = 20, d[b++] = f.os;
7512
- d[b] = 20, b += 2;
7513
- d[b++] = f.flag << 1 | (c < 0 && 8), d[b++] = u && 8;
7514
- d[b++] = f.compression & 255, d[b++] = f.compression >> 8;
7515
- var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;
7516
- if (y < 0 || y > 119)
7517
- err(10);
7518
- wbytes(d, b, y << 25 | dt.getMonth() + 1 << 21 | dt.getDate() << 16 | dt.getHours() << 11 | dt.getMinutes() << 5 | dt.getSeconds() >> 1), b += 4;
7519
- if (c != -1) {
7520
- wbytes(d, b, f.crc);
7521
- wbytes(d, b + 4, c < 0 ? -c - 2 : c);
7522
- wbytes(d, b + 8, f.size);
7523
- }
7524
- wbytes(d, b + 12, fl2);
7525
- wbytes(d, b + 14, exl), b += 16;
7526
- if (ce != null) {
7527
- wbytes(d, b, col);
7528
- wbytes(d, b + 6, f.attrs);
7529
- wbytes(d, b + 10, ce), b += 14;
7530
- }
7531
- d.set(fn, b);
7532
- b += fl2;
7533
- if (exl) {
7534
- for (var k in ex) {
7535
- var exf = ex[k], l = exf.length;
7536
- wbytes(d, b, +k);
7537
- wbytes(d, b + 2, l);
7538
- d.set(exf, b + 4), b += 4 + l;
7539
- }
7540
- }
7541
- if (col)
7542
- d.set(co, b), b += col;
7543
- return b;
7544
- };
7545
- var wzf = function(o, b, c, d, e) {
7546
- wbytes(o, b, 101010256);
7547
- wbytes(o, b + 8, c);
7548
- wbytes(o, b + 10, c);
7549
- wbytes(o, b + 12, d);
7550
- wbytes(o, b + 16, e);
7551
- };
7552
- function zipSync(data, opts) {
7553
- if (!opts)
7554
- opts = {};
7555
- var r = {};
7556
- var files = [];
7557
- fltn(data, "", r, opts);
7558
- var o = 0;
7559
- var tot = 0;
7560
- for (var fn in r) {
7561
- var _a2 = r[fn], file = _a2[0], p = _a2[1];
7562
- var compression = p.level == 0 ? 0 : 8;
7563
- var f = strToU8(fn), s = f.length;
7564
- var com = p.comment, m = com && strToU8(com), ms = m && m.length;
7565
- var exl = exfl(p.extra);
7566
- if (s > 65535)
7567
- err(11);
7568
- var d = compression ? deflateSync(file, p) : file, l = d.length;
7569
- var c = crc();
7570
- c.p(file);
7571
- files.push(mrg(p, {
7572
- size: file.length,
7573
- crc: c.d(),
7574
- c: d,
7575
- f,
7576
- m,
7577
- u: s != fn.length || m && com.length != ms,
7578
- o,
7579
- compression
7580
- }));
7581
- o += 30 + s + exl + l;
7582
- tot += 76 + 2 * (s + exl) + (ms || 0) + l;
7583
- }
7584
- var out = new u8(tot + 22), oe = o, cdl = tot - o;
7585
- for (var i2 = 0;i2 < files.length; ++i2) {
7586
- var f = files[i2];
7587
- wzh(out, f.o, f, f.f, f.u, f.c.length);
7588
- var badd = 30 + f.f.length + exfl(f.extra);
7589
- out.set(f.c, f.o + badd);
7590
- wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);
7591
- }
7592
- wzf(out, o, files.length, cdl, oe);
7593
- return out;
7594
- }
7595
- function unzipSync(data, opts) {
7596
- var files = {};
7597
- var e = data.length - 22;
7598
- for (;b4(data, e) != 101010256; --e) {
7599
- if (!e || data.length - e > 65558)
7600
- err(13);
7601
- }
7602
- var c = b2(data, e + 8);
7603
- if (!c)
7604
- return {};
7605
- var o = b4(data, e + 16);
7606
- var z = b4(data, e - 20) == 117853008;
7607
- if (z) {
7608
- var ze = b4(data, e - 12);
7609
- z = b4(data, ze) == 101075792;
7610
- if (z) {
7611
- c = b4(data, ze + 32);
7612
- o = b4(data, ze + 48);
7613
- }
7614
- }
7615
- var fltr = opts && opts.filter;
7616
- for (var i2 = 0;i2 < c; ++i2) {
7617
- var _a2 = zh(data, o, z), c_2 = _a2[0], sc = _a2[1], su = _a2[2], fn = _a2[3], no = _a2[4], off = _a2[5], b = slzh(data, off);
7618
- o = no;
7619
- if (!fltr || fltr({
7620
- name: fn,
7621
- size: sc,
7622
- originalSize: su,
7623
- compression: c_2
7624
- })) {
7625
- if (!c_2)
7626
- files[fn] = slc(data, b, b + sc);
7627
- else if (c_2 == 8)
7628
- files[fn] = inflateSync(data.subarray(b, b + sc), { out: new u8(su) });
7629
- else
7630
- err(14, "unknown compression type " + c_2);
7631
- }
7632
- }
7633
- return files;
7634
- }
7635
-
7636
- export { catchError, extractErrorDetails, extractErrorMessage, getOutputSink, logger, RESULTS, EXIT_CODES, OutputFormatter, Command, Option, processContext, requireConfirmation, UIPATH_HOME_DIR, isGuid, httpStatusOf, getInteractivityMode, resolveDeprecatedOptionAlias, warnDeprecatedOptionAlias, createHiddenDeprecatedTenantOption, parsePositiveInteger, PollOutcome, pollUntil, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, zipSync, unzipSync };
7170
+ export { catchError, httpStatusOf, classifyHttpStatus, extractErrorDetails, extractErrorMessage, RESULTS, Command, Option, getOutputSink, logger, EXIT_CODES, OutputFormatter, processContext, requireConfirmation, UIPATH_HOME_DIR, isGuid, getInteractivityMode, resolveDeprecatedOptionAlias, warnDeprecatedOptionAlias, createHiddenDeprecatedTenantOption, parsePositiveInteger, PollOutcome, pollUntil, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader };
7637
7171
 
7638
- //# debugId=8882E64859E6520464756E2164756E21
7172
+ //# debugId=F47795F6C29BA1B464756E2164756E21