@uipath/project-packager 1.197.0-preview.64 → 1.197.0-preview.66

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/browser.js CHANGED
@@ -22560,7 +22560,146 @@ class BrowserContextStorage {
22560
22560
  return this.contextStack.length > 0 ? this.contextStack[this.contextStack.length - 1] : undefined;
22561
22561
  }
22562
22562
  }
22563
-
22563
+ function productMode(productArea, mode) {
22564
+ return { product_area: productArea, mode };
22565
+ }
22566
+ function attributionRecord(groups) {
22567
+ const record = {};
22568
+ for (const [productArea, mode, names] of groups) {
22569
+ const attribution = productMode(productArea, mode);
22570
+ for (const name of names) {
22571
+ record[name] = attribution;
22572
+ }
22573
+ }
22574
+ return record;
22575
+ }
22576
+ function commandAttribution(groups) {
22577
+ const entries = [];
22578
+ for (const [productArea, mode, prefixes] of groups) {
22579
+ const attribution = productMode(productArea, mode);
22580
+ for (const prefix of prefixes) {
22581
+ entries.push({ prefix, attribution });
22582
+ }
22583
+ }
22584
+ return entries;
22585
+ }
22586
+ var SKILL_ATTRIBUTION = attributionRecord([
22587
+ ["admin", "operate", ["uipath-admin"]],
22588
+ ["agents", "build", ["uipath-agents"]],
22589
+ ["api-workflow", "build", ["uipath-api-workflow"]],
22590
+ ["automation-discovery", "build", ["uipath-automation-discovery"]],
22591
+ ["coded-apps", "build", ["uipath-coded-apps"]],
22592
+ ["data-fabric", "operate", ["uipath-data-fabric"]],
22593
+ ["cli", "troubleshoot", ["uipath-feedback"]],
22594
+ ["governance", "operate", ["uipath-governance"]],
22595
+ ["action-center", "build", ["uipath-human-in-the-loop"]],
22596
+ ["document-understanding", "build", ["uipath-ixp"]],
22597
+ [
22598
+ "maestro",
22599
+ "build",
22600
+ ["uipath-maestro-bpmn", "uipath-maestro-case", "uipath-maestro-flow"]
22601
+ ],
22602
+ ["agenthub", "build", ["uipath-mcp-servers"]],
22603
+ ["solution", "build", ["uipath-planner", "uipath-solution"]],
22604
+ ["platform", "operate", ["uipath-platform"]],
22605
+ ["quality", "troubleshoot", ["uipath-review"]],
22606
+ ["rpa", "build", ["uipath-rpa"]],
22607
+ ["cli", "operate", ["uipath-skill-catalog"]],
22608
+ ["action-center", "operate", ["uipath-tasks"]],
22609
+ ["test-manager", "operate", ["uipath-test"]],
22610
+ ["platform", "troubleshoot", ["uipath-troubleshoot"]]
22611
+ ]);
22612
+ var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
22613
+ var COMMAND_ATTRIBUTION = commandAttribution([
22614
+ ["cli", "troubleshoot", ["uip.feedback"]],
22615
+ ["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
22616
+ ["context-grounding", "build", ["uip.context-grounding"]],
22617
+ ["api-workflow", "build", ["uip.api-workflow"]],
22618
+ ["rpa", "build", ["uip.rpa-legacy"]],
22619
+ ["conversational", "operate", ["uip.conversational"]],
22620
+ ["agents", "build", ["uip.codedagent", "uip.agent"]],
22621
+ ["agenthub", "build", ["uip.agenthub"]],
22622
+ ["coded-apps", "build", ["uip.codedapp"]],
22623
+ ["functions", "build", ["uip.functions"]],
22624
+ ["solution", "build", ["uip.solution"]],
22625
+ ["maestro", "build", ["uip.maestro", "uip.case", "uip.flow"]],
22626
+ ["llm-observability", "troubleshoot", ["uip.traces"]],
22627
+ ["platform", "operate", ["uip.platform"]],
22628
+ ["admin", "operate", ["uip.admin"]],
22629
+ ["automation-ops", "operate", ["uip.aops"]],
22630
+ ["documentation", "troubleshoot", ["uip.docsai"]],
22631
+ ["governance", "operate", ["uip.gov"]],
22632
+ ["insights", "operate", ["uip.insights"]],
22633
+ ["document-understanding", "build", ["uip.ixp"]],
22634
+ ["process-mining", "operate", ["uip.pm"]],
22635
+ ["action-center", "operate", ["uip.tasks"]],
22636
+ ["test-manager", "operate", ["uip.tm"]],
22637
+ ["vertical-solutions", "build", ["uip.vss"]],
22638
+ ["data-fabric", "operate", ["uip.df"]],
22639
+ ["integration-service", "build", ["uip.is"]],
22640
+ ["orchestrator", "operate", ["uip.or"]],
22641
+ [
22642
+ "cli",
22643
+ "operate",
22644
+ [
22645
+ "uip.login",
22646
+ "uip.logout",
22647
+ "uip.user",
22648
+ "uip.config",
22649
+ "uip.tools",
22650
+ "uip.skills",
22651
+ "uip.completion",
22652
+ "uip.update",
22653
+ "uip.mcp",
22654
+ "uip.track"
22655
+ ]
22656
+ ]
22657
+ ]).sort((a, b) => b.prefix.length - a.prefix.length);
22658
+ var recordedFailureSlot = singleton("CommandTelemetryFailure");
22659
+ var AUTH_ERROR_CODES = new Set([
22660
+ "authentication_required",
22661
+ "permission_denied"
22662
+ ]);
22663
+ var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
22664
+ var NETWORK_HTTP_ERROR_CODES = new Set([
22665
+ "network_error",
22666
+ "rate_limited",
22667
+ "server_error",
22668
+ "not_found",
22669
+ "method_not_allowed"
22670
+ ]);
22671
+ var TIMEOUT_ERROR_CODES = new Set(["timeout"]);
22672
+ var NETWORK_OS_ERROR_CODES = new Set([
22673
+ "ECONNREFUSED",
22674
+ "ECONNRESET",
22675
+ "ENOTFOUND",
22676
+ "EAI_AGAIN",
22677
+ "EPIPE",
22678
+ "EHOSTUNREACH",
22679
+ "ENETUNREACH",
22680
+ "EAI_FAIL"
22681
+ ]);
22682
+ var TIMEOUT_OS_ERROR_CODES = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
22683
+ var TLS_ERROR_CODES2 = new Set([
22684
+ "SELF_SIGNED_CERT_IN_CHAIN",
22685
+ "DEPTH_ZERO_SELF_SIGNED_CERT",
22686
+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
22687
+ "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
22688
+ "UNABLE_TO_GET_ISSUER_CERT",
22689
+ "CERT_HAS_EXPIRED",
22690
+ "CERT_UNTRUSTED",
22691
+ "ERR_TLS_CERT_ALTNAME_INVALID"
22692
+ ]);
22693
+ var MISSING_DEPENDENCY_CODES = new Set([
22694
+ "MODULE_NOT_FOUND",
22695
+ "ERR_MODULE_NOT_FOUND"
22696
+ ]);
22697
+ var INTERNAL_ERROR_NAMES = new Set([
22698
+ "TypeError",
22699
+ "ReferenceError",
22700
+ "SyntaxError",
22701
+ "RangeError"
22702
+ ]);
22564
22703
  class ConsoleTelemetryProvider {
22565
22704
  async trackEvent(eventName, _properties) {
22566
22705
  console.debug(`[Telemetry] Event: ${eventName}`);
@@ -22575,6 +22714,152 @@ class ConsoleTelemetryProvider {
22575
22714
  console.debug(`[Telemetry] Dependency: ${name} [${type}] (${duration}ms, ${success ? "ok" : "fail"})`);
22576
22715
  }
22577
22716
  }
22717
+ var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
22718
+ var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
22719
+ var telemetrySessionIdSlot = singleton("TelemetrySessionId");
22720
+ function getProcessEnv() {
22721
+ return globalThis.process?.env;
22722
+ }
22723
+ function normalizeSessionId(value) {
22724
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
22725
+ return;
22726
+ }
22727
+ const trimmed = String(value).trim();
22728
+ return trimmed || undefined;
22729
+ }
22730
+ function getConfiguredTelemetrySessionId() {
22731
+ return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
22732
+ }
22733
+ function resolveTelemetrySessionId(existingSessionId) {
22734
+ return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
22735
+ }
22736
+ var KNOWN_AGENTS = [
22737
+ { envVar: "CLAUDECODE", value: "1", id: "claude-code" },
22738
+ { envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
22739
+ { envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
22740
+ { envVar: "CODEX_THREAD_ID", id: "codex" },
22741
+ { envVar: "CODEX_SANDBOX", id: "codex" },
22742
+ { envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
22743
+ { envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
22744
+ ];
22745
+ function detectAgentFromEnv(env2) {
22746
+ for (const agent of KNOWN_AGENTS) {
22747
+ const envValue = env2[agent.envVar];
22748
+ if (agent.value !== undefined) {
22749
+ if (envValue === agent.value)
22750
+ return agent.id;
22751
+ } else {
22752
+ if (envValue)
22753
+ return agent.id;
22754
+ }
22755
+ }
22756
+ const agentEnv = env2.AGENT;
22757
+ if (agentEnv) {
22758
+ if (agentEnv === "1" || agentEnv === "true")
22759
+ return "unknown";
22760
+ if (agentEnv.length <= 32)
22761
+ return agentEnv.toLowerCase();
22762
+ }
22763
+ return;
22764
+ }
22765
+ var authSignalSlot = singleton("TelemetryExecutionContextAuthSignal");
22766
+ var isTruthy = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false";
22767
+ var isEqual = (value, expected) => value?.toLowerCase() === expected;
22768
+ var CI_SIGNATURES = [
22769
+ {
22770
+ provider: "github_actions",
22771
+ matches: (env2) => isTruthy(env2.GITHUB_ACTIONS),
22772
+ isScheduler: (env2) => env2.GITHUB_EVENT_NAME === "schedule"
22773
+ },
22774
+ {
22775
+ provider: "azure_devops",
22776
+ matches: (env2) => isTruthy(env2.TF_BUILD),
22777
+ isScheduler: (env2) => isEqual(env2.BUILD_REASON, "schedule")
22778
+ },
22779
+ {
22780
+ provider: "gitlab",
22781
+ matches: (env2) => isTruthy(env2.GITLAB_CI),
22782
+ isScheduler: (env2) => env2.CI_PIPELINE_SOURCE === "schedule"
22783
+ },
22784
+ {
22785
+ provider: "circleci",
22786
+ matches: (env2) => isTruthy(env2.CIRCLECI),
22787
+ isScheduler: (env2) => env2.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
22788
+ },
22789
+ {
22790
+ provider: "jenkins",
22791
+ matches: (env2) => isTruthy(env2.JENKINS_URL) || isTruthy(env2.JENKINS_HOME)
22792
+ },
22793
+ {
22794
+ provider: "teamcity",
22795
+ matches: (env2) => isTruthy(env2.TEAMCITY_VERSION)
22796
+ },
22797
+ {
22798
+ provider: "buildkite",
22799
+ matches: (env2) => isTruthy(env2.BUILDKITE),
22800
+ isScheduler: (env2) => env2.BUILDKITE_SOURCE === "schedule"
22801
+ },
22802
+ {
22803
+ provider: "bitbucket",
22804
+ matches: (env2) => isTruthy(env2.BITBUCKET_BUILD_NUMBER)
22805
+ },
22806
+ {
22807
+ provider: "travis",
22808
+ matches: (env2) => isTruthy(env2.TRAVIS)
22809
+ },
22810
+ {
22811
+ provider: "appveyor",
22812
+ matches: (env2) => isTruthy(env2.APPVEYOR)
22813
+ },
22814
+ {
22815
+ provider: "generic",
22816
+ matches: (env2) => isTruthy(env2.CI)
22817
+ }
22818
+ ];
22819
+ function currentEnv() {
22820
+ return typeof process === "undefined" ? {} : process.env;
22821
+ }
22822
+ function currentTtyState() {
22823
+ if (typeof process === "undefined")
22824
+ return false;
22825
+ return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
22826
+ }
22827
+ function detectCi(env2) {
22828
+ const signature = CI_SIGNATURES.find((candidate) => candidate.matches(env2));
22829
+ if (!signature)
22830
+ return;
22831
+ return {
22832
+ executionContext: signature.isScheduler?.(env2) ? "scheduler" : "ci",
22833
+ ciProvider: signature.provider
22834
+ };
22835
+ }
22836
+ function detectExecutionContext(options = {}) {
22837
+ const env2 = options.env ?? currentEnv();
22838
+ const ci = detectCi(env2);
22839
+ if (ci)
22840
+ return ci;
22841
+ const agent = options.agent ?? detectAgentFromEnv(env2);
22842
+ if (agent) {
22843
+ return { executionContext: "agent" };
22844
+ }
22845
+ const authSignal = options.authSignal ?? authSignalSlot.get();
22846
+ if (authSignal === "service_account") {
22847
+ return { executionContext: "service_account" };
22848
+ }
22849
+ const isTty = options.isTty ?? currentTtyState();
22850
+ if (isTty) {
22851
+ return { executionContext: "manual" };
22852
+ }
22853
+ return { executionContext: "unknown" };
22854
+ }
22855
+ function getExecutionContextTelemetryProperties() {
22856
+ const detected = detectExecutionContext();
22857
+ return {
22858
+ execution_context: detected.executionContext,
22859
+ ...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
22860
+ };
22861
+ }
22862
+
22578
22863
  class TelemetryService {
22579
22864
  telemetryProvider;
22580
22865
  contextStorage;
@@ -22652,12 +22937,22 @@ class TelemetryService {
22652
22937
  return this.contextStorage.getContext();
22653
22938
  }
22654
22939
  enrichPropertiesWithContext(properties, context) {
22655
- return {
22656
- ...getGlobalTelemetryProperties(),
22940
+ const globalProperties = getGlobalTelemetryProperties();
22941
+ const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
22942
+ const sessionId = resolveTelemetrySessionId(existingSessionId);
22943
+ const enriched = {
22944
+ ...getExecutionContextTelemetryProperties(),
22945
+ ...globalProperties,
22657
22946
  ...this.defaultProperties,
22658
22947
  ...properties,
22659
22948
  ...context
22660
22949
  };
22950
+ if (sessionId === undefined) {
22951
+ delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
22952
+ } else {
22953
+ enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
22954
+ }
22955
+ return enriched;
22661
22956
  }
22662
22957
  generateId() {
22663
22958
  return crypto.randomUUID().replaceAll("-", "");
@@ -23604,4 +23899,4 @@ export {
23604
23899
  BaseBrowserPackagerFactory
23605
23900
  };
23606
23901
 
23607
- //# debugId=6A536864E6CCE89D64756E2164756E21
23902
+ //# debugId=261495522C28062064756E2164756E21
package/dist/index.js CHANGED
@@ -22587,7 +22587,146 @@ class BrowserContextStorage {
22587
22587
  return this.contextStack.length > 0 ? this.contextStack[this.contextStack.length - 1] : undefined;
22588
22588
  }
22589
22589
  }
22590
-
22590
+ function productMode(productArea, mode) {
22591
+ return { product_area: productArea, mode };
22592
+ }
22593
+ function attributionRecord(groups) {
22594
+ const record = {};
22595
+ for (const [productArea, mode, names] of groups) {
22596
+ const attribution = productMode(productArea, mode);
22597
+ for (const name of names) {
22598
+ record[name] = attribution;
22599
+ }
22600
+ }
22601
+ return record;
22602
+ }
22603
+ function commandAttribution(groups) {
22604
+ const entries = [];
22605
+ for (const [productArea, mode, prefixes] of groups) {
22606
+ const attribution = productMode(productArea, mode);
22607
+ for (const prefix of prefixes) {
22608
+ entries.push({ prefix, attribution });
22609
+ }
22610
+ }
22611
+ return entries;
22612
+ }
22613
+ var SKILL_ATTRIBUTION = attributionRecord([
22614
+ ["admin", "operate", ["uipath-admin"]],
22615
+ ["agents", "build", ["uipath-agents"]],
22616
+ ["api-workflow", "build", ["uipath-api-workflow"]],
22617
+ ["automation-discovery", "build", ["uipath-automation-discovery"]],
22618
+ ["coded-apps", "build", ["uipath-coded-apps"]],
22619
+ ["data-fabric", "operate", ["uipath-data-fabric"]],
22620
+ ["cli", "troubleshoot", ["uipath-feedback"]],
22621
+ ["governance", "operate", ["uipath-governance"]],
22622
+ ["action-center", "build", ["uipath-human-in-the-loop"]],
22623
+ ["document-understanding", "build", ["uipath-ixp"]],
22624
+ [
22625
+ "maestro",
22626
+ "build",
22627
+ ["uipath-maestro-bpmn", "uipath-maestro-case", "uipath-maestro-flow"]
22628
+ ],
22629
+ ["agenthub", "build", ["uipath-mcp-servers"]],
22630
+ ["solution", "build", ["uipath-planner", "uipath-solution"]],
22631
+ ["platform", "operate", ["uipath-platform"]],
22632
+ ["quality", "troubleshoot", ["uipath-review"]],
22633
+ ["rpa", "build", ["uipath-rpa"]],
22634
+ ["cli", "operate", ["uipath-skill-catalog"]],
22635
+ ["action-center", "operate", ["uipath-tasks"]],
22636
+ ["test-manager", "operate", ["uipath-test"]],
22637
+ ["platform", "troubleshoot", ["uipath-troubleshoot"]]
22638
+ ]);
22639
+ var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
22640
+ var COMMAND_ATTRIBUTION = commandAttribution([
22641
+ ["cli", "troubleshoot", ["uip.feedback"]],
22642
+ ["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
22643
+ ["context-grounding", "build", ["uip.context-grounding"]],
22644
+ ["api-workflow", "build", ["uip.api-workflow"]],
22645
+ ["rpa", "build", ["uip.rpa-legacy"]],
22646
+ ["conversational", "operate", ["uip.conversational"]],
22647
+ ["agents", "build", ["uip.codedagent", "uip.agent"]],
22648
+ ["agenthub", "build", ["uip.agenthub"]],
22649
+ ["coded-apps", "build", ["uip.codedapp"]],
22650
+ ["functions", "build", ["uip.functions"]],
22651
+ ["solution", "build", ["uip.solution"]],
22652
+ ["maestro", "build", ["uip.maestro", "uip.case", "uip.flow"]],
22653
+ ["llm-observability", "troubleshoot", ["uip.traces"]],
22654
+ ["platform", "operate", ["uip.platform"]],
22655
+ ["admin", "operate", ["uip.admin"]],
22656
+ ["automation-ops", "operate", ["uip.aops"]],
22657
+ ["documentation", "troubleshoot", ["uip.docsai"]],
22658
+ ["governance", "operate", ["uip.gov"]],
22659
+ ["insights", "operate", ["uip.insights"]],
22660
+ ["document-understanding", "build", ["uip.ixp"]],
22661
+ ["process-mining", "operate", ["uip.pm"]],
22662
+ ["action-center", "operate", ["uip.tasks"]],
22663
+ ["test-manager", "operate", ["uip.tm"]],
22664
+ ["vertical-solutions", "build", ["uip.vss"]],
22665
+ ["data-fabric", "operate", ["uip.df"]],
22666
+ ["integration-service", "build", ["uip.is"]],
22667
+ ["orchestrator", "operate", ["uip.or"]],
22668
+ [
22669
+ "cli",
22670
+ "operate",
22671
+ [
22672
+ "uip.login",
22673
+ "uip.logout",
22674
+ "uip.user",
22675
+ "uip.config",
22676
+ "uip.tools",
22677
+ "uip.skills",
22678
+ "uip.completion",
22679
+ "uip.update",
22680
+ "uip.mcp",
22681
+ "uip.track"
22682
+ ]
22683
+ ]
22684
+ ]).sort((a, b) => b.prefix.length - a.prefix.length);
22685
+ var recordedFailureSlot = singleton("CommandTelemetryFailure");
22686
+ var AUTH_ERROR_CODES = new Set([
22687
+ "authentication_required",
22688
+ "permission_denied"
22689
+ ]);
22690
+ var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
22691
+ var NETWORK_HTTP_ERROR_CODES = new Set([
22692
+ "network_error",
22693
+ "rate_limited",
22694
+ "server_error",
22695
+ "not_found",
22696
+ "method_not_allowed"
22697
+ ]);
22698
+ var TIMEOUT_ERROR_CODES = new Set(["timeout"]);
22699
+ var NETWORK_OS_ERROR_CODES = new Set([
22700
+ "ECONNREFUSED",
22701
+ "ECONNRESET",
22702
+ "ENOTFOUND",
22703
+ "EAI_AGAIN",
22704
+ "EPIPE",
22705
+ "EHOSTUNREACH",
22706
+ "ENETUNREACH",
22707
+ "EAI_FAIL"
22708
+ ]);
22709
+ var TIMEOUT_OS_ERROR_CODES = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
22710
+ var TLS_ERROR_CODES2 = new Set([
22711
+ "SELF_SIGNED_CERT_IN_CHAIN",
22712
+ "DEPTH_ZERO_SELF_SIGNED_CERT",
22713
+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
22714
+ "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
22715
+ "UNABLE_TO_GET_ISSUER_CERT",
22716
+ "CERT_HAS_EXPIRED",
22717
+ "CERT_UNTRUSTED",
22718
+ "ERR_TLS_CERT_ALTNAME_INVALID"
22719
+ ]);
22720
+ var MISSING_DEPENDENCY_CODES = new Set([
22721
+ "MODULE_NOT_FOUND",
22722
+ "ERR_MODULE_NOT_FOUND"
22723
+ ]);
22724
+ var INTERNAL_ERROR_NAMES = new Set([
22725
+ "TypeError",
22726
+ "ReferenceError",
22727
+ "SyntaxError",
22728
+ "RangeError"
22729
+ ]);
22591
22730
  class ConsoleTelemetryProvider {
22592
22731
  async trackEvent(eventName, _properties) {
22593
22732
  console.debug(`[Telemetry] Event: ${eventName}`);
@@ -22602,6 +22741,152 @@ class ConsoleTelemetryProvider {
22602
22741
  console.debug(`[Telemetry] Dependency: ${name} [${type}] (${duration}ms, ${success ? "ok" : "fail"})`);
22603
22742
  }
22604
22743
  }
22744
+ var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
22745
+ var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
22746
+ var telemetrySessionIdSlot = singleton("TelemetrySessionId");
22747
+ function getProcessEnv() {
22748
+ return globalThis.process?.env;
22749
+ }
22750
+ function normalizeSessionId(value) {
22751
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
22752
+ return;
22753
+ }
22754
+ const trimmed = String(value).trim();
22755
+ return trimmed || undefined;
22756
+ }
22757
+ function getConfiguredTelemetrySessionId() {
22758
+ return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
22759
+ }
22760
+ function resolveTelemetrySessionId(existingSessionId) {
22761
+ return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
22762
+ }
22763
+ var KNOWN_AGENTS = [
22764
+ { envVar: "CLAUDECODE", value: "1", id: "claude-code" },
22765
+ { envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
22766
+ { envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
22767
+ { envVar: "CODEX_THREAD_ID", id: "codex" },
22768
+ { envVar: "CODEX_SANDBOX", id: "codex" },
22769
+ { envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
22770
+ { envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
22771
+ ];
22772
+ function detectAgentFromEnv(env2) {
22773
+ for (const agent of KNOWN_AGENTS) {
22774
+ const envValue = env2[agent.envVar];
22775
+ if (agent.value !== undefined) {
22776
+ if (envValue === agent.value)
22777
+ return agent.id;
22778
+ } else {
22779
+ if (envValue)
22780
+ return agent.id;
22781
+ }
22782
+ }
22783
+ const agentEnv = env2.AGENT;
22784
+ if (agentEnv) {
22785
+ if (agentEnv === "1" || agentEnv === "true")
22786
+ return "unknown";
22787
+ if (agentEnv.length <= 32)
22788
+ return agentEnv.toLowerCase();
22789
+ }
22790
+ return;
22791
+ }
22792
+ var authSignalSlot = singleton("TelemetryExecutionContextAuthSignal");
22793
+ var isTruthy = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false";
22794
+ var isEqual = (value, expected) => value?.toLowerCase() === expected;
22795
+ var CI_SIGNATURES = [
22796
+ {
22797
+ provider: "github_actions",
22798
+ matches: (env2) => isTruthy(env2.GITHUB_ACTIONS),
22799
+ isScheduler: (env2) => env2.GITHUB_EVENT_NAME === "schedule"
22800
+ },
22801
+ {
22802
+ provider: "azure_devops",
22803
+ matches: (env2) => isTruthy(env2.TF_BUILD),
22804
+ isScheduler: (env2) => isEqual(env2.BUILD_REASON, "schedule")
22805
+ },
22806
+ {
22807
+ provider: "gitlab",
22808
+ matches: (env2) => isTruthy(env2.GITLAB_CI),
22809
+ isScheduler: (env2) => env2.CI_PIPELINE_SOURCE === "schedule"
22810
+ },
22811
+ {
22812
+ provider: "circleci",
22813
+ matches: (env2) => isTruthy(env2.CIRCLECI),
22814
+ isScheduler: (env2) => env2.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
22815
+ },
22816
+ {
22817
+ provider: "jenkins",
22818
+ matches: (env2) => isTruthy(env2.JENKINS_URL) || isTruthy(env2.JENKINS_HOME)
22819
+ },
22820
+ {
22821
+ provider: "teamcity",
22822
+ matches: (env2) => isTruthy(env2.TEAMCITY_VERSION)
22823
+ },
22824
+ {
22825
+ provider: "buildkite",
22826
+ matches: (env2) => isTruthy(env2.BUILDKITE),
22827
+ isScheduler: (env2) => env2.BUILDKITE_SOURCE === "schedule"
22828
+ },
22829
+ {
22830
+ provider: "bitbucket",
22831
+ matches: (env2) => isTruthy(env2.BITBUCKET_BUILD_NUMBER)
22832
+ },
22833
+ {
22834
+ provider: "travis",
22835
+ matches: (env2) => isTruthy(env2.TRAVIS)
22836
+ },
22837
+ {
22838
+ provider: "appveyor",
22839
+ matches: (env2) => isTruthy(env2.APPVEYOR)
22840
+ },
22841
+ {
22842
+ provider: "generic",
22843
+ matches: (env2) => isTruthy(env2.CI)
22844
+ }
22845
+ ];
22846
+ function currentEnv() {
22847
+ return typeof process === "undefined" ? {} : process.env;
22848
+ }
22849
+ function currentTtyState() {
22850
+ if (typeof process === "undefined")
22851
+ return false;
22852
+ return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
22853
+ }
22854
+ function detectCi(env2) {
22855
+ const signature = CI_SIGNATURES.find((candidate) => candidate.matches(env2));
22856
+ if (!signature)
22857
+ return;
22858
+ return {
22859
+ executionContext: signature.isScheduler?.(env2) ? "scheduler" : "ci",
22860
+ ciProvider: signature.provider
22861
+ };
22862
+ }
22863
+ function detectExecutionContext(options = {}) {
22864
+ const env2 = options.env ?? currentEnv();
22865
+ const ci = detectCi(env2);
22866
+ if (ci)
22867
+ return ci;
22868
+ const agent = options.agent ?? detectAgentFromEnv(env2);
22869
+ if (agent) {
22870
+ return { executionContext: "agent" };
22871
+ }
22872
+ const authSignal = options.authSignal ?? authSignalSlot.get();
22873
+ if (authSignal === "service_account") {
22874
+ return { executionContext: "service_account" };
22875
+ }
22876
+ const isTty = options.isTty ?? currentTtyState();
22877
+ if (isTty) {
22878
+ return { executionContext: "manual" };
22879
+ }
22880
+ return { executionContext: "unknown" };
22881
+ }
22882
+ function getExecutionContextTelemetryProperties() {
22883
+ const detected = detectExecutionContext();
22884
+ return {
22885
+ execution_context: detected.executionContext,
22886
+ ...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
22887
+ };
22888
+ }
22889
+
22605
22890
  class TelemetryService {
22606
22891
  telemetryProvider;
22607
22892
  contextStorage;
@@ -22679,12 +22964,22 @@ class TelemetryService {
22679
22964
  return this.contextStorage.getContext();
22680
22965
  }
22681
22966
  enrichPropertiesWithContext(properties, context) {
22682
- return {
22683
- ...getGlobalTelemetryProperties(),
22967
+ const globalProperties = getGlobalTelemetryProperties();
22968
+ const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
22969
+ const sessionId = resolveTelemetrySessionId(existingSessionId);
22970
+ const enriched = {
22971
+ ...getExecutionContextTelemetryProperties(),
22972
+ ...globalProperties,
22684
22973
  ...this.defaultProperties,
22685
22974
  ...properties,
22686
22975
  ...context
22687
22976
  };
22977
+ if (sessionId === undefined) {
22978
+ delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
22979
+ } else {
22980
+ enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
22981
+ }
22982
+ return enriched;
22688
22983
  }
22689
22984
  generateId() {
22690
22985
  return crypto.randomUUID().replaceAll("-", "");
@@ -23024,7 +23319,7 @@ import { translate as translate3 } from "@uipath/solutionpackager-tool-core";
23024
23319
  var package_default = {
23025
23320
  name: "@uipath/project-packager",
23026
23321
  license: "MIT",
23027
- version: "1.197.0-preview.64",
23322
+ version: "1.197.0-preview.66",
23028
23323
  description: "UiPath Project Packager - core library for packing individual UiPath projects",
23029
23324
  type: "module",
23030
23325
  main: "./dist/index.js",
@@ -24221,4 +24516,4 @@ export {
24221
24516
  BrowserContextStorage
24222
24517
  };
24223
24518
 
24224
- //# debugId=3FE0CD8B1498AF4364756E2164756E21
24519
+ //# debugId=1C7757C20B40434C64756E2164756E21
package/dist/node.js CHANGED
@@ -9201,8 +9201,225 @@ function getOutputFormat() {
9201
9201
  function getOutputFilter() {
9202
9202
  return filterSlot.get();
9203
9203
  }
9204
+ var recordedFailureSlot = singleton("CommandTelemetryFailure");
9205
+ var AUTH_ERROR_CODES = new Set([
9206
+ "authentication_required",
9207
+ "permission_denied"
9208
+ ]);
9209
+ var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
9210
+ var NETWORK_HTTP_ERROR_CODES = new Set([
9211
+ "network_error",
9212
+ "rate_limited",
9213
+ "server_error",
9214
+ "not_found",
9215
+ "method_not_allowed"
9216
+ ]);
9217
+ var TIMEOUT_ERROR_CODES = new Set(["timeout"]);
9218
+ var NETWORK_OS_ERROR_CODES = new Set([
9219
+ "ECONNREFUSED",
9220
+ "ECONNRESET",
9221
+ "ENOTFOUND",
9222
+ "EAI_AGAIN",
9223
+ "EPIPE",
9224
+ "EHOSTUNREACH",
9225
+ "ENETUNREACH",
9226
+ "EAI_FAIL"
9227
+ ]);
9228
+ var TIMEOUT_OS_ERROR_CODES = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
9229
+ var TLS_ERROR_CODES2 = new Set([
9230
+ "SELF_SIGNED_CERT_IN_CHAIN",
9231
+ "DEPTH_ZERO_SELF_SIGNED_CERT",
9232
+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
9233
+ "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
9234
+ "UNABLE_TO_GET_ISSUER_CERT",
9235
+ "CERT_HAS_EXPIRED",
9236
+ "CERT_UNTRUSTED",
9237
+ "ERR_TLS_CERT_ALTNAME_INVALID"
9238
+ ]);
9239
+ var MISSING_DEPENDENCY_CODES = new Set([
9240
+ "MODULE_NOT_FOUND",
9241
+ "ERR_MODULE_NOT_FOUND"
9242
+ ]);
9243
+ var INTERNAL_ERROR_NAMES = new Set([
9244
+ "TypeError",
9245
+ "ReferenceError",
9246
+ "SyntaxError",
9247
+ "RangeError"
9248
+ ]);
9249
+ function isRecord(value) {
9250
+ return value !== null && typeof value === "object";
9251
+ }
9252
+ function stringField(value, field) {
9253
+ if (!isRecord(value)) {
9254
+ return;
9255
+ }
9256
+ const raw = value[field];
9257
+ return typeof raw === "string" ? raw : undefined;
9258
+ }
9259
+ function numberField(value, field) {
9260
+ if (!isRecord(value)) {
9261
+ return;
9262
+ }
9263
+ const raw = value[field];
9264
+ return typeof raw === "number" ? raw : undefined;
9265
+ }
9266
+ function findStringInCauseChain(error, field) {
9267
+ let current = error;
9268
+ for (let depth = 0;depth < 5 && current !== null && typeof current === "object"; depth++) {
9269
+ const value = stringField(current, field);
9270
+ if (value) {
9271
+ return value;
9272
+ }
9273
+ current = current.cause;
9274
+ }
9275
+ return;
9276
+ }
9277
+ function findCodeInCauseChain(error) {
9278
+ return findStringInCauseChain(error, "code");
9279
+ }
9280
+ function isSpawnEnoent(error) {
9281
+ const code = findCodeInCauseChain(error);
9282
+ if (code !== "ENOENT") {
9283
+ return false;
9284
+ }
9285
+ const syscall = findStringInCauseChain(error, "syscall");
9286
+ return syscall?.startsWith("spawn") === true;
9287
+ }
9288
+ function isCancellationError(error, exitCode, pollSignal) {
9289
+ if (exitCode === 130) {
9290
+ return true;
9291
+ }
9292
+ if (!isRecord(error)) {
9293
+ return false;
9294
+ }
9295
+ if (numberField(error, "exitCode") === 130) {
9296
+ return true;
9297
+ }
9298
+ const name = stringField(error, "name");
9299
+ if (name === "ExitPromptError") {
9300
+ return true;
9301
+ }
9302
+ if (name === "AbortError" && pollSignal?.aborted) {
9303
+ return true;
9304
+ }
9305
+ const message = stringField(error, "message");
9306
+ return message?.includes("SIGINT") === true;
9307
+ }
9308
+ function terminalSignalFor(input, outcome) {
9309
+ if (input.recordedFailure?.terminalSignal) {
9310
+ return input.recordedFailure.terminalSignal;
9311
+ }
9312
+ const explicit = findStringInCauseChain(input.error, "terminalSignal") ?? findStringInCauseChain(input.error, "signal");
9313
+ if (explicit) {
9314
+ return explicit;
9315
+ }
9316
+ return outcome === "cancelled" ? "SIGINT" : undefined;
9317
+ }
9318
+ function classifyHttpStatus(status) {
9319
+ if (status === 401 || status === 403) {
9320
+ return "auth";
9321
+ }
9322
+ if (status === 400 || status === 409 || status === 422) {
9323
+ return "validation";
9324
+ }
9325
+ if (status === 408) {
9326
+ return "timeout";
9327
+ }
9328
+ return "network_http";
9329
+ }
9330
+ function classifyFromResult(result) {
9331
+ switch (result) {
9332
+ case "AuthenticationError":
9333
+ return "auth";
9334
+ case "ValidationError":
9335
+ return "validation";
9336
+ case "TimeoutError":
9337
+ return "timeout";
9338
+ default:
9339
+ return;
9340
+ }
9341
+ }
9342
+ function classifyFromErrorCode(errorCode) {
9343
+ if (!errorCode) {
9344
+ return;
9345
+ }
9346
+ if (AUTH_ERROR_CODES.has(errorCode)) {
9347
+ return "auth";
9348
+ }
9349
+ if (VALIDATION_ERROR_CODES.has(errorCode)) {
9350
+ return "validation";
9351
+ }
9352
+ if (TIMEOUT_ERROR_CODES.has(errorCode)) {
9353
+ return "timeout";
9354
+ }
9355
+ if (NETWORK_HTTP_ERROR_CODES.has(errorCode)) {
9356
+ return "network_http";
9357
+ }
9358
+ return;
9359
+ }
9360
+ function classifyFromError(error) {
9361
+ const code = findCodeInCauseChain(error);
9362
+ if (code) {
9363
+ if (code.startsWith("commander.")) {
9364
+ return "validation";
9365
+ }
9366
+ if (NETWORK_OS_ERROR_CODES.has(code) || TLS_ERROR_CODES2.has(code)) {
9367
+ return "network_http";
9368
+ }
9369
+ if (TIMEOUT_OS_ERROR_CODES.has(code)) {
9370
+ return "timeout";
9371
+ }
9372
+ if (MISSING_DEPENDENCY_CODES.has(code) || isSpawnEnoent(error)) {
9373
+ return "missing_dependency";
9374
+ }
9375
+ }
9376
+ const message = stringField(error, "message");
9377
+ if (message?.includes("fetch failed") === true) {
9378
+ return "network_http";
9379
+ }
9380
+ const name = stringField(error, "name");
9381
+ if (name && INTERNAL_ERROR_NAMES.has(name)) {
9382
+ return "internal";
9383
+ }
9384
+ return;
9385
+ }
9386
+ function classifyError2(input) {
9387
+ const recorded = input.recordedFailure;
9388
+ if (recorded?.errorClass) {
9389
+ return recorded.errorClass;
9390
+ }
9391
+ const status = recorded?.context?.httpStatus;
9392
+ if (status !== undefined) {
9393
+ return classifyHttpStatus(status);
9394
+ }
9395
+ return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
9396
+ }
9397
+ function recordCommandFailureTelemetry(failure) {
9398
+ recordedFailureSlot.set(failure);
9399
+ }
9400
+ function clearRecordedCommandFailureTelemetry() {
9401
+ recordedFailureSlot.clear();
9402
+ }
9403
+ function takeRecordedCommandFailureTelemetry() {
9404
+ const failure = recordedFailureSlot.get();
9405
+ recordedFailureSlot.clear();
9406
+ return failure;
9407
+ }
9408
+ function buildCommandTerminalTelemetryProperties(input) {
9409
+ const cancelled = isCancellationError(input.error, input.exitCode, input.pollSignal);
9410
+ const outcome = input.recordedFailure?.terminalOutcome ?? (input.exitCode === 0 ? "success" : cancelled ? "cancelled" : "failure");
9411
+ const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError2(input);
9412
+ const terminalSignal = terminalSignalFor(input, outcome);
9413
+ return {
9414
+ exit_code: input.exitCode,
9415
+ terminal_outcome: outcome,
9416
+ ...errorClass ? { error_class: errorClass } : {},
9417
+ ...terminalSignal ? { terminal_signal: terminalSignal } : {}
9418
+ };
9419
+ }
9204
9420
  var CommonTelemetryEvents = {
9205
- Error: "uip.error"
9421
+ Error: "uip.error",
9422
+ ShipSucceeded: "ship_succeeded"
9206
9423
  };
9207
9424
  function readRegistryValue(keyPath, valueName) {
9208
9425
  if (process.platform !== "win32") {
@@ -9280,6 +9497,134 @@ class DebugTelemetryProvider {
9280
9497
  logger.debug(`[Telemetry] Dependency: ${name} [${type}] (${duration}ms, ${success ? "ok" : "fail"})`);
9281
9498
  }
9282
9499
  }
9500
+ var KNOWN_AGENTS = [
9501
+ { envVar: "CLAUDECODE", value: "1", id: "claude-code" },
9502
+ { envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
9503
+ { envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
9504
+ { envVar: "CODEX_THREAD_ID", id: "codex" },
9505
+ { envVar: "CODEX_SANDBOX", id: "codex" },
9506
+ { envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
9507
+ { envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
9508
+ ];
9509
+ function detectAgentFromEnv(env) {
9510
+ for (const agent of KNOWN_AGENTS) {
9511
+ const envValue = env[agent.envVar];
9512
+ if (agent.value !== undefined) {
9513
+ if (envValue === agent.value)
9514
+ return agent.id;
9515
+ } else {
9516
+ if (envValue)
9517
+ return agent.id;
9518
+ }
9519
+ }
9520
+ const agentEnv = env.AGENT;
9521
+ if (agentEnv) {
9522
+ if (agentEnv === "1" || agentEnv === "true")
9523
+ return "unknown";
9524
+ if (agentEnv.length <= 32)
9525
+ return agentEnv.toLowerCase();
9526
+ }
9527
+ return;
9528
+ }
9529
+ var LOCAL_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
9530
+ var authSignalSlot = singleton("TelemetryExecutionContextAuthSignal");
9531
+ var isTruthy = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false";
9532
+ var isEqual = (value, expected) => value?.toLowerCase() === expected;
9533
+ var CI_SIGNATURES = [
9534
+ {
9535
+ provider: "github_actions",
9536
+ matches: (env) => isTruthy(env.GITHUB_ACTIONS),
9537
+ isScheduler: (env) => env.GITHUB_EVENT_NAME === "schedule"
9538
+ },
9539
+ {
9540
+ provider: "azure_devops",
9541
+ matches: (env) => isTruthy(env.TF_BUILD),
9542
+ isScheduler: (env) => isEqual(env.BUILD_REASON, "schedule")
9543
+ },
9544
+ {
9545
+ provider: "gitlab",
9546
+ matches: (env) => isTruthy(env.GITLAB_CI),
9547
+ isScheduler: (env) => env.CI_PIPELINE_SOURCE === "schedule"
9548
+ },
9549
+ {
9550
+ provider: "circleci",
9551
+ matches: (env) => isTruthy(env.CIRCLECI),
9552
+ isScheduler: (env) => env.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
9553
+ },
9554
+ {
9555
+ provider: "jenkins",
9556
+ matches: (env) => isTruthy(env.JENKINS_URL) || isTruthy(env.JENKINS_HOME)
9557
+ },
9558
+ {
9559
+ provider: "teamcity",
9560
+ matches: (env) => isTruthy(env.TEAMCITY_VERSION)
9561
+ },
9562
+ {
9563
+ provider: "buildkite",
9564
+ matches: (env) => isTruthy(env.BUILDKITE),
9565
+ isScheduler: (env) => env.BUILDKITE_SOURCE === "schedule"
9566
+ },
9567
+ {
9568
+ provider: "bitbucket",
9569
+ matches: (env) => isTruthy(env.BITBUCKET_BUILD_NUMBER)
9570
+ },
9571
+ {
9572
+ provider: "travis",
9573
+ matches: (env) => isTruthy(env.TRAVIS)
9574
+ },
9575
+ {
9576
+ provider: "appveyor",
9577
+ matches: (env) => isTruthy(env.APPVEYOR)
9578
+ },
9579
+ {
9580
+ provider: "generic",
9581
+ matches: (env) => isTruthy(env.CI)
9582
+ }
9583
+ ];
9584
+ function currentEnv() {
9585
+ return typeof process === "undefined" ? {} : process.env;
9586
+ }
9587
+ function currentTtyState() {
9588
+ if (typeof process === "undefined")
9589
+ return false;
9590
+ return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
9591
+ }
9592
+ function detectCi(env) {
9593
+ const signature = CI_SIGNATURES.find((candidate) => candidate.matches(env));
9594
+ if (!signature)
9595
+ return;
9596
+ return {
9597
+ executionContext: signature.isScheduler?.(env) ? "scheduler" : "ci",
9598
+ ciProvider: signature.provider
9599
+ };
9600
+ }
9601
+ function detectExecutionContext(options = {}) {
9602
+ const env = options.env ?? currentEnv();
9603
+ const ci = detectCi(env);
9604
+ if (ci)
9605
+ return ci;
9606
+ const agent = options.agent ?? detectAgentFromEnv(env);
9607
+ if (agent) {
9608
+ return { executionContext: "agent" };
9609
+ }
9610
+ const authSignal = options.authSignal ?? authSignalSlot.get();
9611
+ if (authSignal === "service_account") {
9612
+ return { executionContext: "service_account" };
9613
+ }
9614
+ const isTty = options.isTty ?? currentTtyState();
9615
+ if (isTty) {
9616
+ return { executionContext: "manual" };
9617
+ }
9618
+ return { executionContext: "unknown" };
9619
+ }
9620
+ function getExecutionContextTelemetryProperties() {
9621
+ const detected = detectExecutionContext();
9622
+ return {
9623
+ execution_context: detected.executionContext,
9624
+ ...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
9625
+ };
9626
+ }
9627
+
9283
9628
  class NodeContextStorage {
9284
9629
  storage = new AsyncLocalStorage;
9285
9630
  run(context, fn) {
@@ -9289,6 +9634,25 @@ class NodeContextStorage {
9289
9634
  return this.storage.getStore();
9290
9635
  }
9291
9636
  }
9637
+ var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
9638
+ var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
9639
+ var telemetrySessionIdSlot = singleton("TelemetrySessionId");
9640
+ function getProcessEnv() {
9641
+ return globalThis.process?.env;
9642
+ }
9643
+ function normalizeSessionId(value) {
9644
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
9645
+ return;
9646
+ }
9647
+ const trimmed = String(value).trim();
9648
+ return trimmed || undefined;
9649
+ }
9650
+ function getConfiguredTelemetrySessionId() {
9651
+ return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
9652
+ }
9653
+ function resolveTelemetrySessionId(existingSessionId) {
9654
+ return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
9655
+ }
9292
9656
  var telemetryPropsSlot = singleton("TelemetryDefaultProps");
9293
9657
  function getGlobalTelemetryProperties() {
9294
9658
  return telemetryPropsSlot.get();
@@ -9371,12 +9735,22 @@ class TelemetryService {
9371
9735
  return this.contextStorage.getContext();
9372
9736
  }
9373
9737
  enrichPropertiesWithContext(properties, context) {
9374
- return {
9375
- ...getGlobalTelemetryProperties(),
9738
+ const globalProperties = getGlobalTelemetryProperties();
9739
+ const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
9740
+ const sessionId = resolveTelemetrySessionId(existingSessionId);
9741
+ const enriched = {
9742
+ ...getExecutionContextTelemetryProperties(),
9743
+ ...globalProperties,
9376
9744
  ...this.defaultProperties,
9377
9745
  ...properties,
9378
9746
  ...context
9379
9747
  };
9748
+ if (sessionId === undefined) {
9749
+ delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
9750
+ } else {
9751
+ enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
9752
+ }
9753
+ return enriched;
9380
9754
  }
9381
9755
  generateId() {
9382
9756
  return crypto.randomUUID().replaceAll("-", "");
@@ -9841,8 +10215,24 @@ var OutputFormatter;
9841
10215
  data.ErrorCode ??= defaultErrorCodeForFailure(data);
9842
10216
  data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
9843
10217
  process.exitCode = EXIT_CODES[data.Result] ?? 1;
9844
- const { SuppressTelemetry, ...envelope } = data;
9845
- if (!SuppressTelemetry) {
10218
+ recordCommandFailureTelemetry({
10219
+ result: data.Result,
10220
+ errorCode: data.ErrorCode,
10221
+ retry: data.Retry,
10222
+ message: data.Message,
10223
+ context: data.Context,
10224
+ exitCode: process.exitCode,
10225
+ errorClass: data.TelemetryErrorClass,
10226
+ terminalOutcome: data.TelemetryTerminalOutcome,
10227
+ terminalSignal: data.TelemetryTerminalSignal
10228
+ });
10229
+ const suppressTelemetry = data.SuppressTelemetry === true;
10230
+ const envelope = { ...data };
10231
+ delete envelope.SuppressTelemetry;
10232
+ delete envelope.TelemetryErrorClass;
10233
+ delete envelope.TelemetryTerminalOutcome;
10234
+ delete envelope.TelemetryTerminalSignal;
10235
+ if (!suppressTelemetry) {
9846
10236
  telemetry.trackEvent(CommonTelemetryEvents.Error, {
9847
10237
  result: data.Result,
9848
10238
  errorCode: data.ErrorCode,
@@ -9904,6 +10294,156 @@ var OutputFormatter;
9904
10294
  }
9905
10295
  OutputFormatter2.formatToString = formatToString;
9906
10296
  })(OutputFormatter ||= {});
10297
+ var LEGACY_SKILL_NAMESPACE = "uipath:";
10298
+ var MAX_SKILL_NAME_LENGTH = 80;
10299
+ var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
10300
+ function productMode(productArea, mode) {
10301
+ return { product_area: productArea, mode };
10302
+ }
10303
+ function attributionRecord(groups) {
10304
+ const record = {};
10305
+ for (const [productArea, mode, names] of groups) {
10306
+ const attribution = productMode(productArea, mode);
10307
+ for (const name of names) {
10308
+ record[name] = attribution;
10309
+ }
10310
+ }
10311
+ return record;
10312
+ }
10313
+ function commandAttribution(groups) {
10314
+ const entries = [];
10315
+ for (const [productArea, mode, prefixes] of groups) {
10316
+ const attribution = productMode(productArea, mode);
10317
+ for (const prefix of prefixes) {
10318
+ entries.push({ prefix, attribution });
10319
+ }
10320
+ }
10321
+ return entries;
10322
+ }
10323
+ var SKILL_ATTRIBUTION = attributionRecord([
10324
+ ["admin", "operate", ["uipath-admin"]],
10325
+ ["agents", "build", ["uipath-agents"]],
10326
+ ["api-workflow", "build", ["uipath-api-workflow"]],
10327
+ ["automation-discovery", "build", ["uipath-automation-discovery"]],
10328
+ ["coded-apps", "build", ["uipath-coded-apps"]],
10329
+ ["data-fabric", "operate", ["uipath-data-fabric"]],
10330
+ ["cli", "troubleshoot", ["uipath-feedback"]],
10331
+ ["governance", "operate", ["uipath-governance"]],
10332
+ ["action-center", "build", ["uipath-human-in-the-loop"]],
10333
+ ["document-understanding", "build", ["uipath-ixp"]],
10334
+ [
10335
+ "maestro",
10336
+ "build",
10337
+ ["uipath-maestro-bpmn", "uipath-maestro-case", "uipath-maestro-flow"]
10338
+ ],
10339
+ ["agenthub", "build", ["uipath-mcp-servers"]],
10340
+ ["solution", "build", ["uipath-planner", "uipath-solution"]],
10341
+ ["platform", "operate", ["uipath-platform"]],
10342
+ ["quality", "troubleshoot", ["uipath-review"]],
10343
+ ["rpa", "build", ["uipath-rpa"]],
10344
+ ["cli", "operate", ["uipath-skill-catalog"]],
10345
+ ["action-center", "operate", ["uipath-tasks"]],
10346
+ ["test-manager", "operate", ["uipath-test"]],
10347
+ ["platform", "troubleshoot", ["uipath-troubleshoot"]]
10348
+ ]);
10349
+ var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
10350
+ var COMMAND_ATTRIBUTION = commandAttribution([
10351
+ ["cli", "troubleshoot", ["uip.feedback"]],
10352
+ ["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
10353
+ ["context-grounding", "build", ["uip.context-grounding"]],
10354
+ ["api-workflow", "build", ["uip.api-workflow"]],
10355
+ ["rpa", "build", ["uip.rpa-legacy"]],
10356
+ ["conversational", "operate", ["uip.conversational"]],
10357
+ ["agents", "build", ["uip.codedagent", "uip.agent"]],
10358
+ ["agenthub", "build", ["uip.agenthub"]],
10359
+ ["coded-apps", "build", ["uip.codedapp"]],
10360
+ ["functions", "build", ["uip.functions"]],
10361
+ ["solution", "build", ["uip.solution"]],
10362
+ ["maestro", "build", ["uip.maestro", "uip.case", "uip.flow"]],
10363
+ ["llm-observability", "troubleshoot", ["uip.traces"]],
10364
+ ["platform", "operate", ["uip.platform"]],
10365
+ ["admin", "operate", ["uip.admin"]],
10366
+ ["automation-ops", "operate", ["uip.aops"]],
10367
+ ["documentation", "troubleshoot", ["uip.docsai"]],
10368
+ ["governance", "operate", ["uip.gov"]],
10369
+ ["insights", "operate", ["uip.insights"]],
10370
+ ["document-understanding", "build", ["uip.ixp"]],
10371
+ ["process-mining", "operate", ["uip.pm"]],
10372
+ ["action-center", "operate", ["uip.tasks"]],
10373
+ ["test-manager", "operate", ["uip.tm"]],
10374
+ ["vertical-solutions", "build", ["uip.vss"]],
10375
+ ["data-fabric", "operate", ["uip.df"]],
10376
+ ["integration-service", "build", ["uip.is"]],
10377
+ ["orchestrator", "operate", ["uip.or"]],
10378
+ [
10379
+ "cli",
10380
+ "operate",
10381
+ [
10382
+ "uip.login",
10383
+ "uip.logout",
10384
+ "uip.user",
10385
+ "uip.config",
10386
+ "uip.tools",
10387
+ "uip.skills",
10388
+ "uip.completion",
10389
+ "uip.update",
10390
+ "uip.mcp",
10391
+ "uip.track"
10392
+ ]
10393
+ ]
10394
+ ]).sort((a, b) => b.prefix.length - a.prefix.length);
10395
+ function normalizeCommandPath(value) {
10396
+ if (typeof value !== "string") {
10397
+ return;
10398
+ }
10399
+ const trimmed = value.trim().toLowerCase();
10400
+ if (!trimmed) {
10401
+ return;
10402
+ }
10403
+ const tokens = trimmed.includes(" ") ? trimmed.split(/\s+/).filter((token) => token.length > 0).filter((token) => !token.startsWith("-")) : trimmed.split(".").filter((token) => token.length > 0);
10404
+ if (tokens.length === 0) {
10405
+ return;
10406
+ }
10407
+ const commandTokens = tokens[0] === "uip" ? tokens : ["uip", ...tokens];
10408
+ return commandTokens.join(".");
10409
+ }
10410
+ function getCommandProductModeAttribution(commandPath) {
10411
+ const normalized = normalizeCommandPath(commandPath);
10412
+ if (!normalized) {
10413
+ return;
10414
+ }
10415
+ return COMMAND_ATTRIBUTION.find(({ prefix }) => normalized === prefix || normalized.startsWith(`${prefix}.`))?.attribution;
10416
+ }
10417
+ function normalizeSkillNameWithOptions(value, options) {
10418
+ if (typeof value !== "string") {
10419
+ return;
10420
+ }
10421
+ const normalized = value.trim().toLowerCase();
10422
+ if (!normalized) {
10423
+ return;
10424
+ }
10425
+ const hasLegacyNamespace = normalized.startsWith(LEGACY_SKILL_NAMESPACE);
10426
+ if (hasLegacyNamespace && !options.allowLegacyNamespace) {
10427
+ return;
10428
+ }
10429
+ const skillName = hasLegacyNamespace ? normalized.slice(LEGACY_SKILL_NAMESPACE.length) : normalized;
10430
+ if (skillName.length > MAX_SKILL_NAME_LENGTH || !SKILL_NAME_PATTERN.test(skillName) || !KNOWN_SKILL_NAMES.has(skillName)) {
10431
+ return;
10432
+ }
10433
+ return skillName;
10434
+ }
10435
+ function normalizeSkillName(value) {
10436
+ return normalizeSkillNameWithOptions(value, {
10437
+ allowLegacyNamespace: false
10438
+ });
10439
+ }
10440
+ function buildCommandTelemetryAttribution(commandPath, skillSource) {
10441
+ const skillName = normalizeSkillName(skillSource);
10442
+ return {
10443
+ ...skillName ? { skill_name: skillName } : {},
10444
+ ...getCommandProductModeAttribution(commandPath)
10445
+ };
10446
+ }
9907
10447
  var REDACTED = "[REDACTED]";
9908
10448
  var MAX_VALUE_LENGTH = 200;
9909
10449
  var SENSITIVE_NAME_TOKENS = new Set([
@@ -10078,6 +10618,12 @@ function commandHelpHint(commandPath) {
10078
10618
  const command = commandPath.replace(/\./g, " ");
10079
10619
  return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
10080
10620
  }
10621
+ function isPromptCancellation(error) {
10622
+ return error instanceof Error && error.name === "ExitPromptError";
10623
+ }
10624
+ function exitCodeFromProcess(fallback) {
10625
+ return typeof process.exitCode === "number" ? process.exitCode : fallback;
10626
+ }
10081
10627
  Command.prototype.trackedAction = function(context, fn, properties) {
10082
10628
  const command = this;
10083
10629
  return this.action(async (...args) => {
@@ -10085,6 +10631,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
10085
10631
  const props = typeof properties === "function" ? properties(...args) : properties;
10086
10632
  const startTime = performance.now();
10087
10633
  let errorMessage;
10634
+ let fallbackExitCode = EXIT_CODES.Success;
10635
+ clearRecordedCommandFailureTelemetry();
10088
10636
  const [error] = await catchError(fn(...args));
10089
10637
  if (error) {
10090
10638
  errorMessage = error instanceof Error ? error.message : String(error);
@@ -10099,6 +10647,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
10099
10647
  const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
10100
10648
  const typedContext = typed.context ?? typed.Context;
10101
10649
  const customContext = isErrorContext(typedContext) ? typedContext : undefined;
10650
+ const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
10651
+ fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
10102
10652
  OutputFormatter.error({
10103
10653
  Result: finalResult,
10104
10654
  ...customErrorCode ? { ErrorCode: customErrorCode } : {},
@@ -10107,16 +10657,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
10107
10657
  ...customRetry ? { Retry: customRetry } : {},
10108
10658
  ...customContext ? { Context: customContext } : {}
10109
10659
  });
10110
- context.exit(EXIT_CODES[finalResult]);
10660
+ context.exit(fallbackExitCode);
10111
10661
  }
10112
10662
  const durationMs = performance.now() - startTime;
10113
- const success = !error && (process.exitCode === undefined || process.exitCode === 0);
10663
+ const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
10664
+ const recordedFailure = takeRecordedCommandFailureTelemetry();
10665
+ const success = !error && exitCode === 0;
10666
+ const terminalTelemetry = buildCommandTerminalTelemetryProperties({
10667
+ error,
10668
+ exitCode,
10669
+ recordedFailure,
10670
+ pollSignal: context.pollSignal
10671
+ });
10114
10672
  telemetry.trackEvent(telemetryName, redactProperties({
10115
10673
  ...extractCommandParams(command),
10116
10674
  ...props,
10675
+ ...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
10117
10676
  command: "true",
10118
10677
  duration: String(durationMs),
10119
10678
  success: String(success),
10679
+ ...terminalTelemetry,
10120
10680
  ...errorMessage ? { errorMessage } : {}
10121
10681
  }));
10122
10682
  });
@@ -10215,6 +10775,7 @@ class ConsoleTelemetryProvider {
10215
10775
  console.debug(`[Telemetry] Dependency: ${name} [${type}] (${duration}ms, ${success ? "ok" : "fail"})`);
10216
10776
  }
10217
10777
  }
10778
+ var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
10218
10779
  var factorySlot = singleton("PackagerFactoryProvider");
10219
10780
  // src/base-node-packager-factory.ts
10220
10781
  import { NodeFileSystem as NodeFileSystem2 } from "@uipath/filesystem";
@@ -11480,7 +12041,7 @@ import { translate as translate9 } from "@uipath/solutionpackager-tool-core";
11480
12041
  var package_default = {
11481
12042
  name: "@uipath/project-packager",
11482
12043
  license: "MIT",
11483
- version: "1.197.0-preview.64",
12044
+ version: "1.197.0-preview.66",
11484
12045
  description: "UiPath Project Packager - core library for packing individual UiPath projects",
11485
12046
  type: "module",
11486
12047
  main: "./dist/index.js",
@@ -11936,4 +12497,4 @@ export {
11936
12497
  BaseNodePackagerFactory
11937
12498
  };
11938
12499
 
11939
- //# debugId=E47B72D2A78FEE2164756E2164756E21
12500
+ //# debugId=9A24780406CD39CA64756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/project-packager",
3
3
  "license": "MIT",
4
- "version": "1.197.0-preview.64",
4
+ "version": "1.197.0-preview.66",
5
5
  "description": "UiPath Project Packager - core library for packing individual UiPath projects",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
@@ -39,5 +39,5 @@
39
39
  "peerDependencies": {
40
40
  "fflate": "^0.8.2"
41
41
  },
42
- "gitHead": "3977b977945bf519336258da69fd271433eaaef4"
42
+ "gitHead": "386b0837882b19062bf744c74949cdf9c5e48dea"
43
43
  }