@uipath/agent-tool 1.205.0-preview.277 → 1.206.0-preview.279
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 +51 -0
- package/dist/THIRD-PARTY-NOTICES.md +5 -5
- package/dist/agent-tool-OK5DK57D-bjevqt47.js +10 -0
- package/dist/{de-MUJPA4EB-209jpeqe.js → de-AI7ML6JM-km47f8k4.js} +47 -5
- package/dist/{embedded-file-reader-r66242ey.js → embedded-file-reader-0228j82a.js} +1 -4
- package/dist/en-LAVDF7IQ-xe939kq1.js +254 -0
- package/dist/{es-MX-2MYFZU7X-6v0q5rbn.js → es-MX-7KJZPEQN-1fq0a9jr.js} +47 -5
- package/dist/{es-7SE7HX2X-qda7whn6.js → es-SPNKTD5Y-vw5cbgv5.js} +47 -5
- package/dist/executor-tool.js +8 -10
- package/dist/first-party-service-ahcc6xc6.js +8 -0
- package/dist/{fr-MDFKNZ4C-qmypp92m.js → fr-AXJGUT53-hdg3pmd4.js} +47 -5
- package/dist/index-20nm3a1t.js +36 -0
- package/dist/{index-ar269vgy.js → index-js1wb4x0.js} +223 -199
- package/dist/{index-h8cph72k.js → index-nzr4mx5p.js} +2 -22
- package/dist/index-ybw87d41.js +21 -0
- package/dist/index-z2qk2qn6.js +24 -0
- package/dist/index.js +15 -19
- package/dist/{ja-UTQEAP34-hvyf683h.js → ja-C7GZV6YP-hvtbngr5.js} +47 -5
- package/dist/{jmespath-e4a59c8w.js → jmespath-ab6tdc42.js} +1 -1
- package/dist/{js-yaml-87cdx6bm.js → js-yaml-a2bk27p6.js} +1 -3
- package/dist/{ko-AXCHW2OK-pkwdcbmx.js → ko-Q24HSSL4-5vn55pte.js} +47 -5
- package/dist/{memory-runtime-service-h9wdsd31.js → memory-runtime-service-h5bqa30b.js} +16 -27
- package/dist/{packager-tool-je2re4j6.js → packager-tool-0ajs8pnk.js} +53 -8
- package/dist/packager-tool-1593sna4.js +1434 -0
- package/dist/{packager-tool-tvk12a3f.js → packager-tool-1cn7vbjr.js} +49 -60
- package/dist/{packager-tool-fza8z686.js → packager-tool-21r3phhc.js} +984 -467
- package/dist/{packager-tool-jd8cfevc.js → packager-tool-4j09ztk2.js} +10 -40
- package/dist/{packager-tool-22e4nhzm.js → packager-tool-4shqngrj.js} +2 -2
- package/dist/packager-tool-bh92xy8d.js +17988 -0
- package/dist/{packager-tool-nzxk0smk.js → packager-tool-d1tw3gdx.js} +1533 -726
- package/dist/{packager-tool-1yh8g550.js → packager-tool-epsr41wx.js} +8 -12
- package/dist/packager-tool-fc08rcbk.js +253 -0
- package/dist/{packager-tool-xbzpm6s2.js → packager-tool-kawtadzm.js} +44 -38
- package/dist/{packager-tool-gdtpsdn7.js → packager-tool-mm1x18d6.js} +223 -28
- package/dist/{packager-tool-vwsq85y7.js → packager-tool-qr8dtv3r.js} +35 -18
- package/dist/{packager-tool-7sbsrgd5.js → packager-tool-qvsazy59.js} +6 -7
- package/dist/{packager-tool-b098y4a2.js → packager-tool-wbksf242.js} +97 -97
- package/dist/packager-tool-z6a5nr2d.js +2342 -0
- package/dist/packager-tool.js +5 -9
- package/dist/{pt-BR-Y6K6XHXK-37a932vp.js → pt-BR-BIUJXIPU-2sqzhr8y.js} +47 -5
- package/dist/{pt-3DIO5QWG-hb763vct.js → pt-MHX6JGAX-xfgvdqwg.js} +47 -5
- package/dist/{ro-BWR3ONRR-jmap5ajd.js → ro-3RKJNGJZ-xqj14e3d.js} +47 -5
- package/dist/{ru-WBLQ5B2U-8r3c7v6d.js → ru-WBLQ5B2U-bf20yr5y.js} +1 -4
- package/dist/solution-auth-wmeqt2hh.js +10 -0
- package/dist/tool.js +14 -18
- package/dist/{tr-5IIHSFW5-stsb3dar.js → tr-PQLUUHPC-qsb7btxn.js} +47 -5
- package/dist/{zh-CN-R2KU4U5L-q4yhc33t.js → zh-CN-OHNTHZRI-b0hjkfqn.js} +47 -5
- package/dist/{zh-TW-GNKMELBF-r4ay2475.js → zh-TW-E4D3Y6ZR-tn3bmzz5.js} +47 -5
- package/package.json +2 -2
- package/dist/agent-tool-OK5DK57D-1654w938.js +0 -12
- package/dist/en-GN2ZGWUE-03z2df4k.js +0 -136
- package/dist/first-party-service-srxaftkn.js +0 -27
- package/dist/index-aa5b4rsq.js +0 -3174
- package/dist/index-dt7brq9y.js +0 -666
- package/dist/index-kmp9fmhb.js +0 -25
- package/dist/packager-tool-4mna26cc.js +0 -133
- package/dist/packager-tool-53w8skv5.js +0 -262
- package/dist/packager-tool-607v4t05.js +0 -22083
- package/dist/packager-tool-c23zrhj8.js +0 -11
- package/dist/packager-tool-emspfs60.js +0 -31133
- package/dist/packager-tool-n9qkcp5y.js +0 -5365
- package/dist/solution-auth-h0yjcbsy.js +0 -11
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getFileSystem
|
|
3
|
-
} from "./packager-tool-
|
|
3
|
+
} from "./packager-tool-0ajs8pnk.js";
|
|
4
4
|
import {
|
|
5
|
+
__toESM,
|
|
5
6
|
__commonJS,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from "./packager-tool-
|
|
7
|
+
__exportCjs,
|
|
8
|
+
__require
|
|
9
|
+
} from "./packager-tool-epsr41wx.js";
|
|
9
10
|
|
|
10
11
|
// ../../node_modules/commander/lib/error.js
|
|
11
12
|
var require_error = __commonJS(function(exports) {
|
|
@@ -127,7 +128,7 @@ var require_help = __commonJS(function(exports) {
|
|
|
127
128
|
this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;
|
|
128
129
|
}
|
|
129
130
|
visibleCommands(cmd) {
|
|
130
|
-
const visibleCommands = cmd.commands.filter((
|
|
131
|
+
const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);
|
|
131
132
|
const helpCommand = cmd._getHelpCommand();
|
|
132
133
|
if (helpCommand && !helpCommand._hidden) {
|
|
133
134
|
visibleCommands.push(helpCommand);
|
|
@@ -607,8 +608,8 @@ var require_option = __commonJS(function(exports) {
|
|
|
607
608
|
}
|
|
608
609
|
}
|
|
609
610
|
function camelcase(str) {
|
|
610
|
-
return str.split("-").reduce((
|
|
611
|
-
return
|
|
611
|
+
return str.split("-").reduce((str, word) => {
|
|
612
|
+
return str + word[0].toUpperCase() + word.slice(1);
|
|
612
613
|
});
|
|
613
614
|
}
|
|
614
615
|
function splitOptionFlags(flags) {
|
|
@@ -1179,44 +1180,44 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1179
1180
|
});
|
|
1180
1181
|
return source;
|
|
1181
1182
|
}
|
|
1182
|
-
_prepareUserArgs(
|
|
1183
|
-
if (
|
|
1183
|
+
_prepareUserArgs(argv2, parseOptions) {
|
|
1184
|
+
if (argv2 !== undefined && !Array.isArray(argv2)) {
|
|
1184
1185
|
throw new Error("first parameter to parse must be array or undefined");
|
|
1185
1186
|
}
|
|
1186
1187
|
parseOptions = parseOptions || {};
|
|
1187
|
-
if (
|
|
1188
|
+
if (argv2 === undefined && parseOptions.from === undefined) {
|
|
1188
1189
|
if (process2.versions?.electron) {
|
|
1189
1190
|
parseOptions.from = "electron";
|
|
1190
1191
|
}
|
|
1191
|
-
const
|
|
1192
|
-
if (
|
|
1192
|
+
const execArgv2 = process2.execArgv ?? [];
|
|
1193
|
+
if (execArgv2.includes("-e") || execArgv2.includes("--eval") || execArgv2.includes("-p") || execArgv2.includes("--print")) {
|
|
1193
1194
|
parseOptions.from = "eval";
|
|
1194
1195
|
}
|
|
1195
1196
|
}
|
|
1196
|
-
if (
|
|
1197
|
-
|
|
1197
|
+
if (argv2 === undefined) {
|
|
1198
|
+
argv2 = process2.argv;
|
|
1198
1199
|
}
|
|
1199
|
-
this.rawArgs =
|
|
1200
|
+
this.rawArgs = argv2.slice();
|
|
1200
1201
|
let userArgs;
|
|
1201
1202
|
switch (parseOptions.from) {
|
|
1202
1203
|
case undefined:
|
|
1203
1204
|
case "node":
|
|
1204
|
-
this._scriptPath =
|
|
1205
|
-
userArgs =
|
|
1205
|
+
this._scriptPath = argv2[1];
|
|
1206
|
+
userArgs = argv2.slice(2);
|
|
1206
1207
|
break;
|
|
1207
1208
|
case "electron":
|
|
1208
1209
|
if (process2.defaultApp) {
|
|
1209
|
-
this._scriptPath =
|
|
1210
|
-
userArgs =
|
|
1210
|
+
this._scriptPath = argv2[1];
|
|
1211
|
+
userArgs = argv2.slice(2);
|
|
1211
1212
|
} else {
|
|
1212
|
-
userArgs =
|
|
1213
|
+
userArgs = argv2.slice(1);
|
|
1213
1214
|
}
|
|
1214
1215
|
break;
|
|
1215
1216
|
case "user":
|
|
1216
|
-
userArgs =
|
|
1217
|
+
userArgs = argv2.slice(0);
|
|
1217
1218
|
break;
|
|
1218
1219
|
case "eval":
|
|
1219
|
-
userArgs =
|
|
1220
|
+
userArgs = argv2.slice(1);
|
|
1220
1221
|
break;
|
|
1221
1222
|
default:
|
|
1222
1223
|
throw new Error(`unexpected parse option { from: '${parseOptions.from}' }`);
|
|
@@ -1739,18 +1740,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1739
1740
|
this.error(message, { code: "commander.missingMandatoryOptionValue" });
|
|
1740
1741
|
}
|
|
1741
1742
|
_conflictingOption(option, conflictingOption) {
|
|
1742
|
-
const findBestOptionFromValue = (
|
|
1743
|
-
const optionKey =
|
|
1743
|
+
const findBestOptionFromValue = (option) => {
|
|
1744
|
+
const optionKey = option.attributeName();
|
|
1744
1745
|
const optionValue = this.getOptionValue(optionKey);
|
|
1745
1746
|
const negativeOption = this.options.find((target) => target.negate && optionKey === target.attributeName());
|
|
1746
1747
|
const positiveOption = this.options.find((target) => !target.negate && optionKey === target.attributeName());
|
|
1747
1748
|
if (negativeOption && (negativeOption.presetArg === undefined && optionValue === false || negativeOption.presetArg !== undefined && optionValue === negativeOption.presetArg)) {
|
|
1748
1749
|
return negativeOption;
|
|
1749
1750
|
}
|
|
1750
|
-
return positiveOption ||
|
|
1751
|
+
return positiveOption || option;
|
|
1751
1752
|
};
|
|
1752
|
-
const getErrorMessage = (
|
|
1753
|
-
const bestOption = findBestOptionFromValue(
|
|
1753
|
+
const getErrorMessage = (option) => {
|
|
1754
|
+
const bestOption = findBestOptionFromValue(option);
|
|
1754
1755
|
const optionKey = bestOption.attributeName();
|
|
1755
1756
|
const source = this.getOptionValueSource(optionKey);
|
|
1756
1757
|
if (source === "env") {
|
|
@@ -1904,10 +1905,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1904
1905
|
this._name = path.basename(filename, path.extname(filename));
|
|
1905
1906
|
return this;
|
|
1906
1907
|
}
|
|
1907
|
-
executableDir(
|
|
1908
|
-
if (
|
|
1908
|
+
executableDir(path) {
|
|
1909
|
+
if (path === undefined)
|
|
1909
1910
|
return this._executableDir;
|
|
1910
|
-
this._executableDir =
|
|
1911
|
+
this._executableDir = path;
|
|
1911
1912
|
return this;
|
|
1912
1913
|
}
|
|
1913
1914
|
helpInformation(contextOptions) {
|
|
@@ -2004,11 +2005,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2004
2005
|
}
|
|
2005
2006
|
help(contextOptions) {
|
|
2006
2007
|
this.outputHelp(contextOptions);
|
|
2007
|
-
let
|
|
2008
|
-
if (
|
|
2009
|
-
|
|
2008
|
+
let exitCode2 = Number(process2.exitCode ?? 0);
|
|
2009
|
+
if (exitCode2 === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) {
|
|
2010
|
+
exitCode2 = 1;
|
|
2010
2011
|
}
|
|
2011
|
-
this._exit(
|
|
2012
|
+
this._exit(exitCode2, "commander.help", "(outputHelp)");
|
|
2012
2013
|
}
|
|
2013
2014
|
addHelpText(position, text) {
|
|
2014
2015
|
const allowedValues = ["beforeAll", "before", "after", "afterAll"];
|
|
@@ -2080,25 +2081,207 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2080
2081
|
exports.useColor = useColor;
|
|
2081
2082
|
});
|
|
2082
2083
|
|
|
2083
|
-
//
|
|
2084
|
-
var
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2084
|
+
// ../common/src/telemetry/telemetry-dimensions.ts
|
|
2085
|
+
var BaseDimensions = {
|
|
2086
|
+
ApplicationName: "ApplicationName",
|
|
2087
|
+
ProductVersion: "ProductVersion",
|
|
2088
|
+
InstallationId: "InstallationId",
|
|
2089
|
+
CloudUserId: "CloudUserId",
|
|
2090
|
+
CloudTenantId: "CloudTenantId",
|
|
2091
|
+
CloudOrganizationId: "CloudOrganizationId",
|
|
2092
|
+
IsInternalUser: "IsInternalUser",
|
|
2093
|
+
Environment: "Environment",
|
|
2094
|
+
BaseUrl: "BaseUrl",
|
|
2095
|
+
Region: "Region",
|
|
2096
|
+
Agent: "Agent",
|
|
2097
|
+
AgentVersion: "AgentVersion",
|
|
2098
|
+
AgentModel: "AgentModel",
|
|
2099
|
+
ToolName: "ToolName",
|
|
2100
|
+
ToolVersion: "ToolVersion",
|
|
2101
|
+
ExecutionContext: "ExecutionContext",
|
|
2102
|
+
CiProvider: "CiProvider",
|
|
2103
|
+
SessionIdSource: "SessionIdSource",
|
|
2104
|
+
SessionId: "SessionId"
|
|
2105
|
+
};
|
|
2106
|
+
var CommandDimensions = {
|
|
2107
|
+
IsCommand: "IsCommand",
|
|
2108
|
+
IsReexec: "IsReexec",
|
|
2109
|
+
CommandName: "CommandName",
|
|
2110
|
+
ExitCode: "ExitCode",
|
|
2111
|
+
TerminalOutcome: "TerminalOutcome",
|
|
2112
|
+
ErrorClass: "ErrorClass",
|
|
2113
|
+
TerminalSignal: "TerminalSignal",
|
|
2114
|
+
ErrorMessage: "ErrorMessage",
|
|
2115
|
+
SkillName: "SkillName",
|
|
2116
|
+
ProductArea: "ProductArea",
|
|
2117
|
+
Mode: "Mode"
|
|
2118
|
+
};
|
|
2119
|
+
var ProjectDimensions = {
|
|
2120
|
+
ProjectKey: "ProjectKey",
|
|
2121
|
+
ProjectType: "ProjectType",
|
|
2122
|
+
ProjectIdentityStatus: "ProjectIdentityStatus",
|
|
2123
|
+
SolutionKey: "SolutionKey",
|
|
2124
|
+
SolutionProjectKey: "SolutionProjectKey",
|
|
2125
|
+
SolutionIdentityStatus: "SolutionIdentityStatus",
|
|
2126
|
+
PreviousSolutionKey: "PreviousSolutionKey"
|
|
2127
|
+
};
|
|
2128
|
+
var GUID_KEY_DIMENSIONS = new Set([
|
|
2129
|
+
ProjectDimensions.ProjectKey,
|
|
2130
|
+
ProjectDimensions.SolutionKey,
|
|
2131
|
+
ProjectDimensions.SolutionProjectKey,
|
|
2132
|
+
ProjectDimensions.PreviousSolutionKey
|
|
2133
|
+
]);
|
|
2134
|
+
var ShipDimensions = {
|
|
2135
|
+
ShipKind: "ShipKind",
|
|
2136
|
+
Target: "Target",
|
|
2137
|
+
ProjectType: "ProjectType",
|
|
2138
|
+
ProjectTypes: "ProjectTypes",
|
|
2139
|
+
ArtifactCorrelationKey: "ArtifactCorrelationKey",
|
|
2140
|
+
PackageName: "PackageName",
|
|
2141
|
+
PackageVersion: "PackageVersion",
|
|
2142
|
+
PackageVersionKey: "PackageVersionKey",
|
|
2143
|
+
DeploymentKey: "DeploymentKey",
|
|
2144
|
+
SolutionId: "SolutionId",
|
|
2145
|
+
FolderKey: "FolderKey",
|
|
2146
|
+
FeedId: "FeedId"
|
|
2147
|
+
};
|
|
2148
|
+
var ErrorDimensions = {
|
|
2149
|
+
Result: "Result",
|
|
2150
|
+
ErrorCode: "ErrorCode",
|
|
2151
|
+
Retry: "Retry",
|
|
2152
|
+
ErrorMessage: "ErrorMessage",
|
|
2153
|
+
HttpStatus: "HttpStatus",
|
|
2154
|
+
UpstreamErrorCode: "UpstreamErrorCode"
|
|
2155
|
+
};
|
|
2156
|
+
var AuthDimensions = {
|
|
2157
|
+
AuthenticationMethod: "AuthenticationMethod",
|
|
2158
|
+
Success: "Success",
|
|
2159
|
+
Reason: "Reason"
|
|
2160
|
+
};
|
|
2161
|
+
var SkillsDimensions = {
|
|
2162
|
+
SchemaVersion: "SchemaVersion",
|
|
2163
|
+
AgentType: "AgentType",
|
|
2164
|
+
SkillsVersion: "SkillsVersion",
|
|
2165
|
+
UipSubcommand: "UipSubcommand",
|
|
2166
|
+
FileExtension: "FileExtension",
|
|
2167
|
+
SubagentModel: "SubagentModel",
|
|
2168
|
+
SubagentType: "SubagentType",
|
|
2169
|
+
PermissionMode: "PermissionMode",
|
|
2170
|
+
EffortLevel: "EffortLevel",
|
|
2171
|
+
SessionSource: "SessionSource",
|
|
2172
|
+
Outcome: "Outcome",
|
|
2173
|
+
DurationMs: "DurationMs",
|
|
2174
|
+
Source: "Source"
|
|
2175
|
+
};
|
|
2176
|
+
var PackagerDimensions = {
|
|
2177
|
+
ProjectId: "ProjectId",
|
|
2178
|
+
ProjectType: "ProjectType",
|
|
2179
|
+
SolutionId: "SolutionId"
|
|
2180
|
+
};
|
|
2181
|
+
var ScopeDimensions = {
|
|
2182
|
+
FolderId: "FolderId"
|
|
2183
|
+
};
|
|
2184
|
+
var ID_DIMENSIONS = new Set([
|
|
2185
|
+
BaseDimensions.CloudUserId,
|
|
2186
|
+
BaseDimensions.CloudTenantId,
|
|
2187
|
+
BaseDimensions.CloudOrganizationId,
|
|
2188
|
+
BaseDimensions.InstallationId,
|
|
2189
|
+
ShipDimensions.ArtifactCorrelationKey,
|
|
2190
|
+
ShipDimensions.PackageVersionKey,
|
|
2191
|
+
ShipDimensions.DeploymentKey,
|
|
2192
|
+
ShipDimensions.SolutionId,
|
|
2193
|
+
ShipDimensions.FolderKey,
|
|
2194
|
+
ShipDimensions.FeedId,
|
|
2195
|
+
PackagerDimensions.ProjectId
|
|
2196
|
+
]);
|
|
2197
|
+
var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
|
|
2198
|
+
var RESERVED_DIMENSION_NAMES = new Set([
|
|
2199
|
+
...Object.values(BaseDimensions),
|
|
2200
|
+
...Object.values(CommandDimensions),
|
|
2201
|
+
...Object.values(ShipDimensions),
|
|
2202
|
+
...Object.values(ProjectDimensions),
|
|
2203
|
+
...Object.values(ErrorDimensions),
|
|
2204
|
+
...Object.values(AuthDimensions),
|
|
2205
|
+
...Object.values(SkillsDimensions),
|
|
2206
|
+
...Object.values(PackagerDimensions),
|
|
2207
|
+
...Object.values(ScopeDimensions)
|
|
2208
|
+
]);
|
|
2209
|
+
var CURATED_DIMENSIONS = new Set([
|
|
2210
|
+
BaseDimensions.ApplicationName,
|
|
2211
|
+
BaseDimensions.ProductVersion,
|
|
2212
|
+
BaseDimensions.InstallationId,
|
|
2213
|
+
BaseDimensions.CloudUserId,
|
|
2214
|
+
BaseDimensions.CloudTenantId,
|
|
2215
|
+
BaseDimensions.CloudOrganizationId,
|
|
2216
|
+
BaseDimensions.IsInternalUser,
|
|
2217
|
+
BaseDimensions.Environment,
|
|
2218
|
+
BaseDimensions.BaseUrl,
|
|
2219
|
+
BaseDimensions.Region,
|
|
2220
|
+
BaseDimensions.Agent,
|
|
2221
|
+
BaseDimensions.AgentVersion,
|
|
2222
|
+
BaseDimensions.ToolVersion,
|
|
2223
|
+
BaseDimensions.ExecutionContext,
|
|
2224
|
+
BaseDimensions.CiProvider,
|
|
2225
|
+
BaseDimensions.SessionIdSource,
|
|
2226
|
+
BaseDimensions.SessionId,
|
|
2227
|
+
...Object.values(CommandDimensions),
|
|
2228
|
+
...Object.values(ShipDimensions),
|
|
2229
|
+
...Object.values(ProjectDimensions)
|
|
2230
|
+
]);
|
|
2231
|
+
function lowercaseIdDimensionValues(properties) {
|
|
2232
|
+
let changed = false;
|
|
2233
|
+
const result = {
|
|
2234
|
+
...properties
|
|
2235
|
+
};
|
|
2236
|
+
for (const key of Object.keys(result)) {
|
|
2237
|
+
const value = result[key];
|
|
2238
|
+
if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
|
|
2239
|
+
continue;
|
|
2240
|
+
}
|
|
2241
|
+
const lowered = value.toLowerCase();
|
|
2242
|
+
if (lowered !== value) {
|
|
2243
|
+
result[key] = lowered;
|
|
2244
|
+
changed = true;
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
return changed ? result : properties;
|
|
2248
|
+
}
|
|
2249
|
+
|
|
2250
|
+
// ../common/src/telemetry/project-identity.ts
|
|
2251
|
+
function projectKey(id) {
|
|
2252
|
+
if (typeof id !== "string")
|
|
2253
|
+
return;
|
|
2254
|
+
const key = id.trim().toLowerCase().replaceAll("-", "");
|
|
2255
|
+
return /^[0-9a-f]{32}$/.test(key) ? key : undefined;
|
|
2256
|
+
}
|
|
2257
|
+
function projectIdentityProperties(identity) {
|
|
2258
|
+
const key = identity.id ? projectKey(identity.id) : undefined;
|
|
2259
|
+
return {
|
|
2260
|
+
[ProjectDimensions.ProjectIdentityStatus]: identity.status === "resolved" && !key ? "invalid" : identity.status,
|
|
2261
|
+
[ProjectDimensions.ProjectType]: identity.projectType,
|
|
2262
|
+
...identity.status === "resolved" && key ? {
|
|
2263
|
+
[ProjectDimensions.ProjectKey]: key
|
|
2264
|
+
} : {}
|
|
2265
|
+
};
|
|
2266
|
+
}
|
|
2267
|
+
var PROJECT_IDENTITY_LOOKUP_BUDGET_MS = 1000;
|
|
2268
|
+
async function withinProjectIdentityBudget(work, onTimeout) {
|
|
2269
|
+
work.catch(() => {
|
|
2270
|
+
return;
|
|
2271
|
+
});
|
|
2272
|
+
let timer;
|
|
2273
|
+
const expired = new Promise((resolve) => {
|
|
2274
|
+
timer = setTimeout(() => {
|
|
2275
|
+
onTimeout?.();
|
|
2276
|
+
resolve(undefined);
|
|
2277
|
+
}, PROJECT_IDENTITY_LOOKUP_BUDGET_MS);
|
|
2278
|
+
});
|
|
2279
|
+
try {
|
|
2280
|
+
return await Promise.race([work, expired]);
|
|
2281
|
+
} finally {
|
|
2282
|
+
clearTimeout(timer);
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2102
2285
|
|
|
2103
2286
|
// ../common/src/telemetry/pseudonymize.ts
|
|
2104
2287
|
var PSEUDONYM_DOMAIN = "uipath-cli/telemetry/pseudonym/v1:";
|
|
@@ -2563,6 +2746,8 @@ function redactProperty(name, value) {
|
|
|
2563
2746
|
if (isSensitiveName(name)) {
|
|
2564
2747
|
return REDACTED;
|
|
2565
2748
|
}
|
|
2749
|
+
if (GUID_KEY_DIMENSIONS.has(name))
|
|
2750
|
+
return projectKey(value);
|
|
2566
2751
|
if (typeof value === "boolean" || typeof value === "number") {
|
|
2567
2752
|
return value;
|
|
2568
2753
|
}
|
|
@@ -2637,21 +2822,121 @@ function settlePromiseLike(thenable) {
|
|
|
2637
2822
|
return Promise.resolve(thenable).then((data) => [undefined, data]).catch((error) => [toError(error), undefined]);
|
|
2638
2823
|
}
|
|
2639
2824
|
|
|
2825
|
+
// ../../node_modules/commander/index.js
|
|
2826
|
+
var exports_commander = {};
|
|
2827
|
+
__exportCjs(exports_commander, {
|
|
2828
|
+
program: () => $program,
|
|
2829
|
+
createCommand: () => $createCommand,
|
|
2830
|
+
createOption: () => $createOption,
|
|
2831
|
+
createArgument: () => $createArgument,
|
|
2832
|
+
Command: () => $Command,
|
|
2833
|
+
Option: () => $Option,
|
|
2834
|
+
Argument: () => $Argument,
|
|
2835
|
+
Help: () => $Help,
|
|
2836
|
+
CommanderError: () => $CommanderError,
|
|
2837
|
+
InvalidArgumentError: () => $InvalidArgumentError,
|
|
2838
|
+
InvalidOptionArgumentError: () => $InvalidOptionArgumentError
|
|
2839
|
+
}, {
|
|
2840
|
+
program: (value) => $program = value,
|
|
2841
|
+
createCommand: (value) => $createCommand = value,
|
|
2842
|
+
createOption: (value) => $createOption = value,
|
|
2843
|
+
createArgument: (value) => $createArgument = value,
|
|
2844
|
+
Command: (value) => $Command = value,
|
|
2845
|
+
Option: (value) => $Option = value,
|
|
2846
|
+
Argument: (value) => $Argument = value,
|
|
2847
|
+
Help: (value) => $Help = value,
|
|
2848
|
+
CommanderError: (value) => $CommanderError = value,
|
|
2849
|
+
InvalidArgumentError: (value) => $InvalidArgumentError = value,
|
|
2850
|
+
InvalidOptionArgumentError: (value) => $InvalidOptionArgumentError = value
|
|
2851
|
+
});
|
|
2852
|
+
var { Argument } = require_argument();
|
|
2853
|
+
var { Command: Command2 } = require_command();
|
|
2854
|
+
var { CommanderError, InvalidArgumentError } = require_error();
|
|
2855
|
+
var { Help } = require_help();
|
|
2856
|
+
var { Option } = require_option();
|
|
2857
|
+
var $program = new Command2;
|
|
2858
|
+
var $createCommand = (name) => new Command2(name);
|
|
2859
|
+
var $createOption = (flags, description) => new Option(flags, description);
|
|
2860
|
+
var $createArgument = (name, description) => new Argument(name, description);
|
|
2861
|
+
var $Command = Command2;
|
|
2862
|
+
var $Option = Option;
|
|
2863
|
+
var $Argument = Argument;
|
|
2864
|
+
var $Help = Help;
|
|
2865
|
+
var $CommanderError = CommanderError;
|
|
2866
|
+
var $InvalidArgumentError = InvalidArgumentError;
|
|
2867
|
+
var $InvalidOptionArgumentError = InvalidArgumentError;
|
|
2868
|
+
|
|
2640
2869
|
// ../../node_modules/commander/esm.mjs
|
|
2641
|
-
var import__ = __toESM(require_commander(), 1);
|
|
2642
2870
|
var {
|
|
2643
2871
|
program,
|
|
2644
2872
|
createCommand,
|
|
2645
2873
|
createArgument,
|
|
2646
2874
|
createOption,
|
|
2647
|
-
CommanderError,
|
|
2648
|
-
InvalidArgumentError,
|
|
2875
|
+
CommanderError: CommanderError2,
|
|
2876
|
+
InvalidArgumentError: InvalidArgumentError2,
|
|
2649
2877
|
InvalidOptionArgumentError,
|
|
2650
2878
|
Command,
|
|
2651
|
-
Argument,
|
|
2652
|
-
Option,
|
|
2653
|
-
Help
|
|
2654
|
-
} =
|
|
2879
|
+
Argument: Argument2,
|
|
2880
|
+
Option: Option2,
|
|
2881
|
+
Help: Help2
|
|
2882
|
+
} = exports_commander;
|
|
2883
|
+
|
|
2884
|
+
// ../common/src/error-codes.ts
|
|
2885
|
+
var CLI_ERROR_CODES = [
|
|
2886
|
+
"invalid_argument",
|
|
2887
|
+
"authentication_required",
|
|
2888
|
+
"permission_denied",
|
|
2889
|
+
"local_permission_denied",
|
|
2890
|
+
"not_found",
|
|
2891
|
+
"rate_limited",
|
|
2892
|
+
"network_error",
|
|
2893
|
+
"timeout",
|
|
2894
|
+
"server_error",
|
|
2895
|
+
"method_not_allowed",
|
|
2896
|
+
"not_supported",
|
|
2897
|
+
"configuration_error",
|
|
2898
|
+
"execution_failed",
|
|
2899
|
+
"unknown_error"
|
|
2900
|
+
];
|
|
2901
|
+
var RETRY_HINTS = [
|
|
2902
|
+
"RetryWillNotFix",
|
|
2903
|
+
"RetryLater",
|
|
2904
|
+
"RetryAfter1Second",
|
|
2905
|
+
"RetryAfter10Seconds",
|
|
2906
|
+
"RetryAfter30Seconds",
|
|
2907
|
+
"RetryAfter60Seconds"
|
|
2908
|
+
];
|
|
2909
|
+
var CLI_ERROR_CODE_VALUES = new Set(CLI_ERROR_CODES);
|
|
2910
|
+
var RETRY_HINT_VALUES = new Set(RETRY_HINTS);
|
|
2911
|
+
function isCliErrorCode(value) {
|
|
2912
|
+
return typeof value === "string" && CLI_ERROR_CODE_VALUES.has(value);
|
|
2913
|
+
}
|
|
2914
|
+
function isRetryHint(value) {
|
|
2915
|
+
return typeof value === "string" && RETRY_HINT_VALUES.has(value);
|
|
2916
|
+
}
|
|
2917
|
+
function carriedErrorCode(error) {
|
|
2918
|
+
if (!error || typeof error !== "object")
|
|
2919
|
+
return;
|
|
2920
|
+
const code = error.errorCode;
|
|
2921
|
+
return isCliErrorCode(code) ? code : undefined;
|
|
2922
|
+
}
|
|
2923
|
+
function carriedRetry(error) {
|
|
2924
|
+
if (!error || typeof error !== "object")
|
|
2925
|
+
return;
|
|
2926
|
+
const retry = error.retry;
|
|
2927
|
+
return isRetryHint(retry) ? retry : undefined;
|
|
2928
|
+
}
|
|
2929
|
+
function defaultRetryForErrorCode(errorCode) {
|
|
2930
|
+
switch (errorCode) {
|
|
2931
|
+
case "network_error":
|
|
2932
|
+
case "rate_limited":
|
|
2933
|
+
case "server_error":
|
|
2934
|
+
case "timeout":
|
|
2935
|
+
return "RetryLater";
|
|
2936
|
+
default:
|
|
2937
|
+
return "RetryWillNotFix";
|
|
2938
|
+
}
|
|
2939
|
+
}
|
|
2655
2940
|
|
|
2656
2941
|
// ../common/src/error-graph.ts
|
|
2657
2942
|
function* walkErrorGraph(error) {
|
|
@@ -2697,6 +2982,40 @@ function findHttpStatusInGraph(error) {
|
|
|
2697
2982
|
return;
|
|
2698
2983
|
}
|
|
2699
2984
|
|
|
2985
|
+
// ../common/src/http-status.ts
|
|
2986
|
+
function classifyHttpStatus(status) {
|
|
2987
|
+
if (status === undefined)
|
|
2988
|
+
return;
|
|
2989
|
+
if (status === 400 || status === 409 || status === 413 || status === 422) {
|
|
2990
|
+
return { errorCode: "invalid_argument", retry: "RetryWillNotFix" };
|
|
2991
|
+
}
|
|
2992
|
+
if (status === 401) {
|
|
2993
|
+
return {
|
|
2994
|
+
errorCode: "authentication_required",
|
|
2995
|
+
retry: "RetryWillNotFix"
|
|
2996
|
+
};
|
|
2997
|
+
}
|
|
2998
|
+
if (status === 403) {
|
|
2999
|
+
return { errorCode: "permission_denied", retry: "RetryWillNotFix" };
|
|
3000
|
+
}
|
|
3001
|
+
if (status === 404) {
|
|
3002
|
+
return { errorCode: "not_found", retry: "RetryWillNotFix" };
|
|
3003
|
+
}
|
|
3004
|
+
if (status === 405) {
|
|
3005
|
+
return { errorCode: "method_not_allowed", retry: "RetryWillNotFix" };
|
|
3006
|
+
}
|
|
3007
|
+
if (status === 408) {
|
|
3008
|
+
return { errorCode: "timeout", retry: "RetryLater" };
|
|
3009
|
+
}
|
|
3010
|
+
if (status === 429) {
|
|
3011
|
+
return { errorCode: "rate_limited", retry: "RetryLater" };
|
|
3012
|
+
}
|
|
3013
|
+
if (status >= 500 && status < 600) {
|
|
3014
|
+
return { errorCode: "server_error", retry: "RetryLater" };
|
|
3015
|
+
}
|
|
3016
|
+
return;
|
|
3017
|
+
}
|
|
3018
|
+
|
|
2700
3019
|
// ../common/src/local-permission-codes.ts
|
|
2701
3020
|
var LOCAL_PERMISSION_ERROR_CODES = new Set([
|
|
2702
3021
|
"EACCES",
|
|
@@ -2709,6 +3028,8 @@ var DEFAULT_401 = "Unauthorized (401). The session is missing or expired, or its
|
|
|
2709
3028
|
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.";
|
|
2710
3029
|
var DEFAULT_405 = "Method Not Allowed (405). The endpoint may not exist or the base URL may be incorrect.";
|
|
2711
3030
|
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.";
|
|
3031
|
+
var CLOUDFLARE_BLOCK_403 = "Forbidden (403) by Cloudflare, in front of the service: the answer is a Cloudflare HTML page, not the service's JSON, so the service did not see the request and did not check the account's roles or the token's scopes. Cloudflare blocks a request when its content matches a firewall rule (text that looks like SQL or script code, for example) or when it comes from a network the firewall does not allow.";
|
|
3032
|
+
var CLOUDFLARE_BLOCK_403_INSTRUCTIONS = "If the request carries text that looks like code, change that text and try again. Otherwise send the time of the request and the Cloudflare Ray ID, when the message gives one, to the owner of the service or UiPath support.";
|
|
2712
3033
|
var HTML_RESPONSE_MESSAGE = "Received HTML instead of the expected JSON response.";
|
|
2713
3034
|
var NETWORK_ERROR_CODES = new Set([
|
|
2714
3035
|
"ECONNREFUSED",
|
|
@@ -2794,8 +3115,22 @@ function localPermissionPath(path, message) {
|
|
|
2794
3115
|
return path;
|
|
2795
3116
|
return message ? /'([^']+)'/.exec(message)?.[1] : undefined;
|
|
2796
3117
|
}
|
|
2797
|
-
function
|
|
2798
|
-
|
|
3118
|
+
function readHeader(response, name) {
|
|
3119
|
+
const headers = response?.headers;
|
|
3120
|
+
if (!headers || typeof headers !== "object")
|
|
3121
|
+
return;
|
|
3122
|
+
if (typeof headers.get === "function") {
|
|
3123
|
+
const value = headers.get(name);
|
|
3124
|
+
if (value)
|
|
3125
|
+
return value;
|
|
3126
|
+
}
|
|
3127
|
+
const plain = headers;
|
|
3128
|
+
const key = Object.keys(plain).find((k) => k.toLowerCase() === name.toLowerCase());
|
|
3129
|
+
const value = key === undefined ? undefined : plain[key];
|
|
3130
|
+
return typeof value === "string" && value !== "" ? value : undefined;
|
|
3131
|
+
}
|
|
3132
|
+
function isHtmlDocument(body) {
|
|
3133
|
+
return /^\s*(<!doctype html|<html\b)/i.test(body);
|
|
2799
3134
|
}
|
|
2800
3135
|
function retryHintForRetryAfter(seconds) {
|
|
2801
3136
|
if (seconds <= 1) {
|
|
@@ -2810,36 +3145,9 @@ function retryHintForRetryAfter(seconds) {
|
|
|
2810
3145
|
return "RetryAfter60Seconds";
|
|
2811
3146
|
}
|
|
2812
3147
|
function classifyError(status, error) {
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
if (status === 401) {
|
|
2817
|
-
return {
|
|
2818
|
-
errorCode: "authentication_required",
|
|
2819
|
-
retry: "RetryWillNotFix"
|
|
2820
|
-
};
|
|
2821
|
-
}
|
|
2822
|
-
if (status === 403) {
|
|
2823
|
-
return { errorCode: "permission_denied", retry: "RetryWillNotFix" };
|
|
2824
|
-
}
|
|
2825
|
-
if (status === 404) {
|
|
2826
|
-
return { errorCode: "not_found", retry: "RetryWillNotFix" };
|
|
2827
|
-
}
|
|
2828
|
-
if (status === 405) {
|
|
2829
|
-
return { errorCode: "method_not_allowed", retry: "RetryWillNotFix" };
|
|
2830
|
-
}
|
|
2831
|
-
if (status === 413) {
|
|
2832
|
-
return { errorCode: "invalid_argument", retry: "RetryWillNotFix" };
|
|
2833
|
-
}
|
|
2834
|
-
if (status === 408) {
|
|
2835
|
-
return { errorCode: "timeout", retry: "RetryLater" };
|
|
2836
|
-
}
|
|
2837
|
-
if (status === 429) {
|
|
2838
|
-
return { errorCode: "rate_limited", retry: "RetryLater" };
|
|
2839
|
-
}
|
|
2840
|
-
if (status !== undefined && status >= 500 && status < 600) {
|
|
2841
|
-
return { errorCode: "server_error", retry: "RetryLater" };
|
|
2842
|
-
}
|
|
3148
|
+
const byStatus = classifyHttpStatus(status);
|
|
3149
|
+
if (byStatus)
|
|
3150
|
+
return byStatus;
|
|
2843
3151
|
if (status === undefined && describePermissionError(error)) {
|
|
2844
3152
|
return {
|
|
2845
3153
|
errorCode: "local_permission_denied",
|
|
@@ -2855,6 +3163,17 @@ function classifyError(status, error) {
|
|
|
2855
3163
|
}
|
|
2856
3164
|
return { errorCode: "unknown_error", retry: "RetryWillNotFix" };
|
|
2857
3165
|
}
|
|
3166
|
+
function withCarriedClass(inferred, error) {
|
|
3167
|
+
const errorCode = carriedErrorCode(error);
|
|
3168
|
+
const retry = carriedRetry(error);
|
|
3169
|
+
if (errorCode === undefined || errorCode === inferred.errorCode) {
|
|
3170
|
+
return {
|
|
3171
|
+
errorCode: inferred.errorCode,
|
|
3172
|
+
retry: retry ?? inferred.retry
|
|
3173
|
+
};
|
|
3174
|
+
}
|
|
3175
|
+
return { errorCode, retry: retry ?? defaultRetryForErrorCode(errorCode) };
|
|
3176
|
+
}
|
|
2858
3177
|
function formatHttpStatusMessage(status, rawMessage, extractedMessage, inferredStatus) {
|
|
2859
3178
|
if (extractedMessage) {
|
|
2860
3179
|
return `HTTP ${status}: ${extractedMessage}`;
|
|
@@ -2910,9 +3229,14 @@ async function extractErrorDetails(error, options) {
|
|
|
2910
3229
|
const classificationStatus = status ?? findHttpStatusInGraph(error);
|
|
2911
3230
|
const classification = classifyError(classificationStatus, error);
|
|
2912
3231
|
let retry = classification.retry;
|
|
3232
|
+
const htmlForbidden = status === 403 && rawBody !== undefined && isHtmlDocument(rawBody);
|
|
3233
|
+
const rayId = htmlForbidden ? readHeader(response, "cf-ray") : undefined;
|
|
3234
|
+
const cloudflareBlock = htmlForbidden && (rayId !== undefined || /\bcloudflare\b/i.test(readHeader(response, "server") ?? ""));
|
|
2913
3235
|
if (status === 401) {
|
|
2914
3236
|
message = DEFAULT_401;
|
|
2915
3237
|
result = "AuthenticationError";
|
|
3238
|
+
} else if (cloudflareBlock) {
|
|
3239
|
+
message = rayId ? `${CLOUDFLARE_BLOCK_403} Cloudflare Ray ID: ${rayId}.` : CLOUDFLARE_BLOCK_403;
|
|
2916
3240
|
} else if (status === 403) {
|
|
2917
3241
|
message = options?.forbiddenMessage ?? DEFAULT_403;
|
|
2918
3242
|
result = "AuthenticationError";
|
|
@@ -2960,7 +3284,9 @@ async function extractErrorDetails(error, options) {
|
|
|
2960
3284
|
}
|
|
2961
3285
|
}
|
|
2962
3286
|
let details = rawMessage;
|
|
2963
|
-
if (
|
|
3287
|
+
if (htmlForbidden) {
|
|
3288
|
+
details = cloudflareBlock ? CLOUDFLARE_BLOCK_403_INSTRUCTIONS : HTML_RESPONSE_MESSAGE;
|
|
3289
|
+
} else if (rawBody) {
|
|
2964
3290
|
if (parsedBody) {
|
|
2965
3291
|
const extra = {};
|
|
2966
3292
|
if (parsedBody.errorCode)
|
|
@@ -2994,6 +3320,8 @@ async function extractErrorDetails(error, options) {
|
|
|
2994
3320
|
}
|
|
2995
3321
|
if (parsedBody?.requestId && typeof parsedBody.requestId === "string") {
|
|
2996
3322
|
context.requestId = parsedBody.requestId;
|
|
3323
|
+
} else if (cloudflareBlock && rayId) {
|
|
3324
|
+
context.requestId = rayId;
|
|
2997
3325
|
}
|
|
2998
3326
|
if (parsedBody?.traceId && typeof parsedBody.traceId === "string") {
|
|
2999
3327
|
context.traceId = parsedBody.traceId;
|
|
@@ -3002,16 +3330,7 @@ async function extractErrorDetails(error, options) {
|
|
|
3002
3330
|
context.path = permission.path;
|
|
3003
3331
|
}
|
|
3004
3332
|
if (status === 429) {
|
|
3005
|
-
const
|
|
3006
|
-
const headersObj = resp?.headers;
|
|
3007
|
-
let retryAfterValue;
|
|
3008
|
-
if (headersObj && typeof headersObj === "object" && typeof headersObj.get === "function") {
|
|
3009
|
-
retryAfterValue = headersObj.get("retry-after") ?? undefined;
|
|
3010
|
-
}
|
|
3011
|
-
if (!retryAfterValue && headersObj && typeof headersObj === "object") {
|
|
3012
|
-
const headers = headersObj;
|
|
3013
|
-
retryAfterValue = headers["retry-after"] ?? headers["Retry-After"];
|
|
3014
|
-
}
|
|
3333
|
+
const retryAfterValue = readHeader(response, "retry-after");
|
|
3015
3334
|
if (retryAfterValue) {
|
|
3016
3335
|
const seconds = Number(retryAfterValue);
|
|
3017
3336
|
if (!Number.isNaN(seconds)) {
|
|
@@ -3045,9 +3364,8 @@ async function extractErrorDetails(error, options) {
|
|
|
3045
3364
|
}
|
|
3046
3365
|
return {
|
|
3047
3366
|
result,
|
|
3048
|
-
errorCode: classification.errorCode,
|
|
3367
|
+
...withCarriedClass({ errorCode: classification.errorCode, retry }, error),
|
|
3049
3368
|
message,
|
|
3050
|
-
retry,
|
|
3051
3369
|
details,
|
|
3052
3370
|
...hasContext ? { context } : {},
|
|
3053
3371
|
...parsedErrors ? { parsedErrors } : {}
|
|
@@ -3105,10 +3423,129 @@ async function readAttachmentSpecs(specs) {
|
|
|
3105
3423
|
};
|
|
3106
3424
|
}));
|
|
3107
3425
|
}
|
|
3108
|
-
// ../common/src/
|
|
3109
|
-
function
|
|
3110
|
-
|
|
3426
|
+
// ../common/src/error-instructions.ts
|
|
3427
|
+
function extractHttpStatus(err) {
|
|
3428
|
+
if (!err || typeof err !== "object")
|
|
3429
|
+
return;
|
|
3430
|
+
const e = err;
|
|
3431
|
+
const structured = e.response?.status ?? e.status ?? e.statusCode;
|
|
3432
|
+
if (structured !== undefined)
|
|
3433
|
+
return structured;
|
|
3434
|
+
return typeof e.message === "string" ? parseHttpStatusFromMessage(e.message) : undefined;
|
|
3435
|
+
}
|
|
3436
|
+
var GENERIC = "Check authentication and parameters";
|
|
3437
|
+
function hasIdentityInstructionContext(err) {
|
|
3438
|
+
return err !== null && typeof err === "object" && "instructionContext" in err && err.instructionContext === "identity";
|
|
3439
|
+
}
|
|
3440
|
+
function instructionsFor(ctx, err) {
|
|
3441
|
+
if (ctx === "auth" && hasIdentityInstructionContext(err)) {
|
|
3442
|
+
return instructionsFor("identity");
|
|
3443
|
+
}
|
|
3444
|
+
switch (ctx) {
|
|
3445
|
+
case "auth":
|
|
3446
|
+
return "Run 'uip login' to authenticate. To inspect the current session, run 'uip whoami'.";
|
|
3447
|
+
case "auth-configuration":
|
|
3448
|
+
return "Fix the authentication settings named in Message, then retry.";
|
|
3449
|
+
case "identity":
|
|
3450
|
+
return "Select an active tenant with 'uip login tenant set <tenant>' and ensure your login includes an organization";
|
|
3451
|
+
case "input-parse":
|
|
3452
|
+
return "Ensure --inputs is valid JSON or pipe JSON via stdin";
|
|
3453
|
+
case "input-validate":
|
|
3454
|
+
return "Fix the flagged input fields to match the process's input schema";
|
|
3455
|
+
case "flag-format":
|
|
3456
|
+
return "Check the flag value format — see --help for the expected shape";
|
|
3457
|
+
case "permissions":
|
|
3458
|
+
return "Confirm your user has the required permissions in this folder/tenant, or re-authenticate with 'uip login' if your session has lapsed";
|
|
3459
|
+
case "backend": {
|
|
3460
|
+
const status = extractHttpStatus(err);
|
|
3461
|
+
if (status === 401) {
|
|
3462
|
+
return "Re-authenticate with 'uip login' — your session is invalid or expired";
|
|
3463
|
+
}
|
|
3464
|
+
if (status === 403) {
|
|
3465
|
+
return "Confirm your user has access to the resource, and the required permissions in this folder or tenant";
|
|
3466
|
+
}
|
|
3467
|
+
if (status === 404) {
|
|
3468
|
+
return "Verify the resource exists in the current folder/tenant";
|
|
3469
|
+
}
|
|
3470
|
+
if (status === 400 || status === 422) {
|
|
3471
|
+
return "Request was rejected — check flag values and inputs";
|
|
3472
|
+
}
|
|
3473
|
+
if (status === 405) {
|
|
3474
|
+
return "Check the command name and the base URL in use — the endpoint may not exist";
|
|
3475
|
+
}
|
|
3476
|
+
if (status === 408) {
|
|
3477
|
+
return "The request timed out — retry; if it persists, narrow the request (e.g. --limit on list commands)";
|
|
3478
|
+
}
|
|
3479
|
+
if (status === 409) {
|
|
3480
|
+
return "The resource already exists, or changed since it was read — list it to see the current state";
|
|
3481
|
+
}
|
|
3482
|
+
if (status === 413) {
|
|
3483
|
+
return "The upload is over the size limit — exclude unused dependencies or drop large files, then retry";
|
|
3484
|
+
}
|
|
3485
|
+
if (status === 429) {
|
|
3486
|
+
return "Rate limit reached — wait and retry; when the service suggests a delay, Retry and Context.retryAfter carry it";
|
|
3487
|
+
}
|
|
3488
|
+
if (status !== undefined && status >= 500 && status < 600) {
|
|
3489
|
+
return "The service returned a server error — retry; if it persists, check service status";
|
|
3490
|
+
}
|
|
3491
|
+
const permission = describePermissionError(err);
|
|
3492
|
+
if (permission) {
|
|
3493
|
+
return permission.instructions;
|
|
3494
|
+
}
|
|
3495
|
+
const connectivity = describeConnectivityError(err);
|
|
3496
|
+
if (connectivity) {
|
|
3497
|
+
return connectivity.instructions;
|
|
3498
|
+
}
|
|
3499
|
+
return GENERIC;
|
|
3500
|
+
}
|
|
3501
|
+
}
|
|
3502
|
+
}
|
|
3503
|
+
|
|
3504
|
+
// ../common/src/result-types.ts
|
|
3505
|
+
var RESULTS = {
|
|
3506
|
+
Success: "Success",
|
|
3507
|
+
Failure: "Failure",
|
|
3508
|
+
ConfigError: "ConfigError",
|
|
3509
|
+
AuthenticationError: "AuthenticationError",
|
|
3510
|
+
ValidationError: "ValidationError",
|
|
3511
|
+
TimeoutError: "TimeoutError"
|
|
3512
|
+
};
|
|
3513
|
+
|
|
3514
|
+
// ../common/src/classified-failure.ts
|
|
3515
|
+
var MAX_QUOTED_BODY_CHARS = 200;
|
|
3516
|
+
async function authContextFailure(error, sessionInstructions) {
|
|
3517
|
+
const details = await extractErrorDetails(error);
|
|
3518
|
+
const missingIdentity = hasIdentityInstructionContext(error);
|
|
3519
|
+
return {
|
|
3520
|
+
Result: details.errorCode === "configuration_error" ? RESULTS.ConfigError : details.errorCode === "authentication_required" ? RESULTS.AuthenticationError : details.result,
|
|
3521
|
+
ErrorCode: details.errorCode,
|
|
3522
|
+
Message: details.message,
|
|
3523
|
+
Instructions: details.errorCode === "configuration_error" ? instructionsFor("auth-configuration") : details.errorCode === "authentication_required" && !missingIdentity && sessionInstructions !== undefined ? sessionInstructions : instructionsFor(details.errorCode === "authentication_required" ? "auth" : "backend", error),
|
|
3524
|
+
Retry: details.retry,
|
|
3525
|
+
...details.context ? { Context: details.context } : {}
|
|
3526
|
+
};
|
|
3527
|
+
}
|
|
3528
|
+
function summarizePlatformBody(body) {
|
|
3529
|
+
const trimmed = body.trim().replace(/\s+/g, " ");
|
|
3530
|
+
return trimmed.length > MAX_QUOTED_BODY_CHARS ? `${trimmed.slice(0, MAX_QUOTED_BODY_CHARS)}…` : trimmed;
|
|
3531
|
+
}
|
|
3532
|
+
// ../common/src/command-examples.ts
|
|
3533
|
+
var examplesByCommand = new WeakMap;
|
|
3534
|
+
Command.prototype.examples = function(examples) {
|
|
3535
|
+
examplesByCommand.set(this, examples);
|
|
3536
|
+
return this;
|
|
3537
|
+
};
|
|
3538
|
+
// ../common/src/preview.ts
|
|
3539
|
+
var previewSlot = singleton("PreviewBuild");
|
|
3540
|
+
function isPreviewBuild() {
|
|
3541
|
+
return previewSlot.get(false) ?? false;
|
|
3111
3542
|
}
|
|
3543
|
+
Command.prototype.previewCommand = function(nameAndArgs, opts) {
|
|
3544
|
+
if (isPreviewBuild()) {
|
|
3545
|
+
return this.command(nameAndArgs, opts);
|
|
3546
|
+
}
|
|
3547
|
+
return new Command(nameAndArgs.split(/\s+/)[0] ?? nameAndArgs);
|
|
3548
|
+
};
|
|
3112
3549
|
|
|
3113
3550
|
// ../common/src/output-context.ts
|
|
3114
3551
|
function createStorage() {
|
|
@@ -3327,18 +3764,111 @@ function getLogFilePath() {
|
|
|
3327
3764
|
return logger.getLogFilePath();
|
|
3328
3765
|
}
|
|
3329
3766
|
|
|
3767
|
+
// ../common/src/timings.ts
|
|
3768
|
+
var TIMINGS_ENV_VAR = "UIP_TIMINGS";
|
|
3769
|
+
function createStorage2() {
|
|
3770
|
+
const [error, mod] = catchError(() => __require("node:async_hooks"));
|
|
3771
|
+
if (error || typeof mod?.AsyncLocalStorage !== "function") {
|
|
3772
|
+
return {
|
|
3773
|
+
getStore: () => {
|
|
3774
|
+
return;
|
|
3775
|
+
},
|
|
3776
|
+
run: (_store, fn) => fn()
|
|
3777
|
+
};
|
|
3778
|
+
}
|
|
3779
|
+
return new mod.AsyncLocalStorage;
|
|
3780
|
+
}
|
|
3781
|
+
var storageSlot = singleton("TimingStorage");
|
|
3782
|
+
var stateSlot = singleton("Timings");
|
|
3783
|
+
var rootStartedSlot = singleton("TimingsRootStarted");
|
|
3784
|
+
var longLivedHostSlot = singleton("TimingsLongLivedHost");
|
|
3785
|
+
var storage = storageSlot.getOrInit(createStorage2, (value) => ("getStore" in value));
|
|
3786
|
+
function newState(baseline) {
|
|
3787
|
+
return { baseline, httpMs: 0, httpCalls: 0 };
|
|
3788
|
+
}
|
|
3789
|
+
function getState() {
|
|
3790
|
+
const scoped = storage.getStore();
|
|
3791
|
+
if (scoped) {
|
|
3792
|
+
return scoped;
|
|
3793
|
+
}
|
|
3794
|
+
const pinned = livePinnedState();
|
|
3795
|
+
if (pinned !== undefined) {
|
|
3796
|
+
return pinned;
|
|
3797
|
+
}
|
|
3798
|
+
return newState(processStartIsInvocationStart() ? 0 : performance.now());
|
|
3799
|
+
}
|
|
3800
|
+
function livePinnedState() {
|
|
3801
|
+
const pinned = stateSlot.get();
|
|
3802
|
+
return pinned !== undefined && "httpCalls" in pinned && !pinned.finished ? pinned : undefined;
|
|
3803
|
+
}
|
|
3804
|
+
function processStartIsInvocationStart() {
|
|
3805
|
+
return !rootStartedSlot.get(false) && !longLivedHostSlot.get(false);
|
|
3806
|
+
}
|
|
3807
|
+
function timingsEnabled() {
|
|
3808
|
+
if (typeof process === "undefined") {
|
|
3809
|
+
return false;
|
|
3810
|
+
}
|
|
3811
|
+
const value = process.env?.[TIMINGS_ENV_VAR];
|
|
3812
|
+
if (value === undefined) {
|
|
3813
|
+
return false;
|
|
3814
|
+
}
|
|
3815
|
+
const normalized = value.trim().toLowerCase();
|
|
3816
|
+
return normalized === "1" || normalized === "true";
|
|
3817
|
+
}
|
|
3818
|
+
function recordExitCode(exitCode) {
|
|
3819
|
+
if (!timingsEnabled()) {
|
|
3820
|
+
return;
|
|
3821
|
+
}
|
|
3822
|
+
getState().exitCode = exitCode;
|
|
3823
|
+
}
|
|
3824
|
+
function invocationStartedAt() {
|
|
3825
|
+
return new Date(performance.timeOrigin + getState().baseline);
|
|
3826
|
+
}
|
|
3827
|
+
function invocationElapsedMs() {
|
|
3828
|
+
return performance.now() - getState().baseline;
|
|
3829
|
+
}
|
|
3830
|
+
function markCommandStart() {
|
|
3831
|
+
if (!timingsEnabled()) {
|
|
3832
|
+
return;
|
|
3833
|
+
}
|
|
3834
|
+
getState().commandStart = performance.now();
|
|
3835
|
+
}
|
|
3836
|
+
function recordCommandDuration(durationMs) {
|
|
3837
|
+
if (!timingsEnabled()) {
|
|
3838
|
+
return;
|
|
3839
|
+
}
|
|
3840
|
+
getState().commandMs = durationMs;
|
|
3841
|
+
}
|
|
3842
|
+
|
|
3843
|
+
// ../common/src/exit-code.ts
|
|
3844
|
+
function setExitCode(code) {
|
|
3845
|
+
process.exitCode = code;
|
|
3846
|
+
recordExitCode(code);
|
|
3847
|
+
}
|
|
3848
|
+
var GENERIC_FAILURE_EXIT_CODE = 1;
|
|
3849
|
+
function recordCommandExit(code) {
|
|
3850
|
+
if (code === GENERIC_FAILURE_EXIT_CODE && getExitCode() !== 0) {
|
|
3851
|
+
return;
|
|
3852
|
+
}
|
|
3853
|
+
setExitCode(code);
|
|
3854
|
+
}
|
|
3855
|
+
function getExitCode() {
|
|
3856
|
+
const code = process.exitCode;
|
|
3857
|
+
return typeof code === "number" ? code : 0;
|
|
3858
|
+
}
|
|
3859
|
+
|
|
3330
3860
|
// ../common/src/output-codecs.ts
|
|
3331
3861
|
var yamlSlot = singleton("YamlCodec");
|
|
3332
3862
|
var jmespathSlot = singleton("JmespathCodec");
|
|
3333
3863
|
async function loadOutputCodecsAsync(needed) {
|
|
3334
3864
|
const loads = [];
|
|
3335
3865
|
if (needed.yaml && yamlSlot.get() === undefined) {
|
|
3336
|
-
loads.push(import("./js-yaml-
|
|
3866
|
+
loads.push(import("./js-yaml-a2bk27p6.js").then((mod) => {
|
|
3337
3867
|
yamlSlot.set(mod);
|
|
3338
3868
|
}));
|
|
3339
3869
|
}
|
|
3340
3870
|
if (needed.filter && jmespathSlot.get() === undefined) {
|
|
3341
|
-
loads.push(import("./jmespath-
|
|
3871
|
+
loads.push(import("./jmespath-ab6tdc42.js").then((m)=>__toESM(m.default,1)).then((mod) => {
|
|
3342
3872
|
jmespathSlot.set(mod);
|
|
3343
3873
|
}));
|
|
3344
3874
|
}
|
|
@@ -3359,157 +3889,8 @@ var filterSlot = singleton("OutputFilter");
|
|
|
3359
3889
|
function getOutputFormat() {
|
|
3360
3890
|
return formatSlot.get("json");
|
|
3361
3891
|
}
|
|
3362
|
-
function getOutputFilter() {
|
|
3363
|
-
return filterSlot.get();
|
|
3364
|
-
}
|
|
3365
|
-
|
|
3366
|
-
// ../common/src/telemetry/telemetry-dimensions.ts
|
|
3367
|
-
var BaseDimensions = {
|
|
3368
|
-
ApplicationName: "ApplicationName",
|
|
3369
|
-
ProductVersion: "ProductVersion",
|
|
3370
|
-
InstallationId: "InstallationId",
|
|
3371
|
-
CloudUserId: "CloudUserId",
|
|
3372
|
-
CloudTenantId: "CloudTenantId",
|
|
3373
|
-
CloudOrganizationId: "CloudOrganizationId",
|
|
3374
|
-
IsInternalUser: "IsInternalUser",
|
|
3375
|
-
Environment: "Environment",
|
|
3376
|
-
BaseUrl: "BaseUrl",
|
|
3377
|
-
Region: "Region",
|
|
3378
|
-
Agent: "Agent",
|
|
3379
|
-
AgentVersion: "AgentVersion",
|
|
3380
|
-
AgentModel: "AgentModel",
|
|
3381
|
-
ToolName: "ToolName",
|
|
3382
|
-
ToolVersion: "ToolVersion",
|
|
3383
|
-
ExecutionContext: "ExecutionContext",
|
|
3384
|
-
CiProvider: "CiProvider",
|
|
3385
|
-
SessionIdSource: "SessionIdSource",
|
|
3386
|
-
SessionId: "SessionId"
|
|
3387
|
-
};
|
|
3388
|
-
var CommandDimensions = {
|
|
3389
|
-
IsCommand: "IsCommand",
|
|
3390
|
-
IsReexec: "IsReexec",
|
|
3391
|
-
CommandName: "CommandName",
|
|
3392
|
-
ExitCode: "ExitCode",
|
|
3393
|
-
TerminalOutcome: "TerminalOutcome",
|
|
3394
|
-
ErrorClass: "ErrorClass",
|
|
3395
|
-
TerminalSignal: "TerminalSignal",
|
|
3396
|
-
ErrorMessage: "ErrorMessage",
|
|
3397
|
-
SkillName: "SkillName",
|
|
3398
|
-
ProductArea: "ProductArea",
|
|
3399
|
-
Mode: "Mode"
|
|
3400
|
-
};
|
|
3401
|
-
var ShipDimensions = {
|
|
3402
|
-
ShipKind: "ShipKind",
|
|
3403
|
-
Target: "Target",
|
|
3404
|
-
ProjectType: "ProjectType",
|
|
3405
|
-
ProjectTypes: "ProjectTypes",
|
|
3406
|
-
ArtifactCorrelationKey: "ArtifactCorrelationKey",
|
|
3407
|
-
PackageName: "PackageName",
|
|
3408
|
-
PackageVersion: "PackageVersion",
|
|
3409
|
-
PackageVersionKey: "PackageVersionKey",
|
|
3410
|
-
DeploymentKey: "DeploymentKey",
|
|
3411
|
-
SolutionId: "SolutionId",
|
|
3412
|
-
FolderKey: "FolderKey",
|
|
3413
|
-
FeedId: "FeedId"
|
|
3414
|
-
};
|
|
3415
|
-
var ErrorDimensions = {
|
|
3416
|
-
Result: "Result",
|
|
3417
|
-
ErrorCode: "ErrorCode",
|
|
3418
|
-
Retry: "Retry",
|
|
3419
|
-
ErrorMessage: "ErrorMessage",
|
|
3420
|
-
HttpStatus: "HttpStatus",
|
|
3421
|
-
UpstreamErrorCode: "UpstreamErrorCode"
|
|
3422
|
-
};
|
|
3423
|
-
var AuthDimensions = {
|
|
3424
|
-
AuthenticationMethod: "AuthenticationMethod",
|
|
3425
|
-
Success: "Success",
|
|
3426
|
-
Reason: "Reason"
|
|
3427
|
-
};
|
|
3428
|
-
var SkillsDimensions = {
|
|
3429
|
-
SchemaVersion: "SchemaVersion",
|
|
3430
|
-
AgentType: "AgentType",
|
|
3431
|
-
SkillsVersion: "SkillsVersion",
|
|
3432
|
-
UipSubcommand: "UipSubcommand",
|
|
3433
|
-
FileExtension: "FileExtension",
|
|
3434
|
-
SubagentModel: "SubagentModel",
|
|
3435
|
-
SubagentType: "SubagentType",
|
|
3436
|
-
PermissionMode: "PermissionMode",
|
|
3437
|
-
EffortLevel: "EffortLevel",
|
|
3438
|
-
SessionSource: "SessionSource",
|
|
3439
|
-
Outcome: "Outcome",
|
|
3440
|
-
DurationMs: "DurationMs",
|
|
3441
|
-
Source: "Source"
|
|
3442
|
-
};
|
|
3443
|
-
var PackagerDimensions = {
|
|
3444
|
-
ProjectId: "ProjectId",
|
|
3445
|
-
ProjectType: "ProjectType",
|
|
3446
|
-
SolutionId: "SolutionId"
|
|
3447
|
-
};
|
|
3448
|
-
var ScopeDimensions = {
|
|
3449
|
-
FolderId: "FolderId"
|
|
3450
|
-
};
|
|
3451
|
-
var ID_DIMENSIONS = new Set([
|
|
3452
|
-
BaseDimensions.CloudUserId,
|
|
3453
|
-
BaseDimensions.CloudTenantId,
|
|
3454
|
-
BaseDimensions.CloudOrganizationId,
|
|
3455
|
-
BaseDimensions.InstallationId,
|
|
3456
|
-
ShipDimensions.ArtifactCorrelationKey,
|
|
3457
|
-
ShipDimensions.PackageVersionKey,
|
|
3458
|
-
ShipDimensions.DeploymentKey,
|
|
3459
|
-
ShipDimensions.SolutionId,
|
|
3460
|
-
ShipDimensions.FolderKey,
|
|
3461
|
-
ShipDimensions.FeedId,
|
|
3462
|
-
PackagerDimensions.ProjectId
|
|
3463
|
-
]);
|
|
3464
|
-
var NON_IDENTIFIER_PLACEHOLDER_PATTERN = /^(?:\[[A-Z_]+\]|<[^>]+>)$/;
|
|
3465
|
-
var RESERVED_DIMENSION_NAMES = new Set([
|
|
3466
|
-
...Object.values(BaseDimensions),
|
|
3467
|
-
...Object.values(CommandDimensions),
|
|
3468
|
-
...Object.values(ShipDimensions),
|
|
3469
|
-
...Object.values(ErrorDimensions),
|
|
3470
|
-
...Object.values(AuthDimensions),
|
|
3471
|
-
...Object.values(SkillsDimensions),
|
|
3472
|
-
...Object.values(PackagerDimensions),
|
|
3473
|
-
...Object.values(ScopeDimensions)
|
|
3474
|
-
]);
|
|
3475
|
-
var CURATED_DIMENSIONS = new Set([
|
|
3476
|
-
BaseDimensions.ApplicationName,
|
|
3477
|
-
BaseDimensions.ProductVersion,
|
|
3478
|
-
BaseDimensions.InstallationId,
|
|
3479
|
-
BaseDimensions.CloudUserId,
|
|
3480
|
-
BaseDimensions.CloudTenantId,
|
|
3481
|
-
BaseDimensions.CloudOrganizationId,
|
|
3482
|
-
BaseDimensions.IsInternalUser,
|
|
3483
|
-
BaseDimensions.Environment,
|
|
3484
|
-
BaseDimensions.BaseUrl,
|
|
3485
|
-
BaseDimensions.Region,
|
|
3486
|
-
BaseDimensions.Agent,
|
|
3487
|
-
BaseDimensions.AgentVersion,
|
|
3488
|
-
BaseDimensions.ToolVersion,
|
|
3489
|
-
BaseDimensions.ExecutionContext,
|
|
3490
|
-
BaseDimensions.CiProvider,
|
|
3491
|
-
BaseDimensions.SessionIdSource,
|
|
3492
|
-
BaseDimensions.SessionId,
|
|
3493
|
-
...Object.values(CommandDimensions),
|
|
3494
|
-
...Object.values(ShipDimensions)
|
|
3495
|
-
]);
|
|
3496
|
-
function lowercaseIdDimensionValues(properties) {
|
|
3497
|
-
let changed = false;
|
|
3498
|
-
const result = {
|
|
3499
|
-
...properties
|
|
3500
|
-
};
|
|
3501
|
-
for (const key of Object.keys(result)) {
|
|
3502
|
-
const value = result[key];
|
|
3503
|
-
if (!ID_DIMENSIONS.has(key) || typeof value !== "string" || NON_IDENTIFIER_PLACEHOLDER_PATTERN.test(value)) {
|
|
3504
|
-
continue;
|
|
3505
|
-
}
|
|
3506
|
-
const lowered = value.toLowerCase();
|
|
3507
|
-
if (lowered !== value) {
|
|
3508
|
-
result[key] = lowered;
|
|
3509
|
-
changed = true;
|
|
3510
|
-
}
|
|
3511
|
-
}
|
|
3512
|
-
return changed ? result : properties;
|
|
3892
|
+
function getOutputFilter() {
|
|
3893
|
+
return filterSlot.get();
|
|
3513
3894
|
}
|
|
3514
3895
|
|
|
3515
3896
|
// ../common/src/telemetry/command-terminal.ts
|
|
@@ -3630,17 +4011,8 @@ function terminalSignalFor(input, outcome) {
|
|
|
3630
4011
|
}
|
|
3631
4012
|
return outcome === "cancelled" ? "SIGINT" : undefined;
|
|
3632
4013
|
}
|
|
3633
|
-
function
|
|
3634
|
-
|
|
3635
|
-
return "auth";
|
|
3636
|
-
}
|
|
3637
|
-
if (status === 400 || status === 409 || status === 422) {
|
|
3638
|
-
return "validation";
|
|
3639
|
-
}
|
|
3640
|
-
if (status === 408) {
|
|
3641
|
-
return "timeout";
|
|
3642
|
-
}
|
|
3643
|
-
return "network_http";
|
|
4014
|
+
function classifyFailingHttpStatus(status) {
|
|
4015
|
+
return classifyFromErrorCode(classifyHttpStatus(status)?.errorCode) ?? "network_http";
|
|
3644
4016
|
}
|
|
3645
4017
|
function classifyFromResult(result) {
|
|
3646
4018
|
switch (result) {
|
|
@@ -3720,7 +4092,7 @@ function classifyError2(input) {
|
|
|
3720
4092
|
}
|
|
3721
4093
|
const status = recorded?.context?.httpStatus ?? findHttpStatusInGraph(input.error);
|
|
3722
4094
|
if (status !== undefined) {
|
|
3723
|
-
return
|
|
4095
|
+
return classifyFailingHttpStatus(status);
|
|
3724
4096
|
}
|
|
3725
4097
|
return classifyFromResult(recorded?.result) ?? classifyFromErrorCode(recorded?.errorCode) ?? classifyFromError(input.error) ?? "unknown";
|
|
3726
4098
|
}
|
|
@@ -3752,6 +4124,7 @@ function buildCommandTerminalTelemetryProperties(input) {
|
|
|
3752
4124
|
var CommonTelemetryEvents = {
|
|
3753
4125
|
Start: "Application.Start",
|
|
3754
4126
|
Error: "Application.Error",
|
|
4127
|
+
ProjectActivity: "Cli.ProjectActivity",
|
|
3755
4128
|
ShipSucceeded: "Cli.ShipSucceeded"
|
|
3756
4129
|
};
|
|
3757
4130
|
|
|
@@ -4269,87 +4642,21 @@ class TelemetryService {
|
|
|
4269
4642
|
return hex;
|
|
4270
4643
|
}
|
|
4271
4644
|
}
|
|
4272
|
-
// ../common/src/timings.ts
|
|
4273
|
-
var TIMINGS_ENV_VAR = "UIP_TIMINGS";
|
|
4274
|
-
function createStorage2() {
|
|
4275
|
-
const [error, mod] = catchError(() => __require("node:async_hooks"));
|
|
4276
|
-
if (error || typeof mod?.AsyncLocalStorage !== "function") {
|
|
4277
|
-
return {
|
|
4278
|
-
getStore: () => {
|
|
4279
|
-
return;
|
|
4280
|
-
},
|
|
4281
|
-
run: (_store, fn) => fn()
|
|
4282
|
-
};
|
|
4283
|
-
}
|
|
4284
|
-
return new mod.AsyncLocalStorage;
|
|
4285
|
-
}
|
|
4286
|
-
var storageSlot = singleton("TimingStorage");
|
|
4287
|
-
var stateSlot = singleton("Timings");
|
|
4288
|
-
var rootStartedSlot = singleton("TimingsRootStarted");
|
|
4289
|
-
var longLivedHostSlot = singleton("TimingsLongLivedHost");
|
|
4290
|
-
var storage = storageSlot.getOrInit(createStorage2, (value) => ("getStore" in value));
|
|
4291
|
-
function newState(baseline) {
|
|
4292
|
-
return { baseline, httpMs: 0, httpCalls: 0 };
|
|
4293
|
-
}
|
|
4294
|
-
function getState() {
|
|
4295
|
-
const scoped = storage.getStore();
|
|
4296
|
-
if (scoped) {
|
|
4297
|
-
return scoped;
|
|
4298
|
-
}
|
|
4299
|
-
const pinned = livePinnedState();
|
|
4300
|
-
if (pinned !== undefined) {
|
|
4301
|
-
return pinned;
|
|
4302
|
-
}
|
|
4303
|
-
return newState(processStartIsInvocationStart() ? 0 : performance.now());
|
|
4304
|
-
}
|
|
4305
|
-
function livePinnedState() {
|
|
4306
|
-
const pinned = stateSlot.get();
|
|
4307
|
-
return pinned !== undefined && "httpCalls" in pinned && !pinned.finished ? pinned : undefined;
|
|
4308
|
-
}
|
|
4309
|
-
function processStartIsInvocationStart() {
|
|
4310
|
-
return !rootStartedSlot.get(false) && !longLivedHostSlot.get(false);
|
|
4311
|
-
}
|
|
4312
|
-
function timingsEnabled() {
|
|
4313
|
-
if (typeof process === "undefined") {
|
|
4314
|
-
return false;
|
|
4315
|
-
}
|
|
4316
|
-
const value = process.env?.[TIMINGS_ENV_VAR];
|
|
4317
|
-
if (value === undefined) {
|
|
4318
|
-
return false;
|
|
4319
|
-
}
|
|
4320
|
-
const normalized = value.trim().toLowerCase();
|
|
4321
|
-
return normalized === "1" || normalized === "true";
|
|
4322
|
-
}
|
|
4323
|
-
function recordExitCode(exitCode) {
|
|
4324
|
-
if (!timingsEnabled()) {
|
|
4325
|
-
return;
|
|
4326
|
-
}
|
|
4327
|
-
getState().exitCode = exitCode;
|
|
4328
|
-
}
|
|
4329
|
-
function invocationStartedAt() {
|
|
4330
|
-
return new Date(performance.timeOrigin + getState().baseline);
|
|
4331
|
-
}
|
|
4332
|
-
function invocationElapsedMs() {
|
|
4333
|
-
return performance.now() - getState().baseline;
|
|
4334
|
-
}
|
|
4335
|
-
function markCommandStart() {
|
|
4336
|
-
if (!timingsEnabled()) {
|
|
4337
|
-
return;
|
|
4338
|
-
}
|
|
4339
|
-
getState().commandStart = performance.now();
|
|
4340
|
-
}
|
|
4341
|
-
function recordCommandDuration(durationMs) {
|
|
4342
|
-
if (!timingsEnabled()) {
|
|
4343
|
-
return;
|
|
4344
|
-
}
|
|
4345
|
-
getState().commandMs = durationMs;
|
|
4346
|
-
}
|
|
4347
4645
|
// ../common/src/telemetry/proxy-http-agent.ts
|
|
4348
4646
|
var slot = singleton("ProxyAuthHttpsAgent");
|
|
4349
4647
|
|
|
4350
4648
|
// ../common/src/telemetry/node-appinsights-telemetry-provider.ts
|
|
4351
4649
|
var providerSlot = singleton("TelemetryProvider");
|
|
4352
4650
|
|
|
4651
|
+
// ../common/src/telemetry/telemetry-config.ts
|
|
4652
|
+
function isTelemetryDisabled() {
|
|
4653
|
+
const value = process.env.UIPATH_TELEMETRY_DISABLED;
|
|
4654
|
+
return value === "1" || value === "true";
|
|
4655
|
+
}
|
|
4656
|
+
function isProjectTelemetryDisabled() {
|
|
4657
|
+
return isTelemetryDisabled() || process.env.UIPATH_PROJECT_TELEMETRY_DISABLED === "1" || process.env.UIPATH_PROJECT_TELEMETRY_DISABLED === "true";
|
|
4658
|
+
}
|
|
4659
|
+
|
|
4353
4660
|
// ../common/src/telemetry/telemetry-spool.ts
|
|
4354
4661
|
var sidecarEntrySlot = singleton("TelemetrySidecarEntry");
|
|
4355
4662
|
var MAX_SPOOL_AGE_MS = 72 * 60 * 60 * 1000;
|
|
@@ -4385,7 +4692,6 @@ var telemetry = new Proxy({}, {
|
|
|
4385
4692
|
return typeof value === "function" ? value.bind(instance) : value;
|
|
4386
4693
|
}
|
|
4387
4694
|
});
|
|
4388
|
-
|
|
4389
4695
|
// ../common/src/formatter.ts
|
|
4390
4696
|
var ANSI_STYLES = {
|
|
4391
4697
|
red: "\x1B[31m",
|
|
@@ -4395,46 +4701,6 @@ var ANSI_RESET = "\x1B[0m";
|
|
|
4395
4701
|
function styleLine(line, style) {
|
|
4396
4702
|
return style ? `${ANSI_STYLES[style]}${line}${ANSI_RESET}` : line;
|
|
4397
4703
|
}
|
|
4398
|
-
var CLI_ERROR_CODES = [
|
|
4399
|
-
"invalid_argument",
|
|
4400
|
-
"authentication_required",
|
|
4401
|
-
"permission_denied",
|
|
4402
|
-
"local_permission_denied",
|
|
4403
|
-
"not_found",
|
|
4404
|
-
"rate_limited",
|
|
4405
|
-
"network_error",
|
|
4406
|
-
"timeout",
|
|
4407
|
-
"server_error",
|
|
4408
|
-
"method_not_allowed",
|
|
4409
|
-
"not_supported",
|
|
4410
|
-
"configuration_error",
|
|
4411
|
-
"execution_failed",
|
|
4412
|
-
"unknown_error"
|
|
4413
|
-
];
|
|
4414
|
-
var RETRY_HINTS = [
|
|
4415
|
-
"RetryWillNotFix",
|
|
4416
|
-
"RetryLater",
|
|
4417
|
-
"RetryAfter1Second",
|
|
4418
|
-
"RetryAfter10Seconds",
|
|
4419
|
-
"RetryAfter30Seconds",
|
|
4420
|
-
"RetryAfter60Seconds"
|
|
4421
|
-
];
|
|
4422
|
-
var CLI_ERROR_CODE_VALUES = new Set(CLI_ERROR_CODES);
|
|
4423
|
-
var RETRY_HINT_VALUES = new Set(RETRY_HINTS);
|
|
4424
|
-
function isCliErrorCode(value) {
|
|
4425
|
-
return typeof value === "string" && CLI_ERROR_CODE_VALUES.has(value);
|
|
4426
|
-
}
|
|
4427
|
-
function isRetryHint(value) {
|
|
4428
|
-
return typeof value === "string" && RETRY_HINT_VALUES.has(value);
|
|
4429
|
-
}
|
|
4430
|
-
var RESULTS = {
|
|
4431
|
-
Success: "Success",
|
|
4432
|
-
Failure: "Failure",
|
|
4433
|
-
ConfigError: "ConfigError",
|
|
4434
|
-
AuthenticationError: "AuthenticationError",
|
|
4435
|
-
ValidationError: "ValidationError",
|
|
4436
|
-
TimeoutError: "TimeoutError"
|
|
4437
|
-
};
|
|
4438
4704
|
var EXIT_CODES = {
|
|
4439
4705
|
Success: 0,
|
|
4440
4706
|
Failure: 1,
|
|
@@ -4443,6 +4709,9 @@ var EXIT_CODES = {
|
|
|
4443
4709
|
ValidationError: 3,
|
|
4444
4710
|
TimeoutError: 4
|
|
4445
4711
|
};
|
|
4712
|
+
function exitCodeForResult(result) {
|
|
4713
|
+
return EXIT_CODES[result] ?? EXIT_CODES.Failure;
|
|
4714
|
+
}
|
|
4446
4715
|
function escapeNonAscii(jsonText) {
|
|
4447
4716
|
return jsonText.replace(/[\u0080-\uffff]/g, (c) => {
|
|
4448
4717
|
const hex = c.charCodeAt(0).toString(16).padStart(4, "0");
|
|
@@ -5118,8 +5387,8 @@ function carriesOnlyNulls(value) {
|
|
|
5118
5387
|
}
|
|
5119
5388
|
return false;
|
|
5120
5389
|
}
|
|
5121
|
-
function nameList(names,
|
|
5122
|
-
const shown = names.slice(0,
|
|
5390
|
+
function nameList(names, cap = 12) {
|
|
5391
|
+
const shown = names.slice(0, cap).map((n) => `\`${n}\``);
|
|
5123
5392
|
const rest = names.length - shown.length;
|
|
5124
5393
|
return shown.join(", ") + (rest > 0 ? `, and ${rest} more` : "");
|
|
5125
5394
|
}
|
|
@@ -5256,40 +5525,11 @@ function defaultErrorCodeForResult(result) {
|
|
|
5256
5525
|
return "unknown_error";
|
|
5257
5526
|
}
|
|
5258
5527
|
}
|
|
5259
|
-
function parseHttpStatusFromMessage2(message) {
|
|
5260
|
-
const match = /^HTTP\s+(\d{3})(?::|\s|-|$)/i.exec(message.trim());
|
|
5261
|
-
if (!match)
|
|
5262
|
-
return;
|
|
5263
|
-
const status = Number(match[1]);
|
|
5264
|
-
return Number.isInteger(status) && status >= 100 && status <= 599 ? status : undefined;
|
|
5265
|
-
}
|
|
5266
|
-
function defaultErrorCodeForHttpStatus(status) {
|
|
5267
|
-
if (status === undefined)
|
|
5268
|
-
return;
|
|
5269
|
-
if (status === 400 || status === 409 || status === 422) {
|
|
5270
|
-
return "invalid_argument";
|
|
5271
|
-
}
|
|
5272
|
-
if (status === 401)
|
|
5273
|
-
return "authentication_required";
|
|
5274
|
-
if (status === 403)
|
|
5275
|
-
return "permission_denied";
|
|
5276
|
-
if (status === 404)
|
|
5277
|
-
return "not_found";
|
|
5278
|
-
if (status === 405)
|
|
5279
|
-
return "method_not_allowed";
|
|
5280
|
-
if (status === 408)
|
|
5281
|
-
return "timeout";
|
|
5282
|
-
if (status === 429)
|
|
5283
|
-
return "rate_limited";
|
|
5284
|
-
if (status >= 500 && status < 600)
|
|
5285
|
-
return "server_error";
|
|
5286
|
-
return;
|
|
5287
|
-
}
|
|
5288
5528
|
var LOCAL_PERMISSION_TEXT_PATTERN = new RegExp(`(?:\\b|\\()(?:${[...LOCAL_PERMISSION_ERROR_CODES].join("|")})(?::\\s|\\))`);
|
|
5289
5529
|
function defaultErrorCodeForFailure(data) {
|
|
5290
5530
|
if (data.Result === RESULTS.Failure) {
|
|
5291
|
-
const status = data.Context?.httpStatus ??
|
|
5292
|
-
const errorCode =
|
|
5531
|
+
const status = data.Context?.httpStatus ?? parseHttpStatusFromMessage(data.Message);
|
|
5532
|
+
const errorCode = classifyHttpStatus(status)?.errorCode;
|
|
5293
5533
|
if (errorCode)
|
|
5294
5534
|
return errorCode;
|
|
5295
5535
|
if (status === undefined && (LOCAL_PERMISSION_TEXT_PATTERN.test(data.Message) || LOCAL_PERMISSION_TEXT_PATTERN.test(data.Instructions))) {
|
|
@@ -5298,17 +5538,6 @@ function defaultErrorCodeForFailure(data) {
|
|
|
5298
5538
|
}
|
|
5299
5539
|
return defaultErrorCodeForResult(data.Result);
|
|
5300
5540
|
}
|
|
5301
|
-
function defaultRetryForErrorCode(errorCode) {
|
|
5302
|
-
switch (errorCode) {
|
|
5303
|
-
case "network_error":
|
|
5304
|
-
case "rate_limited":
|
|
5305
|
-
case "server_error":
|
|
5306
|
-
case "timeout":
|
|
5307
|
-
return "RetryLater";
|
|
5308
|
-
default:
|
|
5309
|
-
return "RetryWillNotFix";
|
|
5310
|
-
}
|
|
5311
|
-
}
|
|
5312
5541
|
var OutputFormatter;
|
|
5313
5542
|
((OutputFormatter) => {
|
|
5314
5543
|
function success(data, options) {
|
|
@@ -5340,7 +5569,7 @@ var OutputFormatter;
|
|
|
5340
5569
|
data.Log ??= getLogFilePath() || undefined;
|
|
5341
5570
|
data.ErrorCode ??= defaultErrorCodeForFailure(data);
|
|
5342
5571
|
data.Retry ??= defaultRetryForErrorCode(data.ErrorCode);
|
|
5343
|
-
const exitCode =
|
|
5572
|
+
const exitCode = exitCodeForResult(data.Result);
|
|
5344
5573
|
setExitCode(exitCode);
|
|
5345
5574
|
recordCommandFailureTelemetry({
|
|
5346
5575
|
result: data.Result,
|
|
@@ -5435,29 +5664,227 @@ var OutputFormatter;
|
|
|
5435
5664
|
OutputFormatter.formatToString = formatToString;
|
|
5436
5665
|
})(OutputFormatter ||= {});
|
|
5437
5666
|
|
|
5438
|
-
// ../common/src/
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5667
|
+
// ../common/src/pass-through-tail.ts
|
|
5668
|
+
function maybeOption(arg) {
|
|
5669
|
+
return arg.length > 1 && arg[0] === "-";
|
|
5670
|
+
}
|
|
5671
|
+
function tokenizeTail(cmd, tail) {
|
|
5672
|
+
const find = (flag) => cmd.options.find((option) => option.long === flag || option.short === flag);
|
|
5673
|
+
const digitShort = cmd.options.some((option) => option.short !== undefined && /^-\d$/.test(option.short));
|
|
5674
|
+
const negativeNumber = (arg) => !digitShort && /^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(arg);
|
|
5675
|
+
const tokens = [];
|
|
5676
|
+
let firstUnknown = -1;
|
|
5677
|
+
let sentinel = -1;
|
|
5678
|
+
let variadic;
|
|
5679
|
+
let group;
|
|
5680
|
+
let groupIndex = 0;
|
|
5681
|
+
let i = 0;
|
|
5682
|
+
while (i < tail.length || group !== undefined) {
|
|
5683
|
+
const index = group === undefined ? i : groupIndex;
|
|
5684
|
+
const arg = group ?? tail[i++];
|
|
5685
|
+
group = undefined;
|
|
5686
|
+
if (arg === "--") {
|
|
5687
|
+
sentinel = index;
|
|
5688
|
+
tokens.push({ kind: "sentinel", index });
|
|
5689
|
+
for (let j = i;j < tail.length; j++) {
|
|
5690
|
+
tokens.push({
|
|
5691
|
+
kind: "operand",
|
|
5692
|
+
index: j,
|
|
5693
|
+
text: tail[j],
|
|
5694
|
+
literal: true
|
|
5695
|
+
});
|
|
5696
|
+
}
|
|
5697
|
+
break;
|
|
5698
|
+
}
|
|
5699
|
+
if (variadic && (!maybeOption(arg) || negativeNumber(arg))) {
|
|
5700
|
+
tokens.push({
|
|
5701
|
+
kind: "option",
|
|
5702
|
+
index,
|
|
5703
|
+
text: arg,
|
|
5704
|
+
option: variadic,
|
|
5705
|
+
value: arg
|
|
5706
|
+
});
|
|
5707
|
+
continue;
|
|
5708
|
+
}
|
|
5709
|
+
variadic = undefined;
|
|
5710
|
+
if (maybeOption(arg)) {
|
|
5711
|
+
const option = find(arg);
|
|
5712
|
+
if (option) {
|
|
5713
|
+
let value;
|
|
5714
|
+
if (option.required) {
|
|
5715
|
+
value = tail[i];
|
|
5716
|
+
if (value !== undefined)
|
|
5717
|
+
i++;
|
|
5718
|
+
} else if (option.optional) {
|
|
5719
|
+
const next = tail[i];
|
|
5720
|
+
if (next !== undefined && (!maybeOption(next) || negativeNumber(next))) {
|
|
5721
|
+
value = next;
|
|
5722
|
+
i++;
|
|
5723
|
+
}
|
|
5724
|
+
}
|
|
5725
|
+
tokens.push({
|
|
5726
|
+
kind: "option",
|
|
5727
|
+
index,
|
|
5728
|
+
text: arg,
|
|
5729
|
+
option,
|
|
5730
|
+
...value === undefined ? {} : { value }
|
|
5731
|
+
});
|
|
5732
|
+
variadic = option.variadic ? option : undefined;
|
|
5733
|
+
continue;
|
|
5734
|
+
}
|
|
5735
|
+
}
|
|
5736
|
+
if (arg.length > 2 && arg[0] === "-" && arg[1] !== "-") {
|
|
5737
|
+
const option = find(`-${arg[1]}`);
|
|
5738
|
+
if (option) {
|
|
5739
|
+
if (option.required || option.optional) {
|
|
5740
|
+
tokens.push({
|
|
5741
|
+
kind: "option",
|
|
5742
|
+
index,
|
|
5743
|
+
text: arg,
|
|
5744
|
+
option,
|
|
5745
|
+
value: arg.slice(2)
|
|
5746
|
+
});
|
|
5747
|
+
} else {
|
|
5748
|
+
tokens.push({ kind: "option", index, text: arg, option });
|
|
5749
|
+
group = `-${arg.slice(2)}`;
|
|
5750
|
+
groupIndex = index;
|
|
5751
|
+
}
|
|
5752
|
+
continue;
|
|
5753
|
+
}
|
|
5754
|
+
}
|
|
5755
|
+
if (/^--[^=]+=/.test(arg)) {
|
|
5756
|
+
const equals = arg.indexOf("=");
|
|
5757
|
+
const option = find(arg.slice(0, equals));
|
|
5758
|
+
if (option && (option.required || option.optional)) {
|
|
5759
|
+
tokens.push({
|
|
5760
|
+
kind: "option",
|
|
5761
|
+
index,
|
|
5762
|
+
text: arg,
|
|
5763
|
+
option,
|
|
5764
|
+
value: arg.slice(equals + 1)
|
|
5765
|
+
});
|
|
5766
|
+
continue;
|
|
5767
|
+
}
|
|
5768
|
+
}
|
|
5769
|
+
if (maybeOption(arg) && !negativeNumber(arg)) {
|
|
5770
|
+
const equals = arg.startsWith("--") ? arg.indexOf("=") : -1;
|
|
5771
|
+
if (firstUnknown === -1)
|
|
5772
|
+
firstUnknown = index;
|
|
5773
|
+
tokens.push({
|
|
5774
|
+
kind: "unknown",
|
|
5775
|
+
index,
|
|
5776
|
+
text: arg,
|
|
5777
|
+
flag: equals > 0 ? arg.slice(0, equals) : arg,
|
|
5778
|
+
...equals > 0 ? { inlineValue: arg.slice(equals + 1) } : {}
|
|
5779
|
+
});
|
|
5780
|
+
continue;
|
|
5781
|
+
}
|
|
5782
|
+
tokens.push({ kind: "operand", index, text: arg, literal: false });
|
|
5783
|
+
}
|
|
5784
|
+
return { tokens, firstUnknown, sentinel };
|
|
5443
5785
|
}
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5786
|
+
|
|
5787
|
+
// ../common/src/project-telemetry.ts
|
|
5788
|
+
var RESOLVER = Symbol.for("@uipath/common/projectTelemetryResolver");
|
|
5789
|
+
var CAPTURE = Symbol.for("@uipath/common/projectTelemetryCapture");
|
|
5790
|
+
var CONTEXT_RESOLVER = Symbol.for("@uipath/common/projectContextTelemetryResolver");
|
|
5791
|
+
var RULES = Symbol.for("@uipath/common/projectTargetRules");
|
|
5792
|
+
function logSkipped(what, error) {
|
|
5793
|
+
logger.debug(`[project-telemetry] ${what} skipped: ${error instanceof Error ? error.message : String(error)}`);
|
|
5794
|
+
}
|
|
5795
|
+
function bounded(work, what) {
|
|
5796
|
+
return withinProjectIdentityBudget(work, () => logSkipped(what, `no answer within ${PROJECT_IDENTITY_LOOKUP_BUDGET_MS} ms`));
|
|
5797
|
+
}
|
|
5798
|
+
async function identityWithContext(command, identity) {
|
|
5799
|
+
const props = projectIdentityProperties(identity);
|
|
5800
|
+
if (!identity.projectDirectory || isProjectTelemetryDisabled())
|
|
5801
|
+
return props;
|
|
5802
|
+
for (let node = command;node; node = node.parent ?? undefined) {
|
|
5803
|
+
const resolver = node[CONTEXT_RESOLVER];
|
|
5804
|
+
if (typeof resolver !== "function")
|
|
5805
|
+
continue;
|
|
5806
|
+
try {
|
|
5807
|
+
return {
|
|
5808
|
+
...await resolver(identity.projectDirectory),
|
|
5809
|
+
...props
|
|
5810
|
+
};
|
|
5811
|
+
} catch (error) {
|
|
5812
|
+
logSkipped("solution context lookup", error);
|
|
5813
|
+
return props;
|
|
5814
|
+
}
|
|
5815
|
+
}
|
|
5816
|
+
return props;
|
|
5454
5817
|
}
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5818
|
+
function getProjectTelemetryResolver(command) {
|
|
5819
|
+
for (let node = command;node; node = node.parent) {
|
|
5820
|
+
const resolver = node[RESOLVER];
|
|
5821
|
+
if (typeof resolver === "function")
|
|
5822
|
+
return resolver;
|
|
5458
5823
|
}
|
|
5459
|
-
return
|
|
5460
|
-
}
|
|
5824
|
+
return;
|
|
5825
|
+
}
|
|
5826
|
+
function attachProjectTelemetryCapture(command, capture) {
|
|
5827
|
+
command[CAPTURE] = capture;
|
|
5828
|
+
}
|
|
5829
|
+
class ProjectTelemetrySession {
|
|
5830
|
+
resolver;
|
|
5831
|
+
command;
|
|
5832
|
+
target;
|
|
5833
|
+
props = {};
|
|
5834
|
+
explicit = false;
|
|
5835
|
+
input;
|
|
5836
|
+
constructor(resolver, command) {
|
|
5837
|
+
this.resolver = resolver;
|
|
5838
|
+
this.command = command;
|
|
5839
|
+
}
|
|
5840
|
+
async setTarget(path) {
|
|
5841
|
+
this.target = path;
|
|
5842
|
+
if (this.input) {
|
|
5843
|
+
await this.resolve({
|
|
5844
|
+
...this.input,
|
|
5845
|
+
phase: "after",
|
|
5846
|
+
success: true
|
|
5847
|
+
});
|
|
5848
|
+
this.explicit = true;
|
|
5849
|
+
}
|
|
5850
|
+
}
|
|
5851
|
+
async setIdentity(identity) {
|
|
5852
|
+
try {
|
|
5853
|
+
const props = await bounded(identityWithContext(this.command, identity), "project identity capture");
|
|
5854
|
+
if (props !== undefined)
|
|
5855
|
+
this.setProperties(props);
|
|
5856
|
+
} catch (error) {
|
|
5857
|
+
logSkipped("project identity capture", error);
|
|
5858
|
+
}
|
|
5859
|
+
}
|
|
5860
|
+
setProperties(properties) {
|
|
5861
|
+
try {
|
|
5862
|
+
this.props = { ...properties };
|
|
5863
|
+
this.explicit = true;
|
|
5864
|
+
} catch (error) {
|
|
5865
|
+
logSkipped("project identity properties", error);
|
|
5866
|
+
}
|
|
5867
|
+
}
|
|
5868
|
+
properties() {
|
|
5869
|
+
return { ...this.props };
|
|
5870
|
+
}
|
|
5871
|
+
async resolve(input) {
|
|
5872
|
+
this.input = input;
|
|
5873
|
+
if (this.explicit)
|
|
5874
|
+
return;
|
|
5875
|
+
try {
|
|
5876
|
+
const props = await bounded(this.resolver({
|
|
5877
|
+
...input,
|
|
5878
|
+
target: this.target
|
|
5879
|
+
}), `project identity (${input.phase})`);
|
|
5880
|
+
if (props !== undefined) {
|
|
5881
|
+
this.props = props;
|
|
5882
|
+
}
|
|
5883
|
+
} catch (error) {
|
|
5884
|
+
logSkipped(`project identity (${input.phase})`, error);
|
|
5885
|
+
}
|
|
5886
|
+
}
|
|
5887
|
+
}
|
|
5461
5888
|
|
|
5462
5889
|
// ../common/src/telemetry/command-attribution.ts
|
|
5463
5890
|
var LEGACY_SKILL_NAMESPACE = "uipath:";
|
|
@@ -5703,8 +6130,7 @@ var pollSignalSlot = singleton("PollSignal");
|
|
|
5703
6130
|
var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
|
|
5704
6131
|
var processContext = {
|
|
5705
6132
|
exit: (code) => {
|
|
5706
|
-
|
|
5707
|
-
setExitCode(code);
|
|
6133
|
+
recordCommandExit(code);
|
|
5708
6134
|
},
|
|
5709
6135
|
get pollSignal() {
|
|
5710
6136
|
return pollSignalSlot.get();
|
|
@@ -5729,6 +6155,8 @@ function recordableArgValue(value, choices) {
|
|
|
5729
6155
|
function extractCommandParams(cmd) {
|
|
5730
6156
|
const params = {};
|
|
5731
6157
|
forEachSuppliedArgument(cmd, (name, value, choices, defaulted) => {
|
|
6158
|
+
if (name === undefined)
|
|
6159
|
+
return;
|
|
5732
6160
|
const recordable = recordableArgValue(value, choices);
|
|
5733
6161
|
params[`${TELEMETRY_COMMAND_ARG_PREFIX}${name}`] = recordable === TELEMETRY_ARG_VALUE_WITHHELD && defaulted ? TELEMETRY_ARG_VALUE_DEFAULTED : recordable;
|
|
5734
6162
|
});
|
|
@@ -5744,7 +6172,8 @@ function isDefaultedPositional(cmd, index) {
|
|
|
5744
6172
|
function forEachSuppliedArgument(cmd, visit) {
|
|
5745
6173
|
const registered = cmd.registeredArguments ?? [];
|
|
5746
6174
|
const processed = cmd.processedArgs ?? [];
|
|
5747
|
-
|
|
6175
|
+
const bound = boundPositionalCount(cmd);
|
|
6176
|
+
for (let i = 0;i < bound; i++) {
|
|
5748
6177
|
const name = registered[i].name();
|
|
5749
6178
|
if (name && processed[i] !== undefined) {
|
|
5750
6179
|
visit(name, processed[i], registered[i].argChoices, isDefaultedPositional(cmd, i));
|
|
@@ -5759,6 +6188,71 @@ function forEachSuppliedArgument(cmd, visit) {
|
|
|
5759
6188
|
visit(key, value, choicesByAttribute.get(key), isDefaultedOption(cmd, key));
|
|
5760
6189
|
}
|
|
5761
6190
|
}
|
|
6191
|
+
forEachPassThroughToken(cmd, bound, (name, value) => {
|
|
6192
|
+
visit(name, value, name === undefined ? undefined : choicesByAttribute.get(name), false);
|
|
6193
|
+
});
|
|
6194
|
+
}
|
|
6195
|
+
function boundPositionalCount(cmd) {
|
|
6196
|
+
const registered = cmd.registeredArguments ?? [];
|
|
6197
|
+
if (registered.some((argument) => argument.variadic)) {
|
|
6198
|
+
return registered.length;
|
|
6199
|
+
}
|
|
6200
|
+
if ((cmd.args ?? []).length <= registered.length) {
|
|
6201
|
+
return registered.length;
|
|
6202
|
+
}
|
|
6203
|
+
const firstFlag = tokenizeTail(cmd, (cmd.args ?? []).slice(1)).tokens.find((token) => token.kind !== "operand")?.index ?? -1;
|
|
6204
|
+
return firstFlag === -1 ? registered.length : Math.min(registered.length, firstFlag + 1);
|
|
6205
|
+
}
|
|
6206
|
+
function forEachPassThroughToken(cmd, bound, visit) {
|
|
6207
|
+
const registered = cmd.registeredArguments ?? [];
|
|
6208
|
+
const fillsPositionals = !registered.some((argument) => argument.variadic);
|
|
6209
|
+
const { tokens, firstUnknown } = tokenizeTail(cmd, (cmd.args ?? []).slice(bound));
|
|
6210
|
+
const repeated = new Map;
|
|
6211
|
+
let nextPositional = bound;
|
|
6212
|
+
for (const token of tokens) {
|
|
6213
|
+
const pastUnknown = firstUnknown !== -1 && token.index > firstUnknown;
|
|
6214
|
+
if (token.kind === "sentinel")
|
|
6215
|
+
continue;
|
|
6216
|
+
if (token.kind === "operand") {
|
|
6217
|
+
const claimable = !pastUnknown && fillsPositionals && nextPositional < registered.length;
|
|
6218
|
+
const name = claimable ? registered[nextPositional++].name() : undefined;
|
|
6219
|
+
visit(name || undefined, token.text);
|
|
6220
|
+
continue;
|
|
6221
|
+
}
|
|
6222
|
+
if (token.kind === "unknown") {
|
|
6223
|
+
const bare = token.flag.replace(/^-+/, "");
|
|
6224
|
+
const key = bare.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
6225
|
+
const keyable = token.flag.startsWith("--") || token.flag.length === 2;
|
|
6226
|
+
if (!pastUnknown && keyable && /^[a-z][a-z0-9-]*$/i.test(bare) && key) {
|
|
6227
|
+
visit(key, token.inlineValue ?? true);
|
|
6228
|
+
} else {
|
|
6229
|
+
visit(undefined, token.text);
|
|
6230
|
+
if (token.inlineValue !== undefined) {
|
|
6231
|
+
visit(undefined, token.inlineValue);
|
|
6232
|
+
} else if (!token.flag.startsWith("--") && token.flag.length > 2) {
|
|
6233
|
+
visit(undefined, token.flag.slice(2));
|
|
6234
|
+
}
|
|
6235
|
+
}
|
|
6236
|
+
continue;
|
|
6237
|
+
}
|
|
6238
|
+
if (pastUnknown) {
|
|
6239
|
+
visit(undefined, token.text);
|
|
6240
|
+
if (token.value !== undefined)
|
|
6241
|
+
visit(undefined, token.value);
|
|
6242
|
+
continue;
|
|
6243
|
+
}
|
|
6244
|
+
const option = token.option;
|
|
6245
|
+
const name = option.attributeName();
|
|
6246
|
+
const value = option.negate ? false : option.required || option.optional ? token.value ?? true : true;
|
|
6247
|
+
const previous = repeated.get(name);
|
|
6248
|
+
if (previous) {
|
|
6249
|
+
previous.push(value);
|
|
6250
|
+
visit(name, previous);
|
|
6251
|
+
} else {
|
|
6252
|
+
repeated.set(name, [value]);
|
|
6253
|
+
visit(name, value);
|
|
6254
|
+
}
|
|
6255
|
+
}
|
|
5762
6256
|
}
|
|
5763
6257
|
function withheldArgumentValues(cmd) {
|
|
5764
6258
|
const values = [];
|
|
@@ -5820,6 +6314,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5820
6314
|
const telemetryName = commandTelemetryName(commandParts);
|
|
5821
6315
|
const commandPath = commandInvocationPath(commandParts);
|
|
5822
6316
|
const props = typeof properties === "function" ? properties(...args) : properties;
|
|
6317
|
+
const projectResolver = getProjectTelemetryResolver(command);
|
|
6318
|
+
const projectSession = projectResolver && !isProjectTelemetryDisabled() ? new ProjectTelemetrySession(projectResolver, command) : undefined;
|
|
5823
6319
|
markCommandStart();
|
|
5824
6320
|
const supplied = recordSuppliedArgumentValues(withheldArgumentValues(command));
|
|
5825
6321
|
try {
|
|
@@ -5832,6 +6328,12 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5832
6328
|
if (violation) {
|
|
5833
6329
|
return Promise.reject(violation);
|
|
5834
6330
|
}
|
|
6331
|
+
if (projectSession) {
|
|
6332
|
+
return projectSession.resolve({ command, args, phase: "before" }).then(() => {
|
|
6333
|
+
attachProjectTelemetryCapture(command, projectSession);
|
|
6334
|
+
return fn(...args);
|
|
6335
|
+
});
|
|
6336
|
+
}
|
|
5835
6337
|
return fn(...args);
|
|
5836
6338
|
}));
|
|
5837
6339
|
if (error) {
|
|
@@ -5840,22 +6342,26 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5840
6342
|
const typed = error;
|
|
5841
6343
|
const customInstructions = typeof typed.instructions === "string" ? typed.instructions : undefined;
|
|
5842
6344
|
const customResult = typeof typed.result === "string" && typed.result !== RESULTS.Success && Object.values(RESULTS).includes(typed.result) ? typed.result : undefined;
|
|
5843
|
-
const
|
|
6345
|
+
const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
|
|
6346
|
+
const classified = cancellationExitCode === undefined ? await extractErrorDetails(error) : undefined;
|
|
6347
|
+
const finalResult = customResult ?? classified?.result ?? RESULTS.Failure;
|
|
5844
6348
|
const typedErrorCode = typed.errorCode ?? typed.ErrorCode;
|
|
5845
6349
|
const customErrorCode = isCliErrorCode(typedErrorCode) ? typedErrorCode : undefined;
|
|
5846
6350
|
const typedRetry = typed.retry ?? typed.Retry;
|
|
5847
6351
|
const customRetry = isRetryHint(typedRetry) ? typedRetry : undefined;
|
|
5848
6352
|
const typedContext = typed.context ?? typed.Context;
|
|
5849
6353
|
const customContext = isErrorContext(typedContext) ? typedContext : undefined;
|
|
5850
|
-
const cancellationExitCode = typed.exitCode === 130 || isPromptCancellation(error) ? 130 : undefined;
|
|
5851
6354
|
fallbackExitCode = cancellationExitCode ?? EXIT_CODES[finalResult];
|
|
6355
|
+
const errorCode = customErrorCode ?? classified?.errorCode;
|
|
6356
|
+
const retry = customRetry ?? classified?.retry;
|
|
6357
|
+
const errorContext = customContext ?? classified?.context;
|
|
5852
6358
|
OutputFormatter.error({
|
|
5853
6359
|
Result: finalResult,
|
|
5854
|
-
...
|
|
6360
|
+
...errorCode ? { ErrorCode: errorCode } : {},
|
|
5855
6361
|
Message: errorMessage,
|
|
5856
6362
|
Instructions: customInstructions ?? commandHelpHint(commandPath),
|
|
5857
|
-
...
|
|
5858
|
-
...
|
|
6363
|
+
...retry ? { Retry: retry } : {},
|
|
6364
|
+
...errorContext ? { Context: errorContext } : {}
|
|
5859
6365
|
});
|
|
5860
6366
|
context.exit(fallbackExitCode);
|
|
5861
6367
|
}
|
|
@@ -5864,6 +6370,14 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5864
6370
|
const exitCode = fallbackExitCode === 130 ? fallbackExitCode : exitCodeFromProcess(fallbackExitCode);
|
|
5865
6371
|
const recordedFailure = takeRecordedCommandFailureTelemetry();
|
|
5866
6372
|
const success = !error && exitCode === 0;
|
|
6373
|
+
if (projectSession) {
|
|
6374
|
+
await projectSession.resolve({
|
|
6375
|
+
command,
|
|
6376
|
+
args,
|
|
6377
|
+
phase: "after",
|
|
6378
|
+
success
|
|
6379
|
+
});
|
|
6380
|
+
}
|
|
5867
6381
|
const terminalTelemetry = buildCommandTerminalTelemetryProperties({
|
|
5868
6382
|
error,
|
|
5869
6383
|
exitCode,
|
|
@@ -5881,6 +6395,7 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5881
6395
|
}
|
|
5882
6396
|
const baseProperties = redactProperties({
|
|
5883
6397
|
...commandParams,
|
|
6398
|
+
...projectSession?.properties(),
|
|
5884
6399
|
...props,
|
|
5885
6400
|
...buildCommandTelemetryAttribution(commandPath, process.env.UIPATH_SKILL),
|
|
5886
6401
|
...buildAgentSessionTelemetry(process.env),
|
|
@@ -5891,6 +6406,8 @@ Command.prototype.trackedAction = function(context, fn, properties) {
|
|
|
5891
6406
|
});
|
|
5892
6407
|
emitInvocationRequest(telemetryName, success, baseProperties);
|
|
5893
6408
|
} finally {
|
|
6409
|
+
if (projectSession)
|
|
6410
|
+
attachProjectTelemetryCapture(command, undefined);
|
|
5894
6411
|
releaseSuppliedArgumentValues(supplied);
|
|
5895
6412
|
}
|
|
5896
6413
|
});
|
|
@@ -6170,14 +6687,14 @@ function mimeTypeForFileName(fileName) {
|
|
|
6170
6687
|
function parseBoundedInt(raw, optionName, bounds) {
|
|
6171
6688
|
const normalized = raw.trim();
|
|
6172
6689
|
if (normalized === "") {
|
|
6173
|
-
throw new
|
|
6690
|
+
throw new InvalidArgumentError2(`${optionName} requires a value (got empty).`);
|
|
6174
6691
|
}
|
|
6175
6692
|
if (!/^-?\d+$/.test(normalized)) {
|
|
6176
|
-
throw new
|
|
6693
|
+
throw new InvalidArgumentError2(`${optionName} must be an integer, got '${normalized}'.`);
|
|
6177
6694
|
}
|
|
6178
6695
|
const n = parseInt(normalized, 10);
|
|
6179
6696
|
if (n < bounds.min || n > bounds.max) {
|
|
6180
|
-
throw new
|
|
6697
|
+
throw new InvalidArgumentError2(`${optionName} must be between ${bounds.min} and ${bounds.max}, got ${n}.`);
|
|
6181
6698
|
}
|
|
6182
6699
|
return n;
|
|
6183
6700
|
}
|
|
@@ -6315,6 +6832,6 @@ function unsupportedSolutionProjectType(projectType) {
|
|
|
6315
6832
|
var shippedKeysSlot = singleton("ShipSucceededDedupeKeys");
|
|
6316
6833
|
// ../common/src/tool-provider.ts
|
|
6317
6834
|
var factorySlot = singleton("PackagerFactoryProvider");
|
|
6318
|
-
export { catchError, extractErrorDetails, extractErrorMessage, extractErrorMessageSync, appendOption, ATTACHMENT_UPLOAD_INSTRUCTIONS, parseAttachmentSpec, readAttachmentSpecs,
|
|
6835
|
+
export { catchError, extractErrorDetails, extractErrorMessage, extractErrorMessageSync, appendOption, ATTACHMENT_UPLOAD_INSTRUCTIONS, parseAttachmentSpec, readAttachmentSpecs, RESULTS, authContextFailure, summarizePlatformBody, Command, logger, OutputFormatter, processContext, isGuid, mimeTypeForFileName, parseBoundedInt, getSdkUserAgentToken, addSdkUserAgentHeader, installSdkUserAgentHeader, quoteForShell, unsupportedSolutionProjectType };
|
|
6319
6836
|
|
|
6320
|
-
//# debugId=
|
|
6837
|
+
//# debugId=3328C65B1C03516964756E2164756E21
|