@pennyfarthing/core 11.2.0 → 11.2.1
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.
- package/README.md +1 -1
- package/package.json +2 -1
- package/packages/core/dist/cli/commands/doctor.d.ts.map +1 -1
- package/packages/core/dist/cli/commands/doctor.js +381 -66
- package/packages/core/dist/cli/commands/doctor.js.map +1 -1
- package/packages/core/dist/cli/commands/init.js +4 -4
- package/packages/core/dist/cli/commands/init.js.map +1 -1
- package/packages/core/dist/cli/commands/update.d.ts.map +1 -1
- package/packages/core/dist/cli/commands/update.js +4 -5
- package/packages/core/dist/cli/commands/update.js.map +1 -1
- package/packages/core/dist/cli/utils/constants.d.ts +3 -8
- package/packages/core/dist/cli/utils/constants.d.ts.map +1 -1
- package/packages/core/dist/cli/utils/constants.js +3 -4
- package/packages/core/dist/cli/utils/constants.js.map +1 -1
- package/packages/core/dist/cli/utils/settings.d.ts +11 -0
- package/packages/core/dist/cli/utils/settings.d.ts.map +1 -1
- package/packages/core/dist/cli/utils/settings.js +65 -29
- package/packages/core/dist/cli/utils/settings.js.map +1 -1
- package/packages/core/dist/cli/utils/symlinks.js +16 -16
- package/packages/core/dist/cli/utils/symlinks.js.map +1 -1
- package/packages/core/dist/consultation/tandem-metrics.d.ts +91 -0
- package/packages/core/dist/consultation/tandem-metrics.d.ts.map +1 -0
- package/packages/core/dist/consultation/tandem-metrics.js +131 -0
- package/packages/core/dist/consultation/tandem-metrics.js.map +1 -0
- package/packages/core/dist/consultation/tandem-metrics.test.d.ts +18 -0
- package/packages/core/dist/consultation/tandem-metrics.test.d.ts.map +1 -0
- package/packages/core/dist/consultation/tandem-metrics.test.js +457 -0
- package/packages/core/dist/consultation/tandem-metrics.test.js.map +1 -0
- package/packages/core/dist/public/js/react/react.js +14 -14
- package/packages/core/dist/scripts/benchmark-integration.d.ts +182 -0
- package/packages/core/dist/scripts/benchmark-integration.d.ts.map +1 -0
- package/packages/core/dist/scripts/benchmark-integration.js +691 -0
- package/packages/core/dist/scripts/benchmark-integration.js.map +1 -0
- package/packages/core/dist/scripts/job-fair-aggregator.d.ts +150 -0
- package/packages/core/dist/scripts/job-fair-aggregator.d.ts.map +1 -0
- package/packages/core/dist/scripts/job-fair-aggregator.js +547 -0
- package/packages/core/dist/scripts/job-fair-aggregator.js.map +1 -0
- package/packages/core/dist/server/api/agent-load.js +1 -1
- package/packages/core/dist/server/api/agent-load.js.map +1 -1
- package/packages/core/dist/server/server.d.ts +0 -3
- package/packages/core/dist/server/server.d.ts.map +1 -1
- package/packages/core/dist/server/server.js +3 -37
- package/packages/core/dist/server/server.js.map +1 -1
- package/packages/core/dist/server/server.test.d.ts +1 -1
- package/packages/core/dist/server/server.test.js +12 -23
- package/packages/core/dist/server/server.test.js.map +1 -1
- package/packages/core/dist/shared/capabilities.d.ts +88 -0
- package/packages/core/dist/shared/capabilities.d.ts.map +1 -0
- package/packages/core/dist/shared/capabilities.js +133 -0
- package/packages/core/dist/shared/capabilities.js.map +1 -0
- package/packages/core/dist/shared/capabilities.test.d.ts +2 -0
- package/packages/core/dist/shared/capabilities.test.d.ts.map +1 -0
- package/packages/core/dist/shared/capabilities.test.js +217 -0
- package/packages/core/dist/shared/capabilities.test.js.map +1 -0
- package/packages/core/dist/shared/spawn-prompt.d.ts +47 -0
- package/packages/core/dist/shared/spawn-prompt.d.ts.map +1 -0
- package/packages/core/dist/shared/spawn-prompt.js +82 -0
- package/packages/core/dist/shared/spawn-prompt.js.map +1 -0
- package/packages/core/dist/shared/spawn-prompt.test.d.ts +2 -0
- package/packages/core/dist/shared/spawn-prompt.test.d.ts.map +1 -0
- package/packages/core/dist/shared/spawn-prompt.test.js +251 -0
- package/packages/core/dist/shared/spawn-prompt.test.js.map +1 -0
- package/packages/core/dist/workflow/tandem-workflow-templates.test.d.ts +18 -0
- package/packages/core/dist/workflow/tandem-workflow-templates.test.d.ts.map +1 -0
- package/packages/core/dist/workflow/tandem-workflow-templates.test.js +434 -0
- package/packages/core/dist/workflow/tandem-workflow-templates.test.js.map +1 -0
- package/packages/core/dist/workflow/workflow-schema.d.ts +32 -0
- package/packages/core/dist/workflow/workflow-schema.d.ts.map +1 -1
- package/packages/core/dist/workflow/workflow-schema.js +120 -0
- package/packages/core/dist/workflow/workflow-schema.js.map +1 -1
- package/packages/core/dist/workflow/workflow-schema.test.d.ts.map +1 -1
- package/packages/core/dist/workflow/workflow-schema.test.js +570 -1
- package/packages/core/dist/workflow/workflow-schema.test.js.map +1 -1
- package/pennyfarthing-dist/agents/dev.md +6 -10
- package/pennyfarthing-dist/agents/reviewer.md +8 -2
- package/pennyfarthing-dist/agents/sm-finish.md +18 -1
- package/pennyfarthing-dist/commands/pf-git.md +4 -2
- package/pennyfarthing-dist/gates/approval.md +63 -0
- package/pennyfarthing-dist/gates/confidence-sm.md +71 -0
- package/pennyfarthing-dist/gates/context-ok.md +56 -0
- package/pennyfarthing-dist/gates/evaluations/confidence-sm.md +54 -0
- package/pennyfarthing-dist/gates/quality-pass.md +67 -0
- package/pennyfarthing-dist/gates/tests-fail.md +84 -0
- package/pennyfarthing-dist/gates/tests-pass.md +79 -0
- package/pennyfarthing-dist/guides/agent-behavior.md +23 -19
- package/pennyfarthing-dist/guides/bell-mode.md +1 -1
- package/pennyfarthing-dist/guides/hooks.md +28 -28
- package/pennyfarthing-dist/guides/reflector.md +1 -1
- package/pennyfarthing-dist/guides/tandem-protocol.md +3 -3
- package/pennyfarthing-dist/scripts/core/check-context.sh +2 -0
- package/pennyfarthing-dist/scripts/core/phase-check-start.sh +5 -87
- package/pennyfarthing-dist/scripts/hooks/README.md +5 -5
- package/pennyfarthing-dist/scripts/hooks/__pycache__/question_reflector_check.cpython-314.pyc +0 -0
- package/pennyfarthing-dist/scripts/hooks/bell-mode-hook.sh +4 -183
- package/pennyfarthing-dist/scripts/hooks/context-circuit-breaker.sh +4 -95
- package/pennyfarthing-dist/scripts/hooks/context-warning.sh +4 -65
- package/pennyfarthing-dist/scripts/hooks/cyclist-pretooluse-hook.sh +3 -31
- package/pennyfarthing-dist/scripts/hooks/pre-commit.sh +27 -33
- package/pennyfarthing-dist/scripts/hooks/pre-edit-check.sh +4 -71
- package/pennyfarthing-dist/scripts/hooks/question-reflector-check.sh +3 -19
- package/pennyfarthing-dist/scripts/hooks/schema-validation.sh +4 -30
- package/pennyfarthing-dist/scripts/hooks/session-start.sh +3 -32
- package/pennyfarthing-dist/scripts/hooks/session-stop.sh +4 -65
- package/pennyfarthing-dist/scripts/hooks/sprint-yaml-validation.sh +4 -78
- package/pennyfarthing-dist/scripts/hooks/welcome-hook.sh +4 -93
- package/pennyfarthing-dist/scripts/misc/README.md +1 -1
- package/pennyfarthing-dist/scripts/misc/statusline.sh +4 -301
- package/pennyfarthing-dist/templates/settings.local.json.template +19 -10
- package/pennyfarthing-dist/workflows/tdd.yaml +11 -2
- package/pennyfarthing_scripts/CLAUDE.md +19 -10
- package/pennyfarthing_scripts/__pycache__/__init__.cpython-311.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/bellmode_hook.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/config.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/context.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/hooks.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/jira.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/jira_bidirectional_sync.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/jira_epic_creation.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/jira_sync.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/jira_sync_story.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/output.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/patch_mode.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/pretooluse_hook.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/schema_validation_hook.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/session_start_hook.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/sprint.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/workflow.cpython-311.pyc +0 -0
- package/pennyfarthing_scripts/__pycache__/workflow.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bc/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bc/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bc/__pycache__/focus.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bellmode_hook.py +12 -296
- package/pennyfarthing_scripts/bikerack/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/audit_log_panel.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/background_panel.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/base_panel.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/changed_panel.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/context_meter_footer.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/debug_panel.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/diffs_panel.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/events.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/git_panel.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/launcher.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/portrait_resolver.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/progress_panel.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/sprint_panel.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/story_detail_data.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/story_detail_screen.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/tui.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/__pycache__/ws_client.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/bikerack/audit_log_panel.py +119 -0
- package/pennyfarthing_scripts/bikerack/base_panel.py +27 -4
- package/pennyfarthing_scripts/bikerack/changed_panel.py +96 -4
- package/pennyfarthing_scripts/bikerack/context_meter_footer.py +88 -0
- package/pennyfarthing_scripts/bikerack/debug_panel.py +1 -1
- package/pennyfarthing_scripts/bikerack/diffs_panel.py +30 -0
- package/pennyfarthing_scripts/bikerack/events.py +28 -0
- package/pennyfarthing_scripts/bikerack/portrait_resolver.py +139 -0
- package/pennyfarthing_scripts/bikerack/sprint_panel.py +373 -142
- package/pennyfarthing_scripts/bikerack/story_detail_data.py +244 -0
- package/pennyfarthing_scripts/bikerack/story_detail_screen.py +176 -0
- package/pennyfarthing_scripts/bikerack/tui.py +293 -61
- package/pennyfarthing_scripts/brownfield/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/brownfield/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/brownfield/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/brownfield/__pycache__/discover.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/cli.py +5 -0
- package/pennyfarthing_scripts/codemarkers/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/codemarkers/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/codemarkers/__pycache__/analyze.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/codemarkers/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/codemarkers/__pycache__/formatters.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/codemarkers/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/common/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/common/__pycache__/config.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/common/__pycache__/output.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/common/__pycache__/themes.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/common/pr_config.py +38 -0
- package/pennyfarthing_scripts/complexity/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/complexity/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/complexity/__pycache__/analyze.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/complexity/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/complexity/__pycache__/formatters.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/complexity/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/consultation/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/consultation/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/consultation/__pycache__/dialogue_manager.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/deadcode/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/deadcode/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/deadcode/__pycache__/analyze.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/deadcode/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/deadcode/__pycache__/formatters.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/deadcode/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/dependencies/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/dependencies/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/dependencies/__pycache__/analyze.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/dependencies/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/dependencies/__pycache__/formatters.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/dependencies/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/epic/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/epic/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git/__pycache__/create_branches.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git/__pycache__/status_all.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git_group/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git_group/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/handoff/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/handoff/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/handoff/__pycache__/complete_phase.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/handoff/__pycache__/gate_file.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/handoff/__pycache__/gate_runner.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/handoff/__pycache__/marker.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/handoff/__pycache__/resolve_gate.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/handoff/cli.py +33 -1
- package/pennyfarthing_scripts/handoff/complete_phase.py +28 -0
- package/pennyfarthing_scripts/handoff/marker.py +15 -15
- package/pennyfarthing_scripts/handoff/phase_check.py +96 -0
- package/pennyfarthing_scripts/handoff/resolve_gate.py +13 -1
- package/pennyfarthing_scripts/healthscore/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/healthscore/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/healthscore/__pycache__/analyze.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/healthscore/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/healthscore/__pycache__/formatters.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/healthscore/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__init__.py +437 -0
- package/pennyfarthing_scripts/hooks/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/bell_mode.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/context_breaker.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/context_warning.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/cyclist_pretooluse.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/pre_edit_check.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/reflector_check.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/schema_validation.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/session_start.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/session_stop.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/sprint_yaml_validation.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/__pycache__/statusline.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hooks/bell_mode.py +215 -0
- package/pennyfarthing_scripts/hooks/cli.py +96 -0
- package/pennyfarthing_scripts/hooks/context_breaker.py +104 -0
- package/pennyfarthing_scripts/hooks/context_warning.py +66 -0
- package/pennyfarthing_scripts/hooks/cyclist_pretooluse.py +129 -0
- package/pennyfarthing_scripts/hooks/pre_edit_check.py +78 -0
- package/pennyfarthing_scripts/hooks/reflector_check.py +271 -0
- package/pennyfarthing_scripts/hooks/schema_validation.py +203 -0
- package/pennyfarthing_scripts/hooks/session_start.py +296 -0
- package/pennyfarthing_scripts/hooks/session_stop.py +111 -0
- package/pennyfarthing_scripts/hooks/sprint_yaml_validation.py +97 -0
- package/pennyfarthing_scripts/hooks/statusline.py +420 -0
- package/pennyfarthing_scripts/hooks.py +27 -432
- package/pennyfarthing_scripts/hotspots/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hotspots/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hotspots/__pycache__/analyze.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hotspots/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hotspots/__pycache__/formatters.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/hotspots/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/bidirectional.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/claim.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/client.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/compat.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/create.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/epic.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/mappings.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/operations.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/reconcile.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/story.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/jira/__pycache__/sync.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/launch/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/launch/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__pycache__/session.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__pycache__/skill.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__pycache__/step.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/migration/__pycache__/validate.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/preflight/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/preflight/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/preflight/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/preflight/__pycache__/finish.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/pretooluse_hook.py +3 -185
- package/pennyfarthing_scripts/prime/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/loader.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/models.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/persona.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/session.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/tiers.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/version_sentinel.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/workflow.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/workflow.py +2 -1
- package/pennyfarthing_scripts/schema_validation_hook.py +3 -298
- package/pennyfarthing_scripts/session/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/session/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/session_start_hook.py +4 -186
- package/pennyfarthing_scripts/sprint/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/archive.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/archive_epic.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/epic_add.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/epic_update.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/import_epic.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/loader.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/status.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/story_add.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/story_finish.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/story_update.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/validate_cmd.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/validator.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/work.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/__pycache__/yaml_io.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/sprint/story_update.py +19 -0
- package/pennyfarthing_scripts/story/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/__main__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/create.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/size.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/story/__pycache__/template.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/conftest.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_108_1_gate_migration.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_archive_epic.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_bc.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_bikerack.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_brownfield.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_cli_modules.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_cli_normalization.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_codemarkers.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_common.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_confidence_sm_evaluation.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_confidence_sm_gate.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_dialogue_manager.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_epic_shard_validation.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_git_utils.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_handoff_cli.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_handoff_e2e.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_healthscore.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_jira_package.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_package_structure.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_patch_mode.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_prime.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_sprint_package.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_sprint_panel.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_sprint_validator.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_story_add.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_story_package.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_story_update.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_tiers.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_token_counting.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_topology_loader.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_tui_focus.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_tui_panel_persistence.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_validate_cmd.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_version_sentinel.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_workflow_check.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_workflow_cli.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_yaml_io.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/test_sprint_panel.py +344 -265
- package/pennyfarthing_scripts/theme/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/theme/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/validate/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/validate/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/validate/adapters/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/validate/adapters/__pycache__/agent.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/validate/adapters/__pycache__/schema.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/validate/adapters/__pycache__/skill_command.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/validate/adapters/__pycache__/sprint.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/validate/adapters/__pycache__/tandem_awareness.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/validate/adapters/__pycache__/workflow.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/validate/adapters/workflow.py +19 -0
- package/pennyfarthing_scripts/welcome_hook.py +3 -149
- package/pennyfarthing_scripts/workflow/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/workflow/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/workflow/__pycache__/helpers.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/workflow/__pycache__/scale.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/workflow/__pycache__/state.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/workflow/cli.py +7 -6
- package/pennyfarthing_scripts/workflow/team_lifecycle.py +257 -0
- package/packages/core/dist/scripts/theme-detail.test.d.ts +0 -10
- package/packages/core/dist/scripts/theme-detail.test.js +0 -199
- package/pennyfarthing_scripts/bikerack/__pycache__/portrait.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/gate/__pycache__/__init__.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/gate/__pycache__/cli.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/gate/__pycache__/validate.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git/__pycache__/hooks_installer.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git/__pycache__/repos.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/git/__pycache__/worktree.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/prime/__pycache__/heatmap.cpython-314.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_108_2_remove_handoff_fallback.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_gate_file_resolution.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_gate_runner.cpython-314-pytest-9.0.2.pyc +0 -0
- package/pennyfarthing_scripts/tests/__pycache__/test_resolve_gate_file_field.cpython-314-pytest-9.0.2.pyc +0 -0
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Claude Code statusline hook — render the status bar.
|
|
3
|
+
|
|
4
|
+
Format: [ROLE] Theme | repo | branch | model [progress] pct%
|
|
5
|
+
|
|
6
|
+
Reads JSON from stdin with workspace, model, session_id, context_window info.
|
|
7
|
+
Outputs ANSI-colored status line to stdout.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import json
|
|
13
|
+
import os
|
|
14
|
+
import re
|
|
15
|
+
import subprocess
|
|
16
|
+
import sys
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
|
|
19
|
+
try:
|
|
20
|
+
import yaml
|
|
21
|
+
HAS_YAML = True
|
|
22
|
+
except ImportError:
|
|
23
|
+
HAS_YAML = False
|
|
24
|
+
|
|
25
|
+
# =============================================================================
|
|
26
|
+
# ANSI Colors
|
|
27
|
+
# =============================================================================
|
|
28
|
+
|
|
29
|
+
RESET = "\033[0m"
|
|
30
|
+
DIM = "\033[2m"
|
|
31
|
+
BOLD = "\033[1m"
|
|
32
|
+
REVERSE = "\033[7m"
|
|
33
|
+
FG_CYAN = "\033[36m"
|
|
34
|
+
FG_GREEN = "\033[32m"
|
|
35
|
+
FG_YELLOW = "\033[33m"
|
|
36
|
+
FG_RED = "\033[31m"
|
|
37
|
+
FG_MAGENTA = "\033[35m"
|
|
38
|
+
FG_BLUE = "\033[34m"
|
|
39
|
+
FG_WHITE = "\033[97m"
|
|
40
|
+
FG_GRAY = "\033[38;5;245m"
|
|
41
|
+
FG_ORANGE = "\033[38;5;208m"
|
|
42
|
+
FG_PINK = "\033[38;5;213m"
|
|
43
|
+
FG_TEAL = "\033[38;5;43m"
|
|
44
|
+
FG_PURPLE = "\033[38;5;141m"
|
|
45
|
+
FG_LIME = "\033[38;5;154m"
|
|
46
|
+
|
|
47
|
+
# =============================================================================
|
|
48
|
+
# Agent Maps
|
|
49
|
+
# =============================================================================
|
|
50
|
+
|
|
51
|
+
AGENT_ABBREVS = {
|
|
52
|
+
"pm": "PM",
|
|
53
|
+
"sm": "SM",
|
|
54
|
+
"dev": "DEV",
|
|
55
|
+
"tea": "TEA",
|
|
56
|
+
"reviewer": "REV",
|
|
57
|
+
"architect": "ARC",
|
|
58
|
+
"devops": "OPS",
|
|
59
|
+
"ux-designer": "UX",
|
|
60
|
+
"tech-writer": "DOC",
|
|
61
|
+
"orchestrator": "ORC",
|
|
62
|
+
"ba": "BA",
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
AGENT_COLORS = {
|
|
66
|
+
"pm": f"{FG_PURPLE}{BOLD}",
|
|
67
|
+
"sm": f"{FG_BLUE}{BOLD}",
|
|
68
|
+
"dev": f"{FG_GREEN}{BOLD}",
|
|
69
|
+
"tea": f"{FG_TEAL}{BOLD}",
|
|
70
|
+
"reviewer": f"{FG_RED}{BOLD}",
|
|
71
|
+
"architect": f"{FG_ORANGE}{BOLD}",
|
|
72
|
+
"devops": f"{FG_CYAN}{BOLD}",
|
|
73
|
+
"ux-designer": f"{FG_PINK}{BOLD}",
|
|
74
|
+
"tech-writer": f"{FG_WHITE}{BOLD}",
|
|
75
|
+
"orchestrator": f"{FG_MAGENTA}{BOLD}",
|
|
76
|
+
"ba": f"{FG_LIME}{BOLD}",
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
# Title patterns to strip from character names
|
|
80
|
+
TITLE_PATTERN = re.compile(
|
|
81
|
+
r'^(Captain|Lieutenant|Dr\.|Doc|Mr\.|Mrs\.|Ms\.|Admiral|Commander|'
|
|
82
|
+
r'Chief|Ensign|Translator|Agent|Colonel|Major|Sergeant|Professor|'
|
|
83
|
+
r'Lord|Lady|Sir|The)\s+',
|
|
84
|
+
re.IGNORECASE,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
# =============================================================================
|
|
89
|
+
# Helpers
|
|
90
|
+
# =============================================================================
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def _get_agent_abbrev(name: str) -> str:
|
|
94
|
+
return AGENT_ABBREVS.get(name, "???")
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def _get_agent_color(name: str) -> str:
|
|
98
|
+
return AGENT_COLORS.get(name, f"{FG_MAGENTA}{BOLD}")
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def _clean_character_name(full_name: str) -> str:
|
|
102
|
+
"""Extract short display name from full character name."""
|
|
103
|
+
# Remove parenthetical: "Breq (Justice of Toren)" → "Breq"
|
|
104
|
+
clean = re.sub(r'\s*\([^)]*\)', '', full_name).strip()
|
|
105
|
+
# Strip titles
|
|
106
|
+
clean = TITLE_PATTERN.sub('', clean).strip()
|
|
107
|
+
words = clean.split()
|
|
108
|
+
if len(words) <= 1:
|
|
109
|
+
return clean
|
|
110
|
+
return words[-1]
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def _parse_input() -> dict:
|
|
114
|
+
"""Read and parse JSON from stdin."""
|
|
115
|
+
raw = sys.stdin.read()
|
|
116
|
+
try:
|
|
117
|
+
data = json.loads(raw)
|
|
118
|
+
if not isinstance(data, dict):
|
|
119
|
+
return {}
|
|
120
|
+
return data
|
|
121
|
+
except (json.JSONDecodeError, ValueError):
|
|
122
|
+
return {}
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def _get_model_name(data: dict) -> str:
|
|
126
|
+
"""Extract and clean model name from input."""
|
|
127
|
+
model_raw = data.get("model", "claude")
|
|
128
|
+
if isinstance(model_raw, dict):
|
|
129
|
+
model = model_raw.get("id") or model_raw.get("name") or "claude"
|
|
130
|
+
elif isinstance(model_raw, str):
|
|
131
|
+
model = model_raw
|
|
132
|
+
else:
|
|
133
|
+
model = "claude"
|
|
134
|
+
|
|
135
|
+
if not model or model == "null":
|
|
136
|
+
model = "claude"
|
|
137
|
+
|
|
138
|
+
# Clean: remove "claude-" prefix and trailing version number
|
|
139
|
+
model = re.sub(r'^claude-', '', model)
|
|
140
|
+
model = re.sub(r'-\d+$', '', model)
|
|
141
|
+
return model[:10]
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def _get_git_info(cwd: str) -> tuple[str, str]:
|
|
145
|
+
"""Get git branch and dirty indicator."""
|
|
146
|
+
branch = ""
|
|
147
|
+
dirty = ""
|
|
148
|
+
try:
|
|
149
|
+
result = subprocess.run(
|
|
150
|
+
["git", "-C", cwd, "branch", "--show-current"],
|
|
151
|
+
capture_output=True, text=True, timeout=3,
|
|
152
|
+
)
|
|
153
|
+
branch = result.stdout.strip()
|
|
154
|
+
if not branch:
|
|
155
|
+
result = subprocess.run(
|
|
156
|
+
["git", "-C", cwd, "rev-parse", "--short", "HEAD"],
|
|
157
|
+
capture_output=True, text=True, timeout=3,
|
|
158
|
+
)
|
|
159
|
+
branch = result.stdout.strip()
|
|
160
|
+
|
|
161
|
+
# Check dirty (using diff-index to avoid index.lock issues)
|
|
162
|
+
result = subprocess.run(
|
|
163
|
+
["git", "-C", cwd, "diff-index", "--quiet", "HEAD", "--"],
|
|
164
|
+
capture_output=True, text=True, timeout=3,
|
|
165
|
+
)
|
|
166
|
+
if result.returncode != 0:
|
|
167
|
+
dirty = "*"
|
|
168
|
+
else:
|
|
169
|
+
# Check for untracked files
|
|
170
|
+
result = subprocess.run(
|
|
171
|
+
["git", "-C", cwd, "ls-files", "--others", "--exclude-standard"],
|
|
172
|
+
capture_output=True, text=True, timeout=3,
|
|
173
|
+
)
|
|
174
|
+
if result.stdout.strip():
|
|
175
|
+
dirty = "*"
|
|
176
|
+
except (subprocess.TimeoutExpired, FileNotFoundError, OSError):
|
|
177
|
+
pass
|
|
178
|
+
|
|
179
|
+
return branch, dirty
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def _get_context_pct(data: dict) -> str | int:
|
|
183
|
+
"""Calculate context usage percentage from input data."""
|
|
184
|
+
usage = data.get("context_window", {}).get("current_usage")
|
|
185
|
+
if not usage or not isinstance(usage, dict):
|
|
186
|
+
return "--"
|
|
187
|
+
|
|
188
|
+
current = (
|
|
189
|
+
usage.get("input_tokens", 0) +
|
|
190
|
+
usage.get("cache_creation_input_tokens", 0) +
|
|
191
|
+
usage.get("cache_read_input_tokens", 0)
|
|
192
|
+
)
|
|
193
|
+
size = data.get("context_window", {}).get("context_window_size", 0)
|
|
194
|
+
|
|
195
|
+
if not current or not size or size <= 0:
|
|
196
|
+
return "--"
|
|
197
|
+
|
|
198
|
+
return current * 100 // size
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
def _resolve_agent(project_root: str, session_id: str) -> str:
|
|
202
|
+
"""Resolve agent name from session files."""
|
|
203
|
+
if session_id:
|
|
204
|
+
agent_file = Path(project_root) / ".session" / "agents" / session_id
|
|
205
|
+
if agent_file.is_file():
|
|
206
|
+
try:
|
|
207
|
+
return agent_file.read_text().strip()
|
|
208
|
+
except OSError:
|
|
209
|
+
pass
|
|
210
|
+
|
|
211
|
+
agents_dir = Path(project_root) / ".session" / "agents"
|
|
212
|
+
if agents_dir.is_dir():
|
|
213
|
+
try:
|
|
214
|
+
files = sorted(
|
|
215
|
+
(f for f in agents_dir.iterdir() if f.is_file()),
|
|
216
|
+
key=lambda f: f.stat().st_mtime,
|
|
217
|
+
reverse=True,
|
|
218
|
+
)
|
|
219
|
+
if files:
|
|
220
|
+
return files[0].read_text().strip()
|
|
221
|
+
except OSError:
|
|
222
|
+
pass
|
|
223
|
+
|
|
224
|
+
return ""
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
def _get_character_display(project_root: str, agent_name: str) -> tuple[str, str | None]:
|
|
228
|
+
"""Get character display name and theme file path.
|
|
229
|
+
|
|
230
|
+
Returns:
|
|
231
|
+
Tuple of (character_display, theme_file_path)
|
|
232
|
+
"""
|
|
233
|
+
if not HAS_YAML or not agent_name:
|
|
234
|
+
return "", None
|
|
235
|
+
|
|
236
|
+
config_file = None
|
|
237
|
+
for name in ("config.local.yaml", "persona-config.yaml"):
|
|
238
|
+
candidate = Path(project_root) / ".pennyfarthing" / name
|
|
239
|
+
if candidate.is_file():
|
|
240
|
+
config_file = candidate
|
|
241
|
+
break
|
|
242
|
+
|
|
243
|
+
if not config_file:
|
|
244
|
+
return "", None
|
|
245
|
+
|
|
246
|
+
try:
|
|
247
|
+
with open(config_file) as f:
|
|
248
|
+
config = yaml.safe_load(f) or {}
|
|
249
|
+
except (OSError, yaml.YAMLError):
|
|
250
|
+
return "", None
|
|
251
|
+
|
|
252
|
+
theme = config.get("theme")
|
|
253
|
+
if not theme:
|
|
254
|
+
return "", None
|
|
255
|
+
|
|
256
|
+
theme_file = Path(project_root) / ".pennyfarthing" / "personas" / "themes" / f"{theme}.yaml"
|
|
257
|
+
if not theme_file.is_file():
|
|
258
|
+
# Capitalize theme name as fallback
|
|
259
|
+
return theme[0].upper() + theme[1:] if theme else "", str(theme_file)
|
|
260
|
+
|
|
261
|
+
try:
|
|
262
|
+
with open(theme_file) as f:
|
|
263
|
+
theme_data = yaml.safe_load(f) or {}
|
|
264
|
+
except (OSError, yaml.YAMLError):
|
|
265
|
+
return theme[0].upper() + theme[1:] if theme else "", str(theme_file)
|
|
266
|
+
|
|
267
|
+
full_name = (theme_data.get("agents", {}).get(agent_name, {}) or {}).get("character")
|
|
268
|
+
if full_name:
|
|
269
|
+
return _clean_character_name(full_name), str(theme_file)
|
|
270
|
+
|
|
271
|
+
return theme[0].upper() + theme[1:] if theme else "", str(theme_file)
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
def _get_tandem_partner_display(project_root: str, theme_file: str | None) -> str:
|
|
275
|
+
"""Find active tandem partner and return display name."""
|
|
276
|
+
session_dir = Path(project_root) / ".session"
|
|
277
|
+
if not session_dir.is_dir():
|
|
278
|
+
return ""
|
|
279
|
+
|
|
280
|
+
tandem_files = list(session_dir.glob("*-tandem-*.md"))
|
|
281
|
+
if not tandem_files:
|
|
282
|
+
return ""
|
|
283
|
+
|
|
284
|
+
tandem_file = tandem_files[0]
|
|
285
|
+
match = re.search(r'-tandem-([a-zA-Z_-]+)\.md$', tandem_file.name)
|
|
286
|
+
if not match:
|
|
287
|
+
return ""
|
|
288
|
+
|
|
289
|
+
partner_name = match.group(1)
|
|
290
|
+
|
|
291
|
+
if HAS_YAML and theme_file and Path(theme_file).is_file():
|
|
292
|
+
try:
|
|
293
|
+
with open(theme_file) as f:
|
|
294
|
+
theme_data = yaml.safe_load(f) or {}
|
|
295
|
+
full_name = (theme_data.get("agents", {}).get(partner_name, {}) or {}).get("character")
|
|
296
|
+
if full_name:
|
|
297
|
+
return _clean_character_name(full_name)
|
|
298
|
+
except (OSError, yaml.YAMLError):
|
|
299
|
+
pass
|
|
300
|
+
|
|
301
|
+
return _get_agent_abbrev(partner_name)
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
def _build_progress_bar(pct: str | int) -> tuple[str, str]:
|
|
305
|
+
"""Build progress bar and pct display with ANSI colors.
|
|
306
|
+
|
|
307
|
+
Returns:
|
|
308
|
+
Tuple of (progress_bar, pct_display)
|
|
309
|
+
"""
|
|
310
|
+
bar_width = 10
|
|
311
|
+
|
|
312
|
+
if pct == "--" or not isinstance(pct, int):
|
|
313
|
+
bar = f"{DIM}{'░' * bar_width}{RESET}"
|
|
314
|
+
pct_str = f"{FG_GRAY}--%{RESET}"
|
|
315
|
+
return bar, pct_str
|
|
316
|
+
|
|
317
|
+
filled = max(0, min(bar_width, pct * bar_width // 100))
|
|
318
|
+
|
|
319
|
+
if pct > 95:
|
|
320
|
+
color = f"{FG_RED}{BOLD}"
|
|
321
|
+
elif pct > 85:
|
|
322
|
+
color = FG_RED
|
|
323
|
+
elif pct > 70:
|
|
324
|
+
color = FG_YELLOW
|
|
325
|
+
else:
|
|
326
|
+
color = FG_GREEN
|
|
327
|
+
|
|
328
|
+
bar = f"{color}{'▓' * filled}{RESET}{DIM}{'░' * (bar_width - filled)}{RESET}"
|
|
329
|
+
pct_str = f"{color}{pct}%{RESET}"
|
|
330
|
+
return bar, pct_str
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
# =============================================================================
|
|
334
|
+
# Entry Point
|
|
335
|
+
# =============================================================================
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
def main() -> None:
|
|
339
|
+
"""Main entry point for statusline hook."""
|
|
340
|
+
try:
|
|
341
|
+
data = _parse_input()
|
|
342
|
+
if not data:
|
|
343
|
+
print("⚠ invalid input", end="")
|
|
344
|
+
sys.exit(0)
|
|
345
|
+
|
|
346
|
+
cwd = data.get("workspace", {}).get("current_dir", "")
|
|
347
|
+
dir_name = Path(cwd).name if cwd else "?"
|
|
348
|
+
project_root = os.environ.get("CLAUDE_PROJECT_DIR", cwd)
|
|
349
|
+
session_id = data.get("session_id", "")
|
|
350
|
+
|
|
351
|
+
model = _get_model_name(data)
|
|
352
|
+
branch, branch_dirty = _get_git_info(cwd) if cwd else ("", "")
|
|
353
|
+
pct = _get_context_pct(data)
|
|
354
|
+
|
|
355
|
+
agent_name = _resolve_agent(project_root, session_id)
|
|
356
|
+
agent_abbrev = _get_agent_abbrev(agent_name) if agent_name else ""
|
|
357
|
+
theme_display, theme_file = _get_character_display(project_root, agent_name)
|
|
358
|
+
tandem_display = _get_tandem_partner_display(project_root, theme_file)
|
|
359
|
+
|
|
360
|
+
# Build progress bar
|
|
361
|
+
progress_bar, pct_display = _build_progress_bar(pct)
|
|
362
|
+
|
|
363
|
+
# Branch color
|
|
364
|
+
branch_color = FG_YELLOW if branch_dirty else FG_GREEN
|
|
365
|
+
|
|
366
|
+
# Fixed-width formatting
|
|
367
|
+
repo_fmt = f"{dir_name:<14}"
|
|
368
|
+
branch_fmt = f"{branch}{branch_dirty}"[:12]
|
|
369
|
+
branch_fmt = f"{branch_fmt:<12}"
|
|
370
|
+
model_fmt = f"{model:<10}"
|
|
371
|
+
|
|
372
|
+
# Tandem suffix
|
|
373
|
+
tandem_suffix = ""
|
|
374
|
+
tandem_suffix_len = 0
|
|
375
|
+
if tandem_display:
|
|
376
|
+
partner_color = _get_agent_color(tandem_display) if tandem_display in AGENT_ABBREVS else _get_agent_color("")
|
|
377
|
+
tandem_suffix = f" {DIM}+{RESET} {partner_color}{tandem_display}{RESET}"
|
|
378
|
+
tandem_suffix_len = 3 + len(tandem_display)
|
|
379
|
+
|
|
380
|
+
# Agent section
|
|
381
|
+
if agent_abbrev:
|
|
382
|
+
agent_color = _get_agent_color(agent_name)
|
|
383
|
+
if theme_display:
|
|
384
|
+
agent_section = f"{agent_color}{REVERSE} {agent_abbrev} {RESET} {DIM}{theme_display}{RESET}{tandem_suffix}"
|
|
385
|
+
pad_len = max(0, 18 - len(agent_abbrev) - len(theme_display) - tandem_suffix_len)
|
|
386
|
+
agent_section += " " * pad_len
|
|
387
|
+
else:
|
|
388
|
+
agent_section = f"{agent_color}{REVERSE} {agent_abbrev} {RESET}{tandem_suffix}"
|
|
389
|
+
pad_len = max(0, 17 - len(agent_abbrev) - tandem_suffix_len)
|
|
390
|
+
agent_section += " " * pad_len
|
|
391
|
+
elif theme_display:
|
|
392
|
+
agent_section = f"{DIM}{theme_display}{RESET}{tandem_suffix}"
|
|
393
|
+
pad_len = max(0, 20 - len(theme_display) - tandem_suffix_len)
|
|
394
|
+
agent_section += " " * pad_len
|
|
395
|
+
else:
|
|
396
|
+
agent_section = " " * 20
|
|
397
|
+
|
|
398
|
+
# Build output
|
|
399
|
+
output = (
|
|
400
|
+
f"{agent_section}"
|
|
401
|
+
f"{DIM}│{RESET} "
|
|
402
|
+
f"{FG_CYAN}{repo_fmt}{RESET}"
|
|
403
|
+
f"{DIM}│{RESET} "
|
|
404
|
+
f"{branch_color}{branch_fmt}{RESET}"
|
|
405
|
+
f"{DIM}│{RESET} "
|
|
406
|
+
f"{FG_GRAY}{model_fmt}{RESET}"
|
|
407
|
+
f"{progress_bar} "
|
|
408
|
+
f"{pct_display}"
|
|
409
|
+
)
|
|
410
|
+
|
|
411
|
+
print(output, end="")
|
|
412
|
+
|
|
413
|
+
except Exception:
|
|
414
|
+
print("⚠ error", end="")
|
|
415
|
+
|
|
416
|
+
sys.exit(0)
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
if __name__ == "__main__":
|
|
420
|
+
main()
|