htmlgraph 0.26.5__py3-none-any.whl → 0.26.7__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 (70) hide show
  1. htmlgraph/.htmlgraph/.session-warning-state.json +1 -1
  2. htmlgraph/__init__.py +1 -1
  3. htmlgraph/api/main.py +50 -10
  4. htmlgraph/api/templates/dashboard-redesign.html +608 -54
  5. htmlgraph/api/templates/partials/activity-feed.html +21 -0
  6. htmlgraph/api/templates/partials/features.html +81 -12
  7. htmlgraph/api/templates/partials/orchestration.html +35 -0
  8. htmlgraph/cli/.htmlgraph/.session-warning-state.json +6 -0
  9. htmlgraph/cli/.htmlgraph/agents.json +72 -0
  10. htmlgraph/cli/__init__.py +42 -0
  11. htmlgraph/cli/__main__.py +6 -0
  12. htmlgraph/cli/analytics.py +939 -0
  13. htmlgraph/cli/base.py +660 -0
  14. htmlgraph/cli/constants.py +206 -0
  15. htmlgraph/cli/core.py +856 -0
  16. htmlgraph/cli/main.py +143 -0
  17. htmlgraph/cli/models.py +462 -0
  18. htmlgraph/cli/templates/__init__.py +1 -0
  19. htmlgraph/cli/templates/cost_dashboard.py +398 -0
  20. htmlgraph/cli/work/__init__.py +159 -0
  21. htmlgraph/cli/work/features.py +567 -0
  22. htmlgraph/cli/work/orchestration.py +675 -0
  23. htmlgraph/cli/work/sessions.py +465 -0
  24. htmlgraph/cli/work/tracks.py +485 -0
  25. htmlgraph/dashboard.html +6414 -634
  26. htmlgraph/db/schema.py +8 -3
  27. htmlgraph/docs/ORCHESTRATION_PATTERNS.md +20 -13
  28. htmlgraph/docs/README.md +2 -3
  29. htmlgraph/hooks/event_tracker.py +355 -26
  30. htmlgraph/hooks/git_commands.py +175 -0
  31. htmlgraph/hooks/orchestrator.py +137 -71
  32. htmlgraph/hooks/orchestrator_reflector.py +23 -0
  33. htmlgraph/hooks/pretooluse.py +29 -6
  34. htmlgraph/hooks/session_handler.py +28 -0
  35. htmlgraph/hooks/session_summary.py +391 -0
  36. htmlgraph/hooks/subagent_detection.py +202 -0
  37. htmlgraph/hooks/subagent_stop.py +71 -12
  38. htmlgraph/hooks/validator.py +192 -79
  39. htmlgraph/operations/__init__.py +18 -0
  40. htmlgraph/operations/initialization.py +596 -0
  41. htmlgraph/operations/initialization.py.backup +228 -0
  42. htmlgraph/orchestration/__init__.py +16 -1
  43. htmlgraph/orchestration/claude_launcher.py +185 -0
  44. htmlgraph/orchestration/command_builder.py +71 -0
  45. htmlgraph/orchestration/headless_spawner.py +72 -1332
  46. htmlgraph/orchestration/plugin_manager.py +136 -0
  47. htmlgraph/orchestration/prompts.py +137 -0
  48. htmlgraph/orchestration/spawners/__init__.py +16 -0
  49. htmlgraph/orchestration/spawners/base.py +194 -0
  50. htmlgraph/orchestration/spawners/claude.py +170 -0
  51. htmlgraph/orchestration/spawners/codex.py +442 -0
  52. htmlgraph/orchestration/spawners/copilot.py +299 -0
  53. htmlgraph/orchestration/spawners/gemini.py +478 -0
  54. htmlgraph/orchestration/subprocess_runner.py +33 -0
  55. htmlgraph/orchestration.md +563 -0
  56. htmlgraph/orchestrator-system-prompt-optimized.txt +620 -55
  57. htmlgraph/orchestrator_config.py +357 -0
  58. htmlgraph/orchestrator_mode.py +45 -12
  59. htmlgraph/transcript.py +16 -4
  60. htmlgraph-0.26.7.data/data/htmlgraph/dashboard.html +6592 -0
  61. {htmlgraph-0.26.5.dist-info → htmlgraph-0.26.7.dist-info}/METADATA +1 -1
  62. {htmlgraph-0.26.5.dist-info → htmlgraph-0.26.7.dist-info}/RECORD +68 -34
  63. {htmlgraph-0.26.5.dist-info → htmlgraph-0.26.7.dist-info}/entry_points.txt +1 -1
  64. htmlgraph/cli.py +0 -7256
  65. htmlgraph-0.26.5.data/data/htmlgraph/dashboard.html +0 -812
  66. {htmlgraph-0.26.5.data → htmlgraph-0.26.7.data}/data/htmlgraph/styles.css +0 -0
  67. {htmlgraph-0.26.5.data → htmlgraph-0.26.7.data}/data/htmlgraph/templates/AGENTS.md.template +0 -0
  68. {htmlgraph-0.26.5.data → htmlgraph-0.26.7.data}/data/htmlgraph/templates/CLAUDE.md.template +0 -0
  69. {htmlgraph-0.26.5.data → htmlgraph-0.26.7.data}/data/htmlgraph/templates/GEMINI.md.template +0 -0
  70. {htmlgraph-0.26.5.dist-info → htmlgraph-0.26.7.dist-info}/WHEEL +0 -0
@@ -0,0 +1,206 @@
1
+ """CLI constants and configuration - Single Source of Truth.
2
+
3
+ Define all constants, defaults, and configuration values here.
4
+ Never hardcode these values elsewhere in the CLI code.
5
+ """
6
+
7
+ from pathlib import Path
8
+
9
+ # ============================================================================
10
+ # Directory and Path Constants
11
+ # ============================================================================
12
+
13
+ DEFAULT_GRAPH_DIR = ".htmlgraph"
14
+ DEFAULT_DATABASE_NAME = "htmlgraph.db"
15
+ DEFAULT_ANALYTICS_CACHE_NAME = "index.sqlite"
16
+
17
+ # Plugin paths (relative to project root)
18
+ PLUGIN_DIR_NAME = ".claude-plugin"
19
+ PLUGIN_SOURCE_DIR = "packages/claude-plugin/.claude-plugin"
20
+
21
+ # ============================================================================
22
+ # Server Configuration
23
+ # ============================================================================
24
+
25
+ DEFAULT_SERVER_HOST = "0.0.0.0"
26
+ DEFAULT_SERVER_PORT = 8080
27
+ SERVER_AUTO_PORT_RANGE = (8080, 8180) # Try ports in this range if default taken
28
+
29
+ # ============================================================================
30
+ # Session Configuration
31
+ # ============================================================================
32
+
33
+ DEFAULT_SESSION_RETENTION_DAYS = 30
34
+ DEFAULT_MAX_SESSIONS = 100
35
+ DEFAULT_AUTO_ARCHIVE = True
36
+
37
+ # ============================================================================
38
+ # Output Format Configuration
39
+ # ============================================================================
40
+
41
+ OUTPUT_FORMATS = ["json", "text", "plain"]
42
+ DEFAULT_OUTPUT_FORMAT = "text"
43
+
44
+ # ============================================================================
45
+ # Work Item Limits
46
+ # ============================================================================
47
+
48
+ WIP_LIMIT_DEFAULT = 3 # Max concurrent work items
49
+ WIP_LIMIT_FEATURES = 3
50
+ WIP_LIMIT_SPIKES = 5
51
+ WIP_LIMIT_BUGS = 5
52
+
53
+ # ============================================================================
54
+ # Claude Integration
55
+ # ============================================================================
56
+
57
+ CLAUDE_BINARY_NAME = "claude"
58
+ CLAUDE_CODE_DOCS_URL = "https://code.claude.com"
59
+
60
+ # Orchestrator modes
61
+ CLAUDE_MODE_INIT = "init"
62
+ CLAUDE_MODE_CONTINUE = "continue"
63
+ CLAUDE_MODE_DEV = "dev"
64
+ CLAUDE_MODE_DEFAULT = "default"
65
+
66
+ # System prompt files (relative to package root)
67
+ ORCHESTRATOR_PROMPT_FILE = "orchestrator-system-prompt-optimized.txt"
68
+ ORCHESTRATION_RULES_FILE = "orchestration.md"
69
+
70
+ # ============================================================================
71
+ # Error Messages (Single Source of Truth)
72
+ # ============================================================================
73
+
74
+ ERROR_MESSAGES = {
75
+ "missing_graph_dir": "Error: .htmlgraph directory not found: {path}",
76
+ "missing_claude_cli": "Error: 'claude' command not found.\nPlease install Claude Code CLI: https://code.claude.com",
77
+ "missing_plugin_dir": "Error: Plugin directory not found: {path}\nExpected location: packages/claude-plugin/.claude-plugin",
78
+ "invalid_format": "Error: Unknown output format '{format}'. Valid: {valid_formats}",
79
+ "wip_limit_reached": "WIP limit ({limit}) reached. Complete existing work first.",
80
+ "feature_not_found": "Error: Feature not found: {feature_id}",
81
+ "session_not_found": "Error: Session not found: {session_id}",
82
+ "track_not_found": "Error: Track not found: {track_id}",
83
+ }
84
+
85
+ # ============================================================================
86
+ # Success Messages
87
+ # ============================================================================
88
+
89
+ SUCCESS_MESSAGES = {
90
+ "feature_created": "✓ Created feature: {feature_id}",
91
+ "feature_started": "✓ Started feature: {feature_id}",
92
+ "feature_completed": "✓ Completed feature: {feature_id}",
93
+ "session_started": "✓ Started session: {session_id}",
94
+ "session_ended": "✓ Ended session: {session_id}",
95
+ "track_created": "✓ Created track: {track_id}",
96
+ "server_started": "✓ Server started: {url}",
97
+ }
98
+
99
+ # ============================================================================
100
+ # Rich Console Styles (Single Source of Truth)
101
+ # ============================================================================
102
+
103
+ CONSOLE_STYLES = {
104
+ "success": "[green]",
105
+ "error": "[red]",
106
+ "warning": "[yellow]",
107
+ "info": "[cyan]",
108
+ "dim": "[dim]",
109
+ "bold": "[bold]",
110
+ "id": "[cyan]",
111
+ "title": "[yellow]",
112
+ "status": "[blue]",
113
+ "path": "[dim]",
114
+ }
115
+
116
+ # ============================================================================
117
+ # Collection Names
118
+ # ============================================================================
119
+
120
+ COLLECTIONS = [
121
+ "features",
122
+ "bugs",
123
+ "spikes",
124
+ "chores",
125
+ "epics",
126
+ "sessions",
127
+ "agents",
128
+ "tracks",
129
+ "task-delegations",
130
+ ]
131
+
132
+ # ============================================================================
133
+ # Feature Priorities
134
+ # ============================================================================
135
+
136
+ FEATURE_PRIORITIES = ["low", "medium", "high", "critical"]
137
+ DEFAULT_FEATURE_PRIORITY = "medium"
138
+
139
+ # ============================================================================
140
+ # Session Status Values
141
+ # ============================================================================
142
+
143
+ SESSION_STATUS_ACTIVE = "active"
144
+ SESSION_STATUS_ENDED = "ended"
145
+ SESSION_STATUS_ARCHIVED = "archived"
146
+
147
+ # ============================================================================
148
+ # Feature Status Values
149
+ # ============================================================================
150
+
151
+ FEATURE_STATUS_TODO = "todo"
152
+ FEATURE_STATUS_IN_PROGRESS = "in_progress"
153
+ FEATURE_STATUS_COMPLETED = "completed"
154
+ FEATURE_STATUS_BLOCKED = "blocked"
155
+
156
+ # ============================================================================
157
+ # Timeout Configuration
158
+ # ============================================================================
159
+
160
+ DEFAULT_TIMEOUT_SECONDS = 120
161
+ LONG_RUNNING_TIMEOUT_SECONDS = 600 # 10 minutes
162
+
163
+ # ============================================================================
164
+ # Helper Functions
165
+ # ============================================================================
166
+
167
+
168
+ def get_error_message(key: str, **kwargs: str) -> str:
169
+ """Get error message template and format with kwargs.
170
+
171
+ Usage:
172
+ msg = get_error_message('missing_graph_dir', path='/path/to/dir')
173
+ """
174
+ template = ERROR_MESSAGES.get(key, "Error: {key}")
175
+ return template.format(**kwargs)
176
+
177
+
178
+ def get_success_message(key: str, **kwargs: str) -> str:
179
+ """Get success message template and format with kwargs.
180
+
181
+ Usage:
182
+ msg = get_success_message('feature_created', feature_id='feat-123')
183
+ """
184
+ template = SUCCESS_MESSAGES.get(key, "Success")
185
+ return template.format(**kwargs)
186
+
187
+
188
+ def get_style(key: str) -> str:
189
+ """Get Rich console style by key.
190
+
191
+ Usage:
192
+ style = get_style('success') # Returns "[green]"
193
+ """
194
+ return CONSOLE_STYLES.get(key, "")
195
+
196
+
197
+ def get_plugin_dir(project_root: Path | str) -> Path:
198
+ """Get plugin directory path from project root.
199
+
200
+ Args:
201
+ project_root: Project root directory
202
+
203
+ Returns:
204
+ Path to plugin directory
205
+ """
206
+ return Path(project_root) / PLUGIN_SOURCE_DIR