@burdenoff/microfe-semanticfed 2026.1031.3 → 2026.1031.5

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.
@@ -1,17 +1,18 @@
1
1
  import { translateWithFallback as e } from "../utils/i18n.js";
2
2
  import { sqlErrorMessage as t, useSemExecuteSql as n, useSemSqlCatalog as r, useSemSqlModels as i } from "../hooks/useSqlConsole.js";
3
- import { useMemo as a, useState as o } from "react";
4
- import { AlertTriangle as s, CheckCircle2 as c, Clock as l, Database as u, EyeOff as d, Loader2 as f, Play as p, Plug as m, Table2 as h, Terminal as g, XCircle as _ } from "lucide-react";
5
- import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
6
- import { useI18n as x } from "@burdenoff/fe-libs/shared/providers/shell";
7
- import { Badge as S, Button as C, Card as w, CardContent as T, CardHeader as E, CardTitle as D } from "@burdenoff/fe-libs/ui";
3
+ import { AskQuestionPanel as a } from "../components/AskQuestionPanel.js";
4
+ import { useMemo as o, useState as s } from "react";
5
+ import { AlertTriangle as c, CheckCircle2 as l, Clock as u, Database as d, EyeOff as f, Loader2 as p, Play as m, Plug as h, Table2 as g, Terminal as _, XCircle as v } from "lucide-react";
6
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
7
+ import { useI18n as S } from "@burdenoff/fe-libs/shared/providers/shell";
8
+ import { Badge as C, Button as w, Card as T, CardContent as E, CardHeader as D, CardTitle as O } from "@burdenoff/fe-libs/ui";
8
9
  //#region src/semanticfed/pages/QueryConsolePage.tsx
9
- var O = [
10
+ var k = [
10
11
  100,
11
12
  1e3,
12
13
  1e4
13
- ], k = 10;
14
- function A(e) {
14
+ ], A = 10;
15
+ function j(e) {
15
16
  if (!e) return "";
16
17
  let t = e.columns.find((e) => e.kind === "DIMENSION"), n = e.columns.find((e) => e.kind === "METRIC"), r = (e) => /^[A-Za-z_][A-Za-z0-9_]*$/.test(e) ? e : `"${e.replace(/"/g, "\"\"")}"`, i = r(e.name);
17
18
  if (t && n) {
@@ -26,11 +27,11 @@ function A(e) {
26
27
  }
27
28
  return `SELECT *\nFROM ${i}\nLIMIT 100;`;
28
29
  }
29
- function j(e) {
30
+ function M(e) {
30
31
  return e == null ? "NULL" : typeof e == "object" ? JSON.stringify(e) : String(e);
31
32
  }
32
- function M() {
33
- let { t: M } = x(), N = (t, n, r) => e(M, t, n, r), P = i(), [F, I] = o(null), L = F ?? P.data?.[0]?.id ?? null, R = r(L), z = n(), [B, V] = o(null), H = B ?? A(R.data?.tables[0]), U = (e) => V(e), [W, G] = o(1e3), [K, q] = o(null), [J, Y] = o(null), [X, Z] = o([]), Q = a(() => P.data?.find((e) => e.id === L)?.name ?? "", [P.data, L]), $ = async () => {
33
+ function N() {
34
+ let { t: N } = S(), P = (t, n, r) => e(N, t, n, r), F = i(), [ee, I] = s(null), L = ee ?? F.data?.[0]?.id ?? null, R = r(L), z = n(), [B, V] = s(null), H = B ?? j(R.data?.tables[0]), U = (e) => V(e), [W, G] = s(1e3), [K, q] = s(null), [J, Y] = s(null), [X, Z] = s([]), Q = o(() => F.data?.find((e) => e.id === L)?.name ?? "", [F.data, L]), $ = async () => {
34
35
  if (!L || H.trim() === "" || z.isPending) return;
35
36
  Y(null);
36
37
  let e = H, n = {
@@ -51,7 +52,7 @@ function M() {
51
52
  rowCount: t.rowCount,
52
53
  durationMs: Math.round(t.durationMs),
53
54
  message: null
54
- }, ...e].slice(0, k));
55
+ }, ...e].slice(0, A));
55
56
  } catch (e) {
56
57
  let r = t(e);
57
58
  q(null), Y(r), Z((e) => [{
@@ -60,57 +61,72 @@ function M() {
60
61
  rowCount: 0,
61
62
  durationMs: 0,
62
63
  message: r
63
- }, ...e].slice(0, k));
64
+ }, ...e].slice(0, A));
64
65
  }
65
- }, ee = (e) => U(H.trim() === "" ? e : `${H}${e}`), te = P.isSuccess && P.data.length === 0;
66
- return /* @__PURE__ */ b("div", {
66
+ }, te = (e) => {
67
+ Y(null), q(e.result);
68
+ let { translation: t, result: n } = e;
69
+ !n || !t.sql || Z((e) => [{
70
+ id: Date.now(),
71
+ sql: t.sql ?? "",
72
+ modelName: t.modelName,
73
+ executedAt: (/* @__PURE__ */ new Date()).toLocaleTimeString(),
74
+ ok: !0,
75
+ rowCount: n.rowCount,
76
+ durationMs: Math.round(n.durationMs),
77
+ message: null
78
+ }, ...e].slice(0, A));
79
+ }, ne = (e) => {
80
+ q(null), Y(e);
81
+ }, re = (e) => U(H.trim() === "" ? e : `${H}${e}`), ie = F.isSuccess && F.data.length === 0;
82
+ return /* @__PURE__ */ x("div", {
67
83
  className: "space-y-6 p-6",
68
84
  children: [
69
- /* @__PURE__ */ b("div", {
85
+ /* @__PURE__ */ x("div", {
70
86
  className: "flex flex-wrap items-center justify-between gap-3",
71
87
  "data-tour": "semanticfed-query-console-header",
72
- children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h1", {
88
+ children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("h1", {
73
89
  className: "text-2xl font-semibold",
74
- children: N("semanticfed.queryConsole.title", "Query Console")
75
- }), /* @__PURE__ */ y("p", {
90
+ children: P("semanticfed.queryConsole.title", "Query Console")
91
+ }), /* @__PURE__ */ b("p", {
76
92
  className: "text-sm text-muted-foreground",
77
- children: N("semanticfed.queryConsole.sqlDescription", "Run read-only SQL against a semantic model. Every statement is federated across its data sources with your access policies applied.")
78
- })] }), /* @__PURE__ */ b("div", {
93
+ children: P("semanticfed.queryConsole.askDescription", "Ask a question in plain English or run read-only SQL against a semantic model. Every query is federated across its data sources with your access policies applied.")
94
+ })] }), /* @__PURE__ */ x("div", {
79
95
  className: "flex gap-2",
80
- children: [/* @__PURE__ */ b(S, {
96
+ children: [/* @__PURE__ */ x(C, {
81
97
  variant: "outline",
82
98
  className: "gap-1",
83
- children: [/* @__PURE__ */ y(g, { className: "h-3 w-3" }), " SQL SELECT"]
84
- }), /* @__PURE__ */ b(S, {
99
+ children: [/* @__PURE__ */ b(_, { className: "h-3 w-3" }), " SQL SELECT"]
100
+ }), /* @__PURE__ */ x(C, {
85
101
  variant: "outline",
86
102
  className: "gap-1",
87
- children: [/* @__PURE__ */ y(m, { className: "h-3 w-3" }), N("semanticfed.queryConsole.badges.httpApi", "HTTP SQL API")]
103
+ children: [/* @__PURE__ */ b(h, { className: "h-3 w-3" }), P("semanticfed.queryConsole.badges.httpApi", "HTTP SQL API")]
88
104
  })]
89
105
  })]
90
106
  }),
91
- te && /* @__PURE__ */ y(w, { children: /* @__PURE__ */ b(T, {
107
+ ie && /* @__PURE__ */ b(T, { children: /* @__PURE__ */ x(E, {
92
108
  className: "flex items-center gap-3 p-6 text-sm text-muted-foreground",
93
- children: [/* @__PURE__ */ y(u, { className: "h-5 w-5" }), N("semanticfed.queryConsole.noModels", "No semantic model yet. Create a model with entities, dimensions and metrics, then query it here with SQL.")]
109
+ children: [/* @__PURE__ */ b(d, { className: "h-5 w-5" }), P("semanticfed.queryConsole.noModels", "No semantic model yet. Create a model with entities, dimensions and metrics, then query it here with SQL.")]
94
110
  }) }),
95
- /* @__PURE__ */ b("div", {
111
+ /* @__PURE__ */ x("div", {
96
112
  className: "grid gap-4 lg:grid-cols-[18rem_minmax(0,1fr)]",
97
- children: [/* @__PURE__ */ b(w, {
113
+ children: [/* @__PURE__ */ x(T, {
98
114
  className: "min-w-0",
99
- children: [/* @__PURE__ */ y(E, {
115
+ children: [/* @__PURE__ */ b(D, {
100
116
  className: "pb-3",
101
- children: /* @__PURE__ */ b(D, {
117
+ children: /* @__PURE__ */ x(O, {
102
118
  className: "flex items-center gap-2 text-base",
103
- children: [/* @__PURE__ */ y(h, { className: "h-4 w-4" }), N("semanticfed.queryConsole.schema.title", "Tables")]
119
+ children: [/* @__PURE__ */ b(g, { className: "h-4 w-4" }), P("semanticfed.queryConsole.schema.title", "Tables")]
104
120
  })
105
- }), /* @__PURE__ */ b(T, {
121
+ }), /* @__PURE__ */ x(E, {
106
122
  className: "space-y-3",
107
123
  children: [
108
- /* @__PURE__ */ y("label", {
124
+ /* @__PURE__ */ b("label", {
109
125
  className: "block text-xs font-medium text-muted-foreground",
110
126
  htmlFor: "sql-console-model",
111
- children: N("semanticfed.queryConsole.schema.model", "Semantic model")
127
+ children: P("semanticfed.queryConsole.schema.model", "Semantic model")
112
128
  }),
113
- /* @__PURE__ */ y("select", {
129
+ /* @__PURE__ */ b("select", {
114
130
  id: "sql-console-model",
115
131
  "data-testid": "sql-console-model",
116
132
  className: "w-full rounded border bg-background p-2 text-sm",
@@ -118,93 +134,100 @@ function M() {
118
134
  onChange: (e) => {
119
135
  I(e.target.value || null), V(null), q(null), Y(null);
120
136
  },
121
- disabled: !P.data || P.data.length === 0,
122
- children: (P.data ?? []).map((e) => /* @__PURE__ */ y("option", {
137
+ disabled: !F.data || F.data.length === 0,
138
+ children: (F.data ?? []).map((e) => /* @__PURE__ */ b("option", {
123
139
  value: e.id,
124
140
  children: e.name
125
141
  }, e.id))
126
142
  }),
127
- P.isError && /* @__PURE__ */ y("p", {
143
+ F.isError && /* @__PURE__ */ b("p", {
128
144
  className: "text-xs text-destructive",
129
- children: t(P.error)
145
+ children: t(F.error)
130
146
  }),
131
- R.isLoading && /* @__PURE__ */ y(f, { className: "h-4 w-4 animate-spin text-muted-foreground" }),
132
- R.isError && /* @__PURE__ */ y("p", {
147
+ R.isLoading && /* @__PURE__ */ b(p, { className: "h-4 w-4 animate-spin text-muted-foreground" }),
148
+ R.isError && /* @__PURE__ */ b("p", {
133
149
  className: "text-xs text-destructive",
134
150
  children: t(R.error)
135
151
  }),
136
- /* @__PURE__ */ y("div", {
152
+ /* @__PURE__ */ b("div", {
137
153
  className: "max-h-96 space-y-2 overflow-y-auto",
138
154
  "data-testid": "sql-console-tables",
139
- children: (R.data?.tables ?? []).map((e) => /* @__PURE__ */ b("details", {
155
+ children: (R.data?.tables ?? []).map((e) => /* @__PURE__ */ x("details", {
140
156
  className: "rounded border p-2",
141
157
  open: R.data?.tables.length === 1,
142
- children: [/* @__PURE__ */ y("summary", {
158
+ children: [/* @__PURE__ */ b("summary", {
143
159
  className: "cursor-pointer truncate font-mono text-xs font-medium",
144
160
  children: e.name
145
- }), /* @__PURE__ */ b("ul", {
161
+ }), /* @__PURE__ */ x("ul", {
146
162
  className: "mt-2 space-y-1",
147
- children: [e.columns.map((e) => /* @__PURE__ */ y("li", { children: /* @__PURE__ */ b("button", {
163
+ children: [e.columns.map((e) => /* @__PURE__ */ b("li", { children: /* @__PURE__ */ x("button", {
148
164
  type: "button",
149
165
  className: "flex w-full items-center justify-between gap-2 rounded px-1 text-left font-mono text-xs hover:bg-muted",
150
- onClick: () => ee(e.name),
166
+ onClick: () => re(e.name),
151
167
  title: e.description ?? void 0,
152
- children: [/* @__PURE__ */ y("span", {
168
+ children: [/* @__PURE__ */ b("span", {
153
169
  className: "truncate",
154
170
  children: e.name
155
- }), /* @__PURE__ */ y("span", {
171
+ }), /* @__PURE__ */ b("span", {
156
172
  className: "shrink-0 text-[10px] text-muted-foreground",
157
173
  children: e.kind === "METRIC" ? e.aggregation ?? "METRIC" : e.dataType
158
174
  })]
159
- }) }, e.name)), e.columns.length === 0 && /* @__PURE__ */ y("li", {
175
+ }) }, e.name)), e.columns.length === 0 && /* @__PURE__ */ b("li", {
160
176
  className: "text-xs text-muted-foreground",
161
- children: N("semanticfed.queryConsole.schema.noColumns", "No dimensions or metrics registered")
177
+ children: P("semanticfed.queryConsole.schema.noColumns", "No dimensions or metrics registered")
162
178
  })]
163
179
  })]
164
180
  }, e.name))
165
181
  })
166
182
  ]
167
183
  })]
168
- }), /* @__PURE__ */ b("div", {
184
+ }), /* @__PURE__ */ x("div", {
169
185
  className: "min-w-0 space-y-4",
170
186
  children: [
171
- /* @__PURE__ */ b(w, { children: [/* @__PURE__ */ y(E, {
187
+ /* @__PURE__ */ b(a, {
188
+ modelId: L,
189
+ maxRows: W,
190
+ onAnswer: te,
191
+ onError: ne,
192
+ onOpenInEditor: (e) => U(e)
193
+ }),
194
+ /* @__PURE__ */ x(T, { children: [/* @__PURE__ */ b(D, {
172
195
  className: "pb-3",
173
- children: /* @__PURE__ */ b("div", {
196
+ children: /* @__PURE__ */ x("div", {
174
197
  className: "flex flex-wrap items-center justify-between gap-2",
175
- children: [/* @__PURE__ */ y(D, {
198
+ children: [/* @__PURE__ */ b(O, {
176
199
  className: "text-base",
177
- children: N("semanticfed.queryConsole.editor.title", "Query Editor")
178
- }), /* @__PURE__ */ b("div", {
200
+ children: P("semanticfed.queryConsole.editor.title", "Query Editor")
201
+ }), /* @__PURE__ */ x("div", {
179
202
  className: "flex items-center gap-2",
180
203
  children: [
181
- /* @__PURE__ */ y("label", {
204
+ /* @__PURE__ */ b("label", {
182
205
  className: "sr-only",
183
206
  htmlFor: "sql-console-max-rows",
184
- children: N("semanticfed.queryConsole.editor.maxRowsLabel", "Maximum rows")
207
+ children: P("semanticfed.queryConsole.editor.maxRowsLabel", "Maximum rows")
185
208
  }),
186
- /* @__PURE__ */ y("select", {
209
+ /* @__PURE__ */ b("select", {
187
210
  id: "sql-console-max-rows",
188
211
  className: "rounded border bg-background p-1 text-xs",
189
212
  value: W,
190
213
  onChange: (e) => G(Number(e.target.value)),
191
- children: O.map((e) => /* @__PURE__ */ y("option", {
214
+ children: k.map((e) => /* @__PURE__ */ b("option", {
192
215
  value: e,
193
- children: N("semanticfed.queryConsole.editor.maxRowsOption", "Max {count} rows", { count: e.toLocaleString() })
216
+ children: P("semanticfed.queryConsole.editor.maxRowsOption", "Max {count} rows", { count: e.toLocaleString() })
194
217
  }, e))
195
218
  }),
196
- /* @__PURE__ */ b(C, {
219
+ /* @__PURE__ */ x(w, {
197
220
  size: "sm",
198
221
  onClick: () => void $(),
199
222
  disabled: !L || H.trim() === "" || z.isPending,
200
223
  "data-testid": "sql-console-run",
201
- children: [z.isPending ? /* @__PURE__ */ y(f, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ y(p, { className: "mr-2 h-4 w-4" }), N("semanticfed.queryConsole.actions.execute", "Execute")]
224
+ children: [z.isPending ? /* @__PURE__ */ b(p, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ b(m, { className: "mr-2 h-4 w-4" }), P("semanticfed.queryConsole.actions.execute", "Execute")]
202
225
  })
203
226
  ]
204
227
  })]
205
228
  })
206
- }), /* @__PURE__ */ b(T, { children: [/* @__PURE__ */ y("textarea", {
207
- "aria-label": N("semanticfed.queryConsole.editor.ariaLabel", "SQL statement"),
229
+ }), /* @__PURE__ */ x(E, { children: [/* @__PURE__ */ b("textarea", {
230
+ "aria-label": P("semanticfed.queryConsole.editor.ariaLabel", "SQL statement"),
208
231
  "data-testid": "sql-console-editor",
209
232
  className: "w-full rounded border bg-muted/30 p-4 font-mono text-sm leading-relaxed focus:outline-none focus:ring-2 focus:ring-primary",
210
233
  rows: 8,
@@ -215,125 +238,125 @@ function M() {
215
238
  },
216
239
  spellCheck: !1,
217
240
  placeholder: "SELECT region, SUM(revenue) FROM orders GROUP BY region"
218
- }), /* @__PURE__ */ b("div", {
241
+ }), /* @__PURE__ */ x("div", {
219
242
  className: "mt-2 flex flex-wrap items-center gap-4 text-xs text-muted-foreground",
220
243
  children: [
221
- /* @__PURE__ */ y("span", { children: N("semanticfed.queryConsole.editor.shortcut", "Ctrl/Cmd + Enter to run") }),
222
- /* @__PURE__ */ y("span", { children: N("semanticfed.queryConsole.editor.timeout", "Timeout: 30s") }),
223
- /* @__PURE__ */ y("span", { children: N("semanticfed.queryConsole.editor.supported", "SELECT, JOIN … ON, WHERE … AND, GROUP BY, ORDER BY, LIMIT/OFFSET") })
244
+ /* @__PURE__ */ b("span", { children: P("semanticfed.queryConsole.editor.shortcut", "Ctrl/Cmd + Enter to run") }),
245
+ /* @__PURE__ */ b("span", { children: P("semanticfed.queryConsole.editor.timeout", "Timeout: 30s") }),
246
+ /* @__PURE__ */ b("span", { children: P("semanticfed.queryConsole.editor.supported", "SELECT, JOIN … ON, WHERE … AND, GROUP BY, ORDER BY, LIMIT/OFFSET") })
224
247
  ]
225
248
  })] })] }),
226
- J && /* @__PURE__ */ y(w, {
249
+ J && /* @__PURE__ */ b(T, {
227
250
  "data-testid": "sql-console-error",
228
- children: /* @__PURE__ */ b(T, {
251
+ children: /* @__PURE__ */ x(E, {
229
252
  className: "flex items-start gap-3 p-4 text-sm text-destructive",
230
- children: [/* @__PURE__ */ y(_, { className: "mt-0.5 h-4 w-4 shrink-0" }), /* @__PURE__ */ y("span", {
253
+ children: [/* @__PURE__ */ b(v, { className: "mt-0.5 h-4 w-4 shrink-0" }), /* @__PURE__ */ b("span", {
231
254
  className: "break-words",
232
255
  children: J
233
256
  })]
234
257
  })
235
258
  }),
236
- K && /* @__PURE__ */ b(w, {
259
+ K && /* @__PURE__ */ x(T, {
237
260
  "data-testid": "sql-console-result",
238
- children: [/* @__PURE__ */ y(E, {
261
+ children: [/* @__PURE__ */ b(D, {
239
262
  className: "pb-3",
240
- children: /* @__PURE__ */ b("div", {
263
+ children: /* @__PURE__ */ x("div", {
241
264
  className: "flex flex-wrap items-center gap-3 text-sm",
242
265
  children: [
243
- /* @__PURE__ */ y(c, { className: "h-4 w-4 text-primary" }),
244
- /* @__PURE__ */ y("span", {
266
+ /* @__PURE__ */ b(l, { className: "h-4 w-4 text-primary" }),
267
+ /* @__PURE__ */ b("span", {
245
268
  className: "font-medium",
246
269
  "data-testid": "sql-console-row-count",
247
- children: N("semanticfed.queryConsole.result.rows", "{count} rows", { count: K.rowCount.toLocaleString() })
270
+ children: P("semanticfed.queryConsole.result.rows", "{count} rows", { count: K.rowCount.toLocaleString() })
248
271
  }),
249
- /* @__PURE__ */ b("span", {
272
+ /* @__PURE__ */ x("span", {
250
273
  className: "text-muted-foreground",
251
274
  children: [Math.round(K.durationMs), "ms"]
252
275
  }),
253
- /* @__PURE__ */ y("span", {
276
+ /* @__PURE__ */ b("span", {
254
277
  className: "text-muted-foreground",
255
- children: N("semanticfed.queryConsole.result.sources", "{count} sources", { count: K.sourcesTouched })
278
+ children: P("semanticfed.queryConsole.result.sources", "{count} sources", { count: K.sourcesTouched })
256
279
  }),
257
- K.truncated && /* @__PURE__ */ b(S, {
280
+ K.truncated && /* @__PURE__ */ x(C, {
258
281
  variant: "outline",
259
282
  className: "gap-1",
260
- children: [/* @__PURE__ */ y(s, { className: "h-3 w-3" }), N("semanticfed.queryConsole.result.truncated", "Truncated — more rows matched")]
283
+ children: [/* @__PURE__ */ b(c, { className: "h-3 w-3" }), P("semanticfed.queryConsole.result.truncated", "Truncated — more rows matched")]
261
284
  })
262
285
  ]
263
286
  })
264
- }), /* @__PURE__ */ y(T, { children: /* @__PURE__ */ y("div", {
287
+ }), /* @__PURE__ */ b(E, { children: /* @__PURE__ */ b("div", {
265
288
  className: "max-h-[28rem] overflow-auto rounded border",
266
- children: /* @__PURE__ */ b("table", {
289
+ children: /* @__PURE__ */ x("table", {
267
290
  className: "w-full text-left text-xs",
268
- children: [/* @__PURE__ */ y("thead", {
291
+ children: [/* @__PURE__ */ b("thead", {
269
292
  className: "sticky top-0 bg-muted",
270
- children: /* @__PURE__ */ y("tr", { children: K.columns.map((e) => /* @__PURE__ */ b("th", {
293
+ children: /* @__PURE__ */ b("tr", { children: K.columns.map((e) => /* @__PURE__ */ x("th", {
271
294
  className: "whitespace-nowrap px-3 py-2 font-medium",
272
- children: [/* @__PURE__ */ b("span", {
295
+ children: [/* @__PURE__ */ x("span", {
273
296
  className: "inline-flex items-center gap-1",
274
- children: [e.name, e.masked && /* @__PURE__ */ y(d, {
297
+ children: [e.name, e.masked && /* @__PURE__ */ b(f, {
275
298
  className: "h-3 w-3 text-muted-foreground",
276
- "aria-label": N("semanticfed.queryConsole.result.masked", "Masked by policy ({mask})", { mask: e.mask ?? "" })
299
+ "aria-label": P("semanticfed.queryConsole.result.masked", "Masked by policy ({mask})", { mask: e.mask ?? "" })
277
300
  })]
278
- }), /* @__PURE__ */ y("span", {
301
+ }), /* @__PURE__ */ b("span", {
279
302
  className: "block text-[10px] font-normal text-muted-foreground",
280
303
  children: e.aggregation ?? e.dataType
281
304
  })]
282
305
  }, e.name)) })
283
- }), /* @__PURE__ */ b("tbody", { children: [K.rows.map((e, t) => /* @__PURE__ */ y("tr", {
306
+ }), /* @__PURE__ */ x("tbody", { children: [K.rows.map((e, t) => /* @__PURE__ */ b("tr", {
284
307
  className: "border-t",
285
- children: K.columns.map((t) => /* @__PURE__ */ y("td", {
308
+ children: K.columns.map((t) => /* @__PURE__ */ b("td", {
286
309
  className: "whitespace-nowrap px-3 py-1.5 font-mono",
287
- children: j(e[t.name])
310
+ children: M(e[t.name])
288
311
  }, t.name))
289
- }, t)), K.rows.length === 0 && /* @__PURE__ */ y("tr", { children: /* @__PURE__ */ y("td", {
312
+ }, t)), K.rows.length === 0 && /* @__PURE__ */ b("tr", { children: /* @__PURE__ */ b("td", {
290
313
  colSpan: K.columns.length,
291
314
  className: "px-3 py-4 text-center text-muted-foreground",
292
- children: N("semanticfed.queryConsole.result.empty", "No rows matched")
315
+ children: P("semanticfed.queryConsole.result.empty", "No rows matched")
293
316
  }) })] })]
294
317
  })
295
318
  }) })]
296
319
  }),
297
- /* @__PURE__ */ b(w, { children: [/* @__PURE__ */ y(E, { children: /* @__PURE__ */ b(D, {
320
+ /* @__PURE__ */ x(T, { children: [/* @__PURE__ */ b(D, { children: /* @__PURE__ */ x(O, {
298
321
  className: "flex items-center gap-2 text-base",
299
- children: [/* @__PURE__ */ y(l, { className: "h-4 w-4" }), N("semanticfed.queryConsole.history.title", "Query History")]
300
- }) }), /* @__PURE__ */ y(T, { children: X.length === 0 ? /* @__PURE__ */ y("p", {
322
+ children: [/* @__PURE__ */ b(u, { className: "h-4 w-4" }), P("semanticfed.queryConsole.history.title", "Query History")]
323
+ }) }), /* @__PURE__ */ b(E, { children: X.length === 0 ? /* @__PURE__ */ b("p", {
301
324
  className: "text-xs text-muted-foreground",
302
- children: N("semanticfed.queryConsole.history.empty", "Statements you run in this session appear here.")
303
- }) : /* @__PURE__ */ y("div", {
325
+ children: P("semanticfed.queryConsole.history.empty", "Statements you run in this session appear here.")
326
+ }) : /* @__PURE__ */ b("div", {
304
327
  className: "space-y-2",
305
- children: X.map((e) => /* @__PURE__ */ b("button", {
328
+ children: X.map((e) => /* @__PURE__ */ x("button", {
306
329
  type: "button",
307
330
  className: "flex w-full items-start gap-3 rounded border p-3 text-left hover:bg-muted",
308
331
  onClick: () => U(e.sql),
309
- children: [e.ok ? /* @__PURE__ */ y(c, { className: "mt-0.5 h-4 w-4 shrink-0 text-primary" }) : /* @__PURE__ */ y(_, { className: "mt-0.5 h-4 w-4 shrink-0 text-destructive" }), /* @__PURE__ */ b("div", {
332
+ children: [e.ok ? /* @__PURE__ */ b(l, { className: "mt-0.5 h-4 w-4 shrink-0 text-primary" }) : /* @__PURE__ */ b(v, { className: "mt-0.5 h-4 w-4 shrink-0 text-destructive" }), /* @__PURE__ */ x("div", {
310
333
  className: "min-w-0 flex-1",
311
- children: [/* @__PURE__ */ y("p", {
334
+ children: [/* @__PURE__ */ b("p", {
312
335
  className: "truncate font-mono text-xs",
313
336
  children: e.sql
314
- }), /* @__PURE__ */ b("div", {
337
+ }), /* @__PURE__ */ x("div", {
315
338
  className: "mt-1 flex flex-wrap items-center gap-3 text-xs text-muted-foreground",
316
339
  children: [
317
- /* @__PURE__ */ y("span", { children: e.modelName }),
318
- e.ok ? /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("span", { children: N("semanticfed.queryConsole.history.results", "{count} results", { count: e.rowCount.toLocaleString() }) }), /* @__PURE__ */ b("span", { children: [e.durationMs, "ms"] })] }) : /* @__PURE__ */ y("span", {
340
+ /* @__PURE__ */ b("span", { children: e.modelName }),
341
+ e.ok ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("span", { children: P("semanticfed.queryConsole.history.results", "{count} results", { count: e.rowCount.toLocaleString() }) }), /* @__PURE__ */ x("span", { children: [e.durationMs, "ms"] })] }) : /* @__PURE__ */ b("span", {
319
342
  className: "truncate",
320
343
  children: e.message
321
344
  }),
322
- /* @__PURE__ */ y("span", { children: e.executedAt })
345
+ /* @__PURE__ */ b("span", { children: e.executedAt })
323
346
  ]
324
347
  })]
325
348
  })]
326
349
  }, e.id))
327
350
  }) })] }),
328
- /* @__PURE__ */ b(w, { children: [/* @__PURE__ */ y(E, {
351
+ /* @__PURE__ */ x(T, { children: [/* @__PURE__ */ b(D, {
329
352
  className: "pb-2",
330
- children: /* @__PURE__ */ b(D, {
353
+ children: /* @__PURE__ */ x(O, {
331
354
  className: "flex items-center gap-2 text-base",
332
- children: [/* @__PURE__ */ y(m, { className: "h-4 w-4" }), N("semanticfed.queryConsole.connect.title", "Connect BI tools and notebooks")]
355
+ children: [/* @__PURE__ */ b(h, { className: "h-4 w-4" }), P("semanticfed.queryConsole.connect.title", "Connect BI tools and notebooks")]
333
356
  })
334
- }), /* @__PURE__ */ b(T, {
357
+ }), /* @__PURE__ */ x(E, {
335
358
  className: "space-y-2 text-xs text-muted-foreground",
336
- children: [/* @__PURE__ */ y("p", { children: N("semanticfed.queryConsole.connect.body", "The same SQL runs over HTTPS: POST the semExecuteSql operation to the workspace API with a workspace token. Power BI (Web connector), Tableau (Web Data Connector), Python/pandas, Jupyter and reverse-ETL HTTP sources can all call it; see the SQL endpoint guide in the SemanticFed docs.") }), /* @__PURE__ */ y("pre", {
359
+ children: [/* @__PURE__ */ b("p", { children: P("semanticfed.queryConsole.connect.body", "The same SQL runs over HTTPS: POST the semExecuteSql operation to the workspace API with a workspace token. Power BI (Web connector), Tableau (Web Data Connector), Python/pandas, Jupyter and reverse-ETL HTTP sources can all call it; see the SQL endpoint guide in the SemanticFed docs.") }), /* @__PURE__ */ b("pre", {
337
360
  className: "overflow-x-auto rounded bg-muted p-3 font-mono text-[11px] text-foreground",
338
361
  children: `mutation { semExecuteSql(input: { modelId: "${L ?? "<model-id>"}", sql: "SELECT ..." }) { columns { name dataType } rows truncated } }`
339
362
  })]
@@ -345,6 +368,6 @@ function M() {
345
368
  });
346
369
  }
347
370
  //#endregion
348
- export { M as QueryConsolePage };
371
+ export { N as QueryConsolePage };
349
372
 
350
373
  //# sourceMappingURL=QueryConsolePage.js.map