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.

Files changed (176) hide show
  1. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/PKG-INFO +18 -17
  2. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/README.md +16 -16
  3. ara_cli-0.1.9.95/ara_cli/__init__.py +17 -0
  4. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/ara_command_action.py +23 -43
  5. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/ara_command_parser.py +16 -1
  6. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/ara_config.py +17 -2
  7. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_autofix.py +40 -21
  8. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_creator.py +3 -1
  9. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_lister.py +29 -55
  10. ara_cli-0.1.9.95/ara_cli/artefact_models/artefact_data_retrieval.py +23 -0
  11. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_renamer.py +6 -2
  12. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/chat.py +80 -34
  13. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/commands/extract_command.py +4 -3
  14. ara_cli-0.1.9.95/ara_cli/commands/read_command.py +104 -0
  15. ara_cli-0.1.9.95/ara_cli/file_loaders/document_readers.py +233 -0
  16. ara_cli-0.1.9.95/ara_cli/file_loaders/file_loaders.py +123 -0
  17. ara_cli-0.1.9.95/ara_cli/file_loaders/image_processor.py +89 -0
  18. ara_cli-0.1.9.95/ara_cli/file_loaders/markdown_reader.py +75 -0
  19. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/file_loaders/text_file_loader.py +9 -11
  20. ara_cli-0.1.9.95/ara_cli/global_file_lister.py +61 -0
  21. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/prompt_extractor.py +21 -6
  22. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/prompt_handler.py +24 -4
  23. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/tag_extractor.py +21 -11
  24. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/template_manager.py +14 -4
  25. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/update_config_prompt.py +7 -1
  26. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/version.py +1 -1
  27. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli.egg-info/PKG-INFO +18 -17
  28. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli.egg-info/SOURCES.txt +8 -0
  29. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli.egg-info/requires.txt +1 -0
  30. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/docker/base/requirements.txt +1 -0
  31. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_ara_config.py +28 -0
  32. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_artefact_lister.py +52 -132
  33. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_chat.py +28 -40
  34. ara_cli-0.1.9.95/tests/test_global_file_lister.py +131 -0
  35. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_prompt_handler.py +26 -1
  36. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_template_manager.py +5 -4
  37. ara_cli-0.1.9.93/ara_cli/__init__.py +0 -3
  38. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/MANIFEST.in +0 -0
  39. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/__main__.py +0 -0
  40. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_deleter.py +0 -0
  41. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_fuzzy_search.py +0 -0
  42. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_link_updater.py +0 -0
  43. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/__init__.py +0 -0
  44. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/artefact_load.py +0 -0
  45. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/artefact_mapping.py +0 -0
  46. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/artefact_model.py +0 -0
  47. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/artefact_templates.py +0 -0
  48. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/businessgoal_artefact_model.py +0 -0
  49. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/capability_artefact_model.py +0 -0
  50. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/epic_artefact_model.py +0 -0
  51. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/example_artefact_model.py +0 -0
  52. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/feature_artefact_model.py +0 -0
  53. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/issue_artefact_model.py +0 -0
  54. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/keyfeature_artefact_model.py +0 -0
  55. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/serialize_helper.py +0 -0
  56. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/task_artefact_model.py +0 -0
  57. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/userstory_artefact_model.py +0 -0
  58. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_models/vision_artefact_model.py +0 -0
  59. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_reader.py +0 -0
  60. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/artefact_scan.py +0 -0
  61. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/classifier.py +0 -0
  62. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/codefusionretriever.py +0 -0
  63. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/codehierachieretriever.py +0 -0
  64. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/commandline_completer.py +0 -0
  65. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/commands/__init__.py +0 -0
  66. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/commands/command.py +0 -0
  67. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/commands/load_command.py +0 -0
  68. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/commands/load_image_command.py +0 -0
  69. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/directory_navigator.py +0 -0
  70. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/file_classifier.py +0 -0
  71. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/file_lister.py +0 -0
  72. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/file_loaders/__init__.py +0 -0
  73. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/file_loaders/binary_file_loader.py +0 -0
  74. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/file_loaders/document_file_loader.py +0 -0
  75. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/file_loaders/document_reader.py +0 -0
  76. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/file_loaders/file_loader.py +0 -0
  77. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/filename_validator.py +0 -0
  78. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/list_filter.py +0 -0
  79. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/output_suppressor.py +0 -0
  80. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/prompt_chat.py +0 -0
  81. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/prompt_rag.py +0 -0
  82. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/run_file_lister.py +0 -0
  83. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/agile.artefacts +0 -0
  84. {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
  85. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/blueprints/empty.blueprint.md +0 -0
  86. {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
  87. {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
  88. {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
  89. {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
  90. {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
  91. {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
  92. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/artefact_classification.commands.md +0 -0
  93. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/artefact_extension.commands.md +0 -0
  94. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/artefact_formulation.commands.md +0 -0
  95. {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
  96. {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
  97. {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
  98. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/empty.commands.md +0 -0
  99. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/error_fixing.commands.md +0 -0
  100. {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
  101. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/feature_formulation.commands.md +0 -0
  102. {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
  103. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/refactoring.commands.md +0 -0
  104. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/commands/refactoring_analysis.commands.md +0 -0
  105. {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
  106. {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
  107. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/classify_task.intention.md +0 -0
  108. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/empty.intention.md +0 -0
  109. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/error_fixing.intention.md +0 -0
  110. {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
  111. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/feature_formulation.intention.md +0 -0
  112. {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
  113. {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
  114. {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
  115. {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
  116. {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
  117. {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
  118. {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
  119. {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
  120. {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
  121. {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
  122. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/intentions/task_implementation.intention.md +0 -0
  123. {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
  124. {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
  125. {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
  126. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/rules/architecture_analyst.rules.md +0 -0
  127. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/rules/code_analyst.rules.md +0 -0
  128. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/rules/empty.rules.md +0 -0
  129. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/rules/error_analyst.rules.md +0 -0
  130. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/rules/gherkin_expert.rules.md +0 -0
  131. {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
  132. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/rules/product_owner.rules.md +0 -0
  133. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/rules/python_behave.rules.md +0 -0
  134. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/prompt-modules/rules/python_developer.rules.md +0 -0
  135. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/specification_breakdown_files/template.concept.exploration.md +0 -0
  136. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/specification_breakdown_files/template.concept.md +0 -0
  137. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/specification_breakdown_files/template.customer.exploration.md +0 -0
  138. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/specification_breakdown_files/template.customer.md +0 -0
  139. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/specification_breakdown_files/template.persona.exploration.md +0 -0
  140. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/specification_breakdown_files/template.persona.md +0 -0
  141. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/specification_breakdown_files/template.step.exploration.md +0 -0
  142. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/specification_breakdown_files/template.step.md +0 -0
  143. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/specification_breakdown_files/template.technology.exploration.md +0 -0
  144. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/specification_breakdown_files/template.technology.md +0 -0
  145. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.businessgoal.prompt_log.md +0 -0
  146. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.capability.prompt_log.md +0 -0
  147. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.epic.prompt_log.md +0 -0
  148. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.example.prompt_log.md +0 -0
  149. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.feature.prompt_log.md +0 -0
  150. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.issue.prompt_log.md +0 -0
  151. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.keyfeature.prompt_log.md +0 -0
  152. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.steps.prompt_log.md +0 -0
  153. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.task.prompt_log.md +0 -0
  154. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.userstory.prompt_log.md +0 -0
  155. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli/templates/template.vision.prompt_log.md +0 -0
  156. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli.egg-info/dependency_links.txt +0 -0
  157. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli.egg-info/entry_points.txt +0 -0
  158. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/ara_cli.egg-info/top_level.txt +0 -0
  159. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/setup.cfg +0 -0
  160. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/setup.py +0 -0
  161. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/__init__.py +0 -0
  162. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_ara_command_action.py +0 -0
  163. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_artefact_autofix.py +0 -0
  164. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_artefact_fuzzy_search.py +0 -0
  165. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_artefact_link_updater.py +0 -0
  166. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_artefact_reader.py +0 -0
  167. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_artefact_renamer.py +0 -0
  168. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_artefact_scan.py +0 -0
  169. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_classifier.py +0 -0
  170. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_directory_navigator.py +0 -0
  171. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_file_classifier.py +0 -0
  172. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_file_creator.py +0 -0
  173. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_file_lister.py +0 -0
  174. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_list_filter.py +0 -0
  175. {ara_cli-0.1.9.93 → ara_cli-0.1.9.95}/tests/test_tag_extractor.py +0 -0
  176. {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.93
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 | Description |
112
- |--------------------|-----------------------------------------------------------------------------|
113
- | create | Create a classified artefact with data directory |
114
- | delete | Delete an artefact and its data directory |
115
- | rename | Rename an artefact and its data directory |
116
- | list, list-tags | List artefacts, show tags, filter by content, extension, hierarchy etc. |
117
- | prompt, chat | Use AI-powered chat and prompt templates for artefact management |
118
- | template | Print artefact templates in the terminal |
119
- | fetch-templates | Download and manage reusable prompt templates |
120
- | read | Output artefact contents and their full contribution chain |
121
- | reconnect | Connect artefacts to parent artefacts |
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 | Scan the ARA tree for incompatible or inconsistent artefacts |
126
- | autofix | Automatically correct artefact issues with LLM assistance |
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 | 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 |
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.artefact_reader import ArtefactReader
298
- from ara_cli.file_classifier import FileClassifier
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
- file_classifier = FileClassifier(os)
305
- classified_artefacts = ArtefactReader.read_artefacts()
306
- artefacts = classified_artefacts.get(classifier, [])
307
- all_artefact_names = [a.title for a in artefacts]
308
-
309
- if artefact_name not in all_artefact_names:
310
- suggest_close_name_matches(
311
- artefact_name,
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
- artefacts_by_classifier = {classifier: []}
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
- match read_mode:
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
- skip_queries = args.skip_queries
596
+ force = args.force
597
+ write = getattr(args, 'write', False)
619
598
  print(filename)
620
599
  command = ExtractCommand(
621
600
  file_name=filename,
622
- skip_queries=skip_queries,
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
- "--skip-queries", "-s",
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
- data = json.load(file)
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
- corrected_data[field_name] = defaults.get(field_name)
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
- result_type=artefact_class,
147
+ output_type=artefact_class,
148
148
  instrument=True,
149
149
  )
150
150
  result = agent.run_sync(prompt)
151
- return result.data
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
- choices, artefact_info: Optional[tuple[str, str]] = None
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
- print(f"{message}.")
209
- for i, contribution in enumerate(choices):
210
- print(f"{i + 1}: {contribution}")
211
- choice_number = input(
212
- "Please choose the artefact to use for contribution (enter number): "
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 contribution choice.")
233
+ print("Invalid choice. Aborting operation.")
218
234
  return None
219
- choice = choices[choice_index]
235
+ return choices[choice_index]
220
236
  except ValueError:
221
- print("Invalid input. Aborting contribution choice.")
237
+ print("Invalid input. Aborting operation.")
222
238
  return None
223
- return choice
224
239
 
225
240
 
226
- def _has_valid_contribution(artefact: Artefact) -> bool:
227
- contribution = artefact.contribution
228
- return contribution and contribution.artefact_name and contribution.classifier
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, False)
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=ArtefactLister.artefact_content_retrieval,
41
- file_path_retrieval=ArtefactLister.artefact_path_retrieval,
42
- tag_retrieval=ArtefactLister.artefact_tags_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 = [p for p in artefact_info if p["title"] == artefact_name]
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(artefacts_by_classifier, list_filter)
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 = [p for p in artefact_info if p["title"] == artefact_name]
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 = [info for info in artefact_info_dict if info["title"] == artefact_name]
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] + '.data'
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
- raise FileExistsError(f"The new directory name {new_dir_path} already exists.")
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)