@aiderdesk/aiderdesk 0.71.2-dev → 0.72.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/out/cli.js +87 -3
- package/out/renderer/assets/{AgentSettings-CGvSAJzP.js → AgentSettings-CEw1Tgyu.js} +133 -125
- package/out/renderer/assets/{InfoIcon-CWchJVTd.js → InfoIcon-B6bij_VJ.js} +1 -1
- package/out/renderer/assets/{Onboarding-DJOy0-Od.js → Onboarding-C2CtQOko.js} +4 -4
- package/out/renderer/assets/{ProviderHeader-BeAt2P8D.js → ProviderHeader-BCrdzdGT.js} +384 -165
- package/out/renderer/assets/{SettingsPage-iA6BPLfI.js → SettingsPage-CNCsKRS7.js} +647 -265
- package/out/renderer/assets/{UsageDashboard-Byo1Se6j.js → UsageDashboard-DtZ8GTj6.js} +3 -3
- package/out/renderer/assets/{arc-DMKtKWVp.js → arc-DnyT8oZ2.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-3BPJPVTR-B6q0Xxlt.js → architectureDiagram-3BPJPVTR-Dus_2n--.js} +3 -3
- package/out/renderer/assets/{blockDiagram-GPEHLZMM-CwUkQOmu.js → blockDiagram-GPEHLZMM-A3REgcbw.js} +4 -4
- package/out/renderer/assets/{c4Diagram-AAUBKEIU-jfNF8o54.js → c4Diagram-AAUBKEIU-DksErR7z.js} +2 -2
- package/out/renderer/assets/{channel-CGSP36Ng.js → channel-DkjNDJNa.js} +1 -1
- package/out/renderer/assets/{chunk-2J33WTMH-m9o4-rdE.js → chunk-2J33WTMH-CrUC6pnQ.js} +1 -1
- package/out/renderer/assets/{chunk-4BX2VUAB-sBI0mD9g.js → chunk-4BX2VUAB-BulXGa1B.js} +1 -1
- package/out/renderer/assets/{chunk-55IACEB6-Bi-yVgmi.js → chunk-55IACEB6-pQjPbAe9.js} +1 -1
- package/out/renderer/assets/{chunk-727SXJPM-DeJ6FAqm.js → chunk-727SXJPM-BcqphFMh.js} +5 -5
- package/out/renderer/assets/{chunk-AQP2D5EJ-RYpGSg2J.js → chunk-AQP2D5EJ-DCREtqoW.js} +3 -3
- package/out/renderer/assets/{chunk-FMBD7UC4-DhXJts_9.js → chunk-FMBD7UC4-LFUgit2t.js} +1 -1
- package/out/renderer/assets/{chunk-ND2GUHAM-BmWa3jDz.js → chunk-ND2GUHAM-Bkunzp-9.js} +1 -1
- package/out/renderer/assets/{chunk-QZHKN3VN-BDCZFGDN.js → chunk-QZHKN3VN-foWYS4_y.js} +1 -1
- package/out/renderer/assets/{classDiagram-4FO5ZUOK-B5meZIas.js → classDiagram-4FO5ZUOK-CVbKiC6R.js} +6 -6
- package/out/renderer/assets/{classDiagram-v2-Q7XG4LA2-B5meZIas.js → classDiagram-v2-Q7XG4LA2-CVbKiC6R.js} +6 -6
- package/out/renderer/assets/{cose-bilkent-S5V4N54A-nN2TmyEI.js → cose-bilkent-S5V4N54A-Bw7reEuM.js} +1 -1
- package/out/renderer/assets/{dagre-BM42HDAG-CKF8Re4C.js → dagre-BM42HDAG-oGURKg82.js} +3 -3
- package/out/renderer/assets/{diagram-2AECGRRQ-BEz7N4-p.js → diagram-2AECGRRQ-kaoJ1YpU.js} +3 -3
- package/out/renderer/assets/{diagram-5GNKFQAL-DzixbxEI.js → diagram-5GNKFQAL-EvoHkNwk.js} +4 -4
- package/out/renderer/assets/{diagram-KO2AKTUF-DrU3hJT-.js → diagram-KO2AKTUF-D5N5hwBV.js} +3 -3
- package/out/renderer/assets/{diagram-LMA3HP47-DeV3p8aR.js → diagram-LMA3HP47-kKi9mSGe.js} +3 -3
- package/out/renderer/assets/{diagram-OG6HWLK6-DqkXt2nH.js → diagram-OG6HWLK6-BWJ9L5AP.js} +4 -4
- package/out/renderer/assets/{erDiagram-TEJ5UH35-BQPyNf4w.js → erDiagram-TEJ5UH35-d1W9ONuu.js} +4 -4
- package/out/renderer/assets/{flowDiagram-I6XJVG4X-D2v6iQ98.js → flowDiagram-I6XJVG4X-u5Xk-TTj.js} +6 -6
- package/out/renderer/assets/{ganttDiagram-6RSMTGT7-CkYOeW7M.js → ganttDiagram-6RSMTGT7-DiheBMSM.js} +3 -3
- package/out/renderer/assets/{gitGraphDiagram-PVQCEYII-g-Uk6P-N.js → gitGraphDiagram-PVQCEYII-B7hUlCNM.js} +4 -4
- package/out/renderer/assets/{graph-CV504Ptb.js → graph-D7JlCUW0.js} +1 -1
- package/out/renderer/assets/{index-U06SYLCN.js → index-3OKQF96N.js} +1 -1
- package/out/renderer/assets/{index-3BRmjDVt.js → index-BgXUknVd.js} +129 -30
- package/out/renderer/assets/{index-BKAL4gqM.js → index-ClS76F34.js} +1 -1
- package/out/renderer/assets/{index-BBiLtvNT.js → index-CzGef_M5.js} +1 -1
- package/out/renderer/assets/{index-BRRWavZT.js → index-D8P2TG70.js} +1 -1
- package/out/renderer/assets/{index-D4QsfuBU.css → index-DJwDiyPe.css} +8 -0
- package/out/renderer/assets/{index-Bup9YtMB.js → index-DOl0MdBC.js} +1 -1
- package/out/renderer/assets/{index-DWl6Lclq.js → index-DcFrLBMu.js} +1 -1
- package/out/renderer/assets/{index-McGZ6Dx1.js → index-Duwg55fn.js} +1 -1
- package/out/renderer/assets/{index-MWcT9iVP.js → index-biM8l5ZN.js} +3377 -1970
- package/out/renderer/assets/{index-BijIcXFX.js → index-gnQtDa4r.js} +1 -1
- package/out/renderer/assets/{infoDiagram-5YYISTIA-D7CDIKx-.js → infoDiagram-5YYISTIA-BNOwcP8d.js} +2 -2
- package/out/renderer/assets/{ishikawaDiagram-YF4QCWOH-Dy5lIJM3.js → ishikawaDiagram-YF4QCWOH-DZGvMXcI.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-JHISSGLW-s4XQg-Ha.js → journeyDiagram-JHISSGLW-BF-SCAHN.js} +4 -4
- package/out/renderer/assets/{jsx-dev-runtime-D9-9kVso.js → jsx-dev-runtime-BZnUoQef.js} +1 -1
- package/out/renderer/assets/{kanban-definition-UN3LZRKU-BCWYozJY.js → kanban-definition-UN3LZRKU-Cp9SfO9v.js} +2 -2
- package/out/renderer/assets/{layout-DnWGEu0W.js → layout-BxWwRUTm.js} +2 -2
- package/out/renderer/assets/{linear-BP7dS-hv.js → linear-Cpdxqlgb.js} +1 -1
- package/out/renderer/assets/{mindmap-definition-RKZ34NQL-DpF4KI3g.js → mindmap-definition-RKZ34NQL-BtGsJF8k.js} +3 -3
- package/out/renderer/assets/{pieDiagram-4H26LBE5-B6ZbPky5.js → pieDiagram-4H26LBE5-choZS41J.js} +4 -4
- package/out/renderer/assets/{quadrantDiagram-W4KKPZXB-QcDi1tPp.js → quadrantDiagram-W4KKPZXB-CSEwIgFD.js} +2 -2
- package/out/renderer/assets/{requirementDiagram-4Y6WPE33-B1JR969o.js → requirementDiagram-4Y6WPE33-sCdLoMf0.js} +3 -3
- package/out/renderer/assets/{sankeyDiagram-5OEKKPKP-BJ5rhw2A.js → sankeyDiagram-5OEKKPKP-DunA5v4o.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-3UESZ5HK-AdtAIm4D.js → sequenceDiagram-3UESZ5HK-Cwz8rZA1.js} +3 -3
- package/out/renderer/assets/{stateDiagram-AJRCARHV--GQXQ4Qf.js → stateDiagram-AJRCARHV-VCMhb3e-.js} +6 -6
- package/out/renderer/assets/{stateDiagram-v2-BHNVJYJU-CQAnRm7m.js → stateDiagram-v2-BHNVJYJU-B9OcfdsH.js} +4 -4
- package/out/renderer/assets/{time-BUK5ZzpA.js → time-CtsiuOCL.js} +1 -1
- package/out/renderer/assets/{timeline-definition-PNZ67QCA-CRru39WZ.js → timeline-definition-PNZ67QCA-B36Hc_gQ.js} +2 -2
- package/out/renderer/assets/{vennDiagram-CIIHVFJN-KF7qF8WR.js → vennDiagram-CIIHVFJN-Dt2oWHz0.js} +1 -1
- package/out/renderer/assets/{wardley-L42UT6IY-D3pQt3SZ.js → wardley-L42UT6IY-DkWaUY9X.js} +1 -1
- package/out/renderer/assets/{wardleyDiagram-YWT4CUSO-D3zxlHug.js → wardleyDiagram-YWT4CUSO-BHFM3JNH.js} +3 -3
- package/out/renderer/assets/{xychartDiagram-2RQKCTM6-B_0-TgYJ.js → xychartDiagram-2RQKCTM6-2wqqMVJ7.js} +2 -2
- package/out/renderer/index.html +2 -2
- package/out/resources/connector/connector.py +6 -1
- package/out/runner.js +752 -313
- package/package.json +15 -19
- package/scripts/download-probe.mjs +9 -2
- package/scripts/generate-package.mjs +0 -1
- package/out/renderer/assets/gemini-cli-BKI4k4GP.png +0 -0
- package/patches/ai-sdk-provider-gemini-cli+1.5.1.patch +0 -373
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiderdesk/aiderdesk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.72.0",
|
|
4
4
|
"description": "AiderDesk - AI-Powered Development Platform",
|
|
5
5
|
"bin": {
|
|
6
6
|
"aiderdesk": "./bin/aiderdesk.js"
|
|
@@ -36,19 +36,19 @@
|
|
|
36
36
|
},
|
|
37
37
|
"license": "MIT",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@ai-sdk/alibaba": "0.0.
|
|
40
|
-
"@ai-sdk/amazon-bedrock": "3.0.
|
|
41
|
-
"@ai-sdk/anthropic": "2.0.
|
|
42
|
-
"@ai-sdk/azure": "2.0.
|
|
43
|
-
"@ai-sdk/cerebras": "1.0.
|
|
44
|
-
"@ai-sdk/deepseek": "1.0.
|
|
45
|
-
"@ai-sdk/google": "2.0.
|
|
46
|
-
"@ai-sdk/google-vertex": "3.0.
|
|
47
|
-
"@ai-sdk/groq": "2.0.
|
|
48
|
-
"@ai-sdk/mistral": "2.0.
|
|
49
|
-
"@ai-sdk/openai": "2.0.
|
|
50
|
-
"@ai-sdk/openai-compatible": "1.0.
|
|
51
|
-
"@aiderdesk/extensions": "0.
|
|
39
|
+
"@ai-sdk/alibaba": "0.0.13",
|
|
40
|
+
"@ai-sdk/amazon-bedrock": "3.0.103",
|
|
41
|
+
"@ai-sdk/anthropic": "2.0.83",
|
|
42
|
+
"@ai-sdk/azure": "2.0.112",
|
|
43
|
+
"@ai-sdk/cerebras": "1.0.46",
|
|
44
|
+
"@ai-sdk/deepseek": "1.0.44",
|
|
45
|
+
"@ai-sdk/google": "2.0.76",
|
|
46
|
+
"@ai-sdk/google-vertex": "3.0.143",
|
|
47
|
+
"@ai-sdk/groq": "2.0.42",
|
|
48
|
+
"@ai-sdk/mistral": "2.0.35",
|
|
49
|
+
"@ai-sdk/openai": "2.0.108",
|
|
50
|
+
"@ai-sdk/openai-compatible": "1.0.41",
|
|
51
|
+
"@aiderdesk/extensions": "0.23.0",
|
|
52
52
|
"@aws-sdk/client-bedrock": "^3.1059.0",
|
|
53
53
|
"@aws-sdk/credential-providers": "^3.1059.0",
|
|
54
54
|
"@dotenvx/dotenvx": "^1.24.5",
|
|
@@ -64,7 +64,6 @@
|
|
|
64
64
|
"@requesty/ai-sdk": "^2.3.0",
|
|
65
65
|
"adm-zip": "^0.5.16",
|
|
66
66
|
"ai": "5.0.195",
|
|
67
|
-
"ai-sdk-provider-gemini-cli": "1.5.1",
|
|
68
67
|
"chalk": "^5.6.2",
|
|
69
68
|
"cheerio": "^1.0.0",
|
|
70
69
|
"chokidar": "^4.0.3",
|
|
@@ -85,7 +84,6 @@
|
|
|
85
84
|
"jiti": "^2.6.1",
|
|
86
85
|
"langfuse-vercel": "^3.38.4",
|
|
87
86
|
"lodash": "^4.18.1",
|
|
88
|
-
"node-fetch": "3.3.2",
|
|
89
87
|
"ollama-ai-provider-v2": "^1.5.5",
|
|
90
88
|
"os-name": "^6.0.0",
|
|
91
89
|
"patch-package": "^8.0.0",
|
|
@@ -97,6 +95,7 @@
|
|
|
97
95
|
"tree-kill": "^1.2.2",
|
|
98
96
|
"turndown": "^7.2.1",
|
|
99
97
|
"typescript": "^5.9.3",
|
|
98
|
+
"undici": "8.5.0",
|
|
100
99
|
"uuid": "^14.0.0",
|
|
101
100
|
"winston": "^3.17.0",
|
|
102
101
|
"winston-daily-rotate-file": "^5.0.0",
|
|
@@ -106,9 +105,6 @@
|
|
|
106
105
|
"zod": "^4.1.11"
|
|
107
106
|
},
|
|
108
107
|
"overrides": {
|
|
109
|
-
"ai-sdk-provider-gemini-cli": {
|
|
110
|
-
"diff": "^8.0.4"
|
|
111
|
-
},
|
|
112
108
|
"@huggingface/transformers": {
|
|
113
109
|
"sharp": "npm:empty-npm-package@1.0.0"
|
|
114
110
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ProxyAgent, setGlobalDispatcher } from 'undici';
|
|
2
2
|
import { createWriteStream, existsSync, mkdirSync, unlinkSync, renameSync, rmSync } from 'fs';
|
|
3
3
|
import { join } from 'path';
|
|
4
4
|
import fs from 'fs';
|
|
@@ -7,9 +7,16 @@ import { promisify } from 'util';
|
|
|
7
7
|
import { extract } from "tar";
|
|
8
8
|
import AdmZip from 'adm-zip';
|
|
9
9
|
|
|
10
|
+
const proxyUrl = process.env.https_proxy || process.env.HTTPS_PROXY
|
|
11
|
+
|| process.env.http_proxy || process.env.HTTP_PROXY;
|
|
12
|
+
if (proxyUrl) {
|
|
13
|
+
setGlobalDispatcher(new ProxyAgent(proxyUrl));
|
|
14
|
+
console.log(`Using proxy: ${proxyUrl}`);
|
|
15
|
+
}
|
|
16
|
+
|
|
10
17
|
const streamPipeline = promisify(pipeline);
|
|
11
18
|
|
|
12
|
-
const PROBE_VERSION = 'v0.6.0-
|
|
19
|
+
const PROBE_VERSION = 'v0.6.0-rc325';
|
|
13
20
|
const BASE_URL = `https://github.com/probelabs/probe/releases/download/${PROBE_VERSION}`;
|
|
14
21
|
const RESOURCES_DIR = process.env.RESOURCES_DIR || './resources';
|
|
15
22
|
|
|
@@ -31,7 +31,6 @@ const NODE_BUILTINS = new Set([
|
|
|
31
31
|
'node:tls', 'node:trace_events', 'node:tty', 'node:url', 'node:util',
|
|
32
32
|
'node:v8', 'node:vm', 'node:wasi', 'node:worker_threads', 'node:zlib',
|
|
33
33
|
'node:sqlite',
|
|
34
|
-
'undici',
|
|
35
34
|
]);
|
|
36
35
|
|
|
37
36
|
// Packages that are already in the committed package.json CLI deps
|
|
Binary file
|
|
@@ -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,
|