architectgbt-mcp 0.2.1 → 0.2.2

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.
@@ -108,28 +108,87 @@ export async function handleGetRecommendation(args) {
108
108
  }
109
109
  }
110
110
  function formatRecommendation(data) {
111
- const { recommendation, reasoning, alternatives, model } = data;
112
- let result = `## šŸŽÆ AI Model Recommendation\n\n`;
113
- if (model) {
114
- result += `### Recommended: ${model.name}\n`;
115
- result += `- **Provider:** ${model.provider}\n`;
116
- result += `- **Model ID:** ${model.model_id || "N/A"}\n`;
117
- if (model.input_price || model.output_price) {
118
- result += `- **Pricing:** $${model.input_price}/1M input, $${model.output_price}/1M output\n`;
119
- }
120
- if (model.context_window) {
121
- result += `- **Context Window:** ${model.context_window.toLocaleString()} tokens\n`;
111
+ // Handle conversational/off-topic responses
112
+ if (data.off_topic || data.needs_clarification) {
113
+ let result = data.message || '';
114
+ if (data.questions && Array.isArray(data.questions) && data.questions.length > 0) {
115
+ result += `\n\nšŸ“‹ To help me recommend the perfect AI model, please tell me:\n`;
116
+ data.questions.forEach((q, i) => {
117
+ result += `${i + 1}. ${q}\n`;
118
+ });
122
119
  }
120
+ return result;
121
+ }
122
+ const recommendations = data.recommendations || [];
123
+ if (recommendations.length === 0) {
124
+ return `āŒ No recommendations found. Try describing your project in more detail.`;
125
+ }
126
+ let result = `šŸŽÆ AI Model Recommendation — Analysis Complete!\n`;
127
+ result += `${"=".repeat(70)}\n\n`;
128
+ // Main recommendation
129
+ const top = recommendations[0];
130
+ result += `✨ TOP MATCH (${top.match_score || top.score || 95}% match)\n\n`;
131
+ result += `${top.model_name || top.name}\n`;
132
+ result += `Provider: ${top.provider}\n`;
133
+ // Pricing
134
+ if (top.estimated_cost) {
135
+ const cost = top.estimated_cost;
136
+ result += `Estimated Cost: $${cost.total_cost_usd?.toFixed(4) || '0.0000'}\n`;
137
+ result += ` └─ ${cost.input_tokens?.toLocaleString() || '0'} input + ${cost.output_tokens?.toLocaleString() || '0'} output tokens\n`;
138
+ }
139
+ else if (top.input_price !== undefined && top.output_price !== undefined) {
140
+ result += `Pricing: $${top.input_price}/1M input • $${top.output_price}/1M output\n`;
141
+ }
142
+ // Capabilities
143
+ if (top.capabilities?.context_window || top.context_window) {
144
+ const contextWindow = top.capabilities?.context_window || top.context_window;
145
+ result += `Context Window: ${contextWindow.toLocaleString()} tokens\n`;
146
+ }
147
+ // Reasoning
148
+ if (top.reasoning) {
149
+ result += `\nšŸ’” Why this model?\n${top.reasoning}\n`;
123
150
  }
124
- if (reasoning) {
125
- result += `\n### Why This Model?\n${reasoning}\n`;
151
+ // Pros and Cons
152
+ if (top.pros || top.cons) {
153
+ result += `\n`;
154
+ if (top.pros && top.pros.length > 0) {
155
+ result += `āœ… Pros:\n`;
156
+ top.pros.forEach((pro) => {
157
+ result += ` • ${pro}\n`;
158
+ });
159
+ }
160
+ if (top.cons && top.cons.length > 0) {
161
+ result += `āš ļø Cons:\n`;
162
+ top.cons.forEach((con) => {
163
+ result += ` • ${con}\n`;
164
+ });
165
+ }
126
166
  }
127
- if (alternatives && alternatives.length > 0) {
128
- result += `\n### Alternatives\n`;
129
- alternatives.forEach((alt, i) => {
130
- result += `${i + 1}. **${alt.name}** - ${alt.reason || alt.description || ""}\n`;
167
+ // Alternative recommendations
168
+ if (recommendations.length > 1) {
169
+ result += `\n${"─".repeat(70)}\n`;
170
+ result += `\nAlternative Options:\n\n`;
171
+ recommendations.slice(1, 3).forEach((rec, i) => {
172
+ result += `${i + 2}. ${rec.model_name || rec.name} (${rec.match_score || rec.score || '??'}% match)\n`;
173
+ result += ` Provider: ${rec.provider}\n`;
174
+ if (rec.estimated_cost) {
175
+ result += ` Cost: $${rec.estimated_cost.total_cost_usd?.toFixed(4) || '0.0000'}\n`;
176
+ }
177
+ else if (rec.input_price !== undefined) {
178
+ result += ` Pricing: $${rec.input_price}/1M in • $${rec.output_price}/1M out\n`;
179
+ }
180
+ if (rec.reasoning) {
181
+ result += ` Reason: ${rec.reasoning.substring(0, 150)}${rec.reasoning.length > 150 ? '...' : ''}\n`;
182
+ }
183
+ result += `\n`;
131
184
  });
132
185
  }
133
- result += `\n---\n*Powered by [ArchitectGBT](https://architectgbt.com)*`;
186
+ // Analysis summary
187
+ if (data.analysis_summary) {
188
+ result += `${"─".repeat(70)}\n`;
189
+ result += `\nšŸ“Š Analysis Summary:\n${data.analysis_summary}\n\n`;
190
+ }
191
+ result += `${"=".repeat(70)}\n`;
192
+ result += `šŸ’Ž Powered by ArchitectGBT • https://architectgbt.com`;
134
193
  return result;
135
194
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "architectgbt-mcp",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Model Context Protocol server for ArchitectGBT - AI architecture recommendations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -126,36 +126,100 @@ export async function handleGetRecommendation(args: unknown) {
126
126
  }
127
127
 
128
128
  function formatRecommendation(data: any): string {
129
- const { recommendation, reasoning, alternatives, model } = data;
129
+ // Handle conversational/off-topic responses
130
+ if (data.off_topic || data.needs_clarification) {
131
+ let result = data.message || '';
132
+
133
+ if (data.questions && Array.isArray(data.questions) && data.questions.length > 0) {
134
+ result += `\n\nšŸ“‹ To help me recommend the perfect AI model, please tell me:\n`;
135
+ data.questions.forEach((q: string, i: number) => {
136
+ result += `${i + 1}. ${q}\n`;
137
+ });
138
+ }
139
+
140
+ return result;
141
+ }
130
142
 
131
- let result = `## šŸŽÆ AI Model Recommendation\n\n`;
143
+ const recommendations = data.recommendations || [];
144
+
145
+ if (recommendations.length === 0) {
146
+ return `āŒ No recommendations found. Try describing your project in more detail.`;
147
+ }
132
148
 
133
- if (model) {
134
- result += `### Recommended: ${model.name}\n`;
135
- result += `- **Provider:** ${model.provider}\n`;
136
- result += `- **Model ID:** ${model.model_id || "N/A"}\n`;
149
+ let result = `šŸŽÆ AI Model Recommendation — Analysis Complete!\n`;
150
+ result += `${"=".repeat(70)}\n\n`;
151
+
152
+ // Main recommendation
153
+ const top = recommendations[0];
154
+ result += `✨ TOP MATCH (${top.match_score || top.score || 95}% match)\n\n`;
155
+ result += `${top.model_name || top.name}\n`;
156
+ result += `Provider: ${top.provider}\n`;
157
+
158
+ // Pricing
159
+ if (top.estimated_cost) {
160
+ const cost = top.estimated_cost;
161
+ result += `Estimated Cost: $${cost.total_cost_usd?.toFixed(4) || '0.0000'}\n`;
162
+ result += ` └─ ${cost.input_tokens?.toLocaleString() || '0'} input + ${cost.output_tokens?.toLocaleString() || '0'} output tokens\n`;
163
+ } else if (top.input_price !== undefined && top.output_price !== undefined) {
164
+ result += `Pricing: $${top.input_price}/1M input • $${top.output_price}/1M output\n`;
165
+ }
137
166
 
138
- if (model.input_price || model.output_price) {
139
- result += `- **Pricing:** $${model.input_price}/1M input, $${model.output_price}/1M output\n`;
140
- }
167
+ // Capabilities
168
+ if (top.capabilities?.context_window || top.context_window) {
169
+ const contextWindow = top.capabilities?.context_window || top.context_window;
170
+ result += `Context Window: ${contextWindow.toLocaleString()} tokens\n`;
171
+ }
141
172
 
142
- if (model.context_window) {
143
- result += `- **Context Window:** ${model.context_window.toLocaleString()} tokens\n`;
144
- }
173
+ // Reasoning
174
+ if (top.reasoning) {
175
+ result += `\nšŸ’” Why this model?\n${top.reasoning}\n`;
145
176
  }
146
177
 
147
- if (reasoning) {
148
- result += `\n### Why This Model?\n${reasoning}\n`;
178
+ // Pros and Cons
179
+ if (top.pros || top.cons) {
180
+ result += `\n`;
181
+ if (top.pros && top.pros.length > 0) {
182
+ result += `āœ… Pros:\n`;
183
+ top.pros.forEach((pro: string) => {
184
+ result += ` • ${pro}\n`;
185
+ });
186
+ }
187
+ if (top.cons && top.cons.length > 0) {
188
+ result += `āš ļø Cons:\n`;
189
+ top.cons.forEach((con: string) => {
190
+ result += ` • ${con}\n`;
191
+ });
192
+ }
149
193
  }
150
194
 
151
- if (alternatives && alternatives.length > 0) {
152
- result += `\n### Alternatives\n`;
153
- alternatives.forEach((alt: any, i: number) => {
154
- result += `${i + 1}. **${alt.name}** - ${alt.reason || alt.description || ""}\n`;
195
+ // Alternative recommendations
196
+ if (recommendations.length > 1) {
197
+ result += `\n${"─".repeat(70)}\n`;
198
+ result += `\nAlternative Options:\n\n`;
199
+
200
+ recommendations.slice(1, 3).forEach((rec: any, i: number) => {
201
+ result += `${i + 2}. ${rec.model_name || rec.name} (${rec.match_score || rec.score || '??'}% match)\n`;
202
+ result += ` Provider: ${rec.provider}\n`;
203
+ if (rec.estimated_cost) {
204
+ result += ` Cost: $${rec.estimated_cost.total_cost_usd?.toFixed(4) || '0.0000'}\n`;
205
+ } else if (rec.input_price !== undefined) {
206
+ result += ` Pricing: $${rec.input_price}/1M in • $${rec.output_price}/1M out\n`;
207
+ }
208
+ if (rec.reasoning) {
209
+ result += ` Reason: ${rec.reasoning.substring(0, 150)}${rec.reasoning.length > 150 ? '...' : ''}\n`;
210
+ }
211
+ result += `\n`;
155
212
  });
156
213
  }
157
214
 
158
- result += `\n---\n*Powered by [ArchitectGBT](https://architectgbt.com)*`;
215
+ // Analysis summary
216
+ if (data.analysis_summary) {
217
+ result += `${"─".repeat(70)}\n`;
218
+ result += `\nšŸ“Š Analysis Summary:\n${data.analysis_summary}\n\n`;
219
+ }
220
+
221
+ result += `${"=".repeat(70)}\n`;
222
+ result += `šŸ’Ž Powered by ArchitectGBT • https://architectgbt.com`;
159
223
 
160
224
  return result;
161
225
  }