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.
@@ -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 from the conversation to save context. Use the output id shown in the "[Output omitted]" placeholder.',
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
@@ -1,3 +1,3 @@
1
1
  module RailsConsoleAi
2
- VERSION = '0.20.0'.freeze
2
+ VERSION = '0.22.0'.freeze
3
3
  end
@@ -93,10 +93,7 @@ module RailsConsoleAi
93
93
  conn = session_connection
94
94
  table = 'rails_console_ai_sessions'
95
95
 
96
- if conn.table_exists?(table)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_console_ai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.0
4
+ version: 0.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cortfr