@equilateral_ai/mindmeld 3.3.0 → 3.3.1

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.
@@ -268,7 +268,7 @@ async function fetchRelevantStandardsFromAPI(apiUrl, authToken, characteristics,
268
268
  if (res.statusCode >= 400) {
269
269
  reject(new Error(parsed.message || `HTTP ${res.statusCode}`));
270
270
  } else {
271
- resolve(parsed.standards || []);
271
+ resolve(parsed.data?.standards || parsed.standards || []);
272
272
  }
273
273
  } catch (e) {
274
274
  reject(new Error('Invalid API response'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equilateral_ai/mindmeld",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "Intelligent standards injection for AI coding sessions - context-aware, self-documenting, scales to large codebases",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -310,72 +310,64 @@ class MindmeldClient {
310
310
  try {
311
311
  const apiUrl = this.config.apiUrl;
312
312
 
313
- // Build query params
313
+ // Build query params (no path parameters per standards)
314
+ // Uses /api/correlations/project which returns pattern effectiveness and team data
314
315
  const params = new URLSearchParams();
315
- if (userId) params.append('userId', userId);
316
- params.append('patternLimit', patternLimit.toString());
317
- params.append('learningDays', learningDays.toString());
316
+ params.append('project_id', projectId);
317
+ params.append('lookbackDays', learningDays.toString());
318
318
 
319
319
  const response = await this._makeApiRequest(
320
- `${apiUrl}/api/projects/${projectId}/context?${params.toString()}`,
320
+ `${apiUrl}/api/correlations/project?${params.toString()}`,
321
321
  'GET'
322
322
  );
323
323
 
324
324
  if (response.error) {
325
325
  console.error('[Rapport] loadProjectContext API error:', response.error);
326
326
  // Fall through to local storage
327
- } else {
328
- // Return normalized context object
327
+ } else if (response.data) {
328
+ const data = response.data;
329
+ // Return normalized context object from correlations endpoint
329
330
  return {
330
- projectId: response.project_id || projectId,
331
- projectName: response.project_name,
332
- companyId: response.company_id,
333
-
334
- // Team patterns (validated and reinforced)
335
- patterns: (response.patterns || []).map(p => ({
336
- patternId: p.pattern_id,
337
- intent: p.intent,
338
- element: p.element || p.intent,
331
+ projectId: data.project?.projectId || projectId,
332
+ projectName: data.project?.projectName,
333
+ companyId: data.project?.companyId,
334
+
335
+ // Team patterns from pattern effectiveness data
336
+ patterns: (data.patternEffectiveness || []).slice(0, patternLimit).map(p => ({
337
+ patternId: p.pattern_id || p.patternId,
338
+ intent: p.intent || p.element,
339
+ element: p.element,
339
340
  maturity: p.maturity,
340
- confidence: p.confidence || p.success_rate,
341
- usageCount: p.usage_count || p.handoff_count,
341
+ confidence: p.success_rate || p.correlation || 0,
342
+ usageCount: p.usage_count || p.usageCount || 0,
342
343
  lastUsed: p.last_used
343
344
  })),
344
345
 
345
- // Load-bearing context elements
346
- loadBearingElements: (response.load_bearing_elements || []).map(e => ({
347
- elementId: e.element_id,
348
- type: e.element_type,
349
- key: e.element_key,
350
- value: e.element_value,
351
- correlation: e.team_correlation,
352
- confidence: e.confidence,
353
- isLoadBearing: e.is_load_bearing
354
- })),
355
-
356
- // Recent team learning
357
- recentLearning: (response.recent_learning || []).map(l => ({
358
- patternId: l.pattern_id,
359
- element: l.element,
360
- learnedBy: l.discovered_by || l.email_address,
361
- learnedAt: l.discovered_at || l.used_at,
362
- success: l.success
346
+ // Recent correlations as learning events
347
+ recentLearning: (data.recentCorrelations || []).map(c => ({
348
+ patternId: c.session_id,
349
+ element: c.commit_message || 'session',
350
+ learnedBy: c.email,
351
+ learnedAt: c.session_end || c.commit_time,
352
+ success: c.correlation_score > 0.5
363
353
  })),
364
354
 
365
- // Collaborators
366
- collaborators: (response.collaborators || []).map(c => ({
367
- email: c.email_address || c.email,
368
- role: c.role,
369
- isExternal: c.is_external,
370
- lastActive: c.last_active
355
+ // Developer breakdown as collaborator activity
356
+ collaborators: (data.developerBreakdown || []).map(d => ({
357
+ email: d.email,
358
+ role: 'collaborator',
359
+ isExternal: false,
360
+ sessions: d.totalSessions,
361
+ commits: d.totalCommits,
362
+ correlation: d.avgCorrelation
371
363
  })),
372
364
 
373
- // Standards applicable to this project
374
- applicableStandards: response.applicable_standards || [],
365
+ // Metrics
366
+ metrics: data.metrics,
375
367
 
376
368
  // Metadata
377
- lastActive: response.last_active,
378
- sessionCount: response.session_count || 0
369
+ lastActive: null,
370
+ sessionCount: data.metrics?.totalSessions || 0
379
371
  };
380
372
  }
381
373
  } catch (error) {