@equilateral_ai/mindmeld 3.5.3 → 4.0.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.
Files changed (138) hide show
  1. package/hooks/session-start.js +312 -85
  2. package/package.json +21 -13
  3. package/scripts/init-project.js +9 -23
  4. package/scripts/repo-analyzer.js +118 -2
  5. package/src/client/dbShim.js +16 -0
  6. package/src/core/AuthManager.js +3 -2
  7. package/src/handlers/helpers/dbOperations.js +9 -46
  8. package/src/index.js +2 -217
  9. package/src/utils/piiMask.js +16 -0
  10. package/scripts/inject.js +0 -409
  11. package/scripts/mcp-bridge.js +0 -220
  12. package/scripts/standards.js +0 -285
  13. package/src/collaboration/CollaborationPrompt.js +0 -460
  14. package/src/core/AlertEngine.js +0 -813
  15. package/src/core/AlertNotifier.js +0 -363
  16. package/src/core/CorrelationAnalyzer.js +0 -931
  17. package/src/core/CrossReferenceEngine.js +0 -624
  18. package/src/core/CurationEngine.js +0 -688
  19. package/src/core/DeprecationScheduler.js +0 -183
  20. package/src/core/LoadBearingDetector.js +0 -242
  21. package/src/core/NotificationService.js +0 -1032
  22. package/src/core/RapportOrchestrator.js +0 -632
  23. package/src/core/RelevanceDetector.js +0 -694
  24. package/src/core/StandardLifecycle.js +0 -244
  25. package/src/core/StandardsIngestion.js +0 -991
  26. package/src/core/TeamLoadBearingDetector.js +0 -431
  27. package/src/core/parsers/adrParser.js +0 -479
  28. package/src/core/parsers/cursorRulesParser.js +0 -564
  29. package/src/core/parsers/eslintParser.js +0 -439
  30. package/src/database/dbOperations.js +0 -105
  31. package/src/handlers/activity/activityGetMe.js +0 -98
  32. package/src/handlers/activity/activityGetTeam.js +0 -175
  33. package/src/handlers/admin/adminSetup.js +0 -216
  34. package/src/handlers/alerts/alertsAcknowledge.js +0 -92
  35. package/src/handlers/alerts/alertsGet.js +0 -250
  36. package/src/handlers/analytics/activitySummaryGet.js +0 -234
  37. package/src/handlers/analytics/coachingGet.js +0 -361
  38. package/src/handlers/analytics/convergenceGet.js +0 -236
  39. package/src/handlers/analytics/developerScoreGet.js +0 -137
  40. package/src/handlers/collaborators/collaboratorAdd.js +0 -200
  41. package/src/handlers/collaborators/collaboratorInvite.js +0 -219
  42. package/src/handlers/collaborators/collaboratorList.js +0 -82
  43. package/src/handlers/collaborators/collaboratorRemove.js +0 -128
  44. package/src/handlers/collaborators/inviteAccept.js +0 -122
  45. package/src/handlers/company/companyUsersDelete.js +0 -141
  46. package/src/handlers/company/companyUsersGet.js +0 -90
  47. package/src/handlers/company/companyUsersPost.js +0 -267
  48. package/src/handlers/company/companyUsersPut.js +0 -76
  49. package/src/handlers/context/contextGet.js +0 -57
  50. package/src/handlers/context/invariantsGet.js +0 -74
  51. package/src/handlers/context/loopsGet.js +0 -82
  52. package/src/handlers/context/notesCreate.js +0 -74
  53. package/src/handlers/context/purposeGet.js +0 -78
  54. package/src/handlers/correlations/correlationsDeveloperGet.js +0 -227
  55. package/src/handlers/correlations/correlationsGet.js +0 -93
  56. package/src/handlers/correlations/correlationsProjectGet.js +0 -153
  57. package/src/handlers/enterprise/controlTowerGet.js +0 -224
  58. package/src/handlers/enterprise/enterpriseAuditGet.js +0 -108
  59. package/src/handlers/enterprise/enterpriseContributorsGet.js +0 -85
  60. package/src/handlers/enterprise/enterpriseKnowledgeCategoriesGet.js +0 -53
  61. package/src/handlers/enterprise/enterpriseKnowledgeCreate.js +0 -77
  62. package/src/handlers/enterprise/enterpriseKnowledgeDelete.js +0 -71
  63. package/src/handlers/enterprise/enterpriseKnowledgeGet.js +0 -87
  64. package/src/handlers/enterprise/enterpriseKnowledgeUpdate.js +0 -122
  65. package/src/handlers/enterprise/enterpriseOnboardingComplete.js +0 -77
  66. package/src/handlers/enterprise/enterpriseOnboardingInvite.js +0 -138
  67. package/src/handlers/enterprise/enterpriseOnboardingSetup.js +0 -128
  68. package/src/handlers/enterprise/enterpriseOnboardingStatus.js +0 -88
  69. package/src/handlers/github/githubConnectionStatus.js +0 -49
  70. package/src/handlers/github/githubDiscoverPatterns.js +0 -621
  71. package/src/handlers/github/githubOAuthCallback.js +0 -178
  72. package/src/handlers/github/githubOAuthStart.js +0 -59
  73. package/src/handlers/github/githubPatternsReview.js +0 -76
  74. package/src/handlers/github/githubReposList.js +0 -105
  75. package/src/handlers/health/healthGet.js +0 -55
  76. package/src/handlers/helpers/auditLogger.js +0 -201
  77. package/src/handlers/helpers/checkSuperAdmin.js +0 -84
  78. package/src/handlers/helpers/decisionFrames.js +0 -29
  79. package/src/handlers/helpers/errorHandler.js +0 -49
  80. package/src/handlers/helpers/index.js +0 -138
  81. package/src/handlers/helpers/lambdaWrapper.js +0 -60
  82. package/src/handlers/helpers/mindmeldMcpCore.js +0 -1103
  83. package/src/handlers/helpers/predictiveCache.js +0 -51
  84. package/src/handlers/helpers/projectAccess.js +0 -88
  85. package/src/handlers/helpers/responseUtil.js +0 -55
  86. package/src/handlers/helpers/subscriptionTiers.js +0 -1168
  87. package/src/handlers/mcp/mcpHandler.js +0 -569
  88. package/src/handlers/mcp/mindmeldMcpHandler.js +0 -124
  89. package/src/handlers/mcp/mindmeldMcpStreamHandler.js +0 -342
  90. package/src/handlers/notifications/getPreferences.js +0 -84
  91. package/src/handlers/notifications/sendNotification.js +0 -170
  92. package/src/handlers/notifications/updatePreferences.js +0 -316
  93. package/src/handlers/patterns/patternEvaluatePromotionPost.js +0 -173
  94. package/src/handlers/patterns/patternUsagePost.js +0 -182
  95. package/src/handlers/patterns/patternViolationPost.js +0 -185
  96. package/src/handlers/projects/projectCreate.js +0 -248
  97. package/src/handlers/projects/projectDelete.js +0 -82
  98. package/src/handlers/projects/projectGet.js +0 -95
  99. package/src/handlers/projects/projectUpdate.js +0 -117
  100. package/src/handlers/reports/aiLeverage.js +0 -210
  101. package/src/handlers/reports/engineeringInvestment.js +0 -132
  102. package/src/handlers/reports/riskForecast.js +0 -206
  103. package/src/handlers/reports/standardsRoi.js +0 -254
  104. package/src/handlers/scheduled/analyzeCorrelations.js +0 -178
  105. package/src/handlers/scheduled/analyzeGitHistory.js +0 -510
  106. package/src/handlers/scheduled/generateAlerts.js +0 -135
  107. package/src/handlers/scheduled/maturityUpdateJob.js +0 -166
  108. package/src/handlers/scheduled/refreshActivity.js +0 -21
  109. package/src/handlers/scheduled/scanCompliance.js +0 -334
  110. package/src/handlers/sessions/sessionEndPost.js +0 -180
  111. package/src/handlers/sessions/sessionStandardsPost.js +0 -171
  112. package/src/handlers/standards/catalogGet.js +0 -185
  113. package/src/handlers/standards/catalogSync.js +0 -120
  114. package/src/handlers/standards/discoveriesGet.js +0 -89
  115. package/src/handlers/standards/projectStandardsGet.js +0 -129
  116. package/src/handlers/standards/projectStandardsPut.js +0 -151
  117. package/src/handlers/standards/standardsAuditGet.js +0 -65
  118. package/src/handlers/standards/standardsParseUpload.js +0 -149
  119. package/src/handlers/standards/standardsRelevantPost.js +0 -405
  120. package/src/handlers/standards/standardsTransition.js +0 -161
  121. package/src/handlers/stripe/addonManagePost.js +0 -240
  122. package/src/handlers/stripe/billingPortalPost.js +0 -93
  123. package/src/handlers/stripe/enterpriseCheckoutPost.js +0 -272
  124. package/src/handlers/stripe/seatsUpdatePost.js +0 -185
  125. package/src/handlers/stripe/subscriptionCancelDelete.js +0 -169
  126. package/src/handlers/stripe/subscriptionCreatePost.js +0 -221
  127. package/src/handlers/stripe/subscriptionUpdatePut.js +0 -163
  128. package/src/handlers/stripe/webhookPost.js +0 -482
  129. package/src/handlers/user/apiTokenCreate.js +0 -71
  130. package/src/handlers/user/apiTokenList.js +0 -64
  131. package/src/handlers/user/userSplashAck.js +0 -91
  132. package/src/handlers/user/userSplashGet.js +0 -211
  133. package/src/handlers/users/cognitoPostConfirmation.js +0 -186
  134. package/src/handlers/users/cognitoPreSignUp.js +0 -114
  135. package/src/handlers/users/userEntitlementsGet.js +0 -89
  136. package/src/handlers/users/userGet.js +0 -118
  137. package/src/handlers/users/userProfilePut.js +0 -77
  138. package/src/handlers/webhooks/githubWebhook.js +0 -215
@@ -1,285 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * MindMeld CLI - Standards Management
4
- *
5
- * Usage:
6
- * mindmeld standards # Open standards picker in browser
7
- * mindmeld standards --show # Show current preferences
8
- * mindmeld standards --sync # Sync preferences from server
9
- * mindmeld standards --reset # Reset to defaults
10
- *
11
- * @equilateral_ai/mindmeld v3.2.0
12
- */
13
-
14
- const path = require('path');
15
- const fs = require('fs').promises;
16
- const { AuthManager } = require('../src/core/AuthManager');
17
-
18
- const authManager = new AuthManager();
19
- const API_BASE = process.env.MINDMELD_API_URL || 'https://api.mindmeld.dev';
20
-
21
- /**
22
- * Load local MindMeld config
23
- */
24
- async function loadConfig() {
25
- try {
26
- const configPath = path.join(process.cwd(), '.mindmeld', 'config.json');
27
- const content = await fs.readFile(configPath, 'utf-8');
28
- return JSON.parse(content);
29
- } catch (error) {
30
- if (error.code !== 'ENOENT' && !(error instanceof SyntaxError)) {
31
- console.error('Unexpected error loading config:', error.message);
32
- }
33
- return null;
34
- }
35
- }
36
-
37
- /**
38
- * Load authentication tokens
39
- */
40
- async function loadAuth() {
41
- try {
42
- const authPath = path.join(process.env.HOME, '.mindmeld', 'auth.json');
43
- const content = await fs.readFile(authPath, 'utf-8');
44
- return JSON.parse(content);
45
- } catch (error) {
46
- if (error.code !== 'ENOENT' && !(error instanceof SyntaxError)) {
47
- console.error('Unexpected error loading auth:', error.message);
48
- }
49
- return null;
50
- }
51
- }
52
-
53
- /**
54
- * Load local preferences
55
- */
56
- async function loadPreferences() {
57
- try {
58
- const prefsPath = path.join(process.cwd(), '.mindmeld', 'preferences.json');
59
- const content = await fs.readFile(prefsPath, 'utf-8');
60
- return JSON.parse(content);
61
- } catch (error) {
62
- if (error.code !== 'ENOENT' && !(error instanceof SyntaxError)) {
63
- console.error('Unexpected error loading preferences:', error.message);
64
- }
65
- return null;
66
- }
67
- }
68
-
69
- /**
70
- * Save local preferences
71
- */
72
- async function savePreferences(preferences) {
73
- const prefsPath = path.join(process.cwd(), '.mindmeld', 'preferences.json');
74
- await fs.mkdir(path.dirname(prefsPath), { recursive: true });
75
- await fs.writeFile(prefsPath, JSON.stringify(preferences, null, 2));
76
- }
77
-
78
- /**
79
- * Fetch project standards from API
80
- */
81
- async function fetchProjectStandards(projectId, idToken) {
82
- const response = await fetch(`${API_BASE}/api/projects/standards?project_id=${encodeURIComponent(projectId)}`, {
83
- headers: {
84
- 'Authorization': `Bearer ${idToken}`,
85
- 'Content-Type': 'application/json'
86
- }
87
- });
88
-
89
- if (!response.ok) {
90
- throw new Error(`API error: ${response.status}`);
91
- }
92
-
93
- return response.json();
94
- }
95
-
96
- /**
97
- * Show current preferences
98
- */
99
- async function showPreferences() {
100
- const prefs = await loadPreferences();
101
-
102
- if (!prefs) {
103
- console.log('\nNo local preferences set. Using defaults (all standards enabled).\n');
104
- console.log('Run `mindmeld standards` to configure.\n');
105
- return;
106
- }
107
-
108
- console.log('\n📋 Current Standards Preferences\n');
109
-
110
- const enabledCats = prefs.enabled_categories || {};
111
- const overrides = prefs.standard_overrides || {};
112
-
113
- console.log('Categories:');
114
- for (const [cat, enabled] of Object.entries(enabledCats)) {
115
- const icon = enabled ? '✅' : '❌';
116
- console.log(` ${icon} ${cat}`);
117
- }
118
-
119
- if (Object.keys(overrides).length > 0) {
120
- console.log('\nIndividual Overrides:');
121
- for (const [standard, enabled] of Object.entries(overrides)) {
122
- const icon = enabled ? '✅' : '❌';
123
- console.log(` ${icon} ${standard}`);
124
- }
125
- }
126
-
127
- if (prefs.synced_at) {
128
- console.log(`\nLast synced: ${new Date(prefs.synced_at).toLocaleString()}`);
129
- }
130
-
131
- console.log('');
132
- }
133
-
134
- /**
135
- * Sync preferences from server
136
- */
137
- async function syncPreferences() {
138
- const config = await loadConfig();
139
- const auth = await loadAuth();
140
-
141
- if (!config) {
142
- console.error('\n❌ Not a MindMeld project. Run `mindmeld init` first.\n');
143
- process.exit(1);
144
- }
145
-
146
- if (!auth || !auth.id_token) {
147
- console.error('\n❌ Not authenticated. Run `mindmeld login` first.\n');
148
- process.exit(1);
149
- }
150
-
151
- console.log('\n🔄 Syncing preferences from server...\n');
152
-
153
- try {
154
- const result = await fetchProjectStandards(config.projectId, auth.id_token);
155
-
156
- if (result.success && result.data) {
157
- const prefs = {
158
- enabled_categories: result.data.preferences?.enabled_categories || {},
159
- standard_overrides: result.data.preferences?.standard_overrides || {},
160
- critical_overrides: result.data.preferences?.critical_overrides || {},
161
- catalog_version: result.data.catalog_version,
162
- synced_at: new Date().toISOString()
163
- };
164
-
165
- await savePreferences(prefs);
166
-
167
- console.log('✅ Preferences synced successfully!\n');
168
- await showPreferences();
169
- } else {
170
- console.log('ℹ️ No custom preferences set. Using defaults.\n');
171
- }
172
- } catch (error) {
173
- console.error('❌ Failed to sync:', error.message);
174
- process.exit(1);
175
- }
176
- }
177
-
178
- /**
179
- * Reset preferences to defaults
180
- */
181
- async function resetPreferences() {
182
- try {
183
- const prefsPath = path.join(process.cwd(), '.mindmeld', 'preferences.json');
184
- await fs.unlink(prefsPath);
185
- console.log('\n✅ Preferences reset to defaults (all standards enabled).\n');
186
- } catch (error) {
187
- if (error.code === 'ENOENT') {
188
- console.log('\nℹ️ No preferences file to reset.\n');
189
- } else {
190
- console.error('Unexpected error resetting preferences:', error.message);
191
- process.exit(1);
192
- }
193
- }
194
- }
195
-
196
- /**
197
- * Open standards picker in browser
198
- */
199
- async function openStandardsPicker() {
200
- const config = await loadConfig();
201
- const auth = await loadAuth();
202
-
203
- if (!config) {
204
- console.error('\n❌ Not a MindMeld project. Run `mindmeld init` first.\n');
205
- process.exit(1);
206
- }
207
-
208
- if (!auth) {
209
- console.error('\n❌ Not authenticated. Run `mindmeld login` first.\n');
210
- process.exit(1);
211
- }
212
-
213
- const projectId = config.projectId;
214
- const baseUrl = authManager.getAppBaseUrl();
215
- const url = `${baseUrl}/projects/${projectId}/standards`;
216
-
217
- console.log('\n🌐 Opening standards picker in browser...\n');
218
- console.log(` ${url}\n`);
219
-
220
- const opened = await authManager.openBrowser(url);
221
- if (!opened) {
222
- console.log('Could not open browser automatically.');
223
- console.log(`Please visit: ${url}\n`);
224
- }
225
-
226
- console.log('After saving preferences in the browser, run:');
227
- console.log(' mindmeld standards --sync\n');
228
- }
229
-
230
- /**
231
- * Show help
232
- */
233
- function showHelp() {
234
- console.log(`
235
- MindMeld Standards - Configure which standards apply to this project
236
-
237
- Usage:
238
- mindmeld standards Open standards picker in browser
239
- mindmeld standards --show Show current preferences
240
- mindmeld standards --sync Sync preferences from server
241
- mindmeld standards --reset Reset to defaults (all enabled)
242
- mindmeld standards --help Show this help
243
-
244
- Examples:
245
- mindmeld standards # Configure in browser
246
- mindmeld standards --show # See what's enabled/disabled
247
- `);
248
- }
249
-
250
- /**
251
- * Main
252
- */
253
- async function main() {
254
- const args = process.argv.slice(2);
255
-
256
- if (args.includes('--help') || args.includes('-h')) {
257
- showHelp();
258
- process.exit(0);
259
- }
260
-
261
- if (args.includes('--show')) {
262
- await showPreferences();
263
- process.exit(0);
264
- }
265
-
266
- if (args.includes('--sync')) {
267
- await syncPreferences();
268
- process.exit(0);
269
- }
270
-
271
- if (args.includes('--reset')) {
272
- await resetPreferences();
273
- process.exit(0);
274
- }
275
-
276
- // Default: open browser
277
- await openStandardsPicker();
278
- }
279
-
280
- main().catch(error => {
281
- console.error('\n❌ Error:', error.message);
282
- process.exit(1);
283
- });
284
-
285
- module.exports = { showHelp };