@noya-app/noya-multiplayer-react 0.1.73 → 0.1.75

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/dist/index.mjs CHANGED
@@ -2023,7 +2023,7 @@ function Literal(value, options = {}) {
2023
2023
  }
2024
2024
 
2025
2025
  // ../../node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs
2026
- function Boolean(options = {}) {
2026
+ function Boolean2(options = {}) {
2027
2027
  return {
2028
2028
  ...options,
2029
2029
  [Kind]: "Boolean",
@@ -2057,7 +2057,7 @@ function String2(options = {}) {
2057
2057
  // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs
2058
2058
  function* FromUnion(syntax) {
2059
2059
  const trim = syntax.trim().replace(/"|'/g, "");
2060
- return trim === "boolean" ? yield Boolean() : trim === "number" ? yield Number2() : trim === "bigint" ? yield BigInt2() : trim === "string" ? yield String2() : yield (() => {
2060
+ return trim === "boolean" ? yield Boolean2() : trim === "number" ? yield Number2() : trim === "bigint" ? yield BigInt2() : trim === "string" ? yield String2() : yield (() => {
2061
2061
  const literals = trim.split("|").map((literal) => Literal(literal.trim()));
2062
2062
  return literals.length === 0 ? Never() : literals.length === 1 ? literals[0] : UnionEvaluated(literals);
2063
2063
  })();
@@ -3849,7 +3849,7 @@ __export(type_exports3, {
3849
3849
  AsyncIterator: () => AsyncIterator,
3850
3850
  Awaited: () => Awaited,
3851
3851
  BigInt: () => BigInt2,
3852
- Boolean: () => Boolean,
3852
+ Boolean: () => Boolean2,
3853
3853
  Capitalize: () => Capitalize,
3854
3854
  Composite: () => Composite,
3855
3855
  Const: () => Const,
@@ -4612,7 +4612,10 @@ import {
4612
4612
  Observable
4613
4613
  } from "@noya-app/observable";
4614
4614
  import { useJsonMemo, useStableCallback } from "@noya-app/react-utils";
4615
- import React18, {
4615
+ import {
4616
+ findNoyaUser
4617
+ } from "@noya-app/state-manager";
4618
+ import React19, {
4616
4619
  createContext,
4617
4620
  useCallback as useCallback3,
4618
4621
  useContext,
@@ -4628,6 +4631,9 @@ import {
4628
4631
  localStorageSync,
4629
4632
  NoyaManager as NoyaManager3,
4630
4633
  parentFrameSync,
4634
+ setClientId,
4635
+ setClientImage,
4636
+ setClientName,
4631
4637
  stubSync as stubSync2,
4632
4638
  TypeGuard,
4633
4639
  webSocketSync
@@ -4726,7 +4732,7 @@ var ErrorOverlay = React.memo(function ErrorOverlay2({
4726
4732
  });
4727
4733
 
4728
4734
  // src/inspector/useStateInspector.tsx
4729
- import React16 from "react";
4735
+ import React17 from "react";
4730
4736
  import { createRoot } from "react-dom/client";
4731
4737
  import { useIsomorphicLayoutEffect } from "@noya-app/react-utils";
4732
4738
 
@@ -4860,7 +4866,7 @@ function uuid() {
4860
4866
 
4861
4867
  // src/inspector/StateInspector.tsx
4862
4868
  import { downloadBlob, memoGeneric } from "@noya-app/react-utils";
4863
- import React15, {
4869
+ import React16, {
4864
4870
  useCallback,
4865
4871
  useEffect as useEffect2,
4866
4872
  useLayoutEffect
@@ -5260,7 +5266,9 @@ function EventsSection({
5260
5266
  setShowEvents,
5261
5267
  colorScheme,
5262
5268
  eventsContainerRef,
5263
- connectionEvents
5269
+ connectionEvents,
5270
+ paused,
5271
+ onTogglePaused
5264
5272
  }) {
5265
5273
  const theme = getStateInspectorTheme(colorScheme);
5266
5274
  return /* @__PURE__ */ React9.createElement(
@@ -5269,9 +5277,20 @@ function EventsSection({
5269
5277
  open: showEvents,
5270
5278
  setOpen: setShowEvents,
5271
5279
  title: "Events",
5272
- colorScheme
5280
+ colorScheme,
5281
+ right: /* @__PURE__ */ React9.createElement(StateInspectorButton, { theme, onClick: onTogglePaused }, paused ? "Resume" : "Pause")
5273
5282
  },
5274
- /* @__PURE__ */ React9.createElement(StateInspectorDisclosureRowInner, { ref: eventsContainerRef }, connectionEvents?.map(
5283
+ /* @__PURE__ */ React9.createElement(StateInspectorDisclosureRowInner, { ref: eventsContainerRef }, paused && /* @__PURE__ */ React9.createElement(
5284
+ "div",
5285
+ {
5286
+ style: {
5287
+ padding: "4px 12px",
5288
+ fontSize: "11px",
5289
+ opacity: 0.7
5290
+ }
5291
+ },
5292
+ "Event streaming paused"
5293
+ ), connectionEvents?.map(
5275
5294
  (event, index) => event.type === "stateChange" ? /* @__PURE__ */ React9.createElement(StateInspectorRow, { key: index, colorScheme }, "connection:", " ", /* @__PURE__ */ React9.createElement("span", { style: { fontStyle: "italic" } }, event.state.toLowerCase())) : /* @__PURE__ */ React9.createElement(
5276
5295
  StateInspectorRow,
5277
5296
  {
@@ -5302,7 +5321,7 @@ function EventsSection({
5302
5321
  }
5303
5322
  )
5304
5323
  )
5305
- ), !connectionEvents && /* @__PURE__ */ React9.createElement(
5324
+ ), !connectionEvents?.length && /* @__PURE__ */ React9.createElement(
5306
5325
  "div",
5307
5326
  {
5308
5327
  style: {
@@ -5556,7 +5575,8 @@ function ServerScriptLogsSection({
5556
5575
  logs,
5557
5576
  containerRef,
5558
5577
  paused,
5559
- onTogglePaused
5578
+ onTogglePaused,
5579
+ title = "Server Script Logs"
5560
5580
  }) {
5561
5581
  const theme = getStateInspectorTheme(colorScheme);
5562
5582
  return /* @__PURE__ */ React11.createElement(
@@ -5564,7 +5584,7 @@ function ServerScriptLogsSection({
5564
5584
  {
5565
5585
  open: showLogs,
5566
5586
  setOpen: setShowLogs,
5567
- title: "Server Script Logs",
5587
+ title,
5568
5588
  colorScheme,
5569
5589
  right: /* @__PURE__ */ React11.createElement(StateInspectorButton, { theme, onClick: onTogglePaused }, paused ? "Resume" : "Pause")
5570
5590
  },
@@ -5593,6 +5613,18 @@ function ServerScriptLogsSection({
5593
5613
  },
5594
5614
  /* @__PURE__ */ React11.createElement("span", null, formatTimestamp(log.timestamp)),
5595
5615
  /* @__PURE__ */ React11.createElement("span", { style: { color: levelColors[log.level] } }, log.level),
5616
+ (log.origin || log.target || log.mode) && /* @__PURE__ */ React11.createElement(
5617
+ "span",
5618
+ {
5619
+ style: {
5620
+ fontFamily: "monospace",
5621
+ textTransform: "none",
5622
+ fontSize: "10px",
5623
+ opacity: 0.75
5624
+ }
5625
+ },
5626
+ [log.origin ?? log.target, log.mode].filter(Boolean).join(" / ")
5627
+ ),
5596
5628
  /* @__PURE__ */ React11.createElement(
5597
5629
  "span",
5598
5630
  {
@@ -5618,8 +5650,7 @@ function ServerScriptLogsSection({
5618
5650
  {
5619
5651
  key: index,
5620
5652
  data: value,
5621
- theme,
5622
- expandLevel: 3
5653
+ theme
5623
5654
  }
5624
5655
  )) : /* @__PURE__ */ React11.createElement("span", { style: { fontSize: "11px", opacity: 0.7 } }, "No data")
5625
5656
  ))), !logs?.length && /* @__PURE__ */ React11.createElement(
@@ -6288,6 +6319,31 @@ function useLocalStorageState(key, defaultValue) {
6288
6319
  return [state, setLocalStorageState];
6289
6320
  }
6290
6321
 
6322
+ // src/inspector/usePausedStream.ts
6323
+ import React15 from "react";
6324
+ function usePausedStream(items) {
6325
+ const [paused, setPaused] = React15.useState(false);
6326
+ const [visibleItems, setVisibleItems] = React15.useState(items ?? []);
6327
+ const togglePaused = React15.useCallback(() => {
6328
+ setPaused((value) => {
6329
+ if (!value) {
6330
+ setVisibleItems(items ?? []);
6331
+ }
6332
+ return !value;
6333
+ });
6334
+ }, [items]);
6335
+ React15.useEffect(() => {
6336
+ if (paused) return;
6337
+ setVisibleItems(items ?? []);
6338
+ }, [items, paused]);
6339
+ return {
6340
+ paused,
6341
+ setPaused,
6342
+ togglePaused,
6343
+ visibleItems
6344
+ };
6345
+ }
6346
+
6291
6347
  // src/inspector/StateInspector.tsx
6292
6348
  var StateInspector = memoGeneric(function StateInspector2({
6293
6349
  noyaManager,
@@ -6310,16 +6366,17 @@ var StateInspector = memoGeneric(function StateInspector2({
6310
6366
  activityEventsManager,
6311
6367
  logManager
6312
6368
  } = noyaManager;
6313
- const [didMount, setDidMount] = React15.useState(false);
6369
+ const [didMount, setDidMount] = React16.useState(false);
6314
6370
  const tasks = useObservable(taskManager.tasks$);
6315
6371
  const inputs = useObservable(ioManager.inputs$);
6316
6372
  const outputTransforms = useObservable(ioManager.outputTransforms$);
6317
6373
  useLayoutEffect(() => {
6318
6374
  setDidMount(true);
6319
6375
  }, []);
6320
- const eventsContainerRef = React15.useRef(null);
6321
- const activityEventsContainerRef = React15.useRef(null);
6322
- const serverLogsContainerRef = React15.useRef(null);
6376
+ const eventsContainerRef = React16.useRef(null);
6377
+ const activityEventsContainerRef = React16.useRef(null);
6378
+ const serverLogsContainerRef = React16.useRef(null);
6379
+ const serverSimulationLogsContainerRef = React16.useRef(null);
6323
6380
  const [showInspector, setShowInspector] = useLocalStorageState(
6324
6381
  "noya-multiplayer-react-show-inspector",
6325
6382
  true
@@ -6336,6 +6393,10 @@ var StateInspector = memoGeneric(function StateInspector2({
6336
6393
  "noya-multiplayer-react-show-users",
6337
6394
  true
6338
6395
  );
6396
+ const [showUserDetails, setShowUserDetails] = useLocalStorageState(
6397
+ "noya-multiplayer-react-show-user-details",
6398
+ false
6399
+ );
6339
6400
  const [showData, setShowData] = useLocalStorageState(
6340
6401
  "noya-multiplayer-react-show-data",
6341
6402
  true
@@ -6376,35 +6437,51 @@ var StateInspector = memoGeneric(function StateInspector2({
6376
6437
  "noya-multiplayer-react-show-server-logs",
6377
6438
  false
6378
6439
  );
6440
+ const [showServerSimulationLogs, setShowServerSimulationLogs] = useLocalStorageState(
6441
+ "noya-multiplayer-react-show-server-simulation-logs",
6442
+ false
6443
+ );
6444
+ const [showSimulation, setShowSimulation] = useLocalStorageState(
6445
+ "noya-multiplayer-react-show-simulation",
6446
+ false
6447
+ );
6379
6448
  const connectionEvents = useObservable(connectionEventManager.events$);
6449
+ const {
6450
+ visibleItems: visibleConnectionEvents,
6451
+ paused: connectionEventsPaused,
6452
+ togglePaused: toggleConnectionEventsPaused
6453
+ } = usePausedStream(connectionEvents);
6380
6454
  useEffect2(() => {
6381
6455
  if (eventsContainerRef.current) {
6382
6456
  eventsContainerRef.current.scrollTop = eventsContainerRef.current.scrollHeight;
6383
6457
  }
6384
- }, [connectionEvents]);
6458
+ }, [visibleConnectionEvents]);
6385
6459
  const serverLogs = useObservable(logManager.logs$);
6386
- const [serverLogsPaused, setServerLogsPaused] = React15.useState(false);
6387
- const [visibleServerLogs, setVisibleServerLogs] = React15.useState(
6388
- serverLogs ?? []
6460
+ const {
6461
+ visibleItems: visibleServerLogs,
6462
+ paused: serverLogsPaused,
6463
+ togglePaused: toggleServerLogsPaused
6464
+ } = usePausedStream(serverLogs);
6465
+ const serverSimulationLogs = useObservable(
6466
+ multiplayerStateManager.serverSimulationLogs$
6389
6467
  );
6390
- const toggleServerLogsPaused = useCallback(() => {
6391
- setServerLogsPaused((value) => {
6392
- if (!value) {
6393
- setVisibleServerLogs(serverLogs ?? []);
6394
- }
6395
- return !value;
6396
- });
6397
- }, [serverLogs]);
6398
- useEffect2(() => {
6399
- if (serverLogsPaused) return;
6400
- setVisibleServerLogs(serverLogs ?? []);
6401
- }, [serverLogs, serverLogsPaused]);
6468
+ const {
6469
+ visibleItems: visibleServerSimulationLogs,
6470
+ paused: serverSimulationLogsPaused,
6471
+ togglePaused: toggleServerSimulationLogsPaused
6472
+ } = usePausedStream(serverSimulationLogs);
6402
6473
  useEffect2(() => {
6403
6474
  if (!showServerLogs) return;
6404
6475
  if (serverLogsContainerRef.current) {
6405
6476
  serverLogsContainerRef.current.scrollTop = serverLogsContainerRef.current.scrollHeight;
6406
6477
  }
6407
6478
  }, [showServerLogs, visibleServerLogs]);
6479
+ useEffect2(() => {
6480
+ if (!showServerSimulationLogs) return;
6481
+ if (serverSimulationLogsContainerRef.current) {
6482
+ serverSimulationLogsContainerRef.current.scrollTop = serverSimulationLogsContainerRef.current.scrollHeight;
6483
+ }
6484
+ }, [showServerSimulationLogs, visibleServerSimulationLogs]);
6408
6485
  const multipeerStateInitialized = useObservable(
6409
6486
  multiplayerStateManager.isInitialized$
6410
6487
  );
@@ -6416,8 +6493,10 @@ var StateInspector = memoGeneric(function StateInspector2({
6416
6493
  const assetsInitialized = useObservable(assetManager.isInitialized$);
6417
6494
  const secrets = useObservable(secretManager.secrets$);
6418
6495
  const secretsInitialized = useObservable(secretManager.isInitialized$);
6419
- const connectedUsers = useObservable(userManager.connectedUsers$);
6496
+ const connectedUsers = useObservable(userManager.allUsers$);
6420
6497
  const connectionId = useObservable(userManager.currentConnectionId$);
6498
+ const simulationDiagnostics = multiplayerStateManager.getServerSimulationDiagnostics?.() ?? null;
6499
+ const showSimulationLogsSection = (simulationDiagnostics?.simulateLocally ?? false) || visibleServerSimulationLogs.length > 0;
6421
6500
  const state = useObservable(multiplayerStateManager.optimisticState$);
6422
6501
  const inputsInitialized = useObservable(ioManager.inputsInitialized$);
6423
6502
  const outputTransformsInitialized = useObservable(
@@ -6461,7 +6540,7 @@ var StateInspector = memoGeneric(function StateInspector2({
6461
6540
  }, [noyaManager]);
6462
6541
  if (!didMount) return null;
6463
6542
  if (!showInspector) {
6464
- return /* @__PURE__ */ React15.createElement(
6543
+ return /* @__PURE__ */ React16.createElement(
6465
6544
  "div",
6466
6545
  {
6467
6546
  ...props,
@@ -6473,7 +6552,7 @@ var StateInspector = memoGeneric(function StateInspector2({
6473
6552
  },
6474
6553
  onClick: () => setShowInspector(true)
6475
6554
  },
6476
- /* @__PURE__ */ React15.createElement(
6555
+ /* @__PURE__ */ React16.createElement(
6477
6556
  StateInspectorToggleButton,
6478
6557
  {
6479
6558
  showInspector,
@@ -6484,7 +6563,7 @@ var StateInspector = memoGeneric(function StateInspector2({
6484
6563
  )
6485
6564
  );
6486
6565
  }
6487
- return /* @__PURE__ */ React15.createElement(
6566
+ return /* @__PURE__ */ React16.createElement(
6488
6567
  "div",
6489
6568
  {
6490
6569
  ...props,
@@ -6493,7 +6572,7 @@ var StateInspector = memoGeneric(function StateInspector2({
6493
6572
  ...props.style
6494
6573
  }
6495
6574
  },
6496
- /* @__PURE__ */ React15.createElement(
6575
+ /* @__PURE__ */ React16.createElement(
6497
6576
  StateInspectorDisclosureSection,
6498
6577
  {
6499
6578
  isFirst: true,
@@ -6503,9 +6582,17 @@ var StateInspector = memoGeneric(function StateInspector2({
6503
6582
  colorScheme,
6504
6583
  style: {
6505
6584
  flex: "0 0 auto",
6506
- maxHeight: "200px"
6585
+ maxHeight: "50%",
6586
+ overflowY: "auto"
6507
6587
  },
6508
- right: /* @__PURE__ */ React15.createElement(
6588
+ right: /* @__PURE__ */ React16.createElement("span", { style: { display: "flex", gap: "10px" } }, /* @__PURE__ */ React16.createElement(
6589
+ StateInspectorButton,
6590
+ {
6591
+ theme,
6592
+ onClick: () => setShowUserDetails(!showUserDetails)
6593
+ },
6594
+ "Toggle details"
6595
+ ), /* @__PURE__ */ React16.createElement(
6509
6596
  StateInspectorToggleButton,
6510
6597
  {
6511
6598
  showInspector,
@@ -6513,19 +6600,21 @@ var StateInspector = memoGeneric(function StateInspector2({
6513
6600
  theme,
6514
6601
  anchor
6515
6602
  }
6516
- )
6603
+ ))
6517
6604
  },
6518
- /* @__PURE__ */ React15.createElement(StateInspectorDisclosureRowInner, { style: { flex: "0 0 auto" } }, connectedUsers?.map((user, index, array) => {
6519
- const identifier = user.userId ?? user.connectionId;
6520
- return /* @__PURE__ */ React15.createElement(
6605
+ /* @__PURE__ */ React16.createElement(StateInspectorDisclosureRowInner, { style: { flex: "0 0 auto" } }, connectedUsers?.filter((user) => showUserDetails || !user.inactive).map((user, index, array) => {
6606
+ return /* @__PURE__ */ React16.createElement(
6521
6607
  StateInspectorRow,
6522
6608
  {
6523
6609
  key: user.connectionId,
6524
6610
  colorScheme,
6525
6611
  variant: user.connectionId === connectionId ? "up" : void 0,
6526
- bordered: index !== array.length - 1
6612
+ bordered: index !== array.length - 1,
6613
+ style: {
6614
+ opacity: user.inactive ? 0.5 : 1
6615
+ }
6527
6616
  },
6528
- user.image && /* @__PURE__ */ React15.createElement(
6617
+ user.image && /* @__PURE__ */ React16.createElement(
6529
6618
  "img",
6530
6619
  {
6531
6620
  src: user.image,
@@ -6542,12 +6631,9 @@ var StateInspector = memoGeneric(function StateInspector2({
6542
6631
  }
6543
6632
  }
6544
6633
  ),
6545
- user.name,
6546
- " (",
6547
- ellipsis(identifier, 8, "middle"),
6548
- ")"
6634
+ showUserDetails ? /* @__PURE__ */ React16.createElement(ObjectInspector5, { data: user, theme }) : user.name
6549
6635
  );
6550
- }), !connectedUsers && /* @__PURE__ */ React15.createElement(
6636
+ }), !connectedUsers && /* @__PURE__ */ React16.createElement(
6551
6637
  "div",
6552
6638
  {
6553
6639
  style: {
@@ -6558,13 +6644,13 @@ var StateInspector = memoGeneric(function StateInspector2({
6558
6644
  gap: "4px"
6559
6645
  }
6560
6646
  },
6561
- /* @__PURE__ */ React15.createElement("span", null, "No connected users")
6647
+ /* @__PURE__ */ React16.createElement("span", null, "No connected users")
6562
6648
  ))
6563
6649
  ),
6564
- /* @__PURE__ */ React15.createElement(
6650
+ /* @__PURE__ */ React16.createElement(
6565
6651
  StateInspectorDisclosureSection,
6566
6652
  {
6567
- title: /* @__PURE__ */ React15.createElement(StateInspectorTitleLabel, null, "Data", /* @__PURE__ */ React15.createElement(
6653
+ title: /* @__PURE__ */ React16.createElement(StateInspectorTitleLabel, null, "Data", /* @__PURE__ */ React16.createElement(
6568
6654
  ColoredDot,
6569
6655
  {
6570
6656
  type: multipeerStateInitialized ? "success" : "error"
@@ -6573,7 +6659,7 @@ var StateInspector = memoGeneric(function StateInspector2({
6573
6659
  colorScheme,
6574
6660
  setOpen: setShowData,
6575
6661
  open: showData,
6576
- right: /* @__PURE__ */ React15.createElement(
6662
+ right: /* @__PURE__ */ React16.createElement(
6577
6663
  "span",
6578
6664
  {
6579
6665
  style: {
@@ -6581,9 +6667,9 @@ var StateInspector = memoGeneric(function StateInspector2({
6581
6667
  gap: "12px"
6582
6668
  }
6583
6669
  },
6584
- /* @__PURE__ */ React15.createElement(StateInspectorButton, { theme, onClick: handleImportAll }, "Import"),
6585
- /* @__PURE__ */ React15.createElement(StateInspectorButton, { theme, onClick: handleExportAll }, "Export"),
6586
- /* @__PURE__ */ React15.createElement(
6670
+ /* @__PURE__ */ React16.createElement(StateInspectorButton, { theme, onClick: handleImportAll }, "Import"),
6671
+ /* @__PURE__ */ React16.createElement(StateInspectorButton, { theme, onClick: handleExportAll }, "Export"),
6672
+ /* @__PURE__ */ React16.createElement(
6587
6673
  StateInspectorButton,
6588
6674
  {
6589
6675
  theme,
@@ -6595,14 +6681,14 @@ var StateInspector = memoGeneric(function StateInspector2({
6595
6681
  )
6596
6682
  )
6597
6683
  },
6598
- /* @__PURE__ */ React15.createElement(StateInspectorDisclosureRowInner, null, /* @__PURE__ */ React15.createElement(StateInspectorRow, { colorScheme }, /* @__PURE__ */ React15.createElement(
6684
+ /* @__PURE__ */ React16.createElement(StateInspectorDisclosureRowInner, null, /* @__PURE__ */ React16.createElement(StateInspectorRow, { colorScheme }, /* @__PURE__ */ React16.createElement(
6599
6685
  ObjectInspector5,
6600
6686
  {
6601
6687
  name: multiplayerStateManager.schema ? "state" : void 0,
6602
6688
  data: state,
6603
6689
  theme
6604
6690
  }
6605
- )), multiplayerStateManager.schema && /* @__PURE__ */ React15.createElement(StateInspectorRow, { colorScheme }, /* @__PURE__ */ React15.createElement(
6691
+ )), multiplayerStateManager.schema && /* @__PURE__ */ React16.createElement(StateInspectorRow, { colorScheme }, /* @__PURE__ */ React16.createElement(
6606
6692
  ObjectInspector5,
6607
6693
  {
6608
6694
  name: "schema",
@@ -6611,7 +6697,7 @@ var StateInspector = memoGeneric(function StateInspector2({
6611
6697
  }
6612
6698
  )))
6613
6699
  ),
6614
- /* @__PURE__ */ React15.createElement(
6700
+ /* @__PURE__ */ React16.createElement(
6615
6701
  HistorySection,
6616
6702
  {
6617
6703
  showHistory,
@@ -6621,14 +6707,14 @@ var StateInspector = memoGeneric(function StateInspector2({
6621
6707
  multiplayerStateManager
6622
6708
  }
6623
6709
  ),
6624
- /* @__PURE__ */ React15.createElement(
6710
+ /* @__PURE__ */ React16.createElement(
6625
6711
  StateInspectorDisclosureSection,
6626
6712
  {
6627
6713
  open: showAssets,
6628
6714
  setOpen: setShowAssets,
6629
- title: /* @__PURE__ */ React15.createElement(StateInspectorTitleLabel, null, "Assets (", assets.length, ")", /* @__PURE__ */ React15.createElement(ColoredDot, { type: assetsInitialized ? "success" : "error" })),
6715
+ title: /* @__PURE__ */ React16.createElement(StateInspectorTitleLabel, null, "Assets (", assets.length, ")", /* @__PURE__ */ React16.createElement(ColoredDot, { type: assetsInitialized ? "success" : "error" })),
6630
6716
  colorScheme,
6631
- right: /* @__PURE__ */ React15.createElement("span", { style: { display: "flex", gap: "10px" } }, /* @__PURE__ */ React15.createElement(
6717
+ right: /* @__PURE__ */ React16.createElement("span", { style: { display: "flex", gap: "10px" } }, /* @__PURE__ */ React16.createElement(
6632
6718
  StateInspectorButton,
6633
6719
  {
6634
6720
  theme,
@@ -6643,7 +6729,7 @@ var StateInspector = memoGeneric(function StateInspector2({
6643
6729
  }
6644
6730
  },
6645
6731
  "Delete all"
6646
- ), /* @__PURE__ */ React15.createElement(
6732
+ ), /* @__PURE__ */ React16.createElement(
6647
6733
  StateInspectorButton,
6648
6734
  {
6649
6735
  theme,
@@ -6656,7 +6742,7 @@ var StateInspector = memoGeneric(function StateInspector2({
6656
6742
  }
6657
6743
  },
6658
6744
  "Reload"
6659
- ), /* @__PURE__ */ React15.createElement(
6745
+ ), /* @__PURE__ */ React16.createElement(
6660
6746
  StateInspectorButton,
6661
6747
  {
6662
6748
  theme,
@@ -6680,14 +6766,14 @@ var StateInspector = memoGeneric(function StateInspector2({
6680
6766
  "Upload"
6681
6767
  ))
6682
6768
  },
6683
- /* @__PURE__ */ React15.createElement(StateInspectorDisclosureRowInner, null, assets.map((asset) => /* @__PURE__ */ React15.createElement(StateInspectorRow, { key: asset.id, colorScheme }, /* @__PURE__ */ React15.createElement(
6769
+ /* @__PURE__ */ React16.createElement(StateInspectorDisclosureRowInner, null, assets.map((asset) => /* @__PURE__ */ React16.createElement(StateInspectorRow, { key: asset.id, colorScheme }, /* @__PURE__ */ React16.createElement(
6684
6770
  ObjectInspector5,
6685
6771
  {
6686
6772
  name: asset.id,
6687
6773
  data: truncateAsset(asset),
6688
6774
  theme
6689
6775
  }
6690
- ), /* @__PURE__ */ React15.createElement(
6776
+ ), /* @__PURE__ */ React16.createElement(
6691
6777
  StateInspectorButton,
6692
6778
  {
6693
6779
  theme,
@@ -6696,14 +6782,14 @@ var StateInspector = memoGeneric(function StateInspector2({
6696
6782
  "Delete"
6697
6783
  ))))
6698
6784
  ),
6699
- advanced && /* @__PURE__ */ React15.createElement(
6785
+ advanced && /* @__PURE__ */ React16.createElement(
6700
6786
  StateInspectorDisclosureSection,
6701
6787
  {
6702
- title: /* @__PURE__ */ React15.createElement(StateInspectorTitleLabel, null, "Resources (", resources.length, ")", /* @__PURE__ */ React15.createElement(ColoredDot, { type: resourcesInitialized ? "success" : "error" })),
6788
+ title: /* @__PURE__ */ React16.createElement(StateInspectorTitleLabel, null, "Resources (", resources.length, ")", /* @__PURE__ */ React16.createElement(ColoredDot, { type: resourcesInitialized ? "success" : "error" })),
6703
6789
  colorScheme,
6704
6790
  open: showResources,
6705
6791
  setOpen: setShowResources,
6706
- right: /* @__PURE__ */ React15.createElement("span", { style: { display: "flex", gap: "10px" } }, /* @__PURE__ */ React15.createElement(
6792
+ right: /* @__PURE__ */ React16.createElement("span", { style: { display: "flex", gap: "10px" } }, /* @__PURE__ */ React16.createElement(
6707
6793
  StateInspectorButton,
6708
6794
  {
6709
6795
  theme,
@@ -6718,7 +6804,7 @@ var StateInspector = memoGeneric(function StateInspector2({
6718
6804
  }
6719
6805
  },
6720
6806
  "Delete all"
6721
- ), /* @__PURE__ */ React15.createElement(
6807
+ ), /* @__PURE__ */ React16.createElement(
6722
6808
  StateInspectorButton,
6723
6809
  {
6724
6810
  theme,
@@ -6731,7 +6817,7 @@ var StateInspector = memoGeneric(function StateInspector2({
6731
6817
  }
6732
6818
  },
6733
6819
  "Create Directory"
6734
- ), /* @__PURE__ */ React15.createElement(
6820
+ ), /* @__PURE__ */ React16.createElement(
6735
6821
  StateInspectorButton,
6736
6822
  {
6737
6823
  theme,
@@ -6751,21 +6837,21 @@ var StateInspector = memoGeneric(function StateInspector2({
6751
6837
  "Create Asset"
6752
6838
  ))
6753
6839
  },
6754
- /* @__PURE__ */ React15.createElement(StateInspectorDisclosureRowInner, null, resources?.map((resource) => /* @__PURE__ */ React15.createElement(StateInspectorRow, { key: resource.id, colorScheme }, /* @__PURE__ */ React15.createElement(
6840
+ /* @__PURE__ */ React16.createElement(StateInspectorDisclosureRowInner, null, resources?.map((resource) => /* @__PURE__ */ React16.createElement(StateInspectorRow, { key: resource.id, colorScheme }, /* @__PURE__ */ React16.createElement(
6755
6841
  ObjectInspector5,
6756
6842
  {
6757
6843
  name: resource.path,
6758
6844
  data: resource,
6759
6845
  theme
6760
6846
  }
6761
- ), /* @__PURE__ */ React15.createElement("div", { style: { display: "flex", gap: "4px" } }, /* @__PURE__ */ React15.createElement(
6847
+ ), /* @__PURE__ */ React16.createElement("div", { style: { display: "flex", gap: "4px" } }, /* @__PURE__ */ React16.createElement(
6762
6848
  StateInspectorButton,
6763
6849
  {
6764
6850
  theme,
6765
6851
  onClick: () => resourceManager.deleteResource({ id: resource.id })
6766
6852
  },
6767
6853
  "Delete"
6768
- ), /* @__PURE__ */ React15.createElement(
6854
+ ), /* @__PURE__ */ React16.createElement(
6769
6855
  StateInspectorButton,
6770
6856
  {
6771
6857
  theme,
@@ -6778,14 +6864,14 @@ var StateInspector = memoGeneric(function StateInspector2({
6778
6864
  "Rename"
6779
6865
  )))))
6780
6866
  ),
6781
- advanced && /* @__PURE__ */ React15.createElement(
6867
+ advanced && /* @__PURE__ */ React16.createElement(
6782
6868
  StateInspectorDisclosureSection,
6783
6869
  {
6784
- title: /* @__PURE__ */ React15.createElement(StateInspectorTitleLabel, null, "Secrets", /* @__PURE__ */ React15.createElement(ColoredDot, { type: secretsInitialized ? "success" : "error" })),
6870
+ title: /* @__PURE__ */ React16.createElement(StateInspectorTitleLabel, null, "Secrets", /* @__PURE__ */ React16.createElement(ColoredDot, { type: secretsInitialized ? "success" : "error" })),
6785
6871
  colorScheme,
6786
6872
  open: showSecrets,
6787
6873
  setOpen: setShowSecrets,
6788
- right: /* @__PURE__ */ React15.createElement(
6874
+ right: /* @__PURE__ */ React16.createElement(
6789
6875
  StateInspectorButton,
6790
6876
  {
6791
6877
  theme,
@@ -6800,7 +6886,7 @@ var StateInspector = memoGeneric(function StateInspector2({
6800
6886
  "Create"
6801
6887
  )
6802
6888
  },
6803
- /* @__PURE__ */ React15.createElement(StateInspectorDisclosureRowInner, null, secrets.map((secret) => /* @__PURE__ */ React15.createElement(StateInspectorRow, { key: secret.id, colorScheme }, /* @__PURE__ */ React15.createElement(ObjectInspector5, { data: secret, theme }), /* @__PURE__ */ React15.createElement(
6889
+ /* @__PURE__ */ React16.createElement(StateInspectorDisclosureRowInner, null, secrets.map((secret) => /* @__PURE__ */ React16.createElement(StateInspectorRow, { key: secret.id, colorScheme }, /* @__PURE__ */ React16.createElement(ObjectInspector5, { data: secret, theme }), /* @__PURE__ */ React16.createElement(
6804
6890
  StateInspectorButton,
6805
6891
  {
6806
6892
  theme,
@@ -6809,15 +6895,15 @@ var StateInspector = memoGeneric(function StateInspector2({
6809
6895
  "Delete"
6810
6896
  ))))
6811
6897
  ),
6812
- advanced && /* @__PURE__ */ React15.createElement(
6898
+ advanced && /* @__PURE__ */ React16.createElement(
6813
6899
  StateInspectorDisclosureSection,
6814
6900
  {
6815
6901
  open: showInputs,
6816
6902
  setOpen: setShowInputs,
6817
- title: /* @__PURE__ */ React15.createElement(StateInspectorTitleLabel, null, "Inputs", /* @__PURE__ */ React15.createElement(ColoredDot, { type: inputsInitialized ? "success" : "error" })),
6903
+ title: /* @__PURE__ */ React16.createElement(StateInspectorTitleLabel, null, "Inputs", /* @__PURE__ */ React16.createElement(ColoredDot, { type: inputsInitialized ? "success" : "error" })),
6818
6904
  colorScheme
6819
6905
  },
6820
- /* @__PURE__ */ React15.createElement(StateInspectorDisclosureRowInner, null, inputs?.map((input) => /* @__PURE__ */ React15.createElement(StateInspectorRow, { key: input.id, colorScheme }, /* @__PURE__ */ React15.createElement(ObjectInspector5, { data: input, theme }))), !inputs?.length && /* @__PURE__ */ React15.createElement(
6906
+ /* @__PURE__ */ React16.createElement(StateInspectorDisclosureRowInner, null, inputs?.map((input) => /* @__PURE__ */ React16.createElement(StateInspectorRow, { key: input.id, colorScheme }, /* @__PURE__ */ React16.createElement(ObjectInspector5, { data: input, theme }))), !inputs?.length && /* @__PURE__ */ React16.createElement(
6821
6907
  "div",
6822
6908
  {
6823
6909
  style: {
@@ -6828,15 +6914,15 @@ var StateInspector = memoGeneric(function StateInspector2({
6828
6914
  gap: "4px"
6829
6915
  }
6830
6916
  },
6831
- /* @__PURE__ */ React15.createElement("span", null, "No inputs")
6917
+ /* @__PURE__ */ React16.createElement("span", null, "No inputs")
6832
6918
  ))
6833
6919
  ),
6834
- advanced && /* @__PURE__ */ React15.createElement(
6920
+ advanced && /* @__PURE__ */ React16.createElement(
6835
6921
  StateInspectorDisclosureSection,
6836
6922
  {
6837
6923
  open: showOutputTransforms,
6838
6924
  setOpen: setShowOutputTransforms,
6839
- title: /* @__PURE__ */ React15.createElement(StateInspectorTitleLabel, null, "Output Transforms", /* @__PURE__ */ React15.createElement(
6925
+ title: /* @__PURE__ */ React16.createElement(StateInspectorTitleLabel, null, "Output Transforms", /* @__PURE__ */ React16.createElement(
6840
6926
  ColoredDot,
6841
6927
  {
6842
6928
  type: outputTransformsInitialized ? "success" : "error"
@@ -6844,7 +6930,7 @@ var StateInspector = memoGeneric(function StateInspector2({
6844
6930
  )),
6845
6931
  colorScheme
6846
6932
  },
6847
- /* @__PURE__ */ React15.createElement(StateInspectorDisclosureRowInner, null, outputTransforms?.map((transform) => /* @__PURE__ */ React15.createElement(StateInspectorRow, { key: transform.id, colorScheme }, /* @__PURE__ */ React15.createElement(ObjectInspector5, { data: transform, theme }))), !outputTransforms?.length && /* @__PURE__ */ React15.createElement(
6933
+ /* @__PURE__ */ React16.createElement(StateInspectorDisclosureRowInner, null, outputTransforms?.map((transform) => /* @__PURE__ */ React16.createElement(StateInspectorRow, { key: transform.id, colorScheme }, /* @__PURE__ */ React16.createElement(ObjectInspector5, { data: transform, theme }))), !outputTransforms?.length && /* @__PURE__ */ React16.createElement(
6848
6934
  "div",
6849
6935
  {
6850
6936
  style: {
@@ -6855,10 +6941,10 @@ var StateInspector = memoGeneric(function StateInspector2({
6855
6941
  gap: "4px"
6856
6942
  }
6857
6943
  },
6858
- /* @__PURE__ */ React15.createElement("span", null, "No output transforms")
6944
+ /* @__PURE__ */ React16.createElement("span", null, "No output transforms")
6859
6945
  ))
6860
6946
  ),
6861
- advanced && /* @__PURE__ */ React15.createElement(
6947
+ advanced && /* @__PURE__ */ React16.createElement(
6862
6948
  StateInspectorDisclosureSection,
6863
6949
  {
6864
6950
  title: "Tasks",
@@ -6866,7 +6952,7 @@ var StateInspector = memoGeneric(function StateInspector2({
6866
6952
  open: showTasks,
6867
6953
  setOpen: setShowTasks
6868
6954
  },
6869
- /* @__PURE__ */ React15.createElement(StateInspectorDisclosureRowInner, null, tasks?.map((task) => /* @__PURE__ */ React15.createElement(
6955
+ /* @__PURE__ */ React16.createElement(StateInspectorDisclosureRowInner, null, tasks?.map((task) => /* @__PURE__ */ React16.createElement(
6870
6956
  StateInspectorRow,
6871
6957
  {
6872
6958
  key: task.id,
@@ -6875,7 +6961,7 @@ var StateInspector = memoGeneric(function StateInspector2({
6875
6961
  backgroundColor: task.status === "done" ? "rgba(0,255,0,0.2)" : task.status === "error" ? "rgba(255,0,0,0.2)" : void 0
6876
6962
  }
6877
6963
  },
6878
- /* @__PURE__ */ React15.createElement(
6964
+ /* @__PURE__ */ React16.createElement(
6879
6965
  ObjectInspector5,
6880
6966
  {
6881
6967
  name: task.name,
@@ -6885,7 +6971,7 @@ var StateInspector = memoGeneric(function StateInspector2({
6885
6971
  )
6886
6972
  )))
6887
6973
  ),
6888
- /* @__PURE__ */ React15.createElement(
6974
+ /* @__PURE__ */ React16.createElement(
6889
6975
  StateInspectorDisclosureSection,
6890
6976
  {
6891
6977
  open: showShared,
@@ -6893,7 +6979,7 @@ var StateInspector = memoGeneric(function StateInspector2({
6893
6979
  title: "Shared Connection Data",
6894
6980
  colorScheme
6895
6981
  },
6896
- /* @__PURE__ */ React15.createElement(StateInspectorDisclosureRowInner, null, Object.entries(shared).map(([key, value]) => /* @__PURE__ */ React15.createElement(StateInspectorRow, { key, colorScheme }, /* @__PURE__ */ React15.createElement(
6982
+ /* @__PURE__ */ React16.createElement(StateInspectorDisclosureRowInner, null, Object.entries(shared).map(([key, value]) => /* @__PURE__ */ React16.createElement(StateInspectorRow, { key, colorScheme }, /* @__PURE__ */ React16.createElement(
6897
6983
  ObjectInspector5,
6898
6984
  {
6899
6985
  name: key,
@@ -6903,7 +6989,7 @@ var StateInspector = memoGeneric(function StateInspector2({
6903
6989
  }
6904
6990
  ))))
6905
6991
  ),
6906
- /* @__PURE__ */ React15.createElement(
6992
+ /* @__PURE__ */ React16.createElement(
6907
6993
  ServerScriptLogsSection,
6908
6994
  {
6909
6995
  colorScheme,
@@ -6915,7 +7001,44 @@ var StateInspector = memoGeneric(function StateInspector2({
6915
7001
  containerRef: serverLogsContainerRef
6916
7002
  }
6917
7003
  ),
6918
- advanced && /* @__PURE__ */ React15.createElement(
7004
+ showSimulationLogsSection && /* @__PURE__ */ React16.createElement(
7005
+ ServerScriptLogsSection,
7006
+ {
7007
+ title: "Server Script Simulation Logs",
7008
+ colorScheme,
7009
+ showLogs: showServerSimulationLogs,
7010
+ setShowLogs: setShowServerSimulationLogs,
7011
+ logs: visibleServerSimulationLogs,
7012
+ paused: serverSimulationLogsPaused,
7013
+ onTogglePaused: toggleServerSimulationLogsPaused,
7014
+ containerRef: serverSimulationLogsContainerRef
7015
+ }
7016
+ ),
7017
+ /* @__PURE__ */ React16.createElement(
7018
+ StateInspectorDisclosureSection,
7019
+ {
7020
+ open: showSimulation,
7021
+ setOpen: setShowSimulation,
7022
+ title: "Server Simulation",
7023
+ colorScheme
7024
+ },
7025
+ /* @__PURE__ */ React16.createElement(StateInspectorDisclosureRowInner, null, /* @__PURE__ */ React16.createElement(StateInspectorRow, { colorScheme }, /* @__PURE__ */ React16.createElement(
7026
+ ObjectInspector5,
7027
+ {
7028
+ name: "status",
7029
+ data: simulationDiagnostics ?? {
7030
+ simulateLocally: false,
7031
+ simulatorActive: false,
7032
+ clockSkewMs: 0,
7033
+ invocations: [],
7034
+ pendingPredictions: []
7035
+ },
7036
+ theme,
7037
+ expandLevel: 2
7038
+ }
7039
+ )))
7040
+ ),
7041
+ advanced && /* @__PURE__ */ React16.createElement(
6919
7042
  ActivityEventsSection,
6920
7043
  {
6921
7044
  colorScheme,
@@ -6925,10 +7048,12 @@ var StateInspector = memoGeneric(function StateInspector2({
6925
7048
  activityEventsManager
6926
7049
  }
6927
7050
  ),
6928
- /* @__PURE__ */ React15.createElement(
7051
+ /* @__PURE__ */ React16.createElement(
6929
7052
  EventsSection,
6930
7053
  {
6931
- connectionEvents,
7054
+ connectionEvents: visibleConnectionEvents,
7055
+ paused: connectionEventsPaused,
7056
+ onTogglePaused: toggleConnectionEventsPaused,
6932
7057
  colorScheme,
6933
7058
  eventsContainerRef,
6934
7059
  showEvents,
@@ -6971,7 +7096,7 @@ function useStateInspector({
6971
7096
  colorScheme,
6972
7097
  anchor
6973
7098
  }) {
6974
- const [root, setRoot] = React16.useState(null);
7099
+ const [root, setRoot] = React17.useState(null);
6975
7100
  useIsomorphicLayoutEffect(() => {
6976
7101
  if (disabled) return;
6977
7102
  const { root: root2, unmount } = createStateInspectorRoot();
@@ -6981,7 +7106,7 @@ function useStateInspector({
6981
7106
  useIsomorphicLayoutEffect(() => {
6982
7107
  if (!root) return;
6983
7108
  root.render(
6984
- /* @__PURE__ */ React16.createElement(
7109
+ /* @__PURE__ */ React17.createElement(
6985
7110
  StateInspector,
6986
7111
  {
6987
7112
  colorScheme,
@@ -7150,6 +7275,17 @@ function parseAppDataParameter(options) {
7150
7275
  return null;
7151
7276
  }
7152
7277
  }
7278
+ function applyClientIdentityFromAppData(appData) {
7279
+ if (appData.clientId !== void 0) {
7280
+ setClientId(appData.clientId);
7281
+ }
7282
+ if (appData.clientName !== void 0) {
7283
+ setClientName(appData.clientName);
7284
+ }
7285
+ if (appData.clientImage !== void 0) {
7286
+ setClientImage(appData.clientImage);
7287
+ }
7288
+ }
7153
7289
  function getAppData(initialState, schema, options) {
7154
7290
  const resolvedInitialState = initialState instanceof Function ? initialState() : initialState;
7155
7291
  let appData = parseAppDataParameter(options) ?? createDefaultAppData(resolvedInitialState);
@@ -7160,6 +7296,7 @@ function getAppData(initialState, schema, options) {
7160
7296
  appData.isDemo = appData.isDemo ?? false;
7161
7297
  const fallbackAccess = appData.viewType === "editable" ? "write" : "read";
7162
7298
  appData.access = appData.access ?? fallbackAccess;
7299
+ applyClientIdentityFromAppData(appData);
7163
7300
  return appData;
7164
7301
  }
7165
7302
  function getSyncAdapter(params) {
@@ -7247,7 +7384,7 @@ function useNoyaStateInternal(...args) {
7247
7384
  import {
7248
7385
  NoyaManager as NoyaManager4
7249
7386
  } from "@noya-app/state-manager";
7250
- import React17 from "react";
7387
+ import React18 from "react";
7251
7388
  var noyaManagerSingleton;
7252
7389
  var noyaSingletonBindings;
7253
7390
  function initializeNoyaSingleton(options) {
@@ -7264,7 +7401,6 @@ function initializeNoyaSingleton(options) {
7264
7401
  viewType,
7265
7402
  offlineStorageKey,
7266
7403
  multiplayerUrl,
7267
- serverScripts,
7268
7404
  ...managerOptions
7269
7405
  } = options ?? {};
7270
7406
  const appData = getAppData(
@@ -7291,7 +7427,7 @@ function initializeNoyaSingleton(options) {
7291
7427
  multiplayerUrl: multiplayerUrl ?? appData.multiplayerUrl,
7292
7428
  offlineStorageKey,
7293
7429
  debug: managerOptions?.debug,
7294
- serverScripts,
7430
+ serverScripts: managerOptions?.serverScripts,
7295
7431
  policyAuthContext
7296
7432
  });
7297
7433
  try {
@@ -7305,7 +7441,7 @@ function initializeNoyaSingleton(options) {
7305
7441
  if (resolvedInspector) {
7306
7442
  const { root } = createStateInspectorRoot();
7307
7443
  root.render(
7308
- /* @__PURE__ */ React17.createElement(
7444
+ /* @__PURE__ */ React18.createElement(
7309
7445
  StateInspector,
7310
7446
  {
7311
7447
  noyaManager: noyaManagerSingleton,
@@ -7524,29 +7660,33 @@ function usePipelineManager() {
7524
7660
  const { noyaManager } = useAnyNoyaStateContext();
7525
7661
  return noyaManager.pipelineManager;
7526
7662
  }
7527
- function useUserManager() {
7663
+ function useNoyaUserManager() {
7528
7664
  const { noyaManager } = useAnyNoyaStateContext();
7529
7665
  return noyaManager.userManager;
7530
7666
  }
7531
- function useConnectedUsers() {
7532
- const userManager = useUserManager();
7533
- return useObservable(userManager?.connectedUsers$);
7667
+ function useNoyaUsers() {
7668
+ const userManager = useNoyaUserManager();
7669
+ return useObservable(userManager?.allUsers$);
7534
7670
  }
7535
- function useConnectedUser(userId) {
7536
- const userManager = useUserManager();
7671
+ function useNoyaUser(id) {
7672
+ const userManager = useNoyaUserManager();
7537
7673
  return useObservable(
7538
- userManager?.connectedUsers$,
7539
- useCallback3(
7540
- (users) => {
7541
- return users.find((user) => {
7542
- const prefix = user.connectionId.slice(0, 8);
7543
- return userId?.includes(prefix);
7544
- });
7545
- },
7546
- [userId]
7547
- )
7674
+ userManager?.allUsers$,
7675
+ useCallback3((users) => findNoyaUser(users, id), [id])
7548
7676
  );
7549
7677
  }
7678
+ function useNoyaActiveUsers() {
7679
+ const userManager = useNoyaUserManager();
7680
+ return useObservable(userManager?.connectedUsers$);
7681
+ }
7682
+ function useNoyaCurrentUser() {
7683
+ const userManager = useNoyaUserManager();
7684
+ return useObservable(userManager?.currentUser$);
7685
+ }
7686
+ function useNoyaCurrentUserId() {
7687
+ const userManager = useNoyaUserManager();
7688
+ return useObservable(userManager?.currentId$);
7689
+ }
7550
7690
  function useAnySharedConnectionData() {
7551
7691
  const { noyaManager } = useAnyNoyaStateContext();
7552
7692
  return noyaManager.sharedConnectionDataManager;
@@ -7555,26 +7695,6 @@ function useEnqueueInput() {
7555
7695
  const { noyaManager } = useAnyNoyaStateContext();
7556
7696
  return noyaManager.enqueueInput;
7557
7697
  }
7558
- function useNoyaUser() {
7559
- const userManager = useUserManager();
7560
- return useObservable(userManager?.currentUser$);
7561
- }
7562
- function useNoyaId() {
7563
- const userManager = useUserManager();
7564
- return useObservable(userManager?.currentId$);
7565
- }
7566
- function useNoyaUserId() {
7567
- const userManager = useUserManager();
7568
- return useObservable(userManager?.currentUserId$);
7569
- }
7570
- function useNoyaConnectionId() {
7571
- const userManager = useUserManager();
7572
- return useObservable(userManager?.currentConnectionId$);
7573
- }
7574
- function useNoyaClientId() {
7575
- const userManager = useUserManager();
7576
- return useObservable(userManager?.currentClientId$);
7577
- }
7578
7698
  function useIsProcessing() {
7579
7699
  const { noyaManager } = useAnyNoyaStateContext();
7580
7700
  return useObservable(noyaManager.isProcessing$);
@@ -7701,7 +7821,7 @@ function createNoyaContext({
7701
7821
  children,
7702
7822
  contextValue
7703
7823
  }) {
7704
- return /* @__PURE__ */ React18.createElement(AnyNoyaStateContext.Provider, { value: contextValue }, children);
7824
+ return /* @__PURE__ */ React19.createElement(AnyNoyaStateContext.Provider, { value: contextValue }, children);
7705
7825
  }
7706
7826
  function NoyaStateProvider({
7707
7827
  children,
@@ -7724,7 +7844,7 @@ function createNoyaContext({
7724
7844
  }),
7725
7845
  [noyaManager, theme, viewType]
7726
7846
  );
7727
- return /* @__PURE__ */ React18.createElement(NoyaContextProvider, { contextValue }, options.fallback !== void 0 ? /* @__PURE__ */ React18.createElement(FallbackUntilInitialized, { fallback: options.fallback }, children) : children);
7847
+ return /* @__PURE__ */ React19.createElement(NoyaContextProvider, { contextValue }, options.fallback !== void 0 ? /* @__PURE__ */ React19.createElement(FallbackUntilInitialized, { fallback: options.fallback }, children) : children);
7728
7848
  }
7729
7849
  function useValue(path2, options) {
7730
7850
  const { noyaManager } = useAnyNoyaStateContext();
@@ -7849,7 +7969,7 @@ function useCallableAITools() {
7849
7969
  // src/components/UserPointersOverlay.tsx
7850
7970
  import { Observable as Observable2 } from "@noya-app/observable";
7851
7971
  import { memoGeneric as memoGeneric2 } from "@noya-app/react-utils";
7852
- import React19, { useEffect as useEffect7, useMemo as useMemo5, useState as useState5 } from "react";
7972
+ import React20, { useEffect as useEffect7, useMemo as useMemo5, useState as useState5 } from "react";
7853
7973
  function shouldShow(hideAfter, updatedAt) {
7854
7974
  return !!updatedAt && Date.now() - updatedAt < hideAfter;
7855
7975
  }
@@ -7894,9 +8014,9 @@ var UserPointersOverlay = memoGeneric2(function UserPointers({
7894
8014
  sharedConnectionDataManager.currentConnectionId$
7895
8015
  );
7896
8016
  const connectedUsers = useObservable(userManager.connectedUsers$);
7897
- return /* @__PURE__ */ React19.createElement(React19.Fragment, null, connectedUsers.map((user) => {
8017
+ return /* @__PURE__ */ React20.createElement(React20.Fragment, null, connectedUsers.map((user) => {
7898
8018
  if (user.connectionId === currentConnectionId) return null;
7899
- return /* @__PURE__ */ React19.createElement(
8019
+ return /* @__PURE__ */ React20.createElement(
7900
8020
  UserPointerInternal,
7901
8021
  {
7902
8022
  key: user.connectionId,
@@ -8026,8 +8146,6 @@ export {
8026
8146
  useBindNoyaManager,
8027
8147
  useCallableAITools,
8028
8148
  useColorScheme,
8029
- useConnectedUser,
8030
- useConnectedUsers,
8031
8149
  useEnqueueInput,
8032
8150
  useFileName,
8033
8151
  useFilePropertyManager,
@@ -8038,14 +8156,15 @@ export {
8038
8156
  useManagedHistory,
8039
8157
  useManagedState,
8040
8158
  useMultiplayerState,
8159
+ useNoyaActiveUsers,
8041
8160
  useNoyaAssetTranscription,
8042
- useNoyaClientId,
8043
- useNoyaConnectionId,
8044
- useNoyaId,
8161
+ useNoyaCurrentUser,
8162
+ useNoyaCurrentUserId,
8045
8163
  useNoyaStateInternal,
8046
8164
  useNoyaTranscriptionManager,
8047
8165
  useNoyaUser,
8048
- useNoyaUserId,
8166
+ useNoyaUserManager,
8167
+ useNoyaUsers,
8049
8168
  useObservable,
8050
8169
  useOutputTransforms,
8051
8170
  usePipelineManager,
@@ -8058,7 +8177,6 @@ export {
8058
8177
  useSecrets,
8059
8178
  useSetFileNameState,
8060
8179
  useStateInspector,
8061
- useUserManager,
8062
8180
  useViewType
8063
8181
  };
8064
8182
  //# sourceMappingURL=index.mjs.map