@uipath/platform-tool 1.203.0-preview.212 → 1.204.0-preview.211

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.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  Command,
4
4
  metadata,
5
5
  registerCommands
6
- } from "./tool-ewe20fdh.js";
6
+ } from "./tool-4k5h4ke6.js";
7
7
  import"./tool-1de529jm.js";
8
8
 
9
9
  // src/index.ts
@@ -27337,7 +27337,7 @@ var package_default = {
27337
27337
  name: "@uipath/platform-tool",
27338
27338
  author: "UiPath",
27339
27339
  license: "SEE LICENSE IN LICENSE.txt",
27340
- version: "1.203.0-preview.212",
27340
+ version: "1.204.0-preview.211",
27341
27341
  description: "Manage UiPath platform-level resources such as tenant licensing.",
27342
27342
  publishConfig: {
27343
27343
  registry: "https://npm.pkg.github.com/"
@@ -27918,6 +27918,11 @@ var pickName = (claims) => {
27918
27918
  const username = asString(claims?.preferred_username);
27919
27919
  return asString(claims?.name) ?? (looksLikeEmail(username) ? undefined : username);
27920
27920
  };
27921
+ var pickScopes = (claims) => {
27922
+ const raw = claims?.scope;
27923
+ const scopes = Array.isArray(raw) ? raw.filter((entry) => asString(entry) !== undefined) : typeof raw === "string" ? raw.split(/\s+/).filter(Boolean) : [];
27924
+ return scopes.length > 0 ? scopes : undefined;
27925
+ };
27921
27926
  var resolveSessionIdentity = (accessToken, authFlow) => {
27922
27927
  const claims = accessToken ? decodeClaims(accessToken) : undefined;
27923
27928
  const email = pickEmail(claims);
@@ -27943,6 +27948,7 @@ var resolveSessionIdentity = (accessToken, authFlow) => {
27943
27948
  identity.clientId = clientId;
27944
27949
  return identity;
27945
27950
  };
27951
+ var readTokenScopes = (accessToken) => accessToken ? pickScopes(decodeClaims(accessToken)) : undefined;
27946
27952
 
27947
27953
  // ../auth/src/envAuth.ts
27948
27954
  var ENV_AUTH_ENABLE_VAR = "UIPATH_CLI_ENABLE_ENV_AUTH";
@@ -28015,6 +28021,7 @@ var readAuthFromEnv = () => {
28015
28021
  const expiration = getTokenExpiration(accessToken);
28016
28022
  const loginStatus = expiration && expiration <= new Date ? "Expired" : "Logged in";
28017
28023
  const identity = resolveSessionIdentity(accessToken);
28024
+ const scopes = readTokenScopes(accessToken);
28018
28025
  return {
28019
28026
  loginStatus,
28020
28027
  accessToken,
@@ -28025,7 +28032,8 @@ var readAuthFromEnv = () => {
28025
28032
  tenantId,
28026
28033
  expiration,
28027
28034
  source: "env-vars" /* EnvironmentVariables */,
28028
- ...identity ? { identity } : {}
28035
+ ...identity ? { identity } : {},
28036
+ ...scopes ? { scopes } : {}
28029
28037
  };
28030
28038
  };
28031
28039
 
@@ -28663,10 +28671,15 @@ async function buildFileStatus(tokens, credentials, globalHint) {
28663
28671
  }
28664
28672
  function identityFields(accessToken, credentials) {
28665
28673
  const identity = resolveSessionIdentity(accessToken, parseAuthFlow(credentials[AUTH_FLOW_ENV_VAR]));
28666
- return identity ? { identity } : {};
28674
+ const scopes = readTokenScopes(accessToken);
28675
+ return {
28676
+ ...identity ? { identity } : {},
28677
+ ...scopes ? { scopes } : {}
28678
+ };
28667
28679
  }
28668
28680
  function buildRobotStatus(robotCreds) {
28669
28681
  const identity = resolveSessionIdentity(robotCreds.accessToken);
28682
+ const scopes = readTokenScopes(robotCreds.accessToken);
28670
28683
  return {
28671
28684
  loginStatus: "Logged in",
28672
28685
  accessToken: robotCreds.accessToken,
@@ -28678,7 +28691,8 @@ function buildRobotStatus(robotCreds) {
28678
28691
  issuer: robotCreds.issuer,
28679
28692
  expiration: getTokenExpiration(robotCreds.accessToken),
28680
28693
  source: "robot" /* Robot */,
28681
- ...identity ? { identity } : {}
28694
+ ...identity ? { identity } : {},
28695
+ ...scopes ? { scopes } : {}
28682
28696
  };
28683
28697
  }
28684
28698
  var isFileNotFoundError = (error) => {
@@ -28945,7 +28959,8 @@ var getAuthContext = async (options = {}) => {
28945
28959
  organizationId: status.organizationId,
28946
28960
  organizationName: status.organizationName,
28947
28961
  tenantId: status.tenantId,
28948
- tenantName
28962
+ tenantName,
28963
+ identity: status.identity
28949
28964
  };
28950
28965
  };
28951
28966
  // ../auth/src/tenantSelection.ts
@@ -29525,9 +29540,60 @@ function settlePromiseLike2(thenable) {
29525
29540
  return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [toError(error), undefined]);
29526
29541
  }
29527
29542
 
29543
+ // ../common/src/error-graph.ts
29544
+ function* walkErrorGraph(error) {
29545
+ const queue = [error];
29546
+ const seen = new Set;
29547
+ for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
29548
+ const current = queue.shift();
29549
+ if (current === null || typeof current !== "object")
29550
+ continue;
29551
+ if (seen.has(current))
29552
+ continue;
29553
+ seen.add(current);
29554
+ const cur = current;
29555
+ yield cur;
29556
+ if (cur.cause !== undefined)
29557
+ queue.push(cur.cause);
29558
+ if (Array.isArray(cur.errors))
29559
+ queue.push(...cur.errors);
29560
+ }
29561
+ return;
29562
+ }
29563
+ function parseHttpStatusFromMessage(message) {
29564
+ const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
29565
+ if (!match)
29566
+ return;
29567
+ const status = Number(match[1]);
29568
+ return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
29569
+ }
29570
+ function findHttpStatusInGraph(error) {
29571
+ for (const node of walkErrorGraph(error)) {
29572
+ const response = node.response;
29573
+ const explicit = typeof node.status === "number" ? node.status : response?.status;
29574
+ if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
29575
+ return explicit;
29576
+ }
29577
+ if (typeof node.message === "string") {
29578
+ const parsed = parseHttpStatusFromMessage(node.message);
29579
+ if (parsed !== undefined && parsed >= 400) {
29580
+ return parsed;
29581
+ }
29582
+ }
29583
+ }
29584
+ return;
29585
+ }
29586
+
29587
+ // ../common/src/local-permission-codes.ts
29588
+ var LOCAL_PERMISSION_ERROR_CODES = new Set([
29589
+ "EACCES",
29590
+ "EPERM",
29591
+ "EROFS"
29592
+ ]);
29593
+
29528
29594
  // ../common/src/error-handler.ts
29529
- var DEFAULT_401 = "Unauthorized (401). Run `uip login` to authenticate.";
29530
- var DEFAULT_403 = "Forbidden (403). Ensure the account has the required permissions.";
29595
+ 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.";
29596
+ 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.";
29531
29597
  var DEFAULT_405 = "Method Not Allowed (405). The endpoint may not exist or the base URL may be incorrect.";
29532
29598
  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.";
29533
29599
  var HTML_RESPONSE_MESSAGE = "Received HTML instead of the expected JSON response.";
@@ -29554,14 +29620,14 @@ var TLS_ERROR_CODES = new Set([
29554
29620
  ]);
29555
29621
  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.";
29556
29622
  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.";
29557
- var LOCAL_PERMISSION_ERROR_CODES = new Set(["EACCES", "EPERM", "EROFS"]);
29558
- var LOCAL_PERMISSION_MESSAGE_PATTERN = /\b(EACCES|EPERM|EROFS)\b/;
29623
+ var LOCAL_PERMISSION_MESSAGE_PATTERN = new RegExp(`\\b(${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})\\b`);
29559
29624
  function localPermissionInstructions(code, path2) {
29560
29625
  const target = path2 !== undefined ? `'${path2}'` : "a local file or resource";
29561
29626
  if (code === "EROFS") {
29562
29627
  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.";
29563
29628
  }
29564
- 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.";
29629
+ const onWindows = typeof process !== "undefined" && process.platform === "win32";
29630
+ 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.";
29565
29631
  return `The operating system denied access to ${target} (${code}). This is ` + "a local permission problem, not a UiPath service error — retrying " + `without a permission change will not help. ${remedy}`;
29566
29632
  }
29567
29633
  function describeConnectivityError(error) {
@@ -29615,48 +29681,6 @@ function localPermissionPath(path2, message) {
29615
29681
  return path2;
29616
29682
  return message ? /'([^']+)'/.exec(message)?.[1] : undefined;
29617
29683
  }
29618
- function* walkErrorGraph(error) {
29619
- const queue = [error];
29620
- const seen = new Set;
29621
- for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
29622
- const current = queue.shift();
29623
- if (current === null || typeof current !== "object")
29624
- continue;
29625
- if (seen.has(current))
29626
- continue;
29627
- seen.add(current);
29628
- const cur = current;
29629
- yield cur;
29630
- if (cur.cause !== undefined)
29631
- queue.push(cur.cause);
29632
- if (Array.isArray(cur.errors))
29633
- queue.push(...cur.errors);
29634
- }
29635
- return;
29636
- }
29637
- function parseHttpStatusFromMessage(message) {
29638
- const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
29639
- if (!match)
29640
- return;
29641
- const status = Number(match[1]);
29642
- return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
29643
- }
29644
- function findHttpStatusInGraph(error) {
29645
- for (const node of walkErrorGraph(error)) {
29646
- const response = node.response;
29647
- const explicit = typeof node.status === "number" ? node.status : response?.status;
29648
- if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
29649
- return explicit;
29650
- }
29651
- if (typeof node.message === "string") {
29652
- const parsed = parseHttpStatusFromMessage(node.message);
29653
- if (parsed !== undefined && parsed >= 400) {
29654
- return parsed;
29655
- }
29656
- }
29657
- }
29658
- return;
29659
- }
29660
29684
  function isHtmlDocument(body) {
29661
29685
  return /^\s*(<!doctype html|<html\b)/i.test(body);
29662
29686
  }
@@ -30178,12 +30202,162 @@ function getOutputFilter() {
30178
30202
  return filterSlot.get();
30179
30203
  }
30180
30204
 
30205
+ // ../common/src/telemetry/telemetry-dimensions.ts
30206
+ var BaseDimensions = {
30207
+ ApplicationName: "ApplicationName",
30208
+ ProductVersion: "ProductVersion",
30209
+ InstallationId: "InstallationId",
30210
+ CloudUserId: "CloudUserId",
30211
+ CloudTenantId: "CloudTenantId",
30212
+ CloudOrganizationId: "CloudOrganizationId",
30213
+ IsInternalUser: "IsInternalUser",
30214
+ Environment: "Environment",
30215
+ BaseUrl: "BaseUrl",
30216
+ Region: "Region",
30217
+ Agent: "Agent",
30218
+ AgentVersion: "AgentVersion",
30219
+ AgentModel: "AgentModel",
30220
+ ToolName: "ToolName",
30221
+ ToolVersion: "ToolVersion",
30222
+ ExecutionContext: "ExecutionContext",
30223
+ CiProvider: "CiProvider",
30224
+ SessionIdSource: "SessionIdSource",
30225
+ SessionId: "SessionId"
30226
+ };
30227
+ var CommandDimensions = {
30228
+ IsCommand: "IsCommand",
30229
+ IsReexec: "IsReexec",
30230
+ CommandName: "CommandName",
30231
+ ExitCode: "ExitCode",
30232
+ TerminalOutcome: "TerminalOutcome",
30233
+ ErrorClass: "ErrorClass",
30234
+ TerminalSignal: "TerminalSignal",
30235
+ ErrorMessage: "ErrorMessage",
30236
+ SkillName: "SkillName",
30237
+ ProductArea: "ProductArea",
30238
+ Mode: "Mode"
30239
+ };
30240
+ var ShipDimensions = {
30241
+ ShipKind: "ShipKind",
30242
+ Target: "Target",
30243
+ ProjectType: "ProjectType",
30244
+ ProjectTypes: "ProjectTypes",
30245
+ ArtifactCorrelationKey: "ArtifactCorrelationKey",
30246
+ PackageName: "PackageName",
30247
+ PackageVersion: "PackageVersion",
30248
+ PackageVersionKey: "PackageVersionKey",
30249
+ DeploymentKey: "DeploymentKey",
30250
+ SolutionId: "SolutionId",
30251
+ FolderKey: "FolderKey",
30252
+ FeedId: "FeedId"
30253
+ };
30254
+ var ErrorDimensions = {
30255
+ Result: "Result",
30256
+ ErrorCode: "ErrorCode",
30257
+ Retry: "Retry",
30258
+ ErrorMessage: "ErrorMessage"
30259
+ };
30260
+ var AuthDimensions = {
30261
+ AuthenticationMethod: "AuthenticationMethod",
30262
+ Success: "Success",
30263
+ Reason: "Reason"
30264
+ };
30265
+ var SkillsDimensions = {
30266
+ SchemaVersion: "SchemaVersion",
30267
+ AgentType: "AgentType",
30268
+ SkillsVersion: "SkillsVersion",
30269
+ UipSubcommand: "UipSubcommand",
30270
+ FileExtension: "FileExtension",
30271
+ SubagentModel: "SubagentModel",
30272
+ SubagentType: "SubagentType",
30273
+ PermissionMode: "PermissionMode",
30274
+ EffortLevel: "EffortLevel",
30275
+ SessionSource: "SessionSource",
30276
+ Outcome: "Outcome",
30277
+ DurationMs: "DurationMs",
30278
+ Source: "Source"
30279
+ };
30280
+ var PackagerDimensions = {
30281
+ ProjectId: "ProjectId",
30282
+ ProjectType: "ProjectType",
30283
+ SolutionId: "SolutionId"
30284
+ };
30285
+ var ScopeDimensions = {
30286
+ FolderId: "FolderId"
30287
+ };
30288
+ var ID_DIMENSIONS = new Set([
30289
+ BaseDimensions.CloudUserId,
30290
+ BaseDimensions.CloudTenantId,
30291
+ BaseDimensions.CloudOrganizationId,
30292
+ BaseDimensions.InstallationId,
30293
+ ShipDimensions.ArtifactCorrelationKey,
30294
+ ShipDimensions.PackageVersionKey,
30295
+ ShipDimensions.DeploymentKey,
30296
+ ShipDimensions.SolutionId,
30297
+ ShipDimensions.FolderKey,
30298
+ ShipDimensions.FeedId,
30299
+ PackagerDimensions.ProjectId
30300
+ ]);
30301
+ var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
30302
+ var RESERVED_DIMENSION_NAMES = new Set([
30303
+ ...Object.values(BaseDimensions),
30304
+ ...Object.values(CommandDimensions),
30305
+ ...Object.values(ShipDimensions),
30306
+ ...Object.values(ErrorDimensions),
30307
+ ...Object.values(AuthDimensions),
30308
+ ...Object.values(SkillsDimensions),
30309
+ ...Object.values(PackagerDimensions),
30310
+ ...Object.values(ScopeDimensions)
30311
+ ]);
30312
+ var CURATED_DIMENSIONS = new Set([
30313
+ BaseDimensions.ApplicationName,
30314
+ BaseDimensions.ProductVersion,
30315
+ BaseDimensions.InstallationId,
30316
+ BaseDimensions.CloudUserId,
30317
+ BaseDimensions.CloudTenantId,
30318
+ BaseDimensions.CloudOrganizationId,
30319
+ BaseDimensions.IsInternalUser,
30320
+ BaseDimensions.Environment,
30321
+ BaseDimensions.BaseUrl,
30322
+ BaseDimensions.Region,
30323
+ BaseDimensions.Agent,
30324
+ BaseDimensions.AgentVersion,
30325
+ BaseDimensions.ToolVersion,
30326
+ BaseDimensions.ExecutionContext,
30327
+ BaseDimensions.CiProvider,
30328
+ BaseDimensions.SessionIdSource,
30329
+ BaseDimensions.SessionId,
30330
+ ...Object.values(CommandDimensions),
30331
+ ...Object.values(ShipDimensions)
30332
+ ]);
30333
+ function lowercaseIdDimensionValues(properties) {
30334
+ let changed = false;
30335
+ const result = {
30336
+ ...properties
30337
+ };
30338
+ for (const key of Object.keys(result)) {
30339
+ const value = result[key];
30340
+ if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
30341
+ continue;
30342
+ }
30343
+ const lowered = value.toLowerCase();
30344
+ if (lowered !== value) {
30345
+ result[key] = lowered;
30346
+ changed = true;
30347
+ }
30348
+ }
30349
+ return changed ? result : properties;
30350
+ }
30351
+
30181
30352
  // ../common/src/telemetry/command-terminal.ts
30182
30353
  var recordedFailureSlot = singleton("CommandTelemetryFailure");
30183
30354
  var AUTH_ERROR_CODES = new Set([
30184
30355
  "authentication_required",
30185
30356
  "permission_denied"
30186
30357
  ]);
30358
+ var LOCAL_PERMISSION_CLI_ERROR_CODES = new Set([
30359
+ "local_permission_denied"
30360
+ ]);
30187
30361
  var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
30188
30362
  var NETWORK_HTTP_ERROR_CODES = new Set([
30189
30363
  "network_error",
@@ -30324,6 +30498,9 @@ function classifyFromErrorCode(errorCode2) {
30324
30498
  if (AUTH_ERROR_CODES.has(errorCode2)) {
30325
30499
  return "auth";
30326
30500
  }
30501
+ if (LOCAL_PERMISSION_CLI_ERROR_CODES.has(errorCode2)) {
30502
+ return "local_permission";
30503
+ }
30327
30504
  if (VALIDATION_ERROR_CODES.has(errorCode2)) {
30328
30505
  return "validation";
30329
30506
  }
@@ -30335,6 +30512,15 @@ function classifyFromErrorCode(errorCode2) {
30335
30512
  }
30336
30513
  return;
30337
30514
  }
30515
+ function hasLocalPermissionCode(error) {
30516
+ for (const node of walkErrorGraph(error)) {
30517
+ const code = node.code;
30518
+ if (typeof code === "string" && LOCAL_PERMISSION_ERROR_CODES.has(code)) {
30519
+ return true;
30520
+ }
30521
+ }
30522
+ return false;
30523
+ }
30338
30524
  function classifyFromError(error) {
30339
30525
  const code = findCodeInCauseChain(error);
30340
30526
  if (code) {
@@ -30351,6 +30537,9 @@ function classifyFromError(error) {
30351
30537
  return "missing_dependency";
30352
30538
  }
30353
30539
  }
30540
+ if (hasLocalPermissionCode(error)) {
30541
+ return "local_permission";
30542
+ }
30354
30543
  const message = stringField(error, "message");
30355
30544
  if (message?.includes("fetch failed") === true) {
30356
30545
  return "network_http";
@@ -30366,7 +30555,7 @@ function classifyError2(input) {
30366
30555
  if (recorded?.errorClass) {
30367
30556
  return recorded.errorClass;
30368
30557
  }
30369
- const status = recorded?.context?.httpStatus;
30558
+ const status = recorded?.context?.httpStatus ?? findHttpStatusInGraph(input.error);
30370
30559
  if (status !== undefined) {
30371
30560
  return classifyHttpStatus(status);
30372
30561
  }
@@ -30389,17 +30578,18 @@ function buildCommandTerminalTelemetryProperties(input) {
30389
30578
  const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError2(input);
30390
30579
  const terminalSignal = terminalSignalFor(input, outcome);
30391
30580
  return {
30392
- exit_code: input.exitCode,
30393
- terminal_outcome: outcome,
30394
- ...errorClass ? { error_class: errorClass } : {},
30395
- ...terminalSignal ? { terminal_signal: terminalSignal } : {}
30581
+ [CommandDimensions.ExitCode]: input.exitCode,
30582
+ [CommandDimensions.TerminalOutcome]: outcome,
30583
+ ...errorClass ? { [CommandDimensions.ErrorClass]: errorClass } : {},
30584
+ ...terminalSignal ? { [CommandDimensions.TerminalSignal]: terminalSignal } : {}
30396
30585
  };
30397
30586
  }
30398
30587
 
30399
30588
  // ../common/src/telemetry/telemetry-events.ts
30400
30589
  var CommonTelemetryEvents = {
30401
- Error: "uip.error",
30402
- ShipSucceeded: "uip.ship.succeeded"
30590
+ Start: "Application.Start",
30591
+ Error: "Application.Error",
30592
+ ShipSucceeded: "Cli.ShipSucceeded"
30403
30593
  };
30404
30594
 
30405
30595
  // ../common/src/registry.ts
@@ -30607,8 +30797,8 @@ function detectExecutionContext(options = {}) {
30607
30797
  function getExecutionContextTelemetryProperties() {
30608
30798
  const detected = detectExecutionContext();
30609
30799
  return {
30610
- execution_context: detected.executionContext,
30611
- ...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
30800
+ [BaseDimensions.ExecutionContext]: detected.executionContext,
30801
+ ...detected.ciProvider ? { [BaseDimensions.CiProvider]: detected.ciProvider } : {}
30612
30802
  };
30613
30803
  }
30614
30804
  // ../common/src/telemetry/node-context-storage.ts
@@ -30651,7 +30841,7 @@ function getInboundTraceContext() {
30651
30841
  var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
30652
30842
  var SESSION_ID_MAX_LENGTH = 64;
30653
30843
  var RANDOM_SESSION_ID_LENGTH = 32;
30654
- var TELEMETRY_SESSION_SOURCE_PROPERTY = "session_id_source";
30844
+ var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
30655
30845
  var CONTROL_CHARACTERS = /\p{Cc}/gu;
30656
30846
  var INHERITED_SESSION_SOURCES = [
30657
30847
  { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
@@ -30703,6 +30893,9 @@ function resolveTelemetrySession() {
30703
30893
  telemetrySessionSlot.set(resolved);
30704
30894
  return resolved;
30705
30895
  }
30896
+ function getTelemetrySessionId() {
30897
+ return resolveTelemetrySession().id;
30898
+ }
30706
30899
  function getTelemetrySessionSource() {
30707
30900
  return resolveTelemetrySession().source;
30708
30901
  }
@@ -30783,7 +30976,10 @@ class TelemetryService {
30783
30976
  } catch (error) {
30784
30977
  const durationMs = clock.elapsedMs();
30785
30978
  const err = error instanceof Error ? error : new Error(String(error));
30786
- await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, { ...properties, errorMessage: err.message }, context));
30979
+ await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, {
30980
+ ...properties,
30981
+ [CommandDimensions.ErrorMessage]: err.message
30982
+ }, context));
30787
30983
  throw error;
30788
30984
  }
30789
30985
  }
@@ -30854,7 +31050,10 @@ class TelemetryService {
30854
31050
  const durationMs = clock.elapsedMs();
30855
31051
  const err = error instanceof Error ? error : new Error(String(error));
30856
31052
  await this.telemetryProvider.trackDependency({
30857
- ...this.spanFor(name, durationMs, false, { ...properties, errorMessage: err.message }, childContext),
31053
+ ...this.spanFor(name, durationMs, false, {
31054
+ ...properties,
31055
+ [CommandDimensions.ErrorMessage]: err.message
31056
+ }, childContext),
30858
31057
  type
30859
31058
  });
30860
31059
  throw error;
@@ -30889,9 +31088,10 @@ class TelemetryService {
30889
31088
  ...globalProperties,
30890
31089
  ...this.defaultProperties,
30891
31090
  ...redactProperties(properties ?? {}),
30892
- [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource()
31091
+ [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
31092
+ [BaseDimensions.SessionId]: this.telemetryProvider.getSessionId?.() ?? getTelemetrySessionId()
30893
31093
  };
30894
- return enriched;
31094
+ return lowercaseIdDimensionValues(enriched);
30895
31095
  }
30896
31096
  generateId() {
30897
31097
  const bytes = new Uint8Array(8);
@@ -31685,7 +31885,165 @@ class FilterImplicitLimitError extends Error {
31685
31885
  this.instructions = "Pass --limit <n> to choose how many records the filter applies to. " + "To filter over all records, pass the command's maximum accepted --limit (see the option's description in --help).";
31686
31886
  }
31687
31887
  }
31688
- function applyFilter(data, filter) {
31888
+ function countRecords(data) {
31889
+ if (Array.isArray(data))
31890
+ return data.length;
31891
+ return data == null ? 0 : 1;
31892
+ }
31893
+ function availableFields(data) {
31894
+ const records = Array.isArray(data) ? data : [data];
31895
+ const keys = new Set;
31896
+ for (const record of records) {
31897
+ if (record && typeof record === "object" && !Array.isArray(record)) {
31898
+ for (const key of Object.keys(record))
31899
+ keys.add(key);
31900
+ }
31901
+ }
31902
+ return [...keys];
31903
+ }
31904
+ function decodeQuotedIdentifier(whole, inner) {
31905
+ const [error, decoded] = catchError2(() => JSON.parse(whole));
31906
+ if (!error && typeof decoded === "string")
31907
+ return decoded;
31908
+ return inner.replace(/\\(.)/g, "$1");
31909
+ }
31910
+ function referencedFields(filter) {
31911
+ const top = new Set;
31912
+ const nested = new Set;
31913
+ const withoutValueLiterals = filter.replace(/'(?:\\.|[^'\\])*'/g, " ").replace(/`(?:\\.|[^`\\])*`/g, " ");
31914
+ const isPathTail = (text, index) => text[index - 1] === "." && /[A-Za-z0-9_"]/.test(text[index - 2] ?? "");
31915
+ const quoted = [];
31916
+ const withoutLiterals = withoutValueLiterals.replace(/"((?:\\.|[^"\\])*)"/g, (whole, name, index) => {
31917
+ const isAlias = /^\s*:/.test(withoutValueLiterals.slice(index + whole.length));
31918
+ if (!isAlias) {
31919
+ quoted.push({
31920
+ name: decodeQuotedIdentifier(whole, name),
31921
+ index,
31922
+ tail: isPathTail(withoutValueLiterals, index)
31923
+ });
31924
+ }
31925
+ return `"${" ".repeat(whole.length - 2)}"`;
31926
+ });
31927
+ const descent = /[A-Za-z0-9_"]\s*[.[]/.exec(withoutLiterals);
31928
+ const rootEnd = descent ? descent.index + 1 : Number.POSITIVE_INFINITY;
31929
+ const place = (name, index, tail) => {
31930
+ if (tail || index >= rootEnd)
31931
+ nested.add(name);
31932
+ else
31933
+ top.add(name);
31934
+ };
31935
+ for (const entry of quoted)
31936
+ place(entry.name, entry.index, entry.tail);
31937
+ const identifiers = withoutLiterals.matchAll(/([A-Za-z_][A-Za-z0-9_]*)(\s*[:(])?/g);
31938
+ const reserved = new Set(["true", "false", "null", "and", "or", "not"]);
31939
+ for (const match of identifiers) {
31940
+ const [, name, trailing] = match;
31941
+ if (trailing || reserved.has(name))
31942
+ continue;
31943
+ place(name, match.index, isPathTail(withoutLiterals, match.index));
31944
+ }
31945
+ return {
31946
+ top: [...top],
31947
+ nested: [...nested].filter((name) => !top.has(name)),
31948
+ hasPredicate: /\[\s*\?/.test(withoutValueLiterals)
31949
+ };
31950
+ }
31951
+ function appearsBelowTopLevel(data, name) {
31952
+ let budget = 2000;
31953
+ const visit = (value, depth) => {
31954
+ if (budget-- <= 0 || depth > 4)
31955
+ return false;
31956
+ if (value === null || typeof value !== "object")
31957
+ return false;
31958
+ if (Array.isArray(value))
31959
+ return value.some((entry) => visit(entry, depth));
31960
+ const record = value;
31961
+ if (depth > 0 && Object.hasOwn(record, name))
31962
+ return true;
31963
+ return Object.values(record).some((entry) => visit(entry, depth + 1));
31964
+ };
31965
+ return visit(data, 0);
31966
+ }
31967
+ function alwaysNullKeys(records) {
31968
+ const objects = records.filter((r) => r != null && typeof r === "object" && !Array.isArray(r));
31969
+ if (objects.length === 0 || objects.length !== records.length)
31970
+ return [];
31971
+ const keys = [...new Set(objects.flatMap((o) => Object.keys(o)))];
31972
+ if (keys.length === 0)
31973
+ return [];
31974
+ const nullKeys = keys.filter((key) => objects.every((record) => record[key] === null));
31975
+ return nullKeys.length === keys.length ? nullKeys : [];
31976
+ }
31977
+ function carriesOnlyNulls(value) {
31978
+ if (value === null)
31979
+ return true;
31980
+ if (Array.isArray(value)) {
31981
+ return value.length > 0 && value.every(carriesOnlyNulls);
31982
+ }
31983
+ if (typeof value === "object" && value !== undefined) {
31984
+ const values = Object.values(value);
31985
+ return values.length > 0 && values.every(carriesOnlyNulls);
31986
+ }
31987
+ return false;
31988
+ }
31989
+ function nameList(names, cap2 = 12) {
31990
+ const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
31991
+ const rest = names.length - shown.length;
31992
+ return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
31993
+ }
31994
+ function buildFilterWarning(filter, data, outcome) {
31995
+ const present = availableFields(data);
31996
+ const refs = referencedFields(filter);
31997
+ const unknown = refs.top.filter((name) => !present.includes(name) && !appearsBelowTopLevel(data, name));
31998
+ const unchecked = refs.nested.filter((name) => !present.includes(name));
31999
+ const count = countRecords(data);
32000
+ const scope = `${count} record(s)`;
32001
+ const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
32002
+ const soundness = unchecked.length > 0 ? `${nameList(unchecked)} ${unchecked.length === 1 ? "reads" : "read"} below the top level, so ${unchecked.length === 1 ? "it was" : "they were"} not checked against the record keys` : refs.top.length > 0 ? "every field it names exists" : "";
32003
+ const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
32004
+ let detail;
32005
+ let lede;
32006
+ if (outcome.kind === "null-elements") {
32007
+ lede = "returned only null values";
32008
+ const projected = `all ${outcome.count} of the elements it projected are null`;
32009
+ if (unknown.length > 0) {
32010
+ detail = `${projected}, because ${isNotAField(unknown)}`;
32011
+ } else if (unchecked.length > 0) {
32012
+ detail = withSoundness(projected);
32013
+ } else {
32014
+ detail = `${projected}, and every field it names exists — a multi-select list ` + `(\`[A, B]\`) reads each entry against \`Data\` itself, so on a list ` + `result use \`[].[A, B]\` or \`[].{a: A, b: B}\` to read the records`;
32015
+ }
32016
+ } else if (outcome.kind === "null-rows") {
32017
+ lede = "returned only null values";
32018
+ const projected = `every value it projected is null on all ${outcome.count} row(s)`;
32019
+ detail = unknown.length > 0 ? `${projected}, because ${isNotAField(unknown)}` : withSoundness(projected);
32020
+ } else if (outcome.kind === "null-values") {
32021
+ lede = "returned only null values";
32022
+ const projected = `every key it projected (${nameList(outcome.keys)}) is null`;
32023
+ const sameSet = unknown.length === outcome.keys.length && outcome.keys.every((k) => unknown.includes(k));
32024
+ if (sameSet) {
32025
+ detail = `${isNotAField(outcome.keys)}, so every key it projected is null`;
32026
+ } else if (unknown.length > 0) {
32027
+ detail = `${projected}, because ${isNotAField(unknown)}`;
32028
+ } else {
32029
+ detail = withSoundness(`${projected} on all ${scope}`);
32030
+ }
32031
+ } else {
32032
+ lede = "returned nothing";
32033
+ if (unknown.length > 0) {
32034
+ detail = isNotAField(unknown);
32035
+ } else {
32036
+ const selection = refs.hasPredicate ? "no record matched" : "the expression resolved to no value";
32037
+ detail = withSoundness(`${selection} — it read ${scope}`);
32038
+ }
32039
+ }
32040
+ const fields = present.length > 0 ? ` Available fields: ${nameList(present)}.` : "";
32041
+ return `--output-filter ${JSON.stringify(filter)} ${lede}: ${detail}.${fields}`;
32042
+ }
32043
+ function appendWarning(existing, note) {
32044
+ return existing ? `${existing} ${note}` : note;
32045
+ }
32046
+ function applyFilter(data, filter, onWarning) {
31689
32047
  const codec = requireJmespath();
31690
32048
  let result;
31691
32049
  try {
@@ -31693,9 +32051,34 @@ function applyFilter(data, filter) {
31693
32051
  } catch (err) {
31694
32052
  throw new FilterEvaluationError(filter, err);
31695
32053
  }
31696
- if (result == null)
32054
+ const inputCount = countRecords(data);
32055
+ const warn = (outcome) => {
32056
+ if (inputCount === 0)
32057
+ return;
32058
+ const note = buildFilterWarning(filter, data, outcome);
32059
+ getOutputSink().writeErr(`[WARN] ${note}
32060
+ `);
32061
+ onWarning?.(note);
32062
+ };
32063
+ const warnIfAllNull = (records) => {
32064
+ const keys = alwaysNullKeys(records);
32065
+ if (keys.length > 0)
32066
+ warn({ kind: "null-values", keys });
32067
+ };
32068
+ if (result == null) {
32069
+ warn({ kind: "empty" });
31697
32070
  return [];
32071
+ }
31698
32072
  if (Array.isArray(result)) {
32073
+ if (result.length === 0) {
32074
+ warn({ kind: "empty" });
32075
+ } else if (result.every((entry) => entry === null)) {
32076
+ warn({ kind: "null-elements", count: result.length });
32077
+ } else if (result.every((entry) => Array.isArray(entry)) && carriesOnlyNulls(result)) {
32078
+ warn({ kind: "null-rows", count: result.length });
32079
+ } else {
32080
+ warnIfAllNull(result);
32081
+ }
31699
32082
  if (result.length > 0 && typeof result[0] !== "object") {
31700
32083
  const fieldMatch = filter.match(/\.(\w+)$/);
31701
32084
  const key = fieldMatch ? fieldMatch[1] : "Value";
@@ -31703,10 +32086,30 @@ function applyFilter(data, filter) {
31703
32086
  }
31704
32087
  return result;
31705
32088
  }
31706
- if (typeof result === "object")
32089
+ if (typeof result === "object") {
32090
+ warnIfAllNull([result]);
31707
32091
  return result;
32092
+ }
31708
32093
  return { Value: result };
31709
32094
  }
32095
+ function filterFailureData(envelope) {
32096
+ const filter = getOutputFilter();
32097
+ const data = envelope.Data;
32098
+ if (!filter || data == null)
32099
+ return;
32100
+ let note;
32101
+ const [filterError, filtered] = catchError2(() => applyFilter(data, filter, (n) => {
32102
+ note = n;
32103
+ }));
32104
+ if (filterError) {
32105
+ envelope.Warning = appendWarning(envelope.Warning, `--output-filter was not applied, so Data is shown in full: ${filterError.message}`);
32106
+ return;
32107
+ }
32108
+ envelope.Data = filtered;
32109
+ if (note) {
32110
+ envelope.Warning = appendWarning(envelope.Warning, note);
32111
+ }
32112
+ }
31710
32113
  function defaultErrorCodeForResult(result) {
31711
32114
  switch (result) {
31712
32115
  case RESULTS.AuthenticationError:
@@ -31750,7 +32153,7 @@ function defaultErrorCodeForHttpStatus(status) {
31750
32153
  return "server_error";
31751
32154
  return;
31752
32155
  }
31753
- var LOCAL_PERMISSION_TEXT_PATTERN = /(?:\b|\()(?:EACCES|EPERM|EROFS)(?::\s|\))/;
32156
+ var LOCAL_PERMISSION_TEXT_PATTERN = new RegExp(`(?:\\b|\\()(?:${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})(?::\\s|\\))`);
31754
32157
  function defaultErrorCodeForFailure(data) {
31755
32158
  if (data.Result === RESULTS.Failure) {
31756
32159
  const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage2(data.Message);
@@ -31789,8 +32192,14 @@ var OutputFormatter;
31789
32192
  }
31790
32193
  const filter = getOutputFilter();
31791
32194
  if (filter) {
31792
- const filtered = applyFilter(data.Data, filter);
32195
+ let note;
32196
+ const filtered = applyFilter(data.Data, filter, (n) => {
32197
+ note = n;
32198
+ });
31793
32199
  data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
32200
+ if (note) {
32201
+ data.Warning = appendWarning(data.Warning, note);
32202
+ }
31794
32203
  }
31795
32204
  logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
31796
32205
  }
@@ -31818,12 +32227,13 @@ var OutputFormatter;
31818
32227
  delete envelope.TelemetryErrorClass;
31819
32228
  delete envelope.TelemetryTerminalOutcome;
31820
32229
  delete envelope.TelemetryTerminalSignal;
32230
+ filterFailureData(envelope);
31821
32231
  if (!suppressTelemetry) {
31822
32232
  telemetry.trackEvent(CommonTelemetryEvents.Error, {
31823
- result: data.Result,
31824
- errorCode: data.ErrorCode,
31825
- retry: data.Retry,
31826
- message: data.Message
32233
+ [ErrorDimensions.Result]: data.Result,
32234
+ [ErrorDimensions.ErrorCode]: data.ErrorCode,
32235
+ [ErrorDimensions.Retry]: data.Retry,
32236
+ [ErrorDimensions.ErrorMessage]: data.Message
31827
32237
  });
31828
32238
  }
31829
32239
  logOutput(normalizeOutputKeys(envelope), getOutputFormat());
@@ -31866,13 +32276,20 @@ var OutputFormatter;
31866
32276
  OutputFormatter.log = log;
31867
32277
  function formatToString(data) {
31868
32278
  const filter = getOutputFilter();
32279
+ const envelope = data;
31869
32280
  if ("Data" in data && data.Data != null) {
31870
32281
  data.Data = normalizeDataKeys(data.Data);
31871
32282
  if (filter) {
31872
- data.Data = normalizeDataKeys(applyFilter(data.Data, filter));
32283
+ let note;
32284
+ data.Data = normalizeDataKeys(applyFilter(data.Data, filter, (n) => {
32285
+ note = n;
32286
+ }));
32287
+ if (note) {
32288
+ envelope.Warning = appendWarning(envelope.Warning, note);
32289
+ }
31873
32290
  }
31874
32291
  }
31875
- const output = normalizeOutputKeys(data);
32292
+ const output = normalizeOutputKeys(envelope);
31876
32293
  const lines = [];
31877
32294
  const sink = getOutputSink();
31878
32295
  printOutput(output, getOutputFormat(), (msg) => {
@@ -31922,7 +32339,7 @@ var LEGACY_SKILL_NAMESPACE = "uipath:";
31922
32339
  var MAX_SKILL_NAME_LENGTH = 80;
31923
32340
  var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
31924
32341
  function productMode(productArea, mode) {
31925
- return { product_area: productArea, mode };
32342
+ return { ProductArea: productArea, Mode: mode };
31926
32343
  }
31927
32344
  function attributionRecord(groups) {
31928
32345
  const record = {};
@@ -31980,6 +32397,7 @@ var COMMAND_ATTRIBUTION = commandAttribution([
31980
32397
  ["rpa", "build", ["uip.rpa-legacy"]],
31981
32398
  ["conversational", "operate", ["uip.conversational"]],
31982
32399
  ["agents", "build", ["uip.codedagent", "uip.agent"]],
32400
+ ["coding-agents", "build", ["uip.coder"]],
31983
32401
  ["agenthub", "build", ["uip.agenthub"]],
31984
32402
  ["coded-apps", "build", ["uip.codedapp"]],
31985
32403
  ["functions", "build", ["uip.function", "uip.functions"]],
@@ -32065,32 +32483,64 @@ function normalizeSkillName(value) {
32065
32483
  function buildCommandTelemetryAttribution(commandPath, skillSource) {
32066
32484
  const skillName = normalizeSkillName(skillSource);
32067
32485
  return {
32068
- ...skillName ? { skill_name: skillName } : {},
32486
+ ...skillName ? { SkillName: skillName } : {},
32069
32487
  ...getCommandProductModeAttribution(commandPath)
32070
32488
  };
32071
32489
  }
32490
+ var AGENT_SESSION_ENV = {
32491
+ [BaseDimensions.AgentModel]: "UIPATH_AGENT_MODEL",
32492
+ [SkillsDimensions.PermissionMode]: "UIPATH_PERMISSION_MODE",
32493
+ [SkillsDimensions.EffortLevel]: "UIPATH_EFFORT_LEVEL",
32494
+ [SkillsDimensions.SkillsVersion]: "UIPATH_SKILLS_VERSION"
32495
+ };
32496
+ var MAX_TELEMETRY_TOKEN_LENGTH = 120;
32497
+ function sanitizeTelemetryToken(value) {
32498
+ return value.replace(/[^A-Za-z0-9:._/ -]/g, "_").slice(0, MAX_TELEMETRY_TOKEN_LENGTH);
32499
+ }
32500
+ function buildAgentSessionTelemetry(env) {
32501
+ const dimensions = {};
32502
+ for (const [key, variable] of Object.entries(AGENT_SESSION_ENV)) {
32503
+ const value = env[variable]?.trim();
32504
+ if (value) {
32505
+ dimensions[key] = sanitizeTelemetryToken(value);
32506
+ }
32507
+ }
32508
+ return dimensions;
32509
+ }
32072
32510
 
32073
32511
  // ../common/src/telemetry/command-name.ts
32074
- var TELEMETRY_COMMAND_ROOT = "uip";
32512
+ var TELEMETRY_NAME_ROOT = "Cli";
32513
+ var CLI_COMMAND_ROOT = "uip";
32514
+ var TELEMETRY_NAME_BARE_ACTION = "Invoke";
32075
32515
  function commandTelemetryName(parts) {
32516
+ const action = vetCommandTokens(parts).map(pascalizeToken).join("");
32517
+ return `${TELEMETRY_NAME_ROOT}.${action || TELEMETRY_NAME_BARE_ACTION}`;
32518
+ }
32519
+ function commandInvocationPath(parts) {
32520
+ return [CLI_COMMAND_ROOT, ...vetCommandTokens(parts)].join(" ");
32521
+ }
32522
+ function vetCommandTokens(parts) {
32076
32523
  const tokens = [];
32077
32524
  for (const part of parts) {
32078
- const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !== TELEMETRY_COMMAND_ROOT);
32525
+ const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !== CLI_COMMAND_ROOT);
32079
32526
  if (pieces.every(isCommandToken)) {
32080
32527
  tokens.push(...pieces);
32081
32528
  continue;
32082
32529
  }
32083
32530
  tokens.push(UNKNOWN_TOKEN);
32084
32531
  }
32085
- return [TELEMETRY_COMMAND_ROOT, ...tokens].join(".");
32532
+ return tokens;
32086
32533
  }
32087
- var COMMAND_TOKEN_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
32534
+ function pascalizeToken(token) {
32535
+ return token.split("-").filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
32536
+ }
32537
+ var COMMAND_TOKEN_PATTERN = /^[a-z][a-z0-9-]*$/;
32088
32538
  var MAX_COMMAND_TOKEN_LENGTH = 32;
32089
32539
  var GUID_TOKEN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
32090
32540
  function isCommandToken(token) {
32091
- return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token) && !/^\d+$/.test(token);
32541
+ return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token);
32092
32542
  }
32093
- var UNKNOWN_TOKEN = "<unknown>";
32543
+ var UNKNOWN_TOKEN = "unknown";
32094
32544
 
32095
32545
  // ../common/src/telemetry/invocation-request.ts
32096
32546
  var requestContextSlot = singleton("TelemetryInvocationRequestContext");
@@ -32195,7 +32645,7 @@ function withheldArgumentValues(cmd) {
32195
32645
  });
32196
32646
  return values;
32197
32647
  }
32198
- function deriveCommandPath(cmd) {
32648
+ function deriveCommandParts(cmd) {
32199
32649
  const parts = [];
32200
32650
  let current = cmd;
32201
32651
  while (current) {
@@ -32208,14 +32658,13 @@ function deriveCommandPath(cmd) {
32208
32658
  if (parts.length > 1) {
32209
32659
  parts.shift();
32210
32660
  }
32211
- return commandTelemetryName(parts);
32661
+ return parts;
32212
32662
  }
32213
32663
  function isErrorContext(value) {
32214
32664
  return value !== null && typeof value === "object";
32215
32665
  }
32216
32666
  function commandHelpHint(commandPath) {
32217
- const command = commandPath.replace(/\./g, " ");
32218
- return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
32667
+ return `An unexpected error occurred. Run '${commandPath} --help' to verify command syntax, or run with --log-level debug for details.`;
32219
32668
  }
32220
32669
  function isPromptCancellation(error) {
32221
32670
  return error instanceof Error && error.name === "ExitPromptError";
@@ -32240,7 +32689,9 @@ Command.prototype.trackedAction = function(context, fn, properties) {
32240
32689
  yaml: getOutputFormat() === "yaml",
32241
32690
  filter: getOutputFilter() !== undefined
32242
32691
  });
32243
- const telemetryName = deriveCommandPath(command);
32692
+ const commandParts = deriveCommandParts(command);
32693
+ const telemetryName = commandTelemetryName(commandParts);
32694
+ const commandPath = commandInvocationPath(commandParts);
32244
32695
  const props = typeof properties === "function" ? properties(...args) : properties;
32245
32696
  markCommandStart();
32246
32697
  const supplied = recordSuppliedArgumentValues(withheldArgumentValues(command));
@@ -32275,7 +32726,7 @@ Command.prototype.trackedAction = function(context, fn, properties) {
32275
32726
  Result: finalResult,
32276
32727
  ...customErrorCode ? { ErrorCode: customErrorCode } : {},
32277
32728
  Message: errorMessage2,
32278
- Instructions: customInstructions ?? commandHelpHint(telemetryName),
32729
+ Instructions: customInstructions ?? commandHelpHint(commandPath),
32279
32730
  ...customRetry ? { Retry: customRetry } : {},
32280
32731
  ...customContext ? { Context: customContext } : {}
32281
32732
  });
@@ -32292,8 +32743,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
32292
32743
  recordedFailure,
32293
32744
  pollSignal: context.pollSignal
32294
32745
  });
32295
- if (terminalTelemetry.error_class === "internal" && error) {
32296
- telemetry.trackException(error instanceof Error ? error : new Error(String(error)), { command_name: telemetryName }, getInvocationRequestContext());
32746
+ if (terminalTelemetry[CommandDimensions.ErrorClass] === "internal" && error) {
32747
+ telemetry.trackException(error instanceof Error ? error : new Error(String(error)), { [CommandDimensions.CommandName]: commandPath }, getInvocationRequestContext());
32297
32748
  }
32298
32749
  const commandParams = extractCommandParams(command);
32299
32750
  if (props) {
@@ -32304,10 +32755,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
32304
32755
  const baseProperties = redactProperties({
32305
32756
  ...commandParams,
32306
32757
  ...props,
32307
- ...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
32308
- command: "true",
32758
+ ...buildCommandTelemetryAttribution(commandPath, process.env.UIPATH_SKILL),
32759
+ ...buildAgentSessionTelemetry(process.env),
32760
+ [CommandDimensions.CommandName]: commandPath,
32761
+ [CommandDimensions.IsCommand]: "true",
32309
32762
  ...terminalTelemetry,
32310
- ...errorMessage2 ? { errorMessage: errorMessage2 } : {}
32763
+ ...errorMessage2 ? { [CommandDimensions.ErrorMessage]: errorMessage2 } : {}
32311
32764
  });
32312
32765
  emitInvocationRequest(telemetryName, success, baseProperties);
32313
32766
  } finally {
@@ -32539,6 +32992,40 @@ var BOOLEAN_FLAGS = new Set(HOST_GLOBAL_FLAGS);
32539
32992
  // ../common/src/interactivity-context.ts
32540
32993
  var modeSlot = singleton("InteractivityMode");
32541
32994
  var interactiveFlagSlot = singleton("InteractiveFlag");
32995
+ // ../common/src/mime-types.ts
32996
+ var MIME_TYPES_BY_EXTENSION = Object.freeze({
32997
+ pdf: "application/pdf",
32998
+ png: "image/png",
32999
+ jpg: "image/jpeg",
33000
+ jpeg: "image/jpeg",
33001
+ gif: "image/gif",
33002
+ webp: "image/webp",
33003
+ bmp: "image/bmp",
33004
+ tif: "image/tiff",
33005
+ tiff: "image/tiff",
33006
+ svg: "image/svg+xml",
33007
+ txt: "text/plain",
33008
+ log: "text/plain",
33009
+ md: "text/markdown",
33010
+ csv: "text/csv",
33011
+ tsv: "text/tab-separated-values",
33012
+ json: "application/json",
33013
+ xml: "application/xml",
33014
+ html: "text/html",
33015
+ htm: "text/html",
33016
+ yaml: "application/yaml",
33017
+ yml: "application/yaml",
33018
+ doc: "application/msword",
33019
+ docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
33020
+ xls: "application/vnd.ms-excel",
33021
+ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
33022
+ ppt: "application/vnd.ms-powerpoint",
33023
+ pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
33024
+ zip: "application/zip",
33025
+ mp3: "audio/mpeg",
33026
+ wav: "audio/wav",
33027
+ mp4: "video/mp4"
33028
+ });
32542
33029
  // ../common/src/option-validators.ts
32543
33030
  function parseLimit(raw, _previous) {
32544
33031
  return parseBoundedInt(raw, "--limit", { min: 1, max: 1e4 });
@@ -33013,6 +33500,7 @@ var ScreenLogger;
33013
33500
  })(ScreenLogger ||= {});
33014
33501
  // ../common/src/sdk-user-agent.ts
33015
33502
  var USER_AGENT_HEADER = "User-Agent";
33503
+ var AGENT_PROPERTY = BaseDimensions.Agent;
33016
33504
  var sdkUserAgentHostToken = singleton("SdkUserAgentHostToken");
33017
33505
  function userAgentPatchKey(userAgent) {
33018
33506
  return Symbol.for(`@uipath/common/sdk-user-agent/${userAgent}`);
@@ -33999,7 +34487,7 @@ var package_default2 = {
33999
34487
  name: "@uipath/identity-sdk",
34000
34488
  author: "UiPath",
34001
34489
  license: "SEE LICENSE IN LICENSE.txt",
34002
- version: "1.203.0",
34490
+ version: "1.204.0",
34003
34491
  repository: {
34004
34492
  type: "git",
34005
34493
  url: "https://github.com/UiPath/cli.git",
@@ -34028,6 +34516,7 @@ var package_default2 = {
34028
34516
  private: true,
34029
34517
  scripts: {
34030
34518
  build: "bun build ./src/index.ts --outdir dist --format esm --target node --sourcemap=linked && tsc -p tsconfig.build.json --noCheck",
34519
+ typecheck: "tsc --noEmit",
34031
34520
  generate: "bun run src/scripts/generate-sdk.ts",
34032
34521
  lint: "biome check .",
34033
34522
  test: "vitest run",
@@ -36655,4 +37144,4 @@ var registerCommands = async (program2) => {
36655
37144
 
36656
37145
  export { Command, metadata, registerCommands };
36657
37146
 
36658
- //# debugId=4B1A9B7C3F790A2E64756E2164756E21
37147
+ //# debugId=3089145809D44B0C64756E2164756E21
package/dist/tool.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  metadata,
3
3
  registerCommands
4
- } from "./tool-ewe20fdh.js";
4
+ } from "./tool-4k5h4ke6.js";
5
5
  import"./tool-1de529jm.js";
6
6
  export {
7
7
  metadata,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uipath/platform-tool",
3
3
  "author": "UiPath",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
- "version": "1.203.0-preview.212",
5
+ "version": "1.204.0-preview.211",
6
6
  "description": "Manage UiPath platform-level resources such as tenant licensing.",
7
7
  "publishConfig": {
8
8
  "registry": "https://registry.npmjs.org/"
@@ -21,5 +21,5 @@
21
21
  "keywords": [
22
22
  "cli-tool"
23
23
  ],
24
- "gitHead": "15094ce85cf76c59a54affbed3304febc271f41a"
24
+ "gitHead": "275e01f1f6098d4c3bc9673f5225f33372822534"
25
25
  }