solace-agent-mesh 1.4.12__py3-none-any.whl → 1.5.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 solace-agent-mesh might be problematic. Click here for more details.

Files changed (181) hide show
  1. solace_agent_mesh/agent/adk/adk_llm.txt +3 -4
  2. solace_agent_mesh/agent/adk/adk_llm_detail.txt +566 -0
  3. solace_agent_mesh/agent/adk/artifacts/artifacts_llm.txt +1 -1
  4. solace_agent_mesh/agent/adk/callbacks.py +51 -2
  5. solace_agent_mesh/agent/adk/models/lite_llm.py +1 -0
  6. solace_agent_mesh/agent/adk/models/models_llm.txt +1 -2
  7. solace_agent_mesh/agent/agent_llm.txt +1 -1
  8. solace_agent_mesh/agent/agent_llm_detail.txt +1702 -0
  9. solace_agent_mesh/agent/protocol/event_handlers.py +2 -13
  10. solace_agent_mesh/agent/protocol/protocol_llm.txt +15 -2
  11. solace_agent_mesh/agent/protocol/protocol_llm_detail.txt +92 -0
  12. solace_agent_mesh/agent/sac/component.py +51 -21
  13. solace_agent_mesh/agent/sac/sac_llm.txt +15 -1
  14. solace_agent_mesh/agent/sac/sac_llm_detail.txt +200 -0
  15. solace_agent_mesh/agent/sac/task_execution_context.py +73 -0
  16. solace_agent_mesh/agent/testing/testing_llm_detail.txt +68 -0
  17. solace_agent_mesh/agent/tools/tools_llm.txt +148 -154
  18. solace_agent_mesh/agent/tools/tools_llm_detail.txt +274 -0
  19. solace_agent_mesh/agent/utils/utils_llm.txt +1 -1
  20. solace_agent_mesh/agent/utils/utils_llm_detail.txt +149 -0
  21. solace_agent_mesh/assets/docs/404.html +3 -3
  22. solace_agent_mesh/assets/docs/assets/js/483cef9a.bf9398af.js +1 -0
  23. solace_agent_mesh/assets/docs/assets/js/{main.f67fc9f4.js → main.0c149855.js} +2 -2
  24. solace_agent_mesh/assets/docs/assets/js/{runtime~main.40527046.js → runtime~main.c66557e4.js} +1 -1
  25. solace_agent_mesh/assets/docs/docs/documentation/Enterprise/installation/index.html +3 -3
  26. solace_agent_mesh/assets/docs/docs/documentation/Enterprise/rbac-setup-guilde/index.html +3 -3
  27. solace_agent_mesh/assets/docs/docs/documentation/Enterprise/single-sign-on/index.html +8 -4
  28. solace_agent_mesh/assets/docs/docs/documentation/Migrations/A2A Upgrade To 0.3.0/a2a-gateway-upgrade-to-0.3.0/index.html +3 -3
  29. solace_agent_mesh/assets/docs/docs/documentation/Migrations/A2A Upgrade To 0.3.0/a2a-technical-migration-map/index.html +3 -3
  30. solace_agent_mesh/assets/docs/docs/documentation/concepts/agents/index.html +3 -3
  31. solace_agent_mesh/assets/docs/docs/documentation/concepts/architecture/index.html +3 -3
  32. solace_agent_mesh/assets/docs/docs/documentation/concepts/cli/index.html +3 -3
  33. solace_agent_mesh/assets/docs/docs/documentation/concepts/gateways/index.html +3 -3
  34. solace_agent_mesh/assets/docs/docs/documentation/concepts/orchestrator/index.html +3 -3
  35. solace_agent_mesh/assets/docs/docs/documentation/concepts/plugins/index.html +3 -3
  36. solace_agent_mesh/assets/docs/docs/documentation/deployment/debugging/index.html +3 -3
  37. solace_agent_mesh/assets/docs/docs/documentation/deployment/deploy/index.html +3 -3
  38. solace_agent_mesh/assets/docs/docs/documentation/deployment/observability/index.html +3 -3
  39. solace_agent_mesh/assets/docs/docs/documentation/getting-started/component-overview/index.html +3 -3
  40. solace_agent_mesh/assets/docs/docs/documentation/getting-started/configurations/index.html +3 -3
  41. solace_agent_mesh/assets/docs/docs/documentation/getting-started/configurations/litellm_models/index.html +3 -3
  42. solace_agent_mesh/assets/docs/docs/documentation/getting-started/installation/index.html +3 -3
  43. solace_agent_mesh/assets/docs/docs/documentation/getting-started/introduction/index.html +3 -3
  44. solace_agent_mesh/assets/docs/docs/documentation/getting-started/quick-start/index.html +3 -3
  45. solace_agent_mesh/assets/docs/docs/documentation/tutorials/bedrock-agents/index.html +3 -3
  46. solace_agent_mesh/assets/docs/docs/documentation/tutorials/custom-agent/index.html +3 -3
  47. solace_agent_mesh/assets/docs/docs/documentation/tutorials/event-mesh-gateway/index.html +3 -3
  48. solace_agent_mesh/assets/docs/docs/documentation/tutorials/mcp-integration/index.html +3 -3
  49. solace_agent_mesh/assets/docs/docs/documentation/tutorials/mongodb-integration/index.html +3 -3
  50. solace_agent_mesh/assets/docs/docs/documentation/tutorials/rag-integration/index.html +3 -3
  51. solace_agent_mesh/assets/docs/docs/documentation/tutorials/rest-gateway/index.html +3 -3
  52. solace_agent_mesh/assets/docs/docs/documentation/tutorials/slack-integration/index.html +3 -3
  53. solace_agent_mesh/assets/docs/docs/documentation/tutorials/sql-database/index.html +3 -3
  54. solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/artifact-management/index.html +3 -3
  55. solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/audio-tools/index.html +3 -3
  56. solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/data-analysis-tools/index.html +3 -3
  57. solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/embeds/index.html +3 -3
  58. solace_agent_mesh/assets/docs/docs/documentation/user-guide/builtin-tools/index.html +3 -3
  59. solace_agent_mesh/assets/docs/docs/documentation/user-guide/create-agents/index.html +3 -3
  60. solace_agent_mesh/assets/docs/docs/documentation/user-guide/create-gateways/index.html +3 -3
  61. solace_agent_mesh/assets/docs/docs/documentation/user-guide/creating-python-tools/index.html +3 -3
  62. solace_agent_mesh/assets/docs/docs/documentation/user-guide/creating-service-providers/index.html +3 -3
  63. solace_agent_mesh/assets/docs/docs/documentation/user-guide/solace-ai-connector/index.html +3 -3
  64. solace_agent_mesh/assets/docs/docs/documentation/user-guide/structure/index.html +3 -3
  65. solace_agent_mesh/assets/docs/lunr-index-1760032255022.json +1 -0
  66. solace_agent_mesh/assets/docs/lunr-index.json +1 -1
  67. solace_agent_mesh/assets/docs/search-doc-1760032255022.json +1 -0
  68. solace_agent_mesh/assets/docs/search-doc.json +1 -1
  69. solace_agent_mesh/cli/__init__.py +1 -1
  70. solace_agent_mesh/client/webui/frontend/static/assets/{authCallback-j1LW-wlq.js → authCallback-DwrxZE0E.js} +1 -1
  71. solace_agent_mesh/client/webui/frontend/static/assets/{client-B9p_nFNA.js → client-DarGQzyw.js} +1 -1
  72. solace_agent_mesh/client/webui/frontend/static/assets/main-CZbpmwfA.css +1 -0
  73. solace_agent_mesh/client/webui/frontend/static/assets/main-C__uuUkB.js +339 -0
  74. solace_agent_mesh/client/webui/frontend/static/assets/{vendor-CS5YMf8a.js → vendor-BKIeiHj_.js} +80 -70
  75. solace_agent_mesh/client/webui/frontend/static/auth-callback.html +3 -3
  76. solace_agent_mesh/client/webui/frontend/static/index.html +4 -4
  77. solace_agent_mesh/common/a2a/a2a_llm.txt +1 -1
  78. solace_agent_mesh/common/a2a/a2a_llm_detail.txt +193 -0
  79. solace_agent_mesh/common/a2a_spec/a2a_spec_llm.txt +1 -1
  80. solace_agent_mesh/common/a2a_spec/a2a_spec_llm_detail.txt +736 -0
  81. solace_agent_mesh/common/a2a_spec/schemas/llm_invocation.json +23 -0
  82. solace_agent_mesh/common/a2a_spec/schemas/schemas_llm.txt +93 -15
  83. solace_agent_mesh/common/a2a_spec/schemas/tool_result.json +23 -0
  84. solace_agent_mesh/common/common_llm.txt +24 -39
  85. solace_agent_mesh/common/common_llm_detail.txt +2562 -0
  86. solace_agent_mesh/common/data_parts.py +9 -1
  87. solace_agent_mesh/common/middleware/middleware_llm_detail.txt +185 -0
  88. solace_agent_mesh/common/sac/sac_llm.txt +1 -1
  89. solace_agent_mesh/common/sac/sac_llm_detail.txt +82 -0
  90. solace_agent_mesh/common/sam_events/sam_events_llm.txt +104 -0
  91. solace_agent_mesh/common/sam_events/sam_events_llm_detail.txt +115 -0
  92. solace_agent_mesh/common/services/services_llm.txt +57 -6
  93. solace_agent_mesh/common/services/services_llm_detail.txt +459 -0
  94. solace_agent_mesh/common/utils/embeds/embeds_llm.txt +1 -1
  95. solace_agent_mesh/common/utils/utils_llm.txt +75 -87
  96. solace_agent_mesh/common/utils/utils_llm_detail.txt +572 -0
  97. solace_agent_mesh/core_a2a/core_a2a_llm_detail.txt +101 -0
  98. solace_agent_mesh/gateway/base/app.py +1 -1
  99. solace_agent_mesh/gateway/base/base_llm.txt +1 -1
  100. solace_agent_mesh/gateway/base/base_llm_detail.txt +235 -0
  101. solace_agent_mesh/gateway/gateway_llm.txt +242 -235
  102. solace_agent_mesh/gateway/gateway_llm_detail.txt +3885 -0
  103. solace_agent_mesh/gateway/http_sse/alembic/alembic_llm.txt +295 -0
  104. solace_agent_mesh/gateway/http_sse/alembic/env.py +10 -1
  105. solace_agent_mesh/gateway/http_sse/alembic/versions/20251006_98882922fa59_add_tasks_events_feedback_chat_tasks.py +190 -0
  106. solace_agent_mesh/gateway/http_sse/alembic/versions/versions_llm.txt +155 -0
  107. solace_agent_mesh/gateway/http_sse/alembic.ini +1 -1
  108. solace_agent_mesh/gateway/http_sse/app.py +148 -2
  109. solace_agent_mesh/gateway/http_sse/component.py +368 -60
  110. solace_agent_mesh/gateway/http_sse/components/components_llm.txt +46 -6
  111. solace_agent_mesh/gateway/http_sse/components/task_logger_forwarder.py +108 -0
  112. solace_agent_mesh/gateway/http_sse/components/visualization_forwarder_component.py +1 -1
  113. solace_agent_mesh/gateway/http_sse/dependencies.py +116 -26
  114. solace_agent_mesh/gateway/http_sse/http_sse_llm.txt +172 -172
  115. solace_agent_mesh/gateway/http_sse/http_sse_llm_detail.txt +3278 -0
  116. solace_agent_mesh/gateway/http_sse/main.py +146 -41
  117. solace_agent_mesh/gateway/http_sse/repository/__init__.py +3 -12
  118. solace_agent_mesh/gateway/http_sse/repository/chat_task_repository.py +103 -0
  119. solace_agent_mesh/gateway/http_sse/repository/entities/__init__.py +5 -3
  120. solace_agent_mesh/gateway/http_sse/repository/entities/chat_task.py +75 -0
  121. solace_agent_mesh/gateway/http_sse/repository/entities/entities_llm.txt +263 -0
  122. solace_agent_mesh/gateway/http_sse/repository/entities/feedback.py +20 -0
  123. solace_agent_mesh/gateway/http_sse/repository/entities/session_history.py +0 -16
  124. solace_agent_mesh/gateway/http_sse/repository/entities/task.py +25 -0
  125. solace_agent_mesh/gateway/http_sse/repository/entities/task_event.py +21 -0
  126. solace_agent_mesh/gateway/http_sse/repository/feedback_repository.py +81 -0
  127. solace_agent_mesh/gateway/http_sse/repository/interfaces.py +73 -18
  128. solace_agent_mesh/gateway/http_sse/repository/models/__init__.py +9 -5
  129. solace_agent_mesh/gateway/http_sse/repository/models/chat_task_model.py +31 -0
  130. solace_agent_mesh/gateway/http_sse/repository/models/feedback_model.py +21 -0
  131. solace_agent_mesh/gateway/http_sse/repository/models/models_llm.txt +266 -0
  132. solace_agent_mesh/gateway/http_sse/repository/models/session_model.py +3 -3
  133. solace_agent_mesh/gateway/http_sse/repository/models/task_event_model.py +25 -0
  134. solace_agent_mesh/gateway/http_sse/repository/models/task_model.py +32 -0
  135. solace_agent_mesh/gateway/http_sse/repository/repository_llm.txt +340 -0
  136. solace_agent_mesh/gateway/http_sse/repository/session_repository.py +4 -53
  137. solace_agent_mesh/gateway/http_sse/repository/task_repository.py +173 -0
  138. solace_agent_mesh/gateway/http_sse/routers/artifacts.py +1 -1
  139. solace_agent_mesh/gateway/http_sse/routers/config.py +26 -4
  140. solace_agent_mesh/gateway/http_sse/routers/dto/dto_llm.txt +346 -0
  141. solace_agent_mesh/gateway/http_sse/routers/dto/requests/__init__.py +3 -3
  142. solace_agent_mesh/gateway/http_sse/routers/dto/requests/requests_llm.txt +83 -0
  143. solace_agent_mesh/gateway/http_sse/routers/dto/requests/session_requests.py +2 -10
  144. solace_agent_mesh/gateway/http_sse/routers/dto/requests/task_requests.py +58 -0
  145. solace_agent_mesh/gateway/http_sse/routers/dto/responses/__init__.py +5 -3
  146. solace_agent_mesh/gateway/http_sse/routers/dto/responses/responses_llm.txt +107 -0
  147. solace_agent_mesh/gateway/http_sse/routers/dto/responses/session_responses.py +1 -15
  148. solace_agent_mesh/gateway/http_sse/routers/dto/responses/task_responses.py +30 -0
  149. solace_agent_mesh/gateway/http_sse/routers/feedback.py +37 -0
  150. solace_agent_mesh/gateway/http_sse/routers/routers_llm.txt +255 -204
  151. solace_agent_mesh/gateway/http_sse/routers/sessions.py +220 -40
  152. solace_agent_mesh/gateway/http_sse/routers/tasks.py +168 -42
  153. solace_agent_mesh/gateway/http_sse/services/data_retention_service.py +272 -0
  154. solace_agent_mesh/gateway/http_sse/services/feedback_service.py +241 -0
  155. solace_agent_mesh/gateway/http_sse/services/people_service.py +0 -80
  156. solace_agent_mesh/gateway/http_sse/services/services_llm.txt +177 -13
  157. solace_agent_mesh/gateway/http_sse/services/session_service.py +151 -84
  158. solace_agent_mesh/gateway/http_sse/services/task_logger_service.py +317 -0
  159. solace_agent_mesh/gateway/http_sse/shared/exception_handlers.py +25 -14
  160. solace_agent_mesh/gateway/http_sse/shared/shared_llm.txt +285 -0
  161. solace_agent_mesh/gateway/http_sse/shared/types.py +7 -0
  162. solace_agent_mesh/gateway/http_sse/utils/__init__.py +1 -0
  163. solace_agent_mesh/gateway/http_sse/utils/stim_utils.py +32 -0
  164. solace_agent_mesh/gateway/http_sse/utils/utils_llm.txt +47 -0
  165. solace_agent_mesh/solace_agent_mesh_llm.txt +1 -1
  166. solace_agent_mesh/solace_agent_mesh_llm_detail.txt +8599 -0
  167. {solace_agent_mesh-1.4.12.dist-info → solace_agent_mesh-1.5.0.dist-info}/METADATA +1 -1
  168. {solace_agent_mesh-1.4.12.dist-info → solace_agent_mesh-1.5.0.dist-info}/RECORD +172 -124
  169. solace_agent_mesh/agent/adk/invocation_monitor.py +0 -295
  170. solace_agent_mesh/assets/docs/assets/js/483cef9a.4736f2d8.js +0 -1
  171. solace_agent_mesh/assets/docs/lunr-index-1759936913198.json +0 -1
  172. solace_agent_mesh/assets/docs/search-doc-1759936913198.json +0 -1
  173. solace_agent_mesh/client/webui/frontend/static/assets/main-ChRwcV89.css +0 -1
  174. solace_agent_mesh/client/webui/frontend/static/assets/main-DnnE01OM.js +0 -339
  175. solace_agent_mesh/gateway/http_sse/repository/entities/message.py +0 -41
  176. solace_agent_mesh/gateway/http_sse/repository/message_repository.py +0 -84
  177. solace_agent_mesh/gateway/http_sse/repository/models/message_model.py +0 -45
  178. /solace_agent_mesh/assets/docs/assets/js/{main.f67fc9f4.js.LICENSE.txt → main.0c149855.js.LICENSE.txt} +0 -0
  179. {solace_agent_mesh-1.4.12.dist-info → solace_agent_mesh-1.5.0.dist-info}/WHEEL +0 -0
  180. {solace_agent_mesh-1.4.12.dist-info → solace_agent_mesh-1.5.0.dist-info}/entry_points.txt +0 -0
  181. {solace_agent_mesh-1.4.12.dist-info → solace_agent_mesh-1.5.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,295 @@
1
+ # DEVELOPER GUIDE: alembic
2
+
3
+ ## Quick Summary
4
+ This directory contains Alembic database migration configuration and version files for the HTTP SSE gateway. It provides database schema management capabilities, including initial table creation, performance optimization through indexing, timestamp format standardization, and task management features with token usage tracking. The directory consists of the main Alembic environment configuration (`env.py`) and a versions subdirectory containing sequential migration files that handle schema evolution over time.
5
+
6
+ ## Files and Subdirectories Overview
7
+ - **Direct files:**
8
+ - `env.py` - Alembic environment configuration for running migrations in offline/online modes
9
+
10
+ - **Subdirectories:**
11
+ - `versions/` - Contains sequential database migration files for schema evolution and task management
12
+
13
+ ## Developer API Reference
14
+
15
+ ### Direct Files
16
+
17
+ #### env.py
18
+ **Purpose:** Alembic environment configuration that handles migration execution in both offline and online modes with proper model registration
19
+ **Import:** This is an Alembic configuration file - not directly imported by application code
20
+
21
+ **Functions:**
22
+ - `run_migrations_offline() -> None` - Executes migrations without database connection (generates SQL scripts)
23
+ - `run_migrations_online() -> None` - Executes migrations with live database connection and proper URL handling
24
+
25
+ **Constants/Variables:**
26
+ - `config` - Alembic Config object providing access to .ini file values
27
+ - `target_metadata` - SQLAlchemy metadata from repository Base class for autogenerate support
28
+
29
+ ### Subdirectory APIs
30
+
31
+ #### versions/
32
+ **Purpose:** Contains sequential Alembic migration files that define database schema changes including core tables, indexes, timestamp modernization, task management, and token usage tracking
33
+ **Key Exports:** Migration functions for complete schema evolution (upgrade/downgrade operations)
34
+ **Import Examples:**
35
+ ```python
36
+ # These are migration files executed by Alembic CLI, not directly imported
37
+ # Access via Alembic commands:
38
+ # alembic upgrade head
39
+ # alembic downgrade base
40
+ ```
41
+
42
+ **Available Migrations:**
43
+ - `d5b3f8f2e9a0` - Initial database schema (sessions and chat_messages tables)
44
+ - `b1c2d3e4f5g6` - Performance indexes for query optimization
45
+ - `f6e7d8c9b0a1` - Timestamp conversion to epoch milliseconds
46
+ - `079e06e9b448` - Task management tables (tasks, task_events, feedback)
47
+ - `20250930_token_usage` - Token usage tracking columns for AI model consumption monitoring
48
+
49
+ ## Complete Usage Guide
50
+
51
+ ### 1. Setting Up Alembic Environment
52
+
53
+ ```python
54
+ # The env.py automatically imports all repository models for metadata
55
+ from solace_agent_mesh.gateway.http_sse.repository.models.base import Base
56
+ from solace_agent_mesh.gateway.http_sse.repository.models.session_model import SessionModel
57
+ from solace_agent_mesh.gateway.http_sse.repository.models.message_model import MessageModel
58
+ from solace_agent_mesh.gateway.http_sse.repository.models.task_model import TaskModel
59
+ from solace_agent_mesh.gateway.http_sse.repository.models.task_event_model import TaskEventModel
60
+ from solace_agent_mesh.gateway.http_sse.repository.models.feedback_model import FeedbackModel
61
+
62
+ target_metadata = Base.metadata
63
+ ```
64
+
65
+ ### 2. Running Migrations
66
+
67
+ ```bash
68
+ # Check current migration status
69
+ alembic current
70
+
71
+ # Run all pending migrations to latest
72
+ alembic upgrade head
73
+
74
+ # Run specific migration
75
+ alembic upgrade d5b3f8f2e9a0
76
+
77
+ # Rollback to previous migration
78
+ alembic downgrade -1
79
+
80
+ # Rollback to specific migration
81
+ alembic downgrade b1c2d3e4f5g6
82
+
83
+ # Rollback all migrations
84
+ alembic downgrade base
85
+
86
+ # View migration history
87
+ alembic history
88
+ ```
89
+
90
+ ### 3. Complete Migration Sequence and Schema Evolution
91
+
92
+ ```bash
93
+ # Step 1: Create initial database schema
94
+ alembic upgrade d5b3f8f2e9a0
95
+ # Creates: sessions table, chat_messages table with relationships
96
+
97
+ # Step 2: Add performance indexes
98
+ alembic upgrade b1c2d3e4f5g6
99
+ # Adds: indexes on user_id, timestamps, composite fields
100
+
101
+ # Step 3: Modernize timestamp format
102
+ alembic upgrade f6e7d8c9b0a1
103
+ # Converts: datetime columns to epoch milliseconds
104
+ # Renames: columns for consistency (created_at → created_time)
105
+
106
+ # Step 4: Add task management features
107
+ alembic upgrade 079e06e9b448
108
+ # Creates: tasks, task_events, feedback tables with proper relationships
109
+
110
+ # Step 5: Add token usage tracking
111
+ alembic upgrade 20250930_token_usage
112
+ # Adds: token usage columns for AI model consumption monitoring
113
+ ```
114
+
115
+ ### 4. Working with Different Database Engines
116
+
117
+ ```python
118
+ # The env.py handles multiple database types automatically
119
+ # Configure database URL in alembic.ini or environment:
120
+
121
+ # PostgreSQL
122
+ # sqlalchemy.url = postgresql://user:pass@localhost/dbname
123
+
124
+ # SQLite
125
+ # sqlalchemy.url = sqlite:///./database.db
126
+
127
+ # MySQL
128
+ # sqlalchemy.url = mysql://user:pass@localhost/dbname
129
+ ```
130
+
131
+ ### 5. Integration with Repository Layer
132
+
133
+ ```python
134
+ # The migrations work with the repository models
135
+ from solace_agent_mesh.gateway.http_sse.repository.models.base import Base
136
+ from solace_agent_mesh.gateway.http_sse.repository.models.session_model import SessionModel
137
+ from solace_agent_mesh.gateway.http_sse.repository.models.message_model import MessageModel
138
+ from solace_agent_mesh.gateway.http_sse.repository.models.task_model import TaskModel
139
+ from solace_agent_mesh.gateway.http_sse.repository.models.task_event_model import TaskEventModel
140
+ from solace_agent_mesh.gateway.http_sse.repository.models.feedback_model import FeedbackModel
141
+
142
+ # After running all migrations, your models will have the updated schema:
143
+ # - All timestamp fields use epoch milliseconds
144
+ # - Proper indexes for performance
145
+ # - Standardized column names
146
+ # - Complete task management functionality
147
+ # - Token usage tracking for AI model consumption
148
+ ```
149
+
150
+ ### 6. Offline Migration Generation
151
+
152
+ ```bash
153
+ # Generate SQL scripts without executing (useful for production deployments)
154
+ # This uses run_migrations_offline() function from env.py
155
+
156
+ # Generate SQL for specific migration
157
+ alembic upgrade d5b3f8f2e9a0 --sql
158
+
159
+ # Generate SQL for all pending migrations
160
+ alembic upgrade head --sql
161
+
162
+ # Generate SQL for token usage migration
163
+ alembic upgrade 20250930_token_usage --sql
164
+ ```
165
+
166
+ ### 7. Common Development Patterns
167
+
168
+ ```bash
169
+ # Development workflow:
170
+ # 1. Make model changes in repository
171
+ # 2. Generate new migration
172
+ alembic revision --autogenerate -m "description of changes"
173
+
174
+ # 3. Review generated migration file
175
+ # 4. Test migration
176
+ alembic upgrade head
177
+
178
+ # 5. Test rollback
179
+ alembic downgrade -1
180
+
181
+ # Production deployment:
182
+ # 1. Generate SQL scripts
183
+ alembic upgrade head --sql > migration.sql
184
+
185
+ # 2. Review and execute SQL manually in production
186
+ ```
187
+
188
+ ### 8. Database Schema After All Migrations
189
+
190
+ ```sql
191
+ -- Final schema structure after all migrations:
192
+
193
+ -- Core tables:
194
+ -- sessions table:
195
+ -- id (String, Primary Key)
196
+ -- name (String)
197
+ -- user_id (String, Indexed)
198
+ -- agent_id (String)
199
+ -- created_time (BigInteger, epoch ms)
200
+ -- updated_time (BigInteger, epoch ms)
201
+
202
+ -- chat_messages table:
203
+ -- id (String, Primary Key)
204
+ -- session_id (String, Foreign Key to sessions.id)
205
+ -- message (Text)
206
+ -- sender_type (String)
207
+ -- sender_name (String)
208
+ -- created_time (BigInteger, epoch ms, Indexed)
209
+
210
+ -- Task management tables:
211
+ -- tasks table:
212
+ -- id (String, Primary Key)
213
+ -- user_id (String, Indexed)
214
+ -- start_time (BigInteger, epoch ms)
215
+ -- end_time (BigInteger, epoch ms)
216
+ -- status (String)
217
+ -- initial_request_text (Text)
218
+ -- total_input_tokens (Integer)
219
+ -- total_output_tokens (Integer)
220
+ -- total_cached_input_tokens (Integer)
221
+ -- token_usage_details (Text, JSON)
222
+
223
+ -- task_events table:
224
+ -- id (String, Primary Key)
225
+ -- task_id (String, Foreign Key to tasks.id)
226
+ -- user_id (String)
227
+ -- created_time (BigInteger, epoch ms)
228
+ -- topic (String)
229
+ -- direction (String)
230
+ -- payload (Text)
231
+
232
+ -- feedback table:
233
+ -- id (String, Primary Key)
234
+ -- session_id (String, Foreign Key to sessions.id)
235
+ -- task_id (String, Foreign Key to tasks.id)
236
+ -- user_id (String)
237
+ -- rating (Integer)
238
+ -- comment (Text)
239
+ -- created_time (BigInteger, epoch ms)
240
+
241
+ -- Performance indexes:
242
+ -- idx_sessions_user_id
243
+ -- idx_sessions_created_time
244
+ -- idx_sessions_updated_time
245
+ -- idx_chat_messages_session_id
246
+ -- idx_chat_messages_created_time
247
+ -- idx_chat_messages_session_created (composite)
248
+ -- idx_tasks_user_id
249
+ -- idx_task_events_task_id
250
+ -- idx_task_events_created_time
251
+ -- idx_feedback_session_id
252
+ -- idx_feedback_task_id
253
+ ```
254
+
255
+ ### 9. Cross-Platform Timestamp Handling
256
+
257
+ ```python
258
+ # The f6e7d8c9b0a1 migration handles database-specific timestamp conversion:
259
+
260
+ # SQLite: Uses table recreation approach
261
+ # - Creates new tables with epoch millisecond columns
262
+ # - Migrates data with timestamp conversion
263
+ # - Drops old tables and renames new ones
264
+
265
+ # PostgreSQL/MySQL: Uses ALTER COLUMN approach
266
+ # - Directly modifies column types
267
+ # - Converts existing data in place
268
+ # - More efficient for large datasets
269
+ ```
270
+
271
+ ### 10. Token Usage Tracking
272
+
273
+ ```python
274
+ # The 20250930_token_usage migration adds AI model consumption tracking:
275
+
276
+ # Token usage columns added to tasks table:
277
+ # - total_input_tokens: Total input tokens consumed
278
+ # - total_output_tokens: Total output tokens generated
279
+ # - total_cached_input_tokens: Cached input tokens used
280
+ # - token_usage_details: JSON field for detailed token usage breakdown
281
+
282
+ # Usage example after migration:
283
+ from solace_agent_mesh.gateway.http_sse.repository.models.task_model import TaskModel
284
+
285
+ # Query tasks with token usage
286
+ task = session.query(TaskModel).filter_by(id="task_id").first()
287
+ print(f"Input tokens: {task.total_input_tokens}")
288
+ print(f"Output tokens: {task.total_output_tokens}")
289
+ print(f"Cached tokens: {task.total_cached_input_tokens}")
290
+ print(f"Details: {task.token_usage_details}")
291
+ ```
292
+
293
+ This Alembic configuration provides a comprehensive database migration system that handles schema evolution, performance optimization, cross-database compatibility, complete task management functionality, and AI model token usage tracking for the HTTP SSE gateway component.
294
+
295
+ # content_hash: 2904df085decd08d4411ff2583b376a04fc56ba1eae82ba45f4a91e1a930b710
@@ -14,7 +14,16 @@ if config.config_file_name is not None:
14
14
 
15
15
  # add your model's MetaData object here
16
16
  # for 'autogenerate' support
17
- from solace_agent_mesh.gateway.http_sse.repository import Base
17
+ from solace_agent_mesh.gateway.http_sse.repository.models.base import Base
18
+
19
+ # Import all models here to ensure they are registered with the Base
20
+ from solace_agent_mesh.gateway.http_sse.repository.models.task_model import TaskModel
21
+ from solace_agent_mesh.gateway.http_sse.repository.models.task_event_model import (
22
+ TaskEventModel,
23
+ )
24
+ from solace_agent_mesh.gateway.http_sse.repository.models.feedback_model import (
25
+ FeedbackModel,
26
+ )
18
27
 
19
28
  target_metadata = Base.metadata
20
29
 
@@ -0,0 +1,190 @@
1
+ """add tasks, task_events, feedback, and chat_tasks tables
2
+
3
+ Revision ID: 98882922fa59
4
+ Revises: f6e7d8c9b0a1
5
+ Create Date: 2025-10-06 09:57:54.735496
6
+
7
+ """
8
+
9
+ from typing import Sequence, Union
10
+
11
+ from alembic import op
12
+ import sqlalchemy as sa
13
+
14
+
15
+ # revision identifiers, used by Alembic.
16
+ revision: str = "98882922fa59"
17
+ down_revision: Union[str, Sequence[str], None] = "f6e7d8c9b0a1"
18
+ branch_labels: Union[str, Sequence[str], None] = None
19
+ depends_on: Union[str, Sequence[str], None] = None
20
+
21
+
22
+ def upgrade() -> None:
23
+ """Create tasks, task_events, feedback, and chat_tasks tables."""
24
+
25
+ # Create feedback table
26
+ op.create_table(
27
+ "feedback",
28
+ sa.Column("id", sa.String(), nullable=False),
29
+ sa.Column("session_id", sa.String(), nullable=False),
30
+ sa.Column("task_id", sa.String(), nullable=False),
31
+ sa.Column("user_id", sa.String(), nullable=False),
32
+ sa.Column("rating", sa.String(), nullable=False),
33
+ sa.Column("comment", sa.Text(), nullable=True),
34
+ sa.Column("created_time", sa.BigInteger(), nullable=False),
35
+ sa.PrimaryKeyConstraint("id"),
36
+ )
37
+ op.create_index(op.f("ix_feedback_task_id"), "feedback", ["task_id"], unique=False)
38
+ op.create_index(op.f("ix_feedback_user_id"), "feedback", ["user_id"], unique=False)
39
+ op.create_index(
40
+ "ix_feedback_created_time", "feedback", ["created_time"], unique=False
41
+ )
42
+
43
+ # Create tasks table
44
+ op.create_table(
45
+ "tasks",
46
+ sa.Column("id", sa.String(), nullable=False),
47
+ sa.Column("user_id", sa.String(), nullable=False),
48
+ sa.Column("start_time", sa.BigInteger(), nullable=False),
49
+ sa.Column("end_time", sa.BigInteger(), nullable=True),
50
+ sa.Column("status", sa.String(), nullable=True),
51
+ sa.Column("initial_request_text", sa.Text(), nullable=True),
52
+ sa.Column("total_input_tokens", sa.Integer(), nullable=True),
53
+ sa.Column("total_output_tokens", sa.Integer(), nullable=True),
54
+ sa.Column("total_cached_input_tokens", sa.Integer(), nullable=True),
55
+ sa.Column("token_usage_details", sa.JSON(), nullable=True),
56
+ sa.PrimaryKeyConstraint("id"),
57
+ )
58
+ op.create_index(
59
+ op.f("ix_tasks_initial_request_text"),
60
+ "tasks",
61
+ ["initial_request_text"],
62
+ unique=False,
63
+ )
64
+ op.create_index(op.f("ix_tasks_user_id"), "tasks", ["user_id"], unique=False)
65
+ op.create_index("ix_tasks_start_time", "tasks", ["start_time"], unique=False)
66
+
67
+ # Create task_events table
68
+ op.create_table(
69
+ "task_events",
70
+ sa.Column("id", sa.String(), nullable=False),
71
+ sa.Column("task_id", sa.String(), nullable=True),
72
+ sa.Column("user_id", sa.String(), nullable=True),
73
+ sa.Column("created_time", sa.BigInteger(), nullable=False),
74
+ sa.Column("topic", sa.Text(), nullable=False),
75
+ sa.Column("direction", sa.String(length=50), nullable=False),
76
+ sa.Column("payload", sa.JSON(), nullable=False),
77
+ sa.ForeignKeyConstraint(["task_id"], ["tasks.id"], ondelete="CASCADE"),
78
+ sa.PrimaryKeyConstraint("id"),
79
+ )
80
+ op.create_index(
81
+ op.f("ix_task_events_task_id"), "task_events", ["task_id"], unique=False
82
+ )
83
+ op.create_index(
84
+ op.f("ix_task_events_user_id"), "task_events", ["user_id"], unique=False
85
+ )
86
+
87
+ # Create chat_tasks table
88
+ op.create_table(
89
+ "chat_tasks",
90
+ sa.Column("id", sa.String(), nullable=False),
91
+ sa.Column("session_id", sa.String(), nullable=False),
92
+ sa.Column("user_id", sa.String(), nullable=False),
93
+ sa.Column("user_message", sa.Text(), nullable=True),
94
+ sa.Column("message_bubbles", sa.Text(), nullable=False),
95
+ sa.Column("task_metadata", sa.Text(), nullable=True),
96
+ sa.Column("created_time", sa.BigInteger(), nullable=False),
97
+ sa.Column("updated_time", sa.BigInteger(), nullable=True),
98
+ sa.PrimaryKeyConstraint("id"),
99
+ sa.ForeignKeyConstraint(["session_id"], ["sessions.id"], ondelete="CASCADE"),
100
+ )
101
+ op.create_index("ix_chat_tasks_session_id", "chat_tasks", ["session_id"])
102
+ op.create_index("ix_chat_tasks_user_id", "chat_tasks", ["user_id"])
103
+ op.create_index("ix_chat_tasks_created_time", "chat_tasks", ["created_time"])
104
+
105
+ # Drop old indexes from sessions and chat_messages tables
106
+ op.drop_index(op.f("ix_chat_messages_created_time"), table_name="chat_messages")
107
+ op.drop_index(op.f("ix_chat_messages_session_id"), table_name="chat_messages")
108
+ op.drop_index(
109
+ op.f("ix_chat_messages_session_id_created_time"), table_name="chat_messages"
110
+ )
111
+ op.drop_index(op.f("ix_sessions_agent_id"), table_name="sessions")
112
+ op.drop_index(op.f("ix_sessions_updated_time"), table_name="sessions")
113
+ op.drop_index(op.f("ix_sessions_user_id"), table_name="sessions")
114
+ op.drop_index(op.f("ix_sessions_user_id_updated_time"), table_name="sessions")
115
+
116
+ # Drop the chat_messages table - replaced by chat_tasks
117
+ op.drop_table("chat_messages")
118
+
119
+
120
+ def downgrade() -> None:
121
+ """Drop tasks, task_events, feedback, and chat_tasks tables."""
122
+
123
+ # Recreate chat_messages table
124
+ op.create_table(
125
+ "chat_messages",
126
+ sa.Column("id", sa.String(), nullable=False),
127
+ sa.Column("session_id", sa.String(), nullable=False),
128
+ sa.Column("message", sa.Text(), nullable=False),
129
+ sa.Column("created_time", sa.BigInteger(), nullable=False),
130
+ sa.Column("sender_type", sa.String(length=50), nullable=True),
131
+ sa.Column("sender_name", sa.String(length=255), nullable=True),
132
+ sa.ForeignKeyConstraint(["session_id"], ["sessions.id"], ondelete="CASCADE"),
133
+ sa.PrimaryKeyConstraint("id"),
134
+ )
135
+
136
+ # Recreate old indexes
137
+ op.create_index(
138
+ op.f("ix_sessions_user_id_updated_time"),
139
+ "sessions",
140
+ ["user_id", "updated_time"],
141
+ unique=False,
142
+ )
143
+ op.create_index(op.f("ix_sessions_user_id"), "sessions", ["user_id"], unique=False)
144
+ op.create_index(
145
+ op.f("ix_sessions_updated_time"), "sessions", ["updated_time"], unique=False
146
+ )
147
+ op.create_index(
148
+ op.f("ix_sessions_agent_id"), "sessions", ["agent_id"], unique=False
149
+ )
150
+ op.create_index(
151
+ op.f("ix_chat_messages_session_id_created_time"),
152
+ "chat_messages",
153
+ ["session_id", "created_time"],
154
+ unique=False,
155
+ )
156
+ op.create_index(
157
+ op.f("ix_chat_messages_session_id"),
158
+ "chat_messages",
159
+ ["session_id"],
160
+ unique=False,
161
+ )
162
+ op.create_index(
163
+ op.f("ix_chat_messages_created_time"),
164
+ "chat_messages",
165
+ ["created_time"],
166
+ unique=False,
167
+ )
168
+
169
+ # Drop chat_tasks table
170
+ op.drop_index("ix_chat_tasks_created_time", table_name="chat_tasks")
171
+ op.drop_index("ix_chat_tasks_user_id", table_name="chat_tasks")
172
+ op.drop_index("ix_chat_tasks_session_id", table_name="chat_tasks")
173
+ op.drop_table("chat_tasks")
174
+
175
+ # Drop task_events table
176
+ op.drop_index(op.f("ix_task_events_user_id"), table_name="task_events")
177
+ op.drop_index(op.f("ix_task_events_task_id"), table_name="task_events")
178
+ op.drop_table("task_events")
179
+
180
+ # Drop tasks table
181
+ op.drop_index("ix_tasks_start_time", table_name="tasks")
182
+ op.drop_index(op.f("ix_tasks_user_id"), table_name="tasks")
183
+ op.drop_index(op.f("ix_tasks_initial_request_text"), table_name="tasks")
184
+ op.drop_table("tasks")
185
+
186
+ # Drop feedback table
187
+ op.drop_index("ix_feedback_created_time", table_name="feedback")
188
+ op.drop_index(op.f("ix_feedback_user_id"), table_name="feedback")
189
+ op.drop_index(op.f("ix_feedback_task_id"), table_name="feedback")
190
+ op.drop_table("feedback")
@@ -0,0 +1,155 @@
1
+ # DEVELOPER GUIDE: versions
2
+
3
+ ## Quick Summary
4
+ This directory contains Alembic database migration files for the HTTP SSE gateway. These migrations handle the evolution of the database schema, including initial table creation, performance optimization through indexing, timestamp format standardization, and task management features with token usage tracking.
5
+
6
+ ## Files Overview
7
+ - `20250910_d5b3f8f2e9a0_create_initial_database.py` - Creates the initial database schema with sessions and chat_messages tables
8
+ - `20250911_b1c2d3e4f5g6_add_database_indexes.py` - Adds performance indexes for common query patterns
9
+ - `20250916_f6e7d8c9b0a1_convert_timestamps_to_epoch_and_align_columns.py` - Converts datetime columns to epoch milliseconds and standardizes column names
10
+ - `20250928_079e06e9b448_add_tasks_task_events_and_feedback_.py` - Adds task management tables (tasks, task_events, feedback)
11
+ - `20250930_add_token_usage_to_tasks.py` - Adds token usage tracking columns to tasks table
12
+ - `versions_llm.txt` - LLM-generated documentation for the versions directory
13
+
14
+ ## Developer API Reference
15
+
16
+ ### 20250910_d5b3f8f2e9a0_create_initial_database.py
17
+ **Purpose:** Initial database migration that creates the core tables for session and message management
18
+ **Import:** This is an Alembic migration file - not directly imported
19
+
20
+ **Functions:**
21
+ - `upgrade() -> None` - Creates sessions and chat_messages tables with proper relationships and foreign key constraints
22
+ - `downgrade() -> None` - Drops all created tables (chat_messages first, then sessions)
23
+
24
+ **Constants/Variables:**
25
+ - `revision: str` - Migration identifier "d5b3f8f2e9a0"
26
+ - `down_revision: Union[str, None]` - Previous migration (None for initial migration)
27
+ - `branch_labels: Union[str, Sequence[str], None]` - Branch labels (None)
28
+ - `depends_on: Union[str, Sequence[str], None]` - Dependencies (None)
29
+
30
+ **Usage Examples:**
31
+ ```bash
32
+ # Run this migration
33
+ alembic upgrade d5b3f8f2e9a0
34
+
35
+ # Rollback this migration
36
+ alembic downgrade base
37
+ ```
38
+
39
+ ### 20250911_b1c2d3e4f5g6_add_database_indexes.py
40
+ **Purpose:** Performance optimization migration that adds indexes for efficient querying
41
+ **Import:** This is an Alembic migration file - not directly imported
42
+
43
+ **Functions:**
44
+ - `upgrade() -> None` - Creates indexes on user_id, timestamps, agent_id, and composite fields for optimal query performance
45
+ - `downgrade() -> None` - Removes all created indexes in reverse order
46
+
47
+ **Constants/Variables:**
48
+ - `revision: str` - Migration identifier "b1c2d3e4f5g6"
49
+ - `down_revision: Union[str, None]` - Previous migration "d5b3f8f2e9a0"
50
+
51
+ **Usage Examples:**
52
+ ```bash
53
+ # Run this migration
54
+ alembic upgrade b1c2d3e4f5g6
55
+
56
+ # Rollback this migration
57
+ alembic downgrade d5b3f8f2e9a0
58
+ ```
59
+
60
+ ### 20250916_f6e7d8c9b0a1_convert_timestamps_to_epoch_and_align_columns.py
61
+ **Purpose:** Schema modernization migration that converts datetime columns to epoch milliseconds for cross-platform compatibility
62
+ **Import:** This is an Alembic migration file - not directly imported
63
+
64
+ **Functions:**
65
+ - `upgrade() -> None` - Converts datetime columns to epoch milliseconds and renames columns (created_at → created_time, updated_at → updated_time)
66
+ - `downgrade() -> None` - Reverts back to datetime columns with original names
67
+ - `_upgrade_sqlite(current_time_ms: int) -> None` - SQLite-specific upgrade logic using table recreation
68
+ - `_upgrade_standard_sql(current_time_ms: int) -> None` - PostgreSQL/MySQL upgrade logic using ALTER COLUMN
69
+ - `_downgrade_sqlite() -> None` - SQLite-specific downgrade logic
70
+ - `_downgrade_standard_sql() -> None` - PostgreSQL/MySQL downgrade logic
71
+ - `_create_updated_indexes() -> None` - Creates indexes on new timestamp columns
72
+ - `_create_indexes_safe(index_name: str, table_name: str, columns: list) -> None` - Safely creates indexes (ignores if exists)
73
+ - `_drop_index_safe(index_name: str, table_name: str) -> None` - Safely drops indexes (ignores if not exists)
74
+
75
+ **Constants/Variables:**
76
+ - `revision: str` - Migration identifier "f6e7d8c9b0a1"
77
+ - `down_revision: str | None` - Previous migration "b1c2d3e4f5g6"
78
+
79
+ **Usage Examples:**
80
+ ```bash
81
+ # Run this migration
82
+ alembic upgrade f6e7d8c9b0a1
83
+
84
+ # Rollback this migration
85
+ alembic downgrade b1c2d3e4f5g6
86
+ ```
87
+
88
+ ### 20250928_079e06e9b448_add_tasks_task_events_and_feedback_.py
89
+ **Purpose:** Adds task management functionality with tables for tracking tasks, events, and user feedback
90
+ **Import:** This is an Alembic migration file - not directly imported
91
+
92
+ **Functions:**
93
+ - `upgrade() -> None` - Creates tasks, task_events, and feedback tables with appropriate indexes and foreign key relationships
94
+ - `downgrade() -> None` - Drops all task-related tables and recreates original session/message indexes
95
+
96
+ **Constants/Variables:**
97
+ - `revision: str` - Migration identifier "079e06e9b448"
98
+ - `down_revision: Union[str, Sequence[str], None]` - Previous migration "f6e7d8c9b0a1"
99
+
100
+ **Usage Examples:**
101
+ ```bash
102
+ # Run this migration
103
+ alembic upgrade 079e06e9b448
104
+
105
+ # Rollback this migration
106
+ alembic downgrade f6e7d8c9b0a1
107
+ ```
108
+
109
+ ### 20250930_add_token_usage_to_tasks.py
110
+ **Purpose:** Adds token usage tracking columns to the tasks table for monitoring AI model consumption
111
+ **Import:** This is an Alembic migration file - not directly imported
112
+
113
+ **Functions:**
114
+ - `upgrade() -> None` - Adds token usage columns (total_input_tokens, total_output_tokens, total_cached_input_tokens, token_usage_details) to tasks table
115
+ - `downgrade() -> None` - Removes all token usage columns from tasks table
116
+
117
+ **Constants/Variables:**
118
+ - `revision: str` - Migration identifier "20250930_token_usage"
119
+ - `down_revision: Union[str, None]` - Previous migration "079e06e9b448"
120
+
121
+ **Usage Examples:**
122
+ ```bash
123
+ # Run this migration
124
+ alembic upgrade 20250930_token_usage
125
+
126
+ # Rollback this migration
127
+ alembic downgrade 079e06e9b448
128
+
129
+ # Run all migrations to latest
130
+ alembic upgrade head
131
+
132
+ # Check current migration status
133
+ alembic current
134
+
135
+ # View migration history
136
+ alembic history
137
+
138
+ # Generate new migration
139
+ alembic revision --autogenerate -m "description"
140
+ ```
141
+
142
+ **Database Schema After All Migrations:**
143
+ ```sql
144
+ -- Core tables with epoch millisecond timestamps:
145
+ -- sessions: id, name, user_id, agent_id, created_time, updated_time
146
+ -- chat_messages: id, session_id, message, sender_type, sender_name, created_time
147
+
148
+ -- Task management tables:
149
+ -- tasks: id, user_id, start_time, end_time, status, initial_request_text,
150
+ -- total_input_tokens, total_output_tokens, total_cached_input_tokens, token_usage_details
151
+ -- task_events: id, task_id, user_id, created_time, topic, direction, payload
152
+ -- feedback: id, session_id, task_id, user_id, rating, comment, created_time
153
+ ```
154
+
155
+ # content_hash: 93bf894b6e5451feedc0b65a723765d7e6798c6912fb3fc34eaf9548d27e4195
@@ -142,4 +142,4 @@ formatter = generic
142
142
 
143
143
  [formatter_generic]
144
144
  format = %(levelname)-5.5s [%(name)s] %(message)s
145
- datefmt = %H:%M:%S
145
+ datefmt = %H:%M:%S