@uipath/flow-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.
package/dist/tool.js CHANGED
@@ -182678,6 +182678,177 @@ function getOutputFormat2() {
182678
182678
  function getOutputFilter2() {
182679
182679
  return filterSlot2.get();
182680
182680
  }
182681
+ function isRecord4(value) {
182682
+ return value !== null && typeof value === "object";
182683
+ }
182684
+ function stringField2(value, field) {
182685
+ if (!isRecord4(value)) {
182686
+ return;
182687
+ }
182688
+ const raw = value[field];
182689
+ return typeof raw === "string" ? raw : undefined;
182690
+ }
182691
+ function numberField2(value, field) {
182692
+ if (!isRecord4(value)) {
182693
+ return;
182694
+ }
182695
+ const raw = value[field];
182696
+ return typeof raw === "number" ? raw : undefined;
182697
+ }
182698
+ function findStringInCauseChain2(error95, field) {
182699
+ let current = error95;
182700
+ for (let depth = 0;depth < 5 && current !== null && typeof current === "object"; depth++) {
182701
+ const value = stringField2(current, field);
182702
+ if (value) {
182703
+ return value;
182704
+ }
182705
+ current = current.cause;
182706
+ }
182707
+ return;
182708
+ }
182709
+ function findCodeInCauseChain2(error95) {
182710
+ return findStringInCauseChain2(error95, "code");
182711
+ }
182712
+ function isSpawnEnoent2(error95) {
182713
+ const code = findCodeInCauseChain2(error95);
182714
+ if (code !== "ENOENT") {
182715
+ return false;
182716
+ }
182717
+ const syscall = findStringInCauseChain2(error95, "syscall");
182718
+ return syscall?.startsWith("spawn") === true;
182719
+ }
182720
+ function isCancellationError2(error95, exitCode, pollSignal) {
182721
+ if (exitCode === 130) {
182722
+ return true;
182723
+ }
182724
+ if (!isRecord4(error95)) {
182725
+ return false;
182726
+ }
182727
+ if (numberField2(error95, "exitCode") === 130) {
182728
+ return true;
182729
+ }
182730
+ const name2 = stringField2(error95, "name");
182731
+ if (name2 === "ExitPromptError") {
182732
+ return true;
182733
+ }
182734
+ if (name2 === "AbortError" && pollSignal?.aborted) {
182735
+ return true;
182736
+ }
182737
+ const message = stringField2(error95, "message");
182738
+ return message?.includes("SIGINT") === true;
182739
+ }
182740
+ function terminalSignalFor2(input2, outcome) {
182741
+ if (input2.recordedFailure?.terminalSignal) {
182742
+ return input2.recordedFailure.terminalSignal;
182743
+ }
182744
+ const explicit = findStringInCauseChain2(input2.error, "terminalSignal") ?? findStringInCauseChain2(input2.error, "signal");
182745
+ if (explicit) {
182746
+ return explicit;
182747
+ }
182748
+ return outcome === "cancelled" ? "SIGINT" : undefined;
182749
+ }
182750
+ function classifyHttpStatus2(status) {
182751
+ if (status === 401 || status === 403) {
182752
+ return "auth";
182753
+ }
182754
+ if (status === 400 || status === 409 || status === 422) {
182755
+ return "validation";
182756
+ }
182757
+ if (status === 408) {
182758
+ return "timeout";
182759
+ }
182760
+ return "network_http";
182761
+ }
182762
+ function classifyFromResult2(result) {
182763
+ switch (result) {
182764
+ case "AuthenticationError":
182765
+ return "auth";
182766
+ case "ValidationError":
182767
+ return "validation";
182768
+ case "TimeoutError":
182769
+ return "timeout";
182770
+ default:
182771
+ return;
182772
+ }
182773
+ }
182774
+ function classifyFromErrorCode2(errorCode2) {
182775
+ if (!errorCode2) {
182776
+ return;
182777
+ }
182778
+ if (AUTH_ERROR_CODES2.has(errorCode2)) {
182779
+ return "auth";
182780
+ }
182781
+ if (VALIDATION_ERROR_CODES2.has(errorCode2)) {
182782
+ return "validation";
182783
+ }
182784
+ if (TIMEOUT_ERROR_CODES2.has(errorCode2)) {
182785
+ return "timeout";
182786
+ }
182787
+ if (NETWORK_HTTP_ERROR_CODES2.has(errorCode2)) {
182788
+ return "network_http";
182789
+ }
182790
+ return;
182791
+ }
182792
+ function classifyFromError2(error95) {
182793
+ const code = findCodeInCauseChain2(error95);
182794
+ if (code) {
182795
+ if (code.startsWith("commander.")) {
182796
+ return "validation";
182797
+ }
182798
+ if (NETWORK_OS_ERROR_CODES2.has(code) || TLS_ERROR_CODES22.has(code)) {
182799
+ return "network_http";
182800
+ }
182801
+ if (TIMEOUT_OS_ERROR_CODES2.has(code)) {
182802
+ return "timeout";
182803
+ }
182804
+ if (MISSING_DEPENDENCY_CODES2.has(code) || isSpawnEnoent2(error95)) {
182805
+ return "missing_dependency";
182806
+ }
182807
+ }
182808
+ const message = stringField2(error95, "message");
182809
+ if (message?.includes("fetch failed") === true) {
182810
+ return "network_http";
182811
+ }
182812
+ const name2 = stringField2(error95, "name");
182813
+ if (name2 && INTERNAL_ERROR_NAMES2.has(name2)) {
182814
+ return "internal";
182815
+ }
182816
+ return;
182817
+ }
182818
+ function classifyError22(input2) {
182819
+ const recorded = input2.recordedFailure;
182820
+ if (recorded?.errorClass) {
182821
+ return recorded.errorClass;
182822
+ }
182823
+ const status = recorded?.context?.httpStatus;
182824
+ if (status !== undefined) {
182825
+ return classifyHttpStatus2(status);
182826
+ }
182827
+ return classifyFromResult2(recorded?.result) ?? classifyFromErrorCode2(recorded?.errorCode) ?? classifyFromError2(input2.error) ?? "unknown";
182828
+ }
182829
+ function recordCommandFailureTelemetry2(failure) {
182830
+ recordedFailureSlot2.set(failure);
182831
+ }
182832
+ function clearRecordedCommandFailureTelemetry2() {
182833
+ recordedFailureSlot2.clear();
182834
+ }
182835
+ function takeRecordedCommandFailureTelemetry2() {
182836
+ const failure = recordedFailureSlot2.get();
182837
+ recordedFailureSlot2.clear();
182838
+ return failure;
182839
+ }
182840
+ function buildCommandTerminalTelemetryProperties2(input2) {
182841
+ const cancelled = isCancellationError2(input2.error, input2.exitCode, input2.pollSignal);
182842
+ const outcome = input2.recordedFailure?.terminalOutcome ?? (input2.exitCode === 0 ? "success" : cancelled ? "cancelled" : "failure");
182843
+ const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError22(input2);
182844
+ const terminalSignal = terminalSignalFor2(input2, outcome);
182845
+ return {
182846
+ exit_code: input2.exitCode,
182847
+ terminal_outcome: outcome,
182848
+ ...errorClass ? { error_class: errorClass } : {},
182849
+ ...terminalSignal ? { terminal_signal: terminalSignal } : {}
182850
+ };
182851
+ }
182681
182852
  function readRegistryValue2(keyPath, valueName) {
182682
182853
  if (process.platform !== "win32") {
182683
182854
  return "";
@@ -182754,6 +182925,69 @@ class DebugTelemetryProvider2 {
182754
182925
  logger3.debug(`[Telemetry] Dependency: ${name2} [${type}] (${duration8}ms, ${success5 ? "ok" : "fail"})`);
182755
182926
  }
182756
182927
  }
182928
+ function detectAgentFromEnv2(env) {
182929
+ for (const agent of KNOWN_AGENTS2) {
182930
+ const envValue = env[agent.envVar];
182931
+ if (agent.value !== undefined) {
182932
+ if (envValue === agent.value)
182933
+ return agent.id;
182934
+ } else {
182935
+ if (envValue)
182936
+ return agent.id;
182937
+ }
182938
+ }
182939
+ const agentEnv = env.AGENT;
182940
+ if (agentEnv) {
182941
+ if (agentEnv === "1" || agentEnv === "true")
182942
+ return "unknown";
182943
+ if (agentEnv.length <= 32)
182944
+ return agentEnv.toLowerCase();
182945
+ }
182946
+ return;
182947
+ }
182948
+ function currentEnv2() {
182949
+ return typeof process === "undefined" ? {} : process.env;
182950
+ }
182951
+ function currentTtyState2() {
182952
+ if (typeof process === "undefined")
182953
+ return false;
182954
+ return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
182955
+ }
182956
+ function detectCi2(env) {
182957
+ const signature = CI_SIGNATURES2.find((candidate) => candidate.matches(env));
182958
+ if (!signature)
182959
+ return;
182960
+ return {
182961
+ executionContext: signature.isScheduler?.(env) ? "scheduler" : "ci",
182962
+ ciProvider: signature.provider
182963
+ };
182964
+ }
182965
+ function detectExecutionContext2(options = {}) {
182966
+ const env = options.env ?? currentEnv2();
182967
+ const ci2 = detectCi2(env);
182968
+ if (ci2)
182969
+ return ci2;
182970
+ const agent = options.agent ?? detectAgentFromEnv2(env);
182971
+ if (agent) {
182972
+ return { executionContext: "agent" };
182973
+ }
182974
+ const authSignal = options.authSignal ?? authSignalSlot2.get();
182975
+ if (authSignal === "service_account") {
182976
+ return { executionContext: "service_account" };
182977
+ }
182978
+ const isTty = options.isTty ?? currentTtyState2();
182979
+ if (isTty) {
182980
+ return { executionContext: "manual" };
182981
+ }
182982
+ return { executionContext: "unknown" };
182983
+ }
182984
+ function getExecutionContextTelemetryProperties2() {
182985
+ const detected = detectExecutionContext2();
182986
+ return {
182987
+ execution_context: detected.executionContext,
182988
+ ...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
182989
+ };
182990
+ }
182757
182991
 
182758
182992
  class NodeContextStorage2 {
182759
182993
  storage = new AsyncLocalStorage2;
@@ -182764,6 +182998,22 @@ class NodeContextStorage2 {
182764
182998
  return this.storage.getStore();
182765
182999
  }
182766
183000
  }
183001
+ function getProcessEnv2() {
183002
+ return globalThis.process?.env;
183003
+ }
183004
+ function normalizeSessionId2(value) {
183005
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
183006
+ return;
183007
+ }
183008
+ const trimmed = String(value).trim();
183009
+ return trimmed || undefined;
183010
+ }
183011
+ function getConfiguredTelemetrySessionId2() {
183012
+ return normalizeSessionId2(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV2]);
183013
+ }
183014
+ function resolveTelemetrySessionId2(existingSessionId) {
183015
+ return getConfiguredTelemetrySessionId2() ?? normalizeSessionId2(existingSessionId);
183016
+ }
182767
183017
  function getGlobalTelemetryProperties2() {
182768
183018
  return telemetryPropsSlot2.get();
182769
183019
  }
@@ -182845,12 +183095,22 @@ class TelemetryService2 {
182845
183095
  return this.contextStorage.getContext();
182846
183096
  }
182847
183097
  enrichPropertiesWithContext(properties, context) {
182848
- return {
182849
- ...getGlobalTelemetryProperties2(),
183098
+ const globalProperties = getGlobalTelemetryProperties2();
183099
+ const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY2] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY2] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY2];
183100
+ const sessionId = resolveTelemetrySessionId2(existingSessionId);
183101
+ const enriched = {
183102
+ ...getExecutionContextTelemetryProperties2(),
183103
+ ...globalProperties,
182850
183104
  ...this.defaultProperties,
182851
183105
  ...properties,
182852
183106
  ...context
182853
183107
  };
183108
+ if (sessionId === undefined) {
183109
+ delete enriched[TELEMETRY_SESSION_ID_PROPERTY2];
183110
+ } else {
183111
+ enriched[TELEMETRY_SESSION_ID_PROPERTY2] = sessionId;
183112
+ }
183113
+ return enriched;
182854
183114
  }
182855
183115
  generateId() {
182856
183116
  return crypto.randomUUID().replaceAll("-", "");
@@ -183232,6 +183492,81 @@ function defaultRetryForErrorCode2(errorCode2) {
183232
183492
  return "RetryWillNotFix";
183233
183493
  }
183234
183494
  }
183495
+ function productMode2(productArea, mode) {
183496
+ return { product_area: productArea, mode };
183497
+ }
183498
+ function attributionRecord2(groups) {
183499
+ const record5 = {};
183500
+ for (const [productArea, mode, names] of groups) {
183501
+ const attribution = productMode2(productArea, mode);
183502
+ for (const name2 of names) {
183503
+ record5[name2] = attribution;
183504
+ }
183505
+ }
183506
+ return record5;
183507
+ }
183508
+ function commandAttribution2(groups) {
183509
+ const entries = [];
183510
+ for (const [productArea, mode, prefixes] of groups) {
183511
+ const attribution = productMode2(productArea, mode);
183512
+ for (const prefix2 of prefixes) {
183513
+ entries.push({ prefix: prefix2, attribution });
183514
+ }
183515
+ }
183516
+ return entries;
183517
+ }
183518
+ function normalizeCommandPath2(value) {
183519
+ if (typeof value !== "string") {
183520
+ return;
183521
+ }
183522
+ const trimmed = value.trim().toLowerCase();
183523
+ if (!trimmed) {
183524
+ return;
183525
+ }
183526
+ const tokens = trimmed.includes(" ") ? trimmed.split(/\s+/).filter((token) => token.length > 0).filter((token) => !token.startsWith("-")) : trimmed.split(".").filter((token) => token.length > 0);
183527
+ if (tokens.length === 0) {
183528
+ return;
183529
+ }
183530
+ const commandTokens = tokens[0] === "uip" ? tokens : ["uip", ...tokens];
183531
+ return commandTokens.join(".");
183532
+ }
183533
+ function getCommandProductModeAttribution2(commandPath) {
183534
+ const normalized = normalizeCommandPath2(commandPath);
183535
+ if (!normalized) {
183536
+ return;
183537
+ }
183538
+ return COMMAND_ATTRIBUTION2.find(({ prefix: prefix2 }) => normalized === prefix2 || normalized.startsWith(`${prefix2}.`))?.attribution;
183539
+ }
183540
+ function normalizeSkillNameWithOptions2(value, options) {
183541
+ if (typeof value !== "string") {
183542
+ return;
183543
+ }
183544
+ const normalized = value.trim().toLowerCase();
183545
+ if (!normalized) {
183546
+ return;
183547
+ }
183548
+ const hasLegacyNamespace = normalized.startsWith(LEGACY_SKILL_NAMESPACE2);
183549
+ if (hasLegacyNamespace && !options.allowLegacyNamespace) {
183550
+ return;
183551
+ }
183552
+ const skillName = hasLegacyNamespace ? normalized.slice(LEGACY_SKILL_NAMESPACE2.length) : normalized;
183553
+ if (skillName.length > MAX_SKILL_NAME_LENGTH2 || !SKILL_NAME_PATTERN2.test(skillName) || !KNOWN_SKILL_NAMES2.has(skillName)) {
183554
+ return;
183555
+ }
183556
+ return skillName;
183557
+ }
183558
+ function normalizeSkillName2(value) {
183559
+ return normalizeSkillNameWithOptions2(value, {
183560
+ allowLegacyNamespace: false
183561
+ });
183562
+ }
183563
+ function buildCommandTelemetryAttribution2(commandPath, skillSource) {
183564
+ const skillName = normalizeSkillName2(skillSource);
183565
+ return {
183566
+ ...skillName ? { skill_name: skillName } : {},
183567
+ ...getCommandProductModeAttribution2(commandPath)
183568
+ };
183569
+ }
183235
183570
  function shortHash2(input2) {
183236
183571
  let hash3 = 2166136261;
183237
183572
  for (let i3 = 0;i3 < input2.length; i3++) {
@@ -183358,6 +183693,12 @@ function commandHelpHint2(commandPath) {
183358
183693
  const command = commandPath.replace(/\./g, " ");
183359
183694
  return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
183360
183695
  }
183696
+ function isPromptCancellation2(error95) {
183697
+ return error95 instanceof Error && error95.name === "ExitPromptError";
183698
+ }
183699
+ function exitCodeFromProcess2(fallback) {
183700
+ return typeof process.exitCode === "number" ? process.exitCode : fallback;
183701
+ }
183361
183702
  function isPreviewBuild2() {
183362
183703
  return previewSlot2.get(false) ?? false;
183363
183704
  }
@@ -185020,7 +185361,7 @@ var de_default10, en4, es_default10, es_MX_default6, fr_default10, ja_default10,
185020
185361
  ...options,
185021
185362
  target
185022
185363
  });
185023
- }, apps3, open_default3, LOCK_HEARTBEAT_MS3 = 5000, LOCK_STALE_MS3 = 15000, LOCK_MAX_WAIT_MS3 = 20000, LOCK_MAX_HOLD_MS3 = 60000, LOCK_RETRY_MIN_MS3 = 100, LOCK_RETRY_JITTER_MS3 = 200, fsInstance3, getFileSystem3 = () => fsInstance3, NETWORK_ERROR_CODES3, TLS_ERROR_CODES2, TLS_INSTRUCTIONS2, NETWORK_INSTRUCTIONS2, import__3, program2, createCommand2, createArgument2, createOption2, CommanderError2, InvalidArgumentError2, InvalidOptionArgumentError2, Command3, Argument2, Option2, Help2, examplesByCommand2, PREFIX2 = "@uipath/common/", _g2, storageSingleton2, sinkSlot2, outputStorage2, CONSOLE_FALLBACK2, COMPLETER_SYMBOL2, isObject8 = (obj) => {
185364
+ }, apps3, open_default3, LOCK_HEARTBEAT_MS3 = 5000, LOCK_STALE_MS3 = 15000, LOCK_MAX_WAIT_MS3 = 20000, LOCK_MAX_HOLD_MS3 = 60000, LOCK_RETRY_MIN_MS3 = 100, LOCK_RETRY_JITTER_MS3 = 200, fsInstance3, getFileSystem3 = () => fsInstance3, NETWORK_ERROR_CODES3, TLS_ERROR_CODES3, TLS_INSTRUCTIONS2, NETWORK_INSTRUCTIONS2, import__3, program2, createCommand2, createArgument2, createOption2, CommanderError2, InvalidArgumentError2, InvalidOptionArgumentError2, Command3, Argument2, Option2, Help2, examplesByCommand2, PREFIX2 = "@uipath/common/", _g2, storageSingleton2, sinkSlot2, outputStorage2, CONSOLE_FALLBACK2, COMPLETER_SYMBOL2, isObject8 = (obj) => {
185024
185365
  return obj !== null && Object.prototype.toString.call(obj) === "[object Object]";
185025
185366
  }, strictDeepEqual2 = (first, second) => {
185026
185367
  if (first === second) {
@@ -186871,7 +187212,7 @@ var de_default10, en4, es_default10, es_MX_default6, fr_default10, ja_default10,
186871
187212
  }, __toESM22 = (mod22, isNodeMode, target) => (target = mod22 != null ? __create22(__getProtoOf22(mod22)) : {}, __copyProps2(isNodeMode || !mod22 || !mod22.__esModule ? __defProp22(target, "default", {
186872
187213
  value: mod22,
186873
187214
  enumerable: true
186874
- }) : target, mod22)), require_common2, require_exception2, require_snippet2, require_type2, require_schema2, require_str2, require_seq2, require_map3, require_failsafe2, require_null2, require_bool2, require_int2, require_float2, require_json2, require_core4, require_timestamp2, require_merge3, require_binary2, require_omap2, require_pairs3, require_set2, require_default2, require_loader2, require_dumper2, import_js_yaml2, Type2, Schema2, FAILSAFE_SCHEMA2, JSON_SCHEMA2, CORE_SCHEMA2, DEFAULT_SCHEMA2, load2, loadAll2, dump2, YAMLException2, types4, safeLoad2, safeLoadAll2, safeDump2, index_vite_proxy_tmp_default2, logFilePathSlot2, LogLevel3, DEFAULT_LOG_LEVEL2 = 3, SimpleLogger2, loggerSingleton2, logger3, formatSlot2, formatExplicitSlot2, filterSlot2, CommonTelemetryEvents2, telemetryPropsSlot2, providerSlot2, telemetryInstanceSlot2, DEFAULT_AI_CONNECTION_STRING2, _localTelemetryInstance2, telemetry2, CLI_ERROR_CODES2, RETRY_HINTS2, RESULTS2, EXIT_CODES2, FilterEvaluationError2, OutputFormatter2, REDACTED2 = "[REDACTED]", MAX_VALUE_LENGTH2 = 200, SENSITIVE_NAME_TOKENS2, SENSITIVE_KEY_PREFIXES2, UUID_PATTERN3, EMAIL_PATTERN2, JWT_PATTERN2, LONG_TOKEN_PATTERN2, USER_HOME_PATTERN2, URL_PATTERN2, URL_TRAILING_PUNCT2, pollSignalSlot2, cliErrorCodeValues2, retryHintValues2, guardInstalledSlot2, savedOriginalsSlot2, DEFAULT_AUTH_TIMEOUT_MS3, modeSlot2, PollOutcome2, REASON_BY_OUTCOME2, TERMINAL_STATUSES2, FAILURE_STATUSES2, previewSlot2, ScreenLogger2, USER_AGENT_HEADER2 = "User-Agent", sdkUserAgentHostToken2, factorySlot2, globalLogHandler = (logMessage) => {
187215
+ }) : target, mod22)), require_common2, require_exception2, require_snippet2, require_type2, require_schema2, require_str2, require_seq2, require_map3, require_failsafe2, require_null2, require_bool2, require_int2, require_float2, require_json2, require_core4, require_timestamp2, require_merge3, require_binary2, require_omap2, require_pairs3, require_set2, require_default2, require_loader2, require_dumper2, import_js_yaml2, Type2, Schema2, FAILSAFE_SCHEMA2, JSON_SCHEMA2, CORE_SCHEMA2, DEFAULT_SCHEMA2, load2, loadAll2, dump2, YAMLException2, types4, safeLoad2, safeLoadAll2, safeDump2, index_vite_proxy_tmp_default2, logFilePathSlot2, LogLevel3, DEFAULT_LOG_LEVEL2 = 3, SimpleLogger2, loggerSingleton2, logger3, formatSlot2, formatExplicitSlot2, filterSlot2, recordedFailureSlot2, AUTH_ERROR_CODES2, VALIDATION_ERROR_CODES2, NETWORK_HTTP_ERROR_CODES2, TIMEOUT_ERROR_CODES2, NETWORK_OS_ERROR_CODES2, TIMEOUT_OS_ERROR_CODES2, TLS_ERROR_CODES22, MISSING_DEPENDENCY_CODES2, INTERNAL_ERROR_NAMES2, CommonTelemetryEvents2, KNOWN_AGENTS2, LOCAL_HOSTS2, authSignalSlot2, isTruthy2 = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false", isEqual2 = (value, expected) => value?.toLowerCase() === expected, CI_SIGNATURES2, TELEMETRY_SESSION_ID_ENV2 = "UIPATH_SESSION_ID", TELEMETRY_SESSION_ID_PROPERTY2 = "session_id", telemetrySessionIdSlot2, telemetryPropsSlot2, providerSlot2, telemetryInstanceSlot2, DEFAULT_AI_CONNECTION_STRING2, _localTelemetryInstance2, telemetry2, CLI_ERROR_CODES2, RETRY_HINTS2, RESULTS2, EXIT_CODES2, FilterEvaluationError2, OutputFormatter2, LEGACY_SKILL_NAMESPACE2 = "uipath:", MAX_SKILL_NAME_LENGTH2 = 80, SKILL_NAME_PATTERN2, SKILL_ATTRIBUTION2, KNOWN_SKILL_NAMES2, COMMAND_ATTRIBUTION2, REDACTED2 = "[REDACTED]", MAX_VALUE_LENGTH2 = 200, SENSITIVE_NAME_TOKENS2, SENSITIVE_KEY_PREFIXES2, UUID_PATTERN3, EMAIL_PATTERN2, JWT_PATTERN2, LONG_TOKEN_PATTERN2, USER_HOME_PATTERN2, URL_PATTERN2, URL_TRAILING_PUNCT2, pollSignalSlot2, cliErrorCodeValues2, retryHintValues2, guardInstalledSlot2, savedOriginalsSlot2, DEFAULT_AUTH_TIMEOUT_MS3, modeSlot2, PollOutcome2, REASON_BY_OUTCOME2, TERMINAL_STATUSES2, FAILURE_STATUSES2, previewSlot2, ScreenLogger2, USER_AGENT_HEADER2 = "User-Agent", sdkUserAgentHostToken2, shippedKeysSlot2, factorySlot2, globalLogHandler = (logMessage) => {
186875
187216
  const formattedMessage = logMessage.toFormattedString();
186876
187217
  switch (logMessage.logLevel) {
186877
187218
  case LogLevel.Debug:
@@ -190346,7 +190687,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
190346
190687
  "ENETUNREACH",
190347
190688
  "EAI_FAIL"
190348
190689
  ]);
190349
- TLS_ERROR_CODES2 = new Set([
190690
+ TLS_ERROR_CODES3 = new Set([
190350
190691
  "SELF_SIGNED_CERT_IN_CHAIN",
190351
190692
  "DEPTH_ZERO_SELF_SIGNED_CERT",
190352
190693
  "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
@@ -193392,9 +193733,118 @@ Expecting one of '${allowedValues.join("', '")}'`);
193392
193733
  formatSlot2 = singleton3("OutputFormat");
193393
193734
  formatExplicitSlot2 = singleton3("OutputFormatExplicit");
193394
193735
  filterSlot2 = singleton3("OutputFilter");
193736
+ recordedFailureSlot2 = singleton3("CommandTelemetryFailure");
193737
+ AUTH_ERROR_CODES2 = new Set([
193738
+ "authentication_required",
193739
+ "permission_denied"
193740
+ ]);
193741
+ VALIDATION_ERROR_CODES2 = new Set(["invalid_argument"]);
193742
+ NETWORK_HTTP_ERROR_CODES2 = new Set([
193743
+ "network_error",
193744
+ "rate_limited",
193745
+ "server_error",
193746
+ "not_found",
193747
+ "method_not_allowed"
193748
+ ]);
193749
+ TIMEOUT_ERROR_CODES2 = new Set(["timeout"]);
193750
+ NETWORK_OS_ERROR_CODES2 = new Set([
193751
+ "ECONNREFUSED",
193752
+ "ECONNRESET",
193753
+ "ENOTFOUND",
193754
+ "EAI_AGAIN",
193755
+ "EPIPE",
193756
+ "EHOSTUNREACH",
193757
+ "ENETUNREACH",
193758
+ "EAI_FAIL"
193759
+ ]);
193760
+ TIMEOUT_OS_ERROR_CODES2 = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
193761
+ TLS_ERROR_CODES22 = new Set([
193762
+ "SELF_SIGNED_CERT_IN_CHAIN",
193763
+ "DEPTH_ZERO_SELF_SIGNED_CERT",
193764
+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
193765
+ "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
193766
+ "UNABLE_TO_GET_ISSUER_CERT",
193767
+ "CERT_HAS_EXPIRED",
193768
+ "CERT_UNTRUSTED",
193769
+ "ERR_TLS_CERT_ALTNAME_INVALID"
193770
+ ]);
193771
+ MISSING_DEPENDENCY_CODES2 = new Set([
193772
+ "MODULE_NOT_FOUND",
193773
+ "ERR_MODULE_NOT_FOUND"
193774
+ ]);
193775
+ INTERNAL_ERROR_NAMES2 = new Set([
193776
+ "TypeError",
193777
+ "ReferenceError",
193778
+ "SyntaxError",
193779
+ "RangeError"
193780
+ ]);
193395
193781
  CommonTelemetryEvents2 = {
193396
- Error: "uip.error"
193397
- };
193782
+ Error: "uip.error",
193783
+ ShipSucceeded: "ship_succeeded"
193784
+ };
193785
+ KNOWN_AGENTS2 = [
193786
+ { envVar: "CLAUDECODE", value: "1", id: "claude-code" },
193787
+ { envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
193788
+ { envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
193789
+ { envVar: "CODEX_THREAD_ID", id: "codex" },
193790
+ { envVar: "CODEX_SANDBOX", id: "codex" },
193791
+ { envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
193792
+ { envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
193793
+ ];
193794
+ LOCAL_HOSTS2 = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
193795
+ authSignalSlot2 = singleton3("TelemetryExecutionContextAuthSignal");
193796
+ CI_SIGNATURES2 = [
193797
+ {
193798
+ provider: "github_actions",
193799
+ matches: (env) => isTruthy2(env.GITHUB_ACTIONS),
193800
+ isScheduler: (env) => env.GITHUB_EVENT_NAME === "schedule"
193801
+ },
193802
+ {
193803
+ provider: "azure_devops",
193804
+ matches: (env) => isTruthy2(env.TF_BUILD),
193805
+ isScheduler: (env) => isEqual2(env.BUILD_REASON, "schedule")
193806
+ },
193807
+ {
193808
+ provider: "gitlab",
193809
+ matches: (env) => isTruthy2(env.GITLAB_CI),
193810
+ isScheduler: (env) => env.CI_PIPELINE_SOURCE === "schedule"
193811
+ },
193812
+ {
193813
+ provider: "circleci",
193814
+ matches: (env) => isTruthy2(env.CIRCLECI),
193815
+ isScheduler: (env) => env.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
193816
+ },
193817
+ {
193818
+ provider: "jenkins",
193819
+ matches: (env) => isTruthy2(env.JENKINS_URL) || isTruthy2(env.JENKINS_HOME)
193820
+ },
193821
+ {
193822
+ provider: "teamcity",
193823
+ matches: (env) => isTruthy2(env.TEAMCITY_VERSION)
193824
+ },
193825
+ {
193826
+ provider: "buildkite",
193827
+ matches: (env) => isTruthy2(env.BUILDKITE),
193828
+ isScheduler: (env) => env.BUILDKITE_SOURCE === "schedule"
193829
+ },
193830
+ {
193831
+ provider: "bitbucket",
193832
+ matches: (env) => isTruthy2(env.BITBUCKET_BUILD_NUMBER)
193833
+ },
193834
+ {
193835
+ provider: "travis",
193836
+ matches: (env) => isTruthy2(env.TRAVIS)
193837
+ },
193838
+ {
193839
+ provider: "appveyor",
193840
+ matches: (env) => isTruthy2(env.APPVEYOR)
193841
+ },
193842
+ {
193843
+ provider: "generic",
193844
+ matches: (env) => isTruthy2(env.CI)
193845
+ }
193846
+ ];
193847
+ telemetrySessionIdSlot2 = singleton3("TelemetrySessionId");
193398
193848
  telemetryPropsSlot2 = singleton3("TelemetryDefaultProps");
193399
193849
  providerSlot2 = singleton3("TelemetryProvider");
193400
193850
  telemetryInstanceSlot2 = singleton3("TelemetryService");
@@ -193478,8 +193928,24 @@ Expecting one of '${allowedValues.join("', '")}'`);
193478
193928
  data.ErrorCode ??= defaultErrorCodeForFailure2(data);
193479
193929
  data.Retry ??= defaultRetryForErrorCode2(data.ErrorCode);
193480
193930
  process.exitCode = EXIT_CODES2[data.Result] ?? 1;
193481
- const { SuppressTelemetry, ...envelope } = data;
193482
- if (!SuppressTelemetry) {
193931
+ recordCommandFailureTelemetry2({
193932
+ result: data.Result,
193933
+ errorCode: data.ErrorCode,
193934
+ retry: data.Retry,
193935
+ message: data.Message,
193936
+ context: data.Context,
193937
+ exitCode: process.exitCode,
193938
+ errorClass: data.TelemetryErrorClass,
193939
+ terminalOutcome: data.TelemetryTerminalOutcome,
193940
+ terminalSignal: data.TelemetryTerminalSignal
193941
+ });
193942
+ const suppressTelemetry = data.SuppressTelemetry === true;
193943
+ const envelope = { ...data };
193944
+ delete envelope.SuppressTelemetry;
193945
+ delete envelope.TelemetryErrorClass;
193946
+ delete envelope.TelemetryTerminalOutcome;
193947
+ delete envelope.TelemetryTerminalSignal;
193948
+ if (!suppressTelemetry) {
193483
193949
  telemetry2.trackEvent(CommonTelemetryEvents2.Error, {
193484
193950
  result: data.Result,
193485
193951
  errorCode: data.ErrorCode,
@@ -193541,6 +194007,79 @@ Expecting one of '${allowedValues.join("', '")}'`);
193541
194007
  }
193542
194008
  OutputFormatter22.formatToString = formatToString;
193543
194009
  })(OutputFormatter2 ||= {});
194010
+ SKILL_NAME_PATTERN2 = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
194011
+ SKILL_ATTRIBUTION2 = attributionRecord2([
194012
+ ["admin", "operate", ["uipath-admin"]],
194013
+ ["agents", "build", ["uipath-agents"]],
194014
+ ["api-workflow", "build", ["uipath-api-workflow"]],
194015
+ ["automation-discovery", "build", ["uipath-automation-discovery"]],
194016
+ ["coded-apps", "build", ["uipath-coded-apps"]],
194017
+ ["data-fabric", "operate", ["uipath-data-fabric"]],
194018
+ ["cli", "troubleshoot", ["uipath-feedback"]],
194019
+ ["governance", "operate", ["uipath-governance"]],
194020
+ ["action-center", "build", ["uipath-human-in-the-loop"]],
194021
+ ["document-understanding", "build", ["uipath-ixp"]],
194022
+ [
194023
+ "maestro",
194024
+ "build",
194025
+ ["uipath-maestro-bpmn", "uipath-maestro-case", "uipath-maestro-flow"]
194026
+ ],
194027
+ ["agenthub", "build", ["uipath-mcp-servers"]],
194028
+ ["solution", "build", ["uipath-planner", "uipath-solution"]],
194029
+ ["platform", "operate", ["uipath-platform"]],
194030
+ ["quality", "troubleshoot", ["uipath-review"]],
194031
+ ["rpa", "build", ["uipath-rpa"]],
194032
+ ["cli", "operate", ["uipath-skill-catalog"]],
194033
+ ["action-center", "operate", ["uipath-tasks"]],
194034
+ ["test-manager", "operate", ["uipath-test"]],
194035
+ ["platform", "troubleshoot", ["uipath-troubleshoot"]]
194036
+ ]);
194037
+ KNOWN_SKILL_NAMES2 = new Set(Object.keys(SKILL_ATTRIBUTION2));
194038
+ COMMAND_ATTRIBUTION2 = commandAttribution2([
194039
+ ["cli", "troubleshoot", ["uip.feedback"]],
194040
+ ["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
194041
+ ["context-grounding", "build", ["uip.context-grounding"]],
194042
+ ["api-workflow", "build", ["uip.api-workflow"]],
194043
+ ["rpa", "build", ["uip.rpa-legacy"]],
194044
+ ["conversational", "operate", ["uip.conversational"]],
194045
+ ["agents", "build", ["uip.codedagent", "uip.agent"]],
194046
+ ["agenthub", "build", ["uip.agenthub"]],
194047
+ ["coded-apps", "build", ["uip.codedapp"]],
194048
+ ["functions", "build", ["uip.functions"]],
194049
+ ["solution", "build", ["uip.solution"]],
194050
+ ["maestro", "build", ["uip.maestro", "uip.case", "uip.flow"]],
194051
+ ["llm-observability", "troubleshoot", ["uip.traces"]],
194052
+ ["platform", "operate", ["uip.platform"]],
194053
+ ["admin", "operate", ["uip.admin"]],
194054
+ ["automation-ops", "operate", ["uip.aops"]],
194055
+ ["documentation", "troubleshoot", ["uip.docsai"]],
194056
+ ["governance", "operate", ["uip.gov"]],
194057
+ ["insights", "operate", ["uip.insights"]],
194058
+ ["document-understanding", "build", ["uip.ixp"]],
194059
+ ["process-mining", "operate", ["uip.pm"]],
194060
+ ["action-center", "operate", ["uip.tasks"]],
194061
+ ["test-manager", "operate", ["uip.tm"]],
194062
+ ["vertical-solutions", "build", ["uip.vss"]],
194063
+ ["data-fabric", "operate", ["uip.df"]],
194064
+ ["integration-service", "build", ["uip.is"]],
194065
+ ["orchestrator", "operate", ["uip.or"]],
194066
+ [
194067
+ "cli",
194068
+ "operate",
194069
+ [
194070
+ "uip.login",
194071
+ "uip.logout",
194072
+ "uip.user",
194073
+ "uip.config",
194074
+ "uip.tools",
194075
+ "uip.skills",
194076
+ "uip.completion",
194077
+ "uip.update",
194078
+ "uip.mcp",
194079
+ "uip.track"
194080
+ ]
194081
+ ]
194082
+ ]).sort((a2, b3) => b3.prefix.length - a2.prefix.length);
193544
194083
  SENSITIVE_NAME_TOKENS2 = new Set([
193545
194084
  "token",
193546
194085
  "tokens",
@@ -193594,6 +194133,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
193594
194133
  const props = typeof properties === "function" ? properties(...args) : properties;
193595
194134
  const startTime = performance.now();
193596
194135
  let errorMessage2;
194136
+ let fallbackExitCode = EXIT_CODES2.Success;
194137
+ clearRecordedCommandFailureTelemetry2();
193597
194138
  const [error95] = await catchError3(fn2(...args));
193598
194139
  if (error95) {
193599
194140
  errorMessage2 = error95 instanceof Error ? error95.message : String(error95);
@@ -193608,6 +194149,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
193608
194149
  const customRetry = isRetryHint2(typedRetry) ? typedRetry : undefined;
193609
194150
  const typedContext = typed.context ?? typed.Context;
193610
194151
  const customContext = isErrorContext2(typedContext) ? typedContext : undefined;
194152
+ const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation2(error95) ? 130 : undefined;
194153
+ fallbackExitCode = cancellationExitCode ?? EXIT_CODES2[finalResult];
193611
194154
  OutputFormatter2.error({
193612
194155
  Result: finalResult,
193613
194156
  ...customErrorCode ? { ErrorCode: customErrorCode } : {},
@@ -193616,16 +194159,26 @@ Expecting one of '${allowedValues.join("', '")}'`);
193616
194159
  ...customRetry ? { Retry: customRetry } : {},
193617
194160
  ...customContext ? { Context: customContext } : {}
193618
194161
  });
193619
- context.exit(EXIT_CODES2[finalResult]);
194162
+ context.exit(fallbackExitCode);
193620
194163
  }
193621
194164
  const durationMs = performance.now() - startTime;
193622
- const success5 = !error95 && (process.exitCode === undefined || process.exitCode === 0);
194165
+ const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess2(fallbackExitCode);
194166
+ const recordedFailure = takeRecordedCommandFailureTelemetry2();
194167
+ const success5 = !error95 && exitCode === 0;
194168
+ const terminalTelemetry = buildCommandTerminalTelemetryProperties2({
194169
+ error: error95,
194170
+ exitCode,
194171
+ recordedFailure,
194172
+ pollSignal: context.pollSignal
194173
+ });
193623
194174
  telemetry2.trackEvent(telemetryName, redactProperties2({
193624
194175
  ...extractCommandParams2(command),
193625
194176
  ...props,
194177
+ ...buildCommandTelemetryAttribution2(telemetryName, process.env.UIPATH_SKILL),
193626
194178
  command: "true",
193627
194179
  duration: String(durationMs),
193628
194180
  success: String(success5),
194181
+ ...terminalTelemetry,
193629
194182
  ...errorMessage2 ? { errorMessage: errorMessage2 } : {}
193630
194183
  }));
193631
194184
  });
@@ -193679,6 +194232,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
193679
194232
  ScreenLogger22.progress = progress;
193680
194233
  })(ScreenLogger2 ||= {});
193681
194234
  sdkUserAgentHostToken2 = singleton3("SdkUserAgentHostToken");
194235
+ shippedKeysSlot2 = singleton3("ShipSucceededDedupeKeys");
193682
194236
  factorySlot2 = singleton3("PackagerFactoryProvider");
193683
194237
  ((RulesConfigFileType2) => {
193684
194238
  RulesConfigFileType2["Default"] = "Default";
@@ -193788,7 +194342,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
193788
194342
  package_default6 = {
193789
194343
  name: "@uipath/project-packager",
193790
194344
  license: "MIT",
193791
- version: "1.197.0-preview.65",
194345
+ version: "1.197.0-preview.67",
193792
194346
  description: "UiPath Project Packager - core library for packing individual UiPath projects",
193793
194347
  type: "module",
193794
194348
  main: "./dist/index.js",
@@ -285664,7 +286218,7 @@ import"./packager-tool.js";
285664
286218
  var package_default = {
285665
286219
  name: "@uipath/flow-tool",
285666
286220
  license: "MIT",
285667
- version: "1.197.0-preview.65",
286221
+ version: "1.197.0-preview.67",
285668
286222
  description: "Create, debug, and run UiPath Flow projects and jobs.",
285669
286223
  private: false,
285670
286224
  repository: {
@@ -291109,9 +291663,228 @@ function getOutputFilter() {
291109
291663
  return filterSlot.get();
291110
291664
  }
291111
291665
 
291666
+ // ../common/src/telemetry/command-terminal.ts
291667
+ var recordedFailureSlot = singleton("CommandTelemetryFailure");
291668
+ var AUTH_ERROR_CODES = new Set([
291669
+ "authentication_required",
291670
+ "permission_denied"
291671
+ ]);
291672
+ var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
291673
+ var NETWORK_HTTP_ERROR_CODES = new Set([
291674
+ "network_error",
291675
+ "rate_limited",
291676
+ "server_error",
291677
+ "not_found",
291678
+ "method_not_allowed"
291679
+ ]);
291680
+ var TIMEOUT_ERROR_CODES = new Set(["timeout"]);
291681
+ var NETWORK_OS_ERROR_CODES = new Set([
291682
+ "ECONNREFUSED",
291683
+ "ECONNRESET",
291684
+ "ENOTFOUND",
291685
+ "EAI_AGAIN",
291686
+ "EPIPE",
291687
+ "EHOSTUNREACH",
291688
+ "ENETUNREACH",
291689
+ "EAI_FAIL"
291690
+ ]);
291691
+ var TIMEOUT_OS_ERROR_CODES = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
291692
+ var TLS_ERROR_CODES2 = new Set([
291693
+ "SELF_SIGNED_CERT_IN_CHAIN",
291694
+ "DEPTH_ZERO_SELF_SIGNED_CERT",
291695
+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
291696
+ "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
291697
+ "UNABLE_TO_GET_ISSUER_CERT",
291698
+ "CERT_HAS_EXPIRED",
291699
+ "CERT_UNTRUSTED",
291700
+ "ERR_TLS_CERT_ALTNAME_INVALID"
291701
+ ]);
291702
+ var MISSING_DEPENDENCY_CODES = new Set([
291703
+ "MODULE_NOT_FOUND",
291704
+ "ERR_MODULE_NOT_FOUND"
291705
+ ]);
291706
+ var INTERNAL_ERROR_NAMES = new Set([
291707
+ "TypeError",
291708
+ "ReferenceError",
291709
+ "SyntaxError",
291710
+ "RangeError"
291711
+ ]);
291712
+ function isRecord(value) {
291713
+ return value !== null && typeof value === "object";
291714
+ }
291715
+ function stringField(value, field) {
291716
+ if (!isRecord(value)) {
291717
+ return;
291718
+ }
291719
+ const raw = value[field];
291720
+ return typeof raw === "string" ? raw : undefined;
291721
+ }
291722
+ function numberField(value, field) {
291723
+ if (!isRecord(value)) {
291724
+ return;
291725
+ }
291726
+ const raw = value[field];
291727
+ return typeof raw === "number" ? raw : undefined;
291728
+ }
291729
+ function findStringInCauseChain(error, field) {
291730
+ let current = error;
291731
+ for (let depth = 0;depth < 5 && current !== null && typeof current === "object"; depth++) {
291732
+ const value = stringField(current, field);
291733
+ if (value) {
291734
+ return value;
291735
+ }
291736
+ current = current.cause;
291737
+ }
291738
+ return;
291739
+ }
291740
+ function findCodeInCauseChain(error) {
291741
+ return findStringInCauseChain(error, "code");
291742
+ }
291743
+ function isSpawnEnoent(error) {
291744
+ const code = findCodeInCauseChain(error);
291745
+ if (code !== "ENOENT") {
291746
+ return false;
291747
+ }
291748
+ const syscall = findStringInCauseChain(error, "syscall");
291749
+ return syscall?.startsWith("spawn") === true;
291750
+ }
291751
+ function isCancellationError(error, exitCode, pollSignal) {
291752
+ if (exitCode === 130) {
291753
+ return true;
291754
+ }
291755
+ if (!isRecord(error)) {
291756
+ return false;
291757
+ }
291758
+ if (numberField(error, "exitCode") === 130) {
291759
+ return true;
291760
+ }
291761
+ const name = stringField(error, "name");
291762
+ if (name === "ExitPromptError") {
291763
+ return true;
291764
+ }
291765
+ if (name === "AbortError" && pollSignal?.aborted) {
291766
+ return true;
291767
+ }
291768
+ const message = stringField(error, "message");
291769
+ return message?.includes("SIGINT") === true;
291770
+ }
291771
+ function terminalSignalFor(input, outcome) {
291772
+ if (input.recordedFailure?.terminalSignal) {
291773
+ return input.recordedFailure.terminalSignal;
291774
+ }
291775
+ const explicit = findStringInCauseChain(input.error, "terminalSignal") ?? findStringInCauseChain(input.error, "signal");
291776
+ if (explicit) {
291777
+ return explicit;
291778
+ }
291779
+ return outcome === "cancelled" ? "SIGINT" : undefined;
291780
+ }
291781
+ function classifyHttpStatus(status) {
291782
+ if (status === 401 || status === 403) {
291783
+ return "auth";
291784
+ }
291785
+ if (status === 400 || status === 409 || status === 422) {
291786
+ return "validation";
291787
+ }
291788
+ if (status === 408) {
291789
+ return "timeout";
291790
+ }
291791
+ return "network_http";
291792
+ }
291793
+ function classifyFromResult(result) {
291794
+ switch (result) {
291795
+ case "AuthenticationError":
291796
+ return "auth";
291797
+ case "ValidationError":
291798
+ return "validation";
291799
+ case "TimeoutError":
291800
+ return "timeout";
291801
+ default:
291802
+ return;
291803
+ }
291804
+ }
291805
+ function classifyFromErrorCode(errorCode) {
291806
+ if (!errorCode) {
291807
+ return;
291808
+ }
291809
+ if (AUTH_ERROR_CODES.has(errorCode)) {
291810
+ return "auth";
291811
+ }
291812
+ if (VALIDATION_ERROR_CODES.has(errorCode)) {
291813
+ return "validation";
291814
+ }
291815
+ if (TIMEOUT_ERROR_CODES.has(errorCode)) {
291816
+ return "timeout";
291817
+ }
291818
+ if (NETWORK_HTTP_ERROR_CODES.has(errorCode)) {
291819
+ return "network_http";
291820
+ }
291821
+ return;
291822
+ }
291823
+ function classifyFromError(error) {
291824
+ const code = findCodeInCauseChain(error);
291825
+ if (code) {
291826
+ if (code.startsWith("commander.")) {
291827
+ return "validation";
291828
+ }
291829
+ if (NETWORK_OS_ERROR_CODES.has(code) || TLS_ERROR_CODES2.has(code)) {
291830
+ return "network_http";
291831
+ }
291832
+ if (TIMEOUT_OS_ERROR_CODES.has(code)) {
291833
+ return "timeout";
291834
+ }
291835
+ if (MISSING_DEPENDENCY_CODES.has(code) || isSpawnEnoent(error)) {
291836
+ return "missing_dependency";
291837
+ }
291838
+ }
291839
+ const message = stringField(error, "message");
291840
+ if (message?.includes("fetch failed") === true) {
291841
+ return "network_http";
291842
+ }
291843
+ const name = stringField(error, "name");
291844
+ if (name && INTERNAL_ERROR_NAMES.has(name)) {
291845
+ return "internal";
291846
+ }
291847
+ return;
291848
+ }
291849
+ function classifyError2(input) {
291850
+ const recorded = input.recordedFailure;
291851
+ if (recorded?.errorClass) {
291852
+ return recorded.errorClass;
291853
+ }
291854
+ const status = recorded?.context?.httpStatus;
291855
+ if (status !== undefined) {
291856
+ return classifyHttpStatus(status);
291857
+ }
291858
+ return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
291859
+ }
291860
+ function recordCommandFailureTelemetry(failure) {
291861
+ recordedFailureSlot.set(failure);
291862
+ }
291863
+ function clearRecordedCommandFailureTelemetry() {
291864
+ recordedFailureSlot.clear();
291865
+ }
291866
+ function takeRecordedCommandFailureTelemetry() {
291867
+ const failure = recordedFailureSlot.get();
291868
+ recordedFailureSlot.clear();
291869
+ return failure;
291870
+ }
291871
+ function buildCommandTerminalTelemetryProperties(input) {
291872
+ const cancelled = isCancellationError(input.error, input.exitCode, input.pollSignal);
291873
+ const outcome = input.recordedFailure?.terminalOutcome ?? (input.exitCode === 0 ? "success" : cancelled ? "cancelled" : "failure");
291874
+ const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError2(input);
291875
+ const terminalSignal = terminalSignalFor(input, outcome);
291876
+ return {
291877
+ exit_code: input.exitCode,
291878
+ terminal_outcome: outcome,
291879
+ ...errorClass ? { error_class: errorClass } : {},
291880
+ ...terminalSignal ? { terminal_signal: terminalSignal } : {}
291881
+ };
291882
+ }
291883
+
291112
291884
  // ../common/src/telemetry/telemetry-events.ts
291113
291885
  var CommonTelemetryEvents = {
291114
- Error: "uip.error"
291886
+ Error: "uip.error",
291887
+ ShipSucceeded: "ship_succeeded"
291115
291888
  };
291116
291889
 
291117
291890
  // ../common/src/registry.ts
@@ -291178,6 +291951,136 @@ function formatMessage(category, name, properties) {
291178
291951
  }
291179
291952
  return message;
291180
291953
  }
291954
+ // ../common/src/telemetry/detect-agent.ts
291955
+ var KNOWN_AGENTS = [
291956
+ { envVar: "CLAUDECODE", value: "1", id: "claude-code" },
291957
+ { envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
291958
+ { envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
291959
+ { envVar: "CODEX_THREAD_ID", id: "codex" },
291960
+ { envVar: "CODEX_SANDBOX", id: "codex" },
291961
+ { envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
291962
+ { envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
291963
+ ];
291964
+ function detectAgentFromEnv(env) {
291965
+ for (const agent of KNOWN_AGENTS) {
291966
+ const envValue = env[agent.envVar];
291967
+ if (agent.value !== undefined) {
291968
+ if (envValue === agent.value)
291969
+ return agent.id;
291970
+ } else {
291971
+ if (envValue)
291972
+ return agent.id;
291973
+ }
291974
+ }
291975
+ const agentEnv = env.AGENT;
291976
+ if (agentEnv) {
291977
+ if (agentEnv === "1" || agentEnv === "true")
291978
+ return "unknown";
291979
+ if (agentEnv.length <= 32)
291980
+ return agentEnv.toLowerCase();
291981
+ }
291982
+ return;
291983
+ }
291984
+ // ../common/src/telemetry/environment-info.ts
291985
+ var LOCAL_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
291986
+ // ../common/src/telemetry/execution-context.ts
291987
+ var authSignalSlot = singleton("TelemetryExecutionContextAuthSignal");
291988
+ var isTruthy = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false";
291989
+ var isEqual = (value, expected) => value?.toLowerCase() === expected;
291990
+ var CI_SIGNATURES = [
291991
+ {
291992
+ provider: "github_actions",
291993
+ matches: (env) => isTruthy(env.GITHUB_ACTIONS),
291994
+ isScheduler: (env) => env.GITHUB_EVENT_NAME === "schedule"
291995
+ },
291996
+ {
291997
+ provider: "azure_devops",
291998
+ matches: (env) => isTruthy(env.TF_BUILD),
291999
+ isScheduler: (env) => isEqual(env.BUILD_REASON, "schedule")
292000
+ },
292001
+ {
292002
+ provider: "gitlab",
292003
+ matches: (env) => isTruthy(env.GITLAB_CI),
292004
+ isScheduler: (env) => env.CI_PIPELINE_SOURCE === "schedule"
292005
+ },
292006
+ {
292007
+ provider: "circleci",
292008
+ matches: (env) => isTruthy(env.CIRCLECI),
292009
+ isScheduler: (env) => env.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
292010
+ },
292011
+ {
292012
+ provider: "jenkins",
292013
+ matches: (env) => isTruthy(env.JENKINS_URL) || isTruthy(env.JENKINS_HOME)
292014
+ },
292015
+ {
292016
+ provider: "teamcity",
292017
+ matches: (env) => isTruthy(env.TEAMCITY_VERSION)
292018
+ },
292019
+ {
292020
+ provider: "buildkite",
292021
+ matches: (env) => isTruthy(env.BUILDKITE),
292022
+ isScheduler: (env) => env.BUILDKITE_SOURCE === "schedule"
292023
+ },
292024
+ {
292025
+ provider: "bitbucket",
292026
+ matches: (env) => isTruthy(env.BITBUCKET_BUILD_NUMBER)
292027
+ },
292028
+ {
292029
+ provider: "travis",
292030
+ matches: (env) => isTruthy(env.TRAVIS)
292031
+ },
292032
+ {
292033
+ provider: "appveyor",
292034
+ matches: (env) => isTruthy(env.APPVEYOR)
292035
+ },
292036
+ {
292037
+ provider: "generic",
292038
+ matches: (env) => isTruthy(env.CI)
292039
+ }
292040
+ ];
292041
+ function currentEnv() {
292042
+ return typeof process === "undefined" ? {} : process.env;
292043
+ }
292044
+ function currentTtyState() {
292045
+ if (typeof process === "undefined")
292046
+ return false;
292047
+ return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
292048
+ }
292049
+ function detectCi(env) {
292050
+ const signature = CI_SIGNATURES.find((candidate) => candidate.matches(env));
292051
+ if (!signature)
292052
+ return;
292053
+ return {
292054
+ executionContext: signature.isScheduler?.(env) ? "scheduler" : "ci",
292055
+ ciProvider: signature.provider
292056
+ };
292057
+ }
292058
+ function detectExecutionContext(options = {}) {
292059
+ const env = options.env ?? currentEnv();
292060
+ const ci = detectCi(env);
292061
+ if (ci)
292062
+ return ci;
292063
+ const agent = options.agent ?? detectAgentFromEnv(env);
292064
+ if (agent) {
292065
+ return { executionContext: "agent" };
292066
+ }
292067
+ const authSignal = options.authSignal ?? authSignalSlot.get();
292068
+ if (authSignal === "service_account") {
292069
+ return { executionContext: "service_account" };
292070
+ }
292071
+ const isTty = options.isTty ?? currentTtyState();
292072
+ if (isTty) {
292073
+ return { executionContext: "manual" };
292074
+ }
292075
+ return { executionContext: "unknown" };
292076
+ }
292077
+ function getExecutionContextTelemetryProperties() {
292078
+ const detected = detectExecutionContext();
292079
+ return {
292080
+ execution_context: detected.executionContext,
292081
+ ...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
292082
+ };
292083
+ }
291181
292084
  // ../common/src/telemetry/node-context-storage.ts
291182
292085
  import { AsyncLocalStorage } from "node:async_hooks";
291183
292086
 
@@ -291190,6 +292093,26 @@ class NodeContextStorage {
291190
292093
  return this.storage.getStore();
291191
292094
  }
291192
292095
  }
292096
+ // ../common/src/telemetry/session-id.ts
292097
+ var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
292098
+ var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
292099
+ var telemetrySessionIdSlot = singleton("TelemetrySessionId");
292100
+ function getProcessEnv() {
292101
+ return globalThis.process?.env;
292102
+ }
292103
+ function normalizeSessionId(value) {
292104
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
292105
+ return;
292106
+ }
292107
+ const trimmed = String(value).trim();
292108
+ return trimmed || undefined;
292109
+ }
292110
+ function getConfiguredTelemetrySessionId() {
292111
+ return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
292112
+ }
292113
+ function resolveTelemetrySessionId(existingSessionId) {
292114
+ return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
292115
+ }
291193
292116
  // ../common/src/telemetry/global-telemetry-properties.ts
291194
292117
  var telemetryPropsSlot = singleton("TelemetryDefaultProps");
291195
292118
  function getGlobalTelemetryProperties() {
@@ -291274,12 +292197,22 @@ class TelemetryService {
291274
292197
  return this.contextStorage.getContext();
291275
292198
  }
291276
292199
  enrichPropertiesWithContext(properties, context) {
291277
- return {
291278
- ...getGlobalTelemetryProperties(),
292200
+ const globalProperties = getGlobalTelemetryProperties();
292201
+ const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
292202
+ const sessionId = resolveTelemetrySessionId(existingSessionId);
292203
+ const enriched = {
292204
+ ...getExecutionContextTelemetryProperties(),
292205
+ ...globalProperties,
291279
292206
  ...this.defaultProperties,
291280
292207
  ...properties,
291281
292208
  ...context
291282
292209
  };
292210
+ if (sessionId === undefined) {
292211
+ delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
292212
+ } else {
292213
+ enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
292214
+ }
292215
+ return enriched;
291283
292216
  }
291284
292217
  generateId() {
291285
292218
  return crypto.randomUUID().replaceAll("-", "");
@@ -291749,8 +292682,24 @@ var OutputFormatter;
291749
292682
  data.ErrorCode ??= defaultErrorCodeForFailure(data);
291750
292683
  data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
291751
292684
  process.exitCode = EXIT_CODES[data.Result] ?? 1;
291752
- const { SuppressTelemetry, ...envelope } = data;
291753
- if (!SuppressTelemetry) {
292685
+ recordCommandFailureTelemetry({
292686
+ result: data.Result,
292687
+ errorCode: data.ErrorCode,
292688
+ retry: data.Retry,
292689
+ message: data.Message,
292690
+ context: data.Context,
292691
+ exitCode: process.exitCode,
292692
+ errorClass: data.TelemetryErrorClass,
292693
+ terminalOutcome: data.TelemetryTerminalOutcome,
292694
+ terminalSignal: data.TelemetryTerminalSignal
292695
+ });
292696
+ const suppressTelemetry = data.SuppressTelemetry === true;
292697
+ const envelope = { ...data };
292698
+ delete envelope.SuppressTelemetry;
292699
+ delete envelope.TelemetryErrorClass;
292700
+ delete envelope.TelemetryTerminalOutcome;
292701
+ delete envelope.TelemetryTerminalSignal;
292702
+ if (!suppressTelemetry) {
291754
292703
  telemetry.trackEvent(CommonTelemetryEvents.Error, {
291755
292704
  result: data.Result,
291756
292705
  errorCode: data.ErrorCode,
@@ -291813,6 +292762,158 @@ var OutputFormatter;
291813
292762
  OutputFormatter.formatToString = formatToString;
291814
292763
  })(OutputFormatter ||= {});
291815
292764
 
292765
+ // ../common/src/telemetry/command-attribution.ts
292766
+ var LEGACY_SKILL_NAMESPACE = "uipath:";
292767
+ var MAX_SKILL_NAME_LENGTH = 80;
292768
+ var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
292769
+ function productMode(productArea, mode) {
292770
+ return { product_area: productArea, mode };
292771
+ }
292772
+ function attributionRecord(groups) {
292773
+ const record = {};
292774
+ for (const [productArea, mode, names] of groups) {
292775
+ const attribution = productMode(productArea, mode);
292776
+ for (const name of names) {
292777
+ record[name] = attribution;
292778
+ }
292779
+ }
292780
+ return record;
292781
+ }
292782
+ function commandAttribution(groups) {
292783
+ const entries = [];
292784
+ for (const [productArea, mode, prefixes] of groups) {
292785
+ const attribution = productMode(productArea, mode);
292786
+ for (const prefix of prefixes) {
292787
+ entries.push({ prefix, attribution });
292788
+ }
292789
+ }
292790
+ return entries;
292791
+ }
292792
+ var SKILL_ATTRIBUTION = attributionRecord([
292793
+ ["admin", "operate", ["uipath-admin"]],
292794
+ ["agents", "build", ["uipath-agents"]],
292795
+ ["api-workflow", "build", ["uipath-api-workflow"]],
292796
+ ["automation-discovery", "build", ["uipath-automation-discovery"]],
292797
+ ["coded-apps", "build", ["uipath-coded-apps"]],
292798
+ ["data-fabric", "operate", ["uipath-data-fabric"]],
292799
+ ["cli", "troubleshoot", ["uipath-feedback"]],
292800
+ ["governance", "operate", ["uipath-governance"]],
292801
+ ["action-center", "build", ["uipath-human-in-the-loop"]],
292802
+ ["document-understanding", "build", ["uipath-ixp"]],
292803
+ [
292804
+ "maestro",
292805
+ "build",
292806
+ ["uipath-maestro-bpmn", "uipath-maestro-case", "uipath-maestro-flow"]
292807
+ ],
292808
+ ["agenthub", "build", ["uipath-mcp-servers"]],
292809
+ ["solution", "build", ["uipath-planner", "uipath-solution"]],
292810
+ ["platform", "operate", ["uipath-platform"]],
292811
+ ["quality", "troubleshoot", ["uipath-review"]],
292812
+ ["rpa", "build", ["uipath-rpa"]],
292813
+ ["cli", "operate", ["uipath-skill-catalog"]],
292814
+ ["action-center", "operate", ["uipath-tasks"]],
292815
+ ["test-manager", "operate", ["uipath-test"]],
292816
+ ["platform", "troubleshoot", ["uipath-troubleshoot"]]
292817
+ ]);
292818
+ var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
292819
+ var COMMAND_ATTRIBUTION = commandAttribution([
292820
+ ["cli", "troubleshoot", ["uip.feedback"]],
292821
+ ["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
292822
+ ["context-grounding", "build", ["uip.context-grounding"]],
292823
+ ["api-workflow", "build", ["uip.api-workflow"]],
292824
+ ["rpa", "build", ["uip.rpa-legacy"]],
292825
+ ["conversational", "operate", ["uip.conversational"]],
292826
+ ["agents", "build", ["uip.codedagent", "uip.agent"]],
292827
+ ["agenthub", "build", ["uip.agenthub"]],
292828
+ ["coded-apps", "build", ["uip.codedapp"]],
292829
+ ["functions", "build", ["uip.functions"]],
292830
+ ["solution", "build", ["uip.solution"]],
292831
+ ["maestro", "build", ["uip.maestro", "uip.case", "uip.flow"]],
292832
+ ["llm-observability", "troubleshoot", ["uip.traces"]],
292833
+ ["platform", "operate", ["uip.platform"]],
292834
+ ["admin", "operate", ["uip.admin"]],
292835
+ ["automation-ops", "operate", ["uip.aops"]],
292836
+ ["documentation", "troubleshoot", ["uip.docsai"]],
292837
+ ["governance", "operate", ["uip.gov"]],
292838
+ ["insights", "operate", ["uip.insights"]],
292839
+ ["document-understanding", "build", ["uip.ixp"]],
292840
+ ["process-mining", "operate", ["uip.pm"]],
292841
+ ["action-center", "operate", ["uip.tasks"]],
292842
+ ["test-manager", "operate", ["uip.tm"]],
292843
+ ["vertical-solutions", "build", ["uip.vss"]],
292844
+ ["data-fabric", "operate", ["uip.df"]],
292845
+ ["integration-service", "build", ["uip.is"]],
292846
+ ["orchestrator", "operate", ["uip.or"]],
292847
+ [
292848
+ "cli",
292849
+ "operate",
292850
+ [
292851
+ "uip.login",
292852
+ "uip.logout",
292853
+ "uip.user",
292854
+ "uip.config",
292855
+ "uip.tools",
292856
+ "uip.skills",
292857
+ "uip.completion",
292858
+ "uip.update",
292859
+ "uip.mcp",
292860
+ "uip.track"
292861
+ ]
292862
+ ]
292863
+ ]).sort((a, b) => b.prefix.length - a.prefix.length);
292864
+ function normalizeCommandPath(value) {
292865
+ if (typeof value !== "string") {
292866
+ return;
292867
+ }
292868
+ const trimmed = value.trim().toLowerCase();
292869
+ if (!trimmed) {
292870
+ return;
292871
+ }
292872
+ const tokens = trimmed.includes(" ") ? trimmed.split(/\s+/).filter((token) => token.length > 0).filter((token) => !token.startsWith("-")) : trimmed.split(".").filter((token) => token.length > 0);
292873
+ if (tokens.length === 0) {
292874
+ return;
292875
+ }
292876
+ const commandTokens = tokens[0] === "uip" ? tokens : ["uip", ...tokens];
292877
+ return commandTokens.join(".");
292878
+ }
292879
+ function getCommandProductModeAttribution(commandPath) {
292880
+ const normalized = normalizeCommandPath(commandPath);
292881
+ if (!normalized) {
292882
+ return;
292883
+ }
292884
+ return COMMAND_ATTRIBUTION.find(({ prefix }) => normalized === prefix || normalized.startsWith(`${prefix}.`))?.attribution;
292885
+ }
292886
+ function normalizeSkillNameWithOptions(value, options) {
292887
+ if (typeof value !== "string") {
292888
+ return;
292889
+ }
292890
+ const normalized = value.trim().toLowerCase();
292891
+ if (!normalized) {
292892
+ return;
292893
+ }
292894
+ const hasLegacyNamespace = normalized.startsWith(LEGACY_SKILL_NAMESPACE);
292895
+ if (hasLegacyNamespace && !options.allowLegacyNamespace) {
292896
+ return;
292897
+ }
292898
+ const skillName = hasLegacyNamespace ? normalized.slice(LEGACY_SKILL_NAMESPACE.length) : normalized;
292899
+ if (skillName.length > MAX_SKILL_NAME_LENGTH || !SKILL_NAME_PATTERN.test(skillName) || !KNOWN_SKILL_NAMES.has(skillName)) {
292900
+ return;
292901
+ }
292902
+ return skillName;
292903
+ }
292904
+ function normalizeSkillName(value) {
292905
+ return normalizeSkillNameWithOptions(value, {
292906
+ allowLegacyNamespace: false
292907
+ });
292908
+ }
292909
+ function buildCommandTelemetryAttribution(commandPath, skillSource) {
292910
+ const skillName = normalizeSkillName(skillSource);
292911
+ return {
292912
+ ...skillName ? { skill_name: skillName } : {},
292913
+ ...getCommandProductModeAttribution(commandPath)
292914
+ };
292915
+ }
292916
+
291816
292917
  // ../common/src/telemetry/pii-redactor.ts
291817
292918
  var REDACTED = "[REDACTED]";
291818
292919
  var MAX_VALUE_LENGTH = 200;
@@ -291998,6 +293099,12 @@ function commandHelpHint(commandPath) {
291998
293099
  const command = commandPath.replace(/\./g, " ");
291999
293100
  return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
292000
293101
  }
293102
+ function isPromptCancellation(error) {
293103
+ return error instanceof Error && error.name === "ExitPromptError";
293104
+ }
293105
+ function exitCodeFromProcess(fallback) {
293106
+ return typeof process.exitCode === "number" ? process.exitCode : fallback;
293107
+ }
292001
293108
  Command.prototype.trackedAction = function(context, fn, properties) {
292002
293109
  const command = this;
292003
293110
  return this.action(async (...args) => {
@@ -292005,6 +293112,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
292005
293112
  const props = typeof properties === "function" ? properties(...args) : properties;
292006
293113
  const startTime = performance.now();
292007
293114
  let errorMessage;
293115
+ let fallbackExitCode = EXIT_CODES.Success;
293116
+ clearRecordedCommandFailureTelemetry();
292008
293117
  const [error] = await catchError(fn(...args));
292009
293118
  if (error) {
292010
293119
  errorMessage = error instanceof Error ? error.message : String(error);
@@ -292019,6 +293128,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
292019
293128
  const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
292020
293129
  const typedContext = typed.context ?? typed.Context;
292021
293130
  const customContext = isErrorContext(typedContext) ? typedContext : undefined;
293131
+ const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
293132
+ fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
292022
293133
  OutputFormatter.error({
292023
293134
  Result: finalResult,
292024
293135
  ...customErrorCode ? { ErrorCode: customErrorCode } : {},
@@ -292027,16 +293138,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
292027
293138
  ...customRetry ? { Retry: customRetry } : {},
292028
293139
  ...customContext ? { Context: customContext } : {}
292029
293140
  });
292030
- context.exit(EXIT_CODES[finalResult]);
293141
+ context.exit(fallbackExitCode);
292031
293142
  }
292032
293143
  const durationMs = performance.now() - startTime;
292033
- const success = !error && (process.exitCode === undefined || process.exitCode === 0);
293144
+ const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
293145
+ const recordedFailure = takeRecordedCommandFailureTelemetry();
293146
+ const success = !error && exitCode === 0;
293147
+ const terminalTelemetry = buildCommandTerminalTelemetryProperties({
293148
+ error,
293149
+ exitCode,
293150
+ recordedFailure,
293151
+ pollSignal: context.pollSignal
293152
+ });
292034
293153
  telemetry.trackEvent(telemetryName, redactProperties({
292035
293154
  ...extractCommandParams(command),
292036
293155
  ...props,
293156
+ ...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
292037
293157
  command: "true",
292038
293158
  duration: String(durationMs),
292039
293159
  success: String(success),
293160
+ ...terminalTelemetry,
292040
293161
  ...errorMessage ? { errorMessage } : {}
292041
293162
  }));
292042
293163
  });
@@ -292737,6 +293858,8 @@ async function readStdin() {
292737
293858
  process.stdin.on("error", reject);
292738
293859
  });
292739
293860
  }
293861
+ // ../common/src/telemetry/ship-succeeded.ts
293862
+ var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
292740
293863
  // ../common/src/tool-provider.ts
292741
293864
  var factorySlot = singleton("PackagerFactoryProvider");
292742
293865
  // ../../node_modules/@uipath/flow-core/dist/chunk-O5TVSNHC.js
@@ -293113,7 +294236,7 @@ init_dist3();
293113
294236
  // ../packager/packager-tool-flow/package.json
293114
294237
  var package_default2 = {
293115
294238
  name: "@uipath/packager-tool-flow",
293116
- version: "1.197.0-preview.65",
294239
+ version: "1.197.0-preview.67",
293117
294240
  description: "UiPath Flow tool implementation",
293118
294241
  type: "module",
293119
294242
  exports: {
@@ -336006,7 +337129,7 @@ class TextApiResponse {
336006
337129
  var package_default3 = {
336007
337130
  name: "@uipath/integrationservice-sdk",
336008
337131
  license: "MIT",
336009
- version: "1.197.0-preview.65",
337132
+ version: "1.197.0-preview.67",
336010
337133
  repository: {
336011
337134
  type: "git",
336012
337135
  url: "https://github.com/UiPath/cli.git",
@@ -354032,7 +355155,7 @@ function querystringSingleKey4(key, value, keyPrefix = "") {
354032
355155
  var package_default5 = {
354033
355156
  name: "@uipath/solution-sdk",
354034
355157
  license: "MIT",
354035
- version: "1.197.0-preview.65",
355158
+ version: "1.197.0-preview.67",
354036
355159
  repository: {
354037
355160
  type: "git",
354038
355161
  url: "https://github.com/UiPath/cli.git",
@@ -354111,7 +355234,7 @@ async function readUipxFile(fs9, solutionDir) {
354111
355234
  return { uipx, uipxFileName };
354112
355235
  }
354113
355236
  function validateUipxFile(parsed, uipxFileName) {
354114
- if (!isRecord(parsed)) {
355237
+ if (!isRecord2(parsed)) {
354115
355238
  throw new Error(`Invalid .uipx file: ${uipxFileName} must contain a JSON object.`);
354116
355239
  }
354117
355240
  if (typeof parsed.SolutionId !== "string" || !parsed.SolutionId.trim()) {
@@ -354121,7 +355244,7 @@ function validateUipxFile(parsed, uipxFileName) {
354121
355244
  throw new Error("Invalid .uipx file: missing Projects.");
354122
355245
  }
354123
355246
  for (const [index, project] of parsed.Projects.entries()) {
354124
- if (!isRecord(project)) {
355247
+ if (!isRecord2(project)) {
354125
355248
  throw new Error(`Invalid .uipx file: Projects[${index}] must be an object.`);
354126
355249
  }
354127
355250
  if (typeof project.ProjectRelativePath !== "string" || !project.ProjectRelativePath.trim()) {
@@ -354131,7 +355254,7 @@ function validateUipxFile(parsed, uipxFileName) {
354131
355254
  }
354132
355255
  return parsed;
354133
355256
  }
354134
- function isRecord(value) {
355257
+ function isRecord2(value) {
354135
355258
  return typeof value === "object" && value !== null && !Array.isArray(value);
354136
355259
  }
354137
355260
  async function updateUipxSolutionId(fs9, uipxPath, newSolutionId) {
@@ -354389,11 +355512,11 @@ async function readProjectManifest(fs9, filePath, useProjectJson) {
354389
355512
  null
354390
355513
  ];
354391
355514
  }
354392
- if (!isRecord(parsed)) {
355515
+ if (!isRecord2(parsed)) {
354393
355516
  return [new Error(`Invalid project file: ${filePath}`), null];
354394
355517
  }
354395
355518
  const designOptions = parsed.designOptions;
354396
- const outputType = useProjectJson && isRecord(designOptions) ? readString(designOptions.outputType) : undefined;
355519
+ const outputType = useProjectJson && isRecord2(designOptions) ? readString(designOptions.outputType) : undefined;
354397
355520
  const projectType = outputType ?? readString(parsed.ProjectType);
354398
355521
  if (!projectType) {
354399
355522
  return [new Error(`ProjectType not found in ${filePath}`), null];
@@ -354420,7 +355543,7 @@ async function readSolutionManifest(fs9, solutionFile) {
354420
355543
  null
354421
355544
  ];
354422
355545
  }
354423
- if (!isRecord(parsed)) {
355546
+ if (!isRecord2(parsed)) {
354424
355547
  return [
354425
355548
  new Error(`Invalid solution file: ${solutionFile} must contain a JSON object.`),
354426
355549
  null
@@ -354434,7 +355557,7 @@ async function readSolutionManifest(fs9, solutionFile) {
354434
355557
  }
354435
355558
  const projects = [];
354436
355559
  for (const [index, project] of parsed.Projects.entries()) {
354437
- if (!isRecord(project)) {
355560
+ if (!isRecord2(project)) {
354438
355561
  return [
354439
355562
  new Error(`Invalid solution file: Projects[${index}] must be an object.`),
354440
355563
  null
@@ -356914,7 +358037,7 @@ function evaluatorCanUseSharedExpectedOutput(typeId) {
356914
358037
  return getEvaluatorTypeDefinition(typeId)?.criteriaFields.some((field) => field.key === "expectedOutput" && field.type === "object") ?? false;
356915
358038
  }
356916
358039
  // src/services/flow-eval-utils.ts
356917
- function isRecord2(value) {
358040
+ function isRecord3(value) {
356918
358041
  return typeof value === "object" && value !== null && !Array.isArray(value);
356919
358042
  }
356920
358043
  var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
@@ -356957,7 +358080,7 @@ function buildDefaultCriteria(evaluators, expectedOutput, searchText) {
356957
358080
  criterias[key] = { searchText };
356958
358081
  } else {
356959
358082
  const defaultCriteria = evaluator.evaluatorConfig.defaultEvaluationCriteria;
356960
- criterias[key] = isRecord2(defaultCriteria) ? defaultCriteria : null;
358083
+ criterias[key] = isRecord3(defaultCriteria) ? defaultCriteria : null;
356961
358084
  }
356962
358085
  }
356963
358086
  return criterias;
@@ -357000,13 +358123,13 @@ function readFlowGlobalsAsInputs(flowContent) {
357000
358123
  } catch {
357001
358124
  return inputs;
357002
358125
  }
357003
- if (!isRecord2(parsed)) {
358126
+ if (!isRecord3(parsed)) {
357004
358127
  return inputs;
357005
358128
  }
357006
- const variables = isRecord2(parsed.variables) ? parsed.variables : undefined;
358129
+ const variables = isRecord3(parsed.variables) ? parsed.variables : undefined;
357007
358130
  const globals = Array.isArray(variables?.globals) ? variables.globals : [];
357008
358131
  for (const entry of globals) {
357009
- if (!isRecord2(entry)) {
358132
+ if (!isRecord3(entry)) {
357010
358133
  continue;
357011
358134
  }
357012
358135
  if (entry.direction !== "in" || typeof entry.id !== "string") {
@@ -357042,7 +358165,7 @@ function readWorkflowId(flowContent) {
357042
358165
  if (parseError) {
357043
358166
  return;
357044
358167
  }
357045
- if (!isRecord2(parsed) || typeof parsed.id !== "string") {
358168
+ if (!isRecord3(parsed) || typeof parsed.id !== "string") {
357046
358169
  return;
357047
358170
  }
357048
358171
  if (parsed.id === "" || parsed.id.includes("/") || parsed.id.includes("\\") || parsed.id.includes("..")) {
@@ -357158,20 +358281,20 @@ class FlowEvalPathResolver {
357158
358281
  }
357159
358282
  function readStartNodeId(flowContent) {
357160
358283
  const parsed = JSON.parse(flowContent);
357161
- if (!isRecord2(parsed) || !Array.isArray(parsed.nodes)) {
358284
+ if (!isRecord3(parsed) || !Array.isArray(parsed.nodes)) {
357162
358285
  return;
357163
358286
  }
357164
- const nodes = parsed.nodes.filter(isRecord2);
358287
+ const nodes = parsed.nodes.filter(isRecord3);
357165
358288
  const defaultEntry = nodes.find((node2) => {
357166
- const inputs = isRecord2(node2.inputs) ? node2.inputs : undefined;
358289
+ const inputs = isRecord3(node2.inputs) ? node2.inputs : undefined;
357167
358290
  if (inputs?.isDefaultEntryPoint === true) {
357168
358291
  return true;
357169
358292
  }
357170
- const model = isRecord2(node2.model) ? node2.model : undefined;
358293
+ const model = isRecord3(node2.model) ? node2.model : undefined;
357171
358294
  return model?.isDefaultEntryPoint === true;
357172
358295
  });
357173
358296
  const startNode = defaultEntry ?? nodes.find((node2) => {
357174
- const model = isRecord2(node2.model) ? node2.model : undefined;
358297
+ const model = isRecord3(node2.model) ? node2.model : undefined;
357175
358298
  return model?.type === "bpmn:StartEvent" || node2.type === "core.trigger.manual";
357176
358299
  }) ?? nodes[0];
357177
358300
  return typeof startNode?.id === "string" ? startNode.id : undefined;
@@ -357468,12 +358591,12 @@ function readFlowGlobalsAsOutputs(flowContent) {
357468
358591
  } catch {
357469
358592
  return outputs;
357470
358593
  }
357471
- if (!isRecord2(parsed))
358594
+ if (!isRecord3(parsed))
357472
358595
  return outputs;
357473
- const variables = isRecord2(parsed.variables) ? parsed.variables : undefined;
358596
+ const variables = isRecord3(parsed.variables) ? parsed.variables : undefined;
357474
358597
  const globals = Array.isArray(variables?.globals) ? variables.globals : [];
357475
358598
  for (const entry of globals) {
357476
- if (!isRecord2(entry))
358599
+ if (!isRecord3(entry))
357477
358600
  continue;
357478
358601
  if (entry.direction !== "out")
357479
358602
  continue;
@@ -357522,11 +358645,11 @@ function extractNodeOutputSchema(flowContent, componentId, wrapAllOutputs) {
357522
358645
  } catch {
357523
358646
  return { schema: undefined, nodeFound: false };
357524
358647
  }
357525
- if (!isRecord2(parsed)) {
358648
+ if (!isRecord3(parsed)) {
357526
358649
  return { schema: undefined, nodeFound: false };
357527
358650
  }
357528
358651
  const nodes = Array.isArray(parsed.nodes) ? parsed.nodes : [];
357529
- const node2 = nodes.find((n) => isRecord2(n) && n.id === componentId);
358652
+ const node2 = nodes.find((n) => isRecord3(n) && n.id === componentId);
357530
358653
  if (!node2) {
357531
358654
  return { schema: undefined, nodeFound: false };
357532
358655
  }
@@ -357543,7 +358666,7 @@ function extractNodeOutputSchema(flowContent, componentId, wrapAllOutputs) {
357543
358666
  return { schema: schema70, nodeFound: true };
357544
358667
  }
357545
358668
  }
357546
- const outputs = isRecord2(node2.outputs) ? node2.outputs : undefined;
358669
+ const outputs = isRecord3(node2.outputs) ? node2.outputs : undefined;
357547
358670
  if (outputs && Object.keys(outputs).length > 0) {
357548
358671
  if (!wrapAllOutputs && "output" in outputs) {
357549
358672
  return { schema: outputs.output, nodeFound: true };
@@ -357556,37 +358679,37 @@ function extractNodeOutputSchema(flowContent, componentId, wrapAllOutputs) {
357556
358679
  return { schema: undefined, nodeFound: true };
357557
358680
  }
357558
358681
  function extractConnectorOutputSchema(node2) {
357559
- if (!isRecord2(node2.inputs))
358682
+ if (!isRecord3(node2.inputs))
357560
358683
  return;
357561
358684
  const detail = node2.inputs.detail;
357562
358685
  let detailObj;
357563
358686
  if (typeof detail === "string") {
357564
358687
  try {
357565
358688
  const parsed = JSON.parse(detail);
357566
- if (!isRecord2(parsed))
358689
+ if (!isRecord3(parsed))
357567
358690
  return;
357568
358691
  detailObj = parsed;
357569
358692
  } catch {
357570
358693
  return;
357571
358694
  }
357572
- } else if (isRecord2(detail)) {
358695
+ } else if (isRecord3(detail)) {
357573
358696
  detailObj = detail;
357574
358697
  } else {
357575
358698
  return;
357576
358699
  }
357577
- const config5 = isRecord2(detailObj.configuration) ? detailObj.configuration : undefined;
358700
+ const config5 = isRecord3(detailObj.configuration) ? detailObj.configuration : undefined;
357578
358701
  if (!config5)
357579
358702
  return;
357580
- const fieldsContainer = isRecord2(config5.fieldsContainer) ? config5.fieldsContainer : undefined;
358703
+ const fieldsContainer = isRecord3(config5.fieldsContainer) ? config5.fieldsContainer : undefined;
357581
358704
  if (!fieldsContainer)
357582
358705
  return;
357583
358706
  const schema70 = fieldsContainer.outputJsonSchema;
357584
- if (!schema70 || !isRecord2(schema70))
358707
+ if (!schema70 || !isRecord3(schema70))
357585
358708
  return;
357586
358709
  return schema70;
357587
358710
  }
357588
358711
  function extractAgentOutputSchema(node2) {
357589
- if (!isRecord2(node2.inputs))
358712
+ if (!isRecord3(node2.inputs))
357590
358713
  return;
357591
358714
  const agentOutputVariables = node2.inputs.agentOutputVariables;
357592
358715
  if (!Array.isArray(agentOutputVariables) || agentOutputVariables.length === 0) {
@@ -357594,10 +358717,10 @@ function extractAgentOutputSchema(node2) {
357594
358717
  }
357595
358718
  const properties = {};
357596
358719
  for (const v2 of agentOutputVariables) {
357597
- if (!isRecord2(v2) || typeof v2.id !== "string")
358720
+ if (!isRecord3(v2) || typeof v2.id !== "string")
357598
358721
  continue;
357599
358722
  const type = typeof v2.type === "string" ? v2.type : "string";
357600
- if (isRecord2(v2.schema)) {
358723
+ if (isRecord3(v2.schema)) {
357601
358724
  properties[v2.id] = v2.schema;
357602
358725
  } else {
357603
358726
  properties[v2.id] = { type };
@@ -357619,20 +358742,20 @@ function cleanOutputSchema(schema70) {
357619
358742
  return unwrapOutputProperty(stripped);
357620
358743
  }
357621
358744
  function stripAnnotations(value) {
357622
- if (!isRecord2(value))
358745
+ if (!isRecord3(value))
357623
358746
  return value;
357624
358747
  const result = {};
357625
358748
  for (const [k2, v2] of Object.entries(value)) {
357626
358749
  if (ANNOTATION_KEYS.has(k2))
357627
358750
  continue;
357628
- result[k2] = Array.isArray(v2) ? v2.map(stripAnnotations) : isRecord2(v2) ? stripAnnotations(v2) : v2;
358751
+ result[k2] = Array.isArray(v2) ? v2.map(stripAnnotations) : isRecord3(v2) ? stripAnnotations(v2) : v2;
357629
358752
  }
357630
358753
  return result;
357631
358754
  }
357632
358755
  function unwrapOutputProperty(schema70) {
357633
- if (!isRecord2(schema70))
358756
+ if (!isRecord3(schema70))
357634
358757
  return schema70;
357635
- const props = isRecord2(schema70.properties) ? schema70.properties : undefined;
358758
+ const props = isRecord3(schema70.properties) ? schema70.properties : undefined;
357636
358759
  if (!props || !("output" in props))
357637
358760
  return schema70;
357638
358761
  return props.output;
@@ -357879,20 +359002,20 @@ function asRecordArray(value, label) {
357879
359002
  throw new Error(`${label} response must be an array`);
357880
359003
  }
357881
359004
  return value.map((item, index) => {
357882
- if (!isRecord2(item)) {
359005
+ if (!isRecord3(item)) {
357883
359006
  throw new Error(`${label} response item ${index} must be an object`);
357884
359007
  }
357885
359008
  return item;
357886
359009
  });
357887
359010
  }
357888
359011
  function readRecord(value) {
357889
- return isRecord2(value) ? value : undefined;
359012
+ return isRecord3(value) ? value : undefined;
357890
359013
  }
357891
359014
  function readRecordArray(value) {
357892
359015
  if (!Array.isArray(value)) {
357893
359016
  return;
357894
359017
  }
357895
- return value.filter(isRecord2);
359018
+ return value.filter(isRecord3);
357896
359019
  }
357897
359020
  function optionalNumber(value) {
357898
359021
  return typeof value === "number" ? value : null;
@@ -357984,7 +359107,7 @@ function readRemoteEvalRun(record5) {
357984
359107
  }
357985
359108
  ];
357986
359109
  }),
357987
- error: typeof record5.error === "string" || isRecord2(record5.error) ? record5.error : null,
359110
+ error: typeof record5.error === "string" || isRecord3(record5.error) ? record5.error : null,
357988
359111
  errorMessage: typeof record5.errorMessage === "string" ? record5.errorMessage : null,
357989
359112
  createdAt: typeof record5.createdAt === "string" ? record5.createdAt : undefined,
357990
359113
  updatedAt: typeof record5.updatedAt === "string" ? record5.updatedAt : undefined
@@ -358005,7 +359128,7 @@ class FlowEvalRunApi {
358005
359128
  }
358006
359129
  async getEvalSetRun(config5, workloadId, evalSetRunId) {
358007
359130
  const response = await this.requestJson(config5, `/unifiedEvals/workloads/${encodeURIComponent(workloadId)}/evalSetRuns/${encodeURIComponent(evalSetRunId)}?workloadType=Flow`, { method: "GET" });
358008
- if (!isRecord2(response)) {
359131
+ if (!isRecord3(response)) {
358009
359132
  throw new Error("Eval set run response must be an object");
358010
359133
  }
358011
359134
  return readRemoteEvalSetRun(response);
@@ -358283,7 +359406,7 @@ function firstString(values) {
358283
359406
  }
358284
359407
  function readFlowStringProperty(flowContent, property) {
358285
359408
  const [parseError, parsed] = catchError(() => JSON.parse(flowContent));
358286
- if (parseError || !isRecord2(parsed)) {
359409
+ if (parseError || !isRecord3(parsed)) {
358287
359410
  return;
358288
359411
  }
358289
359412
  const value = parsed[property];
@@ -358339,15 +359462,15 @@ function withInlineAgentExecutorInfo(project) {
358339
359462
  }
358340
359463
  function extractInlineAgentProjects(flowContent, currentProjectId) {
358341
359464
  const parsed = JSON.parse(flowContent);
358342
- if (!isRecord2(parsed) || !Array.isArray(parsed.nodes)) {
359465
+ if (!isRecord3(parsed) || !Array.isArray(parsed.nodes)) {
358343
359466
  return [];
358344
359467
  }
358345
359468
  const seen = new Set;
358346
- return parsed.nodes.filter(isRecord2).flatMap((node2) => {
359469
+ return parsed.nodes.filter(isRecord3).flatMap((node2) => {
358347
359470
  const nodeType = typeof node2.type === "string" ? node2.type : "";
358348
- const model = isRecord2(node2.model) ? node2.model : undefined;
358349
- const inputs = isRecord2(node2.inputs) ? node2.inputs : undefined;
358350
- const display = isRecord2(node2.display) ? node2.display : undefined;
359471
+ const model = isRecord3(node2.model) ? node2.model : undefined;
359472
+ const inputs = isRecord3(node2.inputs) ? node2.inputs : undefined;
359473
+ const display = isRecord3(node2.display) ? node2.display : undefined;
358351
359474
  const serviceType = typeof model?.serviceType === "string" ? model.serviceType.toLowerCase() : "";
358352
359475
  const lowerType = nodeType.toLowerCase();
358353
359476
  const isAgent = lowerType.startsWith("uipath.agent") || serviceType.includes("agent");
@@ -358544,7 +359667,7 @@ class FlowEvalRunContextResolver {
358544
359667
  return;
358545
359668
  }
358546
359669
  const [parseError, parsed] = catchError(() => JSON.parse(String(content)));
358547
- if (parseError || !isRecord2(parsed)) {
359670
+ if (parseError || !isRecord3(parsed)) {
358548
359671
  return;
358549
359672
  }
358550
359673
  return typeof parsed.projectId === "string" && isUUID(parsed.projectId) ? parsed.projectId : undefined;
@@ -358573,10 +359696,10 @@ class FlowEvalRunContextResolver {
358573
359696
  }
358574
359697
  const content = await this.fs.readFile(storagePath, "utf-8");
358575
359698
  const parsed = JSON.parse(String(content));
358576
- if (!isRecord2(parsed)) {
359699
+ if (!isRecord3(parsed)) {
358577
359700
  throw new Error("SolutionStorage.json must be a JSON object");
358578
359701
  }
358579
- const projects = Array.isArray(parsed.Projects) ? parsed.Projects.filter(isRecord2).map((project) => ({
359702
+ const projects = Array.isArray(parsed.Projects) ? parsed.Projects.filter(isRecord3).map((project) => ({
358580
359703
  ProjectId: typeof project.ProjectId === "string" ? project.ProjectId : undefined,
358581
359704
  ProjectRelativePath: typeof project.ProjectRelativePath === "string" ? project.ProjectRelativePath : undefined,
358582
359705
  CloudProjectId: typeof project.CloudProjectId === "string" ? project.CloudProjectId : undefined
@@ -366296,7 +367419,7 @@ function querystringSingleKey6(key, value, keyPrefix = "") {
366296
367419
  var package_default7 = {
366297
367420
  name: "@uipath/agent-sdk",
366298
367421
  license: "MIT",
366299
- version: "1.197.0-preview.65",
367422
+ version: "1.197.0-preview.67",
366300
367423
  description: "SDK for the UiPath Agent Runtime API — evaluation execution and debug sessions.",
366301
367424
  repository: {
366302
367425
  type: "git",
@@ -367044,4 +368167,4 @@ export {
367044
368167
  metadata
367045
368168
  };
367046
368169
 
367047
- //# debugId=002FAB1F6D48C19264756E2164756E21
368170
+ //# debugId=9C27EEB28C9A406064756E2164756E21