@uipath/maestro-sdk 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/index.js +578 -9
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -53705,9 +53705,228 @@ function getOutputFilter() {
|
|
|
53705
53705
|
return filterSlot.get();
|
|
53706
53706
|
}
|
|
53707
53707
|
|
|
53708
|
+
// ../common/src/telemetry/command-terminal.ts
|
|
53709
|
+
var recordedFailureSlot = singleton("CommandTelemetryFailure");
|
|
53710
|
+
var AUTH_ERROR_CODES = new Set([
|
|
53711
|
+
"authentication_required",
|
|
53712
|
+
"permission_denied"
|
|
53713
|
+
]);
|
|
53714
|
+
var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
|
|
53715
|
+
var NETWORK_HTTP_ERROR_CODES = new Set([
|
|
53716
|
+
"network_error",
|
|
53717
|
+
"rate_limited",
|
|
53718
|
+
"server_error",
|
|
53719
|
+
"not_found",
|
|
53720
|
+
"method_not_allowed"
|
|
53721
|
+
]);
|
|
53722
|
+
var TIMEOUT_ERROR_CODES = new Set(["timeout"]);
|
|
53723
|
+
var NETWORK_OS_ERROR_CODES = new Set([
|
|
53724
|
+
"ECONNREFUSED",
|
|
53725
|
+
"ECONNRESET",
|
|
53726
|
+
"ENOTFOUND",
|
|
53727
|
+
"EAI_AGAIN",
|
|
53728
|
+
"EPIPE",
|
|
53729
|
+
"EHOSTUNREACH",
|
|
53730
|
+
"ENETUNREACH",
|
|
53731
|
+
"EAI_FAIL"
|
|
53732
|
+
]);
|
|
53733
|
+
var TIMEOUT_OS_ERROR_CODES = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
|
|
53734
|
+
var TLS_ERROR_CODES2 = new Set([
|
|
53735
|
+
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
53736
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
53737
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
53738
|
+
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
53739
|
+
"UNABLE_TO_GET_ISSUER_CERT",
|
|
53740
|
+
"CERT_HAS_EXPIRED",
|
|
53741
|
+
"CERT_UNTRUSTED",
|
|
53742
|
+
"ERR_TLS_CERT_ALTNAME_INVALID"
|
|
53743
|
+
]);
|
|
53744
|
+
var MISSING_DEPENDENCY_CODES = new Set([
|
|
53745
|
+
"MODULE_NOT_FOUND",
|
|
53746
|
+
"ERR_MODULE_NOT_FOUND"
|
|
53747
|
+
]);
|
|
53748
|
+
var INTERNAL_ERROR_NAMES = new Set([
|
|
53749
|
+
"TypeError",
|
|
53750
|
+
"ReferenceError",
|
|
53751
|
+
"SyntaxError",
|
|
53752
|
+
"RangeError"
|
|
53753
|
+
]);
|
|
53754
|
+
function isRecord2(value) {
|
|
53755
|
+
return value !== null && typeof value === "object";
|
|
53756
|
+
}
|
|
53757
|
+
function stringField(value, field) {
|
|
53758
|
+
if (!isRecord2(value)) {
|
|
53759
|
+
return;
|
|
53760
|
+
}
|
|
53761
|
+
const raw = value[field];
|
|
53762
|
+
return typeof raw === "string" ? raw : undefined;
|
|
53763
|
+
}
|
|
53764
|
+
function numberField(value, field) {
|
|
53765
|
+
if (!isRecord2(value)) {
|
|
53766
|
+
return;
|
|
53767
|
+
}
|
|
53768
|
+
const raw = value[field];
|
|
53769
|
+
return typeof raw === "number" ? raw : undefined;
|
|
53770
|
+
}
|
|
53771
|
+
function findStringInCauseChain(error, field) {
|
|
53772
|
+
let current = error;
|
|
53773
|
+
for (let depth = 0;depth < 5 && current !== null && typeof current === "object"; depth++) {
|
|
53774
|
+
const value = stringField(current, field);
|
|
53775
|
+
if (value) {
|
|
53776
|
+
return value;
|
|
53777
|
+
}
|
|
53778
|
+
current = current.cause;
|
|
53779
|
+
}
|
|
53780
|
+
return;
|
|
53781
|
+
}
|
|
53782
|
+
function findCodeInCauseChain(error) {
|
|
53783
|
+
return findStringInCauseChain(error, "code");
|
|
53784
|
+
}
|
|
53785
|
+
function isSpawnEnoent(error) {
|
|
53786
|
+
const code = findCodeInCauseChain(error);
|
|
53787
|
+
if (code !== "ENOENT") {
|
|
53788
|
+
return false;
|
|
53789
|
+
}
|
|
53790
|
+
const syscall = findStringInCauseChain(error, "syscall");
|
|
53791
|
+
return syscall?.startsWith("spawn") === true;
|
|
53792
|
+
}
|
|
53793
|
+
function isCancellationError(error, exitCode, pollSignal) {
|
|
53794
|
+
if (exitCode === 130) {
|
|
53795
|
+
return true;
|
|
53796
|
+
}
|
|
53797
|
+
if (!isRecord2(error)) {
|
|
53798
|
+
return false;
|
|
53799
|
+
}
|
|
53800
|
+
if (numberField(error, "exitCode") === 130) {
|
|
53801
|
+
return true;
|
|
53802
|
+
}
|
|
53803
|
+
const name = stringField(error, "name");
|
|
53804
|
+
if (name === "ExitPromptError") {
|
|
53805
|
+
return true;
|
|
53806
|
+
}
|
|
53807
|
+
if (name === "AbortError" && pollSignal?.aborted) {
|
|
53808
|
+
return true;
|
|
53809
|
+
}
|
|
53810
|
+
const message = stringField(error, "message");
|
|
53811
|
+
return message?.includes("SIGINT") === true;
|
|
53812
|
+
}
|
|
53813
|
+
function terminalSignalFor(input, outcome) {
|
|
53814
|
+
if (input.recordedFailure?.terminalSignal) {
|
|
53815
|
+
return input.recordedFailure.terminalSignal;
|
|
53816
|
+
}
|
|
53817
|
+
const explicit = findStringInCauseChain(input.error, "terminalSignal") ?? findStringInCauseChain(input.error, "signal");
|
|
53818
|
+
if (explicit) {
|
|
53819
|
+
return explicit;
|
|
53820
|
+
}
|
|
53821
|
+
return outcome === "cancelled" ? "SIGINT" : undefined;
|
|
53822
|
+
}
|
|
53823
|
+
function classifyHttpStatus(status) {
|
|
53824
|
+
if (status === 401 || status === 403) {
|
|
53825
|
+
return "auth";
|
|
53826
|
+
}
|
|
53827
|
+
if (status === 400 || status === 409 || status === 422) {
|
|
53828
|
+
return "validation";
|
|
53829
|
+
}
|
|
53830
|
+
if (status === 408) {
|
|
53831
|
+
return "timeout";
|
|
53832
|
+
}
|
|
53833
|
+
return "network_http";
|
|
53834
|
+
}
|
|
53835
|
+
function classifyFromResult(result) {
|
|
53836
|
+
switch (result) {
|
|
53837
|
+
case "AuthenticationError":
|
|
53838
|
+
return "auth";
|
|
53839
|
+
case "ValidationError":
|
|
53840
|
+
return "validation";
|
|
53841
|
+
case "TimeoutError":
|
|
53842
|
+
return "timeout";
|
|
53843
|
+
default:
|
|
53844
|
+
return;
|
|
53845
|
+
}
|
|
53846
|
+
}
|
|
53847
|
+
function classifyFromErrorCode(errorCode) {
|
|
53848
|
+
if (!errorCode) {
|
|
53849
|
+
return;
|
|
53850
|
+
}
|
|
53851
|
+
if (AUTH_ERROR_CODES.has(errorCode)) {
|
|
53852
|
+
return "auth";
|
|
53853
|
+
}
|
|
53854
|
+
if (VALIDATION_ERROR_CODES.has(errorCode)) {
|
|
53855
|
+
return "validation";
|
|
53856
|
+
}
|
|
53857
|
+
if (TIMEOUT_ERROR_CODES.has(errorCode)) {
|
|
53858
|
+
return "timeout";
|
|
53859
|
+
}
|
|
53860
|
+
if (NETWORK_HTTP_ERROR_CODES.has(errorCode)) {
|
|
53861
|
+
return "network_http";
|
|
53862
|
+
}
|
|
53863
|
+
return;
|
|
53864
|
+
}
|
|
53865
|
+
function classifyFromError(error) {
|
|
53866
|
+
const code = findCodeInCauseChain(error);
|
|
53867
|
+
if (code) {
|
|
53868
|
+
if (code.startsWith("commander.")) {
|
|
53869
|
+
return "validation";
|
|
53870
|
+
}
|
|
53871
|
+
if (NETWORK_OS_ERROR_CODES.has(code) || TLS_ERROR_CODES2.has(code)) {
|
|
53872
|
+
return "network_http";
|
|
53873
|
+
}
|
|
53874
|
+
if (TIMEOUT_OS_ERROR_CODES.has(code)) {
|
|
53875
|
+
return "timeout";
|
|
53876
|
+
}
|
|
53877
|
+
if (MISSING_DEPENDENCY_CODES.has(code) || isSpawnEnoent(error)) {
|
|
53878
|
+
return "missing_dependency";
|
|
53879
|
+
}
|
|
53880
|
+
}
|
|
53881
|
+
const message = stringField(error, "message");
|
|
53882
|
+
if (message?.includes("fetch failed") === true) {
|
|
53883
|
+
return "network_http";
|
|
53884
|
+
}
|
|
53885
|
+
const name = stringField(error, "name");
|
|
53886
|
+
if (name && INTERNAL_ERROR_NAMES.has(name)) {
|
|
53887
|
+
return "internal";
|
|
53888
|
+
}
|
|
53889
|
+
return;
|
|
53890
|
+
}
|
|
53891
|
+
function classifyError2(input) {
|
|
53892
|
+
const recorded = input.recordedFailure;
|
|
53893
|
+
if (recorded?.errorClass) {
|
|
53894
|
+
return recorded.errorClass;
|
|
53895
|
+
}
|
|
53896
|
+
const status = recorded?.context?.httpStatus;
|
|
53897
|
+
if (status !== undefined) {
|
|
53898
|
+
return classifyHttpStatus(status);
|
|
53899
|
+
}
|
|
53900
|
+
return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
|
|
53901
|
+
}
|
|
53902
|
+
function recordCommandFailureTelemetry(failure) {
|
|
53903
|
+
recordedFailureSlot.set(failure);
|
|
53904
|
+
}
|
|
53905
|
+
function clearRecordedCommandFailureTelemetry() {
|
|
53906
|
+
recordedFailureSlot.clear();
|
|
53907
|
+
}
|
|
53908
|
+
function takeRecordedCommandFailureTelemetry() {
|
|
53909
|
+
const failure = recordedFailureSlot.get();
|
|
53910
|
+
recordedFailureSlot.clear();
|
|
53911
|
+
return failure;
|
|
53912
|
+
}
|
|
53913
|
+
function buildCommandTerminalTelemetryProperties(input) {
|
|
53914
|
+
const cancelled = isCancellationError(input.error, input.exitCode, input.pollSignal);
|
|
53915
|
+
const outcome = input.recordedFailure?.terminalOutcome ?? (input.exitCode === 0 ? "success" : cancelled ? "cancelled" : "failure");
|
|
53916
|
+
const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError2(input);
|
|
53917
|
+
const terminalSignal = terminalSignalFor(input, outcome);
|
|
53918
|
+
return {
|
|
53919
|
+
exit_code: input.exitCode,
|
|
53920
|
+
terminal_outcome: outcome,
|
|
53921
|
+
...errorClass ? { error_class: errorClass } : {},
|
|
53922
|
+
...terminalSignal ? { terminal_signal: terminalSignal } : {}
|
|
53923
|
+
};
|
|
53924
|
+
}
|
|
53925
|
+
|
|
53708
53926
|
// ../common/src/telemetry/telemetry-events.ts
|
|
53709
53927
|
var CommonTelemetryEvents = {
|
|
53710
|
-
Error: "uip.error"
|
|
53928
|
+
Error: "uip.error",
|
|
53929
|
+
ShipSucceeded: "ship_succeeded"
|
|
53711
53930
|
};
|
|
53712
53931
|
|
|
53713
53932
|
// ../common/src/registry.ts
|
|
@@ -53774,6 +53993,136 @@ function formatMessage(category, name, properties) {
|
|
|
53774
53993
|
}
|
|
53775
53994
|
return message;
|
|
53776
53995
|
}
|
|
53996
|
+
// ../common/src/telemetry/detect-agent.ts
|
|
53997
|
+
var KNOWN_AGENTS = [
|
|
53998
|
+
{ envVar: "CLAUDECODE", value: "1", id: "claude-code" },
|
|
53999
|
+
{ envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
|
|
54000
|
+
{ envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
|
|
54001
|
+
{ envVar: "CODEX_THREAD_ID", id: "codex" },
|
|
54002
|
+
{ envVar: "CODEX_SANDBOX", id: "codex" },
|
|
54003
|
+
{ envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
|
|
54004
|
+
{ envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
|
|
54005
|
+
];
|
|
54006
|
+
function detectAgentFromEnv(env) {
|
|
54007
|
+
for (const agent of KNOWN_AGENTS) {
|
|
54008
|
+
const envValue = env[agent.envVar];
|
|
54009
|
+
if (agent.value !== undefined) {
|
|
54010
|
+
if (envValue === agent.value)
|
|
54011
|
+
return agent.id;
|
|
54012
|
+
} else {
|
|
54013
|
+
if (envValue)
|
|
54014
|
+
return agent.id;
|
|
54015
|
+
}
|
|
54016
|
+
}
|
|
54017
|
+
const agentEnv = env.AGENT;
|
|
54018
|
+
if (agentEnv) {
|
|
54019
|
+
if (agentEnv === "1" || agentEnv === "true")
|
|
54020
|
+
return "unknown";
|
|
54021
|
+
if (agentEnv.length <= 32)
|
|
54022
|
+
return agentEnv.toLowerCase();
|
|
54023
|
+
}
|
|
54024
|
+
return;
|
|
54025
|
+
}
|
|
54026
|
+
// ../common/src/telemetry/environment-info.ts
|
|
54027
|
+
var LOCAL_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
|
|
54028
|
+
// ../common/src/telemetry/execution-context.ts
|
|
54029
|
+
var authSignalSlot = singleton("TelemetryExecutionContextAuthSignal");
|
|
54030
|
+
var isTruthy = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false";
|
|
54031
|
+
var isEqual = (value, expected) => value?.toLowerCase() === expected;
|
|
54032
|
+
var CI_SIGNATURES = [
|
|
54033
|
+
{
|
|
54034
|
+
provider: "github_actions",
|
|
54035
|
+
matches: (env) => isTruthy(env.GITHUB_ACTIONS),
|
|
54036
|
+
isScheduler: (env) => env.GITHUB_EVENT_NAME === "schedule"
|
|
54037
|
+
},
|
|
54038
|
+
{
|
|
54039
|
+
provider: "azure_devops",
|
|
54040
|
+
matches: (env) => isTruthy(env.TF_BUILD),
|
|
54041
|
+
isScheduler: (env) => isEqual(env.BUILD_REASON, "schedule")
|
|
54042
|
+
},
|
|
54043
|
+
{
|
|
54044
|
+
provider: "gitlab",
|
|
54045
|
+
matches: (env) => isTruthy(env.GITLAB_CI),
|
|
54046
|
+
isScheduler: (env) => env.CI_PIPELINE_SOURCE === "schedule"
|
|
54047
|
+
},
|
|
54048
|
+
{
|
|
54049
|
+
provider: "circleci",
|
|
54050
|
+
matches: (env) => isTruthy(env.CIRCLECI),
|
|
54051
|
+
isScheduler: (env) => env.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
|
|
54052
|
+
},
|
|
54053
|
+
{
|
|
54054
|
+
provider: "jenkins",
|
|
54055
|
+
matches: (env) => isTruthy(env.JENKINS_URL) || isTruthy(env.JENKINS_HOME)
|
|
54056
|
+
},
|
|
54057
|
+
{
|
|
54058
|
+
provider: "teamcity",
|
|
54059
|
+
matches: (env) => isTruthy(env.TEAMCITY_VERSION)
|
|
54060
|
+
},
|
|
54061
|
+
{
|
|
54062
|
+
provider: "buildkite",
|
|
54063
|
+
matches: (env) => isTruthy(env.BUILDKITE),
|
|
54064
|
+
isScheduler: (env) => env.BUILDKITE_SOURCE === "schedule"
|
|
54065
|
+
},
|
|
54066
|
+
{
|
|
54067
|
+
provider: "bitbucket",
|
|
54068
|
+
matches: (env) => isTruthy(env.BITBUCKET_BUILD_NUMBER)
|
|
54069
|
+
},
|
|
54070
|
+
{
|
|
54071
|
+
provider: "travis",
|
|
54072
|
+
matches: (env) => isTruthy(env.TRAVIS)
|
|
54073
|
+
},
|
|
54074
|
+
{
|
|
54075
|
+
provider: "appveyor",
|
|
54076
|
+
matches: (env) => isTruthy(env.APPVEYOR)
|
|
54077
|
+
},
|
|
54078
|
+
{
|
|
54079
|
+
provider: "generic",
|
|
54080
|
+
matches: (env) => isTruthy(env.CI)
|
|
54081
|
+
}
|
|
54082
|
+
];
|
|
54083
|
+
function currentEnv() {
|
|
54084
|
+
return typeof process === "undefined" ? {} : process.env;
|
|
54085
|
+
}
|
|
54086
|
+
function currentTtyState() {
|
|
54087
|
+
if (typeof process === "undefined")
|
|
54088
|
+
return false;
|
|
54089
|
+
return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
|
|
54090
|
+
}
|
|
54091
|
+
function detectCi(env) {
|
|
54092
|
+
const signature = CI_SIGNATURES.find((candidate) => candidate.matches(env));
|
|
54093
|
+
if (!signature)
|
|
54094
|
+
return;
|
|
54095
|
+
return {
|
|
54096
|
+
executionContext: signature.isScheduler?.(env) ? "scheduler" : "ci",
|
|
54097
|
+
ciProvider: signature.provider
|
|
54098
|
+
};
|
|
54099
|
+
}
|
|
54100
|
+
function detectExecutionContext(options = {}) {
|
|
54101
|
+
const env = options.env ?? currentEnv();
|
|
54102
|
+
const ci = detectCi(env);
|
|
54103
|
+
if (ci)
|
|
54104
|
+
return ci;
|
|
54105
|
+
const agent = options.agent ?? detectAgentFromEnv(env);
|
|
54106
|
+
if (agent) {
|
|
54107
|
+
return { executionContext: "agent" };
|
|
54108
|
+
}
|
|
54109
|
+
const authSignal = options.authSignal ?? authSignalSlot.get();
|
|
54110
|
+
if (authSignal === "service_account") {
|
|
54111
|
+
return { executionContext: "service_account" };
|
|
54112
|
+
}
|
|
54113
|
+
const isTty = options.isTty ?? currentTtyState();
|
|
54114
|
+
if (isTty) {
|
|
54115
|
+
return { executionContext: "manual" };
|
|
54116
|
+
}
|
|
54117
|
+
return { executionContext: "unknown" };
|
|
54118
|
+
}
|
|
54119
|
+
function getExecutionContextTelemetryProperties() {
|
|
54120
|
+
const detected = detectExecutionContext();
|
|
54121
|
+
return {
|
|
54122
|
+
execution_context: detected.executionContext,
|
|
54123
|
+
...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
|
|
54124
|
+
};
|
|
54125
|
+
}
|
|
53777
54126
|
// ../common/src/telemetry/node-context-storage.ts
|
|
53778
54127
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
53779
54128
|
|
|
@@ -53786,6 +54135,26 @@ class NodeContextStorage {
|
|
|
53786
54135
|
return this.storage.getStore();
|
|
53787
54136
|
}
|
|
53788
54137
|
}
|
|
54138
|
+
// ../common/src/telemetry/session-id.ts
|
|
54139
|
+
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
54140
|
+
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
54141
|
+
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
54142
|
+
function getProcessEnv() {
|
|
54143
|
+
return globalThis.process?.env;
|
|
54144
|
+
}
|
|
54145
|
+
function normalizeSessionId(value) {
|
|
54146
|
+
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
|
|
54147
|
+
return;
|
|
54148
|
+
}
|
|
54149
|
+
const trimmed = String(value).trim();
|
|
54150
|
+
return trimmed || undefined;
|
|
54151
|
+
}
|
|
54152
|
+
function getConfiguredTelemetrySessionId() {
|
|
54153
|
+
return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
54154
|
+
}
|
|
54155
|
+
function resolveTelemetrySessionId(existingSessionId) {
|
|
54156
|
+
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
54157
|
+
}
|
|
53789
54158
|
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
53790
54159
|
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
53791
54160
|
function getGlobalTelemetryProperties() {
|
|
@@ -53870,12 +54239,22 @@ class TelemetryService {
|
|
|
53870
54239
|
return this.contextStorage.getContext();
|
|
53871
54240
|
}
|
|
53872
54241
|
enrichPropertiesWithContext(properties, context) {
|
|
53873
|
-
|
|
53874
|
-
|
|
54242
|
+
const globalProperties = getGlobalTelemetryProperties();
|
|
54243
|
+
const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
|
|
54244
|
+
const sessionId = resolveTelemetrySessionId(existingSessionId);
|
|
54245
|
+
const enriched = {
|
|
54246
|
+
...getExecutionContextTelemetryProperties(),
|
|
54247
|
+
...globalProperties,
|
|
53875
54248
|
...this.defaultProperties,
|
|
53876
54249
|
...properties,
|
|
53877
54250
|
...context
|
|
53878
54251
|
};
|
|
54252
|
+
if (sessionId === undefined) {
|
|
54253
|
+
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
54254
|
+
} else {
|
|
54255
|
+
enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
|
|
54256
|
+
}
|
|
54257
|
+
return enriched;
|
|
53879
54258
|
}
|
|
53880
54259
|
generateId() {
|
|
53881
54260
|
return crypto.randomUUID().replaceAll("-", "");
|
|
@@ -54345,8 +54724,24 @@ var OutputFormatter;
|
|
|
54345
54724
|
data.ErrorCode ??= defaultErrorCodeForFailure(data);
|
|
54346
54725
|
data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
|
|
54347
54726
|
process.exitCode = EXIT_CODES[data.Result] ?? 1;
|
|
54348
|
-
|
|
54349
|
-
|
|
54727
|
+
recordCommandFailureTelemetry({
|
|
54728
|
+
result: data.Result,
|
|
54729
|
+
errorCode: data.ErrorCode,
|
|
54730
|
+
retry: data.Retry,
|
|
54731
|
+
message: data.Message,
|
|
54732
|
+
context: data.Context,
|
|
54733
|
+
exitCode: process.exitCode,
|
|
54734
|
+
errorClass: data.TelemetryErrorClass,
|
|
54735
|
+
terminalOutcome: data.TelemetryTerminalOutcome,
|
|
54736
|
+
terminalSignal: data.TelemetryTerminalSignal
|
|
54737
|
+
});
|
|
54738
|
+
const suppressTelemetry = data.SuppressTelemetry === true;
|
|
54739
|
+
const envelope = { ...data };
|
|
54740
|
+
delete envelope.SuppressTelemetry;
|
|
54741
|
+
delete envelope.TelemetryErrorClass;
|
|
54742
|
+
delete envelope.TelemetryTerminalOutcome;
|
|
54743
|
+
delete envelope.TelemetryTerminalSignal;
|
|
54744
|
+
if (!suppressTelemetry) {
|
|
54350
54745
|
telemetry.trackEvent(CommonTelemetryEvents.Error, {
|
|
54351
54746
|
result: data.Result,
|
|
54352
54747
|
errorCode: data.ErrorCode,
|
|
@@ -54409,6 +54804,158 @@ var OutputFormatter;
|
|
|
54409
54804
|
OutputFormatter.formatToString = formatToString;
|
|
54410
54805
|
})(OutputFormatter ||= {});
|
|
54411
54806
|
|
|
54807
|
+
// ../common/src/telemetry/command-attribution.ts
|
|
54808
|
+
var LEGACY_SKILL_NAMESPACE = "uipath:";
|
|
54809
|
+
var MAX_SKILL_NAME_LENGTH = 80;
|
|
54810
|
+
var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
|
|
54811
|
+
function productMode(productArea, mode) {
|
|
54812
|
+
return { product_area: productArea, mode };
|
|
54813
|
+
}
|
|
54814
|
+
function attributionRecord(groups) {
|
|
54815
|
+
const record = {};
|
|
54816
|
+
for (const [productArea, mode, names] of groups) {
|
|
54817
|
+
const attribution = productMode(productArea, mode);
|
|
54818
|
+
for (const name of names) {
|
|
54819
|
+
record[name] = attribution;
|
|
54820
|
+
}
|
|
54821
|
+
}
|
|
54822
|
+
return record;
|
|
54823
|
+
}
|
|
54824
|
+
function commandAttribution(groups) {
|
|
54825
|
+
const entries = [];
|
|
54826
|
+
for (const [productArea, mode, prefixes] of groups) {
|
|
54827
|
+
const attribution = productMode(productArea, mode);
|
|
54828
|
+
for (const prefix of prefixes) {
|
|
54829
|
+
entries.push({ prefix, attribution });
|
|
54830
|
+
}
|
|
54831
|
+
}
|
|
54832
|
+
return entries;
|
|
54833
|
+
}
|
|
54834
|
+
var SKILL_ATTRIBUTION = attributionRecord([
|
|
54835
|
+
["admin", "operate", ["uipath-admin"]],
|
|
54836
|
+
["agents", "build", ["uipath-agents"]],
|
|
54837
|
+
["api-workflow", "build", ["uipath-api-workflow"]],
|
|
54838
|
+
["automation-discovery", "build", ["uipath-automation-discovery"]],
|
|
54839
|
+
["coded-apps", "build", ["uipath-coded-apps"]],
|
|
54840
|
+
["data-fabric", "operate", ["uipath-data-fabric"]],
|
|
54841
|
+
["cli", "troubleshoot", ["uipath-feedback"]],
|
|
54842
|
+
["governance", "operate", ["uipath-governance"]],
|
|
54843
|
+
["action-center", "build", ["uipath-human-in-the-loop"]],
|
|
54844
|
+
["document-understanding", "build", ["uipath-ixp"]],
|
|
54845
|
+
[
|
|
54846
|
+
"maestro",
|
|
54847
|
+
"build",
|
|
54848
|
+
["uipath-maestro-bpmn", "uipath-maestro-case", "uipath-maestro-flow"]
|
|
54849
|
+
],
|
|
54850
|
+
["agenthub", "build", ["uipath-mcp-servers"]],
|
|
54851
|
+
["solution", "build", ["uipath-planner", "uipath-solution"]],
|
|
54852
|
+
["platform", "operate", ["uipath-platform"]],
|
|
54853
|
+
["quality", "troubleshoot", ["uipath-review"]],
|
|
54854
|
+
["rpa", "build", ["uipath-rpa"]],
|
|
54855
|
+
["cli", "operate", ["uipath-skill-catalog"]],
|
|
54856
|
+
["action-center", "operate", ["uipath-tasks"]],
|
|
54857
|
+
["test-manager", "operate", ["uipath-test"]],
|
|
54858
|
+
["platform", "troubleshoot", ["uipath-troubleshoot"]]
|
|
54859
|
+
]);
|
|
54860
|
+
var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
|
|
54861
|
+
var COMMAND_ATTRIBUTION = commandAttribution([
|
|
54862
|
+
["cli", "troubleshoot", ["uip.feedback"]],
|
|
54863
|
+
["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
|
|
54864
|
+
["context-grounding", "build", ["uip.context-grounding"]],
|
|
54865
|
+
["api-workflow", "build", ["uip.api-workflow"]],
|
|
54866
|
+
["rpa", "build", ["uip.rpa-legacy"]],
|
|
54867
|
+
["conversational", "operate", ["uip.conversational"]],
|
|
54868
|
+
["agents", "build", ["uip.codedagent", "uip.agent"]],
|
|
54869
|
+
["agenthub", "build", ["uip.agenthub"]],
|
|
54870
|
+
["coded-apps", "build", ["uip.codedapp"]],
|
|
54871
|
+
["functions", "build", ["uip.functions"]],
|
|
54872
|
+
["solution", "build", ["uip.solution"]],
|
|
54873
|
+
["maestro", "build", ["uip.maestro", "uip.case", "uip.flow"]],
|
|
54874
|
+
["llm-observability", "troubleshoot", ["uip.traces"]],
|
|
54875
|
+
["platform", "operate", ["uip.platform"]],
|
|
54876
|
+
["admin", "operate", ["uip.admin"]],
|
|
54877
|
+
["automation-ops", "operate", ["uip.aops"]],
|
|
54878
|
+
["documentation", "troubleshoot", ["uip.docsai"]],
|
|
54879
|
+
["governance", "operate", ["uip.gov"]],
|
|
54880
|
+
["insights", "operate", ["uip.insights"]],
|
|
54881
|
+
["document-understanding", "build", ["uip.ixp"]],
|
|
54882
|
+
["process-mining", "operate", ["uip.pm"]],
|
|
54883
|
+
["action-center", "operate", ["uip.tasks"]],
|
|
54884
|
+
["test-manager", "operate", ["uip.tm"]],
|
|
54885
|
+
["vertical-solutions", "build", ["uip.vss"]],
|
|
54886
|
+
["data-fabric", "operate", ["uip.df"]],
|
|
54887
|
+
["integration-service", "build", ["uip.is"]],
|
|
54888
|
+
["orchestrator", "operate", ["uip.or"]],
|
|
54889
|
+
[
|
|
54890
|
+
"cli",
|
|
54891
|
+
"operate",
|
|
54892
|
+
[
|
|
54893
|
+
"uip.login",
|
|
54894
|
+
"uip.logout",
|
|
54895
|
+
"uip.user",
|
|
54896
|
+
"uip.config",
|
|
54897
|
+
"uip.tools",
|
|
54898
|
+
"uip.skills",
|
|
54899
|
+
"uip.completion",
|
|
54900
|
+
"uip.update",
|
|
54901
|
+
"uip.mcp",
|
|
54902
|
+
"uip.track"
|
|
54903
|
+
]
|
|
54904
|
+
]
|
|
54905
|
+
]).sort((a, b) => b.prefix.length - a.prefix.length);
|
|
54906
|
+
function normalizeCommandPath(value) {
|
|
54907
|
+
if (typeof value !== "string") {
|
|
54908
|
+
return;
|
|
54909
|
+
}
|
|
54910
|
+
const trimmed = value.trim().toLowerCase();
|
|
54911
|
+
if (!trimmed) {
|
|
54912
|
+
return;
|
|
54913
|
+
}
|
|
54914
|
+
const tokens = trimmed.includes(" ") ? trimmed.split(/\s+/).filter((token) => token.length > 0).filter((token) => !token.startsWith("-")) : trimmed.split(".").filter((token) => token.length > 0);
|
|
54915
|
+
if (tokens.length === 0) {
|
|
54916
|
+
return;
|
|
54917
|
+
}
|
|
54918
|
+
const commandTokens = tokens[0] === "uip" ? tokens : ["uip", ...tokens];
|
|
54919
|
+
return commandTokens.join(".");
|
|
54920
|
+
}
|
|
54921
|
+
function getCommandProductModeAttribution(commandPath) {
|
|
54922
|
+
const normalized = normalizeCommandPath(commandPath);
|
|
54923
|
+
if (!normalized) {
|
|
54924
|
+
return;
|
|
54925
|
+
}
|
|
54926
|
+
return COMMAND_ATTRIBUTION.find(({ prefix }) => normalized === prefix || normalized.startsWith(`${prefix}.`))?.attribution;
|
|
54927
|
+
}
|
|
54928
|
+
function normalizeSkillNameWithOptions(value, options) {
|
|
54929
|
+
if (typeof value !== "string") {
|
|
54930
|
+
return;
|
|
54931
|
+
}
|
|
54932
|
+
const normalized = value.trim().toLowerCase();
|
|
54933
|
+
if (!normalized) {
|
|
54934
|
+
return;
|
|
54935
|
+
}
|
|
54936
|
+
const hasLegacyNamespace = normalized.startsWith(LEGACY_SKILL_NAMESPACE);
|
|
54937
|
+
if (hasLegacyNamespace && !options.allowLegacyNamespace) {
|
|
54938
|
+
return;
|
|
54939
|
+
}
|
|
54940
|
+
const skillName = hasLegacyNamespace ? normalized.slice(LEGACY_SKILL_NAMESPACE.length) : normalized;
|
|
54941
|
+
if (skillName.length > MAX_SKILL_NAME_LENGTH || !SKILL_NAME_PATTERN.test(skillName) || !KNOWN_SKILL_NAMES.has(skillName)) {
|
|
54942
|
+
return;
|
|
54943
|
+
}
|
|
54944
|
+
return skillName;
|
|
54945
|
+
}
|
|
54946
|
+
function normalizeSkillName(value) {
|
|
54947
|
+
return normalizeSkillNameWithOptions(value, {
|
|
54948
|
+
allowLegacyNamespace: false
|
|
54949
|
+
});
|
|
54950
|
+
}
|
|
54951
|
+
function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
54952
|
+
const skillName = normalizeSkillName(skillSource);
|
|
54953
|
+
return {
|
|
54954
|
+
...skillName ? { skill_name: skillName } : {},
|
|
54955
|
+
...getCommandProductModeAttribution(commandPath)
|
|
54956
|
+
};
|
|
54957
|
+
}
|
|
54958
|
+
|
|
54412
54959
|
// ../common/src/telemetry/pii-redactor.ts
|
|
54413
54960
|
var REDACTED = "[REDACTED]";
|
|
54414
54961
|
var MAX_VALUE_LENGTH = 200;
|
|
@@ -54594,6 +55141,12 @@ function commandHelpHint(commandPath) {
|
|
|
54594
55141
|
const command = commandPath.replace(/\./g, " ");
|
|
54595
55142
|
return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
|
|
54596
55143
|
}
|
|
55144
|
+
function isPromptCancellation(error) {
|
|
55145
|
+
return error instanceof Error && error.name === "ExitPromptError";
|
|
55146
|
+
}
|
|
55147
|
+
function exitCodeFromProcess(fallback) {
|
|
55148
|
+
return typeof process.exitCode === "number" ? process.exitCode : fallback;
|
|
55149
|
+
}
|
|
54597
55150
|
Command.prototype.trackedAction = function(context, fn, properties) {
|
|
54598
55151
|
const command = this;
|
|
54599
55152
|
return this.action(async (...args) => {
|
|
@@ -54601,6 +55154,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
54601
55154
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
54602
55155
|
const startTime = performance.now();
|
|
54603
55156
|
let errorMessage;
|
|
55157
|
+
let fallbackExitCode = EXIT_CODES.Success;
|
|
55158
|
+
clearRecordedCommandFailureTelemetry();
|
|
54604
55159
|
const [error] = await catchError(fn(...args));
|
|
54605
55160
|
if (error) {
|
|
54606
55161
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -54615,6 +55170,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
54615
55170
|
const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
|
|
54616
55171
|
const typedContext = typed.context ?? typed.Context;
|
|
54617
55172
|
const customContext = isErrorContext(typedContext) ? typedContext : undefined;
|
|
55173
|
+
const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
|
|
55174
|
+
fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
|
|
54618
55175
|
OutputFormatter.error({
|
|
54619
55176
|
Result: finalResult,
|
|
54620
55177
|
...customErrorCode ? { ErrorCode: customErrorCode } : {},
|
|
@@ -54623,16 +55180,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
54623
55180
|
...customRetry ? { Retry: customRetry } : {},
|
|
54624
55181
|
...customContext ? { Context: customContext } : {}
|
|
54625
55182
|
});
|
|
54626
|
-
context.exit(
|
|
55183
|
+
context.exit(fallbackExitCode);
|
|
54627
55184
|
}
|
|
54628
55185
|
const durationMs = performance.now() - startTime;
|
|
54629
|
-
const
|
|
55186
|
+
const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
|
|
55187
|
+
const recordedFailure = takeRecordedCommandFailureTelemetry();
|
|
55188
|
+
const success = !error && exitCode === 0;
|
|
55189
|
+
const terminalTelemetry = buildCommandTerminalTelemetryProperties({
|
|
55190
|
+
error,
|
|
55191
|
+
exitCode,
|
|
55192
|
+
recordedFailure,
|
|
55193
|
+
pollSignal: context.pollSignal
|
|
55194
|
+
});
|
|
54630
55195
|
telemetry.trackEvent(telemetryName, redactProperties({
|
|
54631
55196
|
...extractCommandParams(command),
|
|
54632
55197
|
...props,
|
|
55198
|
+
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
54633
55199
|
command: "true",
|
|
54634
55200
|
duration: String(durationMs),
|
|
54635
55201
|
success: String(success),
|
|
55202
|
+
...terminalTelemetry,
|
|
54636
55203
|
...errorMessage ? { errorMessage } : {}
|
|
54637
55204
|
}));
|
|
54638
55205
|
});
|
|
@@ -54828,6 +55395,8 @@ async function readStdin() {
|
|
|
54828
55395
|
process.stdin.on("error", reject);
|
|
54829
55396
|
});
|
|
54830
55397
|
}
|
|
55398
|
+
// ../common/src/telemetry/ship-succeeded.ts
|
|
55399
|
+
var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
|
|
54831
55400
|
// ../common/src/tool-provider.ts
|
|
54832
55401
|
var factorySlot = singleton("PackagerFactoryProvider");
|
|
54833
55402
|
// src/client.ts
|
|
@@ -121321,7 +121890,7 @@ class TextApiResponse {
|
|
|
121321
121890
|
var package_default = {
|
|
121322
121891
|
name: "@uipath/integrationservice-sdk",
|
|
121323
121892
|
license: "MIT",
|
|
121324
|
-
version: "1.197.0-preview.
|
|
121893
|
+
version: "1.197.0-preview.66",
|
|
121325
121894
|
repository: {
|
|
121326
121895
|
type: "git",
|
|
121327
121896
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -133040,4 +133609,4 @@ export {
|
|
|
133040
133609
|
BPMN_SPEC
|
|
133041
133610
|
};
|
|
133042
133611
|
|
|
133043
|
-
//# debugId=
|
|
133612
|
+
//# debugId=4E831556E079C91464756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/maestro-sdk",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.197.0-preview.
|
|
4
|
+
"version": "1.197.0-preview.66",
|
|
5
5
|
"description": "SDK for the UiPath Maestro (PIMS) API — process instance management.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"files": [
|
|
43
43
|
"dist"
|
|
44
44
|
],
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "386b0837882b19062bf744c74949cdf9c5e48dea"
|
|
46
46
|
}
|