@uipath/ixp-tool 1.199.0-preview.106 → 1.199.0-preview.108

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/index.js CHANGED
@@ -2146,7 +2146,7 @@ var {
2146
2146
  var package_default = {
2147
2147
  name: "@uipath/ixp-tool",
2148
2148
  license: "MIT",
2149
- version: "1.199.0-preview.106",
2149
+ version: "1.199.0-preview.108",
2150
2150
  description: "Manage UiPath IXP projects, prompts, predictions, and model publishing.",
2151
2151
  private: false,
2152
2152
  repository: {
@@ -2196,4 +2196,4 @@ program2.name("ixp-tool").description("UiPath IXP Tool - Standalone CLI").versio
2196
2196
  await registerCommands(program2);
2197
2197
  program2.parse(process.argv);
2198
2198
 
2199
- //# debugId=61DE591763247C8B64756E2164756E21
2199
+ //# debugId=8E43C5E2E8A7D06164756E2164756E21
package/dist/tool.js CHANGED
@@ -21230,7 +21230,7 @@ var init_server = __esm(() => {
21230
21230
  var package_default = {
21231
21231
  name: "@uipath/ixp-tool",
21232
21232
  license: "MIT",
21233
- version: "1.199.0-preview.106",
21233
+ version: "1.199.0-preview.108",
21234
21234
  description: "Manage UiPath IXP projects, prompts, predictions, and model publishing.",
21235
21235
  private: false,
21236
21236
  repository: {
@@ -27440,8 +27440,18 @@ function getInboundTraceContext() {
27440
27440
 
27441
27441
  // ../common/src/telemetry/session-id.ts
27442
27442
  var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
27443
- var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
27444
- var telemetrySessionIdSlot = singleton("TelemetrySessionId");
27443
+ var SESSION_ID_MAX_LENGTH = 64;
27444
+ var RANDOM_SESSION_ID_LENGTH = 32;
27445
+ var TELEMETRY_SESSION_SOURCE_PROPERTY = "session_id_source";
27446
+ var CONTROL_CHARACTERS = /\p{Cc}/gu;
27447
+ var INHERITED_SESSION_SOURCES = [
27448
+ { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
27449
+ { envVar: "CODEX_THREAD_ID", source: "codex" },
27450
+ { envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
27451
+ { envVar: "TERM_SESSION_ID", source: "terminal" },
27452
+ { envVar: "WT_SESSION", source: "terminal" }
27453
+ ];
27454
+ var telemetrySessionSlot = singleton("TelemetrySession");
27445
27455
  var telemetryOperationIdSlot = singleton("TelemetryOperationId");
27446
27456
  function getProcessEnv2() {
27447
27457
  return globalThis.process?.env;
@@ -27450,14 +27460,42 @@ function normalizeSessionId(value) {
27450
27460
  if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
27451
27461
  return;
27452
27462
  }
27453
- const trimmed = String(value).trim();
27454
- return trimmed || undefined;
27463
+ const cleaned = String(value).replace(CONTROL_CHARACTERS, "").trim().slice(0, SESSION_ID_MAX_LENGTH);
27464
+ return cleaned || undefined;
27455
27465
  }
27456
27466
  function getConfiguredTelemetrySessionId() {
27457
27467
  return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
27458
27468
  }
27459
- function resolveTelemetrySessionId(existingSessionId) {
27460
- return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
27469
+ function getInheritedSession(env) {
27470
+ for (const candidate of INHERITED_SESSION_SOURCES) {
27471
+ const handle = normalizeSessionId(env[candidate.envVar]);
27472
+ if (handle) {
27473
+ return { id: handle, source: candidate.source };
27474
+ }
27475
+ }
27476
+ return;
27477
+ }
27478
+ function generateRandomSession() {
27479
+ const bytes = new Uint8Array(RANDOM_SESSION_ID_LENGTH / 2);
27480
+ crypto.getRandomValues(bytes);
27481
+ let hex = "";
27482
+ for (const byte of bytes) {
27483
+ hex += byte.toString(16).padStart(2, "0");
27484
+ }
27485
+ return { id: hex, source: "random" };
27486
+ }
27487
+ function resolveTelemetrySession() {
27488
+ const existing = telemetrySessionSlot.get();
27489
+ if (existing) {
27490
+ return existing;
27491
+ }
27492
+ const declaredHandle = getConfiguredTelemetrySessionId();
27493
+ const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
27494
+ telemetrySessionSlot.set(resolved);
27495
+ return resolved;
27496
+ }
27497
+ function getTelemetrySessionSource() {
27498
+ return resolveTelemetrySession().source;
27461
27499
  }
27462
27500
  function getTelemetryOperationId() {
27463
27501
  const existing = telemetryOperationIdSlot.get();
@@ -27734,24 +27772,18 @@ class TelemetryService {
27734
27772
  }
27735
27773
  enrichPropertiesWithContext(properties, context) {
27736
27774
  const globalProperties = getGlobalTelemetryProperties();
27737
- const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
27738
- const sessionId = resolveTelemetrySessionId(existingSessionId);
27739
27775
  const enriched = {
27740
27776
  ...getExecutionContextTelemetryProperties(),
27741
27777
  ...globalProperties,
27742
27778
  ...this.defaultProperties,
27743
27779
  ...redactProperties(properties ?? {}),
27780
+ [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
27744
27781
  ...context ? {
27745
27782
  [TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
27746
27783
  ...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
27747
27784
  [TELEMETRY_SPAN_ID_PROPERTY]: context.id
27748
27785
  } : {}
27749
27786
  };
27750
- if (sessionId === undefined) {
27751
- delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
27752
- } else {
27753
- enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
27754
- }
27755
27787
  return enriched;
27756
27788
  }
27757
27789
  generateId() {
@@ -29925,7 +29957,7 @@ init_server();
29925
29957
  var package_default2 = {
29926
29958
  name: "@uipath/ixp-sdk",
29927
29959
  license: "MIT",
29928
- version: "1.199.0-preview.106",
29960
+ version: "1.199.0-preview.108",
29929
29961
  description: "SDK for the UiPath IXP (Intelligent eXtraction Platform) API — projects, taxonomies, prompts, predictions, and model publishing.",
29930
29962
  repository: {
29931
29963
  type: "git",
@@ -32513,4 +32545,4 @@ export {
32513
32545
  metadata
32514
32546
  };
32515
32547
 
32516
- //# debugId=1C977F189394035364756E2164756E21
32548
+ //# debugId=6F86855BFC95AC2E64756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/ixp-tool",
3
3
  "license": "MIT",
4
- "version": "1.199.0-preview.106",
4
+ "version": "1.199.0-preview.108",
5
5
  "description": "Manage UiPath IXP projects, prompts, predictions, and model publishing.",
6
6
  "private": false,
7
7
  "repository": {
@@ -26,5 +26,5 @@
26
26
  "files": [
27
27
  "dist"
28
28
  ],
29
- "gitHead": "cb01f256c2c4f1a1a5d014ffb97e506bac709e45"
29
+ "gitHead": "171f68daab68809916e8df10ea198c259f688ede"
30
30
  }