htmlgraph 0.24.1__py3-none-any.whl → 0.25.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 (103) hide show
  1. htmlgraph/__init__.py +20 -1
  2. htmlgraph/agent_detection.py +26 -10
  3. htmlgraph/analytics/cross_session.py +4 -3
  4. htmlgraph/analytics/work_type.py +52 -16
  5. htmlgraph/analytics_index.py +51 -19
  6. htmlgraph/api/__init__.py +3 -0
  7. htmlgraph/api/main.py +2115 -0
  8. htmlgraph/api/static/htmx.min.js +1 -0
  9. htmlgraph/api/static/style-redesign.css +1344 -0
  10. htmlgraph/api/static/style.css +1079 -0
  11. htmlgraph/api/templates/dashboard-redesign.html +812 -0
  12. htmlgraph/api/templates/dashboard.html +783 -0
  13. htmlgraph/api/templates/partials/activity-feed-hierarchical.html +326 -0
  14. htmlgraph/api/templates/partials/activity-feed.html +570 -0
  15. htmlgraph/api/templates/partials/agents-redesign.html +317 -0
  16. htmlgraph/api/templates/partials/agents.html +317 -0
  17. htmlgraph/api/templates/partials/event-traces.html +373 -0
  18. htmlgraph/api/templates/partials/features-kanban-redesign.html +509 -0
  19. htmlgraph/api/templates/partials/features.html +509 -0
  20. htmlgraph/api/templates/partials/metrics-redesign.html +346 -0
  21. htmlgraph/api/templates/partials/metrics.html +346 -0
  22. htmlgraph/api/templates/partials/orchestration-redesign.html +443 -0
  23. htmlgraph/api/templates/partials/orchestration.html +163 -0
  24. htmlgraph/api/templates/partials/spawners.html +375 -0
  25. htmlgraph/atomic_ops.py +560 -0
  26. htmlgraph/builders/base.py +55 -1
  27. htmlgraph/builders/bug.py +17 -2
  28. htmlgraph/builders/chore.py +17 -2
  29. htmlgraph/builders/epic.py +17 -2
  30. htmlgraph/builders/feature.py +25 -2
  31. htmlgraph/builders/phase.py +17 -2
  32. htmlgraph/builders/spike.py +27 -2
  33. htmlgraph/builders/track.py +14 -0
  34. htmlgraph/cigs/__init__.py +4 -0
  35. htmlgraph/cigs/reporter.py +818 -0
  36. htmlgraph/cli.py +1427 -401
  37. htmlgraph/cli_commands/__init__.py +1 -0
  38. htmlgraph/cli_commands/feature.py +195 -0
  39. htmlgraph/cli_framework.py +115 -0
  40. htmlgraph/collections/__init__.py +2 -0
  41. htmlgraph/collections/base.py +21 -0
  42. htmlgraph/collections/session.py +189 -0
  43. htmlgraph/collections/spike.py +7 -1
  44. htmlgraph/collections/task_delegation.py +236 -0
  45. htmlgraph/collections/traces.py +482 -0
  46. htmlgraph/config.py +113 -0
  47. htmlgraph/converter.py +41 -0
  48. htmlgraph/cost_analysis/__init__.py +5 -0
  49. htmlgraph/cost_analysis/analyzer.py +438 -0
  50. htmlgraph/dashboard.html +3315 -492
  51. htmlgraph-0.24.1.data/data/htmlgraph/dashboard.html → htmlgraph/dashboard.html.backup +2246 -248
  52. htmlgraph/dashboard.html.bak +7181 -0
  53. htmlgraph/dashboard.html.bak2 +7231 -0
  54. htmlgraph/dashboard.html.bak3 +7232 -0
  55. htmlgraph/db/__init__.py +38 -0
  56. htmlgraph/db/queries.py +790 -0
  57. htmlgraph/db/schema.py +1334 -0
  58. htmlgraph/deploy.py +26 -27
  59. htmlgraph/docs/API_REFERENCE.md +841 -0
  60. htmlgraph/docs/HTTP_API.md +750 -0
  61. htmlgraph/docs/INTEGRATION_GUIDE.md +752 -0
  62. htmlgraph/docs/ORCHESTRATION_PATTERNS.md +710 -0
  63. htmlgraph/docs/README.md +533 -0
  64. htmlgraph/docs/version_check.py +3 -1
  65. htmlgraph/error_handler.py +544 -0
  66. htmlgraph/event_log.py +2 -0
  67. htmlgraph/hooks/__init__.py +8 -0
  68. htmlgraph/hooks/bootstrap.py +169 -0
  69. htmlgraph/hooks/context.py +271 -0
  70. htmlgraph/hooks/drift_handler.py +521 -0
  71. htmlgraph/hooks/event_tracker.py +405 -15
  72. htmlgraph/hooks/post_tool_use_handler.py +257 -0
  73. htmlgraph/hooks/pretooluse.py +476 -6
  74. htmlgraph/hooks/prompt_analyzer.py +648 -0
  75. htmlgraph/hooks/session_handler.py +583 -0
  76. htmlgraph/hooks/state_manager.py +501 -0
  77. htmlgraph/hooks/subagent_stop.py +309 -0
  78. htmlgraph/hooks/task_enforcer.py +39 -0
  79. htmlgraph/models.py +111 -15
  80. htmlgraph/operations/fastapi_server.py +230 -0
  81. htmlgraph/orchestration/headless_spawner.py +22 -14
  82. htmlgraph/pydantic_models.py +476 -0
  83. htmlgraph/quality_gates.py +350 -0
  84. htmlgraph/repo_hash.py +511 -0
  85. htmlgraph/sdk.py +348 -10
  86. htmlgraph/server.py +194 -0
  87. htmlgraph/session_hooks.py +300 -0
  88. htmlgraph/session_manager.py +131 -1
  89. htmlgraph/session_registry.py +587 -0
  90. htmlgraph/session_state.py +436 -0
  91. htmlgraph/system_prompts.py +449 -0
  92. htmlgraph/templates/orchestration-view.html +350 -0
  93. htmlgraph/track_builder.py +19 -0
  94. htmlgraph/validation.py +115 -0
  95. htmlgraph-0.25.0.data/data/htmlgraph/dashboard.html +7417 -0
  96. {htmlgraph-0.24.1.dist-info → htmlgraph-0.25.0.dist-info}/METADATA +91 -64
  97. {htmlgraph-0.24.1.dist-info → htmlgraph-0.25.0.dist-info}/RECORD +103 -42
  98. {htmlgraph-0.24.1.data → htmlgraph-0.25.0.data}/data/htmlgraph/styles.css +0 -0
  99. {htmlgraph-0.24.1.data → htmlgraph-0.25.0.data}/data/htmlgraph/templates/AGENTS.md.template +0 -0
  100. {htmlgraph-0.24.1.data → htmlgraph-0.25.0.data}/data/htmlgraph/templates/CLAUDE.md.template +0 -0
  101. {htmlgraph-0.24.1.data → htmlgraph-0.25.0.data}/data/htmlgraph/templates/GEMINI.md.template +0 -0
  102. {htmlgraph-0.24.1.dist-info → htmlgraph-0.25.0.dist-info}/WHEEL +0 -0
  103. {htmlgraph-0.24.1.dist-info → htmlgraph-0.25.0.dist-info}/entry_points.txt +0 -0
htmlgraph/deploy.py CHANGED
@@ -16,14 +16,11 @@ from dataclasses import dataclass, field
16
16
  from pathlib import Path
17
17
  from typing import cast
18
18
 
19
+ from rich.console import Console
20
+ from rich.prompt import Confirm
19
21
 
20
- # ANSI color codes
21
- class Colors:
22
- RED = "\033[0;31m"
23
- GREEN = "\033[0;32m"
24
- YELLOW = "\033[1;33m"
25
- BLUE = "\033[0;34m"
26
- NC = "\033[0m" # No Color
22
+ # Global Rich Console for beautiful CLI output
23
+ console = Console()
27
24
 
28
25
 
29
26
  @dataclass
@@ -157,27 +154,25 @@ class Deployer:
157
154
 
158
155
  def log_section(self, message: str) -> None:
159
156
  """Log a section header."""
160
- print()
161
- print(f"{Colors.BLUE}{'=' * 60}{Colors.NC}")
162
- print(f"{Colors.BLUE}{message}{Colors.NC}")
163
- print(f"{Colors.BLUE}{'=' * 60}{Colors.NC}")
164
- print()
157
+ console.print()
158
+ console.print(f"[bold blue]{message}[/bold blue]")
159
+ console.print()
165
160
 
166
161
  def log_success(self, message: str) -> None:
167
162
  """Log a success message."""
168
- print(f"{Colors.GREEN}✅ {message}{Colors.NC}")
163
+ console.print(f"[green]✅ {message}[/green]")
169
164
 
170
165
  def log_error(self, message: str) -> None:
171
166
  """Log an error message."""
172
- print(f"{Colors.RED}❌ {message}{Colors.NC}")
167
+ console.print(f"[red]❌ {message}[/red]")
173
168
 
174
169
  def log_warning(self, message: str) -> None:
175
170
  """Log a warning message."""
176
- print(f"{Colors.YELLOW}⚠️ {message}{Colors.NC}")
171
+ console.print(f"[yellow]⚠️ {message}[/yellow]")
177
172
 
178
173
  def log_info(self, message: str) -> None:
179
174
  """Log an info message."""
180
- print(f"ℹ️ {message}")
175
+ console.print(f"[cyan]ℹ️ {message}[/cyan]")
181
176
 
182
177
  def run_command(
183
178
  self,
@@ -205,7 +200,8 @@ class Deployer:
205
200
  except subprocess.CalledProcessError as e:
206
201
  self.log_error(f"Command failed: {' '.join(cmd)}")
207
202
  if e.stderr:
208
- print(e.stderr, file=sys.stderr)
203
+ # Print error to stderr using console (Rich supports stderr output)
204
+ console.print(e.stderr, style="red")
209
205
  raise
210
206
 
211
207
  def run_hook(self, hook_commands: list[str], hook_name: str) -> None:
@@ -242,8 +238,7 @@ class Deployer:
242
238
  if result.returncode != 0:
243
239
  self.log_warning("You have uncommitted changes")
244
240
  if not self.dry_run:
245
- response = input("Continue anyway? (y/n) ")
246
- if response.lower() != "y":
241
+ if not Confirm.ask("Continue anyway?", default=False):
247
242
  sys.exit(1)
248
243
 
249
244
  # Push to remote
@@ -286,7 +281,7 @@ class Deployer:
286
281
  if dist_dir.exists():
287
282
  self.log_info("Build artifacts:")
288
283
  for file in dist_dir.iterdir():
289
- print(f" - {file.name}")
284
+ console.print(f"[dim] - {file.name}[/dim]")
290
285
 
291
286
  def _step_pypi_publish(self) -> None:
292
287
  """Publish to PyPI."""
@@ -324,8 +319,7 @@ class Deployer:
324
319
  f"PyPI token not found (looking for {token_var} or UV_PUBLISH_TOKEN)"
325
320
  )
326
321
  if not self.dry_run:
327
- response = input("Continue anyway? (y/n) ")
328
- if response.lower() != "y":
322
+ if not Confirm.ask("Continue anyway?", default=False):
329
323
  sys.exit(1)
330
324
 
331
325
  # Publish
@@ -464,7 +458,7 @@ class Deployer:
464
458
  # Summary
465
459
  self.log_section("Deployment Complete! 🎉")
466
460
  self.log_success("All deployment steps completed successfully!")
467
- print()
461
+ console.print()
468
462
 
469
463
 
470
464
  def create_deployment_config_template(output_path: Path) -> None:
@@ -526,7 +520,12 @@ post_publish = []
526
520
  """
527
521
 
528
522
  output_path.write_text(template)
529
- print(f"✅ Created deployment config template: {output_path}")
530
- print("\nNext steps:")
531
- print("1. Edit htmlgraph-deploy.toml to customize your deployment")
532
- print("2. Run: htmlgraph deploy run")
523
+ console.print(
524
+ f"[green]✅ Created deployment config template: {output_path}[/green]"
525
+ )
526
+ console.print()
527
+ console.print("[bold cyan]Next steps:[/bold cyan]")
528
+ console.print(
529
+ "[dim]1. Edit htmlgraph-deploy.toml to customize your deployment[/dim]"
530
+ )
531
+ console.print("[dim]2. Run: htmlgraph deploy run[/dim]")