@vfarcic/dot-ai 0.142.0 → 0.143.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.
@@ -1 +1 @@
1
- {"version":3,"file":"ai-provider-factory.d.ts","sourceRoot":"","sources":["../../src/core/ai-provider-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,UAAU,EACV,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AA+BjC;;;;;;;;;;;;;;GAcG;AACH,qBAAa,iBAAiB;IAC5B;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,UAAU;IAgCnD;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,aAAa,IAAI,UAAU;IA0FlC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAItC;;;;;OAKG;IACH,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAMrD;;;;OAIG;IACH,MAAM,CAAC,qBAAqB,IAAI,MAAM,EAAE;IAMxC;;;;;OAKG;IACH,MAAM,CAAC,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;CAGxD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,UAAU,CAE7C"}
1
+ {"version":3,"file":"ai-provider-factory.d.ts","sourceRoot":"","sources":["../../src/core/ai-provider-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,UAAU,EACV,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AA4BjC;;;;;;;;;;;;;;GAcG;AACH,qBAAa,iBAAiB;IAC5B;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,UAAU;IAiCnD;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,aAAa,IAAI,UAAU;IA0FlC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAItC;;;;;OAKG;IACH,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAMrD;;;;OAIG;IACH,MAAM,CAAC,qBAAqB,IAAI,MAAM,EAAE;IAMxC;;;;;OAKG;IACH,MAAM,CAAC,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;CAGxD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,UAAU,CAE7C"}
@@ -18,19 +18,16 @@ const model_config_1 = require("./model-config");
18
18
  /**
19
19
  * Provider environment variable mappings
20
20
  * Phase 1 (PRD 73): anthropic, openai, google
21
- * Phase 2 (PRD 154): openai_pro for GPT-5 Pro
22
21
  */
23
22
  const PROVIDER_ENV_KEYS = {
24
23
  anthropic: 'ANTHROPIC_API_KEY',
24
+ anthropic_opus: 'ANTHROPIC_API_KEY', // Uses same API key as regular Anthropic
25
25
  anthropic_haiku: 'ANTHROPIC_API_KEY', // Uses same API key as regular Anthropic
26
26
  openai: 'OPENAI_API_KEY',
27
- openai_pro: 'OPENAI_API_KEY', // Uses same API key as regular OpenAI
28
27
  google: 'GOOGLE_API_KEY',
29
- google_fast: 'GOOGLE_API_KEY', // Uses same API key as regular Google
28
+ kimi: 'MOONSHOT_API_KEY', // PRD #237: Moonshot AI Kimi K2
29
+ kimi_thinking: 'MOONSHOT_API_KEY', // PRD #237: Uses same API key as regular Kimi
30
30
  xai: 'XAI_API_KEY',
31
- xai_fast: 'XAI_API_KEY', // Uses same API key as regular xAI
32
- mistral: 'MISTRAL_API_KEY',
33
- deepseek: 'DEEPSEEK_API_KEY',
34
31
  };
35
32
  const IMPLEMENTED_PROVIDERS = Object.keys(model_config_1.CURRENT_MODELS);
36
33
  /**
@@ -73,6 +70,7 @@ class AIProviderFactory {
73
70
  // Create provider based on type
74
71
  switch (config.provider) {
75
72
  case 'anthropic':
73
+ case 'anthropic_opus':
76
74
  case 'anthropic_haiku':
77
75
  return this.createAnthropicProvider(config);
78
76
  default:
@@ -8,7 +8,7 @@
8
8
  * across the codebase, ensuring backward compatibility and minimal migration effort.
9
9
  *
10
10
  * Phase 1 Implementation (PRD 73): Anthropic, OpenAI, Google
11
- * Future: AWS Bedrock, Mistral, Groq, Ollama, etc.
11
+ * Additional: AWS Bedrock, xAI Grok, OpenRouter, Custom endpoints
12
12
  */
13
13
  /**
14
14
  * Standard AI response structure
@@ -216,7 +216,7 @@ export interface AIProvider {
216
216
  /**
217
217
  * Get the current model name being used
218
218
  *
219
- * @returns Model name (e.g., 'grok-4-fast-reasoning', 'claude-3-5-sonnet-20241022')
219
+ * @returns Model name (e.g., 'grok-4', 'claude-sonnet-4-5-20250929')
220
220
  */
221
221
  getModelName(): string;
222
222
  /**
@@ -9,6 +9,6 @@
9
9
  * across the codebase, ensuring backward compatibility and minimal migration effort.
10
10
  *
11
11
  * Phase 1 Implementation (PRD 73): Anthropic, OpenAI, Google
12
- * Future: AWS Bedrock, Mistral, Groq, Ollama, etc.
12
+ * Additional: AWS Bedrock, xAI Grok, OpenRouter, Custom endpoints
13
13
  */
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -4,8 +4,13 @@
4
4
  * Optional semantic search enhancement for pattern matching.
5
5
  * Gracefully falls back to keyword-only search when embedding providers are not available.
6
6
  */
7
+ /**
8
+ * Supported embedding providers - single source of truth
9
+ */
10
+ export declare const EMBEDDING_PROVIDERS: readonly ["openai", "google", "amazon_bedrock"];
11
+ export type EmbeddingProviderType = typeof EMBEDDING_PROVIDERS[number];
7
12
  export interface EmbeddingConfig {
8
- provider?: 'openai' | 'google' | 'mistral' | 'amazon_bedrock';
13
+ provider?: EmbeddingProviderType;
9
14
  apiKey?: string;
10
15
  model?: string;
11
16
  dimensions?: number;
@@ -19,7 +24,7 @@ export interface EmbeddingProvider {
19
24
  }
20
25
  /**
21
26
  * Unified Vercel AI SDK Embedding Provider
22
- * Supports OpenAI, Google, Mistral, and Amazon Bedrock through Vercel AI SDK
27
+ * Supports OpenAI, Google, and Amazon Bedrock through Vercel AI SDK
23
28
  */
24
29
  export declare class VercelEmbeddingProvider implements EmbeddingProvider {
25
30
  private providerType;
@@ -29,7 +34,7 @@ export declare class VercelEmbeddingProvider implements EmbeddingProvider {
29
34
  private available;
30
35
  private modelInstance;
31
36
  constructor(config: EmbeddingConfig & {
32
- provider: 'openai' | 'google' | 'mistral' | 'amazon_bedrock';
37
+ provider: EmbeddingProviderType;
33
38
  });
34
39
  generateEmbedding(text: string): Promise<number[]>;
35
40
  generateEmbeddings(texts: string[]): Promise<number[][]>;
@@ -1 +1 @@
1
- {"version":3,"file":"embedding-service.d.ts","sourceRoot":"","sources":["../../src/core/embedding-service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,gBAAgB,CAAC;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACnD,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACzD,WAAW,IAAI,OAAO,CAAC;IACvB,aAAa,IAAI,MAAM,CAAC;IACxB,QAAQ,IAAI,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,qBAAa,uBAAwB,YAAW,iBAAiB;IAC/D,OAAO,CAAC,YAAY,CAAqD;IACzE,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,aAAa,CAAM;gBAEf,MAAM,EAAE,eAAe,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,OAAO,CAAC,QAAQ,CAA2B;gBAE/B,MAAM,GAAE,eAAoB;IAKxC;;;OAGG;IACG,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAaxD;;;OAGG;IACG,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;IAc9D;;OAEG;IACH,WAAW,IAAI,OAAO;IAItB;;OAEG;IACH,aAAa,IAAI,MAAM;IAIvB;;OAEG;IACH,SAAS,IAAI;QACX,SAAS,EAAE,OAAO,CAAC;QACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IA4BD;;OAEG;IACH,uBAAuB,CAAC,OAAO,EAAE;QAC/B,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,kBAAkB,EAAE,MAAM,EAAE,CAAC;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,MAAM;CASX"}
@@ -6,16 +6,19 @@
6
6
  * Gracefully falls back to keyword-only search when embedding providers are not available.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.EmbeddingService = exports.VercelEmbeddingProvider = void 0;
9
+ exports.EmbeddingService = exports.VercelEmbeddingProvider = exports.EMBEDDING_PROVIDERS = void 0;
10
10
  const amazon_bedrock_1 = require("@ai-sdk/amazon-bedrock");
11
11
  const google_1 = require("@ai-sdk/google");
12
- const mistral_1 = require("@ai-sdk/mistral");
13
12
  const openai_1 = require("@ai-sdk/openai");
14
13
  const ai_1 = require("ai");
15
14
  const tracing_1 = require("./tracing");
15
+ /**
16
+ * Supported embedding providers - single source of truth
17
+ */
18
+ exports.EMBEDDING_PROVIDERS = ['openai', 'google', 'amazon_bedrock'];
16
19
  /**
17
20
  * Unified Vercel AI SDK Embedding Provider
18
- * Supports OpenAI, Google, Mistral, and Amazon Bedrock through Vercel AI SDK
21
+ * Supports OpenAI, Google, and Amazon Bedrock through Vercel AI SDK
19
22
  */
20
23
  class VercelEmbeddingProvider {
21
24
  providerType;
@@ -39,11 +42,6 @@ class VercelEmbeddingProvider {
39
42
  this.model = config.model || 'text-embedding-004';
40
43
  this.dimensions = config.dimensions || 768;
41
44
  break;
42
- case 'mistral':
43
- this.apiKey = config.apiKey || process.env.MISTRAL_API_KEY || '';
44
- this.model = config.model || 'mistral-embed';
45
- this.dimensions = config.dimensions || 1024;
46
- break;
47
45
  case 'amazon_bedrock':
48
46
  // AWS SDK handles credentials automatically - no API key needed
49
47
  this.apiKey = 'bedrock-uses-aws-credentials';
@@ -72,11 +70,6 @@ class VercelEmbeddingProvider {
72
70
  process.env.GOOGLE_GENERATIVE_AI_API_KEY = this.apiKey;
73
71
  this.modelInstance = google_1.google.textEmbedding(this.model);
74
72
  break;
75
- case 'mistral': {
76
- const mistral = (0, mistral_1.createMistral)({ apiKey: this.apiKey });
77
- this.modelInstance = mistral.textEmbedding(this.model);
78
- break;
79
- }
80
73
  case 'amazon_bedrock': {
81
74
  // AWS SDK automatically uses credential chain:
82
75
  // 1. Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION)
@@ -204,8 +197,8 @@ exports.VercelEmbeddingProvider = VercelEmbeddingProvider;
204
197
  */
205
198
  function createEmbeddingProvider(config = {}) {
206
199
  const providerType = (config.provider || process.env.EMBEDDINGS_PROVIDER || 'openai').toLowerCase();
207
- // Validate provider type
208
- if (providerType !== 'openai' && providerType !== 'google' && providerType !== 'mistral' && providerType !== 'amazon_bedrock') {
200
+ // Validate provider type using centralized list
201
+ if (!exports.EMBEDDING_PROVIDERS.includes(providerType)) {
209
202
  console.warn(`Unknown embedding provider: ${providerType}, falling back to openai`);
210
203
  return createEmbeddingProvider({ ...config, provider: 'openai' });
211
204
  }
@@ -294,7 +287,6 @@ class EmbeddingService {
294
287
  const keyMap = {
295
288
  'openai': 'OPENAI_API_KEY',
296
289
  'google': 'GOOGLE_API_KEY',
297
- 'mistral': 'MISTRAL_API_KEY',
298
290
  'amazon_bedrock': 'AWS credentials (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION)'
299
291
  };
300
292
  const requiredKey = keyMap[requestedProvider] || 'OPENAI_API_KEY';
@@ -6,17 +6,15 @@
6
6
  */
7
7
  export declare const CURRENT_MODELS: {
8
8
  readonly anthropic: "claude-sonnet-4-5-20250929";
9
+ readonly anthropic_opus: "claude-opus-4-5-20251101";
9
10
  readonly anthropic_haiku: "claude-haiku-4-5-20251001";
10
- readonly openai: "gpt-5";
11
- readonly openai_pro: "gpt-5-pro";
12
- readonly google: "gemini-2.5-pro";
13
- readonly google_fast: "gemini-2.5-flash";
11
+ readonly openai: "gpt-5.1-codex";
12
+ readonly google: "gemini-3-pro-preview";
13
+ readonly kimi: "kimi-k2-0905-preview";
14
+ readonly kimi_thinking: "kimi-k2-thinking";
14
15
  readonly xai: "grok-4";
15
- readonly xai_fast: "grok-4-fast-reasoning";
16
- readonly mistral: "mistral-large-latest";
17
- readonly deepseek: "deepseek-reasoner";
18
16
  readonly openrouter: "anthropic/claude-haiku-4.5";
19
- readonly custom: "gpt-5";
17
+ readonly custom: "gpt-5.1-codex";
20
18
  readonly amazon_bedrock: "global.anthropic.claude-sonnet-4-20250514-v1:0";
21
19
  };
22
20
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"model-config.d.ts","sourceRoot":"","sources":["../../src/core/model-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;CAcjB,CAAC;AAEX;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,OAAO,cAAc,GAAG,MAAM,CAE7E"}
1
+ {"version":3,"file":"model-config.d.ts","sourceRoot":"","sources":["../../src/core/model-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;CAYjB,CAAC;AAEX;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,OAAO,cAAc,GAAG,MAAM,CAE7E"}
@@ -10,17 +10,15 @@ exports.CURRENT_MODELS = void 0;
10
10
  exports.getCurrentModel = getCurrentModel;
11
11
  exports.CURRENT_MODELS = {
12
12
  anthropic: 'claude-sonnet-4-5-20250929',
13
+ anthropic_opus: 'claude-opus-4-5-20251101',
13
14
  anthropic_haiku: 'claude-haiku-4-5-20251001',
14
- openai: 'gpt-5',
15
- openai_pro: 'gpt-5-pro',
16
- google: 'gemini-2.5-pro',
17
- google_fast: 'gemini-2.5-flash',
15
+ openai: 'gpt-5.1-codex',
16
+ google: 'gemini-3-pro-preview',
17
+ kimi: 'kimi-k2-0905-preview', // PRD #237: Moonshot AI Kimi K2 - standard model with 256K context
18
+ kimi_thinking: 'kimi-k2-thinking', // PRD #237: Moonshot AI Kimi K2 - extended thinking variant
18
19
  xai: 'grok-4',
19
- xai_fast: 'grok-4-fast-reasoning',
20
- mistral: 'mistral-large-latest',
21
- deepseek: 'deepseek-reasoner',
22
20
  openrouter: 'anthropic/claude-haiku-4.5', // PRD #194: OpenRouter default model (overridden by AI_MODEL env var)
23
- custom: 'gpt-5', // PRD #194: Custom endpoint default model (overridden by AI_MODEL env var)
21
+ custom: 'gpt-5.1-codex', // PRD #194: Custom endpoint default model (overridden by AI_MODEL env var)
24
22
  amazon_bedrock: 'global.anthropic.claude-sonnet-4-20250514-v1:0' // PRD #175: Amazon Bedrock default model (overridden by AI_MODEL env var)
25
23
  };
26
24
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"vercel-provider.d.ts","sourceRoot":"","sources":["../../../src/core/providers/vercel-provider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,OAAO,EACL,UAAU,EACV,UAAU,EACV,gBAAgB,EACh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AAM,EAAE,gBAAgB;IAWpC,OAAO,CAAC,qBAAqB;IAY7B,OAAO,CAAC,eAAe;IAqFvB,eAAe,IAAI,MAAM;IAIzB,eAAe,IAAI,MAAM;IAIzB,YAAY,IAAI,MAAM;IAItB,cAAc,IAAI,MAAM;IAIxB,aAAa,IAAI,OAAO;IAIxB,OAAO,CAAC,iBAAiB;IAyBnB,WAAW,CACf,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,MAAkB,EAC7B,iBAAiB,CAAC,EAAE;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,GACA,OAAO,CAAC,UAAU,CAAC;IAoJtB;;;;;;;;;;;;OAYG;IACG,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAmW/D"}
@@ -12,8 +12,6 @@ const openai_1 = require("@ai-sdk/openai");
12
12
  const google_1 = require("@ai-sdk/google");
13
13
  const anthropic_1 = require("@ai-sdk/anthropic");
14
14
  const xai_1 = require("@ai-sdk/xai");
15
- const mistral_1 = require("@ai-sdk/mistral");
16
- const deepseek_1 = require("@ai-sdk/deepseek");
17
15
  const amazon_bedrock_1 = require("@ai-sdk/amazon-bedrock");
18
16
  const ai_sdk_provider_1 = require("@openrouter/ai-sdk-provider");
19
17
  const provider_debug_utils_1 = require("./provider-debug-utils");
@@ -50,16 +48,15 @@ class VercelProvider {
50
48
  let provider;
51
49
  switch (this.providerType) {
52
50
  case 'openai':
53
- case 'openai_pro':
54
51
  provider = (0, openai_1.createOpenAI)({
55
52
  apiKey: this.apiKey,
56
53
  });
57
54
  break;
58
55
  case 'google':
59
- case 'google_fast':
60
56
  provider = (0, google_1.createGoogleGenerativeAI)({ apiKey: this.apiKey });
61
57
  break;
62
58
  case 'anthropic':
59
+ case 'anthropic_opus':
63
60
  case 'anthropic_haiku':
64
61
  provider = (0, anthropic_1.createAnthropic)({
65
62
  apiKey: this.apiKey,
@@ -71,17 +68,19 @@ class VercelProvider {
71
68
  });
72
69
  break;
73
70
  case 'xai':
74
- case 'xai_fast':
75
71
  provider = (0, xai_1.createXai)({ apiKey: this.apiKey });
76
72
  break;
77
- case 'mistral':
78
- provider = (0, mistral_1.createMistral)({ apiKey: this.apiKey });
79
- break;
80
- case 'deepseek':
81
- provider = (0, deepseek_1.createDeepSeek)({
73
+ case 'kimi':
74
+ case 'kimi_thinking':
75
+ // PRD #237: Moonshot AI Kimi K2 - uses OpenAI-compatible API
76
+ // Use .chat() explicitly to use /chat/completions instead of /responses
77
+ // Use global endpoint (api.moonshot.ai) - China endpoint (api.moonshot.cn) requires China-specific API keys
78
+ provider = (0, openai_1.createOpenAI)({
82
79
  apiKey: this.apiKey,
80
+ baseURL: 'https://api.moonshot.ai/v1',
83
81
  });
84
- break;
82
+ this.modelInstance = provider.chat(this.model);
83
+ return; // Early return - model instance already set
85
84
  case 'amazon_bedrock':
86
85
  // PRD #175: Amazon Bedrock provider
87
86
  // AWS SDK automatically uses credential chain:
@@ -294,6 +293,7 @@ class VercelProvider {
294
293
  // Add cache control ONLY to last tool for Anthropic (max 4 cache breakpoints)
295
294
  // This caches the system prompt + all tools together
296
295
  if ((this.providerType === 'anthropic' ||
296
+ this.providerType === 'anthropic_opus' ||
297
297
  this.providerType === 'anthropic_haiku') &&
298
298
  isLastTool) {
299
299
  toolDef.providerOptions = {
@@ -316,6 +316,7 @@ class VercelProvider {
316
316
  const messages = [];
317
317
  let systemParam;
318
318
  if (this.providerType === 'anthropic' ||
319
+ this.providerType === 'anthropic_opus' ||
319
320
  this.providerType === 'anthropic_haiku') {
320
321
  // For Anthropic: Put system in messages array with cacheControl
321
322
  messages.push({
@@ -66,7 +66,7 @@ exports.REMEDIATE_TOOL_INPUT_SCHEMA = {
66
66
  * AI-driven investigation - uses toolLoop for single-phase investigation and analysis
67
67
  */
68
68
  async function conductInvestigation(session, sessionManager, aiProvider, logger, requestId, isValidation = false, interactionId) {
69
- const maxIterations = 30; // Increased for thorough models like Mistral
69
+ const maxIterations = 30; // Increased for thorough investigation workflows
70
70
  logger.info('Starting AI investigation with toolLoop', {
71
71
  requestId,
72
72
  sessionId: session.sessionId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vfarcic/dot-ai",
3
- "version": "0.142.0",
3
+ "version": "0.143.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",
@@ -19,15 +19,13 @@
19
19
  "test:integration": "./tests/integration/infrastructure/run-integration-tests.sh",
20
20
  "test:integration:watch": "vitest --config=vitest.integration.config.ts --test-timeout=1200000",
21
21
  "test:integration:sonnet": "AI_PROVIDER=anthropic AI_PROVIDER_SDK=vercel DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
22
+ "test:integration:opus": "AI_PROVIDER=anthropic_opus AI_PROVIDER_SDK=vercel DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
22
23
  "test:integration:haiku": "AI_PROVIDER=anthropic_haiku AI_PROVIDER_SDK=vercel DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
23
24
  "test:integration:gpt": "AI_PROVIDER=openai AI_PROVIDER_SDK=vercel DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
24
- "test:integration:gpt-pro": "AI_PROVIDER=openai_pro AI_PROVIDER_SDK=vercel DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
25
25
  "test:integration:gemini": "AI_PROVIDER=google AI_PROVIDER_SDK=vercel DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
26
- "test:integration:gemini-flash": "AI_PROVIDER=google_fast AI_PROVIDER_SDK=vercel DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
27
26
  "test:integration:grok": "AI_PROVIDER=xai AI_PROVIDER_SDK=vercel DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
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
- "test:integration:mistral": "AI_PROVIDER=mistral AI_PROVIDER_SDK=vercel DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
30
- "test:integration:deepseek": "AI_PROVIDER=deepseek AI_PROVIDER_SDK=vercel DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
27
+ "test:integration:kimi": "AI_PROVIDER=kimi AI_PROVIDER_SDK=vercel DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
28
+ "test:integration:kimi-thinking": "AI_PROVIDER=kimi_thinking AI_PROVIDER_SDK=vercel DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
31
29
  "test:integration:bedrock": "AI_PROVIDER=amazon_bedrock AI_MODEL=global.anthropic.claude-sonnet-4-20250514-v1:0 AI_PROVIDER_SDK=vercel DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
32
30
  "test:integration:custom-endpoint": "AI_PROVIDER=openai AI_PROVIDER_SDK=vercel DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
33
31
  "eval:comparative": "DEBUG_DOT_AI=true npx tsx src/evaluation/eval-runner.ts",
@@ -99,9 +97,7 @@
99
97
  "dependencies": {
100
98
  "@ai-sdk/amazon-bedrock": "^3.0.50",
101
99
  "@ai-sdk/anthropic": "^2.0.23",
102
- "@ai-sdk/deepseek": "^1.0.23",
103
100
  "@ai-sdk/google": "^2.0.17",
104
- "@ai-sdk/mistral": "^2.0.19",
105
101
  "@ai-sdk/openai": "^2.0.42",
106
102
  "@ai-sdk/xai": "^2.0.26",
107
103
  "@anthropic-ai/sdk": "^0.65.0",