@fatagnus/convex-feedback 0.1.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 (78) hide show
  1. package/LICENSE +177 -0
  2. package/README.md +382 -0
  3. package/dist/convex/agents/bugReportAgent.d.ts +30 -0
  4. package/dist/convex/agents/bugReportAgent.d.ts.map +1 -0
  5. package/dist/convex/agents/bugReportAgent.js +243 -0
  6. package/dist/convex/agents/bugReportAgent.js.map +1 -0
  7. package/dist/convex/agents/feedbackAgent.d.ts +29 -0
  8. package/dist/convex/agents/feedbackAgent.d.ts.map +1 -0
  9. package/dist/convex/agents/feedbackAgent.js +232 -0
  10. package/dist/convex/agents/feedbackAgent.js.map +1 -0
  11. package/dist/convex/bugReports.d.ts +49 -0
  12. package/dist/convex/bugReports.d.ts.map +1 -0
  13. package/dist/convex/bugReports.js +321 -0
  14. package/dist/convex/bugReports.js.map +1 -0
  15. package/dist/convex/convex.config.d.ts +3 -0
  16. package/dist/convex/convex.config.d.ts.map +1 -0
  17. package/dist/convex/convex.config.js +6 -0
  18. package/dist/convex/convex.config.js.map +1 -0
  19. package/dist/convex/emails/bugReportEmails.d.ts +16 -0
  20. package/dist/convex/emails/bugReportEmails.d.ts.map +1 -0
  21. package/dist/convex/emails/bugReportEmails.js +403 -0
  22. package/dist/convex/emails/bugReportEmails.js.map +1 -0
  23. package/dist/convex/emails/feedbackEmails.d.ts +16 -0
  24. package/dist/convex/emails/feedbackEmails.d.ts.map +1 -0
  25. package/dist/convex/emails/feedbackEmails.js +389 -0
  26. package/dist/convex/emails/feedbackEmails.js.map +1 -0
  27. package/dist/convex/feedback.d.ts +49 -0
  28. package/dist/convex/feedback.d.ts.map +1 -0
  29. package/dist/convex/feedback.js +327 -0
  30. package/dist/convex/feedback.js.map +1 -0
  31. package/dist/convex/index.d.ts +10 -0
  32. package/dist/convex/index.d.ts.map +1 -0
  33. package/dist/convex/index.js +12 -0
  34. package/dist/convex/index.js.map +1 -0
  35. package/dist/convex/schema.d.ts +200 -0
  36. package/dist/convex/schema.d.ts.map +1 -0
  37. package/dist/convex/schema.js +150 -0
  38. package/dist/convex/schema.js.map +1 -0
  39. package/dist/convex/supportTeams.d.ts +29 -0
  40. package/dist/convex/supportTeams.d.ts.map +1 -0
  41. package/dist/convex/supportTeams.js +159 -0
  42. package/dist/convex/supportTeams.js.map +1 -0
  43. package/dist/index.d.ts +70 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +63 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/react/BugReportButton.d.ts +70 -0
  48. package/dist/react/BugReportButton.d.ts.map +1 -0
  49. package/dist/react/BugReportButton.js +371 -0
  50. package/dist/react/BugReportButton.js.map +1 -0
  51. package/dist/react/BugReportContext.d.ts +59 -0
  52. package/dist/react/BugReportContext.d.ts.map +1 -0
  53. package/dist/react/BugReportContext.js +107 -0
  54. package/dist/react/BugReportContext.js.map +1 -0
  55. package/dist/react/index.d.ts +36 -0
  56. package/dist/react/index.d.ts.map +1 -0
  57. package/dist/react/index.js +36 -0
  58. package/dist/react/index.js.map +1 -0
  59. package/dist/types.d.ts +89 -0
  60. package/dist/types.d.ts.map +1 -0
  61. package/dist/types.js +5 -0
  62. package/dist/types.js.map +1 -0
  63. package/package.json +101 -0
  64. package/src/convex/agents/bugReportAgent.ts +277 -0
  65. package/src/convex/agents/feedbackAgent.ts +264 -0
  66. package/src/convex/bugReports.ts +350 -0
  67. package/src/convex/convex.config.ts +7 -0
  68. package/src/convex/emails/bugReportEmails.ts +479 -0
  69. package/src/convex/emails/feedbackEmails.ts +465 -0
  70. package/src/convex/feedback.ts +356 -0
  71. package/src/convex/index.ts +28 -0
  72. package/src/convex/schema.ts +207 -0
  73. package/src/convex/supportTeams.ts +179 -0
  74. package/src/index.ts +77 -0
  75. package/src/react/BugReportButton.tsx +755 -0
  76. package/src/react/BugReportContext.tsx +146 -0
  77. package/src/react/index.ts +46 -0
  78. package/src/types.ts +93 -0
package/LICENSE ADDED
@@ -0,0 +1,177 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no theory of
154
+ liability, whether in contract, strict liability, or tort
155
+ (including negligence or otherwise) arising in any way out of
156
+ the use or inability to use the Work (even if such Holder or other
157
+ party has been advised of the possibility of such damages), shall
158
+ any Contributor be liable to You for damages, including any direct,
159
+ indirect, special, incidental, or consequential damages of any
160
+ character arising as a result of this License or out of the use or
161
+ inability to use the Work (including but not limited to damages for
162
+ loss of goodwill, work stoppage, computer failure or malfunction, or
163
+ any and all other commercial damages or losses), even if such
164
+ Contributor has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
package/README.md ADDED
@@ -0,0 +1,382 @@
1
+ # @fatagnus/convex-feedback
2
+
3
+ Bug reports and feedback collection component for Convex applications with AI analysis and email notifications.
4
+
5
+ ## Features
6
+
7
+ - 🐛 **Bug Reports** - Capture bug reports with browser diagnostics, console errors, and screenshots
8
+ - 💬 **Feedback** - Collect feature requests, change requests, and general feedback
9
+ - 🤖 **AI Analysis** - Automatic analysis of submissions using OpenRouter/Claude
10
+ - 📧 **Email Notifications** - Send notifications to reporters and support teams via Resend
11
+ - 👥 **Support Teams** - Route notifications to the right teams based on type/severity
12
+ - 📸 **Screenshots** - Capture or upload screenshots with reports
13
+ - 🔄 **Real-time** - Leverages Convex for real-time updates
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ npm install @fatagnus/convex-feedback
19
+ ```
20
+
21
+ ### Peer Dependencies
22
+
23
+ **Required:**
24
+ - `convex` (>=1.17.0)
25
+ - `react` (>=18.0.0)
26
+
27
+ **Optional (for React components):**
28
+ - `@mantine/core` (>=7.0.0)
29
+ - `@mantine/form` (>=7.0.0)
30
+ - `@mantine/hooks` (>=7.0.0)
31
+ - `@mantine/notifications` (>=7.0.0)
32
+ - `@tabler/icons-react` (>=3.0.0)
33
+ - `html2canvas` (>=1.4.0)
34
+
35
+ **Optional (for AI analysis):**
36
+ - `@convex-dev/agent` (>=0.1.0)
37
+ - `@ai-sdk/openai-compatible` (>=0.1.0)
38
+
39
+ **Optional (for email notifications):**
40
+ - `resend` (>=4.0.0)
41
+
42
+ ## Setup
43
+
44
+ ### 1. Add the Component
45
+
46
+ Add the feedback component to your Convex app configuration:
47
+
48
+ ```typescript
49
+ // convex/convex.config.ts
50
+ import { defineApp } from "convex/server";
51
+ import feedback from "@fatagnus/convex-feedback/convex.config";
52
+
53
+ const app = defineApp();
54
+ app.use(feedback);
55
+ export default app;
56
+ ```
57
+
58
+ ### 2. Configure Environment Variables
59
+
60
+ Set these environment variables in your Convex dashboard:
61
+
62
+ | Variable | Required | Description |
63
+ |----------|----------|-------------|
64
+ | `OPENROUTER_API_KEY` | No | OpenRouter API key for AI analysis |
65
+ | `RESEND_API_KEY` | No | Resend API key for email notifications |
66
+ | `RESEND_FROM_EMAIL` | No | From email address (default: `bugs@resend.dev`) |
67
+
68
+ ### 3. Add React Components
69
+
70
+ Wrap your app with the `BugReportProvider` and add the `BugReportButton`:
71
+
72
+ ```tsx
73
+ import { BugReportProvider, BugReportButton } from '@fatagnus/convex-feedback/react';
74
+ import { api } from './convex/_generated/api';
75
+
76
+ function App() {
77
+ const user = useCurrentUser(); // Your auth hook
78
+
79
+ return (
80
+ <BugReportProvider>
81
+ <YourApp />
82
+
83
+ {user && (
84
+ <BugReportButton
85
+ reporterType="staff"
86
+ reporterId={user.id}
87
+ reporterEmail={user.email}
88
+ reporterName={user.name}
89
+ bugReportApi={{
90
+ create: api.feedback.bugReports.create,
91
+ generateUploadUrl: api.feedback.bugReports.generateUploadUrl,
92
+ }}
93
+ feedbackApi={{
94
+ create: api.feedback.feedback.create,
95
+ generateUploadUrl: api.feedback.feedback.generateUploadUrl,
96
+ }}
97
+ />
98
+ )}
99
+ </BugReportProvider>
100
+ );
101
+ }
102
+ ```
103
+
104
+ ## API Reference
105
+
106
+ ### Bug Reports
107
+
108
+ #### `bugReports.create`
109
+
110
+ Create a new bug report.
111
+
112
+ ```typescript
113
+ const bugReportId = await ctx.runMutation(api.feedback.bugReports.create, {
114
+ title: "Button not working",
115
+ description: "The submit button doesn't respond to clicks",
116
+ severity: "high", // low | medium | high | critical
117
+ reporterType: "staff", // staff | customer
118
+ reporterId: "user_123",
119
+ reporterEmail: "user@example.com",
120
+ reporterName: "John Doe",
121
+ url: "https://app.example.com/form",
122
+ route: "/form",
123
+ browserInfo: JSON.stringify({ userAgent: "..." }),
124
+ consoleErrors: JSON.stringify([{ message: "Error..." }]),
125
+ screenshotStorageId: "storage_id_here", // optional
126
+ viewportWidth: 1920,
127
+ viewportHeight: 1080,
128
+ networkState: "online",
129
+ });
130
+ ```
131
+
132
+ #### `bugReports.list`
133
+
134
+ List bug reports with optional filters.
135
+
136
+ ```typescript
137
+ const reports = await ctx.runQuery(api.feedback.bugReports.list, {
138
+ status: "open", // optional: open | in-progress | resolved | closed
139
+ severity: "high", // optional: low | medium | high | critical
140
+ includeArchived: false, // optional, default: false
141
+ limit: 50, // optional, default: 50
142
+ });
143
+ ```
144
+
145
+ #### `bugReports.get`
146
+
147
+ Get a single bug report by ID.
148
+
149
+ ```typescript
150
+ const report = await ctx.runQuery(api.feedback.bugReports.get, {
151
+ reportId: "bug_report_id",
152
+ });
153
+ ```
154
+
155
+ #### `bugReports.updateStatus`
156
+
157
+ Update the status of a bug report.
158
+
159
+ ```typescript
160
+ await ctx.runMutation(api.feedback.bugReports.updateStatus, {
161
+ reportId: "bug_report_id",
162
+ status: "resolved",
163
+ });
164
+ ```
165
+
166
+ #### `bugReports.archive` / `bugReports.unarchive`
167
+
168
+ Archive or unarchive a bug report.
169
+
170
+ ```typescript
171
+ await ctx.runMutation(api.feedback.bugReports.archive, {
172
+ reportId: "bug_report_id",
173
+ });
174
+ ```
175
+
176
+ ### Feedback
177
+
178
+ #### `feedback.create`
179
+
180
+ Create new feedback.
181
+
182
+ ```typescript
183
+ const feedbackId = await ctx.runMutation(api.feedback.feedback.create, {
184
+ type: "feature_request", // feature_request | change_request | general
185
+ title: "Dark mode support",
186
+ description: "Please add dark mode to reduce eye strain",
187
+ priority: "important", // nice_to_have | important | critical
188
+ reporterType: "customer",
189
+ reporterId: "customer_123",
190
+ reporterEmail: "customer@example.com",
191
+ reporterName: "Jane Doe",
192
+ url: "https://app.example.com/settings",
193
+ browserInfo: JSON.stringify({ userAgent: "..." }),
194
+ viewportWidth: 1920,
195
+ viewportHeight: 1080,
196
+ networkState: "online",
197
+ });
198
+ ```
199
+
200
+ #### `feedback.list`
201
+
202
+ List feedback with optional filters.
203
+
204
+ ```typescript
205
+ const items = await ctx.runQuery(api.feedback.feedback.list, {
206
+ status: "open", // optional
207
+ type: "feature_request", // optional
208
+ priority: "important", // optional
209
+ includeArchived: false, // optional
210
+ limit: 50, // optional
211
+ });
212
+ ```
213
+
214
+ ### Support Teams
215
+
216
+ #### `supportTeams.create`
217
+
218
+ Create a support team for notification routing.
219
+
220
+ ```typescript
221
+ const teamId = await ctx.runMutation(api.feedback.supportTeams.create, {
222
+ teamName: "Engineering Team",
223
+ memberEmails: ["dev1@example.com", "dev2@example.com"],
224
+ feedbackTypes: ["feature_request", "change_request"],
225
+ bugReportSeverities: ["high", "critical"],
226
+ });
227
+ ```
228
+
229
+ #### `supportTeams.list`
230
+
231
+ List all support teams.
232
+
233
+ ```typescript
234
+ const teams = await ctx.runQuery(api.feedback.supportTeams.list, {
235
+ activeOnly: true, // optional
236
+ });
237
+ ```
238
+
239
+ #### `supportTeams.update`
240
+
241
+ Update a support team.
242
+
243
+ ```typescript
244
+ await ctx.runMutation(api.feedback.supportTeams.update, {
245
+ teamId: "team_id",
246
+ teamName: "Updated Team Name",
247
+ memberEmails: ["new@example.com"],
248
+ isActive: true,
249
+ });
250
+ ```
251
+
252
+ ## React Components
253
+
254
+ ### BugReportProvider
255
+
256
+ Provider component that captures console errors for bug reports. Wrap your app with this provider.
257
+
258
+ ```tsx
259
+ import { BugReportProvider } from '@fatagnus/convex-feedback/react';
260
+
261
+ function App() {
262
+ return (
263
+ <BugReportProvider maxErrors={20}>
264
+ <YourApp />
265
+ </BugReportProvider>
266
+ );
267
+ }
268
+ ```
269
+
270
+ **Props:**
271
+
272
+ | Prop | Type | Default | Description |
273
+ |------|------|---------|-------------|
274
+ | `children` | `ReactNode` | - | Child components |
275
+ | `maxErrors` | `number` | `20` | Maximum console errors to capture |
276
+
277
+ ### BugReportButton
278
+
279
+ Floating action button for submitting bug reports and feedback.
280
+
281
+ ```tsx
282
+ import { BugReportButton } from '@fatagnus/convex-feedback/react';
283
+
284
+ <BugReportButton
285
+ reporterType="staff"
286
+ reporterId={user.id}
287
+ reporterEmail={user.email}
288
+ reporterName={user.name}
289
+ bugReportApi={{
290
+ create: api.feedback.bugReports.create,
291
+ generateUploadUrl: api.feedback.bugReports.generateUploadUrl,
292
+ }}
293
+ feedbackApi={{
294
+ create: api.feedback.feedback.create,
295
+ generateUploadUrl: api.feedback.feedback.generateUploadUrl,
296
+ }}
297
+ position={{ bottom: 20, right: 20 }}
298
+ buttonColor="red"
299
+ showFeedback={true}
300
+ onSuccess={(type) => console.log(`${type} submitted`)}
301
+ onError={(error, type) => console.error(`${type} failed:`, error)}
302
+ />
303
+ ```
304
+
305
+ **Props:**
306
+
307
+ | Prop | Type | Default | Description |
308
+ |------|------|---------|-------------|
309
+ | `reporterType` | `'staff' \| 'customer'` | - | Type of reporter |
310
+ | `reporterId` | `string` | - | Unique reporter identifier |
311
+ | `reporterEmail` | `string` | - | Reporter's email |
312
+ | `reporterName` | `string` | - | Reporter's display name |
313
+ | `bugReportApi` | `object` | - | Convex API references for bug reports |
314
+ | `feedbackApi` | `object` | - | Convex API references for feedback |
315
+ | `position` | `object` | `{ bottom: 20, right: 20 }` | FAB position |
316
+ | `buttonColor` | `string` | `'red'` | Button color |
317
+ | `showFeedback` | `boolean` | `true` | Show feedback tab |
318
+ | `onSuccess` | `function` | - | Success callback |
319
+ | `onError` | `function` | - | Error callback |
320
+
321
+ ### useBugReportContext
322
+
323
+ Hook to access the bug report context for error capture.
324
+
325
+ ```tsx
326
+ import { useBugReportContext } from '@fatagnus/convex-feedback/react';
327
+
328
+ function MyComponent() {
329
+ const { getConsoleErrors, clearConsoleErrors } = useBugReportContext();
330
+
331
+ const errors = getConsoleErrors();
332
+ // ...
333
+ }
334
+ ```
335
+
336
+ ## AI Analysis
337
+
338
+ When `OPENROUTER_API_KEY` is configured, the component automatically analyzes submissions:
339
+
340
+ ### Bug Reports
341
+
342
+ - **Summary** - Concise description of the bug
343
+ - **Root Cause Analysis** - Potential underlying causes
344
+ - **Reproduction Steps** - Steps to reproduce the issue
345
+ - **Suggested Fix** - Recommended approach to resolve
346
+ - **Estimated Effort** - Low/Medium/High effort estimate
347
+ - **Suggested Severity** - AI-recommended severity level
348
+
349
+ ### Feedback
350
+
351
+ - **Summary** - Concise description of the feedback
352
+ - **Impact Analysis** - What areas/users are affected
353
+ - **Action Items** - Concrete next steps
354
+ - **Estimated Effort** - Low/Medium/High effort estimate
355
+ - **Suggested Priority** - AI-recommended priority level
356
+
357
+ ## Email Notifications
358
+
359
+ When `RESEND_API_KEY` is configured, the component sends email notifications:
360
+
361
+ ### To Reporters
362
+
363
+ - Thank you email with submission summary
364
+ - Professional HTML email template
365
+
366
+ ### To Support Teams
367
+
368
+ - Full submission details with AI analysis
369
+ - Routed based on feedback type or bug severity
370
+ - Rich HTML template with all diagnostics
371
+
372
+ ## Schema
373
+
374
+ The component creates these tables:
375
+
376
+ - `bugReports` - Bug report submissions
377
+ - `feedback` - Feedback submissions
378
+ - `supportTeams` - Team configuration for notification routing
379
+
380
+ ## License
381
+
382
+ Apache-2.0
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Bug Report AI Agent
3
+ *
4
+ * Automatically analyzes bug report submissions and generates:
5
+ * - Summary of the bug
6
+ * - Root cause analysis
7
+ * - Reproduction steps
8
+ * - Suggested fix
9
+ * - Estimated effort (low/medium/high)
10
+ * - Suggested severity (low/medium/high/critical)
11
+ *
12
+ * Triggers email notifications to the reporter and assigned team.
13
+ */
14
+ import { Agent } from "@convex-dev/agent";
15
+ /**
16
+ * Bug Report Analysis Agent
17
+ *
18
+ * Analyzes bug report submissions and generates comprehensive analysis.
19
+ */
20
+ export declare const bugReportAgent: Agent<object, {}>;
21
+ /**
22
+ * Get bug report by ID for analysis
23
+ */
24
+ export declare const getBugReportForAnalysis: any;
25
+ /**
26
+ * Analyze bug report using AI and send notifications.
27
+ * This is the main entry point triggered after bug report creation.
28
+ */
29
+ export declare const processBugReport: any;
30
+ //# sourceMappingURL=bugReportAgent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bugReportAgent.d.ts","sourceRoot":"","sources":["../../../src/convex/agents/bugReportAgent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,KAAK,EAAgB,MAAM,mBAAmB,CAAC;AAsBxD;;;;GAIG;AACH,eAAO,MAAM,cAAc,mBAsCzB,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,uBAAuB,KAmClC,CAAC;AAMH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,KA8I3B,CAAC"}