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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { promises as fs } from "node:fs";
|
|
5
5
|
import { success, error, warning } from "../cli-core.js";
|
|
6
6
|
import { BackgroundExecutor } from "../../coordination/background-executor.js";
|
|
7
|
-
import { SwarmMemoryManager } from "../../
|
|
7
|
+
import { SwarmMemoryManager } from "../../swarm/memory.js";
|
|
8
8
|
import { setSwarmCoordinator } from "../../coordination/swarm-coordinator-factory.js";
|
|
9
9
|
import { requireSwarmInit } from "../../validators/swarm-init-validator.js";
|
|
10
10
|
export async function swarmAction(ctx) {
|
package/dist/src/cli/main.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Claude-Flow CLI - Main entry point for Node.js
|
|
4
4
|
*/ import { CLI } from "./cli-core.js";
|
|
5
|
-
import { setupCommands } from "./commands
|
|
5
|
+
import { setupCommands } from "./commands";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
7
|
import { dirname } from "node:path";
|
|
8
8
|
async function main() {
|
|
@@ -607,4 +607,28 @@ export class ByzantineMemoryChannel extends EventEmitter {
|
|
|
607
607
|
}
|
|
608
608
|
|
|
609
609
|
generateNodeId() {
|
|
610
|
-
return `node_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;\n }\n\n generateProposalId() {\n return `proposal_${this.consensus.currentRound}_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;\n }\n\n signData(data) {\n // Simple signature simulation - in production use proper cryptographic signatures\n const dataStr = JSON.stringify(data);\n return `sig_${Buffer.from(dataStr).toString('base64').substr(0, 16)}`;\n }\n\n updateMetrics(operation, duration, success) {\n if (success) {\n // Update success metrics\n } else {\n // Update failure metrics\n }\n }\n\n updateAverage(currentAvg, newValue, count) {\n return ((currentAvg * (count - 1)) + newValue) / count;\n }\n}\n\n/**\n * Message Router for Byzantine communication\n */\nclass MessageRouter extends EventEmitter {\n constructor(channelId) {\n super();\n this.channelId = channelId;\n this.nodeId = null;\n this.initialized = false;\n }\n\n async initialize(nodeId) {\n this.nodeId = nodeId;\n this.initialized = true;\n }\n\n async broadcast(message) {\n // Simulate message broadcasting\n this.emit('broadcast', { ...message, channelId: this.channelId });\n }\n\n async shutdown() {\n this.initialized = false;\n this.removeAllListeners();\n }\n}\n\n/**\n * Consensus Manager for Byzantine fault tolerance\n */\nclass ConsensusManager {\n constructor(threshold) {\n this.threshold = threshold;\n }\n\n analyzeVotes(votes) {\n if (votes.size === 0) {\n return {\n consensus: false,\n reason: 'No votes received',\n byzantineDetected: false\n };\n }\n\n // Simple consensus analysis - in production use proper Byzantine algorithms\n const voteArray = Array.from(votes.values());\n const approvalVotes = voteArray.filter(vote => vote.approval === true).length;\n const totalVotes = voteArray.length;\n const approvalRatio = approvalVotes / totalVotes;\n\n // Check for Byzantine behavior (conflicting votes from same node)\n const byzantineNodes = this.detectByzantineBehavior(voteArray);\n\n return {\n consensus: approvalRatio >= this.threshold,\n votes: voteArray,\n approvalRatio,\n byzantineDetected: byzantineNodes.size > 0,\n byzantineNodes,\n reason: approvalRatio >= this.threshold ? 'Consensus reached' : 'Insufficient approval'\n };\n }\n\n detectByzantineBehavior(votes) {\n const byzantineNodes = new Set();\n const nodeVotes = new Map();\n\n // Group votes by node\n for (const vote of votes) {\n if (!nodeVotes.has(vote.nodeId)) {\n nodeVotes.set(vote.nodeId, []);\n }\n nodeVotes.get(vote.nodeId).push(vote);\n }\n\n // Check for conflicting votes from same node\n for (const [nodeId, nodeVoteList] of nodeVotes.entries()) {\n if (nodeVoteList.length > 1) {\n // Check for contradictory votes\n const approvals = nodeVoteList.map(v => v.approval);\n if (approvals.includes(true) && approvals.includes(false)) {\n byzantineNodes.add(nodeId);\n }\n }\n }\n\n return byzantineNodes;\n }\n}\n\n/**\n * Byzantine Memory Channel Manager\n * Manages multiple channels with coordination\n */\nexport class ByzantineChannelManager extends EventEmitter {\n constructor(options = {}) {\n super();\n\n this.options = {\n maxChannels: options.maxChannels || 50,\n defaultByzantineThreshold: options.defaultByzantineThreshold || 0.67,\n enableCrossChannelConsensus: options.enableCrossChannelConsensus !== false,\n ...options\n };\n\n this.channels = new Map();\n this.crossChannelConsensus = new Map();\n this.isInitialized = false;\n }\n\n /**\n * Initialize channel manager\n */\n async initialize() {\n if (this.isInitialized) return;\n\n this.isInitialized = true;\n\n this.emit('initialized', {\n maxChannels: this.options.maxChannels,\n crossChannelConsensus: this.options.enableCrossChannelConsensus\n });\n\n console.log('✅ Byzantine Channel Manager initialized');\n\n return { success: true };\n }\n\n /**\n * Create new Byzantine memory channel\n */\n async createChannel(channelId, options = {}) {\n this.ensureInitialized();\n\n if (this.channels.has(channelId)) {\n throw new Error(`Channel ${channelId} already exists`);\n }\n\n if (this.channels.size >= this.options.maxChannels) {\n throw new Error('Maximum number of channels reached');\n }\n\n const channelOptions = {\n ...options,\n byzantineThreshold: options.byzantineThreshold || this.options.defaultByzantineThreshold\n };\n\n const channel = new ByzantineMemoryChannel(channelId, channelOptions);\n await channel.initialize();\n\n this.channels.set(channelId, channel);\n\n // Set up cross-channel event handling\n channel.on('consensusReached', (data) => {\n this.emit('channelConsensus', { channelId, ...data });\n });\n\n channel.on('byzantineDetected', (data) => {\n this.emit('channelByzantine', { channelId, ...data });\n this.handleCrossChannelByzantine(channelId, data);\n });\n\n this.emit('channelCreated', { channelId, options: channelOptions });\n\n return channel;\n }\n\n /**\n * Get channel by ID\n */\n getChannel(channelId) {\n return this.channels.get(channelId);\n }\n\n /**\n * Get all channels\n */\n getAllChannels() {\n return Array.from(this.channels.values());\n }\n\n /**\n * Store data across multiple channels with cross-channel consensus\n */\n async crossChannelStore(channelIds, key, value, options = {}) {\n this.ensureInitialized();\n\n if (!this.options.enableCrossChannelConsensus) {\n throw new Error('Cross-channel consensus is disabled');\n }\n\n const channels = channelIds.map(id => this.getChannel(id)).filter(Boolean);\n\n if (channels.length !== channelIds.length) {\n throw new Error('Some channels not found');\n }\n\n // Execute storage across all channels\n const storePromises = channels.map(channel =>\n channel.store(key, value, {\n ...options,\n crossChannelConsensus: true,\n participatingChannels: channelIds\n })\n );\n\n const results = await Promise.allSettled(storePromises);\n const successful = results.filter(r => r.status === 'fulfilled').length;\n const successRate = successful / channels.length;\n\n // Require majority success for cross-channel consensus\n const consensusThreshold = 0.51;\n if (successRate >= consensusThreshold) {\n this.emit('crossChannelConsensus', {\n key,\n channels: channelIds,\n successRate,\n consensusReached: true\n });\n\n return {\n success: true,\n channels: channelIds,\n successRate,\n crossChannelConsensus: true\n };\n } else {\n throw new Error(`Cross-channel consensus failed: ${successRate * 100}% success rate`);\n }\n }\n\n /**\n * Handle Byzantine detection across channels\n */\n async handleCrossChannelByzantine(channelId, byzantineData) {\n // Propagate Byzantine intelligence to other channels\n for (const [otherChannelId, channel] of this.channels.entries()) {\n if (otherChannelId !== channelId) {\n channel.emit('externalByzantine', {\n sourceChannel: channelId,\n ...byzantineData\n });\n }\n }\n }\n\n /**\n * Get comprehensive manager statistics\n */\n async getStats() {\n this.ensureInitialized();\n\n const channelStats = {};\n\n for (const [channelId, channel] of this.channels.entries()) {\n try {\n channelStats[channelId] = await channel.getStats();\n } catch (error) {\n channelStats[channelId] = { error: error.message };\n }\n }\n\n return {\n manager: {\n initialized: this.isInitialized,\n channelCount: this.channels.size,\n maxChannels: this.options.maxChannels,\n crossChannelEnabled: this.options.enableCrossChannelConsensus\n },\n channels: channelStats\n };\n }\n\n /**\n * Shutdown all channels\n */\n async shutdown() {\n if (!this.isInitialized) return;\n\n const shutdownPromises = Array.from(this.channels.values()).map(\n channel => channel.shutdown()\n );\n\n await Promise.allSettled(shutdownPromises);\n\n this.channels.clear();\n this.crossChannelConsensus.clear();\n this.isInitialized = false;\n\n this.emit('shutdown');\n console.log('✅ Byzantine Channel Manager shut down successfully');\n }\n\n ensureInitialized() {\n if (!this.isInitialized) {\n throw new Error('Byzantine Channel Manager not initialized. Call initialize() first.');\n }\n }\n}\n\n// Factory functions\nexport function createByzantineChannel(channelId, options = {}) {\n return new ByzantineMemoryChannel(channelId, options);\n}\n\nexport function createChannelManager(options = {}) {\n return new ByzantineChannelManager(options);\n}\n\n// Test function\nexport async function testByzantineChannels() {\n try {\n const manager = new ByzantineChannelManager({\n maxChannels: 5,\n defaultByzantineThreshold: 0.67\n });\n\n await manager.initialize();\n\n // Create test channel\n const channel = await manager.createChannel('test-channel', {\n enableFallback: true,\n byzantineThreshold: 0.67\n });\n\n // Test storage\n const storeResult = await channel.store('test-key', 'test-value', {\n namespace: 'test'\n });\n\n // Test retrieval\n const retrieved = await channel.retrieve('test-key', { namespace: 'test' });\n\n // Get stats\n const stats = await manager.getStats();\n\n // Shutdown\n await manager.shutdown();\n\n return {\n byzantine: true,\n channelCreated: true,\n storeSuccessful: storeResult.success,\n retrieveSuccessful: retrieved === 'test-value',\n consensusEnabled: storeResult.byzantineVerified !== undefined,\n fallbackReady: stats.channels['test-channel']?.channel?.fallbackEnabled || false,\n error: null\n };\n } catch (error) {\n return {\n byzantine: false,\n error: error.message\n };\n }\n}\n\nexport default ByzantineMemoryChannel;
|
|
610
|
+
return `node_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
generateProposalId() {
|
|
614
|
+
return `proposal_${this.consensus.currentRound}_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
signData(data) {
|
|
618
|
+
// Simple signature simulation - in production use proper cryptographic signatures
|
|
619
|
+
const dataStr = JSON.stringify(data);
|
|
620
|
+
return `sig_${Buffer.from(dataStr).toString('base64').substr(0, 16)}`;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
updateMetrics(operation, duration, success) {
|
|
624
|
+
if (success) {
|
|
625
|
+
// Update success metrics
|
|
626
|
+
} else {
|
|
627
|
+
// Update failure metrics
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
updateAverage(currentAvg, newValue, count) {
|
|
632
|
+
return ((currentAvg * (count - 1)) + newValue) / count;
|
|
633
|
+
}
|
|
634
|
+
}\n\n/**\n * Message Router for Byzantine communication\n */\nclass MessageRouter extends EventEmitter {\n constructor(channelId) {\n super();\n this.channelId = channelId;\n this.nodeId = null;\n this.initialized = false;\n }\n\n async initialize(nodeId) {\n this.nodeId = nodeId;\n this.initialized = true;\n }\n\n async broadcast(message) {\n // Simulate message broadcasting\n this.emit('broadcast', { ...message, channelId: this.channelId });\n }\n\n async shutdown() {\n this.initialized = false;\n this.removeAllListeners();\n }\n}\n\n/**\n * Consensus Manager for Byzantine fault tolerance\n */\nclass ConsensusManager {\n constructor(threshold) {\n this.threshold = threshold;\n }\n\n analyzeVotes(votes) {\n if (votes.size === 0) {\n return {\n consensus: false,\n reason: 'No votes received',\n byzantineDetected: false\n };\n }\n\n // Simple consensus analysis - in production use proper Byzantine algorithms\n const voteArray = Array.from(votes.values());\n const approvalVotes = voteArray.filter(vote => vote.approval === true).length;\n const totalVotes = voteArray.length;\n const approvalRatio = approvalVotes / totalVotes;\n\n // Check for Byzantine behavior (conflicting votes from same node)\n const byzantineNodes = this.detectByzantineBehavior(voteArray);\n\n return {\n consensus: approvalRatio >= this.threshold,\n votes: voteArray,\n approvalRatio,\n byzantineDetected: byzantineNodes.size > 0,\n byzantineNodes,\n reason: approvalRatio >= this.threshold ? 'Consensus reached' : 'Insufficient approval'\n };\n }\n\n detectByzantineBehavior(votes) {\n const byzantineNodes = new Set();\n const nodeVotes = new Map();\n\n // Group votes by node\n for (const vote of votes) {\n if (!nodeVotes.has(vote.nodeId)) {\n nodeVotes.set(vote.nodeId, []);\n }\n nodeVotes.get(vote.nodeId).push(vote);\n }\n\n // Check for conflicting votes from same node\n for (const [nodeId, nodeVoteList] of nodeVotes.entries()) {\n if (nodeVoteList.length > 1) {\n // Check for contradictory votes\n const approvals = nodeVoteList.map(v => v.approval);\n if (approvals.includes(true) && approvals.includes(false)) {\n byzantineNodes.add(nodeId);\n }\n }\n }\n\n return byzantineNodes;\n }\n}\n\n/**\n * Byzantine Memory Channel Manager\n * Manages multiple channels with coordination\n */\nexport class ByzantineChannelManager extends EventEmitter {\n constructor(options = {}) {\n super();\n\n this.options = {\n maxChannels: options.maxChannels || 50,\n defaultByzantineThreshold: options.defaultByzantineThreshold || 0.67,\n enableCrossChannelConsensus: options.enableCrossChannelConsensus !== false,\n ...options\n };\n\n this.channels = new Map();\n this.crossChannelConsensus = new Map();\n this.isInitialized = false;\n }\n\n /**\n * Initialize channel manager\n */\n async initialize() {\n if (this.isInitialized) return;\n\n this.isInitialized = true;\n\n this.emit('initialized', {\n maxChannels: this.options.maxChannels,\n crossChannelConsensus: this.options.enableCrossChannelConsensus\n });\n\n console.log('✅ Byzantine Channel Manager initialized');\n\n return { success: true };\n }\n\n /**\n * Create new Byzantine memory channel\n */\n async createChannel(channelId, options = {}) {\n this.ensureInitialized();\n\n if (this.channels.has(channelId)) {\n throw new Error(`Channel ${channelId} already exists`);\n }\n\n if (this.channels.size >= this.options.maxChannels) {\n throw new Error('Maximum number of channels reached');\n }\n\n const channelOptions = {\n ...options,\n byzantineThreshold: options.byzantineThreshold || this.options.defaultByzantineThreshold\n };\n\n const channel = new ByzantineMemoryChannel(channelId, channelOptions);\n await channel.initialize();\n\n this.channels.set(channelId, channel);\n\n // Set up cross-channel event handling\n channel.on('consensusReached', (data) => {\n this.emit('channelConsensus', { channelId, ...data });\n });\n\n channel.on('byzantineDetected', (data) => {\n this.emit('channelByzantine', { channelId, ...data });\n this.handleCrossChannelByzantine(channelId, data);\n });\n\n this.emit('channelCreated', { channelId, options: channelOptions });\n\n return channel;\n }\n\n /**\n * Get channel by ID\n */\n getChannel(channelId) {\n return this.channels.get(channelId);\n }\n\n /**\n * Get all channels\n */\n getAllChannels() {\n return Array.from(this.channels.values());\n }\n\n /**\n * Store data across multiple channels with cross-channel consensus\n */\n async crossChannelStore(channelIds, key, value, options = {}) {\n this.ensureInitialized();\n\n if (!this.options.enableCrossChannelConsensus) {\n throw new Error('Cross-channel consensus is disabled');\n }\n\n const channels = channelIds.map(id => this.getChannel(id)).filter(Boolean);\n\n if (channels.length !== channelIds.length) {\n throw new Error('Some channels not found');\n }\n\n // Execute storage across all channels\n const storePromises = channels.map(channel =>\n channel.store(key, value, {\n ...options,\n crossChannelConsensus: true,\n participatingChannels: channelIds\n })\n );\n\n const results = await Promise.allSettled(storePromises);\n const successful = results.filter(r => r.status === 'fulfilled').length;\n const successRate = successful / channels.length;\n\n // Require majority success for cross-channel consensus\n const consensusThreshold = 0.51;\n if (successRate >= consensusThreshold) {\n this.emit('crossChannelConsensus', {\n key,\n channels: channelIds,\n successRate,\n consensusReached: true\n });\n\n return {\n success: true,\n channels: channelIds,\n successRate,\n crossChannelConsensus: true\n };\n } else {\n throw new Error(`Cross-channel consensus failed: ${successRate * 100}% success rate`);\n }\n }\n\n /**\n * Handle Byzantine detection across channels\n */\n async handleCrossChannelByzantine(channelId, byzantineData) {\n // Propagate Byzantine intelligence to other channels\n for (const [otherChannelId, channel] of this.channels.entries()) {\n if (otherChannelId !== channelId) {\n channel.emit('externalByzantine', {\n sourceChannel: channelId,\n ...byzantineData\n });\n }\n }\n }\n\n /**\n * Get comprehensive manager statistics\n */\n async getStats() {\n this.ensureInitialized();\n\n const channelStats = {};\n\n for (const [channelId, channel] of this.channels.entries()) {\n try {\n channelStats[channelId] = await channel.getStats();\n } catch (error) {\n channelStats[channelId] = { error: error.message };\n }\n }\n\n return {\n manager: {\n initialized: this.isInitialized,\n channelCount: this.channels.size,\n maxChannels: this.options.maxChannels,\n crossChannelEnabled: this.options.enableCrossChannelConsensus\n },\n channels: channelStats\n };\n }\n\n /**\n * Shutdown all channels\n */\n async shutdown() {\n if (!this.isInitialized) return;\n\n const shutdownPromises = Array.from(this.channels.values()).map(\n channel => channel.shutdown()\n );\n\n await Promise.allSettled(shutdownPromises);\n\n this.channels.clear();\n this.crossChannelConsensus.clear();\n this.isInitialized = false;\n\n this.emit('shutdown');\n console.log('✅ Byzantine Channel Manager shut down successfully');\n }\n\n ensureInitialized() {\n if (!this.isInitialized) {\n throw new Error('Byzantine Channel Manager not initialized. Call initialize() first.');\n }\n }\n}\n\n// Factory functions\nexport function createByzantineChannel(channelId, options = {}) {\n return new ByzantineMemoryChannel(channelId, options);\n}\n\nexport function createChannelManager(options = {}) {\n return new ByzantineChannelManager(options);\n}\n\n// Test function\nexport async function testByzantineChannels() {\n try {\n const manager = new ByzantineChannelManager({\n maxChannels: 5,\n defaultByzantineThreshold: 0.67\n });\n\n await manager.initialize();\n\n // Create test channel\n const channel = await manager.createChannel('test-channel', {\n enableFallback: true,\n byzantineThreshold: 0.67\n });\n\n // Test storage\n const storeResult = await channel.store('test-key', 'test-value', {\n namespace: 'test'\n });\n\n // Test retrieval\n const retrieved = await channel.retrieve('test-key', { namespace: 'test' });\n\n // Get stats\n const stats = await manager.getStats();\n\n // Shutdown\n await manager.shutdown();\n\n return {\n byzantine: true,\n channelCreated: true,\n storeSuccessful: storeResult.success,\n retrieveSuccessful: retrieved === 'test-value',\n consensusEnabled: storeResult.byzantineVerified !== undefined,\n fallbackReady: stats.channels['test-channel']?.channel?.fallbackEnabled || false,\n error: null\n };\n } catch (error) {\n return {\n byzantine: false,\n error: error.message\n };\n }\n}\n\nexport default ByzantineMemoryChannel;
|
package/dist/src/index.js
CHANGED
|
@@ -1,36 +1,385 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
2
|
+
* Content Filtering System - Main Entry Point
|
|
3
|
+
* Comprehensive solution for .md file overload and tone processing
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Core Filtering Components
|
|
7
|
+
export { ContentFilters } from './filters/content-filters.js';
|
|
8
|
+
export { ToneProcessors } from './filters/tone-processors.js';
|
|
9
|
+
|
|
10
|
+
// Integration and Hooks
|
|
11
|
+
export { FilterIntegrationHooks } from './hooks/filter-integration.js';
|
|
12
|
+
export { HooksIntegrationSystem } from './integration/hooks-integration.js';
|
|
13
|
+
|
|
14
|
+
// Configuration and Preferences
|
|
15
|
+
export { FilterConfiguration } from './config/filter-config.js';
|
|
16
|
+
export { PreferenceManager } from './utils/preference-manager.js';
|
|
17
|
+
|
|
18
|
+
// Real-time Processing
|
|
19
|
+
export { RealtimeFilterMiddleware } from './middleware/realtime-filter.js';
|
|
20
|
+
|
|
21
|
+
// Concurrent Processing
|
|
22
|
+
export { ConcurrentFilterPipeline } from './concurrent/filter-pipeline.js';
|
|
23
|
+
|
|
24
|
+
// Audit and Logging
|
|
25
|
+
export { ContentAuditSystem } from './audit/content-audit.js';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Main FilteringSystem class that orchestrates all components
|
|
29
|
+
*/
|
|
30
|
+
class FilteringSystem {
|
|
31
|
+
constructor(projectRoot = process.cwd(), options = {}) {
|
|
32
|
+
this.projectRoot = projectRoot;
|
|
33
|
+
this.options = {
|
|
34
|
+
enableRealtime: true,
|
|
35
|
+
enableConcurrency: true,
|
|
36
|
+
enableAudit: true,
|
|
37
|
+
enableHooksIntegration: true,
|
|
38
|
+
...options,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
this.initialized = false;
|
|
42
|
+
this.startTime = Date.now();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Initialize all system components
|
|
47
|
+
*/
|
|
48
|
+
async initializeComponents() {
|
|
49
|
+
// Core components
|
|
50
|
+
const { ContentFilters } = await import('./filters/content-filters.js');
|
|
51
|
+
const { ToneProcessors } = await import('./filters/tone-processors.js');
|
|
52
|
+
|
|
53
|
+
this.contentFilters = new ContentFilters();
|
|
54
|
+
this.toneProcessors = new ToneProcessors();
|
|
55
|
+
|
|
56
|
+
// Configuration
|
|
57
|
+
const { FilterConfiguration } = await import('./config/filter-config.js');
|
|
58
|
+
const { PreferenceManager } = await import('./utils/preference-manager.js');
|
|
59
|
+
|
|
60
|
+
this.filterConfig = new FilterConfiguration(this.projectRoot);
|
|
61
|
+
this.preferenceManager = new PreferenceManager(this.projectRoot);
|
|
62
|
+
|
|
63
|
+
// Integration
|
|
64
|
+
if (this.options.enableHooksIntegration) {
|
|
65
|
+
const { HooksIntegrationSystem } = await import('./integration/hooks-integration.js');
|
|
66
|
+
this.hooksIntegration = new HooksIntegrationSystem(this.projectRoot);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Real-time processing
|
|
70
|
+
if (this.options.enableRealtime) {
|
|
71
|
+
const { RealtimeFilterMiddleware } = await import('./middleware/realtime-filter.js');
|
|
72
|
+
this.realtimeFilter = new RealtimeFilterMiddleware(this.projectRoot);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Concurrent processing
|
|
76
|
+
if (this.options.enableConcurrency) {
|
|
77
|
+
const { ConcurrentFilterPipeline } = await import('./concurrent/filter-pipeline.js');
|
|
78
|
+
this.concurrentPipeline = new ConcurrentFilterPipeline(this.options.concurrent);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Audit system
|
|
82
|
+
if (this.options.enableAudit) {
|
|
83
|
+
const { ContentAuditSystem } = await import('./audit/content-audit.js');
|
|
84
|
+
this.auditSystem = new ContentAuditSystem(this.projectRoot);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Setup event listeners
|
|
88
|
+
this.setupEventHandlers();
|
|
89
|
+
|
|
90
|
+
this.initialized = true;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Setup event handlers between components
|
|
95
|
+
*/
|
|
96
|
+
setupEventHandlers() {
|
|
97
|
+
if (this.realtimeFilter && this.auditSystem) {
|
|
98
|
+
this.realtimeFilter.on('contentProcessed', (result) => {
|
|
99
|
+
this.auditSystem.logFilterAction('REALTIME_PROCESSED', result);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
this.realtimeFilter.on('contentBlocked', (result) => {
|
|
103
|
+
this.auditSystem.logFilterAction('REALTIME_BLOCKED', result);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (this.concurrentPipeline && this.auditSystem) {
|
|
108
|
+
this.concurrentPipeline.on('jobCompleted', (job) => {
|
|
109
|
+
this.auditSystem.logFilterAction('CONCURRENT_JOB_COMPLETED', job);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Process single document
|
|
116
|
+
*/
|
|
117
|
+
async processDocument(filePath, content, metadata = {}) {
|
|
118
|
+
await this.ensureInitialized();
|
|
119
|
+
|
|
120
|
+
const preferences = this.preferenceManager.getContextualPreferences(metadata);
|
|
121
|
+
|
|
122
|
+
// Apply content filtering
|
|
123
|
+
const filterResult = this.contentFilters.filterDocumentRequest(filePath, content, metadata);
|
|
124
|
+
|
|
125
|
+
if (!filterResult.allowed) {
|
|
126
|
+
return filterResult;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Apply tone processing
|
|
130
|
+
const toneResult = this.toneProcessors.processMessage(
|
|
131
|
+
filterResult.content,
|
|
132
|
+
preferences.userPreferences.tonePreset,
|
|
133
|
+
preferences.userPreferences,
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
return {
|
|
137
|
+
...filterResult,
|
|
138
|
+
content: toneResult.processed,
|
|
139
|
+
toneChanges: toneResult.changes,
|
|
140
|
+
processed: toneResult.processed !== content,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Process multiple documents concurrently
|
|
146
|
+
*/
|
|
147
|
+
async processDocumentsConcurrently(documents, metadata = {}) {
|
|
148
|
+
await this.ensureInitialized();
|
|
149
|
+
|
|
150
|
+
if (!this.concurrentPipeline) {
|
|
151
|
+
throw new Error('Concurrent processing not enabled');
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return this.concurrentPipeline.processParallel(documents, metadata);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Create real-time processing stream
|
|
159
|
+
*/
|
|
160
|
+
createProcessingStream(options = {}) {
|
|
161
|
+
if (!this.realtimeFilter) {
|
|
162
|
+
throw new Error('Real-time processing not enabled');
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return this.realtimeFilter.createStreamingProcessor(options);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Get comprehensive system status
|
|
170
|
+
*/
|
|
171
|
+
getSystemStatus() {
|
|
172
|
+
const status = {
|
|
173
|
+
initialized: this.initialized,
|
|
174
|
+
uptime: Date.now() - this.startTime,
|
|
175
|
+
components: {},
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
if (this.contentFilters) {
|
|
179
|
+
status.components.contentFilters = this.contentFilters.getFilterStats();
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (this.toneProcessors) {
|
|
183
|
+
status.components.toneProcessors = this.toneProcessors.getProcessingStats();
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (this.realtimeFilter) {
|
|
187
|
+
status.components.realtimeFilter = this.realtimeFilter.getStats();
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if (this.concurrentPipeline) {
|
|
191
|
+
status.components.concurrentPipeline = this.concurrentPipeline.getStats();
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (this.auditSystem) {
|
|
195
|
+
status.components.auditSystem = this.auditSystem.getDashboardData();
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
if (this.preferenceManager) {
|
|
199
|
+
status.components.preferences = this.preferenceManager.getUsageStatistics();
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return status;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Generate comprehensive report
|
|
207
|
+
*/
|
|
208
|
+
async generateSystemReport(timeframe = '24h') {
|
|
209
|
+
await this.ensureInitialized();
|
|
210
|
+
|
|
211
|
+
const report = {
|
|
212
|
+
timestamp: new Date().toISOString(),
|
|
213
|
+
timeframe,
|
|
214
|
+
systemStatus: this.getSystemStatus(),
|
|
215
|
+
auditReport: this.auditSystem?.generateAuditReport(timeframe),
|
|
216
|
+
preferences: this.preferenceManager?.exportPreferences(),
|
|
217
|
+
configuration: this.filterConfig?.exportConfig(),
|
|
218
|
+
recommendations: this.generateRecommendations(),
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
return report;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Generate system recommendations
|
|
226
|
+
*/
|
|
227
|
+
generateRecommendations() {
|
|
228
|
+
const recommendations = [];
|
|
229
|
+
|
|
230
|
+
if (this.auditSystem) {
|
|
231
|
+
const stats = this.auditSystem.getDashboardData();
|
|
232
|
+
|
|
233
|
+
if (stats.overview.filteredToday > 50) {
|
|
234
|
+
recommendations.push({
|
|
235
|
+
type: 'performance',
|
|
236
|
+
priority: 'high',
|
|
237
|
+
message:
|
|
238
|
+
'High filtering activity detected. Consider adjusting filter rules to reduce false positives.',
|
|
239
|
+
action: 'review_filter_rules',
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (stats.overview.errorRate > 0.1) {
|
|
244
|
+
recommendations.push({
|
|
245
|
+
type: 'reliability',
|
|
246
|
+
priority: 'medium',
|
|
247
|
+
message: 'Error rate is elevated. Check system logs for recurring issues.',
|
|
248
|
+
action: 'check_error_logs',
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
if (this.concurrentPipeline) {
|
|
254
|
+
const stats = this.concurrentPipeline.getStats();
|
|
255
|
+
|
|
256
|
+
if (stats.workerUtilization > 90) {
|
|
257
|
+
recommendations.push({
|
|
258
|
+
type: 'scalability',
|
|
259
|
+
priority: 'medium',
|
|
260
|
+
message: 'High worker utilization. Consider scaling up worker pool.',
|
|
261
|
+
action: 'scale_workers',
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
return recommendations;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Update system configuration
|
|
271
|
+
*/
|
|
272
|
+
async updateConfiguration(section, updates) {
|
|
273
|
+
await this.ensureInitialized();
|
|
274
|
+
|
|
275
|
+
switch (section) {
|
|
276
|
+
case 'contentFilters':
|
|
277
|
+
this.contentFilters.updateLimits(updates);
|
|
278
|
+
break;
|
|
279
|
+
case 'toneProcessors':
|
|
280
|
+
this.toneProcessors.updateConfig(updates);
|
|
281
|
+
break;
|
|
282
|
+
case 'preferences':
|
|
283
|
+
this.preferenceManager.updateActivePreferences('userPreferences', updates);
|
|
284
|
+
break;
|
|
285
|
+
case 'global':
|
|
286
|
+
this.filterConfig.updateConfig(section, updates);
|
|
287
|
+
break;
|
|
288
|
+
default:
|
|
289
|
+
throw new Error(`Unknown configuration section: ${section}`);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
return this.filterConfig.exportConfig();
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Ensure system is initialized
|
|
297
|
+
*/
|
|
298
|
+
async ensureInitialized() {
|
|
299
|
+
if (!this.initialized) {
|
|
300
|
+
await this.initializeComponents();
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Graceful system shutdown
|
|
306
|
+
*/
|
|
307
|
+
async shutdown() {
|
|
308
|
+
if (this.realtimeFilter) {
|
|
309
|
+
await this.realtimeFilter.shutdown();
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
if (this.concurrentPipeline) {
|
|
313
|
+
await this.concurrentPipeline.shutdown();
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
if (this.auditSystem) {
|
|
317
|
+
// Flush any pending audit data
|
|
318
|
+
this.auditSystem.logFilterAction('SYSTEM_SHUTDOWN', {
|
|
319
|
+
timestamp: new Date().toISOString(),
|
|
320
|
+
uptime: Date.now() - this.startTime,
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
this.initialized = false;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export { FilteringSystem };
|
|
329
|
+
export default FilteringSystem;
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Quick setup function for common use cases
|
|
333
|
+
*/
|
|
334
|
+
export function createFilteringSystem(options = {}) {
|
|
335
|
+
return new FilteringSystem(process.cwd(), options);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Express.js middleware factory
|
|
340
|
+
*/
|
|
341
|
+
export function createExpressMiddleware(options = {}) {
|
|
342
|
+
const system = new FilteringSystem(process.cwd(), options);
|
|
343
|
+
|
|
344
|
+
return async (req, res, next) => {
|
|
345
|
+
await system.ensureInitialized();
|
|
346
|
+
|
|
347
|
+
if (system.realtimeFilter) {
|
|
348
|
+
const middleware = system.realtimeFilter.createExpressMiddleware();
|
|
349
|
+
return middleware(req, res, next);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
next();
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* CLI command factory
|
|
358
|
+
*/
|
|
359
|
+
export function createCliCommands(system) {
|
|
360
|
+
return {
|
|
361
|
+
async processFile(filePath, content, options = {}) {
|
|
362
|
+
return system.processDocument(filePath, content, options);
|
|
363
|
+
},
|
|
364
|
+
|
|
365
|
+
async batchProcess(documents, options = {}) {
|
|
366
|
+
return system.processDocumentsConcurrently(documents, options);
|
|
367
|
+
},
|
|
368
|
+
|
|
369
|
+
async getStatus() {
|
|
370
|
+
return system.getSystemStatus();
|
|
371
|
+
},
|
|
372
|
+
|
|
373
|
+
async generateReport(timeframe = '24h') {
|
|
374
|
+
return system.generateSystemReport(timeframe);
|
|
375
|
+
},
|
|
376
|
+
|
|
377
|
+
async updateConfig(section, updates) {
|
|
378
|
+
return system.updateConfiguration(section, updates);
|
|
379
|
+
},
|
|
380
|
+
|
|
381
|
+
async shutdown() {
|
|
382
|
+
return system.shutdown();
|
|
383
|
+
},
|
|
384
|
+
};
|
|
385
|
+
}
|
|
@@ -1,36 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
*/ function _define_property(obj, key, value) {
|
|
4
|
-
if (key in obj) {
|
|
5
|
-
Object.defineProperty(obj, key, {
|
|
6
|
-
value: value,
|
|
7
|
-
enumerable: true,
|
|
8
|
-
configurable: true,
|
|
9
|
-
writable: true
|
|
10
|
-
});
|
|
11
|
-
} else {
|
|
12
|
-
obj[key] = value;
|
|
13
|
-
}
|
|
14
|
-
return obj;
|
|
15
|
-
}
|
|
16
|
-
import { getErrorMessage as getErrorMsg, getErrorStack as getErrorStk, isError as isErr } from "./type-guards.js";
|
|
17
|
-
export class AppError extends Error {
|
|
18
|
-
constructor(message, code, statusCode){
|
|
19
|
-
super(message), _define_property(this, "code", void 0), _define_property(this, "statusCode", void 0), this.code = code, this.statusCode = statusCode;
|
|
20
|
-
this.name = 'AppError';
|
|
21
|
-
Object.setPrototypeOf(this, AppError.prototype);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
// Re-export from type-guards for backward compatibility
|
|
25
|
-
export const isError = isErr;
|
|
26
|
-
export const getErrorMessage = getErrorMsg;
|
|
27
|
-
export const getErrorStack = getErrorStk;
|
|
28
|
-
export function handleError(error, context) {
|
|
29
|
-
const message = getErrorMessage(error);
|
|
30
|
-
const stack = getErrorStack(error);
|
|
31
|
-
console.error(`Error${context ? ` in ${context}` : ''}: ${message}`);
|
|
32
|
-
if (stack && process.env.NODE_ENV === 'development') {
|
|
33
|
-
console.error('Stack trace:', stack);
|
|
34
|
-
}
|
|
35
|
-
process.exit(1);
|
|
36
|
-
}
|
|
1
|
+
// Re-export from TypeScript file
|
|
2
|
+
export * from './error-handler.ts';
|