context_drop 0.1.4 → 0.2.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/README.md +184 -107
- data/SPEC.md +74 -26
- data/app/assets/javascripts/context_drop/context_drop.js +5121 -651
- data/app/controllers/context_drop/agent_controller.rb +170 -0
- data/app/controllers/context_drop/configs_controller.rb +2 -1
- data/app/controllers/context_drop/feedbacks_controller.rb +13 -3
- data/app/controllers/context_drop/mcp_controller.rb +2 -1
- data/app/helpers/context_drop/widget_helper.rb +11 -1
- data/app/javascript/context_drop/__tests__/widget.test.ts +661 -89
- data/app/javascript/context_drop/api-client.ts +130 -11
- data/app/javascript/context_drop/element-picker.ts +185 -33
- data/app/javascript/context_drop/icons.ts +24 -0
- data/app/javascript/context_drop/markdown.ts +146 -0
- data/app/javascript/context_drop/sanitizer.ts +413 -2
- data/app/javascript/context_drop/screenshot.ts +102 -8
- data/app/javascript/context_drop/styles.ts +1528 -252
- data/app/javascript/context_drop/types.ts +147 -0
- data/app/javascript/context_drop/widget.ts +2591 -290
- data/app/models/context_drop/feedback.rb +23 -0
- data/app/views/context_drop/dashboard/feedbacks/index.html.erb +5 -0
- data/app/views/context_drop/dashboard/feedbacks/show.html.erb +10 -0
- data/app/views/layouts/context_drop/application.html.erb +1 -0
- data/config/routes.rb +11 -0
- data/db/migrate/20261112000004_add_environment_to_context_drop_feedbacks.rb +10 -0
- data/lib/context_drop/agent/key_store.rb +290 -0
- data/lib/context_drop/agent/llm_client.rb +413 -0
- data/lib/context_drop/agent/orchestrator.rb +314 -0
- data/lib/context_drop/agent/workspace_sandbox.rb +499 -0
- data/lib/context_drop/configuration.rb +216 -3
- data/lib/context_drop/mcp/dispatcher.rb +71 -29
- data/lib/context_drop/mcp/environment_router.rb +115 -0
- data/lib/context_drop/mcp/prompts/investigate_feedback.rb +87 -8
- data/lib/context_drop/mcp/remote_client.rb +120 -0
- data/lib/context_drop/mcp/server.rb +9 -2
- data/lib/context_drop/mcp/tools/get_feedback.rb +50 -4
- data/lib/context_drop/mcp/tools/get_feedback_attachment.rb +26 -4
- data/lib/context_drop/mcp/tools/list_environments.rb +60 -0
- data/lib/context_drop/mcp/tools/list_feedbacks.rb +174 -22
- data/lib/context_drop/mcp/tools/update_feedback_status.rb +45 -4
- data/lib/context_drop/version.rb +1 -1
- data/lib/context_drop.rb +8 -2
- data/lib/generators/context_drop/install/templates/initializer.rb.tt +29 -2
- metadata +11 -1
|
@@ -9,10 +9,14 @@ module ContextDrop
|
|
|
9
9
|
|
|
10
10
|
DEFINITION = {
|
|
11
11
|
name: "list_feedbacks",
|
|
12
|
-
description: "List and search ContextDrop feedback submissions filtered
|
|
12
|
+
description: "List and search ContextDrop feedback submissions across all connected environments (or filtered to a specific environment, status, page_url, or query).",
|
|
13
13
|
inputSchema: {
|
|
14
14
|
type: "object",
|
|
15
15
|
properties: {
|
|
16
|
+
environment: {
|
|
17
|
+
type: "string",
|
|
18
|
+
description: "Target environment ('all', 'local', 'development', 'staging', 'production', etc.). Defaults to 'all' across local and configured remote environments."
|
|
19
|
+
},
|
|
16
20
|
status: {
|
|
17
21
|
type: "string",
|
|
18
22
|
enum: %w[new reviewed resolved dismissed],
|
|
@@ -40,17 +44,137 @@ module ContextDrop
|
|
|
40
44
|
|
|
41
45
|
def self.call(args = {})
|
|
42
46
|
params = stringify_keys(args)
|
|
43
|
-
scope = ContextDrop::Feedback.includes(:submitter, :element_references, :attachments).recent
|
|
44
47
|
|
|
45
48
|
status = params["status"].to_s.strip
|
|
46
|
-
if status.present?
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
if status.present? && !ContextDrop::Feedback::STATUSES.include?(status)
|
|
50
|
+
return error_result("Invalid status '#{status}'. Must be one of: #{ContextDrop::Feedback::STATUSES.join(', ')}")
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
raw_limit = params["limit"] ? params["limit"].to_i : DEFAULT_LIMIT
|
|
54
|
+
limit = raw_limit.clamp(1, MAX_LIMIT)
|
|
55
|
+
offset = [params["offset"].to_i, 0].max
|
|
56
|
+
|
|
57
|
+
requested_env = params["environment"].to_s.strip.downcase
|
|
58
|
+
requested_env = "all" if requested_env.empty?
|
|
59
|
+
|
|
60
|
+
remotes = ContextDrop::MCP::EnvironmentRouter.remote_environments
|
|
61
|
+
host_env = ContextDrop::MCP::EnvironmentRouter.host_environment
|
|
62
|
+
|
|
63
|
+
if requested_env == "all"
|
|
64
|
+
return query_all_environments(params, status: status, limit: limit, offset: offset, remotes: remotes)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
if requested_env == "local" || requested_env == host_env
|
|
68
|
+
filter_env = requested_env == "local" ? nil : host_env
|
|
69
|
+
local_res = query_local(params, status: status, limit: limit, offset: offset, env_filter: filter_env)
|
|
70
|
+
return success_json(
|
|
71
|
+
environment: host_env,
|
|
72
|
+
total: local_res[:total],
|
|
73
|
+
limit: limit,
|
|
74
|
+
offset: offset,
|
|
75
|
+
feedbacks: local_res[:records]
|
|
76
|
+
)
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
if remotes.key?(requested_env)
|
|
80
|
+
begin
|
|
81
|
+
remote_res = fetch_remote_list(requested_env, remotes[requested_env], params.merge("limit" => limit, "offset" => offset))
|
|
82
|
+
return success_json(
|
|
83
|
+
environment: requested_env,
|
|
84
|
+
total: remote_res[:total],
|
|
85
|
+
limit: limit,
|
|
86
|
+
offset: offset,
|
|
87
|
+
feedbacks: remote_res[:records]
|
|
88
|
+
)
|
|
89
|
+
rescue ContextDrop::MCP::RemoteClient::RemoteError => e
|
|
90
|
+
return error_result(e.message)
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Fallback: shared database containing records tagged with `requested_env`
|
|
95
|
+
if local_supports_environment_column?
|
|
96
|
+
local_res = query_local(params, status: status, limit: limit, offset: offset, env_filter: requested_env)
|
|
97
|
+
return success_json(
|
|
98
|
+
environment: requested_env,
|
|
99
|
+
total: local_res[:total],
|
|
100
|
+
limit: limit,
|
|
101
|
+
offset: offset,
|
|
102
|
+
feedbacks: local_res[:records]
|
|
103
|
+
)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
known = ([host_env, "local", "all"] + remotes.keys).uniq
|
|
107
|
+
error_result("Unknown environment '#{requested_env}'. Available environments: #{known.join(', ')}")
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
def self.query_all_environments(params, status:, limit:, offset:, remotes:)
|
|
111
|
+
fetch_window = (offset + limit).clamp(1, MAX_LIMIT)
|
|
112
|
+
local_res = query_local(params, status: status, limit: fetch_window, offset: 0, env_filter: nil)
|
|
113
|
+
|
|
114
|
+
if remotes.empty?
|
|
115
|
+
paged = local_res[:records].drop(offset).first(limit)
|
|
116
|
+
return success_json(
|
|
117
|
+
environment: ContextDrop::MCP::EnvironmentRouter.host_environment,
|
|
118
|
+
total: local_res[:total],
|
|
119
|
+
limit: limit,
|
|
120
|
+
offset: offset,
|
|
121
|
+
feedbacks: paged
|
|
122
|
+
)
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
remote_results = {}
|
|
126
|
+
warnings = []
|
|
127
|
+
mutex = Mutex.new
|
|
128
|
+
|
|
129
|
+
threads = remotes.map do |env_name, cfg|
|
|
130
|
+
Thread.new do
|
|
131
|
+
res = fetch_remote_list(env_name, cfg, params.merge("limit" => fetch_window, "offset" => 0))
|
|
132
|
+
mutex.synchronize { remote_results[env_name] = res }
|
|
133
|
+
rescue StandardError => e
|
|
134
|
+
mutex.synchronize { warnings << { environment: env_name, error: e.message } }
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
threads.each(&:join)
|
|
138
|
+
|
|
139
|
+
combined = local_res[:records].dup
|
|
140
|
+
total_count = local_res[:total].to_i
|
|
141
|
+
|
|
142
|
+
remote_results.each_value do |res|
|
|
143
|
+
combined.concat(res[:records])
|
|
144
|
+
total_count += res[:total].to_i
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
combined.sort_by! do |item|
|
|
148
|
+
ts = begin
|
|
149
|
+
Time.iso8601(item[:created_at].to_s).to_f
|
|
150
|
+
rescue StandardError
|
|
151
|
+
0.0
|
|
49
152
|
end
|
|
153
|
+
[-ts, -item[:id].to_i]
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
payload = {
|
|
157
|
+
environment: "all",
|
|
158
|
+
connected_environments: [ContextDrop::MCP::EnvironmentRouter.host_environment] + remotes.keys,
|
|
159
|
+
total: total_count,
|
|
160
|
+
limit: limit,
|
|
161
|
+
offset: offset,
|
|
162
|
+
feedbacks: combined.drop(offset).first(limit)
|
|
163
|
+
}
|
|
164
|
+
payload[:warnings] = warnings unless warnings.empty?
|
|
165
|
+
|
|
166
|
+
success_json(payload)
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
def self.query_local(params, status:, limit:, offset:, env_filter: nil)
|
|
170
|
+
scope = ContextDrop::Feedback.includes(:submitter, :element_references, :attachments).recent
|
|
50
171
|
|
|
51
|
-
|
|
172
|
+
if env_filter.present? && local_supports_environment_column?
|
|
173
|
+
scope = scope.where(environment: env_filter)
|
|
52
174
|
end
|
|
53
175
|
|
|
176
|
+
scope = scope.where(status: status) if status.present?
|
|
177
|
+
|
|
54
178
|
page_url = params["page_url"].to_s.strip
|
|
55
179
|
if page_url.present?
|
|
56
180
|
scope = scope.where("context_drop_feedbacks.page_url LIKE ?", "%#{escape_like(page_url)}%")
|
|
@@ -68,32 +192,46 @@ module ContextDrop
|
|
|
68
192
|
).distinct
|
|
69
193
|
end
|
|
70
194
|
|
|
71
|
-
raw_limit = params["limit"] ? params["limit"].to_i : DEFAULT_LIMIT
|
|
72
|
-
limit = raw_limit.clamp(1, MAX_LIMIT)
|
|
73
|
-
offset = [params["offset"].to_i, 0].max
|
|
74
|
-
|
|
75
195
|
total_count = scope.count
|
|
76
196
|
records = scope.limit(limit).offset(offset).map { |fb| serialize_summary(fb) }
|
|
197
|
+
{ total: total_count, records: records }
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
def self.fetch_remote_list(env_name, env_config, params)
|
|
201
|
+
remote_args = {}
|
|
202
|
+
%w[status page_url query limit offset].each do |key|
|
|
203
|
+
remote_args[key] = params[key] if params.key?(key) && !params[key].nil? && params[key].to_s != ""
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
tool_res = ContextDrop::MCP::RemoteClient.call_tool(env_name, env_config, "list_feedbacks", remote_args)
|
|
207
|
+
text_block = Array(tool_res[:content]).find { |b| b.is_a?(Hash) && b[:type].to_s == "text" }
|
|
208
|
+
parsed = text_block ? JSON.parse(text_block[:text].to_s) : {}
|
|
209
|
+
|
|
210
|
+
if tool_res[:isError]
|
|
211
|
+
raise ContextDrop::MCP::RemoteClient::RemoteError, parsed["error"] || "Remote list_feedbacks failed on '#{env_name}'"
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
items = Array(parsed["feedbacks"]).map do |item|
|
|
215
|
+
sym_item = item.is_a?(Hash) ? item.transform_keys(&:to_sym) : {}
|
|
216
|
+
rec_id = sym_item[:id]
|
|
217
|
+
sym_item.merge(
|
|
218
|
+
environment: env_name,
|
|
219
|
+
qualified_id: ContextDrop::MCP::EnvironmentRouter.qualify_id(env_name, rec_id)
|
|
220
|
+
)
|
|
221
|
+
end
|
|
77
222
|
|
|
78
223
|
{
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
type: "text",
|
|
82
|
-
text: JSON.pretty_generate(
|
|
83
|
-
total: total_count,
|
|
84
|
-
limit: limit,
|
|
85
|
-
offset: offset,
|
|
86
|
-
feedbacks: records
|
|
87
|
-
)
|
|
88
|
-
}
|
|
89
|
-
],
|
|
90
|
-
isError: false
|
|
224
|
+
total: parsed["total"].to_i,
|
|
225
|
+
records: items
|
|
91
226
|
}
|
|
92
227
|
end
|
|
93
228
|
|
|
94
229
|
def self.serialize_summary(feedback)
|
|
230
|
+
env_name = ContextDrop::MCP::EnvironmentRouter.record_environment(feedback)
|
|
95
231
|
{
|
|
96
232
|
id: feedback.id,
|
|
233
|
+
qualified_id: ContextDrop::MCP::EnvironmentRouter.qualify_id(env_name, feedback.id),
|
|
234
|
+
environment: env_name,
|
|
97
235
|
status: feedback.status,
|
|
98
236
|
message: feedback.message,
|
|
99
237
|
page_url: feedback.page_url,
|
|
@@ -105,6 +243,20 @@ module ContextDrop
|
|
|
105
243
|
}
|
|
106
244
|
end
|
|
107
245
|
|
|
246
|
+
def self.local_supports_environment_column?
|
|
247
|
+
ContextDrop::Feedback.respond_to?(:column_names) &&
|
|
248
|
+
Array(ContextDrop::Feedback.column_names).map(&:to_s).include?("environment")
|
|
249
|
+
rescue StandardError
|
|
250
|
+
false
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
def self.success_json(payload)
|
|
254
|
+
{
|
|
255
|
+
content: [{ type: "text", text: JSON.pretty_generate(payload) }],
|
|
256
|
+
isError: false
|
|
257
|
+
}
|
|
258
|
+
end
|
|
259
|
+
|
|
108
260
|
def self.error_result(msg)
|
|
109
261
|
{
|
|
110
262
|
content: [{ type: "text", text: JSON.generate(error: msg) }],
|
|
@@ -6,14 +6,18 @@ 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').",
|
|
9
|
+
description: "Transition a ContextDrop feedback record's status ('new', 'reviewed', 'resolved', 'dismissed') in local or remote environments.",
|
|
10
10
|
inputSchema: {
|
|
11
11
|
type: "object",
|
|
12
12
|
required: %w[id status],
|
|
13
13
|
properties: {
|
|
14
14
|
id: {
|
|
15
15
|
type: %w[integer string],
|
|
16
|
-
description: "The ID of the ContextDrop::Feedback record."
|
|
16
|
+
description: "The ID of the ContextDrop::Feedback record, or a qualified '<environment>:<id>' string (e.g. 'staging:42')."
|
|
17
|
+
},
|
|
18
|
+
environment: {
|
|
19
|
+
type: "string",
|
|
20
|
+
description: "Optional environment name ('local', 'staging', 'production', etc.)."
|
|
17
21
|
},
|
|
18
22
|
status: {
|
|
19
23
|
type: "string",
|
|
@@ -26,10 +30,10 @@ module ContextDrop
|
|
|
26
30
|
|
|
27
31
|
def self.call(args = {})
|
|
28
32
|
params = args.is_a?(Hash) ? args.transform_keys(&:to_s) : {}
|
|
29
|
-
|
|
33
|
+
raw_id = params["id"] || params["feedback_id"]
|
|
30
34
|
next_status = params["status"].to_s.strip
|
|
31
35
|
|
|
32
|
-
return error_result("Missing required parameter: id") if
|
|
36
|
+
return error_result("Missing required parameter: id") if raw_id.nil? || raw_id.to_s.strip.empty?
|
|
33
37
|
|
|
34
38
|
unless ContextDrop::Feedback::STATUSES.include?(next_status)
|
|
35
39
|
return error_result(
|
|
@@ -37,11 +41,46 @@ module ContextDrop
|
|
|
37
41
|
)
|
|
38
42
|
end
|
|
39
43
|
|
|
44
|
+
target_env, feedback_id = ContextDrop::MCP::EnvironmentRouter.parse_target(raw_id, params["environment"])
|
|
45
|
+
|
|
46
|
+
unless ContextDrop::MCP::EnvironmentRouter.local_target?(target_env)
|
|
47
|
+
remote_cfg = ContextDrop::MCP::EnvironmentRouter.remote_config_for(target_env)
|
|
48
|
+
return error_result("Unknown remote environment '#{target_env}'") unless remote_cfg
|
|
49
|
+
|
|
50
|
+
begin
|
|
51
|
+
res = ContextDrop::MCP::RemoteClient.call_tool(target_env, remote_cfg, "update_feedback_status", {
|
|
52
|
+
"id" => feedback_id,
|
|
53
|
+
"status" => next_status
|
|
54
|
+
})
|
|
55
|
+
return res if res[:isError]
|
|
56
|
+
|
|
57
|
+
updated_blocks = Array(res[:content]).map do |block|
|
|
58
|
+
if block.is_a?(Hash) && block[:type].to_s == "text"
|
|
59
|
+
begin
|
|
60
|
+
parsed = JSON.parse(block[:text].to_s)
|
|
61
|
+
if parsed.is_a?(Hash)
|
|
62
|
+
parsed["environment"] = target_env
|
|
63
|
+
parsed["qualified_id"] = ContextDrop::MCP::EnvironmentRouter.qualify_id(target_env, parsed["id"] || feedback_id)
|
|
64
|
+
next block.merge(text: JSON.pretty_generate(parsed))
|
|
65
|
+
end
|
|
66
|
+
rescue JSON::ParserError
|
|
67
|
+
# Keep original block
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
block
|
|
71
|
+
end
|
|
72
|
+
return { content: updated_blocks, isError: false }
|
|
73
|
+
rescue ContextDrop::MCP::RemoteClient::RemoteError => e
|
|
74
|
+
return error_result(e.message)
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
40
78
|
feedback = ContextDrop::Feedback.find_by(id: feedback_id)
|
|
41
79
|
return error_result("Feedback ##{feedback_id} not found") unless feedback
|
|
42
80
|
|
|
43
81
|
previous_status = feedback.status
|
|
44
82
|
feedback.update!(status: next_status)
|
|
83
|
+
env_name = ContextDrop::MCP::EnvironmentRouter.record_environment(feedback)
|
|
45
84
|
|
|
46
85
|
{
|
|
47
86
|
content: [
|
|
@@ -49,6 +88,8 @@ module ContextDrop
|
|
|
49
88
|
type: "text",
|
|
50
89
|
text: JSON.pretty_generate(
|
|
51
90
|
id: feedback.id,
|
|
91
|
+
qualified_id: ContextDrop::MCP::EnvironmentRouter.qualify_id(env_name, feedback.id),
|
|
92
|
+
environment: env_name,
|
|
52
93
|
previous_status: previous_status,
|
|
53
94
|
status: feedback.status,
|
|
54
95
|
page_url: feedback.page_url,
|
data/lib/context_drop/version.rb
CHANGED
data/lib/context_drop.rb
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
module ContextDrop
|
|
4
|
+
class Error < StandardError; end
|
|
5
|
+
end
|
|
6
|
+
|
|
3
7
|
require_relative "context_drop/version"
|
|
4
8
|
require_relative "context_drop/base64_util"
|
|
5
9
|
require_relative "context_drop/configuration"
|
|
6
10
|
require_relative "context_drop/mcp/server"
|
|
11
|
+
require_relative "context_drop/agent/key_store"
|
|
12
|
+
require_relative "context_drop/agent/workspace_sandbox"
|
|
13
|
+
require_relative "context_drop/agent/llm_client"
|
|
14
|
+
require_relative "context_drop/agent/orchestrator"
|
|
7
15
|
require_relative "context_drop/engine" if defined?(Rails::Engine)
|
|
8
16
|
|
|
9
17
|
module ContextDrop
|
|
10
|
-
class Error < StandardError; end
|
|
11
|
-
|
|
12
18
|
class << self
|
|
13
19
|
def config
|
|
14
20
|
@config ||= Configuration.new
|
|
@@ -4,7 +4,10 @@ ContextDrop.configure do |config|
|
|
|
4
4
|
# Environment-based master switch (disables widget, dashboard, and ingestion endpoints when false)
|
|
5
5
|
config.enabled = ENV.fetch("CONTEXT_DROP_ENABLED", "false") == "true"
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# Host environment attribution (defaults automatically to Rails.env)
|
|
8
|
+
# config.environment = Rails.env
|
|
9
|
+
|
|
10
|
+
# Initial book-corner launcher position: :bottom_right, :bottom_left, :top_right, :top_left
|
|
8
11
|
config.position = :bottom_right
|
|
9
12
|
|
|
10
13
|
# Attachment storage backend
|
|
@@ -22,9 +25,19 @@ ContextDrop.configure do |config|
|
|
|
22
25
|
config.max_image_dimensions = [4096, 4096]
|
|
23
26
|
|
|
24
27
|
# Widget feature flags
|
|
28
|
+
# selection_mode: :auto uses zero-jargon Smart Component Selection + surrounding-context auto-screenshot
|
|
29
|
+
# in `production`, and Verbose CSS Selector & Layer Scrubbing (`v0.1.x` style) in `development` / `staging`.
|
|
25
30
|
config.element_selection = true
|
|
31
|
+
config.selection_mode = :auto # :auto | :smart | :verbose
|
|
26
32
|
config.screenshot_capture = true
|
|
27
33
|
config.element_capture_padding = 16
|
|
34
|
+
config.smart_capture_padding = 84
|
|
35
|
+
|
|
36
|
+
# Local development BYOK Agentic Sidebar (strictly active only in `development` on 127.0.0.1 / ::1)
|
|
37
|
+
# In v0.2.0, local development defaults to staging/verbose mode so developers can test bug pinning
|
|
38
|
+
# and use their preferred IDE coding agents (Antigravity, Cursor, Claude Code, etc.) via MCP.
|
|
39
|
+
# Set to true to opt into the experimental embedded in-browser agent sidebar:
|
|
40
|
+
config.enable_local_agent = ENV.fetch("CONTEXT_DROP_LOCAL_AGENT_ENABLED", "false") == "true"
|
|
28
41
|
|
|
29
42
|
# DOM selectors excluded from selection and redacted in screenshots
|
|
30
43
|
config.excluded_selectors = [
|
|
@@ -48,8 +61,22 @@ ContextDrop.configure do |config|
|
|
|
48
61
|
# Optional lifecycle callback invoked after feedback creation
|
|
49
62
|
config.on_feedback_created = ->(feedback) {}
|
|
50
63
|
|
|
51
|
-
# Model Context Protocol (MCP) server settings
|
|
64
|
+
# Unified Model Context Protocol (MCP) server settings
|
|
65
|
+
# Remote HTTP `/mcp` endpoint switch & Bearer key (for staging/production instances):
|
|
52
66
|
config.mcp_enabled = ENV.fetch("CONTEXT_DROP_MCP_ENABLED", "false") == "true"
|
|
53
67
|
config.mcp_api_key = ENV["CONTEXT_DROP_MCP_API_KEY"]
|
|
54
68
|
config.authorize_mcp = nil
|
|
69
|
+
|
|
70
|
+
# Federated remote environments queried by your single local `bin/rails context_drop:mcp` server
|
|
71
|
+
# (also auto-discovers CONTEXT_DROP_<ENV>_MCP_URL + CONTEXT_DROP_<ENV>_MCP_API_KEY env variables):
|
|
72
|
+
config.mcp_environments = {
|
|
73
|
+
staging: {
|
|
74
|
+
url: ENV["CONTEXT_DROP_STAGING_MCP_URL"],
|
|
75
|
+
api_key: ENV["CONTEXT_DROP_STAGING_MCP_API_KEY"]
|
|
76
|
+
},
|
|
77
|
+
production: {
|
|
78
|
+
url: ENV["CONTEXT_DROP_PRODUCTION_MCP_URL"],
|
|
79
|
+
api_key: ENV["CONTEXT_DROP_PRODUCTION_MCP_API_KEY"]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
55
82
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: context_drop
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kemal Elmizan
|
|
@@ -168,6 +168,7 @@ files:
|
|
|
168
168
|
- SPEC.md
|
|
169
169
|
- app/assets/javascripts/context_drop/context_drop.js
|
|
170
170
|
- app/assets/stylesheets/context_drop/application.css
|
|
171
|
+
- app/controllers/context_drop/agent_controller.rb
|
|
171
172
|
- app/controllers/context_drop/application_controller.rb
|
|
172
173
|
- app/controllers/context_drop/attachments_controller.rb
|
|
173
174
|
- app/controllers/context_drop/configs_controller.rb
|
|
@@ -183,6 +184,7 @@ files:
|
|
|
183
184
|
- app/javascript/context_drop/element-picker.ts
|
|
184
185
|
- app/javascript/context_drop/icons.ts
|
|
185
186
|
- app/javascript/context_drop/index.ts
|
|
187
|
+
- app/javascript/context_drop/markdown.ts
|
|
186
188
|
- app/javascript/context_drop/sanitizer.ts
|
|
187
189
|
- app/javascript/context_drop/screenshot.ts
|
|
188
190
|
- app/javascript/context_drop/styles.ts
|
|
@@ -201,16 +203,24 @@ files:
|
|
|
201
203
|
- db/migrate/20261109000001_create_context_drop_feedbacks.rb
|
|
202
204
|
- db/migrate/20261109000002_create_context_drop_element_references.rb
|
|
203
205
|
- db/migrate/20261109000003_create_context_drop_attachments.rb
|
|
206
|
+
- db/migrate/20261112000004_add_environment_to_context_drop_feedbacks.rb
|
|
204
207
|
- lib/context_drop.rb
|
|
208
|
+
- lib/context_drop/agent/key_store.rb
|
|
209
|
+
- lib/context_drop/agent/llm_client.rb
|
|
210
|
+
- lib/context_drop/agent/orchestrator.rb
|
|
211
|
+
- lib/context_drop/agent/workspace_sandbox.rb
|
|
205
212
|
- lib/context_drop/base64_util.rb
|
|
206
213
|
- lib/context_drop/configuration.rb
|
|
207
214
|
- lib/context_drop/engine.rb
|
|
208
215
|
- lib/context_drop/mcp/dispatcher.rb
|
|
216
|
+
- lib/context_drop/mcp/environment_router.rb
|
|
209
217
|
- lib/context_drop/mcp/prompts/investigate_feedback.rb
|
|
218
|
+
- lib/context_drop/mcp/remote_client.rb
|
|
210
219
|
- lib/context_drop/mcp/server.rb
|
|
211
220
|
- lib/context_drop/mcp/stdio_runner.rb
|
|
212
221
|
- lib/context_drop/mcp/tools/get_feedback.rb
|
|
213
222
|
- lib/context_drop/mcp/tools/get_feedback_attachment.rb
|
|
223
|
+
- lib/context_drop/mcp/tools/list_environments.rb
|
|
214
224
|
- lib/context_drop/mcp/tools/list_feedbacks.rb
|
|
215
225
|
- lib/context_drop/mcp/tools/update_feedback_status.rb
|
|
216
226
|
- lib/context_drop/version.rb
|