From 0d4263e91d1df1de826aea99d86d54182ad49c0e Mon Sep 17 00:00:00 2001 From: Michael Panchenko Date: Thu, 17 Jul 2025 10:59:15 +0200 Subject: [PATCH] Added mode and context templates --- src/serena/config/context_mode.py | 2 +- src/serena/resources/config/contexts/context.template.yml | 4 ++++ src/serena/resources/config/modes/mode.template.yml | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 src/serena/resources/config/contexts/context.template.yml create mode 100644 src/serena/resources/config/modes/mode.template.yml diff --git a/src/serena/config/context_mode.py b/src/serena/config/context_mode.py index fcd5790d..5cd10e43 100644 --- a/src/serena/config/context_mode.py +++ b/src/serena/config/context_mode.py @@ -97,7 +97,7 @@ class SerenaAgentMode(ToolInclusionDefinition, ToStringMixin): @classmethod def list_registered_mode_names(cls, include_user_modes: bool = True) -> list[str]: """Names of all registered modes (from the corresponding YAML files in the serena repo).""" - modes = [f.stem for f in Path(SERENAS_OWN_MODE_YAMLS_DIR).glob("*.yml")] + modes = [f.stem for f in Path(SERENAS_OWN_MODE_YAMLS_DIR).glob("*.yml") if f != "mode.template.yml"] if include_user_modes: modes += [f.stem for f in Path(USER_MODE_YAMLS_DIR).glob("*.yml")] return sorted(set(modes)) diff --git a/src/serena/resources/config/contexts/context.template.yml b/src/serena/resources/config/contexts/context.template.yml new file mode 100644 index 00000000..52e94535 --- /dev/null +++ b/src/serena/resources/config/contexts/context.template.yml @@ -0,0 +1,4 @@ +# See Serena's documentation for more details on concept of contexts. +description: Description of the context, not used in the code. +prompt: Prompt that will form part of the system prompt/initial instructions for agents started in this context. +excluded_tools: [] \ No newline at end of file diff --git a/src/serena/resources/config/modes/mode.template.yml b/src/serena/resources/config/modes/mode.template.yml new file mode 100644 index 00000000..431afdeb --- /dev/null +++ b/src/serena/resources/config/modes/mode.template.yml @@ -0,0 +1,4 @@ +# See Serena's documentation for more details on concept of modes. +description: Description of the mode, not used in the code. +prompt: Prompt that will form part of the message sent to the model when activating this mode. +excluded_tools: []