@uipath/docsai-tool 1.198.0-preview.95 → 1.198.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.
- package/dist/tool.js +257 -150
- package/package.json +2 -2
package/dist/tool.js
CHANGED
|
@@ -27808,7 +27808,7 @@ var require_dist2 = __commonJS((exports, module) => {
|
|
|
27808
27808
|
var package_default = {
|
|
27809
27809
|
name: "@uipath/docsai-tool",
|
|
27810
27810
|
license: "MIT",
|
|
27811
|
-
version: "1.198.0
|
|
27811
|
+
version: "1.198.0",
|
|
27812
27812
|
description: "Search UiPath documentation with AI-powered answers.",
|
|
27813
27813
|
private: false,
|
|
27814
27814
|
repository: {
|
|
@@ -33725,11 +33725,36 @@ class NodeContextStorage {
|
|
|
33725
33725
|
return this.storage.getStore();
|
|
33726
33726
|
}
|
|
33727
33727
|
}
|
|
33728
|
+
// ../common/src/telemetry/trace-context.ts
|
|
33729
|
+
var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
|
|
33730
|
+
var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
33731
|
+
function getProcessEnv() {
|
|
33732
|
+
return globalThis.process?.env;
|
|
33733
|
+
}
|
|
33734
|
+
function parseInboundTraceparent(value) {
|
|
33735
|
+
if (!value) {
|
|
33736
|
+
return;
|
|
33737
|
+
}
|
|
33738
|
+
const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
|
|
33739
|
+
if (!match) {
|
|
33740
|
+
return;
|
|
33741
|
+
}
|
|
33742
|
+
const [, traceId, parentSpanId] = match;
|
|
33743
|
+
if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
|
|
33744
|
+
return;
|
|
33745
|
+
}
|
|
33746
|
+
return { traceId, parentSpanId };
|
|
33747
|
+
}
|
|
33748
|
+
function getInboundTraceContext() {
|
|
33749
|
+
return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
|
|
33750
|
+
}
|
|
33751
|
+
|
|
33728
33752
|
// ../common/src/telemetry/session-id.ts
|
|
33729
33753
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
33730
33754
|
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
33731
33755
|
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
33732
|
-
|
|
33756
|
+
var telemetryOperationIdSlot = singleton("TelemetryOperationId");
|
|
33757
|
+
function getProcessEnv2() {
|
|
33733
33758
|
return globalThis.process?.env;
|
|
33734
33759
|
}
|
|
33735
33760
|
function normalizeSessionId(value) {
|
|
@@ -33740,18 +33765,165 @@ function normalizeSessionId(value) {
|
|
|
33740
33765
|
return trimmed || undefined;
|
|
33741
33766
|
}
|
|
33742
33767
|
function getConfiguredTelemetrySessionId() {
|
|
33743
|
-
return normalizeSessionId(
|
|
33768
|
+
return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
33744
33769
|
}
|
|
33745
33770
|
function resolveTelemetrySessionId(existingSessionId) {
|
|
33746
33771
|
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
33747
33772
|
}
|
|
33773
|
+
function getTelemetryOperationId() {
|
|
33774
|
+
const existing = telemetryOperationIdSlot.get();
|
|
33775
|
+
if (existing) {
|
|
33776
|
+
return existing;
|
|
33777
|
+
}
|
|
33778
|
+
const inboundTraceId = getInboundTraceContext()?.traceId;
|
|
33779
|
+
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
33780
|
+
telemetryOperationIdSlot.set(generated);
|
|
33781
|
+
return generated;
|
|
33782
|
+
}
|
|
33748
33783
|
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
33749
33784
|
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
33750
33785
|
function getGlobalTelemetryProperties() {
|
|
33751
33786
|
return telemetryPropsSlot.get();
|
|
33752
33787
|
}
|
|
33753
33788
|
|
|
33789
|
+
// ../common/src/telemetry/pii-redactor.ts
|
|
33790
|
+
var REDACTED = "[REDACTED]";
|
|
33791
|
+
var MAX_VALUE_LENGTH = 200;
|
|
33792
|
+
var SENSITIVE_NAME_TOKENS = new Set([
|
|
33793
|
+
"token",
|
|
33794
|
+
"tokens",
|
|
33795
|
+
"secret",
|
|
33796
|
+
"secrets",
|
|
33797
|
+
"password",
|
|
33798
|
+
"passwords",
|
|
33799
|
+
"pwd",
|
|
33800
|
+
"credential",
|
|
33801
|
+
"credentials",
|
|
33802
|
+
"auth",
|
|
33803
|
+
"authentication",
|
|
33804
|
+
"authorization",
|
|
33805
|
+
"authority",
|
|
33806
|
+
"cert",
|
|
33807
|
+
"certificate",
|
|
33808
|
+
"certificates"
|
|
33809
|
+
]);
|
|
33810
|
+
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
33811
|
+
"api",
|
|
33812
|
+
"access",
|
|
33813
|
+
"client",
|
|
33814
|
+
"private",
|
|
33815
|
+
"public",
|
|
33816
|
+
"signing",
|
|
33817
|
+
"encryption",
|
|
33818
|
+
"session",
|
|
33819
|
+
"master",
|
|
33820
|
+
"shared",
|
|
33821
|
+
"root",
|
|
33822
|
+
"ssh",
|
|
33823
|
+
"rsa",
|
|
33824
|
+
"aes",
|
|
33825
|
+
"hmac",
|
|
33826
|
+
"oauth"
|
|
33827
|
+
]);
|
|
33828
|
+
var UUID_PATTERN = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
|
|
33829
|
+
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
33830
|
+
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
33831
|
+
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
33832
|
+
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
33833
|
+
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
33834
|
+
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
33835
|
+
function shortHash(input) {
|
|
33836
|
+
let hash = 2166136261;
|
|
33837
|
+
for (let i = 0;i < input.length; i++) {
|
|
33838
|
+
hash ^= input.charCodeAt(i);
|
|
33839
|
+
hash = Math.imul(hash, 16777619);
|
|
33840
|
+
}
|
|
33841
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
33842
|
+
}
|
|
33843
|
+
function redactUrl(raw) {
|
|
33844
|
+
try {
|
|
33845
|
+
const url = new URL(raw);
|
|
33846
|
+
return `${url.protocol}//${url.host}`;
|
|
33847
|
+
} catch {
|
|
33848
|
+
return `url#${shortHash(raw)}`;
|
|
33849
|
+
}
|
|
33850
|
+
}
|
|
33851
|
+
function redactValueDetectors(value) {
|
|
33852
|
+
let out = value;
|
|
33853
|
+
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
33854
|
+
out = out.replace(URL_PATTERN, (match) => {
|
|
33855
|
+
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
33856
|
+
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
33857
|
+
return `${redactUrl(core2)}${trailing}`;
|
|
33858
|
+
});
|
|
33859
|
+
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
33860
|
+
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
33861
|
+
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
33862
|
+
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
33863
|
+
if (out.length > MAX_VALUE_LENGTH) {
|
|
33864
|
+
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
33865
|
+
}
|
|
33866
|
+
return out;
|
|
33867
|
+
}
|
|
33868
|
+
function redactValue(value) {
|
|
33869
|
+
return redactValueDetectors(value);
|
|
33870
|
+
}
|
|
33871
|
+
function redactError(error) {
|
|
33872
|
+
const safe = new Error(redactValueDetectors(error.message ?? ""));
|
|
33873
|
+
safe.name = error.name;
|
|
33874
|
+
safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
|
|
33875
|
+
return safe;
|
|
33876
|
+
}
|
|
33877
|
+
function nameTokens(name) {
|
|
33878
|
+
return name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s._-]+/).map((t) => t.toLowerCase()).filter(Boolean);
|
|
33879
|
+
}
|
|
33880
|
+
function isSensitiveName(name) {
|
|
33881
|
+
const tokens = nameTokens(name);
|
|
33882
|
+
for (let i = 0;i < tokens.length; i++) {
|
|
33883
|
+
const token = tokens[i];
|
|
33884
|
+
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
33885
|
+
return true;
|
|
33886
|
+
}
|
|
33887
|
+
if (token === "key" || token === "keys") {
|
|
33888
|
+
const prev = tokens[i - 1];
|
|
33889
|
+
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
33890
|
+
return true;
|
|
33891
|
+
}
|
|
33892
|
+
}
|
|
33893
|
+
}
|
|
33894
|
+
return false;
|
|
33895
|
+
}
|
|
33896
|
+
function redactProperty(name, value) {
|
|
33897
|
+
if (value === undefined || value === null) {
|
|
33898
|
+
return;
|
|
33899
|
+
}
|
|
33900
|
+
if (isSensitiveName(name)) {
|
|
33901
|
+
return REDACTED;
|
|
33902
|
+
}
|
|
33903
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
33904
|
+
return value;
|
|
33905
|
+
}
|
|
33906
|
+
if (typeof value !== "string") {
|
|
33907
|
+
return "[OBJECT]";
|
|
33908
|
+
}
|
|
33909
|
+
return redactValueDetectors(value);
|
|
33910
|
+
}
|
|
33911
|
+
function redactProperties(properties) {
|
|
33912
|
+
const out = {};
|
|
33913
|
+
for (const [name, value] of Object.entries(properties)) {
|
|
33914
|
+
const redacted = redactProperty(name, value);
|
|
33915
|
+
if (redacted !== undefined) {
|
|
33916
|
+
out[name] = redacted;
|
|
33917
|
+
}
|
|
33918
|
+
}
|
|
33919
|
+
return out;
|
|
33920
|
+
}
|
|
33921
|
+
|
|
33754
33922
|
// ../common/src/telemetry/telemetry-service.ts
|
|
33923
|
+
var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
|
|
33924
|
+
var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
|
|
33925
|
+
var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
|
|
33926
|
+
|
|
33755
33927
|
class TelemetryService {
|
|
33756
33928
|
telemetryProvider;
|
|
33757
33929
|
contextStorage;
|
|
@@ -33778,11 +33950,15 @@ class TelemetryService {
|
|
|
33778
33950
|
trackException(error, properties) {
|
|
33779
33951
|
const context = this.getCurrentContext();
|
|
33780
33952
|
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
33781
|
-
this.telemetryProvider.trackException(error, enrichedProperties);
|
|
33953
|
+
this.telemetryProvider.trackException(redactError(error), enrichedProperties);
|
|
33782
33954
|
}
|
|
33783
33955
|
async trackRequest(name, fn, properties) {
|
|
33956
|
+
const parentContext = this.getCurrentContext();
|
|
33957
|
+
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
|
|
33958
|
+
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
33784
33959
|
const context = {
|
|
33785
|
-
operationId
|
|
33960
|
+
operationId,
|
|
33961
|
+
...parentId !== undefined ? { parentId } : {},
|
|
33786
33962
|
id: this.generateId()
|
|
33787
33963
|
};
|
|
33788
33964
|
const startTime = performance.now();
|
|
@@ -33800,6 +33976,45 @@ class TelemetryService {
|
|
|
33800
33976
|
throw error;
|
|
33801
33977
|
}
|
|
33802
33978
|
}
|
|
33979
|
+
trackRequestResult(name, durationMs, success, properties, context) {
|
|
33980
|
+
const requestContext = context ?? {
|
|
33981
|
+
operationId: this.operationId ?? getTelemetryOperationId(),
|
|
33982
|
+
id: this.generateId()
|
|
33983
|
+
};
|
|
33984
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
|
|
33985
|
+
this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
|
|
33986
|
+
}
|
|
33987
|
+
createRequestContext() {
|
|
33988
|
+
const operationId = this.operationId ?? getTelemetryOperationId();
|
|
33989
|
+
const parentId = this.inboundParentIdFor(operationId);
|
|
33990
|
+
return {
|
|
33991
|
+
operationId,
|
|
33992
|
+
...parentId !== undefined ? { parentId } : {},
|
|
33993
|
+
id: this.generateId()
|
|
33994
|
+
};
|
|
33995
|
+
}
|
|
33996
|
+
inboundParentIdFor(operationId) {
|
|
33997
|
+
const inbound = getInboundTraceContext();
|
|
33998
|
+
return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
|
|
33999
|
+
}
|
|
34000
|
+
runWithContext(context, fn) {
|
|
34001
|
+
return this.contextStorage.run(context, fn);
|
|
34002
|
+
}
|
|
34003
|
+
createDependencyContext() {
|
|
34004
|
+
const parentContext = this.getCurrentContext();
|
|
34005
|
+
if (!parentContext) {
|
|
34006
|
+
return;
|
|
34007
|
+
}
|
|
34008
|
+
return {
|
|
34009
|
+
operationId: parentContext.operationId,
|
|
34010
|
+
parentId: parentContext.id,
|
|
34011
|
+
id: this.generateId()
|
|
34012
|
+
};
|
|
34013
|
+
}
|
|
34014
|
+
trackDependencyResult(name, type2, durationMs, success, properties, context, resultCode) {
|
|
34015
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
34016
|
+
this.telemetryProvider.trackDependency(redactValue(name), type2, durationMs, success, enrichedProperties, resultCode);
|
|
34017
|
+
}
|
|
33803
34018
|
async trackDependencyOperation(name, type2, fn, properties) {
|
|
33804
34019
|
const parentContext = this.getCurrentContext();
|
|
33805
34020
|
if (!parentContext) {
|
|
@@ -33836,8 +34051,12 @@ class TelemetryService {
|
|
|
33836
34051
|
...getExecutionContextTelemetryProperties(),
|
|
33837
34052
|
...globalProperties,
|
|
33838
34053
|
...this.defaultProperties,
|
|
33839
|
-
...properties,
|
|
33840
|
-
...context
|
|
34054
|
+
...redactProperties(properties ?? {}),
|
|
34055
|
+
...context ? {
|
|
34056
|
+
[TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
|
|
34057
|
+
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
|
|
34058
|
+
[TELEMETRY_SPAN_ID_PROPERTY]: context.id
|
|
34059
|
+
} : {}
|
|
33841
34060
|
};
|
|
33842
34061
|
if (sessionId === undefined) {
|
|
33843
34062
|
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
@@ -33847,7 +34066,16 @@ class TelemetryService {
|
|
|
33847
34066
|
return enriched;
|
|
33848
34067
|
}
|
|
33849
34068
|
generateId() {
|
|
33850
|
-
|
|
34069
|
+
const bytes = new Uint8Array(8);
|
|
34070
|
+
let hex = "";
|
|
34071
|
+
do {
|
|
34072
|
+
crypto.getRandomValues(bytes);
|
|
34073
|
+
hex = "";
|
|
34074
|
+
for (const byte of bytes) {
|
|
34075
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
34076
|
+
}
|
|
34077
|
+
} while (/^0+$/.test(hex));
|
|
34078
|
+
return hex;
|
|
33851
34079
|
}
|
|
33852
34080
|
}
|
|
33853
34081
|
// ../common/src/telemetry/node-appinsights-telemetry-provider.ts
|
|
@@ -34549,134 +34777,11 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
|
34549
34777
|
};
|
|
34550
34778
|
}
|
|
34551
34779
|
|
|
34552
|
-
// ../common/src/telemetry/pii-redactor.ts
|
|
34553
|
-
var REDACTED = "[REDACTED]";
|
|
34554
|
-
var MAX_VALUE_LENGTH = 200;
|
|
34555
|
-
var SENSITIVE_NAME_TOKENS = new Set([
|
|
34556
|
-
"token",
|
|
34557
|
-
"tokens",
|
|
34558
|
-
"secret",
|
|
34559
|
-
"secrets",
|
|
34560
|
-
"password",
|
|
34561
|
-
"passwords",
|
|
34562
|
-
"pwd",
|
|
34563
|
-
"credential",
|
|
34564
|
-
"credentials",
|
|
34565
|
-
"auth",
|
|
34566
|
-
"authentication",
|
|
34567
|
-
"authorization",
|
|
34568
|
-
"authority",
|
|
34569
|
-
"cert",
|
|
34570
|
-
"certificate",
|
|
34571
|
-
"certificates"
|
|
34572
|
-
]);
|
|
34573
|
-
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
34574
|
-
"api",
|
|
34575
|
-
"access",
|
|
34576
|
-
"client",
|
|
34577
|
-
"private",
|
|
34578
|
-
"public",
|
|
34579
|
-
"signing",
|
|
34580
|
-
"encryption",
|
|
34581
|
-
"session",
|
|
34582
|
-
"master",
|
|
34583
|
-
"shared",
|
|
34584
|
-
"root",
|
|
34585
|
-
"ssh",
|
|
34586
|
-
"rsa",
|
|
34587
|
-
"aes",
|
|
34588
|
-
"hmac",
|
|
34589
|
-
"oauth"
|
|
34590
|
-
]);
|
|
34591
|
-
var UUID_PATTERN = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
|
|
34592
|
-
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
34593
|
-
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
34594
|
-
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
34595
|
-
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
34596
|
-
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
34597
|
-
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
34598
|
-
function shortHash(input) {
|
|
34599
|
-
let hash = 2166136261;
|
|
34600
|
-
for (let i = 0;i < input.length; i++) {
|
|
34601
|
-
hash ^= input.charCodeAt(i);
|
|
34602
|
-
hash = Math.imul(hash, 16777619);
|
|
34603
|
-
}
|
|
34604
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
34605
|
-
}
|
|
34606
|
-
function redactUrl(raw) {
|
|
34607
|
-
try {
|
|
34608
|
-
const url = new URL(raw);
|
|
34609
|
-
return `${url.protocol}//${url.host}`;
|
|
34610
|
-
} catch {
|
|
34611
|
-
return `url#${shortHash(raw)}`;
|
|
34612
|
-
}
|
|
34613
|
-
}
|
|
34614
|
-
function redactValueDetectors(value) {
|
|
34615
|
-
let out = value;
|
|
34616
|
-
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
34617
|
-
out = out.replace(URL_PATTERN, (match) => {
|
|
34618
|
-
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
34619
|
-
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
34620
|
-
return `${redactUrl(core2)}${trailing}`;
|
|
34621
|
-
});
|
|
34622
|
-
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
34623
|
-
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
34624
|
-
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
34625
|
-
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
34626
|
-
if (out.length > MAX_VALUE_LENGTH) {
|
|
34627
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
34628
|
-
}
|
|
34629
|
-
return out;
|
|
34630
|
-
}
|
|
34631
|
-
function nameTokens(name) {
|
|
34632
|
-
return name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(/[\s_-]+/).map((t) => t.toLowerCase()).filter(Boolean);
|
|
34633
|
-
}
|
|
34634
|
-
function isSensitiveName(name) {
|
|
34635
|
-
const tokens = nameTokens(name);
|
|
34636
|
-
for (let i = 0;i < tokens.length; i++) {
|
|
34637
|
-
const token = tokens[i];
|
|
34638
|
-
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
34639
|
-
return true;
|
|
34640
|
-
}
|
|
34641
|
-
if (token === "key" || token === "keys") {
|
|
34642
|
-
const prev = tokens[i - 1];
|
|
34643
|
-
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
34644
|
-
return true;
|
|
34645
|
-
}
|
|
34646
|
-
}
|
|
34647
|
-
}
|
|
34648
|
-
return false;
|
|
34649
|
-
}
|
|
34650
|
-
function redactProperty(name, value) {
|
|
34651
|
-
if (value === undefined || value === null) {
|
|
34652
|
-
return;
|
|
34653
|
-
}
|
|
34654
|
-
if (isSensitiveName(name)) {
|
|
34655
|
-
return REDACTED;
|
|
34656
|
-
}
|
|
34657
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
34658
|
-
return value;
|
|
34659
|
-
}
|
|
34660
|
-
if (typeof value !== "string") {
|
|
34661
|
-
return "[OBJECT]";
|
|
34662
|
-
}
|
|
34663
|
-
return redactValueDetectors(value);
|
|
34664
|
-
}
|
|
34665
|
-
function redactProperties(properties) {
|
|
34666
|
-
const out = {};
|
|
34667
|
-
for (const [name, value] of Object.entries(properties)) {
|
|
34668
|
-
const redacted = redactProperty(name, value);
|
|
34669
|
-
if (redacted !== undefined) {
|
|
34670
|
-
out[name] = redacted;
|
|
34671
|
-
}
|
|
34672
|
-
}
|
|
34673
|
-
return out;
|
|
34674
|
-
}
|
|
34675
|
-
|
|
34676
34780
|
// ../common/src/trackedAction.ts
|
|
34677
34781
|
var pollSignalSlot = singleton("PollSignal");
|
|
34678
34782
|
var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
|
|
34679
34783
|
var retryHintValues = new Set(RETRY_HINTS);
|
|
34784
|
+
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
34680
34785
|
var processContext = {
|
|
34681
34786
|
exit: (code) => {
|
|
34682
34787
|
process.exitCode = code;
|
|
@@ -34687,22 +34792,18 @@ var processContext = {
|
|
|
34687
34792
|
};
|
|
34688
34793
|
function extractCommandParams(cmd) {
|
|
34689
34794
|
const params = {};
|
|
34795
|
+
const add2 = (name, value) => {
|
|
34796
|
+
if (name && value !== undefined) {
|
|
34797
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
|
|
34798
|
+
}
|
|
34799
|
+
};
|
|
34690
34800
|
const registered = cmd.registeredArguments ?? [];
|
|
34691
34801
|
const processed = cmd.processedArgs ?? [];
|
|
34692
34802
|
for (let i = 0;i < registered.length; i++) {
|
|
34693
|
-
|
|
34694
|
-
if (value === undefined) {
|
|
34695
|
-
continue;
|
|
34696
|
-
}
|
|
34697
|
-
const name = registered[i].name();
|
|
34698
|
-
if (name) {
|
|
34699
|
-
params[name] = value;
|
|
34700
|
-
}
|
|
34803
|
+
add2(registered[i].name(), processed[i]);
|
|
34701
34804
|
}
|
|
34702
34805
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
34703
|
-
|
|
34704
|
-
params[key] = value;
|
|
34705
|
-
}
|
|
34806
|
+
add2(key, value);
|
|
34706
34807
|
}
|
|
34707
34808
|
return params;
|
|
34708
34809
|
}
|
|
@@ -34745,11 +34846,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
34745
34846
|
return this.action(async (...args) => {
|
|
34746
34847
|
const telemetryName = deriveCommandPath(command);
|
|
34747
34848
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
34849
|
+
const requestContext = telemetry.createRequestContext();
|
|
34748
34850
|
const startTime = performance.now();
|
|
34749
34851
|
let errorMessage;
|
|
34750
34852
|
let fallbackExitCode = EXIT_CODES.Success;
|
|
34751
34853
|
clearRecordedCommandFailureTelemetry();
|
|
34752
|
-
const [error] = await catchError(fn(...args));
|
|
34854
|
+
const [error] = await catchError(telemetry.runWithContext(requestContext, () => fn(...args)));
|
|
34753
34855
|
if (error) {
|
|
34754
34856
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
34755
34857
|
logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
|
|
@@ -34785,16 +34887,21 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
34785
34887
|
recordedFailure,
|
|
34786
34888
|
pollSignal: context.pollSignal
|
|
34787
34889
|
});
|
|
34788
|
-
|
|
34789
|
-
|
|
34890
|
+
const commandParams = extractCommandParams(command);
|
|
34891
|
+
if (props) {
|
|
34892
|
+
for (const key of Object.keys(props)) {
|
|
34893
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
|
|
34894
|
+
}
|
|
34895
|
+
}
|
|
34896
|
+
const baseProperties = redactProperties({
|
|
34897
|
+
...commandParams,
|
|
34790
34898
|
...props,
|
|
34791
34899
|
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
34792
34900
|
command: "true",
|
|
34793
|
-
duration: String(durationMs),
|
|
34794
|
-
success: String(success),
|
|
34795
34901
|
...terminalTelemetry,
|
|
34796
34902
|
...errorMessage ? { errorMessage } : {}
|
|
34797
|
-
})
|
|
34903
|
+
});
|
|
34904
|
+
telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
|
|
34798
34905
|
});
|
|
34799
34906
|
};
|
|
34800
34907
|
// ../common/src/console-guard.ts
|
|
@@ -45361,4 +45468,4 @@ export {
|
|
|
45361
45468
|
metadata
|
|
45362
45469
|
};
|
|
45363
45470
|
|
|
45364
|
-
//# debugId=
|
|
45471
|
+
//# debugId=4D39ED13064FECF264756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/docsai-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.198.0
|
|
4
|
+
"version": "1.198.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": "
|
|
29
|
+
"gitHead": "1fadf03d7a8dd102742571dff569fdac11808afb"
|
|
30
30
|
}
|