tachibot-mcp 2.0.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.
Files changed (214) hide show
  1. package/.env.example +260 -0
  2. package/CHANGELOG.md +54 -0
  3. package/CODE_OF_CONDUCT.md +56 -0
  4. package/CONTRIBUTING.md +54 -0
  5. package/Dockerfile +36 -0
  6. package/LICENSE +644 -0
  7. package/README.md +201 -0
  8. package/SECURITY.md +95 -0
  9. package/dist/personality/komaai-expressions.js +12 -0
  10. package/dist/profiles/balanced.json +33 -0
  11. package/dist/profiles/code_focus.json +33 -0
  12. package/dist/profiles/full.json +33 -0
  13. package/dist/profiles/minimal.json +33 -0
  14. package/dist/profiles/research_power.json +33 -0
  15. package/dist/scripts/build-profiles.js +46 -0
  16. package/dist/src/application/services/focus/FocusModeRegistry.js +46 -0
  17. package/dist/src/application/services/focus/FocusTool.service.js +109 -0
  18. package/dist/src/application/services/focus/ModeRegistry.js +46 -0
  19. package/dist/src/application/services/focus/modes/focus-deep.mode.js +27 -0
  20. package/dist/src/application/services/focus/modes/status.mode.js +50 -0
  21. package/dist/src/application/services/focus/modes/tachibot-status.mode.js +50 -0
  22. package/dist/src/collaborative-orchestrator.js +391 -0
  23. package/dist/src/config/model-constants.js +188 -0
  24. package/dist/src/config/model-defaults.js +57 -0
  25. package/dist/src/config/model-preferences.js +382 -0
  26. package/dist/src/config/timeout-config.js +130 -0
  27. package/dist/src/config.js +173 -0
  28. package/dist/src/domain/interfaces/IFocusMode.js +5 -0
  29. package/dist/src/domain/interfaces/IProvider.js +6 -0
  30. package/dist/src/domain/interfaces/ITool.js +5 -0
  31. package/dist/src/focus-deep.js +245 -0
  32. package/dist/src/infrastructure/ascii/art/robots.ascii.js +16 -0
  33. package/dist/src/mcp-client.js +90 -0
  34. package/dist/src/memory/index.js +17 -0
  35. package/dist/src/memory/memory-config.js +135 -0
  36. package/dist/src/memory/memory-interface.js +174 -0
  37. package/dist/src/memory/memory-manager.js +383 -0
  38. package/dist/src/memory/providers/devlog-provider.js +385 -0
  39. package/dist/src/memory/providers/hybrid-provider.js +399 -0
  40. package/dist/src/memory/providers/local-provider.js +388 -0
  41. package/dist/src/memory/providers/mem0-provider.js +337 -0
  42. package/dist/src/modes/architect.js +477 -0
  43. package/dist/src/modes/auditor.js +362 -0
  44. package/dist/src/modes/challenger.js +841 -0
  45. package/dist/src/modes/code-reviewer.js +382 -0
  46. package/dist/src/modes/commit-guardian.js +424 -0
  47. package/dist/src/modes/documentation-writer.js +572 -0
  48. package/dist/src/modes/scout.js +587 -0
  49. package/dist/src/modes/shared/helpers/challenger-helpers.js +454 -0
  50. package/dist/src/modes/shared/helpers/index.js +17 -0
  51. package/dist/src/modes/shared/helpers/scout-helpers.js +270 -0
  52. package/dist/src/modes/shared/helpers/verifier-helpers.js +332 -0
  53. package/dist/src/modes/test-architect.js +767 -0
  54. package/dist/src/modes/verifier.js +378 -0
  55. package/dist/src/monitoring/performance-monitor.js +435 -0
  56. package/dist/src/optimization/batch-executor.js +121 -0
  57. package/dist/src/optimization/context-pruner.js +196 -0
  58. package/dist/src/optimization/cost-monitor.js +338 -0
  59. package/dist/src/optimization/index.js +65 -0
  60. package/dist/src/optimization/model-router.js +264 -0
  61. package/dist/src/optimization/result-cache.js +114 -0
  62. package/dist/src/optimization/token-optimizer.js +257 -0
  63. package/dist/src/optimization/token-tracker.js +118 -0
  64. package/dist/src/orchestrator-instructions.js +128 -0
  65. package/dist/src/orchestrator-lite.js +139 -0
  66. package/dist/src/orchestrator.js +191 -0
  67. package/dist/src/orchestrators/collaborative/interfaces/IToolExecutionEngine.js +1 -0
  68. package/dist/src/orchestrators/collaborative/interfaces/IToolExecutionStrategy.js +5 -0
  69. package/dist/src/orchestrators/collaborative/interfaces/IVisualizationRenderer.js +1 -0
  70. package/dist/src/orchestrators/collaborative/registries/ModelProviderRegistry.js +95 -0
  71. package/dist/src/orchestrators/collaborative/registries/ToolAdapterRegistry.js +64 -0
  72. package/dist/src/orchestrators/collaborative/services/tool-execution/ToolExecutionService.js +502 -0
  73. package/dist/src/orchestrators/collaborative/services/visualization/VisualizationService.js +206 -0
  74. package/dist/src/orchestrators/collaborative/types/session-types.js +5 -0
  75. package/dist/src/profiles/balanced.js +37 -0
  76. package/dist/src/profiles/code_focus.js +37 -0
  77. package/dist/src/profiles/debug_intensive.js +59 -0
  78. package/dist/src/profiles/full.js +37 -0
  79. package/dist/src/profiles/minimal.js +37 -0
  80. package/dist/src/profiles/research_code.js +59 -0
  81. package/dist/src/profiles/research_power.js +37 -0
  82. package/dist/src/profiles/types.js +5 -0
  83. package/dist/src/profiles/workflow_builder.js +53 -0
  84. package/dist/src/prompt-engineer-lite.js +78 -0
  85. package/dist/src/prompt-engineer.js +399 -0
  86. package/dist/src/reasoning-chain.js +508 -0
  87. package/dist/src/sequential-thinking.js +291 -0
  88. package/dist/src/server-diagnostic.js +74 -0
  89. package/dist/src/server-raw.js +158 -0
  90. package/dist/src/server-simple.js +58 -0
  91. package/dist/src/server.js +514 -0
  92. package/dist/src/session/session-logger.js +617 -0
  93. package/dist/src/session/session-manager.js +571 -0
  94. package/dist/src/session/session-tools.js +400 -0
  95. package/dist/src/tools/advanced-modes.js +200 -0
  96. package/dist/src/tools/claude-integration.js +356 -0
  97. package/dist/src/tools/consolidated/ai-router.js +174 -0
  98. package/dist/src/tools/consolidated/ai-tool.js +48 -0
  99. package/dist/src/tools/consolidated/brainstorm-tool.js +87 -0
  100. package/dist/src/tools/consolidated/environment-detector.js +80 -0
  101. package/dist/src/tools/consolidated/index.js +50 -0
  102. package/dist/src/tools/consolidated/search-tool.js +110 -0
  103. package/dist/src/tools/consolidated/workflow-tool.js +238 -0
  104. package/dist/src/tools/gemini-tools.js +329 -0
  105. package/dist/src/tools/grok-enhanced.js +376 -0
  106. package/dist/src/tools/grok-tools.js +299 -0
  107. package/dist/src/tools/lmstudio-tools.js +223 -0
  108. package/dist/src/tools/openai-tools.js +498 -0
  109. package/dist/src/tools/openrouter-tools.js +317 -0
  110. package/dist/src/tools/optimized-wrapper.js +204 -0
  111. package/dist/src/tools/perplexity-tools.js +294 -0
  112. package/dist/src/tools/pingpong-tool.js +343 -0
  113. package/dist/src/tools/qwen-wrapper.js +74 -0
  114. package/dist/src/tools/tool-router.js +444 -0
  115. package/dist/src/tools/unified-ai-provider.js +260 -0
  116. package/dist/src/tools/workflow-runner.js +425 -0
  117. package/dist/src/tools/workflow-validator-tool.js +107 -0
  118. package/dist/src/types.js +23 -0
  119. package/dist/src/utils/input-validator.js +130 -0
  120. package/dist/src/utils/model-router.js +91 -0
  121. package/dist/src/utils/progress-stream.js +255 -0
  122. package/dist/src/utils/provider-router.js +88 -0
  123. package/dist/src/utils/smart-api-client.js +146 -0
  124. package/dist/src/utils/table-builder.js +218 -0
  125. package/dist/src/utils/timestamp-formatter.js +134 -0
  126. package/dist/src/utils/tool-compressor.js +257 -0
  127. package/dist/src/utils/tool-config.js +201 -0
  128. package/dist/src/validators/dependency-graph-validator.js +147 -0
  129. package/dist/src/validators/interpolation-validator.js +222 -0
  130. package/dist/src/validators/output-usage-validator.js +151 -0
  131. package/dist/src/validators/syntax-validator.js +102 -0
  132. package/dist/src/validators/tool-registry-validator.js +123 -0
  133. package/dist/src/validators/tool-types.js +97 -0
  134. package/dist/src/validators/types.js +8 -0
  135. package/dist/src/validators/workflow-validator.js +134 -0
  136. package/dist/src/visualizer-lite.js +42 -0
  137. package/dist/src/visualizer.js +179 -0
  138. package/dist/src/workflows/circuit-breaker.js +199 -0
  139. package/dist/src/workflows/custom-workflows.js +451 -0
  140. package/dist/src/workflows/engine/AutoSynthesizer.js +97 -0
  141. package/dist/src/workflows/engine/StepParameterResolver.js +74 -0
  142. package/dist/src/workflows/engine/VariableInterpolator.js +123 -0
  143. package/dist/src/workflows/engine/WorkflowDiscovery.js +125 -0
  144. package/dist/src/workflows/engine/WorkflowExecutionEngine.js +485 -0
  145. package/dist/src/workflows/engine/WorkflowExecutor.js +113 -0
  146. package/dist/src/workflows/engine/WorkflowFileManager.js +244 -0
  147. package/dist/src/workflows/engine/WorkflowHelpers.js +114 -0
  148. package/dist/src/workflows/engine/WorkflowOutputFormatter.js +83 -0
  149. package/dist/src/workflows/engine/events/WorkflowEventBus.js +132 -0
  150. package/dist/src/workflows/engine/events/interfaces/IEventBus.js +5 -0
  151. package/dist/src/workflows/engine/handlers/ErrorRecoveryHandler.js +162 -0
  152. package/dist/src/workflows/engine/handlers/PromptEnhancementHandler.js +115 -0
  153. package/dist/src/workflows/engine/handlers/SessionPersistenceHandler.js +167 -0
  154. package/dist/src/workflows/engine/handlers/StepExecutionHandler.js +231 -0
  155. package/dist/src/workflows/engine/handlers/ToolInvocationHandler.js +46 -0
  156. package/dist/src/workflows/engine/interfaces/IAutoSynthesizer.js +5 -0
  157. package/dist/src/workflows/engine/interfaces/IStepParameterResolver.js +5 -0
  158. package/dist/src/workflows/engine/interfaces/IVariableInterpolator.js +5 -0
  159. package/dist/src/workflows/engine/interfaces/IWorkflowDiscovery.js +4 -0
  160. package/dist/src/workflows/engine/interfaces/IWorkflowFileManager.js +5 -0
  161. package/dist/src/workflows/engine/interfaces/IWorkflowOutputFormatter.js +5 -0
  162. package/dist/src/workflows/engine/state/WorkflowStateMachine.js +194 -0
  163. package/dist/src/workflows/engine/state/interfaces/IStateMachine.js +17 -0
  164. package/dist/src/workflows/fallback-strategies.js +373 -0
  165. package/dist/src/workflows/message-queue.js +455 -0
  166. package/dist/src/workflows/model-router.js +189 -0
  167. package/dist/src/workflows/orchestrator-examples.js +174 -0
  168. package/dist/src/workflows/orchestrator-integration.js +200 -0
  169. package/dist/src/workflows/self-healing.js +524 -0
  170. package/dist/src/workflows/tool-mapper.js +407 -0
  171. package/dist/src/workflows/tool-orchestrator.js +796 -0
  172. package/dist/src/workflows/workflow-engine.js +573 -0
  173. package/dist/src/workflows/workflow-parser.js +283 -0
  174. package/dist/src/workflows/workflow-types.js +95 -0
  175. package/dist/src/workflows.js +568 -0
  176. package/dist/test-workflow-file-output.js +93 -0
  177. package/docs/API_KEYS.md +570 -0
  178. package/docs/CLAUDE_CODE_SETUP.md +181 -0
  179. package/docs/CLAUDE_DESKTOP_MANUAL.md +127 -0
  180. package/docs/CONFIGURATION.md +745 -0
  181. package/docs/FOCUS_MODES.md +240 -0
  182. package/docs/INSTALLATION_BOTH.md +145 -0
  183. package/docs/TERMS.md +352 -0
  184. package/docs/TOOLS_REFERENCE.md +1622 -0
  185. package/docs/TOOL_PARAMETERS.md +496 -0
  186. package/docs/TOOL_PROFILES.md +236 -0
  187. package/docs/WORKFLOWS.md +987 -0
  188. package/docs/WORKFLOW_OUTPUT.md +198 -0
  189. package/docs/WORKFLOW_PROGRESS_TRACKING.md +305 -0
  190. package/docs/workflows/design-brainstorm.md +335 -0
  191. package/package.json +97 -0
  192. package/profiles/balanced.json +37 -0
  193. package/profiles/code_focus.json +37 -0
  194. package/profiles/debug_intensive.json +34 -0
  195. package/profiles/full.json +37 -0
  196. package/profiles/minimal.json +37 -0
  197. package/profiles/research_power.json +37 -0
  198. package/profiles/workflow_builder.json +37 -0
  199. package/smithery.yaml +66 -0
  200. package/start.sh +8 -0
  201. package/tools.config.json +81 -0
  202. package/tsconfig.json +18 -0
  203. package/workflows/accessibility-code-audit.yaml +92 -0
  204. package/workflows/code-architecture-review.yaml +202 -0
  205. package/workflows/code-review.yaml +142 -0
  206. package/workflows/core/iterative-problem-solver.yaml +283 -0
  207. package/workflows/creative-brainstorm-yaml.yaml +215 -0
  208. package/workflows/pingpong.yaml +141 -0
  209. package/workflows/system/README.md +412 -0
  210. package/workflows/system/challenger.yaml +175 -0
  211. package/workflows/system/scout.yaml +164 -0
  212. package/workflows/system/verifier.yaml +133 -0
  213. package/workflows/ultra-creative-brainstorm.yaml +318 -0
  214. package/workflows/ux-research-flow.yaml +92 -0
@@ -0,0 +1,496 @@
1
+ # Tool Parameters Documentation
2
+
3
+ This document provides comprehensive information about all available parameters for the refactored tools: **Challenger**, **Verifier**, and **Scout**.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Challenger](#challenger)
8
+ - [Verifier](#verifier)
9
+ - [Scout](#scout)
10
+ - [API Requirements](#api-requirements)
11
+
12
+ ---
13
+
14
+ ## Challenger
15
+
16
+ The Challenger tool provides critical thinking and echo chamber prevention by generating counter-arguments and alternative perspectives.
17
+
18
+ ### Parameters
19
+
20
+ | Parameter | Type | Required | Default | Description |
21
+ |-----------|------|----------|---------|-------------|
22
+ | `context` | `string \| object \| array` | ✅ Yes | - | The claims, statements, or context to challenge. Can be a string, object with `query`/`text`/`content`, or array of contexts |
23
+ | `model` | `string` | No | `'gpt-5-mini'` | AI model to use for generating challenges. Supports: `gpt-5-mini`, `gpt-5`, `gemini-2.5-flash`, `gemini-2.5-pro`, `grok-4`, `sonar-pro` |
24
+ | `maxTokens` | `number` | No | `2000` | Maximum tokens per API call |
25
+ | `temperature` | `number` | No | `0.9` | Temperature for response generation (0-1). Higher = more creative challenges |
26
+
27
+ ### Example Usage
28
+
29
+ ```typescript
30
+ import { Challenger } from './modes/challenger.js';
31
+
32
+ const challenger = new Challenger();
33
+
34
+ // Basic usage
35
+ const result1 = await challenger.challenge(
36
+ 'AI will solve all of humanity\'s problems.'
37
+ );
38
+
39
+ // With custom parameters
40
+ const result2 = await challenger.challenge(
41
+ 'Social media has only positive effects.',
42
+ {
43
+ model: 'gemini-2.5-flash',
44
+ temperature: 0.7,
45
+ maxTokens: 1500
46
+ }
47
+ );
48
+
49
+ // With object context
50
+ const result3 = await challenger.challenge({
51
+ query: 'Climate change is not real',
52
+ text: 'Scientists are all wrong about global warming'
53
+ });
54
+
55
+ // With array context (detects groupthink)
56
+ const result4 = await challenger.challenge([
57
+ 'Everyone agrees this is the best solution',
58
+ 'There is unanimous consensus on this',
59
+ 'All experts say the same thing'
60
+ ]);
61
+ ```
62
+
63
+ ### Return Structure
64
+
65
+ ```typescript
66
+ interface ChallengeResult {
67
+ claims: Claim[]; // Extracted claims with metadata
68
+ challenges: Challenge[]; // Generated challenges for each claim
69
+ groupthinkDetected: boolean; // Whether echo chamber behavior detected
70
+ alternativePerspectives: string[]; // Alternative viewpoints
71
+ synthesis: string; // Comprehensive analysis markdown
72
+ }
73
+
74
+ interface Claim {
75
+ id: string;
76
+ text: string;
77
+ confidence: number; // 0-1
78
+ type: 'fact' | 'opinion' | 'assumption' | 'conclusion';
79
+ }
80
+
81
+ interface Challenge {
82
+ claimId: string;
83
+ challenge: string;
84
+ evidence?: string;
85
+ severity: 'low' | 'medium' | 'high';
86
+ alternativeView?: string;
87
+ }
88
+ ```
89
+
90
+ ### Supported Models
91
+
92
+ - **OpenAI**: `gpt-5`, `gpt-5-mini`, `qwq-32b`, `qwen3-30b`, `qwen3-coder-480b`
93
+ - **Google**: `gemini-2.5-flash`, `gemini-2.5-pro`
94
+ - **xAI**: `grok-4`, `grok-4-0709`
95
+ - **Perplexity**: `sonar-pro`, `perplexity-sonar-pro`
96
+
97
+ ### Notes
98
+
99
+ - Higher `temperature` values produce more diverse and creative challenges
100
+ - The tool automatically detects claim types (fact, opinion, assumption, conclusion)
101
+ - Groupthink detection works best with array contexts containing multiple similar statements
102
+ - Default model (`gpt-5-mini`) balances cost and quality
103
+
104
+ ---
105
+
106
+ ## Verifier
107
+
108
+ The Verifier tool provides multi-model parallel verification with consensus analysis, querying multiple AI models simultaneously to reach a consensus.
109
+
110
+ ### Parameters
111
+
112
+ | Parameter | Type | Required | Default | Description |
113
+ |-----------|------|----------|---------|-------------|
114
+ | `query` | `string` | ✅ Yes | - | The statement or question to verify |
115
+ | `variant` | `string` | No | `'quick_verify'` | Verification strategy. Options: `quick_verify`, `deep_verify`, `fact_check`, `code_verify`, `security_verify` |
116
+ | `model` | `string \| string[]` | No | Variant-specific | Custom model(s) to use instead of variant defaults. Can be single model or array |
117
+ | `maxTokens` | `number` | No | Variant-specific | Maximum tokens per model call |
118
+ | `timeout` | `number` | No | Variant-specific | Timeout in milliseconds for each model query |
119
+ | `includeSources` | `boolean` | No | `false` | Whether to include source citations (recommended for `fact_check`) |
120
+
121
+ ### Variants
122
+
123
+ Each variant uses different models and settings optimized for specific use cases:
124
+
125
+ #### `quick_verify` (Default)
126
+ - **Models**: `gpt5_mini`, `gemini-2.5-flash`, `qwen3-30b`
127
+ - **Tokens**: 2000
128
+ - **Timeout**: 10000ms
129
+ - **Use case**: Fast verification of simple statements
130
+
131
+ #### `deep_verify`
132
+ - **Models**: `gpt5`, `qwq-32b`, `gpt5_reason`, `gemini-2.5-pro`, `qwen3-coder-480b`
133
+ - **Tokens**: 6000
134
+ - **Timeout**: 30000ms
135
+ - **Use case**: Complex reasoning and analysis
136
+
137
+ #### `fact_check`
138
+ - **Models**: `perplexity-sonar-pro`, `gpt5`, `gemini-2.5-pro`
139
+ - **Tokens**: 3000
140
+ - **Timeout**: 15000ms
141
+ - **Include Sources**: Yes (default)
142
+ - **Use case**: Factual verification with citations
143
+
144
+ #### `code_verify`
145
+ - **Models**: `qwen3-coder-480b`, `gpt5`, `gemini-2.5-pro`
146
+ - **Tokens**: 4000
147
+ - **Timeout**: 20000ms
148
+ - **Use case**: Code correctness verification
149
+
150
+ #### `security_verify`
151
+ - **Models**: `gpt5`, `qwen3-coder-480b`, `grok-4`
152
+ - **Tokens**: 4000
153
+ - **Timeout**: 20000ms
154
+ - **Use case**: Security vulnerability detection
155
+
156
+ ### Example Usage
157
+
158
+ ```typescript
159
+ import { Verifier } from './modes/verifier.js';
160
+
161
+ const verifier = new Verifier();
162
+
163
+ // Basic usage (quick_verify)
164
+ const result1 = await verifier.verify(
165
+ 'Is Python a statically typed language?'
166
+ );
167
+
168
+ // Use specific variant
169
+ const result2 = await verifier.verify(
170
+ 'What is the speed of light?',
171
+ { variant: 'fact_check', includeSources: true }
172
+ );
173
+
174
+ // Custom models
175
+ const result3 = await verifier.verify(
176
+ 'Is this code safe?',
177
+ {
178
+ model: ['gpt-5', 'gemini-2.5-pro'],
179
+ maxTokens: 3000
180
+ }
181
+ );
182
+
183
+ // Code verification
184
+ const result4 = await verifier.verify(
185
+ 'function add(a, b) { return a + b; }',
186
+ { variant: 'code_verify' }
187
+ );
188
+
189
+ // Security check
190
+ const result5 = await verifier.verify(
191
+ 'SELECT * FROM users WHERE id = ${userId}',
192
+ { variant: 'security_verify' }
193
+ );
194
+ ```
195
+
196
+ ### Return Structure
197
+
198
+ ```typescript
199
+ interface VerifierResult {
200
+ consensus: number; // 0-1, agreement level among models
201
+ majority: any; // The majority conclusion
202
+ outliers: ModelResponse[]; // Models that disagreed
203
+ responses: ModelResponse[]; // All model responses
204
+ synthesis: string; // Comprehensive analysis
205
+ confidence: number; // 0-1, overall confidence score
206
+ shouldTerminate?: boolean; // True if consensus >= 0.8
207
+ }
208
+
209
+ interface ModelResponse {
210
+ model: string;
211
+ response: any;
212
+ conclusion?: string; // Extracted conclusion (true/false/uncertain/needs-context)
213
+ evidence?: string[]; // Supporting evidence
214
+ confidence?: number; // Model's confidence (0-1)
215
+ tokens?: number; // Tokens used
216
+ }
217
+ ```
218
+
219
+ ### Notes
220
+
221
+ - Models are queried in parallel for speed
222
+ - Timeouts prevent slow models from blocking results
223
+ - At least one model must succeed for valid result
224
+ - Consensus >= 80% sets `shouldTerminate = true`
225
+ - Use `includeSources: true` with `fact_check` for citations
226
+
227
+ ---
228
+
229
+ ## Scout
230
+
231
+ The Scout tool provides conditional hybrid intelligence gathering, using Perplexity for facts and optionally Grok-4 with live search.
232
+
233
+ ### Parameters
234
+
235
+ | Parameter | Type | Required | Default | Description |
236
+ |-----------|------|----------|---------|-------------|
237
+ | `query` | `string` | ✅ Yes | - | The topic or question to research |
238
+ | `variant` | `string` | No | `'research_scout'` | Research strategy. Options: `research_scout`, `code_scout`, `fact_scout`, `quick_scout` |
239
+ | `searchProvider` | `string` | No | `'perplexity'` | Search provider: `perplexity`, `grok`, or `both` |
240
+ | `maxTokens` | `number` | No | Variant-specific | Maximum tokens per API call |
241
+ | `timeout` | `number` | No | Variant-specific | Timeout in milliseconds |
242
+ | `enableGrokLiveSearch` | `boolean` | No | `true` (if using grok) | Enable Grok-4 live web search (costs extra) |
243
+ | `maxSearchSources` | `number` | No | Variant-specific | Maximum search sources for Grok (costs per 1k sources) |
244
+ | `searchDomains` | `string[]` | No | - | Restrict search to specific domains |
245
+
246
+ ### Variants
247
+
248
+ #### `research_scout` (Default)
249
+ - **Flow**: `perplexity-first-always`
250
+ - **Perplexity Timeout**: 500ms
251
+ - **Parallel Models**: `gemini-2.5-flash`, `gpt-5-mini`
252
+ - **Tokens**: 2500
253
+ - **Max Sources**: 100
254
+ - **Use case**: Comprehensive research with current facts
255
+
256
+ #### `code_scout`
257
+ - **Flow**: `conditional-hybrid`
258
+ - **Perplexity For**: Latest API docs only
259
+ - **Primary**: `gemini-2.5-flash`
260
+ - **Tokens**: 2000
261
+ - **Max Sources**: 100
262
+ - **Use case**: Technical documentation and code information
263
+
264
+ #### `fact_scout`
265
+ - **Flow**: `waterfall`
266
+ - **Perplexity Timeout**: 1000ms
267
+ - **Tokens**: 1500
268
+ - **Max Sources**: 150
269
+ - **Use case**: Fact verification with high reliability
270
+
271
+ #### `quick_scout`
272
+ - **Flow**: `conditional-hybrid`
273
+ - **Perplexity Timeout**: 250ms
274
+ - **Parallel Models**: `gemini-2.5-flash`
275
+ - **Tokens**: 1000
276
+ - **Max Sources**: 50
277
+ - **Use case**: Fast information gathering
278
+
279
+ ### Example Usage
280
+
281
+ ```typescript
282
+ import { Scout } from './modes/scout.js';
283
+
284
+ const scout = new Scout();
285
+
286
+ // Basic usage (research_scout)
287
+ const result1 = await scout.scout(
288
+ 'Latest developments in quantum computing 2025'
289
+ );
290
+
291
+ // Use specific variant
292
+ const result2 = await scout.scout(
293
+ 'TypeScript 5.0 new features',
294
+ { variant: 'code_scout' }
295
+ );
296
+
297
+ // Use Grok live search
298
+ const result3 = await scout.scout(
299
+ 'Current space exploration missions',
300
+ {
301
+ searchProvider: 'grok',
302
+ enableGrokLiveSearch: true,
303
+ maxSearchSources: 50
304
+ }
305
+ );
306
+
307
+ // Use both providers
308
+ const result4 = await scout.scout(
309
+ 'Comprehensive renewable energy research',
310
+ {
311
+ searchProvider: 'both',
312
+ maxSearchSources: 100
313
+ }
314
+ );
315
+
316
+ // Domain filtering
317
+ const result5 = await scout.scout(
318
+ 'Python documentation',
319
+ {
320
+ searchDomains: ['python.org', 'docs.python.org']
321
+ }
322
+ );
323
+
324
+ // Quick lookup
325
+ const result6 = await scout.scout(
326
+ 'Node.js version 20 features',
327
+ {
328
+ variant: 'quick_scout',
329
+ maxTokens: 500
330
+ }
331
+ );
332
+ ```
333
+
334
+ ### Return Structure
335
+
336
+ ```typescript
337
+ interface ScoutResult {
338
+ probe?: ProbeResult; // Initial probe results
339
+ facts?: FactResult; // Gathered facts
340
+ analyses?: AnalysisResult[]; // Multi-model analyses
341
+ synthesis: string; // Comprehensive synthesis
342
+ warning?: string; // Warnings (e.g., outdated info)
343
+ executionTime: number; // Time in milliseconds
344
+ tokensUsed: number; // Total tokens consumed
345
+ }
346
+
347
+ interface FactResult {
348
+ facts: string[];
349
+ sources?: string[];
350
+ timestamp: string;
351
+ reliability: number; // 0-1
352
+ }
353
+
354
+ interface AnalysisResult {
355
+ model: string;
356
+ analysis: string;
357
+ insights: string[];
358
+ }
359
+ ```
360
+
361
+ ### Cost Control
362
+
363
+ Scout includes built-in cost controls:
364
+
365
+ - **Source Limits**: Controls how many sources Grok searches (costs per 1k)
366
+ - `quick_scout`: 50 sources
367
+ - `research_scout`: 100 sources (configurable via `GROK_SEARCH_SOURCES_LIMIT` env)
368
+ - `fact_scout`: 150 sources
369
+
370
+ - **Search Provider**: Default is Perplexity (cheaper), Grok is optional
371
+ - **Timeouts**: Prevent long-running expensive calls
372
+ - **Token Limits**: Per-variant limits prevent runaway costs
373
+
374
+ ### Notes
375
+
376
+ - Requires `PERPLEXITY_API_KEY` for Perplexity search
377
+ - Requires `GROK_API_KEY` or `XAI_API_KEY` for Grok search
378
+ - `searchProvider: 'both'` combines results from both providers
379
+ - Domain filtering restricts searches to specified websites
380
+ - Grok live search costs are based on sources searched (per 1000)
381
+
382
+ ---
383
+
384
+ ## API Requirements
385
+
386
+ ### Required API Keys
387
+
388
+ Configure these in your `.env` file:
389
+
390
+ ```bash
391
+ # Required for most tools
392
+ OPENAI_API_KEY=sk-...
393
+
394
+ # Optional but recommended
395
+ GOOGLE_API_KEY=... # For Gemini models
396
+ PERPLEXITY_API_KEY=... # For Perplexity search
397
+ GROK_API_KEY=... # For Grok models and live search
398
+ # or
399
+ XAI_API_KEY=... # Alternative to GROK_API_KEY
400
+
401
+ # Optional configuration
402
+ DEFAULT_SEARCH_PROVIDER=perplexity # perplexity|grok|both
403
+ GROK_SEARCH_SOURCES_LIMIT=100 # Max sources for Grok
404
+ ```
405
+
406
+ ### Model Routing
407
+
408
+ Tools automatically route to the appropriate API based on model name:
409
+
410
+ - **`gpt*`, `qwen*`, `qwq*`** → OpenAI API
411
+ - **`gemini*`** → Google API
412
+ - **`grok*`** → xAI API
413
+ - **`perplexity*`, `sonar*`** → Perplexity API
414
+
415
+ ### Error Handling
416
+
417
+ All tools handle API failures gracefully:
418
+
419
+ - Timeouts return partial results
420
+ - Failed models are excluded from consensus
421
+ - Fallback mechanisms ensure results even with partial failures
422
+
423
+ ---
424
+
425
+ ## Testing
426
+
427
+ Comprehensive tests are available in `src/modes/__tests__/`:
428
+
429
+ ```bash
430
+ # Run all tests
431
+ npm test
432
+
433
+ # Run specific tool tests
434
+ npm test challenger
435
+ npm test verifier
436
+ npm test scout
437
+
438
+ # Run with coverage
439
+ npm test -- --coverage
440
+ ```
441
+
442
+ See test files for more usage examples:
443
+ - `src/modes/__tests__/challenger.test.ts`
444
+ - `src/modes/__tests__/verifier.test.ts`
445
+ - `src/modes/__tests__/scout.test.ts`
446
+
447
+ ---
448
+
449
+ ## Performance Tips
450
+
451
+ 1. **Use appropriate variants**: Don't use `deep_verify` when `quick_verify` suffices
452
+ 2. **Set token limits**: Lower `maxTokens` for simple queries
453
+ 3. **Control timeouts**: Shorter timeouts for time-sensitive operations
454
+ 4. **Choose models wisely**: `gpt-5-mini` and `gemini-2.5-flash` are fast and cheap
455
+ 5. **Limit Grok sources**: Keep `maxSearchSources` low unless needed
456
+ 6. **Use `quick_scout`**: For simple lookups instead of full research
457
+
458
+ ---
459
+
460
+ ## Migration Guide
461
+
462
+ If migrating from old tool structure:
463
+
464
+ ### Challenger (formerly separate tools)
465
+ ```typescript
466
+ // Old
467
+ await thinkTool.challenge(context);
468
+
469
+ // New
470
+ await challenger.challenge(context, { model: 'gpt-5-mini' });
471
+ ```
472
+
473
+ ### Verifier (formerly consensus tools)
474
+ ```typescript
475
+ // Old
476
+ await multiModelTool.verify(query);
477
+
478
+ // New
479
+ await verifier.verify(query, { variant: 'quick_verify' });
480
+ ```
481
+
482
+ ### Scout (formerly search + research tools)
483
+ ```typescript
484
+ // Old
485
+ await researchTool.search(query);
486
+
487
+ // New
488
+ await scout.scout(query, { variant: 'research_scout' });
489
+ ```
490
+
491
+ ---
492
+
493
+ ## Support
494
+
495
+ For issues or questions:
496
+ - GitHub: https://github.com/byPawel/tachibot-mcp