@uipath/flow-tool 1.204.0-preview.255 → 1.205.0-preview.256
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/dist/THIRD-PARTY-NOTICES.md +36 -12
- package/dist/{authoring-bppe07p0.js → authoring-e1k40hyw.js} +6 -5
- package/dist/{binding-service-fw3rzae4.js → binding-service-yw91615m.js} +38 -30
- package/dist/{connector-service-2z7s7qtd.js → connector-service-ttm75a4n.js} +224 -47
- package/dist/de-UZI7FJDO-awjpqfz0.js +200 -0
- package/dist/{de-MUJPA4EB-dpg7t2rw.js → de-UZI7FJDO-mwvc4cxe.js} +29 -2
- package/dist/{de-FGHEJRCI-rv513mfh.js → de-WLW6KWOJ-2qnsqdtw.js} +238 -31
- package/dist/debug-conversation-trigger-xsm3ycqx.js +30 -0
- package/dist/{debug-http-client-p4kf38yt.js → debug-http-client-yqjzsnhw.js} +5 -4
- package/dist/{debug-service-893erynq.js → debug-service-nra3n02y.js} +6 -5
- package/dist/{edge-service-6zr5f09c.js → edge-service-8fv0m681.js} +16 -12
- package/dist/{embedded-file-reader-v8c2yj2a.js → embedded-file-reader-r66242ey.js} +2 -2
- package/dist/en-EJCBA3LK-0wb3b1xy.js +146 -0
- package/dist/{en-FBPVNKFN-dqt573xn.js → en-EJCBA3LK-dtpdghgj.js} +12 -4
- package/dist/{en-BWGKA5OE-1qkvb9rn.js → en-M7GQYBV2-5nfmpnfz.js} +88 -6
- package/dist/{es-7SE7HX2X-8yh1aj2y.js → es-4UBUTCQA-m1ytpyx2.js} +29 -2
- package/dist/es-4UBUTCQA-t7hsackg.js +200 -0
- package/dist/{es-KR3ZSNMP-84zphx0x.js → es-5THCNRFN-tqwyrdgy.js} +235 -28
- package/dist/{es-MX-2MYFZU7X-3rek4r73.js → es-MX-5RELIXKI-9jhqtddc.js} +29 -2
- package/dist/es-MX-5RELIXKI-jtjbcxbb.js +200 -0
- package/dist/{es-MX-XXZJGC4R-2mr8jtgm.js → es-MX-TWZBRAXK-gqd9swzw.js} +237 -30
- package/dist/filter-engine-7ep90g7f.js +11 -0
- package/dist/{flow-api-kjvpsxhw.js → flow-api-sat010z1.js} +16 -10
- package/dist/{flow-debug-service-9q9k756w.js → flow-debug-service-cgawm96k.js} +96 -58
- package/dist/{flow-eval-node-target-zvk7fcb2.js → flow-eval-node-target-dah1gmmh.js} +17 -17
- package/dist/flow-eval-run-api-xdygjzfv.js +13 -0
- package/dist/{flow-eval-run-service-2hfqyadh.js → flow-eval-run-service-03j1szf6.js} +73 -80
- package/dist/{flow-eval-service-m5n2svke.js → flow-eval-service-9j46ta9k.js} +167 -415
- package/dist/{flow-init-sdk-source-z9qx1zkt.js → flow-init-sdk-source-xvdvkq7d.js} +6 -5
- package/dist/{flow-init-service-8y8b76zm.js → flow-init-service-0a4y3a46.js} +19 -15
- package/dist/{flow-io-w11yspjx.js → flow-io-1wabd32s.js} +15 -11
- package/dist/{flow-migrate-service-v7ch4t3h.js → flow-migrate-service-mkqpbwtv.js} +16 -12
- package/dist/{flow-pack-service-xs8v5mba.js → flow-pack-service-7dj2hhyz.js} +47 -38
- package/dist/flow-validate-service-1ktjayjv.js +70 -0
- package/dist/{fr-Y6NPVODW-8vr1ja4b.js → fr-CERONSRC-edpxhbmb.js} +237 -30
- package/dist/{fr-MDFKNZ4C-h4a122k9.js → fr-VBM5WRC2-63z7w4mh.js} +29 -2
- package/dist/fr-VBM5WRC2-707ha692.js +200 -0
- package/dist/{governance-fetcher-18pk0mgv.js → governance-fetcher-76hxssjm.js} +7 -6
- package/dist/{hitl-service-ehnfkwhp.js → hitl-service-vcbhd4cb.js} +15 -11
- package/dist/{index-aaq9rwfv.js → index-1b2je9n2.js} +1088 -233
- package/dist/index-d090f35d.js +66 -0
- package/dist/{index-yj4xk2aw.js → index-dgdnbb2g.js} +7 -5
- package/dist/{index-ng2f77my.js → index-fyc0k5dd.js} +985 -617
- package/dist/{index-9hqj0ee4.js → index-hz008fep.js} +6 -5
- package/dist/{index-vrhcbxnk.js → index-nsn889vf.js} +6 -5
- package/dist/{index-2s8rmmw6.js → index-sqhbn7ew.js} +4 -4
- package/dist/{index-tnz5ks4t.js → index-wycgq0ff.js} +65 -2230
- package/dist/index.js +17 -14
- package/dist/init.js +19 -15
- package/dist/inline-entity-resolver-64pqwk86.js +45 -0
- package/dist/input-reader-n7kzdrev.js +12 -0
- package/dist/{ja-UTQEAP34-8e0q6swp.js → ja-43QL7CGO-c3q8gre9.js} +29 -2
- package/dist/ja-43QL7CGO-h6qfxfay.js +200 -0
- package/dist/{ja-Q5PXKJ2V-p4msxzjd.js → ja-U2MCNHGT-gz0ap1jk.js} +235 -28
- package/dist/{known-types-q6fcyq2e.js → known-types-3025scz1.js} +5 -5
- package/dist/ko-TLL6Z6CD-ag6gjynr.js +200 -0
- package/dist/{ko-AXCHW2OK-askct7f6.js → ko-TLL6Z6CD-wrt3n8a9.js} +29 -2
- package/dist/{ko-AYBDSRZG-41mdmsg1.js → ko-XAUYQWDR-zp81gjp4.js} +237 -30
- package/dist/{maestro-automate-entry-qak46eg0.js → maestro-automate-entry-6f9act3w.js} +2 -2
- package/dist/{node-cvwqsgg0.js → node-hz6cvp9d.js} +29 -15
- package/dist/{node-service-544fv7as.js → node-service-7wz8gx7h.js} +41 -30
- package/dist/{node-strategy-fdnkvq4a.js → node-strategy-1dmmhvf3.js} +1 -1
- package/dist/node-sync-service-yvyf7chw.js +61 -0
- package/dist/packager-tool-10vc8pq4.js +2 -0
- package/dist/{packager-tool-29b6r6eg.js → packager-tool-2h15x2kb.js} +6 -6
- package/dist/{packager-tool-h7cjs093.js → packager-tool-2z0r1f32.js} +668 -57
- package/dist/packager-tool-4kr6g0zw.js +16 -0
- package/dist/packager-tool-4x7tzvv0.js +1176 -0
- package/dist/{packager-tool-d88rqwk8.js → packager-tool-6z1hsm2h.js} +13 -5
- package/dist/packager-tool-7hw344bt.js +107 -0
- package/dist/{packager-tool-pb7wzsn4.js → packager-tool-7wnxyvf9.js} +519 -437
- package/dist/{packager-tool-m8xtf5ej.js → packager-tool-8g5931fz.js} +7 -4
- package/dist/{packager-tool-h9tzz0qd.js → packager-tool-961vsbsc.js} +15 -10
- package/dist/packager-tool-9era57c0.js +28 -0
- package/dist/packager-tool-9gprvfcy.js +23 -0
- package/dist/packager-tool-9jxzgsxc.js +14 -0
- package/dist/{packager-tool-zxp4hya4.js → packager-tool-a5afh1dc.js} +34 -13
- package/dist/{packager-tool-02f63a08.js → packager-tool-apawc11t.js} +88 -762
- package/dist/{packager-tool-tf3d2y8z.js → packager-tool-aw9v0raw.js} +2 -2
- package/dist/packager-tool-cqtsj6yh.js +2 -0
- package/dist/{packager-tool-5nqhxb9e.js → packager-tool-dwd6cc01.js} +16110 -13031
- package/dist/{packager-tool-t605qewm.js → packager-tool-dxgrhfq5.js} +2 -2
- package/dist/{packager-tool-awkq26v0.js → packager-tool-e7kvq8hf.js} +5 -3
- package/dist/{packager-tool-2y2mmdnq.js → packager-tool-fjqpf1y6.js} +6 -24
- package/dist/{packager-tool-3dc9gz35.js → packager-tool-frjt46rb.js} +1 -1
- package/dist/{packager-tool-y8egb0fa.js → packager-tool-gqq3vkgh.js} +2573 -535
- package/dist/{packager-tool-w5a1hhyj.js → packager-tool-hxyjn885.js} +13 -2
- package/dist/packager-tool-j3228zs9.js +35 -0
- package/dist/{packager-tool-hhy1gr2k.js → packager-tool-jgfzfqjm.js} +1 -1
- package/dist/{packager-tool-5csvkk54.js → packager-tool-kb520rm5.js} +172 -71
- package/dist/{packager-tool-k04k2rnq.js → packager-tool-kmv2p8z4.js} +20 -8
- package/dist/{packager-tool-6h69pd2a.js → packager-tool-kn86394c.js} +127 -61
- package/dist/packager-tool-mgcz986r.js +143 -0
- package/dist/{packager-tool-3h2ktz6q.js → packager-tool-myhbp761.js} +11 -1
- package/dist/{packager-tool-5tk1eg46.js → packager-tool-ns9xn7zq.js} +13 -13
- package/dist/{packager-tool-vbfz8k7w.js → packager-tool-p8gab24q.js} +52 -32
- package/dist/{packager-tool-stq8800d.js → packager-tool-pacrqxv2.js} +17 -4
- package/dist/{packager-tool-7q6z6npd.js → packager-tool-pcvhcn2k.js} +93 -11
- package/dist/packager-tool-phw8ydjx.js +331 -0
- package/dist/{packager-tool-mx0gg6yh.js → packager-tool-q8akejne.js} +6 -4
- package/dist/packager-tool-qcqb9hf8.js +26 -0
- package/dist/{packager-tool-n89vrpex.js → packager-tool-skcjythd.js} +10907 -25608
- package/dist/{packager-tool-v37kemg5.js → packager-tool-sphnextf.js} +5 -6
- package/dist/{packager-tool-1ca047de.js → packager-tool-sqpesv2e.js} +12 -56
- package/dist/packager-tool-t7ahhaer.js +877 -0
- package/dist/{packager-tool-zgm9mqrh.js → packager-tool-thnkpqwc.js} +1802 -378
- package/dist/{packager-tool-peawy22c.js → packager-tool-tqjfdpda.js} +53 -8
- package/dist/{packager-tool-gb4sm499.js → packager-tool-vd3rn4fj.js} +463 -327
- package/dist/{packager-tool-5tjzg56t.js → packager-tool-wh660fny.js} +1 -1
- package/dist/{packager-tool-tyg399d6.js → packager-tool-wze74wyk.js} +74 -47
- package/dist/{packager-tool-zbhqrk3p.js → packager-tool-x20684x5.js} +1 -1
- package/dist/packager-tool-xj0agqpk.js +11 -0
- package/dist/packager-tool-xk78j7dz.js +1256 -0
- package/dist/{packager-tool-py93409h.js → packager-tool-ymma2s85.js} +2 -2
- package/dist/packager-tool-z0yxfhdj.js +40 -0
- package/dist/packager-tool.js +13 -10
- package/dist/{pt-BR-TKHNHMET-sn91xyq0.js → pt-BR-GNQNAAZ2-xadharv4.js} +237 -30
- package/dist/{pt-BR-Y6K6XHXK-mp3hwhw1.js → pt-BR-USP2T7GD-pedn77m1.js} +29 -2
- package/dist/pt-BR-USP2T7GD-rppy42ym.js +200 -0
- package/dist/{pt-3DIO5QWG-59b3f4bc.js → pt-RMIAKZB4-67enhx3m.js} +29 -2
- package/dist/pt-RMIAKZB4-t80exmp7.js +200 -0
- package/dist/{pt-ROXU257Y-2f6bxev4.js → pt-TO2DARY2-ftcce1bv.js} +237 -30
- package/dist/ro-GHOBYW2S-4zevc9dy.js +200 -0
- package/dist/{ro-BWR3ONRR-vzx3hy8a.js → ro-GHOBYW2S-mhnqsgaa.js} +29 -2
- package/dist/{ro-AVAWPKOO-b89pw79r.js → ro-WUYJV6OW-a8d9qy1n.js} +235 -28
- package/dist/ru-WBLQ5B2U-dpqvtfwr.js +10 -0
- package/dist/services/connector-request-buckets.d.ts +1 -0
- package/dist/services/flow-eval-file-store.d.ts +1 -11
- package/dist/services/flow-eval-utils.d.ts +1 -32
- package/dist/services/flow-validate-service.d.ts +51 -0
- package/dist/services/inline-entity-resolver.d.ts +22 -0
- package/dist/services/node-service.d.ts +21 -1
- package/dist/services/packaging-utils.d.ts +15 -2
- package/dist/{shared-utils-pnbvyyb2.js → shared-utils-tqnx96mg.js} +4 -3
- package/dist/solution-auth-8qz5pw7z.js +14 -0
- package/dist/solution-discovery-vqravtkh.js +44 -0
- package/dist/{tidy-service-j70ccg27.js → tidy-service-tqjea6g2.js} +143 -39
- package/dist/tool.js +17 -14
- package/dist/{tr-5IIHSFW5-hw4cewew.js → tr-GDTLECMM-k5fhmq13.js} +29 -2
- package/dist/tr-GDTLECMM-kngksm3r.js +200 -0
- package/dist/{tr-JMIP7ZSL-c39b6pe4.js → tr-M3F5A6AU-bb0tg39m.js} +235 -28
- package/dist/utils/flow-io.d.ts +2 -1
- package/dist/validation.js +39 -33
- package/dist/{variable-service-86t2r5m9.js → variable-service-kqnqxmx2.js} +16 -12
- package/dist/{wait-for-flow-job-d8m6mqb4.js → wait-for-flow-job-b0vj8828.js} +15 -12
- package/dist/{zh-CN-IFFXSEJS-9wm9gmrv.js → zh-CN-C5G4PC7C-ds9gkptg.js} +235 -28
- package/dist/zh-CN-I5D7WHBD-ge92tbx9.js +200 -0
- package/dist/{zh-CN-R2KU4U5L-tc1hat59.js → zh-CN-I5D7WHBD-sr5h0a98.js} +29 -2
- package/dist/{zh-TW-GNKMELBF-j674515r.js → zh-TW-2AVLM723-288pkc1z.js} +29 -2
- package/dist/zh-TW-2AVLM723-xsmap3gk.js +200 -0
- package/dist/{zh-TW-IYBNYAMG-8727c7v2.js → zh-TW-62HZIG6O-787kdwex.js} +234 -27
- package/package.json +2 -2
- package/dist/debug-conversation-trigger-hgszjdhx.js +0 -44
- package/dist/flow-eval-run-api-byx3cacw.js +0 -13
- package/dist/flow-validate-service-12v3bz1b.js +0 -64
- package/dist/input-reader-vhar4g0k.js +0 -11
- package/dist/node-sync-service-ccwgtyte.js +0 -40
- package/dist/packager-tool-4g5hk66k.js +0 -454
- package/dist/packager-tool-kg35b9s6.js +0 -15
- package/dist/packager-tool-pz5nqg0s.js +0 -64
- package/dist/packager-tool-t3ysatjd.js +0 -521
- package/dist/packager-tool-vd6jt4n8.js +0 -208
- package/dist/packager-tool-vscvjrhn.js +0 -265
- package/dist/services/flow-debug-service.d.ts +0 -320
- package/dist/services/flow-eval-schema/deterministic-evaluators.d.ts +0 -110
- package/dist/services/flow-eval-schema/evaluator-fields.d.ts +0 -66
- package/dist/services/flow-eval-schema/helpers.d.ts +0 -9
- package/dist/services/flow-eval-schema/index.d.ts +0 -4
- package/dist/services/flow-eval-schema/llm-judge-evaluators.d.ts +0 -174
- package/dist/services/flow-eval-schema/prompts.d.ts +0 -2
- package/dist/services/flow-eval-schema/registry.d.ts +0 -375
- package/dist/services/flow-eval-schema/tool-call-evaluators.d.ts +0 -93
- package/dist/services/flow-eval-schema/types.d.ts +0 -95
- package/dist/services/flow-eval-types.d.ts +0 -6
- package/dist/utils/write-resolved-flow.d.ts +0 -7
- /package/dist/{headless-45dypanh.js → headless-fw8pwyzm.js} +0 -0
- /package/dist/{localization-xecwjpe2.js → localization-d6gjmrsw.js} +0 -0
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isRecord
|
|
3
|
-
} from "./packager-tool-t3ysatjd.js";
|
|
4
|
-
|
|
5
|
-
// src/services/flow-eval-run-readers.ts
|
|
6
|
-
function asRecordArray(value, label) {
|
|
7
|
-
if (!Array.isArray(value)) {
|
|
8
|
-
throw new Error(`${label} response must be an array`);
|
|
9
|
-
}
|
|
10
|
-
return value.map((item, index) => {
|
|
11
|
-
if (!isRecord(item)) {
|
|
12
|
-
throw new Error(`${label} response item ${index} must be an object`);
|
|
13
|
-
}
|
|
14
|
-
return item;
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
function readRecord(value) {
|
|
18
|
-
return isRecord(value) ? value : undefined;
|
|
19
|
-
}
|
|
20
|
-
function readRecordArray(value) {
|
|
21
|
-
if (!Array.isArray(value)) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
return value.filter(isRecord);
|
|
25
|
-
}
|
|
26
|
-
function optionalNumber(value) {
|
|
27
|
-
return typeof value === "number" ? value : null;
|
|
28
|
-
}
|
|
29
|
-
function optionalString(value) {
|
|
30
|
-
return typeof value === "string" ? value : "";
|
|
31
|
-
}
|
|
32
|
-
function statusString(value) {
|
|
33
|
-
if (typeof value === "string") {
|
|
34
|
-
return value;
|
|
35
|
-
}
|
|
36
|
-
if (typeof value === "number") {
|
|
37
|
-
const statusByCode = {
|
|
38
|
-
0: "Pending",
|
|
39
|
-
1: "Running",
|
|
40
|
-
2: "Completed",
|
|
41
|
-
3: "PartiallyCompleted",
|
|
42
|
-
4: "Failed"
|
|
43
|
-
};
|
|
44
|
-
return statusByCode[value] ?? String(value);
|
|
45
|
-
}
|
|
46
|
-
return "";
|
|
47
|
-
}
|
|
48
|
-
function readEvaluatorScores(value) {
|
|
49
|
-
const records = readRecordArray(value);
|
|
50
|
-
if (!records) {
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
return records.flatMap((score) => {
|
|
54
|
-
const evaluatorId = score.evaluatorId;
|
|
55
|
-
const scoreValue = score.value;
|
|
56
|
-
if (typeof evaluatorId !== "string" || typeof scoreValue !== "number") {
|
|
57
|
-
return [];
|
|
58
|
-
}
|
|
59
|
-
return [{ evaluatorId, value: scoreValue }];
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
function readRemoteEvalSetRun(record) {
|
|
63
|
-
return {
|
|
64
|
-
id: optionalString(record.id),
|
|
65
|
-
workloadId: optionalString(record.workloadId),
|
|
66
|
-
evalSetId: typeof record.evalSetId === "string" ? record.evalSetId : null,
|
|
67
|
-
status: statusString(record.status),
|
|
68
|
-
score: optionalNumber(record.score),
|
|
69
|
-
evaluatorScores: readEvaluatorScores(record.evaluatorScores),
|
|
70
|
-
config: readRecord(record.config) ?? {},
|
|
71
|
-
numberOfEvalsExecuted: optionalNumber(record.numberOfEvalsExecuted),
|
|
72
|
-
durationMilliseconds: optionalNumber(record.durationMilliseconds),
|
|
73
|
-
createdAt: optionalString(record.createdAt),
|
|
74
|
-
updatedAt: optionalString(record.updatedAt)
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
function readRemoteEvalRun(record) {
|
|
78
|
-
const snapshot = readRecord(record.evalSnapshot);
|
|
79
|
-
const result = readRecord(record.result);
|
|
80
|
-
return {
|
|
81
|
-
id: optionalString(record.id),
|
|
82
|
-
evalSetRunId: optionalString(record.evalSetRunId),
|
|
83
|
-
evalSnapshot: snapshot ? {
|
|
84
|
-
id: typeof snapshot.id === "string" ? snapshot.id : undefined,
|
|
85
|
-
name: typeof snapshot.name === "string" ? snapshot.name : undefined,
|
|
86
|
-
inputs: readRecord(snapshot.inputs),
|
|
87
|
-
evaluationCriterias: readRecord(snapshot.evaluationCriterias),
|
|
88
|
-
expectedOutput: readRecord(snapshot.expectedOutput) ?? (snapshot.expectedOutput === null ? null : undefined)
|
|
89
|
-
} : undefined,
|
|
90
|
-
status: statusString(record.status),
|
|
91
|
-
result: result ? {
|
|
92
|
-
output: readRecord(result.output),
|
|
93
|
-
scores: readEvaluatorScores(result.scores) ?? undefined,
|
|
94
|
-
score: readRecord(result.score)
|
|
95
|
-
} : null,
|
|
96
|
-
completionMetrics: readRecord(record.completionMetrics),
|
|
97
|
-
evaluatorRuns: readRecordArray(record.evaluatorRuns)?.flatMap((evaluatorRun) => {
|
|
98
|
-
const evaluatorId = evaluatorRun.evaluatorId;
|
|
99
|
-
if (typeof evaluatorId !== "string") {
|
|
100
|
-
return [];
|
|
101
|
-
}
|
|
102
|
-
const evaluatorResult = readRecord(evaluatorRun.result);
|
|
103
|
-
return [
|
|
104
|
-
{
|
|
105
|
-
evaluatorId,
|
|
106
|
-
evaluatorSnapshot: evaluatorRun.evaluatorSnapshot,
|
|
107
|
-
status: typeof evaluatorRun.status === "string" ? evaluatorRun.status : undefined,
|
|
108
|
-
result: evaluatorResult ? {
|
|
109
|
-
output: readRecord(evaluatorResult.output),
|
|
110
|
-
score: readRecord(evaluatorResult.score)
|
|
111
|
-
} : null,
|
|
112
|
-
completionMetrics: readRecord(evaluatorRun.completionMetrics)
|
|
113
|
-
}
|
|
114
|
-
];
|
|
115
|
-
}),
|
|
116
|
-
error: typeof record.error === "string" || isRecord(record.error) ? record.error : null,
|
|
117
|
-
errorMessage: typeof record.errorMessage === "string" ? record.errorMessage : null,
|
|
118
|
-
createdAt: typeof record.createdAt === "string" ? record.createdAt : undefined,
|
|
119
|
-
updatedAt: typeof record.updatedAt === "string" ? record.updatedAt : undefined
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// src/services/flow-eval-run-api.ts
|
|
124
|
-
var METADATA_FETCH_TIMEOUT_MS = 30000;
|
|
125
|
-
var MAX_ERROR_BODY_LENGTH = 400;
|
|
126
|
-
|
|
127
|
-
class FlowEvalRunApi {
|
|
128
|
-
async executeAndEvaluate(config, payload) {
|
|
129
|
-
return this.requestJson(config, "/unifiedEvals/workloads/executeAndEvaluate", {
|
|
130
|
-
method: "POST",
|
|
131
|
-
body: JSON.stringify(payload)
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
async listEvalSetRuns(config, workloadId) {
|
|
135
|
-
const response = await this.requestJson(config, `/unifiedEvals/workloads/${encodeURIComponent(workloadId)}/evalSetRuns?workloadType=Flow`, { method: "GET" });
|
|
136
|
-
return asRecordArray(response, "Eval set runs").map(readRemoteEvalSetRun);
|
|
137
|
-
}
|
|
138
|
-
async getEvalSetRun(config, workloadId, evalSetRunId) {
|
|
139
|
-
const response = await this.requestJson(config, `/unifiedEvals/workloads/${encodeURIComponent(workloadId)}/evalSetRuns/${encodeURIComponent(evalSetRunId)}?workloadType=Flow`, { method: "GET" });
|
|
140
|
-
if (!isRecord(response)) {
|
|
141
|
-
throw new Error("Eval set run response must be an object");
|
|
142
|
-
}
|
|
143
|
-
return readRemoteEvalSetRun(response);
|
|
144
|
-
}
|
|
145
|
-
async getEvalRuns(config, workloadId, evalSetRunId) {
|
|
146
|
-
const response = await this.requestJson(config, `/unifiedEvals/workloads/${encodeURIComponent(workloadId)}/evalSetRuns/${encodeURIComponent(evalSetRunId)}/evalRuns?workloadType=Flow`, { method: "GET" });
|
|
147
|
-
return asRecordArray(response, "Eval runs").map(readRemoteEvalRun);
|
|
148
|
-
}
|
|
149
|
-
async getSimulatableComponents(config, processKey, processVersion) {
|
|
150
|
-
const params = new URLSearchParams({ workloadType: "Agents" });
|
|
151
|
-
if (processVersion) {
|
|
152
|
-
params.set("processVersion", processVersion);
|
|
153
|
-
}
|
|
154
|
-
const data = await this.requestJson(config, `/unifiedEvals/processes/${encodeURIComponent(processKey)}/simulatableComponents?${params.toString()}`, { method: "GET" }, METADATA_FETCH_TIMEOUT_MS);
|
|
155
|
-
const components = Array.isArray(data.components) ? data.components : [];
|
|
156
|
-
return components.filter((c) => isRecord(c) && typeof c.id === "string" && typeof c.name === "string" && c.isEnabled === true);
|
|
157
|
-
}
|
|
158
|
-
apiBase(config) {
|
|
159
|
-
return `${config.baseUrl}/${config.organizationId}/${config.tenantName}/agentsruntime_/api`;
|
|
160
|
-
}
|
|
161
|
-
headers(config) {
|
|
162
|
-
return {
|
|
163
|
-
Authorization: `Bearer ${config.authToken}`,
|
|
164
|
-
Accept: "application/json",
|
|
165
|
-
"Content-Type": "application/json",
|
|
166
|
-
"X-UiPath-Internal-TenantId": config.tenantId,
|
|
167
|
-
"X-UiPath-Internal-AccountId": config.organizationId
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
async requestJson(config, path, request, timeoutMs) {
|
|
171
|
-
let response;
|
|
172
|
-
let text;
|
|
173
|
-
try {
|
|
174
|
-
response = await fetch(`${this.apiBase(config)}${path}`, {
|
|
175
|
-
method: request.method,
|
|
176
|
-
headers: {
|
|
177
|
-
...this.headers(config),
|
|
178
|
-
...request.headers
|
|
179
|
-
},
|
|
180
|
-
body: request.body,
|
|
181
|
-
...timeoutMs !== undefined ? { signal: AbortSignal.timeout(timeoutMs) } : {}
|
|
182
|
-
});
|
|
183
|
-
text = await response.text();
|
|
184
|
-
} catch (err) {
|
|
185
|
-
if (err instanceof DOMException && err.name === "TimeoutError") {
|
|
186
|
-
throw new Error(`Unified eval API request timed out after ${timeoutMs}ms (${request.method} ${path})`);
|
|
187
|
-
}
|
|
188
|
-
throw new Error(`Unified eval API request failed (${request.method} ${path}): ${err instanceof Error ? err.message : String(err)}`);
|
|
189
|
-
}
|
|
190
|
-
if (!response.ok) {
|
|
191
|
-
const body = text.length > MAX_ERROR_BODY_LENGTH ? `${text.slice(0, MAX_ERROR_BODY_LENGTH)}… (truncated)` : text;
|
|
192
|
-
throw new Error(`Unified eval API returned ${response.status}: ${body}`);
|
|
193
|
-
}
|
|
194
|
-
if (!text) {
|
|
195
|
-
throw new Error(`Unified eval API returned ${response.status} with empty body`);
|
|
196
|
-
}
|
|
197
|
-
try {
|
|
198
|
-
return JSON.parse(text);
|
|
199
|
-
} catch {
|
|
200
|
-
const preview = text.length > MAX_ERROR_BODY_LENGTH ? `${text.slice(0, MAX_ERROR_BODY_LENGTH)}… (truncated)` : text;
|
|
201
|
-
throw new Error(`Unified eval API returned ${response.status} with non-JSON body (${request.method} ${path}): ${preview}`);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
export { FlowEvalRunApi };
|
|
207
|
-
|
|
208
|
-
//# debugId=C7F594BDAF89F66264756E2164756E21
|
|
@@ -1,265 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ensureDirectory
|
|
3
|
-
} from "./packager-tool-pz5nqg0s.js";
|
|
4
|
-
import {
|
|
5
|
-
buildInlineAgentContract,
|
|
6
|
-
isInlineAgentNodeType,
|
|
7
|
-
operateRuntimeOptions,
|
|
8
|
-
readInlineAgentSource
|
|
9
|
-
} from "./packager-tool-zgm9mqrh.js";
|
|
10
|
-
import {
|
|
11
|
-
withRuntimeProfile
|
|
12
|
-
} from "./packager-tool-hhy1gr2k.js";
|
|
13
|
-
import {
|
|
14
|
-
EntryPointType,
|
|
15
|
-
ProjectType,
|
|
16
|
-
generateBindingsJson,
|
|
17
|
-
generateEntryPointsJson,
|
|
18
|
-
generateOperateJson,
|
|
19
|
-
getBindingResources,
|
|
20
|
-
getEntryPoints,
|
|
21
|
-
isConversationalOrVoiceAgentNodeType,
|
|
22
|
-
mergeBindingResources
|
|
23
|
-
} from "./packager-tool-bhqx9kez.js";
|
|
24
|
-
import {
|
|
25
|
-
catchError,
|
|
26
|
-
logger
|
|
27
|
-
} from "./packager-tool-02f63a08.js";
|
|
28
|
-
|
|
29
|
-
// src/services/packaging-utils.ts
|
|
30
|
-
function fileNodesToPackagingNodes(nodes) {
|
|
31
|
-
return nodes.map((node) => ({
|
|
32
|
-
id: node.id,
|
|
33
|
-
type: node.type,
|
|
34
|
-
typeVersion: node.typeVersion ?? "1.0",
|
|
35
|
-
display: node.display,
|
|
36
|
-
inputs: node.inputs,
|
|
37
|
-
outputs: node.outputs,
|
|
38
|
-
...node.model ? { model: node.model } : {}
|
|
39
|
-
}));
|
|
40
|
-
}
|
|
41
|
-
function isRecord(value) {
|
|
42
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
43
|
-
}
|
|
44
|
-
function toResourceList(value) {
|
|
45
|
-
if (!Array.isArray(value))
|
|
46
|
-
return;
|
|
47
|
-
const resources = value.filter(isRecord);
|
|
48
|
-
return resources.length === value.length ? resources : undefined;
|
|
49
|
-
}
|
|
50
|
-
function normalizePackagingBindingsJson(value) {
|
|
51
|
-
if (!isRecord(value))
|
|
52
|
-
return;
|
|
53
|
-
const resources = toResourceList(value.resources);
|
|
54
|
-
if (!resources)
|
|
55
|
-
return;
|
|
56
|
-
return {
|
|
57
|
-
...value,
|
|
58
|
-
version: typeof value.version === "string" ? value.version : "2.0",
|
|
59
|
-
resources
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
function emptyPackagingBindingsJson() {
|
|
63
|
-
return { version: "2.0", resources: [] };
|
|
64
|
-
}
|
|
65
|
-
function mergePackagingBindingsJson(bindingsJsons) {
|
|
66
|
-
const first = bindingsJsons.find((bindingsJson) => bindingsJson !== undefined);
|
|
67
|
-
return {
|
|
68
|
-
...first ?? emptyPackagingBindingsJson(),
|
|
69
|
-
resources: mergeBindingResources(bindingsJsons.flatMap((bindingsJson) => bindingsJson?.resources ?? []))
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
var inlineAgentPackagerLogger = {
|
|
73
|
-
debug: (message) => logger.debug(message),
|
|
74
|
-
info: (message) => logger.info(message),
|
|
75
|
-
warn: (message) => logger.warn(message),
|
|
76
|
-
error: (message) => logger.error(message),
|
|
77
|
-
progress: (message) => logger.info(message),
|
|
78
|
-
log: (message, level) => {
|
|
79
|
-
if (level === "Error" /* Error */)
|
|
80
|
-
logger.error(message);
|
|
81
|
-
else if (level === "Warning" /* Warn */)
|
|
82
|
-
logger.warn(message);
|
|
83
|
-
else if (level === "Debug" /* Debug */)
|
|
84
|
-
logger.debug(message);
|
|
85
|
-
else
|
|
86
|
-
logger.info(message);
|
|
87
|
-
},
|
|
88
|
-
logMessage: (message) => inlineAgentPackagerLogger.log(message.message, message.logLevel)
|
|
89
|
-
};
|
|
90
|
-
async function createInlineAgentContract(fs, agentDir) {
|
|
91
|
-
const outputPath = fs.path.join(fs.env.tmpdir(), `.inline-agent-contract-${crypto.randomUUID()}`);
|
|
92
|
-
await fs.mkdir(outputPath);
|
|
93
|
-
try {
|
|
94
|
-
const built = await buildInlineAgentContract({
|
|
95
|
-
fileSystem: fs,
|
|
96
|
-
logger: inlineAgentPackagerLogger,
|
|
97
|
-
projectPath: agentDir,
|
|
98
|
-
outputPath
|
|
99
|
-
});
|
|
100
|
-
const bindingsJson = normalizePackagingBindingsJson(built.bindingsJson);
|
|
101
|
-
if (!bindingsJson) {
|
|
102
|
-
throw new Error("Agent packager returned an invalid binding contract");
|
|
103
|
-
}
|
|
104
|
-
return { agentJson: built.agentJson, bindingsJson };
|
|
105
|
-
} finally {
|
|
106
|
-
const [cleanupError] = await catchError(fs.rm(outputPath, { recursive: true }));
|
|
107
|
-
if (cleanupError) {
|
|
108
|
-
logger.debug(`Could not remove inline-agent contract directory ${outputPath}: ${cleanupError.message}`);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
async function inlineAgentExists(fs, projectDir, source) {
|
|
113
|
-
const agentJsonPath = fs.path.join(projectDir, source, "agent.json");
|
|
114
|
-
return fs.exists(agentJsonPath);
|
|
115
|
-
}
|
|
116
|
-
async function packageInlineAgents(fs, projectDir, nodes) {
|
|
117
|
-
const result = [];
|
|
118
|
-
for (const node of nodes) {
|
|
119
|
-
if (!isInlineAgentNodeType(node.type))
|
|
120
|
-
continue;
|
|
121
|
-
const source = readInlineAgentSource(node);
|
|
122
|
-
if (!source)
|
|
123
|
-
continue;
|
|
124
|
-
if (/[/\\.]/.test(source))
|
|
125
|
-
continue;
|
|
126
|
-
if (!await inlineAgentExists(fs, projectDir, source))
|
|
127
|
-
continue;
|
|
128
|
-
const contract = await createInlineAgentContract(fs, fs.path.join(projectDir, source));
|
|
129
|
-
const inputSchema = contract.agentJson.inputSchema ?? {
|
|
130
|
-
type: "object",
|
|
131
|
-
properties: {}
|
|
132
|
-
};
|
|
133
|
-
const outputSchema = contract.agentJson.outputSchema ?? {
|
|
134
|
-
type: "object",
|
|
135
|
-
properties: {}
|
|
136
|
-
};
|
|
137
|
-
result.push({
|
|
138
|
-
source,
|
|
139
|
-
entryPoint: {
|
|
140
|
-
filePath: `content/${source}/agent.json`,
|
|
141
|
-
uniqueId: contract.agentJson.projectId ?? source,
|
|
142
|
-
type: EntryPointType.Agent,
|
|
143
|
-
input: inputSchema,
|
|
144
|
-
output: outputSchema,
|
|
145
|
-
displayName: contract.agentJson.name ?? "Agent"
|
|
146
|
-
},
|
|
147
|
-
agentJson: contract.agentJson,
|
|
148
|
-
bindingsJson: contract.bindingsJson
|
|
149
|
-
});
|
|
150
|
-
logger.info(`Packaged inline agent "${source}" for entry-points`);
|
|
151
|
-
}
|
|
152
|
-
return result;
|
|
153
|
-
}
|
|
154
|
-
async function stageInlineAgentPackageFiles(fs, sourceProjectPath, stagingProjectDir, inlineAgents, formatLogMessage) {
|
|
155
|
-
for (const agent of inlineAgents) {
|
|
156
|
-
const srcDir = fs.path.join(sourceProjectPath, agent.source);
|
|
157
|
-
const destDir = fs.path.join(stagingProjectDir, agent.source);
|
|
158
|
-
if (fs.path.resolve(srcDir) !== fs.path.resolve(destDir) && await fs.exists(srcDir)) {
|
|
159
|
-
await fs.copyDirectory(srcDir, destDir);
|
|
160
|
-
}
|
|
161
|
-
const agentBuilderDir = fs.path.join(destDir, ".agent-builder");
|
|
162
|
-
await ensureDirectory(fs, agentBuilderDir);
|
|
163
|
-
await fs.writeFile(fs.path.join(agentBuilderDir, "agent.json"), JSON.stringify({
|
|
164
|
-
...agent.agentJson,
|
|
165
|
-
resources: agent.agentJson.resources ?? [],
|
|
166
|
-
features: agent.agentJson.features ?? []
|
|
167
|
-
}, null, 2));
|
|
168
|
-
await fs.writeFile(fs.path.join(agentBuilderDir, "bindings.json"), `${JSON.stringify(agent.bindingsJson ?? emptyPackagingBindingsJson(), null, 2)}
|
|
169
|
-
`);
|
|
170
|
-
logger.info(formatLogMessage(agent.source));
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
function buildInlineAgentDescriptors(nodes) {
|
|
174
|
-
const out = [];
|
|
175
|
-
for (const node of nodes) {
|
|
176
|
-
if (!isInlineAgentNodeType(node.type))
|
|
177
|
-
continue;
|
|
178
|
-
const source = readInlineAgentSource(node);
|
|
179
|
-
if (!source)
|
|
180
|
-
continue;
|
|
181
|
-
const label = node.display?.label ?? "Agent";
|
|
182
|
-
out.push({
|
|
183
|
-
name: label,
|
|
184
|
-
agentProjectId: source,
|
|
185
|
-
isConversational: isConversationalOrVoiceAgentNodeType(node.type),
|
|
186
|
-
entryPointPath: `${source}/agent.json`
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
return out;
|
|
190
|
-
}
|
|
191
|
-
async function writePackagingArtifacts(fs, projectDir, projectId, packagingNodes, bindings, variables, bpmnFileName, startEventId, flowFileName, definitions = [], options = {}) {
|
|
192
|
-
const { entryPoints } = await writePackagingArtifactsDetailed(fs, projectDir, projectId, packagingNodes, bindings, variables, bpmnFileName, startEventId, flowFileName, definitions, options);
|
|
193
|
-
return entryPoints;
|
|
194
|
-
}
|
|
195
|
-
async function writePackagingArtifactsDetailed(fs, projectDir, projectId, packagingNodes, bindings, variables, bpmnFileName, startEventId, flowFileName, definitions = [], options = {}) {
|
|
196
|
-
const flowEntryPoints = getEntryPoints(bpmnFileName, packagingNodes, variables, definitions, ProjectType.Flow);
|
|
197
|
-
const entryPoints = [
|
|
198
|
-
...flowEntryPoints,
|
|
199
|
-
...options.additionalEntryPoints ?? []
|
|
200
|
-
];
|
|
201
|
-
await fs.writeFile(fs.path.join(projectDir, "entry-points.json"), `${JSON.stringify(generateEntryPointsJson(entryPoints), null, 2)}
|
|
202
|
-
`);
|
|
203
|
-
const bindingResources = getBindingResources(packagingNodes, bindings, definitions);
|
|
204
|
-
const bindingsJson = normalizePackagingBindingsJson(generateBindingsJson(bindingResources)) ?? emptyPackagingBindingsJson();
|
|
205
|
-
const stagedBindingsJson = mergePackagingBindingsJson([
|
|
206
|
-
bindingsJson,
|
|
207
|
-
...options.additionalBindingsJsons ?? []
|
|
208
|
-
]);
|
|
209
|
-
await fs.writeFile(fs.path.join(projectDir, "bindings_v2.json"), `${JSON.stringify(stagedBindingsJson, null, 2)}
|
|
210
|
-
`);
|
|
211
|
-
const mainEntryPoint = `/${bpmnFileName}#${startEventId}`;
|
|
212
|
-
const operateJson = withRuntimeProfile(generateOperateJson(projectId, mainEntryPoint, operateRuntimeOptions(packagingNodes)), options.profile ?? "Standard" /* Standard */);
|
|
213
|
-
await fs.writeFile(fs.path.join(projectDir, "operate.json"), `${JSON.stringify(operateJson, null, 2)}
|
|
214
|
-
`);
|
|
215
|
-
const packageDescriptorJson = options.packageDescriptorJson ?? {
|
|
216
|
-
$schema: "https://cloud.uipath.com/draft/2024-12/package-descriptor",
|
|
217
|
-
files: {
|
|
218
|
-
"operate.json": "operate.json",
|
|
219
|
-
"entry-points.json": "entry-points.json",
|
|
220
|
-
"bindings.json": "bindings_v2.json",
|
|
221
|
-
[bpmnFileName]: bpmnFileName,
|
|
222
|
-
...flowFileName ? { [flowFileName]: flowFileName } : {}
|
|
223
|
-
}
|
|
224
|
-
};
|
|
225
|
-
await fs.writeFile(fs.path.join(projectDir, "package-descriptor.json"), `${JSON.stringify(packageDescriptorJson, null, 2)}
|
|
226
|
-
`);
|
|
227
|
-
return { entryPoints, bindingsJson: stagedBindingsJson };
|
|
228
|
-
}
|
|
229
|
-
function backfillNodeModelsFromDefinitions(nodes, definitions) {
|
|
230
|
-
if (definitions.length === 0)
|
|
231
|
-
return nodes;
|
|
232
|
-
const definitionByType = new Map;
|
|
233
|
-
for (const def of definitions) {
|
|
234
|
-
if (def?.nodeType)
|
|
235
|
-
definitionByType.set(def.nodeType, def);
|
|
236
|
-
}
|
|
237
|
-
return nodes.map((n) => {
|
|
238
|
-
if (n.model)
|
|
239
|
-
return n;
|
|
240
|
-
const def = definitionByType.get(n.type);
|
|
241
|
-
if (!def?.model)
|
|
242
|
-
return n;
|
|
243
|
-
return { ...n, model: def.model };
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
async function regenerateBindingsFile(fs, flowFilePath) {
|
|
247
|
-
const absolutePath = fs.path.resolve(flowFilePath);
|
|
248
|
-
const projectDir = fs.path.dirname(absolutePath);
|
|
249
|
-
const content = await fs.readFile(absolutePath, "utf-8");
|
|
250
|
-
if (!content) {
|
|
251
|
-
throw new Error(`Could not read .flow file at ${absolutePath}`);
|
|
252
|
-
}
|
|
253
|
-
const [parseErr, flowData] = catchError(() => JSON.parse(content));
|
|
254
|
-
if (parseErr) {
|
|
255
|
-
throw new Error(`Failed to parse .flow file at ${absolutePath}: ${parseErr.message}`);
|
|
256
|
-
}
|
|
257
|
-
const packagingNodes = backfillNodeModelsFromDefinitions(fileNodesToPackagingNodes(flowData.nodes ?? []), flowData.definitions ?? []);
|
|
258
|
-
const bindingResources = getBindingResources(packagingNodes, flowData.bindings ?? [], flowData.definitions ?? []);
|
|
259
|
-
await fs.writeFile(fs.path.join(projectDir, "bindings_v2.json"), `${JSON.stringify(generateBindingsJson(bindingResources), null, 2)}
|
|
260
|
-
`);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
export { fileNodesToPackagingNodes, packageInlineAgents, stageInlineAgentPackageFiles, buildInlineAgentDescriptors, writePackagingArtifacts, writePackagingArtifactsDetailed, regenerateBindingsFile };
|
|
264
|
-
|
|
265
|
-
//# debugId=FF54069E2277B66C64756E2164756E21
|