@gotza02/sequential-thinking 2026.3.6 → 2026.3.8
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/lib.js +6 -2
- package/dist/tools/thinking.js +22 -8
- package/package.json +1 -1
package/dist/lib.js
CHANGED
|
@@ -615,13 +615,17 @@ ${typeof wrappedThought === 'string' && wrappedThought.startsWith('│') ? wrapp
|
|
|
615
615
|
}
|
|
616
616
|
// --- 📊 Update Confidence Score ---
|
|
617
617
|
if (warnings.length > 0)
|
|
618
|
-
this.confidenceScore -= (
|
|
618
|
+
this.confidenceScore -= (5 * warnings.length);
|
|
619
619
|
if (input.thoughtType === 'observation') {
|
|
620
620
|
const isError = input.toolResult?.toLowerCase().includes('error');
|
|
621
621
|
if (isError)
|
|
622
622
|
this.confidenceScore -= 10;
|
|
623
623
|
else
|
|
624
|
-
this.confidenceScore = Math.min(100, this.confidenceScore +
|
|
624
|
+
this.confidenceScore = Math.min(100, this.confidenceScore + 10);
|
|
625
|
+
}
|
|
626
|
+
else if (input.thoughtType === 'solution' && warnings.length === 0) {
|
|
627
|
+
// Bonus for clean solution
|
|
628
|
+
this.confidenceScore = Math.min(100, this.confidenceScore + 20);
|
|
625
629
|
}
|
|
626
630
|
// C. Update State
|
|
627
631
|
this.addToMemory(input);
|
package/dist/tools/thinking.js
CHANGED
|
@@ -112,14 +112,28 @@ If you have tried to fix the same problem 3 times and failed:
|
|
|
112
112
|
options: z.array(z.string()).optional().describe("List of options for generation type"),
|
|
113
113
|
selectedOption: z.string().optional().describe("The option selected for selection type")
|
|
114
114
|
}, async (args) => {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
115
|
+
try {
|
|
116
|
+
const thoughtNumber = args.thoughtNumber ?? (thinkingServer.getHistoryLength() + 1);
|
|
117
|
+
// Smart defaults for totalThoughts based on complexity
|
|
118
|
+
let defaultAdd = 5;
|
|
119
|
+
if (args.complexity === 'low')
|
|
120
|
+
defaultAdd = 3;
|
|
121
|
+
else if (args.complexity === 'high')
|
|
122
|
+
defaultAdd = 8;
|
|
123
|
+
const totalThoughts = args.totalThoughts ?? (thoughtNumber + defaultAdd);
|
|
124
|
+
const input = { ...args, thoughtNumber, totalThoughts };
|
|
125
|
+
const result = await thinkingServer.processThought(input);
|
|
126
|
+
return {
|
|
127
|
+
content: result.content,
|
|
128
|
+
isError: result.isError
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
return {
|
|
133
|
+
content: [{ type: "text", text: `Thinking Error: ${error instanceof Error ? error.message : String(error)}` }],
|
|
134
|
+
isError: true
|
|
135
|
+
};
|
|
136
|
+
}
|
|
123
137
|
});
|
|
124
138
|
// --- Clear Thought History ---
|
|
125
139
|
server.tool("clear_thought_history", "Clear the sequential thinking history. Use this to start fresh when changing to a completely different task.", {}, async () => {
|