@uipath/authz-commands 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.
Files changed (2) hide show
  1. package/dist/index.js +588 -98
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -2638,6 +2638,11 @@ var pickName = (claims) => {
2638
2638
  const username = asString(claims?.preferred_username);
2639
2639
  return asString(claims?.name) ?? (looksLikeEmail(username) ? undefined : username);
2640
2640
  };
2641
+ var pickScopes = (claims) => {
2642
+ const raw = claims?.scope;
2643
+ const scopes = Array.isArray(raw) ? raw.filter((entry) => asString(entry) !== undefined) : typeof raw === "string" ? raw.split(/\s+/).filter(Boolean) : [];
2644
+ return scopes.length > 0 ? scopes : undefined;
2645
+ };
2641
2646
  var resolveSessionIdentity = (accessToken, authFlow) => {
2642
2647
  const claims = accessToken ? decodeClaims(accessToken) : undefined;
2643
2648
  const email = pickEmail(claims);
@@ -2663,6 +2668,7 @@ var resolveSessionIdentity = (accessToken, authFlow) => {
2663
2668
  identity.clientId = clientId;
2664
2669
  return identity;
2665
2670
  };
2671
+ var readTokenScopes = (accessToken) => accessToken ? pickScopes(decodeClaims(accessToken)) : undefined;
2666
2672
 
2667
2673
  // ../../auth/src/envAuth.ts
2668
2674
  var ENV_AUTH_ENABLE_VAR = "UIPATH_CLI_ENABLE_ENV_AUTH";
@@ -2735,6 +2741,7 @@ var readAuthFromEnv = () => {
2735
2741
  const expiration = getTokenExpiration(accessToken);
2736
2742
  const loginStatus = expiration && expiration <= new Date ? "Expired" : "Logged in";
2737
2743
  const identity = resolveSessionIdentity(accessToken);
2744
+ const scopes = readTokenScopes(accessToken);
2738
2745
  return {
2739
2746
  loginStatus,
2740
2747
  accessToken,
@@ -2745,7 +2752,8 @@ var readAuthFromEnv = () => {
2745
2752
  tenantId,
2746
2753
  expiration,
2747
2754
  source: "env-vars" /* EnvironmentVariables */,
2748
- ...identity ? { identity } : {}
2755
+ ...identity ? { identity } : {},
2756
+ ...scopes ? { scopes } : {}
2749
2757
  };
2750
2758
  };
2751
2759
 
@@ -3383,10 +3391,15 @@ async function buildFileStatus(tokens, credentials, globalHint) {
3383
3391
  }
3384
3392
  function identityFields(accessToken, credentials) {
3385
3393
  const identity = resolveSessionIdentity(accessToken, parseAuthFlow(credentials[AUTH_FLOW_ENV_VAR]));
3386
- return identity ? { identity } : {};
3394
+ const scopes = readTokenScopes(accessToken);
3395
+ return {
3396
+ ...identity ? { identity } : {},
3397
+ ...scopes ? { scopes } : {}
3398
+ };
3387
3399
  }
3388
3400
  function buildRobotStatus(robotCreds) {
3389
3401
  const identity = resolveSessionIdentity(robotCreds.accessToken);
3402
+ const scopes = readTokenScopes(robotCreds.accessToken);
3390
3403
  return {
3391
3404
  loginStatus: "Logged in",
3392
3405
  accessToken: robotCreds.accessToken,
@@ -3398,7 +3411,8 @@ function buildRobotStatus(robotCreds) {
3398
3411
  issuer: robotCreds.issuer,
3399
3412
  expiration: getTokenExpiration(robotCreds.accessToken),
3400
3413
  source: "robot" /* Robot */,
3401
- ...identity ? { identity } : {}
3414
+ ...identity ? { identity } : {},
3415
+ ...scopes ? { scopes } : {}
3402
3416
  };
3403
3417
  }
3404
3418
  var isFileNotFoundError = (error) => {
@@ -3665,7 +3679,8 @@ var getAuthContext = async (options = {}) => {
3665
3679
  organizationId: status.organizationId,
3666
3680
  organizationName: status.organizationName,
3667
3681
  tenantId: status.tenantId,
3668
- tenantName
3682
+ tenantName,
3683
+ identity: status.identity
3669
3684
  };
3670
3685
  };
3671
3686
  // ../../auth/src/tenantSelection.ts
@@ -3714,8 +3729,156 @@ function getGlobalTelemetryProperties() {
3714
3729
  return telemetryPropsSlot.get();
3715
3730
  }
3716
3731
 
3732
+ // ../../common/src/telemetry/telemetry-dimensions.ts
3733
+ var BaseDimensions = {
3734
+ ApplicationName: "ApplicationName",
3735
+ ProductVersion: "ProductVersion",
3736
+ InstallationId: "InstallationId",
3737
+ CloudUserId: "CloudUserId",
3738
+ CloudTenantId: "CloudTenantId",
3739
+ CloudOrganizationId: "CloudOrganizationId",
3740
+ IsInternalUser: "IsInternalUser",
3741
+ Environment: "Environment",
3742
+ BaseUrl: "BaseUrl",
3743
+ Region: "Region",
3744
+ Agent: "Agent",
3745
+ AgentVersion: "AgentVersion",
3746
+ AgentModel: "AgentModel",
3747
+ ToolName: "ToolName",
3748
+ ToolVersion: "ToolVersion",
3749
+ ExecutionContext: "ExecutionContext",
3750
+ CiProvider: "CiProvider",
3751
+ SessionIdSource: "SessionIdSource",
3752
+ SessionId: "SessionId"
3753
+ };
3754
+ var CommandDimensions = {
3755
+ IsCommand: "IsCommand",
3756
+ IsReexec: "IsReexec",
3757
+ CommandName: "CommandName",
3758
+ ExitCode: "ExitCode",
3759
+ TerminalOutcome: "TerminalOutcome",
3760
+ ErrorClass: "ErrorClass",
3761
+ TerminalSignal: "TerminalSignal",
3762
+ ErrorMessage: "ErrorMessage",
3763
+ SkillName: "SkillName",
3764
+ ProductArea: "ProductArea",
3765
+ Mode: "Mode"
3766
+ };
3767
+ var ShipDimensions = {
3768
+ ShipKind: "ShipKind",
3769
+ Target: "Target",
3770
+ ProjectType: "ProjectType",
3771
+ ProjectTypes: "ProjectTypes",
3772
+ ArtifactCorrelationKey: "ArtifactCorrelationKey",
3773
+ PackageName: "PackageName",
3774
+ PackageVersion: "PackageVersion",
3775
+ PackageVersionKey: "PackageVersionKey",
3776
+ DeploymentKey: "DeploymentKey",
3777
+ SolutionId: "SolutionId",
3778
+ FolderKey: "FolderKey",
3779
+ FeedId: "FeedId"
3780
+ };
3781
+ var ErrorDimensions = {
3782
+ Result: "Result",
3783
+ ErrorCode: "ErrorCode",
3784
+ Retry: "Retry",
3785
+ ErrorMessage: "ErrorMessage"
3786
+ };
3787
+ var AuthDimensions = {
3788
+ AuthenticationMethod: "AuthenticationMethod",
3789
+ Success: "Success",
3790
+ Reason: "Reason"
3791
+ };
3792
+ var SkillsDimensions = {
3793
+ SchemaVersion: "SchemaVersion",
3794
+ AgentType: "AgentType",
3795
+ SkillsVersion: "SkillsVersion",
3796
+ UipSubcommand: "UipSubcommand",
3797
+ FileExtension: "FileExtension",
3798
+ SubagentModel: "SubagentModel",
3799
+ SubagentType: "SubagentType",
3800
+ PermissionMode: "PermissionMode",
3801
+ EffortLevel: "EffortLevel",
3802
+ SessionSource: "SessionSource",
3803
+ Outcome: "Outcome",
3804
+ DurationMs: "DurationMs",
3805
+ Source: "Source"
3806
+ };
3807
+ var PackagerDimensions = {
3808
+ ProjectId: "ProjectId",
3809
+ ProjectType: "ProjectType",
3810
+ SolutionId: "SolutionId"
3811
+ };
3812
+ var ScopeDimensions = {
3813
+ FolderId: "FolderId"
3814
+ };
3815
+ var ID_DIMENSIONS = new Set([
3816
+ BaseDimensions.CloudUserId,
3817
+ BaseDimensions.CloudTenantId,
3818
+ BaseDimensions.CloudOrganizationId,
3819
+ BaseDimensions.InstallationId,
3820
+ ShipDimensions.ArtifactCorrelationKey,
3821
+ ShipDimensions.PackageVersionKey,
3822
+ ShipDimensions.DeploymentKey,
3823
+ ShipDimensions.SolutionId,
3824
+ ShipDimensions.FolderKey,
3825
+ ShipDimensions.FeedId,
3826
+ PackagerDimensions.ProjectId
3827
+ ]);
3828
+ var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
3829
+ var RESERVED_DIMENSION_NAMES = new Set([
3830
+ ...Object.values(BaseDimensions),
3831
+ ...Object.values(CommandDimensions),
3832
+ ...Object.values(ShipDimensions),
3833
+ ...Object.values(ErrorDimensions),
3834
+ ...Object.values(AuthDimensions),
3835
+ ...Object.values(SkillsDimensions),
3836
+ ...Object.values(PackagerDimensions),
3837
+ ...Object.values(ScopeDimensions)
3838
+ ]);
3839
+ var CURATED_DIMENSIONS = new Set([
3840
+ BaseDimensions.ApplicationName,
3841
+ BaseDimensions.ProductVersion,
3842
+ BaseDimensions.InstallationId,
3843
+ BaseDimensions.CloudUserId,
3844
+ BaseDimensions.CloudTenantId,
3845
+ BaseDimensions.CloudOrganizationId,
3846
+ BaseDimensions.IsInternalUser,
3847
+ BaseDimensions.Environment,
3848
+ BaseDimensions.BaseUrl,
3849
+ BaseDimensions.Region,
3850
+ BaseDimensions.Agent,
3851
+ BaseDimensions.AgentVersion,
3852
+ BaseDimensions.ToolVersion,
3853
+ BaseDimensions.ExecutionContext,
3854
+ BaseDimensions.CiProvider,
3855
+ BaseDimensions.SessionIdSource,
3856
+ BaseDimensions.SessionId,
3857
+ ...Object.values(CommandDimensions),
3858
+ ...Object.values(ShipDimensions)
3859
+ ]);
3860
+ function lowercaseIdDimensionValues(properties) {
3861
+ let changed = false;
3862
+ const result = {
3863
+ ...properties
3864
+ };
3865
+ for (const key of Object.keys(result)) {
3866
+ const value = result[key];
3867
+ if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
3868
+ continue;
3869
+ }
3870
+ const lowered = value.toLowerCase();
3871
+ if (lowered !== value) {
3872
+ result[key] = lowered;
3873
+ changed = true;
3874
+ }
3875
+ }
3876
+ return changed ? result : properties;
3877
+ }
3878
+
3717
3879
  // ../../common/src/sdk-user-agent.ts
3718
3880
  var USER_AGENT_HEADER = "User-Agent";
3881
+ var AGENT_PROPERTY = BaseDimensions.Agent;
3719
3882
  var sdkUserAgentHostToken = singleton("SdkUserAgentHostToken");
3720
3883
  function userAgentPatchKey(userAgent) {
3721
3884
  return Symbol.for(`@uipath/common/sdk-user-agent/${userAgent}`);
@@ -4043,7 +4206,7 @@ var package_default = {
4043
4206
  name: "@uipath/authz-sdk",
4044
4207
  author: "UiPath",
4045
4208
  license: "SEE LICENSE IN LICENSE.txt",
4046
- version: "1.203.0",
4209
+ version: "1.204.0",
4047
4210
  description: "SDK for the UiPath Authorization Service API.",
4048
4211
  repository: {
4049
4212
  type: "git",
@@ -4074,6 +4237,7 @@ var package_default = {
4074
4237
  private: true,
4075
4238
  scripts: {
4076
4239
  build: "bun build ./src/index.ts --outdir dist --format esm --target node --sourcemap=linked && tsc -p tsconfig.build.json --noCheck",
4240
+ typecheck: "tsc --noEmit",
4077
4241
  generate: "bun run src/scripts/generate-sdk.ts",
4078
4242
  lint: "biome check ."
4079
4243
  },
@@ -5147,9 +5311,60 @@ function settlePromiseLike2(thenable) {
5147
5311
  return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [toError(error), undefined]);
5148
5312
  }
5149
5313
 
5314
+ // ../../common/src/error-graph.ts
5315
+ function* walkErrorGraph(error) {
5316
+ const queue = [error];
5317
+ const seen = new Set;
5318
+ for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
5319
+ const current = queue.shift();
5320
+ if (current === null || typeof current !== "object")
5321
+ continue;
5322
+ if (seen.has(current))
5323
+ continue;
5324
+ seen.add(current);
5325
+ const cur = current;
5326
+ yield cur;
5327
+ if (cur.cause !== undefined)
5328
+ queue.push(cur.cause);
5329
+ if (Array.isArray(cur.errors))
5330
+ queue.push(...cur.errors);
5331
+ }
5332
+ return;
5333
+ }
5334
+ function parseHttpStatusFromMessage(message) {
5335
+ const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
5336
+ if (!match)
5337
+ return;
5338
+ const status = Number(match[1]);
5339
+ return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
5340
+ }
5341
+ function findHttpStatusInGraph(error) {
5342
+ for (const node of walkErrorGraph(error)) {
5343
+ const response = node.response;
5344
+ const explicit = typeof node.status === "number" ? node.status : response?.status;
5345
+ if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
5346
+ return explicit;
5347
+ }
5348
+ if (typeof node.message === "string") {
5349
+ const parsed = parseHttpStatusFromMessage(node.message);
5350
+ if (parsed !== undefined && parsed >= 400) {
5351
+ return parsed;
5352
+ }
5353
+ }
5354
+ }
5355
+ return;
5356
+ }
5357
+
5358
+ // ../../common/src/local-permission-codes.ts
5359
+ var LOCAL_PERMISSION_ERROR_CODES = new Set([
5360
+ "EACCES",
5361
+ "EPERM",
5362
+ "EROFS"
5363
+ ]);
5364
+
5150
5365
  // ../../common/src/error-handler.ts
5151
- var DEFAULT_401 = "Unauthorized (401). Run `uip login` to authenticate.";
5152
- var DEFAULT_403 = "Forbidden (403). Ensure the account has the required permissions.";
5366
+ 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.";
5367
+ 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.";
5153
5368
  var DEFAULT_405 = "Method Not Allowed (405). The endpoint may not exist or the base URL may be incorrect.";
5154
5369
  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.";
5155
5370
  var HTML_RESPONSE_MESSAGE = "Received HTML instead of the expected JSON response.";
@@ -5176,14 +5391,14 @@ var TLS_ERROR_CODES = new Set([
5176
5391
  ]);
5177
5392
  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.";
5178
5393
  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.";
5179
- var LOCAL_PERMISSION_ERROR_CODES = new Set(["EACCES", "EPERM", "EROFS"]);
5180
- var LOCAL_PERMISSION_MESSAGE_PATTERN = /\b(EACCES|EPERM|EROFS)\b/;
5394
+ var LOCAL_PERMISSION_MESSAGE_PATTERN = new RegExp(`\\b(${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})\\b`);
5181
5395
  function localPermissionInstructions(code, path2) {
5182
5396
  const target = path2 !== undefined ? `'${path2}'` : "a local file or resource";
5183
5397
  if (code === "EROFS") {
5184
5398
  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.";
5185
5399
  }
5186
- 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.";
5400
+ const onWindows = typeof process !== "undefined" && process.platform === "win32";
5401
+ 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.";
5187
5402
  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}`;
5188
5403
  }
5189
5404
  function describeConnectivityError(error) {
@@ -5237,48 +5452,6 @@ function localPermissionPath(path2, message) {
5237
5452
  return path2;
5238
5453
  return message ? /'([^']+)'/.exec(message)?.[1] : undefined;
5239
5454
  }
5240
- function* walkErrorGraph(error) {
5241
- const queue = [error];
5242
- const seen = new Set;
5243
- for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
5244
- const current = queue.shift();
5245
- if (current === null || typeof current !== "object")
5246
- continue;
5247
- if (seen.has(current))
5248
- continue;
5249
- seen.add(current);
5250
- const cur = current;
5251
- yield cur;
5252
- if (cur.cause !== undefined)
5253
- queue.push(cur.cause);
5254
- if (Array.isArray(cur.errors))
5255
- queue.push(...cur.errors);
5256
- }
5257
- return;
5258
- }
5259
- function parseHttpStatusFromMessage(message) {
5260
- const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
5261
- if (!match)
5262
- return;
5263
- const status = Number(match[1]);
5264
- return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
5265
- }
5266
- function findHttpStatusInGraph(error) {
5267
- for (const node of walkErrorGraph(error)) {
5268
- const response = node.response;
5269
- const explicit = typeof node.status === "number" ? node.status : response?.status;
5270
- if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
5271
- return explicit;
5272
- }
5273
- if (typeof node.message === "string") {
5274
- const parsed = parseHttpStatusFromMessage(node.message);
5275
- if (parsed !== undefined && parsed >= 400) {
5276
- return parsed;
5277
- }
5278
- }
5279
- }
5280
- return;
5281
- }
5282
5455
  function isHtmlDocument(body) {
5283
5456
  return /^\s*(<!doctype html|<html\b)/i.test(body);
5284
5457
  }
@@ -5806,6 +5979,9 @@ var AUTH_ERROR_CODES = new Set([
5806
5979
  "authentication_required",
5807
5980
  "permission_denied"
5808
5981
  ]);
5982
+ var LOCAL_PERMISSION_CLI_ERROR_CODES = new Set([
5983
+ "local_permission_denied"
5984
+ ]);
5809
5985
  var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
5810
5986
  var NETWORK_HTTP_ERROR_CODES = new Set([
5811
5987
  "network_error",
@@ -5946,6 +6122,9 @@ function classifyFromErrorCode(errorCode2) {
5946
6122
  if (AUTH_ERROR_CODES.has(errorCode2)) {
5947
6123
  return "auth";
5948
6124
  }
6125
+ if (LOCAL_PERMISSION_CLI_ERROR_CODES.has(errorCode2)) {
6126
+ return "local_permission";
6127
+ }
5949
6128
  if (VALIDATION_ERROR_CODES.has(errorCode2)) {
5950
6129
  return "validation";
5951
6130
  }
@@ -5957,6 +6136,15 @@ function classifyFromErrorCode(errorCode2) {
5957
6136
  }
5958
6137
  return;
5959
6138
  }
6139
+ function hasLocalPermissionCode(error) {
6140
+ for (const node of walkErrorGraph(error)) {
6141
+ const code = node.code;
6142
+ if (typeof code === "string" && LOCAL_PERMISSION_ERROR_CODES.has(code)) {
6143
+ return true;
6144
+ }
6145
+ }
6146
+ return false;
6147
+ }
5960
6148
  function classifyFromError(error) {
5961
6149
  const code = findCodeInCauseChain(error);
5962
6150
  if (code) {
@@ -5973,6 +6161,9 @@ function classifyFromError(error) {
5973
6161
  return "missing_dependency";
5974
6162
  }
5975
6163
  }
6164
+ if (hasLocalPermissionCode(error)) {
6165
+ return "local_permission";
6166
+ }
5976
6167
  const message = stringField(error, "message");
5977
6168
  if (message?.includes("fetch failed") === true) {
5978
6169
  return "network_http";
@@ -5988,7 +6179,7 @@ function classifyError2(input) {
5988
6179
  if (recorded?.errorClass) {
5989
6180
  return recorded.errorClass;
5990
6181
  }
5991
- const status = recorded?.context?.httpStatus;
6182
+ const status = recorded?.context?.httpStatus ?? findHttpStatusInGraph(input.error);
5992
6183
  if (status !== undefined) {
5993
6184
  return classifyHttpStatus(status);
5994
6185
  }
@@ -6011,17 +6202,18 @@ function buildCommandTerminalTelemetryProperties(input) {
6011
6202
  const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError2(input);
6012
6203
  const terminalSignal = terminalSignalFor(input, outcome);
6013
6204
  return {
6014
- exit_code: input.exitCode,
6015
- terminal_outcome: outcome,
6016
- ...errorClass ? { error_class: errorClass } : {},
6017
- ...terminalSignal ? { terminal_signal: terminalSignal } : {}
6205
+ [CommandDimensions.ExitCode]: input.exitCode,
6206
+ [CommandDimensions.TerminalOutcome]: outcome,
6207
+ ...errorClass ? { [CommandDimensions.ErrorClass]: errorClass } : {},
6208
+ ...terminalSignal ? { [CommandDimensions.TerminalSignal]: terminalSignal } : {}
6018
6209
  };
6019
6210
  }
6020
6211
 
6021
6212
  // ../../common/src/telemetry/telemetry-events.ts
6022
6213
  var CommonTelemetryEvents = {
6023
- Error: "uip.error",
6024
- ShipSucceeded: "uip.ship.succeeded"
6214
+ Start: "Application.Start",
6215
+ Error: "Application.Error",
6216
+ ShipSucceeded: "Cli.ShipSucceeded"
6025
6217
  };
6026
6218
 
6027
6219
  // ../../common/src/registry.ts
@@ -6229,8 +6421,8 @@ function detectExecutionContext(options = {}) {
6229
6421
  function getExecutionContextTelemetryProperties() {
6230
6422
  const detected = detectExecutionContext();
6231
6423
  return {
6232
- execution_context: detected.executionContext,
6233
- ...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
6424
+ [BaseDimensions.ExecutionContext]: detected.executionContext,
6425
+ ...detected.ciProvider ? { [BaseDimensions.CiProvider]: detected.ciProvider } : {}
6234
6426
  };
6235
6427
  }
6236
6428
  // ../../common/src/telemetry/node-context-storage.ts
@@ -6273,7 +6465,7 @@ function getInboundTraceContext() {
6273
6465
  var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
6274
6466
  var SESSION_ID_MAX_LENGTH = 64;
6275
6467
  var RANDOM_SESSION_ID_LENGTH = 32;
6276
- var TELEMETRY_SESSION_SOURCE_PROPERTY = "session_id_source";
6468
+ var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
6277
6469
  var CONTROL_CHARACTERS = /\p{Cc}/gu;
6278
6470
  var INHERITED_SESSION_SOURCES = [
6279
6471
  { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
@@ -6325,6 +6517,9 @@ function resolveTelemetrySession() {
6325
6517
  telemetrySessionSlot.set(resolved);
6326
6518
  return resolved;
6327
6519
  }
6520
+ function getTelemetrySessionId() {
6521
+ return resolveTelemetrySession().id;
6522
+ }
6328
6523
  function getTelemetrySessionSource() {
6329
6524
  return resolveTelemetrySession().source;
6330
6525
  }
@@ -6399,7 +6594,10 @@ class TelemetryService {
6399
6594
  } catch (error) {
6400
6595
  const durationMs = clock.elapsedMs();
6401
6596
  const err = error instanceof Error ? error : new Error(String(error));
6402
- await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, { ...properties, errorMessage: err.message }, context));
6597
+ await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, {
6598
+ ...properties,
6599
+ [CommandDimensions.ErrorMessage]: err.message
6600
+ }, context));
6403
6601
  throw error;
6404
6602
  }
6405
6603
  }
@@ -6470,7 +6668,10 @@ class TelemetryService {
6470
6668
  const durationMs = clock.elapsedMs();
6471
6669
  const err = error instanceof Error ? error : new Error(String(error));
6472
6670
  await this.telemetryProvider.trackDependency({
6473
- ...this.spanFor(name, durationMs, false, { ...properties, errorMessage: err.message }, childContext),
6671
+ ...this.spanFor(name, durationMs, false, {
6672
+ ...properties,
6673
+ [CommandDimensions.ErrorMessage]: err.message
6674
+ }, childContext),
6474
6675
  type
6475
6676
  });
6476
6677
  throw error;
@@ -6505,9 +6706,10 @@ class TelemetryService {
6505
6706
  ...globalProperties,
6506
6707
  ...this.defaultProperties,
6507
6708
  ...redactProperties(properties ?? {}),
6508
- [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource()
6709
+ [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
6710
+ [BaseDimensions.SessionId]: this.telemetryProvider.getSessionId?.() ?? getTelemetrySessionId()
6509
6711
  };
6510
- return enriched;
6712
+ return lowercaseIdDimensionValues(enriched);
6511
6713
  }
6512
6714
  generateId() {
6513
6715
  const bytes = new Uint8Array(8);
@@ -7268,7 +7470,165 @@ class FilterImplicitLimitError extends Error {
7268
7470
  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).";
7269
7471
  }
7270
7472
  }
7271
- function applyFilter(data, filter) {
7473
+ function countRecords(data) {
7474
+ if (Array.isArray(data))
7475
+ return data.length;
7476
+ return data == null ? 0 : 1;
7477
+ }
7478
+ function availableFields(data) {
7479
+ const records = Array.isArray(data) ? data : [data];
7480
+ const keys = new Set;
7481
+ for (const record of records) {
7482
+ if (record && typeof record === "object" && !Array.isArray(record)) {
7483
+ for (const key of Object.keys(record))
7484
+ keys.add(key);
7485
+ }
7486
+ }
7487
+ return [...keys];
7488
+ }
7489
+ function decodeQuotedIdentifier(whole, inner) {
7490
+ const [error, decoded] = catchError2(() => JSON.parse(whole));
7491
+ if (!error && typeof decoded === "string")
7492
+ return decoded;
7493
+ return inner.replace(/\\(.)/g, "$1");
7494
+ }
7495
+ function referencedFields(filter) {
7496
+ const top = new Set;
7497
+ const nested = new Set;
7498
+ const withoutValueLiterals = filter.replace(/'(?:\\.|[^'\\])*'/g, " ").replace(/`(?:\\.|[^`\\])*`/g, " ");
7499
+ const isPathTail = (text, index) => text[index - 1] === "." && /[A-Za-z0-9_"]/.test(text[index - 2] ?? "");
7500
+ const quoted = [];
7501
+ const withoutLiterals = withoutValueLiterals.replace(/"((?:\\.|[^"\\])*)"/g, (whole, name, index) => {
7502
+ const isAlias = /^\s*:/.test(withoutValueLiterals.slice(index + whole.length));
7503
+ if (!isAlias) {
7504
+ quoted.push({
7505
+ name: decodeQuotedIdentifier(whole, name),
7506
+ index,
7507
+ tail: isPathTail(withoutValueLiterals, index)
7508
+ });
7509
+ }
7510
+ return `"${" ".repeat(whole.length - 2)}"`;
7511
+ });
7512
+ const descent = /[A-Za-z0-9_"]\s*[.[]/.exec(withoutLiterals);
7513
+ const rootEnd = descent ? descent.index + 1 : Number.POSITIVE_INFINITY;
7514
+ const place = (name, index, tail) => {
7515
+ if (tail || index >= rootEnd)
7516
+ nested.add(name);
7517
+ else
7518
+ top.add(name);
7519
+ };
7520
+ for (const entry of quoted)
7521
+ place(entry.name, entry.index, entry.tail);
7522
+ const identifiers = withoutLiterals.matchAll(/([A-Za-z_][A-Za-z0-9_]*)(\s*[:(])?/g);
7523
+ const reserved = new Set(["true", "false", "null", "and", "or", "not"]);
7524
+ for (const match of identifiers) {
7525
+ const [, name, trailing] = match;
7526
+ if (trailing || reserved.has(name))
7527
+ continue;
7528
+ place(name, match.index, isPathTail(withoutLiterals, match.index));
7529
+ }
7530
+ return {
7531
+ top: [...top],
7532
+ nested: [...nested].filter((name) => !top.has(name)),
7533
+ hasPredicate: /\[\s*\?/.test(withoutValueLiterals)
7534
+ };
7535
+ }
7536
+ function appearsBelowTopLevel(data, name) {
7537
+ let budget = 2000;
7538
+ const visit = (value, depth) => {
7539
+ if (budget-- <= 0 || depth > 4)
7540
+ return false;
7541
+ if (value === null || typeof value !== "object")
7542
+ return false;
7543
+ if (Array.isArray(value))
7544
+ return value.some((entry) => visit(entry, depth));
7545
+ const record = value;
7546
+ if (depth > 0 && Object.hasOwn(record, name))
7547
+ return true;
7548
+ return Object.values(record).some((entry) => visit(entry, depth + 1));
7549
+ };
7550
+ return visit(data, 0);
7551
+ }
7552
+ function alwaysNullKeys(records) {
7553
+ const objects = records.filter((r) => r != null && typeof r === "object" && !Array.isArray(r));
7554
+ if (objects.length === 0 || objects.length !== records.length)
7555
+ return [];
7556
+ const keys = [...new Set(objects.flatMap((o) => Object.keys(o)))];
7557
+ if (keys.length === 0)
7558
+ return [];
7559
+ const nullKeys = keys.filter((key) => objects.every((record) => record[key] === null));
7560
+ return nullKeys.length === keys.length ? nullKeys : [];
7561
+ }
7562
+ function carriesOnlyNulls(value) {
7563
+ if (value === null)
7564
+ return true;
7565
+ if (Array.isArray(value)) {
7566
+ return value.length > 0 && value.every(carriesOnlyNulls);
7567
+ }
7568
+ if (typeof value === "object" && value !== undefined) {
7569
+ const values = Object.values(value);
7570
+ return values.length > 0 && values.every(carriesOnlyNulls);
7571
+ }
7572
+ return false;
7573
+ }
7574
+ function nameList(names, cap2 = 12) {
7575
+ const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
7576
+ const rest = names.length - shown.length;
7577
+ return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
7578
+ }
7579
+ function buildFilterWarning(filter, data, outcome) {
7580
+ const present = availableFields(data);
7581
+ const refs = referencedFields(filter);
7582
+ const unknown = refs.top.filter((name) => !present.includes(name) && !appearsBelowTopLevel(data, name));
7583
+ const unchecked = refs.nested.filter((name) => !present.includes(name));
7584
+ const count = countRecords(data);
7585
+ const scope = `${count} record(s)`;
7586
+ const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
7587
+ 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" : "";
7588
+ const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
7589
+ let detail;
7590
+ let lede;
7591
+ if (outcome.kind === "null-elements") {
7592
+ lede = "returned only null values";
7593
+ const projected = `all ${outcome.count} of the elements it projected are null`;
7594
+ if (unknown.length > 0) {
7595
+ detail = `${projected}, because ${isNotAField(unknown)}`;
7596
+ } else if (unchecked.length > 0) {
7597
+ detail = withSoundness(projected);
7598
+ } else {
7599
+ 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`;
7600
+ }
7601
+ } else if (outcome.kind === "null-rows") {
7602
+ lede = "returned only null values";
7603
+ const projected = `every value it projected is null on all ${outcome.count} row(s)`;
7604
+ detail = unknown.length > 0 ? `${projected}, because ${isNotAField(unknown)}` : withSoundness(projected);
7605
+ } else if (outcome.kind === "null-values") {
7606
+ lede = "returned only null values";
7607
+ const projected = `every key it projected (${nameList(outcome.keys)}) is null`;
7608
+ const sameSet = unknown.length === outcome.keys.length && outcome.keys.every((k) => unknown.includes(k));
7609
+ if (sameSet) {
7610
+ detail = `${isNotAField(outcome.keys)}, so every key it projected is null`;
7611
+ } else if (unknown.length > 0) {
7612
+ detail = `${projected}, because ${isNotAField(unknown)}`;
7613
+ } else {
7614
+ detail = withSoundness(`${projected} on all ${scope}`);
7615
+ }
7616
+ } else {
7617
+ lede = "returned nothing";
7618
+ if (unknown.length > 0) {
7619
+ detail = isNotAField(unknown);
7620
+ } else {
7621
+ const selection = refs.hasPredicate ? "no record matched" : "the expression resolved to no value";
7622
+ detail = withSoundness(`${selection} — it read ${scope}`);
7623
+ }
7624
+ }
7625
+ const fields = present.length > 0 ? ` Available fields: ${nameList(present)}.` : "";
7626
+ return `--output-filter ${JSON.stringify(filter)} ${lede}: ${detail}.${fields}`;
7627
+ }
7628
+ function appendWarning(existing, note) {
7629
+ return existing ? `${existing} ${note}` : note;
7630
+ }
7631
+ function applyFilter(data, filter, onWarning) {
7272
7632
  const codec = requireJmespath();
7273
7633
  let result;
7274
7634
  try {
@@ -7276,9 +7636,34 @@ function applyFilter(data, filter) {
7276
7636
  } catch (err) {
7277
7637
  throw new FilterEvaluationError(filter, err);
7278
7638
  }
7279
- if (result == null)
7639
+ const inputCount = countRecords(data);
7640
+ const warn = (outcome) => {
7641
+ if (inputCount === 0)
7642
+ return;
7643
+ const note = buildFilterWarning(filter, data, outcome);
7644
+ getOutputSink().writeErr(`[WARN] ${note}
7645
+ `);
7646
+ onWarning?.(note);
7647
+ };
7648
+ const warnIfAllNull = (records) => {
7649
+ const keys = alwaysNullKeys(records);
7650
+ if (keys.length > 0)
7651
+ warn({ kind: "null-values", keys });
7652
+ };
7653
+ if (result == null) {
7654
+ warn({ kind: "empty" });
7280
7655
  return [];
7656
+ }
7281
7657
  if (Array.isArray(result)) {
7658
+ if (result.length === 0) {
7659
+ warn({ kind: "empty" });
7660
+ } else if (result.every((entry) => entry === null)) {
7661
+ warn({ kind: "null-elements", count: result.length });
7662
+ } else if (result.every((entry) => Array.isArray(entry)) && carriesOnlyNulls(result)) {
7663
+ warn({ kind: "null-rows", count: result.length });
7664
+ } else {
7665
+ warnIfAllNull(result);
7666
+ }
7282
7667
  if (result.length > 0 && typeof result[0] !== "object") {
7283
7668
  const fieldMatch = filter.match(/\.(\w+)$/);
7284
7669
  const key = fieldMatch ? fieldMatch[1] : "Value";
@@ -7286,10 +7671,30 @@ function applyFilter(data, filter) {
7286
7671
  }
7287
7672
  return result;
7288
7673
  }
7289
- if (typeof result === "object")
7674
+ if (typeof result === "object") {
7675
+ warnIfAllNull([result]);
7290
7676
  return result;
7677
+ }
7291
7678
  return { Value: result };
7292
7679
  }
7680
+ function filterFailureData(envelope) {
7681
+ const filter = getOutputFilter();
7682
+ const data = envelope.Data;
7683
+ if (!filter || data == null)
7684
+ return;
7685
+ let note;
7686
+ const [filterError, filtered] = catchError2(() => applyFilter(data, filter, (n) => {
7687
+ note = n;
7688
+ }));
7689
+ if (filterError) {
7690
+ envelope.Warning = appendWarning(envelope.Warning, `--output-filter was not applied, so Data is shown in full: ${filterError.message}`);
7691
+ return;
7692
+ }
7693
+ envelope.Data = filtered;
7694
+ if (note) {
7695
+ envelope.Warning = appendWarning(envelope.Warning, note);
7696
+ }
7697
+ }
7293
7698
  function defaultErrorCodeForResult(result) {
7294
7699
  switch (result) {
7295
7700
  case RESULTS.AuthenticationError:
@@ -7333,7 +7738,7 @@ function defaultErrorCodeForHttpStatus(status) {
7333
7738
  return "server_error";
7334
7739
  return;
7335
7740
  }
7336
- var LOCAL_PERMISSION_TEXT_PATTERN = /(?:\b|\()(?:EACCES|EPERM|EROFS)(?::\s|\))/;
7741
+ var LOCAL_PERMISSION_TEXT_PATTERN = new RegExp(`(?:\\b|\\()(?:${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})(?::\\s|\\))`);
7337
7742
  function defaultErrorCodeForFailure(data) {
7338
7743
  if (data.Result === RESULTS.Failure) {
7339
7744
  const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage2(data.Message);
@@ -7372,8 +7777,14 @@ var OutputFormatter;
7372
7777
  }
7373
7778
  const filter = getOutputFilter();
7374
7779
  if (filter) {
7375
- const filtered = applyFilter(data.Data, filter);
7780
+ let note;
7781
+ const filtered = applyFilter(data.Data, filter, (n) => {
7782
+ note = n;
7783
+ });
7376
7784
  data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
7785
+ if (note) {
7786
+ data.Warning = appendWarning(data.Warning, note);
7787
+ }
7377
7788
  }
7378
7789
  logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
7379
7790
  }
@@ -7401,12 +7812,13 @@ var OutputFormatter;
7401
7812
  delete envelope.TelemetryErrorClass;
7402
7813
  delete envelope.TelemetryTerminalOutcome;
7403
7814
  delete envelope.TelemetryTerminalSignal;
7815
+ filterFailureData(envelope);
7404
7816
  if (!suppressTelemetry) {
7405
7817
  telemetry.trackEvent(CommonTelemetryEvents.Error, {
7406
- result: data.Result,
7407
- errorCode: data.ErrorCode,
7408
- retry: data.Retry,
7409
- message: data.Message
7818
+ [ErrorDimensions.Result]: data.Result,
7819
+ [ErrorDimensions.ErrorCode]: data.ErrorCode,
7820
+ [ErrorDimensions.Retry]: data.Retry,
7821
+ [ErrorDimensions.ErrorMessage]: data.Message
7410
7822
  });
7411
7823
  }
7412
7824
  logOutput(normalizeOutputKeys(envelope), getOutputFormat());
@@ -7449,13 +7861,20 @@ var OutputFormatter;
7449
7861
  OutputFormatter.log = log;
7450
7862
  function formatToString(data) {
7451
7863
  const filter = getOutputFilter();
7864
+ const envelope = data;
7452
7865
  if ("Data" in data && data.Data != null) {
7453
7866
  data.Data = normalizeDataKeys(data.Data);
7454
7867
  if (filter) {
7455
- data.Data = normalizeDataKeys(applyFilter(data.Data, filter));
7868
+ let note;
7869
+ data.Data = normalizeDataKeys(applyFilter(data.Data, filter, (n) => {
7870
+ note = n;
7871
+ }));
7872
+ if (note) {
7873
+ envelope.Warning = appendWarning(envelope.Warning, note);
7874
+ }
7456
7875
  }
7457
7876
  }
7458
- const output = normalizeOutputKeys(data);
7877
+ const output = normalizeOutputKeys(envelope);
7459
7878
  const lines = [];
7460
7879
  const sink = getOutputSink();
7461
7880
  printOutput(output, getOutputFormat(), (msg) => {
@@ -7505,7 +7924,7 @@ var LEGACY_SKILL_NAMESPACE = "uipath:";
7505
7924
  var MAX_SKILL_NAME_LENGTH = 80;
7506
7925
  var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
7507
7926
  function productMode(productArea, mode) {
7508
- return { product_area: productArea, mode };
7927
+ return { ProductArea: productArea, Mode: mode };
7509
7928
  }
7510
7929
  function attributionRecord(groups) {
7511
7930
  const record = {};
@@ -7563,6 +7982,7 @@ var COMMAND_ATTRIBUTION = commandAttribution([
7563
7982
  ["rpa", "build", ["uip.rpa-legacy"]],
7564
7983
  ["conversational", "operate", ["uip.conversational"]],
7565
7984
  ["agents", "build", ["uip.codedagent", "uip.agent"]],
7985
+ ["coding-agents", "build", ["uip.coder"]],
7566
7986
  ["agenthub", "build", ["uip.agenthub"]],
7567
7987
  ["coded-apps", "build", ["uip.codedapp"]],
7568
7988
  ["functions", "build", ["uip.function", "uip.functions"]],
@@ -7648,32 +8068,64 @@ function normalizeSkillName(value) {
7648
8068
  function buildCommandTelemetryAttribution(commandPath, skillSource) {
7649
8069
  const skillName = normalizeSkillName(skillSource);
7650
8070
  return {
7651
- ...skillName ? { skill_name: skillName } : {},
8071
+ ...skillName ? { SkillName: skillName } : {},
7652
8072
  ...getCommandProductModeAttribution(commandPath)
7653
8073
  };
7654
8074
  }
8075
+ var AGENT_SESSION_ENV = {
8076
+ [BaseDimensions.AgentModel]: "UIPATH_AGENT_MODEL",
8077
+ [SkillsDimensions.PermissionMode]: "UIPATH_PERMISSION_MODE",
8078
+ [SkillsDimensions.EffortLevel]: "UIPATH_EFFORT_LEVEL",
8079
+ [SkillsDimensions.SkillsVersion]: "UIPATH_SKILLS_VERSION"
8080
+ };
8081
+ var MAX_TELEMETRY_TOKEN_LENGTH = 120;
8082
+ function sanitizeTelemetryToken(value) {
8083
+ return value.replace(/[^A-Za-z0-9:._/ -]/g, "_").slice(0, MAX_TELEMETRY_TOKEN_LENGTH);
8084
+ }
8085
+ function buildAgentSessionTelemetry(env) {
8086
+ const dimensions = {};
8087
+ for (const [key, variable] of Object.entries(AGENT_SESSION_ENV)) {
8088
+ const value = env[variable]?.trim();
8089
+ if (value) {
8090
+ dimensions[key] = sanitizeTelemetryToken(value);
8091
+ }
8092
+ }
8093
+ return dimensions;
8094
+ }
7655
8095
 
7656
8096
  // ../../common/src/telemetry/command-name.ts
7657
- var TELEMETRY_COMMAND_ROOT = "uip";
8097
+ var TELEMETRY_NAME_ROOT = "Cli";
8098
+ var CLI_COMMAND_ROOT = "uip";
8099
+ var TELEMETRY_NAME_BARE_ACTION = "Invoke";
7658
8100
  function commandTelemetryName(parts) {
8101
+ const action = vetCommandTokens(parts).map(pascalizeToken).join("");
8102
+ return `${TELEMETRY_NAME_ROOT}.${action || TELEMETRY_NAME_BARE_ACTION}`;
8103
+ }
8104
+ function commandInvocationPath(parts) {
8105
+ return [CLI_COMMAND_ROOT, ...vetCommandTokens(parts)].join(" ");
8106
+ }
8107
+ function vetCommandTokens(parts) {
7659
8108
  const tokens = [];
7660
8109
  for (const part of parts) {
7661
- const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !== TELEMETRY_COMMAND_ROOT);
8110
+ const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !== CLI_COMMAND_ROOT);
7662
8111
  if (pieces.every(isCommandToken)) {
7663
8112
  tokens.push(...pieces);
7664
8113
  continue;
7665
8114
  }
7666
8115
  tokens.push(UNKNOWN_TOKEN);
7667
8116
  }
7668
- return [TELEMETRY_COMMAND_ROOT, ...tokens].join(".");
8117
+ return tokens;
7669
8118
  }
7670
- var COMMAND_TOKEN_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
8119
+ function pascalizeToken(token) {
8120
+ return token.split("-").filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
8121
+ }
8122
+ var COMMAND_TOKEN_PATTERN = /^[a-z][a-z0-9-]*$/;
7671
8123
  var MAX_COMMAND_TOKEN_LENGTH = 32;
7672
8124
  var GUID_TOKEN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
7673
8125
  function isCommandToken(token) {
7674
- return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token) && !/^\d+$/.test(token);
8126
+ return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token);
7675
8127
  }
7676
- var UNKNOWN_TOKEN = "<unknown>";
8128
+ var UNKNOWN_TOKEN = "unknown";
7677
8129
 
7678
8130
  // ../../common/src/telemetry/invocation-request.ts
7679
8131
  var requestContextSlot = singleton("TelemetryInvocationRequestContext");
@@ -7778,7 +8230,7 @@ function withheldArgumentValues(cmd) {
7778
8230
  });
7779
8231
  return values;
7780
8232
  }
7781
- function deriveCommandPath(cmd) {
8233
+ function deriveCommandParts(cmd) {
7782
8234
  const parts = [];
7783
8235
  let current = cmd;
7784
8236
  while (current) {
@@ -7791,14 +8243,13 @@ function deriveCommandPath(cmd) {
7791
8243
  if (parts.length > 1) {
7792
8244
  parts.shift();
7793
8245
  }
7794
- return commandTelemetryName(parts);
8246
+ return parts;
7795
8247
  }
7796
8248
  function isErrorContext(value) {
7797
8249
  return value !== null && typeof value === "object";
7798
8250
  }
7799
8251
  function commandHelpHint(commandPath) {
7800
- const command = commandPath.replace(/\./g, " ");
7801
- return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
8252
+ return `An unexpected error occurred. Run '${commandPath} --help' to verify command syntax, or run with --log-level debug for details.`;
7802
8253
  }
7803
8254
  function isPromptCancellation(error) {
7804
8255
  return error instanceof Error && error.name === "ExitPromptError";
@@ -7823,7 +8274,9 @@ Command.prototype.trackedAction = function(context, fn, properties) {
7823
8274
  yaml: getOutputFormat() === "yaml",
7824
8275
  filter: getOutputFilter() !== undefined
7825
8276
  });
7826
- const telemetryName = deriveCommandPath(command);
8277
+ const commandParts = deriveCommandParts(command);
8278
+ const telemetryName = commandTelemetryName(commandParts);
8279
+ const commandPath = commandInvocationPath(commandParts);
7827
8280
  const props = typeof properties === "function" ? properties(...args) : properties;
7828
8281
  markCommandStart();
7829
8282
  const supplied = recordSuppliedArgumentValues(withheldArgumentValues(command));
@@ -7858,7 +8311,7 @@ Command.prototype.trackedAction = function(context, fn, properties) {
7858
8311
  Result: finalResult,
7859
8312
  ...customErrorCode ? { ErrorCode: customErrorCode } : {},
7860
8313
  Message: errorMessage2,
7861
- Instructions: customInstructions ?? commandHelpHint(telemetryName),
8314
+ Instructions: customInstructions ?? commandHelpHint(commandPath),
7862
8315
  ...customRetry ? { Retry: customRetry } : {},
7863
8316
  ...customContext ? { Context: customContext } : {}
7864
8317
  });
@@ -7875,8 +8328,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
7875
8328
  recordedFailure,
7876
8329
  pollSignal: context.pollSignal
7877
8330
  });
7878
- if (terminalTelemetry.error_class === "internal" && error) {
7879
- telemetry.trackException(error instanceof Error ? error : new Error(String(error)), { command_name: telemetryName }, getInvocationRequestContext());
8331
+ if (terminalTelemetry[CommandDimensions.ErrorClass] === "internal" && error) {
8332
+ telemetry.trackException(error instanceof Error ? error : new Error(String(error)), { [CommandDimensions.CommandName]: commandPath }, getInvocationRequestContext());
7880
8333
  }
7881
8334
  const commandParams = extractCommandParams(command);
7882
8335
  if (props) {
@@ -7887,10 +8340,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
7887
8340
  const baseProperties = redactProperties({
7888
8341
  ...commandParams,
7889
8342
  ...props,
7890
- ...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
7891
- command: "true",
8343
+ ...buildCommandTelemetryAttribution(commandPath, process.env.UIPATH_SKILL),
8344
+ ...buildAgentSessionTelemetry(process.env),
8345
+ [CommandDimensions.CommandName]: commandPath,
8346
+ [CommandDimensions.IsCommand]: "true",
7892
8347
  ...terminalTelemetry,
7893
- ...errorMessage2 ? { errorMessage: errorMessage2 } : {}
8348
+ ...errorMessage2 ? { [CommandDimensions.ErrorMessage]: errorMessage2 } : {}
7894
8349
  });
7895
8350
  emitInvocationRequest(telemetryName, success, baseProperties);
7896
8351
  } finally {
@@ -8121,6 +8576,40 @@ var BOOLEAN_FLAGS = new Set(HOST_GLOBAL_FLAGS);
8121
8576
  // ../../common/src/interactivity-context.ts
8122
8577
  var modeSlot = singleton("InteractivityMode");
8123
8578
  var interactiveFlagSlot = singleton("InteractiveFlag");
8579
+ // ../../common/src/mime-types.ts
8580
+ var MIME_TYPES_BY_EXTENSION = Object.freeze({
8581
+ pdf: "application/pdf",
8582
+ png: "image/png",
8583
+ jpg: "image/jpeg",
8584
+ jpeg: "image/jpeg",
8585
+ gif: "image/gif",
8586
+ webp: "image/webp",
8587
+ bmp: "image/bmp",
8588
+ tif: "image/tiff",
8589
+ tiff: "image/tiff",
8590
+ svg: "image/svg+xml",
8591
+ txt: "text/plain",
8592
+ log: "text/plain",
8593
+ md: "text/markdown",
8594
+ csv: "text/csv",
8595
+ tsv: "text/tab-separated-values",
8596
+ json: "application/json",
8597
+ xml: "application/xml",
8598
+ html: "text/html",
8599
+ htm: "text/html",
8600
+ yaml: "application/yaml",
8601
+ yml: "application/yaml",
8602
+ doc: "application/msword",
8603
+ docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
8604
+ xls: "application/vnd.ms-excel",
8605
+ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
8606
+ ppt: "application/vnd.ms-powerpoint",
8607
+ pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
8608
+ zip: "application/zip",
8609
+ mp3: "audio/mpeg",
8610
+ wav: "audio/wav",
8611
+ mp4: "video/mp4"
8612
+ });
8124
8613
  // ../../common/src/polling/types.ts
8125
8614
  var PollOutcome = {
8126
8615
  Completed: "completed",
@@ -8422,7 +8911,7 @@ var package_default2 = {
8422
8911
  name: "@uipath/identity-sdk",
8423
8912
  author: "UiPath",
8424
8913
  license: "SEE LICENSE IN LICENSE.txt",
8425
- version: "1.203.0",
8914
+ version: "1.204.0",
8426
8915
  repository: {
8427
8916
  type: "git",
8428
8917
  url: "https://github.com/UiPath/cli.git",
@@ -8451,6 +8940,7 @@ var package_default2 = {
8451
8940
  private: true,
8452
8941
  scripts: {
8453
8942
  build: "bun build ./src/index.ts --outdir dist --format esm --target node --sourcemap=linked && tsc -p tsconfig.build.json --noCheck",
8943
+ typecheck: "tsc --noEmit",
8454
8944
  generate: "bun run src/scripts/generate-sdk.ts",
8455
8945
  lint: "biome check .",
8456
8946
  test: "vitest run",
@@ -10877,4 +11367,4 @@ export {
10877
11367
  registerCommands
10878
11368
  };
10879
11369
 
10880
- //# debugId=6E2EC35A8728EE7964756E2164756E21
11370
+ //# debugId=7343258477D9DBDD64756E2164756E21
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uipath/authz-commands",
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": "Admin CLI commands for the UiPath Authorization service. Library composed by admin-tool, not a standalone CLI tool.",
7
7
  "private": false,
8
8
  "repository": {
@@ -26,5 +26,5 @@
26
26
  "files": [
27
27
  "dist"
28
28
  ],
29
- "gitHead": "15094ce85cf76c59a54affbed3304febc271f41a"
29
+ "gitHead": "275e01f1f6098d4c3bc9673f5225f33372822534"
30
30
  }