agentrules 3.8.0__tar.gz → 4.1.0__tar.gz
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.
- {agentrules-3.8.0/src/agentrules.egg-info → agentrules-4.1.0}/PKG-INFO +3 -2
- {agentrules-3.8.0 → agentrules-4.1.0}/README.md +1 -1
- {agentrules-3.8.0 → agentrules-4.1.0}/pyproject.toml +3 -2
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/commands/execplan.py +21 -66
- agentrules-4.1.0/src/agentrules/cli/services/claude_code_runtime.py +89 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/services/configuration.py +31 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/ui/settings/__init__.py +2 -0
- agentrules-4.1.0/src/agentrules/cli/ui/settings/claude_code.py +212 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/ui/settings/menu.py +5 -1
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/ui/settings/models/__init__.py +3 -2
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/ui/settings/models/researcher.py +1 -1
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/ui/settings/models/utils.py +2 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/ui/styles.py +2 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/config/agents.py +47 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/base.py +1 -0
- agentrules-4.1.0/src/agentrules/core/agents/claude_code/__init__.py +11 -0
- agentrules-4.1.0/src/agentrules/core/agents/claude_code/architect.py +299 -0
- agentrules-4.1.0/src/agentrules/core/agents/claude_code/client.py +216 -0
- agentrules-4.1.0/src/agentrules/core/agents/claude_code/errors.py +22 -0
- agentrules-4.1.0/src/agentrules/core/agents/claude_code/request_builder.py +179 -0
- agentrules-4.1.0/src/agentrules/core/agents/claude_code/response_parser.py +122 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/factory/factory.py +3 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/configuration/__init__.py +12 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/configuration/constants.py +6 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/configuration/environment.py +3 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/configuration/manager.py +59 -2
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/configuration/model_presets.py +1 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/configuration/models.py +28 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/configuration/serde.py +67 -2
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/configuration/services/__init__.py +2 -1
- agentrules-4.1.0/src/agentrules/core/configuration/services/claude_code.py +164 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/configuration/services/providers.py +3 -1
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/configuration/utils.py +36 -1
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/execplan/__init__.py +8 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/execplan/creator.py +94 -55
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/execplan/locks.py +5 -2
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/execplan/milestones.py +136 -56
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/execplan/paths.py +10 -10
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/execplan/registry.py +5 -5
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/types/models.py +15 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/file_creation/templates/MILESTONE_TEMPLATE.md +1 -1
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/file_creation/templates/PLANS.md +1 -1
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/provider_capabilities.py +1 -1
- agentrules-4.1.0/src/agentrules/core/utils/provider_utils.py +104 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/structured_outputs.py +19 -1
- {agentrules-3.8.0 → agentrules-4.1.0/src/agentrules.egg-info}/PKG-INFO +3 -2
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules.egg-info/SOURCES.txt +10 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules.egg-info/requires.txt +1 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/LICENSE +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/setup.cfg +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/__main__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/app.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/bootstrap.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/commands/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/commands/analyze.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/commands/configure.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/commands/execplan_registry.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/commands/keys.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/commands/scaffold.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/commands/snapshot.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/commands/tree.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/context.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/services/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/services/codex_runtime.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/services/output_validation.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/services/pipeline_runner.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/services/tree_preview.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/ui/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/ui/analysis_view.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/ui/event_sink.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/ui/main_menu.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/ui/settings/codex.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/ui/settings/exclusions/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/ui/settings/exclusions/editor.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/ui/settings/exclusions/preview.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/ui/settings/exclusions/summary.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/ui/settings/logging.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/ui/settings/outputs.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/cli/ui/settings/providers.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/config/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/config/exclusions.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/config/prompts/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/config/prompts/final_analysis_prompt.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/config/prompts/phase_1_prompts.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/config/prompts/phase_2_prompts.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/config/prompts/phase_3_prompts.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/config/prompts/phase_4_prompts.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/config/prompts/phase_5_prompts.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/config/tools.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agent_tools/tool_manager.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agent_tools/web_search/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agent_tools/web_search/tavily.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/anthropic/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/anthropic/architect.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/anthropic/capabilities.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/anthropic/client.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/anthropic/prompting.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/anthropic/request_builder.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/anthropic/response_parser.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/anthropic/tooling.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/codex/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/codex/architect.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/codex/client.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/codex/errors.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/codex/models.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/codex/process.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/codex/protocol.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/codex/request_builder.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/codex/response_parser.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/deepseek/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/deepseek/architect.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/deepseek/client.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/deepseek/compat.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/deepseek/config.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/deepseek/prompting.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/deepseek/request_builder.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/deepseek/response_parser.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/deepseek/tooling.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/factory/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/gemini/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/gemini/architect.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/gemini/capabilities.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/gemini/client.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/gemini/errors.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/gemini/legacy.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/gemini/prompting.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/gemini/response_parser.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/gemini/tooling.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/openai/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/openai/architect.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/openai/client.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/openai/compat.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/openai/config.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/openai/request_builder.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/openai/response_parser.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/xai/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/xai/architect.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/xai/client.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/xai/config.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/xai/prompting.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/xai/request_builder.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/xai/response_parser.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/agents/xai/tooling.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/analysis/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/analysis/events.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/analysis/final_analysis.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/analysis/phase_1.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/analysis/phase_2.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/analysis/phase_3.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/analysis/phase_4.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/analysis/phase_5.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/configuration/repository.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/configuration/services/codex.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/configuration/services/exclusions.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/configuration/services/features.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/configuration/services/logging.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/configuration/services/outputs.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/configuration/services/phase_models.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/execplan/identity.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/execplan/templates/EXECPLAN_TEMPLATE.md +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/execplan/templates/MILESTONE_FILE_TEMPLATE.md +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/logging/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/logging/config.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/pipeline/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/pipeline/config.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/pipeline/factory.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/pipeline/orchestrator.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/pipeline/output.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/pipeline/project_profile.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/pipeline/snapshot.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/streaming/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/streaming/types.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/types/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/types/agent_config.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/types/tool_config.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/async_stream.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/constants.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/constants.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/discovery.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/metadata.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/models.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/parsers/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/parsers/clojure.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/parsers/dart.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/parsers/dotnet.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/parsers/elixir.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/parsers/generic.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/parsers/go.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/parsers/helpers.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/parsers/java.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/parsers/javascript.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/parsers/php.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/parsers/python.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/parsers/ruby.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/parsers/swift.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/parsers/toml_based.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/registry.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/dependency_scanner/scan.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/file_creation/agent_scaffold.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/file_creation/atomic_write.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/file_creation/cursorignore.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/file_creation/phases_output.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/file_creation/snapshot_artifact.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/file_creation/snapshot_policy.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/file_system/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/file_system/file_retriever.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/file_system/gitignore.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/file_system/tree_generator.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/formatters/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/formatters/clean_agentrules.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/model_config_helper.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/offline.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/parsers/__init__.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/parsers/agent_parser.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/release_metadata.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/system_prompt.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/token_estimator.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules/core/utils/token_packer.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules.egg-info/dependency_links.txt +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules.egg-info/entry_points.txt +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/src/agentrules.egg-info/top_level.txt +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/tests/test_cli_services.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/tests/test_env.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/tests/test_openai_responses.py +0 -0
- {agentrules-3.8.0 → agentrules-4.1.0}/tests/test_smoke_discovery.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agentrules
|
|
3
|
-
Version:
|
|
3
|
+
Version: 4.1.0
|
|
4
4
|
Summary: AGENTS.md/CLAUDE.md generator and ExecPlan harness for coding agents
|
|
5
5
|
Author: trevor-nichols
|
|
6
6
|
License-Expression: MIT
|
|
@@ -27,6 +27,7 @@ Requires-Dist: PyYAML>=6.0
|
|
|
27
27
|
Requires-Dist: tomli; python_version < "3.11"
|
|
28
28
|
Requires-Dist: tomli-w
|
|
29
29
|
Requires-Dist: tiktoken>=0.7.0
|
|
30
|
+
Requires-Dist: claude-agent-sdk>=0.1.73
|
|
30
31
|
Provides-Extra: dev
|
|
31
32
|
Requires-Dist: pytest; extra == "dev"
|
|
32
33
|
Requires-Dist: pytest-asyncio; extra == "dev"
|
|
@@ -273,7 +274,7 @@ agentrules execplan milestone list EP-20260207-001 --active-only
|
|
|
273
274
|
# Optional: compact "what's left" view for active milestones only
|
|
274
275
|
agentrules execplan milestone remaining EP-20260207-001
|
|
275
276
|
|
|
276
|
-
# 4)
|
|
277
|
+
# 4) Complete a finished milestone
|
|
277
278
|
agentrules execplan milestone complete EP-20260207-001 --ms 1
|
|
278
279
|
|
|
279
280
|
# 5) Complete the ExecPlan directory
|
|
@@ -235,7 +235,7 @@ agentrules execplan milestone list EP-20260207-001 --active-only
|
|
|
235
235
|
# Optional: compact "what's left" view for active milestones only
|
|
236
236
|
agentrules execplan milestone remaining EP-20260207-001
|
|
237
237
|
|
|
238
|
-
# 4)
|
|
238
|
+
# 4) Complete a finished milestone
|
|
239
239
|
agentrules execplan milestone complete EP-20260207-001 --ms 1
|
|
240
240
|
|
|
241
241
|
# 5) Complete the ExecPlan directory
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "agentrules"
|
|
7
|
-
version = "
|
|
7
|
+
version = "4.1.0"
|
|
8
8
|
description = "AGENTS.md/CLAUDE.md generator and ExecPlan harness for coding agents"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{name = "trevor-nichols"}]
|
|
@@ -32,7 +32,8 @@ dependencies = [
|
|
|
32
32
|
"PyYAML>=6.0",
|
|
33
33
|
"tomli; python_version < '3.11'",
|
|
34
34
|
"tomli-w",
|
|
35
|
-
"tiktoken>=0.7.0"
|
|
35
|
+
"tiktoken>=0.7.0",
|
|
36
|
+
"claude-agent-sdk>=0.1.73",
|
|
36
37
|
]
|
|
37
38
|
|
|
38
39
|
[project.optional-dependencies]
|
|
@@ -3,17 +3,16 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from pathlib import Path
|
|
6
|
-
from typing import Any
|
|
6
|
+
from typing import Any
|
|
7
7
|
|
|
8
8
|
import typer
|
|
9
9
|
|
|
10
|
-
from agentrules.core.execplan.creator import
|
|
10
|
+
from agentrules.core.execplan.creator import complete_execplan, create_execplan
|
|
11
11
|
from agentrules.core.execplan.milestones import (
|
|
12
|
-
|
|
12
|
+
complete_execplan_milestone,
|
|
13
13
|
create_execplan_milestone,
|
|
14
14
|
list_execplan_milestones,
|
|
15
15
|
)
|
|
16
|
-
from agentrules.core.execplan.paths import ARCHIVE_DIR, COMPLETE_DIR, EXECPLAN_ARCHIVE_DIR, EXECPLAN_COMPLETE_DIR
|
|
17
16
|
from agentrules.core.execplan.registry import (
|
|
18
17
|
DEFAULT_EXECPLANS_DIR,
|
|
19
18
|
DEFAULT_REGISTRY_PATH,
|
|
@@ -46,7 +45,7 @@ DATE_OPTION = typer.Option(
|
|
|
46
45
|
metavar="YYYYMMDD",
|
|
47
46
|
help="Override date token used in ExecPlan ID generation.",
|
|
48
47
|
)
|
|
49
|
-
|
|
48
|
+
COMPLETION_DATE_OPTION = typer.Option(
|
|
50
49
|
None,
|
|
51
50
|
"--date",
|
|
52
51
|
metavar="YYYYMMDD",
|
|
@@ -106,10 +105,10 @@ MILESTONE_MS_OPTION = typer.Option(
|
|
|
106
105
|
max=999,
|
|
107
106
|
help="Milestone sequence number (MS###) to complete.",
|
|
108
107
|
)
|
|
109
|
-
|
|
108
|
+
MILESTONE_INCLUDE_COMPLETED_OPTION = typer.Option(
|
|
110
109
|
True,
|
|
111
|
-
"--
|
|
112
|
-
help="Include completed milestones in list output.
|
|
110
|
+
"--completed/--active-only",
|
|
111
|
+
help="Include completed milestones in list output.",
|
|
113
112
|
)
|
|
114
113
|
PLAN_LIST_INCLUDE_PATH_OPTION = typer.Option(
|
|
115
114
|
False,
|
|
@@ -241,13 +240,12 @@ def register(app: typer.Typer) -> None:
|
|
|
241
240
|
console.print("[yellow]Registry was not updated.[/]")
|
|
242
241
|
raise typer.Exit(1)
|
|
243
242
|
|
|
244
|
-
def
|
|
243
|
+
def _complete_execplan( # type: ignore[func-returns-value]
|
|
245
244
|
*,
|
|
246
|
-
destination_dir: Literal["complete", "archive"],
|
|
247
245
|
execplan_id: str = EXECPLAN_ID_ARGUMENT,
|
|
248
246
|
root: Path | None = ROOT_OPTION,
|
|
249
247
|
execplans_dir: Path = EXECPLANS_DIR_OPTION,
|
|
250
|
-
date: str | None =
|
|
248
|
+
date: str | None = COMPLETION_DATE_OPTION,
|
|
251
249
|
out: Path = OUT_OPTION,
|
|
252
250
|
update_registry: bool = UPDATE_REGISTRY_OPTION,
|
|
253
251
|
fail_on_registry_warn: bool = FAIL_ON_REGISTRY_WARN_OPTION,
|
|
@@ -261,12 +259,11 @@ def register(app: typer.Typer) -> None:
|
|
|
261
259
|
resolved_registry = _resolve_path(resolved_root, out)
|
|
262
260
|
|
|
263
261
|
try:
|
|
264
|
-
result =
|
|
262
|
+
result = complete_execplan(
|
|
265
263
|
root=resolved_root,
|
|
266
264
|
execplan_id=execplan_id.strip(),
|
|
267
265
|
execplans_dir=resolved_execplans_dir,
|
|
268
|
-
|
|
269
|
-
destination_dir=destination_dir,
|
|
266
|
+
completion_date_yyyymmdd=date,
|
|
270
267
|
update_registry=update_registry,
|
|
271
268
|
registry_path=resolved_registry,
|
|
272
269
|
include_registry_timestamp=registry_timestamp,
|
|
@@ -283,7 +280,7 @@ def register(app: typer.Typer) -> None:
|
|
|
283
280
|
|
|
284
281
|
console.print(f"[green]Completed ExecPlan:[/] {result.plan_id}")
|
|
285
282
|
console.print(f"[green]From:[/] {result.source_plan_root.as_posix()}")
|
|
286
|
-
console.print(f"[green]To:[/] {result.
|
|
283
|
+
console.print(f"[green]To:[/] {result.completed_plan_root.as_posix()}")
|
|
287
284
|
active_count = _count_active_execplans(
|
|
288
285
|
root=resolved_root,
|
|
289
286
|
execplans_dir=resolved_execplans_dir,
|
|
@@ -331,37 +328,13 @@ def register(app: typer.Typer) -> None:
|
|
|
331
328
|
execplan_id: str = EXECPLAN_ID_ARGUMENT,
|
|
332
329
|
root: Path | None = ROOT_OPTION,
|
|
333
330
|
execplans_dir: Path = EXECPLANS_DIR_OPTION,
|
|
334
|
-
date: str | None =
|
|
331
|
+
date: str | None = COMPLETION_DATE_OPTION,
|
|
335
332
|
out: Path = OUT_OPTION,
|
|
336
333
|
update_registry: bool = UPDATE_REGISTRY_OPTION,
|
|
337
334
|
fail_on_registry_warn: bool = FAIL_ON_REGISTRY_WARN_OPTION,
|
|
338
335
|
registry_timestamp: bool = REGISTRY_TIMESTAMP_OPTION,
|
|
339
336
|
) -> None:
|
|
340
|
-
|
|
341
|
-
destination_dir=EXECPLAN_COMPLETE_DIR,
|
|
342
|
-
execplan_id=execplan_id,
|
|
343
|
-
root=root,
|
|
344
|
-
execplans_dir=execplans_dir,
|
|
345
|
-
date=date,
|
|
346
|
-
out=out,
|
|
347
|
-
update_registry=update_registry,
|
|
348
|
-
fail_on_registry_warn=fail_on_registry_warn,
|
|
349
|
-
registry_timestamp=registry_timestamp,
|
|
350
|
-
)
|
|
351
|
-
|
|
352
|
-
@execplan_app.command("archive")
|
|
353
|
-
def archive_existing_execplan( # type: ignore[func-returns-value]
|
|
354
|
-
execplan_id: str = EXECPLAN_ID_ARGUMENT,
|
|
355
|
-
root: Path | None = ROOT_OPTION,
|
|
356
|
-
execplans_dir: Path = EXECPLANS_DIR_OPTION,
|
|
357
|
-
date: str | None = ARCHIVE_DATE_OPTION,
|
|
358
|
-
out: Path = OUT_OPTION,
|
|
359
|
-
update_registry: bool = UPDATE_REGISTRY_OPTION,
|
|
360
|
-
fail_on_registry_warn: bool = FAIL_ON_REGISTRY_WARN_OPTION,
|
|
361
|
-
registry_timestamp: bool = REGISTRY_TIMESTAMP_OPTION,
|
|
362
|
-
) -> None:
|
|
363
|
-
_complete_or_archive_execplan(
|
|
364
|
-
destination_dir=EXECPLAN_ARCHIVE_DIR,
|
|
337
|
+
_complete_execplan(
|
|
365
338
|
execplan_id=execplan_id,
|
|
366
339
|
root=root,
|
|
367
340
|
execplans_dir=execplans_dir,
|
|
@@ -482,7 +455,7 @@ def register(app: typer.Typer) -> None:
|
|
|
482
455
|
execplan_id: str = EXECPLAN_ID_ARGUMENT,
|
|
483
456
|
root: Path | None = ROOT_OPTION,
|
|
484
457
|
execplans_dir: Path = EXECPLANS_DIR_OPTION,
|
|
485
|
-
|
|
458
|
+
include_completed: bool = MILESTONE_INCLUDE_COMPLETED_OPTION,
|
|
486
459
|
) -> None:
|
|
487
460
|
context = bootstrap_runtime()
|
|
488
461
|
console = context.console
|
|
@@ -495,7 +468,7 @@ def register(app: typer.Typer) -> None:
|
|
|
495
468
|
root=resolved_root,
|
|
496
469
|
execplan_id=execplan_id.strip(),
|
|
497
470
|
execplans_dir=resolved_execplans_dir,
|
|
498
|
-
|
|
471
|
+
include_completed=include_completed,
|
|
499
472
|
)
|
|
500
473
|
except (ValueError, FileNotFoundError) as error:
|
|
501
474
|
raise typer.BadParameter(str(error)) from error
|
|
@@ -509,9 +482,8 @@ def register(app: typer.Typer) -> None:
|
|
|
509
482
|
console.print(f"{status} {milestone.milestone_id} -> {milestone.path.as_posix()}")
|
|
510
483
|
raise typer.Exit(0)
|
|
511
484
|
|
|
512
|
-
def
|
|
485
|
+
def _complete_milestone( # type: ignore[func-returns-value]
|
|
513
486
|
*,
|
|
514
|
-
destination_dir: Literal["complete", "archive"],
|
|
515
487
|
execplan_id: str = EXECPLAN_ID_ARGUMENT,
|
|
516
488
|
root: Path | None = ROOT_OPTION,
|
|
517
489
|
execplans_dir: Path = EXECPLANS_DIR_OPTION,
|
|
@@ -524,12 +496,11 @@ def register(app: typer.Typer) -> None:
|
|
|
524
496
|
resolved_execplans_dir = _resolve_path(resolved_root, execplans_dir)
|
|
525
497
|
|
|
526
498
|
try:
|
|
527
|
-
result =
|
|
499
|
+
result = complete_execplan_milestone(
|
|
528
500
|
root=resolved_root,
|
|
529
501
|
execplan_id=execplan_id.strip(),
|
|
530
502
|
sequence=ms,
|
|
531
503
|
execplans_dir=resolved_execplans_dir,
|
|
532
|
-
destination_dir=destination_dir,
|
|
533
504
|
)
|
|
534
505
|
except (ValueError, FileNotFoundError) as error:
|
|
535
506
|
raise typer.BadParameter(str(error)) from error
|
|
@@ -542,7 +513,7 @@ def register(app: typer.Typer) -> None:
|
|
|
542
513
|
|
|
543
514
|
console.print(f"[green]Completed milestone:[/] {result.milestone_id}")
|
|
544
515
|
console.print(f"[green]From:[/] {result.source_path.as_posix()}")
|
|
545
|
-
console.print(f"[green]To:[/] {result.
|
|
516
|
+
console.print(f"[green]To:[/] {result.completed_path.as_posix()}")
|
|
546
517
|
raise typer.Exit(0)
|
|
547
518
|
|
|
548
519
|
@milestone_app.command("complete")
|
|
@@ -552,23 +523,7 @@ def register(app: typer.Typer) -> None:
|
|
|
552
523
|
execplans_dir: Path = EXECPLANS_DIR_OPTION,
|
|
553
524
|
ms: int = MILESTONE_MS_OPTION,
|
|
554
525
|
) -> None:
|
|
555
|
-
|
|
556
|
-
destination_dir=COMPLETE_DIR,
|
|
557
|
-
execplan_id=execplan_id,
|
|
558
|
-
root=root,
|
|
559
|
-
execplans_dir=execplans_dir,
|
|
560
|
-
ms=ms,
|
|
561
|
-
)
|
|
562
|
-
|
|
563
|
-
@milestone_app.command("archive")
|
|
564
|
-
def archive_milestone( # type: ignore[func-returns-value]
|
|
565
|
-
execplan_id: str = EXECPLAN_ID_ARGUMENT,
|
|
566
|
-
root: Path | None = ROOT_OPTION,
|
|
567
|
-
execplans_dir: Path = EXECPLANS_DIR_OPTION,
|
|
568
|
-
ms: int = MILESTONE_MS_OPTION,
|
|
569
|
-
) -> None:
|
|
570
|
-
_complete_or_archive_milestone(
|
|
571
|
-
destination_dir=ARCHIVE_DIR,
|
|
526
|
+
_complete_milestone(
|
|
572
527
|
execplan_id=execplan_id,
|
|
573
528
|
root=root,
|
|
574
529
|
execplans_dir=execplans_dir,
|
|
@@ -594,7 +549,7 @@ def register(app: typer.Typer) -> None:
|
|
|
594
549
|
root=resolved_root,
|
|
595
550
|
execplan_id=normalized_execplan_id,
|
|
596
551
|
execplans_dir=resolved_execplans_dir,
|
|
597
|
-
|
|
552
|
+
include_completed=False,
|
|
598
553
|
)
|
|
599
554
|
except (ValueError, FileNotFoundError) as error:
|
|
600
555
|
raise typer.BadParameter(str(error)) from error
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"""Synchronous helpers for inspecting the local Claude Code runtime."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import subprocess
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
|
|
8
|
+
from agentrules.core.configuration import (
|
|
9
|
+
CLAUDE_CODE_API_KEY_ENV_VARS,
|
|
10
|
+
CLAUDE_CODE_OAUTH_TOKEN_ENV_VAR,
|
|
11
|
+
ConfigManager,
|
|
12
|
+
get_config_manager,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@dataclass(frozen=True)
|
|
17
|
+
class ClaudeCodeRuntimeDiagnostics:
|
|
18
|
+
cli_path: str | None
|
|
19
|
+
executable_path: str | None
|
|
20
|
+
sdk_available: bool
|
|
21
|
+
auth_strategy: str
|
|
22
|
+
sanitize_api_key_env: bool
|
|
23
|
+
oauth_token_present: bool
|
|
24
|
+
api_key_env_present_after_sanitization: bool
|
|
25
|
+
version: str | None = None
|
|
26
|
+
runtime_error: str | None = None
|
|
27
|
+
version_error: str | None = None
|
|
28
|
+
|
|
29
|
+
@property
|
|
30
|
+
def is_available(self) -> bool:
|
|
31
|
+
return self.sdk_available and self.runtime_error is None
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def get_claude_code_runtime_diagnostics(
|
|
35
|
+
*,
|
|
36
|
+
config_manager: ConfigManager | None = None,
|
|
37
|
+
timeout_seconds: float = 2.0,
|
|
38
|
+
) -> ClaudeCodeRuntimeDiagnostics:
|
|
39
|
+
manager = config_manager or get_config_manager()
|
|
40
|
+
runtime_config = manager.get_claude_code_config()
|
|
41
|
+
executable_path = manager.resolve_claude_code_executable()
|
|
42
|
+
sdk_available = manager.is_claude_agent_sdk_available()
|
|
43
|
+
child_env = manager.build_claude_code_environment()
|
|
44
|
+
|
|
45
|
+
version: str | None = None
|
|
46
|
+
version_error: str | None = None
|
|
47
|
+
runtime_error: str | None = None
|
|
48
|
+
|
|
49
|
+
if not sdk_available:
|
|
50
|
+
runtime_error = "Claude Agent SDK package could not be imported in the AgentRules environment."
|
|
51
|
+
elif executable_path is None:
|
|
52
|
+
if runtime_config.cli_path is None:
|
|
53
|
+
runtime_error = "Claude Code executable could not be resolved from the SDK default runtime settings."
|
|
54
|
+
else:
|
|
55
|
+
runtime_error = "Configured Claude Code executable could not be resolved from the current settings."
|
|
56
|
+
else:
|
|
57
|
+
try:
|
|
58
|
+
completed = subprocess.run(
|
|
59
|
+
[executable_path, "--version"],
|
|
60
|
+
check=False,
|
|
61
|
+
capture_output=True,
|
|
62
|
+
env=child_env,
|
|
63
|
+
text=True,
|
|
64
|
+
timeout=timeout_seconds,
|
|
65
|
+
)
|
|
66
|
+
if completed.returncode == 0:
|
|
67
|
+
version = (completed.stdout or completed.stderr).strip() or None
|
|
68
|
+
else:
|
|
69
|
+
version_error = (completed.stderr or completed.stdout).strip() or (
|
|
70
|
+
f"`claude --version` exited with status {completed.returncode}."
|
|
71
|
+
)
|
|
72
|
+
except Exception as exc:
|
|
73
|
+
version_error = str(exc)
|
|
74
|
+
|
|
75
|
+
return ClaudeCodeRuntimeDiagnostics(
|
|
76
|
+
cli_path=runtime_config.cli_path,
|
|
77
|
+
executable_path=executable_path,
|
|
78
|
+
sdk_available=sdk_available,
|
|
79
|
+
auth_strategy=runtime_config.auth_strategy,
|
|
80
|
+
sanitize_api_key_env=runtime_config.sanitize_api_key_env,
|
|
81
|
+
oauth_token_present=CLAUDE_CODE_OAUTH_TOKEN_ENV_VAR in child_env,
|
|
82
|
+
api_key_env_present_after_sanitization=any(env_var in child_env for env_var in CLAUDE_CODE_API_KEY_ENV_VARS),
|
|
83
|
+
version=version,
|
|
84
|
+
runtime_error=runtime_error,
|
|
85
|
+
version_error=version_error,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
__all__ = ["ClaudeCodeRuntimeDiagnostics", "get_claude_code_runtime_diagnostics"]
|
|
@@ -6,8 +6,10 @@ from collections.abc import Mapping
|
|
|
6
6
|
from dataclasses import dataclass
|
|
7
7
|
|
|
8
8
|
from agentrules.core.configuration import (
|
|
9
|
+
CLAUDE_CODE_OAUTH_TOKEN_ENV_VAR,
|
|
9
10
|
CODEX_HOME_ENV_VAR,
|
|
10
11
|
PROVIDER_ENV_MAP,
|
|
12
|
+
ClaudeCodeAuthStrategy,
|
|
11
13
|
CodexHomeStrategy,
|
|
12
14
|
OutputPreferences,
|
|
13
15
|
get_config_manager,
|
|
@@ -37,6 +39,16 @@ class CodexRuntimeState:
|
|
|
37
39
|
is_available: bool = False
|
|
38
40
|
|
|
39
41
|
|
|
42
|
+
@dataclass(frozen=True)
|
|
43
|
+
class ClaudeCodeRuntimeState:
|
|
44
|
+
cli_path: str | None
|
|
45
|
+
auth_strategy: ClaudeCodeAuthStrategy
|
|
46
|
+
sanitize_api_key_env: bool
|
|
47
|
+
executable_path: str | None = None
|
|
48
|
+
is_available: bool = False
|
|
49
|
+
oauth_token_env_var: str = CLAUDE_CODE_OAUTH_TOKEN_ENV_VAR
|
|
50
|
+
|
|
51
|
+
|
|
40
52
|
def list_provider_states() -> list[ProviderState]:
|
|
41
53
|
keys = CONFIG_MANAGER.get_current_provider_keys()
|
|
42
54
|
return [
|
|
@@ -117,6 +129,25 @@ def save_codex_managed_home(managed_home: str | None) -> None:
|
|
|
117
129
|
CONFIG_MANAGER.set_codex_managed_home(managed_home)
|
|
118
130
|
|
|
119
131
|
|
|
132
|
+
def get_claude_code_runtime_state() -> ClaudeCodeRuntimeState:
|
|
133
|
+
claude_code_config = CONFIG_MANAGER.get_claude_code_config()
|
|
134
|
+
return ClaudeCodeRuntimeState(
|
|
135
|
+
cli_path=claude_code_config.cli_path,
|
|
136
|
+
auth_strategy=claude_code_config.auth_strategy,
|
|
137
|
+
sanitize_api_key_env=claude_code_config.sanitize_api_key_env,
|
|
138
|
+
executable_path=CONFIG_MANAGER.resolve_claude_code_executable(),
|
|
139
|
+
is_available=CONFIG_MANAGER.is_claude_code_available(),
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
def save_claude_code_cli_path(cli_path: str | None) -> None:
|
|
144
|
+
CONFIG_MANAGER.set_claude_code_cli_path(cli_path)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def save_claude_code_sanitize_api_key_env(enabled: bool) -> None:
|
|
148
|
+
CONFIG_MANAGER.set_claude_code_sanitize_api_key_env(enabled)
|
|
149
|
+
|
|
150
|
+
|
|
120
151
|
def get_logging_preference() -> str | None:
|
|
121
152
|
return CONFIG_MANAGER.get_logging_verbosity()
|
|
122
153
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
from .claude_code import configure_claude_code_runtime
|
|
5
6
|
from .codex import configure_codex_runtime
|
|
6
7
|
from .exclusions import configure_exclusions
|
|
7
8
|
from .logging import configure_logging
|
|
@@ -12,6 +13,7 @@ from .providers import configure_provider_keys, show_provider_summary
|
|
|
12
13
|
|
|
13
14
|
__all__ = [
|
|
14
15
|
"configure_settings",
|
|
16
|
+
"configure_claude_code_runtime",
|
|
15
17
|
"configure_codex_runtime",
|
|
16
18
|
"configure_logging",
|
|
17
19
|
"configure_output_preferences",
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"""Claude Code runtime configuration flow."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import questionary
|
|
6
|
+
from rich.table import Table
|
|
7
|
+
|
|
8
|
+
from agentrules.cli.context import CliContext
|
|
9
|
+
from agentrules.cli.services import claude_code_runtime, configuration
|
|
10
|
+
from agentrules.cli.ui.styles import CLI_STYLE, navigation_choice, value_choice
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _format_status(diagnostics: claude_code_runtime.ClaudeCodeRuntimeDiagnostics) -> str:
|
|
14
|
+
if diagnostics.runtime_error:
|
|
15
|
+
return "[red]Unavailable[/]"
|
|
16
|
+
if diagnostics.version_error:
|
|
17
|
+
return "[yellow]Executable found[/]"
|
|
18
|
+
return "[green]Available[/]"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _format_bool(value: bool) -> str:
|
|
22
|
+
return "[green]Yes[/]" if value else "[yellow]No[/]"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _format_cli_path(cli_path: str | None) -> str:
|
|
26
|
+
return cli_path or "[dim]SDK default[/]"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _format_cli_path_plain(cli_path: str | None) -> str:
|
|
30
|
+
return cli_path or "SDK default"
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _format_resolved_executable(state: configuration.ClaudeCodeRuntimeState) -> str:
|
|
34
|
+
if state.executable_path:
|
|
35
|
+
return state.executable_path
|
|
36
|
+
if state.cli_path is None:
|
|
37
|
+
return "[dim]SDK default[/]"
|
|
38
|
+
return "[red]Not found[/]"
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _render_runtime_summary(
|
|
42
|
+
context: CliContext,
|
|
43
|
+
state: configuration.ClaudeCodeRuntimeState,
|
|
44
|
+
diagnostics: claude_code_runtime.ClaudeCodeRuntimeDiagnostics,
|
|
45
|
+
) -> None:
|
|
46
|
+
config_table = Table(title="[bold]Claude Code Runtime Configuration[/bold]", show_lines=False, pad_edge=False)
|
|
47
|
+
config_table.add_column("Setting", style="bold")
|
|
48
|
+
config_table.add_column("Value")
|
|
49
|
+
config_table.add_row("Configured executable", _format_cli_path(state.cli_path))
|
|
50
|
+
config_table.add_row("Resolved executable", _format_resolved_executable(state))
|
|
51
|
+
config_table.add_row("Claude Agent SDK", _format_bool(diagnostics.sdk_available))
|
|
52
|
+
config_table.add_row("Auth strategy", state.auth_strategy)
|
|
53
|
+
config_table.add_row("OAuth token env var", state.oauth_token_env_var)
|
|
54
|
+
config_table.add_row("Strip Anthropic API-key env", _format_bool(state.sanitize_api_key_env))
|
|
55
|
+
|
|
56
|
+
live_table = Table(title="[bold]Runtime Diagnostics[/bold]", show_lines=False, pad_edge=False)
|
|
57
|
+
live_table.add_column("Signal", style="bold")
|
|
58
|
+
live_table.add_column("Value")
|
|
59
|
+
live_table.add_row("Status", _format_status(diagnostics))
|
|
60
|
+
live_table.add_row("Version", diagnostics.version or "[dim]-[/]")
|
|
61
|
+
live_table.add_row("OAuth token present", _format_bool(diagnostics.oauth_token_present))
|
|
62
|
+
live_table.add_row(
|
|
63
|
+
"API-key env visible to child",
|
|
64
|
+
_format_bool(diagnostics.api_key_env_present_after_sanitization),
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
context.console.print("")
|
|
68
|
+
context.console.print(config_table)
|
|
69
|
+
context.console.print("")
|
|
70
|
+
context.console.print(live_table)
|
|
71
|
+
if diagnostics.runtime_error:
|
|
72
|
+
context.console.print(f"\n[red]Runtime error:[/] {diagnostics.runtime_error}")
|
|
73
|
+
if diagnostics.version_error:
|
|
74
|
+
context.console.print(f"\n[yellow]Version check:[/] {diagnostics.version_error}")
|
|
75
|
+
for note in build_runtime_guidance(state, diagnostics):
|
|
76
|
+
context.console.print(note)
|
|
77
|
+
context.console.print("")
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def build_runtime_guidance(
|
|
81
|
+
state: configuration.ClaudeCodeRuntimeState,
|
|
82
|
+
diagnostics: claude_code_runtime.ClaudeCodeRuntimeDiagnostics,
|
|
83
|
+
) -> list[str]:
|
|
84
|
+
"""Render operator notes for the current Claude Code runtime state."""
|
|
85
|
+
|
|
86
|
+
notes: list[str] = [
|
|
87
|
+
"[dim]Claude Code uses the Claude Agent SDK and Claude.ai OAuth subscription auth. "
|
|
88
|
+
"AgentRules uses the SDK default runtime unless you configure an explicit executable path.[/]"
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
if diagnostics.runtime_error:
|
|
92
|
+
if not diagnostics.sdk_available:
|
|
93
|
+
notes.append("[dim]Install AgentRules dependencies so `claude-agent-sdk` is importable.[/]")
|
|
94
|
+
elif state.cli_path:
|
|
95
|
+
notes.append(
|
|
96
|
+
"[dim]Set a valid Claude executable path, or clear the path to let the SDK use its default "
|
|
97
|
+
"runtime resolution.[/]"
|
|
98
|
+
)
|
|
99
|
+
else:
|
|
100
|
+
notes.append(
|
|
101
|
+
"[dim]Install Claude Code or configure a valid Claude executable path so the SDK default "
|
|
102
|
+
"runtime can be resolved.[/]"
|
|
103
|
+
)
|
|
104
|
+
else:
|
|
105
|
+
notes.append(
|
|
106
|
+
"[dim]Authenticate outside AgentRules with Claude Code's OAuth flow. When the `claude` command "
|
|
107
|
+
"is available, run `claude auth login`; for automated environments, run `claude setup-token` "
|
|
108
|
+
"and export CLAUDE_CODE_OAUTH_TOKEN.[/]"
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
if state.sanitize_api_key_env:
|
|
112
|
+
notes.append(
|
|
113
|
+
"[dim]Anthropic API-key environment variables are stripped from Claude Code child processes "
|
|
114
|
+
"so Claude.ai OAuth remains authoritative.[/]"
|
|
115
|
+
)
|
|
116
|
+
elif diagnostics.api_key_env_present_after_sanitization:
|
|
117
|
+
notes.append(
|
|
118
|
+
"[yellow]Anthropic API-key environment variables are visible to Claude Code. "
|
|
119
|
+
"Re-enable sanitization unless you intentionally want API-key precedence.[/]"
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
if diagnostics.is_available:
|
|
123
|
+
notes.append(
|
|
124
|
+
"[dim]Next step: choose a Claude Code preset under Settings -> Model presets per phase "
|
|
125
|
+
"to route analysis through this runtime.[/]"
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
return notes
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def configure_claude_code_runtime(context: CliContext) -> None:
|
|
132
|
+
"""Interactive prompts for configuring the local Claude Code runtime."""
|
|
133
|
+
|
|
134
|
+
console = context.console
|
|
135
|
+
console.print("\n[bold]Configure Claude Code Runtime[/bold]")
|
|
136
|
+
console.print(
|
|
137
|
+
"Claude Code uses the Claude Agent SDK and Claude.ai OAuth subscription auth. Leave the executable "
|
|
138
|
+
"path blank to use the SDK default runtime; set a path only when you need an explicit override. "
|
|
139
|
+
"AgentRules only stores runtime settings and never stores Anthropic API keys for this provider.\n"
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
while True:
|
|
143
|
+
state = configuration.get_claude_code_runtime_state()
|
|
144
|
+
diagnostics = claude_code_runtime.get_claude_code_runtime_diagnostics()
|
|
145
|
+
_render_runtime_summary(context, state, diagnostics)
|
|
146
|
+
|
|
147
|
+
selection = questionary.select(
|
|
148
|
+
"Select Claude Code runtime action:",
|
|
149
|
+
choices=[
|
|
150
|
+
value_choice("Claude executable path", _format_cli_path_plain(state.cli_path), value="__CLI_PATH__"),
|
|
151
|
+
value_choice(
|
|
152
|
+
"Strip Anthropic API-key env",
|
|
153
|
+
"Yes" if state.sanitize_api_key_env else "No",
|
|
154
|
+
value="__SANITIZE__",
|
|
155
|
+
),
|
|
156
|
+
questionary.Choice(title="Show OAuth login instructions", value="__LOGIN_HELP__"),
|
|
157
|
+
value_choice(
|
|
158
|
+
"Refresh runtime status",
|
|
159
|
+
"Available" if diagnostics.is_available else "Retry",
|
|
160
|
+
value="__REFRESH__",
|
|
161
|
+
),
|
|
162
|
+
navigation_choice("Back", value="__BACK__"),
|
|
163
|
+
],
|
|
164
|
+
qmark="🧰",
|
|
165
|
+
style=CLI_STYLE,
|
|
166
|
+
).ask()
|
|
167
|
+
|
|
168
|
+
if selection in (None, "__BACK__"):
|
|
169
|
+
console.print("[dim]Leaving Claude Code runtime settings.[/]")
|
|
170
|
+
return
|
|
171
|
+
|
|
172
|
+
if selection == "__CLI_PATH__":
|
|
173
|
+
answer = questionary.text(
|
|
174
|
+
"Enter the Claude executable path or command name (leave blank for SDK default):",
|
|
175
|
+
default=state.cli_path or "",
|
|
176
|
+
qmark="🧰",
|
|
177
|
+
style=CLI_STYLE,
|
|
178
|
+
).ask()
|
|
179
|
+
if answer is None:
|
|
180
|
+
console.print("[yellow]No changes made to Claude executable path.[/]")
|
|
181
|
+
continue
|
|
182
|
+
configuration.save_claude_code_cli_path(answer)
|
|
183
|
+
console.print("[green]Claude executable path updated.[/]")
|
|
184
|
+
continue
|
|
185
|
+
|
|
186
|
+
if selection == "__SANITIZE__":
|
|
187
|
+
enabled = questionary.confirm(
|
|
188
|
+
"Strip Anthropic API-key environment variables from Claude Code child processes?",
|
|
189
|
+
default=state.sanitize_api_key_env,
|
|
190
|
+
qmark="🧰",
|
|
191
|
+
style=CLI_STYLE,
|
|
192
|
+
).ask()
|
|
193
|
+
if enabled is None:
|
|
194
|
+
console.print("[yellow]No changes made to environment sanitization.[/]")
|
|
195
|
+
continue
|
|
196
|
+
configuration.save_claude_code_sanitize_api_key_env(bool(enabled))
|
|
197
|
+
console.print("[green]Claude Code environment sanitization updated.[/]")
|
|
198
|
+
continue
|
|
199
|
+
|
|
200
|
+
if selection == "__LOGIN_HELP__":
|
|
201
|
+
console.print("[cyan]Run this in your terminal:[/] claude auth login")
|
|
202
|
+
console.print(
|
|
203
|
+
"[cyan]For automation/CI:[/] claude setup-token, then export CLAUDE_CODE_OAUTH_TOKEN"
|
|
204
|
+
)
|
|
205
|
+
console.print(
|
|
206
|
+
"[dim]Complete the Claude.ai OAuth flow in Claude Code, then return here and refresh status.[/]"
|
|
207
|
+
)
|
|
208
|
+
continue
|
|
209
|
+
|
|
210
|
+
if selection == "__REFRESH__":
|
|
211
|
+
console.print("[green]Claude Code runtime status refreshed.[/]")
|
|
212
|
+
continue
|
|
@@ -7,6 +7,7 @@ import questionary
|
|
|
7
7
|
from agentrules.cli.context import CliContext
|
|
8
8
|
from agentrules.cli.ui.styles import CLI_STYLE, navigation_choice
|
|
9
9
|
|
|
10
|
+
from .claude_code import configure_claude_code_runtime
|
|
10
11
|
from .codex import configure_codex_runtime
|
|
11
12
|
from .exclusions import configure_exclusions
|
|
12
13
|
from .logging import configure_logging
|
|
@@ -17,6 +18,7 @@ from .providers import configure_provider_keys
|
|
|
17
18
|
SETTINGS_CATEGORY_ENTRIES: tuple[tuple[str, str], ...] = (
|
|
18
19
|
("Provider API keys", "providers"),
|
|
19
20
|
("Codex runtime", "codex"),
|
|
21
|
+
("Claude Code runtime", "claude_code"),
|
|
20
22
|
("Model presets per phase", "models"),
|
|
21
23
|
("Logging verbosity", "logging"),
|
|
22
24
|
("Output preferences", "outputs"),
|
|
@@ -35,7 +37,7 @@ def configure_settings(context: CliContext) -> None:
|
|
|
35
37
|
|
|
36
38
|
console = context.console
|
|
37
39
|
console.print("\n[bold]Settings[/bold]")
|
|
38
|
-
console.print("[dim]Provider API keys and
|
|
40
|
+
console.print("[dim]Provider API keys and local CLI runtimes are configured separately.[/]")
|
|
39
41
|
|
|
40
42
|
while True:
|
|
41
43
|
selection = questionary.select(
|
|
@@ -55,6 +57,8 @@ def configure_settings(context: CliContext) -> None:
|
|
|
55
57
|
configure_provider_keys(context)
|
|
56
58
|
elif selection == "codex":
|
|
57
59
|
configure_codex_runtime(context)
|
|
60
|
+
elif selection == "claude_code":
|
|
61
|
+
configure_claude_code_runtime(context)
|
|
58
62
|
elif selection == "models":
|
|
59
63
|
configure_models(context)
|
|
60
64
|
elif selection == "logging":
|
|
@@ -177,10 +177,11 @@ def describe_researcher_phase_status(
|
|
|
177
177
|
researcher_info = model_presets.get_preset_info(researcher_key) if researcher_key else None
|
|
178
178
|
researcher_uses_native_search = uses_runtime_native_web_search(researcher_info)
|
|
179
179
|
codex_available = bool(provider_availability.get(ModelProvider.CODEX.value, False))
|
|
180
|
+
claude_code_available = bool(provider_availability.get(ModelProvider.CLAUDE_CODE.value, False))
|
|
180
181
|
|
|
181
182
|
if not tavily_available and not offline_mode and not researcher_uses_native_search:
|
|
182
|
-
if codex_available:
|
|
183
|
-
return "Needs Tavily or
|
|
183
|
+
if codex_available or claude_code_available:
|
|
184
|
+
return "Needs Tavily or runtime preset", ""
|
|
184
185
|
return "Add Tavily API key to enable", ""
|
|
185
186
|
|
|
186
187
|
status_label = "On" if researcher_mode == "on" else "Off"
|