@splicr/mcp-server 0.9.4 → 0.9.5
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/dist/cli.js +15 -7
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -610,18 +610,26 @@ async function runStop() {
|
|
|
610
610
|
process.exit(0);
|
|
611
611
|
return;
|
|
612
612
|
}
|
|
613
|
-
//
|
|
614
|
-
if (transcript.includes('save_from_agent') && transcript.includes('Saved to Splicr')) {
|
|
615
|
-
process.exit(0);
|
|
616
|
-
return;
|
|
617
|
-
}
|
|
618
|
-
// Count tool calls as a rough significance signal
|
|
613
|
+
// Count total tool calls as a rough significance signal
|
|
619
614
|
const toolCalls = (transcript.match(/"tool_use"/g) || []).length;
|
|
620
615
|
if (toolCalls < 5) {
|
|
621
616
|
process.exit(0);
|
|
622
617
|
return;
|
|
623
618
|
}
|
|
624
|
-
//
|
|
619
|
+
// Check if agent saved to Splicr — but only suppress if save was RECENT
|
|
620
|
+
// (i.e., no significant work happened after the last save)
|
|
621
|
+
const lastSaveIndex = transcript.lastIndexOf('Saved to Splicr');
|
|
622
|
+
if (lastSaveIndex !== -1) {
|
|
623
|
+
const afterSave = transcript.slice(lastSaveIndex);
|
|
624
|
+
const toolCallsAfterSave = (afterSave.match(/"tool_use"/g) || []).length;
|
|
625
|
+
// If fewer than 5 tool calls happened after the last save, don't nudge
|
|
626
|
+
if (toolCallsAfterSave < 5) {
|
|
627
|
+
process.exit(0);
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
// 5+ tool calls after last save = significant new work, nudge again
|
|
631
|
+
}
|
|
632
|
+
// Significant session with no recent save — nudge the agent
|
|
625
633
|
const output = JSON.stringify({
|
|
626
634
|
decision: 'block',
|
|
627
635
|
reason: 'SPLICR BACK-PRESSURE: This was a significant session (many tool calls). Before finishing, consider: did you make any decisions, discoveries, or workarounds worth saving? If yes, call save_from_agent with the learning and include the context field (agent, files, decision_type, durability). If nothing significant was learned, you may finish.',
|