@trilogy-data/trilogy-studio-components 0.1.24 → 0.1.26
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 +5 -0
- package/dist/AssetAutoImporter-CBzvBaOt.js +405 -0
- package/dist/ChatCreatorModal-CL-jBnc3.js +218 -0
- package/dist/ChatModelSelect-Do-VRUFc.js +40 -0
- package/dist/{CommunityModels-CsDDXyIL.js → CommunityModels-Cmro0hV3.js} +101 -70
- package/dist/{Dashboard-BJfgRfRy.js → Dashboard-BH9ZwMVJ.js} +8 -8
- package/dist/{DashboardCreatorInline-wAlx6oH7.js → DashboardCreatorInline-CDU7kLy3.js} +3 -3
- package/dist/{DashboardImportSelector-D6ufVZIk.js → DashboardImportSelector-DQSvu9T-.js} +1 -1
- package/dist/{DashboardMobile-DoOyBHN7.js → DashboardMobile-BUPtdN2V.js} +4 -4
- package/dist/{Editor-Bs-h7edF.js → Editor-DQsYpkwl.js} +6 -6
- package/dist/{GlobalChatPanel-YsDZGxg8.js → GlobalChatPanel-DhnOaige.js} +155 -119
- package/dist/{IDE-CLF-KH2r.js → IDE-HLa8vybk.js} +9 -9
- package/dist/{JobsView-D1pp2xi5.js → JobsView-B97HBoIE.js} +8 -8
- package/dist/{LLMChat-CwM_brSg.js → LLMChat-CxJcPLEG.js} +1 -1
- package/dist/{LLMView-BiwCZb3Q.js → LLMView-C1MUf0c2.js} +21 -21
- package/dist/{MobileIDE-DrWh_OlB.js → MobileIDE-BpqXoaMR.js} +258 -253
- package/dist/{ModelCard-CsW4UwZI.js → ModelCard-BhN25jaV.js} +10 -10
- package/dist/{ModelCreator-C2douDis.js → ModelCreator-CCdC7EXt.js} +1 -1
- package/dist/{ModelView-D7ENFV2U.js → ModelView-DUDA_PtZ.js} +3 -3
- package/dist/{PageLoading-C5WK5i5Y.js → PageLoading-BzniJM0C.js} +622 -619
- package/dist/{ResultComponent-1MQlbELb.js → ResultComponent-CAn_r3BL.js} +3 -3
- package/dist/{Results-DXIYS4iW.js → Results-BJtlwebY.js} +3 -3
- package/dist/{SymbolsPane-BM6dUN-h.js → SymbolsPane-KYSwN9Sv.js} +1 -1
- package/dist/{TutorialPage-HXbXCznh.js → TutorialPage-NRcee6Dx.js} +8 -8
- package/dist/{VegaLiteChart-CS4h_t-K.js → VegaLiteChart-D1slfOUY.js} +11227 -11195
- package/dist/{WelcomePage-CLKvAvk-.js → WelcomePage-D5mU2x1L.js} +1 -1
- package/dist/components/AssetAutoImporter.vue.d.ts.map +1 -1
- package/dist/components/TipsCTA.vue.d.ts +1 -1
- package/dist/components/VegaLiteChart.vue.d.ts.map +1 -1
- package/dist/components/chartHelpers.d.ts +9 -1
- package/dist/components/chartHelpers.d.ts.map +1 -1
- package/dist/components/chartRenderManager.d.ts +4 -1
- package/dist/components/chartRenderManager.d.ts.map +1 -1
- package/dist/components/community/AddStoreModal.vue.d.ts +1 -1
- package/dist/components/community/AddStoreModal.vue.d.ts.map +1 -1
- package/dist/components/community/CommunityModelCard.vue.d.ts.map +1 -1
- package/dist/components/editor/Editor.vue.d.ts.map +1 -1
- package/dist/components/jobs/JobsAddStoreModal.vue.d.ts.map +1 -1
- package/dist/components/llm/ChatCreatorModal.vue.d.ts +17 -1
- package/dist/components/llm/ChatCreatorModal.vue.d.ts.map +1 -1
- package/dist/components/llm/ChatModelSelect.vue.d.ts +13 -0
- package/dist/components/llm/ChatModelSelect.vue.d.ts.map +1 -0
- package/dist/components/llm/GlobalChatPanel.vue.d.ts.map +1 -1
- package/dist/components/sidebar/CommunityModelList.vue.d.ts +33 -50
- package/dist/components/sidebar/CommunityModelList.vue.d.ts.map +1 -1
- package/dist/components/sidebar/CommunityModelListItem.vue.d.ts.map +1 -1
- package/dist/components/sidebar/EditorList.vue.d.ts +32 -49
- package/dist/components/sidebar/EditorList.vue.d.ts.map +1 -1
- package/dist/components/sidebar/Sidebar.vue.d.ts +65 -99
- package/dist/components/sidebar/Sidebar.vue.d.ts.map +1 -1
- package/dist/dashboard.js +52 -52
- package/dist/{dashboardStore-BzmI4OCV.js → dashboardStore-ppM6nGks.js} +33 -33
- package/dist/dashboards/layerSpec.d.ts +38 -4
- package/dist/dashboards/layerSpec.d.ts.map +1 -1
- package/dist/dashboards/lineAreaSpec.d.ts +8 -80
- package/dist/dashboards/lineAreaSpec.d.ts.map +1 -1
- package/dist/dashboards/mapSpec.d.ts +1 -0
- package/dist/dashboards/mapSpec.d.ts.map +1 -1
- package/dist/dashboards/spec.d.ts.map +1 -1
- package/dist/data/tutorial/documentation.d.ts.map +1 -1
- package/dist/data/tutorial/startupScripts.d.ts +3 -0
- package/dist/data/tutorial/startupScripts.d.ts.map +1 -0
- package/dist/{demoSetup-vmiMeH4_.js → demoSetup-mwa-RDC6.js} +19 -18
- package/dist/{editorRefinementRuntime-hC3u8GMO.js → editorRefinementRuntime-DoP9P5J2.js} +892 -871
- package/dist/{editorRefinementToolExecutor-Bomrpmns.js → editorRefinementToolExecutor-CVY3FA7k.js} +392 -267
- package/dist/{editorStore-Bj3Qnatp.js → editorStore-BhhmXbi-.js} +230 -183
- package/dist/entry.dashboard.d.ts +1 -0
- package/dist/entry.dashboard.d.ts.map +1 -1
- package/dist/{globalChatRuntime-DXI2KyGn.js → globalChatRuntime-DWZxeS57.js} +13 -13
- package/dist/{helpers-CFp2QCvv.js → helpers-BLQAgX3C.js} +17 -16
- package/dist/llm/chatAgentPrompt.d.ts.map +1 -1
- package/dist/llm/data/constants.d.ts +1 -1
- package/dist/llm/data/constants.d.ts.map +1 -1
- package/dist/llm/data/trilogySyntax.generated.d.ts +7 -1
- package/dist/llm/data/trilogySyntax.generated.d.ts.map +1 -1
- package/dist/llm/docsIndex.d.ts.map +1 -1
- package/dist/llm/openai.d.ts +2 -1
- package/dist/llm/openai.d.ts.map +1 -1
- package/dist/{llm-BuEsqH9Q.js → llm-BBOVWb-F.js} +7 -5
- package/dist/llm.js +3 -3
- package/dist/{llmStore-x5lRrKgx.js → llmStore-DJM2JhzY.js} +2 -2
- package/dist/{localStorage-C-ZtI6YA.js → localStorage-D9uyOFEO.js} +14 -14
- package/dist/models/helpers.d.ts.map +1 -1
- package/dist/monaco.js +1 -1
- package/dist/{reconcile-E5LR5p_f.js → reconcile-Dyf4UZmj.js} +1 -1
- package/dist/{remoteStoreSync-MwuJpHHt.js → remoteStoreSync-Z-yjlYtI.js} +1 -1
- package/dist/remotes/displayHelpers.d.ts.map +1 -1
- package/dist/remotes/genericStoreMetadata.d.ts +1 -0
- package/dist/remotes/genericStoreMetadata.d.ts.map +1 -1
- package/dist/remotes/models.d.ts +37 -5
- package/dist/remotes/models.d.ts.map +1 -1
- package/dist/remotes/staticStorePresets.d.ts +22 -0
- package/dist/remotes/staticStorePresets.d.ts.map +1 -0
- package/dist/remotes/storeService.d.ts +25 -4
- package/dist/remotes/storeService.d.ts.map +1 -1
- package/dist/stores/communityApiStore.d.ts +32 -60
- package/dist/stores/communityApiStore.d.ts.map +1 -1
- package/dist/stores/connectionStore.d.ts.map +1 -1
- package/dist/stores/resolver.d.ts +5 -0
- package/dist/stores/resolver.d.ts.map +1 -1
- package/dist/stores/urlStore.d.ts +1 -0
- package/dist/stores/urlStore.d.ts.map +1 -1
- package/dist/{stores-D-gHjj-_.js → stores-BT9hTLny.js} +47 -47
- package/dist/stores.js +7 -7
- package/dist/trilogy-studio-components.css +1 -1
- package/dist/{urlStore-Dgmwx1YI.js → urlStore-52HG6lsX.js} +1 -0
- package/dist/{useChatWithTools-BlCJrJT7.js → useChatWithTools-B0HZ_DVh.js} +1 -1
- package/dist/{useDashboard-CVlbV17V.js → useDashboard-CdSnPe_6.js} +186 -186
- package/dist/{useGlobalChatPanel-CNARTFYu.js → useGlobalChatPanel-D_0luajQ.js} +2 -2
- package/dist/views/MobileIDE.vue.d.ts.map +1 -1
- package/dist/views/TutorialPage.vue.d.ts +32 -49
- package/dist/views/TutorialPage.vue.d.ts.map +1 -1
- package/dist/views.js +16 -16
- package/package.json +1 -1
- package/dist/AssetAutoImporter-BD1P91Hq.js +0 -403
- package/dist/ChatCreatorModal-BTqY06B6.js +0 -177
package/README.md
CHANGED
|
@@ -158,6 +158,11 @@ const chat = useTrilogyChat({
|
|
|
158
158
|
The toolset is part of the provider's prompt-cache prefix, so keep the list stable within a
|
|
159
159
|
conversation where you can; each change costs one cache miss.
|
|
160
160
|
|
|
161
|
+
Disabling `connect_data_connection` also changes what the prompt says when the data connection is
|
|
162
|
+
down: instead of telling the model to connect, it says to tell the user and return. A host that
|
|
163
|
+
opens its own connection must actually open it — a model told to call a tool it cannot see goes
|
|
164
|
+
looking for it rather than reporting the problem.
|
|
165
|
+
|
|
161
166
|
## Styling Prerequisites
|
|
162
167
|
|
|
163
168
|
The package stylesheet (`@trilogy-data/trilogy-studio-components/style.css`) carries the
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
import { n as e } from "./rolldown-runtime-Dqa2HsxW.js";
|
|
2
|
+
import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
3
|
+
import { i as n } from "./stores-BT9hTLny.js";
|
|
4
|
+
import { d as r, f as i, n as a, o, p as s } from "./editorStore-BhhmXbi-.js";
|
|
5
|
+
import "./dashboardStore-ppM6nGks.js";
|
|
6
|
+
import { i as c, n as l, t as u } from "./urlStore-52HG6lsX.js";
|
|
7
|
+
import { t as ee } from "./trilogy-BroD2Qmp.js";
|
|
8
|
+
import { t as d } from "./helpers-BLQAgX3C.js";
|
|
9
|
+
import { n as f, r as p } from "./remoteStoreSync-Z-yjlYtI.js";
|
|
10
|
+
import { Fragment as m, computed as h, createCommentVNode as g, createElementBlock as _, createElementVNode as v, createTextVNode as y, createVNode as te, defineComponent as ne, inject as b, normalizeClass as x, onBeforeUnmount as re, onMounted as ie, openBlock as S, ref as C, toDisplayString as w, unref as ae, vModelText as T, withDirectives as E } from "vue";
|
|
11
|
+
//#region components/AssetAutoImporter.vue?vue&type=script&setup=true&lang.ts
|
|
12
|
+
var oe = { class: "auto-import-container" }, se = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "import-panel import-state error-state",
|
|
15
|
+
role: "alert"
|
|
16
|
+
}, ce = { class: "import-headline" }, le = { class: "error-message" }, ue = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "import-panel import-state loading-state",
|
|
19
|
+
role: "status"
|
|
20
|
+
}, de = { class: "loading-content" }, fe = ["src"], pe = { class: "import-headline" }, me = { class: "step-indicator" }, he = { class: "step-icon" }, ge = { key: 0 }, _e = { key: 1 }, ve = { class: "step-icon" }, ye = { key: 0 }, be = { key: 1 }, xe = { key: 2 }, Se = { class: "step-icon" }, Ce = { key: 0 }, we = { key: 1 }, Te = { key: 2 }, Ee = { class: "step-icon" }, De = { key: 0 }, Oe = { key: 1 }, ke = { key: 2 }, Ae = { class: "step-text" }, je = {
|
|
21
|
+
key: 2,
|
|
22
|
+
class: "import-panel import-form"
|
|
23
|
+
}, Me = { class: "import-header" }, Ne = { class: "import-headline" }, Pe = { class: "import-details" }, Fe = {
|
|
24
|
+
key: 0,
|
|
25
|
+
class: "import-source"
|
|
26
|
+
}, Ie = { class: "import-source" }, Le = { class: "connection-setup" }, Re = { class: "setup-description" }, ze = {
|
|
27
|
+
key: 0,
|
|
28
|
+
class: "form-group"
|
|
29
|
+
}, Be = {
|
|
30
|
+
key: 1,
|
|
31
|
+
class: "form-group"
|
|
32
|
+
}, Ve = { class: "form-group" }, He = { class: "form-group" }, Ue = { class: "form-group" }, We = { class: "form-actions" }, Ge = ["disabled"], Ke = 1500, D = /*@__PURE__*/ ne({
|
|
33
|
+
__name: "AssetAutoImporter",
|
|
34
|
+
emits: ["importComplete", "fullScreen"],
|
|
35
|
+
setup(e, { emit: t }) {
|
|
36
|
+
let ne = t, D = b("dashboardStore"), O = b("connectionStore"), k = b("editorStore"), A = b("modelStore"), j = b("communityApiStore"), qe = b("queryExecutionService"), Je = b("saveDashboards"), Ye = b("saveAll"), Xe = b("storageSources", []), M = n(), Ze = h(() => Xe.find((e) => e.type === "remote"));
|
|
37
|
+
if (!D || !O || !k || !A || !Je || !qe || !Ye) throw Error("Required stores not provided");
|
|
38
|
+
let N = C(!0), P = C(""), F = C(""), Qe = C(""), $e = C("generic"), I = C(""), L = C(!1), R = C(""), z = C("dashboard"), B = C(""), V = C(""), H = C(null), U = C(!1), et = C(""), W = C(!1), G = C("importing"), K = C(Date.now()), tt = C(Date.now()), nt = C("0 ms"), q = null, J = C({
|
|
39
|
+
mdToken: "",
|
|
40
|
+
projectId: "",
|
|
41
|
+
username: "",
|
|
42
|
+
password: "",
|
|
43
|
+
account: "",
|
|
44
|
+
sshPrivateKey: ""
|
|
45
|
+
}), Y = C(!0), rt = {
|
|
46
|
+
duckdb: {
|
|
47
|
+
fields: [],
|
|
48
|
+
autoImport: !0
|
|
49
|
+
},
|
|
50
|
+
motherduck: {
|
|
51
|
+
fields: ["mdToken"],
|
|
52
|
+
autoImport: !1
|
|
53
|
+
},
|
|
54
|
+
bigquery: {
|
|
55
|
+
fields: ["projectId"],
|
|
56
|
+
autoImport: !1
|
|
57
|
+
},
|
|
58
|
+
snowflake: {
|
|
59
|
+
fields: [
|
|
60
|
+
"username",
|
|
61
|
+
"account",
|
|
62
|
+
"sshPrivateKey"
|
|
63
|
+
],
|
|
64
|
+
autoImport: !1
|
|
65
|
+
}
|
|
66
|
+
}, it = h(() => {
|
|
67
|
+
if (L.value) return !1;
|
|
68
|
+
let e = rt[V.value];
|
|
69
|
+
return !e || !e.autoImport;
|
|
70
|
+
}), at = h(() => {
|
|
71
|
+
let e = rt[V.value];
|
|
72
|
+
return e ? e.fields : [];
|
|
73
|
+
}), ot = h(() => {
|
|
74
|
+
let e = a.find((e) => e.value === V.value);
|
|
75
|
+
return e ? e.label : V.value;
|
|
76
|
+
}), X = h(() => {
|
|
77
|
+
switch (z.value) {
|
|
78
|
+
case "dashboard": return "Dashboard";
|
|
79
|
+
case "editor":
|
|
80
|
+
case "trilogy": return "Editor";
|
|
81
|
+
default: return "Asset";
|
|
82
|
+
}
|
|
83
|
+
}), st = h(() => `A model named "${B.value}" already exists. Overwriting will replace its imported sources. Continue?`), ct = h(() => {
|
|
84
|
+
switch (z.value) {
|
|
85
|
+
case "dashboard": return "Setting up your dashboard...";
|
|
86
|
+
case "editor":
|
|
87
|
+
case "trilogy": return "Setting up your editor...";
|
|
88
|
+
default: return "Setting up your asset...";
|
|
89
|
+
}
|
|
90
|
+
}), lt = (e) => 100, Z = () => {
|
|
91
|
+
Q();
|
|
92
|
+
let e = Date.now() - tt.value;
|
|
93
|
+
if (e < 1e3) nt.value = `${e} ms`;
|
|
94
|
+
else if (e < 6e4) {
|
|
95
|
+
let t = (e / 1e3).toFixed(1);
|
|
96
|
+
nt.value = `${t} sec`;
|
|
97
|
+
} else {
|
|
98
|
+
let t = Math.floor(e / 6e4), n = (e % 6e4 / 1e3).toFixed(1);
|
|
99
|
+
nt.value = n === "0.0" ? `${t} min` : `${t} min ${n} sec`;
|
|
100
|
+
}
|
|
101
|
+
if (!H.value && (N.value || U.value)) {
|
|
102
|
+
let t = lt(e);
|
|
103
|
+
q = setTimeout(Z, t);
|
|
104
|
+
}
|
|
105
|
+
}, Q = () => {
|
|
106
|
+
q &&= (clearTimeout(q), null);
|
|
107
|
+
}, ut = async (e) => {
|
|
108
|
+
let t = Date.now() - K.value, n = Math.max(0, Ke - t);
|
|
109
|
+
n > 0 && G.value !== "registering" && G.value !== "importing" && await new Promise((e) => setTimeout(e, n)), G.value = e, K.value = Date.now();
|
|
110
|
+
};
|
|
111
|
+
function $() {
|
|
112
|
+
if (!V.value) {
|
|
113
|
+
Y.value = !1;
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
let e = at.value;
|
|
117
|
+
for (let t of e) if (!J.value[t]) {
|
|
118
|
+
Y.value = !1;
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
Y.value = !0;
|
|
122
|
+
}
|
|
123
|
+
let dt = (e) => Qe.value || i(e), ft = async () => {
|
|
124
|
+
if (!F.value || !j) return;
|
|
125
|
+
let e = s(F.value), t = dt(e), n = j.stores.find((e) => e.id === t);
|
|
126
|
+
if (n) {
|
|
127
|
+
n.type === "generic" && (I.value && (n.token = I.value), L.value && B.value && (n.name = B.value)), console.log(`Store ${t} already registered`);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
let r = $e.value === "static" ? {
|
|
131
|
+
...o(e),
|
|
132
|
+
id: t
|
|
133
|
+
} : {
|
|
134
|
+
type: "generic",
|
|
135
|
+
id: t,
|
|
136
|
+
name: L.value && B.value ? B.value : `Auto-registered: ${e}`,
|
|
137
|
+
baseUrl: e,
|
|
138
|
+
token: I.value || void 0
|
|
139
|
+
};
|
|
140
|
+
try {
|
|
141
|
+
await j.addStore(r), console.log(`Store ${t} registered successfully`);
|
|
142
|
+
} catch (e) {
|
|
143
|
+
console.warn(`Failed to register store ${t}:`, e);
|
|
144
|
+
}
|
|
145
|
+
}, pt = () => {
|
|
146
|
+
if (!F.value || !j) return null;
|
|
147
|
+
let e = s(F.value), t = dt(e), n = j.stores.find((e) => e.id === t);
|
|
148
|
+
return n?.type === "generic" ? n : null;
|
|
149
|
+
}, mt = () => {
|
|
150
|
+
W.value = !1, H.value = `Import cancelled. Existing model "${B.value}" was not overwritten.`, N.value = !1, Q();
|
|
151
|
+
}, ht = async () => {
|
|
152
|
+
W.value = !1, H.value = null, await yt();
|
|
153
|
+
}, gt = async () => {
|
|
154
|
+
if (!L.value && A.models[B.value]) {
|
|
155
|
+
N.value = !1, Q(), W.value = !0;
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
await yt();
|
|
159
|
+
}, _t = async () => {
|
|
160
|
+
if (!Ze.value) throw Error("Remote storage is not available in this context.");
|
|
161
|
+
let e = pt();
|
|
162
|
+
if (!e) throw Error("Remote imports require a valid store URL that can be registered.");
|
|
163
|
+
await f(Ze.value, e.id, k, O, A);
|
|
164
|
+
let t = r(e);
|
|
165
|
+
if (z.value === "dashboard") {
|
|
166
|
+
let e = Object.values(D.dashboards).find((e) => e.name === R.value && e.connection === t);
|
|
167
|
+
if (!e) throw Error(`Dashboard "${R.value}" is not part of the remote store. Remote stores don't serve dashboards — create one locally against this store's connection first.`);
|
|
168
|
+
return D.warmDashboardQueries(e.id, qe, k), {
|
|
169
|
+
foundAssetId: e.id,
|
|
170
|
+
connectionName: t
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
let n = `remote:${e.id}:`, i = Object.values(k.editors).filter((e) => e.id.startsWith(n) && e.connection === t), a = (e) => e.replace(/\.[^.]+$/, ""), o = i.find((e) => e.name === R.value || a(e.name) === R.value);
|
|
174
|
+
if (!o) {
|
|
175
|
+
let e = i.map((e) => e.name).join(", ");
|
|
176
|
+
throw Error(`Editor "${R.value}" was not found in the remote store, have ${e}`);
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
foundAssetId: o.id,
|
|
180
|
+
connectionName: t
|
|
181
|
+
};
|
|
182
|
+
}, vt = async () => {
|
|
183
|
+
let e = `${B.value}-connection`, t = new d(k, A, D);
|
|
184
|
+
A.models[B.value] || A.newModelConfig(B.value, !0), O.connectionByName(e) || O.newConnection(e, V.value, {
|
|
185
|
+
mdToken: J.value.mdToken,
|
|
186
|
+
projectId: J.value.projectId,
|
|
187
|
+
username: J.value.username,
|
|
188
|
+
password: J.value.password,
|
|
189
|
+
account: J.value.account,
|
|
190
|
+
privateKey: J.value.sshPrivateKey,
|
|
191
|
+
model: B.value
|
|
192
|
+
});
|
|
193
|
+
let n = pt(), r = await t.importModel(B.value, P.value, e, {
|
|
194
|
+
token: I.value || void 0,
|
|
195
|
+
remote: !1,
|
|
196
|
+
remoteStoreId: n?.id || null,
|
|
197
|
+
remoteBaseUrl: n?.baseUrl || F.value || null
|
|
198
|
+
});
|
|
199
|
+
if (O.connectionByName(e)?.setModel(B.value), z.value === "dashboard") {
|
|
200
|
+
let t = r?.dashboards.get(R.value), n = t ? D.dashboards[t] : void 0;
|
|
201
|
+
if (!n) {
|
|
202
|
+
let t = Object.values(D.dashboards).filter((t) => t.connection === e && t.storage !== "remote").map((e) => e.name).join(", ");
|
|
203
|
+
throw Error(`Dashboard "${R.value}" was not found in the imported model, have ${t}`);
|
|
204
|
+
}
|
|
205
|
+
return D.warmDashboardQueries(n.id, qe, k), {
|
|
206
|
+
foundAssetId: n.id,
|
|
207
|
+
connectionName: e
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
let i = r?.trilogy.get(R.value) || r?.sql.get(R.value) || r?.python.get(R.value), a = i ? k.editors[i] : void 0;
|
|
211
|
+
if (!a) {
|
|
212
|
+
let t = Object.values(k.editors).filter((t) => t.connection === e && t.storage !== "remote").map((e) => e.name).join(", ");
|
|
213
|
+
throw Error(`Editor "${R.value}" was not found in the imported model, have ${t}`);
|
|
214
|
+
}
|
|
215
|
+
return {
|
|
216
|
+
foundAssetId: a.id,
|
|
217
|
+
connectionName: e
|
|
218
|
+
};
|
|
219
|
+
}, yt = async () => {
|
|
220
|
+
try {
|
|
221
|
+
if (!B.value || !R.value) {
|
|
222
|
+
H.value = "Missing required import parameters";
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (!L.value && !P.value) {
|
|
226
|
+
H.value = "Missing required import parameters";
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
tt.value = Date.now(), K.value = Date.now(), N.value = !0, Z(), F.value ? (G.value = "registering", await ft(), await ut("importing")) : G.value = "importing";
|
|
230
|
+
let { foundAssetId: e, connectionName: t } = L.value ? await _t() : await vt();
|
|
231
|
+
await ut("connecting"), et.value = e, L.value || await Ye();
|
|
232
|
+
let n = O.connectionByName(t);
|
|
233
|
+
n && await O.resetConnection(n.id), await ut("preparing"), N.value = !1, U.value = !0, q && clearTimeout(q), Z(), setTimeout(() => {
|
|
234
|
+
Q();
|
|
235
|
+
}, 2e3), ne("importComplete", e, z.value), c(u.IMPORT), c(u.STORE), c(u.STORE_ID), c(u.STORE_KIND), c(u.TOKEN), c(u.ASSET_TYPE), c(u.ASSET_NAME), c(u.DASHBOARD), c(u.REMOTE), setTimeout(() => {
|
|
236
|
+
M.closeTab(null, "asset-import"), z.value === "dashboard" ? (M.openTab("dashboard", null, e), M.setActiveSidebarScreen("dashboard")) : (M.openTab("editors", null, e), M.setActiveSidebarScreen("editors"));
|
|
237
|
+
}, 500);
|
|
238
|
+
} catch (e) {
|
|
239
|
+
console.error("Import failed:", e), H.value = e instanceof Error ? e.message : "Import failed", N.value = !1, Q();
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
ie(async () => {
|
|
243
|
+
try {
|
|
244
|
+
tt.value = Date.now(), K.value = Date.now(), Z();
|
|
245
|
+
let e = M.modelImport.value, t = l(u.STORE, ""), n = l(u.STORE_ID, ""), r = l(u.STORE_KIND, ""), i = l(u.TOKEN, ""), a = l(u.REMOTE, ""), o = l(u.ASSET_TYPE, ""), s = l(u.ASSET_NAME, ""), c = l(u.DASHBOARD, ""), ee = l(u.MODEL_NAME, ""), d = l(u.CONNECTION, ""), f = "dashboard", p = "";
|
|
246
|
+
o && s ? (f = o, p = s) : c && (f = "dashboard", p = c);
|
|
247
|
+
let m = [
|
|
248
|
+
"true",
|
|
249
|
+
"1",
|
|
250
|
+
"yes"
|
|
251
|
+
].includes((a || "").toLowerCase());
|
|
252
|
+
if (!p || !ee || !m && (!e || !d) || m && !t) {
|
|
253
|
+
H.value = m ? "Missing required import parameters (store, assetName/dashboard, modelName)" : "Missing required import parameters (import, assetName/dashboard, modelName, connection)", N.value = !1, Q();
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
if (P.value = e ? decodeURIComponent(e) : "", F.value = t ? decodeURIComponent(t) : "", Qe.value = n ? decodeURIComponent(n) : "", $e.value = r === "static" && !m ? "static" : "generic", I.value = i ? decodeURIComponent(i) : "", L.value = m, R.value = decodeURIComponent(p), z.value = f, B.value = decodeURIComponent(ee), V.value = d, !L.value && !rt[V.value]) {
|
|
257
|
+
H.value = `Unsupported connection type: ${V.value}`, N.value = !1, Q();
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
it.value ? (N.value = !1, Q(), $()) : await gt();
|
|
261
|
+
} catch (e) {
|
|
262
|
+
console.error("Auto-import initialization failed:", e), H.value = e instanceof Error ? e.message : "Failed to initialize import", N.value = !1, Q();
|
|
263
|
+
}
|
|
264
|
+
}), re(() => {
|
|
265
|
+
Q();
|
|
266
|
+
});
|
|
267
|
+
let bt = async () => {
|
|
268
|
+
if (N.value = !0, !Y.value) throw Error("Form is not valid");
|
|
269
|
+
console.log("performing import"), await gt();
|
|
270
|
+
}, xt = () => {
|
|
271
|
+
z.value === "dashboard" ? (M.setActiveDashboard(null), M.setActiveScreen("dashboard")) : M.setActiveScreen("editors");
|
|
272
|
+
};
|
|
273
|
+
return (e, t) => (S(), _("div", oe, [H.value ? (S(), _("div", se, [
|
|
274
|
+
t[5] ||= v("div", { class: "error-icon" }, "⚠️", -1),
|
|
275
|
+
v("h2", ce, w(X.value) + " Load Failed", 1),
|
|
276
|
+
v("p", le, w(H.value), 1),
|
|
277
|
+
v("div", { class: "error-actions" }, [v("button", {
|
|
278
|
+
onClick: xt,
|
|
279
|
+
class: "import-action manual-import-button"
|
|
280
|
+
}, " Try Manual Import ")])
|
|
281
|
+
])) : N.value || U.value ? (S(), _("div", ue, [v("div", de, [
|
|
282
|
+
v("img", {
|
|
283
|
+
src: ae(ee),
|
|
284
|
+
class: "trilogy-icon spinning",
|
|
285
|
+
alt: "Loading"
|
|
286
|
+
}, null, 8, fe),
|
|
287
|
+
v("h2", pe, w(ct.value), 1),
|
|
288
|
+
v("div", me, [
|
|
289
|
+
F.value ? (S(), _("div", {
|
|
290
|
+
key: 0,
|
|
291
|
+
class: x(["step", {
|
|
292
|
+
active: G.value === "registering",
|
|
293
|
+
completed: G.value !== "registering"
|
|
294
|
+
}])
|
|
295
|
+
}, [v("div", he, [G.value === "registering" ? (S(), _("span", ge, "⟳")) : (S(), _("span", _e, "✓"))]), t[6] ||= v("span", { class: "step-text" }, "Registering store", -1)], 2)) : g("", !0),
|
|
296
|
+
v("div", { class: x(["step", {
|
|
297
|
+
active: G.value === "importing",
|
|
298
|
+
completed: G.value !== "importing" && G.value !== "registering" && (G.value === "connecting" || G.value === "preparing" || U.value)
|
|
299
|
+
}]) }, [v("div", ve, [G.value === "importing" ? (S(), _("span", ye, "⟳")) : G.value === "registering" ? (S(), _("span", be, "○")) : (S(), _("span", xe, "✓"))]), t[7] ||= v("span", { class: "step-text" }, "Importing model", -1)], 2),
|
|
300
|
+
v("div", { class: x(["step", {
|
|
301
|
+
active: G.value === "connecting",
|
|
302
|
+
completed: G.value === "preparing" || U.value
|
|
303
|
+
}]) }, [v("div", Se, [G.value === "connecting" ? (S(), _("span", Ce, "⟳")) : G.value === "preparing" || U.value ? (S(), _("span", we, "✓")) : (S(), _("span", Te, "○"))]), t[8] ||= v("span", { class: "step-text" }, "Establishing connection", -1)], 2),
|
|
304
|
+
v("div", { class: x(["step", {
|
|
305
|
+
active: G.value === "preparing" || U.value,
|
|
306
|
+
completed: U.value
|
|
307
|
+
}]) }, [v("div", Ee, [G.value === "preparing" ? (S(), _("span", De, "⟳")) : U.value ? (S(), _("span", Oe, "✓")) : (S(), _("span", ke, "○"))]), v("span", Ae, "Preparing " + w(X.value.toLowerCase()), 1)], 2)
|
|
308
|
+
]),
|
|
309
|
+
t[9] ||= v("p", { class: "import-details" }, "This may take a few seconds.", -1)
|
|
310
|
+
])])) : it.value ? (S(), _("div", je, [
|
|
311
|
+
v("div", Me, [v("h2", Ne, "Import Model & " + w(X.value), 1), v("div", Pe, [
|
|
312
|
+
v("p", null, [t[10] ||= v("strong", null, "Model:", -1), y(" " + w(B.value), 1)]),
|
|
313
|
+
v("p", null, [v("strong", null, w(X.value) + ":", 1), y(" " + w(R.value), 1)]),
|
|
314
|
+
F.value ? (S(), _("p", Fe, [t[11] ||= v("strong", null, "Store:", -1), y(" " + w(F.value), 1)])) : g("", !0),
|
|
315
|
+
v("p", Ie, [t[12] ||= v("strong", null, "From:", -1), y(" " + w(P.value), 1)])
|
|
316
|
+
])]),
|
|
317
|
+
v("div", Le, [
|
|
318
|
+
v("h3", null, w(ot.value) + " Connection Setup", 1),
|
|
319
|
+
v("p", Re, " This model requires a " + w(V.value) + " connection. Please provide the required configuration: ", 1),
|
|
320
|
+
V.value === "motherduck" ? (S(), _("div", ze, [t[13] ||= v("label", { for: "md-token" }, "MotherDuck Token", -1), E(v("input", {
|
|
321
|
+
type: "text",
|
|
322
|
+
"onUpdate:modelValue": t[0] ||= (e) => J.value.mdToken = e,
|
|
323
|
+
id: "md-token",
|
|
324
|
+
placeholder: "Enter your MotherDuck token",
|
|
325
|
+
class: "sidebar-control-input connection-input",
|
|
326
|
+
onInput: $
|
|
327
|
+
}, null, 544), [[
|
|
328
|
+
T,
|
|
329
|
+
J.value.mdToken,
|
|
330
|
+
void 0,
|
|
331
|
+
{ trim: !0 }
|
|
332
|
+
]])])) : V.value === "bigquery" ? (S(), _("div", Be, [t[14] ||= v("label", { for: "project-id" }, "BigQuery Project ID", -1), E(v("input", {
|
|
333
|
+
type: "text",
|
|
334
|
+
"onUpdate:modelValue": t[1] ||= (e) => J.value.projectId = e,
|
|
335
|
+
id: "project-id",
|
|
336
|
+
placeholder: "Enter your billing project ID",
|
|
337
|
+
class: "sidebar-control-input connection-input",
|
|
338
|
+
onInput: $
|
|
339
|
+
}, null, 544), [[
|
|
340
|
+
T,
|
|
341
|
+
J.value.projectId,
|
|
342
|
+
void 0,
|
|
343
|
+
{ trim: !0 }
|
|
344
|
+
]])])) : V.value === "snowflake" ? (S(), _(m, { key: 2 }, [
|
|
345
|
+
v("div", Ve, [t[15] ||= v("label", { for: "snowflake-username" }, "Username", -1), E(v("input", {
|
|
346
|
+
type: "text",
|
|
347
|
+
"onUpdate:modelValue": t[2] ||= (e) => J.value.username = e,
|
|
348
|
+
id: "snowflake-username",
|
|
349
|
+
placeholder: "Snowflake username",
|
|
350
|
+
class: "sidebar-control-input connection-input",
|
|
351
|
+
onInput: $
|
|
352
|
+
}, null, 544), [[
|
|
353
|
+
T,
|
|
354
|
+
J.value.username,
|
|
355
|
+
void 0,
|
|
356
|
+
{ trim: !0 }
|
|
357
|
+
]])]),
|
|
358
|
+
v("div", He, [t[16] ||= v("label", { for: "snowflake-account" }, "Account", -1), E(v("input", {
|
|
359
|
+
type: "text",
|
|
360
|
+
"onUpdate:modelValue": t[3] ||= (e) => J.value.account = e,
|
|
361
|
+
id: "snowflake-account",
|
|
362
|
+
placeholder: "Snowflake account identifier",
|
|
363
|
+
class: "sidebar-control-input connection-input",
|
|
364
|
+
onInput: $
|
|
365
|
+
}, null, 544), [[
|
|
366
|
+
T,
|
|
367
|
+
J.value.account,
|
|
368
|
+
void 0,
|
|
369
|
+
{ trim: !0 }
|
|
370
|
+
]])]),
|
|
371
|
+
v("div", Ue, [t[17] ||= v("label", { for: "snowflake-key" }, "Private Key", -1), E(v("input", {
|
|
372
|
+
type: "text",
|
|
373
|
+
"onUpdate:modelValue": t[4] ||= (e) => J.value.sshPrivateKey = e,
|
|
374
|
+
id: "snowflake-key",
|
|
375
|
+
placeholder: "Private key for authentication",
|
|
376
|
+
class: "sidebar-control-input connection-input",
|
|
377
|
+
onInput: $
|
|
378
|
+
}, null, 544), [[
|
|
379
|
+
T,
|
|
380
|
+
J.value.sshPrivateKey,
|
|
381
|
+
void 0,
|
|
382
|
+
{ trim: !0 }
|
|
383
|
+
]])])
|
|
384
|
+
], 64)) : g("", !0)
|
|
385
|
+
]),
|
|
386
|
+
v("div", We, [v("button", {
|
|
387
|
+
onClick: bt,
|
|
388
|
+
class: "import-action import-button",
|
|
389
|
+
disabled: !Y.value
|
|
390
|
+
}, " Import Model & " + w(X.value), 9, Ge), v("button", { onClick: xt }, "Cancel")])
|
|
391
|
+
])) : g("", !0), te(p, {
|
|
392
|
+
show: W.value,
|
|
393
|
+
title: "Overwrite Existing Model?",
|
|
394
|
+
message: st.value,
|
|
395
|
+
"confirm-label": "Overwrite",
|
|
396
|
+
"cancel-label": "Cancel",
|
|
397
|
+
"confirm-test-id": "confirm-overwrite-model",
|
|
398
|
+
"cancel-test-id": "cancel-overwrite-model",
|
|
399
|
+
onClose: mt,
|
|
400
|
+
onConfirm: ht
|
|
401
|
+
}, null, 8, ["show", "message"])]));
|
|
402
|
+
}
|
|
403
|
+
}), O = /* @__PURE__ */ e({ default: () => k }), k = /*#__PURE__*/ t(D, [["__scopeId", "data-v-331fa5ac"]]);
|
|
404
|
+
//#endregion
|
|
405
|
+
export { O as n, k as t };
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
2
|
+
import { t } from "./StatusIcon-BylPx2EO.js";
|
|
3
|
+
import { t as n } from "./ChatModelSelect-Do-VRUFc.js";
|
|
4
|
+
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, defineComponent as u, inject as d, normalizeClass as f, openBlock as p, ref as m, renderList as h, resolveComponent as g, toDisplayString as _, vModelSelect as v, vModelText as y, watch as b, withDirectives as x, withModifiers as S } from "vue";
|
|
5
|
+
//#region components/llm/ChatCreatorModal.vue?vue&type=script&lang.ts
|
|
6
|
+
var C = u({
|
|
7
|
+
name: "ChatCreatorModal",
|
|
8
|
+
components: {
|
|
9
|
+
StatusIcon: t,
|
|
10
|
+
ChatModelSelect: n
|
|
11
|
+
},
|
|
12
|
+
props: {
|
|
13
|
+
visible: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: !1
|
|
16
|
+
},
|
|
17
|
+
preselectedConnection: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ""
|
|
20
|
+
},
|
|
21
|
+
activeDataConnection: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: ""
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
emits: ["close", "chat-created"],
|
|
27
|
+
setup(e, { emit: t }) {
|
|
28
|
+
let n = d("llmConnectionStore"), r = d("connectionStore", null), a = d("chatStore", null), o = d("saveLLMConnections", null), s = m(e.preselectedConnection || ""), c = m(""), l = m(""), u = m(""), f = m(!1), p = m("");
|
|
29
|
+
b([s, () => e.visible], () => {
|
|
30
|
+
u.value = n?.connections[s.value]?.model || "", p.value = "";
|
|
31
|
+
}, { immediate: !0 }), b(() => e.preselectedConnection, (e) => {
|
|
32
|
+
e && (s.value = e);
|
|
33
|
+
}, { immediate: !0 }), b(() => e.visible, (t) => {
|
|
34
|
+
t && (e.preselectedConnection && (s.value = e.preselectedConnection), c.value = "", l.value = "");
|
|
35
|
+
});
|
|
36
|
+
let h = i(() => n ? Object.values(n.connections).filter((e) => !e.deleted).map((e) => ({
|
|
37
|
+
name: e.name,
|
|
38
|
+
model: e.model || "Unknown",
|
|
39
|
+
connected: e.connected === !0,
|
|
40
|
+
running: e.running === !0,
|
|
41
|
+
error: e.error || null
|
|
42
|
+
})) : []), g = i(() => [...h.value].sort((e, t) => e.connected && !t.connected ? -1 : !e.connected && t.connected ? 1 : e.name.localeCompare(t.name))), _ = i(() => {
|
|
43
|
+
if (!s.value) return null;
|
|
44
|
+
let e = h.value.find((e) => e.name === s.value);
|
|
45
|
+
return e ? e.connected ? e.running ? {
|
|
46
|
+
status: "running",
|
|
47
|
+
message: "Running"
|
|
48
|
+
} : e.error ? {
|
|
49
|
+
status: "failed",
|
|
50
|
+
message: e.error
|
|
51
|
+
} : {
|
|
52
|
+
status: "connected",
|
|
53
|
+
message: "Connected"
|
|
54
|
+
} : {
|
|
55
|
+
status: "disabled",
|
|
56
|
+
message: "Disconnected"
|
|
57
|
+
} : null;
|
|
58
|
+
}), v = i(() => e.activeDataConnection ? e.activeDataConnection.split("+")[0] : ""), y = i(() => !v.value || !r ? "" : r.connectionByName(v.value)?.id || ""), x = i(() => r ? Object.values(r.connections).filter((e) => !e.deleted).map((e) => ({
|
|
59
|
+
id: e.id,
|
|
60
|
+
name: e.name,
|
|
61
|
+
connected: e.connected === !0,
|
|
62
|
+
running: e.running === !0,
|
|
63
|
+
error: e.error || null
|
|
64
|
+
})) : []);
|
|
65
|
+
return {
|
|
66
|
+
selectedLLMConnection: s,
|
|
67
|
+
selectedModel: u,
|
|
68
|
+
isCreating: f,
|
|
69
|
+
creationError: p,
|
|
70
|
+
selectedDataConnectionId: c,
|
|
71
|
+
chatName: l,
|
|
72
|
+
availableLLMConnections: h,
|
|
73
|
+
sortedLLMConnections: g,
|
|
74
|
+
selectedConnectionStatus: _,
|
|
75
|
+
availableDataConnections: x,
|
|
76
|
+
sortedDataConnections: i(() => [...x.value].sort((e, t) => e.connected && !t.connected ? -1 : !e.connected && t.connected ? 1 : e.name.localeCompare(t.name))),
|
|
77
|
+
selectedDataConnectionStatus: i(() => {
|
|
78
|
+
if (!c.value) return null;
|
|
79
|
+
let e = x.value.find((e) => e.id === c.value);
|
|
80
|
+
return e ? e.connected ? e.running ? {
|
|
81
|
+
status: "running",
|
|
82
|
+
message: "Running"
|
|
83
|
+
} : e.error ? {
|
|
84
|
+
status: "failed",
|
|
85
|
+
message: e.error
|
|
86
|
+
} : {
|
|
87
|
+
status: "connected",
|
|
88
|
+
message: "Connected"
|
|
89
|
+
} : {
|
|
90
|
+
status: "disabled",
|
|
91
|
+
message: "Disconnected"
|
|
92
|
+
} : null;
|
|
93
|
+
}),
|
|
94
|
+
activeDataConnectionName: v,
|
|
95
|
+
activeDataConnectionId: y,
|
|
96
|
+
createChat: async () => {
|
|
97
|
+
if (!s.value || !a || f.value) return;
|
|
98
|
+
let e = n?.connections[s.value];
|
|
99
|
+
if (e && u.value && e.model !== u.value) {
|
|
100
|
+
f.value = !0;
|
|
101
|
+
let t = e.model;
|
|
102
|
+
try {
|
|
103
|
+
e.setModel(u.value), await o?.();
|
|
104
|
+
} catch {
|
|
105
|
+
e.setModel(t), p.value = "Could not save the model. Please try again.";
|
|
106
|
+
return;
|
|
107
|
+
} finally {
|
|
108
|
+
f.value = !1;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
n && (n.activeConnection = s.value);
|
|
112
|
+
let i = c.value ? r?.connections[c.value] : null;
|
|
113
|
+
t("chat-created", a.newChat(s.value, i?.name || "", l.value || void 0, i?.id || "")), t("close");
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}), w = { class: "chat-creator-form" }, T = { class: "form-group" }, E = { class: "select-with-status" }, D = ["disabled"], O = ["value", "disabled"], k = { key: 0 }, A = {
|
|
118
|
+
key: 1,
|
|
119
|
+
role: "alert"
|
|
120
|
+
}, j = { class: "form-group" }, M = { class: "select-with-status" }, N = ["disabled"], P = ["value"], F = { class: "form-group" }, I = ["disabled"], L = { class: "button-container" }, R = ["disabled"], z = ["disabled"];
|
|
121
|
+
function B(e, t, n, i, u, d) {
|
|
122
|
+
let m = g("status-icon"), b = g("ChatModelSelect");
|
|
123
|
+
return e.visible ? (p(), s("div", {
|
|
124
|
+
key: 0,
|
|
125
|
+
class: "confirmation-overlay",
|
|
126
|
+
onClick: t[7] ||= (t) => !e.isCreating && e.$emit("close")
|
|
127
|
+
}, [c("div", {
|
|
128
|
+
class: "confirmation-dialog",
|
|
129
|
+
"data-testid": "chat-creator-modal",
|
|
130
|
+
onClick: t[6] ||= S(() => {}, ["stop"])
|
|
131
|
+
}, [t[14] ||= c("h3", null, "Create New Chat", -1), c("div", w, [
|
|
132
|
+
c("div", T, [
|
|
133
|
+
t[9] ||= c("label", { for: "llm-connection" }, [l("LLM Connection: "), c("span", { class: "required" }, "*")], -1),
|
|
134
|
+
c("div", E, [x(c("select", {
|
|
135
|
+
id: "llm-connection",
|
|
136
|
+
"onUpdate:modelValue": t[0] ||= (t) => e.selectedLLMConnection = t,
|
|
137
|
+
required: "",
|
|
138
|
+
disabled: !!e.preselectedConnection || e.isCreating,
|
|
139
|
+
"data-testid": "llm-connection-select"
|
|
140
|
+
}, [t[8] ||= c("option", {
|
|
141
|
+
value: "",
|
|
142
|
+
disabled: ""
|
|
143
|
+
}, "Select an LLM connection...", -1), (p(!0), s(r, null, h(e.sortedLLMConnections, (e) => (p(), s("option", {
|
|
144
|
+
key: e.name,
|
|
145
|
+
value: e.name,
|
|
146
|
+
disabled: !e.connected
|
|
147
|
+
}, _(e.name) + " (" + _(e.model) + ") ", 9, O))), 128))], 8, D), [[v, e.selectedLLMConnection]]), e.selectedConnectionStatus ? (p(), a(m, {
|
|
148
|
+
key: 0,
|
|
149
|
+
status: e.selectedConnectionStatus.status,
|
|
150
|
+
message: e.selectedConnectionStatus.message,
|
|
151
|
+
testName: e.selectedLLMConnection
|
|
152
|
+
}, null, 8, [
|
|
153
|
+
"status",
|
|
154
|
+
"message",
|
|
155
|
+
"testName"
|
|
156
|
+
])) : o("", !0)]),
|
|
157
|
+
e.selectedLLMConnection ? o("", !0) : (p(), s("small", k, " Required - Select which LLM to use for this chat "))
|
|
158
|
+
]),
|
|
159
|
+
e.selectedLLMConnection ? (p(), a(b, {
|
|
160
|
+
key: 0,
|
|
161
|
+
class: "form-group",
|
|
162
|
+
"connection-name": e.selectedLLMConnection,
|
|
163
|
+
modelValue: e.selectedModel,
|
|
164
|
+
"onUpdate:modelValue": t[1] ||= (t) => e.selectedModel = t,
|
|
165
|
+
disabled: e.isCreating
|
|
166
|
+
}, null, 8, [
|
|
167
|
+
"connection-name",
|
|
168
|
+
"modelValue",
|
|
169
|
+
"disabled"
|
|
170
|
+
])) : o("", !0),
|
|
171
|
+
e.creationError ? (p(), s("p", A, _(e.creationError), 1)) : o("", !0),
|
|
172
|
+
c("div", j, [
|
|
173
|
+
t[11] ||= c("label", { for: "data-connection" }, "Data Connection:", -1),
|
|
174
|
+
c("div", M, [x(c("select", {
|
|
175
|
+
id: "data-connection",
|
|
176
|
+
"onUpdate:modelValue": t[2] ||= (t) => e.selectedDataConnectionId = t,
|
|
177
|
+
disabled: e.isCreating,
|
|
178
|
+
"data-testid": "data-connection-select"
|
|
179
|
+
}, [t[10] ||= c("option", { value: "" }, "None - Select later", -1), (p(!0), s(r, null, h(e.sortedDataConnections, (t) => (p(), s("option", {
|
|
180
|
+
key: t.id,
|
|
181
|
+
value: t.id,
|
|
182
|
+
class: f({ "active-connection": t.id === e.activeDataConnectionId })
|
|
183
|
+
}, _(t.name) + _(t.id === e.activeDataConnectionId ? " (active)" : ""), 11, P))), 128))], 8, N), [[v, e.selectedDataConnectionId]]), e.selectedDataConnectionStatus ? (p(), a(m, {
|
|
184
|
+
key: 0,
|
|
185
|
+
status: e.selectedDataConnectionStatus.status,
|
|
186
|
+
message: e.selectedDataConnectionStatus.message,
|
|
187
|
+
testName: "data-" + e.selectedDataConnectionId
|
|
188
|
+
}, null, 8, [
|
|
189
|
+
"status",
|
|
190
|
+
"message",
|
|
191
|
+
"testName"
|
|
192
|
+
])) : o("", !0)]),
|
|
193
|
+
t[12] ||= c("small", null, " Optional - Select a data source for running queries ", -1)
|
|
194
|
+
]),
|
|
195
|
+
c("div", F, [t[13] ||= c("label", { for: "chat-name" }, "Chat Name:", -1), x(c("input", {
|
|
196
|
+
id: "chat-name",
|
|
197
|
+
"onUpdate:modelValue": t[3] ||= (t) => e.chatName = t,
|
|
198
|
+
disabled: e.isCreating,
|
|
199
|
+
placeholder: "Auto-generated if empty",
|
|
200
|
+
maxlength: "100",
|
|
201
|
+
"data-testid": "chat-name-input"
|
|
202
|
+
}, null, 8, I), [[y, e.chatName]])]),
|
|
203
|
+
c("div", L, [c("button", {
|
|
204
|
+
class: "cancel-btn",
|
|
205
|
+
disabled: e.isCreating,
|
|
206
|
+
onClick: t[4] ||= (t) => e.$emit("close"),
|
|
207
|
+
"data-testid": "cancel-chat-create"
|
|
208
|
+
}, " Cancel ", 8, R), c("button", {
|
|
209
|
+
class: "primary-button",
|
|
210
|
+
onClick: t[5] ||= (...t) => e.createChat && e.createChat(...t),
|
|
211
|
+
disabled: !e.selectedLLMConnection || e.isCreating,
|
|
212
|
+
"data-testid": "create-chat-btn"
|
|
213
|
+
}, " Create Chat ", 8, z)])
|
|
214
|
+
])])])) : o("", !0);
|
|
215
|
+
}
|
|
216
|
+
var V = /*#__PURE__*/ e(C, [["render", B], ["__scopeId", "data-v-b00cd718"]]);
|
|
217
|
+
//#endregion
|
|
218
|
+
export { V as default };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
2
|
+
import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, defineComponent as o, inject as s, openBlock as c, renderList as l, toDisplayString as u, unref as d, useId as f } from "vue";
|
|
3
|
+
//#region components/llm/ChatModelSelect.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var p = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "chat-model-picker"
|
|
7
|
+
}, m = ["for"], h = [
|
|
8
|
+
"id",
|
|
9
|
+
"value",
|
|
10
|
+
"disabled",
|
|
11
|
+
"aria-describedby"
|
|
12
|
+
], g = ["value"], _ = ["id"], v = /*#__PURE__*/ e(/* @__PURE__ */ o({
|
|
13
|
+
__name: "ChatModelSelect",
|
|
14
|
+
props: {
|
|
15
|
+
connectionName: {},
|
|
16
|
+
modelValue: {},
|
|
17
|
+
disabled: { type: Boolean }
|
|
18
|
+
},
|
|
19
|
+
emits: ["update:modelValue"],
|
|
20
|
+
setup(e, { emit: o }) {
|
|
21
|
+
let v = e, y = o, b = s("llmConnectionStore"), x = f(), S = n(() => b?.connections[v.connectionName]), C = n(() => [.../* @__PURE__ */ new Set([S.value?.model, ...S.value?.models || []])].filter((e) => !!e));
|
|
22
|
+
return (n, o) => S.value ? (c(), i("div", p, [
|
|
23
|
+
a("label", { for: d(x) }, "Model", 8, m),
|
|
24
|
+
a("select", {
|
|
25
|
+
id: d(x),
|
|
26
|
+
value: e.modelValue,
|
|
27
|
+
disabled: e.disabled,
|
|
28
|
+
"aria-describedby": `${d(x)}-notice`,
|
|
29
|
+
"data-testid": "chat-model-select",
|
|
30
|
+
onChange: o[0] ||= (e) => y("update:modelValue", e.target.value)
|
|
31
|
+
}, [(c(!0), i(t, null, l(C.value, (e) => (c(), i("option", {
|
|
32
|
+
key: e,
|
|
33
|
+
value: e
|
|
34
|
+
}, u(e), 9, g))), 128))], 40, h),
|
|
35
|
+
a("small", { id: `${d(x)}-notice` }, " Changing the model updates this connection’s default and affects all chats using it. ", 8, _)
|
|
36
|
+
])) : r("", !0);
|
|
37
|
+
}
|
|
38
|
+
}), [["__scopeId", "data-v-ee5cd48f"]]);
|
|
39
|
+
//#endregion
|
|
40
|
+
export { v as t };
|