n8n-editor-ui 1.58.1 → 1.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/@vue-flow/{background-Cs_KhuIs.js → background-BBsDO5na.js} +2 -2
- package/dist/assets/@vue-flow/{controls-DN_qYfUs.js → controls-3RHEV3L7.js} +2 -2
- package/dist/assets/@vue-flow/{core-B3xjPof0.js → core-CM-Aqnx_.js} +3 -3
- package/dist/assets/@vue-flow/{minimap-Bbba1Snt.js → minimap-CbqX0yYi.js} +2 -2
- package/dist/assets/@vue-flow/{node-resizer-C8R17lSK.js → node-resizer-CV5M1itj.js} +2 -2
- package/dist/assets/@vueuse/{core-BHDhJRX_.js → core-AtYOJIrV.js} +20 -20
- package/dist/assets/{AnnotationTagsDropdown-CvbfWPym.js → AnnotationTagsDropdown-Cy7xAt08.js} +3 -3
- package/dist/assets/{AuthView-BGHoHWps.js → AuthView-O49PSWbK.js} +4 -4
- package/dist/assets/{CanvasControls-yHWHIES5.js → CanvasControls-2JYn17IG.js} +9 -9
- package/dist/assets/{ChangePasswordView-CDgfEoHx.js → ChangePasswordView-BQ-iaNRI.js} +10 -10
- package/dist/assets/{CredentialsView-CWxvvrW-.js → CredentialsView-D4jojwGd.js} +32 -18
- package/dist/assets/{ErrorView-D-EXKFCI.js → ErrorView-sr5LjuQu.js} +9 -9
- package/dist/assets/{ExecutionsFilter-KJUXh7xs.js → ExecutionsFilter-gsNAEFrB.js} +4 -4
- package/dist/assets/{ExecutionsView-B6RDT32P.js → ExecutionsView-Dt3ICwxb.js} +12 -12
- package/dist/assets/{FixedCollectionParameter-CZ0AANCx.js → FixedCollectionParameter-C0RvSWqz.js} +9 -9
- package/dist/assets/{ForgotMyPasswordView-CaetKBFO.js → ForgotMyPasswordView-BCWcAxhr.js} +10 -10
- package/dist/assets/{MainHeader-aLR7Mt6h.js → MainHeader-kzk6iaMu.js} +151 -91
- package/dist/assets/{MainHeader-46C-nkS_.css → MainHeader-oXTSMZ8q.css} +9 -9
- package/dist/assets/{MainSidebar-DfnOQqYS.js → MainSidebar-BGJolVoW.js} +10 -10
- package/dist/assets/{NodeCreation-CjvfgqMQ.js → NodeCreation-DKhT4USt.js} +6 -6
- package/dist/assets/{NodeCreator-CqGqvTkz.js → NodeCreator-BsudR6nA.js} +39 -38
- package/dist/assets/{NodeViewSwitcher-CaNkhcKd.js → NodeViewSwitcher-Br1aKc5z.js} +707 -1244
- package/dist/assets/{NodeViewSwitcher-DF46E4YO.css → NodeViewSwitcher-IsNz-KAm.css} +66 -232
- package/dist/assets/{ProjectCardBadge-DQz9p7bj.js → ProjectCardBadge-BwWPs83x.js} +2 -2
- package/dist/assets/{ProjectSettings-D3IQ-XH3.js → ProjectSettings-CbnKAMpv.js} +10 -10
- package/dist/assets/{ProjectTabs-CESKkFkd.js → ProjectTabs-DCJsLAZq.js} +3 -3
- package/dist/assets/{PushConnectionTracker-D7sLotqk.js → PushConnectionTracker-BDzC-g2q.js} +4 -4
- package/dist/assets/{ResourcesListLayout-D54JHUFJ.js → ResourcesListLayout-C5qx_bf5.js} +4 -4
- package/dist/assets/RunDataAi-BkiymeP5.js +1522 -0
- package/dist/assets/RunDataAi-x30tU8-0.css +441 -0
- package/dist/assets/{RunDataJson-psJyY-xC.js → RunDataJson-B3wIzv7T.js} +12 -12
- package/dist/assets/{RunDataJsonActions-B3QM-sD6.js → RunDataJsonActions-BD6e_BuK.js} +10 -10
- package/dist/assets/{RunDataSearch-BNei-8eY.js → RunDataSearch-CFJYdHb7.js} +9 -9
- package/dist/assets/{RunDataTable-BAIw8_GD.js → RunDataTable-DmnGDda9.js} +9 -9
- package/dist/assets/{SamlOnboarding-XHC_OVzS.js → SamlOnboarding-Ya2uwLQu.js} +10 -10
- package/dist/assets/{SettingsApiView-Cxr0YjBj.js → SettingsApiView-CrYz1scI.js} +9 -9
- package/dist/assets/{SettingsCommunityNodesView-DSYLd1NL.js → SettingsCommunityNodesView-EoznGbel.js} +166 -177
- package/dist/assets/{SettingsExternalSecrets-Dixl8U-H.js → SettingsExternalSecrets-DDhgvsbl.js} +9 -9
- package/dist/assets/{SettingsFakeDoorView-Bd9T-Jm8.js → SettingsFakeDoorView-DkL03jRW.js} +9 -9
- package/dist/assets/{SettingsLdapView-DfIJBH3O.js → SettingsLdapView-CY51z81n.js} +11 -11
- package/dist/assets/{SettingsLogStreamingView-D3FvPA8r.js → SettingsLogStreamingView-Ca5plOJu.js} +9 -9
- package/dist/assets/{SettingsPersonalView-Ct9jyNz1.js → SettingsPersonalView-B8uhVdih.js} +9 -9
- package/dist/assets/{SettingsSourceControl-BE695sdL.js → SettingsSourceControl-DJcKTb3l.js} +9 -9
- package/dist/assets/{SettingsSso-CmH0czdA.js → SettingsSso-BLGsGgqo.js} +9 -9
- package/dist/assets/{SettingsUsageAndPlan-Dx8wVLJp.js → SettingsUsageAndPlan-B3WF2qC8.js} +9 -9
- package/dist/assets/{SettingsUsersView-BspD88t8.js → SettingsUsersView-pYsu4DHL.js} +9 -9
- package/dist/assets/{SettingsView-N6ThZ9KM.js → SettingsView-D2T9bJjz.js} +10 -10
- package/dist/assets/{SetupView-B1kM7lwl.js → SetupView-TQNkQn2l.js} +10 -10
- package/dist/assets/{SetupWorkflowCredentialsButton-khECUo1h.js → SetupWorkflowCredentialsButton-DQuLHbTi.js} +9 -9
- package/dist/assets/{SetupWorkflowFromTemplateView-iI2njEvI.js → SetupWorkflowFromTemplateView-CoBlBOLO.js} +11 -11
- package/dist/assets/{SigninView-6itJ-CED.js → SigninView-sdpUg6ZD.js} +10 -10
- package/dist/assets/SignoutView-BbUM-CXk.js +56 -0
- package/dist/assets/{SignupView-Bq18Ktg7.js → SignupView-g95ToDnP.js} +10 -10
- package/dist/assets/{TemplateDetails-Czazhd5s.js → TemplateDetails-DepxHIYU.js} +4 -4
- package/dist/assets/{TemplateList-BeAPaZGs.js → TemplateList-Cb43ADj0.js} +3 -3
- package/dist/assets/{TemplatesCollectionView-CexaV31l.js → TemplatesCollectionView-NP3nhwbl.js} +13 -13
- package/dist/assets/{TemplatesSearchView-DlqM48VA.js → TemplatesSearchView-mi4hfRZg.js} +12 -12
- package/dist/assets/{TemplatesView-8fVX0s-c.js → TemplatesView-CjibD8pY.js} +3 -3
- package/dist/assets/{TemplatesWorkflowView-DVk9fEe9.js → TemplatesWorkflowView-Cfz2Rv22.js} +13 -13
- package/dist/assets/{VariablesView-B4KxaLHe.js → VariablesView-cUihwY2M.js} +10 -10
- package/dist/assets/{WorkerView-C3r2Qksx.js → WorkerView-CqofFMZi.js} +13 -13
- package/dist/assets/{WorkflowActivator-B6SkhHUl.js → WorkflowActivator-CgdV6eRB.js} +29 -12
- package/dist/assets/{WorkflowActivator-5wLNfUgA.css → WorkflowActivator-UkpopT-n.css} +2 -2
- package/dist/assets/{WorkflowExecutionsInfoAccordion-D_uPE3Mm.js → WorkflowExecutionsInfoAccordion-CHBvZeYC.js} +3 -3
- package/dist/assets/{WorkflowExecutionsLandingPage-C4jCCR90.js → WorkflowExecutionsLandingPage-CzXE-udV.js} +10 -10
- package/dist/assets/{WorkflowExecutionsPreview-CQ1EmBkZ.js → WorkflowExecutionsPreview-DAWT0OZA.js} +16 -14
- package/dist/assets/{WorkflowExecutionsView-CdItH9NU.js → WorkflowExecutionsView-CggsVwjO.js} +13 -13
- package/dist/assets/{WorkflowHistory-BHxwr-Yt.js → WorkflowHistory-Ce3fW3mv.js} +11 -11
- package/dist/assets/{WorkflowOnboardingView-BMCtQmja.js → WorkflowOnboardingView-BCrYDc97.js} +9 -9
- package/dist/assets/{WorkflowPreview-Dm-F1IKC.js → WorkflowPreview-5ou2OjhQ.js} +3 -3
- package/dist/assets/{WorkflowsView-OkAUYvKL.js → WorkflowsView-CC28cpPP.js} +29 -17
- package/dist/assets/{cloud-DRWI97VY.js → cloud-fIrexlo0.js} +9 -9
- package/dist/assets/{dateFormatter-BQoEbDGi.js → dateFormatter-Dkb6vbxk.js} +1 -1
- package/dist/assets/{dateformat-BnMKt03f.js → dateformat-B3EyBJMs.js} +1 -1
- package/dist/assets/email-providers-C75kdji1.js +1 -0
- package/dist/assets/{fast-json-stable-stringify-D53fIhuw.js → fast-json-stable-stringify-DEy7178q.js} +1 -1
- package/dist/assets/{file-saver-aVxDTBJI.js → file-saver-DDNIqfqN.js} +1 -1
- package/dist/assets/highlight.js-C75kdji1.js +1 -0
- package/dist/assets/{humanize-duration-DE5qJCgx.js → humanize-duration-BFdc0Kfh.js} +1 -1
- package/dist/assets/{index-Bqkr-RRJ.css → index-DFaBhDtA.css} +30 -12
- package/dist/assets/{index-D1NZCYzm.js → index-DpX7MP1K.js} +927 -784
- package/dist/assets/{jsonpath-rcQTxGBV.js → jsonpath-FNLZVmrL.js} +1 -1
- package/dist/assets/{n8n-Z2397JES.js → n8n-CFF-cZB8.js} +138 -137
- package/dist/assets/{n8n-CeKkptTY.css → n8n-CIUUFRtk.css} +34 -26
- package/dist/assets/{pinia-DvV9jJ-A.js → pinia-C4PgcsWV.js} +1 -1
- package/dist/assets/{pushConnection.store-DtTlLmXK.js → pushConnection.store-BT6Fbt3d.js} +8 -4
- package/dist/assets/{qrcode.vue-Di8rc46A.js → qrcode.vue-EmD3D6Vb.js} +1 -1
- package/dist/assets/{templateActions-YaCceXGU.js → templateActions-DLfxU1tn.js} +1 -1
- package/dist/assets/useBeforeUnload-OBKCsMpw.js +44 -0
- package/dist/assets/{useExecutionDebugging-S7GEmTTt.js → useExecutionDebugging-BWxzrSHC.js} +2 -2
- package/dist/assets/{usePushConnection-Gymv3TIc.js → usePushConnection-DqYL1-t5.js} +31 -11
- package/dist/assets/{useUserHelpers-WhAIJpQu.js → useUserHelpers-CVv0DQfs.js} +1 -1
- package/dist/assets/{useWorkflowActivate-BadnTJWu.js → useWorkflowActivate-DepvkQST.js} +2 -2
- package/dist/assets/{v3-infinite-loading-BVY6QVQT.js → v3-infinite-loading-BDSwUlAm.js} +1 -1
- package/dist/assets/{vendor-tVazXwC6.js → vendor-DCtS1fjk.js} +1 -0
- package/dist/assets/{vue-agile-DZ76wxj6.js → vue-agile-CTnHPMWQ.js} +2 -2
- package/dist/assets/{vue-chartjs-D5H-i6tv.js → vue-chartjs-ytwxJ63I.js} +1 -1
- package/dist/assets/{vue-i18n-DNQ-lWfW.js → vue-i18n-DBLN2Rh9.js} +1 -1
- package/dist/assets/{vue-json-pretty-DirxoTt6.js → vue-json-pretty-B1en_dYW.js} +2 -2
- package/dist/assets/xss-C75kdji1.js +1 -0
- package/dist/index.html +11 -11
- package/package.json +1 -1
- package/dist/assets/RunDataAi-9yv-GkKd.js +0 -876
- package/dist/assets/RunDataAi-HUzSX62R.css +0 -250
- package/dist/assets/SignoutView-hDa3nDs6.js +0 -61
- package/dist/assets/collaboration.store-DUEBB9uv.js +0 -65
- package/dist/assets/email-providers-DwL5ncu9.js +0 -1
- package/dist/assets/xss-DwL5ncu9.js +0 -1
|
@@ -1,876 +0,0 @@
|
|
|
1
|
-
import { I as defineComponent, a as ref, q as onMounted, an as resolveComponent, J as openBlock, K as createElementBlock, L as createBaseVNode, _ as normalizeClass, a8 as createVNode, a7 as toDisplayString, u as unref, V as createBlock, ac as withModifiers, U as createCommentVNode, R as Fragment, af as renderList, f as computed, a3 as withCtx, a6 as createTextVNode, b as watch, $ as normalizeStyle } from "./vendor-tVazXwC6.js";
|
|
2
|
-
import { N as NodeConnectionType, aP as isObjectEmpty, a5 as VueMarkdown, _ as _export_sfc, aQ as ElTree } from "./n8n-Z2397JES.js";
|
|
3
|
-
import { af as useClipboard, u as useToast, j as useI18n, a5 as useNodeTypesStore, k as useWorkflowsStore, aa as _sfc_main$3 } from "./index-D1NZCYzm.js";
|
|
4
|
-
import { F as capitalize } from "./lodash-es-kRWQHL5K.js";
|
|
5
|
-
import "./esprima-next-DUEu30kB.js";
|
|
6
|
-
import "./axios-B4zXCSve.js";
|
|
7
|
-
import "./luxon-Bt_g4NOb.js";
|
|
8
|
-
import "./@vueuse/core-BHDhJRX_.js";
|
|
9
|
-
import "./uuid-sKupIUZ4.js";
|
|
10
|
-
import "./flatted-D70IerrI.js";
|
|
11
|
-
import "./pinia-DvV9jJ-A.js";
|
|
12
|
-
import "./bowser-C3wWO1p5.js";
|
|
13
|
-
import "./@n8n/permissions-BxSXRD9U.js";
|
|
14
|
-
import "./dateformat-BnMKt03f.js";
|
|
15
|
-
import "./vue-i18n-DNQ-lWfW.js";
|
|
16
|
-
import "./@n8n/codemirror-lang-CIGGB1t0.js";
|
|
17
|
-
import "./@lezer/common-CnY9etib.js";
|
|
18
|
-
import "./@n8n/codemirror-lang-sql-C41WNa63.js";
|
|
19
|
-
import "./prettier-_aQB57xD.js";
|
|
20
|
-
import "./@jsplumb/util-BwtpiQ4c.js";
|
|
21
|
-
import "./@jsplumb/core-B__RSZHf.js";
|
|
22
|
-
import "./@jsplumb/common-s1StEx7B.js";
|
|
23
|
-
import "./@jsplumb/connector-bezier-D659hq4c.js";
|
|
24
|
-
import "./@jsplumb/browser-ui-BphmFVJY.js";
|
|
25
|
-
import "./codemirror-lang-html-n8n-CXTCIWzP.js";
|
|
26
|
-
import "./fast-json-stable-stringify-D53fIhuw.js";
|
|
27
|
-
import "./timeago.js-CgQus8nl.js";
|
|
28
|
-
import "./qrcode.vue-Di8rc46A.js";
|
|
29
|
-
import "./vue3-touch-events-DVOgU3fI.js";
|
|
30
|
-
import "./chart.js-DiBOFLDH.js";
|
|
31
|
-
const fallbackParser = (execData) => ({
|
|
32
|
-
type: "json",
|
|
33
|
-
data: execData,
|
|
34
|
-
parsed: false
|
|
35
|
-
});
|
|
36
|
-
const outputTypeParsers = {
|
|
37
|
-
[NodeConnectionType.AiLanguageModel](execData) {
|
|
38
|
-
const response = execData.response ?? execData;
|
|
39
|
-
if (!response)
|
|
40
|
-
throw new Error("No response from Language Model");
|
|
41
|
-
if (Array.isArray(response == null ? void 0 : response.messages) && (response == null ? void 0 : response.messages.length) === 1 && typeof (response == null ? void 0 : response.messages[0]) === "string") {
|
|
42
|
-
return {
|
|
43
|
-
type: "text",
|
|
44
|
-
data: response.messages[0],
|
|
45
|
-
parsed: true
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
if (response.messages && Array.isArray(response.messages)) {
|
|
49
|
-
return outputTypeParsers[NodeConnectionType.AiMemory](execData);
|
|
50
|
-
}
|
|
51
|
-
if (response.generations) {
|
|
52
|
-
const generations = response.generations;
|
|
53
|
-
const content = generations.map((generation) => {
|
|
54
|
-
if (generation == null ? void 0 : generation.text)
|
|
55
|
-
return generation.text;
|
|
56
|
-
if (Array.isArray(generation)) {
|
|
57
|
-
return generation.map((item) => item.text ?? item).join("\n\n").trim();
|
|
58
|
-
}
|
|
59
|
-
return generation;
|
|
60
|
-
});
|
|
61
|
-
return {
|
|
62
|
-
type: "json",
|
|
63
|
-
data: content,
|
|
64
|
-
parsed: true
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
return {
|
|
68
|
-
type: "json",
|
|
69
|
-
data: response,
|
|
70
|
-
parsed: true
|
|
71
|
-
};
|
|
72
|
-
},
|
|
73
|
-
[NodeConnectionType.AiTool]: fallbackParser,
|
|
74
|
-
[NodeConnectionType.AiAgent]: fallbackParser,
|
|
75
|
-
[NodeConnectionType.AiMemory](execData) {
|
|
76
|
-
var _a;
|
|
77
|
-
const chatHistory = execData.chatHistory ?? execData.messages ?? ((_a = execData == null ? void 0 : execData.response) == null ? void 0 : _a.chat_history);
|
|
78
|
-
if (Array.isArray(chatHistory)) {
|
|
79
|
-
const responseText = chatHistory.map((content) => {
|
|
80
|
-
var _a2;
|
|
81
|
-
if (content.type === "constructor" && ((_a2 = content.id) == null ? void 0 : _a2.includes("messages")) && content.kwargs) {
|
|
82
|
-
let message = content.kwargs.content;
|
|
83
|
-
if (Array.isArray(message)) {
|
|
84
|
-
message = message.map((item) => {
|
|
85
|
-
const { type, image_url } = item;
|
|
86
|
-
if (type === "image_url" && typeof image_url === "object" && typeof image_url.url === "string") {
|
|
87
|
-
return ``;
|
|
88
|
-
} else if (typeof image_url === "string") {
|
|
89
|
-
return ``;
|
|
90
|
-
}
|
|
91
|
-
return item.text;
|
|
92
|
-
}).join("\n");
|
|
93
|
-
}
|
|
94
|
-
if (Object.keys(content.kwargs.additional_kwargs).length) {
|
|
95
|
-
message += ` (${JSON.stringify(content.kwargs.additional_kwargs)})`;
|
|
96
|
-
}
|
|
97
|
-
if (content.id.includes("HumanMessage")) {
|
|
98
|
-
message = `**Human:** ${String(message).trim()}`;
|
|
99
|
-
} else if (content.id.includes("AIMessage")) {
|
|
100
|
-
message = `**AI:** ${message}`;
|
|
101
|
-
} else if (content.id.includes("SystemMessage")) {
|
|
102
|
-
message = `**System Message:** ${message}`;
|
|
103
|
-
}
|
|
104
|
-
if (execData.action && typeof execData.action !== "object" && execData.action !== "getMessages") {
|
|
105
|
-
message = `## Action: ${execData.action}
|
|
106
|
-
|
|
107
|
-
${message}`;
|
|
108
|
-
}
|
|
109
|
-
return message;
|
|
110
|
-
}
|
|
111
|
-
return "";
|
|
112
|
-
}).join("\n\n");
|
|
113
|
-
return {
|
|
114
|
-
type: "markdown",
|
|
115
|
-
data: responseText,
|
|
116
|
-
parsed: true
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
return fallbackParser(execData);
|
|
120
|
-
},
|
|
121
|
-
[NodeConnectionType.AiOutputParser]: fallbackParser,
|
|
122
|
-
[NodeConnectionType.AiRetriever]: fallbackParser,
|
|
123
|
-
[NodeConnectionType.AiVectorStore](execData) {
|
|
124
|
-
if (execData.documents) {
|
|
125
|
-
return {
|
|
126
|
-
type: "json",
|
|
127
|
-
data: execData.documents,
|
|
128
|
-
parsed: true
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
return fallbackParser(execData);
|
|
132
|
-
},
|
|
133
|
-
[NodeConnectionType.AiEmbedding](execData) {
|
|
134
|
-
if (execData.documents) {
|
|
135
|
-
return {
|
|
136
|
-
type: "json",
|
|
137
|
-
data: execData.documents,
|
|
138
|
-
parsed: true
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
return fallbackParser(execData);
|
|
142
|
-
},
|
|
143
|
-
[NodeConnectionType.AiDocument](execData) {
|
|
144
|
-
if (execData.documents) {
|
|
145
|
-
return {
|
|
146
|
-
type: "json",
|
|
147
|
-
data: execData.documents,
|
|
148
|
-
parsed: true
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
return fallbackParser(execData);
|
|
152
|
-
},
|
|
153
|
-
[NodeConnectionType.AiTextSplitter](execData) {
|
|
154
|
-
const arrayData = Array.isArray(execData.response) ? execData.response : [execData.textSplitter];
|
|
155
|
-
return {
|
|
156
|
-
type: "text",
|
|
157
|
-
data: arrayData.join("\n\n"),
|
|
158
|
-
parsed: true
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
const useAiContentParsers = () => {
|
|
163
|
-
const parseAiRunData = (executionData, endpointType) => {
|
|
164
|
-
if ([NodeConnectionType.AiChain, NodeConnectionType.Main].includes(endpointType)) {
|
|
165
|
-
return executionData.map((data) => ({ raw: data.json, parsedContent: null }));
|
|
166
|
-
}
|
|
167
|
-
const contentJson = executionData.map((node) => {
|
|
168
|
-
const hasBinarData = !isObjectEmpty(node.binary);
|
|
169
|
-
return hasBinarData ? node.binary : node.json;
|
|
170
|
-
});
|
|
171
|
-
const parser = outputTypeParsers[endpointType];
|
|
172
|
-
if (!parser)
|
|
173
|
-
return [
|
|
174
|
-
{
|
|
175
|
-
raw: contentJson.filter((item) => item !== void 0),
|
|
176
|
-
parsedContent: null
|
|
177
|
-
}
|
|
178
|
-
];
|
|
179
|
-
const parsedOutput = contentJson.filter((c) => c !== void 0).map((c) => ({ raw: c, parsedContent: parser(c) }));
|
|
180
|
-
return parsedOutput;
|
|
181
|
-
};
|
|
182
|
-
return {
|
|
183
|
-
parseAiRunData
|
|
184
|
-
};
|
|
185
|
-
};
|
|
186
|
-
const _hoisted_1$2 = ["data-content-type"];
|
|
187
|
-
const _hoisted_2$2 = ["textContent"];
|
|
188
|
-
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
189
|
-
__name: "AiRunContentBlock",
|
|
190
|
-
props: {
|
|
191
|
-
runData: {}
|
|
192
|
-
},
|
|
193
|
-
setup(__props) {
|
|
194
|
-
const props = __props;
|
|
195
|
-
const i18n = useI18n();
|
|
196
|
-
const clipboard = useClipboard();
|
|
197
|
-
const { showMessage } = useToast();
|
|
198
|
-
const contentParsers = useAiContentParsers();
|
|
199
|
-
const isExpanded = ref(getInitialExpandedState());
|
|
200
|
-
const isShowRaw = ref(false);
|
|
201
|
-
const contentParsed = ref(false);
|
|
202
|
-
const parsedRun = ref(void 0);
|
|
203
|
-
function getInitialExpandedState() {
|
|
204
|
-
const collapsedTypes = {
|
|
205
|
-
input: [NodeConnectionType.AiDocument, NodeConnectionType.AiTextSplitter],
|
|
206
|
-
output: [
|
|
207
|
-
NodeConnectionType.AiDocument,
|
|
208
|
-
NodeConnectionType.AiEmbedding,
|
|
209
|
-
NodeConnectionType.AiTextSplitter,
|
|
210
|
-
NodeConnectionType.AiVectorStore
|
|
211
|
-
]
|
|
212
|
-
};
|
|
213
|
-
return !collapsedTypes[props.runData.inOut].includes(props.runData.type);
|
|
214
|
-
}
|
|
215
|
-
function parseAiRunData(run) {
|
|
216
|
-
if (!run.data) {
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
|
-
const parsedData = contentParsers.parseAiRunData(run.data, run.type);
|
|
220
|
-
return parsedData;
|
|
221
|
-
}
|
|
222
|
-
function isMarkdown(content) {
|
|
223
|
-
if (typeof content !== "string")
|
|
224
|
-
return false;
|
|
225
|
-
const markdownPatterns = [
|
|
226
|
-
/^# .+/gm,
|
|
227
|
-
// headers
|
|
228
|
-
/\*{1,2}.+\*{1,2}/g,
|
|
229
|
-
// emphasis and strong
|
|
230
|
-
/\[.+\]\(.+\)/g,
|
|
231
|
-
// links
|
|
232
|
-
/```[\s\S]+```/g
|
|
233
|
-
// code blocks
|
|
234
|
-
];
|
|
235
|
-
return markdownPatterns.some((pattern) => pattern.test(content));
|
|
236
|
-
}
|
|
237
|
-
function formatToJsonMarkdown(data) {
|
|
238
|
-
return "```json\n" + data + "\n```";
|
|
239
|
-
}
|
|
240
|
-
function jsonToMarkdown(data) {
|
|
241
|
-
if (isMarkdown(data))
|
|
242
|
-
return data;
|
|
243
|
-
if (Array.isArray(data) && data.length && typeof data[0] !== "number") {
|
|
244
|
-
const markdownArray = data.map((item) => jsonToMarkdown(item));
|
|
245
|
-
return markdownArray.join("\n\n").trim();
|
|
246
|
-
}
|
|
247
|
-
if (typeof data === "string") {
|
|
248
|
-
return formatToJsonMarkdown(data);
|
|
249
|
-
}
|
|
250
|
-
return formatToJsonMarkdown(JSON.stringify(data, null, 2));
|
|
251
|
-
}
|
|
252
|
-
function setContentParsed(content) {
|
|
253
|
-
contentParsed.value = !!content.find((item) => {
|
|
254
|
-
var _a;
|
|
255
|
-
if (((_a = item.parsedContent) == null ? void 0 : _a.parsed) === true) {
|
|
256
|
-
return true;
|
|
257
|
-
}
|
|
258
|
-
return false;
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
function onBlockHeaderClick() {
|
|
262
|
-
isExpanded.value = !isExpanded.value;
|
|
263
|
-
}
|
|
264
|
-
function onCopyToClipboard(content) {
|
|
265
|
-
try {
|
|
266
|
-
void clipboard.copy(JSON.stringify(content, void 0, 2));
|
|
267
|
-
showMessage({
|
|
268
|
-
title: i18n.baseText("generic.copiedToClipboard"),
|
|
269
|
-
type: "success"
|
|
270
|
-
});
|
|
271
|
-
} catch (err) {
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
onMounted(() => {
|
|
275
|
-
parsedRun.value = parseAiRunData(props.runData);
|
|
276
|
-
if (parsedRun.value) {
|
|
277
|
-
setContentParsed(parsedRun.value);
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
|
-
return (_ctx, _cache) => {
|
|
281
|
-
const _component_font_awesome_icon = resolveComponent("font-awesome-icon");
|
|
282
|
-
const _component_el_switch = resolveComponent("el-switch");
|
|
283
|
-
const _component_n8n_icon_button = resolveComponent("n8n-icon-button");
|
|
284
|
-
return openBlock(), createElementBlock("div", {
|
|
285
|
-
class: normalizeClass(_ctx.$style.block)
|
|
286
|
-
}, [
|
|
287
|
-
createBaseVNode("header", {
|
|
288
|
-
class: normalizeClass(_ctx.$style.blockHeader),
|
|
289
|
-
onClick: onBlockHeaderClick
|
|
290
|
-
}, [
|
|
291
|
-
createBaseVNode("button", {
|
|
292
|
-
class: normalizeClass(_ctx.$style.blockToggle)
|
|
293
|
-
}, [
|
|
294
|
-
createVNode(_component_font_awesome_icon, {
|
|
295
|
-
icon: isExpanded.value ? "angle-down" : "angle-up",
|
|
296
|
-
size: "lg"
|
|
297
|
-
}, null, 8, ["icon"])
|
|
298
|
-
], 2),
|
|
299
|
-
createBaseVNode("p", {
|
|
300
|
-
class: normalizeClass(_ctx.$style.blockTitle)
|
|
301
|
-
}, toDisplayString(unref(capitalize)(_ctx.runData.inOut)), 3),
|
|
302
|
-
contentParsed.value ? (openBlock(), createBlock(_component_el_switch, {
|
|
303
|
-
key: 0,
|
|
304
|
-
modelValue: isShowRaw.value,
|
|
305
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isShowRaw.value = $event),
|
|
306
|
-
class: normalizeClass(_ctx.$style.rawSwitch),
|
|
307
|
-
"active-text": "RAW JSON",
|
|
308
|
-
onClick: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
309
|
-
}, ["stop"]))
|
|
310
|
-
}, null, 8, ["modelValue", "class"])) : createCommentVNode("", true)
|
|
311
|
-
], 2),
|
|
312
|
-
createBaseVNode("main", {
|
|
313
|
-
class: normalizeClass({
|
|
314
|
-
[_ctx.$style.blockContent]: true,
|
|
315
|
-
[_ctx.$style.blockContentExpanded]: isExpanded.value
|
|
316
|
-
})
|
|
317
|
-
}, [
|
|
318
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(parsedRun.value, ({ parsedContent, raw }, index) => {
|
|
319
|
-
return openBlock(), createElementBlock("div", {
|
|
320
|
-
key: index,
|
|
321
|
-
class: normalizeClass(_ctx.$style.contentText),
|
|
322
|
-
"data-content-type": parsedContent == null ? void 0 : parsedContent.type
|
|
323
|
-
}, [
|
|
324
|
-
parsedContent && !isShowRaw.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
325
|
-
parsedContent.type === "json" ? (openBlock(), createBlock(unref(VueMarkdown), {
|
|
326
|
-
key: 0,
|
|
327
|
-
source: jsonToMarkdown(parsedContent.data),
|
|
328
|
-
class: normalizeClass(_ctx.$style.markdown)
|
|
329
|
-
}, null, 8, ["source", "class"])) : createCommentVNode("", true),
|
|
330
|
-
parsedContent.type === "markdown" ? (openBlock(), createBlock(unref(VueMarkdown), {
|
|
331
|
-
key: 1,
|
|
332
|
-
source: parsedContent.data,
|
|
333
|
-
class: normalizeClass(_ctx.$style.markdown)
|
|
334
|
-
}, null, 8, ["source", "class"])) : createCommentVNode("", true),
|
|
335
|
-
parsedContent.type === "text" ? (openBlock(), createElementBlock("p", {
|
|
336
|
-
key: 2,
|
|
337
|
-
class: normalizeClass(_ctx.$style.runText),
|
|
338
|
-
textContent: toDisplayString(parsedContent.data)
|
|
339
|
-
}, null, 10, _hoisted_2$2)) : createCommentVNode("", true)
|
|
340
|
-
], 64)) : (openBlock(), createElementBlock("div", {
|
|
341
|
-
key: 1,
|
|
342
|
-
class: normalizeClass(_ctx.$style.rawContent)
|
|
343
|
-
}, [
|
|
344
|
-
createVNode(_component_n8n_icon_button, {
|
|
345
|
-
size: "small",
|
|
346
|
-
class: normalizeClass(_ctx.$style.copyToClipboard),
|
|
347
|
-
type: "secondary",
|
|
348
|
-
title: _ctx.$locale.baseText("nodeErrorView.copyToClipboard"),
|
|
349
|
-
icon: "copy",
|
|
350
|
-
onClick: ($event) => onCopyToClipboard(raw)
|
|
351
|
-
}, null, 8, ["class", "title", "onClick"]),
|
|
352
|
-
createVNode(unref(VueMarkdown), {
|
|
353
|
-
source: jsonToMarkdown(raw),
|
|
354
|
-
class: normalizeClass(_ctx.$style.markdown)
|
|
355
|
-
}, null, 8, ["source", "class"])
|
|
356
|
-
], 2))
|
|
357
|
-
], 10, _hoisted_1$2);
|
|
358
|
-
}), 128))
|
|
359
|
-
], 2)
|
|
360
|
-
], 2);
|
|
361
|
-
};
|
|
362
|
-
}
|
|
363
|
-
});
|
|
364
|
-
const copyToClipboard = "_copyToClipboard_1bt7e_1";
|
|
365
|
-
const rawContent = "_rawContent_1bt7e_7";
|
|
366
|
-
const markdown = "_markdown_1bt7e_11";
|
|
367
|
-
const contentText = "_contentText_1bt7e_35";
|
|
368
|
-
const block = "_block_1bt7e_40";
|
|
369
|
-
const blockContent = "_blockContent_1bt7e_48";
|
|
370
|
-
const blockContentExpanded = "_blockContentExpanded_1bt7e_52";
|
|
371
|
-
const runText = "_runText_1bt7e_56";
|
|
372
|
-
const rawSwitch = "_rawSwitch_1bt7e_61";
|
|
373
|
-
const blockHeader = "_blockHeader_1bt7e_68";
|
|
374
|
-
const blockTitle = "_blockTitle_1bt7e_80";
|
|
375
|
-
const blockToggle = "_blockToggle_1bt7e_85";
|
|
376
|
-
const style0$2 = {
|
|
377
|
-
copyToClipboard,
|
|
378
|
-
rawContent,
|
|
379
|
-
markdown,
|
|
380
|
-
contentText,
|
|
381
|
-
block,
|
|
382
|
-
blockContent,
|
|
383
|
-
blockContentExpanded,
|
|
384
|
-
runText,
|
|
385
|
-
rawSwitch,
|
|
386
|
-
blockHeader,
|
|
387
|
-
blockTitle,
|
|
388
|
-
blockToggle
|
|
389
|
-
};
|
|
390
|
-
const cssModules$2 = {
|
|
391
|
-
"$style": style0$2
|
|
392
|
-
};
|
|
393
|
-
const AiRunContentBlock = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__cssModules", cssModules$2]]);
|
|
394
|
-
const _hoisted_1$1 = { key: 0 };
|
|
395
|
-
const _hoisted_2$1 = { key: 1 };
|
|
396
|
-
const _hoisted_3$1 = /* @__PURE__ */ createBaseVNode("br", null, null, -1);
|
|
397
|
-
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
398
|
-
__name: "RunDataAiContent",
|
|
399
|
-
props: {
|
|
400
|
-
inputData: {},
|
|
401
|
-
contentIndex: {}
|
|
402
|
-
},
|
|
403
|
-
setup(__props) {
|
|
404
|
-
const props = __props;
|
|
405
|
-
const nodeTypesStore = useNodeTypesStore();
|
|
406
|
-
const workflowsStore = useWorkflowsStore();
|
|
407
|
-
const consumedTokensSum = computed(() => {
|
|
408
|
-
var _a, _b;
|
|
409
|
-
const tokenUsage = (_b = (_a = outputRun.value) == null ? void 0 : _a.data) == null ? void 0 : _b.reduce(
|
|
410
|
-
(acc, curr) => {
|
|
411
|
-
var _a2, _b2;
|
|
412
|
-
const tokenUsageData = ((_a2 = curr.json) == null ? void 0 : _a2.tokenUsage) ?? ((_b2 = curr.json) == null ? void 0 : _b2.tokenUsageEstimate);
|
|
413
|
-
if (!tokenUsageData)
|
|
414
|
-
return acc;
|
|
415
|
-
return {
|
|
416
|
-
completionTokens: acc.completionTokens + tokenUsageData.completionTokens,
|
|
417
|
-
promptTokens: acc.promptTokens + tokenUsageData.promptTokens,
|
|
418
|
-
totalTokens: acc.totalTokens + tokenUsageData.totalTokens
|
|
419
|
-
};
|
|
420
|
-
},
|
|
421
|
-
{
|
|
422
|
-
completionTokens: 0,
|
|
423
|
-
promptTokens: 0,
|
|
424
|
-
totalTokens: 0
|
|
425
|
-
}
|
|
426
|
-
);
|
|
427
|
-
return tokenUsage;
|
|
428
|
-
});
|
|
429
|
-
const usingTokensEstimates = computed(() => {
|
|
430
|
-
var _a, _b;
|
|
431
|
-
return (_b = (_a = outputRun.value) == null ? void 0 : _a.data) == null ? void 0 : _b.some((d) => {
|
|
432
|
-
var _a2;
|
|
433
|
-
return (_a2 = d.json) == null ? void 0 : _a2.tokenUsageEstimate;
|
|
434
|
-
});
|
|
435
|
-
});
|
|
436
|
-
function formatTokenUsageCount(count) {
|
|
437
|
-
return usingTokensEstimates.value ? `~${count}` : count.toString();
|
|
438
|
-
}
|
|
439
|
-
function extractRunMeta(run) {
|
|
440
|
-
const uiNode = workflowsStore.getNodeByName(props.inputData.node);
|
|
441
|
-
const nodeType = nodeTypesStore.getNodeType((uiNode == null ? void 0 : uiNode.type) ?? "");
|
|
442
|
-
const runMeta2 = {
|
|
443
|
-
startTimeMs: run.metadata.startTime,
|
|
444
|
-
executionTimeMs: run.metadata.executionTime,
|
|
445
|
-
node: nodeType,
|
|
446
|
-
type: run.inOut,
|
|
447
|
-
connectionType: run.type
|
|
448
|
-
};
|
|
449
|
-
return runMeta2;
|
|
450
|
-
}
|
|
451
|
-
const outputRun = computed(() => {
|
|
452
|
-
return props.inputData.data.find((r) => r.inOut === "output");
|
|
453
|
-
});
|
|
454
|
-
const runMeta = computed(() => {
|
|
455
|
-
if (outputRun.value === void 0) {
|
|
456
|
-
return;
|
|
457
|
-
}
|
|
458
|
-
return extractRunMeta(outputRun.value);
|
|
459
|
-
});
|
|
460
|
-
return (_ctx, _cache) => {
|
|
461
|
-
var _a, _b, _c, _d, _e, _f;
|
|
462
|
-
const _component_n8n_tooltip = resolveComponent("n8n-tooltip");
|
|
463
|
-
const _component_n8n_text = resolveComponent("n8n-text");
|
|
464
|
-
const _component_n8n_info_tip = resolveComponent("n8n-info-tip");
|
|
465
|
-
return openBlock(), createElementBlock("div", {
|
|
466
|
-
class: normalizeClass(_ctx.$style.container)
|
|
467
|
-
}, [
|
|
468
|
-
createBaseVNode("header", {
|
|
469
|
-
class: normalizeClass(_ctx.$style.header)
|
|
470
|
-
}, [
|
|
471
|
-
((_a = runMeta.value) == null ? void 0 : _a.node) ? (openBlock(), createBlock(_sfc_main$3, {
|
|
472
|
-
key: 0,
|
|
473
|
-
class: normalizeClass(_ctx.$style.nodeIcon),
|
|
474
|
-
"node-type": runMeta.value.node,
|
|
475
|
-
size: 20
|
|
476
|
-
}, null, 8, ["class", "node-type"])) : createCommentVNode("", true),
|
|
477
|
-
createBaseVNode("div", {
|
|
478
|
-
class: normalizeClass(_ctx.$style.headerWrap)
|
|
479
|
-
}, [
|
|
480
|
-
createBaseVNode("p", {
|
|
481
|
-
class: normalizeClass(_ctx.$style.title)
|
|
482
|
-
}, toDisplayString(_ctx.inputData.node), 3),
|
|
483
|
-
createBaseVNode("ul", {
|
|
484
|
-
class: normalizeClass(_ctx.$style.meta)
|
|
485
|
-
}, [
|
|
486
|
-
((_b = runMeta.value) == null ? void 0 : _b.startTimeMs) ? (openBlock(), createElementBlock("li", _hoisted_1$1, toDisplayString((_c = runMeta.value) == null ? void 0 : _c.executionTimeMs) + "ms", 1)) : createCommentVNode("", true),
|
|
487
|
-
((_d = runMeta.value) == null ? void 0 : _d.startTimeMs) ? (openBlock(), createElementBlock("li", _hoisted_2$1, [
|
|
488
|
-
createVNode(_component_n8n_tooltip, null, {
|
|
489
|
-
content: withCtx(() => {
|
|
490
|
-
var _a2;
|
|
491
|
-
return [
|
|
492
|
-
createTextVNode(toDisplayString(new Date((_a2 = runMeta.value) == null ? void 0 : _a2.startTimeMs).toLocaleString()), 1)
|
|
493
|
-
];
|
|
494
|
-
}),
|
|
495
|
-
default: withCtx(() => {
|
|
496
|
-
var _a2;
|
|
497
|
-
return [
|
|
498
|
-
createTextVNode(" " + toDisplayString(_ctx.$locale.baseText("runData.aiContentBlock.startedAt", {
|
|
499
|
-
interpolate: {
|
|
500
|
-
startTime: new Date((_a2 = runMeta.value) == null ? void 0 : _a2.startTimeMs).toLocaleTimeString()
|
|
501
|
-
}
|
|
502
|
-
})), 1)
|
|
503
|
-
];
|
|
504
|
-
}),
|
|
505
|
-
_: 1
|
|
506
|
-
})
|
|
507
|
-
])) : createCommentVNode("", true),
|
|
508
|
-
(((_e = consumedTokensSum.value) == null ? void 0 : _e.totalTokens) ?? 0) > 0 ? (openBlock(), createElementBlock("li", {
|
|
509
|
-
key: 2,
|
|
510
|
-
class: normalizeClass(_ctx.$style.tokensUsage)
|
|
511
|
-
}, [
|
|
512
|
-
createTextVNode(toDisplayString(_ctx.$locale.baseText("runData.aiContentBlock.tokens", {
|
|
513
|
-
interpolate: {
|
|
514
|
-
count: formatTokenUsageCount(((_f = consumedTokensSum.value) == null ? void 0 : _f.totalTokens) ?? 0)
|
|
515
|
-
}
|
|
516
|
-
})) + " ", 1),
|
|
517
|
-
createVNode(_component_n8n_info_tip, {
|
|
518
|
-
type: "tooltip",
|
|
519
|
-
theme: "info-light",
|
|
520
|
-
"tooltip-placement": "right"
|
|
521
|
-
}, {
|
|
522
|
-
default: withCtx(() => [
|
|
523
|
-
createBaseVNode("div", null, [
|
|
524
|
-
createVNode(_component_n8n_text, {
|
|
525
|
-
bold: true,
|
|
526
|
-
size: "small"
|
|
527
|
-
}, {
|
|
528
|
-
default: withCtx(() => {
|
|
529
|
-
var _a2;
|
|
530
|
-
return [
|
|
531
|
-
createTextVNode(toDisplayString(_ctx.$locale.baseText("runData.aiContentBlock.tokens.prompt")) + " " + toDisplayString(_ctx.$locale.baseText("runData.aiContentBlock.tokens", {
|
|
532
|
-
interpolate: {
|
|
533
|
-
count: formatTokenUsageCount(((_a2 = consumedTokensSum.value) == null ? void 0 : _a2.promptTokens) ?? 0)
|
|
534
|
-
}
|
|
535
|
-
})), 1)
|
|
536
|
-
];
|
|
537
|
-
}),
|
|
538
|
-
_: 1
|
|
539
|
-
}),
|
|
540
|
-
_hoisted_3$1,
|
|
541
|
-
createVNode(_component_n8n_text, {
|
|
542
|
-
bold: true,
|
|
543
|
-
size: "small"
|
|
544
|
-
}, {
|
|
545
|
-
default: withCtx(() => {
|
|
546
|
-
var _a2;
|
|
547
|
-
return [
|
|
548
|
-
createTextVNode(toDisplayString(_ctx.$locale.baseText("runData.aiContentBlock.tokens.completion")) + " " + toDisplayString(_ctx.$locale.baseText("runData.aiContentBlock.tokens", {
|
|
549
|
-
interpolate: {
|
|
550
|
-
count: formatTokenUsageCount(((_a2 = consumedTokensSum.value) == null ? void 0 : _a2.completionTokens) ?? 0)
|
|
551
|
-
}
|
|
552
|
-
})), 1)
|
|
553
|
-
];
|
|
554
|
-
}),
|
|
555
|
-
_: 1
|
|
556
|
-
})
|
|
557
|
-
])
|
|
558
|
-
]),
|
|
559
|
-
_: 1
|
|
560
|
-
})
|
|
561
|
-
], 2)) : createCommentVNode("", true)
|
|
562
|
-
], 2)
|
|
563
|
-
], 2)
|
|
564
|
-
], 2),
|
|
565
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(props.inputData.data, (run, index) => {
|
|
566
|
-
return openBlock(), createElementBlock("main", {
|
|
567
|
-
key: index,
|
|
568
|
-
class: normalizeClass(_ctx.$style.content)
|
|
569
|
-
}, [
|
|
570
|
-
createVNode(AiRunContentBlock, { "run-data": run }, null, 8, ["run-data"])
|
|
571
|
-
], 2);
|
|
572
|
-
}), 128))
|
|
573
|
-
], 2);
|
|
574
|
-
};
|
|
575
|
-
}
|
|
576
|
-
});
|
|
577
|
-
const container$1 = "_container_dypaw_2";
|
|
578
|
-
const nodeIcon = "_nodeIcon_dypaw_5";
|
|
579
|
-
const header = "_header_dypaw_8";
|
|
580
|
-
const headerWrap = "_headerWrap_dypaw_14";
|
|
581
|
-
const title$1 = "_title_dypaw_18";
|
|
582
|
-
const meta = "_meta_dypaw_25";
|
|
583
|
-
const tokensUsage = "_tokensUsage_dypaw_41";
|
|
584
|
-
const style0$1 = {
|
|
585
|
-
container: container$1,
|
|
586
|
-
nodeIcon,
|
|
587
|
-
header,
|
|
588
|
-
headerWrap,
|
|
589
|
-
title: title$1,
|
|
590
|
-
meta,
|
|
591
|
-
tokensUsage
|
|
592
|
-
};
|
|
593
|
-
const cssModules$1 = {
|
|
594
|
-
"$style": style0$1
|
|
595
|
-
};
|
|
596
|
-
const RunDataAiContent = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__cssModules", cssModules$1]]);
|
|
597
|
-
const _hoisted_1 = ["data-tree-depth"];
|
|
598
|
-
const _hoisted_2 = ["onClick"];
|
|
599
|
-
const _hoisted_3 = ["textContent"];
|
|
600
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
601
|
-
__name: "RunDataAi",
|
|
602
|
-
props: {
|
|
603
|
-
node: {},
|
|
604
|
-
runIndex: { default: 0 },
|
|
605
|
-
hideTitle: { type: Boolean },
|
|
606
|
-
slim: { type: Boolean }
|
|
607
|
-
},
|
|
608
|
-
setup(__props) {
|
|
609
|
-
const props = __props;
|
|
610
|
-
const workflowsStore = useWorkflowsStore();
|
|
611
|
-
const nodeTypesStore = useNodeTypesStore();
|
|
612
|
-
const selectedRun = ref([]);
|
|
613
|
-
function isTreeNodeSelected(node) {
|
|
614
|
-
return selectedRun.value.some((run) => run.node === node.node && run.runIndex === node.runIndex);
|
|
615
|
-
}
|
|
616
|
-
function getReferencedData(reference, withInput, withOutput) {
|
|
617
|
-
const resultData = workflowsStore.getWorkflowResultDataByNodeName(reference.node);
|
|
618
|
-
if (!(resultData == null ? void 0 : resultData[reference.runIndex])) {
|
|
619
|
-
return [];
|
|
620
|
-
}
|
|
621
|
-
const taskData = resultData[reference.runIndex];
|
|
622
|
-
if (!taskData) {
|
|
623
|
-
return [];
|
|
624
|
-
}
|
|
625
|
-
const returnData = [];
|
|
626
|
-
function addFunction(data, inOut) {
|
|
627
|
-
if (!data) {
|
|
628
|
-
return;
|
|
629
|
-
}
|
|
630
|
-
Object.keys(data).map((type) => {
|
|
631
|
-
returnData.push({
|
|
632
|
-
data: data[type][0],
|
|
633
|
-
inOut,
|
|
634
|
-
type,
|
|
635
|
-
metadata: {
|
|
636
|
-
executionTime: taskData.executionTime,
|
|
637
|
-
startTime: taskData.startTime
|
|
638
|
-
}
|
|
639
|
-
});
|
|
640
|
-
});
|
|
641
|
-
}
|
|
642
|
-
if (withInput) {
|
|
643
|
-
addFunction(taskData.inputOverride, "input");
|
|
644
|
-
}
|
|
645
|
-
if (withOutput) {
|
|
646
|
-
addFunction(taskData.data, "output");
|
|
647
|
-
}
|
|
648
|
-
return returnData;
|
|
649
|
-
}
|
|
650
|
-
function toggleTreeItem(node) {
|
|
651
|
-
node.expanded = !node.expanded;
|
|
652
|
-
}
|
|
653
|
-
function onItemClick(data) {
|
|
654
|
-
var _a;
|
|
655
|
-
const matchingRun = (_a = aiData.value) == null ? void 0 : _a.find(
|
|
656
|
-
(run) => run.node === data.node && run.runIndex === data.runIndex
|
|
657
|
-
);
|
|
658
|
-
if (!matchingRun) {
|
|
659
|
-
selectedRun.value = [];
|
|
660
|
-
return;
|
|
661
|
-
}
|
|
662
|
-
selectedRun.value = [
|
|
663
|
-
{
|
|
664
|
-
node: data.node,
|
|
665
|
-
runIndex: data.runIndex,
|
|
666
|
-
data: getReferencedData(
|
|
667
|
-
{
|
|
668
|
-
node: data.node,
|
|
669
|
-
runIndex: data.runIndex
|
|
670
|
-
},
|
|
671
|
-
true,
|
|
672
|
-
true
|
|
673
|
-
)
|
|
674
|
-
}
|
|
675
|
-
];
|
|
676
|
-
}
|
|
677
|
-
function getNodeType(nodeName) {
|
|
678
|
-
const node = workflowsStore.getNodeByName(nodeName);
|
|
679
|
-
if (!node) {
|
|
680
|
-
return null;
|
|
681
|
-
}
|
|
682
|
-
const nodeType = nodeTypesStore.getNodeType(node == null ? void 0 : node.type);
|
|
683
|
-
return nodeType;
|
|
684
|
-
}
|
|
685
|
-
function selectFirst() {
|
|
686
|
-
if (executionTree.value.length && executionTree.value[0].children.length) {
|
|
687
|
-
onItemClick(executionTree.value[0].children[0]);
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
const createNode = (nodeName, currentDepth, r, children = []) => {
|
|
691
|
-
var _a, _b;
|
|
692
|
-
return {
|
|
693
|
-
node: nodeName,
|
|
694
|
-
id: nodeName,
|
|
695
|
-
depth: currentDepth,
|
|
696
|
-
startTime: ((_b = (_a = r == null ? void 0 : r.data) == null ? void 0 : _a.metadata) == null ? void 0 : _b.startTime) ?? 0,
|
|
697
|
-
runIndex: (r == null ? void 0 : r.runIndex) ?? 0,
|
|
698
|
-
children
|
|
699
|
-
};
|
|
700
|
-
};
|
|
701
|
-
function getTreeNodeData(nodeName, currentDepth) {
|
|
702
|
-
var _a;
|
|
703
|
-
const { connectionsByDestinationNode } = workflowsStore.getCurrentWorkflow();
|
|
704
|
-
const connections = connectionsByDestinationNode[nodeName];
|
|
705
|
-
const resultData = ((_a = aiData.value) == null ? void 0 : _a.filter((data) => data.node === nodeName)) ?? [];
|
|
706
|
-
if (!connections) {
|
|
707
|
-
return resultData.map((d) => createNode(nodeName, currentDepth, d));
|
|
708
|
-
}
|
|
709
|
-
const nonMainConnectionsKeys = Object.keys(connections).filter(
|
|
710
|
-
(key) => key !== NodeConnectionType.Main
|
|
711
|
-
);
|
|
712
|
-
const children = nonMainConnectionsKeys.flatMap(
|
|
713
|
-
(key) => connections[key][0].flatMap((node) => getTreeNodeData(node.node, currentDepth + 1))
|
|
714
|
-
);
|
|
715
|
-
if (resultData.length) {
|
|
716
|
-
return resultData.map((r) => createNode(nodeName, currentDepth, r, children));
|
|
717
|
-
}
|
|
718
|
-
children.sort((a, b) => a.startTime - b.startTime);
|
|
719
|
-
return [createNode(nodeName, currentDepth, void 0, children)];
|
|
720
|
-
}
|
|
721
|
-
const aiData = computed(() => {
|
|
722
|
-
var _a;
|
|
723
|
-
const resultData = workflowsStore.getWorkflowResultDataByNodeName(props.node.name);
|
|
724
|
-
if (!resultData || !Array.isArray(resultData)) {
|
|
725
|
-
return;
|
|
726
|
-
}
|
|
727
|
-
const subRun = (_a = resultData[props.runIndex].metadata) == null ? void 0 : _a.subRun;
|
|
728
|
-
if (!Array.isArray(subRun)) {
|
|
729
|
-
return;
|
|
730
|
-
}
|
|
731
|
-
const subRunWithData = subRun.flatMap(
|
|
732
|
-
(run) => getReferencedData(run, false, true).map((data) => ({ ...run, data }))
|
|
733
|
-
);
|
|
734
|
-
subRunWithData.sort((a, b) => {
|
|
735
|
-
var _a2, _b, _c, _d;
|
|
736
|
-
const aTime = ((_b = (_a2 = a.data) == null ? void 0 : _a2.metadata) == null ? void 0 : _b.startTime) || 0;
|
|
737
|
-
const bTime = ((_d = (_c = b.data) == null ? void 0 : _c.metadata) == null ? void 0 : _d.startTime) || 0;
|
|
738
|
-
return aTime - bTime;
|
|
739
|
-
});
|
|
740
|
-
return subRunWithData;
|
|
741
|
-
});
|
|
742
|
-
const executionTree = computed(() => {
|
|
743
|
-
const rootNode = props.node;
|
|
744
|
-
const tree2 = getTreeNodeData(rootNode.name, 0);
|
|
745
|
-
return tree2 || [];
|
|
746
|
-
});
|
|
747
|
-
watch(() => props.runIndex, selectFirst, { immediate: true });
|
|
748
|
-
return (_ctx, _cache) => {
|
|
749
|
-
const _component_font_awesome_icon = resolveComponent("font-awesome-icon");
|
|
750
|
-
const _component_n8n_tooltip = resolveComponent("n8n-tooltip");
|
|
751
|
-
const _component_n8n_text = resolveComponent("n8n-text");
|
|
752
|
-
return aiData.value ? (openBlock(), createElementBlock("div", {
|
|
753
|
-
key: 0,
|
|
754
|
-
class: normalizeClass(_ctx.$style.container)
|
|
755
|
-
}, [
|
|
756
|
-
createBaseVNode("div", {
|
|
757
|
-
class: normalizeClass({ [_ctx.$style.tree]: true, [_ctx.$style.slim]: _ctx.slim })
|
|
758
|
-
}, [
|
|
759
|
-
createVNode(unref(ElTree), {
|
|
760
|
-
data: executionTree.value,
|
|
761
|
-
props: { label: "node" },
|
|
762
|
-
"default-expand-all": "",
|
|
763
|
-
indent: 12,
|
|
764
|
-
"expand-on-click-node": false,
|
|
765
|
-
"data-test-id": "lm-chat-logs-tree",
|
|
766
|
-
onNodeClick: onItemClick
|
|
767
|
-
}, {
|
|
768
|
-
default: withCtx(({ node, data }) => [
|
|
769
|
-
createBaseVNode("div", {
|
|
770
|
-
class: normalizeClass({
|
|
771
|
-
[_ctx.$style.treeNode]: true,
|
|
772
|
-
[_ctx.$style.isSelected]: isTreeNodeSelected(data)
|
|
773
|
-
}),
|
|
774
|
-
"data-tree-depth": data.depth,
|
|
775
|
-
style: normalizeStyle({ "--item-depth": data.depth })
|
|
776
|
-
}, [
|
|
777
|
-
data.children.length ? (openBlock(), createElementBlock("button", {
|
|
778
|
-
key: 0,
|
|
779
|
-
class: normalizeClass(_ctx.$style.treeToggle),
|
|
780
|
-
onClick: ($event) => toggleTreeItem(node)
|
|
781
|
-
}, [
|
|
782
|
-
createVNode(_component_font_awesome_icon, {
|
|
783
|
-
icon: node.expanded ? "angle-down" : "angle-up"
|
|
784
|
-
}, null, 8, ["icon"])
|
|
785
|
-
], 10, _hoisted_2)) : createCommentVNode("", true),
|
|
786
|
-
createVNode(_component_n8n_tooltip, {
|
|
787
|
-
disabled: !_ctx.slim,
|
|
788
|
-
placement: "right"
|
|
789
|
-
}, {
|
|
790
|
-
content: withCtx(() => [
|
|
791
|
-
createTextVNode(toDisplayString(node.label), 1)
|
|
792
|
-
]),
|
|
793
|
-
default: withCtx(() => [
|
|
794
|
-
createBaseVNode("span", {
|
|
795
|
-
class: normalizeClass(_ctx.$style.leafLabel)
|
|
796
|
-
}, [
|
|
797
|
-
createVNode(_sfc_main$3, {
|
|
798
|
-
"node-type": getNodeType(data.node),
|
|
799
|
-
size: 17
|
|
800
|
-
}, null, 8, ["node-type"]),
|
|
801
|
-
!_ctx.slim ? (openBlock(), createElementBlock("span", {
|
|
802
|
-
key: 0,
|
|
803
|
-
textContent: toDisplayString(node.label)
|
|
804
|
-
}, null, 8, _hoisted_3)) : createCommentVNode("", true)
|
|
805
|
-
], 2)
|
|
806
|
-
]),
|
|
807
|
-
_: 2
|
|
808
|
-
}, 1032, ["disabled"])
|
|
809
|
-
], 14, _hoisted_1)
|
|
810
|
-
]),
|
|
811
|
-
_: 1
|
|
812
|
-
}, 8, ["data"])
|
|
813
|
-
], 2),
|
|
814
|
-
createBaseVNode("div", {
|
|
815
|
-
class: normalizeClass(_ctx.$style.runData)
|
|
816
|
-
}, [
|
|
817
|
-
selectedRun.value.length === 0 ? (openBlock(), createElementBlock("div", {
|
|
818
|
-
key: 0,
|
|
819
|
-
class: normalizeClass(_ctx.$style.empty)
|
|
820
|
-
}, [
|
|
821
|
-
createVNode(_component_n8n_text, { size: "large" }, {
|
|
822
|
-
default: withCtx(() => [
|
|
823
|
-
createTextVNode(toDisplayString(_ctx.$locale.baseText("ndv.output.ai.empty", {
|
|
824
|
-
interpolate: {
|
|
825
|
-
node: props.node.name
|
|
826
|
-
}
|
|
827
|
-
})), 1)
|
|
828
|
-
]),
|
|
829
|
-
_: 1
|
|
830
|
-
})
|
|
831
|
-
], 2)) : createCommentVNode("", true),
|
|
832
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(selectedRun.value, (data, index) => {
|
|
833
|
-
return openBlock(), createElementBlock("div", {
|
|
834
|
-
key: `${data.node}__${data.runIndex}__index`,
|
|
835
|
-
"data-test-id": "lm-chat-logs-entry"
|
|
836
|
-
}, [
|
|
837
|
-
createVNode(RunDataAiContent, {
|
|
838
|
-
"input-data": data,
|
|
839
|
-
"content-index": index
|
|
840
|
-
}, null, 8, ["input-data", "content-index"])
|
|
841
|
-
]);
|
|
842
|
-
}), 128))
|
|
843
|
-
], 2)
|
|
844
|
-
], 2)) : createCommentVNode("", true);
|
|
845
|
-
};
|
|
846
|
-
}
|
|
847
|
-
});
|
|
848
|
-
const treeToggle = "_treeToggle_z0rh6_1";
|
|
849
|
-
const leafLabel = "_leafLabel_z0rh6_9";
|
|
850
|
-
const empty = "_empty_z0rh6_15";
|
|
851
|
-
const title = "_title_z0rh6_19";
|
|
852
|
-
const tree = "_tree_z0rh6_1";
|
|
853
|
-
const slim = "_slim_z0rh6_32";
|
|
854
|
-
const runData = "_runData_z0rh6_36";
|
|
855
|
-
const container = "_container_z0rh6_42";
|
|
856
|
-
const isSelected = "_isSelected_z0rh6_69";
|
|
857
|
-
const treeNode = "_treeNode_z0rh6_73";
|
|
858
|
-
const style0 = {
|
|
859
|
-
treeToggle,
|
|
860
|
-
leafLabel,
|
|
861
|
-
empty,
|
|
862
|
-
title,
|
|
863
|
-
tree,
|
|
864
|
-
slim,
|
|
865
|
-
runData,
|
|
866
|
-
container,
|
|
867
|
-
isSelected,
|
|
868
|
-
treeNode
|
|
869
|
-
};
|
|
870
|
-
const cssModules = {
|
|
871
|
-
"$style": style0
|
|
872
|
-
};
|
|
873
|
-
const RunDataAi = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules]]);
|
|
874
|
-
export {
|
|
875
|
-
RunDataAi as default
|
|
876
|
-
};
|