@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.
- package/hooks/session-start.js +1 -1
- package/package.json +1 -1
- package/src/index.js +38 -46
package/hooks/session-start.js
CHANGED
|
@@ -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
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
|
-
|
|
316
|
-
params.append('
|
|
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/
|
|
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
|
-
|
|
327
|
+
} else if (response.data) {
|
|
328
|
+
const data = response.data;
|
|
329
|
+
// Return normalized context object from correlations endpoint
|
|
329
330
|
return {
|
|
330
|
-
projectId:
|
|
331
|
-
projectName:
|
|
332
|
-
companyId:
|
|
333
|
-
|
|
334
|
-
// Team patterns
|
|
335
|
-
patterns: (
|
|
336
|
-
patternId: p.pattern_id,
|
|
337
|
-
intent: p.intent,
|
|
338
|
-
element: p.element
|
|
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.
|
|
341
|
-
usageCount: p.usage_count || p.
|
|
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
|
-
//
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
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
|
-
//
|
|
366
|
-
collaborators: (
|
|
367
|
-
email:
|
|
368
|
-
role:
|
|
369
|
-
isExternal:
|
|
370
|
-
|
|
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
|
-
//
|
|
374
|
-
|
|
365
|
+
// Metrics
|
|
366
|
+
metrics: data.metrics,
|
|
375
367
|
|
|
376
368
|
// Metadata
|
|
377
|
-
lastActive:
|
|
378
|
-
sessionCount:
|
|
369
|
+
lastActive: null,
|
|
370
|
+
sessionCount: data.metrics?.totalSessions || 0
|
|
379
371
|
};
|
|
380
372
|
}
|
|
381
373
|
} catch (error) {
|