@trilogy-data/trilogy-studio-components 0.1.29 → 0.1.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/README.md +1 -0
  2. package/dist/AssetAutoImporter-BA8C4p09.js +403 -0
  3. package/dist/{ChatCreatorModal-C0OHgrEB.js → ChatCreatorModal-94gZ9D-y.js} +1 -1
  4. package/dist/{CodeBlock-CS86Ipg1.js → CodeBlock-C9o09ipr.js} +1 -1
  5. package/dist/{CommunityModels-BxJKe8_v.js → CommunityModels-D48H9Bqt.js} +6 -6
  6. package/dist/{ConnectionView-D-1gQNQ7.js → ConnectionView-sEXGE8Vs.js} +5 -5
  7. package/dist/{CreateEditorFromDatasourcePopup-RkNgUdzU.js → CreateEditorFromDatasourcePopup-BUoegyem.js} +2 -2
  8. package/dist/{Dashboard-DWJPKIeQ.js → Dashboard-C6adKZ7q.js} +202 -203
  9. package/dist/{DashboardImportSelector-t6tKq5N4.js → DashboardImportSelector-CQqXshDj.js} +1 -1
  10. package/dist/{DashboardMobile-CxObMuv6.js → DashboardMobile-BU1nDLQv.js} +42 -42
  11. package/dist/{Editor-DD1inQuU.js → Editor-DO4VRvek.js} +9 -10
  12. package/dist/{ErrorMessage-D5JeF3Iz.js → ErrorMessage-Cz7q7vJI.js} +1 -1
  13. package/dist/{GlobalChatPanel-BArWsM8Y.js → GlobalChatPanel-Ct6oSj_A.js} +6 -6
  14. package/dist/{IDE-D5GKLVYn.js → IDE-kdaEhA4g.js} +19 -20
  15. package/dist/{JobsView-By7OZgj_.js → JobsView-BcyWrDRf.js} +11 -11
  16. package/dist/{LLMChat-B-q_7sa4.js → LLMChat-Dg8VvTIP.js} +19 -19
  17. package/dist/{LLMView-8BKf70Ay.js → LLMView-CZNNYXC1.js} +61 -61
  18. package/dist/{LoadingView-Da0HfQ56.js → LoadingView-k2CIKiN7.js} +1 -1
  19. package/dist/{MarkdownRenderer-CQppLv_n.js → MarkdownRenderer-Dlb_KGmk.js} +1 -1
  20. package/dist/{MobileIDE-C81gvbco.js → MobileIDE-BQcdjWUT.js} +26 -27
  21. package/dist/{ModelCard-BMDgFDyQ.js → ModelCard-Dn2b5WLs.js} +5 -5
  22. package/dist/{ModelView-C4B8qJwX.js → ModelView-BEi83zrX.js} +6 -6
  23. package/dist/{PageLoading-CRl9HNIg.js → PageLoading-C7H6q6U6.js} +233 -233
  24. package/dist/{ResultComponent-C-A8sbr1.js → ResultComponent-DW9Q9tp9.js} +5 -5
  25. package/dist/{Results-C1nNHU7C.js → Results-N2OttUlb.js} +14 -14
  26. package/dist/{StatusIcon-v2EhaU49.js → StatusIcon-B21tjIXx.js} +1 -1
  27. package/dist/{StoreTokenModal-BV_gLE94.js → StoreTokenModal-CHgvjLGl.js} +1 -1
  28. package/dist/{SymbolsPane-CuVCamJf.js → SymbolsPane-DUrLpSSw.js} +11 -11
  29. package/dist/{TutorialPage-DGQGx3vF.js → TutorialPage-DHgPuFN0.js} +11 -11
  30. package/dist/{VegaLiteChart-BIeSuNU8.js → VegaLiteChart-BqHLSptG.js} +6689 -6690
  31. package/dist/{WelcomePage-T757Ynnn.js → WelcomePage-CN6ptsoF.js} +3 -3
  32. package/dist/agent.js +1349 -0
  33. package/dist/{cssMode-zpO2ap2B.js → cssMode-DW4OByy3.js} +2 -2
  34. package/dist/dashboard.js +66 -66
  35. package/dist/{editor.main-BQh6DxDB.js → editor.main-TuTbSVcN.js} +22 -22
  36. package/dist/{editorStore-k4IbmW9-.js → editorStore-Czhpct1j.js} +1695 -1125
  37. package/dist/entry.agent.d.ts +12 -0
  38. package/dist/entry.agent.d.ts.map +1 -0
  39. package/dist/entry.llm.d.ts +1 -1
  40. package/dist/entry.llm.d.ts.map +1 -1
  41. package/dist/{freemarker2-DQBqlEXc.js → freemarker2-ZGcKAI8o.js} +1 -1
  42. package/dist/{globalChatRuntime-BWahbZxZ.js → globalChatRuntime-BnMYNYqe.js} +30 -30
  43. package/dist/{handlebars-tgYxaM70.js → handlebars-B3s0Qrrb.js} +1 -1
  44. package/dist/{helpers-DDKx6kkf.js → helpers-B3tq3RZK.js} +17 -17
  45. package/dist/{html-jJahD3Mi.js → html-DM1koKCG.js} +1 -1
  46. package/dist/{htmlMode-BA1-8l2e.js → htmlMode-CpPImbDh.js} +2 -2
  47. package/dist/{javascript-Cypfo7va.js → javascript-jClqu73w.js} +1 -1
  48. package/dist/{jsonMode-xJye8PWS.js → jsonMode-CwFYTPO9.js} +2 -2
  49. package/dist/{liquid-BGDrv5da.js → liquid-C6l-UINC.js} +1 -1
  50. package/dist/llm/chatAgentPrompt.d.ts +4 -16
  51. package/dist/llm/chatAgentPrompt.d.ts.map +1 -1
  52. package/dist/llm/dashboardAgentRuntime.d.ts +10 -10
  53. package/dist/llm/dashboardAgentTools.d.ts +10 -10
  54. package/dist/llm/data/prompts.d.ts +1 -1
  55. package/dist/llm/data/prompts.d.ts.map +1 -1
  56. package/dist/llm/data/trilogySyntax.generated.d.ts +3 -3
  57. package/dist/llm/data/trilogySyntax.generated.d.ts.map +1 -1
  58. package/dist/llm/returnToUserTool.d.ts +20 -0
  59. package/dist/llm/returnToUserTool.d.ts.map +1 -0
  60. package/dist/llm/toolLoopCore.d.ts +7 -0
  61. package/dist/llm/toolLoopCore.d.ts.map +1 -1
  62. package/dist/llm/utils.d.ts.map +1 -1
  63. package/dist/{llm--BDQ6qkZ.js → llm-Bc1CfjOE.js} +2233 -2786
  64. package/dist/llm.js +3 -3
  65. package/dist/{localStorage-BYwXjN4M.js → localStorage-Cy0sHlT0.js} +18 -18
  66. package/dist/{lspLanguageFeatures-V3e_p9oN.js → lspLanguageFeatures-GDtuGOTD.js} +1 -1
  67. package/dist/{mdx-BUR1aImW.js → mdx-BQEQ0k1f.js} +1 -1
  68. package/dist/monaco.js +3 -3
  69. package/dist/{python-YLkl0pc6.js → python-USoVCfWY.js} +1 -1
  70. package/dist/{razor-BP8TRMDY.js → razor-BxmgiR-q.js} +1 -1
  71. package/dist/{reconcile-D-vMtlgJ.js → reconcile-DtPcgEjQ.js} +1 -1
  72. package/dist/{remoteStoreSync-PLFQCOmY.js → remoteStoreSync-CscErZ-I.js} +2 -2
  73. package/dist/{stores-S6dQ5cjI.js → stores-DgdADCiH.js} +325 -325
  74. package/dist/stores.js +3 -4
  75. package/dist/{tsMode-BH9HS_sH.js → tsMode-BEQ7aXX4.js} +1 -1
  76. package/dist/{typescript-BM-ynfk9.js → typescript-CzBSjjfY.js} +1 -1
  77. package/dist/{useChatWithTools-Bkd9MeMh.js → useChatWithTools-CMhGxdyr.js} +7 -7
  78. package/dist/{useDashboard-50rwbG0x.js → useDashboard-CjZgjmgb.js} +1148 -1148
  79. package/dist/{useGlobalChatPanel-JJZaHao8.js → useGlobalChatPanel-Doeilj18.js} +69 -70
  80. package/dist/views/LLMView.vue.d.ts +23 -23
  81. package/dist/views/TutorialPage.vue.d.ts +10 -10
  82. package/dist/views.js +147 -148
  83. package/dist/vite.agent.config.d.ts +3 -0
  84. package/dist/vite.agent.config.d.ts.map +1 -0
  85. package/dist/{workers-B9Eybl-M.js → workers-CHvkad0r.js} +2 -2
  86. package/dist/{xml-M5WFPSpA.js → xml-ODdyS0gX.js} +1 -1
  87. package/dist/{yaml-CEeFwjz9.js → yaml-PCBTA2qD.js} +1 -1
  88. package/package.json +7 -2
  89. package/dist/AssetAutoImporter-CCbTLQ9v.js +0 -403
  90. package/dist/rolldown-runtime-B0aSnxlc.js +0 -20
@@ -1,4 +1,4 @@
1
- import { p as e } from "./workers-B9Eybl-M.js";
1
+ import { p as e } from "./workers-CHvkad0r.js";
2
2
  //#region node_modules/.pnpm/monaco-editor@0.55.1/node_modules/monaco-editor/esm/vs/basic-languages/xml/xml.js
3
3
  var t = {
4
4
  comments: { blockComment: ["<!--", "-->"] },
@@ -1,4 +1,4 @@
1
- import { p as e } from "./workers-B9Eybl-M.js";
1
+ import { p as e } from "./workers-CHvkad0r.js";
2
2
  //#region node_modules/.pnpm/monaco-editor@0.55.1/node_modules/monaco-editor/esm/vs/basic-languages/yaml/yaml.js
3
3
  var t = {
4
4
  comments: { lineComment: "#" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trilogy-data/trilogy-studio-components",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -28,6 +28,11 @@
28
28
  "import": "./dist/llm.js",
29
29
  "default": "./dist/llm.js"
30
30
  },
31
+ "./agent": {
32
+ "types": "./dist/entry.agent.d.ts",
33
+ "import": "./dist/agent.js",
34
+ "default": "./dist/agent.js"
35
+ },
31
36
  "./stores": {
32
37
  "types": "./dist/stores.d.ts",
33
38
  "import": "./dist/stores.js",
@@ -52,7 +57,7 @@
52
57
  "dist"
53
58
  ],
54
59
  "scripts": {
55
- "build": "pnpm build:grammar && pnpm sync:trilogy-ai && vite build",
60
+ "build": "pnpm build:grammar && pnpm sync:trilogy-ai && vite build && vite build -c vite.agent.config.ts",
56
61
  "build:grammar": "pnpm -C ../prism-trilogy install --frozen-lockfile && pnpm -C ../prism-trilogy build",
57
62
  "sync:trilogy-ai": "node ../scripts/generate-trilogy-ai-guidance.mjs",
58
63
  "check:trilogy-ai": "node ../scripts/generate-trilogy-ai-guidance.mjs --check",
@@ -1,403 +0,0 @@
1
- import { n as e } from "./rolldown-runtime-B0aSnxlc.js";
2
- import { t } from "./_plugin-vue_export-helper-f9Rw-Il4.js";
3
- import { a as n, l as r, o as i, s as a } from "./stores-S6dQ5cjI.js";
4
- import { A as ee, M as te, T as o, j as s, x as c } from "./editorStore-k4IbmW9-.js";
5
- import { c as l } from "./useGlobalChatPanel-JJZaHao8.js";
6
- import { t as u } from "./helpers-DDKx6kkf.js";
7
- import { n as d, r as f } from "./remoteStoreSync-PLFQCOmY.js";
8
- import { Fragment as p, computed as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createTextVNode as v, createVNode as ne, defineComponent as re, inject as y, normalizeClass as b, onBeforeUnmount as ie, onMounted as ae, openBlock as x, ref as S, toDisplayString as C, unref as oe, vModelText as w, withDirectives as T } from "vue";
9
- //#region components/AssetAutoImporter.vue?vue&type=script&setup=true&lang.ts
10
- var se = { class: "auto-import-container" }, ce = {
11
- key: 0,
12
- class: "import-panel import-state error-state",
13
- role: "alert"
14
- }, le = { class: "import-headline" }, ue = { class: "error-message" }, de = {
15
- key: 1,
16
- class: "import-panel import-state loading-state",
17
- role: "status"
18
- }, fe = { class: "loading-content" }, pe = ["src"], me = { class: "import-headline" }, he = { class: "step-indicator" }, ge = { class: "step-icon" }, _e = { key: 0 }, ve = { key: 1 }, ye = { class: "step-icon" }, be = { key: 0 }, xe = { key: 1 }, Se = { key: 2 }, Ce = { class: "step-icon" }, we = { key: 0 }, Te = { key: 1 }, Ee = { key: 2 }, De = { class: "step-icon" }, Oe = { key: 0 }, ke = { key: 1 }, Ae = { key: 2 }, je = { class: "step-text" }, Me = {
19
- key: 2,
20
- class: "import-panel import-form"
21
- }, Ne = { class: "import-header" }, Pe = { class: "import-headline" }, Fe = { class: "import-details" }, Ie = {
22
- key: 0,
23
- class: "import-source"
24
- }, Le = { class: "import-source" }, Re = { class: "connection-setup" }, ze = { class: "setup-description" }, Be = {
25
- key: 0,
26
- class: "form-group"
27
- }, Ve = {
28
- key: 1,
29
- class: "form-group"
30
- }, He = { class: "form-group" }, Ue = { class: "form-group" }, We = { class: "form-group" }, Ge = { class: "form-actions" }, Ke = ["disabled"], qe = 1500, E = /*@__PURE__*/ re({
31
- __name: "AssetAutoImporter",
32
- emits: ["importComplete", "fullScreen"],
33
- setup(e, { emit: t }) {
34
- let re = t, E = y("dashboardStore"), D = y("connectionStore"), O = y("editorStore"), k = y("modelStore"), A = y("communityApiStore"), Je = y("queryExecutionService"), Ye = y("saveDashboards"), Xe = y("saveAll"), Ze = y("storageSources", []), j = n(), Qe = m(() => Ze.find((e) => e.type === "remote"));
35
- if (!E || !D || !O || !k || !Ye || !Je || !Xe) throw Error("Required stores not provided");
36
- let M = S(!0), N = S(""), P = S(""), $e = S(""), et = S("generic"), F = S(""), I = S(!1), L = S(""), R = S("dashboard"), z = S(""), B = S(""), V = S(null), H = S(!1), tt = S(""), U = S(!1), W = S("importing"), G = S(Date.now()), K = S(Date.now()), nt = S("0 ms"), q = null, J = S({
37
- mdToken: "",
38
- projectId: "",
39
- username: "",
40
- password: "",
41
- account: "",
42
- sshPrivateKey: ""
43
- }), Y = S(!0), rt = {
44
- duckdb: {
45
- fields: [],
46
- autoImport: !0
47
- },
48
- motherduck: {
49
- fields: ["mdToken"],
50
- autoImport: !1
51
- },
52
- bigquery: {
53
- fields: ["projectId"],
54
- autoImport: !1
55
- },
56
- snowflake: {
57
- fields: [
58
- "username",
59
- "account",
60
- "sshPrivateKey"
61
- ],
62
- autoImport: !1
63
- }
64
- }, it = m(() => {
65
- if (I.value) return !1;
66
- let e = rt[B.value];
67
- return !e || !e.autoImport;
68
- }), at = m(() => {
69
- let e = rt[B.value];
70
- return e ? e.fields : [];
71
- }), ot = m(() => {
72
- let e = c.find((e) => e.value === B.value);
73
- return e ? e.label : B.value;
74
- }), X = m(() => {
75
- switch (R.value) {
76
- case "dashboard": return "Dashboard";
77
- case "editor":
78
- case "trilogy": return "Editor";
79
- default: return "Asset";
80
- }
81
- }), st = m(() => `A model named "${z.value}" already exists. Overwriting will replace its imported sources. Continue?`), ct = m(() => {
82
- switch (R.value) {
83
- case "dashboard": return "Setting up your dashboard...";
84
- case "editor":
85
- case "trilogy": return "Setting up your editor...";
86
- default: return "Setting up your asset...";
87
- }
88
- }), lt = (e) => 100, Z = () => {
89
- Q();
90
- let e = Date.now() - K.value;
91
- if (e < 1e3) nt.value = `${e} ms`;
92
- else if (e < 6e4) {
93
- let t = (e / 1e3).toFixed(1);
94
- nt.value = `${t} sec`;
95
- } else {
96
- let t = Math.floor(e / 6e4), n = (e % 6e4 / 1e3).toFixed(1);
97
- nt.value = n === "0.0" ? `${t} min` : `${t} min ${n} sec`;
98
- }
99
- if (!V.value && (M.value || H.value)) {
100
- let t = lt(e);
101
- q = setTimeout(Z, t);
102
- }
103
- }, Q = () => {
104
- q &&= (clearTimeout(q), null);
105
- }, ut = async (e) => {
106
- let t = Date.now() - G.value, n = Math.max(0, qe - t);
107
- n > 0 && W.value !== "registering" && W.value !== "importing" && await new Promise((e) => setTimeout(e, n)), W.value = e, G.value = Date.now();
108
- };
109
- function $() {
110
- if (!B.value) {
111
- Y.value = !1;
112
- return;
113
- }
114
- let e = at.value;
115
- for (let t of e) if (!J.value[t]) {
116
- Y.value = !1;
117
- return;
118
- }
119
- Y.value = !0;
120
- }
121
- let dt = (e) => $e.value || s(e), ft = async () => {
122
- if (!P.value || !A) return;
123
- let e = te(P.value), t = dt(e), n = A.stores.find((e) => e.id === t);
124
- if (n) {
125
- n.type === "generic" && (F.value && (n.token = F.value), I.value && z.value && (n.name = z.value)), console.log(`Store ${t} already registered`);
126
- return;
127
- }
128
- let r = et.value === "static" ? {
129
- ...o(e),
130
- id: t
131
- } : {
132
- type: "generic",
133
- id: t,
134
- name: I.value && z.value ? z.value : `Auto-registered: ${e}`,
135
- baseUrl: e,
136
- token: F.value || void 0
137
- };
138
- try {
139
- await A.addStore(r), console.log(`Store ${t} registered successfully`);
140
- } catch (e) {
141
- console.warn(`Failed to register store ${t}:`, e);
142
- }
143
- }, pt = () => {
144
- if (!P.value || !A) return null;
145
- let e = te(P.value), t = dt(e), n = A.stores.find((e) => e.id === t);
146
- return n?.type === "generic" ? n : null;
147
- }, mt = () => {
148
- U.value = !1, V.value = `Import cancelled. Existing model "${z.value}" was not overwritten.`, M.value = !1, Q();
149
- }, ht = async () => {
150
- U.value = !1, V.value = null, await yt();
151
- }, gt = async () => {
152
- if (!I.value && k.models[z.value]) {
153
- M.value = !1, Q(), U.value = !0;
154
- return;
155
- }
156
- await yt();
157
- }, _t = async () => {
158
- if (!Qe.value) throw Error("Remote storage is not available in this context.");
159
- let e = pt();
160
- if (!e) throw Error("Remote imports require a valid store URL that can be registered.");
161
- await d(Qe.value, e.id, O, D, k);
162
- let t = ee(e);
163
- if (R.value === "dashboard") {
164
- let e = Object.values(E.dashboards).find((e) => e.name === L.value && e.connection === t);
165
- if (!e) throw Error(`Dashboard "${L.value}" is not part of the remote store. Remote stores don't serve dashboards — create one locally against this store's connection first.`);
166
- return E.warmDashboardQueries(e.id, Je, O), {
167
- foundAssetId: e.id,
168
- connectionName: t
169
- };
170
- }
171
- let n = `remote:${e.id}:`, r = Object.values(O.editors).filter((e) => e.id.startsWith(n) && e.connection === t), i = (e) => e.replace(/\.[^.]+$/, ""), a = r.find((e) => e.name === L.value || i(e.name) === L.value);
172
- if (!a) {
173
- let e = r.map((e) => e.name).join(", ");
174
- throw Error(`Editor "${L.value}" was not found in the remote store, have ${e}`);
175
- }
176
- return {
177
- foundAssetId: a.id,
178
- connectionName: t
179
- };
180
- }, vt = async () => {
181
- let e = `${z.value}-connection`, t = new u(O, k, E);
182
- k.models[z.value] || k.newModelConfig(z.value, !0), D.connectionByName(e) || D.newConnection(e, B.value, {
183
- mdToken: J.value.mdToken,
184
- projectId: J.value.projectId,
185
- username: J.value.username,
186
- password: J.value.password,
187
- account: J.value.account,
188
- privateKey: J.value.sshPrivateKey,
189
- model: z.value
190
- });
191
- let n = pt(), r = await t.importModel(z.value, N.value, e, {
192
- token: F.value || void 0,
193
- remote: !1,
194
- remoteStoreId: n?.id || null,
195
- remoteBaseUrl: n?.baseUrl || P.value || null
196
- });
197
- if (D.connectionByName(e)?.setModel(z.value), R.value === "dashboard") {
198
- let t = r?.dashboards.get(L.value), n = t ? E.dashboards[t] : void 0;
199
- if (!n) {
200
- let t = Object.values(E.dashboards).filter((t) => t.connection === e && t.storage !== "remote").map((e) => e.name).join(", ");
201
- throw Error(`Dashboard "${L.value}" was not found in the imported model, have ${t}`);
202
- }
203
- return E.warmDashboardQueries(n.id, Je, O), {
204
- foundAssetId: n.id,
205
- connectionName: e
206
- };
207
- }
208
- let i = r?.trilogy.get(L.value) || r?.sql.get(L.value) || r?.python.get(L.value), a = i ? O.editors[i] : void 0;
209
- if (!a) {
210
- let t = Object.values(O.editors).filter((t) => t.connection === e && t.storage !== "remote").map((e) => e.name).join(", ");
211
- throw Error(`Editor "${L.value}" was not found in the imported model, have ${t}`);
212
- }
213
- return {
214
- foundAssetId: a.id,
215
- connectionName: e
216
- };
217
- }, yt = async () => {
218
- try {
219
- if (!z.value || !L.value) {
220
- V.value = "Missing required import parameters";
221
- return;
222
- }
223
- if (!I.value && !N.value) {
224
- V.value = "Missing required import parameters";
225
- return;
226
- }
227
- K.value = Date.now(), G.value = Date.now(), M.value = !0, Z(), P.value ? (W.value = "registering", await ft(), await ut("importing")) : W.value = "importing";
228
- let { foundAssetId: e, connectionName: t } = I.value ? await _t() : await vt();
229
- await ut("connecting"), tt.value = e, I.value || await Xe();
230
- let n = D.connectionByName(t);
231
- n && await D.resetConnection(n.id), await ut("preparing"), M.value = !1, H.value = !0, q && clearTimeout(q), Z(), setTimeout(() => {
232
- Q();
233
- }, 2e3), re("importComplete", e, R.value), r(i.IMPORT), r(i.STORE), r(i.STORE_ID), r(i.STORE_KIND), r(i.TOKEN), r(i.ASSET_TYPE), r(i.ASSET_NAME), r(i.DASHBOARD), r(i.REMOTE), setTimeout(() => {
234
- j.closeTab(null, "asset-import"), R.value === "dashboard" ? (j.openTab("dashboard", null, e), j.setActiveSidebarScreen("dashboard")) : (j.openTab("editors", null, e), j.setActiveSidebarScreen("editors"));
235
- }, 500);
236
- } catch (e) {
237
- console.error("Import failed:", e), V.value = e instanceof Error ? e.message : "Import failed", M.value = !1, Q();
238
- }
239
- };
240
- ae(async () => {
241
- try {
242
- K.value = Date.now(), G.value = Date.now(), Z();
243
- let e = j.modelImport.value, t = a(i.STORE, ""), n = a(i.STORE_ID, ""), r = a(i.STORE_KIND, ""), ee = a(i.TOKEN, ""), te = a(i.REMOTE, ""), o = a(i.ASSET_TYPE, ""), s = a(i.ASSET_NAME, ""), c = a(i.DASHBOARD, ""), l = a(i.MODEL_NAME, ""), u = a(i.CONNECTION, ""), d = "dashboard", f = "";
244
- o && s ? (d = o, f = s) : c && (d = "dashboard", f = c);
245
- let p = [
246
- "true",
247
- "1",
248
- "yes"
249
- ].includes((te || "").toLowerCase());
250
- if (!f || !l || !p && (!e || !u) || p && !t) {
251
- V.value = p ? "Missing required import parameters (store, assetName/dashboard, modelName)" : "Missing required import parameters (import, assetName/dashboard, modelName, connection)", M.value = !1, Q();
252
- return;
253
- }
254
- if (N.value = e ? decodeURIComponent(e) : "", P.value = t ? decodeURIComponent(t) : "", $e.value = n ? decodeURIComponent(n) : "", et.value = r === "static" && !p ? "static" : "generic", F.value = ee ? decodeURIComponent(ee) : "", I.value = p, L.value = decodeURIComponent(f), R.value = d, z.value = decodeURIComponent(l), B.value = u, !I.value && !rt[B.value]) {
255
- V.value = `Unsupported connection type: ${B.value}`, M.value = !1, Q();
256
- return;
257
- }
258
- it.value ? (M.value = !1, Q(), $()) : await gt();
259
- } catch (e) {
260
- console.error("Auto-import initialization failed:", e), V.value = e instanceof Error ? e.message : "Failed to initialize import", M.value = !1, Q();
261
- }
262
- }), ie(() => {
263
- Q();
264
- });
265
- let bt = async () => {
266
- if (M.value = !0, !Y.value) throw Error("Form is not valid");
267
- console.log("performing import"), await gt();
268
- }, xt = () => {
269
- R.value === "dashboard" ? (j.setActiveDashboard(null), j.setActiveScreen("dashboard")) : j.setActiveScreen("editors");
270
- };
271
- return (e, t) => (x(), g("div", se, [V.value ? (x(), g("div", ce, [
272
- t[5] ||= _("div", { class: "error-icon" }, "⚠️", -1),
273
- _("h2", le, C(X.value) + " Load Failed", 1),
274
- _("p", ue, C(V.value), 1),
275
- _("div", { class: "error-actions" }, [_("button", {
276
- onClick: xt,
277
- class: "import-action manual-import-button"
278
- }, " Try Manual Import ")])
279
- ])) : M.value || H.value ? (x(), g("div", de, [_("div", fe, [
280
- _("img", {
281
- src: oe(l),
282
- class: "trilogy-icon spinning",
283
- alt: "Loading"
284
- }, null, 8, pe),
285
- _("h2", me, C(ct.value), 1),
286
- _("div", he, [
287
- P.value ? (x(), g("div", {
288
- key: 0,
289
- class: b(["step", {
290
- active: W.value === "registering",
291
- completed: W.value !== "registering"
292
- }])
293
- }, [_("div", ge, [W.value === "registering" ? (x(), g("span", _e, "⟳")) : (x(), g("span", ve, "✓"))]), t[6] ||= _("span", { class: "step-text" }, "Registering store", -1)], 2)) : h("", !0),
294
- _("div", { class: b(["step", {
295
- active: W.value === "importing",
296
- completed: W.value !== "importing" && W.value !== "registering" && (W.value === "connecting" || W.value === "preparing" || H.value)
297
- }]) }, [_("div", ye, [W.value === "importing" ? (x(), g("span", be, "⟳")) : W.value === "registering" ? (x(), g("span", xe, "○")) : (x(), g("span", Se, "✓"))]), t[7] ||= _("span", { class: "step-text" }, "Importing model", -1)], 2),
298
- _("div", { class: b(["step", {
299
- active: W.value === "connecting",
300
- completed: W.value === "preparing" || H.value
301
- }]) }, [_("div", Ce, [W.value === "connecting" ? (x(), g("span", we, "⟳")) : W.value === "preparing" || H.value ? (x(), g("span", Te, "✓")) : (x(), g("span", Ee, "○"))]), t[8] ||= _("span", { class: "step-text" }, "Establishing connection", -1)], 2),
302
- _("div", { class: b(["step", {
303
- active: W.value === "preparing" || H.value,
304
- completed: H.value
305
- }]) }, [_("div", De, [W.value === "preparing" ? (x(), g("span", Oe, "⟳")) : H.value ? (x(), g("span", ke, "✓")) : (x(), g("span", Ae, "○"))]), _("span", je, "Preparing " + C(X.value.toLowerCase()), 1)], 2)
306
- ]),
307
- t[9] ||= _("p", { class: "import-details" }, "This may take a few seconds.", -1)
308
- ])])) : it.value ? (x(), g("div", Me, [
309
- _("div", Ne, [_("h2", Pe, "Import Model & " + C(X.value), 1), _("div", Fe, [
310
- _("p", null, [t[10] ||= _("strong", null, "Model:", -1), v(" " + C(z.value), 1)]),
311
- _("p", null, [_("strong", null, C(X.value) + ":", 1), v(" " + C(L.value), 1)]),
312
- P.value ? (x(), g("p", Ie, [t[11] ||= _("strong", null, "Store:", -1), v(" " + C(P.value), 1)])) : h("", !0),
313
- _("p", Le, [t[12] ||= _("strong", null, "From:", -1), v(" " + C(N.value), 1)])
314
- ])]),
315
- _("div", Re, [
316
- _("h3", null, C(ot.value) + " Connection Setup", 1),
317
- _("p", ze, " This model requires a " + C(B.value) + " connection. Please provide the required configuration: ", 1),
318
- B.value === "motherduck" ? (x(), g("div", Be, [t[13] ||= _("label", { for: "md-token" }, "MotherDuck Token", -1), T(_("input", {
319
- type: "text",
320
- "onUpdate:modelValue": t[0] ||= (e) => J.value.mdToken = e,
321
- id: "md-token",
322
- placeholder: "Enter your MotherDuck token",
323
- class: "sidebar-control-input connection-input",
324
- onInput: $
325
- }, null, 544), [[
326
- w,
327
- J.value.mdToken,
328
- void 0,
329
- { trim: !0 }
330
- ]])])) : B.value === "bigquery" ? (x(), g("div", Ve, [t[14] ||= _("label", { for: "project-id" }, "BigQuery Project ID", -1), T(_("input", {
331
- type: "text",
332
- "onUpdate:modelValue": t[1] ||= (e) => J.value.projectId = e,
333
- id: "project-id",
334
- placeholder: "Enter your billing project ID",
335
- class: "sidebar-control-input connection-input",
336
- onInput: $
337
- }, null, 544), [[
338
- w,
339
- J.value.projectId,
340
- void 0,
341
- { trim: !0 }
342
- ]])])) : B.value === "snowflake" ? (x(), g(p, { key: 2 }, [
343
- _("div", He, [t[15] ||= _("label", { for: "snowflake-username" }, "Username", -1), T(_("input", {
344
- type: "text",
345
- "onUpdate:modelValue": t[2] ||= (e) => J.value.username = e,
346
- id: "snowflake-username",
347
- placeholder: "Snowflake username",
348
- class: "sidebar-control-input connection-input",
349
- onInput: $
350
- }, null, 544), [[
351
- w,
352
- J.value.username,
353
- void 0,
354
- { trim: !0 }
355
- ]])]),
356
- _("div", Ue, [t[16] ||= _("label", { for: "snowflake-account" }, "Account", -1), T(_("input", {
357
- type: "text",
358
- "onUpdate:modelValue": t[3] ||= (e) => J.value.account = e,
359
- id: "snowflake-account",
360
- placeholder: "Snowflake account identifier",
361
- class: "sidebar-control-input connection-input",
362
- onInput: $
363
- }, null, 544), [[
364
- w,
365
- J.value.account,
366
- void 0,
367
- { trim: !0 }
368
- ]])]),
369
- _("div", We, [t[17] ||= _("label", { for: "snowflake-key" }, "Private Key", -1), T(_("input", {
370
- type: "text",
371
- "onUpdate:modelValue": t[4] ||= (e) => J.value.sshPrivateKey = e,
372
- id: "snowflake-key",
373
- placeholder: "Private key for authentication",
374
- class: "sidebar-control-input connection-input",
375
- onInput: $
376
- }, null, 544), [[
377
- w,
378
- J.value.sshPrivateKey,
379
- void 0,
380
- { trim: !0 }
381
- ]])])
382
- ], 64)) : h("", !0)
383
- ]),
384
- _("div", Ge, [_("button", {
385
- onClick: bt,
386
- class: "import-action import-button",
387
- disabled: !Y.value
388
- }, " Import Model & " + C(X.value), 9, Ke), _("button", { onClick: xt }, "Cancel")])
389
- ])) : h("", !0), ne(f, {
390
- show: U.value,
391
- title: "Overwrite Existing Model?",
392
- message: st.value,
393
- "confirm-label": "Overwrite",
394
- "cancel-label": "Cancel",
395
- "confirm-test-id": "confirm-overwrite-model",
396
- "cancel-test-id": "cancel-overwrite-model",
397
- onClose: mt,
398
- onConfirm: ht
399
- }, null, 8, ["show", "message"])]));
400
- }
401
- }), D = /* @__PURE__ */ e({ default: () => O }), O = /*#__PURE__*/ t(E, [["__scopeId", "data-v-331fa5ac"]]);
402
- //#endregion
403
- export { D as n, O as t };
@@ -1,20 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, n) => {
3
- let r = {};
4
- for (var i in e) t(r, i, {
5
- get: e[i],
6
- enumerable: !0
7
- });
8
- return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
9
- }, c = (e, i, o, s) => {
10
- if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
11
- get: ((e) => i[e]).bind(null, d),
12
- enumerable: !(s = n(i, d)) || s.enumerable
13
- });
14
- return e;
15
- }, l = (n, r, o) => (o = n == null ? {} : e(i(n)), c(r || !n || !n.__esModule || !a.call(n, "default") ? t(o, "default", {
16
- value: n,
17
- enumerable: !0
18
- }) : o, n));
19
- //#endregion
20
- export { s as n, l as r, o as t };