@ayatec/ai-gateway-mcp-server 0.1.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.
Files changed (75) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +213 -0
  3. package/dist/config.d.ts +8 -0
  4. package/dist/config.d.ts.map +1 -0
  5. package/dist/config.js +9 -0
  6. package/dist/config.js.map +1 -0
  7. package/dist/index.d.ts +3 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +40 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/lib/gateway.d.ts +24 -0
  12. package/dist/lib/gateway.d.ts.map +1 -0
  13. package/dist/lib/gateway.js +122 -0
  14. package/dist/lib/gateway.js.map +1 -0
  15. package/dist/lib/model-registry.d.ts +16 -0
  16. package/dist/lib/model-registry.d.ts.map +1 -0
  17. package/dist/lib/model-registry.js +264 -0
  18. package/dist/lib/model-registry.js.map +1 -0
  19. package/dist/providers/anthropic.d.ts +2 -0
  20. package/dist/providers/anthropic.d.ts.map +1 -0
  21. package/dist/providers/anthropic.js +7 -0
  22. package/dist/providers/anthropic.js.map +1 -0
  23. package/dist/providers/google.d.ts +2 -0
  24. package/dist/providers/google.d.ts.map +1 -0
  25. package/dist/providers/google.js +9 -0
  26. package/dist/providers/google.js.map +1 -0
  27. package/dist/providers/index.d.ts +5 -0
  28. package/dist/providers/index.d.ts.map +1 -0
  29. package/dist/providers/index.js +8 -0
  30. package/dist/providers/index.js.map +1 -0
  31. package/dist/providers/openai.d.ts +2 -0
  32. package/dist/providers/openai.d.ts.map +1 -0
  33. package/dist/providers/openai.js +7 -0
  34. package/dist/providers/openai.js.map +1 -0
  35. package/dist/providers/perplexity.d.ts +2 -0
  36. package/dist/providers/perplexity.d.ts.map +1 -0
  37. package/dist/providers/perplexity.js +9 -0
  38. package/dist/providers/perplexity.js.map +1 -0
  39. package/dist/tools/ask.d.ts +20 -0
  40. package/dist/tools/ask.d.ts.map +1 -0
  41. package/dist/tools/ask.js +47 -0
  42. package/dist/tools/ask.js.map +1 -0
  43. package/dist/tools/index.d.ts +5 -0
  44. package/dist/tools/index.d.ts.map +1 -0
  45. package/dist/tools/index.js +5 -0
  46. package/dist/tools/index.js.map +1 -0
  47. package/dist/tools/list-models.d.ts +38 -0
  48. package/dist/tools/list-models.d.ts.map +1 -0
  49. package/dist/tools/list-models.js +106 -0
  50. package/dist/tools/list-models.js.map +1 -0
  51. package/dist/tools/research.d.ts +32 -0
  52. package/dist/tools/research.d.ts.map +1 -0
  53. package/dist/tools/research.js +157 -0
  54. package/dist/tools/research.js.map +1 -0
  55. package/dist/tools/search.d.ts +18 -0
  56. package/dist/tools/search.d.ts.map +1 -0
  57. package/dist/tools/search.js +61 -0
  58. package/dist/tools/search.js.map +1 -0
  59. package/dist/types/index.d.ts +40 -0
  60. package/dist/types/index.d.ts.map +1 -0
  61. package/dist/types/index.js +2 -0
  62. package/dist/types/index.js.map +1 -0
  63. package/dist/utils/cost.d.ts +10 -0
  64. package/dist/utils/cost.d.ts.map +1 -0
  65. package/dist/utils/cost.js +18 -0
  66. package/dist/utils/cost.js.map +1 -0
  67. package/dist/utils/format.d.ts +5 -0
  68. package/dist/utils/format.d.ts.map +1 -0
  69. package/dist/utils/format.js +18 -0
  70. package/dist/utils/format.js.map +1 -0
  71. package/dist/utils/logger.d.ts +12 -0
  72. package/dist/utils/logger.d.ts.map +1 -0
  73. package/dist/utils/logger.js +20 -0
  74. package/dist/utils/logger.js.map +1 -0
  75. package/package.json +87 -0
@@ -0,0 +1,264 @@
1
+ // 全モデル定義(計画v5の価格・能力情報に準拠)
2
+ const models = [
3
+ // --- OpenAI ---
4
+ {
5
+ id: 'openai/gpt-5.2',
6
+ provider: 'openai',
7
+ displayName: 'GPT-5.2',
8
+ contextWindow: 400_000,
9
+ capabilities: { search: true, reasoning: true, coding: true, fast: false, cheap: false },
10
+ pricing: { input: 1.75, cachedInput: 0.4375, output: 14.0 },
11
+ searchCost: {
12
+ type: 'token_based',
13
+ description: '検索結果がinputトークンに含まれる(膨張大)',
14
+ },
15
+ maxOutputTokens: 128000,
16
+ releasedAt: '2025-12-11',
17
+ note: 'フラッグシップ、askデフォルト',
18
+ },
19
+ {
20
+ id: 'openai/gpt-5.2-codex',
21
+ provider: 'openai',
22
+ displayName: 'GPT-5.2 Codex',
23
+ contextWindow: 400_000,
24
+ capabilities: { search: true, reasoning: true, coding: true, fast: false, cheap: false },
25
+ pricing: { input: 1.75, cachedInput: 0.4375, output: 14.0 },
26
+ searchCost: {
27
+ type: 'token_based',
28
+ description: '検索結果がinputトークンに含まれる(膨張大)',
29
+ },
30
+ maxOutputTokens: 128000,
31
+ releasedAt: '2026-01-14',
32
+ note: 'コード特化',
33
+ },
34
+ {
35
+ id: 'openai/gpt-5-mini',
36
+ provider: 'openai',
37
+ displayName: 'GPT-5 Mini',
38
+ contextWindow: 400_000,
39
+ capabilities: { search: true, reasoning: true, coding: true, fast: true, cheap: true },
40
+ pricing: { input: 0.25, cachedInput: 0.0625, output: 2.0 },
41
+ searchCost: {
42
+ type: 'token_based',
43
+ description: '検索結果がinputトークンに含まれる(膨張大)',
44
+ },
45
+ maxOutputTokens: 128000,
46
+ releasedAt: '2025-08-07',
47
+ note: 'バランス型',
48
+ },
49
+ {
50
+ id: 'openai/gpt-5-nano',
51
+ provider: 'openai',
52
+ displayName: 'GPT-5 Nano',
53
+ contextWindow: 400_000,
54
+ capabilities: { search: false, reasoning: false, coding: false, fast: true, cheap: true },
55
+ pricing: { input: 0.05, cachedInput: 0.0125, output: 0.4 },
56
+ maxOutputTokens: 128000,
57
+ releasedAt: '2025-08-07',
58
+ note: '最安',
59
+ },
60
+ {
61
+ id: 'openai/gpt-oss-120b',
62
+ provider: 'openai',
63
+ displayName: 'GPT-OSS 120B',
64
+ contextWindow: 131_000,
65
+ capabilities: { search: false, reasoning: true, coding: true, fast: true, cheap: true },
66
+ pricing: { input: 0.1, cachedInput: 0.025, output: 0.5 },
67
+ maxOutputTokens: 32768,
68
+ releasedAt: '2025-08-05',
69
+ note: 'OSS、検索非対応',
70
+ },
71
+ // --- Anthropic ---
72
+ {
73
+ id: 'anthropic/claude-opus-4.6',
74
+ provider: 'anthropic',
75
+ displayName: 'Claude Opus 4.6',
76
+ contextWindow: 1_000_000,
77
+ capabilities: { search: true, reasoning: true, coding: true, fast: false, cheap: false },
78
+ pricing: { input: 5.0, cachedInput: 0.5, output: 25.0 },
79
+ searchCost: {
80
+ type: 'per_request',
81
+ costPerRequest: 0.01,
82
+ description: '$0.01/検索 + 検索結果がinputに含まれる(Dynamic Filtering)',
83
+ },
84
+ maxOutputTokens: 128000,
85
+ releasedAt: '2026-02-05',
86
+ note: '最高性能',
87
+ },
88
+ {
89
+ id: 'anthropic/claude-sonnet-4.6',
90
+ provider: 'anthropic',
91
+ displayName: 'Claude Sonnet 4.6',
92
+ contextWindow: 1_000_000,
93
+ capabilities: { search: true, reasoning: true, coding: true, fast: false, cheap: false },
94
+ pricing: { input: 3.0, cachedInput: 0.3, output: 15.0 },
95
+ searchCost: {
96
+ type: 'per_request',
97
+ costPerRequest: 0.01,
98
+ description: '$0.01/検索 + 検索結果がinputに含まれる(Dynamic Filtering)',
99
+ },
100
+ maxOutputTokens: 128000,
101
+ releasedAt: '2026-02-17',
102
+ note: 'バランス型',
103
+ },
104
+ {
105
+ id: 'anthropic/claude-haiku-4.5',
106
+ provider: 'anthropic',
107
+ displayName: 'Claude Haiku 4.5',
108
+ contextWindow: 200_000,
109
+ capabilities: { search: true, reasoning: false, coding: true, fast: true, cheap: true },
110
+ pricing: { input: 1.0, cachedInput: 0.1, output: 5.0 },
111
+ searchCost: {
112
+ type: 'per_request',
113
+ costPerRequest: 0.01,
114
+ description: '$0.01/検索 + 検索結果がinputに含まれる(Dynamic Filtering)',
115
+ },
116
+ maxOutputTokens: 64000,
117
+ releasedAt: '2025-10-15',
118
+ note: '高速',
119
+ },
120
+ // --- Google ---
121
+ {
122
+ id: 'google/gemini-3-flash',
123
+ provider: 'google',
124
+ displayName: 'Gemini 3 Flash',
125
+ contextWindow: 1_000_000,
126
+ capabilities: { search: true, reasoning: false, coding: true, fast: true, cheap: true },
127
+ pricing: { input: 0.5, cachedInput: 0.125, output: 3.0 },
128
+ searchCost: {
129
+ type: 'per_request',
130
+ costPerRequest: 0.014,
131
+ description: '$0.014/クエリ、inputトークン膨張なし、無料枠5,000/月',
132
+ },
133
+ maxOutputTokens: 8192,
134
+ releasedAt: '2025-12-17',
135
+ note: 'コスパ最強',
136
+ },
137
+ {
138
+ id: 'google/gemini-3.1-pro-preview',
139
+ provider: 'google',
140
+ displayName: 'Gemini 3.1 Pro Preview',
141
+ contextWindow: 1_000_000,
142
+ capabilities: { search: true, reasoning: true, coding: true, fast: false, cheap: false },
143
+ pricing: { input: 2.0, cachedInput: 0.5, output: 12.0 },
144
+ searchCost: {
145
+ type: 'per_request',
146
+ costPerRequest: 0.014,
147
+ description: '$0.014/クエリ、inputトークン膨張なし、無料枠5,000/月',
148
+ },
149
+ maxOutputTokens: 65536,
150
+ releasedAt: '2026-02-19',
151
+ note: '高性能、Gemini 3 Proの後継',
152
+ },
153
+ // --- Perplexity ---
154
+ {
155
+ id: 'perplexity/sonar',
156
+ provider: 'perplexity',
157
+ displayName: 'Perplexity Sonar',
158
+ contextWindow: 127_000,
159
+ capabilities: { search: true, reasoning: false, coding: false, fast: true, cheap: true },
160
+ pricing: { input: 1.0, output: 1.0 },
161
+ searchCost: {
162
+ type: 'per_request',
163
+ costPerRequest: 0.005,
164
+ description: '$0.005/検索リクエスト、inputトークン膨張なし',
165
+ },
166
+ maxOutputTokens: 16384,
167
+ releasedAt: '2025-01-21',
168
+ note: 'ネイティブ検索、searchデフォルト',
169
+ },
170
+ {
171
+ id: 'perplexity/sonar-pro',
172
+ provider: 'perplexity',
173
+ displayName: 'Perplexity Sonar Pro',
174
+ contextWindow: 200_000,
175
+ capabilities: { search: true, reasoning: false, coding: false, fast: false, cheap: false },
176
+ pricing: { input: 3.0, output: 15.0 },
177
+ searchCost: {
178
+ type: 'per_request',
179
+ costPerRequest: 0.005,
180
+ description: '$0.005/検索リクエスト(最大5回の内部検索)、inputトークン膨張なし',
181
+ },
182
+ maxOutputTokens: 16384,
183
+ releasedAt: '2025-01-21',
184
+ note: '高精度検索',
185
+ },
186
+ {
187
+ id: 'perplexity/sonar-reasoning-pro',
188
+ provider: 'perplexity',
189
+ displayName: 'Perplexity Sonar Reasoning Pro',
190
+ contextWindow: 127_000,
191
+ capabilities: { search: true, reasoning: true, coding: false, fast: false, cheap: false },
192
+ pricing: { input: 2.0, output: 8.0 },
193
+ searchCost: {
194
+ type: 'per_request',
195
+ costPerRequest: 0.005,
196
+ description: '$0.005/検索リクエスト(最大5回の内部検索)、inputトークン膨張なし',
197
+ },
198
+ maxOutputTokens: 16384,
199
+ releasedAt: '2025-03-07',
200
+ note: '推論+高精度検索',
201
+ },
202
+ {
203
+ id: 'perplexity/sonar-deep-research',
204
+ provider: 'perplexity',
205
+ displayName: 'Perplexity Sonar Deep Research',
206
+ contextWindow: 128_000,
207
+ capabilities: { search: true, reasoning: true, coding: false, fast: false, cheap: false },
208
+ pricing: { input: 2.0, output: 8.0 },
209
+ searchCost: {
210
+ type: 'per_request',
211
+ costPerRequest: 0.005,
212
+ description: '$0.005/検索リクエスト(1回で複数回検索を自動実行)、推論トークン$3/1M、引用トークン$2/1M が別途発生',
213
+ },
214
+ maxOutputTokens: 16384,
215
+ releasedAt: '2025-03-07',
216
+ note: 'エージェント型マルチ検索調査、コスト構造が複雑',
217
+ },
218
+ ];
219
+ // インデックスで高速アクセス
220
+ const modelMap = new Map(models.map((m) => [m.id, m]));
221
+ /** モデルIDからモデル定義を取得 */
222
+ export function getModel(id) {
223
+ const model = modelMap.get(id);
224
+ if (!model) {
225
+ throw new Error(`不明なモデル: ${id}`);
226
+ }
227
+ return model;
228
+ }
229
+ /** 全モデル一覧を取得 */
230
+ export function getAllModels() {
231
+ return [...models];
232
+ }
233
+ /** プロバイダーでフィルタしたモデル一覧を取得 */
234
+ export function getModelsByProvider(provider) {
235
+ return models.filter((m) => m.provider === provider);
236
+ }
237
+ /** capability でフィルタしたモデル一覧を取得 */
238
+ export function getModelsByCapability(capability) {
239
+ switch (capability) {
240
+ case 'search':
241
+ return models.filter((m) => m.capabilities.search);
242
+ case 'reasoning':
243
+ return models.filter((m) => m.capabilities.reasoning);
244
+ case 'fast':
245
+ return models.filter((m) => m.capabilities.fast);
246
+ case 'cheap':
247
+ return models.filter((m) => m.capabilities.cheap);
248
+ case 'code':
249
+ return models.filter((m) => m.capabilities.coding);
250
+ }
251
+ }
252
+ /** 検索対応モデル一覧を取得 */
253
+ export function getSearchCapableModels() {
254
+ return models.filter((m) => m.capabilities.search);
255
+ }
256
+ /** モデルIDの文字列が有効かチェック */
257
+ export function isValidModelId(id) {
258
+ return modelMap.has(id);
259
+ }
260
+ /** 全モデルID一覧 */
261
+ export function getAllModelIds() {
262
+ return models.map((m) => m.id);
263
+ }
264
+ //# sourceMappingURL=model-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-registry.js","sourceRoot":"","sources":["../../src/lib/model-registry.ts"],"names":[],"mappings":"AAEA,0BAA0B;AAC1B,MAAM,MAAM,GAAsB;IAChC,iBAAiB;IACjB;QACE,EAAE,EAAE,gBAAgB;QACpB,QAAQ,EAAE,QAAQ;QAClB,WAAW,EAAE,SAAS;QACtB,aAAa,EAAE,OAAO;QACtB,YAAY,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;QACxF,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE;QAC3D,UAAU,EAAE;YACV,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,0BAA0B;SACxC;QACD,eAAe,EAAE,MAAM;QACvB,UAAU,EAAE,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CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACrD,KAAK,WAAW;YACd,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QACxD,KAAK,MAAM;YACT,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QACnD,KAAK,OAAO;YACV,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QACpD,KAAK,MAAM;YACT,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACvD,CAAC;AACH,CAAC;AAED,mBAAmB;AACnB,MAAM,UAAU,sBAAsB;IACpC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;AACrD,CAAC;AAED,wBAAwB;AACxB,MAAM,UAAU,cAAc,CAAC,EAAU;IACvC,OAAO,QAAQ,CAAC,GAAG,CAAC,EAAa,CAAC,CAAC;AACrC,CAAC;AAED,eAAe;AACf,MAAM,UAAU,cAAc;IAC5B,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACjC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const anthropic: import("@ai-sdk/anthropic").AnthropicProvider;
2
+ //# sourceMappingURL=anthropic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../src/providers/anthropic.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,+CAGpB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { createAnthropic } from '@ai-sdk/anthropic';
2
+ import { config } from '../config.js';
3
+ export const anthropic = createAnthropic({
4
+ apiKey: config.gatewayApiKey,
5
+ baseURL: config.gatewayBaseUrl,
6
+ });
7
+ //# sourceMappingURL=anthropic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anthropic.js","sourceRoot":"","sources":["../../src/providers/anthropic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC;IACvC,MAAM,EAAE,MAAM,CAAC,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC,cAAc;CAC/B,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const google: import("@ai-sdk/openai").OpenAIProvider;
2
+ //# sourceMappingURL=google.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google.d.ts","sourceRoot":"","sources":["../../src/providers/google.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM,yCAIjB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { createOpenAI } from '@ai-sdk/openai';
2
+ import { config } from '../config.js';
3
+ // Google は独自API形式のため Gateway の OpenAI互換エンドポイント経由で接続
4
+ export const google = createOpenAI({
5
+ apiKey: config.gatewayApiKey,
6
+ baseURL: config.gatewayBaseUrl,
7
+ name: 'google',
8
+ });
9
+ //# sourceMappingURL=google.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google.js","sourceRoot":"","sources":["../../src/providers/google.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,oDAAoD;AACpD,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC,cAAc;IAC9B,IAAI,EAAE,QAAQ;CACf,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { gateway, type LanguageModel } from 'ai';
2
+ export { gateway };
3
+ /** モデル参照文字列("provider/model")から SDK モデルインスタンスを解決 */
4
+ export declare function resolveModel(modelRef: string): LanguageModel;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,IAAI,CAAC;AAGjD,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,oDAAoD;AACpD,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,CAE5D"}
@@ -0,0 +1,8 @@
1
+ import { gateway } from 'ai';
2
+ // デフォルトの gateway インスタンス(AI_GATEWAY_API_KEY 環境変数で自動認証)
3
+ export { gateway };
4
+ /** モデル参照文字列("provider/model")から SDK モデルインスタンスを解決 */
5
+ export function resolveModel(modelRef) {
6
+ return gateway(modelRef);
7
+ }
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAsB,MAAM,IAAI,CAAC;AAEjD,sDAAsD;AACtD,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB,oDAAoD;AACpD,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const openai: import("@ai-sdk/openai").OpenAIProvider;
2
+ //# sourceMappingURL=openai.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../src/providers/openai.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,yCAGjB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { createOpenAI } from '@ai-sdk/openai';
2
+ import { config } from '../config.js';
3
+ export const openai = createOpenAI({
4
+ apiKey: config.gatewayApiKey,
5
+ baseURL: config.gatewayBaseUrl,
6
+ });
7
+ //# sourceMappingURL=openai.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openai.js","sourceRoot":"","sources":["../../src/providers/openai.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC,cAAc;CAC/B,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const perplexity: import("@ai-sdk/openai").OpenAIProvider;
2
+ //# sourceMappingURL=perplexity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"perplexity.d.ts","sourceRoot":"","sources":["../../src/providers/perplexity.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,yCAIrB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { createOpenAI } from '@ai-sdk/openai';
2
+ import { config } from '../config.js';
3
+ // Perplexity は OpenAI互換APIとして Gateway 経由で接続
4
+ export const perplexity = createOpenAI({
5
+ apiKey: config.gatewayApiKey,
6
+ baseURL: config.gatewayBaseUrl,
7
+ name: 'perplexity',
8
+ });
9
+ //# sourceMappingURL=perplexity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"perplexity.js","sourceRoot":"","sources":["../../src/providers/perplexity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,4CAA4C;AAC5C,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC;IACrC,MAAM,EAAE,MAAM,CAAC,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC,cAAc;IAC9B,IAAI,EAAE,YAAY;CACnB,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import type { ToolResponse } from '../types/index.js';
3
+ export declare const askSchema: z.ZodObject<{
4
+ question: z.ZodString;
5
+ model: z.ZodDefault<z.ZodOptional<z.ZodString>>;
6
+ context: z.ZodOptional<z.ZodString>;
7
+ max_tokens: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
8
+ }, z.core.$strip>;
9
+ export declare function askHandler(args: z.infer<typeof askSchema>, _extra?: unknown): Promise<ToolResponse>;
10
+ export declare const askTool: {
11
+ name: string;
12
+ description: string;
13
+ paramsSchema: {
14
+ question: z.ZodString;
15
+ model: z.ZodDefault<z.ZodOptional<z.ZodString>>;
16
+ context: z.ZodOptional<z.ZodString>;
17
+ max_tokens: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
18
+ };
19
+ };
20
+ //# sourceMappingURL=ask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ask.d.ts","sourceRoot":"","sources":["../../src/tools/ask.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAW,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE/D,eAAO,MAAM,SAAS;;;;;iBAyBpB,CAAC;AAEH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,EAC/B,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,YAAY,CAAC,CAmBvB;AAED,eAAO,MAAM,OAAO;;;;;;;;;CAKnB,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { z } from 'zod';
2
+ import { generate } from '../lib/gateway.js';
3
+ import { isValidModelId } from '../lib/model-registry.js';
4
+ export const askSchema = z.object({
5
+ question: z
6
+ .string()
7
+ .min(1)
8
+ .describe("The question to ask, e.g. 'Explain Rust lifetimes' or 'Compare REST vs GraphQL'"),
9
+ model: z
10
+ .string()
11
+ .optional()
12
+ .default('openai/gpt-5.2')
13
+ .describe("Model in provider/name format, e.g. 'openai/gpt-5.2-codex', 'anthropic/claude-sonnet-4.6'"),
14
+ context: z
15
+ .string()
16
+ .optional()
17
+ .describe('Additional context, e.g. code snippets, error messages, or background info'),
18
+ max_tokens: z
19
+ .number()
20
+ .int()
21
+ .positive()
22
+ .optional()
23
+ .default(4000)
24
+ .describe('Max output tokens (default: 4000). Guide: 500-1000 for short answers, 2000-4000 for explanations, 8000+ for detailed analysis. Reasoning models (e.g. sonar-reasoning-pro) use tokens internally for thinking, so set 2x-3x higher than expected output length'),
25
+ });
26
+ export async function askHandler(args, _extra) {
27
+ const modelId = args.model;
28
+ if (!isValidModelId(modelId)) {
29
+ return {
30
+ content: [{ type: 'text', text: `Unknown model: ${modelId}` }],
31
+ isError: true,
32
+ };
33
+ }
34
+ const prompt = args.context ? `${args.context}\n\n${args.question}` : args.question;
35
+ const result = await generate({
36
+ modelId: modelId,
37
+ prompt,
38
+ maxTokens: args.max_tokens,
39
+ });
40
+ return result.response;
41
+ }
42
+ export const askTool = {
43
+ name: 'ask',
44
+ description: 'Ask a single AI model a question (no web search, cannot retrieve latest/real-time information). Default: openai/gpt-5.2 (flagship, $1.75/$14, 400K ctx). For multiple perspectives on a question, prefer research tool with mode:ask synthesize:false. For code: openai/gpt-5.2-codex. For cheaper: openai/gpt-5-mini ($0.25/$2) or google/gemini-3-flash ($0.50/$3). For cheapest: openai/gpt-5-nano ($0.05/$0.40).',
45
+ paramsSchema: askSchema.shape,
46
+ };
47
+ //# sourceMappingURL=ask.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ask.js","sourceRoot":"","sources":["../../src/tools/ask.ts"],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AM,QAAQ,CAAC;QAC5B,OAAO,EAAE,OAAkB;QAC3B,MAAM;QACN,SAAS,EAAE,IAAI,CAAC,UAAU;KAC3B,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,QAAQ,CAAC;AACzB,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE,KAAK;IACX,WAAW,EACT,sZAAsZ;IACxZ,YAAY,EAAE,SAAS,CAAC,KAAK;CAC9B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { askTool, askHandler, askSchema } from './ask.js';
2
+ export { searchTool, searchHandler, searchSchema } from './search.js';
3
+ export { researchTool, researchHandler, researchSchema } from './research.js';
4
+ export { listModelsTool, listModelsHandler, listModelsSchema } from './list-models.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { askTool, askHandler, askSchema } from './ask.js';
2
+ export { searchTool, searchHandler, searchSchema } from './search.js';
3
+ export { researchTool, researchHandler, researchSchema } from './research.js';
4
+ export { listModelsTool, listModelsHandler, listModelsSchema } from './list-models.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { z } from 'zod';
2
+ import type { ToolResponse } from '../types/index.js';
3
+ export declare const listModelsSchema: z.ZodObject<{
4
+ provider: z.ZodOptional<z.ZodEnum<{
5
+ openai: "openai";
6
+ anthropic: "anthropic";
7
+ google: "google";
8
+ perplexity: "perplexity";
9
+ }>>;
10
+ capability: z.ZodOptional<z.ZodEnum<{
11
+ search: "search";
12
+ reasoning: "reasoning";
13
+ fast: "fast";
14
+ cheap: "cheap";
15
+ code: "code";
16
+ }>>;
17
+ }, z.core.$strip>;
18
+ export declare function listModelsHandler(args: z.infer<typeof listModelsSchema>, _extra?: unknown): Promise<ToolResponse>;
19
+ export declare const listModelsTool: {
20
+ name: string;
21
+ description: string;
22
+ paramsSchema: {
23
+ provider: z.ZodOptional<z.ZodEnum<{
24
+ openai: "openai";
25
+ anthropic: "anthropic";
26
+ google: "google";
27
+ perplexity: "perplexity";
28
+ }>>;
29
+ capability: z.ZodOptional<z.ZodEnum<{
30
+ search: "search";
31
+ reasoning: "reasoning";
32
+ fast: "fast";
33
+ cheap: "cheap";
34
+ code: "code";
35
+ }>>;
36
+ };
37
+ };
38
+ //# sourceMappingURL=list-models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-models.d.ts","sourceRoot":"","sources":["../../src/tools/list-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAqC,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEzF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;iBAS3B,CAAC;AA0DH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,EACtC,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,YAAY,CAAC,CAqCvB;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;CAK1B,CAAC"}
@@ -0,0 +1,106 @@
1
+ import { z } from 'zod';
2
+ import { getAllModels, getModelsByProvider, getModelsByCapability } from '../lib/model-registry.js';
3
+ export const listModelsSchema = z.object({
4
+ provider: z
5
+ .enum(['openai', 'anthropic', 'google', 'perplexity'])
6
+ .optional()
7
+ .describe('Filter by provider'),
8
+ capability: z
9
+ .enum(['search', 'reasoning', 'fast', 'cheap', 'code'])
10
+ .optional()
11
+ .describe('Filter by capability'),
12
+ });
13
+ function formatModel(m) {
14
+ const lines = [];
15
+ lines.push(`### ${m.displayName}`);
16
+ lines.push(`- **ID**: \`${m.id}\``);
17
+ lines.push(`- **Provider**: ${m.provider}`);
18
+ lines.push(`- **Context**: ${(m.contextWindow / 1000).toFixed(0)}K tokens`);
19
+ // 能力
20
+ const caps = [];
21
+ if (m.capabilities.search)
22
+ caps.push('Search');
23
+ if (m.capabilities.reasoning)
24
+ caps.push('Reasoning');
25
+ if (m.capabilities.coding)
26
+ caps.push('Code');
27
+ if (m.capabilities.fast)
28
+ caps.push('Fast');
29
+ if (m.capabilities.cheap)
30
+ caps.push('Cheap');
31
+ lines.push(`- **Capabilities**: ${caps.length > 0 ? caps.join(', ') : 'None'}`);
32
+ // 価格
33
+ const priceLines = [`Input: $${m.pricing.input}/1M`];
34
+ if (m.pricing.cachedInput !== undefined) {
35
+ priceLines.push(`Cached: $${m.pricing.cachedInput}/1M`);
36
+ }
37
+ priceLines.push(`Output: $${m.pricing.output}/1M`);
38
+ lines.push(`- **Pricing**: ${priceLines.join(' | ')}`);
39
+ // 検索コスト
40
+ if (m.searchCost) {
41
+ lines.push(`- **Search cost**: ${m.searchCost.description}`);
42
+ }
43
+ if (m.maxOutputTokens) {
44
+ lines.push(`- **Max output**: ${m.maxOutputTokens.toLocaleString()} tokens`);
45
+ }
46
+ if (m.releasedAt) {
47
+ lines.push(`- **Released**: ${m.releasedAt}`);
48
+ }
49
+ if (m.note) {
50
+ lines.push(`- **Note**: ${m.note}`);
51
+ }
52
+ return lines.join('\n');
53
+ }
54
+ function groupByProvider(models) {
55
+ const groups = {};
56
+ for (const m of models) {
57
+ if (!groups[m.provider]) {
58
+ groups[m.provider] = [];
59
+ }
60
+ groups[m.provider].push(m);
61
+ }
62
+ return groups;
63
+ }
64
+ export async function listModelsHandler(args, _extra) {
65
+ let models;
66
+ if (args.provider && args.capability) {
67
+ // 両方指定された場合: プロバイダーフィルタ → capability フィルタ
68
+ const byProvider = getModelsByProvider(args.provider);
69
+ const capModels = getModelsByCapability(args.capability);
70
+ const capIds = new Set(capModels.map((m) => m.id));
71
+ models = byProvider.filter((m) => capIds.has(m.id));
72
+ }
73
+ else if (args.provider) {
74
+ models = getModelsByProvider(args.provider);
75
+ }
76
+ else if (args.capability) {
77
+ models = getModelsByCapability(args.capability);
78
+ }
79
+ else {
80
+ models = getAllModels();
81
+ }
82
+ const filters = [];
83
+ if (args.provider)
84
+ filters.push(`provider: ${args.provider}`);
85
+ if (args.capability)
86
+ filters.push(`capability: ${args.capability}`);
87
+ const filterStr = filters.length > 0 ? ` (${filters.join(', ')})` : '';
88
+ const title = `# Available Models${filterStr}`;
89
+ const providerGroups = groupByProvider(models);
90
+ const sections = Object.entries(providerGroups)
91
+ .map(([provider, providerModels]) => {
92
+ const modelSections = providerModels.map(formatModel).join('\n\n');
93
+ return `## ${provider}\n\n${modelSections}`;
94
+ })
95
+ .join('\n\n---\n\n');
96
+ const summary = `${title}\n\nTotal: ${models.length} models\n\n${sections}`;
97
+ return {
98
+ content: [{ type: 'text', text: summary }],
99
+ };
100
+ }
101
+ export const listModelsTool = {
102
+ name: 'list_models',
103
+ description: 'List available AI models with capabilities, pricing, and web search costs. Use this to choose the right model for your task.',
104
+ paramsSchema: listModelsSchema.shape,
105
+ };
106
+ //# sourceMappingURL=list-models.js.map