context-drop 0.0.0-stage → 0.3.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.
Files changed (60) hide show
  1. package/MIT-LICENSE +21 -0
  2. package/README.md +710 -2
  3. package/app/assets/javascripts/context_drop/context_drop.js +9949 -0
  4. package/dist/app/javascript/context_drop/api-client.d.ts +53 -0
  5. package/dist/app/javascript/context_drop/api-client.js +470 -0
  6. package/dist/app/javascript/context_drop/element-picker.d.ts +111 -0
  7. package/dist/app/javascript/context_drop/element-picker.js +1428 -0
  8. package/dist/app/javascript/context_drop/icons.d.ts +34 -0
  9. package/dist/app/javascript/context_drop/icons.js +34 -0
  10. package/dist/app/javascript/context_drop/index.d.ts +7 -0
  11. package/dist/app/javascript/context_drop/index.js +9 -0
  12. package/dist/app/javascript/context_drop/markdown.d.ts +7 -0
  13. package/dist/app/javascript/context_drop/markdown.js +129 -0
  14. package/dist/app/javascript/context_drop/sanitizer.d.ts +38 -0
  15. package/dist/app/javascript/context_drop/sanitizer.js +769 -0
  16. package/dist/app/javascript/context_drop/screenshot.d.ts +21 -0
  17. package/dist/app/javascript/context_drop/screenshot.js +245 -0
  18. package/dist/app/javascript/context_drop/styles.d.ts +1 -0
  19. package/dist/app/javascript/context_drop/styles.js +2196 -0
  20. package/dist/app/javascript/context_drop/types.d.ts +316 -0
  21. package/dist/app/javascript/context_drop/types.js +1 -0
  22. package/dist/app/javascript/context_drop/widget.d.ts +206 -0
  23. package/dist/app/javascript/context_drop/widget.js +3752 -0
  24. package/dist/src/cli.d.ts +3 -0
  25. package/dist/src/cli.js +207 -0
  26. package/dist/src/index.d.ts +5 -0
  27. package/dist/src/index.js +5 -0
  28. package/dist/src/mcp/dispatcher.d.ts +42 -0
  29. package/dist/src/mcp/dispatcher.js +895 -0
  30. package/dist/src/mcp/environment-router.d.ts +38 -0
  31. package/dist/src/mcp/environment-router.js +174 -0
  32. package/dist/src/mcp/index.d.ts +24 -0
  33. package/dist/src/mcp/index.js +75 -0
  34. package/dist/src/mcp/remote-client.d.ts +25 -0
  35. package/dist/src/mcp/remote-client.js +98 -0
  36. package/dist/src/next/index.d.ts +13 -0
  37. package/dist/src/next/index.js +25 -0
  38. package/dist/src/next/server.d.ts +1 -0
  39. package/dist/src/next/server.js +1 -0
  40. package/dist/src/react/index.d.ts +104 -0
  41. package/dist/src/react/index.js +144 -0
  42. package/dist/src/server/handler.d.ts +48 -0
  43. package/dist/src/server/handler.js +1180 -0
  44. package/dist/src/server/index.d.ts +8 -0
  45. package/dist/src/server/index.js +8 -0
  46. package/dist/src/server/sanitizer.d.ts +15 -0
  47. package/dist/src/server/sanitizer.js +201 -0
  48. package/dist/src/server/storage/local.d.ts +22 -0
  49. package/dist/src/server/storage/local.js +827 -0
  50. package/dist/src/server/storage/memory.d.ts +8 -0
  51. package/dist/src/server/storage/memory.js +387 -0
  52. package/dist/src/server/storage/postgres.d.ts +27 -0
  53. package/dist/src/server/storage/postgres.js +629 -0
  54. package/dist/src/server/types.d.ts +227 -0
  55. package/dist/src/server/types.js +7 -0
  56. package/dist/src/server/upload-validator.d.ts +16 -0
  57. package/dist/src/server/upload-validator.js +196 -0
  58. package/dist/src/widget/index.d.ts +1 -0
  59. package/dist/src/widget/index.js +1 -0
  60. package/package.json +99 -4
@@ -0,0 +1,227 @@
1
+ import type { BoundingRectSnapshot, SelectionMode, ViewportSnapshot, WidgetPosition } from "../../app/javascript/context_drop/types.js";
2
+ export declare const VERSION = "0.3.0";
3
+ export type FeedbackStatus = "new" | "reviewed" | "resolved" | "dismissed";
4
+ export declare const FEEDBACK_STATUSES: readonly FeedbackStatus[];
5
+ export interface SubmitterIdentity {
6
+ type?: string | null;
7
+ id?: string | number | null;
8
+ label?: string | null;
9
+ }
10
+ export interface StoredElementReference {
11
+ id: number | string;
12
+ feedback_id: number | string;
13
+ client_ref: string | null;
14
+ tag_name: string;
15
+ selector: string;
16
+ dom_path: string | null;
17
+ text_content: string | null;
18
+ attributes_snapshot: Record<string, string>;
19
+ bounding_rect: Partial<BoundingRectSnapshot>;
20
+ viewport: Partial<ViewportSnapshot>;
21
+ metadata: Record<string, unknown>;
22
+ captured_at: string;
23
+ }
24
+ export interface StoredAttachment {
25
+ id: number | string;
26
+ feedback_id: number | string;
27
+ element_reference_id: number | string | null;
28
+ attachment_type: "image" | "screenshot";
29
+ filename: string | null;
30
+ content_type: string | null;
31
+ byte_size: number | null;
32
+ blob_key?: string | null;
33
+ metadata: Record<string, unknown>;
34
+ created_at: string;
35
+ }
36
+ export interface StoredFeedbackRecord {
37
+ id: number | string;
38
+ environment: string;
39
+ status: FeedbackStatus;
40
+ message: string | null;
41
+ page_url: string;
42
+ user_agent: string | null;
43
+ session_id: string | null;
44
+ submitter: SubmitterIdentity;
45
+ metadata: Record<string, unknown>;
46
+ element_references: StoredElementReference[];
47
+ attachments: StoredAttachment[];
48
+ created_at: string;
49
+ updated_at: string;
50
+ deleted_at?: string | null;
51
+ }
52
+ export interface FeedbackSummaryItem {
53
+ id: number | string;
54
+ qualified_id?: string;
55
+ environment: string;
56
+ status: FeedbackStatus;
57
+ message: string | null;
58
+ page_url: string;
59
+ submitter: string;
60
+ attachments_count: number;
61
+ element_references_count: number;
62
+ element_selectors: string[];
63
+ created_at: string;
64
+ deleted?: boolean;
65
+ deleted_at?: string | null;
66
+ }
67
+ export interface FeedbackQueryFilter {
68
+ environment?: string | null;
69
+ status?: FeedbackStatus | null;
70
+ page_url?: string | null;
71
+ query?: string | null;
72
+ limit?: number;
73
+ offset?: number;
74
+ include_deleted?: boolean;
75
+ }
76
+ export interface ValidatedUpload {
77
+ data: Uint8Array;
78
+ filename: string;
79
+ content_type: string;
80
+ byte_size: number;
81
+ dimensions: [number, number] | null;
82
+ }
83
+ export interface SanitizedElementInput {
84
+ client_ref: string | null;
85
+ tag_name: string;
86
+ selector: string;
87
+ dom_path: string | null;
88
+ text_content: string | null;
89
+ attributes_snapshot: Record<string, string>;
90
+ bounding_rect: Partial<BoundingRectSnapshot>;
91
+ viewport: Partial<ViewportSnapshot>;
92
+ metadata: Record<string, unknown>;
93
+ captured_at: string;
94
+ }
95
+ export interface CreateAttachmentInput {
96
+ attachment_type: "image" | "screenshot";
97
+ element_client_ref?: string | null;
98
+ filename: string | null;
99
+ content_type: string | null;
100
+ byte_size: number | null;
101
+ data: Uint8Array | null;
102
+ metadata: Record<string, unknown>;
103
+ }
104
+ export interface RetainedAttachmentInput {
105
+ existing_id: string | number;
106
+ element_client_ref?: string | null;
107
+ metadata?: Record<string, unknown>;
108
+ update_metadata?: boolean;
109
+ }
110
+ export type UpdateAttachmentSpec = ({
111
+ kind: "retain";
112
+ } & RetainedAttachmentInput) | ({
113
+ kind: "create";
114
+ } & CreateAttachmentInput);
115
+ export interface CreateFeedbackRecordInput {
116
+ environment: string;
117
+ message: string | null;
118
+ page_url: string;
119
+ user_agent: string | null;
120
+ session_id: string | null;
121
+ submitter: SubmitterIdentity;
122
+ metadata: Record<string, unknown>;
123
+ element_references: SanitizedElementInput[];
124
+ attachments: CreateAttachmentInput[];
125
+ }
126
+ export interface UpdateFeedbackRecordInput {
127
+ message?: string | null;
128
+ metadata?: Record<string, unknown>;
129
+ element_references?: SanitizedElementInput[];
130
+ attachments?: UpdateAttachmentSpec[];
131
+ }
132
+ export interface OwnFeedbackLookupQuery {
133
+ submitter?: SubmitterIdentity | null;
134
+ session_id?: string | null;
135
+ token_ids?: Array<string | number>;
136
+ limit?: number;
137
+ }
138
+ export interface BlobStorageAdapter {
139
+ putBlob(input: {
140
+ key: string;
141
+ data: Uint8Array;
142
+ contentType: string;
143
+ filename: string;
144
+ }): Promise<{
145
+ key: string;
146
+ }>;
147
+ getBlob(key: string): Promise<Uint8Array | null>;
148
+ deleteBlob?(key: string): Promise<void>;
149
+ }
150
+ export interface StorageAdapter {
151
+ savePendingBlob(blob: ValidatedUpload): Promise<{
152
+ signed_blob_id: string;
153
+ }>;
154
+ consumePendingBlob(signedBlobId: string): Promise<ValidatedUpload | null>;
155
+ createFeedback(input: CreateFeedbackRecordInput): Promise<StoredFeedbackRecord>;
156
+ listFeedbacks(filter: FeedbackQueryFilter): Promise<{
157
+ total: number;
158
+ records: FeedbackSummaryItem[];
159
+ }>;
160
+ listOwnFeedbacks(query: OwnFeedbackLookupQuery): Promise<{
161
+ total: number;
162
+ records: StoredFeedbackRecord[];
163
+ }>;
164
+ getFeedback(id: string | number): Promise<StoredFeedbackRecord | null>;
165
+ updateFeedback(id: string | number, input: UpdateFeedbackRecordInput): Promise<StoredFeedbackRecord | null>;
166
+ softDeleteFeedback(id: string | number): Promise<StoredFeedbackRecord | null>;
167
+ getAttachment(attachmentId: string | number): Promise<{
168
+ attachment: StoredAttachment;
169
+ element_selector: string | null;
170
+ data: Uint8Array | null;
171
+ } | null>;
172
+ getAttachmentBytes(attachmentId: string | number): Promise<Uint8Array | null>;
173
+ updateFeedbackStatus(id: string | number, status: FeedbackStatus): Promise<{
174
+ previous_status: FeedbackStatus;
175
+ feedback: StoredFeedbackRecord;
176
+ } | null>;
177
+ getOwnershipSecret?(): Buffer;
178
+ }
179
+ export interface RemoteMcpEnvironmentConfig {
180
+ url: string;
181
+ apiKey?: string;
182
+ headers?: Record<string, string>;
183
+ allowInsecureHttp?: boolean;
184
+ }
185
+ export interface ContextDropServerConfig {
186
+ enabled?: boolean;
187
+ environment?: string;
188
+ position?: WidgetPosition;
189
+ placeholder?: string;
190
+ selectionMode?: "auto" | SelectionMode;
191
+ allowAnonymous?: boolean;
192
+ allowedOrigins?: Array<string | RegExp>;
193
+ ownershipSecret?: string;
194
+ storage?: StorageAdapter;
195
+ storageDir?: string;
196
+ features?: {
197
+ elementSelection?: boolean;
198
+ screenshotCapture?: boolean;
199
+ elementCapturePadding?: number;
200
+ smartCapturePadding?: number;
201
+ };
202
+ limits?: {
203
+ maxAttachments?: number;
204
+ maxElementReferences?: number;
205
+ maxAttachmentSize?: number;
206
+ allowedContentTypes?: string[];
207
+ maxImageDimensions?: [number, number];
208
+ };
209
+ privacy?: {
210
+ excludedSelectors?: string[];
211
+ };
212
+ rateLimit?: {
213
+ maxRequests: number;
214
+ periodSeconds: number;
215
+ } | false;
216
+ resolveSubmitter?: (request: Request) => Promise<SubmitterIdentity | null> | SubmitterIdentity | null;
217
+ authorizeSubmission?: (request: Request, submitter: SubmitterIdentity | null) => Promise<boolean> | boolean;
218
+ onFeedbackCreated?: (feedback: StoredFeedbackRecord) => Promise<void> | void;
219
+ onFeedbackUpdated?: (feedback: StoredFeedbackRecord) => Promise<void> | void;
220
+ onFeedbackDeleted?: (feedback: StoredFeedbackRecord) => Promise<void> | void;
221
+ mcp?: {
222
+ enabled?: boolean;
223
+ apiKey?: string;
224
+ authorize?: (request: Request) => Promise<boolean> | boolean;
225
+ environments?: Record<string, RemoteMcpEnvironmentConfig>;
226
+ };
227
+ }
@@ -0,0 +1,7 @@
1
+ export const VERSION = "0.3.0";
2
+ export const FEEDBACK_STATUSES = [
3
+ "new",
4
+ "reviewed",
5
+ "resolved",
6
+ "dismissed"
7
+ ];
@@ -0,0 +1,16 @@
1
+ import type { ValidatedUpload } from "./types.js";
2
+ export declare const DEFAULT_ALLOWED_CONTENT_TYPES: readonly ["image/png", "image/jpeg", "image/webp", "image/gif"];
3
+ export interface UploadValidationOptions {
4
+ maxAttachmentSize?: number;
5
+ allowedContentTypes?: string[];
6
+ maxImageDimensions?: [number, number];
7
+ }
8
+ export declare class UploadValidationError extends Error {
9
+ readonly status: number;
10
+ constructor(message: string, status?: number);
11
+ }
12
+ export declare function detectMagicMimeType(bytes: Uint8Array): string | null;
13
+ export declare function extractImageDimensions(bytes: Uint8Array, mimeType: string): [number, number] | null;
14
+ export declare function sanitizeFilename(filename: string | null | undefined, detectedMime: string): string;
15
+ export declare function validateBinaryUpload(bytes: Uint8Array, originalFilename?: string | null, options?: UploadValidationOptions): ValidatedUpload;
16
+ export declare function decodeBase64DataUrl(rawData: string, customFilename?: string | null, options?: UploadValidationOptions): ValidatedUpload;
@@ -0,0 +1,196 @@
1
+ export const DEFAULT_ALLOWED_CONTENT_TYPES = [
2
+ "image/png",
3
+ "image/jpeg",
4
+ "image/webp",
5
+ "image/gif"
6
+ ];
7
+ const MIME_EXTENSIONS = {
8
+ "image/png": [".png"],
9
+ "image/jpeg": [".jpg", ".jpeg"],
10
+ "image/webp": [".webp"],
11
+ "image/gif": [".gif"]
12
+ };
13
+ export class UploadValidationError extends Error {
14
+ status;
15
+ constructor(message, status = 422) {
16
+ super(message);
17
+ this.name = "UploadValidationError";
18
+ this.status = status;
19
+ }
20
+ }
21
+ export function detectMagicMimeType(bytes) {
22
+ if (bytes.byteLength >= 8) {
23
+ // PNG: 89 50 4E 47 0D 0A 1A 0A
24
+ if (bytes[0] === 0x89 &&
25
+ bytes[1] === 0x50 &&
26
+ bytes[2] === 0x4e &&
27
+ bytes[3] === 0x47 &&
28
+ bytes[4] === 0x0d &&
29
+ bytes[5] === 0x0a &&
30
+ bytes[6] === 0x1a &&
31
+ bytes[7] === 0x0a) {
32
+ return "image/png";
33
+ }
34
+ }
35
+ if (bytes.byteLength >= 3) {
36
+ // JPEG: FF D8 FF
37
+ if (bytes[0] === 0xff && bytes[1] === 0xd8 && bytes[2] === 0xff) {
38
+ return "image/jpeg";
39
+ }
40
+ }
41
+ if (bytes.byteLength >= 6) {
42
+ // GIF87a / GIF89a
43
+ const gifSig = String.fromCharCode(bytes[0], bytes[1], bytes[2], bytes[3], bytes[4], bytes[5]);
44
+ if (gifSig === "GIF87a" || gifSig === "GIF89a") {
45
+ return "image/gif";
46
+ }
47
+ }
48
+ if (bytes.byteLength >= 12) {
49
+ // RIFF....WEBP
50
+ const riff = String.fromCharCode(bytes[0], bytes[1], bytes[2], bytes[3]);
51
+ const webp = String.fromCharCode(bytes[8], bytes[9], bytes[10], bytes[11]);
52
+ if (riff === "RIFF" && webp === "WEBP") {
53
+ return "image/webp";
54
+ }
55
+ }
56
+ return null;
57
+ }
58
+ export function extractImageDimensions(bytes, mimeType) {
59
+ try {
60
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
61
+ if (mimeType === "image/png") {
62
+ if (bytes.byteLength < 24)
63
+ return null;
64
+ const width = view.getUint32(16, false);
65
+ const height = view.getUint32(20, false);
66
+ return [width, height];
67
+ }
68
+ if (mimeType === "image/gif") {
69
+ if (bytes.byteLength < 10)
70
+ return null;
71
+ const width = view.getUint16(6, true);
72
+ const height = view.getUint16(8, true);
73
+ return [width, height];
74
+ }
75
+ if (mimeType === "image/webp") {
76
+ if (bytes.byteLength < 30)
77
+ return null;
78
+ const chunkType = String.fromCharCode(bytes[12], bytes[13], bytes[14], bytes[15]);
79
+ if (chunkType === "VP8 ") {
80
+ const w = view.getUint16(26, true) & 0x3fff;
81
+ const h = view.getUint16(28, true) & 0x3fff;
82
+ return [w, h];
83
+ }
84
+ if (chunkType === "VP8L") {
85
+ const bits = view.getUint32(21, true);
86
+ const w = (bits & 0x3fff) + 1;
87
+ const h = ((bits >> 14) & 0x3fff) + 1;
88
+ return [w, h];
89
+ }
90
+ if (chunkType === "VP8X") {
91
+ const w = (bytes[24] | (bytes[25] << 8) | (bytes[26] << 16)) + 1;
92
+ const h = (bytes[27] | (bytes[28] << 8) | (bytes[29] << 16)) + 1;
93
+ return [w, h];
94
+ }
95
+ return null;
96
+ }
97
+ if (mimeType === "image/jpeg") {
98
+ let idx = 2;
99
+ const len = bytes.byteLength;
100
+ while (idx + 9 < len) {
101
+ if (bytes[idx] !== 0xff) {
102
+ idx += 1;
103
+ continue;
104
+ }
105
+ const marker = bytes[idx + 1];
106
+ idx += 2;
107
+ if (marker === 0xd8 || marker === 0xd9 || (marker >= 0xd0 && marker <= 0xd7)) {
108
+ continue;
109
+ }
110
+ const segLen = view.getUint16(idx, false);
111
+ if (segLen < 2)
112
+ break;
113
+ if (marker === 0xc0 || marker === 0xc1 || marker === 0xc2 || marker === 0xc3) {
114
+ const height = view.getUint16(idx + 3, false);
115
+ const width = view.getUint16(idx + 5, false);
116
+ return [width, height];
117
+ }
118
+ idx += segLen;
119
+ }
120
+ return null;
121
+ }
122
+ }
123
+ catch {
124
+ return null;
125
+ }
126
+ return null;
127
+ }
128
+ export function sanitizeFilename(filename, detectedMime) {
129
+ const defaultExt = MIME_EXTENSIONS[detectedMime]?.[0] ?? ".bin";
130
+ if (!filename || filename.trim().length === 0) {
131
+ return `attachment${defaultExt}`;
132
+ }
133
+ const stripped = filename.trim().replace(/^.*[\\/]/, "");
134
+ const safe = stripped.replace(/[^a-zA-Z0-9._-]/g, "_");
135
+ if (!safe || safe.startsWith(".")) {
136
+ return `attachment${defaultExt}`;
137
+ }
138
+ return safe;
139
+ }
140
+ function getExtensionLower(filename) {
141
+ const lastDot = filename.lastIndexOf(".");
142
+ if (lastDot <= 0)
143
+ return "";
144
+ return filename.slice(lastDot).toLowerCase();
145
+ }
146
+ export function validateBinaryUpload(bytes, originalFilename, options = {}) {
147
+ const byteSize = bytes.byteLength;
148
+ if (byteSize === 0) {
149
+ throw new UploadValidationError("Uploaded file cannot be empty");
150
+ }
151
+ const maxSize = options.maxAttachmentSize ?? 10 * 1024 * 1024;
152
+ if (maxSize > 0 && byteSize > maxSize) {
153
+ throw new UploadValidationError(`File size (${byteSize} bytes) exceeds maximum allowed size (${maxSize} bytes)`);
154
+ }
155
+ const detectedMime = detectMagicMimeType(bytes);
156
+ const allowedTypes = options.allowedContentTypes ?? [...DEFAULT_ALLOWED_CONTENT_TYPES];
157
+ if (!detectedMime || !allowedTypes.includes(detectedMime)) {
158
+ throw new UploadValidationError(`Unsupported or invalid file content type (detected: ${detectedMime ?? "unknown"})`);
159
+ }
160
+ const filename = sanitizeFilename(originalFilename, detectedMime);
161
+ const ext = getExtensionLower(filename);
162
+ const allowedExts = MIME_EXTENSIONS[detectedMime] ?? [];
163
+ if (ext && !allowedExts.includes(ext)) {
164
+ throw new UploadValidationError(`File extension '${ext}' does not match detected content type '${detectedMime}'`);
165
+ }
166
+ const dimensions = extractImageDimensions(bytes, detectedMime);
167
+ if (dimensions) {
168
+ const [width, height] = dimensions;
169
+ if (width <= 0 || height <= 0) {
170
+ throw new UploadValidationError(`Invalid image dimensions (${width}x${height})`);
171
+ }
172
+ const [maxW, maxH] = options.maxImageDimensions ?? [4096, 4096];
173
+ if ((maxW > 0 && width > maxW) || (maxH > 0 && height > maxH)) {
174
+ throw new UploadValidationError(`Image dimensions (${width}x${height}) exceed maximum allowed (${maxW}x${maxH})`);
175
+ }
176
+ }
177
+ return {
178
+ data: bytes,
179
+ filename,
180
+ content_type: detectedMime,
181
+ byte_size: byteSize,
182
+ dimensions
183
+ };
184
+ }
185
+ export function decodeBase64DataUrl(rawData, customFilename, options = {}) {
186
+ const payload = rawData.includes(";base64,")
187
+ ? rawData.split(";base64,")[1] ?? ""
188
+ : rawData;
189
+ const trimmed = payload.trim();
190
+ if (!trimmed || !/^[A-Za-z0-9+/]+={0,2}$/.test(trimmed) || trimmed.length % 4 !== 0) {
191
+ throw new UploadValidationError("Invalid base64 attachment data");
192
+ }
193
+ const buf = Buffer.from(trimmed, "base64");
194
+ const bytes = new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
195
+ return validateBinaryUpload(bytes, customFilename || "screenshot.png", options);
196
+ }
@@ -0,0 +1 @@
1
+ export * from "../../app/javascript/context_drop/index.js";
@@ -0,0 +1 @@
1
+ export * from "../../app/javascript/context_drop/index.js";
package/package.json CHANGED
@@ -1,6 +1,101 @@
1
1
  {
2
2
  "name": "context-drop",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.3.0",
4
+ "description": "Self-hosted contextual feedback widget, Next.js & Rails integration, and unified multi-environment MCP server for AI coding agents.",
5
+ "type": "module",
6
+ "main": "./dist/src/index.js",
7
+ "types": "./dist/src/index.d.ts",
8
+ "bin": {
9
+ "context-drop": "dist/src/cli.js"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/src/index.d.ts",
14
+ "default": "./dist/src/index.js"
15
+ },
16
+ "./widget": {
17
+ "types": "./dist/src/widget/index.d.ts",
18
+ "default": "./dist/src/widget/index.js"
19
+ },
20
+ "./bundle": "./app/assets/javascripts/context_drop/context_drop.js",
21
+ "./react": {
22
+ "types": "./dist/src/react/index.d.ts",
23
+ "default": "./dist/src/react/index.js"
24
+ },
25
+ "./next": {
26
+ "types": "./dist/src/next/index.d.ts",
27
+ "default": "./dist/src/next/index.js"
28
+ },
29
+ "./next/server": {
30
+ "types": "./dist/src/next/server.d.ts",
31
+ "default": "./dist/src/next/server.js"
32
+ },
33
+ "./server": {
34
+ "types": "./dist/src/server/index.d.ts",
35
+ "default": "./dist/src/server/index.js"
36
+ },
37
+ "./mcp": {
38
+ "types": "./dist/src/mcp/index.d.ts",
39
+ "default": "./dist/src/mcp/index.js"
40
+ },
41
+ "./package.json": "./package.json"
42
+ },
43
+ "files": [
44
+ "dist",
45
+ "app/assets/javascripts/context_drop/context_drop.js",
46
+ "README.md",
47
+ "MIT-LICENSE"
48
+ ],
49
+ "scripts": {
50
+ "build": "node scripts/build_npm.mjs",
51
+ "build:widget": "node scripts/build_widget.mjs",
52
+ "typecheck": "tsc --noEmit",
53
+ "demo": "node scripts/build_widget.mjs && node scripts/serve_demo.mjs",
54
+ "test": "node --test app/javascript/context_drop/__tests__/*.test.ts src/__tests__/*.test.ts",
55
+ "prepublishOnly": "npm run build && npm test"
56
+ },
57
+ "peerDependencies": {
58
+ "next": ">=13.4.0",
59
+ "react": ">=18.0.0"
60
+ },
61
+ "peerDependenciesMeta": {
62
+ "next": {
63
+ "optional": true
64
+ },
65
+ "react": {
66
+ "optional": true
67
+ }
68
+ },
69
+ "keywords": [
70
+ "feedback",
71
+ "widget",
72
+ "nextjs",
73
+ "react",
74
+ "rails",
75
+ "mcp",
76
+ "model-context-protocol",
77
+ "ai-agents",
78
+ "shadow-dom",
79
+ "bug-reporting",
80
+ "dom-inspector",
81
+ "screenshot"
82
+ ],
83
+ "author": "Kemal Elmizan <kemal@elmizan.com>",
84
+ "homepage": "https://github.com/kemalelmizan/context-drop",
85
+ "repository": {
86
+ "type": "git",
87
+ "url": "git+https://github.com/kemalelmizan/context-drop.git"
88
+ },
89
+ "bugs": {
90
+ "url": "https://github.com/kemalelmizan/context-drop/issues"
91
+ },
92
+ "engines": {
93
+ "node": ">=20.0.0"
94
+ },
95
+ "license": "MIT",
96
+ "devDependencies": {
97
+ "@types/node": "^26.6.6",
98
+ "@types/react": "^19.3.0",
99
+ "typescript": "^7.0.2"
100
+ }
101
+ }