@trilogy-data/trilogy-studio-components 0.1.26 → 0.1.27

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 (138) hide show
  1. package/dist/AssetAutoImporter-OHphsfW9.js +403 -0
  2. package/dist/{ChatCreatorModal-CL-jBnc3.js → ChatCreatorModal-CuXha6Dg.js} +3 -3
  3. package/dist/{ChatModelSelect-Do-VRUFc.js → ChatModelSelect-Cz7axWjP.js} +1 -1
  4. package/dist/{CodeBlock-PT4no49I.js → CodeBlock-BBsaC6hX.js} +4 -4
  5. package/dist/{CommunityModels-Cmro0hV3.js → CommunityModels-CIQQhO-y.js} +7 -7
  6. package/dist/{ConnectionErrorPopup-FSs7U-Yl.js → ConnectionErrorPopup-7vpqgF0s.js} +1 -1
  7. package/dist/{ConnectionView-COnTTuA4.js → ConnectionView-7Jj_Ggdi.js} +49 -49
  8. package/dist/{CreateEditorFromDatasourcePopup-snOh1d5h.js → CreateEditorFromDatasourcePopup-CrVHUWFl.js} +4 -4
  9. package/dist/{Dashboard-BH9ZwMVJ.js → Dashboard-DxSi9W6Q.js} +276 -280
  10. package/dist/{DashboardImportSelector-DQSvu9T-.js → DashboardImportSelector-kuDRDYi8.js} +2 -2
  11. package/dist/{DashboardMobile-BUPtdN2V.js → DashboardMobile-CZEgTb0R.js} +39 -39
  12. package/dist/{DrilldownPane-CBs5ZojS.js → DrilldownPane-BheRHJMs.js} +5 -7
  13. package/dist/{Editor-DQsYpkwl.js → Editor-D6tdutTm.js} +105 -103
  14. package/dist/{ErrorMessage-XMn_08gJ.js → ErrorMessage-D5JeF3Iz.js} +4 -4
  15. package/dist/{GlobalChatPanel-DhnOaige.js → GlobalChatPanel-BXZh0sdD.js} +20 -21
  16. package/dist/{IDE-HLa8vybk.js → IDE-T8PmyAQ_.js} +200 -203
  17. package/dist/{JobsView-B97HBoIE.js → JobsView-Ca97MiSd.js} +13 -14
  18. package/dist/{LLMChat-CxJcPLEG.js → LLMChat-Cch33Yd_.js} +3 -3
  19. package/dist/{LLMView-C1MUf0c2.js → LLMView-BDb6wD74.js} +23 -23
  20. package/dist/{LoadingView-s1uznGwG.js → LoadingView-B-xFwd2N.js} +2 -2
  21. package/dist/{MarkdownRenderer-BNDuEyG-.js → MarkdownRenderer-BWvdx0k3.js} +531 -430
  22. package/dist/{MobileIDE-BpqXoaMR.js → MobileIDE-DpdEQEqc.js} +179 -182
  23. package/dist/{ModelCard-BhN25jaV.js → ModelCard-DkAMP4X9.js} +12 -13
  24. package/dist/{ModelView-DUDA_PtZ.js → ModelView-DomyhN8g.js} +7 -7
  25. package/dist/PageLoading-BAvKGo9h.js +5937 -0
  26. package/dist/{ResultComponent-CAn_r3BL.js → ResultComponent-zoOSoRLe.js} +8 -8
  27. package/dist/{Results-BJtlwebY.js → Results-dq-SlJbU.js} +17 -19
  28. package/dist/{StatusIcon-BylPx2EO.js → StatusIcon-AbxNvJ6p.js} +2 -2
  29. package/dist/{StoreTokenModal-zCSYhfrw.js → StoreTokenModal-CM8WXdu1.js} +2 -2
  30. package/dist/{SymbolsPane-KYSwN9Sv.js → SymbolsPane-DfaxeaPS.js} +6 -3
  31. package/dist/{TrilogyEmbedProvider-WA_dlv9e.js → TrilogyEmbedProvider-D3h0gYnX.js} +9 -9
  32. package/dist/{TutorialPage-NRcee6Dx.js → TutorialPage-BtEJG7cT.js} +27 -28
  33. package/dist/{VegaLiteChart-D1slfOUY.js → VegaLiteChart-BVyAab-o.js} +12131 -10947
  34. package/dist/{WelcomePage-D5mU2x1L.js → WelcomePage-BoqzYBLr.js} +5 -5
  35. package/dist/{embedTheme-Bub46ILG.js → _plugin-vue_export-helper-f9Rw-Il4.js} +14 -6
  36. package/dist/assets/{css.worker-9aDGcEUy.js → css.worker-niORQtzO.js} +14 -14
  37. package/dist/assets/{html.worker-D2LKDpnG.js → html.worker-CO5LvJpF.js} +17 -17
  38. package/dist/assets/json.worker-BezHzWUV.js +58 -0
  39. package/dist/assets/{ts.worker-Bz0-EaKK.js → ts.worker-CYhxGg0r.js} +107 -107
  40. package/dist/{results-DTgAKr5j.js → base-DuKnVD-A.js} +216 -45
  41. package/dist/components/FeedbackBanner.vue.d.ts +4 -0
  42. package/dist/components/FeedbackBanner.vue.d.ts.map +1 -0
  43. package/dist/components/dashboard/DashboardCreatorIcon.vue.d.ts +54 -0
  44. package/dist/components/dashboard/DashboardCreatorIcon.vue.d.ts.map +1 -0
  45. package/dist/components/dashboard/DashboardProvenance.vue.d.ts +30 -0
  46. package/dist/components/dashboard/DashboardProvenance.vue.d.ts.map +1 -0
  47. package/dist/components/dashboard/ReportLayout.vue.d.ts +19 -0
  48. package/dist/components/dashboard/ReportLayout.vue.d.ts.map +1 -0
  49. package/dist/components/editor/Editor.vue.d.ts +3 -3
  50. package/dist/components/editor/EditorCreatorIcon.vue.d.ts +62 -0
  51. package/dist/components/editor/EditorCreatorIcon.vue.d.ts.map +1 -0
  52. package/dist/components/editor/ValidationComponent.vue.d.ts +50 -0
  53. package/dist/components/editor/ValidationComponent.vue.d.ts.map +1 -0
  54. package/dist/components/model/ModelCard.vue.d.ts +3 -3
  55. package/dist/components/sidebar/LLMConnectionList.vue.d.ts.map +1 -1
  56. package/dist/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  57. package/dist/components/tutorial/TutorialPrompt.vue.d.ts +3 -3
  58. package/dist/components/tutorial/TutorialPrompt.vue.d.ts.map +1 -1
  59. package/dist/{remoteWorker-Dkv3TJ0j.js → connections-CWH3zwH2.js} +4544 -4126
  60. package/dist/connections.js +3 -4
  61. package/dist/{cssMode-D4Rzr1Cu.js → cssMode-zpO2ap2B.js} +5 -6
  62. package/dist/dashboard.js +28 -31
  63. package/dist/{dist-CXoL8kXK.js → dist-1z5KURzS.js} +55 -50
  64. package/dist/{dist-DKkuvbPb.js → dist-Bv3D2p5A.js} +20 -18
  65. package/dist/{editor.main-Cl8i7rHY.js → editor.main-BQh6DxDB.js} +33 -33
  66. package/dist/{editorRefinementRuntime-DoP9P5J2.js → editorStore-CAlMJftt.js} +1692 -575
  67. package/dist/embed.js +2 -2
  68. package/dist/{freemarker2-fW5NBILf.js → freemarker2-DQBqlEXc.js} +1 -1
  69. package/dist/{globalChatRuntime-DWZxeS57.js → globalChatRuntime-CyS7vH51.js} +16 -16
  70. package/dist/{handlebars-dG4w8UUY.js → handlebars-tgYxaM70.js} +1 -1
  71. package/dist/{helpers-BLQAgX3C.js → helpers-BbVlA3Pf.js} +34 -35
  72. package/dist/{html-1Dq70BdU.js → html-jJahD3Mi.js} +1 -1
  73. package/dist/{htmlMode--IQmLBeh.js → htmlMode-BA1-8l2e.js} +5 -6
  74. package/dist/{javascript-CTzBM4sF.js → javascript-Cypfo7va.js} +1 -1
  75. package/dist/{jsonMode-DzeJjIEH.js → jsonMode-xJye8PWS.js} +25 -25
  76. package/dist/{liquid-DlHThiki.js → liquid-BGDrv5da.js} +1 -1
  77. package/dist/llm-ClU-2rgk.js +18493 -0
  78. package/dist/llm.js +2 -3
  79. package/dist/{localStorage-D9uyOFEO.js → localStorage-CGQ1iJXt.js} +40 -43
  80. package/dist/{lspLanguageFeatures-Cdfs3EKq.js → lspLanguageFeatures-V3e_p9oN.js} +32 -32
  81. package/dist/{mdx-fn3g4PH5.js → mdx-BUR1aImW.js} +1 -1
  82. package/dist/monaco.js +3 -3
  83. package/dist/{python-CCVj0pFt.js → python-YLkl0pc6.js} +1 -1
  84. package/dist/{razor-Cj3flYnk.js → razor-BP8TRMDY.js} +1 -1
  85. package/dist/{reconcile-Dyf4UZmj.js → reconcile-DXIvGwBk.js} +1 -1
  86. package/dist/{remoteStoreSync-Z-yjlYtI.js → remoteStoreSync-CuQBWpWf.js} +3 -3
  87. package/dist/{rolldown-runtime-Dqa2HsxW.js → rolldown-runtime-B0aSnxlc.js} +2 -2
  88. package/dist/static/test_import.vue.d.ts +4 -0
  89. package/dist/static/test_import.vue.d.ts.map +1 -0
  90. package/dist/stores-LlyiwSbK.js +2604 -0
  91. package/dist/stores.js +4 -7
  92. package/dist/trilogy-studio-components.css +1 -1
  93. package/dist/{tsMode-GI4xMYAl.js → tsMode-BH9HS_sH.js} +64 -66
  94. package/dist/{typescript-CPibXi3J.js → typescript-BM-ynfk9.js} +1 -1
  95. package/dist/{useChatWithTools-B0HZ_DVh.js → useChatWithTools-m3Jn_SV-.js} +11 -11
  96. package/dist/{useDashboard-CdSnPe_6.js → useDashboard-BOAuvVEw.js} +1014 -1022
  97. package/dist/{tabulator_esm-CxLvGDp8.js → useGlobalChatPanel-DuP1q7_f.js} +1729 -711
  98. package/dist/{useResizableDialog-B0ePSts4.js → useResizableDialog-Cs90WJdF.js} +2 -2
  99. package/dist/views/ModelView.vue.d.ts +6 -6
  100. package/dist/views/ModelView.vue.d.ts.map +1 -1
  101. package/dist/views/TutorialPage.vue.d.ts +9 -9
  102. package/dist/views/TutorialPage.vue.d.ts.map +1 -1
  103. package/dist/views.js +192 -194
  104. package/dist/{editor.api2-ClD5pp8H.js → workers-B9Eybl-M.js} +16252 -15926
  105. package/dist/{xml-BNyphceI.js → xml-M5WFPSpA.js} +1 -1
  106. package/dist/{yaml-DE5Vz0PH.js → yaml-CEeFwjz9.js} +1 -1
  107. package/package.json +29 -20
  108. package/dist/AssetAutoImporter-CBzvBaOt.js +0 -405
  109. package/dist/DashboardCreatorInline-CDU7kLy3.js +0 -129
  110. package/dist/DataTable-DoRDynP1.js +0 -365
  111. package/dist/EditorCreatorInline-D6_y1H_h.js +0 -125
  112. package/dist/LoadingButton-OH3frQuO.js +0 -138
  113. package/dist/ModalDialog-D1EOG4rl.js +0 -42
  114. package/dist/ModelCreator-CCdC7EXt.js +0 -253
  115. package/dist/PageLoading-BzniJM0C.js +0 -2669
  116. package/dist/Tooltip-Dihir4zs.js +0 -103
  117. package/dist/_plugin-vue_export-helper-B3ysoDQm.js +0 -8
  118. package/dist/assets/json.worker-CJ5MmO5Q.js +0 -58
  119. package/dist/base-C8IuZWqY.js +0 -164
  120. package/dist/connectionHistoryStorage-DKJHiKJY.js +0 -111
  121. package/dist/connectionHistoryStore-DQeBvStZ.js +0 -61
  122. package/dist/connections-CJSb1TZl.js +0 -229
  123. package/dist/constants-DgFEYN2b.js +0 -7
  124. package/dist/dashboardStore-ppM6nGks.js +0 -641
  125. package/dist/demoSetup-mwa-RDC6.js +0 -2942
  126. package/dist/editorRefinementToolExecutor-CVY3FA7k.js +0 -4624
  127. package/dist/editorStore-BhhmXbi-.js +0 -1019
  128. package/dist/formatting-BbJ5ICgh.js +0 -6
  129. package/dist/llm-BBOVWb-F.js +0 -11967
  130. package/dist/llmStore-DJM2JhzY.js +0 -153
  131. package/dist/monaco.contribution-ikesdolO.js +0 -128
  132. package/dist/stores-BT9hTLny.js +0 -1708
  133. package/dist/trilogy-BroD2Qmp.js +0 -4
  134. package/dist/urlStore-52HG6lsX.js +0 -55
  135. package/dist/useGlobalChatPanel-D_0luajQ.js +0 -85
  136. package/dist/useIsMobile-CNpUQAvk.js +0 -8
  137. package/dist/usePrismHighlight-DVyDiDAL.js +0 -183
  138. package/dist/workers-Br7ThUKL.js +0 -47
@@ -1,4 +1,4 @@
1
- import { u as e } from "./editor.api2-ClD5pp8H.js";
1
+ import { p as e } from "./workers-B9Eybl-M.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 { u as e } from "./editor.api2-ClD5pp8H.js";
1
+ import { p as e } from "./workers-B9Eybl-M.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.26",
3
+ "version": "0.1.27",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -66,42 +66,51 @@
66
66
  },
67
67
  "devDependencies": {
68
68
  "@trilogy-data/prism-trilogy": "link:../prism-trilogy",
69
- "@types/luxon": "^3.7.2",
69
+ "@types/luxon": "^3.7.5",
70
70
  "@types/prismjs": "^1.26.6",
71
71
  "@types/tabulator-tables": "^6.3.6",
72
- "@vitejs/plugin-vue": "^6.0.8",
73
- "@vitest/ui": "^4.1.10",
74
- "@vue/test-utils": "^2.4.11",
72
+ "@vitejs/plugin-vue": "^6.0.9",
73
+ "@vitest/ui": "^4.1.11",
74
+ "@vue/test-utils": "^2.5.1",
75
75
  "@vue/tsconfig": "^0.9.1",
76
76
  "jsdom": "^29.1.1",
77
- "pinia": "^4.0.1",
78
- "prettier": "^3.9.5",
77
+ "pinia": "^4.0.3",
78
+ "prettier": "^3.9.9",
79
79
  "prismjs": "^1.30.0",
80
80
  "typescript": "~5.9.3",
81
- "vite": "^8.1.4",
82
- "vite-plugin-dts": "^5.0.3",
81
+ "vite": "^8.3.1",
82
+ "vite-plugin-dts": "^5.1.1",
83
83
  "vite-plugin-node-polyfills": "^0.28.0",
84
- "vitest": "^4.1.10",
85
- "vue": "^3.5.39",
86
- "vue-tsc": "^3.3.7"
84
+ "vitest": "^4.1.11",
85
+ "vue": "^3.5.43",
86
+ "vue-tsc": "^3.3.11"
87
87
  },
88
88
  "dependencies": {
89
89
  "@duckdb/duckdb-wasm": "1.32.0",
90
- "@google/genai": "^2.11.0",
90
+ "@google/genai": "^2.24.0",
91
91
  "@mdi/js": "^7.4.47",
92
92
  "@motherduck/wasm-client": "^0.8.1",
93
- "apache-arrow": "^21.1.0",
94
- "dompurify": "^3.4.12",
95
- "jose": "^6.2.3",
93
+ "apache-arrow": "^21.2.0",
94
+ "dompurify": "^3.4.16",
95
+ "jose": "^6.2.12",
96
96
  "luxon": "^3.7.2",
97
97
  "modern-screenshot": "4.7.0",
98
98
  "monaco-editor": "^0.55.1",
99
99
  "split.js": "^1.6.5",
100
- "sql.js": "^1.14.1",
101
- "tabulator-tables": "^6.5.2",
102
- "vega": "^6.2.0",
103
- "vega-embed": "^7.1.0",
100
+ "sql.js": "^1.14.2",
101
+ "tabulator-tables": "^6.5.3",
102
+ "vega": "^6.4.0",
103
+ "vega-embed": "^7.3.0",
104
104
  "vega-lite": "^6.4.3",
105
105
  "vue3-grid-layout-next": "^1.0.7"
106
+ },
107
+ "pnpm": {
108
+ "overrides": {
109
+ "monaco-editor>dompurify": "^3.4.16",
110
+ "lodash": "^4.18.0",
111
+ "minimatch@>=10.0.0 <10.2.3": "^10.2.3",
112
+ "ajv@>=7.0.0 <8.18.0": "^8.18.0",
113
+ "rollup@>=4.0.0 <4.59.0": "^4.59.0"
114
+ }
106
115
  }
107
116
  }
@@ -1,405 +0,0 @@
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 };
@@ -1,129 +0,0 @@
1
- import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
- import "./editorRefinementToolExecutor-CVY3FA7k.js";
3
- import { E as t } from "./editorRefinementRuntime-DoP9P5J2.js";
4
- import "./editorStore-BhhmXbi-.js";
5
- import { Fragment as n, computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, inject as c, openBlock as l, ref as u, renderList as d, toDisplayString as f, vModelSelect as p, vModelText as m, withDirectives as h, withKeys as g, withModifiers as _ } from "vue";
6
- //#region components/dashboard/DashboardCreatorInline.vue?vue&type=script&lang.ts
7
- var v = {
8
- name: "DashboardCreatorInline",
9
- props: {
10
- visible: {
11
- type: Boolean,
12
- default: !1
13
- },
14
- testTag: {
15
- type: String,
16
- default: ""
17
- }
18
- },
19
- setup(e, { emit: n }) {
20
- let i = c("dashboardStore"), a = c("connectionStore"), o = c("llmConnectionStore"), s = c("editorStore"), l = c("saveDashboards"), d = c("setActiveDashboard");
21
- if (!i || !a || !o || !s || !l) throw Error("Dashboard or connection store is not provided!");
22
- let f = u(""), p = u(""), m = u(""), h = u(""), g = r(() => o.hasActiveDefaultConnection), _ = r(() => p.value ? g.value && m.value.trim() ? !0 : !!f.value.trim() : !1), v = r(() => g.value && m.value.trim() ? "Leave blank to let the assistant choose" : "My Dashboard"), y = r(() => Object.values(a.connections).filter((e) => e.model && !e.deleted).sort((e, t) => e.name.localeCompare(t.name))), b = r(() => {
23
- let e = p.value ? a.connections[p.value] : void 0;
24
- return e ? Object.values(s.editors).filter((n) => t(n.type) && n.connectionId === e.id).map((e) => ({
25
- id: e.id,
26
- name: e.name,
27
- alias: ""
28
- })) : [];
29
- });
30
- return r(() => (b.value.length > 0 && !h.value ? h.value = b.value[0].id : b.value.length === 0 && (h.value = ""), b.value)), y.value.length > 0 && !p.value && (p.value = y.value[0].id), {
31
- dashboardName: f,
32
- selectedConnection: p,
33
- dashboardPrompt: m,
34
- showPromptField: g,
35
- canSubmit: _,
36
- namePlaceholder: v,
37
- connections: y,
38
- availableImports: b,
39
- selectedImport: h,
40
- createDashboard: async () => {
41
- if (_.value) try {
42
- let e = f.value.trim();
43
- e ||= `Dashboard ${(/* @__PURE__ */ new Date()).toLocaleTimeString([], {
44
- hour: "2-digit",
45
- minute: "2-digit"
46
- })}`;
47
- let t = i.newDashboard(e, p.value);
48
- if (h.value) {
49
- let e = b.value.find((e) => e.id === h.value);
50
- e && i.updateDashboardImports(t.id, [e]);
51
- }
52
- let r = g.value ? m.value.trim() : "";
53
- r && i.setPendingChatPrompt(t.id, r), f.value = "", h.value = "", m.value = "", l(), n("close"), d ? d(t.id) : i.setActiveDashboard(t.id), console.log("New dashboard created:", t.id), n("dashboard-created", t.id);
54
- } catch (e) {
55
- console.error("Failed to create dashboard:", e), alert(`Error creating dashboard: ${e instanceof Error ? e.message : String(e)}`);
56
- }
57
- },
58
- cancel: () => {
59
- f.value = "", m.value = "", h.value = "", n("close");
60
- }
61
- };
62
- }
63
- }, y = {
64
- key: 0,
65
- class: "dashboard-creator creator-container"
66
- }, b = {
67
- key: 0,
68
- class: "form-group"
69
- }, x = ["data-testid"], S = {
70
- key: 1,
71
- class: "form-divider"
72
- }, C = { class: "form-group" }, w = { for: "dashboard-name" }, T = {
73
- key: 0,
74
- class: "optional-label"
75
- }, E = ["placeholder", "data-testid"], D = { class: "form-group" }, O = ["data-testid"], k = ["value"], A = {
76
- key: 2,
77
- class: "form-group"
78
- }, j = ["data-testid"], M = ["value"], N = { class: "form-actions button-row" }, P = ["disabled", "data-testid"], F = ["data-testid"];
79
- function I(e, t, r, c, u, v) {
80
- return r.visible ? (l(), a("div", y, [
81
- t[13] ||= o("h4", null, "Create New Dashboard", -1),
82
- c.showPromptField ? (l(), a("div", b, [t[8] ||= o("label", { for: "dashboard-prompt" }, "Describe your dashboard", -1), h(o("textarea", {
83
- id: "dashboard-prompt",
84
- "onUpdate:modelValue": t[0] ||= (e) => c.dashboardPrompt = e,
85
- placeholder: "Describe what you want to analyze. The assistant will build it (and pick a title if you skip the next field)...",
86
- rows: "3",
87
- onKeyup: t[1] ||= g(_((...e) => c.createDashboard && c.createDashboard(...e), ["ctrl"]), ["enter"]),
88
- "data-testid": r.testTag ? `dashboard-creator-prompt-${r.testTag}` : "dashboard-creator-prompt"
89
- }, null, 40, x), [[m, c.dashboardPrompt]])])) : i("", !0),
90
- c.showPromptField ? (l(), a("div", S, [...t[9] ||= [o("span", null, "or set manually", -1)]])) : i("", !0),
91
- o("div", C, [o("label", w, [t[10] ||= s(" Name ", -1), c.showPromptField && c.dashboardPrompt.trim() ? (l(), a("span", T, "(optional)")) : i("", !0)]), h(o("input", {
92
- id: "dashboard-name",
93
- "onUpdate:modelValue": t[2] ||= (e) => c.dashboardName = e,
94
- type: "text",
95
- placeholder: c.namePlaceholder,
96
- onKeyup: t[3] ||= g((...e) => c.createDashboard && c.createDashboard(...e), ["enter"]),
97
- "data-testid": r.testTag ? `dashboard-creator-name-${r.testTag}` : "dashboard-creator-name"
98
- }, null, 40, E), [[m, c.dashboardName]])]),
99
- o("div", D, [t[11] ||= o("label", { for: "dashboard-connection" }, "Connection", -1), h(o("select", {
100
- id: "dashboard-connection",
101
- "onUpdate:modelValue": t[4] ||= (e) => c.selectedConnection = e,
102
- "data-testid": r.testTag ? `dashboard-creator-connection-${r.testTag}` : "dashboard-creator-connection"
103
- }, [(l(!0), a(n, null, d(c.connections, (e) => (l(), a("option", {
104
- key: e.id,
105
- value: e.id
106
- }, f(e.name), 9, k))), 128))], 8, O), [[p, c.selectedConnection]])]),
107
- c.selectedConnection && c.availableImports.length > 0 ? (l(), a("div", A, [t[12] ||= o("label", { for: "dashboard-import" }, "Import", -1), h(o("select", {
108
- id: "dashboard-import",
109
- "onUpdate:modelValue": t[5] ||= (e) => c.selectedImport = e,
110
- "data-testid": r.testTag ? `dashboard-creator-import-${r.testTag}` : "dashboard-creator-import"
111
- }, [(l(!0), a(n, null, d(c.availableImports, (e) => (l(), a("option", {
112
- key: e.name,
113
- value: e.id
114
- }, f(e.name), 9, M))), 128))], 8, j), [[p, c.selectedImport]])])) : i("", !0),
115
- o("div", N, [o("button", {
116
- onClick: t[6] ||= (...e) => c.createDashboard && c.createDashboard(...e),
117
- disabled: !c.canSubmit,
118
- "data-testid": r.testTag ? `dashboard-creator-submit-${r.testTag}` : "dashboard-creator-submit",
119
- class: "create-btn"
120
- }, " Create ", 8, P), o("button", {
121
- onClick: t[7] ||= (...e) => c.cancel && c.cancel(...e),
122
- "data-testid": r.testTag ? `dashboard-creator-cancel-${r.testTag}` : "dashboard-creator-cancel",
123
- class: "cancel-btn"
124
- }, " Cancel ", 8, F)])
125
- ])) : i("", !0);
126
- }
127
- var L = /*#__PURE__*/ e(v, [["render", I], ["__scopeId", "data-v-410e08e1"]]);
128
- //#endregion
129
- export { L as t };