converse-mcp-server 2.29.2 → 3.0.1

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 (42) hide show
  1. package/.env.example +6 -3
  2. package/README.md +96 -94
  3. package/docs/API.md +703 -1562
  4. package/docs/ARCHITECTURE.md +13 -11
  5. package/docs/EXAMPLES.md +241 -667
  6. package/docs/PROVIDERS.md +104 -79
  7. package/package.json +1 -1
  8. package/src/async/asyncJobStore.js +2 -2
  9. package/src/async/jobRunner.js +6 -1
  10. package/src/async/providerStreamNormalizer.js +59 -1
  11. package/src/config.js +4 -3
  12. package/src/prompts/helpPrompt.js +43 -61
  13. package/src/providers/anthropic.js +0 -31
  14. package/src/providers/claude.js +0 -14
  15. package/src/providers/codex.js +15 -21
  16. package/src/providers/copilot.js +36 -202
  17. package/src/providers/deepseek.js +73 -53
  18. package/src/providers/gemini-cli.js +0 -3
  19. package/src/providers/google.js +10 -27
  20. package/src/providers/interface.js +0 -3
  21. package/src/providers/mistral.js +169 -63
  22. package/src/providers/openai-compatible.js +113 -28
  23. package/src/providers/openai.js +14 -66
  24. package/src/providers/openrouter-discovery.js +308 -0
  25. package/src/providers/openrouter.js +452 -282
  26. package/src/providers/xai.js +298 -280
  27. package/src/services/summarizationService.js +4 -14
  28. package/src/systemPrompts.js +19 -2
  29. package/src/tools/cancelJob.js +7 -1
  30. package/src/tools/chat.js +957 -995
  31. package/src/tools/checkStatus.js +1 -0
  32. package/src/tools/index.js +2 -6
  33. package/src/tools/modes/parallel.js +488 -0
  34. package/src/tools/modes/roundtable.js +495 -0
  35. package/src/tools/modes/streamShared.js +31 -0
  36. package/src/utils/contextProcessor.js +1 -38
  37. package/src/utils/conversationExporter.js +6 -26
  38. package/src/utils/formatStatus.js +46 -19
  39. package/src/utils/modelRouting.js +207 -4
  40. package/src/providers/openrouter-endpoints-client.js +0 -220
  41. package/src/tools/consensus.js +0 -1813
  42. package/src/tools/conversation.js +0 -1233
@@ -9,8 +9,7 @@
9
9
  import { createLogger } from '../utils/logger.js';
10
10
  import { debugLog, debugError } from '../utils/console.js';
11
11
 
12
- // Import mapModelToProvider from chat tool
13
- import { mapModelToProvider } from '../tools/chat.js';
12
+ import { mapModelToProvider } from '../utils/modelRouting.js';
14
13
 
15
14
  const logger = createLogger('summarization');
16
15
 
@@ -18,16 +17,13 @@ const logger = createLogger('summarization');
18
17
  const FAST_MODELS = {
19
18
  openai: 'gpt-5-nano', // Fastest GPT-5 model with minimal reasoning
20
19
  google: 'flash',
21
- xai: 'grok-4',
20
+ xai: 'grok-4.5',
22
21
  anthropic: 'claude-3-5-haiku-latest',
23
22
  mistral: 'mistral-small-latest',
24
- deepseek: 'deepseek-chat',
25
- openrouter: 'qwen/qwen-2.5-32b-instruct',
23
+ deepseek: 'deepseek-v4-flash',
24
+ openrouter: 'z-ai/glm-5.2',
26
25
  };
27
26
 
28
- // Temperature for consistent summarization
29
- const SUMMARIZATION_TEMPERATURE = 0.3;
30
-
31
27
  export class SummarizationService {
32
28
  constructor(providers, config) {
33
29
  this.providers = providers;
@@ -82,10 +78,8 @@ export class SummarizationService {
82
78
  // Invoke provider with minimal reasoning for speed
83
79
  const response = await provider.invoke(messages, {
84
80
  model: selectedModel,
85
- temperature: SUMMARIZATION_TEMPERATURE,
86
81
  maxTokens: 200, // Increased to prevent incomplete responses
87
82
  reasoning_effort: 'minimal', // Use minimal reasoning for fast summaries
88
- verbosity: 'low', // Keep outputs concise
89
83
  config: this.config,
90
84
  });
91
85
 
@@ -145,10 +139,8 @@ export class SummarizationService {
145
139
  // Invoke provider with minimal reasoning for speed
146
140
  const response = await provider.invoke(messages, {
147
141
  model: selectedModel,
148
- temperature: SUMMARIZATION_TEMPERATURE,
149
142
  maxTokens: 300, // Increased to prevent incomplete responses
150
143
  reasoning_effort: 'minimal', // Use minimal reasoning for fast summaries
151
- verbosity: 'low', // Keep outputs concise
152
144
  config: this.config,
153
145
  });
154
146
 
@@ -210,10 +202,8 @@ export class SummarizationService {
210
202
  // Invoke provider with minimal reasoning for speed
211
203
  const response = await provider.invoke(messages, {
212
204
  model: selectedModel,
213
- temperature: SUMMARIZATION_TEMPERATURE,
214
205
  maxTokens: 250, // Increased to prevent incomplete responses
215
206
  reasoning_effort: 'minimal', // Use minimal reasoning for fast summaries
216
- verbosity: 'low', // Keep outputs concise
217
207
  config: this.config,
218
208
  });
219
209
 
@@ -90,13 +90,13 @@ Remember: The best solution often has one breakthrough insight that makes the co
90
90
  `.trim();
91
91
 
92
92
  /**
93
- * Conversation tool system prompt - sequential round-table dialogue.
93
+ * Roundtable mode system prompt - sequential round-table dialogue.
94
94
  *
95
95
  * Unlike CONSENSUS_PROMPT (parallel, rigidly-structured answers), this frames a
96
96
  * turn-based round-table where each participant speaks after seeing the full
97
97
  * running transcript and is expected to build the discussion forward as dialogue.
98
98
  */
99
- export const CONVERSATION_PROMPT = `
99
+ export const ROUNDTABLE_PROMPT = `
100
100
  You are taking part in a multi-model round-table conversation. Several AI models speak one after another, each seeing the full running transcript of everything said before it. When it is your turn, you respond to the whole conversation so far and your response is passed on to the next participant.
101
101
 
102
102
  Your goal: advance the discussion. Build on, challenge, or refine what earlier participants have said — don't merely repeat them. Add genuine value with each turn, whether that's a new insight, a correction, a synthesis, or a sharper framing. Treat this as a collaborative dialogue, not a set of isolated answers.
@@ -121,3 +121,20 @@ RESPONSE STYLE
121
121
  - Be direct and technical; surface trade-offs and challenge weak assumptions constructively.
122
122
  - Keep momentum: leave the conversation in a better place than you found it for the next participant.
123
123
  `.trim();
124
+
125
+ /**
126
+ * Select the system prompt for a chat-tool mode.
127
+ * @param {string} mode - One of 'chat' | 'consensus' | 'roundtable'
128
+ * @returns {string} The system prompt for that mode (defaults to CHAT_PROMPT)
129
+ */
130
+ export function getSystemPromptForMode(mode) {
131
+ switch (mode) {
132
+ case 'consensus':
133
+ return CONSENSUS_PROMPT;
134
+ case 'roundtable':
135
+ return ROUNDTABLE_PROMPT;
136
+ case 'chat':
137
+ default:
138
+ return CHAT_PROMPT;
139
+ }
140
+ }
@@ -126,7 +126,13 @@ export async function cancelJobTool(args, dependencies) {
126
126
  ? new Date(updatedJobState.createdAt).toLocaleString()
127
127
  : 'unknown';
128
128
 
129
- let statusLine = `${statusEmoji} CANCELLED | ${updatedJobState?.tool?.toUpperCase() || jobState.tool?.toUpperCase() || 'UNKNOWN'} | ${continuation_id} | Started: ${startTime} | ${timeStr} elapsed`;
129
+ const modeLabel =
130
+ updatedJobState?.mode ||
131
+ updatedJobState?.tool ||
132
+ jobState.mode ||
133
+ jobState.tool ||
134
+ 'UNKNOWN';
135
+ let statusLine = `${statusEmoji} CANCELLED | ${modeLabel.toUpperCase()} | ${continuation_id} | Started: ${startTime} | ${timeStr} elapsed`;
130
136
 
131
137
  // Add title if available
132
138
  if (updatedJobState?.title) {