@uipath/insights-tool 1.197.0-preview.65 → 1.197.0-preview.67
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 +578 -9
- package/package.json +2 -2
package/dist/tool.js
CHANGED
|
@@ -2128,7 +2128,7 @@ var require_commander = __commonJS((exports) => {
|
|
|
2128
2128
|
var package_default = {
|
|
2129
2129
|
name: "@uipath/insights-tool",
|
|
2130
2130
|
license: "MIT",
|
|
2131
|
-
version: "1.197.0-preview.
|
|
2131
|
+
version: "1.197.0-preview.67",
|
|
2132
2132
|
description: "Query UiPath Insights data — jobs, failures, and performance metrics.",
|
|
2133
2133
|
private: false,
|
|
2134
2134
|
repository: {
|
|
@@ -8060,9 +8060,228 @@ function getOutputFilter() {
|
|
|
8060
8060
|
return filterSlot.get();
|
|
8061
8061
|
}
|
|
8062
8062
|
|
|
8063
|
+
// ../common/src/telemetry/command-terminal.ts
|
|
8064
|
+
var recordedFailureSlot = singleton("CommandTelemetryFailure");
|
|
8065
|
+
var AUTH_ERROR_CODES = new Set([
|
|
8066
|
+
"authentication_required",
|
|
8067
|
+
"permission_denied"
|
|
8068
|
+
]);
|
|
8069
|
+
var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
|
|
8070
|
+
var NETWORK_HTTP_ERROR_CODES = new Set([
|
|
8071
|
+
"network_error",
|
|
8072
|
+
"rate_limited",
|
|
8073
|
+
"server_error",
|
|
8074
|
+
"not_found",
|
|
8075
|
+
"method_not_allowed"
|
|
8076
|
+
]);
|
|
8077
|
+
var TIMEOUT_ERROR_CODES = new Set(["timeout"]);
|
|
8078
|
+
var NETWORK_OS_ERROR_CODES = new Set([
|
|
8079
|
+
"ECONNREFUSED",
|
|
8080
|
+
"ECONNRESET",
|
|
8081
|
+
"ENOTFOUND",
|
|
8082
|
+
"EAI_AGAIN",
|
|
8083
|
+
"EPIPE",
|
|
8084
|
+
"EHOSTUNREACH",
|
|
8085
|
+
"ENETUNREACH",
|
|
8086
|
+
"EAI_FAIL"
|
|
8087
|
+
]);
|
|
8088
|
+
var TIMEOUT_OS_ERROR_CODES = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
|
|
8089
|
+
var TLS_ERROR_CODES2 = new Set([
|
|
8090
|
+
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
8091
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
8092
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
8093
|
+
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
8094
|
+
"UNABLE_TO_GET_ISSUER_CERT",
|
|
8095
|
+
"CERT_HAS_EXPIRED",
|
|
8096
|
+
"CERT_UNTRUSTED",
|
|
8097
|
+
"ERR_TLS_CERT_ALTNAME_INVALID"
|
|
8098
|
+
]);
|
|
8099
|
+
var MISSING_DEPENDENCY_CODES = new Set([
|
|
8100
|
+
"MODULE_NOT_FOUND",
|
|
8101
|
+
"ERR_MODULE_NOT_FOUND"
|
|
8102
|
+
]);
|
|
8103
|
+
var INTERNAL_ERROR_NAMES = new Set([
|
|
8104
|
+
"TypeError",
|
|
8105
|
+
"ReferenceError",
|
|
8106
|
+
"SyntaxError",
|
|
8107
|
+
"RangeError"
|
|
8108
|
+
]);
|
|
8109
|
+
function isRecord(value) {
|
|
8110
|
+
return value !== null && typeof value === "object";
|
|
8111
|
+
}
|
|
8112
|
+
function stringField(value, field) {
|
|
8113
|
+
if (!isRecord(value)) {
|
|
8114
|
+
return;
|
|
8115
|
+
}
|
|
8116
|
+
const raw = value[field];
|
|
8117
|
+
return typeof raw === "string" ? raw : undefined;
|
|
8118
|
+
}
|
|
8119
|
+
function numberField(value, field) {
|
|
8120
|
+
if (!isRecord(value)) {
|
|
8121
|
+
return;
|
|
8122
|
+
}
|
|
8123
|
+
const raw = value[field];
|
|
8124
|
+
return typeof raw === "number" ? raw : undefined;
|
|
8125
|
+
}
|
|
8126
|
+
function findStringInCauseChain(error, field) {
|
|
8127
|
+
let current = error;
|
|
8128
|
+
for (let depth = 0;depth < 5 && current !== null && typeof current === "object"; depth++) {
|
|
8129
|
+
const value = stringField(current, field);
|
|
8130
|
+
if (value) {
|
|
8131
|
+
return value;
|
|
8132
|
+
}
|
|
8133
|
+
current = current.cause;
|
|
8134
|
+
}
|
|
8135
|
+
return;
|
|
8136
|
+
}
|
|
8137
|
+
function findCodeInCauseChain(error) {
|
|
8138
|
+
return findStringInCauseChain(error, "code");
|
|
8139
|
+
}
|
|
8140
|
+
function isSpawnEnoent(error) {
|
|
8141
|
+
const code = findCodeInCauseChain(error);
|
|
8142
|
+
if (code !== "ENOENT") {
|
|
8143
|
+
return false;
|
|
8144
|
+
}
|
|
8145
|
+
const syscall = findStringInCauseChain(error, "syscall");
|
|
8146
|
+
return syscall?.startsWith("spawn") === true;
|
|
8147
|
+
}
|
|
8148
|
+
function isCancellationError(error, exitCode, pollSignal) {
|
|
8149
|
+
if (exitCode === 130) {
|
|
8150
|
+
return true;
|
|
8151
|
+
}
|
|
8152
|
+
if (!isRecord(error)) {
|
|
8153
|
+
return false;
|
|
8154
|
+
}
|
|
8155
|
+
if (numberField(error, "exitCode") === 130) {
|
|
8156
|
+
return true;
|
|
8157
|
+
}
|
|
8158
|
+
const name = stringField(error, "name");
|
|
8159
|
+
if (name === "ExitPromptError") {
|
|
8160
|
+
return true;
|
|
8161
|
+
}
|
|
8162
|
+
if (name === "AbortError" && pollSignal?.aborted) {
|
|
8163
|
+
return true;
|
|
8164
|
+
}
|
|
8165
|
+
const message = stringField(error, "message");
|
|
8166
|
+
return message?.includes("SIGINT") === true;
|
|
8167
|
+
}
|
|
8168
|
+
function terminalSignalFor(input, outcome) {
|
|
8169
|
+
if (input.recordedFailure?.terminalSignal) {
|
|
8170
|
+
return input.recordedFailure.terminalSignal;
|
|
8171
|
+
}
|
|
8172
|
+
const explicit = findStringInCauseChain(input.error, "terminalSignal") ?? findStringInCauseChain(input.error, "signal");
|
|
8173
|
+
if (explicit) {
|
|
8174
|
+
return explicit;
|
|
8175
|
+
}
|
|
8176
|
+
return outcome === "cancelled" ? "SIGINT" : undefined;
|
|
8177
|
+
}
|
|
8178
|
+
function classifyHttpStatus(status) {
|
|
8179
|
+
if (status === 401 || status === 403) {
|
|
8180
|
+
return "auth";
|
|
8181
|
+
}
|
|
8182
|
+
if (status === 400 || status === 409 || status === 422) {
|
|
8183
|
+
return "validation";
|
|
8184
|
+
}
|
|
8185
|
+
if (status === 408) {
|
|
8186
|
+
return "timeout";
|
|
8187
|
+
}
|
|
8188
|
+
return "network_http";
|
|
8189
|
+
}
|
|
8190
|
+
function classifyFromResult(result) {
|
|
8191
|
+
switch (result) {
|
|
8192
|
+
case "AuthenticationError":
|
|
8193
|
+
return "auth";
|
|
8194
|
+
case "ValidationError":
|
|
8195
|
+
return "validation";
|
|
8196
|
+
case "TimeoutError":
|
|
8197
|
+
return "timeout";
|
|
8198
|
+
default:
|
|
8199
|
+
return;
|
|
8200
|
+
}
|
|
8201
|
+
}
|
|
8202
|
+
function classifyFromErrorCode(errorCode) {
|
|
8203
|
+
if (!errorCode) {
|
|
8204
|
+
return;
|
|
8205
|
+
}
|
|
8206
|
+
if (AUTH_ERROR_CODES.has(errorCode)) {
|
|
8207
|
+
return "auth";
|
|
8208
|
+
}
|
|
8209
|
+
if (VALIDATION_ERROR_CODES.has(errorCode)) {
|
|
8210
|
+
return "validation";
|
|
8211
|
+
}
|
|
8212
|
+
if (TIMEOUT_ERROR_CODES.has(errorCode)) {
|
|
8213
|
+
return "timeout";
|
|
8214
|
+
}
|
|
8215
|
+
if (NETWORK_HTTP_ERROR_CODES.has(errorCode)) {
|
|
8216
|
+
return "network_http";
|
|
8217
|
+
}
|
|
8218
|
+
return;
|
|
8219
|
+
}
|
|
8220
|
+
function classifyFromError(error) {
|
|
8221
|
+
const code = findCodeInCauseChain(error);
|
|
8222
|
+
if (code) {
|
|
8223
|
+
if (code.startsWith("commander.")) {
|
|
8224
|
+
return "validation";
|
|
8225
|
+
}
|
|
8226
|
+
if (NETWORK_OS_ERROR_CODES.has(code) || TLS_ERROR_CODES2.has(code)) {
|
|
8227
|
+
return "network_http";
|
|
8228
|
+
}
|
|
8229
|
+
if (TIMEOUT_OS_ERROR_CODES.has(code)) {
|
|
8230
|
+
return "timeout";
|
|
8231
|
+
}
|
|
8232
|
+
if (MISSING_DEPENDENCY_CODES.has(code) || isSpawnEnoent(error)) {
|
|
8233
|
+
return "missing_dependency";
|
|
8234
|
+
}
|
|
8235
|
+
}
|
|
8236
|
+
const message = stringField(error, "message");
|
|
8237
|
+
if (message?.includes("fetch failed") === true) {
|
|
8238
|
+
return "network_http";
|
|
8239
|
+
}
|
|
8240
|
+
const name = stringField(error, "name");
|
|
8241
|
+
if (name && INTERNAL_ERROR_NAMES.has(name)) {
|
|
8242
|
+
return "internal";
|
|
8243
|
+
}
|
|
8244
|
+
return;
|
|
8245
|
+
}
|
|
8246
|
+
function classifyError(input) {
|
|
8247
|
+
const recorded = input.recordedFailure;
|
|
8248
|
+
if (recorded?.errorClass) {
|
|
8249
|
+
return recorded.errorClass;
|
|
8250
|
+
}
|
|
8251
|
+
const status = recorded?.context?.httpStatus;
|
|
8252
|
+
if (status !== undefined) {
|
|
8253
|
+
return classifyHttpStatus(status);
|
|
8254
|
+
}
|
|
8255
|
+
return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
|
|
8256
|
+
}
|
|
8257
|
+
function recordCommandFailureTelemetry(failure) {
|
|
8258
|
+
recordedFailureSlot.set(failure);
|
|
8259
|
+
}
|
|
8260
|
+
function clearRecordedCommandFailureTelemetry() {
|
|
8261
|
+
recordedFailureSlot.clear();
|
|
8262
|
+
}
|
|
8263
|
+
function takeRecordedCommandFailureTelemetry() {
|
|
8264
|
+
const failure = recordedFailureSlot.get();
|
|
8265
|
+
recordedFailureSlot.clear();
|
|
8266
|
+
return failure;
|
|
8267
|
+
}
|
|
8268
|
+
function buildCommandTerminalTelemetryProperties(input) {
|
|
8269
|
+
const cancelled = isCancellationError(input.error, input.exitCode, input.pollSignal);
|
|
8270
|
+
const outcome = input.recordedFailure?.terminalOutcome ?? (input.exitCode === 0 ? "success" : cancelled ? "cancelled" : "failure");
|
|
8271
|
+
const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError(input);
|
|
8272
|
+
const terminalSignal = terminalSignalFor(input, outcome);
|
|
8273
|
+
return {
|
|
8274
|
+
exit_code: input.exitCode,
|
|
8275
|
+
terminal_outcome: outcome,
|
|
8276
|
+
...errorClass ? { error_class: errorClass } : {},
|
|
8277
|
+
...terminalSignal ? { terminal_signal: terminalSignal } : {}
|
|
8278
|
+
};
|
|
8279
|
+
}
|
|
8280
|
+
|
|
8063
8281
|
// ../common/src/telemetry/telemetry-events.ts
|
|
8064
8282
|
var CommonTelemetryEvents = {
|
|
8065
|
-
Error: "uip.error"
|
|
8283
|
+
Error: "uip.error",
|
|
8284
|
+
ShipSucceeded: "ship_succeeded"
|
|
8066
8285
|
};
|
|
8067
8286
|
|
|
8068
8287
|
// ../common/src/registry.ts
|
|
@@ -8129,6 +8348,136 @@ function formatMessage(category, name, properties) {
|
|
|
8129
8348
|
}
|
|
8130
8349
|
return message;
|
|
8131
8350
|
}
|
|
8351
|
+
// ../common/src/telemetry/detect-agent.ts
|
|
8352
|
+
var KNOWN_AGENTS = [
|
|
8353
|
+
{ envVar: "CLAUDECODE", value: "1", id: "claude-code" },
|
|
8354
|
+
{ envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
|
|
8355
|
+
{ envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
|
|
8356
|
+
{ envVar: "CODEX_THREAD_ID", id: "codex" },
|
|
8357
|
+
{ envVar: "CODEX_SANDBOX", id: "codex" },
|
|
8358
|
+
{ envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
|
|
8359
|
+
{ envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
|
|
8360
|
+
];
|
|
8361
|
+
function detectAgentFromEnv(env) {
|
|
8362
|
+
for (const agent of KNOWN_AGENTS) {
|
|
8363
|
+
const envValue = env[agent.envVar];
|
|
8364
|
+
if (agent.value !== undefined) {
|
|
8365
|
+
if (envValue === agent.value)
|
|
8366
|
+
return agent.id;
|
|
8367
|
+
} else {
|
|
8368
|
+
if (envValue)
|
|
8369
|
+
return agent.id;
|
|
8370
|
+
}
|
|
8371
|
+
}
|
|
8372
|
+
const agentEnv = env.AGENT;
|
|
8373
|
+
if (agentEnv) {
|
|
8374
|
+
if (agentEnv === "1" || agentEnv === "true")
|
|
8375
|
+
return "unknown";
|
|
8376
|
+
if (agentEnv.length <= 32)
|
|
8377
|
+
return agentEnv.toLowerCase();
|
|
8378
|
+
}
|
|
8379
|
+
return;
|
|
8380
|
+
}
|
|
8381
|
+
// ../common/src/telemetry/environment-info.ts
|
|
8382
|
+
var LOCAL_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
|
|
8383
|
+
// ../common/src/telemetry/execution-context.ts
|
|
8384
|
+
var authSignalSlot = singleton("TelemetryExecutionContextAuthSignal");
|
|
8385
|
+
var isTruthy = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false";
|
|
8386
|
+
var isEqual = (value, expected) => value?.toLowerCase() === expected;
|
|
8387
|
+
var CI_SIGNATURES = [
|
|
8388
|
+
{
|
|
8389
|
+
provider: "github_actions",
|
|
8390
|
+
matches: (env) => isTruthy(env.GITHUB_ACTIONS),
|
|
8391
|
+
isScheduler: (env) => env.GITHUB_EVENT_NAME === "schedule"
|
|
8392
|
+
},
|
|
8393
|
+
{
|
|
8394
|
+
provider: "azure_devops",
|
|
8395
|
+
matches: (env) => isTruthy(env.TF_BUILD),
|
|
8396
|
+
isScheduler: (env) => isEqual(env.BUILD_REASON, "schedule")
|
|
8397
|
+
},
|
|
8398
|
+
{
|
|
8399
|
+
provider: "gitlab",
|
|
8400
|
+
matches: (env) => isTruthy(env.GITLAB_CI),
|
|
8401
|
+
isScheduler: (env) => env.CI_PIPELINE_SOURCE === "schedule"
|
|
8402
|
+
},
|
|
8403
|
+
{
|
|
8404
|
+
provider: "circleci",
|
|
8405
|
+
matches: (env) => isTruthy(env.CIRCLECI),
|
|
8406
|
+
isScheduler: (env) => env.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
|
|
8407
|
+
},
|
|
8408
|
+
{
|
|
8409
|
+
provider: "jenkins",
|
|
8410
|
+
matches: (env) => isTruthy(env.JENKINS_URL) || isTruthy(env.JENKINS_HOME)
|
|
8411
|
+
},
|
|
8412
|
+
{
|
|
8413
|
+
provider: "teamcity",
|
|
8414
|
+
matches: (env) => isTruthy(env.TEAMCITY_VERSION)
|
|
8415
|
+
},
|
|
8416
|
+
{
|
|
8417
|
+
provider: "buildkite",
|
|
8418
|
+
matches: (env) => isTruthy(env.BUILDKITE),
|
|
8419
|
+
isScheduler: (env) => env.BUILDKITE_SOURCE === "schedule"
|
|
8420
|
+
},
|
|
8421
|
+
{
|
|
8422
|
+
provider: "bitbucket",
|
|
8423
|
+
matches: (env) => isTruthy(env.BITBUCKET_BUILD_NUMBER)
|
|
8424
|
+
},
|
|
8425
|
+
{
|
|
8426
|
+
provider: "travis",
|
|
8427
|
+
matches: (env) => isTruthy(env.TRAVIS)
|
|
8428
|
+
},
|
|
8429
|
+
{
|
|
8430
|
+
provider: "appveyor",
|
|
8431
|
+
matches: (env) => isTruthy(env.APPVEYOR)
|
|
8432
|
+
},
|
|
8433
|
+
{
|
|
8434
|
+
provider: "generic",
|
|
8435
|
+
matches: (env) => isTruthy(env.CI)
|
|
8436
|
+
}
|
|
8437
|
+
];
|
|
8438
|
+
function currentEnv() {
|
|
8439
|
+
return typeof process === "undefined" ? {} : process.env;
|
|
8440
|
+
}
|
|
8441
|
+
function currentTtyState() {
|
|
8442
|
+
if (typeof process === "undefined")
|
|
8443
|
+
return false;
|
|
8444
|
+
return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
|
|
8445
|
+
}
|
|
8446
|
+
function detectCi(env) {
|
|
8447
|
+
const signature = CI_SIGNATURES.find((candidate) => candidate.matches(env));
|
|
8448
|
+
if (!signature)
|
|
8449
|
+
return;
|
|
8450
|
+
return {
|
|
8451
|
+
executionContext: signature.isScheduler?.(env) ? "scheduler" : "ci",
|
|
8452
|
+
ciProvider: signature.provider
|
|
8453
|
+
};
|
|
8454
|
+
}
|
|
8455
|
+
function detectExecutionContext(options = {}) {
|
|
8456
|
+
const env = options.env ?? currentEnv();
|
|
8457
|
+
const ci = detectCi(env);
|
|
8458
|
+
if (ci)
|
|
8459
|
+
return ci;
|
|
8460
|
+
const agent = options.agent ?? detectAgentFromEnv(env);
|
|
8461
|
+
if (agent) {
|
|
8462
|
+
return { executionContext: "agent" };
|
|
8463
|
+
}
|
|
8464
|
+
const authSignal = options.authSignal ?? authSignalSlot.get();
|
|
8465
|
+
if (authSignal === "service_account") {
|
|
8466
|
+
return { executionContext: "service_account" };
|
|
8467
|
+
}
|
|
8468
|
+
const isTty = options.isTty ?? currentTtyState();
|
|
8469
|
+
if (isTty) {
|
|
8470
|
+
return { executionContext: "manual" };
|
|
8471
|
+
}
|
|
8472
|
+
return { executionContext: "unknown" };
|
|
8473
|
+
}
|
|
8474
|
+
function getExecutionContextTelemetryProperties() {
|
|
8475
|
+
const detected = detectExecutionContext();
|
|
8476
|
+
return {
|
|
8477
|
+
execution_context: detected.executionContext,
|
|
8478
|
+
...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
|
|
8479
|
+
};
|
|
8480
|
+
}
|
|
8132
8481
|
// ../common/src/telemetry/node-context-storage.ts
|
|
8133
8482
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
8134
8483
|
|
|
@@ -8141,6 +8490,26 @@ class NodeContextStorage {
|
|
|
8141
8490
|
return this.storage.getStore();
|
|
8142
8491
|
}
|
|
8143
8492
|
}
|
|
8493
|
+
// ../common/src/telemetry/session-id.ts
|
|
8494
|
+
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
8495
|
+
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
8496
|
+
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
8497
|
+
function getProcessEnv() {
|
|
8498
|
+
return globalThis.process?.env;
|
|
8499
|
+
}
|
|
8500
|
+
function normalizeSessionId(value) {
|
|
8501
|
+
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
|
|
8502
|
+
return;
|
|
8503
|
+
}
|
|
8504
|
+
const trimmed = String(value).trim();
|
|
8505
|
+
return trimmed || undefined;
|
|
8506
|
+
}
|
|
8507
|
+
function getConfiguredTelemetrySessionId() {
|
|
8508
|
+
return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
8509
|
+
}
|
|
8510
|
+
function resolveTelemetrySessionId(existingSessionId) {
|
|
8511
|
+
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
8512
|
+
}
|
|
8144
8513
|
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
8145
8514
|
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
8146
8515
|
function getGlobalTelemetryProperties() {
|
|
@@ -8225,12 +8594,22 @@ class TelemetryService {
|
|
|
8225
8594
|
return this.contextStorage.getContext();
|
|
8226
8595
|
}
|
|
8227
8596
|
enrichPropertiesWithContext(properties, context) {
|
|
8228
|
-
|
|
8229
|
-
|
|
8597
|
+
const globalProperties = getGlobalTelemetryProperties();
|
|
8598
|
+
const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
|
|
8599
|
+
const sessionId = resolveTelemetrySessionId(existingSessionId);
|
|
8600
|
+
const enriched = {
|
|
8601
|
+
...getExecutionContextTelemetryProperties(),
|
|
8602
|
+
...globalProperties,
|
|
8230
8603
|
...this.defaultProperties,
|
|
8231
8604
|
...properties,
|
|
8232
8605
|
...context
|
|
8233
8606
|
};
|
|
8607
|
+
if (sessionId === undefined) {
|
|
8608
|
+
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
8609
|
+
} else {
|
|
8610
|
+
enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
|
|
8611
|
+
}
|
|
8612
|
+
return enriched;
|
|
8234
8613
|
}
|
|
8235
8614
|
generateId() {
|
|
8236
8615
|
return crypto.randomUUID().replaceAll("-", "");
|
|
@@ -8700,8 +9079,24 @@ var OutputFormatter;
|
|
|
8700
9079
|
data.ErrorCode ??= defaultErrorCodeForFailure(data);
|
|
8701
9080
|
data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
|
|
8702
9081
|
process.exitCode = EXIT_CODES[data.Result] ?? 1;
|
|
8703
|
-
|
|
8704
|
-
|
|
9082
|
+
recordCommandFailureTelemetry({
|
|
9083
|
+
result: data.Result,
|
|
9084
|
+
errorCode: data.ErrorCode,
|
|
9085
|
+
retry: data.Retry,
|
|
9086
|
+
message: data.Message,
|
|
9087
|
+
context: data.Context,
|
|
9088
|
+
exitCode: process.exitCode,
|
|
9089
|
+
errorClass: data.TelemetryErrorClass,
|
|
9090
|
+
terminalOutcome: data.TelemetryTerminalOutcome,
|
|
9091
|
+
terminalSignal: data.TelemetryTerminalSignal
|
|
9092
|
+
});
|
|
9093
|
+
const suppressTelemetry = data.SuppressTelemetry === true;
|
|
9094
|
+
const envelope = { ...data };
|
|
9095
|
+
delete envelope.SuppressTelemetry;
|
|
9096
|
+
delete envelope.TelemetryErrorClass;
|
|
9097
|
+
delete envelope.TelemetryTerminalOutcome;
|
|
9098
|
+
delete envelope.TelemetryTerminalSignal;
|
|
9099
|
+
if (!suppressTelemetry) {
|
|
8705
9100
|
telemetry.trackEvent(CommonTelemetryEvents.Error, {
|
|
8706
9101
|
result: data.Result,
|
|
8707
9102
|
errorCode: data.ErrorCode,
|
|
@@ -8764,6 +9159,158 @@ var OutputFormatter;
|
|
|
8764
9159
|
OutputFormatter.formatToString = formatToString;
|
|
8765
9160
|
})(OutputFormatter ||= {});
|
|
8766
9161
|
|
|
9162
|
+
// ../common/src/telemetry/command-attribution.ts
|
|
9163
|
+
var LEGACY_SKILL_NAMESPACE = "uipath:";
|
|
9164
|
+
var MAX_SKILL_NAME_LENGTH = 80;
|
|
9165
|
+
var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
|
|
9166
|
+
function productMode(productArea, mode) {
|
|
9167
|
+
return { product_area: productArea, mode };
|
|
9168
|
+
}
|
|
9169
|
+
function attributionRecord(groups) {
|
|
9170
|
+
const record = {};
|
|
9171
|
+
for (const [productArea, mode, names] of groups) {
|
|
9172
|
+
const attribution = productMode(productArea, mode);
|
|
9173
|
+
for (const name of names) {
|
|
9174
|
+
record[name] = attribution;
|
|
9175
|
+
}
|
|
9176
|
+
}
|
|
9177
|
+
return record;
|
|
9178
|
+
}
|
|
9179
|
+
function commandAttribution(groups) {
|
|
9180
|
+
const entries = [];
|
|
9181
|
+
for (const [productArea, mode, prefixes] of groups) {
|
|
9182
|
+
const attribution = productMode(productArea, mode);
|
|
9183
|
+
for (const prefix of prefixes) {
|
|
9184
|
+
entries.push({ prefix, attribution });
|
|
9185
|
+
}
|
|
9186
|
+
}
|
|
9187
|
+
return entries;
|
|
9188
|
+
}
|
|
9189
|
+
var SKILL_ATTRIBUTION = attributionRecord([
|
|
9190
|
+
["admin", "operate", ["uipath-admin"]],
|
|
9191
|
+
["agents", "build", ["uipath-agents"]],
|
|
9192
|
+
["api-workflow", "build", ["uipath-api-workflow"]],
|
|
9193
|
+
["automation-discovery", "build", ["uipath-automation-discovery"]],
|
|
9194
|
+
["coded-apps", "build", ["uipath-coded-apps"]],
|
|
9195
|
+
["data-fabric", "operate", ["uipath-data-fabric"]],
|
|
9196
|
+
["cli", "troubleshoot", ["uipath-feedback"]],
|
|
9197
|
+
["governance", "operate", ["uipath-governance"]],
|
|
9198
|
+
["action-center", "build", ["uipath-human-in-the-loop"]],
|
|
9199
|
+
["document-understanding", "build", ["uipath-ixp"]],
|
|
9200
|
+
[
|
|
9201
|
+
"maestro",
|
|
9202
|
+
"build",
|
|
9203
|
+
["uipath-maestro-bpmn", "uipath-maestro-case", "uipath-maestro-flow"]
|
|
9204
|
+
],
|
|
9205
|
+
["agenthub", "build", ["uipath-mcp-servers"]],
|
|
9206
|
+
["solution", "build", ["uipath-planner", "uipath-solution"]],
|
|
9207
|
+
["platform", "operate", ["uipath-platform"]],
|
|
9208
|
+
["quality", "troubleshoot", ["uipath-review"]],
|
|
9209
|
+
["rpa", "build", ["uipath-rpa"]],
|
|
9210
|
+
["cli", "operate", ["uipath-skill-catalog"]],
|
|
9211
|
+
["action-center", "operate", ["uipath-tasks"]],
|
|
9212
|
+
["test-manager", "operate", ["uipath-test"]],
|
|
9213
|
+
["platform", "troubleshoot", ["uipath-troubleshoot"]]
|
|
9214
|
+
]);
|
|
9215
|
+
var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
|
|
9216
|
+
var COMMAND_ATTRIBUTION = commandAttribution([
|
|
9217
|
+
["cli", "troubleshoot", ["uip.feedback"]],
|
|
9218
|
+
["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
|
|
9219
|
+
["context-grounding", "build", ["uip.context-grounding"]],
|
|
9220
|
+
["api-workflow", "build", ["uip.api-workflow"]],
|
|
9221
|
+
["rpa", "build", ["uip.rpa-legacy"]],
|
|
9222
|
+
["conversational", "operate", ["uip.conversational"]],
|
|
9223
|
+
["agents", "build", ["uip.codedagent", "uip.agent"]],
|
|
9224
|
+
["agenthub", "build", ["uip.agenthub"]],
|
|
9225
|
+
["coded-apps", "build", ["uip.codedapp"]],
|
|
9226
|
+
["functions", "build", ["uip.functions"]],
|
|
9227
|
+
["solution", "build", ["uip.solution"]],
|
|
9228
|
+
["maestro", "build", ["uip.maestro", "uip.case", "uip.flow"]],
|
|
9229
|
+
["llm-observability", "troubleshoot", ["uip.traces"]],
|
|
9230
|
+
["platform", "operate", ["uip.platform"]],
|
|
9231
|
+
["admin", "operate", ["uip.admin"]],
|
|
9232
|
+
["automation-ops", "operate", ["uip.aops"]],
|
|
9233
|
+
["documentation", "troubleshoot", ["uip.docsai"]],
|
|
9234
|
+
["governance", "operate", ["uip.gov"]],
|
|
9235
|
+
["insights", "operate", ["uip.insights"]],
|
|
9236
|
+
["document-understanding", "build", ["uip.ixp"]],
|
|
9237
|
+
["process-mining", "operate", ["uip.pm"]],
|
|
9238
|
+
["action-center", "operate", ["uip.tasks"]],
|
|
9239
|
+
["test-manager", "operate", ["uip.tm"]],
|
|
9240
|
+
["vertical-solutions", "build", ["uip.vss"]],
|
|
9241
|
+
["data-fabric", "operate", ["uip.df"]],
|
|
9242
|
+
["integration-service", "build", ["uip.is"]],
|
|
9243
|
+
["orchestrator", "operate", ["uip.or"]],
|
|
9244
|
+
[
|
|
9245
|
+
"cli",
|
|
9246
|
+
"operate",
|
|
9247
|
+
[
|
|
9248
|
+
"uip.login",
|
|
9249
|
+
"uip.logout",
|
|
9250
|
+
"uip.user",
|
|
9251
|
+
"uip.config",
|
|
9252
|
+
"uip.tools",
|
|
9253
|
+
"uip.skills",
|
|
9254
|
+
"uip.completion",
|
|
9255
|
+
"uip.update",
|
|
9256
|
+
"uip.mcp",
|
|
9257
|
+
"uip.track"
|
|
9258
|
+
]
|
|
9259
|
+
]
|
|
9260
|
+
]).sort((a, b) => b.prefix.length - a.prefix.length);
|
|
9261
|
+
function normalizeCommandPath(value) {
|
|
9262
|
+
if (typeof value !== "string") {
|
|
9263
|
+
return;
|
|
9264
|
+
}
|
|
9265
|
+
const trimmed = value.trim().toLowerCase();
|
|
9266
|
+
if (!trimmed) {
|
|
9267
|
+
return;
|
|
9268
|
+
}
|
|
9269
|
+
const tokens = trimmed.includes(" ") ? trimmed.split(/\s+/).filter((token) => token.length > 0).filter((token) => !token.startsWith("-")) : trimmed.split(".").filter((token) => token.length > 0);
|
|
9270
|
+
if (tokens.length === 0) {
|
|
9271
|
+
return;
|
|
9272
|
+
}
|
|
9273
|
+
const commandTokens = tokens[0] === "uip" ? tokens : ["uip", ...tokens];
|
|
9274
|
+
return commandTokens.join(".");
|
|
9275
|
+
}
|
|
9276
|
+
function getCommandProductModeAttribution(commandPath) {
|
|
9277
|
+
const normalized = normalizeCommandPath(commandPath);
|
|
9278
|
+
if (!normalized) {
|
|
9279
|
+
return;
|
|
9280
|
+
}
|
|
9281
|
+
return COMMAND_ATTRIBUTION.find(({ prefix }) => normalized === prefix || normalized.startsWith(`${prefix}.`))?.attribution;
|
|
9282
|
+
}
|
|
9283
|
+
function normalizeSkillNameWithOptions(value, options) {
|
|
9284
|
+
if (typeof value !== "string") {
|
|
9285
|
+
return;
|
|
9286
|
+
}
|
|
9287
|
+
const normalized = value.trim().toLowerCase();
|
|
9288
|
+
if (!normalized) {
|
|
9289
|
+
return;
|
|
9290
|
+
}
|
|
9291
|
+
const hasLegacyNamespace = normalized.startsWith(LEGACY_SKILL_NAMESPACE);
|
|
9292
|
+
if (hasLegacyNamespace && !options.allowLegacyNamespace) {
|
|
9293
|
+
return;
|
|
9294
|
+
}
|
|
9295
|
+
const skillName = hasLegacyNamespace ? normalized.slice(LEGACY_SKILL_NAMESPACE.length) : normalized;
|
|
9296
|
+
if (skillName.length > MAX_SKILL_NAME_LENGTH || !SKILL_NAME_PATTERN.test(skillName) || !KNOWN_SKILL_NAMES.has(skillName)) {
|
|
9297
|
+
return;
|
|
9298
|
+
}
|
|
9299
|
+
return skillName;
|
|
9300
|
+
}
|
|
9301
|
+
function normalizeSkillName(value) {
|
|
9302
|
+
return normalizeSkillNameWithOptions(value, {
|
|
9303
|
+
allowLegacyNamespace: false
|
|
9304
|
+
});
|
|
9305
|
+
}
|
|
9306
|
+
function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
9307
|
+
const skillName = normalizeSkillName(skillSource);
|
|
9308
|
+
return {
|
|
9309
|
+
...skillName ? { skill_name: skillName } : {},
|
|
9310
|
+
...getCommandProductModeAttribution(commandPath)
|
|
9311
|
+
};
|
|
9312
|
+
}
|
|
9313
|
+
|
|
8767
9314
|
// ../common/src/telemetry/pii-redactor.ts
|
|
8768
9315
|
var REDACTED = "[REDACTED]";
|
|
8769
9316
|
var MAX_VALUE_LENGTH = 200;
|
|
@@ -8949,6 +9496,12 @@ function commandHelpHint(commandPath) {
|
|
|
8949
9496
|
const command = commandPath.replace(/\./g, " ");
|
|
8950
9497
|
return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
|
|
8951
9498
|
}
|
|
9499
|
+
function isPromptCancellation(error) {
|
|
9500
|
+
return error instanceof Error && error.name === "ExitPromptError";
|
|
9501
|
+
}
|
|
9502
|
+
function exitCodeFromProcess(fallback) {
|
|
9503
|
+
return typeof process.exitCode === "number" ? process.exitCode : fallback;
|
|
9504
|
+
}
|
|
8952
9505
|
Command.prototype.trackedAction = function(context, fn, properties) {
|
|
8953
9506
|
const command = this;
|
|
8954
9507
|
return this.action(async (...args) => {
|
|
@@ -8956,6 +9509,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
8956
9509
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
8957
9510
|
const startTime = performance.now();
|
|
8958
9511
|
let errorMessage;
|
|
9512
|
+
let fallbackExitCode = EXIT_CODES.Success;
|
|
9513
|
+
clearRecordedCommandFailureTelemetry();
|
|
8959
9514
|
const [error] = await catchError(fn(...args));
|
|
8960
9515
|
if (error) {
|
|
8961
9516
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -8970,6 +9525,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
8970
9525
|
const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
|
|
8971
9526
|
const typedContext = typed.context ?? typed.Context;
|
|
8972
9527
|
const customContext = isErrorContext(typedContext) ? typedContext : undefined;
|
|
9528
|
+
const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
|
|
9529
|
+
fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
|
|
8973
9530
|
OutputFormatter.error({
|
|
8974
9531
|
Result: finalResult,
|
|
8975
9532
|
...customErrorCode ? { ErrorCode: customErrorCode } : {},
|
|
@@ -8978,16 +9535,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
8978
9535
|
...customRetry ? { Retry: customRetry } : {},
|
|
8979
9536
|
...customContext ? { Context: customContext } : {}
|
|
8980
9537
|
});
|
|
8981
|
-
context.exit(
|
|
9538
|
+
context.exit(fallbackExitCode);
|
|
8982
9539
|
}
|
|
8983
9540
|
const durationMs = performance.now() - startTime;
|
|
8984
|
-
const
|
|
9541
|
+
const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
|
|
9542
|
+
const recordedFailure = takeRecordedCommandFailureTelemetry();
|
|
9543
|
+
const success = !error && exitCode === 0;
|
|
9544
|
+
const terminalTelemetry = buildCommandTerminalTelemetryProperties({
|
|
9545
|
+
error,
|
|
9546
|
+
exitCode,
|
|
9547
|
+
recordedFailure,
|
|
9548
|
+
pollSignal: context.pollSignal
|
|
9549
|
+
});
|
|
8985
9550
|
telemetry.trackEvent(telemetryName, redactProperties({
|
|
8986
9551
|
...extractCommandParams(command),
|
|
8987
9552
|
...props,
|
|
9553
|
+
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
8988
9554
|
command: "true",
|
|
8989
9555
|
duration: String(durationMs),
|
|
8990
9556
|
success: String(success),
|
|
9557
|
+
...terminalTelemetry,
|
|
8991
9558
|
...errorMessage ? { errorMessage } : {}
|
|
8992
9559
|
}));
|
|
8993
9560
|
});
|
|
@@ -9072,6 +9639,8 @@ var ScreenLogger;
|
|
|
9072
9639
|
})(ScreenLogger ||= {});
|
|
9073
9640
|
// ../common/src/sdk-user-agent.ts
|
|
9074
9641
|
var sdkUserAgentHostToken = singleton("SdkUserAgentHostToken");
|
|
9642
|
+
// ../common/src/telemetry/ship-succeeded.ts
|
|
9643
|
+
var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
|
|
9075
9644
|
// ../common/src/tool-provider.ts
|
|
9076
9645
|
var factorySlot = singleton("PackagerFactoryProvider");
|
|
9077
9646
|
// ../insights-sdk/dist/index.js
|
|
@@ -29197,4 +29766,4 @@ export {
|
|
|
29197
29766
|
metadata
|
|
29198
29767
|
};
|
|
29199
29768
|
|
|
29200
|
-
//# debugId=
|
|
29769
|
+
//# debugId=018F2FCA1D45B6D464756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/insights-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.197.0-preview.
|
|
4
|
+
"version": "1.197.0-preview.67",
|
|
5
5
|
"description": "Query UiPath Insights data — jobs, failures, and performance metrics.",
|
|
6
6
|
"private": false,
|
|
7
7
|
"repository": {
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"files": [
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "579e7d41cb100fcb8130eec8ed1c9b5b55feaf0b"
|
|
30
30
|
}
|