@workflow/web 4.1.33 → 4.1.35

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 (33) hide show
  1. package/README.md +11 -34
  2. package/build/client/assets/{encryption-Cu4jq70Y.js → encryption-BhH0xZid.js} +2 -2
  3. package/build/client/assets/{entry.client-C7XgFTHI.js → entry.client-CaUKWFDB.js} +13 -35
  4. package/build/client/assets/{highlighted-body-B3W2YXNL-CK5bxjZc.js → highlighted-body-B3W2YXNL-D5wXP22M.js} +2 -2
  5. package/build/client/assets/{home-vGjXNC_q.js → home-CjokEfcx.js} +92 -164
  6. package/build/client/assets/{index-BQ-Xa8kF.js → index-BbkkdbNz.js} +78 -149
  7. package/build/client/assets/{index-CXBr7N7m.js → index-DY3Cy2uF.js} +20 -23
  8. package/build/client/assets/{manifest-5d325d67.js → manifest-cbe27963.js} +1 -1
  9. package/build/client/assets/{mermaid-3ZIDBTTL-CCVNMOf9.js → mermaid-3ZIDBTTL-8p93TMNC.js} +315 -479
  10. package/build/client/assets/mermaid-3ZIDBTTL-DHICBbcE.css +1 -0
  11. package/build/client/assets/{root-DjobWPwY.js → root-D-ZCwNhI.js} +5 -35
  12. package/build/client/assets/root-DzrclYrK.css +1 -0
  13. package/build/client/assets/{run-detail-nLEl00wq.js → run-detail-H0o7UsyU.js} +141 -205
  14. package/build/client/assets/server-build-DMZyIeNn.css +1 -0
  15. package/build/client/assets/{worker-CqHKTA7D.js → worker-DxRAeS-i.js} +2 -2
  16. package/build/client/assets/{workflow-graph-viewer-CTw33ANm.js → workflow-graph-viewer-C-MZ2XPV.js} +466 -723
  17. package/build/server/assets/{app-DFeBwpXW.js → app-BX9dMsx4.js} +67 -153
  18. package/build/server/assets/{highlighted-body-B3W2YXNL-DucHV668.js → highlighted-body-B3W2YXNL-CHc9_Xzp.js} +2 -2
  19. package/build/server/assets/{index-BUlN7QFn.js → index-BC_EEwAS.js} +2 -2
  20. package/build/server/assets/{index-DOJ452m_.js → index-BNN2zck_.js} +3 -3
  21. package/build/server/assets/{index-CMfOrLiJ.js → index-C-y3EhAf.js} +25 -32
  22. package/build/server/assets/{mermaid-3ZIDBTTL-DCNPJ1qb.js → mermaid-3ZIDBTTL-CP_u5jLd.js} +2 -2
  23. package/build/server/assets/{server-build-D0sUavwG.js → server-build-C0EUGBN0.js} +6483 -7670
  24. package/build/server/assets/{token-v98bLjzH.js → token-DYdYwRhs.js} +6 -6
  25. package/build/server/assets/{token-util-BoIjkgfM.js → token-util-BZHkMK_T.js} +2 -2
  26. package/build/server/index.js +1 -1
  27. package/host-guard.js +176 -0
  28. package/package.json +5 -4
  29. package/server.d.ts +15 -1
  30. package/server.js +28 -3
  31. package/build/client/assets/mermaid-3ZIDBTTL-yyHEMZs4.css +0 -1
  32. package/build/client/assets/root-BOS11TzD.css +0 -1
  33. package/build/client/assets/server-build-CNEy-GiI.css +0 -1
package/README.md CHANGED
@@ -11,55 +11,32 @@ Observability Web UI Package bundled in the [Workflow SDK](https://useworkflow.d
11
11
 
12
12
  While this UI is bundled with the Workflow CLI, you can also self-host it.
13
13
 
14
- There are multiple approaches:
14
+ There are two approaches:
15
15
 
16
16
  1. Run `npx workflow web --noBrowser` on a server
17
- 2. Clone this repo and deploy as a normal Next.js app
18
- 3. Deploy the published `@workflow/web` package
17
+ 2. Run the published `@workflow/web` package's server directly
19
18
 
20
19
  All options require the environment to be configured with the right environment variables for the World you're using.
21
20
 
21
+ ### Allowed host names
22
+
23
+ To protect against DNS rebinding, the server rejects requests whose `Host` header is not `localhost`, a `*.localhost` name, or an IP address. If you reach the UI under a domain name (for example behind a reverse proxy), list it in `WORKFLOW_WEB_ALLOWED_HOSTS` or pass `--webAllowedHosts` to the CLI: comma-separated, `.example.com` matches the domain and its subdomains, and `*` disables the check. Cross-origin `POST` requests are rejected as well, unless their origin is one of these names.
24
+
22
25
  ### Option 1: Run with the CLI
23
26
 
24
27
  ```bash
25
- npx workflow web --noBrowser
28
+ npx workflow web --noBrowser --webAllowedHosts workflow.example.com
26
29
  ```
27
30
 
28
31
  This will start the web UI on the default port `3456`.
29
32
 
30
- ### Option 2: Clone and deploy
31
-
32
- - Build and deploy like any Next.js app.
33
- - Configure the backend via environment variables (same variables the CLI writes).
34
-
35
- ### Option 3: Deploy the published `@workflow/web` package
36
-
37
- The published `@workflow/web` package contains a prebuilt `.next` directory and `package.json`.
38
- You can install it and run `next start` from the package directory.
33
+ ### Option 2: Run the published `@workflow/web` package
39
34
 
40
- Example (Node server / container):
35
+ The published `@workflow/web` package contains a prebuilt `build/` directory and a standalone server entry point, `server.js`.
41
36
 
42
37
  ```bash
43
- mkdir workflow-observability-ui
44
- cd workflow-observability-ui
45
-
46
- npm init -y
47
- # You must provide React runtime dependencies in your host project.
48
- npm i @workflow/web react react-dom
49
-
50
- # Run Next.js from the installed package (it contains the .next output)
51
- cd node_modules/@workflow/web
52
- npx --yes next start -p "${PORT:-3456}"
53
- ```
54
-
55
- If you prefer, you can set a `start` script in your host `package.json` like:
56
-
57
- ```json
58
- {
59
- "scripts": {
60
- "start": "cd node_modules/@workflow/web && next start -p $PORT"
61
- }
62
- }
38
+ npm i @workflow/web
39
+ PORT=3456 WORKFLOW_WEB_ALLOWED_HOSTS=workflow.example.com node node_modules/@workflow/web/server.js
63
40
  ```
64
41
 
65
42
  ### Configuration (environment variables)
@@ -1,5 +1,5 @@
1
- import { R as RuntimeDecryptionError } from "./index-CXBr7N7m.js";
2
- import "./index-BQ-Xa8kF.js";
1
+ import { R as RuntimeDecryptionError } from "./index-DY3Cy2uF.js";
2
+ import "./index-BbkkdbNz.js";
3
3
  const NONCE_LENGTH = 12;
4
4
  const TAG_LENGTH = 128;
5
5
  const KEY_LENGTH = 32;
@@ -1,17 +1,8 @@
1
- import { a as requireReact, b as requireReactDom, m as matchRoutes, s as shouldHydrateRouteLoader, N as NO_BODY_STATUS_CODES, R as ReactExports, i as isRouteErrorResponse, r as reactExports, c as invariant, u as useFogOFWarDiscovery, F as FrameworkContext, d as RemixErrorBoundary, e as RouterProvider, f as reactDomExports, h as decodeViaTurboStream, k as createClientRoutes, l as createRouter, n as getPatchRoutesOnNavigationFunction, o as getTurboStreamSingleFetchDataStrategy, p as createBrowserHistory, q as createClientRoutesWithHMRRevalidationOptOut, t as mapRouteProperties, v as hydrationRouteProperties, j as jsxRuntimeExports } from "./index-BQ-Xa8kF.js";
1
+ import { a as requireReact, b as requireReactDom, m as matchRoutes, s as shouldHydrateRouteLoader, N as NO_BODY_STATUS_CODES, R as ReactExports, i as isRouteErrorResponse, r as reactExports, c as invariant, u as useFogOFWarDiscovery, F as FrameworkContext, d as RemixErrorBoundary, e as RouterProvider, f as reactDomExports, h as decodeViaTurboStream, k as createClientRoutes, l as createRouter, n as getPatchRoutesOnNavigationFunction, o as getTurboStreamSingleFetchDataStrategy, p as createBrowserHistory, q as createClientRoutesWithHMRRevalidationOptOut, t as mapRouteProperties, v as hydrationRouteProperties, j as jsxRuntimeExports } from "./index-BbkkdbNz.js";
2
2
  var client = { exports: {} };
3
3
  var reactDomClient_production = {};
4
4
  var scheduler = { exports: {} };
5
5
  var scheduler_production = {};
6
- /**
7
- * @license React
8
- * scheduler.production.js
9
- *
10
- * Copyright (c) Meta Platforms, Inc. and affiliates.
11
- *
12
- * This source code is licensed under the MIT license found in the
13
- * LICENSE file in the root directory of this source tree.
14
- */
15
6
  var hasRequiredScheduler_production;
16
7
  function requireScheduler_production() {
17
8
  if (hasRequiredScheduler_production) return scheduler_production;
@@ -276,15 +267,6 @@ function requireScheduler() {
276
267
  }
277
268
  return scheduler.exports;
278
269
  }
279
- /**
280
- * @license React
281
- * react-dom-client.production.js
282
- *
283
- * Copyright (c) Meta Platforms, Inc. and affiliates.
284
- *
285
- * This source code is licensed under the MIT license found in the
286
- * LICENSE file in the root directory of this source tree.
287
- */
288
270
  var hasRequiredReactDomClient_production;
289
271
  function requireReactDomClient_production() {
290
272
  if (hasRequiredReactDomClient_production) return reactDomClient_production;
@@ -403,16 +385,16 @@ function requireReactDomClient_production() {
403
385
  }
404
386
  return null;
405
387
  }
406
- var assign = Object.assign, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_PROVIDER_TYPE = Symbol.for("react.provider"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy");
407
- var REACT_ACTIVITY_TYPE = Symbol.for("react.activity");
408
- var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
388
+ var assign = Object.assign, REACT_LEGACY_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element"), REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_PROVIDER_TYPE = /* @__PURE__ */ Symbol.for("react.provider"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
389
+ var REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity");
390
+ var REACT_MEMO_CACHE_SENTINEL = /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel");
409
391
  var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
410
392
  function getIteratorFn(maybeIterable) {
411
393
  if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
412
394
  maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
413
395
  return "function" === typeof maybeIterable ? maybeIterable : null;
414
396
  }
415
- var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
397
+ var REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference");
416
398
  function getComponentNameFromType(type) {
417
399
  if (null == type) return null;
418
400
  if ("function" === typeof type)
@@ -11498,7 +11480,7 @@ function initSsrInfo() {
11498
11480
  if (!ssrInfo && window.__reactRouterContext && window.__reactRouterManifest && window.__reactRouterRouteModules) {
11499
11481
  if (window.__reactRouterManifest.sri === true) {
11500
11482
  const importMap = document.querySelector("script[rr-importmap]");
11501
- if (importMap == null ? void 0 : importMap.textContent) {
11483
+ if (importMap?.textContent) {
11502
11484
  try {
11503
11485
  window.__reactRouterManifest.sri = JSON.parse(
11504
11486
  importMap.textContent
@@ -11522,7 +11504,6 @@ function createHydratedRouter({
11522
11504
  getContext,
11523
11505
  instrumentations
11524
11506
  }) {
11525
- var _a, _b;
11526
11507
  initSsrInfo();
11527
11508
  if (!ssrInfo) {
11528
11509
  throw new Error(
@@ -11557,7 +11538,7 @@ function createHydratedRouter({
11557
11538
  let hydrationData = void 0;
11558
11539
  if (ssrInfo.context.isSpaMode) {
11559
11540
  let { loaderData } = ssrInfo.context.state;
11560
- if (((_a = ssrInfo.manifest.routes.root) == null ? void 0 : _a.hasLoader) && loaderData && "root" in loaderData) {
11541
+ if (ssrInfo.manifest.routes.root?.hasLoader && loaderData && "root" in loaderData) {
11561
11542
  hydrationData = {
11562
11543
  loaderData: {
11563
11544
  root: loaderData.root
@@ -11568,16 +11549,13 @@ function createHydratedRouter({
11568
11549
  hydrationData = getHydrationData({
11569
11550
  state: ssrInfo.context.state,
11570
11551
  routes,
11571
- getRouteInfo: (routeId) => {
11572
- var _a2, _b2, _c;
11573
- return {
11574
- clientLoader: (_a2 = ssrInfo.routeModules[routeId]) == null ? void 0 : _a2.clientLoader,
11575
- hasLoader: ((_b2 = ssrInfo.manifest.routes[routeId]) == null ? void 0 : _b2.hasLoader) === true,
11576
- hasHydrateFallback: ((_c = ssrInfo.routeModules[routeId]) == null ? void 0 : _c.HydrateFallback) != null
11577
- };
11578
- },
11552
+ getRouteInfo: (routeId) => ({
11553
+ clientLoader: ssrInfo.routeModules[routeId]?.clientLoader,
11554
+ hasLoader: ssrInfo.manifest.routes[routeId]?.hasLoader === true,
11555
+ hasHydrateFallback: ssrInfo.routeModules[routeId]?.HydrateFallback != null
11556
+ }),
11579
11557
  location: window.location,
11580
- basename: (_b = window.__reactRouterContext) == null ? void 0 : _b.basename,
11558
+ basename: window.__reactRouterContext?.basename,
11581
11559
  isSpaMode: ssrInfo.context.isSpaMode
11582
11560
  });
11583
11561
  }
@@ -1,5 +1,5 @@
1
- import { R, K as Ks, Q as Qe } from "./mermaid-3ZIDBTTL-CCVNMOf9.js";
2
- import { r as reactExports, j as jsxRuntimeExports } from "./index-BQ-Xa8kF.js";
1
+ import { R, K as Ks, Q as Qe } from "./mermaid-3ZIDBTTL-8p93TMNC.js";
2
+ import { r as reactExports, j as jsxRuntimeExports } from "./index-BbkkdbNz.js";
3
3
  var L = ({ code: s, language: t, raw: e, className: n, ...d$1 }) => {
4
4
  let { shikiTheme: l } = reactExports.useContext(R), o = Ks(), [m, i] = reactExports.useState(e);
5
5
  return reactExports.useEffect(() => {