@uipath/gov-tool 1.199.0-preview.97 → 1.199.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/tool.js +50 -19
  2. package/package.json +2 -2
package/dist/tool.js CHANGED
@@ -21230,7 +21230,7 @@ var require_commander = __commonJS((exports) => {
21230
21230
  var package_default = {
21231
21231
  name: "@uipath/gov-tool",
21232
21232
  license: "MIT",
21233
- version: "1.199.0-preview.97",
21233
+ version: "1.199.0",
21234
21234
  description: "Manage UiPath governance — AOps policies, Access policies, and compliance packs.",
21235
21235
  private: false,
21236
21236
  repository: {
@@ -26754,7 +26754,7 @@ function requireOmap() {
26754
26754
  function resolveYamlOmap(data) {
26755
26755
  if (data === null)
26756
26756
  return true;
26757
- const objectKeys = [];
26757
+ const objectKeys = {};
26758
26758
  const object = data;
26759
26759
  for (let index = 0, length = object.length;index < length; index += 1) {
26760
26760
  const pair = object[index];
@@ -26772,10 +26772,9 @@ function requireOmap() {
26772
26772
  }
26773
26773
  if (!pairHasKey)
26774
26774
  return false;
26775
- if (objectKeys.indexOf(pairKey) === -1)
26776
- objectKeys.push(pairKey);
26777
- else
26775
+ if (_hasOwnProperty.call(objectKeys, pairKey))
26778
26776
  return false;
26777
+ Object.defineProperty(objectKeys, pairKey, { value: true });
26779
26778
  }
26780
26779
  return true;
26781
26780
  }
@@ -29636,8 +29635,18 @@ function getInboundTraceContext() {
29636
29635
 
29637
29636
  // ../../common/src/telemetry/session-id.ts
29638
29637
  var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
29639
- var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
29640
- var telemetrySessionIdSlot = singleton("TelemetrySessionId");
29638
+ var SESSION_ID_MAX_LENGTH = 64;
29639
+ var RANDOM_SESSION_ID_LENGTH = 32;
29640
+ var TELEMETRY_SESSION_SOURCE_PROPERTY = "session_id_source";
29641
+ var CONTROL_CHARACTERS = /\p{Cc}/gu;
29642
+ var INHERITED_SESSION_SOURCES = [
29643
+ { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
29644
+ { envVar: "CODEX_THREAD_ID", source: "codex" },
29645
+ { envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
29646
+ { envVar: "TERM_SESSION_ID", source: "terminal" },
29647
+ { envVar: "WT_SESSION", source: "terminal" }
29648
+ ];
29649
+ var telemetrySessionSlot = singleton("TelemetrySession");
29641
29650
  var telemetryOperationIdSlot = singleton("TelemetryOperationId");
29642
29651
  function getProcessEnv2() {
29643
29652
  return globalThis.process?.env;
@@ -29646,14 +29655,42 @@ function normalizeSessionId(value) {
29646
29655
  if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
29647
29656
  return;
29648
29657
  }
29649
- const trimmed = String(value).trim();
29650
- return trimmed || undefined;
29658
+ const cleaned = String(value).replace(CONTROL_CHARACTERS, "").trim().slice(0, SESSION_ID_MAX_LENGTH);
29659
+ return cleaned || undefined;
29651
29660
  }
29652
29661
  function getConfiguredTelemetrySessionId() {
29653
29662
  return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
29654
29663
  }
29655
- function resolveTelemetrySessionId(existingSessionId) {
29656
- return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
29664
+ function getInheritedSession(env) {
29665
+ for (const candidate of INHERITED_SESSION_SOURCES) {
29666
+ const handle = normalizeSessionId(env[candidate.envVar]);
29667
+ if (handle) {
29668
+ return { id: handle, source: candidate.source };
29669
+ }
29670
+ }
29671
+ return;
29672
+ }
29673
+ function generateRandomSession() {
29674
+ const bytes = new Uint8Array(RANDOM_SESSION_ID_LENGTH / 2);
29675
+ crypto.getRandomValues(bytes);
29676
+ let hex = "";
29677
+ for (const byte of bytes) {
29678
+ hex += byte.toString(16).padStart(2, "0");
29679
+ }
29680
+ return { id: hex, source: "random" };
29681
+ }
29682
+ function resolveTelemetrySession() {
29683
+ const existing = telemetrySessionSlot.get();
29684
+ if (existing) {
29685
+ return existing;
29686
+ }
29687
+ const declaredHandle = getConfiguredTelemetrySessionId();
29688
+ const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
29689
+ telemetrySessionSlot.set(resolved);
29690
+ return resolved;
29691
+ }
29692
+ function getTelemetrySessionSource() {
29693
+ return resolveTelemetrySession().source;
29657
29694
  }
29658
29695
  function getTelemetryOperationId() {
29659
29696
  const existing = telemetryOperationIdSlot.get();
@@ -29924,24 +29961,18 @@ class TelemetryService {
29924
29961
  }
29925
29962
  enrichPropertiesWithContext(properties, context) {
29926
29963
  const globalProperties = getGlobalTelemetryProperties();
29927
- const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
29928
- const sessionId = resolveTelemetrySessionId(existingSessionId);
29929
29964
  const enriched = {
29930
29965
  ...getExecutionContextTelemetryProperties(),
29931
29966
  ...globalProperties,
29932
29967
  ...this.defaultProperties,
29933
29968
  ...redactProperties(properties ?? {}),
29969
+ [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
29934
29970
  ...context ? {
29935
29971
  [TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
29936
29972
  ...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
29937
29973
  [TELEMETRY_SPAN_ID_PROPERTY]: context.id
29938
29974
  } : {}
29939
29975
  };
29940
- if (sessionId === undefined) {
29941
- delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
29942
- } else {
29943
- enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
29944
- }
29945
29976
  return enriched;
29946
29977
  }
29947
29978
  generateId() {
@@ -59505,4 +59536,4 @@ export {
59505
59536
  metadata
59506
59537
  };
59507
59538
 
59508
- //# debugId=C748D462516D7EE064756E2164756E21
59539
+ //# debugId=C9A68116BC32CFFA64756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/gov-tool",
3
3
  "license": "MIT",
4
- "version": "1.199.0-preview.97",
4
+ "version": "1.199.0",
5
5
  "description": "Manage UiPath governance — AOps policies, Access policies, and compliance packs.",
6
6
  "private": false,
7
7
  "repository": {
@@ -23,5 +23,5 @@
23
23
  "files": [
24
24
  "dist"
25
25
  ],
26
- "gitHead": "087ae21e842f27bde5eb0013892c9487bfe60568"
26
+ "gitHead": "723e6801b77b5926ba75e75b6a756cc38b1b7adc"
27
27
  }