@gotza02/sequential-thinking 2026.2.20 โ†’ 2026.2.22

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.
Files changed (51) hide show
  1. package/README.md +1 -0
  2. package/dist/codestore.d.ts +28 -0
  3. package/dist/graph.d.ts +60 -0
  4. package/dist/graph.js +19 -0
  5. package/dist/http-server.d.ts +2 -0
  6. package/dist/http-server.js +7 -1
  7. package/dist/index.d.ts +2 -0
  8. package/dist/index.js +2 -0
  9. package/dist/lib.d.ts +67 -0
  10. package/dist/lib.js +323 -83
  11. package/dist/notes.d.ts +25 -0
  12. package/dist/system_test.d.ts +1 -0
  13. package/dist/test_ts_req.d.ts +1 -0
  14. package/dist/tools/codestore.d.ts +3 -0
  15. package/dist/tools/coding.d.ts +3 -0
  16. package/dist/tools/filesystem.d.ts +2 -0
  17. package/dist/tools/graph.d.ts +3 -0
  18. package/dist/tools/graph.js +18 -0
  19. package/dist/tools/human.d.ts +65 -0
  20. package/dist/tools/human.js +305 -0
  21. package/dist/tools/notes.d.ts +3 -0
  22. package/dist/tools/thinking.d.ts +3 -0
  23. package/dist/tools/thinking.js +137 -65
  24. package/dist/tools/web.d.ts +2 -0
  25. package/dist/utils.d.ts +32 -0
  26. package/package.json +3 -1
  27. package/dist/chaos.test.js +0 -72
  28. package/dist/codestore.test.js +0 -59
  29. package/dist/coding.test.js +0 -140
  30. package/dist/e2e.test.js +0 -122
  31. package/dist/filesystem.test.js +0 -189
  32. package/dist/graph.test.js +0 -150
  33. package/dist/graph_repro.test.js +0 -63
  34. package/dist/integration.test.js +0 -58
  35. package/dist/notes.test.js +0 -74
  36. package/dist/registration.test.js +0 -39
  37. package/dist/repro_dollar.js +0 -30
  38. package/dist/repro_dollar_simple.js +0 -22
  39. package/dist/repro_history.js +0 -41
  40. package/dist/repro_path.js +0 -17
  41. package/dist/repro_search.test.js +0 -79
  42. package/dist/repro_ts_req.js +0 -3
  43. package/dist/server.test.js +0 -127
  44. package/dist/stress.test.js +0 -68
  45. package/dist/utils.test.js +0 -40
  46. package/dist/verify_cache.test.js +0 -27
  47. package/dist/verify_edit.test.js +0 -66
  48. package/dist/verify_notes.test.js +0 -36
  49. package/dist/verify_viz.test.js +0 -25
  50. package/dist/web_fallback.test.js +0 -103
  51. package/dist/web_read.test.js +0 -60
package/README.md CHANGED
@@ -90,6 +90,7 @@ npm run start:http
90
90
  ## ๐Ÿงช Testing & Robustness
91
91
  This project is rigorously tested using **TestSprite** and **Vitest**.
92
92
  - **Current Status:** โœ… **100% Pass Rate** (10/10 core requirements).
93
+ - **Test Isolation:** Graph tests now run in isolated temporary environments to prevent race conditions.
93
94
  - **Path Security:** Enhanced `validatePath` with symlink resolution (`realpathSync`) for stable operation in restricted environments like Termux/Android.
94
95
  - **Error Handling:** Improved HTTP status mapping and descriptive error reporting.
95
96
 
@@ -0,0 +1,28 @@
1
+ export interface CodeSnippet {
2
+ id: string;
3
+ title: string;
4
+ language: string;
5
+ code: string;
6
+ description: string;
7
+ tags: string[];
8
+ context?: string;
9
+ updatedAt: string;
10
+ }
11
+ export interface CodeKnowledge {
12
+ snippets: CodeSnippet[];
13
+ patterns: Record<string, string>;
14
+ }
15
+ export declare class CodeDatabase {
16
+ private filePath;
17
+ private db;
18
+ private loaded;
19
+ private mutex;
20
+ constructor(storagePath?: string);
21
+ private load;
22
+ private save;
23
+ addSnippet(snippet: Omit<CodeSnippet, 'id' | 'updatedAt'>): Promise<CodeSnippet>;
24
+ searchSnippets(query: string): Promise<CodeSnippet[]>;
25
+ learnPattern(name: string, description: string): Promise<void>;
26
+ getPattern(name: string): Promise<string | null>;
27
+ listAllPatterns(): Promise<Record<string, string>>;
28
+ }
@@ -0,0 +1,60 @@
1
+ export interface FileNode {
2
+ path: string;
3
+ imports: string[];
4
+ importedBy: string[];
5
+ symbols: string[];
6
+ }
7
+ export declare class ProjectKnowledgeGraph {
8
+ private nodes;
9
+ private rootDir;
10
+ private cache;
11
+ private cachePath;
12
+ constructor();
13
+ /**
14
+ * Force rebuild the graph by clearing cache first.
15
+ * Use this when cache seems stale or files are not detected properly.
16
+ */
17
+ forceRebuild(rootDir: string): Promise<{
18
+ nodeCount: number;
19
+ totalFiles: number;
20
+ cachedFiles: number;
21
+ parsedFiles: number;
22
+ }>;
23
+ build(rootDir: string): Promise<{
24
+ nodeCount: number;
25
+ totalFiles: number;
26
+ cachedFiles: number;
27
+ parsedFiles: number;
28
+ }>;
29
+ private loadCache;
30
+ private saveCache;
31
+ private getAllFiles;
32
+ private parseFile;
33
+ private parseTypeScript;
34
+ private parseGeneric;
35
+ private linkFileNodes;
36
+ private resolvePath;
37
+ getRelationships(filePath: string): {
38
+ path: string;
39
+ imports: string[];
40
+ importedBy: string[];
41
+ symbols: string[];
42
+ } | null;
43
+ getDeepContext(filePath: string): {
44
+ targetFile: {
45
+ path: string;
46
+ symbols: string[];
47
+ };
48
+ dependencies: any[];
49
+ dependents: any[];
50
+ } | null;
51
+ getSummary(): {
52
+ root: string;
53
+ fileCount: number;
54
+ mostReferencedFiles: {
55
+ file: string;
56
+ referencedBy: number;
57
+ }[];
58
+ };
59
+ toMermaid(): string;
60
+ }
package/dist/graph.js CHANGED
@@ -7,6 +7,25 @@ export class ProjectKnowledgeGraph {
7
7
  cache = { version: '1.0', files: {} };
8
8
  cachePath = '';
9
9
  constructor() { }
10
+ /**
11
+ * Force rebuild the graph by clearing cache first.
12
+ * Use this when cache seems stale or files are not detected properly.
13
+ */
14
+ async forceRebuild(rootDir) {
15
+ this.rootDir = path.resolve(rootDir);
16
+ this.cachePath = path.join(this.rootDir, '.gemini_graph_cache.json');
17
+ // Clear in-memory cache
18
+ this.cache = { version: '1.0', files: {} };
19
+ // Delete cache file if exists
20
+ try {
21
+ await fs.unlink(this.cachePath);
22
+ }
23
+ catch (e) {
24
+ // File doesn't exist, that's fine
25
+ }
26
+ // Now build fresh
27
+ return await this.build(rootDir);
28
+ }
10
29
  async build(rootDir) {
11
30
  try {
12
31
  this.rootDir = path.resolve(rootDir);
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -67,7 +67,13 @@ app.get('/api/thinking/history', async (req, res) => {
67
67
  thought: t.thought,
68
68
  type: t.thoughtType,
69
69
  thoughtNumber: t.thoughtNumber,
70
- totalThoughts: t.totalThoughts
70
+ totalThoughts: t.totalThoughts,
71
+ nextThoughtNeeded: t.nextThoughtNeeded,
72
+ isRevision: t.isRevision,
73
+ revisesThought: t.revisesThought,
74
+ branchFromThought: t.branchFromThought,
75
+ branchId: t.branchId,
76
+ blockId: t.blockId
71
77
  }));
72
78
  res.json(transformedHistory);
73
79
  }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js CHANGED
@@ -12,6 +12,7 @@ import { registerGraphTools } from './tools/graph.js';
12
12
  import { registerNoteTools } from './tools/notes.js';
13
13
  import { registerCodingTools } from './tools/coding.js';
14
14
  import { registerCodeDbTools } from './tools/codestore.js';
15
+ import { registerHumanTools } from './tools/human.js';
15
16
  const server = new McpServer({
16
17
  name: "sequential-thinking-server",
17
18
  version: "2026.2.6",
@@ -28,6 +29,7 @@ registerGraphTools(server, knowledgeGraph);
28
29
  registerNoteTools(server, notesManager);
29
30
  registerCodingTools(server, knowledgeGraph);
30
31
  registerCodeDbTools(server, codeDb);
32
+ registerHumanTools(server);
31
33
  async function runServer() {
32
34
  const transport = new StdioServerTransport();
33
35
  await server.connect(transport);
package/dist/lib.d.ts ADDED
@@ -0,0 +1,67 @@
1
+ export type ThoughtType = 'analysis' | 'planning' | 'execution' | 'observation' | 'hypothesis' | 'reflexion' | 'solution' | 'generation' | 'evaluation' | 'selection';
2
+ export interface ThoughtData {
3
+ thought: string;
4
+ thoughtNumber: number;
5
+ totalThoughts: number;
6
+ nextThoughtNeeded: boolean;
7
+ thoughtType?: ThoughtType;
8
+ blockId?: string;
9
+ relatedToolCall?: string;
10
+ toolResult?: string;
11
+ isRevision?: boolean;
12
+ revisesThought?: number;
13
+ branchFromThought?: number;
14
+ branchId?: string;
15
+ needsMoreThoughts?: boolean;
16
+ score?: number;
17
+ options?: string[];
18
+ selectedOption?: string;
19
+ }
20
+ interface ThinkingBlock {
21
+ id: string;
22
+ topic: string;
23
+ status: 'active' | 'completed' | 'failed';
24
+ thoughts: ThoughtData[];
25
+ createdAt: string;
26
+ updatedAt: string;
27
+ }
28
+ export declare class SequentialThinkingServer {
29
+ private thoughtHistory;
30
+ private blocks;
31
+ private currentBlockId;
32
+ private branches;
33
+ private disableThoughtLogging;
34
+ private storagePath;
35
+ private delayMs;
36
+ private saveMutex;
37
+ constructor(storagePath?: string, delayMs?: number);
38
+ private loadHistory;
39
+ private attemptRecovery;
40
+ private rebuildBlocks;
41
+ private rebuildBranches;
42
+ private saveHistory;
43
+ private autoPrune;
44
+ clearHistory(): Promise<void>;
45
+ archiveHistory(startIndex: number, endIndex: number, summary: string): Promise<{
46
+ newHistoryLength: number;
47
+ summaryInsertedAt: number;
48
+ }>;
49
+ searchHistory(query: string): Promise<ThoughtData[]>;
50
+ private addToMemory;
51
+ private formatThought;
52
+ processThought(input: ThoughtData): Promise<{
53
+ content: any[];
54
+ isError?: boolean;
55
+ }>;
56
+ private getInterleavedState;
57
+ private generateMermaid;
58
+ startNewBlock(blockId: string, topic: string): void;
59
+ getCurrentBlock(): ThinkingBlock | null;
60
+ getBlocksSummary(): {
61
+ id: string;
62
+ topic: string;
63
+ status: string;
64
+ thoughtCount: number;
65
+ }[];
66
+ }
67
+ export {};