@gotza02/sequential-thinking 2026.3.7 → 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/tools/thinking.js +22 -8
- package/package.json +1 -1
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 () => {
|