From 4a260a4ecae6257f088cdaf76466175db8b6d6b1 Mon Sep 17 00:00:00 2001 From: Sapir Malka Date: Sun, 31 Aug 2025 10:14:31 +0300 Subject: [PATCH 1/6] Update content agent schema --- .../commands/common/schemas/agentixagent.yml | 15 +++++++++++++++ .../content_graph/objects/agentix_agent.py | 4 ++++ .../content_graph/parsers/agentix_agent.py | 4 ++++ .../content_graph/strict_objects/agentix_agent.py | 4 ++++ 4 files changed, 27 insertions(+) diff --git a/demisto_sdk/commands/common/schemas/agentixagent.yml b/demisto_sdk/commands/common/schemas/agentixagent.yml index c3e0461a74..b0baa2e02e 100644 --- a/demisto_sdk/commands/common/schemas/agentixagent.yml +++ b/demisto_sdk/commands/common/schemas/agentixagent.yml @@ -13,6 +13,11 @@ mapping: color: type: str required: true + actionids: + type: seq + sequence: + - type: str + required: true tags: type: seq sequence: @@ -21,10 +26,20 @@ mapping: type: str name: type: str + required: true display: type: str description: type: str + required: true + systeminstructions: + type: str + conversationstarters: + type: seq + sequence: + - type: str + autoenablenewactions: + type: bool marketplaces: type: seq sequence: diff --git a/demisto_sdk/commands/content_graph/objects/agentix_agent.py b/demisto_sdk/commands/content_graph/objects/agentix_agent.py index c4fa9fdbdf..7052d7d77d 100644 --- a/demisto_sdk/commands/content_graph/objects/agentix_agent.py +++ b/demisto_sdk/commands/content_graph/objects/agentix_agent.py @@ -6,6 +6,10 @@ class AgentixAgent(AgentixBase, content_type=ContentType.AGENTIX_AGENT): color: str + actionids: list[str] + systeminstructions: str + conversationstarters: list[str] + autoenablenewactions: bool @staticmethod def match(_dict: dict, path: Path) -> bool: diff --git a/demisto_sdk/commands/content_graph/parsers/agentix_agent.py b/demisto_sdk/commands/content_graph/parsers/agentix_agent.py index 5751da40ea..d935ce0794 100644 --- a/demisto_sdk/commands/content_graph/parsers/agentix_agent.py +++ b/demisto_sdk/commands/content_graph/parsers/agentix_agent.py @@ -20,6 +20,10 @@ def __init__( path, pack_marketplaces, pack_supported_modules, git_sha=git_sha ) self.color: str = self.yml_data.get("color") # type: ignore + self.actionids: list[str] = self.yml_data.get("actionids") # type: ignore + self.systeminstructions: str = self.yml_data.get("systeminstructions", "") + self.conversationstarters: list[str] = self.yml_data.get("conversationstarters", []) + self.autoenablenewactions: bool = self.yml_data.get("autoenablenewactions", False) @cached_property def field_mapping(self): diff --git a/demisto_sdk/commands/content_graph/strict_objects/agentix_agent.py b/demisto_sdk/commands/content_graph/strict_objects/agentix_agent.py index fbee6f35ac..f1fb61233b 100644 --- a/demisto_sdk/commands/content_graph/strict_objects/agentix_agent.py +++ b/demisto_sdk/commands/content_graph/strict_objects/agentix_agent.py @@ -5,3 +5,7 @@ class AgentixAgent(AgentixBase): color: str + actionids: list[str] + systeminstructions: str + conversationstarters: list[str] + autoenablenewactions: bool From 859946381f9dc8ce6685e6f06459671672dc62d5 Mon Sep 17 00:00:00 2001 From: Sapir Malka Date: Sun, 31 Aug 2025 10:46:06 +0300 Subject: [PATCH 2/6] fix uts and pre-commit --- .changelog/5054.yml | 4 ++++ .../content_graph/parsers/agentix_agent.py | 8 ++++++-- .../validate/tests/AG_validators_test.py | 20 +++++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 .changelog/5054.yml diff --git a/.changelog/5054.yml b/.changelog/5054.yml new file mode 100644 index 0000000000..5d1719f3f2 --- /dev/null +++ b/.changelog/5054.yml @@ -0,0 +1,4 @@ +changes: +- description: Updated the schema for Agentix agents. + type: internal +pr_number: 5054 diff --git a/demisto_sdk/commands/content_graph/parsers/agentix_agent.py b/demisto_sdk/commands/content_graph/parsers/agentix_agent.py index d935ce0794..b4ad858e17 100644 --- a/demisto_sdk/commands/content_graph/parsers/agentix_agent.py +++ b/demisto_sdk/commands/content_graph/parsers/agentix_agent.py @@ -22,8 +22,12 @@ def __init__( self.color: str = self.yml_data.get("color") # type: ignore self.actionids: list[str] = self.yml_data.get("actionids") # type: ignore self.systeminstructions: str = self.yml_data.get("systeminstructions", "") - self.conversationstarters: list[str] = self.yml_data.get("conversationstarters", []) - self.autoenablenewactions: bool = self.yml_data.get("autoenablenewactions", False) + self.conversationstarters: list[str] = self.yml_data.get( + "conversationstarters", [] + ) + self.autoenablenewactions: bool = self.yml_data.get( + "autoenablenewactions", False + ) @cached_property def field_mapping(self): diff --git a/demisto_sdk/commands/validate/tests/AG_validators_test.py b/demisto_sdk/commands/validate/tests/AG_validators_test.py index 3272373745..c45f4b142d 100644 --- a/demisto_sdk/commands/validate/tests/AG_validators_test.py +++ b/demisto_sdk/commands/validate/tests/AG_validators_test.py @@ -29,6 +29,10 @@ def test_is_forbidden_content_item(): content_items = [ AgentixAgent( color="red", + actionids=["test_action"], + systeminstructions="Test system instructions", + conversationstarters=["Test conversation starter"], + autoenablenewactions=False, description="", display="display Name", path=Path("test.yml"), @@ -67,6 +71,10 @@ def test_is_correct_marketplace(): content_items = [ AgentixAgent( color="red", + actionids=[""], + systeminstructions="", + conversationstarters=[""], + autoenablenewactions=False, description="", display="", path=Path("test.yml"), @@ -81,6 +89,10 @@ def test_is_correct_marketplace(): ), AgentixAgent( color="red", + actionids=[""], + systeminstructions="", + conversationstarters=[""], + autoenablenewactions=False, description="", display="", path=Path("test.yml"), @@ -236,6 +248,10 @@ def test_is_correct_supportedModules(): content_items = [ AgentixAgent( color="red", + actionids=[""], + systeminstructions="", + conversationstarters=[""], + autoenablenewactions=False, description="", display="", path=Path("test.yml"), @@ -251,6 +267,10 @@ def test_is_correct_supportedModules(): ), AgentixAgent( color="red", + actionids=[""], + systeminstructions="", + conversationstarters=[""], + autoenablenewactions=False, description="", display="", path=Path("test.yml"), From f09fc1d8444f4b30f76f9fecd7c54e561d039fe3 Mon Sep 17 00:00:00 2001 From: Sapir Malka Date: Wed, 3 Sep 2025 12:06:06 +0300 Subject: [PATCH 3/6] Add default values --- demisto_sdk/commands/content_graph/objects/agentix_agent.py | 6 +++--- .../commands/content_graph/strict_objects/agentix_agent.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/demisto_sdk/commands/content_graph/objects/agentix_agent.py b/demisto_sdk/commands/content_graph/objects/agentix_agent.py index 7052d7d77d..bae1b46dd4 100644 --- a/demisto_sdk/commands/content_graph/objects/agentix_agent.py +++ b/demisto_sdk/commands/content_graph/objects/agentix_agent.py @@ -7,9 +7,9 @@ class AgentixAgent(AgentixBase, content_type=ContentType.AGENTIX_AGENT): color: str actionids: list[str] - systeminstructions: str - conversationstarters: list[str] - autoenablenewactions: bool + systeminstructions: str = "" + conversationstarters: list[str] = [] + autoenablenewactions: bool = False @staticmethod def match(_dict: dict, path: Path) -> bool: diff --git a/demisto_sdk/commands/content_graph/strict_objects/agentix_agent.py b/demisto_sdk/commands/content_graph/strict_objects/agentix_agent.py index f1fb61233b..9910bcfbfb 100644 --- a/demisto_sdk/commands/content_graph/strict_objects/agentix_agent.py +++ b/demisto_sdk/commands/content_graph/strict_objects/agentix_agent.py @@ -6,6 +6,6 @@ class AgentixAgent(AgentixBase): color: str actionids: list[str] - systeminstructions: str - conversationstarters: list[str] - autoenablenewactions: bool + systeminstructions: str = "" + conversationstarters: list[str] = [] + autoenablenewactions: bool = False From 3265eec476c3aa88a53810ddf58ba8175eaead25 Mon Sep 17 00:00:00 2001 From: hyaffe Date: Wed, 15 Oct 2025 19:53:15 +0300 Subject: [PATCH 4/6] validate action ids --- .../commands/content_graph/parsers/agentix_agent.py | 7 +++++++ .../GR_validators/GR103_is_using_unknown_content.py | 3 +++ 2 files changed, 10 insertions(+) diff --git a/demisto_sdk/commands/content_graph/parsers/agentix_agent.py b/demisto_sdk/commands/content_graph/parsers/agentix_agent.py index 5751da40ea..99538bf5a6 100644 --- a/demisto_sdk/commands/content_graph/parsers/agentix_agent.py +++ b/demisto_sdk/commands/content_graph/parsers/agentix_agent.py @@ -20,6 +20,13 @@ def __init__( path, pack_marketplaces, pack_supported_modules, git_sha=git_sha ) self.color: str = self.yml_data.get("color") # type: ignore + self.connect_to_dependencies() + + def connect_to_dependencies(self) -> None: + """Collects the playbook used in the trigger as a mandatory dependency.""" + if actions_ids := self.yml_data.get("actions"): + for id in actions_ids: + self.add_dependency_by_id(id, ContentType.AGENTIX_ACTION) @cached_property def field_mapping(self): diff --git a/demisto_sdk/commands/validate/validators/GR_validators/GR103_is_using_unknown_content.py b/demisto_sdk/commands/validate/validators/GR_validators/GR103_is_using_unknown_content.py index 98b4d9d2bd..dba24e2ee5 100644 --- a/demisto_sdk/commands/validate/validators/GR_validators/GR103_is_using_unknown_content.py +++ b/demisto_sdk/commands/validate/validators/GR_validators/GR103_is_using_unknown_content.py @@ -13,6 +13,8 @@ from demisto_sdk.commands.content_graph.objects.generic_definition import ( GenericDefinition, ) + +from demisto_sdk.commands.content_graph.objects.agentix_agent import AgentixAgent from demisto_sdk.commands.content_graph.objects.generic_field import GenericField from demisto_sdk.commands.content_graph.objects.generic_module import GenericModule from demisto_sdk.commands.content_graph.objects.generic_type import GenericType @@ -43,6 +45,7 @@ ) ContentTypes = Union[ + AgentixAgent, Integration, Script, Playbook, From c3f9b04a369d24a11a7475c4157ca0479b2275cf Mon Sep 17 00:00:00 2001 From: hyaffe Date: Sun, 19 Oct 2025 19:32:31 +0300 Subject: [PATCH 5/6] add dependencies, actionids to actionIds --- demisto_sdk/commands/content_graph/parsers/agentix_agent.py | 4 ++-- .../GR_validators/GR103_is_using_unknown_content.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/demisto_sdk/commands/content_graph/parsers/agentix_agent.py b/demisto_sdk/commands/content_graph/parsers/agentix_agent.py index d1a96cfda3..2309f15e67 100644 --- a/demisto_sdk/commands/content_graph/parsers/agentix_agent.py +++ b/demisto_sdk/commands/content_graph/parsers/agentix_agent.py @@ -20,7 +20,7 @@ def __init__( path, pack_marketplaces, pack_supported_modules, git_sha=git_sha ) self.color: str = self.yml_data.get("color") # type: ignore - self.actionids: list[str] = self.yml_data.get("actionids") # type: ignore + self.actionids: list[str] = self.yml_data.get("actionIds") # type: ignore self.systeminstructions: str = self.yml_data.get("systeminstructions", "") self.conversationstarters: list[str] = self.yml_data.get( "conversationstarters", [] @@ -32,7 +32,7 @@ def __init__( def connect_to_dependencies(self) -> None: """Collects the playbook used in the trigger as a mandatory dependency.""" - if actions_ids := self.yml_data.get("actionids"): + if actions_ids := self.yml_data.get("actionIds"): for id in actions_ids: self.add_dependency_by_id(id, ContentType.AGENTIX_ACTION) diff --git a/demisto_sdk/commands/validate/validators/GR_validators/GR103_is_using_unknown_content.py b/demisto_sdk/commands/validate/validators/GR_validators/GR103_is_using_unknown_content.py index dba24e2ee5..fc73732c2f 100644 --- a/demisto_sdk/commands/validate/validators/GR_validators/GR103_is_using_unknown_content.py +++ b/demisto_sdk/commands/validate/validators/GR_validators/GR103_is_using_unknown_content.py @@ -13,7 +13,6 @@ from demisto_sdk.commands.content_graph.objects.generic_definition import ( GenericDefinition, ) - from demisto_sdk.commands.content_graph.objects.agentix_agent import AgentixAgent from demisto_sdk.commands.content_graph.objects.generic_field import GenericField from demisto_sdk.commands.content_graph.objects.generic_module import GenericModule From 63222f65dce530acb22b60111661fa4dd8e9bc17 Mon Sep 17 00:00:00 2001 From: hyaffe Date: Sun, 19 Oct 2025 19:36:37 +0300 Subject: [PATCH 6/6] connect_to_dependencies docs --- demisto_sdk/commands/content_graph/parsers/agentix_agent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demisto_sdk/commands/content_graph/parsers/agentix_agent.py b/demisto_sdk/commands/content_graph/parsers/agentix_agent.py index 2309f15e67..12ea88231d 100644 --- a/demisto_sdk/commands/content_graph/parsers/agentix_agent.py +++ b/demisto_sdk/commands/content_graph/parsers/agentix_agent.py @@ -31,7 +31,7 @@ def __init__( self.connect_to_dependencies() def connect_to_dependencies(self) -> None: - """Collects the playbook used in the trigger as a mandatory dependency.""" + """Collects the actions used in the agent as a mandatory dependency.""" if actions_ids := self.yml_data.get("actionIds"): for id in actions_ids: self.add_dependency_by_id(id, ContentType.AGENTIX_ACTION)