daita-agents 0.1.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.

Potentially problematic release.


This version of daita-agents might be problematic. Click here for more details.

Files changed (69) hide show
  1. daita/__init__.py +208 -0
  2. daita/agents/__init__.py +33 -0
  3. daita/agents/base.py +722 -0
  4. daita/agents/substrate.py +895 -0
  5. daita/cli/__init__.py +145 -0
  6. daita/cli/__main__.py +7 -0
  7. daita/cli/ascii_art.py +44 -0
  8. daita/cli/core/__init__.py +0 -0
  9. daita/cli/core/create.py +254 -0
  10. daita/cli/core/deploy.py +473 -0
  11. daita/cli/core/deployments.py +309 -0
  12. daita/cli/core/import_detector.py +219 -0
  13. daita/cli/core/init.py +382 -0
  14. daita/cli/core/logs.py +239 -0
  15. daita/cli/core/managed_deploy.py +709 -0
  16. daita/cli/core/run.py +648 -0
  17. daita/cli/core/status.py +421 -0
  18. daita/cli/core/test.py +239 -0
  19. daita/cli/core/webhooks.py +172 -0
  20. daita/cli/main.py +588 -0
  21. daita/cli/utils.py +541 -0
  22. daita/config/__init__.py +62 -0
  23. daita/config/base.py +159 -0
  24. daita/config/settings.py +184 -0
  25. daita/core/__init__.py +262 -0
  26. daita/core/decision_tracing.py +701 -0
  27. daita/core/exceptions.py +480 -0
  28. daita/core/focus.py +251 -0
  29. daita/core/interfaces.py +76 -0
  30. daita/core/plugin_tracing.py +550 -0
  31. daita/core/relay.py +695 -0
  32. daita/core/reliability.py +381 -0
  33. daita/core/scaling.py +444 -0
  34. daita/core/tools.py +402 -0
  35. daita/core/tracing.py +770 -0
  36. daita/core/workflow.py +1084 -0
  37. daita/display/__init__.py +1 -0
  38. daita/display/console.py +160 -0
  39. daita/execution/__init__.py +58 -0
  40. daita/execution/client.py +856 -0
  41. daita/execution/exceptions.py +92 -0
  42. daita/execution/models.py +317 -0
  43. daita/llm/__init__.py +60 -0
  44. daita/llm/anthropic.py +166 -0
  45. daita/llm/base.py +373 -0
  46. daita/llm/factory.py +101 -0
  47. daita/llm/gemini.py +152 -0
  48. daita/llm/grok.py +114 -0
  49. daita/llm/mock.py +135 -0
  50. daita/llm/openai.py +109 -0
  51. daita/plugins/__init__.py +141 -0
  52. daita/plugins/base.py +37 -0
  53. daita/plugins/base_db.py +167 -0
  54. daita/plugins/elasticsearch.py +844 -0
  55. daita/plugins/mcp.py +481 -0
  56. daita/plugins/mongodb.py +510 -0
  57. daita/plugins/mysql.py +351 -0
  58. daita/plugins/postgresql.py +331 -0
  59. daita/plugins/redis_messaging.py +500 -0
  60. daita/plugins/rest.py +529 -0
  61. daita/plugins/s3.py +761 -0
  62. daita/plugins/slack.py +729 -0
  63. daita/utils/__init__.py +18 -0
  64. daita_agents-0.1.0.dist-info/METADATA +350 -0
  65. daita_agents-0.1.0.dist-info/RECORD +69 -0
  66. daita_agents-0.1.0.dist-info/WHEEL +5 -0
  67. daita_agents-0.1.0.dist-info/entry_points.txt +2 -0
  68. daita_agents-0.1.0.dist-info/licenses/LICENSE +56 -0
  69. daita_agents-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1 @@
1
+ """Display utilities for Daita framework."""
@@ -0,0 +1,160 @@
1
+ """
2
+ Console Decision Display for Daita Framework
3
+
4
+ Provides simple, clean console display of agent decision-making during development.
5
+ Always uses minimal styling to encourage users to upgrade to dashboard for detailed
6
+ reasoning insights and comprehensive observability.
7
+ """
8
+
9
+ import sys
10
+ from typing import Optional
11
+
12
+ from ..core.decision_tracing import DecisionEvent, DecisionEventType
13
+
14
+
15
+ class ConsoleDecisionDisplay:
16
+ """
17
+ Console decision display for local development.
18
+
19
+ Shows just enough information to understand what the agent is doing,
20
+ encouraging users to use the dashboard for detailed reasoning analysis.
21
+ """
22
+
23
+ def __init__(self, agent_name: str, agent_id: str):
24
+ self.agent_name = agent_name
25
+ self.agent_id = agent_id
26
+ self.decision_count = 0
27
+ self.is_active = False
28
+ self.current_decisions = {} # Track ongoing decisions
29
+
30
+ def start(self):
31
+ """Start the console decision display."""
32
+ self.is_active = True
33
+ print(f"🤔 Agent: {self.agent_name}")
34
+
35
+ def stop(self):
36
+ """Stop the decision display."""
37
+ if self.is_active and self.decision_count > 0:
38
+ print(f"✨ Complete: {self.decision_count} decisions made")
39
+ self.is_active = False
40
+
41
+ def handle_event(self, event: DecisionEvent):
42
+ """Handle decision events with minimal output."""
43
+ if not self.is_active:
44
+ return
45
+
46
+ span_id = event.span_id or "unknown"
47
+
48
+ if event.event_type == DecisionEventType.DECISION_STARTED:
49
+ self._handle_decision_started(event, span_id)
50
+
51
+ elif event.event_type == DecisionEventType.DECISION_COMPLETED:
52
+ self._handle_decision_completed(event, span_id)
53
+
54
+ # We ignore intermediate events (reasoning, confidence, alternatives)
55
+ # to keep output minimal and drive users to dashboard for details
56
+
57
+ sys.stdout.flush()
58
+
59
+ def _handle_decision_started(self, event: DecisionEvent, span_id: str):
60
+ """Handle decision started - track but don't display yet."""
61
+ self.current_decisions[span_id] = {
62
+ "decision_point": event.decision_point,
63
+ "started": True
64
+ }
65
+
66
+ def _handle_decision_completed(self, event: DecisionEvent, span_id: str):
67
+ """Handle decision completed - show final result."""
68
+ if span_id not in self.current_decisions:
69
+ # Decision started before display was active, show it anyway
70
+ decision_point = event.decision_point
71
+ else:
72
+ decision_point = self.current_decisions[span_id]["decision_point"]
73
+ del self.current_decisions[span_id]
74
+
75
+ self.decision_count += 1
76
+
77
+ final_conf = event.data.get('final_confidence', 0)
78
+ success = event.data.get('success', False)
79
+
80
+ # Determine the decision outcome for display
81
+ outcome = self._determine_outcome(decision_point, final_conf, success)
82
+
83
+ status_icon = "" if success else ""
84
+
85
+ # Simple one-line format: Decision → Outcome (confidence)
86
+ print(f" Decision: {decision_point} → {outcome} ({final_conf:.2f})")
87
+
88
+ def _determine_outcome(self, decision_point: str, confidence: float, success: bool) -> str:
89
+ """
90
+ Determine a simple outcome description for the decision.
91
+
92
+ This is intentionally basic - detailed reasoning is available in dashboard.
93
+ """
94
+ if not success:
95
+ return "FAILED"
96
+
97
+ # Try to infer outcome from decision point name and confidence
98
+ if "urgency" in decision_point.lower():
99
+ if confidence >= 0.8:
100
+ return "HIGH urgency"
101
+ elif confidence >= 0.5:
102
+ return "MEDIUM urgency"
103
+ else:
104
+ return "LOW urgency"
105
+
106
+ elif "classification" in decision_point.lower() or "classify" in decision_point.lower():
107
+ if confidence >= 0.8:
108
+ return "CLASSIFIED"
109
+ else:
110
+ return "UNCERTAIN"
111
+
112
+ elif "analysis" in decision_point.lower() or "analyze" in decision_point.lower():
113
+ if confidence >= 0.8:
114
+ return "ANALYZED"
115
+ else:
116
+ return "PARTIAL"
117
+
118
+ elif "recommendation" in decision_point.lower() or "recommend" in decision_point.lower():
119
+ if confidence >= 0.8:
120
+ return "RECOMMENDED"
121
+ else:
122
+ return "SUGGESTED"
123
+
124
+ elif "validation" in decision_point.lower() or "validate" in decision_point.lower():
125
+ if confidence >= 0.8:
126
+ return "VALID"
127
+ else:
128
+ return "QUESTIONABLE"
129
+
130
+ else:
131
+ # Generic outcomes based on confidence
132
+ if confidence >= 0.9:
133
+ return "HIGH confidence"
134
+ elif confidence >= 0.7:
135
+ return "CONFIDENT"
136
+ elif confidence >= 0.5:
137
+ return "MODERATE"
138
+ else:
139
+ return "LOW confidence"
140
+
141
+
142
+ def create_console_decision_display(agent_name: str, agent_id: str) -> ConsoleDecisionDisplay:
143
+ """
144
+ Create a console decision display for local development.
145
+
146
+ This is the primary display mode for local development and testing.
147
+ For detailed reasoning analysis, users should use the Daita dashboard.
148
+
149
+ Args:
150
+ agent_name: Name of the agent for display
151
+ agent_id: Agent ID for tracking
152
+
153
+ Returns:
154
+ ConsoleDecisionDisplay instance
155
+ """
156
+ return ConsoleDecisionDisplay(agent_name, agent_id)
157
+
158
+ # Legacy alias for backwards compatibility during migration
159
+ MinimalDecisionDisplay = ConsoleDecisionDisplay
160
+ create_minimal_decision_display = create_console_decision_display
@@ -0,0 +1,58 @@
1
+ """
2
+ Autonomous Execution Package for Daita Agents.
3
+
4
+ This package provides programmatic execution capabilities for deployed agents
5
+ and workflows, enabling users to build autonomous systems that can trigger
6
+ agent execution from external code.
7
+
8
+ Main Components:
9
+ - DaitaClient: Primary interface for programmatic agent execution
10
+ - ExecutionResult: Response model for execution results
11
+ - ScheduledTask: Model for scheduled execution configuration
12
+ - WebhookTrigger: Model for webhook-triggered execution configuration
13
+
14
+ Clean API Design:
15
+ - Sync methods are primary interface (no ugly _sync suffixes)
16
+ - Async methods available with _async suffix for advanced users
17
+ - Clear, descriptive method names that state what they do
18
+
19
+ Example Usage:
20
+ from daita import DaitaClient
21
+
22
+ # Initialize with user's existing API key
23
+ client = DaitaClient(api_key="your_api_key")
24
+
25
+ # Execute agent and wait for completion (sync)
26
+ result = client.execute_agent("my_agent", data={"input": "data"}, wait=True)
27
+
28
+ # Check execution status
29
+ status = client.get_execution(result.execution_id)
30
+
31
+ # Get latest execution for an agent
32
+ latest = client.get_latest_execution(agent_name="my_agent")
33
+
34
+ Async Usage (Advanced):
35
+ async with DaitaClient(api_key="your_api_key") as client:
36
+ result = await client.execute_agent_async("my_agent", data={"input": "data"})
37
+ status = await client.get_execution_async(result.execution_id)
38
+ """
39
+
40
+ from .client import DaitaClient
41
+ from .models import ExecutionResult, ScheduledTask, WebhookTrigger
42
+ from .exceptions import (
43
+ ExecutionError,
44
+ AuthenticationError,
45
+ NotFoundError,
46
+ ValidationError
47
+ )
48
+
49
+ __all__ = [
50
+ "DaitaClient",
51
+ "ExecutionResult",
52
+ "ScheduledTask",
53
+ "WebhookTrigger",
54
+ "ExecutionError",
55
+ "AuthenticationError",
56
+ "NotFoundError",
57
+ "ValidationError"
58
+ ]