rubyllm-observ 0.6.0 → 0.6.2
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/README.md +2 -2
- data/app/views/layouts/observ/application.html.erb +1 -1
- data/lib/generators/observ/install/install_generator.rb +61 -9
- data/lib/generators/observ/install/templates/observ.js +19 -0
- data/lib/generators/observ/install_chat/install_chat_generator.rb +0 -10
- data/lib/observ/version.rb +1 -1
- metadata +2 -3
- data/app/assets/javascripts/observ/controllers/index.js +0 -52
- data/lib/generators/observ/install_chat/templates/views/messages/_content.html.erb.tt +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b4e9b6c9cbdff527ab0b271d85641c9d0ff4ebaf77cc08da9c11111c3fb6538d
|
|
4
|
+
data.tar.gz: 30de5275f31ebb93f6d2b24353b0a7262b29a22abba58dea276217e2dbe1a769
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3711a589d8dd3a381fa24f7d09d4bdadbde03051323878676d05d8eee5c03d1f25e7cb7e67d141fae8b3f0c53ade1104d0dc23f72f95811503428001b87a880d
|
|
7
|
+
data.tar.gz: ac3fbd36c37c83935c370fcf76fef53236d6286159e4132e29ba7bc6b4f9c84dacc29c39c4363c168b417724f8072739102dd4749c87f1e819621bdc65565d16
|
data/README.md
CHANGED
|
@@ -76,9 +76,9 @@ rails db:migrate
|
|
|
76
76
|
rails ruby_llm:load_models
|
|
77
77
|
|
|
78
78
|
# Then install Observ
|
|
79
|
-
rails observ:install:migrations
|
|
80
79
|
rails generate observ:install # Core features
|
|
81
|
-
rails generate observ:
|
|
80
|
+
rails generate observ:install_chat # Chat feature
|
|
81
|
+
rails observ:install:migrations
|
|
82
82
|
rails db:migrate
|
|
83
83
|
```
|
|
84
84
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<%# Load Vite assets in environments where the helper is available (e.g., demo app) %>
|
|
10
10
|
<% if respond_to?(:vite_client_tag) %>
|
|
11
11
|
<%= vite_client_tag %>
|
|
12
|
-
<%= vite_javascript_tag '
|
|
12
|
+
<%= vite_javascript_tag 'observ' %>
|
|
13
13
|
<% end %>
|
|
14
14
|
</head>
|
|
15
15
|
|
|
@@ -14,6 +14,7 @@ module Observ
|
|
|
14
14
|
# rails generate observ:install --skip-index
|
|
15
15
|
# rails generate observ:install --skip-routes # Don't auto-mount engine
|
|
16
16
|
# rails generate observ:install --force # Skip confirmation prompt
|
|
17
|
+
# rails generate observ:install --skip-vite-entrypoint # Don't generate Vite entry point
|
|
17
18
|
class InstallGenerator < Rails::Generators::Base
|
|
18
19
|
source_root File.expand_path("templates", __dir__)
|
|
19
20
|
|
|
@@ -29,8 +30,8 @@ module Observ
|
|
|
29
30
|
|
|
30
31
|
class_option :skip_index,
|
|
31
32
|
type: :boolean,
|
|
32
|
-
desc: "Skip generation of index files",
|
|
33
|
-
default:
|
|
33
|
+
desc: "Skip generation of index files (default: true, index.js no longer needed)",
|
|
34
|
+
default: true
|
|
34
35
|
|
|
35
36
|
class_option :force,
|
|
36
37
|
type: :boolean,
|
|
@@ -42,6 +43,16 @@ module Observ
|
|
|
42
43
|
desc: "Skip automatic route mounting",
|
|
43
44
|
default: false
|
|
44
45
|
|
|
46
|
+
class_option :skip_vite_entrypoint,
|
|
47
|
+
type: :boolean,
|
|
48
|
+
desc: "Skip generation of Vite entry point",
|
|
49
|
+
default: false
|
|
50
|
+
|
|
51
|
+
class_option :vite_entrypoint_dest,
|
|
52
|
+
type: :string,
|
|
53
|
+
desc: "Destination path for Vite entry point (default: app/javascript/entrypoints)",
|
|
54
|
+
default: "app/javascript/entrypoints"
|
|
55
|
+
|
|
45
56
|
def confirm_installation
|
|
46
57
|
return if options[:force]
|
|
47
58
|
|
|
@@ -59,10 +70,12 @@ module Observ
|
|
|
59
70
|
js_files_to_copy = collect_files_to_copy("javascripts", "*.js", js_dest)
|
|
60
71
|
index_will_be_generated = !options[:skip_index] && will_generate_index?(js_dest)
|
|
61
72
|
route_will_be_added = !options[:skip_routes] && !route_already_exists?
|
|
73
|
+
vite_entrypoint_will_be_created = !options[:skip_vite_entrypoint] && will_create_vite_entrypoint?
|
|
62
74
|
|
|
63
75
|
# Check if there are any changes to make
|
|
64
76
|
total_changes = stylesheets_to_copy.count + js_files_to_copy.count +
|
|
65
|
-
(index_will_be_generated ? 1 : 0) + (route_will_be_added ? 1 : 0)
|
|
77
|
+
(index_will_be_generated ? 1 : 0) + (route_will_be_added ? 1 : 0) +
|
|
78
|
+
(vite_entrypoint_will_be_created ? 1 : 0)
|
|
66
79
|
|
|
67
80
|
if total_changes == 0
|
|
68
81
|
say "No changes needed - all files are up to date!", :green
|
|
@@ -92,9 +105,13 @@ module Observ
|
|
|
92
105
|
end
|
|
93
106
|
|
|
94
107
|
# Show generated files
|
|
95
|
-
|
|
108
|
+
generated_files = []
|
|
109
|
+
generated_files << "#{js_dest}/index.js (controller index)" if index_will_be_generated
|
|
110
|
+
generated_files << "#{options[:vite_entrypoint_dest]}/observ.js (Vite entry point)" if vite_entrypoint_will_be_created
|
|
111
|
+
|
|
112
|
+
if generated_files.any?
|
|
96
113
|
say "Generated Files:", :yellow
|
|
97
|
-
say " • #{
|
|
114
|
+
generated_files.each { |file| say " • #{file}", :white }
|
|
98
115
|
say "\n"
|
|
99
116
|
end
|
|
100
117
|
|
|
@@ -145,6 +162,26 @@ module Observ
|
|
|
145
162
|
)
|
|
146
163
|
end
|
|
147
164
|
|
|
165
|
+
def install_vite_entrypoint
|
|
166
|
+
return if options[:skip_vite_entrypoint]
|
|
167
|
+
|
|
168
|
+
dest_dir = Rails.root.join(options[:vite_entrypoint_dest])
|
|
169
|
+
dest_file = dest_dir.join("observ.js")
|
|
170
|
+
|
|
171
|
+
if dest_file.exist?
|
|
172
|
+
say " Vite entry point already exists: #{dest_file}", :yellow
|
|
173
|
+
return
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
say "Creating Vite entry point...", :cyan
|
|
177
|
+
say "-" * 80, :cyan
|
|
178
|
+
|
|
179
|
+
FileUtils.mkdir_p(dest_dir)
|
|
180
|
+
copy_file "observ.js", dest_file
|
|
181
|
+
say " Created #{dest_file}", :green
|
|
182
|
+
say "\n"
|
|
183
|
+
end
|
|
184
|
+
|
|
148
185
|
def show_post_install_message
|
|
149
186
|
say "\n"
|
|
150
187
|
say "=" * 80, :green
|
|
@@ -161,10 +198,18 @@ module Observ
|
|
|
161
198
|
end
|
|
162
199
|
|
|
163
200
|
say "Next steps:", :cyan
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
201
|
+
|
|
202
|
+
if options[:skip_vite_entrypoint]
|
|
203
|
+
say " 1. Import Observ in your application", :cyan
|
|
204
|
+
say " Add to app/javascript/application.js:", :cyan
|
|
205
|
+
say " import 'observ'", :cyan
|
|
206
|
+
say "\n"
|
|
207
|
+
else
|
|
208
|
+
say " 1. Add 'observ' to your Vite entrypoints (if not auto-detected)", :cyan
|
|
209
|
+
say " The entry point was created at: #{options[:vite_entrypoint_dest]}/observ.js", :cyan
|
|
210
|
+
say "\n"
|
|
211
|
+
end
|
|
212
|
+
|
|
168
213
|
say " 2. Restart your development server", :cyan
|
|
169
214
|
say " bin/dev or rails server", :cyan
|
|
170
215
|
say "\n"
|
|
@@ -238,6 +283,13 @@ module Observ
|
|
|
238
283
|
!index_file.exist?
|
|
239
284
|
end
|
|
240
285
|
|
|
286
|
+
# Check if Vite entry point will be created
|
|
287
|
+
# @return [Boolean] true if observ.js will be created
|
|
288
|
+
def will_create_vite_entrypoint?
|
|
289
|
+
dest_file = Rails.root.join(options[:vite_entrypoint_dest], "observ.js")
|
|
290
|
+
!dest_file.exist?
|
|
291
|
+
end
|
|
292
|
+
|
|
241
293
|
# Logger adapter for Rails generator
|
|
242
294
|
class GeneratorLogger
|
|
243
295
|
def initialize(generator)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Observ Vite entry point
|
|
2
|
+
// This file is loaded via vite_javascript_tag 'observ' in the Observ layout
|
|
3
|
+
|
|
4
|
+
// Import Turbo and Stimulus
|
|
5
|
+
import '@hotwired/turbo-rails'
|
|
6
|
+
import { Application } from '@hotwired/stimulus'
|
|
7
|
+
import { registerControllers } from 'stimulus-vite-helpers'
|
|
8
|
+
|
|
9
|
+
// Import Observ stylesheets
|
|
10
|
+
import '../stylesheets/observ/application.scss'
|
|
11
|
+
|
|
12
|
+
// Start Stimulus application
|
|
13
|
+
const application = Application.start()
|
|
14
|
+
application.debug = false
|
|
15
|
+
window.Stimulus = application
|
|
16
|
+
|
|
17
|
+
// Auto-register all Observ Stimulus controllers
|
|
18
|
+
const controllers = import.meta.glob('../controllers/observ/*_controller.js', { eager: true })
|
|
19
|
+
registerControllers(application, controllers)
|
|
@@ -131,16 +131,6 @@ module Observ
|
|
|
131
131
|
say "\n"
|
|
132
132
|
end
|
|
133
133
|
|
|
134
|
-
def create_view_partials
|
|
135
|
-
say "Creating view partials...", :cyan
|
|
136
|
-
say "-" * 80, :cyan
|
|
137
|
-
|
|
138
|
-
template "views/messages/_content.html.erb.tt", "app/views/messages/_content.html.erb"
|
|
139
|
-
|
|
140
|
-
say " ✓ Created messages/_content partial", :green
|
|
141
|
-
say "\n"
|
|
142
|
-
end
|
|
143
|
-
|
|
144
134
|
def create_initializer
|
|
145
135
|
say "Creating observability initializer...", :cyan
|
|
146
136
|
say "-" * 80, :cyan
|
data/lib/observ/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubyllm-observ
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Franck D'agostini
|
|
@@ -230,7 +230,6 @@ files:
|
|
|
230
230
|
- app/assets/javascripts/observ/controllers/drawer_controller.js
|
|
231
231
|
- app/assets/javascripts/observ/controllers/expandable_controller.js
|
|
232
232
|
- app/assets/javascripts/observ/controllers/filter_controller.js
|
|
233
|
-
- app/assets/javascripts/observ/controllers/index.js
|
|
234
233
|
- app/assets/javascripts/observ/controllers/json_viewer_controller.js
|
|
235
234
|
- app/assets/javascripts/observ/controllers/message_form_controller.js
|
|
236
235
|
- app/assets/javascripts/observ/controllers/prompt_variables_controller.js
|
|
@@ -436,6 +435,7 @@ files:
|
|
|
436
435
|
- lib/generators/observ/add_phase_tracking/templates/migration.rb.tt
|
|
437
436
|
- lib/generators/observ/install/USAGE
|
|
438
437
|
- lib/generators/observ/install/install_generator.rb
|
|
438
|
+
- lib/generators/observ/install/templates/observ.js
|
|
439
439
|
- lib/generators/observ/install_chat/install_chat_generator.rb
|
|
440
440
|
- lib/generators/observ/install_chat/templates/agents/base_agent.rb.tt
|
|
441
441
|
- lib/generators/observ/install_chat/templates/agents/simple_agent.rb.tt
|
|
@@ -446,7 +446,6 @@ files:
|
|
|
446
446
|
- lib/generators/observ/install_chat/templates/migrations/add_agent_class_name.rb.tt
|
|
447
447
|
- lib/generators/observ/install_chat/templates/migrations/add_observability_session_id.rb.tt
|
|
448
448
|
- lib/generators/observ/install_chat/templates/tools/think_tool.rb.tt
|
|
449
|
-
- lib/generators/observ/install_chat/templates/views/messages/_content.html.erb.tt
|
|
450
449
|
- lib/observ.rb
|
|
451
450
|
- lib/observ/asset_installer.rb
|
|
452
451
|
- lib/observ/asset_syncer.rb
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
// Auto-generated index file for Observ Stimulus controllers
|
|
2
|
-
// Register all Observ controllers with the observ-- prefix
|
|
3
|
-
//
|
|
4
|
-
// This file is designed to be imported by the host application's Stimulus setup.
|
|
5
|
-
// The host app should import this file in their controllers/index.js:
|
|
6
|
-
// import "./observ"
|
|
7
|
-
|
|
8
|
-
import AutoscrollController from "./autoscroll_controller.js"
|
|
9
|
-
import ChatFormController from "./chat_form_controller.js"
|
|
10
|
-
import CopyController from "./copy_controller.js"
|
|
11
|
-
import DashboardController from "./dashboard_controller.js"
|
|
12
|
-
import DrawerController from "./drawer_controller.js"
|
|
13
|
-
import ExpandableController from "./expandable_controller.js"
|
|
14
|
-
import FilterController from "./filter_controller.js"
|
|
15
|
-
import JsonViewerController from "./json_viewer_controller.js"
|
|
16
|
-
import MessageFormController from "./message_form_controller.js"
|
|
17
|
-
import PromptVariablesController from "./prompt_variables_controller.js"
|
|
18
|
-
import TextSelectController from "./text_select_controller.js"
|
|
19
|
-
|
|
20
|
-
// Export controllers for manual registration if needed
|
|
21
|
-
export {
|
|
22
|
-
AutoscrollController,
|
|
23
|
-
ChatFormController,
|
|
24
|
-
CopyController,
|
|
25
|
-
DashboardController,
|
|
26
|
-
DrawerController,
|
|
27
|
-
ExpandableController,
|
|
28
|
-
FilterController,
|
|
29
|
-
JsonViewerController,
|
|
30
|
-
MessageFormController,
|
|
31
|
-
PromptVariablesController,
|
|
32
|
-
TextSelectController
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Auto-register if Stimulus application is available globally
|
|
36
|
-
if (typeof window.Stimulus !== "undefined") {
|
|
37
|
-
const application = window.Stimulus
|
|
38
|
-
|
|
39
|
-
application.register("observ--autoscroll", AutoscrollController)
|
|
40
|
-
application.register("observ--chat-form", ChatFormController)
|
|
41
|
-
application.register("observ--copy", CopyController)
|
|
42
|
-
application.register("observ--dashboard", DashboardController)
|
|
43
|
-
application.register("observ--drawer", DrawerController)
|
|
44
|
-
application.register("observ--expandable", ExpandableController)
|
|
45
|
-
application.register("observ--filter", FilterController)
|
|
46
|
-
application.register("observ--json-viewer", JsonViewerController)
|
|
47
|
-
application.register("observ--message-form", MessageFormController)
|
|
48
|
-
application.register("observ--prompt-variables", PromptVariablesController)
|
|
49
|
-
application.register("observ--text-select", TextSelectController)
|
|
50
|
-
|
|
51
|
-
console.log("Observ Stimulus controllers registered")
|
|
52
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<%%= content %>
|