empathy-framework 5.0.1__py3-none-any.whl → 5.0.3__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 (38) hide show
  1. {empathy_framework-5.0.1.dist-info → empathy_framework-5.0.3.dist-info}/METADATA +53 -9
  2. {empathy_framework-5.0.1.dist-info → empathy_framework-5.0.3.dist-info}/RECORD +28 -31
  3. empathy_llm_toolkit/providers.py +175 -35
  4. empathy_llm_toolkit/utils/tokens.py +150 -30
  5. empathy_os/__init__.py +1 -1
  6. empathy_os/cli/commands/batch.py +256 -0
  7. empathy_os/cli/commands/cache.py +248 -0
  8. empathy_os/cli/commands/inspect.py +1 -2
  9. empathy_os/cli/commands/metrics.py +1 -1
  10. empathy_os/cli/commands/routing.py +285 -0
  11. empathy_os/cli/commands/workflow.py +2 -2
  12. empathy_os/cli/parsers/__init__.py +6 -0
  13. empathy_os/cli/parsers/batch.py +118 -0
  14. empathy_os/cli/parsers/cache.py +65 -0
  15. empathy_os/cli/parsers/routing.py +110 -0
  16. empathy_os/dashboard/standalone_server.py +22 -11
  17. empathy_os/metrics/collector.py +31 -0
  18. empathy_os/models/token_estimator.py +21 -13
  19. empathy_os/telemetry/agent_coordination.py +12 -14
  20. empathy_os/telemetry/agent_tracking.py +18 -19
  21. empathy_os/telemetry/approval_gates.py +27 -39
  22. empathy_os/telemetry/event_streaming.py +19 -19
  23. empathy_os/telemetry/feedback_loop.py +13 -16
  24. empathy_os/workflows/batch_processing.py +56 -10
  25. empathy_os/vscode_bridge 2.py +0 -173
  26. empathy_os/workflows/progressive/README 2.md +0 -454
  27. empathy_os/workflows/progressive/__init__ 2.py +0 -92
  28. empathy_os/workflows/progressive/cli 2.py +0 -242
  29. empathy_os/workflows/progressive/core 2.py +0 -488
  30. empathy_os/workflows/progressive/orchestrator 2.py +0 -701
  31. empathy_os/workflows/progressive/reports 2.py +0 -528
  32. empathy_os/workflows/progressive/telemetry 2.py +0 -280
  33. empathy_os/workflows/progressive/test_gen 2.py +0 -514
  34. empathy_os/workflows/progressive/workflow 2.py +0 -628
  35. {empathy_framework-5.0.1.dist-info → empathy_framework-5.0.3.dist-info}/WHEEL +0 -0
  36. {empathy_framework-5.0.1.dist-info → empathy_framework-5.0.3.dist-info}/entry_points.txt +0 -0
  37. {empathy_framework-5.0.1.dist-info → empathy_framework-5.0.3.dist-info}/licenses/LICENSE +0 -0
  38. {empathy_framework-5.0.1.dist-info → empathy_framework-5.0.3.dist-info}/top_level.txt +0 -0
@@ -1,242 +0,0 @@
1
- """CLI commands for progressive workflow management.
2
-
3
- Provides commands for:
4
- - Listing saved results
5
- - Viewing detailed reports
6
- - Generating analytics
7
- - Cleaning up old results
8
- """
9
-
10
- import argparse
11
- import sys
12
-
13
- from empathy_os.workflows.progressive.reports import (
14
- cleanup_old_results,
15
- format_cost_analytics_report,
16
- generate_cost_analytics,
17
- list_saved_results,
18
- load_result_from_disk,
19
- )
20
-
21
-
22
- def cmd_list_results(args: argparse.Namespace) -> int:
23
- """List all saved progressive workflow results.
24
-
25
- Args:
26
- args: Parsed command line arguments
27
-
28
- Returns:
29
- Exit code (0 for success)
30
- """
31
- storage_path = args.storage_path or ".empathy/progressive_runs"
32
- results = list_saved_results(storage_path)
33
-
34
- if not results:
35
- print(f"No results found in {storage_path}")
36
- return 0
37
-
38
- print(f"\n📋 Found {len(results)} progressive workflow results:\n")
39
- print(f"{'Task ID':<40} {'Workflow':<15} {'Cost':<10} {'Savings':<12} {'Success'}")
40
- print("─" * 90)
41
-
42
- for result in results:
43
- task_id = result.get("task_id", "unknown")
44
- workflow = result.get("workflow", "unknown")[:14]
45
- cost = result.get("total_cost", 0.0)
46
- savings = result.get("cost_savings_percent", 0.0)
47
- success = "✅" if result.get("success", False) else "❌"
48
-
49
- print(f"{task_id:<40} {workflow:<15} ${cost:<9.2f} {savings:>6.1f}% {success}")
50
-
51
- print()
52
- return 0
53
-
54
-
55
- def cmd_show_report(args: argparse.Namespace) -> int:
56
- """Show detailed report for a specific task.
57
-
58
- Args:
59
- args: Parsed command line arguments
60
-
61
- Returns:
62
- Exit code (0 for success, 1 for error)
63
- """
64
- task_id = args.task_id
65
- storage_path = args.storage_path or ".empathy/progressive_runs"
66
-
67
- try:
68
- result_data = load_result_from_disk(task_id, storage_path)
69
-
70
- if args.json:
71
- import json
72
- print(json.dumps(result_data, indent=2))
73
- else:
74
- # Show human-readable report
75
- report = result_data.get("report", "")
76
- if report:
77
- print(report)
78
- else:
79
- print("No report found for this task")
80
-
81
- return 0
82
-
83
- except FileNotFoundError as e:
84
- print(f"Error: {e}", file=sys.stderr)
85
- return 1
86
-
87
-
88
- def cmd_analytics(args: argparse.Namespace) -> int:
89
- """Show cost optimization analytics.
90
-
91
- Args:
92
- args: Parsed command line arguments
93
-
94
- Returns:
95
- Exit code (0 for success)
96
- """
97
- storage_path = args.storage_path or ".empathy/progressive_runs"
98
- analytics = generate_cost_analytics(storage_path)
99
-
100
- if analytics["total_runs"] == 0:
101
- print(f"No results found in {storage_path}")
102
- return 0
103
-
104
- if args.json:
105
- import json
106
- print(json.dumps(analytics, indent=2))
107
- else:
108
- report = format_cost_analytics_report(analytics)
109
- print(report)
110
-
111
- return 0
112
-
113
-
114
- def cmd_cleanup(args: argparse.Namespace) -> int:
115
- """Clean up old progressive workflow results.
116
-
117
- Args:
118
- args: Parsed command line arguments
119
-
120
- Returns:
121
- Exit code (0 for success)
122
- """
123
- storage_path = args.storage_path or ".empathy/progressive_runs"
124
- retention_days = args.retention_days
125
- dry_run = args.dry_run
126
-
127
- deleted, retained = cleanup_old_results(
128
- storage_path=storage_path,
129
- retention_days=retention_days,
130
- dry_run=dry_run
131
- )
132
-
133
- if dry_run:
134
- print("\n🔍 Dry run mode - no files deleted\n")
135
- print(f"Would delete: {deleted} results older than {retention_days} days")
136
- print(f"Would retain: {retained} recent results")
137
- else:
138
- print("\n🗑️ Cleanup complete\n")
139
- print(f"Deleted: {deleted} results older than {retention_days} days")
140
- print(f"Retained: {retained} recent results")
141
-
142
- return 0
143
-
144
-
145
- def create_parser() -> argparse.ArgumentParser:
146
- """Create argument parser for progressive CLI.
147
-
148
- Returns:
149
- Configured argument parser
150
- """
151
- parser = argparse.ArgumentParser(
152
- prog="empathy progressive",
153
- description="Manage progressive tier escalation workflows"
154
- )
155
-
156
- parser.add_argument(
157
- "--storage-path",
158
- type=str,
159
- default=None,
160
- help="Custom storage path (default: .empathy/progressive_runs)"
161
- )
162
-
163
- subparsers = parser.add_subparsers(dest="command", help="Available commands")
164
-
165
- # List command
166
- list_parser = subparsers.add_parser(
167
- "list",
168
- help="List all saved progressive workflow results"
169
- )
170
- list_parser.set_defaults(func=cmd_list_results)
171
-
172
- # Show command
173
- show_parser = subparsers.add_parser(
174
- "show",
175
- help="Show detailed report for a specific task"
176
- )
177
- show_parser.add_argument(
178
- "task_id",
179
- type=str,
180
- help="Task ID to display"
181
- )
182
- show_parser.add_argument(
183
- "--json",
184
- action="store_true",
185
- help="Output in JSON format"
186
- )
187
- show_parser.set_defaults(func=cmd_show_report)
188
-
189
- # Analytics command
190
- analytics_parser = subparsers.add_parser(
191
- "analytics",
192
- help="Show cost optimization analytics"
193
- )
194
- analytics_parser.add_argument(
195
- "--json",
196
- action="store_true",
197
- help="Output in JSON format"
198
- )
199
- analytics_parser.set_defaults(func=cmd_analytics)
200
-
201
- # Cleanup command
202
- cleanup_parser = subparsers.add_parser(
203
- "cleanup",
204
- help="Clean up old progressive workflow results"
205
- )
206
- cleanup_parser.add_argument(
207
- "--retention-days",
208
- type=int,
209
- default=30,
210
- help="Number of days to retain results (default: 30)"
211
- )
212
- cleanup_parser.add_argument(
213
- "--dry-run",
214
- action="store_true",
215
- help="Show what would be deleted without actually deleting"
216
- )
217
- cleanup_parser.set_defaults(func=cmd_cleanup)
218
-
219
- return parser
220
-
221
-
222
- def main(argv: list[str] | None = None) -> int:
223
- """Main entry point for progressive CLI.
224
-
225
- Args:
226
- argv: Command line arguments (defaults to sys.argv[1:])
227
-
228
- Returns:
229
- Exit code
230
- """
231
- parser = create_parser()
232
- args = parser.parse_args(argv)
233
-
234
- if not hasattr(args, "func"):
235
- parser.print_help()
236
- return 1
237
-
238
- return args.func(args)
239
-
240
-
241
- if __name__ == "__main__":
242
- sys.exit(main())