empathy-framework 4.7.1__py3-none-any.whl → 4.8.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 (90) hide show
  1. {empathy_framework-4.7.1.dist-info → empathy_framework-4.8.0.dist-info}/METADATA +65 -2
  2. {empathy_framework-4.7.1.dist-info → empathy_framework-4.8.0.dist-info}/RECORD +73 -52
  3. {empathy_framework-4.7.1.dist-info → empathy_framework-4.8.0.dist-info}/WHEEL +1 -1
  4. {empathy_framework-4.7.1.dist-info → empathy_framework-4.8.0.dist-info}/entry_points.txt +2 -1
  5. {empathy_framework-4.7.1.dist-info → empathy_framework-4.8.0.dist-info}/top_level.txt +0 -1
  6. empathy_os/__init__.py +2 -0
  7. empathy_os/cache/hash_only.py +6 -3
  8. empathy_os/cache/hybrid.py +6 -3
  9. empathy_os/cli/__init__.py +128 -238
  10. empathy_os/cli/__main__.py +5 -33
  11. empathy_os/cli/commands/__init__.py +1 -8
  12. empathy_os/cli/commands/help.py +331 -0
  13. empathy_os/cli/commands/info.py +140 -0
  14. empathy_os/cli/commands/inspect.py +437 -0
  15. empathy_os/cli/commands/metrics.py +92 -0
  16. empathy_os/cli/commands/orchestrate.py +184 -0
  17. empathy_os/cli/commands/patterns.py +207 -0
  18. empathy_os/cli/commands/provider.py +93 -81
  19. empathy_os/cli/commands/setup.py +96 -0
  20. empathy_os/cli/commands/status.py +235 -0
  21. empathy_os/cli/commands/sync.py +166 -0
  22. empathy_os/cli/commands/tier.py +121 -0
  23. empathy_os/cli/commands/workflow.py +574 -0
  24. empathy_os/cli/parsers/__init__.py +62 -0
  25. empathy_os/cli/parsers/help.py +41 -0
  26. empathy_os/cli/parsers/info.py +26 -0
  27. empathy_os/cli/parsers/inspect.py +66 -0
  28. empathy_os/cli/parsers/metrics.py +42 -0
  29. empathy_os/cli/parsers/orchestrate.py +61 -0
  30. empathy_os/cli/parsers/patterns.py +54 -0
  31. empathy_os/cli/parsers/provider.py +40 -0
  32. empathy_os/cli/parsers/setup.py +42 -0
  33. empathy_os/cli/parsers/status.py +47 -0
  34. empathy_os/cli/parsers/sync.py +31 -0
  35. empathy_os/cli/parsers/tier.py +33 -0
  36. empathy_os/cli/parsers/workflow.py +77 -0
  37. empathy_os/cli/utils/__init__.py +1 -0
  38. empathy_os/cli/utils/data.py +242 -0
  39. empathy_os/cli/utils/helpers.py +68 -0
  40. empathy_os/{cli.py → cli_legacy.py} +27 -27
  41. empathy_os/cli_minimal.py +662 -0
  42. empathy_os/cli_router.py +384 -0
  43. empathy_os/cli_unified.py +38 -2
  44. empathy_os/memory/__init__.py +19 -5
  45. empathy_os/memory/short_term.py +14 -404
  46. empathy_os/memory/types.py +437 -0
  47. empathy_os/memory/unified.py +61 -48
  48. empathy_os/models/fallback.py +1 -1
  49. empathy_os/models/provider_config.py +59 -344
  50. empathy_os/models/registry.py +31 -180
  51. empathy_os/monitoring/alerts.py +14 -20
  52. empathy_os/monitoring/alerts_cli.py +24 -7
  53. empathy_os/project_index/__init__.py +2 -0
  54. empathy_os/project_index/index.py +210 -5
  55. empathy_os/project_index/scanner.py +45 -14
  56. empathy_os/project_index/scanner_parallel.py +291 -0
  57. empathy_os/socratic/ab_testing.py +1 -1
  58. empathy_os/workflows/__init__.py +31 -2
  59. empathy_os/workflows/base.py +349 -325
  60. empathy_os/workflows/bug_predict.py +8 -0
  61. empathy_os/workflows/builder.py +273 -0
  62. empathy_os/workflows/caching.py +253 -0
  63. empathy_os/workflows/code_review_pipeline.py +1 -0
  64. empathy_os/workflows/history.py +510 -0
  65. empathy_os/workflows/output.py +410 -0
  66. empathy_os/workflows/perf_audit.py +125 -19
  67. empathy_os/workflows/progress.py +324 -22
  68. empathy_os/workflows/routing.py +168 -0
  69. empathy_os/workflows/secure_release.py +1 -0
  70. empathy_os/workflows/security_audit.py +190 -0
  71. empathy_os/workflows/security_audit_phase3.py +328 -0
  72. empathy_os/workflows/telemetry_mixin.py +269 -0
  73. empathy_os/dashboard/__init__.py +0 -15
  74. empathy_os/dashboard/server.py +0 -941
  75. patterns/README.md +0 -119
  76. patterns/__init__.py +0 -95
  77. patterns/behavior.py +0 -298
  78. patterns/code_review_memory.json +0 -441
  79. patterns/core.py +0 -97
  80. patterns/debugging.json +0 -3763
  81. patterns/empathy.py +0 -268
  82. patterns/health_check_memory.json +0 -505
  83. patterns/input.py +0 -161
  84. patterns/memory_graph.json +0 -8
  85. patterns/refactoring_memory.json +0 -1113
  86. patterns/registry.py +0 -663
  87. patterns/security_memory.json +0 -8
  88. patterns/structural.py +0 -415
  89. patterns/validation.py +0 -194
  90. {empathy_framework-4.7.1.dist-info → empathy_framework-4.8.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()
@@ -1,5 +1,22 @@
1
- """Command-Line Interface for Empathy Framework
1
+ """Command-Line Interface for Empathy Framework (LEGACY)
2
2
 
3
+ DEPRECATED: This module is deprecated as of v5.0.0.
4
+ Use the minimal CLI instead: `empathy` (empathy_os.cli_minimal)
5
+
6
+ The minimal CLI provides:
7
+ - `empathy workflow list|info|run` - Workflow management
8
+ - `empathy telemetry show|savings|export` - Usage tracking
9
+ - `empathy provider show|set` - Provider configuration
10
+ - `empathy validate` - Configuration validation
11
+
12
+ For interactive features, use Claude Code slash commands:
13
+ - /dev, /testing, /docs, /release, /help
14
+
15
+ Migration guide: https://smartaimemory.com/framework-docs/migration/cli/
16
+
17
+ ---
18
+
19
+ Original description:
3
20
  Provides CLI commands for:
4
21
  - Running interactive REPL (empathy run)
5
22
  - Inspecting patterns, metrics, state (empathy inspect)
@@ -12,6 +29,15 @@ Copyright 2025 Smart-AI-Memory
12
29
  Licensed under Fair Source License 0.9
13
30
  """
14
31
 
32
+ import warnings
33
+
34
+ warnings.warn(
35
+ "empathy_os.cli_legacy is deprecated. Use 'empathy' (cli_minimal) instead. "
36
+ "See: https://smartaimemory.com/framework-docs/reference/cli-reference/",
37
+ DeprecationWarning,
38
+ stacklevel=2,
39
+ )
40
+
15
41
  import argparse
16
42
  import heapq
17
43
  import sys
@@ -22,7 +48,6 @@ from pathlib import Path
22
48
  from empathy_os import EmpathyConfig, EmpathyOS, load_config
23
49
  from empathy_os.config import _validate_file_path
24
50
  from empathy_os.cost_tracker import cmd_costs
25
- from empathy_os.dashboard import cmd_dashboard
26
51
  from empathy_os.discovery import show_tip_if_available
27
52
  from empathy_os.logging_config import get_logger
28
53
  from empathy_os.pattern_library import PatternLibrary
@@ -3681,31 +3706,6 @@ def main():
3681
3706
  parser_new.add_argument("--list", "-l", action="store_true", help="List available templates")
3682
3707
  parser_new.set_defaults(func=cmd_new)
3683
3708
 
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
3709
  # Frameworks command (agent framework management)
3710
3710
  parser_frameworks = subparsers.add_parser(
3711
3711
  "frameworks",