rails_console_ai 0.20.0 → 0.22.0
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/CHANGELOG.md +23 -0
- data/README.md +15 -6
- data/app/views/rails_console_ai/sessions/index.html.erb +2 -0
- data/app/views/rails_console_ai/sessions/show.html.erb +6 -0
- data/lib/rails_console_ai/channel/console.rb +54 -0
- data/lib/rails_console_ai/console_methods.rb +7 -2
- data/lib/rails_console_ai/context_builder.rb +0 -3
- data/lib/rails_console_ai/conversation_engine.rb +159 -25
- data/lib/rails_console_ai/executor.rb +9 -29
- data/lib/rails_console_ai/providers/bedrock.rb +7 -3
- data/lib/rails_console_ai/safety_guards.rb +16 -2
- data/lib/rails_console_ai/session_logger.rb +2 -1
- data/lib/rails_console_ai/slack_bot.rb +363 -26
- data/lib/rails_console_ai/tools/registry.rb +14 -1
- data/lib/rails_console_ai/version.rb +1 -1
- data/lib/rails_console_ai.rb +11 -4
- metadata +1 -1
|
@@ -186,7 +186,7 @@ module RailsConsoleAi
|
|
|
186
186
|
if @executor
|
|
187
187
|
register(
|
|
188
188
|
name: 'recall_output',
|
|
189
|
-
description: 'Retrieve a previous code execution output that was omitted
|
|
189
|
+
description: 'Retrieve a previous code execution output that was omitted or truncated. The output will be expanded in place in the conversation. Use the output id shown in the "[Output omitted]" or "[Output truncated]" placeholder.',
|
|
190
190
|
parameters: {
|
|
191
191
|
'type' => 'object',
|
|
192
192
|
'properties' => {
|
|
@@ -199,6 +199,19 @@ module RailsConsoleAi
|
|
|
199
199
|
result || "No output found with id #{args['id']}"
|
|
200
200
|
}
|
|
201
201
|
)
|
|
202
|
+
|
|
203
|
+
register(
|
|
204
|
+
name: 'recall_outputs',
|
|
205
|
+
description: 'Retrieve multiple previous code execution outputs that were omitted from the conversation. Use the output ids shown in "[Output omitted]" or "[Output truncated]" placeholders.',
|
|
206
|
+
parameters: {
|
|
207
|
+
'type' => 'object',
|
|
208
|
+
'properties' => {
|
|
209
|
+
'ids' => { 'type' => 'array', 'items' => { 'type' => 'integer' }, 'description' => 'The output ids to retrieve' }
|
|
210
|
+
},
|
|
211
|
+
'required' => ['ids']
|
|
212
|
+
},
|
|
213
|
+
handler: ->(args) { "recall_outputs handled by conversation engine" }
|
|
214
|
+
)
|
|
202
215
|
end
|
|
203
216
|
|
|
204
217
|
unless @mode == :init
|
data/lib/rails_console_ai.rb
CHANGED
|
@@ -93,10 +93,7 @@ module RailsConsoleAi
|
|
|
93
93
|
conn = session_connection
|
|
94
94
|
table = 'rails_console_ai_sessions'
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
$stdout.puts "\e[32mRailsConsoleAi: #{table} already exists — checking for pending migrations.\e[0m"
|
|
98
|
-
migrate!
|
|
99
|
-
else
|
|
96
|
+
unless conn.table_exists?(table)
|
|
100
97
|
conn.create_table(table) do |t|
|
|
101
98
|
t.text :query, null: false
|
|
102
99
|
t.text :conversation, null: false
|
|
@@ -112,6 +109,8 @@ module RailsConsoleAi
|
|
|
112
109
|
t.string :provider, limit: 50
|
|
113
110
|
t.string :model, limit: 100
|
|
114
111
|
t.string :name, limit: 255
|
|
112
|
+
t.string :slack_thread_ts, limit: 255
|
|
113
|
+
t.string :slack_channel_name, limit: 255
|
|
115
114
|
t.integer :duration_ms
|
|
116
115
|
t.datetime :created_at, null: false
|
|
117
116
|
end
|
|
@@ -119,9 +118,12 @@ module RailsConsoleAi
|
|
|
119
118
|
conn.add_index(table, :created_at)
|
|
120
119
|
conn.add_index(table, :user_name)
|
|
121
120
|
conn.add_index(table, :name)
|
|
121
|
+
conn.add_index(table, :slack_thread_ts)
|
|
122
122
|
|
|
123
123
|
$stdout.puts "\e[32mRailsConsoleAi: created #{table} table.\e[0m"
|
|
124
124
|
end
|
|
125
|
+
|
|
126
|
+
migrate!
|
|
125
127
|
rescue => e
|
|
126
128
|
$stderr.puts "\e[31mRailsConsoleAi setup failed: #{e.class}: #{e.message}\e[0m"
|
|
127
129
|
end
|
|
@@ -149,6 +151,11 @@ module RailsConsoleAi
|
|
|
149
151
|
migrations << 'slack_thread_ts'
|
|
150
152
|
end
|
|
151
153
|
|
|
154
|
+
unless conn.column_exists?(table, :slack_channel_name)
|
|
155
|
+
conn.add_column(table, :slack_channel_name, :string, limit: 255)
|
|
156
|
+
migrations << 'slack_channel_name'
|
|
157
|
+
end
|
|
158
|
+
|
|
152
159
|
if migrations.empty?
|
|
153
160
|
$stdout.puts "\e[32mRailsConsoleAi: #{table} is up to date.\e[0m"
|
|
154
161
|
else
|