@uipath/vertical-solutions-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.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  Command,
4
4
  metadata,
5
5
  registerCommands
6
- } from "./tool-ttrz2jja.js";
6
+ } from "./tool-5vq0sjhd.js";
7
7
  import"./tool-mpvp5rqs.js";
8
8
  import"./tool-1yh8g550.js";
9
9
 
@@ -6865,7 +6865,7 @@ var package_default = {
6865
6865
  name: "@uipath/vertical-solutions-tool",
6866
6866
  author: "UiPath",
6867
6867
  license: "SEE LICENSE IN LICENSE.txt",
6868
- version: "1.203.0-preview.205",
6868
+ version: "1.204.0-preview.206",
6869
6869
  description: "Scaffold and generate Vertical Solution projects.",
6870
6870
  private: false,
6871
6871
  repository: {
@@ -7687,6 +7687,57 @@ function settlePromiseLike(thenable) {
7687
7687
  return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [toError(error), undefined]);
7688
7688
  }
7689
7689
 
7690
+ // ../common/src/error-graph.ts
7691
+ function* walkErrorGraph(error) {
7692
+ const queue = [error];
7693
+ const seen = new Set;
7694
+ for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
7695
+ const current = queue.shift();
7696
+ if (current === null || typeof current !== "object")
7697
+ continue;
7698
+ if (seen.has(current))
7699
+ continue;
7700
+ seen.add(current);
7701
+ const cur = current;
7702
+ yield cur;
7703
+ if (cur.cause !== undefined)
7704
+ queue.push(cur.cause);
7705
+ if (Array.isArray(cur.errors))
7706
+ queue.push(...cur.errors);
7707
+ }
7708
+ return;
7709
+ }
7710
+ function parseHttpStatusFromMessage(message) {
7711
+ const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
7712
+ if (!match)
7713
+ return;
7714
+ const status = Number(match[1]);
7715
+ return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
7716
+ }
7717
+ function findHttpStatusInGraph(error) {
7718
+ for (const node of walkErrorGraph(error)) {
7719
+ const response = node.response;
7720
+ const explicit = typeof node.status === "number" ? node.status : response?.status;
7721
+ if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
7722
+ return explicit;
7723
+ }
7724
+ if (typeof node.message === "string") {
7725
+ const parsed = parseHttpStatusFromMessage(node.message);
7726
+ if (parsed !== undefined && parsed >= 400) {
7727
+ return parsed;
7728
+ }
7729
+ }
7730
+ }
7731
+ return;
7732
+ }
7733
+
7734
+ // ../common/src/local-permission-codes.ts
7735
+ var LOCAL_PERMISSION_ERROR_CODES = new Set([
7736
+ "EACCES",
7737
+ "EPERM",
7738
+ "EROFS"
7739
+ ]);
7740
+
7690
7741
  // ../common/src/error-handler.ts
7691
7742
  var NETWORK_ERROR_CODES = new Set([
7692
7743
  "ECONNREFUSED",
@@ -7711,7 +7762,7 @@ var TLS_ERROR_CODES = new Set([
7711
7762
  ]);
7712
7763
  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.";
7713
7764
  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.";
7714
- var LOCAL_PERMISSION_ERROR_CODES = new Set(["EACCES", "EPERM", "EROFS"]);
7765
+ var LOCAL_PERMISSION_MESSAGE_PATTERN = new RegExp(`\\b(${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})\\b`);
7715
7766
  // ../common/src/exit-code.ts
7716
7767
  function setExitCode(code) {
7717
7768
  process.exitCode = code;
@@ -7970,12 +8021,162 @@ function getOutputFilter() {
7970
8021
  return filterSlot.get();
7971
8022
  }
7972
8023
 
8024
+ // ../common/src/telemetry/telemetry-dimensions.ts
8025
+ var BaseDimensions = {
8026
+ ApplicationName: "ApplicationName",
8027
+ ProductVersion: "ProductVersion",
8028
+ InstallationId: "InstallationId",
8029
+ CloudUserId: "CloudUserId",
8030
+ CloudTenantId: "CloudTenantId",
8031
+ CloudOrganizationId: "CloudOrganizationId",
8032
+ IsInternalUser: "IsInternalUser",
8033
+ Environment: "Environment",
8034
+ BaseUrl: "BaseUrl",
8035
+ Region: "Region",
8036
+ Agent: "Agent",
8037
+ AgentVersion: "AgentVersion",
8038
+ AgentModel: "AgentModel",
8039
+ ToolName: "ToolName",
8040
+ ToolVersion: "ToolVersion",
8041
+ ExecutionContext: "ExecutionContext",
8042
+ CiProvider: "CiProvider",
8043
+ SessionIdSource: "SessionIdSource",
8044
+ SessionId: "SessionId"
8045
+ };
8046
+ var CommandDimensions = {
8047
+ IsCommand: "IsCommand",
8048
+ IsReexec: "IsReexec",
8049
+ CommandName: "CommandName",
8050
+ ExitCode: "ExitCode",
8051
+ TerminalOutcome: "TerminalOutcome",
8052
+ ErrorClass: "ErrorClass",
8053
+ TerminalSignal: "TerminalSignal",
8054
+ ErrorMessage: "ErrorMessage",
8055
+ SkillName: "SkillName",
8056
+ ProductArea: "ProductArea",
8057
+ Mode: "Mode"
8058
+ };
8059
+ var ShipDimensions = {
8060
+ ShipKind: "ShipKind",
8061
+ Target: "Target",
8062
+ ProjectType: "ProjectType",
8063
+ ProjectTypes: "ProjectTypes",
8064
+ ArtifactCorrelationKey: "ArtifactCorrelationKey",
8065
+ PackageName: "PackageName",
8066
+ PackageVersion: "PackageVersion",
8067
+ PackageVersionKey: "PackageVersionKey",
8068
+ DeploymentKey: "DeploymentKey",
8069
+ SolutionId: "SolutionId",
8070
+ FolderKey: "FolderKey",
8071
+ FeedId: "FeedId"
8072
+ };
8073
+ var ErrorDimensions = {
8074
+ Result: "Result",
8075
+ ErrorCode: "ErrorCode",
8076
+ Retry: "Retry",
8077
+ ErrorMessage: "ErrorMessage"
8078
+ };
8079
+ var AuthDimensions = {
8080
+ AuthenticationMethod: "AuthenticationMethod",
8081
+ Success: "Success",
8082
+ Reason: "Reason"
8083
+ };
8084
+ var SkillsDimensions = {
8085
+ SchemaVersion: "SchemaVersion",
8086
+ AgentType: "AgentType",
8087
+ SkillsVersion: "SkillsVersion",
8088
+ UipSubcommand: "UipSubcommand",
8089
+ FileExtension: "FileExtension",
8090
+ SubagentModel: "SubagentModel",
8091
+ SubagentType: "SubagentType",
8092
+ PermissionMode: "PermissionMode",
8093
+ EffortLevel: "EffortLevel",
8094
+ SessionSource: "SessionSource",
8095
+ Outcome: "Outcome",
8096
+ DurationMs: "DurationMs",
8097
+ Source: "Source"
8098
+ };
8099
+ var PackagerDimensions = {
8100
+ ProjectId: "ProjectId",
8101
+ ProjectType: "ProjectType",
8102
+ SolutionId: "SolutionId"
8103
+ };
8104
+ var ScopeDimensions = {
8105
+ FolderId: "FolderId"
8106
+ };
8107
+ var ID_DIMENSIONS = new Set([
8108
+ BaseDimensions.CloudUserId,
8109
+ BaseDimensions.CloudTenantId,
8110
+ BaseDimensions.CloudOrganizationId,
8111
+ BaseDimensions.InstallationId,
8112
+ ShipDimensions.ArtifactCorrelationKey,
8113
+ ShipDimensions.PackageVersionKey,
8114
+ ShipDimensions.DeploymentKey,
8115
+ ShipDimensions.SolutionId,
8116
+ ShipDimensions.FolderKey,
8117
+ ShipDimensions.FeedId,
8118
+ PackagerDimensions.ProjectId
8119
+ ]);
8120
+ var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
8121
+ var RESERVED_DIMENSION_NAMES = new Set([
8122
+ ...Object.values(BaseDimensions),
8123
+ ...Object.values(CommandDimensions),
8124
+ ...Object.values(ShipDimensions),
8125
+ ...Object.values(ErrorDimensions),
8126
+ ...Object.values(AuthDimensions),
8127
+ ...Object.values(SkillsDimensions),
8128
+ ...Object.values(PackagerDimensions),
8129
+ ...Object.values(ScopeDimensions)
8130
+ ]);
8131
+ var CURATED_DIMENSIONS = new Set([
8132
+ BaseDimensions.ApplicationName,
8133
+ BaseDimensions.ProductVersion,
8134
+ BaseDimensions.InstallationId,
8135
+ BaseDimensions.CloudUserId,
8136
+ BaseDimensions.CloudTenantId,
8137
+ BaseDimensions.CloudOrganizationId,
8138
+ BaseDimensions.IsInternalUser,
8139
+ BaseDimensions.Environment,
8140
+ BaseDimensions.BaseUrl,
8141
+ BaseDimensions.Region,
8142
+ BaseDimensions.Agent,
8143
+ BaseDimensions.AgentVersion,
8144
+ BaseDimensions.ToolVersion,
8145
+ BaseDimensions.ExecutionContext,
8146
+ BaseDimensions.CiProvider,
8147
+ BaseDimensions.SessionIdSource,
8148
+ BaseDimensions.SessionId,
8149
+ ...Object.values(CommandDimensions),
8150
+ ...Object.values(ShipDimensions)
8151
+ ]);
8152
+ function lowercaseIdDimensionValues(properties) {
8153
+ let changed = false;
8154
+ const result = {
8155
+ ...properties
8156
+ };
8157
+ for (const key of Object.keys(result)) {
8158
+ const value = result[key];
8159
+ if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
8160
+ continue;
8161
+ }
8162
+ const lowered = value.toLowerCase();
8163
+ if (lowered !== value) {
8164
+ result[key] = lowered;
8165
+ changed = true;
8166
+ }
8167
+ }
8168
+ return changed ? result : properties;
8169
+ }
8170
+
7973
8171
  // ../common/src/telemetry/command-terminal.ts
7974
8172
  var recordedFailureSlot = singleton("CommandTelemetryFailure");
7975
8173
  var AUTH_ERROR_CODES = new Set([
7976
8174
  "authentication_required",
7977
8175
  "permission_denied"
7978
8176
  ]);
8177
+ var LOCAL_PERMISSION_CLI_ERROR_CODES = new Set([
8178
+ "local_permission_denied"
8179
+ ]);
7979
8180
  var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
7980
8181
  var NETWORK_HTTP_ERROR_CODES = new Set([
7981
8182
  "network_error",
@@ -8116,6 +8317,9 @@ function classifyFromErrorCode(errorCode) {
8116
8317
  if (AUTH_ERROR_CODES.has(errorCode)) {
8117
8318
  return "auth";
8118
8319
  }
8320
+ if (LOCAL_PERMISSION_CLI_ERROR_CODES.has(errorCode)) {
8321
+ return "local_permission";
8322
+ }
8119
8323
  if (VALIDATION_ERROR_CODES.has(errorCode)) {
8120
8324
  return "validation";
8121
8325
  }
@@ -8127,6 +8331,15 @@ function classifyFromErrorCode(errorCode) {
8127
8331
  }
8128
8332
  return;
8129
8333
  }
8334
+ function hasLocalPermissionCode(error) {
8335
+ for (const node of walkErrorGraph(error)) {
8336
+ const code = node.code;
8337
+ if (typeof code === "string" && LOCAL_PERMISSION_ERROR_CODES.has(code)) {
8338
+ return true;
8339
+ }
8340
+ }
8341
+ return false;
8342
+ }
8130
8343
  function classifyFromError(error) {
8131
8344
  const code = findCodeInCauseChain(error);
8132
8345
  if (code) {
@@ -8143,6 +8356,9 @@ function classifyFromError(error) {
8143
8356
  return "missing_dependency";
8144
8357
  }
8145
8358
  }
8359
+ if (hasLocalPermissionCode(error)) {
8360
+ return "local_permission";
8361
+ }
8146
8362
  const message = stringField(error, "message");
8147
8363
  if (message?.includes("fetch failed") === true) {
8148
8364
  return "network_http";
@@ -8158,7 +8374,7 @@ function classifyError(input) {
8158
8374
  if (recorded?.errorClass) {
8159
8375
  return recorded.errorClass;
8160
8376
  }
8161
- const status = recorded?.context?.httpStatus;
8377
+ const status = recorded?.context?.httpStatus ?? findHttpStatusInGraph(input.error);
8162
8378
  if (status !== undefined) {
8163
8379
  return classifyHttpStatus(status);
8164
8380
  }
@@ -8181,17 +8397,18 @@ function buildCommandTerminalTelemetryProperties(input) {
8181
8397
  const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError(input);
8182
8398
  const terminalSignal = terminalSignalFor(input, outcome);
8183
8399
  return {
8184
- exit_code: input.exitCode,
8185
- terminal_outcome: outcome,
8186
- ...errorClass ? { error_class: errorClass } : {},
8187
- ...terminalSignal ? { terminal_signal: terminalSignal } : {}
8400
+ [CommandDimensions.ExitCode]: input.exitCode,
8401
+ [CommandDimensions.TerminalOutcome]: outcome,
8402
+ ...errorClass ? { [CommandDimensions.ErrorClass]: errorClass } : {},
8403
+ ...terminalSignal ? { [CommandDimensions.TerminalSignal]: terminalSignal } : {}
8188
8404
  };
8189
8405
  }
8190
8406
 
8191
8407
  // ../common/src/telemetry/telemetry-events.ts
8192
8408
  var CommonTelemetryEvents = {
8193
- Error: "uip.error",
8194
- ShipSucceeded: "uip.ship.succeeded"
8409
+ Start: "Application.Start",
8410
+ Error: "Application.Error",
8411
+ ShipSucceeded: "Cli.ShipSucceeded"
8195
8412
  };
8196
8413
 
8197
8414
  // ../common/src/registry.ts
@@ -8399,8 +8616,8 @@ function detectExecutionContext(options = {}) {
8399
8616
  function getExecutionContextTelemetryProperties() {
8400
8617
  const detected = detectExecutionContext();
8401
8618
  return {
8402
- execution_context: detected.executionContext,
8403
- ...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
8619
+ [BaseDimensions.ExecutionContext]: detected.executionContext,
8620
+ ...detected.ciProvider ? { [BaseDimensions.CiProvider]: detected.ciProvider } : {}
8404
8621
  };
8405
8622
  }
8406
8623
  // ../common/src/telemetry/node-context-storage.ts
@@ -8443,7 +8660,7 @@ function getInboundTraceContext() {
8443
8660
  var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
8444
8661
  var SESSION_ID_MAX_LENGTH = 64;
8445
8662
  var RANDOM_SESSION_ID_LENGTH = 32;
8446
- var TELEMETRY_SESSION_SOURCE_PROPERTY = "session_id_source";
8663
+ var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
8447
8664
  var CONTROL_CHARACTERS = /\p{Cc}/gu;
8448
8665
  var INHERITED_SESSION_SOURCES = [
8449
8666
  { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
@@ -8495,6 +8712,9 @@ function resolveTelemetrySession() {
8495
8712
  telemetrySessionSlot.set(resolved);
8496
8713
  return resolved;
8497
8714
  }
8715
+ function getTelemetrySessionId() {
8716
+ return resolveTelemetrySession().id;
8717
+ }
8498
8718
  function getTelemetrySessionSource() {
8499
8719
  return resolveTelemetrySession().source;
8500
8720
  }
@@ -8575,7 +8795,10 @@ class TelemetryService {
8575
8795
  } catch (error) {
8576
8796
  const durationMs = clock.elapsedMs();
8577
8797
  const err = error instanceof Error ? error : new Error(String(error));
8578
- await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, { ...properties, errorMessage: err.message }, context));
8798
+ await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, {
8799
+ ...properties,
8800
+ [CommandDimensions.ErrorMessage]: err.message
8801
+ }, context));
8579
8802
  throw error;
8580
8803
  }
8581
8804
  }
@@ -8646,7 +8869,10 @@ class TelemetryService {
8646
8869
  const durationMs = clock.elapsedMs();
8647
8870
  const err = error instanceof Error ? error : new Error(String(error));
8648
8871
  await this.telemetryProvider.trackDependency({
8649
- ...this.spanFor(name, durationMs, false, { ...properties, errorMessage: err.message }, childContext),
8872
+ ...this.spanFor(name, durationMs, false, {
8873
+ ...properties,
8874
+ [CommandDimensions.ErrorMessage]: err.message
8875
+ }, childContext),
8650
8876
  type
8651
8877
  });
8652
8878
  throw error;
@@ -8681,9 +8907,10 @@ class TelemetryService {
8681
8907
  ...globalProperties,
8682
8908
  ...this.defaultProperties,
8683
8909
  ...redactProperties(properties ?? {}),
8684
- [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource()
8910
+ [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
8911
+ [BaseDimensions.SessionId]: this.telemetryProvider.getSessionId?.() ?? getTelemetrySessionId()
8685
8912
  };
8686
- return enriched;
8913
+ return lowercaseIdDimensionValues(enriched);
8687
8914
  }
8688
8915
  generateId() {
8689
8916
  const bytes = new Uint8Array(8);
@@ -9444,7 +9671,165 @@ class FilterImplicitLimitError extends Error {
9444
9671
  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).";
9445
9672
  }
9446
9673
  }
9447
- function applyFilter(data, filter) {
9674
+ function countRecords(data) {
9675
+ if (Array.isArray(data))
9676
+ return data.length;
9677
+ return data == null ? 0 : 1;
9678
+ }
9679
+ function availableFields(data) {
9680
+ const records = Array.isArray(data) ? data : [data];
9681
+ const keys = new Set;
9682
+ for (const record of records) {
9683
+ if (record && typeof record === "object" && !Array.isArray(record)) {
9684
+ for (const key of Object.keys(record))
9685
+ keys.add(key);
9686
+ }
9687
+ }
9688
+ return [...keys];
9689
+ }
9690
+ function decodeQuotedIdentifier(whole, inner) {
9691
+ const [error, decoded] = catchError(() => JSON.parse(whole));
9692
+ if (!error && typeof decoded === "string")
9693
+ return decoded;
9694
+ return inner.replace(/\\(.)/g, "$1");
9695
+ }
9696
+ function referencedFields(filter) {
9697
+ const top = new Set;
9698
+ const nested = new Set;
9699
+ const withoutValueLiterals = filter.replace(/'(?:\\.|[^'\\])*'/g, " ").replace(/`(?:\\.|[^`\\])*`/g, " ");
9700
+ const isPathTail = (text, index) => text[index - 1] === "." && /[A-Za-z0-9_"]/.test(text[index - 2] ?? "");
9701
+ const quoted = [];
9702
+ const withoutLiterals = withoutValueLiterals.replace(/"((?:\\.|[^"\\])*)"/g, (whole, name, index) => {
9703
+ const isAlias = /^\s*:/.test(withoutValueLiterals.slice(index + whole.length));
9704
+ if (!isAlias) {
9705
+ quoted.push({
9706
+ name: decodeQuotedIdentifier(whole, name),
9707
+ index,
9708
+ tail: isPathTail(withoutValueLiterals, index)
9709
+ });
9710
+ }
9711
+ return `"${" ".repeat(whole.length - 2)}"`;
9712
+ });
9713
+ const descent = /[A-Za-z0-9_"]\s*[.[]/.exec(withoutLiterals);
9714
+ const rootEnd = descent ? descent.index + 1 : Number.POSITIVE_INFINITY;
9715
+ const place = (name, index, tail) => {
9716
+ if (tail || index >= rootEnd)
9717
+ nested.add(name);
9718
+ else
9719
+ top.add(name);
9720
+ };
9721
+ for (const entry of quoted)
9722
+ place(entry.name, entry.index, entry.tail);
9723
+ const identifiers = withoutLiterals.matchAll(/([A-Za-z_][A-Za-z0-9_]*)(\s*[:(])?/g);
9724
+ const reserved = new Set(["true", "false", "null", "and", "or", "not"]);
9725
+ for (const match of identifiers) {
9726
+ const [, name, trailing] = match;
9727
+ if (trailing || reserved.has(name))
9728
+ continue;
9729
+ place(name, match.index, isPathTail(withoutLiterals, match.index));
9730
+ }
9731
+ return {
9732
+ top: [...top],
9733
+ nested: [...nested].filter((name) => !top.has(name)),
9734
+ hasPredicate: /\[\s*\?/.test(withoutValueLiterals)
9735
+ };
9736
+ }
9737
+ function appearsBelowTopLevel(data, name) {
9738
+ let budget = 2000;
9739
+ const visit = (value, depth) => {
9740
+ if (budget-- <= 0 || depth > 4)
9741
+ return false;
9742
+ if (value === null || typeof value !== "object")
9743
+ return false;
9744
+ if (Array.isArray(value))
9745
+ return value.some((entry) => visit(entry, depth));
9746
+ const record = value;
9747
+ if (depth > 0 && Object.hasOwn(record, name))
9748
+ return true;
9749
+ return Object.values(record).some((entry) => visit(entry, depth + 1));
9750
+ };
9751
+ return visit(data, 0);
9752
+ }
9753
+ function alwaysNullKeys(records) {
9754
+ const objects = records.filter((r) => r != null && typeof r === "object" && !Array.isArray(r));
9755
+ if (objects.length === 0 || objects.length !== records.length)
9756
+ return [];
9757
+ const keys = [...new Set(objects.flatMap((o) => Object.keys(o)))];
9758
+ if (keys.length === 0)
9759
+ return [];
9760
+ const nullKeys = keys.filter((key) => objects.every((record) => record[key] === null));
9761
+ return nullKeys.length === keys.length ? nullKeys : [];
9762
+ }
9763
+ function carriesOnlyNulls(value) {
9764
+ if (value === null)
9765
+ return true;
9766
+ if (Array.isArray(value)) {
9767
+ return value.length > 0 && value.every(carriesOnlyNulls);
9768
+ }
9769
+ if (typeof value === "object" && value !== undefined) {
9770
+ const values = Object.values(value);
9771
+ return values.length > 0 && values.every(carriesOnlyNulls);
9772
+ }
9773
+ return false;
9774
+ }
9775
+ function nameList(names, cap2 = 12) {
9776
+ const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
9777
+ const rest = names.length - shown.length;
9778
+ return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
9779
+ }
9780
+ function buildFilterWarning(filter, data, outcome) {
9781
+ const present = availableFields(data);
9782
+ const refs = referencedFields(filter);
9783
+ const unknown = refs.top.filter((name) => !present.includes(name) && !appearsBelowTopLevel(data, name));
9784
+ const unchecked = refs.nested.filter((name) => !present.includes(name));
9785
+ const count = countRecords(data);
9786
+ const scope = `${count} record(s)`;
9787
+ const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
9788
+ 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" : "";
9789
+ const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
9790
+ let detail;
9791
+ let lede;
9792
+ if (outcome.kind === "null-elements") {
9793
+ lede = "returned only null values";
9794
+ const projected = `all ${outcome.count} of the elements it projected are null`;
9795
+ if (unknown.length > 0) {
9796
+ detail = `${projected}, because ${isNotAField(unknown)}`;
9797
+ } else if (unchecked.length > 0) {
9798
+ detail = withSoundness(projected);
9799
+ } else {
9800
+ 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`;
9801
+ }
9802
+ } else if (outcome.kind === "null-rows") {
9803
+ lede = "returned only null values";
9804
+ const projected = `every value it projected is null on all ${outcome.count} row(s)`;
9805
+ detail = unknown.length > 0 ? `${projected}, because ${isNotAField(unknown)}` : withSoundness(projected);
9806
+ } else if (outcome.kind === "null-values") {
9807
+ lede = "returned only null values";
9808
+ const projected = `every key it projected (${nameList(outcome.keys)}) is null`;
9809
+ const sameSet = unknown.length === outcome.keys.length && outcome.keys.every((k) => unknown.includes(k));
9810
+ if (sameSet) {
9811
+ detail = `${isNotAField(outcome.keys)}, so every key it projected is null`;
9812
+ } else if (unknown.length > 0) {
9813
+ detail = `${projected}, because ${isNotAField(unknown)}`;
9814
+ } else {
9815
+ detail = withSoundness(`${projected} on all ${scope}`);
9816
+ }
9817
+ } else {
9818
+ lede = "returned nothing";
9819
+ if (unknown.length > 0) {
9820
+ detail = isNotAField(unknown);
9821
+ } else {
9822
+ const selection = refs.hasPredicate ? "no record matched" : "the expression resolved to no value";
9823
+ detail = withSoundness(`${selection} — it read ${scope}`);
9824
+ }
9825
+ }
9826
+ const fields = present.length > 0 ? ` Available fields: ${nameList(present)}.` : "";
9827
+ return `--output-filter ${JSON.stringify(filter)} ${lede}: ${detail}.${fields}`;
9828
+ }
9829
+ function appendWarning(existing, note) {
9830
+ return existing ? `${existing} ${note}` : note;
9831
+ }
9832
+ function applyFilter(data, filter, onWarning) {
9448
9833
  const codec = requireJmespath();
9449
9834
  let result;
9450
9835
  try {
@@ -9452,9 +9837,34 @@ function applyFilter(data, filter) {
9452
9837
  } catch (err) {
9453
9838
  throw new FilterEvaluationError(filter, err);
9454
9839
  }
9455
- if (result == null)
9840
+ const inputCount = countRecords(data);
9841
+ const warn = (outcome) => {
9842
+ if (inputCount === 0)
9843
+ return;
9844
+ const note = buildFilterWarning(filter, data, outcome);
9845
+ getOutputSink().writeErr(`[WARN] ${note}
9846
+ `);
9847
+ onWarning?.(note);
9848
+ };
9849
+ const warnIfAllNull = (records) => {
9850
+ const keys = alwaysNullKeys(records);
9851
+ if (keys.length > 0)
9852
+ warn({ kind: "null-values", keys });
9853
+ };
9854
+ if (result == null) {
9855
+ warn({ kind: "empty" });
9456
9856
  return [];
9857
+ }
9457
9858
  if (Array.isArray(result)) {
9859
+ if (result.length === 0) {
9860
+ warn({ kind: "empty" });
9861
+ } else if (result.every((entry) => entry === null)) {
9862
+ warn({ kind: "null-elements", count: result.length });
9863
+ } else if (result.every((entry) => Array.isArray(entry)) && carriesOnlyNulls(result)) {
9864
+ warn({ kind: "null-rows", count: result.length });
9865
+ } else {
9866
+ warnIfAllNull(result);
9867
+ }
9458
9868
  if (result.length > 0 && typeof result[0] !== "object") {
9459
9869
  const fieldMatch = filter.match(/\.(\w+)$/);
9460
9870
  const key = fieldMatch ? fieldMatch[1] : "Value";
@@ -9462,10 +9872,30 @@ function applyFilter(data, filter) {
9462
9872
  }
9463
9873
  return result;
9464
9874
  }
9465
- if (typeof result === "object")
9875
+ if (typeof result === "object") {
9876
+ warnIfAllNull([result]);
9466
9877
  return result;
9878
+ }
9467
9879
  return { Value: result };
9468
9880
  }
9881
+ function filterFailureData(envelope) {
9882
+ const filter = getOutputFilter();
9883
+ const data = envelope.Data;
9884
+ if (!filter || data == null)
9885
+ return;
9886
+ let note;
9887
+ const [filterError, filtered] = catchError(() => applyFilter(data, filter, (n) => {
9888
+ note = n;
9889
+ }));
9890
+ if (filterError) {
9891
+ envelope.Warning = appendWarning(envelope.Warning, `--output-filter was not applied, so Data is shown in full: ${filterError.message}`);
9892
+ return;
9893
+ }
9894
+ envelope.Data = filtered;
9895
+ if (note) {
9896
+ envelope.Warning = appendWarning(envelope.Warning, note);
9897
+ }
9898
+ }
9469
9899
  function defaultErrorCodeForResult(result) {
9470
9900
  switch (result) {
9471
9901
  case RESULTS.AuthenticationError:
@@ -9480,7 +9910,7 @@ function defaultErrorCodeForResult(result) {
9480
9910
  return "unknown_error";
9481
9911
  }
9482
9912
  }
9483
- function parseHttpStatusFromMessage(message) {
9913
+ function parseHttpStatusFromMessage2(message) {
9484
9914
  const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
9485
9915
  if (!match)
9486
9916
  return;
@@ -9509,10 +9939,10 @@ function defaultErrorCodeForHttpStatus(status) {
9509
9939
  return "server_error";
9510
9940
  return;
9511
9941
  }
9512
- var LOCAL_PERMISSION_TEXT_PATTERN = /(?:\b|\()(?:EACCES|EPERM|EROFS)(?::\s|\))/;
9942
+ var LOCAL_PERMISSION_TEXT_PATTERN = new RegExp(`(?:\\b|\\()(?:${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})(?::\\s|\\))`);
9513
9943
  function defaultErrorCodeForFailure(data) {
9514
9944
  if (data.Result === RESULTS.Failure) {
9515
- const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage(data.Message);
9945
+ const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage2(data.Message);
9516
9946
  const errorCode = defaultErrorCodeForHttpStatus(status);
9517
9947
  if (errorCode)
9518
9948
  return errorCode;
@@ -9548,8 +9978,14 @@ var OutputFormatter;
9548
9978
  }
9549
9979
  const filter = getOutputFilter();
9550
9980
  if (filter) {
9551
- const filtered = applyFilter(data.Data, filter);
9981
+ let note;
9982
+ const filtered = applyFilter(data.Data, filter, (n) => {
9983
+ note = n;
9984
+ });
9552
9985
  data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
9986
+ if (note) {
9987
+ data.Warning = appendWarning(data.Warning, note);
9988
+ }
9553
9989
  }
9554
9990
  logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
9555
9991
  }
@@ -9577,12 +10013,13 @@ var OutputFormatter;
9577
10013
  delete envelope.TelemetryErrorClass;
9578
10014
  delete envelope.TelemetryTerminalOutcome;
9579
10015
  delete envelope.TelemetryTerminalSignal;
10016
+ filterFailureData(envelope);
9580
10017
  if (!suppressTelemetry) {
9581
10018
  telemetry.trackEvent(CommonTelemetryEvents.Error, {
9582
- result: data.Result,
9583
- errorCode: data.ErrorCode,
9584
- retry: data.Retry,
9585
- message: data.Message
10019
+ [ErrorDimensions.Result]: data.Result,
10020
+ [ErrorDimensions.ErrorCode]: data.ErrorCode,
10021
+ [ErrorDimensions.Retry]: data.Retry,
10022
+ [ErrorDimensions.ErrorMessage]: data.Message
9586
10023
  });
9587
10024
  }
9588
10025
  logOutput(normalizeOutputKeys(envelope), getOutputFormat());
@@ -9625,13 +10062,20 @@ var OutputFormatter;
9625
10062
  OutputFormatter.log = log;
9626
10063
  function formatToString(data) {
9627
10064
  const filter = getOutputFilter();
10065
+ const envelope = data;
9628
10066
  if ("Data" in data && data.Data != null) {
9629
10067
  data.Data = normalizeDataKeys(data.Data);
9630
10068
  if (filter) {
9631
- data.Data = normalizeDataKeys(applyFilter(data.Data, filter));
10069
+ let note;
10070
+ data.Data = normalizeDataKeys(applyFilter(data.Data, filter, (n) => {
10071
+ note = n;
10072
+ }));
10073
+ if (note) {
10074
+ envelope.Warning = appendWarning(envelope.Warning, note);
10075
+ }
9632
10076
  }
9633
10077
  }
9634
- const output = normalizeOutputKeys(data);
10078
+ const output = normalizeOutputKeys(envelope);
9635
10079
  const lines = [];
9636
10080
  const sink = getOutputSink();
9637
10081
  printOutput(output, getOutputFormat(), (msg) => {
@@ -9681,7 +10125,7 @@ var LEGACY_SKILL_NAMESPACE = "uipath:";
9681
10125
  var MAX_SKILL_NAME_LENGTH = 80;
9682
10126
  var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
9683
10127
  function productMode(productArea, mode) {
9684
- return { product_area: productArea, mode };
10128
+ return { ProductArea: productArea, Mode: mode };
9685
10129
  }
9686
10130
  function attributionRecord(groups) {
9687
10131
  const record = {};
@@ -9739,6 +10183,7 @@ var COMMAND_ATTRIBUTION = commandAttribution([
9739
10183
  ["rpa", "build", ["uip.rpa-legacy"]],
9740
10184
  ["conversational", "operate", ["uip.conversational"]],
9741
10185
  ["agents", "build", ["uip.codedagent", "uip.agent"]],
10186
+ ["coding-agents", "build", ["uip.coder"]],
9742
10187
  ["agenthub", "build", ["uip.agenthub"]],
9743
10188
  ["coded-apps", "build", ["uip.codedapp"]],
9744
10189
  ["functions", "build", ["uip.function", "uip.functions"]],
@@ -9824,32 +10269,64 @@ function normalizeSkillName(value) {
9824
10269
  function buildCommandTelemetryAttribution(commandPath, skillSource) {
9825
10270
  const skillName = normalizeSkillName(skillSource);
9826
10271
  return {
9827
- ...skillName ? { skill_name: skillName } : {},
10272
+ ...skillName ? { SkillName: skillName } : {},
9828
10273
  ...getCommandProductModeAttribution(commandPath)
9829
10274
  };
9830
10275
  }
10276
+ var AGENT_SESSION_ENV = {
10277
+ [BaseDimensions.AgentModel]: "UIPATH_AGENT_MODEL",
10278
+ [SkillsDimensions.PermissionMode]: "UIPATH_PERMISSION_MODE",
10279
+ [SkillsDimensions.EffortLevel]: "UIPATH_EFFORT_LEVEL",
10280
+ [SkillsDimensions.SkillsVersion]: "UIPATH_SKILLS_VERSION"
10281
+ };
10282
+ var MAX_TELEMETRY_TOKEN_LENGTH = 120;
10283
+ function sanitizeTelemetryToken(value) {
10284
+ return value.replace(/[^A-Za-z0-9:._/ -]/g, "_").slice(0, MAX_TELEMETRY_TOKEN_LENGTH);
10285
+ }
10286
+ function buildAgentSessionTelemetry(env) {
10287
+ const dimensions = {};
10288
+ for (const [key, variable] of Object.entries(AGENT_SESSION_ENV)) {
10289
+ const value = env[variable]?.trim();
10290
+ if (value) {
10291
+ dimensions[key] = sanitizeTelemetryToken(value);
10292
+ }
10293
+ }
10294
+ return dimensions;
10295
+ }
9831
10296
 
9832
10297
  // ../common/src/telemetry/command-name.ts
9833
- var TELEMETRY_COMMAND_ROOT = "uip";
10298
+ var TELEMETRY_NAME_ROOT = "Cli";
10299
+ var CLI_COMMAND_ROOT = "uip";
10300
+ var TELEMETRY_NAME_BARE_ACTION = "Invoke";
9834
10301
  function commandTelemetryName(parts) {
10302
+ const action = vetCommandTokens(parts).map(pascalizeToken).join("");
10303
+ return `${TELEMETRY_NAME_ROOT}.${action || TELEMETRY_NAME_BARE_ACTION}`;
10304
+ }
10305
+ function commandInvocationPath(parts) {
10306
+ return [CLI_COMMAND_ROOT, ...vetCommandTokens(parts)].join(" ");
10307
+ }
10308
+ function vetCommandTokens(parts) {
9835
10309
  const tokens = [];
9836
10310
  for (const part of parts) {
9837
- const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !== TELEMETRY_COMMAND_ROOT);
10311
+ const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !== CLI_COMMAND_ROOT);
9838
10312
  if (pieces.every(isCommandToken)) {
9839
10313
  tokens.push(...pieces);
9840
10314
  continue;
9841
10315
  }
9842
10316
  tokens.push(UNKNOWN_TOKEN);
9843
10317
  }
9844
- return [TELEMETRY_COMMAND_ROOT, ...tokens].join(".");
10318
+ return tokens;
9845
10319
  }
9846
- var COMMAND_TOKEN_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
10320
+ function pascalizeToken(token) {
10321
+ return token.split("-").filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
10322
+ }
10323
+ var COMMAND_TOKEN_PATTERN = /^[a-z][a-z0-9-]*$/;
9847
10324
  var MAX_COMMAND_TOKEN_LENGTH = 32;
9848
10325
  var GUID_TOKEN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
9849
10326
  function isCommandToken(token) {
9850
- return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token) && !/^\d+$/.test(token);
10327
+ return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token);
9851
10328
  }
9852
- var UNKNOWN_TOKEN = "<unknown>";
10329
+ var UNKNOWN_TOKEN = "unknown";
9853
10330
 
9854
10331
  // ../common/src/telemetry/invocation-request.ts
9855
10332
  var requestContextSlot = singleton("TelemetryInvocationRequestContext");
@@ -9954,7 +10431,7 @@ function withheldArgumentValues(cmd) {
9954
10431
  });
9955
10432
  return values;
9956
10433
  }
9957
- function deriveCommandPath(cmd) {
10434
+ function deriveCommandParts(cmd) {
9958
10435
  const parts = [];
9959
10436
  let current = cmd;
9960
10437
  while (current) {
@@ -9967,14 +10444,13 @@ function deriveCommandPath(cmd) {
9967
10444
  if (parts.length > 1) {
9968
10445
  parts.shift();
9969
10446
  }
9970
- return commandTelemetryName(parts);
10447
+ return parts;
9971
10448
  }
9972
10449
  function isErrorContext(value) {
9973
10450
  return value !== null && typeof value === "object";
9974
10451
  }
9975
10452
  function commandHelpHint(commandPath) {
9976
- const command = commandPath.replace(/\./g, " ");
9977
- return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
10453
+ return `An unexpected error occurred. Run '${commandPath} --help' to verify command syntax, or run with --log-level debug for details.`;
9978
10454
  }
9979
10455
  function isPromptCancellation(error) {
9980
10456
  return error instanceof Error && error.name === "ExitPromptError";
@@ -9999,7 +10475,9 @@ Command.prototype.trackedAction = function(context, fn, properties) {
9999
10475
  yaml: getOutputFormat() === "yaml",
10000
10476
  filter: getOutputFilter() !== undefined
10001
10477
  });
10002
- const telemetryName = deriveCommandPath(command);
10478
+ const commandParts = deriveCommandParts(command);
10479
+ const telemetryName = commandTelemetryName(commandParts);
10480
+ const commandPath = commandInvocationPath(commandParts);
10003
10481
  const props = typeof properties === "function" ? properties(...args) : properties;
10004
10482
  markCommandStart();
10005
10483
  const supplied = recordSuppliedArgumentValues(withheldArgumentValues(command));
@@ -10034,7 +10512,7 @@ Command.prototype.trackedAction = function(context, fn, properties) {
10034
10512
  Result: finalResult,
10035
10513
  ...customErrorCode ? { ErrorCode: customErrorCode } : {},
10036
10514
  Message: errorMessage,
10037
- Instructions: customInstructions ?? commandHelpHint(telemetryName),
10515
+ Instructions: customInstructions ?? commandHelpHint(commandPath),
10038
10516
  ...customRetry ? { Retry: customRetry } : {},
10039
10517
  ...customContext ? { Context: customContext } : {}
10040
10518
  });
@@ -10051,8 +10529,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
10051
10529
  recordedFailure,
10052
10530
  pollSignal: context.pollSignal
10053
10531
  });
10054
- if (terminalTelemetry.error_class === "internal" && error) {
10055
- telemetry.trackException(error instanceof Error ? error : new Error(String(error)), { command_name: telemetryName }, getInvocationRequestContext());
10532
+ if (terminalTelemetry[CommandDimensions.ErrorClass] === "internal" && error) {
10533
+ telemetry.trackException(error instanceof Error ? error : new Error(String(error)), { [CommandDimensions.CommandName]: commandPath }, getInvocationRequestContext());
10056
10534
  }
10057
10535
  const commandParams = extractCommandParams(command);
10058
10536
  if (props) {
@@ -10063,10 +10541,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
10063
10541
  const baseProperties = redactProperties({
10064
10542
  ...commandParams,
10065
10543
  ...props,
10066
- ...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
10067
- command: "true",
10544
+ ...buildCommandTelemetryAttribution(commandPath, process.env.UIPATH_SKILL),
10545
+ ...buildAgentSessionTelemetry(process.env),
10546
+ [CommandDimensions.CommandName]: commandPath,
10547
+ [CommandDimensions.IsCommand]: "true",
10068
10548
  ...terminalTelemetry,
10069
- ...errorMessage ? { errorMessage } : {}
10549
+ ...errorMessage ? { [CommandDimensions.ErrorMessage]: errorMessage } : {}
10070
10550
  });
10071
10551
  emitInvocationRequest(telemetryName, success, baseProperties);
10072
10552
  } finally {
@@ -10311,6 +10791,40 @@ function canPrompt() {
10311
10791
  const capabilities = getOutputSink().capabilities;
10312
10792
  return capabilities.isInteractive && capabilities.canReadInput;
10313
10793
  }
10794
+ // ../common/src/mime-types.ts
10795
+ var MIME_TYPES_BY_EXTENSION = Object.freeze({
10796
+ pdf: "application/pdf",
10797
+ png: "image/png",
10798
+ jpg: "image/jpeg",
10799
+ jpeg: "image/jpeg",
10800
+ gif: "image/gif",
10801
+ webp: "image/webp",
10802
+ bmp: "image/bmp",
10803
+ tif: "image/tiff",
10804
+ tiff: "image/tiff",
10805
+ svg: "image/svg+xml",
10806
+ txt: "text/plain",
10807
+ log: "text/plain",
10808
+ md: "text/markdown",
10809
+ csv: "text/csv",
10810
+ tsv: "text/tab-separated-values",
10811
+ json: "application/json",
10812
+ xml: "application/xml",
10813
+ html: "text/html",
10814
+ htm: "text/html",
10815
+ yaml: "application/yaml",
10816
+ yml: "application/yaml",
10817
+ doc: "application/msword",
10818
+ docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
10819
+ xls: "application/vnd.ms-excel",
10820
+ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
10821
+ ppt: "application/vnd.ms-powerpoint",
10822
+ pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
10823
+ zip: "application/zip",
10824
+ mp3: "audio/mpeg",
10825
+ wav: "audio/wav",
10826
+ mp4: "video/mp4"
10827
+ });
10314
10828
  // ../common/src/polling/types.ts
10315
10829
  var PollOutcome = {
10316
10830
  Completed: "completed",
@@ -10355,6 +10869,7 @@ var ScreenLogger;
10355
10869
  ScreenLogger.progress = progress;
10356
10870
  })(ScreenLogger ||= {});
10357
10871
  // ../common/src/sdk-user-agent.ts
10872
+ var AGENT_PROPERTY = BaseDimensions.Agent;
10358
10873
  var sdkUserAgentHostToken = singleton("SdkUserAgentHostToken");
10359
10874
  // ../common/src/telemetry/ship-succeeded.ts
10360
10875
  var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
@@ -31199,6 +31714,11 @@ var pickName = (claims) => {
31199
31714
  const username = asString(claims?.preferred_username);
31200
31715
  return asString(claims?.name) ?? (looksLikeEmail(username) ? undefined : username);
31201
31716
  };
31717
+ var pickScopes = (claims) => {
31718
+ const raw = claims?.scope;
31719
+ const scopes = Array.isArray(raw) ? raw.filter((entry) => asString(entry) !== undefined) : typeof raw === "string" ? raw.split(/\s+/).filter(Boolean) : [];
31720
+ return scopes.length > 0 ? scopes : undefined;
31721
+ };
31202
31722
  var resolveSessionIdentity = (accessToken, authFlow) => {
31203
31723
  const claims = accessToken ? decodeClaims(accessToken) : undefined;
31204
31724
  const email3 = pickEmail(claims);
@@ -31224,6 +31744,7 @@ var resolveSessionIdentity = (accessToken, authFlow) => {
31224
31744
  identity.clientId = clientId;
31225
31745
  return identity;
31226
31746
  };
31747
+ var readTokenScopes = (accessToken) => accessToken ? pickScopes(decodeClaims(accessToken)) : undefined;
31227
31748
 
31228
31749
  // ../auth/src/envAuth.ts
31229
31750
  var ENV_AUTH_ENABLE_VAR = "UIPATH_CLI_ENABLE_ENV_AUTH";
@@ -31296,6 +31817,7 @@ var readAuthFromEnv = () => {
31296
31817
  const expiration = getTokenExpiration(accessToken);
31297
31818
  const loginStatus = expiration && expiration <= new Date ? "Expired" : "Logged in";
31298
31819
  const identity = resolveSessionIdentity(accessToken);
31820
+ const scopes = readTokenScopes(accessToken);
31299
31821
  return {
31300
31822
  loginStatus,
31301
31823
  accessToken,
@@ -31306,7 +31828,8 @@ var readAuthFromEnv = () => {
31306
31828
  tenantId,
31307
31829
  expiration,
31308
31830
  source: "env-vars" /* EnvironmentVariables */,
31309
- ...identity ? { identity } : {}
31831
+ ...identity ? { identity } : {},
31832
+ ...scopes ? { scopes } : {}
31310
31833
  };
31311
31834
  };
31312
31835
 
@@ -31944,10 +32467,15 @@ async function buildFileStatus(tokens, credentials, globalHint) {
31944
32467
  }
31945
32468
  function identityFields(accessToken, credentials) {
31946
32469
  const identity = resolveSessionIdentity(accessToken, parseAuthFlow(credentials[AUTH_FLOW_ENV_VAR]));
31947
- return identity ? { identity } : {};
32470
+ const scopes = readTokenScopes(accessToken);
32471
+ return {
32472
+ ...identity ? { identity } : {},
32473
+ ...scopes ? { scopes } : {}
32474
+ };
31948
32475
  }
31949
32476
  function buildRobotStatus(robotCreds) {
31950
32477
  const identity = resolveSessionIdentity(robotCreds.accessToken);
32478
+ const scopes = readTokenScopes(robotCreds.accessToken);
31951
32479
  return {
31952
32480
  loginStatus: "Logged in",
31953
32481
  accessToken: robotCreds.accessToken,
@@ -31959,7 +32487,8 @@ function buildRobotStatus(robotCreds) {
31959
32487
  issuer: robotCreds.issuer,
31960
32488
  expiration: getTokenExpiration(robotCreds.accessToken),
31961
32489
  source: "robot" /* Robot */,
31962
- ...identity ? { identity } : {}
32490
+ ...identity ? { identity } : {},
32491
+ ...scopes ? { scopes } : {}
31963
32492
  };
31964
32493
  }
31965
32494
  var isFileNotFoundError = (error52) => {
@@ -32226,7 +32755,8 @@ var getAuthContext = async (options = {}) => {
32226
32755
  organizationId: status.organizationId,
32227
32756
  organizationName: status.organizationName,
32228
32757
  tenantId: status.tenantId,
32229
- tenantName
32758
+ tenantName,
32759
+ identity: status.identity
32230
32760
  };
32231
32761
  };
32232
32762
  // ../auth/src/tenantSelection.ts
@@ -44550,4 +45080,4 @@ var registerCommands = async (program2) => {
44550
45080
 
44551
45081
  export { Command, metadata, registerCommands };
44552
45082
 
44553
- //# debugId=40AF3A525107ABE864756E2164756E21
45083
+ //# debugId=8E29DA60FFADE62A64756E2164756E21
package/dist/tool.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  metadata,
3
3
  registerCommands
4
- } from "./tool-ttrz2jja.js";
4
+ } from "./tool-5vq0sjhd.js";
5
5
  import"./tool-mpvp5rqs.js";
6
6
  import"./tool-1yh8g550.js";
7
7
  export {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uipath/vertical-solutions-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": "Scaffold and generate Vertical Solution projects.",
7
7
  "private": false,
8
8
  "repository": {
@@ -35,5 +35,5 @@
35
35
  "files": [
36
36
  "dist"
37
37
  ],
38
- "gitHead": "d8d19829030cc590c630bebfc60a9d9fc7fa8c31"
38
+ "gitHead": "ea7fd32a02acccf14e8e83522e69101430627b83"
39
39
  }