@vfarcic/dot-ai 0.124.0 → 0.125.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/assets/project-setup/templates/.github/CODEOWNERS.hbs +25 -0
- package/assets/project-setup/templates/.github/FUNDING.yml.hbs +35 -0
- package/assets/project-setup/templates/.github/ISSUE_TEMPLATE/bug_report.yml.hbs +175 -0
- package/assets/project-setup/templates/.github/ISSUE_TEMPLATE/config.yml.hbs +32 -0
- package/assets/project-setup/templates/.github/ISSUE_TEMPLATE/feature_request.yml.hbs +134 -0
- package/assets/project-setup/templates/.github/PULL_REQUEST_TEMPLATE.md.hbs +172 -0
- package/assets/project-setup/templates/.github/labeler.yml.hbs +123 -0
- package/assets/project-setup/templates/.github/release.yml.hbs +51 -0
- package/assets/project-setup/templates/.github/workflows/labeler.yml.hbs +21 -0
- package/assets/project-setup/templates/.github/workflows/scorecard.yml.hbs +71 -0
- package/assets/project-setup/templates/.github/workflows/stale.yml.hbs +57 -0
- package/dist/core/ai-provider-factory.d.ts.map +1 -1
- package/dist/core/ai-provider-factory.js +22 -5
- package/dist/core/ai-provider.interface.d.ts +16 -0
- package/dist/core/ai-provider.interface.d.ts.map +1 -1
- package/dist/core/capability-scan-workflow.d.ts.map +1 -1
- package/dist/core/capability-scan-workflow.js +1 -2
- package/dist/core/discovery.d.ts +6 -0
- package/dist/core/discovery.d.ts.map +1 -1
- package/dist/core/discovery.js +35 -0
- package/dist/core/embedding-service.d.ts.map +1 -1
- package/dist/core/embedding-service.js +9 -2
- package/dist/core/model-config.d.ts +2 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +3 -1
- package/dist/core/providers/provider-debug-utils.d.ts +4 -0
- package/dist/core/providers/provider-debug-utils.d.ts.map +1 -1
- package/dist/core/providers/provider-debug-utils.js +25 -3
- package/dist/core/providers/vercel-provider.d.ts +1 -0
- package/dist/core/providers/vercel-provider.d.ts.map +1 -1
- package/dist/core/providers/vercel-provider.js +35 -6
- package/dist/core/unified-creation-session.js +1 -1
- package/package.json +3 -1
|
@@ -14,6 +14,7 @@ const anthropic_1 = require("@ai-sdk/anthropic");
|
|
|
14
14
|
const xai_1 = require("@ai-sdk/xai");
|
|
15
15
|
const mistral_1 = require("@ai-sdk/mistral");
|
|
16
16
|
const deepseek_1 = require("@ai-sdk/deepseek");
|
|
17
|
+
const ai_sdk_provider_1 = require("@openrouter/ai-sdk-provider");
|
|
17
18
|
const provider_debug_utils_1 = require("./provider-debug-utils");
|
|
18
19
|
const model_config_1 = require("../model-config");
|
|
19
20
|
// Get all supported provider keys dynamically from CURRENT_MODELS
|
|
@@ -23,12 +24,14 @@ class VercelProvider {
|
|
|
23
24
|
model;
|
|
24
25
|
apiKey;
|
|
25
26
|
debugMode;
|
|
27
|
+
baseURL; // PRD #194: Custom endpoint URL for OpenAI-compatible APIs
|
|
26
28
|
modelInstance; // Vercel AI SDK model instance
|
|
27
29
|
constructor(config) {
|
|
28
30
|
this.apiKey = config.apiKey;
|
|
29
31
|
this.providerType = config.provider;
|
|
30
32
|
this.model = config.model || this.getDefaultModel();
|
|
31
33
|
this.debugMode = config.debugMode ?? (process.env.DEBUG_DOT_AI === 'true');
|
|
34
|
+
this.baseURL = config.baseURL; // PRD #194: Store custom endpoint URL
|
|
32
35
|
this.validateConfiguration();
|
|
33
36
|
this.initializeModel();
|
|
34
37
|
}
|
|
@@ -46,7 +49,9 @@ class VercelProvider {
|
|
|
46
49
|
switch (this.providerType) {
|
|
47
50
|
case 'openai':
|
|
48
51
|
case 'openai_pro':
|
|
49
|
-
provider = (0, openai_1.createOpenAI)({
|
|
52
|
+
provider = (0, openai_1.createOpenAI)({
|
|
53
|
+
apiKey: this.apiKey
|
|
54
|
+
});
|
|
50
55
|
break;
|
|
51
56
|
case 'google':
|
|
52
57
|
case 'google_fast':
|
|
@@ -71,7 +76,27 @@ class VercelProvider {
|
|
|
71
76
|
provider = (0, mistral_1.createMistral)({ apiKey: this.apiKey });
|
|
72
77
|
break;
|
|
73
78
|
case 'deepseek':
|
|
74
|
-
provider = (0, deepseek_1.createDeepSeek)({
|
|
79
|
+
provider = (0, deepseek_1.createDeepSeek)({
|
|
80
|
+
apiKey: this.apiKey
|
|
81
|
+
});
|
|
82
|
+
break;
|
|
83
|
+
case 'openrouter':
|
|
84
|
+
// PRD #194: OpenRouter custom endpoint support
|
|
85
|
+
// Use dedicated OpenRouter provider for proper format conversion
|
|
86
|
+
provider = (0, ai_sdk_provider_1.createOpenRouter)({
|
|
87
|
+
apiKey: this.apiKey
|
|
88
|
+
});
|
|
89
|
+
break;
|
|
90
|
+
case 'custom':
|
|
91
|
+
// PRD #194: Generic custom endpoint support for OpenAI-compatible APIs
|
|
92
|
+
// For non-OpenRouter custom endpoints (Ollama, vLLM, LiteLLM, etc.)
|
|
93
|
+
if (!this.baseURL) {
|
|
94
|
+
throw new Error('Custom endpoint requires CUSTOM_LLM_BASE_URL to be set');
|
|
95
|
+
}
|
|
96
|
+
provider = (0, openai_1.createOpenAI)({
|
|
97
|
+
apiKey: this.apiKey,
|
|
98
|
+
baseURL: this.baseURL
|
|
99
|
+
});
|
|
75
100
|
break;
|
|
76
101
|
default:
|
|
77
102
|
throw new Error(`Cannot initialize model for provider: ${this.providerType}`);
|
|
@@ -115,11 +140,10 @@ class VercelProvider {
|
|
|
115
140
|
const startTime = Date.now();
|
|
116
141
|
try {
|
|
117
142
|
// Use Vercel AI SDK generateText
|
|
118
|
-
//
|
|
143
|
+
// Note: maxOutputTokens not specified - provider will use model's natural maximum
|
|
119
144
|
const result = await (0, ai_1.generateText)({
|
|
120
145
|
model: this.modelInstance,
|
|
121
146
|
prompt: message,
|
|
122
|
-
maxOutputTokens: 8192, // Increased from default 4096 to support longer responses
|
|
123
147
|
});
|
|
124
148
|
const response = {
|
|
125
149
|
content: result.text,
|
|
@@ -165,6 +189,11 @@ class VercelProvider {
|
|
|
165
189
|
return response;
|
|
166
190
|
}
|
|
167
191
|
catch (error) {
|
|
192
|
+
// Log the prompt that caused the error for debugging
|
|
193
|
+
if (this.debugMode) {
|
|
194
|
+
const debugId = (0, provider_debug_utils_1.generateDebugId)(operation);
|
|
195
|
+
(0, provider_debug_utils_1.debugLogPromptOnly)(debugId, message, operation, this.getProviderType(), this.model, this.debugMode);
|
|
196
|
+
}
|
|
168
197
|
// Generate dataset for failed AI interaction
|
|
169
198
|
if (this.debugMode && evaluationContext) {
|
|
170
199
|
const failureMetrics = {
|
|
@@ -284,12 +313,12 @@ class VercelProvider {
|
|
|
284
313
|
try {
|
|
285
314
|
// Use Vercel AI SDK's generateText with stopWhen for automatic loop
|
|
286
315
|
// Default is stepCountIs(1) - we need to increase for multi-step investigation
|
|
316
|
+
// Note: maxOutputTokens not specified - provider will use model's natural maximum
|
|
287
317
|
const generateConfig = {
|
|
288
318
|
model: this.modelInstance,
|
|
289
319
|
messages,
|
|
290
320
|
tools,
|
|
291
|
-
stopWhen: (0, ai_1.stepCountIs)(maxIterations)
|
|
292
|
-
maxOutputTokens: 8192 // Increased from default 4096 to support longer responses
|
|
321
|
+
stopWhen: (0, ai_1.stepCountIs)(maxIterations)
|
|
293
322
|
};
|
|
294
323
|
// Add system parameter for non-Anthropic providers
|
|
295
324
|
if (systemParam) {
|
|
@@ -833,7 +833,7 @@ Please try again or modify your policy description.`,
|
|
|
833
833
|
const capabilityService = new capability_vector_service_1.CapabilityVectorService(collection);
|
|
834
834
|
// Use existing searchCapabilities function - no fallback, let it throw if it fails
|
|
835
835
|
const searchResults = await capabilityService.searchCapabilities(searchQuery, {
|
|
836
|
-
limit:
|
|
836
|
+
limit: 30 // Reduced from 50 to stay within 200K token context limit (testing shows 35 still exceeds)
|
|
837
837
|
});
|
|
838
838
|
if (searchResults.length === 0) {
|
|
839
839
|
throw new Error(`No relevant capabilities found for policy description: "${policyDescription}"`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vfarcic/dot-ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.125.0",
|
|
4
4
|
"description": "AI-powered development productivity platform that enhances software development workflows through intelligent automation and AI-driven assistance",
|
|
5
5
|
"mcpName": "io.github.vfarcic/dot-ai",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"test:integration:grok-fast": "AI_PROVIDER=xai_fast AI_PROVIDER_SDK=vercel DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
|
|
29
29
|
"test:integration:mistral": "AI_PROVIDER=mistral AI_PROVIDER_SDK=vercel DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
|
|
30
30
|
"test:integration:deepseek": "AI_PROVIDER=deepseek AI_PROVIDER_SDK=vercel DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
|
|
31
|
+
"test:integration:custom-endpoint": "AI_PROVIDER=openai AI_PROVIDER_SDK=vercel DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
|
|
31
32
|
"eval:comparative": "DEBUG_DOT_AI=true npx tsx src/evaluation/eval-runner.ts",
|
|
32
33
|
"eval:platform-synthesis": "DEBUG_DOT_AI=true npx tsx src/evaluation/run-platform-synthesis.ts",
|
|
33
34
|
"clean": "rm -rf dist",
|
|
@@ -104,6 +105,7 @@
|
|
|
104
105
|
"@anthropic-ai/sdk": "^0.65.0",
|
|
105
106
|
"@kubernetes/client-node": "^1.3.0",
|
|
106
107
|
"@modelcontextprotocol/sdk": "^1.13.2",
|
|
108
|
+
"@openrouter/ai-sdk-provider": "^1.2.0",
|
|
107
109
|
"@qdrant/js-client-rest": "^1.15.0",
|
|
108
110
|
"ai": "^5.0.60",
|
|
109
111
|
"glob": "^11.0.3",
|