@jungjaehoon/mama-server 1.5.4 ā 1.5.6
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/package.json +1 -1
- package/src/server.js +23 -1
- package/src/tools/checkpoint-tools.js +25 -1
package/package.json
CHANGED
package/src/server.js
CHANGED
|
@@ -394,12 +394,34 @@ Returns: summary (4-section), next_steps (DoD + commands), open_files
|
|
|
394
394
|
if (!summary) {
|
|
395
395
|
return { success: false, message: 'ā Checkpoint requires: summary' };
|
|
396
396
|
}
|
|
397
|
+
|
|
398
|
+
// Search for related decisions before saving
|
|
399
|
+
let relatedDecisionsHint = '';
|
|
400
|
+
try {
|
|
401
|
+
const searchResults = await mama.suggest(summary, { limit: 3, threshold: 0.8 });
|
|
402
|
+
if (searchResults && searchResults.results && searchResults.results.length > 0) {
|
|
403
|
+
const related = searchResults.results.map((d) => ({
|
|
404
|
+
id: d.id,
|
|
405
|
+
topic: d.topic,
|
|
406
|
+
decision: d.decision?.substring(0, 80) + (d.decision?.length > 80 ? '...' : ''),
|
|
407
|
+
similarity: d.similarity?.toFixed(2),
|
|
408
|
+
}));
|
|
409
|
+
relatedDecisionsHint =
|
|
410
|
+
`\n\nš Related Decisions Found (consider linking in summary):\n` +
|
|
411
|
+
related.map((d) => ` ⢠${d.topic} [${d.similarity}]: ${d.decision}`).join('\n') +
|
|
412
|
+
`\n\nš” To link: Add "Related decisions: ${related.map((d) => d.id).join(', ')}" to summary if relevant.`;
|
|
413
|
+
}
|
|
414
|
+
} catch (error) {
|
|
415
|
+
// Silent fail - don't block checkpoint save
|
|
416
|
+
console.warn('[saveCheckpoint] Failed to search related decisions:', error.message);
|
|
417
|
+
}
|
|
418
|
+
|
|
397
419
|
const id = await mama.saveCheckpoint(summary, open_files || [], next_steps || '');
|
|
398
420
|
return {
|
|
399
421
|
success: true,
|
|
400
422
|
id,
|
|
401
423
|
type: 'checkpoint',
|
|
402
|
-
message:
|
|
424
|
+
message: `ā
Checkpoint saved${relatedDecisionsHint}`,
|
|
403
425
|
};
|
|
404
426
|
}
|
|
405
427
|
|
|
@@ -172,6 +172,30 @@ Before saving: scan for TODOs or missing tests and state them plainly.`,
|
|
|
172
172
|
handler: async (args) => {
|
|
173
173
|
const { summary, open_files, next_steps } = args;
|
|
174
174
|
|
|
175
|
+
// Search for related decisions before saving
|
|
176
|
+
let relatedDecisions = [];
|
|
177
|
+
let relatedDecisionsHint = '';
|
|
178
|
+
try {
|
|
179
|
+
const searchResults = await search(summary, { limit: 3, threshold: 0.8 });
|
|
180
|
+
if (searchResults && searchResults.length > 0) {
|
|
181
|
+
relatedDecisions = searchResults.map((d) => ({
|
|
182
|
+
id: d.id,
|
|
183
|
+
topic: d.topic,
|
|
184
|
+
decision: d.decision?.substring(0, 100) + (d.decision?.length > 100 ? '...' : ''),
|
|
185
|
+
similarity: d.similarity?.toFixed(2),
|
|
186
|
+
}));
|
|
187
|
+
relatedDecisionsHint =
|
|
188
|
+
`\n\nš Related Decisions Found (consider linking in summary):\n` +
|
|
189
|
+
relatedDecisions
|
|
190
|
+
.map((d) => ` ⢠${d.topic} [${d.similarity}]: ${d.decision}`)
|
|
191
|
+
.join('\n') +
|
|
192
|
+
`\n\nš” To link: Add "Related decisions: ${relatedDecisions.map((d) => d.id).join(', ')}" to summary if relevant.`;
|
|
193
|
+
}
|
|
194
|
+
} catch (error) {
|
|
195
|
+
// Silent fail - don't block checkpoint save
|
|
196
|
+
console.warn('[saveCheckpoint] Failed to search related decisions:', error.message);
|
|
197
|
+
}
|
|
198
|
+
|
|
175
199
|
// BMad Workflow Integration: Check Story status before saving
|
|
176
200
|
const currentStory = inferCurrentStory(summary);
|
|
177
201
|
let bmadWorkflowWarning = '';
|
|
@@ -221,7 +245,7 @@ Before saving: scan for TODOs or missing tests and state them plainly.`,
|
|
|
221
245
|
content: [
|
|
222
246
|
{
|
|
223
247
|
type: 'text',
|
|
224
|
-
text: `ā
Checkpoint saved (ID: ${id})\nSummary: ${summary}${bmadWorkflowWarning}`,
|
|
248
|
+
text: `ā
Checkpoint saved (ID: ${id})\nSummary: ${summary}${relatedDecisionsHint}${bmadWorkflowWarning}`,
|
|
225
249
|
},
|
|
226
250
|
],
|
|
227
251
|
};
|