moai-adk 0.15.0__py3-none-any.whl → 0.25.4__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.
Potentially problematic release.
This version of moai-adk might be problematic. Click here for more details.
- moai_adk/__init__.py +1 -2
- moai_adk/__main__.py +85 -2
- moai_adk/cli/__init__.py +0 -1
- moai_adk/cli/commands/__init__.py +0 -1
- moai_adk/cli/commands/analyze.py +127 -0
- moai_adk/cli/commands/backup.py +5 -3
- moai_adk/cli/commands/doctor.py +35 -11
- moai_adk/cli/commands/improve_user_experience.py +348 -0
- moai_adk/cli/commands/init.py +150 -23
- moai_adk/cli/commands/language.py +269 -0
- moai_adk/cli/commands/migrate.py +158 -0
- moai_adk/cli/commands/status.py +13 -12
- moai_adk/cli/commands/update.py +364 -60
- moai_adk/cli/commands/validate_links.py +118 -0
- moai_adk/cli/main.py +3 -2
- moai_adk/cli/prompts/init_prompts.py +79 -82
- moai_adk/core/__init__.py +0 -1
- moai_adk/core/analysis/__init__.py +9 -0
- moai_adk/core/analysis/session_analyzer.py +439 -0
- moai_adk/core/claude_integration.py +421 -0
- moai_adk/core/command_helpers.py +270 -0
- moai_adk/core/config/__init__.py +6 -0
- moai_adk/core/config/auto_spec_config.py +346 -0
- moai_adk/core/config/migration.py +133 -12
- moai_adk/core/context_manager.py +279 -0
- moai_adk/core/diagnostics/slash_commands.py +0 -1
- moai_adk/core/error_recovery_system.py +1289 -0
- moai_adk/core/git/__init__.py +0 -1
- moai_adk/core/git/branch.py +0 -1
- moai_adk/core/git/branch_manager.py +4 -4
- moai_adk/core/git/checkpoint.py +1 -5
- moai_adk/core/git/commit.py +0 -1
- moai_adk/core/git/event_detector.py +3 -5
- moai_adk/core/git/manager.py +0 -1
- moai_adk/core/hooks/post_tool_auto_spec_completion.py +925 -0
- moai_adk/core/integration/__init__.py +22 -0
- moai_adk/core/integration/engine.py +169 -0
- moai_adk/core/integration/integration_tester.py +225 -0
- moai_adk/core/integration/models.py +88 -0
- moai_adk/core/integration/utils.py +211 -0
- moai_adk/core/issue_creator.py +28 -18
- moai_adk/core/language_config.py +202 -0
- moai_adk/core/language_validator.py +556 -0
- moai_adk/core/mcp/setup.py +113 -0
- moai_adk/core/migration/__init__.py +18 -0
- moai_adk/core/migration/backup_manager.py +208 -0
- moai_adk/core/migration/file_migrator.py +218 -0
- moai_adk/core/migration/version_detector.py +143 -0
- moai_adk/core/migration/version_migrator.py +228 -0
- moai_adk/core/performance/__init__.py +6 -0
- moai_adk/core/performance/cache_system.py +318 -0
- moai_adk/core/performance/parallel_processor.py +116 -0
- moai_adk/core/project/__init__.py +0 -1
- moai_adk/core/project/backup_utils.py +2 -7
- moai_adk/core/project/checker.py +3 -3
- moai_adk/core/project/detector.py +20 -40
- moai_adk/core/project/initializer.py +42 -17
- moai_adk/core/project/phase_executor.py +415 -58
- moai_adk/core/project/validator.py +6 -25
- moai_adk/core/quality/__init__.py +1 -1
- moai_adk/core/quality/trust_checker.py +64 -110
- moai_adk/core/quality/validators/__init__.py +1 -1
- moai_adk/core/quality/validators/base_validator.py +1 -1
- moai_adk/core/rollback_manager.py +993 -0
- moai_adk/core/session_manager.py +667 -0
- moai_adk/core/spec/confidence_scoring.py +749 -0
- moai_adk/core/spec/ears_template_engine.py +1182 -0
- moai_adk/core/spec/quality_validator.py +721 -0
- moai_adk/core/spec_status_manager.py +488 -0
- moai_adk/core/template/__init__.py +0 -1
- moai_adk/core/template/backup.py +41 -1
- moai_adk/core/template/config.py +11 -12
- moai_adk/core/template/languages.py +0 -1
- moai_adk/core/template/merger.py +79 -22
- moai_adk/core/template/processor.py +614 -40
- moai_adk/core/template_engine.py +36 -27
- moai_adk/foundation/git/commit_templates.py +565 -0
- moai_adk/foundation/trust/trust_principles.py +725 -0
- moai_adk/foundation/trust/validation_checklist.py +1678 -0
- moai_adk/statusline/__init__.py +38 -0
- moai_adk/statusline/alfred_detector.py +107 -0
- moai_adk/statusline/config.py +364 -0
- moai_adk/statusline/enhanced_output_style_detector.py +364 -0
- moai_adk/statusline/git_collector.py +190 -0
- moai_adk/statusline/main.py +228 -0
- moai_adk/statusline/metrics_tracker.py +78 -0
- moai_adk/statusline/renderer.py +327 -0
- moai_adk/statusline/update_checker.py +135 -0
- moai_adk/statusline/version_reader.py +647 -0
- moai_adk/templates/.git-hooks/pre-commit +66 -0
- moai_adk/templates/.git-hooks/pre-push +116 -4
- moai_adk/templates/.github/workflows/moai-gitflow.yml +1 -7
- moai_adk/templates/.github/workflows/spec-issue-sync.yml +0 -1
- moai_adk/templates/.gitignore +44 -0
- moai_adk/templates/.mcp.json +22 -0
- moai_adk/templates/CLAUDE.md +450 -1071
- moai_adk/utils/__init__.py +0 -1
- moai_adk/utils/banner.py +0 -1
- moai_adk/utils/common.py +308 -0
- moai_adk/utils/link_validator.py +249 -0
- moai_adk/utils/logger.py +4 -9
- moai_adk/utils/safe_file_reader.py +210 -0
- moai_adk/utils/user_experience.py +531 -0
- moai_adk-0.25.4.dist-info/METADATA +2279 -0
- moai_adk-0.25.4.dist-info/RECORD +112 -0
- moai_adk/core/tags/__init__.py +0 -86
- moai_adk/core/tags/ci_validator.py +0 -463
- moai_adk/core/tags/cli.py +0 -283
- moai_adk/core/tags/generator.py +0 -109
- moai_adk/core/tags/inserter.py +0 -99
- moai_adk/core/tags/mapper.py +0 -126
- moai_adk/core/tags/parser.py +0 -76
- moai_adk/core/tags/pre_commit_validator.py +0 -393
- moai_adk/core/tags/reporter.py +0 -956
- moai_adk/core/tags/tags.py +0 -149
- moai_adk/core/tags/validator.py +0 -897
- moai_adk/templates/.claude/agents/alfred/backend-expert.md +0 -319
- moai_adk/templates/.claude/agents/alfred/cc-manager.md +0 -316
- moai_adk/templates/.claude/agents/alfred/debug-helper.md +0 -208
- moai_adk/templates/.claude/agents/alfred/devops-expert.md +0 -464
- moai_adk/templates/.claude/agents/alfred/doc-syncer.md +0 -214
- moai_adk/templates/.claude/agents/alfred/frontend-expert.md +0 -357
- moai_adk/templates/.claude/agents/alfred/git-manager.md +0 -406
- moai_adk/templates/.claude/agents/alfred/implementation-planner.md +0 -423
- moai_adk/templates/.claude/agents/alfred/project-manager.md +0 -312
- moai_adk/templates/.claude/agents/alfred/quality-gate.md +0 -343
- moai_adk/templates/.claude/agents/alfred/skill-factory.md +0 -865
- moai_adk/templates/.claude/agents/alfred/spec-builder.md +0 -392
- moai_adk/templates/.claude/agents/alfred/tag-agent.md +0 -361
- moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +0 -428
- moai_adk/templates/.claude/agents/alfred/trust-checker.md +0 -375
- moai_adk/templates/.claude/agents/alfred/ui-ux-expert.md +0 -571
- moai_adk/templates/.claude/commands/alfred/0-project.md +0 -1525
- moai_adk/templates/.claude/commands/alfred/1-plan.md +0 -802
- moai_adk/templates/.claude/commands/alfred/2-run.md +0 -709
- moai_adk/templates/.claude/commands/alfred/3-sync.md +0 -1009
- moai_adk/templates/.claude/commands/alfred/9-feedback.md +0 -149
- moai_adk/templates/.claude/hooks/alfred/core/project.py +0 -748
- moai_adk/templates/.claude/hooks/alfred/core/timeout.py +0 -136
- moai_adk/templates/.claude/hooks/alfred/core/ttl_cache.py +0 -108
- moai_adk/templates/.claude/hooks/alfred/core/version_cache.py +0 -198
- moai_adk/templates/.claude/hooks/alfred/handlers/__init__.py +0 -29
- moai_adk/templates/.claude/hooks/alfred/post_tool__log_changes.py +0 -94
- moai_adk/templates/.claude/hooks/alfred/pre_tool__auto_checkpoint.py +0 -100
- moai_adk/templates/.claude/hooks/alfred/session_end__cleanup.py +0 -94
- moai_adk/templates/.claude/hooks/alfred/session_start__show_project_info.py +0 -94
- moai_adk/templates/.claude/hooks/alfred/shared/core/__init__.py +0 -170
- moai_adk/templates/.claude/hooks/alfred/shared/core/checkpoint.py +0 -271
- moai_adk/templates/.claude/hooks/alfred/shared/core/context.py +0 -67
- moai_adk/templates/.claude/hooks/alfred/shared/core/project.py +0 -749
- moai_adk/templates/.claude/hooks/alfred/shared/core/tags.py +0 -230
- moai_adk/templates/.claude/hooks/alfred/shared/core/version_cache.py +0 -198
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/__init__.py +0 -21
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/notification.py +0 -154
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/session.py +0 -174
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/tool.py +0 -87
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/user.py +0 -61
- moai_adk/templates/.claude/hooks/alfred/user_prompt__jit_load_docs.py +0 -112
- moai_adk/templates/.claude/hooks/alfred/utils/__init__.py +0 -1
- moai_adk/templates/.claude/hooks/alfred/utils/timeout.py +0 -161
- moai_adk/templates/.claude/settings.json +0 -144
- moai_adk/templates/.claude/skills/moai-alfred-agent-guide/SKILL.md +0 -70
- moai_adk/templates/.claude/skills/moai-alfred-agent-guide/examples.md +0 -62
- moai_adk/templates/.claude/skills/moai-alfred-agent-guide/reference.md +0 -242
- moai_adk/templates/.claude/skills/moai-alfred-config-schema/SKILL.md +0 -56
- moai_adk/templates/.claude/skills/moai-alfred-config-schema/examples.md +0 -28
- moai_adk/templates/.claude/skills/moai-alfred-config-schema/reference.md +0 -444
- moai_adk/templates/.claude/skills/moai-alfred-context-budget/SKILL.md +0 -62
- moai_adk/templates/.claude/skills/moai-alfred-context-budget/examples.md +0 -28
- moai_adk/templates/.claude/skills/moai-alfred-context-budget/reference.md +0 -405
- moai_adk/templates/.claude/skills/moai-alfred-dev-guide/SKILL.md +0 -51
- moai_adk/templates/.claude/skills/moai-alfred-dev-guide/examples.md +0 -355
- moai_adk/templates/.claude/skills/moai-alfred-dev-guide/reference.md +0 -239
- moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/SKILL.md +0 -323
- moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/examples.md +0 -286
- moai_adk/templates/.claude/skills/moai-alfred-expertise-detection/reference.md +0 -126
- moai_adk/templates/.claude/skills/moai-alfred-git-workflow/SKILL.md +0 -122
- moai_adk/templates/.claude/skills/moai-alfred-git-workflow/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-alfred-git-workflow/reference.md +0 -29
- moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/SKILL.md +0 -74
- moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/examples.md +0 -4
- moai_adk/templates/.claude/skills/moai-alfred-gitflow-policy/reference.md +0 -269
- moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/SKILL.md +0 -237
- moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/examples.md +0 -615
- moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/reference.md +0 -653
- moai_adk/templates/.claude/skills/moai-alfred-issue-labels/SKILL.md +0 -19
- moai_adk/templates/.claude/skills/moai-alfred-issue-labels/examples.md +0 -4
- moai_adk/templates/.claude/skills/moai-alfred-issue-labels/reference.md +0 -150
- moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-alfred-language-detection/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-alfred-language-detection/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-alfred-persona-roles/SKILL.md +0 -198
- moai_adk/templates/.claude/skills/moai-alfred-persona-roles/examples.md +0 -431
- moai_adk/templates/.claude/skills/moai-alfred-persona-roles/reference.md +0 -141
- moai_adk/templates/.claude/skills/moai-alfred-practices/SKILL.md +0 -89
- moai_adk/templates/.claude/skills/moai-alfred-practices/examples.md +0 -122
- moai_adk/templates/.claude/skills/moai-alfred-practices/reference.md +0 -369
- moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/SKILL.md +0 -508
- moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/examples.md +0 -481
- moai_adk/templates/.claude/skills/moai-alfred-proactive-suggestions/reference.md +0 -100
- moai_adk/templates/.claude/skills/moai-alfred-reporting/SKILL.md +0 -273
- moai_adk/templates/.claude/skills/moai-alfred-rules/SKILL.md +0 -77
- moai_adk/templates/.claude/skills/moai-alfred-rules/examples.md +0 -265
- moai_adk/templates/.claude/skills/moai-alfred-rules/reference.md +0 -539
- moai_adk/templates/.claude/skills/moai-alfred-session-state/SKILL.md +0 -19
- moai_adk/templates/.claude/skills/moai-alfred-session-state/examples.md +0 -4
- moai_adk/templates/.claude/skills/moai-alfred-session-state/reference.md +0 -84
- moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/README.md +0 -137
- moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/SKILL.md +0 -219
- moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/examples/validate-spec.sh +0 -161
- moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/examples.md +0 -541
- moai_adk/templates/.claude/skills/moai-alfred-spec-authoring/reference.md +0 -622
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/SKILL.md +0 -115
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/examples.md +0 -4
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-extended/reference.md +0 -348
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/SKILL.md +0 -19
- moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/examples.md +0 -4
- moai_adk/templates/.claude/skills/moai-alfred-todowrite-pattern/reference.md +0 -211
- moai_adk/templates/.claude/skills/moai-alfred-trust-validation/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-alfred-trust-validation/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-alfred-trust-validation/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-alfred-workflow/SKILL.md +0 -288
- moai_adk/templates/.claude/skills/moai-cc-agents/SKILL.md +0 -269
- moai_adk/templates/.claude/skills/moai-cc-agents/templates/agent-template.md +0 -32
- moai_adk/templates/.claude/skills/moai-cc-claude-md/SKILL.md +0 -298
- moai_adk/templates/.claude/skills/moai-cc-claude-md/templates/CLAUDE-template.md +0 -26
- moai_adk/templates/.claude/skills/moai-cc-commands/SKILL.md +0 -307
- moai_adk/templates/.claude/skills/moai-cc-commands/templates/command-template.md +0 -21
- moai_adk/templates/.claude/skills/moai-cc-hooks/SKILL.md +0 -252
- moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/pre-bash-check.sh +0 -19
- moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/preserve-permissions.sh +0 -19
- moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/validate-bash-command.py +0 -24
- moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/SKILL.md +0 -199
- moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/templates/settings-mcp-template.json +0 -39
- moai_adk/templates/.claude/skills/moai-cc-memory/SKILL.md +0 -316
- moai_adk/templates/.claude/skills/moai-cc-memory/templates/session-summary-template.md +0 -18
- moai_adk/templates/.claude/skills/moai-cc-settings/SKILL.md +0 -263
- moai_adk/templates/.claude/skills/moai-cc-settings/templates/settings-complete-template.json +0 -30
- moai_adk/templates/.claude/skills/moai-cc-skill-descriptions/SKILL.md +0 -19
- moai_adk/templates/.claude/skills/moai-cc-skill-descriptions/examples.md +0 -4
- moai_adk/templates/.claude/skills/moai-cc-skill-descriptions/reference.md +0 -218
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/CHECKLIST.md +0 -482
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/EXAMPLES.md +0 -278
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/INTERACTIVE-DISCOVERY.md +0 -524
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/METADATA.md +0 -477
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/PARALLEL-ANALYSIS-REPORT.md +0 -429
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/PYTHON-VERSION-MATRIX.md +0 -391
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL-FACTORY-WORKFLOW.md +0 -431
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL-UPDATE-ADVISOR.md +0 -577
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/SKILL.md +0 -271
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/STEP-BY-STEP-GUIDE.md +0 -466
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/STRUCTURE.md +0 -583
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/WEB-RESEARCH.md +0 -526
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/reference.md +0 -465
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/scripts/generate-structure.sh +0 -328
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/scripts/validate-skill.sh +0 -312
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/SKILL_TEMPLATE.md +0 -245
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/examples-template.md +0 -285
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/reference-template.md +0 -278
- moai_adk/templates/.claude/skills/moai-cc-skill-factory/templates/scripts-template.sh +0 -303
- moai_adk/templates/.claude/skills/moai-cc-skills/SKILL.md +0 -291
- moai_adk/templates/.claude/skills/moai-cc-skills/templates/SKILL-template.md +0 -15
- moai_adk/templates/.claude/skills/moai-design-systems/SKILL.md +0 -802
- moai_adk/templates/.claude/skills/moai-design-systems/examples.md +0 -1238
- moai_adk/templates/.claude/skills/moai-design-systems/reference.md +0 -673
- moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +0 -290
- moai_adk/templates/.claude/skills/moai-domain-backend/examples.md +0 -1633
- moai_adk/templates/.claude/skills/moai-domain-backend/reference.md +0 -660
- moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-domain-cli-tool/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-domain-cli-tool/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-domain-data-science/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-domain-data-science/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-domain-database/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-domain-database/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +0 -124
- moai_adk/templates/.claude/skills/moai-domain-devops/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-domain-devops/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +0 -128
- moai_adk/templates/.claude/skills/moai-domain-frontend/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-domain-frontend/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-domain-ml/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-domain-ml/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-domain-mobile-app/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-domain-mobile-app/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-domain-security/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-domain-security/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-domain-web-api/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-domain-web-api/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +0 -303
- moai_adk/templates/.claude/skills/moai-essentials-debug/examples.md +0 -1064
- moai_adk/templates/.claude/skills/moai-essentials-debug/reference.md +0 -1047
- moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-essentials-perf/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-essentials-perf/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-essentials-refactor/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-essentials-refactor/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-essentials-review/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-essentials-review/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +0 -116
- moai_adk/templates/.claude/skills/moai-foundation-ears/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-foundation-ears/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +0 -122
- moai_adk/templates/.claude/skills/moai-foundation-git/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-foundation-git/reference.md +0 -29
- moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-foundation-langs/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-foundation-langs/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-foundation-specs/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-foundation-specs/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +0 -113
- moai_adk/templates/.claude/skills/moai-foundation-tags/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-foundation-tags/reference.md +0 -28
- moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +0 -307
- moai_adk/templates/.claude/skills/moai-foundation-trust/examples.md +0 -0
- moai_adk/templates/.claude/skills/moai-foundation-trust/reference.md +0 -1099
- moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +0 -124
- moai_adk/templates/.claude/skills/moai-lang-c/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-c/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +0 -124
- moai_adk/templates/.claude/skills/moai-lang-cpp/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-cpp/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-lang-csharp/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-csharp/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-lang-dart/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-dart/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +0 -127
- moai_adk/templates/.claude/skills/moai-lang-go/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-go/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +0 -126
- moai_adk/templates/.claude/skills/moai-lang-java/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-java/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +0 -125
- moai_adk/templates/.claude/skills/moai-lang-javascript/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-javascript/reference.md +0 -32
- moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +0 -124
- moai_adk/templates/.claude/skills/moai-lang-kotlin/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-kotlin/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +0 -126
- moai_adk/templates/.claude/skills/moai-lang-php/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-php/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +0 -433
- moai_adk/templates/.claude/skills/moai-lang-python/examples.md +0 -624
- moai_adk/templates/.claude/skills/moai-lang-python/reference.md +0 -316
- moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-lang-r/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-r/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +0 -124
- moai_adk/templates/.claude/skills/moai-lang-ruby/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-ruby/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +0 -127
- moai_adk/templates/.claude/skills/moai-lang-rust/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-rust/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +0 -125
- moai_adk/templates/.claude/skills/moai-lang-scala/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-scala/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-lang-shell/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-shell/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +0 -124
- moai_adk/templates/.claude/skills/moai-lang-sql/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-sql/reference.md +0 -31
- moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +0 -123
- moai_adk/templates/.claude/skills/moai-lang-swift/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-swift/reference.md +0 -30
- moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +0 -133
- moai_adk/templates/.claude/skills/moai-lang-typescript/examples.md +0 -29
- moai_adk/templates/.claude/skills/moai-lang-typescript/reference.md +0 -34
- moai_adk/templates/.claude/skills/moai-project-documentation.md +0 -622
- moai_adk/templates/.github/workflows/c-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/cpp-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/csharp-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/dart-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/go-tag-validation.yml +0 -130
- moai_adk/templates/.github/workflows/java-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/javascript-tag-validation.yml +0 -135
- moai_adk/templates/.github/workflows/kotlin-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/php-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/python-tag-validation.yml +0 -118
- moai_adk/templates/.github/workflows/release.yml +0 -118
- moai_adk/templates/.github/workflows/ruby-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/rust-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/shell-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/swift-tag-validation.yml +0 -11
- moai_adk/templates/.github/workflows/tag-report.yml +0 -269
- moai_adk/templates/.github/workflows/tag-validation.yml +0 -186
- moai_adk/templates/.github/workflows/typescript-tag-validation.yml +0 -154
- moai_adk/templates/.moai/config.json +0 -115
- moai_adk/templates/workflows/go-tag-validation.yml +0 -30
- moai_adk/templates/workflows/javascript-tag-validation.yml +0 -41
- moai_adk/templates/workflows/python-tag-validation.yml +0 -42
- moai_adk/templates/workflows/typescript-tag-validation.yml +0 -31
- moai_adk-0.15.0.dist-info/METADATA +0 -3079
- moai_adk-0.15.0.dist-info/RECORD +0 -365
- {moai_adk-0.15.0.dist-info → moai_adk-0.25.4.dist-info}/WHEEL +0 -0
- {moai_adk-0.15.0.dist-info → moai_adk-0.25.4.dist-info}/entry_points.txt +0 -0
- {moai_adk-0.15.0.dist-info → moai_adk-0.25.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# type: ignore
|
|
2
|
+
#!/usr/bin/env python3
|
|
3
|
+
"""
|
|
4
|
+
Claude Code Statusline Integration
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Main entry point for MoAI-ADK statusline rendering in Claude Code.
|
|
8
|
+
Collects all necessary information from the project and renders it
|
|
9
|
+
in the specified format for display in the status bar.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
import json
|
|
13
|
+
import os
|
|
14
|
+
import sys
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
from typing import Optional
|
|
17
|
+
|
|
18
|
+
from .alfred_detector import AlfredDetector
|
|
19
|
+
from .config import StatuslineConfig
|
|
20
|
+
from .git_collector import GitCollector
|
|
21
|
+
from .metrics_tracker import MetricsTracker
|
|
22
|
+
from .renderer import StatuslineData, StatuslineRenderer
|
|
23
|
+
from .update_checker import UpdateChecker
|
|
24
|
+
from .version_reader import VersionReader
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def read_session_context() -> dict:
|
|
28
|
+
"""
|
|
29
|
+
Read JSON context from stdin (sent by Claude Code).
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
Dictionary containing session information
|
|
33
|
+
"""
|
|
34
|
+
try:
|
|
35
|
+
input_data = sys.stdin.read()
|
|
36
|
+
if input_data:
|
|
37
|
+
return json.loads(input_data)
|
|
38
|
+
return {}
|
|
39
|
+
except (json.JSONDecodeError, EOFError, ValueError):
|
|
40
|
+
return {}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def safe_collect_git_info() -> tuple[str, str]:
|
|
44
|
+
"""
|
|
45
|
+
Safely collect git information with fallback.
|
|
46
|
+
|
|
47
|
+
Returns:
|
|
48
|
+
Tuple of (branch_name, git_status_str)
|
|
49
|
+
"""
|
|
50
|
+
try:
|
|
51
|
+
collector = GitCollector()
|
|
52
|
+
git_info = collector.collect_git_info()
|
|
53
|
+
|
|
54
|
+
branch = git_info.branch or "unknown"
|
|
55
|
+
git_status = f"+{git_info.staged} M{git_info.modified} ?{git_info.untracked}"
|
|
56
|
+
|
|
57
|
+
return branch, git_status
|
|
58
|
+
except Exception:
|
|
59
|
+
return "N/A", ""
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def safe_collect_duration() -> str:
|
|
63
|
+
"""
|
|
64
|
+
Safely collect session duration with fallback.
|
|
65
|
+
|
|
66
|
+
Returns:
|
|
67
|
+
Formatted duration string
|
|
68
|
+
"""
|
|
69
|
+
try:
|
|
70
|
+
tracker = MetricsTracker()
|
|
71
|
+
return tracker.get_duration()
|
|
72
|
+
except Exception:
|
|
73
|
+
return "0m"
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def safe_collect_alfred_task() -> str:
|
|
77
|
+
"""
|
|
78
|
+
Safely collect active Alfred task with fallback.
|
|
79
|
+
|
|
80
|
+
Returns:
|
|
81
|
+
Formatted task string
|
|
82
|
+
"""
|
|
83
|
+
try:
|
|
84
|
+
detector = AlfredDetector()
|
|
85
|
+
task = detector.detect_active_task()
|
|
86
|
+
|
|
87
|
+
if task.command:
|
|
88
|
+
stage_suffix = f"-{task.stage}" if task.stage else ""
|
|
89
|
+
return f"[{task.command.upper()}{stage_suffix}]"
|
|
90
|
+
return ""
|
|
91
|
+
except Exception:
|
|
92
|
+
return ""
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def safe_collect_version() -> str:
|
|
96
|
+
"""
|
|
97
|
+
Safely collect MoAI-ADK version with fallback.
|
|
98
|
+
|
|
99
|
+
Returns:
|
|
100
|
+
Version string
|
|
101
|
+
"""
|
|
102
|
+
try:
|
|
103
|
+
reader = VersionReader()
|
|
104
|
+
version = reader.get_version()
|
|
105
|
+
return version or "unknown"
|
|
106
|
+
except Exception:
|
|
107
|
+
return "unknown"
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
# safe_collect_output_style function removed - no longer needed
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def safe_check_update(current_version: str) -> tuple[bool, Optional[str]]:
|
|
114
|
+
"""
|
|
115
|
+
Safely check for updates with fallback.
|
|
116
|
+
|
|
117
|
+
Args:
|
|
118
|
+
current_version: Current version string
|
|
119
|
+
|
|
120
|
+
Returns:
|
|
121
|
+
Tuple of (update_available, latest_version)
|
|
122
|
+
"""
|
|
123
|
+
try:
|
|
124
|
+
checker = UpdateChecker()
|
|
125
|
+
update_info = checker.check_for_update(current_version)
|
|
126
|
+
|
|
127
|
+
return update_info.available, update_info.latest_version
|
|
128
|
+
except Exception:
|
|
129
|
+
return False, None
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def build_statusline_data(session_context: dict, mode: str = "compact") -> str:
|
|
133
|
+
"""
|
|
134
|
+
Build complete statusline string from all data sources.
|
|
135
|
+
|
|
136
|
+
Collects information from:
|
|
137
|
+
- Claude Code session context
|
|
138
|
+
- Git repository
|
|
139
|
+
- Session metrics
|
|
140
|
+
- Alfred workflow state
|
|
141
|
+
- MoAI-ADK version
|
|
142
|
+
- Update checker
|
|
143
|
+
|
|
144
|
+
Args:
|
|
145
|
+
session_context: Context passed from Claude Code
|
|
146
|
+
mode: Display mode (compact, extended, minimal)
|
|
147
|
+
|
|
148
|
+
Returns:
|
|
149
|
+
Rendered statusline string
|
|
150
|
+
"""
|
|
151
|
+
try:
|
|
152
|
+
# Extract model from session context
|
|
153
|
+
model_info = session_context.get("model", {})
|
|
154
|
+
model = model_info.get("display_name", "Unknown")
|
|
155
|
+
if not model:
|
|
156
|
+
model = model_info.get("name", "Unknown")
|
|
157
|
+
|
|
158
|
+
# Extract directory
|
|
159
|
+
cwd = session_context.get("cwd", "")
|
|
160
|
+
if cwd:
|
|
161
|
+
directory = Path(cwd).name or Path(cwd).parent.name or "project"
|
|
162
|
+
else:
|
|
163
|
+
directory = "project"
|
|
164
|
+
|
|
165
|
+
# Collect all information
|
|
166
|
+
branch, git_status = safe_collect_git_info()
|
|
167
|
+
duration = safe_collect_duration()
|
|
168
|
+
active_task = safe_collect_alfred_task()
|
|
169
|
+
version = safe_collect_version()
|
|
170
|
+
update_available, latest_version = safe_check_update(version)
|
|
171
|
+
|
|
172
|
+
# Build StatuslineData with dynamic fields
|
|
173
|
+
data = StatuslineData(
|
|
174
|
+
model=model,
|
|
175
|
+
version=version,
|
|
176
|
+
memory_usage="256MB", # TODO: Get actual memory usage
|
|
177
|
+
branch=branch,
|
|
178
|
+
git_status=git_status,
|
|
179
|
+
duration=duration,
|
|
180
|
+
directory=directory,
|
|
181
|
+
active_task=active_task,
|
|
182
|
+
update_available=update_available,
|
|
183
|
+
latest_version=latest_version,
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
# Render statusline with labeled sections
|
|
187
|
+
renderer = StatuslineRenderer()
|
|
188
|
+
statusline = renderer.render(data, mode=mode)
|
|
189
|
+
|
|
190
|
+
return statusline
|
|
191
|
+
|
|
192
|
+
except Exception as e:
|
|
193
|
+
# Graceful degradation on any error
|
|
194
|
+
import logging
|
|
195
|
+
|
|
196
|
+
logging.warning(f"Statusline rendering error: {e}")
|
|
197
|
+
return ""
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def main():
|
|
201
|
+
"""
|
|
202
|
+
Main entry point for Claude Code statusline.
|
|
203
|
+
|
|
204
|
+
Reads JSON from stdin, processes all information,
|
|
205
|
+
and outputs the formatted statusline string.
|
|
206
|
+
"""
|
|
207
|
+
# Read session context from Claude Code
|
|
208
|
+
session_context = read_session_context()
|
|
209
|
+
|
|
210
|
+
# Load configuration
|
|
211
|
+
config = StatuslineConfig()
|
|
212
|
+
|
|
213
|
+
# Determine display mode (priority: session context > environment > config > default)
|
|
214
|
+
mode = (
|
|
215
|
+
session_context.get("statusline", {}).get("mode")
|
|
216
|
+
or os.environ.get("MOAI_STATUSLINE_MODE")
|
|
217
|
+
or config.get("statusline.mode")
|
|
218
|
+
or "extended"
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
# Build and output statusline
|
|
222
|
+
statusline = build_statusline_data(session_context, mode=mode)
|
|
223
|
+
if statusline:
|
|
224
|
+
print(statusline, end="")
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
if __name__ == "__main__":
|
|
228
|
+
main()
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# type: ignore
|
|
2
|
+
"""
|
|
3
|
+
Session metrics tracker for statusline
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import logging
|
|
8
|
+
from datetime import datetime, timedelta
|
|
9
|
+
from typing import Optional
|
|
10
|
+
|
|
11
|
+
logger = logging.getLogger(__name__)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class MetricsTracker:
|
|
15
|
+
"""Tracks session duration with 10-second caching"""
|
|
16
|
+
|
|
17
|
+
# Configuration
|
|
18
|
+
_CACHE_TTL_SECONDS = 10
|
|
19
|
+
|
|
20
|
+
def __init__(self):
|
|
21
|
+
"""Initialize metrics tracker"""
|
|
22
|
+
self._session_start: datetime = datetime.now()
|
|
23
|
+
self._duration_cache: Optional[str] = None
|
|
24
|
+
self._cache_time: Optional[datetime] = None
|
|
25
|
+
self._cache_ttl = timedelta(seconds=self._CACHE_TTL_SECONDS)
|
|
26
|
+
|
|
27
|
+
def get_duration(self) -> str:
|
|
28
|
+
"""
|
|
29
|
+
Get formatted session duration
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
Formatted duration string (e.g., "5m", "1h 30m")
|
|
33
|
+
"""
|
|
34
|
+
# Check cache validity
|
|
35
|
+
if self._is_cache_valid():
|
|
36
|
+
return self._duration_cache
|
|
37
|
+
|
|
38
|
+
# Calculate and format duration
|
|
39
|
+
duration = self._calculate_and_format_duration()
|
|
40
|
+
self._update_cache(duration)
|
|
41
|
+
return duration
|
|
42
|
+
|
|
43
|
+
def _calculate_and_format_duration(self) -> str:
|
|
44
|
+
"""
|
|
45
|
+
Calculate session duration and format it
|
|
46
|
+
|
|
47
|
+
Returns:
|
|
48
|
+
Formatted duration string
|
|
49
|
+
"""
|
|
50
|
+
elapsed = datetime.now() - self._session_start
|
|
51
|
+
total_seconds = int(elapsed.total_seconds())
|
|
52
|
+
|
|
53
|
+
# Format based on duration range
|
|
54
|
+
if total_seconds < 60:
|
|
55
|
+
return f"{total_seconds}s"
|
|
56
|
+
elif total_seconds < 3600:
|
|
57
|
+
minutes = total_seconds // 60
|
|
58
|
+
seconds = total_seconds % 60
|
|
59
|
+
if seconds > 0:
|
|
60
|
+
return f"{minutes}m {seconds}s"
|
|
61
|
+
return f"{minutes}m"
|
|
62
|
+
else:
|
|
63
|
+
hours = total_seconds // 3600
|
|
64
|
+
minutes = (total_seconds % 3600) // 60
|
|
65
|
+
if minutes > 0:
|
|
66
|
+
return f"{hours}h {minutes}m"
|
|
67
|
+
return f"{hours}h"
|
|
68
|
+
|
|
69
|
+
def _is_cache_valid(self) -> bool:
|
|
70
|
+
"""Check if duration cache is still valid"""
|
|
71
|
+
if self._duration_cache is None or self._cache_time is None:
|
|
72
|
+
return False
|
|
73
|
+
return datetime.now() - self._cache_time < self._cache_ttl
|
|
74
|
+
|
|
75
|
+
def _update_cache(self, duration: str) -> None:
|
|
76
|
+
"""Update duration cache"""
|
|
77
|
+
self._duration_cache = duration
|
|
78
|
+
self._cache_time = datetime.now()
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Statusline renderer for Claude Code status display
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
# type: ignore
|
|
7
|
+
|
|
8
|
+
from dataclasses import dataclass
|
|
9
|
+
from typing import List
|
|
10
|
+
|
|
11
|
+
from .config import StatuslineConfig # type: ignore[attr-defined]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass
|
|
15
|
+
class StatuslineData:
|
|
16
|
+
"""Status line data structure containing all necessary information"""
|
|
17
|
+
|
|
18
|
+
model: str
|
|
19
|
+
version: str
|
|
20
|
+
memory_usage: str
|
|
21
|
+
branch: str
|
|
22
|
+
git_status: str
|
|
23
|
+
duration: str
|
|
24
|
+
directory: str
|
|
25
|
+
active_task: str
|
|
26
|
+
update_available: bool = False
|
|
27
|
+
latest_version: str = ""
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class StatuslineRenderer:
|
|
31
|
+
"""Renders status information in various modes (compact, extended, minimal)"""
|
|
32
|
+
|
|
33
|
+
# Constraints for each mode
|
|
34
|
+
_MODE_CONSTRAINTS = {
|
|
35
|
+
"compact": 80,
|
|
36
|
+
"extended": 120,
|
|
37
|
+
"minimal": 40,
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
def __init__(self):
|
|
41
|
+
"""Initialize renderer with configuration"""
|
|
42
|
+
self._config = StatuslineConfig()
|
|
43
|
+
self._format_config = self._config.get_format_config()
|
|
44
|
+
self._display_config = self._config.get_display_config()
|
|
45
|
+
|
|
46
|
+
def render(self, data: StatuslineData, mode: str = "compact") -> str:
|
|
47
|
+
"""
|
|
48
|
+
Render statusline with given data in specified mode
|
|
49
|
+
|
|
50
|
+
Args:
|
|
51
|
+
data: StatuslineData instance with all required fields
|
|
52
|
+
mode: Display mode - "compact" (80 chars), "extended" (120 chars), "minimal" (40 chars)
|
|
53
|
+
|
|
54
|
+
Returns:
|
|
55
|
+
Formatted statusline string
|
|
56
|
+
"""
|
|
57
|
+
render_method = {
|
|
58
|
+
"compact": self._render_compact,
|
|
59
|
+
"extended": self._render_extended,
|
|
60
|
+
"minimal": self._render_minimal,
|
|
61
|
+
}.get(mode, self._render_compact)
|
|
62
|
+
|
|
63
|
+
return render_method(data)
|
|
64
|
+
|
|
65
|
+
def _render_compact(self, data: StatuslineData) -> str:
|
|
66
|
+
"""
|
|
67
|
+
Render compact mode: [MODEL] [DURATION] | [DIR] | [VERSION] | [BRANCH] | [GIT] | [TASK]
|
|
68
|
+
Constraint: <= 80 characters
|
|
69
|
+
|
|
70
|
+
Args:
|
|
71
|
+
data: StatuslineData instance
|
|
72
|
+
|
|
73
|
+
Returns:
|
|
74
|
+
Formatted statusline string (max 80 chars)
|
|
75
|
+
"""
|
|
76
|
+
max_length = self._MODE_CONSTRAINTS["compact"]
|
|
77
|
+
parts = self._build_compact_parts(data)
|
|
78
|
+
result = self._format_config.separator.join(parts)
|
|
79
|
+
|
|
80
|
+
# Adjust if too long
|
|
81
|
+
if len(result) > max_length:
|
|
82
|
+
result = self._fit_to_constraint(data, max_length)
|
|
83
|
+
|
|
84
|
+
return result
|
|
85
|
+
|
|
86
|
+
def _build_compact_parts(self, data: StatuslineData) -> List[str]:
|
|
87
|
+
"""
|
|
88
|
+
Build parts list for compact mode with labeled sections
|
|
89
|
+
Format: 🤖 Model | 🗿 Version | Output Style | 📋 TODO | 🔀 Git: Branch | Changes
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
data: StatuslineData instance
|
|
93
|
+
|
|
94
|
+
Returns:
|
|
95
|
+
List of parts to be joined
|
|
96
|
+
"""
|
|
97
|
+
parts = []
|
|
98
|
+
|
|
99
|
+
# Add model if display enabled (most important - cloud service context)
|
|
100
|
+
if self._display_config.model:
|
|
101
|
+
parts.append(f"🤖 {data.model}")
|
|
102
|
+
|
|
103
|
+
# Add version if display enabled (system status)
|
|
104
|
+
if self._display_config.version:
|
|
105
|
+
parts.append(f"🗿 Ver {data.version}")
|
|
106
|
+
|
|
107
|
+
# Add git status if display enabled and status not empty
|
|
108
|
+
if self._display_config.git_status and data.git_status:
|
|
109
|
+
parts.append(f"📊 {data.git_status}")
|
|
110
|
+
|
|
111
|
+
# Add Git info (development context)
|
|
112
|
+
if self._display_config.branch:
|
|
113
|
+
parts.append(f"🔀 {data.branch}")
|
|
114
|
+
|
|
115
|
+
# Add active_task if display enabled and not empty
|
|
116
|
+
if self._display_config.active_task and data.active_task.strip():
|
|
117
|
+
parts.append(data.active_task)
|
|
118
|
+
|
|
119
|
+
return parts
|
|
120
|
+
|
|
121
|
+
def _fit_to_constraint(self, data: StatuslineData, max_length: int) -> str:
|
|
122
|
+
"""
|
|
123
|
+
Fit statusline to character constraint by truncating
|
|
124
|
+
Format: 🤖 Model | 🗿 Version | Output Style | 📋 TODO | 🔀 Git: Branch | Changes
|
|
125
|
+
|
|
126
|
+
Args:
|
|
127
|
+
data: StatuslineData instance
|
|
128
|
+
max_length: Maximum allowed length
|
|
129
|
+
|
|
130
|
+
Returns:
|
|
131
|
+
Truncated statusline string
|
|
132
|
+
"""
|
|
133
|
+
# Try with truncated branch first
|
|
134
|
+
truncated_branch = self._truncate_branch(data.branch, max_length=20)
|
|
135
|
+
parts = [
|
|
136
|
+
f"🤖 {data.model}",
|
|
137
|
+
f"🗿 Ver {data.version}",
|
|
138
|
+
]
|
|
139
|
+
|
|
140
|
+
# Add git status if display enabled and status not empty
|
|
141
|
+
if self._display_config.git_status and data.git_status:
|
|
142
|
+
parts.append(f"📊 {data.git_status}")
|
|
143
|
+
|
|
144
|
+
# Add Git info
|
|
145
|
+
parts.append(f"🔀 {truncated_branch}")
|
|
146
|
+
|
|
147
|
+
# Only add active_task if it's not empty
|
|
148
|
+
if data.active_task.strip():
|
|
149
|
+
parts.append(data.active_task)
|
|
150
|
+
|
|
151
|
+
result = self._format_config.separator.join(parts)
|
|
152
|
+
|
|
153
|
+
# If still too long, try more aggressive branch truncation
|
|
154
|
+
if len(result) > max_length:
|
|
155
|
+
truncated_branch = self._truncate_branch(data.branch, max_length=12)
|
|
156
|
+
parts = [
|
|
157
|
+
f"🤖 {data.model}",
|
|
158
|
+
f"🗿 Ver {data.version}",
|
|
159
|
+
]
|
|
160
|
+
if data.git_status:
|
|
161
|
+
parts.append(f"📊 {data.git_status}")
|
|
162
|
+
parts.append(f"🔀 {truncated_branch}")
|
|
163
|
+
if data.active_task.strip():
|
|
164
|
+
parts.append(data.active_task)
|
|
165
|
+
result = self._format_config.separator.join(parts)
|
|
166
|
+
|
|
167
|
+
# If still too long, remove active_task
|
|
168
|
+
if len(result) > max_length and data.active_task.strip():
|
|
169
|
+
parts = [
|
|
170
|
+
f"🤖 {data.model}",
|
|
171
|
+
f"🗿 Ver {data.version}",
|
|
172
|
+
]
|
|
173
|
+
if data.git_status:
|
|
174
|
+
parts.append(f"📊 {data.git_status}")
|
|
175
|
+
parts.append(f"🔀 {truncated_branch}")
|
|
176
|
+
result = self._format_config.separator.join(parts)
|
|
177
|
+
|
|
178
|
+
# Final fallback to minimal if still too long
|
|
179
|
+
if len(result) > max_length:
|
|
180
|
+
result = self._render_minimal(data)
|
|
181
|
+
|
|
182
|
+
return result
|
|
183
|
+
|
|
184
|
+
def _render_extended(self, data: StatuslineData) -> str:
|
|
185
|
+
"""
|
|
186
|
+
Render extended mode: Full path and detailed info with labels
|
|
187
|
+
Constraint: <= 120 characters
|
|
188
|
+
Format: 🤖 Model | 🗿 Version | Output Style | 📋 TODO | 🔀 Git: Branch | Changes
|
|
189
|
+
|
|
190
|
+
Args:
|
|
191
|
+
data: StatuslineData instance
|
|
192
|
+
|
|
193
|
+
Returns:
|
|
194
|
+
Formatted statusline string (max 120 chars)
|
|
195
|
+
"""
|
|
196
|
+
branch = self._truncate_branch(data.branch, max_length=30)
|
|
197
|
+
|
|
198
|
+
parts = []
|
|
199
|
+
|
|
200
|
+
# Add model if display enabled
|
|
201
|
+
if self._display_config.model:
|
|
202
|
+
parts.append(f"🤖 {data.model}")
|
|
203
|
+
|
|
204
|
+
# Add version if display enabled
|
|
205
|
+
if self._display_config.version:
|
|
206
|
+
parts.append(f"🗿 Ver {data.version}")
|
|
207
|
+
|
|
208
|
+
# Add git status if display enabled and status not empty
|
|
209
|
+
if self._display_config.git_status and data.git_status:
|
|
210
|
+
parts.append(f"📊 {data.git_status}")
|
|
211
|
+
|
|
212
|
+
# Add Git info (development context)
|
|
213
|
+
if self._display_config.branch:
|
|
214
|
+
parts.append(f"🔀 {branch}")
|
|
215
|
+
|
|
216
|
+
# Add active_task if display enabled and not empty
|
|
217
|
+
if self._display_config.active_task and data.active_task.strip():
|
|
218
|
+
parts.append(data.active_task)
|
|
219
|
+
|
|
220
|
+
result = self._format_config.separator.join(parts)
|
|
221
|
+
|
|
222
|
+
# If exceeds limit, try truncating branch
|
|
223
|
+
if len(result) > 120:
|
|
224
|
+
branch = self._truncate_branch(data.branch, max_length=20)
|
|
225
|
+
parts = [
|
|
226
|
+
f"🤖 {data.model}",
|
|
227
|
+
f"🗿 Ver {data.version}",
|
|
228
|
+
]
|
|
229
|
+
|
|
230
|
+
# Add optional parts only if they have content
|
|
231
|
+
if self._display_config.output_style and data.output_style.strip():
|
|
232
|
+
# Use Yoda-specific emoji for Yoda styles only
|
|
233
|
+
if "yoda" in data.output_style.lower() or "Yoda Master" in data.output_style:
|
|
234
|
+
parts.append(f"🧙 {data.output_style}")
|
|
235
|
+
else:
|
|
236
|
+
parts.append(f"{data.output_style}")
|
|
237
|
+
if self._display_config.todo_count and data.todo_count.strip():
|
|
238
|
+
parts.append(f"📋 {data.todo_count}")
|
|
239
|
+
|
|
240
|
+
parts.append(f"🔀 {branch}")
|
|
241
|
+
|
|
242
|
+
if data.git_status:
|
|
243
|
+
parts.append(f"Changes: {data.git_status}")
|
|
244
|
+
if data.active_task.strip():
|
|
245
|
+
parts.append(data.active_task)
|
|
246
|
+
result = self._format_config.separator.join(parts)
|
|
247
|
+
|
|
248
|
+
return result
|
|
249
|
+
|
|
250
|
+
def _render_minimal(self, data: StatuslineData) -> str:
|
|
251
|
+
"""
|
|
252
|
+
Render minimal mode: Extreme space constraint with minimal labels
|
|
253
|
+
Constraint: <= 40 characters
|
|
254
|
+
Format: 🤖 Model | 🗿 Ver Version | Changes: +staged M modified ? untracked
|
|
255
|
+
|
|
256
|
+
Args:
|
|
257
|
+
data: StatuslineData instance
|
|
258
|
+
|
|
259
|
+
Returns:
|
|
260
|
+
Formatted statusline string (max 40 chars)
|
|
261
|
+
"""
|
|
262
|
+
parts = []
|
|
263
|
+
|
|
264
|
+
# Add model if display enabled
|
|
265
|
+
if self._display_config.model:
|
|
266
|
+
parts.append(f"🤖 {data.model}")
|
|
267
|
+
|
|
268
|
+
# Add version if display enabled
|
|
269
|
+
if self._display_config.version:
|
|
270
|
+
parts.append(f"🗿 Ver {self._truncate_version(data.version)}")
|
|
271
|
+
|
|
272
|
+
result = self._format_config.separator.join(parts)
|
|
273
|
+
|
|
274
|
+
# Add git_status if it fits (use abbreviated format for minimal)
|
|
275
|
+
# and if display is enabled and status not empty
|
|
276
|
+
if self._display_config.git_status and data.git_status:
|
|
277
|
+
status_label = f"Chg: {data.git_status}"
|
|
278
|
+
if (
|
|
279
|
+
len(result) + len(status_label) + len(self._format_config.separator)
|
|
280
|
+
<= 40
|
|
281
|
+
):
|
|
282
|
+
result += f"{self._format_config.separator}{status_label}"
|
|
283
|
+
|
|
284
|
+
return result
|
|
285
|
+
|
|
286
|
+
@staticmethod
|
|
287
|
+
def _truncate_branch(branch: str, max_length: int = 20) -> str:
|
|
288
|
+
"""
|
|
289
|
+
Truncate branch name intelligently, preserving SPEC ID if present
|
|
290
|
+
|
|
291
|
+
Args:
|
|
292
|
+
branch: Branch name to truncate
|
|
293
|
+
max_length: Maximum allowed length
|
|
294
|
+
|
|
295
|
+
Returns:
|
|
296
|
+
Truncated branch name
|
|
297
|
+
"""
|
|
298
|
+
if len(branch) <= max_length:
|
|
299
|
+
return branch
|
|
300
|
+
|
|
301
|
+
# Try to preserve SPEC ID in feature branches
|
|
302
|
+
if "SPEC" in branch:
|
|
303
|
+
parts = branch.split("-")
|
|
304
|
+
for i, part in enumerate(parts):
|
|
305
|
+
if "SPEC" in part and i + 1 < len(parts):
|
|
306
|
+
# Found SPEC ID, include it
|
|
307
|
+
spec_truncated = "-".join(parts[: i + 2])
|
|
308
|
+
if len(spec_truncated) <= max_length:
|
|
309
|
+
return spec_truncated
|
|
310
|
+
|
|
311
|
+
# Simple truncation with ellipsis for very long names
|
|
312
|
+
return f"{branch[:max_length-1]}…" if len(branch) > max_length else branch
|
|
313
|
+
|
|
314
|
+
@staticmethod
|
|
315
|
+
def _truncate_version(version: str) -> str:
|
|
316
|
+
"""
|
|
317
|
+
Truncate version string for minimal display by removing 'v' prefix
|
|
318
|
+
|
|
319
|
+
Args:
|
|
320
|
+
version: Version string (e.g., "v0.20.1" or "0.20.1")
|
|
321
|
+
|
|
322
|
+
Returns:
|
|
323
|
+
Truncated version string
|
|
324
|
+
"""
|
|
325
|
+
if version.startswith("v"):
|
|
326
|
+
return version[1:]
|
|
327
|
+
return version
|