@uipath/tasks-tool 1.203.0-preview.205 → 1.204.0-preview.206
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/{folder-picker-interactive-g7r2c8ct.js → folder-picker-interactive-gmbtq8na.js} +2 -2
- package/dist/{folder-resolver-v3hx6eqb.js → folder-resolver-xyd1pa57.js} +2 -2
- package/dist/index.js +2 -2
- package/dist/{tool-pbamehqj.js → tool-cfbjw574.js} +584 -96
- package/dist/{tool-6ykqbeks.js → tool-egmxm08f.js} +260 -4
- package/dist/{tool-kmcmj3jt.js → tool-qkz03qyt.js} +8 -8
- package/dist/tool.js +2 -2
- package/package.json +2 -2
|
@@ -2634,9 +2634,60 @@ function settlePromiseLike(thenable) {
|
|
|
2634
2634
|
return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [toError(error), undefined]);
|
|
2635
2635
|
}
|
|
2636
2636
|
|
|
2637
|
+
// ../common/src/error-graph.ts
|
|
2638
|
+
function* walkErrorGraph(error) {
|
|
2639
|
+
const queue = [error];
|
|
2640
|
+
const seen = new Set;
|
|
2641
|
+
for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
|
|
2642
|
+
const current = queue.shift();
|
|
2643
|
+
if (current === null || typeof current !== "object")
|
|
2644
|
+
continue;
|
|
2645
|
+
if (seen.has(current))
|
|
2646
|
+
continue;
|
|
2647
|
+
seen.add(current);
|
|
2648
|
+
const cur = current;
|
|
2649
|
+
yield cur;
|
|
2650
|
+
if (cur.cause !== undefined)
|
|
2651
|
+
queue.push(cur.cause);
|
|
2652
|
+
if (Array.isArray(cur.errors))
|
|
2653
|
+
queue.push(...cur.errors);
|
|
2654
|
+
}
|
|
2655
|
+
return;
|
|
2656
|
+
}
|
|
2657
|
+
function parseHttpStatusFromMessage(message) {
|
|
2658
|
+
const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
|
|
2659
|
+
if (!match)
|
|
2660
|
+
return;
|
|
2661
|
+
const status = Number(match[1]);
|
|
2662
|
+
return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
|
|
2663
|
+
}
|
|
2664
|
+
function findHttpStatusInGraph(error) {
|
|
2665
|
+
for (const node of walkErrorGraph(error)) {
|
|
2666
|
+
const response = node.response;
|
|
2667
|
+
const explicit = typeof node.status === "number" ? node.status : response?.status;
|
|
2668
|
+
if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
|
|
2669
|
+
return explicit;
|
|
2670
|
+
}
|
|
2671
|
+
if (typeof node.message === "string") {
|
|
2672
|
+
const parsed = parseHttpStatusFromMessage(node.message);
|
|
2673
|
+
if (parsed !== undefined && parsed >= 400) {
|
|
2674
|
+
return parsed;
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
}
|
|
2678
|
+
return;
|
|
2679
|
+
}
|
|
2680
|
+
|
|
2681
|
+
// ../common/src/local-permission-codes.ts
|
|
2682
|
+
var LOCAL_PERMISSION_ERROR_CODES = new Set([
|
|
2683
|
+
"EACCES",
|
|
2684
|
+
"EPERM",
|
|
2685
|
+
"EROFS"
|
|
2686
|
+
]);
|
|
2687
|
+
|
|
2637
2688
|
// ../common/src/error-handler.ts
|
|
2638
|
-
var DEFAULT_401 = "Unauthorized (401). Run `uip login` to
|
|
2639
|
-
var DEFAULT_403 = "Forbidden (403).
|
|
2689
|
+
var DEFAULT_401 = "Unauthorized (401). The session is missing or expired, or its token carries no scope for this API. Run `uip login status --detailed` to see the session and its scopes.";
|
|
2690
|
+
var DEFAULT_403 = "Forbidden (403). The account lacks permission for this operation, or the token carries no scope for this API. Run `uip login status --detailed` to see the token's scopes.";
|
|
2640
2691
|
var DEFAULT_405 = "Method Not Allowed (405). The endpoint may not exist or the base URL may be incorrect.";
|
|
2641
2692
|
var DEFAULT_413 = "Payload too large (413). The upload exceeded the server or CDN size limit. Reduce the package size — for example, exclude unused dependencies or remove large files from the project — and try again.";
|
|
2642
2693
|
var HTML_RESPONSE_MESSAGE = "Received HTML instead of the expected JSON response.";
|
|
@@ -2663,14 +2714,14 @@ var TLS_ERROR_CODES = new Set([
|
|
|
2663
2714
|
]);
|
|
2664
2715
|
var TLS_INSTRUCTIONS = "The server's TLS certificate could not be verified. Most often a " + "corporate proxy/firewall re-signs HTTPS with a root CA that Node does " + "not trust — set NODE_EXTRA_CA_CERTS to that CA's PEM file (and HTTPS_PROXY " + "if you connect through a proxy). If the certificate is instead expired or " + "its hostname does not match, fix the endpoint URL or the system clock. " + "Then retry.";
|
|
2665
2716
|
var NETWORK_INSTRUCTIONS = "Could not reach the UiPath service. Check your network connection and " + "VPN, confirm any HTTP_PROXY/HTTPS_PROXY/NO_PROXY settings are correct, " + "then retry.";
|
|
2666
|
-
var
|
|
2667
|
-
var LOCAL_PERMISSION_MESSAGE_PATTERN = /\b(EACCES|EPERM|EROFS)\b/;
|
|
2717
|
+
var LOCAL_PERMISSION_MESSAGE_PATTERN = new RegExp(`\\b(${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})\\b`);
|
|
2668
2718
|
function localPermissionInstructions(code, path) {
|
|
2669
2719
|
const target = path !== undefined ? `'${path}'` : "a local file or resource";
|
|
2670
2720
|
if (code === "EROFS") {
|
|
2671
2721
|
return `The filesystem containing ${target} is read-only (EROFS), so the ` + "CLI could not write to it. This is a local environment problem, " + "not a UiPath service error — retrying will not help. Use a " + "writable location, or give this environment write access to the " + "path.";
|
|
2672
2722
|
}
|
|
2673
|
-
const
|
|
2723
|
+
const onWindows = typeof process !== "undefined" && process.platform === "win32";
|
|
2724
|
+
const remedy = onWindows ? "Re-run from an elevated terminal, close any program holding " + "the file open, or grant your user access to the path." : "Grant this user (or the sandbox the command runs in) access " + "to the path, or run the command outside the sandbox.";
|
|
2674
2725
|
return `The operating system denied access to ${target} (${code}). This is ` + "a local permission problem, not a UiPath service error — retrying " + `without a permission change will not help. ${remedy}`;
|
|
2675
2726
|
}
|
|
2676
2727
|
function describeConnectivityError(error) {
|
|
@@ -2724,48 +2775,6 @@ function localPermissionPath(path, message) {
|
|
|
2724
2775
|
return path;
|
|
2725
2776
|
return message ? /'([^']+)'/.exec(message)?.[1] : undefined;
|
|
2726
2777
|
}
|
|
2727
|
-
function* walkErrorGraph(error) {
|
|
2728
|
-
const queue = [error];
|
|
2729
|
-
const seen = new Set;
|
|
2730
|
-
for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
|
|
2731
|
-
const current = queue.shift();
|
|
2732
|
-
if (current === null || typeof current !== "object")
|
|
2733
|
-
continue;
|
|
2734
|
-
if (seen.has(current))
|
|
2735
|
-
continue;
|
|
2736
|
-
seen.add(current);
|
|
2737
|
-
const cur = current;
|
|
2738
|
-
yield cur;
|
|
2739
|
-
if (cur.cause !== undefined)
|
|
2740
|
-
queue.push(cur.cause);
|
|
2741
|
-
if (Array.isArray(cur.errors))
|
|
2742
|
-
queue.push(...cur.errors);
|
|
2743
|
-
}
|
|
2744
|
-
return;
|
|
2745
|
-
}
|
|
2746
|
-
function parseHttpStatusFromMessage(message) {
|
|
2747
|
-
const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
|
|
2748
|
-
if (!match)
|
|
2749
|
-
return;
|
|
2750
|
-
const status = Number(match[1]);
|
|
2751
|
-
return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
|
|
2752
|
-
}
|
|
2753
|
-
function findHttpStatusInGraph(error) {
|
|
2754
|
-
for (const node of walkErrorGraph(error)) {
|
|
2755
|
-
const response = node.response;
|
|
2756
|
-
const explicit = typeof node.status === "number" ? node.status : response?.status;
|
|
2757
|
-
if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
|
|
2758
|
-
return explicit;
|
|
2759
|
-
}
|
|
2760
|
-
if (typeof node.message === "string") {
|
|
2761
|
-
const parsed = parseHttpStatusFromMessage(node.message);
|
|
2762
|
-
if (parsed !== undefined && parsed >= 400) {
|
|
2763
|
-
return parsed;
|
|
2764
|
-
}
|
|
2765
|
-
}
|
|
2766
|
-
}
|
|
2767
|
-
return;
|
|
2768
|
-
}
|
|
2769
2778
|
function isHtmlDocument(body) {
|
|
2770
2779
|
return /^\s*(<!doctype html|<html\b)/i.test(body);
|
|
2771
2780
|
}
|
|
@@ -3532,12 +3541,162 @@ function getOutputFilter() {
|
|
|
3532
3541
|
return filterSlot.get();
|
|
3533
3542
|
}
|
|
3534
3543
|
|
|
3544
|
+
// ../common/src/telemetry/telemetry-dimensions.ts
|
|
3545
|
+
var BaseDimensions = {
|
|
3546
|
+
ApplicationName: "ApplicationName",
|
|
3547
|
+
ProductVersion: "ProductVersion",
|
|
3548
|
+
InstallationId: "InstallationId",
|
|
3549
|
+
CloudUserId: "CloudUserId",
|
|
3550
|
+
CloudTenantId: "CloudTenantId",
|
|
3551
|
+
CloudOrganizationId: "CloudOrganizationId",
|
|
3552
|
+
IsInternalUser: "IsInternalUser",
|
|
3553
|
+
Environment: "Environment",
|
|
3554
|
+
BaseUrl: "BaseUrl",
|
|
3555
|
+
Region: "Region",
|
|
3556
|
+
Agent: "Agent",
|
|
3557
|
+
AgentVersion: "AgentVersion",
|
|
3558
|
+
AgentModel: "AgentModel",
|
|
3559
|
+
ToolName: "ToolName",
|
|
3560
|
+
ToolVersion: "ToolVersion",
|
|
3561
|
+
ExecutionContext: "ExecutionContext",
|
|
3562
|
+
CiProvider: "CiProvider",
|
|
3563
|
+
SessionIdSource: "SessionIdSource",
|
|
3564
|
+
SessionId: "SessionId"
|
|
3565
|
+
};
|
|
3566
|
+
var CommandDimensions = {
|
|
3567
|
+
IsCommand: "IsCommand",
|
|
3568
|
+
IsReexec: "IsReexec",
|
|
3569
|
+
CommandName: "CommandName",
|
|
3570
|
+
ExitCode: "ExitCode",
|
|
3571
|
+
TerminalOutcome: "TerminalOutcome",
|
|
3572
|
+
ErrorClass: "ErrorClass",
|
|
3573
|
+
TerminalSignal: "TerminalSignal",
|
|
3574
|
+
ErrorMessage: "ErrorMessage",
|
|
3575
|
+
SkillName: "SkillName",
|
|
3576
|
+
ProductArea: "ProductArea",
|
|
3577
|
+
Mode: "Mode"
|
|
3578
|
+
};
|
|
3579
|
+
var ShipDimensions = {
|
|
3580
|
+
ShipKind: "ShipKind",
|
|
3581
|
+
Target: "Target",
|
|
3582
|
+
ProjectType: "ProjectType",
|
|
3583
|
+
ProjectTypes: "ProjectTypes",
|
|
3584
|
+
ArtifactCorrelationKey: "ArtifactCorrelationKey",
|
|
3585
|
+
PackageName: "PackageName",
|
|
3586
|
+
PackageVersion: "PackageVersion",
|
|
3587
|
+
PackageVersionKey: "PackageVersionKey",
|
|
3588
|
+
DeploymentKey: "DeploymentKey",
|
|
3589
|
+
SolutionId: "SolutionId",
|
|
3590
|
+
FolderKey: "FolderKey",
|
|
3591
|
+
FeedId: "FeedId"
|
|
3592
|
+
};
|
|
3593
|
+
var ErrorDimensions = {
|
|
3594
|
+
Result: "Result",
|
|
3595
|
+
ErrorCode: "ErrorCode",
|
|
3596
|
+
Retry: "Retry",
|
|
3597
|
+
ErrorMessage: "ErrorMessage"
|
|
3598
|
+
};
|
|
3599
|
+
var AuthDimensions = {
|
|
3600
|
+
AuthenticationMethod: "AuthenticationMethod",
|
|
3601
|
+
Success: "Success",
|
|
3602
|
+
Reason: "Reason"
|
|
3603
|
+
};
|
|
3604
|
+
var SkillsDimensions = {
|
|
3605
|
+
SchemaVersion: "SchemaVersion",
|
|
3606
|
+
AgentType: "AgentType",
|
|
3607
|
+
SkillsVersion: "SkillsVersion",
|
|
3608
|
+
UipSubcommand: "UipSubcommand",
|
|
3609
|
+
FileExtension: "FileExtension",
|
|
3610
|
+
SubagentModel: "SubagentModel",
|
|
3611
|
+
SubagentType: "SubagentType",
|
|
3612
|
+
PermissionMode: "PermissionMode",
|
|
3613
|
+
EffortLevel: "EffortLevel",
|
|
3614
|
+
SessionSource: "SessionSource",
|
|
3615
|
+
Outcome: "Outcome",
|
|
3616
|
+
DurationMs: "DurationMs",
|
|
3617
|
+
Source: "Source"
|
|
3618
|
+
};
|
|
3619
|
+
var PackagerDimensions = {
|
|
3620
|
+
ProjectId: "ProjectId",
|
|
3621
|
+
ProjectType: "ProjectType",
|
|
3622
|
+
SolutionId: "SolutionId"
|
|
3623
|
+
};
|
|
3624
|
+
var ScopeDimensions = {
|
|
3625
|
+
FolderId: "FolderId"
|
|
3626
|
+
};
|
|
3627
|
+
var ID_DIMENSIONS = new Set([
|
|
3628
|
+
BaseDimensions.CloudUserId,
|
|
3629
|
+
BaseDimensions.CloudTenantId,
|
|
3630
|
+
BaseDimensions.CloudOrganizationId,
|
|
3631
|
+
BaseDimensions.InstallationId,
|
|
3632
|
+
ShipDimensions.ArtifactCorrelationKey,
|
|
3633
|
+
ShipDimensions.PackageVersionKey,
|
|
3634
|
+
ShipDimensions.DeploymentKey,
|
|
3635
|
+
ShipDimensions.SolutionId,
|
|
3636
|
+
ShipDimensions.FolderKey,
|
|
3637
|
+
ShipDimensions.FeedId,
|
|
3638
|
+
PackagerDimensions.ProjectId
|
|
3639
|
+
]);
|
|
3640
|
+
var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
|
|
3641
|
+
var RESERVED_DIMENSION_NAMES = new Set([
|
|
3642
|
+
...Object.values(BaseDimensions),
|
|
3643
|
+
...Object.values(CommandDimensions),
|
|
3644
|
+
...Object.values(ShipDimensions),
|
|
3645
|
+
...Object.values(ErrorDimensions),
|
|
3646
|
+
...Object.values(AuthDimensions),
|
|
3647
|
+
...Object.values(SkillsDimensions),
|
|
3648
|
+
...Object.values(PackagerDimensions),
|
|
3649
|
+
...Object.values(ScopeDimensions)
|
|
3650
|
+
]);
|
|
3651
|
+
var CURATED_DIMENSIONS = new Set([
|
|
3652
|
+
BaseDimensions.ApplicationName,
|
|
3653
|
+
BaseDimensions.ProductVersion,
|
|
3654
|
+
BaseDimensions.InstallationId,
|
|
3655
|
+
BaseDimensions.CloudUserId,
|
|
3656
|
+
BaseDimensions.CloudTenantId,
|
|
3657
|
+
BaseDimensions.CloudOrganizationId,
|
|
3658
|
+
BaseDimensions.IsInternalUser,
|
|
3659
|
+
BaseDimensions.Environment,
|
|
3660
|
+
BaseDimensions.BaseUrl,
|
|
3661
|
+
BaseDimensions.Region,
|
|
3662
|
+
BaseDimensions.Agent,
|
|
3663
|
+
BaseDimensions.AgentVersion,
|
|
3664
|
+
BaseDimensions.ToolVersion,
|
|
3665
|
+
BaseDimensions.ExecutionContext,
|
|
3666
|
+
BaseDimensions.CiProvider,
|
|
3667
|
+
BaseDimensions.SessionIdSource,
|
|
3668
|
+
BaseDimensions.SessionId,
|
|
3669
|
+
...Object.values(CommandDimensions),
|
|
3670
|
+
...Object.values(ShipDimensions)
|
|
3671
|
+
]);
|
|
3672
|
+
function lowercaseIdDimensionValues(properties) {
|
|
3673
|
+
let changed = false;
|
|
3674
|
+
const result = {
|
|
3675
|
+
...properties
|
|
3676
|
+
};
|
|
3677
|
+
for (const key of Object.keys(result)) {
|
|
3678
|
+
const value = result[key];
|
|
3679
|
+
if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
|
|
3680
|
+
continue;
|
|
3681
|
+
}
|
|
3682
|
+
const lowered = value.toLowerCase();
|
|
3683
|
+
if (lowered !== value) {
|
|
3684
|
+
result[key] = lowered;
|
|
3685
|
+
changed = true;
|
|
3686
|
+
}
|
|
3687
|
+
}
|
|
3688
|
+
return changed ? result : properties;
|
|
3689
|
+
}
|
|
3690
|
+
|
|
3535
3691
|
// ../common/src/telemetry/command-terminal.ts
|
|
3536
3692
|
var recordedFailureSlot = singleton("CommandTelemetryFailure");
|
|
3537
3693
|
var AUTH_ERROR_CODES = new Set([
|
|
3538
3694
|
"authentication_required",
|
|
3539
3695
|
"permission_denied"
|
|
3540
3696
|
]);
|
|
3697
|
+
var LOCAL_PERMISSION_CLI_ERROR_CODES = new Set([
|
|
3698
|
+
"local_permission_denied"
|
|
3699
|
+
]);
|
|
3541
3700
|
var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
|
|
3542
3701
|
var NETWORK_HTTP_ERROR_CODES = new Set([
|
|
3543
3702
|
"network_error",
|
|
@@ -3678,6 +3837,9 @@ function classifyFromErrorCode(errorCode) {
|
|
|
3678
3837
|
if (AUTH_ERROR_CODES.has(errorCode)) {
|
|
3679
3838
|
return "auth";
|
|
3680
3839
|
}
|
|
3840
|
+
if (LOCAL_PERMISSION_CLI_ERROR_CODES.has(errorCode)) {
|
|
3841
|
+
return "local_permission";
|
|
3842
|
+
}
|
|
3681
3843
|
if (VALIDATION_ERROR_CODES.has(errorCode)) {
|
|
3682
3844
|
return "validation";
|
|
3683
3845
|
}
|
|
@@ -3689,6 +3851,15 @@ function classifyFromErrorCode(errorCode) {
|
|
|
3689
3851
|
}
|
|
3690
3852
|
return;
|
|
3691
3853
|
}
|
|
3854
|
+
function hasLocalPermissionCode(error) {
|
|
3855
|
+
for (const node of walkErrorGraph(error)) {
|
|
3856
|
+
const code = node.code;
|
|
3857
|
+
if (typeof code === "string" && LOCAL_PERMISSION_ERROR_CODES.has(code)) {
|
|
3858
|
+
return true;
|
|
3859
|
+
}
|
|
3860
|
+
}
|
|
3861
|
+
return false;
|
|
3862
|
+
}
|
|
3692
3863
|
function classifyFromError(error) {
|
|
3693
3864
|
const code = findCodeInCauseChain(error);
|
|
3694
3865
|
if (code) {
|
|
@@ -3705,6 +3876,9 @@ function classifyFromError(error) {
|
|
|
3705
3876
|
return "missing_dependency";
|
|
3706
3877
|
}
|
|
3707
3878
|
}
|
|
3879
|
+
if (hasLocalPermissionCode(error)) {
|
|
3880
|
+
return "local_permission";
|
|
3881
|
+
}
|
|
3708
3882
|
const message = stringField(error, "message");
|
|
3709
3883
|
if (message?.includes("fetch failed") === true) {
|
|
3710
3884
|
return "network_http";
|
|
@@ -3720,7 +3894,7 @@ function classifyError2(input) {
|
|
|
3720
3894
|
if (recorded?.errorClass) {
|
|
3721
3895
|
return recorded.errorClass;
|
|
3722
3896
|
}
|
|
3723
|
-
const status = recorded?.context?.httpStatus;
|
|
3897
|
+
const status = recorded?.context?.httpStatus ?? findHttpStatusInGraph(input.error);
|
|
3724
3898
|
if (status !== undefined) {
|
|
3725
3899
|
return classifyHttpStatus(status);
|
|
3726
3900
|
}
|
|
@@ -3743,17 +3917,18 @@ function buildCommandTerminalTelemetryProperties(input) {
|
|
|
3743
3917
|
const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError2(input);
|
|
3744
3918
|
const terminalSignal = terminalSignalFor(input, outcome);
|
|
3745
3919
|
return {
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
...errorClass ? {
|
|
3749
|
-
...terminalSignal ? {
|
|
3920
|
+
[CommandDimensions.ExitCode]: input.exitCode,
|
|
3921
|
+
[CommandDimensions.TerminalOutcome]: outcome,
|
|
3922
|
+
...errorClass ? { [CommandDimensions.ErrorClass]: errorClass } : {},
|
|
3923
|
+
...terminalSignal ? { [CommandDimensions.TerminalSignal]: terminalSignal } : {}
|
|
3750
3924
|
};
|
|
3751
3925
|
}
|
|
3752
3926
|
|
|
3753
3927
|
// ../common/src/telemetry/telemetry-events.ts
|
|
3754
3928
|
var CommonTelemetryEvents = {
|
|
3755
|
-
|
|
3756
|
-
|
|
3929
|
+
Start: "Application.Start",
|
|
3930
|
+
Error: "Application.Error",
|
|
3931
|
+
ShipSucceeded: "Cli.ShipSucceeded"
|
|
3757
3932
|
};
|
|
3758
3933
|
|
|
3759
3934
|
// ../common/src/registry.ts
|
|
@@ -3961,8 +4136,8 @@ function detectExecutionContext(options = {}) {
|
|
|
3961
4136
|
function getExecutionContextTelemetryProperties() {
|
|
3962
4137
|
const detected = detectExecutionContext();
|
|
3963
4138
|
return {
|
|
3964
|
-
|
|
3965
|
-
...detected.ciProvider ? {
|
|
4139
|
+
[BaseDimensions.ExecutionContext]: detected.executionContext,
|
|
4140
|
+
...detected.ciProvider ? { [BaseDimensions.CiProvider]: detected.ciProvider } : {}
|
|
3966
4141
|
};
|
|
3967
4142
|
}
|
|
3968
4143
|
// ../common/src/telemetry/node-context-storage.ts
|
|
@@ -4005,7 +4180,7 @@ function getInboundTraceContext() {
|
|
|
4005
4180
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
4006
4181
|
var SESSION_ID_MAX_LENGTH = 64;
|
|
4007
4182
|
var RANDOM_SESSION_ID_LENGTH = 32;
|
|
4008
|
-
var TELEMETRY_SESSION_SOURCE_PROPERTY = "
|
|
4183
|
+
var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
|
|
4009
4184
|
var CONTROL_CHARACTERS = /\p{Cc}/gu;
|
|
4010
4185
|
var INHERITED_SESSION_SOURCES = [
|
|
4011
4186
|
{ envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
|
|
@@ -4057,6 +4232,9 @@ function resolveTelemetrySession() {
|
|
|
4057
4232
|
telemetrySessionSlot.set(resolved);
|
|
4058
4233
|
return resolved;
|
|
4059
4234
|
}
|
|
4235
|
+
function getTelemetrySessionId() {
|
|
4236
|
+
return resolveTelemetrySession().id;
|
|
4237
|
+
}
|
|
4060
4238
|
function getTelemetrySessionSource() {
|
|
4061
4239
|
return resolveTelemetrySession().source;
|
|
4062
4240
|
}
|
|
@@ -4137,7 +4315,10 @@ class TelemetryService {
|
|
|
4137
4315
|
} catch (error) {
|
|
4138
4316
|
const durationMs = clock.elapsedMs();
|
|
4139
4317
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
4140
|
-
await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, {
|
|
4318
|
+
await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, {
|
|
4319
|
+
...properties,
|
|
4320
|
+
[CommandDimensions.ErrorMessage]: err.message
|
|
4321
|
+
}, context));
|
|
4141
4322
|
throw error;
|
|
4142
4323
|
}
|
|
4143
4324
|
}
|
|
@@ -4208,7 +4389,10 @@ class TelemetryService {
|
|
|
4208
4389
|
const durationMs = clock.elapsedMs();
|
|
4209
4390
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
4210
4391
|
await this.telemetryProvider.trackDependency({
|
|
4211
|
-
...this.spanFor(name, durationMs, false, {
|
|
4392
|
+
...this.spanFor(name, durationMs, false, {
|
|
4393
|
+
...properties,
|
|
4394
|
+
[CommandDimensions.ErrorMessage]: err.message
|
|
4395
|
+
}, childContext),
|
|
4212
4396
|
type
|
|
4213
4397
|
});
|
|
4214
4398
|
throw error;
|
|
@@ -4243,9 +4427,10 @@ class TelemetryService {
|
|
|
4243
4427
|
...globalProperties,
|
|
4244
4428
|
...this.defaultProperties,
|
|
4245
4429
|
...redactProperties(properties ?? {}),
|
|
4246
|
-
[TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource()
|
|
4430
|
+
[TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
|
|
4431
|
+
[BaseDimensions.SessionId]: this.telemetryProvider.getSessionId?.() ?? getTelemetrySessionId()
|
|
4247
4432
|
};
|
|
4248
|
-
return enriched;
|
|
4433
|
+
return lowercaseIdDimensionValues(enriched);
|
|
4249
4434
|
}
|
|
4250
4435
|
generateId() {
|
|
4251
4436
|
const bytes = new Uint8Array(8);
|
|
@@ -5006,7 +5191,165 @@ class FilterImplicitLimitError extends Error {
|
|
|
5006
5191
|
this.instructions = "Pass --limit <n> to choose how many records the filter applies to. " + "To filter over all records, pass the command's maximum accepted --limit (see the option's description in --help).";
|
|
5007
5192
|
}
|
|
5008
5193
|
}
|
|
5009
|
-
function
|
|
5194
|
+
function countRecords(data) {
|
|
5195
|
+
if (Array.isArray(data))
|
|
5196
|
+
return data.length;
|
|
5197
|
+
return data == null ? 0 : 1;
|
|
5198
|
+
}
|
|
5199
|
+
function availableFields(data) {
|
|
5200
|
+
const records = Array.isArray(data) ? data : [data];
|
|
5201
|
+
const keys = new Set;
|
|
5202
|
+
for (const record of records) {
|
|
5203
|
+
if (record && typeof record === "object" && !Array.isArray(record)) {
|
|
5204
|
+
for (const key of Object.keys(record))
|
|
5205
|
+
keys.add(key);
|
|
5206
|
+
}
|
|
5207
|
+
}
|
|
5208
|
+
return [...keys];
|
|
5209
|
+
}
|
|
5210
|
+
function decodeQuotedIdentifier(whole, inner) {
|
|
5211
|
+
const [error, decoded] = catchError(() => JSON.parse(whole));
|
|
5212
|
+
if (!error && typeof decoded === "string")
|
|
5213
|
+
return decoded;
|
|
5214
|
+
return inner.replace(/\\(.)/g, "$1");
|
|
5215
|
+
}
|
|
5216
|
+
function referencedFields(filter) {
|
|
5217
|
+
const top = new Set;
|
|
5218
|
+
const nested = new Set;
|
|
5219
|
+
const withoutValueLiterals = filter.replace(/'(?:\\.|[^'\\])*'/g, " ").replace(/`(?:\\.|[^`\\])*`/g, " ");
|
|
5220
|
+
const isPathTail = (text, index) => text[index - 1] === "." && /[A-Za-z0-9_"]/.test(text[index - 2] ?? "");
|
|
5221
|
+
const quoted = [];
|
|
5222
|
+
const withoutLiterals = withoutValueLiterals.replace(/"((?:\\.|[^"\\])*)"/g, (whole, name, index) => {
|
|
5223
|
+
const isAlias = /^\s*:/.test(withoutValueLiterals.slice(index + whole.length));
|
|
5224
|
+
if (!isAlias) {
|
|
5225
|
+
quoted.push({
|
|
5226
|
+
name: decodeQuotedIdentifier(whole, name),
|
|
5227
|
+
index,
|
|
5228
|
+
tail: isPathTail(withoutValueLiterals, index)
|
|
5229
|
+
});
|
|
5230
|
+
}
|
|
5231
|
+
return `"${" ".repeat(whole.length - 2)}"`;
|
|
5232
|
+
});
|
|
5233
|
+
const descent = /[A-Za-z0-9_"]\s*[.[]/.exec(withoutLiterals);
|
|
5234
|
+
const rootEnd = descent ? descent.index + 1 : Number.POSITIVE_INFINITY;
|
|
5235
|
+
const place = (name, index, tail) => {
|
|
5236
|
+
if (tail || index >= rootEnd)
|
|
5237
|
+
nested.add(name);
|
|
5238
|
+
else
|
|
5239
|
+
top.add(name);
|
|
5240
|
+
};
|
|
5241
|
+
for (const entry of quoted)
|
|
5242
|
+
place(entry.name, entry.index, entry.tail);
|
|
5243
|
+
const identifiers = withoutLiterals.matchAll(/([A-Za-z_][A-Za-z0-9_]*)(\s*[:(])?/g);
|
|
5244
|
+
const reserved = new Set(["true", "false", "null", "and", "or", "not"]);
|
|
5245
|
+
for (const match of identifiers) {
|
|
5246
|
+
const [, name, trailing] = match;
|
|
5247
|
+
if (trailing || reserved.has(name))
|
|
5248
|
+
continue;
|
|
5249
|
+
place(name, match.index, isPathTail(withoutLiterals, match.index));
|
|
5250
|
+
}
|
|
5251
|
+
return {
|
|
5252
|
+
top: [...top],
|
|
5253
|
+
nested: [...nested].filter((name) => !top.has(name)),
|
|
5254
|
+
hasPredicate: /\[\s*\?/.test(withoutValueLiterals)
|
|
5255
|
+
};
|
|
5256
|
+
}
|
|
5257
|
+
function appearsBelowTopLevel(data, name) {
|
|
5258
|
+
let budget = 2000;
|
|
5259
|
+
const visit = (value, depth) => {
|
|
5260
|
+
if (budget-- <= 0 || depth > 4)
|
|
5261
|
+
return false;
|
|
5262
|
+
if (value === null || typeof value !== "object")
|
|
5263
|
+
return false;
|
|
5264
|
+
if (Array.isArray(value))
|
|
5265
|
+
return value.some((entry) => visit(entry, depth));
|
|
5266
|
+
const record = value;
|
|
5267
|
+
if (depth > 0 && Object.hasOwn(record, name))
|
|
5268
|
+
return true;
|
|
5269
|
+
return Object.values(record).some((entry) => visit(entry, depth + 1));
|
|
5270
|
+
};
|
|
5271
|
+
return visit(data, 0);
|
|
5272
|
+
}
|
|
5273
|
+
function alwaysNullKeys(records) {
|
|
5274
|
+
const objects = records.filter((r) => r != null && typeof r === "object" && !Array.isArray(r));
|
|
5275
|
+
if (objects.length === 0 || objects.length !== records.length)
|
|
5276
|
+
return [];
|
|
5277
|
+
const keys = [...new Set(objects.flatMap((o) => Object.keys(o)))];
|
|
5278
|
+
if (keys.length === 0)
|
|
5279
|
+
return [];
|
|
5280
|
+
const nullKeys = keys.filter((key) => objects.every((record) => record[key] === null));
|
|
5281
|
+
return nullKeys.length === keys.length ? nullKeys : [];
|
|
5282
|
+
}
|
|
5283
|
+
function carriesOnlyNulls(value) {
|
|
5284
|
+
if (value === null)
|
|
5285
|
+
return true;
|
|
5286
|
+
if (Array.isArray(value)) {
|
|
5287
|
+
return value.length > 0 && value.every(carriesOnlyNulls);
|
|
5288
|
+
}
|
|
5289
|
+
if (typeof value === "object" && value !== undefined) {
|
|
5290
|
+
const values = Object.values(value);
|
|
5291
|
+
return values.length > 0 && values.every(carriesOnlyNulls);
|
|
5292
|
+
}
|
|
5293
|
+
return false;
|
|
5294
|
+
}
|
|
5295
|
+
function nameList(names, cap2 = 12) {
|
|
5296
|
+
const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
|
|
5297
|
+
const rest = names.length - shown.length;
|
|
5298
|
+
return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
|
|
5299
|
+
}
|
|
5300
|
+
function buildFilterWarning(filter, data, outcome) {
|
|
5301
|
+
const present = availableFields(data);
|
|
5302
|
+
const refs = referencedFields(filter);
|
|
5303
|
+
const unknown = refs.top.filter((name) => !present.includes(name) && !appearsBelowTopLevel(data, name));
|
|
5304
|
+
const unchecked = refs.nested.filter((name) => !present.includes(name));
|
|
5305
|
+
const count = countRecords(data);
|
|
5306
|
+
const scope = `${count} record(s)`;
|
|
5307
|
+
const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
|
|
5308
|
+
const soundness = unchecked.length > 0 ? `${nameList(unchecked)} ${unchecked.length === 1 ? "reads" : "read"} below the top level, so ${unchecked.length === 1 ? "it was" : "they were"} not checked against the record keys` : refs.top.length > 0 ? "every field it names exists" : "";
|
|
5309
|
+
const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
|
|
5310
|
+
let detail;
|
|
5311
|
+
let lede;
|
|
5312
|
+
if (outcome.kind === "null-elements") {
|
|
5313
|
+
lede = "returned only null values";
|
|
5314
|
+
const projected = `all ${outcome.count} of the elements it projected are null`;
|
|
5315
|
+
if (unknown.length > 0) {
|
|
5316
|
+
detail = `${projected}, because ${isNotAField(unknown)}`;
|
|
5317
|
+
} else if (unchecked.length > 0) {
|
|
5318
|
+
detail = withSoundness(projected);
|
|
5319
|
+
} else {
|
|
5320
|
+
detail = `${projected}, and every field it names exists — a multi-select list ` + `(\`[A, B]\`) reads each entry against \`Data\` itself, so on a list ` + `result use \`[].[A, B]\` or \`[].{a: A, b: B}\` to read the records`;
|
|
5321
|
+
}
|
|
5322
|
+
} else if (outcome.kind === "null-rows") {
|
|
5323
|
+
lede = "returned only null values";
|
|
5324
|
+
const projected = `every value it projected is null on all ${outcome.count} row(s)`;
|
|
5325
|
+
detail = unknown.length > 0 ? `${projected}, because ${isNotAField(unknown)}` : withSoundness(projected);
|
|
5326
|
+
} else if (outcome.kind === "null-values") {
|
|
5327
|
+
lede = "returned only null values";
|
|
5328
|
+
const projected = `every key it projected (${nameList(outcome.keys)}) is null`;
|
|
5329
|
+
const sameSet = unknown.length === outcome.keys.length && outcome.keys.every((k) => unknown.includes(k));
|
|
5330
|
+
if (sameSet) {
|
|
5331
|
+
detail = `${isNotAField(outcome.keys)}, so every key it projected is null`;
|
|
5332
|
+
} else if (unknown.length > 0) {
|
|
5333
|
+
detail = `${projected}, because ${isNotAField(unknown)}`;
|
|
5334
|
+
} else {
|
|
5335
|
+
detail = withSoundness(`${projected} on all ${scope}`);
|
|
5336
|
+
}
|
|
5337
|
+
} else {
|
|
5338
|
+
lede = "returned nothing";
|
|
5339
|
+
if (unknown.length > 0) {
|
|
5340
|
+
detail = isNotAField(unknown);
|
|
5341
|
+
} else {
|
|
5342
|
+
const selection = refs.hasPredicate ? "no record matched" : "the expression resolved to no value";
|
|
5343
|
+
detail = withSoundness(`${selection} — it read ${scope}`);
|
|
5344
|
+
}
|
|
5345
|
+
}
|
|
5346
|
+
const fields = present.length > 0 ? ` Available fields: ${nameList(present)}.` : "";
|
|
5347
|
+
return `--output-filter ${JSON.stringify(filter)} ${lede}: ${detail}.${fields}`;
|
|
5348
|
+
}
|
|
5349
|
+
function appendWarning(existing, note) {
|
|
5350
|
+
return existing ? `${existing} ${note}` : note;
|
|
5351
|
+
}
|
|
5352
|
+
function applyFilter(data, filter, onWarning) {
|
|
5010
5353
|
const codec = requireJmespath();
|
|
5011
5354
|
let result;
|
|
5012
5355
|
try {
|
|
@@ -5014,9 +5357,34 @@ function applyFilter(data, filter) {
|
|
|
5014
5357
|
} catch (err) {
|
|
5015
5358
|
throw new FilterEvaluationError(filter, err);
|
|
5016
5359
|
}
|
|
5017
|
-
|
|
5360
|
+
const inputCount = countRecords(data);
|
|
5361
|
+
const warn = (outcome) => {
|
|
5362
|
+
if (inputCount === 0)
|
|
5363
|
+
return;
|
|
5364
|
+
const note = buildFilterWarning(filter, data, outcome);
|
|
5365
|
+
getOutputSink().writeErr(`[WARN] ${note}
|
|
5366
|
+
`);
|
|
5367
|
+
onWarning?.(note);
|
|
5368
|
+
};
|
|
5369
|
+
const warnIfAllNull = (records) => {
|
|
5370
|
+
const keys = alwaysNullKeys(records);
|
|
5371
|
+
if (keys.length > 0)
|
|
5372
|
+
warn({ kind: "null-values", keys });
|
|
5373
|
+
};
|
|
5374
|
+
if (result == null) {
|
|
5375
|
+
warn({ kind: "empty" });
|
|
5018
5376
|
return [];
|
|
5377
|
+
}
|
|
5019
5378
|
if (Array.isArray(result)) {
|
|
5379
|
+
if (result.length === 0) {
|
|
5380
|
+
warn({ kind: "empty" });
|
|
5381
|
+
} else if (result.every((entry) => entry === null)) {
|
|
5382
|
+
warn({ kind: "null-elements", count: result.length });
|
|
5383
|
+
} else if (result.every((entry) => Array.isArray(entry)) && carriesOnlyNulls(result)) {
|
|
5384
|
+
warn({ kind: "null-rows", count: result.length });
|
|
5385
|
+
} else {
|
|
5386
|
+
warnIfAllNull(result);
|
|
5387
|
+
}
|
|
5020
5388
|
if (result.length > 0 && typeof result[0] !== "object") {
|
|
5021
5389
|
const fieldMatch = filter.match(/\.(\w+)$/);
|
|
5022
5390
|
const key = fieldMatch ? fieldMatch[1] : "Value";
|
|
@@ -5024,10 +5392,30 @@ function applyFilter(data, filter) {
|
|
|
5024
5392
|
}
|
|
5025
5393
|
return result;
|
|
5026
5394
|
}
|
|
5027
|
-
if (typeof result === "object")
|
|
5395
|
+
if (typeof result === "object") {
|
|
5396
|
+
warnIfAllNull([result]);
|
|
5028
5397
|
return result;
|
|
5398
|
+
}
|
|
5029
5399
|
return { Value: result };
|
|
5030
5400
|
}
|
|
5401
|
+
function filterFailureData(envelope) {
|
|
5402
|
+
const filter = getOutputFilter();
|
|
5403
|
+
const data = envelope.Data;
|
|
5404
|
+
if (!filter || data == null)
|
|
5405
|
+
return;
|
|
5406
|
+
let note;
|
|
5407
|
+
const [filterError, filtered] = catchError(() => applyFilter(data, filter, (n) => {
|
|
5408
|
+
note = n;
|
|
5409
|
+
}));
|
|
5410
|
+
if (filterError) {
|
|
5411
|
+
envelope.Warning = appendWarning(envelope.Warning, `--output-filter was not applied, so Data is shown in full: ${filterError.message}`);
|
|
5412
|
+
return;
|
|
5413
|
+
}
|
|
5414
|
+
envelope.Data = filtered;
|
|
5415
|
+
if (note) {
|
|
5416
|
+
envelope.Warning = appendWarning(envelope.Warning, note);
|
|
5417
|
+
}
|
|
5418
|
+
}
|
|
5031
5419
|
function defaultErrorCodeForResult(result) {
|
|
5032
5420
|
switch (result) {
|
|
5033
5421
|
case RESULTS.AuthenticationError:
|
|
@@ -5071,7 +5459,7 @@ function defaultErrorCodeForHttpStatus(status) {
|
|
|
5071
5459
|
return "server_error";
|
|
5072
5460
|
return;
|
|
5073
5461
|
}
|
|
5074
|
-
var LOCAL_PERMISSION_TEXT_PATTERN =
|
|
5462
|
+
var LOCAL_PERMISSION_TEXT_PATTERN = new RegExp(`(?:\\b|\\()(?:${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})(?::\\s|\\))`);
|
|
5075
5463
|
function defaultErrorCodeForFailure(data) {
|
|
5076
5464
|
if (data.Result === RESULTS.Failure) {
|
|
5077
5465
|
const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage2(data.Message);
|
|
@@ -5110,8 +5498,14 @@ var OutputFormatter;
|
|
|
5110
5498
|
}
|
|
5111
5499
|
const filter = getOutputFilter();
|
|
5112
5500
|
if (filter) {
|
|
5113
|
-
|
|
5501
|
+
let note;
|
|
5502
|
+
const filtered = applyFilter(data.Data, filter, (n) => {
|
|
5503
|
+
note = n;
|
|
5504
|
+
});
|
|
5114
5505
|
data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
|
|
5506
|
+
if (note) {
|
|
5507
|
+
data.Warning = appendWarning(data.Warning, note);
|
|
5508
|
+
}
|
|
5115
5509
|
}
|
|
5116
5510
|
logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
|
|
5117
5511
|
}
|
|
@@ -5139,12 +5533,13 @@ var OutputFormatter;
|
|
|
5139
5533
|
delete envelope.TelemetryErrorClass;
|
|
5140
5534
|
delete envelope.TelemetryTerminalOutcome;
|
|
5141
5535
|
delete envelope.TelemetryTerminalSignal;
|
|
5536
|
+
filterFailureData(envelope);
|
|
5142
5537
|
if (!suppressTelemetry) {
|
|
5143
5538
|
telemetry.trackEvent(CommonTelemetryEvents.Error, {
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5539
|
+
[ErrorDimensions.Result]: data.Result,
|
|
5540
|
+
[ErrorDimensions.ErrorCode]: data.ErrorCode,
|
|
5541
|
+
[ErrorDimensions.Retry]: data.Retry,
|
|
5542
|
+
[ErrorDimensions.ErrorMessage]: data.Message
|
|
5148
5543
|
});
|
|
5149
5544
|
}
|
|
5150
5545
|
logOutput(normalizeOutputKeys(envelope), getOutputFormat());
|
|
@@ -5187,13 +5582,20 @@ var OutputFormatter;
|
|
|
5187
5582
|
OutputFormatter.log = log;
|
|
5188
5583
|
function formatToString(data) {
|
|
5189
5584
|
const filter = getOutputFilter();
|
|
5585
|
+
const envelope = data;
|
|
5190
5586
|
if ("Data" in data && data.Data != null) {
|
|
5191
5587
|
data.Data = normalizeDataKeys(data.Data);
|
|
5192
5588
|
if (filter) {
|
|
5193
|
-
|
|
5589
|
+
let note;
|
|
5590
|
+
data.Data = normalizeDataKeys(applyFilter(data.Data, filter, (n) => {
|
|
5591
|
+
note = n;
|
|
5592
|
+
}));
|
|
5593
|
+
if (note) {
|
|
5594
|
+
envelope.Warning = appendWarning(envelope.Warning, note);
|
|
5595
|
+
}
|
|
5194
5596
|
}
|
|
5195
5597
|
}
|
|
5196
|
-
const output = normalizeOutputKeys(
|
|
5598
|
+
const output = normalizeOutputKeys(envelope);
|
|
5197
5599
|
const lines = [];
|
|
5198
5600
|
const sink = getOutputSink();
|
|
5199
5601
|
printOutput(output, getOutputFormat(), (msg) => {
|
|
@@ -5226,7 +5628,7 @@ var LEGACY_SKILL_NAMESPACE = "uipath:";
|
|
|
5226
5628
|
var MAX_SKILL_NAME_LENGTH = 80;
|
|
5227
5629
|
var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
|
|
5228
5630
|
function productMode(productArea, mode) {
|
|
5229
|
-
return {
|
|
5631
|
+
return { ProductArea: productArea, Mode: mode };
|
|
5230
5632
|
}
|
|
5231
5633
|
function attributionRecord(groups) {
|
|
5232
5634
|
const record = {};
|
|
@@ -5284,6 +5686,7 @@ var COMMAND_ATTRIBUTION = commandAttribution([
|
|
|
5284
5686
|
["rpa", "build", ["uip.rpa-legacy"]],
|
|
5285
5687
|
["conversational", "operate", ["uip.conversational"]],
|
|
5286
5688
|
["agents", "build", ["uip.codedagent", "uip.agent"]],
|
|
5689
|
+
["coding-agents", "build", ["uip.coder"]],
|
|
5287
5690
|
["agenthub", "build", ["uip.agenthub"]],
|
|
5288
5691
|
["coded-apps", "build", ["uip.codedapp"]],
|
|
5289
5692
|
["functions", "build", ["uip.function", "uip.functions"]],
|
|
@@ -5369,32 +5772,64 @@ function normalizeSkillName(value) {
|
|
|
5369
5772
|
function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
5370
5773
|
const skillName = normalizeSkillName(skillSource);
|
|
5371
5774
|
return {
|
|
5372
|
-
...skillName ? {
|
|
5775
|
+
...skillName ? { SkillName: skillName } : {},
|
|
5373
5776
|
...getCommandProductModeAttribution(commandPath)
|
|
5374
5777
|
};
|
|
5375
5778
|
}
|
|
5779
|
+
var AGENT_SESSION_ENV = {
|
|
5780
|
+
[BaseDimensions.AgentModel]: "UIPATH_AGENT_MODEL",
|
|
5781
|
+
[SkillsDimensions.PermissionMode]: "UIPATH_PERMISSION_MODE",
|
|
5782
|
+
[SkillsDimensions.EffortLevel]: "UIPATH_EFFORT_LEVEL",
|
|
5783
|
+
[SkillsDimensions.SkillsVersion]: "UIPATH_SKILLS_VERSION"
|
|
5784
|
+
};
|
|
5785
|
+
var MAX_TELEMETRY_TOKEN_LENGTH = 120;
|
|
5786
|
+
function sanitizeTelemetryToken(value) {
|
|
5787
|
+
return value.replace(/[^A-Za-z0-9:._/ -]/g, "_").slice(0, MAX_TELEMETRY_TOKEN_LENGTH);
|
|
5788
|
+
}
|
|
5789
|
+
function buildAgentSessionTelemetry(env) {
|
|
5790
|
+
const dimensions = {};
|
|
5791
|
+
for (const [key, variable] of Object.entries(AGENT_SESSION_ENV)) {
|
|
5792
|
+
const value = env[variable]?.trim();
|
|
5793
|
+
if (value) {
|
|
5794
|
+
dimensions[key] = sanitizeTelemetryToken(value);
|
|
5795
|
+
}
|
|
5796
|
+
}
|
|
5797
|
+
return dimensions;
|
|
5798
|
+
}
|
|
5376
5799
|
|
|
5377
5800
|
// ../common/src/telemetry/command-name.ts
|
|
5378
|
-
var
|
|
5801
|
+
var TELEMETRY_NAME_ROOT = "Cli";
|
|
5802
|
+
var CLI_COMMAND_ROOT = "uip";
|
|
5803
|
+
var TELEMETRY_NAME_BARE_ACTION = "Invoke";
|
|
5379
5804
|
function commandTelemetryName(parts) {
|
|
5805
|
+
const action = vetCommandTokens(parts).map(pascalizeToken).join("");
|
|
5806
|
+
return `${TELEMETRY_NAME_ROOT}.${action || TELEMETRY_NAME_BARE_ACTION}`;
|
|
5807
|
+
}
|
|
5808
|
+
function commandInvocationPath(parts) {
|
|
5809
|
+
return [CLI_COMMAND_ROOT, ...vetCommandTokens(parts)].join(" ");
|
|
5810
|
+
}
|
|
5811
|
+
function vetCommandTokens(parts) {
|
|
5380
5812
|
const tokens = [];
|
|
5381
5813
|
for (const part of parts) {
|
|
5382
|
-
const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !==
|
|
5814
|
+
const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !== CLI_COMMAND_ROOT);
|
|
5383
5815
|
if (pieces.every(isCommandToken)) {
|
|
5384
5816
|
tokens.push(...pieces);
|
|
5385
5817
|
continue;
|
|
5386
5818
|
}
|
|
5387
5819
|
tokens.push(UNKNOWN_TOKEN);
|
|
5388
5820
|
}
|
|
5389
|
-
return
|
|
5821
|
+
return tokens;
|
|
5822
|
+
}
|
|
5823
|
+
function pascalizeToken(token) {
|
|
5824
|
+
return token.split("-").filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
|
|
5390
5825
|
}
|
|
5391
|
-
var COMMAND_TOKEN_PATTERN = /^[a-
|
|
5826
|
+
var COMMAND_TOKEN_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
5392
5827
|
var MAX_COMMAND_TOKEN_LENGTH = 32;
|
|
5393
5828
|
var GUID_TOKEN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
5394
5829
|
function isCommandToken(token) {
|
|
5395
|
-
return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token)
|
|
5830
|
+
return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token);
|
|
5396
5831
|
}
|
|
5397
|
-
var UNKNOWN_TOKEN = "
|
|
5832
|
+
var UNKNOWN_TOKEN = "unknown";
|
|
5398
5833
|
|
|
5399
5834
|
// ../common/src/telemetry/invocation-request.ts
|
|
5400
5835
|
var requestContextSlot = singleton("TelemetryInvocationRequestContext");
|
|
@@ -5499,7 +5934,7 @@ function withheldArgumentValues(cmd) {
|
|
|
5499
5934
|
});
|
|
5500
5935
|
return values;
|
|
5501
5936
|
}
|
|
5502
|
-
function
|
|
5937
|
+
function deriveCommandParts(cmd) {
|
|
5503
5938
|
const parts = [];
|
|
5504
5939
|
let current = cmd;
|
|
5505
5940
|
while (current) {
|
|
@@ -5512,14 +5947,13 @@ function deriveCommandPath(cmd) {
|
|
|
5512
5947
|
if (parts.length > 1) {
|
|
5513
5948
|
parts.shift();
|
|
5514
5949
|
}
|
|
5515
|
-
return
|
|
5950
|
+
return parts;
|
|
5516
5951
|
}
|
|
5517
5952
|
function isErrorContext(value) {
|
|
5518
5953
|
return value !== null && typeof value === "object";
|
|
5519
5954
|
}
|
|
5520
5955
|
function commandHelpHint(commandPath) {
|
|
5521
|
-
|
|
5522
|
-
return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
|
|
5956
|
+
return `An unexpected error occurred. Run '${commandPath} --help' to verify command syntax, or run with --log-level debug for details.`;
|
|
5523
5957
|
}
|
|
5524
5958
|
function isPromptCancellation(error) {
|
|
5525
5959
|
return error instanceof Error && error.name === "ExitPromptError";
|
|
@@ -5544,7 +5978,9 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5544
5978
|
yaml: getOutputFormat() === "yaml",
|
|
5545
5979
|
filter: getOutputFilter() !== undefined
|
|
5546
5980
|
});
|
|
5547
|
-
const
|
|
5981
|
+
const commandParts = deriveCommandParts(command);
|
|
5982
|
+
const telemetryName = commandTelemetryName(commandParts);
|
|
5983
|
+
const commandPath = commandInvocationPath(commandParts);
|
|
5548
5984
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
5549
5985
|
markCommandStart();
|
|
5550
5986
|
const supplied = recordSuppliedArgumentValues(withheldArgumentValues(command));
|
|
@@ -5579,7 +6015,7 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5579
6015
|
Result: finalResult,
|
|
5580
6016
|
...customErrorCode ? { ErrorCode: customErrorCode } : {},
|
|
5581
6017
|
Message: errorMessage,
|
|
5582
|
-
Instructions: customInstructions ?? commandHelpHint(
|
|
6018
|
+
Instructions: customInstructions ?? commandHelpHint(commandPath),
|
|
5583
6019
|
...customRetry ? { Retry: customRetry } : {},
|
|
5584
6020
|
...customContext ? { Context: customContext } : {}
|
|
5585
6021
|
});
|
|
@@ -5596,8 +6032,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5596
6032
|
recordedFailure,
|
|
5597
6033
|
pollSignal: context.pollSignal
|
|
5598
6034
|
});
|
|
5599
|
-
if (terminalTelemetry.
|
|
5600
|
-
telemetry.trackException(error instanceof Error ? error : new Error(String(error)), {
|
|
6035
|
+
if (terminalTelemetry[CommandDimensions.ErrorClass] === "internal" && error) {
|
|
6036
|
+
telemetry.trackException(error instanceof Error ? error : new Error(String(error)), { [CommandDimensions.CommandName]: commandPath }, getInvocationRequestContext());
|
|
5601
6037
|
}
|
|
5602
6038
|
const commandParams = extractCommandParams(command);
|
|
5603
6039
|
if (props) {
|
|
@@ -5608,10 +6044,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5608
6044
|
const baseProperties = redactProperties({
|
|
5609
6045
|
...commandParams,
|
|
5610
6046
|
...props,
|
|
5611
|
-
...buildCommandTelemetryAttribution(
|
|
5612
|
-
|
|
6047
|
+
...buildCommandTelemetryAttribution(commandPath, process.env.UIPATH_SKILL),
|
|
6048
|
+
...buildAgentSessionTelemetry(process.env),
|
|
6049
|
+
[CommandDimensions.CommandName]: commandPath,
|
|
6050
|
+
[CommandDimensions.IsCommand]: "true",
|
|
5613
6051
|
...terminalTelemetry,
|
|
5614
|
-
...errorMessage ? { errorMessage } : {}
|
|
6052
|
+
...errorMessage ? { [CommandDimensions.ErrorMessage]: errorMessage } : {}
|
|
5615
6053
|
});
|
|
5616
6054
|
emitInvocationRequest(telemetryName, success, baseProperties);
|
|
5617
6055
|
} finally {
|
|
@@ -5877,6 +6315,40 @@ var BOOLEAN_FLAGS = new Set(HOST_GLOBAL_FLAGS);
|
|
|
5877
6315
|
// ../common/src/interactivity-context.ts
|
|
5878
6316
|
var modeSlot = singleton("InteractivityMode");
|
|
5879
6317
|
var interactiveFlagSlot = singleton("InteractiveFlag");
|
|
6318
|
+
// ../common/src/mime-types.ts
|
|
6319
|
+
var MIME_TYPES_BY_EXTENSION = Object.freeze({
|
|
6320
|
+
pdf: "application/pdf",
|
|
6321
|
+
png: "image/png",
|
|
6322
|
+
jpg: "image/jpeg",
|
|
6323
|
+
jpeg: "image/jpeg",
|
|
6324
|
+
gif: "image/gif",
|
|
6325
|
+
webp: "image/webp",
|
|
6326
|
+
bmp: "image/bmp",
|
|
6327
|
+
tif: "image/tiff",
|
|
6328
|
+
tiff: "image/tiff",
|
|
6329
|
+
svg: "image/svg+xml",
|
|
6330
|
+
txt: "text/plain",
|
|
6331
|
+
log: "text/plain",
|
|
6332
|
+
md: "text/markdown",
|
|
6333
|
+
csv: "text/csv",
|
|
6334
|
+
tsv: "text/tab-separated-values",
|
|
6335
|
+
json: "application/json",
|
|
6336
|
+
xml: "application/xml",
|
|
6337
|
+
html: "text/html",
|
|
6338
|
+
htm: "text/html",
|
|
6339
|
+
yaml: "application/yaml",
|
|
6340
|
+
yml: "application/yaml",
|
|
6341
|
+
doc: "application/msword",
|
|
6342
|
+
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
6343
|
+
xls: "application/vnd.ms-excel",
|
|
6344
|
+
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
6345
|
+
ppt: "application/vnd.ms-powerpoint",
|
|
6346
|
+
pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
6347
|
+
zip: "application/zip",
|
|
6348
|
+
mp3: "audio/mpeg",
|
|
6349
|
+
wav: "audio/wav",
|
|
6350
|
+
mp4: "video/mp4"
|
|
6351
|
+
});
|
|
5880
6352
|
// ../common/src/option-aliases.ts
|
|
5881
6353
|
function warnDeprecatedOptionAlias(deprecatedFlag, preferredFlag) {
|
|
5882
6354
|
getOutputSink().writeErr(`[WARN] ${deprecatedFlag} is deprecated. Use ${preferredFlag} instead.
|
|
@@ -5939,6 +6411,7 @@ var ScreenLogger;
|
|
|
5939
6411
|
})(ScreenLogger ||= {});
|
|
5940
6412
|
// ../common/src/sdk-user-agent.ts
|
|
5941
6413
|
var USER_AGENT_HEADER = "User-Agent";
|
|
6414
|
+
var AGENT_PROPERTY = BaseDimensions.Agent;
|
|
5942
6415
|
var sdkUserAgentHostToken = singleton("SdkUserAgentHostToken");
|
|
5943
6416
|
function userAgentPatchKey(userAgent) {
|
|
5944
6417
|
return Symbol.for(`@uipath/common/sdk-user-agent/${userAgent}`);
|
|
@@ -6326,6 +6799,11 @@ var pickName = (claims) => {
|
|
|
6326
6799
|
const username = asString(claims?.preferred_username);
|
|
6327
6800
|
return asString(claims?.name) ?? (looksLikeEmail(username) ? undefined : username);
|
|
6328
6801
|
};
|
|
6802
|
+
var pickScopes = (claims) => {
|
|
6803
|
+
const raw = claims?.scope;
|
|
6804
|
+
const scopes = Array.isArray(raw) ? raw.filter((entry) => asString(entry) !== undefined) : typeof raw === "string" ? raw.split(/\s+/).filter(Boolean) : [];
|
|
6805
|
+
return scopes.length > 0 ? scopes : undefined;
|
|
6806
|
+
};
|
|
6329
6807
|
var resolveSessionIdentity = (accessToken, authFlow) => {
|
|
6330
6808
|
const claims = accessToken ? decodeClaims(accessToken) : undefined;
|
|
6331
6809
|
const email = pickEmail(claims);
|
|
@@ -6351,6 +6829,7 @@ var resolveSessionIdentity = (accessToken, authFlow) => {
|
|
|
6351
6829
|
identity.clientId = clientId;
|
|
6352
6830
|
return identity;
|
|
6353
6831
|
};
|
|
6832
|
+
var readTokenScopes = (accessToken) => accessToken ? pickScopes(decodeClaims(accessToken)) : undefined;
|
|
6354
6833
|
|
|
6355
6834
|
// ../auth/src/envAuth.ts
|
|
6356
6835
|
var ENV_AUTH_ENABLE_VAR = "UIPATH_CLI_ENABLE_ENV_AUTH";
|
|
@@ -6423,6 +6902,7 @@ var readAuthFromEnv = () => {
|
|
|
6423
6902
|
const expiration = getTokenExpiration(accessToken);
|
|
6424
6903
|
const loginStatus = expiration && expiration <= new Date ? "Expired" : "Logged in";
|
|
6425
6904
|
const identity = resolveSessionIdentity(accessToken);
|
|
6905
|
+
const scopes = readTokenScopes(accessToken);
|
|
6426
6906
|
return {
|
|
6427
6907
|
loginStatus,
|
|
6428
6908
|
accessToken,
|
|
@@ -6433,7 +6913,8 @@ var readAuthFromEnv = () => {
|
|
|
6433
6913
|
tenantId,
|
|
6434
6914
|
expiration,
|
|
6435
6915
|
source: "env-vars" /* EnvironmentVariables */,
|
|
6436
|
-
...identity ? { identity } : {}
|
|
6916
|
+
...identity ? { identity } : {},
|
|
6917
|
+
...scopes ? { scopes } : {}
|
|
6437
6918
|
};
|
|
6438
6919
|
};
|
|
6439
6920
|
|
|
@@ -7071,10 +7552,15 @@ async function buildFileStatus(tokens, credentials, globalHint) {
|
|
|
7071
7552
|
}
|
|
7072
7553
|
function identityFields(accessToken, credentials) {
|
|
7073
7554
|
const identity = resolveSessionIdentity(accessToken, parseAuthFlow(credentials[AUTH_FLOW_ENV_VAR]));
|
|
7074
|
-
|
|
7555
|
+
const scopes = readTokenScopes(accessToken);
|
|
7556
|
+
return {
|
|
7557
|
+
...identity ? { identity } : {},
|
|
7558
|
+
...scopes ? { scopes } : {}
|
|
7559
|
+
};
|
|
7075
7560
|
}
|
|
7076
7561
|
function buildRobotStatus(robotCreds) {
|
|
7077
7562
|
const identity = resolveSessionIdentity(robotCreds.accessToken);
|
|
7563
|
+
const scopes = readTokenScopes(robotCreds.accessToken);
|
|
7078
7564
|
return {
|
|
7079
7565
|
loginStatus: "Logged in",
|
|
7080
7566
|
accessToken: robotCreds.accessToken,
|
|
@@ -7086,7 +7572,8 @@ function buildRobotStatus(robotCreds) {
|
|
|
7086
7572
|
issuer: robotCreds.issuer,
|
|
7087
7573
|
expiration: getTokenExpiration(robotCreds.accessToken),
|
|
7088
7574
|
source: "robot" /* Robot */,
|
|
7089
|
-
...identity ? { identity } : {}
|
|
7575
|
+
...identity ? { identity } : {},
|
|
7576
|
+
...scopes ? { scopes } : {}
|
|
7090
7577
|
};
|
|
7091
7578
|
}
|
|
7092
7579
|
var isFileNotFoundError = (error) => {
|
|
@@ -7353,7 +7840,8 @@ var getAuthContext = async (options = {}) => {
|
|
|
7353
7840
|
organizationId: status.organizationId,
|
|
7354
7841
|
organizationName: status.organizationName,
|
|
7355
7842
|
tenantId: status.tenantId,
|
|
7356
|
-
tenantName
|
|
7843
|
+
tenantName,
|
|
7844
|
+
identity: status.identity
|
|
7357
7845
|
};
|
|
7358
7846
|
};
|
|
7359
7847
|
// ../auth/src/tenantSelection.ts
|
|
@@ -7368,4 +7856,4 @@ var TENANT_SELECTION_CODES = new Set([
|
|
|
7368
7856
|
]);
|
|
7369
7857
|
export { catchError, extractErrorMessage, extractErrorMessageSync, RESULTS, OutputFormatter, classifiedFailure, Command, Option, processContext, isGuid, createHiddenDeprecatedTenantOption, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, getLoginStatusAsync, getAuthContext };
|
|
7370
7858
|
|
|
7371
|
-
//# debugId=
|
|
7859
|
+
//# debugId=37C248725D68198264756E2164756E21
|