@vfarcic/dot-ai 0.170.0 → 0.171.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/dist/core/ai-provider-factory.d.ts.map +1 -1
- package/dist/core/ai-provider-factory.js +13 -3
- package/dist/core/model-config.d.ts +1 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +1 -0
- package/dist/core/providers/vercel-provider.d.ts.map +1 -1
- package/dist/core/providers/vercel-provider.js +1 -0
- package/dist/tools/operate-analysis.js +19 -6
- package/package.json +2 -1
- package/shared-prompts/prd-start.md +13 -2
|
@@ -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;
|
|
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;AA6BjC;;;;;;;;;;;;;;GAcG;AACH,qBAAa,iBAAiB;IAC5B;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,UAAU;IA2BnD;;;;;;;;;;OAUG;IACH,MAAM,CAAC,aAAa,IAAI,UAAU;IAoFlC;;;;;OAKG;IACH,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAWrD;;;;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"}
|
|
@@ -24,7 +24,8 @@ const PROVIDER_ENV_KEYS = {
|
|
|
24
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
|
-
google: '
|
|
27
|
+
google: 'GOOGLE_GENERATIVE_AI_API_KEY', // Standard Vercel AI SDK env var (also checks GOOGLE_API_KEY as fallback)
|
|
28
|
+
google_flash: 'GOOGLE_GENERATIVE_AI_API_KEY', // PRD #294: Uses same API key as regular Google
|
|
28
29
|
kimi: 'MOONSHOT_API_KEY', // PRD #237: Moonshot AI Kimi K2
|
|
29
30
|
kimi_thinking: 'MOONSHOT_API_KEY', // PRD #237: Uses same API key as regular Kimi
|
|
30
31
|
xai: 'XAI_API_KEY',
|
|
@@ -115,7 +116,11 @@ class AIProviderFactory {
|
|
|
115
116
|
`Falling back to NoOpProvider.\n`);
|
|
116
117
|
return new noop_provider_1.NoOpAIProvider();
|
|
117
118
|
}
|
|
118
|
-
|
|
119
|
+
// Check primary env var, with fallback for Google providers (GOOGLE_API_KEY for backward compatibility)
|
|
120
|
+
let resolvedApiKey = process.env.CUSTOM_LLM_API_KEY || process.env[apiKeyEnvVar];
|
|
121
|
+
if (!resolvedApiKey && providerType.startsWith('google')) {
|
|
122
|
+
resolvedApiKey = process.env.GOOGLE_API_KEY; // Fallback for backward compatibility
|
|
123
|
+
}
|
|
119
124
|
if (!resolvedApiKey) {
|
|
120
125
|
process.stderr.write(`INFO: ${apiKeyEnvVar} not configured. ` +
|
|
121
126
|
`AI features will be unavailable. ` +
|
|
@@ -160,7 +165,12 @@ class AIProviderFactory {
|
|
|
160
165
|
const apiKeyEnvVar = PROVIDER_ENV_KEYS[provider];
|
|
161
166
|
if (!apiKeyEnvVar)
|
|
162
167
|
return false;
|
|
163
|
-
|
|
168
|
+
// Check primary env var, with fallback for Google providers
|
|
169
|
+
const hasKey = !!process.env[apiKeyEnvVar];
|
|
170
|
+
if (!hasKey && provider.startsWith('google')) {
|
|
171
|
+
return !!process.env.GOOGLE_API_KEY; // Fallback for backward compatibility
|
|
172
|
+
}
|
|
173
|
+
return hasKey;
|
|
164
174
|
}
|
|
165
175
|
/**
|
|
166
176
|
* Get list of available providers (implemented + have API keys configured)
|
|
@@ -10,6 +10,7 @@ export declare const CURRENT_MODELS: {
|
|
|
10
10
|
readonly anthropic_haiku: "claude-haiku-4-5-20251001";
|
|
11
11
|
readonly openai: "gpt-5.1-codex";
|
|
12
12
|
readonly google: "gemini-3-pro-preview";
|
|
13
|
+
readonly google_flash: "gemini-3-flash-preview";
|
|
13
14
|
readonly kimi: "kimi-k2-0905-preview";
|
|
14
15
|
readonly kimi_thinking: "kimi-k2-thinking";
|
|
15
16
|
readonly xai: "grok-4";
|
|
@@ -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
|
|
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"}
|
|
@@ -14,6 +14,7 @@ exports.CURRENT_MODELS = {
|
|
|
14
14
|
anthropic_haiku: 'claude-haiku-4-5-20251001',
|
|
15
15
|
openai: 'gpt-5.1-codex',
|
|
16
16
|
google: 'gemini-3-pro-preview',
|
|
17
|
+
google_flash: 'gemini-3-flash-preview', // PRD #294: Gemini 3 Flash - faster/cheaper variant with same 1M context
|
|
17
18
|
kimi: 'kimi-k2-0905-preview', // PRD #237: Moonshot AI Kimi K2 - standard model with 256K context
|
|
18
19
|
kimi_thinking: 'kimi-k2-thinking', // PRD #237: Moonshot AI Kimi K2 - extended thinking variant
|
|
19
20
|
xai: 'grok-4',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vercel-provider.d.ts","sourceRoot":"","sources":["../../../src/core/providers/vercel-provider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,EACL,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,aAAa,EACd,MAAM,0BAA0B,CAAC;AAiBlC,qBAAa,cAAe,YAAW,UAAU;IAC/C,OAAO,CAAC,YAAY,CAAoB;IACxC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,aAAa,CAAM;gBAEf,MAAM,EAAE,gBAAgB;IAWpC,OAAO,CAAC,qBAAqB;IAY7B,OAAO,CAAC,eAAe;
|
|
1
|
+
{"version":3,"file":"vercel-provider.d.ts","sourceRoot":"","sources":["../../../src/core/providers/vercel-provider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,EACL,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,aAAa,EACd,MAAM,0BAA0B,CAAC;AAiBlC,qBAAa,cAAe,YAAW,UAAU;IAC/C,OAAO,CAAC,YAAY,CAAoB;IACxC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,SAAS,CAAU;IAC3B,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,aAAa,CAAM;gBAEf,MAAM,EAAE,gBAAgB;IAWpC,OAAO,CAAC,qBAAqB;IAY7B,OAAO,CAAC,eAAe;IAsFvB,eAAe,IAAI,MAAM;IAIzB,eAAe,IAAI,MAAM;IAIzB,YAAY,IAAI,MAAM;IAItB,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"}
|
|
@@ -117,15 +117,28 @@ async function executeToolLoop(systemPrompt, userMessage, logger, interaction_id
|
|
|
117
117
|
*/
|
|
118
118
|
function parseAIResponse(response, logger) {
|
|
119
119
|
logger.debug('Parsing AI response');
|
|
120
|
-
//
|
|
120
|
+
// Try to extract JSON from code block first (Claude format)
|
|
121
121
|
const jsonMatch = response.match(/```json\n([\s\S]+?)\n```/);
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
let jsonContent;
|
|
123
|
+
if (jsonMatch) {
|
|
124
|
+
jsonContent = jsonMatch[1];
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
// Fallback: try to parse raw JSON response (Gemini format)
|
|
128
|
+
// Look for JSON object starting with { and ending with }
|
|
129
|
+
const rawJsonMatch = response.match(/^\s*(\{[\s\S]*\})\s*$/);
|
|
130
|
+
if (rawJsonMatch) {
|
|
131
|
+
jsonContent = rawJsonMatch[1];
|
|
132
|
+
logger.debug('Parsing raw JSON response (no code block wrapper)');
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
const truncatedResponse = response.substring(0, 500);
|
|
136
|
+
logger.error(`AI response not valid JSON. Response: ${truncatedResponse}`);
|
|
137
|
+
throw new Error('AI did not return structured JSON response. Expected JSON object or ```json code block.');
|
|
138
|
+
}
|
|
126
139
|
}
|
|
127
140
|
try {
|
|
128
|
-
const parsed = JSON.parse(
|
|
141
|
+
const parsed = JSON.parse(jsonContent);
|
|
129
142
|
// Validate required fields
|
|
130
143
|
if (!parsed.analysis || typeof parsed.analysis !== 'string') {
|
|
131
144
|
throw new Error('AI response missing required "analysis" field (string)');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vfarcic/dot-ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.171.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",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"test:integration:haiku": "AI_PROVIDER=anthropic_haiku DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
|
|
25
25
|
"test:integration:gpt": "AI_PROVIDER=openai DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
|
|
26
26
|
"test:integration:gemini": "AI_PROVIDER=google DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
|
|
27
|
+
"test:integration:gemini-flash": "AI_PROVIDER=google_flash DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
|
|
27
28
|
"test:integration:grok": "AI_PROVIDER=xai DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
|
|
28
29
|
"test:integration:kimi": "AI_PROVIDER=kimi DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
|
|
29
30
|
"test:integration:kimi-thinking": "AI_PROVIDER=kimi_thinking DEBUG_DOT_AI=true ./tests/integration/infrastructure/run-integration-tests.sh",
|
|
@@ -215,11 +215,22 @@ If confirmed, provide:
|
|
|
215
215
|
- **Testing approach**: How to validate the implementation
|
|
216
216
|
- **Progress checkpoints**: When to update the PRD with progress
|
|
217
217
|
|
|
218
|
-
|
|
219
|
-
|
|
218
|
+
## Step 6: Update Progress After Completion
|
|
219
|
+
|
|
220
|
+
After the user completes the task implementation, prompt them to update PRD progress:
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
**Task implementation complete.**
|
|
225
|
+
|
|
226
|
+
To update PRD progress and commit your work, run the `prd-update-progress` prompt.
|
|
220
227
|
|
|
221
228
|
*Note: Different agents/clients may have different syntax for executing commands and prompts (e.g., `/prd-update-progress` in Claude Code, or other syntax in different MCP clients).*
|
|
222
229
|
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
This ensures a smooth workflow from task selection → implementation → progress tracking → next task.
|
|
233
|
+
|
|
223
234
|
## Success Criteria
|
|
224
235
|
|
|
225
236
|
This command should:
|