@malloy-publisher/server 0.0.382-dev → 0.2.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.
Files changed (175) hide show
  1. package/README.docker.md +145 -20
  2. package/README.md +65 -12
  3. package/dist/app/api-doc.html +5 -0
  4. package/dist/app/api-doc.yaml +3903 -583
  5. package/dist/app/assets/EnvironmentPage-DiUgLuCH.js +1 -0
  6. package/dist/app/assets/HomePage-MhhjhnFj.js +1 -0
  7. package/dist/app/assets/LightMode-BEyvNUzT.js +1 -0
  8. package/dist/app/assets/MainPage-D4Cfee9o.js +2 -0
  9. package/dist/app/assets/MaterializationsPage-nGgGqwSN.js +1 -0
  10. package/dist/app/assets/ModelPage-DLAcEw-F.js +1 -0
  11. package/dist/app/assets/PackagePage-Df0ikH7w.js +1 -0
  12. package/dist/app/assets/RouteError-BFQwtroH.js +1 -0
  13. package/dist/app/assets/ThemeEditorPage-OoskoQYN.js +1 -0
  14. package/dist/app/assets/WorkbookPage-CpFgvUDC.js +1 -0
  15. package/dist/app/assets/{core-CjeTkq8O.es-BqRc6yhC.js → core-lb28vQkR.es-BoVSOc75.js} +1 -1
  16. package/dist/app/assets/github-dark-DenFmJkN.es-DHJKELXO.js +1 -0
  17. package/dist/app/assets/index-5eLCcNmP.css +1 -0
  18. package/dist/app/assets/index-6ypuFH6g.js +1774 -0
  19. package/dist/app/assets/index-B8pnU_V_.js +615 -0
  20. package/dist/app/assets/index-BImcHmVP.js +1 -0
  21. package/dist/app/assets/index-DSoCUF-f.js +2725 -0
  22. package/dist/app/assets/index-DfqzSItA.js +2 -0
  23. package/dist/app/assets/index-w_0OQJgZ.js +23 -0
  24. package/dist/app/index.html +8 -4
  25. package/dist/cpufeatures-1yrn0vtw.node +0 -0
  26. package/dist/default-publisher.config.json +23 -0
  27. package/dist/{instrumentation.js → instrumentation.mjs} +10631 -10573
  28. package/dist/package_load_worker.mjs +15219 -0
  29. package/dist/runtime/publisher.js +331 -0
  30. package/dist/{server.js → server.mjs} +115548 -49590
  31. package/dist/sshcrypto-vd2k5hq9.node +0 -0
  32. package/package.json +41 -28
  33. package/publisher.config.example.bigquery.json +33 -0
  34. package/publisher.config.example.duckdb.json +23 -0
  35. package/.eslintrc.json +0 -44
  36. package/.prettierignore +0 -1
  37. package/.prettierrc +0 -4
  38. package/build.ts +0 -38
  39. package/dist/app/assets/HomePage-Dn3E4CuB.js +0 -1
  40. package/dist/app/assets/MainPage-BzB3yoqi.js +0 -2
  41. package/dist/app/assets/ModelPage-C9O_sAXT.js +0 -1
  42. package/dist/app/assets/PackagePage-DcxKEjBX.js +0 -1
  43. package/dist/app/assets/ProjectPage-BDj307rF.js +0 -1
  44. package/dist/app/assets/RouteError-DAShbVCG.js +0 -1
  45. package/dist/app/assets/WorkbookPage-Cs_XYEaB.js +0 -1
  46. package/dist/app/assets/index-15BOvhp0.js +0 -456
  47. package/dist/app/assets/index-Bb2jqquW.js +0 -676
  48. package/dist/app/assets/index-CMlGQMcl.css +0 -1
  49. package/dist/app/assets/index-D68X76-7.js +0 -1276
  50. package/dist/app/assets/index.umd-DGBekgSu.js +0 -1145
  51. package/dxt/malloy_bridge.py +0 -354
  52. package/dxt/manifest.json +0 -22
  53. package/eslint.config.mjs +0 -76
  54. package/k6-tests/README.md +0 -144
  55. package/k6-tests/bun.lock +0 -797
  56. package/k6-tests/load-test/load-test-crud-connections.ts +0 -263
  57. package/k6-tests/load-test/load-test-crud-packages.ts +0 -461
  58. package/k6-tests/load-test/load-test-crud-projects.ts +0 -160
  59. package/k6-tests/load-test/load-test-crud.ts +0 -142
  60. package/k6-tests/load-test/load-test.ts +0 -784
  61. package/k6-tests/package.json +0 -27
  62. package/k6-tests/scripts/run-with-otel.sh +0 -50
  63. package/k6-tests/smoke-test/smoke-test.ts +0 -158
  64. package/k6-tests/tsconfig.json +0 -29
  65. package/k6-tests/utils/client_factory.ts +0 -128
  66. package/k6-tests/utils/common.ts +0 -489
  67. package/k6-tests/utils/logger.ts +0 -62
  68. package/k6-tests/utils/types.d.ts +0 -35
  69. package/malloy_mcp.dxt +0 -0
  70. package/publisher.config.json +0 -33
  71. package/src/config.spec.ts +0 -850
  72. package/src/config.ts +0 -305
  73. package/src/constants.ts +0 -10
  74. package/src/controller/compile.controller.ts +0 -35
  75. package/src/controller/connection.controller.ts +0 -515
  76. package/src/controller/database.controller.ts +0 -21
  77. package/src/controller/manifest.controller.ts +0 -29
  78. package/src/controller/materialization.controller.ts +0 -125
  79. package/src/controller/model.controller.ts +0 -107
  80. package/src/controller/package.controller.ts +0 -182
  81. package/src/controller/query.controller.ts +0 -60
  82. package/src/controller/watch-mode.controller.ts +0 -98
  83. package/src/data_styles.ts +0 -71
  84. package/src/dto/connection.dto.spec.ts +0 -131
  85. package/src/dto/connection.dto.ts +0 -174
  86. package/src/dto/index.ts +0 -2
  87. package/src/dto/package.dto.spec.ts +0 -42
  88. package/src/dto/package.dto.ts +0 -12
  89. package/src/dto/validate.spec.ts +0 -76
  90. package/src/dto/validate.ts +0 -31
  91. package/src/errors.ts +0 -116
  92. package/src/health.ts +0 -189
  93. package/src/instrumentation.ts +0 -148
  94. package/src/logger.ts +0 -154
  95. package/src/mcp/error_messages.ts +0 -199
  96. package/src/mcp/handler_utils.ts +0 -239
  97. package/src/mcp/mcp_constants.ts +0 -22
  98. package/src/mcp/prompts/handlers.ts +0 -84
  99. package/src/mcp/prompts/index.ts +0 -11
  100. package/src/mcp/prompts/prompt_definitions.ts +0 -160
  101. package/src/mcp/prompts/prompt_service.ts +0 -67
  102. package/src/mcp/prompts/utils.ts +0 -62
  103. package/src/mcp/resource_metadata.ts +0 -47
  104. package/src/mcp/resources/model_resource.ts +0 -153
  105. package/src/mcp/resources/notebook_resource.ts +0 -137
  106. package/src/mcp/resources/package_resource.ts +0 -370
  107. package/src/mcp/resources/project_resource.ts +0 -184
  108. package/src/mcp/resources/query_resource.ts +0 -117
  109. package/src/mcp/resources/source_resource.ts +0 -141
  110. package/src/mcp/resources/view_resource.ts +0 -136
  111. package/src/mcp/server.ts +0 -62
  112. package/src/mcp/tools/discovery_tools.ts +0 -258
  113. package/src/mcp/tools/execute_query_tool.ts +0 -265
  114. package/src/server.ts +0 -1195
  115. package/src/service/connection.spec.ts +0 -1331
  116. package/src/service/connection.ts +0 -1511
  117. package/src/service/connection_service.spec.ts +0 -641
  118. package/src/service/connection_service.ts +0 -181
  119. package/src/service/db_utils.spec.ts +0 -714
  120. package/src/service/db_utils.ts +0 -1227
  121. package/src/service/filter.spec.ts +0 -447
  122. package/src/service/filter.ts +0 -337
  123. package/src/service/filter_integration.spec.ts +0 -825
  124. package/src/service/gcs_s3_utils.ts +0 -427
  125. package/src/service/manifest_service.spec.ts +0 -201
  126. package/src/service/manifest_service.ts +0 -106
  127. package/src/service/materialization_service.spec.ts +0 -648
  128. package/src/service/materialization_service.ts +0 -929
  129. package/src/service/materialized_table_gc.spec.ts +0 -383
  130. package/src/service/materialized_table_gc.ts +0 -279
  131. package/src/service/model.spec.ts +0 -257
  132. package/src/service/model.ts +0 -1069
  133. package/src/service/package.spec.ts +0 -236
  134. package/src/service/package.ts +0 -463
  135. package/src/service/project.ts +0 -681
  136. package/src/service/project_compile.spec.ts +0 -197
  137. package/src/service/project_store.spec.ts +0 -859
  138. package/src/service/project_store.ts +0 -1531
  139. package/src/service/quoting.ts +0 -41
  140. package/src/service/resolve_project.ts +0 -13
  141. package/src/storage/BaseRepository.ts +0 -31
  142. package/src/storage/DatabaseInterface.ts +0 -180
  143. package/src/storage/StorageManager.mock.ts +0 -59
  144. package/src/storage/StorageManager.ts +0 -210
  145. package/src/storage/duckdb/ConnectionRepository.ts +0 -141
  146. package/src/storage/duckdb/DuckDBConnection.ts +0 -177
  147. package/src/storage/duckdb/DuckDBManifestStore.ts +0 -70
  148. package/src/storage/duckdb/DuckDBRepository.ts +0 -224
  149. package/src/storage/duckdb/ManifestRepository.ts +0 -119
  150. package/src/storage/duckdb/MaterializationRepository.ts +0 -249
  151. package/src/storage/duckdb/PackageRepository.ts +0 -135
  152. package/src/storage/duckdb/ProjectRepository.ts +0 -148
  153. package/src/storage/duckdb/manifest_store.spec.ts +0 -133
  154. package/src/storage/duckdb/schema.ts +0 -147
  155. package/src/storage/ducklake/DuckLakeManifestStore.ts +0 -146
  156. package/src/utils.ts +0 -13
  157. package/tests/fixtures/persist-test/data/orders.csv +0 -5
  158. package/tests/fixtures/persist-test/persist_test.malloy +0 -11
  159. package/tests/fixtures/persist-test/publisher.json +0 -5
  160. package/tests/fixtures/publisher.config.json +0 -15
  161. package/tests/harness/e2e.ts +0 -96
  162. package/tests/harness/mcp_test_setup.ts +0 -344
  163. package/tests/harness/mocks.ts +0 -37
  164. package/tests/harness/rest_e2e.ts +0 -68
  165. package/tests/harness/uris.ts +0 -31
  166. package/tests/integration/materialization/materialization_lifecycle.integration.spec.ts +0 -470
  167. package/tests/integration/mcp/mcp_execute_query_tool.integration.spec.ts +0 -434
  168. package/tests/integration/mcp/mcp_resource.integration.spec.ts +0 -663
  169. package/tests/integration/mcp/mcp_transport.integration.spec.ts +0 -122
  170. package/tests/integration/mcp/setup.spec.ts +0 -5
  171. package/tests/unit/duckdb/attached_databases.test.ts +0 -1132
  172. package/tests/unit/ducklake/ducklake.test.ts +0 -950
  173. package/tests/unit/mcp/prompt_definitions.test.ts +0 -102
  174. package/tests/unit/mcp/prompt_happy.test.ts +0 -51
  175. package/tsconfig.json +0 -32
@@ -0,0 +1,331 @@
1
+ // Copyright (c) Credible Data Inc.
2
+ // SPDX-License-Identifier: MIT
3
+
4
+ // Publisher runtime helper for in-package HTML dashboards.
5
+ // Served by the Publisher server at /sdk/publisher.js. Hand-authored vanilla
6
+ // JS — no bundler. Loaded via <script src="/sdk/publisher.js">.
7
+ //
8
+ // Exposes window.Publisher with:
9
+ // - Publisher.query(model, malloy, opts?) → Promise<rows[]>
10
+ // - Publisher.queryFull(model, malloy, opts?) → Promise<MalloyResult> (envelope for <malloy-render>)
11
+ // opts: { environment?, package?, sourceName?, queryName?, filterParams?,
12
+ // bypassFilters?, givens? }. givens is a name→value map bound as
13
+ // Malloy given: runtime parameters for this query (safe parameterization,
14
+ // not string interpolation) — see the malloy-html-data-app-runtime skill.
15
+ // - Publisher.embed(selector, { src, height?, token? })
16
+ // - Publisher.context ({ environment, package } inferred from URL)
17
+ // - Publisher.setToken(token) (override Bearer token; default uses cookies)
18
+ //
19
+ // When loaded inside an iframe served from /environments/<env>/packages/<pkg>/...,
20
+ // the runtime auto-subscribes to a Server-Sent Events live-reload stream
21
+ // (GET .../events) and reloads the page on file changes. It also posts size
22
+ // updates to the parent window so Publisher.embed() in the host can resize
23
+ // the iframe.
24
+ //
25
+ // The "publisher:resize" postMessage protocol below is the SAME contract the
26
+ // SPA host consumes. Its canonical definition lives in
27
+ // packages/sdk/src/utils/dataAppEmbed.ts (PUBLISHER_RESIZE_MESSAGE_TYPE /
28
+ // PublisherResizeMessage). This file is build-step-free vanilla JS and can't
29
+ // import it, so keep the message type/shape here in sync with that module.
30
+
31
+ (function () {
32
+ "use strict";
33
+
34
+ // --- Context inference -------------------------------------------------
35
+ // URL shape: /environments/<env>/packages/<pkg>/<file>
36
+ //
37
+ // location.pathname is URL-encoded, so we MUST decode the captured
38
+ // segments here. Without this step, a name with a space (e.g.
39
+ // "demo env") would arrive as "demo%20env" — and the encodeURIComponent
40
+ // we apply when building API URLs (below) would produce "demo%2520env",
41
+ // which Publisher then 404s on.
42
+ var pathMatch = location.pathname.match(
43
+ /^\/environments\/([^/]+)\/packages\/([^/]+)\//,
44
+ );
45
+ function safeDecode(s) {
46
+ try {
47
+ return decodeURIComponent(s);
48
+ } catch (_e) {
49
+ return s;
50
+ }
51
+ }
52
+ var ctx = pathMatch
53
+ ? {
54
+ environment: safeDecode(pathMatch[1]),
55
+ package: safeDecode(pathMatch[2]),
56
+ }
57
+ : {};
58
+
59
+ var apiBase = location.origin + "/api/v0";
60
+ var bearerToken = null;
61
+
62
+ function authHeaders() {
63
+ return bearerToken ? { Authorization: "Bearer " + bearerToken } : {};
64
+ }
65
+
66
+ // --- Query helpers -----------------------------------------------------
67
+ function resolveTarget(opts) {
68
+ var env = (opts && opts.environment) || ctx.environment;
69
+ var pkg = (opts && opts.package) || ctx.package;
70
+ if (!env || !pkg) {
71
+ throw new Error(
72
+ "Publisher: no environment/package; either serve the page from " +
73
+ "/environments/<env>/packages/<pkg>/... or pass { environment, package } in opts.",
74
+ );
75
+ }
76
+ return { env: env, pkg: pkg };
77
+ }
78
+
79
+ async function rawQuery(modelPath, malloyQuery, opts, compactJson) {
80
+ opts = opts || {};
81
+ var target = resolveTarget(opts);
82
+ var url =
83
+ apiBase +
84
+ "/environments/" +
85
+ encodeURIComponent(target.env) +
86
+ "/packages/" +
87
+ encodeURIComponent(target.pkg) +
88
+ "/models/" +
89
+ // Encode the whole model path as ONE path segment (slashes -> %2F). A model
90
+ // in a subfolder ("model/x.malloy") must not become two URL segments: some
91
+ // servers only match a single-segment {path} and would 405 a multi-segment
92
+ // path. This matches the typed SDK (encodeURIComponent) and the server's
93
+ // encoded-slash handling.
94
+ encodeURIComponent(modelPath) +
95
+ "/query";
96
+ var body = { compactJson: compactJson };
97
+ if (malloyQuery) body.query = malloyQuery;
98
+ if (opts.sourceName) body.sourceName = opts.sourceName;
99
+ if (opts.queryName) body.queryName = opts.queryName;
100
+ if (opts.filterParams) body.filterParams = opts.filterParams;
101
+ if (opts.bypassFilters) body.bypassFilters = true;
102
+ if (opts.givens) body.givens = opts.givens;
103
+
104
+ var headers = Object.assign(
105
+ { "content-type": "application/json" },
106
+ authHeaders(),
107
+ );
108
+ var res = await fetch(url, {
109
+ method: "POST",
110
+ credentials: "include",
111
+ headers: headers,
112
+ body: JSON.stringify(body),
113
+ });
114
+ var json;
115
+ try {
116
+ json = await res.json();
117
+ } catch (_e) {
118
+ throw new Error(
119
+ "Publisher: server returned non-JSON response (" + res.status + ")",
120
+ );
121
+ }
122
+ if (!res.ok) {
123
+ var msg = (json && json.message) || res.statusText || "Query failed";
124
+ var err = new Error("Publisher.query: " + msg);
125
+ err.response = json;
126
+ err.status = res.status;
127
+ throw err;
128
+ }
129
+ // The server's QueryResult always has `result` as a JSON-encoded string.
130
+ // Parse it before handing it back so callers see real JS values.
131
+ return JSON.parse(json.result);
132
+ }
133
+
134
+ function query(modelPath, malloyQuery, opts) {
135
+ return rawQuery(modelPath, malloyQuery, opts, true);
136
+ }
137
+ function queryFull(modelPath, malloyQuery, opts) {
138
+ return rawQuery(modelPath, malloyQuery, opts, false);
139
+ }
140
+
141
+ // --- Embed helper (host page) -----------------------------------------
142
+ function embed(selector, options) {
143
+ options = options || {};
144
+ var host =
145
+ typeof selector === "string"
146
+ ? document.querySelector(selector)
147
+ : selector;
148
+ if (!host) {
149
+ throw new Error("Publisher.embed: selector did not match an element");
150
+ }
151
+ if (!options.src) {
152
+ throw new Error("Publisher.embed: opts.src is required");
153
+ }
154
+ var iframe = document.createElement("iframe");
155
+ iframe.src = options.token
156
+ ? options.src +
157
+ (options.src.indexOf("?") === -1 ? "?" : "&") +
158
+ "embed_token=" +
159
+ encodeURIComponent(options.token)
160
+ : options.src;
161
+ iframe.style.border = "0";
162
+ iframe.style.width = "100%";
163
+ iframe.style.display = "block";
164
+ if (options.height) {
165
+ iframe.style.height =
166
+ typeof options.height === "number"
167
+ ? options.height + "px"
168
+ : options.height;
169
+ } else {
170
+ iframe.style.height = "0px"; // will be sized via postMessage
171
+ }
172
+ if (options.allow) iframe.allow = options.allow;
173
+ iframe.setAttribute(
174
+ "sandbox",
175
+ "allow-scripts allow-same-origin allow-forms",
176
+ );
177
+
178
+ // Resize listener
179
+ function onMessage(e) {
180
+ if (!e.data || e.data.type !== "publisher:resize") return;
181
+ if (e.source !== iframe.contentWindow) return;
182
+ if (typeof e.data.height === "number") {
183
+ iframe.style.height = Math.max(0, e.data.height) + "px";
184
+ }
185
+ }
186
+ window.addEventListener("message", onMessage);
187
+ // Best-effort cleanup if the host removes the iframe
188
+ var observer = new MutationObserver(function () {
189
+ if (!host.contains(iframe)) {
190
+ window.removeEventListener("message", onMessage);
191
+ observer.disconnect();
192
+ }
193
+ });
194
+ observer.observe(host, { childList: true, subtree: false });
195
+
196
+ host.appendChild(iframe);
197
+ return {
198
+ iframe: iframe,
199
+ destroy: function () {
200
+ window.removeEventListener("message", onMessage);
201
+ observer.disconnect();
202
+ if (iframe.parentNode) iframe.parentNode.removeChild(iframe);
203
+ },
204
+ };
205
+ }
206
+
207
+ // --- When this runtime is itself inside an iframe ---------------------
208
+ // Post size updates upstream + listen for live-reload SSE events.
209
+ function setUpEmbeddedSelfBehaviors() {
210
+ var inIframe = (function () {
211
+ try {
212
+ return window.self !== window.top;
213
+ } catch (_e) {
214
+ return true; // cross-origin parent — assume embedded
215
+ }
216
+ })();
217
+
218
+ if (inIframe) {
219
+ var lastHeight = -1;
220
+ function measureContentHeight() {
221
+ // We want the "ink height" — where the last piece of visible
222
+ // content ends. NOT document.body.scrollHeight: any rule like
223
+ // `body { min-height: 100vh }` (extremely common in dashboards
224
+ // that look nice standalone) inflates scrollHeight to match
225
+ // whatever the iframe's current viewport is, creating a
226
+ // feedback loop where the iframe ratchets up but never shrinks.
227
+ //
228
+ // Sum the lowest bottom edge across body's children, in
229
+ // document coordinates. This ignores body padding, min-height,
230
+ // and CSS that just fills the viewport.
231
+ var body = document.body;
232
+ if (!body) return document.documentElement.scrollHeight;
233
+ var maxBottom = 0;
234
+ var kids = body.children;
235
+ for (var i = 0; i < kids.length; i++) {
236
+ var rect = kids[i].getBoundingClientRect();
237
+ if (rect.bottom > maxBottom) maxBottom = rect.bottom;
238
+ }
239
+ if (maxBottom <= 0) {
240
+ // Fallback for empty body / hidden children
241
+ return document.documentElement.scrollHeight;
242
+ }
243
+ var scrollTop =
244
+ window.scrollY ||
245
+ document.documentElement.scrollTop ||
246
+ document.body.scrollTop ||
247
+ 0;
248
+ // Add body bottom padding (rect.bottom is content-box bottom,
249
+ // body padding isn't part of any child's rect).
250
+ var bodyStyle = window.getComputedStyle(body);
251
+ var pad = parseFloat(bodyStyle.paddingBottom) || 0;
252
+ return Math.ceil(maxBottom + scrollTop + pad);
253
+ }
254
+ function postSize() {
255
+ var h = measureContentHeight();
256
+ if (h !== lastHeight) {
257
+ lastHeight = h;
258
+ try {
259
+ window.parent.postMessage(
260
+ { type: "publisher:resize", height: h },
261
+ "*",
262
+ );
263
+ } catch (_e) {
264
+ /* ignore */
265
+ }
266
+ }
267
+ }
268
+ // Initial + observe content changes
269
+ if (document.readyState === "loading") {
270
+ document.addEventListener("DOMContentLoaded", postSize);
271
+ } else {
272
+ postSize();
273
+ }
274
+ window.addEventListener("load", postSize);
275
+ if (typeof ResizeObserver !== "undefined") {
276
+ var ro = new ResizeObserver(postSize);
277
+ // Observe documentElement so we catch any layout change
278
+ ro.observe(document.documentElement);
279
+ } else {
280
+ // Fallback: poll once a second
281
+ setInterval(postSize, 1000);
282
+ }
283
+ }
284
+ }
285
+
286
+ // --- SSE live reload --------------------------------------------------
287
+ function setUpLiveReload() {
288
+ if (!ctx.environment || !ctx.package) return;
289
+ if (typeof EventSource === "undefined") return;
290
+ var url =
291
+ apiBase +
292
+ "/environments/" +
293
+ encodeURIComponent(ctx.environment) +
294
+ "/packages/" +
295
+ encodeURIComponent(ctx.package) +
296
+ "/events";
297
+ try {
298
+ var es = new EventSource(url, { withCredentials: true });
299
+ var pending = false;
300
+ es.addEventListener("changed", function () {
301
+ if (pending) return;
302
+ pending = true;
303
+ // Tiny debounce to coalesce a flurry of saves
304
+ setTimeout(function () {
305
+ location.reload();
306
+ }, 100);
307
+ });
308
+ es.onerror = function () {
309
+ // Browser will auto-reconnect; nothing to do.
310
+ };
311
+ } catch (_e) {
312
+ // SSE may be blocked (e.g. corp proxy) — non-fatal.
313
+ }
314
+ }
315
+
316
+ // --- Public API --------------------------------------------------------
317
+ window.Publisher = {
318
+ query: query,
319
+ queryFull: queryFull,
320
+ embed: embed,
321
+ context: ctx,
322
+ setToken: function (token) {
323
+ bearerToken = token || null;
324
+ },
325
+ };
326
+
327
+ // Auto-init the in-iframe behaviors and live-reload subscription.
328
+ // Both are no-ops if not applicable.
329
+ setUpEmbeddedSelfBehaviors();
330
+ setUpLiveReload();
331
+ })();