@uipath/platform-tool 1.197.0-preview.65 → 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/tool.js +578 -9
- package/package.json +2 -2
package/dist/tool.js
CHANGED
|
@@ -44724,7 +44724,7 @@ var require_dist3 = __commonJS((exports) => {
|
|
|
44724
44724
|
var package_default = {
|
|
44725
44725
|
name: "@uipath/platform-tool",
|
|
44726
44726
|
license: "MIT",
|
|
44727
|
-
version: "1.197.0-preview.
|
|
44727
|
+
version: "1.197.0-preview.66",
|
|
44728
44728
|
description: "Manage UiPath platform-level resources such as tenant licensing.",
|
|
44729
44729
|
type: "module",
|
|
44730
44730
|
main: "./dist/tool.js",
|
|
@@ -51318,9 +51318,228 @@ function getOutputFilter() {
|
|
|
51318
51318
|
return filterSlot.get();
|
|
51319
51319
|
}
|
|
51320
51320
|
|
|
51321
|
+
// ../common/src/telemetry/command-terminal.ts
|
|
51322
|
+
var recordedFailureSlot = singleton("CommandTelemetryFailure");
|
|
51323
|
+
var AUTH_ERROR_CODES = new Set([
|
|
51324
|
+
"authentication_required",
|
|
51325
|
+
"permission_denied"
|
|
51326
|
+
]);
|
|
51327
|
+
var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
|
|
51328
|
+
var NETWORK_HTTP_ERROR_CODES = new Set([
|
|
51329
|
+
"network_error",
|
|
51330
|
+
"rate_limited",
|
|
51331
|
+
"server_error",
|
|
51332
|
+
"not_found",
|
|
51333
|
+
"method_not_allowed"
|
|
51334
|
+
]);
|
|
51335
|
+
var TIMEOUT_ERROR_CODES = new Set(["timeout"]);
|
|
51336
|
+
var NETWORK_OS_ERROR_CODES = new Set([
|
|
51337
|
+
"ECONNREFUSED",
|
|
51338
|
+
"ECONNRESET",
|
|
51339
|
+
"ENOTFOUND",
|
|
51340
|
+
"EAI_AGAIN",
|
|
51341
|
+
"EPIPE",
|
|
51342
|
+
"EHOSTUNREACH",
|
|
51343
|
+
"ENETUNREACH",
|
|
51344
|
+
"EAI_FAIL"
|
|
51345
|
+
]);
|
|
51346
|
+
var TIMEOUT_OS_ERROR_CODES = new Set(["ETIMEDOUT", "ESOCKETTIMEDOUT"]);
|
|
51347
|
+
var TLS_ERROR_CODES2 = new Set([
|
|
51348
|
+
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
51349
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
51350
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
51351
|
+
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
51352
|
+
"UNABLE_TO_GET_ISSUER_CERT",
|
|
51353
|
+
"CERT_HAS_EXPIRED",
|
|
51354
|
+
"CERT_UNTRUSTED",
|
|
51355
|
+
"ERR_TLS_CERT_ALTNAME_INVALID"
|
|
51356
|
+
]);
|
|
51357
|
+
var MISSING_DEPENDENCY_CODES = new Set([
|
|
51358
|
+
"MODULE_NOT_FOUND",
|
|
51359
|
+
"ERR_MODULE_NOT_FOUND"
|
|
51360
|
+
]);
|
|
51361
|
+
var INTERNAL_ERROR_NAMES = new Set([
|
|
51362
|
+
"TypeError",
|
|
51363
|
+
"ReferenceError",
|
|
51364
|
+
"SyntaxError",
|
|
51365
|
+
"RangeError"
|
|
51366
|
+
]);
|
|
51367
|
+
function isRecord(value) {
|
|
51368
|
+
return value !== null && typeof value === "object";
|
|
51369
|
+
}
|
|
51370
|
+
function stringField(value, field) {
|
|
51371
|
+
if (!isRecord(value)) {
|
|
51372
|
+
return;
|
|
51373
|
+
}
|
|
51374
|
+
const raw = value[field];
|
|
51375
|
+
return typeof raw === "string" ? raw : undefined;
|
|
51376
|
+
}
|
|
51377
|
+
function numberField(value, field) {
|
|
51378
|
+
if (!isRecord(value)) {
|
|
51379
|
+
return;
|
|
51380
|
+
}
|
|
51381
|
+
const raw = value[field];
|
|
51382
|
+
return typeof raw === "number" ? raw : undefined;
|
|
51383
|
+
}
|
|
51384
|
+
function findStringInCauseChain(error, field) {
|
|
51385
|
+
let current = error;
|
|
51386
|
+
for (let depth = 0;depth < 5 && current !== null && typeof current === "object"; depth++) {
|
|
51387
|
+
const value = stringField(current, field);
|
|
51388
|
+
if (value) {
|
|
51389
|
+
return value;
|
|
51390
|
+
}
|
|
51391
|
+
current = current.cause;
|
|
51392
|
+
}
|
|
51393
|
+
return;
|
|
51394
|
+
}
|
|
51395
|
+
function findCodeInCauseChain(error) {
|
|
51396
|
+
return findStringInCauseChain(error, "code");
|
|
51397
|
+
}
|
|
51398
|
+
function isSpawnEnoent(error) {
|
|
51399
|
+
const code = findCodeInCauseChain(error);
|
|
51400
|
+
if (code !== "ENOENT") {
|
|
51401
|
+
return false;
|
|
51402
|
+
}
|
|
51403
|
+
const syscall = findStringInCauseChain(error, "syscall");
|
|
51404
|
+
return syscall?.startsWith("spawn") === true;
|
|
51405
|
+
}
|
|
51406
|
+
function isCancellationError(error, exitCode, pollSignal) {
|
|
51407
|
+
if (exitCode === 130) {
|
|
51408
|
+
return true;
|
|
51409
|
+
}
|
|
51410
|
+
if (!isRecord(error)) {
|
|
51411
|
+
return false;
|
|
51412
|
+
}
|
|
51413
|
+
if (numberField(error, "exitCode") === 130) {
|
|
51414
|
+
return true;
|
|
51415
|
+
}
|
|
51416
|
+
const name = stringField(error, "name");
|
|
51417
|
+
if (name === "ExitPromptError") {
|
|
51418
|
+
return true;
|
|
51419
|
+
}
|
|
51420
|
+
if (name === "AbortError" && pollSignal?.aborted) {
|
|
51421
|
+
return true;
|
|
51422
|
+
}
|
|
51423
|
+
const message = stringField(error, "message");
|
|
51424
|
+
return message?.includes("SIGINT") === true;
|
|
51425
|
+
}
|
|
51426
|
+
function terminalSignalFor(input, outcome) {
|
|
51427
|
+
if (input.recordedFailure?.terminalSignal) {
|
|
51428
|
+
return input.recordedFailure.terminalSignal;
|
|
51429
|
+
}
|
|
51430
|
+
const explicit = findStringInCauseChain(input.error, "terminalSignal") ?? findStringInCauseChain(input.error, "signal");
|
|
51431
|
+
if (explicit) {
|
|
51432
|
+
return explicit;
|
|
51433
|
+
}
|
|
51434
|
+
return outcome === "cancelled" ? "SIGINT" : undefined;
|
|
51435
|
+
}
|
|
51436
|
+
function classifyHttpStatus(status) {
|
|
51437
|
+
if (status === 401 || status === 403) {
|
|
51438
|
+
return "auth";
|
|
51439
|
+
}
|
|
51440
|
+
if (status === 400 || status === 409 || status === 422) {
|
|
51441
|
+
return "validation";
|
|
51442
|
+
}
|
|
51443
|
+
if (status === 408) {
|
|
51444
|
+
return "timeout";
|
|
51445
|
+
}
|
|
51446
|
+
return "network_http";
|
|
51447
|
+
}
|
|
51448
|
+
function classifyFromResult(result) {
|
|
51449
|
+
switch (result) {
|
|
51450
|
+
case "AuthenticationError":
|
|
51451
|
+
return "auth";
|
|
51452
|
+
case "ValidationError":
|
|
51453
|
+
return "validation";
|
|
51454
|
+
case "TimeoutError":
|
|
51455
|
+
return "timeout";
|
|
51456
|
+
default:
|
|
51457
|
+
return;
|
|
51458
|
+
}
|
|
51459
|
+
}
|
|
51460
|
+
function classifyFromErrorCode(errorCode2) {
|
|
51461
|
+
if (!errorCode2) {
|
|
51462
|
+
return;
|
|
51463
|
+
}
|
|
51464
|
+
if (AUTH_ERROR_CODES.has(errorCode2)) {
|
|
51465
|
+
return "auth";
|
|
51466
|
+
}
|
|
51467
|
+
if (VALIDATION_ERROR_CODES.has(errorCode2)) {
|
|
51468
|
+
return "validation";
|
|
51469
|
+
}
|
|
51470
|
+
if (TIMEOUT_ERROR_CODES.has(errorCode2)) {
|
|
51471
|
+
return "timeout";
|
|
51472
|
+
}
|
|
51473
|
+
if (NETWORK_HTTP_ERROR_CODES.has(errorCode2)) {
|
|
51474
|
+
return "network_http";
|
|
51475
|
+
}
|
|
51476
|
+
return;
|
|
51477
|
+
}
|
|
51478
|
+
function classifyFromError(error) {
|
|
51479
|
+
const code = findCodeInCauseChain(error);
|
|
51480
|
+
if (code) {
|
|
51481
|
+
if (code.startsWith("commander.")) {
|
|
51482
|
+
return "validation";
|
|
51483
|
+
}
|
|
51484
|
+
if (NETWORK_OS_ERROR_CODES.has(code) || TLS_ERROR_CODES2.has(code)) {
|
|
51485
|
+
return "network_http";
|
|
51486
|
+
}
|
|
51487
|
+
if (TIMEOUT_OS_ERROR_CODES.has(code)) {
|
|
51488
|
+
return "timeout";
|
|
51489
|
+
}
|
|
51490
|
+
if (MISSING_DEPENDENCY_CODES.has(code) || isSpawnEnoent(error)) {
|
|
51491
|
+
return "missing_dependency";
|
|
51492
|
+
}
|
|
51493
|
+
}
|
|
51494
|
+
const message = stringField(error, "message");
|
|
51495
|
+
if (message?.includes("fetch failed") === true) {
|
|
51496
|
+
return "network_http";
|
|
51497
|
+
}
|
|
51498
|
+
const name = stringField(error, "name");
|
|
51499
|
+
if (name && INTERNAL_ERROR_NAMES.has(name)) {
|
|
51500
|
+
return "internal";
|
|
51501
|
+
}
|
|
51502
|
+
return;
|
|
51503
|
+
}
|
|
51504
|
+
function classifyError2(input) {
|
|
51505
|
+
const recorded = input.recordedFailure;
|
|
51506
|
+
if (recorded?.errorClass) {
|
|
51507
|
+
return recorded.errorClass;
|
|
51508
|
+
}
|
|
51509
|
+
const status = recorded?.context?.httpStatus;
|
|
51510
|
+
if (status !== undefined) {
|
|
51511
|
+
return classifyHttpStatus(status);
|
|
51512
|
+
}
|
|
51513
|
+
return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
|
|
51514
|
+
}
|
|
51515
|
+
function recordCommandFailureTelemetry(failure) {
|
|
51516
|
+
recordedFailureSlot.set(failure);
|
|
51517
|
+
}
|
|
51518
|
+
function clearRecordedCommandFailureTelemetry() {
|
|
51519
|
+
recordedFailureSlot.clear();
|
|
51520
|
+
}
|
|
51521
|
+
function takeRecordedCommandFailureTelemetry() {
|
|
51522
|
+
const failure = recordedFailureSlot.get();
|
|
51523
|
+
recordedFailureSlot.clear();
|
|
51524
|
+
return failure;
|
|
51525
|
+
}
|
|
51526
|
+
function buildCommandTerminalTelemetryProperties(input) {
|
|
51527
|
+
const cancelled = isCancellationError(input.error, input.exitCode, input.pollSignal);
|
|
51528
|
+
const outcome = input.recordedFailure?.terminalOutcome ?? (input.exitCode === 0 ? "success" : cancelled ? "cancelled" : "failure");
|
|
51529
|
+
const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError2(input);
|
|
51530
|
+
const terminalSignal = terminalSignalFor(input, outcome);
|
|
51531
|
+
return {
|
|
51532
|
+
exit_code: input.exitCode,
|
|
51533
|
+
terminal_outcome: outcome,
|
|
51534
|
+
...errorClass ? { error_class: errorClass } : {},
|
|
51535
|
+
...terminalSignal ? { terminal_signal: terminalSignal } : {}
|
|
51536
|
+
};
|
|
51537
|
+
}
|
|
51538
|
+
|
|
51321
51539
|
// ../common/src/telemetry/telemetry-events.ts
|
|
51322
51540
|
var CommonTelemetryEvents = {
|
|
51323
|
-
Error: "uip.error"
|
|
51541
|
+
Error: "uip.error",
|
|
51542
|
+
ShipSucceeded: "ship_succeeded"
|
|
51324
51543
|
};
|
|
51325
51544
|
|
|
51326
51545
|
// ../common/src/registry.ts
|
|
@@ -51387,6 +51606,136 @@ function formatMessage(category, name, properties) {
|
|
|
51387
51606
|
}
|
|
51388
51607
|
return message;
|
|
51389
51608
|
}
|
|
51609
|
+
// ../common/src/telemetry/detect-agent.ts
|
|
51610
|
+
var KNOWN_AGENTS = [
|
|
51611
|
+
{ envVar: "CLAUDECODE", value: "1", id: "claude-code" },
|
|
51612
|
+
{ envVar: "CURSOR_AGENT", value: "1", id: "cursor" },
|
|
51613
|
+
{ envVar: "GEMINI_CLI", value: "1", id: "gemini-cli" },
|
|
51614
|
+
{ envVar: "CODEX_THREAD_ID", id: "codex" },
|
|
51615
|
+
{ envVar: "CODEX_SANDBOX", id: "codex" },
|
|
51616
|
+
{ envVar: "AUGMENT_AGENT", value: "1", id: "augment" },
|
|
51617
|
+
{ envVar: "CLINE_ACTIVE", value: "true", id: "cline" }
|
|
51618
|
+
];
|
|
51619
|
+
function detectAgentFromEnv(env) {
|
|
51620
|
+
for (const agent of KNOWN_AGENTS) {
|
|
51621
|
+
const envValue = env[agent.envVar];
|
|
51622
|
+
if (agent.value !== undefined) {
|
|
51623
|
+
if (envValue === agent.value)
|
|
51624
|
+
return agent.id;
|
|
51625
|
+
} else {
|
|
51626
|
+
if (envValue)
|
|
51627
|
+
return agent.id;
|
|
51628
|
+
}
|
|
51629
|
+
}
|
|
51630
|
+
const agentEnv = env.AGENT;
|
|
51631
|
+
if (agentEnv) {
|
|
51632
|
+
if (agentEnv === "1" || agentEnv === "true")
|
|
51633
|
+
return "unknown";
|
|
51634
|
+
if (agentEnv.length <= 32)
|
|
51635
|
+
return agentEnv.toLowerCase();
|
|
51636
|
+
}
|
|
51637
|
+
return;
|
|
51638
|
+
}
|
|
51639
|
+
// ../common/src/telemetry/environment-info.ts
|
|
51640
|
+
var LOCAL_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
|
|
51641
|
+
// ../common/src/telemetry/execution-context.ts
|
|
51642
|
+
var authSignalSlot = singleton("TelemetryExecutionContextAuthSignal");
|
|
51643
|
+
var isTruthy = (value) => value !== undefined && value !== "" && value !== "0" && value.toLowerCase() !== "false";
|
|
51644
|
+
var isEqual = (value, expected) => value?.toLowerCase() === expected;
|
|
51645
|
+
var CI_SIGNATURES = [
|
|
51646
|
+
{
|
|
51647
|
+
provider: "github_actions",
|
|
51648
|
+
matches: (env) => isTruthy(env.GITHUB_ACTIONS),
|
|
51649
|
+
isScheduler: (env) => env.GITHUB_EVENT_NAME === "schedule"
|
|
51650
|
+
},
|
|
51651
|
+
{
|
|
51652
|
+
provider: "azure_devops",
|
|
51653
|
+
matches: (env) => isTruthy(env.TF_BUILD),
|
|
51654
|
+
isScheduler: (env) => isEqual(env.BUILD_REASON, "schedule")
|
|
51655
|
+
},
|
|
51656
|
+
{
|
|
51657
|
+
provider: "gitlab",
|
|
51658
|
+
matches: (env) => isTruthy(env.GITLAB_CI),
|
|
51659
|
+
isScheduler: (env) => env.CI_PIPELINE_SOURCE === "schedule"
|
|
51660
|
+
},
|
|
51661
|
+
{
|
|
51662
|
+
provider: "circleci",
|
|
51663
|
+
matches: (env) => isTruthy(env.CIRCLECI),
|
|
51664
|
+
isScheduler: (env) => env.CIRCLE_PIPELINE_TRIGGER_SOURCE === "scheduled_pipeline"
|
|
51665
|
+
},
|
|
51666
|
+
{
|
|
51667
|
+
provider: "jenkins",
|
|
51668
|
+
matches: (env) => isTruthy(env.JENKINS_URL) || isTruthy(env.JENKINS_HOME)
|
|
51669
|
+
},
|
|
51670
|
+
{
|
|
51671
|
+
provider: "teamcity",
|
|
51672
|
+
matches: (env) => isTruthy(env.TEAMCITY_VERSION)
|
|
51673
|
+
},
|
|
51674
|
+
{
|
|
51675
|
+
provider: "buildkite",
|
|
51676
|
+
matches: (env) => isTruthy(env.BUILDKITE),
|
|
51677
|
+
isScheduler: (env) => env.BUILDKITE_SOURCE === "schedule"
|
|
51678
|
+
},
|
|
51679
|
+
{
|
|
51680
|
+
provider: "bitbucket",
|
|
51681
|
+
matches: (env) => isTruthy(env.BITBUCKET_BUILD_NUMBER)
|
|
51682
|
+
},
|
|
51683
|
+
{
|
|
51684
|
+
provider: "travis",
|
|
51685
|
+
matches: (env) => isTruthy(env.TRAVIS)
|
|
51686
|
+
},
|
|
51687
|
+
{
|
|
51688
|
+
provider: "appveyor",
|
|
51689
|
+
matches: (env) => isTruthy(env.APPVEYOR)
|
|
51690
|
+
},
|
|
51691
|
+
{
|
|
51692
|
+
provider: "generic",
|
|
51693
|
+
matches: (env) => isTruthy(env.CI)
|
|
51694
|
+
}
|
|
51695
|
+
];
|
|
51696
|
+
function currentEnv() {
|
|
51697
|
+
return typeof process === "undefined" ? {} : process.env;
|
|
51698
|
+
}
|
|
51699
|
+
function currentTtyState() {
|
|
51700
|
+
if (typeof process === "undefined")
|
|
51701
|
+
return false;
|
|
51702
|
+
return Boolean(process.stdout?.isTTY || process.stdin?.isTTY || process.stderr?.isTTY);
|
|
51703
|
+
}
|
|
51704
|
+
function detectCi(env) {
|
|
51705
|
+
const signature = CI_SIGNATURES.find((candidate) => candidate.matches(env));
|
|
51706
|
+
if (!signature)
|
|
51707
|
+
return;
|
|
51708
|
+
return {
|
|
51709
|
+
executionContext: signature.isScheduler?.(env) ? "scheduler" : "ci",
|
|
51710
|
+
ciProvider: signature.provider
|
|
51711
|
+
};
|
|
51712
|
+
}
|
|
51713
|
+
function detectExecutionContext(options = {}) {
|
|
51714
|
+
const env = options.env ?? currentEnv();
|
|
51715
|
+
const ci = detectCi(env);
|
|
51716
|
+
if (ci)
|
|
51717
|
+
return ci;
|
|
51718
|
+
const agent = options.agent ?? detectAgentFromEnv(env);
|
|
51719
|
+
if (agent) {
|
|
51720
|
+
return { executionContext: "agent" };
|
|
51721
|
+
}
|
|
51722
|
+
const authSignal = options.authSignal ?? authSignalSlot.get();
|
|
51723
|
+
if (authSignal === "service_account") {
|
|
51724
|
+
return { executionContext: "service_account" };
|
|
51725
|
+
}
|
|
51726
|
+
const isTty = options.isTty ?? currentTtyState();
|
|
51727
|
+
if (isTty) {
|
|
51728
|
+
return { executionContext: "manual" };
|
|
51729
|
+
}
|
|
51730
|
+
return { executionContext: "unknown" };
|
|
51731
|
+
}
|
|
51732
|
+
function getExecutionContextTelemetryProperties() {
|
|
51733
|
+
const detected = detectExecutionContext();
|
|
51734
|
+
return {
|
|
51735
|
+
execution_context: detected.executionContext,
|
|
51736
|
+
...detected.ciProvider ? { ci_provider: detected.ciProvider } : {}
|
|
51737
|
+
};
|
|
51738
|
+
}
|
|
51390
51739
|
// ../common/src/telemetry/node-context-storage.ts
|
|
51391
51740
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
51392
51741
|
|
|
@@ -51399,6 +51748,26 @@ class NodeContextStorage {
|
|
|
51399
51748
|
return this.storage.getStore();
|
|
51400
51749
|
}
|
|
51401
51750
|
}
|
|
51751
|
+
// ../common/src/telemetry/session-id.ts
|
|
51752
|
+
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
51753
|
+
var TELEMETRY_SESSION_ID_PROPERTY = "session_id";
|
|
51754
|
+
var telemetrySessionIdSlot = singleton("TelemetrySessionId");
|
|
51755
|
+
function getProcessEnv() {
|
|
51756
|
+
return globalThis.process?.env;
|
|
51757
|
+
}
|
|
51758
|
+
function normalizeSessionId(value) {
|
|
51759
|
+
if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
|
|
51760
|
+
return;
|
|
51761
|
+
}
|
|
51762
|
+
const trimmed = String(value).trim();
|
|
51763
|
+
return trimmed || undefined;
|
|
51764
|
+
}
|
|
51765
|
+
function getConfiguredTelemetrySessionId() {
|
|
51766
|
+
return normalizeSessionId(getProcessEnv()?.[TELEMETRY_SESSION_ID_ENV]);
|
|
51767
|
+
}
|
|
51768
|
+
function resolveTelemetrySessionId(existingSessionId) {
|
|
51769
|
+
return getConfiguredTelemetrySessionId() ?? normalizeSessionId(existingSessionId);
|
|
51770
|
+
}
|
|
51402
51771
|
// ../common/src/telemetry/global-telemetry-properties.ts
|
|
51403
51772
|
var telemetryPropsSlot = singleton("TelemetryDefaultProps");
|
|
51404
51773
|
function getGlobalTelemetryProperties() {
|
|
@@ -51483,12 +51852,22 @@ class TelemetryService {
|
|
|
51483
51852
|
return this.contextStorage.getContext();
|
|
51484
51853
|
}
|
|
51485
51854
|
enrichPropertiesWithContext(properties, context) {
|
|
51486
|
-
|
|
51487
|
-
|
|
51855
|
+
const globalProperties = getGlobalTelemetryProperties();
|
|
51856
|
+
const existingSessionId = properties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? this.defaultProperties?.[TELEMETRY_SESSION_ID_PROPERTY] ?? globalProperties?.[TELEMETRY_SESSION_ID_PROPERTY];
|
|
51857
|
+
const sessionId = resolveTelemetrySessionId(existingSessionId);
|
|
51858
|
+
const enriched = {
|
|
51859
|
+
...getExecutionContextTelemetryProperties(),
|
|
51860
|
+
...globalProperties,
|
|
51488
51861
|
...this.defaultProperties,
|
|
51489
51862
|
...properties,
|
|
51490
51863
|
...context
|
|
51491
51864
|
};
|
|
51865
|
+
if (sessionId === undefined) {
|
|
51866
|
+
delete enriched[TELEMETRY_SESSION_ID_PROPERTY];
|
|
51867
|
+
} else {
|
|
51868
|
+
enriched[TELEMETRY_SESSION_ID_PROPERTY] = sessionId;
|
|
51869
|
+
}
|
|
51870
|
+
return enriched;
|
|
51492
51871
|
}
|
|
51493
51872
|
generateId() {
|
|
51494
51873
|
return crypto.randomUUID().replaceAll("-", "");
|
|
@@ -51979,8 +52358,24 @@ var OutputFormatter;
|
|
|
51979
52358
|
data.ErrorCode ??= defaultErrorCodeForFailure(data);
|
|
51980
52359
|
data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
|
|
51981
52360
|
process.exitCode = EXIT_CODES[data.Result] ?? 1;
|
|
51982
|
-
|
|
51983
|
-
|
|
52361
|
+
recordCommandFailureTelemetry({
|
|
52362
|
+
result: data.Result,
|
|
52363
|
+
errorCode: data.ErrorCode,
|
|
52364
|
+
retry: data.Retry,
|
|
52365
|
+
message: data.Message,
|
|
52366
|
+
context: data.Context,
|
|
52367
|
+
exitCode: process.exitCode,
|
|
52368
|
+
errorClass: data.TelemetryErrorClass,
|
|
52369
|
+
terminalOutcome: data.TelemetryTerminalOutcome,
|
|
52370
|
+
terminalSignal: data.TelemetryTerminalSignal
|
|
52371
|
+
});
|
|
52372
|
+
const suppressTelemetry = data.SuppressTelemetry === true;
|
|
52373
|
+
const envelope = { ...data };
|
|
52374
|
+
delete envelope.SuppressTelemetry;
|
|
52375
|
+
delete envelope.TelemetryErrorClass;
|
|
52376
|
+
delete envelope.TelemetryTerminalOutcome;
|
|
52377
|
+
delete envelope.TelemetryTerminalSignal;
|
|
52378
|
+
if (!suppressTelemetry) {
|
|
51984
52379
|
telemetry.trackEvent(CommonTelemetryEvents.Error, {
|
|
51985
52380
|
result: data.Result,
|
|
51986
52381
|
errorCode: data.ErrorCode,
|
|
@@ -52043,6 +52438,158 @@ var OutputFormatter;
|
|
|
52043
52438
|
OutputFormatter.formatToString = formatToString;
|
|
52044
52439
|
})(OutputFormatter ||= {});
|
|
52045
52440
|
|
|
52441
|
+
// ../common/src/telemetry/command-attribution.ts
|
|
52442
|
+
var LEGACY_SKILL_NAMESPACE = "uipath:";
|
|
52443
|
+
var MAX_SKILL_NAME_LENGTH = 80;
|
|
52444
|
+
var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
|
|
52445
|
+
function productMode(productArea, mode) {
|
|
52446
|
+
return { product_area: productArea, mode };
|
|
52447
|
+
}
|
|
52448
|
+
function attributionRecord(groups) {
|
|
52449
|
+
const record = {};
|
|
52450
|
+
for (const [productArea, mode, names] of groups) {
|
|
52451
|
+
const attribution = productMode(productArea, mode);
|
|
52452
|
+
for (const name of names) {
|
|
52453
|
+
record[name] = attribution;
|
|
52454
|
+
}
|
|
52455
|
+
}
|
|
52456
|
+
return record;
|
|
52457
|
+
}
|
|
52458
|
+
function commandAttribution(groups) {
|
|
52459
|
+
const entries = [];
|
|
52460
|
+
for (const [productArea, mode, prefixes] of groups) {
|
|
52461
|
+
const attribution = productMode(productArea, mode);
|
|
52462
|
+
for (const prefix of prefixes) {
|
|
52463
|
+
entries.push({ prefix, attribution });
|
|
52464
|
+
}
|
|
52465
|
+
}
|
|
52466
|
+
return entries;
|
|
52467
|
+
}
|
|
52468
|
+
var SKILL_ATTRIBUTION = attributionRecord([
|
|
52469
|
+
["admin", "operate", ["uipath-admin"]],
|
|
52470
|
+
["agents", "build", ["uipath-agents"]],
|
|
52471
|
+
["api-workflow", "build", ["uipath-api-workflow"]],
|
|
52472
|
+
["automation-discovery", "build", ["uipath-automation-discovery"]],
|
|
52473
|
+
["coded-apps", "build", ["uipath-coded-apps"]],
|
|
52474
|
+
["data-fabric", "operate", ["uipath-data-fabric"]],
|
|
52475
|
+
["cli", "troubleshoot", ["uipath-feedback"]],
|
|
52476
|
+
["governance", "operate", ["uipath-governance"]],
|
|
52477
|
+
["action-center", "build", ["uipath-human-in-the-loop"]],
|
|
52478
|
+
["document-understanding", "build", ["uipath-ixp"]],
|
|
52479
|
+
[
|
|
52480
|
+
"maestro",
|
|
52481
|
+
"build",
|
|
52482
|
+
["uipath-maestro-bpmn", "uipath-maestro-case", "uipath-maestro-flow"]
|
|
52483
|
+
],
|
|
52484
|
+
["agenthub", "build", ["uipath-mcp-servers"]],
|
|
52485
|
+
["solution", "build", ["uipath-planner", "uipath-solution"]],
|
|
52486
|
+
["platform", "operate", ["uipath-platform"]],
|
|
52487
|
+
["quality", "troubleshoot", ["uipath-review"]],
|
|
52488
|
+
["rpa", "build", ["uipath-rpa"]],
|
|
52489
|
+
["cli", "operate", ["uipath-skill-catalog"]],
|
|
52490
|
+
["action-center", "operate", ["uipath-tasks"]],
|
|
52491
|
+
["test-manager", "operate", ["uipath-test"]],
|
|
52492
|
+
["platform", "troubleshoot", ["uipath-troubleshoot"]]
|
|
52493
|
+
]);
|
|
52494
|
+
var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
|
|
52495
|
+
var COMMAND_ATTRIBUTION = commandAttribution([
|
|
52496
|
+
["cli", "troubleshoot", ["uip.feedback"]],
|
|
52497
|
+
["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
|
|
52498
|
+
["context-grounding", "build", ["uip.context-grounding"]],
|
|
52499
|
+
["api-workflow", "build", ["uip.api-workflow"]],
|
|
52500
|
+
["rpa", "build", ["uip.rpa-legacy"]],
|
|
52501
|
+
["conversational", "operate", ["uip.conversational"]],
|
|
52502
|
+
["agents", "build", ["uip.codedagent", "uip.agent"]],
|
|
52503
|
+
["agenthub", "build", ["uip.agenthub"]],
|
|
52504
|
+
["coded-apps", "build", ["uip.codedapp"]],
|
|
52505
|
+
["functions", "build", ["uip.functions"]],
|
|
52506
|
+
["solution", "build", ["uip.solution"]],
|
|
52507
|
+
["maestro", "build", ["uip.maestro", "uip.case", "uip.flow"]],
|
|
52508
|
+
["llm-observability", "troubleshoot", ["uip.traces"]],
|
|
52509
|
+
["platform", "operate", ["uip.platform"]],
|
|
52510
|
+
["admin", "operate", ["uip.admin"]],
|
|
52511
|
+
["automation-ops", "operate", ["uip.aops"]],
|
|
52512
|
+
["documentation", "troubleshoot", ["uip.docsai"]],
|
|
52513
|
+
["governance", "operate", ["uip.gov"]],
|
|
52514
|
+
["insights", "operate", ["uip.insights"]],
|
|
52515
|
+
["document-understanding", "build", ["uip.ixp"]],
|
|
52516
|
+
["process-mining", "operate", ["uip.pm"]],
|
|
52517
|
+
["action-center", "operate", ["uip.tasks"]],
|
|
52518
|
+
["test-manager", "operate", ["uip.tm"]],
|
|
52519
|
+
["vertical-solutions", "build", ["uip.vss"]],
|
|
52520
|
+
["data-fabric", "operate", ["uip.df"]],
|
|
52521
|
+
["integration-service", "build", ["uip.is"]],
|
|
52522
|
+
["orchestrator", "operate", ["uip.or"]],
|
|
52523
|
+
[
|
|
52524
|
+
"cli",
|
|
52525
|
+
"operate",
|
|
52526
|
+
[
|
|
52527
|
+
"uip.login",
|
|
52528
|
+
"uip.logout",
|
|
52529
|
+
"uip.user",
|
|
52530
|
+
"uip.config",
|
|
52531
|
+
"uip.tools",
|
|
52532
|
+
"uip.skills",
|
|
52533
|
+
"uip.completion",
|
|
52534
|
+
"uip.update",
|
|
52535
|
+
"uip.mcp",
|
|
52536
|
+
"uip.track"
|
|
52537
|
+
]
|
|
52538
|
+
]
|
|
52539
|
+
]).sort((a, b) => b.prefix.length - a.prefix.length);
|
|
52540
|
+
function normalizeCommandPath(value) {
|
|
52541
|
+
if (typeof value !== "string") {
|
|
52542
|
+
return;
|
|
52543
|
+
}
|
|
52544
|
+
const trimmed = value.trim().toLowerCase();
|
|
52545
|
+
if (!trimmed) {
|
|
52546
|
+
return;
|
|
52547
|
+
}
|
|
52548
|
+
const tokens = trimmed.includes(" ") ? trimmed.split(/\s+/).filter((token) => token.length > 0).filter((token) => !token.startsWith("-")) : trimmed.split(".").filter((token) => token.length > 0);
|
|
52549
|
+
if (tokens.length === 0) {
|
|
52550
|
+
return;
|
|
52551
|
+
}
|
|
52552
|
+
const commandTokens = tokens[0] === "uip" ? tokens : ["uip", ...tokens];
|
|
52553
|
+
return commandTokens.join(".");
|
|
52554
|
+
}
|
|
52555
|
+
function getCommandProductModeAttribution(commandPath) {
|
|
52556
|
+
const normalized = normalizeCommandPath(commandPath);
|
|
52557
|
+
if (!normalized) {
|
|
52558
|
+
return;
|
|
52559
|
+
}
|
|
52560
|
+
return COMMAND_ATTRIBUTION.find(({ prefix }) => normalized === prefix || normalized.startsWith(`${prefix}.`))?.attribution;
|
|
52561
|
+
}
|
|
52562
|
+
function normalizeSkillNameWithOptions(value, options) {
|
|
52563
|
+
if (typeof value !== "string") {
|
|
52564
|
+
return;
|
|
52565
|
+
}
|
|
52566
|
+
const normalized = value.trim().toLowerCase();
|
|
52567
|
+
if (!normalized) {
|
|
52568
|
+
return;
|
|
52569
|
+
}
|
|
52570
|
+
const hasLegacyNamespace = normalized.startsWith(LEGACY_SKILL_NAMESPACE);
|
|
52571
|
+
if (hasLegacyNamespace && !options.allowLegacyNamespace) {
|
|
52572
|
+
return;
|
|
52573
|
+
}
|
|
52574
|
+
const skillName = hasLegacyNamespace ? normalized.slice(LEGACY_SKILL_NAMESPACE.length) : normalized;
|
|
52575
|
+
if (skillName.length > MAX_SKILL_NAME_LENGTH || !SKILL_NAME_PATTERN.test(skillName) || !KNOWN_SKILL_NAMES.has(skillName)) {
|
|
52576
|
+
return;
|
|
52577
|
+
}
|
|
52578
|
+
return skillName;
|
|
52579
|
+
}
|
|
52580
|
+
function normalizeSkillName(value) {
|
|
52581
|
+
return normalizeSkillNameWithOptions(value, {
|
|
52582
|
+
allowLegacyNamespace: false
|
|
52583
|
+
});
|
|
52584
|
+
}
|
|
52585
|
+
function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
52586
|
+
const skillName = normalizeSkillName(skillSource);
|
|
52587
|
+
return {
|
|
52588
|
+
...skillName ? { skill_name: skillName } : {},
|
|
52589
|
+
...getCommandProductModeAttribution(commandPath)
|
|
52590
|
+
};
|
|
52591
|
+
}
|
|
52592
|
+
|
|
52046
52593
|
// ../common/src/telemetry/pii-redactor.ts
|
|
52047
52594
|
var REDACTED = "[REDACTED]";
|
|
52048
52595
|
var MAX_VALUE_LENGTH = 200;
|
|
@@ -52228,6 +52775,12 @@ function commandHelpHint(commandPath) {
|
|
|
52228
52775
|
const command = commandPath.replace(/\./g, " ");
|
|
52229
52776
|
return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
|
|
52230
52777
|
}
|
|
52778
|
+
function isPromptCancellation(error) {
|
|
52779
|
+
return error instanceof Error && error.name === "ExitPromptError";
|
|
52780
|
+
}
|
|
52781
|
+
function exitCodeFromProcess(fallback) {
|
|
52782
|
+
return typeof process.exitCode === "number" ? process.exitCode : fallback;
|
|
52783
|
+
}
|
|
52231
52784
|
Command.prototype.trackedAction = function(context, fn, properties) {
|
|
52232
52785
|
const command = this;
|
|
52233
52786
|
return this.action(async (...args) => {
|
|
@@ -52235,6 +52788,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
52235
52788
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
52236
52789
|
const startTime = performance.now();
|
|
52237
52790
|
let errorMessage2;
|
|
52791
|
+
let fallbackExitCode = EXIT_CODES.Success;
|
|
52792
|
+
clearRecordedCommandFailureTelemetry();
|
|
52238
52793
|
const [error] = await catchError2(fn(...args));
|
|
52239
52794
|
if (error) {
|
|
52240
52795
|
errorMessage2 = error instanceof Error ? error.message : String(error);
|
|
@@ -52249,6 +52804,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
52249
52804
|
const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
|
|
52250
52805
|
const typedContext = typed.context ?? typed.Context;
|
|
52251
52806
|
const customContext = isErrorContext(typedContext) ? typedContext : undefined;
|
|
52807
|
+
const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
|
|
52808
|
+
fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
|
|
52252
52809
|
OutputFormatter.error({
|
|
52253
52810
|
Result: finalResult,
|
|
52254
52811
|
...customErrorCode ? { ErrorCode: customErrorCode } : {},
|
|
@@ -52257,16 +52814,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
52257
52814
|
...customRetry ? { Retry: customRetry } : {},
|
|
52258
52815
|
...customContext ? { Context: customContext } : {}
|
|
52259
52816
|
});
|
|
52260
|
-
context.exit(
|
|
52817
|
+
context.exit(fallbackExitCode);
|
|
52261
52818
|
}
|
|
52262
52819
|
const durationMs = performance.now() - startTime;
|
|
52263
|
-
const
|
|
52820
|
+
const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
|
|
52821
|
+
const recordedFailure = takeRecordedCommandFailureTelemetry();
|
|
52822
|
+
const success = !error && exitCode === 0;
|
|
52823
|
+
const terminalTelemetry = buildCommandTerminalTelemetryProperties({
|
|
52824
|
+
error,
|
|
52825
|
+
exitCode,
|
|
52826
|
+
recordedFailure,
|
|
52827
|
+
pollSignal: context.pollSignal
|
|
52828
|
+
});
|
|
52264
52829
|
telemetry.trackEvent(telemetryName, redactProperties({
|
|
52265
52830
|
...extractCommandParams(command),
|
|
52266
52831
|
...props,
|
|
52832
|
+
...buildCommandTelemetryAttribution(telemetryName, process.env.UIPATH_SKILL),
|
|
52267
52833
|
command: "true",
|
|
52268
52834
|
duration: String(durationMs),
|
|
52269
52835
|
success: String(success),
|
|
52836
|
+
...terminalTelemetry,
|
|
52270
52837
|
...errorMessage2 ? { errorMessage: errorMessage2 } : {}
|
|
52271
52838
|
}));
|
|
52272
52839
|
});
|
|
@@ -52406,6 +52973,8 @@ function installRequestHeaderForwarding(BaseApiClass, patchKey, forward) {
|
|
|
52406
52973
|
function installSdkUserAgentHeader(BaseApiClass, userAgent) {
|
|
52407
52974
|
installRequestHeaderForwarding(BaseApiClass, userAgentPatchKey(userAgent), (headers) => addSdkUserAgentHeader(headers, userAgent));
|
|
52408
52975
|
}
|
|
52976
|
+
// ../common/src/telemetry/ship-succeeded.ts
|
|
52977
|
+
var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
|
|
52409
52978
|
// ../common/src/tool-provider.ts
|
|
52410
52979
|
var factorySlot = singleton("PackagerFactoryProvider");
|
|
52411
52980
|
// src/utils/product-codes.ts
|
|
@@ -55060,4 +55629,4 @@ export {
|
|
|
55060
55629
|
metadata
|
|
55061
55630
|
};
|
|
55062
55631
|
|
|
55063
|
-
//# debugId=
|
|
55632
|
+
//# debugId=847953C4FABBCACA64756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/platform-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.197.0-preview.
|
|
4
|
+
"version": "1.197.0-preview.66",
|
|
5
5
|
"description": "Manage UiPath platform-level resources such as tenant licensing.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/tool.js",
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"publishConfig": {
|
|
21
21
|
"registry": "https://registry.npmjs.org/"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "386b0837882b19062bf744c74949cdf9c5e48dea"
|
|
24
24
|
}
|