@uipath/docsai-tool 1.199.0-preview.91 → 1.199.0-preview.97
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.199.0-preview.
|
|
27811
|
+
version: "1.199.0-preview.97",
|
|
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
|
|
@@ -34550,134 +34778,11 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
|
34550
34778
|
};
|
|
34551
34779
|
}
|
|
34552
34780
|
|
|
34553
|
-
// ../common/src/telemetry/pii-redactor.ts
|
|
34554
|
-
var REDACTED = "[REDACTED]";
|
|
34555
|
-
var MAX_VALUE_LENGTH = 200;
|
|
34556
|
-
var SENSITIVE_NAME_TOKENS = new Set([
|
|
34557
|
-
"token",
|
|
34558
|
-
"tokens",
|
|
34559
|
-
"secret",
|
|
34560
|
-
"secrets",
|
|
34561
|
-
"password",
|
|
34562
|
-
"passwords",
|
|
34563
|
-
"pwd",
|
|
34564
|
-
"credential",
|
|
34565
|
-
"credentials",
|
|
34566
|
-
"auth",
|
|
34567
|
-
"authentication",
|
|
34568
|
-
"authorization",
|
|
34569
|
-
"authority",
|
|
34570
|
-
"cert",
|
|
34571
|
-
"certificate",
|
|
34572
|
-
"certificates"
|
|
34573
|
-
]);
|
|
34574
|
-
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
34575
|
-
"api",
|
|
34576
|
-
"access",
|
|
34577
|
-
"client",
|
|
34578
|
-
"private",
|
|
34579
|
-
"public",
|
|
34580
|
-
"signing",
|
|
34581
|
-
"encryption",
|
|
34582
|
-
"session",
|
|
34583
|
-
"master",
|
|
34584
|
-
"shared",
|
|
34585
|
-
"root",
|
|
34586
|
-
"ssh",
|
|
34587
|
-
"rsa",
|
|
34588
|
-
"aes",
|
|
34589
|
-
"hmac",
|
|
34590
|
-
"oauth"
|
|
34591
|
-
]);
|
|
34592
|
-
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;
|
|
34593
|
-
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
34594
|
-
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
34595
|
-
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
34596
|
-
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
34597
|
-
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
34598
|
-
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
34599
|
-
function shortHash(input) {
|
|
34600
|
-
let hash = 2166136261;
|
|
34601
|
-
for (let i = 0;i < input.length; i++) {
|
|
34602
|
-
hash ^= input.charCodeAt(i);
|
|
34603
|
-
hash = Math.imul(hash, 16777619);
|
|
34604
|
-
}
|
|
34605
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
34606
|
-
}
|
|
34607
|
-
function redactUrl(raw) {
|
|
34608
|
-
try {
|
|
34609
|
-
const url = new URL(raw);
|
|
34610
|
-
return `${url.protocol}//${url.host}`;
|
|
34611
|
-
} catch {
|
|
34612
|
-
return `url#${shortHash(raw)}`;
|
|
34613
|
-
}
|
|
34614
|
-
}
|
|
34615
|
-
function redactValueDetectors(value) {
|
|
34616
|
-
let out = value;
|
|
34617
|
-
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
34618
|
-
out = out.replace(URL_PATTERN, (match) => {
|
|
34619
|
-
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
34620
|
-
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
34621
|
-
return `${redactUrl(core2)}${trailing}`;
|
|
34622
|
-
});
|
|
34623
|
-
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
34624
|
-
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
34625
|
-
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
34626
|
-
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
34627
|
-
if (out.length > MAX_VALUE_LENGTH) {
|
|
34628
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
34629
|
-
}
|
|
34630
|
-
return out;
|
|
34631
|
-
}
|
|
34632
|
-
function nameTokens(name) {
|
|
34633
|
-
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);
|
|
34634
|
-
}
|
|
34635
|
-
function isSensitiveName(name) {
|
|
34636
|
-
const tokens = nameTokens(name);
|
|
34637
|
-
for (let i = 0;i < tokens.length; i++) {
|
|
34638
|
-
const token = tokens[i];
|
|
34639
|
-
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
34640
|
-
return true;
|
|
34641
|
-
}
|
|
34642
|
-
if (token === "key" || token === "keys") {
|
|
34643
|
-
const prev = tokens[i - 1];
|
|
34644
|
-
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
34645
|
-
return true;
|
|
34646
|
-
}
|
|
34647
|
-
}
|
|
34648
|
-
}
|
|
34649
|
-
return false;
|
|
34650
|
-
}
|
|
34651
|
-
function redactProperty(name, value) {
|
|
34652
|
-
if (value === undefined || value === null) {
|
|
34653
|
-
return;
|
|
34654
|
-
}
|
|
34655
|
-
if (isSensitiveName(name)) {
|
|
34656
|
-
return REDACTED;
|
|
34657
|
-
}
|
|
34658
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
34659
|
-
return value;
|
|
34660
|
-
}
|
|
34661
|
-
if (typeof value !== "string") {
|
|
34662
|
-
return "[OBJECT]";
|
|
34663
|
-
}
|
|
34664
|
-
return redactValueDetectors(value);
|
|
34665
|
-
}
|
|
34666
|
-
function redactProperties(properties) {
|
|
34667
|
-
const out = {};
|
|
34668
|
-
for (const [name, value] of Object.entries(properties)) {
|
|
34669
|
-
const redacted = redactProperty(name, value);
|
|
34670
|
-
if (redacted !== undefined) {
|
|
34671
|
-
out[name] = redacted;
|
|
34672
|
-
}
|
|
34673
|
-
}
|
|
34674
|
-
return out;
|
|
34675
|
-
}
|
|
34676
|
-
|
|
34677
34781
|
// ../common/src/trackedAction.ts
|
|
34678
34782
|
var pollSignalSlot = singleton("PollSignal");
|
|
34679
34783
|
var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
|
|
34680
34784
|
var retryHintValues = new Set(RETRY_HINTS);
|
|
34785
|
+
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
34681
34786
|
var processContext = {
|
|
34682
34787
|
exit: (code) => {
|
|
34683
34788
|
process.exitCode = code;
|
|
@@ -34688,22 +34793,18 @@ var processContext = {
|
|
|
34688
34793
|
};
|
|
34689
34794
|
function extractCommandParams(cmd) {
|
|
34690
34795
|
const params = {};
|
|
34796
|
+
const add2 = (name, value) => {
|
|
34797
|
+
if (name && value !== undefined) {
|
|
34798
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
|
|
34799
|
+
}
|
|
34800
|
+
};
|
|
34691
34801
|
const registered = cmd.registeredArguments ?? [];
|
|
34692
34802
|
const processed = cmd.processedArgs ?? [];
|
|
34693
34803
|
for (let i = 0;i < registered.length; i++) {
|
|
34694
|
-
|
|
34695
|
-
if (value === undefined) {
|
|
34696
|
-
continue;
|
|
34697
|
-
}
|
|
34698
|
-
const name = registered[i].name();
|
|
34699
|
-
if (name) {
|
|
34700
|
-
params[name] = value;
|
|
34701
|
-
}
|
|
34804
|
+
add2(registered[i].name(), processed[i]);
|
|
34702
34805
|
}
|
|
34703
34806
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
34704
|
-
|
|
34705
|
-
params[key] = value;
|
|
34706
|
-
}
|
|
34807
|
+
add2(key, value);
|
|
34707
34808
|
}
|
|
34708
34809
|
return params;
|
|
34709
34810
|
}
|
|
@@ -34746,11 +34847,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
34746
34847
|
return this.action(async (...args) => {
|
|
34747
34848
|
const telemetryName = deriveCommandPath(command);
|
|
34748
34849
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
34850
|
+
const requestContext = telemetry.createRequestContext();
|
|
34749
34851
|
const startTime = performance.now();
|
|
34750
34852
|
let errorMessage;
|
|
34751
34853
|
let fallbackExitCode = EXIT_CODES.Success;
|
|
34752
34854
|
clearRecordedCommandFailureTelemetry();
|
|
34753
|
-
const [error] = await catchError(fn(...args));
|
|
34855
|
+
const [error] = await catchError(telemetry.runWithContext(requestContext, () => fn(...args)));
|
|
34754
34856
|
if (error) {
|
|
34755
34857
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
34756
34858
|
logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
|
|
@@ -34786,16 +34888,21 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
34786
34888
|
recordedFailure,
|
|
34787
34889
|
pollSignal: context.pollSignal
|
|
34788
34890
|
});
|
|
34789
|
-
|
|
34790
|
-
|
|
34891
|
+
const commandParams = extractCommandParams(command);
|
|
34892
|
+
if (props) {
|
|
34893
|
+
for (const key of Object.keys(props)) {
|
|
34894
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
|
|
34895
|
+
}
|
|
34896
|
+
}
|
|
34897
|
+
const baseProperties = redactProperties({
|
|
34898
|
+
...commandParams,
|
|
34791
34899
|
...props,
|
|
34792
34900
|
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
34793
34901
|
command: "true",
|
|
34794
|
-
duration: String(durationMs),
|
|
34795
|
-
success: String(success),
|
|
34796
34902
|
...terminalTelemetry,
|
|
34797
34903
|
...errorMessage ? { errorMessage } : {}
|
|
34798
|
-
})
|
|
34904
|
+
});
|
|
34905
|
+
telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
|
|
34799
34906
|
});
|
|
34800
34907
|
};
|
|
34801
34908
|
// ../common/src/console-guard.ts
|
|
@@ -45362,4 +45469,4 @@ export {
|
|
|
45362
45469
|
metadata
|
|
45363
45470
|
};
|
|
45364
45471
|
|
|
45365
|
-
//# debugId=
|
|
45472
|
+
//# debugId=BEA7D7E28DA3874464756E2164756E21
|
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.
|
|
4
|
+
"version": "1.199.0-preview.97",
|
|
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": "087ae21e842f27bde5eb0013892c9487bfe60568"
|
|
30
30
|
}
|