context_drop 0.2.0 → 0.3.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.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +149 -12
  3. data/Rakefile +110 -1
  4. data/app/assets/javascripts/context_drop/context_drop.js +1759 -105
  5. data/app/controllers/context_drop/application_controller.rb +52 -3
  6. data/app/controllers/context_drop/configs_controller.rb +10 -1
  7. data/app/controllers/context_drop/dashboard/feedbacks_controller.rb +99 -14
  8. data/app/controllers/context_drop/feedbacks_controller.rb +536 -17
  9. data/app/helpers/context_drop/dashboard_helper.rb +4 -0
  10. data/app/javascript/context_drop/__tests__/api-client.test.ts +255 -0
  11. data/app/javascript/context_drop/__tests__/widget.test.ts +355 -1
  12. data/app/javascript/context_drop/api-client.ts +343 -22
  13. data/app/javascript/context_drop/element-picker.ts +1 -1
  14. data/app/javascript/context_drop/icons.ts +6 -0
  15. data/app/javascript/context_drop/screenshot.ts +1 -1
  16. data/app/javascript/context_drop/styles.ts +311 -0
  17. data/app/javascript/context_drop/types.ts +141 -6
  18. data/app/javascript/context_drop/widget.ts +1072 -35
  19. data/app/models/context_drop/attachment.rb +5 -0
  20. data/app/models/context_drop/comment.rb +50 -0
  21. data/app/models/context_drop/feedback.rb +81 -11
  22. data/app/services/context_drop/ownership_token.rb +114 -0
  23. data/app/views/context_drop/dashboard/feedbacks/index.html.erb +14 -0
  24. data/app/views/context_drop/dashboard/feedbacks/show.html.erb +169 -2
  25. data/app/views/layouts/context_drop/application.html.erb +131 -7
  26. data/config/routes.rb +16 -1
  27. data/db/migrate/20261113000005_add_deleted_at_to_context_drop_feedbacks.rb +11 -0
  28. data/db/migrate/20261116000001_create_context_drop_comments_and_update_statuses.rb +44 -0
  29. data/lib/context_drop/agent/orchestrator.rb +1 -1
  30. data/lib/context_drop/configuration.rb +26 -0
  31. data/lib/context_drop/mcp/dispatcher.rb +2 -1
  32. data/lib/context_drop/mcp/prompts/investigate_feedback.rb +5 -3
  33. data/lib/context_drop/mcp/server.rb +1 -0
  34. data/lib/context_drop/mcp/tools/add_feedback_comment.rb +139 -0
  35. data/lib/context_drop/mcp/tools/get_feedback.rb +45 -6
  36. data/lib/context_drop/mcp/tools/get_feedback_attachment.rb +3 -0
  37. data/lib/context_drop/mcp/tools/list_feedbacks.rb +23 -3
  38. data/lib/context_drop/mcp/tools/update_feedback_status.rb +5 -3
  39. data/lib/context_drop/version.rb +1 -1
  40. metadata +7 -2
@@ -19,7 +19,7 @@ module ContextDrop
19
19
  },
20
20
  status: {
21
21
  type: "string",
22
- enum: %w[new reviewed resolved dismissed],
22
+ enum: %w[new updated fixed reviewed dismissed],
23
23
  description: "Filter feedback by workflow status."
24
24
  },
25
25
  page_url: {
@@ -37,6 +37,10 @@ module ContextDrop
37
37
  offset: {
38
38
  type: "integer",
39
39
  description: "Pagination offset (default 0)."
40
+ },
41
+ include_deleted: {
42
+ type: "boolean",
43
+ description: "When true, includes soft-deleted feedback records. Defaults to false."
40
44
  }
41
45
  }
42
46
  }
@@ -167,7 +171,13 @@ module ContextDrop
167
171
  end
168
172
 
169
173
  def self.query_local(params, status:, limit:, offset:, env_filter: nil)
170
- scope = ContextDrop::Feedback.includes(:submitter, :element_references, :attachments).recent
174
+ include_deleted = truthy?(params["include_deleted"])
175
+ base = if !include_deleted && ContextDrop::Feedback.respond_to?(:active)
176
+ ContextDrop::Feedback.active
177
+ else
178
+ ContextDrop::Feedback
179
+ end
180
+ scope = base.includes(:submitter, :element_references, :attachments).recent
171
181
 
172
182
  if env_filter.present? && local_supports_environment_column?
173
183
  scope = scope.where(environment: env_filter)
@@ -202,6 +212,7 @@ module ContextDrop
202
212
  %w[status page_url query limit offset].each do |key|
203
213
  remote_args[key] = params[key] if params.key?(key) && !params[key].nil? && params[key].to_s != ""
204
214
  end
215
+ remote_args["include_deleted"] = true if truthy?(params["include_deleted"])
205
216
 
206
217
  tool_res = ContextDrop::MCP::RemoteClient.call_tool(env_name, env_config, "list_feedbacks", remote_args)
207
218
  text_block = Array(tool_res[:content]).find { |b| b.is_a?(Hash) && b[:type].to_s == "text" }
@@ -228,7 +239,7 @@ module ContextDrop
228
239
 
229
240
  def self.serialize_summary(feedback)
230
241
  env_name = ContextDrop::MCP::EnvironmentRouter.record_environment(feedback)
231
- {
242
+ summary = {
232
243
  id: feedback.id,
233
244
  qualified_id: ContextDrop::MCP::EnvironmentRouter.qualify_id(env_name, feedback.id),
234
245
  environment: env_name,
@@ -241,6 +252,15 @@ module ContextDrop
241
252
  element_selectors: feedback.element_references.map(&:selector),
242
253
  created_at: feedback.created_at&.iso8601
243
254
  }
255
+ if feedback.respond_to?(:deleted?) && feedback.deleted?
256
+ summary[:deleted] = true
257
+ summary[:deleted_at] = feedback.respond_to?(:deleted_at_value) ? feedback.deleted_at_value&.iso8601 : nil
258
+ end
259
+ summary
260
+ end
261
+
262
+ def self.truthy?(val)
263
+ val == true || %w[true 1 yes].include?(val.to_s.strip.downcase)
244
264
  end
245
265
 
246
266
  def self.local_supports_environment_column?
@@ -6,7 +6,7 @@ module ContextDrop
6
6
  class UpdateFeedbackStatus
7
7
  DEFINITION = {
8
8
  name: "update_feedback_status",
9
- description: "Transition a ContextDrop feedback record's status ('new', 'reviewed', 'resolved', 'dismissed') in local or remote environments.",
9
+ description: "Transition a ContextDrop feedback record's status ('new', 'updated', 'fixed', 'reviewed', 'dismissed') in local or remote environments.",
10
10
  inputSchema: {
11
11
  type: "object",
12
12
  required: %w[id status],
@@ -21,7 +21,7 @@ module ContextDrop
21
21
  },
22
22
  status: {
23
23
  type: "string",
24
- enum: %w[new reviewed resolved dismissed],
24
+ enum: %w[new updated fixed reviewed dismissed],
25
25
  description: "Target workflow status."
26
26
  }
27
27
  }
@@ -76,7 +76,9 @@ module ContextDrop
76
76
  end
77
77
 
78
78
  feedback = ContextDrop::Feedback.find_by(id: feedback_id)
79
- return error_result("Feedback ##{feedback_id} not found") unless feedback
79
+ if !feedback || (feedback.respond_to?(:deleted?) && feedback.deleted?)
80
+ return error_result("Feedback ##{feedback_id} not found")
81
+ end
80
82
 
81
83
  previous_status = feedback.status
82
84
  feedback.update!(status: next_status)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContextDrop
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: context_drop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kemal Elmizan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-11-12 00:00:00.000000000 Z
11
+ date: 2026-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -192,9 +192,11 @@ files:
192
192
  - app/javascript/context_drop/widget.ts
193
193
  - app/models/context_drop/application_record.rb
194
194
  - app/models/context_drop/attachment.rb
195
+ - app/models/context_drop/comment.rb
195
196
  - app/models/context_drop/element_reference.rb
196
197
  - app/models/context_drop/feedback.rb
197
198
  - app/services/context_drop/metadata_sanitizer.rb
199
+ - app/services/context_drop/ownership_token.rb
198
200
  - app/services/context_drop/upload_validator.rb
199
201
  - app/views/context_drop/dashboard/feedbacks/index.html.erb
200
202
  - app/views/context_drop/dashboard/feedbacks/show.html.erb
@@ -204,6 +206,8 @@ files:
204
206
  - db/migrate/20261109000002_create_context_drop_element_references.rb
205
207
  - db/migrate/20261109000003_create_context_drop_attachments.rb
206
208
  - db/migrate/20261112000004_add_environment_to_context_drop_feedbacks.rb
209
+ - db/migrate/20261113000005_add_deleted_at_to_context_drop_feedbacks.rb
210
+ - db/migrate/20261116000001_create_context_drop_comments_and_update_statuses.rb
207
211
  - lib/context_drop.rb
208
212
  - lib/context_drop/agent/key_store.rb
209
213
  - lib/context_drop/agent/llm_client.rb
@@ -218,6 +222,7 @@ files:
218
222
  - lib/context_drop/mcp/remote_client.rb
219
223
  - lib/context_drop/mcp/server.rb
220
224
  - lib/context_drop/mcp/stdio_runner.rb
225
+ - lib/context_drop/mcp/tools/add_feedback_comment.rb
221
226
  - lib/context_drop/mcp/tools/get_feedback.rb
222
227
  - lib/context_drop/mcp/tools/get_feedback_attachment.rb
223
228
  - lib/context_drop/mcp/tools/list_environments.rb