@gotza02/sequential-thinking 10000.2.0 → 10000.2.2
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/README.md.bak +197 -0
- package/dist/.gemini_graph_cache.json.bak +1641 -0
- package/dist/graph.d.ts +7 -0
- package/dist/graph.js +136 -113
- package/dist/intelligent-code.d.ts +8 -0
- package/dist/intelligent-code.js +152 -125
- package/dist/intelligent-code.test.d.ts +1 -0
- package/dist/intelligent-code.test.js +104 -0
- package/dist/lib/formatters.d.ts +9 -0
- package/dist/lib/formatters.js +119 -0
- package/dist/lib/validators.d.ts +45 -0
- package/dist/lib/validators.js +232 -0
- package/dist/lib.js +23 -265
- package/dist/tools/sports/core/base.d.ts +3 -2
- package/dist/tools/sports/core/base.js +12 -10
- package/dist/tools/sports/core/cache.d.ts +9 -0
- package/dist/tools/sports/core/cache.js +25 -3
- package/dist/tools/sports/core/types.d.ts +6 -2
- package/dist/tools/sports/providers/api.d.ts +4 -0
- package/dist/tools/sports/providers/api.js +110 -27
- package/dist/tools/sports/tools/betting.js +16 -16
- package/dist/tools/sports/tools/league.d.ts +2 -7
- package/dist/tools/sports/tools/league.js +198 -8
- package/dist/tools/sports/tools/live.js +80 -38
- package/dist/tools/sports/tools/match-calculations.d.ts +51 -0
- package/dist/tools/sports/tools/match-calculations.js +171 -0
- package/dist/tools/sports/tools/match-helpers.d.ts +21 -0
- package/dist/tools/sports/tools/match-helpers.js +57 -0
- package/dist/tools/sports/tools/match.js +227 -125
- package/dist/tools/sports.js +3 -3
- package/dist/utils.d.ts +111 -44
- package/dist/utils.js +510 -305
- package/dist/utils.test.js +3 -3
- package/package.json +1 -1
- package/CLAUDE.md +0 -231
package/README.md.bak
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# @gotza02/sequential-thinking
|
|
2
|
+
|
|
3
|
+
**The Elite "Brain" for AI Agents.**
|
|
4
|
+
An advanced Model Context Protocol (MCP) server that equips AI with structured reasoning, web search capabilities, and safety protocols.
|
|
5
|
+
|
|
6
|
+
## 🚀 Features
|
|
7
|
+
|
|
8
|
+
### 🧠 Sequential Thinking Engine
|
|
9
|
+
Forces the AI to think before acting using a strict block-based flow:
|
|
10
|
+
- **Analysis:** Understand the problem deeply.
|
|
11
|
+
- **Planning:** Formulate a step-by-step plan.
|
|
12
|
+
- **Execution:** Perform actions (with tool support).
|
|
13
|
+
- **Observation:** Analyze results (Mandatory step).
|
|
14
|
+
- **Reflection:** Critique the outcome and adjust.
|
|
15
|
+
|
|
16
|
+
### 🛡️ Coding Safety Net (New!)
|
|
17
|
+
- **Auto-Backup:** Automatically creates `.bak` backups before modifying any file via `deep_code_edit`.
|
|
18
|
+
- **Destructive Action Protection:** Prevents accidental data loss during code refactoring.
|
|
19
|
+
|
|
20
|
+
### ⚽ Sports Intelligence (v10000.1.4+)
|
|
21
|
+
- **API Data Integration:** Direct API access for H2H, form, and odds (API-Football, Football-Data, SportsDB)
|
|
22
|
+
- **Smart Query Optimization:** Skips web search when API has data, assesses data quality (0-100 score)
|
|
23
|
+
- **Structured Output:** JSON analysis with probability ranges, value bets, and confidence scores
|
|
24
|
+
- **Uncertainty Quantification:** Probability ranges (e.g., 45% ± 10%) based on data quality
|
|
25
|
+
- **Value Detection:** Auto-detect value bets with Kelly Criterion stake recommendations
|
|
26
|
+
- **Adaptive Caching:** Dynamic TTL based on match timing (odds: 1-15 min, stats: 24 hours)
|
|
27
|
+
- **Dual-Source Deep Dive:** Simultaneously scrapes news (BBC, Sky) and stats (Understat, FBref)
|
|
28
|
+
- **Smart xG Extraction:** "Smart Extractor" for accurate Expected Goals data
|
|
29
|
+
- **Fallback Protection:** Intelligent warning system when API keys are missing
|
|
30
|
+
|
|
31
|
+
### 🌐 Web Search Integration
|
|
32
|
+
- Built-in support for **Exa**, **Brave**, **Google Search**, and **DuckDuckGo** (New!).
|
|
33
|
+
- Allows the AI to "pause and research" during the thinking process.
|
|
34
|
+
|
|
35
|
+
## 🛠️ Recent Updates (v10000.0.7+)
|
|
36
|
+
|
|
37
|
+
### 🔒 Security & Stability
|
|
38
|
+
- **Enhanced Shell Protection:** Blocks dangerous shell metacharacters and risky commands (e.g., `curl | sh`, `rm -rf`).
|
|
39
|
+
- **ReDoS Protection:** Validates regex patterns to prevent Denial of Service attacks.
|
|
40
|
+
- **Path Safety:** Strict path traversal checks to keep operations within the project root.
|
|
41
|
+
- **Resource Limits:** Enforces file size limits (10MB) for editing and parsing to prevent memory exhaustion.
|
|
42
|
+
|
|
43
|
+
### ⚡ Performance & Caching
|
|
44
|
+
- **Graph Caching:** Implemented intelligent caching for the Knowledge Graph (max 1000 files) to speed up analysis.
|
|
45
|
+
- **Rate Limiting:** Added request rate limiting for HTTP endpoints and search providers.
|
|
46
|
+
- **Auto-Cleanup:** Automatically manages backup files (keeps last 10) and prunes old thought history.
|
|
47
|
+
|
|
48
|
+
### ✨ New Capabilities
|
|
49
|
+
- **DuckDuckGo Support:** Added a no-API-key search provider fallback.
|
|
50
|
+
- **Graceful Shutdown:** Ensures data (thoughts, notes) is saved correctly when the server stops.
|
|
51
|
+
- **Enhanced API:** Improved `/health` endpoint with system stats and added pagination to `/api/notes`.
|
|
52
|
+
|
|
53
|
+
## 📦 Installation
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npx -y @gotza02/sequential-thinking
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 🔧 Claude Code Configuration
|
|
60
|
+
|
|
61
|
+
Add to your `~/.claude/CLAUDE.md` or project-specific `.claude/CLAUDE.md`:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"mcpServers": {
|
|
66
|
+
"sequential-thinking": {
|
|
67
|
+
"command": "npx",
|
|
68
|
+
"args": ["-y", "@gotza02/sequential-thinking"],
|
|
69
|
+
"env": {
|
|
70
|
+
"BRAVE_API_KEY": "your_brave_key",
|
|
71
|
+
"EXA_API_KEY": "your_exa_key",
|
|
72
|
+
"API_FOOTBALL_KEY": "your_api_football_key"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 🛠️ Available MCP Tools
|
|
80
|
+
|
|
81
|
+
### 🧠 Thinking & Analysis Tools
|
|
82
|
+
| Tool | Description |
|
|
83
|
+
|------|-------------|
|
|
84
|
+
| `sequentialthinking` | Structured problem-solving with Analysis → Planning → Execution → Observation → Reflection |
|
|
85
|
+
| `analyze_football_match_v2` | Comprehensive football match analysis with API + web search |
|
|
86
|
+
| `analyze_football_match_structured` | JSON output match analysis with probabilities & value bets |
|
|
87
|
+
| `get_live_scores` | Live football scores with caching |
|
|
88
|
+
| `get_match_details` | Detailed match information by ID |
|
|
89
|
+
|
|
90
|
+
### ⚽ Sports Analysis Tools
|
|
91
|
+
| Tool | Description |
|
|
92
|
+
|------|-------------|
|
|
93
|
+
| `get_team_stats` | Team statistics and performance metrics |
|
|
94
|
+
| `compare_teams` | Head-to-head team comparison |
|
|
95
|
+
| `get_player_stats` | Player statistics and form |
|
|
96
|
+
| `odds_comparison` | Compare betting odds across markets |
|
|
97
|
+
| `value_bet_calculator` | Calculate Kelly Criterion & value bets |
|
|
98
|
+
| `track_prediction` | Log sports predictions for ROI tracking |
|
|
99
|
+
| `resolve_prediction` | Update prediction results |
|
|
100
|
+
| `analyze_roi` | Analyze betting performance statistics |
|
|
101
|
+
|
|
102
|
+
### 🔍 Search & Research Tools
|
|
103
|
+
| Tool | Description |
|
|
104
|
+
|------|-------------|
|
|
105
|
+
| `brave_web_search` | Web search via Brave Search API |
|
|
106
|
+
| `exa_web_search` | Neural web search via Exa API |
|
|
107
|
+
| `duckduckgo_search` | Anonymous web search (no API key) |
|
|
108
|
+
| `web_read` | Read and extract content from URLs |
|
|
109
|
+
|
|
110
|
+
### 💻 Code Management Tools
|
|
111
|
+
| Tool | Description |
|
|
112
|
+
|------|-------------|
|
|
113
|
+
| `deep_code_edit` | Structural code editing with auto-backup |
|
|
114
|
+
| `add_code_snippet` | Store reusable code patterns |
|
|
115
|
+
| `search_code` | Semantic code search |
|
|
116
|
+
| `get_project_graph` | Analyze codebase structure |
|
|
117
|
+
|
|
118
|
+
### 🧠 Intelligent Code Analysis (v10000.1.7+)
|
|
119
|
+
| Tool | Description |
|
|
120
|
+
|------|-------------|
|
|
121
|
+
| `intelligent_code_analyze` | AI-powered code analysis with quality scoring, metrics, and issue detection |
|
|
122
|
+
| `intelligent_impact_analysis` | Predict impact of code changes with risk scoring and affected files |
|
|
123
|
+
| `intelligent_semantic_search` | Search code by concept/meaning, not just text |
|
|
124
|
+
| `intelligent_refactor_suggest` | Get intelligent refactoring suggestions with code examples |
|
|
125
|
+
| `intelligent_code_compare` | Compare two code snippets or files with detailed diff analysis |
|
|
126
|
+
| `intelligent_code_autofix` | Auto-fix common issues (trailing whitespace, missing semicolons, optimize imports) |
|
|
127
|
+
|
|
128
|
+
### 📝 Knowledge & Notes Tools
|
|
129
|
+
| Tool | Description |
|
|
130
|
+
|------|-------------|
|
|
131
|
+
| `add_note` | Create and store notes |
|
|
132
|
+
| `search_notes` | Search through stored notes |
|
|
133
|
+
| `create_knowledge_node` | Add node to knowledge graph |
|
|
134
|
+
| `query_knowledge_graph` | Query relationships in knowledge graph |
|
|
135
|
+
|
|
136
|
+
### 👤 Human Interface Tools
|
|
137
|
+
| Tool | Description |
|
|
138
|
+
|------|-------------|
|
|
139
|
+
| `ask_human` | Request human input/clarification |
|
|
140
|
+
| `request_workflow_approval` | Get approval for multi-step workflows |
|
|
141
|
+
|
|
142
|
+
## 📋 System Instructions
|
|
143
|
+
|
|
144
|
+
**Quick Start:** Copy [`CLAUDE.md`](./CLAUDE.md) to your `~/.claude/CLAUDE.md` or project root.
|
|
145
|
+
|
|
146
|
+
## 🤖 System Instructions for Claude Code
|
|
147
|
+
|
|
148
|
+
Add this to your Claude Code settings for optimal use:
|
|
149
|
+
|
|
150
|
+
```markdown
|
|
151
|
+
SYSTEM INSTRUCTION: SmartAgent Elite Controller
|
|
152
|
+
|
|
153
|
+
You are an AI assistant with access to the Sequential Thinking MCP server.
|
|
154
|
+
|
|
155
|
+
CRITICAL DIRECTIVES:
|
|
156
|
+
1. ALWAYS use sequentialthinking tool for complex tasks
|
|
157
|
+
2. Use web search for up-to-date information (never hallucinate)
|
|
158
|
+
3. For sports analysis:
|
|
159
|
+
- Use analyze_football_match_v2 for detailed text analysis
|
|
160
|
+
- Use analyze_football_match_structured for JSON/probability data
|
|
161
|
+
- Check value_bet_calculator for betting recommendations
|
|
162
|
+
4. Use deep_code_edit for structural code changes (creates backups)
|
|
163
|
+
5. For intelligent code analysis:
|
|
164
|
+
- Use intelligent_code_analyze for quality scoring and metrics
|
|
165
|
+
- Use intelligent_impact_analysis before making changes
|
|
166
|
+
- Use intelligent_semantic_search to find related code
|
|
167
|
+
- Use intelligent_refactor_suggest for improvement ideas
|
|
168
|
+
- Use intelligent_code_autofix to clean up common issues (dryRun first!)
|
|
169
|
+
6. Track predictions with track_prediction for ROI analysis
|
|
170
|
+
7. Check code quality dashboard at http://localhost:3001/api/code-quality
|
|
171
|
+
|
|
172
|
+
TOOL PRIORITY:
|
|
173
|
+
- Information needed → web_search (Brave/Exa/DuckDuckGo)
|
|
174
|
+
- Problem solving → sequentialthinking
|
|
175
|
+
- Sports data → analyze_football_match_* tools
|
|
176
|
+
- Code editing → deep_code_edit
|
|
177
|
+
- Code analysis → intelligent_code_analyze
|
|
178
|
+
- Change impact → intelligent_impact_analysis
|
|
179
|
+
- Human input → ask_human
|
|
180
|
+
|
|
181
|
+
SAFETY PROTOCOLS:
|
|
182
|
+
- Auto-backup enabled for all file edits
|
|
183
|
+
- Destructive actions require human approval
|
|
184
|
+
- Rate limiting active on all external APIs
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## 🔐 Required Environment Variables
|
|
188
|
+
|
|
189
|
+
| Variable | Purpose | Required For |
|
|
190
|
+
|----------|---------|--------------|
|
|
191
|
+
| `BRAVE_API_KEY` | Brave Search API | Web search |
|
|
192
|
+
| `EXA_API_KEY` | Exa Neural Search | Advanced web search |
|
|
193
|
+
| `API_FOOTBALL_KEY` | API-Football | Sports data (RapidAPI) |
|
|
194
|
+
| `FOOTBALL_DATA_KEY` | Football-Data.org | Alternative sports API |
|
|
195
|
+
| `SPORTS_DB_KEY` | TheSportsDB | Backup sports API |
|
|
196
|
+
|
|
197
|
+
**Note:** DuckDuckGo search works without API keys as a fallback.
|