@crvouga/mockingbird-service-intercom 1.7.0 → 1.8.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-intercom
2
2
 
3
- ## 1.7.0 (2026-09-30)
3
+ ## 1.8.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.7.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.7.0 (2026-09-29)
4
22
 
5
23
  ### Features
6
24
 
@@ -1973,6 +1973,167 @@ function faultPresetList(value) {
1973
1973
  })
1974
1974
  };
1975
1975
  }
1976
+ function mountSqlExplorer(root, api) {
1977
+ const cell = (value) => {
1978
+ if (value === null || value === void 0)
1979
+ return "";
1980
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
1981
+ return String(value);
1982
+ }
1983
+ return JSON.stringify(value) ?? "";
1984
+ };
1985
+ root.replaceChildren();
1986
+ const layout = document.createElement("div");
1987
+ layout.className = "sql-layout";
1988
+ const tables = document.createElement("div");
1989
+ tables.className = "sql-tables";
1990
+ const stack = document.createElement("div");
1991
+ stack.className = "stack";
1992
+ const banner = document.createElement("p");
1993
+ banner.className = "banner";
1994
+ const grid = document.createElement("div");
1995
+ const input = document.createElement("textarea");
1996
+ input.className = "sql-input";
1997
+ input.spellcheck = false;
1998
+ input.placeholder = "SELECT * FROM ...";
1999
+ const actions = document.createElement("div");
2000
+ actions.className = "row-actions";
2001
+ const run = document.createElement("button");
2002
+ run.type = "button";
2003
+ run.textContent = "Run";
2004
+ actions.append(run);
2005
+ const result = document.createElement("pre");
2006
+ stack.append(banner, grid, input, actions, result);
2007
+ layout.append(tables, stack);
2008
+ root.append(layout);
2009
+ const showError = (error) => {
2010
+ banner.textContent = error instanceof Error ? error.message : String(error);
2011
+ banner.classList.add("show");
2012
+ };
2013
+ const clearError = () => {
2014
+ banner.textContent = "";
2015
+ banner.classList.remove("show");
2016
+ };
2017
+ const renderGrid = (columns, rows) => {
2018
+ grid.replaceChildren();
2019
+ if (columns.length === 0) {
2020
+ const empty = document.createElement("p");
2021
+ empty.className = "empty";
2022
+ empty.textContent = "No rows.";
2023
+ grid.append(empty);
2024
+ return;
2025
+ }
2026
+ const table = document.createElement("table");
2027
+ const head = document.createElement("thead");
2028
+ const headRow = document.createElement("tr");
2029
+ for (const column of columns) {
2030
+ const th = document.createElement("th");
2031
+ th.textContent = column;
2032
+ headRow.append(th);
2033
+ }
2034
+ head.append(headRow);
2035
+ const body = document.createElement("tbody");
2036
+ for (const row of rows) {
2037
+ const tr = document.createElement("tr");
2038
+ for (const column of columns) {
2039
+ const td = document.createElement("td");
2040
+ td.dataset.label = column;
2041
+ td.textContent = cell(row[column]);
2042
+ tr.append(td);
2043
+ }
2044
+ body.append(tr);
2045
+ }
2046
+ table.append(head, body);
2047
+ grid.append(table);
2048
+ };
2049
+ const rowsOf = (value) => {
2050
+ if (!isRecord2(value) || !Array.isArray(value.rows))
2051
+ return [];
2052
+ return value.rows.flatMap((row) => isRecord2(row) ? [row] : []);
2053
+ };
2054
+ const columnsOf = (value, rows) => {
2055
+ if (isRecord2(value) && Array.isArray(value.columns)) {
2056
+ const named = value.columns.flatMap((column) => typeof column === "string" ? [column] : []);
2057
+ if (named.length > 0)
2058
+ return named;
2059
+ }
2060
+ const first = rows[0];
2061
+ return first === void 0 ? [] : Object.keys(first);
2062
+ };
2063
+ let selected = "";
2064
+ const loadPage = async (schema, name) => {
2065
+ selected = `${schema}.${name}`;
2066
+ const page = await api.get(`/sql/tables/${encodeURIComponent(schema)}/${encodeURIComponent(name)}?limit=50`);
2067
+ const rows = rowsOf(page);
2068
+ renderGrid(columnsOf(page, rows), rows);
2069
+ const total = isRecord2(page) && typeof page.total === "number" ? page.total : rows.length;
2070
+ result.textContent = `${selected} \xB7 ${total} rows`;
2071
+ for (const button of tables.querySelectorAll("button")) {
2072
+ if (!(button instanceof HTMLButtonElement))
2073
+ continue;
2074
+ button.setAttribute("aria-current", button.dataset.schema === schema && button.dataset.table === name ? "true" : "false");
2075
+ }
2076
+ };
2077
+ const loadTables = async () => {
2078
+ const payload = await api.get("/sql/tables");
2079
+ const listed = isRecord2(payload) && Array.isArray(payload.tables) ? payload.tables : [];
2080
+ tables.replaceChildren();
2081
+ if (listed.length === 0) {
2082
+ const empty = document.createElement("p");
2083
+ empty.className = "empty";
2084
+ empty.textContent = "No tables.";
2085
+ tables.append(empty);
2086
+ return;
2087
+ }
2088
+ for (const item of listed) {
2089
+ if (!isRecord2(item) || typeof item.schema !== "string" || typeof item.name !== "string")
2090
+ continue;
2091
+ const button = document.createElement("button");
2092
+ button.type = "button";
2093
+ button.dataset.schema = item.schema;
2094
+ button.dataset.table = item.name;
2095
+ button.textContent = `${item.schema}.${item.name}`;
2096
+ tables.append(button);
2097
+ }
2098
+ };
2099
+ tables.addEventListener("click", (event) => {
2100
+ const target = event.target;
2101
+ if (!(target instanceof Element))
2102
+ return;
2103
+ const button = target.closest("button");
2104
+ if (!(button instanceof HTMLButtonElement))
2105
+ return;
2106
+ const schema = button.dataset.schema;
2107
+ const name = button.dataset.table;
2108
+ if (schema === void 0 || name === void 0)
2109
+ return;
2110
+ clearError();
2111
+ loadPage(schema, name).catch(showError);
2112
+ });
2113
+ run.addEventListener("click", () => {
2114
+ const sql = input.value.trim();
2115
+ if (sql === "") {
2116
+ showError(new Error("Enter a statement"));
2117
+ return;
2118
+ }
2119
+ clearError();
2120
+ api.send("POST", "/sql/query", { sql }).then((payload) => {
2121
+ const rows = rowsOf(payload);
2122
+ renderGrid(columnsOf(payload, rows), rows);
2123
+ const count = isRecord2(payload) && typeof payload.rowCount === "number" ? payload.rowCount : rows.length;
2124
+ const truncated = isRecord2(payload) && payload.truncated === true ? " (truncated)" : "";
2125
+ result.textContent = `${count} rows${truncated}`;
2126
+ }).catch(showError);
2127
+ });
2128
+ const namespace = document.getElementById("namespace");
2129
+ if (namespace) {
2130
+ namespace.addEventListener("change", () => {
2131
+ clearError();
2132
+ loadTables().catch(showError);
2133
+ });
2134
+ }
2135
+ loadTables().catch(showError);
2136
+ }
1976
2137
  function bootAdmin(config) {
1977
2138
  const fieldKinds = ["string", "number", "boolean", "null", "object", "array", "unknown"];
1978
2139
  const sources = ["declared", "inferred", "mixed"];
@@ -2413,6 +2574,50 @@ function bootAdmin(config) {
2413
2574
  if (render)
2414
2575
  await render();
2415
2576
  }
2577
+ const delay = (ms) => new Promise((resolve) => {
2578
+ window.setTimeout(resolve, ms);
2579
+ });
2580
+ const confirmAction = async (button, pending, done, work) => {
2581
+ if (button.dataset.pending === "1")
2582
+ return;
2583
+ const label = button.textContent ?? "";
2584
+ const width = button.offsetWidth;
2585
+ button.dataset.pending = "1";
2586
+ button.classList.add("pressed");
2587
+ button.setAttribute("aria-busy", "true");
2588
+ button.style.minWidth = `${width}px`;
2589
+ button.textContent = pending;
2590
+ try {
2591
+ await work();
2592
+ button.textContent = done;
2593
+ await delay(1e3);
2594
+ } catch (error) {
2595
+ showError(error);
2596
+ } finally {
2597
+ button.textContent = label;
2598
+ button.style.minWidth = "";
2599
+ button.classList.remove("pressed");
2600
+ button.removeAttribute("aria-busy");
2601
+ delete button.dataset.pending;
2602
+ }
2603
+ };
2604
+ document.addEventListener("click", (event) => {
2605
+ const target = event.target;
2606
+ if (!(target instanceof Element))
2607
+ return;
2608
+ const button = target.closest("button");
2609
+ if (!(button instanceof HTMLButtonElement) || button.dataset.pending === "1")
2610
+ return;
2611
+ button.classList.add("pressed");
2612
+ const token = String(Date.now());
2613
+ button.dataset.press = token;
2614
+ window.setTimeout(() => {
2615
+ if (button.dataset.press !== token || button.dataset.pending === "1")
2616
+ return;
2617
+ button.classList.remove("pressed");
2618
+ delete button.dataset.press;
2619
+ }, 450);
2620
+ });
2416
2621
  el("namespace", HTMLSelectElement).addEventListener("change", () => {
2417
2622
  state.namespace = el("namespace", HTMLSelectElement).value;
2418
2623
  refresh().catch(showError);
@@ -2423,7 +2628,7 @@ function bootAdmin(config) {
2423
2628
  refresh().catch(showError);
2424
2629
  });
2425
2630
  el("refresh", HTMLButtonElement).addEventListener("click", () => {
2426
- refresh().catch(showError);
2631
+ confirmAction(el("refresh", HTMLButtonElement), "Refreshing...", "Updated", () => refresh()).catch(showError);
2427
2632
  });
2428
2633
  el("collections", HTMLElement).addEventListener("click", (event) => {
2429
2634
  const target = event.target;
@@ -2546,10 +2751,10 @@ function bootAdmin(config) {
2546
2751
  }).then(() => renderFaults()).catch(showError);
2547
2752
  });
2548
2753
  el("fault-clear", HTMLButtonElement).addEventListener("click", () => {
2549
- api("DELETE", "/faults").then(() => renderFaults()).catch(showError);
2754
+ confirmAction(el("fault-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/faults").then(() => renderFaults())).catch(showError);
2550
2755
  });
2551
2756
  el("journal-clear", HTMLButtonElement).addEventListener("click", () => {
2552
- api("DELETE", "/requests").then(() => renderJournal()).catch(showError);
2757
+ confirmAction(el("journal-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/requests").then(() => renderJournal())).catch(showError);
2553
2758
  });
2554
2759
  el("route-list", HTMLElement).addEventListener("click", (event) => {
2555
2760
  const target = event.target;
@@ -2605,6 +2810,22 @@ function bootAdmin(config) {
2605
2810
  panel.script = value.script;
2606
2811
  return panel;
2607
2812
  };
2813
+ const decodeExtension = (value) => {
2814
+ if (!isRecord2(value))
2815
+ return void 0;
2816
+ if (value.kind === "sql") {
2817
+ return {
2818
+ kind: "sql",
2819
+ id: typeof value.id === "string" && value.id !== "" ? value.id : "sql",
2820
+ title: typeof value.title === "string" && value.title !== "" ? value.title : "SQL",
2821
+ description: typeof value.description === "string" ? value.description : "Browse tables and run queries."
2822
+ };
2823
+ }
2824
+ if (value.kind !== "panel")
2825
+ return void 0;
2826
+ const panel = decodePanel(value);
2827
+ return panel === void 0 ? void 0 : { kind: "panel", ...panel };
2828
+ };
2608
2829
  const mountPanels = (panels) => {
2609
2830
  const nav = el("nav", HTMLElement);
2610
2831
  const views = el("views", HTMLElement);
@@ -2658,15 +2879,57 @@ function bootAdmin(config) {
2658
2879
  return decoded === void 0 ? [] : [decoded];
2659
2880
  });
2660
2881
  mountPanels(panels);
2882
+ const extensions = requireList(isRecord2(manifest) ? manifest.extensions : void 0, "Extensions").flatMap((extension) => {
2883
+ const decoded = decodeExtension(extension);
2884
+ return decoded === void 0 ? [] : [decoded];
2885
+ });
2886
+ const extensionPanels = extensions.flatMap((extension) => extension.kind === "panel" ? [extension] : []);
2887
+ mountPanels(extensionPanels);
2888
+ for (const extension of extensions) {
2889
+ if (extension.kind !== "sql")
2890
+ continue;
2891
+ const nav = el("nav", HTMLElement);
2892
+ const views = el("views", HTMLElement);
2893
+ const button = document.createElement("button");
2894
+ button.type = "button";
2895
+ button.dataset.view = extension.id;
2896
+ button.textContent = extension.title;
2897
+ nav.append(button);
2898
+ const section = document.createElement("section");
2899
+ section.className = "view";
2900
+ section.id = `view-${extension.id}`;
2901
+ section.hidden = true;
2902
+ const title = document.createElement("h2");
2903
+ title.textContent = extension.title;
2904
+ const lede = document.createElement("p");
2905
+ lede.className = "lede";
2906
+ lede.textContent = extension.description;
2907
+ const body = document.createElement("div");
2908
+ body.className = "panel-body";
2909
+ section.append(title, lede, body);
2910
+ views.append(section);
2911
+ mountSqlExplorer(body, panelApi);
2912
+ }
2661
2913
  return refresh();
2662
2914
  }).catch(showError);
2663
2915
  }
2664
- var clientPrelude = [isRecord2, mountAdminBrand, startAdminBrand, faultPresetList, bootAdmin].map((fn) => fn.toString()).join("\n");
2916
+ var clientPrelude = [
2917
+ isRecord2,
2918
+ mountAdminBrand,
2919
+ startAdminBrand,
2920
+ faultPresetList,
2921
+ mountSqlExplorer,
2922
+ bootAdmin
2923
+ ].map((fn) => fn.toString()).join("\n");
2665
2924
  var adminClientSource = (config) => {
2666
2925
  const payload = JSON.stringify(config).replace(/</g, "\\u003c");
2926
+ const entry = bootAdmin.name;
2927
+ if (!/^[A-Za-z_$][\w$]*$/.test(entry)) {
2928
+ throw new Error("admin client cannot call its boot function");
2929
+ }
2667
2930
  return `<script>
2668
2931
  ${clientPrelude}
2669
- bootAdmin(${payload});
2932
+ ${entry}(${payload});
2670
2933
  </script>`;
2671
2934
  };
2672
2935
 
@@ -2707,19 +2970,33 @@ var STANDARD_ADMIN_ROUTES = [
2707
2970
  "GET /ui/manifest"
2708
2971
  ];
2709
2972
  var PANEL_ID = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
2973
+ var RESERVED_VIEWS = /* @__PURE__ */ new Set(["overview", "state", "clock", "faults", "journal", "routes"]);
2974
+ var checkPanel = (panel, seen, label) => {
2975
+ if (!PANEL_ID.test(panel.id)) {
2976
+ throw new RangeError(`${label} id must match ${PANEL_ID}: ${JSON.stringify(panel.id)}`);
2977
+ }
2978
+ if (RESERVED_VIEWS.has(panel.id)) {
2979
+ throw new RangeError(`${label} id ${panel.id} is reserved by the admin shell`);
2980
+ }
2981
+ if (seen.has(panel.id))
2982
+ throw new RangeError(`duplicate admin view id ${panel.id}`);
2983
+ seen.add(panel.id);
2984
+ if (panel.title.trim() === "")
2985
+ throw new RangeError(`${label} ${panel.id} needs a title`);
2986
+ };
2710
2987
  var assertAdminUi = (ui) => {
2711
- if (!ui?.panels)
2988
+ if (!ui)
2712
2989
  return;
2713
2990
  const seen = /* @__PURE__ */ new Set();
2714
- for (const panel of ui.panels) {
2715
- if (!PANEL_ID.test(panel.id)) {
2716
- throw new RangeError(`admin panel id must match ${PANEL_ID}: ${JSON.stringify(panel.id)}`);
2991
+ for (const panel of ui.panels ?? [])
2992
+ checkPanel(panel, seen, "admin panel");
2993
+ for (const extension of ui.extensions ?? []) {
2994
+ if (extension.kind === "panel") {
2995
+ checkPanel(extension, seen, "admin extension");
2996
+ continue;
2717
2997
  }
2718
- if (seen.has(panel.id))
2719
- throw new RangeError(`duplicate admin panel id ${panel.id}`);
2720
- seen.add(panel.id);
2721
- if (panel.title.trim() === "")
2722
- throw new RangeError(`admin panel ${panel.id} needs a title`);
2998
+ const id = extension.id ?? "sql";
2999
+ checkPanel({ id, title: extension.title ?? "SQL" }, seen, "admin extension");
2723
3000
  }
2724
3001
  };
2725
3002
 
@@ -2880,9 +3157,24 @@ var renderAdminDocument = (service) => {
2880
3157
  .controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
2881
3158
  label.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--faint); }
2882
3159
  label.field input, label.field select, .controls input[type="password"] {
2883
- background: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
2884
- padding: 7px 8px; min-height: 36px;
2885
- }
3160
+ background-color: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
3161
+ padding: 7px 8px; min-height: 36px; line-height: 1.2;
3162
+ }
3163
+ /* A native menu ignores min-height, so Preset rendered about half as tall as
3164
+ the text fields in the same form. Paint it like those fields. */
3165
+ label.field select {
3166
+ -webkit-appearance: none; appearance: none;
3167
+ padding-right: 28px;
3168
+ 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");
3169
+ background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
3170
+ }
3171
+ .stack > .field > input,
3172
+ .stack > .field > select,
3173
+ .stack > .field > textarea,
3174
+ dialog .field > input,
3175
+ dialog .field > select,
3176
+ dialog .field > textarea { width: 100%; }
3177
+ .icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger, nav.side button { cursor: pointer; }
2886
3178
  .icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger {
2887
3179
  border-radius: 9px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
2888
3180
  background: var(--bg-elev);
@@ -2890,6 +3182,14 @@ var renderAdminDocument = (service) => {
2890
3182
  .btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
2891
3183
  .btn-quiet { background: transparent; }
2892
3184
  .btn-danger { color: var(--err); }
3185
+ /* Held after mouseup. Clearing an empty journal changes nothing on screen,
3186
+ so the press itself has to stay visible. */
3187
+ .icon-btn:active, .btn:active, .btn-quiet:active, .btn-danger:active, nav.side button:active,
3188
+ .icon-btn.pressed, .btn.pressed, .btn-quiet.pressed, .btn-danger.pressed, nav.side button.pressed {
3189
+ background: var(--bg-inset); border-color: var(--line-strong); color: var(--ink);
3190
+ }
3191
+ .btn-danger:active, .btn-danger.pressed { background: var(--err-soft); color: var(--err); }
3192
+ .btn-primary:active, .btn-primary.pressed { filter: brightness(0.88); color: var(--accent-ink); }
2893
3193
  /* minmax(0, 1fr): a 1fr column will not shrink below its content, so a long
2894
3194
  record or the full nav row would widen the page past the viewport. */
2895
3195
  .layout {
@@ -2930,6 +3230,12 @@ var renderAdminDocument = (service) => {
2930
3230
  border-radius: 999px; padding: 4px 8px;
2931
3231
  }
2932
3232
  .chip i { color: var(--faint); font-style: normal; }
3233
+ .sql-layout {
3234
+ display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 16px;
3235
+ }
3236
+ .sql-tables { display: flex; flex-direction: column; gap: 4px; max-height: 28rem; overflow: auto; }
3237
+ .sql-tables button { text-align: left; }
3238
+ .sql-input { font-family: var(--mono); min-height: 7rem; width: 100%; }
2933
3239
  table { width: 100%; border-collapse: collapse; font-size: 14px; }
2934
3240
  th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
2935
3241
  th { color: var(--faint); font-weight: 600; font-size: 12px; }
@@ -2978,14 +3284,22 @@ var renderAdminDocument = (service) => {
2978
3284
  input, select, textarea { font-size: 16px; }
2979
3285
  .brand, .vendor, .controls { width: 100%; }
2980
3286
  label.field, label.field select, label.field input { flex: 1; min-width: 0; }
2981
- .layout { grid-template-columns: minmax(0, 1fr); }
3287
+ /* The layout fills the screen. A single-column grid stretches every auto
3288
+ row, so the tab bar grew with the leftover height and the buttons floated
3289
+ in the middle of it. The bar stays one row; the page below takes the rest. */
3290
+ .layout {
3291
+ grid-template-columns: minmax(0, 1fr);
3292
+ grid-template-rows: auto minmax(0, 1fr);
3293
+ align-content: start;
3294
+ }
2982
3295
  nav.side {
3296
+ align-self: start; height: auto;
2983
3297
  flex-direction: row; align-items: center; overflow-x: auto; min-width: 0;
2984
3298
  border-right: 0; border-bottom: 1px solid var(--line);
2985
3299
  padding: 8px;
2986
3300
  }
2987
3301
  nav.side button { white-space: nowrap; flex: none; }
2988
- .split { grid-template-columns: minmax(0, 1fr); }
3302
+ .split, .sql-layout { grid-template-columns: minmax(0, 1fr); }
2989
3303
  main { padding: 14px; }
2990
3304
  table, thead, tbody, tr, th, td { display: block; }
2991
3305
  thead { display: none; }
@@ -3156,6 +3470,24 @@ var json3 = (body) => new Response(JSON.stringify(body), {
3156
3470
  status: 200,
3157
3471
  headers: { "content-type": "application/json; charset=utf-8" }
3158
3472
  });
3473
+ var describeExtension = (extension) => {
3474
+ if (extension.kind === "sql") {
3475
+ return {
3476
+ kind: "sql",
3477
+ id: extension.id ?? "sql",
3478
+ title: extension.title ?? "SQL",
3479
+ ...extension.description !== void 0 ? { description: extension.description } : {}
3480
+ };
3481
+ }
3482
+ return {
3483
+ kind: "panel",
3484
+ id: extension.id,
3485
+ title: extension.title,
3486
+ ...extension.description !== void 0 ? { description: extension.description } : {},
3487
+ html: extension.html,
3488
+ ...extension.script !== void 0 ? { script: extension.script } : {}
3489
+ };
3490
+ };
3159
3491
  var adminUiRoutes = (service, ui) => {
3160
3492
  const shell = () => renderAdminDocument(service);
3161
3493
  const document3 = () => ui?.render ? ui.render({ service, defaultHtml: shell }) : shell();
@@ -3170,7 +3502,8 @@ var adminUiRoutes = (service, ui) => {
3170
3502
  ...panel.description !== void 0 ? { description: panel.description } : {},
3171
3503
  html: panel.html,
3172
3504
  ...panel.script !== void 0 ? { script: panel.script } : {}
3173
- }))
3505
+ })),
3506
+ extensions: (ui?.extensions ?? []).map(describeExtension)
3174
3507
  })
3175
3508
  };
3176
3509
  };
@@ -3847,7 +4180,7 @@ var stateAdminRoutes = (routes) => {
3847
4180
  };
3848
4181
 
3849
4182
  // ../core/dist/version.js
3850
- var PACKAGE_VERSION = true ? "1.7.0" : UNRELEASED_VERSION;
4183
+ var PACKAGE_VERSION = true ? "1.8.0" : UNRELEASED_VERSION;
3851
4184
 
3852
4185
  // ../core/dist/signing.js
3853
4186
  var encoder = new TextEncoder();
@@ -6225,4 +6558,4 @@ export {
6225
6558
  IntercomError,
6226
6559
  IntercomAPI
6227
6560
  };
6228
- //# sourceMappingURL=chunk-O25E63FD.js.map
6561
+ //# sourceMappingURL=chunk-IECVMRLO.js.map