@uipath/docsai-tool 1.199.0-preview.99 → 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 +71 -20
  2. package/package.json +2 -2
package/dist/tool.js CHANGED
@@ -24741,7 +24741,12 @@ var require_fast_uri = __commonJS((exports, module) => {
24741
24741
  }
24742
24742
  function resolve2(baseURI, relativeURI, options) {
24743
24743
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
24744
- const resolved = resolveComponent(parse5(baseURI, schemelessOptions), parse5(relativeURI, schemelessOptions), schemelessOptions, true);
24744
+ const { parsed: baseParsed, malformedAuthorityOrPort: baseMalformed } = parseWithStatus(baseURI, schemelessOptions);
24745
+ const { parsed: relativeParsed, malformedAuthorityOrPort: relativeMalformed } = parseWithStatus(relativeURI, schemelessOptions);
24746
+ if (baseMalformed || relativeMalformed) {
24747
+ throw new Error(baseParsed.error || relativeParsed.error || "URI is malformed.");
24748
+ }
24749
+ const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true);
24745
24750
  schemelessOptions.skipEscape = true;
24746
24751
  return serialize(resolved, schemelessOptions);
24747
24752
  }
@@ -24868,6 +24873,7 @@ var require_fast_uri = __commonJS((exports, module) => {
24868
24873
  }
24869
24874
  var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
24870
24875
  var AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/;
24876
+ var AUTHORITY_INTRODUCER_REGION = /^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;
24871
24877
  function getParseError(parsed, matches) {
24872
24878
  if (matches[2] !== undefined && parsed.path && parsed.path[0] !== "/") {
24873
24879
  return 'URI path must start with "/" when authority is present.';
@@ -24902,6 +24908,20 @@ var require_fast_uri = __commonJS((exports, module) => {
24902
24908
  parsed.error = "URI authority must not contain a literal backslash.";
24903
24909
  malformedAuthorityOrPort = true;
24904
24910
  }
24911
+ const introducerMatch = uri.match(AUTHORITY_INTRODUCER_REGION);
24912
+ if (introducerMatch !== null) {
24913
+ const region = introducerMatch[1];
24914
+ const normalizedRegion = region.replace(/[\t\n\r]/g, "");
24915
+ if (normalizedRegion.length >= 2) {
24916
+ if (normalizedRegion.slice(0, 2) !== "//") {
24917
+ parsed.error = parsed.error || "URI authority must not contain a literal backslash.";
24918
+ malformedAuthorityOrPort = true;
24919
+ } else if (region.length !== normalizedRegion.length) {
24920
+ parsed.error = parsed.error || "URI authority introducer must not contain whitespace.";
24921
+ malformedAuthorityOrPort = true;
24922
+ }
24923
+ }
24924
+ }
24905
24925
  const matches = uri.match(URI_PARSE);
24906
24926
  if (matches) {
24907
24927
  parsed.scheme = matches[1];
@@ -27808,7 +27828,7 @@ var require_dist2 = __commonJS((exports, module) => {
27808
27828
  var package_default = {
27809
27829
  name: "@uipath/docsai-tool",
27810
27830
  license: "MIT",
27811
- version: "1.199.0-preview.99",
27831
+ version: "1.199.0",
27812
27832
  description: "Search UiPath documentation with AI-powered answers.",
27813
27833
  private: false,
27814
27834
  repository: {
@@ -30869,7 +30889,7 @@ function requireOmap() {
30869
30889
  function resolveYamlOmap(data) {
30870
30890
  if (data === null)
30871
30891
  return true;
30872
- const objectKeys = [];
30892
+ const objectKeys = {};
30873
30893
  const object = data;
30874
30894
  for (let index = 0, length = object.length;index < length; index += 1) {
30875
30895
  const pair = object[index];
@@ -30887,10 +30907,9 @@ function requireOmap() {
30887
30907
  }
30888
30908
  if (!pairHasKey)
30889
30909
  return false;
30890
- if (objectKeys.indexOf(pairKey) === -1)
30891
- objectKeys.push(pairKey);
30892
- else
30910
+ if (_hasOwnProperty.call(objectKeys, pairKey))
30893
30911
  return false;
30912
+ Object.defineProperty(objectKeys, pairKey, { value: true });
30894
30913
  }
30895
30914
  return true;
30896
30915
  }
@@ -33751,8 +33770,18 @@ function getInboundTraceContext() {
33751
33770
 
33752
33771
  // ../common/src/telemetry/session-id.ts
33753
33772
  var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
33754
- var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
33755
- var telemetrySessionIdSlot = singleton("TelemetrySessionId");
33773
+ var SESSION_ID_MAX_LENGTH = 64;
33774
+ var RANDOM_SESSION_ID_LENGTH = 32;
33775
+ var TELEMETRY_SESSION_SOURCE_PROPERTY = "session_id_source";
33776
+ var CONTROL_CHARACTERS = /\p{Cc}/gu;
33777
+ var INHERITED_SESSION_SOURCES = [
33778
+ { envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
33779
+ { envVar: "CODEX_THREAD_ID", source: "codex" },
33780
+ { envVar: "ANTIGRAVITY_TRAJECTORY_ID", source: "antigravity" },
33781
+ { envVar: "TERM_SESSION_ID", source: "terminal" },
33782
+ { envVar: "WT_SESSION", source: "terminal" }
33783
+ ];
33784
+ var telemetrySessionSlot = singleton("TelemetrySession");
33756
33785
  var telemetryOperationIdSlot = singleton("TelemetryOperationId");
33757
33786
  function getProcessEnv2() {
33758
33787
  return globalThis.process?.env;
@@ -33761,14 +33790,42 @@ function normalizeSessionId(value) {
33761
33790
  if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
33762
33791
  return;
33763
33792
  }
33764
- const trimmed = String(value).trim();
33765
- return trimmed || undefined;
33793
+ const cleaned = String(value).replace(CONTROL_CHARACTERS, "").trim().slice(0, SESSION_ID_MAX_LENGTH);
33794
+ return cleaned || undefined;
33766
33795
  }
33767
33796
  function getConfiguredTelemetrySessionId() {
33768
33797
  return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
33769
33798
  }
33770
- function resolveTelemetrySessionId(existingSessionId) {
33771
- return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
33799
+ function getInheritedSession(env) {
33800
+ for (const candidate of INHERITED_SESSION_SOURCES) {
33801
+ const handle = normalizeSessionId(env[candidate.envVar]);
33802
+ if (handle) {
33803
+ return { id: handle, source: candidate.source };
33804
+ }
33805
+ }
33806
+ return;
33807
+ }
33808
+ function generateRandomSession() {
33809
+ const bytes = new Uint8Array(RANDOM_SESSION_ID_LENGTH / 2);
33810
+ crypto.getRandomValues(bytes);
33811
+ let hex = "";
33812
+ for (const byte of bytes) {
33813
+ hex += byte.toString(16).padStart(2, "0");
33814
+ }
33815
+ return { id: hex, source: "random" };
33816
+ }
33817
+ function resolveTelemetrySession() {
33818
+ const existing = telemetrySessionSlot.get();
33819
+ if (existing) {
33820
+ return existing;
33821
+ }
33822
+ const declaredHandle = getConfiguredTelemetrySessionId();
33823
+ const resolved = declaredHandle ? { id: declaredHandle, source: "declared" } : getInheritedSession(getProcessEnv2() ?? {}) ?? generateRandomSession();
33824
+ telemetrySessionSlot.set(resolved);
33825
+ return resolved;
33826
+ }
33827
+ function getTelemetrySessionSource() {
33828
+ return resolveTelemetrySession().source;
33772
33829
  }
33773
33830
  function getTelemetryOperationId() {
33774
33831
  const existing = telemetryOperationIdSlot.get();
@@ -34045,24 +34102,18 @@ class TelemetryService {
34045
34102
  }
34046
34103
  enrichPropertiesWithContext(properties, context) {
34047
34104
  const globalProperties = getGlobalTelemetryProperties();
34048
- const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
34049
- const sessionId = resolveTelemetrySessionId(existingSessionId);
34050
34105
  const enriched = {
34051
34106
  ...getExecutionContextTelemetryProperties(),
34052
34107
  ...globalProperties,
34053
34108
  ...this.defaultProperties,
34054
34109
  ...redactProperties(properties ?? {}),
34110
+ [TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
34055
34111
  ...context ? {
34056
34112
  [TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
34057
34113
  ...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
34058
34114
  [TELEMETRY_SPAN_ID_PROPERTY]: context.id
34059
34115
  } : {}
34060
34116
  };
34061
- if (sessionId === undefined) {
34062
- delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
34063
- } else {
34064
- enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
34065
- }
34066
34117
  return enriched;
34067
34118
  }
34068
34119
  generateId() {
@@ -45469,4 +45520,4 @@ export {
45469
45520
  metadata
45470
45521
  };
45471
45522
 
45472
- //# debugId=3AFB83C4961D604164756E2164756E21
45523
+ //# debugId=E1EDDE3E8D3E2AF264756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/docsai-tool",
3
3
  "license": "MIT",
4
- "version": "1.199.0-preview.99",
4
+ "version": "1.199.0",
5
5
  "description": "Search UiPath documentation with AI-powered answers.",
6
6
  "private": false,
7
7
  "repository": {
@@ -26,5 +26,5 @@
26
26
  "files": [
27
27
  "dist"
28
28
  ],
29
- "gitHead": "6ba217cddceb86e3fa39ed82e49c5062878a85c6"
29
+ "gitHead": "723e6801b77b5926ba75e75b6a756cc38b1b7adc"
30
30
  }