monty-autonomous-fullstack-dev-multillm 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 +81 -0
- package/README.md +608 -0
- package/bin/cli.js +448 -0
- package/dist/agents/coding.d.ts +15 -0
- package/dist/agents/coding.d.ts.map +1 -0
- package/dist/agents/coding.js +189 -0
- package/dist/agents/coding.js.map +1 -0
- package/dist/agents/initializer.d.ts +15 -0
- package/dist/agents/initializer.d.ts.map +1 -0
- package/dist/agents/initializer.js +87 -0
- package/dist/agents/initializer.js.map +1 -0
- package/dist/agents/prompts/arbitrator.md +143 -0
- package/dist/agents/prompts/coding.md +247 -0
- package/dist/agents/prompts/initializer.md +98 -0
- package/dist/config/agent-config.d.ts +103 -0
- package/dist/config/agent-config.d.ts.map +1 -0
- package/dist/config/agent-config.js +138 -0
- package/dist/config/agent-config.js.map +1 -0
- package/dist/config/auth-config.d.ts +152 -0
- package/dist/config/auth-config.d.ts.map +1 -0
- package/dist/config/auth-config.js +139 -0
- package/dist/config/auth-config.js.map +1 -0
- package/dist/config/mcp-config.d.ts +109 -0
- package/dist/config/mcp-config.d.ts.map +1 -0
- package/dist/config/mcp-config.js +234 -0
- package/dist/config/mcp-config.js.map +1 -0
- package/dist/config/provider-config.d.ts +139 -0
- package/dist/config/provider-config.d.ts.map +1 -0
- package/dist/config/provider-config.js +344 -0
- package/dist/config/provider-config.js.map +1 -0
- package/dist/config/subagents-config.d.ts +85 -0
- package/dist/config/subagents-config.d.ts.map +1 -0
- package/dist/config/subagents-config.js +430 -0
- package/dist/config/subagents-config.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +385 -0
- package/dist/index.js.map +1 -0
- package/dist/orchestrator/arbitrator.d.ts +93 -0
- package/dist/orchestrator/arbitrator.d.ts.map +1 -0
- package/dist/orchestrator/arbitrator.js +330 -0
- package/dist/orchestrator/arbitrator.js.map +1 -0
- package/dist/orchestrator/index.d.ts +113 -0
- package/dist/orchestrator/index.d.ts.map +1 -0
- package/dist/orchestrator/index.js +217 -0
- package/dist/orchestrator/index.js.map +1 -0
- package/dist/orchestrator/review-coordinator.d.ts +143 -0
- package/dist/orchestrator/review-coordinator.d.ts.map +1 -0
- package/dist/orchestrator/review-coordinator.js +401 -0
- package/dist/orchestrator/review-coordinator.js.map +1 -0
- package/dist/orchestrator/task-classifier.d.ts +87 -0
- package/dist/orchestrator/task-classifier.d.ts.map +1 -0
- package/dist/orchestrator/task-classifier.js +250 -0
- package/dist/orchestrator/task-classifier.js.map +1 -0
- package/dist/providers/anthropic-provider.d.ts +64 -0
- package/dist/providers/anthropic-provider.d.ts.map +1 -0
- package/dist/providers/anthropic-provider.js +264 -0
- package/dist/providers/anthropic-provider.js.map +1 -0
- package/dist/providers/base-provider.d.ts +219 -0
- package/dist/providers/base-provider.d.ts.map +1 -0
- package/dist/providers/base-provider.js +143 -0
- package/dist/providers/base-provider.js.map +1 -0
- package/dist/providers/cursor-provider.d.ts +82 -0
- package/dist/providers/cursor-provider.d.ts.map +1 -0
- package/dist/providers/cursor-provider.js +321 -0
- package/dist/providers/cursor-provider.js.map +1 -0
- package/dist/providers/google-provider.d.ts +75 -0
- package/dist/providers/google-provider.d.ts.map +1 -0
- package/dist/providers/google-provider.js +274 -0
- package/dist/providers/google-provider.js.map +1 -0
- package/dist/providers/index.d.ts +92 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +233 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/openai-provider.d.ts +83 -0
- package/dist/providers/openai-provider.d.ts.map +1 -0
- package/dist/providers/openai-provider.js +295 -0
- package/dist/providers/openai-provider.js.map +1 -0
- package/dist/templates/feature_list.template.json +66 -0
- package/dist/templates/progress.template.txt +51 -0
- package/dist/utils/auth-manager.d.ts +121 -0
- package/dist/utils/auth-manager.d.ts.map +1 -0
- package/dist/utils/auth-manager.js +560 -0
- package/dist/utils/auth-manager.js.map +1 -0
- package/dist/utils/budget-enforcer.d.ts +181 -0
- package/dist/utils/budget-enforcer.d.ts.map +1 -0
- package/dist/utils/budget-enforcer.js +386 -0
- package/dist/utils/budget-enforcer.js.map +1 -0
- package/dist/utils/chatgpt-detector.d.ts +51 -0
- package/dist/utils/chatgpt-detector.d.ts.map +1 -0
- package/dist/utils/chatgpt-detector.js +274 -0
- package/dist/utils/chatgpt-detector.js.map +1 -0
- package/dist/utils/claude-code-detector.d.ts +39 -0
- package/dist/utils/claude-code-detector.d.ts.map +1 -0
- package/dist/utils/claude-code-detector.js +153 -0
- package/dist/utils/claude-code-detector.js.map +1 -0
- package/dist/utils/code-quality.d.ts +58 -0
- package/dist/utils/code-quality.d.ts.map +1 -0
- package/dist/utils/code-quality.js +258 -0
- package/dist/utils/code-quality.js.map +1 -0
- package/dist/utils/context-primer.d.ts +50 -0
- package/dist/utils/context-primer.d.ts.map +1 -0
- package/dist/utils/context-primer.js +429 -0
- package/dist/utils/context-primer.js.map +1 -0
- package/dist/utils/dependency-management.d.ts +40 -0
- package/dist/utils/dependency-management.d.ts.map +1 -0
- package/dist/utils/dependency-management.js +123 -0
- package/dist/utils/dependency-management.js.map +1 -0
- package/dist/utils/environment-validation.d.ts +33 -0
- package/dist/utils/environment-validation.d.ts.map +1 -0
- package/dist/utils/environment-validation.js +136 -0
- package/dist/utils/environment-validation.js.map +1 -0
- package/dist/utils/error-recovery.d.ts +60 -0
- package/dist/utils/error-recovery.d.ts.map +1 -0
- package/dist/utils/error-recovery.js +183 -0
- package/dist/utils/error-recovery.js.map +1 -0
- package/dist/utils/feature-list.d.ts +102 -0
- package/dist/utils/feature-list.d.ts.map +1 -0
- package/dist/utils/feature-list.js +191 -0
- package/dist/utils/feature-list.js.map +1 -0
- package/dist/utils/gemini-detector.d.ts +65 -0
- package/dist/utils/gemini-detector.d.ts.map +1 -0
- package/dist/utils/gemini-detector.js +340 -0
- package/dist/utils/gemini-detector.js.map +1 -0
- package/dist/utils/git-utils.d.ts +48 -0
- package/dist/utils/git-utils.d.ts.map +1 -0
- package/dist/utils/git-utils.js +110 -0
- package/dist/utils/git-utils.js.map +1 -0
- package/dist/utils/health-check.d.ts +32 -0
- package/dist/utils/health-check.d.ts.map +1 -0
- package/dist/utils/health-check.js +152 -0
- package/dist/utils/health-check.js.map +1 -0
- package/dist/utils/hooks-manager.d.ts +154 -0
- package/dist/utils/hooks-manager.d.ts.map +1 -0
- package/dist/utils/hooks-manager.js +359 -0
- package/dist/utils/hooks-manager.js.map +1 -0
- package/dist/utils/multi-auth-manager.d.ts +144 -0
- package/dist/utils/multi-auth-manager.d.ts.map +1 -0
- package/dist/utils/multi-auth-manager.js +588 -0
- package/dist/utils/multi-auth-manager.js.map +1 -0
- package/dist/utils/progress.d.ts +49 -0
- package/dist/utils/progress.d.ts.map +1 -0
- package/dist/utils/progress.js +209 -0
- package/dist/utils/progress.js.map +1 -0
- package/dist/utils/project-detection.d.ts +40 -0
- package/dist/utils/project-detection.d.ts.map +1 -0
- package/dist/utils/project-detection.js +230 -0
- package/dist/utils/project-detection.js.map +1 -0
- package/dist/utils/session-manager.d.ts +119 -0
- package/dist/utils/session-manager.d.ts.map +1 -0
- package/dist/utils/session-manager.js +389 -0
- package/dist/utils/session-manager.js.map +1 -0
- package/dist/utils/skills-manager.d.ts +113 -0
- package/dist/utils/skills-manager.d.ts.map +1 -0
- package/dist/utils/skills-manager.js +332 -0
- package/dist/utils/skills-manager.js.map +1 -0
- package/dist/utils/structured-output.d.ts +117 -0
- package/dist/utils/structured-output.d.ts.map +1 -0
- package/dist/utils/structured-output.js +191 -0
- package/dist/utils/structured-output.js.map +1 -0
- package/dist/utils/subagent-manager.d.ts +143 -0
- package/dist/utils/subagent-manager.d.ts.map +1 -0
- package/dist/utils/subagent-manager.js +326 -0
- package/dist/utils/subagent-manager.js.map +1 -0
- package/dist/utils/supabase-setup.d.ts +50 -0
- package/dist/utils/supabase-setup.d.ts.map +1 -0
- package/dist/utils/supabase-setup.js +151 -0
- package/dist/utils/supabase-setup.js.map +1 -0
- package/dist/utils/token-refresh.d.ts +21 -0
- package/dist/utils/token-refresh.d.ts.map +1 -0
- package/dist/utils/token-refresh.js +77 -0
- package/dist/utils/token-refresh.js.map +1 -0
- package/dist/utils/tos-warning.d.ts +115 -0
- package/dist/utils/tos-warning.d.ts.map +1 -0
- package/dist/utils/tos-warning.js +304 -0
- package/dist/utils/tos-warning.js.map +1 -0
- package/dist/utils/usage-monitor.d.ts +156 -0
- package/dist/utils/usage-monitor.d.ts.map +1 -0
- package/dist/utils/usage-monitor.js +296 -0
- package/dist/utils/usage-monitor.js.map +1 -0
- package/package.json +105 -0
- package/scripts/init.ps1 +73 -0
- package/scripts/init.sh +86 -0
- package/scripts/test-auth.sh +90 -0
- package/templates/feature_list.template.json +66 -0
- package/templates/progress.template.txt +51 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-classifier.d.ts","sourceRoot":"","sources":["../../src/orchestrator/task-classifier.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,QAAQ,EAId,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,QAAQ,CAAC;IACnB,mBAAmB,EAAE,YAAY,CAAC;IAClC,iBAAiB,EAAE,YAAY,EAAE,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,sCAAsC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,kBAAkB,CAAC,EAAE,YAAY,EAAE,CAAC;IACpC,qCAAqC;IACrC,cAAc,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC5B,+BAA+B;IAC/B,iBAAiB,CAAC,EAAE,YAAY,CAAC;CAClC;AA8DD;;;GAGG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,kBAAkB,CAAoB;IAC9C,OAAO,CAAC,eAAe,CAA6B;gBAExC,kBAAkB,CAAC,EAAE,YAAY,EAAE;IAM/C;;OAEG;IACH,qBAAqB,CAAC,SAAS,EAAE,YAAY,EAAE,GAAG,IAAI;IAItD;;OAEG;IACH,kBAAkB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;IAIhD;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,kBAAkB;IAwFjE;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAY3B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAyB/B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAgCzB;;OAEG;IACH,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO;IAI7C;;OAEG;IACH,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY,EAAE;IAKvD;;OAEG;IACH,mBAAmB,CACjB,QAAQ,EAAE,QAAQ,EAClB,mBAAmB,EAAE,YAAY,GAChC,YAAY,EAAE;CAMlB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,kBAAkB,CAAC,EAAE,YAAY,EAAE,GAAG,cAAc,CAExF;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task Classifier
|
|
3
|
+
* Routes tasks to the most appropriate AI provider based on task type,
|
|
4
|
+
* provider capabilities, and availability.
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) 2025 Dobeu Tech Solutions LLC
|
|
7
|
+
* Licensed under CC BY-NC 4.0
|
|
8
|
+
*/
|
|
9
|
+
import { TASK_ROUTING_RULES, getProviderConfig, } from '../config/provider-config.js';
|
|
10
|
+
/**
|
|
11
|
+
* Keyword patterns for task classification
|
|
12
|
+
*/
|
|
13
|
+
const TASK_PATTERNS = {
|
|
14
|
+
complex_reasoning: {
|
|
15
|
+
keywords: ['analyze', 'design', 'architect', 'evaluate', 'compare', 'decide', 'trade-off', 'strategy'],
|
|
16
|
+
phrases: ['best approach', 'should we', 'pros and cons', 'what if', 'how should'],
|
|
17
|
+
weight: 1.0,
|
|
18
|
+
},
|
|
19
|
+
architectural_decision: {
|
|
20
|
+
keywords: ['architecture', 'structure', 'design', 'pattern', 'refactor', 'reorganize', 'modular'],
|
|
21
|
+
phrases: ['folder structure', 'code organization', 'design pattern', 'system design'],
|
|
22
|
+
weight: 1.0,
|
|
23
|
+
},
|
|
24
|
+
ci_cd_automation: {
|
|
25
|
+
keywords: ['ci', 'cd', 'pipeline', 'deploy', 'github', 'actions', 'workflow', 'build', 'release'],
|
|
26
|
+
phrases: ['github actions', 'ci/cd', 'deployment', 'continuous integration', 'automated testing'],
|
|
27
|
+
weight: 1.0,
|
|
28
|
+
},
|
|
29
|
+
test_execution: {
|
|
30
|
+
keywords: ['test', 'spec', 'coverage', 'jest', 'vitest', 'playwright', 'cypress', 'unit', 'integration', 'e2e'],
|
|
31
|
+
phrases: ['run tests', 'test coverage', 'write tests', 'test suite', 'test file'],
|
|
32
|
+
weight: 0.9,
|
|
33
|
+
},
|
|
34
|
+
research: {
|
|
35
|
+
keywords: ['research', 'investigate', 'explore', 'find', 'search', 'look up', 'learn', 'understand'],
|
|
36
|
+
phrases: ['how does', 'what is', 'find out', 'look into', 'research about'],
|
|
37
|
+
weight: 0.8,
|
|
38
|
+
},
|
|
39
|
+
documentation: {
|
|
40
|
+
keywords: ['document', 'readme', 'docs', 'jsdoc', 'comment', 'explain', 'describe', 'api'],
|
|
41
|
+
phrases: ['write documentation', 'add comments', 'update readme', 'api docs', 'document the'],
|
|
42
|
+
weight: 0.9,
|
|
43
|
+
},
|
|
44
|
+
ide_task: {
|
|
45
|
+
keywords: ['file', 'edit', 'rename', 'move', 'delete', 'create', 'open', 'navigate', 'quick'],
|
|
46
|
+
phrases: ['create file', 'rename file', 'quick edit', 'simple change', 'small fix'],
|
|
47
|
+
weight: 0.7,
|
|
48
|
+
},
|
|
49
|
+
rapid_prototyping: {
|
|
50
|
+
keywords: ['prototype', 'quick', 'poc', 'sketch', 'mock', 'draft', 'experiment', 'try'],
|
|
51
|
+
phrases: ['quick prototype', 'proof of concept', 'try out', 'experiment with'],
|
|
52
|
+
weight: 0.8,
|
|
53
|
+
},
|
|
54
|
+
code_review: {
|
|
55
|
+
keywords: ['review', 'audit', 'check', 'inspect', 'security', 'quality', 'lint', 'analyze'],
|
|
56
|
+
phrases: ['code review', 'security audit', 'review the', 'check the code', 'analyze code'],
|
|
57
|
+
weight: 1.0,
|
|
58
|
+
},
|
|
59
|
+
general: {
|
|
60
|
+
keywords: [],
|
|
61
|
+
phrases: [],
|
|
62
|
+
weight: 0.5,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Task Classifier
|
|
67
|
+
* Analyzes task descriptions and routes to appropriate providers
|
|
68
|
+
*/
|
|
69
|
+
export class TaskClassifier {
|
|
70
|
+
availableProviders;
|
|
71
|
+
defaultProvider = 'anthropic';
|
|
72
|
+
constructor(availableProviders) {
|
|
73
|
+
this.availableProviders = new Set(availableProviders ?? ['anthropic']);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Update available providers
|
|
77
|
+
*/
|
|
78
|
+
setAvailableProviders(providers) {
|
|
79
|
+
this.availableProviders = new Set(providers);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Set default provider
|
|
83
|
+
*/
|
|
84
|
+
setDefaultProvider(provider) {
|
|
85
|
+
this.defaultProvider = provider;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Classify a task and recommend a provider
|
|
89
|
+
*/
|
|
90
|
+
classify(task, context) {
|
|
91
|
+
const normalizedTask = task.toLowerCase();
|
|
92
|
+
const scores = new Map();
|
|
93
|
+
const matchedKeywords = [];
|
|
94
|
+
// Score each task type
|
|
95
|
+
for (const [taskType, patterns] of Object.entries(TASK_PATTERNS)) {
|
|
96
|
+
let score = 0;
|
|
97
|
+
// Check keywords
|
|
98
|
+
for (const keyword of patterns.keywords) {
|
|
99
|
+
if (normalizedTask.includes(keyword)) {
|
|
100
|
+
score += 1;
|
|
101
|
+
matchedKeywords.push(keyword);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Check phrases (weighted higher)
|
|
105
|
+
for (const phrase of patterns.phrases) {
|
|
106
|
+
if (normalizedTask.includes(phrase)) {
|
|
107
|
+
score += 2;
|
|
108
|
+
matchedKeywords.push(phrase);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// Apply weight
|
|
112
|
+
scores.set(taskType, score * patterns.weight);
|
|
113
|
+
}
|
|
114
|
+
// Find best match
|
|
115
|
+
let bestType = 'general';
|
|
116
|
+
let bestScore = 0;
|
|
117
|
+
for (const [taskType, score] of scores.entries()) {
|
|
118
|
+
if (score > bestScore) {
|
|
119
|
+
bestScore = score;
|
|
120
|
+
bestType = taskType;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
// Get routing preference
|
|
124
|
+
const routingPreference = TASK_ROUTING_RULES[bestType];
|
|
125
|
+
// Filter by available providers
|
|
126
|
+
const availableRouting = routingPreference.filter(p => this.availableProviders.has(p));
|
|
127
|
+
// Apply user preference if specified
|
|
128
|
+
let recommendedProvider;
|
|
129
|
+
if (context?.preferredProvider && this.availableProviders.has(context.preferredProvider)) {
|
|
130
|
+
recommendedProvider = context.preferredProvider;
|
|
131
|
+
}
|
|
132
|
+
else if (availableRouting.length > 0) {
|
|
133
|
+
recommendedProvider = availableRouting[0];
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
recommendedProvider = this.defaultProvider;
|
|
137
|
+
}
|
|
138
|
+
// Build fallback list
|
|
139
|
+
const fallbackProviders = availableRouting
|
|
140
|
+
.filter(p => p !== recommendedProvider)
|
|
141
|
+
.slice(0, 3);
|
|
142
|
+
// Calculate confidence
|
|
143
|
+
const confidence = this.calculateConfidence(bestScore, matchedKeywords.length);
|
|
144
|
+
// Get required capabilities for this task type
|
|
145
|
+
const requiredCapabilities = this.getRequiredCapabilities(bestType);
|
|
146
|
+
// Generate reasoning
|
|
147
|
+
const reasoning = this.generateReasoning(bestType, recommendedProvider, matchedKeywords, confidence);
|
|
148
|
+
return {
|
|
149
|
+
taskType: bestType,
|
|
150
|
+
recommendedProvider,
|
|
151
|
+
fallbackProviders,
|
|
152
|
+
confidence,
|
|
153
|
+
reasoning,
|
|
154
|
+
requiredCapabilities,
|
|
155
|
+
keywords: [...new Set(matchedKeywords)],
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Calculate classification confidence (0-1)
|
|
160
|
+
*/
|
|
161
|
+
calculateConfidence(score, keywordCount) {
|
|
162
|
+
if (score === 0)
|
|
163
|
+
return 0.5; // Default confidence for general tasks
|
|
164
|
+
// Base confidence from score
|
|
165
|
+
const baseConfidence = Math.min(score / 5, 1);
|
|
166
|
+
// Bonus for multiple keyword matches
|
|
167
|
+
const keywordBonus = Math.min(keywordCount * 0.1, 0.3);
|
|
168
|
+
return Math.min(baseConfidence + keywordBonus, 1);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Get required capabilities for a task type
|
|
172
|
+
*/
|
|
173
|
+
getRequiredCapabilities(taskType) {
|
|
174
|
+
switch (taskType) {
|
|
175
|
+
case 'complex_reasoning':
|
|
176
|
+
return ['reasoning', 'tool_use'];
|
|
177
|
+
case 'architectural_decision':
|
|
178
|
+
return ['reasoning', 'tool_use'];
|
|
179
|
+
case 'ci_cd_automation':
|
|
180
|
+
return ['tool_use', 'codeExecution'];
|
|
181
|
+
case 'test_execution':
|
|
182
|
+
return ['tool_use', 'codeExecution'];
|
|
183
|
+
case 'research':
|
|
184
|
+
return ['reasoning'];
|
|
185
|
+
case 'documentation':
|
|
186
|
+
return ['reasoning'];
|
|
187
|
+
case 'ide_task':
|
|
188
|
+
return ['tool_use'];
|
|
189
|
+
case 'rapid_prototyping':
|
|
190
|
+
return ['tool_use', 'codeExecution'];
|
|
191
|
+
case 'code_review':
|
|
192
|
+
return ['reasoning', 'tool_use'];
|
|
193
|
+
default:
|
|
194
|
+
return ['tool_use'];
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Generate human-readable reasoning for the classification
|
|
199
|
+
*/
|
|
200
|
+
generateReasoning(taskType, provider, keywords, confidence) {
|
|
201
|
+
const providerConfig = getProviderConfig(provider);
|
|
202
|
+
const taskDescriptions = {
|
|
203
|
+
complex_reasoning: 'complex reasoning and analysis',
|
|
204
|
+
architectural_decision: 'architectural design and decisions',
|
|
205
|
+
ci_cd_automation: 'CI/CD and deployment automation',
|
|
206
|
+
test_execution: 'test execution and coverage',
|
|
207
|
+
research: 'research and investigation',
|
|
208
|
+
documentation: 'documentation and explanation',
|
|
209
|
+
ide_task: 'quick file operations',
|
|
210
|
+
rapid_prototyping: 'rapid prototyping and experimentation',
|
|
211
|
+
code_review: 'code review and quality analysis',
|
|
212
|
+
general: 'general development tasks',
|
|
213
|
+
};
|
|
214
|
+
let reasoning = `Task classified as "${taskType}" (${taskDescriptions[taskType]})`;
|
|
215
|
+
if (keywords.length > 0) {
|
|
216
|
+
reasoning += ` based on keywords: ${keywords.slice(0, 3).join(', ')}`;
|
|
217
|
+
}
|
|
218
|
+
reasoning += `. Recommended provider: ${providerConfig.displayName}`;
|
|
219
|
+
reasoning += ` (confidence: ${Math.round(confidence * 100)}%)`;
|
|
220
|
+
return reasoning;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Check if a task should trigger multi-agent review
|
|
224
|
+
*/
|
|
225
|
+
isMultiAgentTask(taskType) {
|
|
226
|
+
return taskType === 'code_review';
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Get providers suitable for a task type (ordered by preference)
|
|
230
|
+
*/
|
|
231
|
+
getProvidersForTask(taskType) {
|
|
232
|
+
const routing = TASK_ROUTING_RULES[taskType];
|
|
233
|
+
return routing.filter(p => this.availableProviders.has(p));
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Suggest alternative providers if primary is unavailable
|
|
237
|
+
*/
|
|
238
|
+
suggestAlternatives(taskType, unavailableProvider) {
|
|
239
|
+
const routing = TASK_ROUTING_RULES[taskType];
|
|
240
|
+
return routing.filter(p => p !== unavailableProvider && this.availableProviders.has(p));
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Create a task classifier with available providers
|
|
245
|
+
*/
|
|
246
|
+
export function createTaskClassifier(availableProviders) {
|
|
247
|
+
return new TaskClassifier(availableProviders);
|
|
248
|
+
}
|
|
249
|
+
export default TaskClassifier;
|
|
250
|
+
//# sourceMappingURL=task-classifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-classifier.js","sourceRoot":"","sources":["../../src/orchestrator/task-classifier.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAGL,kBAAkB,EAElB,iBAAiB,GAClB,MAAM,8BAA8B,CAAC;AA+BtC;;GAEG;AACH,MAAM,aAAa,GAId;IACH,iBAAiB,EAAE;QACjB,QAAQ,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAC;QACtG,OAAO,EAAE,CAAC,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,CAAC;QACjF,MAAM,EAAE,GAAG;KACZ;IACD,sBAAsB,EAAE;QACtB,QAAQ,EAAE,CAAC,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY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BAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED;;OAEG;IACH,mBAAmB,CACjB,QAAkB,EAClB,mBAAiC;QAEjC,MAAM,OAAO,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CACxB,CAAC,KAAK,mBAAmB,IAAI,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,CAC5D,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,kBAAmC;IACtE,OAAO,IAAI,cAAc,CAAC,kBAAkB,CAAC,CAAC;AAChD,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anthropic Provider
|
|
3
|
+
* Wrapper around Claude Agent SDK for multi-provider orchestration.
|
|
4
|
+
* Maintains full backwards compatibility with existing implementation.
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) 2025 Dobeu Tech Solutions LLC
|
|
7
|
+
* Licensed under CC BY-NC 4.0
|
|
8
|
+
*/
|
|
9
|
+
import { BaseProvider, type AgentMessage, type QueryOptions, type ProviderCapabilities, type ModelInfo } from './base-provider.js';
|
|
10
|
+
import { type ProviderName } from '../config/provider-config.js';
|
|
11
|
+
/**
|
|
12
|
+
* Anthropic Provider Implementation
|
|
13
|
+
* Wraps the Claude Agent SDK for use in multi-provider orchestration
|
|
14
|
+
*/
|
|
15
|
+
export declare class AnthropicProvider extends BaseProvider {
|
|
16
|
+
readonly name: ProviderName;
|
|
17
|
+
readonly displayName = "Claude (Anthropic)";
|
|
18
|
+
readonly packageName = "@anthropic-ai/claude-agent-sdk";
|
|
19
|
+
private config;
|
|
20
|
+
private apiKey;
|
|
21
|
+
constructor(apiKey?: string);
|
|
22
|
+
/**
|
|
23
|
+
* Execute a query using the Claude Agent SDK
|
|
24
|
+
*/
|
|
25
|
+
query(prompt: string, options: QueryOptions): AsyncGenerator<AgentMessage, void, unknown>;
|
|
26
|
+
/**
|
|
27
|
+
* Validate Anthropic API credentials
|
|
28
|
+
*/
|
|
29
|
+
validateCredentials(): Promise<boolean>;
|
|
30
|
+
/**
|
|
31
|
+
* List available Claude models
|
|
32
|
+
*/
|
|
33
|
+
listModels(): Promise<ModelInfo[]>;
|
|
34
|
+
/**
|
|
35
|
+
* Get Anthropic provider capabilities
|
|
36
|
+
*/
|
|
37
|
+
getCapabilities(): ProviderCapabilities;
|
|
38
|
+
/**
|
|
39
|
+
* Get list of supported standard tools
|
|
40
|
+
*/
|
|
41
|
+
getSupportedTools(): string[];
|
|
42
|
+
/**
|
|
43
|
+
* Map standard tool name to Anthropic tool name
|
|
44
|
+
*/
|
|
45
|
+
mapToolName(standardTool: string): string | null;
|
|
46
|
+
/**
|
|
47
|
+
* Normalize Claude SDK message to standard format
|
|
48
|
+
*/
|
|
49
|
+
protected normalizeMessage(rawMessage: unknown): AgentMessage;
|
|
50
|
+
/**
|
|
51
|
+
* Set API key at runtime
|
|
52
|
+
*/
|
|
53
|
+
setApiKey(key: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* Get the current API key (masked for display)
|
|
56
|
+
*/
|
|
57
|
+
getApiKeyPreview(): string | null;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Create a new Anthropic provider instance
|
|
61
|
+
*/
|
|
62
|
+
export declare function createAnthropicProvider(apiKey?: string): AnthropicProvider;
|
|
63
|
+
export default AnthropicProvider;
|
|
64
|
+
//# sourceMappingURL=anthropic-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic-provider.d.ts","sourceRoot":"","sources":["../../src/providers/anthropic-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,SAAS,EAEf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,8BAA8B,CAAC;AA2BtC;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,YAAY;IACjD,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAe;IAC1C,QAAQ,CAAC,WAAW,wBAAwB;IAC5C,QAAQ,CAAC,WAAW,oCAAoC;IAExD,OAAO,CAAC,MAAM,CAA8B;IAC5C,OAAO,CAAC,MAAM,CAAuB;gBAEzB,MAAM,CAAC,EAAE,MAAM;IAO3B;;OAEG;IACI,KAAK,CACV,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,YAAY,GACpB,cAAc,CAAC,YAAY,EAAE,IAAI,EAAE,OAAO,CAAC;IA2D9C;;OAEG;IACG,mBAAmB,IAAI,OAAO,CAAC,OAAO,CAAC;IAmC7C;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IAUxC;;OAEG;IACH,eAAe,IAAI,oBAAoB;IAIvC;;OAEG;IACH,iBAAiB,IAAI,MAAM,EAAE;IAM7B;;OAEG;IACH,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAKhD;;OAEG;IACH,SAAS,CAAC,gBAAgB,CAAC,UAAU,EAAE,OAAO,GAAG,YAAY;IA2F7D;;OAEG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAM5B;;OAEG;IACH,gBAAgB,IAAI,MAAM,GAAG,IAAI;CAIlC;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAE1E;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anthropic Provider
|
|
3
|
+
* Wrapper around Claude Agent SDK for multi-provider orchestration.
|
|
4
|
+
* Maintains full backwards compatibility with existing implementation.
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) 2025 Dobeu Tech Solutions LLC
|
|
7
|
+
* Licensed under CC BY-NC 4.0
|
|
8
|
+
*/
|
|
9
|
+
import { query } from '@anthropic-ai/claude-agent-sdk';
|
|
10
|
+
import { BaseProvider, } from './base-provider.js';
|
|
11
|
+
import { PROVIDER_CONFIGS, } from '../config/provider-config.js';
|
|
12
|
+
/**
|
|
13
|
+
* Anthropic Provider Implementation
|
|
14
|
+
* Wraps the Claude Agent SDK for use in multi-provider orchestration
|
|
15
|
+
*/
|
|
16
|
+
export class AnthropicProvider extends BaseProvider {
|
|
17
|
+
name = 'anthropic';
|
|
18
|
+
displayName = 'Claude (Anthropic)';
|
|
19
|
+
packageName = '@anthropic-ai/claude-agent-sdk';
|
|
20
|
+
config = PROVIDER_CONFIGS.anthropic;
|
|
21
|
+
apiKey = null;
|
|
22
|
+
constructor(apiKey) {
|
|
23
|
+
super();
|
|
24
|
+
this.apiKey = apiKey ?? process.env.ANTHROPIC_API_KEY ?? null;
|
|
25
|
+
this.status.authenticated = !!this.apiKey;
|
|
26
|
+
this.status.available = this.status.authenticated;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Execute a query using the Claude Agent SDK
|
|
30
|
+
*/
|
|
31
|
+
async *query(prompt, options) {
|
|
32
|
+
const startTime = Date.now();
|
|
33
|
+
try {
|
|
34
|
+
// Map standard tools to Anthropic tool names
|
|
35
|
+
const allowedTools = options.tools
|
|
36
|
+
? this.filterSupportedTools(options.tools)
|
|
37
|
+
: undefined;
|
|
38
|
+
// Build SDK options
|
|
39
|
+
const sdkOptions = {
|
|
40
|
+
allowedTools,
|
|
41
|
+
permissionMode: options.permissionMode ?? 'acceptEdits',
|
|
42
|
+
};
|
|
43
|
+
// Pass API key via environment
|
|
44
|
+
if (this.apiKey) {
|
|
45
|
+
sdkOptions.env = {
|
|
46
|
+
ANTHROPIC_API_KEY: this.apiKey,
|
|
47
|
+
...options.env,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
// Execute query
|
|
51
|
+
for await (const rawMessage of query({
|
|
52
|
+
prompt,
|
|
53
|
+
options: sdkOptions,
|
|
54
|
+
})) {
|
|
55
|
+
const message = this.normalizeMessage(rawMessage);
|
|
56
|
+
message.metadata = {
|
|
57
|
+
...message.metadata,
|
|
58
|
+
provider: this.name,
|
|
59
|
+
latency_ms: Date.now() - startTime,
|
|
60
|
+
};
|
|
61
|
+
yield message;
|
|
62
|
+
// Update status on result
|
|
63
|
+
if (message.type === 'result') {
|
|
64
|
+
this.updateStatus(message.subtype === 'success');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
70
|
+
this.updateStatus(false, errorMessage);
|
|
71
|
+
yield {
|
|
72
|
+
type: 'error',
|
|
73
|
+
content: [{
|
|
74
|
+
type: 'text',
|
|
75
|
+
text: `Anthropic provider error: ${errorMessage}`,
|
|
76
|
+
}],
|
|
77
|
+
metadata: {
|
|
78
|
+
provider: this.name,
|
|
79
|
+
latency_ms: Date.now() - startTime,
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Validate Anthropic API credentials
|
|
86
|
+
*/
|
|
87
|
+
async validateCredentials() {
|
|
88
|
+
const key = this.apiKey ?? process.env.ANTHROPIC_API_KEY;
|
|
89
|
+
if (!key) {
|
|
90
|
+
this.status.authenticated = false;
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
// Make a minimal API request to validate the key
|
|
95
|
+
const response = await fetch('https://api.anthropic.com/v1/messages', {
|
|
96
|
+
method: 'POST',
|
|
97
|
+
headers: {
|
|
98
|
+
'Content-Type': 'application/json',
|
|
99
|
+
'x-api-key': key,
|
|
100
|
+
'anthropic-version': '2023-06-01',
|
|
101
|
+
},
|
|
102
|
+
body: JSON.stringify({
|
|
103
|
+
model: 'claude-3-haiku-20240307',
|
|
104
|
+
max_tokens: 1,
|
|
105
|
+
messages: [{ role: 'user', content: 'hi' }],
|
|
106
|
+
}),
|
|
107
|
+
});
|
|
108
|
+
// 200 = valid, 401 = invalid key, 400 = valid key but bad request (still valid)
|
|
109
|
+
const isValid = response.status === 200 || response.status === 400;
|
|
110
|
+
this.status.authenticated = isValid;
|
|
111
|
+
this.status.available = isValid;
|
|
112
|
+
return isValid;
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
// Network error - assume key might be valid
|
|
116
|
+
console.warn('Could not validate Anthropic key online');
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* List available Claude models
|
|
122
|
+
*/
|
|
123
|
+
async listModels() {
|
|
124
|
+
return this.config.models.map(model => ({
|
|
125
|
+
id: model.id,
|
|
126
|
+
name: model.name,
|
|
127
|
+
contextWindow: model.contextWindow,
|
|
128
|
+
costPerMToken: model.costPerMToken,
|
|
129
|
+
capabilities: model.capabilities,
|
|
130
|
+
}));
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Get Anthropic provider capabilities
|
|
134
|
+
*/
|
|
135
|
+
getCapabilities() {
|
|
136
|
+
return { ...this.config.capabilities };
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Get list of supported standard tools
|
|
140
|
+
*/
|
|
141
|
+
getSupportedTools() {
|
|
142
|
+
return Object.entries(this.config.toolMapping)
|
|
143
|
+
.filter(([_, mapped]) => mapped !== null)
|
|
144
|
+
.map(([standard]) => standard);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Map standard tool name to Anthropic tool name
|
|
148
|
+
*/
|
|
149
|
+
mapToolName(standardTool) {
|
|
150
|
+
const mapped = this.config.toolMapping[standardTool];
|
|
151
|
+
return mapped ?? null;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Normalize Claude SDK message to standard format
|
|
155
|
+
*/
|
|
156
|
+
normalizeMessage(rawMessage) {
|
|
157
|
+
const sdkMessage = rawMessage;
|
|
158
|
+
// Handle result messages
|
|
159
|
+
if (sdkMessage.type === 'result') {
|
|
160
|
+
return {
|
|
161
|
+
type: 'result',
|
|
162
|
+
subtype: sdkMessage.subtype,
|
|
163
|
+
content: [],
|
|
164
|
+
metadata: {
|
|
165
|
+
provider: this.name,
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
// Handle assistant messages
|
|
170
|
+
if (sdkMessage.type === 'assistant' && sdkMessage.message?.content) {
|
|
171
|
+
const content = sdkMessage.message.content.map(block => {
|
|
172
|
+
if (block.text !== undefined) {
|
|
173
|
+
return {
|
|
174
|
+
type: 'text',
|
|
175
|
+
text: block.text,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
if (block.name !== undefined) {
|
|
179
|
+
return {
|
|
180
|
+
type: 'tool_use',
|
|
181
|
+
id: block.id ?? `tool_${Date.now()}`,
|
|
182
|
+
name: block.name,
|
|
183
|
+
input: block.input ?? {},
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
if (block.tool_use_id !== undefined) {
|
|
187
|
+
return {
|
|
188
|
+
type: 'tool_result',
|
|
189
|
+
tool_use_id: block.tool_use_id,
|
|
190
|
+
content: block.content ?? '',
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
// Default to text block for unknown types
|
|
194
|
+
return {
|
|
195
|
+
type: 'text',
|
|
196
|
+
text: JSON.stringify(block),
|
|
197
|
+
};
|
|
198
|
+
});
|
|
199
|
+
return {
|
|
200
|
+
type: 'assistant',
|
|
201
|
+
content,
|
|
202
|
+
metadata: {
|
|
203
|
+
provider: this.name,
|
|
204
|
+
usage: sdkMessage.message.usage,
|
|
205
|
+
},
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
// Handle tool_use messages
|
|
209
|
+
if (sdkMessage.type === 'tool_use') {
|
|
210
|
+
return {
|
|
211
|
+
type: 'tool_use',
|
|
212
|
+
content: [],
|
|
213
|
+
metadata: {
|
|
214
|
+
provider: this.name,
|
|
215
|
+
},
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
// Handle tool_result messages
|
|
219
|
+
if (sdkMessage.type === 'tool_result') {
|
|
220
|
+
return {
|
|
221
|
+
type: 'tool_result',
|
|
222
|
+
content: [],
|
|
223
|
+
metadata: {
|
|
224
|
+
provider: this.name,
|
|
225
|
+
},
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
// Default fallback
|
|
229
|
+
return {
|
|
230
|
+
type: 'assistant',
|
|
231
|
+
content: [{
|
|
232
|
+
type: 'text',
|
|
233
|
+
text: JSON.stringify(rawMessage),
|
|
234
|
+
}],
|
|
235
|
+
metadata: {
|
|
236
|
+
provider: this.name,
|
|
237
|
+
},
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Set API key at runtime
|
|
242
|
+
*/
|
|
243
|
+
setApiKey(key) {
|
|
244
|
+
this.apiKey = key;
|
|
245
|
+
this.status.authenticated = true;
|
|
246
|
+
this.status.available = true;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Get the current API key (masked for display)
|
|
250
|
+
*/
|
|
251
|
+
getApiKeyPreview() {
|
|
252
|
+
if (!this.apiKey)
|
|
253
|
+
return null;
|
|
254
|
+
return `${this.apiKey.slice(0, 8)}...${this.apiKey.slice(-4)}`;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Create a new Anthropic provider instance
|
|
259
|
+
*/
|
|
260
|
+
export function createAnthropicProvider(apiKey) {
|
|
261
|
+
return new AnthropicProvider(apiKey);
|
|
262
|
+
}
|
|
263
|
+
export default AnthropicProvider;
|
|
264
|
+
//# sourceMappingURL=anthropic-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic-provider.js","sourceRoot":"","sources":["../../src/provid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