@browsersync/bslive 0.0.9 → 0.0.13

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 (68) hide show
  1. package/Cargo.toml +3 -2
  2. package/bslive/src/lib.rs +8 -3
  3. package/bsnext/src/main.rs +9 -3
  4. package/crates/bsnext_client/generated/dto.ts +33 -2
  5. package/crates/bsnext_client/generated/schema.ts +52 -2
  6. package/crates/bsnext_client/{dist → inject/dist}/index.js +105 -58
  7. package/crates/bsnext_client/inject/package.json +12 -0
  8. package/crates/bsnext_client/{ts → inject/src}/index.ts +2 -2
  9. package/crates/bsnext_client/package-lock.json +89 -3
  10. package/crates/bsnext_client/package.json +4 -2
  11. package/crates/bsnext_client/src/lib.rs +10 -0
  12. package/crates/bsnext_client/tsconfig.json +8 -2
  13. package/crates/bsnext_client/ui/dist/index.css +78 -0
  14. package/crates/bsnext_client/ui/dist/index.js +997 -0
  15. package/crates/bsnext_client/{index.html → ui/index.html} +8 -4
  16. package/crates/bsnext_client/ui/input.yml +19 -0
  17. package/crates/bsnext_client/ui/package.json +18 -0
  18. package/crates/bsnext_client/ui/src/components/bs-debug.ts +27 -0
  19. package/crates/bsnext_client/ui/src/components/bs-header.ts +33 -0
  20. package/crates/bsnext_client/ui/src/components/bs-icon.ts +101 -0
  21. package/crates/bsnext_client/ui/src/components/bs-server-detail.ts +21 -0
  22. package/crates/bsnext_client/ui/src/components/bs-server-identity.ts +24 -0
  23. package/crates/bsnext_client/ui/src/components/bs-server-list.ts +39 -0
  24. package/crates/bsnext_client/ui/src/index.ts +39 -0
  25. package/crates/bsnext_client/ui/styles/base.css.ts +17 -0
  26. package/crates/bsnext_client/ui/styles/reset.css +52 -0
  27. package/crates/bsnext_client/ui/styles/style.css +29 -0
  28. package/crates/bsnext_client/ui/svg/wordmark-white.svg +38 -0
  29. package/crates/bsnext_core/Cargo.toml +1 -0
  30. package/crates/bsnext_core/src/common_layers.rs +62 -0
  31. package/crates/bsnext_core/src/dir_loader.rs +1 -1
  32. package/crates/bsnext_core/src/dto.rs +62 -2
  33. package/crates/bsnext_core/src/lib.rs +1 -0
  34. package/crates/bsnext_core/src/not_found/mod.rs +0 -1
  35. package/crates/bsnext_core/src/not_found/not_found_service.rs +5 -11
  36. package/crates/bsnext_core/src/raw_loader.rs +4 -34
  37. package/crates/bsnext_core/src/server/handler_listen.rs +10 -4
  38. package/crates/bsnext_core/src/server/router/assets.rs +39 -0
  39. package/crates/bsnext_core/src/server/router/mod.rs +15 -4
  40. package/crates/bsnext_core/src/server/router/pub_api.rs +39 -0
  41. package/crates/bsnext_core/src/server/router/snapshots/bsnext_core__server__router__tests__test__handlers.snap +9 -0
  42. package/crates/bsnext_core/src/server/router/tests.rs +11 -6
  43. package/crates/bsnext_core/src/server/state.rs +4 -0
  44. package/crates/bsnext_core/src/servers_supervisor/get_servers_handler.rs +3 -2
  45. package/crates/bsnext_core/src/servers_supervisor/start_handler.rs +5 -1
  46. package/crates/bsnext_fs/src/actor.rs +2 -1
  47. package/crates/bsnext_fs/src/filter.rs +14 -5
  48. package/crates/bsnext_fs/src/test/mod.rs +1 -1
  49. package/crates/bsnext_fs/src/watch_path_handler.rs +1 -1
  50. package/crates/bsnext_fs/src/watcher.rs +2 -1
  51. package/crates/bsnext_input/Cargo.toml +3 -0
  52. package/crates/bsnext_input/src/input_test/mod.rs +34 -0
  53. package/crates/bsnext_input/src/input_test/snapshots/bsnext_input__input_test__deserialize_3_headers.snap +29 -0
  54. package/crates/bsnext_input/src/input_test/snapshots/bsnext_input__input_test__deserialize_3_headers_control.snap +25 -0
  55. package/crates/bsnext_input/src/route.rs +4 -0
  56. package/crates/bsnext_output/src/pretty.rs +1 -1
  57. package/crates/bsnext_system/Cargo.toml +1 -1
  58. package/crates/bsnext_system/src/args.rs +4 -0
  59. package/crates/bsnext_system/src/monitor_any_watchables.rs +20 -14
  60. package/crates/bsnext_system/src/start_kind/snapshots/bsnext_system__start_kind__start_from_paths__test__test-2.snap +2 -1
  61. package/crates/bsnext_system/src/start_kind/snapshots/bsnext_system__start_kind__start_from_paths__test__test.snap +2 -1
  62. package/crates/bsnext_tracing/src/lib.rs +42 -4
  63. package/examples/kitchen-sink/input.yml +1 -1
  64. package/package.json +17 -17
  65. package/crates/bsnext_client/style.css +0 -3
  66. package/crates/bsnext_core/src/not_found/not_found.html +0 -20
  67. package/crates/bsnext_core/src/not_found/route_list.rs +0 -49
  68. /package/crates/bsnext_client/{ts → inject/src}/console.ts +0 -0
package/Cargo.toml CHANGED
@@ -13,7 +13,7 @@ tokio-stream = { version = "0.1.15", features = ["sync"] }
13
13
  futures = "0.3.30"
14
14
  futures-util = { version = "0.3", default-features = false, features = ["sink", "std"] }
15
15
  tower = { version = "0.4.13" }
16
- tower-http = { version = "0.5.0", features = ['trace', 'fs', 'compression-full', 'decompression-full', 'catch-panic', 'cors', 'timeout'] }
16
+ tower-http = { version = "0.5.0", features = ['trace', 'fs', 'compression-full', 'decompression-full', 'catch-panic', 'cors', 'timeout', 'set-header'] }
17
17
  tracing = "0.1.40"
18
18
  tracing-subscriber = { version = "0.3.18", features = ["env-filter", "json"] }
19
19
  actix = "0.13.1"
@@ -30,4 +30,5 @@ typeshare = "1"
30
30
  random_word = { version = "0.4.3", features = ["en"] }
31
31
  toml = { version = "0.8.12" }
32
32
  mime_guess = "2.0.4"
33
- tempfile = "3.10.1"
33
+ tempfile = "3.10.1"
34
+ insta = { version = "1.38.0", features = ["yaml"] }
package/bslive/src/lib.rs CHANGED
@@ -17,7 +17,7 @@ use bsnext_system::args::Args;
17
17
  use bsnext_system::start_kind::StartKind;
18
18
  use bsnext_system::startup::{DidStart, StartupResult};
19
19
  use bsnext_system::{BsSystem, Start};
20
- use bsnext_tracing::{init_tracing, OutputFormat};
20
+ use bsnext_tracing::{init_tracing, OutputFormat, WriteOption};
21
21
  use tokio::sync::{mpsc, oneshot};
22
22
  use tokio::time::sleep;
23
23
 
@@ -51,8 +51,13 @@ async fn main_sync(args: Vec<String>) -> Result<(), anyhow::Error> {
51
51
  let args = Args::parse_from(&args);
52
52
  let format_clone = args.format;
53
53
 
54
- init_tracing(args.log_level, args.format);
55
- tracing::trace!(?args);
54
+ let write_opt = if args.write_log {
55
+ WriteOption::File
56
+ } else {
57
+ WriteOption::None
58
+ };
59
+ init_tracing(args.log_level, args.format, write_opt);
60
+ tracing::debug!("{:#?}", args);
56
61
 
57
62
  let (tx, rx) = oneshot::channel();
58
63
  let (startup_oneshot_sender, startup_oneshot_receiver) = oneshot::channel::<StartupResult>();
@@ -9,7 +9,7 @@ use bsnext_system::args::Args;
9
9
  use bsnext_system::start_kind::StartKind;
10
10
  use bsnext_system::startup::{DidStart, StartupResult};
11
11
  use bsnext_system::{BsSystem, Start};
12
- use bsnext_tracing::{init_tracing, OutputFormat};
12
+ use bsnext_tracing::{init_tracing, OutputFormat, WriteOption};
13
13
  use clap::Parser;
14
14
  use tokio::sync::{mpsc, oneshot};
15
15
 
@@ -19,9 +19,14 @@ async fn main() -> Result<(), anyhow::Error> {
19
19
  let cwd = PathBuf::from(current_dir().unwrap().to_string_lossy().to_string());
20
20
  let args = Args::parse();
21
21
  let format_clone = args.format;
22
+ let write_opt = if args.write_log {
23
+ WriteOption::File
24
+ } else {
25
+ WriteOption::None
26
+ };
22
27
 
23
- init_tracing(args.log_level, args.format);
24
- tracing::trace!(?args);
28
+ init_tracing(args.log_level, args.format, write_opt);
29
+ tracing::debug!("{:#?}", args);
25
30
 
26
31
  let (tx, rx) = oneshot::channel();
27
32
  let (startup_oneshot_sender, startup_oneshot_receiver) = oneshot::channel::<StartupResult>();
@@ -55,6 +60,7 @@ async fn main() -> Result<(), anyhow::Error> {
55
60
  Some(OutputFormat::Json) => Writers::Json,
56
61
  };
57
62
  while let Some(evt) = events_receiver.recv().await {
63
+ tracing::debug!(external_event=?evt);
58
64
  match printer.handle_event(stdout, &evt) {
59
65
  Ok(_v) => {}
60
66
  Err(e) => tracing::error!("could not write to stdout {e}"),
@@ -2,6 +2,36 @@
2
2
  Generated by typeshare 1.9.2
3
3
  */
4
4
 
5
+ export type RouteKindDTO =
6
+ | { kind: "Html", payload: {
7
+ html: string;
8
+ }}
9
+ | { kind: "Json", payload: {
10
+ json_str: string;
11
+ }}
12
+ | { kind: "Raw", payload: {
13
+ raw: string;
14
+ }}
15
+ | { kind: "Sse", payload: {
16
+ sse: string;
17
+ }}
18
+ | { kind: "Proxy", payload: {
19
+ proxy: string;
20
+ }}
21
+ | { kind: "Dir", payload: {
22
+ dir: string;
23
+ }};
24
+
25
+ export interface RouteDTO {
26
+ path: string;
27
+ kind: RouteKindDTO;
28
+ }
29
+
30
+ export interface ServerDesc {
31
+ routes: RouteDTO[];
32
+ id: string;
33
+ }
34
+
5
35
  export type IdentityDTO =
6
36
  | { kind: "Both", payload: {
7
37
  name: string;
@@ -14,13 +44,14 @@ export type IdentityDTO =
14
44
  name: string;
15
45
  }};
16
46
 
17
- export interface ServersDTO {
47
+ export interface ServerDTO {
48
+ id: string;
18
49
  identity: IdentityDTO;
19
50
  socket_addr: string;
20
51
  }
21
52
 
22
53
  export interface GetServersMessageResponse {
23
- servers: ServersDTO[];
54
+ servers: ServerDTO[];
24
55
  }
25
56
 
26
57
  export type ServerChange =
@@ -2,6 +2,55 @@
2
2
  import { z } from "zod";
3
3
  import { EventLevel, ChangeKind, ChangeDTO } from "./dto";
4
4
 
5
+ export const routeKindDTOSchema = z.union([
6
+ z.object({
7
+ kind: z.literal("Html"),
8
+ payload: z.object({
9
+ html: z.string(),
10
+ }),
11
+ }),
12
+ z.object({
13
+ kind: z.literal("Json"),
14
+ payload: z.object({
15
+ json_str: z.string(),
16
+ }),
17
+ }),
18
+ z.object({
19
+ kind: z.literal("Raw"),
20
+ payload: z.object({
21
+ raw: z.string(),
22
+ }),
23
+ }),
24
+ z.object({
25
+ kind: z.literal("Sse"),
26
+ payload: z.object({
27
+ sse: z.string(),
28
+ }),
29
+ }),
30
+ z.object({
31
+ kind: z.literal("Proxy"),
32
+ payload: z.object({
33
+ proxy: z.string(),
34
+ }),
35
+ }),
36
+ z.object({
37
+ kind: z.literal("Dir"),
38
+ payload: z.object({
39
+ dir: z.string(),
40
+ }),
41
+ }),
42
+ ]);
43
+
44
+ export const routeDTOSchema = z.object({
45
+ path: z.string(),
46
+ kind: routeKindDTOSchema,
47
+ });
48
+
49
+ export const serverDescSchema = z.object({
50
+ routes: z.array(routeDTOSchema),
51
+ id: z.string(),
52
+ });
53
+
5
54
  export const identityDTOSchema = z.union([
6
55
  z.object({
7
56
  kind: z.literal("Both"),
@@ -24,13 +73,14 @@ export const identityDTOSchema = z.union([
24
73
  }),
25
74
  ]);
26
75
 
27
- export const serversDTOSchema = z.object({
76
+ export const serverDTOSchema = z.object({
77
+ id: z.string(),
28
78
  identity: identityDTOSchema,
29
79
  socket_addr: z.string(),
30
80
  });
31
81
 
32
82
  export const getServersMessageResponseSchema = z.object({
33
- servers: z.array(serversDTOSchema),
83
+ servers: z.array(serverDTOSchema),
34
84
  });
35
85
 
36
86
  export const serverChangeSchema = z.union([
@@ -24,9 +24,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  mod
25
25
  ));
26
26
 
27
- // ../../node_modules/livereload-js/src/reloader.js
27
+ // ../node_modules/livereload-js/src/reloader.js
28
28
  var require_reloader = __commonJS({
29
- "../../node_modules/livereload-js/src/reloader.js"(exports) {
29
+ "../node_modules/livereload-js/src/reloader.js"(exports) {
30
30
  function splitUrl(url2) {
31
31
  let hash = "";
32
32
  let params = "";
@@ -463,9 +463,9 @@ var require_reloader = __commonJS({
463
463
  }
464
464
  });
465
465
 
466
- // ../../node_modules/livereload-js/src/timer.js
466
+ // ../node_modules/livereload-js/src/timer.js
467
467
  var require_timer = __commonJS({
468
- "../../node_modules/livereload-js/src/timer.js"(exports) {
468
+ "../node_modules/livereload-js/src/timer.js"(exports) {
469
469
  var Timer2 = class {
470
470
  constructor(func) {
471
471
  this.func = func;
@@ -497,11 +497,11 @@ var require_timer = __commonJS({
497
497
  }
498
498
  });
499
499
 
500
- // ts/index.ts
501
- var import_reloader = __toESM(require_reloader(), 1);
502
- var import_timer2 = __toESM(require_timer(), 1);
500
+ // src/index.ts
501
+ var import_reloader = __toESM(require_reloader());
502
+ var import_timer2 = __toESM(require_timer());
503
503
 
504
- // ../../node_modules/tslib/tslib.es6.mjs
504
+ // ../node_modules/tslib/tslib.es6.mjs
505
505
  var extendStatics = function(d, b) {
506
506
  extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
507
507
  d2.__proto__ = b2;
@@ -742,12 +742,12 @@ function __asyncValues(o) {
742
742
  }
743
743
  }
744
744
 
745
- // ../../node_modules/rxjs/dist/esm5/internal/util/isFunction.js
745
+ // ../node_modules/rxjs/dist/esm5/internal/util/isFunction.js
746
746
  function isFunction(value) {
747
747
  return typeof value === "function";
748
748
  }
749
749
 
750
- // ../../node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js
750
+ // ../node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js
751
751
  function createErrorClass(createImpl) {
752
752
  var _super = function(instance) {
753
753
  Error.call(instance);
@@ -759,7 +759,7 @@ function createErrorClass(createImpl) {
759
759
  return ctorFunc;
760
760
  }
761
761
 
762
- // ../../node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js
762
+ // ../node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js
763
763
  var UnsubscriptionError = createErrorClass(function(_super) {
764
764
  return function UnsubscriptionErrorImpl(errors) {
765
765
  _super(this);
@@ -771,7 +771,7 @@ var UnsubscriptionError = createErrorClass(function(_super) {
771
771
  };
772
772
  });
773
773
 
774
- // ../../node_modules/rxjs/dist/esm5/internal/util/arrRemove.js
774
+ // ../node_modules/rxjs/dist/esm5/internal/util/arrRemove.js
775
775
  function arrRemove(arr, item) {
776
776
  if (arr) {
777
777
  var index = arr.indexOf(item);
@@ -779,7 +779,7 @@ function arrRemove(arr, item) {
779
779
  }
780
780
  }
781
781
 
782
- // ../../node_modules/rxjs/dist/esm5/internal/Subscription.js
782
+ // ../node_modules/rxjs/dist/esm5/internal/Subscription.js
783
783
  var Subscription = function() {
784
784
  function Subscription2(initialTeardown) {
785
785
  this.initialTeardown = initialTeardown;
@@ -916,7 +916,7 @@ function execFinalizer(finalizer) {
916
916
  }
917
917
  }
918
918
 
919
- // ../../node_modules/rxjs/dist/esm5/internal/config.js
919
+ // ../node_modules/rxjs/dist/esm5/internal/config.js
920
920
  var config = {
921
921
  onUnhandledError: null,
922
922
  onStoppedNotification: null,
@@ -925,7 +925,7 @@ var config = {
925
925
  useDeprecatedNextContext: false
926
926
  };
927
927
 
928
- // ../../node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js
928
+ // ../node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js
929
929
  var timeoutProvider = {
930
930
  setTimeout: function(handler, timeout) {
931
931
  var args = [];
@@ -945,7 +945,7 @@ var timeoutProvider = {
945
945
  delegate: void 0
946
946
  };
947
947
 
948
- // ../../node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js
948
+ // ../node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js
949
949
  function reportUnhandledError(err) {
950
950
  timeoutProvider.setTimeout(function() {
951
951
  var onUnhandledError = config.onUnhandledError;
@@ -957,11 +957,11 @@ function reportUnhandledError(err) {
957
957
  });
958
958
  }
959
959
 
960
- // ../../node_modules/rxjs/dist/esm5/internal/util/noop.js
960
+ // ../node_modules/rxjs/dist/esm5/internal/util/noop.js
961
961
  function noop() {
962
962
  }
963
963
 
964
- // ../../node_modules/rxjs/dist/esm5/internal/NotificationFactories.js
964
+ // ../node_modules/rxjs/dist/esm5/internal/NotificationFactories.js
965
965
  var COMPLETE_NOTIFICATION = function() {
966
966
  return createNotification("C", void 0, void 0);
967
967
  }();
@@ -979,7 +979,7 @@ function createNotification(kind, value, error) {
979
979
  };
980
980
  }
981
981
 
982
- // ../../node_modules/rxjs/dist/esm5/internal/util/errorContext.js
982
+ // ../node_modules/rxjs/dist/esm5/internal/util/errorContext.js
983
983
  var context = null;
984
984
  function errorContext(cb) {
985
985
  if (config.useDeprecatedSynchronousErrorHandling) {
@@ -1006,7 +1006,7 @@ function captureError(err) {
1006
1006
  }
1007
1007
  }
1008
1008
 
1009
- // ../../node_modules/rxjs/dist/esm5/internal/Subscriber.js
1009
+ // ../node_modules/rxjs/dist/esm5/internal/Subscriber.js
1010
1010
  var Subscriber = function(_super) {
1011
1011
  __extends(Subscriber2, _super);
1012
1012
  function Subscriber2(destination) {
@@ -1171,17 +1171,17 @@ var EMPTY_OBSERVER = {
1171
1171
  complete: noop
1172
1172
  };
1173
1173
 
1174
- // ../../node_modules/rxjs/dist/esm5/internal/symbol/observable.js
1174
+ // ../node_modules/rxjs/dist/esm5/internal/symbol/observable.js
1175
1175
  var observable = function() {
1176
1176
  return typeof Symbol === "function" && Symbol.observable || "@@observable";
1177
1177
  }();
1178
1178
 
1179
- // ../../node_modules/rxjs/dist/esm5/internal/util/identity.js
1179
+ // ../node_modules/rxjs/dist/esm5/internal/util/identity.js
1180
1180
  function identity(x) {
1181
1181
  return x;
1182
1182
  }
1183
1183
 
1184
- // ../../node_modules/rxjs/dist/esm5/internal/util/pipe.js
1184
+ // ../node_modules/rxjs/dist/esm5/internal/util/pipe.js
1185
1185
  function pipeFromArray(fns) {
1186
1186
  if (fns.length === 0) {
1187
1187
  return identity;
@@ -1196,7 +1196,7 @@ function pipeFromArray(fns) {
1196
1196
  };
1197
1197
  }
1198
1198
 
1199
- // ../../node_modules/rxjs/dist/esm5/internal/Observable.js
1199
+ // ../node_modules/rxjs/dist/esm5/internal/Observable.js
1200
1200
  var Observable = function() {
1201
1201
  function Observable3(subscribe) {
1202
1202
  if (subscribe) {
@@ -1288,7 +1288,7 @@ function isSubscriber(value) {
1288
1288
  return value && value instanceof Subscriber || isObserver(value) && isSubscription(value);
1289
1289
  }
1290
1290
 
1291
- // ../../node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js
1291
+ // ../node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js
1292
1292
  var ObjectUnsubscribedError = createErrorClass(function(_super) {
1293
1293
  return function ObjectUnsubscribedErrorImpl() {
1294
1294
  _super(this);
@@ -1297,7 +1297,7 @@ var ObjectUnsubscribedError = createErrorClass(function(_super) {
1297
1297
  };
1298
1298
  });
1299
1299
 
1300
- // ../../node_modules/rxjs/dist/esm5/internal/Subject.js
1300
+ // ../node_modules/rxjs/dist/esm5/internal/Subject.js
1301
1301
  var Subject = function(_super) {
1302
1302
  __extends(Subject2, _super);
1303
1303
  function Subject2() {
@@ -1454,7 +1454,7 @@ var AnonymousSubject = function(_super) {
1454
1454
  return AnonymousSubject2;
1455
1455
  }(Subject);
1456
1456
 
1457
- // ../../node_modules/rxjs/dist/esm5/internal/scheduler/dateTimestampProvider.js
1457
+ // ../node_modules/rxjs/dist/esm5/internal/scheduler/dateTimestampProvider.js
1458
1458
  var dateTimestampProvider = {
1459
1459
  now: function() {
1460
1460
  return (dateTimestampProvider.delegate || Date).now();
@@ -1462,7 +1462,7 @@ var dateTimestampProvider = {
1462
1462
  delegate: void 0
1463
1463
  };
1464
1464
 
1465
- // ../../node_modules/rxjs/dist/esm5/internal/ReplaySubject.js
1465
+ // ../node_modules/rxjs/dist/esm5/internal/ReplaySubject.js
1466
1466
  var ReplaySubject = function(_super) {
1467
1467
  __extends(ReplaySubject2, _super);
1468
1468
  function ReplaySubject2(_bufferSize, _windowTime, _timestampProvider) {
@@ -1523,7 +1523,7 @@ var ReplaySubject = function(_super) {
1523
1523
  return ReplaySubject2;
1524
1524
  }(Subject);
1525
1525
 
1526
- // ../../node_modules/rxjs/dist/esm5/internal/observable/dom/WebSocketSubject.js
1526
+ // ../node_modules/rxjs/dist/esm5/internal/observable/dom/WebSocketSubject.js
1527
1527
  var DEFAULT_WEBSOCKET_CONFIG = {
1528
1528
  url: "",
1529
1529
  deserializer: function(e) {
@@ -1735,12 +1735,12 @@ var WebSocketSubject = function(_super) {
1735
1735
  return WebSocketSubject2;
1736
1736
  }(AnonymousSubject);
1737
1737
 
1738
- // ../../node_modules/rxjs/dist/esm5/internal/observable/dom/webSocket.js
1738
+ // ../node_modules/rxjs/dist/esm5/internal/observable/dom/webSocket.js
1739
1739
  function webSocket(urlConfigOrSource) {
1740
1740
  return new WebSocketSubject(urlConfigOrSource);
1741
1741
  }
1742
1742
 
1743
- // ../../node_modules/rxjs/dist/esm5/internal/util/lift.js
1743
+ // ../node_modules/rxjs/dist/esm5/internal/util/lift.js
1744
1744
  function hasLift(source) {
1745
1745
  return isFunction(source === null || source === void 0 ? void 0 : source.lift);
1746
1746
  }
@@ -1759,7 +1759,7 @@ function operate(init) {
1759
1759
  };
1760
1760
  }
1761
1761
 
1762
- // ../../node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js
1762
+ // ../node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js
1763
1763
  function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {
1764
1764
  return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);
1765
1765
  }
@@ -1807,7 +1807,7 @@ var OperatorSubscriber = function(_super) {
1807
1807
  return OperatorSubscriber2;
1808
1808
  }(Subscriber);
1809
1809
 
1810
- // ../../node_modules/rxjs/dist/esm5/internal/scheduler/Action.js
1810
+ // ../node_modules/rxjs/dist/esm5/internal/scheduler/Action.js
1811
1811
  var Action = function(_super) {
1812
1812
  __extends(Action2, _super);
1813
1813
  function Action2(scheduler, work) {
@@ -1822,7 +1822,7 @@ var Action = function(_super) {
1822
1822
  return Action2;
1823
1823
  }(Subscription);
1824
1824
 
1825
- // ../../node_modules/rxjs/dist/esm5/internal/scheduler/intervalProvider.js
1825
+ // ../node_modules/rxjs/dist/esm5/internal/scheduler/intervalProvider.js
1826
1826
  var intervalProvider = {
1827
1827
  setInterval: function(handler, timeout) {
1828
1828
  var args = [];
@@ -1842,7 +1842,7 @@ var intervalProvider = {
1842
1842
  delegate: void 0
1843
1843
  };
1844
1844
 
1845
- // ../../node_modules/rxjs/dist/esm5/internal/scheduler/AsyncAction.js
1845
+ // ../node_modules/rxjs/dist/esm5/internal/scheduler/AsyncAction.js
1846
1846
  var AsyncAction = function(_super) {
1847
1847
  __extends(AsyncAction2, _super);
1848
1848
  function AsyncAction2(scheduler, work) {
@@ -1932,7 +1932,7 @@ var AsyncAction = function(_super) {
1932
1932
  return AsyncAction2;
1933
1933
  }(Action);
1934
1934
 
1935
- // ../../node_modules/rxjs/dist/esm5/internal/Scheduler.js
1935
+ // ../node_modules/rxjs/dist/esm5/internal/Scheduler.js
1936
1936
  var Scheduler = function() {
1937
1937
  function Scheduler2(schedulerActionCtor, now) {
1938
1938
  if (now === void 0) {
@@ -1951,7 +1951,7 @@ var Scheduler = function() {
1951
1951
  return Scheduler2;
1952
1952
  }();
1953
1953
 
1954
- // ../../node_modules/rxjs/dist/esm5/internal/scheduler/AsyncScheduler.js
1954
+ // ../node_modules/rxjs/dist/esm5/internal/scheduler/AsyncScheduler.js
1955
1955
  var AsyncScheduler = function(_super) {
1956
1956
  __extends(AsyncScheduler2, _super);
1957
1957
  function AsyncScheduler2(SchedulerAction, now) {
@@ -1987,41 +1987,41 @@ var AsyncScheduler = function(_super) {
1987
1987
  return AsyncScheduler2;
1988
1988
  }(Scheduler);
1989
1989
 
1990
- // ../../node_modules/rxjs/dist/esm5/internal/scheduler/async.js
1990
+ // ../node_modules/rxjs/dist/esm5/internal/scheduler/async.js
1991
1991
  var asyncScheduler = new AsyncScheduler(AsyncAction);
1992
1992
  var async = asyncScheduler;
1993
1993
 
1994
- // ../../node_modules/rxjs/dist/esm5/internal/util/isScheduler.js
1994
+ // ../node_modules/rxjs/dist/esm5/internal/util/isScheduler.js
1995
1995
  function isScheduler(value) {
1996
1996
  return value && isFunction(value.schedule);
1997
1997
  }
1998
1998
 
1999
- // ../../node_modules/rxjs/dist/esm5/internal/util/isArrayLike.js
1999
+ // ../node_modules/rxjs/dist/esm5/internal/util/isArrayLike.js
2000
2000
  var isArrayLike = function(x) {
2001
2001
  return x && typeof x.length === "number" && typeof x !== "function";
2002
2002
  };
2003
2003
 
2004
- // ../../node_modules/rxjs/dist/esm5/internal/util/isPromise.js
2004
+ // ../node_modules/rxjs/dist/esm5/internal/util/isPromise.js
2005
2005
  function isPromise(value) {
2006
2006
  return isFunction(value === null || value === void 0 ? void 0 : value.then);
2007
2007
  }
2008
2008
 
2009
- // ../../node_modules/rxjs/dist/esm5/internal/util/isInteropObservable.js
2009
+ // ../node_modules/rxjs/dist/esm5/internal/util/isInteropObservable.js
2010
2010
  function isInteropObservable(input) {
2011
2011
  return isFunction(input[observable]);
2012
2012
  }
2013
2013
 
2014
- // ../../node_modules/rxjs/dist/esm5/internal/util/isAsyncIterable.js
2014
+ // ../node_modules/rxjs/dist/esm5/internal/util/isAsyncIterable.js
2015
2015
  function isAsyncIterable(obj) {
2016
2016
  return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);
2017
2017
  }
2018
2018
 
2019
- // ../../node_modules/rxjs/dist/esm5/internal/util/throwUnobservableError.js
2019
+ // ../node_modules/rxjs/dist/esm5/internal/util/throwUnobservableError.js
2020
2020
  function createInvalidObservableTypeError(input) {
2021
2021
  return new TypeError("You provided " + (input !== null && typeof input === "object" ? "an invalid object" : "'" + input + "'") + " where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.");
2022
2022
  }
2023
2023
 
2024
- // ../../node_modules/rxjs/dist/esm5/internal/symbol/iterator.js
2024
+ // ../node_modules/rxjs/dist/esm5/internal/symbol/iterator.js
2025
2025
  function getSymbolIterator() {
2026
2026
  if (typeof Symbol !== "function" || !Symbol.iterator) {
2027
2027
  return "@@iterator";
@@ -2030,12 +2030,12 @@ function getSymbolIterator() {
2030
2030
  }
2031
2031
  var iterator = getSymbolIterator();
2032
2032
 
2033
- // ../../node_modules/rxjs/dist/esm5/internal/util/isIterable.js
2033
+ // ../node_modules/rxjs/dist/esm5/internal/util/isIterable.js
2034
2034
  function isIterable(input) {
2035
2035
  return isFunction(input === null || input === void 0 ? void 0 : input[iterator]);
2036
2036
  }
2037
2037
 
2038
- // ../../node_modules/rxjs/dist/esm5/internal/util/isReadableStreamLike.js
2038
+ // ../node_modules/rxjs/dist/esm5/internal/util/isReadableStreamLike.js
2039
2039
  function readableStreamLikeToAsyncGenerator(readableStream) {
2040
2040
  return __asyncGenerator(this, arguments, function readableStreamLikeToAsyncGenerator_1() {
2041
2041
  var reader, _a, value, done;
@@ -2080,7 +2080,7 @@ function isReadableStreamLike(obj) {
2080
2080
  return isFunction(obj === null || obj === void 0 ? void 0 : obj.getReader);
2081
2081
  }
2082
2082
 
2083
- // ../../node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js
2083
+ // ../node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js
2084
2084
  function innerFrom(input) {
2085
2085
  if (input instanceof Observable) {
2086
2086
  return input;
@@ -2225,12 +2225,12 @@ function process(asyncIterable, subscriber) {
2225
2225
  });
2226
2226
  }
2227
2227
 
2228
- // ../../node_modules/rxjs/dist/esm5/internal/util/isDate.js
2228
+ // ../node_modules/rxjs/dist/esm5/internal/util/isDate.js
2229
2229
  function isValidDate(value) {
2230
2230
  return value instanceof Date && !isNaN(value);
2231
2231
  }
2232
2232
 
2233
- // ../../node_modules/rxjs/dist/esm5/internal/observable/timer.js
2233
+ // ../node_modules/rxjs/dist/esm5/internal/observable/timer.js
2234
2234
  function timer(dueTime, intervalOrScheduler, scheduler) {
2235
2235
  if (dueTime === void 0) {
2236
2236
  dueTime = 0;
@@ -2265,7 +2265,7 @@ function timer(dueTime, intervalOrScheduler, scheduler) {
2265
2265
  });
2266
2266
  }
2267
2267
 
2268
- // ../../node_modules/rxjs/dist/esm5/internal/operators/retry.js
2268
+ // ../node_modules/rxjs/dist/esm5/internal/operators/retry.js
2269
2269
  function retry(configOrCount) {
2270
2270
  if (configOrCount === void 0) {
2271
2271
  configOrCount = Infinity;
@@ -2326,7 +2326,7 @@ function retry(configOrCount) {
2326
2326
  });
2327
2327
  }
2328
2328
 
2329
- // ../../node_modules/zod/lib/index.mjs
2329
+ // ../node_modules/zod/lib/index.mjs
2330
2330
  var util;
2331
2331
  (function(util2) {
2332
2332
  util2.assertEqual = (val) => val;
@@ -6246,7 +6246,7 @@ var z = /* @__PURE__ */ Object.freeze({
6246
6246
  ZodError
6247
6247
  });
6248
6248
 
6249
- // generated/dto.ts
6249
+ // ../generated/dto.ts
6250
6250
  var EventLevel = /* @__PURE__ */ ((EventLevel2) => {
6251
6251
  EventLevel2["External"] = "BSLIVE_EXTERNAL";
6252
6252
  return EventLevel2;
@@ -6258,7 +6258,53 @@ var ChangeKind = /* @__PURE__ */ ((ChangeKind2) => {
6258
6258
  return ChangeKind2;
6259
6259
  })(ChangeKind || {});
6260
6260
 
6261
- // generated/schema.ts
6261
+ // ../generated/schema.ts
6262
+ var routeKindDTOSchema = z.union([
6263
+ z.object({
6264
+ kind: z.literal("Html"),
6265
+ payload: z.object({
6266
+ html: z.string()
6267
+ })
6268
+ }),
6269
+ z.object({
6270
+ kind: z.literal("Json"),
6271
+ payload: z.object({
6272
+ json_str: z.string()
6273
+ })
6274
+ }),
6275
+ z.object({
6276
+ kind: z.literal("Raw"),
6277
+ payload: z.object({
6278
+ raw: z.string()
6279
+ })
6280
+ }),
6281
+ z.object({
6282
+ kind: z.literal("Sse"),
6283
+ payload: z.object({
6284
+ sse: z.string()
6285
+ })
6286
+ }),
6287
+ z.object({
6288
+ kind: z.literal("Proxy"),
6289
+ payload: z.object({
6290
+ proxy: z.string()
6291
+ })
6292
+ }),
6293
+ z.object({
6294
+ kind: z.literal("Dir"),
6295
+ payload: z.object({
6296
+ dir: z.string()
6297
+ })
6298
+ })
6299
+ ]);
6300
+ var routeDTOSchema = z.object({
6301
+ path: z.string(),
6302
+ kind: routeKindDTOSchema
6303
+ });
6304
+ var serverDescSchema = z.object({
6305
+ routes: z.array(routeDTOSchema),
6306
+ id: z.string()
6307
+ });
6262
6308
  var identityDTOSchema = z.union([
6263
6309
  z.object({
6264
6310
  kind: z.literal("Both"),
@@ -6280,12 +6326,13 @@ var identityDTOSchema = z.union([
6280
6326
  })
6281
6327
  })
6282
6328
  ]);
6283
- var serversDTOSchema = z.object({
6329
+ var serverDTOSchema = z.object({
6330
+ id: z.string(),
6284
6331
  identity: identityDTOSchema,
6285
6332
  socket_addr: z.string()
6286
6333
  });
6287
6334
  var getServersMessageResponseSchema = z.object({
6288
- servers: z.array(serversDTOSchema)
6335
+ servers: z.array(serverDTOSchema)
6289
6336
  });
6290
6337
  var serverChangeSchema = z.union([
6291
6338
  z.object({
@@ -6424,7 +6471,7 @@ var clientEventSchema = z.object({
6424
6471
  payload: changeDTOSchema
6425
6472
  });
6426
6473
 
6427
- // ts/console.ts
6474
+ // src/console.ts
6428
6475
  function createLRConsoleObserver() {
6429
6476
  const subject = new Subject();
6430
6477
  return [subject, {
@@ -6437,7 +6484,7 @@ function createLRConsoleObserver() {
6437
6484
  }];
6438
6485
  }
6439
6486
 
6440
- // ts/index.ts
6487
+ // src/index.ts
6441
6488
  var [consoleSubject, consoleApi] = createLRConsoleObserver();
6442
6489
  var r = new import_reloader.Reloader(window, consoleApi, import_timer2.Timer);
6443
6490
  var url = new URL(window.location.href);