@uipath/context-grounding-tool 1.199.0-preview.92 → 1.199.0-preview.99
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
|
|
@@ -27914,134 +28142,11 @@ function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
|
27914
28142
|
};
|
|
27915
28143
|
}
|
|
27916
28144
|
|
|
27917
|
-
// ../common/src/telemetry/pii-redactor.ts
|
|
27918
|
-
var REDACTED = "[REDACTED]";
|
|
27919
|
-
var MAX_VALUE_LENGTH = 200;
|
|
27920
|
-
var SENSITIVE_NAME_TOKENS = new Set([
|
|
27921
|
-
"token",
|
|
27922
|
-
"tokens",
|
|
27923
|
-
"secret",
|
|
27924
|
-
"secrets",
|
|
27925
|
-
"password",
|
|
27926
|
-
"passwords",
|
|
27927
|
-
"pwd",
|
|
27928
|
-
"credential",
|
|
27929
|
-
"credentials",
|
|
27930
|
-
"auth",
|
|
27931
|
-
"authentication",
|
|
27932
|
-
"authorization",
|
|
27933
|
-
"authority",
|
|
27934
|
-
"cert",
|
|
27935
|
-
"certificate",
|
|
27936
|
-
"certificates"
|
|
27937
|
-
]);
|
|
27938
|
-
var SENSITIVE_KEY_PREFIXES = new Set([
|
|
27939
|
-
"api",
|
|
27940
|
-
"access",
|
|
27941
|
-
"client",
|
|
27942
|
-
"private",
|
|
27943
|
-
"public",
|
|
27944
|
-
"signing",
|
|
27945
|
-
"encryption",
|
|
27946
|
-
"session",
|
|
27947
|
-
"master",
|
|
27948
|
-
"shared",
|
|
27949
|
-
"root",
|
|
27950
|
-
"ssh",
|
|
27951
|
-
"rsa",
|
|
27952
|
-
"aes",
|
|
27953
|
-
"hmac",
|
|
27954
|
-
"oauth"
|
|
27955
|
-
]);
|
|
27956
|
-
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;
|
|
27957
|
-
var EMAIL_PATTERN = /\b[^\s@]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g;
|
|
27958
|
-
var JWT_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g;
|
|
27959
|
-
var LONG_TOKEN_PATTERN = /\b[A-Za-z0-9_-]{40,}\b/g;
|
|
27960
|
-
var USER_HOME_PATTERN = /([/\\])(Users|home)([/\\])([^/\\]+)/gi;
|
|
27961
|
-
var URL_PATTERN = /\bhttps?:\/\/[^\s,;]+/gi;
|
|
27962
|
-
var URL_TRAILING_PUNCT = /[.,;:!?)\]}>'"]+$/;
|
|
27963
|
-
function shortHash(input) {
|
|
27964
|
-
let hash = 2166136261;
|
|
27965
|
-
for (let i = 0;i < input.length; i++) {
|
|
27966
|
-
hash ^= input.charCodeAt(i);
|
|
27967
|
-
hash = Math.imul(hash, 16777619);
|
|
27968
|
-
}
|
|
27969
|
-
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
27970
|
-
}
|
|
27971
|
-
function redactUrl(raw) {
|
|
27972
|
-
try {
|
|
27973
|
-
const url = new URL(raw);
|
|
27974
|
-
return `${url.protocol}//${url.host}`;
|
|
27975
|
-
} catch {
|
|
27976
|
-
return `url#${shortHash(raw)}`;
|
|
27977
|
-
}
|
|
27978
|
-
}
|
|
27979
|
-
function redactValueDetectors(value) {
|
|
27980
|
-
let out = value;
|
|
27981
|
-
out = out.replace(JWT_PATTERN, () => REDACTED);
|
|
27982
|
-
out = out.replace(URL_PATTERN, (match) => {
|
|
27983
|
-
const trailing = match.match(URL_TRAILING_PUNCT)?.[0] ?? "";
|
|
27984
|
-
const core2 = trailing ? match.slice(0, -trailing.length) : match;
|
|
27985
|
-
return `${redactUrl(core2)}${trailing}`;
|
|
27986
|
-
});
|
|
27987
|
-
out = out.replace(USER_HOME_PATTERN, (_match, sep1, folder, sep2) => `${sep1}${folder}${sep2}<user>`);
|
|
27988
|
-
out = out.replace(EMAIL_PATTERN, (match) => `email#${shortHash(match)}`);
|
|
27989
|
-
out = out.replace(UUID_PATTERN, (match) => `uuid#${shortHash(match)}`);
|
|
27990
|
-
out = out.replace(LONG_TOKEN_PATTERN, () => REDACTED);
|
|
27991
|
-
if (out.length > MAX_VALUE_LENGTH) {
|
|
27992
|
-
out = `${out.slice(0, MAX_VALUE_LENGTH)}…`;
|
|
27993
|
-
}
|
|
27994
|
-
return out;
|
|
27995
|
-
}
|
|
27996
|
-
function nameTokens(name) {
|
|
27997
|
-
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);
|
|
27998
|
-
}
|
|
27999
|
-
function isSensitiveName(name) {
|
|
28000
|
-
const tokens = nameTokens(name);
|
|
28001
|
-
for (let i = 0;i < tokens.length; i++) {
|
|
28002
|
-
const token = tokens[i];
|
|
28003
|
-
if (SENSITIVE_NAME_TOKENS.has(token)) {
|
|
28004
|
-
return true;
|
|
28005
|
-
}
|
|
28006
|
-
if (token === "key" || token === "keys") {
|
|
28007
|
-
const prev = tokens[i - 1];
|
|
28008
|
-
if (prev && SENSITIVE_KEY_PREFIXES.has(prev)) {
|
|
28009
|
-
return true;
|
|
28010
|
-
}
|
|
28011
|
-
}
|
|
28012
|
-
}
|
|
28013
|
-
return false;
|
|
28014
|
-
}
|
|
28015
|
-
function redactProperty(name, value) {
|
|
28016
|
-
if (value === undefined || value === null) {
|
|
28017
|
-
return;
|
|
28018
|
-
}
|
|
28019
|
-
if (isSensitiveName(name)) {
|
|
28020
|
-
return REDACTED;
|
|
28021
|
-
}
|
|
28022
|
-
if (typeof value === "boolean" || typeof value === "number") {
|
|
28023
|
-
return value;
|
|
28024
|
-
}
|
|
28025
|
-
if (typeof value !== "string") {
|
|
28026
|
-
return "[OBJECT]";
|
|
28027
|
-
}
|
|
28028
|
-
return redactValueDetectors(value);
|
|
28029
|
-
}
|
|
28030
|
-
function redactProperties(properties) {
|
|
28031
|
-
const out = {};
|
|
28032
|
-
for (const [name, value] of Object.entries(properties)) {
|
|
28033
|
-
const redacted = redactProperty(name, value);
|
|
28034
|
-
if (redacted !== undefined) {
|
|
28035
|
-
out[name] = redacted;
|
|
28036
|
-
}
|
|
28037
|
-
}
|
|
28038
|
-
return out;
|
|
28039
|
-
}
|
|
28040
|
-
|
|
28041
28145
|
// ../common/src/trackedAction.ts
|
|
28042
28146
|
var pollSignalSlot = singleton("PollSignal");
|
|
28043
28147
|
var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
|
|
28044
28148
|
var retryHintValues = new Set(RETRY_HINTS);
|
|
28149
|
+
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
28045
28150
|
var processContext = {
|
|
28046
28151
|
exit: (code) => {
|
|
28047
28152
|
process.exitCode = code;
|
|
@@ -28052,22 +28157,18 @@ var processContext = {
|
|
|
28052
28157
|
};
|
|
28053
28158
|
function extractCommandParams(cmd) {
|
|
28054
28159
|
const params = {};
|
|
28160
|
+
const add2 = (name, value) => {
|
|
28161
|
+
if (name && value !== undefined) {
|
|
28162
|
+
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = value;
|
|
28163
|
+
}
|
|
28164
|
+
};
|
|
28055
28165
|
const registered = cmd.registeredArguments ?? [];
|
|
28056
28166
|
const processed = cmd.processedArgs ?? [];
|
|
28057
28167
|
for (let i = 0;i < registered.length; i++) {
|
|
28058
|
-
|
|
28059
|
-
if (value === undefined) {
|
|
28060
|
-
continue;
|
|
28061
|
-
}
|
|
28062
|
-
const name = registered[i].name();
|
|
28063
|
-
if (name) {
|
|
28064
|
-
params[name] = value;
|
|
28065
|
-
}
|
|
28168
|
+
add2(registered[i].name(), processed[i]);
|
|
28066
28169
|
}
|
|
28067
28170
|
for (const [key, value] of Object.entries(cmd.opts())) {
|
|
28068
|
-
|
|
28069
|
-
params[key] = value;
|
|
28070
|
-
}
|
|
28171
|
+
add2(key, value);
|
|
28071
28172
|
}
|
|
28072
28173
|
return params;
|
|
28073
28174
|
}
|
|
@@ -28110,11 +28211,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
28110
28211
|
return this.action(async (...args) => {
|
|
28111
28212
|
const telemetryName = deriveCommandPath(command);
|
|
28112
28213
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
28214
|
+
const requestContext = telemetry.createRequestContext();
|
|
28113
28215
|
const startTime = performance.now();
|
|
28114
28216
|
let errorMessage;
|
|
28115
28217
|
let fallbackExitCode = EXIT_CODES.Success;
|
|
28116
28218
|
clearRecordedCommandFailureTelemetry();
|
|
28117
|
-
const [error] = await catchError(fn(...args));
|
|
28219
|
+
const [error] = await catchError(telemetry.runWithContext(requestContext, () => fn(...args)));
|
|
28118
28220
|
if (error) {
|
|
28119
28221
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
28120
28222
|
logger.debug(`[trackedAction] ${telemetryName} failed: ${errorMessage}`);
|
|
@@ -28150,16 +28252,21 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
28150
28252
|
recordedFailure,
|
|
28151
28253
|
pollSignal: context.pollSignal
|
|
28152
28254
|
});
|
|
28153
|
-
|
|
28154
|
-
|
|
28255
|
+
const commandParams = extractCommandParams(command);
|
|
28256
|
+
if (props) {
|
|
28257
|
+
for (const key of Object.keys(props)) {
|
|
28258
|
+
delete commandParams[`${TELEMETRY_COMMAND_ARG_PREFIX}${key}`];
|
|
28259
|
+
}
|
|
28260
|
+
}
|
|
28261
|
+
const baseProperties = redactProperties({
|
|
28262
|
+
...commandParams,
|
|
28155
28263
|
...props,
|
|
28156
28264
|
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
28157
28265
|
command: "true",
|
|
28158
|
-
duration: String(durationMs),
|
|
28159
|
-
success: String(success),
|
|
28160
28266
|
...terminalTelemetry,
|
|
28161
28267
|
...errorMessage ? { errorMessage } : {}
|
|
28162
|
-
})
|
|
28268
|
+
});
|
|
28269
|
+
telemetry.trackRequestResult(telemetryName, durationMs, success, baseProperties, requestContext);
|
|
28163
28270
|
});
|
|
28164
28271
|
};
|
|
28165
28272
|
// ../common/src/console-guard.ts
|
|
@@ -30221,7 +30328,7 @@ function createCommandForwarder(executeCommand) {
|
|
|
30221
30328
|
var package_default = {
|
|
30222
30329
|
name: "@uipath/context-grounding-tool",
|
|
30223
30330
|
license: "MIT",
|
|
30224
|
-
version: "1.199.0-preview.
|
|
30331
|
+
version: "1.199.0-preview.99",
|
|
30225
30332
|
description: "Tool for context grounding operations via the UiPath Python SDK",
|
|
30226
30333
|
keywords: [
|
|
30227
30334
|
"uipcli-tool",
|
|
@@ -30324,4 +30431,4 @@ export {
|
|
|
30324
30431
|
metadata
|
|
30325
30432
|
};
|
|
30326
30433
|
|
|
30327
|
-
//# debugId=
|
|
30434
|
+
//# debugId=908C765F29ACC6C864756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/context-grounding-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.199.0-preview.
|
|
4
|
+
"version": "1.199.0-preview.99",
|
|
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": "6ba217cddceb86e3fa39ed82e49c5062878a85c6"
|
|
32
32
|
}
|