@uipath/agent-tool 1.206.0-preview.301 → 1.207.0-preview.305
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD-PARTY-NOTICES.md +2 -2
- package/dist/{agent-tool-OK5DK57D-bjevqt47.js → agent-tool-OK5DK57D-swanc7b5.js} +2 -2
- package/dist/{browser-strategy-gnftxwsf.js → browser-strategy-1nk8hgcf.js} +1 -1
- package/dist/{de-AI7ML6JM-km47f8k4.js → de-B6IFKV43-9sk50xx0.js} +164 -2
- package/dist/{en-LAVDF7IQ-xe939kq1.js → en-5JIPZTS5-q1x823gc.js} +4 -2
- package/dist/{es-SPNKTD5Y-vw5cbgv5.js → es-AQW6PFIU-q2mz247f.js} +164 -2
- package/dist/{es-MX-7KJZPEQN-1fq0a9jr.js → es-MX-KWITVBWE-w49gknha.js} +164 -2
- package/dist/executor-tool.js +42 -9
- package/dist/{fr-AXJGUT53-hdg3pmd4.js → fr-RNWK2TMC-dpyzj366.js} +164 -2
- package/dist/index-9vtvwe74.js +26 -0
- package/dist/{index-f8b7h71h.js → index-je168ncz.js} +7 -5
- package/dist/{index-r7ff4pb0.js → index-knn2nm9e.js} +104 -60
- package/dist/{index-18dnd3nk.js → index-v88kds1m.js} +5 -5
- package/dist/{index-kvhrzcvf.js → index-yv2728h1.js} +3 -3
- package/dist/index.js +9 -9
- package/dist/{ja-C7GZV6YP-hvtbngr5.js → ja-DH4I3GEF-ywyhhppa.js} +164 -2
- package/dist/{ko-Q24HSSL4-5vn55pte.js → ko-R5BCWVO7-whzgmh6q.js} +164 -2
- package/dist/{memory-runtime-service-tt5y1af6.js → memory-runtime-service-zk17fk27.js} +57 -11
- package/dist/{node-strategy-fk02jqd8.js → node-strategy-ems5bj71.js} +2 -2
- package/dist/{packager-tool-9xrkfzn1.js → packager-tool-4px3x90r.js} +51 -9
- package/dist/{packager-tool-7s0srewz.js → packager-tool-85qp13np.js} +786 -294
- package/dist/{packager-tool-0ajs8pnk.js → packager-tool-9thx6ae9.js} +30 -8
- package/dist/{packager-tool-1qg04b7q.js → packager-tool-bzcphfa8.js} +4 -2
- package/dist/{packager-tool-2dd1qswc.js → packager-tool-fjgtaen6.js} +144 -12
- package/dist/{packager-tool-4shqngrj.js → packager-tool-gpm2hwy5.js} +316 -261
- package/dist/{packager-tool-kawtadzm.js → packager-tool-hgmpt45k.js} +34 -34
- package/dist/{packager-tool-fc08rcbk.js → packager-tool-k7h03v9f.js} +5 -3
- package/dist/{packager-tool-9nh85680.js → packager-tool-m0wy5pqh.js} +4 -2
- package/dist/{packager-tool-3t6d1zdz.js → packager-tool-m63j60x7.js} +120 -13
- package/dist/{packager-tool-dy6gcgks.js → packager-tool-wqg51y3z.js} +328 -133
- package/dist/{packager-tool-7wcgtmm9.js → packager-tool-xmv0ajm4.js} +56 -15
- package/dist/{packager-tool-000169n6.js → packager-tool-yz4vywz9.js} +52 -15
- package/dist/packager-tool.js +6 -6
- package/dist/{pt-BR-BIUJXIPU-2sqzhr8y.js → pt-BR-6TBBEDQS-y3f2vg5d.js} +164 -2
- package/dist/{pt-MHX6JGAX-xfgvdqwg.js → pt-ZSQC5RZ3-8kp3g1z5.js} +164 -2
- package/dist/{ro-3RKJNGJZ-xqj14e3d.js → ro-P33AQ6ZL-s92z1mgg.js} +164 -2
- package/dist/solution-auth-1tdetckr.js +11 -0
- package/dist/tool.js +9 -9
- package/dist/{tr-PQLUUHPC-qsb7btxn.js → tr-XD73CQAA-tb2nrpyp.js} +164 -2
- package/dist/{zh-CN-OHNTHZRI-b0hjkfqn.js → zh-CN-GWP3B2EM-c07fm17a.js} +164 -2
- package/dist/{zh-TW-E4D3Y6ZR-tn3bmzz5.js → zh-TW-2DLUOA7C-9khqnr4r.js} +164 -2
- package/package.json +2 -2
- package/dist/solution-auth-4zs3axft.js +0 -11
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
catchError,
|
|
3
|
+
RESULTS,
|
|
3
4
|
redactTokens,
|
|
4
5
|
parseAuthChallenge,
|
|
5
|
-
RESULTS,
|
|
6
6
|
summarizePlatformBody,
|
|
7
7
|
logger,
|
|
8
8
|
getSdkUserAgentToken,
|
|
9
9
|
addSdkUserAgentHeader,
|
|
10
10
|
installSdkUserAgentHeader
|
|
11
|
-
} from "./packager-tool-
|
|
11
|
+
} from "./packager-tool-wqg51y3z.js";
|
|
12
12
|
import {
|
|
13
|
-
readUipxFile
|
|
14
|
-
|
|
13
|
+
readUipxFile,
|
|
14
|
+
hasUnsafeNameChars2
|
|
15
|
+
} from "./packager-tool-m63j60x7.js";
|
|
15
16
|
import {
|
|
16
17
|
zipSync
|
|
17
18
|
} from "./packager-tool-wbksf242.js";
|
|
@@ -504,7 +505,7 @@ var package_default = {
|
|
|
504
505
|
name: "@uipath/solution-sdk",
|
|
505
506
|
author: "UiPath",
|
|
506
507
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
507
|
-
version: "1.
|
|
508
|
+
version: "1.207.0-preview.305",
|
|
508
509
|
repository: {
|
|
509
510
|
type: "git",
|
|
510
511
|
url: "https://github.com/UiPath/cli.git",
|
|
@@ -545,6 +546,10 @@ var package_default = {
|
|
|
545
546
|
"./project-context": {
|
|
546
547
|
types: "./dist/src/project-context.d.ts",
|
|
547
548
|
default: "./dist/project-context.js"
|
|
549
|
+
},
|
|
550
|
+
"./invocation-graph": {
|
|
551
|
+
types: "./dist/src/invocation-graph.d.ts",
|
|
552
|
+
default: "./dist/invocation-graph.js"
|
|
548
553
|
}
|
|
549
554
|
},
|
|
550
555
|
bin: {
|
|
@@ -555,7 +560,7 @@ var package_default = {
|
|
|
555
560
|
],
|
|
556
561
|
private: false,
|
|
557
562
|
scripts: {
|
|
558
|
-
build: "bun build ./src/index.ts ./src/resources/index.ts ./src/solution-auth.ts ./src/deployment-search.ts ./src/package-search.ts ./src/project-context.ts --outdir dist --format esm --target node --splitting --sourcemap=linked && bun build ./src/scripts/generate-sdk.ts --outdir dist/scripts --format esm --target node --sourcemap=linked && tsc -p tsconfig.build.json --noCheck",
|
|
563
|
+
build: "bun build ./src/index.ts ./src/resources/index.ts ./src/solution-auth.ts ./src/deployment-search.ts ./src/package-search.ts ./src/project-context.ts ./src/invocation-graph.ts --outdir dist --format esm --target node --splitting --sourcemap=linked && bun build ./src/scripts/generate-sdk.ts --outdir dist/scripts --format esm --target node --sourcemap=linked && tsc -p tsconfig.build.json --noCheck",
|
|
559
564
|
generate: "bun run src/scripts/generate-sdk.ts",
|
|
560
565
|
lint: "biome check .",
|
|
561
566
|
test: "vitest run",
|
|
@@ -819,6 +824,24 @@ function assertStudioWebCompatibleProjects(projects) {
|
|
|
819
824
|
throw new StudioWebIncompatibleProjectError2(incompatible.map((p) => p.ProjectRelativePath));
|
|
820
825
|
}
|
|
821
826
|
}
|
|
827
|
+
var MAX_NAMED_PATHS = 20;
|
|
828
|
+
|
|
829
|
+
class StudioWebInvalidFileNameError2 extends Error {
|
|
830
|
+
offendingPaths;
|
|
831
|
+
constructor(offendingPaths) {
|
|
832
|
+
const named = offendingPaths.slice(0, MAX_NAMED_PATHS).join(", ");
|
|
833
|
+
const more = offendingPaths.length - MAX_NAMED_PATHS;
|
|
834
|
+
super(`Studio Web cannot import a project file whose name holds a control character or any of : * ? " < > |: ${named}${more > 0 ? `, and ${more} more` : ""}.`);
|
|
835
|
+
this.offendingPaths = offendingPaths;
|
|
836
|
+
this.name = "StudioWebInvalidFileNameError";
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
function assertStudioWebValidFileNames(projectFilePaths) {
|
|
840
|
+
const invalid = projectFilePaths.filter((p) => hasUnsafeNameChars2(p.replace(/\\/g, "/").split("/").pop() ?? ""));
|
|
841
|
+
if (invalid.length > 0) {
|
|
842
|
+
throw new StudioWebInvalidFileNameError2(invalid);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
822
845
|
|
|
823
846
|
// ../solution-sdk/src/zip-utils.ts
|
|
824
847
|
var import_ignore = __toESM(require_ignore(), 1);
|
|
@@ -1039,14 +1062,16 @@ async function mirrorTree(fs, srcDir, relativeBase, destBaseDir, ignoreRules) {
|
|
|
1039
1062
|
if (rootRel) {
|
|
1040
1063
|
await fs.mkdir(fs.path.join(destBaseDir, rootRel));
|
|
1041
1064
|
}
|
|
1042
|
-
return;
|
|
1065
|
+
return [];
|
|
1043
1066
|
}
|
|
1067
|
+
const copied = [];
|
|
1044
1068
|
for (const f of files) {
|
|
1045
1069
|
const relPath = fs.path.relative(relativeBase, f);
|
|
1046
1070
|
const destPath = fs.path.join(destBaseDir, relPath);
|
|
1047
1071
|
const data = await fs.readFile(f);
|
|
1048
1072
|
if (data) {
|
|
1049
1073
|
await fs.writeFile(destPath, data);
|
|
1074
|
+
copied.push(f);
|
|
1050
1075
|
} else {
|
|
1051
1076
|
logger.warn(`Skipping empty or unreadable file: ${f}`);
|
|
1052
1077
|
}
|
|
@@ -1058,9 +1083,11 @@ async function mirrorTree(fs, srcDir, relativeBase, destBaseDir, ignoreRules) {
|
|
|
1058
1083
|
}
|
|
1059
1084
|
await fs.mkdir(fs.path.join(destBaseDir, relPath));
|
|
1060
1085
|
}
|
|
1086
|
+
return copied;
|
|
1061
1087
|
}
|
|
1062
1088
|
async function flattenProjectDir(fs, srcProjectDir, destProjectDir, ignoreRules) {
|
|
1063
1089
|
await fs.mkdir(destProjectDir);
|
|
1090
|
+
const copied = [];
|
|
1064
1091
|
const entries = await fs.readdir(srcProjectDir);
|
|
1065
1092
|
for (const entryName of entries) {
|
|
1066
1093
|
const srcPath = fs.path.join(srcProjectDir, entryName);
|
|
@@ -1075,18 +1102,20 @@ async function flattenProjectDir(fs, srcProjectDir, destProjectDir, ignoreRules)
|
|
|
1075
1102
|
const data = await fs.readFile(srcPath);
|
|
1076
1103
|
if (data) {
|
|
1077
1104
|
await fs.writeFile(fs.path.join(destProjectDir, entryName), data);
|
|
1105
|
+
copied.push(srcPath);
|
|
1078
1106
|
}
|
|
1079
1107
|
} else if (entryStat.isDirectory()) {
|
|
1080
1108
|
if (DEFAULT_EXCLUDED_DIR_NAMES.has(entryName) || isIgnoredByRules(fs, ignoreRules, srcPath, true)) {
|
|
1081
1109
|
continue;
|
|
1082
1110
|
}
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1111
|
+
const relativeBase = entryName === "content" || entryName === "flow_files" ? srcPath : srcProjectDir;
|
|
1112
|
+
const mirrored = await mirrorTree(fs, srcPath, relativeBase, destProjectDir, ignoreRules);
|
|
1113
|
+
for (const f of mirrored) {
|
|
1114
|
+
copied.push(f);
|
|
1087
1115
|
}
|
|
1088
1116
|
}
|
|
1089
1117
|
}
|
|
1118
|
+
return copied;
|
|
1090
1119
|
}
|
|
1091
1120
|
async function bundleSolution2(fs, solutionDir, outputDir, outputName) {
|
|
1092
1121
|
const resolvedPath = fs.path.resolve(solutionDir);
|
|
@@ -1121,6 +1150,7 @@ async function bundleSolution2(fs, solutionDir, outputDir, outputName) {
|
|
|
1121
1150
|
try {
|
|
1122
1151
|
await fs.writeFile(fs.path.join(stagingDir, "SolutionStorage.json"), JSON.stringify(solutionStorage));
|
|
1123
1152
|
await fs.writeFile(fs.path.join(stagingDir, uipxFileName), JSON.stringify(uipx));
|
|
1153
|
+
const projectFiles = [];
|
|
1124
1154
|
for (const project of uipx.Projects) {
|
|
1125
1155
|
const projectDir = fs.path.dirname(project.ProjectRelativePath);
|
|
1126
1156
|
const srcProjectPath = fs.path.join(resolvedPath, projectDir);
|
|
@@ -1133,8 +1163,12 @@ async function bundleSolution2(fs, solutionDir, outputDir, outputName) {
|
|
|
1133
1163
|
if (isIgnoredByRules(fs, projectRules, manifestPath, false)) {
|
|
1134
1164
|
throw new UipignoreExcludesProjectError2(project.ProjectRelativePath);
|
|
1135
1165
|
}
|
|
1136
|
-
await flattenProjectDir(fs, srcProjectPath, fs.path.join(stagingDir, projectDir), projectRules);
|
|
1166
|
+
const copied = await flattenProjectDir(fs, srcProjectPath, fs.path.join(stagingDir, projectDir), projectRules);
|
|
1167
|
+
for (const f of copied) {
|
|
1168
|
+
projectFiles.push(toForwardSlash(fs.path.relative(resolvedPath, f)));
|
|
1169
|
+
}
|
|
1137
1170
|
}
|
|
1171
|
+
assertStudioWebValidFileNames(projectFiles);
|
|
1138
1172
|
const resourcesPath = fs.path.join(resolvedPath, "resources");
|
|
1139
1173
|
if (!isTopLevelTreeExcluded(resourcesPath, "resources") && await fs.exists(resourcesPath)) {
|
|
1140
1174
|
await mirrorTree(fs, resourcesPath, resolvedPath, stagingDir, solutionRules);
|
|
@@ -1244,6 +1278,7 @@ function buildAuthRefusalInstructions({
|
|
|
1244
1278
|
const closing = bodySuffix ? `If the grants and the tenant are already right, report the platform ` + `response, including its traceId.${bodySuffix}` : challenge.error ? `If the grants and the tenant are already right, report that reason ` + `together with the request path and status above.` : `If the grants and the tenant are already right, report the request ` + `path and status above — Studio Web returned no response body and ` + `no authentication challenge, so there is nothing further to quote.`;
|
|
1245
1279
|
return `Studio Web ${refusal} while ${what}. ${diagnosis}${actor}${tenant}` + `Nothing was uploaded and nothing ran, so the ${subject} is not the ` + `cause. ${closing}`;
|
|
1246
1280
|
}
|
|
1281
|
+
var INVALID_FILE_NAME_ERROR_CODE = "20039";
|
|
1247
1282
|
function buildSolutionUploadFailureOutput2(err, options = {}) {
|
|
1248
1283
|
const stage = err.operation === "overwrite" ? "overwrite-solution" : "import-solution";
|
|
1249
1284
|
const authRefusal = isAuthRefusal(err.status);
|
|
@@ -1264,7 +1299,8 @@ function buildSolutionUploadFailureOutput2(err, options = {}) {
|
|
|
1264
1299
|
identityType: options.identityType,
|
|
1265
1300
|
clientId: options.clientId
|
|
1266
1301
|
}) : undefined;
|
|
1267
|
-
const
|
|
1302
|
+
const invalidFileName = err.parsedErrorCode === INVALID_FILE_NAME_ERROR_CODE;
|
|
1303
|
+
const Instructions = authInstructions ?? (invalidFileName ? `Studio Web refused a file name in the uploaded solution ` + `package: a file inside a project folder has a name holding a ` + `control character or one of : * ? " < > |, and the platform ` + `does not say which file. Rename that file, or move it out ` + `of the project folder, and upload again. Retrying ` + `unchanged fails the same way.${bodySuffix}` : err.operation === "overwrite" ? `Studio Web refused to replace the contents of solution ` + `${target}. Nothing was uploaded and nothing ran, so the ` + `${subject} is not the cause: do not re-author it, and do not ` + `copy the project into another solution. Confirm that ${target} ` + `is a solution you can still write to, and that it is the one ` + `this project should publish to — it comes from the SolutionId ` + `recorded in the enclosing solution file. If it is right, report ` + `the platform response.${bodySuffix}` : `Studio Web refused to import the solution package. Nothing was ` + `uploaded and nothing ran, so no part of the ${subject} executed ` + `— but the package itself may be what was rejected.${importHint} ` + `Report the platform response if the ${subject} is ` + `well-formed.${bodySuffix}`);
|
|
1268
1304
|
const Context = {
|
|
1269
1305
|
httpStatus: err.status,
|
|
1270
1306
|
stage,
|
|
@@ -1283,6 +1319,11 @@ function buildSolutionUploadFailureOutput2(err, options = {}) {
|
|
|
1283
1319
|
if (err.status === 401 && options.identityType === "Application") {
|
|
1284
1320
|
output.ErrorCode = "permission_denied";
|
|
1285
1321
|
}
|
|
1322
|
+
if (invalidFileName) {
|
|
1323
|
+
output.ErrorCode = "invalid_argument";
|
|
1324
|
+
output.Retry = "RetryWillNotFix";
|
|
1325
|
+
return output;
|
|
1326
|
+
}
|
|
1286
1327
|
if (err.operation === "overwrite" && err.status >= 500 && err.status < 600) {
|
|
1287
1328
|
output.Retry = "RetryAfter30Seconds";
|
|
1288
1329
|
}
|
|
@@ -1415,6 +1456,6 @@ async function uploadOrOverwriteSolution2(config, organizationName, fileBufferOr
|
|
|
1415
1456
|
logger.info("Importing new solution to Studio Web...");
|
|
1416
1457
|
return importSolution(config, organizationName, fileBuffer, fileName);
|
|
1417
1458
|
}
|
|
1418
|
-
export { StudioWebIncompatibleProjectError2, finalizeZip642, UipignoreExcludesProjectError2, bundleSolution2, isSolutionUploadHttpError2, buildSolutionUploadFailureOutput2, uploadOrOverwriteSolution2 };
|
|
1459
|
+
export { StudioWebIncompatibleProjectError2, StudioWebInvalidFileNameError2, finalizeZip642, UipignoreExcludesProjectError2, bundleSolution2, isSolutionUploadHttpError2, buildSolutionUploadFailureOutput2, uploadOrOverwriteSolution2 };
|
|
1419
1460
|
|
|
1420
|
-
//# debugId=
|
|
1461
|
+
//# debugId=6089C8BEBBCECD3A64756E2164756E21
|
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getFileSystem
|
|
3
|
-
} from "./packager-tool-
|
|
3
|
+
} from "./packager-tool-9thx6ae9.js";
|
|
4
4
|
import {
|
|
5
5
|
catchError,
|
|
6
|
+
RESULTS,
|
|
6
7
|
extractErrorDetails,
|
|
7
8
|
extractErrorMessage,
|
|
8
9
|
parseAttachmentSpec,
|
|
9
10
|
readAttachmentSpecs,
|
|
10
11
|
logger,
|
|
11
12
|
OutputFormatter
|
|
12
|
-
} from "./packager-tool-
|
|
13
|
+
} from "./packager-tool-wqg51y3z.js";
|
|
13
14
|
import {
|
|
14
15
|
PersonalWorkspacesApi2,
|
|
15
16
|
createApiClient2,
|
|
16
17
|
JobAttachmentUploadError2,
|
|
17
18
|
uploadJobAttachment2
|
|
18
|
-
} from "./packager-tool-
|
|
19
|
+
} from "./packager-tool-fjgtaen6.js";
|
|
19
20
|
import {
|
|
20
21
|
getAuthContext2
|
|
21
|
-
} from "./packager-tool-
|
|
22
|
+
} from "./packager-tool-4px3x90r.js";
|
|
22
23
|
import {
|
|
23
24
|
finalizeZip642,
|
|
24
25
|
bundleSolution2,
|
|
25
26
|
uploadOrOverwriteSolution2
|
|
26
|
-
} from "./packager-tool-
|
|
27
|
+
} from "./packager-tool-xmv0ajm4.js";
|
|
27
28
|
import {
|
|
28
29
|
updateUipxSolutionId2,
|
|
29
30
|
findSolutionFile2,
|
|
30
31
|
updateSolutionFile2
|
|
31
|
-
} from "./packager-tool-
|
|
32
|
+
} from "./packager-tool-m63j60x7.js";
|
|
32
33
|
import {
|
|
33
34
|
zipSync
|
|
34
35
|
} from "./packager-tool-wbksf242.js";
|
|
@@ -540,12 +541,15 @@ class AgentLocalWorkspaceEvalPreparer {
|
|
|
540
541
|
async isLocalWorkspace(projectPath) {
|
|
541
542
|
return await this.readLocalWorkspaceMarker(projectPath) !== undefined;
|
|
542
543
|
}
|
|
543
|
-
async prepare(projectPath, config, existingSolutionIdOverride) {
|
|
544
|
+
async prepare(projectPath, config, existingSolutionIdOverride, onAgentDirResolved) {
|
|
544
545
|
const absoluteProjectPath = this.fs.path.resolve(projectPath);
|
|
545
546
|
const marker = await this.readLocalWorkspaceMarker(absoluteProjectPath);
|
|
546
547
|
const packageRoot = marker?.rootPath ?? absoluteProjectPath;
|
|
547
548
|
const projectService = new AgentProjectService;
|
|
548
549
|
const agentDir = await projectService.resolveAgentDir(absoluteProjectPath);
|
|
550
|
+
if (agentDir !== absoluteProjectPath) {
|
|
551
|
+
await onAgentDirResolved?.(agentDir);
|
|
552
|
+
}
|
|
549
553
|
const agent = await projectService.readAgentJson(absoluteProjectPath);
|
|
550
554
|
const projectFilePath = this.fs.path.join(agentDir, "project.uiproj");
|
|
551
555
|
if (!await this.fs.exists(projectFilePath)) {
|
|
@@ -698,6 +702,39 @@ class AgentDebugStartOutcomeUnknownError extends Error {
|
|
|
698
702
|
return new AgentDebugStartOutcomeUnknownError(this.message, this.errorCode, bound, { cause: this.cause });
|
|
699
703
|
}
|
|
700
704
|
}
|
|
705
|
+
var NO_PERSONAL_ROBOT_ERROR_CODE = "1230";
|
|
706
|
+
|
|
707
|
+
class AgentDebugStartRejectedError extends Error {
|
|
708
|
+
result;
|
|
709
|
+
errorCode;
|
|
710
|
+
retry;
|
|
711
|
+
instructions;
|
|
712
|
+
context;
|
|
713
|
+
constructor(message, result, errorCode, retry, instructions, context) {
|
|
714
|
+
super(message);
|
|
715
|
+
this.result = result;
|
|
716
|
+
this.errorCode = errorCode;
|
|
717
|
+
this.retry = retry;
|
|
718
|
+
this.instructions = instructions;
|
|
719
|
+
this.context = context;
|
|
720
|
+
this.name = "AgentDebugStartRejectedError";
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
async function startRejectedError(response, body) {
|
|
724
|
+
const details = await extractErrorDetails({
|
|
725
|
+
status: response.status,
|
|
726
|
+
response: {
|
|
727
|
+
status: response.status,
|
|
728
|
+
statusText: response.statusText,
|
|
729
|
+
headers: response.headers,
|
|
730
|
+
text: () => Promise.resolve(body)
|
|
731
|
+
}
|
|
732
|
+
});
|
|
733
|
+
if (details.context?.errorCode === NO_PERSONAL_ROBOT_ERROR_CODE) {
|
|
734
|
+
return new AgentDebugStartRejectedError("Your user has no personal robot on this tenant, and 'uip agent debug' runs the agent as you.", RESULTS.ConfigError, "configuration_error", "RetryWillNotFix", "Ask a tenant administrator to give your user a personal robot (Orchestrator > Tenant > Manage Access > your user > Robot setup), then run 'uip agent debug' again.", details.context);
|
|
735
|
+
}
|
|
736
|
+
return new AgentDebugStartRejectedError(`Orchestrator refused to start the debug job: ${details.message}`, details.result, details.errorCode, details.retry, details.retry === "RetryWillNotFix" ? "No debug job was started. Fix what Orchestrator reported, then run 'uip agent debug' again." : "No debug job was started. Run 'uip agent debug' again in a moment.", details.context);
|
|
737
|
+
}
|
|
701
738
|
var TERMINAL_STATES = new Set([
|
|
702
739
|
"Successful",
|
|
703
740
|
"Faulted",
|
|
@@ -711,7 +748,7 @@ class AgentDebugService {
|
|
|
711
748
|
projectService = new AgentProjectService;
|
|
712
749
|
async debug(options, auth) {
|
|
713
750
|
throwIfAborted(options.signal);
|
|
714
|
-
const projectId = await this.resolveProjectId(options.projectPath);
|
|
751
|
+
const projectId = await this.resolveProjectId(options.projectPath, options.onAgentDirResolved);
|
|
715
752
|
throwIfAborted(options.signal);
|
|
716
753
|
const folderKey = await this.resolvePersonalWorkspaceKey();
|
|
717
754
|
throwIfAborted(options.signal);
|
|
@@ -788,12 +825,12 @@ class AgentDebugService {
|
|
|
788
825
|
}
|
|
789
826
|
logger.warn(`The debug job did not start, so attachments ${bound.map((b) => b.reference.ID).join(", ")} are left on the tenant for retention to reclaim.`);
|
|
790
827
|
}
|
|
791
|
-
async resolveProjectId(projectPath) {
|
|
828
|
+
async resolveProjectId(projectPath, onAgentDirResolved) {
|
|
792
829
|
const preparer = new AgentLocalWorkspaceEvalPreparer;
|
|
793
830
|
if (await preparer.isLocalWorkspace(projectPath)) {
|
|
794
831
|
const [, storage] = await catchError(this.projectService.readSolutionStorage(projectPath));
|
|
795
832
|
const config = await resolveStudioWebConfig();
|
|
796
|
-
const prepared = await preparer.prepare(projectPath, config, storage?.SolutionId);
|
|
833
|
+
const prepared = await preparer.prepare(projectPath, config, storage?.SolutionId, onAgentDirResolved);
|
|
797
834
|
return prepared.agentProjectId;
|
|
798
835
|
}
|
|
799
836
|
return this.uploadSolutionAndResolveProjectId(projectPath);
|
|
@@ -878,11 +915,11 @@ class AgentDebugService {
|
|
|
878
915
|
throw new AgentDebugStartOutcomeUnknownError(`Failed to start debug job: ${await extractErrorMessage(fetchError)}`, "network_error", [], { cause: fetchError });
|
|
879
916
|
}
|
|
880
917
|
if (!response.ok) {
|
|
881
|
-
const
|
|
918
|
+
const body = await response.text();
|
|
882
919
|
if (response.status >= 500) {
|
|
883
|
-
throw new AgentDebugStartOutcomeUnknownError(
|
|
920
|
+
throw new AgentDebugStartOutcomeUnknownError(`Failed to start debug job: ${response.status} ${body}`, "server_error");
|
|
884
921
|
}
|
|
885
|
-
throw
|
|
922
|
+
throw await startRejectedError(response, body);
|
|
886
923
|
}
|
|
887
924
|
const [bodyError, data] = await catchError(response.json());
|
|
888
925
|
if (bodyError && isAbortError(bodyError)) {
|
|
@@ -961,6 +998,6 @@ function parseOutput(outputArguments) {
|
|
|
961
998
|
return error ? outputArguments : parsed;
|
|
962
999
|
}
|
|
963
1000
|
|
|
964
|
-
export { migrateLegacyToolGuardrailPolicies, AgentProjectService, resolveStudioWebConfig, AgentLocalWorkspaceEvalPreparer, AttachmentInputError, toAttachmentSummaries, prepareAttachmentInputs, AgentDebugCancelledError, AgentDebugAttachmentUploadError, AgentDebugStartOutcomeUnknownError, AgentDebugService };
|
|
1001
|
+
export { migrateLegacyToolGuardrailPolicies, AgentProjectService, resolveStudioWebConfig, AgentLocalWorkspaceEvalPreparer, AttachmentInputError, toAttachmentSummaries, prepareAttachmentInputs, AgentDebugCancelledError, AgentDebugAttachmentUploadError, AgentDebugStartOutcomeUnknownError, AgentDebugStartRejectedError, AgentDebugService };
|
|
965
1002
|
|
|
966
|
-
//# debugId=
|
|
1003
|
+
//# debugId=BBB1AEF72249135264756E2164756E21
|
package/dist/packager-tool.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./packager-tool-
|
|
2
|
+
toolsFactoryRepository2
|
|
3
|
+
} from "./packager-tool-gpm2hwy5.js";
|
|
4
4
|
import"./packager-tool-bh92xy8d.js";
|
|
5
|
-
import"./packager-tool-
|
|
5
|
+
import"./packager-tool-hgmpt45k.js";
|
|
6
6
|
|
|
7
7
|
// ../../node_modules/@uipath/tool-agent/dist/index.js
|
|
8
8
|
var AgentToolFactory = class {
|
|
@@ -10,12 +10,12 @@ var AgentToolFactory = class {
|
|
|
10
10
|
this.supportedTypes = ["Agent" /* Agent */];
|
|
11
11
|
}
|
|
12
12
|
async createAsync(logger, fileSystem) {
|
|
13
|
-
const { AgentTool: AgentTool2 } = await import("./agent-tool-OK5DK57D-
|
|
13
|
+
const { AgentTool: AgentTool2 } = await import("./agent-tool-OK5DK57D-swanc7b5.js");
|
|
14
14
|
return new AgentTool2(fileSystem, logger);
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
function registerAgentToolFactory() {
|
|
18
|
-
|
|
18
|
+
toolsFactoryRepository2.registerProjectToolFactory(new AgentToolFactory);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
// src/packager-tool.ts
|
|
@@ -26,4 +26,4 @@ export {
|
|
|
26
26
|
registerPackagerFactories
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
//# debugId=
|
|
29
|
+
//# debugId=40694D7788FC0EEB64756E2164756E21
|