@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.
@@ -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
- const thoughtNumber = args.thoughtNumber ?? (thinkingServer.getHistoryLength() + 1);
116
- const totalThoughts = args.totalThoughts ?? (thoughtNumber + 5);
117
- const input = { ...args, thoughtNumber, totalThoughts };
118
- const result = await thinkingServer.processThought(input);
119
- return {
120
- content: result.content,
121
- isError: result.isError
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 () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gotza02/sequential-thinking",
3
- "version": "2026.3.7",
3
+ "version": "2026.3.8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },