layered-assistant-rails 0.4.0 → 0.4.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 +4 -4
- data/AGENTS.md +3 -4
- data/README.md +1 -3
- data/app/views/layered/assistant/assistants/edit.html.erb +4 -4
- data/app/views/layered/assistant/assistants/index.html.erb +2 -3
- data/app/views/layered/assistant/assistants/new.html.erb +4 -4
- data/app/views/layered/assistant/conversations/edit.html.erb +4 -4
- data/app/views/layered/assistant/conversations/index.html.erb +6 -9
- data/app/views/layered/assistant/conversations/new.html.erb +4 -4
- data/app/views/layered/assistant/messages/index.html.erb +4 -4
- data/app/views/layered/assistant/models/edit.html.erb +7 -4
- data/app/views/layered/assistant/models/index.html.erb +6 -7
- data/app/views/layered/assistant/models/new.html.erb +7 -4
- data/app/views/layered/assistant/personas/edit.html.erb +5 -1
- data/app/views/layered/assistant/personas/index.html.erb +2 -3
- data/app/views/layered/assistant/personas/new.html.erb +5 -1
- data/app/views/layered/assistant/providers/edit.html.erb +4 -4
- data/app/views/layered/assistant/providers/index.html.erb +2 -3
- data/app/views/layered/assistant/providers/new.html.erb +4 -4
- data/app/views/layered/assistant/public/assistants/index.html.erb +1 -1
- data/app/views/layered/assistant/setup/index.html.erb +2 -1
- data/app/views/layered/assistant/skills/edit.html.erb +5 -1
- data/app/views/layered/assistant/skills/index.html.erb +2 -3
- data/app/views/layered/assistant/skills/new.html.erb +5 -1
- data/lib/generators/layered/assistant/install_generator.rb +0 -32
- data/lib/layered/assistant/version.rb +1 -1
- metadata +5 -7
- data/app/assets/tailwind/layered/assistant/styles.css +0 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '07081dd0ae8adfb43bf4bbfcdb5ae6925faa1d31a196762bec9d52efd5a28d11'
|
|
4
|
+
data.tar.gz: 305c23332a9a6e41aa5b8e3814565a4be3c0ea9c25a44aa4103c35b2d8e79d42
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b148483c047879c248db3d9275c4f8033ca294cc0d5b575b3ac2960c56b78a854ca444894b4d4e59b03279e4fee10712656fc758ef29fadc66f85cfd58254311
|
|
7
|
+
data.tar.gz: eae3bd16f81cb0542c7e32e7ce332f08027fb24bf5c7241258f5f6c7034e7ef60886dd16871f5de15986c371a9b38d949ad23fc3709de2397df71a1987c6efc8
|
data/AGENTS.md
CHANGED
|
@@ -4,7 +4,7 @@ This file provides guidance to AI agents when working with code in this reposito
|
|
|
4
4
|
|
|
5
5
|
## Project Overview
|
|
6
6
|
|
|
7
|
-
**layered-assistant-rails** is a Rails 8+ engine gem (`Layered::Assistant`) providing AI assistant UI components. It uses `isolate_namespace Layered::Assistant` and distributes
|
|
7
|
+
**layered-assistant-rails** is a Rails 8+ engine gem (`Layered::Assistant`) providing AI assistant UI components. It uses `isolate_namespace Layered::Assistant` and distributes JS (importmap) to host applications via a generator.
|
|
8
8
|
|
|
9
9
|
Requires Rails >= 8.0.0, Ruby >= 3.2.0. Depends on sibling gem `layered-ui-rails` (path dependency at `../layered-ui-rails`).
|
|
10
10
|
|
|
@@ -18,12 +18,11 @@ Requires Rails >= 8.0.0, Ruby >= 3.2.0. Depends on sibling gem `layered-ui-rails
|
|
|
18
18
|
|
|
19
19
|
### Asset Distribution
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
JS is authored in the engine and delivered to host apps:
|
|
22
22
|
|
|
23
|
-
- **CSS**: `app/assets/tailwind/layered/assistant/styles.css` — copied to host app by the install generator
|
|
24
23
|
- **JS**: `app/javascript/layered_assistant/index.js` — pinned via `config/importmap.rb`, made available through engine initializer
|
|
25
24
|
|
|
26
|
-
The install generator (`lib/generators/layered/assistant/install_generator.rb`) verifies `layered-ui-rails` is installed first, then
|
|
25
|
+
The install generator (`lib/generators/layered/assistant/install_generator.rb`) verifies `layered-ui-rails` is installed first, then injects the JS import line into `application.js`.
|
|
27
26
|
|
|
28
27
|
### Test Harness
|
|
29
28
|
|
data/README.md
CHANGED
|
@@ -33,7 +33,7 @@ bundle install
|
|
|
33
33
|
|
|
34
34
|
### Install generator
|
|
35
35
|
|
|
36
|
-
Run the install generator to
|
|
36
|
+
Run the install generator to register imports and mount the engine:
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
39
|
bin/rails generate layered:assistant:install
|
|
@@ -43,8 +43,6 @@ This will:
|
|
|
43
43
|
- Copy `layered_ui.css` to `app/assets/tailwind/`
|
|
44
44
|
- Add `@import "./layered_ui";` to your `application.css`
|
|
45
45
|
- Add `import "layered_ui"` to your `application.js`
|
|
46
|
-
- Copy `layered_assistant.css` to `app/assets/tailwind/layered_assistant.css`
|
|
47
|
-
- Add `@import "./layered_assistant";` to your `app/assets/tailwind/application.css` (after the layered-ui import)
|
|
48
46
|
- Add `import "layered_assistant"` to your `app/javascript/application.js` (after the layered-ui import)
|
|
49
47
|
- Mount the engine at `/layered/assistant` in your `config/routes.rb`
|
|
50
48
|
- Copy engine migrations into your application
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<%= l_ui_title_bar(
|
|
2
|
+
title: "Edit assistant",
|
|
3
|
+
breadcrumbs: [["Assistants", layered_assistant.assistants_path]]
|
|
4
|
+
) %>
|
|
5
5
|
|
|
6
6
|
<%= render "form", assistant: @assistant, url: layered_assistant.assistant_path(@assistant) %>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
<h1>Assistants</h1>
|
|
1
|
+
<%= l_ui_title_bar(title: "Assistants") do %>
|
|
3
2
|
<%= link_to "New", layered_assistant.new_assistant_path, class: "l-ui-button--primary" %>
|
|
4
|
-
|
|
3
|
+
<% end %>
|
|
5
4
|
|
|
6
5
|
<div class="l-ui-container--table l-ui-utility--mt-lg">
|
|
7
6
|
<table class="l-ui-table">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<%= l_ui_title_bar(
|
|
2
|
+
title: "New assistant",
|
|
3
|
+
breadcrumbs: [["Assistants", layered_assistant.assistants_path]]
|
|
4
|
+
) %>
|
|
5
5
|
|
|
6
6
|
<%= render "form", assistant: @assistant, url: layered_assistant.assistants_path %>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<%= l_ui_title_bar(
|
|
2
|
+
title: "Edit conversation",
|
|
3
|
+
breadcrumbs: [["Conversations", layered_assistant.conversations_path]]
|
|
4
|
+
) %>
|
|
5
5
|
|
|
6
6
|
<%= render "form", conversation: @conversation, url: layered_assistant.conversation_path(@conversation) %>
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<%= link_to "New", layered_assistant.new_conversation_path(conversation: @assistant ? { assistant_id: @assistant.id } : {}), class: "l-ui-button--primary" %>
|
|
8
|
-
</div>
|
|
9
|
-
</div>
|
|
1
|
+
<%= l_ui_title_bar(
|
|
2
|
+
title: @assistant ? "Conversations - #{@assistant.name}" : "Conversations",
|
|
3
|
+
breadcrumbs: @assistant ? [["Assistants", layered_assistant.assistants_path]] : []
|
|
4
|
+
) do %>
|
|
5
|
+
<%= link_to "New", layered_assistant.new_conversation_path(conversation: @assistant ? { assistant_id: @assistant.id } : {}), class: "l-ui-button--primary" %>
|
|
6
|
+
<% end %>
|
|
10
7
|
|
|
11
8
|
<div class="l-ui-container--table l-ui-utility--mt-lg">
|
|
12
9
|
<table class="l-ui-table">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<%= l_ui_title_bar(
|
|
2
|
+
title: "New conversation",
|
|
3
|
+
breadcrumbs: [["Conversations", layered_assistant.conversations_path]]
|
|
4
|
+
) %>
|
|
5
5
|
|
|
6
6
|
<%= render "form", conversation: @conversation, url: layered_assistant.conversations_path %>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<%= l_ui_title_bar(
|
|
2
|
+
title: "Messages",
|
|
3
|
+
breadcrumbs: [["Conversations", layered_assistant.conversations_path]]
|
|
4
|
+
) %>
|
|
5
5
|
|
|
6
6
|
<div class="l-ui-container--table l-ui-utility--mt-lg">
|
|
7
7
|
<table class="l-ui-table">
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<%= l_ui_title_bar(
|
|
2
|
+
title: "Edit model",
|
|
3
|
+
breadcrumbs: [
|
|
4
|
+
["Providers", layered_assistant.providers_path],
|
|
5
|
+
["Models", layered_assistant.provider_models_path(@provider)]
|
|
6
|
+
]
|
|
7
|
+
) %>
|
|
5
8
|
|
|
6
9
|
<%= render "form", model: @model, url: layered_assistant.provider_model_path(@provider, @model) %>
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
</div>
|
|
1
|
+
<%= l_ui_title_bar(
|
|
2
|
+
title: "Models",
|
|
3
|
+
breadcrumbs: [["Providers", layered_assistant.providers_path]]
|
|
4
|
+
) do %>
|
|
5
|
+
<%= link_to "New", layered_assistant.new_provider_model_path(@provider), class: "l-ui-button--primary" %>
|
|
6
|
+
<% end %>
|
|
8
7
|
|
|
9
8
|
<div class="l-ui-container--table l-ui-utility--mt-lg">
|
|
10
9
|
<table class="l-ui-table">
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<%= l_ui_title_bar(
|
|
2
|
+
title: "New model",
|
|
3
|
+
breadcrumbs: [
|
|
4
|
+
["Providers", layered_assistant.providers_path],
|
|
5
|
+
["Models", layered_assistant.provider_models_path(@provider)]
|
|
6
|
+
]
|
|
7
|
+
) %>
|
|
5
8
|
|
|
6
9
|
<%= render "form", model: @model, url: layered_assistant.provider_models_path(@provider) %>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
<h1>Personas</h1>
|
|
1
|
+
<%= l_ui_title_bar(title: "Personas") do %>
|
|
3
2
|
<%= link_to "New", layered_assistant.new_persona_path, class: "l-ui-button--primary" %>
|
|
4
|
-
|
|
3
|
+
<% end %>
|
|
5
4
|
|
|
6
5
|
<div class="l-ui-container--table l-ui-utility--mt-lg">
|
|
7
6
|
<table class="l-ui-table">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<%= l_ui_title_bar(
|
|
2
|
+
title: "Edit provider",
|
|
3
|
+
breadcrumbs: [["Providers", layered_assistant.providers_path]]
|
|
4
|
+
) %>
|
|
5
5
|
|
|
6
6
|
<%= render "form", provider: @provider, url: layered_assistant.provider_path(@provider) %>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
<h1>Providers</h1>
|
|
1
|
+
<%= l_ui_title_bar(title: "Providers") do %>
|
|
3
2
|
<%= link_to "New", layered_assistant.new_provider_path, class: "l-ui-button--primary" %>
|
|
4
|
-
|
|
3
|
+
<% end %>
|
|
5
4
|
|
|
6
5
|
<div class="l-ui-container--table l-ui-utility--mt-lg">
|
|
7
6
|
<table class="l-ui-table">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<%= l_ui_title_bar(
|
|
2
|
+
title: "New provider",
|
|
3
|
+
breadcrumbs: [["Providers", layered_assistant.providers_path]]
|
|
4
|
+
) %>
|
|
5
5
|
|
|
6
6
|
<%= render "form", provider: @provider, url: layered_assistant.providers_path %>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
<h1>Skills</h1>
|
|
1
|
+
<%= l_ui_title_bar(title: "Skills") do %>
|
|
3
2
|
<%= link_to "New", layered_assistant.new_skill_path, class: "l-ui-button--primary" %>
|
|
4
|
-
|
|
3
|
+
<% end %>
|
|
5
4
|
|
|
6
5
|
<div class="l-ui-container--table l-ui-utility--mt-lg">
|
|
7
6
|
<table class="l-ui-table">
|
|
@@ -21,38 +21,6 @@ module Layered
|
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
def copy_css
|
|
25
|
-
source_path = File.join(self.class.source_root, "app/assets/tailwind/layered/assistant/styles.css")
|
|
26
|
-
source_content = File.read(source_path)
|
|
27
|
-
|
|
28
|
-
header = <<~CSS
|
|
29
|
-
/*
|
|
30
|
-
* layered-assistant-rails v#{Layered::Assistant::VERSION}
|
|
31
|
-
*
|
|
32
|
-
* This file was automatically generated by the layered:assistant:install generator.
|
|
33
|
-
* Do not modify directly. To update, re-run: bin/rails generate layered:assistant:install
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
CSS
|
|
37
|
-
|
|
38
|
-
create_file "app/assets/tailwind/layered_assistant.css", header + source_content, force: true
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def add_css_import
|
|
42
|
-
application_css = "app/assets/tailwind/application.css"
|
|
43
|
-
|
|
44
|
-
return unless File.exist?(application_css)
|
|
45
|
-
|
|
46
|
-
content = File.read(application_css)
|
|
47
|
-
import_line = '@import "./layered_assistant";'
|
|
48
|
-
|
|
49
|
-
return if content.match?(%r{@import\s+['"]\.?/?layered_assistant['"]})
|
|
50
|
-
|
|
51
|
-
# Insert after the layered_ui import (which must already be present)
|
|
52
|
-
inject_into_file application_css, "\n#{import_line}", after: %r{@import\s+['"]\.?/?layered_ui['"];?}
|
|
53
|
-
say "Added import to #{application_css}", :green
|
|
54
|
-
end
|
|
55
|
-
|
|
56
24
|
def add_js_import
|
|
57
25
|
application_js = "app/javascript/application.js"
|
|
58
26
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: layered-assistant-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- layered.ai
|
|
@@ -113,14 +113,14 @@ dependencies:
|
|
|
113
113
|
requirements:
|
|
114
114
|
- - "~>"
|
|
115
115
|
- !ruby/object:Gem::Version
|
|
116
|
-
version: '0.
|
|
116
|
+
version: '0.9'
|
|
117
117
|
type: :runtime
|
|
118
118
|
prerelease: false
|
|
119
119
|
version_requirements: !ruby/object:Gem::Requirement
|
|
120
120
|
requirements:
|
|
121
121
|
- - "~>"
|
|
122
122
|
- !ruby/object:Gem::Version
|
|
123
|
-
version: '0.
|
|
123
|
+
version: '0.9'
|
|
124
124
|
- !ruby/object:Gem::Dependency
|
|
125
125
|
name: propshaft
|
|
126
126
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -302,7 +302,6 @@ files:
|
|
|
302
302
|
- NOTICE
|
|
303
303
|
- README.md
|
|
304
304
|
- Rakefile
|
|
305
|
-
- app/assets/tailwind/layered/assistant/styles.css
|
|
306
305
|
- app/controllers/concerns/layered/assistant/message_creation.rb
|
|
307
306
|
- app/controllers/concerns/layered/assistant/public/session_conversations.rb
|
|
308
307
|
- app/controllers/concerns/layered/assistant/stoppable_response.rb
|
|
@@ -440,10 +439,9 @@ post_install_message: |
|
|
|
440
439
|
bin/rails generate layered:assistant:install
|
|
441
440
|
|
|
442
441
|
This command will:
|
|
443
|
-
• Copy the layered assistant CSS to your host app at app/assets/tailwind/layered_assistant.css
|
|
444
|
-
• This approach ensures the CSS is processed with your host app's Tailwind configuration
|
|
445
|
-
• Add an import statement to your app/assets/tailwind/application.css
|
|
446
442
|
• Add `import "layered_assistant"` to your app/javascript/application.js (just after `import "layered_ui"`, which must already be present)
|
|
443
|
+
• Mount the engine at /layered/assistant in your config/routes.rb
|
|
444
|
+
• Create a starter initialiser at config/initializers/layered_assistant.rb
|
|
447
445
|
• Copy engine migrations to your app's db/migrate/
|
|
448
446
|
|
|
449
447
|
If these imports already exist, they will not be duplicated.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* CSS Formatting Convention
|
|
3
|
-
*
|
|
4
|
-
* All @apply directives use multi-line formatting with logical grouping:
|
|
5
|
-
* 1. Layout (flex, block, fixed, relative, etc.)
|
|
6
|
-
* 2. Spacing (padding, margin, gap, width, height)
|
|
7
|
-
* 3. Typography (text, font)
|
|
8
|
-
* 4. Colors (bg, text, border)
|
|
9
|
-
* 5. Effects (hover, transitions, shadows, etc.)
|
|
10
|
-
*
|
|
11
|
-
* Single-utility classes may remain on one line for brevity.
|
|
12
|
-
* This structure improves readability, maintainability, and makes diffs easier to review.
|
|
13
|
-
*/
|