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,448 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Status API Routes
|
|
3
|
+
*
|
|
4
|
+
* REST API endpoints for agent status monitoring and real-time information
|
|
5
|
+
*
|
|
6
|
+
* @module web/api/routes/status
|
|
7
|
+
*/ import { Router } from "express";
|
|
8
|
+
import { asyncHandler } from "../middleware/error-handler.js";
|
|
9
|
+
import { validationMiddleware, commonSchemas } from "../middleware/validation.js";
|
|
10
|
+
/**
|
|
11
|
+
* Create status routes
|
|
12
|
+
*/ export function statusRoutes(transparencySystem, logger) {
|
|
13
|
+
const router = Router();
|
|
14
|
+
/**
|
|
15
|
+
* GET /api/v1/status
|
|
16
|
+
* Get all agent statuses
|
|
17
|
+
*/ router.get('/', validationMiddleware({
|
|
18
|
+
query: {
|
|
19
|
+
...commonSchemas.pagination,
|
|
20
|
+
...commonSchemas.stateFilter
|
|
21
|
+
}
|
|
22
|
+
}), asyncHandler(async (req, res)=>{
|
|
23
|
+
const { page = 1, limit = 20, sort = 'lastHeartbeat', order = 'desc', state } = req.query;
|
|
24
|
+
logger.info('Getting all agent statuses', {
|
|
25
|
+
page,
|
|
26
|
+
limit,
|
|
27
|
+
sort,
|
|
28
|
+
order,
|
|
29
|
+
state
|
|
30
|
+
});
|
|
31
|
+
let statuses = await transparencySystem.getAllAgentStatuses();
|
|
32
|
+
// Apply state filter
|
|
33
|
+
if (state) {
|
|
34
|
+
statuses = statuses.filter((status)=>status.state === state);
|
|
35
|
+
}
|
|
36
|
+
// Apply sorting
|
|
37
|
+
statuses = sortStatuses(statuses, sort, order);
|
|
38
|
+
// Apply pagination
|
|
39
|
+
const startIndex = (page - 1) * limit;
|
|
40
|
+
const endIndex = startIndex + limit;
|
|
41
|
+
const paginatedStatuses = statuses.slice(startIndex, endIndex);
|
|
42
|
+
res.json({
|
|
43
|
+
data: paginatedStatuses,
|
|
44
|
+
pagination: {
|
|
45
|
+
page,
|
|
46
|
+
limit,
|
|
47
|
+
total: statuses.length,
|
|
48
|
+
pages: Math.ceil(statuses.length / limit)
|
|
49
|
+
},
|
|
50
|
+
meta: {
|
|
51
|
+
sort,
|
|
52
|
+
order,
|
|
53
|
+
filters: {
|
|
54
|
+
state
|
|
55
|
+
},
|
|
56
|
+
timestamp: new Date().toISOString()
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}));
|
|
60
|
+
/**
|
|
61
|
+
* GET /api/v1/status/agent/:agentId
|
|
62
|
+
* Get specific agent status
|
|
63
|
+
*/ router.get('/agent/:agentId', validationMiddleware({
|
|
64
|
+
params: commonSchemas.agentIdParam
|
|
65
|
+
}), asyncHandler(async (req, res)=>{
|
|
66
|
+
const { agentId } = req.params;
|
|
67
|
+
logger.info(`Getting status for agent ${agentId}`);
|
|
68
|
+
try {
|
|
69
|
+
const status = await transparencySystem.getAgentStatus(agentId);
|
|
70
|
+
res.json({
|
|
71
|
+
data: status,
|
|
72
|
+
meta: {
|
|
73
|
+
timestamp: new Date().toISOString()
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
} catch (error) {
|
|
77
|
+
res.status(404).json({
|
|
78
|
+
error: 'NOT_FOUND',
|
|
79
|
+
message: `Agent ${agentId} not found`,
|
|
80
|
+
timestamp: new Date().toISOString()
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}));
|
|
84
|
+
/**
|
|
85
|
+
* GET /api/v1/status/active
|
|
86
|
+
* Get currently active agents
|
|
87
|
+
*/ router.get('/active', validationMiddleware({
|
|
88
|
+
query: commonSchemas.pagination
|
|
89
|
+
}), asyncHandler(async (req, res)=>{
|
|
90
|
+
const { page = 1, limit = 20 } = req.query;
|
|
91
|
+
logger.info('Getting active agents');
|
|
92
|
+
const activeAgents = await transparencySystem.getActiveAgents();
|
|
93
|
+
// Apply pagination
|
|
94
|
+
const startIndex = (page - 1) * limit;
|
|
95
|
+
const endIndex = startIndex + limit;
|
|
96
|
+
const paginatedAgents = activeAgents.slice(startIndex, endIndex);
|
|
97
|
+
res.json({
|
|
98
|
+
data: paginatedAgents,
|
|
99
|
+
pagination: {
|
|
100
|
+
page,
|
|
101
|
+
limit,
|
|
102
|
+
total: activeAgents.length,
|
|
103
|
+
pages: Math.ceil(activeAgents.length / limit)
|
|
104
|
+
},
|
|
105
|
+
meta: {
|
|
106
|
+
timestamp: new Date().toISOString()
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}));
|
|
110
|
+
/**
|
|
111
|
+
* GET /api/v1/status/paused
|
|
112
|
+
* Get currently paused agents
|
|
113
|
+
*/ router.get('/paused', validationMiddleware({
|
|
114
|
+
query: commonSchemas.pagination
|
|
115
|
+
}), asyncHandler(async (req, res)=>{
|
|
116
|
+
const { page = 1, limit = 20 } = req.query;
|
|
117
|
+
logger.info('Getting paused agents');
|
|
118
|
+
const pausedAgents = await transparencySystem.getPausedAgents();
|
|
119
|
+
// Apply pagination
|
|
120
|
+
const startIndex = (page - 1) * limit;
|
|
121
|
+
const endIndex = startIndex + limit;
|
|
122
|
+
const paginatedAgents = pausedAgents.slice(startIndex, endIndex);
|
|
123
|
+
res.json({
|
|
124
|
+
data: paginatedAgents,
|
|
125
|
+
pagination: {
|
|
126
|
+
page,
|
|
127
|
+
limit,
|
|
128
|
+
total: pausedAgents.length,
|
|
129
|
+
pages: Math.ceil(pausedAgents.length / limit)
|
|
130
|
+
},
|
|
131
|
+
meta: {
|
|
132
|
+
timestamp: new Date().toISOString()
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}));
|
|
136
|
+
/**
|
|
137
|
+
* GET /api/v1/status/summary
|
|
138
|
+
* Get status summary statistics
|
|
139
|
+
*/ router.get('/summary', asyncHandler(async (req, res)=>{
|
|
140
|
+
logger.info('Getting status summary');
|
|
141
|
+
const allStatuses = await transparencySystem.getAllAgentStatuses();
|
|
142
|
+
const summary = calculateStatusSummary(allStatuses);
|
|
143
|
+
res.json({
|
|
144
|
+
data: summary,
|
|
145
|
+
meta: {
|
|
146
|
+
timestamp: new Date().toISOString()
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}));
|
|
150
|
+
/**
|
|
151
|
+
* GET /api/v1/status/errors
|
|
152
|
+
* Get agents with recent errors
|
|
153
|
+
*/ router.get('/errors', validationMiddleware({
|
|
154
|
+
query: {
|
|
155
|
+
...commonSchemas.pagination,
|
|
156
|
+
severity: {
|
|
157
|
+
type: 'string',
|
|
158
|
+
enum: [
|
|
159
|
+
'warning',
|
|
160
|
+
'error',
|
|
161
|
+
'critical'
|
|
162
|
+
],
|
|
163
|
+
description: 'Error severity filter'
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}), asyncHandler(async (req, res)=>{
|
|
167
|
+
const { page = 1, limit = 20, severity } = req.query;
|
|
168
|
+
logger.info('Getting agents with errors', {
|
|
169
|
+
severity
|
|
170
|
+
});
|
|
171
|
+
const allStatuses = await transparencySystem.getAllAgentStatuses();
|
|
172
|
+
const agentsWithErrors = allStatuses.filter((status)=>{
|
|
173
|
+
if (!status.recentErrors || status.recentErrors.length === 0) {
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
if (severity) {
|
|
177
|
+
return status.recentErrors.some((error)=>error.severity === severity);
|
|
178
|
+
}
|
|
179
|
+
return true;
|
|
180
|
+
});
|
|
181
|
+
// Sort by most recent error
|
|
182
|
+
agentsWithErrors.sort((a, b)=>{
|
|
183
|
+
const aLatestError = a.recentErrors[0];
|
|
184
|
+
const bLatestError = b.recentErrors[0];
|
|
185
|
+
return bLatestError.timestamp.getTime() - aLatestError.timestamp.getTime();
|
|
186
|
+
});
|
|
187
|
+
// Apply pagination
|
|
188
|
+
const startIndex = (page - 1) * limit;
|
|
189
|
+
const endIndex = startIndex + limit;
|
|
190
|
+
const paginatedAgents = agentsWithErrors.slice(startIndex, endIndex);
|
|
191
|
+
res.json({
|
|
192
|
+
data: paginatedAgents,
|
|
193
|
+
pagination: {
|
|
194
|
+
page,
|
|
195
|
+
limit,
|
|
196
|
+
total: agentsWithErrors.length,
|
|
197
|
+
pages: Math.ceil(agentsWithErrors.length / limit)
|
|
198
|
+
},
|
|
199
|
+
meta: {
|
|
200
|
+
severity,
|
|
201
|
+
timestamp: new Date().toISOString()
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
}));
|
|
205
|
+
/**
|
|
206
|
+
* GET /api/v1/status/performance
|
|
207
|
+
* Get performance metrics for all agents
|
|
208
|
+
*/ router.get('/performance', validationMiddleware({
|
|
209
|
+
query: {
|
|
210
|
+
...commonSchemas.pagination,
|
|
211
|
+
sortBy: {
|
|
212
|
+
type: 'string',
|
|
213
|
+
enum: [
|
|
214
|
+
'tokenUsageRate',
|
|
215
|
+
'memoryUsage',
|
|
216
|
+
'cpuUsage',
|
|
217
|
+
'progress'
|
|
218
|
+
],
|
|
219
|
+
default: 'tokenUsageRate',
|
|
220
|
+
description: 'Performance metric to sort by'
|
|
221
|
+
},
|
|
222
|
+
threshold: {
|
|
223
|
+
type: 'number',
|
|
224
|
+
minimum: 0,
|
|
225
|
+
maximum: 100,
|
|
226
|
+
description: 'Performance threshold filter'
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}), asyncHandler(async (req, res)=>{
|
|
230
|
+
const { page = 1, limit = 20, sortBy = 'tokenUsageRate', threshold } = req.query;
|
|
231
|
+
logger.info('Getting agent performance metrics', {
|
|
232
|
+
sortBy,
|
|
233
|
+
threshold
|
|
234
|
+
});
|
|
235
|
+
const allStatuses = await transparencySystem.getAllAgentStatuses();
|
|
236
|
+
// Apply threshold filter if specified
|
|
237
|
+
let filteredStatuses = allStatuses;
|
|
238
|
+
if (threshold !== undefined) {
|
|
239
|
+
filteredStatuses = allStatuses.filter((status)=>{
|
|
240
|
+
switch(sortBy){
|
|
241
|
+
case 'tokenUsageRate':
|
|
242
|
+
return status.tokenUsageRate >= threshold;
|
|
243
|
+
case 'memoryUsage':
|
|
244
|
+
return status.memoryUsage / (1024 * 1024) >= threshold; // Convert to MB
|
|
245
|
+
case 'cpuUsage':
|
|
246
|
+
return status.cpuUsage >= threshold;
|
|
247
|
+
case 'progress':
|
|
248
|
+
return status.progress >= threshold;
|
|
249
|
+
default:
|
|
250
|
+
return true;
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
// Sort by performance metric
|
|
255
|
+
filteredStatuses.sort((a, b)=>{
|
|
256
|
+
const aValue = getPerformanceMetric(a, sortBy);
|
|
257
|
+
const bValue = getPerformanceMetric(b, sortBy);
|
|
258
|
+
return bValue - aValue; // Descending order
|
|
259
|
+
});
|
|
260
|
+
// Apply pagination
|
|
261
|
+
const startIndex = (page - 1) * limit;
|
|
262
|
+
const endIndex = startIndex + limit;
|
|
263
|
+
const paginatedAgents = filteredStatuses.slice(startIndex, endIndex);
|
|
264
|
+
res.json({
|
|
265
|
+
data: paginatedAgents,
|
|
266
|
+
pagination: {
|
|
267
|
+
page,
|
|
268
|
+
limit,
|
|
269
|
+
total: filteredStatuses.length,
|
|
270
|
+
pages: Math.ceil(filteredStatuses.length / limit)
|
|
271
|
+
},
|
|
272
|
+
meta: {
|
|
273
|
+
sortBy,
|
|
274
|
+
threshold,
|
|
275
|
+
timestamp: new Date().toISOString()
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
}));
|
|
279
|
+
/**
|
|
280
|
+
* GET /api/v1/status/heartbeat
|
|
281
|
+
* Get recent heartbeat information
|
|
282
|
+
*/ router.get('/heartbeat', validationMiddleware({
|
|
283
|
+
query: {
|
|
284
|
+
staleMinutes: {
|
|
285
|
+
type: 'integer',
|
|
286
|
+
minimum: 1,
|
|
287
|
+
maximum: 60,
|
|
288
|
+
default: 5,
|
|
289
|
+
description: 'Minutes since last heartbeat to consider stale'
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}), asyncHandler(async (req, res)=>{
|
|
293
|
+
const { staleMinutes = 5 } = req.query;
|
|
294
|
+
logger.info('Getting heartbeat information', {
|
|
295
|
+
staleMinutes
|
|
296
|
+
});
|
|
297
|
+
const allStatuses = await transparencySystem.getAllAgentStatuses();
|
|
298
|
+
const now = new Date();
|
|
299
|
+
const staleThreshold = staleMinutes * 60 * 1000; // Convert to milliseconds
|
|
300
|
+
const heartbeatInfo = allStatuses.map((status)=>{
|
|
301
|
+
const timeSinceLastHeartbeat = now.getTime() - status.lastHeartbeat.getTime();
|
|
302
|
+
const isStale = timeSinceLastHeartbeat > staleThreshold;
|
|
303
|
+
return {
|
|
304
|
+
agentId: status.agentId,
|
|
305
|
+
lastHeartbeat: status.lastHeartbeat,
|
|
306
|
+
timeSinceLastHeartbeatMs: timeSinceLastHeartbeat,
|
|
307
|
+
isStale,
|
|
308
|
+
status: isStale ? 'stale' : 'healthy'
|
|
309
|
+
};
|
|
310
|
+
});
|
|
311
|
+
// Sort by most recent heartbeat
|
|
312
|
+
heartbeatInfo.sort((a, b)=>a.timeSinceLastHeartbeatMs - b.timeSinceLastHeartbeatMs);
|
|
313
|
+
res.json({
|
|
314
|
+
data: heartbeatInfo,
|
|
315
|
+
meta: {
|
|
316
|
+
staleThresholdMinutes: staleMinutes,
|
|
317
|
+
totalAgents: allStatuses.length,
|
|
318
|
+
staleAgents: heartbeatInfo.filter((info)=>info.isStale).length,
|
|
319
|
+
timestamp: new Date().toISOString()
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
}));
|
|
323
|
+
return router;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Sort agent statuses by specified field
|
|
327
|
+
*/ function sortStatuses(statuses, sortBy, order) {
|
|
328
|
+
const sorted = [
|
|
329
|
+
...statuses
|
|
330
|
+
].sort((a, b)=>{
|
|
331
|
+
let aValue, bValue;
|
|
332
|
+
switch(sortBy){
|
|
333
|
+
case 'agentId':
|
|
334
|
+
aValue = a.agentId;
|
|
335
|
+
bValue = b.agentId;
|
|
336
|
+
break;
|
|
337
|
+
case 'state':
|
|
338
|
+
aValue = a.state;
|
|
339
|
+
bValue = b.state;
|
|
340
|
+
break;
|
|
341
|
+
case 'activity':
|
|
342
|
+
aValue = a.activity;
|
|
343
|
+
bValue = b.activity;
|
|
344
|
+
break;
|
|
345
|
+
case 'progress':
|
|
346
|
+
aValue = a.progress;
|
|
347
|
+
bValue = b.progress;
|
|
348
|
+
break;
|
|
349
|
+
case 'tokensUsed':
|
|
350
|
+
aValue = a.tokensUsed;
|
|
351
|
+
bValue = b.tokensUsed;
|
|
352
|
+
break;
|
|
353
|
+
case 'tokenUsageRate':
|
|
354
|
+
aValue = a.tokenUsageRate;
|
|
355
|
+
bValue = b.tokenUsageRate;
|
|
356
|
+
break;
|
|
357
|
+
case 'memoryUsage':
|
|
358
|
+
aValue = a.memoryUsage;
|
|
359
|
+
bValue = b.memoryUsage;
|
|
360
|
+
break;
|
|
361
|
+
case 'cpuUsage':
|
|
362
|
+
aValue = a.cpuUsage;
|
|
363
|
+
bValue = b.cpuUsage;
|
|
364
|
+
break;
|
|
365
|
+
case 'lastHeartbeat':
|
|
366
|
+
aValue = a.lastHeartbeat.getTime();
|
|
367
|
+
bValue = b.lastHeartbeat.getTime();
|
|
368
|
+
break;
|
|
369
|
+
default:
|
|
370
|
+
aValue = a.agentId;
|
|
371
|
+
bValue = b.agentId;
|
|
372
|
+
}
|
|
373
|
+
if (typeof aValue === 'string') {
|
|
374
|
+
return order === 'asc' ? aValue.localeCompare(bValue) : bValue.localeCompare(aValue);
|
|
375
|
+
}
|
|
376
|
+
return order === 'asc' ? aValue - bValue : bValue - aValue;
|
|
377
|
+
});
|
|
378
|
+
return sorted;
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Calculate status summary statistics
|
|
382
|
+
*/ function calculateStatusSummary(statuses) {
|
|
383
|
+
const summary = {
|
|
384
|
+
totalAgents: statuses.length,
|
|
385
|
+
agentsByState: {},
|
|
386
|
+
agentsByActivity: {},
|
|
387
|
+
totalTokensUsed: 0,
|
|
388
|
+
averageTokenUsageRate: 0,
|
|
389
|
+
totalMemoryUsage: 0,
|
|
390
|
+
averageCpuUsage: 0,
|
|
391
|
+
averageProgress: 0,
|
|
392
|
+
activeAgents: 0,
|
|
393
|
+
pausedAgents: 0,
|
|
394
|
+
agentsWithErrors: 0,
|
|
395
|
+
totalErrors: 0
|
|
396
|
+
};
|
|
397
|
+
let totalTokenUsageRate = 0;
|
|
398
|
+
let totalCpuUsage = 0;
|
|
399
|
+
let totalProgress = 0;
|
|
400
|
+
statuses.forEach((status)=>{
|
|
401
|
+
// Count by state
|
|
402
|
+
summary.agentsByState[status.state] = (summary.agentsByState[status.state] || 0) + 1;
|
|
403
|
+
// Count by activity
|
|
404
|
+
summary.agentsByActivity[status.activity] = (summary.agentsByActivity[status.activity] || 0) + 1;
|
|
405
|
+
// Token metrics
|
|
406
|
+
summary.totalTokensUsed += status.tokensUsed;
|
|
407
|
+
totalTokenUsageRate += status.tokenUsageRate;
|
|
408
|
+
// Performance metrics
|
|
409
|
+
summary.totalMemoryUsage += status.memoryUsage;
|
|
410
|
+
totalCpuUsage += status.cpuUsage;
|
|
411
|
+
totalProgress += status.progress;
|
|
412
|
+
// Agent status counts
|
|
413
|
+
if (!status.isPaused && status.state !== 'terminated') {
|
|
414
|
+
summary.activeAgents++;
|
|
415
|
+
}
|
|
416
|
+
if (status.isPaused) {
|
|
417
|
+
summary.pausedAgents++;
|
|
418
|
+
}
|
|
419
|
+
// Error metrics
|
|
420
|
+
if (status.recentErrors && status.recentErrors.length > 0) {
|
|
421
|
+
summary.agentsWithErrors++;
|
|
422
|
+
summary.totalErrors += status.recentErrors.length;
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
// Calculate averages
|
|
426
|
+
summary.averageTokenUsageRate = statuses.length > 0 ? totalTokenUsageRate / statuses.length : 0;
|
|
427
|
+
summary.averageCpuUsage = statuses.length > 0 ? totalCpuUsage / statuses.length : 0;
|
|
428
|
+
summary.averageProgress = statuses.length > 0 ? totalProgress / statuses.length : 0;
|
|
429
|
+
return summary;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Get specific performance metric from agent status
|
|
433
|
+
*/ function getPerformanceMetric(status, metric) {
|
|
434
|
+
switch(metric){
|
|
435
|
+
case 'tokenUsageRate':
|
|
436
|
+
return status.tokenUsageRate;
|
|
437
|
+
case 'memoryUsage':
|
|
438
|
+
return status.memoryUsage;
|
|
439
|
+
case 'cpuUsage':
|
|
440
|
+
return status.cpuUsage;
|
|
441
|
+
case 'progress':
|
|
442
|
+
return status.progress;
|
|
443
|
+
case 'tokensUsed':
|
|
444
|
+
return status.tokensUsed;
|
|
445
|
+
default:
|
|
446
|
+
return 0;
|
|
447
|
+
}
|
|
448
|
+
}
|