@gotza02/sequential-thinking 2026.3.5 → 2026.3.7
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 +15 -1
- 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
|
@@ -87,7 +87,21 @@ If you have tried to fix the same problem 3 times and failed:
|
|
|
87
87
|
blockId: z.string().optional().describe("ID for the current topic block (e.g., 'auth-debug', 'api-research'). Keep same ID to stay in context."),
|
|
88
88
|
relatedToolCall: z.string().optional().describe("If type='execution', specify the tool name here (e.g., 'read_file', 'edit_file')"),
|
|
89
89
|
toolResult: z.string().optional().describe("If type='observation', summarize the key findings from the tool output here"),
|
|
90
|
-
complexity: z.
|
|
90
|
+
complexity: z.preprocess((val) => {
|
|
91
|
+
if (typeof val !== 'string')
|
|
92
|
+
return val;
|
|
93
|
+
const v = val.toLowerCase();
|
|
94
|
+
if (['simple', 'easy', 'basic'].includes(v))
|
|
95
|
+
return 'low';
|
|
96
|
+
if (['standard', 'normal', 'regular'].includes(v))
|
|
97
|
+
return 'medium';
|
|
98
|
+
if (['critical', 'expert', 'very high'].includes(v))
|
|
99
|
+
return 'high';
|
|
100
|
+
// If it's a string but not one of the enum values, default to medium
|
|
101
|
+
if (!['low', 'medium', 'high'].includes(v))
|
|
102
|
+
return 'medium';
|
|
103
|
+
return v;
|
|
104
|
+
}, z.enum(['low', 'medium', 'high']).optional()).describe("Task complexity level. 'low': simple tasks, less strict. 'medium': standard. 'high': critical, requires critique & double verification."),
|
|
91
105
|
// Legacy Fields (backwards compatible)
|
|
92
106
|
isRevision: z.boolean().optional().describe("Whether this revises previous thinking"),
|
|
93
107
|
revisesThought: z.number().int().min(1).optional().describe("Which thought number is being reconsidered"),
|