@gotza02/mathinking 2.9.3 → 2.9.4

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 (35) hide show
  1. package/dist/index.js +9 -0
  2. package/dist/index.js.map +1 -1
  3. package/dist/test-max-intelligence.d.ts +2 -0
  4. package/dist/test-max-intelligence.d.ts.map +1 -0
  5. package/dist/test-max-intelligence.js +59 -0
  6. package/dist/test-max-intelligence.js.map +1 -0
  7. package/dist/test-resilience.d.ts +2 -0
  8. package/dist/test-resilience.d.ts.map +1 -0
  9. package/dist/test-resilience.js +49 -0
  10. package/dist/test-resilience.js.map +1 -0
  11. package/dist/tools/orchestrator.d.ts +1 -1
  12. package/dist/tools/orchestrator.d.ts.map +1 -1
  13. package/dist/tools/orchestrator.js +107 -65
  14. package/dist/tools/orchestrator.js.map +1 -1
  15. package/dist/tools/sequential-thinking.d.ts +11 -91
  16. package/dist/tools/sequential-thinking.d.ts.map +1 -1
  17. package/dist/tools/sequential-thinking.js +194 -782
  18. package/dist/tools/sequential-thinking.js.map +1 -1
  19. package/dist/types/index.d.ts +18 -3
  20. package/dist/types/index.d.ts.map +1 -1
  21. package/dist/types/index.js +0 -3
  22. package/dist/types/index.js.map +1 -1
  23. package/dist/utils/resilience.d.ts +27 -0
  24. package/dist/utils/resilience.d.ts.map +1 -0
  25. package/dist/utils/resilience.js +96 -0
  26. package/dist/utils/resilience.js.map +1 -0
  27. package/dist/utils/tool-cache.d.ts +17 -0
  28. package/dist/utils/tool-cache.d.ts.map +1 -0
  29. package/dist/utils/tool-cache.js +57 -0
  30. package/dist/utils/tool-cache.js.map +1 -0
  31. package/dist/utils/vector-memory.d.ts +39 -0
  32. package/dist/utils/vector-memory.d.ts.map +1 -0
  33. package/dist/utils/vector-memory.js +132 -0
  34. package/dist/utils/vector-memory.js.map +1 -0
  35. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  import type { SequentialThinkingInput, SequentialThinkingOutput } from '../types/index.js';
2
2
  /**
3
- * Sequential Thinking Manager (The Brain)
3
+ * Sequential Thinking Manager (The Brain v2.0)
4
+ * Upgraded with Tree of Thoughts (ToT), Semantic Memory, and Reflexion.
4
5
  */
5
6
  export declare class SequentialThinkingManager {
6
7
  private sessions;
@@ -10,108 +11,27 @@ export declare class SequentialThinkingManager {
10
11
  private lastActionTimestamp;
11
12
  private readonly MIN_DELAY_MS;
12
13
  constructor();
13
- /**
14
- * Helper to add a delay
15
- */
16
14
  private sleep;
17
- /**
18
- * Initialize storage directory and load existing sessions
19
- */
20
15
  private initStorage;
21
- /**
22
- * Save all sessions to persistent storage
23
- */
24
16
  private saveToStorage;
25
- /**
26
- * Process a thinking action
27
- */
28
17
  process(input: SequentialThinkingInput): Promise<SequentialThinkingOutput>;
29
- /**
30
- * Start a new thinking session
31
- */
18
+ private replan;
32
19
  private startSession;
33
- /**
34
- * List all available sessions
35
- */
36
- private listSessions;
37
- /**
38
- * Add a new thought to the session
39
- */
40
20
  private addThought;
41
- /**
42
- * Create a branch for exploring alternative thought paths
43
- */
21
+ private generateOptions;
22
+ private evaluateOptions;
23
+ private selectOption;
24
+ private reflect;
25
+ private executeConclusion;
26
+ private errorResponse;
27
+ private getSession;
28
+ private getLastThoughtId;
44
29
  private createBranch;
45
- /**
46
- * Revise a previous thought
47
- */
48
30
  private reviseThought;
49
- /**
50
- * Set a hypothesis that needs verification
51
- */
52
31
  private setHypothesis;
53
- /**
54
- * Verify a hypothesis with evidence
55
- */
56
32
  private verifyHypothesis;
57
- /**
58
- * Dynamically adjust the total number of thinking steps
59
- */
60
- private adjustTotalThoughts;
61
- /**
62
- * Conclude the thinking session
63
- */
64
33
  private conclude;
65
- /**
66
- * Delete a specific thought from the history
67
- */
68
- private deleteThought;
69
- /**
70
- * Get current session status
71
- */
72
- private getStatus;
73
- /**
74
- * Get complete thought history
75
- */
76
34
  private getHistory;
77
- /**
78
- * Clear all thinking sessions
79
- */
80
- private clearHistory;
81
- /**
82
- * Delete a specific thinking session
83
- */
84
- private deleteSession;
85
- /**
86
- * Perform a self-critique of the current reasoning
87
- */
88
- private selfCritique;
89
- /**
90
- * Summarize the thought history to keep context focused
91
- */
92
- private summarizeHistory;
93
- /**
94
- * Merge multiple branches or thoughts into a new consolidated thought
95
- */
96
- private mergeBranches;
97
- /**
98
- * Bridge: Execute the plan derived from the thinking session's conclusion
99
- */
100
- private executeConclusion;
101
- /**
102
- * Heuristic-based plan generator to fulfill the "Auto-Plan" requirement
103
- */
104
- private autoGeneratePlan;
105
- private getSession;
106
- private errorResponse;
107
- private getThoughtMessage;
108
- private getConfidenceBar;
109
- private getSuggestedActions;
110
- private getVerificationConfidence;
111
- private getVerificationEmoji;
112
- private getPostVerificationActions;
113
- private getStatusBasedActions;
114
- private generateSessionStats;
115
35
  }
116
36
  export declare const thinkingManager: SequentialThinkingManager;
117
37
  //# sourceMappingURL=sequential-thinking.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sequential-thinking.d.ts","sourceRoot":"","sources":["../../src/tools/sequential-thinking.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAIV,uBAAuB,EACvB,wBAAwB,EAKzB,MAAM,mBAAmB,CAAC;AAE3B;;GAEG;AACH,qBAAa,yBAAyB;IACpC,OAAO,CAAC,QAAQ,CAA2C;IAC3D,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,mBAAmB,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAO;;IAOpC;;OAEG;IACH,OAAO,CAAC,KAAK;IAIb;;OAEG;YACW,WAAW;IA8CzB;;OAEG;YACW,aAAa;IAoB3B;;OAEG;IACG,OAAO,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAsGhF;;OAEG;IACH,OAAO,CAAC,YAAY;IAmCpB;;OAEG;IACH,OAAO,CAAC,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