@uipath/solution-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/deploy.js +582 -13
- package/dist/init.js +577 -8
- package/dist/pack.js +1294 -23
- package/dist/publish.js +578 -9
- package/dist/resource.js +577 -8
- package/dist/tool.js +1446 -31
- package/package.json +2 -2
package/dist/init.js
CHANGED
|
@@ -8016,9 +8016,228 @@ function getOutputFilter() {
|
|
|
8016
8016
|
return filterSlot.get();
|
|
8017
8017
|
}
|
|
8018
8018
|
|
|
8019
|
+
// ../common/src/telemetry/command-terminal.ts
|
|
8020
|
+
var recordedFailureSlot = singleton("CommandTelemetryFailure");
|
|
8021
|
+
var AUTH_ERROR_CODES = new Set([
|
|
8022
|
+
"authentication_required",
|
|
8023
|
+
"permission_denied"
|
|
8024
|
+
]);
|
|
8025
|
+
var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
|
|
8026
|
+
var NETWORK_HTTP_ERROR_CODES = new Set([
|
|
8027
|
+
"network_error",
|
|
8028
|
+
"rate_limited",
|
|
8029
|
+
"server_error",
|
|
8030
|
+
"not_found",
|
|
8031
|
+
"method_not_allowed"
|
|
8032
|
+
]);
|
|
8033
|
+
var TIMEOUT_ERROR_CODES = new Set(["timeout"]);
|
|
8034
|
+
var NETWORK_OS_ERROR_CODES = new Set([
|
|
8035
|
+
"ECONNREFUSED",
|
|
8036
|
+
"ECONNRESET",
|
|
8037
|
+
"ENOTFOUND",
|
|
8038
|
+
"EAI_AGAIN",
|
|
8039
|
+
"EPIPE",
|
|
8040
|
+
"EHOSTUNREACH",
|
|
8041
|
+
"ENETUNREACH",
|
|
8042
|
+
"EAI_FAIL"
|
|
8043
|
+
]);
|
|
8044
|
+
var TIMEOUT_OS_ERROR_CODES = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
|
|
8045
|
+
var TLS_ERROR_CODES2 = new Set([
|
|
8046
|
+
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
8047
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
8048
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
8049
|
+
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
8050
|
+
"UNABLE_TO_GET_ISSUER_CERT",
|
|
8051
|
+
"CERT_HAS_EXPIRED",
|
|
8052
|
+
"CERT_UNTRUSTED",
|
|
8053
|
+
"ERR_TLS_CERT_ALTNAME_INVALID"
|
|
8054
|
+
]);
|
|
8055
|
+
var MISSING_DEPENDENCY_CODES = new Set([
|
|
8056
|
+
"MODULE_NOT_FOUND",
|
|
8057
|
+
"ERR_MODULE_NOT_FOUND"
|
|
8058
|
+
]);
|
|
8059
|
+
var INTERNAL_ERROR_NAMES = new Set([
|
|
8060
|
+
"TypeError",
|
|
8061
|
+
"ReferenceError",
|
|
8062
|
+
"SyntaxError",
|
|
8063
|
+
"RangeError"
|
|
8064
|
+
]);
|
|
8065
|
+
function isRecord(value) {
|
|
8066
|
+
return value !== null && typeof value === "object";
|
|
8067
|
+
}
|
|
8068
|
+
function stringField(value, field) {
|
|
8069
|
+
if (!isRecord(value)) {
|
|
8070
|
+
return;
|
|
8071
|
+
}
|
|
8072
|
+
const raw = value[field];
|
|
8073
|
+
return typeof raw === "string" ? raw : undefined;
|
|
8074
|
+
}
|
|
8075
|
+
function numberField(value, field) {
|
|
8076
|
+
if (!isRecord(value)) {
|
|
8077
|
+
return;
|
|
8078
|
+
}
|
|
8079
|
+
const raw = value[field];
|
|
8080
|
+
return typeof raw === "number" ? raw : undefined;
|
|
8081
|
+
}
|
|
8082
|
+
function findStringInCauseChain(error, field) {
|
|
8083
|
+
let current = error;
|
|
8084
|
+
for (let depth = 0;depth < 5 && current !== null && typeof current === "object"; depth++) {
|
|
8085
|
+
const value = stringField(current, field);
|
|
8086
|
+
if (value) {
|
|
8087
|
+
return value;
|
|
8088
|
+
}
|
|
8089
|
+
current = current.cause;
|
|
8090
|
+
}
|
|
8091
|
+
return;
|
|
8092
|
+
}
|
|
8093
|
+
function findCodeInCauseChain(error) {
|
|
8094
|
+
return findStringInCauseChain(error, "code");
|
|
8095
|
+
}
|
|
8096
|
+
function isSpawnEnoent(error) {
|
|
8097
|
+
const code = findCodeInCauseChain(error);
|
|
8098
|
+
if (code !== "ENOENT") {
|
|
8099
|
+
return false;
|
|
8100
|
+
}
|
|
8101
|
+
const syscall = findStringInCauseChain(error, "syscall");
|
|
8102
|
+
return syscall?.startsWith("spawn") === true;
|
|
8103
|
+
}
|
|
8104
|
+
function isCancellationError(error, exitCode, pollSignal) {
|
|
8105
|
+
if (exitCode === 130) {
|
|
8106
|
+
return true;
|
|
8107
|
+
}
|
|
8108
|
+
if (!isRecord(error)) {
|
|
8109
|
+
return false;
|
|
8110
|
+
}
|
|
8111
|
+
if (numberField(error, "exitCode") === 130) {
|
|
8112
|
+
return true;
|
|
8113
|
+
}
|
|
8114
|
+
const name = stringField(error, "name");
|
|
8115
|
+
if (name === "ExitPromptError") {
|
|
8116
|
+
return true;
|
|
8117
|
+
}
|
|
8118
|
+
if (name === "AbortError" && pollSignal?.aborted) {
|
|
8119
|
+
return true;
|
|
8120
|
+
}
|
|
8121
|
+
const message = stringField(error, "message");
|
|
8122
|
+
return message?.includes("SIGINT") === true;
|
|
8123
|
+
}
|
|
8124
|
+
function terminalSignalFor(input, outcome) {
|
|
8125
|
+
if (input.recordedFailure?.terminalSignal) {
|
|
8126
|
+
return input.recordedFailure.terminalSignal;
|
|
8127
|
+
}
|
|
8128
|
+
const explicit = findStringInCauseChain(input.error, "terminalSignal") ?? findStringInCauseChain(input.error, "signal");
|
|
8129
|
+
if (explicit) {
|
|
8130
|
+
return explicit;
|
|
8131
|
+
}
|
|
8132
|
+
return outcome === "cancelled" ? "SIGINT" : undefined;
|
|
8133
|
+
}
|
|
8134
|
+
function classifyHttpStatus(status) {
|
|
8135
|
+
if (status === 401 || status === 403) {
|
|
8136
|
+
return "auth";
|
|
8137
|
+
}
|
|
8138
|
+
if (status === 400 || status === 409 || status === 422) {
|
|
8139
|
+
return "validation";
|
|
8140
|
+
}
|
|
8141
|
+
if (status === 408) {
|
|
8142
|
+
return "timeout";
|
|
8143
|
+
}
|
|
8144
|
+
return "network_http";
|
|
8145
|
+
}
|
|
8146
|
+
function classifyFromResult(result) {
|
|
8147
|
+
switch (result) {
|
|
8148
|
+
case "AuthenticationError":
|
|
8149
|
+
return "auth";
|
|
8150
|
+
case "ValidationError":
|
|
8151
|
+
return "validation";
|
|
8152
|
+
case "TimeoutError":
|
|
8153
|
+
return "timeout";
|
|
8154
|
+
default:
|
|
8155
|
+
return;
|
|
8156
|
+
}
|
|
8157
|
+
}
|
|
8158
|
+
function classifyFromErrorCode(errorCode) {
|
|
8159
|
+
if (!errorCode) {
|
|
8160
|
+
return;
|
|
8161
|
+
}
|
|
8162
|
+
if (AUTH_ERROR_CODES.has(errorCode)) {
|
|
8163
|
+
return "auth";
|
|
8164
|
+
}
|
|
8165
|
+
if (VALIDATION_ERROR_CODES.has(errorCode)) {
|
|
8166
|
+
return "validation";
|
|
8167
|
+
}
|
|
8168
|
+
if (TIMEOUT_ERROR_CODES.has(errorCode)) {
|
|
8169
|
+
return "timeout";
|
|
8170
|
+
}
|
|
8171
|
+
if (NETWORK_HTTP_ERROR_CODES.has(errorCode)) {
|
|
8172
|
+
return "network_http";
|
|
8173
|
+
}
|
|
8174
|
+
return;
|
|
8175
|
+
}
|
|
8176
|
+
function classifyFromError(error) {
|
|
8177
|
+
const code = findCodeInCauseChain(error);
|
|
8178
|
+
if (code) {
|
|
8179
|
+
if (code.startsWith("commander.")) {
|
|
8180
|
+
return "validation";
|
|
8181
|
+
}
|
|
8182
|
+
if (NETWORK_OS_ERROR_CODES.has(code) || TLS_ERROR_CODES2.has(code)) {
|
|
8183
|
+
return "network_http";
|
|
8184
|
+
}
|
|
8185
|
+
if (TIMEOUT_OS_ERROR_CODES.has(code)) {
|
|
8186
|
+
return "timeout";
|
|
8187
|
+
}
|
|
8188
|
+
if (MISSING_DEPENDENCY_CODES.has(code) || isSpawnEnoent(error)) {
|
|
8189
|
+
return "missing_dependency";
|
|
8190
|
+
}
|
|
8191
|
+
}
|
|
8192
|
+
const message = stringField(error, "message");
|
|
8193
|
+
if (message?.includes("fetch failed") === true) {
|
|
8194
|
+
return "network_http";
|
|
8195
|
+
}
|
|
8196
|
+
const name = stringField(error, "name");
|
|
8197
|
+
if (name && INTERNAL_ERROR_NAMES.has(name)) {
|
|
8198
|
+
return "internal";
|
|
8199
|
+
}
|
|
8200
|
+
return;
|
|
8201
|
+
}
|
|
8202
|
+
function classifyError(input) {
|
|
8203
|
+
const recorded = input.recordedFailure;
|
|
8204
|
+
if (recorded?.errorClass) {
|
|
8205
|
+
return recorded.errorClass;
|
|
8206
|
+
}
|
|
8207
|
+
const status = recorded?.context?.httpStatus;
|
|
8208
|
+
if (status !== undefined) {
|
|
8209
|
+
return classifyHttpStatus(status);
|
|
8210
|
+
}
|
|
8211
|
+
return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
|
|
8212
|
+
}
|
|
8213
|
+
function recordCommandFailureTelemetry(failure) {
|
|
8214
|
+
recordedFailureSlot.set(failure);
|
|
8215
|
+
}
|
|
8216
|
+
function clearRecordedCommandFailureTelemetry() {
|
|
8217
|
+
recordedFailureSlot.clear();
|
|
8218
|
+
}
|
|
8219
|
+
function takeRecordedCommandFailureTelemetry() {
|
|
8220
|
+
const failure = recordedFailureSlot.get();
|
|
8221
|
+
recordedFailureSlot.clear();
|
|
8222
|
+
return failure;
|
|
8223
|
+
}
|
|
8224
|
+
function buildCommandTerminalTelemetryProperties(input) {
|
|
8225
|
+
const cancelled = isCancellationError(input.error, input.exitCode, input.pollSignal);
|
|
8226
|
+
const outcome = input.recordedFailure?.terminalOutcome ?? (input.exitCode === 0 ? "success" : cancelled ? "cancelled" : "failure");
|
|
8227
|
+
const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError(input);
|
|
8228
|
+
const terminalSignal = terminalSignalFor(input, outcome);
|
|
8229
|
+
return {
|
|
8230
|
+
exit_code: input.exitCode,
|
|
8231
|
+
terminal_outcome: outcome,
|
|
8232
|
+
...errorClass ? { error_class: errorClass } : {},
|
|
8233
|
+
...terminalSignal ? { terminal_signal: terminalSignal } : {}
|
|
8234
|
+
};
|
|
8235
|
+
}
|
|
8236
|
+
|
|
8019
8237
|
// ../common/src/telemetry/telemetry-events.ts
|
|
8020
8238
|
var CommonTelemetryEvents = {
|
|
8021
|
-
Error: "uip.error"
|
|
8239
|
+
Error: "uip.error",
|
|
8240
|
+
ShipSucceeded: "ship_succeeded"
|
|
8022
8241
|
};
|
|
8023
8242
|
|
|
8024
8243
|
// ../common/src/registry.ts
|
|
@@ -8085,6 +8304,136 @@ function formatMessage(category, name, properties) {
|
|
|
8085
8304
|
}
|
|
8086
8305
|
return message;
|
|
8087
8306
|
}
|
|
8307
|
+
// ../common/src/telemetry/detect-agent.ts
|
|
8308
|
+
var KNOWN_AGENTS = [
|
|
8309
|
+
{ envVar: "CLAUDECODE", value: "1", id: "claude-code" },
|
|
8310
|
+
{ envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
|
|
8311
|
+
{ envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
|
|
8312
|
+
{ envVar: "CODEX_THREAD_ID", id: "codex" },
|
|
8313
|
+
{ envVar: "CODEX_SANDBOX", id: "codex" },
|
|
8314
|
+
{ envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
|
|
8315
|
+
{ envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
|
|
8316
|
+
];
|
|
8317
|
+
function detectAgentFromEnv(env) {
|
|
8318
|
+
for (const agent of KNOWN_AGENTS) {
|
|
8319
|
+
const envValue = env[agent.envVar];
|
|
8320
|
+
if (agent.value !== undefined) {
|
|
8321
|
+
if (envValue === agent.value)
|
|
8322
|
+
return agent.id;
|
|
8323
|
+
} else {
|
|
8324
|
+
if (envValue)
|
|
8325
|
+
return agent.id;
|
|
8326
|
+
}
|
|
8327
|
+
}
|
|
8328
|
+
const agentEnv = env.AGENT;
|
|
8329
|
+
if (agentEnv) {
|
|
8330
|
+
if (agentEnv === "1" || agentEnv === "true")
|
|
8331
|
+
return "unknown";
|
|
8332
|
+
if (agentEnv.length <= 32)
|
|
8333
|
+
return agentEnv.toLowerCase();
|
|
8334
|
+
}
|
|
8335
|
+
return;
|
|
8336
|
+
}
|
|
8337
|
+
// ../common/src/telemetry/environment-info.ts
|
|
8338
|
+
var LOCAL_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
|
|
8339
|
+
// ../common/src/telemetry/execution-context.ts
|
|
8340
|
+
var authSignalSlot = singleton("TelemetryExecutionContextAuthSignal");
|
|
8341
|
+
var isTruthy = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false";
|
|
8342
|
+
var isEqual = (value, expected) => value?.toLowerCase() === expected;
|
|
8343
|
+
var CI_SIGNATURES = [
|
|
8344
|
+
{
|
|
8345
|
+
provider: "github_actions",
|
|
8346
|
+
matches: (env) => isTruthy(env.GITHUB_ACTIONS),
|
|
8347
|
+
isScheduler: (env) => env.GITHUB_EVENT_NAME === "schedule"
|
|
8348
|
+
},
|
|
8349
|
+
{
|
|
8350
|
+
provider: "azure_devops",
|
|
8351
|
+
matches: (env) => isTruthy(env.TF_BUILD),
|
|
8352
|
+
isScheduler: (env) => isEqual(env.BUILD_REASON, "schedule")
|
|
8353
|
+
},
|
|
8354
|
+
{
|
|
8355
|
+
provider: "gitlab",
|
|
8356
|
+
matches: (env) => isTruthy(env.GITLAB_CI),
|
|
8357
|
+
isScheduler: (env) => env.CI_PIPELINE_SOURCE === "schedule"
|
|
8358
|
+
},
|
|
8359
|
+
{
|
|
8360
|
+
provider: "circleci",
|
|
8361
|
+
matches: (env) => isTruthy(env.CIRCLECI),
|
|
8362
|
+
isScheduler: (env) => env.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
|
|
8363
|
+
},
|
|
8364
|
+
{
|
|
8365
|
+
provider: "jenkins",
|
|
8366
|
+
matches: (env) => isTruthy(env.JENKINS_URL) || isTruthy(env.JENKINS_HOME)
|
|
8367
|
+
},
|
|
8368
|
+
{
|
|
8369
|
+
provider: "teamcity",
|
|
8370
|
+
matches: (env) => isTruthy(env.TEAMCITY_VERSION)
|
|
8371
|
+
},
|
|
8372
|
+
{
|
|
8373
|
+
provider: "buildkite",
|
|
8374
|
+
matches: (env) => isTruthy(env.BUILDKITE),
|
|
8375
|
+
isScheduler: (env) => env.BUILDKITE_SOURCE === "schedule"
|
|
8376
|
+
},
|
|
8377
|
+
{
|
|
8378
|
+
provider: "bitbucket",
|
|
8379
|
+
matches: (env) => isTruthy(env.BITBUCKET_BUILD_NUMBER)
|
|
8380
|
+
},
|
|
8381
|
+
{
|
|
8382
|
+
provider: "travis",
|
|
8383
|
+
matches: (env) => isTruthy(env.TRAVIS)
|
|
8384
|
+
},
|
|
8385
|
+
{
|
|
8386
|
+
provider: "appveyor",
|
|
8387
|
+
matches: (env) => isTruthy(env.APPVEYOR)
|
|
8388
|
+
},
|
|
8389
|
+
{
|
|
8390
|
+
provider: "generic",
|
|
8391
|
+
matches: (env) => isTruthy(env.CI)
|
|
8392
|
+
}
|
|
8393
|
+
];
|
|
8394
|
+
function currentEnv() {
|
|
8395
|
+
return typeof process === "undefined" ? {} : process.env;
|
|
8396
|
+
}
|
|
8397
|
+
function currentTtyState() {
|
|
8398
|
+
if (typeof process === "undefined")
|
|
8399
|
+
return false;
|
|
8400
|
+
return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
|
|
8401
|
+
}
|
|
8402
|
+
function detectCi(env) {
|
|
8403
|
+
const signature = CI_SIGNATURES.find((candidate) => candidate.matches(env));
|
|
8404
|
+
if (!signature)
|
|
8405
|
+
return;
|
|
8406
|
+
return {
|
|
8407
|
+
executionContext: signature.isScheduler?.(env) ? "scheduler" : "ci",
|
|
8408
|
+
ciProvider: signature.provider
|
|
8409
|
+
};
|
|
8410
|
+
}
|
|
8411
|
+
function detectExecutionContext(options = {}) {
|
|
8412
|
+
const env = options.env ?? currentEnv();
|
|
8413
|
+
const ci = detectCi(env);
|
|
8414
|
+
if (ci)
|
|
8415
|
+
return ci;
|
|
8416
|
+
const agent = options.agent ?? detectAgentFromEnv(env);
|
|
8417
|
+
if (agent) {
|
|
8418
|
+
return { executionContext: "agent" };
|
|
8419
|
+
}
|
|
8420
|
+
const authSignal = options.authSignal ?? authSignalSlot.get();
|
|
8421
|
+
if (authSignal === "service_account") {
|
|
8422
|
+
return { executionContext: "service_account" };
|
|
8423
|
+
}
|
|
8424
|
+
const isTty = options.isTty ?? currentTtyState();
|
|
8425
|
+
if (isTty) {
|
|
8426
|
+
return { executionContext: "manual" };
|
|
8427
|
+
}
|
|
8428
|
+
return { executionContext: "unknown" };
|
|
8429
|
+
}
|
|
8430
|
+
function getExecutionContextTelemetryProperties() {
|
|
8431
|
+
const detected = detectExecutionContext();
|
|
8432
|
+
return {
|
|
8433
|
+
execution_context: detected.executionContext,
|
|
8434
|
+
...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
|
|
8435
|
+
};
|
|
8436
|
+
}
|
|
8088
8437
|
// ../common/src/telemetry/node-context-storage.ts
|
|
8089
8438
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
8090
8439
|
|
|
@@ -8097,6 +8446,26 @@ class NodeContextStorage {
|
|
|
8097
8446
|
return this.storage.getStore();
|
|
8098
8447
|
}
|
|
8099
8448
|
}
|
|
8449
|
+
// ../common/src/telemetry/session-id.ts
|
|
8450
|
+
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
8451
|
+
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
8452
|
+
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
8453
|
+
function getProcessEnv() {
|
|
8454
|
+
return globalThis.process?.env;
|
|
8455
|
+
}
|
|
8456
|
+
function normalizeSessionId(value) {
|
|
8457
|
+
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
|
|
8458
|
+
return;
|
|
8459
|
+
}
|
|
8460
|
+
const trimmed = String(value).trim();
|
|
8461
|
+
return trimmed || undefined;
|
|
8462
|
+
}
|
|
8463
|
+
function getConfiguredTelemetrySessionId() {
|
|
8464
|
+
return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
8465
|
+
}
|
|
8466
|
+
function resolveTelemetrySessionId(existingSessionId) {
|
|
8467
|
+
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
8468
|
+
}
|
|
8100
8469
|
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
8101
8470
|
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
8102
8471
|
function getGlobalTelemetryProperties() {
|
|
@@ -8181,12 +8550,22 @@ class TelemetryService {
|
|
|
8181
8550
|
return this.contextStorage.getContext();
|
|
8182
8551
|
}
|
|
8183
8552
|
enrichPropertiesWithContext(properties, context) {
|
|
8184
|
-
|
|
8185
|
-
|
|
8553
|
+
const globalProperties = getGlobalTelemetryProperties();
|
|
8554
|
+
const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
|
|
8555
|
+
const sessionId = resolveTelemetrySessionId(existingSessionId);
|
|
8556
|
+
const enriched = {
|
|
8557
|
+
...getExecutionContextTelemetryProperties(),
|
|
8558
|
+
...globalProperties,
|
|
8186
8559
|
...this.defaultProperties,
|
|
8187
8560
|
...properties,
|
|
8188
8561
|
...context
|
|
8189
8562
|
};
|
|
8563
|
+
if (sessionId === undefined) {
|
|
8564
|
+
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
8565
|
+
} else {
|
|
8566
|
+
enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
|
|
8567
|
+
}
|
|
8568
|
+
return enriched;
|
|
8190
8569
|
}
|
|
8191
8570
|
generateId() {
|
|
8192
8571
|
return crypto.randomUUID().replaceAll("-", "");
|
|
@@ -8656,8 +9035,24 @@ var OutputFormatter;
|
|
|
8656
9035
|
data.ErrorCode ??= defaultErrorCodeForFailure(data);
|
|
8657
9036
|
data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
|
|
8658
9037
|
process.exitCode = EXIT_CODES[data.Result] ?? 1;
|
|
8659
|
-
|
|
8660
|
-
|
|
9038
|
+
recordCommandFailureTelemetry({
|
|
9039
|
+
result: data.Result,
|
|
9040
|
+
errorCode: data.ErrorCode,
|
|
9041
|
+
retry: data.Retry,
|
|
9042
|
+
message: data.Message,
|
|
9043
|
+
context: data.Context,
|
|
9044
|
+
exitCode: process.exitCode,
|
|
9045
|
+
errorClass: data.TelemetryErrorClass,
|
|
9046
|
+
terminalOutcome: data.TelemetryTerminalOutcome,
|
|
9047
|
+
terminalSignal: data.TelemetryTerminalSignal
|
|
9048
|
+
});
|
|
9049
|
+
const suppressTelemetry = data.SuppressTelemetry === true;
|
|
9050
|
+
const envelope = { ...data };
|
|
9051
|
+
delete envelope.SuppressTelemetry;
|
|
9052
|
+
delete envelope.TelemetryErrorClass;
|
|
9053
|
+
delete envelope.TelemetryTerminalOutcome;
|
|
9054
|
+
delete envelope.TelemetryTerminalSignal;
|
|
9055
|
+
if (!suppressTelemetry) {
|
|
8661
9056
|
telemetry.trackEvent(CommonTelemetryEvents.Error, {
|
|
8662
9057
|
result: data.Result,
|
|
8663
9058
|
errorCode: data.ErrorCode,
|
|
@@ -8720,6 +9115,158 @@ var OutputFormatter;
|
|
|
8720
9115
|
OutputFormatter.formatToString = formatToString;
|
|
8721
9116
|
})(OutputFormatter ||= {});
|
|
8722
9117
|
|
|
9118
|
+
// ../common/src/telemetry/command-attribution.ts
|
|
9119
|
+
var LEGACY_SKILL_NAMESPACE = "uipath:";
|
|
9120
|
+
var MAX_SKILL_NAME_LENGTH = 80;
|
|
9121
|
+
var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
|
|
9122
|
+
function productMode(productArea, mode) {
|
|
9123
|
+
return { product_area: productArea, mode };
|
|
9124
|
+
}
|
|
9125
|
+
function attributionRecord(groups) {
|
|
9126
|
+
const record = {};
|
|
9127
|
+
for (const [productArea, mode, names] of groups) {
|
|
9128
|
+
const attribution = productMode(productArea, mode);
|
|
9129
|
+
for (const name of names) {
|
|
9130
|
+
record[name] = attribution;
|
|
9131
|
+
}
|
|
9132
|
+
}
|
|
9133
|
+
return record;
|
|
9134
|
+
}
|
|
9135
|
+
function commandAttribution(groups) {
|
|
9136
|
+
const entries = [];
|
|
9137
|
+
for (const [productArea, mode, prefixes] of groups) {
|
|
9138
|
+
const attribution = productMode(productArea, mode);
|
|
9139
|
+
for (const prefix of prefixes) {
|
|
9140
|
+
entries.push({ prefix, attribution });
|
|
9141
|
+
}
|
|
9142
|
+
}
|
|
9143
|
+
return entries;
|
|
9144
|
+
}
|
|
9145
|
+
var SKILL_ATTRIBUTION = attributionRecord([
|
|
9146
|
+
["admin", "operate", ["uipath-admin"]],
|
|
9147
|
+
["agents", "build", ["uipath-agents"]],
|
|
9148
|
+
["api-workflow", "build", ["uipath-api-workflow"]],
|
|
9149
|
+
["automation-discovery", "build", ["uipath-automation-discovery"]],
|
|
9150
|
+
["coded-apps", "build", ["uipath-coded-apps"]],
|
|
9151
|
+
["data-fabric", "operate", ["uipath-data-fabric"]],
|
|
9152
|
+
["cli", "troubleshoot", ["uipath-feedback"]],
|
|
9153
|
+
["governance", "operate", ["uipath-governance"]],
|
|
9154
|
+
["action-center", "build", ["uipath-human-in-the-loop"]],
|
|
9155
|
+
["document-understanding", "build", ["uipath-ixp"]],
|
|
9156
|
+
[
|
|
9157
|
+
"maestro",
|
|
9158
|
+
"build",
|
|
9159
|
+
["uipath-maestro-bpmn", "uipath-maestro-case", "uipath-maestro-flow"]
|
|
9160
|
+
],
|
|
9161
|
+
["agenthub", "build", ["uipath-mcp-servers"]],
|
|
9162
|
+
["solution", "build", ["uipath-planner", "uipath-solution"]],
|
|
9163
|
+
["platform", "operate", ["uipath-platform"]],
|
|
9164
|
+
["quality", "troubleshoot", ["uipath-review"]],
|
|
9165
|
+
["rpa", "build", ["uipath-rpa"]],
|
|
9166
|
+
["cli", "operate", ["uipath-skill-catalog"]],
|
|
9167
|
+
["action-center", "operate", ["uipath-tasks"]],
|
|
9168
|
+
["test-manager", "operate", ["uipath-test"]],
|
|
9169
|
+
["platform", "troubleshoot", ["uipath-troubleshoot"]]
|
|
9170
|
+
]);
|
|
9171
|
+
var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
|
|
9172
|
+
var COMMAND_ATTRIBUTION = commandAttribution([
|
|
9173
|
+
["cli", "troubleshoot", ["uip.feedback"]],
|
|
9174
|
+
["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
|
|
9175
|
+
["context-grounding", "build", ["uip.context-grounding"]],
|
|
9176
|
+
["api-workflow", "build", ["uip.api-workflow"]],
|
|
9177
|
+
["rpa", "build", ["uip.rpa-legacy"]],
|
|
9178
|
+
["conversational", "operate", ["uip.conversational"]],
|
|
9179
|
+
["agents", "build", ["uip.codedagent", "uip.agent"]],
|
|
9180
|
+
["agenthub", "build", ["uip.agenthub"]],
|
|
9181
|
+
["coded-apps", "build", ["uip.codedapp"]],
|
|
9182
|
+
["functions", "build", ["uip.functions"]],
|
|
9183
|
+
["solution", "build", ["uip.solution"]],
|
|
9184
|
+
["maestro", "build", ["uip.maestro", "uip.case", "uip.flow"]],
|
|
9185
|
+
["llm-observability", "troubleshoot", ["uip.traces"]],
|
|
9186
|
+
["platform", "operate", ["uip.platform"]],
|
|
9187
|
+
["admin", "operate", ["uip.admin"]],
|
|
9188
|
+
["automation-ops", "operate", ["uip.aops"]],
|
|
9189
|
+
["documentation", "troubleshoot", ["uip.docsai"]],
|
|
9190
|
+
["governance", "operate", ["uip.gov"]],
|
|
9191
|
+
["insights", "operate", ["uip.insights"]],
|
|
9192
|
+
["document-understanding", "build", ["uip.ixp"]],
|
|
9193
|
+
["process-mining", "operate", ["uip.pm"]],
|
|
9194
|
+
["action-center", "operate", ["uip.tasks"]],
|
|
9195
|
+
["test-manager", "operate", ["uip.tm"]],
|
|
9196
|
+
["vertical-solutions", "build", ["uip.vss"]],
|
|
9197
|
+
["data-fabric", "operate", ["uip.df"]],
|
|
9198
|
+
["integration-service", "build", ["uip.is"]],
|
|
9199
|
+
["orchestrator", "operate", ["uip.or"]],
|
|
9200
|
+
[
|
|
9201
|
+
"cli",
|
|
9202
|
+
"operate",
|
|
9203
|
+
[
|
|
9204
|
+
"uip.login",
|
|
9205
|
+
"uip.logout",
|
|
9206
|
+
"uip.user",
|
|
9207
|
+
"uip.config",
|
|
9208
|
+
"uip.tools",
|
|
9209
|
+
"uip.skills",
|
|
9210
|
+
"uip.completion",
|
|
9211
|
+
"uip.update",
|
|
9212
|
+
"uip.mcp",
|
|
9213
|
+
"uip.track"
|
|
9214
|
+
]
|
|
9215
|
+
]
|
|
9216
|
+
]).sort((a, b) => b.prefix.length - a.prefix.length);
|
|
9217
|
+
function normalizeCommandPath(value) {
|
|
9218
|
+
if (typeof value !== "string") {
|
|
9219
|
+
return;
|
|
9220
|
+
}
|
|
9221
|
+
const trimmed = value.trim().toLowerCase();
|
|
9222
|
+
if (!trimmed) {
|
|
9223
|
+
return;
|
|
9224
|
+
}
|
|
9225
|
+
const tokens = trimmed.includes(" ") ? trimmed.split(/\s+/).filter((token) => token.length > 0).filter((token) => !token.startsWith("-")) : trimmed.split(".").filter((token) => token.length > 0);
|
|
9226
|
+
if (tokens.length === 0) {
|
|
9227
|
+
return;
|
|
9228
|
+
}
|
|
9229
|
+
const commandTokens = tokens[0] === "uip" ? tokens : ["uip", ...tokens];
|
|
9230
|
+
return commandTokens.join(".");
|
|
9231
|
+
}
|
|
9232
|
+
function getCommandProductModeAttribution(commandPath) {
|
|
9233
|
+
const normalized = normalizeCommandPath(commandPath);
|
|
9234
|
+
if (!normalized) {
|
|
9235
|
+
return;
|
|
9236
|
+
}
|
|
9237
|
+
return COMMAND_ATTRIBUTION.find(({ prefix }) => normalized === prefix || normalized.startsWith(`${prefix}.`))?.attribution;
|
|
9238
|
+
}
|
|
9239
|
+
function normalizeSkillNameWithOptions(value, options) {
|
|
9240
|
+
if (typeof value !== "string") {
|
|
9241
|
+
return;
|
|
9242
|
+
}
|
|
9243
|
+
const normalized = value.trim().toLowerCase();
|
|
9244
|
+
if (!normalized) {
|
|
9245
|
+
return;
|
|
9246
|
+
}
|
|
9247
|
+
const hasLegacyNamespace = normalized.startsWith(LEGACY_SKILL_NAMESPACE);
|
|
9248
|
+
if (hasLegacyNamespace && !options.allowLegacyNamespace) {
|
|
9249
|
+
return;
|
|
9250
|
+
}
|
|
9251
|
+
const skillName = hasLegacyNamespace ? normalized.slice(LEGACY_SKILL_NAMESPACE.length) : normalized;
|
|
9252
|
+
if (skillName.length > MAX_SKILL_NAME_LENGTH || !SKILL_NAME_PATTERN.test(skillName) || !KNOWN_SKILL_NAMES.has(skillName)) {
|
|
9253
|
+
return;
|
|
9254
|
+
}
|
|
9255
|
+
return skillName;
|
|
9256
|
+
}
|
|
9257
|
+
function normalizeSkillName(value) {
|
|
9258
|
+
return normalizeSkillNameWithOptions(value, {
|
|
9259
|
+
allowLegacyNamespace: false
|
|
9260
|
+
});
|
|
9261
|
+
}
|
|
9262
|
+
function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
9263
|
+
const skillName = normalizeSkillName(skillSource);
|
|
9264
|
+
return {
|
|
9265
|
+
...skillName ? { skill_name: skillName } : {},
|
|
9266
|
+
...getCommandProductModeAttribution(commandPath)
|
|
9267
|
+
};
|
|
9268
|
+
}
|
|
9269
|
+
|
|
8723
9270
|
// ../common/src/telemetry/pii-redactor.ts
|
|
8724
9271
|
var REDACTED = "[REDACTED]";
|
|
8725
9272
|
var MAX_VALUE_LENGTH = 200;
|
|
@@ -8897,6 +9444,12 @@ function commandHelpHint(commandPath) {
|
|
|
8897
9444
|
const command = commandPath.replace(/\./g, " ");
|
|
8898
9445
|
return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
|
|
8899
9446
|
}
|
|
9447
|
+
function isPromptCancellation(error) {
|
|
9448
|
+
return error instanceof Error && error.name === "ExitPromptError";
|
|
9449
|
+
}
|
|
9450
|
+
function exitCodeFromProcess(fallback) {
|
|
9451
|
+
return typeof process.exitCode === "number" ? process.exitCode : fallback;
|
|
9452
|
+
}
|
|
8900
9453
|
Command.prototype.trackedAction = function(context, fn, properties) {
|
|
8901
9454
|
const command = this;
|
|
8902
9455
|
return this.action(async (...args) => {
|
|
@@ -8904,6 +9457,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
8904
9457
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
8905
9458
|
const startTime = performance.now();
|
|
8906
9459
|
let errorMessage;
|
|
9460
|
+
let fallbackExitCode = EXIT_CODES.Success;
|
|
9461
|
+
clearRecordedCommandFailureTelemetry();
|
|
8907
9462
|
const [error] = await catchError(fn(...args));
|
|
8908
9463
|
if (error) {
|
|
8909
9464
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -8918,6 +9473,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
8918
9473
|
const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
|
|
8919
9474
|
const typedContext = typed.context ?? typed.Context;
|
|
8920
9475
|
const customContext = isErrorContext(typedContext) ? typedContext : undefined;
|
|
9476
|
+
const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
|
|
9477
|
+
fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
|
|
8921
9478
|
OutputFormatter.error({
|
|
8922
9479
|
Result: finalResult,
|
|
8923
9480
|
...customErrorCode ? { ErrorCode: customErrorCode } : {},
|
|
@@ -8926,16 +9483,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
8926
9483
|
...customRetry ? { Retry: customRetry } : {},
|
|
8927
9484
|
...customContext ? { Context: customContext } : {}
|
|
8928
9485
|
});
|
|
8929
|
-
context.exit(
|
|
9486
|
+
context.exit(fallbackExitCode);
|
|
8930
9487
|
}
|
|
8931
9488
|
const durationMs = performance.now() - startTime;
|
|
8932
|
-
const
|
|
9489
|
+
const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
|
|
9490
|
+
const recordedFailure = takeRecordedCommandFailureTelemetry();
|
|
9491
|
+
const success = !error && exitCode === 0;
|
|
9492
|
+
const terminalTelemetry = buildCommandTerminalTelemetryProperties({
|
|
9493
|
+
error,
|
|
9494
|
+
exitCode,
|
|
9495
|
+
recordedFailure,
|
|
9496
|
+
pollSignal: context.pollSignal
|
|
9497
|
+
});
|
|
8933
9498
|
telemetry.trackEvent(telemetryName, redactProperties({
|
|
8934
9499
|
...extractCommandParams(command),
|
|
8935
9500
|
...props,
|
|
9501
|
+
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
8936
9502
|
command: "true",
|
|
8937
9503
|
duration: String(durationMs),
|
|
8938
9504
|
success: String(success),
|
|
9505
|
+
...terminalTelemetry,
|
|
8939
9506
|
...errorMessage ? { errorMessage } : {}
|
|
8940
9507
|
}));
|
|
8941
9508
|
});
|
|
@@ -9003,6 +9570,8 @@ var ScreenLogger;
|
|
|
9003
9570
|
})(ScreenLogger ||= {});
|
|
9004
9571
|
// ../common/src/sdk-user-agent.ts
|
|
9005
9572
|
var sdkUserAgentHostToken = singleton("SdkUserAgentHostToken");
|
|
9573
|
+
// ../common/src/telemetry/ship-succeeded.ts
|
|
9574
|
+
var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
|
|
9006
9575
|
// ../common/src/tool-provider.ts
|
|
9007
9576
|
var factorySlot = singleton("PackagerFactoryProvider");
|
|
9008
9577
|
// src/services/solution-init-service.ts
|
|
@@ -9069,4 +9638,4 @@ export {
|
|
|
9069
9638
|
SolutionInitError
|
|
9070
9639
|
};
|
|
9071
9640
|
|
|
9072
|
-
//# debugId=
|
|
9641
|
+
//# debugId=5002F814CEA5C34E64756E2164756E21
|