@uipath/flow-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/init.js +585 -16
- package/dist/packager-tool.js +2 -2
- package/dist/tool.js +1199 -76
- package/dist/validation.js +583 -14
- package/package.json +2 -2
package/dist/init.js
CHANGED
|
@@ -165945,9 +165945,228 @@ function getOutputFilter() {
|
|
|
165945
165945
|
return filterSlot.get();
|
|
165946
165946
|
}
|
|
165947
165947
|
|
|
165948
|
+
// ../common/src/telemetry/command-terminal.ts
|
|
165949
|
+
var recordedFailureSlot = singleton("CommandTelemetryFailure");
|
|
165950
|
+
var AUTH_ERROR_CODES = new Set([
|
|
165951
|
+
"authentication_required",
|
|
165952
|
+
"permission_denied"
|
|
165953
|
+
]);
|
|
165954
|
+
var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
|
|
165955
|
+
var NETWORK_HTTP_ERROR_CODES = new Set([
|
|
165956
|
+
"network_error",
|
|
165957
|
+
"rate_limited",
|
|
165958
|
+
"server_error",
|
|
165959
|
+
"not_found",
|
|
165960
|
+
"method_not_allowed"
|
|
165961
|
+
]);
|
|
165962
|
+
var TIMEOUT_ERROR_CODES = new Set(["timeout"]);
|
|
165963
|
+
var NETWORK_OS_ERROR_CODES = new Set([
|
|
165964
|
+
"ECONNREFUSED",
|
|
165965
|
+
"ECONNRESET",
|
|
165966
|
+
"ENOTFOUND",
|
|
165967
|
+
"EAI_AGAIN",
|
|
165968
|
+
"EPIPE",
|
|
165969
|
+
"EHOSTUNREACH",
|
|
165970
|
+
"ENETUNREACH",
|
|
165971
|
+
"EAI_FAIL"
|
|
165972
|
+
]);
|
|
165973
|
+
var TIMEOUT_OS_ERROR_CODES = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
|
|
165974
|
+
var TLS_ERROR_CODES2 = new Set([
|
|
165975
|
+
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
165976
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
165977
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
165978
|
+
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
165979
|
+
"UNABLE_TO_GET_ISSUER_CERT",
|
|
165980
|
+
"CERT_HAS_EXPIRED",
|
|
165981
|
+
"CERT_UNTRUSTED",
|
|
165982
|
+
"ERR_TLS_CERT_ALTNAME_INVALID"
|
|
165983
|
+
]);
|
|
165984
|
+
var MISSING_DEPENDENCY_CODES = new Set([
|
|
165985
|
+
"MODULE_NOT_FOUND",
|
|
165986
|
+
"ERR_MODULE_NOT_FOUND"
|
|
165987
|
+
]);
|
|
165988
|
+
var INTERNAL_ERROR_NAMES = new Set([
|
|
165989
|
+
"TypeError",
|
|
165990
|
+
"ReferenceError",
|
|
165991
|
+
"SyntaxError",
|
|
165992
|
+
"RangeError"
|
|
165993
|
+
]);
|
|
165994
|
+
function isRecord(value) {
|
|
165995
|
+
return value !== null && typeof value === "object";
|
|
165996
|
+
}
|
|
165997
|
+
function stringField(value, field) {
|
|
165998
|
+
if (!isRecord(value)) {
|
|
165999
|
+
return;
|
|
166000
|
+
}
|
|
166001
|
+
const raw = value[field];
|
|
166002
|
+
return typeof raw === "string" ? raw : undefined;
|
|
166003
|
+
}
|
|
166004
|
+
function numberField(value, field) {
|
|
166005
|
+
if (!isRecord(value)) {
|
|
166006
|
+
return;
|
|
166007
|
+
}
|
|
166008
|
+
const raw = value[field];
|
|
166009
|
+
return typeof raw === "number" ? raw : undefined;
|
|
166010
|
+
}
|
|
166011
|
+
function findStringInCauseChain(error, field) {
|
|
166012
|
+
let current = error;
|
|
166013
|
+
for (let depth = 0;depth < 5 && current !== null && typeof current === "object"; depth++) {
|
|
166014
|
+
const value = stringField(current, field);
|
|
166015
|
+
if (value) {
|
|
166016
|
+
return value;
|
|
166017
|
+
}
|
|
166018
|
+
current = current.cause;
|
|
166019
|
+
}
|
|
166020
|
+
return;
|
|
166021
|
+
}
|
|
166022
|
+
function findCodeInCauseChain(error) {
|
|
166023
|
+
return findStringInCauseChain(error, "code");
|
|
166024
|
+
}
|
|
166025
|
+
function isSpawnEnoent(error) {
|
|
166026
|
+
const code = findCodeInCauseChain(error);
|
|
166027
|
+
if (code !== "ENOENT") {
|
|
166028
|
+
return false;
|
|
166029
|
+
}
|
|
166030
|
+
const syscall = findStringInCauseChain(error, "syscall");
|
|
166031
|
+
return syscall?.startsWith("spawn") === true;
|
|
166032
|
+
}
|
|
166033
|
+
function isCancellationError(error, exitCode, pollSignal) {
|
|
166034
|
+
if (exitCode === 130) {
|
|
166035
|
+
return true;
|
|
166036
|
+
}
|
|
166037
|
+
if (!isRecord(error)) {
|
|
166038
|
+
return false;
|
|
166039
|
+
}
|
|
166040
|
+
if (numberField(error, "exitCode") === 130) {
|
|
166041
|
+
return true;
|
|
166042
|
+
}
|
|
166043
|
+
const name = stringField(error, "name");
|
|
166044
|
+
if (name === "ExitPromptError") {
|
|
166045
|
+
return true;
|
|
166046
|
+
}
|
|
166047
|
+
if (name === "AbortError" && pollSignal?.aborted) {
|
|
166048
|
+
return true;
|
|
166049
|
+
}
|
|
166050
|
+
const message = stringField(error, "message");
|
|
166051
|
+
return message?.includes("SIGINT") === true;
|
|
166052
|
+
}
|
|
166053
|
+
function terminalSignalFor(input, outcome) {
|
|
166054
|
+
if (input.recordedFailure?.terminalSignal) {
|
|
166055
|
+
return input.recordedFailure.terminalSignal;
|
|
166056
|
+
}
|
|
166057
|
+
const explicit = findStringInCauseChain(input.error, "terminalSignal") ?? findStringInCauseChain(input.error, "signal");
|
|
166058
|
+
if (explicit) {
|
|
166059
|
+
return explicit;
|
|
166060
|
+
}
|
|
166061
|
+
return outcome === "cancelled" ? "SIGINT" : undefined;
|
|
166062
|
+
}
|
|
166063
|
+
function classifyHttpStatus(status) {
|
|
166064
|
+
if (status === 401 || status === 403) {
|
|
166065
|
+
return "auth";
|
|
166066
|
+
}
|
|
166067
|
+
if (status === 400 || status === 409 || status === 422) {
|
|
166068
|
+
return "validation";
|
|
166069
|
+
}
|
|
166070
|
+
if (status === 408) {
|
|
166071
|
+
return "timeout";
|
|
166072
|
+
}
|
|
166073
|
+
return "network_http";
|
|
166074
|
+
}
|
|
166075
|
+
function classifyFromResult(result) {
|
|
166076
|
+
switch (result) {
|
|
166077
|
+
case "AuthenticationError":
|
|
166078
|
+
return "auth";
|
|
166079
|
+
case "ValidationError":
|
|
166080
|
+
return "validation";
|
|
166081
|
+
case "TimeoutError":
|
|
166082
|
+
return "timeout";
|
|
166083
|
+
default:
|
|
166084
|
+
return;
|
|
166085
|
+
}
|
|
166086
|
+
}
|
|
166087
|
+
function classifyFromErrorCode(errorCode) {
|
|
166088
|
+
if (!errorCode) {
|
|
166089
|
+
return;
|
|
166090
|
+
}
|
|
166091
|
+
if (AUTH_ERROR_CODES.has(errorCode)) {
|
|
166092
|
+
return "auth";
|
|
166093
|
+
}
|
|
166094
|
+
if (VALIDATION_ERROR_CODES.has(errorCode)) {
|
|
166095
|
+
return "validation";
|
|
166096
|
+
}
|
|
166097
|
+
if (TIMEOUT_ERROR_CODES.has(errorCode)) {
|
|
166098
|
+
return "timeout";
|
|
166099
|
+
}
|
|
166100
|
+
if (NETWORK_HTTP_ERROR_CODES.has(errorCode)) {
|
|
166101
|
+
return "network_http";
|
|
166102
|
+
}
|
|
166103
|
+
return;
|
|
166104
|
+
}
|
|
166105
|
+
function classifyFromError(error) {
|
|
166106
|
+
const code = findCodeInCauseChain(error);
|
|
166107
|
+
if (code) {
|
|
166108
|
+
if (code.startsWith("commander.")) {
|
|
166109
|
+
return "validation";
|
|
166110
|
+
}
|
|
166111
|
+
if (NETWORK_OS_ERROR_CODES.has(code) || TLS_ERROR_CODES2.has(code)) {
|
|
166112
|
+
return "network_http";
|
|
166113
|
+
}
|
|
166114
|
+
if (TIMEOUT_OS_ERROR_CODES.has(code)) {
|
|
166115
|
+
return "timeout";
|
|
166116
|
+
}
|
|
166117
|
+
if (MISSING_DEPENDENCY_CODES.has(code) || isSpawnEnoent(error)) {
|
|
166118
|
+
return "missing_dependency";
|
|
166119
|
+
}
|
|
166120
|
+
}
|
|
166121
|
+
const message = stringField(error, "message");
|
|
166122
|
+
if (message?.includes("fetch failed") === true) {
|
|
166123
|
+
return "network_http";
|
|
166124
|
+
}
|
|
166125
|
+
const name = stringField(error, "name");
|
|
166126
|
+
if (name && INTERNAL_ERROR_NAMES.has(name)) {
|
|
166127
|
+
return "internal";
|
|
166128
|
+
}
|
|
166129
|
+
return;
|
|
166130
|
+
}
|
|
166131
|
+
function classifyError(input) {
|
|
166132
|
+
const recorded = input.recordedFailure;
|
|
166133
|
+
if (recorded?.errorClass) {
|
|
166134
|
+
return recorded.errorClass;
|
|
166135
|
+
}
|
|
166136
|
+
const status = recorded?.context?.httpStatus;
|
|
166137
|
+
if (status !== undefined) {
|
|
166138
|
+
return classifyHttpStatus(status);
|
|
166139
|
+
}
|
|
166140
|
+
return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
|
|
166141
|
+
}
|
|
166142
|
+
function recordCommandFailureTelemetry(failure) {
|
|
166143
|
+
recordedFailureSlot.set(failure);
|
|
166144
|
+
}
|
|
166145
|
+
function clearRecordedCommandFailureTelemetry() {
|
|
166146
|
+
recordedFailureSlot.clear();
|
|
166147
|
+
}
|
|
166148
|
+
function takeRecordedCommandFailureTelemetry() {
|
|
166149
|
+
const failure = recordedFailureSlot.get();
|
|
166150
|
+
recordedFailureSlot.clear();
|
|
166151
|
+
return failure;
|
|
166152
|
+
}
|
|
166153
|
+
function buildCommandTerminalTelemetryProperties(input) {
|
|
166154
|
+
const cancelled = isCancellationError(input.error, input.exitCode, input.pollSignal);
|
|
166155
|
+
const outcome = input.recordedFailure?.terminalOutcome ?? (input.exitCode === 0 ? "success" : cancelled ? "cancelled" : "failure");
|
|
166156
|
+
const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError(input);
|
|
166157
|
+
const terminalSignal = terminalSignalFor(input, outcome);
|
|
166158
|
+
return {
|
|
166159
|
+
exit_code: input.exitCode,
|
|
166160
|
+
terminal_outcome: outcome,
|
|
166161
|
+
...errorClass ? { error_class: errorClass } : {},
|
|
166162
|
+
...terminalSignal ? { terminal_signal: terminalSignal } : {}
|
|
166163
|
+
};
|
|
166164
|
+
}
|
|
166165
|
+
|
|
165948
166166
|
// ../common/src/telemetry/telemetry-events.ts
|
|
165949
166167
|
var CommonTelemetryEvents = {
|
|
165950
|
-
Error: "uip.error"
|
|
166168
|
+
Error: "uip.error",
|
|
166169
|
+
ShipSucceeded: "ship_succeeded"
|
|
165951
166170
|
};
|
|
165952
166171
|
|
|
165953
166172
|
// ../common/src/registry.ts
|
|
@@ -166014,6 +166233,136 @@ function formatMessage(category, name, properties) {
|
|
|
166014
166233
|
}
|
|
166015
166234
|
return message;
|
|
166016
166235
|
}
|
|
166236
|
+
// ../common/src/telemetry/detect-agent.ts
|
|
166237
|
+
var KNOWN_AGENTS = [
|
|
166238
|
+
{ envVar: "CLAUDECODE", value: "1", id: "claude-code" },
|
|
166239
|
+
{ envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
|
|
166240
|
+
{ envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
|
|
166241
|
+
{ envVar: "CODEX_THREAD_ID", id: "codex" },
|
|
166242
|
+
{ envVar: "CODEX_SANDBOX", id: "codex" },
|
|
166243
|
+
{ envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
|
|
166244
|
+
{ envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
|
|
166245
|
+
];
|
|
166246
|
+
function detectAgentFromEnv(env) {
|
|
166247
|
+
for (const agent of KNOWN_AGENTS) {
|
|
166248
|
+
const envValue = env[agent.envVar];
|
|
166249
|
+
if (agent.value !== undefined) {
|
|
166250
|
+
if (envValue === agent.value)
|
|
166251
|
+
return agent.id;
|
|
166252
|
+
} else {
|
|
166253
|
+
if (envValue)
|
|
166254
|
+
return agent.id;
|
|
166255
|
+
}
|
|
166256
|
+
}
|
|
166257
|
+
const agentEnv = env.AGENT;
|
|
166258
|
+
if (agentEnv) {
|
|
166259
|
+
if (agentEnv === "1" || agentEnv === "true")
|
|
166260
|
+
return "unknown";
|
|
166261
|
+
if (agentEnv.length <= 32)
|
|
166262
|
+
return agentEnv.toLowerCase();
|
|
166263
|
+
}
|
|
166264
|
+
return;
|
|
166265
|
+
}
|
|
166266
|
+
// ../common/src/telemetry/environment-info.ts
|
|
166267
|
+
var LOCAL_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
|
|
166268
|
+
// ../common/src/telemetry/execution-context.ts
|
|
166269
|
+
var authSignalSlot = singleton("TelemetryExecutionContextAuthSignal");
|
|
166270
|
+
var isTruthy = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false";
|
|
166271
|
+
var isEqual = (value, expected) => value?.toLowerCase() === expected;
|
|
166272
|
+
var CI_SIGNATURES = [
|
|
166273
|
+
{
|
|
166274
|
+
provider: "github_actions",
|
|
166275
|
+
matches: (env) => isTruthy(env.GITHUB_ACTIONS),
|
|
166276
|
+
isScheduler: (env) => env.GITHUB_EVENT_NAME === "schedule"
|
|
166277
|
+
},
|
|
166278
|
+
{
|
|
166279
|
+
provider: "azure_devops",
|
|
166280
|
+
matches: (env) => isTruthy(env.TF_BUILD),
|
|
166281
|
+
isScheduler: (env) => isEqual(env.BUILD_REASON, "schedule")
|
|
166282
|
+
},
|
|
166283
|
+
{
|
|
166284
|
+
provider: "gitlab",
|
|
166285
|
+
matches: (env) => isTruthy(env.GITLAB_CI),
|
|
166286
|
+
isScheduler: (env) => env.CI_PIPELINE_SOURCE === "schedule"
|
|
166287
|
+
},
|
|
166288
|
+
{
|
|
166289
|
+
provider: "circleci",
|
|
166290
|
+
matches: (env) => isTruthy(env.CIRCLECI),
|
|
166291
|
+
isScheduler: (env) => env.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
|
|
166292
|
+
},
|
|
166293
|
+
{
|
|
166294
|
+
provider: "jenkins",
|
|
166295
|
+
matches: (env) => isTruthy(env.JENKINS_URL) || isTruthy(env.JENKINS_HOME)
|
|
166296
|
+
},
|
|
166297
|
+
{
|
|
166298
|
+
provider: "teamcity",
|
|
166299
|
+
matches: (env) => isTruthy(env.TEAMCITY_VERSION)
|
|
166300
|
+
},
|
|
166301
|
+
{
|
|
166302
|
+
provider: "buildkite",
|
|
166303
|
+
matches: (env) => isTruthy(env.BUILDKITE),
|
|
166304
|
+
isScheduler: (env) => env.BUILDKITE_SOURCE === "schedule"
|
|
166305
|
+
},
|
|
166306
|
+
{
|
|
166307
|
+
provider: "bitbucket",
|
|
166308
|
+
matches: (env) => isTruthy(env.BITBUCKET_BUILD_NUMBER)
|
|
166309
|
+
},
|
|
166310
|
+
{
|
|
166311
|
+
provider: "travis",
|
|
166312
|
+
matches: (env) => isTruthy(env.TRAVIS)
|
|
166313
|
+
},
|
|
166314
|
+
{
|
|
166315
|
+
provider: "appveyor",
|
|
166316
|
+
matches: (env) => isTruthy(env.APPVEYOR)
|
|
166317
|
+
},
|
|
166318
|
+
{
|
|
166319
|
+
provider: "generic",
|
|
166320
|
+
matches: (env) => isTruthy(env.CI)
|
|
166321
|
+
}
|
|
166322
|
+
];
|
|
166323
|
+
function currentEnv() {
|
|
166324
|
+
return typeof process === "undefined" ? {} : process.env;
|
|
166325
|
+
}
|
|
166326
|
+
function currentTtyState() {
|
|
166327
|
+
if (typeof process === "undefined")
|
|
166328
|
+
return false;
|
|
166329
|
+
return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
|
|
166330
|
+
}
|
|
166331
|
+
function detectCi(env) {
|
|
166332
|
+
const signature = CI_SIGNATURES.find((candidate) => candidate.matches(env));
|
|
166333
|
+
if (!signature)
|
|
166334
|
+
return;
|
|
166335
|
+
return {
|
|
166336
|
+
executionContext: signature.isScheduler?.(env) ? "scheduler" : "ci",
|
|
166337
|
+
ciProvider: signature.provider
|
|
166338
|
+
};
|
|
166339
|
+
}
|
|
166340
|
+
function detectExecutionContext(options = {}) {
|
|
166341
|
+
const env = options.env ?? currentEnv();
|
|
166342
|
+
const ci = detectCi(env);
|
|
166343
|
+
if (ci)
|
|
166344
|
+
return ci;
|
|
166345
|
+
const agent = options.agent ?? detectAgentFromEnv(env);
|
|
166346
|
+
if (agent) {
|
|
166347
|
+
return { executionContext: "agent" };
|
|
166348
|
+
}
|
|
166349
|
+
const authSignal = options.authSignal ?? authSignalSlot.get();
|
|
166350
|
+
if (authSignal === "service_account") {
|
|
166351
|
+
return { executionContext: "service_account" };
|
|
166352
|
+
}
|
|
166353
|
+
const isTty = options.isTty ?? currentTtyState();
|
|
166354
|
+
if (isTty) {
|
|
166355
|
+
return { executionContext: "manual" };
|
|
166356
|
+
}
|
|
166357
|
+
return { executionContext: "unknown" };
|
|
166358
|
+
}
|
|
166359
|
+
function getExecutionContextTelemetryProperties() {
|
|
166360
|
+
const detected = detectExecutionContext();
|
|
166361
|
+
return {
|
|
166362
|
+
execution_context: detected.executionContext,
|
|
166363
|
+
...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
|
|
166364
|
+
};
|
|
166365
|
+
}
|
|
166017
166366
|
// ../common/src/telemetry/node-context-storage.ts
|
|
166018
166367
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
166019
166368
|
|
|
@@ -166026,6 +166375,26 @@ class NodeContextStorage {
|
|
|
166026
166375
|
return this.storage.getStore();
|
|
166027
166376
|
}
|
|
166028
166377
|
}
|
|
166378
|
+
// ../common/src/telemetry/session-id.ts
|
|
166379
|
+
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
166380
|
+
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
166381
|
+
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
166382
|
+
function getProcessEnv() {
|
|
166383
|
+
return globalThis.process?.env;
|
|
166384
|
+
}
|
|
166385
|
+
function normalizeSessionId(value) {
|
|
166386
|
+
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
|
|
166387
|
+
return;
|
|
166388
|
+
}
|
|
166389
|
+
const trimmed = String(value).trim();
|
|
166390
|
+
return trimmed || undefined;
|
|
166391
|
+
}
|
|
166392
|
+
function getConfiguredTelemetrySessionId() {
|
|
166393
|
+
return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
166394
|
+
}
|
|
166395
|
+
function resolveTelemetrySessionId(existingSessionId) {
|
|
166396
|
+
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
166397
|
+
}
|
|
166029
166398
|
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
166030
166399
|
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
166031
166400
|
function getGlobalTelemetryProperties() {
|
|
@@ -166110,12 +166479,22 @@ class TelemetryService {
|
|
|
166110
166479
|
return this.contextStorage.getContext();
|
|
166111
166480
|
}
|
|
166112
166481
|
enrichPropertiesWithContext(properties, context) {
|
|
166113
|
-
|
|
166114
|
-
|
|
166482
|
+
const globalProperties = getGlobalTelemetryProperties();
|
|
166483
|
+
const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
|
|
166484
|
+
const sessionId = resolveTelemetrySessionId(existingSessionId);
|
|
166485
|
+
const enriched = {
|
|
166486
|
+
...getExecutionContextTelemetryProperties(),
|
|
166487
|
+
...globalProperties,
|
|
166115
166488
|
...this.defaultProperties,
|
|
166116
166489
|
...properties,
|
|
166117
166490
|
...context
|
|
166118
166491
|
};
|
|
166492
|
+
if (sessionId === undefined) {
|
|
166493
|
+
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
166494
|
+
} else {
|
|
166495
|
+
enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
|
|
166496
|
+
}
|
|
166497
|
+
return enriched;
|
|
166119
166498
|
}
|
|
166120
166499
|
generateId() {
|
|
166121
166500
|
return crypto.randomUUID().replaceAll("-", "");
|
|
@@ -166585,8 +166964,24 @@ var OutputFormatter;
|
|
|
166585
166964
|
data.ErrorCode ??= defaultErrorCodeForFailure(data);
|
|
166586
166965
|
data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
|
|
166587
166966
|
process.exitCode = EXIT_CODES[data.Result] ?? 1;
|
|
166588
|
-
|
|
166589
|
-
|
|
166967
|
+
recordCommandFailureTelemetry({
|
|
166968
|
+
result: data.Result,
|
|
166969
|
+
errorCode: data.ErrorCode,
|
|
166970
|
+
retry: data.Retry,
|
|
166971
|
+
message: data.Message,
|
|
166972
|
+
context: data.Context,
|
|
166973
|
+
exitCode: process.exitCode,
|
|
166974
|
+
errorClass: data.TelemetryErrorClass,
|
|
166975
|
+
terminalOutcome: data.TelemetryTerminalOutcome,
|
|
166976
|
+
terminalSignal: data.TelemetryTerminalSignal
|
|
166977
|
+
});
|
|
166978
|
+
const suppressTelemetry = data.SuppressTelemetry === true;
|
|
166979
|
+
const envelope = { ...data };
|
|
166980
|
+
delete envelope.SuppressTelemetry;
|
|
166981
|
+
delete envelope.TelemetryErrorClass;
|
|
166982
|
+
delete envelope.TelemetryTerminalOutcome;
|
|
166983
|
+
delete envelope.TelemetryTerminalSignal;
|
|
166984
|
+
if (!suppressTelemetry) {
|
|
166590
166985
|
telemetry.trackEvent(CommonTelemetryEvents.Error, {
|
|
166591
166986
|
result: data.Result,
|
|
166592
166987
|
errorCode: data.ErrorCode,
|
|
@@ -166649,6 +167044,158 @@ var OutputFormatter;
|
|
|
166649
167044
|
OutputFormatter.formatToString = formatToString;
|
|
166650
167045
|
})(OutputFormatter ||= {});
|
|
166651
167046
|
|
|
167047
|
+
// ../common/src/telemetry/command-attribution.ts
|
|
167048
|
+
var LEGACY_SKILL_NAMESPACE = "uipath:";
|
|
167049
|
+
var MAX_SKILL_NAME_LENGTH = 80;
|
|
167050
|
+
var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
|
|
167051
|
+
function productMode(productArea, mode) {
|
|
167052
|
+
return { product_area: productArea, mode };
|
|
167053
|
+
}
|
|
167054
|
+
function attributionRecord(groups) {
|
|
167055
|
+
const record = {};
|
|
167056
|
+
for (const [productArea, mode, names] of groups) {
|
|
167057
|
+
const attribution = productMode(productArea, mode);
|
|
167058
|
+
for (const name of names) {
|
|
167059
|
+
record[name] = attribution;
|
|
167060
|
+
}
|
|
167061
|
+
}
|
|
167062
|
+
return record;
|
|
167063
|
+
}
|
|
167064
|
+
function commandAttribution(groups) {
|
|
167065
|
+
const entries = [];
|
|
167066
|
+
for (const [productArea, mode, prefixes] of groups) {
|
|
167067
|
+
const attribution = productMode(productArea, mode);
|
|
167068
|
+
for (const prefix of prefixes) {
|
|
167069
|
+
entries.push({ prefix, attribution });
|
|
167070
|
+
}
|
|
167071
|
+
}
|
|
167072
|
+
return entries;
|
|
167073
|
+
}
|
|
167074
|
+
var SKILL_ATTRIBUTION = attributionRecord([
|
|
167075
|
+
["admin", "operate", ["uipath-admin"]],
|
|
167076
|
+
["agents", "build", ["uipath-agents"]],
|
|
167077
|
+
["api-workflow", "build", ["uipath-api-workflow"]],
|
|
167078
|
+
["automation-discovery", "build", ["uipath-automation-discovery"]],
|
|
167079
|
+
["coded-apps", "build", ["uipath-coded-apps"]],
|
|
167080
|
+
["data-fabric", "operate", ["uipath-data-fabric"]],
|
|
167081
|
+
["cli", "troubleshoot", ["uipath-feedback"]],
|
|
167082
|
+
["governance", "operate", ["uipath-governance"]],
|
|
167083
|
+
["action-center", "build", ["uipath-human-in-the-loop"]],
|
|
167084
|
+
["document-understanding", "build", ["uipath-ixp"]],
|
|
167085
|
+
[
|
|
167086
|
+
"maestro",
|
|
167087
|
+
"build",
|
|
167088
|
+
["uipath-maestro-bpmn", "uipath-maestro-case", "uipath-maestro-flow"]
|
|
167089
|
+
],
|
|
167090
|
+
["agenthub", "build", ["uipath-mcp-servers"]],
|
|
167091
|
+
["solution", "build", ["uipath-planner", "uipath-solution"]],
|
|
167092
|
+
["platform", "operate", ["uipath-platform"]],
|
|
167093
|
+
["quality", "troubleshoot", ["uipath-review"]],
|
|
167094
|
+
["rpa", "build", ["uipath-rpa"]],
|
|
167095
|
+
["cli", "operate", ["uipath-skill-catalog"]],
|
|
167096
|
+
["action-center", "operate", ["uipath-tasks"]],
|
|
167097
|
+
["test-manager", "operate", ["uipath-test"]],
|
|
167098
|
+
["platform", "troubleshoot", ["uipath-troubleshoot"]]
|
|
167099
|
+
]);
|
|
167100
|
+
var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
|
|
167101
|
+
var COMMAND_ATTRIBUTION = commandAttribution([
|
|
167102
|
+
["cli", "troubleshoot", ["uip.feedback"]],
|
|
167103
|
+
["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
|
|
167104
|
+
["context-grounding", "build", ["uip.context-grounding"]],
|
|
167105
|
+
["api-workflow", "build", ["uip.api-workflow"]],
|
|
167106
|
+
["rpa", "build", ["uip.rpa-legacy"]],
|
|
167107
|
+
["conversational", "operate", ["uip.conversational"]],
|
|
167108
|
+
["agents", "build", ["uip.codedagent", "uip.agent"]],
|
|
167109
|
+
["agenthub", "build", ["uip.agenthub"]],
|
|
167110
|
+
["coded-apps", "build", ["uip.codedapp"]],
|
|
167111
|
+
["functions", "build", ["uip.functions"]],
|
|
167112
|
+
["solution", "build", ["uip.solution"]],
|
|
167113
|
+
["maestro", "build", ["uip.maestro", "uip.case", "uip.flow"]],
|
|
167114
|
+
["llm-observability", "troubleshoot", ["uip.traces"]],
|
|
167115
|
+
["platform", "operate", ["uip.platform"]],
|
|
167116
|
+
["admin", "operate", ["uip.admin"]],
|
|
167117
|
+
["automation-ops", "operate", ["uip.aops"]],
|
|
167118
|
+
["documentation", "troubleshoot", ["uip.docsai"]],
|
|
167119
|
+
["governance", "operate", ["uip.gov"]],
|
|
167120
|
+
["insights", "operate", ["uip.insights"]],
|
|
167121
|
+
["document-understanding", "build", ["uip.ixp"]],
|
|
167122
|
+
["process-mining", "operate", ["uip.pm"]],
|
|
167123
|
+
["action-center", "operate", ["uip.tasks"]],
|
|
167124
|
+
["test-manager", "operate", ["uip.tm"]],
|
|
167125
|
+
["vertical-solutions", "build", ["uip.vss"]],
|
|
167126
|
+
["data-fabric", "operate", ["uip.df"]],
|
|
167127
|
+
["integration-service", "build", ["uip.is"]],
|
|
167128
|
+
["orchestrator", "operate", ["uip.or"]],
|
|
167129
|
+
[
|
|
167130
|
+
"cli",
|
|
167131
|
+
"operate",
|
|
167132
|
+
[
|
|
167133
|
+
"uip.login",
|
|
167134
|
+
"uip.logout",
|
|
167135
|
+
"uip.user",
|
|
167136
|
+
"uip.config",
|
|
167137
|
+
"uip.tools",
|
|
167138
|
+
"uip.skills",
|
|
167139
|
+
"uip.completion",
|
|
167140
|
+
"uip.update",
|
|
167141
|
+
"uip.mcp",
|
|
167142
|
+
"uip.track"
|
|
167143
|
+
]
|
|
167144
|
+
]
|
|
167145
|
+
]).sort((a, b) => b.prefix.length - a.prefix.length);
|
|
167146
|
+
function normalizeCommandPath(value) {
|
|
167147
|
+
if (typeof value !== "string") {
|
|
167148
|
+
return;
|
|
167149
|
+
}
|
|
167150
|
+
const trimmed = value.trim().toLowerCase();
|
|
167151
|
+
if (!trimmed) {
|
|
167152
|
+
return;
|
|
167153
|
+
}
|
|
167154
|
+
const tokens = trimmed.includes(" ") ? trimmed.split(/\s+/).filter((token) => token.length > 0).filter((token) => !token.startsWith("-")) : trimmed.split(".").filter((token) => token.length > 0);
|
|
167155
|
+
if (tokens.length === 0) {
|
|
167156
|
+
return;
|
|
167157
|
+
}
|
|
167158
|
+
const commandTokens = tokens[0] === "uip" ? tokens : ["uip", ...tokens];
|
|
167159
|
+
return commandTokens.join(".");
|
|
167160
|
+
}
|
|
167161
|
+
function getCommandProductModeAttribution(commandPath) {
|
|
167162
|
+
const normalized = normalizeCommandPath(commandPath);
|
|
167163
|
+
if (!normalized) {
|
|
167164
|
+
return;
|
|
167165
|
+
}
|
|
167166
|
+
return COMMAND_ATTRIBUTION.find(({ prefix }) => normalized === prefix || normalized.startsWith(`${prefix}.`))?.attribution;
|
|
167167
|
+
}
|
|
167168
|
+
function normalizeSkillNameWithOptions(value, options) {
|
|
167169
|
+
if (typeof value !== "string") {
|
|
167170
|
+
return;
|
|
167171
|
+
}
|
|
167172
|
+
const normalized = value.trim().toLowerCase();
|
|
167173
|
+
if (!normalized) {
|
|
167174
|
+
return;
|
|
167175
|
+
}
|
|
167176
|
+
const hasLegacyNamespace = normalized.startsWith(LEGACY_SKILL_NAMESPACE);
|
|
167177
|
+
if (hasLegacyNamespace && !options.allowLegacyNamespace) {
|
|
167178
|
+
return;
|
|
167179
|
+
}
|
|
167180
|
+
const skillName = hasLegacyNamespace ? normalized.slice(LEGACY_SKILL_NAMESPACE.length) : normalized;
|
|
167181
|
+
if (skillName.length > MAX_SKILL_NAME_LENGTH || !SKILL_NAME_PATTERN.test(skillName) || !KNOWN_SKILL_NAMES.has(skillName)) {
|
|
167182
|
+
return;
|
|
167183
|
+
}
|
|
167184
|
+
return skillName;
|
|
167185
|
+
}
|
|
167186
|
+
function normalizeSkillName(value) {
|
|
167187
|
+
return normalizeSkillNameWithOptions(value, {
|
|
167188
|
+
allowLegacyNamespace: false
|
|
167189
|
+
});
|
|
167190
|
+
}
|
|
167191
|
+
function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
167192
|
+
const skillName = normalizeSkillName(skillSource);
|
|
167193
|
+
return {
|
|
167194
|
+
...skillName ? { skill_name: skillName } : {},
|
|
167195
|
+
...getCommandProductModeAttribution(commandPath)
|
|
167196
|
+
};
|
|
167197
|
+
}
|
|
167198
|
+
|
|
166652
167199
|
// ../common/src/telemetry/pii-redactor.ts
|
|
166653
167200
|
var REDACTED = "[REDACTED]";
|
|
166654
167201
|
var MAX_VALUE_LENGTH = 200;
|
|
@@ -166826,6 +167373,12 @@ function commandHelpHint(commandPath) {
|
|
|
166826
167373
|
const command = commandPath.replace(/\./g, " ");
|
|
166827
167374
|
return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
|
|
166828
167375
|
}
|
|
167376
|
+
function isPromptCancellation(error) {
|
|
167377
|
+
return error instanceof Error && error.name === "ExitPromptError";
|
|
167378
|
+
}
|
|
167379
|
+
function exitCodeFromProcess(fallback) {
|
|
167380
|
+
return typeof process.exitCode === "number" ? process.exitCode : fallback;
|
|
167381
|
+
}
|
|
166829
167382
|
Command.prototype.trackedAction = function(context, fn, properties) {
|
|
166830
167383
|
const command = this;
|
|
166831
167384
|
return this.action(async (...args) => {
|
|
@@ -166833,6 +167386,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
166833
167386
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
166834
167387
|
const startTime = performance.now();
|
|
166835
167388
|
let errorMessage;
|
|
167389
|
+
let fallbackExitCode = EXIT_CODES.Success;
|
|
167390
|
+
clearRecordedCommandFailureTelemetry();
|
|
166836
167391
|
const [error] = await catchError(fn(...args));
|
|
166837
167392
|
if (error) {
|
|
166838
167393
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -166847,6 +167402,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
166847
167402
|
const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
|
|
166848
167403
|
const typedContext = typed.context ?? typed.Context;
|
|
166849
167404
|
const customContext = isErrorContext(typedContext) ? typedContext : undefined;
|
|
167405
|
+
const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
|
|
167406
|
+
fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
|
|
166850
167407
|
OutputFormatter.error({
|
|
166851
167408
|
Result: finalResult,
|
|
166852
167409
|
...customErrorCode ? { ErrorCode: customErrorCode } : {},
|
|
@@ -166855,16 +167412,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
166855
167412
|
...customRetry ? { Retry: customRetry } : {},
|
|
166856
167413
|
...customContext ? { Context: customContext } : {}
|
|
166857
167414
|
});
|
|
166858
|
-
context.exit(
|
|
167415
|
+
context.exit(fallbackExitCode);
|
|
166859
167416
|
}
|
|
166860
167417
|
const durationMs = performance.now() - startTime;
|
|
166861
|
-
const
|
|
167418
|
+
const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
|
|
167419
|
+
const recordedFailure = takeRecordedCommandFailureTelemetry();
|
|
167420
|
+
const success = !error && exitCode === 0;
|
|
167421
|
+
const terminalTelemetry = buildCommandTerminalTelemetryProperties({
|
|
167422
|
+
error,
|
|
167423
|
+
exitCode,
|
|
167424
|
+
recordedFailure,
|
|
167425
|
+
pollSignal: context.pollSignal
|
|
167426
|
+
});
|
|
166862
167427
|
telemetry.trackEvent(telemetryName, redactProperties({
|
|
166863
167428
|
...extractCommandParams(command),
|
|
166864
167429
|
...props,
|
|
167430
|
+
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
166865
167431
|
command: "true",
|
|
166866
167432
|
duration: String(durationMs),
|
|
166867
167433
|
success: String(success),
|
|
167434
|
+
...terminalTelemetry,
|
|
166868
167435
|
...errorMessage ? { errorMessage } : {}
|
|
166869
167436
|
}));
|
|
166870
167437
|
});
|
|
@@ -167004,6 +167571,8 @@ function installRequestHeaderForwarding(BaseApiClass, patchKey, forward) {
|
|
|
167004
167571
|
function installSdkUserAgentHeader(BaseApiClass, userAgent) {
|
|
167005
167572
|
installRequestHeaderForwarding(BaseApiClass, userAgentPatchKey(userAgent), (headers) => addSdkUserAgentHeader(headers, userAgent));
|
|
167006
167573
|
}
|
|
167574
|
+
// ../common/src/telemetry/ship-succeeded.ts
|
|
167575
|
+
var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
|
|
167007
167576
|
// ../common/src/tool-provider.ts
|
|
167008
167577
|
var factorySlot = singleton("PackagerFactoryProvider");
|
|
167009
167578
|
// src/services/flow-init-service.ts
|
|
@@ -194628,7 +195197,7 @@ class TextApiResponse {
|
|
|
194628
195197
|
var package_default = {
|
|
194629
195198
|
name: "@uipath/integrationservice-sdk",
|
|
194630
195199
|
license: "MIT",
|
|
194631
|
-
version: "1.197.0-preview.
|
|
195200
|
+
version: "1.197.0-preview.67",
|
|
194632
195201
|
repository: {
|
|
194633
195202
|
type: "git",
|
|
194634
195203
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -201409,7 +201978,7 @@ function querystringSingleKey4(key, value, keyPrefix = "") {
|
|
|
201409
201978
|
var package_default3 = {
|
|
201410
201979
|
name: "@uipath/solution-sdk",
|
|
201411
201980
|
license: "MIT",
|
|
201412
|
-
version: "1.197.0-preview.
|
|
201981
|
+
version: "1.197.0-preview.67",
|
|
201413
201982
|
repository: {
|
|
201414
201983
|
type: "git",
|
|
201415
201984
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -201470,7 +202039,7 @@ function normalizeProjectType(projectType) {
|
|
|
201470
202039
|
function toPortableRelativePath(relativePath) {
|
|
201471
202040
|
return relativePath.replace(/\\/g, "/");
|
|
201472
202041
|
}
|
|
201473
|
-
function
|
|
202042
|
+
function isRecord2(value) {
|
|
201474
202043
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
201475
202044
|
}
|
|
201476
202045
|
async function tryRegisterProjectInParentSolution(fs7, projectDir, options) {
|
|
@@ -201663,11 +202232,11 @@ async function readProjectManifest(fs7, filePath, useProjectJson) {
|
|
|
201663
202232
|
null
|
|
201664
202233
|
];
|
|
201665
202234
|
}
|
|
201666
|
-
if (!
|
|
202235
|
+
if (!isRecord2(parsed)) {
|
|
201667
202236
|
return [new Error(`Invalid project file: ${filePath}`), null];
|
|
201668
202237
|
}
|
|
201669
202238
|
const designOptions = parsed.designOptions;
|
|
201670
|
-
const outputType = useProjectJson &&
|
|
202239
|
+
const outputType = useProjectJson && isRecord2(designOptions) ? readString(designOptions.outputType) : undefined;
|
|
201671
202240
|
const projectType = outputType ?? readString(parsed.ProjectType);
|
|
201672
202241
|
if (!projectType) {
|
|
201673
202242
|
return [new Error(`ProjectType not found in ${filePath}`), null];
|
|
@@ -201694,7 +202263,7 @@ async function readSolutionManifest(fs7, solutionFile) {
|
|
|
201694
202263
|
null
|
|
201695
202264
|
];
|
|
201696
202265
|
}
|
|
201697
|
-
if (!
|
|
202266
|
+
if (!isRecord2(parsed)) {
|
|
201698
202267
|
return [
|
|
201699
202268
|
new Error(`Invalid solution file: ${solutionFile} must contain a JSON object.`),
|
|
201700
202269
|
null
|
|
@@ -201708,7 +202277,7 @@ async function readSolutionManifest(fs7, solutionFile) {
|
|
|
201708
202277
|
}
|
|
201709
202278
|
const projects = [];
|
|
201710
202279
|
for (const [index, project] of parsed.Projects.entries()) {
|
|
201711
|
-
if (!
|
|
202280
|
+
if (!isRecord2(project)) {
|
|
201712
202281
|
return [
|
|
201713
202282
|
new Error(`Invalid solution file: Projects[${index}] must be an object.`),
|
|
201714
202283
|
null
|
|
@@ -203941,7 +204510,7 @@ init_dist2();
|
|
|
203941
204510
|
// ../packager/packager-tool-flow/package.json
|
|
203942
204511
|
var package_default4 = {
|
|
203943
204512
|
name: "@uipath/packager-tool-flow",
|
|
203944
|
-
version: "1.197.0-preview.
|
|
204513
|
+
version: "1.197.0-preview.67",
|
|
203945
204514
|
description: "UiPath Flow tool implementation",
|
|
203946
204515
|
type: "module",
|
|
203947
204516
|
exports: {
|
|
@@ -217739,4 +218308,4 @@ export {
|
|
|
217739
218308
|
flowInitAsync
|
|
217740
218309
|
};
|
|
217741
218310
|
|
|
217742
|
-
//# debugId=
|
|
218311
|
+
//# debugId=197F501B83C7DF4364756E2164756E21
|