@mgsoftwarebv/mcp-server-bridge 2.20.2 → 2.23.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/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import { Octokit } from '@octokit/rest';
9
9
  var args = process.argv.slice(2);
10
10
  var apiKey = args.find((arg) => arg.startsWith("--api-key="))?.split("=")[1] || process.env.MG_TICKETS_API_KEY;
11
11
  var supabaseUrl = args.find((arg) => arg.startsWith("--supabase-url="))?.split("=")[1] || process.env.SUPABASE_URL || "https://cvjdbczxyczjnatuolsk.supabase.co";
12
- var supabaseKey = args.find((arg) => arg.startsWith("--supabase-key="))?.split("=")[1] || process.env.SUPABASE_SERVICE_ROLE_KEY || "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImN2amRiY3p4eWN6am5hdHVvbHNrIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc1NjE0NzcyNCwiZXhwIjoyMDcxNzIzNzI0fQ.LljuNdCZXDcSIVTeIVOSNsvGNBfWsIM1QIswBJmGXKE";
12
+ var supabaseKey = args.find((arg) => arg.startsWith("--supabase-key="))?.split("=")[1] || process.env.SUPABASE_SERVICE_ROLE_KEY || "sb_secret_ZLVeVsj5-fjX9PPZAcC4lw_OEB0dhGL";
13
13
  if (!apiKey) {
14
14
  console.error("\u274C API key is required. Use --api-key=your_key or set MG_TICKETS_API_KEY environment variable");
15
15
  process.exit(1);
@@ -296,28 +296,16 @@ var TOOLS = [
296
296
  // === NEW AI SESSION TOOLS ===
297
297
  {
298
298
  name: "start-ai-session-smart",
299
- description: "Start a new AI development session with automatic tracking (time breakdown provided by Cursor AI)",
299
+ description: "Start a new AI development session with automatic tracking",
300
300
  inputSchema: {
301
301
  type: "object",
302
302
  properties: {
303
303
  ticketId: { type: "string" },
304
304
  ticketUrl: { type: "string", description: "URL to the ticket" },
305
305
  cursorSessionId: { type: "string", description: "Cursor session identifier" },
306
- codebaseContext: {
307
- type: "array",
308
- items: { type: "string" },
309
- description: "Relevant files for complexity analysis"
310
- },
311
- timeBreakdown: {
312
- type: "object",
313
- description: "Time estimate breakdown by development phase (REQUIRED)",
314
- properties: {
315
- analysisMinutes: { type: "number", description: "Ticket/context analysis time" },
316
- investigationMinutes: { type: "number", description: "Bug investigation/reproduction (0 if not a bug)" },
317
- developmentMinutes: { type: "number", description: "Actual coding/fixing time" },
318
- communicationMinutes: { type: "number", description: "Customer response writing time" }
319
- },
320
- required: ["analysisMinutes", "investigationMinutes", "developmentMinutes", "communicationMinutes"]
306
+ totalEstimatedMinutes: {
307
+ type: "number",
308
+ description: "Total estimated time in minutes (senior dev WITHOUT AI, rounded to 15 min)"
321
309
  },
322
310
  complexityScore: {
323
311
  type: "number",
@@ -326,7 +314,7 @@ var TOOLS = [
326
314
  description: "Estimated complexity from 1-10"
327
315
  }
328
316
  },
329
- required: ["ticketId", "timeBreakdown"]
317
+ required: ["ticketId", "totalEstimatedMinutes"]
330
318
  }
331
319
  },
332
320
  {
@@ -987,91 +975,34 @@ ${description ? `Description: ${description}
987
975
  }
988
976
  // === AI SESSION TOOLS ===
989
977
  case "start-ai-session-smart": {
990
- const { ticketId, ticketUrl, cursorSessionId, codebaseContext, timeBreakdown, complexityScore } = args2;
991
- if (!timeBreakdown || !timeBreakdown.analysisMinutes || timeBreakdown.developmentMinutes === void 0) {
992
- throw new Error("timeBreakdown is required with all phases: analysisMinutes, investigationMinutes, developmentMinutes, communicationMinutes");
993
- }
994
- const roundedTimeBreakdown = {
995
- analysisMinutes: roundToNearest15Minutes(timeBreakdown.analysisMinutes || 0),
996
- investigationMinutes: roundToNearest15Minutes(timeBreakdown.investigationMinutes || 0),
997
- developmentMinutes: roundToNearest15Minutes(timeBreakdown.developmentMinutes || 0),
998
- communicationMinutes: roundToNearest15Minutes(timeBreakdown.communicationMinutes || 0)
999
- };
1000
- const totalEstimateMinutes = roundedTimeBreakdown.analysisMinutes + roundedTimeBreakdown.investigationMinutes + roundedTimeBreakdown.developmentMinutes + roundedTimeBreakdown.communicationMinutes;
978
+ const { ticketId, ticketUrl, cursorSessionId, totalEstimatedMinutes, complexityScore } = args2;
979
+ if (!totalEstimatedMinutes) {
980
+ throw new Error("totalEstimatedMinutes is required");
981
+ }
982
+ const roundedMinutes = roundToNearest15Minutes(totalEstimatedMinutes);
1001
983
  const sessionStartTime = /* @__PURE__ */ new Date();
1002
984
  const { data: sessionData, error } = await supabase.from("ai_sessions").insert({
1003
985
  ticket_id: ticketId,
1004
986
  provider_user_id: authContext.userId,
1005
987
  team_id: authContext.teamId,
1006
988
  cursor_session_id: cursorSessionId || null,
1007
- ai_time_estimate_minutes: totalEstimateMinutes,
989
+ ai_time_estimate_minutes: roundedMinutes,
1008
990
  complexity_score: complexityScore || null,
1009
991
  status: "in_progress"
1010
992
  }).select("id, ticket_id, cursor_session_id, created_at").single();
1011
993
  if (error) throw error;
1012
- const phaseActivities = [
1013
- {
1014
- ai_session_id: sessionData.id,
1015
- activity_type: "analysis",
1016
- description: "Ticket analysis and context understanding",
1017
- duration_seconds: 0,
1018
- estimated_duration_seconds: roundedTimeBreakdown.analysisMinutes * 60,
1019
- status: "in_progress",
1020
- // Analysis starts immediately
1021
- productivity_score: 8,
1022
- started_at: sessionStartTime.toISOString()
1023
- },
1024
- {
1025
- ai_session_id: sessionData.id,
1026
- activity_type: "bug_investigation",
1027
- description: "Bug investigation and root cause analysis",
1028
- duration_seconds: 0,
1029
- estimated_duration_seconds: roundedTimeBreakdown.investigationMinutes * 60,
1030
- status: "pending",
1031
- productivity_score: null
1032
- },
1033
- {
1034
- ai_session_id: sessionData.id,
1035
- activity_type: "development",
1036
- description: "Implementation and coding",
1037
- duration_seconds: 0,
1038
- estimated_duration_seconds: roundedTimeBreakdown.developmentMinutes * 60,
1039
- status: "pending",
1040
- productivity_score: null
1041
- },
1042
- {
1043
- ai_session_id: sessionData.id,
1044
- activity_type: "communication",
1045
- description: "Customer response and documentation",
1046
- duration_seconds: 0,
1047
- estimated_duration_seconds: roundedTimeBreakdown.communicationMinutes * 60,
1048
- status: "pending",
1049
- productivity_score: null
1050
- }
1051
- ];
1052
- await supabase.from("ai_time_logs").insert(phaseActivities);
1053
994
  const sessionId = `ai-sess-${sessionData.id.substring(0, 8)}`;
1054
995
  return {
1055
996
  content: [{
1056
997
  type: "text",
1057
- text: `\u{1F680} **AI Session Started Successfully!**
998
+ text: `\u{1F680} **AI Session Started!**
1058
999
 
1059
1000
  \u{1F194} Session ID: **${sessionId}**
1060
1001
  \u{1F3AB} Ticket: ${ticketId}
1061
-
1062
- \u{1F4CA} **Time Breakdown:**
1063
- \u2022 Analysis: ${roundedTimeBreakdown.analysisMinutes} min
1064
- \u2022 Investigation: ${roundedTimeBreakdown.investigationMinutes} min
1065
- \u2022 Development: ${roundedTimeBreakdown.developmentMinutes} min
1066
- \u2022 Communication: ${roundedTimeBreakdown.communicationMinutes} min
1067
- \u2022 **Total: ${totalEstimateMinutes} min**
1068
-
1002
+ \u23F1\uFE0F Estimated: ${roundedMinutes} min
1069
1003
  ${complexityScore ? `\u{1F3AF} Complexity: ${complexityScore}/10
1070
- ` : ""}\u23F1\uFE0F **Phase Tracking Started** (Analysis in progress)
1071
- ${cursorSessionId ? `\u{1F517} Cursor Session: ${cursorSessionId}
1072
1004
  ` : ""}\u{1F4C5} Started: ${sessionStartTime.toLocaleString()}
1073
1005
 
1074
- \u2705 Session initialized with phase breakdown!
1075
1006
  \u{1F4DD} Timetrack entry will be created when you complete the session.`
1076
1007
  }]
1077
1008
  };