@uipath/tasks-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 +580 -11
- package/package.json +2 -2
package/dist/tool.js
CHANGED
|
@@ -27244,7 +27244,7 @@ var require_src6 = __commonJS((exports) => {
|
|
|
27244
27244
|
var package_default = {
|
|
27245
27245
|
name: "@uipath/tasks-tool",
|
|
27246
27246
|
license: "MIT",
|
|
27247
|
-
version: "1.197.0-preview.
|
|
27247
|
+
version: "1.197.0-preview.67",
|
|
27248
27248
|
description: "Manage Action Center tasks.",
|
|
27249
27249
|
type: "module",
|
|
27250
27250
|
main: "./dist/tool.js",
|
|
@@ -32609,9 +32609,228 @@ function getOutputFilter() {
|
|
|
32609
32609
|
return filterSlot.get();
|
|
32610
32610
|
}
|
|
32611
32611
|
|
|
32612
|
+
// ../common/src/telemetry/command-terminal.ts
|
|
32613
|
+
var recordedFailureSlot = singleton("CommandTelemetryFailure");
|
|
32614
|
+
var AUTH_ERROR_CODES = new Set([
|
|
32615
|
+
"authentication_required",
|
|
32616
|
+
"permission_denied"
|
|
32617
|
+
]);
|
|
32618
|
+
var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
|
|
32619
|
+
var NETWORK_HTTP_ERROR_CODES = new Set([
|
|
32620
|
+
"network_error",
|
|
32621
|
+
"rate_limited",
|
|
32622
|
+
"server_error",
|
|
32623
|
+
"not_found",
|
|
32624
|
+
"method_not_allowed"
|
|
32625
|
+
]);
|
|
32626
|
+
var TIMEOUT_ERROR_CODES = new Set(["timeout"]);
|
|
32627
|
+
var NETWORK_OS_ERROR_CODES = new Set([
|
|
32628
|
+
"ECONNREFUSED",
|
|
32629
|
+
"ECONNRESET",
|
|
32630
|
+
"ENOTFOUND",
|
|
32631
|
+
"EAI_AGAIN",
|
|
32632
|
+
"EPIPE",
|
|
32633
|
+
"EHOSTUNREACH",
|
|
32634
|
+
"ENETUNREACH",
|
|
32635
|
+
"EAI_FAIL"
|
|
32636
|
+
]);
|
|
32637
|
+
var TIMEOUT_OS_ERROR_CODES = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
|
|
32638
|
+
var TLS_ERROR_CODES2 = new Set([
|
|
32639
|
+
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
32640
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
32641
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
32642
|
+
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
32643
|
+
"UNABLE_TO_GET_ISSUER_CERT",
|
|
32644
|
+
"CERT_HAS_EXPIRED",
|
|
32645
|
+
"CERT_UNTRUSTED",
|
|
32646
|
+
"ERR_TLS_CERT_ALTNAME_INVALID"
|
|
32647
|
+
]);
|
|
32648
|
+
var MISSING_DEPENDENCY_CODES = new Set([
|
|
32649
|
+
"MODULE_NOT_FOUND",
|
|
32650
|
+
"ERR_MODULE_NOT_FOUND"
|
|
32651
|
+
]);
|
|
32652
|
+
var INTERNAL_ERROR_NAMES = new Set([
|
|
32653
|
+
"TypeError",
|
|
32654
|
+
"ReferenceError",
|
|
32655
|
+
"SyntaxError",
|
|
32656
|
+
"RangeError"
|
|
32657
|
+
]);
|
|
32658
|
+
function isRecord(value) {
|
|
32659
|
+
return value !== null && typeof value === "object";
|
|
32660
|
+
}
|
|
32661
|
+
function stringField(value, field) {
|
|
32662
|
+
if (!isRecord(value)) {
|
|
32663
|
+
return;
|
|
32664
|
+
}
|
|
32665
|
+
const raw = value[field];
|
|
32666
|
+
return typeof raw === "string" ? raw : undefined;
|
|
32667
|
+
}
|
|
32668
|
+
function numberField(value, field) {
|
|
32669
|
+
if (!isRecord(value)) {
|
|
32670
|
+
return;
|
|
32671
|
+
}
|
|
32672
|
+
const raw = value[field];
|
|
32673
|
+
return typeof raw === "number" ? raw : undefined;
|
|
32674
|
+
}
|
|
32675
|
+
function findStringInCauseChain(error, field) {
|
|
32676
|
+
let current = error;
|
|
32677
|
+
for (let depth = 0;depth < 5 && current !== null && typeof current === "object"; depth++) {
|
|
32678
|
+
const value = stringField(current, field);
|
|
32679
|
+
if (value) {
|
|
32680
|
+
return value;
|
|
32681
|
+
}
|
|
32682
|
+
current = current.cause;
|
|
32683
|
+
}
|
|
32684
|
+
return;
|
|
32685
|
+
}
|
|
32686
|
+
function findCodeInCauseChain(error) {
|
|
32687
|
+
return findStringInCauseChain(error, "code");
|
|
32688
|
+
}
|
|
32689
|
+
function isSpawnEnoent(error) {
|
|
32690
|
+
const code = findCodeInCauseChain(error);
|
|
32691
|
+
if (code !== "ENOENT") {
|
|
32692
|
+
return false;
|
|
32693
|
+
}
|
|
32694
|
+
const syscall = findStringInCauseChain(error, "syscall");
|
|
32695
|
+
return syscall?.startsWith("spawn") === true;
|
|
32696
|
+
}
|
|
32697
|
+
function isCancellationError(error, exitCode, pollSignal) {
|
|
32698
|
+
if (exitCode === 130) {
|
|
32699
|
+
return true;
|
|
32700
|
+
}
|
|
32701
|
+
if (!isRecord(error)) {
|
|
32702
|
+
return false;
|
|
32703
|
+
}
|
|
32704
|
+
if (numberField(error, "exitCode") === 130) {
|
|
32705
|
+
return true;
|
|
32706
|
+
}
|
|
32707
|
+
const name = stringField(error, "name");
|
|
32708
|
+
if (name === "ExitPromptError") {
|
|
32709
|
+
return true;
|
|
32710
|
+
}
|
|
32711
|
+
if (name === "AbortError" && pollSignal?.aborted) {
|
|
32712
|
+
return true;
|
|
32713
|
+
}
|
|
32714
|
+
const message = stringField(error, "message");
|
|
32715
|
+
return message?.includes("SIGINT") === true;
|
|
32716
|
+
}
|
|
32717
|
+
function terminalSignalFor(input, outcome) {
|
|
32718
|
+
if (input.recordedFailure?.terminalSignal) {
|
|
32719
|
+
return input.recordedFailure.terminalSignal;
|
|
32720
|
+
}
|
|
32721
|
+
const explicit = findStringInCauseChain(input.error, "terminalSignal") ?? findStringInCauseChain(input.error, "signal");
|
|
32722
|
+
if (explicit) {
|
|
32723
|
+
return explicit;
|
|
32724
|
+
}
|
|
32725
|
+
return outcome === "cancelled" ? "SIGINT" : undefined;
|
|
32726
|
+
}
|
|
32727
|
+
function classifyHttpStatus(status) {
|
|
32728
|
+
if (status === 401 || status === 403) {
|
|
32729
|
+
return "auth";
|
|
32730
|
+
}
|
|
32731
|
+
if (status === 400 || status === 409 || status === 422) {
|
|
32732
|
+
return "validation";
|
|
32733
|
+
}
|
|
32734
|
+
if (status === 408) {
|
|
32735
|
+
return "timeout";
|
|
32736
|
+
}
|
|
32737
|
+
return "network_http";
|
|
32738
|
+
}
|
|
32739
|
+
function classifyFromResult(result) {
|
|
32740
|
+
switch (result) {
|
|
32741
|
+
case "AuthenticationError":
|
|
32742
|
+
return "auth";
|
|
32743
|
+
case "ValidationError":
|
|
32744
|
+
return "validation";
|
|
32745
|
+
case "TimeoutError":
|
|
32746
|
+
return "timeout";
|
|
32747
|
+
default:
|
|
32748
|
+
return;
|
|
32749
|
+
}
|
|
32750
|
+
}
|
|
32751
|
+
function classifyFromErrorCode(errorCode) {
|
|
32752
|
+
if (!errorCode) {
|
|
32753
|
+
return;
|
|
32754
|
+
}
|
|
32755
|
+
if (AUTH_ERROR_CODES.has(errorCode)) {
|
|
32756
|
+
return "auth";
|
|
32757
|
+
}
|
|
32758
|
+
if (VALIDATION_ERROR_CODES.has(errorCode)) {
|
|
32759
|
+
return "validation";
|
|
32760
|
+
}
|
|
32761
|
+
if (TIMEOUT_ERROR_CODES.has(errorCode)) {
|
|
32762
|
+
return "timeout";
|
|
32763
|
+
}
|
|
32764
|
+
if (NETWORK_HTTP_ERROR_CODES.has(errorCode)) {
|
|
32765
|
+
return "network_http";
|
|
32766
|
+
}
|
|
32767
|
+
return;
|
|
32768
|
+
}
|
|
32769
|
+
function classifyFromError(error) {
|
|
32770
|
+
const code = findCodeInCauseChain(error);
|
|
32771
|
+
if (code) {
|
|
32772
|
+
if (code.startsWith("commander.")) {
|
|
32773
|
+
return "validation";
|
|
32774
|
+
}
|
|
32775
|
+
if (NETWORK_OS_ERROR_CODES.has(code) || TLS_ERROR_CODES2.has(code)) {
|
|
32776
|
+
return "network_http";
|
|
32777
|
+
}
|
|
32778
|
+
if (TIMEOUT_OS_ERROR_CODES.has(code)) {
|
|
32779
|
+
return "timeout";
|
|
32780
|
+
}
|
|
32781
|
+
if (MISSING_DEPENDENCY_CODES.has(code) || isSpawnEnoent(error)) {
|
|
32782
|
+
return "missing_dependency";
|
|
32783
|
+
}
|
|
32784
|
+
}
|
|
32785
|
+
const message = stringField(error, "message");
|
|
32786
|
+
if (message?.includes("fetch failed") === true) {
|
|
32787
|
+
return "network_http";
|
|
32788
|
+
}
|
|
32789
|
+
const name = stringField(error, "name");
|
|
32790
|
+
if (name && INTERNAL_ERROR_NAMES.has(name)) {
|
|
32791
|
+
return "internal";
|
|
32792
|
+
}
|
|
32793
|
+
return;
|
|
32794
|
+
}
|
|
32795
|
+
function classifyError2(input) {
|
|
32796
|
+
const recorded = input.recordedFailure;
|
|
32797
|
+
if (recorded?.errorClass) {
|
|
32798
|
+
return recorded.errorClass;
|
|
32799
|
+
}
|
|
32800
|
+
const status = recorded?.context?.httpStatus;
|
|
32801
|
+
if (status !== undefined) {
|
|
32802
|
+
return classifyHttpStatus(status);
|
|
32803
|
+
}
|
|
32804
|
+
return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
|
|
32805
|
+
}
|
|
32806
|
+
function recordCommandFailureTelemetry(failure) {
|
|
32807
|
+
recordedFailureSlot.set(failure);
|
|
32808
|
+
}
|
|
32809
|
+
function clearRecordedCommandFailureTelemetry() {
|
|
32810
|
+
recordedFailureSlot.clear();
|
|
32811
|
+
}
|
|
32812
|
+
function takeRecordedCommandFailureTelemetry() {
|
|
32813
|
+
const failure = recordedFailureSlot.get();
|
|
32814
|
+
recordedFailureSlot.clear();
|
|
32815
|
+
return failure;
|
|
32816
|
+
}
|
|
32817
|
+
function buildCommandTerminalTelemetryProperties(input) {
|
|
32818
|
+
const cancelled = isCancellationError(input.error, input.exitCode, input.pollSignal);
|
|
32819
|
+
const outcome = input.recordedFailure?.terminalOutcome ?? (input.exitCode === 0 ? "success" : cancelled ? "cancelled" : "failure");
|
|
32820
|
+
const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError2(input);
|
|
32821
|
+
const terminalSignal = terminalSignalFor(input, outcome);
|
|
32822
|
+
return {
|
|
32823
|
+
exit_code: input.exitCode,
|
|
32824
|
+
terminal_outcome: outcome,
|
|
32825
|
+
...errorClass ? { error_class: errorClass } : {},
|
|
32826
|
+
...terminalSignal ? { terminal_signal: terminalSignal } : {}
|
|
32827
|
+
};
|
|
32828
|
+
}
|
|
32829
|
+
|
|
32612
32830
|
// ../common/src/telemetry/telemetry-events.ts
|
|
32613
32831
|
var CommonTelemetryEvents = {
|
|
32614
|
-
Error: "uip.error"
|
|
32832
|
+
Error: "uip.error",
|
|
32833
|
+
ShipSucceeded: "ship_succeeded"
|
|
32615
32834
|
};
|
|
32616
32835
|
|
|
32617
32836
|
// ../common/src/registry.ts
|
|
@@ -32678,6 +32897,136 @@ function formatMessage(category, name, properties) {
|
|
|
32678
32897
|
}
|
|
32679
32898
|
return message;
|
|
32680
32899
|
}
|
|
32900
|
+
// ../common/src/telemetry/detect-agent.ts
|
|
32901
|
+
var KNOWN_AGENTS = [
|
|
32902
|
+
{ envVar: "CLAUDECODE", value: "1", id: "claude-code" },
|
|
32903
|
+
{ envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
|
|
32904
|
+
{ envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
|
|
32905
|
+
{ envVar: "CODEX_THREAD_ID", id: "codex" },
|
|
32906
|
+
{ envVar: "CODEX_SANDBOX", id: "codex" },
|
|
32907
|
+
{ envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
|
|
32908
|
+
{ envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
|
|
32909
|
+
];
|
|
32910
|
+
function detectAgentFromEnv(env) {
|
|
32911
|
+
for (const agent of KNOWN_AGENTS) {
|
|
32912
|
+
const envValue = env[agent.envVar];
|
|
32913
|
+
if (agent.value !== undefined) {
|
|
32914
|
+
if (envValue === agent.value)
|
|
32915
|
+
return agent.id;
|
|
32916
|
+
} else {
|
|
32917
|
+
if (envValue)
|
|
32918
|
+
return agent.id;
|
|
32919
|
+
}
|
|
32920
|
+
}
|
|
32921
|
+
const agentEnv = env.AGENT;
|
|
32922
|
+
if (agentEnv) {
|
|
32923
|
+
if (agentEnv === "1" || agentEnv === "true")
|
|
32924
|
+
return "unknown";
|
|
32925
|
+
if (agentEnv.length <= 32)
|
|
32926
|
+
return agentEnv.toLowerCase();
|
|
32927
|
+
}
|
|
32928
|
+
return;
|
|
32929
|
+
}
|
|
32930
|
+
// ../common/src/telemetry/environment-info.ts
|
|
32931
|
+
var LOCAL_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
|
|
32932
|
+
// ../common/src/telemetry/execution-context.ts
|
|
32933
|
+
var authSignalSlot = singleton("TelemetryExecutionContextAuthSignal");
|
|
32934
|
+
var isTruthy = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false";
|
|
32935
|
+
var isEqual = (value, expected) => value?.toLowerCase() === expected;
|
|
32936
|
+
var CI_SIGNATURES = [
|
|
32937
|
+
{
|
|
32938
|
+
provider: "github_actions",
|
|
32939
|
+
matches: (env) => isTruthy(env.GITHUB_ACTIONS),
|
|
32940
|
+
isScheduler: (env) => env.GITHUB_EVENT_NAME === "schedule"
|
|
32941
|
+
},
|
|
32942
|
+
{
|
|
32943
|
+
provider: "azure_devops",
|
|
32944
|
+
matches: (env) => isTruthy(env.TF_BUILD),
|
|
32945
|
+
isScheduler: (env) => isEqual(env.BUILD_REASON, "schedule")
|
|
32946
|
+
},
|
|
32947
|
+
{
|
|
32948
|
+
provider: "gitlab",
|
|
32949
|
+
matches: (env) => isTruthy(env.GITLAB_CI),
|
|
32950
|
+
isScheduler: (env) => env.CI_PIPELINE_SOURCE === "schedule"
|
|
32951
|
+
},
|
|
32952
|
+
{
|
|
32953
|
+
provider: "circleci",
|
|
32954
|
+
matches: (env) => isTruthy(env.CIRCLECI),
|
|
32955
|
+
isScheduler: (env) => env.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
|
|
32956
|
+
},
|
|
32957
|
+
{
|
|
32958
|
+
provider: "jenkins",
|
|
32959
|
+
matches: (env) => isTruthy(env.JENKINS_URL) || isTruthy(env.JENKINS_HOME)
|
|
32960
|
+
},
|
|
32961
|
+
{
|
|
32962
|
+
provider: "teamcity",
|
|
32963
|
+
matches: (env) => isTruthy(env.TEAMCITY_VERSION)
|
|
32964
|
+
},
|
|
32965
|
+
{
|
|
32966
|
+
provider: "buildkite",
|
|
32967
|
+
matches: (env) => isTruthy(env.BUILDKITE),
|
|
32968
|
+
isScheduler: (env) => env.BUILDKITE_SOURCE === "schedule"
|
|
32969
|
+
},
|
|
32970
|
+
{
|
|
32971
|
+
provider: "bitbucket",
|
|
32972
|
+
matches: (env) => isTruthy(env.BITBUCKET_BUILD_NUMBER)
|
|
32973
|
+
},
|
|
32974
|
+
{
|
|
32975
|
+
provider: "travis",
|
|
32976
|
+
matches: (env) => isTruthy(env.TRAVIS)
|
|
32977
|
+
},
|
|
32978
|
+
{
|
|
32979
|
+
provider: "appveyor",
|
|
32980
|
+
matches: (env) => isTruthy(env.APPVEYOR)
|
|
32981
|
+
},
|
|
32982
|
+
{
|
|
32983
|
+
provider: "generic",
|
|
32984
|
+
matches: (env) => isTruthy(env.CI)
|
|
32985
|
+
}
|
|
32986
|
+
];
|
|
32987
|
+
function currentEnv() {
|
|
32988
|
+
return typeof process === "undefined" ? {} : process.env;
|
|
32989
|
+
}
|
|
32990
|
+
function currentTtyState() {
|
|
32991
|
+
if (typeof process === "undefined")
|
|
32992
|
+
return false;
|
|
32993
|
+
return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
|
|
32994
|
+
}
|
|
32995
|
+
function detectCi(env) {
|
|
32996
|
+
const signature = CI_SIGNATURES.find((candidate) => candidate.matches(env));
|
|
32997
|
+
if (!signature)
|
|
32998
|
+
return;
|
|
32999
|
+
return {
|
|
33000
|
+
executionContext: signature.isScheduler?.(env) ? "scheduler" : "ci",
|
|
33001
|
+
ciProvider: signature.provider
|
|
33002
|
+
};
|
|
33003
|
+
}
|
|
33004
|
+
function detectExecutionContext(options = {}) {
|
|
33005
|
+
const env = options.env ?? currentEnv();
|
|
33006
|
+
const ci = detectCi(env);
|
|
33007
|
+
if (ci)
|
|
33008
|
+
return ci;
|
|
33009
|
+
const agent = options.agent ?? detectAgentFromEnv(env);
|
|
33010
|
+
if (agent) {
|
|
33011
|
+
return { executionContext: "agent" };
|
|
33012
|
+
}
|
|
33013
|
+
const authSignal = options.authSignal ?? authSignalSlot.get();
|
|
33014
|
+
if (authSignal === "service_account") {
|
|
33015
|
+
return { executionContext: "service_account" };
|
|
33016
|
+
}
|
|
33017
|
+
const isTty = options.isTty ?? currentTtyState();
|
|
33018
|
+
if (isTty) {
|
|
33019
|
+
return { executionContext: "manual" };
|
|
33020
|
+
}
|
|
33021
|
+
return { executionContext: "unknown" };
|
|
33022
|
+
}
|
|
33023
|
+
function getExecutionContextTelemetryProperties() {
|
|
33024
|
+
const detected = detectExecutionContext();
|
|
33025
|
+
return {
|
|
33026
|
+
execution_context: detected.executionContext,
|
|
33027
|
+
...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
|
|
33028
|
+
};
|
|
33029
|
+
}
|
|
32681
33030
|
// ../common/src/telemetry/node-context-storage.ts
|
|
32682
33031
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
32683
33032
|
|
|
@@ -32690,6 +33039,26 @@ class NodeContextStorage {
|
|
|
32690
33039
|
return this.storage.getStore();
|
|
32691
33040
|
}
|
|
32692
33041
|
}
|
|
33042
|
+
// ../common/src/telemetry/session-id.ts
|
|
33043
|
+
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
33044
|
+
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
33045
|
+
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
33046
|
+
function getProcessEnv() {
|
|
33047
|
+
return globalThis.process?.env;
|
|
33048
|
+
}
|
|
33049
|
+
function normalizeSessionId(value) {
|
|
33050
|
+
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
|
|
33051
|
+
return;
|
|
33052
|
+
}
|
|
33053
|
+
const trimmed = String(value).trim();
|
|
33054
|
+
return trimmed || undefined;
|
|
33055
|
+
}
|
|
33056
|
+
function getConfiguredTelemetrySessionId() {
|
|
33057
|
+
return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
33058
|
+
}
|
|
33059
|
+
function resolveTelemetrySessionId(existingSessionId) {
|
|
33060
|
+
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
33061
|
+
}
|
|
32693
33062
|
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
32694
33063
|
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
32695
33064
|
function getGlobalTelemetryProperties() {
|
|
@@ -32774,12 +33143,22 @@ class TelemetryService {
|
|
|
32774
33143
|
return this.contextStorage.getContext();
|
|
32775
33144
|
}
|
|
32776
33145
|
enrichPropertiesWithContext(properties, context) {
|
|
32777
|
-
|
|
32778
|
-
|
|
33146
|
+
const globalProperties = getGlobalTelemetryProperties();
|
|
33147
|
+
const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
|
|
33148
|
+
const sessionId = resolveTelemetrySessionId(existingSessionId);
|
|
33149
|
+
const enriched = {
|
|
33150
|
+
...getExecutionContextTelemetryProperties(),
|
|
33151
|
+
...globalProperties,
|
|
32779
33152
|
...this.defaultProperties,
|
|
32780
33153
|
...properties,
|
|
32781
33154
|
...context
|
|
32782
33155
|
};
|
|
33156
|
+
if (sessionId === undefined) {
|
|
33157
|
+
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
33158
|
+
} else {
|
|
33159
|
+
enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
|
|
33160
|
+
}
|
|
33161
|
+
return enriched;
|
|
32783
33162
|
}
|
|
32784
33163
|
generateId() {
|
|
32785
33164
|
return crypto.randomUUID().replaceAll("-", "");
|
|
@@ -33249,8 +33628,24 @@ var OutputFormatter;
|
|
|
33249
33628
|
data.ErrorCode ??= defaultErrorCodeForFailure(data);
|
|
33250
33629
|
data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
|
|
33251
33630
|
process.exitCode = EXIT_CODES[data.Result] ?? 1;
|
|
33252
|
-
|
|
33253
|
-
|
|
33631
|
+
recordCommandFailureTelemetry({
|
|
33632
|
+
result: data.Result,
|
|
33633
|
+
errorCode: data.ErrorCode,
|
|
33634
|
+
retry: data.Retry,
|
|
33635
|
+
message: data.Message,
|
|
33636
|
+
context: data.Context,
|
|
33637
|
+
exitCode: process.exitCode,
|
|
33638
|
+
errorClass: data.TelemetryErrorClass,
|
|
33639
|
+
terminalOutcome: data.TelemetryTerminalOutcome,
|
|
33640
|
+
terminalSignal: data.TelemetryTerminalSignal
|
|
33641
|
+
});
|
|
33642
|
+
const suppressTelemetry = data.SuppressTelemetry === true;
|
|
33643
|
+
const envelope = { ...data };
|
|
33644
|
+
delete envelope.SuppressTelemetry;
|
|
33645
|
+
delete envelope.TelemetryErrorClass;
|
|
33646
|
+
delete envelope.TelemetryTerminalOutcome;
|
|
33647
|
+
delete envelope.TelemetryTerminalSignal;
|
|
33648
|
+
if (!suppressTelemetry) {
|
|
33254
33649
|
telemetry.trackEvent(CommonTelemetryEvents.Error, {
|
|
33255
33650
|
result: data.Result,
|
|
33256
33651
|
errorCode: data.ErrorCode,
|
|
@@ -33313,6 +33708,158 @@ var OutputFormatter;
|
|
|
33313
33708
|
OutputFormatter.formatToString = formatToString;
|
|
33314
33709
|
})(OutputFormatter ||= {});
|
|
33315
33710
|
|
|
33711
|
+
// ../common/src/telemetry/command-attribution.ts
|
|
33712
|
+
var LEGACY_SKILL_NAMESPACE = "uipath:";
|
|
33713
|
+
var MAX_SKILL_NAME_LENGTH = 80;
|
|
33714
|
+
var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
|
|
33715
|
+
function productMode(productArea, mode) {
|
|
33716
|
+
return { product_area: productArea, mode };
|
|
33717
|
+
}
|
|
33718
|
+
function attributionRecord(groups) {
|
|
33719
|
+
const record = {};
|
|
33720
|
+
for (const [productArea, mode, names] of groups) {
|
|
33721
|
+
const attribution = productMode(productArea, mode);
|
|
33722
|
+
for (const name of names) {
|
|
33723
|
+
record[name] = attribution;
|
|
33724
|
+
}
|
|
33725
|
+
}
|
|
33726
|
+
return record;
|
|
33727
|
+
}
|
|
33728
|
+
function commandAttribution(groups) {
|
|
33729
|
+
const entries = [];
|
|
33730
|
+
for (const [productArea, mode, prefixes] of groups) {
|
|
33731
|
+
const attribution = productMode(productArea, mode);
|
|
33732
|
+
for (const prefix of prefixes) {
|
|
33733
|
+
entries.push({ prefix, attribution });
|
|
33734
|
+
}
|
|
33735
|
+
}
|
|
33736
|
+
return entries;
|
|
33737
|
+
}
|
|
33738
|
+
var SKILL_ATTRIBUTION = attributionRecord([
|
|
33739
|
+
["admin", "operate", ["uipath-admin"]],
|
|
33740
|
+
["agents", "build", ["uipath-agents"]],
|
|
33741
|
+
["api-workflow", "build", ["uipath-api-workflow"]],
|
|
33742
|
+
["automation-discovery", "build", ["uipath-automation-discovery"]],
|
|
33743
|
+
["coded-apps", "build", ["uipath-coded-apps"]],
|
|
33744
|
+
["data-fabric", "operate", ["uipath-data-fabric"]],
|
|
33745
|
+
["cli", "troubleshoot", ["uipath-feedback"]],
|
|
33746
|
+
["governance", "operate", ["uipath-governance"]],
|
|
33747
|
+
["action-center", "build", ["uipath-human-in-the-loop"]],
|
|
33748
|
+
["document-understanding", "build", ["uipath-ixp"]],
|
|
33749
|
+
[
|
|
33750
|
+
"maestro",
|
|
33751
|
+
"build",
|
|
33752
|
+
["uipath-maestro-bpmn", "uipath-maestro-case", "uipath-maestro-flow"]
|
|
33753
|
+
],
|
|
33754
|
+
["agenthub", "build", ["uipath-mcp-servers"]],
|
|
33755
|
+
["solution", "build", ["uipath-planner", "uipath-solution"]],
|
|
33756
|
+
["platform", "operate", ["uipath-platform"]],
|
|
33757
|
+
["quality", "troubleshoot", ["uipath-review"]],
|
|
33758
|
+
["rpa", "build", ["uipath-rpa"]],
|
|
33759
|
+
["cli", "operate", ["uipath-skill-catalog"]],
|
|
33760
|
+
["action-center", "operate", ["uipath-tasks"]],
|
|
33761
|
+
["test-manager", "operate", ["uipath-test"]],
|
|
33762
|
+
["platform", "troubleshoot", ["uipath-troubleshoot"]]
|
|
33763
|
+
]);
|
|
33764
|
+
var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
|
|
33765
|
+
var COMMAND_ATTRIBUTION = commandAttribution([
|
|
33766
|
+
["cli", "troubleshoot", ["uip.feedback"]],
|
|
33767
|
+
["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
|
|
33768
|
+
["context-grounding", "build", ["uip.context-grounding"]],
|
|
33769
|
+
["api-workflow", "build", ["uip.api-workflow"]],
|
|
33770
|
+
["rpa", "build", ["uip.rpa-legacy"]],
|
|
33771
|
+
["conversational", "operate", ["uip.conversational"]],
|
|
33772
|
+
["agents", "build", ["uip.codedagent", "uip.agent"]],
|
|
33773
|
+
["agenthub", "build", ["uip.agenthub"]],
|
|
33774
|
+
["coded-apps", "build", ["uip.codedapp"]],
|
|
33775
|
+
["functions", "build", ["uip.functions"]],
|
|
33776
|
+
["solution", "build", ["uip.solution"]],
|
|
33777
|
+
["maestro", "build", ["uip.maestro", "uip.case", "uip.flow"]],
|
|
33778
|
+
["llm-observability", "troubleshoot", ["uip.traces"]],
|
|
33779
|
+
["platform", "operate", ["uip.platform"]],
|
|
33780
|
+
["admin", "operate", ["uip.admin"]],
|
|
33781
|
+
["automation-ops", "operate", ["uip.aops"]],
|
|
33782
|
+
["documentation", "troubleshoot", ["uip.docsai"]],
|
|
33783
|
+
["governance", "operate", ["uip.gov"]],
|
|
33784
|
+
["insights", "operate", ["uip.insights"]],
|
|
33785
|
+
["document-understanding", "build", ["uip.ixp"]],
|
|
33786
|
+
["process-mining", "operate", ["uip.pm"]],
|
|
33787
|
+
["action-center", "operate", ["uip.tasks"]],
|
|
33788
|
+
["test-manager", "operate", ["uip.tm"]],
|
|
33789
|
+
["vertical-solutions", "build", ["uip.vss"]],
|
|
33790
|
+
["data-fabric", "operate", ["uip.df"]],
|
|
33791
|
+
["integration-service", "build", ["uip.is"]],
|
|
33792
|
+
["orchestrator", "operate", ["uip.or"]],
|
|
33793
|
+
[
|
|
33794
|
+
"cli",
|
|
33795
|
+
"operate",
|
|
33796
|
+
[
|
|
33797
|
+
"uip.login",
|
|
33798
|
+
"uip.logout",
|
|
33799
|
+
"uip.user",
|
|
33800
|
+
"uip.config",
|
|
33801
|
+
"uip.tools",
|
|
33802
|
+
"uip.skills",
|
|
33803
|
+
"uip.completion",
|
|
33804
|
+
"uip.update",
|
|
33805
|
+
"uip.mcp",
|
|
33806
|
+
"uip.track"
|
|
33807
|
+
]
|
|
33808
|
+
]
|
|
33809
|
+
]).sort((a, b) => b.prefix.length - a.prefix.length);
|
|
33810
|
+
function normalizeCommandPath(value) {
|
|
33811
|
+
if (typeof value !== "string") {
|
|
33812
|
+
return;
|
|
33813
|
+
}
|
|
33814
|
+
const trimmed = value.trim().toLowerCase();
|
|
33815
|
+
if (!trimmed) {
|
|
33816
|
+
return;
|
|
33817
|
+
}
|
|
33818
|
+
const tokens = trimmed.includes(" ") ? trimmed.split(/\s+/).filter((token) => token.length > 0).filter((token) => !token.startsWith("-")) : trimmed.split(".").filter((token) => token.length > 0);
|
|
33819
|
+
if (tokens.length === 0) {
|
|
33820
|
+
return;
|
|
33821
|
+
}
|
|
33822
|
+
const commandTokens = tokens[0] === "uip" ? tokens : ["uip", ...tokens];
|
|
33823
|
+
return commandTokens.join(".");
|
|
33824
|
+
}
|
|
33825
|
+
function getCommandProductModeAttribution(commandPath) {
|
|
33826
|
+
const normalized = normalizeCommandPath(commandPath);
|
|
33827
|
+
if (!normalized) {
|
|
33828
|
+
return;
|
|
33829
|
+
}
|
|
33830
|
+
return COMMAND_ATTRIBUTION.find(({ prefix }) => normalized === prefix || normalized.startsWith(`${prefix}.`))?.attribution;
|
|
33831
|
+
}
|
|
33832
|
+
function normalizeSkillNameWithOptions(value, options) {
|
|
33833
|
+
if (typeof value !== "string") {
|
|
33834
|
+
return;
|
|
33835
|
+
}
|
|
33836
|
+
const normalized = value.trim().toLowerCase();
|
|
33837
|
+
if (!normalized) {
|
|
33838
|
+
return;
|
|
33839
|
+
}
|
|
33840
|
+
const hasLegacyNamespace = normalized.startsWith(LEGACY_SKILL_NAMESPACE);
|
|
33841
|
+
if (hasLegacyNamespace && !options.allowLegacyNamespace) {
|
|
33842
|
+
return;
|
|
33843
|
+
}
|
|
33844
|
+
const skillName = hasLegacyNamespace ? normalized.slice(LEGACY_SKILL_NAMESPACE.length) : normalized;
|
|
33845
|
+
if (skillName.length > MAX_SKILL_NAME_LENGTH || !SKILL_NAME_PATTERN.test(skillName) || !KNOWN_SKILL_NAMES.has(skillName)) {
|
|
33846
|
+
return;
|
|
33847
|
+
}
|
|
33848
|
+
return skillName;
|
|
33849
|
+
}
|
|
33850
|
+
function normalizeSkillName(value) {
|
|
33851
|
+
return normalizeSkillNameWithOptions(value, {
|
|
33852
|
+
allowLegacyNamespace: false
|
|
33853
|
+
});
|
|
33854
|
+
}
|
|
33855
|
+
function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
33856
|
+
const skillName = normalizeSkillName(skillSource);
|
|
33857
|
+
return {
|
|
33858
|
+
...skillName ? { skill_name: skillName } : {},
|
|
33859
|
+
...getCommandProductModeAttribution(commandPath)
|
|
33860
|
+
};
|
|
33861
|
+
}
|
|
33862
|
+
|
|
33316
33863
|
// ../common/src/telemetry/pii-redactor.ts
|
|
33317
33864
|
var REDACTED = "[REDACTED]";
|
|
33318
33865
|
var MAX_VALUE_LENGTH = 200;
|
|
@@ -33498,6 +34045,12 @@ function commandHelpHint(commandPath) {
|
|
|
33498
34045
|
const command = commandPath.replace(/\./g, " ");
|
|
33499
34046
|
return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
|
|
33500
34047
|
}
|
|
34048
|
+
function isPromptCancellation(error) {
|
|
34049
|
+
return error instanceof Error && error.name === "ExitPromptError";
|
|
34050
|
+
}
|
|
34051
|
+
function exitCodeFromProcess(fallback) {
|
|
34052
|
+
return typeof process.exitCode === "number" ? process.exitCode : fallback;
|
|
34053
|
+
}
|
|
33501
34054
|
Command.prototype.trackedAction = function(context, fn, properties) {
|
|
33502
34055
|
const command = this;
|
|
33503
34056
|
return this.action(async (...args) => {
|
|
@@ -33505,6 +34058,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
33505
34058
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
33506
34059
|
const startTime = performance.now();
|
|
33507
34060
|
let errorMessage;
|
|
34061
|
+
let fallbackExitCode = EXIT_CODES.Success;
|
|
34062
|
+
clearRecordedCommandFailureTelemetry();
|
|
33508
34063
|
const [error] = await catchError(fn(...args));
|
|
33509
34064
|
if (error) {
|
|
33510
34065
|
errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -33519,6 +34074,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
33519
34074
|
const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
|
|
33520
34075
|
const typedContext = typed.context ?? typed.Context;
|
|
33521
34076
|
const customContext = isErrorContext(typedContext) ? typedContext : undefined;
|
|
34077
|
+
const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
|
|
34078
|
+
fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
|
|
33522
34079
|
OutputFormatter.error({
|
|
33523
34080
|
Result: finalResult,
|
|
33524
34081
|
...customErrorCode ? { ErrorCode: customErrorCode } : {},
|
|
@@ -33527,16 +34084,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
33527
34084
|
...customRetry ? { Retry: customRetry } : {},
|
|
33528
34085
|
...customContext ? { Context: customContext } : {}
|
|
33529
34086
|
});
|
|
33530
|
-
context.exit(
|
|
34087
|
+
context.exit(fallbackExitCode);
|
|
33531
34088
|
}
|
|
33532
34089
|
const durationMs = performance.now() - startTime;
|
|
33533
|
-
const
|
|
34090
|
+
const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
|
|
34091
|
+
const recordedFailure = takeRecordedCommandFailureTelemetry();
|
|
34092
|
+
const success = !error && exitCode === 0;
|
|
34093
|
+
const terminalTelemetry = buildCommandTerminalTelemetryProperties({
|
|
34094
|
+
error,
|
|
34095
|
+
exitCode,
|
|
34096
|
+
recordedFailure,
|
|
34097
|
+
pollSignal: context.pollSignal
|
|
34098
|
+
});
|
|
33534
34099
|
telemetry.trackEvent(telemetryName, redactProperties({
|
|
33535
34100
|
...extractCommandParams(command),
|
|
33536
34101
|
...props,
|
|
34102
|
+
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
33537
34103
|
command: "true",
|
|
33538
34104
|
duration: String(durationMs),
|
|
33539
34105
|
success: String(success),
|
|
34106
|
+
...terminalTelemetry,
|
|
33540
34107
|
...errorMessage ? { errorMessage } : {}
|
|
33541
34108
|
}));
|
|
33542
34109
|
});
|
|
@@ -33621,6 +34188,8 @@ var ScreenLogger;
|
|
|
33621
34188
|
})(ScreenLogger ||= {});
|
|
33622
34189
|
// ../common/src/sdk-user-agent.ts
|
|
33623
34190
|
var sdkUserAgentHostToken = singleton("SdkUserAgentHostToken");
|
|
34191
|
+
// ../common/src/telemetry/ship-succeeded.ts
|
|
34192
|
+
var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
|
|
33624
34193
|
// ../common/src/tool-provider.ts
|
|
33625
34194
|
var factorySlot = singleton("PackagerFactoryProvider");
|
|
33626
34195
|
// ../auth/src/config.ts
|
|
@@ -39877,7 +40446,7 @@ function validateConfig(config2) {
|
|
|
39877
40446
|
function isCompleteConfig(config2) {
|
|
39878
40447
|
return hasRequiredBaseFields(config2) && hasValidAuthConfig(config2);
|
|
39879
40448
|
}
|
|
39880
|
-
function
|
|
40449
|
+
function normalizeBaseUrl2(url) {
|
|
39881
40450
|
return url.endsWith("/") ? url.slice(0, -1) : url;
|
|
39882
40451
|
}
|
|
39883
40452
|
var REGISTRY_KEY2 = Symbol.for("@uipath/sdk-internals-registry");
|
|
@@ -40051,7 +40620,7 @@ _UiPath_config = new WeakMap, _UiPath_authService = new WeakMap, _UiPath_initial
|
|
|
40051
40620
|
const hasSecretAuth = hasSecretConfig(config2);
|
|
40052
40621
|
const hasOAuthAuth = hasOAuthConfig(config2);
|
|
40053
40622
|
const internalConfig = new UiPathConfig({
|
|
40054
|
-
baseUrl:
|
|
40623
|
+
baseUrl: normalizeBaseUrl2(config2.baseUrl),
|
|
40055
40624
|
orgName: config2.orgName,
|
|
40056
40625
|
tenantName: config2.tenantName,
|
|
40057
40626
|
secret: hasSecretAuth ? config2.secret : undefined,
|
|
@@ -45221,4 +45790,4 @@ export {
|
|
|
45221
45790
|
metadata
|
|
45222
45791
|
};
|
|
45223
45792
|
|
|
45224
|
-
//# debugId=
|
|
45793
|
+
//# debugId=F881E1AA1D856C8164756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/tasks-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.197.0-preview.
|
|
4
|
+
"version": "1.197.0-preview.67",
|
|
5
5
|
"description": "Manage Action Center tasks.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/tool.js",
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
"publishConfig": {
|
|
15
15
|
"registry": "https://registry.npmjs.org/"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "579e7d41cb100fcb8130eec8ed1c9b5b55feaf0b"
|
|
18
18
|
}
|