claude-flow-novice 2.0.3 → 2.0.5
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/src/cli/commands/swarm.js +1 -1
- package/dist/src/cli/main.js +1 -1
- package/dist/src/coordination/byzantine-memory-channels.js +25 -1
- package/dist/src/index.js +384 -35
- package/dist/src/utils/error-handler.js +2 -36
- package/dist/src/web/api/apm-routes.js +353 -0
- package/dist/src/web/api/config/api-config.js +184 -0
- package/dist/src/web/api/middleware/auth.js +203 -0
- package/dist/src/web/api/middleware/cache.js +273 -0
- package/dist/src/web/api/middleware/error-handler.js +257 -0
- package/dist/src/web/api/middleware/request-logger.js +215 -0
- package/dist/src/web/api/middleware/validation.js +323 -0
- package/dist/src/web/api/routes/events.js +463 -0
- package/dist/src/web/api/routes/hierarchy.js +300 -0
- package/dist/src/web/api/routes/index.js +12 -0
- package/dist/src/web/api/routes/metrics.js +559 -0
- package/dist/src/web/api/routes/parallel-status.js +359 -0
- package/dist/src/web/api/routes/status.js +448 -0
- package/dist/src/web/api/server.js +462 -0
- package/dist/src/web/dashboard/hooks/useWebSocket.js +383 -0
- package/dist/src/web/dashboard/index.js +85 -0
- package/dist/src/web/dashboard/realtime/CustomSyncManager.js +439 -0
- package/dist/src/web/dashboard/realtime/NativeWebSocketManager.js +323 -0
- package/dist/src/web/dashboard/realtime/PerformanceBenchmark.js +527 -0
- package/dist/src/web/dashboard/realtime/RealtimeCommunicationManager.js +474 -0
- package/dist/src/web/dashboard/realtime/RealtimeServer.js +666 -0
- package/dist/src/web/dashboard/realtime/SSEManager.js +426 -0
- package/dist/src/web/dashboard/types.js +4 -0
- package/dist/src/web/messaging/agent-status-tracker.js +453 -0
- package/dist/src/web/messaging/human-intervention-system.js +305 -0
- package/dist/src/web/messaging/message-filter.js +302 -0
- package/dist/src/web/messaging/swarm-message-router.js +324 -0
- package/dist/src/web/messaging/transparency-logger.js +421 -0
- package/dist/src/web/portal-server.js +460 -0
- package/dist/src/web/server.js +322 -0
- package/dist/src/web/websocket/apm-websocket-handler.js +453 -0
- package/dist/src/web/websocket/websocket-manager.js +780 -0
- package/package.json +6 -4
- package/dist/src/cli/minimal-main.js +0 -22
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/documentSymbols/browser/documentSymbols.js +0 -23
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteContribution.js +0 -57
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +0 -401
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +0 -181
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorContribution.js +0 -44
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +0 -157
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/dropOrPasteInto/browser/edit.js +0 -71
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/editorState/browser/editorState.js +0 -112
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/find/browser/findController.js +0 -990
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/find/browser/findDecorations.js +0 -296
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/find/browser/findModel.js +0 -488
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/find/browser/findOptionsWidget.js +0 -138
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/find/browser/findState.js +0 -243
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/find/browser/findWidget.js +0 -1177
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/folding/browser/folding.js +0 -1093
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/folding/browser/foldingDecorations.js +0 -133
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/folding/browser/foldingModel.js +0 -538
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/folding/browser/foldingRanges.js +0 -351
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/fontZoom/browser/fontZoom.js +0 -49
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/format/browser/format.js +0 -360
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/format/browser/formatActions.js +0 -263
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/format/browser/formattingEdit.js +0 -54
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/gotoSymbol/browser/link/clickLinkGesture.js +0 -149
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/hover/browser/contentHover.js +0 -874
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/inlineCompletions/browser/commandIds.js +0 -7
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/inlineCompletions/browser/commands.js +0 -199
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/linesOperations/browser/copyLinesCommand.js +0 -70
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/quickAccess/browser/commandsQuickAccess.js +0 -26
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/quickAccess/browser/editorNavigationQuickAccess.js +0 -153
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/readOnlyMessage/browser/contribution.js +0 -33
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/semanticTokens/browser/documentSemanticTokens.js +0 -354
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/smartSelect/browser/bracketSelections.js +0 -146
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/suggest/browser/completionModel.js +0 -224
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/contrib/unicodeHighlighter/browser/bannerController.js +0 -119
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/edcore.main.js +0 -14
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/editor.all.js +0 -63
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/editor.api.js +0 -55
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/editor.main.js +0 -7
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/editor.worker.js +0 -25
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/editor/standalone/browser/colorizer.js +0 -118
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/language/css/css.worker.js +0 -36869
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/language/css/cssMode.js +0 -2035
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/accessibility/browser/accessibilityService.js +0 -88
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/accessibility/common/accessibility.js +0 -9
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/action/common/action.js +0 -7
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/action/common/actionCommonCategories.js +0 -13
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/actionWidget/browser/actionList.js +0 -276
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/actionWidget/browser/actionWidget.js +0 -248
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/actionWidget/common/actionWidget.js +0 -5
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/actions/common/actions.js +0 -409
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/audioCues/browser/audioCueService.js +0 -176
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/clipboard/browser/clipboardService.js +0 -141
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/clipboard/common/clipboardService.js +0 -6
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/commands/common/commands.js +0 -80
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/configuration/common/configuration.js +0 -86
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/configuration/common/configurationModels.js +0 -554
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/configuration/common/configurationRegistry.js +0 -317
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/configuration/common/configurations.js +0 -41
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextkey/browser/contextKeyService.js +0 -432
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextkey/common/contextkey.js +0 -1547
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextkey/common/contextkeys.js +0 -18
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextview/browser/contextMenuHandler.js +0 -124
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextview/browser/contextMenuService.js +0 -101
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextview/browser/contextView.js +0 -7
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/contextview/browser/contextViewService.js +0 -72
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/dialogs/common/dialogs.js +0 -2
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/dnd/browser/dnd.js +0 -36
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/editor/common/editor.js +0 -17
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/environment/common/environment.js +0 -2
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/extensions/common/extensions.js +0 -47
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/files/common/files.js +0 -9
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/history/browser/contextScopedHistoryWidget.js +0 -105
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/instantiation/common/descriptors.js +0 -11
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/instantiation/common/extensions.js +0 -15
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/keybinding/common/abstractKeybindingService.js +0 -277
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/keybinding/common/baseResolvedKeybinding.js +0 -53
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/quickinput/browser/commandsQuickAccess.js +0 -354
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/theme/browser/defaultStyles.js +0 -162
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/esm/vs/platform/theme/common/colorRegistry.js +0 -482
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/abap/abap.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/apex/apex.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/azcli/azcli.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/bat/bat.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/bicep/bicep.js +0 -11
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/cameligo/cameligo.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/clojure/clojure.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/coffee/coffee.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/cpp/cpp.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/csharp/csharp.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/csp/csp.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/css/css.js +0 -12
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/cypher/cypher.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/dart/dart.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/dockerfile/dockerfile.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/ecl/ecl.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/elixir/elixir.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/basic-languages/flow9/flow9.js +0 -10
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.js +0 -745
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.de.js +0 -31
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.es.js +0 -31
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.fr.js +0 -29
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.it.js +0 -29
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.ja.js +0 -31
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.js +0 -29
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.ko.js +0 -29
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.ru.js +0 -31
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.zh-cn.js +0 -31
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/editor/editor.main.nls.zh-tw.js +0 -29
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/language/css/cssMode.js +0 -13
- package/dist/src/web/frontend/node_modules/.monaco-editor-MndU045b/min/vs/language/css/cssWorker.js +0 -81
- package/dist/src/web/frontend/node_modules/.multicast-dns-iKseM9bB/cli.js +0 -64
- package/dist/src/web/frontend/node_modules/.multicast-dns-iKseM9bB/example.js +0 -36
- package/dist/src/web/frontend/node_modules/.multicast-dns-iKseM9bB/index.js +0 -205
- package/dist/src/web/frontend/node_modules/.multicast-dns-iKseM9bB/test.js +0 -260
- package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/async/index.browser.js +0 -34
- package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/async/index.js +0 -35
- package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/async/index.native.js +0 -26
- package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/index.browser.js +0 -34
- package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/index.js +0 -45
- package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/nanoid.js +0 -1
- package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/non-secure/index.js +0 -21
- package/dist/src/web/frontend/node_modules/.nanoid-PAMEV9Hd/url-alphabet/index.js +0 -3
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/bin/nodemon.js +0 -16
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/cli/index.js +0 -49
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/cli/parse.js +0 -230
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/config/command.js +0 -43
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/config/defaults.js +0 -34
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/config/exec.js +0 -234
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/config/index.js +0 -93
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/config/load.js +0 -225
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/help/index.js +0 -27
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/index.js +0 -1
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/monitor/index.js +0 -4
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/monitor/match.js +0 -287
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/monitor/run.js +0 -562
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/monitor/signals.js +0 -34
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/monitor/watch.js +0 -244
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/nodemon.js +0 -317
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/rules/add.js +0 -89
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/rules/index.js +0 -53
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/rules/parse.js +0 -43
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/spawn.js +0 -74
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/utils/bus.js +0 -44
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/utils/clone.js +0 -40
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/utils/colour.js +0 -26
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/utils/index.js +0 -103
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/utils/log.js +0 -82
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/utils/merge.js +0 -47
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/lib/version.js +0 -100
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/node_modules/brace-expansion/index.js +0 -201
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/node_modules/has-flag/index.js +0 -8
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/node_modules/minimatch/minimatch.js +0 -947
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/node_modules/supports-color/browser.js +0 -5
- package/dist/src/web/frontend/node_modules/.nodemon-QcvNKhKT/node_modules/supports-color/index.js +0 -131
- package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/bin/pidtree.js +0 -128
- package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/index.js +0 -49
- package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/lib/bin.js +0 -61
- package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/lib/get.js +0 -45
- package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/lib/pidtree.js +0 -104
- package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/lib/ps.js +0 -47
- package/dist/src/web/frontend/node_modules/.pidtree-icfat3SQ/lib/wmic.js +0 -49
- package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/doc.js +0 -1270
- package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/acorn.js +0 -15
- package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/angular.js +0 -2
- package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/babel.js +0 -15
- package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/estree.js +0 -36
- package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/flow.js +0 -19
- package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/glimmer.js +0 -29
- package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/graphql.js +0 -29
- package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/html.js +0 -22
- package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/markdown.js +0 -63
- package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/meriyah.js +0 -4
- package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/postcss.js +0 -54
- package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/typescript.js +0 -20
- package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/plugins/yaml.js +0 -160
- package/dist/src/web/frontend/node_modules/.prettier-ApZm3b7s/standalone.js +0 -34
- package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/bin/react-scripts.js +0 -58
- package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/env.js +0 -112
- package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/getHttpsConfig.js +0 -74
- package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/jest/babelTransform.js +0 -37
- package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/jest/cssTransform.js +0 -22
- package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/jest/fileTransform.js +0 -40
- package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/modules.js +0 -142
- package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/paths.js +0 -153
- package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/webpack/persistentCache/createEnvironmentHash.js +0 -9
- package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/webpack.config.js +0 -796
- package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/config/webpackDevServer.config.js +0 -135
- package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/scripts/build.js +0 -225
- package/dist/src/web/frontend/node_modules/.react-scripts-OTANyoRb/scripts/eject.js +0 -340
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Real-time Communication Manager
|
|
3
|
+
* Provides interface to switch between WebSocket, SSE, and Custom Sync methods
|
|
4
|
+
*/ function _define_property(obj, key, value) {
|
|
5
|
+
if (key in obj) {
|
|
6
|
+
Object.defineProperty(obj, key, {
|
|
7
|
+
value: value,
|
|
8
|
+
enumerable: true,
|
|
9
|
+
configurable: true,
|
|
10
|
+
writable: true
|
|
11
|
+
});
|
|
12
|
+
} else {
|
|
13
|
+
obj[key] = value;
|
|
14
|
+
}
|
|
15
|
+
return obj;
|
|
16
|
+
}
|
|
17
|
+
import { NativeWebSocketManager } from "./NativeWebSocketManager.js";
|
|
18
|
+
import { SSEManager } from "./SSEManager.js";
|
|
19
|
+
import { CustomSyncManager } from "./CustomSyncManager.js";
|
|
20
|
+
import { PerformanceBenchmark } from "./PerformanceBenchmark.js";
|
|
21
|
+
export class RealtimeCommunicationManager {
|
|
22
|
+
/**
|
|
23
|
+
* Initialize all connection methods
|
|
24
|
+
*/ async initializeConnections() {
|
|
25
|
+
console.log('Initializing real-time communication methods...');
|
|
26
|
+
try {
|
|
27
|
+
// Initialize WebSocket
|
|
28
|
+
this.connections.set('websocket', new NativeWebSocketManager({
|
|
29
|
+
url: `ws://${window.location.host}/ws`,
|
|
30
|
+
autoConnect: false,
|
|
31
|
+
onConnect: ()=>this.handleMethodConnect('websocket'),
|
|
32
|
+
onDisconnect: ()=>this.handleMethodDisconnect('websocket'),
|
|
33
|
+
onError: (error)=>this.handleMethodError('websocket', error),
|
|
34
|
+
onMessage: (message)=>this.handleMessage('websocket', message)
|
|
35
|
+
}));
|
|
36
|
+
// Initialize SSE
|
|
37
|
+
this.connections.set('sse', new SSEManager({
|
|
38
|
+
url: `${window.location.origin}/api/events`,
|
|
39
|
+
autoConnect: false,
|
|
40
|
+
onConnect: ()=>this.handleMethodConnect('sse'),
|
|
41
|
+
onDisconnect: ()=>this.handleMethodDisconnect('sse'),
|
|
42
|
+
onError: (error)=>this.handleMethodError('sse', error),
|
|
43
|
+
onMessage: (message)=>this.handleMessage('sse', message)
|
|
44
|
+
}));
|
|
45
|
+
// Initialize Custom Sync
|
|
46
|
+
this.connections.set('custom-sync', new CustomSyncManager({
|
|
47
|
+
url: `${window.location.origin}/api/sync`,
|
|
48
|
+
autoConnect: false,
|
|
49
|
+
onConnect: ()=>this.handleMethodConnect('custom-sync'),
|
|
50
|
+
onDisconnect: ()=>this.handleMethodDisconnect('custom-sync'),
|
|
51
|
+
onError: (error)=>this.handleMethodError('custom-sync', error),
|
|
52
|
+
onSync: (data)=>this.handleMessage('custom-sync', {
|
|
53
|
+
type: 'sync',
|
|
54
|
+
data
|
|
55
|
+
})
|
|
56
|
+
}));
|
|
57
|
+
// Connect to default method
|
|
58
|
+
await this.connect();
|
|
59
|
+
} catch (error) {
|
|
60
|
+
console.error('Failed to initialize connections:', error);
|
|
61
|
+
this.options.onError(error instanceof Error ? error : new Error('Initialization failed'), this.currentMethod);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Connect to the current or specified method
|
|
66
|
+
*/ async connect(method) {
|
|
67
|
+
const targetMethod = method || this.currentMethod;
|
|
68
|
+
if (targetMethod === 'auto') {
|
|
69
|
+
await this.connectWithBestMethod();
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
console.log(`Connecting using ${targetMethod}...`);
|
|
73
|
+
try {
|
|
74
|
+
// Disconnect current method if different
|
|
75
|
+
if (this.currentMethod !== targetMethod && this.currentMethod !== 'auto') {
|
|
76
|
+
await this.disconnect();
|
|
77
|
+
}
|
|
78
|
+
const connection = this.connections.get(targetMethod);
|
|
79
|
+
if (!connection) {
|
|
80
|
+
throw new Error(`Connection method ${targetMethod} not initialized`);
|
|
81
|
+
}
|
|
82
|
+
await connection.connect();
|
|
83
|
+
this.currentMethod = targetMethod;
|
|
84
|
+
this.options.onMethodChange(targetMethod);
|
|
85
|
+
console.log(`Successfully connected using ${targetMethod}`);
|
|
86
|
+
} catch (error) {
|
|
87
|
+
console.error(`Failed to connect with ${targetMethod}:`, error);
|
|
88
|
+
if (this.options.autoSwitch && targetMethod !== 'auto') {
|
|
89
|
+
await this.tryFallbackMethods(targetMethod);
|
|
90
|
+
} else {
|
|
91
|
+
this.options.onError(error instanceof Error ? error : new Error('Connection failed'), targetMethod);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Connect with the best available method
|
|
97
|
+
*/ async connectWithBestMethod() {
|
|
98
|
+
console.log('Finding best connection method...');
|
|
99
|
+
for (const method of this.options.fallbackMethods){
|
|
100
|
+
try {
|
|
101
|
+
console.log(`Trying ${method}...`);
|
|
102
|
+
await this.connect(method);
|
|
103
|
+
return;
|
|
104
|
+
} catch (error) {
|
|
105
|
+
console.warn(`${method} failed:`, error);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
throw new Error('All connection methods failed');
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Try fallback methods when primary fails
|
|
112
|
+
*/ async tryFallbackMethods(failedMethod) {
|
|
113
|
+
if (this.isAutoSwitching) return; // Prevent infinite loops
|
|
114
|
+
this.isAutoSwitching = true;
|
|
115
|
+
for (const method of this.options.fallbackMethods){
|
|
116
|
+
if (method === failedMethod) continue;
|
|
117
|
+
try {
|
|
118
|
+
console.log(`Falling back to ${method}...`);
|
|
119
|
+
await this.connect(method);
|
|
120
|
+
this.isAutoSwitching = false;
|
|
121
|
+
return;
|
|
122
|
+
} catch (error) {
|
|
123
|
+
console.warn(`Fallback to ${method} failed:`, error);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
this.isAutoSwitching = false;
|
|
127
|
+
throw new Error(`All fallback methods failed after ${failedMethod} failure`);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Disconnect from current method
|
|
131
|
+
*/ async disconnect() {
|
|
132
|
+
console.log(`Disconnecting from ${this.currentMethod}...`);
|
|
133
|
+
const connection = this.connections.get(this.currentMethod);
|
|
134
|
+
if (connection && connection.disconnect) {
|
|
135
|
+
connection.disconnect();
|
|
136
|
+
}
|
|
137
|
+
this.currentMethod = 'auto';
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Send a message using the current method
|
|
141
|
+
*/ sendMessage(type, payload, options) {
|
|
142
|
+
const method = options?.method || this.currentMethod;
|
|
143
|
+
if (method === 'auto') {
|
|
144
|
+
console.warn('Cannot send message with auto method - please specify a method');
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
const connection = this.connections.get(method);
|
|
148
|
+
if (!connection) {
|
|
149
|
+
console.error(`Connection method ${method} not available`);
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
try {
|
|
153
|
+
switch(method){
|
|
154
|
+
case 'websocket':
|
|
155
|
+
return connection.sendMessage(type, payload);
|
|
156
|
+
case 'sse':
|
|
157
|
+
console.warn('SSE is unidirectional - cannot send messages');
|
|
158
|
+
return false;
|
|
159
|
+
case 'custom-sync':
|
|
160
|
+
connection.sendMessage(type, payload);
|
|
161
|
+
return true;
|
|
162
|
+
default:
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
} catch (error) {
|
|
166
|
+
console.error(`Failed to send message via ${method}:`, error);
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Subscribe to message types
|
|
172
|
+
*/ subscribe(eventType, callback) {
|
|
173
|
+
if (!this.subscriptions.has(eventType)) {
|
|
174
|
+
this.subscriptions.set(eventType, new Set());
|
|
175
|
+
}
|
|
176
|
+
this.subscriptions.get(eventType).add(callback);
|
|
177
|
+
// Also subscribe to all active connections
|
|
178
|
+
this.connections.forEach((connection, method)=>{
|
|
179
|
+
if (connection.subscribe) {
|
|
180
|
+
connection.subscribe(eventType, callback);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
// Return unsubscribe function
|
|
184
|
+
return ()=>{
|
|
185
|
+
const callbacks = this.subscriptions.get(eventType);
|
|
186
|
+
if (callbacks) {
|
|
187
|
+
callbacks.delete(callback);
|
|
188
|
+
if (callbacks.size === 0) {
|
|
189
|
+
this.subscriptions.delete(eventType);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
// Unsubscribe from all connections
|
|
193
|
+
this.connections.forEach((connection)=>{
|
|
194
|
+
if (connection.unsubscribe) {
|
|
195
|
+
connection.unsubscribe(eventType, callback);
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Get current connection status
|
|
202
|
+
*/ getStatus() {
|
|
203
|
+
const connection = this.connections.get(this.currentMethod);
|
|
204
|
+
const protocolStatus = connection?.getStatus ? connection.getStatus() : null;
|
|
205
|
+
return {
|
|
206
|
+
connected: protocolStatus?.connected ?? false,
|
|
207
|
+
method: this.currentMethod,
|
|
208
|
+
latency: protocolStatus?.latency ?? 0,
|
|
209
|
+
throughput: protocolStatus?.dataRate ?? 0,
|
|
210
|
+
errorRate: this.calculateErrorRate(),
|
|
211
|
+
lastConnected: protocolStatus?.lastConnected,
|
|
212
|
+
lastMessage: protocolStatus?.lastMessage,
|
|
213
|
+
error: protocolStatus?.error,
|
|
214
|
+
protocolSpecific: protocolStatus
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Get all available connection statuses
|
|
219
|
+
*/ getAllStatuses() {
|
|
220
|
+
const statuses = new Map();
|
|
221
|
+
this.connections.forEach((connection, method)=>{
|
|
222
|
+
if (connection.getStatus) {
|
|
223
|
+
statuses.set(method, connection.getStatus());
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
return statuses;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Switch to a different communication method
|
|
230
|
+
*/ async switchMethod(newMethod) {
|
|
231
|
+
if (newMethod === this.currentMethod) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
const timeSinceLastSwitch = Date.now() - this.lastMethodSwitch.getTime();
|
|
235
|
+
if (timeSinceLastSwitch < 5000) {
|
|
236
|
+
console.warn('Method switching too frequently - please wait');
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
console.log(`Switching from ${this.currentMethod} to ${newMethod}...`);
|
|
240
|
+
try {
|
|
241
|
+
await this.disconnect();
|
|
242
|
+
await this.connect(newMethod);
|
|
243
|
+
this.lastMethodSwitch = new Date();
|
|
244
|
+
} catch (error) {
|
|
245
|
+
console.error(`Failed to switch to ${newMethod}:`, error);
|
|
246
|
+
this.options.onError(error instanceof Error ? error : new Error('Method switch failed'), newMethod);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Run performance benchmark
|
|
251
|
+
*/ async runBenchmark(config) {
|
|
252
|
+
if (!this.benchmark) {
|
|
253
|
+
this.benchmark = new PerformanceBenchmark(config);
|
|
254
|
+
}
|
|
255
|
+
const result = await this.benchmark.runBenchmarkSuite();
|
|
256
|
+
this.updatePerformanceData(result);
|
|
257
|
+
return result;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Get performance comparison
|
|
261
|
+
*/ getPerformanceComparison() {
|
|
262
|
+
const comparison = {};
|
|
263
|
+
this.performanceData.forEach((data, method)=>{
|
|
264
|
+
if (data.length > 0) {
|
|
265
|
+
const latest = data[data.length - 1];
|
|
266
|
+
comparison[method] = {
|
|
267
|
+
averageLatency: latest.results.reduce((sum, r)=>sum + r.averageLatency, 0) / latest.results.length,
|
|
268
|
+
averageThroughput: latest.results.reduce((sum, r)=>sum + r.throughput, 0) / latest.results.length,
|
|
269
|
+
reliability: latest.results.reduce((sum, r)=>sum + r.reliability, 0) / latest.results.length,
|
|
270
|
+
lastTest: latest.timestamp
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
return comparison;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Get connection statistics
|
|
278
|
+
*/ getStatistics() {
|
|
279
|
+
const stats = {
|
|
280
|
+
currentMethod: this.currentMethod,
|
|
281
|
+
connectedSubscriptions: this.subscriptions.size,
|
|
282
|
+
autoSwitching: this.isAutoSwitching,
|
|
283
|
+
lastMethodSwitch: this.lastMethodSwitch,
|
|
284
|
+
uptime: Date.now() - this.lastMethodSwitch.getTime()
|
|
285
|
+
};
|
|
286
|
+
// Add method-specific stats
|
|
287
|
+
this.connections.forEach((connection, method)=>{
|
|
288
|
+
if (connection.getStats) {
|
|
289
|
+
stats[`${method}Stats`] = connection.getStats();
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
return stats;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Handle method connection
|
|
296
|
+
*/ handleMethodConnect(method) {
|
|
297
|
+
console.log(`${method} connected`);
|
|
298
|
+
this.recordPerformanceEvent(method, 'connect');
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Handle method disconnection
|
|
302
|
+
*/ handleMethodDisconnect(method) {
|
|
303
|
+
console.log(`${method} disconnected`);
|
|
304
|
+
this.recordPerformanceEvent(method, 'disconnect');
|
|
305
|
+
// Auto-switch if this was the active method
|
|
306
|
+
if (method === this.currentMethod && this.options.autoSwitch && !this.isAutoSwitching) {
|
|
307
|
+
this.tryFallbackMethods(method);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Handle method error
|
|
312
|
+
*/ handleMethodError(method, error) {
|
|
313
|
+
console.error(`${method} error:`, error);
|
|
314
|
+
this.recordPerformanceEvent(method, 'error');
|
|
315
|
+
this.options.onError(error instanceof Error ? error : new Error('Method error'), method);
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Handle incoming messages
|
|
319
|
+
*/ handleMessage(method, message) {
|
|
320
|
+
const unifiedMessage = {
|
|
321
|
+
type: message.type || message.event,
|
|
322
|
+
payload: message.data || message.payload,
|
|
323
|
+
timestamp: message.timestamp || new Date(),
|
|
324
|
+
id: message.id,
|
|
325
|
+
protocol: method
|
|
326
|
+
};
|
|
327
|
+
// Notify subscribers
|
|
328
|
+
const callbacks = this.subscriptions.get(unifiedMessage.type);
|
|
329
|
+
if (callbacks) {
|
|
330
|
+
callbacks.forEach((callback)=>callback(unifiedMessage.payload));
|
|
331
|
+
}
|
|
332
|
+
// Record performance metrics
|
|
333
|
+
this.recordPerformanceEvent(method, 'message', unifiedMessage);
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Start performance monitoring
|
|
337
|
+
*/ startPerformanceMonitoring() {
|
|
338
|
+
if (this.options.benchmarkInterval > 0) {
|
|
339
|
+
setInterval(async ()=>{
|
|
340
|
+
if (this.options.enablePerformanceMonitoring) {
|
|
341
|
+
try {
|
|
342
|
+
await this.runBenchmark({
|
|
343
|
+
duration: 10000,
|
|
344
|
+
messageFrequency: 10,
|
|
345
|
+
testScenarios: [
|
|
346
|
+
'latency',
|
|
347
|
+
'throughput'
|
|
348
|
+
]
|
|
349
|
+
});
|
|
350
|
+
} catch (error) {
|
|
351
|
+
console.error('Performance monitoring failed:', error);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}, this.options.benchmarkInterval);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Record performance event
|
|
359
|
+
*/ recordPerformanceEvent(method, eventType, data) {
|
|
360
|
+
if (!this.performanceData.has(method)) {
|
|
361
|
+
this.performanceData.set(method, []);
|
|
362
|
+
}
|
|
363
|
+
const events = this.performanceData.get(method);
|
|
364
|
+
events.push({
|
|
365
|
+
timestamp: new Date(),
|
|
366
|
+
eventType,
|
|
367
|
+
data
|
|
368
|
+
});
|
|
369
|
+
// Keep only last 100 events per method
|
|
370
|
+
if (events.length > 100) {
|
|
371
|
+
events.splice(0, events.length - 100);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Update performance data from benchmark results
|
|
376
|
+
*/ updatePerformanceData(result) {
|
|
377
|
+
result.results.forEach((metrics)=>{
|
|
378
|
+
if (!this.performanceData.has(metrics.protocol)) {
|
|
379
|
+
this.performanceData.set(metrics.protocol, []);
|
|
380
|
+
}
|
|
381
|
+
this.performanceData.get(metrics.protocol).push({
|
|
382
|
+
timestamp: result.timestamp,
|
|
383
|
+
type: 'benchmark',
|
|
384
|
+
metrics
|
|
385
|
+
});
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Calculate error rate
|
|
390
|
+
*/ calculateErrorRate() {
|
|
391
|
+
// Simple implementation - could be enhanced with actual error tracking
|
|
392
|
+
return 0;
|
|
393
|
+
}
|
|
394
|
+
/**
|
|
395
|
+
* Get recommended method based on performance
|
|
396
|
+
*/ getRecommendedMethod() {
|
|
397
|
+
const comparison = this.getPerformanceComparison();
|
|
398
|
+
if (!Object.keys(comparison).length) {
|
|
399
|
+
return this.options.fallbackMethods[0];
|
|
400
|
+
}
|
|
401
|
+
// Find method with best latency
|
|
402
|
+
let bestMethod = this.options.fallbackMethods[0];
|
|
403
|
+
let bestLatency = Infinity;
|
|
404
|
+
for (const [method, data] of Object.entries(comparison)){
|
|
405
|
+
if (data.averageLatency < bestLatency) {
|
|
406
|
+
bestLatency = data.averageLatency;
|
|
407
|
+
bestMethod = method;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
return bestMethod;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Export configuration and statistics
|
|
414
|
+
*/ exportData() {
|
|
415
|
+
return {
|
|
416
|
+
configuration: this.options,
|
|
417
|
+
currentStatus: this.getStatus(),
|
|
418
|
+
allStatuses: Object.fromEntries(this.getAllStatuses()),
|
|
419
|
+
performanceComparison: this.getPerformanceComparison(),
|
|
420
|
+
statistics: this.getStatistics(),
|
|
421
|
+
recommendations: {
|
|
422
|
+
bestMethod: this.getRecommendedMethod(),
|
|
423
|
+
autoSwitching: this.options.autoSwitch
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Cleanup resources
|
|
429
|
+
*/ destroy() {
|
|
430
|
+
console.log('Cleaning up RealtimeCommunicationManager...');
|
|
431
|
+
// Disconnect all connections
|
|
432
|
+
this.connections.forEach((connection)=>{
|
|
433
|
+
if (connection.disconnect) {
|
|
434
|
+
connection.disconnect();
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
// Clear data
|
|
438
|
+
this.subscriptions.clear();
|
|
439
|
+
this.performanceData.clear();
|
|
440
|
+
if (this.benchmark) {
|
|
441
|
+
this.benchmark = null;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
constructor(options = {}){
|
|
445
|
+
_define_property(this, "options", void 0);
|
|
446
|
+
_define_property(this, "currentMethod", void 0);
|
|
447
|
+
_define_property(this, "connections", new Map());
|
|
448
|
+
_define_property(this, "subscriptions", new Map());
|
|
449
|
+
_define_property(this, "performanceData", new Map());
|
|
450
|
+
_define_property(this, "benchmark", null);
|
|
451
|
+
_define_property(this, "isAutoSwitching", false);
|
|
452
|
+
_define_property(this, "lastMethodSwitch", new Date());
|
|
453
|
+
this.options = {
|
|
454
|
+
defaultMethod: options.defaultMethod ?? 'auto',
|
|
455
|
+
autoSwitch: options.autoSwitch ?? true,
|
|
456
|
+
fallbackMethods: options.fallbackMethods ?? [
|
|
457
|
+
'websocket',
|
|
458
|
+
'sse',
|
|
459
|
+
'custom-sync'
|
|
460
|
+
],
|
|
461
|
+
enablePerformanceMonitoring: options.enablePerformanceMonitoring ?? true,
|
|
462
|
+
benchmarkInterval: options.benchmarkInterval ?? 300000,
|
|
463
|
+
connectionTimeout: options.connectionTimeout ?? 10000,
|
|
464
|
+
onMethodChange: options.onMethodChange || (()=>{}),
|
|
465
|
+
onError: options.onError || (()=>{})
|
|
466
|
+
};
|
|
467
|
+
this.currentMethod = this.options.defaultMethod;
|
|
468
|
+
this.initializeConnections();
|
|
469
|
+
if (this.options.enablePerformanceMonitoring) {
|
|
470
|
+
this.startPerformanceMonitoring();
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
export default RealtimeCommunicationManager;
|