edsger 0.10.0 → 0.10.2

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.
@@ -5,7 +5,16 @@
5
5
  "Bash(npm run build)",
6
6
  "Bash(node:*)",
7
7
  "Bash(git add:*)",
8
- "Bash(git commit:*)"
8
+ "Bash(git commit:*)",
9
+ "Bash(ls:*)",
10
+ "Bash(cat:*)",
11
+ "Bash(npm run typecheck:*)",
12
+ "Bash(git diff:*)",
13
+ "WebSearch",
14
+ "WebFetch(domain:supabase.com)",
15
+ "Bash(npm install:*)",
16
+ "Bash(grep:*)",
17
+ "Bash(npx supabase gen types typescript --help:*)"
9
18
  ],
10
19
  "deny": [],
11
20
  "ask": []
@@ -21,12 +21,16 @@ export async function checkApprovalBeforePhaseExecution(featureId, verbose = fal
21
21
  const productId = feature.product_id;
22
22
  if (verbose) {
23
23
  logInfo(`🔍 Checking approval for current status: ${currentStatus}`);
24
+ logInfo(`📦 Product ID: ${productId}`);
24
25
  }
25
26
  // 2. Check if current status requires approval
26
27
  const requiresApprovalResult = (await callMcpEndpoint('approvals/requires_approval', {
27
28
  product_id: productId,
28
29
  feature_status: currentStatus,
29
30
  }));
31
+ if (verbose) {
32
+ logInfo(`📋 MCP requires_approval response: ${JSON.stringify(requiresApprovalResult)}`);
33
+ }
30
34
  const requiresApproval = requiresApprovalResult?.requires_approval === true;
31
35
  if (!requiresApproval) {
32
36
  if (verbose) {
@@ -106,7 +110,7 @@ export async function checkApprovalBeforePhaseExecution(featureId, verbose = fal
106
110
  }
107
111
  }
108
112
  /**
109
- * Create an approval request and send notification emails
113
+ * Create an approval request (emails are sent automatically by the MCP handler)
110
114
  * This is for the CURRENT status, not the next status
111
115
  */
112
116
  async function createApprovalRequestWithEmail(featureId, productId, currentStatus, verbose = false) {
@@ -117,6 +121,7 @@ async function createApprovalRequestWithEmail(featureId, productId, currentStatu
117
121
  // Create approval request via MCP endpoint
118
122
  // Note: We're requesting approval for the current status
119
123
  // The approval is asking: "Can we proceed from this status?"
124
+ // Email notifications are sent automatically by the MCP handler
120
125
  const result = (await callMcpEndpoint('approvals/create', {
121
126
  feature_id: featureId,
122
127
  requested_status: currentStatus,
@@ -129,30 +134,16 @@ async function createApprovalRequestWithEmail(featureId, productId, currentStatu
129
134
  }
130
135
  if (verbose) {
131
136
  logInfo(`✅ Approval request created: ${approvalId}`);
132
- }
133
- // Send approval emails via edge function
134
- try {
135
- if (verbose) {
136
- logInfo('Sending approval notification emails...');
137
- }
138
- const emailResult = (await callMcpEndpoint('approvals/send_email', {
139
- approval_id: approvalId,
140
- }));
141
- if (emailResult?.emails_sent) {
142
- const sentCount = emailResult.emails_sent.filter((e) => e.status === 'sent').length;
143
- if (verbose) {
144
- logInfo(`✅ Sent approval emails to ${sentCount} assignee(s)`);
137
+ // Log email results if available
138
+ if (result?.emails_sent) {
139
+ const sentCount = result.emails_sent.filter((e) => e.status === 'sent').length;
140
+ const failedCount = result.emails_sent.filter((e) => e.status !== 'sent').length;
141
+ logInfo(`📧 Sent approval emails to ${sentCount} assignee(s)`);
142
+ if (failedCount > 0) {
143
+ logWarning(`⚠️ Failed to send ${failedCount} email(s)`);
145
144
  }
146
145
  }
147
146
  }
148
- catch (emailError) {
149
- // Don't fail the whole process if email fails
150
- const errorMessage = emailError instanceof Error ? emailError.message : String(emailError);
151
- logWarning(`Failed to send approval emails: ${errorMessage}`);
152
- if (verbose) {
153
- logInfo('⚠️ Approval created but email notification failed');
154
- }
155
- }
156
147
  return approvalId;
157
148
  }
158
149
  catch (error) {
@@ -89,7 +89,8 @@ export async function getGitHubConfig(featureId, verbose) {
89
89
  }
90
90
  return {
91
91
  configured: false,
92
- message: result.message || 'GitHub not configured for this product. Please configure a developer with GitHub App installation in the product settings.',
92
+ message: result.message ||
93
+ 'GitHub not configured for this product. Please configure a developer with GitHub App installation in the product settings.',
93
94
  };
94
95
  }
95
96
  catch (error) {
@@ -74,7 +74,10 @@ export async function handlePullRequestCreation({ featureId, results, testingRes
74
74
  }
75
75
  // Get GitHub configuration from product developer settings
76
76
  const githubConfig = await getGitHubConfig(featureId, verbose);
77
- if (!githubConfig.configured || !githubConfig.token || !githubConfig.owner || !githubConfig.repo) {
77
+ if (!githubConfig.configured ||
78
+ !githubConfig.token ||
79
+ !githubConfig.owner ||
80
+ !githubConfig.repo) {
78
81
  if (verbose) {
79
82
  console.log('⚠️ GitHub configuration not found. Skipping pull request creation.');
80
83
  console.log(` ${githubConfig.message || 'Please configure a developer with GitHub App installation in the product settings.'}`);
@@ -92,7 +95,7 @@ export async function handlePullRequestCreation({ featureId, results, testingRes
92
95
  }, verbose);
93
96
  return false;
94
97
  }
95
- const { token: githubToken, owner: githubOwner, repo: githubRepo } = githubConfig;
98
+ const { token: githubToken, owner: githubOwner, repo: githubRepo, } = githubConfig;
96
99
  if (verbose) {
97
100
  console.log(`📌 Using GitHub config from product developer: ${githubOwner}/${githubRepo}`);
98
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edsger",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "edsger": "dist/index.js"