mcp-agent-foundry 1.0.0
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/LICENSE +21 -0
- package/README.md +477 -0
- package/dist/cli/install-skills.d.ts +11 -0
- package/dist/cli/install-skills.d.ts.map +1 -0
- package/dist/cli/install-skills.js +143 -0
- package/dist/cli/install-skills.js.map +1 -0
- package/dist/cli/recovery-commands.d.ts +41 -0
- package/dist/cli/recovery-commands.d.ts.map +1 -0
- package/dist/cli/recovery-commands.js +241 -0
- package/dist/cli/recovery-commands.js.map +1 -0
- package/dist/cli/setup-wizard.d.ts +25 -0
- package/dist/cli/setup-wizard.d.ts.map +1 -0
- package/dist/cli/setup-wizard.js +1417 -0
- package/dist/cli/setup-wizard.js.map +1 -0
- package/dist/cli/test-connection.d.ts +45 -0
- package/dist/cli/test-connection.d.ts.map +1 -0
- package/dist/cli/test-connection.js +317 -0
- package/dist/cli/test-connection.js.map +1 -0
- package/dist/cli.d.ts +75 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +704 -0
- package/dist/cli.js.map +1 -0
- package/dist/config/defaults.d.ts +57 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +99 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/index.d.ts +14 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +22 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/manager.d.ts +184 -0
- package/dist/config/manager.d.ts.map +1 -0
- package/dist/config/manager.js +347 -0
- package/dist/config/manager.js.map +1 -0
- package/dist/config/merger.d.ts +76 -0
- package/dist/config/merger.d.ts.map +1 -0
- package/dist/config/merger.js +189 -0
- package/dist/config/merger.js.map +1 -0
- package/dist/config/schema.d.ts +20 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +20 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config/validator.d.ts +254 -0
- package/dist/config/validator.d.ts.map +1 -0
- package/dist/config/validator.js +363 -0
- package/dist/config/validator.js.map +1 -0
- package/dist/config/worktree-defaults.d.ts +23 -0
- package/dist/config/worktree-defaults.d.ts.map +1 -0
- package/dist/config/worktree-defaults.js +78 -0
- package/dist/config/worktree-defaults.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/tools/compare-agents.d.ts +25 -0
- package/dist/mcp/tools/compare-agents.d.ts.map +1 -0
- package/dist/mcp/tools/compare-agents.js +177 -0
- package/dist/mcp/tools/compare-agents.js.map +1 -0
- package/dist/mcp/tools/critique-plan.d.ts +26 -0
- package/dist/mcp/tools/critique-plan.d.ts.map +1 -0
- package/dist/mcp/tools/critique-plan.js +162 -0
- package/dist/mcp/tools/critique-plan.js.map +1 -0
- package/dist/mcp/tools/design-feedback.d.ts +26 -0
- package/dist/mcp/tools/design-feedback.d.ts.map +1 -0
- package/dist/mcp/tools/design-feedback.js +216 -0
- package/dist/mcp/tools/design-feedback.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +50 -0
- package/dist/mcp/tools/index.d.ts.map +1 -0
- package/dist/mcp/tools/index.js +191 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/invoke-agent.d.ts +25 -0
- package/dist/mcp/tools/invoke-agent.d.ts.map +1 -0
- package/dist/mcp/tools/invoke-agent.js +141 -0
- package/dist/mcp/tools/invoke-agent.js.map +1 -0
- package/dist/mcp/tools/review-code.d.ts +25 -0
- package/dist/mcp/tools/review-code.d.ts.map +1 -0
- package/dist/mcp/tools/review-code.js +170 -0
- package/dist/mcp/tools/review-code.js.map +1 -0
- package/dist/mcp/tools/tasks/claim-next-task.d.ts +22 -0
- package/dist/mcp/tools/tasks/claim-next-task.d.ts.map +1 -0
- package/dist/mcp/tools/tasks/claim-next-task.js +203 -0
- package/dist/mcp/tools/tasks/claim-next-task.js.map +1 -0
- package/dist/mcp/tools/tasks/create-routed-task.d.ts +17 -0
- package/dist/mcp/tools/tasks/create-routed-task.d.ts.map +1 -0
- package/dist/mcp/tools/tasks/create-routed-task.js +178 -0
- package/dist/mcp/tools/tasks/create-routed-task.js.map +1 -0
- package/dist/mcp/tools/tasks/execute-pipeline.d.ts +22 -0
- package/dist/mcp/tools/tasks/execute-pipeline.d.ts.map +1 -0
- package/dist/mcp/tools/tasks/execute-pipeline.js +401 -0
- package/dist/mcp/tools/tasks/execute-pipeline.js.map +1 -0
- package/dist/mcp/tools/tasks/execute-task.d.ts +32 -0
- package/dist/mcp/tools/tasks/execute-task.d.ts.map +1 -0
- package/dist/mcp/tools/tasks/execute-task.js +284 -0
- package/dist/mcp/tools/tasks/execute-task.js.map +1 -0
- package/dist/mcp/tools/tasks/get-pipeline-status.d.ts +26 -0
- package/dist/mcp/tools/tasks/get-pipeline-status.d.ts.map +1 -0
- package/dist/mcp/tools/tasks/get-pipeline-status.js +460 -0
- package/dist/mcp/tools/tasks/get-pipeline-status.js.map +1 -0
- package/dist/mcp/tools/tasks/index.d.ts +36 -0
- package/dist/mcp/tools/tasks/index.d.ts.map +1 -0
- package/dist/mcp/tools/tasks/index.js +66 -0
- package/dist/mcp/tools/tasks/index.js.map +1 -0
- package/dist/mcp/tools/worktree/cleanup-worktrees.d.ts +17 -0
- package/dist/mcp/tools/worktree/cleanup-worktrees.d.ts.map +1 -0
- package/dist/mcp/tools/worktree/cleanup-worktrees.js +147 -0
- package/dist/mcp/tools/worktree/cleanup-worktrees.js.map +1 -0
- package/dist/mcp/tools/worktree/get-worktree-status.d.ts +17 -0
- package/dist/mcp/tools/worktree/get-worktree-status.d.ts.map +1 -0
- package/dist/mcp/tools/worktree/get-worktree-status.js +123 -0
- package/dist/mcp/tools/worktree/get-worktree-status.js.map +1 -0
- package/dist/mcp/tools/worktree/index.d.ts +41 -0
- package/dist/mcp/tools/worktree/index.d.ts.map +1 -0
- package/dist/mcp/tools/worktree/index.js +69 -0
- package/dist/mcp/tools/worktree/index.js.map +1 -0
- package/dist/mcp/tools/worktree/list-worktrees.d.ts +17 -0
- package/dist/mcp/tools/worktree/list-worktrees.d.ts.map +1 -0
- package/dist/mcp/tools/worktree/list-worktrees.js +136 -0
- package/dist/mcp/tools/worktree/list-worktrees.js.map +1 -0
- package/dist/mcp/tools/worktree/resolve-conflicts.d.ts +19 -0
- package/dist/mcp/tools/worktree/resolve-conflicts.d.ts.map +1 -0
- package/dist/mcp/tools/worktree/resolve-conflicts.js +228 -0
- package/dist/mcp/tools/worktree/resolve-conflicts.js.map +1 -0
- package/dist/mcp/transport/stdio.d.ts +13 -0
- package/dist/mcp/transport/stdio.d.ts.map +1 -0
- package/dist/mcp/transport/stdio.js +15 -0
- package/dist/mcp/transport/stdio.js.map +1 -0
- package/dist/observability/logger.d.ts +137 -0
- package/dist/observability/logger.d.ts.map +1 -0
- package/dist/observability/logger.js +235 -0
- package/dist/observability/logger.js.map +1 -0
- package/dist/observability/metrics.d.ts +250 -0
- package/dist/observability/metrics.d.ts.map +1 -0
- package/dist/observability/metrics.js +364 -0
- package/dist/observability/metrics.js.map +1 -0
- package/dist/persistence/index.d.ts +9 -0
- package/dist/persistence/index.d.ts.map +1 -0
- package/dist/persistence/index.js +9 -0
- package/dist/persistence/index.js.map +1 -0
- package/dist/persistence/state-schema.d.ts +116 -0
- package/dist/persistence/state-schema.d.ts.map +1 -0
- package/dist/persistence/state-schema.js +28 -0
- package/dist/persistence/state-schema.js.map +1 -0
- package/dist/persistence/state-store.d.ts +111 -0
- package/dist/persistence/state-store.d.ts.map +1 -0
- package/dist/persistence/state-store.js +291 -0
- package/dist/persistence/state-store.js.map +1 -0
- package/dist/providers/anthropic.d.ts +164 -0
- package/dist/providers/anthropic.d.ts.map +1 -0
- package/dist/providers/anthropic.js +500 -0
- package/dist/providers/anthropic.js.map +1 -0
- package/dist/providers/base.d.ts +151 -0
- package/dist/providers/base.d.ts.map +1 -0
- package/dist/providers/base.js +227 -0
- package/dist/providers/base.js.map +1 -0
- package/dist/providers/gemini.d.ts +85 -0
- package/dist/providers/gemini.d.ts.map +1 -0
- package/dist/providers/gemini.js +414 -0
- package/dist/providers/gemini.js.map +1 -0
- package/dist/providers/kimi.d.ts +19 -0
- package/dist/providers/kimi.d.ts.map +1 -0
- package/dist/providers/kimi.js +20 -0
- package/dist/providers/kimi.js.map +1 -0
- package/dist/providers/manager.d.ts +160 -0
- package/dist/providers/manager.d.ts.map +1 -0
- package/dist/providers/manager.js +264 -0
- package/dist/providers/manager.js.map +1 -0
- package/dist/providers/ollama.d.ts +83 -0
- package/dist/providers/ollama.d.ts.map +1 -0
- package/dist/providers/ollama.js +453 -0
- package/dist/providers/ollama.js.map +1 -0
- package/dist/providers/openai.d.ts +96 -0
- package/dist/providers/openai.d.ts.map +1 -0
- package/dist/providers/openai.js +457 -0
- package/dist/providers/openai.js.map +1 -0
- package/dist/providers/zai.d.ts +19 -0
- package/dist/providers/zai.d.ts.map +1 -0
- package/dist/providers/zai.js +20 -0
- package/dist/providers/zai.js.map +1 -0
- package/dist/router/context-manager.d.ts +2 -0
- package/dist/router/context-manager.d.ts.map +1 -0
- package/dist/router/context-manager.js +3 -0
- package/dist/router/context-manager.js.map +1 -0
- package/dist/router/engine.d.ts +169 -0
- package/dist/router/engine.d.ts.map +1 -0
- package/dist/router/engine.js +435 -0
- package/dist/router/engine.js.map +1 -0
- package/dist/router/pattern-executor.d.ts +317 -0
- package/dist/router/pattern-executor.d.ts.map +1 -0
- package/dist/router/pattern-executor.js +571 -0
- package/dist/router/pattern-executor.js.map +1 -0
- package/dist/router/role-resolver.d.ts +59 -0
- package/dist/router/role-resolver.d.ts.map +1 -0
- package/dist/router/role-resolver.js +95 -0
- package/dist/router/role-resolver.js.map +1 -0
- package/dist/server.d.ts +32 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +223 -0
- package/dist/server.js.map +1 -0
- package/dist/startup.d.ts +78 -0
- package/dist/startup.d.ts.map +1 -0
- package/dist/startup.js +107 -0
- package/dist/startup.js.map +1 -0
- package/dist/tasks/coordinator.d.ts +141 -0
- package/dist/tasks/coordinator.d.ts.map +1 -0
- package/dist/tasks/coordinator.js +331 -0
- package/dist/tasks/coordinator.js.map +1 -0
- package/dist/tasks/index.d.ts +13 -0
- package/dist/tasks/index.d.ts.map +1 -0
- package/dist/tasks/index.js +13 -0
- package/dist/tasks/index.js.map +1 -0
- package/dist/tasks/persistent-state-coordinator.d.ts +89 -0
- package/dist/tasks/persistent-state-coordinator.d.ts.map +1 -0
- package/dist/tasks/persistent-state-coordinator.js +371 -0
- package/dist/tasks/persistent-state-coordinator.js.map +1 -0
- package/dist/tasks/pipeline-manager.d.ts +103 -0
- package/dist/tasks/pipeline-manager.d.ts.map +1 -0
- package/dist/tasks/pipeline-manager.js +358 -0
- package/dist/tasks/pipeline-manager.js.map +1 -0
- package/dist/tasks/state-coordinator.d.ts +79 -0
- package/dist/tasks/state-coordinator.d.ts.map +1 -0
- package/dist/tasks/state-coordinator.js +200 -0
- package/dist/tasks/state-coordinator.js.map +1 -0
- package/dist/tasks/worker-mode.d.ts +65 -0
- package/dist/tasks/worker-mode.d.ts.map +1 -0
- package/dist/tasks/worker-mode.js +208 -0
- package/dist/tasks/worker-mode.js.map +1 -0
- package/dist/translation/errors.d.ts +203 -0
- package/dist/translation/errors.d.ts.map +1 -0
- package/dist/translation/errors.js +477 -0
- package/dist/translation/errors.js.map +1 -0
- package/dist/translation/index.d.ts +12 -0
- package/dist/translation/index.d.ts.map +1 -0
- package/dist/translation/index.js +32 -0
- package/dist/translation/index.js.map +1 -0
- package/dist/translation/messages.d.ts +295 -0
- package/dist/translation/messages.d.ts.map +1 -0
- package/dist/translation/messages.js +557 -0
- package/dist/translation/messages.js.map +1 -0
- package/dist/translation/streaming.d.ts +226 -0
- package/dist/translation/streaming.d.ts.map +1 -0
- package/dist/translation/streaming.js +520 -0
- package/dist/translation/streaming.js.map +1 -0
- package/dist/translation/tools.d.ts +209 -0
- package/dist/translation/tools.d.ts.map +1 -0
- package/dist/translation/tools.js +331 -0
- package/dist/translation/tools.js.map +1 -0
- package/dist/types.d.ts +747 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +86 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/circuit-breaker.d.ts +175 -0
- package/dist/utils/circuit-breaker.d.ts.map +1 -0
- package/dist/utils/circuit-breaker.js +315 -0
- package/dist/utils/circuit-breaker.js.map +1 -0
- package/dist/utils/env.d.ts +2 -0
- package/dist/utils/env.d.ts.map +1 -0
- package/dist/utils/env.js +3 -0
- package/dist/utils/env.js.map +1 -0
- package/dist/utils/git.d.ts +58 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +197 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/merge-ordering.d.ts +45 -0
- package/dist/utils/merge-ordering.d.ts.map +1 -0
- package/dist/utils/merge-ordering.js +128 -0
- package/dist/utils/merge-ordering.js.map +1 -0
- package/dist/utils/retry.d.ts +106 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/retry.js +188 -0
- package/dist/utils/retry.js.map +1 -0
- package/dist/worktrees/branch-manager.d.ts +55 -0
- package/dist/worktrees/branch-manager.d.ts.map +1 -0
- package/dist/worktrees/branch-manager.js +129 -0
- package/dist/worktrees/branch-manager.js.map +1 -0
- package/dist/worktrees/conflict-handler.d.ts +72 -0
- package/dist/worktrees/conflict-handler.d.ts.map +1 -0
- package/dist/worktrees/conflict-handler.js +287 -0
- package/dist/worktrees/conflict-handler.js.map +1 -0
- package/dist/worktrees/conflict-parser.d.ts +28 -0
- package/dist/worktrees/conflict-parser.d.ts.map +1 -0
- package/dist/worktrees/conflict-parser.js +140 -0
- package/dist/worktrees/conflict-parser.js.map +1 -0
- package/dist/worktrees/index.d.ts +20 -0
- package/dist/worktrees/index.d.ts.map +1 -0
- package/dist/worktrees/index.js +20 -0
- package/dist/worktrees/index.js.map +1 -0
- package/dist/worktrees/instructions.d.ts +20 -0
- package/dist/worktrees/instructions.d.ts.map +1 -0
- package/dist/worktrees/instructions.js +84 -0
- package/dist/worktrees/instructions.js.map +1 -0
- package/dist/worktrees/manager.d.ts +76 -0
- package/dist/worktrees/manager.d.ts.map +1 -0
- package/dist/worktrees/manager.js +277 -0
- package/dist/worktrees/manager.js.map +1 -0
- package/dist/worktrees/pipeline-merge-orchestrator.d.ts +55 -0
- package/dist/worktrees/pipeline-merge-orchestrator.d.ts.map +1 -0
- package/dist/worktrees/pipeline-merge-orchestrator.js +221 -0
- package/dist/worktrees/pipeline-merge-orchestrator.js.map +1 -0
- package/dist/worktrees/pool.d.ts +95 -0
- package/dist/worktrees/pool.d.ts.map +1 -0
- package/dist/worktrees/pool.js +271 -0
- package/dist/worktrees/pool.js.map +1 -0
- package/dist/worktrees/recovery.d.ts +94 -0
- package/dist/worktrees/recovery.d.ts.map +1 -0
- package/dist/worktrees/recovery.js +371 -0
- package/dist/worktrees/recovery.js.map +1 -0
- package/dist/worktrees/resource-manager.d.ts +74 -0
- package/dist/worktrees/resource-manager.d.ts.map +1 -0
- package/dist/worktrees/resource-manager.js +228 -0
- package/dist/worktrees/resource-manager.js.map +1 -0
- package/package.json +88 -0
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message Format Translation
|
|
3
|
+
*
|
|
4
|
+
* Translates messages between AgentRouter's internal format and provider-specific formats.
|
|
5
|
+
* Handles the differences in how each provider represents:
|
|
6
|
+
* - System prompts
|
|
7
|
+
* - Message content (text, tool use, tool results)
|
|
8
|
+
* - Role naming conventions
|
|
9
|
+
*
|
|
10
|
+
* Format Reference:
|
|
11
|
+
* | Feature | Anthropic | OpenAI | Gemini |
|
|
12
|
+
* |--------------|------------------------|------------------------|---------------------|
|
|
13
|
+
* | System | separate param | role: "system" message | systemInstruction |
|
|
14
|
+
* | Content | content blocks | string or array | parts array |
|
|
15
|
+
* | Tool use | tool_use block | tool_calls array | functionCall |
|
|
16
|
+
* | Tool result | tool_result block | role: "tool" message | functionResponse |
|
|
17
|
+
*/
|
|
18
|
+
// ============================================================================
|
|
19
|
+
// Translation Functions: To Provider Formats
|
|
20
|
+
// ============================================================================
|
|
21
|
+
/**
|
|
22
|
+
* Convert internal messages to Anthropic format
|
|
23
|
+
*
|
|
24
|
+
* Anthropic:
|
|
25
|
+
* - System prompt is a separate top-level parameter
|
|
26
|
+
* - Messages use 'user' | 'assistant' roles
|
|
27
|
+
* - Content can be string or ContentBlock[]
|
|
28
|
+
* - Tool results go in user messages with tool_result blocks
|
|
29
|
+
*
|
|
30
|
+
* @param messages - Internal Message array
|
|
31
|
+
* @param systemPrompt - Optional system prompt (becomes separate param in Anthropic)
|
|
32
|
+
* @returns Anthropic-formatted messages (system prompt handled separately by caller)
|
|
33
|
+
*/
|
|
34
|
+
export function toAnthropicMessages(messages, systemPrompt) {
|
|
35
|
+
const anthropicMessages = [];
|
|
36
|
+
for (const message of messages) {
|
|
37
|
+
const anthropicMessage = messageToAnthropic(message);
|
|
38
|
+
anthropicMessages.push(anthropicMessage);
|
|
39
|
+
}
|
|
40
|
+
// Ensure valid message sequence (must start with user, alternate)
|
|
41
|
+
const validatedMessages = validateAnthropicMessageSequence(anthropicMessages);
|
|
42
|
+
const result = {
|
|
43
|
+
messages: validatedMessages,
|
|
44
|
+
};
|
|
45
|
+
if (systemPrompt !== undefined) {
|
|
46
|
+
result.system = systemPrompt;
|
|
47
|
+
}
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Convert internal messages to OpenAI format
|
|
52
|
+
*
|
|
53
|
+
* OpenAI:
|
|
54
|
+
* - System prompt is a message with role: "system"
|
|
55
|
+
* - Tool use is in assistant message's tool_calls array
|
|
56
|
+
* - Tool results are separate messages with role: "tool"
|
|
57
|
+
*
|
|
58
|
+
* @param messages - Internal Message array
|
|
59
|
+
* @param systemPrompt - Optional system prompt (becomes first message)
|
|
60
|
+
* @returns OpenAI-formatted messages
|
|
61
|
+
*/
|
|
62
|
+
export function toOpenAIMessages(messages, systemPrompt) {
|
|
63
|
+
const openAIMessages = [];
|
|
64
|
+
// Add system prompt as first message if provided
|
|
65
|
+
if (systemPrompt) {
|
|
66
|
+
openAIMessages.push({
|
|
67
|
+
role: 'system',
|
|
68
|
+
content: systemPrompt,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
for (const message of messages) {
|
|
72
|
+
const translated = messageToOpenAI(message);
|
|
73
|
+
// messageToOpenAI can return multiple messages (for tool results)
|
|
74
|
+
openAIMessages.push(...translated);
|
|
75
|
+
}
|
|
76
|
+
return openAIMessages;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Convert internal messages to Gemini format
|
|
80
|
+
*
|
|
81
|
+
* Gemini:
|
|
82
|
+
* - System prompt goes in systemInstruction
|
|
83
|
+
* - Roles are 'user' | 'model' (not 'assistant')
|
|
84
|
+
* - Content is always an array of parts
|
|
85
|
+
* - Function calls and responses are specific part types
|
|
86
|
+
*
|
|
87
|
+
* @param messages - Internal Message array
|
|
88
|
+
* @param systemPrompt - Optional system prompt (becomes systemInstruction)
|
|
89
|
+
* @returns Gemini-formatted contents and system instruction
|
|
90
|
+
*/
|
|
91
|
+
export function toGeminiContents(messages, systemPrompt) {
|
|
92
|
+
const contents = [];
|
|
93
|
+
for (const message of messages) {
|
|
94
|
+
const geminiContent = messageToGemini(message);
|
|
95
|
+
contents.push(geminiContent);
|
|
96
|
+
}
|
|
97
|
+
// Validate and merge consecutive same-role messages if needed
|
|
98
|
+
const validatedContents = validateGeminiContentSequence(contents);
|
|
99
|
+
const result = {
|
|
100
|
+
contents: validatedContents,
|
|
101
|
+
};
|
|
102
|
+
if (systemPrompt !== undefined) {
|
|
103
|
+
result.systemInstruction = { parts: [{ text: systemPrompt }] };
|
|
104
|
+
}
|
|
105
|
+
return result;
|
|
106
|
+
}
|
|
107
|
+
// ============================================================================
|
|
108
|
+
// Translation Functions: From Provider Responses
|
|
109
|
+
// ============================================================================
|
|
110
|
+
/**
|
|
111
|
+
* Convert Anthropic response to internal Message format
|
|
112
|
+
*
|
|
113
|
+
* @param response - Anthropic API response
|
|
114
|
+
* @returns Internal Message
|
|
115
|
+
*/
|
|
116
|
+
export function fromAnthropicResponse(response) {
|
|
117
|
+
const content = response.content.map((block) => {
|
|
118
|
+
if (block.type === 'text') {
|
|
119
|
+
const textBlock = {
|
|
120
|
+
type: 'text',
|
|
121
|
+
};
|
|
122
|
+
if (block.text !== undefined) {
|
|
123
|
+
textBlock.text = block.text;
|
|
124
|
+
}
|
|
125
|
+
return textBlock;
|
|
126
|
+
}
|
|
127
|
+
else if (block.type === 'tool_use') {
|
|
128
|
+
const toolUseBlock = {
|
|
129
|
+
type: 'tool_use',
|
|
130
|
+
};
|
|
131
|
+
if (block.id !== undefined) {
|
|
132
|
+
toolUseBlock.id = block.id;
|
|
133
|
+
}
|
|
134
|
+
if (block.name !== undefined) {
|
|
135
|
+
toolUseBlock.name = block.name;
|
|
136
|
+
}
|
|
137
|
+
if (block.input !== undefined) {
|
|
138
|
+
toolUseBlock.input = block.input;
|
|
139
|
+
}
|
|
140
|
+
return toolUseBlock;
|
|
141
|
+
}
|
|
142
|
+
else if (block.type === 'tool_result') {
|
|
143
|
+
const toolResultBlock = {
|
|
144
|
+
type: 'tool_result',
|
|
145
|
+
};
|
|
146
|
+
if (block.tool_use_id !== undefined) {
|
|
147
|
+
toolResultBlock.tool_use_id = block.tool_use_id;
|
|
148
|
+
}
|
|
149
|
+
if (block.content !== undefined) {
|
|
150
|
+
toolResultBlock.content = block.content;
|
|
151
|
+
}
|
|
152
|
+
return toolResultBlock;
|
|
153
|
+
}
|
|
154
|
+
// Unknown block type, treat as text
|
|
155
|
+
return {
|
|
156
|
+
type: 'text',
|
|
157
|
+
text: JSON.stringify(block),
|
|
158
|
+
};
|
|
159
|
+
});
|
|
160
|
+
return {
|
|
161
|
+
role: 'assistant',
|
|
162
|
+
content,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Convert OpenAI response to internal Message format
|
|
167
|
+
*
|
|
168
|
+
* @param response - OpenAI API response
|
|
169
|
+
* @returns Internal Message
|
|
170
|
+
*/
|
|
171
|
+
export function fromOpenAIResponse(response) {
|
|
172
|
+
const choice = response.choices[0];
|
|
173
|
+
if (!choice) {
|
|
174
|
+
return {
|
|
175
|
+
role: 'assistant',
|
|
176
|
+
content: [],
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
const message = choice.message;
|
|
180
|
+
const content = [];
|
|
181
|
+
// Handle text content
|
|
182
|
+
if (message.content) {
|
|
183
|
+
if (typeof message.content === 'string') {
|
|
184
|
+
content.push({
|
|
185
|
+
type: 'text',
|
|
186
|
+
text: message.content,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
else if (Array.isArray(message.content)) {
|
|
190
|
+
// Multi-part content
|
|
191
|
+
for (const part of message.content) {
|
|
192
|
+
if (part.type === 'text' && part.text) {
|
|
193
|
+
content.push({
|
|
194
|
+
type: 'text',
|
|
195
|
+
text: part.text,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
// Note: Image parts are not supported in our internal format
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
// Handle tool calls
|
|
203
|
+
if (message.tool_calls && message.tool_calls.length > 0) {
|
|
204
|
+
for (const toolCall of message.tool_calls) {
|
|
205
|
+
content.push({
|
|
206
|
+
type: 'tool_use',
|
|
207
|
+
id: toolCall.id,
|
|
208
|
+
name: toolCall.function.name,
|
|
209
|
+
input: safeJsonParse(toolCall.function.arguments),
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return {
|
|
214
|
+
role: 'assistant',
|
|
215
|
+
content: content.length > 0 ? content : [],
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Convert Gemini response to internal Message format
|
|
220
|
+
*
|
|
221
|
+
* @param response - Gemini API response
|
|
222
|
+
* @returns Internal Message
|
|
223
|
+
*/
|
|
224
|
+
export function fromGeminiResponse(response) {
|
|
225
|
+
const candidate = response.candidates?.[0];
|
|
226
|
+
if (!candidate) {
|
|
227
|
+
return {
|
|
228
|
+
role: 'assistant',
|
|
229
|
+
content: [],
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
const geminiContent = candidate.content;
|
|
233
|
+
const content = [];
|
|
234
|
+
for (const part of geminiContent.parts) {
|
|
235
|
+
if (part.text !== undefined) {
|
|
236
|
+
content.push({
|
|
237
|
+
type: 'text',
|
|
238
|
+
text: part.text,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
else if (part.functionCall) {
|
|
242
|
+
content.push({
|
|
243
|
+
type: 'tool_use',
|
|
244
|
+
id: generateToolCallId(),
|
|
245
|
+
name: part.functionCall.name,
|
|
246
|
+
input: part.functionCall.args,
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
// functionResponse parts are typically in user messages, not assistant responses
|
|
250
|
+
}
|
|
251
|
+
return {
|
|
252
|
+
role: 'assistant',
|
|
253
|
+
content: content.length > 0 ? content : [],
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
// ============================================================================
|
|
257
|
+
// Internal Helper Functions
|
|
258
|
+
// ============================================================================
|
|
259
|
+
/**
|
|
260
|
+
* Convert a single internal message to Anthropic format
|
|
261
|
+
*/
|
|
262
|
+
function messageToAnthropic(message) {
|
|
263
|
+
if (typeof message.content === 'string') {
|
|
264
|
+
return {
|
|
265
|
+
role: message.role,
|
|
266
|
+
content: message.content,
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
const anthropicBlocks = message.content.map((block) => {
|
|
270
|
+
if (block.type === 'text') {
|
|
271
|
+
return {
|
|
272
|
+
type: 'text',
|
|
273
|
+
text: block.text || '',
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
else if (block.type === 'tool_use') {
|
|
277
|
+
return {
|
|
278
|
+
type: 'tool_use',
|
|
279
|
+
id: block.id || generateToolCallId(),
|
|
280
|
+
name: block.name || '',
|
|
281
|
+
input: block.input || {},
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
else if (block.type === 'tool_result') {
|
|
285
|
+
return {
|
|
286
|
+
type: 'tool_result',
|
|
287
|
+
tool_use_id: block.tool_use_id || '',
|
|
288
|
+
content: block.content || '',
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
// Fallback for unknown types
|
|
292
|
+
return {
|
|
293
|
+
type: 'text',
|
|
294
|
+
text: JSON.stringify(block),
|
|
295
|
+
};
|
|
296
|
+
});
|
|
297
|
+
return {
|
|
298
|
+
role: message.role,
|
|
299
|
+
content: anthropicBlocks,
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Convert a single internal message to OpenAI format
|
|
304
|
+
* Returns an array because tool results become separate messages
|
|
305
|
+
*/
|
|
306
|
+
function messageToOpenAI(message) {
|
|
307
|
+
const messages = [];
|
|
308
|
+
if (typeof message.content === 'string') {
|
|
309
|
+
messages.push({
|
|
310
|
+
role: message.role,
|
|
311
|
+
content: message.content,
|
|
312
|
+
});
|
|
313
|
+
return messages;
|
|
314
|
+
}
|
|
315
|
+
// Separate tool results from other content
|
|
316
|
+
const toolResults = [];
|
|
317
|
+
const otherBlocks = [];
|
|
318
|
+
for (const block of message.content) {
|
|
319
|
+
if (block.type === 'tool_result') {
|
|
320
|
+
toolResults.push(block);
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
otherBlocks.push(block);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
// Handle non-tool-result content
|
|
327
|
+
if (otherBlocks.length > 0) {
|
|
328
|
+
const hasToolUse = otherBlocks.some((b) => b.type === 'tool_use');
|
|
329
|
+
if (hasToolUse && message.role === 'assistant') {
|
|
330
|
+
// Assistant message with tool calls
|
|
331
|
+
const textParts = otherBlocks
|
|
332
|
+
.filter((b) => b.type === 'text')
|
|
333
|
+
.map((b) => b.text || '')
|
|
334
|
+
.join('');
|
|
335
|
+
const toolCalls = otherBlocks
|
|
336
|
+
.filter((b) => b.type === 'tool_use')
|
|
337
|
+
.map((b) => ({
|
|
338
|
+
id: b.id || generateToolCallId(),
|
|
339
|
+
type: 'function',
|
|
340
|
+
function: {
|
|
341
|
+
name: b.name || '',
|
|
342
|
+
arguments: JSON.stringify(b.input || {}),
|
|
343
|
+
},
|
|
344
|
+
}));
|
|
345
|
+
messages.push({
|
|
346
|
+
role: 'assistant',
|
|
347
|
+
content: textParts || null,
|
|
348
|
+
tool_calls: toolCalls,
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
// Regular message
|
|
353
|
+
const textContent = otherBlocks
|
|
354
|
+
.filter((b) => b.type === 'text')
|
|
355
|
+
.map((b) => b.text || '')
|
|
356
|
+
.join('');
|
|
357
|
+
messages.push({
|
|
358
|
+
role: message.role,
|
|
359
|
+
content: textContent,
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
// Handle tool results as separate tool messages
|
|
364
|
+
for (const toolResult of toolResults) {
|
|
365
|
+
messages.push({
|
|
366
|
+
role: 'tool',
|
|
367
|
+
tool_call_id: toolResult.tool_use_id || '',
|
|
368
|
+
content: toolResult.content || '',
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
return messages;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Convert a single internal message to Gemini format
|
|
375
|
+
*/
|
|
376
|
+
function messageToGemini(message) {
|
|
377
|
+
const role = message.role === 'assistant' ? 'model' : 'user';
|
|
378
|
+
if (typeof message.content === 'string') {
|
|
379
|
+
return {
|
|
380
|
+
role,
|
|
381
|
+
parts: [{ text: message.content }],
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
const parts = message.content.map((block) => {
|
|
385
|
+
if (block.type === 'text') {
|
|
386
|
+
return { text: block.text || '' };
|
|
387
|
+
}
|
|
388
|
+
else if (block.type === 'tool_use') {
|
|
389
|
+
return {
|
|
390
|
+
functionCall: {
|
|
391
|
+
name: block.name || '',
|
|
392
|
+
args: (block.input) || {},
|
|
393
|
+
},
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
else if (block.type === 'tool_result') {
|
|
397
|
+
// Gemini needs the function name for responses, but we only have tool_use_id
|
|
398
|
+
// The caller should track tool names or include them in the content
|
|
399
|
+
return {
|
|
400
|
+
functionResponse: {
|
|
401
|
+
name: block.tool_use_id || 'unknown',
|
|
402
|
+
response: { result: block.content || '' },
|
|
403
|
+
},
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
// Fallback
|
|
407
|
+
return { text: JSON.stringify(block) };
|
|
408
|
+
});
|
|
409
|
+
return {
|
|
410
|
+
role,
|
|
411
|
+
parts,
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Ensure Anthropic messages follow required sequence rules:
|
|
416
|
+
* - Must start with a user message
|
|
417
|
+
* - Messages must alternate between user and assistant
|
|
418
|
+
*/
|
|
419
|
+
function validateAnthropicMessageSequence(messages) {
|
|
420
|
+
if (messages.length === 0) {
|
|
421
|
+
return messages;
|
|
422
|
+
}
|
|
423
|
+
const result = [];
|
|
424
|
+
let lastRole = null;
|
|
425
|
+
for (const message of messages) {
|
|
426
|
+
// First message must be user
|
|
427
|
+
if (result.length === 0 && message.role !== 'user') {
|
|
428
|
+
// Prepend an empty user message
|
|
429
|
+
result.push({
|
|
430
|
+
role: 'user',
|
|
431
|
+
content: '',
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
// Merge consecutive same-role messages
|
|
435
|
+
if (lastRole === message.role && result.length > 0) {
|
|
436
|
+
const lastIndex = result.length - 1;
|
|
437
|
+
const lastMessage = result[lastIndex];
|
|
438
|
+
if (lastMessage) {
|
|
439
|
+
result[lastIndex] = {
|
|
440
|
+
...lastMessage,
|
|
441
|
+
content: mergeAnthropicContent(lastMessage.content, message.content),
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
else {
|
|
446
|
+
result.push({ ...message });
|
|
447
|
+
}
|
|
448
|
+
lastRole = message.role;
|
|
449
|
+
}
|
|
450
|
+
return result;
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Merge two Anthropic content values
|
|
454
|
+
*/
|
|
455
|
+
function mergeAnthropicContent(a, b) {
|
|
456
|
+
const blocksA = typeof a === 'string' ? [{ type: 'text', text: a }] : a;
|
|
457
|
+
const blocksB = typeof b === 'string' ? [{ type: 'text', text: b }] : b;
|
|
458
|
+
return [...blocksA, ...blocksB];
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Ensure Gemini contents follow required sequence rules:
|
|
462
|
+
* - Contents should alternate between user and model
|
|
463
|
+
*/
|
|
464
|
+
function validateGeminiContentSequence(contents) {
|
|
465
|
+
if (contents.length === 0) {
|
|
466
|
+
return contents;
|
|
467
|
+
}
|
|
468
|
+
const result = [];
|
|
469
|
+
let lastRole = null;
|
|
470
|
+
for (const content of contents) {
|
|
471
|
+
// Merge consecutive same-role contents
|
|
472
|
+
if (lastRole === content.role && result.length > 0) {
|
|
473
|
+
const lastIndex = result.length - 1;
|
|
474
|
+
const lastContent = result[lastIndex];
|
|
475
|
+
if (lastContent) {
|
|
476
|
+
result[lastIndex] = {
|
|
477
|
+
...lastContent,
|
|
478
|
+
parts: [...lastContent.parts, ...content.parts],
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
else {
|
|
483
|
+
result.push({ ...content, parts: [...content.parts] });
|
|
484
|
+
}
|
|
485
|
+
lastRole = content.role;
|
|
486
|
+
}
|
|
487
|
+
return result;
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Safely parse JSON, returning empty object on failure
|
|
491
|
+
*/
|
|
492
|
+
function safeJsonParse(json) {
|
|
493
|
+
try {
|
|
494
|
+
return JSON.parse(json);
|
|
495
|
+
}
|
|
496
|
+
catch {
|
|
497
|
+
return {};
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Generate a unique tool call ID
|
|
502
|
+
*/
|
|
503
|
+
function generateToolCallId() {
|
|
504
|
+
return `toolu_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
|
|
505
|
+
}
|
|
506
|
+
// ============================================================================
|
|
507
|
+
// Utility Exports
|
|
508
|
+
// ============================================================================
|
|
509
|
+
/**
|
|
510
|
+
* Extract text content from a Message
|
|
511
|
+
*/
|
|
512
|
+
export function extractTextContent(message) {
|
|
513
|
+
if (typeof message.content === 'string') {
|
|
514
|
+
return message.content;
|
|
515
|
+
}
|
|
516
|
+
return message.content
|
|
517
|
+
.filter((block) => block.type === 'text')
|
|
518
|
+
.map((block) => block.text || '')
|
|
519
|
+
.join('\n');
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Check if a message contains tool use
|
|
523
|
+
*/
|
|
524
|
+
export function hasToolUse(message) {
|
|
525
|
+
if (typeof message.content === 'string') {
|
|
526
|
+
return false;
|
|
527
|
+
}
|
|
528
|
+
return message.content.some((block) => block.type === 'tool_use');
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* Check if a message contains tool results
|
|
532
|
+
*/
|
|
533
|
+
export function hasToolResult(message) {
|
|
534
|
+
if (typeof message.content === 'string') {
|
|
535
|
+
return false;
|
|
536
|
+
}
|
|
537
|
+
return message.content.some((block) => block.type === 'tool_result');
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Get all tool use blocks from a message
|
|
541
|
+
*/
|
|
542
|
+
export function getToolUseBlocks(message) {
|
|
543
|
+
if (typeof message.content === 'string') {
|
|
544
|
+
return [];
|
|
545
|
+
}
|
|
546
|
+
return message.content.filter((block) => block.type === 'tool_use');
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Get all tool result blocks from a message
|
|
550
|
+
*/
|
|
551
|
+
export function getToolResultBlocks(message) {
|
|
552
|
+
if (typeof message.content === 'string') {
|
|
553
|
+
return [];
|
|
554
|
+
}
|
|
555
|
+
return message.content.filter((block) => block.type === 'tool_result');
|
|
556
|
+
}
|
|
557
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/translation/messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA0NH,+EAA+E;AAC/E,6CAA6C;AAC7C,+EAA+E;AAE/E;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAAmB,EACnB,YAAqB;IAErB,MAAM,iBAAiB,GAAuB,EAAE,CAAC;IAEjD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;QACrD,iBAAiB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC3C,CAAC;IAED,kEAAkE;IAClE,MAAM,iBAAiB,GAAG,gCAAgC,CAAC,iBAAiB,CAAC,CAAC;IAE9E,MAAM,MAAM,GAAsD;QAChE,QAAQ,EAAE,iBAAiB;KAC5B,CAAC;IAEF,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/B,MAAM,CAAC,MAAM,GAAG,YAAY,CAAC;IAC/B,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,gBAAgB,CAC9B,QAAmB,EACnB,YAAqB;IAErB,MAAM,cAAc,GAAoB,EAAE,CAAC;IAE3C,iDAAiD;IACjD,IAAI,YAAY,EAAE,CAAC;QACjB,cAAc,CAAC,IAAI,CAAC;YAClB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,YAAY;SACtB,C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