@uipath/tasks-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
@@ -27310,7 +27310,7 @@ var require_src6 = __commonJS((exports) => {
27310
27310
  var package_default = {
27311
27311
  name: "@uipath/tasks-tool",
27312
27312
  license: "MIT",
27313
- version: "1.199.0-preview.97",
27313
+ version: "1.199.0",
27314
27314
  description: "Manage Action Center tasks.",
27315
27315
  type: "module",
27316
27316
  main: "./dist/tool.js",
@@ -30640,7 +30640,7 @@ function requireOmap() {
30640
30640
  function resolveYamlOmap(data) {
30641
30641
  if (data === null)
30642
30642
  return true;
30643
- const objectKeys = [];
30643
+ const objectKeys = {};
30644
30644
  const object = data;
30645
30645
  for (let index = 0, length = object.length;index < length; index += 1) {
30646
30646
  const pair = object[index];
@@ -30658,10 +30658,9 @@ function requireOmap() {
30658
30658
  }
30659
30659
  if (!pairHasKey)
30660
30660
  return false;
30661
- if (objectKeys.indexOf(pairKey) === -1)
30662
- objectKeys.push(pairKey);
30663
- else
30661
+ if (_hasOwnProperty.call(objectKeys, pairKey))
30664
30662
  return false;
30663
+ Object.defineProperty(objectKeys, pairKey, { value: true });
30665
30664
  }
30666
30665
  return true;
30667
30666
  }
@@ -33522,8 +33521,18 @@ function getInboundTraceContext() {
33522
33521
 
33523
33522
  // ../common/src/telemetry/session-id.ts
33524
33523
  var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
33525
- var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
33526
- var telemetrySessionIdSlot = singleton("TelemetrySessionId");
33524
+ var SESSION_ID_MAX_LENGTH = 64;
33525
+ var RANDOM_SESSION_ID_LENGTH = 32;
33526
+ var TELEMETRY_SESSION_SOURCE_PROPERTY = "session_id_source";
33527
+ var CONTROL_CHARACTERS = /\p{Cc}/gu;
33528
+ var INHERITED_SESSION_SOURCES = [
33529
+ { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
33530
+ { envVar: "CODEX_THREAD_ID", source: "codex" },
33531
+ { envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
33532
+ { envVar: "TERM_SESSION_ID", source: "terminal" },
33533
+ { envVar: "WT_SESSION", source: "terminal" }
33534
+ ];
33535
+ var telemetrySessionSlot = singleton("TelemetrySession");
33527
33536
  var telemetryOperationIdSlot = singleton("TelemetryOperationId");
33528
33537
  function getProcessEnv2() {
33529
33538
  return globalThis.process?.env;
@@ -33532,14 +33541,42 @@ function normalizeSessionId(value) {
33532
33541
  if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
33533
33542
  return;
33534
33543
  }
33535
- const trimmed = String(value).trim();
33536
- return trimmed || undefined;
33544
+ const cleaned = String(value).replace(CONTROL_CHARACTERS, "").trim().slice(0, SESSION_ID_MAX_LENGTH);
33545
+ return cleaned || undefined;
33537
33546
  }
33538
33547
  function getConfiguredTelemetrySessionId() {
33539
33548
  return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
33540
33549
  }
33541
- function resolveTelemetrySessionId(existingSessionId) {
33542
- return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
33550
+ function getInheritedSession(env) {
33551
+ for (const candidate of INHERITED_SESSION_SOURCES) {
33552
+ const handle = normalizeSessionId(env[candidate.envVar]);
33553
+ if (handle) {
33554
+ return { id: handle, source: candidate.source };
33555
+ }
33556
+ }
33557
+ return;
33558
+ }
33559
+ function generateRandomSession() {
33560
+ const bytes = new Uint8Array(RANDOM_SESSION_ID_LENGTH / 2);
33561
+ crypto.getRandomValues(bytes);
33562
+ let hex = "";
33563
+ for (const byte of bytes) {
33564
+ hex += byte.toString(16).padStart(2, "0");
33565
+ }
33566
+ return { id: hex, source: "random" };
33567
+ }
33568
+ function resolveTelemetrySession() {
33569
+ const existing = telemetrySessionSlot.get();
33570
+ if (existing) {
33571
+ return existing;
33572
+ }
33573
+ const declaredHandle = getConfiguredTelemetrySessionId();
33574
+ const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
33575
+ telemetrySessionSlot.set(resolved);
33576
+ return resolved;
33577
+ }
33578
+ function getTelemetrySessionSource() {
33579
+ return resolveTelemetrySession().source;
33543
33580
  }
33544
33581
  function getTelemetryOperationId() {
33545
33582
  const existing = telemetryOperationIdSlot.get();
@@ -33816,24 +33853,18 @@ class TelemetryService {
33816
33853
  }
33817
33854
  enrichPropertiesWithContext(properties, context) {
33818
33855
  const globalProperties = getGlobalTelemetryProperties();
33819
- const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
33820
- const sessionId = resolveTelemetrySessionId(existingSessionId);
33821
33856
  const enriched = {
33822
33857
  ...getExecutionContextTelemetryProperties(),
33823
33858
  ...globalProperties,
33824
33859
  ...this.defaultProperties,
33825
33860
  ...redactProperties(properties ?? {}),
33861
+ [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
33826
33862
  ...context ? {
33827
33863
  [TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
33828
33864
  ...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
33829
33865
  [TELEMETRY_SPAN_ID_PROPERTY]: context.id
33830
33866
  } : {}
33831
33867
  };
33832
- if (sessionId === undefined) {
33833
- delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
33834
- } else {
33835
- enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
33836
- }
33837
33868
  return enriched;
33838
33869
  }
33839
33870
  generateId() {
@@ -46849,4 +46880,4 @@ export {
46849
46880
  metadata
46850
46881
  };
46851
46882
 
46852
- //# debugId=4CD2A3A87D0E48CB64756E2164756E21
46883
+ //# debugId=E3BA423C6B5FE1A364756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/tasks-tool",
3
3
  "license": "MIT",
4
- "version": "1.199.0-preview.97",
4
+ "version": "1.199.0",
5
5
  "description": "Manage Action Center tasks.",
6
6
  "type": "module",
7
7
  "main": "./dist/tool.js",
@@ -14,5 +14,5 @@
14
14
  "publishConfig": {
15
15
  "registry": "https://registry.npmjs.org/"
16
16
  },
17
- "gitHead": "087ae21e842f27bde5eb0013892c9487bfe60568"
17
+ "gitHead": "723e6801b77b5926ba75e75b6a756cc38b1b7adc"
18
18
  }