@trilogy-data/trilogy-studio-components 0.1.21 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AssetAutoImporter-IfDvXCFE.js → AssetAutoImporter-D3Y61TQd.js} +2 -2
- package/dist/{CommunityModels-DlK6gSx6.js → CommunityModels-HRPrOUL7.js} +2 -2
- package/dist/{ConnectionView-B_qlbq8s.js → ConnectionView-IEdVwiAs.js} +1 -1
- package/dist/{Dashboard-BN0T29JU.js → Dashboard-W2TQctK3.js} +3 -3
- package/dist/{DashboardCreatorInline-CPrHcaZC.js → DashboardCreatorInline-K1khKEvT.js} +1 -1
- package/dist/{DashboardMobile-BFcFiWhG.js → DashboardMobile-C37I5fFz.js} +3 -3
- package/dist/{DrilldownPane-oN6u9FSj.js → DrilldownPane-KlCvIjlb.js} +2269 -2252
- package/dist/{Editor-BRnH6Fhm.js → Editor-DBE-qYvP.js} +1 -1
- package/dist/{IDE-BYphurDi.js → IDE-C9soEffx.js} +5 -5
- package/dist/{JobsView-Bzv-qCJD.js → JobsView-BRGWShZ7.js} +1 -1
- package/dist/{LLMChat-DUReWNVL.js → LLMChat-ij37ucbm.js} +2 -2
- package/dist/{LLMConnectionList-CS8b_fyI.js → LLMConnectionList-CxT0rMUV.js} +1 -1
- package/dist/{LLMView-D031rgKZ.js → LLMView-Bd5_1JHj.js} +2 -2
- package/dist/{MobileIDE-YK0ZzWHh.js → MobileIDE-CBzdAvfE.js} +10 -10
- package/dist/{ModelCard-DqfChNPX.js → ModelCard-CWXrviT3.js} +2 -2
- package/dist/{ModelCreator-DM1J950f.js → ModelCreator-DHM3AiOl.js} +1 -1
- package/dist/{ModelView--DBf6oe2.js → ModelView-MGkeSYFD.js} +2 -2
- package/dist/{ResultComponent-DPeHR38g.js → ResultComponent-B_OUdQGo.js} +1 -1
- package/dist/{Sidebar-Dq-6dIQq.js → Sidebar-CVbPgM3I.js} +4 -4
- package/dist/{TutorialPage-A-44DRyk.js → TutorialPage-BxTnHWJN.js} +8 -8
- package/dist/{UserProfile-DmDQyEIc.js → UserProfile-85umd0xp.js} +1 -1
- package/dist/dashboard.js +5 -5
- package/dist/dashboards/barChartSpec.d.ts.map +1 -1
- package/dist/dashboards/barHChartSpec.d.ts.map +1 -1
- package/dist/dashboards/crossFilters.d.ts +2 -0
- package/dist/dashboards/crossFilters.d.ts.map +1 -1
- package/dist/{queryExecutionService-D1ynkTop.js → queryExecutionService-Dvn1FJG0.js} +137 -119
- package/dist/stores/queryExecutionService.d.ts.map +1 -1
- package/dist/stores/resolver.d.ts +1 -1
- package/dist/stores/resolver.d.ts.map +1 -1
- package/dist/stores.js +1 -1
- package/dist/{useDashboard-DlVElw8y.js → useDashboard-CqW1pA34.js} +2 -2
- package/dist/views.js +2 -2
- package/package.json +2 -1
|
@@ -2,10 +2,10 @@ var tt = Object.defineProperty;
|
|
|
2
2
|
var rt = (r, e, t) => e in r ? tt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
3
|
var w = (r, e, t) => rt(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import { k as st, u as ot } from "./editorStore-CHHdik0L.js";
|
|
5
|
-
import { a as nt, c as it, b as at, q as _e, s as
|
|
6
|
-
import { ref as
|
|
5
|
+
import { a as nt, c as it, b as at, q as _e, s as Oe, t as ct, M as lt, r as ut, C as Qe, u as ht } from "./toolLoopCore-CK_KVuAS.js";
|
|
6
|
+
import { ref as O, toValue as Ve, computed as dt } from "vue";
|
|
7
7
|
import { K as se, l as ft } from "./constants-BXXolEur.js";
|
|
8
|
-
import { E as
|
|
8
|
+
import { E as De, m as qe, R as B, C as mt } from "./snowflake-BUHnLz1S.js";
|
|
9
9
|
import { defineStore as Y } from "pinia";
|
|
10
10
|
import { c as gt, e as yt, A as ke, O as Me, G as Le, a as Pe, D as pt, g as bt, b as wt, C as vt } from "./chatAgentPrompt-DrX26_jN.js";
|
|
11
11
|
const St = [
|
|
@@ -149,7 +149,7 @@ const St = [
|
|
|
149
149
|
category: "community",
|
|
150
150
|
highlightDataTestId: "copy-dashboard-share-button"
|
|
151
151
|
}
|
|
152
|
-
], je = /* @__PURE__ */ new Set(),
|
|
152
|
+
], je = /* @__PURE__ */ new Set(), pe = /* @__PURE__ */ new Map(), xt = {
|
|
153
153
|
query: "select 1 as resolver_warmup;",
|
|
154
154
|
dialect: "duckdb",
|
|
155
155
|
full_model: { name: "", sources: [] },
|
|
@@ -242,25 +242,26 @@ class Sr {
|
|
|
242
242
|
throw console.log(s), Error(this.getErrorMessage(s));
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
async validate_query(e, t = null, s = null, o = null, i = null, n = null) {
|
|
246
|
-
const
|
|
245
|
+
async validate_query(e, t = null, s = null, o = null, i = null, n = null, a = null) {
|
|
246
|
+
const c = {
|
|
247
247
|
query: e,
|
|
248
248
|
sources: t || [],
|
|
249
249
|
imports: s || [],
|
|
250
250
|
extra_filters: o || [],
|
|
251
251
|
extra_content: i || {},
|
|
252
|
-
current_filename: n || null
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
252
|
+
current_filename: n || null,
|
|
253
|
+
parameters: a || {}
|
|
254
|
+
}, u = this.createHash(c), l = this.validateCache.get(u);
|
|
255
|
+
if (l)
|
|
256
|
+
return l;
|
|
257
|
+
const h = await this.fetchWithErrorHandling(this.buildResolverUrl("validate_query"), {
|
|
257
258
|
method: "POST",
|
|
258
259
|
headers: {
|
|
259
260
|
"Content-Type": "application/json"
|
|
260
261
|
},
|
|
261
|
-
body: JSON.stringify(
|
|
262
|
+
body: JSON.stringify(c)
|
|
262
263
|
});
|
|
263
|
-
return this.validateCache.set(
|
|
264
|
+
return this.validateCache.set(u, h), h;
|
|
264
265
|
}
|
|
265
266
|
async drilldown_query(e, t, s, o, i, n, a = null, c = null, u = null, l = null, h = null) {
|
|
266
267
|
console.log("TrilogyResolver.drilldown_query called"), console.log(n);
|
|
@@ -434,7 +435,7 @@ class Sr {
|
|
|
434
435
|
const e = this.settingStore.settings.trilogyResolver.replace(/\/+$/, "");
|
|
435
436
|
if (!e || je.has(e))
|
|
436
437
|
return;
|
|
437
|
-
const t =
|
|
438
|
+
const t = pe.get(e);
|
|
438
439
|
if (t)
|
|
439
440
|
return t;
|
|
440
441
|
const s = this.fetchWithErrorHandling(`${e}/generate_query`, {
|
|
@@ -448,9 +449,9 @@ class Sr {
|
|
|
448
449
|
}).catch((o) => {
|
|
449
450
|
console.warn("Resolver warm-up request failed:", o);
|
|
450
451
|
}).finally(() => {
|
|
451
|
-
|
|
452
|
+
pe.delete(e);
|
|
452
453
|
});
|
|
453
|
-
return
|
|
454
|
+
return pe.set(e, s), s;
|
|
454
455
|
}
|
|
455
456
|
// Cache management methods
|
|
456
457
|
clearAllCaches() {
|
|
@@ -520,10 +521,10 @@ function Cr(r) {
|
|
|
520
521
|
Object.entries(o).forEach(([i, n]) => {
|
|
521
522
|
t[i] || (t[i] = []), t[i].push(n);
|
|
522
523
|
});
|
|
523
|
-
}), Object.entries(t).map(([o, i]) => i.length > 1 ? `(${i.map((a) =>
|
|
524
|
+
}), Object.entries(t).map(([o, i]) => i.length > 1 ? `(${i.map((a) => be(o, a)).join(" OR ")})` : be(o, i[0])).join(" AND ");
|
|
524
525
|
}
|
|
525
526
|
return Object.keys(r).length === 0 ? "" : Object.entries(r).map(
|
|
526
|
-
([t, s]) =>
|
|
527
|
+
([t, s]) => be(t, s)
|
|
527
528
|
).join(" AND ");
|
|
528
529
|
}
|
|
529
530
|
function Ne(r) {
|
|
@@ -534,17 +535,17 @@ function Ne(r) {
|
|
|
534
535
|
if (r === null)
|
|
535
536
|
return "NULL";
|
|
536
537
|
if (typeof r == "string")
|
|
537
|
-
return `'${r.replace(/'/g,
|
|
538
|
+
return `'${r.replace(/'/g, De)}'`;
|
|
538
539
|
if (typeof r == "boolean")
|
|
539
540
|
return r ? "TRUE" : "FALSE";
|
|
540
541
|
if (typeof r == "number")
|
|
541
542
|
return r.toString();
|
|
542
543
|
}
|
|
543
|
-
function
|
|
544
|
+
function be(r, e) {
|
|
544
545
|
if (e === null)
|
|
545
546
|
return `${r} IS NULL`;
|
|
546
547
|
if (typeof e == "string") {
|
|
547
|
-
const t = e.replace(/'/g,
|
|
548
|
+
const t = e.replace(/'/g, De);
|
|
548
549
|
return `${r}='''${t}'''`;
|
|
549
550
|
} else {
|
|
550
551
|
if (Array.isArray(e))
|
|
@@ -554,7 +555,7 @@ function pe(r, e) {
|
|
|
554
555
|
if (e === void 0)
|
|
555
556
|
return `${r} IS NULL`;
|
|
556
557
|
{
|
|
557
|
-
const t = JSON.stringify(e).replace(/'/g,
|
|
558
|
+
const t = JSON.stringify(e).replace(/'/g, De);
|
|
558
559
|
return `${r}='${t}'`;
|
|
559
560
|
}
|
|
560
561
|
}
|
|
@@ -565,7 +566,7 @@ function At(r = []) {
|
|
|
565
566
|
t != null && t.label && e.add(t.label);
|
|
566
567
|
return Array.from(e);
|
|
567
568
|
}
|
|
568
|
-
function
|
|
569
|
+
function he(r) {
|
|
569
570
|
return { ...r };
|
|
570
571
|
}
|
|
571
572
|
function G(r) {
|
|
@@ -588,7 +589,7 @@ function Ft(r, e) {
|
|
|
588
589
|
}
|
|
589
590
|
}
|
|
590
591
|
}
|
|
591
|
-
function
|
|
592
|
+
function de(r, e) {
|
|
592
593
|
const t = Object.keys(r).sort(), s = Object.keys(e).sort();
|
|
593
594
|
return t.length !== s.length ? !1 : t.every(
|
|
594
595
|
(o, i) => o === s[i] && Ft(r[o], e[o])
|
|
@@ -603,14 +604,14 @@ function Re(r, e) {
|
|
|
603
604
|
(o, i) => o === s[i] && _t(r[o], e[o])
|
|
604
605
|
);
|
|
605
606
|
}
|
|
606
|
-
function
|
|
607
|
+
function Ot(r, e, t, s) {
|
|
607
608
|
const o = r.filter((c) => c.source !== e), i = r.filter((c) => c.source === e);
|
|
608
609
|
if (s === "remove") return o;
|
|
609
610
|
if (s === "add") return [...o, { source: e, value: G(t) }];
|
|
610
611
|
const a = i.some((c) => Re(c.value, t)) ? i.filter((c) => !Re(c.value, t)) : [...i, { source: e, value: G(t) }];
|
|
611
612
|
return [...o, ...a];
|
|
612
613
|
}
|
|
613
|
-
function
|
|
614
|
+
function Qt(r, e, t) {
|
|
614
615
|
if (e.size === 0)
|
|
615
616
|
return t && r.startsWith("local.") ? r.replace(/^local\./, "") : r;
|
|
616
617
|
if (e.has(r))
|
|
@@ -627,11 +628,11 @@ function qt(r, e = [], t = {}) {
|
|
|
627
628
|
return Object.entries(r).reduce((i, [n, a]) => {
|
|
628
629
|
if (typeof a != "object" || a === null || !["eq", "range", "in", "is_null"].includes(a.op))
|
|
629
630
|
return i;
|
|
630
|
-
const c =
|
|
631
|
+
const c = Qt(n, s, o);
|
|
631
632
|
return c && (i[c] = a), i;
|
|
632
633
|
}, {});
|
|
633
634
|
}
|
|
634
|
-
function
|
|
635
|
+
function le(r) {
|
|
635
636
|
if (!r.length)
|
|
636
637
|
return { filterStrings: [], parameters: {} };
|
|
637
638
|
const e = {};
|
|
@@ -654,8 +655,8 @@ function De(r) {
|
|
|
654
655
|
}
|
|
655
656
|
return { filterStrings: t, parameters: s };
|
|
656
657
|
}
|
|
657
|
-
function
|
|
658
|
-
const e = r.conceptFilters || [], t = (r.filters || []).filter((a) => a.source !== "cross"), { filterStrings: s, parameters: o } =
|
|
658
|
+
function me(r) {
|
|
659
|
+
const e = r.conceptFilters || [], t = (r.filters || []).filter((a) => a.source !== "cross"), { filterStrings: s, parameters: o } = le(e), i = s.join(" AND ");
|
|
659
660
|
i && t.push({
|
|
660
661
|
source: "cross",
|
|
661
662
|
value: i,
|
|
@@ -669,15 +670,15 @@ function kt(r, e, t, s) {
|
|
|
669
670
|
if (s === "remove")
|
|
670
671
|
return o;
|
|
671
672
|
if (s === "add")
|
|
672
|
-
return [...o, { source: e, value:
|
|
673
|
-
const a = i.some((c) =>
|
|
673
|
+
return [...o, { source: e, value: he(t) }];
|
|
674
|
+
const a = i.some((c) => de(c.value, t)) ? i.filter((c) => !de(c.value, t)) : [...i, { source: e, value: he(t) }];
|
|
674
675
|
return [...o, ...a];
|
|
675
676
|
}
|
|
676
677
|
function Mt(r, e, t, s, o) {
|
|
677
678
|
const i = [];
|
|
678
679
|
return Object.entries(r).forEach(([n, a]) => {
|
|
679
680
|
if (n === e) {
|
|
680
|
-
const h =
|
|
681
|
+
const h = Ot(
|
|
681
682
|
a.chartFilters || [],
|
|
682
683
|
e,
|
|
683
684
|
s,
|
|
@@ -695,7 +696,7 @@ function Mt(r, e, t, s, o) {
|
|
|
695
696
|
o
|
|
696
697
|
), u = JSON.stringify(c) !== JSON.stringify(a.conceptFilters || []);
|
|
697
698
|
u && (a.conceptFilters = c);
|
|
698
|
-
const l =
|
|
699
|
+
const l = me(a);
|
|
699
700
|
(u || l) && i.push(n);
|
|
700
701
|
}), i;
|
|
701
702
|
}
|
|
@@ -707,7 +708,7 @@ function Lt(r, e, t) {
|
|
|
707
708
|
(a) => a.source !== t
|
|
708
709
|
), i = JSON.stringify(o) !== JSON.stringify(s.conceptFilters || []);
|
|
709
710
|
i && (s.conceptFilters = o);
|
|
710
|
-
const n =
|
|
711
|
+
const n = me(s);
|
|
711
712
|
return i || n;
|
|
712
713
|
}
|
|
713
714
|
function Pt(r, e) {
|
|
@@ -721,7 +722,7 @@ function Pt(r, e) {
|
|
|
721
722
|
(c) => c.source !== e
|
|
722
723
|
), n = JSON.stringify(i) !== JSON.stringify(o.conceptFilters || []);
|
|
723
724
|
n && (o.conceptFilters = i);
|
|
724
|
-
const a =
|
|
725
|
+
const a = me(o);
|
|
725
726
|
(n || a) && t.push(s);
|
|
726
727
|
}), t;
|
|
727
728
|
}
|
|
@@ -752,7 +753,7 @@ function It(r = {}) {
|
|
|
752
753
|
getSelections() {
|
|
753
754
|
return Array.from(e.values()).flat().map((o) => ({
|
|
754
755
|
source: o.source,
|
|
755
|
-
filters:
|
|
756
|
+
filters: he(o.filters),
|
|
756
757
|
chart: G(o.chart || {}),
|
|
757
758
|
append: o.append
|
|
758
759
|
}));
|
|
@@ -770,8 +771,8 @@ function It(r = {}) {
|
|
|
770
771
|
if (a === "add")
|
|
771
772
|
return e.set(o.source, [n]), n.filters;
|
|
772
773
|
const l = c.some(
|
|
773
|
-
(h) =>
|
|
774
|
-
) ? c.filter((h) => !
|
|
774
|
+
(h) => de(h.filters, n.filters)
|
|
775
|
+
) ? c.filter((h) => !de(h.filters, n.filters)) : [...c, n];
|
|
775
776
|
return l.length === 0 ? e.delete(o.source) : e.set(o.source, l), n.filters;
|
|
776
777
|
},
|
|
777
778
|
clearSource(o) {
|
|
@@ -787,7 +788,7 @@ function It(r = {}) {
|
|
|
787
788
|
return Array.from(e.entries()).filter(([i]) => i !== o).flatMap(
|
|
788
789
|
([i, n]) => n.map((a) => ({
|
|
789
790
|
source: i,
|
|
790
|
-
value:
|
|
791
|
+
value: he(a.filters)
|
|
791
792
|
}))
|
|
792
793
|
);
|
|
793
794
|
},
|
|
@@ -795,21 +796,34 @@ function It(r = {}) {
|
|
|
795
796
|
return (e.get(o) || []).map((i) => G(i.chart || {}));
|
|
796
797
|
},
|
|
797
798
|
getFilterExpressionFor(o) {
|
|
798
|
-
const { filterStrings: i } =
|
|
799
|
+
const { filterStrings: i } = le(this.getSqlFilterInputsFor(o));
|
|
799
800
|
return i.join(" AND ");
|
|
800
801
|
},
|
|
801
802
|
getSqlFiltersFor(o, i = []) {
|
|
802
803
|
const n = this.getFilterExpressionFor(o);
|
|
803
804
|
return n ? [...i, n] : [...i];
|
|
804
805
|
},
|
|
806
|
+
getSqlFilterLikesFor(o, i = []) {
|
|
807
|
+
const n = i.map((l) => ({
|
|
808
|
+
source: "base",
|
|
809
|
+
value: l
|
|
810
|
+
})), { filterStrings: a, parameters: c } = le(
|
|
811
|
+
this.getSqlFilterInputsFor(o)
|
|
812
|
+
), u = a.join(" AND ");
|
|
813
|
+
return u && n.push({
|
|
814
|
+
source: "cross",
|
|
815
|
+
value: u,
|
|
816
|
+
parameters: Object.keys(c).length ? c : void 0
|
|
817
|
+
}), n;
|
|
818
|
+
},
|
|
805
819
|
getSqlParametersFor(o) {
|
|
806
|
-
const { parameters: i } =
|
|
820
|
+
const { parameters: i } = le(this.getSqlFilterInputsFor(o));
|
|
807
821
|
return i;
|
|
808
822
|
}
|
|
809
823
|
};
|
|
810
824
|
}
|
|
811
825
|
function Er(r = {}) {
|
|
812
|
-
const e =
|
|
826
|
+
const e = O(0), t = It(Ve(r)), s = () => {
|
|
813
827
|
e.value += 1;
|
|
814
828
|
};
|
|
815
829
|
return {
|
|
@@ -845,6 +859,9 @@ function Er(r = {}) {
|
|
|
845
859
|
getSqlFiltersFor(o, i = []) {
|
|
846
860
|
return e.value, t.getSqlFiltersFor(o, i);
|
|
847
861
|
},
|
|
862
|
+
getSqlFilterLikesFor(o, i = []) {
|
|
863
|
+
return e.value, t.getSqlFilterLikesFor(o, i);
|
|
864
|
+
},
|
|
848
865
|
getSqlParametersFor(o) {
|
|
849
866
|
return e.value, t.getSqlParametersFor(o);
|
|
850
867
|
}
|
|
@@ -1026,7 +1043,7 @@ Enter your markdown content here.`;
|
|
|
1026
1043
|
}
|
|
1027
1044
|
updateItemFilters(e) {
|
|
1028
1045
|
const t = this.gridItems[e];
|
|
1029
|
-
t &&
|
|
1046
|
+
t && me(t) && (this.updatedAt = /* @__PURE__ */ new Date(), this.changed = !0);
|
|
1030
1047
|
}
|
|
1031
1048
|
removeItemCrossFilter(e, t) {
|
|
1032
1049
|
Lt(this.gridItems, e, t) && (this.updatedAt = /* @__PURE__ */ new Date(), this.changed = !0);
|
|
@@ -1175,7 +1192,7 @@ Enter your markdown content here.`;
|
|
|
1175
1192
|
});
|
|
1176
1193
|
}
|
|
1177
1194
|
}
|
|
1178
|
-
const
|
|
1195
|
+
const we = (r) => {
|
|
1179
1196
|
const t = r.replace(/'''/g, "```").replace(/"""/g, "```").replace(/```(trilogy|sql|json)(\s|\n)/g, "```");
|
|
1180
1197
|
for (const s of ["```\\s*```", "```"]) {
|
|
1181
1198
|
const o = t.match(new RegExp(`${s}([\\s\\S]*)${s}`, "s"));
|
|
@@ -1274,7 +1291,7 @@ const be = (r) => {
|
|
|
1274
1291
|
role: "assistant",
|
|
1275
1292
|
content: h.text,
|
|
1276
1293
|
toolCalls: h.toolCalls
|
|
1277
|
-
}), console.log("Initial LLM response:", h.text), l =
|
|
1294
|
+
}), console.log("Initial LLM response:", h.text), l = we(h.text), e)
|
|
1278
1295
|
for (; c < t && !u; )
|
|
1279
1296
|
try {
|
|
1280
1297
|
if (!l || l.trim() == "")
|
|
@@ -1302,7 +1319,7 @@ You had given a response: """${l}""" that failed validation on this error: ${f}.
|
|
|
1302
1319
|
role: "assistant",
|
|
1303
1320
|
content: h.text,
|
|
1304
1321
|
toolCalls: h.toolCalls
|
|
1305
|
-
}), l =
|
|
1322
|
+
}), l = we(h.text), console.log(`Attempt ${c}. New extract:`, l);
|
|
1306
1323
|
}
|
|
1307
1324
|
return console.log("Exiting validation loop with attempts:", c), console.log("Final LLM response:", l), {
|
|
1308
1325
|
success: u,
|
|
@@ -1328,7 +1345,7 @@ You had given a response: """${l}""" that failed validation on this error: ${f}.
|
|
|
1328
1345
|
success: !0,
|
|
1329
1346
|
prompt: r,
|
|
1330
1347
|
message: e.text,
|
|
1331
|
-
content:
|
|
1348
|
+
content: we(e.text),
|
|
1332
1349
|
attempts: 1
|
|
1333
1350
|
}));
|
|
1334
1351
|
},
|
|
@@ -2238,7 +2255,7 @@ const Rt = (r) => r.replace(/\s+/g, ""), Jt = Y("dashboards", {
|
|
|
2238
2255
|
} catch {
|
|
2239
2256
|
}
|
|
2240
2257
|
return !1;
|
|
2241
|
-
},
|
|
2258
|
+
}, fe = async (r, e, t = 5, s = 1e3) => {
|
|
2242
2259
|
if (Ke(r))
|
|
2243
2260
|
throw new Error(
|
|
2244
2261
|
`Cannot connect to ${r} - blocked by Content Security Policy. This URL is not allowed by the browser's security settings.`
|
|
@@ -2305,7 +2322,7 @@ const Rt = (r) => r.replace(/\s+/g, ""), Jt = Y("dashboards", {
|
|
|
2305
2322
|
}
|
|
2306
2323
|
};
|
|
2307
2324
|
}, zt = async (r) => {
|
|
2308
|
-
const e = `${r.baseUrl}/index.json`, t = await
|
|
2325
|
+
const e = `${r.baseUrl}/index.json`, t = await fe(e, Ye(r.token));
|
|
2309
2326
|
if (!t.ok)
|
|
2310
2327
|
throw new Error(`Failed to fetch store index: ${t.status} ${t.statusText}`);
|
|
2311
2328
|
return t.json();
|
|
@@ -2314,7 +2331,7 @@ const Rt = (r) => r.replace(/\s+/g, ""), Jt = Y("dashboards", {
|
|
|
2314
2331
|
try {
|
|
2315
2332
|
const o = (await zt(r)).models.map(async (n) => {
|
|
2316
2333
|
try {
|
|
2317
|
-
const a = await
|
|
2334
|
+
const a = await fe(n.url, Ye(r.token));
|
|
2318
2335
|
if (!a.ok)
|
|
2319
2336
|
return console.warn(`Failed to fetch model ${n.name}: ${a.statusText}`), null;
|
|
2320
2337
|
const c = await a.json();
|
|
@@ -2333,7 +2350,7 @@ const Rt = (r) => r.replace(/\s+/g, ""), Jt = Y("dashboards", {
|
|
|
2333
2350
|
try {
|
|
2334
2351
|
let s, o;
|
|
2335
2352
|
r.owner === "trilogy-data" && r.repo === "trilogy-public-models" ? (s = "https://trilogy-data.github.io/trilogy-public-models/studio/index.json", o = "https://trilogy-data.github.io/trilogy-public-models/studio/") : (s = `https://api.github.com/repos/${r.owner}/${r.repo}/contents/studio/index.json?ref=${r.branch}`, o = `https://raw.githubusercontent.com/${r.owner}/${r.repo}/${r.branch}/studio/`);
|
|
2336
|
-
const i = await
|
|
2353
|
+
const i = await fe(s);
|
|
2337
2354
|
if (i.status !== 200)
|
|
2338
2355
|
throw new Error(`Error fetching community data: ${await i.text()}`);
|
|
2339
2356
|
let n;
|
|
@@ -2344,7 +2361,7 @@ const Rt = (r) => r.replace(/\s+/g, ""), Jt = Y("dashboards", {
|
|
|
2344
2361
|
n = JSON.parse(atob(c.content));
|
|
2345
2362
|
}
|
|
2346
2363
|
const a = n.files.filter((c) => c.filename.endsWith(".json")).map(async (c) => {
|
|
2347
|
-
const u = `${o}${c.filename}`, l = await
|
|
2364
|
+
const u = `${o}${c.filename}`, l = await fe(u);
|
|
2348
2365
|
if (!l.ok)
|
|
2349
2366
|
throw new Error(`Error fetching file ${c.filename}: ${l.statusText}`);
|
|
2350
2367
|
const h = await l.json();
|
|
@@ -2383,7 +2400,7 @@ const Rt = (r) => r.replace(/\s+/g, ""), Jt = Y("dashboards", {
|
|
|
2383
2400
|
(n) => n.type === "generic" && K(n.baseUrl) === o
|
|
2384
2401
|
);
|
|
2385
2402
|
i && !i.token && (i.token = s);
|
|
2386
|
-
},
|
|
2403
|
+
}, ue = Y("communityApi", {
|
|
2387
2404
|
state: () => ({
|
|
2388
2405
|
// Initialize with default store
|
|
2389
2406
|
stores: [ne],
|
|
@@ -2728,7 +2745,7 @@ const I = (r, e = {}) => {
|
|
|
2728
2745
|
})
|
|
2729
2746
|
);
|
|
2730
2747
|
await N(s, `Failed to update ${e}`);
|
|
2731
|
-
},
|
|
2748
|
+
}, Or = async (r, e) => {
|
|
2732
2749
|
const t = await fetch(
|
|
2733
2750
|
`${r.baseUrl}/files/${Ae(e)}`,
|
|
2734
2751
|
I(r.token, {
|
|
@@ -2771,7 +2788,7 @@ const I = (r, e = {}) => {
|
|
|
2771
2788
|
pollingState: t,
|
|
2772
2789
|
pollingError: t === "stopped" && !r.pollingError && e === "unable-to-fetch" ? "Polling stopped locally." : r.pollingError ?? null
|
|
2773
2790
|
};
|
|
2774
|
-
}, ie = (r) => [...r].sort((e, t) => t.submittedAt - e.submittedAt),
|
|
2791
|
+
}, ie = (r) => [...r].sort((e, t) => t.submittedAt - e.submittedAt), Qr = Y("jobsApi", {
|
|
2775
2792
|
state: () => ({
|
|
2776
2793
|
filesByStore: {},
|
|
2777
2794
|
jobsByStore: {},
|
|
@@ -2784,11 +2801,11 @@ const I = (r, e = {}) => {
|
|
|
2784
2801
|
}),
|
|
2785
2802
|
actions: {
|
|
2786
2803
|
getGenericStore(r) {
|
|
2787
|
-
const t =
|
|
2804
|
+
const t = ue().stores.find((s) => s.id === r);
|
|
2788
2805
|
return !t || t.type !== "generic" ? null : t;
|
|
2789
2806
|
},
|
|
2790
2807
|
getGenericStores() {
|
|
2791
|
-
return
|
|
2808
|
+
return ue().stores.filter(
|
|
2792
2809
|
(e) => e.type === "generic"
|
|
2793
2810
|
);
|
|
2794
2811
|
},
|
|
@@ -2822,7 +2839,7 @@ const I = (r, e = {}) => {
|
|
|
2822
2839
|
}), delete this.filesByStore[r], delete this.jobsByStore[r], delete this.errors[r], delete this.storeStatus[r], delete this.loadingByStore[r], this.saveJobsToStorage();
|
|
2823
2840
|
},
|
|
2824
2841
|
async initialize() {
|
|
2825
|
-
|
|
2842
|
+
ue().loadStoresFromStorage(), this.loadJobsFromStorage(), this.resumePolling(), await this.refreshAllStores();
|
|
2826
2843
|
},
|
|
2827
2844
|
saveJobsToStorage() {
|
|
2828
2845
|
try {
|
|
@@ -3185,7 +3202,7 @@ class tr {
|
|
|
3185
3202
|
query: e,
|
|
3186
3203
|
generatedSql: y.generatedSql
|
|
3187
3204
|
};
|
|
3188
|
-
const E =
|
|
3205
|
+
const E = Oe();
|
|
3189
3206
|
return {
|
|
3190
3207
|
success: !0,
|
|
3191
3208
|
artifact: {
|
|
@@ -3457,7 +3474,7 @@ Use select_active_import to select a data source.`
|
|
|
3457
3474
|
success: !1,
|
|
3458
3475
|
error: "Markdown content is required and must be a non-empty string"
|
|
3459
3476
|
};
|
|
3460
|
-
const i =
|
|
3477
|
+
const i = Oe();
|
|
3461
3478
|
let n = null;
|
|
3462
3479
|
if (s && s.trim()) {
|
|
3463
3480
|
if (!o) {
|
|
@@ -3699,7 +3716,7 @@ const rr = Y("chats", {
|
|
|
3699
3716
|
},
|
|
3700
3717
|
actions: {
|
|
3701
3718
|
newChat(r, e = "", t) {
|
|
3702
|
-
const s = new
|
|
3719
|
+
const s = new Qe({
|
|
3703
3720
|
llmConnectionName: r,
|
|
3704
3721
|
dataConnectionName: e,
|
|
3705
3722
|
name: t || `Chat ${(/* @__PURE__ */ new Date()).toLocaleTimeString()}`
|
|
@@ -3748,7 +3765,7 @@ const rr = Y("chats", {
|
|
|
3748
3765
|
},
|
|
3749
3766
|
loadChats(r) {
|
|
3750
3767
|
Object.entries(r).forEach(([e, t]) => {
|
|
3751
|
-
this.chats[e] =
|
|
3768
|
+
this.chats[e] = Qe.fromSerialized(t);
|
|
3752
3769
|
});
|
|
3753
3770
|
},
|
|
3754
3771
|
serializeChats() {
|
|
@@ -3949,31 +3966,31 @@ function sr(r) {
|
|
|
3949
3966
|
}), window.location.hash = `#${t.toString()}`;
|
|
3950
3967
|
}
|
|
3951
3968
|
const or = () => {
|
|
3952
|
-
const r = Jt(), e = ot(), t = ht(), s =
|
|
3969
|
+
const r = Jt(), e = ot(), t = ht(), s = ue(), o = rr();
|
|
3953
3970
|
let i = null;
|
|
3954
3971
|
const n = {
|
|
3955
|
-
activeScreen:
|
|
3956
|
-
activeSidebarScreen:
|
|
3972
|
+
activeScreen: O(A("screen", "")),
|
|
3973
|
+
activeSidebarScreen: O(
|
|
3957
3974
|
A("sidebarScreen", "editors")
|
|
3958
3975
|
),
|
|
3959
|
-
activeEditor:
|
|
3960
|
-
activeDashboard:
|
|
3961
|
-
activeConnectionKey:
|
|
3962
|
-
activeModelKey:
|
|
3963
|
-
activeCommunityModelKey:
|
|
3964
|
-
activeJobsKey:
|
|
3965
|
-
activeLLMConnectionKey:
|
|
3966
|
-
activeDocumentationKey:
|
|
3976
|
+
activeEditor: O(A("editors", "")),
|
|
3977
|
+
activeDashboard: O(A("dashboard", "")),
|
|
3978
|
+
activeConnectionKey: O(A("connections", "")),
|
|
3979
|
+
activeModelKey: O(A("model", "")),
|
|
3980
|
+
activeCommunityModelKey: O(A("community-models", "")),
|
|
3981
|
+
activeJobsKey: O(A("jobs", "")),
|
|
3982
|
+
activeLLMConnectionKey: O(A("llms", "")),
|
|
3983
|
+
activeDocumentationKey: O(A("tutorial", "")),
|
|
3967
3984
|
// model import is legacy
|
|
3968
|
-
modelImport:
|
|
3969
|
-
connectionImport:
|
|
3970
|
-
mobileMenuOpen:
|
|
3971
|
-
initialSearch:
|
|
3972
|
-
tabs:
|
|
3973
|
-
activeTab:
|
|
3974
|
-
showTipModal:
|
|
3975
|
-
displayedTips:
|
|
3976
|
-
fullScreen:
|
|
3985
|
+
modelImport: O(A("import", A("model", ""))),
|
|
3986
|
+
connectionImport: O(A("connection", "")),
|
|
3987
|
+
mobileMenuOpen: O(!1),
|
|
3988
|
+
initialSearch: O(A("initialSearch", "")),
|
|
3989
|
+
tabs: O([]),
|
|
3990
|
+
activeTab: O(null),
|
|
3991
|
+
showTipModal: O(!0),
|
|
3992
|
+
displayedTips: O([]),
|
|
3993
|
+
fullScreen: O(!1)
|
|
3977
3994
|
}, a = /* @__PURE__ */ new Set([
|
|
3978
3995
|
"editors",
|
|
3979
3996
|
"tutorial",
|
|
@@ -4007,19 +4024,19 @@ const or = () => {
|
|
|
4007
4024
|
if (p)
|
|
4008
4025
|
return p.name || "Untitled Editor";
|
|
4009
4026
|
} else if (g === "llms") {
|
|
4010
|
-
const p = b.split(se), D = p[0],
|
|
4011
|
-
if (
|
|
4012
|
-
const $ = o.getChatById(
|
|
4027
|
+
const p = b.split(se), D = p[0], Q = p.length > 1 ? p[1] : null;
|
|
4028
|
+
if (Q) {
|
|
4029
|
+
const $ = o.getChatById(Q);
|
|
4013
4030
|
if ($)
|
|
4014
4031
|
return $.name;
|
|
4015
4032
|
}
|
|
4016
4033
|
return D || "LLM Chat";
|
|
4017
4034
|
} else if (g === "community-models") {
|
|
4018
|
-
const p = b.split(se), D = p[0],
|
|
4019
|
-
if (
|
|
4020
|
-
return p.length === 2 ? `${
|
|
4035
|
+
const p = b.split(se), D = p[0], Q = s.stores.find(($) => $.id === D);
|
|
4036
|
+
if (Q)
|
|
4037
|
+
return p.length === 2 ? `${Q.name} - ${p[1]}` : p.length === 3 ? p[2] : Q.name;
|
|
4021
4038
|
} else if (g === "jobs") {
|
|
4022
|
-
const p = b.split(se), D = p[0],
|
|
4039
|
+
const p = b.split(se), D = p[0], Q = s.stores.find((k) => k.id === D), $ = (Q == null ? void 0 : Q.name) || D;
|
|
4023
4040
|
if (p.length === 1)
|
|
4024
4041
|
return $;
|
|
4025
4042
|
const q = decodeURIComponent(p[2] || "");
|
|
@@ -4107,8 +4124,8 @@ const or = () => {
|
|
|
4107
4124
|
n.activeLLMConnectionKey.value = b.address;
|
|
4108
4125
|
const D = b.address.split(se);
|
|
4109
4126
|
if (D.length > 1) {
|
|
4110
|
-
const
|
|
4111
|
-
o.setActiveChat(
|
|
4127
|
+
const Q = D[1];
|
|
4128
|
+
o.setActiveChat(Q);
|
|
4112
4129
|
}
|
|
4113
4130
|
} else b.screen === "tutorial" ? n.activeDocumentationKey.value = b.address : b.screen === "models" ? n.activeModelKey.value = b.address : b.screen === "dashboard-import" || b.screen === "asset-import" ? p = [] : b.screen === "community-models" ? (n.activeCommunityModelKey.value = b.address, p = p.concat(t.getUnreadTips(Dt))) : b.screen === "jobs" && (n.activeJobsKey.value = b.address);
|
|
4114
4131
|
n.mobileMenuOpen.value = !1, n.displayedTips.value = p, n.showTipModal.value = p.length > 0, b.address && !S && ae(b.screen, b.address);
|
|
@@ -4251,7 +4268,7 @@ const or = () => {
|
|
|
4251
4268
|
const q = A("assetType", ""), k = A("assetName", "");
|
|
4252
4269
|
q && k ? d("asset-import", null, "asset-import") : d("dashboard-import", null, "dashboard-import"), p = !0;
|
|
4253
4270
|
}
|
|
4254
|
-
let D = n.activeScreen.value,
|
|
4271
|
+
let D = n.activeScreen.value, Q = n.activeSidebarScreen.value;
|
|
4255
4272
|
const $ = [];
|
|
4256
4273
|
n.activeEditor.value && !p && $.push({
|
|
4257
4274
|
screen: "editors",
|
|
@@ -4305,14 +4322,14 @@ const or = () => {
|
|
|
4305
4322
|
isActive: D === "profile"
|
|
4306
4323
|
}), $.sort((q, k) => q.isActive ? 1 : k.isActive ? -1 : 0), $.forEach((q) => {
|
|
4307
4324
|
d(q.screen, q.title, q.key, !0);
|
|
4308
|
-
}), T(D), !
|
|
4325
|
+
}), T(D), !Q && $.length > 0 ? b = $[$.length - 1].screen : Q && (b = Q), x(b);
|
|
4309
4326
|
},
|
|
4310
4327
|
toggleFullScreen: (g) => {
|
|
4311
4328
|
n.fullScreen.value = g;
|
|
4312
4329
|
},
|
|
4313
4330
|
addBackListeners: () => {
|
|
4314
4331
|
i || (i = window.addEventListener("hashchange", () => {
|
|
4315
|
-
const g = A("editors", ""), S = A("dashboard", ""), b = A("connections", ""), p = A("model", ""), D = A("community-models", ""),
|
|
4332
|
+
const g = A("editors", ""), S = A("dashboard", ""), b = A("connections", ""), p = A("model", ""), D = A("community-models", ""), Q = A("jobs", ""), $ = A("docs", ""), q = A("llms", ""), k = A("screen", ""), J = A("sidebarScreen", "");
|
|
4316
4333
|
let ee = !1;
|
|
4317
4334
|
J !== n.activeSidebarScreen.value && x(J), k !== n.activeScreen.value && (n.activeScreen.value = k, ee = !0);
|
|
4318
4335
|
const te = [
|
|
@@ -4342,7 +4359,7 @@ const or = () => {
|
|
|
4342
4359
|
current: n.activeCommunityModelKey.value
|
|
4343
4360
|
},
|
|
4344
4361
|
{
|
|
4345
|
-
hash:
|
|
4362
|
+
hash: Q,
|
|
4346
4363
|
screen: "jobs",
|
|
4347
4364
|
current: n.activeJobsKey.value
|
|
4348
4365
|
},
|
|
@@ -4357,17 +4374,17 @@ const or = () => {
|
|
|
4357
4374
|
current: n.activeLLMConnectionKey.value
|
|
4358
4375
|
}
|
|
4359
4376
|
];
|
|
4360
|
-
for (const { hash: H, screen:
|
|
4361
|
-
if (H && H !== et ||
|
|
4377
|
+
for (const { hash: H, screen: ge, current: et } of te)
|
|
4378
|
+
if (H && H !== et || ge === k && ee) {
|
|
4362
4379
|
const re = n.tabs.value.find(
|
|
4363
|
-
(
|
|
4380
|
+
(ye) => ye.screen === ge && ye.screen === k && ye.address === H
|
|
4364
4381
|
);
|
|
4365
4382
|
if (re && re.id !== n.activeTab.value) {
|
|
4366
4383
|
E(re.id, !0);
|
|
4367
4384
|
break;
|
|
4368
4385
|
}
|
|
4369
4386
|
if (!re && H) {
|
|
4370
|
-
d(
|
|
4387
|
+
d(ge, null, H);
|
|
4371
4388
|
break;
|
|
4372
4389
|
}
|
|
4373
4390
|
}
|
|
@@ -4378,11 +4395,11 @@ const or = () => {
|
|
|
4378
4395
|
}
|
|
4379
4396
|
};
|
|
4380
4397
|
};
|
|
4381
|
-
let
|
|
4398
|
+
let ve = null;
|
|
4382
4399
|
function qr() {
|
|
4383
|
-
return
|
|
4400
|
+
return ve || (ve = or()), ve;
|
|
4384
4401
|
}
|
|
4385
|
-
const
|
|
4402
|
+
const Se = 100;
|
|
4386
4403
|
class nr {
|
|
4387
4404
|
constructor() {
|
|
4388
4405
|
w(this, "dbName");
|
|
@@ -4438,7 +4455,7 @@ class nr {
|
|
|
4438
4455
|
});
|
|
4439
4456
|
}
|
|
4440
4457
|
// Get query history for a specific connection
|
|
4441
|
-
async getQueriesForConnection(e, t =
|
|
4458
|
+
async getQueriesForConnection(e, t = Se) {
|
|
4442
4459
|
return this.db || await this._initDB(), new Promise((s, o) => {
|
|
4443
4460
|
if (!this.db) {
|
|
4444
4461
|
o(new Error("Database not initialized"));
|
|
@@ -4479,11 +4496,11 @@ class nr {
|
|
|
4479
4496
|
const n = this.db.transaction([this.storeName], "readwrite").objectStore(this.storeName).index("connectionName"), a = n.count(IDBKeyRange.only(e));
|
|
4480
4497
|
a.onsuccess = () => {
|
|
4481
4498
|
const c = a.result;
|
|
4482
|
-
if (c <=
|
|
4499
|
+
if (c <= Se) {
|
|
4483
4500
|
t();
|
|
4484
4501
|
return;
|
|
4485
4502
|
}
|
|
4486
|
-
const u = c -
|
|
4503
|
+
const u = c - Se, l = n.openCursor(IDBKeyRange.only(e));
|
|
4487
4504
|
let h = 0;
|
|
4488
4505
|
l.onsuccess = (d) => {
|
|
4489
4506
|
const f = d.target.result;
|
|
@@ -4497,13 +4514,13 @@ class nr {
|
|
|
4497
4514
|
});
|
|
4498
4515
|
}
|
|
4499
4516
|
}
|
|
4500
|
-
let
|
|
4501
|
-
const
|
|
4517
|
+
let Ce = null;
|
|
4518
|
+
const Ee = () => (Ce || (Ce = new nr()), Ce);
|
|
4502
4519
|
function ce(r) {
|
|
4503
|
-
const e =
|
|
4520
|
+
const e = O([]), t = O(!0), s = O(null), o = async () => {
|
|
4504
4521
|
t.value = !0;
|
|
4505
4522
|
try {
|
|
4506
|
-
const c = await
|
|
4523
|
+
const c = await Ee().getQueriesForConnection(r);
|
|
4507
4524
|
e.value = c, s.value = null;
|
|
4508
4525
|
} catch (c) {
|
|
4509
4526
|
console.error("Failed to load query history:", c), s.value = "Failed to load query history";
|
|
@@ -4512,14 +4529,14 @@ function ce(r) {
|
|
|
4512
4529
|
}
|
|
4513
4530
|
}, i = async (c) => {
|
|
4514
4531
|
try {
|
|
4515
|
-
await
|
|
4532
|
+
await Ee().addQuery(r, c), await o();
|
|
4516
4533
|
} catch (u) {
|
|
4517
4534
|
console.error("Failed to record query:", u), s.value = "Failed to record query";
|
|
4518
4535
|
}
|
|
4519
4536
|
}, n = async () => {
|
|
4520
4537
|
t.value = !0;
|
|
4521
4538
|
try {
|
|
4522
|
-
await
|
|
4539
|
+
await Ee().clearConnectionHistory(r), e.value = [], s.value = null;
|
|
4523
4540
|
} catch (c) {
|
|
4524
4541
|
console.error("Failed to clear query history:", c), s.value = "Failed to clear query history";
|
|
4525
4542
|
} finally {
|
|
@@ -4908,7 +4925,8 @@ class kr {
|
|
|
4908
4925
|
t.imports,
|
|
4909
4926
|
t.extraFilters,
|
|
4910
4927
|
null,
|
|
4911
|
-
t.currentFilename || null
|
|
4928
|
+
t.currentFilename || null,
|
|
4929
|
+
t.parameters || null
|
|
4912
4930
|
)) : null;
|
|
4913
4931
|
}
|
|
4914
4932
|
async getEligibleCrossFilterFields(e, t = {}) {
|
|
@@ -5140,7 +5158,7 @@ export {
|
|
|
5140
5158
|
$r as G,
|
|
5141
5159
|
Ar as H,
|
|
5142
5160
|
Ze as I,
|
|
5143
|
-
|
|
5161
|
+
Or as J,
|
|
5144
5162
|
Fr as K,
|
|
5145
5163
|
_r as L,
|
|
5146
5164
|
Te as M,
|
|
@@ -5149,8 +5167,8 @@ export {
|
|
|
5149
5167
|
kr as Q,
|
|
5150
5168
|
Sr as T,
|
|
5151
5169
|
Jt as a,
|
|
5152
|
-
|
|
5153
|
-
|
|
5170
|
+
ue as b,
|
|
5171
|
+
Qr as c,
|
|
5154
5172
|
rr as d,
|
|
5155
5173
|
qr as e,
|
|
5156
5174
|
Ue as f,
|
|
@@ -5159,7 +5177,7 @@ export {
|
|
|
5159
5177
|
Er as i,
|
|
5160
5178
|
V as j,
|
|
5161
5179
|
Mt as k,
|
|
5162
|
-
|
|
5180
|
+
le as l,
|
|
5163
5181
|
jt as m,
|
|
5164
5182
|
K as n,
|
|
5165
5183
|
It as o,
|
|
@@ -5169,9 +5187,9 @@ export {
|
|
|
5169
5187
|
Lt as s,
|
|
5170
5188
|
Pt as t,
|
|
5171
5189
|
Dr as u,
|
|
5172
|
-
|
|
5190
|
+
me as v,
|
|
5173
5191
|
Cr as w,
|
|
5174
5192
|
ae as x,
|
|
5175
5193
|
xr as y,
|
|
5176
|
-
|
|
5194
|
+
we as z
|
|
5177
5195
|
};
|