empathy-framework 5.2.1__py3-none-any.whl → 5.4.0__py3-none-any.whl
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.
- empathy_framework-5.4.0.dist-info/METADATA +47 -0
- empathy_framework-5.4.0.dist-info/RECORD +8 -0
- {empathy_framework-5.2.1.dist-info → empathy_framework-5.4.0.dist-info}/top_level.txt +0 -1
- empathy_healthcare_plugin/__init__.py +12 -11
- empathy_llm_toolkit/__init__.py +12 -26
- empathy_os/__init__.py +12 -356
- empathy_software_plugin/__init__.py +12 -11
- empathy_framework-5.2.1.dist-info/METADATA +0 -1002
- empathy_framework-5.2.1.dist-info/RECORD +0 -478
- empathy_framework-5.2.1.dist-info/entry_points.txt +0 -26
- empathy_framework-5.2.1.dist-info/licenses/LICENSE +0 -201
- empathy_framework-5.2.1.dist-info/licenses/LICENSE_CHANGE_ANNOUNCEMENT.md +0 -101
- empathy_healthcare_plugin/monitors/__init__.py +0 -9
- empathy_healthcare_plugin/monitors/clinical_protocol_monitor.py +0 -315
- empathy_healthcare_plugin/monitors/monitoring/__init__.py +0 -44
- empathy_healthcare_plugin/monitors/monitoring/protocol_checker.py +0 -300
- empathy_healthcare_plugin/monitors/monitoring/protocol_loader.py +0 -214
- empathy_healthcare_plugin/monitors/monitoring/sensor_parsers.py +0 -306
- empathy_healthcare_plugin/monitors/monitoring/trajectory_analyzer.py +0 -389
- empathy_healthcare_plugin/protocols/cardiac.json +0 -93
- empathy_healthcare_plugin/protocols/post_operative.json +0 -92
- empathy_healthcare_plugin/protocols/respiratory.json +0 -92
- empathy_healthcare_plugin/protocols/sepsis.json +0 -141
- empathy_llm_toolkit/README.md +0 -553
- empathy_llm_toolkit/agent_factory/__init__.py +0 -53
- empathy_llm_toolkit/agent_factory/adapters/__init__.py +0 -85
- empathy_llm_toolkit/agent_factory/adapters/autogen_adapter.py +0 -312
- empathy_llm_toolkit/agent_factory/adapters/crewai_adapter.py +0 -483
- empathy_llm_toolkit/agent_factory/adapters/haystack_adapter.py +0 -298
- empathy_llm_toolkit/agent_factory/adapters/langchain_adapter.py +0 -362
- empathy_llm_toolkit/agent_factory/adapters/langgraph_adapter.py +0 -333
- empathy_llm_toolkit/agent_factory/adapters/native.py +0 -228
- empathy_llm_toolkit/agent_factory/adapters/wizard_adapter.py +0 -423
- empathy_llm_toolkit/agent_factory/base.py +0 -305
- empathy_llm_toolkit/agent_factory/crews/__init__.py +0 -67
- empathy_llm_toolkit/agent_factory/crews/code_review.py +0 -1113
- empathy_llm_toolkit/agent_factory/crews/health_check.py +0 -1262
- empathy_llm_toolkit/agent_factory/crews/refactoring.py +0 -1128
- empathy_llm_toolkit/agent_factory/crews/security_audit.py +0 -1018
- empathy_llm_toolkit/agent_factory/decorators.py +0 -287
- empathy_llm_toolkit/agent_factory/factory.py +0 -558
- empathy_llm_toolkit/agent_factory/framework.py +0 -193
- empathy_llm_toolkit/agent_factory/memory_integration.py +0 -328
- empathy_llm_toolkit/agent_factory/resilient.py +0 -320
- empathy_llm_toolkit/agents_md/__init__.py +0 -22
- empathy_llm_toolkit/agents_md/loader.py +0 -218
- empathy_llm_toolkit/agents_md/parser.py +0 -271
- empathy_llm_toolkit/agents_md/registry.py +0 -307
- empathy_llm_toolkit/claude_memory.py +0 -466
- empathy_llm_toolkit/cli/__init__.py +0 -8
- empathy_llm_toolkit/cli/sync_claude.py +0 -487
- empathy_llm_toolkit/code_health.py +0 -1313
- empathy_llm_toolkit/commands/__init__.py +0 -51
- empathy_llm_toolkit/commands/context.py +0 -375
- empathy_llm_toolkit/commands/loader.py +0 -301
- empathy_llm_toolkit/commands/models.py +0 -231
- empathy_llm_toolkit/commands/parser.py +0 -371
- empathy_llm_toolkit/commands/registry.py +0 -429
- empathy_llm_toolkit/config/__init__.py +0 -29
- empathy_llm_toolkit/config/unified.py +0 -291
- empathy_llm_toolkit/context/__init__.py +0 -22
- empathy_llm_toolkit/context/compaction.py +0 -455
- empathy_llm_toolkit/context/manager.py +0 -434
- empathy_llm_toolkit/contextual_patterns.py +0 -361
- empathy_llm_toolkit/core.py +0 -907
- empathy_llm_toolkit/git_pattern_extractor.py +0 -435
- empathy_llm_toolkit/hooks/__init__.py +0 -24
- empathy_llm_toolkit/hooks/config.py +0 -306
- empathy_llm_toolkit/hooks/executor.py +0 -289
- empathy_llm_toolkit/hooks/registry.py +0 -302
- empathy_llm_toolkit/hooks/scripts/__init__.py +0 -39
- empathy_llm_toolkit/hooks/scripts/evaluate_session.py +0 -201
- empathy_llm_toolkit/hooks/scripts/first_time_init.py +0 -285
- empathy_llm_toolkit/hooks/scripts/pre_compact.py +0 -207
- empathy_llm_toolkit/hooks/scripts/session_end.py +0 -183
- empathy_llm_toolkit/hooks/scripts/session_start.py +0 -163
- empathy_llm_toolkit/hooks/scripts/suggest_compact.py +0 -225
- empathy_llm_toolkit/learning/__init__.py +0 -30
- empathy_llm_toolkit/learning/evaluator.py +0 -438
- empathy_llm_toolkit/learning/extractor.py +0 -514
- empathy_llm_toolkit/learning/storage.py +0 -560
- empathy_llm_toolkit/levels.py +0 -227
- empathy_llm_toolkit/pattern_confidence.py +0 -414
- empathy_llm_toolkit/pattern_resolver.py +0 -272
- empathy_llm_toolkit/pattern_summary.py +0 -350
- empathy_llm_toolkit/providers.py +0 -967
- empathy_llm_toolkit/routing/__init__.py +0 -32
- empathy_llm_toolkit/routing/model_router.py +0 -362
- empathy_llm_toolkit/security/IMPLEMENTATION_SUMMARY.md +0 -413
- empathy_llm_toolkit/security/PHASE2_COMPLETE.md +0 -384
- empathy_llm_toolkit/security/PHASE2_SECRETS_DETECTOR_COMPLETE.md +0 -271
- empathy_llm_toolkit/security/QUICK_REFERENCE.md +0 -316
- empathy_llm_toolkit/security/README.md +0 -262
- empathy_llm_toolkit/security/__init__.py +0 -62
- empathy_llm_toolkit/security/audit_logger.py +0 -929
- empathy_llm_toolkit/security/audit_logger_example.py +0 -152
- empathy_llm_toolkit/security/pii_scrubber.py +0 -640
- empathy_llm_toolkit/security/secrets_detector.py +0 -678
- empathy_llm_toolkit/security/secrets_detector_example.py +0 -304
- empathy_llm_toolkit/security/secure_memdocs.py +0 -1192
- empathy_llm_toolkit/security/secure_memdocs_example.py +0 -278
- empathy_llm_toolkit/session_status.py +0 -745
- empathy_llm_toolkit/state.py +0 -246
- empathy_llm_toolkit/utils/__init__.py +0 -5
- empathy_llm_toolkit/utils/tokens.py +0 -349
- empathy_os/adaptive/__init__.py +0 -13
- empathy_os/adaptive/task_complexity.py +0 -127
- empathy_os/agent_monitoring.py +0 -414
- empathy_os/cache/__init__.py +0 -117
- empathy_os/cache/base.py +0 -166
- empathy_os/cache/dependency_manager.py +0 -256
- empathy_os/cache/hash_only.py +0 -251
- empathy_os/cache/hybrid.py +0 -453
- empathy_os/cache/storage.py +0 -285
- empathy_os/cache_monitor.py +0 -356
- empathy_os/cache_stats.py +0 -298
- empathy_os/cli/__init__.py +0 -152
- empathy_os/cli/__main__.py +0 -12
- empathy_os/cli/commands/__init__.py +0 -1
- empathy_os/cli/commands/batch.py +0 -256
- empathy_os/cli/commands/cache.py +0 -248
- empathy_os/cli/commands/help.py +0 -331
- empathy_os/cli/commands/info.py +0 -140
- empathy_os/cli/commands/inspect.py +0 -436
- empathy_os/cli/commands/inspection.py +0 -57
- empathy_os/cli/commands/memory.py +0 -48
- empathy_os/cli/commands/metrics.py +0 -92
- empathy_os/cli/commands/orchestrate.py +0 -184
- empathy_os/cli/commands/patterns.py +0 -207
- empathy_os/cli/commands/profiling.py +0 -198
- empathy_os/cli/commands/provider.py +0 -98
- empathy_os/cli/commands/routing.py +0 -285
- empathy_os/cli/commands/setup.py +0 -96
- empathy_os/cli/commands/status.py +0 -235
- empathy_os/cli/commands/sync.py +0 -166
- empathy_os/cli/commands/tier.py +0 -121
- empathy_os/cli/commands/utilities.py +0 -114
- empathy_os/cli/commands/workflow.py +0 -575
- empathy_os/cli/core.py +0 -32
- empathy_os/cli/parsers/__init__.py +0 -68
- empathy_os/cli/parsers/batch.py +0 -118
- empathy_os/cli/parsers/cache 2.py +0 -65
- empathy_os/cli/parsers/cache.py +0 -65
- empathy_os/cli/parsers/help.py +0 -41
- empathy_os/cli/parsers/info.py +0 -26
- empathy_os/cli/parsers/inspect.py +0 -66
- empathy_os/cli/parsers/metrics.py +0 -42
- empathy_os/cli/parsers/orchestrate.py +0 -61
- empathy_os/cli/parsers/patterns.py +0 -54
- empathy_os/cli/parsers/provider.py +0 -40
- empathy_os/cli/parsers/routing.py +0 -110
- empathy_os/cli/parsers/setup.py +0 -42
- empathy_os/cli/parsers/status.py +0 -47
- empathy_os/cli/parsers/sync.py +0 -31
- empathy_os/cli/parsers/tier.py +0 -33
- empathy_os/cli/parsers/workflow.py +0 -77
- empathy_os/cli/utils/__init__.py +0 -1
- empathy_os/cli/utils/data.py +0 -242
- empathy_os/cli/utils/helpers.py +0 -68
- empathy_os/cli_legacy.py +0 -3957
- empathy_os/cli_minimal.py +0 -1159
- empathy_os/cli_router 2.py +0 -416
- empathy_os/cli_router.py +0 -437
- empathy_os/cli_unified.py +0 -814
- empathy_os/config/__init__.py +0 -66
- empathy_os/config/xml_config.py +0 -286
- empathy_os/config.py +0 -532
- empathy_os/coordination.py +0 -870
- empathy_os/core.py +0 -1511
- empathy_os/core_modules/__init__.py +0 -15
- empathy_os/cost_tracker.py +0 -626
- empathy_os/dashboard/__init__.py +0 -41
- empathy_os/dashboard/app 2.py +0 -512
- empathy_os/dashboard/app.py +0 -512
- empathy_os/dashboard/simple_server 2.py +0 -403
- empathy_os/dashboard/simple_server.py +0 -403
- empathy_os/dashboard/standalone_server 2.py +0 -536
- empathy_os/dashboard/standalone_server.py +0 -547
- empathy_os/discovery.py +0 -306
- empathy_os/emergence.py +0 -306
- empathy_os/exceptions.py +0 -123
- empathy_os/feedback_loops.py +0 -373
- empathy_os/hot_reload/README.md +0 -473
- empathy_os/hot_reload/__init__.py +0 -62
- empathy_os/hot_reload/config.py +0 -83
- empathy_os/hot_reload/integration.py +0 -229
- empathy_os/hot_reload/reloader.py +0 -298
- empathy_os/hot_reload/watcher.py +0 -183
- empathy_os/hot_reload/websocket.py +0 -177
- empathy_os/levels.py +0 -577
- empathy_os/leverage_points.py +0 -441
- empathy_os/logging_config.py +0 -261
- empathy_os/mcp/__init__.py +0 -10
- empathy_os/mcp/server.py +0 -506
- empathy_os/memory/__init__.py +0 -237
- empathy_os/memory/claude_memory.py +0 -469
- empathy_os/memory/config.py +0 -224
- empathy_os/memory/control_panel.py +0 -1290
- empathy_os/memory/control_panel_support.py +0 -145
- empathy_os/memory/cross_session.py +0 -845
- empathy_os/memory/edges.py +0 -179
- empathy_os/memory/encryption.py +0 -159
- empathy_os/memory/file_session.py +0 -770
- empathy_os/memory/graph.py +0 -570
- empathy_os/memory/long_term.py +0 -913
- empathy_os/memory/long_term_types.py +0 -99
- empathy_os/memory/mixins/__init__.py +0 -25
- empathy_os/memory/mixins/backend_init_mixin.py +0 -244
- empathy_os/memory/mixins/capabilities_mixin.py +0 -199
- empathy_os/memory/mixins/handoff_mixin.py +0 -208
- empathy_os/memory/mixins/lifecycle_mixin.py +0 -49
- empathy_os/memory/mixins/long_term_mixin.py +0 -352
- empathy_os/memory/mixins/promotion_mixin.py +0 -109
- empathy_os/memory/mixins/short_term_mixin.py +0 -182
- empathy_os/memory/nodes.py +0 -179
- empathy_os/memory/redis_bootstrap.py +0 -540
- empathy_os/memory/security/__init__.py +0 -31
- empathy_os/memory/security/audit_logger.py +0 -932
- empathy_os/memory/security/pii_scrubber.py +0 -640
- empathy_os/memory/security/secrets_detector.py +0 -678
- empathy_os/memory/short_term.py +0 -2150
- empathy_os/memory/simple_storage.py +0 -302
- empathy_os/memory/storage/__init__.py +0 -15
- empathy_os/memory/storage_backend.py +0 -167
- empathy_os/memory/summary_index.py +0 -583
- empathy_os/memory/types.py +0 -441
- empathy_os/memory/unified.py +0 -182
- empathy_os/meta_workflows/__init__.py +0 -74
- empathy_os/meta_workflows/agent_creator.py +0 -248
- empathy_os/meta_workflows/builtin_templates.py +0 -567
- empathy_os/meta_workflows/cli_commands/__init__.py +0 -56
- empathy_os/meta_workflows/cli_commands/agent_commands.py +0 -321
- empathy_os/meta_workflows/cli_commands/analytics_commands.py +0 -442
- empathy_os/meta_workflows/cli_commands/config_commands.py +0 -232
- empathy_os/meta_workflows/cli_commands/memory_commands.py +0 -182
- empathy_os/meta_workflows/cli_commands/template_commands.py +0 -354
- empathy_os/meta_workflows/cli_commands/workflow_commands.py +0 -382
- empathy_os/meta_workflows/cli_meta_workflows.py +0 -59
- empathy_os/meta_workflows/form_engine.py +0 -292
- empathy_os/meta_workflows/intent_detector.py +0 -409
- empathy_os/meta_workflows/models.py +0 -569
- empathy_os/meta_workflows/pattern_learner.py +0 -738
- empathy_os/meta_workflows/plan_generator.py +0 -384
- empathy_os/meta_workflows/session_context.py +0 -397
- empathy_os/meta_workflows/template_registry.py +0 -229
- empathy_os/meta_workflows/workflow.py +0 -984
- empathy_os/metrics/__init__.py +0 -12
- empathy_os/metrics/collector.py +0 -31
- empathy_os/metrics/prompt_metrics.py +0 -194
- empathy_os/models/__init__.py +0 -172
- empathy_os/models/__main__.py +0 -13
- empathy_os/models/adaptive_routing 2.py +0 -437
- empathy_os/models/adaptive_routing.py +0 -437
- empathy_os/models/auth_cli.py +0 -444
- empathy_os/models/auth_strategy.py +0 -450
- empathy_os/models/cli.py +0 -655
- empathy_os/models/empathy_executor.py +0 -354
- empathy_os/models/executor.py +0 -257
- empathy_os/models/fallback.py +0 -762
- empathy_os/models/provider_config.py +0 -282
- empathy_os/models/registry.py +0 -472
- empathy_os/models/tasks.py +0 -359
- empathy_os/models/telemetry/__init__.py +0 -71
- empathy_os/models/telemetry/analytics.py +0 -594
- empathy_os/models/telemetry/backend.py +0 -196
- empathy_os/models/telemetry/data_models.py +0 -431
- empathy_os/models/telemetry/storage.py +0 -489
- empathy_os/models/token_estimator.py +0 -420
- empathy_os/models/validation.py +0 -280
- empathy_os/monitoring/__init__.py +0 -52
- empathy_os/monitoring/alerts.py +0 -946
- empathy_os/monitoring/alerts_cli.py +0 -448
- empathy_os/monitoring/multi_backend.py +0 -271
- empathy_os/monitoring/otel_backend.py +0 -362
- empathy_os/optimization/__init__.py +0 -19
- empathy_os/optimization/context_optimizer.py +0 -272
- empathy_os/orchestration/__init__.py +0 -67
- empathy_os/orchestration/agent_templates.py +0 -707
- empathy_os/orchestration/config_store.py +0 -499
- empathy_os/orchestration/execution_strategies.py +0 -2111
- empathy_os/orchestration/meta_orchestrator.py +0 -1168
- empathy_os/orchestration/pattern_learner.py +0 -696
- empathy_os/orchestration/real_tools.py +0 -931
- empathy_os/pattern_cache.py +0 -187
- empathy_os/pattern_library.py +0 -542
- empathy_os/patterns/debugging/all_patterns.json +0 -81
- empathy_os/patterns/debugging/workflow_20260107_1770825e.json +0 -77
- empathy_os/patterns/refactoring_memory.json +0 -89
- empathy_os/persistence.py +0 -564
- empathy_os/platform_utils.py +0 -265
- empathy_os/plugins/__init__.py +0 -28
- empathy_os/plugins/base.py +0 -361
- empathy_os/plugins/registry.py +0 -268
- empathy_os/project_index/__init__.py +0 -32
- empathy_os/project_index/cli.py +0 -335
- empathy_os/project_index/index.py +0 -667
- empathy_os/project_index/models.py +0 -504
- empathy_os/project_index/reports.py +0 -474
- empathy_os/project_index/scanner.py +0 -777
- empathy_os/project_index/scanner_parallel 2.py +0 -291
- empathy_os/project_index/scanner_parallel.py +0 -291
- empathy_os/prompts/__init__.py +0 -61
- empathy_os/prompts/config.py +0 -77
- empathy_os/prompts/context.py +0 -177
- empathy_os/prompts/parser.py +0 -285
- empathy_os/prompts/registry.py +0 -313
- empathy_os/prompts/templates.py +0 -208
- empathy_os/redis_config.py +0 -302
- empathy_os/redis_memory.py +0 -799
- empathy_os/resilience/__init__.py +0 -56
- empathy_os/resilience/circuit_breaker.py +0 -256
- empathy_os/resilience/fallback.py +0 -179
- empathy_os/resilience/health.py +0 -300
- empathy_os/resilience/retry.py +0 -209
- empathy_os/resilience/timeout.py +0 -135
- empathy_os/routing/__init__.py +0 -43
- empathy_os/routing/chain_executor.py +0 -433
- empathy_os/routing/classifier.py +0 -217
- empathy_os/routing/smart_router.py +0 -234
- empathy_os/routing/workflow_registry.py +0 -343
- empathy_os/scaffolding/README.md +0 -589
- empathy_os/scaffolding/__init__.py +0 -35
- empathy_os/scaffolding/__main__.py +0 -14
- empathy_os/scaffolding/cli.py +0 -240
- empathy_os/socratic/__init__.py +0 -256
- empathy_os/socratic/ab_testing.py +0 -958
- empathy_os/socratic/blueprint.py +0 -533
- empathy_os/socratic/cli.py +0 -703
- empathy_os/socratic/collaboration.py +0 -1114
- empathy_os/socratic/domain_templates.py +0 -924
- empathy_os/socratic/embeddings.py +0 -738
- empathy_os/socratic/engine.py +0 -794
- empathy_os/socratic/explainer.py +0 -682
- empathy_os/socratic/feedback.py +0 -772
- empathy_os/socratic/forms.py +0 -629
- empathy_os/socratic/generator.py +0 -732
- empathy_os/socratic/llm_analyzer.py +0 -637
- empathy_os/socratic/mcp_server.py +0 -702
- empathy_os/socratic/session.py +0 -312
- empathy_os/socratic/storage.py +0 -667
- empathy_os/socratic/success.py +0 -730
- empathy_os/socratic/visual_editor.py +0 -860
- empathy_os/socratic/web_ui.py +0 -958
- empathy_os/telemetry/__init__.py +0 -39
- empathy_os/telemetry/agent_coordination 2.py +0 -478
- empathy_os/telemetry/agent_coordination.py +0 -476
- empathy_os/telemetry/agent_tracking 2.py +0 -350
- empathy_os/telemetry/agent_tracking.py +0 -348
- empathy_os/telemetry/approval_gates 2.py +0 -563
- empathy_os/telemetry/approval_gates.py +0 -551
- empathy_os/telemetry/cli.py +0 -1231
- empathy_os/telemetry/commands/__init__.py +0 -14
- empathy_os/telemetry/commands/dashboard_commands.py +0 -696
- empathy_os/telemetry/event_streaming 2.py +0 -405
- empathy_os/telemetry/event_streaming.py +0 -405
- empathy_os/telemetry/feedback_loop 2.py +0 -557
- empathy_os/telemetry/feedback_loop.py +0 -554
- empathy_os/telemetry/usage_tracker.py +0 -591
- empathy_os/templates.py +0 -754
- empathy_os/test_generator/__init__.py +0 -38
- empathy_os/test_generator/__main__.py +0 -14
- empathy_os/test_generator/cli.py +0 -234
- empathy_os/test_generator/generator.py +0 -355
- empathy_os/test_generator/risk_analyzer.py +0 -216
- empathy_os/tier_recommender.py +0 -384
- empathy_os/tools.py +0 -183
- empathy_os/trust/__init__.py +0 -28
- empathy_os/trust/circuit_breaker.py +0 -579
- empathy_os/trust_building.py +0 -527
- empathy_os/validation/__init__.py +0 -19
- empathy_os/validation/xml_validator.py +0 -281
- empathy_os/vscode_bridge 2.py +0 -173
- empathy_os/vscode_bridge.py +0 -173
- empathy_os/workflow_commands.py +0 -780
- empathy_os/workflow_patterns/__init__.py +0 -33
- empathy_os/workflow_patterns/behavior.py +0 -249
- empathy_os/workflow_patterns/core.py +0 -76
- empathy_os/workflow_patterns/output.py +0 -99
- empathy_os/workflow_patterns/registry.py +0 -255
- empathy_os/workflow_patterns/structural.py +0 -288
- empathy_os/workflows/__init__.py +0 -539
- empathy_os/workflows/autonomous_test_gen.py +0 -1268
- empathy_os/workflows/base.py +0 -2667
- empathy_os/workflows/batch_processing.py +0 -342
- empathy_os/workflows/bug_predict.py +0 -1084
- empathy_os/workflows/builder.py +0 -273
- empathy_os/workflows/caching.py +0 -253
- empathy_os/workflows/code_review.py +0 -1048
- empathy_os/workflows/code_review_adapters.py +0 -312
- empathy_os/workflows/code_review_pipeline.py +0 -722
- empathy_os/workflows/config.py +0 -645
- empathy_os/workflows/dependency_check.py +0 -644
- empathy_os/workflows/document_gen/__init__.py +0 -25
- empathy_os/workflows/document_gen/config.py +0 -30
- empathy_os/workflows/document_gen/report_formatter.py +0 -162
- empathy_os/workflows/document_gen/workflow.py +0 -1426
- empathy_os/workflows/document_gen.py +0 -29
- empathy_os/workflows/document_manager.py +0 -216
- empathy_os/workflows/document_manager_README.md +0 -134
- empathy_os/workflows/documentation_orchestrator.py +0 -1205
- empathy_os/workflows/history.py +0 -510
- empathy_os/workflows/keyboard_shortcuts/__init__.py +0 -39
- empathy_os/workflows/keyboard_shortcuts/generators.py +0 -391
- empathy_os/workflows/keyboard_shortcuts/parsers.py +0 -416
- empathy_os/workflows/keyboard_shortcuts/prompts.py +0 -295
- empathy_os/workflows/keyboard_shortcuts/schema.py +0 -193
- empathy_os/workflows/keyboard_shortcuts/workflow.py +0 -509
- empathy_os/workflows/llm_base.py +0 -363
- empathy_os/workflows/manage_docs.py +0 -87
- empathy_os/workflows/manage_docs_README.md +0 -134
- empathy_os/workflows/manage_documentation.py +0 -821
- empathy_os/workflows/new_sample_workflow1.py +0 -149
- empathy_os/workflows/new_sample_workflow1_README.md +0 -150
- empathy_os/workflows/orchestrated_health_check.py +0 -849
- empathy_os/workflows/orchestrated_release_prep.py +0 -600
- empathy_os/workflows/output.py +0 -410
- empathy_os/workflows/perf_audit.py +0 -863
- empathy_os/workflows/pr_review.py +0 -762
- empathy_os/workflows/progress.py +0 -779
- empathy_os/workflows/progress_server.py +0 -322
- empathy_os/workflows/progressive/README 2.md +0 -454
- empathy_os/workflows/progressive/README.md +0 -454
- empathy_os/workflows/progressive/__init__ 2.py +0 -92
- empathy_os/workflows/progressive/__init__.py +0 -82
- empathy_os/workflows/progressive/cli 2.py +0 -242
- empathy_os/workflows/progressive/cli.py +0 -219
- empathy_os/workflows/progressive/core 2.py +0 -488
- empathy_os/workflows/progressive/core.py +0 -488
- empathy_os/workflows/progressive/orchestrator 2.py +0 -701
- empathy_os/workflows/progressive/orchestrator.py +0 -723
- empathy_os/workflows/progressive/reports 2.py +0 -528
- empathy_os/workflows/progressive/reports.py +0 -520
- empathy_os/workflows/progressive/telemetry 2.py +0 -280
- empathy_os/workflows/progressive/telemetry.py +0 -274
- empathy_os/workflows/progressive/test_gen 2.py +0 -514
- empathy_os/workflows/progressive/test_gen.py +0 -495
- empathy_os/workflows/progressive/workflow 2.py +0 -628
- empathy_os/workflows/progressive/workflow.py +0 -589
- empathy_os/workflows/refactor_plan.py +0 -694
- empathy_os/workflows/release_prep.py +0 -895
- empathy_os/workflows/release_prep_crew.py +0 -969
- empathy_os/workflows/research_synthesis.py +0 -404
- empathy_os/workflows/routing.py +0 -168
- empathy_os/workflows/secure_release.py +0 -593
- empathy_os/workflows/security_adapters.py +0 -297
- empathy_os/workflows/security_audit.py +0 -1329
- empathy_os/workflows/security_audit_phase3.py +0 -355
- empathy_os/workflows/seo_optimization.py +0 -633
- empathy_os/workflows/step_config.py +0 -234
- empathy_os/workflows/telemetry_mixin.py +0 -269
- empathy_os/workflows/test5.py +0 -125
- empathy_os/workflows/test5_README.md +0 -158
- empathy_os/workflows/test_coverage_boost_crew.py +0 -849
- empathy_os/workflows/test_gen/__init__.py +0 -52
- empathy_os/workflows/test_gen/ast_analyzer.py +0 -249
- empathy_os/workflows/test_gen/config.py +0 -88
- empathy_os/workflows/test_gen/data_models.py +0 -38
- empathy_os/workflows/test_gen/report_formatter.py +0 -289
- empathy_os/workflows/test_gen/test_templates.py +0 -381
- empathy_os/workflows/test_gen/workflow.py +0 -655
- empathy_os/workflows/test_gen.py +0 -54
- empathy_os/workflows/test_gen_behavioral.py +0 -477
- empathy_os/workflows/test_gen_parallel.py +0 -341
- empathy_os/workflows/test_lifecycle.py +0 -526
- empathy_os/workflows/test_maintenance.py +0 -627
- empathy_os/workflows/test_maintenance_cli.py +0 -590
- empathy_os/workflows/test_maintenance_crew.py +0 -840
- empathy_os/workflows/test_runner.py +0 -622
- empathy_os/workflows/tier_tracking.py +0 -531
- empathy_os/workflows/xml_enhanced_crew.py +0 -285
- empathy_software_plugin/SOFTWARE_PLUGIN_README.md +0 -57
- empathy_software_plugin/cli/__init__.py +0 -120
- empathy_software_plugin/cli/inspect.py +0 -362
- empathy_software_plugin/cli.py +0 -574
- empathy_software_plugin/plugin.py +0 -188
- workflow_scaffolding/__init__.py +0 -11
- workflow_scaffolding/__main__.py +0 -12
- workflow_scaffolding/cli.py +0 -206
- workflow_scaffolding/generator.py +0 -265
- {empathy_framework-5.2.1.dist-info → empathy_framework-5.4.0.dist-info}/WHEEL +0 -0
|
@@ -1,536 +0,0 @@
|
|
|
1
|
-
"""Standalone Dashboard Server - Reads Directly from Redis.
|
|
2
|
-
|
|
3
|
-
This version bypasses the telemetry API layer and reads directly from Redis.
|
|
4
|
-
Works with data populated by scripts/populate_redis_direct.py.
|
|
5
|
-
|
|
6
|
-
Zero external dependencies (uses Python stdlib only).
|
|
7
|
-
|
|
8
|
-
Copyright 2025 Smart-AI-Memory
|
|
9
|
-
Licensed under Fair Source License 0.9
|
|
10
|
-
"""
|
|
11
|
-
|
|
12
|
-
from __future__ import annotations
|
|
13
|
-
|
|
14
|
-
import json
|
|
15
|
-
import logging
|
|
16
|
-
from datetime import datetime
|
|
17
|
-
from http.server import BaseHTTPRequestHandler, HTTPServer
|
|
18
|
-
from pathlib import Path
|
|
19
|
-
from urllib.parse import parse_qs, urlparse
|
|
20
|
-
|
|
21
|
-
try:
|
|
22
|
-
import redis
|
|
23
|
-
|
|
24
|
-
REDIS_AVAILABLE = True
|
|
25
|
-
except ImportError:
|
|
26
|
-
REDIS_AVAILABLE = False
|
|
27
|
-
|
|
28
|
-
logger = logging.getLogger(__name__)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
class StandaloneDashboardHandler(BaseHTTPRequestHandler):
|
|
32
|
-
"""HTTP handler that reads directly from Redis."""
|
|
33
|
-
|
|
34
|
-
# Class variable for Redis connection (shared across requests)
|
|
35
|
-
_redis_client = None
|
|
36
|
-
|
|
37
|
-
@classmethod
|
|
38
|
-
def get_redis(cls):
|
|
39
|
-
"""Get or create Redis connection."""
|
|
40
|
-
if not REDIS_AVAILABLE:
|
|
41
|
-
return None
|
|
42
|
-
|
|
43
|
-
if cls._redis_client is None:
|
|
44
|
-
try:
|
|
45
|
-
cls._redis_client = redis.Redis(host="localhost", port=6379, decode_responses=False)
|
|
46
|
-
cls._redis_client.ping() # Test connection
|
|
47
|
-
except Exception as e:
|
|
48
|
-
logger.error(f"Failed to connect to Redis: {e}")
|
|
49
|
-
cls._redis_client = None
|
|
50
|
-
|
|
51
|
-
return cls._redis_client
|
|
52
|
-
|
|
53
|
-
def do_GET(self):
|
|
54
|
-
"""Handle GET requests."""
|
|
55
|
-
parsed = urlparse(self.path)
|
|
56
|
-
path = parsed.path
|
|
57
|
-
query = parse_qs(parsed.query)
|
|
58
|
-
|
|
59
|
-
# Route requests
|
|
60
|
-
if path == "/" or path == "/index.html":
|
|
61
|
-
self.serve_file("index.html", "text/html")
|
|
62
|
-
elif path == "/static/style.css":
|
|
63
|
-
self.serve_file("style.css", "text/css")
|
|
64
|
-
elif path == "/static/app.js":
|
|
65
|
-
self.serve_file("app.js", "application/javascript")
|
|
66
|
-
elif path == "/api/health":
|
|
67
|
-
self.api_health()
|
|
68
|
-
elif path == "/api/agents":
|
|
69
|
-
self.api_agents()
|
|
70
|
-
elif path.startswith("/api/agents/"):
|
|
71
|
-
agent_id = path.split("/")[-1]
|
|
72
|
-
self.api_agent_detail(agent_id)
|
|
73
|
-
elif path == "/api/signals":
|
|
74
|
-
limit = int(query.get("limit", [50])[0])
|
|
75
|
-
self.api_signals(limit)
|
|
76
|
-
elif path == "/api/events":
|
|
77
|
-
event_type = query.get("event_type", [None])[0]
|
|
78
|
-
limit = int(query.get("limit", [100])[0])
|
|
79
|
-
self.api_events(event_type, limit)
|
|
80
|
-
elif path == "/api/approvals":
|
|
81
|
-
self.api_approvals()
|
|
82
|
-
elif path == "/api/feedback/workflows":
|
|
83
|
-
self.api_feedback_workflows()
|
|
84
|
-
elif path == "/api/feedback/underperforming":
|
|
85
|
-
threshold = float(query.get("threshold", [0.7])[0])
|
|
86
|
-
self.api_underperforming(threshold)
|
|
87
|
-
else:
|
|
88
|
-
self.send_error(404, "Not Found")
|
|
89
|
-
|
|
90
|
-
def do_POST(self):
|
|
91
|
-
"""Handle POST requests."""
|
|
92
|
-
parsed = urlparse(self.path)
|
|
93
|
-
path = parsed.path
|
|
94
|
-
|
|
95
|
-
# Get request body
|
|
96
|
-
content_length = int(self.headers.get("Content-Length", 0))
|
|
97
|
-
body = self.rfile.read(content_length) if content_length > 0 else b"{}"
|
|
98
|
-
data = json.loads(body.decode("utf-8")) if body else {}
|
|
99
|
-
|
|
100
|
-
# Route requests
|
|
101
|
-
if "/approve" in path:
|
|
102
|
-
request_id = path.split("/")[-2]
|
|
103
|
-
self.api_approve(request_id, data.get("reason", "Approved via dashboard"))
|
|
104
|
-
elif "/reject" in path:
|
|
105
|
-
request_id = path.split("/")[-2]
|
|
106
|
-
self.api_reject(request_id, data.get("reason", "Rejected via dashboard"))
|
|
107
|
-
else:
|
|
108
|
-
self.send_error(404, "Not Found")
|
|
109
|
-
|
|
110
|
-
def serve_file(self, filename: str, content_type: str):
|
|
111
|
-
"""Serve static file."""
|
|
112
|
-
try:
|
|
113
|
-
static_dir = Path(__file__).parent / "static"
|
|
114
|
-
file_path = static_dir / filename
|
|
115
|
-
|
|
116
|
-
if not file_path.exists():
|
|
117
|
-
self.send_error(404, f"File not found: {filename}")
|
|
118
|
-
return
|
|
119
|
-
|
|
120
|
-
content = file_path.read_bytes()
|
|
121
|
-
|
|
122
|
-
self.send_response(200)
|
|
123
|
-
self.send_header("Content-Type", content_type)
|
|
124
|
-
self.send_header("Content-Length", str(len(content)))
|
|
125
|
-
self.end_headers()
|
|
126
|
-
self.wfile.write(content)
|
|
127
|
-
|
|
128
|
-
except Exception as e:
|
|
129
|
-
logger.error(f"Failed to serve file {filename}: {e}")
|
|
130
|
-
self.send_error(500, str(e))
|
|
131
|
-
|
|
132
|
-
def send_json(self, data: dict | list, status: int = 200):
|
|
133
|
-
"""Send JSON response."""
|
|
134
|
-
try:
|
|
135
|
-
content = json.dumps(data).encode("utf-8")
|
|
136
|
-
|
|
137
|
-
self.send_response(status)
|
|
138
|
-
self.send_header("Content-Type", "application/json")
|
|
139
|
-
self.send_header("Content-Length", str(len(content)))
|
|
140
|
-
self.send_header("Access-Control-Allow-Origin", "*") # CORS
|
|
141
|
-
self.end_headers()
|
|
142
|
-
self.wfile.write(content)
|
|
143
|
-
|
|
144
|
-
except Exception as e:
|
|
145
|
-
logger.error(f"Failed to send JSON: {e}")
|
|
146
|
-
self.send_error(500, str(e))
|
|
147
|
-
|
|
148
|
-
# ========================================================================
|
|
149
|
-
# API Endpoints - Read Directly from Redis
|
|
150
|
-
# ========================================================================
|
|
151
|
-
|
|
152
|
-
def api_health(self):
|
|
153
|
-
"""System health endpoint."""
|
|
154
|
-
try:
|
|
155
|
-
r = self.get_redis()
|
|
156
|
-
has_redis = r is not None
|
|
157
|
-
|
|
158
|
-
if has_redis:
|
|
159
|
-
# Count keys directly
|
|
160
|
-
heartbeat_count = len(r.keys(b"heartbeat:*"))
|
|
161
|
-
approval_count = len(r.keys(b"approval:pending:*"))
|
|
162
|
-
else:
|
|
163
|
-
heartbeat_count = 0
|
|
164
|
-
approval_count = 0
|
|
165
|
-
|
|
166
|
-
self.send_json(
|
|
167
|
-
{
|
|
168
|
-
"status": "healthy" if has_redis else "degraded",
|
|
169
|
-
"redis_available": has_redis,
|
|
170
|
-
"active_agents": heartbeat_count,
|
|
171
|
-
"pending_approvals": approval_count,
|
|
172
|
-
"timestamp": datetime.utcnow().isoformat(),
|
|
173
|
-
}
|
|
174
|
-
)
|
|
175
|
-
except Exception as e:
|
|
176
|
-
self.send_json({"status": "error", "error": str(e)}, status=500)
|
|
177
|
-
|
|
178
|
-
def api_agents(self):
|
|
179
|
-
"""List active agents."""
|
|
180
|
-
try:
|
|
181
|
-
r = self.get_redis()
|
|
182
|
-
if not r:
|
|
183
|
-
self.send_json([])
|
|
184
|
-
return
|
|
185
|
-
|
|
186
|
-
result = []
|
|
187
|
-
for key in r.keys(b"heartbeat:*"):
|
|
188
|
-
try:
|
|
189
|
-
data = r.get(key)
|
|
190
|
-
if data:
|
|
191
|
-
heartbeat = json.loads(data.decode("utf-8"))
|
|
192
|
-
result.append(
|
|
193
|
-
{
|
|
194
|
-
"agent_id": heartbeat.get("agent_id"),
|
|
195
|
-
"status": heartbeat.get("status"),
|
|
196
|
-
"last_seen": heartbeat.get("timestamp"),
|
|
197
|
-
"progress": heartbeat.get("progress", 0.0),
|
|
198
|
-
"current_task": heartbeat.get("current_task", "Unknown"),
|
|
199
|
-
}
|
|
200
|
-
)
|
|
201
|
-
except Exception as e:
|
|
202
|
-
logger.error(f"Failed to parse heartbeat {key}: {e}")
|
|
203
|
-
|
|
204
|
-
self.send_json(result)
|
|
205
|
-
except Exception as e:
|
|
206
|
-
logger.error(f"Failed to get agents: {e}")
|
|
207
|
-
self.send_json([], status=500)
|
|
208
|
-
|
|
209
|
-
def api_agent_detail(self, agent_id: str):
|
|
210
|
-
"""Get specific agent details."""
|
|
211
|
-
try:
|
|
212
|
-
r = self.get_redis()
|
|
213
|
-
if not r:
|
|
214
|
-
self.send_json({"error": "Redis not available"}, status=503)
|
|
215
|
-
return
|
|
216
|
-
|
|
217
|
-
key = f"heartbeat:{agent_id}".encode()
|
|
218
|
-
data = r.get(key)
|
|
219
|
-
|
|
220
|
-
if not data:
|
|
221
|
-
self.send_json({"error": f"Agent {agent_id} not found"}, status=404)
|
|
222
|
-
return
|
|
223
|
-
|
|
224
|
-
heartbeat = json.loads(data.decode("utf-8"))
|
|
225
|
-
self.send_json(
|
|
226
|
-
{
|
|
227
|
-
"agent_id": heartbeat.get("agent_id"),
|
|
228
|
-
"status": heartbeat.get("status"),
|
|
229
|
-
"last_seen": heartbeat.get("timestamp"),
|
|
230
|
-
"progress": heartbeat.get("progress", 0.0),
|
|
231
|
-
"current_task": heartbeat.get("current_task"),
|
|
232
|
-
"metadata": heartbeat.get("metadata", {}),
|
|
233
|
-
}
|
|
234
|
-
)
|
|
235
|
-
except Exception as e:
|
|
236
|
-
self.send_json({"error": str(e)}, status=500)
|
|
237
|
-
|
|
238
|
-
def api_signals(self, limit: int):
|
|
239
|
-
"""Get recent coordination signals."""
|
|
240
|
-
try:
|
|
241
|
-
r = self.get_redis()
|
|
242
|
-
if not r:
|
|
243
|
-
self.send_json([])
|
|
244
|
-
return
|
|
245
|
-
|
|
246
|
-
result = []
|
|
247
|
-
for key in r.keys(b"empathy:signal:*")[:limit]:
|
|
248
|
-
try:
|
|
249
|
-
data = r.get(key)
|
|
250
|
-
if data:
|
|
251
|
-
signal = json.loads(data.decode("utf-8"))
|
|
252
|
-
result.append(
|
|
253
|
-
{
|
|
254
|
-
"signal_type": signal.get("signal_type"),
|
|
255
|
-
"source_agent": signal.get("source_agent"),
|
|
256
|
-
"target_agent": signal.get("target_agent"),
|
|
257
|
-
"timestamp": signal.get("timestamp"),
|
|
258
|
-
"payload": signal.get("payload", {}),
|
|
259
|
-
}
|
|
260
|
-
)
|
|
261
|
-
except Exception as e:
|
|
262
|
-
logger.error(f"Failed to parse signal {key}: {e}")
|
|
263
|
-
|
|
264
|
-
# Sort by timestamp (newest first)
|
|
265
|
-
result.sort(key=lambda x: x.get("timestamp", ""), reverse=True)
|
|
266
|
-
self.send_json(result[:limit])
|
|
267
|
-
except Exception as e:
|
|
268
|
-
logger.error(f"Failed to get signals: {e}")
|
|
269
|
-
self.send_json([])
|
|
270
|
-
|
|
271
|
-
def api_events(self, event_type: str | None, limit: int):
|
|
272
|
-
"""Get recent events."""
|
|
273
|
-
try:
|
|
274
|
-
r = self.get_redis()
|
|
275
|
-
if not r:
|
|
276
|
-
self.send_json([])
|
|
277
|
-
return
|
|
278
|
-
|
|
279
|
-
result = []
|
|
280
|
-
|
|
281
|
-
# Get from streams
|
|
282
|
-
stream_patterns = [
|
|
283
|
-
b"stream:workflow_progress",
|
|
284
|
-
b"stream:agent_heartbeat",
|
|
285
|
-
b"stream:coordination_signal",
|
|
286
|
-
]
|
|
287
|
-
|
|
288
|
-
for stream_key in stream_patterns:
|
|
289
|
-
try:
|
|
290
|
-
# Get last N entries from stream
|
|
291
|
-
entries = r.xrevrange(stream_key, count=limit)
|
|
292
|
-
for entry_id, fields in entries:
|
|
293
|
-
if b"data" in fields:
|
|
294
|
-
event = json.loads(fields[b"data"].decode("utf-8"))
|
|
295
|
-
result.append(
|
|
296
|
-
{
|
|
297
|
-
"event_id": event.get("event_id"),
|
|
298
|
-
"event_type": event.get("event_type"),
|
|
299
|
-
"timestamp": event.get("timestamp"),
|
|
300
|
-
"data": event.get("data", {}),
|
|
301
|
-
"source": event.get("source"),
|
|
302
|
-
}
|
|
303
|
-
)
|
|
304
|
-
except Exception as e:
|
|
305
|
-
logger.debug(f"Stream {stream_key} not found or empty: {e}")
|
|
306
|
-
|
|
307
|
-
# Sort by timestamp
|
|
308
|
-
result.sort(key=lambda x: x.get("timestamp", ""), reverse=True)
|
|
309
|
-
self.send_json(result[:limit])
|
|
310
|
-
except Exception as e:
|
|
311
|
-
logger.error(f"Failed to get events: {e}")
|
|
312
|
-
self.send_json([])
|
|
313
|
-
|
|
314
|
-
def api_approvals(self):
|
|
315
|
-
"""Get pending approvals."""
|
|
316
|
-
try:
|
|
317
|
-
r = self.get_redis()
|
|
318
|
-
if not r:
|
|
319
|
-
self.send_json([])
|
|
320
|
-
return
|
|
321
|
-
|
|
322
|
-
result = []
|
|
323
|
-
for key in r.keys(b"approval:pending:*"):
|
|
324
|
-
try:
|
|
325
|
-
data = r.get(key)
|
|
326
|
-
if data:
|
|
327
|
-
approval = json.loads(data.decode("utf-8"))
|
|
328
|
-
result.append(
|
|
329
|
-
{
|
|
330
|
-
"request_id": approval.get("request_id"),
|
|
331
|
-
"approval_type": approval.get("approval_type"),
|
|
332
|
-
"agent_id": approval.get("agent_id"),
|
|
333
|
-
"context": approval.get("context", {}),
|
|
334
|
-
"timestamp": approval.get("timestamp"),
|
|
335
|
-
"timeout_seconds": approval.get("timeout_seconds", 300),
|
|
336
|
-
}
|
|
337
|
-
)
|
|
338
|
-
except Exception as e:
|
|
339
|
-
logger.error(f"Failed to parse approval {key}: {e}")
|
|
340
|
-
|
|
341
|
-
self.send_json(result)
|
|
342
|
-
except Exception as e:
|
|
343
|
-
logger.error(f"Failed to get approvals: {e}")
|
|
344
|
-
self.send_json([])
|
|
345
|
-
|
|
346
|
-
def api_approve(self, request_id: str, reason: str):
|
|
347
|
-
"""Approve request."""
|
|
348
|
-
try:
|
|
349
|
-
r = self.get_redis()
|
|
350
|
-
if not r:
|
|
351
|
-
self.send_json({"error": "Redis not available"}, status=503)
|
|
352
|
-
return
|
|
353
|
-
|
|
354
|
-
# Delete from pending
|
|
355
|
-
key = f"approval:pending:{request_id}".encode()
|
|
356
|
-
if r.delete(key):
|
|
357
|
-
self.send_json({"status": "approved", "request_id": request_id})
|
|
358
|
-
else:
|
|
359
|
-
self.send_json({"error": "Request not found"}, status=404)
|
|
360
|
-
except Exception as e:
|
|
361
|
-
self.send_json({"error": str(e)}, status=500)
|
|
362
|
-
|
|
363
|
-
def api_reject(self, request_id: str, reason: str):
|
|
364
|
-
"""Reject request."""
|
|
365
|
-
try:
|
|
366
|
-
r = self.get_redis()
|
|
367
|
-
if not r:
|
|
368
|
-
self.send_json({"error": "Redis not available"}, status=503)
|
|
369
|
-
return
|
|
370
|
-
|
|
371
|
-
# Delete from pending
|
|
372
|
-
key = f"approval:pending:{request_id}".encode()
|
|
373
|
-
if r.delete(key):
|
|
374
|
-
self.send_json({"status": "rejected", "request_id": request_id})
|
|
375
|
-
else:
|
|
376
|
-
self.send_json({"error": "Request not found"}, status=404)
|
|
377
|
-
except Exception as e:
|
|
378
|
-
self.send_json({"error": str(e)}, status=500)
|
|
379
|
-
|
|
380
|
-
def api_feedback_workflows(self):
|
|
381
|
-
"""Get workflow quality metrics."""
|
|
382
|
-
try:
|
|
383
|
-
r = self.get_redis()
|
|
384
|
-
if not r:
|
|
385
|
-
self.send_json([])
|
|
386
|
-
return
|
|
387
|
-
|
|
388
|
-
# Group feedback by workflow/stage/tier
|
|
389
|
-
feedback_groups = {}
|
|
390
|
-
|
|
391
|
-
for key in r.keys(b"feedback:*"):
|
|
392
|
-
try:
|
|
393
|
-
data = r.get(key)
|
|
394
|
-
if data:
|
|
395
|
-
feedback = json.loads(data.decode("utf-8"))
|
|
396
|
-
workflow = feedback.get("workflow_name")
|
|
397
|
-
stage = feedback.get("stage_name")
|
|
398
|
-
tier = feedback.get("tier")
|
|
399
|
-
quality = feedback.get("quality_score")
|
|
400
|
-
|
|
401
|
-
group_key = f"{workflow}/{stage}/{tier}"
|
|
402
|
-
if group_key not in feedback_groups:
|
|
403
|
-
feedback_groups[group_key] = {
|
|
404
|
-
"workflow_name": workflow,
|
|
405
|
-
"stage_name": stage,
|
|
406
|
-
"tier": tier,
|
|
407
|
-
"qualities": [],
|
|
408
|
-
}
|
|
409
|
-
feedback_groups[group_key]["qualities"].append(quality)
|
|
410
|
-
except Exception as e:
|
|
411
|
-
logger.error(f"Failed to parse feedback {key}: {e}")
|
|
412
|
-
|
|
413
|
-
# Calculate stats
|
|
414
|
-
result = []
|
|
415
|
-
for group_key, group in feedback_groups.items():
|
|
416
|
-
qualities = group["qualities"]
|
|
417
|
-
if qualities:
|
|
418
|
-
avg_quality = sum(qualities) / len(qualities)
|
|
419
|
-
result.append(
|
|
420
|
-
{
|
|
421
|
-
"workflow_name": group["workflow_name"],
|
|
422
|
-
"stage_name": group["stage_name"],
|
|
423
|
-
"tier": group["tier"],
|
|
424
|
-
"avg_quality": avg_quality,
|
|
425
|
-
"sample_count": len(qualities),
|
|
426
|
-
"trend": 0, # Simplified - no trend calculation
|
|
427
|
-
}
|
|
428
|
-
)
|
|
429
|
-
|
|
430
|
-
self.send_json(result)
|
|
431
|
-
except Exception as e:
|
|
432
|
-
logger.error(f"Failed to get quality metrics: {e}")
|
|
433
|
-
self.send_json([])
|
|
434
|
-
|
|
435
|
-
def api_underperforming(self, threshold: float):
|
|
436
|
-
"""Get underperforming stages."""
|
|
437
|
-
try:
|
|
438
|
-
r = self.get_redis()
|
|
439
|
-
if not r:
|
|
440
|
-
self.send_json([])
|
|
441
|
-
return
|
|
442
|
-
|
|
443
|
-
# Get all feedback and group by workflow/stage
|
|
444
|
-
feedback_groups = {}
|
|
445
|
-
|
|
446
|
-
for key in r.keys(b"feedback:*"):
|
|
447
|
-
try:
|
|
448
|
-
data = r.get(key)
|
|
449
|
-
if data:
|
|
450
|
-
feedback = json.loads(data.decode("utf-8"))
|
|
451
|
-
workflow = feedback.get("workflow_name")
|
|
452
|
-
stage = feedback.get("stage_name")
|
|
453
|
-
quality = feedback.get("quality_score")
|
|
454
|
-
|
|
455
|
-
group_key = f"{workflow}/{stage}"
|
|
456
|
-
if group_key not in feedback_groups:
|
|
457
|
-
feedback_groups[group_key] = {
|
|
458
|
-
"workflow_name": workflow,
|
|
459
|
-
"stage_name": stage,
|
|
460
|
-
"qualities": [],
|
|
461
|
-
}
|
|
462
|
-
feedback_groups[group_key]["qualities"].append(quality)
|
|
463
|
-
except Exception as e:
|
|
464
|
-
logger.error(f"Failed to parse feedback {key}: {e}")
|
|
465
|
-
|
|
466
|
-
# Find underperforming stages
|
|
467
|
-
result = []
|
|
468
|
-
for group_key, group in feedback_groups.items():
|
|
469
|
-
qualities = group["qualities"]
|
|
470
|
-
if qualities:
|
|
471
|
-
avg_quality = sum(qualities) / len(qualities)
|
|
472
|
-
if avg_quality < threshold:
|
|
473
|
-
result.append(
|
|
474
|
-
{
|
|
475
|
-
"workflow_name": group["workflow_name"],
|
|
476
|
-
"stage_name": group["stage_name"],
|
|
477
|
-
"avg_quality": avg_quality,
|
|
478
|
-
"sample_count": len(qualities),
|
|
479
|
-
"min_quality": min(qualities),
|
|
480
|
-
"max_quality": max(qualities),
|
|
481
|
-
"trend": 0,
|
|
482
|
-
}
|
|
483
|
-
)
|
|
484
|
-
|
|
485
|
-
# Sort by quality (worst first)
|
|
486
|
-
result.sort(key=lambda x: x["avg_quality"])
|
|
487
|
-
self.send_json(result)
|
|
488
|
-
except Exception as e:
|
|
489
|
-
logger.error(f"Failed to get underperforming: {e}")
|
|
490
|
-
self.send_json([])
|
|
491
|
-
|
|
492
|
-
def log_message(self, format, *args):
|
|
493
|
-
"""Suppress default logging."""
|
|
494
|
-
# Override to reduce noise - only log errors
|
|
495
|
-
if args[1][0] in ("4", "5"): # 4xx or 5xx errors
|
|
496
|
-
logger.warning(f"{self.address_string()} - {format % args}")
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
def run_standalone_dashboard(host: str = "127.0.0.1", port: int = 8000):
|
|
500
|
-
"""Run standalone dashboard that reads directly from Redis.
|
|
501
|
-
|
|
502
|
-
This version bypasses the telemetry API layer and works with
|
|
503
|
-
data populated by scripts/populate_redis_direct.py.
|
|
504
|
-
|
|
505
|
-
Args:
|
|
506
|
-
host: Host to bind to (default: 127.0.0.1)
|
|
507
|
-
port: Port to bind to (default: 8000)
|
|
508
|
-
|
|
509
|
-
Example:
|
|
510
|
-
>>> from empathy_os.dashboard.standalone_server import run_standalone_dashboard
|
|
511
|
-
>>> run_standalone_dashboard(host="0.0.0.0", port=8080)
|
|
512
|
-
"""
|
|
513
|
-
if not REDIS_AVAILABLE:
|
|
514
|
-
print("⚠️ Warning: redis-py not installed. Install with: pip install redis")
|
|
515
|
-
print(" Dashboard will start but won't show data.")
|
|
516
|
-
print()
|
|
517
|
-
|
|
518
|
-
server = HTTPServer((host, port), StandaloneDashboardHandler)
|
|
519
|
-
|
|
520
|
-
print(f"🚀 Agent Coordination Dashboard (Standalone) running at http://{host}:{port}")
|
|
521
|
-
print(f"📊 Open in browser: http://{host}:{port}")
|
|
522
|
-
print()
|
|
523
|
-
print("💡 This version reads directly from Redis")
|
|
524
|
-
print(" Populate data with: python scripts/populate_redis_direct.py")
|
|
525
|
-
print()
|
|
526
|
-
print("Press Ctrl+C to stop")
|
|
527
|
-
|
|
528
|
-
try:
|
|
529
|
-
server.serve_forever()
|
|
530
|
-
except KeyboardInterrupt:
|
|
531
|
-
print("\n\n🛑 Shutting down dashboard...")
|
|
532
|
-
server.shutdown()
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
if __name__ == "__main__":
|
|
536
|
-
run_standalone_dashboard()
|