@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.
- package/LICENSE +177 -0
- package/README.md +382 -0
- package/dist/convex/agents/bugReportAgent.d.ts +30 -0
- package/dist/convex/agents/bugReportAgent.d.ts.map +1 -0
- package/dist/convex/agents/bugReportAgent.js +243 -0
- package/dist/convex/agents/bugReportAgent.js.map +1 -0
- package/dist/convex/agents/feedbackAgent.d.ts +29 -0
- package/dist/convex/agents/feedbackAgent.d.ts.map +1 -0
- package/dist/convex/agents/feedbackAgent.js +232 -0
- package/dist/convex/agents/feedbackAgent.js.map +1 -0
- package/dist/convex/bugReports.d.ts +49 -0
- package/dist/convex/bugReports.d.ts.map +1 -0
- package/dist/convex/bugReports.js +321 -0
- package/dist/convex/bugReports.js.map +1 -0
- package/dist/convex/convex.config.d.ts +3 -0
- package/dist/convex/convex.config.d.ts.map +1 -0
- package/dist/convex/convex.config.js +6 -0
- package/dist/convex/convex.config.js.map +1 -0
- package/dist/convex/emails/bugReportEmails.d.ts +16 -0
- package/dist/convex/emails/bugReportEmails.d.ts.map +1 -0
- package/dist/convex/emails/bugReportEmails.js +403 -0
- package/dist/convex/emails/bugReportEmails.js.map +1 -0
- package/dist/convex/emails/feedbackEmails.d.ts +16 -0
- package/dist/convex/emails/feedbackEmails.d.ts.map +1 -0
- package/dist/convex/emails/feedbackEmails.js +389 -0
- package/dist/convex/emails/feedbackEmails.js.map +1 -0
- package/dist/convex/feedback.d.ts +49 -0
- package/dist/convex/feedback.d.ts.map +1 -0
- package/dist/convex/feedback.js +327 -0
- package/dist/convex/feedback.js.map +1 -0
- package/dist/convex/index.d.ts +10 -0
- package/dist/convex/index.d.ts.map +1 -0
- package/dist/convex/index.js +12 -0
- package/dist/convex/index.js.map +1 -0
- package/dist/convex/schema.d.ts +200 -0
- package/dist/convex/schema.d.ts.map +1 -0
- package/dist/convex/schema.js +150 -0
- package/dist/convex/schema.js.map +1 -0
- package/dist/convex/supportTeams.d.ts +29 -0
- package/dist/convex/supportTeams.d.ts.map +1 -0
- package/dist/convex/supportTeams.js +159 -0
- package/dist/convex/supportTeams.js.map +1 -0
- package/dist/index.d.ts +70 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -0
- package/dist/react/BugReportButton.d.ts +70 -0
- package/dist/react/BugReportButton.d.ts.map +1 -0
- package/dist/react/BugReportButton.js +371 -0
- package/dist/react/BugReportButton.js.map +1 -0
- package/dist/react/BugReportContext.d.ts +59 -0
- package/dist/react/BugReportContext.d.ts.map +1 -0
- package/dist/react/BugReportContext.js +107 -0
- package/dist/react/BugReportContext.js.map +1 -0
- package/dist/react/index.d.ts +36 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +36 -0
- package/dist/react/index.js.map +1 -0
- package/dist/types.d.ts +89 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +101 -0
- package/src/convex/agents/bugReportAgent.ts +277 -0
- package/src/convex/agents/feedbackAgent.ts +264 -0
- package/src/convex/bugReports.ts +350 -0
- package/src/convex/convex.config.ts +7 -0
- package/src/convex/emails/bugReportEmails.ts +479 -0
- package/src/convex/emails/feedbackEmails.ts +465 -0
- package/src/convex/feedback.ts +356 -0
- package/src/convex/index.ts +28 -0
- package/src/convex/schema.ts +207 -0
- package/src/convex/supportTeams.ts +179 -0
- package/src/index.ts +77 -0
- package/src/react/BugReportButton.tsx +755 -0
- package/src/react/BugReportContext.tsx +146 -0
- package/src/react/index.ts +46 -0
- package/src/types.ts +93 -0
|
@@ -0,0 +1,243 @@
|
|
|
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 { v } from "convex/values";
|
|
15
|
+
import { Agent, createThread } from "@convex-dev/agent";
|
|
16
|
+
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
|
|
17
|
+
import { components, internal } from "../_generated/api";
|
|
18
|
+
import { internalAction, internalQuery } from "../_generated/server";
|
|
19
|
+
// Create OpenRouter provider
|
|
20
|
+
const openrouter = createOpenAICompatible({
|
|
21
|
+
name: "openrouter",
|
|
22
|
+
baseURL: "https://openrouter.ai/api/v1",
|
|
23
|
+
headers: {
|
|
24
|
+
Authorization: `Bearer ${process.env.OPENROUTER_API_KEY}`,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
// Agent name constant
|
|
28
|
+
const AGENT_NAME = "Bug Report Analyst";
|
|
29
|
+
// ============================================================================
|
|
30
|
+
// Agent Definition
|
|
31
|
+
// ============================================================================
|
|
32
|
+
/**
|
|
33
|
+
* Bug Report Analysis Agent
|
|
34
|
+
*
|
|
35
|
+
* Analyzes bug report submissions and generates comprehensive analysis.
|
|
36
|
+
*/
|
|
37
|
+
export const bugReportAgent = new Agent(components.agent, {
|
|
38
|
+
name: AGENT_NAME,
|
|
39
|
+
languageModel: openrouter.languageModel("anthropic/claude-sonnet-4"),
|
|
40
|
+
instructions: `You are the Bug Report Analyst, an AI assistant that analyzes bug report submissions.
|
|
41
|
+
|
|
42
|
+
When given a bug report, you will:
|
|
43
|
+
1. **Summarize** the bug in 2-3 clear sentences
|
|
44
|
+
2. **Analyze Root Cause** - identify potential underlying causes based on the symptoms described
|
|
45
|
+
3. **Extract Reproduction Steps** - create clear, numbered steps to reproduce the bug
|
|
46
|
+
4. **Suggest Fix** - provide a recommended approach to fix the bug
|
|
47
|
+
5. **Estimate Effort** - rate as "low" (< 1 day), "medium" (1-3 days), or "high" (> 3 days)
|
|
48
|
+
6. **Suggest Severity** - rate as "low" (minor inconvenience), "medium" (affects workflow), "high" (blocks work), or "critical" (data loss/security)
|
|
49
|
+
|
|
50
|
+
## Response Format
|
|
51
|
+
Always respond in the following JSON format:
|
|
52
|
+
\`\`\`json
|
|
53
|
+
{
|
|
54
|
+
"summary": "A 2-3 sentence summary of the bug",
|
|
55
|
+
"rootCauseAnalysis": "Analysis of potential root cause",
|
|
56
|
+
"reproductionSteps": ["Step 1", "Step 2", "Step 3"],
|
|
57
|
+
"suggestedFix": "Recommended approach to fix the bug",
|
|
58
|
+
"estimatedEffort": "low" | "medium" | "high",
|
|
59
|
+
"suggestedSeverity": "low" | "medium" | "high" | "critical",
|
|
60
|
+
"reasoning": "Brief explanation for estimates"
|
|
61
|
+
}
|
|
62
|
+
\`\`\`
|
|
63
|
+
|
|
64
|
+
## Guidelines
|
|
65
|
+
- Be precise and technical in your analysis
|
|
66
|
+
- Consider edge cases and related issues
|
|
67
|
+
- Reproduction steps should be specific and actionable
|
|
68
|
+
- Suggested fix should be practical and implementable
|
|
69
|
+
- Effort estimation should account for investigation, fix, testing, and deployment
|
|
70
|
+
- Severity should reflect user impact and business criticality`,
|
|
71
|
+
tools: {},
|
|
72
|
+
maxSteps: 3,
|
|
73
|
+
});
|
|
74
|
+
// ============================================================================
|
|
75
|
+
// Internal Queries
|
|
76
|
+
// ============================================================================
|
|
77
|
+
/**
|
|
78
|
+
* Get bug report by ID for analysis
|
|
79
|
+
*/
|
|
80
|
+
export const getBugReportForAnalysis = internalQuery({
|
|
81
|
+
args: {
|
|
82
|
+
bugReportId: v.id("bugReports"),
|
|
83
|
+
},
|
|
84
|
+
returns: v.union(v.object({
|
|
85
|
+
_id: v.id("bugReports"),
|
|
86
|
+
title: v.string(),
|
|
87
|
+
description: v.string(),
|
|
88
|
+
severity: v.string(),
|
|
89
|
+
reporterName: v.string(),
|
|
90
|
+
reporterEmail: v.string(),
|
|
91
|
+
url: v.string(),
|
|
92
|
+
browserInfo: v.string(),
|
|
93
|
+
consoleErrors: v.optional(v.string()),
|
|
94
|
+
}), v.null()),
|
|
95
|
+
handler: async (ctx, args) => {
|
|
96
|
+
const bugReport = await ctx.db.get(args.bugReportId);
|
|
97
|
+
if (!bugReport) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
_id: bugReport._id,
|
|
102
|
+
title: bugReport.title,
|
|
103
|
+
description: bugReport.description,
|
|
104
|
+
severity: bugReport.severity,
|
|
105
|
+
reporterName: bugReport.reporterName,
|
|
106
|
+
reporterEmail: bugReport.reporterEmail,
|
|
107
|
+
url: bugReport.url,
|
|
108
|
+
browserInfo: bugReport.browserInfo,
|
|
109
|
+
consoleErrors: bugReport.consoleErrors,
|
|
110
|
+
};
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
// ============================================================================
|
|
114
|
+
// Main Processing Action
|
|
115
|
+
// ============================================================================
|
|
116
|
+
/**
|
|
117
|
+
* Analyze bug report using AI and send notifications.
|
|
118
|
+
* This is the main entry point triggered after bug report creation.
|
|
119
|
+
*/
|
|
120
|
+
export const processBugReport = internalAction({
|
|
121
|
+
args: {
|
|
122
|
+
bugReportId: v.id("bugReports"),
|
|
123
|
+
},
|
|
124
|
+
returns: v.object({
|
|
125
|
+
success: v.boolean(),
|
|
126
|
+
error: v.optional(v.string()),
|
|
127
|
+
}),
|
|
128
|
+
handler: async (ctx, args) => {
|
|
129
|
+
// Check if OpenRouter API key is configured
|
|
130
|
+
if (!process.env.OPENROUTER_API_KEY) {
|
|
131
|
+
console.log("OPENROUTER_API_KEY not configured, skipping AI analysis");
|
|
132
|
+
// Still try to send notifications without AI analysis
|
|
133
|
+
try {
|
|
134
|
+
await ctx.runAction(internal.emails.bugReportEmails.sendBugReportNotifications, {
|
|
135
|
+
reportId: args.bugReportId,
|
|
136
|
+
analysis: null,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
console.log("Email notifications not configured");
|
|
141
|
+
}
|
|
142
|
+
return { success: true };
|
|
143
|
+
}
|
|
144
|
+
// Get the bug report
|
|
145
|
+
const bugReport = await ctx.runQuery(internal.agents.bugReportAgent.getBugReportForAnalysis, {
|
|
146
|
+
bugReportId: args.bugReportId,
|
|
147
|
+
});
|
|
148
|
+
if (!bugReport) {
|
|
149
|
+
return { success: false, error: "Bug report not found" };
|
|
150
|
+
}
|
|
151
|
+
// Create a thread for this analysis
|
|
152
|
+
const threadId = await createThread(ctx, components.agent, {
|
|
153
|
+
title: `Bug Report Analysis: ${bugReport.title}`,
|
|
154
|
+
});
|
|
155
|
+
// Build the prompt for analysis
|
|
156
|
+
const consoleErrorsSection = bugReport.consoleErrors
|
|
157
|
+
? `**Console Errors:** ${bugReport.consoleErrors}`
|
|
158
|
+
: "";
|
|
159
|
+
const analysisPrompt = `Please analyze the following bug report:
|
|
160
|
+
|
|
161
|
+
**Title:** ${bugReport.title}
|
|
162
|
+
**Description:** ${bugReport.description}
|
|
163
|
+
**Reporter Severity:** ${bugReport.severity}
|
|
164
|
+
**Submitted From:** ${bugReport.url}
|
|
165
|
+
**Browser Info:** ${bugReport.browserInfo}
|
|
166
|
+
${consoleErrorsSection}
|
|
167
|
+
|
|
168
|
+
Provide your analysis in the JSON format specified.`;
|
|
169
|
+
// Generate analysis using the agent
|
|
170
|
+
let result;
|
|
171
|
+
try {
|
|
172
|
+
result = await bugReportAgent.generateText(ctx, { threadId }, { prompt: analysisPrompt });
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
console.error("AI analysis failed:", error);
|
|
176
|
+
return { success: false, error: `AI analysis failed: ${error instanceof Error ? error.message : String(error)}` };
|
|
177
|
+
}
|
|
178
|
+
// Parse the AI response
|
|
179
|
+
let analysis;
|
|
180
|
+
try {
|
|
181
|
+
// Extract JSON from the response (handle markdown code blocks)
|
|
182
|
+
const jsonMatch = result.text.match(/```json\s*([\s\S]*?)\s*```/);
|
|
183
|
+
const jsonStr = jsonMatch ? jsonMatch[1] : result.text;
|
|
184
|
+
const parsed = JSON.parse(jsonStr);
|
|
185
|
+
analysis = {
|
|
186
|
+
summary: parsed.summary || "Unable to generate summary",
|
|
187
|
+
rootCauseAnalysis: parsed.rootCauseAnalysis || "Unable to generate root cause analysis",
|
|
188
|
+
reproductionSteps: Array.isArray(parsed.reproductionSteps) ? parsed.reproductionSteps : [],
|
|
189
|
+
suggestedFix: parsed.suggestedFix || "Unable to generate suggested fix",
|
|
190
|
+
estimatedEffort: ["low", "medium", "high"].includes(parsed.estimatedEffort)
|
|
191
|
+
? parsed.estimatedEffort
|
|
192
|
+
: "medium",
|
|
193
|
+
suggestedSeverity: ["low", "medium", "high", "critical"].includes(parsed.suggestedSeverity)
|
|
194
|
+
? parsed.suggestedSeverity
|
|
195
|
+
: bugReport.severity,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
// If parsing fails, create a basic analysis from the text
|
|
200
|
+
analysis = {
|
|
201
|
+
summary: result.text.substring(0, 500),
|
|
202
|
+
rootCauseAnalysis: "AI analysis parsing failed. Please review manually.",
|
|
203
|
+
reproductionSteps: ["Review bug report manually", "Contact reporter for clarification"],
|
|
204
|
+
suggestedFix: "Manual investigation required.",
|
|
205
|
+
estimatedEffort: "medium",
|
|
206
|
+
suggestedSeverity: bugReport.severity,
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
// Update bug report with analysis
|
|
210
|
+
await ctx.runMutation(internal.bugReports.updateWithAnalysis, {
|
|
211
|
+
bugReportId: args.bugReportId,
|
|
212
|
+
aiSummary: analysis.summary,
|
|
213
|
+
aiRootCauseAnalysis: analysis.rootCauseAnalysis,
|
|
214
|
+
aiReproductionSteps: analysis.reproductionSteps,
|
|
215
|
+
aiSuggestedFix: analysis.suggestedFix,
|
|
216
|
+
aiEstimatedEffort: analysis.estimatedEffort,
|
|
217
|
+
aiSuggestedSeverity: analysis.suggestedSeverity,
|
|
218
|
+
aiThreadId: threadId,
|
|
219
|
+
});
|
|
220
|
+
// Send email notifications
|
|
221
|
+
try {
|
|
222
|
+
await ctx.runAction(internal.emails.bugReportEmails.sendBugReportNotifications, {
|
|
223
|
+
reportId: args.bugReportId,
|
|
224
|
+
analysis: {
|
|
225
|
+
summary: analysis.summary,
|
|
226
|
+
rootCauseAnalysis: analysis.rootCauseAnalysis,
|
|
227
|
+
reproductionSteps: analysis.reproductionSteps,
|
|
228
|
+
suggestedFix: analysis.suggestedFix,
|
|
229
|
+
estimatedEffort: analysis.estimatedEffort,
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
// Mark notifications as sent
|
|
233
|
+
await ctx.runMutation(internal.bugReports.markNotificationsSent, {
|
|
234
|
+
bugReportId: args.bugReportId,
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
catch {
|
|
238
|
+
console.log("Email notifications not configured or failed");
|
|
239
|
+
}
|
|
240
|
+
return { success: true };
|
|
241
|
+
},
|
|
242
|
+
});
|
|
243
|
+
//# sourceMappingURL=bugReportAgent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bugReportAgent.js","sourceRoot":"","sources":["../../../src/convex/agents/bugReportAgent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrE,6BAA6B;AAC7B,MAAM,UAAU,GAAG,sBAAsB,CAAC;IACxC,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,8BAA8B;IACvC,OAAO,EAAE;QACP,aAAa,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AAC,CAAC;YAEH,6BAA6B;YAC7B,MAAM,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,UAAU,CAAC,qBAAqB,EAAE;gBAC/D,WAAW,EAAE,IAAI,CAAC,WAAW;aAC9B,CAAC,CAAC;QACL,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC;QAC9D,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feedback AI Agent
|
|
3
|
+
*
|
|
4
|
+
* Automatically analyzes feedback submissions and generates:
|
|
5
|
+
* - Summary of the feedback
|
|
6
|
+
* - Impact analysis (affected areas, users, systems)
|
|
7
|
+
* - Suggested action items
|
|
8
|
+
* - Estimated effort (low/medium/high)
|
|
9
|
+
* - Priority recommendations
|
|
10
|
+
*
|
|
11
|
+
* Triggers email notifications to the reporter and assigned team.
|
|
12
|
+
*/
|
|
13
|
+
import { Agent } from "@convex-dev/agent";
|
|
14
|
+
/**
|
|
15
|
+
* Feedback Analysis Agent
|
|
16
|
+
*
|
|
17
|
+
* Analyzes feedback submissions and generates comprehensive reports.
|
|
18
|
+
*/
|
|
19
|
+
export declare const feedbackAgent: Agent<object, {}>;
|
|
20
|
+
/**
|
|
21
|
+
* Get feedback by ID for analysis
|
|
22
|
+
*/
|
|
23
|
+
export declare const getFeedbackForAnalysis: any;
|
|
24
|
+
/**
|
|
25
|
+
* Analyze feedback using AI and send notifications.
|
|
26
|
+
* This is the main entry point triggered after feedback creation.
|
|
27
|
+
*/
|
|
28
|
+
export declare const processFeedback: any;
|
|
29
|
+
//# sourceMappingURL=feedbackAgent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedbackAgent.d.ts","sourceRoot":"","sources":["../../../src/convex/agents/feedbackAgent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,KAAK,EAAgB,MAAM,mBAAmB,CAAC;AAsBxD;;;;GAIG;AACH,eAAO,MAAM,aAAa,mBAmCxB,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,sBAAsB,KAmCjC,CAAC;AAMH;;;GAGG;AACH,eAAO,MAAM,eAAe,KAqI1B,CAAC"}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feedback AI Agent
|
|
3
|
+
*
|
|
4
|
+
* Automatically analyzes feedback submissions and generates:
|
|
5
|
+
* - Summary of the feedback
|
|
6
|
+
* - Impact analysis (affected areas, users, systems)
|
|
7
|
+
* - Suggested action items
|
|
8
|
+
* - Estimated effort (low/medium/high)
|
|
9
|
+
* - Priority recommendations
|
|
10
|
+
*
|
|
11
|
+
* Triggers email notifications to the reporter and assigned team.
|
|
12
|
+
*/
|
|
13
|
+
import { v } from "convex/values";
|
|
14
|
+
import { Agent, createThread } from "@convex-dev/agent";
|
|
15
|
+
import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
|
|
16
|
+
import { components, internal } from "../_generated/api";
|
|
17
|
+
import { internalAction, internalQuery } from "../_generated/server";
|
|
18
|
+
// Create OpenRouter provider
|
|
19
|
+
const openrouter = createOpenAICompatible({
|
|
20
|
+
name: "openrouter",
|
|
21
|
+
baseURL: "https://openrouter.ai/api/v1",
|
|
22
|
+
headers: {
|
|
23
|
+
Authorization: `Bearer ${process.env.OPENROUTER_API_KEY}`,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
// Agent name constant
|
|
27
|
+
const AGENT_NAME = "Feedback Analyst";
|
|
28
|
+
// ============================================================================
|
|
29
|
+
// Agent Definition
|
|
30
|
+
// ============================================================================
|
|
31
|
+
/**
|
|
32
|
+
* Feedback Analysis Agent
|
|
33
|
+
*
|
|
34
|
+
* Analyzes feedback submissions and generates comprehensive reports.
|
|
35
|
+
*/
|
|
36
|
+
export const feedbackAgent = new Agent(components.agent, {
|
|
37
|
+
name: AGENT_NAME,
|
|
38
|
+
languageModel: openrouter.languageModel("anthropic/claude-sonnet-4"),
|
|
39
|
+
instructions: `You are the Feedback Analyst, an AI assistant that analyzes user feedback submissions.
|
|
40
|
+
|
|
41
|
+
When given feedback, you will:
|
|
42
|
+
1. **Summarize** the feedback in 2-3 clear sentences
|
|
43
|
+
2. **Analyze Impact** - identify what areas, users, or systems are affected
|
|
44
|
+
3. **Suggest Action Items** - provide 3-5 concrete next steps to address the feedback
|
|
45
|
+
4. **Estimate Effort** - rate as "low" (< 1 week), "medium" (1-4 weeks), or "high" (> 4 weeks)
|
|
46
|
+
5. **Recommend Priority** - suggest "nice_to_have", "important", or "critical" based on the feedback content
|
|
47
|
+
|
|
48
|
+
## Response Format
|
|
49
|
+
Always respond in the following JSON format:
|
|
50
|
+
\`\`\`json
|
|
51
|
+
{
|
|
52
|
+
"summary": "A 2-3 sentence summary of the feedback",
|
|
53
|
+
"impactAnalysis": "Detailed analysis of what's affected and potential consequences",
|
|
54
|
+
"actionItems": ["Action item 1", "Action item 2", "Action item 3"],
|
|
55
|
+
"estimatedEffort": "low" | "medium" | "high",
|
|
56
|
+
"suggestedPriority": "nice_to_have" | "important" | "critical",
|
|
57
|
+
"reasoning": "Brief explanation for your priority and effort estimates"
|
|
58
|
+
}
|
|
59
|
+
\`\`\`
|
|
60
|
+
|
|
61
|
+
## Guidelines
|
|
62
|
+
- Be objective and constructive in your analysis
|
|
63
|
+
- Consider both technical and business impact
|
|
64
|
+
- Action items should be specific and actionable
|
|
65
|
+
- Effort estimation should account for development, testing, and deployment
|
|
66
|
+
- Priority should reflect urgency and user impact`,
|
|
67
|
+
tools: {},
|
|
68
|
+
maxSteps: 3,
|
|
69
|
+
});
|
|
70
|
+
// ============================================================================
|
|
71
|
+
// Internal Queries
|
|
72
|
+
// ============================================================================
|
|
73
|
+
/**
|
|
74
|
+
* Get feedback by ID for analysis
|
|
75
|
+
*/
|
|
76
|
+
export const getFeedbackForAnalysis = internalQuery({
|
|
77
|
+
args: {
|
|
78
|
+
feedbackId: v.id("feedback"),
|
|
79
|
+
},
|
|
80
|
+
returns: v.union(v.object({
|
|
81
|
+
_id: v.id("feedback"),
|
|
82
|
+
type: v.string(),
|
|
83
|
+
title: v.string(),
|
|
84
|
+
description: v.string(),
|
|
85
|
+
priority: v.string(),
|
|
86
|
+
reporterName: v.string(),
|
|
87
|
+
reporterEmail: v.string(),
|
|
88
|
+
url: v.string(),
|
|
89
|
+
browserInfo: v.string(),
|
|
90
|
+
}), v.null()),
|
|
91
|
+
handler: async (ctx, args) => {
|
|
92
|
+
const feedback = await ctx.db.get(args.feedbackId);
|
|
93
|
+
if (!feedback) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
_id: feedback._id,
|
|
98
|
+
type: feedback.type,
|
|
99
|
+
title: feedback.title,
|
|
100
|
+
description: feedback.description,
|
|
101
|
+
priority: feedback.priority,
|
|
102
|
+
reporterName: feedback.reporterName,
|
|
103
|
+
reporterEmail: feedback.reporterEmail,
|
|
104
|
+
url: feedback.url,
|
|
105
|
+
browserInfo: feedback.browserInfo,
|
|
106
|
+
};
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
// ============================================================================
|
|
110
|
+
// Main Processing Action
|
|
111
|
+
// ============================================================================
|
|
112
|
+
/**
|
|
113
|
+
* Analyze feedback using AI and send notifications.
|
|
114
|
+
* This is the main entry point triggered after feedback creation.
|
|
115
|
+
*/
|
|
116
|
+
export const processFeedback = internalAction({
|
|
117
|
+
args: {
|
|
118
|
+
feedbackId: v.id("feedback"),
|
|
119
|
+
},
|
|
120
|
+
returns: v.object({
|
|
121
|
+
success: v.boolean(),
|
|
122
|
+
error: v.optional(v.string()),
|
|
123
|
+
}),
|
|
124
|
+
handler: async (ctx, args) => {
|
|
125
|
+
// Check if OpenRouter API key is configured
|
|
126
|
+
if (!process.env.OPENROUTER_API_KEY) {
|
|
127
|
+
console.log("OPENROUTER_API_KEY not configured, skipping AI analysis");
|
|
128
|
+
// Still try to send notifications without AI analysis
|
|
129
|
+
try {
|
|
130
|
+
await ctx.runAction(internal.emails.feedbackEmails.sendFeedbackNotifications, {
|
|
131
|
+
feedbackId: args.feedbackId,
|
|
132
|
+
analysis: null,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
console.log("Email notifications not configured");
|
|
137
|
+
}
|
|
138
|
+
return { success: true };
|
|
139
|
+
}
|
|
140
|
+
// Get the feedback
|
|
141
|
+
const feedback = await ctx.runQuery(internal.agents.feedbackAgent.getFeedbackForAnalysis, {
|
|
142
|
+
feedbackId: args.feedbackId,
|
|
143
|
+
});
|
|
144
|
+
if (!feedback) {
|
|
145
|
+
return { success: false, error: "Feedback not found" };
|
|
146
|
+
}
|
|
147
|
+
// Create a thread for this analysis
|
|
148
|
+
const threadId = await createThread(ctx, components.agent, {
|
|
149
|
+
title: `Feedback Analysis: ${feedback.title}`,
|
|
150
|
+
});
|
|
151
|
+
// Build the prompt for analysis
|
|
152
|
+
const analysisPrompt = `Please analyze the following feedback submission:
|
|
153
|
+
|
|
154
|
+
**Type:** ${feedback.type.replace("_", " ")}
|
|
155
|
+
**Title:** ${feedback.title}
|
|
156
|
+
**Description:** ${feedback.description}
|
|
157
|
+
**Reporter Priority:** ${feedback.priority.replace("_", " ")}
|
|
158
|
+
**Submitted From:** ${feedback.url}
|
|
159
|
+
|
|
160
|
+
Provide your analysis in the JSON format specified.`;
|
|
161
|
+
// Generate analysis using the agent
|
|
162
|
+
let result;
|
|
163
|
+
try {
|
|
164
|
+
result = await feedbackAgent.generateText(ctx, { threadId }, { prompt: analysisPrompt });
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
console.error("AI analysis failed:", error);
|
|
168
|
+
return { success: false, error: `AI analysis failed: ${error instanceof Error ? error.message : String(error)}` };
|
|
169
|
+
}
|
|
170
|
+
// Parse the AI response
|
|
171
|
+
let analysis;
|
|
172
|
+
try {
|
|
173
|
+
// Extract JSON from the response (handle markdown code blocks)
|
|
174
|
+
const jsonMatch = result.text.match(/```json\s*([\s\S]*?)\s*```/);
|
|
175
|
+
const jsonStr = jsonMatch ? jsonMatch[1] : result.text;
|
|
176
|
+
const parsed = JSON.parse(jsonStr);
|
|
177
|
+
analysis = {
|
|
178
|
+
summary: parsed.summary || "Unable to generate summary",
|
|
179
|
+
impactAnalysis: parsed.impactAnalysis || "Unable to generate impact analysis",
|
|
180
|
+
actionItems: Array.isArray(parsed.actionItems) ? parsed.actionItems : [],
|
|
181
|
+
estimatedEffort: ["low", "medium", "high"].includes(parsed.estimatedEffort)
|
|
182
|
+
? parsed.estimatedEffort
|
|
183
|
+
: "medium",
|
|
184
|
+
suggestedPriority: ["nice_to_have", "important", "critical"].includes(parsed.suggestedPriority)
|
|
185
|
+
? parsed.suggestedPriority
|
|
186
|
+
: feedback.priority,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
// If parsing fails, create a basic analysis from the text
|
|
191
|
+
analysis = {
|
|
192
|
+
summary: result.text.substring(0, 500),
|
|
193
|
+
impactAnalysis: "AI analysis parsing failed. Please review manually.",
|
|
194
|
+
actionItems: ["Review feedback manually", "Contact reporter for clarification"],
|
|
195
|
+
estimatedEffort: "medium",
|
|
196
|
+
suggestedPriority: feedback.priority,
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
// Update feedback with analysis
|
|
200
|
+
await ctx.runMutation(internal.feedback.updateWithAnalysis, {
|
|
201
|
+
feedbackId: args.feedbackId,
|
|
202
|
+
aiSummary: analysis.summary,
|
|
203
|
+
aiImpactAnalysis: analysis.impactAnalysis,
|
|
204
|
+
aiActionItems: analysis.actionItems,
|
|
205
|
+
aiEstimatedEffort: analysis.estimatedEffort,
|
|
206
|
+
aiSuggestedPriority: analysis.suggestedPriority,
|
|
207
|
+
aiThreadId: threadId,
|
|
208
|
+
});
|
|
209
|
+
// Send email notifications
|
|
210
|
+
try {
|
|
211
|
+
await ctx.runAction(internal.emails.feedbackEmails.sendFeedbackNotifications, {
|
|
212
|
+
feedbackId: args.feedbackId,
|
|
213
|
+
analysis: {
|
|
214
|
+
summary: analysis.summary,
|
|
215
|
+
impactAnalysis: analysis.impactAnalysis,
|
|
216
|
+
actionItems: analysis.actionItems,
|
|
217
|
+
estimatedEffort: analysis.estimatedEffort,
|
|
218
|
+
suggestedPriority: analysis.suggestedPriority,
|
|
219
|
+
},
|
|
220
|
+
});
|
|
221
|
+
// Mark notifications as sent
|
|
222
|
+
await ctx.runMutation(internal.feedback.markNotificationsSent, {
|
|
223
|
+
feedbackId: args.feedbackId,
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
catch {
|
|
227
|
+
console.log("Email notifications not configured or failed");
|
|
228
|
+
}
|
|
229
|
+
return { success: true };
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
//# sourceMappingURL=feedbackAgent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedbackAgent.js","sourceRoot":"","sources":["../../../src/convex/agents/feedbackAgent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrE,6BAA6B;AAC7B,MAAM,UAAU,GAAG,sBAAsB,CAAC;IACxC,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,8BAA8B;IACvC,OAAO,EAAE;QACP,aAAa,EAAE,UAAU,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE;KAC1D;CACF,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AAE,CAAC;IAC3B,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a new bug report.
|
|
3
|
+
* This mutation is intentionally public (no auth required) because:
|
|
4
|
+
* 1. We want to capture bugs even when auth might be broken
|
|
5
|
+
* 2. The reporter info is passed explicitly from the client
|
|
6
|
+
*/
|
|
7
|
+
export declare const create: any;
|
|
8
|
+
/**
|
|
9
|
+
* List bug reports with optional filters.
|
|
10
|
+
* By default, archived items are excluded unless includeArchived is true.
|
|
11
|
+
*/
|
|
12
|
+
export declare const list: any;
|
|
13
|
+
/**
|
|
14
|
+
* Get a single bug report by ID.
|
|
15
|
+
*/
|
|
16
|
+
export declare const get: any;
|
|
17
|
+
/**
|
|
18
|
+
* Update bug report status.
|
|
19
|
+
*/
|
|
20
|
+
export declare const updateStatus: any;
|
|
21
|
+
/**
|
|
22
|
+
* Generate upload URL for screenshot.
|
|
23
|
+
*/
|
|
24
|
+
export declare const generateUploadUrl: any;
|
|
25
|
+
/**
|
|
26
|
+
* Get screenshot URL from storage ID.
|
|
27
|
+
*/
|
|
28
|
+
export declare const getScreenshotUrl: any;
|
|
29
|
+
/**
|
|
30
|
+
* Archive a bug report.
|
|
31
|
+
*/
|
|
32
|
+
export declare const archive: any;
|
|
33
|
+
/**
|
|
34
|
+
* Unarchive a bug report.
|
|
35
|
+
*/
|
|
36
|
+
export declare const unarchive: any;
|
|
37
|
+
/**
|
|
38
|
+
* Get AI analysis for a specific bug report.
|
|
39
|
+
*/
|
|
40
|
+
export declare const getAiAnalysis: any;
|
|
41
|
+
/**
|
|
42
|
+
* Internal mutation to update bug report with AI analysis results
|
|
43
|
+
*/
|
|
44
|
+
export declare const updateWithAnalysis: any;
|
|
45
|
+
/**
|
|
46
|
+
* Internal mutation to mark notifications as sent
|
|
47
|
+
*/
|
|
48
|
+
export declare const markNotificationsSent: any;
|
|
49
|
+
//# sourceMappingURL=bugReports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bugReports.d.ts","sourceRoot":"","sources":["../../src/convex/bugReports.ts"],"names":[],"mappings":"AA6CA;;;;;GAKG;AACH,eAAO,MAAM,MAAM,KAwDjB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,IAAI,KA0Cf,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,GAAG,KAQd,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY,KAmBvB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB,KAM5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB,KAQ3B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,OAAO,KAkBlB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,SAAS,KAkBpB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa,KAkCxB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB,KA0B7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB,KAYhC,CAAC"}
|