htmlgraph 0.9.3__py3-none-any.whl → 0.27.5__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.
- htmlgraph/.htmlgraph/.session-warning-state.json +6 -0
- htmlgraph/.htmlgraph/agents.json +72 -0
- htmlgraph/.htmlgraph/htmlgraph.db +0 -0
- htmlgraph/__init__.py +173 -17
- htmlgraph/__init__.pyi +123 -0
- htmlgraph/agent_detection.py +127 -0
- htmlgraph/agent_registry.py +45 -30
- htmlgraph/agents.py +160 -107
- htmlgraph/analytics/__init__.py +9 -2
- htmlgraph/analytics/cli.py +190 -51
- htmlgraph/analytics/cost_analyzer.py +391 -0
- htmlgraph/analytics/cost_monitor.py +664 -0
- htmlgraph/analytics/cost_reporter.py +675 -0
- htmlgraph/analytics/cross_session.py +617 -0
- htmlgraph/analytics/dependency.py +192 -100
- htmlgraph/analytics/pattern_learning.py +771 -0
- htmlgraph/analytics/session_graph.py +707 -0
- htmlgraph/analytics/strategic/__init__.py +80 -0
- htmlgraph/analytics/strategic/cost_optimizer.py +611 -0
- htmlgraph/analytics/strategic/pattern_detector.py +876 -0
- htmlgraph/analytics/strategic/preference_manager.py +709 -0
- htmlgraph/analytics/strategic/suggestion_engine.py +747 -0
- htmlgraph/analytics/work_type.py +190 -14
- htmlgraph/analytics_index.py +135 -51
- htmlgraph/api/__init__.py +3 -0
- htmlgraph/api/cost_alerts_websocket.py +416 -0
- htmlgraph/api/main.py +2498 -0
- htmlgraph/api/static/htmx.min.js +1 -0
- htmlgraph/api/static/style-redesign.css +1344 -0
- htmlgraph/api/static/style.css +1079 -0
- htmlgraph/api/templates/dashboard-redesign.html +1366 -0
- htmlgraph/api/templates/dashboard.html +794 -0
- htmlgraph/api/templates/partials/activity-feed-hierarchical.html +326 -0
- htmlgraph/api/templates/partials/activity-feed.html +1100 -0
- htmlgraph/api/templates/partials/agents-redesign.html +317 -0
- htmlgraph/api/templates/partials/agents.html +317 -0
- htmlgraph/api/templates/partials/event-traces.html +373 -0
- htmlgraph/api/templates/partials/features-kanban-redesign.html +509 -0
- htmlgraph/api/templates/partials/features.html +578 -0
- htmlgraph/api/templates/partials/metrics-redesign.html +346 -0
- htmlgraph/api/templates/partials/metrics.html +346 -0
- htmlgraph/api/templates/partials/orchestration-redesign.html +443 -0
- htmlgraph/api/templates/partials/orchestration.html +198 -0
- htmlgraph/api/templates/partials/spawners.html +375 -0
- htmlgraph/api/templates/partials/work-items.html +613 -0
- htmlgraph/api/websocket.py +538 -0
- htmlgraph/archive/__init__.py +24 -0
- htmlgraph/archive/bloom.py +234 -0
- htmlgraph/archive/fts.py +297 -0
- htmlgraph/archive/manager.py +583 -0
- htmlgraph/archive/search.py +244 -0
- htmlgraph/atomic_ops.py +560 -0
- htmlgraph/attribute_index.py +208 -0
- htmlgraph/bounded_paths.py +539 -0
- htmlgraph/builders/__init__.py +14 -0
- htmlgraph/builders/base.py +118 -29
- htmlgraph/builders/bug.py +150 -0
- htmlgraph/builders/chore.py +119 -0
- htmlgraph/builders/epic.py +150 -0
- htmlgraph/builders/feature.py +31 -6
- htmlgraph/builders/insight.py +195 -0
- htmlgraph/builders/metric.py +217 -0
- htmlgraph/builders/pattern.py +202 -0
- htmlgraph/builders/phase.py +162 -0
- htmlgraph/builders/spike.py +52 -19
- htmlgraph/builders/track.py +148 -72
- htmlgraph/cigs/__init__.py +81 -0
- htmlgraph/cigs/autonomy.py +385 -0
- htmlgraph/cigs/cost.py +475 -0
- htmlgraph/cigs/messages_basic.py +472 -0
- htmlgraph/cigs/messaging.py +365 -0
- htmlgraph/cigs/models.py +771 -0
- htmlgraph/cigs/pattern_storage.py +427 -0
- htmlgraph/cigs/patterns.py +503 -0
- htmlgraph/cigs/posttool_analyzer.py +234 -0
- htmlgraph/cigs/reporter.py +818 -0
- htmlgraph/cigs/tracker.py +317 -0
- htmlgraph/cli/.htmlgraph/.session-warning-state.json +6 -0
- htmlgraph/cli/.htmlgraph/agents.json +72 -0
- htmlgraph/cli/.htmlgraph/htmlgraph.db +0 -0
- htmlgraph/cli/__init__.py +42 -0
- htmlgraph/cli/__main__.py +6 -0
- htmlgraph/cli/analytics.py +1424 -0
- htmlgraph/cli/base.py +685 -0
- htmlgraph/cli/constants.py +206 -0
- htmlgraph/cli/core.py +954 -0
- htmlgraph/cli/main.py +147 -0
- htmlgraph/cli/models.py +475 -0
- htmlgraph/cli/templates/__init__.py +1 -0
- htmlgraph/cli/templates/cost_dashboard.py +399 -0
- htmlgraph/cli/work/__init__.py +239 -0
- htmlgraph/cli/work/browse.py +115 -0
- htmlgraph/cli/work/features.py +568 -0
- htmlgraph/cli/work/orchestration.py +676 -0
- htmlgraph/cli/work/report.py +728 -0
- htmlgraph/cli/work/sessions.py +466 -0
- htmlgraph/cli/work/snapshot.py +559 -0
- htmlgraph/cli/work/tracks.py +486 -0
- htmlgraph/cli_commands/__init__.py +1 -0
- htmlgraph/cli_commands/feature.py +195 -0
- htmlgraph/cli_framework.py +115 -0
- htmlgraph/collections/__init__.py +18 -0
- htmlgraph/collections/base.py +415 -98
- htmlgraph/collections/bug.py +53 -0
- htmlgraph/collections/chore.py +53 -0
- htmlgraph/collections/epic.py +53 -0
- htmlgraph/collections/feature.py +12 -26
- htmlgraph/collections/insight.py +100 -0
- htmlgraph/collections/metric.py +92 -0
- htmlgraph/collections/pattern.py +97 -0
- htmlgraph/collections/phase.py +53 -0
- htmlgraph/collections/session.py +194 -0
- htmlgraph/collections/spike.py +56 -16
- htmlgraph/collections/task_delegation.py +241 -0
- htmlgraph/collections/todo.py +511 -0
- htmlgraph/collections/traces.py +487 -0
- htmlgraph/config/cost_models.json +56 -0
- htmlgraph/config.py +190 -0
- htmlgraph/context_analytics.py +344 -0
- htmlgraph/converter.py +216 -28
- htmlgraph/cost_analysis/__init__.py +5 -0
- htmlgraph/cost_analysis/analyzer.py +438 -0
- htmlgraph/dashboard.html +2406 -307
- htmlgraph/dashboard.html.backup +6592 -0
- htmlgraph/dashboard.html.bak +7181 -0
- htmlgraph/dashboard.html.bak2 +7231 -0
- htmlgraph/dashboard.html.bak3 +7232 -0
- htmlgraph/db/__init__.py +38 -0
- htmlgraph/db/queries.py +790 -0
- htmlgraph/db/schema.py +1788 -0
- htmlgraph/decorators.py +317 -0
- htmlgraph/dependency_models.py +19 -2
- htmlgraph/deploy.py +142 -125
- htmlgraph/deployment_models.py +474 -0
- htmlgraph/docs/API_REFERENCE.md +841 -0
- htmlgraph/docs/HTTP_API.md +750 -0
- htmlgraph/docs/INTEGRATION_GUIDE.md +752 -0
- htmlgraph/docs/ORCHESTRATION_PATTERNS.md +717 -0
- htmlgraph/docs/README.md +532 -0
- htmlgraph/docs/__init__.py +77 -0
- htmlgraph/docs/docs_version.py +55 -0
- htmlgraph/docs/metadata.py +93 -0
- htmlgraph/docs/migrations.py +232 -0
- htmlgraph/docs/template_engine.py +143 -0
- htmlgraph/docs/templates/_sections/cli_reference.md.j2 +52 -0
- htmlgraph/docs/templates/_sections/core_concepts.md.j2 +29 -0
- htmlgraph/docs/templates/_sections/sdk_basics.md.j2 +69 -0
- htmlgraph/docs/templates/base_agents.md.j2 +78 -0
- htmlgraph/docs/templates/example_user_override.md.j2 +47 -0
- htmlgraph/docs/version_check.py +163 -0
- htmlgraph/edge_index.py +182 -27
- htmlgraph/error_handler.py +544 -0
- htmlgraph/event_log.py +100 -52
- htmlgraph/event_migration.py +13 -4
- htmlgraph/exceptions.py +49 -0
- htmlgraph/file_watcher.py +101 -28
- htmlgraph/find_api.py +75 -63
- htmlgraph/git_events.py +145 -63
- htmlgraph/graph.py +1122 -106
- htmlgraph/hooks/.htmlgraph/.session-warning-state.json +6 -0
- htmlgraph/hooks/.htmlgraph/agents.json +72 -0
- htmlgraph/hooks/.htmlgraph/index.sqlite +0 -0
- htmlgraph/hooks/__init__.py +45 -0
- htmlgraph/hooks/bootstrap.py +169 -0
- htmlgraph/hooks/cigs_pretool_enforcer.py +354 -0
- htmlgraph/hooks/concurrent_sessions.py +208 -0
- htmlgraph/hooks/context.py +350 -0
- htmlgraph/hooks/drift_handler.py +525 -0
- htmlgraph/hooks/event_tracker.py +1314 -0
- htmlgraph/hooks/git_commands.py +175 -0
- htmlgraph/hooks/hooks-config.example.json +12 -0
- htmlgraph/hooks/installer.py +343 -0
- htmlgraph/hooks/orchestrator.py +674 -0
- htmlgraph/hooks/orchestrator_reflector.py +223 -0
- htmlgraph/hooks/post-checkout.sh +28 -0
- htmlgraph/hooks/post-commit.sh +24 -0
- htmlgraph/hooks/post-merge.sh +26 -0
- htmlgraph/hooks/post_tool_use_failure.py +273 -0
- htmlgraph/hooks/post_tool_use_handler.py +257 -0
- htmlgraph/hooks/posttooluse.py +408 -0
- htmlgraph/hooks/pre-commit.sh +94 -0
- htmlgraph/hooks/pre-push.sh +28 -0
- htmlgraph/hooks/pretooluse.py +819 -0
- htmlgraph/hooks/prompt_analyzer.py +637 -0
- htmlgraph/hooks/session_handler.py +668 -0
- htmlgraph/hooks/session_summary.py +395 -0
- htmlgraph/hooks/state_manager.py +504 -0
- htmlgraph/hooks/subagent_detection.py +202 -0
- htmlgraph/hooks/subagent_stop.py +369 -0
- htmlgraph/hooks/task_enforcer.py +255 -0
- htmlgraph/hooks/task_validator.py +177 -0
- htmlgraph/hooks/validator.py +628 -0
- htmlgraph/ids.py +41 -27
- htmlgraph/index.d.ts +286 -0
- htmlgraph/learning.py +767 -0
- htmlgraph/mcp_server.py +69 -23
- htmlgraph/models.py +1586 -87
- htmlgraph/operations/README.md +62 -0
- htmlgraph/operations/__init__.py +79 -0
- htmlgraph/operations/analytics.py +339 -0
- htmlgraph/operations/bootstrap.py +289 -0
- htmlgraph/operations/events.py +244 -0
- htmlgraph/operations/fastapi_server.py +231 -0
- htmlgraph/operations/hooks.py +350 -0
- htmlgraph/operations/initialization.py +597 -0
- htmlgraph/operations/initialization.py.backup +228 -0
- htmlgraph/operations/server.py +303 -0
- htmlgraph/orchestration/__init__.py +58 -0
- htmlgraph/orchestration/claude_launcher.py +179 -0
- htmlgraph/orchestration/command_builder.py +72 -0
- htmlgraph/orchestration/headless_spawner.py +281 -0
- htmlgraph/orchestration/live_events.py +377 -0
- htmlgraph/orchestration/model_selection.py +327 -0
- htmlgraph/orchestration/plugin_manager.py +140 -0
- htmlgraph/orchestration/prompts.py +137 -0
- htmlgraph/orchestration/spawner_event_tracker.py +383 -0
- htmlgraph/orchestration/spawners/__init__.py +16 -0
- htmlgraph/orchestration/spawners/base.py +194 -0
- htmlgraph/orchestration/spawners/claude.py +173 -0
- htmlgraph/orchestration/spawners/codex.py +435 -0
- htmlgraph/orchestration/spawners/copilot.py +294 -0
- htmlgraph/orchestration/spawners/gemini.py +471 -0
- htmlgraph/orchestration/subprocess_runner.py +36 -0
- htmlgraph/orchestration/task_coordination.py +343 -0
- htmlgraph/orchestration.md +563 -0
- htmlgraph/orchestrator-system-prompt-optimized.txt +863 -0
- htmlgraph/orchestrator.py +669 -0
- htmlgraph/orchestrator_config.py +357 -0
- htmlgraph/orchestrator_mode.py +328 -0
- htmlgraph/orchestrator_validator.py +133 -0
- htmlgraph/parallel.py +646 -0
- htmlgraph/parser.py +160 -35
- htmlgraph/path_query.py +608 -0
- htmlgraph/pattern_matcher.py +636 -0
- htmlgraph/planning.py +147 -52
- htmlgraph/pydantic_models.py +476 -0
- htmlgraph/quality_gates.py +350 -0
- htmlgraph/query_builder.py +109 -72
- htmlgraph/query_composer.py +509 -0
- htmlgraph/reflection.py +443 -0
- htmlgraph/refs.py +344 -0
- htmlgraph/repo_hash.py +512 -0
- htmlgraph/repositories/__init__.py +292 -0
- htmlgraph/repositories/analytics_repository.py +455 -0
- htmlgraph/repositories/analytics_repository_standard.py +628 -0
- htmlgraph/repositories/feature_repository.py +581 -0
- htmlgraph/repositories/feature_repository_htmlfile.py +668 -0
- htmlgraph/repositories/feature_repository_memory.py +607 -0
- htmlgraph/repositories/feature_repository_sqlite.py +858 -0
- htmlgraph/repositories/filter_service.py +620 -0
- htmlgraph/repositories/filter_service_standard.py +445 -0
- htmlgraph/repositories/shared_cache.py +621 -0
- htmlgraph/repositories/shared_cache_memory.py +395 -0
- htmlgraph/repositories/track_repository.py +552 -0
- htmlgraph/repositories/track_repository_htmlfile.py +619 -0
- htmlgraph/repositories/track_repository_memory.py +508 -0
- htmlgraph/repositories/track_repository_sqlite.py +711 -0
- htmlgraph/routing.py +8 -19
- htmlgraph/scripts/deploy.py +1 -2
- htmlgraph/sdk/__init__.py +398 -0
- htmlgraph/sdk/__init__.pyi +14 -0
- htmlgraph/sdk/analytics/__init__.py +19 -0
- htmlgraph/sdk/analytics/engine.py +155 -0
- htmlgraph/sdk/analytics/helpers.py +178 -0
- htmlgraph/sdk/analytics/registry.py +109 -0
- htmlgraph/sdk/base.py +484 -0
- htmlgraph/sdk/constants.py +216 -0
- htmlgraph/sdk/core.pyi +308 -0
- htmlgraph/sdk/discovery.py +120 -0
- htmlgraph/sdk/help/__init__.py +12 -0
- htmlgraph/sdk/help/mixin.py +699 -0
- htmlgraph/sdk/mixins/__init__.py +15 -0
- htmlgraph/sdk/mixins/attribution.py +113 -0
- htmlgraph/sdk/mixins/mixin.py +410 -0
- htmlgraph/sdk/operations/__init__.py +12 -0
- htmlgraph/sdk/operations/mixin.py +427 -0
- htmlgraph/sdk/orchestration/__init__.py +17 -0
- htmlgraph/sdk/orchestration/coordinator.py +203 -0
- htmlgraph/sdk/orchestration/spawner.py +204 -0
- htmlgraph/sdk/planning/__init__.py +19 -0
- htmlgraph/sdk/planning/bottlenecks.py +93 -0
- htmlgraph/sdk/planning/mixin.py +211 -0
- htmlgraph/sdk/planning/parallel.py +186 -0
- htmlgraph/sdk/planning/queue.py +210 -0
- htmlgraph/sdk/planning/recommendations.py +87 -0
- htmlgraph/sdk/planning/smart_planning.py +319 -0
- htmlgraph/sdk/session/__init__.py +19 -0
- htmlgraph/sdk/session/continuity.py +57 -0
- htmlgraph/sdk/session/handoff.py +110 -0
- htmlgraph/sdk/session/info.py +309 -0
- htmlgraph/sdk/session/manager.py +103 -0
- htmlgraph/sdk/strategic/__init__.py +26 -0
- htmlgraph/sdk/strategic/mixin.py +563 -0
- htmlgraph/server.py +685 -180
- htmlgraph/services/__init__.py +10 -0
- htmlgraph/services/claiming.py +199 -0
- htmlgraph/session_hooks.py +300 -0
- htmlgraph/session_manager.py +1392 -175
- htmlgraph/session_registry.py +587 -0
- htmlgraph/session_state.py +436 -0
- htmlgraph/session_warning.py +201 -0
- htmlgraph/sessions/__init__.py +23 -0
- htmlgraph/sessions/handoff.py +756 -0
- htmlgraph/setup.py +34 -17
- htmlgraph/spike_index.py +143 -0
- htmlgraph/sync_docs.py +12 -15
- htmlgraph/system_prompts.py +450 -0
- htmlgraph/templates/AGENTS.md.template +366 -0
- htmlgraph/templates/CLAUDE.md.template +97 -0
- htmlgraph/templates/GEMINI.md.template +87 -0
- htmlgraph/templates/orchestration-view.html +350 -0
- htmlgraph/track_builder.py +146 -15
- htmlgraph/track_manager.py +69 -21
- htmlgraph/transcript.py +890 -0
- htmlgraph/transcript_analytics.py +699 -0
- htmlgraph/types.py +323 -0
- htmlgraph/validation.py +115 -0
- htmlgraph/watch.py +8 -5
- htmlgraph/work_type_utils.py +3 -2
- {htmlgraph-0.9.3.data → htmlgraph-0.27.5.data}/data/htmlgraph/dashboard.html +2406 -307
- htmlgraph-0.27.5.data/data/htmlgraph/templates/AGENTS.md.template +366 -0
- htmlgraph-0.27.5.data/data/htmlgraph/templates/CLAUDE.md.template +97 -0
- htmlgraph-0.27.5.data/data/htmlgraph/templates/GEMINI.md.template +87 -0
- {htmlgraph-0.9.3.dist-info → htmlgraph-0.27.5.dist-info}/METADATA +97 -64
- htmlgraph-0.27.5.dist-info/RECORD +337 -0
- {htmlgraph-0.9.3.dist-info → htmlgraph-0.27.5.dist-info}/entry_points.txt +1 -1
- htmlgraph/cli.py +0 -2688
- htmlgraph/sdk.py +0 -709
- htmlgraph-0.9.3.dist-info/RECORD +0 -61
- {htmlgraph-0.9.3.data → htmlgraph-0.27.5.data}/data/htmlgraph/styles.css +0 -0
- {htmlgraph-0.9.3.dist-info → htmlgraph-0.27.5.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Documentation metadata storage and management.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from datetime import datetime
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
from pydantic import BaseModel, Field
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class DocsMetadata(BaseModel):
|
|
12
|
+
"""Metadata for project documentation."""
|
|
13
|
+
|
|
14
|
+
schema_version: int = 2
|
|
15
|
+
last_updated: datetime = Field(default_factory=datetime.now)
|
|
16
|
+
customizations: list[str] = [] # List of user-customized sections
|
|
17
|
+
base_version_on_last_update: str = "0.21.0"
|
|
18
|
+
|
|
19
|
+
@classmethod
|
|
20
|
+
def load(cls, htmlgraph_dir: Path) -> "DocsMetadata":
|
|
21
|
+
"""Load metadata from .docs-metadata.json.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
htmlgraph_dir: Path to .htmlgraph directory
|
|
25
|
+
|
|
26
|
+
Returns:
|
|
27
|
+
DocsMetadata instance (default if file doesn't exist)
|
|
28
|
+
"""
|
|
29
|
+
import json
|
|
30
|
+
|
|
31
|
+
metadata_file = htmlgraph_dir / ".docs-metadata.json"
|
|
32
|
+
if metadata_file.exists():
|
|
33
|
+
data = json.loads(metadata_file.read_text())
|
|
34
|
+
return cls(**data)
|
|
35
|
+
return cls() # Default
|
|
36
|
+
|
|
37
|
+
def save(self, htmlgraph_dir: Path) -> None:
|
|
38
|
+
"""Save metadata to .docs-metadata.json.
|
|
39
|
+
|
|
40
|
+
Args:
|
|
41
|
+
htmlgraph_dir: Path to .htmlgraph directory
|
|
42
|
+
"""
|
|
43
|
+
metadata_file = htmlgraph_dir / ".docs-metadata.json"
|
|
44
|
+
metadata_file.write_text(self.model_dump_json(indent=2))
|
|
45
|
+
|
|
46
|
+
@classmethod
|
|
47
|
+
def create_initial(
|
|
48
|
+
cls, htmlgraph_dir: Path, schema_version: int = 2
|
|
49
|
+
) -> "DocsMetadata":
|
|
50
|
+
"""Create initial metadata file.
|
|
51
|
+
|
|
52
|
+
Args:
|
|
53
|
+
htmlgraph_dir: Path to .htmlgraph directory
|
|
54
|
+
schema_version: Documentation schema version
|
|
55
|
+
|
|
56
|
+
Returns:
|
|
57
|
+
New DocsMetadata instance
|
|
58
|
+
"""
|
|
59
|
+
from htmlgraph import __version__
|
|
60
|
+
|
|
61
|
+
metadata = cls(
|
|
62
|
+
schema_version=schema_version,
|
|
63
|
+
base_version_on_last_update=__version__,
|
|
64
|
+
customizations=[],
|
|
65
|
+
)
|
|
66
|
+
metadata.save(htmlgraph_dir)
|
|
67
|
+
return metadata
|
|
68
|
+
|
|
69
|
+
def add_customization(self, section_name: str) -> None:
|
|
70
|
+
"""Mark a section as customized.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
section_name: Name of the customized section
|
|
74
|
+
"""
|
|
75
|
+
if section_name not in self.customizations:
|
|
76
|
+
self.customizations.append(section_name)
|
|
77
|
+
|
|
78
|
+
def remove_customization(self, section_name: str) -> None:
|
|
79
|
+
"""Remove a customization marker.
|
|
80
|
+
|
|
81
|
+
Args:
|
|
82
|
+
section_name: Name of the section to unmark
|
|
83
|
+
"""
|
|
84
|
+
if section_name in self.customizations:
|
|
85
|
+
self.customizations.remove(section_name)
|
|
86
|
+
|
|
87
|
+
def has_customizations(self) -> bool:
|
|
88
|
+
"""Check if any customizations exist.
|
|
89
|
+
|
|
90
|
+
Returns:
|
|
91
|
+
True if user has customized documentation
|
|
92
|
+
"""
|
|
93
|
+
return len(self.customizations) > 0
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Documentation migration system.
|
|
3
|
+
|
|
4
|
+
Handles version migrations with automatic customization preservation.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import shutil
|
|
8
|
+
from abc import ABC, abstractmethod
|
|
9
|
+
from datetime import datetime
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
from htmlgraph.docs.metadata import DocsMetadata
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class MigrationScript(ABC):
|
|
16
|
+
"""Base class for documentation migrations."""
|
|
17
|
+
|
|
18
|
+
from_version: int
|
|
19
|
+
to_version: int
|
|
20
|
+
|
|
21
|
+
@abstractmethod
|
|
22
|
+
def migrate(self, htmlgraph_dir: Path, backup_dir: Path) -> bool:
|
|
23
|
+
"""Execute migration. Returns True if successful.
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
htmlgraph_dir: Path to .htmlgraph directory
|
|
27
|
+
backup_dir: Path to backup directory
|
|
28
|
+
|
|
29
|
+
Returns:
|
|
30
|
+
True if migration successful
|
|
31
|
+
"""
|
|
32
|
+
pass
|
|
33
|
+
|
|
34
|
+
@abstractmethod
|
|
35
|
+
def rollback(self, htmlgraph_dir: Path, backup_dir: Path) -> None:
|
|
36
|
+
"""Rollback migration to previous state.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
htmlgraph_dir: Path to .htmlgraph directory
|
|
40
|
+
backup_dir: Path to backup directory
|
|
41
|
+
"""
|
|
42
|
+
pass
|
|
43
|
+
|
|
44
|
+
def backup_docs(self, htmlgraph_dir: Path, backup_dir: Path) -> Path:
|
|
45
|
+
"""Backup current documentation before migration.
|
|
46
|
+
|
|
47
|
+
Args:
|
|
48
|
+
htmlgraph_dir: Path to .htmlgraph directory
|
|
49
|
+
backup_dir: Path to backup directory
|
|
50
|
+
|
|
51
|
+
Returns:
|
|
52
|
+
Path to created backup subdirectory
|
|
53
|
+
"""
|
|
54
|
+
backup_subdir = (
|
|
55
|
+
backup_dir / f"v{self.from_version}_{datetime.now():%Y%m%d_%H%M%S}"
|
|
56
|
+
)
|
|
57
|
+
backup_subdir.mkdir(parents=True, exist_ok=True)
|
|
58
|
+
|
|
59
|
+
# Backup all docs
|
|
60
|
+
docs_dir = htmlgraph_dir / "docs"
|
|
61
|
+
if docs_dir.exists():
|
|
62
|
+
for doc_file in docs_dir.glob("*.md"):
|
|
63
|
+
shutil.copy2(doc_file, backup_subdir / doc_file.name)
|
|
64
|
+
|
|
65
|
+
# Also backup root-level docs (legacy)
|
|
66
|
+
for doc_file in htmlgraph_dir.glob("*.md"):
|
|
67
|
+
shutil.copy2(doc_file, backup_subdir / doc_file.name)
|
|
68
|
+
|
|
69
|
+
return backup_subdir
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class V1toV2Migration(MigrationScript):
|
|
73
|
+
"""Migrate from v1 (root-level docs) to v2 (template-based docs)."""
|
|
74
|
+
|
|
75
|
+
from_version = 1
|
|
76
|
+
to_version = 2
|
|
77
|
+
|
|
78
|
+
def migrate(self, htmlgraph_dir: Path, backup_dir: Path) -> bool:
|
|
79
|
+
"""Migrate v1 docs to v2 template structure.
|
|
80
|
+
|
|
81
|
+
Args:
|
|
82
|
+
htmlgraph_dir: Path to .htmlgraph directory
|
|
83
|
+
backup_dir: Path to backup directory
|
|
84
|
+
|
|
85
|
+
Returns:
|
|
86
|
+
True if migration successful
|
|
87
|
+
"""
|
|
88
|
+
# Backup first
|
|
89
|
+
backup_path = self.backup_docs(htmlgraph_dir, backup_dir)
|
|
90
|
+
print(f"✅ Backed up to {backup_path}")
|
|
91
|
+
|
|
92
|
+
# Detect user customizations in old AGENTS.md
|
|
93
|
+
customizations = self._detect_customizations(htmlgraph_dir / "AGENTS.md")
|
|
94
|
+
if customizations:
|
|
95
|
+
print(f"📝 Detected customizations: {', '.join(customizations)}")
|
|
96
|
+
|
|
97
|
+
# Move old docs to archive
|
|
98
|
+
old_agents_md = htmlgraph_dir / "AGENTS.md"
|
|
99
|
+
if old_agents_md.exists():
|
|
100
|
+
old_agents_md.rename(htmlgraph_dir / "AGENTS.md.v1.backup")
|
|
101
|
+
print("📦 Archived old AGENTS.md")
|
|
102
|
+
|
|
103
|
+
# Generate new v2 docs with customizations preserved
|
|
104
|
+
self._generate_v2_docs(htmlgraph_dir, customizations)
|
|
105
|
+
print("✨ Generated v2 documentation")
|
|
106
|
+
|
|
107
|
+
# Update metadata
|
|
108
|
+
metadata = DocsMetadata.load(htmlgraph_dir)
|
|
109
|
+
metadata.schema_version = 2
|
|
110
|
+
metadata.customizations = customizations
|
|
111
|
+
metadata.save(htmlgraph_dir)
|
|
112
|
+
print("💾 Updated metadata")
|
|
113
|
+
|
|
114
|
+
return True
|
|
115
|
+
|
|
116
|
+
def _detect_customizations(self, agents_md_path: Path) -> list[str]:
|
|
117
|
+
"""Detect user-customized sections in old AGENTS.md.
|
|
118
|
+
|
|
119
|
+
Args:
|
|
120
|
+
agents_md_path: Path to AGENTS.md file
|
|
121
|
+
|
|
122
|
+
Returns:
|
|
123
|
+
List of customized section names
|
|
124
|
+
"""
|
|
125
|
+
if not agents_md_path.exists():
|
|
126
|
+
return []
|
|
127
|
+
|
|
128
|
+
content = agents_md_path.read_text()
|
|
129
|
+
customizations = []
|
|
130
|
+
|
|
131
|
+
# Simple heuristic: sections not in base template
|
|
132
|
+
if "## Our Team" in content:
|
|
133
|
+
customizations.append("custom_workflows")
|
|
134
|
+
if "## Project Conventions" in content:
|
|
135
|
+
customizations.append("project_conventions")
|
|
136
|
+
if "## Custom Workflows" in content:
|
|
137
|
+
customizations.append("custom_workflows")
|
|
138
|
+
|
|
139
|
+
return customizations
|
|
140
|
+
|
|
141
|
+
def _generate_v2_docs(self, htmlgraph_dir: Path, customizations: list[str]) -> None:
|
|
142
|
+
"""Generate v2 template-based docs with customizations.
|
|
143
|
+
|
|
144
|
+
Args:
|
|
145
|
+
htmlgraph_dir: Path to .htmlgraph directory
|
|
146
|
+
customizations: List of customized sections to preserve
|
|
147
|
+
"""
|
|
148
|
+
# NOTE: This would integrate with sync_docs.py
|
|
149
|
+
# For now, just create placeholder
|
|
150
|
+
docs_dir = htmlgraph_dir / "docs"
|
|
151
|
+
docs_dir.mkdir(exist_ok=True)
|
|
152
|
+
|
|
153
|
+
placeholder = docs_dir / "AGENTS.md"
|
|
154
|
+
placeholder.write_text(
|
|
155
|
+
"""# HtmlGraph Agent Documentation (v2)
|
|
156
|
+
|
|
157
|
+
This file was migrated from v1 to v2.
|
|
158
|
+
|
|
159
|
+
Run `uv run htmlgraph sync-docs` to regenerate from templates.
|
|
160
|
+
"""
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
# Inject customizations as template overrides if needed
|
|
164
|
+
if customizations:
|
|
165
|
+
self._create_override_template(htmlgraph_dir, customizations)
|
|
166
|
+
|
|
167
|
+
def _create_override_template(
|
|
168
|
+
self, htmlgraph_dir: Path, customizations: list[str]
|
|
169
|
+
) -> None:
|
|
170
|
+
"""Create template overrides for customizations.
|
|
171
|
+
|
|
172
|
+
Args:
|
|
173
|
+
htmlgraph_dir: Path to .htmlgraph directory
|
|
174
|
+
customizations: List of customizations to preserve
|
|
175
|
+
"""
|
|
176
|
+
overrides_file = htmlgraph_dir / "docs" / "overrides.md"
|
|
177
|
+
overrides_file.write_text(
|
|
178
|
+
f"""# Documentation Customizations
|
|
179
|
+
|
|
180
|
+
The following sections were customized in v1:
|
|
181
|
+
|
|
182
|
+
{chr(10).join(f"- {c}" for c in customizations)}
|
|
183
|
+
|
|
184
|
+
To preserve these customizations, add them back manually after running sync-docs.
|
|
185
|
+
"""
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
def rollback(self, htmlgraph_dir: Path, backup_dir: Path) -> None:
|
|
189
|
+
"""Rollback to v1 docs from backup.
|
|
190
|
+
|
|
191
|
+
Args:
|
|
192
|
+
htmlgraph_dir: Path to .htmlgraph directory
|
|
193
|
+
backup_dir: Path to backup directory
|
|
194
|
+
"""
|
|
195
|
+
# Find latest backup
|
|
196
|
+
backups = sorted(backup_dir.glob("v1_*"))
|
|
197
|
+
if not backups:
|
|
198
|
+
raise ValueError("No backup found for rollback")
|
|
199
|
+
|
|
200
|
+
latest_backup = backups[-1]
|
|
201
|
+
print(f"🔄 Rolling back from {latest_backup}")
|
|
202
|
+
|
|
203
|
+
# Restore old AGENTS.md
|
|
204
|
+
backup_agents = latest_backup / "AGENTS.md"
|
|
205
|
+
if backup_agents.exists():
|
|
206
|
+
shutil.copy2(backup_agents, htmlgraph_dir / "AGENTS.md")
|
|
207
|
+
print("✅ Restored AGENTS.md")
|
|
208
|
+
|
|
209
|
+
# Update metadata
|
|
210
|
+
metadata = DocsMetadata.load(htmlgraph_dir)
|
|
211
|
+
metadata.schema_version = 1
|
|
212
|
+
metadata.save(htmlgraph_dir)
|
|
213
|
+
print("💾 Updated metadata to v1")
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
# Migration registry
|
|
217
|
+
MIGRATIONS: dict[tuple[int, int], MigrationScript] = {
|
|
218
|
+
(1, 2): V1toV2Migration(),
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
def get_migration(from_version: int, to_version: int) -> MigrationScript | None:
|
|
223
|
+
"""Get migration script for version transition.
|
|
224
|
+
|
|
225
|
+
Args:
|
|
226
|
+
from_version: Source schema version
|
|
227
|
+
to_version: Target schema version
|
|
228
|
+
|
|
229
|
+
Returns:
|
|
230
|
+
MigrationScript instance or None if no migration exists
|
|
231
|
+
"""
|
|
232
|
+
return MIGRATIONS.get((from_version, to_version))
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"""Jinja2-based template engine for documentation with user customization."""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
from jinja2 import ChoiceLoader, Environment, FileSystemLoader
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DocTemplateEngine:
|
|
11
|
+
"""Renders documentation templates with user customization support.
|
|
12
|
+
|
|
13
|
+
Template Priority:
|
|
14
|
+
1. User templates in .htmlgraph/docs/templates/ (highest priority)
|
|
15
|
+
2. Package templates in htmlgraph/docs/templates/ (fallback)
|
|
16
|
+
|
|
17
|
+
Example:
|
|
18
|
+
>>> engine = DocTemplateEngine(Path(".htmlgraph"))
|
|
19
|
+
>>> content = engine.render_agents_md("0.21.0", "claude")
|
|
20
|
+
>>> print(content)
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
def __init__(self, htmlgraph_dir: Path):
|
|
24
|
+
"""Initialize template engine with multi-loader.
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
htmlgraph_dir: Path to .htmlgraph directory
|
|
28
|
+
"""
|
|
29
|
+
# Package templates (bundled with pip install)
|
|
30
|
+
package_templates = Path(__file__).parent / "templates"
|
|
31
|
+
|
|
32
|
+
# User templates (project-specific customizations)
|
|
33
|
+
user_templates = htmlgraph_dir / "docs" / "templates"
|
|
34
|
+
|
|
35
|
+
# Multi-loader: User templates have priority over package templates
|
|
36
|
+
loaders = []
|
|
37
|
+
if user_templates.exists():
|
|
38
|
+
loaders.append(FileSystemLoader(str(user_templates)))
|
|
39
|
+
loaders.append(FileSystemLoader(str(package_templates)))
|
|
40
|
+
|
|
41
|
+
self.env = Environment(loader=ChoiceLoader(loaders))
|
|
42
|
+
|
|
43
|
+
# Add custom filters
|
|
44
|
+
self.env.filters["format_date"] = self._format_date
|
|
45
|
+
self.env.filters["highlight_code"] = self._highlight_code
|
|
46
|
+
|
|
47
|
+
def render(self, template_name: str, context: dict[str, Any]) -> str:
|
|
48
|
+
"""Render template with context, merging user overrides.
|
|
49
|
+
|
|
50
|
+
Args:
|
|
51
|
+
template_name: Name of template file (e.g., "agents.md.j2")
|
|
52
|
+
context: Template variables
|
|
53
|
+
|
|
54
|
+
Returns:
|
|
55
|
+
Rendered content with user customizations applied
|
|
56
|
+
|
|
57
|
+
Example:
|
|
58
|
+
>>> engine.render("agents.md.j2", {"platform": "claude"})
|
|
59
|
+
"""
|
|
60
|
+
template = self.env.get_template(template_name)
|
|
61
|
+
return template.render(**context)
|
|
62
|
+
|
|
63
|
+
def render_agents_md(self, sdk_version: str, platform: str = "claude") -> str:
|
|
64
|
+
"""Render AGENTS.md with platform-specific customizations.
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
sdk_version: HtmlGraph SDK version (e.g., "0.21.0")
|
|
68
|
+
platform: Platform name (claude, gemini, api, etc.)
|
|
69
|
+
|
|
70
|
+
Returns:
|
|
71
|
+
Rendered AGENTS.md content
|
|
72
|
+
|
|
73
|
+
Example:
|
|
74
|
+
>>> content = engine.render_agents_md("0.21.0", "claude")
|
|
75
|
+
"""
|
|
76
|
+
context = {
|
|
77
|
+
"sdk_version": sdk_version,
|
|
78
|
+
"platform": platform,
|
|
79
|
+
"features_enabled": self._get_enabled_features(),
|
|
80
|
+
"custom_workflows": self._load_custom_workflows(),
|
|
81
|
+
"generated_at": datetime.now().isoformat(),
|
|
82
|
+
}
|
|
83
|
+
# User templates should extend "base_agents.md.j2" to avoid recursion
|
|
84
|
+
# Priority: agents.md.j2 (user override) → base_agents.md.j2 (package default)
|
|
85
|
+
template_name = "agents.md.j2"
|
|
86
|
+
try:
|
|
87
|
+
# Try to get user template first (will succeed if it exists in user dir)
|
|
88
|
+
self.env.get_template(template_name)
|
|
89
|
+
return self.render(template_name, context)
|
|
90
|
+
except: # noqa
|
|
91
|
+
# Fall back to base template (always exists in package)
|
|
92
|
+
return self.render("base_agents.md.j2", context)
|
|
93
|
+
|
|
94
|
+
def _format_date(self, value: str) -> str:
|
|
95
|
+
"""Format ISO date string for display.
|
|
96
|
+
|
|
97
|
+
Args:
|
|
98
|
+
value: ISO 8601 date string
|
|
99
|
+
|
|
100
|
+
Returns:
|
|
101
|
+
Formatted date string
|
|
102
|
+
"""
|
|
103
|
+
try:
|
|
104
|
+
dt = datetime.fromisoformat(value)
|
|
105
|
+
return dt.strftime("%Y-%m-%d %H:%M")
|
|
106
|
+
except (ValueError, AttributeError):
|
|
107
|
+
return value
|
|
108
|
+
|
|
109
|
+
def _highlight_code(self, code: str, language: str = "python") -> str:
|
|
110
|
+
"""Add markdown code fence with syntax highlighting.
|
|
111
|
+
|
|
112
|
+
Args:
|
|
113
|
+
code: Code snippet
|
|
114
|
+
language: Programming language for syntax highlighting
|
|
115
|
+
|
|
116
|
+
Returns:
|
|
117
|
+
Markdown code block
|
|
118
|
+
"""
|
|
119
|
+
return f"```{language}\n{code}\n```"
|
|
120
|
+
|
|
121
|
+
def _get_enabled_features(self) -> dict[str, bool]:
|
|
122
|
+
"""Get enabled features for this installation.
|
|
123
|
+
|
|
124
|
+
Returns:
|
|
125
|
+
Dictionary of feature flags
|
|
126
|
+
"""
|
|
127
|
+
# TODO: Read from config or detect dynamically
|
|
128
|
+
return {
|
|
129
|
+
"sessions": True,
|
|
130
|
+
"tracks": True,
|
|
131
|
+
"analytics": True,
|
|
132
|
+
"mcp": True,
|
|
133
|
+
"cli": True,
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
def _load_custom_workflows(self) -> str | None:
|
|
137
|
+
"""Load custom workflows from user template.
|
|
138
|
+
|
|
139
|
+
Returns:
|
|
140
|
+
Custom workflow markdown or None
|
|
141
|
+
"""
|
|
142
|
+
# TODO: Load from .htmlgraph/docs/workflows.md if exists
|
|
143
|
+
return None
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
## CLI Reference
|
|
2
|
+
|
|
3
|
+
### Installation
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
pip install htmlgraph
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
### Basic Commands
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Initialize project
|
|
13
|
+
htmlgraph init
|
|
14
|
+
|
|
15
|
+
# Create work items
|
|
16
|
+
htmlgraph feature create "Add authentication"
|
|
17
|
+
htmlgraph bug create "Fix login redirect"
|
|
18
|
+
htmlgraph spike create "Research OAuth providers"
|
|
19
|
+
|
|
20
|
+
# List work items
|
|
21
|
+
htmlgraph feature list
|
|
22
|
+
htmlgraph status
|
|
23
|
+
|
|
24
|
+
# Start MCP server
|
|
25
|
+
htmlgraph mcp
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Session Management
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# List sessions
|
|
32
|
+
htmlgraph session list
|
|
33
|
+
|
|
34
|
+
# Show active sessions
|
|
35
|
+
htmlgraph session list --active
|
|
36
|
+
|
|
37
|
+
# Link session to work item
|
|
38
|
+
htmlgraph session link <session-id> <feature-id>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Documentation
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Generate documentation
|
|
45
|
+
htmlgraph docs generate --platform {{ platform }}
|
|
46
|
+
|
|
47
|
+
# Sync documentation files
|
|
48
|
+
htmlgraph sync-docs
|
|
49
|
+
|
|
50
|
+
# Validate documentation
|
|
51
|
+
htmlgraph docs validate
|
|
52
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
## Core Concepts
|
|
2
|
+
|
|
3
|
+
### Graph Structure
|
|
4
|
+
|
|
5
|
+
HtmlGraph uses HTML files as graph nodes and hyperlinks as edges:
|
|
6
|
+
|
|
7
|
+
- **Nodes**: HTML files with `data-*` attributes
|
|
8
|
+
- **Edges**: `<a href>` links between files
|
|
9
|
+
- **Properties**: `data-*` attributes on elements
|
|
10
|
+
- **Query Language**: CSS selectors
|
|
11
|
+
|
|
12
|
+
### Work Item Types
|
|
13
|
+
|
|
14
|
+
HtmlGraph supports multiple work item types:
|
|
15
|
+
|
|
16
|
+
1. **Features** - New capabilities or enhancements
|
|
17
|
+
2. **Bugs** - Issues to fix
|
|
18
|
+
3. **Spikes** - Research or investigation tasks
|
|
19
|
+
4. **Chores** - Maintenance and refactoring
|
|
20
|
+
5. **Tracks** - Multi-feature initiatives
|
|
21
|
+
|
|
22
|
+
### Session Tracking
|
|
23
|
+
|
|
24
|
+
HtmlGraph automatically tracks agent sessions via git hooks:
|
|
25
|
+
|
|
26
|
+
- Session start/end detection
|
|
27
|
+
- Work item linking
|
|
28
|
+
- Event logging
|
|
29
|
+
- Transcript capture
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
## SDK Reference
|
|
2
|
+
|
|
3
|
+
### SDK Initialization
|
|
4
|
+
|
|
5
|
+
```python
|
|
6
|
+
from htmlgraph import SDK
|
|
7
|
+
|
|
8
|
+
# Initialize with agent name
|
|
9
|
+
sdk = SDK(agent="{{ platform }}")
|
|
10
|
+
|
|
11
|
+
# Access collections
|
|
12
|
+
features = sdk.features
|
|
13
|
+
bugs = sdk.bugs
|
|
14
|
+
spikes = sdk.spikes
|
|
15
|
+
tracks = sdk.tracks
|
|
16
|
+
sessions = sdk.sessions
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Features API
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
# Create feature
|
|
23
|
+
feature = sdk.features.create("Add authentication") \
|
|
24
|
+
.set_priority("high") \
|
|
25
|
+
.set_status("in-progress") \
|
|
26
|
+
.add_steps([
|
|
27
|
+
"Setup OAuth provider",
|
|
28
|
+
"Implement JWT tokens",
|
|
29
|
+
"Add session management"
|
|
30
|
+
]) \
|
|
31
|
+
.save()
|
|
32
|
+
|
|
33
|
+
# Update feature
|
|
34
|
+
feature = sdk.features.get(feature.id) \
|
|
35
|
+
.complete_step(0) \
|
|
36
|
+
.save()
|
|
37
|
+
|
|
38
|
+
# List features
|
|
39
|
+
all_features = sdk.features.list()
|
|
40
|
+
high_priority = sdk.features.filter(priority="high")
|
|
41
|
+
in_progress = sdk.features.filter(status="in-progress")
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Tracks API
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
# Create track
|
|
48
|
+
track = sdk.tracks.create("Authentication System") \
|
|
49
|
+
.set_priority("high") \
|
|
50
|
+
.add_feature(feature.id) \
|
|
51
|
+
.save()
|
|
52
|
+
|
|
53
|
+
# Get track progress
|
|
54
|
+
progress = track.get_progress()
|
|
55
|
+
print(f"Completion: {progress['completion_percentage']}%")
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Analytics
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
# Get strategic recommendations
|
|
62
|
+
next_work = sdk.analytics.recommend_next_work(limit=5)
|
|
63
|
+
|
|
64
|
+
# Find bottlenecks
|
|
65
|
+
bottlenecks = sdk.analytics.find_bottlenecks()
|
|
66
|
+
|
|
67
|
+
# Get summary
|
|
68
|
+
summary = sdk.summary()
|
|
69
|
+
```
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{# Base template for AGENTS.md - Package provides this #}
|
|
2
|
+
---
|
|
3
|
+
version: "{{ sdk_version }}"
|
|
4
|
+
platform: "{{ platform }}"
|
|
5
|
+
generated: "{{ generated_at }}"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
{% block header %}
|
|
9
|
+
# HtmlGraph Agent Documentation
|
|
10
|
+
{% endblock %}
|
|
11
|
+
|
|
12
|
+
{% block introduction %}
|
|
13
|
+
## Introduction
|
|
14
|
+
|
|
15
|
+
HtmlGraph is a lightweight graph database framework built entirely on web standards (HTML, CSS, JavaScript) for AI agent coordination and human observability.
|
|
16
|
+
|
|
17
|
+
**Tagline**: "HTML is All You Need"
|
|
18
|
+
{% endblock %}
|
|
19
|
+
|
|
20
|
+
{% block quick_start %}
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
from htmlgraph import SDK
|
|
25
|
+
|
|
26
|
+
# Initialize SDK for your agent
|
|
27
|
+
sdk = SDK(agent="{{ platform }}")
|
|
28
|
+
|
|
29
|
+
# Create a feature
|
|
30
|
+
feature = sdk.features.create("Add authentication") \
|
|
31
|
+
.set_priority("high") \
|
|
32
|
+
.add_steps(["Setup OAuth", "Add JWT", "Test login"]) \
|
|
33
|
+
.save()
|
|
34
|
+
|
|
35
|
+
# Track progress
|
|
36
|
+
sdk.features.get(feature.id).complete_step(0).save()
|
|
37
|
+
```
|
|
38
|
+
{% endblock %}
|
|
39
|
+
|
|
40
|
+
{% block core_concepts %}
|
|
41
|
+
{% include "_sections/core_concepts.md.j2" %}
|
|
42
|
+
{% endblock %}
|
|
43
|
+
|
|
44
|
+
{% block sdk_reference %}
|
|
45
|
+
{% include "_sections/sdk_basics.md.j2" %}
|
|
46
|
+
{% endblock %}
|
|
47
|
+
|
|
48
|
+
{% block cli_reference %}
|
|
49
|
+
{% include "_sections/cli_reference.md.j2" %}
|
|
50
|
+
{% endblock %}
|
|
51
|
+
|
|
52
|
+
{% block custom_workflows %}
|
|
53
|
+
{# Users can override this block in .htmlgraph/docs/templates/agents.md.j2 #}
|
|
54
|
+
{% if custom_workflows %}
|
|
55
|
+
## Custom Workflows
|
|
56
|
+
|
|
57
|
+
{{ custom_workflows }}
|
|
58
|
+
{% endif %}
|
|
59
|
+
{% endblock %}
|
|
60
|
+
|
|
61
|
+
{% block deployment %}
|
|
62
|
+
## Deployment
|
|
63
|
+
|
|
64
|
+
For deployment instructions, see the deployment guide:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Build and publish package
|
|
68
|
+
./scripts/deploy-all.sh 0.21.0 --no-confirm
|
|
69
|
+
|
|
70
|
+
# Documentation changes only
|
|
71
|
+
./scripts/deploy-all.sh --docs-only
|
|
72
|
+
```
|
|
73
|
+
{% endblock %}
|
|
74
|
+
|
|
75
|
+
{% block footer %}
|
|
76
|
+
---
|
|
77
|
+
*Generated by HtmlGraph v{{ sdk_version }} on {{ generated_at }}*
|
|
78
|
+
{% endblock %}
|