@uipath/agent-tool 1.202.0-preview.159 → 1.203.0-preview.160

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.
@@ -13,7 +13,7 @@ import {
13
13
  isSolutionUploadHttpError,
14
14
  migrateLegacyToolGuardrailPolicies,
15
15
  resolveStudioWebConfig
16
- } from "./packager-tool-1p2be2cq.js";
16
+ } from "./packager-tool-abj3ftf8.js";
17
17
  import {
18
18
  OutputFormatter,
19
19
  RESULTS,
@@ -27,10 +27,11 @@ import {
27
27
  getSdkUserAgentToken,
28
28
  installSdkUserAgentHeader,
29
29
  logger,
30
+ parseBoundedInt,
30
31
  prepareProjectLocation,
31
32
  processContext,
32
33
  tryRegisterProjectInParentSolution
33
- } from "./packager-tool-r46ma7qq.js";
34
+ } from "./packager-tool-tnz82jk0.js";
34
35
  import {
35
36
  currentAgentStorageSchema,
36
37
  currentEvaluationSetStorageSchema,
@@ -6987,8 +6988,9 @@ var require_index_cjs = __commonJS(function(exports, module) {
6987
6988
  // package.json
6988
6989
  var package_default = {
6989
6990
  name: "@uipath/agent-tool",
6991
+ author: "UiPath",
6990
6992
  license: "SEE LICENSE IN LICENSE.txt",
6991
- version: "1.202.0-preview.159",
6993
+ version: "1.203.0-preview.160",
6992
6994
  description: "cli plugin for creating and managing UiPath low-code agents",
6993
6995
  private: false,
6994
6996
  repository: {
@@ -7039,8 +7041,8 @@ var package_default = {
7039
7041
  "@uipath/solution-sdk": "workspace:*",
7040
7042
  "@uipath/solutionpackager-tool-core": "workspace:*",
7041
7043
  "@uipath/tool-agent": "^2.0.0",
7042
- "adm-zip": "^0.6.0",
7043
7044
  commander: "^14.0.3",
7045
+ fflate: "^0.8.2",
7044
7046
  typescript: "^7.0.2"
7045
7047
  }
7046
7048
  };
@@ -7430,8 +7432,9 @@ class VoidApiResponse {
7430
7432
  // ../agent-sdk/package.json
7431
7433
  var package_default2 = {
7432
7434
  name: "@uipath/agent-sdk",
7435
+ author: "UiPath",
7433
7436
  license: "SEE LICENSE IN LICENSE.txt",
7434
- version: "1.202.0-preview.159",
7437
+ version: "1.203.0-preview.160",
7435
7438
  description: "SDK for the UiPath Agent Runtime API — evaluation execution and debug sessions.",
7436
7439
  repository: {
7437
7440
  type: "git",
@@ -11801,16 +11804,7 @@ var resolveEnvFilePathAsync = async (envFilePath = DEFAULT_ENV_FILENAME, opts) =
11801
11804
  errorMessage: location.source === "absolute" ? `Environment file not found: ${envFilePath}` : `Unable to locate environment file: ${envFilePath}. Run 'uip login' to authenticate.`
11802
11805
  };
11803
11806
  };
11804
- var loadEnvFileAsync = async ({ envPath }) => {
11805
- const fs7 = getFileSystem2();
11806
- const absolutePath = fs7.path.isAbsolute(envPath) ? envPath : fs7.path.join(fs7.env.cwd(), envPath);
11807
- if (!await fs7.exists(absolutePath)) {
11808
- throw new Error(`Environment file not found: ${envPath}`);
11809
- }
11810
- const content = await fs7.readFile(absolutePath, "utf-8");
11811
- if (content === null) {
11812
- throw new Error(`Environment file not found: ${envPath}`);
11813
- }
11807
+ var parseEnvContent = (content) => {
11814
11808
  const env = {};
11815
11809
  for (const line of content.split(`
11816
11810
  `)) {
@@ -11831,6 +11825,18 @@ var loadEnvFileAsync = async ({ envPath }) => {
11831
11825
  }
11832
11826
  return env;
11833
11827
  };
11828
+ var loadEnvFileAsync = async ({ envPath }) => {
11829
+ const fs7 = getFileSystem2();
11830
+ const absolutePath = fs7.path.isAbsolute(envPath) ? envPath : fs7.path.join(fs7.env.cwd(), envPath);
11831
+ if (!await fs7.exists(absolutePath)) {
11832
+ throw new Error(`Environment file not found: ${envPath}`);
11833
+ }
11834
+ const content = await fs7.readFile(absolutePath, "utf-8");
11835
+ if (content === null) {
11836
+ throw new Error(`Environment file not found: ${envPath}`);
11837
+ }
11838
+ return parseEnvContent(content);
11839
+ };
11834
11840
  var saveEnvFileAsync = async ({
11835
11841
  envPath,
11836
11842
  data,
@@ -12337,6 +12343,7 @@ function normalizeTokenRefreshUnavailableFailure() {
12337
12343
  function errorMessage(error) {
12338
12344
  return error instanceof Error ? error.message : String(error);
12339
12345
  }
12346
+ init_src();
12340
12347
  init_constants();
12341
12348
  init_src();
12342
12349
  init_constants();
@@ -12792,7 +12799,7 @@ var registerGuardrailCommands = (program) => {
12792
12799
 
12793
12800
  // src/services/project-artifacts.ts
12794
12801
  async function ensureProjectArtifacts(args) {
12795
- const { addProjectArtifactsToSolutionAsync } = await import("./index-jkdwsj5d.js");
12802
+ const { addProjectArtifactsToSolutionAsync } = await import("./index-s1mvhfbj.js");
12796
12803
  return addProjectArtifactsToSolutionAsync(args);
12797
12804
  }
12798
12805
 
@@ -33283,8 +33290,9 @@ class TextApiResponse {
33283
33290
  // ../integrationservice-sdk/package.json
33284
33291
  var package_default3 = {
33285
33292
  name: "@uipath/integrationservice-sdk",
33293
+ author: "UiPath",
33286
33294
  license: "SEE LICENSE IN LICENSE.txt",
33287
- version: "1.202.0-preview.159",
33295
+ version: "1.203.0-preview.160",
33288
33296
  repository: {
33289
33297
  type: "git",
33290
33298
  url: "https://github.com/UiPath/cli.git",
@@ -41105,6 +41113,21 @@ var KNOWN_CATEGORIES = [
41105
41113
  "code",
41106
41114
  "general"
41107
41115
  ];
41116
+ var GRADES = [
41117
+ "A+",
41118
+ "A",
41119
+ "A-",
41120
+ "B+",
41121
+ "B",
41122
+ "B-",
41123
+ "C+",
41124
+ "C",
41125
+ "C-",
41126
+ "D+",
41127
+ "D",
41128
+ "D-",
41129
+ "F"
41130
+ ];
41108
41131
  function listCategories() {
41109
41132
  return [...KNOWN_CATEGORIES];
41110
41133
  }
@@ -42959,6 +42982,116 @@ function buildInvalidAgentJsonIssue(loaded) {
42959
42982
  suggestedFix: "Verify agent.json exists and is valid, properly encoded JSON."
42960
42983
  };
42961
42984
  }
42985
+ var REVIEW_HISTORY_FILE = "review-history.json";
42986
+ var MAX_REVIEW_HISTORY_ENTRIES = 25;
42987
+ var isGrade = (value) => typeof value === "string" && GRADES.includes(value);
42988
+ var validateEntry = (entry, index) => {
42989
+ if (typeof entry !== "object" || entry === null) {
42990
+ return `[${index}]: expected an object`;
42991
+ }
42992
+ const { grade, runAt, errors: errors3, warnings } = entry;
42993
+ if (!isGrade(grade)) {
42994
+ return `[${index}].grade: expected one of ${GRADES.join(", ")}`;
42995
+ }
42996
+ if (typeof runAt !== "string") {
42997
+ return `[${index}].runAt: expected a string`;
42998
+ }
42999
+ for (const [name, count] of [
43000
+ ["errors", errors3],
43001
+ ["warnings", warnings]
43002
+ ]) {
43003
+ if (count !== undefined && typeof count !== "number") {
43004
+ return `[${index}].${name}: expected a number`;
43005
+ }
43006
+ }
43007
+ return;
43008
+ };
43009
+ var parseHistory = (raw) => {
43010
+ let parsed;
43011
+ try {
43012
+ parsed = JSON.parse(raw);
43013
+ } catch (err2) {
43014
+ const message = err2 instanceof Error ? err2.message : String(err2);
43015
+ return { success: false, error: `invalid JSON: ${message}` };
43016
+ }
43017
+ if (!Array.isArray(parsed)) {
43018
+ return { success: false, error: "expected a JSON array of entries" };
43019
+ }
43020
+ for (const [index, entry] of parsed.entries()) {
43021
+ const error51 = validateEntry(entry, index);
43022
+ if (error51 !== undefined) {
43023
+ return { success: false, error: error51 };
43024
+ }
43025
+ }
43026
+ return { success: true, data: parsed };
43027
+ };
43028
+ var parseRunAt = (entry) => {
43029
+ const time3 = Date.parse(entry.runAt);
43030
+ return Number.isNaN(time3) ? Number.NEGATIVE_INFINITY : time3;
43031
+ };
43032
+ var writeAtomically = async (file2, content, fs7) => {
43033
+ const tempFile = `${file2}.${globalThis.crypto.randomUUID()}.tmp`;
43034
+ try {
43035
+ await fs7.writeFile(tempFile, content);
43036
+ await fs7.rename(tempFile, file2);
43037
+ } catch (err2) {
43038
+ await fs7.rm(tempFile).catch(() => {
43039
+ return;
43040
+ });
43041
+ throw err2;
43042
+ }
43043
+ };
43044
+ var appendEntry = async (file2, grade, input, fs7) => {
43045
+ let history = [];
43046
+ const raw = await fs7.readFile(file2, "utf-8");
43047
+ if (raw !== null) {
43048
+ const parsed = parseHistory(raw);
43049
+ if (!parsed.success) {
43050
+ return {
43051
+ ok: false,
43052
+ error: "MALFORMED_HISTORY",
43053
+ file: file2,
43054
+ detail: parsed.error
43055
+ };
43056
+ }
43057
+ history = parsed.data;
43058
+ }
43059
+ const entry = {
43060
+ grade,
43061
+ runAt: new Date().toISOString(),
43062
+ ...input.errors !== undefined && { errors: input.errors },
43063
+ ...input.warnings !== undefined && { warnings: input.warnings }
43064
+ };
43065
+ const newTime = Date.parse(entry.runAt);
43066
+ let index = 0;
43067
+ while (index < history.length && parseRunAt(history[index]) > newTime) {
43068
+ index++;
43069
+ }
43070
+ history.splice(index, 0, entry);
43071
+ if (history.length > MAX_REVIEW_HISTORY_ENTRIES) {
43072
+ history.length = MAX_REVIEW_HISTORY_ENTRIES;
43073
+ }
43074
+ await writeAtomically(file2, `${JSON.stringify(history, null, 2)}
43075
+ `, fs7);
43076
+ return { ok: true, entry, history };
43077
+ };
43078
+ var recordReview = async (projectPath, input, fs7) => {
43079
+ const grade = input.grade.toUpperCase();
43080
+ if (!isGrade(grade)) {
43081
+ return { ok: false, error: "INVALID_GRADE", allowed: GRADES };
43082
+ }
43083
+ const stats = await fs7.stat(projectPath);
43084
+ if (!stats?.isDirectory()) {
43085
+ return { ok: false, error: "NOT_A_DIRECTORY", projectPath };
43086
+ }
43087
+ const file2 = fs7.path.join(projectPath, REVIEW_HISTORY_FILE);
43088
+ const release = await fs7.acquireLock(file2);
43089
+ try {
43090
+ return await appendEntry(file2, grade, input, fs7);
43091
+ } finally {
43092
+ await release();
43093
+ }
43094
+ };
42962
43095
 
42963
43096
  // src/services/guardrail-catalog-service.ts
42964
43097
  var LLM_AS_JUDGE_VALIDATOR = "llm_as_judge";
@@ -43145,6 +43278,122 @@ var registerReviewCommand = (program) => {
43145
43278
  });
43146
43279
  };
43147
43280
 
43281
+ // src/commands/review-history.ts
43282
+ var CODES2 = {
43283
+ success: "AgentReviewHistoryAdd",
43284
+ invalidGrade: "AgentReviewHistoryAddInvalidGrade",
43285
+ invalidPath: "AgentReviewHistoryAddInvalidPath",
43286
+ malformedHistory: "AgentReviewHistoryAddMalformedHistory",
43287
+ failed: "AgentReviewHistoryAddFailed"
43288
+ };
43289
+ var ADD_EXAMPLES = [
43290
+ {
43291
+ Description: "Record a review grade for a project at a specific path",
43292
+ Command: "uip agent review-history add B ./my-agent",
43293
+ Output: {
43294
+ Code: CODES2.success,
43295
+ Data: {
43296
+ ProjectDir: "./my-agent",
43297
+ Grade: "B",
43298
+ RunAt: "2026-09-02T10:00:00.000Z",
43299
+ HistoryCount: 1
43300
+ }
43301
+ }
43302
+ },
43303
+ {
43304
+ Description: "Record a grade with finding counts",
43305
+ Command: "uip agent review-history add C --errors 2 --warnings 5",
43306
+ Output: {
43307
+ Code: CODES2.success,
43308
+ Data: {
43309
+ ProjectDir: ".",
43310
+ Grade: "C",
43311
+ RunAt: "2026-09-02T10:00:00.000Z",
43312
+ Errors: 2,
43313
+ Warnings: 5,
43314
+ HistoryCount: 3
43315
+ }
43316
+ }
43317
+ }
43318
+ ];
43319
+ var COUNT_BOUNDS = { min: 0, max: Number.MAX_SAFE_INTEGER };
43320
+ var parseCount = (flag) => (raw) => parseBoundedInt(raw, flag, COUNT_BOUNDS);
43321
+ var reportFailure = (rawGrade, outcome) => {
43322
+ switch (outcome.error) {
43323
+ case "INVALID_GRADE":
43324
+ OutputFormatter.error({
43325
+ Result: RESULTS.Failure,
43326
+ Code: CODES2.invalidGrade,
43327
+ ErrorCode: "invalid_argument",
43328
+ Message: `\`${rawGrade}\` is not a recordable grade.`,
43329
+ Instructions: `Pass one of: ${outcome.allowed.join(", ")}.`
43330
+ });
43331
+ return;
43332
+ case "NOT_A_DIRECTORY":
43333
+ OutputFormatter.error({
43334
+ Result: RESULTS.Failure,
43335
+ Code: CODES2.invalidPath,
43336
+ ErrorCode: "invalid_argument",
43337
+ Message: `\`${outcome.projectPath}\` is not an existing directory.`,
43338
+ Instructions: "Pass the agent project directory as [path], or run from inside it."
43339
+ });
43340
+ return;
43341
+ case "MALFORMED_HISTORY":
43342
+ OutputFormatter.error({
43343
+ Result: RESULTS.Failure,
43344
+ Code: CODES2.malformedHistory,
43345
+ ErrorCode: "configuration_error",
43346
+ Message: `\`${outcome.file}\` exists but is not a JSON array of review entries: ${outcome.detail}`,
43347
+ Instructions: "Fix the file so it parses as a JSON array, or delete it to start a fresh history, then rerun."
43348
+ });
43349
+ return;
43350
+ }
43351
+ };
43352
+ var registerReviewHistoryCommands = (program) => {
43353
+ const reviewHistory = program.command("review-history").description(`Manage the review grades recorded in the project's ${REVIEW_HISTORY_FILE}`);
43354
+ reviewHistory.command("add").description(`Record a review grade in the project's ${REVIEW_HISTORY_FILE}. ` + `Keeps the newest ${MAX_REVIEW_HISTORY_ENTRIES} entries, most recent first. Does not run the review.`).argument("<grade>", "Letter grade to record (A to F)").argument("[path]", "Agent project directory", ".").option("--errors <count>", "Number of error findings to record", parseCount("--errors")).option("--warnings <count>", "Number of warning findings to record", parseCount("--warnings")).examples(ADD_EXAMPLES).trackedAction(processContext, async (grade, targetPath, options) => {
43355
+ const fs7 = getFileSystem();
43356
+ const projectPath = fs7.path.resolve(targetPath);
43357
+ const [err2, outcome] = await catchError(recordReview(projectPath, {
43358
+ grade,
43359
+ errors: options.errors,
43360
+ warnings: options.warnings
43361
+ }, fs7));
43362
+ if (err2) {
43363
+ OutputFormatter.error({
43364
+ Result: RESULTS.Failure,
43365
+ Code: CODES2.failed,
43366
+ Message: `Recording the review failed: ${extractErrorMessageSync(err2)}`,
43367
+ Instructions: "Verify the project directory is writable. " + "Run `uip agent review-history add --help` for usage."
43368
+ });
43369
+ processContext.exit(1);
43370
+ return;
43371
+ }
43372
+ if (!outcome.ok) {
43373
+ reportFailure(grade, outcome);
43374
+ processContext.exit(1);
43375
+ return;
43376
+ }
43377
+ const { entry, history } = outcome;
43378
+ OutputFormatter.success({
43379
+ Result: RESULTS.Success,
43380
+ Code: CODES2.success,
43381
+ Data: {
43382
+ ProjectDir: projectPath,
43383
+ Grade: entry.grade,
43384
+ RunAt: entry.runAt,
43385
+ ...entry.errors !== undefined && {
43386
+ Errors: entry.errors
43387
+ },
43388
+ ...entry.warnings !== undefined && {
43389
+ Warnings: entry.warnings
43390
+ },
43391
+ HistoryCount: history.length
43392
+ }
43393
+ });
43394
+ });
43395
+ };
43396
+
43148
43397
  // src/commands/tool-list.ts
43149
43398
  var TOOL_LIST_EXAMPLES = [
43150
43399
  {
@@ -43211,6 +43460,7 @@ var registerCommands = async (program) => {
43211
43460
  registerValidateCommand(program);
43212
43461
  registerRefreshCommand(program);
43213
43462
  registerReviewCommand(program);
43463
+ registerReviewHistoryCommands(program);
43214
43464
  registerToolListCommand(program);
43215
43465
  registerMemoryCommands(program);
43216
43466
  registerEvalCommands(program);
@@ -43221,4 +43471,4 @@ var registerCommands = async (program) => {
43221
43471
 
43222
43472
  export { metadata, registerCommands };
43223
43473
 
43224
- //# debugId=325616C87483A8F964756E2164756E21
43474
+ //# debugId=8377E5091839BBF564756E2164756E21