@uipath/solution-tool 1.197.0-preview.64 → 1.197.0-preview.66
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/resource.js
CHANGED
|
@@ -28913,9 +28913,228 @@ function getOutputFilter() {
|
|
|
28913
28913
|
return filterSlot.get();
|
|
28914
28914
|
}
|
|
28915
28915
|
|
|
28916
|
+
// ../common/src/telemetry/command-terminal.ts
|
|
28917
|
+
var recordedFailureSlot = singleton("CommandTelemetryFailure");
|
|
28918
|
+
var AUTH_ERROR_CODES = new Set([
|
|
28919
|
+
"authentication_required",
|
|
28920
|
+
"permission_denied"
|
|
28921
|
+
]);
|
|
28922
|
+
var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
|
|
28923
|
+
var NETWORK_HTTP_ERROR_CODES = new Set([
|
|
28924
|
+
"network_error",
|
|
28925
|
+
"rate_limited",
|
|
28926
|
+
"server_error",
|
|
28927
|
+
"not_found",
|
|
28928
|
+
"method_not_allowed"
|
|
28929
|
+
]);
|
|
28930
|
+
var TIMEOUT_ERROR_CODES = new Set(["timeout"]);
|
|
28931
|
+
var NETWORK_OS_ERROR_CODES = new Set([
|
|
28932
|
+
"ECONNREFUSED",
|
|
28933
|
+
"ECONNRESET",
|
|
28934
|
+
"ENOTFOUND",
|
|
28935
|
+
"EAI_AGAIN",
|
|
28936
|
+
"EPIPE",
|
|
28937
|
+
"EHOSTUNREACH",
|
|
28938
|
+
"ENETUNREACH",
|
|
28939
|
+
"EAI_FAIL"
|
|
28940
|
+
]);
|
|
28941
|
+
var TIMEOUT_OS_ERROR_CODES = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
|
|
28942
|
+
var TLS_ERROR_CODES2 = new Set([
|
|
28943
|
+
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
28944
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
28945
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
28946
|
+
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
28947
|
+
"UNABLE_TO_GET_ISSUER_CERT",
|
|
28948
|
+
"CERT_HAS_EXPIRED",
|
|
28949
|
+
"CERT_UNTRUSTED",
|
|
28950
|
+
"ERR_TLS_CERT_ALTNAME_INVALID"
|
|
28951
|
+
]);
|
|
28952
|
+
var MISSING_DEPENDENCY_CODES = new Set([
|
|
28953
|
+
"MODULE_NOT_FOUND",
|
|
28954
|
+
"ERR_MODULE_NOT_FOUND"
|
|
28955
|
+
]);
|
|
28956
|
+
var INTERNAL_ERROR_NAMES = new Set([
|
|
28957
|
+
"TypeError",
|
|
28958
|
+
"ReferenceError",
|
|
28959
|
+
"SyntaxError",
|
|
28960
|
+
"RangeError"
|
|
28961
|
+
]);
|
|
28962
|
+
function isRecord(value) {
|
|
28963
|
+
return value !== null && typeof value === "object";
|
|
28964
|
+
}
|
|
28965
|
+
function stringField(value, field) {
|
|
28966
|
+
if (!isRecord(value)) {
|
|
28967
|
+
return;
|
|
28968
|
+
}
|
|
28969
|
+
const raw = value[field];
|
|
28970
|
+
return typeof raw === "string" ? raw : undefined;
|
|
28971
|
+
}
|
|
28972
|
+
function numberField(value, field) {
|
|
28973
|
+
if (!isRecord(value)) {
|
|
28974
|
+
return;
|
|
28975
|
+
}
|
|
28976
|
+
const raw = value[field];
|
|
28977
|
+
return typeof raw === "number" ? raw : undefined;
|
|
28978
|
+
}
|
|
28979
|
+
function findStringInCauseChain(error, field) {
|
|
28980
|
+
let current = error;
|
|
28981
|
+
for (let depth = 0;depth < 5 && current !== null && typeof current === "object"; depth++) {
|
|
28982
|
+
const value = stringField(current, field);
|
|
28983
|
+
if (value) {
|
|
28984
|
+
return value;
|
|
28985
|
+
}
|
|
28986
|
+
current = current.cause;
|
|
28987
|
+
}
|
|
28988
|
+
return;
|
|
28989
|
+
}
|
|
28990
|
+
function findCodeInCauseChain(error) {
|
|
28991
|
+
return findStringInCauseChain(error, "code");
|
|
28992
|
+
}
|
|
28993
|
+
function isSpawnEnoent(error) {
|
|
28994
|
+
const code = findCodeInCauseChain(error);
|
|
28995
|
+
if (code !== "ENOENT") {
|
|
28996
|
+
return false;
|
|
28997
|
+
}
|
|
28998
|
+
const syscall = findStringInCauseChain(error, "syscall");
|
|
28999
|
+
return syscall?.startsWith("spawn") === true;
|
|
29000
|
+
}
|
|
29001
|
+
function isCancellationError(error, exitCode, pollSignal) {
|
|
29002
|
+
if (exitCode === 130) {
|
|
29003
|
+
return true;
|
|
29004
|
+
}
|
|
29005
|
+
if (!isRecord(error)) {
|
|
29006
|
+
return false;
|
|
29007
|
+
}
|
|
29008
|
+
if (numberField(error, "exitCode") === 130) {
|
|
29009
|
+
return true;
|
|
29010
|
+
}
|
|
29011
|
+
const name = stringField(error, "name");
|
|
29012
|
+
if (name === "ExitPromptError") {
|
|
29013
|
+
return true;
|
|
29014
|
+
}
|
|
29015
|
+
if (name === "AbortError" && pollSignal?.aborted) {
|
|
29016
|
+
return true;
|
|
29017
|
+
}
|
|
29018
|
+
const message = stringField(error, "message");
|
|
29019
|
+
return message?.includes("SIGINT") === true;
|
|
29020
|
+
}
|
|
29021
|
+
function terminalSignalFor(input, outcome) {
|
|
29022
|
+
if (input.recordedFailure?.terminalSignal) {
|
|
29023
|
+
return input.recordedFailure.terminalSignal;
|
|
29024
|
+
}
|
|
29025
|
+
const explicit = findStringInCauseChain(input.error, "terminalSignal") ?? findStringInCauseChain(input.error, "signal");
|
|
29026
|
+
if (explicit) {
|
|
29027
|
+
return explicit;
|
|
29028
|
+
}
|
|
29029
|
+
return outcome === "cancelled" ? "SIGINT" : undefined;
|
|
29030
|
+
}
|
|
29031
|
+
function classifyHttpStatus(status) {
|
|
29032
|
+
if (status === 401 || status === 403) {
|
|
29033
|
+
return "auth";
|
|
29034
|
+
}
|
|
29035
|
+
if (status === 400 || status === 409 || status === 422) {
|
|
29036
|
+
return "validation";
|
|
29037
|
+
}
|
|
29038
|
+
if (status === 408) {
|
|
29039
|
+
return "timeout";
|
|
29040
|
+
}
|
|
29041
|
+
return "network_http";
|
|
29042
|
+
}
|
|
29043
|
+
function classifyFromResult(result) {
|
|
29044
|
+
switch (result) {
|
|
29045
|
+
case "AuthenticationError":
|
|
29046
|
+
return "auth";
|
|
29047
|
+
case "ValidationError":
|
|
29048
|
+
return "validation";
|
|
29049
|
+
case "TimeoutError":
|
|
29050
|
+
return "timeout";
|
|
29051
|
+
default:
|
|
29052
|
+
return;
|
|
29053
|
+
}
|
|
29054
|
+
}
|
|
29055
|
+
function classifyFromErrorCode(errorCode) {
|
|
29056
|
+
if (!errorCode) {
|
|
29057
|
+
return;
|
|
29058
|
+
}
|
|
29059
|
+
if (AUTH_ERROR_CODES.has(errorCode)) {
|
|
29060
|
+
return "auth";
|
|
29061
|
+
}
|
|
29062
|
+
if (VALIDATION_ERROR_CODES.has(errorCode)) {
|
|
29063
|
+
return "validation";
|
|
29064
|
+
}
|
|
29065
|
+
if (TIMEOUT_ERROR_CODES.has(errorCode)) {
|
|
29066
|
+
return "timeout";
|
|
29067
|
+
}
|
|
29068
|
+
if (NETWORK_HTTP_ERROR_CODES.has(errorCode)) {
|
|
29069
|
+
return "network_http";
|
|
29070
|
+
}
|
|
29071
|
+
return;
|
|
29072
|
+
}
|
|
29073
|
+
function classifyFromError(error) {
|
|
29074
|
+
const code = findCodeInCauseChain(error);
|
|
29075
|
+
if (code) {
|
|
29076
|
+
if (code.startsWith("commander.")) {
|
|
29077
|
+
return "validation";
|
|
29078
|
+
}
|
|
29079
|
+
if (NETWORK_OS_ERROR_CODES.has(code) || TLS_ERROR_CODES2.has(code)) {
|
|
29080
|
+
return "network_http";
|
|
29081
|
+
}
|
|
29082
|
+
if (TIMEOUT_OS_ERROR_CODES.has(code)) {
|
|
29083
|
+
return "timeout";
|
|
29084
|
+
}
|
|
29085
|
+
if (MISSING_DEPENDENCY_CODES.has(code) || isSpawnEnoent(error)) {
|
|
29086
|
+
return "missing_dependency";
|
|
29087
|
+
}
|
|
29088
|
+
}
|
|
29089
|
+
const message = stringField(error, "message");
|
|
29090
|
+
if (message?.includes("fetch failed") === true) {
|
|
29091
|
+
return "network_http";
|
|
29092
|
+
}
|
|
29093
|
+
const name = stringField(error, "name");
|
|
29094
|
+
if (name && INTERNAL_ERROR_NAMES.has(name)) {
|
|
29095
|
+
return "internal";
|
|
29096
|
+
}
|
|
29097
|
+
return;
|
|
29098
|
+
}
|
|
29099
|
+
function classifyError2(input) {
|
|
29100
|
+
const recorded = input.recordedFailure;
|
|
29101
|
+
if (recorded?.errorClass) {
|
|
29102
|
+
return recorded.errorClass;
|
|
29103
|
+
}
|
|
29104
|
+
const status = recorded?.context?.httpStatus;
|
|
29105
|
+
if (status !== undefined) {
|
|
29106
|
+
return classifyHttpStatus(status);
|
|
29107
|
+
}
|
|
29108
|
+
return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
|
|
29109
|
+
}
|
|
29110
|
+
function recordCommandFailureTelemetry(failure) {
|
|
29111
|
+
recordedFailureSlot.set(failure);
|
|
29112
|
+
}
|
|
29113
|
+
function clearRecordedCommandFailureTelemetry() {
|
|
29114
|
+
recordedFailureSlot.clear();
|
|
29115
|
+
}
|
|
29116
|
+
function takeRecordedCommandFailureTelemetry() {
|
|
29117
|
+
const failure = recordedFailureSlot.get();
|
|
29118
|
+
recordedFailureSlot.clear();
|
|
29119
|
+
return failure;
|
|
29120
|
+
}
|
|
29121
|
+
function buildCommandTerminalTelemetryProperties(input) {
|
|
29122
|
+
const cancelled = isCancellationError(input.error, input.exitCode, input.pollSignal);
|
|
29123
|
+
const outcome = input.recordedFailure?.terminalOutcome ?? (input.exitCode === 0 ? "success" : cancelled ? "cancelled" : "failure");
|
|
29124
|
+
const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError2(input);
|
|
29125
|
+
const terminalSignal = terminalSignalFor(input, outcome);
|
|
29126
|
+
return {
|
|
29127
|
+
exit_code: input.exitCode,
|
|
29128
|
+
terminal_outcome: outcome,
|
|
29129
|
+
...errorClass ? { error_class: errorClass } : {},
|
|
29130
|
+
...terminalSignal ? { terminal_signal: terminalSignal } : {}
|
|
29131
|
+
};
|
|
29132
|
+
}
|
|
29133
|
+
|
|
28916
29134
|
// ../common/src/telemetry/telemetry-events.ts
|
|
28917
29135
|
var CommonTelemetryEvents = {
|
|
28918
|
-
Error: "uip.error"
|
|
29136
|
+
Error: "uip.error",
|
|
29137
|
+
ShipSucceeded: "ship_succeeded"
|
|
28919
29138
|
};
|
|
28920
29139
|
|
|
28921
29140
|
// ../common/src/registry.ts
|
|
@@ -28982,6 +29201,136 @@ function formatMessage(category, name, properties) {
|
|
|
28982
29201
|
}
|
|
28983
29202
|
return message;
|
|
28984
29203
|
}
|
|
29204
|
+
// ../common/src/telemetry/detect-agent.ts
|
|
29205
|
+
var KNOWN_AGENTS = [
|
|
29206
|
+
{ envVar: "CLAUDECODE", value: "1", id: "claude-code" },
|
|
29207
|
+
{ envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
|
|
29208
|
+
{ envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
|
|
29209
|
+
{ envVar: "CODEX_THREAD_ID", id: "codex" },
|
|
29210
|
+
{ envVar: "CODEX_SANDBOX", id: "codex" },
|
|
29211
|
+
{ envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
|
|
29212
|
+
{ envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
|
|
29213
|
+
];
|
|
29214
|
+
function detectAgentFromEnv(env) {
|
|
29215
|
+
for (const agent of KNOWN_AGENTS) {
|
|
29216
|
+
const envValue = env[agent.envVar];
|
|
29217
|
+
if (agent.value !== undefined) {
|
|
29218
|
+
if (envValue === agent.value)
|
|
29219
|
+
return agent.id;
|
|
29220
|
+
} else {
|
|
29221
|
+
if (envValue)
|
|
29222
|
+
return agent.id;
|
|
29223
|
+
}
|
|
29224
|
+
}
|
|
29225
|
+
const agentEnv = env.AGENT;
|
|
29226
|
+
if (agentEnv) {
|
|
29227
|
+
if (agentEnv === "1" || agentEnv === "true")
|
|
29228
|
+
return "unknown";
|
|
29229
|
+
if (agentEnv.length <= 32)
|
|
29230
|
+
return agentEnv.toLowerCase();
|
|
29231
|
+
}
|
|
29232
|
+
return;
|
|
29233
|
+
}
|
|
29234
|
+
// ../common/src/telemetry/environment-info.ts
|
|
29235
|
+
var LOCAL_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
|
|
29236
|
+
// ../common/src/telemetry/execution-context.ts
|
|
29237
|
+
var authSignalSlot = singleton("TelemetryExecutionContextAuthSignal");
|
|
29238
|
+
var isTruthy = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false";
|
|
29239
|
+
var isEqual = (value, expected) => value?.toLowerCase() === expected;
|
|
29240
|
+
var CI_SIGNATURES = [
|
|
29241
|
+
{
|
|
29242
|
+
provider: "github_actions",
|
|
29243
|
+
matches: (env) => isTruthy(env.GITHUB_ACTIONS),
|
|
29244
|
+
isScheduler: (env) => env.GITHUB_EVENT_NAME === "schedule"
|
|
29245
|
+
},
|
|
29246
|
+
{
|
|
29247
|
+
provider: "azure_devops",
|
|
29248
|
+
matches: (env) => isTruthy(env.TF_BUILD),
|
|
29249
|
+
isScheduler: (env) => isEqual(env.BUILD_REASON, "schedule")
|
|
29250
|
+
},
|
|
29251
|
+
{
|
|
29252
|
+
provider: "gitlab",
|
|
29253
|
+
matches: (env) => isTruthy(env.GITLAB_CI),
|
|
29254
|
+
isScheduler: (env) => env.CI_PIPELINE_SOURCE === "schedule"
|
|
29255
|
+
},
|
|
29256
|
+
{
|
|
29257
|
+
provider: "circleci",
|
|
29258
|
+
matches: (env) => isTruthy(env.CIRCLECI),
|
|
29259
|
+
isScheduler: (env) => env.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
|
|
29260
|
+
},
|
|
29261
|
+
{
|
|
29262
|
+
provider: "jenkins",
|
|
29263
|
+
matches: (env) => isTruthy(env.JENKINS_URL) || isTruthy(env.JENKINS_HOME)
|
|
29264
|
+
},
|
|
29265
|
+
{
|
|
29266
|
+
provider: "teamcity",
|
|
29267
|
+
matches: (env) => isTruthy(env.TEAMCITY_VERSION)
|
|
29268
|
+
},
|
|
29269
|
+
{
|
|
29270
|
+
provider: "buildkite",
|
|
29271
|
+
matches: (env) => isTruthy(env.BUILDKITE),
|
|
29272
|
+
isScheduler: (env) => env.BUILDKITE_SOURCE === "schedule"
|
|
29273
|
+
},
|
|
29274
|
+
{
|
|
29275
|
+
provider: "bitbucket",
|
|
29276
|
+
matches: (env) => isTruthy(env.BITBUCKET_BUILD_NUMBER)
|
|
29277
|
+
},
|
|
29278
|
+
{
|
|
29279
|
+
provider: "travis",
|
|
29280
|
+
matches: (env) => isTruthy(env.TRAVIS)
|
|
29281
|
+
},
|
|
29282
|
+
{
|
|
29283
|
+
provider: "appveyor",
|
|
29284
|
+
matches: (env) => isTruthy(env.APPVEYOR)
|
|
29285
|
+
},
|
|
29286
|
+
{
|
|
29287
|
+
provider: "generic",
|
|
29288
|
+
matches: (env) => isTruthy(env.CI)
|
|
29289
|
+
}
|
|
29290
|
+
];
|
|
29291
|
+
function currentEnv() {
|
|
29292
|
+
return typeof process === "undefined" ? {} : process.env;
|
|
29293
|
+
}
|
|
29294
|
+
function currentTtyState() {
|
|
29295
|
+
if (typeof process === "undefined")
|
|
29296
|
+
return false;
|
|
29297
|
+
return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
|
|
29298
|
+
}
|
|
29299
|
+
function detectCi(env) {
|
|
29300
|
+
const signature = CI_SIGNATURES.find((candidate) => candidate.matches(env));
|
|
29301
|
+
if (!signature)
|
|
29302
|
+
return;
|
|
29303
|
+
return {
|
|
29304
|
+
executionContext: signature.isScheduler?.(env) ? "scheduler" : "ci",
|
|
29305
|
+
ciProvider: signature.provider
|
|
29306
|
+
};
|
|
29307
|
+
}
|
|
29308
|
+
function detectExecutionContext(options = {}) {
|
|
29309
|
+
const env = options.env ?? currentEnv();
|
|
29310
|
+
const ci = detectCi(env);
|
|
29311
|
+
if (ci)
|
|
29312
|
+
return ci;
|
|
29313
|
+
const agent = options.agent ?? detectAgentFromEnv(env);
|
|
29314
|
+
if (agent) {
|
|
29315
|
+
return { executionContext: "agent" };
|
|
29316
|
+
}
|
|
29317
|
+
const authSignal = options.authSignal ?? authSignalSlot.get();
|
|
29318
|
+
if (authSignal === "service_account") {
|
|
29319
|
+
return { executionContext: "service_account" };
|
|
29320
|
+
}
|
|
29321
|
+
const isTty = options.isTty ?? currentTtyState();
|
|
29322
|
+
if (isTty) {
|
|
29323
|
+
return { executionContext: "manual" };
|
|
29324
|
+
}
|
|
29325
|
+
return { executionContext: "unknown" };
|
|
29326
|
+
}
|
|
29327
|
+
function getExecutionContextTelemetryProperties() {
|
|
29328
|
+
const detected = detectExecutionContext();
|
|
29329
|
+
return {
|
|
29330
|
+
execution_context: detected.executionContext,
|
|
29331
|
+
...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
|
|
29332
|
+
};
|
|
29333
|
+
}
|
|
28985
29334
|
// ../common/src/telemetry/node-context-storage.ts
|
|
28986
29335
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
28987
29336
|
|
|
@@ -28994,6 +29343,26 @@ class NodeContextStorage {
|
|
|
28994
29343
|
return this.storage.getStore();
|
|
28995
29344
|
}
|
|
28996
29345
|
}
|
|
29346
|
+
// ../common/src/telemetry/session-id.ts
|
|
29347
|
+
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
29348
|
+
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
29349
|
+
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
29350
|
+
function getProcessEnv() {
|
|
29351
|
+
return globalThis.process?.env;
|
|
29352
|
+
}
|
|
29353
|
+
function normalizeSessionId(value) {
|
|
29354
|
+
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
|
|
29355
|
+
return;
|
|
29356
|
+
}
|
|
29357
|
+
const trimmed = String(value).trim();
|
|
29358
|
+
return trimmed || undefined;
|
|
29359
|
+
}
|
|
29360
|
+
function getConfiguredTelemetrySessionId() {
|
|
29361
|
+
return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
29362
|
+
}
|
|
29363
|
+
function resolveTelemetrySessionId(existingSessionId) {
|
|
29364
|
+
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
29365
|
+
}
|
|
28997
29366
|
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
28998
29367
|
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
28999
29368
|
function getGlobalTelemetryProperties() {
|
|
@@ -29078,12 +29447,22 @@ class TelemetryService {
|
|
|
29078
29447
|
return this.contextStorage.getContext();
|
|
29079
29448
|
}
|
|
29080
29449
|
enrichPropertiesWithContext(properties, context) {
|
|
29081
|
-
|
|
29082
|
-
|
|
29450
|
+
const globalProperties = getGlobalTelemetryProperties();
|
|
29451
|
+
const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
|
|
29452
|
+
const sessionId = resolveTelemetrySessionId(existingSessionId);
|
|
29453
|
+
const enriched = {
|
|
29454
|
+
...getExecutionContextTelemetryProperties(),
|
|
29455
|
+
...globalProperties,
|
|
29083
29456
|
...this.defaultProperties,
|
|
29084
29457
|
...properties,
|
|
29085
29458
|
...context
|
|
29086
29459
|
};
|
|
29460
|
+
if (sessionId === undefined) {
|
|
29461
|
+
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
29462
|
+
} else {
|
|
29463
|
+
enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
|
|
29464
|
+
}
|
|
29465
|
+
return enriched;
|
|
29087
29466
|
}
|
|
29088
29467
|
generateId() {
|
|
29089
29468
|
return crypto.randomUUID().replaceAll("-", "");
|
|
@@ -29553,8 +29932,24 @@ var OutputFormatter;
|
|
|
29553
29932
|
data.ErrorCode ??= defaultErrorCodeForFailure(data);
|
|
29554
29933
|
data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
|
|
29555
29934
|
process.exitCode = EXIT_CODES[data.Result] ?? 1;
|
|
29556
|
-
|
|
29557
|
-
|
|
29935
|
+
recordCommandFailureTelemetry({
|
|
29936
|
+
result: data.Result,
|
|
29937
|
+
errorCode: data.ErrorCode,
|
|
29938
|
+
retry: data.Retry,
|
|
29939
|
+
message: data.Message,
|
|
29940
|
+
context: data.Context,
|
|
29941
|
+
exitCode: process.exitCode,
|
|
29942
|
+
errorClass: data.TelemetryErrorClass,
|
|
29943
|
+
terminalOutcome: data.TelemetryTerminalOutcome,
|
|
29944
|
+
terminalSignal: data.TelemetryTerminalSignal
|
|
29945
|
+
});
|
|
29946
|
+
const suppressTelemetry = data.SuppressTelemetry === true;
|
|
29947
|
+
const envelope = { ...data };
|
|
29948
|
+
delete envelope.SuppressTelemetry;
|
|
29949
|
+
delete envelope.TelemetryErrorClass;
|
|
29950
|
+
delete envelope.TelemetryTerminalOutcome;
|
|
29951
|
+
delete envelope.TelemetryTerminalSignal;
|
|
29952
|
+
if (!suppressTelemetry) {
|
|
29558
29953
|
telemetry.trackEvent(CommonTelemetryEvents.Error, {
|
|
29559
29954
|
result: data.Result,
|
|
29560
29955
|
errorCode: data.ErrorCode,
|
|
@@ -29617,6 +30012,158 @@ var OutputFormatter;
|
|
|
29617
30012
|
OutputFormatter.formatToString = formatToString;
|
|
29618
30013
|
})(OutputFormatter ||= {});
|
|
29619
30014
|
|
|
30015
|
+
// ../common/src/telemetry/command-attribution.ts
|
|
30016
|
+
var LEGACY_SKILL_NAMESPACE = "uipath:";
|
|
30017
|
+
var MAX_SKILL_NAME_LENGTH = 80;
|
|
30018
|
+
var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
|
|
30019
|
+
function productMode(productArea, mode) {
|
|
30020
|
+
return { product_area: productArea, mode };
|
|
30021
|
+
}
|
|
30022
|
+
function attributionRecord(groups) {
|
|
30023
|
+
const record = {};
|
|
30024
|
+
for (const [productArea, mode, names] of groups) {
|
|
30025
|
+
const attribution = productMode(productArea, mode);
|
|
30026
|
+
for (const name of names) {
|
|
30027
|
+
record[name] = attribution;
|
|
30028
|
+
}
|
|
30029
|
+
}
|
|
30030
|
+
return record;
|
|
30031
|
+
}
|
|
30032
|
+
function commandAttribution(groups) {
|
|
30033
|
+
const entries = [];
|
|
30034
|
+
for (const [productArea, mode, prefixes] of groups) {
|
|
30035
|
+
const attribution = productMode(productArea, mode);
|
|
30036
|
+
for (const prefix of prefixes) {
|
|
30037
|
+
entries.push({ prefix, attribution });
|
|
30038
|
+
}
|
|
30039
|
+
}
|
|
30040
|
+
return entries;
|
|
30041
|
+
}
|
|
30042
|
+
var SKILL_ATTRIBUTION = attributionRecord([
|
|
30043
|
+
["admin", "operate", ["uipath-admin"]],
|
|
30044
|
+
["agents", "build", ["uipath-agents"]],
|
|
30045
|
+
["api-workflow", "build", ["uipath-api-workflow"]],
|
|
30046
|
+
["automation-discovery", "build", ["uipath-automation-discovery"]],
|
|
30047
|
+
["coded-apps", "build", ["uipath-coded-apps"]],
|
|
30048
|
+
["data-fabric", "operate", ["uipath-data-fabric"]],
|
|
30049
|
+
["cli", "troubleshoot", ["uipath-feedback"]],
|
|
30050
|
+
["governance", "operate", ["uipath-governance"]],
|
|
30051
|
+
["action-center", "build", ["uipath-human-in-the-loop"]],
|
|
30052
|
+
["document-understanding", "build", ["uipath-ixp"]],
|
|
30053
|
+
[
|
|
30054
|
+
"maestro",
|
|
30055
|
+
"build",
|
|
30056
|
+
["uipath-maestro-bpmn", "uipath-maestro-case", "uipath-maestro-flow"]
|
|
30057
|
+
],
|
|
30058
|
+
["agenthub", "build", ["uipath-mcp-servers"]],
|
|
30059
|
+
["solution", "build", ["uipath-planner", "uipath-solution"]],
|
|
30060
|
+
["platform", "operate", ["uipath-platform"]],
|
|
30061
|
+
["quality", "troubleshoot", ["uipath-review"]],
|
|
30062
|
+
["rpa", "build", ["uipath-rpa"]],
|
|
30063
|
+
["cli", "operate", ["uipath-skill-catalog"]],
|
|
30064
|
+
["action-center", "operate", ["uipath-tasks"]],
|
|
30065
|
+
["test-manager", "operate", ["uipath-test"]],
|
|
30066
|
+
["platform", "troubleshoot", ["uipath-troubleshoot"]]
|
|
30067
|
+
]);
|
|
30068
|
+
var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
|
|
30069
|
+
var COMMAND_ATTRIBUTION = commandAttribution([
|
|
30070
|
+
["cli", "troubleshoot", ["uip.feedback"]],
|
|
30071
|
+
["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
|
|
30072
|
+
["context-grounding", "build", ["uip.context-grounding"]],
|
|
30073
|
+
["api-workflow", "build", ["uip.api-workflow"]],
|
|
30074
|
+
["rpa", "build", ["uip.rpa-legacy"]],
|
|
30075
|
+
["conversational", "operate", ["uip.conversational"]],
|
|
30076
|
+
["agents", "build", ["uip.codedagent", "uip.agent"]],
|
|
30077
|
+
["agenthub", "build", ["uip.agenthub"]],
|
|
30078
|
+
["coded-apps", "build", ["uip.codedapp"]],
|
|
30079
|
+
["functions", "build", ["uip.functions"]],
|
|
30080
|
+
["solution", "build", ["uip.solution"]],
|
|
30081
|
+
["maestro", "build", ["uip.maestro", "uip.case", "uip.flow"]],
|
|
30082
|
+
["llm-observability", "troubleshoot", ["uip.traces"]],
|
|
30083
|
+
["platform", "operate", ["uip.platform"]],
|
|
30084
|
+
["admin", "operate", ["uip.admin"]],
|
|
30085
|
+
["automation-ops", "operate", ["uip.aops"]],
|
|
30086
|
+
["documentation", "troubleshoot", ["uip.docsai"]],
|
|
30087
|
+
["governance", "operate", ["uip.gov"]],
|
|
30088
|
+
["insights", "operate", ["uip.insights"]],
|
|
30089
|
+
["document-understanding", "build", ["uip.ixp"]],
|
|
30090
|
+
["process-mining", "operate", ["uip.pm"]],
|
|
30091
|
+
["action-center", "operate", ["uip.tasks"]],
|
|
30092
|
+
["test-manager", "operate", ["uip.tm"]],
|
|
30093
|
+
["vertical-solutions", "build", ["uip.vss"]],
|
|
30094
|
+
["data-fabric", "operate", ["uip.df"]],
|
|
30095
|
+
["integration-service", "build", ["uip.is"]],
|
|
30096
|
+
["orchestrator", "operate", ["uip.or"]],
|
|
30097
|
+
[
|
|
30098
|
+
"cli",
|
|
30099
|
+
"operate",
|
|
30100
|
+
[
|
|
30101
|
+
"uip.login",
|
|
30102
|
+
"uip.logout",
|
|
30103
|
+
"uip.user",
|
|
30104
|
+
"uip.config",
|
|
30105
|
+
"uip.tools",
|
|
30106
|
+
"uip.skills",
|
|
30107
|
+
"uip.completion",
|
|
30108
|
+
"uip.update",
|
|
30109
|
+
"uip.mcp",
|
|
30110
|
+
"uip.track"
|
|
30111
|
+
]
|
|
30112
|
+
]
|
|
30113
|
+
]).sort((a, b) => b.prefix.length - a.prefix.length);
|
|
30114
|
+
function normalizeCommandPath(value) {
|
|
30115
|
+
if (typeof value !== "string") {
|
|
30116
|
+
return;
|
|
30117
|
+
}
|
|
30118
|
+
const trimmed = value.trim().toLowerCase();
|
|
30119
|
+
if (!trimmed) {
|
|
30120
|
+
return;
|
|
30121
|
+
}
|
|
30122
|
+
const tokens = trimmed.includes(" ") ? trimmed.split(/\s+/).filter((token) => token.length > 0).filter((token) => !token.startsWith("-")) : trimmed.split(".").filter((token) => token.length > 0);
|
|
30123
|
+
if (tokens.length === 0) {
|
|
30124
|
+
return;
|
|
30125
|
+
}
|
|
30126
|
+
const commandTokens = tokens[0] === "uip" ? tokens : ["uip", ...tokens];
|
|
30127
|
+
return commandTokens.join(".");
|
|
30128
|
+
}
|
|
30129
|
+
function getCommandProductModeAttribution(commandPath) {
|
|
30130
|
+
const normalized = normalizeCommandPath(commandPath);
|
|
30131
|
+
if (!normalized) {
|
|
30132
|
+
return;
|
|
30133
|
+
}
|
|
30134
|
+
return COMMAND_ATTRIBUTION.find(({ prefix }) => normalized === prefix || normalized.startsWith(`${prefix}.`))?.attribution;
|
|
30135
|
+
}
|
|
30136
|
+
function normalizeSkillNameWithOptions(value, options) {
|
|
30137
|
+
if (typeof value !== "string") {
|
|
30138
|
+
return;
|
|
30139
|
+
}
|
|
30140
|
+
const normalized = value.trim().toLowerCase();
|
|
30141
|
+
if (!normalized) {
|
|
30142
|
+
return;
|
|
30143
|
+
}
|
|
30144
|
+
const hasLegacyNamespace = normalized.startsWith(LEGACY_SKILL_NAMESPACE);
|
|
30145
|
+
if (hasLegacyNamespace && !options.allowLegacyNamespace) {
|
|
30146
|
+
return;
|
|
30147
|
+
}
|
|
30148
|
+
const skillName = hasLegacyNamespace ? normalized.slice(LEGACY_SKILL_NAMESPACE.length) : normalized;
|
|
30149
|
+
if (skillName.length > MAX_SKILL_NAME_LENGTH || !SKILL_NAME_PATTERN.test(skillName) || !KNOWN_SKILL_NAMES.has(skillName)) {
|
|
30150
|
+
return;
|
|
30151
|
+
}
|
|
30152
|
+
return skillName;
|
|
30153
|
+
}
|
|
30154
|
+
function normalizeSkillName(value) {
|
|
30155
|
+
return normalizeSkillNameWithOptions(value, {
|
|
30156
|
+
allowLegacyNamespace: false
|
|
30157
|
+
});
|
|
30158
|
+
}
|
|
30159
|
+
function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
30160
|
+
const skillName = normalizeSkillName(skillSource);
|
|
30161
|
+
return {
|
|
30162
|
+
...skillName ? { skill_name: skillName } : {},
|
|
30163
|
+
...getCommandProductModeAttribution(commandPath)
|
|
30164
|
+
};
|
|
30165
|
+
}
|
|
30166
|
+
|
|
29620
30167
|
// ../common/src/telemetry/pii-redactor.ts
|
|
29621
30168
|
var REDACTED = "[REDACTED]";
|
|
29622
30169
|
var MAX_VALUE_LENGTH = 200;
|
|
@@ -29794,6 +30341,12 @@ function commandHelpHint(commandPath) {
|
|
|
29794
30341
|
const command = commandPath.replace(/\./g, " ");
|
|
29795
30342
|
return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
|
|
29796
30343
|
}
|
|
30344
|
+
function isPromptCancellation(error) {
|
|
30345
|
+
return error instanceof Error && error.name === "ExitPromptError";
|
|
30346
|
+
}
|
|
30347
|
+
function exitCodeFromProcess(fallback) {
|
|
30348
|
+
return typeof process.exitCode === "number" ? process.exitCode : fallback;
|
|
30349
|
+
}
|
|
29797
30350
|
Command.prototype.trackedAction = function(context, fn, properties) {
|
|
29798
30351
|
const command = this;
|
|
29799
30352
|
return this.action(async (...args) => {
|
|
@@ -29801,6 +30354,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
29801
30354
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
29802
30355
|
const startTime = performance.now();
|
|
29803
30356
|
let errorMessage;
|
|
30357
|
+
let fallbackExitCode = EXIT_CODES.Success;
|
|
30358
|
+
clearRecordedCommandFailureTelemetry();
|
|
29804
30359
|
const [error] = await catchError(fn(...args));
|
|
29805
30360
|
if (error) {
|
|
29806
30361
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -29815,6 +30370,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
29815
30370
|
const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
|
|
29816
30371
|
const typedContext = typed.context ?? typed.Context;
|
|
29817
30372
|
const customContext = isErrorContext(typedContext) ? typedContext : undefined;
|
|
30373
|
+
const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
|
|
30374
|
+
fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
|
|
29818
30375
|
OutputFormatter.error({
|
|
29819
30376
|
Result: finalResult,
|
|
29820
30377
|
...customErrorCode ? { ErrorCode: customErrorCode } : {},
|
|
@@ -29823,16 +30380,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
29823
30380
|
...customRetry ? { Retry: customRetry } : {},
|
|
29824
30381
|
...customContext ? { Context: customContext } : {}
|
|
29825
30382
|
});
|
|
29826
|
-
context.exit(
|
|
30383
|
+
context.exit(fallbackExitCode);
|
|
29827
30384
|
}
|
|
29828
30385
|
const durationMs = performance.now() - startTime;
|
|
29829
|
-
const
|
|
30386
|
+
const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
|
|
30387
|
+
const recordedFailure = takeRecordedCommandFailureTelemetry();
|
|
30388
|
+
const success = !error && exitCode === 0;
|
|
30389
|
+
const terminalTelemetry = buildCommandTerminalTelemetryProperties({
|
|
30390
|
+
error,
|
|
30391
|
+
exitCode,
|
|
30392
|
+
recordedFailure,
|
|
30393
|
+
pollSignal: context.pollSignal
|
|
30394
|
+
});
|
|
29830
30395
|
telemetry.trackEvent(telemetryName, redactProperties({
|
|
29831
30396
|
...extractCommandParams(command),
|
|
29832
30397
|
...props,
|
|
30398
|
+
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
29833
30399
|
command: "true",
|
|
29834
30400
|
duration: String(durationMs),
|
|
29835
30401
|
success: String(success),
|
|
30402
|
+
...terminalTelemetry,
|
|
29836
30403
|
...errorMessage ? { errorMessage } : {}
|
|
29837
30404
|
}));
|
|
29838
30405
|
});
|
|
@@ -29977,6 +30544,8 @@ function installRequestHeaderForwarding(BaseApiClass, patchKey, forward) {
|
|
|
29977
30544
|
function installSdkUserAgentHeader(BaseApiClass, userAgent) {
|
|
29978
30545
|
installRequestHeaderForwarding(BaseApiClass, userAgentPatchKey(userAgent), (headers) => addSdkUserAgentHeader(headers, userAgent));
|
|
29979
30546
|
}
|
|
30547
|
+
// ../common/src/telemetry/ship-succeeded.ts
|
|
30548
|
+
var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
|
|
29980
30549
|
// ../common/src/tool-provider.ts
|
|
29981
30550
|
var factorySlot = singleton("PackagerFactoryProvider");
|
|
29982
30551
|
// src/services/resource-refresh-service.ts
|
|
@@ -46438,4 +47007,4 @@ export {
|
|
|
46438
47007
|
resourceRefreshAsync
|
|
46439
47008
|
};
|
|
46440
47009
|
|
|
46441
|
-
//# debugId=
|
|
47010
|
+
//# debugId=296B4FF093DB3D9B64756E2164756E21
|