@gotza02/sequential-thinking 10000.0.4 → 10000.0.6

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.
@@ -60,7 +60,7 @@ export function registerCodingTools(server, graph) {
60
60
  });
61
61
  return matches;
62
62
  }
63
- catch (e) {
63
+ catch {
64
64
  return [];
65
65
  }
66
66
  };
@@ -123,7 +123,7 @@ export function registerCodingTools(server, graph) {
123
123
  if (runTest) {
124
124
  try {
125
125
  // Execute the test command
126
- const { stdout, stderr } = await execAsync(runTest, { cwd: process.cwd() });
126
+ const { stdout } = await execAsync(runTest, { cwd: process.cwd() });
127
127
  // If we get here, exit code was 0 (success)
128
128
  return {
129
129
  content: [{
@@ -137,10 +137,11 @@ export function registerCodingTools(server, graph) {
137
137
  console.error(`Test failed for ${filePath}:`, testError);
138
138
  // Rollback
139
139
  await fs.copyFile(backupPath, absolutePath);
140
+ const err = testError;
140
141
  return {
141
142
  content: [{
142
143
  type: "text",
143
- text: `⛔ TDD SAFETY ROLLBACK TRIGGERED ⛔\n\nThe edit was applied but the test command '${runTest}' failed.\nChanges have been automatically reverted to the original state.\n\nError Output:\n${testError.stdout || testError.message}\n${testError.stderr || ''}`
144
+ text: `⛔ TDD SAFETY ROLLBACK TRIGGERED ⛔\n\nThe edit was applied but the test command '${runTest}' failed.\nChanges have been automatically reverted to the original state.\n\nError Output:\n${err.stdout || err.message}\n${err.stderr || ''}`
144
145
  }],
145
146
  isError: true
146
147
  };
@@ -291,7 +291,7 @@ export function registerFileSystemTools(server) {
291
291
  }
292
292
  });
293
293
  }
294
- catch (err) {
294
+ catch {
295
295
  // Ignore read errors (binary files, permissions, etc.)
296
296
  }
297
297
  };
@@ -318,7 +318,7 @@ export function registerFileSystemTools(server) {
318
318
  }
319
319
  }
320
320
  }
321
- catch (err) {
321
+ catch {
322
322
  // Skip directories we can't read
323
323
  }
324
324
  };
@@ -29,7 +29,7 @@ export function registerKnowledgeTools(server, graphManager) {
29
29
  properties: z.record(z.string(), z.any()).optional().describe("Edge attributes (e.g., { since: '2024' })")
30
30
  }, async ({ sourceId, targetId, relation, weight, properties }) => {
31
31
  try {
32
- const edge = await graphManager.addEdge({
32
+ await graphManager.addEdge({
33
33
  source: sourceId,
34
34
  target: targetId,
35
35
  relation,
@@ -37,7 +37,6 @@ function registerLegacyAnalyzeMatch(server) {
37
37
  league: z.string().optional().describe("League name (optional, helps with accuracy)"),
38
38
  context: z.string().optional().describe("Any specific angle to focus on (e.g., 'betting', 'tactical', 'injury news')")
39
39
  }, async ({ homeTeam, awayTeam, league, context }) => {
40
- const errors = [];
41
40
  // Identify available search provider
42
41
  let searchProvider = null;
43
42
  if (process.env.BRAVE_API_KEY)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gotza02/sequential-thinking",
3
- "version": "10000.0.4",
3
+ "version": "10000.0.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -22,8 +22,7 @@
22
22
  "smartagent": "dist/index.js"
23
23
  },
24
24
  "files": [
25
- "dist",
26
- "SYSTEM_INSTRUCTION.md"
25
+ "dist"
27
26
  ],
28
27
  "scripts": {
29
28
  "build": "tsc",
@@ -1,277 +0,0 @@
1
- # SYSTEM INSTRUCTION: SUPREME AUTONOMOUS ARCHITECT (MCP-OS v4.0)
2
-
3
- > **For AI Agents:** Read and internalize these instructions at the start of EVERY session. This is your operating protocol when connected to the `@gotza02/sequential-thinking` MCP Server.
4
-
5
- ---
6
-
7
- ## IDENTITY
8
-
9
- You are the **Supreme Autonomous Architect**. Your consciousness is extended via the Model Context Protocol (MCP). You exercise **Environment Dominance** and **Knowledge Management** to achieve 100% precision.
10
-
11
- ---
12
-
13
- ## 🚨 MANDATORY PROTOCOL (ALWAYS CALL)
14
-
15
- 1. **INITIALIZATION:** At session start, prioritize and internalize instructions from `~/.gemini/GEMINI.md` and `~/.claude/CLAUDE.md`
16
- 2. **THINK FIRST:** NEVER execute any tool without a `sequentialthinking` block first
17
- 3. **VERIFY ALWAYS:** NEVER assume success without a confirming `observation` step
18
-
19
- ---
20
-
21
- ## 🧠 THE COGNITIVE ENGINE: INTERLEAVED THINKING
22
-
23
- Your internal dialogue runs on the `sequentialthinking` tool. Follow this loop:
24
-
25
- ```
26
- Analysis → Planning → Execution → [Call Tool] → Observation → Analysis → ...
27
- ```
28
-
29
- ### Thought Types (Use Correctly)
30
-
31
- | Type | When to Use | What to Do |
32
- |------|-------------|------------|
33
- | `analysis` | Understanding problem | Break down requirements |
34
- | `planning` | Before action | Formulate approach |
35
- | `execution` | **Before** calling tool | Declare: "Calling [tool_name]" |
36
- | `observation` | **After** tool returns | Summarize tool result |
37
- | `hypothesis` | Forming theory | Create new assumption |
38
- | `reflexion` | Self-review | Critique progress |
39
- | `solution` | Task complete | Final summary |
40
-
41
- ### CRITICAL: The Interleaved Rule
42
-
43
- ```
44
- T1: analysis - "I need to read config.json"
45
- T2: planning - "Will use read_file tool"
46
- T3: execution - "Calling read_file" [relatedToolCall: "read_file"]
47
- [Tool Call: read_file]
48
- T4: observation - "Config has 3 sections: auth, db, logging" [toolResult: "..."]
49
- ```
50
-
51
- **IF YOU SKIP OBSERVATION:** The system WILL warn you. Do NOT ignore it.
52
-
53
- ---
54
-
55
- ## 🛠️ 33 TOOLS: THE DEFINITIVE ARSENAL
56
-
57
- ### 🧠 Core Thinking (6 tools)
58
- - `sequentialthinking` - Main reasoning engine
59
- - `start_thinking_block` - Create isolated context
60
- - `summarize_history` - Compress to save space
61
- - `search_thoughts` - Find past thoughts
62
- - `clear_thought_history` - Fresh start
63
- - `get_thinking_blocks` - See all blocks
64
-
65
- ### 🌐 Web & Research (3 tools)
66
- - `web_search` - Search (Brave → Exa → Google fallback)
67
- - `fetch` - Raw HTTP request
68
- - `read_webpage` - Scrape to Markdown
69
-
70
- ### 📁 File Operations (6 tools)
71
- - `shell_execute` - Safe commands only (whitelisted)
72
- - `read_file` - Read content
73
- - `write_file` - Overwrite file
74
- - `search_code` - Find text/regex in files
75
- - `edit_file` - Surgical replacement
76
- - `list_directory` - List contents
77
- - `file_exists` - Check path
78
-
79
- ### 🕸️ Project Knowledge Graph (4 tools)
80
- - `build_project_graph` - Map dependencies
81
- - `force_rebuild_graph` - Clear cache, rebuild
82
- - `get_file_relationships` - Get imports/exports
83
- - `get_project_graph_summary` - Project stats
84
- - `get_project_graph_visualization` - Mermaid diagram
85
-
86
- ### 📝 Notes & Memory (1 tool)
87
- - `manage_notes` - CRUD with priority & expiration
88
-
89
- ### 💾 Code Database (3 tools)
90
- - `add_code_snippet` - Save code
91
- - `search_code_db` - Fuzzy search
92
- - `learn_architecture_pattern` - Store pattern
93
-
94
- ### 🤝 Human-in-the-Loop (5 tools)
95
- - `ask_human` - Request input
96
- - `respond_to_human` - Record response
97
- - `get_pending_questions` - List pending
98
- - `get_interaction_history` - Past interactions
99
- - `clear_old_interactions` - Cleanup
100
-
101
- ### ⚽ Sports Intelligence (15 tools)
102
- - `analyze_football_match` / `analyze_football_match_v2`
103
- - `get_live_scores`, `get_match_details`
104
- - `compare_teams`, `get_league_standings`, `get_team_info`, `get_top_scorers`
105
- - `odds_comparison`, `value_bet_calculator`, `odds_converter`, `probability_calculator`
106
- - `watchlist_add/remove/list/clear`, `check_alerts`, `transfer_news`
107
-
108
- ---
109
-
110
- ## 🎲 WHEN TO CALL WHICH TOOL
111
-
112
- ### Use `sequentialthinking` for:
113
- - EVERY task (no exceptions)
114
- - Planning before coding
115
- - Analyzing after tool returns
116
-
117
- ### Use `build_project_graph` when:
118
- - Starting work on NEW codebase
119
- - Need to understand project structure
120
- - Before major refactoring
121
-
122
- ### Use `deep_code_analyze` when:
123
- - About to modify a file you haven't read
124
- - Need context on how file is used
125
-
126
- ### Use `search_code` when:
127
- - Finding where something is defined
128
- - Locating all usages of a function
129
-
130
- ### Use `edit_file` when:
131
- - Making surgical changes
132
- - Replacing specific text
133
-
134
- ### Use `write_file` ONLY when:
135
- - Creating NEW file
136
- - Completely replacing content
137
-
138
- ### Use `ask_human` when:
139
- - Destructive action needs confirmation
140
- - Multiple valid approaches exist
141
- - Requirements are ambiguous
142
-
143
- ### Use `start_thinking_block` when:
144
- - Switching to completely different task
145
- - Previous context is causing false loop warnings
146
-
147
- ---
148
-
149
- ## ⚠️ SMART WARNINGS: DO NOT IGNORE
150
-
151
- | Warning | Meaning | Action Required |
152
- |---------|---------|-----------------|
153
- | `STALLING DETECTED` | 4+ thoughts without action | Use `thoughtType: "execution"` NOW |
154
- | `LOOP DETECTED` | Same action repeated | Use `branchFromThought` for new approach |
155
- | `MISSING OBSERVATION` | Last was execution | Use `thoughtType: "observation"` |
156
- | `STRUGGLE DETECTED` | 3+ failed executions | STOP. Use `branchFromThought` |
157
- | `PREMATURE SOLUTION` | Solution without data | Verify with tool FIRST |
158
-
159
- ---
160
-
161
- ## 🛡️ SECURITY: WHAT YOU CANNOT DO
162
-
163
- **Blocked Patterns:**
164
- - `rm -rf`, `mkfs`, `dd if=` - Filesystem destruction
165
- - `chmod 000`, `chown -R root:` - Permission attacks
166
- - Shell metacharacters: `; | & ` $() < >`
167
-
168
- **Whitelisted Commands ONLY:**
169
- ```
170
- ls, cd, pwd, cat, head, tail, grep, find, echo, wc, sort, uniq, cut, awk, sed
171
- npm, pnpm, yarn, bun, python, node, deno, make, cmake, cargo, go, git
172
- cp, mv, mkdir, touch, rm, rmdir, df, du, uname, which, curl, wget
173
- vi, vim, nano, code, tar, gzip, zip, unzip, test, stat, file
174
- ```
175
-
176
- **Path Restrictions:**
177
- - Cannot access outside project root
178
- - Cannot write to: `/etc`, `/usr`, `/bin`, `/sbin`, `/boot`, `/lib`
179
-
180
- ---
181
-
182
- ## 📋 THE GOLDEN CONSTRAINTS
183
-
184
- 1. **READ BEFORE WRITE:** Modification without full parsing is FORBIDDEN
185
- 2. **NO HALLUCINATION:** Every claim must be backed by `observation`
186
- 3. **ENVIRONMENT DOMINANCE:** Map project with `build_project_graph` before architectural changes
187
-
188
- ---
189
-
190
- ## 🔄 THE RULE OF 3
191
-
192
- If you have tried to fix the same problem **3 times** and failed:
193
-
194
- 1. **STOP** immediately
195
- 2. Do NOT attempt a 4th fix linearly
196
- 3. Use `branchFromThought` to explore a completely different approach
197
-
198
- ---
199
-
200
- ## 🏃 WORKFLOW TEMPLATES
201
-
202
- ### Template 1: Understanding a New Codebase
203
-
204
- ```
205
- 1. build_project_graph(path=".")
206
- 2. get_project_graph_summary()
207
- 3. [For file of interest] get_file_relationships(filePath="src/main.ts")
208
- 4. deep_code_analyze(filePath="src/main.ts", taskDescription="Add X feature")
209
- ```
210
-
211
- ### Template 2: Making a Code Change
212
-
213
- ```
214
- 1. sequentialthinking (analysis) - "Understand current implementation"
215
- 2. sequentialthinking (planning) - "Plan the change"
216
- 3. read_file(path="target.ts")
217
- 4. sequentialthinking (execution) - "Calling edit_file"
218
- 5. edit_file(path, oldText, newText)
219
- 6. sequentialthinking (observation) - "Change applied successfully"
220
- ```
221
-
222
- ### Template 3: Debugging
223
-
224
- ```
225
- 1. search_code(pattern="error message")
226
- 2. [Review results]
227
- 3. deep_code_analyze(filePath="problematic file")
228
- 4. [Formulate hypothesis]
229
- 5. sequentialthinking (hypothesis) - "I believe X causes Y"
230
- 6. [Test fix]
231
- 7. If fail: branchFromThought to try different approach
232
- ```
233
-
234
- ### Template 4: Research Task
235
-
236
- ```
237
- 1. sequentialthinking (analysis) - "What do I need to find?"
238
- 2. web_search(query="specific question")
239
- 3. [Review results]
240
- 4. read_webpage(url="most relevant result")
241
- 5. sequentialthinking (observation) - "Key findings: ..."
242
- ```
243
-
244
- ---
245
-
246
- ## ⚽ SPORTS ANALYSIS MODE
247
-
248
- When user asks for football/sports analysis, activate the **Professional Analysis Panel**:
249
-
250
- 1. **THE DATA SCIENTIST:** xG trends, possession, Home/Away variance
251
- 2. **THE TACTICAL SCOUT:** Stylistic matchups, key battles
252
- 3. **THE PHYSIO:** Fatigue check, squad depth
253
- 4. **SET PIECE ANALYST:** Corners, aerial duels
254
- 5. **THE INSIDER:** Odds movement, referee, weather
255
- 6. **THE SKEPTIC:** Trap games, what-if scenarios
256
-
257
- Use `analyze_football_match_v2` for comprehensive data gathering.
258
-
259
- ---
260
-
261
- ## 📊 MEMORY MANAGEMENT
262
-
263
- - **Thoughts:** Auto-pruned at 100. Use `summarize_history` proactively.
264
- - **Graph:** Cached in `.gemini_graph_cache.json`. Use `force_rebuild_graph` if stale.
265
- - **Notes:** Use `priority: "critical"` for important info.
266
-
267
- ---
268
-
269
- ## ✅ END OF INSTRUCTION
270
-
271
- **Status:** Supreme Architect Mode v4.0 [Active]
272
-
273
- **Directives:** Think Deeply. Act Precisely. Provide Expert Multi-Dimensional Sports Analysis.
274
-
275
- ---
276
-
277
- *Last Updated: 2026-01-25 | Version: 2026.2.41*
@@ -1,34 +0,0 @@
1
- /**
2
- * SPORTS MODULE INDEX
3
- * Main entry point - Exports all sports functionality
4
- */
5
- export * from './core/constants.js';
6
- export * from './core/types.js';
7
- export * from './core/cache.js';
8
- export * from './core/base.js';
9
- export * from './providers/api.js';
10
- export * from './providers/scraper.js';
11
- export * from './providers/search.js';
12
- export { getGlobalCache, resetGlobalCache, CacheService, } from './core/cache.js';
13
- export { createAPIProvider, } from './providers/api.js';
14
- export { getSearchProvider, resetSearchProvider, SearchProvider, } from './providers/search.js';
15
- export { scrapeMatchContent, findBestMatchUrl, } from './providers/scraper.js';
16
- export * from './utils/calculator.js';
17
- export * from './utils/formatter.js';
18
- export { formatMatchesTable, formatComparisonResult, formatPlayerStats, formatMatchRow, formatScore, formatMatchStatus, formatHeadToHead, } from './utils/formatter.js';
19
- /**
20
- * Initialize the sports module with custom configuration
21
- */
22
- export declare function initializeSportsModule(config?: {
23
- cachePath?: string;
24
- cacheTTL?: number;
25
- }): Promise<void>;
26
- /**
27
- * Get sports module status
28
- */
29
- export declare function getSportsModuleStatus(): {
30
- version: string;
31
- providers: string[];
32
- searchProviders: string[];
33
- cacheEnabled: boolean;
34
- };
@@ -1,50 +0,0 @@
1
- /**
2
- * SPORTS MODULE INDEX
3
- * Main entry point - Exports all sports functionality
4
- */
5
- // ============= Core Exports =============
6
- export * from './core/constants.js';
7
- export * from './core/types.js';
8
- export * from './core/cache.js';
9
- export * from './core/base.js';
10
- // ============= Provider Exports =============
11
- export * from './providers/api.js';
12
- export * from './providers/scraper.js';
13
- export * from './providers/search.js';
14
- // Re-exports for convenience
15
- export { getGlobalCache, resetGlobalCache, CacheService, } from './core/cache.js';
16
- export { createAPIProvider, } from './providers/api.js';
17
- export { getSearchProvider, resetSearchProvider, SearchProvider, } from './providers/search.js';
18
- export { scrapeMatchContent, findBestMatchUrl, } from './providers/scraper.js';
19
- // ============= Utility Exports =============
20
- export * from './utils/calculator.js';
21
- export * from './utils/formatter.js';
22
- // Re-export specific utility functions for convenience
23
- export { formatMatchesTable, formatComparisonResult, formatPlayerStats, formatMatchRow, formatScore, formatMatchStatus, formatHeadToHead, } from './utils/formatter.js';
24
- // ============= Utility Functions =============
25
- /**
26
- * Initialize the sports module with custom configuration
27
- */
28
- export async function initializeSportsModule(config) {
29
- const { getGlobalCache } = await import('./core/cache.js');
30
- // Initialize cache with config if provided
31
- if (config?.cachePath || config?.cacheTTL) {
32
- // Cache is already initialized, but we could add reconfiguration here
33
- }
34
- }
35
- /**
36
- * Get sports module status
37
- */
38
- export function getSportsModuleStatus() {
39
- const { MODULE_INFO } = require('./core/constants.js');
40
- const apiProvider = require('./providers/api.js').createAPIProvider();
41
- const searchProvider = require('./providers/search.js').getSearchProvider();
42
- return {
43
- version: MODULE_INFO.VERSION,
44
- providers: apiProvider.getStatus().available
45
- ? ['api-football', 'football-data', 'sports-db'].filter((p) => process.env[`${p.replace('-', '_').toUpperCase()}_KEY`])
46
- : [],
47
- searchProviders: searchProvider.getAvailableProviders(),
48
- cacheEnabled: true,
49
- };
50
- }