@agnt-sdk/studio 0.0.1

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 (78) hide show
  1. package/README.md +162 -0
  2. package/dist/AgntExecutor.d.ts +56 -0
  3. package/dist/AgntExecutor.d.ts.map +1 -0
  4. package/dist/AgntExecutor.js +117 -0
  5. package/dist/AgntExecutor.js.map +1 -0
  6. package/dist/BaseExecutor.d.ts +69 -0
  7. package/dist/BaseExecutor.d.ts.map +1 -0
  8. package/dist/BaseExecutor.js +528 -0
  9. package/dist/BaseExecutor.js.map +1 -0
  10. package/dist/ImageCache.d.ts +94 -0
  11. package/dist/ImageCache.d.ts.map +1 -0
  12. package/dist/ImageCache.js +232 -0
  13. package/dist/ImageCache.js.map +1 -0
  14. package/dist/cli/commands/init.d.ts +5 -0
  15. package/dist/cli/commands/init.d.ts.map +1 -0
  16. package/dist/cli/commands/init.js +47 -0
  17. package/dist/cli/commands/init.js.map +1 -0
  18. package/dist/cli/commands/pull.d.ts +10 -0
  19. package/dist/cli/commands/pull.d.ts.map +1 -0
  20. package/dist/cli/commands/pull.js +82 -0
  21. package/dist/cli/commands/pull.js.map +1 -0
  22. package/dist/cli/index.d.ts +6 -0
  23. package/dist/cli/index.d.ts.map +1 -0
  24. package/dist/cli/index.js +28 -0
  25. package/dist/cli/index.js.map +1 -0
  26. package/dist/cli/utils/api.d.ts +38 -0
  27. package/dist/cli/utils/api.d.ts.map +1 -0
  28. package/dist/cli/utils/api.js +44 -0
  29. package/dist/cli/utils/api.js.map +1 -0
  30. package/dist/cli/utils/config.d.ts +5 -0
  31. package/dist/cli/utils/config.d.ts.map +1 -0
  32. package/dist/cli/utils/config.js +5 -0
  33. package/dist/cli/utils/config.js.map +1 -0
  34. package/dist/conditions.d.ts +14 -0
  35. package/dist/conditions.d.ts.map +1 -0
  36. package/dist/conditions.js +59 -0
  37. package/dist/conditions.js.map +1 -0
  38. package/dist/executorFactory.d.ts +10 -0
  39. package/dist/executorFactory.d.ts.map +1 -0
  40. package/dist/executorFactory.js +45 -0
  41. package/dist/executorFactory.js.map +1 -0
  42. package/dist/index.d.ts +21 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +26 -0
  45. package/dist/index.js.map +1 -0
  46. package/dist/providers/anthropic.d.ts +22 -0
  47. package/dist/providers/anthropic.d.ts.map +1 -0
  48. package/dist/providers/anthropic.js +280 -0
  49. package/dist/providers/anthropic.js.map +1 -0
  50. package/dist/providers/bedrock.d.ts +23 -0
  51. package/dist/providers/bedrock.d.ts.map +1 -0
  52. package/dist/providers/bedrock.js +281 -0
  53. package/dist/providers/bedrock.js.map +1 -0
  54. package/dist/providers/deepseek.d.ts +22 -0
  55. package/dist/providers/deepseek.d.ts.map +1 -0
  56. package/dist/providers/deepseek.js +193 -0
  57. package/dist/providers/deepseek.js.map +1 -0
  58. package/dist/providers/google.d.ts +22 -0
  59. package/dist/providers/google.d.ts.map +1 -0
  60. package/dist/providers/google.js +357 -0
  61. package/dist/providers/google.js.map +1 -0
  62. package/dist/providers/openai.d.ts +22 -0
  63. package/dist/providers/openai.d.ts.map +1 -0
  64. package/dist/providers/openai.js +194 -0
  65. package/dist/providers/openai.js.map +1 -0
  66. package/dist/systemTools.d.ts +6 -0
  67. package/dist/systemTools.d.ts.map +1 -0
  68. package/dist/systemTools.js +15 -0
  69. package/dist/systemTools.js.map +1 -0
  70. package/dist/tracing.d.ts +32 -0
  71. package/dist/tracing.d.ts.map +1 -0
  72. package/dist/tracing.js +38 -0
  73. package/dist/tracing.js.map +1 -0
  74. package/dist/types.d.ts +280 -0
  75. package/dist/types.d.ts.map +1 -0
  76. package/dist/types.js +5 -0
  77. package/dist/types.js.map +1 -0
  78. package/package.json +76 -0
@@ -0,0 +1,281 @@
1
+ /**
2
+ * BedrockExecutor - Provider adapter for AWS Bedrock models
3
+ *
4
+ * Uses native @aws-sdk/client-bedrock-runtime (not LangChain)
5
+ */
6
+ import { BedrockRuntimeClient, ConverseCommand } from '@aws-sdk/client-bedrock-runtime';
7
+ import BaseExecutor from '../BaseExecutor.js';
8
+ export default class BedrockExecutor extends BaseExecutor {
9
+ client;
10
+ region;
11
+ constructor(config) {
12
+ super(config);
13
+ // Get Bedrock credentials
14
+ const bedrockCreds = this.credentials.bedrock;
15
+ if (!bedrockCreds) {
16
+ throw new Error('[BedrockExecutor] credentials.bedrock is required');
17
+ }
18
+ if (!bedrockCreds.region) {
19
+ throw new Error('[BedrockExecutor] credentials.bedrock.region is required');
20
+ }
21
+ // Initialize Bedrock client
22
+ const clientConfig = { region: bedrockCreds.region };
23
+ // Add credentials if provided (optional - can use AWS SDK default credential chain)
24
+ if (bedrockCreds.accessKeyId && bedrockCreds.secretAccessKey) {
25
+ clientConfig.credentials = {
26
+ accessKeyId: bedrockCreds.accessKeyId,
27
+ secretAccessKey: bedrockCreds.secretAccessKey
28
+ };
29
+ }
30
+ this.client = new BedrockRuntimeClient(clientConfig);
31
+ this.region = bedrockCreds.region;
32
+ this.log(`[BedrockExecutor] Initialized with model: ${this.model}, region: ${this.region}`);
33
+ }
34
+ /**
35
+ * Invoke Bedrock Converse API
36
+ * Returns: { message: { role, content, tool_calls }, usage: { input_tokens, output_tokens } }
37
+ */
38
+ async invoke(messages, options = {}) {
39
+ // Extract provider-specific parameters
40
+ const providerParams = this.#extractProviderParams();
41
+ // Extract system messages (Bedrock requires separate system parameter)
42
+ const systemMessages = messages.filter(m => m.role === 'system');
43
+ const systemContent = systemMessages.map(m => m.content).join('\n\n');
44
+ // Build request parameters
45
+ const params = {
46
+ modelId: this.model,
47
+ messages: this.#formatMessages(messages),
48
+ inferenceConfig: {
49
+ maxTokens: providerParams.maxTokens || providerParams.max_tokens || 4096
50
+ }
51
+ };
52
+ // Add system parameter if we have system messages
53
+ if (systemContent) {
54
+ params.system = [{ text: systemContent }];
55
+ }
56
+ // Add temperature if defined
57
+ if (providerParams.temperature !== undefined) {
58
+ params.inferenceConfig.temperature = providerParams.temperature;
59
+ }
60
+ // Add top_p if defined
61
+ if (providerParams.top_p !== undefined) {
62
+ params.inferenceConfig.topP = providerParams.top_p;
63
+ }
64
+ // Add tools if provided
65
+ if (options.tools && options.tools.length > 0) {
66
+ params.toolConfig = {
67
+ tools: options.tools.map(t => this.#formatTool(t))
68
+ };
69
+ // Add tool_choice if specified
70
+ if (options.tool_choice && options.tool_choice !== 'auto') {
71
+ params.toolConfig.toolChoice = this.#formatToolChoice(options.tool_choice);
72
+ }
73
+ }
74
+ this.log('[BedrockExecutor] Invoking:', {
75
+ model: params.modelId,
76
+ temperature: params.inferenceConfig.temperature,
77
+ top_p: params.inferenceConfig.topP,
78
+ tools: params.toolConfig?.tools?.length || 0
79
+ });
80
+ // Call Bedrock Converse API
81
+ const command = new ConverseCommand(params);
82
+ const response = await this.client.send(command);
83
+ // Format response to match expected structure
84
+ const output = response.output;
85
+ const message = output.message;
86
+ return {
87
+ message: {
88
+ role: 'assistant',
89
+ content: this.#extractTextContent(message.content),
90
+ tool_calls: this.#extractToolCalls(message.content)
91
+ },
92
+ usage: {
93
+ input_tokens: response.usage.inputTokens,
94
+ output_tokens: response.usage.outputTokens
95
+ }
96
+ };
97
+ }
98
+ /**
99
+ * Check if message has tool calls
100
+ */
101
+ hasToolCalls(message) {
102
+ return Boolean(message?.tool_calls && message.tool_calls.length > 0);
103
+ }
104
+ /**
105
+ * Format messages for Bedrock Converse API
106
+ */
107
+ #formatMessages(messages) {
108
+ const formatted = [];
109
+ for (const msg of messages) {
110
+ // Skip system messages (handled separately in Bedrock)
111
+ if (msg.role === 'system') {
112
+ continue;
113
+ }
114
+ // Handle tool messages
115
+ if (msg.role === 'tool') {
116
+ formatted.push({
117
+ role: 'user',
118
+ content: [
119
+ {
120
+ toolResult: {
121
+ toolUseId: msg.tool_call_id,
122
+ content: [
123
+ {
124
+ json: typeof msg.content === 'string'
125
+ ? JSON.parse(msg.content)
126
+ : msg.content
127
+ }
128
+ ]
129
+ }
130
+ }
131
+ ]
132
+ });
133
+ continue;
134
+ }
135
+ // Handle user/assistant messages
136
+ const content = typeof msg.content === 'string'
137
+ ? [{ text: msg.content }]
138
+ : this.#formatContent(msg.content);
139
+ formatted.push({
140
+ role: msg.role,
141
+ content
142
+ });
143
+ }
144
+ return formatted;
145
+ }
146
+ /**
147
+ * Format content blocks
148
+ */
149
+ #formatContent(content) {
150
+ if (typeof content === 'string') {
151
+ return [{ text: content }];
152
+ }
153
+ if (Array.isArray(content)) {
154
+ return content.map(item => {
155
+ if (item.type === 'text') {
156
+ return { text: item.text || item.content };
157
+ }
158
+ if (item.type === 'image_url') {
159
+ // Bedrock expects images in a specific format
160
+ // This should be handled by ImageCache before getting here
161
+ this.log('[BedrockExecutor] Warning: Image processing not yet implemented');
162
+ return null;
163
+ }
164
+ return item;
165
+ }).filter(Boolean);
166
+ }
167
+ return [{ text: String(content) }];
168
+ }
169
+ /**
170
+ * Format tool definition for Bedrock
171
+ */
172
+ #formatTool(tool) {
173
+ // Tool might be in OpenAI format: { type: "function", function: { name, description, parameters } }
174
+ // Or Anthropic format: { name, description, input_schema }
175
+ // Or Studio format: { name, description, parameters }
176
+ let toolSpec;
177
+ // OpenAI format: { type: "function", function: { name, description, parameters } }
178
+ if (tool.function) {
179
+ toolSpec = {
180
+ name: tool.function.name,
181
+ description: tool.function.description || '',
182
+ inputSchema: {
183
+ json: tool.function.parameters || { type: 'object', properties: {} }
184
+ }
185
+ };
186
+ }
187
+ // Anthropic format: { name, description, input_schema }
188
+ else if (tool.input_schema) {
189
+ toolSpec = {
190
+ name: tool.name,
191
+ description: tool.description || '',
192
+ inputSchema: {
193
+ json: tool.input_schema
194
+ }
195
+ };
196
+ }
197
+ // Studio format: { name, description, parameters }
198
+ else if (tool.parameters) {
199
+ toolSpec = {
200
+ name: tool.name,
201
+ description: tool.description || '',
202
+ inputSchema: {
203
+ json: tool.parameters
204
+ }
205
+ };
206
+ }
207
+ // Fallback
208
+ else {
209
+ this.log('[BedrockExecutor] Warning: Unrecognized tool format:', JSON.stringify(tool));
210
+ toolSpec = {
211
+ name: tool.name || 'unknown',
212
+ description: tool.description || '',
213
+ inputSchema: {
214
+ json: tool.input_schema || tool.parameters || { type: 'object', properties: {} }
215
+ }
216
+ };
217
+ }
218
+ return { toolSpec };
219
+ }
220
+ /**
221
+ * Format tool_choice for Bedrock
222
+ */
223
+ #formatToolChoice(toolChoice) {
224
+ if (typeof toolChoice === 'string') {
225
+ if (toolChoice === 'required' || toolChoice === 'any') {
226
+ return { any: {} };
227
+ }
228
+ return { auto: {} };
229
+ }
230
+ // Specific tool selection
231
+ if (toolChoice.type === 'function' && toolChoice.function?.name) {
232
+ return { tool: { name: toolChoice.function.name } };
233
+ }
234
+ if (toolChoice.type === 'tool' && toolChoice.name) {
235
+ return { tool: { name: toolChoice.name } };
236
+ }
237
+ return { auto: {} };
238
+ }
239
+ /**
240
+ * Extract text content from response
241
+ */
242
+ #extractTextContent(content) {
243
+ if (!content || content.length === 0) {
244
+ return '';
245
+ }
246
+ // Find text blocks
247
+ const textBlocks = content.filter(block => block.text);
248
+ if (textBlocks.length === 0) {
249
+ return '';
250
+ }
251
+ return textBlocks.map(block => block.text).join('\n');
252
+ }
253
+ /**
254
+ * Extract tool calls from response
255
+ */
256
+ #extractToolCalls(content) {
257
+ if (!content || content.length === 0) {
258
+ return [];
259
+ }
260
+ // Find toolUse blocks
261
+ const toolUseBlocks = content.filter(block => block.toolUse);
262
+ if (toolUseBlocks.length === 0) {
263
+ return [];
264
+ }
265
+ return toolUseBlocks.map(block => ({
266
+ id: block.toolUse.toolUseId,
267
+ name: block.toolUse.name,
268
+ args: block.toolUse.input
269
+ }));
270
+ }
271
+ /**
272
+ * Extract provider-specific parameters from model config
273
+ * Excludes displayName, passes rest to Bedrock API
274
+ */
275
+ #extractProviderParams() {
276
+ const metadata = this.primaryModelConfig.metadata || {};
277
+ const { displayName, ...providerParams } = metadata;
278
+ return providerParams;
279
+ }
280
+ }
281
+ //# sourceMappingURL=bedrock.js.map
@@ -0,0 +1 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CAAC;YACjC,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS;YAC3B,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI;YACxB,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;SAC1B,CAAC,CAAC,CAAC;IACN,CAAC;IAED;;;OAGG;IACH,sBAAsB;QACpB,MAAM,QAAQ,GAAI,IAAI,CAAC,kBAA0B,CAAC,QAAQ,IAAI,EAAE,CAAC;QACjE,MAAM,EAAE,WAAW,EAAE,GAAG,cAAc,EAAE,GAAG,QAAQ,CAAC;QACpD,OAAO,cAAc,CAAC;IACxB,CAAC;CACF"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * DeepSeekExecutor - Provider adapter for DeepSeek models
3
+ *
4
+ * DeepSeek uses OpenAI-compatible API
5
+ */
6
+ import BaseExecutor from '../BaseExecutor.js';
7
+ import type { BaseExecutorConfig, Message, InvokeOptions, InvokeResult } from '../types.js';
8
+ export default class DeepSeekExecutor extends BaseExecutor {
9
+ #private;
10
+ private client;
11
+ constructor(config: BaseExecutorConfig);
12
+ /**
13
+ * Invoke DeepSeek API
14
+ * Returns: { message: { role, content, tool_calls }, usage: { input_tokens, output_tokens } }
15
+ */
16
+ invoke(messages: Message[], options?: InvokeOptions): Promise<InvokeResult>;
17
+ /**
18
+ * Check if message has tool calls
19
+ */
20
+ hasToolCalls(message: Message): boolean;
21
+ }
22
+ //# sourceMappingURL=deepseek.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepseek.d.ts","sourceRoot":"","sources":["../../src/providers/deepseek.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE5F,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,YAAY;;IACxD,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,EAAE,kBAAkB;IAsBtC;;;OAGG;IACG,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;IAgDrF;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO;CAmIxC"}
@@ -0,0 +1,193 @@
1
+ /**
2
+ * DeepSeekExecutor - Provider adapter for DeepSeek models
3
+ *
4
+ * DeepSeek uses OpenAI-compatible API
5
+ */
6
+ import OpenAI from 'openai';
7
+ import BaseExecutor from '../BaseExecutor.js';
8
+ export default class DeepSeekExecutor extends BaseExecutor {
9
+ client;
10
+ constructor(config) {
11
+ super(config);
12
+ // Get DeepSeek credentials
13
+ const deepseekCreds = this.credentials.deepseek;
14
+ if (!deepseekCreds) {
15
+ throw new Error('[DeepSeekExecutor] credentials.deepseek is required');
16
+ }
17
+ if (!deepseekCreds.apiKey) {
18
+ throw new Error('[DeepSeekExecutor] credentials.deepseek.apiKey is required');
19
+ }
20
+ // Initialize DeepSeek client (OpenAI-compatible)
21
+ this.client = new OpenAI({
22
+ apiKey: deepseekCreds.apiKey,
23
+ baseURL: 'https://api.deepseek.com/v1',
24
+ dangerouslyAllowBrowser: deepseekCreds.dangerouslyAllowBrowser
25
+ });
26
+ this.log(`[DeepSeekExecutor] Initialized with model: ${this.model}`);
27
+ }
28
+ /**
29
+ * Invoke DeepSeek API
30
+ * Returns: { message: { role, content, tool_calls }, usage: { input_tokens, output_tokens } }
31
+ */
32
+ async invoke(messages, options = {}) {
33
+ // Build request parameters
34
+ const params = {
35
+ model: this.model,
36
+ messages: this.#formatMessages(messages),
37
+ };
38
+ // Add all provider-specific parameters from model config
39
+ const providerParams = this.#extractProviderParams();
40
+ Object.assign(params, providerParams);
41
+ // Add tools if provided
42
+ if (options.tools && options.tools.length > 0) {
43
+ params.tools = options.tools.map(t => this.#formatTool(t));
44
+ }
45
+ // Add tool_choice if specified
46
+ if (options.tool_choice && options.tool_choice !== 'auto') {
47
+ params.tool_choice = this.#formatToolChoice(options.tool_choice);
48
+ }
49
+ this.log('[DeepSeekExecutor] Invoking:', {
50
+ model: params.model,
51
+ temperature: params.temperature,
52
+ top_p: params.top_p,
53
+ tools: params.tools?.length || 0
54
+ });
55
+ // Call DeepSeek API (OpenAI-compatible)
56
+ const response = await this.client.chat.completions.create(params);
57
+ const choice = response.choices[0];
58
+ const message = choice.message;
59
+ // Format response to match expected structure
60
+ return {
61
+ message: {
62
+ role: message.role,
63
+ content: message.content || '',
64
+ tool_calls: this.#extractToolCalls(message.tool_calls)
65
+ },
66
+ usage: {
67
+ input_tokens: response.usage.prompt_tokens,
68
+ output_tokens: response.usage.completion_tokens
69
+ }
70
+ };
71
+ }
72
+ /**
73
+ * Check if message has tool calls
74
+ */
75
+ hasToolCalls(message) {
76
+ return Boolean(message?.tool_calls && message.tool_calls.length > 0);
77
+ }
78
+ /**
79
+ * Format messages for DeepSeek API (OpenAI format)
80
+ */
81
+ #formatMessages(messages) {
82
+ return messages.map(msg => {
83
+ // Handle tool messages
84
+ if (msg.role === 'tool') {
85
+ return {
86
+ role: 'tool',
87
+ tool_call_id: msg.tool_call_id,
88
+ content: msg.content
89
+ };
90
+ }
91
+ // Handle regular messages
92
+ return {
93
+ role: msg.role,
94
+ content: msg.content
95
+ };
96
+ });
97
+ }
98
+ /**
99
+ * Format tool definition for DeepSeek (OpenAI format)
100
+ */
101
+ #formatTool(tool) {
102
+ // Already in OpenAI format: { type: "function", function: { name, description, parameters } }
103
+ if (tool.type === 'function' && tool.function) {
104
+ return tool;
105
+ }
106
+ // If has function field but no type (partial OpenAI format)
107
+ if (tool.function) {
108
+ return {
109
+ type: 'function',
110
+ function: tool.function
111
+ };
112
+ }
113
+ // Anthropic format: { name, description, input_schema } - convert to OpenAI
114
+ if (tool.input_schema) {
115
+ return {
116
+ type: 'function',
117
+ function: {
118
+ name: tool.name,
119
+ description: tool.description || '',
120
+ parameters: tool.input_schema
121
+ }
122
+ };
123
+ }
124
+ // Studio format: { name, description, parameters } - convert to OpenAI format
125
+ if (tool.parameters) {
126
+ return {
127
+ type: 'function',
128
+ function: {
129
+ name: tool.name,
130
+ description: tool.description || '',
131
+ parameters: tool.parameters
132
+ }
133
+ };
134
+ }
135
+ // Fallback: wrap in OpenAI format
136
+ this.log('[DeepSeekExecutor] Warning: Unrecognized tool format:', JSON.stringify(tool));
137
+ return {
138
+ type: 'function',
139
+ function: {
140
+ name: tool.name || 'unknown',
141
+ description: tool.description || '',
142
+ parameters: tool.parameters || tool.input_schema || { type: 'object', properties: {} }
143
+ }
144
+ };
145
+ }
146
+ /**
147
+ * Format tool_choice for DeepSeek (OpenAI format)
148
+ */
149
+ #formatToolChoice(toolChoice) {
150
+ if (typeof toolChoice === 'string') {
151
+ // "required" or "any" -> "required"
152
+ if (toolChoice === 'required' || toolChoice === 'any') {
153
+ return 'required';
154
+ }
155
+ return 'auto';
156
+ }
157
+ // If it's a specific tool: { type: "function", function: { name: "..." } }
158
+ if (toolChoice.type === 'function' || toolChoice.function?.name) {
159
+ return toolChoice;
160
+ }
161
+ // Anthropic format: { type: "tool", name: "..." }
162
+ if (toolChoice.type === 'tool' && toolChoice.name) {
163
+ return {
164
+ type: 'function',
165
+ function: { name: toolChoice.name }
166
+ };
167
+ }
168
+ return 'auto';
169
+ }
170
+ /**
171
+ * Extract tool calls from DeepSeek response (OpenAI format)
172
+ */
173
+ #extractToolCalls(toolCalls) {
174
+ if (!toolCalls || toolCalls.length === 0) {
175
+ return [];
176
+ }
177
+ return toolCalls.map(tc => ({
178
+ id: tc.id,
179
+ name: tc.function.name,
180
+ args: JSON.parse(tc.function.arguments)
181
+ }));
182
+ }
183
+ /**
184
+ * Extract provider-specific parameters from model config
185
+ * Excludes displayName, passes rest to DeepSeek API
186
+ */
187
+ #extractProviderParams() {
188
+ const metadata = this.primaryModelConfig.metadata || {};
189
+ const { displayName, ...providerParams } = metadata;
190
+ return providerParams;
191
+ }
192
+ }
193
+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E,UAAU,CAAC,IAAI,EAAE;aACpC,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,iBAAiB,CAAC,SAA4B;QAC5C,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YAC1B,EAAE,EAAE,EAAE,CAAC,EAAE;YACT,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI;YACtB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC;SACxC,CAAC,CAAC,CAAC;IACN,CAAC;IAED;;;OAGG;IACH,sBAAsB;QACpB,MAAM,QAAQ,GAAI,IAAI,CAAC,kBAA0B,CAAC,QAAQ,IAAI,EAAE,CAAC;QACjE,MAAM,EAAE,WAAW,EAAE,GAAG,cAAc,EAAE,GAAG,QAAQ,CAAC;QACpD,OAAO,cAAc,CAAC;IACxB,CAAC;CACF"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * GoogleExecutor - Provider adapter for Google Gemini models
3
+ *
4
+ * Uses native @google/generative-ai SDK
5
+ */
6
+ import BaseExecutor from '../BaseExecutor.js';
7
+ import type { BaseExecutorConfig, Message, InvokeOptions, InvokeResult } from '../types.js';
8
+ export default class GoogleExecutor extends BaseExecutor {
9
+ #private;
10
+ private client;
11
+ constructor(config: BaseExecutorConfig);
12
+ /**
13
+ * Invoke Google Gemini API
14
+ * Returns: { message: { role, content, tool_calls }, usage: { input_tokens, output_tokens } }
15
+ */
16
+ invoke(messages: Message[], options?: InvokeOptions): Promise<InvokeResult>;
17
+ /**
18
+ * Check if message has tool calls
19
+ */
20
+ hasToolCalls(message: Message): boolean;
21
+ }
22
+ //# sourceMappingURL=google.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google.d.ts","sourceRoot":"","sources":["../../src/providers/google.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE5F,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,YAAY;;IACtD,OAAO,CAAC,MAAM,CAAqB;gBAEvB,MAAM,EAAE,kBAAkB;IA4BtC;;;OAGG;IACG,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;IA+ErF;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO;CA6RxC"}