meta_workflows 0.9.15 → 0.9.16

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: a869293f98a7a997feb4c8c20173c25c85101ed225713e0a7080b40b45048771
4
- data.tar.gz: 7edc0a1e0bde4bbe02c60b6e0244253e055047684a9a793235ba858886451706
3
+ metadata.gz: bf87bca0ce45dc8b835c415c61203e0678cdb8a66e8668cb9997e12b76a9a164
4
+ data.tar.gz: 19c97c95dfecc3260c7869983c7281a498f623eac0e0636f50ada1e0a25eec70
5
5
  SHA512:
6
- metadata.gz: 2b2768f55196fec5a94c8f83810563d7ac46625af7a9953e6aeb6f0fd1c6478bfe402c577f3f9076e93be1bbfc26a38834c27c94a39d937de56dd52b938ee332
7
- data.tar.gz: 6b1f0065875d24435071cbaa15fcda4f3683c1d2e719415949c3001aa6aa33f6c9d841ba870835ae083d2c5df145082f4b70077141690eb8588eb09b793b50b3
6
+ metadata.gz: e4009226f5d3cd1bafb0d676a29ba21fcd4e181208e20801fab0a892cf50bae9bdb9df895c8d9b3cb919170193dae295d482bb9c67c357efda1d2c8f8f2ef430
7
+ data.tar.gz: 7af79ba6d4d8469e36e9be797abaafe8c1f0262e8fc90457ef1cd862a146a846ad455ef56cf3b442f195ddb6db98240af1dcbd1e6e8ed8f53444b48b1edc1f69
data/README.md CHANGED
@@ -233,10 +233,7 @@ steps:
233
233
  action: "agent"
234
234
  prompt_id: "generation_prompt"
235
235
  model: "your-preferred-model-id" # Use appropriate model from RubyLLM documentation
236
- step_progress:
237
- - "Analyzing input parameters..."
238
- - "Generating initial content..."
239
- - "Refining results..."
236
+ step_progress: ["Analyzing input parameters", "Generating initial content", "Refining results"]
240
237
  input:
241
238
  title:
242
239
  type: "string"
@@ -250,8 +247,7 @@ steps:
250
247
  - name: "human_review"
251
248
  action: "human"
252
249
  prompt_id: "review_prompt"
253
- step_progress:
254
- - "Preparing content for review..."
250
+ step_progress: ["Preparing content for review"]
255
251
  input:
256
252
  generated_content:
257
253
  type: "string"
@@ -267,9 +263,7 @@ steps:
267
263
  attributes_to_update:
268
264
  - "title"
269
265
  - "topic"
270
- step_progress:
271
- - "Updating record..."
272
- - "Saving changes..."
266
+ step_progress: ["Updating record", "Saving changes"]
273
267
  workflow_params:
274
268
  - name: "title"
275
269
  type: string
@@ -307,27 +301,87 @@ end
307
301
 
308
302
  ### Using Meta Workflow UI Components
309
303
 
310
- Instead of creating custom views from scratch, use the provided Meta Workflow partials:
304
+ Instead of creating custom views from scratch, use the provided Meta Workflow partials. The system now uses in-chat messaging for loader states and error handling, providing a seamless conversational experience:
305
+
306
+ #### Chat-Based UI Components
307
+
308
+ The workflow UI now consists of three main components:
309
+
310
+ 1. **Chat Messages (`meta_response`)**: Displays conversation history and responses
311
+ 2. **Loader Messages (`meta_loader_message`)**: Shows loading states as chat messages
312
+ 3. **Error Messages (`meta_error_message`)**: Displays errors as friendly chat messages
313
+ 4. **Response Form (`meta_response_form`)**: Handles user input during human interaction steps
311
314
 
312
315
  #### Complete View Example
313
316
 
314
317
  ```erb
315
318
  <%= turbo_stream_from turbo_stream_name(@record) %>
316
319
  <div class="max-w-3xl m-auto flex flex-col p-10 gap-6">
317
- <!-- Workflow progress and chat messages area -->
318
- <%= render partial: 'meta_workflows/loader', locals: {
320
+ <!-- Chat messages area with existing conversation -->
321
+ <%= render partial: 'meta_workflows/response_lexi', locals: {
319
322
  record: @record,
320
- step_progress: ["Generating draft content...", "Processing with AI..."]
323
+ chat: @active_chat,
324
+ messages: @active_chat&.messages&.order(:created_at) || [],
325
+ user_messages: @active_chat&.messages&.where(role: 'user')&.order(:created_at) || [],
326
+ last_message: @active_chat&.messages&.last,
327
+ full_response: nil,
328
+ is_streaming: false
321
329
  } %>
322
330
 
323
331
  <!-- User input area for human interaction steps -->
324
332
  <%= render partial: 'meta_workflows/response_form', locals: {
325
333
  record: @record,
326
- response_enabled: false
334
+ response_enabled: true,
335
+ workflow_execution_id: @workflow_execution&.id,
336
+ chat_id: @active_chat&.id,
337
+ step_has_repetitions: true
327
338
  } %>
328
339
  </div>
329
340
  ```
330
341
 
342
+ #### Built-in Chat Tray Components
343
+
344
+ For a complete chat experience, use the pre-built chat tray components:
345
+
346
+ **Right Tray (Gamma) - Sidebar Chat:**
347
+ ```erb
348
+ <%= render partial: 'meta_workflows/lexi_chat_right_tray', locals: {
349
+ record: @record
350
+ } %>
351
+ ```
352
+
353
+ **Alpha Tray (Main) - Full-Screen Chat:**
354
+ ```erb
355
+ <%= render partial: 'meta_workflows/lexi_chat_alpha_tray', locals: {
356
+ record: @record
357
+ } %>
358
+ ```
359
+
360
+ #### Individual Component Usage
361
+
362
+ **Loader Message (appears as chat message):**
363
+ ```erb
364
+ <%= render partial: 'meta_workflows/loader_message', locals: {
365
+ record: @record,
366
+ step_progress: ["Generating content", "Processing with AI", "Finalizing results"]
367
+ } %>
368
+ ```
369
+
370
+ **Error Message (appears as chat message):**
371
+ ```erb
372
+ <%= render partial: 'meta_workflows/error_message', locals: {
373
+ record: @record
374
+ } %>
375
+ ```
376
+
377
+ #### Key Features
378
+
379
+ - **In-Chat Loading**: Loader messages appear as animated chat bubbles from the assistant
380
+ - **Friendly Error Messages**: Errors display as conversational messages with friendly styling
381
+ - **Seamless Integration**: Chat history persists while new interactions are processed
382
+ - **Responsive Design**: Components adapt to different tray layouts (sidebar, main, bottom)
383
+ - **Turbo Stream Updates**: Real-time updates without page refreshes using dedicated frame targeting
384
+
331
385
  ## File Structure Overview
332
386
 
333
387
  The MetaWorkflows gem follows a structured organization:
@@ -478,7 +532,7 @@ To add a new action type:
478
532
  ### Workflow Design
479
533
  - Keep steps focused and single-purpose
480
534
  - Design clear input/output schemas
481
- - Provide meaningful progress messages
535
+ - Provide meaningful progress messages without ellipsis (the loader UI handles animated dots automatically)
482
536
  - Handle error cases gracefully
483
537
  - Use `record_update` steps to persist intermediate workflow results
484
538
  - Choose appropriate AI models for each step based on task complexity and cost considerations
@@ -3,7 +3,7 @@
3
3
  module MetaWorkflows
4
4
  MAJOR = 0
5
5
  MINOR = 9
6
- PATCH = 15 # this is automatically incremented by the build process
6
+ PATCH = 16 # 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.9.15
4
+ version: 0.9.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonid Medovyy