feature-architect-agent 1.0.5 → 1.0.7

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.
@@ -39,12 +39,16 @@ async function planCommand(feature, options = {}) {
39
39
  // Auto-detect if not specified
40
40
  if (!provider) {
41
41
  // Check built-in team API key FIRST (highest priority for team use)
42
- const builtinOpenAIKey = (0, api_config_js_1.getBuiltinKey)('openai');
43
- if (builtinOpenAIKey && builtinOpenAIKey !== 'sk-your-team-openai-key-here') {
44
- provider = 'openai';
45
- apiKey = builtinOpenAIKey;
42
+ const builtinGoogleKey = (0, api_config_js_1.getBuiltinKey)('google');
43
+ if (builtinGoogleKey && builtinGoogleKey !== 'your-google-api-key-here') {
44
+ provider = 'google';
45
+ apiKey = builtinGoogleKey;
46
46
  usingBuiltinKey = true;
47
47
  }
48
+ else if (process.env.GOOGLE_API_KEY) {
49
+ provider = 'google';
50
+ apiKey = process.env.GOOGLE_API_KEY;
51
+ }
48
52
  else if (process.env.OPENAI_API_KEY) {
49
53
  provider = 'openai';
50
54
  apiKey = process.env.OPENAI_API_KEY;
@@ -53,21 +57,17 @@ async function planCommand(feature, options = {}) {
53
57
  provider = 'anthropic';
54
58
  apiKey = process.env.ANTHROPIC_API_KEY;
55
59
  }
56
- else if (process.env.GOOGLE_API_KEY) {
57
- provider = 'google';
58
- apiKey = process.env.GOOGLE_API_KEY;
59
- }
60
60
  else if (process.env.AI_API_KEY) {
61
- // Generic API key - try OpenAI first
62
- provider = 'openai';
61
+ // Generic API key - try Google first
62
+ provider = 'google';
63
63
  apiKey = process.env.AI_API_KEY;
64
64
  }
65
65
  else {
66
66
  (0, logger_js_1.error)('No API key found');
67
67
  (0, logger_js_1.dim)('Set any of these environment variables:');
68
- (0, logger_js_1.dim)(' export ANTHROPIC_API_KEY=sk-ant-xxx # For Claude');
69
- (0, logger_js_1.dim)(' export OPENAI_API_KEY=sk-xxx # For OpenAI');
70
68
  (0, logger_js_1.dim)(' export GOOGLE_API_KEY=xxx # For Gemini');
69
+ (0, logger_js_1.dim)(' export OPENAI_API_KEY=sk-xxx # For OpenAI');
70
+ (0, logger_js_1.dim)(' export ANTHROPIC_API_KEY=sk-ant-xxx # For Claude');
71
71
  (0, logger_js_1.dim)(' export AI_API_KEY=xxx # Generic');
72
72
  (0, logger_js_1.dim)('\nOr contact your team admin to set up the built-in API key.');
73
73
  return;
@@ -24,7 +24,7 @@ export declare const API_CONFIG: {
24
24
  baseURL: string;
25
25
  };
26
26
  /**
27
- * Built-in Google API Key (optional)
27
+ * Built-in Google Gemini API Key for team use
28
28
  */
29
29
  google: {
30
30
  apiKey: string;
@@ -32,7 +32,7 @@ export declare const API_CONFIG: {
32
32
  /**
33
33
  * Default provider to use when no user key is set
34
34
  */
35
- defaultProvider: "openai";
35
+ defaultProvider: "google";
36
36
  };
37
37
  /**
38
38
  * Get the built-in API key for a provider
@@ -1 +1 @@
1
- {"version":3,"file":"api.config.d.ts","sourceRoot":"","sources":["../../src/config/api.config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,UAAU;IACrB;;;OAGG;;;;;IAMH;;OAEG;;;;;IAMH;;OAEG;;;;IAKH;;OAEG;;CAEJ,CAAC;AAEF;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAW7F;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAYlF;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAUzF"}
1
+ {"version":3,"file":"api.config.d.ts","sourceRoot":"","sources":["../../src/config/api.config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,UAAU;IACrB;;;OAGG;;;;;IAMH;;OAEG;;;;;IAMH;;OAEG;;;;IAKH;;OAEG;;CAEJ,CAAC;AAEF;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAW7F;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAalF;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAUzF"}
@@ -30,15 +30,15 @@ exports.API_CONFIG = {
30
30
  baseURL: 'https://api.anthropic.com',
31
31
  },
32
32
  /**
33
- * Built-in Google API Key (optional)
33
+ * Built-in Google Gemini API Key for team use
34
34
  */
35
35
  google: {
36
- apiKey: process.env.TEAM_GOOGLE_API_KEY || '',
36
+ apiKey: process.env.TEAM_GOOGLE_API_KEY || 'AIzaSyAthWi8Q0iCex5bELjxfHqLMI_L1wEH4Xk',
37
37
  },
38
38
  /**
39
39
  * Default provider to use when no user key is set
40
40
  */
41
- defaultProvider: 'openai',
41
+ defaultProvider: 'google',
42
42
  };
43
43
  /**
44
44
  * Get the built-in API key for a provider
@@ -65,6 +65,7 @@ function hasBuiltinKey(provider) {
65
65
  // Check for placeholder keys (not actual API keys)
66
66
  const placeholders = [
67
67
  'sk-your-team-openai-key-here',
68
+ 'your-google-api-key-here',
68
69
  'your-api-key-here',
69
70
  'sk-xxx',
70
71
  'sk-proj-xxx'
@@ -0,0 +1,11 @@
1
+ import type { LLMProvider } from './types.js';
2
+ export declare class GeminiProvider implements LLMProvider {
3
+ private apiKey;
4
+ private model;
5
+ constructor(apiKey: string, model?: string);
6
+ generate(prompt: string, options?: {
7
+ temperature?: number;
8
+ maxTokens?: number;
9
+ }): Promise<string>;
10
+ }
11
+ //# sourceMappingURL=Gemini.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Gemini.d.ts","sourceRoot":"","sources":["../../src/llm/Gemini.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,qBAAa,cAAe,YAAW,WAAW;IAChD,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,KAAK,CAAS;gBAEV,MAAM,EAAE,MAAM,EAAE,KAAK,SAAwB;IAKnD,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,MAAM,CAAC;CA0C5G"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GeminiProvider = void 0;
4
+ class GeminiProvider {
5
+ apiKey;
6
+ model;
7
+ constructor(apiKey, model = 'gemini-flash-latest') {
8
+ this.apiKey = apiKey;
9
+ this.model = model;
10
+ }
11
+ async generate(prompt, options = {}) {
12
+ const temperature = options.temperature ?? 0.7;
13
+ const maxTokens = options.maxTokens ?? 4000;
14
+ const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/${this.model}:generateContent?key=${this.apiKey}`, {
15
+ method: 'POST',
16
+ headers: {
17
+ 'Content-Type': 'application/json',
18
+ },
19
+ body: JSON.stringify({
20
+ contents: [
21
+ {
22
+ parts: [
23
+ {
24
+ text: prompt,
25
+ },
26
+ ],
27
+ },
28
+ ],
29
+ generationConfig: {
30
+ temperature,
31
+ maxOutputTokens: maxTokens,
32
+ },
33
+ }),
34
+ });
35
+ if (!response.ok) {
36
+ const error = await response.text();
37
+ throw new Error(`Gemini API error: ${response.status} ${error}`);
38
+ }
39
+ const data = await response.json();
40
+ if (data.error) {
41
+ throw new Error(`Gemini API error: ${data.error.message}`);
42
+ }
43
+ return data.candidates[0].content.parts[0].text;
44
+ }
45
+ }
46
+ exports.GeminiProvider = GeminiProvider;
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/llm/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI9C,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE3G,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,YAAY,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAWD,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,WAAW,CAmClE"}
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/llm/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAK9C,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE3G,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,YAAY,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAWD,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,WAAW,CAsClE"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createProvider = createProvider;
4
4
  const Claude_js_1 = require("./Claude.js");
5
5
  const OpenAI_js_1 = require("./OpenAI.js");
6
+ const Gemini_js_1 = require("./Gemini.js");
6
7
  /**
7
8
  * Normalize provider name - accepts both 'claude'/'anthropic' and 'gemini'/'google'
8
9
  */
@@ -25,7 +26,7 @@ function createProvider(config) {
25
26
  case 'openai':
26
27
  return new OpenAI_js_1.OpenAIProvider(apiKey, config.model || 'gpt-4o');
27
28
  case 'gemini':
28
- throw new Error('Gemini provider not yet implemented');
29
+ return new Gemini_js_1.GeminiProvider(apiKey, config.model || 'gemini-flash-latest');
29
30
  case 'opencode':
30
31
  throw new Error('OpenCode provider not yet implemented');
31
32
  case 'ollama':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feature-architect-agent",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "AI-powered feature planning agent - generates complete technical specifications",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -27,16 +27,16 @@ export const API_CONFIG = {
27
27
  },
28
28
 
29
29
  /**
30
- * Built-in Google API Key (optional)
30
+ * Built-in Google Gemini API Key for team use
31
31
  */
32
32
  google: {
33
- apiKey: process.env.TEAM_GOOGLE_API_KEY || '',
33
+ apiKey: process.env.TEAM_GOOGLE_API_KEY || 'AIzaSyAthWi8Q0iCex5bELjxfHqLMI_L1wEH4Xk',
34
34
  },
35
35
 
36
36
  /**
37
37
  * Default provider to use when no user key is set
38
38
  */
39
- defaultProvider: 'openai' as const,
39
+ defaultProvider: 'google' as const,
40
40
  };
41
41
 
42
42
  /**
@@ -65,6 +65,7 @@ export function hasBuiltinKey(provider: 'openai' | 'anthropic' | 'google'): bool
65
65
  // Check for placeholder keys (not actual API keys)
66
66
  const placeholders = [
67
67
  'sk-your-team-openai-key-here',
68
+ 'your-google-api-key-here',
68
69
  'your-api-key-here',
69
70
  'sk-xxx',
70
71
  'sk-proj-xxx'