aiecs 1.1.0__py3-none-any.whl → 1.2.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 aiecs might be problematic. Click here for more details.

Files changed (58) hide show
  1. aiecs/__init__.py +1 -1
  2. aiecs/config/config.py +2 -0
  3. aiecs/domain/__init__.py +95 -0
  4. aiecs/domain/community/__init__.py +159 -0
  5. aiecs/domain/community/agent_adapter.py +516 -0
  6. aiecs/domain/community/analytics.py +465 -0
  7. aiecs/domain/community/collaborative_workflow.py +99 -7
  8. aiecs/domain/community/communication_hub.py +649 -0
  9. aiecs/domain/community/community_builder.py +322 -0
  10. aiecs/domain/community/community_integration.py +365 -12
  11. aiecs/domain/community/community_manager.py +481 -5
  12. aiecs/domain/community/decision_engine.py +459 -13
  13. aiecs/domain/community/exceptions.py +238 -0
  14. aiecs/domain/community/models/__init__.py +36 -0
  15. aiecs/domain/community/resource_manager.py +1 -1
  16. aiecs/domain/community/shared_context_manager.py +621 -0
  17. aiecs/domain/context/context_engine.py +37 -33
  18. aiecs/main.py +2 -2
  19. aiecs/scripts/aid/VERSION_MANAGEMENT.md +97 -0
  20. aiecs/scripts/aid/__init__.py +15 -0
  21. aiecs/scripts/aid/version_manager.py +224 -0
  22. aiecs/scripts/dependance_check/download_nlp_data.py +1 -0
  23. aiecs/tools/__init__.py +23 -23
  24. aiecs/tools/docs/__init__.py +5 -2
  25. aiecs/tools/docs/ai_document_orchestrator.py +39 -26
  26. aiecs/tools/docs/ai_document_writer_orchestrator.py +61 -38
  27. aiecs/tools/docs/content_insertion_tool.py +48 -28
  28. aiecs/tools/docs/document_creator_tool.py +47 -29
  29. aiecs/tools/docs/document_layout_tool.py +35 -20
  30. aiecs/tools/docs/document_parser_tool.py +56 -36
  31. aiecs/tools/docs/document_writer_tool.py +115 -62
  32. aiecs/tools/schema_generator.py +56 -56
  33. aiecs/tools/statistics/__init__.py +82 -0
  34. aiecs/tools/statistics/ai_data_analysis_orchestrator.py +581 -0
  35. aiecs/tools/statistics/ai_insight_generator_tool.py +473 -0
  36. aiecs/tools/statistics/ai_report_orchestrator_tool.py +629 -0
  37. aiecs/tools/statistics/data_loader_tool.py +518 -0
  38. aiecs/tools/statistics/data_profiler_tool.py +599 -0
  39. aiecs/tools/statistics/data_transformer_tool.py +531 -0
  40. aiecs/tools/statistics/data_visualizer_tool.py +460 -0
  41. aiecs/tools/statistics/model_trainer_tool.py +470 -0
  42. aiecs/tools/statistics/statistical_analyzer_tool.py +426 -0
  43. aiecs/tools/task_tools/chart_tool.py +2 -1
  44. aiecs/tools/task_tools/image_tool.py +43 -43
  45. aiecs/tools/task_tools/office_tool.py +39 -36
  46. aiecs/tools/task_tools/pandas_tool.py +37 -33
  47. aiecs/tools/task_tools/report_tool.py +67 -56
  48. aiecs/tools/task_tools/research_tool.py +32 -31
  49. aiecs/tools/task_tools/scraper_tool.py +53 -46
  50. aiecs/tools/task_tools/search_tool.py +1123 -0
  51. aiecs/tools/task_tools/stats_tool.py +20 -15
  52. {aiecs-1.1.0.dist-info → aiecs-1.2.0.dist-info}/METADATA +5 -1
  53. {aiecs-1.1.0.dist-info → aiecs-1.2.0.dist-info}/RECORD +57 -36
  54. {aiecs-1.1.0.dist-info → aiecs-1.2.0.dist-info}/entry_points.txt +1 -0
  55. aiecs/tools/task_tools/search_api.py +0 -7
  56. {aiecs-1.1.0.dist-info → aiecs-1.2.0.dist-info}/WHEEL +0 -0
  57. {aiecs-1.1.0.dist-info → aiecs-1.2.0.dist-info}/licenses/LICENSE +0 -0
  58. {aiecs-1.1.0.dist-info → aiecs-1.2.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,238 @@
1
+ """
2
+ Community Exceptions
3
+
4
+ Defines community-specific exception classes with clear error messages
5
+ and recovery suggestions.
6
+ """
7
+
8
+
9
+ class CommunityException(Exception):
10
+ """Base exception for community-related errors."""
11
+
12
+ def __init__(self, message: str, recovery_suggestion: str = None):
13
+ """
14
+ Initialize community exception.
15
+
16
+ Args:
17
+ message: Error message
18
+ recovery_suggestion: Optional suggestion for recovery
19
+ """
20
+ self.message = message
21
+ self.recovery_suggestion = recovery_suggestion
22
+ super().__init__(self.message)
23
+
24
+ def __str__(self):
25
+ """String representation with recovery suggestion."""
26
+ if self.recovery_suggestion:
27
+ return f"{self.message}\nSuggestion: {self.recovery_suggestion}"
28
+ return self.message
29
+
30
+
31
+ class CommunityNotFoundError(CommunityException):
32
+ """Raised when a community is not found."""
33
+
34
+ def __init__(self, community_id: str):
35
+ super().__init__(
36
+ f"Community not found: {community_id}",
37
+ "Verify the community ID is correct and the community exists."
38
+ )
39
+ self.community_id = community_id
40
+
41
+
42
+ class MemberNotFoundError(CommunityException):
43
+ """Raised when a member is not found."""
44
+
45
+ def __init__(self, member_id: str):
46
+ super().__init__(
47
+ f"Member not found: {member_id}",
48
+ "Verify the member ID is correct and the member exists in the community."
49
+ )
50
+ self.member_id = member_id
51
+
52
+
53
+ class ResourceNotFoundError(CommunityException):
54
+ """Raised when a resource is not found."""
55
+
56
+ def __init__(self, resource_id: str):
57
+ super().__init__(
58
+ f"Resource not found: {resource_id}",
59
+ "Verify the resource ID is correct and the resource exists."
60
+ )
61
+ self.resource_id = resource_id
62
+
63
+
64
+ class DecisionNotFoundError(CommunityException):
65
+ """Raised when a decision is not found."""
66
+
67
+ def __init__(self, decision_id: str):
68
+ super().__init__(
69
+ f"Decision not found: {decision_id}",
70
+ "Verify the decision ID is correct and the decision exists."
71
+ )
72
+ self.decision_id = decision_id
73
+
74
+
75
+ class AccessDeniedError(CommunityException):
76
+ """Raised when access to a community resource is denied."""
77
+
78
+ def __init__(self, agent_id: str, resource_type: str, resource_id: str):
79
+ super().__init__(
80
+ f"Access denied for agent {agent_id} to {resource_type} {resource_id}",
81
+ "Request access from the resource owner or community administrator."
82
+ )
83
+ self.agent_id = agent_id
84
+ self.resource_type = resource_type
85
+ self.resource_id = resource_id
86
+
87
+
88
+ class MembershipError(CommunityException):
89
+ """Raised when there's an issue with community membership."""
90
+
91
+ def __init__(self, message: str, agent_id: str = None):
92
+ super().__init__(
93
+ message,
94
+ "Check membership status and community requirements."
95
+ )
96
+ self.agent_id = agent_id
97
+
98
+
99
+ class VotingError(CommunityException):
100
+ """Raised when there's an issue with voting."""
101
+
102
+ def __init__(self, message: str, decision_id: str = None):
103
+ super().__init__(
104
+ message,
105
+ "Verify voting is open and you are eligible to vote on this decision."
106
+ )
107
+ self.decision_id = decision_id
108
+
109
+
110
+ class GovernanceError(CommunityException):
111
+ """Raised when there's an issue with community governance."""
112
+
113
+ def __init__(self, message: str, community_id: str = None):
114
+ super().__init__(
115
+ message,
116
+ "Review community governance rules and requirements."
117
+ )
118
+ self.community_id = community_id
119
+
120
+
121
+ class CollaborationError(CommunityException):
122
+ """Raised when there's an issue with collaboration."""
123
+
124
+ def __init__(self, message: str, session_id: str = None):
125
+ super().__init__(
126
+ message,
127
+ "Check session status and participant availability."
128
+ )
129
+ self.session_id = session_id
130
+
131
+
132
+ class CommunityInitializationError(CommunityException):
133
+ """Raised when community initialization fails."""
134
+
135
+ def __init__(self, component: str, reason: str):
136
+ super().__init__(
137
+ f"Failed to initialize {component}: {reason}",
138
+ "Check configuration and dependencies are properly set up."
139
+ )
140
+ self.component = component
141
+ self.reason = reason
142
+
143
+
144
+ class CommunityValidationError(CommunityException):
145
+ """Raised when community validation fails."""
146
+
147
+ def __init__(self, field_or_message: str, reason: str = None):
148
+ if reason:
149
+ # Two-argument form: field and reason
150
+ message = f"Validation error for {field_or_message}: {reason}"
151
+ self.field = field_or_message
152
+ self.reason = reason
153
+ else:
154
+ # One-argument form: just message
155
+ message = field_or_message
156
+ self.field = None
157
+ self.reason = None
158
+
159
+ super().__init__(
160
+ message,
161
+ "Review the field value and ensure it meets requirements."
162
+ )
163
+
164
+
165
+ class QuorumNotMetError(CommunityException):
166
+ """Raised when quorum is not met for a decision."""
167
+
168
+ def __init__(self, required: int, actual: int, decision_id: str = None):
169
+ super().__init__(
170
+ f"Quorum not met: {actual} votes cast, {required} required",
171
+ "Encourage more members to participate in voting."
172
+ )
173
+ self.required = required
174
+ self.actual = actual
175
+ self.decision_id = decision_id
176
+
177
+
178
+ class ConflictResolutionError(CommunityException):
179
+ """Raised when conflict resolution fails."""
180
+
181
+ def __init__(self, decision_id: str, strategy: str):
182
+ super().__init__(
183
+ f"Conflict resolution failed for decision {decision_id} using {strategy}",
184
+ "Try a different conflict resolution strategy or escalate the decision."
185
+ )
186
+ self.decision_id = decision_id
187
+ self.strategy = strategy
188
+
189
+
190
+ class CommunityCapacityError(CommunityException):
191
+ """Raised when community reaches capacity."""
192
+
193
+ def __init__(self, community_id: str, current: int, maximum: int):
194
+ super().__init__(
195
+ f"Community {community_id} is at capacity: {current}/{maximum} members",
196
+ "Create a new community or increase the member limit."
197
+ )
198
+ self.community_id = community_id
199
+ self.current = current
200
+ self.maximum = maximum
201
+
202
+
203
+ class AgentAdapterError(CommunityException):
204
+ """Raised when there's an issue with agent adapter."""
205
+
206
+ def __init__(self, agent_id: str, reason: str):
207
+ super().__init__(
208
+ f"Agent adapter error for {agent_id}: {reason}",
209
+ "Check agent adapter configuration and connectivity."
210
+ )
211
+ self.agent_id = agent_id
212
+ self.reason = reason
213
+
214
+
215
+ class CommunicationError(CommunityException):
216
+ """Raised when there's an issue with agent communication."""
217
+
218
+ def __init__(self, sender_id: str, recipient_id: str, reason: str):
219
+ super().__init__(
220
+ f"Communication error from {sender_id} to {recipient_id}: {reason}",
221
+ "Verify both agents are registered and active in the communication hub."
222
+ )
223
+ self.sender_id = sender_id
224
+ self.recipient_id = recipient_id
225
+ self.reason = reason
226
+
227
+
228
+ class ContextError(CommunityException):
229
+ """Raised when there's an issue with shared context."""
230
+
231
+ def __init__(self, context_id: str, reason: str):
232
+ super().__init__(
233
+ f"Context error for {context_id}: {reason}",
234
+ "Check context access permissions and version compatibility."
235
+ )
236
+ self.context_id = context_id
237
+ self.reason = reason
238
+
@@ -0,0 +1,36 @@
1
+ """
2
+ Community Models
3
+
4
+ Data models for agent community collaboration, governance, and resource sharing.
5
+ """
6
+
7
+ from .community_models import (
8
+ # Enums
9
+ CommunityRole,
10
+ GovernanceType,
11
+ DecisionStatus,
12
+ ResourceType,
13
+
14
+ # Models
15
+ CommunityMember,
16
+ CommunityResource,
17
+ CommunityDecision,
18
+ AgentCommunity,
19
+ CollaborationSession,
20
+ )
21
+
22
+ __all__ = [
23
+ # Enums
24
+ "CommunityRole",
25
+ "GovernanceType",
26
+ "DecisionStatus",
27
+ "ResourceType",
28
+
29
+ # Models
30
+ "CommunityMember",
31
+ "CommunityResource",
32
+ "CommunityDecision",
33
+ "AgentCommunity",
34
+ "CollaborationSession",
35
+ ]
36
+
@@ -15,7 +15,7 @@ from .models.community_models import (
15
15
  CommunityResource, CommunityMember, AgentCommunity,
16
16
  ResourceType
17
17
  )
18
- from ..core.exceptions.task_exceptions import TaskValidationError
18
+ from .exceptions import CommunityValidationError as TaskValidationError
19
19
 
20
20
  logger = logging.getLogger(__name__)
21
21