@uipath/agent-tool 1.204.0 → 1.205.0-preview.258

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.
@@ -0,0 +1,247 @@
1
+ import {
2
+ __require
3
+ } from "./packager-tool-1yh8g550.js";
4
+
5
+ // ../filesystem/src/node.ts
6
+ import { randomUUID } from "node:crypto";
7
+ import { existsSync } from "node:fs";
8
+ import * as fs from "node:fs/promises";
9
+ import * as os from "node:os";
10
+ import * as path from "node:path";
11
+ var LOCK_HEARTBEAT_MS = 5000;
12
+ var LOCK_STALE_MS = 15000;
13
+ var LOCK_MAX_WAIT_MS = 20000;
14
+ var LOCK_MAX_HOLD_MS = 60000;
15
+ var LOCK_RETRY_MIN_MS = 100;
16
+ var LOCK_RETRY_JITTER_MS = 200;
17
+
18
+ class NodeFileSystem {
19
+ path = {
20
+ join: path.join,
21
+ resolve: path.resolve,
22
+ relative: path.relative,
23
+ dirname: path.dirname,
24
+ isAbsolute: path.isAbsolute,
25
+ basename: path.basename
26
+ };
27
+ env = {
28
+ cwd: process.cwd,
29
+ homedir: os.homedir,
30
+ tmpdir: os.tmpdir,
31
+ getenv: (key) => process.env[key]
32
+ };
33
+ utils = {
34
+ open: async (url) => {
35
+ const { default: open } = await import("./index-h8cph72k.js");
36
+ await open(url);
37
+ }
38
+ };
39
+ async readFile(path2, options) {
40
+ try {
41
+ if (options) {
42
+ return await fs.readFile(path2, "utf-8");
43
+ }
44
+ return await fs.readFile(path2);
45
+ } catch (error) {
46
+ if (this.isEnoent(error))
47
+ return null;
48
+ throw error;
49
+ }
50
+ }
51
+ async writeFile(filePath, data) {
52
+ const dir = path.dirname(filePath);
53
+ if (dir) {
54
+ await fs.mkdir(dir, { recursive: true });
55
+ }
56
+ await fs.writeFile(filePath, data);
57
+ }
58
+ async appendFile(filePath, data) {
59
+ const dir = path.dirname(filePath);
60
+ if (dir) {
61
+ await fs.mkdir(dir, { recursive: true });
62
+ }
63
+ await fs.appendFile(filePath, data);
64
+ }
65
+ async readdir(dirPath) {
66
+ try {
67
+ return await fs.readdir(dirPath);
68
+ } catch (error) {
69
+ if (this.isEnoent(error))
70
+ return [];
71
+ throw error;
72
+ }
73
+ }
74
+ async stat(filePath) {
75
+ try {
76
+ const stats = await fs.stat(filePath);
77
+ return {
78
+ isFile: () => stats.isFile(),
79
+ isDirectory: () => stats.isDirectory(),
80
+ size: stats.size,
81
+ mtimeMs: stats.mtimeMs
82
+ };
83
+ } catch (error) {
84
+ if (this.isEnoent(error))
85
+ return null;
86
+ throw error;
87
+ }
88
+ }
89
+ async exists(filePath) {
90
+ return existsSync(filePath);
91
+ }
92
+ async mkdir(dirPath) {
93
+ await fs.mkdir(dirPath, { recursive: true });
94
+ }
95
+ async acquireLock(lockPath) {
96
+ const canonicalPath = await this.canonicalizeLockTarget(lockPath);
97
+ const lockFile = `${canonicalPath}.lock`;
98
+ const ownerId = randomUUID();
99
+ const start = Date.now();
100
+ while (true) {
101
+ try {
102
+ await fs.writeFile(lockFile, ownerId, { flag: "wx" });
103
+ return this.createLockRelease(lockFile, ownerId);
104
+ } catch (error) {
105
+ if (!this.hasErrnoCode(error, "EEXIST")) {
106
+ throw error;
107
+ }
108
+ const stats = await fs.stat(lockFile).catch(() => null);
109
+ if (stats && Date.now() - stats.mtimeMs > LOCK_STALE_MS) {
110
+ const reclaimed = await fs.rm(lockFile, { force: true }).then(() => true).catch(() => false);
111
+ if (reclaimed)
112
+ continue;
113
+ }
114
+ if (Date.now() - start > LOCK_MAX_WAIT_MS) {
115
+ throw new Error(`ELOCKED: timed out waiting for lock on ${canonicalPath}`);
116
+ }
117
+ await new Promise((resolve2) => setTimeout(resolve2, LOCK_RETRY_MIN_MS + Math.random() * LOCK_RETRY_JITTER_MS));
118
+ }
119
+ }
120
+ }
121
+ async canonicalizeLockTarget(lockPath) {
122
+ const absolute = path.resolve(lockPath);
123
+ const fullReal = await fs.realpath(absolute).catch(() => null);
124
+ if (fullReal)
125
+ return fullReal;
126
+ const parent = path.dirname(absolute);
127
+ const base = path.basename(absolute);
128
+ const canonicalParent = await fs.realpath(parent).catch(() => parent);
129
+ return path.join(canonicalParent, base);
130
+ }
131
+ createLockRelease(lockFile, ownerId) {
132
+ const heartbeatStart = Date.now();
133
+ let heartbeatTimer;
134
+ let stopped = false;
135
+ const stopHeartbeat = () => {
136
+ stopped = true;
137
+ if (heartbeatTimer)
138
+ clearTimeout(heartbeatTimer);
139
+ };
140
+ const scheduleNextHeartbeat = () => {
141
+ if (stopped)
142
+ return;
143
+ if (Date.now() - heartbeatStart >= LOCK_MAX_HOLD_MS) {
144
+ stopped = true;
145
+ return;
146
+ }
147
+ heartbeatTimer = setTimeout(() => {
148
+ runHeartbeat();
149
+ }, LOCK_HEARTBEAT_MS);
150
+ heartbeatTimer.unref?.();
151
+ };
152
+ const runHeartbeat = async () => {
153
+ if (stopped)
154
+ return;
155
+ const current = await fs.readFile(lockFile, "utf-8").catch(() => null);
156
+ if (stopped)
157
+ return;
158
+ if (current !== ownerId) {
159
+ stopped = true;
160
+ return;
161
+ }
162
+ const now = Date.now() / 1000;
163
+ await fs.utimes(lockFile, now, now).catch(() => {});
164
+ scheduleNextHeartbeat();
165
+ };
166
+ scheduleNextHeartbeat();
167
+ let released = false;
168
+ return async () => {
169
+ if (released)
170
+ return;
171
+ released = true;
172
+ stopHeartbeat();
173
+ const current = await fs.readFile(lockFile, "utf-8").catch(() => null);
174
+ if (current === ownerId) {
175
+ await fs.rm(lockFile, { force: true });
176
+ }
177
+ };
178
+ }
179
+ async rm(filePath) {
180
+ await fs.rm(filePath, { recursive: true, force: true });
181
+ }
182
+ async rename(oldPath, newPath) {
183
+ await fs.rename(oldPath, newPath);
184
+ }
185
+ async isSymbolicLink(filePath) {
186
+ try {
187
+ return (await fs.lstat(filePath)).isSymbolicLink();
188
+ } catch (error) {
189
+ if (this.isEnoent(error) || this.hasErrnoCode(error, "ENOTDIR")) {
190
+ return false;
191
+ }
192
+ throw error;
193
+ }
194
+ }
195
+ async realpath(filePath) {
196
+ try {
197
+ return await fs.realpath(filePath);
198
+ } catch (error) {
199
+ if (this.isEnoent(error))
200
+ return filePath;
201
+ throw error;
202
+ }
203
+ }
204
+ async getTempDir() {
205
+ return await fs.mkdtemp(path.join(os.tmpdir(), "uipath-fs-"));
206
+ }
207
+ async copyDirectory(sourcePath, destPath) {
208
+ const sourceStats = await this.stat(sourcePath);
209
+ if (!sourceStats) {
210
+ throw new Error(`Source directory does not exist: ${sourcePath}`);
211
+ }
212
+ if (!sourceStats.isDirectory()) {
213
+ throw new Error(`Source path is not a directory: ${sourcePath}`);
214
+ }
215
+ await this.mkdir(destPath);
216
+ const entries = await this.readdir(sourcePath);
217
+ for (const entry of entries) {
218
+ const srcEntry = path.join(sourcePath, entry);
219
+ const destEntry = path.join(destPath, entry);
220
+ const entryStats = await this.stat(srcEntry);
221
+ if (!entryStats)
222
+ continue;
223
+ if (entryStats.isDirectory()) {
224
+ await this.copyDirectory(srcEntry, destEntry);
225
+ } else if (entryStats.isFile()) {
226
+ const content = await this.readFile(srcEntry);
227
+ if (content !== null) {
228
+ await this.writeFile(destEntry, content);
229
+ }
230
+ }
231
+ }
232
+ }
233
+ isEnoent(error) {
234
+ return this.hasErrnoCode(error, "ENOENT");
235
+ }
236
+ hasErrnoCode(error, code) {
237
+ return typeof error === "object" && error !== null && "code" in error && error.code === code;
238
+ }
239
+ }
240
+
241
+ // ../filesystem/src/index.ts
242
+ var fsInstance = new NodeFileSystem;
243
+ var getFileSystem = () => fsInstance;
244
+
245
+ export { getFileSystem };
246
+
247
+ //# debugId=82E3494FD83B7EB464756E2164756E21
@@ -15,25 +15,25 @@ import {
15
15
  prepareAttachmentInputs,
16
16
  resolveStudioWebConfig,
17
17
  toAttachmentSummaries
18
- } from "./packager-tool-cfkfh4xq.js";
18
+ } from "./packager-tool-4fq1ta8t.js";
19
19
  import {
20
20
  StudioWebIncompatibleProjectError,
21
21
  UipignoreExcludesProjectError,
22
22
  buildSolutionUploadFailureOutput,
23
23
  isSolutionUploadHttpError
24
- } from "./packager-tool-s41pfpn7.js";
24
+ } from "./packager-tool-yv1n0tph.js";
25
25
  import {
26
26
  prepareProjectLocation,
27
27
  tryRegisterProjectInParentSolution
28
- } from "./packager-tool-z8ryp7pb.js";
28
+ } from "./packager-tool-jd8cfevc.js";
29
29
  import {
30
30
  JobAttachmentUploadError
31
- } from "./packager-tool-xxd71jja.js";
31
+ } from "./packager-tool-607v4t05.js";
32
32
  import {
33
33
  getAuthContext,
34
34
  getLoginStatusAsync,
35
35
  parseJWT
36
- } from "./packager-tool-h4ymyb9t.js";
36
+ } from "./packager-tool-vwsq85y7.js";
37
37
  import {
38
38
  ATTACHMENT_UPLOAD_INSTRUCTIONS,
39
39
  OutputFormatter,
@@ -44,13 +44,15 @@ import {
44
44
  extractErrorDetails,
45
45
  extractErrorMessage,
46
46
  extractErrorMessageSync,
47
- getFileSystem,
48
47
  getSdkUserAgentToken,
49
48
  installSdkUserAgentHeader,
50
49
  logger,
51
50
  parseBoundedInt,
52
51
  processContext
53
- } from "./packager-tool-2tf3hrem.js";
52
+ } from "./packager-tool-fza8z686.js";
53
+ import {
54
+ getFileSystem
55
+ } from "./packager-tool-je2re4j6.js";
54
56
  import {
55
57
  currentAgentStorageSchema,
56
58
  currentEvaluationSetStorageSchema,
@@ -7010,7 +7012,7 @@ var package_default = {
7010
7012
  name: "@uipath/agent-tool",
7011
7013
  author: "UiPath",
7012
7014
  license: "SEE LICENSE IN LICENSE.txt",
7013
- version: "1.204.0",
7015
+ version: "1.205.0-preview.258",
7014
7016
  description: "cli plugin for creating and managing UiPath low-code agents",
7015
7017
  private: false,
7016
7018
  repository: {
@@ -7175,7 +7177,7 @@ var registerDebugCommand = (program) => {
7175
7177
  Result: RESULTS.Failure,
7176
7178
  ErrorCode: details.errorCode,
7177
7179
  Message: error.message,
7178
- Instructions: `${ATTACHMENT_UPLOAD_INSTRUCTIONS}${scopeHint} The solution was uploaded to Studio Web and no debug job was started. Attachments this run had already uploaded were deleted where possible; any that could not be removed are named in Message or in the log (UIP_LOG_LEVEL=warn).`,
7180
+ Instructions: `${ATTACHMENT_UPLOAD_INSTRUCTIONS}${scopeHint} The solution was uploaded to Studio Web and no debug job was started. Attachments this run had already uploaded are left on the tenant for Orchestrator's retention to reclaim; their IDs are named in Message or in the log (UIP_LOG_LEVEL=warn).`,
7179
7181
  Retry: details.retry,
7180
7182
  ...details.context ? { Context: details.context } : {}
7181
7183
  });
@@ -7538,7 +7540,7 @@ var package_default2 = {
7538
7540
  name: "@uipath/agent-sdk",
7539
7541
  author: "UiPath",
7540
7542
  license: "SEE LICENSE IN LICENSE.txt",
7541
- version: "1.204.0",
7543
+ version: "1.205.0-preview.258",
7542
7544
  description: "SDK for the UiPath Agent Runtime API — evaluation execution and debug sessions.",
7543
7545
  repository: {
7544
7546
  type: "git",
@@ -9546,7 +9548,7 @@ var registerEvalRunCommands = (evalCmd) => {
9546
9548
  processContext.exit(1);
9547
9549
  }
9548
9550
  });
9549
- runCmd.command("status").description("Check the status of an evaluation run").argument("<evalSetRunId>", "Evaluation set run ID").requiredOption("--set <name>", "Evaluation set name or ID").option("--path <path>", "Path to agent project directory", ".").examples(EVAL_RUN_STATUS_EXAMPLES).trackedAction(processContext, async (evalSetRunId, options) => {
9551
+ runCmd.command("status").description("Check the status of an evaluation run").argument("<eval-set-run-id>", "Evaluation set run ID").requiredOption("--set <name>", "Evaluation set name or ID").option("--path <path>", "Path to agent project directory", ".").examples(EVAL_RUN_STATUS_EXAMPLES).trackedAction(processContext, async (evalSetRunId, options) => {
9550
9552
  const [error] = await catchError((async () => {
9551
9553
  const api = await createApiClient(EvalsTenantExecutionApi);
9552
9554
  const projectService = new AgentProjectService;
@@ -9590,7 +9592,7 @@ var registerEvalRunCommands = (evalCmd) => {
9590
9592
  processContext.exit(1);
9591
9593
  }
9592
9594
  });
9593
- runCmd.command("results").description("Get detailed results for an evaluation run").argument("<evalSetRunId>", "Evaluation set run ID").requiredOption("--set <name>", "Evaluation set name or ID").option("--path <path>", "Path to agent project directory", ".").option("--only-failed", "Show only failed or errored test cases").option("--verbose", "Include evaluator justifications in output").option("--export-format <json|csv>", "Export results to file (json or csv)").examples(EVAL_RUN_RESULTS_EXAMPLES).trackedAction(processContext, async (evalSetRunId, options) => {
9595
+ runCmd.command("results").description("Get detailed results for an evaluation run").argument("<eval-set-run-id>", "Evaluation set run ID").requiredOption("--set <name>", "Evaluation set name or ID").option("--path <path>", "Path to agent project directory", ".").option("--only-failed", "Show only failed or errored test cases").option("--verbose", "Include evaluator justifications in output").option("--export-format <json|csv>", "Export results to file (json or csv)").examples(EVAL_RUN_RESULTS_EXAMPLES).trackedAction(processContext, async (evalSetRunId, options) => {
9594
9596
  const [error] = await catchError((async () => {
9595
9597
  const api = await createApiClient(EvalsTenantExecutionApi);
9596
9598
  const projectService = new AgentProjectService;
@@ -9734,7 +9736,7 @@ var registerEvalRunCommands = (evalCmd) => {
9734
9736
  processContext.exit(1);
9735
9737
  }
9736
9738
  });
9737
- runCmd.command("compare").description("Compare results of two evaluation runs side by side").argument("<evalSetRunId>", "First evaluation set run ID").requiredOption("--compare-to <id>", "Second evaluation set run ID to compare against").requiredOption("--set <name>", "Evaluation set name or ID").option("--path <path>", "Path to agent project directory", ".").examples(EVAL_RUN_COMPARE_EXAMPLES).trackedAction(processContext, async (evalSetRunId, options) => {
9739
+ runCmd.command("compare").description("Compare results of two evaluation runs side by side").argument("<eval-set-run-id>", "First evaluation set run ID").requiredOption("--compare-to <id>", "Second evaluation set run ID to compare against").requiredOption("--set <name>", "Evaluation set name or ID").option("--path <path>", "Path to agent project directory", ".").examples(EVAL_RUN_COMPARE_EXAMPLES).trackedAction(processContext, async (evalSetRunId, options) => {
9738
9740
  const [error] = await catchError((async () => {
9739
9741
  const api = await createApiClient(EvalsTenantExecutionApi);
9740
9742
  const projectService = new AgentProjectService;
@@ -10696,7 +10698,7 @@ var registerGuardrailCommands = (program) => {
10696
10698
 
10697
10699
  // src/services/project-artifacts.ts
10698
10700
  async function ensureProjectArtifacts(args) {
10699
- const { addProjectArtifactsToSolutionAsync } = await import("./index-6dvnvfjv.js");
10701
+ const { addProjectArtifactsToSolutionAsync } = await import("./index-ar269vgy.js");
10700
10702
  return addProjectArtifactsToSolutionAsync(args);
10701
10703
  }
10702
10704
 
@@ -11197,7 +11199,7 @@ var SOLUTION_FOLDER = "solution_folder";
11197
11199
  // src/services/memory-space-solution-link.ts
11198
11200
  async function findEnclosingSolutionFile(projectPath) {
11199
11201
  const fs = getFileSystem();
11200
- const { findSolutionFileUpward } = await import("./index-wdwv17hz.js");
11202
+ const { findSolutionFileUpward } = await import("./index-3acyr1r7.js");
11201
11203
  const [error, solutionFile] = await catchError(findSolutionFileUpward(fs, fs.path.resolve(projectPath)));
11202
11204
  if (error) {
11203
11205
  if (error.message.startsWith("No .uipx solution file found")) {
@@ -11247,7 +11249,7 @@ async function activeTenantId() {
11247
11249
  return status.tenantId ?? undefined;
11248
11250
  }
11249
11251
  async function openSolution(solutionDir) {
11250
- const engine = await import("./index-6dvnvfjv.js");
11252
+ const engine = await import("./index-ar269vgy.js");
11251
11253
  const services = await engine.createResourceBuilderServices();
11252
11254
  await engine.normalizeResourceFileCasing(solutionDir);
11253
11255
  const builder = await services.getSolutionBuilder(solutionDir);
@@ -11757,7 +11759,7 @@ async function resolveRuntimeTarget(memoryName, options) {
11757
11759
  if (options.folderKey === undefined && folderPath.toLowerCase() === SOLUTION_FOLDER) {
11758
11760
  throw new Error(`Feature "${feature.name}" points at ${SOLUTION_FOLDER}, the placeholder the deploy replaces with the deployment folder. Pass --folder-path <deployed folder path> or --folder-key <key> for the folder the solution is deployed to ('uip solution deploy list' shows it).`);
11759
11761
  }
11760
- const { findRuntimeMemorySpace, resolveRuntimeFolder } = await import("./memory-runtime-service-x1ndz84n.js");
11762
+ const { findRuntimeMemorySpace, resolveRuntimeFolder } = await import("./memory-runtime-service-h9wdsd31.js");
11761
11763
  const folder = await resolveRuntimeFolder(options.folderKey !== undefined ? { folderKey: options.folderKey } : { folderPath });
11762
11764
  if (folder === undefined) {
11763
11765
  throw new Error("Memory items are not available in this build; use the uip CLI.");
@@ -11898,7 +11900,7 @@ var registerMemoryCommands = (program) => {
11898
11900
  const memoryType = parseMemoryType(options.memoryType);
11899
11901
  const request = buildItemRequest(memoryType, options);
11900
11902
  const target = await resolveRuntimeTarget(memoryName, options);
11901
- const { addRuntimeMemoryItem } = await import("./memory-runtime-service-x1ndz84n.js");
11903
+ const { addRuntimeMemoryItem } = await import("./memory-runtime-service-h9wdsd31.js");
11902
11904
  const item = await addRuntimeMemoryItem(target.space.id, target.folder.key, request);
11903
11905
  OutputFormatter.success({
11904
11906
  Result: RESULTS.Success,
@@ -11931,7 +11933,7 @@ var registerMemoryCommands = (program) => {
11931
11933
  const [error] = await catchError((async () => {
11932
11934
  const memoryType = options.memoryType === undefined ? undefined : parseMemoryType(options.memoryType);
11933
11935
  const target = await resolveRuntimeTarget(memoryName, options);
11934
- const { listRuntimeMemoryItems } = await import("./memory-runtime-service-x1ndz84n.js");
11936
+ const { listRuntimeMemoryItems } = await import("./memory-runtime-service-h9wdsd31.js");
11935
11937
  const items = await listRuntimeMemoryItems(target.space.id, target.folder.key, memoryType);
11936
11938
  OutputFormatter.success({
11937
11939
  Result: RESULTS.Success,
@@ -31386,7 +31388,7 @@ var package_default3 = {
31386
31388
  name: "@uipath/integrationservice-sdk",
31387
31389
  author: "UiPath",
31388
31390
  license: "SEE LICENSE IN LICENSE.txt",
31389
- version: "1.204.0",
31391
+ version: "1.205.0-preview.258",
31390
31392
  repository: {
31391
31393
  type: "git",
31392
31394
  url: "https://github.com/UiPath/cli.git",
@@ -31422,12 +31424,13 @@ var package_default3 = {
31422
31424
  devDependencies: {
31423
31425
  "@uipath/auth": "workspace:*",
31424
31426
  "@uipath/common": "workspace:*",
31427
+ "@uipath/solution-sdk": "workspace:*",
31425
31428
  "@openapitools/openapi-generator-cli": "^2.31.1",
31426
31429
  "@types/node": "^25.5.2",
31427
31430
  typescript: "^7.0.2"
31428
31431
  },
31429
31432
  dependencies: {
31430
- "@uipath/integration-service-design-time": "1.41.2"
31433
+ "@uipath/integration-service-design-time": "2.10.0"
31431
31434
  }
31432
31435
  };
31433
31436
 
@@ -41679,4 +41682,4 @@ var registerCommands = async (program) => {
41679
41682
 
41680
41683
  export { metadata, registerCommands };
41681
41684
 
41682
- //# debugId=58EBBD12706723F264756E2164756E21
41685
+ //# debugId=EE1EA9FE19B72B2F64756E2164756E21