meta_workflows 0.8.17 → 0.8.19

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad09f1d339b0efee72ca8bcd71d89e60d9dbd431eae240d0a2763fd688e4ad81
4
- data.tar.gz: 1cfb07dea381b3730a7a185c50ac4238eef821d656f969e4ca287ead0c507e6e
3
+ metadata.gz: a9c825c0e356c14c04b766a7952fd48f3ed40f062de1becc83aec289feb98194
4
+ data.tar.gz: a9741632d6106d1c4979de1f23e1d1ed904fa103adc1d3ce667d6bf089f1d33b
5
5
  SHA512:
6
- metadata.gz: 8f651f54303a4c5724157d1cf37b0ae4ea5c36525fac453faf1aa260b5977530522c509e26c700b8ded23cded243cd4bcd1cbd2ed1d39fb3dd31da8794b1f6b1
7
- data.tar.gz: 6b473d2dcef5fa839e48b7a908a8bfb25fffd7a896ca6f3a86a765e79b08ac0156e581c2af8b73b64f025dd138cf5fde3b621f4c56ff9b68ab8d9234738aef6a
6
+ metadata.gz: a7914fedafe891ec2ce5032ab8fcd5f9ccdb7ced4fde876a38fcc8d4bf55c257652148afdbbc99e749fb0f4c8668fe9e2befb20cf8495ae5795bbe393e51b25d
7
+ data.tar.gz: 3a7ea92f25c36ccca8e1aff1b56aa670056f19ffcb4b794535c4cce1f28ed0d076a61c6a6cbc3f68156c36f134daad5d7630cf8321f6fc5e4f46bc79c6149756
@@ -141,7 +141,11 @@
141
141
  <%= execution_status_display(execution) %>
142
142
  </td>
143
143
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
144
- Step <%= execution.current_step + 1 %>
144
+ <% if execution.completed? %>
145
+ Step <%= execution.workflow.total_steps %>
146
+ <% else %>
147
+ Step <%= execution.current_step + 1 %>
148
+ <% end %>
145
149
  </td>
146
150
  <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
147
151
  <%= execution.workflow_steps.count %> steps
@@ -72,18 +72,18 @@
72
72
  <div class="px-6 py-4 border-b border-gray-200">
73
73
  <h2 class="text-lg font-medium text-gray-900">Workflow Steps</h2>
74
74
  <p class="mt-1 text-sm text-gray-500">
75
- Detailed view of each step in this execution
75
+ Detailed view of each step in this execution with associated chat conversations
76
76
  </p>
77
77
  </div>
78
78
 
79
79
  <div class="divide-y divide-gray-200">
80
80
  <% @execution.workflow_steps.includes(:chat).order(:step).each do |workflow_step| %>
81
- <div class="px-6 py-4">
82
- <div class="flex items-start justify-between">
81
+ <div class="px-6 py-6">
82
+ <div class="flex items-start justify-between mb-4">
83
83
  <div class="flex-1">
84
84
  <div class="flex items-center">
85
85
  <h3 class="text-sm font-medium text-gray-900">
86
- Step <%= workflow_step.step %>
86
+ Step <%= workflow_step.step + 1 %>
87
87
  </h3>
88
88
  <%= workflow_step_status(workflow_step, @execution.current_step) %>
89
89
  <% if workflow_step.error? %>
@@ -149,22 +149,92 @@
149
149
  </div>
150
150
  </div>
151
151
  <% end %>
152
-
153
- <% if workflow_step.chat.present? %>
154
- <div class="mt-2">
155
- <span class="text-xs text-gray-500">
156
- Chat ID: <%= workflow_step.chat.id %> |
157
- Messages: <%= workflow_step.chat.messages.count %> |
158
- Created: <%= time_with_tooltip(workflow_step.chat.created_at) %>
159
- </span>
160
- </div>
161
- <% end %>
162
152
  </div>
163
153
 
164
154
  <div class="text-xs text-gray-500">
165
155
  <%= time_with_tooltip(workflow_step.created_at) %>
166
156
  </div>
167
157
  </div>
158
+
159
+ <!-- Chat Associated with This Step -->
160
+ <% if workflow_step.chat.present? && workflow_step.chat.messages.any? %>
161
+ <div class="bg-gray-50 rounded-lg p-4 mt-4">
162
+ <div class="flex items-center justify-between mb-3">
163
+ <h4 class="text-sm font-medium text-gray-900">
164
+ Chat Conversation for Step <%= workflow_step.step + 1 %>
165
+ </h4>
166
+ <div class="text-xs text-gray-500">
167
+ Chat #<%= workflow_step.chat.id %> |
168
+ <%= workflow_step.chat.provider %> - <%= workflow_step.chat.model_id %> |
169
+ <%= workflow_step.chat.messages.count %> messages
170
+ </div>
171
+ </div>
172
+
173
+ <% if workflow_step.chat.user.present? %>
174
+ <p class="text-xs text-gray-500 mb-3">User: <%= user_display_name(workflow_step.chat.user) %></p>
175
+ <% end %>
176
+
177
+ <!-- Messages for this step -->
178
+ <div class="space-y-3">
179
+ <% workflow_step.chat.messages.order(:created_at).each do |message| %>
180
+ <div class="border rounded-lg p-3 bg-white <%= message_role_badge(message.role) %>">
181
+ <div class="flex items-center justify-between mb-2">
182
+ <div class="flex items-center space-x-2">
183
+ <span class="text-xs font-medium text-gray-900 uppercase"><%= message.role %></span>
184
+ <% if message.model_id.present? %>
185
+ <span class="text-xs text-gray-500">(<%= message.model_id %>)</span>
186
+ <% end %>
187
+ </div>
188
+ <div class="text-xs text-gray-500">
189
+ <%= time_with_tooltip(message.created_at) %>
190
+ <% token_info = format_token_usage(message.input_tokens, message.output_tokens) %>
191
+ <% if token_info.present? %>
192
+ | <%= token_info %>
193
+ <% end %>
194
+ </div>
195
+ </div>
196
+
197
+ <% if message.content.present? %>
198
+ <div class="text-sm text-gray-800 whitespace-pre-wrap"><%= message.content %></div>
199
+ <% end %>
200
+
201
+ <!-- Tool Calls -->
202
+ <% if message.tool_calls.any? %>
203
+ <div class="mt-3 space-y-2">
204
+ <h5 class="text-xs font-medium text-gray-700">Tool Calls:</h5>
205
+ <% message.tool_calls.each do |tool_call| %>
206
+ <div class="bg-gray-50 border rounded p-2">
207
+ <div class="flex items-center justify-between mb-1">
208
+ <span class="text-xs font-medium text-gray-800"><%= tool_call.name %></span>
209
+ <span class="text-xs text-gray-500">ID: <%= tool_call.tool_call_id %></span>
210
+ </div>
211
+ <% if tool_call.arguments.present? %>
212
+ <div class="text-xs">
213
+ <strong>Arguments:</strong>
214
+ <%= json_display(tool_call.arguments, classes: 'bg-white p-2 rounded text-xs overflow-x-auto mt-1') %>
215
+ </div>
216
+ <% end %>
217
+ </div>
218
+ <% end %>
219
+ </div>
220
+ <% end %>
221
+ </div>
222
+ <% end %>
223
+ </div>
224
+ </div>
225
+ <% elsif workflow_step.chat.present? %>
226
+ <div class="bg-gray-50 rounded-lg p-4 mt-4">
227
+ <div class="text-sm text-gray-500 text-center">
228
+ Chat #<%= workflow_step.chat.id %> exists for this step but contains no messages
229
+ </div>
230
+ </div>
231
+ <% else %>
232
+ <div class="bg-gray-50 rounded-lg p-4 mt-4">
233
+ <div class="text-sm text-gray-500 text-center">
234
+ No chat conversation associated with this step
235
+ </div>
236
+ </div>
237
+ <% end %>
168
238
  </div>
169
239
  <% end %>
170
240
 
@@ -176,87 +246,41 @@
176
246
  </div>
177
247
  </div>
178
248
 
179
- <!-- Chat History -->
180
- <% chats_with_messages = @execution.workflow_steps.includes(chat: { messages: :tool_calls }).map(&:chat).compact.select { |c| c.messages.any? } %>
181
- <% if chats_with_messages.any? %>
249
+ <!-- Summary Chat Information -->
250
+ <% total_chats = @execution.workflow_steps.joins(:chat).distinct.count %>
251
+ <% total_messages = @execution.workflow_steps.joins(chat: :messages).count %>
252
+ <% if total_chats > 0 %>
182
253
  <div class="bg-white shadow rounded-lg">
183
254
  <div class="px-6 py-4 border-b border-gray-200">
184
- <h2 class="text-lg font-medium text-gray-900">Chat History</h2>
255
+ <h2 class="text-lg font-medium text-gray-900">Chat Summary</h2>
185
256
  <p class="mt-1 text-sm text-gray-500">
186
- Chronological view of all conversations in this execution
257
+ Overview of all chat activity in this execution
187
258
  </p>
188
259
  </div>
189
-
190
- <div class="divide-y divide-gray-200">
191
- <% chats_with_messages.each do |chat| %>
192
- <div class="px-6 py-4">
193
- <div class="mb-4">
194
- <h3 class="text-sm font-medium text-gray-900">
195
- Chat #<%= chat.id %>
196
- <span class="ml-2 text-xs text-gray-500">
197
- (<%= chat.provider %> - <%= chat.model_id %>)
198
- </span>
199
- </h3>
200
- <% if chat.user.present? %>
201
- <p class="text-xs text-gray-500">User: <%= user_display_name(chat.user) %></p>
202
- <% end %>
203
- </div>
204
-
205
- <!-- Messages -->
206
- <div class="space-y-3">
207
- <% chat.messages.order(:created_at).each do |message| %>
208
- <div class="border rounded-lg p-3 <%= message_role_badge(message.role) %>">
209
- <div class="flex items-center justify-between mb-2">
210
- <div class="flex items-center space-x-2">
211
- <span class="text-xs font-medium text-gray-900 uppercase"><%= message.role %></span>
212
- <% if message.model_id.present? %>
213
- <span class="text-xs text-gray-500">(<%= message.model_id %>)</span>
214
- <% end %>
215
- </div>
216
- <div class="text-xs text-gray-500">
217
- <%= time_with_tooltip(message.created_at) %>
218
- <% token_info = format_token_usage(message.input_tokens, message.output_tokens) %>
219
- <% if token_info.present? %>
220
- | <%= token_info %>
221
- <% end %>
222
- </div>
223
- </div>
224
-
225
- <% if message.content.present? %>
226
- <div class="text-sm text-gray-800 whitespace-pre-wrap"><%= message.content %></div>
227
- <% end %>
228
-
229
- <!-- Tool Calls -->
230
- <% if message.tool_calls.any? %>
231
- <div class="mt-3 space-y-2">
232
- <h4 class="text-xs font-medium text-gray-700">Tool Calls:</h4>
233
- <% message.tool_calls.each do |tool_call| %>
234
- <div class="bg-white border rounded p-2">
235
- <div class="flex items-center justify-between mb-1">
236
- <span class="text-xs font-medium text-gray-800"><%= tool_call.name %></span>
237
- <span class="text-xs text-gray-500">ID: <%= tool_call.tool_call_id %></span>
238
- </div>
239
- <% if tool_call.arguments.present? %>
240
- <div class="text-xs">
241
- <strong>Arguments:</strong>
242
- <%= json_display(tool_call.arguments, classes: 'bg-gray-50 p-2 rounded text-xs overflow-x-auto mt-1') %>
243
- </div>
244
- <% end %>
245
- </div>
246
- <% end %>
247
- </div>
248
- <% end %>
249
- </div>
250
- <% end %>
251
- </div>
260
+
261
+ <div class="px-6 py-4">
262
+ <dl class="grid grid-cols-1 gap-x-4 gap-y-4 sm:grid-cols-3">
263
+ <div>
264
+ <dt class="text-sm font-medium text-gray-500">Total Chats</dt>
265
+ <dd class="mt-1 text-sm text-gray-900"><%= total_chats %></dd>
266
+ </div>
267
+ <div>
268
+ <dt class="text-sm font-medium text-gray-500">Total Messages</dt>
269
+ <dd class="mt-1 text-sm text-gray-900"><%= total_messages %></dd>
270
+ </div>
271
+ <div>
272
+ <dt class="text-sm font-medium text-gray-500">Steps with Conversations</dt>
273
+ <dd class="mt-1 text-sm text-gray-900">
274
+ <%= @execution.workflow_steps.joins(:chat).joins('JOIN meta_workflows_messages ON meta_workflows_chats.id = meta_workflows_messages.chat_id').distinct.count %> / <%= @execution.workflow_steps.count %>
275
+ </dd>
252
276
  </div>
253
- <% end %>
277
+ </dl>
254
278
  </div>
255
279
  </div>
256
280
  <% else %>
257
281
  <div class="bg-white shadow rounded-lg">
258
282
  <div class="px-6 py-4 border-b border-gray-200">
259
- <h2 class="text-lg font-medium text-gray-900">Chat History</h2>
283
+ <h2 class="text-lg font-medium text-gray-900">Chat Summary</h2>
260
284
  <p class="mt-1 text-sm text-gray-500">
261
285
  No chat conversations found for this execution
262
286
  </p>
@@ -3,7 +3,7 @@
3
3
  module MetaWorkflows
4
4
  MAJOR = 0
5
5
  MINOR = 8
6
- PATCH = 17 # this is automatically incremented by the build process
6
+ PATCH = 19 # this is automatically incremented by the build process
7
7
 
8
8
  VERSION = "#{MetaWorkflows::MAJOR}.#{MetaWorkflows::MINOR}.#{MetaWorkflows::PATCH}".freeze
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meta_workflows
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.17
4
+ version: 0.8.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonid Medovyy