@crvouga/mockingbird-service-slack 1.6.0 → 1.7.0

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/CHANGELOG.md CHANGED
@@ -1,6 +1,24 @@
1
1
  # Changelog — @crvouga/mockingbird-service-slack
2
2
 
3
- ## 1.6.0 (2026-09-30)
3
+ ## 1.7.0 (2026-10-01)
4
+
5
+ ### Features
6
+
7
+ - record SQL timelines and serve the admin explorer ([8ced17a](https://github.com/crvouga/mockingbird/commit/8ced17ac398e386ef4e9d7e01fc7744c34b95d07))
8
+
9
+ ### Dependencies
10
+
11
+ - `@crvouga/mockingbird-service-sqlite`
12
+
13
+ ## 1.6.1 (2026-09-30)
14
+
15
+ ### Fixes and improvements
16
+
17
+ - keep admin buttons pressed until the action finishes ([0aabfcb](https://github.com/crvouga/mockingbird/commit/0aabfcb5f392aa51e193f9c3f817d5877d92bc6a))
18
+ - size admin select fields like the text inputs beside them ([0fb3ef2](https://github.com/crvouga/mockingbird/commit/0fb3ef2ddbf43376c93a2ae6d87c6c9bf890dafc))
19
+ - keep admin section tabs wired when boot is renamed ([4eda25e](https://github.com/crvouga/mockingbird/commit/4eda25eacd59da048d196f7cc8369d7a02b47bfc))
20
+
21
+ ## 1.6.0 (2026-09-29)
4
22
 
5
23
  ### Features
6
24
 
@@ -5,7 +5,7 @@ import {
5
5
  markSocketClosed,
6
6
  openSocketCount,
7
7
  unbindSocketTransport
8
- } from "./chunk-XNPGYYVE.js";
8
+ } from "./chunk-E47OMSFP.js";
9
9
 
10
10
  // ../../adapters/node/dist/cli.js
11
11
  import { readFile } from "node:fs/promises";
@@ -650,4 +650,4 @@ export {
650
650
  createServer2 as createServer,
651
651
  serveTarget
652
652
  };
653
- //# sourceMappingURL=chunk-GPFJICAV.js.map
653
+ //# sourceMappingURL=chunk-3RJHDGHW.js.map
@@ -1722,6 +1722,167 @@ function faultPresetList(value) {
1722
1722
  })
1723
1723
  };
1724
1724
  }
1725
+ function mountSqlExplorer(root, api) {
1726
+ const cell = (value) => {
1727
+ if (value === null || value === void 0)
1728
+ return "";
1729
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
1730
+ return String(value);
1731
+ }
1732
+ return JSON.stringify(value) ?? "";
1733
+ };
1734
+ root.replaceChildren();
1735
+ const layout = document.createElement("div");
1736
+ layout.className = "sql-layout";
1737
+ const tables = document.createElement("div");
1738
+ tables.className = "sql-tables";
1739
+ const stack = document.createElement("div");
1740
+ stack.className = "stack";
1741
+ const banner = document.createElement("p");
1742
+ banner.className = "banner";
1743
+ const grid = document.createElement("div");
1744
+ const input = document.createElement("textarea");
1745
+ input.className = "sql-input";
1746
+ input.spellcheck = false;
1747
+ input.placeholder = "SELECT * FROM ...";
1748
+ const actions = document.createElement("div");
1749
+ actions.className = "row-actions";
1750
+ const run = document.createElement("button");
1751
+ run.type = "button";
1752
+ run.textContent = "Run";
1753
+ actions.append(run);
1754
+ const result = document.createElement("pre");
1755
+ stack.append(banner, grid, input, actions, result);
1756
+ layout.append(tables, stack);
1757
+ root.append(layout);
1758
+ const showError = (error) => {
1759
+ banner.textContent = error instanceof Error ? error.message : String(error);
1760
+ banner.classList.add("show");
1761
+ };
1762
+ const clearError = () => {
1763
+ banner.textContent = "";
1764
+ banner.classList.remove("show");
1765
+ };
1766
+ const renderGrid = (columns, rows) => {
1767
+ grid.replaceChildren();
1768
+ if (columns.length === 0) {
1769
+ const empty = document.createElement("p");
1770
+ empty.className = "empty";
1771
+ empty.textContent = "No rows.";
1772
+ grid.append(empty);
1773
+ return;
1774
+ }
1775
+ const table = document.createElement("table");
1776
+ const head = document.createElement("thead");
1777
+ const headRow = document.createElement("tr");
1778
+ for (const column of columns) {
1779
+ const th = document.createElement("th");
1780
+ th.textContent = column;
1781
+ headRow.append(th);
1782
+ }
1783
+ head.append(headRow);
1784
+ const body = document.createElement("tbody");
1785
+ for (const row of rows) {
1786
+ const tr = document.createElement("tr");
1787
+ for (const column of columns) {
1788
+ const td = document.createElement("td");
1789
+ td.dataset.label = column;
1790
+ td.textContent = cell(row[column]);
1791
+ tr.append(td);
1792
+ }
1793
+ body.append(tr);
1794
+ }
1795
+ table.append(head, body);
1796
+ grid.append(table);
1797
+ };
1798
+ const rowsOf = (value) => {
1799
+ if (!isRecord2(value) || !Array.isArray(value.rows))
1800
+ return [];
1801
+ return value.rows.flatMap((row) => isRecord2(row) ? [row] : []);
1802
+ };
1803
+ const columnsOf = (value, rows) => {
1804
+ if (isRecord2(value) && Array.isArray(value.columns)) {
1805
+ const named = value.columns.flatMap((column) => typeof column === "string" ? [column] : []);
1806
+ if (named.length > 0)
1807
+ return named;
1808
+ }
1809
+ const first = rows[0];
1810
+ return first === void 0 ? [] : Object.keys(first);
1811
+ };
1812
+ let selected = "";
1813
+ const loadPage = async (schema, name) => {
1814
+ selected = `${schema}.${name}`;
1815
+ const page = await api.get(`/sql/tables/${encodeURIComponent(schema)}/${encodeURIComponent(name)}?limit=50`);
1816
+ const rows = rowsOf(page);
1817
+ renderGrid(columnsOf(page, rows), rows);
1818
+ const total = isRecord2(page) && typeof page.total === "number" ? page.total : rows.length;
1819
+ result.textContent = `${selected} \xB7 ${total} rows`;
1820
+ for (const button of tables.querySelectorAll("button")) {
1821
+ if (!(button instanceof HTMLButtonElement))
1822
+ continue;
1823
+ button.setAttribute("aria-current", button.dataset.schema === schema && button.dataset.table === name ? "true" : "false");
1824
+ }
1825
+ };
1826
+ const loadTables = async () => {
1827
+ const payload = await api.get("/sql/tables");
1828
+ const listed = isRecord2(payload) && Array.isArray(payload.tables) ? payload.tables : [];
1829
+ tables.replaceChildren();
1830
+ if (listed.length === 0) {
1831
+ const empty = document.createElement("p");
1832
+ empty.className = "empty";
1833
+ empty.textContent = "No tables.";
1834
+ tables.append(empty);
1835
+ return;
1836
+ }
1837
+ for (const item of listed) {
1838
+ if (!isRecord2(item) || typeof item.schema !== "string" || typeof item.name !== "string")
1839
+ continue;
1840
+ const button = document.createElement("button");
1841
+ button.type = "button";
1842
+ button.dataset.schema = item.schema;
1843
+ button.dataset.table = item.name;
1844
+ button.textContent = `${item.schema}.${item.name}`;
1845
+ tables.append(button);
1846
+ }
1847
+ };
1848
+ tables.addEventListener("click", (event) => {
1849
+ const target = event.target;
1850
+ if (!(target instanceof Element))
1851
+ return;
1852
+ const button = target.closest("button");
1853
+ if (!(button instanceof HTMLButtonElement))
1854
+ return;
1855
+ const schema = button.dataset.schema;
1856
+ const name = button.dataset.table;
1857
+ if (schema === void 0 || name === void 0)
1858
+ return;
1859
+ clearError();
1860
+ loadPage(schema, name).catch(showError);
1861
+ });
1862
+ run.addEventListener("click", () => {
1863
+ const sql = input.value.trim();
1864
+ if (sql === "") {
1865
+ showError(new Error("Enter a statement"));
1866
+ return;
1867
+ }
1868
+ clearError();
1869
+ api.send("POST", "/sql/query", { sql }).then((payload) => {
1870
+ const rows = rowsOf(payload);
1871
+ renderGrid(columnsOf(payload, rows), rows);
1872
+ const count = isRecord2(payload) && typeof payload.rowCount === "number" ? payload.rowCount : rows.length;
1873
+ const truncated = isRecord2(payload) && payload.truncated === true ? " (truncated)" : "";
1874
+ result.textContent = `${count} rows${truncated}`;
1875
+ }).catch(showError);
1876
+ });
1877
+ const namespace = document.getElementById("namespace");
1878
+ if (namespace) {
1879
+ namespace.addEventListener("change", () => {
1880
+ clearError();
1881
+ loadTables().catch(showError);
1882
+ });
1883
+ }
1884
+ loadTables().catch(showError);
1885
+ }
1725
1886
  function bootAdmin(config) {
1726
1887
  const fieldKinds = ["string", "number", "boolean", "null", "object", "array", "unknown"];
1727
1888
  const sources = ["declared", "inferred", "mixed"];
@@ -2162,6 +2323,50 @@ function bootAdmin(config) {
2162
2323
  if (render)
2163
2324
  await render();
2164
2325
  }
2326
+ const delay = (ms) => new Promise((resolve) => {
2327
+ window.setTimeout(resolve, ms);
2328
+ });
2329
+ const confirmAction = async (button, pending, done, work) => {
2330
+ if (button.dataset.pending === "1")
2331
+ return;
2332
+ const label = button.textContent ?? "";
2333
+ const width = button.offsetWidth;
2334
+ button.dataset.pending = "1";
2335
+ button.classList.add("pressed");
2336
+ button.setAttribute("aria-busy", "true");
2337
+ button.style.minWidth = `${width}px`;
2338
+ button.textContent = pending;
2339
+ try {
2340
+ await work();
2341
+ button.textContent = done;
2342
+ await delay(1e3);
2343
+ } catch (error) {
2344
+ showError(error);
2345
+ } finally {
2346
+ button.textContent = label;
2347
+ button.style.minWidth = "";
2348
+ button.classList.remove("pressed");
2349
+ button.removeAttribute("aria-busy");
2350
+ delete button.dataset.pending;
2351
+ }
2352
+ };
2353
+ document.addEventListener("click", (event) => {
2354
+ const target = event.target;
2355
+ if (!(target instanceof Element))
2356
+ return;
2357
+ const button = target.closest("button");
2358
+ if (!(button instanceof HTMLButtonElement) || button.dataset.pending === "1")
2359
+ return;
2360
+ button.classList.add("pressed");
2361
+ const token = String(Date.now());
2362
+ button.dataset.press = token;
2363
+ window.setTimeout(() => {
2364
+ if (button.dataset.press !== token || button.dataset.pending === "1")
2365
+ return;
2366
+ button.classList.remove("pressed");
2367
+ delete button.dataset.press;
2368
+ }, 450);
2369
+ });
2165
2370
  el("namespace", HTMLSelectElement).addEventListener("change", () => {
2166
2371
  state.namespace = el("namespace", HTMLSelectElement).value;
2167
2372
  refresh().catch(showError);
@@ -2172,7 +2377,7 @@ function bootAdmin(config) {
2172
2377
  refresh().catch(showError);
2173
2378
  });
2174
2379
  el("refresh", HTMLButtonElement).addEventListener("click", () => {
2175
- refresh().catch(showError);
2380
+ confirmAction(el("refresh", HTMLButtonElement), "Refreshing...", "Updated", () => refresh()).catch(showError);
2176
2381
  });
2177
2382
  el("collections", HTMLElement).addEventListener("click", (event) => {
2178
2383
  const target = event.target;
@@ -2295,10 +2500,10 @@ function bootAdmin(config) {
2295
2500
  }).then(() => renderFaults()).catch(showError);
2296
2501
  });
2297
2502
  el("fault-clear", HTMLButtonElement).addEventListener("click", () => {
2298
- api("DELETE", "/faults").then(() => renderFaults()).catch(showError);
2503
+ confirmAction(el("fault-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/faults").then(() => renderFaults())).catch(showError);
2299
2504
  });
2300
2505
  el("journal-clear", HTMLButtonElement).addEventListener("click", () => {
2301
- api("DELETE", "/requests").then(() => renderJournal()).catch(showError);
2506
+ confirmAction(el("journal-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/requests").then(() => renderJournal())).catch(showError);
2302
2507
  });
2303
2508
  el("route-list", HTMLElement).addEventListener("click", (event) => {
2304
2509
  const target = event.target;
@@ -2354,6 +2559,22 @@ function bootAdmin(config) {
2354
2559
  panel.script = value.script;
2355
2560
  return panel;
2356
2561
  };
2562
+ const decodeExtension = (value) => {
2563
+ if (!isRecord2(value))
2564
+ return void 0;
2565
+ if (value.kind === "sql") {
2566
+ return {
2567
+ kind: "sql",
2568
+ id: typeof value.id === "string" && value.id !== "" ? value.id : "sql",
2569
+ title: typeof value.title === "string" && value.title !== "" ? value.title : "SQL",
2570
+ description: typeof value.description === "string" ? value.description : "Browse tables and run queries."
2571
+ };
2572
+ }
2573
+ if (value.kind !== "panel")
2574
+ return void 0;
2575
+ const panel = decodePanel(value);
2576
+ return panel === void 0 ? void 0 : { kind: "panel", ...panel };
2577
+ };
2357
2578
  const mountPanels = (panels) => {
2358
2579
  const nav = el("nav", HTMLElement);
2359
2580
  const views = el("views", HTMLElement);
@@ -2407,15 +2628,57 @@ function bootAdmin(config) {
2407
2628
  return decoded === void 0 ? [] : [decoded];
2408
2629
  });
2409
2630
  mountPanels(panels);
2631
+ const extensions = requireList(isRecord2(manifest) ? manifest.extensions : void 0, "Extensions").flatMap((extension) => {
2632
+ const decoded = decodeExtension(extension);
2633
+ return decoded === void 0 ? [] : [decoded];
2634
+ });
2635
+ const extensionPanels = extensions.flatMap((extension) => extension.kind === "panel" ? [extension] : []);
2636
+ mountPanels(extensionPanels);
2637
+ for (const extension of extensions) {
2638
+ if (extension.kind !== "sql")
2639
+ continue;
2640
+ const nav = el("nav", HTMLElement);
2641
+ const views = el("views", HTMLElement);
2642
+ const button = document.createElement("button");
2643
+ button.type = "button";
2644
+ button.dataset.view = extension.id;
2645
+ button.textContent = extension.title;
2646
+ nav.append(button);
2647
+ const section = document.createElement("section");
2648
+ section.className = "view";
2649
+ section.id = `view-${extension.id}`;
2650
+ section.hidden = true;
2651
+ const title = document.createElement("h2");
2652
+ title.textContent = extension.title;
2653
+ const lede = document.createElement("p");
2654
+ lede.className = "lede";
2655
+ lede.textContent = extension.description;
2656
+ const body = document.createElement("div");
2657
+ body.className = "panel-body";
2658
+ section.append(title, lede, body);
2659
+ views.append(section);
2660
+ mountSqlExplorer(body, panelApi);
2661
+ }
2410
2662
  return refresh();
2411
2663
  }).catch(showError);
2412
2664
  }
2413
- var clientPrelude = [isRecord2, mountAdminBrand, startAdminBrand, faultPresetList, bootAdmin].map((fn) => fn.toString()).join("\n");
2665
+ var clientPrelude = [
2666
+ isRecord2,
2667
+ mountAdminBrand,
2668
+ startAdminBrand,
2669
+ faultPresetList,
2670
+ mountSqlExplorer,
2671
+ bootAdmin
2672
+ ].map((fn) => fn.toString()).join("\n");
2414
2673
  var adminClientSource = (config) => {
2415
2674
  const payload = JSON.stringify(config).replace(/</g, "\\u003c");
2675
+ const entry = bootAdmin.name;
2676
+ if (!/^[A-Za-z_$][\w$]*$/.test(entry)) {
2677
+ throw new Error("admin client cannot call its boot function");
2678
+ }
2416
2679
  return `<script>
2417
2680
  ${clientPrelude}
2418
- bootAdmin(${payload});
2681
+ ${entry}(${payload});
2419
2682
  </script>`;
2420
2683
  };
2421
2684
 
@@ -2456,19 +2719,33 @@ var STANDARD_ADMIN_ROUTES = [
2456
2719
  "GET /ui/manifest"
2457
2720
  ];
2458
2721
  var PANEL_ID = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
2722
+ var RESERVED_VIEWS = /* @__PURE__ */ new Set(["overview", "state", "clock", "faults", "journal", "routes"]);
2723
+ var checkPanel = (panel, seen, label) => {
2724
+ if (!PANEL_ID.test(panel.id)) {
2725
+ throw new RangeError(`${label} id must match ${PANEL_ID}: ${JSON.stringify(panel.id)}`);
2726
+ }
2727
+ if (RESERVED_VIEWS.has(panel.id)) {
2728
+ throw new RangeError(`${label} id ${panel.id} is reserved by the admin shell`);
2729
+ }
2730
+ if (seen.has(panel.id))
2731
+ throw new RangeError(`duplicate admin view id ${panel.id}`);
2732
+ seen.add(panel.id);
2733
+ if (panel.title.trim() === "")
2734
+ throw new RangeError(`${label} ${panel.id} needs a title`);
2735
+ };
2459
2736
  var assertAdminUi = (ui) => {
2460
- if (!ui?.panels)
2737
+ if (!ui)
2461
2738
  return;
2462
2739
  const seen = /* @__PURE__ */ new Set();
2463
- for (const panel of ui.panels) {
2464
- if (!PANEL_ID.test(panel.id)) {
2465
- throw new RangeError(`admin panel id must match ${PANEL_ID}: ${JSON.stringify(panel.id)}`);
2740
+ for (const panel of ui.panels ?? [])
2741
+ checkPanel(panel, seen, "admin panel");
2742
+ for (const extension of ui.extensions ?? []) {
2743
+ if (extension.kind === "panel") {
2744
+ checkPanel(extension, seen, "admin extension");
2745
+ continue;
2466
2746
  }
2467
- if (seen.has(panel.id))
2468
- throw new RangeError(`duplicate admin panel id ${panel.id}`);
2469
- seen.add(panel.id);
2470
- if (panel.title.trim() === "")
2471
- throw new RangeError(`admin panel ${panel.id} needs a title`);
2747
+ const id = extension.id ?? "sql";
2748
+ checkPanel({ id, title: extension.title ?? "SQL" }, seen, "admin extension");
2472
2749
  }
2473
2750
  };
2474
2751
 
@@ -2629,9 +2906,24 @@ var renderAdminDocument = (service) => {
2629
2906
  .controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
2630
2907
  label.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--faint); }
2631
2908
  label.field input, label.field select, .controls input[type="password"] {
2632
- background: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
2633
- padding: 7px 8px; min-height: 36px;
2634
- }
2909
+ background-color: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
2910
+ padding: 7px 8px; min-height: 36px; line-height: 1.2;
2911
+ }
2912
+ /* A native menu ignores min-height, so Preset rendered about half as tall as
2913
+ the text fields in the same form. Paint it like those fields. */
2914
+ label.field select {
2915
+ -webkit-appearance: none; appearance: none;
2916
+ padding-right: 28px;
2917
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%2371717a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4.5 6 8l3.5-3.5'/%3E%3C/svg%3E");
2918
+ background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
2919
+ }
2920
+ .stack > .field > input,
2921
+ .stack > .field > select,
2922
+ .stack > .field > textarea,
2923
+ dialog .field > input,
2924
+ dialog .field > select,
2925
+ dialog .field > textarea { width: 100%; }
2926
+ .icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger, nav.side button { cursor: pointer; }
2635
2927
  .icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger {
2636
2928
  border-radius: 9px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
2637
2929
  background: var(--bg-elev);
@@ -2639,6 +2931,14 @@ var renderAdminDocument = (service) => {
2639
2931
  .btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
2640
2932
  .btn-quiet { background: transparent; }
2641
2933
  .btn-danger { color: var(--err); }
2934
+ /* Held after mouseup. Clearing an empty journal changes nothing on screen,
2935
+ so the press itself has to stay visible. */
2936
+ .icon-btn:active, .btn:active, .btn-quiet:active, .btn-danger:active, nav.side button:active,
2937
+ .icon-btn.pressed, .btn.pressed, .btn-quiet.pressed, .btn-danger.pressed, nav.side button.pressed {
2938
+ background: var(--bg-inset); border-color: var(--line-strong); color: var(--ink);
2939
+ }
2940
+ .btn-danger:active, .btn-danger.pressed { background: var(--err-soft); color: var(--err); }
2941
+ .btn-primary:active, .btn-primary.pressed { filter: brightness(0.88); color: var(--accent-ink); }
2642
2942
  /* minmax(0, 1fr): a 1fr column will not shrink below its content, so a long
2643
2943
  record or the full nav row would widen the page past the viewport. */
2644
2944
  .layout {
@@ -2679,6 +2979,12 @@ var renderAdminDocument = (service) => {
2679
2979
  border-radius: 999px; padding: 4px 8px;
2680
2980
  }
2681
2981
  .chip i { color: var(--faint); font-style: normal; }
2982
+ .sql-layout {
2983
+ display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 16px;
2984
+ }
2985
+ .sql-tables { display: flex; flex-direction: column; gap: 4px; max-height: 28rem; overflow: auto; }
2986
+ .sql-tables button { text-align: left; }
2987
+ .sql-input { font-family: var(--mono); min-height: 7rem; width: 100%; }
2682
2988
  table { width: 100%; border-collapse: collapse; font-size: 14px; }
2683
2989
  th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
2684
2990
  th { color: var(--faint); font-weight: 600; font-size: 12px; }
@@ -2727,14 +3033,22 @@ var renderAdminDocument = (service) => {
2727
3033
  input, select, textarea { font-size: 16px; }
2728
3034
  .brand, .vendor, .controls { width: 100%; }
2729
3035
  label.field, label.field select, label.field input { flex: 1; min-width: 0; }
2730
- .layout { grid-template-columns: minmax(0, 1fr); }
3036
+ /* The layout fills the screen. A single-column grid stretches every auto
3037
+ row, so the tab bar grew with the leftover height and the buttons floated
3038
+ in the middle of it. The bar stays one row; the page below takes the rest. */
3039
+ .layout {
3040
+ grid-template-columns: minmax(0, 1fr);
3041
+ grid-template-rows: auto minmax(0, 1fr);
3042
+ align-content: start;
3043
+ }
2731
3044
  nav.side {
3045
+ align-self: start; height: auto;
2732
3046
  flex-direction: row; align-items: center; overflow-x: auto; min-width: 0;
2733
3047
  border-right: 0; border-bottom: 1px solid var(--line);
2734
3048
  padding: 8px;
2735
3049
  }
2736
3050
  nav.side button { white-space: nowrap; flex: none; }
2737
- .split { grid-template-columns: minmax(0, 1fr); }
3051
+ .split, .sql-layout { grid-template-columns: minmax(0, 1fr); }
2738
3052
  main { padding: 14px; }
2739
3053
  table, thead, tbody, tr, th, td { display: block; }
2740
3054
  thead { display: none; }
@@ -2905,6 +3219,24 @@ var json3 = (body) => new Response(JSON.stringify(body), {
2905
3219
  status: 200,
2906
3220
  headers: { "content-type": "application/json; charset=utf-8" }
2907
3221
  });
3222
+ var describeExtension = (extension) => {
3223
+ if (extension.kind === "sql") {
3224
+ return {
3225
+ kind: "sql",
3226
+ id: extension.id ?? "sql",
3227
+ title: extension.title ?? "SQL",
3228
+ ...extension.description !== void 0 ? { description: extension.description } : {}
3229
+ };
3230
+ }
3231
+ return {
3232
+ kind: "panel",
3233
+ id: extension.id,
3234
+ title: extension.title,
3235
+ ...extension.description !== void 0 ? { description: extension.description } : {},
3236
+ html: extension.html,
3237
+ ...extension.script !== void 0 ? { script: extension.script } : {}
3238
+ };
3239
+ };
2908
3240
  var adminUiRoutes = (service, ui) => {
2909
3241
  const shell = () => renderAdminDocument(service);
2910
3242
  const document3 = () => ui?.render ? ui.render({ service, defaultHtml: shell }) : shell();
@@ -2919,7 +3251,8 @@ var adminUiRoutes = (service, ui) => {
2919
3251
  ...panel.description !== void 0 ? { description: panel.description } : {},
2920
3252
  html: panel.html,
2921
3253
  ...panel.script !== void 0 ? { script: panel.script } : {}
2922
- }))
3254
+ })),
3255
+ extensions: (ui?.extensions ?? []).map(describeExtension)
2923
3256
  })
2924
3257
  };
2925
3258
  };
@@ -3522,7 +3855,7 @@ var stateAdminRoutes = (routes) => {
3522
3855
  };
3523
3856
 
3524
3857
  // ../core/dist/version.js
3525
- var PACKAGE_VERSION = true ? "1.6.0" : UNRELEASED_VERSION;
3858
+ var PACKAGE_VERSION = true ? "1.7.0" : UNRELEASED_VERSION;
3526
3859
 
3527
3860
  // ../core/dist/webhooks.js
3528
3861
  var json5 = (status, body) => new Response(JSON.stringify(body), { status, headers: { "content-type": "application/json" } });
@@ -5352,4 +5685,4 @@ export {
5352
5685
  slackCredential,
5353
5686
  SlackAPI
5354
5687
  };
5355
- //# sourceMappingURL=chunk-XNPGYYVE.js.map
5688
+ //# sourceMappingURL=chunk-E47OMSFP.js.map