@uipath/codedapp-tool 1.197.0-preview.65 → 1.197.0-preview.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/tool.js +704 -40
  2. package/package.json +2 -2
package/dist/tool.js CHANGED
@@ -21355,8 +21355,8 @@ var require_sequenceEqual = __commonJS((exports) => {
21355
21355
  return lift_1.operate(function(source, subscriber) {
21356
21356
  var aState = createState();
21357
21357
  var bState = createState();
21358
- var emit = function(isEqual) {
21359
- subscriber.next(isEqual);
21358
+ var emit = function(isEqual2) {
21359
+ subscriber.next(isEqual2);
21360
21360
  subscriber.complete();
21361
21361
  };
21362
21362
  var createSubscriber = function(selfState, otherState) {
@@ -58781,6 +58781,9 @@ var init_selectTenant = __esm(() => {
58781
58781
  ]);
58782
58782
  });
58783
58783
 
58784
+ // ../auth/src/types.ts
58785
+ var AUTH_FLOW_ENV_VAR = "UIPATH_AUTH_FLOW";
58786
+
58784
58787
  // ../auth/src/interactive.ts
58785
58788
  var interactiveLoginWithDeps = async (options, deps) => {
58786
58789
  const {
@@ -58830,6 +58833,7 @@ var interactiveLoginWithDeps = async (options, deps) => {
58830
58833
  if (noBrowser && !resolvedSecret && !onEvent) {
58831
58834
  throw new Error("noBrowser login requires an onEvent subscriber to receive the " + "auth-url event — the authorize URL is delivered through it.");
58832
58835
  }
58836
+ const authFlow = resolvedSecret ? "client_credentials" : "authorization_code";
58833
58837
  const authPromise = resolvedSecret ? (async () => {
58834
58838
  return await clientCredentials({
58835
58839
  clientId: config3.clientId,
@@ -58860,7 +58864,8 @@ var interactiveLoginWithDeps = async (options, deps) => {
58860
58864
  issuerAsserter(tokens.UIPATH_ACCESS_TOKEN, config3.baseUrl);
58861
58865
  const credentials = {
58862
58866
  ...tokens,
58863
- UIPATH_URL: config3.baseUrl
58867
+ UIPATH_URL: config3.baseUrl,
58868
+ [AUTH_FLOW_ENV_VAR]: authFlow
58864
58869
  };
58865
58870
  try {
58866
58871
  const tokenData = jwtParser(tokens.UIPATH_ACCESS_TOKEN);
@@ -59454,7 +59459,8 @@ __export(exports_src, {
59454
59459
  DEFAULT_AUTH_FILENAME: () => DEFAULT_AUTH_FILENAME,
59455
59460
  ClientCredentialsAuthenticationError: () => ClientCredentialsAuthenticationError,
59456
59461
  AuthProfileValidationError: () => AuthProfileValidationError,
59457
- AUTH_TIMEOUT_ERROR_CODE: () => AUTH_TIMEOUT_ERROR_CODE
59462
+ AUTH_TIMEOUT_ERROR_CODE: () => AUTH_TIMEOUT_ERROR_CODE,
59463
+ AUTH_FLOW_ENV_VAR: () => AUTH_FLOW_ENV_VAR
59458
59464
  });
59459
59465
  var authenticate = async ({
59460
59466
  baseUrl,
@@ -59548,7 +59554,7 @@ var init_src2 = __esm(() => {
59548
59554
  var package_default = {
59549
59555
  name: "@uipath/codedapp-tool",
59550
59556
  license: "MIT",
59551
- version: "1.197.0-preview.65",
59557
+ version: "1.197.0-preview.67",
59552
59558
  description: "Build, pack, publish, deploy, and manage UiPath Coded Web Applications.",
59553
59559
  keywords: [
59554
59560
  "cli-tool",
@@ -64657,9 +64663,228 @@ function getOutputFilter() {
64657
64663
  return filterSlot.get();
64658
64664
  }
64659
64665
 
64666
+ // ../common/src/telemetry/command-terminal.ts
64667
+ var recordedFailureSlot = singleton("CommandTelemetryFailure");
64668
+ var AUTH_ERROR_CODES = new Set([
64669
+ "authentication_required",
64670
+ "permission_denied"
64671
+ ]);
64672
+ var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
64673
+ var NETWORK_HTTP_ERROR_CODES = new Set([
64674
+ "network_error",
64675
+ "rate_limited",
64676
+ "server_error",
64677
+ "not_found",
64678
+ "method_not_allowed"
64679
+ ]);
64680
+ var TIMEOUT_ERROR_CODES = new Set(["timeout"]);
64681
+ var NETWORK_OS_ERROR_CODES = new Set([
64682
+ "ECONNREFUSED",
64683
+ "ECONNRESET",
64684
+ "ENOTFOUND",
64685
+ "EAI_AGAIN",
64686
+ "EPIPE",
64687
+ "EHOSTUNREACH",
64688
+ "ENETUNREACH",
64689
+ "EAI_FAIL"
64690
+ ]);
64691
+ var TIMEOUT_OS_ERROR_CODES = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
64692
+ var TLS_ERROR_CODES2 = new Set([
64693
+ "SELF_SIGNED_CERT_IN_CHAIN",
64694
+ "DEPTH_ZERO_SELF_SIGNED_CERT",
64695
+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
64696
+ "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
64697
+ "UNABLE_TO_GET_ISSUER_CERT",
64698
+ "CERT_HAS_EXPIRED",
64699
+ "CERT_UNTRUSTED",
64700
+ "ERR_TLS_CERT_ALTNAME_INVALID"
64701
+ ]);
64702
+ var MISSING_DEPENDENCY_CODES = new Set([
64703
+ "MODULE_NOT_FOUND",
64704
+ "ERR_MODULE_NOT_FOUND"
64705
+ ]);
64706
+ var INTERNAL_ERROR_NAMES = new Set([
64707
+ "TypeError",
64708
+ "ReferenceError",
64709
+ "SyntaxError",
64710
+ "RangeError"
64711
+ ]);
64712
+ function isRecord(value) {
64713
+ return value !== null && typeof value === "object";
64714
+ }
64715
+ function stringField(value, field) {
64716
+ if (!isRecord(value)) {
64717
+ return;
64718
+ }
64719
+ const raw = value[field];
64720
+ return typeof raw === "string" ? raw : undefined;
64721
+ }
64722
+ function numberField(value, field) {
64723
+ if (!isRecord(value)) {
64724
+ return;
64725
+ }
64726
+ const raw = value[field];
64727
+ return typeof raw === "number" ? raw : undefined;
64728
+ }
64729
+ function findStringInCauseChain(error, field) {
64730
+ let current = error;
64731
+ for (let depth = 0;depth < 5 && current !== null && typeof current === "object"; depth++) {
64732
+ const value = stringField(current, field);
64733
+ if (value) {
64734
+ return value;
64735
+ }
64736
+ current = current.cause;
64737
+ }
64738
+ return;
64739
+ }
64740
+ function findCodeInCauseChain(error) {
64741
+ return findStringInCauseChain(error, "code");
64742
+ }
64743
+ function isSpawnEnoent(error) {
64744
+ const code = findCodeInCauseChain(error);
64745
+ if (code !== "ENOENT") {
64746
+ return false;
64747
+ }
64748
+ const syscall = findStringInCauseChain(error, "syscall");
64749
+ return syscall?.startsWith("spawn") === true;
64750
+ }
64751
+ function isCancellationError(error, exitCode, pollSignal) {
64752
+ if (exitCode === 130) {
64753
+ return true;
64754
+ }
64755
+ if (!isRecord(error)) {
64756
+ return false;
64757
+ }
64758
+ if (numberField(error, "exitCode") === 130) {
64759
+ return true;
64760
+ }
64761
+ const name = stringField(error, "name");
64762
+ if (name === "ExitPromptError") {
64763
+ return true;
64764
+ }
64765
+ if (name === "AbortError" && pollSignal?.aborted) {
64766
+ return true;
64767
+ }
64768
+ const message = stringField(error, "message");
64769
+ return message?.includes("SIGINT") === true;
64770
+ }
64771
+ function terminalSignalFor(input, outcome) {
64772
+ if (input.recordedFailure?.terminalSignal) {
64773
+ return input.recordedFailure.terminalSignal;
64774
+ }
64775
+ const explicit = findStringInCauseChain(input.error, "terminalSignal") ?? findStringInCauseChain(input.error, "signal");
64776
+ if (explicit) {
64777
+ return explicit;
64778
+ }
64779
+ return outcome === "cancelled" ? "SIGINT" : undefined;
64780
+ }
64781
+ function classifyHttpStatus(status) {
64782
+ if (status === 401 || status === 403) {
64783
+ return "auth";
64784
+ }
64785
+ if (status === 400 || status === 409 || status === 422) {
64786
+ return "validation";
64787
+ }
64788
+ if (status === 408) {
64789
+ return "timeout";
64790
+ }
64791
+ return "network_http";
64792
+ }
64793
+ function classifyFromResult(result) {
64794
+ switch (result) {
64795
+ case "AuthenticationError":
64796
+ return "auth";
64797
+ case "ValidationError":
64798
+ return "validation";
64799
+ case "TimeoutError":
64800
+ return "timeout";
64801
+ default:
64802
+ return;
64803
+ }
64804
+ }
64805
+ function classifyFromErrorCode(errorCode) {
64806
+ if (!errorCode) {
64807
+ return;
64808
+ }
64809
+ if (AUTH_ERROR_CODES.has(errorCode)) {
64810
+ return "auth";
64811
+ }
64812
+ if (VALIDATION_ERROR_CODES.has(errorCode)) {
64813
+ return "validation";
64814
+ }
64815
+ if (TIMEOUT_ERROR_CODES.has(errorCode)) {
64816
+ return "timeout";
64817
+ }
64818
+ if (NETWORK_HTTP_ERROR_CODES.has(errorCode)) {
64819
+ return "network_http";
64820
+ }
64821
+ return;
64822
+ }
64823
+ function classifyFromError(error) {
64824
+ const code = findCodeInCauseChain(error);
64825
+ if (code) {
64826
+ if (code.startsWith("commander.")) {
64827
+ return "validation";
64828
+ }
64829
+ if (NETWORK_OS_ERROR_CODES.has(code) || TLS_ERROR_CODES2.has(code)) {
64830
+ return "network_http";
64831
+ }
64832
+ if (TIMEOUT_OS_ERROR_CODES.has(code)) {
64833
+ return "timeout";
64834
+ }
64835
+ if (MISSING_DEPENDENCY_CODES.has(code) || isSpawnEnoent(error)) {
64836
+ return "missing_dependency";
64837
+ }
64838
+ }
64839
+ const message = stringField(error, "message");
64840
+ if (message?.includes("fetch failed") === true) {
64841
+ return "network_http";
64842
+ }
64843
+ const name = stringField(error, "name");
64844
+ if (name && INTERNAL_ERROR_NAMES.has(name)) {
64845
+ return "internal";
64846
+ }
64847
+ return;
64848
+ }
64849
+ function classifyError(input) {
64850
+ const recorded = input.recordedFailure;
64851
+ if (recorded?.errorClass) {
64852
+ return recorded.errorClass;
64853
+ }
64854
+ const status = recorded?.context?.httpStatus;
64855
+ if (status !== undefined) {
64856
+ return classifyHttpStatus(status);
64857
+ }
64858
+ return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
64859
+ }
64860
+ function recordCommandFailureTelemetry(failure) {
64861
+ recordedFailureSlot.set(failure);
64862
+ }
64863
+ function clearRecordedCommandFailureTelemetry() {
64864
+ recordedFailureSlot.clear();
64865
+ }
64866
+ function takeRecordedCommandFailureTelemetry() {
64867
+ const failure = recordedFailureSlot.get();
64868
+ recordedFailureSlot.clear();
64869
+ return failure;
64870
+ }
64871
+ function buildCommandTerminalTelemetryProperties(input) {
64872
+ const cancelled = isCancellationError(input.error, input.exitCode, input.pollSignal);
64873
+ const outcome = input.recordedFailure?.terminalOutcome ?? (input.exitCode === 0 ? "success" : cancelled ? "cancelled" : "failure");
64874
+ const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError(input);
64875
+ const terminalSignal = terminalSignalFor(input, outcome);
64876
+ return {
64877
+ exit_code: input.exitCode,
64878
+ terminal_outcome: outcome,
64879
+ ...errorClass ? { error_class: errorClass } : {},
64880
+ ...terminalSignal ? { terminal_signal: terminalSignal } : {}
64881
+ };
64882
+ }
64883
+
64660
64884
  // ../common/src/telemetry/telemetry-events.ts
64661
64885
  var CommonTelemetryEvents = {
64662
- Error: "uip.error"
64886
+ Error: "uip.error",
64887
+ ShipSucceeded: "ship_succeeded"
64663
64888
  };
64664
64889
 
64665
64890
  // ../common/src/registry.ts
@@ -64726,6 +64951,136 @@ function formatMessage(category, name, properties) {
64726
64951
  }
64727
64952
  return message;
64728
64953
  }
64954
+ // ../common/src/telemetry/detect-agent.ts
64955
+ var KNOWN_AGENTS = [
64956
+ { envVar: "CLAUDECODE", value: "1", id: "claude-code" },
64957
+ { envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
64958
+ { envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
64959
+ { envVar: "CODEX_THREAD_ID", id: "codex" },
64960
+ { envVar: "CODEX_SANDBOX", id: "codex" },
64961
+ { envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
64962
+ { envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
64963
+ ];
64964
+ function detectAgentFromEnv(env) {
64965
+ for (const agent of KNOWN_AGENTS) {
64966
+ const envValue = env[agent.envVar];
64967
+ if (agent.value !== undefined) {
64968
+ if (envValue === agent.value)
64969
+ return agent.id;
64970
+ } else {
64971
+ if (envValue)
64972
+ return agent.id;
64973
+ }
64974
+ }
64975
+ const agentEnv = env.AGENT;
64976
+ if (agentEnv) {
64977
+ if (agentEnv === "1" || agentEnv === "true")
64978
+ return "unknown";
64979
+ if (agentEnv.length <= 32)
64980
+ return agentEnv.toLowerCase();
64981
+ }
64982
+ return;
64983
+ }
64984
+ // ../common/src/telemetry/environment-info.ts
64985
+ var LOCAL_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
64986
+ // ../common/src/telemetry/execution-context.ts
64987
+ var authSignalSlot = singleton("TelemetryExecutionContextAuthSignal");
64988
+ var isTruthy = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false";
64989
+ var isEqual = (value, expected) => value?.toLowerCase() === expected;
64990
+ var CI_SIGNATURES = [
64991
+ {
64992
+ provider: "github_actions",
64993
+ matches: (env) => isTruthy(env.GITHUB_ACTIONS),
64994
+ isScheduler: (env) => env.GITHUB_EVENT_NAME === "schedule"
64995
+ },
64996
+ {
64997
+ provider: "azure_devops",
64998
+ matches: (env) => isTruthy(env.TF_BUILD),
64999
+ isScheduler: (env) => isEqual(env.BUILD_REASON, "schedule")
65000
+ },
65001
+ {
65002
+ provider: "gitlab",
65003
+ matches: (env) => isTruthy(env.GITLAB_CI),
65004
+ isScheduler: (env) => env.CI_PIPELINE_SOURCE === "schedule"
65005
+ },
65006
+ {
65007
+ provider: "circleci",
65008
+ matches: (env) => isTruthy(env.CIRCLECI),
65009
+ isScheduler: (env) => env.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
65010
+ },
65011
+ {
65012
+ provider: "jenkins",
65013
+ matches: (env) => isTruthy(env.JENKINS_URL) || isTruthy(env.JENKINS_HOME)
65014
+ },
65015
+ {
65016
+ provider: "teamcity",
65017
+ matches: (env) => isTruthy(env.TEAMCITY_VERSION)
65018
+ },
65019
+ {
65020
+ provider: "buildkite",
65021
+ matches: (env) => isTruthy(env.BUILDKITE),
65022
+ isScheduler: (env) => env.BUILDKITE_SOURCE === "schedule"
65023
+ },
65024
+ {
65025
+ provider: "bitbucket",
65026
+ matches: (env) => isTruthy(env.BITBUCKET_BUILD_NUMBER)
65027
+ },
65028
+ {
65029
+ provider: "travis",
65030
+ matches: (env) => isTruthy(env.TRAVIS)
65031
+ },
65032
+ {
65033
+ provider: "appveyor",
65034
+ matches: (env) => isTruthy(env.APPVEYOR)
65035
+ },
65036
+ {
65037
+ provider: "generic",
65038
+ matches: (env) => isTruthy(env.CI)
65039
+ }
65040
+ ];
65041
+ function currentEnv() {
65042
+ return typeof process === "undefined" ? {} : process.env;
65043
+ }
65044
+ function currentTtyState() {
65045
+ if (typeof process === "undefined")
65046
+ return false;
65047
+ return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
65048
+ }
65049
+ function detectCi(env) {
65050
+ const signature = CI_SIGNATURES.find((candidate) => candidate.matches(env));
65051
+ if (!signature)
65052
+ return;
65053
+ return {
65054
+ executionContext: signature.isScheduler?.(env) ? "scheduler" : "ci",
65055
+ ciProvider: signature.provider
65056
+ };
65057
+ }
65058
+ function detectExecutionContext(options = {}) {
65059
+ const env = options.env ?? currentEnv();
65060
+ const ci = detectCi(env);
65061
+ if (ci)
65062
+ return ci;
65063
+ const agent = options.agent ?? detectAgentFromEnv(env);
65064
+ if (agent) {
65065
+ return { executionContext: "agent" };
65066
+ }
65067
+ const authSignal = options.authSignal ?? authSignalSlot.get();
65068
+ if (authSignal === "service_account") {
65069
+ return { executionContext: "service_account" };
65070
+ }
65071
+ const isTty = options.isTty ?? currentTtyState();
65072
+ if (isTty) {
65073
+ return { executionContext: "manual" };
65074
+ }
65075
+ return { executionContext: "unknown" };
65076
+ }
65077
+ function getExecutionContextTelemetryProperties() {
65078
+ const detected = detectExecutionContext();
65079
+ return {
65080
+ execution_context: detected.executionContext,
65081
+ ...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
65082
+ };
65083
+ }
64729
65084
  // ../common/src/telemetry/node-context-storage.ts
64730
65085
  import { AsyncLocalStorage } from "node:async_hooks";
64731
65086
 
@@ -64738,6 +65093,26 @@ class NodeContextStorage {
64738
65093
  return this.storage.getStore();
64739
65094
  }
64740
65095
  }
65096
+ // ../common/src/telemetry/session-id.ts
65097
+ var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
65098
+ var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
65099
+ var telemetrySessionIdSlot = singleton("TelemetrySessionId");
65100
+ function getProcessEnv() {
65101
+ return globalThis.process?.env;
65102
+ }
65103
+ function normalizeSessionId(value) {
65104
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
65105
+ return;
65106
+ }
65107
+ const trimmed = String(value).trim();
65108
+ return trimmed || undefined;
65109
+ }
65110
+ function getConfiguredTelemetrySessionId() {
65111
+ return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
65112
+ }
65113
+ function resolveTelemetrySessionId(existingSessionId) {
65114
+ return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
65115
+ }
64741
65116
  // ../common/src/telemetry/global-telemetry-properties.ts
64742
65117
  var telemetryPropsSlot = singleton("TelemetryDefaultProps");
64743
65118
  function getGlobalTelemetryProperties() {
@@ -64822,12 +65197,22 @@ class TelemetryService {
64822
65197
  return this.contextStorage.getContext();
64823
65198
  }
64824
65199
  enrichPropertiesWithContext(properties, context) {
64825
- return {
64826
- ...getGlobalTelemetryProperties(),
65200
+ const globalProperties = getGlobalTelemetryProperties();
65201
+ const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
65202
+ const sessionId = resolveTelemetrySessionId(existingSessionId);
65203
+ const enriched = {
65204
+ ...getExecutionContextTelemetryProperties(),
65205
+ ...globalProperties,
64827
65206
  ...this.defaultProperties,
64828
65207
  ...properties,
64829
65208
  ...context
64830
65209
  };
65210
+ if (sessionId === undefined) {
65211
+ delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
65212
+ } else {
65213
+ enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
65214
+ }
65215
+ return enriched;
64831
65216
  }
64832
65217
  generateId() {
64833
65218
  return crypto.randomUUID().replaceAll("-", "");
@@ -65297,8 +65682,24 @@ var OutputFormatter;
65297
65682
  data.ErrorCode ??= defaultErrorCodeForFailure(data);
65298
65683
  data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
65299
65684
  process.exitCode = EXIT_CODES[data.Result] ?? 1;
65300
- const { SuppressTelemetry, ...envelope } = data;
65301
- if (!SuppressTelemetry) {
65685
+ recordCommandFailureTelemetry({
65686
+ result: data.Result,
65687
+ errorCode: data.ErrorCode,
65688
+ retry: data.Retry,
65689
+ message: data.Message,
65690
+ context: data.Context,
65691
+ exitCode: process.exitCode,
65692
+ errorClass: data.TelemetryErrorClass,
65693
+ terminalOutcome: data.TelemetryTerminalOutcome,
65694
+ terminalSignal: data.TelemetryTerminalSignal
65695
+ });
65696
+ const suppressTelemetry = data.SuppressTelemetry === true;
65697
+ const envelope = { ...data };
65698
+ delete envelope.SuppressTelemetry;
65699
+ delete envelope.TelemetryErrorClass;
65700
+ delete envelope.TelemetryTerminalOutcome;
65701
+ delete envelope.TelemetryTerminalSignal;
65702
+ if (!suppressTelemetry) {
65302
65703
  telemetry.trackEvent(CommonTelemetryEvents.Error, {
65303
65704
  result: data.Result,
65304
65705
  errorCode: data.ErrorCode,
@@ -65361,6 +65762,158 @@ var OutputFormatter;
65361
65762
  OutputFormatter.formatToString = formatToString;
65362
65763
  })(OutputFormatter ||= {});
65363
65764
 
65765
+ // ../common/src/telemetry/command-attribution.ts
65766
+ var LEGACY_SKILL_NAMESPACE = "uipath:";
65767
+ var MAX_SKILL_NAME_LENGTH = 80;
65768
+ var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
65769
+ function productMode(productArea, mode) {
65770
+ return { product_area: productArea, mode };
65771
+ }
65772
+ function attributionRecord(groups) {
65773
+ const record = {};
65774
+ for (const [productArea, mode, names] of groups) {
65775
+ const attribution = productMode(productArea, mode);
65776
+ for (const name of names) {
65777
+ record[name] = attribution;
65778
+ }
65779
+ }
65780
+ return record;
65781
+ }
65782
+ function commandAttribution(groups) {
65783
+ const entries = [];
65784
+ for (const [productArea, mode, prefixes] of groups) {
65785
+ const attribution = productMode(productArea, mode);
65786
+ for (const prefix of prefixes) {
65787
+ entries.push({ prefix, attribution });
65788
+ }
65789
+ }
65790
+ return entries;
65791
+ }
65792
+ var SKILL_ATTRIBUTION = attributionRecord([
65793
+ ["admin", "operate", ["uipath-admin"]],
65794
+ ["agents", "build", ["uipath-agents"]],
65795
+ ["api-workflow", "build", ["uipath-api-workflow"]],
65796
+ ["automation-discovery", "build", ["uipath-automation-discovery"]],
65797
+ ["coded-apps", "build", ["uipath-coded-apps"]],
65798
+ ["data-fabric", "operate", ["uipath-data-fabric"]],
65799
+ ["cli", "troubleshoot", ["uipath-feedback"]],
65800
+ ["governance", "operate", ["uipath-governance"]],
65801
+ ["action-center", "build", ["uipath-human-in-the-loop"]],
65802
+ ["document-understanding", "build", ["uipath-ixp"]],
65803
+ [
65804
+ "maestro",
65805
+ "build",
65806
+ ["uipath-maestro-bpmn", "uipath-maestro-case", "uipath-maestro-flow"]
65807
+ ],
65808
+ ["agenthub", "build", ["uipath-mcp-servers"]],
65809
+ ["solution", "build", ["uipath-planner", "uipath-solution"]],
65810
+ ["platform", "operate", ["uipath-platform"]],
65811
+ ["quality", "troubleshoot", ["uipath-review"]],
65812
+ ["rpa", "build", ["uipath-rpa"]],
65813
+ ["cli", "operate", ["uipath-skill-catalog"]],
65814
+ ["action-center", "operate", ["uipath-tasks"]],
65815
+ ["test-manager", "operate", ["uipath-test"]],
65816
+ ["platform", "troubleshoot", ["uipath-troubleshoot"]]
65817
+ ]);
65818
+ var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
65819
+ var COMMAND_ATTRIBUTION = commandAttribution([
65820
+ ["cli", "troubleshoot", ["uip.feedback"]],
65821
+ ["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
65822
+ ["context-grounding", "build", ["uip.context-grounding"]],
65823
+ ["api-workflow", "build", ["uip.api-workflow"]],
65824
+ ["rpa", "build", ["uip.rpa-legacy"]],
65825
+ ["conversational", "operate", ["uip.conversational"]],
65826
+ ["agents", "build", ["uip.codedagent", "uip.agent"]],
65827
+ ["agenthub", "build", ["uip.agenthub"]],
65828
+ ["coded-apps", "build", ["uip.codedapp"]],
65829
+ ["functions", "build", ["uip.functions"]],
65830
+ ["solution", "build", ["uip.solution"]],
65831
+ ["maestro", "build", ["uip.maestro", "uip.case", "uip.flow"]],
65832
+ ["llm-observability", "troubleshoot", ["uip.traces"]],
65833
+ ["platform", "operate", ["uip.platform"]],
65834
+ ["admin", "operate", ["uip.admin"]],
65835
+ ["automation-ops", "operate", ["uip.aops"]],
65836
+ ["documentation", "troubleshoot", ["uip.docsai"]],
65837
+ ["governance", "operate", ["uip.gov"]],
65838
+ ["insights", "operate", ["uip.insights"]],
65839
+ ["document-understanding", "build", ["uip.ixp"]],
65840
+ ["process-mining", "operate", ["uip.pm"]],
65841
+ ["action-center", "operate", ["uip.tasks"]],
65842
+ ["test-manager", "operate", ["uip.tm"]],
65843
+ ["vertical-solutions", "build", ["uip.vss"]],
65844
+ ["data-fabric", "operate", ["uip.df"]],
65845
+ ["integration-service", "build", ["uip.is"]],
65846
+ ["orchestrator", "operate", ["uip.or"]],
65847
+ [
65848
+ "cli",
65849
+ "operate",
65850
+ [
65851
+ "uip.login",
65852
+ "uip.logout",
65853
+ "uip.user",
65854
+ "uip.config",
65855
+ "uip.tools",
65856
+ "uip.skills",
65857
+ "uip.completion",
65858
+ "uip.update",
65859
+ "uip.mcp",
65860
+ "uip.track"
65861
+ ]
65862
+ ]
65863
+ ]).sort((a, b) => b.prefix.length - a.prefix.length);
65864
+ function normalizeCommandPath(value) {
65865
+ if (typeof value !== "string") {
65866
+ return;
65867
+ }
65868
+ const trimmed = value.trim().toLowerCase();
65869
+ if (!trimmed) {
65870
+ return;
65871
+ }
65872
+ const tokens = trimmed.includes(" ") ? trimmed.split(/\s+/).filter((token) => token.length > 0).filter((token) => !token.startsWith("-")) : trimmed.split(".").filter((token) => token.length > 0);
65873
+ if (tokens.length === 0) {
65874
+ return;
65875
+ }
65876
+ const commandTokens = tokens[0] === "uip" ? tokens : ["uip", ...tokens];
65877
+ return commandTokens.join(".");
65878
+ }
65879
+ function getCommandProductModeAttribution(commandPath) {
65880
+ const normalized = normalizeCommandPath(commandPath);
65881
+ if (!normalized) {
65882
+ return;
65883
+ }
65884
+ return COMMAND_ATTRIBUTION.find(({ prefix }) => normalized === prefix || normalized.startsWith(`${prefix}.`))?.attribution;
65885
+ }
65886
+ function normalizeSkillNameWithOptions(value, options) {
65887
+ if (typeof value !== "string") {
65888
+ return;
65889
+ }
65890
+ const normalized = value.trim().toLowerCase();
65891
+ if (!normalized) {
65892
+ return;
65893
+ }
65894
+ const hasLegacyNamespace = normalized.startsWith(LEGACY_SKILL_NAMESPACE);
65895
+ if (hasLegacyNamespace && !options.allowLegacyNamespace) {
65896
+ return;
65897
+ }
65898
+ const skillName = hasLegacyNamespace ? normalized.slice(LEGACY_SKILL_NAMESPACE.length) : normalized;
65899
+ if (skillName.length > MAX_SKILL_NAME_LENGTH || !SKILL_NAME_PATTERN.test(skillName) || !KNOWN_SKILL_NAMES.has(skillName)) {
65900
+ return;
65901
+ }
65902
+ return skillName;
65903
+ }
65904
+ function normalizeSkillName(value) {
65905
+ return normalizeSkillNameWithOptions(value, {
65906
+ allowLegacyNamespace: false
65907
+ });
65908
+ }
65909
+ function buildCommandTelemetryAttribution(commandPath, skillSource) {
65910
+ const skillName = normalizeSkillName(skillSource);
65911
+ return {
65912
+ ...skillName ? { skill_name: skillName } : {},
65913
+ ...getCommandProductModeAttribution(commandPath)
65914
+ };
65915
+ }
65916
+
65364
65917
  // ../common/src/telemetry/pii-redactor.ts
65365
65918
  var REDACTED = "[REDACTED]";
65366
65919
  var MAX_VALUE_LENGTH = 200;
@@ -65546,6 +66099,12 @@ function commandHelpHint(commandPath) {
65546
66099
  const command = commandPath.replace(/\./g, " ");
65547
66100
  return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
65548
66101
  }
66102
+ function isPromptCancellation(error) {
66103
+ return error instanceof Error && error.name === "ExitPromptError";
66104
+ }
66105
+ function exitCodeFromProcess(fallback) {
66106
+ return typeof process.exitCode === "number" ? process.exitCode : fallback;
66107
+ }
65549
66108
  Command.prototype.trackedAction = function(context, fn, properties) {
65550
66109
  const command = this;
65551
66110
  return this.action(async (...args) => {
@@ -65553,6 +66112,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
65553
66112
  const props = typeof properties === "function" ? properties(...args) : properties;
65554
66113
  const startTime = performance.now();
65555
66114
  let errorMessage;
66115
+ let fallbackExitCode = EXIT_CODES.Success;
66116
+ clearRecordedCommandFailureTelemetry();
65556
66117
  const [error] = await catchError(fn(...args));
65557
66118
  if (error) {
65558
66119
  errorMessage = error instanceof Error ? error.message : String(error);
@@ -65567,6 +66128,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
65567
66128
  const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
65568
66129
  const typedContext = typed.context ?? typed.Context;
65569
66130
  const customContext = isErrorContext(typedContext) ? typedContext : undefined;
66131
+ const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
66132
+ fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
65570
66133
  OutputFormatter.error({
65571
66134
  Result: finalResult,
65572
66135
  ...customErrorCode ? { ErrorCode: customErrorCode } : {},
@@ -65575,16 +66138,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
65575
66138
  ...customRetry ? { Retry: customRetry } : {},
65576
66139
  ...customContext ? { Context: customContext } : {}
65577
66140
  });
65578
- context.exit(EXIT_CODES[finalResult]);
66141
+ context.exit(fallbackExitCode);
65579
66142
  }
65580
66143
  const durationMs = performance.now() - startTime;
65581
- const success = !error && (process.exitCode === undefined || process.exitCode === 0);
66144
+ const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
66145
+ const recordedFailure = takeRecordedCommandFailureTelemetry();
66146
+ const success = !error && exitCode === 0;
66147
+ const terminalTelemetry = buildCommandTerminalTelemetryProperties({
66148
+ error,
66149
+ exitCode,
66150
+ recordedFailure,
66151
+ pollSignal: context.pollSignal
66152
+ });
65582
66153
  telemetry.trackEvent(telemetryName, redactProperties({
65583
66154
  ...extractCommandParams(command),
65584
66155
  ...props,
66156
+ ...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
65585
66157
  command: "true",
65586
66158
  duration: String(durationMs),
65587
66159
  success: String(success),
66160
+ ...terminalTelemetry,
65588
66161
  ...errorMessage ? { errorMessage } : {}
65589
66162
  }));
65590
66163
  });
@@ -65765,6 +66338,36 @@ function installRequestHeaderForwarding(BaseApiClass, patchKey, forward) {
65765
66338
  function installSdkUserAgentHeader(BaseApiClass, userAgent) {
65766
66339
  installRequestHeaderForwarding(BaseApiClass, userAgentPatchKey(userAgent), (headers) => addSdkUserAgentHeader(headers, userAgent));
65767
66340
  }
66341
+ // ../common/src/telemetry/ship-succeeded.ts
66342
+ var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
66343
+ function getShippedKeys() {
66344
+ const existing = shippedKeysSlot.get();
66345
+ if (existing) {
66346
+ return existing;
66347
+ }
66348
+ const keys = new Set;
66349
+ shippedKeysSlot.set(keys);
66350
+ return keys;
66351
+ }
66352
+ function dedupeKey(payload) {
66353
+ return [
66354
+ payload.command_name,
66355
+ payload.ship_kind,
66356
+ payload.target,
66357
+ payload.project_type,
66358
+ payload.artifact_correlation_key ?? payload.package_version_key ?? payload.deployment_key ?? payload.solution_id ?? payload.package_name ?? ""
66359
+ ].join("|");
66360
+ }
66361
+ function trackShipSucceeded(payload) {
66362
+ const keys = getShippedKeys();
66363
+ const key = dedupeKey(payload);
66364
+ if (keys.has(key)) {
66365
+ return false;
66366
+ }
66367
+ keys.add(key);
66368
+ telemetry.trackEvent(CommonTelemetryEvents.ShipSucceeded, redactProperties({ ...payload }));
66369
+ return true;
66370
+ }
65768
66371
  // ../common/src/tool-provider.ts
65769
66372
  var factorySlot = singleton("PackagerFactoryProvider");
65770
66373
  // src/actions/deploy.ts
@@ -88850,7 +89453,7 @@ function logMissingConfigError(missing, logger3) {
88850
89453
  }
88851
89454
  });
88852
89455
  }
88853
- function normalizeBaseUrl(url2) {
89456
+ function normalizeBaseUrl2(url2) {
88854
89457
  let baseUrl = url2 || BASE_URLS.cloud;
88855
89458
  if (!baseUrl.startsWith("http://") && !baseUrl.startsWith("https://")) {
88856
89459
  baseUrl = `https://${baseUrl}`;
@@ -88859,7 +89462,7 @@ function normalizeBaseUrl(url2) {
88859
89462
  }
88860
89463
  function buildConfig(mergedValues) {
88861
89464
  return {
88862
- baseUrl: normalizeBaseUrl(mergedValues[ENV_CONFIG.BASE_URL.envVar]),
89465
+ baseUrl: normalizeBaseUrl2(mergedValues[ENV_CONFIG.BASE_URL.envVar]),
88863
89466
  orgId: mergedValues[ENV_CONFIG.ORG_ID.envVar] ?? "",
88864
89467
  orgName: mergedValues[ENV_CONFIG.ORG_NAME.envVar] ?? "",
88865
89468
  tenantId: mergedValues[ENV_CONFIG.TENANT_ID.envVar] ?? "",
@@ -89202,6 +89805,16 @@ async function updateAppConfig(deploymentId, logger3) {
89202
89805
  function buildNotPublishedMessage(version2) {
89203
89806
  return version2 ? `${MESSAGES.ERRORS.APP_NOT_PUBLISHED} (version ${version2})` : MESSAGES.ERRORS.APP_NOT_PUBLISHED;
89204
89807
  }
89808
+ function logDeployDetails(logger3, displayTitle, version2, appUrl) {
89809
+ logger3.log("");
89810
+ logger3.log(` ${source_default.cyan("App Name:")} ${displayTitle}`);
89811
+ logger3.log(` ${source_default.cyan("Version:")} ${version2}`);
89812
+ if (appUrl === null) {
89813
+ logger3.log(` ${source_default.yellow(MESSAGES.INFO.ACTION_APP_RUN_IN_ACTION_CENTER)}`);
89814
+ return;
89815
+ }
89816
+ logger3.log(` ${source_default.cyan("App URL:")} ${source_default.green(appUrl)}`);
89817
+ }
89205
89818
  async function executeDeploy(options) {
89206
89819
  const logger3 = options.logger ?? {
89207
89820
  log: (msg) => logger.info(msg)
@@ -89245,9 +89858,9 @@ async function executeDeploy(options) {
89245
89858
  }
89246
89859
  validateAppNameLength(routingName);
89247
89860
  let spinner = ora(MESSAGES.INFO.CHECKING_DEPLOYMENT_STATUS).start();
89248
- const [deployError] = await catchError((async () => {
89861
+ const [deployError, deployResult] = await catchError((async () => {
89249
89862
  const deployedApp = await getDeployedApp(appName, displayTitle, envConfig);
89250
- let version2;
89863
+ let operationResult;
89251
89864
  if (deployedApp) {
89252
89865
  spinner.text = MESSAGES.INFO.UPGRADING_APP;
89253
89866
  const publishedApp = await getPublishedAppWithRetry(appName, envConfig, options.version, () => {
@@ -89258,14 +89871,21 @@ async function executeDeploy(options) {
89258
89871
  spinner.fail(source_default.red(notFoundMsg));
89259
89872
  throw new Error(notFoundMsg);
89260
89873
  }
89261
- if (!publishedApp.deployVersion) {
89874
+ if (publishedApp.deployVersion === undefined) {
89262
89875
  spinner.fail(source_default.red(MESSAGES.ERRORS.DEPLOY_VERSION_NOT_FOUND));
89263
89876
  throw new Error(MESSAGES.ERRORS.DEPLOY_VERSION_NOT_FOUND);
89264
89877
  }
89265
89878
  await upgradeApp(deployedApp.id, displayTitle, publishedApp.deployVersion, options.pathName ? routingName : undefined, envConfig, options.tags);
89266
89879
  spinner.succeed(source_default.green(MESSAGES.SUCCESS.APP_UPGRADED_SUCCESS));
89267
89880
  const appConfig3 = await loadAppConfig(logger3);
89268
- version2 = publishedApp.definition?.codedAppMetadata?.packageVersion ?? appConfig3?.appVersion ?? deployedApp.semVersion;
89881
+ const version2 = publishedApp.definition?.codedAppMetadata?.packageVersion ?? appConfig3?.appVersion ?? deployedApp.semVersion;
89882
+ operationResult = {
89883
+ version: version2,
89884
+ deploymentId: deployedApp.id,
89885
+ systemName: publishedApp.systemName,
89886
+ deployVersion: publishedApp.deployVersion,
89887
+ operation: "upgrade"
89888
+ };
89269
89889
  cliTelemetryClient.track(CodedAppTelemetryEvents.Deploy, {
89270
89890
  operation: "upgrade"
89271
89891
  });
@@ -89282,7 +89902,7 @@ async function executeDeploy(options) {
89282
89902
  spinner.fail(source_default.red(notFoundMsg));
89283
89903
  throw new Error(notFoundMsg);
89284
89904
  }
89285
- if (!publishedApp.deployVersion) {
89905
+ if (publishedApp.deployVersion === undefined) {
89286
89906
  spinner.fail(source_default.red(MESSAGES.ERRORS.DEPLOY_VERSION_NOT_FOUND));
89287
89907
  throw new Error(MESSAGES.ERRORS.DEPLOY_VERSION_NOT_FOUND);
89288
89908
  }
@@ -89290,21 +89910,27 @@ async function executeDeploy(options) {
89290
89910
  spinner.succeed(source_default.green(MESSAGES.SUCCESS.APP_DEPLOYED_SUCCESS));
89291
89911
  await updateAppConfig(deploymentId, logger3);
89292
89912
  const appConfig3 = await loadAppConfig(logger3);
89293
- version2 = publishedApp.definition?.codedAppMetadata?.packageVersion ?? appConfig3?.appVersion ?? "1.0.0";
89913
+ const version2 = publishedApp.definition?.codedAppMetadata?.packageVersion ?? appConfig3?.appVersion ?? "1.0.0";
89914
+ operationResult = {
89915
+ version: version2,
89916
+ deploymentId,
89917
+ systemName: publishedApp.systemName,
89918
+ deployVersion: publishedApp.deployVersion,
89919
+ operation: "deploy"
89920
+ };
89294
89921
  cliTelemetryClient.track(CodedAppTelemetryEvents.Deploy, {
89295
89922
  operation: "fresh_deploy"
89296
89923
  });
89297
89924
  }
89298
- logger3.log("");
89299
- logger3.log(` ${source_default.cyan("App Name:")} ${displayTitle}`);
89300
- logger3.log(` ${source_default.cyan("Version:")} ${version2}`);
89301
89925
  const appConfig2 = await loadAppConfig(logger3);
89302
- if (appConfig2?.appType === "Action" /* Action */) {
89303
- logger3.log(` ${source_default.yellow(MESSAGES.INFO.ACTION_APP_RUN_IN_ACTION_CENTER)}`);
89304
- } else {
89305
- const appUrl = buildAppUrl(envConfig.baseUrl, envConfig.orgName, routingName);
89306
- logger3.log(` ${source_default.cyan("App URL:")} ${source_default.green(appUrl)}`);
89307
- }
89926
+ const isActionApp = appConfig2?.appType === "Action" /* Action */;
89927
+ const appUrl = isActionApp ? null : buildAppUrl(envConfig.baseUrl, envConfig.orgName, routingName);
89928
+ logDeployDetails(logger3, displayTitle, operationResult.version, appUrl);
89929
+ return {
89930
+ appName: displayTitle,
89931
+ appUrl,
89932
+ ...operationResult
89933
+ };
89308
89934
  })());
89309
89935
  if (deployError) {
89310
89936
  if (spinner.isSpinning) {
@@ -89312,6 +89938,10 @@ async function executeDeploy(options) {
89312
89938
  }
89313
89939
  throw deployError;
89314
89940
  }
89941
+ if (!deployResult) {
89942
+ throw new Error("Deploy completed without result.");
89943
+ }
89944
+ return deployResult;
89315
89945
  }
89316
89946
  async function getAppName(logger3) {
89317
89947
  const appConfig = await loadAppConfig(logger3);
@@ -89368,7 +89998,7 @@ var registerDeployCommand = (program2) => {
89368
89998
  `)
89369
89999
  };
89370
90000
  const tags = options.tags?.split(",").map((t2) => t2.trim()).filter(Boolean);
89371
- const [error52] = await catchError(executeDeploy({
90001
+ const [error52, result] = await catchError(executeDeploy({
89372
90002
  packageName: options.name,
89373
90003
  pathName: options.pathName,
89374
90004
  version: options.version,
@@ -89395,6 +90025,18 @@ var registerDeployCommand = (program2) => {
89395
90025
  Code: "DeployCompleted",
89396
90026
  Data: { message: "App deployed successfully." }
89397
90027
  });
90028
+ if (result) {
90029
+ trackShipSucceeded({
90030
+ ship_kind: "deploy",
90031
+ target: "uipath_apps",
90032
+ project_type: "coded_app",
90033
+ command_name: "uip.codedapp.deploy",
90034
+ artifact_correlation_key: result.deploymentId ?? `${result.systemName}:${result.deployVersion}`,
90035
+ deployment_key: result.deploymentId,
90036
+ package_name: result.systemName,
90037
+ package_version: result.version
90038
+ });
90039
+ }
89398
90040
  });
89399
90041
  };
89400
90042
 
@@ -89624,7 +90266,7 @@ function querystringSingleKey(key, value, keyPrefix = "") {
89624
90266
  var package_default2 = {
89625
90267
  name: "@uipath/solution-sdk",
89626
90268
  license: "MIT",
89627
- version: "1.197.0-preview.65",
90269
+ version: "1.197.0-preview.67",
89628
90270
  repository: {
89629
90271
  type: "git",
89630
90272
  url: "https://github.com/UiPath/cli.git",
@@ -89685,7 +90327,7 @@ function normalizeProjectType(projectType) {
89685
90327
  function toPortableRelativePath(relativePath) {
89686
90328
  return relativePath.replace(/\\/g, "/");
89687
90329
  }
89688
- function isRecord(value) {
90330
+ function isRecord2(value) {
89689
90331
  return typeof value === "object" && value !== null && !Array.isArray(value);
89690
90332
  }
89691
90333
  async function tryRegisterProjectInParentSolution(fs8, projectDir, options) {
@@ -89878,11 +90520,11 @@ async function readProjectManifest(fs8, filePath, useProjectJson) {
89878
90520
  null
89879
90521
  ];
89880
90522
  }
89881
- if (!isRecord(parsed)) {
90523
+ if (!isRecord2(parsed)) {
89882
90524
  return [new Error(`Invalid project file: ${filePath}`), null];
89883
90525
  }
89884
90526
  const designOptions = parsed.designOptions;
89885
- const outputType = useProjectJson && isRecord(designOptions) ? readString(designOptions.outputType) : undefined;
90527
+ const outputType = useProjectJson && isRecord2(designOptions) ? readString(designOptions.outputType) : undefined;
89886
90528
  const projectType = outputType ?? readString(parsed.ProjectType);
89887
90529
  if (!projectType) {
89888
90530
  return [new Error(`ProjectType not found in ${filePath}`), null];
@@ -89909,7 +90551,7 @@ async function readSolutionManifest(fs8, solutionFile) {
89909
90551
  null
89910
90552
  ];
89911
90553
  }
89912
- if (!isRecord(parsed)) {
90554
+ if (!isRecord2(parsed)) {
89913
90555
  return [
89914
90556
  new Error(`Invalid solution file: ${solutionFile} must contain a JSON object.`),
89915
90557
  null
@@ -89923,7 +90565,7 @@ async function readSolutionManifest(fs8, solutionFile) {
89923
90565
  }
89924
90566
  const projects = [];
89925
90567
  for (const [index, project] of parsed.Projects.entries()) {
89926
- if (!isRecord(project)) {
90568
+ if (!isRecord2(project)) {
89927
90569
  return [
89928
90570
  new Error(`Invalid solution file: Projects[${index}] must be an object.`),
89929
90571
  null
@@ -94469,6 +95111,13 @@ async function publishSelectedPackage(selectedPackage, uipathDir, envConfig, isA
94469
95111
  logger3.log(source_default.yellow(`${MESSAGES.ERRORS.FAILED_TO_SAVE_APP_CONFIG} ${saveError instanceof Error ? saveError.message : MESSAGES.ERRORS.UNKNOWN_ERROR}`));
94470
95112
  }
94471
95113
  logPublishedDetails(metadata, registerResponse, logger3);
95114
+ return {
95115
+ packageName: metadata.packageName,
95116
+ packageVersion: metadata.packageVersion,
95117
+ systemName: registerResponse.definition.systemName,
95118
+ deployVersion: registerResponse.deployVersion,
95119
+ appType: isActionApp ? "Action" /* Action */ : "Web" /* Web */
95120
+ };
94472
95121
  }
94473
95122
  async function executePublish(options) {
94474
95123
  const fs8 = getFileSystem();
@@ -94495,10 +95144,10 @@ async function executePublish(options) {
94495
95144
  const { packageName, packageLookupNames } = resolvePackageLookup(options, logger3);
94496
95145
  const uipathDir = options.uipathDir ?? "./.uipath";
94497
95146
  const spinner = ora(MESSAGES.INFO.PUBLISHING_PACKAGE).start();
94498
- const [publishError] = await catchError((async () => {
95147
+ const [publishError, publishResult] = await catchError((async () => {
94499
95148
  const nupkgFiles = await listNupkgFiles(uipathDir, spinner, logger3);
94500
95149
  const selectedPackage = await selectPackage(nupkgFiles, packageLookupNames, packageName, options, spinner, logger3);
94501
- await publishSelectedPackage(selectedPackage, uipathDir, envConfig, isActionApp, spinner, logger3);
95150
+ return publishSelectedPackage(selectedPackage, uipathDir, envConfig, isActionApp, spinner, logger3);
94502
95151
  })());
94503
95152
  if (publishError) {
94504
95153
  if (spinner.isSpinning) {
@@ -94506,6 +95155,10 @@ async function executePublish(options) {
94506
95155
  }
94507
95156
  throw publishError;
94508
95157
  }
95158
+ if (!publishResult) {
95159
+ throw new Error("Publish completed without result.");
95160
+ }
95161
+ return publishResult;
94509
95162
  }
94510
95163
 
94511
95164
  // src/commands/publish.ts
@@ -94535,7 +95188,7 @@ var registerPublishCommand = (program2) => {
94535
95188
  log: (msg) => getOutputSink().writeErr(`${msg}
94536
95189
  `)
94537
95190
  };
94538
- const [error52] = await catchError(executePublish({
95191
+ const [error52, result] = await catchError(executePublish({
94539
95192
  name: options.name,
94540
95193
  version: options.version,
94541
95194
  type: options.type,
@@ -94561,6 +95214,17 @@ var registerPublishCommand = (program2) => {
94561
95214
  Code: "PublishCompleted",
94562
95215
  Data: { message: "Package published successfully." }
94563
95216
  });
95217
+ if (result) {
95218
+ trackShipSucceeded({
95219
+ ship_kind: "publish",
95220
+ target: "tenant_coded_app_feed",
95221
+ project_type: "coded_app",
95222
+ command_name: "uip.codedapp.publish",
95223
+ artifact_correlation_key: `${result.systemName}:${result.packageVersion}`,
95224
+ package_name: result.packageName,
95225
+ package_version: result.packageVersion
95226
+ });
95227
+ }
94564
95228
  });
94565
95229
  };
94566
95230
 
@@ -97491,4 +98155,4 @@ export {
97491
98155
  metadata
97492
98156
  };
97493
98157
 
97494
- //# debugId=FE1AD53862E74BF964756E2164756E21
98158
+ //# debugId=2408771C8541E10D64756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/codedapp-tool",
3
3
  "license": "MIT",
4
- "version": "1.197.0-preview.65",
4
+ "version": "1.197.0-preview.67",
5
5
  "description": "Build, pack, publish, deploy, and manage UiPath Coded Web Applications.",
6
6
  "keywords": [
7
7
  "cli-tool",
@@ -27,5 +27,5 @@
27
27
  "publishConfig": {
28
28
  "registry": "https://registry.npmjs.org/"
29
29
  },
30
- "gitHead": "9388ccbe5e739c9578bfd9b5395980fb63e11d9c"
30
+ "gitHead": "579e7d41cb100fcb8130eec8ed1c9b5b55feaf0b"
31
31
  }