ara-cli 0.1.10.0__py3-none-any.whl → 0.1.13.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ara_cli/__init__.py +51 -6
- ara_cli/__main__.py +270 -103
- ara_cli/ara_command_action.py +106 -63
- ara_cli/ara_config.py +187 -128
- ara_cli/ara_subcommands/__init__.py +0 -0
- ara_cli/ara_subcommands/autofix.py +26 -0
- ara_cli/ara_subcommands/chat.py +27 -0
- ara_cli/ara_subcommands/classifier_directory.py +16 -0
- ara_cli/ara_subcommands/common.py +100 -0
- ara_cli/ara_subcommands/config.py +221 -0
- ara_cli/ara_subcommands/convert.py +43 -0
- ara_cli/ara_subcommands/create.py +75 -0
- ara_cli/ara_subcommands/delete.py +22 -0
- ara_cli/ara_subcommands/extract.py +22 -0
- ara_cli/ara_subcommands/fetch.py +41 -0
- ara_cli/ara_subcommands/fetch_agents.py +22 -0
- ara_cli/ara_subcommands/fetch_scripts.py +19 -0
- ara_cli/ara_subcommands/fetch_templates.py +19 -0
- ara_cli/ara_subcommands/list.py +139 -0
- ara_cli/ara_subcommands/list_tags.py +25 -0
- ara_cli/ara_subcommands/load.py +48 -0
- ara_cli/ara_subcommands/prompt.py +136 -0
- ara_cli/ara_subcommands/read.py +47 -0
- ara_cli/ara_subcommands/read_status.py +20 -0
- ara_cli/ara_subcommands/read_user.py +20 -0
- ara_cli/ara_subcommands/reconnect.py +27 -0
- ara_cli/ara_subcommands/rename.py +22 -0
- ara_cli/ara_subcommands/scan.py +14 -0
- ara_cli/ara_subcommands/set_status.py +22 -0
- ara_cli/ara_subcommands/set_user.py +22 -0
- ara_cli/ara_subcommands/template.py +16 -0
- ara_cli/artefact_autofix.py +154 -63
- ara_cli/artefact_converter.py +256 -0
- ara_cli/artefact_models/artefact_model.py +106 -25
- ara_cli/artefact_models/artefact_templates.py +20 -10
- ara_cli/artefact_models/epic_artefact_model.py +11 -2
- ara_cli/artefact_models/feature_artefact_model.py +31 -1
- ara_cli/artefact_models/userstory_artefact_model.py +15 -3
- ara_cli/artefact_scan.py +2 -2
- ara_cli/chat.py +283 -80
- ara_cli/chat_agent/__init__.py +0 -0
- ara_cli/chat_agent/agent_process_manager.py +155 -0
- ara_cli/chat_script_runner/__init__.py +0 -0
- ara_cli/chat_script_runner/script_completer.py +23 -0
- ara_cli/chat_script_runner/script_finder.py +41 -0
- ara_cli/chat_script_runner/script_lister.py +36 -0
- ara_cli/chat_script_runner/script_runner.py +36 -0
- ara_cli/chat_web_search/__init__.py +0 -0
- ara_cli/chat_web_search/web_search.py +263 -0
- ara_cli/commands/agent_run_command.py +98 -0
- ara_cli/commands/fetch_agents_command.py +106 -0
- ara_cli/commands/fetch_scripts_command.py +43 -0
- ara_cli/commands/fetch_templates_command.py +39 -0
- ara_cli/commands/fetch_templates_commands.py +39 -0
- ara_cli/commands/list_agents_command.py +39 -0
- ara_cli/commands/read_command.py +17 -4
- ara_cli/completers.py +180 -0
- ara_cli/constants.py +2 -0
- ara_cli/directory_navigator.py +37 -4
- ara_cli/file_loaders/text_file_loader.py +2 -2
- ara_cli/global_file_lister.py +5 -15
- ara_cli/llm_utils.py +58 -0
- ara_cli/prompt_chat.py +20 -4
- ara_cli/prompt_extractor.py +199 -76
- ara_cli/prompt_handler.py +160 -59
- ara_cli/tag_extractor.py +38 -18
- ara_cli/template_loader.py +3 -2
- ara_cli/template_manager.py +52 -21
- ara_cli/templates/global-scripts/hello_global.py +1 -0
- ara_cli/templates/prompt-modules/commands/add_scenarios_for_new_behaviour.feature_creation_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/align_feature_with_implementation_changes.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/analyze_codebase_and_plan_tasks.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/choose_best_parent_artefact.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/create_tasks_from_artefact_content.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/create_tests_for_uncovered_modules.test_generation_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/derive_features_from_video_description.feature_creation_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/describe_agent_capabilities.agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/empty.commands.md +2 -12
- ara_cli/templates/prompt-modules/commands/execute_scoped_todos_in_task.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/explain_single_file_purpose.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/extract_file_information_bullets.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/extract_general.commands.md +12 -0
- ara_cli/templates/prompt-modules/commands/extract_markdown.commands.md +11 -0
- ara_cli/templates/prompt-modules/commands/extract_python.commands.md +13 -0
- ara_cli/templates/prompt-modules/commands/feature_add_or_modifiy_specified_behavior.commands.md +36 -0
- ara_cli/templates/prompt-modules/commands/feature_generate_initial_specified_bevahior.commands.md +53 -0
- ara_cli/templates/prompt-modules/commands/fix_failing_behave_step_definitions.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/fix_failing_pytest_tests.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/general_instruction_policy.commands.md +47 -0
- ara_cli/templates/prompt-modules/commands/generate_and_fix_pytest_tests.test_generation_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/prompt_template_tech_stack_transformer.commands.md +95 -0
- ara_cli/templates/prompt-modules/commands/python_bug_fixing_code.commands.md +34 -0
- ara_cli/templates/prompt-modules/commands/python_generate_code.commands.md +27 -0
- ara_cli/templates/prompt-modules/commands/python_refactoring_code.commands.md +39 -0
- ara_cli/templates/prompt-modules/commands/python_step_definitions_generation_and_fixing.commands.md +40 -0
- ara_cli/templates/prompt-modules/commands/python_unittest_generation_and_fixing.commands.md +48 -0
- ara_cli/templates/prompt-modules/commands/suggest_next_story_child_tasks.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/summarize_or_transcribe_media.interview_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/update_feature_to_match_implementation.feature_creation_agent.commands.md +1 -0
- ara_cli/templates/prompt-modules/commands/update_user_story_with_requirements.interview_agent.commands.md +1 -0
- ara_cli/version.py +1 -1
- {ara_cli-0.1.10.0.dist-info → ara_cli-0.1.13.3.dist-info}/METADATA +34 -1
- {ara_cli-0.1.10.0.dist-info → ara_cli-0.1.13.3.dist-info}/RECORD +123 -54
- tests/test_ara_command_action.py +31 -19
- tests/test_ara_config.py +177 -90
- tests/test_artefact_autofix.py +170 -97
- tests/test_artefact_autofix_integration.py +495 -0
- tests/test_artefact_converter.py +357 -0
- tests/test_artefact_extraction.py +564 -0
- tests/test_artefact_scan.py +1 -1
- tests/test_chat.py +162 -126
- tests/test_chat_givens_images.py +603 -0
- tests/test_chat_script_runner.py +454 -0
- tests/test_global_file_lister.py +1 -1
- tests/test_llm_utils.py +164 -0
- tests/test_prompt_chat.py +343 -0
- tests/test_prompt_extractor.py +683 -0
- tests/test_prompt_handler.py +12 -4
- tests/test_tag_extractor.py +19 -13
- tests/test_web_search.py +467 -0
- ara_cli/ara_command_parser.py +0 -605
- ara_cli/templates/prompt-modules/blueprints/complete_pytest_unittest.blueprint.md +0 -27
- ara_cli/templates/prompt-modules/blueprints/task_todo_list_implement_feature_BDD_way.blueprint.md +0 -30
- ara_cli/templates/prompt-modules/commands/artefact_classification.commands.md +0 -9
- ara_cli/templates/prompt-modules/commands/artefact_extension.commands.md +0 -17
- ara_cli/templates/prompt-modules/commands/artefact_formulation.commands.md +0 -14
- ara_cli/templates/prompt-modules/commands/behave_step_generation.commands.md +0 -102
- ara_cli/templates/prompt-modules/commands/code_generation_complex.commands.md +0 -20
- ara_cli/templates/prompt-modules/commands/code_generation_simple.commands.md +0 -13
- ara_cli/templates/prompt-modules/commands/error_fixing.commands.md +0 -20
- ara_cli/templates/prompt-modules/commands/feature_file_update.commands.md +0 -18
- ara_cli/templates/prompt-modules/commands/feature_formulation.commands.md +0 -43
- ara_cli/templates/prompt-modules/commands/js_code_generation_simple.commands.md +0 -13
- ara_cli/templates/prompt-modules/commands/refactoring.commands.md +0 -15
- ara_cli/templates/prompt-modules/commands/refactoring_analysis.commands.md +0 -9
- ara_cli/templates/prompt-modules/commands/reverse_engineer_feature_file.commands.md +0 -15
- ara_cli/templates/prompt-modules/commands/reverse_engineer_program_flow.commands.md +0 -19
- {ara_cli-0.1.10.0.dist-info → ara_cli-0.1.13.3.dist-info}/WHEEL +0 -0
- {ara_cli-0.1.10.0.dist-info → ara_cli-0.1.13.3.dist-info}/entry_points.txt +0 -0
- {ara_cli-0.1.10.0.dist-info → ara_cli-0.1.13.3.dist-info}/top_level.txt +0 -0
ara_cli/ara_command_action.py
CHANGED
|
@@ -23,24 +23,33 @@ def create_action(args):
|
|
|
23
23
|
from ara_cli.artefact_reader import ArtefactReader
|
|
24
24
|
from ara_cli.artefact_fuzzy_search import find_closest_rule
|
|
25
25
|
|
|
26
|
-
check_validity(Classifier.is_valid_classifier(args.classifier),
|
|
27
|
-
|
|
26
|
+
check_validity(Classifier.is_valid_classifier(args.classifier),
|
|
27
|
+
"Invalid classifier provided. Please provide a valid classifier.")
|
|
28
|
+
check_validity(is_valid_filename(args.parameter),
|
|
29
|
+
"Invalid filename provided. Please provide a valid filename.")
|
|
28
30
|
|
|
29
31
|
def handle_parent_arguments(args):
|
|
30
|
-
parent_classifier = args.parent_classifier if hasattr(
|
|
31
|
-
|
|
32
|
+
parent_classifier = args.parent_classifier if hasattr(
|
|
33
|
+
args, "parent_classifier") else None
|
|
34
|
+
parent_name = args.parent_name if hasattr(
|
|
35
|
+
args, "parent_name") else None
|
|
32
36
|
rule = args.rule if hasattr(args, 'rule') else None
|
|
33
37
|
invalid_classifier_message = "Invalid parent classifier provided. Please provide a valid classifier"
|
|
34
38
|
invalid_name_message = "Invalid filename provided for parent. Please provide a valid filename."
|
|
35
39
|
if parent_classifier and parent_name and rule:
|
|
36
|
-
check_validity(Classifier.is_valid_classifier(
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
check_validity(Classifier.is_valid_classifier(
|
|
41
|
+
parent_classifier), invalid_classifier_message)
|
|
42
|
+
check_validity(is_valid_filename(
|
|
43
|
+
parent_name), invalid_name_message)
|
|
44
|
+
parent_artefact = ArtefactReader.read_artefact(
|
|
45
|
+
artefact_name=parent_name, classifier=parent_classifier)
|
|
39
46
|
rule = find_closest_rule(parent_artefact, rule)
|
|
40
47
|
return parent_classifier, parent_name, rule
|
|
41
48
|
if parent_classifier and parent_name:
|
|
42
|
-
check_validity(Classifier.is_valid_classifier(
|
|
43
|
-
|
|
49
|
+
check_validity(Classifier.is_valid_classifier(
|
|
50
|
+
parent_classifier), invalid_classifier_message)
|
|
51
|
+
check_validity(is_valid_filename(
|
|
52
|
+
parent_name), invalid_name_message)
|
|
44
53
|
return parent_classifier, parent_name, rule
|
|
45
54
|
return None, None, None
|
|
46
55
|
|
|
@@ -61,7 +70,8 @@ def create_action(args):
|
|
|
61
70
|
return
|
|
62
71
|
|
|
63
72
|
artefact_creator = ArtefactCreator()
|
|
64
|
-
artefact_creator.run(args.parameter, args.classifier,
|
|
73
|
+
artefact_creator.run(args.parameter, args.classifier,
|
|
74
|
+
parent_classifier, parent_name, rule)
|
|
65
75
|
|
|
66
76
|
|
|
67
77
|
@handle_errors(context="delete action", error_handler=error_handler)
|
|
@@ -78,22 +88,33 @@ def rename_action(args):
|
|
|
78
88
|
from ara_cli.classifier import Classifier
|
|
79
89
|
from ara_cli.filename_validator import is_valid_filename
|
|
80
90
|
|
|
81
|
-
check_validity(is_valid_filename(args.parameter),
|
|
82
|
-
|
|
83
|
-
check_validity(
|
|
91
|
+
check_validity(is_valid_filename(args.parameter),
|
|
92
|
+
"Invalid filename provided. Please provide a valid filename.")
|
|
93
|
+
check_validity(Classifier.is_valid_classifier(args.classifier),
|
|
94
|
+
"Invalid classifier provided. Please provide a valid classifier.")
|
|
95
|
+
check_validity(is_valid_filename(
|
|
96
|
+
args.aspect), "Invalid new filename provided. Please provide a valid filename.")
|
|
84
97
|
|
|
85
98
|
artefact_renamer = ArtefactRenamer()
|
|
86
99
|
artefact_renamer.rename(args.parameter, args.aspect, args.classifier)
|
|
87
100
|
|
|
88
101
|
|
|
102
|
+
def _execute_list_method(method, classifier, artefact_name, list_filter, flag_name):
|
|
103
|
+
"""Helper function to validate and execute list methods."""
|
|
104
|
+
if not classifier or not artefact_name:
|
|
105
|
+
raise AraError(
|
|
106
|
+
f"Both classifier and artefact_name are required for --{flag_name}"
|
|
107
|
+
)
|
|
108
|
+
method(classifier=classifier, artefact_name=artefact_name, list_filter=list_filter)
|
|
109
|
+
|
|
110
|
+
|
|
89
111
|
@handle_errors(context="rename action", error_handler=error_handler)
|
|
90
112
|
def list_action(args):
|
|
91
113
|
from ara_cli.artefact_lister import ArtefactLister
|
|
92
114
|
from ara_cli.list_filter import ListFilter
|
|
93
115
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
data_classifier, data_artefact_name = args.data_args
|
|
116
|
+
classifier = args.classifier
|
|
117
|
+
artefact_name = args.artefact_name
|
|
97
118
|
|
|
98
119
|
artefact_lister = ArtefactLister()
|
|
99
120
|
|
|
@@ -106,33 +127,28 @@ def list_action(args):
|
|
|
106
127
|
exclude_tags=args.exclude_tags
|
|
107
128
|
)
|
|
108
129
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return
|
|
116
|
-
|
|
117
|
-
if children_classifier and children_artefact_name:
|
|
118
|
-
artefact_lister.list_children(
|
|
119
|
-
classifier=children_classifier,
|
|
120
|
-
artefact_name=children_artefact_name,
|
|
121
|
-
list_filter=list_filter
|
|
122
|
-
)
|
|
123
|
-
return
|
|
130
|
+
# Map flags to their corresponding methods
|
|
131
|
+
flag_method_map = {
|
|
132
|
+
"branch": (args.branch, artefact_lister.list_branch),
|
|
133
|
+
"children": (args.children, artefact_lister.list_children),
|
|
134
|
+
"data": (args.data, artefact_lister.list_data),
|
|
135
|
+
}
|
|
124
136
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
137
|
+
for flag_name, (flag_value, method) in flag_method_map.items():
|
|
138
|
+
if flag_value:
|
|
139
|
+
_execute_list_method(
|
|
140
|
+
method, classifier, artefact_name, list_filter, flag_name
|
|
141
|
+
)
|
|
142
|
+
return
|
|
143
|
+
|
|
144
|
+
# If both classifier and artefact_name are present, but no specific action flag (branch, children, data)
|
|
145
|
+
# was provided, raise an error as per requirements.
|
|
146
|
+
if classifier and artefact_name:
|
|
147
|
+
raise AraError(
|
|
148
|
+
f"To list specific info for '{classifier} {artefact_name}', "
|
|
149
|
+
"you must provide one of: --children, --branch, or --data."
|
|
130
150
|
)
|
|
131
|
-
return
|
|
132
151
|
|
|
133
|
-
if (args.tags):
|
|
134
|
-
artefact_lister.list_files(tags=args.tags, list_filter=list_filter)
|
|
135
|
-
return
|
|
136
152
|
artefact_lister.list_files(list_filter=list_filter)
|
|
137
153
|
|
|
138
154
|
|
|
@@ -147,17 +163,25 @@ def list_tags_action(args):
|
|
|
147
163
|
)
|
|
148
164
|
|
|
149
165
|
tag_extractor = TagExtractor()
|
|
150
|
-
|
|
166
|
+
tag_groups = tag_extractor.extract_tags(
|
|
151
167
|
filtered_extra_column=getattr(args, "filtered_extra_column", False),
|
|
152
168
|
list_filter=list_filter
|
|
153
169
|
)
|
|
154
170
|
|
|
155
171
|
if args.json:
|
|
156
|
-
|
|
172
|
+
all_tags = []
|
|
173
|
+
for group in tag_groups.values():
|
|
174
|
+
all_tags.extend(group)
|
|
175
|
+
output = json.dumps({"tags": sorted(all_tags)})
|
|
157
176
|
print(output)
|
|
158
177
|
return
|
|
159
178
|
|
|
160
|
-
|
|
179
|
+
output_lines = []
|
|
180
|
+
for key in sorted(tag_groups.keys()):
|
|
181
|
+
line = " ".join(sorted(list(tag_groups[key])))
|
|
182
|
+
output_lines.append(line)
|
|
183
|
+
|
|
184
|
+
output = "\n".join(f"- {tag}" for tag in output_lines)
|
|
161
185
|
print(output)
|
|
162
186
|
|
|
163
187
|
|
|
@@ -166,8 +190,10 @@ def prompt_action(args):
|
|
|
166
190
|
from ara_cli.classifier import Classifier
|
|
167
191
|
from ara_cli.filename_validator import is_valid_filename
|
|
168
192
|
|
|
169
|
-
check_validity(Classifier.is_valid_classifier(args.classifier),
|
|
170
|
-
|
|
193
|
+
check_validity(Classifier.is_valid_classifier(args.classifier),
|
|
194
|
+
"Invalid classifier provided. Please provide a valid classifier.")
|
|
195
|
+
check_validity(is_valid_filename(args.parameter),
|
|
196
|
+
"Invalid filename provided. Please provide a valid filename.")
|
|
171
197
|
|
|
172
198
|
classifier = args.classifier
|
|
173
199
|
param = args.parameter
|
|
@@ -202,7 +228,8 @@ def prompt_action(args):
|
|
|
202
228
|
from ara_cli.update_config_prompt import update_artefact_config_prompt_files
|
|
203
229
|
extract_and_save_prompt_results(classifier, param, write=write)
|
|
204
230
|
print(f"automatic update after extract")
|
|
205
|
-
update_artefact_config_prompt_files(
|
|
231
|
+
update_artefact_config_prompt_files(
|
|
232
|
+
classifier, param, automatic_update=True)
|
|
206
233
|
|
|
207
234
|
def handle_chat():
|
|
208
235
|
from ara_cli.prompt_chat import initialize_prompt_chat_mode
|
|
@@ -211,11 +238,13 @@ def prompt_action(args):
|
|
|
211
238
|
output_mode = args.output_mode
|
|
212
239
|
append_strings = args.append
|
|
213
240
|
restricted = args.restricted
|
|
214
|
-
initialize_prompt_chat_mode(classifier, param, chat_name, reset=reset,
|
|
241
|
+
initialize_prompt_chat_mode(classifier, param, chat_name, reset=reset,
|
|
242
|
+
output_mode=output_mode, append_strings=append_strings, restricted=restricted)
|
|
215
243
|
|
|
216
244
|
def handle_update():
|
|
217
245
|
from ara_cli.update_config_prompt import update_artefact_config_prompt_files
|
|
218
|
-
update_artefact_config_prompt_files(
|
|
246
|
+
update_artefact_config_prompt_files(
|
|
247
|
+
classifier, param, automatic_update=True)
|
|
219
248
|
|
|
220
249
|
command_dispatcher = {
|
|
221
250
|
'init': handle_init,
|
|
@@ -250,7 +279,8 @@ def chat_action(args):
|
|
|
250
279
|
chat_file_path = join(cwd, chat_name)
|
|
251
280
|
|
|
252
281
|
with suppress_stdout(output_mode):
|
|
253
|
-
chat = Chat(chat_file_path, reset=reset) if not restricted else Chat(
|
|
282
|
+
chat = Chat(chat_file_path, reset=reset) if not restricted else Chat(
|
|
283
|
+
chat_file_path, reset=reset, enable_commands=whitelisted_commands)
|
|
254
284
|
|
|
255
285
|
if append_strings:
|
|
256
286
|
chat.append_strings(append_strings)
|
|
@@ -300,7 +330,8 @@ def load_action(args):
|
|
|
300
330
|
default_pattern = default_patterns.get(template_type)
|
|
301
331
|
|
|
302
332
|
if not template_name and not default_pattern:
|
|
303
|
-
raise AraError(
|
|
333
|
+
raise AraError(
|
|
334
|
+
f"A template name is required for template type '{template_type}'.")
|
|
304
335
|
|
|
305
336
|
loader = TemplateLoader() # No chat instance for CLI context
|
|
306
337
|
success = loader.load_template(
|
|
@@ -319,7 +350,8 @@ def template_action(args):
|
|
|
319
350
|
from ara_cli.classifier import Classifier
|
|
320
351
|
from ara_cli.template_manager import TemplatePathManager
|
|
321
352
|
|
|
322
|
-
check_validity(Classifier.is_valid_classifier(args.classifier),
|
|
353
|
+
check_validity(Classifier.is_valid_classifier(args.classifier),
|
|
354
|
+
"Invalid classifier provided. Please provide a valid classifier.")
|
|
323
355
|
|
|
324
356
|
template_manager = TemplatePathManager()
|
|
325
357
|
content = template_manager.get_template_content(args.classifier)
|
|
@@ -340,9 +372,11 @@ def fetch_templates_action(args):
|
|
|
340
372
|
|
|
341
373
|
subdirs = ["commands", "rules", "intentions", "blueprints"]
|
|
342
374
|
|
|
343
|
-
os.makedirs(join(prompt_templates_dir,
|
|
375
|
+
os.makedirs(join(prompt_templates_dir,
|
|
376
|
+
"global-prompt-modules"), exist_ok=True)
|
|
344
377
|
for subdir in subdirs:
|
|
345
|
-
target_dir = join(prompt_templates_dir,
|
|
378
|
+
target_dir = join(prompt_templates_dir,
|
|
379
|
+
"global-prompt-modules", subdir)
|
|
346
380
|
source_dir = join(global_prompt_templates_path, subdir)
|
|
347
381
|
os.makedirs(target_dir, exist_ok=True)
|
|
348
382
|
for item in os.listdir(source_dir):
|
|
@@ -351,7 +385,8 @@ def fetch_templates_action(args):
|
|
|
351
385
|
shutil.copy2(source, target)
|
|
352
386
|
|
|
353
387
|
custom_prompt_templates_subdir = config.custom_prompt_templates_subdir
|
|
354
|
-
local_prompt_modules_dir = join(
|
|
388
|
+
local_prompt_modules_dir = join(
|
|
389
|
+
prompt_templates_dir, custom_prompt_templates_subdir)
|
|
355
390
|
os.makedirs(local_prompt_modules_dir, exist_ok=True)
|
|
356
391
|
for subdir in subdirs:
|
|
357
392
|
os.makedirs(join(local_prompt_modules_dir, subdir), exist_ok=True)
|
|
@@ -454,9 +489,11 @@ def read_status_action(args):
|
|
|
454
489
|
artefact_info = file_classifier.classify_files()
|
|
455
490
|
artefact_info_dicts = artefact_info.get(classifier, [])
|
|
456
491
|
|
|
457
|
-
all_artefact_names = [artefact_info["title"]
|
|
492
|
+
all_artefact_names = [artefact_info["title"]
|
|
493
|
+
for artefact_info in artefact_info_dicts]
|
|
458
494
|
if artefact_name not in all_artefact_names:
|
|
459
|
-
suggest_close_name_matches(
|
|
495
|
+
suggest_close_name_matches(
|
|
496
|
+
artefact_name, all_artefact_names, report_as_error=True)
|
|
460
497
|
return
|
|
461
498
|
|
|
462
499
|
artefact_info = next(filter(
|
|
@@ -487,9 +524,11 @@ def read_user_action(args):
|
|
|
487
524
|
artefact_info = file_classifier.classify_files()
|
|
488
525
|
artefact_info_dicts = artefact_info.get(classifier, [])
|
|
489
526
|
|
|
490
|
-
all_artefact_names = [artefact_info["title"]
|
|
527
|
+
all_artefact_names = [artefact_info["title"]
|
|
528
|
+
for artefact_info in artefact_info_dicts]
|
|
491
529
|
if artefact_name not in all_artefact_names:
|
|
492
|
-
suggest_close_name_matches(
|
|
530
|
+
suggest_close_name_matches(
|
|
531
|
+
artefact_name, all_artefact_names, report_as_error=True)
|
|
493
532
|
return
|
|
494
533
|
|
|
495
534
|
artefact_info = next(filter(
|
|
@@ -524,12 +563,14 @@ def set_status_action(args):
|
|
|
524
563
|
if new_status.startswith('@'):
|
|
525
564
|
new_status = new_status.lstrip('@')
|
|
526
565
|
|
|
527
|
-
check_validity(new_status in status_tags,
|
|
566
|
+
check_validity(new_status in status_tags,
|
|
567
|
+
"Invalid status provided. Please provide a valid status.")
|
|
528
568
|
|
|
529
569
|
file_classifier = FileClassifier(os)
|
|
530
570
|
classified_artefacts_info = file_classifier.classify_files()
|
|
531
571
|
classified_artefact_dict = classified_artefacts_info.get(classifier, [])
|
|
532
|
-
all_artefact_names = [artefact_info["title"]
|
|
572
|
+
all_artefact_names = [artefact_info["title"]
|
|
573
|
+
for artefact_info in classified_artefact_dict]
|
|
533
574
|
|
|
534
575
|
if artefact_name not in all_artefact_names:
|
|
535
576
|
suggest_close_name_matches(artefact_name, all_artefact_names)
|
|
@@ -549,7 +590,8 @@ def set_status_action(args):
|
|
|
549
590
|
with open(f"{artefact_info['file_path']}", 'w', encoding='utf-8') as file:
|
|
550
591
|
file.write(serialized_content)
|
|
551
592
|
|
|
552
|
-
print(
|
|
593
|
+
print(
|
|
594
|
+
f"Status of task '{artefact_name}' has been updated to '{new_status}'.")
|
|
553
595
|
|
|
554
596
|
|
|
555
597
|
@handle_errors(context="set-user action", error_handler=error_handler)
|
|
@@ -567,7 +609,8 @@ def set_user_action(args):
|
|
|
567
609
|
file_classifier = FileClassifier(os)
|
|
568
610
|
classified_artefacts_info = file_classifier.classify_files()
|
|
569
611
|
classified_artefact_dict = classified_artefacts_info.get(classifier, [])
|
|
570
|
-
all_artefact_names = [artefact_info["title"]
|
|
612
|
+
all_artefact_names = [artefact_info["title"]
|
|
613
|
+
for artefact_info in classified_artefact_dict]
|
|
571
614
|
|
|
572
615
|
if artefact_name not in all_artefact_names:
|
|
573
616
|
suggest_close_name_matches(artefact_name, all_artefact_names)
|
|
@@ -668,4 +711,4 @@ def extract_action(args):
|
|
|
668
711
|
write=write,
|
|
669
712
|
output=lambda msg: print(msg, file=sys.stdout)
|
|
670
713
|
)
|
|
671
|
-
command.execute()
|
|
714
|
+
command.execute()
|