@uipath/cli 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/README.md +143 -112
- package/dist/THIRD-PARTY-NOTICES.md +21 -2
- package/dist/{cli-akjte1tb.js → cli-rzsqfejn.js} +4 -4
- package/dist/{index-eb9q7r0k.js → index-45h1c7ad.js} +159 -13
- package/dist/{index-7pvwjzsq.js → index-kyn5nn3d.js} +575 -74
- package/dist/{index-hgvsratt.js → index-mttdq2yn.js} +4 -2
- package/dist/{index-59rge93d.js → index-nh7w4ccm.js} +507 -149
- package/dist/{index-vmn69waj.js → index-zwnedwxc.js} +21 -6
- package/dist/index.js +5 -5
- package/dist/{server-w65r13bn.js → server-x6j9cv7f.js} +3 -3
- package/dist/{telemetry-drain-zkrm8xja.js → telemetry-drain-4sk6ezgk.js} +1 -1
- package/dist/{updateService-txkkjjcq.js → updateService-r03h6d1b.js} +2 -2
- package/package.json +2 -2
|
@@ -3131,6 +3131,161 @@ function detectAgentFromEnv(env) {
|
|
|
3131
3131
|
}
|
|
3132
3132
|
return;
|
|
3133
3133
|
}
|
|
3134
|
+
// ../common/src/telemetry/telemetry-dimensions.ts
|
|
3135
|
+
var CLI_APPLICATION_NAME = "UiPath.Cli";
|
|
3136
|
+
var BaseDimensions = {
|
|
3137
|
+
ApplicationName: "ApplicationName",
|
|
3138
|
+
ProductVersion: "ProductVersion",
|
|
3139
|
+
InstallationId: "InstallationId",
|
|
3140
|
+
CloudUserId: "CloudUserId",
|
|
3141
|
+
CloudTenantId: "CloudTenantId",
|
|
3142
|
+
CloudOrganizationId: "CloudOrganizationId",
|
|
3143
|
+
IsInternalUser: "IsInternalUser",
|
|
3144
|
+
Environment: "Environment",
|
|
3145
|
+
BaseUrl: "BaseUrl",
|
|
3146
|
+
Region: "Region",
|
|
3147
|
+
Agent: "Agent",
|
|
3148
|
+
AgentVersion: "AgentVersion",
|
|
3149
|
+
AgentModel: "AgentModel",
|
|
3150
|
+
ToolName: "ToolName",
|
|
3151
|
+
ToolVersion: "ToolVersion",
|
|
3152
|
+
ExecutionContext: "ExecutionContext",
|
|
3153
|
+
CiProvider: "CiProvider",
|
|
3154
|
+
SessionIdSource: "SessionIdSource",
|
|
3155
|
+
SessionId: "SessionId"
|
|
3156
|
+
};
|
|
3157
|
+
var CommandDimensions = {
|
|
3158
|
+
IsCommand: "IsCommand",
|
|
3159
|
+
IsReexec: "IsReexec",
|
|
3160
|
+
CommandName: "CommandName",
|
|
3161
|
+
ExitCode: "ExitCode",
|
|
3162
|
+
TerminalOutcome: "TerminalOutcome",
|
|
3163
|
+
ErrorClass: "ErrorClass",
|
|
3164
|
+
TerminalSignal: "TerminalSignal",
|
|
3165
|
+
ErrorMessage: "ErrorMessage",
|
|
3166
|
+
SkillName: "SkillName",
|
|
3167
|
+
ProductArea: "ProductArea",
|
|
3168
|
+
Mode: "Mode"
|
|
3169
|
+
};
|
|
3170
|
+
var ShipDimensions = {
|
|
3171
|
+
ShipKind: "ShipKind",
|
|
3172
|
+
Target: "Target",
|
|
3173
|
+
ProjectType: "ProjectType",
|
|
3174
|
+
ProjectTypes: "ProjectTypes",
|
|
3175
|
+
ArtifactCorrelationKey: "ArtifactCorrelationKey",
|
|
3176
|
+
PackageName: "PackageName",
|
|
3177
|
+
PackageVersion: "PackageVersion",
|
|
3178
|
+
PackageVersionKey: "PackageVersionKey",
|
|
3179
|
+
DeploymentKey: "DeploymentKey",
|
|
3180
|
+
SolutionId: "SolutionId",
|
|
3181
|
+
FolderKey: "FolderKey",
|
|
3182
|
+
FeedId: "FeedId"
|
|
3183
|
+
};
|
|
3184
|
+
var ErrorDimensions = {
|
|
3185
|
+
Result: "Result",
|
|
3186
|
+
ErrorCode: "ErrorCode",
|
|
3187
|
+
Retry: "Retry",
|
|
3188
|
+
ErrorMessage: "ErrorMessage"
|
|
3189
|
+
};
|
|
3190
|
+
var AuthDimensions = {
|
|
3191
|
+
AuthenticationMethod: "AuthenticationMethod",
|
|
3192
|
+
Success: "Success",
|
|
3193
|
+
Reason: "Reason"
|
|
3194
|
+
};
|
|
3195
|
+
var SkillsDimensions = {
|
|
3196
|
+
SchemaVersion: "SchemaVersion",
|
|
3197
|
+
AgentType: "AgentType",
|
|
3198
|
+
SkillsVersion: "SkillsVersion",
|
|
3199
|
+
UipSubcommand: "UipSubcommand",
|
|
3200
|
+
FileExtension: "FileExtension",
|
|
3201
|
+
SubagentModel: "SubagentModel",
|
|
3202
|
+
SubagentType: "SubagentType",
|
|
3203
|
+
PermissionMode: "PermissionMode",
|
|
3204
|
+
EffortLevel: "EffortLevel",
|
|
3205
|
+
SessionSource: "SessionSource",
|
|
3206
|
+
Outcome: "Outcome",
|
|
3207
|
+
DurationMs: "DurationMs",
|
|
3208
|
+
Source: "Source"
|
|
3209
|
+
};
|
|
3210
|
+
var PackagerDimensions = {
|
|
3211
|
+
ProjectId: "ProjectId",
|
|
3212
|
+
ProjectType: "ProjectType",
|
|
3213
|
+
SolutionId: "SolutionId"
|
|
3214
|
+
};
|
|
3215
|
+
var ScopeDimensions = {
|
|
3216
|
+
FolderId: "FolderId"
|
|
3217
|
+
};
|
|
3218
|
+
var ID_DIMENSIONS = new Set([
|
|
3219
|
+
BaseDimensions.CloudUserId,
|
|
3220
|
+
BaseDimensions.CloudTenantId,
|
|
3221
|
+
BaseDimensions.CloudOrganizationId,
|
|
3222
|
+
BaseDimensions.InstallationId,
|
|
3223
|
+
ShipDimensions.ArtifactCorrelationKey,
|
|
3224
|
+
ShipDimensions.PackageVersionKey,
|
|
3225
|
+
ShipDimensions.DeploymentKey,
|
|
3226
|
+
ShipDimensions.SolutionId,
|
|
3227
|
+
ShipDimensions.FolderKey,
|
|
3228
|
+
ShipDimensions.FeedId,
|
|
3229
|
+
PackagerDimensions.ProjectId
|
|
3230
|
+
]);
|
|
3231
|
+
var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
|
|
3232
|
+
var RESERVED_DIMENSION_NAMES = new Set([
|
|
3233
|
+
...Object.values(BaseDimensions),
|
|
3234
|
+
...Object.values(CommandDimensions),
|
|
3235
|
+
...Object.values(ShipDimensions),
|
|
3236
|
+
...Object.values(ErrorDimensions),
|
|
3237
|
+
...Object.values(AuthDimensions),
|
|
3238
|
+
...Object.values(SkillsDimensions),
|
|
3239
|
+
...Object.values(PackagerDimensions),
|
|
3240
|
+
...Object.values(ScopeDimensions)
|
|
3241
|
+
]);
|
|
3242
|
+
var CURATED_DIMENSIONS = new Set([
|
|
3243
|
+
BaseDimensions.ApplicationName,
|
|
3244
|
+
BaseDimensions.ProductVersion,
|
|
3245
|
+
BaseDimensions.InstallationId,
|
|
3246
|
+
BaseDimensions.CloudUserId,
|
|
3247
|
+
BaseDimensions.CloudTenantId,
|
|
3248
|
+
BaseDimensions.CloudOrganizationId,
|
|
3249
|
+
BaseDimensions.IsInternalUser,
|
|
3250
|
+
BaseDimensions.Environment,
|
|
3251
|
+
BaseDimensions.BaseUrl,
|
|
3252
|
+
BaseDimensions.Region,
|
|
3253
|
+
BaseDimensions.Agent,
|
|
3254
|
+
BaseDimensions.AgentVersion,
|
|
3255
|
+
BaseDimensions.ToolVersion,
|
|
3256
|
+
BaseDimensions.ExecutionContext,
|
|
3257
|
+
BaseDimensions.CiProvider,
|
|
3258
|
+
BaseDimensions.SessionIdSource,
|
|
3259
|
+
BaseDimensions.SessionId,
|
|
3260
|
+
...Object.values(CommandDimensions),
|
|
3261
|
+
...Object.values(ShipDimensions)
|
|
3262
|
+
]);
|
|
3263
|
+
function assertNoCuratedDimensionTargets(map, mapName) {
|
|
3264
|
+
for (const [inputKey, dimension] of Object.entries(map)) {
|
|
3265
|
+
if (CURATED_DIMENSIONS.has(dimension)) {
|
|
3266
|
+
throw new Error(`${mapName}: input field "${inputKey}" maps to curated dimension "${dimension}"`);
|
|
3267
|
+
}
|
|
3268
|
+
}
|
|
3269
|
+
}
|
|
3270
|
+
function lowercaseIdDimensionValues(properties) {
|
|
3271
|
+
let changed = false;
|
|
3272
|
+
const result = {
|
|
3273
|
+
...properties
|
|
3274
|
+
};
|
|
3275
|
+
for (const key of Object.keys(result)) {
|
|
3276
|
+
const value = result[key];
|
|
3277
|
+
if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
|
|
3278
|
+
continue;
|
|
3279
|
+
}
|
|
3280
|
+
const lowered = value.toLowerCase();
|
|
3281
|
+
if (lowered !== value) {
|
|
3282
|
+
result[key] = lowered;
|
|
3283
|
+
changed = true;
|
|
3284
|
+
}
|
|
3285
|
+
}
|
|
3286
|
+
return changed ? result : properties;
|
|
3287
|
+
}
|
|
3288
|
+
|
|
3134
3289
|
// ../common/src/telemetry/environment-info.ts
|
|
3135
3290
|
var LOCAL_HOSTS = new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
|
|
3136
3291
|
function parseHost(baseUrl) {
|
|
@@ -3174,14 +3329,14 @@ function deriveRegion(baseUrl) {
|
|
|
3174
3329
|
}
|
|
3175
3330
|
function buildEnvironmentProperties(baseUrl) {
|
|
3176
3331
|
const props = {
|
|
3177
|
-
|
|
3332
|
+
[BaseDimensions.Environment]: normalizeEnvironment(baseUrl)
|
|
3178
3333
|
};
|
|
3179
3334
|
const normalized = normalizeBaseUrl(baseUrl);
|
|
3180
3335
|
if (normalized)
|
|
3181
|
-
props.
|
|
3336
|
+
props[BaseDimensions.BaseUrl] = normalized;
|
|
3182
3337
|
const region = deriveRegion(baseUrl);
|
|
3183
3338
|
if (region)
|
|
3184
|
-
props.
|
|
3339
|
+
props[BaseDimensions.Region] = region;
|
|
3185
3340
|
return props;
|
|
3186
3341
|
}
|
|
3187
3342
|
// ../common/src/telemetry/execution-context.ts
|
|
@@ -3285,8 +3440,8 @@ function detectExecutionContext(options = {}) {
|
|
|
3285
3440
|
function getExecutionContextTelemetryProperties() {
|
|
3286
3441
|
const detected = detectExecutionContext();
|
|
3287
3442
|
return {
|
|
3288
|
-
|
|
3289
|
-
...detected.ciProvider ? {
|
|
3443
|
+
[BaseDimensions.ExecutionContext]: detected.executionContext,
|
|
3444
|
+
...detected.ciProvider ? { [BaseDimensions.CiProvider]: detected.ciProvider } : {}
|
|
3290
3445
|
};
|
|
3291
3446
|
}
|
|
3292
3447
|
// ../common/src/telemetry/node-context-storage.ts
|
|
@@ -3329,7 +3484,7 @@ function getInboundTraceContext() {
|
|
|
3329
3484
|
var TELEMETRY_SESSION_ID_ENV = "UIPATH_SESSION_ID";
|
|
3330
3485
|
var SESSION_ID_MAX_LENGTH = 64;
|
|
3331
3486
|
var RANDOM_SESSION_ID_LENGTH = 32;
|
|
3332
|
-
var TELEMETRY_SESSION_SOURCE_PROPERTY = "
|
|
3487
|
+
var TELEMETRY_SESSION_SOURCE_PROPERTY = "SessionIdSource";
|
|
3333
3488
|
var CONTROL_CHARACTERS = /\p{Cc}/gu;
|
|
3334
3489
|
var INHERITED_SESSION_SOURCES = [
|
|
3335
3490
|
{ envVar: "CLAUDE_CODE_SESSION_ID", source: "claude-code" },
|
|
@@ -3468,7 +3623,10 @@ class TelemetryService {
|
|
|
3468
3623
|
} catch (error) {
|
|
3469
3624
|
const durationMs = clock.elapsedMs();
|
|
3470
3625
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
3471
|
-
await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, {
|
|
3626
|
+
await this.telemetryProvider.trackRequest(this.spanFor(name, durationMs, false, {
|
|
3627
|
+
...properties,
|
|
3628
|
+
[CommandDimensions.ErrorMessage]: err.message
|
|
3629
|
+
}, context));
|
|
3472
3630
|
throw error;
|
|
3473
3631
|
}
|
|
3474
3632
|
}
|
|
@@ -3539,7 +3697,10 @@ class TelemetryService {
|
|
|
3539
3697
|
const durationMs = clock.elapsedMs();
|
|
3540
3698
|
const err = error instanceof Error ? error : new Error(String(error));
|
|
3541
3699
|
await this.telemetryProvider.trackDependency({
|
|
3542
|
-
...this.spanFor(name, durationMs, false, {
|
|
3700
|
+
...this.spanFor(name, durationMs, false, {
|
|
3701
|
+
...properties,
|
|
3702
|
+
[CommandDimensions.ErrorMessage]: err.message
|
|
3703
|
+
}, childContext),
|
|
3543
3704
|
type
|
|
3544
3705
|
});
|
|
3545
3706
|
throw error;
|
|
@@ -3574,9 +3735,10 @@ class TelemetryService {
|
|
|
3574
3735
|
...globalProperties,
|
|
3575
3736
|
...this.defaultProperties,
|
|
3576
3737
|
...redactProperties(properties ?? {}),
|
|
3577
|
-
[TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource()
|
|
3738
|
+
[TELEMETRY_SESSION_SOURCE_PROPERTY]: getTelemetrySessionSource(),
|
|
3739
|
+
[BaseDimensions.SessionId]: this.telemetryProvider.getSessionId?.() ?? getTelemetrySessionId()
|
|
3578
3740
|
};
|
|
3579
|
-
return enriched;
|
|
3741
|
+
return lowercaseIdDimensionValues(enriched);
|
|
3580
3742
|
}
|
|
3581
3743
|
generateId() {
|
|
3582
3744
|
const bytes = new Uint8Array(8);
|
|
@@ -3824,7 +3986,7 @@ function makeTrackedFetch(realFetch) {
|
|
|
3824
3986
|
telemetry.trackDependencyResult(name, "HTTP", durationMs, false, {
|
|
3825
3987
|
"server.address": url.host,
|
|
3826
3988
|
"http.request.method": method,
|
|
3827
|
-
|
|
3989
|
+
[CommandDimensions.ErrorMessage]: error instanceof Error ? error.message : String(error)
|
|
3828
3990
|
}, context);
|
|
3829
3991
|
throw error;
|
|
3830
3992
|
}
|
|
@@ -4468,6 +4630,13 @@ var {
|
|
|
4468
4630
|
Help
|
|
4469
4631
|
} = import__.default;
|
|
4470
4632
|
|
|
4633
|
+
// ../common/src/local-permission-codes.ts
|
|
4634
|
+
var LOCAL_PERMISSION_ERROR_CODES = new Set([
|
|
4635
|
+
"EACCES",
|
|
4636
|
+
"EPERM",
|
|
4637
|
+
"EROFS"
|
|
4638
|
+
]);
|
|
4639
|
+
|
|
4471
4640
|
// ../common/src/output-codecs.ts
|
|
4472
4641
|
var yamlSlot = singleton("YamlCodec");
|
|
4473
4642
|
var jmespathSlot = singleton("JmespathCodec");
|
|
@@ -4534,12 +4703,59 @@ function isOutputFormat(value) {
|
|
|
4534
4703
|
return OUTPUT_FORMATS.includes(value);
|
|
4535
4704
|
}
|
|
4536
4705
|
|
|
4706
|
+
// ../common/src/error-graph.ts
|
|
4707
|
+
function* walkErrorGraph(error) {
|
|
4708
|
+
const queue = [error];
|
|
4709
|
+
const seen = new Set;
|
|
4710
|
+
for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
|
|
4711
|
+
const current = queue.shift();
|
|
4712
|
+
if (current === null || typeof current !== "object")
|
|
4713
|
+
continue;
|
|
4714
|
+
if (seen.has(current))
|
|
4715
|
+
continue;
|
|
4716
|
+
seen.add(current);
|
|
4717
|
+
const cur = current;
|
|
4718
|
+
yield cur;
|
|
4719
|
+
if (cur.cause !== undefined)
|
|
4720
|
+
queue.push(cur.cause);
|
|
4721
|
+
if (Array.isArray(cur.errors))
|
|
4722
|
+
queue.push(...cur.errors);
|
|
4723
|
+
}
|
|
4724
|
+
return;
|
|
4725
|
+
}
|
|
4726
|
+
function parseHttpStatusFromMessage(message) {
|
|
4727
|
+
const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
|
|
4728
|
+
if (!match)
|
|
4729
|
+
return;
|
|
4730
|
+
const status = Number(match[1]);
|
|
4731
|
+
return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
|
|
4732
|
+
}
|
|
4733
|
+
function findHttpStatusInGraph(error) {
|
|
4734
|
+
for (const node of walkErrorGraph(error)) {
|
|
4735
|
+
const response = node.response;
|
|
4736
|
+
const explicit = typeof node.status === "number" ? node.status : response?.status;
|
|
4737
|
+
if (typeof explicit === "number" && explicit >= 400 && explicit <= 599) {
|
|
4738
|
+
return explicit;
|
|
4739
|
+
}
|
|
4740
|
+
if (typeof node.message === "string") {
|
|
4741
|
+
const parsed = parseHttpStatusFromMessage(node.message);
|
|
4742
|
+
if (parsed !== undefined && parsed >= 400) {
|
|
4743
|
+
return parsed;
|
|
4744
|
+
}
|
|
4745
|
+
}
|
|
4746
|
+
}
|
|
4747
|
+
return;
|
|
4748
|
+
}
|
|
4749
|
+
|
|
4537
4750
|
// ../common/src/telemetry/command-terminal.ts
|
|
4538
4751
|
var recordedFailureSlot = singleton("CommandTelemetryFailure");
|
|
4539
4752
|
var AUTH_ERROR_CODES = new Set([
|
|
4540
4753
|
"authentication_required",
|
|
4541
4754
|
"permission_denied"
|
|
4542
4755
|
]);
|
|
4756
|
+
var LOCAL_PERMISSION_CLI_ERROR_CODES = new Set([
|
|
4757
|
+
"local_permission_denied"
|
|
4758
|
+
]);
|
|
4543
4759
|
var VALIDATION_ERROR_CODES = new Set(["invalid_argument"]);
|
|
4544
4760
|
var NETWORK_HTTP_ERROR_CODES = new Set([
|
|
4545
4761
|
"network_error",
|
|
@@ -4680,6 +4896,9 @@ function classifyFromErrorCode(errorCode) {
|
|
|
4680
4896
|
if (AUTH_ERROR_CODES.has(errorCode)) {
|
|
4681
4897
|
return "auth";
|
|
4682
4898
|
}
|
|
4899
|
+
if (LOCAL_PERMISSION_CLI_ERROR_CODES.has(errorCode)) {
|
|
4900
|
+
return "local_permission";
|
|
4901
|
+
}
|
|
4683
4902
|
if (VALIDATION_ERROR_CODES.has(errorCode)) {
|
|
4684
4903
|
return "validation";
|
|
4685
4904
|
}
|
|
@@ -4691,6 +4910,15 @@ function classifyFromErrorCode(errorCode) {
|
|
|
4691
4910
|
}
|
|
4692
4911
|
return;
|
|
4693
4912
|
}
|
|
4913
|
+
function hasLocalPermissionCode(error) {
|
|
4914
|
+
for (const node of walkErrorGraph(error)) {
|
|
4915
|
+
const code = node.code;
|
|
4916
|
+
if (typeof code === "string" && LOCAL_PERMISSION_ERROR_CODES.has(code)) {
|
|
4917
|
+
return true;
|
|
4918
|
+
}
|
|
4919
|
+
}
|
|
4920
|
+
return false;
|
|
4921
|
+
}
|
|
4694
4922
|
function classifyFromError(error) {
|
|
4695
4923
|
const code = findCodeInCauseChain(error);
|
|
4696
4924
|
if (code) {
|
|
@@ -4707,6 +4935,9 @@ function classifyFromError(error) {
|
|
|
4707
4935
|
return "missing_dependency";
|
|
4708
4936
|
}
|
|
4709
4937
|
}
|
|
4938
|
+
if (hasLocalPermissionCode(error)) {
|
|
4939
|
+
return "local_permission";
|
|
4940
|
+
}
|
|
4710
4941
|
const message = stringField(error, "message");
|
|
4711
4942
|
if (message?.includes("fetch failed") === true) {
|
|
4712
4943
|
return "network_http";
|
|
@@ -4722,7 +4953,7 @@ function classifyError(input) {
|
|
|
4722
4953
|
if (recorded?.errorClass) {
|
|
4723
4954
|
return recorded.errorClass;
|
|
4724
4955
|
}
|
|
4725
|
-
const status = recorded?.context?.httpStatus;
|
|
4956
|
+
const status = recorded?.context?.httpStatus ?? findHttpStatusInGraph(input.error);
|
|
4726
4957
|
if (status !== undefined) {
|
|
4727
4958
|
return classifyHttpStatus(status);
|
|
4728
4959
|
}
|
|
@@ -4745,17 +4976,18 @@ function buildCommandTerminalTelemetryProperties(input) {
|
|
|
4745
4976
|
const errorClass = outcome === "success" || outcome === "no_op" ? undefined : outcome === "cancelled" ? "user_cancelled" : classifyError(input);
|
|
4746
4977
|
const terminalSignal = terminalSignalFor(input, outcome);
|
|
4747
4978
|
return {
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
...errorClass ? {
|
|
4751
|
-
...terminalSignal ? {
|
|
4979
|
+
[CommandDimensions.ExitCode]: input.exitCode,
|
|
4980
|
+
[CommandDimensions.TerminalOutcome]: outcome,
|
|
4981
|
+
...errorClass ? { [CommandDimensions.ErrorClass]: errorClass } : {},
|
|
4982
|
+
...terminalSignal ? { [CommandDimensions.TerminalSignal]: terminalSignal } : {}
|
|
4752
4983
|
};
|
|
4753
4984
|
}
|
|
4754
4985
|
|
|
4755
4986
|
// ../common/src/telemetry/telemetry-events.ts
|
|
4756
4987
|
var CommonTelemetryEvents = {
|
|
4757
|
-
|
|
4758
|
-
|
|
4988
|
+
Start: "Application.Start",
|
|
4989
|
+
Error: "Application.Error",
|
|
4990
|
+
ShipSucceeded: "Cli.ShipSucceeded"
|
|
4759
4991
|
};
|
|
4760
4992
|
|
|
4761
4993
|
// ../common/src/formatter.ts
|
|
@@ -5441,7 +5673,165 @@ class FilterImplicitLimitError extends Error {
|
|
|
5441
5673
|
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).";
|
|
5442
5674
|
}
|
|
5443
5675
|
}
|
|
5444
|
-
function
|
|
5676
|
+
function countRecords(data) {
|
|
5677
|
+
if (Array.isArray(data))
|
|
5678
|
+
return data.length;
|
|
5679
|
+
return data == null ? 0 : 1;
|
|
5680
|
+
}
|
|
5681
|
+
function availableFields(data) {
|
|
5682
|
+
const records = Array.isArray(data) ? data : [data];
|
|
5683
|
+
const keys = new Set;
|
|
5684
|
+
for (const record of records) {
|
|
5685
|
+
if (record && typeof record === "object" && !Array.isArray(record)) {
|
|
5686
|
+
for (const key of Object.keys(record))
|
|
5687
|
+
keys.add(key);
|
|
5688
|
+
}
|
|
5689
|
+
}
|
|
5690
|
+
return [...keys];
|
|
5691
|
+
}
|
|
5692
|
+
function decodeQuotedIdentifier(whole, inner) {
|
|
5693
|
+
const [error, decoded] = catchError(() => JSON.parse(whole));
|
|
5694
|
+
if (!error && typeof decoded === "string")
|
|
5695
|
+
return decoded;
|
|
5696
|
+
return inner.replace(/\\(.)/g, "$1");
|
|
5697
|
+
}
|
|
5698
|
+
function referencedFields(filter) {
|
|
5699
|
+
const top = new Set;
|
|
5700
|
+
const nested = new Set;
|
|
5701
|
+
const withoutValueLiterals = filter.replace(/'(?:\\.|[^'\\])*'/g, " ").replace(/`(?:\\.|[^`\\])*`/g, " ");
|
|
5702
|
+
const isPathTail = (text, index) => text[index - 1] === "." && /[A-Za-z0-9_"]/.test(text[index - 2] ?? "");
|
|
5703
|
+
const quoted = [];
|
|
5704
|
+
const withoutLiterals = withoutValueLiterals.replace(/"((?:\\.|[^"\\])*)"/g, (whole, name, index) => {
|
|
5705
|
+
const isAlias = /^\s*:/.test(withoutValueLiterals.slice(index + whole.length));
|
|
5706
|
+
if (!isAlias) {
|
|
5707
|
+
quoted.push({
|
|
5708
|
+
name: decodeQuotedIdentifier(whole, name),
|
|
5709
|
+
index,
|
|
5710
|
+
tail: isPathTail(withoutValueLiterals, index)
|
|
5711
|
+
});
|
|
5712
|
+
}
|
|
5713
|
+
return `"${" ".repeat(whole.length - 2)}"`;
|
|
5714
|
+
});
|
|
5715
|
+
const descent = /[A-Za-z0-9_"]\s*[.[]/.exec(withoutLiterals);
|
|
5716
|
+
const rootEnd = descent ? descent.index + 1 : Number.POSITIVE_INFINITY;
|
|
5717
|
+
const place = (name, index, tail) => {
|
|
5718
|
+
if (tail || index >= rootEnd)
|
|
5719
|
+
nested.add(name);
|
|
5720
|
+
else
|
|
5721
|
+
top.add(name);
|
|
5722
|
+
};
|
|
5723
|
+
for (const entry of quoted)
|
|
5724
|
+
place(entry.name, entry.index, entry.tail);
|
|
5725
|
+
const identifiers = withoutLiterals.matchAll(/([A-Za-z_][A-Za-z0-9_]*)(\s*[:(])?/g);
|
|
5726
|
+
const reserved = new Set(["true", "false", "null", "and", "or", "not"]);
|
|
5727
|
+
for (const match of identifiers) {
|
|
5728
|
+
const [, name, trailing] = match;
|
|
5729
|
+
if (trailing || reserved.has(name))
|
|
5730
|
+
continue;
|
|
5731
|
+
place(name, match.index, isPathTail(withoutLiterals, match.index));
|
|
5732
|
+
}
|
|
5733
|
+
return {
|
|
5734
|
+
top: [...top],
|
|
5735
|
+
nested: [...nested].filter((name) => !top.has(name)),
|
|
5736
|
+
hasPredicate: /\[\s*\?/.test(withoutValueLiterals)
|
|
5737
|
+
};
|
|
5738
|
+
}
|
|
5739
|
+
function appearsBelowTopLevel(data, name) {
|
|
5740
|
+
let budget = 2000;
|
|
5741
|
+
const visit = (value, depth) => {
|
|
5742
|
+
if (budget-- <= 0 || depth > 4)
|
|
5743
|
+
return false;
|
|
5744
|
+
if (value === null || typeof value !== "object")
|
|
5745
|
+
return false;
|
|
5746
|
+
if (Array.isArray(value))
|
|
5747
|
+
return value.some((entry) => visit(entry, depth));
|
|
5748
|
+
const record = value;
|
|
5749
|
+
if (depth > 0 && Object.hasOwn(record, name))
|
|
5750
|
+
return true;
|
|
5751
|
+
return Object.values(record).some((entry) => visit(entry, depth + 1));
|
|
5752
|
+
};
|
|
5753
|
+
return visit(data, 0);
|
|
5754
|
+
}
|
|
5755
|
+
function alwaysNullKeys(records) {
|
|
5756
|
+
const objects = records.filter((r) => r != null && typeof r === "object" && !Array.isArray(r));
|
|
5757
|
+
if (objects.length === 0 || objects.length !== records.length)
|
|
5758
|
+
return [];
|
|
5759
|
+
const keys = [...new Set(objects.flatMap((o) => Object.keys(o)))];
|
|
5760
|
+
if (keys.length === 0)
|
|
5761
|
+
return [];
|
|
5762
|
+
const nullKeys = keys.filter((key) => objects.every((record) => record[key] === null));
|
|
5763
|
+
return nullKeys.length === keys.length ? nullKeys : [];
|
|
5764
|
+
}
|
|
5765
|
+
function carriesOnlyNulls(value) {
|
|
5766
|
+
if (value === null)
|
|
5767
|
+
return true;
|
|
5768
|
+
if (Array.isArray(value)) {
|
|
5769
|
+
return value.length > 0 && value.every(carriesOnlyNulls);
|
|
5770
|
+
}
|
|
5771
|
+
if (typeof value === "object" && value !== undefined) {
|
|
5772
|
+
const values = Object.values(value);
|
|
5773
|
+
return values.length > 0 && values.every(carriesOnlyNulls);
|
|
5774
|
+
}
|
|
5775
|
+
return false;
|
|
5776
|
+
}
|
|
5777
|
+
function nameList(names, cap2 = 12) {
|
|
5778
|
+
const shown = names.slice(0, cap2).map((n) => `\`${n}\``);
|
|
5779
|
+
const rest = names.length - shown.length;
|
|
5780
|
+
return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
|
|
5781
|
+
}
|
|
5782
|
+
function buildFilterWarning(filter, data, outcome) {
|
|
5783
|
+
const present = availableFields(data);
|
|
5784
|
+
const refs = referencedFields(filter);
|
|
5785
|
+
const unknown = refs.top.filter((name) => !present.includes(name) && !appearsBelowTopLevel(data, name));
|
|
5786
|
+
const unchecked = refs.nested.filter((name) => !present.includes(name));
|
|
5787
|
+
const count = countRecords(data);
|
|
5788
|
+
const scope = `${count} record(s)`;
|
|
5789
|
+
const isNotAField = (names) => `${nameList(names)} ${names.length === 1 ? "is not a field" : "are not fields"} on the ${scope} it read`;
|
|
5790
|
+
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" : "";
|
|
5791
|
+
const withSoundness = (base) => soundness ? `${base}, and ${soundness}` : base;
|
|
5792
|
+
let detail;
|
|
5793
|
+
let lede;
|
|
5794
|
+
if (outcome.kind === "null-elements") {
|
|
5795
|
+
lede = "returned only null values";
|
|
5796
|
+
const projected = `all ${outcome.count} of the elements it projected are null`;
|
|
5797
|
+
if (unknown.length > 0) {
|
|
5798
|
+
detail = `${projected}, because ${isNotAField(unknown)}`;
|
|
5799
|
+
} else if (unchecked.length > 0) {
|
|
5800
|
+
detail = withSoundness(projected);
|
|
5801
|
+
} else {
|
|
5802
|
+
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`;
|
|
5803
|
+
}
|
|
5804
|
+
} else if (outcome.kind === "null-rows") {
|
|
5805
|
+
lede = "returned only null values";
|
|
5806
|
+
const projected = `every value it projected is null on all ${outcome.count} row(s)`;
|
|
5807
|
+
detail = unknown.length > 0 ? `${projected}, because ${isNotAField(unknown)}` : withSoundness(projected);
|
|
5808
|
+
} else if (outcome.kind === "null-values") {
|
|
5809
|
+
lede = "returned only null values";
|
|
5810
|
+
const projected = `every key it projected (${nameList(outcome.keys)}) is null`;
|
|
5811
|
+
const sameSet = unknown.length === outcome.keys.length && outcome.keys.every((k) => unknown.includes(k));
|
|
5812
|
+
if (sameSet) {
|
|
5813
|
+
detail = `${isNotAField(outcome.keys)}, so every key it projected is null`;
|
|
5814
|
+
} else if (unknown.length > 0) {
|
|
5815
|
+
detail = `${projected}, because ${isNotAField(unknown)}`;
|
|
5816
|
+
} else {
|
|
5817
|
+
detail = withSoundness(`${projected} on all ${scope}`);
|
|
5818
|
+
}
|
|
5819
|
+
} else {
|
|
5820
|
+
lede = "returned nothing";
|
|
5821
|
+
if (unknown.length > 0) {
|
|
5822
|
+
detail = isNotAField(unknown);
|
|
5823
|
+
} else {
|
|
5824
|
+
const selection = refs.hasPredicate ? "no record matched" : "the expression resolved to no value";
|
|
5825
|
+
detail = withSoundness(`${selection} — it read ${scope}`);
|
|
5826
|
+
}
|
|
5827
|
+
}
|
|
5828
|
+
const fields = present.length > 0 ? ` Available fields: ${nameList(present)}.` : "";
|
|
5829
|
+
return `--output-filter ${JSON.stringify(filter)} ${lede}: ${detail}.${fields}`;
|
|
5830
|
+
}
|
|
5831
|
+
function appendWarning(existing, note) {
|
|
5832
|
+
return existing ? `${existing} ${note}` : note;
|
|
5833
|
+
}
|
|
5834
|
+
function applyFilter(data, filter, onWarning) {
|
|
5445
5835
|
const codec = requireJmespath();
|
|
5446
5836
|
let result;
|
|
5447
5837
|
try {
|
|
@@ -5449,9 +5839,34 @@ function applyFilter(data, filter) {
|
|
|
5449
5839
|
} catch (err) {
|
|
5450
5840
|
throw new FilterEvaluationError(filter, err);
|
|
5451
5841
|
}
|
|
5452
|
-
|
|
5842
|
+
const inputCount = countRecords(data);
|
|
5843
|
+
const warn = (outcome) => {
|
|
5844
|
+
if (inputCount === 0)
|
|
5845
|
+
return;
|
|
5846
|
+
const note = buildFilterWarning(filter, data, outcome);
|
|
5847
|
+
getOutputSink().writeErr(`[WARN] ${note}
|
|
5848
|
+
`);
|
|
5849
|
+
onWarning?.(note);
|
|
5850
|
+
};
|
|
5851
|
+
const warnIfAllNull = (records) => {
|
|
5852
|
+
const keys = alwaysNullKeys(records);
|
|
5853
|
+
if (keys.length > 0)
|
|
5854
|
+
warn({ kind: "null-values", keys });
|
|
5855
|
+
};
|
|
5856
|
+
if (result == null) {
|
|
5857
|
+
warn({ kind: "empty" });
|
|
5453
5858
|
return [];
|
|
5859
|
+
}
|
|
5454
5860
|
if (Array.isArray(result)) {
|
|
5861
|
+
if (result.length === 0) {
|
|
5862
|
+
warn({ kind: "empty" });
|
|
5863
|
+
} else if (result.every((entry) => entry === null)) {
|
|
5864
|
+
warn({ kind: "null-elements", count: result.length });
|
|
5865
|
+
} else if (result.every((entry) => Array.isArray(entry)) && carriesOnlyNulls(result)) {
|
|
5866
|
+
warn({ kind: "null-rows", count: result.length });
|
|
5867
|
+
} else {
|
|
5868
|
+
warnIfAllNull(result);
|
|
5869
|
+
}
|
|
5455
5870
|
if (result.length > 0 && typeof result[0] !== "object") {
|
|
5456
5871
|
const fieldMatch = filter.match(/\.(\w+)$/);
|
|
5457
5872
|
const key = fieldMatch ? fieldMatch[1] : "Value";
|
|
@@ -5459,10 +5874,30 @@ function applyFilter(data, filter) {
|
|
|
5459
5874
|
}
|
|
5460
5875
|
return result;
|
|
5461
5876
|
}
|
|
5462
|
-
if (typeof result === "object")
|
|
5877
|
+
if (typeof result === "object") {
|
|
5878
|
+
warnIfAllNull([result]);
|
|
5463
5879
|
return result;
|
|
5880
|
+
}
|
|
5464
5881
|
return { Value: result };
|
|
5465
5882
|
}
|
|
5883
|
+
function filterFailureData(envelope) {
|
|
5884
|
+
const filter = getOutputFilter();
|
|
5885
|
+
const data = envelope.Data;
|
|
5886
|
+
if (!filter || data == null)
|
|
5887
|
+
return;
|
|
5888
|
+
let note;
|
|
5889
|
+
const [filterError, filtered] = catchError(() => applyFilter(data, filter, (n) => {
|
|
5890
|
+
note = n;
|
|
5891
|
+
}));
|
|
5892
|
+
if (filterError) {
|
|
5893
|
+
envelope.Warning = appendWarning(envelope.Warning, `--output-filter was not applied, so Data is shown in full: ${filterError.message}`);
|
|
5894
|
+
return;
|
|
5895
|
+
}
|
|
5896
|
+
envelope.Data = filtered;
|
|
5897
|
+
if (note) {
|
|
5898
|
+
envelope.Warning = appendWarning(envelope.Warning, note);
|
|
5899
|
+
}
|
|
5900
|
+
}
|
|
5466
5901
|
function defaultErrorCodeForResult(result) {
|
|
5467
5902
|
switch (result) {
|
|
5468
5903
|
case RESULTS.AuthenticationError:
|
|
@@ -5477,7 +5912,7 @@ function defaultErrorCodeForResult(result) {
|
|
|
5477
5912
|
return "unknown_error";
|
|
5478
5913
|
}
|
|
5479
5914
|
}
|
|
5480
|
-
function
|
|
5915
|
+
function parseHttpStatusFromMessage2(message) {
|
|
5481
5916
|
const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
|
|
5482
5917
|
if (!match)
|
|
5483
5918
|
return;
|
|
@@ -5506,10 +5941,10 @@ function defaultErrorCodeForHttpStatus(status) {
|
|
|
5506
5941
|
return "server_error";
|
|
5507
5942
|
return;
|
|
5508
5943
|
}
|
|
5509
|
-
var LOCAL_PERMISSION_TEXT_PATTERN =
|
|
5944
|
+
var LOCAL_PERMISSION_TEXT_PATTERN = new RegExp(`(?:\\b|\\()(?:${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})(?::\\s|\\))`);
|
|
5510
5945
|
function defaultErrorCodeForFailure(data) {
|
|
5511
5946
|
if (data.Result === RESULTS.Failure) {
|
|
5512
|
-
const status = data.Context?.httpStatus ??
|
|
5947
|
+
const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage2(data.Message);
|
|
5513
5948
|
const errorCode = defaultErrorCodeForHttpStatus(status);
|
|
5514
5949
|
if (errorCode)
|
|
5515
5950
|
return errorCode;
|
|
@@ -5545,8 +5980,14 @@ var OutputFormatter;
|
|
|
5545
5980
|
}
|
|
5546
5981
|
const filter = getOutputFilter();
|
|
5547
5982
|
if (filter) {
|
|
5548
|
-
|
|
5983
|
+
let note;
|
|
5984
|
+
const filtered = applyFilter(data.Data, filter, (n) => {
|
|
5985
|
+
note = n;
|
|
5986
|
+
});
|
|
5549
5987
|
data.Data = normalize ? normalizeDataKeys(filtered, verbatim, subtrees && { refs: subtrees.refs, mode: "skip" }) : filtered;
|
|
5988
|
+
if (note) {
|
|
5989
|
+
data.Warning = appendWarning(data.Warning, note);
|
|
5990
|
+
}
|
|
5550
5991
|
}
|
|
5551
5992
|
logOutput(normalizeOutputKeys(data), getOutputFormat(), options?.tableRowStyle);
|
|
5552
5993
|
}
|
|
@@ -5574,12 +6015,13 @@ var OutputFormatter;
|
|
|
5574
6015
|
delete envelope.TelemetryErrorClass;
|
|
5575
6016
|
delete envelope.TelemetryTerminalOutcome;
|
|
5576
6017
|
delete envelope.TelemetryTerminalSignal;
|
|
6018
|
+
filterFailureData(envelope);
|
|
5577
6019
|
if (!suppressTelemetry) {
|
|
5578
6020
|
telemetry.trackEvent(CommonTelemetryEvents.Error, {
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
6021
|
+
[ErrorDimensions.Result]: data.Result,
|
|
6022
|
+
[ErrorDimensions.ErrorCode]: data.ErrorCode,
|
|
6023
|
+
[ErrorDimensions.Retry]: data.Retry,
|
|
6024
|
+
[ErrorDimensions.ErrorMessage]: data.Message
|
|
5583
6025
|
});
|
|
5584
6026
|
}
|
|
5585
6027
|
logOutput(normalizeOutputKeys(envelope), getOutputFormat());
|
|
@@ -5622,13 +6064,20 @@ var OutputFormatter;
|
|
|
5622
6064
|
OutputFormatter.log = log;
|
|
5623
6065
|
function formatToString(data) {
|
|
5624
6066
|
const filter = getOutputFilter();
|
|
6067
|
+
const envelope = data;
|
|
5625
6068
|
if ("Data" in data && data.Data != null) {
|
|
5626
6069
|
data.Data = normalizeDataKeys(data.Data);
|
|
5627
6070
|
if (filter) {
|
|
5628
|
-
|
|
6071
|
+
let note;
|
|
6072
|
+
data.Data = normalizeDataKeys(applyFilter(data.Data, filter, (n) => {
|
|
6073
|
+
note = n;
|
|
6074
|
+
}));
|
|
6075
|
+
if (note) {
|
|
6076
|
+
envelope.Warning = appendWarning(envelope.Warning, note);
|
|
6077
|
+
}
|
|
5629
6078
|
}
|
|
5630
6079
|
}
|
|
5631
|
-
const output = normalizeOutputKeys(
|
|
6080
|
+
const output = normalizeOutputKeys(envelope);
|
|
5632
6081
|
const lines = [];
|
|
5633
6082
|
const sink = getOutputSink();
|
|
5634
6083
|
printOutput(output, getOutputFormat(), (msg) => {
|
|
@@ -5645,7 +6094,7 @@ var LEGACY_SKILL_NAMESPACE = "uipath:";
|
|
|
5645
6094
|
var MAX_SKILL_NAME_LENGTH = 80;
|
|
5646
6095
|
var SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
|
|
5647
6096
|
function productMode(productArea, mode) {
|
|
5648
|
-
return {
|
|
6097
|
+
return { ProductArea: productArea, Mode: mode };
|
|
5649
6098
|
}
|
|
5650
6099
|
function attributionRecord(groups) {
|
|
5651
6100
|
const record = {};
|
|
@@ -5703,6 +6152,7 @@ var COMMAND_ATTRIBUTION = commandAttribution([
|
|
|
5703
6152
|
["rpa", "build", ["uip.rpa-legacy"]],
|
|
5704
6153
|
["conversational", "operate", ["uip.conversational"]],
|
|
5705
6154
|
["agents", "build", ["uip.codedagent", "uip.agent"]],
|
|
6155
|
+
["coding-agents", "build", ["uip.coder"]],
|
|
5706
6156
|
["agenthub", "build", ["uip.agenthub"]],
|
|
5707
6157
|
["coded-apps", "build", ["uip.codedapp"]],
|
|
5708
6158
|
["functions", "build", ["uip.function", "uip.functions"]],
|
|
@@ -5793,7 +6243,7 @@ function normalizeLegacySkillName(value) {
|
|
|
5793
6243
|
function buildCommandTelemetryAttribution(commandPath, skillSource) {
|
|
5794
6244
|
const skillName = normalizeSkillName(skillSource);
|
|
5795
6245
|
return {
|
|
5796
|
-
...skillName ? {
|
|
6246
|
+
...skillName ? { SkillName: skillName } : {},
|
|
5797
6247
|
...getCommandProductModeAttribution(commandPath)
|
|
5798
6248
|
};
|
|
5799
6249
|
}
|
|
@@ -5804,31 +6254,63 @@ function buildSkillEventTelemetryAttribution(skillSource, uipSubcommand) {
|
|
|
5804
6254
|
return {
|
|
5805
6255
|
...skillAttribution,
|
|
5806
6256
|
...commandAttribution2,
|
|
5807
|
-
...skillName ? {
|
|
6257
|
+
...skillName ? { SkillName: skillName } : {}
|
|
5808
6258
|
};
|
|
5809
6259
|
}
|
|
6260
|
+
var AGENT_SESSION_ENV = {
|
|
6261
|
+
[BaseDimensions.AgentModel]: "UIPATH_AGENT_MODEL",
|
|
6262
|
+
[SkillsDimensions.PermissionMode]: "UIPATH_PERMISSION_MODE",
|
|
6263
|
+
[SkillsDimensions.EffortLevel]: "UIPATH_EFFORT_LEVEL",
|
|
6264
|
+
[SkillsDimensions.SkillsVersion]: "UIPATH_SKILLS_VERSION"
|
|
6265
|
+
};
|
|
6266
|
+
var MAX_TELEMETRY_TOKEN_LENGTH = 120;
|
|
6267
|
+
function sanitizeTelemetryToken(value) {
|
|
6268
|
+
return value.replace(/[^A-Za-z0-9:._/ -]/g, "_").slice(0, MAX_TELEMETRY_TOKEN_LENGTH);
|
|
6269
|
+
}
|
|
6270
|
+
function buildAgentSessionTelemetry(env) {
|
|
6271
|
+
const dimensions = {};
|
|
6272
|
+
for (const [key, variable] of Object.entries(AGENT_SESSION_ENV)) {
|
|
6273
|
+
const value = env[variable]?.trim();
|
|
6274
|
+
if (value) {
|
|
6275
|
+
dimensions[key] = sanitizeTelemetryToken(value);
|
|
6276
|
+
}
|
|
6277
|
+
}
|
|
6278
|
+
return dimensions;
|
|
6279
|
+
}
|
|
5810
6280
|
|
|
5811
6281
|
// ../common/src/telemetry/command-name.ts
|
|
5812
|
-
var
|
|
6282
|
+
var TELEMETRY_NAME_ROOT = "Cli";
|
|
6283
|
+
var CLI_COMMAND_ROOT = "uip";
|
|
6284
|
+
var TELEMETRY_NAME_BARE_ACTION = "Invoke";
|
|
5813
6285
|
function commandTelemetryName(parts) {
|
|
6286
|
+
const action = vetCommandTokens(parts).map(pascalizeToken).join("");
|
|
6287
|
+
return `${TELEMETRY_NAME_ROOT}.${action || TELEMETRY_NAME_BARE_ACTION}`;
|
|
6288
|
+
}
|
|
6289
|
+
function commandInvocationPath(parts) {
|
|
6290
|
+
return [CLI_COMMAND_ROOT, ...vetCommandTokens(parts)].join(" ");
|
|
6291
|
+
}
|
|
6292
|
+
function vetCommandTokens(parts) {
|
|
5814
6293
|
const tokens = [];
|
|
5815
6294
|
for (const part of parts) {
|
|
5816
|
-
const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !==
|
|
6295
|
+
const pieces = String(part ?? "").split(/\s+/).filter((token) => token && !token.startsWith("-") && token !== CLI_COMMAND_ROOT);
|
|
5817
6296
|
if (pieces.every(isCommandToken)) {
|
|
5818
6297
|
tokens.push(...pieces);
|
|
5819
6298
|
continue;
|
|
5820
6299
|
}
|
|
5821
6300
|
tokens.push(UNKNOWN_TOKEN);
|
|
5822
6301
|
}
|
|
5823
|
-
return
|
|
6302
|
+
return tokens;
|
|
6303
|
+
}
|
|
6304
|
+
function pascalizeToken(token) {
|
|
6305
|
+
return token.split("-").filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join("");
|
|
5824
6306
|
}
|
|
5825
|
-
var COMMAND_TOKEN_PATTERN = /^[a-
|
|
6307
|
+
var COMMAND_TOKEN_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
5826
6308
|
var MAX_COMMAND_TOKEN_LENGTH = 32;
|
|
5827
6309
|
var GUID_TOKEN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
5828
6310
|
function isCommandToken(token) {
|
|
5829
|
-
return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token)
|
|
6311
|
+
return token.length <= MAX_COMMAND_TOKEN_LENGTH && COMMAND_TOKEN_PATTERN.test(token) && !GUID_TOKEN.test(token);
|
|
5830
6312
|
}
|
|
5831
|
-
var UNKNOWN_TOKEN = "
|
|
6313
|
+
var UNKNOWN_TOKEN = "unknown";
|
|
5832
6314
|
|
|
5833
6315
|
// ../common/src/telemetry/invocation-request.ts
|
|
5834
6316
|
var requestContextSlot = singleton("TelemetryInvocationRequestContext");
|
|
@@ -5936,7 +6418,7 @@ function withheldArgumentValues(cmd) {
|
|
|
5936
6418
|
});
|
|
5937
6419
|
return values;
|
|
5938
6420
|
}
|
|
5939
|
-
function
|
|
6421
|
+
function deriveCommandParts(cmd) {
|
|
5940
6422
|
const parts = [];
|
|
5941
6423
|
let current = cmd;
|
|
5942
6424
|
while (current) {
|
|
@@ -5949,14 +6431,13 @@ function deriveCommandPath(cmd) {
|
|
|
5949
6431
|
if (parts.length > 1) {
|
|
5950
6432
|
parts.shift();
|
|
5951
6433
|
}
|
|
5952
|
-
return
|
|
6434
|
+
return parts;
|
|
5953
6435
|
}
|
|
5954
6436
|
function isErrorContext(value) {
|
|
5955
6437
|
return value !== null && typeof value === "object";
|
|
5956
6438
|
}
|
|
5957
6439
|
function commandHelpHint(commandPath) {
|
|
5958
|
-
|
|
5959
|
-
return `An unexpected error occurred. Run '${command} --help' to verify command syntax, or run with --log-level debug for details.`;
|
|
6440
|
+
return `An unexpected error occurred. Run '${commandPath} --help' to verify command syntax, or run with --log-level debug for details.`;
|
|
5960
6441
|
}
|
|
5961
6442
|
function isPromptCancellation(error) {
|
|
5962
6443
|
return error instanceof Error && error.name === "ExitPromptError";
|
|
@@ -5981,7 +6462,9 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5981
6462
|
yaml: getOutputFormat() === "yaml",
|
|
5982
6463
|
filter: getOutputFilter() !== undefined
|
|
5983
6464
|
});
|
|
5984
|
-
const
|
|
6465
|
+
const commandParts = deriveCommandParts(command);
|
|
6466
|
+
const telemetryName = commandTelemetryName(commandParts);
|
|
6467
|
+
const commandPath = commandInvocationPath(commandParts);
|
|
5985
6468
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
5986
6469
|
markCommandStart();
|
|
5987
6470
|
const supplied = recordSuppliedArgumentValues(withheldArgumentValues(command));
|
|
@@ -6016,7 +6499,7 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
6016
6499
|
Result: finalResult,
|
|
6017
6500
|
...customErrorCode ? { ErrorCode: customErrorCode } : {},
|
|
6018
6501
|
Message: errorMessage,
|
|
6019
|
-
Instructions: customInstructions ?? commandHelpHint(
|
|
6502
|
+
Instructions: customInstructions ?? commandHelpHint(commandPath),
|
|
6020
6503
|
...customRetry ? { Retry: customRetry } : {},
|
|
6021
6504
|
...customContext ? { Context: customContext } : {}
|
|
6022
6505
|
});
|
|
@@ -6033,8 +6516,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
6033
6516
|
recordedFailure,
|
|
6034
6517
|
pollSignal: context.pollSignal
|
|
6035
6518
|
});
|
|
6036
|
-
if (terminalTelemetry.
|
|
6037
|
-
telemetry.trackException(error instanceof Error ? error : new Error(String(error)), {
|
|
6519
|
+
if (terminalTelemetry[CommandDimensions.ErrorClass] === "internal" && error) {
|
|
6520
|
+
telemetry.trackException(error instanceof Error ? error : new Error(String(error)), { [CommandDimensions.CommandName]: commandPath }, getInvocationRequestContext());
|
|
6038
6521
|
}
|
|
6039
6522
|
const commandParams = extractCommandParams(command);
|
|
6040
6523
|
if (props) {
|
|
@@ -6045,10 +6528,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
6045
6528
|
const baseProperties = redactProperties({
|
|
6046
6529
|
...commandParams,
|
|
6047
6530
|
...props,
|
|
6048
|
-
...buildCommandTelemetryAttribution(
|
|
6049
|
-
|
|
6531
|
+
...buildCommandTelemetryAttribution(commandPath, process.env.UIPATH_SKILL),
|
|
6532
|
+
...buildAgentSessionTelemetry(process.env),
|
|
6533
|
+
[CommandDimensions.CommandName]: commandPath,
|
|
6534
|
+
[CommandDimensions.IsCommand]: "true",
|
|
6050
6535
|
...terminalTelemetry,
|
|
6051
|
-
...errorMessage ? { errorMessage } : {}
|
|
6536
|
+
...errorMessage ? { [CommandDimensions.ErrorMessage]: errorMessage } : {}
|
|
6052
6537
|
});
|
|
6053
6538
|
emitInvocationRequest(telemetryName, success, baseProperties);
|
|
6054
6539
|
} finally {
|
|
@@ -6200,7 +6685,7 @@ var FAILURE_STATUSES = new Set([
|
|
|
6200
6685
|
"stopped"
|
|
6201
6686
|
]);
|
|
6202
6687
|
// ../common/src/error-handler.ts
|
|
6203
|
-
var DEFAULT_401 = "Unauthorized (401). Run `uip login` to
|
|
6688
|
+
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.";
|
|
6204
6689
|
var NETWORK_ERROR_CODES = new Set([
|
|
6205
6690
|
"ECONNREFUSED",
|
|
6206
6691
|
"ECONNRESET",
|
|
@@ -6224,7 +6709,7 @@ var TLS_ERROR_CODES2 = new Set([
|
|
|
6224
6709
|
]);
|
|
6225
6710
|
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.";
|
|
6226
6711
|
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.";
|
|
6227
|
-
var
|
|
6712
|
+
var LOCAL_PERMISSION_MESSAGE_PATTERN = new RegExp(`\\b(${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})\\b`);
|
|
6228
6713
|
function carriedInstructions(error) {
|
|
6229
6714
|
if (!error || typeof error !== "object")
|
|
6230
6715
|
return;
|
|
@@ -6285,25 +6770,6 @@ function describeConnectivityError(error) {
|
|
|
6285
6770
|
}
|
|
6286
6771
|
return;
|
|
6287
6772
|
}
|
|
6288
|
-
function* walkErrorGraph(error) {
|
|
6289
|
-
const queue = [error];
|
|
6290
|
-
const seen = new Set;
|
|
6291
|
-
for (let steps = 0;queue.length > 0 && steps < 32; steps++) {
|
|
6292
|
-
const current = queue.shift();
|
|
6293
|
-
if (current === null || typeof current !== "object")
|
|
6294
|
-
continue;
|
|
6295
|
-
if (seen.has(current))
|
|
6296
|
-
continue;
|
|
6297
|
-
seen.add(current);
|
|
6298
|
-
const cur = current;
|
|
6299
|
-
yield cur;
|
|
6300
|
-
if (cur.cause !== undefined)
|
|
6301
|
-
queue.push(cur.cause);
|
|
6302
|
-
if (Array.isArray(cur.errors))
|
|
6303
|
-
queue.push(...cur.errors);
|
|
6304
|
-
}
|
|
6305
|
-
return;
|
|
6306
|
-
}
|
|
6307
6773
|
function extractErrorMessageSync(error) {
|
|
6308
6774
|
if (error instanceof Error) {
|
|
6309
6775
|
return error.message;
|
|
@@ -6677,6 +7143,40 @@ function canPrompt() {
|
|
|
6677
7143
|
const capabilities = getOutputSink().capabilities;
|
|
6678
7144
|
return capabilities.isInteractive && capabilities.canReadInput;
|
|
6679
7145
|
}
|
|
7146
|
+
// ../common/src/mime-types.ts
|
|
7147
|
+
var MIME_TYPES_BY_EXTENSION = Object.freeze({
|
|
7148
|
+
pdf: "application/pdf",
|
|
7149
|
+
png: "image/png",
|
|
7150
|
+
jpg: "image/jpeg",
|
|
7151
|
+
jpeg: "image/jpeg",
|
|
7152
|
+
gif: "image/gif",
|
|
7153
|
+
webp: "image/webp",
|
|
7154
|
+
bmp: "image/bmp",
|
|
7155
|
+
tif: "image/tiff",
|
|
7156
|
+
tiff: "image/tiff",
|
|
7157
|
+
svg: "image/svg+xml",
|
|
7158
|
+
txt: "text/plain",
|
|
7159
|
+
log: "text/plain",
|
|
7160
|
+
md: "text/markdown",
|
|
7161
|
+
csv: "text/csv",
|
|
7162
|
+
tsv: "text/tab-separated-values",
|
|
7163
|
+
json: "application/json",
|
|
7164
|
+
xml: "application/xml",
|
|
7165
|
+
html: "text/html",
|
|
7166
|
+
htm: "text/html",
|
|
7167
|
+
yaml: "application/yaml",
|
|
7168
|
+
yml: "application/yaml",
|
|
7169
|
+
doc: "application/msword",
|
|
7170
|
+
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
7171
|
+
xls: "application/vnd.ms-excel",
|
|
7172
|
+
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
7173
|
+
ppt: "application/vnd.ms-powerpoint",
|
|
7174
|
+
pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
7175
|
+
zip: "application/zip",
|
|
7176
|
+
mp3: "audio/mpeg",
|
|
7177
|
+
wav: "audio/wav",
|
|
7178
|
+
mp4: "video/mp4"
|
|
7179
|
+
});
|
|
6680
7180
|
// ../common/src/option-validators.ts
|
|
6681
7181
|
function parseBoundedInt(raw, optionName, bounds) {
|
|
6682
7182
|
const normalized = raw.trim();
|
|
@@ -6709,6 +7209,7 @@ var ScreenLogger;
|
|
|
6709
7209
|
ScreenLogger.progress = progress;
|
|
6710
7210
|
})(ScreenLogger ||= {});
|
|
6711
7211
|
// ../common/src/sdk-user-agent.ts
|
|
7212
|
+
var AGENT_PROPERTY = BaseDimensions.Agent;
|
|
6712
7213
|
var sdkUserAgentHostToken = singleton("SdkUserAgentHostToken");
|
|
6713
7214
|
function setSdkUserAgentHostToken(token) {
|
|
6714
7215
|
if (token === undefined) {
|
|
@@ -6755,6 +7256,6 @@ var factorySlot = singleton("PackagerFactoryProvider");
|
|
|
6755
7256
|
function setPackagerFactoryProvider(provider) {
|
|
6756
7257
|
factorySlot.set(provider);
|
|
6757
7258
|
}
|
|
6758
|
-
export { redactProperties, catchError, carriedInstructions, formatErrorChain, describeConnectivityError, extractErrorMessageSync, setExitCode, getExitCode, runWithSink, getOutputSink, setGlobalSink, LogLevel, logger, configureLogger, loadOutputCodecsAsync, setOutputFormat, getOutputFormat, setOutputFormatExplicit, getOutputFormatExplicit, setHelpRequested, getHelpRequested, setOutputFilter, OUTPUT_FORMATS, isOutputFormat, takeRecordedCommandFailureTelemetry, buildCommandTerminalTelemetryProperties, detectAgent, detectAgentVersion, buildEnvironmentProperties, setExecutionContextAuthSignal, setGlobalTelemetryProperties, runWithTimings, setTimingCommand, recordExitCode, suppressTimingReport, makeTrackedFetch, setProxyAuthHttpsAgent, isTelemetryDisabled, TELEMETRY_DRAIN_ARGV, setTelemetrySidecarEntry, claimPendingSpoolFiles, releaseClaimedSpoolFile, discardClaimedSpoolFile, sweepTelemetrySpool, getTelemetryIngestionOrigin, telemetry, telemetryInit, telemetryFlushAndShutdown, telemetryShutdownWithoutFlush, carriedErrorCode, carriedRetry, RESULTS, EXIT_CODES, Pagination, validateOutputFilter, OutputFormatter, Command, setPreviewBuild, buildSkillEventTelemetryAttribution, commandTelemetryName, runWithInvocationRequest, emitInvocationRequest, processContext, setProcessContextPollSignal, TELEMETRY_ARG_VALUE_WITHHELD, extractCommandHelp, collectCommands, getCompleter, requireConfirmation, installConsoleGuard, UIPATH_HOME_DIR, CONFIG_FILENAME, DEFAULT_FETCH_TIMEOUT_MS, resolveEnvReference, setInteractivityMode, setInteractiveFlag, wasInteractiveFlagPassed, canPrompt, parseBoundedInt, splitScopeList, REGISTER_EXPORT, createPollAbortController, setSdkUserAgentHostToken, readStdinWithTimeout, setPackagerFactoryProvider };
|
|
7259
|
+
export { redactProperties, catchError, carriedInstructions, formatErrorChain, describeConnectivityError, extractErrorMessageSync, setExitCode, getExitCode, runWithSink, getOutputSink, setGlobalSink, LogLevel, logger, configureLogger, loadOutputCodecsAsync, setOutputFormat, getOutputFormat, setOutputFormatExplicit, getOutputFormatExplicit, setHelpRequested, getHelpRequested, setOutputFilter, OUTPUT_FORMATS, isOutputFormat, CLI_APPLICATION_NAME, BaseDimensions, CommandDimensions, AuthDimensions, SkillsDimensions, assertNoCuratedDimensionTargets, takeRecordedCommandFailureTelemetry, buildCommandTerminalTelemetryProperties, CommonTelemetryEvents, detectAgent, detectAgentVersion, buildEnvironmentProperties, setExecutionContextAuthSignal, setGlobalTelemetryProperties, runWithTimings, setTimingCommand, recordExitCode, suppressTimingReport, makeTrackedFetch, setProxyAuthHttpsAgent, isTelemetryDisabled, TELEMETRY_DRAIN_ARGV, setTelemetrySidecarEntry, claimPendingSpoolFiles, releaseClaimedSpoolFile, discardClaimedSpoolFile, sweepTelemetrySpool, getTelemetryIngestionOrigin, telemetry, telemetryInit, telemetryFlushAndShutdown, telemetryShutdownWithoutFlush, carriedErrorCode, carriedRetry, RESULTS, EXIT_CODES, Pagination, validateOutputFilter, OutputFormatter, Command, Option, setPreviewBuild, buildSkillEventTelemetryAttribution, sanitizeTelemetryToken, commandTelemetryName, commandInvocationPath, runWithInvocationRequest, emitInvocationRequest, processContext, setProcessContextPollSignal, TELEMETRY_ARG_VALUE_WITHHELD, extractCommandHelp, collectCommands, getCompleter, requireConfirmation, installConsoleGuard, UIPATH_HOME_DIR, CONFIG_FILENAME, DEFAULT_FETCH_TIMEOUT_MS, resolveEnvReference, setInteractivityMode, setInteractiveFlag, wasInteractiveFlagPassed, canPrompt, parseBoundedInt, splitScopeList, REGISTER_EXPORT, createPollAbortController, setSdkUserAgentHostToken, readStdinWithTimeout, setPackagerFactoryProvider };
|
|
6759
7260
|
|
|
6760
|
-
//# debugId=
|
|
7261
|
+
//# debugId=1D9D9C9A9F64EBFE64756E2164756E21
|