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.
- package/.env.example +6 -3
- package/README.md +96 -94
- package/docs/API.md +703 -1562
- package/docs/ARCHITECTURE.md +13 -11
- package/docs/EXAMPLES.md +241 -667
- package/docs/PROVIDERS.md +104 -79
- package/package.json +1 -1
- package/src/async/asyncJobStore.js +2 -2
- package/src/async/jobRunner.js +6 -1
- package/src/async/providerStreamNormalizer.js +59 -1
- package/src/config.js +4 -3
- package/src/prompts/helpPrompt.js +43 -61
- package/src/providers/anthropic.js +0 -31
- package/src/providers/claude.js +0 -14
- package/src/providers/codex.js +15 -21
- package/src/providers/copilot.js +36 -202
- package/src/providers/deepseek.js +73 -53
- package/src/providers/gemini-cli.js +0 -3
- package/src/providers/google.js +10 -27
- package/src/providers/interface.js +0 -3
- package/src/providers/mistral.js +169 -63
- package/src/providers/openai-compatible.js +113 -28
- package/src/providers/openai.js +14 -66
- package/src/providers/openrouter-discovery.js +308 -0
- package/src/providers/openrouter.js +452 -282
- package/src/providers/xai.js +298 -280
- package/src/services/summarizationService.js +4 -14
- package/src/systemPrompts.js +19 -2
- package/src/tools/cancelJob.js +7 -1
- package/src/tools/chat.js +957 -995
- package/src/tools/checkStatus.js +1 -0
- package/src/tools/index.js +2 -6
- package/src/tools/modes/parallel.js +488 -0
- package/src/tools/modes/roundtable.js +495 -0
- package/src/tools/modes/streamShared.js +31 -0
- package/src/utils/contextProcessor.js +1 -38
- package/src/utils/conversationExporter.js +6 -26
- package/src/utils/formatStatus.js +46 -19
- package/src/utils/modelRouting.js +207 -4
- package/src/providers/openrouter-endpoints-client.js +0 -220
- package/src/tools/consensus.js +0 -1813
- 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
|
-
|
|
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-
|
|
25
|
-
openrouter: '
|
|
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
|
|
package/src/systemPrompts.js
CHANGED
|
@@ -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
|
-
*
|
|
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
|
|
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
|
+
}
|
package/src/tools/cancelJob.js
CHANGED
|
@@ -126,7 +126,13 @@ export async function cancelJobTool(args, dependencies) {
|
|
|
126
126
|
? new Date(updatedJobState.createdAt).toLocaleString()
|
|
127
127
|
: 'unknown';
|
|
128
128
|
|
|
129
|
-
|
|
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) {
|