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
htmlgraph/docs/README.md
ADDED
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
# HtmlGraph API Documentation
|
|
2
|
+
|
|
3
|
+
Complete developer documentation for HtmlGraph SDK, HTTP API, and orchestration patterns.
|
|
4
|
+
|
|
5
|
+
## Quick Navigation
|
|
6
|
+
|
|
7
|
+
### For First-Time Users
|
|
8
|
+
Start here for a quick introduction and working examples.
|
|
9
|
+
|
|
10
|
+
**→ [Integration Guide](INTEGRATION_GUIDE.md)** - 5-minute quick start
|
|
11
|
+
- Installation and setup
|
|
12
|
+
- Common patterns (5 minutes to first feature)
|
|
13
|
+
- Complete example applications
|
|
14
|
+
- Troubleshooting guide
|
|
15
|
+
|
|
16
|
+
### For SDK Developers
|
|
17
|
+
Complete reference for Python SDK with code examples for every method.
|
|
18
|
+
|
|
19
|
+
**→ [SDK API Reference](API_REFERENCE.md)** - Comprehensive Python API
|
|
20
|
+
- SDK initialization
|
|
21
|
+
- All collection methods (create, get, all, where, edit, delete)
|
|
22
|
+
- Builder pattern for fluent API
|
|
23
|
+
- Query builder for complex searches
|
|
24
|
+
- Analytics and dependency analysis
|
|
25
|
+
- System prompt management
|
|
26
|
+
- Task delegation
|
|
27
|
+
- Error handling patterns
|
|
28
|
+
- 800+ lines of examples
|
|
29
|
+
|
|
30
|
+
### For HTTP Integration
|
|
31
|
+
REST API documentation for external service integration.
|
|
32
|
+
|
|
33
|
+
**→ [HTTP API Reference](HTTP_API.md)** - REST endpoint documentation
|
|
34
|
+
- Server startup
|
|
35
|
+
- All endpoints (/api/features, /api/bugs, /api/tasks, etc.)
|
|
36
|
+
- Request/response formats with examples
|
|
37
|
+
- Query parameters and filtering
|
|
38
|
+
- Status codes and error responses
|
|
39
|
+
- Pagination
|
|
40
|
+
- Complete curl examples
|
|
41
|
+
|
|
42
|
+
### For Multi-Agent Workflows
|
|
43
|
+
Guide to spawning agents, delegating tasks, and coordinating work.
|
|
44
|
+
|
|
45
|
+
**→ [Orchestration Patterns](ORCHESTRATION_PATTERNS.md)** - Agent coordination guide
|
|
46
|
+
- Agent spawning (Claude, Gemini, Codex, Copilot)
|
|
47
|
+
- Task delegation and tracking
|
|
48
|
+
- Model selection strategy
|
|
49
|
+
- Cost optimization
|
|
50
|
+
- Advanced patterns (chain-of-thought, feedback loops, consensus)
|
|
51
|
+
- Error recovery and fallback patterns
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Documentation Overview
|
|
56
|
+
|
|
57
|
+
| Document | Purpose | Audience | Time |
|
|
58
|
+
|----------|---------|----------|------|
|
|
59
|
+
| [Integration Guide](INTEGRATION_GUIDE.md) | Quick start and common patterns | All developers | 5 min |
|
|
60
|
+
| [SDK API Reference](API_REFERENCE.md) | Complete Python SDK documentation | Python developers | 30 min |
|
|
61
|
+
| [HTTP API Reference](HTTP_API.md) | REST endpoint reference | Integration engineers | 20 min |
|
|
62
|
+
| [Orchestration Patterns](ORCHESTRATION_PATTERNS.md) | Multi-agent workflows | Advanced users | 30 min |
|
|
63
|
+
|
|
64
|
+
**Total Documentation:** ~3,000 lines of comprehensive guides with 150+ code examples
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Key Features Documented
|
|
69
|
+
|
|
70
|
+
### SDK Features
|
|
71
|
+
- Auto-discovery of .htmlgraph directory
|
|
72
|
+
- Fluent builder interface for all work items
|
|
73
|
+
- Collections: Features, Bugs, Spikes, Chores, Epics, Phases, Sessions, Tracks
|
|
74
|
+
- Query builder for complex searches
|
|
75
|
+
- Analytics: Work distribution, bottleneck analysis, parallelizable work
|
|
76
|
+
- Dependency analysis: Blocking relationships, impact analysis
|
|
77
|
+
- Task delegation and result tracking
|
|
78
|
+
- System prompt management
|
|
79
|
+
- Context analytics and efficiency scoring
|
|
80
|
+
|
|
81
|
+
### HTTP API
|
|
82
|
+
- REST endpoints for all work items
|
|
83
|
+
- Advanced query API
|
|
84
|
+
- Agent statistics and analytics endpoints
|
|
85
|
+
- Task delegation tracking
|
|
86
|
+
- Status endpoint with collection counts
|
|
87
|
+
|
|
88
|
+
### Orchestration
|
|
89
|
+
- Agent spawning: Claude, Gemini, Codex, Copilot
|
|
90
|
+
- Task delegation with result tracking
|
|
91
|
+
- Model selection based on task type and complexity
|
|
92
|
+
- Cost optimization strategies
|
|
93
|
+
- Parallel task coordination
|
|
94
|
+
- Error recovery and fallback patterns
|
|
95
|
+
- Advanced patterns: chain-of-thought, feedback loops, multi-agent consensus
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Common Tasks
|
|
100
|
+
|
|
101
|
+
### Create Work Items
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
from htmlgraph import SDK
|
|
105
|
+
|
|
106
|
+
sdk = SDK(agent="claude")
|
|
107
|
+
|
|
108
|
+
# Create feature with builder
|
|
109
|
+
feature = sdk.features.create("User Auth") \
|
|
110
|
+
.set_priority("high") \
|
|
111
|
+
.add_steps(["Design", "Implement", "Test"]) \
|
|
112
|
+
.save()
|
|
113
|
+
|
|
114
|
+
# Create bug
|
|
115
|
+
bug = sdk.bugs.create("Login bug").save()
|
|
116
|
+
|
|
117
|
+
# Create spike
|
|
118
|
+
spike = sdk.spikes.create("Investigate caching").save()
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
See: [Integration Guide - Creating Work Items](INTEGRATION_GUIDE.md#creating-work-items)
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### Query and Filter
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
# Get all features
|
|
129
|
+
all_features = sdk.features.all()
|
|
130
|
+
|
|
131
|
+
# Filter by status and priority
|
|
132
|
+
high_priority = sdk.features.where(
|
|
133
|
+
status="todo",
|
|
134
|
+
priority="high"
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
# Complex query
|
|
138
|
+
results = graph.query_builder() \
|
|
139
|
+
.where("status", "todo") \
|
|
140
|
+
.and_("priority").in_(["high", "critical"]) \
|
|
141
|
+
.execute()
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
See: [SDK API Reference - Collections](API_REFERENCE.md#collections)
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
### Analytics and Insights
|
|
149
|
+
|
|
150
|
+
```python
|
|
151
|
+
# Work distribution
|
|
152
|
+
distribution = sdk.analytics.get_work_type_distribution()
|
|
153
|
+
|
|
154
|
+
# Find bottlenecks
|
|
155
|
+
bottlenecks = sdk.dep_analytics.find_bottlenecks(top_n=5)
|
|
156
|
+
|
|
157
|
+
# Get parallelizable work
|
|
158
|
+
parallel = sdk.dep_analytics.get_parallel_work(max_agents=3)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
See: [SDK API Reference - Analytics](API_REFERENCE.md#analytics)
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
### Delegate Tasks
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
from htmlgraph import delegate_with_id, parallel_delegate
|
|
169
|
+
|
|
170
|
+
# Single task
|
|
171
|
+
task_id = delegate_with_id(
|
|
172
|
+
prompt="Implement feature",
|
|
173
|
+
agent="coder",
|
|
174
|
+
task_id="task-001"
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
# Multiple parallel tasks
|
|
178
|
+
results = parallel_delegate([
|
|
179
|
+
{"prompt": "Task 1", "agent": "coder", "task_id": "t1"},
|
|
180
|
+
{"prompt": "Task 2", "agent": "tester", "task_id": "t2"}
|
|
181
|
+
])
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
See: [Orchestration Patterns - Task Delegation](ORCHESTRATION_PATTERNS.md#task-delegation)
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
### Spawn Agents
|
|
189
|
+
|
|
190
|
+
```python
|
|
191
|
+
from htmlgraph.orchestration import HeadlessSpawner
|
|
192
|
+
|
|
193
|
+
spawner = HeadlessSpawner()
|
|
194
|
+
|
|
195
|
+
# Spawn Claude
|
|
196
|
+
result = spawner.spawn_claude(
|
|
197
|
+
prompt="Write authentication code",
|
|
198
|
+
approval="auto"
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
# Spawn Gemini (model=None uses latest models including Gemini 3 preview)
|
|
202
|
+
result = spawner.spawn_gemini(
|
|
203
|
+
prompt="Analyze performance"
|
|
204
|
+
)
|
|
205
|
+
|
|
206
|
+
# Spawn Codex
|
|
207
|
+
result = spawner.spawn_codex(
|
|
208
|
+
prompt="Generate API",
|
|
209
|
+
sandbox="workspace-write"
|
|
210
|
+
)
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
See: [Orchestration Patterns - Agent Selection](ORCHESTRATION_PATTERNS.md#agent-selection)
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
### Start HTTP Server
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
# CLI
|
|
221
|
+
htmlgraph serve --port 8080
|
|
222
|
+
|
|
223
|
+
# Python
|
|
224
|
+
from htmlgraph import serve
|
|
225
|
+
serve(port=8080, directory=".htmlgraph")
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Then access API:
|
|
229
|
+
```bash
|
|
230
|
+
curl http://localhost:8080/api/status
|
|
231
|
+
curl http://localhost:8080/api/features
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
See: [HTTP API Reference](HTTP_API.md)
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Error Handling
|
|
239
|
+
|
|
240
|
+
HtmlGraph uses consistent error handling patterns:
|
|
241
|
+
|
|
242
|
+
| Operation | Error Behavior | Example |
|
|
243
|
+
|-----------|----------------|---------|
|
|
244
|
+
| Lookup (`get`) | Returns `None` | `feature = sdk.features.get("id")` |
|
|
245
|
+
| Query (`where`, `all`) | Returns `[]` | `items = sdk.features.where(...)` |
|
|
246
|
+
| Edit | Raises `NodeNotFoundError` | `with sdk.features.edit("id")` |
|
|
247
|
+
| Create | Raises `ValidationError` | `sdk.features.create(title)` |
|
|
248
|
+
| Batch | Returns results dict | `sdk.features.mark_done([ids])` |
|
|
249
|
+
|
|
250
|
+
See: [SDK API Reference - Error Handling](API_REFERENCE.md#error-handling)
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## Installation
|
|
255
|
+
|
|
256
|
+
### Quick Install
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
pip install htmlgraph
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### With uv (Recommended)
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
uv pip install htmlgraph
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Development
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
git clone https://github.com/anthropics/htmlgraph.git
|
|
272
|
+
cd htmlgraph
|
|
273
|
+
uv pip install -e .
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## Project Structure
|
|
279
|
+
|
|
280
|
+
```
|
|
281
|
+
.htmlgraph/
|
|
282
|
+
├── features/ # Feature work items
|
|
283
|
+
├── bugs/ # Bug reports
|
|
284
|
+
├── spikes/ # Investigation spikes
|
|
285
|
+
├── chores/ # Maintenance tasks
|
|
286
|
+
├── epics/ # Large work bodies
|
|
287
|
+
├── phases/ # Project phases
|
|
288
|
+
├── sessions/ # Agent sessions
|
|
289
|
+
├── tracks/ # Work tracks
|
|
290
|
+
├── task-delegations/ # Delegated task tracking
|
|
291
|
+
├── patterns/ # Learned patterns
|
|
292
|
+
├── insights/ # Session insights
|
|
293
|
+
└── metrics/ # Aggregated metrics
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## API Overview
|
|
299
|
+
|
|
300
|
+
### SDK Collections
|
|
301
|
+
|
|
302
|
+
```python
|
|
303
|
+
sdk.features # Feature work items
|
|
304
|
+
sdk.bugs # Bug reports
|
|
305
|
+
sdk.spikes # Investigation spikes
|
|
306
|
+
sdk.chores # Maintenance tasks
|
|
307
|
+
sdk.epics # Large work bodies
|
|
308
|
+
sdk.phases # Project phases
|
|
309
|
+
sdk.sessions # Agent sessions
|
|
310
|
+
sdk.tracks # Work tracks
|
|
311
|
+
sdk.todos # Persistent task tracking
|
|
312
|
+
sdk.patterns # Learned patterns
|
|
313
|
+
sdk.insights # Session insights
|
|
314
|
+
sdk.metrics # Aggregated metrics
|
|
315
|
+
sdk.task_delegations # Task delegation tracking
|
|
316
|
+
sdk.agents # Agent information
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### HTTP Endpoints
|
|
320
|
+
|
|
321
|
+
```
|
|
322
|
+
GET /api/status - Server status
|
|
323
|
+
GET /api/features - List features
|
|
324
|
+
POST /api/features - Create feature
|
|
325
|
+
GET /api/features/{id} - Get feature
|
|
326
|
+
PUT /api/features/{id} - Update feature
|
|
327
|
+
DELETE /api/features/{id} - Delete feature
|
|
328
|
+
|
|
329
|
+
GET /api/bugs - List bugs (same pattern as features)
|
|
330
|
+
GET /api/spikes - List spikes
|
|
331
|
+
GET /api/tasks - List delegations
|
|
332
|
+
GET /api/analytics/* - Analytics endpoints
|
|
333
|
+
GET /api/query - Advanced query
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
## Version Information
|
|
339
|
+
|
|
340
|
+
- **Current Version:** 0.24.1
|
|
341
|
+
- **Documentation Updated:** 2025-01-06
|
|
342
|
+
- **Tested with:** Python 3.8+
|
|
343
|
+
- **Dependencies:** Zero (standard library only)
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
## Common Patterns
|
|
348
|
+
|
|
349
|
+
### Pattern 1: Create and Update
|
|
350
|
+
|
|
351
|
+
```python
|
|
352
|
+
feature = sdk.features.create("My Feature") \
|
|
353
|
+
.set_priority("high") \
|
|
354
|
+
.add_steps(["Step 1", "Step 2"]) \
|
|
355
|
+
.save()
|
|
356
|
+
|
|
357
|
+
with sdk.features.edit(feature.id) as f:
|
|
358
|
+
f.status = "done"
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
### Pattern 2: Query and Analyze
|
|
362
|
+
|
|
363
|
+
```python
|
|
364
|
+
todos = sdk.features.where(status="todo")
|
|
365
|
+
bottlenecks = sdk.dep_analytics.find_bottlenecks()
|
|
366
|
+
distribution = sdk.analytics.get_work_type_distribution()
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
### Pattern 3: Delegate Work
|
|
370
|
+
|
|
371
|
+
```python
|
|
372
|
+
task_id = delegate_with_id(
|
|
373
|
+
prompt="Your task",
|
|
374
|
+
agent="coder",
|
|
375
|
+
task_id="task-001"
|
|
376
|
+
)
|
|
377
|
+
|
|
378
|
+
# Check results later
|
|
379
|
+
results = get_results_by_task_id("task-001")
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
### Pattern 4: Batch Operations
|
|
383
|
+
|
|
384
|
+
```python
|
|
385
|
+
# Create multiple
|
|
386
|
+
items = [sdk.features.create(title).save() for title in titles]
|
|
387
|
+
|
|
388
|
+
# Update multiple
|
|
389
|
+
sdk.features.batch_update({
|
|
390
|
+
"feat-1": {"status": "done"},
|
|
391
|
+
"feat-2": {"priority": "high"}
|
|
392
|
+
})
|
|
393
|
+
|
|
394
|
+
# Mark multiple done
|
|
395
|
+
sdk.features.mark_done([id1, id2, id3])
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
## Troubleshooting
|
|
401
|
+
|
|
402
|
+
### SDK Issues
|
|
403
|
+
|
|
404
|
+
**"Agent identifier is required"**
|
|
405
|
+
```python
|
|
406
|
+
# Fix: Always provide agent
|
|
407
|
+
sdk = SDK(agent="claude") # ✓ Correct
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
**".htmlgraph directory not found"**
|
|
411
|
+
```python
|
|
412
|
+
# Fix: Create directory structure
|
|
413
|
+
from pathlib import Path
|
|
414
|
+
Path(".htmlgraph/features").mkdir(parents=True, exist_ok=True)
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
**"NodeNotFoundError"**
|
|
418
|
+
```python
|
|
419
|
+
# Fix: Check if exists or handle exception
|
|
420
|
+
try:
|
|
421
|
+
with sdk.features.edit("id") as f:
|
|
422
|
+
f.status = "done"
|
|
423
|
+
except NodeNotFoundError:
|
|
424
|
+
print("Not found")
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
See: [Integration Guide - Troubleshooting](INTEGRATION_GUIDE.md#troubleshooting)
|
|
428
|
+
|
|
429
|
+
---
|
|
430
|
+
|
|
431
|
+
### HTTP API Issues
|
|
432
|
+
|
|
433
|
+
**"Connection refused"**
|
|
434
|
+
```bash
|
|
435
|
+
# Start server
|
|
436
|
+
htmlgraph serve --port 8080
|
|
437
|
+
|
|
438
|
+
# Verify it's running
|
|
439
|
+
curl http://localhost:8080/api/status
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
**"404 Not Found"**
|
|
443
|
+
```bash
|
|
444
|
+
# Verify item exists
|
|
445
|
+
curl http://localhost:8080/api/features
|
|
446
|
+
|
|
447
|
+
# Check specific item
|
|
448
|
+
curl http://localhost:8080/api/features/feat-abc123
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
See: [HTTP API Reference - Error Responses](HTTP_API.md#error-responses)
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
455
|
+
### Orchestration Issues
|
|
456
|
+
|
|
457
|
+
**"Agent spawn failed"**
|
|
458
|
+
```python
|
|
459
|
+
# Check API key
|
|
460
|
+
import os
|
|
461
|
+
if not os.getenv("ANTHROPIC_API_KEY"):
|
|
462
|
+
print("Set ANTHROPIC_API_KEY")
|
|
463
|
+
|
|
464
|
+
# Use fallback
|
|
465
|
+
try:
|
|
466
|
+
result = spawner.spawn_claude(prompt="...")
|
|
467
|
+
except Exception as e:
|
|
468
|
+
print(f"Claude failed: {e}")
|
|
469
|
+
result = spawner.spawn_gemini(prompt="...")
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
See: [Orchestration Patterns - Troubleshooting](ORCHESTRATION_PATTERNS.md#troubleshooting)
|
|
473
|
+
|
|
474
|
+
---
|
|
475
|
+
|
|
476
|
+
## Learning Paths
|
|
477
|
+
|
|
478
|
+
### Path 1: Quick Start (15 minutes)
|
|
479
|
+
1. Read [Integration Guide](INTEGRATION_GUIDE.md) intro
|
|
480
|
+
2. Run the quick start examples
|
|
481
|
+
3. Create first feature
|
|
482
|
+
4. Done!
|
|
483
|
+
|
|
484
|
+
### Path 2: Python Developer (1 hour)
|
|
485
|
+
1. [Integration Guide](INTEGRATION_GUIDE.md) - Patterns
|
|
486
|
+
2. [SDK API Reference](API_REFERENCE.md) - All methods
|
|
487
|
+
3. Try common patterns from your project
|
|
488
|
+
4. Explore analytics
|
|
489
|
+
|
|
490
|
+
### Path 3: Integration Engineer (1 hour)
|
|
491
|
+
1. [Integration Guide](INTEGRATION_GUIDE.md) - Basics
|
|
492
|
+
2. [HTTP API Reference](HTTP_API.md) - All endpoints
|
|
493
|
+
3. Set up HTTP server
|
|
494
|
+
4. Integrate with external services
|
|
495
|
+
|
|
496
|
+
### Path 4: Multi-Agent Workflows (2 hours)
|
|
497
|
+
1. [Integration Guide](INTEGRATION_GUIDE.md) - Task delegation
|
|
498
|
+
2. [Orchestration Patterns](ORCHESTRATION_PATTERNS.md) - All patterns
|
|
499
|
+
3. Explore agent spawning
|
|
500
|
+
4. Build multi-agent workflows
|
|
501
|
+
|
|
502
|
+
---
|
|
503
|
+
|
|
504
|
+
## Next Steps
|
|
505
|
+
|
|
506
|
+
1. **Get started** - Read [Integration Guide](INTEGRATION_GUIDE.md)
|
|
507
|
+
2. **Deep dive** - Explore [SDK API Reference](API_REFERENCE.md)
|
|
508
|
+
3. **Build APIs** - Check [HTTP API Reference](HTTP_API.md)
|
|
509
|
+
4. **Multi-agent** - Learn [Orchestration Patterns](ORCHESTRATION_PATTERNS.md)
|
|
510
|
+
5. **Get help** - Check troubleshooting sections
|
|
511
|
+
6. **See examples** - Look for `examples/` directory in repo
|
|
512
|
+
|
|
513
|
+
---
|
|
514
|
+
|
|
515
|
+
## Contributing
|
|
516
|
+
|
|
517
|
+
Found a documentation issue? Have a great example? Contribute!
|
|
518
|
+
|
|
519
|
+
- Report issues on GitHub
|
|
520
|
+
- Submit documentation PRs
|
|
521
|
+
- Share your patterns
|
|
522
|
+
|
|
523
|
+
---
|
|
524
|
+
|
|
525
|
+
## License
|
|
526
|
+
|
|
527
|
+
HtmlGraph documentation is part of the HtmlGraph project.
|
|
528
|
+
See LICENSE file in repository for details.
|
|
529
|
+
|
|
530
|
+
---
|
|
531
|
+
|
|
532
|
+
**Version:** 0.24.1 | **Last Updated:** 2025-01-06 | **Maintainer:** HtmlGraph Team
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Documentation version tracking and migration system with template-based user customization.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
from htmlgraph import __version__
|
|
8
|
+
from htmlgraph.docs.docs_version import (
|
|
9
|
+
DOC_VERSIONS,
|
|
10
|
+
DocVersion,
|
|
11
|
+
get_current_doc_version,
|
|
12
|
+
is_compatible,
|
|
13
|
+
)
|
|
14
|
+
from htmlgraph.docs.metadata import DocsMetadata
|
|
15
|
+
from htmlgraph.docs.migrations import MIGRATIONS, MigrationScript, get_migration
|
|
16
|
+
from htmlgraph.docs.template_engine import DocTemplateEngine
|
|
17
|
+
from htmlgraph.docs.version_check import check_docs_version, upgrade_docs_interactive
|
|
18
|
+
|
|
19
|
+
__all__ = [
|
|
20
|
+
"DOC_VERSIONS",
|
|
21
|
+
"DocVersion",
|
|
22
|
+
"get_current_doc_version",
|
|
23
|
+
"is_compatible",
|
|
24
|
+
"DocsMetadata",
|
|
25
|
+
"MigrationScript",
|
|
26
|
+
"MIGRATIONS",
|
|
27
|
+
"get_migration",
|
|
28
|
+
"check_docs_version",
|
|
29
|
+
"upgrade_docs_interactive",
|
|
30
|
+
"DocTemplateEngine",
|
|
31
|
+
"get_agents_md",
|
|
32
|
+
"sync_docs_to_file",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def get_agents_md(htmlgraph_dir: Path, platform: str = "claude") -> str:
|
|
37
|
+
"""Get AGENTS.md content with user customizations merged.
|
|
38
|
+
|
|
39
|
+
Args:
|
|
40
|
+
htmlgraph_dir: Path to .htmlgraph directory
|
|
41
|
+
platform: Platform name (claude, gemini, etc.)
|
|
42
|
+
|
|
43
|
+
Returns:
|
|
44
|
+
Merged documentation content
|
|
45
|
+
|
|
46
|
+
Example:
|
|
47
|
+
>>> from pathlib import Path
|
|
48
|
+
>>> content = get_agents_md(Path(".htmlgraph"), "claude")
|
|
49
|
+
"""
|
|
50
|
+
engine = DocTemplateEngine(htmlgraph_dir)
|
|
51
|
+
return engine.render_agents_md(__version__, platform)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def sync_docs_to_file(
|
|
55
|
+
htmlgraph_dir: Path, output_file: Path, platform: str = "claude"
|
|
56
|
+
) -> Path:
|
|
57
|
+
"""Generate and write documentation to file.
|
|
58
|
+
|
|
59
|
+
Args:
|
|
60
|
+
htmlgraph_dir: Path to .htmlgraph directory
|
|
61
|
+
output_file: Path where documentation should be written
|
|
62
|
+
platform: Platform name (claude, gemini, etc.)
|
|
63
|
+
|
|
64
|
+
Returns:
|
|
65
|
+
Path to written file
|
|
66
|
+
|
|
67
|
+
Example:
|
|
68
|
+
>>> from pathlib import Path
|
|
69
|
+
>>> sync_docs_to_file(
|
|
70
|
+
... Path(".htmlgraph"),
|
|
71
|
+
... Path("AGENTS.md"),
|
|
72
|
+
... "claude"
|
|
73
|
+
... )
|
|
74
|
+
"""
|
|
75
|
+
content = get_agents_md(htmlgraph_dir, platform)
|
|
76
|
+
output_file.write_text(content)
|
|
77
|
+
return output_file
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Documentation schema version management.
|
|
3
|
+
|
|
4
|
+
This module defines version compatibility rules for HtmlGraph documentation files.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from dataclasses import dataclass
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@dataclass
|
|
11
|
+
class DocVersion:
|
|
12
|
+
"""Documentation schema version."""
|
|
13
|
+
|
|
14
|
+
version: int # Schema version (1, 2, 3)
|
|
15
|
+
package_version: str # Minimum package version (e.g., "0.20.0")
|
|
16
|
+
breaking_changes: list[str]
|
|
17
|
+
migration_required: bool = False
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
# Version compatibility matrix
|
|
21
|
+
DOC_VERSIONS = {
|
|
22
|
+
1: DocVersion(
|
|
23
|
+
version=1,
|
|
24
|
+
package_version="0.1.0",
|
|
25
|
+
breaking_changes=[],
|
|
26
|
+
migration_required=False,
|
|
27
|
+
),
|
|
28
|
+
2: DocVersion(
|
|
29
|
+
version=2,
|
|
30
|
+
package_version="0.20.0",
|
|
31
|
+
breaking_changes=[
|
|
32
|
+
"AGENTS.md structure changed to use Jinja2 templates",
|
|
33
|
+
"Removed root-level CLAUDE.md/GEMINI.md (moved to .htmlgraph/docs/)",
|
|
34
|
+
],
|
|
35
|
+
migration_required=True,
|
|
36
|
+
),
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def get_current_doc_version() -> int:
|
|
41
|
+
"""Get current documentation schema version for this package."""
|
|
42
|
+
return 2 # Current version
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def is_compatible(user_version: int, package_version: int) -> bool:
|
|
46
|
+
"""Check if user's doc version is compatible with package.
|
|
47
|
+
|
|
48
|
+
Args:
|
|
49
|
+
user_version: User's documentation schema version
|
|
50
|
+
package_version: Package's required documentation schema version
|
|
51
|
+
|
|
52
|
+
Returns:
|
|
53
|
+
True if compatible (supports N-1 versions)
|
|
54
|
+
"""
|
|
55
|
+
return user_version >= package_version - 1 # Support N-1 versions
|