ara-cli 0.1.9.93__tar.gz → 0.1.9.95__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.
Potentially problematic release.
This version of ara-cli might be problematic. Click here for more details.
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/PKG-INFO +18 -17
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/README.md +16 -16
- ara_cli-0.1.9.95/ara_cli/__init__.py +17 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/ara_command_action.py +23 -43
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/ara_command_parser.py +16 -1
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/ara_config.py +17 -2
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_autofix.py +40 -21
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_creator.py +3 -1
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_lister.py +29 -55
- ara_cli-0.1.9.95/ara_cli/artefact_models/artefact_data_retrieval.py +23 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_renamer.py +6 -2
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/chat.py +80 -34
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/commands/extract_command.py +4 -3
- ara_cli-0.1.9.95/ara_cli/commands/read_command.py +104 -0
- ara_cli-0.1.9.95/ara_cli/file_loaders/document_readers.py +233 -0
- ara_cli-0.1.9.95/ara_cli/file_loaders/file_loaders.py +123 -0
- ara_cli-0.1.9.95/ara_cli/file_loaders/image_processor.py +89 -0
- ara_cli-0.1.9.95/ara_cli/file_loaders/markdown_reader.py +75 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/file_loaders/text_file_loader.py +9 -11
- ara_cli-0.1.9.95/ara_cli/global_file_lister.py +61 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/prompt_extractor.py +21 -6
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/prompt_handler.py +24 -4
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/tag_extractor.py +21 -11
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/template_manager.py +14 -4
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/update_config_prompt.py +7 -1
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/version.py +1 -1
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli.egg-info/PKG-INFO +18 -17
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli.egg-info/SOURCES.txt +8 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli.egg-info/requires.txt +1 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/docker/base/requirements.txt +1 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_ara_config.py +28 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_artefact_lister.py +52 -132
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_chat.py +28 -40
- ara_cli-0.1.9.95/tests/test_global_file_lister.py +131 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_prompt_handler.py +26 -1
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_template_manager.py +5 -4
- ara_cli-0.1.9.93/ara_cli/__init__.py +0 -3
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/MANIFEST.in +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/__main__.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_deleter.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_fuzzy_search.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_link_updater.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/__init__.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/artefact_load.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/artefact_mapping.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/artefact_model.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/artefact_templates.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/businessgoal_artefact_model.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/capability_artefact_model.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/epic_artefact_model.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/example_artefact_model.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/feature_artefact_model.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/issue_artefact_model.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/keyfeature_artefact_model.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/serialize_helper.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/task_artefact_model.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/userstory_artefact_model.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/vision_artefact_model.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_reader.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_scan.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/classifier.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/codefusionretriever.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/codehierachieretriever.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/commandline_completer.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/commands/__init__.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/commands/command.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/commands/load_command.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/commands/load_image_command.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/directory_navigator.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/file_classifier.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/file_lister.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/file_loaders/__init__.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/file_loaders/binary_file_loader.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/file_loaders/document_file_loader.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/file_loaders/document_reader.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/file_loaders/file_loader.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/filename_validator.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/list_filter.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/output_suppressor.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/prompt_chat.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/prompt_rag.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/run_file_lister.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/agile.artefacts +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/blueprints/complete_pytest_unittest.blueprint.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/blueprints/empty.blueprint.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/blueprints/task_todo_list_C4_architecture_analysis.blueprint.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/blueprints/task_todo_list_implement_feature_BDD_way.blueprint.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/architecture_C4_analysis.commands.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/architecture_radon_cc_score.commands.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/architecture_radon_halstead_v.commands.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/architecture_radon_maintainability_score.commands.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/artefact_classification.commands.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/artefact_extension.commands.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/artefact_formulation.commands.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/behave_step_generation.commands.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/code_generation_complex.commands.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/code_generation_simple.commands.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/empty.commands.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/error_fixing.commands.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/feature_file_update.commands.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/feature_formulation.commands.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/js_code_generation_simple.commands.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/refactoring.commands.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/refactoring_analysis.commands.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/reverse_engineer_feature_file.commands.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/reverse_engineer_program_flow.commands.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/classify_task.intention.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/empty.intention.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/error_fixing.intention.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/feature_fix_steps_for_scenario.intention.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/feature_formulation.intention.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/feature_reverse_formulation_from_code.intention.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/feature_scenario_implementation.intention.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/feature_scenario_implementation_update.intention.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/feature_scenario_outline_extension.intention.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/feature_update_formulation.intention.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/fibonacci_example_implementation.intention.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/js_implementation_from_task_description.intention.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/js_steps_implementation.intention.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/python_cli_implementation_with_test.intention.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/python_code_understanding.intention.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/task_implementation.intention.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/task_prompt_control_by_status.intention.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/task_stepwise_implementation_by_number.intention.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/task_stepwise_implementation_by_status.intention.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/rules/architecture_analyst.rules.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/rules/code_analyst.rules.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/rules/empty.rules.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/rules/error_analyst.rules.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/rules/gherkin_expert.rules.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/rules/js_expert_developer.rules.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/rules/product_owner.rules.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/rules/python_behave.rules.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/rules/python_developer.rules.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/specification_breakdown_files/template.concept.exploration.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/specification_breakdown_files/template.concept.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/specification_breakdown_files/template.customer.exploration.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/specification_breakdown_files/template.customer.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/specification_breakdown_files/template.persona.exploration.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/specification_breakdown_files/template.persona.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/specification_breakdown_files/template.step.exploration.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/specification_breakdown_files/template.step.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/specification_breakdown_files/template.technology.exploration.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/specification_breakdown_files/template.technology.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.businessgoal.prompt_log.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.capability.prompt_log.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.epic.prompt_log.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.example.prompt_log.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.feature.prompt_log.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.issue.prompt_log.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.keyfeature.prompt_log.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.steps.prompt_log.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.task.prompt_log.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.userstory.prompt_log.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.vision.prompt_log.md +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli.egg-info/dependency_links.txt +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli.egg-info/entry_points.txt +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli.egg-info/top_level.txt +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/setup.cfg +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/setup.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/__init__.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_ara_command_action.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_artefact_autofix.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_artefact_fuzzy_search.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_artefact_link_updater.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_artefact_reader.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_artefact_renamer.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_artefact_scan.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_classifier.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_directory_navigator.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_file_classifier.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_file_creator.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_file_lister.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_list_filter.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_tag_extractor.py +0 -0
- {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_update_config_prompt.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ara_cli
|
|
3
|
-
Version: 0.1.9.
|
|
3
|
+
Version: 0.1.9.95
|
|
4
4
|
Summary: Powerful, open source command-line tool for managing, structuring and automating software development artifacts in line with Business-Driven Development (BDD) and AI-assisted processes
|
|
5
5
|
Description-Content-Type: text/markdown
|
|
6
6
|
Requires-Dist: litellm
|
|
@@ -13,6 +13,7 @@ Requires-Dist: json-repair
|
|
|
13
13
|
Requires-Dist: argparse
|
|
14
14
|
Requires-Dist: argcomplete
|
|
15
15
|
Requires-Dist: cmd2>=2.5
|
|
16
|
+
Requires-Dist: charset-normalizer
|
|
16
17
|
Requires-Dist: pydantic
|
|
17
18
|
Requires-Dist: pydantic_ai
|
|
18
19
|
Requires-Dist: python-docx
|
|
@@ -108,22 +109,22 @@ ara autofix
|
|
|
108
109
|
|
|
109
110
|
## Command Overview
|
|
110
111
|
|
|
111
|
-
| Action
|
|
112
|
-
|
|
113
|
-
| create
|
|
114
|
-
| delete
|
|
115
|
-
| rename
|
|
116
|
-
| list, list-tags
|
|
117
|
-
| prompt, chat
|
|
118
|
-
| template
|
|
119
|
-
| fetch-templates
|
|
120
|
-
| read
|
|
121
|
-
| reconnect
|
|
122
|
-
| read-status, set-status | Query and assign status to artefacts
|
|
123
|
-
| read-user, set-user | Query and assign responsible users
|
|
124
|
-
| classifier-directory | Show directory of artefact classifiers
|
|
125
|
-
| scan
|
|
126
|
-
| autofix
|
|
112
|
+
| Action | Description |
|
|
113
|
+
| ----------------------- | ----------------------------------------------------------------------- |
|
|
114
|
+
| create | Create a classified artefact with data directory |
|
|
115
|
+
| delete | Delete an artefact and its data directory |
|
|
116
|
+
| rename | Rename an artefact and its data directory |
|
|
117
|
+
| list, list-tags | List artefacts, show tags, filter by content, extension, hierarchy etc. |
|
|
118
|
+
| prompt, chat | Use AI-powered chat and prompt templates for artefact management |
|
|
119
|
+
| template | Print artefact templates in the terminal |
|
|
120
|
+
| fetch-templates | Download and manage reusable prompt templates |
|
|
121
|
+
| read | Output artefact contents and their full contribution chain |
|
|
122
|
+
| reconnect | Connect artefacts to parent artefacts |
|
|
123
|
+
| read-status, set-status | Query and assign status to artefacts |
|
|
124
|
+
| read-user, set-user | Query and assign responsible users |
|
|
125
|
+
| classifier-directory | Show directory of artefact classifiers |
|
|
126
|
+
| scan | Scan the ARA tree for incompatible or inconsistent artefacts |
|
|
127
|
+
| autofix | Automatically correct artefact issues with LLM assistance |
|
|
127
128
|
|
|
128
129
|
See `ara -h` for the complete list of commands and usage examples.
|
|
129
130
|
|
|
@@ -84,22 +84,22 @@ ara autofix
|
|
|
84
84
|
|
|
85
85
|
## Command Overview
|
|
86
86
|
|
|
87
|
-
| Action
|
|
88
|
-
|
|
89
|
-
| create
|
|
90
|
-
| delete
|
|
91
|
-
| rename
|
|
92
|
-
| list, list-tags
|
|
93
|
-
| prompt, chat
|
|
94
|
-
| template
|
|
95
|
-
| fetch-templates
|
|
96
|
-
| read
|
|
97
|
-
| reconnect
|
|
98
|
-
| read-status, set-status | Query and assign status to artefacts
|
|
99
|
-
| read-user, set-user | Query and assign responsible users
|
|
100
|
-
| classifier-directory | Show directory of artefact classifiers
|
|
101
|
-
| scan
|
|
102
|
-
| autofix
|
|
87
|
+
| Action | Description |
|
|
88
|
+
| ----------------------- | ----------------------------------------------------------------------- |
|
|
89
|
+
| create | Create a classified artefact with data directory |
|
|
90
|
+
| delete | Delete an artefact and its data directory |
|
|
91
|
+
| rename | Rename an artefact and its data directory |
|
|
92
|
+
| list, list-tags | List artefacts, show tags, filter by content, extension, hierarchy etc. |
|
|
93
|
+
| prompt, chat | Use AI-powered chat and prompt templates for artefact management |
|
|
94
|
+
| template | Print artefact templates in the terminal |
|
|
95
|
+
| fetch-templates | Download and manage reusable prompt templates |
|
|
96
|
+
| read | Output artefact contents and their full contribution chain |
|
|
97
|
+
| reconnect | Connect artefacts to parent artefacts |
|
|
98
|
+
| read-status, set-status | Query and assign status to artefacts |
|
|
99
|
+
| read-user, set-user | Query and assign responsible users |
|
|
100
|
+
| classifier-directory | Show directory of artefact classifiers |
|
|
101
|
+
| scan | Scan the ARA tree for incompatible or inconsistent artefacts |
|
|
102
|
+
| autofix | Automatically correct artefact issues with LLM assistance |
|
|
103
103
|
|
|
104
104
|
See `ara -h` for the complete list of commands and usage examples.
|
|
105
105
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import warnings
|
|
2
|
+
from .version import __version__
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
whitelisted_commands = ["RERUN", "SEND", "EXTRACT", "LOAD_IMAGE", "CHOOSE_MODEL", "CHOOSE_EXTRACTION_MODEL", "CURRENT_MODEL", "CURRENT_EXTRACTION_MODEL", "LIST_MODELS"]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# ANSI escape codes for coloring
|
|
9
|
+
YELLOW = '\033[93m'
|
|
10
|
+
RESET = '\033[0m'
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def format_warning(message, category, *args, **kwargs):
|
|
14
|
+
return f'{YELLOW}{category.__name__}: {message}{RESET}\n'
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
warnings.formatwarning = format_warning
|
|
@@ -165,6 +165,7 @@ def prompt_action(args):
|
|
|
165
165
|
classifier = args.classifier
|
|
166
166
|
param = args.parameter
|
|
167
167
|
init = args.steps
|
|
168
|
+
write = getattr(args, 'write', False)
|
|
168
169
|
|
|
169
170
|
def handle_init():
|
|
170
171
|
from ara_cli.prompt_handler import initialize_prompt_templates
|
|
@@ -192,7 +193,7 @@ def prompt_action(args):
|
|
|
192
193
|
def handle_extract():
|
|
193
194
|
from ara_cli.prompt_extractor import extract_and_save_prompt_results
|
|
194
195
|
from ara_cli.update_config_prompt import update_artefact_config_prompt_files
|
|
195
|
-
extract_and_save_prompt_results(classifier, param)
|
|
196
|
+
extract_and_save_prompt_results(classifier, param, write=write)
|
|
196
197
|
print(f"automatic update after extract")
|
|
197
198
|
update_artefact_config_prompt_files(classifier, param, automatic_update=True)
|
|
198
199
|
|
|
@@ -294,53 +295,30 @@ def fetch_templates_action(args):
|
|
|
294
295
|
|
|
295
296
|
|
|
296
297
|
def read_action(args):
|
|
297
|
-
from ara_cli.
|
|
298
|
-
from ara_cli.
|
|
298
|
+
from ara_cli.commands.read_command import ReadCommand
|
|
299
|
+
from ara_cli.list_filter import ListFilter
|
|
299
300
|
|
|
300
301
|
classifier = args.classifier
|
|
301
302
|
artefact_name = args.parameter
|
|
302
303
|
read_mode = args.read_mode
|
|
303
304
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
all_artefact_names
|
|
313
|
-
)
|
|
314
|
-
return
|
|
315
|
-
|
|
316
|
-
target_artefact = next(filter(
|
|
317
|
-
lambda x: x.title == artefact_name, artefacts
|
|
318
|
-
))
|
|
305
|
+
list_filter = ListFilter(
|
|
306
|
+
include_content=args.include_content,
|
|
307
|
+
exclude_content=args.exclude_content,
|
|
308
|
+
include_extension=args.include_extension,
|
|
309
|
+
exclude_extension=args.exclude_extension,
|
|
310
|
+
include_tags=args.include_tags,
|
|
311
|
+
exclude_tags=args.exclude_tags
|
|
312
|
+
)
|
|
319
313
|
|
|
320
|
-
|
|
314
|
+
command = ReadCommand(
|
|
315
|
+
classifier=classifier,
|
|
316
|
+
artefact_name=artefact_name,
|
|
317
|
+
read_mode=read_mode,
|
|
318
|
+
list_filter=list_filter
|
|
319
|
+
)
|
|
321
320
|
|
|
322
|
-
|
|
323
|
-
case "branch":
|
|
324
|
-
ArtefactReader.step_through_value_chain(
|
|
325
|
-
artefact_name=artefact_name,
|
|
326
|
-
classifier=classifier,
|
|
327
|
-
artefacts_by_classifier=artefacts_by_classifier,
|
|
328
|
-
classified_artefacts=classified_artefacts
|
|
329
|
-
)
|
|
330
|
-
file_classifier.print_classified_files(artefacts_by_classifier, print_content=True)
|
|
331
|
-
case "children":
|
|
332
|
-
artefacts = ArtefactReader.find_children(
|
|
333
|
-
artefact_name=artefact_name,
|
|
334
|
-
classifier=classifier,
|
|
335
|
-
classified_artefacts=classified_artefacts
|
|
336
|
-
)
|
|
337
|
-
file_classifier.print_classified_files(
|
|
338
|
-
files_by_classifier=artefacts,
|
|
339
|
-
print_content=True
|
|
340
|
-
)
|
|
341
|
-
case _:
|
|
342
|
-
artefacts_by_classifier[classifier].append(target_artefact)
|
|
343
|
-
file_classifier.print_classified_files(artefacts_by_classifier, print_content=True)
|
|
321
|
+
command.execute()
|
|
344
322
|
|
|
345
323
|
|
|
346
324
|
def reconnect_action(args):
|
|
@@ -615,11 +593,13 @@ def extract_action(args):
|
|
|
615
593
|
from ara_cli.commands.extract_command import ExtractCommand
|
|
616
594
|
|
|
617
595
|
filename = args.filename
|
|
618
|
-
|
|
596
|
+
force = args.force
|
|
597
|
+
write = getattr(args, 'write', False)
|
|
619
598
|
print(filename)
|
|
620
599
|
command = ExtractCommand(
|
|
621
600
|
file_name=filename,
|
|
622
|
-
|
|
601
|
+
force=force,
|
|
602
|
+
write=write,
|
|
623
603
|
output=lambda msg: print(msg, file=sys.stdout),
|
|
624
604
|
error_output=lambda msg: print(msg, file=sys.stderr)
|
|
625
605
|
)
|
|
@@ -254,6 +254,13 @@ def prompt_parser(subparsers):
|
|
|
254
254
|
).completer = ArtefactCompleter()
|
|
255
255
|
if step == "chat":
|
|
256
256
|
add_chat_arguments(step_parser)
|
|
257
|
+
if step == "extract":
|
|
258
|
+
step_parser.add_argument(
|
|
259
|
+
"-w",
|
|
260
|
+
"--write",
|
|
261
|
+
action="store_true",
|
|
262
|
+
help="Overwrite existing files without using LLM for merging."
|
|
263
|
+
)
|
|
257
264
|
|
|
258
265
|
|
|
259
266
|
def chat_parser(subparsers):
|
|
@@ -287,6 +294,8 @@ def read_parser(subparsers):
|
|
|
287
294
|
"parameter", help="Filename of artefact"
|
|
288
295
|
).completer = ArtefactCompleter()
|
|
289
296
|
|
|
297
|
+
add_filter_flags(read_parser)
|
|
298
|
+
|
|
290
299
|
branch_group = read_parser.add_mutually_exclusive_group()
|
|
291
300
|
branch_group.add_argument(
|
|
292
301
|
"-b",
|
|
@@ -429,10 +438,16 @@ def extract_parser(subparsers):
|
|
|
429
438
|
help="Input file to extract from."
|
|
430
439
|
)
|
|
431
440
|
extract_parser.add_argument(
|
|
432
|
-
"--
|
|
441
|
+
"--force", "-f",
|
|
433
442
|
action="store_true",
|
|
434
443
|
help="Answer queries with yes when extracting."
|
|
435
444
|
)
|
|
445
|
+
extract_parser.add_argument(
|
|
446
|
+
"-w",
|
|
447
|
+
"--write",
|
|
448
|
+
action="store_true",
|
|
449
|
+
help="Overwrite existing files without using LLM for merging."
|
|
450
|
+
)
|
|
436
451
|
|
|
437
452
|
|
|
438
453
|
class CustomHelpFormatter(argparse.HelpFormatter):
|
|
@@ -6,6 +6,7 @@ from os.path import exists, dirname
|
|
|
6
6
|
from os import makedirs
|
|
7
7
|
from functools import lru_cache
|
|
8
8
|
import sys
|
|
9
|
+
import warnings
|
|
9
10
|
|
|
10
11
|
DEFAULT_CONFIG_LOCATION = "./ara/.araconfig/ara_config.json"
|
|
11
12
|
|
|
@@ -21,6 +22,7 @@ class ARAconfig(BaseModel):
|
|
|
21
22
|
{"source_dir": "./src"},
|
|
22
23
|
{"source_dir": "./tests"}
|
|
23
24
|
])
|
|
25
|
+
global_dirs: Optional[List[Dict[str, str]]] = Field(default=[])
|
|
24
26
|
glossary_dir: str = "./glossary"
|
|
25
27
|
doc_dir: str = "./docs"
|
|
26
28
|
local_prompt_templates_dir: str = "./ara/.araconfig"
|
|
@@ -162,6 +164,7 @@ def handle_unrecognized_keys(data: dict) -> dict:
|
|
|
162
164
|
cleaned_data[key] = value
|
|
163
165
|
return cleaned_data
|
|
164
166
|
|
|
167
|
+
|
|
165
168
|
# Function to read the JSON file and return an ARAconfig model
|
|
166
169
|
@lru_cache(maxsize=1)
|
|
167
170
|
def read_data(filepath: str) -> ARAconfig:
|
|
@@ -170,6 +173,16 @@ def read_data(filepath: str) -> ARAconfig:
|
|
|
170
173
|
If the file doesn't exist, it creates a default one.
|
|
171
174
|
If the file is invalid, it corrects only the broken parts.
|
|
172
175
|
"""
|
|
176
|
+
|
|
177
|
+
def warn_on_duplicate_llm_dict_key(ordered_pairs):
|
|
178
|
+
"""Reject duplicate keys."""
|
|
179
|
+
d = {}
|
|
180
|
+
for k, v in ordered_pairs:
|
|
181
|
+
if k in d:
|
|
182
|
+
warnings.warn(f"Duplicate LLM configuration identifier '{k}'. The previous entry will be removed.", UserWarning)
|
|
183
|
+
d[k] = v
|
|
184
|
+
return d
|
|
185
|
+
|
|
173
186
|
ensure_directory_exists(dirname(filepath))
|
|
174
187
|
|
|
175
188
|
if not exists(filepath):
|
|
@@ -181,7 +194,8 @@ def read_data(filepath: str) -> ARAconfig:
|
|
|
181
194
|
|
|
182
195
|
try:
|
|
183
196
|
with open(filepath, "r", encoding="utf-8") as file:
|
|
184
|
-
|
|
197
|
+
content = file.read()
|
|
198
|
+
data = json.loads(content, object_pairs_hook=warn_on_duplicate_llm_dict_key)
|
|
185
199
|
except json.JSONDecodeError as e:
|
|
186
200
|
print(f"Error: Invalid JSON in configuration file: {e}")
|
|
187
201
|
print("Creating a new configuration with defaults...")
|
|
@@ -206,7 +220,8 @@ def read_data(filepath: str) -> ARAconfig:
|
|
|
206
220
|
|
|
207
221
|
for field_name in error_fields:
|
|
208
222
|
print(f"-> Field '{field_name}' is invalid and will be reverted to its default value.")
|
|
209
|
-
|
|
223
|
+
if field_name in corrected_data:
|
|
224
|
+
corrected_data[field_name] = defaults.get(field_name)
|
|
210
225
|
|
|
211
226
|
print("--- End of Error Report ---")
|
|
212
227
|
|
|
@@ -144,11 +144,11 @@ def run_agent(prompt, artefact_class):
|
|
|
144
144
|
# anthropic:claude-4-sonnet-20250514
|
|
145
145
|
agent = Agent(
|
|
146
146
|
model="anthropic:claude-4-sonnet-20250514",
|
|
147
|
-
|
|
147
|
+
output_type=artefact_class,
|
|
148
148
|
instrument=True,
|
|
149
149
|
)
|
|
150
150
|
result = agent.run_sync(prompt)
|
|
151
|
-
return result.
|
|
151
|
+
return result.output
|
|
152
152
|
|
|
153
153
|
|
|
154
154
|
def write_corrected_artefact(file_path, corrected_text):
|
|
@@ -196,36 +196,52 @@ def ask_for_correct_contribution(
|
|
|
196
196
|
return name, classifier
|
|
197
197
|
|
|
198
198
|
|
|
199
|
-
def ask_for_contribution_choice(
|
|
200
|
-
|
|
201
|
-
) -> Optional[str]:
|
|
202
|
-
artefact_name, artefact_classifier = (
|
|
203
|
-
artefact_info if artefact_info else (None, None)
|
|
204
|
-
)
|
|
199
|
+
def ask_for_contribution_choice(choices: List[str], artefact_info: Optional[tuple[str, str]] = None) -> Optional[str]:
|
|
200
|
+
artefact_name, artefact_classifier = artefact_info if artefact_info else (None, None)
|
|
205
201
|
message = "Found multiple close matches for the contribution"
|
|
206
202
|
if artefact_name and artefact_classifier:
|
|
207
203
|
message += f" of the {artefact_classifier} '{artefact_name}'"
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
204
|
+
message += "."
|
|
205
|
+
return get_user_choice(choices, message)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def _has_valid_contribution(artefact: Artefact) -> bool:
|
|
209
|
+
contribution = artefact.contribution
|
|
210
|
+
return contribution and contribution.artefact_name and contribution.classifier
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
def get_user_choice(choices: List[str], message: str) -> Optional[str]:
|
|
214
|
+
"""
|
|
215
|
+
Generic function to present user with a list of choices and return their selection.
|
|
216
|
+
|
|
217
|
+
Args:
|
|
218
|
+
choices: A list of strings representing the choices to display.
|
|
219
|
+
message: A message to display before listing the choices.
|
|
220
|
+
|
|
221
|
+
Returns:
|
|
222
|
+
The chosen item from the list or None if the input was invalid.
|
|
223
|
+
"""
|
|
224
|
+
print(message)
|
|
225
|
+
for i, choice in enumerate(choices):
|
|
226
|
+
print(f"{i + 1}: {choice}")
|
|
227
|
+
|
|
228
|
+
choice_number = input("Please enter your choice (number): ")
|
|
229
|
+
|
|
214
230
|
try:
|
|
215
231
|
choice_index = int(choice_number) - 1
|
|
216
232
|
if choice_index < 0 or choice_index >= len(choices):
|
|
217
|
-
print("Invalid choice. Aborting
|
|
233
|
+
print("Invalid choice. Aborting operation.")
|
|
218
234
|
return None
|
|
219
|
-
|
|
235
|
+
return choices[choice_index]
|
|
220
236
|
except ValueError:
|
|
221
|
-
print("Invalid input. Aborting
|
|
237
|
+
print("Invalid input. Aborting operation.")
|
|
222
238
|
return None
|
|
223
|
-
return choice
|
|
224
239
|
|
|
225
240
|
|
|
226
|
-
def
|
|
227
|
-
|
|
228
|
-
|
|
241
|
+
def ask_for_rule_choice(matches: List[str]) -> Optional[str]:
|
|
242
|
+
"""Asks the user for a choice between multiple rule matches"""
|
|
243
|
+
message = "Multiple rule matches found:"
|
|
244
|
+
return get_user_choice(matches, message)
|
|
229
245
|
|
|
230
246
|
|
|
231
247
|
def _update_rule(
|
|
@@ -249,6 +265,9 @@ def _update_rule(
|
|
|
249
265
|
return
|
|
250
266
|
if not closest_rule_match:
|
|
251
267
|
return
|
|
268
|
+
if len(closest_rule_match) > 1:
|
|
269
|
+
artefact.contribution.rule = ask_for_rule_choice(closest_rule_match)
|
|
270
|
+
return
|
|
252
271
|
artefact.contribution.rule = closest_rule_match[0]
|
|
253
272
|
|
|
254
273
|
|
|
@@ -106,7 +106,7 @@ class ArtefactCreator:
|
|
|
106
106
|
if not self.handle_existing_files(file_exists):
|
|
107
107
|
return
|
|
108
108
|
|
|
109
|
-
artefact = template_artefact_of_type(classifier, filename,
|
|
109
|
+
artefact = template_artefact_of_type(classifier, filename, True)
|
|
110
110
|
|
|
111
111
|
if parent_classifier and parent_name:
|
|
112
112
|
artefact.set_contribution(
|
|
@@ -114,6 +114,8 @@ class ArtefactCreator:
|
|
|
114
114
|
classifier=parent_classifier,
|
|
115
115
|
rule=rule
|
|
116
116
|
)
|
|
117
|
+
else:
|
|
118
|
+
artefact.set_contribution(None, None, None)
|
|
117
119
|
|
|
118
120
|
artefact_content = artefact.serialize()
|
|
119
121
|
rmtree(dir_path, ignore_errors=True)
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
from ara_cli.file_classifier import FileClassifier
|
|
2
2
|
from ara_cli.artefact_reader import ArtefactReader
|
|
3
3
|
from ara_cli.file_lister import list_files_in_directory
|
|
4
|
-
from ara_cli.artefact_models.artefact_model import Artefact
|
|
5
4
|
from ara_cli.list_filter import ListFilter, filter_list
|
|
6
5
|
from ara_cli.artefact_fuzzy_search import suggest_close_name_matches
|
|
6
|
+
from ara_cli.artefact_models.artefact_data_retrieval import (
|
|
7
|
+
artefact_content_retrieval,
|
|
8
|
+
artefact_path_retrieval,
|
|
9
|
+
artefact_tags_retrieval,
|
|
10
|
+
)
|
|
7
11
|
import os
|
|
8
12
|
|
|
9
13
|
|
|
@@ -11,43 +15,18 @@ class ArtefactLister:
|
|
|
11
15
|
def __init__(self, file_system=None):
|
|
12
16
|
self.file_system = file_system or os
|
|
13
17
|
|
|
14
|
-
@staticmethod
|
|
15
|
-
def artefact_content_retrieval(artefact: Artefact):
|
|
16
|
-
content = artefact.serialize()
|
|
17
|
-
return content
|
|
18
|
-
|
|
19
|
-
@staticmethod
|
|
20
|
-
def artefact_path_retrieval(artefact: Artefact):
|
|
21
|
-
return artefact.file_path
|
|
22
|
-
|
|
23
|
-
@staticmethod
|
|
24
|
-
def artefact_tags_retrieval(artefact: Artefact):
|
|
25
|
-
final_tags = []
|
|
26
|
-
|
|
27
|
-
if not artefact:
|
|
28
|
-
return []
|
|
29
|
-
|
|
30
|
-
final_tags.extend([f"user_{user}" for user in artefact.users])
|
|
31
|
-
final_tags.append(artefact.status)
|
|
32
|
-
final_tags.extend(artefact.tags)
|
|
33
|
-
|
|
34
|
-
return final_tags
|
|
35
|
-
|
|
36
18
|
def filter_artefacts(self, classified_files: list, list_filter: ListFilter):
|
|
37
19
|
filtered_list = filter_list(
|
|
38
20
|
list_to_filter=classified_files,
|
|
39
21
|
list_filter=list_filter,
|
|
40
|
-
content_retrieval_strategy=
|
|
41
|
-
file_path_retrieval=
|
|
42
|
-
tag_retrieval=
|
|
22
|
+
content_retrieval_strategy=artefact_content_retrieval,
|
|
23
|
+
file_path_retrieval=artefact_path_retrieval,
|
|
24
|
+
tag_retrieval=artefact_tags_retrieval,
|
|
43
25
|
)
|
|
44
26
|
return filtered_list
|
|
45
27
|
|
|
46
28
|
def list_files(
|
|
47
|
-
self,
|
|
48
|
-
tags=None,
|
|
49
|
-
navigate_to_target=False,
|
|
50
|
-
list_filter: ListFilter | None = None
|
|
29
|
+
self, tags=None, navigate_to_target=False, list_filter: ListFilter | None = None
|
|
51
30
|
):
|
|
52
31
|
artefact_list = ArtefactReader.read_artefacts(tags=tags)
|
|
53
32
|
artefact_list = self.filter_artefacts(artefact_list, list_filter)
|
|
@@ -60,20 +39,18 @@ class ArtefactLister:
|
|
|
60
39
|
file_classifier.print_classified_files(filtered_artefact_list)
|
|
61
40
|
|
|
62
41
|
def list_branch(
|
|
63
|
-
self,
|
|
64
|
-
classifier,
|
|
65
|
-
artefact_name,
|
|
66
|
-
list_filter: ListFilter | None = None
|
|
42
|
+
self, classifier, artefact_name, list_filter: ListFilter | None = None
|
|
67
43
|
):
|
|
68
44
|
file_classifier = FileClassifier(os)
|
|
69
45
|
classified_artefacts = file_classifier.classify_files()
|
|
70
46
|
artefact_info = classified_artefacts.get(classifier, [])
|
|
71
|
-
matching_artefact_info = [
|
|
47
|
+
matching_artefact_info = [
|
|
48
|
+
p for p in artefact_info if p["title"] == artefact_name
|
|
49
|
+
]
|
|
72
50
|
|
|
73
51
|
if not matching_artefact_info:
|
|
74
52
|
suggest_close_name_matches(
|
|
75
|
-
artefact_name,
|
|
76
|
-
[info["title"] for info in artefact_info]
|
|
53
|
+
artefact_name, [info["title"] for info in artefact_info]
|
|
77
54
|
)
|
|
78
55
|
|
|
79
56
|
artefacts_by_classifier = {classifier: []}
|
|
@@ -82,29 +59,28 @@ class ArtefactLister:
|
|
|
82
59
|
classifier=classifier,
|
|
83
60
|
artefacts_by_classifier=artefacts_by_classifier,
|
|
84
61
|
)
|
|
85
|
-
artefacts_by_classifier = self.filter_artefacts(
|
|
62
|
+
artefacts_by_classifier = self.filter_artefacts(
|
|
63
|
+
artefacts_by_classifier, list_filter
|
|
64
|
+
)
|
|
86
65
|
file_classifier.print_classified_files(artefacts_by_classifier)
|
|
87
66
|
|
|
88
67
|
def list_children(
|
|
89
|
-
self,
|
|
90
|
-
classifier,
|
|
91
|
-
artefact_name,
|
|
92
|
-
list_filter: ListFilter | None = None
|
|
68
|
+
self, classifier, artefact_name, list_filter: ListFilter | None = None
|
|
93
69
|
):
|
|
94
70
|
file_classifier = FileClassifier(os)
|
|
95
71
|
classified_artefacts = file_classifier.classify_files()
|
|
96
72
|
artefact_info = classified_artefacts.get(classifier, [])
|
|
97
|
-
matching_artefact_info = [
|
|
73
|
+
matching_artefact_info = [
|
|
74
|
+
p for p in artefact_info if p["title"] == artefact_name
|
|
75
|
+
]
|
|
98
76
|
|
|
99
77
|
if not matching_artefact_info:
|
|
100
78
|
suggest_close_name_matches(
|
|
101
|
-
artefact_name,
|
|
102
|
-
[info["title"] for info in artefact_info]
|
|
79
|
+
artefact_name, [info["title"] for info in artefact_info]
|
|
103
80
|
)
|
|
104
81
|
|
|
105
82
|
child_artefacts = ArtefactReader.find_children(
|
|
106
|
-
artefact_name=artefact_name,
|
|
107
|
-
classifier=classifier
|
|
83
|
+
artefact_name=artefact_name, classifier=classifier
|
|
108
84
|
)
|
|
109
85
|
|
|
110
86
|
child_artefacts = self.filter_artefacts(child_artefacts, list_filter)
|
|
@@ -112,25 +88,23 @@ class ArtefactLister:
|
|
|
112
88
|
file_classifier.print_classified_files(child_artefacts)
|
|
113
89
|
|
|
114
90
|
def list_data(
|
|
115
|
-
self,
|
|
116
|
-
classifier,
|
|
117
|
-
artefact_name,
|
|
118
|
-
list_filter: ListFilter | None = None
|
|
91
|
+
self, classifier, artefact_name, list_filter: ListFilter | None = None
|
|
119
92
|
):
|
|
120
93
|
file_classifier = FileClassifier(os)
|
|
121
94
|
classified_artefact_info = file_classifier.classify_files()
|
|
122
95
|
artefact_info_dict = classified_artefact_info.get(classifier, [])
|
|
123
96
|
|
|
124
|
-
matching_info = [
|
|
97
|
+
matching_info = [
|
|
98
|
+
info for info in artefact_info_dict if info["title"] == artefact_name
|
|
99
|
+
]
|
|
125
100
|
|
|
126
101
|
if not matching_info:
|
|
127
102
|
suggest_close_name_matches(
|
|
128
|
-
artefact_name,
|
|
129
|
-
[info["title"] for info in artefact_info_dict]
|
|
103
|
+
artefact_name, [info["title"] for info in artefact_info_dict]
|
|
130
104
|
)
|
|
131
105
|
return
|
|
132
106
|
|
|
133
107
|
artefact_info = matching_info[0]
|
|
134
|
-
data_dir = os.path.splitext(artefact_info["file_path"])[0] +
|
|
108
|
+
data_dir = os.path.splitext(artefact_info["file_path"])[0] + ".data"
|
|
135
109
|
if os.path.exists(data_dir):
|
|
136
110
|
list_files_in_directory(data_dir, list_filter)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from ara_cli.artefact_models.artefact_model import Artefact
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def artefact_content_retrieval(artefact: Artefact):
|
|
5
|
+
content = artefact.serialize()
|
|
6
|
+
return content
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def artefact_path_retrieval(artefact: Artefact):
|
|
10
|
+
return artefact.file_path
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def artefact_tags_retrieval(artefact: Artefact):
|
|
14
|
+
final_tags = []
|
|
15
|
+
|
|
16
|
+
if not artefact:
|
|
17
|
+
return []
|
|
18
|
+
|
|
19
|
+
final_tags.extend([f"user_{user}" for user in artefact.users])
|
|
20
|
+
final_tags.append(artefact.status)
|
|
21
|
+
final_tags.extend(artefact.tags)
|
|
22
|
+
|
|
23
|
+
return final_tags
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import os
|
|
2
1
|
from functools import lru_cache
|
|
3
2
|
from ara_cli.classifier import Classifier
|
|
4
3
|
from ara_cli.artefact_link_updater import ArtefactLinkUpdater
|
|
5
4
|
from ara_cli.template_manager import DirectoryNavigator
|
|
5
|
+
import os
|
|
6
6
|
import re
|
|
7
|
+
import warnings
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class ArtefactRenamer:
|
|
@@ -22,6 +23,8 @@ class ArtefactRenamer:
|
|
|
22
23
|
return re.compile(pattern)
|
|
23
24
|
|
|
24
25
|
def rename(self, old_name, new_name, classifier):
|
|
26
|
+
import shutil
|
|
27
|
+
|
|
25
28
|
original_directory = self.navigate_to_target()
|
|
26
29
|
|
|
27
30
|
if not new_name:
|
|
@@ -47,7 +50,8 @@ class ArtefactRenamer:
|
|
|
47
50
|
if self.file_system.path.exists(new_file_path):
|
|
48
51
|
raise FileExistsError(f"The new file name {new_file_path} already exists.")
|
|
49
52
|
if self.file_system.path.exists(new_dir_path):
|
|
50
|
-
|
|
53
|
+
warnings.warn(f"The new directory name {new_dir_path} already exists. It will be replaced by the artefact's data directory or removed entirely.", UserWarning)
|
|
54
|
+
shutil.rmtree(new_dir_path)
|
|
51
55
|
|
|
52
56
|
# Perform the renaming of the file and directory
|
|
53
57
|
self.file_system.rename(old_file_path, new_file_path)
|