@crvouga/mockingbird-service-twilio 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-twilio
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
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createRuntime
3
- } from "./chunk-VV4XROZJ.js";
3
+ } from "./chunk-SFDNKUJT.js";
4
4
 
5
5
  // ../../adapters/node/dist/cli.js
6
6
  import { readFile } from "node:fs/promises";
@@ -389,4 +389,4 @@ export {
389
389
  createServer2 as createServer,
390
390
  serveTarget
391
391
  };
392
- //# sourceMappingURL=chunk-5CN3JESR.js.map
392
+ //# sourceMappingURL=chunk-FRUWVNJV.js.map
@@ -1752,6 +1752,167 @@ function faultPresetList(value) {
1752
1752
  })
1753
1753
  };
1754
1754
  }
1755
+ function mountSqlExplorer(root, api) {
1756
+ const cell = (value) => {
1757
+ if (value === null || value === void 0)
1758
+ return "";
1759
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
1760
+ return String(value);
1761
+ }
1762
+ return JSON.stringify(value) ?? "";
1763
+ };
1764
+ root.replaceChildren();
1765
+ const layout = document.createElement("div");
1766
+ layout.className = "sql-layout";
1767
+ const tables = document.createElement("div");
1768
+ tables.className = "sql-tables";
1769
+ const stack = document.createElement("div");
1770
+ stack.className = "stack";
1771
+ const banner = document.createElement("p");
1772
+ banner.className = "banner";
1773
+ const grid = document.createElement("div");
1774
+ const input = document.createElement("textarea");
1775
+ input.className = "sql-input";
1776
+ input.spellcheck = false;
1777
+ input.placeholder = "SELECT * FROM ...";
1778
+ const actions = document.createElement("div");
1779
+ actions.className = "row-actions";
1780
+ const run = document.createElement("button");
1781
+ run.type = "button";
1782
+ run.textContent = "Run";
1783
+ actions.append(run);
1784
+ const result = document.createElement("pre");
1785
+ stack.append(banner, grid, input, actions, result);
1786
+ layout.append(tables, stack);
1787
+ root.append(layout);
1788
+ const showError = (error) => {
1789
+ banner.textContent = error instanceof Error ? error.message : String(error);
1790
+ banner.classList.add("show");
1791
+ };
1792
+ const clearError = () => {
1793
+ banner.textContent = "";
1794
+ banner.classList.remove("show");
1795
+ };
1796
+ const renderGrid = (columns, rows) => {
1797
+ grid.replaceChildren();
1798
+ if (columns.length === 0) {
1799
+ const empty = document.createElement("p");
1800
+ empty.className = "empty";
1801
+ empty.textContent = "No rows.";
1802
+ grid.append(empty);
1803
+ return;
1804
+ }
1805
+ const table = document.createElement("table");
1806
+ const head = document.createElement("thead");
1807
+ const headRow = document.createElement("tr");
1808
+ for (const column of columns) {
1809
+ const th = document.createElement("th");
1810
+ th.textContent = column;
1811
+ headRow.append(th);
1812
+ }
1813
+ head.append(headRow);
1814
+ const body = document.createElement("tbody");
1815
+ for (const row of rows) {
1816
+ const tr = document.createElement("tr");
1817
+ for (const column of columns) {
1818
+ const td = document.createElement("td");
1819
+ td.dataset.label = column;
1820
+ td.textContent = cell(row[column]);
1821
+ tr.append(td);
1822
+ }
1823
+ body.append(tr);
1824
+ }
1825
+ table.append(head, body);
1826
+ grid.append(table);
1827
+ };
1828
+ const rowsOf = (value) => {
1829
+ if (!isRecord2(value) || !Array.isArray(value.rows))
1830
+ return [];
1831
+ return value.rows.flatMap((row) => isRecord2(row) ? [row] : []);
1832
+ };
1833
+ const columnsOf = (value, rows) => {
1834
+ if (isRecord2(value) && Array.isArray(value.columns)) {
1835
+ const named = value.columns.flatMap((column) => typeof column === "string" ? [column] : []);
1836
+ if (named.length > 0)
1837
+ return named;
1838
+ }
1839
+ const first = rows[0];
1840
+ return first === void 0 ? [] : Object.keys(first);
1841
+ };
1842
+ let selected = "";
1843
+ const loadPage = async (schema, name) => {
1844
+ selected = `${schema}.${name}`;
1845
+ const page = await api.get(`/sql/tables/${encodeURIComponent(schema)}/${encodeURIComponent(name)}?limit=50`);
1846
+ const rows = rowsOf(page);
1847
+ renderGrid(columnsOf(page, rows), rows);
1848
+ const total = isRecord2(page) && typeof page.total === "number" ? page.total : rows.length;
1849
+ result.textContent = `${selected} \xB7 ${total} rows`;
1850
+ for (const button of tables.querySelectorAll("button")) {
1851
+ if (!(button instanceof HTMLButtonElement))
1852
+ continue;
1853
+ button.setAttribute("aria-current", button.dataset.schema === schema && button.dataset.table === name ? "true" : "false");
1854
+ }
1855
+ };
1856
+ const loadTables = async () => {
1857
+ const payload = await api.get("/sql/tables");
1858
+ const listed = isRecord2(payload) && Array.isArray(payload.tables) ? payload.tables : [];
1859
+ tables.replaceChildren();
1860
+ if (listed.length === 0) {
1861
+ const empty = document.createElement("p");
1862
+ empty.className = "empty";
1863
+ empty.textContent = "No tables.";
1864
+ tables.append(empty);
1865
+ return;
1866
+ }
1867
+ for (const item of listed) {
1868
+ if (!isRecord2(item) || typeof item.schema !== "string" || typeof item.name !== "string")
1869
+ continue;
1870
+ const button = document.createElement("button");
1871
+ button.type = "button";
1872
+ button.dataset.schema = item.schema;
1873
+ button.dataset.table = item.name;
1874
+ button.textContent = `${item.schema}.${item.name}`;
1875
+ tables.append(button);
1876
+ }
1877
+ };
1878
+ tables.addEventListener("click", (event) => {
1879
+ const target = event.target;
1880
+ if (!(target instanceof Element))
1881
+ return;
1882
+ const button = target.closest("button");
1883
+ if (!(button instanceof HTMLButtonElement))
1884
+ return;
1885
+ const schema = button.dataset.schema;
1886
+ const name = button.dataset.table;
1887
+ if (schema === void 0 || name === void 0)
1888
+ return;
1889
+ clearError();
1890
+ loadPage(schema, name).catch(showError);
1891
+ });
1892
+ run.addEventListener("click", () => {
1893
+ const sql = input.value.trim();
1894
+ if (sql === "") {
1895
+ showError(new Error("Enter a statement"));
1896
+ return;
1897
+ }
1898
+ clearError();
1899
+ api.send("POST", "/sql/query", { sql }).then((payload) => {
1900
+ const rows = rowsOf(payload);
1901
+ renderGrid(columnsOf(payload, rows), rows);
1902
+ const count = isRecord2(payload) && typeof payload.rowCount === "number" ? payload.rowCount : rows.length;
1903
+ const truncated = isRecord2(payload) && payload.truncated === true ? " (truncated)" : "";
1904
+ result.textContent = `${count} rows${truncated}`;
1905
+ }).catch(showError);
1906
+ });
1907
+ const namespace = document.getElementById("namespace");
1908
+ if (namespace) {
1909
+ namespace.addEventListener("change", () => {
1910
+ clearError();
1911
+ loadTables().catch(showError);
1912
+ });
1913
+ }
1914
+ loadTables().catch(showError);
1915
+ }
1755
1916
  function bootAdmin(config) {
1756
1917
  const fieldKinds = ["string", "number", "boolean", "null", "object", "array", "unknown"];
1757
1918
  const sources = ["declared", "inferred", "mixed"];
@@ -2192,6 +2353,50 @@ function bootAdmin(config) {
2192
2353
  if (render)
2193
2354
  await render();
2194
2355
  }
2356
+ const delay = (ms) => new Promise((resolve) => {
2357
+ window.setTimeout(resolve, ms);
2358
+ });
2359
+ const confirmAction = async (button, pending, done, work) => {
2360
+ if (button.dataset.pending === "1")
2361
+ return;
2362
+ const label = button.textContent ?? "";
2363
+ const width = button.offsetWidth;
2364
+ button.dataset.pending = "1";
2365
+ button.classList.add("pressed");
2366
+ button.setAttribute("aria-busy", "true");
2367
+ button.style.minWidth = `${width}px`;
2368
+ button.textContent = pending;
2369
+ try {
2370
+ await work();
2371
+ button.textContent = done;
2372
+ await delay(1e3);
2373
+ } catch (error) {
2374
+ showError(error);
2375
+ } finally {
2376
+ button.textContent = label;
2377
+ button.style.minWidth = "";
2378
+ button.classList.remove("pressed");
2379
+ button.removeAttribute("aria-busy");
2380
+ delete button.dataset.pending;
2381
+ }
2382
+ };
2383
+ document.addEventListener("click", (event) => {
2384
+ const target = event.target;
2385
+ if (!(target instanceof Element))
2386
+ return;
2387
+ const button = target.closest("button");
2388
+ if (!(button instanceof HTMLButtonElement) || button.dataset.pending === "1")
2389
+ return;
2390
+ button.classList.add("pressed");
2391
+ const token = String(Date.now());
2392
+ button.dataset.press = token;
2393
+ window.setTimeout(() => {
2394
+ if (button.dataset.press !== token || button.dataset.pending === "1")
2395
+ return;
2396
+ button.classList.remove("pressed");
2397
+ delete button.dataset.press;
2398
+ }, 450);
2399
+ });
2195
2400
  el("namespace", HTMLSelectElement).addEventListener("change", () => {
2196
2401
  state.namespace = el("namespace", HTMLSelectElement).value;
2197
2402
  refresh().catch(showError);
@@ -2202,7 +2407,7 @@ function bootAdmin(config) {
2202
2407
  refresh().catch(showError);
2203
2408
  });
2204
2409
  el("refresh", HTMLButtonElement).addEventListener("click", () => {
2205
- refresh().catch(showError);
2410
+ confirmAction(el("refresh", HTMLButtonElement), "Refreshing...", "Updated", () => refresh()).catch(showError);
2206
2411
  });
2207
2412
  el("collections", HTMLElement).addEventListener("click", (event) => {
2208
2413
  const target = event.target;
@@ -2325,10 +2530,10 @@ function bootAdmin(config) {
2325
2530
  }).then(() => renderFaults()).catch(showError);
2326
2531
  });
2327
2532
  el("fault-clear", HTMLButtonElement).addEventListener("click", () => {
2328
- api("DELETE", "/faults").then(() => renderFaults()).catch(showError);
2533
+ confirmAction(el("fault-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/faults").then(() => renderFaults())).catch(showError);
2329
2534
  });
2330
2535
  el("journal-clear", HTMLButtonElement).addEventListener("click", () => {
2331
- api("DELETE", "/requests").then(() => renderJournal()).catch(showError);
2536
+ confirmAction(el("journal-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/requests").then(() => renderJournal())).catch(showError);
2332
2537
  });
2333
2538
  el("route-list", HTMLElement).addEventListener("click", (event) => {
2334
2539
  const target = event.target;
@@ -2384,6 +2589,22 @@ function bootAdmin(config) {
2384
2589
  panel.script = value.script;
2385
2590
  return panel;
2386
2591
  };
2592
+ const decodeExtension = (value) => {
2593
+ if (!isRecord2(value))
2594
+ return void 0;
2595
+ if (value.kind === "sql") {
2596
+ return {
2597
+ kind: "sql",
2598
+ id: typeof value.id === "string" && value.id !== "" ? value.id : "sql",
2599
+ title: typeof value.title === "string" && value.title !== "" ? value.title : "SQL",
2600
+ description: typeof value.description === "string" ? value.description : "Browse tables and run queries."
2601
+ };
2602
+ }
2603
+ if (value.kind !== "panel")
2604
+ return void 0;
2605
+ const panel = decodePanel(value);
2606
+ return panel === void 0 ? void 0 : { kind: "panel", ...panel };
2607
+ };
2387
2608
  const mountPanels = (panels) => {
2388
2609
  const nav = el("nav", HTMLElement);
2389
2610
  const views = el("views", HTMLElement);
@@ -2437,15 +2658,57 @@ function bootAdmin(config) {
2437
2658
  return decoded === void 0 ? [] : [decoded];
2438
2659
  });
2439
2660
  mountPanels(panels);
2661
+ const extensions = requireList(isRecord2(manifest) ? manifest.extensions : void 0, "Extensions").flatMap((extension) => {
2662
+ const decoded = decodeExtension(extension);
2663
+ return decoded === void 0 ? [] : [decoded];
2664
+ });
2665
+ const extensionPanels = extensions.flatMap((extension) => extension.kind === "panel" ? [extension] : []);
2666
+ mountPanels(extensionPanels);
2667
+ for (const extension of extensions) {
2668
+ if (extension.kind !== "sql")
2669
+ continue;
2670
+ const nav = el("nav", HTMLElement);
2671
+ const views = el("views", HTMLElement);
2672
+ const button = document.createElement("button");
2673
+ button.type = "button";
2674
+ button.dataset.view = extension.id;
2675
+ button.textContent = extension.title;
2676
+ nav.append(button);
2677
+ const section = document.createElement("section");
2678
+ section.className = "view";
2679
+ section.id = `view-${extension.id}`;
2680
+ section.hidden = true;
2681
+ const title = document.createElement("h2");
2682
+ title.textContent = extension.title;
2683
+ const lede = document.createElement("p");
2684
+ lede.className = "lede";
2685
+ lede.textContent = extension.description;
2686
+ const body = document.createElement("div");
2687
+ body.className = "panel-body";
2688
+ section.append(title, lede, body);
2689
+ views.append(section);
2690
+ mountSqlExplorer(body, panelApi);
2691
+ }
2440
2692
  return refresh();
2441
2693
  }).catch(showError);
2442
2694
  }
2443
- var clientPrelude = [isRecord2, mountAdminBrand, startAdminBrand, faultPresetList, bootAdmin].map((fn) => fn.toString()).join("\n");
2695
+ var clientPrelude = [
2696
+ isRecord2,
2697
+ mountAdminBrand,
2698
+ startAdminBrand,
2699
+ faultPresetList,
2700
+ mountSqlExplorer,
2701
+ bootAdmin
2702
+ ].map((fn) => fn.toString()).join("\n");
2444
2703
  var adminClientSource = (config) => {
2445
2704
  const payload = JSON.stringify(config).replace(/</g, "\\u003c");
2705
+ const entry = bootAdmin.name;
2706
+ if (!/^[A-Za-z_$][\w$]*$/.test(entry)) {
2707
+ throw new Error("admin client cannot call its boot function");
2708
+ }
2446
2709
  return `<script>
2447
2710
  ${clientPrelude}
2448
- bootAdmin(${payload});
2711
+ ${entry}(${payload});
2449
2712
  </script>`;
2450
2713
  };
2451
2714
 
@@ -2486,19 +2749,33 @@ var STANDARD_ADMIN_ROUTES = [
2486
2749
  "GET /ui/manifest"
2487
2750
  ];
2488
2751
  var PANEL_ID = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
2752
+ var RESERVED_VIEWS = /* @__PURE__ */ new Set(["overview", "state", "clock", "faults", "journal", "routes"]);
2753
+ var checkPanel = (panel, seen, label) => {
2754
+ if (!PANEL_ID.test(panel.id)) {
2755
+ throw new RangeError(`${label} id must match ${PANEL_ID}: ${JSON.stringify(panel.id)}`);
2756
+ }
2757
+ if (RESERVED_VIEWS.has(panel.id)) {
2758
+ throw new RangeError(`${label} id ${panel.id} is reserved by the admin shell`);
2759
+ }
2760
+ if (seen.has(panel.id))
2761
+ throw new RangeError(`duplicate admin view id ${panel.id}`);
2762
+ seen.add(panel.id);
2763
+ if (panel.title.trim() === "")
2764
+ throw new RangeError(`${label} ${panel.id} needs a title`);
2765
+ };
2489
2766
  var assertAdminUi = (ui) => {
2490
- if (!ui?.panels)
2767
+ if (!ui)
2491
2768
  return;
2492
2769
  const seen = /* @__PURE__ */ new Set();
2493
- for (const panel of ui.panels) {
2494
- if (!PANEL_ID.test(panel.id)) {
2495
- throw new RangeError(`admin panel id must match ${PANEL_ID}: ${JSON.stringify(panel.id)}`);
2770
+ for (const panel of ui.panels ?? [])
2771
+ checkPanel(panel, seen, "admin panel");
2772
+ for (const extension of ui.extensions ?? []) {
2773
+ if (extension.kind === "panel") {
2774
+ checkPanel(extension, seen, "admin extension");
2775
+ continue;
2496
2776
  }
2497
- if (seen.has(panel.id))
2498
- throw new RangeError(`duplicate admin panel id ${panel.id}`);
2499
- seen.add(panel.id);
2500
- if (panel.title.trim() === "")
2501
- throw new RangeError(`admin panel ${panel.id} needs a title`);
2777
+ const id = extension.id ?? "sql";
2778
+ checkPanel({ id, title: extension.title ?? "SQL" }, seen, "admin extension");
2502
2779
  }
2503
2780
  };
2504
2781
 
@@ -2659,9 +2936,24 @@ var renderAdminDocument = (service) => {
2659
2936
  .controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
2660
2937
  label.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--faint); }
2661
2938
  label.field input, label.field select, .controls input[type="password"] {
2662
- background: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
2663
- padding: 7px 8px; min-height: 36px;
2664
- }
2939
+ background-color: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
2940
+ padding: 7px 8px; min-height: 36px; line-height: 1.2;
2941
+ }
2942
+ /* A native menu ignores min-height, so Preset rendered about half as tall as
2943
+ the text fields in the same form. Paint it like those fields. */
2944
+ label.field select {
2945
+ -webkit-appearance: none; appearance: none;
2946
+ padding-right: 28px;
2947
+ 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");
2948
+ background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
2949
+ }
2950
+ .stack > .field > input,
2951
+ .stack > .field > select,
2952
+ .stack > .field > textarea,
2953
+ dialog .field > input,
2954
+ dialog .field > select,
2955
+ dialog .field > textarea { width: 100%; }
2956
+ .icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger, nav.side button { cursor: pointer; }
2665
2957
  .icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger {
2666
2958
  border-radius: 9px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
2667
2959
  background: var(--bg-elev);
@@ -2669,6 +2961,14 @@ var renderAdminDocument = (service) => {
2669
2961
  .btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
2670
2962
  .btn-quiet { background: transparent; }
2671
2963
  .btn-danger { color: var(--err); }
2964
+ /* Held after mouseup. Clearing an empty journal changes nothing on screen,
2965
+ so the press itself has to stay visible. */
2966
+ .icon-btn:active, .btn:active, .btn-quiet:active, .btn-danger:active, nav.side button:active,
2967
+ .icon-btn.pressed, .btn.pressed, .btn-quiet.pressed, .btn-danger.pressed, nav.side button.pressed {
2968
+ background: var(--bg-inset); border-color: var(--line-strong); color: var(--ink);
2969
+ }
2970
+ .btn-danger:active, .btn-danger.pressed { background: var(--err-soft); color: var(--err); }
2971
+ .btn-primary:active, .btn-primary.pressed { filter: brightness(0.88); color: var(--accent-ink); }
2672
2972
  /* minmax(0, 1fr): a 1fr column will not shrink below its content, so a long
2673
2973
  record or the full nav row would widen the page past the viewport. */
2674
2974
  .layout {
@@ -2709,6 +3009,12 @@ var renderAdminDocument = (service) => {
2709
3009
  border-radius: 999px; padding: 4px 8px;
2710
3010
  }
2711
3011
  .chip i { color: var(--faint); font-style: normal; }
3012
+ .sql-layout {
3013
+ display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 16px;
3014
+ }
3015
+ .sql-tables { display: flex; flex-direction: column; gap: 4px; max-height: 28rem; overflow: auto; }
3016
+ .sql-tables button { text-align: left; }
3017
+ .sql-input { font-family: var(--mono); min-height: 7rem; width: 100%; }
2712
3018
  table { width: 100%; border-collapse: collapse; font-size: 14px; }
2713
3019
  th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
2714
3020
  th { color: var(--faint); font-weight: 600; font-size: 12px; }
@@ -2757,14 +3063,22 @@ var renderAdminDocument = (service) => {
2757
3063
  input, select, textarea { font-size: 16px; }
2758
3064
  .brand, .vendor, .controls { width: 100%; }
2759
3065
  label.field, label.field select, label.field input { flex: 1; min-width: 0; }
2760
- .layout { grid-template-columns: minmax(0, 1fr); }
3066
+ /* The layout fills the screen. A single-column grid stretches every auto
3067
+ row, so the tab bar grew with the leftover height and the buttons floated
3068
+ in the middle of it. The bar stays one row; the page below takes the rest. */
3069
+ .layout {
3070
+ grid-template-columns: minmax(0, 1fr);
3071
+ grid-template-rows: auto minmax(0, 1fr);
3072
+ align-content: start;
3073
+ }
2761
3074
  nav.side {
3075
+ align-self: start; height: auto;
2762
3076
  flex-direction: row; align-items: center; overflow-x: auto; min-width: 0;
2763
3077
  border-right: 0; border-bottom: 1px solid var(--line);
2764
3078
  padding: 8px;
2765
3079
  }
2766
3080
  nav.side button { white-space: nowrap; flex: none; }
2767
- .split { grid-template-columns: minmax(0, 1fr); }
3081
+ .split, .sql-layout { grid-template-columns: minmax(0, 1fr); }
2768
3082
  main { padding: 14px; }
2769
3083
  table, thead, tbody, tr, th, td { display: block; }
2770
3084
  thead { display: none; }
@@ -2935,6 +3249,24 @@ var json3 = (body) => new Response(JSON.stringify(body), {
2935
3249
  status: 200,
2936
3250
  headers: { "content-type": "application/json; charset=utf-8" }
2937
3251
  });
3252
+ var describeExtension = (extension) => {
3253
+ if (extension.kind === "sql") {
3254
+ return {
3255
+ kind: "sql",
3256
+ id: extension.id ?? "sql",
3257
+ title: extension.title ?? "SQL",
3258
+ ...extension.description !== void 0 ? { description: extension.description } : {}
3259
+ };
3260
+ }
3261
+ return {
3262
+ kind: "panel",
3263
+ id: extension.id,
3264
+ title: extension.title,
3265
+ ...extension.description !== void 0 ? { description: extension.description } : {},
3266
+ html: extension.html,
3267
+ ...extension.script !== void 0 ? { script: extension.script } : {}
3268
+ };
3269
+ };
2938
3270
  var adminUiRoutes = (service, ui) => {
2939
3271
  const shell = () => renderAdminDocument(service);
2940
3272
  const document3 = () => ui?.render ? ui.render({ service, defaultHtml: shell }) : shell();
@@ -2949,7 +3281,8 @@ var adminUiRoutes = (service, ui) => {
2949
3281
  ...panel.description !== void 0 ? { description: panel.description } : {},
2950
3282
  html: panel.html,
2951
3283
  ...panel.script !== void 0 ? { script: panel.script } : {}
2952
- }))
3284
+ })),
3285
+ extensions: (ui?.extensions ?? []).map(describeExtension)
2953
3286
  })
2954
3287
  };
2955
3288
  };
@@ -3552,7 +3885,7 @@ var stateAdminRoutes = (routes) => {
3552
3885
  };
3553
3886
 
3554
3887
  // ../core/dist/version.js
3555
- var PACKAGE_VERSION = true ? "1.6.0" : UNRELEASED_VERSION;
3888
+ var PACKAGE_VERSION = true ? "1.7.0" : UNRELEASED_VERSION;
3556
3889
 
3557
3890
  // ../core/dist/signing.js
3558
3891
  var encoder = new TextEncoder();
@@ -5906,4 +6239,4 @@ export {
5906
6239
  twilioError,
5907
6240
  TwilioAPI
5908
6241
  };
5909
- //# sourceMappingURL=chunk-VV4XROZJ.js.map
6242
+ //# sourceMappingURL=chunk-SFDNKUJT.js.map