@uipath/conversational-tool 1.203.0-preview.205 → 1.204.0-preview.206

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ import {
4
4
  getLoginStatusAsync,
5
5
  getSdkUserAgentToken,
6
6
  package_default
7
- } from "./tool-jdffzrjd.js";
7
+ } from "./tool-n7gsekbz.js";
8
8
  import"./tool-1yh8g550.js";
9
9
 
10
10
  // src/api/cas-client.ts
package/dist/index.js CHANGED
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  metadata,
4
4
  registerCommands
5
- } from "./tool-vhy8gmvh.js";
5
+ } from "./tool-2zvqmzay.js";
6
6
  import"./tool-nkyhbf79.js";
7
7
  import {
8
8
  Command
9
- } from "./tool-jdffzrjd.js";
9
+ } from "./tool-n7gsekbz.js";
10
10
  import"./tool-mpvp5rqs.js";
11
11
  import"./tool-1yh8g550.js";
12
12
 
@@ -20,7 +20,7 @@ import {
20
20
  parseBoundedInt,
21
21
  processContext,
22
22
  requireConfirmation
23
- } from "./tool-jdffzrjd.js";
23
+ } from "./tool-n7gsekbz.js";
24
24
  import {
25
25
  __require
26
26
  } from "./tool-1yh8g550.js";
@@ -12481,7 +12481,7 @@ var resolveEntryPoint = (entryPoints, requested) => {
12481
12481
  var resolveBinding = async (target) => {
12482
12482
  const processKey = target.processKey.toLowerCase();
12483
12483
  const folderKey = target.folderKey.toLowerCase();
12484
- const { listVoiceEntryPoints } = await import("./cas-client-f973xttc.js");
12484
+ const { listVoiceEntryPoints } = await import("./cas-client-820weswv.js");
12485
12485
  const [epError, entryPoints] = await catchError(listVoiceEntryPoints(processKey, folderKey));
12486
12486
  if (epError) {
12487
12487
  await failFromError(epError);
@@ -12497,7 +12497,7 @@ var resolveBinding = async (target) => {
12497
12497
  var registerTrunksCommand = (program) => {
12498
12498
  const trunks = program.command("trunks").description("Inspect the SIP trunks (phone numbers) configured for conversational voice.");
12499
12499
  trunks.command("list").description("List the tenant's SIP trunks. Voice flows dial out from an outbound-enabled trunk's phone number (`inputs.from` on Create outgoing call); inbound-enabled trunks route incoming calls to a published process. Trunks are connected in Instance Management under Phone numbers.").option("--direction <direction>", "Only trunks enabled for this call direction: inbound or outbound (default: all trunks)", parseDirection).trackedAction(processContext, async (options) => {
12500
- const { listSipTrunks } = await import("./cas-client-f973xttc.js");
12500
+ const { listSipTrunks } = await import("./cas-client-820weswv.js");
12501
12501
  const [listError, trunks2] = await catchError(listSipTrunks(options.direction));
12502
12502
  if (listError) {
12503
12503
  await failFromError(listError);
@@ -12513,7 +12513,7 @@ var registerTrunksCommand = (program) => {
12513
12513
  const plan = planAssign(options);
12514
12514
  if (plan === null)
12515
12515
  return;
12516
- const { resolveSipTrunk, updateSipTrunkBinding } = await import("./cas-client-f973xttc.js");
12516
+ const { resolveSipTrunk, updateSipTrunkBinding } = await import("./cas-client-820weswv.js");
12517
12517
  const [trunkError, trunk] = await catchError(resolveSipTrunk(trunkArg));
12518
12518
  if (trunkError) {
12519
12519
  await failFromError(trunkError);
@@ -2101,7 +2101,7 @@ var package_default = {
2101
2101
  name: "@uipath/conversational-tool",
2102
2102
  author: "UiPath",
2103
2103
  license: "SEE LICENSE IN LICENSE.txt",
2104
- version: "1.203.0-preview.205",
2104
+ version: "1.204.0-preview.206",
2105
2105
  description: "Handle conversations with deployed UiPath conversational processes.",
2106
2106
  publishConfig: {
2107
2107
  registry: "https://npm.pkg.github.com/"
@@ -2188,8 +2188,156 @@ function getGlobalTelemetryProperties() {
2188
2188
  return telemetryPropsSlot.get();
2189
2189
  }
2190
2190
 
2191
+ // ../common/src/telemetry/telemetry-dimensions.ts
2192
+ var BaseDimensions = {
2193
+ ApplicationName: "ApplicationName",
2194
+ ProductVersion: "ProductVersion",
2195
+ InstallationId: "InstallationId",
2196
+ CloudUserId: "CloudUserId",
2197
+ CloudTenantId: "CloudTenantId",
2198
+ CloudOrganizationId: "CloudOrganizationId",
2199
+ IsInternalUser: "IsInternalUser",
2200
+ Environment: "Environment",
2201
+ BaseUrl: "BaseUrl",
2202
+ Region: "Region",
2203
+ Agent: "Agent",
2204
+ AgentVersion: "AgentVersion",
2205
+ AgentModel: "AgentModel",
2206
+ ToolName: "ToolName",
2207
+ ToolVersion: "ToolVersion",
2208
+ ExecutionContext: "ExecutionContext",
2209
+ CiProvider: "CiProvider",
2210
+ SessionIdSource: "SessionIdSource",
2211
+ SessionId: "SessionId"
2212
+ };
2213
+ var CommandDimensions = {
2214
+ IsCommand: "IsCommand",
2215
+ IsReexec: "IsReexec",
2216
+ CommandName: "CommandName",
2217
+ ExitCode: "ExitCode",
2218
+ TerminalOutcome: "TerminalOutcome",
2219
+ ErrorClass: "ErrorClass",
2220
+ TerminalSignal: "TerminalSignal",
2221
+ ErrorMessage: "ErrorMessage",
2222
+ SkillName: "SkillName",
2223
+ ProductArea: "ProductArea",
2224
+ Mode: "Mode"
2225
+ };
2226
+ var ShipDimensions = {
2227
+ ShipKind: "ShipKind",
2228
+ Target: "Target",
2229
+ ProjectType: "ProjectType",
2230
+ ProjectTypes: "ProjectTypes",
2231
+ ArtifactCorrelationKey: "ArtifactCorrelationKey",
2232
+ PackageName: "PackageName",
2233
+ PackageVersion: "PackageVersion",
2234
+ PackageVersionKey: "PackageVersionKey",
2235
+ DeploymentKey: "DeploymentKey",
2236
+ SolutionId: "SolutionId",
2237
+ FolderKey: "FolderKey",
2238
+ FeedId: "FeedId"
2239
+ };
2240
+ var ErrorDimensions = {
2241
+ Result: "Result",
2242
+ ErrorCode: "ErrorCode",
2243
+ Retry: "Retry",
2244
+ ErrorMessage: "ErrorMessage"
2245
+ };
2246
+ var AuthDimensions = {
2247
+ AuthenticationMethod: "AuthenticationMethod",
2248
+ Success: "Success",
2249
+ Reason: "Reason"
2250
+ };
2251
+ var SkillsDimensions = {
2252
+ SchemaVersion: "SchemaVersion",
2253
+ AgentType: "AgentType",
2254
+ SkillsVersion: "SkillsVersion",
2255
+ UipSubcommand: "UipSubcommand",
2256
+ FileExtension: "FileExtension",
2257
+ SubagentModel: "SubagentModel",
2258
+ SubagentType: "SubagentType",
2259
+ PermissionMode: "PermissionMode",
2260
+ EffortLevel: "EffortLevel",
2261
+ SessionSource: "SessionSource",
2262
+ Outcome: "Outcome",
2263
+ DurationMs: "DurationMs",
2264
+ Source: "Source"
2265
+ };
2266
+ var PackagerDimensions = {
2267
+ ProjectId: "ProjectId",
2268
+ ProjectType: "ProjectType",
2269
+ SolutionId: "SolutionId"
2270
+ };
2271
+ var ScopeDimensions = {
2272
+ FolderId: "FolderId"
2273
+ };
2274
+ var ID_DIMENSIONS = new Set([
2275
+ BaseDimensions.CloudUserId,
2276
+ BaseDimensions.CloudTenantId,
2277
+ BaseDimensions.CloudOrganizationId,
2278
+ BaseDimensions.InstallationId,
2279
+ ShipDimensions.ArtifactCorrelationKey,
2280
+ ShipDimensions.PackageVersionKey,
2281
+ ShipDimensions.DeploymentKey,
2282
+ ShipDimensions.SolutionId,
2283
+ ShipDimensions.FolderKey,
2284
+ ShipDimensions.FeedId,
2285
+ PackagerDimensions.ProjectId
2286
+ ]);
2287
+ var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
2288
+ var RESERVED_DIMENSION_NAMES = new Set([
2289
+ ...Object.values(BaseDimensions),
2290
+ ...Object.values(CommandDimensions),
2291
+ ...Object.values(ShipDimensions),
2292
+ ...Object.values(ErrorDimensions),
2293
+ ...Object.values(AuthDimensions),
2294
+ ...Object.values(SkillsDimensions),
2295
+ ...Object.values(PackagerDimensions),
2296
+ ...Object.values(ScopeDimensions)
2297
+ ]);
2298
+ var CURATED_DIMENSIONS = new Set([
2299
+ BaseDimensions.ApplicationName,
2300
+ BaseDimensions.ProductVersion,
2301
+ BaseDimensions.InstallationId,
2302
+ BaseDimensions.CloudUserId,
2303
+ BaseDimensions.CloudTenantId,
2304
+ BaseDimensions.CloudOrganizationId,
2305
+ BaseDimensions.IsInternalUser,
2306
+ BaseDimensions.Environment,
2307
+ BaseDimensions.BaseUrl,
2308
+ BaseDimensions.Region,
2309
+ BaseDimensions.Agent,
2310
+ BaseDimensions.AgentVersion,
2311
+ BaseDimensions.ToolVersion,
2312
+ BaseDimensions.ExecutionContext,
2313
+ BaseDimensions.CiProvider,
2314
+ BaseDimensions.SessionIdSource,
2315
+ BaseDimensions.SessionId,
2316
+ ...Object.values(CommandDimensions),
2317
+ ...Object.values(ShipDimensions)
2318
+ ]);
2319
+ function lowercaseIdDimensionValues(properties) {
2320
+ let changed = false;
2321
+ const result = {
2322
+ ...properties
2323
+ };
2324
+ for (const key of Object.keys(result)) {
2325
+ const value = result[key];
2326
+ if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
2327
+ continue;
2328
+ }
2329
+ const lowered = value.toLowerCase();
2330
+ if (lowered !== value) {
2331
+ result[key] = lowered;
2332
+ changed = true;
2333
+ }
2334
+ }
2335
+ return changed ? result : properties;
2336
+ }
2337
+
2191
2338
  // ../common/src/sdk-user-agent.ts
2192
2339
  var USER_AGENT_HEADER = "User-Agent";
2340
+ var AGENT_PROPERTY = BaseDimensions.Agent;
2193
2341
  var sdkUserAgentHostToken = singleton("SdkUserAgentHostToken");
2194
2342
  function splitUserAgentTokens(value) {
2195
2343
  return value?.trim().split(/\s+/).filter(Boolean) ?? [];
@@ -2959,9 +3107,60 @@ function settlePromiseLike(thenable) {
2959
3107
  return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [toError(error), undefined]);
2960
3108
  }
2961
3109
 
3110
+ // ../common/src/error-graph.ts
3111
+ function* walkErrorGraph(error) {
3112
+ const queue = [error];
3113
+ const seen = new Set;
3114
+ for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
3115
+ const current = queue.shift();
3116
+ if (current === null || typeof current !== "object")
3117
+ continue;
3118
+ if (seen.has(current))
3119
+ continue;
3120
+ seen.add(current);
3121
+ const cur = current;
3122
+ yield cur;
3123
+ if (cur.cause !== undefined)
3124
+ queue.push(cur.cause);
3125
+ if (Array.isArray(cur.errors))
3126
+ queue.push(...cur.errors);
3127
+ }
3128
+ return;
3129
+ }
3130
+ function parseHttpStatusFromMessage(message) {
3131
+ const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
3132
+ if (!match)
3133
+ return;
3134
+ const status = Number(match[1]);
3135
+ return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
3136
+ }
3137
+ function findHttpStatusInGraph(error) {
3138
+ for (const node of walkErrorGraph(error)) {
3139
+ const response = node.response;
3140
+ const explicit = typeof node.status === "number" ? node.status : response?.status;
3141
+ if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
3142
+ return explicit;
3143
+ }
3144
+ if (typeof node.message === "string") {
3145
+ const parsed = parseHttpStatusFromMessage(node.message);
3146
+ if (parsed !== undefined && parsed >= 400) {
3147
+ return parsed;
3148
+ }
3149
+ }
3150
+ }
3151
+ return;
3152
+ }
3153
+
3154
+ // ../common/src/local-permission-codes.ts
3155
+ var LOCAL_PERMISSION_ERROR_CODES = new Set([
3156
+ "EACCES",
3157
+ "EPERM",
3158
+ "EROFS"
3159
+ ]);
3160
+
2962
3161
  // ../common/src/error-handler.ts
2963
- var DEFAULT_401 = "Unauthorized (401). Run `uip login` to authenticate.";
2964
- var DEFAULT_403 = "Forbidden (403). Ensure the account has the required permissions.";
3162
+ 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.";
3163
+ 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.";
2965
3164
  var DEFAULT_405 = "Method Not Allowed (405). The endpoint may not exist or the base URL may be incorrect.";
2966
3165
  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.";
2967
3166
  var HTML_RESPONSE_MESSAGE = "Received HTML instead of the expected JSON response.";
@@ -2988,14 +3187,14 @@ var TLS_ERROR_CODES = new Set([
2988
3187
  ]);
2989
3188
  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.";
2990
3189
  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.";
2991
- var LOCAL_PERMISSION_ERROR_CODES = new Set(["EACCES", "EPERM", "EROFS"]);
2992
- var LOCAL_PERMISSION_MESSAGE_PATTERN = /\b(EACCES|EPERM|EROFS)\b/;
3190
+ var LOCAL_PERMISSION_MESSAGE_PATTERN = new RegExp(`\\b(${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})\\b`);
2993
3191
  function localPermissionInstructions(code, path2) {
2994
3192
  const target = path2 !== undefined ? `'${path2}'` : "a local file or resource";
2995
3193
  if (code === "EROFS") {
2996
3194
  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.";
2997
3195
  }
2998
- 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.";
3196
+ const onWindows = typeof process !== "undefined" && process.platform === "win32";
3197
+ 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.";
2999
3198
  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}`;
3000
3199
  }
3001
3200
  function describeConnectivityError(error) {
@@ -3049,48 +3248,6 @@ function localPermissionPath(path2, message) {
3049
3248
  return path2;
3050
3249
  return message ? /'([^']+)'/.exec(message)?.[1] : undefined;
3051
3250
  }
3052
- function* walkErrorGraph(error) {
3053
- const queue = [error];
3054
- const seen = new Set;
3055
- for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
3056
- const current = queue.shift();
3057
- if (current === null || typeof current !== "object")
3058
- continue;
3059
- if (seen.has(current))
3060
- continue;
3061
- seen.add(current);
3062
- const cur = current;
3063
- yield cur;
3064
- if (cur.cause !== undefined)
3065
- queue.push(cur.cause);
3066
- if (Array.isArray(cur.errors))
3067
- queue.push(...cur.errors);
3068
- }
3069
- return;
3070
- }
3071
- function parseHttpStatusFromMessage(message) {
3072
- const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
3073
- if (!match)
3074
- return;
3075
- const status = Number(match[1]);
3076
- return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
3077
- }
3078
- function findHttpStatusInGraph(error) {
3079
- for (const node of walkErrorGraph(error)) {
3080
- const response = node.response;
3081
- const explicit = typeof node.status === "number" ? node.status : response?.status;
3082
- if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
3083
- return explicit;
3084
- }
3085
- if (typeof node.message === "string") {
3086
- const parsed = parseHttpStatusFromMessage(node.message);
3087
- if (parsed !== undefined && parsed >= 400) {
3088
- return parsed;
3089
- }
3090
- }
3091
- }
3092
- return;
3093
- }
3094
3251
  function isHtmlDocument(body) {
3095
3252
  return /^\s*(<!doctype html|<html\b)/i.test(body);
3096
3253
  }
@@ -3628,6 +3785,9 @@ var AUTH_ERROR_CODES = new Set([
3628
3785
  "authentication_required",
3629
3786
  "permission_denied"
3630
3787
  ]);
3788
+ var LOCAL_PERMISSION_CLI_ERROR_CODES = new Set([
3789
+ "local_permission_denied"
3790
+ ]);
3631
3791
  var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
3632
3792
  var NETWORK_HTTP_ERROR_CODES = new Set([
3633
3793
  "network_error",
@@ -3768,6 +3928,9 @@ function classifyFromErrorCode(errorCode) {
3768
3928
  if (AUTH_ERROR_CODES.has(errorCode)) {
3769
3929
  return "auth";
3770
3930
  }
3931
+ if (LOCAL_PERMISSION_CLI_ERROR_CODES.has(errorCode)) {
3932
+ return "local_permission";
3933
+ }
3771
3934
  if (VALIDATION_ERROR_CODES.has(errorCode)) {
3772
3935
  return "validation";
3773
3936
  }
@@ -3779,6 +3942,15 @@ function classifyFromErrorCode(errorCode) {
3779
3942
  }
3780
3943
  return;
3781
3944
  }
3945
+ function hasLocalPermissionCode(error) {
3946
+ for (const node of walkErrorGraph(error)) {
3947
+ const code = node.code;
3948
+ if (typeof code === "string" && LOCAL_PERMISSION_ERROR_CODES.has(code)) {
3949
+ return true;
3950
+ }
3951
+ }
3952
+ return false;
3953
+ }
3782
3954
  function classifyFromError(error) {
3783
3955
  const code = findCodeInCauseChain(error);
3784
3956
  if (code) {
@@ -3795,6 +3967,9 @@ function classifyFromError(error) {
3795
3967
  return "missing_dependency";
3796
3968
  }
3797
3969
  }
3970
+ if (hasLocalPermissionCode(error)) {
3971
+ return "local_permission";
3972
+ }
3798
3973
  const message = stringField(error, "message");
3799
3974
  if (message?.includes("fetch failed") === true) {
3800
3975
  return "network_http";
@@ -3810,7 +3985,7 @@ function classifyError2(input) {
3810
3985
  if (recorded?.errorClass) {
3811
3986
  return recorded.errorClass;
3812
3987
  }
3813
- const status = recorded?.context?.httpStatus;
3988
+ const status = recorded?.context?.httpStatus ?? findHttpStatusInGraph(input.error);
3814
3989
  if (status !== undefined) {
3815
3990
  return classifyHttpStatus(status);
3816
3991
  }
@@ -3833,17 +4008,18 @@ function buildCommandTerminalTelemetryProperties(input) {
3833
4008
  const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError2(input);
3834
4009
  const terminalSignal = terminalSignalFor(input, outcome);
3835
4010
  return {
3836
- exit_code: input.exitCode,
3837
- terminal_outcome: outcome,
3838
- ...errorClass ? { error_class: errorClass } : {},
3839
- ...terminalSignal ? { terminal_signal: terminalSignal } : {}
4011
+ [CommandDimensions.ExitCode]: input.exitCode,
4012
+ [CommandDimensions.TerminalOutcome]: outcome,
4013
+ ...errorClass ? { [CommandDimensions.ErrorClass]: errorClass } : {},
4014
+ ...terminalSignal ? { [CommandDimensions.TerminalSignal]: terminalSignal } : {}
3840
4015
  };
3841
4016
  }
3842
4017
 
3843
4018
  // ../common/src/telemetry/telemetry-events.ts
3844
4019
  var CommonTelemetryEvents = {
3845
- Error: "uip.error",
3846
- ShipSucceeded: "uip.ship.succeeded"
4020
+ Start: "Application.Start",
4021
+ Error: "Application.Error",
4022
+ ShipSucceeded: "Cli.ShipSucceeded"
3847
4023
  };
3848
4024
 
3849
4025
  // ../common/src/registry.ts
@@ -4051,8 +4227,8 @@ function detectExecutionContext(options = {}) {
4051
4227
  function getExecutionContextTelemetryProperties() {
4052
4228
  const detected = detectExecutionContext();
4053
4229
  return {
4054
- execution_context: detected.executionContext,
4055
- ...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
4230
+ [BaseDimensions.ExecutionContext]: detected.executionContext,
4231
+ ...detected.ciProvider ? { [BaseDimensions.CiProvider]: detected.ciProvider } : {}
4056
4232
  };
4057
4233
  }
4058
4234
  // ../common/src/telemetry/node-context-storage.ts
@@ -4095,7 +4271,7 @@ function getInboundTraceContext() {
4095
4271
  var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
4096
4272
  var SESSION_ID_MAX_LENGTH = 64;
4097
4273
  var RANDOM_SESSION_ID_LENGTH = 32;
4098
- var TELEMETRY_SESSION_SOURCE_PROPERTY = "session_id_source";
4274
+ var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
4099
4275
  var CONTROL_CHARACTERS = /\p{Cc}/gu;
4100
4276
  var INHERITED_SESSION_SOURCES = [
4101
4277
  { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
@@ -4147,6 +4323,9 @@ function resolveTelemetrySession() {
4147
4323
  telemetrySessionSlot.set(resolved);
4148
4324
  return resolved;
4149
4325
  }
4326
+ function getTelemetrySessionId() {
4327
+ return resolveTelemetrySession().id;
4328
+ }
4150
4329
  function getTelemetrySessionSource() {
4151
4330
  return resolveTelemetrySession().source;
4152
4331
  }
@@ -4221,7 +4400,10 @@ class TelemetryService {
4221
4400
  } catch (error) {
4222
4401
  const durationMs = clock.elapsedMs();
4223
4402
  const err = error instanceof Error ? error : new Error(String(error));
4224
- await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, { ...properties, errorMessage: err.message }, context));
4403
+ await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, {
4404
+ ...properties,
4405
+ [CommandDimensions.ErrorMessage]: err.message
4406
+ }, context));
4225
4407
  throw error;
4226
4408
  }
4227
4409
  }
@@ -4292,7 +4474,10 @@ class TelemetryService {
4292
4474
  const durationMs = clock.elapsedMs();
4293
4475
  const err = error instanceof Error ? error : new Error(String(error));
4294
4476
  await this.telemetryProvider.trackDependency({
4295
- ...this.spanFor(name, durationMs, false, { ...properties, errorMessage: err.message }, childContext),
4477
+ ...this.spanFor(name, durationMs, false, {
4478
+ ...properties,
4479
+ [CommandDimensions.ErrorMessage]: err.message
4480
+ }, childContext),
4296
4481
  type
4297
4482
  });
4298
4483
  throw error;
@@ -4327,9 +4512,10 @@ class TelemetryService {
4327
4512
  ...globalProperties,
4328
4513
  ...this.defaultProperties,
4329
4514
  ...redactProperties(properties ?? {}),
4330
- [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource()
4515
+ [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
4516
+ [BaseDimensions.SessionId]: this.telemetryProvider.getSessionId?.() ?? getTelemetrySessionId()
4331
4517
  };
4332
- return enriched;
4518
+ return lowercaseIdDimensionValues(enriched);
4333
4519
  }
4334
4520
  generateId() {
4335
4521
  const bytes = new Uint8Array(8);
@@ -5090,7 +5276,165 @@ class FilterImplicitLimitError extends Error {
5090
5276
  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).";
5091
5277
  }
5092
5278
  }
5093
- function applyFilter(data, filter) {
5279
+ function countRecords(data) {
5280
+ if (Array.isArray(data))
5281
+ return data.length;
5282
+ return data == null ? 0 : 1;
5283
+ }
5284
+ function availableFields(data) {
5285
+ const records = Array.isArray(data) ? data : [data];
5286
+ const keys = new Set;
5287
+ for (const record of records) {
5288
+ if (record && typeof record === "object" && !Array.isArray(record)) {
5289
+ for (const key of Object.keys(record))
5290
+ keys.add(key);
5291
+ }
5292
+ }
5293
+ return [...keys];
5294
+ }
5295
+ function decodeQuotedIdentifier(whole, inner) {
5296
+ const [error, decoded] = catchError(() => JSON.parse(whole));
5297
+ if (!error && typeof decoded === "string")
5298
+ return decoded;
5299
+ return inner.replace(/\\(.)/g, "$1");
5300
+ }
5301
+ function referencedFields(filter) {
5302
+ const top = new Set;
5303
+ const nested = new Set;
5304
+ const withoutValueLiterals = filter.replace(/'(?:\\.|[^'\\])*'/g, " ").replace(/`(?:\\.|[^`\\])*`/g, " ");
5305
+ const isPathTail = (text, index) => text[index - 1] === "." && /[A-Za-z0-9_"]/.test(text[index - 2] ?? "");
5306
+ const quoted = [];
5307
+ const withoutLiterals = withoutValueLiterals.replace(/"((?:\\.|[^"\\])*)"/g, (whole, name, index) => {
5308
+ const isAlias = /^\s*:/.test(withoutValueLiterals.slice(index + whole.length));
5309
+ if (!isAlias) {
5310
+ quoted.push({
5311
+ name: decodeQuotedIdentifier(whole, name),
5312
+ index,
5313
+ tail: isPathTail(withoutValueLiterals, index)
5314
+ });
5315
+ }
5316
+ return `"${" ".repeat(whole.length - 2)}"`;
5317
+ });
5318
+ const descent = /[A-Za-z0-9_"]\s*[.[]/.exec(withoutLiterals);
5319
+ const rootEnd = descent ? descent.index + 1 : Number.POSITIVE_INFINITY;
5320
+ const place = (name, index, tail) => {
5321
+ if (tail || index >= rootEnd)
5322
+ nested.add(name);
5323
+ else
5324
+ top.add(name);
5325
+ };
5326
+ for (const entry of quoted)
5327
+ place(entry.name, entry.index, entry.tail);
5328
+ const identifiers = withoutLiterals.matchAll(/([A-Za-z_][A-Za-z0-9_]*)(\s*[:(])?/g);
5329
+ const reserved = new Set(["true", "false", "null", "and", "or", "not"]);
5330
+ for (const match of identifiers) {
5331
+ const [, name, trailing] = match;
5332
+ if (trailing || reserved.has(name))
5333
+ continue;
5334
+ place(name, match.index, isPathTail(withoutLiterals, match.index));
5335
+ }
5336
+ return {
5337
+ top: [...top],
5338
+ nested: [...nested].filter((name) => !top.has(name)),
5339
+ hasPredicate: /\[\s*\?/.test(withoutValueLiterals)
5340
+ };
5341
+ }
5342
+ function appearsBelowTopLevel(data, name) {
5343
+ let budget = 2000;
5344
+ const visit = (value, depth) => {
5345
+ if (budget-- <= 0 || depth > 4)
5346
+ return false;
5347
+ if (value === null || typeof value !== "object")
5348
+ return false;
5349
+ if (Array.isArray(value))
5350
+ return value.some((entry) => visit(entry, depth));
5351
+ const record = value;
5352
+ if (depth > 0 && Object.hasOwn(record, name))
5353
+ return true;
5354
+ return Object.values(record).some((entry) => visit(entry, depth + 1));
5355
+ };
5356
+ return visit(data, 0);
5357
+ }
5358
+ function alwaysNullKeys(records) {
5359
+ const objects = records.filter((r) => r != null && typeof r === "object" && !Array.isArray(r));
5360
+ if (objects.length === 0 || objects.length !== records.length)
5361
+ return [];
5362
+ const keys = [...new Set(objects.flatMap((o) => Object.keys(o)))];
5363
+ if (keys.length === 0)
5364
+ return [];
5365
+ const nullKeys = keys.filter((key) => objects.every((record) => record[key] === null));
5366
+ return nullKeys.length === keys.length ? nullKeys : [];
5367
+ }
5368
+ function carriesOnlyNulls(value) {
5369
+ if (value === null)
5370
+ return true;
5371
+ if (Array.isArray(value)) {
5372
+ return value.length > 0 && value.every(carriesOnlyNulls);
5373
+ }
5374
+ if (typeof value === "object" && value !== undefined) {
5375
+ const values = Object.values(value);
5376
+ return values.length > 0 && values.every(carriesOnlyNulls);
5377
+ }
5378
+ return false;
5379
+ }
5380
+ function nameList(names, cap2 = 12) {
5381
+ const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
5382
+ const rest = names.length - shown.length;
5383
+ return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
5384
+ }
5385
+ function buildFilterWarning(filter, data, outcome) {
5386
+ const present = availableFields(data);
5387
+ const refs = referencedFields(filter);
5388
+ const unknown = refs.top.filter((name) => !present.includes(name) && !appearsBelowTopLevel(data, name));
5389
+ const unchecked = refs.nested.filter((name) => !present.includes(name));
5390
+ const count = countRecords(data);
5391
+ const scope = `${count} record(s)`;
5392
+ const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
5393
+ 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" : "";
5394
+ const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
5395
+ let detail;
5396
+ let lede;
5397
+ if (outcome.kind === "null-elements") {
5398
+ lede = "returned only null values";
5399
+ const projected = `all ${outcome.count} of the elements it projected are null`;
5400
+ if (unknown.length > 0) {
5401
+ detail = `${projected}, because ${isNotAField(unknown)}`;
5402
+ } else if (unchecked.length > 0) {
5403
+ detail = withSoundness(projected);
5404
+ } else {
5405
+ 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`;
5406
+ }
5407
+ } else if (outcome.kind === "null-rows") {
5408
+ lede = "returned only null values";
5409
+ const projected = `every value it projected is null on all ${outcome.count} row(s)`;
5410
+ detail = unknown.length > 0 ? `${projected}, because ${isNotAField(unknown)}` : withSoundness(projected);
5411
+ } else if (outcome.kind === "null-values") {
5412
+ lede = "returned only null values";
5413
+ const projected = `every key it projected (${nameList(outcome.keys)}) is null`;
5414
+ const sameSet = unknown.length === outcome.keys.length && outcome.keys.every((k) => unknown.includes(k));
5415
+ if (sameSet) {
5416
+ detail = `${isNotAField(outcome.keys)}, so every key it projected is null`;
5417
+ } else if (unknown.length > 0) {
5418
+ detail = `${projected}, because ${isNotAField(unknown)}`;
5419
+ } else {
5420
+ detail = withSoundness(`${projected} on all ${scope}`);
5421
+ }
5422
+ } else {
5423
+ lede = "returned nothing";
5424
+ if (unknown.length > 0) {
5425
+ detail = isNotAField(unknown);
5426
+ } else {
5427
+ const selection = refs.hasPredicate ? "no record matched" : "the expression resolved to no value";
5428
+ detail = withSoundness(`${selection} — it read ${scope}`);
5429
+ }
5430
+ }
5431
+ const fields = present.length > 0 ? ` Available fields: ${nameList(present)}.` : "";
5432
+ return `--output-filter ${JSON.stringify(filter)} ${lede}: ${detail}.${fields}`;
5433
+ }
5434
+ function appendWarning(existing, note) {
5435
+ return existing ? `${existing} ${note}` : note;
5436
+ }
5437
+ function applyFilter(data, filter, onWarning) {
5094
5438
  const codec = requireJmespath();
5095
5439
  let result;
5096
5440
  try {
@@ -5098,9 +5442,34 @@ function applyFilter(data, filter) {
5098
5442
  } catch (err) {
5099
5443
  throw new FilterEvaluationError(filter, err);
5100
5444
  }
5101
- if (result == null)
5445
+ const inputCount = countRecords(data);
5446
+ const warn = (outcome) => {
5447
+ if (inputCount === 0)
5448
+ return;
5449
+ const note = buildFilterWarning(filter, data, outcome);
5450
+ getOutputSink().writeErr(`[WARN] ${note}
5451
+ `);
5452
+ onWarning?.(note);
5453
+ };
5454
+ const warnIfAllNull = (records) => {
5455
+ const keys = alwaysNullKeys(records);
5456
+ if (keys.length > 0)
5457
+ warn({ kind: "null-values", keys });
5458
+ };
5459
+ if (result == null) {
5460
+ warn({ kind: "empty" });
5102
5461
  return [];
5462
+ }
5103
5463
  if (Array.isArray(result)) {
5464
+ if (result.length === 0) {
5465
+ warn({ kind: "empty" });
5466
+ } else if (result.every((entry) => entry === null)) {
5467
+ warn({ kind: "null-elements", count: result.length });
5468
+ } else if (result.every((entry) => Array.isArray(entry)) && carriesOnlyNulls(result)) {
5469
+ warn({ kind: "null-rows", count: result.length });
5470
+ } else {
5471
+ warnIfAllNull(result);
5472
+ }
5104
5473
  if (result.length > 0 && typeof result[0] !== "object") {
5105
5474
  const fieldMatch = filter.match(/\.(\w+)$/);
5106
5475
  const key = fieldMatch ? fieldMatch[1] : "Value";
@@ -5108,10 +5477,30 @@ function applyFilter(data, filter) {
5108
5477
  }
5109
5478
  return result;
5110
5479
  }
5111
- if (typeof result === "object")
5480
+ if (typeof result === "object") {
5481
+ warnIfAllNull([result]);
5112
5482
  return result;
5483
+ }
5113
5484
  return { Value: result };
5114
5485
  }
5486
+ function filterFailureData(envelope) {
5487
+ const filter = getOutputFilter();
5488
+ const data = envelope.Data;
5489
+ if (!filter || data == null)
5490
+ return;
5491
+ let note;
5492
+ const [filterError, filtered] = catchError(() => applyFilter(data, filter, (n) => {
5493
+ note = n;
5494
+ }));
5495
+ if (filterError) {
5496
+ envelope.Warning = appendWarning(envelope.Warning, `--output-filter was not applied, so Data is shown in full: ${filterError.message}`);
5497
+ return;
5498
+ }
5499
+ envelope.Data = filtered;
5500
+ if (note) {
5501
+ envelope.Warning = appendWarning(envelope.Warning, note);
5502
+ }
5503
+ }
5115
5504
  function defaultErrorCodeForResult(result) {
5116
5505
  switch (result) {
5117
5506
  case RESULTS.AuthenticationError:
@@ -5155,7 +5544,7 @@ function defaultErrorCodeForHttpStatus(status) {
5155
5544
  return "server_error";
5156
5545
  return;
5157
5546
  }
5158
- var LOCAL_PERMISSION_TEXT_PATTERN = /(?:\b|\()(?:EACCES|EPERM|EROFS)(?::\s|\))/;
5547
+ var LOCAL_PERMISSION_TEXT_PATTERN = new RegExp(`(?:\\b|\\()(?:${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})(?::\\s|\\))`);
5159
5548
  function defaultErrorCodeForFailure(data) {
5160
5549
  if (data.Result === RESULTS.Failure) {
5161
5550
  const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage2(data.Message);
@@ -5194,8 +5583,14 @@ var OutputFormatter;
5194
5583
  }
5195
5584
  const filter = getOutputFilter();
5196
5585
  if (filter) {
5197
- const filtered = applyFilter(data.Data, filter);
5586
+ let note;
5587
+ const filtered = applyFilter(data.Data, filter, (n) => {
5588
+ note = n;
5589
+ });
5198
5590
  data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
5591
+ if (note) {
5592
+ data.Warning = appendWarning(data.Warning, note);
5593
+ }
5199
5594
  }
5200
5595
  logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
5201
5596
  }
@@ -5223,12 +5618,13 @@ var OutputFormatter;
5223
5618
  delete envelope.TelemetryErrorClass;
5224
5619
  delete envelope.TelemetryTerminalOutcome;
5225
5620
  delete envelope.TelemetryTerminalSignal;
5621
+ filterFailureData(envelope);
5226
5622
  if (!suppressTelemetry) {
5227
5623
  telemetry.trackEvent(CommonTelemetryEvents.Error, {
5228
- result: data.Result,
5229
- errorCode: data.ErrorCode,
5230
- retry: data.Retry,
5231
- message: data.Message
5624
+ [ErrorDimensions.Result]: data.Result,
5625
+ [ErrorDimensions.ErrorCode]: data.ErrorCode,
5626
+ [ErrorDimensions.Retry]: data.Retry,
5627
+ [ErrorDimensions.ErrorMessage]: data.Message
5232
5628
  });
5233
5629
  }
5234
5630
  logOutput(normalizeOutputKeys(envelope), getOutputFormat());
@@ -5271,13 +5667,20 @@ var OutputFormatter;
5271
5667
  OutputFormatter.log = log;
5272
5668
  function formatToString(data) {
5273
5669
  const filter = getOutputFilter();
5670
+ const envelope = data;
5274
5671
  if ("Data" in data && data.Data != null) {
5275
5672
  data.Data = normalizeDataKeys(data.Data);
5276
5673
  if (filter) {
5277
- data.Data = normalizeDataKeys(applyFilter(data.Data, filter));
5674
+ let note;
5675
+ data.Data = normalizeDataKeys(applyFilter(data.Data, filter, (n) => {
5676
+ note = n;
5677
+ }));
5678
+ if (note) {
5679
+ envelope.Warning = appendWarning(envelope.Warning, note);
5680
+ }
5278
5681
  }
5279
5682
  }
5280
- const output = normalizeOutputKeys(data);
5683
+ const output = normalizeOutputKeys(envelope);
5281
5684
  const lines = [];
5282
5685
  const sink = getOutputSink();
5283
5686
  printOutput(output, getOutputFormat(), (msg) => {
@@ -5311,7 +5714,7 @@ var LEGACY_SKILL_NAMESPACE = "uipath:";
5311
5714
  var MAX_SKILL_NAME_LENGTH = 80;
5312
5715
  var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
5313
5716
  function productMode(productArea, mode) {
5314
- return { product_area: productArea, mode };
5717
+ return { ProductArea: productArea, Mode: mode };
5315
5718
  }
5316
5719
  function attributionRecord(groups) {
5317
5720
  const record = {};
@@ -5369,6 +5772,7 @@ var COMMAND_ATTRIBUTION = commandAttribution([
5369
5772
  ["rpa", "build", ["uip.rpa-legacy"]],
5370
5773
  ["conversational", "operate", ["uip.conversational"]],
5371
5774
  ["agents", "build", ["uip.codedagent", "uip.agent"]],
5775
+ ["coding-agents", "build", ["uip.coder"]],
5372
5776
  ["agenthub", "build", ["uip.agenthub"]],
5373
5777
  ["coded-apps", "build", ["uip.codedapp"]],
5374
5778
  ["functions", "build", ["uip.function", "uip.functions"]],
@@ -5454,32 +5858,64 @@ function normalizeSkillName(value) {
5454
5858
  function buildCommandTelemetryAttribution(commandPath, skillSource) {
5455
5859
  const skillName = normalizeSkillName(skillSource);
5456
5860
  return {
5457
- ...skillName ? { skill_name: skillName } : {},
5861
+ ...skillName ? { SkillName: skillName } : {},
5458
5862
  ...getCommandProductModeAttribution(commandPath)
5459
5863
  };
5460
5864
  }
5865
+ var AGENT_SESSION_ENV = {
5866
+ [BaseDimensions.AgentModel]: "UIPATH_AGENT_MODEL",
5867
+ [SkillsDimensions.PermissionMode]: "UIPATH_PERMISSION_MODE",
5868
+ [SkillsDimensions.EffortLevel]: "UIPATH_EFFORT_LEVEL",
5869
+ [SkillsDimensions.SkillsVersion]: "UIPATH_SKILLS_VERSION"
5870
+ };
5871
+ var MAX_TELEMETRY_TOKEN_LENGTH = 120;
5872
+ function sanitizeTelemetryToken(value) {
5873
+ return value.replace(/[^A-Za-z0-9:._/ -]/g, "_").slice(0, MAX_TELEMETRY_TOKEN_LENGTH);
5874
+ }
5875
+ function buildAgentSessionTelemetry(env) {
5876
+ const dimensions = {};
5877
+ for (const [key, variable] of Object.entries(AGENT_SESSION_ENV)) {
5878
+ const value = env[variable]?.trim();
5879
+ if (value) {
5880
+ dimensions[key] = sanitizeTelemetryToken(value);
5881
+ }
5882
+ }
5883
+ return dimensions;
5884
+ }
5461
5885
 
5462
5886
  // ../common/src/telemetry/command-name.ts
5463
- var TELEMETRY_COMMAND_ROOT = "uip";
5887
+ var TELEMETRY_NAME_ROOT = "Cli";
5888
+ var CLI_COMMAND_ROOT = "uip";
5889
+ var TELEMETRY_NAME_BARE_ACTION = "Invoke";
5464
5890
  function commandTelemetryName(parts) {
5891
+ const action = vetCommandTokens(parts).map(pascalizeToken).join("");
5892
+ return `${TELEMETRY_NAME_ROOT}.${action || TELEMETRY_NAME_BARE_ACTION}`;
5893
+ }
5894
+ function commandInvocationPath(parts) {
5895
+ return [CLI_COMMAND_ROOT, ...vetCommandTokens(parts)].join(" ");
5896
+ }
5897
+ function vetCommandTokens(parts) {
5465
5898
  const tokens = [];
5466
5899
  for (const part of parts) {
5467
- const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !== TELEMETRY_COMMAND_ROOT);
5900
+ const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !== CLI_COMMAND_ROOT);
5468
5901
  if (pieces.every(isCommandToken)) {
5469
5902
  tokens.push(...pieces);
5470
5903
  continue;
5471
5904
  }
5472
5905
  tokens.push(UNKNOWN_TOKEN);
5473
5906
  }
5474
- return [TELEMETRY_COMMAND_ROOT, ...tokens].join(".");
5907
+ return tokens;
5475
5908
  }
5476
- var COMMAND_TOKEN_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
5909
+ function pascalizeToken(token) {
5910
+ return token.split("-").filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
5911
+ }
5912
+ var COMMAND_TOKEN_PATTERN = /^[a-z][a-z0-9-]*$/;
5477
5913
  var MAX_COMMAND_TOKEN_LENGTH = 32;
5478
5914
  var GUID_TOKEN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
5479
5915
  function isCommandToken(token) {
5480
- return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token) && !/^\d+$/.test(token);
5916
+ return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token);
5481
5917
  }
5482
- var UNKNOWN_TOKEN = "<unknown>";
5918
+ var UNKNOWN_TOKEN = "unknown";
5483
5919
 
5484
5920
  // ../common/src/telemetry/invocation-request.ts
5485
5921
  var requestContextSlot = singleton("TelemetryInvocationRequestContext");
@@ -5584,7 +6020,7 @@ function withheldArgumentValues(cmd) {
5584
6020
  });
5585
6021
  return values;
5586
6022
  }
5587
- function deriveCommandPath(cmd) {
6023
+ function deriveCommandParts(cmd) {
5588
6024
  const parts = [];
5589
6025
  let current = cmd;
5590
6026
  while (current) {
@@ -5597,14 +6033,13 @@ function deriveCommandPath(cmd) {
5597
6033
  if (parts.length > 1) {
5598
6034
  parts.shift();
5599
6035
  }
5600
- return commandTelemetryName(parts);
6036
+ return parts;
5601
6037
  }
5602
6038
  function isErrorContext(value) {
5603
6039
  return value !== null && typeof value === "object";
5604
6040
  }
5605
6041
  function commandHelpHint(commandPath) {
5606
- const command = commandPath.replace(/\./g, " ");
5607
- return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
6042
+ return `An unexpected error occurred. Run '${commandPath} --help' to verify command syntax, or run with --log-level debug for details.`;
5608
6043
  }
5609
6044
  function isPromptCancellation(error) {
5610
6045
  return error instanceof Error && error.name === "ExitPromptError";
@@ -5629,7 +6064,9 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5629
6064
  yaml: getOutputFormat() === "yaml",
5630
6065
  filter: getOutputFilter() !== undefined
5631
6066
  });
5632
- const telemetryName = deriveCommandPath(command);
6067
+ const commandParts = deriveCommandParts(command);
6068
+ const telemetryName = commandTelemetryName(commandParts);
6069
+ const commandPath = commandInvocationPath(commandParts);
5633
6070
  const props = typeof properties === "function" ? properties(...args) : properties;
5634
6071
  markCommandStart();
5635
6072
  const supplied = recordSuppliedArgumentValues(withheldArgumentValues(command));
@@ -5664,7 +6101,7 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5664
6101
  Result: finalResult,
5665
6102
  ...customErrorCode ? { ErrorCode: customErrorCode } : {},
5666
6103
  Message: errorMessage,
5667
- Instructions: customInstructions ?? commandHelpHint(telemetryName),
6104
+ Instructions: customInstructions ?? commandHelpHint(commandPath),
5668
6105
  ...customRetry ? { Retry: customRetry } : {},
5669
6106
  ...customContext ? { Context: customContext } : {}
5670
6107
  });
@@ -5681,8 +6118,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5681
6118
  recordedFailure,
5682
6119
  pollSignal: context.pollSignal
5683
6120
  });
5684
- if (terminalTelemetry.error_class === "internal" && error) {
5685
- telemetry.trackException(error instanceof Error ? error : new Error(String(error)), { command_name: telemetryName }, getInvocationRequestContext());
6121
+ if (terminalTelemetry[CommandDimensions.ErrorClass] === "internal" && error) {
6122
+ telemetry.trackException(error instanceof Error ? error : new Error(String(error)), { [CommandDimensions.CommandName]: commandPath }, getInvocationRequestContext());
5686
6123
  }
5687
6124
  const commandParams = extractCommandParams(command);
5688
6125
  if (props) {
@@ -5693,10 +6130,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
5693
6130
  const baseProperties = redactProperties({
5694
6131
  ...commandParams,
5695
6132
  ...props,
5696
- ...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
5697
- command: "true",
6133
+ ...buildCommandTelemetryAttribution(commandPath, process.env.UIPATH_SKILL),
6134
+ ...buildAgentSessionTelemetry(process.env),
6135
+ [CommandDimensions.CommandName]: commandPath,
6136
+ [CommandDimensions.IsCommand]: "true",
5698
6137
  ...terminalTelemetry,
5699
- ...errorMessage ? { errorMessage } : {}
6138
+ ...errorMessage ? { [CommandDimensions.ErrorMessage]: errorMessage } : {}
5700
6139
  });
5701
6140
  emitInvocationRequest(telemetryName, success, baseProperties);
5702
6141
  } finally {
@@ -6023,6 +6462,40 @@ function canPrompt() {
6023
6462
  const capabilities = getOutputSink().capabilities;
6024
6463
  return capabilities.isInteractive && capabilities.canReadInput;
6025
6464
  }
6465
+ // ../common/src/mime-types.ts
6466
+ var MIME_TYPES_BY_EXTENSION = Object.freeze({
6467
+ pdf: "application/pdf",
6468
+ png: "image/png",
6469
+ jpg: "image/jpeg",
6470
+ jpeg: "image/jpeg",
6471
+ gif: "image/gif",
6472
+ webp: "image/webp",
6473
+ bmp: "image/bmp",
6474
+ tif: "image/tiff",
6475
+ tiff: "image/tiff",
6476
+ svg: "image/svg+xml",
6477
+ txt: "text/plain",
6478
+ log: "text/plain",
6479
+ md: "text/markdown",
6480
+ csv: "text/csv",
6481
+ tsv: "text/tab-separated-values",
6482
+ json: "application/json",
6483
+ xml: "application/xml",
6484
+ html: "text/html",
6485
+ htm: "text/html",
6486
+ yaml: "application/yaml",
6487
+ yml: "application/yaml",
6488
+ doc: "application/msword",
6489
+ docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
6490
+ xls: "application/vnd.ms-excel",
6491
+ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
6492
+ ppt: "application/vnd.ms-powerpoint",
6493
+ pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
6494
+ zip: "application/zip",
6495
+ mp3: "audio/mpeg",
6496
+ wav: "audio/wav",
6497
+ mp4: "video/mp4"
6498
+ });
6026
6499
  // ../common/src/option-validators.ts
6027
6500
  function parseBoundedInt(raw, optionName, bounds) {
6028
6501
  const normalized = raw.trim();
@@ -6396,6 +6869,11 @@ var pickName = (claims) => {
6396
6869
  const username = asString(claims?.preferred_username);
6397
6870
  return asString(claims?.name) ?? (looksLikeEmail(username) ? undefined : username);
6398
6871
  };
6872
+ var pickScopes = (claims) => {
6873
+ const raw = claims?.scope;
6874
+ const scopes = Array.isArray(raw) ? raw.filter((entry) => asString(entry) !== undefined) : typeof raw === "string" ? raw.split(/\s+/).filter(Boolean) : [];
6875
+ return scopes.length > 0 ? scopes : undefined;
6876
+ };
6399
6877
  var resolveSessionIdentity = (accessToken, authFlow) => {
6400
6878
  const claims = accessToken ? decodeClaims(accessToken) : undefined;
6401
6879
  const email = pickEmail(claims);
@@ -6421,6 +6899,7 @@ var resolveSessionIdentity = (accessToken, authFlow) => {
6421
6899
  identity.clientId = clientId;
6422
6900
  return identity;
6423
6901
  };
6902
+ var readTokenScopes = (accessToken) => accessToken ? pickScopes(decodeClaims(accessToken)) : undefined;
6424
6903
 
6425
6904
  // ../auth/src/envAuth.ts
6426
6905
  var ENV_AUTH_ENABLE_VAR = "UIPATH_CLI_ENABLE_ENV_AUTH";
@@ -6493,6 +6972,7 @@ var readAuthFromEnv = () => {
6493
6972
  const expiration = getTokenExpiration(accessToken);
6494
6973
  const loginStatus = expiration && expiration <= new Date ? "Expired" : "Logged in";
6495
6974
  const identity = resolveSessionIdentity(accessToken);
6975
+ const scopes = readTokenScopes(accessToken);
6496
6976
  return {
6497
6977
  loginStatus,
6498
6978
  accessToken,
@@ -6503,7 +6983,8 @@ var readAuthFromEnv = () => {
6503
6983
  tenantId,
6504
6984
  expiration,
6505
6985
  source: "env-vars" /* EnvironmentVariables */,
6506
- ...identity ? { identity } : {}
6986
+ ...identity ? { identity } : {},
6987
+ ...scopes ? { scopes } : {}
6507
6988
  };
6508
6989
  };
6509
6990
 
@@ -7141,10 +7622,15 @@ async function buildFileStatus(tokens, credentials, globalHint) {
7141
7622
  }
7142
7623
  function identityFields(accessToken, credentials) {
7143
7624
  const identity = resolveSessionIdentity(accessToken, parseAuthFlow(credentials[AUTH_FLOW_ENV_VAR]));
7144
- return identity ? { identity } : {};
7625
+ const scopes = readTokenScopes(accessToken);
7626
+ return {
7627
+ ...identity ? { identity } : {},
7628
+ ...scopes ? { scopes } : {}
7629
+ };
7145
7630
  }
7146
7631
  function buildRobotStatus(robotCreds) {
7147
7632
  const identity = resolveSessionIdentity(robotCreds.accessToken);
7633
+ const scopes = readTokenScopes(robotCreds.accessToken);
7148
7634
  return {
7149
7635
  loginStatus: "Logged in",
7150
7636
  accessToken: robotCreds.accessToken,
@@ -7156,7 +7642,8 @@ function buildRobotStatus(robotCreds) {
7156
7642
  issuer: robotCreds.issuer,
7157
7643
  expiration: getTokenExpiration(robotCreds.accessToken),
7158
7644
  source: "robot" /* Robot */,
7159
- ...identity ? { identity } : {}
7645
+ ...identity ? { identity } : {},
7646
+ ...scopes ? { scopes } : {}
7160
7647
  };
7161
7648
  }
7162
7649
  var isFileNotFoundError = (error) => {
@@ -7409,4 +7896,4 @@ var CLI_EXTERNAL_USER_ID = "app-user-cli-cas";
7409
7896
 
7410
7897
  export { package_default, getFileSystem, catchError, extractErrorDetails, extractErrorMessageSync, RESULTS, EXIT_CODES, OutputFormatter, InvalidArgumentError, Command, processContext, requireConfirmation, instructionsFor, canPrompt, parseBoundedInt, getSdkUserAgentToken, addSdkUserAgentHeader, getLoginStatusAsync, CLI_EXTERNAL_USER_ID };
7411
7898
 
7412
- //# debugId=93C8047EDF27D99B64756E2164756E21
7899
+ //# debugId=80E04C26B6D8FECA64756E2164756E21
package/dist/tool.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  metadata,
3
3
  registerCommands
4
- } from "./tool-vhy8gmvh.js";
4
+ } from "./tool-2zvqmzay.js";
5
5
  import"./tool-nkyhbf79.js";
6
- import"./tool-jdffzrjd.js";
6
+ import"./tool-n7gsekbz.js";
7
7
  import"./tool-mpvp5rqs.js";
8
8
  import"./tool-1yh8g550.js";
9
9
  export {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uipath/conversational-tool",
3
3
  "author": "UiPath",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
- "version": "1.203.0-preview.205",
5
+ "version": "1.204.0-preview.206",
6
6
  "description": "Handle conversations with deployed UiPath conversational processes.",
7
7
  "publishConfig": {
8
8
  "registry": "https://registry.npmjs.org/"
@@ -18,5 +18,5 @@
18
18
  "files": [
19
19
  "dist"
20
20
  ],
21
- "gitHead": "d8d19829030cc590c630bebfc60a9d9fc7fa8c31"
21
+ "gitHead": "ea7fd32a02acccf14e8e83522e69101430627b83"
22
22
  }