@uipath/aops-tool 1.197.0-preview.65 → 1.197.0-preview.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tool.js +578 -9
- package/package.json +2 -2
package/dist/tool.js
CHANGED
|
@@ -21230,7 +21230,7 @@ var init_server = __esm(() => {
|
|
|
21230
21230
|
var package_default = {
|
|
21231
21231
|
name: "@uipath/aops-tool",
|
|
21232
21232
|
license: "MIT",
|
|
21233
|
-
version: "1.197.0-preview.
|
|
21233
|
+
version: "1.197.0-preview.67",
|
|
21234
21234
|
description: "Manage UiPath StudioAdmin AOps — connections, repos, projects, solutions, pipelines, executions.",
|
|
21235
21235
|
private: false,
|
|
21236
21236
|
repository: {
|
|
@@ -26598,9 +26598,228 @@ function getOutputFilter() {
|
|
|
26598
26598
|
return filterSlot.get();
|
|
26599
26599
|
}
|
|
26600
26600
|
|
|
26601
|
+
// ../common/src/telemetry/command-terminal.ts
|
|
26602
|
+
var recordedFailureSlot = singleton("CommandTelemetryFailure");
|
|
26603
|
+
var AUTH_ERROR_CODES = new Set([
|
|
26604
|
+
"authentication_required",
|
|
26605
|
+
"permission_denied"
|
|
26606
|
+
]);
|
|
26607
|
+
var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
|
|
26608
|
+
var NETWORK_HTTP_ERROR_CODES = new Set([
|
|
26609
|
+
"network_error",
|
|
26610
|
+
"rate_limited",
|
|
26611
|
+
"server_error",
|
|
26612
|
+
"not_found",
|
|
26613
|
+
"method_not_allowed"
|
|
26614
|
+
]);
|
|
26615
|
+
var TIMEOUT_ERROR_CODES = new Set(["timeout"]);
|
|
26616
|
+
var NETWORK_OS_ERROR_CODES = new Set([
|
|
26617
|
+
"ECONNREFUSED",
|
|
26618
|
+
"ECONNRESET",
|
|
26619
|
+
"ENOTFOUND",
|
|
26620
|
+
"EAI_AGAIN",
|
|
26621
|
+
"EPIPE",
|
|
26622
|
+
"EHOSTUNREACH",
|
|
26623
|
+
"ENETUNREACH",
|
|
26624
|
+
"EAI_FAIL"
|
|
26625
|
+
]);
|
|
26626
|
+
var TIMEOUT_OS_ERROR_CODES = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
|
|
26627
|
+
var TLS_ERROR_CODES2 = new Set([
|
|
26628
|
+
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
26629
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
26630
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
26631
|
+
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
26632
|
+
"UNABLE_TO_GET_ISSUER_CERT",
|
|
26633
|
+
"CERT_HAS_EXPIRED",
|
|
26634
|
+
"CERT_UNTRUSTED",
|
|
26635
|
+
"ERR_TLS_CERT_ALTNAME_INVALID"
|
|
26636
|
+
]);
|
|
26637
|
+
var MISSING_DEPENDENCY_CODES = new Set([
|
|
26638
|
+
"MODULE_NOT_FOUND",
|
|
26639
|
+
"ERR_MODULE_NOT_FOUND"
|
|
26640
|
+
]);
|
|
26641
|
+
var INTERNAL_ERROR_NAMES = new Set([
|
|
26642
|
+
"TypeError",
|
|
26643
|
+
"ReferenceError",
|
|
26644
|
+
"SyntaxError",
|
|
26645
|
+
"RangeError"
|
|
26646
|
+
]);
|
|
26647
|
+
function isRecord(value) {
|
|
26648
|
+
return value !== null && typeof value === "object";
|
|
26649
|
+
}
|
|
26650
|
+
function stringField(value, field) {
|
|
26651
|
+
if (!isRecord(value)) {
|
|
26652
|
+
return;
|
|
26653
|
+
}
|
|
26654
|
+
const raw = value[field];
|
|
26655
|
+
return typeof raw === "string" ? raw : undefined;
|
|
26656
|
+
}
|
|
26657
|
+
function numberField(value, field) {
|
|
26658
|
+
if (!isRecord(value)) {
|
|
26659
|
+
return;
|
|
26660
|
+
}
|
|
26661
|
+
const raw = value[field];
|
|
26662
|
+
return typeof raw === "number" ? raw : undefined;
|
|
26663
|
+
}
|
|
26664
|
+
function findStringInCauseChain(error, field) {
|
|
26665
|
+
let current = error;
|
|
26666
|
+
for (let depth = 0;depth < 5 && current !== null && typeof current === "object"; depth++) {
|
|
26667
|
+
const value = stringField(current, field);
|
|
26668
|
+
if (value) {
|
|
26669
|
+
return value;
|
|
26670
|
+
}
|
|
26671
|
+
current = current.cause;
|
|
26672
|
+
}
|
|
26673
|
+
return;
|
|
26674
|
+
}
|
|
26675
|
+
function findCodeInCauseChain(error) {
|
|
26676
|
+
return findStringInCauseChain(error, "code");
|
|
26677
|
+
}
|
|
26678
|
+
function isSpawnEnoent(error) {
|
|
26679
|
+
const code = findCodeInCauseChain(error);
|
|
26680
|
+
if (code !== "ENOENT") {
|
|
26681
|
+
return false;
|
|
26682
|
+
}
|
|
26683
|
+
const syscall = findStringInCauseChain(error, "syscall");
|
|
26684
|
+
return syscall?.startsWith("spawn") === true;
|
|
26685
|
+
}
|
|
26686
|
+
function isCancellationError(error, exitCode, pollSignal) {
|
|
26687
|
+
if (exitCode === 130) {
|
|
26688
|
+
return true;
|
|
26689
|
+
}
|
|
26690
|
+
if (!isRecord(error)) {
|
|
26691
|
+
return false;
|
|
26692
|
+
}
|
|
26693
|
+
if (numberField(error, "exitCode") === 130) {
|
|
26694
|
+
return true;
|
|
26695
|
+
}
|
|
26696
|
+
const name = stringField(error, "name");
|
|
26697
|
+
if (name === "ExitPromptError") {
|
|
26698
|
+
return true;
|
|
26699
|
+
}
|
|
26700
|
+
if (name === "AbortError" && pollSignal?.aborted) {
|
|
26701
|
+
return true;
|
|
26702
|
+
}
|
|
26703
|
+
const message = stringField(error, "message");
|
|
26704
|
+
return message?.includes("SIGINT") === true;
|
|
26705
|
+
}
|
|
26706
|
+
function terminalSignalFor(input, outcome) {
|
|
26707
|
+
if (input.recordedFailure?.terminalSignal) {
|
|
26708
|
+
return input.recordedFailure.terminalSignal;
|
|
26709
|
+
}
|
|
26710
|
+
const explicit = findStringInCauseChain(input.error, "terminalSignal") ?? findStringInCauseChain(input.error, "signal");
|
|
26711
|
+
if (explicit) {
|
|
26712
|
+
return explicit;
|
|
26713
|
+
}
|
|
26714
|
+
return outcome === "cancelled" ? "SIGINT" : undefined;
|
|
26715
|
+
}
|
|
26716
|
+
function classifyHttpStatus(status) {
|
|
26717
|
+
if (status === 401 || status === 403) {
|
|
26718
|
+
return "auth";
|
|
26719
|
+
}
|
|
26720
|
+
if (status === 400 || status === 409 || status === 422) {
|
|
26721
|
+
return "validation";
|
|
26722
|
+
}
|
|
26723
|
+
if (status === 408) {
|
|
26724
|
+
return "timeout";
|
|
26725
|
+
}
|
|
26726
|
+
return "network_http";
|
|
26727
|
+
}
|
|
26728
|
+
function classifyFromResult(result) {
|
|
26729
|
+
switch (result) {
|
|
26730
|
+
case "AuthenticationError":
|
|
26731
|
+
return "auth";
|
|
26732
|
+
case "ValidationError":
|
|
26733
|
+
return "validation";
|
|
26734
|
+
case "TimeoutError":
|
|
26735
|
+
return "timeout";
|
|
26736
|
+
default:
|
|
26737
|
+
return;
|
|
26738
|
+
}
|
|
26739
|
+
}
|
|
26740
|
+
function classifyFromErrorCode(errorCode) {
|
|
26741
|
+
if (!errorCode) {
|
|
26742
|
+
return;
|
|
26743
|
+
}
|
|
26744
|
+
if (AUTH_ERROR_CODES.has(errorCode)) {
|
|
26745
|
+
return "auth";
|
|
26746
|
+
}
|
|
26747
|
+
if (VALIDATION_ERROR_CODES.has(errorCode)) {
|
|
26748
|
+
return "validation";
|
|
26749
|
+
}
|
|
26750
|
+
if (TIMEOUT_ERROR_CODES.has(errorCode)) {
|
|
26751
|
+
return "timeout";
|
|
26752
|
+
}
|
|
26753
|
+
if (NETWORK_HTTP_ERROR_CODES.has(errorCode)) {
|
|
26754
|
+
return "network_http";
|
|
26755
|
+
}
|
|
26756
|
+
return;
|
|
26757
|
+
}
|
|
26758
|
+
function classifyFromError(error) {
|
|
26759
|
+
const code = findCodeInCauseChain(error);
|
|
26760
|
+
if (code) {
|
|
26761
|
+
if (code.startsWith("commander.")) {
|
|
26762
|
+
return "validation";
|
|
26763
|
+
}
|
|
26764
|
+
if (NETWORK_OS_ERROR_CODES.has(code) || TLS_ERROR_CODES2.has(code)) {
|
|
26765
|
+
return "network_http";
|
|
26766
|
+
}
|
|
26767
|
+
if (TIMEOUT_OS_ERROR_CODES.has(code)) {
|
|
26768
|
+
return "timeout";
|
|
26769
|
+
}
|
|
26770
|
+
if (MISSING_DEPENDENCY_CODES.has(code) || isSpawnEnoent(error)) {
|
|
26771
|
+
return "missing_dependency";
|
|
26772
|
+
}
|
|
26773
|
+
}
|
|
26774
|
+
const message = stringField(error, "message");
|
|
26775
|
+
if (message?.includes("fetch failed") === true) {
|
|
26776
|
+
return "network_http";
|
|
26777
|
+
}
|
|
26778
|
+
const name = stringField(error, "name");
|
|
26779
|
+
if (name && INTERNAL_ERROR_NAMES.has(name)) {
|
|
26780
|
+
return "internal";
|
|
26781
|
+
}
|
|
26782
|
+
return;
|
|
26783
|
+
}
|
|
26784
|
+
function classifyError2(input) {
|
|
26785
|
+
const recorded = input.recordedFailure;
|
|
26786
|
+
if (recorded?.errorClass) {
|
|
26787
|
+
return recorded.errorClass;
|
|
26788
|
+
}
|
|
26789
|
+
const status = recorded?.context?.httpStatus;
|
|
26790
|
+
if (status !== undefined) {
|
|
26791
|
+
return classifyHttpStatus(status);
|
|
26792
|
+
}
|
|
26793
|
+
return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
|
|
26794
|
+
}
|
|
26795
|
+
function recordCommandFailureTelemetry(failure) {
|
|
26796
|
+
recordedFailureSlot.set(failure);
|
|
26797
|
+
}
|
|
26798
|
+
function clearRecordedCommandFailureTelemetry() {
|
|
26799
|
+
recordedFailureSlot.clear();
|
|
26800
|
+
}
|
|
26801
|
+
function takeRecordedCommandFailureTelemetry() {
|
|
26802
|
+
const failure = recordedFailureSlot.get();
|
|
26803
|
+
recordedFailureSlot.clear();
|
|
26804
|
+
return failure;
|
|
26805
|
+
}
|
|
26806
|
+
function buildCommandTerminalTelemetryProperties(input) {
|
|
26807
|
+
const cancelled = isCancellationError(input.error, input.exitCode, input.pollSignal);
|
|
26808
|
+
const outcome = input.recordedFailure?.terminalOutcome ?? (input.exitCode === 0 ? "success" : cancelled ? "cancelled" : "failure");
|
|
26809
|
+
const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError2(input);
|
|
26810
|
+
const terminalSignal = terminalSignalFor(input, outcome);
|
|
26811
|
+
return {
|
|
26812
|
+
exit_code: input.exitCode,
|
|
26813
|
+
terminal_outcome: outcome,
|
|
26814
|
+
...errorClass ? { error_class: errorClass } : {},
|
|
26815
|
+
...terminalSignal ? { terminal_signal: terminalSignal } : {}
|
|
26816
|
+
};
|
|
26817
|
+
}
|
|
26818
|
+
|
|
26601
26819
|
// ../common/src/telemetry/telemetry-events.ts
|
|
26602
26820
|
var CommonTelemetryEvents = {
|
|
26603
|
-
Error: "uip.error"
|
|
26821
|
+
Error: "uip.error",
|
|
26822
|
+
ShipSucceeded: "ship_succeeded"
|
|
26604
26823
|
};
|
|
26605
26824
|
|
|
26606
26825
|
// ../common/src/registry.ts
|
|
@@ -26667,6 +26886,136 @@ function formatMessage(category, name, properties) {
|
|
|
26667
26886
|
}
|
|
26668
26887
|
return message;
|
|
26669
26888
|
}
|
|
26889
|
+
// ../common/src/telemetry/detect-agent.ts
|
|
26890
|
+
var KNOWN_AGENTS = [
|
|
26891
|
+
{ envVar: "CLAUDECODE", value: "1", id: "claude-code" },
|
|
26892
|
+
{ envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
|
|
26893
|
+
{ envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
|
|
26894
|
+
{ envVar: "CODEX_THREAD_ID", id: "codex" },
|
|
26895
|
+
{ envVar: "CODEX_SANDBOX", id: "codex" },
|
|
26896
|
+
{ envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
|
|
26897
|
+
{ envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
|
|
26898
|
+
];
|
|
26899
|
+
function detectAgentFromEnv(env) {
|
|
26900
|
+
for (const agent of KNOWN_AGENTS) {
|
|
26901
|
+
const envValue = env[agent.envVar];
|
|
26902
|
+
if (agent.value !== undefined) {
|
|
26903
|
+
if (envValue === agent.value)
|
|
26904
|
+
return agent.id;
|
|
26905
|
+
} else {
|
|
26906
|
+
if (envValue)
|
|
26907
|
+
return agent.id;
|
|
26908
|
+
}
|
|
26909
|
+
}
|
|
26910
|
+
const agentEnv = env.AGENT;
|
|
26911
|
+
if (agentEnv) {
|
|
26912
|
+
if (agentEnv === "1" || agentEnv === "true")
|
|
26913
|
+
return "unknown";
|
|
26914
|
+
if (agentEnv.length <= 32)
|
|
26915
|
+
return agentEnv.toLowerCase();
|
|
26916
|
+
}
|
|
26917
|
+
return;
|
|
26918
|
+
}
|
|
26919
|
+
// ../common/src/telemetry/environment-info.ts
|
|
26920
|
+
var LOCAL_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
|
|
26921
|
+
// ../common/src/telemetry/execution-context.ts
|
|
26922
|
+
var authSignalSlot = singleton("TelemetryExecutionContextAuthSignal");
|
|
26923
|
+
var isTruthy = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false";
|
|
26924
|
+
var isEqual = (value, expected) => value?.toLowerCase() === expected;
|
|
26925
|
+
var CI_SIGNATURES = [
|
|
26926
|
+
{
|
|
26927
|
+
provider: "github_actions",
|
|
26928
|
+
matches: (env) => isTruthy(env.GITHUB_ACTIONS),
|
|
26929
|
+
isScheduler: (env) => env.GITHUB_EVENT_NAME === "schedule"
|
|
26930
|
+
},
|
|
26931
|
+
{
|
|
26932
|
+
provider: "azure_devops",
|
|
26933
|
+
matches: (env) => isTruthy(env.TF_BUILD),
|
|
26934
|
+
isScheduler: (env) => isEqual(env.BUILD_REASON, "schedule")
|
|
26935
|
+
},
|
|
26936
|
+
{
|
|
26937
|
+
provider: "gitlab",
|
|
26938
|
+
matches: (env) => isTruthy(env.GITLAB_CI),
|
|
26939
|
+
isScheduler: (env) => env.CI_PIPELINE_SOURCE === "schedule"
|
|
26940
|
+
},
|
|
26941
|
+
{
|
|
26942
|
+
provider: "circleci",
|
|
26943
|
+
matches: (env) => isTruthy(env.CIRCLECI),
|
|
26944
|
+
isScheduler: (env) => env.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
|
|
26945
|
+
},
|
|
26946
|
+
{
|
|
26947
|
+
provider: "jenkins",
|
|
26948
|
+
matches: (env) => isTruthy(env.JENKINS_URL) || isTruthy(env.JENKINS_HOME)
|
|
26949
|
+
},
|
|
26950
|
+
{
|
|
26951
|
+
provider: "teamcity",
|
|
26952
|
+
matches: (env) => isTruthy(env.TEAMCITY_VERSION)
|
|
26953
|
+
},
|
|
26954
|
+
{
|
|
26955
|
+
provider: "buildkite",
|
|
26956
|
+
matches: (env) => isTruthy(env.BUILDKITE),
|
|
26957
|
+
isScheduler: (env) => env.BUILDKITE_SOURCE === "schedule"
|
|
26958
|
+
},
|
|
26959
|
+
{
|
|
26960
|
+
provider: "bitbucket",
|
|
26961
|
+
matches: (env) => isTruthy(env.BITBUCKET_BUILD_NUMBER)
|
|
26962
|
+
},
|
|
26963
|
+
{
|
|
26964
|
+
provider: "travis",
|
|
26965
|
+
matches: (env) => isTruthy(env.TRAVIS)
|
|
26966
|
+
},
|
|
26967
|
+
{
|
|
26968
|
+
provider: "appveyor",
|
|
26969
|
+
matches: (env) => isTruthy(env.APPVEYOR)
|
|
26970
|
+
},
|
|
26971
|
+
{
|
|
26972
|
+
provider: "generic",
|
|
26973
|
+
matches: (env) => isTruthy(env.CI)
|
|
26974
|
+
}
|
|
26975
|
+
];
|
|
26976
|
+
function currentEnv() {
|
|
26977
|
+
return typeof process === "undefined" ? {} : process.env;
|
|
26978
|
+
}
|
|
26979
|
+
function currentTtyState() {
|
|
26980
|
+
if (typeof process === "undefined")
|
|
26981
|
+
return false;
|
|
26982
|
+
return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
|
|
26983
|
+
}
|
|
26984
|
+
function detectCi(env) {
|
|
26985
|
+
const signature = CI_SIGNATURES.find((candidate) => candidate.matches(env));
|
|
26986
|
+
if (!signature)
|
|
26987
|
+
return;
|
|
26988
|
+
return {
|
|
26989
|
+
executionContext: signature.isScheduler?.(env) ? "scheduler" : "ci",
|
|
26990
|
+
ciProvider: signature.provider
|
|
26991
|
+
};
|
|
26992
|
+
}
|
|
26993
|
+
function detectExecutionContext(options = {}) {
|
|
26994
|
+
const env = options.env ?? currentEnv();
|
|
26995
|
+
const ci = detectCi(env);
|
|
26996
|
+
if (ci)
|
|
26997
|
+
return ci;
|
|
26998
|
+
const agent = options.agent ?? detectAgentFromEnv(env);
|
|
26999
|
+
if (agent) {
|
|
27000
|
+
return { executionContext: "agent" };
|
|
27001
|
+
}
|
|
27002
|
+
const authSignal = options.authSignal ?? authSignalSlot.get();
|
|
27003
|
+
if (authSignal === "service_account") {
|
|
27004
|
+
return { executionContext: "service_account" };
|
|
27005
|
+
}
|
|
27006
|
+
const isTty = options.isTty ?? currentTtyState();
|
|
27007
|
+
if (isTty) {
|
|
27008
|
+
return { executionContext: "manual" };
|
|
27009
|
+
}
|
|
27010
|
+
return { executionContext: "unknown" };
|
|
27011
|
+
}
|
|
27012
|
+
function getExecutionContextTelemetryProperties() {
|
|
27013
|
+
const detected = detectExecutionContext();
|
|
27014
|
+
return {
|
|
27015
|
+
execution_context: detected.executionContext,
|
|
27016
|
+
...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
|
|
27017
|
+
};
|
|
27018
|
+
}
|
|
26670
27019
|
// ../common/src/telemetry/node-context-storage.ts
|
|
26671
27020
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
26672
27021
|
|
|
@@ -26679,6 +27028,26 @@ class NodeContextStorage {
|
|
|
26679
27028
|
return this.storage.getStore();
|
|
26680
27029
|
}
|
|
26681
27030
|
}
|
|
27031
|
+
// ../common/src/telemetry/session-id.ts
|
|
27032
|
+
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
27033
|
+
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
27034
|
+
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
27035
|
+
function getProcessEnv() {
|
|
27036
|
+
return globalThis.process?.env;
|
|
27037
|
+
}
|
|
27038
|
+
function normalizeSessionId(value) {
|
|
27039
|
+
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
|
|
27040
|
+
return;
|
|
27041
|
+
}
|
|
27042
|
+
const trimmed = String(value).trim();
|
|
27043
|
+
return trimmed || undefined;
|
|
27044
|
+
}
|
|
27045
|
+
function getConfiguredTelemetrySessionId() {
|
|
27046
|
+
return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
27047
|
+
}
|
|
27048
|
+
function resolveTelemetrySessionId(existingSessionId) {
|
|
27049
|
+
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
27050
|
+
}
|
|
26682
27051
|
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
26683
27052
|
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
26684
27053
|
function getGlobalTelemetryProperties() {
|
|
@@ -26763,12 +27132,22 @@ class TelemetryService {
|
|
|
26763
27132
|
return this.contextStorage.getContext();
|
|
26764
27133
|
}
|
|
26765
27134
|
enrichPropertiesWithContext(properties, context) {
|
|
26766
|
-
|
|
26767
|
-
|
|
27135
|
+
const globalProperties = getGlobalTelemetryProperties();
|
|
27136
|
+
const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
|
|
27137
|
+
const sessionId = resolveTelemetrySessionId(existingSessionId);
|
|
27138
|
+
const enriched = {
|
|
27139
|
+
...getExecutionContextTelemetryProperties(),
|
|
27140
|
+
...globalProperties,
|
|
26768
27141
|
...this.defaultProperties,
|
|
26769
27142
|
...properties,
|
|
26770
27143
|
...context
|
|
26771
27144
|
};
|
|
27145
|
+
if (sessionId === undefined) {
|
|
27146
|
+
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
27147
|
+
} else {
|
|
27148
|
+
enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
|
|
27149
|
+
}
|
|
27150
|
+
return enriched;
|
|
26772
27151
|
}
|
|
26773
27152
|
generateId() {
|
|
26774
27153
|
return crypto.randomUUID().replaceAll("-", "");
|
|
@@ -27238,8 +27617,24 @@ var OutputFormatter;
|
|
|
27238
27617
|
data.ErrorCode ??= defaultErrorCodeForFailure(data);
|
|
27239
27618
|
data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
|
|
27240
27619
|
process.exitCode = EXIT_CODES[data.Result] ?? 1;
|
|
27241
|
-
|
|
27242
|
-
|
|
27620
|
+
recordCommandFailureTelemetry({
|
|
27621
|
+
result: data.Result,
|
|
27622
|
+
errorCode: data.ErrorCode,
|
|
27623
|
+
retry: data.Retry,
|
|
27624
|
+
message: data.Message,
|
|
27625
|
+
context: data.Context,
|
|
27626
|
+
exitCode: process.exitCode,
|
|
27627
|
+
errorClass: data.TelemetryErrorClass,
|
|
27628
|
+
terminalOutcome: data.TelemetryTerminalOutcome,
|
|
27629
|
+
terminalSignal: data.TelemetryTerminalSignal
|
|
27630
|
+
});
|
|
27631
|
+
const suppressTelemetry = data.SuppressTelemetry === true;
|
|
27632
|
+
const envelope = { ...data };
|
|
27633
|
+
delete envelope.SuppressTelemetry;
|
|
27634
|
+
delete envelope.TelemetryErrorClass;
|
|
27635
|
+
delete envelope.TelemetryTerminalOutcome;
|
|
27636
|
+
delete envelope.TelemetryTerminalSignal;
|
|
27637
|
+
if (!suppressTelemetry) {
|
|
27243
27638
|
telemetry.trackEvent(CommonTelemetryEvents.Error, {
|
|
27244
27639
|
result: data.Result,
|
|
27245
27640
|
errorCode: data.ErrorCode,
|
|
@@ -27302,6 +27697,158 @@ var OutputFormatter;
|
|
|
27302
27697
|
OutputFormatter.formatToString = formatToString;
|
|
27303
27698
|
})(OutputFormatter ||= {});
|
|
27304
27699
|
|
|
27700
|
+
// ../common/src/telemetry/command-attribution.ts
|
|
27701
|
+
var LEGACY_SKILL_NAMESPACE = "uipath:";
|
|
27702
|
+
var MAX_SKILL_NAME_LENGTH = 80;
|
|
27703
|
+
var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
|
|
27704
|
+
function productMode(productArea, mode) {
|
|
27705
|
+
return { product_area: productArea, mode };
|
|
27706
|
+
}
|
|
27707
|
+
function attributionRecord(groups) {
|
|
27708
|
+
const record = {};
|
|
27709
|
+
for (const [productArea, mode, names] of groups) {
|
|
27710
|
+
const attribution = productMode(productArea, mode);
|
|
27711
|
+
for (const name of names) {
|
|
27712
|
+
record[name] = attribution;
|
|
27713
|
+
}
|
|
27714
|
+
}
|
|
27715
|
+
return record;
|
|
27716
|
+
}
|
|
27717
|
+
function commandAttribution(groups) {
|
|
27718
|
+
const entries = [];
|
|
27719
|
+
for (const [productArea, mode, prefixes] of groups) {
|
|
27720
|
+
const attribution = productMode(productArea, mode);
|
|
27721
|
+
for (const prefix of prefixes) {
|
|
27722
|
+
entries.push({ prefix, attribution });
|
|
27723
|
+
}
|
|
27724
|
+
}
|
|
27725
|
+
return entries;
|
|
27726
|
+
}
|
|
27727
|
+
var SKILL_ATTRIBUTION = attributionRecord([
|
|
27728
|
+
["admin", "operate", ["uipath-admin"]],
|
|
27729
|
+
["agents", "build", ["uipath-agents"]],
|
|
27730
|
+
["api-workflow", "build", ["uipath-api-workflow"]],
|
|
27731
|
+
["automation-discovery", "build", ["uipath-automation-discovery"]],
|
|
27732
|
+
["coded-apps", "build", ["uipath-coded-apps"]],
|
|
27733
|
+
["data-fabric", "operate", ["uipath-data-fabric"]],
|
|
27734
|
+
["cli", "troubleshoot", ["uipath-feedback"]],
|
|
27735
|
+
["governance", "operate", ["uipath-governance"]],
|
|
27736
|
+
["action-center", "build", ["uipath-human-in-the-loop"]],
|
|
27737
|
+
["document-understanding", "build", ["uipath-ixp"]],
|
|
27738
|
+
[
|
|
27739
|
+
"maestro",
|
|
27740
|
+
"build",
|
|
27741
|
+
["uipath-maestro-bpmn", "uipath-maestro-case", "uipath-maestro-flow"]
|
|
27742
|
+
],
|
|
27743
|
+
["agenthub", "build", ["uipath-mcp-servers"]],
|
|
27744
|
+
["solution", "build", ["uipath-planner", "uipath-solution"]],
|
|
27745
|
+
["platform", "operate", ["uipath-platform"]],
|
|
27746
|
+
["quality", "troubleshoot", ["uipath-review"]],
|
|
27747
|
+
["rpa", "build", ["uipath-rpa"]],
|
|
27748
|
+
["cli", "operate", ["uipath-skill-catalog"]],
|
|
27749
|
+
["action-center", "operate", ["uipath-tasks"]],
|
|
27750
|
+
["test-manager", "operate", ["uipath-test"]],
|
|
27751
|
+
["platform", "troubleshoot", ["uipath-troubleshoot"]]
|
|
27752
|
+
]);
|
|
27753
|
+
var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
|
|
27754
|
+
var COMMAND_ATTRIBUTION = commandAttribution([
|
|
27755
|
+
["cli", "troubleshoot", ["uip.feedback"]],
|
|
27756
|
+
["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
|
|
27757
|
+
["context-grounding", "build", ["uip.context-grounding"]],
|
|
27758
|
+
["api-workflow", "build", ["uip.api-workflow"]],
|
|
27759
|
+
["rpa", "build", ["uip.rpa-legacy"]],
|
|
27760
|
+
["conversational", "operate", ["uip.conversational"]],
|
|
27761
|
+
["agents", "build", ["uip.codedagent", "uip.agent"]],
|
|
27762
|
+
["agenthub", "build", ["uip.agenthub"]],
|
|
27763
|
+
["coded-apps", "build", ["uip.codedapp"]],
|
|
27764
|
+
["functions", "build", ["uip.functions"]],
|
|
27765
|
+
["solution", "build", ["uip.solution"]],
|
|
27766
|
+
["maestro", "build", ["uip.maestro", "uip.case", "uip.flow"]],
|
|
27767
|
+
["llm-observability", "troubleshoot", ["uip.traces"]],
|
|
27768
|
+
["platform", "operate", ["uip.platform"]],
|
|
27769
|
+
["admin", "operate", ["uip.admin"]],
|
|
27770
|
+
["automation-ops", "operate", ["uip.aops"]],
|
|
27771
|
+
["documentation", "troubleshoot", ["uip.docsai"]],
|
|
27772
|
+
["governance", "operate", ["uip.gov"]],
|
|
27773
|
+
["insights", "operate", ["uip.insights"]],
|
|
27774
|
+
["document-understanding", "build", ["uip.ixp"]],
|
|
27775
|
+
["process-mining", "operate", ["uip.pm"]],
|
|
27776
|
+
["action-center", "operate", ["uip.tasks"]],
|
|
27777
|
+
["test-manager", "operate", ["uip.tm"]],
|
|
27778
|
+
["vertical-solutions", "build", ["uip.vss"]],
|
|
27779
|
+
["data-fabric", "operate", ["uip.df"]],
|
|
27780
|
+
["integration-service", "build", ["uip.is"]],
|
|
27781
|
+
["orchestrator", "operate", ["uip.or"]],
|
|
27782
|
+
[
|
|
27783
|
+
"cli",
|
|
27784
|
+
"operate",
|
|
27785
|
+
[
|
|
27786
|
+
"uip.login",
|
|
27787
|
+
"uip.logout",
|
|
27788
|
+
"uip.user",
|
|
27789
|
+
"uip.config",
|
|
27790
|
+
"uip.tools",
|
|
27791
|
+
"uip.skills",
|
|
27792
|
+
"uip.completion",
|
|
27793
|
+
"uip.update",
|
|
27794
|
+
"uip.mcp",
|
|
27795
|
+
"uip.track"
|
|
27796
|
+
]
|
|
27797
|
+
]
|
|
27798
|
+
]).sort((a, b) => b.prefix.length - a.prefix.length);
|
|
27799
|
+
function normalizeCommandPath(value) {
|
|
27800
|
+
if (typeof value !== "string") {
|
|
27801
|
+
return;
|
|
27802
|
+
}
|
|
27803
|
+
const trimmed = value.trim().toLowerCase();
|
|
27804
|
+
if (!trimmed) {
|
|
27805
|
+
return;
|
|
27806
|
+
}
|
|
27807
|
+
const tokens = trimmed.includes(" ") ? trimmed.split(/\s+/).filter((token) => token.length > 0).filter((token) => !token.startsWith("-")) : trimmed.split(".").filter((token) => token.length > 0);
|
|
27808
|
+
if (tokens.length === 0) {
|
|
27809
|
+
return;
|
|
27810
|
+
}
|
|
27811
|
+
const commandTokens = tokens[0] === "uip" ? tokens : ["uip", ...tokens];
|
|
27812
|
+
return commandTokens.join(".");
|
|
27813
|
+
}
|
|
27814
|
+
function getCommandProductModeAttribution(commandPath) {
|
|
27815
|
+
const normalized = normalizeCommandPath(commandPath);
|
|
27816
|
+
if (!normalized) {
|
|
27817
|
+
return;
|
|
27818
|
+
}
|
|
27819
|
+
return COMMAND_ATTRIBUTION.find(({ prefix }) => normalized === prefix || normalized.startsWith(`${prefix}.`))?.attribution;
|
|
27820
|
+
}
|
|
27821
|
+
function normalizeSkillNameWithOptions(value, options) {
|
|
27822
|
+
if (typeof value !== "string") {
|
|
27823
|
+
return;
|
|
27824
|
+
}
|
|
27825
|
+
const normalized = value.trim().toLowerCase();
|
|
27826
|
+
if (!normalized) {
|
|
27827
|
+
return;
|
|
27828
|
+
}
|
|
27829
|
+
const hasLegacyNamespace = normalized.startsWith(LEGACY_SKILL_NAMESPACE);
|
|
27830
|
+
if (hasLegacyNamespace && !options.allowLegacyNamespace) {
|
|
27831
|
+
return;
|
|
27832
|
+
}
|
|
27833
|
+
const skillName = hasLegacyNamespace ? normalized.slice(LEGACY_SKILL_NAMESPACE.length) : normalized;
|
|
27834
|
+
if (skillName.length > MAX_SKILL_NAME_LENGTH || !SKILL_NAME_PATTERN.test(skillName) || !KNOWN_SKILL_NAMES.has(skillName)) {
|
|
27835
|
+
return;
|
|
27836
|
+
}
|
|
27837
|
+
return skillName;
|
|
27838
|
+
}
|
|
27839
|
+
function normalizeSkillName(value) {
|
|
27840
|
+
return normalizeSkillNameWithOptions(value, {
|
|
27841
|
+
allowLegacyNamespace: false
|
|
27842
|
+
});
|
|
27843
|
+
}
|
|
27844
|
+
function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
27845
|
+
const skillName = normalizeSkillName(skillSource);
|
|
27846
|
+
return {
|
|
27847
|
+
...skillName ? { skill_name: skillName } : {},
|
|
27848
|
+
...getCommandProductModeAttribution(commandPath)
|
|
27849
|
+
};
|
|
27850
|
+
}
|
|
27851
|
+
|
|
27305
27852
|
// ../common/src/telemetry/pii-redactor.ts
|
|
27306
27853
|
var REDACTED = "[REDACTED]";
|
|
27307
27854
|
var MAX_VALUE_LENGTH = 200;
|
|
@@ -27487,6 +28034,12 @@ function commandHelpHint(commandPath) {
|
|
|
27487
28034
|
const command = commandPath.replace(/\./g, " ");
|
|
27488
28035
|
return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
|
|
27489
28036
|
}
|
|
28037
|
+
function isPromptCancellation(error) {
|
|
28038
|
+
return error instanceof Error && error.name === "ExitPromptError";
|
|
28039
|
+
}
|
|
28040
|
+
function exitCodeFromProcess(fallback) {
|
|
28041
|
+
return typeof process.exitCode === "number" ? process.exitCode : fallback;
|
|
28042
|
+
}
|
|
27490
28043
|
Command.prototype.trackedAction = function(context, fn, properties) {
|
|
27491
28044
|
const command = this;
|
|
27492
28045
|
return this.action(async (...args) => {
|
|
@@ -27494,6 +28047,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
27494
28047
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
27495
28048
|
const startTime = performance.now();
|
|
27496
28049
|
let errorMessage;
|
|
28050
|
+
let fallbackExitCode = EXIT_CODES.Success;
|
|
28051
|
+
clearRecordedCommandFailureTelemetry();
|
|
27497
28052
|
const [error] = await catchError(fn(...args));
|
|
27498
28053
|
if (error) {
|
|
27499
28054
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -27508,6 +28063,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
27508
28063
|
const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
|
|
27509
28064
|
const typedContext = typed.context ?? typed.Context;
|
|
27510
28065
|
const customContext = isErrorContext(typedContext) ? typedContext : undefined;
|
|
28066
|
+
const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
|
|
28067
|
+
fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
|
|
27511
28068
|
OutputFormatter.error({
|
|
27512
28069
|
Result: finalResult,
|
|
27513
28070
|
...customErrorCode ? { ErrorCode: customErrorCode } : {},
|
|
@@ -27516,16 +28073,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
27516
28073
|
...customRetry ? { Retry: customRetry } : {},
|
|
27517
28074
|
...customContext ? { Context: customContext } : {}
|
|
27518
28075
|
});
|
|
27519
|
-
context.exit(
|
|
28076
|
+
context.exit(fallbackExitCode);
|
|
27520
28077
|
}
|
|
27521
28078
|
const durationMs = performance.now() - startTime;
|
|
27522
|
-
const
|
|
28079
|
+
const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
|
|
28080
|
+
const recordedFailure = takeRecordedCommandFailureTelemetry();
|
|
28081
|
+
const success = !error && exitCode === 0;
|
|
28082
|
+
const terminalTelemetry = buildCommandTerminalTelemetryProperties({
|
|
28083
|
+
error,
|
|
28084
|
+
exitCode,
|
|
28085
|
+
recordedFailure,
|
|
28086
|
+
pollSignal: context.pollSignal
|
|
28087
|
+
});
|
|
27523
28088
|
telemetry.trackEvent(telemetryName, redactProperties({
|
|
27524
28089
|
...extractCommandParams(command),
|
|
27525
28090
|
...props,
|
|
28091
|
+
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
27526
28092
|
command: "true",
|
|
27527
28093
|
duration: String(durationMs),
|
|
27528
28094
|
success: String(success),
|
|
28095
|
+
...terminalTelemetry,
|
|
27529
28096
|
...errorMessage ? { errorMessage } : {}
|
|
27530
28097
|
}));
|
|
27531
28098
|
});
|
|
@@ -28130,6 +28697,8 @@ function installRequestHeaderForwarding(BaseApiClass, patchKey, forward) {
|
|
|
28130
28697
|
function installSdkUserAgentHeader(BaseApiClass, userAgent) {
|
|
28131
28698
|
installRequestHeaderForwarding(BaseApiClass, userAgentPatchKey(userAgent), (headers) => addSdkUserAgentHeader(headers, userAgent));
|
|
28132
28699
|
}
|
|
28700
|
+
// ../common/src/telemetry/ship-succeeded.ts
|
|
28701
|
+
var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
|
|
28133
28702
|
// ../common/src/tool-provider.ts
|
|
28134
28703
|
var factorySlot = singleton("PackagerFactoryProvider");
|
|
28135
28704
|
// ../sc-sdk/generated/src/runtime.ts
|
|
@@ -34852,4 +35421,4 @@ export {
|
|
|
34852
35421
|
metadata
|
|
34853
35422
|
};
|
|
34854
35423
|
|
|
34855
|
-
//# debugId=
|
|
35424
|
+
//# debugId=ACF49D1473DC94BC64756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/aops-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.197.0-preview.
|
|
4
|
+
"version": "1.197.0-preview.67",
|
|
5
5
|
"description": "Manage UiPath StudioAdmin AOps — connections, repos, projects, solutions, pipelines, executions.",
|
|
6
6
|
"private": false,
|
|
7
7
|
"repository": {
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"files": [
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "579e7d41cb100fcb8130eec8ed1c9b5b55feaf0b"
|
|
30
30
|
}
|