@uipath/agent-tool 1.202.0 → 1.202.1-preview.168

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.
Files changed (27) hide show
  1. package/dist/THIRD-PARTY-NOTICES.md +53 -7
  2. package/dist/{agent-tool-OK5DK57D-zkbmhnmd.js → agent-tool-OK5DK57D-rjan4r3q.js} +2 -2
  3. package/dist/{de-5KVP66U6-1bnf4zt5.js → de-MUJPA4EB-209jpeqe.js} +14 -2
  4. package/dist/{en-X3S6IZ5J-nhkg6pwn.js → en-GN2ZGWUE-03z2df4k.js} +26 -2
  5. package/dist/{es-VFPNVMP5-bx2c337j.js → es-7SE7HX2X-qda7whn6.js} +14 -2
  6. package/dist/{es-MX-XAVLOQW3-q00km2y7.js → es-MX-2MYFZU7X-6v0q5rbn.js} +14 -2
  7. package/dist/executor-tool.js +2 -2
  8. package/dist/{fr-E5MDO4EG-c3mkty2t.js → fr-MDFKNZ4C-qmypp92m.js} +14 -2
  9. package/dist/{index-4vpac2gy.js → index-g54778e4.js} +1 -1
  10. package/dist/index.js +5 -5
  11. package/dist/{ja-DPO5PPLO-mysfmznx.js → ja-UTQEAP34-hvyf683h.js} +14 -2
  12. package/dist/{ko-ITOPNIYI-hmxd2asd.js → ko-AXCHW2OK-pkwdcbmx.js} +14 -2
  13. package/dist/{packager-tool-a42jnpy5.js → packager-tool-4mna26cc.js} +27 -3
  14. package/dist/{packager-tool-kpf6eryr.js → packager-tool-6kkp5bq2.js} +3 -3
  15. package/dist/{packager-tool-p1yrrbpt.js → packager-tool-b20zvjv7.js} +18 -2
  16. package/dist/{packager-tool-pst3whq5.js → packager-tool-byvnxap3.js} +1 -1
  17. package/dist/{packager-tool-0srzfhdr.js → packager-tool-mc1499dc.js} +2 -2
  18. package/dist/{packager-tool-wmd0pbnz.js → packager-tool-pv87pnq1.js} +448 -2206
  19. package/dist/packager-tool.js +3 -3
  20. package/dist/{pt-YI4VE4YQ-wdkn2dcf.js → pt-3DIO5QWG-hb763vct.js} +14 -2
  21. package/dist/{pt-BR-BXURWX4W-bwfcwhk1.js → pt-BR-Y6K6XHXK-37a932vp.js} +14 -2
  22. package/dist/{ro-RKXZUG7Z-nndrrsq7.js → ro-BWR3ONRR-jmap5ajd.js} +14 -2
  23. package/dist/tool.js +5 -5
  24. package/dist/{tr-AA6O2WSR-86ba4bdf.js → tr-5IIHSFW5-stsb3dar.js} +14 -2
  25. package/dist/{zh-CN-R2KLHXQV-agqr45ds.js → zh-CN-R2KU4U5L-q4yhc33t.js} +14 -2
  26. package/dist/{zh-TW-RJGCQANM-w0x3qc1p.js → zh-TW-GNKMELBF-r4ay2475.js} +14 -2
  27. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  en_default
3
- } from "./packager-tool-a42jnpy5.js";
3
+ } from "./packager-tool-4mna26cc.js";
4
4
  import {
5
5
  __glob
6
6
  } from "./packager-tool-c23zrhj8.js";
@@ -13,7 +13,7 @@ import {
13
13
  isSolutionUploadHttpError,
14
14
  migrateLegacyToolGuardrailPolicies,
15
15
  resolveStudioWebConfig
16
- } from "./packager-tool-kpf6eryr.js";
16
+ } from "./packager-tool-6kkp5bq2.js";
17
17
  import {
18
18
  OutputFormatter,
19
19
  RESULTS,
@@ -27,21 +27,21 @@ 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-p1yrrbpt.js";
34
+ } from "./packager-tool-b20zvjv7.js";
34
35
  import {
35
36
  currentAgentStorageSchema,
36
37
  currentEvaluationSetStorageSchema,
37
38
  currentFeatureStorageSchema,
38
39
  currentResourceStorageSchema,
39
40
  currentStorageSchema,
40
- currentStorageSchemaMigration,
41
41
  generateBindings,
42
42
  getLatestVersion,
43
43
  migrations
44
- } from "./packager-tool-0srzfhdr.js";
44
+ } from "./packager-tool-mc1499dc.js";
45
45
  import {
46
46
  __commonJS,
47
47
  __export,
@@ -6989,7 +6989,7 @@ var require_index_cjs = __commonJS(function(exports, module) {
6989
6989
  var package_default = {
6990
6990
  name: "@uipath/agent-tool",
6991
6991
  license: "SEE LICENSE IN LICENSE.txt",
6992
- version: "1.202.0",
6992
+ version: "1.202.1-preview.168",
6993
6993
  description: "cli plugin for creating and managing UiPath low-code agents",
6994
6994
  private: false,
6995
6995
  repository: {
@@ -7032,7 +7032,7 @@ var package_default = {
7032
7032
  "@uipath/auth": "workspace:*",
7033
7033
  "@uipath/common": "workspace:*",
7034
7034
  "@uipath/filesystem": "workspace:*",
7035
- "@uipath/flow-schema": "0.57.4-develop",
7035
+ "@uipath/flow-schema": "0.68.0",
7036
7036
  "@uipath/integrationservice-sdk": "workspace:*",
7037
7037
  "@uipath/llmgw-sdk": "workspace:*",
7038
7038
  "@uipath/orchestrator-sdk": "workspace:*",
@@ -7432,7 +7432,7 @@ class VoidApiResponse {
7432
7432
  var package_default2 = {
7433
7433
  name: "@uipath/agent-sdk",
7434
7434
  license: "SEE LICENSE IN LICENSE.txt",
7435
- version: "1.202.0",
7435
+ version: "1.202.1-preview.168",
7436
7436
  description: "SDK for the UiPath Agent Runtime API — evaluation execution and debug sessions.",
7437
7437
  repository: {
7438
7438
  type: "git",
@@ -12793,7 +12793,7 @@ var registerGuardrailCommands = (program) => {
12793
12793
 
12794
12794
  // src/services/project-artifacts.ts
12795
12795
  async function ensureProjectArtifacts(args) {
12796
- const { addProjectArtifactsToSolutionAsync } = await import("./index-4vpac2gy.js");
12796
+ const { addProjectArtifactsToSolutionAsync } = await import("./index-g54778e4.js");
12797
12797
  return addProjectArtifactsToSolutionAsync(args);
12798
12798
  }
12799
12799
 
@@ -13926,7 +13926,7 @@ var registerModelCommands = (program) => {
13926
13926
  });
13927
13927
  };
13928
13928
 
13929
- // ../../node_modules/@uipath/flow-schema/dist/chunk-IUN2JAAB.js
13929
+ // ../../node_modules/@uipath/flow-schema/dist/chunk-4P5M5KWK.js
13930
13930
  var SUPPORTED_LOCALES = ["en", "es", "pt", "de", "fr", "ja", "ko", "ru", "tr", "ro", "zh-CN", "zh-TW", "pt-BR", "es-MX"];
13931
13931
  function normalizeCasing(locale) {
13932
13932
  const [language, country] = locale.split("-");
@@ -13977,20 +13977,20 @@ function createI18nRegistrar(options) {
13977
13977
  };
13978
13978
  }
13979
13979
  var globImport_locales_json = __glob({
13980
- "../../locales/de.json": () => import("./de-5KVP66U6-1bnf4zt5.js"),
13981
- "../../locales/en.json": () => import("./en-X3S6IZ5J-nhkg6pwn.js"),
13982
- "../../locales/es-MX.json": () => import("./es-MX-XAVLOQW3-q00km2y7.js"),
13983
- "../../locales/es.json": () => import("./es-VFPNVMP5-bx2c337j.js"),
13984
- "../../locales/fr.json": () => import("./fr-E5MDO4EG-c3mkty2t.js"),
13985
- "../../locales/ja.json": () => import("./ja-DPO5PPLO-mysfmznx.js"),
13986
- "../../locales/ko.json": () => import("./ko-ITOPNIYI-hmxd2asd.js"),
13987
- "../../locales/pt-BR.json": () => import("./pt-BR-BXURWX4W-bwfcwhk1.js"),
13988
- "../../locales/pt.json": () => import("./pt-YI4VE4YQ-wdkn2dcf.js"),
13989
- "../../locales/ro.json": () => import("./ro-RKXZUG7Z-nndrrsq7.js"),
13980
+ "../../locales/de.json": () => import("./de-MUJPA4EB-209jpeqe.js"),
13981
+ "../../locales/en.json": () => import("./en-GN2ZGWUE-03z2df4k.js"),
13982
+ "../../locales/es-MX.json": () => import("./es-MX-2MYFZU7X-6v0q5rbn.js"),
13983
+ "../../locales/es.json": () => import("./es-7SE7HX2X-qda7whn6.js"),
13984
+ "../../locales/fr.json": () => import("./fr-MDFKNZ4C-qmypp92m.js"),
13985
+ "../../locales/ja.json": () => import("./ja-UTQEAP34-hvyf683h.js"),
13986
+ "../../locales/ko.json": () => import("./ko-AXCHW2OK-pkwdcbmx.js"),
13987
+ "../../locales/pt-BR.json": () => import("./pt-BR-Y6K6XHXK-37a932vp.js"),
13988
+ "../../locales/pt.json": () => import("./pt-3DIO5QWG-hb763vct.js"),
13989
+ "../../locales/ro.json": () => import("./ro-BWR3ONRR-jmap5ajd.js"),
13990
13990
  "../../locales/ru.json": () => import("./ru-WBLQ5B2U-8r3c7v6d.js"),
13991
- "../../locales/tr.json": () => import("./tr-AA6O2WSR-86ba4bdf.js"),
13992
- "../../locales/zh-CN.json": () => import("./zh-CN-R2KLHXQV-agqr45ds.js"),
13993
- "../../locales/zh-TW.json": () => import("./zh-TW-RJGCQANM-w0x3qc1p.js")
13991
+ "../../locales/tr.json": () => import("./tr-5IIHSFW5-stsb3dar.js"),
13992
+ "../../locales/zh-CN.json": () => import("./zh-CN-R2KU4U5L-q4yhc33t.js"),
13993
+ "../../locales/zh-TW.json": () => import("./zh-TW-GNKMELBF-r4ay2475.js")
13994
13994
  });
13995
13995
  var VALIDATION_NAMESPACE = "validation";
13996
13996
  var registerFlowSchemaI18n = createI18nRegistrar({
@@ -28275,8 +28275,17 @@ function date4(params) {
28275
28275
 
28276
28276
  // ../../node_modules/zod/v4/classic/external.js
28277
28277
  config(en_default2());
28278
- // ../../node_modules/@uipath/flow-schema/dist/chunk-E6I5CCCH.js
28279
- var import_ajv = __toESM(require_ajv(), 1);
28278
+ // ../../node_modules/@uipath/flow-schema/dist/chunk-GWRTD4DY.js
28279
+ var expressionFieldTypeSchema = exports_external.enum(["string", "number", "boolean", "object", "array", "null"]);
28280
+ var expressionModeSchema = exports_external.enum(["literal", "jsExpression"]);
28281
+ var expressionValueSchema = exports_external.object({
28282
+ type: expressionModeSchema,
28283
+ expression: exports_external.string(),
28284
+ fieldType: expressionFieldTypeSchema
28285
+ }).strict();
28286
+ var expressionLikeSchema = exports_external.union([exports_external.string(), expressionValueSchema]);
28287
+
28288
+ // ../../node_modules/@uipath/flow-schema/dist/chunk-M4DXYS4M.js
28280
28289
  var import_ajv_errors = __toESM(require_dist(), 1);
28281
28290
 
28282
28291
  // ../../node_modules/i18next/dist/esm/i18next.js
@@ -31507,7 +31516,7 @@ var ternary = {
31507
31516
  };
31508
31517
  jsep.plugins.register(ternary);
31509
31518
 
31510
- // ../../node_modules/@uipath/flow-schema/dist/chunk-E6I5CCCH.js
31519
+ // ../../node_modules/@uipath/flow-schema/dist/chunk-M4DXYS4M.js
31511
31520
  var agentEnforcementsSchema = exports_external.object({
31512
31521
  maxTokens: exports_external.number().nullable(),
31513
31522
  maxTemperature: exports_external.number().nullable(),
@@ -31515,2104 +31524,224 @@ var agentEnforcementsSchema = exports_external.object({
31515
31524
  shouldEnforceHumanInTheLoop: exports_external.boolean().optional(),
31516
31525
  maxIterations: exports_external.number().nullable().optional()
31517
31526
  });
31518
- var JS_EXPRESSION_PREFIX = "=js:";
31519
- var expressionFieldTypeSchema = exports_external.enum(["string", "number", "boolean", "object", "array", "null"]);
31520
- var expressionModeSchema = exports_external.enum(["literal", "jsExpression"]);
31521
- var expressionValueSchema = exports_external.object({
31522
- type: expressionModeSchema,
31523
- expression: exports_external.string(),
31524
- fieldType: expressionFieldTypeSchema
31525
- }).strict();
31526
- var expressionLikeSchema = exports_external.union([exports_external.string(), expressionValueSchema]);
31527
- function isExpressionValue(v) {
31528
- return expressionValueSchema.safeParse(v).success;
31529
- }
31530
- function isEmptyExpressionValue(ev) {
31531
- return ev.expression.trim() === "";
31532
- }
31533
- function inferFieldType(value) {
31534
- if (Array.isArray(value))
31535
- return "array";
31536
- if (value === null)
31537
- return "null";
31538
- const t13 = typeof value;
31539
- if (t13 === "string" || t13 === "number" || t13 === "boolean" || t13 === "object")
31540
- return t13;
31541
- return "string";
31542
- }
31543
- function encodeLiteral(raw, fieldType) {
31544
- switch (fieldType) {
31545
- case "string":
31546
- if (typeof raw === "string")
31547
- return raw;
31548
- if (raw == null)
31549
- return "";
31550
- if (typeof raw === "object") {
31551
- try {
31552
- return JSON.stringify(raw);
31553
- } catch {
31554
- return String(raw);
31555
- }
31556
- }
31557
- return String(raw);
31558
- case "number":
31559
- case "boolean":
31560
- return raw == null ? "" : String(raw);
31561
- case "null":
31562
- return "null";
31563
- case "object":
31564
- case "array":
31565
- return JSON.stringify(raw ?? null);
31566
- }
31567
- }
31568
- function decodeLiteral(ev) {
31569
- if (ev.type === "jsExpression")
31570
- return ev.expression;
31571
- switch (ev.fieldType) {
31572
- case "string":
31573
- return ev.expression;
31574
- case "number":
31575
- return ev.expression === "" ? undefined : Number(ev.expression);
31576
- case "boolean":
31577
- return ev.expression === "" ? undefined : ev.expression === "true";
31578
- case "null":
31579
- return null;
31580
- case "object":
31581
- case "array":
31582
- if (ev.expression === "")
31583
- return;
31584
- try {
31585
- return JSON.parse(ev.expression);
31586
- } catch {
31587
- return;
31588
- }
31589
- }
31590
- }
31591
- function coerceToExpressionValue(value, fieldType) {
31592
- if (isExpressionValue(value))
31593
- return value;
31594
- const resolvedFieldType = fieldType ?? inferFieldType(value);
31595
- if (typeof value === "string") {
31596
- if (value.startsWith(JS_EXPRESSION_PREFIX)) {
31597
- return {
31598
- type: "jsExpression",
31599
- expression: value.slice(JS_EXPRESSION_PREFIX.length),
31600
- fieldType: resolvedFieldType
31601
- };
31602
- }
31603
- return { type: "literal", expression: value, fieldType: resolvedFieldType };
31604
- }
31605
- return { type: "literal", expression: encodeLiteral(value, resolvedFieldType), fieldType: resolvedFieldType };
31606
- }
31607
- function getJsExpressionBody(value) {
31608
- if (isExpressionValue(value)) {
31609
- return value.type === "jsExpression" ? value.expression : undefined;
31610
- }
31611
- if (typeof value === "string" && value.startsWith(JS_EXPRESSION_PREFIX)) {
31612
- return value.slice(JS_EXPRESSION_PREFIX.length);
31613
- }
31614
- return;
31615
- }
31616
- function hasMustacheInterpolation(s) {
31617
- const stripped = s.replace(/\\\{/g, "").replace(/\\\}/g, "");
31618
- return /\{\{[^{}]+\}\}/.test(stripped);
31619
- }
31620
31527
  var t2 = instance.getFixedT(null, VALIDATION_NAMESPACE);
31621
- function isExpression(value) {
31622
- if (isExpressionValue(value))
31623
- return value.type === "jsExpression";
31624
- return typeof value === "string" && value.startsWith(JS_EXPRESSION_PREFIX);
31625
- }
31626
- var VALUE_SOURCE_MODES = /* @__PURE__ */ new Set(["text-builder", "variable", "prompt"]);
31627
- function isValueSourceShape(value) {
31628
- if (typeof value !== "object" || value === null || Array.isArray(value))
31629
- return false;
31630
- const obj = value;
31631
- return VALUE_SOURCE_MODES.has(obj.mode) && (("textValue" in obj) || ("promptValue" in obj) || ("argumentPath" in obj));
31632
- }
31633
- function decodeLiteralForValidation(value) {
31634
- if (value === null || value === undefined)
31635
- return value;
31636
- if (isExpressionValue(value)) {
31637
- if (value.type === "jsExpression")
31638
- return value.expression === "" ? "" : value;
31639
- return decodeLiteral(value);
31640
- }
31641
- if (Array.isArray(value))
31642
- return value.map(decodeLiteralForValidation);
31643
- if (typeof value === "object") {
31644
- const out = {};
31645
- for (const [k, v] of Object.entries(value)) {
31646
- out[k] = decodeLiteralForValidation(v);
31647
- }
31648
- return out;
31649
- }
31650
- return value;
31651
- }
31652
- function decodeLiteralsForValidation(inputs) {
31653
- return decodeLiteralForValidation(inputs);
31654
- }
31655
- var ajvInstance;
31656
- function getAjv() {
31657
- if (!ajvInstance) {
31658
- ajvInstance = new import_ajv.default({ allErrors: true, strict: false });
31659
- import_ajv_errors.default(ajvInstance);
31660
- }
31661
- return ajvInstance;
31662
- }
31663
- var nodeValidatorCache = /* @__PURE__ */ new Map;
31664
- function isJsonSchema(def) {
31665
- return def.type === "object" && typeof def.properties === "object" && def.properties !== null;
31666
- }
31667
- function normalizeInputDefinition(def) {
31668
- if (isJsonSchema(def))
31669
- return def;
31670
- return {
31671
- type: "object",
31672
- properties: def
31673
- };
31674
- }
31675
- function getNodeValidator(manifestKey, inputDefinition) {
31676
- const cached2 = nodeValidatorCache.get(manifestKey);
31677
- if (cached2)
31678
- return cached2;
31679
- const normalized = normalizeInputDefinition(inputDefinition);
31680
- const enriched = enrichRequiredStrings(normalized);
31681
- try {
31682
- const validate = getAjv().compile(enriched);
31683
- nodeValidatorCache.set(manifestKey, validate);
31684
- return validate;
31685
- } catch {
31686
- return null;
31687
- }
31688
- }
31689
- function enrichRequiredStrings(schema) {
31690
- const properties = schema.properties;
31691
- const required2 = schema.required ?? [];
31692
- if (!properties || required2.length === 0)
31693
- return schema;
31694
- const enrichedProps = {};
31695
- let changed = false;
31696
- for (const [key, propSchema] of Object.entries(properties)) {
31697
- if (required2.includes(key) && propSchema.type === "string" && !("minLength" in propSchema)) {
31698
- enrichedProps[key] = { ...propSchema, minLength: 1 };
31699
- changed = true;
31700
- } else {
31701
- enrichedProps[key] = propSchema;
31702
- }
31703
- }
31704
- if (!changed)
31705
- return schema;
31706
- return { ...schema, properties: enrichedProps };
31707
- }
31708
- function schemaErrorsToValidationErrors(errors3, nodeId, nodeLabel, fieldPrefix, inputs, resolveErrorMessageKey, fieldLabels) {
31709
- const result = [];
31710
- const seen = /* @__PURE__ */ new Set;
31711
- for (const error51 of errors3) {
31712
- if (error51.keyword === "if")
31713
- continue;
31714
- if (inputs && error51.keyword !== "required") {
31715
- const value = resolveValueByInstancePath(inputs, error51.instancePath);
31716
- if (isExpression(value))
31717
- continue;
31718
- if (error51.keyword === "type" && isValueSourceShape(value))
31719
- continue;
31720
- if (error51.keyword === "type" && (value === null || typeof value === "string")) {
31721
- const expected = error51.params?.type;
31722
- if (expected === "object" || expected === "array")
31723
- continue;
31724
- }
31725
- }
31726
- if (inputs && error51.keyword === "required") {
31727
- const container = resolveValueByInstancePath(inputs, error51.instancePath);
31728
- if (isExpression(container))
31729
- continue;
31730
- }
31731
- const fieldPath = resolveFieldPath(error51, fieldPrefix);
31732
- const dedupeKey = `${fieldPath}:${error51.keyword}`;
31733
- if (seen.has(dedupeKey))
31734
- continue;
31735
- seen.add(dedupeKey);
31736
- const message = formatErrorMessage(error51, nodeLabel, fieldPath, fieldLabels);
31737
- let i18n13;
31738
- if (error51.keyword === "errorMessage") {
31739
- const i18nKey = resolveErrorMessageKey?.(error51);
31740
- i18n13 = i18nKey ? { key: i18nKey } : undefined;
31741
- } else {
31742
- const { key, params } = getSchemaErrorI18n(error51, nodeLabel, fieldPath, fieldLabels);
31743
- i18n13 = { key, ns: VALIDATION_NAMESPACE, params };
31744
- }
31745
- result.push({
31746
- code: ajvKeywordToCode(error51.keyword),
31747
- message,
31748
- severity: "error",
31749
- nodeId,
31750
- fieldPath: fieldPath ? `inputs.${fieldPath}` : undefined,
31751
- layer: fieldPath ? "field" : "node",
31752
- i18n: i18n13
31753
- });
31754
- }
31755
- return result;
31756
- }
31757
- function resolveValueByInstancePath(obj, instancePath) {
31758
- if (!instancePath)
31759
- return obj;
31760
- const segments = instancePath.split("/").filter(Boolean);
31761
- let current = obj;
31762
- for (const seg of segments) {
31763
- if (current == null || typeof current !== "object")
31764
- return;
31765
- current = current[seg];
31766
- }
31767
- return current;
31768
- }
31769
- function instancePathToFieldPath(instancePath) {
31770
- const segments = instancePath.split("/").filter(Boolean);
31771
- let result = "";
31772
- for (const seg of segments) {
31773
- if (/^\d+$/.test(seg)) {
31774
- result += `[${seg}]`;
31775
- } else {
31776
- result += result ? `.${seg}` : seg;
31777
- }
31778
- }
31779
- return result;
31780
- }
31781
- function resolveFieldPath(error51, fieldPrefix) {
31782
- if (error51.keyword === "required") {
31783
- const missing = error51.params.missingProperty;
31784
- const basePath = instancePathToFieldPath(error51.instancePath);
31785
- return basePath ? `${basePath}.${missing}` : missing;
31786
- }
31787
- const path3 = instancePathToFieldPath(error51.instancePath);
31788
- if (fieldPrefix && path3)
31789
- return path3.startsWith("[") ? `${fieldPrefix}${path3}` : `${fieldPrefix}.${path3}`;
31790
- return fieldPrefix || path3;
31791
- }
31792
- function getSchemaErrorI18n(error51, nodeLabel, fieldPath, fieldLabels) {
31793
- const rawKey = fieldPath.split(".").pop() ?? fieldPath;
31794
- const isTopLevel = !fieldPath.includes(".") && !fieldPath.includes("[");
31795
- const fieldName = isTopLevel ? fieldLabels?.[rawKey] ?? rawKey : rawKey;
31796
- switch (error51.keyword) {
31797
- case "required": {
31798
- const missing = error51.params.missingProperty;
31799
- const missingLabel = error51.instancePath === "" ? fieldLabels?.[missing] ?? missing : missing;
31800
- return {
31801
- key: "schemaValidator_required_message",
31802
- params: { fieldName: missingLabel, nodeLabel, defaultValue: '"{{fieldName}}" is required on "{{nodeLabel}}"' }
31803
- };
31804
- }
31805
- case "minLength":
31806
- return {
31807
- key: "schemaValidator_required_message",
31808
- params: { fieldName, nodeLabel, defaultValue: '"{{fieldName}}" is required on "{{nodeLabel}}"' }
31809
- };
31810
- case "type":
31811
- return {
31812
- key: "schemaValidator_typeMismatch_message",
31813
- params: {
31814
- fieldName,
31815
- nodeLabel,
31816
- type: error51.params.type,
31817
- defaultValue: '"{{fieldName}}" on "{{nodeLabel}}" expects {{type}}'
31818
- }
31819
- };
31820
- case "enum":
31821
- return {
31822
- key: "schemaValidator_invalidEnum_message",
31823
- params: { fieldName, nodeLabel, defaultValue: '"{{fieldName}}" on "{{nodeLabel}}" must be one of the allowed values' }
31824
- };
31825
- case "pattern":
31826
- return {
31827
- key: "schemaValidator_invalidPattern_message",
31828
- params: { fieldName, nodeLabel, defaultValue: '"{{fieldName}}" on "{{nodeLabel}}" has invalid format' }
31829
- };
31830
- case "minimum":
31831
- case "maximum":
31832
- return {
31833
- key: "schemaValidator_outOfRange_message",
31834
- params: { fieldName, nodeLabel, detail: error51.message ?? "", defaultValue: '"{{fieldName}}" on "{{nodeLabel}}" {{detail}}' }
31835
- };
31836
- default:
31837
- return error51.message ? {
31838
- key: "schemaValidator_genericKeyword_message",
31839
- params: { fieldName, nodeLabel, detail: error51.message, defaultValue: '"{{fieldName}}" on "{{nodeLabel}}": {{detail}}' }
31840
- } : {
31841
- key: "schemaValidator_invalidField_message",
31842
- params: { fieldName, nodeLabel, defaultValue: '"{{fieldName}}" on "{{nodeLabel}}" is invalid' }
31843
- };
31844
- }
31845
- }
31846
- function formatErrorMessage(error51, nodeLabel, fieldPath, fieldLabels) {
31847
- if (error51.keyword === "errorMessage") {
31848
- return error51.message ?? "Validation error";
31849
- }
31850
- const { key, params } = getSchemaErrorI18n(error51, nodeLabel, fieldPath, fieldLabels);
31851
- return t2(key, params);
31852
- }
31853
- function ajvKeywordToCode(keyword) {
31854
- switch (keyword) {
31855
- case "required":
31856
- case "minLength":
31857
- return "REQUIRED_FIELD";
31858
- case "type":
31859
- return "TYPE_MISMATCH";
31860
- case "enum":
31861
- return "INVALID_ENUM";
31862
- case "pattern":
31863
- return "INVALID_PATTERN";
31864
- case "minimum":
31865
- case "maximum":
31866
- case "exclusiveMinimum":
31867
- case "exclusiveMaximum":
31868
- return "OUT_OF_RANGE";
31869
- case "errorMessage":
31870
- return "SCHEMA_ERROR";
31871
- default:
31872
- return "SCHEMA_ERROR";
31873
- }
31874
- }
31875
31528
  var t22 = instance.getFixedT(null, VALIDATION_NAMESPACE);
31876
- function localized(key, params, defaultValue) {
31877
- return {
31878
- message: t22(key, { ...params, defaultValue }),
31879
- i18n: { key, params, ns: VALIDATION_NAMESPACE }
31880
- };
31881
- }
31882
- function readStringField(value) {
31883
- if (isExpressionValue(value))
31884
- return value.expression;
31885
- return typeof value === "string" ? value : "";
31886
- }
31887
- function getManifestForNode(node, manifests) {
31888
- const version2 = node.data.typeVersion || "1.0.0";
31889
- return manifests.get(`${node.type}:${version2}`);
31890
- }
31891
- function getNodeLabel(node, manifest) {
31892
- const displayLabel = node.data.display?.label;
31893
- return displayLabel || node.data.label || manifest?.display?.label || node.type;
31894
- }
31895
- function resolvePath(path3, context) {
31896
- return path3.split(".").reduce((obj, key) => {
31897
- if (obj == null || typeof obj !== "object")
31898
- return;
31899
- return obj[key];
31900
- }, context);
31901
- }
31902
- function resolveTemplate(template, context) {
31903
- if (!template.includes("{"))
31904
- return template;
31905
- return template.replace(/\{([^{}]+)\}/g, (_, expr) => {
31906
- const parts = expr.split("||").map((p) => p.trim());
31907
- for (const part of parts) {
31908
- const strMatch = part.match(/^'([^']*)'$/) || part.match(/^"([^"]*)"$/);
31909
- if (strMatch)
31910
- return strMatch[1];
31911
- const val = resolvePath(part, context);
31912
- if (val != null && val !== "")
31913
- return String(val);
31914
- }
31915
- return "";
31916
- });
31917
- }
31918
- function isTriggerNodeType(nodeType2) {
31919
- if (typeof nodeType2 !== "string")
31920
- return false;
31921
- return nodeType2.startsWith("core.trigger") || nodeType2.toLowerCase().includes("trigger");
31922
- }
31923
- function isEndNodeType(nodeType2) {
31924
- return nodeType2 === "core.control.end" || nodeType2 === "core.logic.terminate" || nodeType2 === "core.control.response";
31925
- }
31926
- var DOWHILE_NODE_TYPE = "core.logic.dowhile";
31927
- var DOWHILE_MAX_LIMIT = 1e4;
31928
- var DOWHILE_MIN_LIMIT = 1;
31929
- function parseDoWhileLimit(raw) {
31930
- if (raw === undefined || raw === null)
31931
- return;
31932
- const decoded = decodeLiteral(coerceToExpressionValue(raw, "number"));
31933
- if (decoded === undefined)
31934
- return;
31935
- if (typeof decoded === "number")
31936
- return decoded;
31937
- if (typeof decoded !== "string")
31938
- return NaN;
31939
- const body = decoded.trim();
31940
- if (!body)
31941
- return;
31942
- const parsed = Number(body);
31943
- return Number.isNaN(parsed) ? undefined : parsed;
31944
- }
31945
- var DECISION_NODE_TYPE = "core.logic.decision";
31946
- var SWITCH_NODE_TYPE = "core.logic.switch";
31947
- var MERGE_NODE_TYPE = "core.logic.merge";
31948
- function supportsVariableUpdates(nodeType2) {
31949
- return nodeType2 !== DECISION_NODE_TYPE && nodeType2 !== SWITCH_NODE_TYPE && nodeType2 !== MERGE_NODE_TYPE;
31950
- }
31951
31529
  var AUTONOMOUS_AGENT_NODE_TYPE = "uipath.agent.autonomous";
31952
31530
  var CONVERSATIONAL_AGENT_NODE_TYPE = "uipath.agent.conversational";
31953
31531
  var VOICE_AGENT_NODE_TYPE = "uipath.agent.voice";
31954
31532
  var AGENT_NODE_TYPES = [AUTONOMOUS_AGENT_NODE_TYPE, CONVERSATIONAL_AGENT_NODE_TYPE, VOICE_AGENT_NODE_TYPE];
31955
- function isConversationalOrVoiceAgentNodeType(nodeType2) {
31956
- if (!nodeType2)
31957
- return false;
31958
- return [CONVERSATIONAL_AGENT_NODE_TYPE, VOICE_AGENT_NODE_TYPE].some((t13) => nodeType2 === t13 || nodeType2.startsWith(`${t13}.`));
31959
- }
31960
- function isVoiceAgentNodeType(nodeType2) {
31961
- return nodeType2 === VOICE_AGENT_NODE_TYPE;
31962
- }
31963
- function isAutonomousAgentNodeType(nodeType2) {
31964
- return nodeType2 === AUTONOMOUS_AGENT_NODE_TYPE;
31965
- }
31966
- function isConversationalAgentNode(node) {
31967
- if (isConversationalOrVoiceAgentNodeType(node.type))
31968
- return true;
31969
- if (!isAgentNodeType(node.type) && !isPublishedAgentNodeType(node.type))
31970
- return false;
31971
- const inputs = node.data?.inputs;
31972
- return inputs?.isConversational === true;
31973
- }
31974
31533
  function isAgentNodeType(nodeType2) {
31975
31534
  if (!nodeType2)
31976
31535
  return false;
31977
31536
  return AGENT_NODE_TYPES.some((t13) => nodeType2 === t13 || nodeType2.startsWith(`${t13}.`));
31978
31537
  }
31979
- var PUBLISHED_AGENT_NODE_TYPE_PREFIX = "uipath.core.agent.";
31980
- function isPublishedAgentNodeType(nodeType2) {
31981
- if (!nodeType2)
31982
- return false;
31983
- return nodeType2.startsWith(PUBLISHED_AGENT_NODE_TYPE_PREFIX);
31984
- }
31985
- function isAgentToolNodeType(nodeType2) {
31986
- if (!nodeType2)
31987
- return false;
31988
- return nodeType2.startsWith("uipath.agent.resource.tool") && !nodeType2.startsWith("uipath.agent.resource.tool.mcp") && !nodeType2.startsWith("uipath.agent.resource.tool.a2a");
31989
- }
31990
- var AGENT_RESOURCE_PREFIX = "uipath.agent.resource.";
31991
- function isAgentResourceNodeType(nodeType2) {
31992
- if (!nodeType2)
31993
- return false;
31994
- return nodeType2.startsWith(AGENT_RESOURCE_PREFIX);
31995
- }
31996
- var CONVERSATIONAL_VOICE_END_CALL_NODE_TYPE = "uipath.conversational.voice.end-call";
31997
- function manifestExposesCallContext(manifest) {
31998
- const properties = manifest.inputDefinition?.properties;
31999
- return !!properties && Object.prototype.hasOwnProperty.call(properties, "callContext");
32000
- }
32001
- function isCallContextEmpty(callContext) {
32002
- if (isExpressionValue(callContext))
32003
- return isEmptyExpressionValue(callContext);
32004
- if (typeof callContext === "string")
32005
- return callContext.trim().length === 0;
32006
- if (Array.isArray(callContext))
32007
- return callContext.length === 0;
32008
- if (callContext == null || typeof callContext !== "object")
32009
- return true;
32010
- return Object.keys(callContext).length === 0;
32011
- }
32012
- function isValidCallContextBinding(callContext) {
32013
- if (isExpressionValue(callContext))
32014
- return callContext.type === "jsExpression" && !isEmptyExpressionValue(callContext);
32015
- if (typeof callContext === "string") {
32016
- const trimmed = callContext.trim();
32017
- return trimmed.startsWith("=") && trimmed.length > 1;
32018
- }
32019
- return callContext != null && typeof callContext === "object" && !Array.isArray(callContext) && Object.keys(callContext).length > 0;
32020
- }
32021
- var SCHEMA_PATH_PROPERTY_RE = /\/properties\/([^/]+)\/errorMessage$/;
32022
- function makeResolverFromMap(propMap) {
32023
- if (!propMap)
32024
- return;
32025
- return (error51) => {
32026
- const propName = SCHEMA_PATH_PROPERTY_RE.exec(error51.schemaPath)?.[1];
32027
- return propName ? propMap[propName] : undefined;
32028
- };
32029
- }
32030
- function buildSeverityOverrides(inputDefinition) {
32031
- const props = inputDefinition.properties;
32032
- if (!props)
32033
- return null;
32034
- let map2 = null;
32035
- for (const [key, schema] of Object.entries(props)) {
32036
- if (schema.validationSeverity && typeof schema.validationSeverity === "string") {
32037
- if (!map2)
32038
- map2 = /* @__PURE__ */ new Map;
32039
- map2.set(key, schema.validationSeverity);
32040
- }
32041
- }
32042
- return map2;
32043
- }
32044
- var schemaValidationRule = {
32045
- id: "schema-validation",
32046
- severity: "error",
32047
- validate(ctx) {
32048
- const errors3 = [];
32049
- const severityCache = /* @__PURE__ */ new Map;
32050
- for (const node of ctx.nodes) {
32051
- const manifest = getManifestForNode(node, ctx.manifests);
32052
- if (!manifest?.inputDefinition)
32053
- continue;
32054
- const manifestKey = `${manifest.nodeType}:${manifest.version}`;
32055
- const validator = getNodeValidator(manifestKey, manifest.inputDefinition);
32056
- if (!validator)
32057
- continue;
32058
- const inputs = node.data.inputs ?? {};
32059
- const decodedInputs = decodeLiteralsForValidation(inputs);
32060
- const valid = validator(decodedInputs);
32061
- if (!valid && validator.errors) {
32062
- const resolveErrorMessageKey = makeResolverFromMap(ctx.errorMessageKeysByNodeType?.[manifest.nodeType]);
32063
- const nodeErrors = schemaErrorsToValidationErrors(validator.errors, node.id, getNodeLabel(node, manifest), undefined, decodedInputs, resolveErrorMessageKey, manifest.fieldLabels);
32064
- if (!severityCache.has(manifestKey)) {
32065
- severityCache.set(manifestKey, buildSeverityOverrides(manifest.inputDefinition));
32066
- }
32067
- const overrides = severityCache.get(manifestKey);
32068
- if (overrides) {
32069
- for (const err of nodeErrors) {
32070
- if (err.fieldPath) {
32071
- const fieldName = err.fieldPath.replace(/^inputs\./, "").split(".")[0];
32072
- const severity = overrides.get(fieldName);
32073
- if (severity)
32074
- err.severity = severity;
32075
- }
32076
- }
32077
- }
32078
- errors3.push(...nodeErrors);
32079
- }
32080
- }
32081
- return errors3;
32082
- }
32083
- };
32084
- var minConnectionsRule = {
32085
- id: "min-connections",
32086
- severity: "error",
32087
- validate(ctx) {
32088
- const errors3 = [];
32089
- const sourceEdgeCounts = /* @__PURE__ */ new Map;
32090
- const targetEdgeCounts = /* @__PURE__ */ new Map;
32091
- for (const e of ctx.edges) {
32092
- const sourceKey = `${e.source}:${e.sourceHandle ?? ""}`;
32093
- sourceEdgeCounts.set(sourceKey, (sourceEdgeCounts.get(sourceKey) ?? 0) + 1);
32094
- const targetKey = `${e.target}:${e.targetHandle ?? ""}`;
32095
- targetEdgeCounts.set(targetKey, (targetEdgeCounts.get(targetKey) ?? 0) + 1);
32096
- }
32097
- for (const node of ctx.nodes) {
32098
- const manifest = getManifestForNode(node, ctx.manifests);
32099
- if (!manifest)
32100
- continue;
32101
- for (const handleGroup of manifest.handleConfiguration) {
32102
- for (const handle of handleGroup.handles) {
32103
- if (!handle.constraints?.minConnections)
32104
- continue;
32105
- const countMap = handle.type === "source" ? sourceEdgeCounts : targetEdgeCounts;
32106
- const handleKey = `${node.id}:${handle.id ?? ""}`;
32107
- let connectionCount = countMap.get(handleKey) ?? 0;
32108
- if (handle.id != null) {
32109
- connectionCount += countMap.get(`${node.id}:`) ?? 0;
32110
- }
32111
- if (connectionCount < handle.constraints.minConnections) {
32112
- const nodeLabel = getNodeLabel(node, manifest);
32113
- const handleLabel = handle.label ? resolveTemplate(handle.label, node.data) : handle.id;
32114
- const severity = handle.constraints.severity ?? "error";
32115
- const customMessage = handle.constraints.validationMessage ? resolveTemplate(handle.constraints.validationMessage, node.data) : undefined;
32116
- errors3.push({
32117
- code: "MIN_CONNECTIONS",
32118
- message: customMessage ?? `"${nodeLabel}" handle "${handleLabel}" requires at least ${handle.constraints.minConnections} connection(s)`,
32119
- severity,
32120
- nodeId: node.id,
32121
- layer: "node"
32122
- });
32123
- }
32124
- }
32125
- }
32126
- }
32127
- return errors3;
32128
- }
32129
- };
32130
31538
  var t3 = instance.getFixedT(null, VALIDATION_NAMESPACE);
32131
- function localized2(key, params, defaultValue) {
32132
- return {
32133
- message: t3(key, { ...params, defaultValue }),
32134
- i18n: { key, params, ns: VALIDATION_NAMESPACE }
32135
- };
32136
- }
32137
- var triggerRequiredRule = {
32138
- id: "trigger-required",
32139
- severity: "error",
32140
- validate(ctx) {
32141
- const hasTrigger = ctx.nodes.some((node) => isTriggerNodeType(node.type));
32142
- if (!hasTrigger) {
32143
- return [
32144
- {
32145
- code: "TRIGGER_REQUIRED",
32146
- ...localized2("triggerRequired_message", {}, "Process must have at least one trigger node"),
32147
- severity: "error",
32148
- nodeId: "",
32149
- layer: "workflow"
32150
- }
32151
- ];
32152
- }
32153
- return [];
32154
- }
32155
- };
32156
31539
  var t4 = instance.getFixedT(null, VALIDATION_NAMESPACE);
32157
- function localized3(key, params, defaultValue) {
32158
- return {
32159
- message: t4(key, { ...params, defaultValue }),
32160
- i18n: { key, params, ns: VALIDATION_NAMESPACE }
32161
- };
32162
- }
32163
- var TRANSFORM_NODE_TYPES = /* @__PURE__ */ new Set([
32164
- "core.action.transform",
32165
- "core.action.transform.map",
32166
- "core.action.transform.filter",
32167
- "core.action.transform.group-by"
32168
- ]);
32169
- function validateFilterConfig(config2, nodeLabel, nodeId) {
32170
- const errors3 = [];
32171
- const filters = Array.isArray(config2.filters) ? config2.filters : [];
32172
- if (filters.length === 0) {
32173
- errors3.push({
32174
- code: "DATA_TRANSFORM_INCOMPLETE",
32175
- ...localized3("dataTransform_filterNoConditions_message", { nodeLabel }, '"{{nodeLabel}}" filter operation has no conditions'),
32176
- severity: "error",
32177
- nodeId,
32178
- fieldPath: "inputs.operations",
32179
- layer: "field"
32180
- });
32181
- return errors3;
32182
- }
32183
- for (const filter of filters) {
32184
- if (filter.field === null || filter.field === undefined) {
32185
- errors3.push({
32186
- code: "DATA_TRANSFORM_INCOMPLETE",
32187
- ...localized3("dataTransform_filterMissingField_message", { nodeLabel }, '"{{nodeLabel}}" filter condition is missing a field'),
32188
- severity: "error",
32189
- nodeId,
32190
- fieldPath: "inputs.operations",
32191
- layer: "field"
32192
- });
32193
- }
32194
- }
32195
- return errors3;
32196
- }
32197
- function validateMapConfig(config2, nodeLabel, nodeId) {
32198
- const errors3 = [];
32199
- const mappings = Array.isArray(config2.mappings) ? config2.mappings : [];
32200
- const keepOriginalFields = config2.keepOriginalFields !== false;
32201
- if (!keepOriginalFields && mappings.length === 0) {
32202
- errors3.push({
32203
- code: "DATA_TRANSFORM_INCOMPLETE",
32204
- ...localized3("dataTransform_mapNoMappings_message", { nodeLabel }, '"{{nodeLabel}}" map operation needs at least one field mapping when original fields are not kept'),
32205
- severity: "error",
32206
- nodeId,
32207
- fieldPath: "inputs.operations",
32208
- layer: "field"
32209
- });
32210
- return errors3;
32211
- }
32212
- for (const mapping of mappings) {
32213
- if (mapping.field === null || mapping.field === undefined) {
32214
- errors3.push({
32215
- code: "DATA_TRANSFORM_INCOMPLETE",
32216
- ...localized3("dataTransform_mapMissingField_message", { nodeLabel }, '"{{nodeLabel}}" map field mapping is missing a field'),
32217
- severity: "error",
32218
- nodeId,
32219
- fieldPath: "inputs.operations",
32220
- layer: "field"
32221
- });
32222
- }
32223
- }
32224
- return errors3;
32225
- }
32226
- function validateGroupByConfig(config2, nodeLabel, nodeId) {
32227
- const errors3 = [];
32228
- if (config2.groupByField === null || config2.groupByField === undefined) {
32229
- errors3.push({
32230
- code: "DATA_TRANSFORM_INCOMPLETE",
32231
- ...localized3("dataTransform_groupByMissingField_message", { nodeLabel }, '"{{nodeLabel}}" group by operation is missing the group by field'),
32232
- severity: "error",
32233
- nodeId,
32234
- fieldPath: "inputs.operations",
32235
- layer: "field"
32236
- });
32237
- return errors3;
32238
- }
32239
- const aggregations = Array.isArray(config2.aggregations) ? config2.aggregations : [];
32240
- for (const agg of aggregations) {
32241
- const operation = agg.operation;
32242
- const fieldRequired = operation !== "count";
32243
- if (fieldRequired && (agg.field === null || agg.field === undefined)) {
32244
- errors3.push({
32245
- code: "DATA_TRANSFORM_INCOMPLETE",
32246
- ...localized3("dataTransform_groupByAggMissingField_message", { nodeLabel }, '"{{nodeLabel}}" group by aggregation is missing a field'),
32247
- severity: "error",
32248
- nodeId,
32249
- fieldPath: "inputs.operations",
32250
- layer: "field"
32251
- });
32252
- }
32253
- if (!readStringField(agg.alias).trim()) {
32254
- errors3.push({
32255
- code: "DATA_TRANSFORM_INCOMPLETE",
32256
- ...localized3("dataTransform_groupByAggMissingOutputName_message", { nodeLabel }, '"{{nodeLabel}}" group by aggregation is missing an output name'),
32257
- severity: "error",
32258
- nodeId,
32259
- fieldPath: "inputs.operations",
32260
- layer: "field"
32261
- });
32262
- }
32263
- }
32264
- return errors3;
32265
- }
32266
- function validateCustomScriptConfig(config2, nodeLabel, nodeId) {
32267
- if (!readStringField(config2.script).trim()) {
32268
- return [
32269
- {
32270
- code: "DATA_TRANSFORM_INCOMPLETE",
32271
- ...localized3("dataTransform_customScriptMissing_message", { nodeLabel }, '"{{nodeLabel}}" custom script operation has no script'),
32272
- severity: "error",
32273
- nodeId,
32274
- fieldPath: "inputs.operations",
32275
- layer: "field"
32276
- }
32277
- ];
32278
- }
32279
- return [];
32280
- }
32281
- function validateOperation(op, nodeLabel, nodeId) {
32282
- const config2 = op.config;
32283
- if (!config2 || typeof config2 !== "object")
32284
- return [];
32285
- switch (op.type) {
32286
- case "filter":
32287
- return validateFilterConfig(config2, nodeLabel, nodeId);
32288
- case "map":
32289
- return validateMapConfig(config2, nodeLabel, nodeId);
32290
- case "groupBy":
32291
- return validateGroupByConfig(config2, nodeLabel, nodeId);
32292
- case "customScript":
32293
- return validateCustomScriptConfig(config2, nodeLabel, nodeId);
32294
- default:
32295
- return [];
32296
- }
32297
- }
32298
- var dataTransformRule = {
32299
- id: "data-transform",
32300
- severity: "error",
32301
- validate(ctx) {
32302
- const errors3 = [];
32303
- for (const node of ctx.nodes) {
32304
- if (!TRANSFORM_NODE_TYPES.has(node.type))
32305
- continue;
32306
- const manifest = getManifestForNode(node, ctx.manifests);
32307
- const nodeLabel = getNodeLabel(node, manifest);
32308
- const inputs = node.data.inputs ?? {};
32309
- if (!readStringField(inputs.collection).trim()) {
32310
- errors3.push({
32311
- code: "DATA_TRANSFORM_INCOMPLETE",
32312
- ...localized3("dataTransform_missingCollection_message", { nodeLabel }, '"{{nodeLabel}}" is missing a collection variable'),
32313
- severity: "error",
32314
- nodeId: node.id,
32315
- fieldPath: "inputs.collection",
32316
- layer: "field"
32317
- });
32318
- }
32319
- const operations = Array.isArray(inputs.operations) ? inputs.operations : [];
32320
- if (operations.length === 0) {
32321
- errors3.push({
32322
- code: "DATA_TRANSFORM_INCOMPLETE",
32323
- ...localized3("dataTransform_noOperations_message", { nodeLabel }, '"{{nodeLabel}}" has no operations configured'),
32324
- severity: "error",
32325
- nodeId: node.id,
32326
- fieldPath: "inputs.operations",
32327
- layer: "field"
32328
- });
32329
- continue;
32330
- }
32331
- for (const op of operations) {
32332
- errors3.push(...validateOperation(op, nodeLabel, node.id));
32333
- }
32334
- }
32335
- return errors3;
32336
- }
32337
- };
32338
31540
  var t5 = instance.getFixedT(null, VALIDATION_NAMESPACE);
32339
- function localized4(key, params, defaultValue) {
32340
- return {
32341
- message: t5(key, { ...params, defaultValue }),
32342
- i18n: { key, params, ns: VALIDATION_NAMESPACE }
32343
- };
32344
- }
32345
- var outputMappingRule = {
32346
- id: "output-mapping",
32347
- severity: "warning",
32348
- validate(ctx) {
32349
- const outputVarIds = ctx.outputVariableIds;
32350
- if (!outputVarIds || outputVarIds.length === 0)
32351
- return [];
32352
- const errors3 = [];
32353
- const endNodes = ctx.nodes.filter((n) => isEndNodeType(n.type));
32354
- if (endNodes.length === 0)
32355
- return [];
32356
- for (const node of endNodes) {
32357
- const manifest = getManifestForNode(node, ctx.manifests);
32358
- const nodeLabel = getNodeLabel(node, manifest);
32359
- const outputs = node.data.outputs ?? {};
32360
- for (const varId of outputVarIds) {
32361
- if (!readStringField(outputs[varId]?.source).trim()) {
32362
- errors3.push({
32363
- code: "MISSING_OUTPUT_MAPPING",
32364
- ...localized4("outputMapping_missing_message", { nodeLabel, varId }, '"{{nodeLabel}}" is missing output mapping for "{{varId}}"'),
32365
- severity: "warning",
32366
- nodeId: node.id,
32367
- fieldPath: `outputs.${varId}.source`,
32368
- layer: "node"
32369
- });
32370
- }
32371
- }
32372
- }
32373
- return errors3;
32374
- }
32375
- };
32376
- var ESCALATION_QUICK_FORM_NODE_TYPE = "uipath.agent.resource.escalation.quick-form";
32377
31541
  var ESCALATION_TASK_TYPE = {
32378
31542
  AppTask: "app-task",
32379
31543
  QuickForm: "quick-form",
32380
31544
  DocumentValidationTask: "document-validation-task"
32381
31545
  };
32382
31546
  var ESCALATION_TASK_TYPES = new Set(Object.values(ESCALATION_TASK_TYPE));
32383
- function resolveEscalationTaskType(nodeType2, inputsType) {
32384
- if (nodeType2 === ESCALATION_QUICK_FORM_NODE_TYPE)
32385
- return ESCALATION_TASK_TYPE.QuickForm;
32386
- if (typeof inputsType === "string" && ESCALATION_TASK_TYPES.has(inputsType))
32387
- return inputsType;
32388
- return ESCALATION_TASK_TYPE.AppTask;
32389
- }
32390
- var isToolNode = (nodeType2) => {
32391
- return nodeType2.startsWith("uipath.agent.resource.tool.");
32392
- };
32393
- var isContextNode = (nodeType2) => {
32394
- return nodeType2.startsWith("uipath.agent.resource.context.");
32395
- };
32396
- var isEscalationNode = (nodeType2) => {
32397
- return nodeType2.startsWith("uipath.agent.resource.escalation");
32398
- };
32399
- var isMemoryNode = (nodeType2) => {
32400
- return nodeType2.startsWith("uipath.agent.resource.memory.");
32401
- };
32402
- var isAgentResourceNode = (nodeType2) => {
32403
- return isToolNode(nodeType2) || isContextNode(nodeType2) || isEscalationNode(nodeType2) || isMemoryNode(nodeType2);
32404
- };
32405
31547
  var DEFAULT_STORAGE_VERSION = currentStorageSchema.version;
32406
- var _defaultAgentContent;
32407
- function getDefaultAgentContent() {
32408
- if (!_defaultAgentContent) {
32409
- const entry = currentStorageSchemaMigration.defaultStorageContents.files.find((f) => f.name === "agent.json");
32410
- if (!entry) {
32411
- throw new Error("@uipath/agents-storage-schemas: missing agent.json in defaultStorageContents");
32412
- }
32413
- _defaultAgentContent = entry.content;
32414
- }
32415
- return _defaultAgentContent;
32416
- }
32417
31548
  var t6 = instance.getFixedT(null, VALIDATION_NAMESPACE);
32418
- function localized5(key, params, defaultValue) {
32419
- return {
32420
- message: t6(key, { ...params, defaultValue }),
32421
- i18n: { key, params, ns: VALIDATION_NAMESPACE }
32422
- };
32423
- }
32424
- function getNodeType(node) {
32425
- return node.data?.type ?? node.type ?? "";
32426
- }
32427
- function isAgentNode(node) {
32428
- return isAgentNodeType(getNodeType(node));
32429
- }
32430
- function isEscalationNode2(node) {
32431
- return isEscalationNode(getNodeType(node));
32432
- }
32433
- function isAgentResourceNode2(node) {
32434
- return isAgentResourceNodeType(getNodeType(node));
32435
- }
32436
- function checkTemperature(node, gov) {
32437
- if (gov.maxTemperature == null || gov.maxTemperature <= 0)
32438
- return null;
32439
- const temperature = Number(node.data?.inputs?.temperature ?? 0);
32440
- if (temperature <= gov.maxTemperature)
32441
- return null;
32442
- return {
32443
- code: "GOVERNANCE_TEMPERATURE_EXCEEDED",
32444
- ...localized5("governance_temperatureExceeded_message", { maxTemperature: gov.maxTemperature, policyName: gov.policyName }, "Temperature exceeds {{maxTemperature}}. Rule enforced by governance policy: {{policyName}}"),
32445
- severity: "error",
32446
- nodeId: node.id,
32447
- fieldPath: "inputs.temperature",
32448
- layer: "field"
32449
- };
32450
- }
32451
- function checkMaxTokens(node, gov) {
32452
- if (gov.maxTokens == null || gov.maxTokens <= 0)
32453
- return null;
32454
- const maxTokens = Number(node.data?.inputs?.maxTokenPerResponse ?? 0);
32455
- if (maxTokens <= gov.maxTokens)
32456
- return null;
32457
- return {
32458
- code: "GOVERNANCE_MAX_TOKENS_EXCEEDED",
32459
- ...localized5("governance_maxTokensExceeded_message", { maxTokens: gov.maxTokens, policyName: gov.policyName }, "Max tokens per response exceeds {{maxTokens}}. Rule enforced by governance policy: {{policyName}}"),
32460
- severity: "error",
32461
- nodeId: node.id,
32462
- fieldPath: "inputs.maxTokenPerResponse",
32463
- layer: "field"
32464
- };
32465
- }
32466
- function checkMaxIterations(node, gov) {
32467
- if (gov.maxIterations == null || gov.maxIterations <= 0)
32468
- return null;
32469
- const defaultMaxIterations = getDefaultAgentContent().settings.maxIterations ?? 0;
32470
- const maxIterations = Number(node.data?.inputs?.maxIterations ?? defaultMaxIterations);
32471
- if (maxIterations <= gov.maxIterations)
32472
- return null;
32473
- return {
32474
- code: "GOVERNANCE_MAX_ITERATIONS_EXCEEDED",
32475
- ...localized5("governance_maxIterationsExceeded_message", { maxIterations: gov.maxIterations, policyName: gov.policyName }, "Max iterations exceeds {{maxIterations}}. Rule enforced by governance policy: {{policyName}}"),
32476
- severity: "error",
32477
- nodeId: node.id,
32478
- fieldPath: "inputs.maxIterations",
32479
- layer: "field"
32480
- };
32481
- }
32482
- function hasEscalationGuardrail(node) {
32483
- const inputs = node.data?.inputs;
32484
- const guardrails = inputs?.guardrails;
32485
- if (!Array.isArray(guardrails))
32486
- return false;
32487
- return guardrails.some((g) => {
32488
- if (typeof g !== "object" || g === null)
32489
- return false;
32490
- const action = g.action;
32491
- return !!action && action.$actionType === "escalate";
32492
- });
32493
- }
32494
- function checkModelAvailability(node, availableModelNames, policyName) {
32495
- const model = node.data?.inputs?.model;
32496
- if (!model || typeof model !== "string") {
32497
- if (availableModelNames.includes(getDefaultAgentContent().settings.model))
32498
- return null;
32499
- return {
32500
- code: "MODEL_NOT_AVAILABLE",
32501
- ...localized5("governance_noAllowedModel_message", { policyName }, "No allowed model selected, enforced by governance policy: {{policyName}}"),
32502
- severity: "error",
32503
- nodeId: node.id,
32504
- fieldPath: "inputs.model",
32505
- layer: "field"
32506
- };
32507
- }
32508
- if (availableModelNames.includes(model))
32509
- return null;
32510
- return {
32511
- code: "MODEL_NOT_AVAILABLE",
32512
- ...localized5("governance_modelNotAvailable_message", { model, policyName }, "{{model}} model is not allowed, enforced by governance policy: {{policyName}}"),
32513
- severity: "error",
32514
- nodeId: node.id,
32515
- fieldPath: "inputs.model",
32516
- layer: "field"
32517
- };
32518
- }
32519
- function checkHitl(node, gov, nodes, edges) {
32520
- if (!gov.shouldEnforceHumanInTheLoop)
32521
- return null;
32522
- const hasEscalationResource = edges.some((edge) => edge.source === node.id && edge.sourceHandle === "escalation" && nodes.some((n) => n.id === edge.target && isEscalationNode2(n)));
32523
- if (hasEscalationResource)
32524
- return null;
32525
- if (hasEscalationGuardrail(node))
32526
- return null;
32527
- const linkedTargetIds = new Set(edges.filter((edge) => edge.source === node.id).map((edge) => edge.target));
32528
- const hasLinkedEscalationGuardrail = nodes.some((n) => linkedTargetIds.has(n.id) && isAgentResourceNode2(n) && hasEscalationGuardrail(n));
32529
- if (hasLinkedEscalationGuardrail)
32530
- return null;
32531
- return {
32532
- code: "GOVERNANCE_HITL_REQUIRED",
32533
- ...localized5("governance_hitlRequired_message", { policyName: gov.policyName }, "Agent must have at least one escalation resource or a guardrail with HITL action. Rule enforced by governance policy: {{policyName}}"),
32534
- severity: "error",
32535
- nodeId: node.id,
32536
- layer: "node",
32537
- publishOnly: true
32538
- };
32539
- }
32540
- var governanceRule = {
32541
- id: "governance",
32542
- severity: "error",
32543
- validate(ctx) {
32544
- const gov = ctx.governanceEnforcements;
32545
- const availableModels = ctx.availableModelNames;
32546
- const errors3 = [];
32547
- for (const node of ctx.nodes) {
32548
- if (!isAgentNode(node))
32549
- continue;
32550
- if (isVoiceAgentNodeType(getNodeType(node)))
32551
- continue;
32552
- if (gov) {
32553
- const tempErr = checkTemperature(node, gov);
32554
- if (tempErr)
32555
- errors3.push(tempErr);
32556
- const tokensErr = checkMaxTokens(node, gov);
32557
- if (tokensErr)
32558
- errors3.push(tokensErr);
32559
- const iterationsErr = checkMaxIterations(node, gov);
32560
- if (iterationsErr)
32561
- errors3.push(iterationsErr);
32562
- const hitlErr = checkHitl(node, gov, ctx.nodes, ctx.edges);
32563
- if (hitlErr)
32564
- errors3.push(hitlErr);
32565
- }
32566
- if (availableModels !== undefined) {
32567
- const modelErr = checkModelAvailability(node, availableModels, gov?.policyName ?? "tenant model policy");
32568
- if (modelErr)
32569
- errors3.push(modelErr);
32570
- }
32571
- }
32572
- return errors3;
32573
- }
32574
- };
32575
- function getHitlFieldChannelKey(field) {
32576
- if (field.label)
32577
- return field.label;
32578
- if (field.id)
32579
- return field.id;
32580
- return null;
32581
- }
32582
- function isHitlInputDirectionField(field) {
32583
- return (field.direction ?? "input") === "input" || field.direction === "inOut";
32584
- }
32585
- function isHitlOutputDirectionField(field) {
32586
- return field.direction === "output" || field.direction === "inOut";
32587
- }
32588
- function collectDuplicateChannelKeys(fields) {
32589
- const seen = /* @__PURE__ */ new Set;
32590
- const duplicates = /* @__PURE__ */ new Set;
32591
- for (const field of fields) {
32592
- const key = getHitlFieldChannelKey(field);
32593
- if (key === null)
32594
- continue;
32595
- if (seen.has(key))
32596
- duplicates.add(key);
32597
- seen.add(key);
32598
- }
32599
- return [...duplicates];
32600
- }
32601
- function findDuplicateHitlChannelKeys(schema) {
32602
- const fields = schema?.fields ?? [];
32603
- const inputSide = collectDuplicateChannelKeys(fields.filter(isHitlInputDirectionField));
32604
- const outputSide = collectDuplicateChannelKeys(fields.filter(isHitlOutputDirectionField));
32605
- return [.../* @__PURE__ */ new Set([...inputSide, ...outputSide])];
32606
- }
32607
31549
  var t7 = instance.getFixedT(null, VALIDATION_NAMESPACE);
32608
- function localized6(key, params, defaultValue) {
32609
- return {
32610
- message: t7(key, { ...params, defaultValue }),
32611
- i18n: { key, params, ns: VALIDATION_NAMESPACE }
32612
- };
32613
- }
32614
- var escalationValidationRule = {
32615
- id: "escalation-validation",
32616
- severity: "error",
32617
- validate(ctx) {
32618
- const errors3 = [];
32619
- for (const node of ctx.nodes) {
32620
- if (!isEscalationNode(node.type))
32621
- continue;
32622
- const inputs = node.data.inputs ?? {};
32623
- const manifest = getManifestForNode(node, ctx.manifests);
32624
- const label = getNodeLabel(node, manifest);
32625
- const isQuickForm = resolveEscalationTaskType(node.type, inputs.type) === ESCALATION_TASK_TYPE.QuickForm;
32626
- if (!readStringField(inputs.name).trim()) {
32627
- errors3.push({
32628
- code: "ESCALATION_NAME_REQUIRED",
32629
- ...localized6("escalation_nameRequired_message", { label }, "{{label}}: Escalation name is required"),
32630
- severity: "error",
32631
- nodeId: node.id,
32632
- fieldPath: "inputs.name",
32633
- layer: "node"
32634
- });
32635
- }
32636
- if (isQuickForm) {
32637
- for (const fieldLabel of findDuplicateHitlChannelKeys(inputs.schema)) {
32638
- errors3.push({
32639
- code: "ESCALATION_QUICK_FORM_DUPLICATE_FIELD_LABEL",
32640
- ...localized6("escalation_quickFormDuplicateFieldLabel_message", { label, fieldLabel }, '{{label}}: Multiple fields are labeled "{{fieldLabel}}" — the escalation task would keep only one of them. Make field labels unique'),
32641
- severity: "error",
32642
- nodeId: node.id,
32643
- fieldPath: "inputs.schema",
32644
- layer: "field"
32645
- });
32646
- }
32647
- }
32648
- if (!isQuickForm) {
32649
- const app = inputs.app;
32650
- if (!app?.appName) {
32651
- errors3.push({
32652
- code: "ESCALATION_APP_REQUIRED",
32653
- ...localized6("escalation_appRequired_message", { label }, "Select an action app"),
32654
- severity: "error",
32655
- nodeId: node.id,
32656
- fieldPath: "inputs.app",
32657
- layer: "node"
32658
- });
32659
- }
32660
- }
32661
- if (inputs.agentMemory === true) {
32662
- const fieldSettings = inputs.memoryFieldSettings;
32663
- if (!Array.isArray(fieldSettings) || fieldSettings.length === 0) {
32664
- errors3.push({
32665
- code: "ESCALATION_MEMORY_ARGUMENT_REQUIRED",
32666
- ...localized6("escalation_memoryArgumentRequired_message", { label }, "{{label}}: Add at least one argument for agent memory, or turn agent memory off"),
32667
- severity: "error",
32668
- nodeId: node.id,
32669
- fieldPath: "inputs.memoryFieldSettings",
32670
- layer: "node"
32671
- });
32672
- }
32673
- }
32674
- const recipients = inputs.recipients;
32675
- const hasValidRecipient = Array.isArray(recipients) && recipients.length > 0 && recipients.some((r) => r.value && String(r.value).trim() !== "");
32676
- if (!hasValidRecipient) {
32677
- errors3.push({
32678
- code: "ESCALATION_RECIPIENT_REQUIRED",
32679
- ...localized6("escalation_recipientRequired_message", { label }, "{{label}}: Escalation recipient is required"),
32680
- severity: "error",
32681
- nodeId: node.id,
32682
- fieldPath: "inputs.recipients",
32683
- layer: "node"
32684
- });
32685
- }
32686
- }
32687
- return errors3;
32688
- }
32689
- };
32690
31550
  var t8 = instance.getFixedT(null, VALIDATION_NAMESPACE);
32691
31551
  var t9 = instance.getFixedT(null, VALIDATION_NAMESPACE);
32692
- function localized8(key, params, defaultValue) {
32693
- return {
32694
- message: t9(key, { ...params, defaultValue }),
32695
- i18n: { key, params, ns: VALIDATION_NAMESPACE }
32696
- };
32697
- }
32698
- var INPUT_REF_REGEX = /\{\{\s*\$agent\.([a-zA-Z_][a-zA-Z0-9_.]*)\s*\}\}/g;
32699
31552
  var VARS_PATH_CAPTURE = String.raw`[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*|\[\d+\])*`;
32700
31553
  var VARS_REF_REGEX = new RegExp(String.raw`\{\{\s*\$vars\.(${VARS_PATH_CAPTURE})\s*\}\}`, "g");
32701
31554
  var RAW_VARS_REF_REGEX = new RegExp(String.raw`(?<!\w)\$vars\.(${VARS_PATH_CAPTURE})`, "g");
32702
- function getNodeType2(node) {
32703
- return node.data?.type ?? node.type ?? "";
32704
- }
32705
- function collectStringsDeep(value, out = []) {
32706
- if (typeof value === "string")
32707
- out.push(value);
32708
- else if (Array.isArray(value))
32709
- for (const item of value)
32710
- collectStringsDeep(item, out);
32711
- else if (value && typeof value === "object")
32712
- for (const item of Object.values(value))
32713
- collectStringsDeep(item, out);
32714
- return out;
32715
- }
32716
- function extractMatches(text, regex) {
32717
- const refs = /* @__PURE__ */ new Set;
32718
- regex.lastIndex = 0;
32719
- let match;
32720
- while ((match = regex.exec(text)) !== null) {
32721
- refs.add(match[1]);
32722
- }
32723
- return refs;
32724
- }
32725
- var agentInputRefsRule = {
32726
- id: "agent-input-refs",
32727
- severity: "error",
32728
- validate(ctx) {
32729
- const errors3 = [];
32730
- const knownRootSegments = ctx.workflowVariableIds ? new Set(ctx.workflowVariableIds) : null;
32731
- if (knownRootSegments) {
32732
- for (const n of ctx.nodes)
32733
- knownRootSegments.add(n.id);
32734
- }
32735
- const nodeById = new Map(ctx.nodes.map((n) => [n.id, n]));
32736
- for (const node of ctx.nodes) {
32737
- if (!isAgentNodeType(getNodeType2(node)))
32738
- continue;
32739
- const inputs = node.data?.inputs;
32740
- if (!inputs)
32741
- continue;
32742
- const systemPrompt = typeof inputs.systemPrompt === "string" ? inputs.systemPrompt : "";
32743
- const userPrompt = typeof inputs.userPrompt === "string" ? inputs.userPrompt : "";
32744
- const inputRefs = /* @__PURE__ */ new Set;
32745
- for (const ref of extractMatches(systemPrompt, INPUT_REF_REGEX))
32746
- inputRefs.add(ref);
32747
- for (const ref of extractMatches(userPrompt, INPUT_REF_REGEX))
32748
- inputRefs.add(ref);
32749
- for (const ref of inputRefs) {
32750
- errors3.push({
32751
- code: "AGENT_RESERVED_INPUT_REF",
32752
- ...localized8("agentInputRefs_reservedNamespace_message", { ref }, '"$agent.{{ref}}" is a Flow-internal agent-runtime namespace and cannot be used directly in prompts. Reference the flow variable via "$vars.{{ref}}" or "$metadata.{{ref}}" instead.'),
32753
- severity: "error",
32754
- nodeId: node.id,
32755
- layer: "node"
32756
- });
32757
- }
32758
- const mustacheVarsRefs = /* @__PURE__ */ new Set;
32759
- for (const ref of extractMatches(systemPrompt, VARS_REF_REGEX))
32760
- mustacheVarsRefs.add(ref);
32761
- for (const ref of extractMatches(userPrompt, VARS_REF_REGEX))
32762
- mustacheVarsRefs.add(ref);
32763
- const rootCheckRefs = new Set(mustacheVarsRefs);
32764
- for (const ref of extractMatches(systemPrompt, RAW_VARS_REF_REGEX))
32765
- rootCheckRefs.add(ref);
32766
- for (const ref of extractMatches(userPrompt, RAW_VARS_REF_REGEX))
32767
- rootCheckRefs.add(ref);
32768
- for (const edge of ctx.edges) {
32769
- if (edge.source !== node.id)
32770
- continue;
32771
- const target = nodeById.get(edge.target);
32772
- if (!target || !isAgentResourceNode(getNodeType2(target)))
32773
- continue;
32774
- for (const s of collectStringsDeep(target.data?.inputs ?? undefined)) {
32775
- for (const ref of extractMatches(s, RAW_VARS_REF_REGEX))
32776
- rootCheckRefs.add(ref);
32777
- }
32778
- }
32779
- const stripIndex = (s) => s.replace(/\[\d+\]/g, "");
32780
- const reportedProblems = /* @__PURE__ */ new Set;
32781
- const flaggedRoots = /* @__PURE__ */ new Set;
32782
- for (const ref of rootCheckRefs) {
32783
- const segments = ref.split(".");
32784
- const rootSegment = stripIndex(segments[0]);
32785
- if (rootSegment === "metadata") {
32786
- flaggedRoots.add(rootSegment);
32787
- if (reportedProblems.has("metadata"))
32788
- continue;
32789
- reportedProblems.add("metadata");
32790
- errors3.push({
32791
- code: "AGENT_RESERVED_METADATA_ROOT",
32792
- ...localized8("agentInputRefs_reservedMetadataRoot_message", { ref }, 'Prompt references "$vars.{{ref}}", but a variable or node named "metadata" collides with the "$metadata" namespace once serialized for the agent and cannot round-trip. Rename it to something other than "metadata".'),
32793
- severity: "error",
32794
- nodeId: node.id,
32795
- layer: "node"
32796
- });
32797
- continue;
32798
- }
32799
- const indexed = /\[\d+\]/.test(ref);
32800
- const offending = (indexed ? segments : [segments[0]]).map(stripIndex).find((s) => s.includes("__"));
32801
- if (offending) {
32802
- flaggedRoots.add(rootSegment);
32803
- if (reportedProblems.has(offending))
32804
- continue;
32805
- reportedProblems.add(offending);
32806
- errors3.push({
32807
- code: "AGENT_AMBIGUOUS_UNDERSCORE_ROOT",
32808
- ...localized8("agentInputRefs_ambiguousUnderscoreRoot_message", { ref, rootSegment: offending }, 'Prompt references "$vars.{{ref}}", but the name "{{rootSegment}}" contains "__", which is reserved as the agent-input encoding separator and cannot round-trip. Rename it to remove the double underscore.'),
32809
- severity: "error",
32810
- nodeId: node.id,
32811
- layer: "node"
32812
- });
32813
- }
32814
- }
32815
- if (knownRootSegments) {
32816
- for (const ref of mustacheVarsRefs) {
32817
- const rootSegment = stripIndex(ref.split(".")[0]);
32818
- if (flaggedRoots.has(rootSegment) || knownRootSegments.has(rootSegment))
32819
- continue;
32820
- errors3.push({
32821
- code: "AGENT_UNRESOLVED_VARS_REF",
32822
- ...localized8("agentInputRefs_unresolvedRef_message", { ref, rootSegment }, 'Prompt references "$vars.{{ref}}" but no workflow variable or node "{{rootSegment}}" exists. Add the variable/node to the flow or remove the reference.'),
32823
- severity: "error",
32824
- nodeId: node.id,
32825
- layer: "node"
32826
- });
32827
- }
31555
+ var JobAttachmentSchema = {
31556
+ type: "object",
31557
+ "x-uipath-resource-kind": "JobAttachment",
31558
+ properties: {
31559
+ ID: {
31560
+ type: "string",
31561
+ description: "Orchestrator attachment key"
31562
+ },
31563
+ FullName: {
31564
+ type: "string",
31565
+ description: "File name"
31566
+ },
31567
+ MimeType: {
31568
+ type: "string",
31569
+ description: 'The MIME type of the content, such as "application/json" or "image/png"'
31570
+ },
31571
+ Metadata: {
31572
+ type: "object",
31573
+ description: "Dictionary of metadata",
31574
+ additionalProperties: {
31575
+ type: "string"
32828
31576
  }
32829
31577
  }
32830
- return errors3;
32831
- }
31578
+ },
31579
+ required: ["ID"]
32832
31580
  };
32833
- function getNodeType3(node) {
32834
- return node.data?.type ?? node.type ?? "";
32835
- }
32836
- function getToolDisplayName(node, manifest) {
32837
- const label = node.data?.display?.label;
32838
- const inputsName = node.data?.inputs?.name;
32839
- return typeof label === "string" && label || typeof inputsName === "string" && inputsName || manifest?.display?.label || "Tool";
32840
- }
32841
- function getConnectedNodeIds(nodeId, edges) {
32842
- const ids = /* @__PURE__ */ new Set;
32843
- for (const edge of edges) {
32844
- if (edge.source === nodeId)
32845
- ids.add(edge.target);
32846
- if (edge.target === nodeId)
32847
- ids.add(edge.source);
32848
- }
32849
- return ids;
32850
- }
32851
- function groupToolsByName(toolNodes, ctx) {
32852
- const nameToNodes = /* @__PURE__ */ new Map;
32853
- for (const toolNode of toolNodes) {
32854
- const version2 = toolNode.data?.typeVersion || "1.0.0";
32855
- const manifest = ctx.manifests.get(`${getNodeType3(toolNode)}:${version2}`);
32856
- const name = getToolDisplayName(toolNode, manifest);
32857
- const group = nameToNodes.get(name);
32858
- if (group) {
32859
- group.push(toolNode);
32860
- } else {
32861
- nameToNodes.set(name, [toolNode]);
32862
- }
32863
- }
32864
- return nameToNodes;
32865
- }
32866
- function emitDuplicateErrors(nameToNodes) {
32867
- const errors3 = [];
32868
- for (const [name, dupes] of nameToNodes) {
32869
- if (dupes.length <= 1)
32870
- continue;
32871
- for (const toolNode of dupes) {
32872
- errors3.push({
32873
- code: "AGENT_DUPLICATE_TOOL_NAME",
32874
- ...localized("agentDuplicateToolNames_duplicateName_message", { name }, 'Tool name "{{name}}" is used by multiple tools on this agent. Each tool must have a unique name.'),
32875
- severity: "error",
32876
- nodeId: toolNode.id,
32877
- fieldPath: "display.label",
32878
- layer: "node"
32879
- });
32880
- }
32881
- }
32882
- return errors3;
32883
- }
32884
- var agentDuplicateToolNamesRule = {
32885
- id: "agent-duplicate-tool-names",
32886
- severity: "error",
32887
- validate(ctx) {
32888
- const agentNodes = ctx.nodes.filter((n) => isAgentNodeType(getNodeType3(n)));
32889
- const errors3 = [];
32890
- for (const agentNode of agentNodes) {
32891
- const connectedIds = getConnectedNodeIds(agentNode.id, ctx.edges);
32892
- const toolNodes = ctx.nodes.filter((n) => connectedIds.has(n.id) && isAgentToolNodeType(getNodeType3(n)));
32893
- if (toolNodes.length === 0)
32894
- continue;
32895
- errors3.push(...emitDuplicateErrors(groupToolsByName(toolNodes, ctx)));
32896
- }
32897
- return errors3;
32898
- }
32899
- };
32900
- var HITL_NODE_TYPE = "uipath.human-in-the-loop";
32901
- var HITL_QUICK_FORM_NODE_TYPE = "uipath.human-in-the-loop.quick-form";
32902
- var HITL_CODED_ACTION_NODE_TYPE = "uipath.human-in-the-loop.coded-action-app";
32903
- var HITL_DOC_VALIDATION_NODE_TYPE = "uipath.human-in-the-loop.document-validation";
32904
- var DYNAMIC_EXTRACT_NODE_TYPE = "uipath.ixp.extract-document-builder";
32905
- var FORM_TRIGGER_NODE_TYPE = "core.trigger.form";
32906
- var HITL_NODE_TYPES = /* @__PURE__ */ new Set([
32907
- HITL_QUICK_FORM_NODE_TYPE,
32908
- HITL_CODED_ACTION_NODE_TYPE,
32909
- HITL_DOC_VALIDATION_NODE_TYPE,
32910
- HITL_NODE_TYPE
32911
- ]);
32912
- function isHitlNodeType(t13) {
32913
- return HITL_NODE_TYPES.has(t13);
32914
- }
32915
- var HITL_VARS_REF = /\$?vars\.([A-Za-z_$][\w$]*)/g;
32916
- function nodeType(node) {
32917
- return node.data?.type ?? node.type ?? "";
32918
- }
32919
- function addUpdateTargets(updates, out) {
32920
- if (!Array.isArray(updates))
32921
- return;
32922
- for (const update of updates) {
32923
- const id = update?.variableId;
32924
- if (typeof id === "string" && id)
32925
- out.add(id);
32926
- }
32927
- }
32928
- function addEndOutputTargets(node, out) {
32929
- const outputs = node.data?.outputs;
32930
- if (!isEndNodeType(nodeType(node)) || !outputs || typeof outputs !== "object")
32931
- return;
32932
- for (const [globalId, mapping] of Object.entries(outputs)) {
32933
- if (readStringField(mapping?.source).trim() !== "")
32934
- out.add(globalId);
32935
- }
32936
- }
32937
- function addHitlMapTargets(node, out) {
32938
- if (!isHitlNodeType(nodeType(node)))
32939
- return;
32940
- const variableMap = node.data?.inputs?.variableMap;
32941
- if (!variableMap || typeof variableMap !== "object")
32942
- return;
32943
- for (const expression of Object.values(variableMap)) {
32944
- if (typeof expression !== "string")
32945
- continue;
32946
- HITL_VARS_REF.lastIndex = 0;
32947
- let match;
32948
- while ((match = HITL_VARS_REF.exec(expression)) !== null)
32949
- out.add(match[1]);
32950
- }
32951
- }
32952
- function collectWrittenGlobalIds(nodes, workflowVariables) {
32953
- const written = /* @__PURE__ */ new Set;
32954
- const unsupportedNodeIds = new Set(nodes.filter((node) => !supportsVariableUpdates(nodeType(node))).map((node) => node.id));
32955
- for (const [nodeId, updates] of Object.entries(workflowVariables?.variableUpdates ?? {})) {
32956
- if (unsupportedNodeIds.has(nodeId))
32957
- continue;
32958
- addUpdateTargets(updates, written);
32959
- }
32960
- for (const node of nodes) {
32961
- if (supportsVariableUpdates(nodeType(node)))
32962
- addUpdateTargets(node.data?.variableUpdates, written);
32963
- addEndOutputTargets(node, written);
32964
- addHitlMapTargets(node, written);
32965
- }
32966
- return written;
32967
- }
32968
- var VARS_REF = /\$vars\.([A-Za-z_$][\w$]*)/g;
32969
- function getNodeType4(node) {
32970
- return node.data?.type ?? node.type ?? "";
32971
- }
32972
- function collectStrings(value, out) {
32973
- if (typeof value === "string") {
32974
- out.push(value);
32975
- } else if (Array.isArray(value)) {
32976
- for (const v of value)
32977
- collectStrings(v, out);
32978
- } else if (value && typeof value === "object") {
32979
- for (const v of Object.values(value))
32980
- collectStrings(v, out);
32981
- }
32982
- }
32983
- function collectBindingStrings(value, out) {
32984
- if (value == null)
32985
- return;
32986
- if (typeof value === "string") {
32987
- if (value.includes("{{"))
32988
- out.push(value);
32989
- } else if (isExpressionValue(value)) {
32990
- out.push(value.expression);
32991
- } else if (Array.isArray(value)) {
32992
- for (const v of value)
32993
- collectBindingStrings(v, out);
32994
- } else if (typeof value === "object") {
32995
- for (const v of Object.values(value))
32996
- collectBindingStrings(v, out);
32997
- }
32998
- }
32999
- var agentEmptyVarRule = {
33000
- id: "agent-empty-var",
33001
- severity: "warning",
33002
- validate(ctx) {
33003
- const orphanIds = collectOrphanGlobalIds(ctx);
33004
- if (orphanIds.size === 0)
33005
- return [];
33006
- const errors3 = [];
33007
- for (const agent of ctx.nodes.filter((n) => isAgentNodeType(getNodeType4(n)))) {
33008
- errors3.push(...emitEmptyVarWarnings(agent, collectAgentScanStrings(agent, ctx), orphanIds));
33009
- }
33010
- return errors3;
33011
- }
33012
- };
33013
- function collectOrphanGlobalIds(ctx) {
33014
- const globals = ctx.workflowVariables?.globals ?? [];
33015
- if (globals.length === 0)
33016
- return /* @__PURE__ */ new Set;
33017
- const written = collectWrittenGlobalIds(ctx.nodes, ctx.workflowVariables);
33018
- return new Set(globals.filter((g) => g.direction !== "in" && g.defaultValue === undefined && !written.has(g.id)).map((g) => g.id));
33019
- }
33020
- function collectAgentScanStrings(agent, ctx) {
33021
- const strings = [];
33022
- const inputs = agent.data?.inputs;
33023
- if (inputs) {
33024
- collectStrings(inputs.systemPrompt, strings);
33025
- collectStrings(inputs.userPrompt, strings);
33026
- }
33027
- const neighbourIds = /* @__PURE__ */ new Set;
33028
- for (const e of ctx.edges) {
33029
- if (e.source === agent.id && e.target)
33030
- neighbourIds.add(e.target);
33031
- else if (e.target === agent.id && e.source)
33032
- neighbourIds.add(e.source);
33033
- }
33034
- for (const n of ctx.nodes) {
33035
- if (!neighbourIds.has(n.id) || !isAgentResourceNodeType(getNodeType4(n)))
33036
- continue;
33037
- collectBindingStrings(n.data?.inputs, strings);
33038
- }
33039
- return strings;
33040
- }
33041
- function emitEmptyVarWarnings(agent, strings, orphanIds) {
33042
- const errors3 = [];
33043
- const flagged = /* @__PURE__ */ new Set;
33044
- for (const s of strings) {
33045
- VARS_REF.lastIndex = 0;
33046
- let match;
33047
- while ((match = VARS_REF.exec(s)) !== null) {
33048
- const root = match[1];
33049
- if (!orphanIds.has(root) || flagged.has(root))
33050
- continue;
33051
- flagged.add(root);
33052
- errors3.push({
33053
- code: "AGENT_INPUT_EMPTY_VAR",
33054
- ...localized("agentEmptyVar_unwrittenVariable_message", { root }, `Agent uses "$vars.{{root}}" but no node assigns a value to "{{root}}", so it will be empty at runtime. Bind it to a node output (e.g. a connector's "<node>.output") or give it a value source.`),
33055
- severity: "warning",
33056
- nodeId: agent.id,
33057
- layer: "field"
33058
- });
33059
- }
33060
- }
33061
- return errors3;
33062
- }
33063
- var VARS_REF_REGEX2 = /\$vars\.([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)/g;
33064
- function pathExistsOnOutputSchema(schema, segments) {
33065
- let cursor = schema;
33066
- for (let i = 0;i < segments.length; i++) {
33067
- const seg = segments[i];
33068
- if (cursor == null) {
33069
- return { valid: true };
33070
- }
33071
- if (typeof cursor !== "object") {
33072
- return { valid: false, missingSegment: seg, matchedDepth: i };
33073
- }
33074
- const obj = cursor;
33075
- let propsContainer;
33076
- let additionalProps;
33077
- const inlineProps = obj.properties;
33078
- if (inlineProps && typeof inlineProps === "object") {
33079
- propsContainer = inlineProps;
33080
- additionalProps = obj.additionalProperties;
33081
- } else if (obj.schema && typeof obj.schema === "object") {
33082
- const schemaObj = obj.schema;
33083
- const wrappedProps = schemaObj.properties;
33084
- if (wrappedProps && typeof wrappedProps === "object") {
33085
- propsContainer = wrappedProps;
33086
- additionalProps = schemaObj.additionalProperties;
33087
- }
33088
- }
33089
- if (!propsContainer) {
33090
- const declaredType = obj.type;
33091
- if (typeof declaredType === "string" && declaredType !== "object" && declaredType !== "array" && !obj.items) {
33092
- return { valid: false, missingSegment: seg, matchedDepth: i };
33093
- }
33094
- return { valid: true };
33095
- }
33096
- const next = propsContainer[seg];
33097
- if (next === undefined) {
33098
- if (additionalProps === false) {
33099
- return { valid: false, missingSegment: seg, matchedDepth: i };
31581
+ var ANALYZE_FILES_SCHEMA = {
31582
+ inputSchema: {
31583
+ type: "object",
31584
+ properties: {
31585
+ attachments: {
31586
+ type: "array",
31587
+ items: JobAttachmentSchema,
31588
+ description: "Array of files, documents, images, or other attachments to process"
31589
+ },
31590
+ analysisTask: {
31591
+ type: "string",
31592
+ description: "The task, question, or instruction for processing the files (e.g., 'summarize this document', 'extract key points', 'what is in this image')"
33100
31593
  }
33101
- return { valid: true };
33102
- }
33103
- cursor = next;
33104
- }
33105
- return { valid: true };
33106
- }
33107
- function* iterateJsExpressionBodies(value, pathPrefix) {
33108
- const body = getJsExpressionBody(value);
33109
- if (body !== undefined) {
33110
- yield { body, path: pathPrefix };
33111
- return;
33112
- }
33113
- if (isExpressionValue(value) || typeof value === "string")
33114
- return;
33115
- if (Array.isArray(value)) {
33116
- for (let i = 0;i < value.length; i++) {
33117
- yield* iterateJsExpressionBodies(value[i], `${pathPrefix}[${i}]`);
33118
- }
33119
- } else if (value && typeof value === "object") {
33120
- for (const [k, v] of Object.entries(value)) {
33121
- yield* iterateJsExpressionBodies(v, pathPrefix ? `${pathPrefix}.${k}` : k);
33122
- }
33123
- }
33124
- }
33125
- var expressionRefRule = {
33126
- id: "expression-ref",
33127
- severity: "error",
33128
- validate(ctx) {
33129
- const errors3 = [];
33130
- const knownRoots = /* @__PURE__ */ new Set;
33131
- for (const id of ctx.workflowVariableIds ?? [])
33132
- knownRoots.add(id);
33133
- const nodeIds = /* @__PURE__ */ new Set;
33134
- const nodesById = /* @__PURE__ */ new Map;
33135
- for (const node of ctx.nodes) {
33136
- knownRoots.add(node.id);
33137
- nodeIds.add(node.id);
33138
- nodesById.set(node.id, node);
33139
- }
33140
- const hasWorkflowVarsContext = ctx.workflowVariableIds !== undefined;
33141
- if (knownRoots.size === 0)
33142
- return errors3;
33143
- for (const node of ctx.nodes) {
33144
- const inputs = node.data?.inputs;
33145
- if (inputs == null || typeof inputs !== "object")
33146
- continue;
33147
- const nodeLabel = getNodeLabel(node, getManifestForNode(node, ctx.manifests));
33148
- for (const { body, path: fieldPath } of iterateJsExpressionBodies(inputs, "inputs")) {
33149
- VARS_REF_REGEX2.lastIndex = 0;
33150
- const seenInThisExpr = /* @__PURE__ */ new Set;
33151
- let match;
33152
- while ((match = VARS_REF_REGEX2.exec(body)) !== null) {
33153
- const fullRef = match[1];
33154
- if (seenInThisExpr.has(fullRef))
33155
- continue;
33156
- seenInThisExpr.add(fullRef);
33157
- const segments = fullRef.split(".");
33158
- const rootSegment = segments[0];
33159
- if (!knownRoots.has(rootSegment)) {
33160
- if (!hasWorkflowVarsContext)
33161
- continue;
33162
- errors3.push({
33163
- code: "EXPR_UNRESOLVED_REF",
33164
- message: `Expression in "${nodeLabel}" references "$vars.${rootSegment}" but no workflow variable or node "${rootSegment}" exists. Add the variable/node to the flow or remove the reference.`,
33165
- severity: "error",
33166
- nodeId: node.id,
33167
- fieldPath,
33168
- layer: "field"
33169
- });
33170
- continue;
33171
- }
33172
- if (!nodeIds.has(rootSegment) || segments.length < 2)
33173
- continue;
33174
- const producerNode = nodesById.get(rootSegment);
33175
- if (!producerNode)
33176
- continue;
33177
- const producerManifest = getManifestForNode(producerNode, ctx.manifests);
33178
- const outputDef = producerManifest?.outputDefinition;
33179
- if (!outputDef || typeof outputDef !== "object")
33180
- continue;
33181
- const outputVarName = segments[1];
33182
- const outputSchema = outputDef[outputVarName];
33183
- if (outputSchema === undefined) {
33184
- const available = Object.keys(outputDef);
33185
- errors3.push({
33186
- code: "EXPR_INVALID_OUTPUT_PATH",
33187
- message: `Expression in "${nodeLabel}" references "$vars.${fullRef}" but node "${rootSegment}" has no output named "${outputVarName}". Available outputs: ${available.length > 0 ? available.join(", ") : "(none)"}.`,
33188
- severity: "error",
33189
- nodeId: node.id,
33190
- fieldPath,
33191
- layer: "field"
33192
- });
33193
- continue;
33194
- }
33195
- if (segments.length < 3)
33196
- continue;
33197
- const deepPath = segments.slice(2);
33198
- const result = pathExistsOnOutputSchema(outputSchema, deepPath);
33199
- if (!result.valid) {
33200
- const matchedSoFar = [outputVarName, ...deepPath.slice(0, result.matchedDepth ?? 0)].join(".");
33201
- errors3.push({
33202
- code: "EXPR_INVALID_OUTPUT_PATH",
33203
- message: `Expression in "${nodeLabel}" references "$vars.${fullRef}" but field "${result.missingSegment}" is not declared on node "${rootSegment}"'s output schema (matched up to "${matchedSoFar}").`,
33204
- severity: "error",
33205
- nodeId: node.id,
33206
- fieldPath,
33207
- layer: "field"
33208
- });
33209
- }
33210
- }
31594
+ },
31595
+ required: ["attachments", "analysisTask"]
31596
+ },
31597
+ outputSchema: {
31598
+ type: "object",
31599
+ properties: {
31600
+ analysis: {
31601
+ type: "string",
31602
+ description: "Analysis result of the attachments (analysis, summary, extracted information, etc.)"
33211
31603
  }
33212
- }
33213
- return errors3;
33214
- }
33215
- };
33216
- var conversationalRequiredFieldsRule = {
33217
- id: "conversational-required-fields",
33218
- severity: "error",
33219
- validate(ctx) {
33220
- const errors3 = [];
33221
- for (const node of ctx.nodes) {
33222
- if (!isConversationalAgentNode(node))
33223
- continue;
33224
- const inputs = node.data.inputs ?? {};
33225
- if (isVoiceAgentNodeType(node.type))
33226
- continue;
33227
- const settings = inputs.conversationalAgentSettings ?? {};
33228
- const isEmpty = readStringField(settings.conversationId).trim() === "";
33229
- if (!isEmpty)
33230
- continue;
33231
- const manifest = getManifestForNode(node, ctx.manifests);
33232
- const label = getNodeLabel(node, manifest);
33233
- errors3.push({
33234
- code: "CONVERSATIONAL_CONVERSATION_ID_REQUIRED",
33235
- message: `${label}: Conversation ID is required`,
33236
- severity: "error",
33237
- nodeId: node.id,
33238
- fieldPath: "inputs.conversationalAgentSettings.conversationId",
33239
- layer: "node"
33240
- });
33241
- }
33242
- return errors3;
31604
+ },
31605
+ required: ["analysis"]
33243
31606
  }
33244
31607
  };
33245
- var conversationalVoiceCallContextRule = {
33246
- id: "conversational-voice-call-context",
33247
- severity: "error",
33248
- validate(ctx) {
33249
- const errors3 = [];
33250
- for (const node of ctx.nodes) {
33251
- const inputs = node.data.inputs ?? {};
33252
- if (!isVoiceAgentNodeType(node.type))
33253
- continue;
33254
- const manifest = getManifestForNode(node, ctx.manifests);
33255
- const label = getNodeLabel(node, manifest);
33256
- if (isCallContextEmpty(inputs.callContext)) {
33257
- errors3.push({
33258
- code: "CONVERSATIONAL_VOICE_CALL_CONTEXT_REQUIRED",
33259
- ...localized("conversationalVoice_callContextRequired_message", { label }, "{{label}}: Call context is required when voice is enabled"),
33260
- severity: "error",
33261
- nodeId: node.id,
33262
- fieldPath: "inputs.callContext",
33263
- layer: "node"
33264
- });
33265
- continue;
31608
+ var SUMMARIZE_SCHEMA = {
31609
+ inputSchema: {
31610
+ type: "object",
31611
+ properties: {
31612
+ attachment: {
31613
+ type: "object",
31614
+ title: "Source",
31615
+ description: "File or document to summarize",
31616
+ properties: JobAttachmentSchema.properties,
31617
+ required: JobAttachmentSchema.required
33266
31618
  }
33267
- if (!isValidCallContextBinding(inputs.callContext)) {
33268
- errors3.push({
33269
- code: "CONVERSATIONAL_VOICE_CALL_CONTEXT_INVALID",
33270
- ...localized("conversationalVoice_callContextInvalid_message", { label }, "{{label}}: Call context must be bound to a call context object"),
33271
- severity: "error",
33272
- nodeId: node.id,
33273
- fieldPath: "inputs.callContext",
33274
- layer: "node"
33275
- });
31619
+ },
31620
+ required: ["attachment"]
31621
+ },
31622
+ outputSchema: {
31623
+ type: "array",
31624
+ items: {
31625
+ type: "object",
31626
+ properties: {
31627
+ content: {
31628
+ type: "string",
31629
+ description: "The content of the analyzed attachment"
31630
+ }
33276
31631
  }
33277
31632
  }
33278
- return errors3;
33279
31633
  }
33280
31634
  };
33281
- var conversationalVoiceEndCallContextRule = {
33282
- id: "conversational-voice-end-call-context",
33283
- severity: "error",
33284
- validate(ctx) {
33285
- const errors3 = [];
33286
- for (const node of ctx.nodes) {
33287
- if (node.type !== CONVERSATIONAL_VOICE_END_CALL_NODE_TYPE)
33288
- continue;
33289
- const manifest = getManifestForNode(node, ctx.manifests);
33290
- if (!manifest || !manifestExposesCallContext(manifest))
33291
- continue;
33292
- const inputs = node.data.inputs ?? {};
33293
- if (isValidCallContextBinding(inputs.callContext))
33294
- continue;
33295
- const label = getNodeLabel(node, manifest);
33296
- errors3.push({
33297
- code: "CONVERSATIONAL_VOICE_END_CALL_CONTEXT_INVALID",
33298
- ...localized("conversationalVoiceEndCall_callContextInvalid_message", { label }, "{{label}}: Call context must be bound to a call context object"),
33299
- severity: "error",
33300
- nodeId: node.id,
33301
- fieldPath: "inputs.callContext",
33302
- layer: "node"
33303
- });
33304
- }
33305
- return errors3;
33306
- }
33307
- };
33308
- var agentOutputRequiredRule = {
33309
- id: "agent-output-required",
33310
- severity: "error",
33311
- validate(ctx) {
33312
- const errors3 = [];
33313
- for (const node of ctx.nodes) {
33314
- if (!isAutonomousAgentNodeType(node.type))
33315
- continue;
33316
- const inputs = node.data.inputs ?? {};
33317
- const outputs = inputs.agentOutputVariables;
33318
- if (Array.isArray(outputs) && outputs.length > 0)
33319
- continue;
33320
- const manifest = getManifestForNode(node, ctx.manifests);
33321
- const label = getNodeLabel(node, manifest);
33322
- errors3.push({
33323
- code: "AGENT_OUTPUT_REQUIRED",
33324
- message: `${label}: Agent must define at least one output variable`,
33325
- severity: "error",
33326
- nodeId: node.id,
33327
- fieldPath: "inputs.agentOutputVariables",
33328
- layer: "node"
33329
- });
33330
- }
33331
- return errors3;
33332
- }
33333
- };
33334
- var t10 = instance.getFixedT(null, VALIDATION_NAMESPACE);
33335
- function localized9(key, params, defaultValue) {
33336
- return {
33337
- message: t10(key, { ...params, defaultValue }),
33338
- i18n: { key, params, ns: VALIDATION_NAMESPACE }
33339
- };
33340
- }
33341
- var hitlQuickFormRule = {
33342
- id: "hitl-quick-form",
33343
- severity: "error",
33344
- validate(ctx) {
33345
- const errors3 = [];
33346
- for (const node of ctx.nodes) {
33347
- const nodeType2 = node.data?.type ?? node.type ?? "";
33348
- if (nodeType2 !== HITL_QUICK_FORM_NODE_TYPE && nodeType2 !== FORM_TRIGGER_NODE_TYPE)
33349
- continue;
33350
- const inputs = node.data?.inputs;
33351
- const schema = inputs?.schema;
33352
- const fields = Array.isArray(schema?.fields) ? schema.fields : [];
33353
- if (fields.length === 0) {
33354
- errors3.push({
33355
- code: "HITL_QUICK_FORM_EMPTY_SCHEMA",
33356
- ...localized9("hitlQuickForm_emptySchema_message", {}, "Add at least one field"),
33357
- severity: "error",
33358
- nodeId: node.id,
33359
- fieldPath: "inputs.schema",
33360
- layer: "field"
33361
- });
33362
- continue;
31635
+ var BATCH_TRANSFORM_SCHEMA = {
31636
+ inputSchema: {
31637
+ type: "object",
31638
+ properties: {
31639
+ attachment: {
31640
+ type: "object",
31641
+ title: "Source",
31642
+ description: "CSV file to transform",
31643
+ properties: JobAttachmentSchema.properties,
31644
+ required: JobAttachmentSchema.required
33363
31645
  }
33364
- fields.forEach((field, index) => {
33365
- const label = field && typeof field === "object" && !Array.isArray(field) ? field.label : undefined;
33366
- if (!readStringField(label).trim()) {
33367
- errors3.push({
33368
- code: "HITL_QUICK_FORM_FIELD_LABEL_REQUIRED",
33369
- ...localized9("hitlQuickForm_fieldLabelRequired_message", {}, "Field label is required"),
33370
- severity: "error",
33371
- nodeId: node.id,
33372
- fieldPath: `inputs.schema.fields[${index}].label`,
33373
- layer: "field"
33374
- });
31646
+ },
31647
+ required: ["attachment"]
31648
+ },
31649
+ outputSchema: {
31650
+ type: "array",
31651
+ items: {
31652
+ type: "object",
31653
+ properties: {
31654
+ content: {
31655
+ type: "string",
31656
+ description: "The content of the transformed row"
33375
31657
  }
33376
- });
31658
+ }
33377
31659
  }
33378
- return errors3;
33379
31660
  }
33380
31661
  };
33381
- var hitlCompletedRule = {
33382
- id: "hitl-completed",
33383
- severity: "warning",
33384
- validate(ctx) {
33385
- const errors3 = [];
33386
- for (const node of ctx.nodes) {
33387
- const nodeType2 = node.data?.type ?? node.type ?? "";
33388
- if (!isHitlNodeType(nodeType2))
33389
- continue;
33390
- const hasOutgoingEdge = ctx.edges.some((e) => e.source === node.id && (e.sourceHandle === "completed" || e.sourceHandle?.startsWith("outcome-")));
33391
- if (hasOutgoingEdge)
33392
- continue;
33393
- errors3.push({
33394
- code: "HITL_COMPLETED_UNWIRED",
33395
- message: `HITL node "${node.id}" has no outgoing edge. The runtime stalls indefinitely if no outcome is wired.`,
33396
- severity: "warning",
33397
- nodeId: node.id,
33398
- fieldPath: "handles",
33399
- layer: "node"
33400
- });
31662
+ var nameValuePairSchema = (nameDescription, valueDescription) => ({
31663
+ type: "object",
31664
+ properties: {
31665
+ name: {
31666
+ type: "string",
31667
+ description: nameDescription
31668
+ },
31669
+ value: {
31670
+ type: "string",
31671
+ description: valueDescription
33401
31672
  }
33402
- return errors3;
33403
- }
33404
- };
33405
- var t11 = instance.getFixedT(null, VALIDATION_NAMESPACE);
33406
- function localized10(key, defaultValue) {
33407
- return {
33408
- message: t11(key, { defaultValue }),
33409
- i18n: { key, params: {}, ns: VALIDATION_NAMESPACE }
33410
- };
33411
- }
33412
- var CUSTOM_RENDER_TYPE = "custom";
33413
- var hitlDocValidationRule = {
33414
- id: "hitl-doc-validation",
33415
- severity: "error",
33416
- validate(ctx) {
33417
- const errors3 = [];
33418
- for (const node of ctx.nodes) {
33419
- const nodeType2 = node.data?.type ?? node.type ?? "";
33420
- if (nodeType2 !== HITL_DOC_VALIDATION_NODE_TYPE)
33421
- continue;
33422
- const inputs = node.data?.inputs;
33423
- const renderType = inputs?.["validationRenderType"];
33424
- const extractionResult = readStringField(inputs?.["extractionResult"]).trim();
33425
- if (!extractionResult) {
33426
- errors3.push({
33427
- code: "HITL_DOC_VALIDATION_EXTRACTION_RESULT_REQUIRED",
33428
- ...localized10("hitlDocValidation_extractionResultRequired_message", "Extraction result is required"),
33429
- severity: "error",
33430
- nodeId: node.id,
33431
- fieldPath: "inputs.extractionResult",
33432
- layer: "field"
33433
- });
33434
- }
33435
- if (renderType === CUSTOM_RENDER_TYPE) {
33436
- const taxonomy = readStringField(inputs?.["taxonomy"]).trim();
33437
- if (!taxonomy) {
33438
- errors3.push({
33439
- code: "HITL_DOC_VALIDATION_TAXONOMY_REQUIRED",
33440
- ...localized10("hitlDocValidation_taxonomyRequired_message", "Taxonomy is required when using a custom app"),
33441
- severity: "error",
33442
- nodeId: node.id,
33443
- fieldPath: "inputs.taxonomy",
33444
- layer: "field"
33445
- });
33446
- }
31673
+ },
31674
+ required: ["name", "value"]
31675
+ });
31676
+ var HTTP_REQUEST_SCHEMA = {
31677
+ inputSchema: {
31678
+ type: "object",
31679
+ properties: {
31680
+ url: {
31681
+ type: "string",
31682
+ description: "The absolute URL to send the request to."
31683
+ },
31684
+ method: {
31685
+ type: "string",
31686
+ description: "HTTP method to use, one of: GET, POST, PUT, PATCH, DELETE."
31687
+ },
31688
+ headers: {
31689
+ type: "array",
31690
+ description: "Request headers as a list of name/value pairs.",
31691
+ items: nameValuePairSchema("Header name.", "Header value.")
31692
+ },
31693
+ params: {
31694
+ type: "array",
31695
+ description: "Query-string parameters as a list of name/value pairs.",
31696
+ items: nameValuePairSchema("Parameter name.", "Parameter value.")
31697
+ },
31698
+ body: {
31699
+ type: "string",
31700
+ description: "Request body sent as-is. Provide JSON as a string and set a Content-Type header if the endpoint expects JSON."
31701
+ },
31702
+ timeout: {
31703
+ type: "number",
31704
+ description: "Request timeout in seconds."
33447
31705
  }
33448
- }
33449
- return errors3;
33450
- }
33451
- };
33452
- var IXP_SCHEMA_EDITOR_DRAFT_EXTENSION = "x-uipath-schema-editor-draft";
33453
- var IXP_SCHEMA_EDITOR_ISSUES_EXTENSION = "x-uipath-schema-editor-issues";
33454
- var IXP_SCHEMA_INVALID_ERROR_CODE = "IXP_SCHEMA_INVALID";
33455
- function asRecord(value) {
33456
- return value !== null && typeof value === "object" && !Array.isArray(value) ? value : undefined;
33457
- }
33458
- function readIxpSchemaEditorDraft(value) {
33459
- const schema = asRecord(value);
33460
- if (!schema || !Object.hasOwn(schema, IXP_SCHEMA_EDITOR_DRAFT_EXTENSION)) {
33461
- return;
33462
- }
33463
- const rawIssues = schema[IXP_SCHEMA_EDITOR_ISSUES_EXTENSION];
33464
- const issues = Array.isArray(rawIssues) ? rawIssues : [];
33465
- const issueMessages = issues.flatMap((issue2) => {
33466
- const message = asRecord(issue2)?.message;
33467
- return typeof message === "string" && message.trim().length > 0 ? [message.trim()] : [];
33468
- });
33469
- return {
33470
- draft: schema[IXP_SCHEMA_EDITOR_DRAFT_EXTENSION],
33471
- issues,
33472
- issueMessages
33473
- };
33474
- }
33475
- function createSchemaDraftError(node, nodeLabel, detail) {
33476
- const localization = detail ? localized("ixpSchemaDraft_invalidWithDetail_message", { nodeLabel, detail }, 'Schema is not valid on "{{nodeLabel}}": {{detail}}') : localized("ixpSchemaDraft_invalid_message", { nodeLabel }, 'Schema is not valid on "{{nodeLabel}}".');
33477
- return {
33478
- code: IXP_SCHEMA_INVALID_ERROR_CODE,
33479
- ...localization,
33480
- severity: "error",
33481
- nodeId: node.id,
33482
- nodeLabel,
33483
- layer: "node"
33484
- };
33485
- }
33486
- function validateNodeSchemaDraft(node, ctx) {
33487
- const nodeType2 = node.data?.type ?? node.type ?? "";
33488
- if (nodeType2 !== DYNAMIC_EXTRACT_NODE_TYPE)
33489
- return [];
33490
- const inputs = node.data?.inputs;
33491
- const editorDraft = readIxpSchemaEditorDraft(inputs?.schemaDocument);
33492
- if (!editorDraft)
33493
- return [];
33494
- const manifest = getManifestForNode(node, ctx.manifests);
33495
- const nodeLabel = getNodeLabel(node, manifest);
33496
- const details = editorDraft.issueMessages.length > 0 ? editorDraft.issueMessages : [undefined];
33497
- return details.map((detail) => createSchemaDraftError(node, nodeLabel, detail));
33498
- }
33499
- var ixpSchemaDraftRule = {
33500
- id: "ixp-schema-draft",
33501
- severity: "error",
33502
- validate(ctx) {
33503
- return ctx.nodes.flatMap((node) => validateNodeSchemaDraft(node, ctx));
31706
+ },
31707
+ required: ["url"]
31708
+ },
31709
+ outputSchema: {
31710
+ type: "object",
31711
+ properties: {}
33504
31712
  }
33505
31713
  };
33506
- var SCRIPT_NODE_TYPES = /* @__PURE__ */ new Set(["core.action.script"]);
33507
- var scriptMustacheRule = {
33508
- id: "script-mustache",
33509
- severity: "warning",
33510
- validate(ctx) {
33511
- const errors3 = [];
33512
- for (const node of ctx.nodes) {
33513
- const inputs = node.data.inputs ?? {};
33514
- let fieldPath;
33515
- if (SCRIPT_NODE_TYPES.has(node.type)) {
33516
- if (hasMustacheInterpolation(readStringField(inputs.script))) {
33517
- fieldPath = "inputs.script";
33518
- }
33519
- } else if (TRANSFORM_NODE_TYPES.has(node.type)) {
33520
- const operations = Array.isArray(inputs.operations) ? inputs.operations : [];
33521
- if (operations.some((op) => op?.type === "customScript" && hasMustacheInterpolation(readStringField(op.config?.script)))) {
33522
- fieldPath = "inputs.operations";
33523
- }
33524
- }
33525
- if (fieldPath) {
33526
- errors3.push({
33527
- code: "SCRIPT_MUSTACHE_SYNTAX",
33528
- ...localized("scriptBody_mustache_message", {}, "Reference variables directly without double braces"),
33529
- severity: "warning",
33530
- nodeId: node.id,
33531
- fieldPath,
33532
- layer: "field"
33533
- });
33534
- }
33535
- }
33536
- return errors3;
33537
- }
31714
+ var BUILT_IN_TOOL_SCHEMAS = {
31715
+ "uipath.agent.resource.tool.builtin.analyzefiles": ANALYZE_FILES_SCHEMA,
31716
+ "uipath.agent.resource.tool.builtin.summarize": SUMMARIZE_SCHEMA,
31717
+ "uipath.agent.resource.tool.builtin.batchtransform": BATCH_TRANSFORM_SCHEMA,
31718
+ "uipath.agent.resource.tool.builtin.httprequest": HTTP_REQUEST_SCHEMA
33538
31719
  };
33539
- function getNodeType5(node) {
33540
- return node.data?.type ?? node.type ?? "";
31720
+ var FILE_SCHEMA_FIELDS = Object.keys(JobAttachmentSchema.properties ?? {});
31721
+ function isFileShapedInputNode(node) {
31722
+ if (!node || typeof node !== "object")
31723
+ return false;
31724
+ const n = node;
31725
+ if (n["x-uipath-resource-kind"] === "JobAttachment")
31726
+ return true;
31727
+ if (typeof n.$ref === "string" && n.$ref.toLowerCase().includes("job-attachment"))
31728
+ return true;
31729
+ if (n.type === "file" || n.type === "octet-stream")
31730
+ return true;
31731
+ if (n.properties && FILE_SCHEMA_FIELDS.every((field) => (field in n.properties)))
31732
+ return true;
31733
+ return isFileShapedInputNode(n.items);
33541
31734
  }
33542
- var singleConversationTriggerRule = {
33543
- id: "single-conversation-trigger",
33544
- severity: "error",
33545
- validate(ctx) {
33546
- const triggers = ctx.nodes.filter((n) => getNodeType5(n) === "core.trigger.conversation");
33547
- if (triggers.length <= 1)
33548
- return [];
33549
- return triggers.map((node) => ({
33550
- code: "SINGLE_CONVERSATION_TRIGGER",
33551
- ...localized("singleConversationTrigger_message", {}, "Only one conversation trigger is allowed per process. Remove the extra trigger."),
33552
- severity: "error",
33553
- nodeId: node.id,
33554
- layer: "node"
33555
- }));
33556
- }
33557
- };
33558
- var t12 = instance.getFixedT(null, VALIDATION_NAMESPACE);
33559
- function localized11(key, params, defaultValue) {
33560
- return {
33561
- message: t12(key, { ...params, defaultValue }),
33562
- i18n: { key, params, ns: VALIDATION_NAMESPACE }
33563
- };
31735
+ function schemaAcceptsFileInput(inputSchema) {
31736
+ const properties = inputSchema?.properties;
31737
+ if (!properties)
31738
+ return false;
31739
+ return Object.values(properties).some(isFileShapedInputNode);
33564
31740
  }
33565
- var doWhileLimitRule = {
33566
- id: "dowhile-limit",
33567
- severity: "error",
33568
- validate(ctx) {
33569
- const errors3 = [];
33570
- for (const node of ctx.nodes) {
33571
- const nodeType2 = node.data?.type ?? node.type ?? "";
33572
- if (nodeType2 !== DOWHILE_NODE_TYPE)
33573
- continue;
33574
- const inputs = node.data?.inputs;
33575
- const limit = parseDoWhileLimit(inputs?.limit);
33576
- if (limit === undefined)
33577
- continue;
33578
- if (!Number.isInteger(limit) || limit < DOWHILE_MIN_LIMIT || limit > DOWHILE_MAX_LIMIT) {
33579
- errors3.push({
33580
- code: "DOWHILE_LIMIT_OUT_OF_RANGE",
33581
- ...localized11("doWhile_limitOutOfRange_message", { min: DOWHILE_MIN_LIMIT, max: DOWHILE_MAX_LIMIT }, `Set maximum iterations between ${DOWHILE_MIN_LIMIT} and ${DOWHILE_MAX_LIMIT}`),
33582
- severity: "error",
33583
- nodeId: node.id,
33584
- fieldPath: "inputs.limit",
33585
- layer: "field"
33586
- });
33587
- }
33588
- }
33589
- return errors3;
33590
- }
33591
- };
33592
- var generalRules = [
33593
- schemaValidationRule,
33594
- minConnectionsRule,
33595
- triggerRequiredRule,
33596
- outputMappingRule,
33597
- dataTransformRule,
33598
- governanceRule,
33599
- escalationValidationRule,
33600
- agentInputRefsRule,
33601
- agentDuplicateToolNamesRule,
33602
- agentEmptyVarRule,
33603
- conversationalRequiredFieldsRule,
33604
- conversationalVoiceCallContextRule,
33605
- conversationalVoiceEndCallContextRule,
33606
- agentOutputRequiredRule,
33607
- hitlQuickFormRule,
33608
- hitlCompletedRule,
33609
- hitlDocValidationRule,
33610
- ixpSchemaDraftRule,
33611
- scriptMustacheRule,
33612
- singleConversationTriggerRule,
33613
- doWhileLimitRule
33614
- ];
33615
- var cliRules = [...generalRules, expressionRefRule];
31741
+ var FILE_CAPABLE_BUILTIN_TOOL_TYPES = new Set(Object.entries(BUILT_IN_TOOL_SCHEMAS).filter(([, schemas3]) => schemaAcceptsFileInput(schemas3.inputSchema)).map(([nodeType2]) => nodeType2));
31742
+ var t10 = instance.getFixedT(null, VALIDATION_NAMESPACE);
31743
+ var t11 = instance.getFixedT(null, VALIDATION_NAMESPACE);
31744
+ var t12 = instance.getFixedT(null, VALIDATION_NAMESPACE);
33616
31745
 
33617
31746
  // ../../node_modules/@uipath/flow-schema/dist/index.js
33618
31747
  var import_object = __toESM(require_index_cjs(), 1);
@@ -33936,6 +32065,7 @@ var nodeSchema2 = nodeSchema.extend({
33936
32065
  typeVersion: exports_external.string().regex(/^\d+\.\d+(\.\d+)?$/, 'Version must be in format "x.y" or "x.y.z"')
33937
32066
  });
33938
32067
  var nodeManifestSchema2 = exports_external.lazy(() => nodeManifestSchema.extend({
32068
+ display: nodeDisplayManifestSchema.extend({ isPreview: exports_external.boolean().optional() }),
33939
32069
  projectId: exports_external.string().optional(),
33940
32070
  entryPointPath: exports_external.string().optional(),
33941
32071
  unsupportedRuntime: exports_external.boolean().optional(),
@@ -34160,6 +32290,8 @@ var CRON_TOKEN = "(?:\\d+[LW]?|[A-Z]{3}|LW|L|W|\\?|\\*)";
34160
32290
  var CRON_FIELD = `${CRON_TOKEN}(?:[,/#-]${CRON_TOKEN})*`;
34161
32291
  var QUARTZ_CRON_RE = new RegExp(`^\\s*${CRON_FIELD}(?:\\s+${CRON_FIELD}){5,6}\\s*$`);
34162
32292
  var FORM_TRIGGER_RESOURCE = "FormTrigger";
32293
+ var JOB_ATTACHMENT_DEFINITION_KEY = "job-attachment";
32294
+ var JOB_ATTACHMENT_REF = `#/definitions/${JOB_ATTACHMENT_DEFINITION_KEY}`;
34163
32295
  var mergeBindingResources = (resources) => {
34164
32296
  const seen = /* @__PURE__ */ new Map;
34165
32297
  const result = [];
@@ -34215,138 +32347,6 @@ var DEFAULT_CONVERSATIONAL_VOICE_SETTINGS = {
34215
32347
  persona: DEFAULT_CONVERSATIONAL_VOICE_MODEL_ENTRY.personas[0],
34216
32348
  agentSpeaksFirst: DEFAULT_VOICE_AGENT_SPEAKS_FIRST
34217
32349
  };
34218
- var JobAttachmentSchema = {
34219
- type: "object",
34220
- "x-uipath-resource-kind": "JobAttachment",
34221
- properties: {
34222
- ID: {
34223
- type: "string",
34224
- description: "Orchestrator attachment key"
34225
- },
34226
- FullName: {
34227
- type: "string",
34228
- description: "File name"
34229
- },
34230
- MimeType: {
34231
- type: "string",
34232
- description: 'The MIME type of the content, such as "application/json" or "image/png"'
34233
- },
34234
- Metadata: {
34235
- type: "object",
34236
- description: "Dictionary of metadata",
34237
- additionalProperties: {
34238
- type: "string"
34239
- }
34240
- }
34241
- },
34242
- required: ["ID"]
34243
- };
34244
- var SUMMARIZE_SCHEMA = {
34245
- inputSchema: {
34246
- type: "object",
34247
- properties: {
34248
- attachment: {
34249
- type: "object",
34250
- title: "Source",
34251
- description: "File or document to summarize",
34252
- properties: JobAttachmentSchema.properties,
34253
- required: JobAttachmentSchema.required
34254
- }
34255
- },
34256
- required: ["attachment"]
34257
- },
34258
- outputSchema: {
34259
- type: "array",
34260
- items: {
34261
- type: "object",
34262
- properties: {
34263
- content: {
34264
- type: "string",
34265
- description: "The content of the analyzed attachment"
34266
- }
34267
- }
34268
- }
34269
- }
34270
- };
34271
- var BATCH_TRANSFORM_SCHEMA = {
34272
- inputSchema: {
34273
- type: "object",
34274
- properties: {
34275
- attachment: {
34276
- type: "object",
34277
- title: "Source",
34278
- description: "CSV file to transform",
34279
- properties: JobAttachmentSchema.properties,
34280
- required: JobAttachmentSchema.required
34281
- }
34282
- },
34283
- required: ["attachment"]
34284
- },
34285
- outputSchema: {
34286
- type: "array",
34287
- items: {
34288
- type: "object",
34289
- properties: {
34290
- content: {
34291
- type: "string",
34292
- description: "The content of the transformed row"
34293
- }
34294
- }
34295
- }
34296
- }
34297
- };
34298
- var nameValuePairSchema = (nameDescription, valueDescription) => ({
34299
- type: "object",
34300
- properties: {
34301
- name: {
34302
- type: "string",
34303
- description: nameDescription
34304
- },
34305
- value: {
34306
- type: "string",
34307
- description: valueDescription
34308
- }
34309
- },
34310
- required: ["name", "value"]
34311
- });
34312
- var HTTP_REQUEST_SCHEMA = {
34313
- inputSchema: {
34314
- type: "object",
34315
- properties: {
34316
- url: {
34317
- type: "string",
34318
- description: "The absolute URL to send the request to."
34319
- },
34320
- method: {
34321
- type: "string",
34322
- description: "HTTP method to use, one of: GET, POST, PUT, PATCH, DELETE."
34323
- },
34324
- headers: {
34325
- type: "array",
34326
- description: "Request headers as a list of name/value pairs.",
34327
- items: nameValuePairSchema("Header name.", "Header value.")
34328
- },
34329
- params: {
34330
- type: "array",
34331
- description: "Query-string parameters as a list of name/value pairs.",
34332
- items: nameValuePairSchema("Parameter name.", "Parameter value.")
34333
- },
34334
- body: {
34335
- type: "string",
34336
- description: "Request body sent as-is. Provide JSON as a string and set a Content-Type header if the endpoint expects JSON."
34337
- },
34338
- timeout: {
34339
- type: "number",
34340
- description: "Request timeout in seconds."
34341
- }
34342
- },
34343
- required: ["url"]
34344
- },
34345
- outputSchema: {
34346
- type: "object",
34347
- properties: {}
34348
- }
34349
- };
34350
32350
 
34351
32351
  // ../../node_modules/@uipath/tool-agent/dist/agent-bindings.js
34352
32352
  function generateBindings2(agent, resources, features) {
@@ -35285,7 +33285,7 @@ class TextApiResponse {
35285
33285
  var package_default3 = {
35286
33286
  name: "@uipath/integrationservice-sdk",
35287
33287
  license: "SEE LICENSE IN LICENSE.txt",
35288
- version: "1.202.0",
33288
+ version: "1.202.1-preview.168",
35289
33289
  repository: {
35290
33290
  type: "git",
35291
33291
  url: "https://github.com/UiPath/cli.git",
@@ -43106,6 +41106,21 @@ var KNOWN_CATEGORIES = [
43106
41106
  "code",
43107
41107
  "general"
43108
41108
  ];
41109
+ var GRADES = [
41110
+ "A+",
41111
+ "A",
41112
+ "A-",
41113
+ "B+",
41114
+ "B",
41115
+ "B-",
41116
+ "C+",
41117
+ "C",
41118
+ "C-",
41119
+ "D+",
41120
+ "D",
41121
+ "D-",
41122
+ "F"
41123
+ ];
43109
41124
  function listCategories() {
43110
41125
  return [...KNOWN_CATEGORIES];
43111
41126
  }
@@ -44960,6 +42975,116 @@ function buildInvalidAgentJsonIssue(loaded) {
44960
42975
  suggestedFix: "Verify agent.json exists and is valid, properly encoded JSON."
44961
42976
  };
44962
42977
  }
42978
+ var REVIEW_HISTORY_FILE = "review-history.json";
42979
+ var MAX_REVIEW_HISTORY_ENTRIES = 25;
42980
+ var isGrade = (value) => typeof value === "string" && GRADES.includes(value);
42981
+ var validateEntry = (entry, index) => {
42982
+ if (typeof entry !== "object" || entry === null) {
42983
+ return `[${index}]: expected an object`;
42984
+ }
42985
+ const { grade, runAt, errors: errors3, warnings } = entry;
42986
+ if (!isGrade(grade)) {
42987
+ return `[${index}].grade: expected one of ${GRADES.join(", ")}`;
42988
+ }
42989
+ if (typeof runAt !== "string") {
42990
+ return `[${index}].runAt: expected a string`;
42991
+ }
42992
+ for (const [name, count] of [
42993
+ ["errors", errors3],
42994
+ ["warnings", warnings]
42995
+ ]) {
42996
+ if (count !== undefined && typeof count !== "number") {
42997
+ return `[${index}].${name}: expected a number`;
42998
+ }
42999
+ }
43000
+ return;
43001
+ };
43002
+ var parseHistory = (raw) => {
43003
+ let parsed;
43004
+ try {
43005
+ parsed = JSON.parse(raw);
43006
+ } catch (err2) {
43007
+ const message = err2 instanceof Error ? err2.message : String(err2);
43008
+ return { success: false, error: `invalid JSON: ${message}` };
43009
+ }
43010
+ if (!Array.isArray(parsed)) {
43011
+ return { success: false, error: "expected a JSON array of entries" };
43012
+ }
43013
+ for (const [index, entry] of parsed.entries()) {
43014
+ const error51 = validateEntry(entry, index);
43015
+ if (error51 !== undefined) {
43016
+ return { success: false, error: error51 };
43017
+ }
43018
+ }
43019
+ return { success: true, data: parsed };
43020
+ };
43021
+ var parseRunAt = (entry) => {
43022
+ const time3 = Date.parse(entry.runAt);
43023
+ return Number.isNaN(time3) ? Number.NEGATIVE_INFINITY : time3;
43024
+ };
43025
+ var writeAtomically = async (file2, content, fs7) => {
43026
+ const tempFile = `${file2}.${globalThis.crypto.randomUUID()}.tmp`;
43027
+ try {
43028
+ await fs7.writeFile(tempFile, content);
43029
+ await fs7.rename(tempFile, file2);
43030
+ } catch (err2) {
43031
+ await fs7.rm(tempFile).catch(() => {
43032
+ return;
43033
+ });
43034
+ throw err2;
43035
+ }
43036
+ };
43037
+ var appendEntry = async (file2, grade, input, fs7) => {
43038
+ let history = [];
43039
+ const raw = await fs7.readFile(file2, "utf-8");
43040
+ if (raw !== null) {
43041
+ const parsed = parseHistory(raw);
43042
+ if (!parsed.success) {
43043
+ return {
43044
+ ok: false,
43045
+ error: "MALFORMED_HISTORY",
43046
+ file: file2,
43047
+ detail: parsed.error
43048
+ };
43049
+ }
43050
+ history = parsed.data;
43051
+ }
43052
+ const entry = {
43053
+ grade,
43054
+ runAt: new Date().toISOString(),
43055
+ ...input.errors !== undefined && { errors: input.errors },
43056
+ ...input.warnings !== undefined && { warnings: input.warnings }
43057
+ };
43058
+ const newTime = Date.parse(entry.runAt);
43059
+ let index = 0;
43060
+ while (index < history.length && parseRunAt(history[index]) > newTime) {
43061
+ index++;
43062
+ }
43063
+ history.splice(index, 0, entry);
43064
+ if (history.length > MAX_REVIEW_HISTORY_ENTRIES) {
43065
+ history.length = MAX_REVIEW_HISTORY_ENTRIES;
43066
+ }
43067
+ await writeAtomically(file2, `${JSON.stringify(history, null, 2)}
43068
+ `, fs7);
43069
+ return { ok: true, entry, history };
43070
+ };
43071
+ var recordReview = async (projectPath, input, fs7) => {
43072
+ const grade = input.grade.toUpperCase();
43073
+ if (!isGrade(grade)) {
43074
+ return { ok: false, error: "INVALID_GRADE", allowed: GRADES };
43075
+ }
43076
+ const stats = await fs7.stat(projectPath);
43077
+ if (!stats?.isDirectory()) {
43078
+ return { ok: false, error: "NOT_A_DIRECTORY", projectPath };
43079
+ }
43080
+ const file2 = fs7.path.join(projectPath, REVIEW_HISTORY_FILE);
43081
+ const release = await fs7.acquireLock(file2);
43082
+ try {
43083
+ return await appendEntry(file2, grade, input, fs7);
43084
+ } finally {
43085
+ await release();
43086
+ }
43087
+ };
44963
43088
 
44964
43089
  // src/services/guardrail-catalog-service.ts
44965
43090
  var LLM_AS_JUDGE_VALIDATOR = "llm_as_judge";
@@ -45146,6 +43271,122 @@ var registerReviewCommand = (program) => {
45146
43271
  });
45147
43272
  };
45148
43273
 
43274
+ // src/commands/review-history.ts
43275
+ var CODES2 = {
43276
+ success: "AgentReviewHistoryAdd",
43277
+ invalidGrade: "AgentReviewHistoryAddInvalidGrade",
43278
+ invalidPath: "AgentReviewHistoryAddInvalidPath",
43279
+ malformedHistory: "AgentReviewHistoryAddMalformedHistory",
43280
+ failed: "AgentReviewHistoryAddFailed"
43281
+ };
43282
+ var ADD_EXAMPLES = [
43283
+ {
43284
+ Description: "Record a review grade for a project at a specific path",
43285
+ Command: "uip agent review-history add B ./my-agent",
43286
+ Output: {
43287
+ Code: CODES2.success,
43288
+ Data: {
43289
+ ProjectDir: "./my-agent",
43290
+ Grade: "B",
43291
+ RunAt: "2026-09-02T10:00:00.000Z",
43292
+ HistoryCount: 1
43293
+ }
43294
+ }
43295
+ },
43296
+ {
43297
+ Description: "Record a grade with finding counts",
43298
+ Command: "uip agent review-history add C --errors 2 --warnings 5",
43299
+ Output: {
43300
+ Code: CODES2.success,
43301
+ Data: {
43302
+ ProjectDir: ".",
43303
+ Grade: "C",
43304
+ RunAt: "2026-09-02T10:00:00.000Z",
43305
+ Errors: 2,
43306
+ Warnings: 5,
43307
+ HistoryCount: 3
43308
+ }
43309
+ }
43310
+ }
43311
+ ];
43312
+ var COUNT_BOUNDS = { min: 0, max: Number.MAX_SAFE_INTEGER };
43313
+ var parseCount = (flag) => (raw) => parseBoundedInt(raw, flag, COUNT_BOUNDS);
43314
+ var reportFailure = (rawGrade, outcome) => {
43315
+ switch (outcome.error) {
43316
+ case "INVALID_GRADE":
43317
+ OutputFormatter.error({
43318
+ Result: RESULTS.Failure,
43319
+ Code: CODES2.invalidGrade,
43320
+ ErrorCode: "invalid_argument",
43321
+ Message: `\`${rawGrade}\` is not a recordable grade.`,
43322
+ Instructions: `Pass one of: ${outcome.allowed.join(", ")}.`
43323
+ });
43324
+ return;
43325
+ case "NOT_A_DIRECTORY":
43326
+ OutputFormatter.error({
43327
+ Result: RESULTS.Failure,
43328
+ Code: CODES2.invalidPath,
43329
+ ErrorCode: "invalid_argument",
43330
+ Message: `\`${outcome.projectPath}\` is not an existing directory.`,
43331
+ Instructions: "Pass the agent project directory as [path], or run from inside it."
43332
+ });
43333
+ return;
43334
+ case "MALFORMED_HISTORY":
43335
+ OutputFormatter.error({
43336
+ Result: RESULTS.Failure,
43337
+ Code: CODES2.malformedHistory,
43338
+ ErrorCode: "configuration_error",
43339
+ Message: `\`${outcome.file}\` exists but is not a JSON array of review entries: ${outcome.detail}`,
43340
+ Instructions: "Fix the file so it parses as a JSON array, or delete it to start a fresh history, then rerun."
43341
+ });
43342
+ return;
43343
+ }
43344
+ };
43345
+ var registerReviewHistoryCommands = (program) => {
43346
+ const reviewHistory = program.command("review-history").description(`Manage the review grades recorded in the project's ${REVIEW_HISTORY_FILE}`);
43347
+ 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) => {
43348
+ const fs7 = getFileSystem();
43349
+ const projectPath = fs7.path.resolve(targetPath);
43350
+ const [err2, outcome] = await catchError(recordReview(projectPath, {
43351
+ grade,
43352
+ errors: options.errors,
43353
+ warnings: options.warnings
43354
+ }, fs7));
43355
+ if (err2) {
43356
+ OutputFormatter.error({
43357
+ Result: RESULTS.Failure,
43358
+ Code: CODES2.failed,
43359
+ Message: `Recording the review failed: ${extractErrorMessageSync(err2)}`,
43360
+ Instructions: "Verify the project directory is writable. " + "Run `uip agent review-history add --help` for usage."
43361
+ });
43362
+ processContext.exit(1);
43363
+ return;
43364
+ }
43365
+ if (!outcome.ok) {
43366
+ reportFailure(grade, outcome);
43367
+ processContext.exit(1);
43368
+ return;
43369
+ }
43370
+ const { entry, history } = outcome;
43371
+ OutputFormatter.success({
43372
+ Result: RESULTS.Success,
43373
+ Code: CODES2.success,
43374
+ Data: {
43375
+ ProjectDir: projectPath,
43376
+ Grade: entry.grade,
43377
+ RunAt: entry.runAt,
43378
+ ...entry.errors !== undefined && {
43379
+ Errors: entry.errors
43380
+ },
43381
+ ...entry.warnings !== undefined && {
43382
+ Warnings: entry.warnings
43383
+ },
43384
+ HistoryCount: history.length
43385
+ }
43386
+ });
43387
+ });
43388
+ };
43389
+
45149
43390
  // src/commands/tool-list.ts
45150
43391
  var TOOL_LIST_EXAMPLES = [
45151
43392
  {
@@ -45212,6 +43453,7 @@ var registerCommands = async (program) => {
45212
43453
  registerValidateCommand(program);
45213
43454
  registerRefreshCommand(program);
45214
43455
  registerReviewCommand(program);
43456
+ registerReviewHistoryCommands(program);
45215
43457
  registerToolListCommand(program);
45216
43458
  registerMemoryCommands(program);
45217
43459
  registerEvalCommands(program);
@@ -45222,4 +43464,4 @@ var registerCommands = async (program) => {
45222
43464
 
45223
43465
  export { metadata, registerCommands };
45224
43466
 
45225
- //# debugId=62D660E34E218DB464756E2164756E21
43467
+ //# debugId=A04E229D84238E3F64756E2164756E21