empathy-framework 4.7.1__py3-none-any.whl → 4.9.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.
Files changed (96) hide show
  1. {empathy_framework-4.7.1.dist-info → empathy_framework-4.9.0.dist-info}/METADATA +65 -2
  2. {empathy_framework-4.7.1.dist-info → empathy_framework-4.9.0.dist-info}/RECORD +69 -59
  3. {empathy_framework-4.7.1.dist-info → empathy_framework-4.9.0.dist-info}/WHEEL +1 -1
  4. {empathy_framework-4.7.1.dist-info → empathy_framework-4.9.0.dist-info}/entry_points.txt +2 -1
  5. {empathy_framework-4.7.1.dist-info → empathy_framework-4.9.0.dist-info}/top_level.txt +0 -1
  6. empathy_os/__init__.py +2 -0
  7. empathy_os/cli/__init__.py +128 -238
  8. empathy_os/cli/__main__.py +5 -33
  9. empathy_os/cli/commands/__init__.py +1 -8
  10. empathy_os/cli/commands/help.py +331 -0
  11. empathy_os/cli/commands/info.py +140 -0
  12. empathy_os/cli/commands/inspect.py +437 -0
  13. empathy_os/cli/commands/metrics.py +92 -0
  14. empathy_os/cli/commands/orchestrate.py +184 -0
  15. empathy_os/cli/commands/patterns.py +207 -0
  16. empathy_os/cli/commands/provider.py +93 -81
  17. empathy_os/cli/commands/setup.py +96 -0
  18. empathy_os/cli/commands/status.py +235 -0
  19. empathy_os/cli/commands/sync.py +166 -0
  20. empathy_os/cli/commands/tier.py +121 -0
  21. empathy_os/cli/commands/workflow.py +574 -0
  22. empathy_os/cli/parsers/__init__.py +62 -0
  23. empathy_os/cli/parsers/help.py +41 -0
  24. empathy_os/cli/parsers/info.py +26 -0
  25. empathy_os/cli/parsers/inspect.py +66 -0
  26. empathy_os/cli/parsers/metrics.py +42 -0
  27. empathy_os/cli/parsers/orchestrate.py +61 -0
  28. empathy_os/cli/parsers/patterns.py +54 -0
  29. empathy_os/cli/parsers/provider.py +40 -0
  30. empathy_os/cli/parsers/setup.py +42 -0
  31. empathy_os/cli/parsers/status.py +47 -0
  32. empathy_os/cli/parsers/sync.py +31 -0
  33. empathy_os/cli/parsers/tier.py +33 -0
  34. empathy_os/cli/parsers/workflow.py +77 -0
  35. empathy_os/cli/utils/__init__.py +1 -0
  36. empathy_os/cli/utils/data.py +242 -0
  37. empathy_os/cli/utils/helpers.py +68 -0
  38. empathy_os/{cli.py → cli_legacy.py} +0 -26
  39. empathy_os/cli_minimal.py +662 -0
  40. empathy_os/cli_router.py +384 -0
  41. empathy_os/cli_unified.py +13 -2
  42. empathy_os/memory/short_term.py +146 -414
  43. empathy_os/memory/types.py +441 -0
  44. empathy_os/memory/unified.py +61 -48
  45. empathy_os/models/fallback.py +1 -1
  46. empathy_os/models/provider_config.py +59 -344
  47. empathy_os/models/registry.py +27 -176
  48. empathy_os/monitoring/alerts.py +14 -20
  49. empathy_os/monitoring/alerts_cli.py +24 -7
  50. empathy_os/project_index/__init__.py +2 -0
  51. empathy_os/project_index/index.py +210 -5
  52. empathy_os/project_index/scanner.py +48 -16
  53. empathy_os/project_index/scanner_parallel.py +291 -0
  54. empathy_os/workflow_commands.py +9 -9
  55. empathy_os/workflows/__init__.py +31 -2
  56. empathy_os/workflows/base.py +295 -317
  57. empathy_os/workflows/bug_predict.py +10 -2
  58. empathy_os/workflows/builder.py +273 -0
  59. empathy_os/workflows/caching.py +253 -0
  60. empathy_os/workflows/code_review_pipeline.py +1 -0
  61. empathy_os/workflows/history.py +512 -0
  62. empathy_os/workflows/perf_audit.py +129 -23
  63. empathy_os/workflows/routing.py +163 -0
  64. empathy_os/workflows/secure_release.py +1 -0
  65. empathy_os/workflows/security_audit.py +1 -0
  66. empathy_os/workflows/security_audit_phase3.py +352 -0
  67. empathy_os/workflows/telemetry_mixin.py +269 -0
  68. empathy_os/workflows/test_gen.py +7 -7
  69. empathy_os/dashboard/__init__.py +0 -15
  70. empathy_os/dashboard/server.py +0 -941
  71. empathy_os/vscode_bridge 2.py +0 -173
  72. empathy_os/workflows/progressive/README 2.md +0 -454
  73. empathy_os/workflows/progressive/__init__ 2.py +0 -92
  74. empathy_os/workflows/progressive/cli 2.py +0 -242
  75. empathy_os/workflows/progressive/core 2.py +0 -488
  76. empathy_os/workflows/progressive/orchestrator 2.py +0 -701
  77. empathy_os/workflows/progressive/reports 2.py +0 -528
  78. empathy_os/workflows/progressive/telemetry 2.py +0 -280
  79. empathy_os/workflows/progressive/test_gen 2.py +0 -514
  80. empathy_os/workflows/progressive/workflow 2.py +0 -628
  81. patterns/README.md +0 -119
  82. patterns/__init__.py +0 -95
  83. patterns/behavior.py +0 -298
  84. patterns/code_review_memory.json +0 -441
  85. patterns/core.py +0 -97
  86. patterns/debugging.json +0 -3763
  87. patterns/empathy.py +0 -268
  88. patterns/health_check_memory.json +0 -505
  89. patterns/input.py +0 -161
  90. patterns/memory_graph.json +0 -8
  91. patterns/refactoring_memory.json +0 -1113
  92. patterns/registry.py +0 -663
  93. patterns/security_memory.json +0 -8
  94. patterns/structural.py +0 -415
  95. patterns/validation.py +0 -194
  96. {empathy_framework-4.7.1.dist-info → empathy_framework-4.9.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,242 @@
1
+ """Help text and documentation data for CLI commands.
2
+
3
+ This module contains static help content displayed by various CLI commands.
4
+
5
+ Copyright 2025 Smart-AI-Memory
6
+ Licensed under Fair Source License 0.9
7
+ """
8
+
9
+ CHEATSHEET = {
10
+ "Getting Started": [
11
+ ("empathy init", "Create a new config file"),
12
+ ("empathy workflow", "Interactive setup workflow"),
13
+ ("empathy run", "Interactive REPL mode"),
14
+ ],
15
+ "Daily Workflow": [
16
+ ("empathy morning", "Start-of-day briefing"),
17
+ ("empathy status", "What needs attention now"),
18
+ ("empathy ship", "Pre-commit validation"),
19
+ ],
20
+ "Code Quality": [
21
+ ("empathy health", "Quick health check"),
22
+ ("empathy health --deep", "Comprehensive check"),
23
+ ("empathy health --fix", "Auto-fix issues"),
24
+ ("empathy fix-all", "Fix all lint/format issues"),
25
+ ],
26
+ "Pattern Learning": [
27
+ ("empathy learn --analyze 20", "Learn from last 20 commits"),
28
+ ("empathy sync-claude", "Sync patterns to Claude Code"),
29
+ ("empathy inspect patterns", "View learned patterns"),
30
+ ],
31
+ "Code Review": [
32
+ ("empathy review", "Review recent changes"),
33
+ ("empathy review --staged", "Review staged changes only"),
34
+ ],
35
+ "Memory & State": [
36
+ ("empathy inspect state", "View saved states"),
37
+ ("empathy inspect metrics --user-id X", "View user metrics"),
38
+ ("empathy export patterns.json", "Export patterns"),
39
+ ],
40
+ "Advanced": [
41
+ ("empathy costs", "View API cost tracking"),
42
+ ("empathy dashboard", "Launch visual dashboard"),
43
+ ("empathy frameworks", "List agent frameworks"),
44
+ ("empathy workflow list", "List multi-model workflows"),
45
+ ("empathy new <template>", "Create project from template"),
46
+ ],
47
+ }
48
+
49
+ EXPLAIN_CONTENT = {
50
+ "morning": """
51
+ HOW 'empathy morning' WORKS:
52
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━
53
+ This command aggregates multiple data sources to give you a prioritized
54
+ start-of-day briefing:
55
+
56
+ 1. PATTERNS ANALYSIS
57
+ Reads ./patterns/*.json to find:
58
+ - Unresolved bugs (status: investigating)
59
+ - Recent security decisions
60
+ - Tech debt trends
61
+
62
+ 2. GIT CONTEXT
63
+ Checks your recent git activity:
64
+ - Commits from yesterday
65
+ - Uncommitted changes
66
+ - Branch status
67
+
68
+ 3. HEALTH SNAPSHOT
69
+ Runs quick health checks:
70
+ - Lint issues count
71
+ - Type errors
72
+ - Test status
73
+
74
+ 4. PRIORITY SCORING
75
+ Items are scored and sorted by:
76
+ - Age (older = higher priority)
77
+ - Severity (critical > high > medium)
78
+ - Your recent activity patterns
79
+
80
+ TIPS:
81
+ • Run this first thing each day
82
+ • Use 'empathy morning --verbose' for details
83
+ • Pair with 'empathy status --select N' to dive deeper
84
+ """,
85
+ "ship": """
86
+ HOW 'empathy ship' WORKS:
87
+ ━━━━━━━━━━━━━━━━━━━━━━━━━
88
+ Pre-commit validation pipeline that ensures code quality before shipping:
89
+
90
+ 1. HEALTH CHECKS
91
+ - Runs lint checks (ruff/flake8)
92
+ - Validates types (mypy/pyright)
93
+ - Checks formatting (black/prettier)
94
+
95
+ 2. PATTERN REVIEW
96
+ - Compares changes against known bug patterns
97
+ - Flags code that matches historical issues
98
+ - Suggests fixes based on past resolutions
99
+
100
+ 3. SECURITY SCAN
101
+ - Checks for hardcoded secrets
102
+ - Validates against security patterns
103
+ - Reports potential vulnerabilities
104
+
105
+ 4. PATTERN SYNC (optional)
106
+ - Updates Claude Code rules
107
+ - Syncs new patterns discovered
108
+ - Skip with --skip-sync
109
+
110
+ EXIT CODES:
111
+ • 0 = All checks passed, safe to commit
112
+ • 1 = Issues found, review before committing
113
+
114
+ TIPS:
115
+ • Add to pre-commit hook: empathy ship --skip-sync
116
+ • Use 'empathy ship --verbose' to see all checks
117
+ """,
118
+ "learn": """
119
+ HOW 'empathy learn' WORKS:
120
+ ━━━━━━━━━━━━━━━━━━━━━━━━━
121
+ Extracts patterns from your git history to teach Claude about your codebase:
122
+
123
+ 1. COMMIT ANALYSIS
124
+ Parses commit messages looking for:
125
+ - fix: Bug fixes → debugging.json
126
+ - security: decisions → security.json
127
+ - TODO/FIXME in code → tech_debt.json
128
+
129
+ 2. DIFF INSPECTION
130
+ Analyzes code changes to:
131
+ - Identify affected files
132
+ - Extract error types
133
+ - Record fix patterns
134
+
135
+ 3. PATTERN STORAGE
136
+ Saves to ./patterns/:
137
+ - debugging.json: Bug patterns
138
+ - security.json: Security decisions
139
+ - tech_debt.json: Technical debt
140
+ - inspection.json: Code review findings
141
+
142
+ 4. SUMMARY GENERATION
143
+ Creates .claude/patterns_summary.md:
144
+ - Human-readable pattern overview
145
+ - Loaded by Claude Code automatically
146
+
147
+ USAGE EXAMPLES:
148
+ • empathy learn --analyze 10 # Last 10 commits
149
+ • empathy learn --analyze 100 # Deeper history
150
+ • empathy sync-claude # Apply patterns to Claude
151
+
152
+ TIPS:
153
+ • Run weekly to keep patterns current
154
+ • Use good commit messages (fix:, feat:, etc.)
155
+ • Check ./patterns/ to see what was learned
156
+ """,
157
+ "health": """
158
+ HOW 'empathy health' WORKS:
159
+ ━━━━━━━━━━━━━━━━━━━━━━━━━
160
+ Code health dashboard that runs multiple quality checks:
161
+
162
+ 1. QUICK MODE (default)
163
+ Fast checks that run in seconds:
164
+ - Lint: ruff check or flake8
165
+ - Format: black --check or prettier
166
+ - Basic type checking
167
+
168
+ 2. DEEP MODE (--deep)
169
+ Comprehensive checks (slower):
170
+ - Full type analysis (mypy --strict)
171
+ - Test suite execution
172
+ - Security scanning
173
+ - Dependency audit
174
+
175
+ 3. SCORING
176
+ Health score 0-100 based on:
177
+ - Lint issues (×2 penalty each)
178
+ - Type errors (×5 penalty each)
179
+ - Test failures (×10 penalty each)
180
+ - Security issues (×20 penalty each)
181
+
182
+ 4. AUTO-FIX (--fix)
183
+ Can automatically fix:
184
+ - Formatting issues
185
+ - Import sorting
186
+ - Simple lint errors
187
+
188
+ USAGE:
189
+ • empathy health # Quick check
190
+ • empathy health --deep # Full check
191
+ • empathy health --fix # Auto-fix issues
192
+ • empathy health --trends 30 # 30-day trend
193
+
194
+ TIPS:
195
+ • Run quick checks before commits
196
+ • Run deep checks in CI/CD
197
+ • Track trends to catch regressions
198
+ """,
199
+ "sync-claude": """
200
+ HOW 'empathy sync-claude' WORKS:
201
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
202
+ Converts learned patterns into Claude Code rules:
203
+
204
+ 1. READS PATTERNS
205
+ Loads from ./patterns/:
206
+ - debugging.json → Bug fix patterns
207
+ - security.json → Security decisions
208
+ - tech_debt.json → Known debt items
209
+
210
+ 2. GENERATES RULES
211
+ Creates .claude/rules/empathy/:
212
+ - debugging.md
213
+ - security.md
214
+ - tech_debt.md
215
+
216
+ 3. CLAUDE CODE INTEGRATION
217
+ Rules are automatically loaded when:
218
+ - Claude Code starts in this directory
219
+ - Combined with CLAUDE.md instructions
220
+
221
+ HOW CLAUDE USES THESE:
222
+ • Sees historical bugs before suggesting code
223
+ • Knows about accepted security patterns
224
+ • Understands existing tech debt
225
+
226
+ FILE STRUCTURE:
227
+ ./patterns/ # Your pattern storage
228
+ debugging.json
229
+ security.json
230
+ .claude/
231
+ CLAUDE.md # Project instructions
232
+ rules/
233
+ empathy/ # Generated rules
234
+ debugging.md
235
+ security.md
236
+
237
+ TIPS:
238
+ • Run after 'empathy learn'
239
+ • Commit .claude/rules/ to share with team
240
+ • Weekly sync keeps Claude current
241
+ """,
242
+ }
@@ -0,0 +1,68 @@
1
+ """Helper utilities for CLI commands.
2
+
3
+ Copyright 2025 Smart-AI-Memory
4
+ Licensed under Fair Source License 0.9
5
+ """
6
+
7
+ from pathlib import Path
8
+
9
+
10
+ def _file_exists(path: str) -> bool:
11
+ """Check if a file exists.
12
+
13
+ Args:
14
+ path: File path to check
15
+
16
+ Returns:
17
+ True if file exists, False otherwise
18
+ """
19
+ return Path(path).exists()
20
+
21
+
22
+ def _show_achievements(engine) -> None:
23
+ """Show user achievements based on usage.
24
+
25
+ Args:
26
+ engine: Engine instance with stats
27
+ """
28
+ stats = engine.get_stats()
29
+
30
+ achievements = []
31
+ total_cmds = stats.get("total_commands", 0)
32
+ cmd_counts = stats.get("command_counts", {})
33
+
34
+ # Check achievements
35
+ if total_cmds >= 1:
36
+ achievements.append(("First Steps", "Ran your first command"))
37
+ if total_cmds >= 10:
38
+ achievements.append(("Getting Started", "Ran 10+ commands"))
39
+ if total_cmds >= 50:
40
+ achievements.append(("Power User", "Ran 50+ commands"))
41
+ if total_cmds >= 100:
42
+ achievements.append(("Expert", "Ran 100+ commands"))
43
+
44
+ if cmd_counts.get("learn", 0) >= 1:
45
+ achievements.append(("Pattern Learner", "Learned from git history"))
46
+ if cmd_counts.get("sync-claude", 0) >= 1:
47
+ achievements.append(("Claude Whisperer", "Synced patterns to Claude"))
48
+ if cmd_counts.get("morning", 0) >= 5:
49
+ achievements.append(("Early Bird", "Used morning briefing 5+ times"))
50
+ if cmd_counts.get("ship", 0) >= 10:
51
+ achievements.append(("Quality Shipper", "Used pre-commit checks 10+ times"))
52
+ if cmd_counts.get("health", 0) >= 1 and cmd_counts.get("fix-all", 0) >= 1:
53
+ achievements.append(("Code Doctor", "Used health checks and fixes"))
54
+
55
+ if stats.get("patterns_learned", 0) >= 10:
56
+ achievements.append(("Pattern Master", "Learned 10+ patterns"))
57
+
58
+ if stats.get("days_active", 0) >= 7:
59
+ achievements.append(("Week Warrior", "Active for 7+ days"))
60
+ if stats.get("days_active", 0) >= 30:
61
+ achievements.append(("Monthly Maven", "Active for 30+ days"))
62
+
63
+ if achievements:
64
+ print(" ACHIEVEMENTS UNLOCKED")
65
+ print(" " + "-" * 30)
66
+ for name, desc in achievements:
67
+ print(f" * {name}: {desc}")
68
+ print()
@@ -22,7 +22,6 @@ from pathlib import Path
22
22
  from empathy_os import EmpathyConfig, EmpathyOS, load_config
23
23
  from empathy_os.config import _validate_file_path
24
24
  from empathy_os.cost_tracker import cmd_costs
25
- from empathy_os.dashboard import cmd_dashboard
26
25
  from empathy_os.discovery import show_tip_if_available
27
26
  from empathy_os.logging_config import get_logger
28
27
  from empathy_os.pattern_library import PatternLibrary
@@ -3681,31 +3680,6 @@ def main():
3681
3680
  parser_new.add_argument("--list", "-l", action="store_true", help="List available templates")
3682
3681
  parser_new.set_defaults(func=cmd_new)
3683
3682
 
3684
- # Dashboard command (visual web interface)
3685
- parser_dashboard = subparsers.add_parser("dashboard", help="Launch visual dashboard in browser")
3686
- parser_dashboard.add_argument(
3687
- "--port",
3688
- type=int,
3689
- default=8765,
3690
- help="Port to run on (default: 8765)",
3691
- )
3692
- parser_dashboard.add_argument(
3693
- "--patterns-dir",
3694
- default="./patterns",
3695
- help="Path to patterns directory",
3696
- )
3697
- parser_dashboard.add_argument(
3698
- "--empathy-dir",
3699
- default=".empathy",
3700
- help="Empathy data directory",
3701
- )
3702
- parser_dashboard.add_argument(
3703
- "--no-browser",
3704
- action="store_true",
3705
- help="Don't open browser automatically",
3706
- )
3707
- parser_dashboard.set_defaults(func=cmd_dashboard)
3708
-
3709
3683
  # Frameworks command (agent framework management)
3710
3684
  parser_frameworks = subparsers.add_parser(
3711
3685
  "frameworks",