@aiderdesk/aiderdesk 0.70.0 → 0.71.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.
- package/README.md +49 -0
- package/out/cli.js +1006 -1
- package/out/renderer/assets/{AgentSettings-4fCr6MRo.js → AgentSettings-BKSogFrU.js} +133 -125
- package/out/renderer/assets/{InfoIcon-Cend8bQ6.js → InfoIcon-XbMgPv1i.js} +1 -1
- package/out/renderer/assets/{Onboarding-SfOrsd7I.js → Onboarding-DsxeAj-M.js} +4 -4
- package/out/renderer/assets/{ProviderHeader-IIBa8Q98.js → ProviderHeader-CQHU1_fp.js} +384 -165
- package/out/renderer/assets/{SettingsPage-1PPq3lwt.js → SettingsPage-jGXWkGLq.js} +643 -265
- package/out/renderer/assets/{UsageDashboard-C73v7_7A.js → UsageDashboard-BcWDkudQ.js} +3 -3
- package/out/renderer/assets/{arc-DooaZ_2W.js → arc-CbTCDvhP.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-3BPJPVTR-BZRfdU_l.js → architectureDiagram-3BPJPVTR-BYGjkH2o.js} +3 -3
- package/out/renderer/assets/{blockDiagram-GPEHLZMM-GVLrld7f.js → blockDiagram-GPEHLZMM-BNslNypY.js} +4 -4
- package/out/renderer/assets/{c4Diagram-AAUBKEIU-CuLHxnUp.js → c4Diagram-AAUBKEIU-BOUV-4Hf.js} +2 -2
- package/out/renderer/assets/{channel-CBp4QC42.js → channel-gTXtcW6n.js} +1 -1
- package/out/renderer/assets/{chunk-2J33WTMH-CLGSY5ry.js → chunk-2J33WTMH-cVAo2nRo.js} +1 -1
- package/out/renderer/assets/{chunk-4BX2VUAB-DfOAmq0y.js → chunk-4BX2VUAB-QUppBCep.js} +1 -1
- package/out/renderer/assets/{chunk-55IACEB6-CjDMk8wF.js → chunk-55IACEB6-B7ATOpEx.js} +1 -1
- package/out/renderer/assets/{chunk-727SXJPM-4GHP5or6.js → chunk-727SXJPM-DNHjk-uw.js} +5 -5
- package/out/renderer/assets/{chunk-AQP2D5EJ-B8ex3L6d.js → chunk-AQP2D5EJ-C_nuud1y.js} +3 -3
- package/out/renderer/assets/{chunk-FMBD7UC4-DXVKqz45.js → chunk-FMBD7UC4-DoAO6UdZ.js} +1 -1
- package/out/renderer/assets/{chunk-ND2GUHAM-CJf331B5.js → chunk-ND2GUHAM-hRnym-e6.js} +1 -1
- package/out/renderer/assets/{chunk-QZHKN3VN-CmRmlYwi.js → chunk-QZHKN3VN-BkTqSMpi.js} +1 -1
- package/out/renderer/assets/{classDiagram-4FO5ZUOK-BB0WWhct.js → classDiagram-4FO5ZUOK-097_YN8Y.js} +6 -6
- package/out/renderer/assets/{classDiagram-v2-Q7XG4LA2-BB0WWhct.js → classDiagram-v2-Q7XG4LA2-097_YN8Y.js} +6 -6
- package/out/renderer/assets/{cose-bilkent-S5V4N54A-C1ovVUkK.js → cose-bilkent-S5V4N54A-CU24fSZY.js} +1 -1
- package/out/renderer/assets/{dagre-BM42HDAG-BN2vkdYj.js → dagre-BM42HDAG-CXQk6wIx.js} +3 -3
- package/out/renderer/assets/{diagram-2AECGRRQ-Gmur2BYD.js → diagram-2AECGRRQ-cp5zubxu.js} +3 -3
- package/out/renderer/assets/{diagram-5GNKFQAL-CO-0qbfq.js → diagram-5GNKFQAL-Dz1liaVJ.js} +4 -4
- package/out/renderer/assets/{diagram-KO2AKTUF-B0BourUo.js → diagram-KO2AKTUF-C_a_DDR7.js} +3 -3
- package/out/renderer/assets/{diagram-LMA3HP47-CZSemlgR.js → diagram-LMA3HP47-DMzt3Wms.js} +3 -3
- package/out/renderer/assets/{diagram-OG6HWLK6-DIg_VSi2.js → diagram-OG6HWLK6-DXgo41ZN.js} +4 -4
- package/out/renderer/assets/{erDiagram-TEJ5UH35-CeDB_1TN.js → erDiagram-TEJ5UH35-Duy8-ZVE.js} +4 -4
- package/out/renderer/assets/{flowDiagram-I6XJVG4X-CAYyZ6xk.js → flowDiagram-I6XJVG4X-C79uBv3j.js} +6 -6
- package/out/renderer/assets/{ganttDiagram-6RSMTGT7-28qx3HO3.js → ganttDiagram-6RSMTGT7-COUQHYqH.js} +3 -3
- package/out/renderer/assets/{gitGraphDiagram-PVQCEYII-C0C5PVgG.js → gitGraphDiagram-PVQCEYII-D3-KSp5g.js} +4 -4
- package/out/renderer/assets/{graph-BmyvWy9U.js → graph-CojOaclU.js} +1 -1
- package/out/renderer/assets/{index-CCixlVbO.js → index-BDc7WeA_.js} +1 -1
- package/out/renderer/assets/{index-CqkLi8Rn.js → index-BX1dnn54.js} +1 -1
- package/out/renderer/assets/{index-BkEUNx2M.js → index-BxH3Vzns.js} +129 -30
- package/out/renderer/assets/{index-CleisQX7.js → index-CZVPwEh7.js} +1 -1
- package/out/renderer/assets/{index-DHgg9rnw.js → index-CcbWMGtO.js} +1 -1
- package/out/renderer/assets/{index-LwoRwQcK.js → index-CoN3I29h.js} +1 -1
- package/out/renderer/assets/{index-D4QsfuBU.css → index-DJwDiyPe.css} +8 -0
- package/out/renderer/assets/{index-CjWyE7Qc.js → index-DqOJFqtI.js} +1 -1
- package/out/renderer/assets/{index-DDyjc4hl.js → index-DqOyb6kJ.js} +1 -1
- package/out/renderer/assets/{index-DiXCQ0pX.js → index-LigRSjJQ.js} +2274 -1492
- package/out/renderer/assets/{index-D1hWSFOH.js → index-uk-xw9ke.js} +1 -1
- package/out/renderer/assets/{infoDiagram-5YYISTIA-BR2qewYU.js → infoDiagram-5YYISTIA-Dhu3XDyU.js} +2 -2
- package/out/renderer/assets/{ishikawaDiagram-YF4QCWOH-mBtVTtfu.js → ishikawaDiagram-YF4QCWOH-Zv844Inp.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-JHISSGLW-BLwLxSRJ.js → journeyDiagram-JHISSGLW-CiEy0k__.js} +4 -4
- package/out/renderer/assets/{jsx-dev-runtime-C3x5nPQV.js → jsx-dev-runtime-BblfdcBq.js} +1 -1
- package/out/renderer/assets/{kanban-definition-UN3LZRKU-DEQMBIes.js → kanban-definition-UN3LZRKU-Bg7Tn0_t.js} +2 -2
- package/out/renderer/assets/{layout-COZ2dLJC.js → layout-C7gScUZ3.js} +2 -2
- package/out/renderer/assets/{linear-BwuiC9BD.js → linear-C8mfmsRG.js} +1 -1
- package/out/renderer/assets/{mindmap-definition-RKZ34NQL-BEdOr2LN.js → mindmap-definition-RKZ34NQL-CT41c9xA.js} +3 -3
- package/out/renderer/assets/{pieDiagram-4H26LBE5-C2CIjhWa.js → pieDiagram-4H26LBE5-4MIz5Tk3.js} +4 -4
- package/out/renderer/assets/{quadrantDiagram-W4KKPZXB-ByG1Fnbm.js → quadrantDiagram-W4KKPZXB-srrdZ4mO.js} +2 -2
- package/out/renderer/assets/{requirementDiagram-4Y6WPE33-CPNEbV2R.js → requirementDiagram-4Y6WPE33-hCfEAv72.js} +3 -3
- package/out/renderer/assets/{sankeyDiagram-5OEKKPKP-DseN3BYS.js → sankeyDiagram-5OEKKPKP-D3Dmoahf.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-3UESZ5HK-DGbPycPW.js → sequenceDiagram-3UESZ5HK-B_R1OT73.js} +3 -3
- package/out/renderer/assets/{stateDiagram-AJRCARHV-I_wGtDx-.js → stateDiagram-AJRCARHV-T81AxWaT.js} +6 -6
- package/out/renderer/assets/{stateDiagram-v2-BHNVJYJU-MVwIUdrA.js → stateDiagram-v2-BHNVJYJU-DotM3iTY.js} +4 -4
- package/out/renderer/assets/{time-DKSwLtIL.js → time-NQi4RUKr.js} +1 -1
- package/out/renderer/assets/{timeline-definition-PNZ67QCA-0o1eLzXF.js → timeline-definition-PNZ67QCA-CuIJOcqs.js} +2 -2
- package/out/renderer/assets/{vennDiagram-CIIHVFJN-BbPtgu5r.js → vennDiagram-CIIHVFJN-BP9XceqR.js} +1 -1
- package/out/renderer/assets/{wardley-L42UT6IY-C6O9NaAx.js → wardley-L42UT6IY-Cs8sx4Yc.js} +1 -1
- package/out/renderer/assets/{wardleyDiagram-YWT4CUSO-C0NB17Hf.js → wardleyDiagram-YWT4CUSO-BleVwqnB.js} +3 -3
- package/out/renderer/assets/{xychartDiagram-2RQKCTM6-CM1NB5k6.js → xychartDiagram-2RQKCTM6-CoEiSbj_.js} +2 -2
- package/out/renderer/index.html +2 -2
- package/out/runner.js +613 -287
- package/package.json +20 -20
- package/scripts/generate-package.mjs +1 -2
- package/scripts/publish-next.mjs +22 -0
- package/out/renderer/assets/gemini-cli-BKI4k4GP.png +0 -0
- package/out/resources/mcp-server/aider-desk-mcp-server.js +0 -39437
- package/patches/ai-sdk-provider-gemini-cli+1.5.1.patch +0 -373
|
@@ -1,373 +0,0 @@
|
|
|
1
|
-
diff --git a/node_modules/ai-sdk-provider-gemini-cli/dist/index.mjs b/node_modules/ai-sdk-provider-gemini-cli/dist/index.mjs
|
|
2
|
-
index de27b24..b04605e 100644
|
|
3
|
-
--- a/node_modules/ai-sdk-provider-gemini-cli/dist/index.mjs
|
|
4
|
-
+++ b/node_modules/ai-sdk-provider-gemini-cli/dist/index.mjs
|
|
5
|
-
@@ -1,8 +1,10 @@
|
|
6
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
7
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
8
|
-
}) : x)(function(x) {
|
|
9
|
-
- if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
10
|
-
- throw Error('Dynamic require of "' + x + '" is not supported');
|
|
11
|
-
+ if (typeof require !== "undefined") {
|
|
12
|
-
+ return require.apply(this, arguments);
|
|
13
|
-
+ }
|
|
14
|
-
+ throw Error("Dynamic require of \"" + x + "\" is not supported");
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
// src/gemini-provider.ts
|
|
18
|
-
@@ -18,6 +20,7 @@ import {
|
|
19
|
-
createContentGeneratorConfig,
|
|
20
|
-
AuthType
|
|
21
|
-
} from "@google/gemini-cli-core";
|
|
22
|
-
+
|
|
23
|
-
async function initializeGeminiClient(options, modelId) {
|
|
24
|
-
let authType;
|
|
25
|
-
if (options.authType === "api-key" || options.authType === "gemini-api-key") {
|
|
26
|
-
@@ -173,6 +176,7 @@ function mapPromptToGeminiFormat(options) {
|
|
27
|
-
}
|
|
28
|
-
return { contents, systemInstruction };
|
|
29
|
-
}
|
|
30
|
-
+
|
|
31
|
-
function mapUserMessage(message) {
|
|
32
|
-
const parts = [];
|
|
33
|
-
for (const part of message.content) {
|
|
34
|
-
@@ -193,25 +197,41 @@ function mapUserMessage(message) {
|
|
35
|
-
}
|
|
36
|
-
return { role: "user", parts };
|
|
37
|
-
}
|
|
38
|
-
+
|
|
39
|
-
function mapAssistantMessage(message) {
|
|
40
|
-
const parts = [];
|
|
41
|
-
for (const part of message.content) {
|
|
42
|
-
+ const thoughtSignature = part.providerOptions == null ? void 0 : part.providerOptions["gemini-cli"] == null
|
|
43
|
-
+ ? void 0
|
|
44
|
-
+ : part.providerOptions["gemini-cli"].thoughtSignature;
|
|
45
|
-
switch (part.type) {
|
|
46
|
-
case "text":
|
|
47
|
-
- parts.push({ text: part.text });
|
|
48
|
-
+ parts.push({
|
|
49
|
-
+ text: part.text,
|
|
50
|
-
+ thoughtSignature
|
|
51
|
-
+ });
|
|
52
|
-
+ break;
|
|
53
|
-
+ case "reasoning":
|
|
54
|
-
+ parts.push({
|
|
55
|
-
+ text: part.text,
|
|
56
|
-
+ thought: true,
|
|
57
|
-
+ thoughtSignature
|
|
58
|
-
+ });
|
|
59
|
-
break;
|
|
60
|
-
case "tool-call":
|
|
61
|
-
parts.push({
|
|
62
|
-
functionCall: {
|
|
63
|
-
name: part.toolName,
|
|
64
|
-
args: part.input || {}
|
|
65
|
-
- }
|
|
66
|
-
+ },
|
|
67
|
-
+ thoughtSignature
|
|
68
|
-
});
|
|
69
|
-
break;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return { role: "model", parts };
|
|
73
|
-
}
|
|
74
|
-
+
|
|
75
|
-
function mapFilePart(part) {
|
|
76
|
-
if (part.data instanceof URL) {
|
|
77
|
-
throw new Error(
|
|
78
|
-
@@ -240,6 +260,7 @@ import {
|
|
79
|
-
FunctionCallingConfigMode
|
|
80
|
-
} from "@google/genai";
|
|
81
|
-
import { z } from "zod";
|
|
82
|
-
+
|
|
83
|
-
function mapToolsToGeminiFormat(tools) {
|
|
84
|
-
const functionDeclarations = [];
|
|
85
|
-
for (const tool of tools) {
|
|
86
|
-
@@ -251,6 +272,7 @@ function mapToolsToGeminiFormat(tools) {
|
|
87
|
-
}
|
|
88
|
-
return [{ functionDeclarations }];
|
|
89
|
-
}
|
|
90
|
-
+
|
|
91
|
-
function convertZodToJsonSchema(zodSchema) {
|
|
92
|
-
const zodWithToJSONSchema = z;
|
|
93
|
-
if (zodWithToJSONSchema.toJSONSchema && typeof zodWithToJSONSchema.toJSONSchema === "function") {
|
|
94
|
-
@@ -269,6 +291,7 @@ function convertZodToJsonSchema(zodSchema) {
|
|
95
|
-
);
|
|
96
|
-
return { type: "object" };
|
|
97
|
-
}
|
|
98
|
-
+
|
|
99
|
-
function convertToolParameters(parameters) {
|
|
100
|
-
if (isJsonSchema(parameters)) {
|
|
101
|
-
return cleanJsonSchema(parameters);
|
|
102
|
-
@@ -279,12 +302,15 @@ function convertToolParameters(parameters) {
|
|
103
|
-
}
|
|
104
|
-
return parameters;
|
|
105
|
-
}
|
|
106
|
-
+
|
|
107
|
-
function isJsonSchema(obj) {
|
|
108
|
-
return typeof obj === "object" && obj !== null && ("type" in obj || "properties" in obj || "$schema" in obj);
|
|
109
|
-
}
|
|
110
|
-
+
|
|
111
|
-
function isZodSchema(obj) {
|
|
112
|
-
return typeof obj === "object" && obj !== null && "_def" in obj && typeof obj._def === "object";
|
|
113
|
-
}
|
|
114
|
-
+
|
|
115
|
-
function cleanJsonSchema(schema) {
|
|
116
|
-
if (typeof schema !== "object" || schema === null) {
|
|
117
|
-
return schema;
|
|
118
|
-
@@ -319,6 +345,7 @@ function cleanJsonSchema(schema) {
|
|
119
|
-
}
|
|
120
|
-
return cleaned;
|
|
121
|
-
}
|
|
122
|
-
+
|
|
123
|
-
function mapGeminiToolConfig(options) {
|
|
124
|
-
if (options.toolChoice) {
|
|
125
|
-
const allowedFunctionNames = options.toolChoice.type === "tool" ? [options.toolChoice.toolName] : void 0;
|
|
126
|
-
@@ -331,6 +358,7 @@ function mapGeminiToolConfig(options) {
|
|
127
|
-
}
|
|
128
|
-
return void 0;
|
|
129
|
-
}
|
|
130
|
-
+
|
|
131
|
-
function mapToolChoiceToGeminiFormat(toolChoice) {
|
|
132
|
-
switch (toolChoice.type) {
|
|
133
|
-
case "auto":
|
|
134
|
-
@@ -347,15 +375,16 @@ function mapToolChoiceToGeminiFormat(toolChoice) {
|
|
135
|
-
|
|
136
|
-
// src/error.ts
|
|
137
|
-
import { APICallError, LoadAPIKeyError } from "@ai-sdk/provider";
|
|
138
|
-
+
|
|
139
|
-
function createAPICallError({
|
|
140
|
-
- message,
|
|
141
|
-
- code,
|
|
142
|
-
- exitCode,
|
|
143
|
-
- stderr,
|
|
144
|
-
- promptExcerpt,
|
|
145
|
-
- isRetryable = false,
|
|
146
|
-
- statusCode = 500
|
|
147
|
-
-}) {
|
|
148
|
-
+ message,
|
|
149
|
-
+ code,
|
|
150
|
-
+ exitCode,
|
|
151
|
-
+ stderr,
|
|
152
|
-
+ promptExcerpt,
|
|
153
|
-
+ isRetryable = false,
|
|
154
|
-
+ statusCode = 500
|
|
155
|
-
+ }) {
|
|
156
|
-
return new APICallError({
|
|
157
|
-
url: "gemini-cli-core://command",
|
|
158
|
-
requestBodyValues: promptExcerpt ? { prompt: promptExcerpt } : {},
|
|
159
|
-
@@ -370,17 +399,19 @@ function createAPICallError({
|
|
160
|
-
isRetryable
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
+
|
|
164
|
-
function createAuthenticationError({
|
|
165
|
-
- message
|
|
166
|
-
-}) {
|
|
167
|
-
+ message
|
|
168
|
-
+ }) {
|
|
169
|
-
return new LoadAPIKeyError({
|
|
170
|
-
message
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
+
|
|
174
|
-
function createTimeoutError({
|
|
175
|
-
- message,
|
|
176
|
-
- promptExcerpt
|
|
177
|
-
-}) {
|
|
178
|
-
+ message,
|
|
179
|
-
+ promptExcerpt
|
|
180
|
-
+ }) {
|
|
181
|
-
return createAPICallError({
|
|
182
|
-
message,
|
|
183
|
-
code: "TIMEOUT",
|
|
184
|
-
@@ -389,6 +420,7 @@ function createTimeoutError({
|
|
185
|
-
statusCode: 504
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
+
|
|
189
|
-
function isAuthenticationError(error) {
|
|
190
|
-
if (error instanceof LoadAPIKeyError) {
|
|
191
|
-
return true;
|
|
192
|
-
@@ -399,6 +431,7 @@ function isAuthenticationError(error) {
|
|
193
|
-
}
|
|
194
|
-
return false;
|
|
195
|
-
}
|
|
196
|
-
+
|
|
197
|
-
function isTimeoutError(error) {
|
|
198
|
-
if (error instanceof APICallError) {
|
|
199
|
-
return error.statusCode === 504 || error.data?.code === "TIMEOUT";
|
|
200
|
-
@@ -409,6 +442,7 @@ function isTimeoutError(error) {
|
|
201
|
-
}
|
|
202
|
-
return false;
|
|
203
|
-
}
|
|
204
|
-
+
|
|
205
|
-
function mapGeminiError(error) {
|
|
206
|
-
if (error instanceof Error) {
|
|
207
|
-
if (error.name === "AbortError") {
|
|
208
|
-
@@ -481,6 +515,7 @@ var noopLogger = {
|
|
209
|
-
error: () => {
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
+
|
|
213
|
-
function getLogger(logger) {
|
|
214
|
-
if (logger === false) {
|
|
215
|
-
return noopLogger;
|
|
216
|
-
@@ -490,6 +525,7 @@ function getLogger(logger) {
|
|
217
|
-
}
|
|
218
|
-
return logger;
|
|
219
|
-
}
|
|
220
|
-
+
|
|
221
|
-
function createVerboseLogger(logger, verbose = false) {
|
|
222
|
-
if (verbose) {
|
|
223
|
-
return logger;
|
|
224
|
-
@@ -514,6 +550,7 @@ var ThinkingLevel = /* @__PURE__ */ ((ThinkingLevel2) => {
|
|
225
|
-
ThinkingLevel2["MINIMAL"] = "MINIMAL";
|
|
226
|
-
return ThinkingLevel2;
|
|
227
|
-
})(ThinkingLevel || {});
|
|
228
|
-
+
|
|
229
|
-
function normalizeThinkingLevel(level) {
|
|
230
|
-
const normalized = level.toUpperCase();
|
|
231
|
-
switch (normalized) {
|
|
232
|
-
@@ -529,6 +566,7 @@ function normalizeThinkingLevel(level) {
|
|
233
|
-
return void 0;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
+
|
|
237
|
-
function mapGeminiFinishReason(geminiReason) {
|
|
238
|
-
switch (geminiReason) {
|
|
239
|
-
case "STOP":
|
|
240
|
-
@@ -544,6 +582,7 @@ function mapGeminiFinishReason(geminiReason) {
|
|
241
|
-
return "unknown";
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
+
|
|
245
|
-
function buildThinkingConfig(input) {
|
|
246
|
-
const config = {};
|
|
247
|
-
if (input.thinkingLevel !== void 0) {
|
|
248
|
-
@@ -564,6 +603,7 @@ function buildThinkingConfig(input) {
|
|
249
|
-
}
|
|
250
|
-
return config;
|
|
251
|
-
}
|
|
252
|
-
+
|
|
253
|
-
function prepareGenerationConfig(options, settings) {
|
|
254
|
-
const warnings = [];
|
|
255
|
-
const responseFormat = options.responseFormat;
|
|
256
|
-
@@ -608,6 +648,7 @@ function prepareGenerationConfig(options, settings) {
|
|
257
|
-
};
|
|
258
|
-
return { generationConfig, warnings };
|
|
259
|
-
}
|
|
260
|
-
+
|
|
261
|
-
var GeminiLanguageModel = class {
|
|
262
|
-
constructor(options) {
|
|
263
|
-
this.specificationVersion = "v2";
|
|
264
|
-
@@ -627,6 +668,7 @@ var GeminiLanguageModel = class {
|
|
265
|
-
options.settings?.verbose ?? false
|
|
266
|
-
);
|
|
267
|
-
}
|
|
268
|
-
+
|
|
269
|
-
async ensureInitialized() {
|
|
270
|
-
if (this.contentGenerator && this.config) {
|
|
271
|
-
return { contentGenerator: this.contentGenerator, config: this.config };
|
|
272
|
-
@@ -637,6 +679,7 @@ var GeminiLanguageModel = class {
|
|
273
|
-
await this.initPromise;
|
|
274
|
-
return { contentGenerator: this.contentGenerator, config: this.config };
|
|
275
|
-
}
|
|
276
|
-
+
|
|
277
|
-
async initialize() {
|
|
278
|
-
try {
|
|
279
|
-
const { client, config } = await initializeGeminiClient(
|
|
280
|
-
@@ -649,6 +692,7 @@ var GeminiLanguageModel = class {
|
|
281
|
-
throw new Error(`Failed to initialize Gemini model: ${String(error)}`);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
+
|
|
285
|
-
/**
|
|
286
|
-
* Non-streaming generation method
|
|
287
|
-
*/
|
|
288
|
-
@@ -660,7 +704,9 @@ var GeminiLanguageModel = class {
|
|
289
|
-
const { contentGenerator } = await this.ensureInitialized();
|
|
290
|
-
const { contents, systemInstruction } = mapPromptToGeminiFormat(options);
|
|
291
|
-
this.logger.debug(
|
|
292
|
-
- `[gemini-cli] Request mode: ${options.responseFormat?.type === "json" ? "object-json" : "regular"}, response format: ${options.responseFormat?.type ?? "none"}`
|
|
293
|
-
+ `[gemini-cli] Request mode: ${options.responseFormat?.type === "json"
|
|
294
|
-
+ ? "object-json"
|
|
295
|
-
+ : "regular"}, response format: ${options.responseFormat?.type ?? "none"}`
|
|
296
|
-
);
|
|
297
|
-
this.logger.debug(
|
|
298
|
-
`[gemini-cli] Converted ${options.prompt.length} messages`
|
|
299
|
-
@@ -727,17 +773,20 @@ var GeminiLanguageModel = class {
|
|
300
|
-
const content = [];
|
|
301
|
-
if (responseContent?.parts) {
|
|
302
|
-
for (const part of responseContent.parts) {
|
|
303
|
-
+ const thoughtSignatureMetadata = part.thoughtSignature ? { 'gemini-cli': { thoughtSignature: part.thoughtSignature } } : void 0;
|
|
304
|
-
if (part.text) {
|
|
305
|
-
content.push({
|
|
306
|
-
- type: "text",
|
|
307
|
-
- text: part.text
|
|
308
|
-
+ type: part.thought === true ? "reasoning" : "text",
|
|
309
|
-
+ text: part.text,
|
|
310
|
-
+ providerMetadata: thoughtSignatureMetadata
|
|
311
|
-
});
|
|
312
|
-
} else if (part.functionCall) {
|
|
313
|
-
content.push({
|
|
314
|
-
type: "tool-call",
|
|
315
|
-
toolCallId: randomUUID2(),
|
|
316
|
-
toolName: part.functionCall.name || "",
|
|
317
|
-
- input: JSON.stringify(part.functionCall.args || {})
|
|
318
|
-
+ input: JSON.stringify(part.functionCall.args || {}),
|
|
319
|
-
+ providerMetadata: thoughtSignatureMetadata
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
@@ -780,6 +829,7 @@ var GeminiLanguageModel = class {
|
|
324
|
-
throw mapGeminiError(error);
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
+
|
|
328
|
-
/**
|
|
329
|
-
* Streaming generation method
|
|
330
|
-
*/
|
|
331
|
-
@@ -791,7 +841,9 @@ var GeminiLanguageModel = class {
|
|
332
|
-
const { contentGenerator } = await this.ensureInitialized();
|
|
333
|
-
const { contents, systemInstruction } = mapPromptToGeminiFormat(options);
|
|
334
|
-
this.logger.debug(
|
|
335
|
-
- `[gemini-cli] Stream mode: ${options.responseFormat?.type === "json" ? "object-json" : "regular"}, response format: ${options.responseFormat?.type ?? "none"}`
|
|
336
|
-
+ `[gemini-cli] Stream mode: ${options.responseFormat?.type === "json"
|
|
337
|
-
+ ? "object-json"
|
|
338
|
-
+ : "regular"}, response format: ${options.responseFormat?.type ?? "none"}`
|
|
339
|
-
);
|
|
340
|
-
this.logger.debug(
|
|
341
|
-
`[gemini-cli] Converted ${options.prompt.length} messages for streaming`
|
|
342
|
-
@@ -886,18 +938,21 @@ var GeminiLanguageModel = class {
|
|
343
|
-
}
|
|
344
|
-
if (content?.parts) {
|
|
345
|
-
for (const part of content.parts) {
|
|
346
|
-
+ const thoughtSignatureMetadata = part.thoughtSignature ? { 'gemini-cli': { thoughtSignature: part.thoughtSignature } } : void 0;
|
|
347
|
-
if (part.text) {
|
|
348
|
-
controller.enqueue({
|
|
349
|
-
type: "text-delta",
|
|
350
|
-
id: randomUUID2(),
|
|
351
|
-
- delta: part.text
|
|
352
|
-
+ delta: part.text,
|
|
353
|
-
+ providerMetadata: thoughtSignatureMetadata
|
|
354
|
-
});
|
|
355
|
-
} else if (part.functionCall) {
|
|
356
|
-
controller.enqueue({
|
|
357
|
-
type: "tool-call",
|
|
358
|
-
toolCallId: randomUUID2(),
|
|
359
|
-
toolName: part.functionCall.name || "",
|
|
360
|
-
- input: JSON.stringify(part.functionCall.args || {})
|
|
361
|
-
+ input: JSON.stringify(part.functionCall.args || {}),
|
|
362
|
-
+ providerMetadata: thoughtSignatureMetadata
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
@@ -1051,6 +1106,7 @@ function createGeminiProvider(options = {}) {
|
|
367
|
-
);
|
|
368
|
-
return provider;
|
|
369
|
-
}
|
|
370
|
-
+
|
|
371
|
-
export {
|
|
372
|
-
ThinkingLevel,
|
|
373
|
-
createGeminiProvider as createGeminiCliCoreProvider,
|