@uipath/context-grounding-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
|
@@ -27089,11 +27089,36 @@ class NodeContextStorage {
|
|
|
27089
27089
|
return this.storage.getStore();
|
|
27090
27090
|
}
|
|
27091
27091
|
}
|
|
27092
|
+
// ../common/src/telemetry/trace-context.ts
|
|
27093
|
+
var TELEMETRY_TRACEPARENT_ENV = "TRACEPARENT";
|
|
27094
|
+
var TRACEPARENT_PATTERN = /^00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}$/;
|
|
27095
|
+
function getProcessEnv() {
|
|
27096
|
+
return globalThis.process?.env;
|
|
27097
|
+
}
|
|
27098
|
+
function parseInboundTraceparent(value) {
|
|
27099
|
+
if (!value) {
|
|
27100
|
+
return;
|
|
27101
|
+
}
|
|
27102
|
+
const match = TRACEPARENT_PATTERN.exec(value.trim().toLowerCase());
|
|
27103
|
+
if (!match) {
|
|
27104
|
+
return;
|
|
27105
|
+
}
|
|
27106
|
+
const [, traceId, parentSpanId] = match;
|
|
27107
|
+
if (/^0+$/.test(traceId) || /^0+$/.test(parentSpanId)) {
|
|
27108
|
+
return;
|
|
27109
|
+
}
|
|
27110
|
+
return { traceId, parentSpanId };
|
|
27111
|
+
}
|
|
27112
|
+
function getInboundTraceContext() {
|
|
27113
|
+
return parseInboundTraceparent(getProcessEnv()?.[TELEMETRY_TRACEPARENT_ENV]);
|
|
27114
|
+
}
|
|
27115
|
+
|
|
27092
27116
|
// ../common/src/telemetry/session-id.ts
|
|
27093
27117
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
27094
27118
|
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
27095
27119
|
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
27096
|
-
|
|
27120
|
+
var telemetryOperationIdSlot = singleton("TelemetryOperationId");
|
|
27121
|
+
function getProcessEnv2() {
|
|
27097
27122
|
return globalThis.process?.env;
|
|
27098
27123
|
}
|
|
27099
27124
|
function normalizeSessionId(value) {
|
|
@@ -27104,18 +27129,165 @@ function normalizeSessionId(value) {
|
|
|
27104
27129
|
return trimmed || undefined;
|
|
27105
27130
|
}
|
|
27106
27131
|
function getConfiguredTelemetrySessionId() {
|
|
27107
|
-
return normalizeSessionId(
|
|
27132
|
+
return normalizeSessionId(getProcessEnv2()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
27108
27133
|
}
|
|
27109
27134
|
function resolveTelemetrySessionId(existingSessionId) {
|
|
27110
27135
|
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
27111
27136
|
}
|
|
27137
|
+
function getTelemetryOperationId() {
|
|
27138
|
+
const existing = telemetryOperationIdSlot.get();
|
|
27139
|
+
if (existing) {
|
|
27140
|
+
return existing;
|
|
27141
|
+
}
|
|
27142
|
+
const inboundTraceId = getInboundTraceContext()?.traceId;
|
|
27143
|
+
const generated = inboundTraceId ?? crypto.randomUUID().replaceAll("-", "");
|
|
27144
|
+
telemetryOperationIdSlot.set(generated);
|
|
27145
|
+
return generated;
|
|
27146
|
+
}
|
|
27112
27147
|
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
27113
27148
|
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
27114
27149
|
function getGlobalTelemetryProperties() {
|
|
27115
27150
|
return telemetryPropsSlot.get();
|
|
27116
27151
|
}
|
|
27117
27152
|
|
|
27153
|
+
// ../common/src/telemetry/pii-redactor.ts
|
|
27154
|
+
var REDACTED = "[REDACTED]";
|
|
27155
|
+
var MAX_VALUE_LENGTH = 200;
|
|
27156
|
+
var SENSITIVE_NAME_TOKENS = new Set([
|
|
27157
|
+
"token",
|
|
27158
|
+
"tokens",
|
|
27159
|
+
"secret",
|
|
27160
|
+
"secrets",
|
|
27161
|
+
"password",
|
|
27162
|
+
"passwords",
|
|
27163
|
+
"pwd",
|
|
27164
|
+
"credential",
|
|
27165
|
+
"credentials",
|
|
27166
|
+
"auth",
|
|
27167
|
+
"authentication",
|
|
27168
|
+
"authorization",
|
|
27169
|
+
"authority",
|
|
27170
|
+
"cert",
|
|
27171
|
+
"certificate",
|
|
27172
|
+
"certificates"
|
|
27173
|
+
]);
|
|
27174
|
+
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
27175
|
+
"api",
|
|
27176
|
+
"access",
|
|
27177
|
+
"client",
|
|
27178
|
+
"private",
|
|
27179
|
+
"public",
|
|
27180
|
+
"signing",
|
|
27181
|
+
"encryption",
|
|
27182
|
+
"session",
|
|
27183
|
+
"master",
|
|
27184
|
+
"shared",
|
|
27185
|
+
"root",
|
|
27186
|
+
"ssh",
|
|
27187
|
+
"rsa",
|
|
27188
|
+
"aes",
|
|
27189
|
+
"hmac",
|
|
27190
|
+
"oauth"
|
|
27191
|
+
]);
|
|
27192
|
+
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;
|
|
27193
|
+
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
27194
|
+
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
27195
|
+
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
27196
|
+
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
27197
|
+
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
27198
|
+
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
27199
|
+
function shortHash(input) {
|
|
27200
|
+
let hash = 2166136261;
|
|
27201
|
+
for (let i = 0;i < input.length; i++) {
|
|
27202
|
+
hash ^= input.charCodeAt(i);
|
|
27203
|
+
hash = Math.imul(hash, 16777619);
|
|
27204
|
+
}
|
|
27205
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
27206
|
+
}
|
|
27207
|
+
function redactUrl(raw) {
|
|
27208
|
+
try {
|
|
27209
|
+
const url = new URL(raw);
|
|
27210
|
+
return `${url.protocol}//${url.host}`;
|
|
27211
|
+
} catch {
|
|
27212
|
+
return `url#${shortHash(raw)}`;
|
|
27213
|
+
}
|
|
27214
|
+
}
|
|
27215
|
+
function redactValueDetectors(value) {
|
|
27216
|
+
let out = value;
|
|
27217
|
+
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
27218
|
+
out = out.replace(URL_PATTERN, (match) => {
|
|
27219
|
+
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
27220
|
+
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
27221
|
+
return `${redactUrl(core2)}${trailing}`;
|
|
27222
|
+
});
|
|
27223
|
+
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
27224
|
+
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
27225
|
+
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
27226
|
+
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
27227
|
+
if (out.length > MAX_VALUE_LENGTH) {
|
|
27228
|
+
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
27229
|
+
}
|
|
27230
|
+
return out;
|
|
27231
|
+
}
|
|
27232
|
+
function redactValue(value) {
|
|
27233
|
+
return redactValueDetectors(value);
|
|
27234
|
+
}
|
|
27235
|
+
function redactError(error) {
|
|
27236
|
+
const safe = new Error(redactValueDetectors(error.message ?? ""));
|
|
27237
|
+
safe.name = error.name;
|
|
27238
|
+
safe.stack = typeof error.stack === "string" ? redactValueDetectors(error.stack) : undefined;
|
|
27239
|
+
return safe;
|
|
27240
|
+
}
|
|
27241
|
+
function nameTokens(name) {
|
|
27242
|
+
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);
|
|
27243
|
+
}
|
|
27244
|
+
function isSensitiveName(name) {
|
|
27245
|
+
const tokens = nameTokens(name);
|
|
27246
|
+
for (let i = 0;i < tokens.length; i++) {
|
|
27247
|
+
const token = tokens[i];
|
|
27248
|
+
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
27249
|
+
return true;
|
|
27250
|
+
}
|
|
27251
|
+
if (token === "key" || token === "keys") {
|
|
27252
|
+
const prev = tokens[i - 1];
|
|
27253
|
+
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
27254
|
+
return true;
|
|
27255
|
+
}
|
|
27256
|
+
}
|
|
27257
|
+
}
|
|
27258
|
+
return false;
|
|
27259
|
+
}
|
|
27260
|
+
function redactProperty(name, value) {
|
|
27261
|
+
if (value === undefined || value === null) {
|
|
27262
|
+
return;
|
|
27263
|
+
}
|
|
27264
|
+
if (isSensitiveName(name)) {
|
|
27265
|
+
return REDACTED;
|
|
27266
|
+
}
|
|
27267
|
+
if (typeof value === "boolean" || typeof value === "number") {
|
|
27268
|
+
return value;
|
|
27269
|
+
}
|
|
27270
|
+
if (typeof value !== "string") {
|
|
27271
|
+
return "[OBJECT]";
|
|
27272
|
+
}
|
|
27273
|
+
return redactValueDetectors(value);
|
|
27274
|
+
}
|
|
27275
|
+
function redactProperties(properties) {
|
|
27276
|
+
const out = {};
|
|
27277
|
+
for (const [name, value] of Object.entries(properties)) {
|
|
27278
|
+
const redacted = redactProperty(name, value);
|
|
27279
|
+
if (redacted !== undefined) {
|
|
27280
|
+
out[name] = redacted;
|
|
27281
|
+
}
|
|
27282
|
+
}
|
|
27283
|
+
return out;
|
|
27284
|
+
}
|
|
27285
|
+
|
|
27118
27286
|
// ../common/src/telemetry/telemetry-service.ts
|
|
27287
|
+
var TELEMETRY_OPERATION_ID_PROPERTY = "uip.trace.operation_id";
|
|
27288
|
+
var TELEMETRY_PARENT_ID_PROPERTY = "uip.trace.parent_id";
|
|
27289
|
+
var TELEMETRY_SPAN_ID_PROPERTY = "uip.trace.span_id";
|
|
27290
|
+
|
|
27119
27291
|
class TelemetryService {
|
|
27120
27292
|
telemetryProvider;
|
|
27121
27293
|
contextStorage;
|
|
@@ -27142,11 +27314,15 @@ class TelemetryService {
|
|
|
27142
27314
|
trackException(error, properties) {
|
|
27143
27315
|
const context = this.getCurrentContext();
|
|
27144
27316
|
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
27145
|
-
this.telemetryProvider.trackException(error, enrichedProperties);
|
|
27317
|
+
this.telemetryProvider.trackException(redactError(error), enrichedProperties);
|
|
27146
27318
|
}
|
|
27147
27319
|
async trackRequest(name, fn, properties) {
|
|
27320
|
+
const parentContext = this.getCurrentContext();
|
|
27321
|
+
const operationId = parentContext?.operationId ?? this.operationId ?? getTelemetryOperationId();
|
|
27322
|
+
const parentId = parentContext ? parentContext.id : this.inboundParentIdFor(operationId);
|
|
27148
27323
|
const context = {
|
|
27149
|
-
operationId
|
|
27324
|
+
operationId,
|
|
27325
|
+
...parentId !== undefined ? { parentId } : {},
|
|
27150
27326
|
id: this.generateId()
|
|
27151
27327
|
};
|
|
27152
27328
|
const startTime = performance.now();
|
|
@@ -27164,6 +27340,45 @@ class TelemetryService {
|
|
|
27164
27340
|
throw error;
|
|
27165
27341
|
}
|
|
27166
27342
|
}
|
|
27343
|
+
trackRequestResult(name, durationMs, success, properties, context) {
|
|
27344
|
+
const requestContext = context ?? {
|
|
27345
|
+
operationId: this.operationId ?? getTelemetryOperationId(),
|
|
27346
|
+
id: this.generateId()
|
|
27347
|
+
};
|
|
27348
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, requestContext);
|
|
27349
|
+
this.telemetryProvider.trackRequest(name, durationMs, success, enrichedProperties);
|
|
27350
|
+
}
|
|
27351
|
+
createRequestContext() {
|
|
27352
|
+
const operationId = this.operationId ?? getTelemetryOperationId();
|
|
27353
|
+
const parentId = this.inboundParentIdFor(operationId);
|
|
27354
|
+
return {
|
|
27355
|
+
operationId,
|
|
27356
|
+
...parentId !== undefined ? { parentId } : {},
|
|
27357
|
+
id: this.generateId()
|
|
27358
|
+
};
|
|
27359
|
+
}
|
|
27360
|
+
inboundParentIdFor(operationId) {
|
|
27361
|
+
const inbound = getInboundTraceContext();
|
|
27362
|
+
return inbound && inbound.traceId === operationId ? inbound.parentSpanId : undefined;
|
|
27363
|
+
}
|
|
27364
|
+
runWithContext(context, fn) {
|
|
27365
|
+
return this.contextStorage.run(context, fn);
|
|
27366
|
+
}
|
|
27367
|
+
createDependencyContext() {
|
|
27368
|
+
const parentContext = this.getCurrentContext();
|
|
27369
|
+
if (!parentContext) {
|
|
27370
|
+
return;
|
|
27371
|
+
}
|
|
27372
|
+
return {
|
|
27373
|
+
operationId: parentContext.operationId,
|
|
27374
|
+
parentId: parentContext.id,
|
|
27375
|
+
id: this.generateId()
|
|
27376
|
+
};
|
|
27377
|
+
}
|
|
27378
|
+
trackDependencyResult(name, type2, durationMs, success, properties, context, resultCode) {
|
|
27379
|
+
const enrichedProperties = this.enrichPropertiesWithContext(properties, context);
|
|
27380
|
+
this.telemetryProvider.trackDependency(redactValue(name), type2, durationMs, success, enrichedProperties, resultCode);
|
|
27381
|
+
}
|
|
27167
27382
|
async trackDependencyOperation(name, type2, fn, properties) {
|
|
27168
27383
|
const parentContext = this.getCurrentContext();
|
|
27169
27384
|
if (!parentContext) {
|
|
@@ -27200,8 +27415,12 @@ class TelemetryService {
|
|
|
27200
27415
|
...getExecutionContextTelemetryProperties(),
|
|
27201
27416
|
...globalProperties,
|
|
27202
27417
|
...this.defaultProperties,
|
|
27203
|
-
...properties,
|
|
27204
|
-
...context
|
|
27418
|
+
...redactProperties(properties ?? {}),
|
|
27419
|
+
...context ? {
|
|
27420
|
+
[TELEMETRY_OPERATION_ID_PROPERTY]: context.operationId,
|
|
27421
|
+
...context.parentId !== undefined ? { [TELEMETRY_PARENT_ID_PROPERTY]: context.parentId } : {},
|
|
27422
|
+
[TELEMETRY_SPAN_ID_PROPERTY]: context.id
|
|
27423
|
+
} : {}
|
|
27205
27424
|
};
|
|
27206
27425
|
if (sessionId === undefined) {
|
|
27207
27426
|
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
@@ -27211,7 +27430,16 @@ class TelemetryService {
|
|
|
27211
27430
|
return enriched;
|
|
27212
27431
|
}
|
|
27213
27432
|
generateId() {
|
|
27214
|
-
|
|
27433
|
+
const bytes = new Uint8Array(8);
|
|
27434
|
+
let hex = "";
|
|
27435
|
+
do {
|
|
27436
|
+
crypto.getRandomValues(bytes);
|
|
27437
|
+
hex = "";
|
|
27438
|
+
for (const byte of bytes) {
|
|
27439
|
+
hex += byte.toString(16).padStart(2, "0");
|
|
27440
|
+
}
|
|
27441
|
+
} while (/^0+$/.test(hex));
|
|
27442
|
+
return hex;
|
|
27215
27443
|
}
|
|
27216
27444
|
}
|
|
27217
27445
|
// ../common/src/telemetry/node-appinsights-telemetry-provider.ts
|
|
@@ -27913,134 +28141,11 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
|
27913
28141
|
};
|
|
27914
28142
|
}
|
|
27915
28143
|
|
|
27916
|
-
// ../common/src/telemetry/pii-redactor.ts
|
|
27917
|
-
var REDACTED = "[REDACTED]";
|
|
27918
|
-
var MAX_VALUE_LENGTH = 200;
|
|
27919
|
-
var SENSITIVE_NAME_TOKENS = new Set([
|
|
27920
|
-
"token",
|
|
27921
|
-
"tokens",
|
|
27922
|
-
"secret",
|
|
27923
|
-
"secrets",
|
|
27924
|
-
"password",
|
|
27925
|
-
"passwords",
|
|
27926
|
-
"pwd",
|
|
27927
|
-
"credential",
|
|
27928
|
-
"credentials",
|
|
27929
|
-
"auth",
|
|
27930
|
-
"authentication",
|
|
27931
|
-
"authorization",
|
|
27932
|
-
"authority",
|
|
27933
|
-
"cert",
|
|
27934
|
-
"certificate",
|
|
27935
|
-
"certificates"
|
|
27936
|
-
]);
|
|
27937
|
-
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
27938
|
-
"api",
|
|
27939
|
-
"access",
|
|
27940
|
-
"client",
|
|
27941
|
-
"private",
|
|
27942
|
-
"public",
|
|
27943
|
-
"signing",
|
|
27944
|
-
"encryption",
|
|
27945
|
-
"session",
|
|
27946
|
-
"master",
|
|
27947
|
-
"shared",
|
|
27948
|
-
"root",
|
|
27949
|
-
"ssh",
|
|
27950
|
-
"rsa",
|
|
27951
|
-
"aes",
|
|
27952
|
-
"hmac",
|
|
27953
|
-
"oauth"
|
|
27954
|
-
]);
|
|
27955
|
-
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;
|
|
27956
|
-
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
27957
|
-
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
27958
|
-
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
27959
|
-
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
27960
|
-
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
27961
|
-
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
27962
|
-
function shortHash(input) {
|
|
27963
|
-
let hash = 2166136261;
|
|
27964
|
-
for (let i = 0;i < input.length; i++) {
|
|
27965
|
-
hash ^= input.charCodeAt(i);
|
|
27966
|
-
hash = Math.imul(hash, 16777619);
|
|
27967
|
-
}
|
|
27968
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
27969
|
-
}
|
|
27970
|
-
function redactUrl(raw) {
|
|
27971
|
-
try {
|
|
27972
|
-
const url = new URL(raw);
|
|
27973
|
-
return `${url.protocol}//${url.host}`;
|
|
27974
|
-
} catch {
|
|
27975
|
-
return `url#${shortHash(raw)}`;
|
|
27976
|
-
}
|
|
27977
|
-
}
|
|
27978
|
-
function redactValueDetectors(value) {
|
|
27979
|
-
let out = value;
|
|
27980
|
-
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
27981
|
-
out = out.replace(URL_PATTERN, (match) => {
|
|
27982
|
-
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
27983
|
-
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
27984
|
-
return `${redactUrl(core2)}${trailing}`;
|
|
27985
|
-
});
|
|
27986
|
-
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
27987
|
-
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
27988
|
-
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
27989
|
-
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
27990
|
-
if (out.length > MAX_VALUE_LENGTH) {
|
|
27991
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
27992
|
-
}
|
|
27993
|
-
return out;
|
|
27994
|
-
}
|
|
27995
|
-
function nameTokens(name) {
|
|
27996
|
-
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);
|
|
27997
|
-
}
|
|
27998
|
-
function isSensitiveName(name) {
|
|
27999
|
-
const tokens = nameTokens(name);
|
|
28000
|
-
for (let i = 0;i < tokens.length; i++) {
|
|
28001
|
-
const token = tokens[i];
|
|
28002
|
-
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
28003
|
-
return true;
|
|
28004
|
-
}
|
|
28005
|
-
if (token === "key" || token === "keys") {
|
|
28006
|
-
const prev = tokens[i - 1];
|
|
28007
|
-
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
28008
|
-
return true;
|
|
28009
|
-
}
|
|
28010
|
-
}
|
|
28011
|
-
}
|
|
28012
|
-
return false;
|
|
28013
|
-
}
|
|
28014
|
-
function redactProperty(name, value) {
|
|
28015
|
-
if (value === undefined || value === null) {
|
|
28016
|
-
return;
|
|
28017
|
-
}
|
|
28018
|
-
if (isSensitiveName(name)) {
|
|
28019
|
-
return REDACTED;
|
|
28020
|
-
}
|
|
28021
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
28022
|
-
return value;
|
|
28023
|
-
}
|
|
28024
|
-
if (typeof value !== "string") {
|
|
28025
|
-
return "[OBJECT]";
|
|
28026
|
-
}
|
|
28027
|
-
return redactValueDetectors(value);
|
|
28028
|
-
}
|
|
28029
|
-
function redactProperties(properties) {
|
|
28030
|
-
const out = {};
|
|
28031
|
-
for (const [name, value] of Object.entries(properties)) {
|
|
28032
|
-
const redacted = redactProperty(name, value);
|
|
28033
|
-
if (redacted !== undefined) {
|
|
28034
|
-
out[name] = redacted;
|
|
28035
|
-
}
|
|
28036
|
-
}
|
|
28037
|
-
return out;
|
|
28038
|
-
}
|
|
28039
|
-
|
|
28040
28144
|
// ../common/src/trackedAction.ts
|
|
28041
28145
|
var pollSignalSlot = singleton("PollSignal");
|
|
28042
28146
|
var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
|
|
28043
28147
|
var retryHintValues = new Set(RETRY_HINTS);
|
|
28148
|
+
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
28044
28149
|
var processContext = {
|
|
28045
28150
|
exit: (code) => {
|
|
28046
28151
|
process.exitCode = code;
|
|
@@ -28051,22 +28156,18 @@ var processContext = {
|
|
|
28051
28156
|
};
|
|
28052
28157
|
function extractCommandParams(cmd) {
|
|
28053
28158
|
const params = {};
|
|
28159
|
+
const add2 = (name, value) => {
|
|
28160
|
+
if (name && value !== undefined) {
|
|
28161
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
|
|
28162
|
+
}
|
|
28163
|
+
};
|
|
28054
28164
|
const registered = cmd.registeredArguments ?? [];
|
|
28055
28165
|
const processed = cmd.processedArgs ?? [];
|
|
28056
28166
|
for (let i = 0;i < registered.length; i++) {
|
|
28057
|
-
|
|
28058
|
-
if (value === undefined) {
|
|
28059
|
-
continue;
|
|
28060
|
-
}
|
|
28061
|
-
const name = registered[i].name();
|
|
28062
|
-
if (name) {
|
|
28063
|
-
params[name] = value;
|
|
28064
|
-
}
|
|
28167
|
+
add2(registered[i].name(), processed[i]);
|
|
28065
28168
|
}
|
|
28066
28169
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
28067
|
-
|
|
28068
|
-
params[key] = value;
|
|
28069
|
-
}
|
|
28170
|
+
add2(key, value);
|
|
28070
28171
|
}
|
|
28071
28172
|
return params;
|
|
28072
28173
|
}
|
|
@@ -28109,11 +28210,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
28109
28210
|
return this.action(async (...args) => {
|
|
28110
28211
|
const telemetryName = deriveCommandPath(command);
|
|
28111
28212
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
28213
|
+
const requestContext = telemetry.createRequestContext();
|
|
28112
28214
|
const startTime = performance.now();
|
|
28113
28215
|
let errorMessage;
|
|
28114
28216
|
let fallbackExitCode = EXIT_CODES.Success;
|
|
28115
28217
|
clearRecordedCommandFailureTelemetry();
|
|
28116
|
-
const [error] = await catchError(fn(...args));
|
|
28218
|
+
const [error] = await catchError(telemetry.runWithContext(requestContext, () => fn(...args)));
|
|
28117
28219
|
if (error) {
|
|
28118
28220
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
28119
28221
|
logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
|
|
@@ -28149,16 +28251,21 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
28149
28251
|
recordedFailure,
|
|
28150
28252
|
pollSignal: context.pollSignal
|
|
28151
28253
|
});
|
|
28152
|
-
|
|
28153
|
-
|
|
28254
|
+
const commandParams = extractCommandParams(command);
|
|
28255
|
+
if (props) {
|
|
28256
|
+
for (const key of Object.keys(props)) {
|
|
28257
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
|
|
28258
|
+
}
|
|
28259
|
+
}
|
|
28260
|
+
const baseProperties = redactProperties({
|
|
28261
|
+
...commandParams,
|
|
28154
28262
|
...props,
|
|
28155
28263
|
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
28156
28264
|
command: "true",
|
|
28157
|
-
duration: String(durationMs),
|
|
28158
|
-
success: String(success),
|
|
28159
28265
|
...terminalTelemetry,
|
|
28160
28266
|
...errorMessage ? { errorMessage } : {}
|
|
28161
|
-
})
|
|
28267
|
+
});
|
|
28268
|
+
telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
|
|
28162
28269
|
});
|
|
28163
28270
|
};
|
|
28164
28271
|
// ../common/src/console-guard.ts
|
|
@@ -30220,7 +30327,7 @@ function createCommandForwarder(executeCommand) {
|
|
|
30220
30327
|
var package_default = {
|
|
30221
30328
|
name: "@uipath/context-grounding-tool",
|
|
30222
30329
|
license: "MIT",
|
|
30223
|
-
version: "1.198.0
|
|
30330
|
+
version: "1.198.0",
|
|
30224
30331
|
description: "Tool for context grounding operations via the UiPath Python SDK",
|
|
30225
30332
|
keywords: [
|
|
30226
30333
|
"uipcli-tool",
|
|
@@ -30323,4 +30430,4 @@ export {
|
|
|
30323
30430
|
metadata
|
|
30324
30431
|
};
|
|
30325
30432
|
|
|
30326
|
-
//# debugId=
|
|
30433
|
+
//# debugId=CC948125A156FB5664756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/context-grounding-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.198.0
|
|
4
|
+
"version": "1.198.0",
|
|
5
5
|
"description": "Tool for context grounding operations via the UiPath Python SDK",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"uipcli-tool",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"registry": "https://registry.npmjs.org/"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "1fadf03d7a8dd102742571dff569fdac11808afb"
|
|
32
32
|
}
|