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,421 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transparency Logger - Provides complete visibility into agent decision-making
|
|
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 { EventEmitter } from "events";
|
|
17
|
+
import { promises as fs } from "fs";
|
|
18
|
+
import path from "path";
|
|
19
|
+
export class TransparencyLogger extends EventEmitter {
|
|
20
|
+
/**
|
|
21
|
+
* Log agent message with transparency details
|
|
22
|
+
*/ logMessage(message) {
|
|
23
|
+
const transparencyLog = {
|
|
24
|
+
id: this.generateLogId(),
|
|
25
|
+
swarmId: message.swarmId,
|
|
26
|
+
agentId: message.agentId,
|
|
27
|
+
type: this.mapMessageTypeToLogType(message.messageType),
|
|
28
|
+
title: this.generateLogTitle(message),
|
|
29
|
+
content: message.content,
|
|
30
|
+
metadata: {
|
|
31
|
+
reasoning: message.metadata?.reasoning,
|
|
32
|
+
alternatives: message.metadata?.alternatives,
|
|
33
|
+
confidence: message.metadata?.confidence,
|
|
34
|
+
dependencies: message.metadata?.dependencies,
|
|
35
|
+
riskAssessment: this.generateRiskAssessment(message),
|
|
36
|
+
expectedOutcome: message.metadata?.expectedOutcome
|
|
37
|
+
},
|
|
38
|
+
timestamp: message.timestamp,
|
|
39
|
+
visibility: 'public'
|
|
40
|
+
};
|
|
41
|
+
this.storeLogs(transparencyLog);
|
|
42
|
+
this.emit('transparency-logged', transparencyLog);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Log task progress with detailed insights
|
|
46
|
+
*/ logTaskProgress(progress) {
|
|
47
|
+
const transparencyLog = {
|
|
48
|
+
id: this.generateLogId(),
|
|
49
|
+
swarmId: progress.swarmId,
|
|
50
|
+
agentId: progress.agentId,
|
|
51
|
+
type: 'task-progress',
|
|
52
|
+
title: `Task Progress: ${progress.taskName}`,
|
|
53
|
+
content: `Progress: ${progress.percentage}% - ${progress.status}`,
|
|
54
|
+
metadata: {
|
|
55
|
+
timeSpent: progress.timeSpent,
|
|
56
|
+
expectedOutcome: progress.expectedCompletion,
|
|
57
|
+
riskAssessment: this.assessTaskRisk(progress)
|
|
58
|
+
},
|
|
59
|
+
timestamp: new Date().toISOString(),
|
|
60
|
+
visibility: 'team'
|
|
61
|
+
};
|
|
62
|
+
this.storeLogs(transparencyLog);
|
|
63
|
+
this.emit('task-progress-logged', transparencyLog);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Generate transparency insights
|
|
67
|
+
*/ generateInsight(swarmId, type, content) {
|
|
68
|
+
const insight = {
|
|
69
|
+
id: this.generateLogId(),
|
|
70
|
+
swarmId,
|
|
71
|
+
agentId: 'system',
|
|
72
|
+
type: 'insight',
|
|
73
|
+
title: `Transparency Insight: ${type}`,
|
|
74
|
+
content,
|
|
75
|
+
metadata: {
|
|
76
|
+
reasoning: 'Generated by transparency analysis system'
|
|
77
|
+
},
|
|
78
|
+
timestamp: new Date().toISOString(),
|
|
79
|
+
visibility: 'public'
|
|
80
|
+
};
|
|
81
|
+
this.storeLogs(insight);
|
|
82
|
+
this.emit('insight', insight);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Get message statistics with transparency metrics
|
|
86
|
+
*/ async getMessageStats(swarmId, timeRange = '24h') {
|
|
87
|
+
const swarmLogs = this.getSwarmLogs(swarmId, timeRange);
|
|
88
|
+
const stats = {
|
|
89
|
+
swarmId,
|
|
90
|
+
timeRange,
|
|
91
|
+
totalMessages: swarmLogs.length,
|
|
92
|
+
messagesByType: {},
|
|
93
|
+
messagesByAgent: {},
|
|
94
|
+
averageResponseTime: 0,
|
|
95
|
+
decisionCount: 0,
|
|
96
|
+
coordinationEvents: 0,
|
|
97
|
+
transparencyScore: this.calculateTransparencyScore(swarmLogs)
|
|
98
|
+
};
|
|
99
|
+
// Analyze message types
|
|
100
|
+
for (const log of swarmLogs){
|
|
101
|
+
stats.messagesByType[log.type] = (stats.messagesByType[log.type] || 0) + 1;
|
|
102
|
+
stats.messagesByAgent[log.agentId] = (stats.messagesByAgent[log.agentId] || 0) + 1;
|
|
103
|
+
if (log.type === 'decision') {
|
|
104
|
+
stats.decisionCount++;
|
|
105
|
+
}
|
|
106
|
+
if (log.type === 'coordination') {
|
|
107
|
+
stats.coordinationEvents++;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// Calculate average response time
|
|
111
|
+
const responseTimes = swarmLogs.filter((log)=>log.metadata.timeSpent).map((log)=>log.metadata.timeSpent);
|
|
112
|
+
if (responseTimes.length > 0) {
|
|
113
|
+
stats.averageResponseTime = responseTimes.reduce((sum, time)=>sum + time, 0) / responseTimes.length;
|
|
114
|
+
}
|
|
115
|
+
return stats;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Get transparency report for a swarm
|
|
119
|
+
*/ async getTransparencyReport(swarmId) {
|
|
120
|
+
const logs = this.getSwarmLogs(swarmId);
|
|
121
|
+
const decisions = logs.filter((log)=>log.type === 'decision');
|
|
122
|
+
const reasoningEntries = logs.filter((log)=>log.metadata.reasoning);
|
|
123
|
+
return {
|
|
124
|
+
swarmId,
|
|
125
|
+
reportGeneratedAt: new Date().toISOString(),
|
|
126
|
+
summary: {
|
|
127
|
+
totalEvents: logs.length,
|
|
128
|
+
decisionsLogged: decisions.length,
|
|
129
|
+
reasoningProvided: reasoningEntries.length,
|
|
130
|
+
transparencyScore: this.calculateTransparencyScore(logs)
|
|
131
|
+
},
|
|
132
|
+
decisionBreakdown: this.analyzeDecisions(decisions),
|
|
133
|
+
reasoningQuality: this.analyzeReasoningQuality(reasoningEntries),
|
|
134
|
+
coordinationEfficiency: this.analyzeCoordinationEfficiency(logs),
|
|
135
|
+
recommendations: this.generateRecommendations(logs)
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Get real-time transparency dashboard data
|
|
140
|
+
*/ getTransparencyDashboard(swarmId) {
|
|
141
|
+
const recentLogs = this.getSwarmLogs(swarmId, '1h');
|
|
142
|
+
const allLogs = this.getSwarmLogs(swarmId);
|
|
143
|
+
return {
|
|
144
|
+
swarmId,
|
|
145
|
+
lastUpdated: new Date().toISOString(),
|
|
146
|
+
realTimeMetrics: {
|
|
147
|
+
recentActivity: recentLogs.length,
|
|
148
|
+
currentTransparencyScore: this.calculateTransparencyScore(recentLogs),
|
|
149
|
+
activeAgents: [
|
|
150
|
+
...new Set(recentLogs.map((log)=>log.agentId))
|
|
151
|
+
].length,
|
|
152
|
+
pendingDecisions: recentLogs.filter((log)=>log.type === 'decision' && !log.metadata.expectedOutcome).length
|
|
153
|
+
},
|
|
154
|
+
trends: {
|
|
155
|
+
transparencyTrend: this.calculateTransparencyTrend(allLogs),
|
|
156
|
+
decisionVelocity: this.calculateDecisionVelocity(allLogs),
|
|
157
|
+
coordinationEfficiency: this.calculateCoordinationTrend(allLogs)
|
|
158
|
+
},
|
|
159
|
+
alerts: this.generateTransparencyAlerts(recentLogs)
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
storeLogs(log) {
|
|
163
|
+
this.logs.set(log.id, log);
|
|
164
|
+
// Update swarm index
|
|
165
|
+
if (!this.logsBySwarm.has(log.swarmId)) {
|
|
166
|
+
this.logsBySwarm.set(log.swarmId, []);
|
|
167
|
+
}
|
|
168
|
+
this.logsBySwarm.get(log.swarmId).push(log.id);
|
|
169
|
+
// Write to file if enabled
|
|
170
|
+
if (this.config.logToFile) {
|
|
171
|
+
this.writeLogToFile(log);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
async writeLogToFile(log) {
|
|
175
|
+
try {
|
|
176
|
+
const logFile = path.join(this.logPath, `${log.swarmId}-${new Date().toISOString().split('T')[0]}.json`);
|
|
177
|
+
const logEntry = JSON.stringify(log) + '\n';
|
|
178
|
+
await fs.appendFile(logFile, logEntry);
|
|
179
|
+
} catch (error) {
|
|
180
|
+
this.logger.error('Failed to write transparency log to file', {
|
|
181
|
+
error,
|
|
182
|
+
logId: log.id
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
getSwarmLogs(swarmId, timeRange) {
|
|
187
|
+
const logIds = this.logsBySwarm.get(swarmId) || [];
|
|
188
|
+
let logs = logIds.map((id)=>this.logs.get(id)).filter(Boolean);
|
|
189
|
+
if (timeRange) {
|
|
190
|
+
const cutoff = this.parseTimeRange(timeRange);
|
|
191
|
+
logs = logs.filter((log)=>new Date(log.timestamp) > cutoff);
|
|
192
|
+
}
|
|
193
|
+
return logs.sort((a, b)=>new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime());
|
|
194
|
+
}
|
|
195
|
+
parseTimeRange(timeRange) {
|
|
196
|
+
const now = new Date();
|
|
197
|
+
const value = parseInt(timeRange.slice(0, -1));
|
|
198
|
+
const unit = timeRange.slice(-1);
|
|
199
|
+
switch(unit){
|
|
200
|
+
case 'h':
|
|
201
|
+
return new Date(now.getTime() - value * 60 * 60 * 1000);
|
|
202
|
+
case 'd':
|
|
203
|
+
return new Date(now.getTime() - value * 24 * 60 * 60 * 1000);
|
|
204
|
+
case 'm':
|
|
205
|
+
return new Date(now.getTime() - value * 60 * 1000);
|
|
206
|
+
default:
|
|
207
|
+
return new Date(now.getTime() - 24 * 60 * 60 * 1000); // Default 24h
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
calculateTransparencyScore(logs) {
|
|
211
|
+
if (logs.length === 0) return 0;
|
|
212
|
+
let score = 0;
|
|
213
|
+
let maxScore = 0;
|
|
214
|
+
for (const log of logs){
|
|
215
|
+
maxScore += 100; // Each log can contribute max 100 points
|
|
216
|
+
// Points for having reasoning
|
|
217
|
+
if (log.metadata.reasoning) score += 30;
|
|
218
|
+
// Points for alternatives provided
|
|
219
|
+
if (log.metadata.alternatives && log.metadata.alternatives.length > 0) score += 20;
|
|
220
|
+
// Points for confidence score
|
|
221
|
+
if (log.metadata.confidence !== undefined) score += 15;
|
|
222
|
+
// Points for risk assessment
|
|
223
|
+
if (log.metadata.riskAssessment) score += 15;
|
|
224
|
+
// Points for expected outcome
|
|
225
|
+
if (log.metadata.expectedOutcome) score += 20;
|
|
226
|
+
}
|
|
227
|
+
return Math.round(score / maxScore * 100);
|
|
228
|
+
}
|
|
229
|
+
analyzeDecisions(decisions) {
|
|
230
|
+
return {
|
|
231
|
+
totalDecisions: decisions.length,
|
|
232
|
+
decisionsWithReasoning: decisions.filter((d)=>d.metadata.reasoning).length,
|
|
233
|
+
decisionsWithAlternatives: decisions.filter((d)=>d.metadata.alternatives?.length).length,
|
|
234
|
+
averageConfidence: this.calculateAverageConfidence(decisions),
|
|
235
|
+
riskDistribution: this.analyzeRiskDistribution(decisions)
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
analyzeReasoningQuality(entries) {
|
|
239
|
+
const reasoningLengths = entries.map((entry)=>entry.metadata.reasoning?.length || 0);
|
|
240
|
+
return {
|
|
241
|
+
totalEntries: entries.length,
|
|
242
|
+
averageReasoningLength: reasoningLengths.reduce((sum, len)=>sum + len, 0) / reasoningLengths.length || 0,
|
|
243
|
+
qualityScore: this.calculateReasoningQuality(entries)
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
analyzeCoordinationEfficiency(logs) {
|
|
247
|
+
const coordinationLogs = logs.filter((log)=>log.type === 'coordination');
|
|
248
|
+
return {
|
|
249
|
+
coordinationEvents: coordinationLogs.length,
|
|
250
|
+
averageCoordinationTime: this.calculateAverageCoordinationTime(coordinationLogs),
|
|
251
|
+
efficiencyScore: this.calculateCoordinationEfficiency(coordinationLogs)
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
generateRecommendations(logs) {
|
|
255
|
+
const recommendations = [];
|
|
256
|
+
const transparencyScore = this.calculateTransparencyScore(logs);
|
|
257
|
+
const decisions = logs.filter((log)=>log.type === 'decision');
|
|
258
|
+
if (transparencyScore < 70) {
|
|
259
|
+
recommendations.push('Increase transparency by providing more detailed reasoning for decisions');
|
|
260
|
+
}
|
|
261
|
+
if (decisions.length > 0) {
|
|
262
|
+
const decisionsWithoutReasoning = decisions.filter((d)=>!d.metadata.reasoning);
|
|
263
|
+
if (decisionsWithoutReasoning.length / decisions.length > 0.3) {
|
|
264
|
+
recommendations.push('Add reasoning explanations to more agent decisions');
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
const coordinationLogs = logs.filter((log)=>log.type === 'coordination');
|
|
268
|
+
if (coordinationLogs.length < logs.length * 0.2) {
|
|
269
|
+
recommendations.push('Increase coordination transparency between agents');
|
|
270
|
+
}
|
|
271
|
+
return recommendations;
|
|
272
|
+
}
|
|
273
|
+
calculateAverageConfidence(decisions) {
|
|
274
|
+
const confidenceScores = decisions.filter((d)=>d.metadata.confidence !== undefined).map((d)=>d.metadata.confidence);
|
|
275
|
+
return confidenceScores.length > 0 ? confidenceScores.reduce((sum, conf)=>sum + conf, 0) / confidenceScores.length : 0;
|
|
276
|
+
}
|
|
277
|
+
calculateReasoningQuality(entries) {
|
|
278
|
+
// Simple quality metric based on reasoning length and structure
|
|
279
|
+
let totalQuality = 0;
|
|
280
|
+
for (const entry of entries){
|
|
281
|
+
const reasoning = entry.metadata.reasoning || '';
|
|
282
|
+
let quality = 0;
|
|
283
|
+
// Length factor (reasonable explanation)
|
|
284
|
+
if (reasoning.length > 50) quality += 30;
|
|
285
|
+
if (reasoning.length > 100) quality += 20;
|
|
286
|
+
// Structure factors
|
|
287
|
+
if (reasoning.includes('because')) quality += 15;
|
|
288
|
+
if (reasoning.includes('therefore')) quality += 10;
|
|
289
|
+
if (reasoning.includes('consider')) quality += 15;
|
|
290
|
+
if (reasoning.includes('analyze')) quality += 10;
|
|
291
|
+
totalQuality += Math.min(quality, 100);
|
|
292
|
+
}
|
|
293
|
+
return entries.length > 0 ? totalQuality / entries.length : 0;
|
|
294
|
+
}
|
|
295
|
+
mapMessageTypeToLogType(messageType) {
|
|
296
|
+
switch(messageType){
|
|
297
|
+
case 'decision':
|
|
298
|
+
return 'decision';
|
|
299
|
+
case 'reasoning':
|
|
300
|
+
return 'reasoning';
|
|
301
|
+
case 'coordination':
|
|
302
|
+
return 'coordination';
|
|
303
|
+
case 'progress-update':
|
|
304
|
+
return 'task-progress';
|
|
305
|
+
default:
|
|
306
|
+
return 'reasoning';
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
generateLogTitle(message) {
|
|
310
|
+
switch(message.messageType){
|
|
311
|
+
case 'decision':
|
|
312
|
+
return `Decision: ${message.content.substring(0, 50)}...`;
|
|
313
|
+
case 'coordination':
|
|
314
|
+
return `Coordination: Agent ${message.agentId}`;
|
|
315
|
+
case 'progress-update':
|
|
316
|
+
return `Progress Update: ${message.content.substring(0, 30)}...`;
|
|
317
|
+
default:
|
|
318
|
+
return `${message.messageType}: ${message.content.substring(0, 40)}...`;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
generateRiskAssessment(message) {
|
|
322
|
+
// Simple risk assessment based on message content and metadata
|
|
323
|
+
const content = message.content.toLowerCase();
|
|
324
|
+
if (content.includes('error') || content.includes('fail')) {
|
|
325
|
+
return 'High - Error conditions detected';
|
|
326
|
+
}
|
|
327
|
+
if (content.includes('uncertain') || content.includes('unclear')) {
|
|
328
|
+
return 'Medium - Uncertainty present';
|
|
329
|
+
}
|
|
330
|
+
if (message.metadata?.confidence && message.metadata.confidence < 0.5) {
|
|
331
|
+
return 'Medium - Low confidence level';
|
|
332
|
+
}
|
|
333
|
+
return 'Low - Standard operation';
|
|
334
|
+
}
|
|
335
|
+
assessTaskRisk(progress) {
|
|
336
|
+
if (progress.percentage < 10 && progress.timeSpent > progress.estimatedTime * 0.5) {
|
|
337
|
+
return 'High - Behind schedule';
|
|
338
|
+
}
|
|
339
|
+
if (progress.blockers && progress.blockers.length > 0) {
|
|
340
|
+
return 'Medium - Has blockers';
|
|
341
|
+
}
|
|
342
|
+
return 'Low - On track';
|
|
343
|
+
}
|
|
344
|
+
calculateTransparencyTrend(logs) {
|
|
345
|
+
// Compare recent vs older transparency scores
|
|
346
|
+
const recentLogs = logs.slice(0, Math.floor(logs.length / 2));
|
|
347
|
+
const olderLogs = logs.slice(Math.floor(logs.length / 2));
|
|
348
|
+
const recentScore = this.calculateTransparencyScore(recentLogs);
|
|
349
|
+
const olderScore = this.calculateTransparencyScore(olderLogs);
|
|
350
|
+
if (recentScore > olderScore + 5) return 'improving';
|
|
351
|
+
if (recentScore < olderScore - 5) return 'declining';
|
|
352
|
+
return 'stable';
|
|
353
|
+
}
|
|
354
|
+
calculateDecisionVelocity(logs) {
|
|
355
|
+
const decisions = logs.filter((log)=>log.type === 'decision');
|
|
356
|
+
if (decisions.length < 2) return 0;
|
|
357
|
+
const timespan = new Date(decisions[0].timestamp).getTime() - new Date(decisions[decisions.length - 1].timestamp).getTime();
|
|
358
|
+
return decisions.length / (timespan / (60 * 60 * 1000)); // decisions per hour
|
|
359
|
+
}
|
|
360
|
+
calculateCoordinationTrend(logs) {
|
|
361
|
+
const coordinationLogs = logs.filter((log)=>log.type === 'coordination');
|
|
362
|
+
const ratio = coordinationLogs.length / logs.length;
|
|
363
|
+
if (ratio > 0.3) return 'high';
|
|
364
|
+
if (ratio > 0.15) return 'medium';
|
|
365
|
+
return 'low';
|
|
366
|
+
}
|
|
367
|
+
generateTransparencyAlerts(logs) {
|
|
368
|
+
const alerts = [];
|
|
369
|
+
const decisionsWithoutReasoning = logs.filter((log)=>log.type === 'decision' && !log.metadata.reasoning);
|
|
370
|
+
if (decisionsWithoutReasoning.length > 0) {
|
|
371
|
+
alerts.push(`${decisionsWithoutReasoning.length} decisions lack reasoning explanations`);
|
|
372
|
+
}
|
|
373
|
+
const lowConfidenceDecisions = logs.filter((log)=>log.type === 'decision' && log.metadata.confidence && log.metadata.confidence < 0.5);
|
|
374
|
+
if (lowConfidenceDecisions.length > 0) {
|
|
375
|
+
alerts.push(`${lowConfidenceDecisions.length} decisions have low confidence scores`);
|
|
376
|
+
}
|
|
377
|
+
return alerts;
|
|
378
|
+
}
|
|
379
|
+
calculateAverageCoordinationTime(logs) {
|
|
380
|
+
const times = logs.filter((log)=>log.metadata.timeSpent).map((log)=>log.metadata.timeSpent);
|
|
381
|
+
return times.length > 0 ? times.reduce((sum, time)=>sum + time, 0) / times.length : 0;
|
|
382
|
+
}
|
|
383
|
+
calculateCoordinationEfficiency(logs) {
|
|
384
|
+
// Simple efficiency metric based on coordination frequency and success
|
|
385
|
+
return Math.min(100, logs.length * 10); // Placeholder calculation
|
|
386
|
+
}
|
|
387
|
+
analyzeRiskDistribution(decisions) {
|
|
388
|
+
const distribution = {
|
|
389
|
+
low: 0,
|
|
390
|
+
medium: 0,
|
|
391
|
+
high: 0
|
|
392
|
+
};
|
|
393
|
+
for (const decision of decisions){
|
|
394
|
+
const risk = decision.metadata.riskAssessment?.toLowerCase() || 'low';
|
|
395
|
+
if (risk.includes('high')) distribution.high++;
|
|
396
|
+
else if (risk.includes('medium')) distribution.medium++;
|
|
397
|
+
else distribution.low++;
|
|
398
|
+
}
|
|
399
|
+
return distribution;
|
|
400
|
+
}
|
|
401
|
+
async ensureLogDirectory() {
|
|
402
|
+
try {
|
|
403
|
+
await fs.mkdir(this.logPath, {
|
|
404
|
+
recursive: true
|
|
405
|
+
});
|
|
406
|
+
} catch (error) {
|
|
407
|
+
this.logger.error('Failed to create transparency log directory', {
|
|
408
|
+
error,
|
|
409
|
+
path: this.logPath
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
generateLogId() {
|
|
414
|
+
return `log_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
415
|
+
}
|
|
416
|
+
constructor(config, logger){
|
|
417
|
+
super(), _define_property(this, "config", void 0), _define_property(this, "logger", void 0), _define_property(this, "logs", void 0), _define_property(this, "logsBySwarm", void 0), _define_property(this, "logPath", void 0), this.config = config, this.logger = logger, this.logs = new Map(), this.logsBySwarm = new Map();
|
|
418
|
+
this.logPath = config.logPath || './logs/transparency';
|
|
419
|
+
this.ensureLogDirectory();
|
|
420
|
+
}
|
|
421
|
+
}
|