idun-agent-engine 0.3.8__py3-none-any.whl → 0.4.0__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.
Files changed (39) hide show
  1. idun_agent_engine/_version.py +1 -1
  2. idun_agent_engine/agent/langgraph/langgraph.py +1 -1
  3. idun_agent_engine/core/app_factory.py +1 -1
  4. idun_agent_engine/core/config_builder.py +5 -6
  5. idun_agent_engine/guardrails/guardrails_hub/__init__.py +2 -2
  6. idun_agent_engine/mcp/__init__.py +18 -2
  7. idun_agent_engine/mcp/helpers.py +95 -45
  8. idun_agent_engine/mcp/registry.py +7 -1
  9. idun_agent_engine/server/lifespan.py +22 -0
  10. idun_agent_engine/telemetry/__init__.py +19 -0
  11. idun_agent_engine/telemetry/config.py +29 -0
  12. idun_agent_engine/telemetry/telemetry.py +248 -0
  13. {idun_agent_engine-0.3.8.dist-info → idun_agent_engine-0.4.0.dist-info}/METADATA +12 -8
  14. {idun_agent_engine-0.3.8.dist-info → idun_agent_engine-0.4.0.dist-info}/RECORD +39 -14
  15. idun_platform_cli/groups/init.py +23 -0
  16. idun_platform_cli/main.py +3 -0
  17. idun_platform_cli/tui/__init__.py +0 -0
  18. idun_platform_cli/tui/css/__init__.py +0 -0
  19. idun_platform_cli/tui/css/create_agent.py +789 -0
  20. idun_platform_cli/tui/css/main.py +92 -0
  21. idun_platform_cli/tui/main.py +87 -0
  22. idun_platform_cli/tui/schemas/__init__.py +0 -0
  23. idun_platform_cli/tui/schemas/create_agent.py +60 -0
  24. idun_platform_cli/tui/screens/__init__.py +0 -0
  25. idun_platform_cli/tui/screens/create_agent.py +482 -0
  26. idun_platform_cli/tui/utils/__init__.py +0 -0
  27. idun_platform_cli/tui/utils/config.py +161 -0
  28. idun_platform_cli/tui/validators/__init__.py +0 -0
  29. idun_platform_cli/tui/validators/guardrails.py +76 -0
  30. idun_platform_cli/tui/validators/mcps.py +84 -0
  31. idun_platform_cli/tui/validators/observability.py +65 -0
  32. idun_platform_cli/tui/widgets/__init__.py +15 -0
  33. idun_platform_cli/tui/widgets/guardrails_widget.py +348 -0
  34. idun_platform_cli/tui/widgets/identity_widget.py +234 -0
  35. idun_platform_cli/tui/widgets/mcps_widget.py +230 -0
  36. idun_platform_cli/tui/widgets/observability_widget.py +384 -0
  37. idun_platform_cli/tui/widgets/serve_widget.py +78 -0
  38. {idun_agent_engine-0.3.8.dist-info → idun_agent_engine-0.4.0.dist-info}/WHEEL +0 -0
  39. {idun_agent_engine-0.3.8.dist-info → idun_agent_engine-0.4.0.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,92 @@
1
+ CSS = """
2
+ Screen {
3
+ align: center middle;
4
+ }
5
+
6
+
7
+ Container {
8
+ width: 90%;
9
+ max-width: 80;
10
+ height: 40;
11
+ border: heavy white;
12
+ padding: 2 4;
13
+ }
14
+
15
+ .ascii-logo {
16
+ text-align: center;
17
+ color: yellow;
18
+ }
19
+
20
+ .platform {
21
+ text-align: center;
22
+ text-style: bold;
23
+ color: cyan;
24
+ margin-top: 2;
25
+ }
26
+
27
+ .tagline {
28
+ text-align: center;
29
+ color: white;
30
+ margin-top: 1;
31
+ }
32
+
33
+ .built-by {
34
+ text-align: center;
35
+ color: gray;
36
+ margin-top: 1;
37
+ }
38
+
39
+ .version {
40
+ text-align: center;
41
+ color: gray;
42
+ margin-top: 0;
43
+ }
44
+
45
+ .link-container {
46
+ align: center middle;
47
+ width: 100%;
48
+ height: auto;
49
+ margin-top: 2;
50
+ }
51
+
52
+ .links {
53
+ color: green;
54
+ margin: 0 2;
55
+ }
56
+
57
+ .actions {
58
+ align: center middle;
59
+ width: 100%;
60
+ height: auto;
61
+ padding: 2;
62
+ }
63
+
64
+ .actions Button {
65
+ width: 32;
66
+ margin: 1 0;
67
+ background: transparent;
68
+ border: none;
69
+ color: white;
70
+ }
71
+
72
+ .actions Button:hover {
73
+ background: $boost;
74
+ color: $text;
75
+ }
76
+
77
+ .actions Button:focus {
78
+ background: $surface;
79
+ text-style: bold;
80
+ }
81
+
82
+ .question_prompt {
83
+ width: 100%;
84
+ height: auto;
85
+ text-align: center;
86
+ text-style: bold;
87
+ color: white;
88
+ margin-top: 2;
89
+ }
90
+
91
+
92
+ """
@@ -0,0 +1,87 @@
1
+ from enum import StrEnum
2
+ from typing import Any
3
+
4
+ from textual.app import App, ComposeResult
5
+ from textual.containers import Container, Horizontal, VerticalScroll
6
+ from textual.widget import Widget
7
+ from textual.widgets import Button, Footer, Link, Static
8
+
9
+ from idun_agent_engine._version import __version__
10
+ from idun_platform_cli.tui.css.main import CSS
11
+ from idun_platform_cli.tui.screens.create_agent import CreateAgentScreen
12
+ from idun_platform_cli.tui.utils.config import ConfigManager
13
+
14
+
15
+ class Actions(StrEnum):
16
+ NEW_AGENT = "new_agent"
17
+ UPDATE_AGENT = "update_agent"
18
+ TOUR = "tour"
19
+ EXIT = "exit"
20
+
21
+
22
+ class MainPageActions(Widget):
23
+ CSS_PATH = "selection_list.tcss"
24
+
25
+ def compose(self) -> ComposeResult:
26
+ with VerticalScroll(classes="actions"):
27
+ yield Button("✨ Configure a new Agent", id="new_agent")
28
+ # yield Button("🔨 Modify an existing Agent", id="update_agent")
29
+ # yield Button("🔍 Tour Idun Agent Platform", id="tour")
30
+ yield Button("🚪 Exit", id="exit")
31
+
32
+ def on_mount(self):
33
+ self.query_one("#new_agent", Button).focus()
34
+
35
+
36
+ class IdunApp(App):
37
+ CSS = CSS
38
+ REPO = "https://github.com/idun-group/idun-agent-platform"
39
+ DOCS = "https://idun-group.github.io/idun-agent-platform"
40
+
41
+ BINDINGS = [
42
+ ("up", "focus_previous", "Previous"),
43
+ ("down", "focus_next", "Next"),
44
+ ]
45
+
46
+ config_manager = ConfigManager()
47
+ config: dict[str, Any] = {}
48
+
49
+ def compose(self):
50
+ with Container():
51
+ yield Static(
52
+ """██╗██████╗ ██╗ ██╗███╗ ██╗
53
+ ██║██╔══██╗██║ ██║████╗ ██║
54
+ ██║██║ ██║██║ ██║██╔██╗ ██║
55
+ ██║██║ ██║██║ ██║██║╚██╗██║
56
+ ██║██████╔╝╚██████╔╝██║ ╚████║
57
+ ╚═╝╚═════╝ ╚═════╝ ╚═╝ ╚═══╝""",
58
+ classes="ascii-logo",
59
+ )
60
+
61
+ yield Static("IDUN AGENT PLATFORM", classes="platform")
62
+ yield Static("Deploy, guard and monitor any agent", classes="tagline")
63
+ yield Static("Built with ❤️ by Idun Group", classes="built-by")
64
+ yield Static(f"v{__version__}", classes="version")
65
+ with Horizontal(classes="link-container"):
66
+ yield Link("⭐️ Github", url=self.REPO, classes="links")
67
+ yield Link("📚 Docs", url=self.DOCS, classes="links")
68
+
69
+ yield Static("What do you want to do?", classes="question_prompt")
70
+ yield MainPageActions()
71
+ yield Footer()
72
+
73
+ def on_button_pressed(self, event: Button.Pressed):
74
+ import sys
75
+
76
+ button_id = event.button.id
77
+ match button_id:
78
+ case Actions.EXIT:
79
+ sys.exit(0)
80
+
81
+ case Actions.NEW_AGENT:
82
+ self.push_screen(CreateAgentScreen())
83
+
84
+
85
+ if __name__ == "__main__":
86
+ app = IdunApp()
87
+ app.run()
File without changes
@@ -0,0 +1,60 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import Any
4
+
5
+ from pydantic import BaseModel, field_validator
6
+
7
+ """
8
+ server:
9
+ api:
10
+ port: 8010
11
+
12
+ agent:
13
+ type: "LANGGRAPH"
14
+ config:
15
+ name: "Guardrails"
16
+ graph_definition: "example_agent.py:app"
17
+
18
+ """
19
+
20
+
21
+ # we need to map the graph_definition, pipeline_definition, agent_definition fields based on framework
22
+ AGENT_SOURCE_KEY_MAPPING: dict[str, str] = dict(
23
+ {
24
+ "HAYSTACK": "pipeline_definition",
25
+ "LANGGRAPH": "graph_definition",
26
+ "ADK": "agent",
27
+ }
28
+ )
29
+
30
+
31
+ class TUIAgentConfig(BaseModel):
32
+ name: str
33
+ framework: str
34
+ port: int
35
+ graph_definition: str
36
+
37
+ @field_validator("*", mode="after")
38
+ def validate_not_null(cls, value: str | Any | None) -> str:
39
+ if value is None or value == "":
40
+ raise ValueError("Cannot have empty fields!")
41
+ return value
42
+
43
+ def to_engine_config(self) -> dict[str, Any]:
44
+ agent_config = {
45
+ "name": self.name,
46
+ AGENT_SOURCE_KEY_MAPPING[self.framework]: self.graph_definition,
47
+ }
48
+
49
+ if self.framework == "ADK":
50
+ agent_config["app_name"] = self.name.replace("-", "_").replace(" ", "_")
51
+ agent_config["session_service"] = {"type": "in_memory"}
52
+ agent_config["memory_service"] = {"type": "in_memory"}
53
+
54
+ return {
55
+ "server": {"api": {"port": self.port}},
56
+ "agent": {
57
+ "type": self.framework,
58
+ "config": agent_config,
59
+ },
60
+ }
File without changes