Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changelog/5054.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
changes:
- description: Updated the schema for Agentix agents.
type: internal
pr_number: 5054
15 changes: 15 additions & 0 deletions demisto_sdk/commands/common/schemas/agentixagent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ mapping:
color:
type: str
required: true
actionids:
type: seq
sequence:
- type: str
required: true
tags:
type: seq
sequence:
Expand All @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions demisto_sdk/commands/content_graph/objects/agentix_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

class AgentixAgent(AgentixBase, content_type=ContentType.AGENTIX_AGENT):
color: str
actionids: list[str]
systeminstructions: str = ""
conversationstarters: list[str] = []
autoenablenewactions: bool = False

@staticmethod
def match(_dict: dict, path: Path) -> bool:
Expand Down
15 changes: 15 additions & 0 deletions demisto_sdk/commands/content_graph/parsers/agentix_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@ 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
)
self.connect_to_dependencies()

def connect_to_dependencies(self) -> None:
"""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)

@cached_property
def field_mapping(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@

class AgentixAgent(AgentixBase):
color: str
actionids: list[str]
systeminstructions: str = ""
conversationstarters: list[str] = []
autoenablenewactions: bool = False
20 changes: 20 additions & 0 deletions demisto_sdk/commands/validate/tests/AG_validators_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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"),
Expand All @@ -81,6 +89,10 @@ def test_is_correct_marketplace():
),
AgentixAgent(
color="red",
actionids=[""],
systeminstructions="",
conversationstarters=[""],
autoenablenewactions=False,
description="",
display="",
path=Path("test.yml"),
Expand Down Expand Up @@ -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"),
Expand All @@ -251,6 +267,10 @@ def test_is_correct_supportedModules():
),
AgentixAgent(
color="red",
actionids=[""],
systeminstructions="",
conversationstarters=[""],
autoenablenewactions=False,
description="",
display="",
path=Path("test.yml"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
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
Expand Down Expand Up @@ -43,6 +44,7 @@
)

ContentTypes = Union[
AgentixAgent,
Integration,
Script,
Playbook,
Expand Down