@uipath/common 1.203.0-preview.205 → 1.204.0-preview.206

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.
@@ -21728,9 +21728,60 @@ function resolveEnvReference(value) {
21728
21728
  }
21729
21729
  return value;
21730
21730
  }
21731
+ // src/error-graph.ts
21732
+ function* walkErrorGraph(error) {
21733
+ const queue2 = [error];
21734
+ const seen = new Set;
21735
+ for (let steps = 0;queue2.length > 0 && steps < 32; steps++) {
21736
+ const current = queue2.shift();
21737
+ if (current === null || typeof current !== "object")
21738
+ continue;
21739
+ if (seen.has(current))
21740
+ continue;
21741
+ seen.add(current);
21742
+ const cur = current;
21743
+ yield cur;
21744
+ if (cur.cause !== undefined)
21745
+ queue2.push(cur.cause);
21746
+ if (Array.isArray(cur.errors))
21747
+ queue2.push(...cur.errors);
21748
+ }
21749
+ return;
21750
+ }
21751
+ function parseHttpStatusFromMessage(message) {
21752
+ const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
21753
+ if (!match)
21754
+ return;
21755
+ const status = Number(match[1]);
21756
+ return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
21757
+ }
21758
+ function findHttpStatusInGraph(error) {
21759
+ for (const node of walkErrorGraph(error)) {
21760
+ const response = node.response;
21761
+ const explicit = typeof node.status === "number" ? node.status : response?.status;
21762
+ if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
21763
+ return explicit;
21764
+ }
21765
+ if (typeof node.message === "string") {
21766
+ const parsed = parseHttpStatusFromMessage(node.message);
21767
+ if (parsed !== undefined && parsed >= 400) {
21768
+ return parsed;
21769
+ }
21770
+ }
21771
+ }
21772
+ return;
21773
+ }
21774
+
21775
+ // src/local-permission-codes.ts
21776
+ var LOCAL_PERMISSION_ERROR_CODES = new Set([
21777
+ "EACCES",
21778
+ "EPERM",
21779
+ "EROFS"
21780
+ ]);
21781
+
21731
21782
  // src/error-handler.ts
21732
- var DEFAULT_401 = "Unauthorized (401). Run `uip login` to authenticate.";
21733
- var DEFAULT_403 = "Forbidden (403). Ensure the account has the required permissions.";
21783
+ 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.";
21784
+ 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.";
21734
21785
  var DEFAULT_405 = "Method Not Allowed (405). The endpoint may not exist or the base URL may be incorrect.";
21735
21786
  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.";
21736
21787
  var HTML_RESPONSE_MESSAGE = "Received HTML instead of the expected JSON response.";
@@ -21757,14 +21808,14 @@ var TLS_ERROR_CODES = new Set([
21757
21808
  ]);
21758
21809
  var TLS_INSTRUCTIONS = "The server's TLS certificate could not be verified. Most often a " + "corporate proxy/firewall re-signs HTTPS with a root CA that Node does " + "not trust — set NODE_EXTRA_CA_CERTS to that CA's PEM file (and HTTPS_PROXY " + "if you connect through a proxy). If the certificate is instead expired or " + "its hostname does not match, fix the endpoint URL or the system clock. " + "Then retry.";
21759
21810
  var NETWORK_INSTRUCTIONS = "Could not reach the UiPath service. Check your network connection and " + "VPN, confirm any HTTP_PROXY/HTTPS_PROXY/NO_PROXY settings are correct, " + "then retry.";
21760
- var LOCAL_PERMISSION_ERROR_CODES = new Set(["EACCES", "EPERM", "EROFS"]);
21761
- var LOCAL_PERMISSION_MESSAGE_PATTERN = /\b(EACCES|EPERM|EROFS)\b/;
21811
+ var LOCAL_PERMISSION_MESSAGE_PATTERN = new RegExp(`\\b(${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})\\b`);
21762
21812
  function localPermissionInstructions(code2, path) {
21763
21813
  const target = path !== undefined ? `'${path}'` : "a local file or resource";
21764
21814
  if (code2 === "EROFS") {
21765
21815
  return `The filesystem containing ${target} is read-only (EROFS), so the ` + "CLI could not write to it. This is a local environment problem, " + "not a UiPath service error — retrying will not help. Use a " + "writable location, or give this environment write access to the " + "path.";
21766
21816
  }
21767
- const remedy = process.platform === "win32" ? "Re-run from an elevated terminal, close any program holding " + "the file open, or grant your user access to the path." : "Grant this user (or the sandbox the command runs in) access " + "to the path, or run the command outside the sandbox.";
21817
+ const onWindows = typeof process !== "undefined" && process.platform === "win32";
21818
+ const remedy = onWindows ? "Re-run from an elevated terminal, close any program holding " + "the file open, or grant your user access to the path." : "Grant this user (or the sandbox the command runs in) access " + "to the path, or run the command outside the sandbox.";
21768
21819
  return `The operating system denied access to ${target} (${code2}). This is ` + "a local permission problem, not a UiPath service error — retrying " + `without a permission change will not help. ${remedy}`;
21769
21820
  }
21770
21821
  function carriedInstructions(error) {
@@ -21855,48 +21906,6 @@ function localPermissionPath(path, message) {
21855
21906
  return path;
21856
21907
  return message ? /'([^']+)'/.exec(message)?.[1] : undefined;
21857
21908
  }
21858
- function* walkErrorGraph(error) {
21859
- const queue2 = [error];
21860
- const seen = new Set;
21861
- for (let steps = 0;queue2.length > 0 && steps < 32; steps++) {
21862
- const current = queue2.shift();
21863
- if (current === null || typeof current !== "object")
21864
- continue;
21865
- if (seen.has(current))
21866
- continue;
21867
- seen.add(current);
21868
- const cur = current;
21869
- yield cur;
21870
- if (cur.cause !== undefined)
21871
- queue2.push(cur.cause);
21872
- if (Array.isArray(cur.errors))
21873
- queue2.push(...cur.errors);
21874
- }
21875
- return;
21876
- }
21877
- function parseHttpStatusFromMessage(message) {
21878
- const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
21879
- if (!match)
21880
- return;
21881
- const status = Number(match[1]);
21882
- return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
21883
- }
21884
- function findHttpStatusInGraph(error) {
21885
- for (const node of walkErrorGraph(error)) {
21886
- const response = node.response;
21887
- const explicit = typeof node.status === "number" ? node.status : response?.status;
21888
- if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
21889
- return explicit;
21890
- }
21891
- if (typeof node.message === "string") {
21892
- const parsed = parseHttpStatusFromMessage(node.message);
21893
- if (parsed !== undefined && parsed >= 400) {
21894
- return parsed;
21895
- }
21896
- }
21897
- }
21898
- return;
21899
- }
21900
21909
  function isHtmlDocument(body) {
21901
21910
  return /^\s*(<!doctype html|<html\b)/i.test(body);
21902
21911
  }
@@ -22469,6 +22478,49 @@ function configureLogger(config) {
22469
22478
  logger.setLogFile(config.logFile);
22470
22479
  }
22471
22480
  }
22481
+ // src/mime-types.ts
22482
+ var OCTET_STREAM = "application/octet-stream";
22483
+ var MIME_TYPES_BY_EXTENSION = Object.freeze({
22484
+ pdf: "application/pdf",
22485
+ png: "image/png",
22486
+ jpg: "image/jpeg",
22487
+ jpeg: "image/jpeg",
22488
+ gif: "image/gif",
22489
+ webp: "image/webp",
22490
+ bmp: "image/bmp",
22491
+ tif: "image/tiff",
22492
+ tiff: "image/tiff",
22493
+ svg: "image/svg+xml",
22494
+ txt: "text/plain",
22495
+ log: "text/plain",
22496
+ md: "text/markdown",
22497
+ csv: "text/csv",
22498
+ tsv: "text/tab-separated-values",
22499
+ json: "application/json",
22500
+ xml: "application/xml",
22501
+ html: "text/html",
22502
+ htm: "text/html",
22503
+ yaml: "application/yaml",
22504
+ yml: "application/yaml",
22505
+ doc: "application/msword",
22506
+ docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
22507
+ xls: "application/vnd.ms-excel",
22508
+ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
22509
+ ppt: "application/vnd.ms-powerpoint",
22510
+ pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
22511
+ zip: "application/zip",
22512
+ mp3: "audio/mpeg",
22513
+ wav: "audio/wav",
22514
+ mp4: "video/mp4"
22515
+ });
22516
+ function mimeTypeForFileName(fileName) {
22517
+ const dot = fileName.lastIndexOf(".");
22518
+ if (dot < 0 || dot === fileName.length - 1) {
22519
+ return OCTET_STREAM;
22520
+ }
22521
+ const extension = fileName.slice(dot + 1).toLowerCase();
22522
+ return Object.hasOwn(MIME_TYPES_BY_EXTENSION, extension) ? MIME_TYPES_BY_EXTENSION[extension] : OCTET_STREAM;
22523
+ }
22472
22524
  // src/option-validators.ts
22473
22525
  function parseLimit(raw, _previous) {
22474
22526
  return parseBoundedInt(raw, "--limit", { min: 1, max: 1e4 });
@@ -23121,10 +23173,175 @@ function isTelemetryDisabled() {
23121
23173
  return value === "1" || value === "true";
23122
23174
  }
23123
23175
 
23176
+ // src/telemetry/telemetry-dimensions.ts
23177
+ var CLI_APPLICATION_NAME = "UiPath.Cli";
23178
+ var BaseDimensions = {
23179
+ ApplicationName: "ApplicationName",
23180
+ ProductVersion: "ProductVersion",
23181
+ InstallationId: "InstallationId",
23182
+ CloudUserId: "CloudUserId",
23183
+ CloudTenantId: "CloudTenantId",
23184
+ CloudOrganizationId: "CloudOrganizationId",
23185
+ IsInternalUser: "IsInternalUser",
23186
+ Environment: "Environment",
23187
+ BaseUrl: "BaseUrl",
23188
+ Region: "Region",
23189
+ Agent: "Agent",
23190
+ AgentVersion: "AgentVersion",
23191
+ AgentModel: "AgentModel",
23192
+ ToolName: "ToolName",
23193
+ ToolVersion: "ToolVersion",
23194
+ ExecutionContext: "ExecutionContext",
23195
+ CiProvider: "CiProvider",
23196
+ SessionIdSource: "SessionIdSource",
23197
+ SessionId: "SessionId"
23198
+ };
23199
+ var CommandDimensions = {
23200
+ IsCommand: "IsCommand",
23201
+ IsReexec: "IsReexec",
23202
+ CommandName: "CommandName",
23203
+ ExitCode: "ExitCode",
23204
+ TerminalOutcome: "TerminalOutcome",
23205
+ ErrorClass: "ErrorClass",
23206
+ TerminalSignal: "TerminalSignal",
23207
+ ErrorMessage: "ErrorMessage",
23208
+ SkillName: "SkillName",
23209
+ ProductArea: "ProductArea",
23210
+ Mode: "Mode"
23211
+ };
23212
+ var ShipDimensions = {
23213
+ ShipKind: "ShipKind",
23214
+ Target: "Target",
23215
+ ProjectType: "ProjectType",
23216
+ ProjectTypes: "ProjectTypes",
23217
+ ArtifactCorrelationKey: "ArtifactCorrelationKey",
23218
+ PackageName: "PackageName",
23219
+ PackageVersion: "PackageVersion",
23220
+ PackageVersionKey: "PackageVersionKey",
23221
+ DeploymentKey: "DeploymentKey",
23222
+ SolutionId: "SolutionId",
23223
+ FolderKey: "FolderKey",
23224
+ FeedId: "FeedId"
23225
+ };
23226
+ var ErrorDimensions = {
23227
+ Result: "Result",
23228
+ ErrorCode: "ErrorCode",
23229
+ Retry: "Retry",
23230
+ ErrorMessage: "ErrorMessage"
23231
+ };
23232
+ var AuthDimensions = {
23233
+ AuthenticationMethod: "AuthenticationMethod",
23234
+ Success: "Success",
23235
+ Reason: "Reason"
23236
+ };
23237
+ var SkillsDimensions = {
23238
+ SchemaVersion: "SchemaVersion",
23239
+ AgentType: "AgentType",
23240
+ SkillsVersion: "SkillsVersion",
23241
+ UipSubcommand: "UipSubcommand",
23242
+ FileExtension: "FileExtension",
23243
+ SubagentModel: "SubagentModel",
23244
+ SubagentType: "SubagentType",
23245
+ PermissionMode: "PermissionMode",
23246
+ EffortLevel: "EffortLevel",
23247
+ SessionSource: "SessionSource",
23248
+ Outcome: "Outcome",
23249
+ DurationMs: "DurationMs",
23250
+ Source: "Source"
23251
+ };
23252
+ var PackagerDimensions = {
23253
+ ProjectId: "ProjectId",
23254
+ ProjectType: "ProjectType",
23255
+ SolutionId: "SolutionId"
23256
+ };
23257
+ var ScopeDimensions = {
23258
+ FolderId: "FolderId"
23259
+ };
23260
+ var ID_DIMENSIONS = new Set([
23261
+ BaseDimensions.CloudUserId,
23262
+ BaseDimensions.CloudTenantId,
23263
+ BaseDimensions.CloudOrganizationId,
23264
+ BaseDimensions.InstallationId,
23265
+ ShipDimensions.ArtifactCorrelationKey,
23266
+ ShipDimensions.PackageVersionKey,
23267
+ ShipDimensions.DeploymentKey,
23268
+ ShipDimensions.SolutionId,
23269
+ ShipDimensions.FolderKey,
23270
+ ShipDimensions.FeedId,
23271
+ PackagerDimensions.ProjectId
23272
+ ]);
23273
+ var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
23274
+ var DIMENSION_NAME_EXEMPT_PREFIXES = [
23275
+ "uip.cmd.arg.",
23276
+ "server.",
23277
+ "http."
23278
+ ];
23279
+ function isExemptDimensionName(name) {
23280
+ return DIMENSION_NAME_EXEMPT_PREFIXES.some((prefix) => name.startsWith(prefix));
23281
+ }
23282
+ var DIMENSION_NAME_PATTERN = /^[A-Z][A-Za-z0-9]*$/;
23283
+ var EVENT_NAME_PATTERN = /^[A-Z][A-Za-z0-9]*\.[A-Z][A-Za-z0-9]*$/;
23284
+ var RESERVED_DIMENSION_NAMES = new Set([
23285
+ ...Object.values(BaseDimensions),
23286
+ ...Object.values(CommandDimensions),
23287
+ ...Object.values(ShipDimensions),
23288
+ ...Object.values(ErrorDimensions),
23289
+ ...Object.values(AuthDimensions),
23290
+ ...Object.values(SkillsDimensions),
23291
+ ...Object.values(PackagerDimensions),
23292
+ ...Object.values(ScopeDimensions)
23293
+ ]);
23294
+ var CURATED_DIMENSIONS = new Set([
23295
+ BaseDimensions.ApplicationName,
23296
+ BaseDimensions.ProductVersion,
23297
+ BaseDimensions.InstallationId,
23298
+ BaseDimensions.CloudUserId,
23299
+ BaseDimensions.CloudTenantId,
23300
+ BaseDimensions.CloudOrganizationId,
23301
+ BaseDimensions.IsInternalUser,
23302
+ BaseDimensions.Environment,
23303
+ BaseDimensions.BaseUrl,
23304
+ BaseDimensions.Region,
23305
+ BaseDimensions.Agent,
23306
+ BaseDimensions.AgentVersion,
23307
+ BaseDimensions.ToolVersion,
23308
+ BaseDimensions.ExecutionContext,
23309
+ BaseDimensions.CiProvider,
23310
+ BaseDimensions.SessionIdSource,
23311
+ BaseDimensions.SessionId,
23312
+ ...Object.values(CommandDimensions),
23313
+ ...Object.values(ShipDimensions)
23314
+ ]);
23315
+ function assertNoCuratedDimensionTargets(map, mapName) {
23316
+ for (const [inputKey, dimension] of Object.entries(map)) {
23317
+ if (CURATED_DIMENSIONS.has(dimension)) {
23318
+ throw new Error(`${mapName}: input field "${inputKey}" maps to curated dimension "${dimension}"`);
23319
+ }
23320
+ }
23321
+ }
23322
+ function lowercaseIdDimensionValues(properties) {
23323
+ let changed = false;
23324
+ const result = {
23325
+ ...properties
23326
+ };
23327
+ for (const key of Object.keys(result)) {
23328
+ const value = result[key];
23329
+ if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
23330
+ continue;
23331
+ }
23332
+ const lowered = value.toLowerCase();
23333
+ if (lowered !== value) {
23334
+ result[key] = lowered;
23335
+ changed = true;
23336
+ }
23337
+ }
23338
+ return changed ? result : properties;
23339
+ }
23340
+
23124
23341
  // src/sdk-user-agent.ts
23125
23342
  var USER_AGENT_HEADER = "User-Agent";
23126
23343
  var CODING_AGENT_HEADER = "x-coding-agent-info";
23127
- var AGENT_PROPERTY = "agent";
23344
+ var AGENT_PROPERTY = BaseDimensions.Agent;
23128
23345
  var CODING_AGENT_PROPERTY = "CodingAgent";
23129
23346
  var sdkUserAgentHostToken = singleton("SdkUserAgentHostToken");
23130
23347
  function userAgentPatchKey(userAgent) {
@@ -23257,7 +23474,7 @@ var LEGACY_SKILL_NAMESPACE = "uipath:";
23257
23474
  var MAX_SKILL_NAME_LENGTH = 80;
23258
23475
  var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
23259
23476
  function productMode(productArea, mode) {
23260
- return { product_area: productArea, mode };
23477
+ return { ProductArea: productArea, Mode: mode };
23261
23478
  }
23262
23479
  function attributionRecord(groups) {
23263
23480
  const record = {};
@@ -23315,6 +23532,7 @@ var COMMAND_ATTRIBUTION = commandAttribution([
23315
23532
  ["rpa", "build", ["uip.rpa-legacy"]],
23316
23533
  ["conversational", "operate", ["uip.conversational"]],
23317
23534
  ["agents", "build", ["uip.codedagent", "uip.agent"]],
23535
+ ["coding-agents", "build", ["uip.coder"]],
23318
23536
  ["agenthub", "build", ["uip.agenthub"]],
23319
23537
  ["coded-apps", "build", ["uip.codedapp"]],
23320
23538
  ["functions", "build", ["uip.function", "uip.functions"]],
@@ -23405,7 +23623,7 @@ function normalizeLegacySkillName(value) {
23405
23623
  function buildCommandTelemetryAttribution(commandPath, skillSource) {
23406
23624
  const skillName = normalizeSkillName(skillSource);
23407
23625
  return {
23408
- ...skillName ? { skill_name: skillName } : {},
23626
+ ...skillName ? { SkillName: skillName } : {},
23409
23627
  ...getCommandProductModeAttribution(commandPath)
23410
23628
  };
23411
23629
  }
@@ -23416,15 +23634,38 @@ function buildSkillEventTelemetryAttribution(skillSource, uipSubcommand) {
23416
23634
  return {
23417
23635
  ...skillAttribution,
23418
23636
  ...commandAttribution2,
23419
- ...skillName ? { skill_name: skillName } : {}
23637
+ ...skillName ? { SkillName: skillName } : {}
23420
23638
  };
23421
23639
  }
23640
+ var AGENT_SESSION_ENV = {
23641
+ [BaseDimensions.AgentModel]: "UIPATH_AGENT_MODEL",
23642
+ [SkillsDimensions.PermissionMode]: "UIPATH_PERMISSION_MODE",
23643
+ [SkillsDimensions.EffortLevel]: "UIPATH_EFFORT_LEVEL",
23644
+ [SkillsDimensions.SkillsVersion]: "UIPATH_SKILLS_VERSION"
23645
+ };
23646
+ var MAX_TELEMETRY_TOKEN_LENGTH = 120;
23647
+ function sanitizeTelemetryToken(value) {
23648
+ return value.replace(/[^A-Za-z0-9:._/ -]/g, "_").slice(0, MAX_TELEMETRY_TOKEN_LENGTH);
23649
+ }
23650
+ function buildAgentSessionTelemetry(env2) {
23651
+ const dimensions = {};
23652
+ for (const [key, variable] of Object.entries(AGENT_SESSION_ENV)) {
23653
+ const value = env2[variable]?.trim();
23654
+ if (value) {
23655
+ dimensions[key] = sanitizeTelemetryToken(value);
23656
+ }
23657
+ }
23658
+ return dimensions;
23659
+ }
23422
23660
  // src/telemetry/command-terminal.ts
23423
23661
  var recordedFailureSlot = singleton("CommandTelemetryFailure");
23424
23662
  var AUTH_ERROR_CODES = new Set([
23425
23663
  "authentication_required",
23426
23664
  "permission_denied"
23427
23665
  ]);
23666
+ var LOCAL_PERMISSION_CLI_ERROR_CODES = new Set([
23667
+ "local_permission_denied"
23668
+ ]);
23428
23669
  var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
23429
23670
  var NETWORK_HTTP_ERROR_CODES = new Set([
23430
23671
  "network_error",
@@ -23565,6 +23806,9 @@ function classifyFromErrorCode(errorCode) {
23565
23806
  if (AUTH_ERROR_CODES.has(errorCode)) {
23566
23807
  return "auth";
23567
23808
  }
23809
+ if (LOCAL_PERMISSION_CLI_ERROR_CODES.has(errorCode)) {
23810
+ return "local_permission";
23811
+ }
23568
23812
  if (VALIDATION_ERROR_CODES.has(errorCode)) {
23569
23813
  return "validation";
23570
23814
  }
@@ -23576,6 +23820,15 @@ function classifyFromErrorCode(errorCode) {
23576
23820
  }
23577
23821
  return;
23578
23822
  }
23823
+ function hasLocalPermissionCode(error) {
23824
+ for (const node of walkErrorGraph(error)) {
23825
+ const code2 = node.code;
23826
+ if (typeof code2 === "string" && LOCAL_PERMISSION_ERROR_CODES.has(code2)) {
23827
+ return true;
23828
+ }
23829
+ }
23830
+ return false;
23831
+ }
23579
23832
  function classifyFromError(error) {
23580
23833
  const code2 = findCodeInCauseChain(error);
23581
23834
  if (code2) {
@@ -23592,6 +23845,9 @@ function classifyFromError(error) {
23592
23845
  return "missing_dependency";
23593
23846
  }
23594
23847
  }
23848
+ if (hasLocalPermissionCode(error)) {
23849
+ return "local_permission";
23850
+ }
23595
23851
  const message = stringField(error, "message");
23596
23852
  if (message?.includes("fetch failed") === true) {
23597
23853
  return "network_http";
@@ -23607,7 +23863,7 @@ function classifyError2(input) {
23607
23863
  if (recorded?.errorClass) {
23608
23864
  return recorded.errorClass;
23609
23865
  }
23610
- const status = recorded?.context?.httpStatus;
23866
+ const status = recorded?.context?.httpStatus ?? findHttpStatusInGraph(input.error);
23611
23867
  if (status !== undefined) {
23612
23868
  return classifyHttpStatus(status);
23613
23869
  }
@@ -23633,10 +23889,10 @@ function buildCommandTerminalTelemetryProperties(input) {
23633
23889
  const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError2(input);
23634
23890
  const terminalSignal = terminalSignalFor(input, outcome);
23635
23891
  return {
23636
- exit_code: input.exitCode,
23637
- terminal_outcome: outcome,
23638
- ...errorClass ? { error_class: errorClass } : {},
23639
- ...terminalSignal ? { terminal_signal: terminalSignal } : {}
23892
+ [CommandDimensions.ExitCode]: input.exitCode,
23893
+ [CommandDimensions.TerminalOutcome]: outcome,
23894
+ ...errorClass ? { [CommandDimensions.ErrorClass]: errorClass } : {},
23895
+ ...terminalSignal ? { [CommandDimensions.TerminalSignal]: terminalSignal } : {}
23640
23896
  };
23641
23897
  }
23642
23898
  // src/telemetry/console-telemetry-provider.ts
@@ -23691,7 +23947,7 @@ function getInboundTraceContext() {
23691
23947
  var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
23692
23948
  var SESSION_ID_MAX_LENGTH = 64;
23693
23949
  var RANDOM_SESSION_ID_LENGTH = 32;
23694
- var TELEMETRY_SESSION_SOURCE_PROPERTY = "session_id_source";
23950
+ var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
23695
23951
  var CONTROL_CHARACTERS = /\p{Cc}/gu;
23696
23952
  var INHERITED_SESSION_SOURCES = [
23697
23953
  { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
@@ -23761,8 +24017,9 @@ function getTelemetryOperationId() {
23761
24017
  }
23762
24018
  // src/telemetry/telemetry-events.ts
23763
24019
  var CommonTelemetryEvents = {
23764
- Error: "uip.error",
23765
- ShipSucceeded: "uip.ship.succeeded"
24020
+ Start: "Application.Start",
24021
+ Error: "Application.Error",
24022
+ ShipSucceeded: "Cli.ShipSucceeded"
23766
24023
  };
23767
24024
  // src/telemetry/detect-agent.ts
23768
24025
  var KNOWN_AGENTS = [
@@ -23889,8 +24146,8 @@ function detectExecutionContext(options = {}) {
23889
24146
  function getExecutionContextTelemetryProperties() {
23890
24147
  const detected = detectExecutionContext();
23891
24148
  return {
23892
- execution_context: detected.executionContext,
23893
- ...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
24149
+ [BaseDimensions.ExecutionContext]: detected.executionContext,
24150
+ ...detected.ciProvider ? { [BaseDimensions.CiProvider]: detected.ciProvider } : {}
23894
24151
  };
23895
24152
  }
23896
24153
 
@@ -23955,7 +24212,10 @@ class TelemetryService {
23955
24212
  } catch (error) {
23956
24213
  const durationMs = clock.elapsedMs();
23957
24214
  const err = error instanceof Error ? error : new Error(String(error));
23958
- await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, { ...properties, errorMessage: err.message }, context));
24215
+ await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, {
24216
+ ...properties,
24217
+ [CommandDimensions.ErrorMessage]: err.message
24218
+ }, context));
23959
24219
  throw error;
23960
24220
  }
23961
24221
  }
@@ -24026,7 +24286,10 @@ class TelemetryService {
24026
24286
  const durationMs = clock.elapsedMs();
24027
24287
  const err = error instanceof Error ? error : new Error(String(error));
24028
24288
  await this.telemetryProvider.trackDependency({
24029
- ...this.spanFor(name, durationMs, false, { ...properties, errorMessage: err.message }, childContext),
24289
+ ...this.spanFor(name, durationMs, false, {
24290
+ ...properties,
24291
+ [CommandDimensions.ErrorMessage]: err.message
24292
+ }, childContext),
24030
24293
  type
24031
24294
  });
24032
24295
  throw error;
@@ -24061,9 +24324,10 @@ class TelemetryService {
24061
24324
  ...globalProperties,
24062
24325
  ...this.defaultProperties,
24063
24326
  ...redactProperties(properties ?? {}),
24064
- [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource()
24327
+ [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
24328
+ [BaseDimensions.SessionId]: this.telemetryProvider.getSessionId?.() ?? getTelemetrySessionId()
24065
24329
  };
24066
- return enriched;
24330
+ return lowercaseIdDimensionValues(enriched);
24067
24331
  }
24068
24332
  generateId() {
24069
24333
  const bytes = new Uint8Array(8);
@@ -24330,9 +24594,14 @@ async function loadPackagerTool(specifier) {
24330
24594
  }
24331
24595
  export {
24332
24596
  AUTH_FILENAME,
24597
+ AuthDimensions,
24333
24598
  BACKOFF_DEFAULTS,
24599
+ BaseDimensions,
24334
24600
  BrowserContextStorage,
24601
+ CLI_APPLICATION_NAME,
24335
24602
  CONFIG_FILENAME,
24603
+ CURATED_DIMENSIONS,
24604
+ CommandDimensions,
24336
24605
  CommonTelemetryEvents,
24337
24606
  ConsoleTelemetryProvider,
24338
24607
  DEFAULT_AUTH_TIMEOUT_MS,
@@ -24341,13 +24610,25 @@ export {
24341
24610
  DEFAULT_LOG_LEVEL,
24342
24611
  DEFAULT_PAGE_SIZE,
24343
24612
  DEFAULT_REDIRECT_URI,
24613
+ DIMENSION_NAME_EXEMPT_PREFIXES,
24614
+ DIMENSION_NAME_PATTERN,
24615
+ EVENT_NAME_PATTERN,
24344
24616
  ErrorDecision,
24617
+ ErrorDimensions,
24618
+ ID_DIMENSIONS,
24345
24619
  LogLevel,
24620
+ MIME_TYPES_BY_EXTENSION,
24346
24621
  MIN_INTERVAL_MS,
24622
+ OCTET_STREAM,
24347
24623
  OUTPUT_FORMATS,
24348
24624
  POLL_DEFAULTS,
24625
+ PackagerDimensions,
24349
24626
  PollOutcome,
24627
+ RESERVED_DIMENSION_NAMES,
24628
+ ScopeDimensions,
24350
24629
  ScreenLogger,
24630
+ ShipDimensions,
24631
+ SkillsDimensions,
24351
24632
  TELEMETRY_SESSION_ID_ENV,
24352
24633
  TELEMETRY_SESSION_SOURCE_PROPERTY,
24353
24634
  TIMINGS_ENV_VAR,
@@ -24357,8 +24638,10 @@ export {
24357
24638
  UIPATH_HOME_DIR,
24358
24639
  addSdkCodingAgentHeader,
24359
24640
  addSdkUserAgentHeader,
24641
+ assertNoCuratedDimensionTargets,
24360
24642
  buildActionCenterInboxUrl,
24361
24643
  buildActionCenterTaskUrl,
24644
+ buildAgentSessionTelemetry,
24362
24645
  buildCommandTelemetryAttribution,
24363
24646
  buildCommandTerminalTelemetryProperties,
24364
24647
  buildOrchestratorUrl,
@@ -24403,6 +24686,7 @@ export {
24403
24686
  instructionsFor,
24404
24687
  invocationElapsedMs,
24405
24688
  invocationStartedAt,
24689
+ isExemptDimensionName,
24406
24690
  isFailureStatus,
24407
24691
  isGuid,
24408
24692
  isHtmlDocument,
@@ -24410,10 +24694,12 @@ export {
24410
24694
  isSuccessStatus,
24411
24695
  isTerminalStatus,
24412
24696
  logger,
24697
+ lowercaseIdDimensionValues,
24413
24698
  mapPackageMetadataOptions,
24414
24699
  mapPollFailure,
24415
24700
  markCommandStart,
24416
24701
  markLongLivedHost,
24702
+ mimeTypeForFileName,
24417
24703
  msToDuration,
24418
24704
  normalizeSkillName,
24419
24705
  parseBoundedInt,
@@ -24435,6 +24721,7 @@ export {
24435
24721
  restoreConsole,
24436
24722
  runWithSink,
24437
24723
  runWithTimings,
24724
+ sanitizeTelemetryToken,
24438
24725
  setExitCode,
24439
24726
  setGlobalLogFilePath,
24440
24727
  setGlobalSink,
@@ -24455,4 +24742,4 @@ export {
24455
24742
  withCompleter
24456
24743
  };
24457
24744
 
24458
- //# debugId=37F07319EF673DA664756E2164756E21
24745
+ //# debugId=77A2D11E304F06D664756E2164756E21
package/dist/index.d.ts CHANGED
@@ -21,6 +21,7 @@ export * from "./guid";
21
21
  export * from "./host-global-options";
22
22
  export * from "./interactivity-context";
23
23
  export * from "./logger";
24
+ export * from "./mime-types";
24
25
  export * from "./option-aliases";
25
26
  export * from "./option-validators";
26
27
  export * from "./orchestrator-urls";
@@ -40,7 +41,7 @@ export * from "./solution-project-types";
40
41
  export * from "./stdin";
41
42
  export { BrowserContextStorage } from "./telemetry/browser-context-storage.js";
42
43
  export * from "./telemetry/command-attribution.js";
43
- export { commandTelemetryName, TELEMETRY_COMMAND_ROOT, } from "./telemetry/command-name.js";
44
+ export { CLI_COMMAND_ROOT, commandInvocationPath, commandTelemetryName, TELEMETRY_COMMAND_ROOT, TELEMETRY_NAME_BARE_ACTION, TELEMETRY_NAME_ROOT, } from "./telemetry/command-name.js";
44
45
  export * from "./telemetry/command-terminal.js";
45
46
  export { ConsoleTelemetryProvider } from "./telemetry/console-telemetry-provider.js";
46
47
  export { emitInvocationRequest, ensureInvocationRequestScope, getInvocationRequestContext, resetInvocationRequest, runWithInvocationRequest, } from "./telemetry/invocation-request.js";
@@ -52,6 +53,7 @@ export { getProxyAuthHttpsAgent, setProxyAuthHttpsAgent, } from "./telemetry/pro
52
53
  export { pseudonymize } from "./telemetry/pseudonymize.js";
53
54
  export { type ShipSucceededTelemetryPayload, trackShipSucceeded, } from "./telemetry/ship-succeeded.js";
54
55
  export { clearSuppliedArgumentValues, getSuppliedArgumentValues, recordSuppliedArgumentValues, releaseSuppliedArgumentValues, } from "./telemetry/supplied-values.js";
56
+ export * from "./telemetry/telemetry-dimensions.js";
55
57
  export * from "./telemetry/telemetry-events.js";
56
58
  export * from "./telemetry/telemetry-init.js";
57
59
  export * from "./telemetry/telemetry-spool.js";