meta_workflows 0.7.0 → 0.8.1

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: afd80be43cbf526411e03bbf7ced8c539b12d81e82d19b2e805dc2a85045aa83
4
- data.tar.gz: 4ce850bc8e751d2271ea049724bce5ddbf82d55b9d83749e7d06cfb1d0aebb2c
3
+ metadata.gz: 40e3769944f241f922ada44ee68481751bd2becd8c287972522c179d7dbe2696
4
+ data.tar.gz: 45f4723223484bd4a5fd6fd2eedfdb4da12044b2986ac3facf2bf10df62c8671
5
5
  SHA512:
6
- metadata.gz: 4fda18b86bf518cfbace011470987b8aa6fb7d1ebbfbb8e95933498736a6792b9c90183a8e820a2868ed8a34dab8cb0a32e194f054315d6bfbbdd4f6c067feb6
7
- data.tar.gz: 45148c5baac802a9c4c330206724b4e8a867df7886a2fc984b9f5b5854a14d926336492c88c0e0f718f84a3d0b8973373f682eaf20d628929dd03d7bc4c5a9ee
6
+ metadata.gz: f36ae90ac276a1777b229d30bff8a77d4e216dc68b5b8ae7d2c407bc6692c25b1f2a5823e2607ef3825f579751bc8c8fb28874cc9f62c26fa4c209beadc7de0c
7
+ data.tar.gz: 9f17625cd21f52316b04923c87e6e7edf7ca1d651bbb7ce7b4dcce53f9e2e5b6cb67ce3acb7a40f747abf9cb46727e3a34f0f040f1075aa4b79dfbdd717c6116
data/README.md CHANGED
@@ -112,6 +112,34 @@ Or install it yourself as:
112
112
  gem install meta_workflows
113
113
  ```
114
114
 
115
+ ## Git Hooks with Overcommit
116
+
117
+ This project uses Overcommit to manage Git hooks. The hooks are configured to run various code quality and security checks before commits and pushes:
118
+
119
+ - **Pre-commit**:
120
+ - RuboCop: Checks for code style violations
121
+
122
+ - **Pre-push**:
123
+ - RuboCop: Performs a more thorough code style check
124
+ - BundleAudit: Scans for vulnerable gems
125
+ - Brakeman: Scans for security vulnerabilities
126
+
127
+ To set up the git hooks, run:
128
+
129
+ ```shell
130
+ bundle install
131
+ bundle exec rake app:git:setup_hooks
132
+ ```
133
+
134
+ If you need to bypass the hooks temporarily, you can use:
135
+
136
+ ```shell
137
+ git commit --no-verify
138
+ git push --no-verify
139
+ ```
140
+
141
+ > **Note:** While bypassing hooks can be useful in specific scenarios, we recommend fixing issues rather than bypassing checks regularly.
142
+
115
143
  ## Setup
116
144
 
117
145
  ### 1. Database Setup
@@ -496,3 +524,72 @@ For detailed information about the MetaWorkflows system:
496
524
  ## License
497
525
 
498
526
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
527
+
528
+ ## Tray System (Sidebar, Bottom, and Main Content Trays)
529
+
530
+ MetaWorkflows provides a flexible tray system for building modern, multi-pane layouts. The tray system supports left (Beta), right (Gamma), and bottom (Delta) trays, as well as a main content area (Alpha). Each tray can be shown, hidden, or made collapsible on a per-controller or per-page basis.
531
+
532
+ ### Tray Placement Overview
533
+
534
+ | Tray | Placement | Description |
535
+ |:-----:|:--------------|:--------------------------------------------|
536
+ | Beta | Left sidebar | Optional collapsible sidebar on the left |
537
+ | Alpha | Center/main | Main content area (always visible) |
538
+ | Gamma | Right sidebar | Optional collapsible sidebar on the right |
539
+ | Delta | Bottom tray | Optional collapsible tray at the bottom |
540
+
541
+ ### How It Works
542
+ - The tray system is controlled by a `TrayConfigurable` concern included in your controllers.
543
+ - By default, all trays are hidden. You must explicitly set `visible: true` for any tray you want to show.
544
+ - The engine's layout will automatically respect your tray configuration.
545
+
546
+ ### Enabling and Configuring Trays
547
+
548
+ 1. **Include the Concern in Your ApplicationController:**
549
+
550
+ ```ruby
551
+ class ApplicationController < ActionController::Base
552
+ include TrayConfigurable
553
+ before_action :configure_trays
554
+ end
555
+ ```
556
+
557
+ 2. **Override Tray Settings in Any Controller:**
558
+
559
+ ```ruby
560
+ class PostsController < ApplicationController
561
+ def configure_trays
562
+ super
563
+ tray_config[:beta][:visible] = true # Show Beta (left) tray
564
+ tray_config[:gamma][:visible] = false # Hide Gamma (right) tray
565
+ tray_config[:delta][:collapsible] = false # Make Delta (bottom) tray not collapsible
566
+ end
567
+ end
568
+ ```
569
+
570
+ 3. **Default Behavior:**
571
+ - All trays are hidden unless set to `visible: true`.
572
+ - Trays are collapsible by default; set `collapsible: false` to disable collapsing.
573
+
574
+ 4. **Layout:**
575
+ - The engine's layout (`app/views/layouts/meta_workflows/application.html.erb`) will automatically render trays based on your configuration.
576
+
577
+ ### Example: Show Only the Left Tray
578
+
579
+ ```ruby
580
+ class DashboardController < ApplicationController
581
+ def configure_trays
582
+ super
583
+ tray_config[:beta][:visible] = true
584
+ tray_config[:gamma][:visible] = false
585
+ tray_config[:delta][:visible] = false
586
+ end
587
+ end
588
+ ```
589
+
590
+ ### Notes
591
+ - The tray system is available in both the engine and the dummy app for development/testing.
592
+ - You can override tray configuration per controller or per action as needed.
593
+ - The main content area (Alpha tray) is always visible and holds your page content.
594
+
595
+ For more advanced usage or to contribute improvements, see the tray logic in `TrayConfigurable` and the engine layout file.
@@ -0,0 +1,109 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+
3
+ function getCookie(name) {
4
+ const value = `; ${document.cookie}`;
5
+ const parts = value.split(`; ${name}=`);
6
+ if (parts.length !== 2) return null;
7
+ return parts.pop().split(';').shift();
8
+ }
9
+
10
+ function setCookie(name, value) {
11
+ document.cookie = `${name}=${value}; path=/; max-age=31536000`;
12
+ }
13
+
14
+ function chevronDirection(tray, expanded) {
15
+ if (tray === "beta") return expanded ? "fa-chevron-left" : "fa-chevron-right";
16
+ if (tray === "gamma") return expanded ? "fa-chevron-right" : "fa-chevron-left";
17
+ if (tray === "delta") return expanded ? "fa-chevron-down" : "fa-chevron-up";
18
+ return "";
19
+ }
20
+
21
+ export default class extends Controller {
22
+ static values = { name: String }
23
+ static targets = ["content", "chevron"]
24
+
25
+ connect() {
26
+ // Load state from cookies
27
+ const savedState = getCookie(`tray_${this.nameValue}`);
28
+ if (savedState === "collapsed") {
29
+ this.expanded = false;
30
+ } else {
31
+ this.expanded = true;
32
+ }
33
+ this.updateTray();
34
+ // Set chevron direction from cookie if present
35
+ const chevron = this.hasChevronTarget ? this.chevronTarget : null;
36
+ if (chevron) {
37
+ const chevronCookie = getCookie(`chevron_${this.nameValue}`);
38
+ if (chevronCookie) {
39
+ chevron.classList.remove("fa-chevron-left", "fa-chevron-right", "fa-chevron-up", "fa-chevron-down");
40
+ chevron.classList.add(chevronCookie);
41
+ }
42
+ }
43
+ }
44
+
45
+ toggle() {
46
+ this.expanded = !this.expanded;
47
+ // Save state to cookies
48
+ setCookie(`tray_${this.nameValue}`, this.expanded ? "expanded" : "collapsed");
49
+ // Save chevron direction to cookies
50
+ setCookie(`chevron_${this.nameValue}`, chevronDirection(this.nameValue, this.expanded));
51
+ this.updateTray();
52
+ }
53
+
54
+ updateTray() {
55
+ // Only update chevron if it exists (tray is collapsible)
56
+ const hasChevron = this.hasChevronTarget;
57
+ if (this.nameValue === "delta") {
58
+ if (this.expanded) {
59
+ this.element.classList.remove("collapsed");
60
+ this.element.classList.add("h-[200px]");
61
+ if (hasChevron) {
62
+ this.chevronTarget.classList.remove("fa-chevron-up");
63
+ this.chevronTarget.classList.add("fa-chevron-down");
64
+ }
65
+ } else {
66
+ this.element.classList.remove("h-[200px]");
67
+ this.element.classList.add("collapsed");
68
+ if (hasChevron) {
69
+ this.chevronTarget.classList.remove("fa-chevron-down");
70
+ this.chevronTarget.classList.add("fa-chevron-up");
71
+ }
72
+ }
73
+ } else if (this.nameValue === "beta") {
74
+ // Beta: open=left, collapsed=right
75
+ if (this.expanded) {
76
+ this.element.classList.remove("collapsed");
77
+ this.element.classList.add("w-[300px]");
78
+ if (hasChevron) {
79
+ this.chevronTarget.classList.remove("fa-chevron-right");
80
+ this.chevronTarget.classList.add("fa-chevron-left");
81
+ }
82
+ } else {
83
+ this.element.classList.remove("w-[300px]");
84
+ this.element.classList.add("collapsed");
85
+ if (hasChevron) {
86
+ this.chevronTarget.classList.remove("fa-chevron-left");
87
+ this.chevronTarget.classList.add("fa-chevron-right");
88
+ }
89
+ }
90
+ } else if (this.nameValue === "gamma") {
91
+ // Gamma: open=right, collapsed=left
92
+ if (this.expanded) {
93
+ this.element.classList.remove("collapsed");
94
+ this.element.classList.add("w-[300px]");
95
+ if (hasChevron) {
96
+ this.chevronTarget.classList.remove("fa-chevron-left");
97
+ this.chevronTarget.classList.add("fa-chevron-right");
98
+ }
99
+ } else {
100
+ this.element.classList.remove("w-[300px]");
101
+ this.element.classList.add("collapsed");
102
+ if (hasChevron) {
103
+ this.chevronTarget.classList.remove("fa-chevron-right");
104
+ this.chevronTarget.classList.add("fa-chevron-left");
105
+ }
106
+ }
107
+ }
108
+ }
109
+ }
@@ -158,4 +158,61 @@
158
158
  em {
159
159
  font-style: italic;
160
160
  }
161
- }
161
+ }
162
+
163
+ /* Tray Animations */
164
+ .tray-container {
165
+ transition: all 500ms ease-in-out;
166
+ }
167
+
168
+ /* Beta Tray (Left) */
169
+ .beta-tray {
170
+ transition: width 500ms ease-in-out;
171
+ }
172
+
173
+ .beta-tray.collapsed {
174
+ width: 70px;
175
+ }
176
+
177
+ .beta-tray.collapsed .tray-content {
178
+ opacity: 0;
179
+ transform: translateX(1rem);
180
+ pointer-events: none;
181
+ }
182
+
183
+ /* Gamma Tray (Right) */
184
+ .gamma-tray {
185
+ transition: width 500ms ease-in-out;
186
+ }
187
+
188
+ .gamma-tray.collapsed {
189
+ width: 70px;
190
+ }
191
+
192
+ .gamma-tray.collapsed .tray-content {
193
+ opacity: 0;
194
+ transform: translateX(-1rem);
195
+ pointer-events: none;
196
+ }
197
+
198
+ /* Delta Tray (Bottom) */
199
+ .delta-tray {
200
+ transition: height 500ms ease-in-out;
201
+ }
202
+
203
+ .delta-tray.collapsed {
204
+ height: 50px;
205
+ }
206
+
207
+ .delta-tray.collapsed .tray-content {
208
+ opacity: 0;
209
+ transform: translateY(1rem);
210
+ pointer-events: none;
211
+ }
212
+
213
+ /* Common content transitions */
214
+ .tray-content {
215
+ transition: opacity 500ms ease-in-out, transform 500ms ease-in-out;
216
+ opacity: 1;
217
+ transform: translate(0);
218
+ }
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TrayConfigurable
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ helper_method :tray_config
8
+ end
9
+
10
+ def tray_config
11
+ @tray_config ||= {
12
+ beta: {
13
+ visible: false,
14
+ collapsible: true
15
+ },
16
+ gamma: {
17
+ visible: false,
18
+ collapsible: true
19
+ },
20
+ delta: {
21
+ visible: false,
22
+ collapsible: true
23
+ }
24
+ }
25
+ end
26
+
27
+ # Override in controllers to customize tray configuration
28
+ def configure_trays
29
+ # Example:
30
+ # tray_config[:beta][:visible] = true
31
+ # tray_config[:gamma][:collapsible] = false
32
+ end
33
+ end
@@ -4,6 +4,15 @@ module MetaWorkflows
4
4
  class ApplicationController < ActionController::Base
5
5
  protect_from_forgery with: :exception
6
6
 
7
+ include TrayConfigurable
8
+ before_action :configure_trays
9
+
10
+ def configure_trays
11
+ super
12
+ tray_config[:beta][:visible] = false
13
+ tray_config[:gamma][:visible] = false
14
+ tray_config[:delta][:visible] = false
15
+ end
7
16
  # Add any MetaWorkflows-specific controller functionality here
8
17
  # This ensures proper engine isolation
9
18
  end
@@ -37,5 +37,23 @@ module MetaWorkflows
37
37
  'Happy with this, or want changes?'
38
38
  ].sample
39
39
  end
40
+
41
+ def tray_state(tray)
42
+ (cookies['tray_'] && cookies['tray_'][tray.to_s]) || cookies["tray_#{tray}"] || 'expanded'
43
+ end
44
+
45
+ def chevron_direction(tray)
46
+ state = tray_state(tray)
47
+ case tray.to_s
48
+ when 'beta'
49
+ state == 'collapsed' ? 'fa-chevron-right' : 'fa-chevron-left'
50
+ when 'gamma'
51
+ state == 'collapsed' ? 'fa-chevron-left' : 'fa-chevron-right'
52
+ when 'delta'
53
+ state == 'collapsed' ? 'fa-chevron-up' : 'fa-chevron-down'
54
+ else
55
+ ''
56
+ end
57
+ end
40
58
  end
41
59
  end
@@ -1,17 +1,16 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
- <head>
4
- <title>Meta workflows</title>
5
- <%= csrf_meta_tags %>
6
- <%= csp_meta_tag %>
3
+ <head>
4
+ <title>Meta Workflows</title>
5
+ <%= csrf_meta_tags %>
6
+ <%= csp_meta_tag %>
7
7
 
8
- <%= yield :head %>
8
+ <%= stylesheet_link_tag "meta_workflows/application", media: "all" %>
9
+ <%= javascript_include_tag "meta_workflows/application" %>
10
+ </head>
9
11
 
10
- <%= stylesheet_link_tag "meta_workflows/application", media: "all" %>
11
- </head>
12
- <body>
13
-
14
- <%= yield %>
15
-
16
- </body>
12
+ <body>
13
+ <%= render 'layouts/meta_workflows/flash' %>
14
+ <%= yield %>
15
+ </body>
17
16
  </html>
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class AddErrorFieldsToWorkflowSteps < ActiveRecord::Migration[7.2]
2
4
  def change
3
5
  add_column :meta_workflows_workflow_steps, :error_message, :text
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddCallIdAndStatusToMetaWorkflowsToolCalls < ActiveRecord::Migration[7.2]
4
+ def change
5
+ add_column :meta_workflows_tool_calls, :call_id, :string
6
+ add_column :meta_workflows_tool_calls, :status, :string
7
+ end
8
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MetaWorkflows
4
- VERSION = '0.7.0'
4
+ VERSION = '0.8.1'
5
5
  end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :git do
4
+ desc 'Set up git hooks using Overcommit'
5
+ task setup_hooks: :environment do
6
+ puts 'Setting up git hooks with Overcommit...'
7
+
8
+ system('bundle exec overcommit --install') || abort('Failed to install Overcommit hooks')
9
+ system('bundle exec overcommit --sign') || abort('Failed to sign Overcommit hooks')
10
+ puts 'Git hooks have been set up successfully!'
11
+ end
12
+ 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.7.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonid Medovyy
@@ -9,28 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-06-16 00:00:00.000000000 Z
12
+ date: 2025-06-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
20
  version: 7.2.0
21
- - - "<"
22
- - !ruby/object:Gem::Version
23
- version: '9.0'
24
21
  type: :runtime
25
22
  prerelease: false
26
23
  version_requirements: !ruby/object:Gem::Requirement
27
24
  requirements:
28
- - - ">="
25
+ - - "~>"
29
26
  - !ruby/object:Gem::Version
30
27
  version: 7.2.0
31
- - - "<"
32
- - !ruby/object:Gem::Version
33
- version: '9.0'
34
28
  - !ruby/object:Gem::Dependency
35
29
  name: sidekiq
36
30
  requirement: !ruby/object:Gem::Requirement
@@ -131,8 +125,10 @@ files:
131
125
  - app/assets/javascripts/meta_workflows/controllers/loading_phrases_controller.js
132
126
  - app/assets/javascripts/meta_workflows/controllers/redirect_controller.js
133
127
  - app/assets/javascripts/meta_workflows/controllers/response_scroll_controller.js
128
+ - app/assets/javascripts/meta_workflows/controllers/tray_controller.js
134
129
  - app/assets/javascripts/meta_workflows_manifest.js
135
130
  - app/assets/stylesheets/meta_workflows/application.css
131
+ - app/controllers/concerns/tray_configurable.rb
136
132
  - app/controllers/meta_workflows/application_controller.rb
137
133
  - app/controllers/meta_workflows/debug_controller.rb
138
134
  - app/controllers/meta_workflows/humans_controller.rb
@@ -177,6 +173,7 @@ files:
177
173
  - db/migrate/20250530220737_create_meta_workflows_tool_calls.rb
178
174
  - db/migrate/20250530220750_create_meta_workflows_workflow_steps.rb
179
175
  - db/migrate/20250613213159_add_error_fields_to_workflow_steps.rb
176
+ - db/migrate/20250618175439_add_call_id_and_status_to_meta_workflows_tool_calls.rb
180
177
  - lib/meta_workflows.rb
181
178
  - lib/meta_workflows/asset_installer.rb
182
179
  - lib/meta_workflows/configuration.rb
@@ -186,16 +183,17 @@ files:
186
183
  - lib/services/meta_workflows/application_service.rb
187
184
  - lib/services/meta_workflows/meta_workflow_service.rb
188
185
  - lib/services/meta_workflows/updaters/meta_service.rb
186
+ - lib/tasks/git_hooks.rake
189
187
  - lib/tasks/meta_workflows_tasks.rake
190
- homepage: https://github.com/strongmind/meta_workflows
188
+ homepage: https://github.com/strongmind/meta-workflows
191
189
  licenses:
192
190
  - None
193
191
  metadata:
194
192
  allowed_push_host: https://rubygems.org
195
- homepage_uri: https://github.com/strongmind/meta_workflows
196
- source_code_uri: https://github.com/strongmind/meta_workflows
197
- changelog_uri: https://github.com/strongmind/meta_workflows/blob/main/CHANGELOG.md
198
- documentation_uri: https://github.com/strongmind/meta_workflows/blob/main/README.md
193
+ homepage_uri: https://github.com/strongmind/meta-workflows
194
+ source_code_uri: https://github.com/strongmind/meta-workflows
195
+ changelog_uri: https://github.com/strongmind/meta-workflows/blob/main/CHANGELOG.md
196
+ documentation_uri: https://github.com/strongmind/meta-workflows/blob/main/README.md
199
197
  rubygems_mfa_required: 'true'
200
198
  post_install_message:
201
199
  rdoc_options: []
@@ -212,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
210
  - !ruby/object:Gem::Version
213
211
  version: '0'
214
212
  requirements: []
215
- rubygems_version: 3.5.3
213
+ rubygems_version: 3.4.19
216
214
  signing_key:
217
215
  specification_version: 4
218
216
  summary: A Rails engine for managing AI-powered meta workflows