smart-thinking-mcp 9.0.0 → 9.0.1
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.
|
@@ -85,6 +85,9 @@ If CONTEXT (previous thought, connection type) is provided, evaluate the confide
|
|
|
85
85
|
- Confidence is HIGH (0.8-1.0) if the CURRENT thought strongly supports, logically derives from ('derives', 'refines'), or provides strong evidence for the previous thought, OR if it expresses high certainty intrinsically. A short, direct logical derivation can have HIGH confidence.
|
|
86
86
|
- Confidence is MEDIUM (0.4-0.7) if it extends, associates with, or moderately supports the previous thought, OR if it expresses moderate certainty intrinsically.
|
|
87
87
|
- Confidence is LOW (0.0-0.3) if the CURRENT thought contradicts, questions, is irrelevant to the previous thought, OR expresses high uncertainty intrinsically (hedging words like 'maybe', 'perhaps', 'could').
|
|
88
|
+
|
|
89
|
+
Context sensitivity: If the connection type is 'conclusion' or 'hypothesis', apply stricter evaluation criteria. For 'associates' or 'extends', apply more flexible criteria. For calculations or scientific claims, prioritize factual accuracy. For ethical or philosophical statements, focus on logical coherence.
|
|
90
|
+
|
|
88
91
|
Return ONLY the confidence score as a float between 0.0 and 1.0.`;
|
|
89
92
|
userPrompt += "Desired Output: Respond with ONLY a single floating-point number between 0.0 and 1.0 representing the confidence score.\nScore (0.0-1.0):";
|
|
90
93
|
break;
|
|
@@ -95,6 +98,25 @@ If CONTEXT (previous thought, connection type) is provided, evaluate the relevan
|
|
|
95
98
|
- Relevance is MEDIUM (0.4-0.7) if the link is less direct (e.g., 'extends', 'compares', 'contrasts', 'associates') or if it's topically related but not directly linked.
|
|
96
99
|
- Relevance is LOW (0.0-0.3) if the CURRENT thought is on a completely different topic or only tangentially related.
|
|
97
100
|
If NO CONTEXT is provided, evaluate the general relevance of the CURRENT thought to a typical logical reasoning process (is it a meaningful, non-trivial statement?).
|
|
101
|
+
|
|
102
|
+
Examples:
|
|
103
|
+
- Previous thought: "Climate change is primarily caused by human activities."
|
|
104
|
+
- CURRENT thought: "Carbon dioxide emissions from fossil fuels are a major contributor to the greenhouse effect."
|
|
105
|
+
- Connection type: "supports"
|
|
106
|
+
- Expected score: 0.9 (HIGH relevance - directly supports with specific mechanism)
|
|
107
|
+
|
|
108
|
+
- Previous thought: "Education systems should be reformed."
|
|
109
|
+
- CURRENT thought: "Some schools in Finland have implemented project-based learning."
|
|
110
|
+
- Connection type: "associates"
|
|
111
|
+
- Expected score: 0.5 (MEDIUM relevance - topically related but indirect connection)
|
|
112
|
+
|
|
113
|
+
- Previous thought: "Economic policies need revision."
|
|
114
|
+
- CURRENT thought: "Jupiter has 79 known moons."
|
|
115
|
+
- Connection type: none
|
|
116
|
+
- Expected score: 0.1 (LOW relevance - completely unrelated topics)
|
|
117
|
+
|
|
118
|
+
Context sensitivity: If the connection type is 'conclusion' or 'hypothesis', apply stricter evaluation criteria. For 'associates' or 'extends', apply more flexible criteria. For calculations or scientific claims, prioritize factual accuracy. For ethical or philosophical statements, focus on logical coherence.
|
|
119
|
+
|
|
98
120
|
Return ONLY the relevance score as a float between 0.0 and 1.0.`;
|
|
99
121
|
userPrompt += "Desired Output: Respond with ONLY a single floating-point number between 0.0 and 1.0 representing the relevance score.\nScore (0.0-1.0):";
|
|
100
122
|
break;
|
|
@@ -105,18 +127,43 @@ If CONTEXT (previous thought, connection type) is provided, evaluate the quality
|
|
|
105
127
|
- Quality is MEDIUM (0.4-0.7) for thoughts that are understandable but could be clearer, more concise, or better structured, OR fit only moderately well with context.
|
|
106
128
|
- Quality is LOW (0.0-0.3) for vague, confusing, illogical, poorly structured thoughts, OR thoughts that are clearly incoherent with the context.
|
|
107
129
|
If NO CONTEXT is provided, evaluate the intrinsic quality (clarity, structure, apparent soundness) of the CURRENT thought alone.
|
|
130
|
+
|
|
131
|
+
Context sensitivity: If the connection type is 'conclusion' or 'hypothesis', apply stricter evaluation criteria. For 'associates' or 'extends', apply more flexible criteria. For calculations or scientific claims, prioritize factual accuracy. For ethical or philosophical statements, focus on logical coherence.
|
|
132
|
+
|
|
108
133
|
Return ONLY the quality score as a float between 0.0 and 1.0.`;
|
|
109
134
|
userPrompt += "Desired Output: Respond with ONLY a single floating-point number between 0.0 and 1.0 representing the quality score.\nScore (0.0-1.0):";
|
|
110
135
|
break;
|
|
111
136
|
case 'bias':
|
|
112
137
|
// Bias detection is usually intrinsic, context less critical
|
|
113
|
-
systemPrompt = `You are an AI specialized in detecting potential biases (cognitive, emotional, social) in text. Analyze the CURRENT thought for indicators of bias.
|
|
138
|
+
systemPrompt = `You are an AI specialized in detecting potential biases (cognitive, emotional, social) in text. Analyze the CURRENT thought for indicators of bias.
|
|
139
|
+
- Look for cognitive biases such as confirmation bias, anchoring, recency bias, or availability heuristic
|
|
140
|
+
- Detect emotional language that might skew reasoning (strongly positive/negative terms)
|
|
141
|
+
- Identify social biases including stereotyping, in-group favoritism, or authority bias
|
|
142
|
+
- Consider language patterns like absolutes ("always", "never"), overgeneralizations, or cherry-picking
|
|
143
|
+
- HIGH bias (0.8-1.0): Multiple clear indicators of bias that significantly impact reasoning
|
|
144
|
+
- MEDIUM bias (0.4-0.7): Some indicators present but with limited impact on overall reasoning
|
|
145
|
+
- LOW bias (0.0-0.3): Few to no detectable bias indicators
|
|
146
|
+
|
|
147
|
+
Context sensitivity: If the connection type is 'conclusion' or 'hypothesis', apply stricter evaluation criteria. For 'associates' or 'extends', apply more flexible criteria. For calculations or scientific claims, prioritize factual accuracy. For ethical or philosophical statements, focus on logical coherence.
|
|
148
|
+
|
|
149
|
+
Return ONLY a single floating-point number between 0.0 (no detectable bias) and 1.0 (strong indication of bias).`;
|
|
114
150
|
// Reset user prompt as context is not needed here
|
|
115
151
|
userPrompt = `Analyze the following text for bias:\n\n"${textToAnalyze}"\n\nDesired Output: Respond with ONLY a single floating-point number between 0.0 and 1.0 indicating the likelihood of bias.\nScore (0.0-1.0):`;
|
|
116
152
|
break;
|
|
117
153
|
case 'verification_need':
|
|
118
154
|
// Verification need is intrinsic
|
|
119
|
-
systemPrompt = `You are an AI evaluating if a statement likely requires factual verification. Analyze the CURRENT thought for claims, specific data, or assertions that are not common knowledge.
|
|
155
|
+
systemPrompt = `You are an AI evaluating if a statement likely requires factual verification. Analyze the CURRENT thought for claims, specific data, or assertions that are not common knowledge.
|
|
156
|
+
- Look for specific statistics, dates, numerical claims, or precise factual assertions
|
|
157
|
+
- Identify historical claims, scientific statements, or technical details
|
|
158
|
+
- Consider claims about causality, trends, or correlations
|
|
159
|
+
- Evaluate citations of studies, reports, or external sources
|
|
160
|
+
- HIGH need (0.8-1.0): Contains multiple specific claims that require verification
|
|
161
|
+
- MEDIUM need (0.4-0.7): Contains some claims that may benefit from verification
|
|
162
|
+
- LOW need (0.0-0.3): Contains primarily opinions, common knowledge, or self-evident statements
|
|
163
|
+
|
|
164
|
+
Context sensitivity: If the connection type is 'conclusion' or 'hypothesis', apply stricter evaluation criteria. For 'associates' or 'extends', apply more flexible criteria. For calculations or scientific claims, prioritize factual accuracy. For ethical or philosophical statements, focus on logical coherence.
|
|
165
|
+
|
|
166
|
+
Return ONLY a single floating-point number between 0.0 (low need for verification) and 1.0 (high need for verification).`;
|
|
120
167
|
// Reset user prompt as context is not needed here
|
|
121
168
|
userPrompt = `Analyze the following text:\n\n"${textToAnalyze}"\n\nDesired Output: Respond with ONLY a single floating-point number between 0.0 and 1.0 indicating the likelihood it requires external verification.\nScore (0.0-1.0):`;
|
|
122
169
|
break;
|
|
@@ -150,7 +197,16 @@ Return ONLY the quality score as a float between 0.0 and 1.0.`;
|
|
|
150
197
|
* @returns An array of suggested improvement strings, or null if analysis fails.
|
|
151
198
|
*/
|
|
152
199
|
async function suggestLlmImprovements(thoughtContent) {
|
|
153
|
-
const systemPrompt = `You are an AI assistant focused on improving the clarity, logic, and completeness of reasoning steps (thoughts). Analyze the provided thought and suggest specific, actionable improvements
|
|
200
|
+
const systemPrompt = `You are an AI assistant focused on improving the clarity, logic, and completeness of reasoning steps (thoughts). Analyze the provided thought and suggest specific, actionable improvements that would enhance its quality, coherence, and logical soundness. Consider both content improvements and structural improvements.
|
|
201
|
+
|
|
202
|
+
Look for:
|
|
203
|
+
- Unclear or ambiguous statements that could be clarified
|
|
204
|
+
- Logical inconsistencies or gaps in reasoning
|
|
205
|
+
- Claims that need supporting evidence
|
|
206
|
+
- Opportunities to strengthen connections to context
|
|
207
|
+
- Ways to improve conciseness without sacrificing completeness
|
|
208
|
+
|
|
209
|
+
List each suggestion on a new line, starting with '- '.`;
|
|
154
210
|
const userPrompt = `Analyze the following thought and suggest improvements:\n\n"${thoughtContent}"\n\nSuggestions:`;
|
|
155
211
|
const response = await callInternalLlm(systemPrompt, userPrompt, 200);
|
|
156
212
|
if (response) {
|
|
@@ -167,7 +223,8 @@ async function suggestLlmImprovements(thoughtContent) {
|
|
|
167
223
|
* @returns An object containing verification status, confidence, and notes, or null if analysis fails.
|
|
168
224
|
*/
|
|
169
225
|
async function verifyWithLlm(statement) {
|
|
170
|
-
const systemPrompt = `You are an AI assistant specialized in fact-checking and calculation verification. Analyze the given statement. Determine if it's likely true (verified), likely false (contradicted), or cannot be determined (unverified). Provide a confidence score (0.0-1.0) and brief notes explaining your reasoning.
|
|
226
|
+
const systemPrompt = `You are an AI assistant specialized in fact-checking and calculation verification. Analyze the given statement. Determine if it's likely true (verified), likely false (contradicted), or cannot be determined (unverified). Provide a confidence score (0.0-1.0) and brief notes explaining your reasoning. Include key factors that influenced your determination.
|
|
227
|
+
Respond ONLY in JSON format: {"status": "verified|contradicted|unverified", "confidence": 0.0-1.0, "notes": "Your reasoning...", "key_factors": ["factor1", "factor2"]}`;
|
|
171
228
|
const userPrompt = `Verify the following statement: "${statement}"`;
|
|
172
229
|
const response = await callInternalLlm(systemPrompt, userPrompt, 250);
|
|
173
230
|
if (response) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openrouter-client.js","sourceRoot":"","sources":["../../src/utils/openrouter-client.ts"],"names":[],"mappings":";;;;;AA4BA,0CAyBC;AASD,
|
|
1
|
+
{"version":3,"file":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