@didim365/agent-cli-core 0.2.18 → 0.2.19
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/src/generated/git-commit.d.ts +1 -1
- package/dist/src/generated/git-commit.js +1 -1
- package/dist/src/ide/types.d.ts +36 -36
- package/dist/src/providers/gemini/requestBuilder.d.ts +22 -0
- package/dist/src/providers/gemini/requestBuilder.js +131 -1
- package/dist/src/providers/gemini/requestBuilder.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
// This file is auto-generated by the build script (scripts/generate-git-commit-info.js)
|
|
7
7
|
// Do not edit this file manually.
|
|
8
|
-
export const GIT_COMMIT_INFO = '
|
|
8
|
+
export const GIT_COMMIT_INFO = '3a76b5fed';
|
|
9
9
|
export const CLI_VERSION = '0.30.0';
|
|
10
10
|
//# sourceMappingURL=git-commit.js.map
|
package/dist/src/ide/types.d.ts
CHANGED
|
@@ -46,21 +46,21 @@ export declare const FileSchema: z.ZodObject<{
|
|
|
46
46
|
}, "strip", z.ZodTypeAny, {
|
|
47
47
|
path: string;
|
|
48
48
|
timestamp: number;
|
|
49
|
-
isActive?: boolean | undefined;
|
|
50
|
-
selectedText?: string | undefined;
|
|
51
49
|
cursor?: {
|
|
52
50
|
line: number;
|
|
53
51
|
character: number;
|
|
54
52
|
} | undefined;
|
|
53
|
+
isActive?: boolean | undefined;
|
|
54
|
+
selectedText?: string | undefined;
|
|
55
55
|
}, {
|
|
56
56
|
path: string;
|
|
57
57
|
timestamp: number;
|
|
58
|
-
isActive?: boolean | undefined;
|
|
59
|
-
selectedText?: string | undefined;
|
|
60
58
|
cursor?: {
|
|
61
59
|
line: number;
|
|
62
60
|
character: number;
|
|
63
61
|
} | undefined;
|
|
62
|
+
isActive?: boolean | undefined;
|
|
63
|
+
selectedText?: string | undefined;
|
|
64
64
|
}>;
|
|
65
65
|
export type File = z.infer<typeof FileSchema>;
|
|
66
66
|
/**
|
|
@@ -110,21 +110,21 @@ export declare const IdeContextSchema: z.ZodObject<{
|
|
|
110
110
|
}, "strip", z.ZodTypeAny, {
|
|
111
111
|
path: string;
|
|
112
112
|
timestamp: number;
|
|
113
|
-
isActive?: boolean | undefined;
|
|
114
|
-
selectedText?: string | undefined;
|
|
115
113
|
cursor?: {
|
|
116
114
|
line: number;
|
|
117
115
|
character: number;
|
|
118
116
|
} | undefined;
|
|
117
|
+
isActive?: boolean | undefined;
|
|
118
|
+
selectedText?: string | undefined;
|
|
119
119
|
}, {
|
|
120
120
|
path: string;
|
|
121
121
|
timestamp: number;
|
|
122
|
-
isActive?: boolean | undefined;
|
|
123
|
-
selectedText?: string | undefined;
|
|
124
122
|
cursor?: {
|
|
125
123
|
line: number;
|
|
126
124
|
character: number;
|
|
127
125
|
} | undefined;
|
|
126
|
+
isActive?: boolean | undefined;
|
|
127
|
+
selectedText?: string | undefined;
|
|
128
128
|
}>, "many">>;
|
|
129
129
|
/**
|
|
130
130
|
* Whether the workspace is trusted.
|
|
@@ -134,24 +134,24 @@ export declare const IdeContextSchema: z.ZodObject<{
|
|
|
134
134
|
openFiles?: {
|
|
135
135
|
path: string;
|
|
136
136
|
timestamp: number;
|
|
137
|
-
isActive?: boolean | undefined;
|
|
138
|
-
selectedText?: string | undefined;
|
|
139
137
|
cursor?: {
|
|
140
138
|
line: number;
|
|
141
139
|
character: number;
|
|
142
140
|
} | undefined;
|
|
141
|
+
isActive?: boolean | undefined;
|
|
142
|
+
selectedText?: string | undefined;
|
|
143
143
|
}[] | undefined;
|
|
144
144
|
isTrusted?: boolean | undefined;
|
|
145
145
|
}, {
|
|
146
146
|
openFiles?: {
|
|
147
147
|
path: string;
|
|
148
148
|
timestamp: number;
|
|
149
|
-
isActive?: boolean | undefined;
|
|
150
|
-
selectedText?: string | undefined;
|
|
151
149
|
cursor?: {
|
|
152
150
|
line: number;
|
|
153
151
|
character: number;
|
|
154
152
|
} | undefined;
|
|
153
|
+
isActive?: boolean | undefined;
|
|
154
|
+
selectedText?: string | undefined;
|
|
155
155
|
}[] | undefined;
|
|
156
156
|
isTrusted?: boolean | undefined;
|
|
157
157
|
}>>;
|
|
@@ -160,12 +160,12 @@ export declare const IdeContextSchema: z.ZodObject<{
|
|
|
160
160
|
openFiles?: {
|
|
161
161
|
path: string;
|
|
162
162
|
timestamp: number;
|
|
163
|
-
isActive?: boolean | undefined;
|
|
164
|
-
selectedText?: string | undefined;
|
|
165
163
|
cursor?: {
|
|
166
164
|
line: number;
|
|
167
165
|
character: number;
|
|
168
166
|
} | undefined;
|
|
167
|
+
isActive?: boolean | undefined;
|
|
168
|
+
selectedText?: string | undefined;
|
|
169
169
|
}[] | undefined;
|
|
170
170
|
isTrusted?: boolean | undefined;
|
|
171
171
|
} | undefined;
|
|
@@ -174,12 +174,12 @@ export declare const IdeContextSchema: z.ZodObject<{
|
|
|
174
174
|
openFiles?: {
|
|
175
175
|
path: string;
|
|
176
176
|
timestamp: number;
|
|
177
|
-
isActive?: boolean | undefined;
|
|
178
|
-
selectedText?: string | undefined;
|
|
179
177
|
cursor?: {
|
|
180
178
|
line: number;
|
|
181
179
|
character: number;
|
|
182
180
|
} | undefined;
|
|
181
|
+
isActive?: boolean | undefined;
|
|
182
|
+
selectedText?: string | undefined;
|
|
183
183
|
}[] | undefined;
|
|
184
184
|
isTrusted?: boolean | undefined;
|
|
185
185
|
} | undefined;
|
|
@@ -235,21 +235,21 @@ export declare const IdeContextNotificationSchema: z.ZodObject<{
|
|
|
235
235
|
}, "strip", z.ZodTypeAny, {
|
|
236
236
|
path: string;
|
|
237
237
|
timestamp: number;
|
|
238
|
-
isActive?: boolean | undefined;
|
|
239
|
-
selectedText?: string | undefined;
|
|
240
238
|
cursor?: {
|
|
241
239
|
line: number;
|
|
242
240
|
character: number;
|
|
243
241
|
} | undefined;
|
|
242
|
+
isActive?: boolean | undefined;
|
|
243
|
+
selectedText?: string | undefined;
|
|
244
244
|
}, {
|
|
245
245
|
path: string;
|
|
246
246
|
timestamp: number;
|
|
247
|
-
isActive?: boolean | undefined;
|
|
248
|
-
selectedText?: string | undefined;
|
|
249
247
|
cursor?: {
|
|
250
248
|
line: number;
|
|
251
249
|
character: number;
|
|
252
250
|
} | undefined;
|
|
251
|
+
isActive?: boolean | undefined;
|
|
252
|
+
selectedText?: string | undefined;
|
|
253
253
|
}>, "many">>;
|
|
254
254
|
/**
|
|
255
255
|
* Whether the workspace is trusted.
|
|
@@ -259,24 +259,24 @@ export declare const IdeContextNotificationSchema: z.ZodObject<{
|
|
|
259
259
|
openFiles?: {
|
|
260
260
|
path: string;
|
|
261
261
|
timestamp: number;
|
|
262
|
-
isActive?: boolean | undefined;
|
|
263
|
-
selectedText?: string | undefined;
|
|
264
262
|
cursor?: {
|
|
265
263
|
line: number;
|
|
266
264
|
character: number;
|
|
267
265
|
} | undefined;
|
|
266
|
+
isActive?: boolean | undefined;
|
|
267
|
+
selectedText?: string | undefined;
|
|
268
268
|
}[] | undefined;
|
|
269
269
|
isTrusted?: boolean | undefined;
|
|
270
270
|
}, {
|
|
271
271
|
openFiles?: {
|
|
272
272
|
path: string;
|
|
273
273
|
timestamp: number;
|
|
274
|
-
isActive?: boolean | undefined;
|
|
275
|
-
selectedText?: string | undefined;
|
|
276
274
|
cursor?: {
|
|
277
275
|
line: number;
|
|
278
276
|
character: number;
|
|
279
277
|
} | undefined;
|
|
278
|
+
isActive?: boolean | undefined;
|
|
279
|
+
selectedText?: string | undefined;
|
|
280
280
|
}[] | undefined;
|
|
281
281
|
isTrusted?: boolean | undefined;
|
|
282
282
|
}>>;
|
|
@@ -285,12 +285,12 @@ export declare const IdeContextNotificationSchema: z.ZodObject<{
|
|
|
285
285
|
openFiles?: {
|
|
286
286
|
path: string;
|
|
287
287
|
timestamp: number;
|
|
288
|
-
isActive?: boolean | undefined;
|
|
289
|
-
selectedText?: string | undefined;
|
|
290
288
|
cursor?: {
|
|
291
289
|
line: number;
|
|
292
290
|
character: number;
|
|
293
291
|
} | undefined;
|
|
292
|
+
isActive?: boolean | undefined;
|
|
293
|
+
selectedText?: string | undefined;
|
|
294
294
|
}[] | undefined;
|
|
295
295
|
isTrusted?: boolean | undefined;
|
|
296
296
|
} | undefined;
|
|
@@ -299,12 +299,12 @@ export declare const IdeContextNotificationSchema: z.ZodObject<{
|
|
|
299
299
|
openFiles?: {
|
|
300
300
|
path: string;
|
|
301
301
|
timestamp: number;
|
|
302
|
-
isActive?: boolean | undefined;
|
|
303
|
-
selectedText?: string | undefined;
|
|
304
302
|
cursor?: {
|
|
305
303
|
line: number;
|
|
306
304
|
character: number;
|
|
307
305
|
} | undefined;
|
|
306
|
+
isActive?: boolean | undefined;
|
|
307
|
+
selectedText?: string | undefined;
|
|
308
308
|
}[] | undefined;
|
|
309
309
|
isTrusted?: boolean | undefined;
|
|
310
310
|
} | undefined;
|
|
@@ -315,12 +315,12 @@ export declare const IdeContextNotificationSchema: z.ZodObject<{
|
|
|
315
315
|
openFiles?: {
|
|
316
316
|
path: string;
|
|
317
317
|
timestamp: number;
|
|
318
|
-
isActive?: boolean | undefined;
|
|
319
|
-
selectedText?: string | undefined;
|
|
320
318
|
cursor?: {
|
|
321
319
|
line: number;
|
|
322
320
|
character: number;
|
|
323
321
|
} | undefined;
|
|
322
|
+
isActive?: boolean | undefined;
|
|
323
|
+
selectedText?: string | undefined;
|
|
324
324
|
}[] | undefined;
|
|
325
325
|
isTrusted?: boolean | undefined;
|
|
326
326
|
} | undefined;
|
|
@@ -333,12 +333,12 @@ export declare const IdeContextNotificationSchema: z.ZodObject<{
|
|
|
333
333
|
openFiles?: {
|
|
334
334
|
path: string;
|
|
335
335
|
timestamp: number;
|
|
336
|
-
isActive?: boolean | undefined;
|
|
337
|
-
selectedText?: string | undefined;
|
|
338
336
|
cursor?: {
|
|
339
337
|
line: number;
|
|
340
338
|
character: number;
|
|
341
339
|
} | undefined;
|
|
340
|
+
isActive?: boolean | undefined;
|
|
341
|
+
selectedText?: string | undefined;
|
|
342
342
|
}[] | undefined;
|
|
343
343
|
isTrusted?: boolean | undefined;
|
|
344
344
|
} | undefined;
|
|
@@ -362,23 +362,23 @@ export declare const IdeDiffAcceptedNotificationSchema: z.ZodObject<{
|
|
|
362
362
|
*/
|
|
363
363
|
content: z.ZodString;
|
|
364
364
|
}, "strip", z.ZodTypeAny, {
|
|
365
|
-
content: string;
|
|
366
365
|
filePath: string;
|
|
367
|
-
}, {
|
|
368
366
|
content: string;
|
|
367
|
+
}, {
|
|
369
368
|
filePath: string;
|
|
369
|
+
content: string;
|
|
370
370
|
}>;
|
|
371
371
|
}, "strip", z.ZodTypeAny, {
|
|
372
372
|
params: {
|
|
373
|
-
content: string;
|
|
374
373
|
filePath: string;
|
|
374
|
+
content: string;
|
|
375
375
|
};
|
|
376
376
|
jsonrpc: "2.0";
|
|
377
377
|
method: "ide/diffAccepted";
|
|
378
378
|
}, {
|
|
379
379
|
params: {
|
|
380
|
-
content: string;
|
|
381
380
|
filePath: string;
|
|
381
|
+
content: string;
|
|
382
382
|
};
|
|
383
383
|
jsonrpc: "2.0";
|
|
384
384
|
method: "ide/diffAccepted";
|
|
@@ -25,6 +25,28 @@ import type { LlmGenerateRequest, LlmToolDefinition } from '../types.js';
|
|
|
25
25
|
* This is the reverse of GeminiConverter.toGeminiTools().
|
|
26
26
|
*/
|
|
27
27
|
export declare function convertGeminiToolsToLlm(tools: Tool[]): LlmToolDefinition[];
|
|
28
|
+
/**
|
|
29
|
+
* Reconcile functionCall/functionResponse IDs in Gemini history.
|
|
30
|
+
*
|
|
31
|
+
* When the Gemini native path handles tool calls, Turn.handlePendingFunctionCall
|
|
32
|
+
* generates a callId via crypto.randomUUID() and stores it in the
|
|
33
|
+
* functionResponse.id. However, the Gemini SDK does NOT write this back to
|
|
34
|
+
* the functionCall.id in history (it remains undefined).
|
|
35
|
+
*
|
|
36
|
+
* On provider switch (Gemini → OpenAI), convertPartToLlmContent generates a
|
|
37
|
+
* NEW random UUID for the undefined functionCall.id, causing a mismatch with
|
|
38
|
+
* the functionResponse.id. OpenAI API then rejects the request with:
|
|
39
|
+
* "tool_call_id not found in tool_calls of previous message"
|
|
40
|
+
*
|
|
41
|
+
* This function pre-processes the history by matching functionCall/functionResponse
|
|
42
|
+
* pairs. Matching strategy:
|
|
43
|
+
* 1. Positional match (call[n] ↔ response[n]) with name validation
|
|
44
|
+
* 2. Name-based fallback when positional names don't match
|
|
45
|
+
*
|
|
46
|
+
* @returns A new Content[] with reconciled IDs (does NOT mutate the original).
|
|
47
|
+
* Returns the same reference if no reconciliation is needed.
|
|
48
|
+
*/
|
|
49
|
+
export declare function reconcileFunctionCallIds(history: Content[]): Content[];
|
|
28
50
|
/**
|
|
29
51
|
* Options for building an LlmGenerateRequest from Gemini runtime state.
|
|
30
52
|
*/
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Copyright 2026 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
+
import { randomUUID } from 'node:crypto';
|
|
6
7
|
import { fixToolResultRoles } from '../../core/llmMessageUtils.js';
|
|
7
8
|
import { convertContentsToLlmMessages, convertPartListUnionToLlmContents, } from './typeConversion.js';
|
|
8
9
|
// ============================================================================
|
|
@@ -85,6 +86,131 @@ export function convertGeminiToolsToLlm(tools) {
|
|
|
85
86
|
}
|
|
86
87
|
return result;
|
|
87
88
|
}
|
|
89
|
+
// ============================================================================
|
|
90
|
+
// History ID reconciliation for provider switching
|
|
91
|
+
// ============================================================================
|
|
92
|
+
/**
|
|
93
|
+
* Reconcile functionCall/functionResponse IDs in Gemini history.
|
|
94
|
+
*
|
|
95
|
+
* When the Gemini native path handles tool calls, Turn.handlePendingFunctionCall
|
|
96
|
+
* generates a callId via crypto.randomUUID() and stores it in the
|
|
97
|
+
* functionResponse.id. However, the Gemini SDK does NOT write this back to
|
|
98
|
+
* the functionCall.id in history (it remains undefined).
|
|
99
|
+
*
|
|
100
|
+
* On provider switch (Gemini → OpenAI), convertPartToLlmContent generates a
|
|
101
|
+
* NEW random UUID for the undefined functionCall.id, causing a mismatch with
|
|
102
|
+
* the functionResponse.id. OpenAI API then rejects the request with:
|
|
103
|
+
* "tool_call_id not found in tool_calls of previous message"
|
|
104
|
+
*
|
|
105
|
+
* This function pre-processes the history by matching functionCall/functionResponse
|
|
106
|
+
* pairs. Matching strategy:
|
|
107
|
+
* 1. Positional match (call[n] ↔ response[n]) with name validation
|
|
108
|
+
* 2. Name-based fallback when positional names don't match
|
|
109
|
+
*
|
|
110
|
+
* @returns A new Content[] with reconciled IDs (does NOT mutate the original).
|
|
111
|
+
* Returns the same reference if no reconciliation is needed.
|
|
112
|
+
*/
|
|
113
|
+
export function reconcileFunctionCallIds(history) {
|
|
114
|
+
// Quick check: skip clone if no reconciliation needed
|
|
115
|
+
let needsReconciliation = false;
|
|
116
|
+
for (const content of history) {
|
|
117
|
+
if (content.role !== 'model' || !content.parts)
|
|
118
|
+
continue;
|
|
119
|
+
if (content.parts.some((p) => p.functionCall && !p.functionCall.id)) {
|
|
120
|
+
needsReconciliation = true;
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (!needsReconciliation)
|
|
125
|
+
return history;
|
|
126
|
+
const cloned = structuredClone(history);
|
|
127
|
+
for (let i = 0; i < cloned.length; i++) {
|
|
128
|
+
const content = cloned[i];
|
|
129
|
+
if (content.role !== 'model' || !content.parts)
|
|
130
|
+
continue;
|
|
131
|
+
// Get ALL functionCall parts (preserving original position indices)
|
|
132
|
+
const allCalls = content.parts.filter((p) => p.functionCall);
|
|
133
|
+
if (allCalls.length === 0)
|
|
134
|
+
continue;
|
|
135
|
+
if (allCalls.every((p) => p.functionCall.id))
|
|
136
|
+
continue;
|
|
137
|
+
// Scan forward for the nearest user Content with functionResponse parts.
|
|
138
|
+
// Stops at the next model Content to avoid crossing turn boundaries.
|
|
139
|
+
let responseContent;
|
|
140
|
+
for (let k = i + 1; k < cloned.length; k++) {
|
|
141
|
+
if (cloned[k].role === 'model')
|
|
142
|
+
break;
|
|
143
|
+
if (cloned[k].role === 'user' &&
|
|
144
|
+
cloned[k].parts?.some((p) => p.functionResponse)) {
|
|
145
|
+
responseContent = cloned[k];
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
if (!responseContent?.parts)
|
|
150
|
+
continue;
|
|
151
|
+
const allResponses = responseContent.parts.filter((p) => p.functionResponse);
|
|
152
|
+
// 2-pass matching with "used" tracking to prevent duplicate ID assignment.
|
|
153
|
+
//
|
|
154
|
+
// Pass 1: Mark responses already claimed by calls that have IDs.
|
|
155
|
+
// This prevents a subsequent ID-less call from stealing an already-
|
|
156
|
+
// matched response (the root cause of the same-name mixed-ID bug).
|
|
157
|
+
//
|
|
158
|
+
// Pass 2: For each ID-less call, find the best unused response
|
|
159
|
+
// (positional match → name-based fallback).
|
|
160
|
+
const usedResponseIndices = new Set();
|
|
161
|
+
// Pass 1: claim responses for calls that already have IDs
|
|
162
|
+
for (let j = 0; j < allCalls.length; j++) {
|
|
163
|
+
const fc = allCalls[j].functionCall;
|
|
164
|
+
if (!fc.id)
|
|
165
|
+
continue;
|
|
166
|
+
const idx = allResponses.findIndex((p) => p.functionResponse?.id === fc.id);
|
|
167
|
+
if (idx >= 0) {
|
|
168
|
+
usedResponseIndices.add(idx);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
// Pass 2: reconcile calls without IDs
|
|
172
|
+
for (let j = 0; j < allCalls.length; j++) {
|
|
173
|
+
const fc = allCalls[j].functionCall;
|
|
174
|
+
if (fc.id)
|
|
175
|
+
continue;
|
|
176
|
+
let fr = undefined;
|
|
177
|
+
let frIdx = -1;
|
|
178
|
+
// 1. Try positional match (if not already used)
|
|
179
|
+
if (!usedResponseIndices.has(j) && allResponses[j]?.functionResponse) {
|
|
180
|
+
const candidate = allResponses[j].functionResponse;
|
|
181
|
+
if (!fc.name || !candidate.name || fc.name === candidate.name) {
|
|
182
|
+
fr = candidate;
|
|
183
|
+
frIdx = j;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
// 2. Name-based fallback: find first UNUSED response with matching name
|
|
187
|
+
if (!fr && fc.name) {
|
|
188
|
+
for (let r = 0; r < allResponses.length; r++) {
|
|
189
|
+
if (usedResponseIndices.has(r))
|
|
190
|
+
continue;
|
|
191
|
+
const candidate = allResponses[r].functionResponse;
|
|
192
|
+
if (candidate?.name === fc.name) {
|
|
193
|
+
fr = candidate;
|
|
194
|
+
frIdx = r;
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
if (!fr || frIdx < 0)
|
|
200
|
+
continue;
|
|
201
|
+
usedResponseIndices.add(frIdx);
|
|
202
|
+
if (fr.id) {
|
|
203
|
+
fc.id = fr.id;
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
const newId = randomUUID();
|
|
207
|
+
fc.id = newId;
|
|
208
|
+
fr.id = newId;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return cloned;
|
|
213
|
+
}
|
|
88
214
|
/**
|
|
89
215
|
* Build an LlmGenerateRequest from Gemini runtime state.
|
|
90
216
|
*
|
|
@@ -96,8 +222,12 @@ export function convertGeminiToolsToLlm(tools) {
|
|
|
96
222
|
* that are accessed through llm* methods on the content generator.
|
|
97
223
|
*/
|
|
98
224
|
export function buildLlmRequestFromGeminiState(opts) {
|
|
225
|
+
// Reconcile functionCall/functionResponse IDs before conversion.
|
|
226
|
+
// Required for provider switching: Gemini history may have undefined
|
|
227
|
+
// functionCall.id while functionResponse.id is set.
|
|
228
|
+
const reconciledHistory = reconcileFunctionCallIds(opts.history);
|
|
99
229
|
// Convert history Content[] → LlmMessage[]
|
|
100
|
-
const historyMessages = convertContentsToLlmMessages(
|
|
230
|
+
const historyMessages = convertContentsToLlmMessages(reconciledHistory);
|
|
101
231
|
// Convert current request PartListUnion → LlmContent[]
|
|
102
232
|
const currentContents = convertPartListUnionToLlmContents(opts.currentRequest);
|
|
103
233
|
// Append current request as a user message
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestBuilder.js","sourceRoot":"","sources":["../../../../src/providers/gemini/requestBuilder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"requestBuilder.js","sourceRoot":"","sources":["../../../../src/providers/gemini/requestBuilder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoBH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AASzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EACL,4BAA4B,EAC5B,iCAAiC,GAClC,MAAM,qBAAqB,CAAC;AAE7B,+EAA+E;AAC/E,uDAAuD;AACvD,+EAA+E;AAE/E,gEAAgE;AAChE,MAAM,eAAe,GAAwC;IAC3D,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF;;;GAGG;AACH,SAAS,qBAAqB,CAC5B,MAA+B;IAE/B,MAAM,OAAO,GAAI,MAAM,CAAC,MAAM,CAAwB,IAAI,QAAQ,CAAC;IACnE,MAAM,IAAI,GAAoB;QAC5B,IAAI,EAAE,eAAe,CAAC,OAAO,CAAC,IAAI,QAAQ;KAC3C,CAAC;IAEF,IAAI,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;QAC1B,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,aAAa,CAAW,CAAC;IACrD,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAa,CAAC;IACzC,CAAC;IAED,2BAA2B;IAC3B,IAAI,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;QACzB,MAAM,WAA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