@qwen-code/qwen-code 0.18.4 → 0.18.5-preview.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/bundled/qc-helper/SKILL.md +13 -5
- package/bundled/qc-helper/docs/configuration/_meta.ts +1 -0
- package/bundled/qc-helper/docs/configuration/auth.md +75 -54
- package/bundled/qc-helper/docs/configuration/model-providers.md +221 -185
- package/bundled/qc-helper/docs/configuration/qwen-ignore.md +31 -15
- package/bundled/qc-helper/docs/configuration/settings.md +70 -53
- package/bundled/qc-helper/docs/configuration/themes.md +7 -4
- package/bundled/qc-helper/docs/extension/extension-releasing.md +1 -1
- package/bundled/qc-helper/docs/extension/introduction.md +27 -21
- package/bundled/qc-helper/docs/features/approval-mode.md +2 -0
- package/bundled/qc-helper/docs/features/arena.md +3 -3
- package/bundled/qc-helper/docs/features/channels/overview.md +1 -1
- package/bundled/qc-helper/docs/features/channels/plugins.md +1 -1
- package/bundled/qc-helper/docs/features/commands.md +6 -1
- package/bundled/qc-helper/docs/features/headless.md +1 -1
- package/bundled/qc-helper/docs/features/mcp.md +78 -10
- package/bundled/qc-helper/docs/features/sandbox.md +2 -2
- package/bundled/qc-helper/docs/features/tool-use-summaries.md +1 -1
- package/bundled/qc-helper/docs/integration-github-action.md +2 -2
- package/bundled/qc-helper/docs/overview.md +1 -1
- package/bundled/qc-helper/docs/quickstart.md +9 -5
- package/bundled/qc-helper/docs/qwen-serve.md +14 -2
- package/bundled/qc-helper/docs/support/tos-privacy.md +1 -1
- package/chunks/{agent-LYTC56HT.js → agent-P4KSTVXX.js} +24 -22
- package/chunks/{agent-headless-FPUP5WHP.js → agent-headless-QUAPWF55.js} +24 -22
- package/chunks/{anthropicContentGenerator-OLOGBVLP.js → anthropicContentGenerator-7352A7I5.js} +17 -14
- package/chunks/artifact-tool-5J4HUZAV.js +675 -0
- package/chunks/{askUserQuestion-ANRVSBIJ.js → askUserQuestion-HF7HCWDD.js} +20 -7
- package/chunks/{ca-K6MD665I.js → ca-7WC7ELX6.js} +1 -0
- package/chunks/chunk-22IFUCVR.js +291 -0
- package/chunks/{chunk-M5VYHAHT.js → chunk-2BIF2NVV.js} +2 -2
- package/chunks/{chunk-AQDPHFDZ.js → chunk-2QDQTWCI.js} +1 -1
- package/chunks/{chunk-2ES3D3TW.js → chunk-3BR4OIOE.js} +3 -3
- package/chunks/{chunk-N5QHMPZU.js → chunk-3UALQ56H.js} +1 -1
- package/chunks/{chunk-5RVEAAD2.js → chunk-BC5POO46.js} +8 -7
- package/chunks/{chunk-DZCZZPCY.js → chunk-BGUDAULQ.js} +11 -290
- package/chunks/{chunk-FPZF3BNV.js → chunk-BNXANYLH.js} +1 -1
- package/chunks/{chunk-IKOWINH4.js → chunk-C4K3FEQ2.js} +42 -2
- package/chunks/{chunk-PTGKSUUJ.js → chunk-CGEGHF2C.js} +2 -207
- package/chunks/chunk-EEEZIVFJ.js +908 -0
- package/chunks/{chunk-GBTJHKQ6.js → chunk-EIJYMXXX.js} +619 -135
- package/chunks/chunk-EJYJYJZ2.js +3703 -0
- package/chunks/{chunk-F6FP3URI.js → chunk-EW6C27XX.js} +1 -1
- package/chunks/{chunk-HU3RKEK2.js → chunk-F6XNTYNE.js} +216 -1
- package/chunks/{chunk-4HMWGHPP.js → chunk-GZCJS5WH.js} +2 -2
- package/chunks/{chunk-E5SRTXRG.js → chunk-HGNSRCRB.js} +1 -1
- package/chunks/{chunk-IUEQOXOI.js → chunk-KBXLIVWQ.js} +2 -2
- package/chunks/{chunk-JJHY7NAD.js → chunk-L7U2RI5O.js} +59 -57
- package/chunks/{chunk-JN6FVOPP.js → chunk-NKJ6LRCR.js} +2 -2
- package/chunks/{chunk-7OCZ77KA.js → chunk-NWLUISRA.js} +1 -1
- package/chunks/{chunk-JIJBNW4A.js → chunk-OTBK43JR.js} +1 -1
- package/chunks/{chunk-WWU2KUSR.js → chunk-PRYMDRBV.js} +1 -1
- package/chunks/{chunk-KQIKOTQJ.js → chunk-RYLJU2DY.js} +60 -5
- package/chunks/{chunk-VWPDSQZY.js → chunk-T2VDEFUU.js} +2 -2
- package/chunks/{chunk-LXUQBWQA.js → chunk-T336V435.js} +93 -45
- package/chunks/{chunk-4TW2JM5Q.js → chunk-TXVGVZYR.js} +3 -3
- package/chunks/{chunk-6Z2MVJIJ.js → chunk-UMRZ7XCR.js} +172 -5017
- package/chunks/{chunk-7GX7XYZU.js → chunk-XU5P23GN.js} +3 -3
- package/chunks/{chunk-SZWDOOGV.js → chunk-ZC675NGC.js} +11 -11
- package/chunks/{chunk-32SSXBMG.js → chunk-ZXNEOCW2.js} +8049 -5520
- package/chunks/{computer-use-P4WQBATW.js → computer-use-4TLHI3UR.js} +26 -23
- package/chunks/contextCommand-HFEITKSR.js +56 -0
- package/chunks/{cron-create-OKGQO6GX.js → cron-create-A5637KCI.js} +12 -9
- package/chunks/{cron-delete-DTJP7L6O.js → cron-delete-AADOSEOZ.js} +4 -4
- package/chunks/{cron-list-VKZUASFG.js → cron-list-OFCPTT2Y.js} +4 -4
- package/chunks/{de-K2F3T3TR.js → de-ACHALDED.js} +1 -0
- package/chunks/{dist-OLC6NBSB.js → dist-DZ6AJDX4.js} +1 -1
- package/chunks/{dist-QUSDBLAK.js → dist-ZBX7LPJZ.js} +6 -1
- package/chunks/{edit-CS7DSS4Z.js → edit-B7H73V6O.js} +24 -22
- package/chunks/{en-KGSAKBJP.js → en-7OGNWWME.js} +49 -0
- package/chunks/{enter-worktree-PA4HPHJK.js → enter-worktree-GG7ZHYPS.js} +24 -22
- package/chunks/{enterPlanMode-SFE5AFKZ.js → enterPlanMode-RHTAKG52.js} +32 -28
- package/chunks/{exit-worktree-FR3AZTC6.js → exit-worktree-U7VQZRMG.js} +24 -22
- package/chunks/{exitPlanMode-AHOUO44D.js → exitPlanMode-S35A36II.js} +36 -28
- package/chunks/{fr-2CAQEOK6.js → fr-GVKZ27MF.js} +1 -0
- package/chunks/{geminiContentGenerator-AXCVDKGI.js → geminiContentGenerator-W7KVATBA.js} +4 -4
- package/chunks/{glob-BQPAW3IW.js → glob-WOFF7ECI.js} +26 -23
- package/chunks/{grep-2F7BL5TQ.js → grep-MWNYWYWQ.js} +24 -22
- package/chunks/{ja-QWL7V6OJ.js → ja-FKZ2WZ4D.js} +1 -0
- package/chunks/{keychain-token-storage-ALKQXYJQ.js → keychain-token-storage-CSYMNRPP.js} +2 -2
- package/chunks/{loop-wakeup-RX6YIUSG.js → loop-wakeup-DGSMT4N6.js} +5 -5
- package/chunks/{ls-6PLNWHMU.js → ls-UGRZ4ZOM.js} +6 -6
- package/chunks/{lsp-3HFQU4OF.js → lsp-72IJURW3.js} +2 -2
- package/chunks/{monitor-YTTMDFW2.js → monitor-AYUINLYN.js} +24 -22
- package/chunks/{notebook-edit-7TNZMTBR.js → notebook-edit-EP4D4WFD.js} +25 -23
- package/chunks/{openaiContentGenerator-JA6YXXPI.js → openaiContentGenerator-SLYYF7AM.js} +12 -13
- package/chunks/{pt-2SPOLMAY.js → pt-SY5NCFGR.js} +1 -0
- package/chunks/{qwenContentGenerator-NBOVGW7B.js → qwenContentGenerator-VZ7JYU4A.js} +27 -25
- package/chunks/{qwenOAuth2-XWC5SU63.js → qwenOAuth2-K4AASPCV.js} +5 -4
- package/chunks/{read-file-RUBU3KUA.js → read-file-65EQ53KS.js} +9 -8
- package/chunks/{ripGrep-TPFC7KZF.js → ripGrep-5XLHJDDM.js} +24 -22
- package/chunks/{ru-35IVJTEH.js → ru-FWNXJG4F.js} +1 -0
- package/chunks/{scheduler-NTVF45LR.js → scheduler-5GLJSA2H.js} +73 -27
- package/chunks/{send-message-IIT3SHA7.js → send-message-URUZ7PLA.js} +24 -4
- package/chunks/{serve-J6VG37OX.js → serve-MUROZGCG.js} +7575 -6916
- package/chunks/{shell-EQQEHEFI.js → shell-ET3BQWKB.js} +24 -22
- package/chunks/{skill-QWRWJCQJ.js → skill-YEYABCAF.js} +11 -10
- package/chunks/{src-LNADIG5P.js → src-POVOI65Y.js} +165 -66
- package/chunks/{syntheticOutput-H67FYXU7.js → syntheticOutput-65FRJGWM.js} +3 -3
- package/chunks/{task-create-OVXHSHAI.js → task-create-IH45HOFT.js} +6 -6
- package/chunks/{task-list-QUUCQJ3U.js → task-list-FUB6JWSX.js} +5 -5
- package/chunks/{task-stop-WA5DMTKK.js → task-stop-P6IOHQM3.js} +2 -2
- package/chunks/{task-update-PC5427TI.js → task-update-RTUT7LJV.js} +6 -6
- package/chunks/{team-create-TXWQL777.js → team-create-EFZFKQFP.js} +28 -26
- package/chunks/{team-delete-ZTEMYRJ3.js → team-delete-RXGYRMHC.js} +5 -5
- package/chunks/{todoWrite-J6L6ELD6.js → todoWrite-O6JK24G6.js} +4 -4
- package/chunks/{tool-search-JAVM7ABF.js → tool-search-BRJC42TE.js} +9 -8
- package/chunks/{web-fetch-6XLPPTP7.js → web-fetch-KUMBROUI.js} +4 -4
- package/chunks/{workflow-7LN3L6KK.js → workflow-UDRBNFTT.js} +557 -97
- package/chunks/{write-file-DAKE7YKB.js → write-file-F7TAHAHF.js} +24 -22
- package/chunks/{zh-X4KM6MTW.js → zh-3RMSEO5M.js} +49 -0
- package/chunks/{zh-TW-BSG6BUWK.js → zh-TW-R7WRLTJS.js} +49 -0
- package/cli.js +9205 -5426
- package/locales/ca.js +2 -1
- package/locales/de.js +1 -0
- package/locales/en.js +70 -0
- package/locales/fr.js +1 -0
- package/locales/ja.js +1 -0
- package/locales/pt.js +1 -0
- package/locales/ru.js +1 -0
- package/locales/zh-TW.js +67 -0
- package/locales/zh.js +67 -0
- package/package.json +3 -2
- package/web-shell/assets/{arc-CRFN10gD.js → arc-DHUeMnnj.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-IRlu1CpH.js → architectureDiagram-3BPJPVTR-DlX12yyj.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-htIZ6iw8.js → blockDiagram-GPEHLZMM-DTFUXMUT.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-A2GoRq3O.js → c4Diagram-AAUBKEIU-CWdB54fk.js} +1 -1
- package/web-shell/assets/channel-C3WhMjjP.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-CdP2AC6u.js → chunk-2J33WTMH-CF5C5jNR.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-DrA07nW2.js → chunk-4BX2VUAB-Cw7Ydfji.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-CFGnVU2f.js → chunk-55IACEB6-CnbI1ZCw.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-BTMkq3Tk.js → chunk-727SXJPM-DmSy00Pe.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-C9sYg04Z.js → chunk-AQP2D5EJ-DgNgXqBu.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-Cag-cj6I.js → chunk-FMBD7UC4-tz2IvOXv.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-CDSTFoR7.js → chunk-ND2GUHAM-DaBLEBPa.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-CN9Z6oOs.js → chunk-QZHKN3VN-DVCQST3O.js} +1 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-CQ6TXPif.js +1 -0
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CQ6TXPif.js +1 -0
- package/web-shell/assets/{cose-bilkent-S5V4N54A-DuN9j8Du.js → cose-bilkent-S5V4N54A-CAKTcdCQ.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-ByCWe45f.js → dagre-BM42HDAG-BdkBwlKg.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-eWyU_pKZ.js → diagram-2AECGRRQ-DYt3G65F.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-0Bfu3Fq5.js → diagram-5GNKFQAL-BWvROWjY.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-B6KBKkQP.js → diagram-KO2AKTUF-BvvgwIaQ.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-TToDmeA_.js → diagram-LMA3HP47-E7NLSNKg.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-CQCkC2Yx.js → diagram-OG6HWLK6-CYmUBgpE.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-Cm9ls1iB.js → erDiagram-TEJ5UH35-BU5gY30h.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-Dyoz80Pv.js → flowDiagram-I6XJVG4X-V_ZssSZ9.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-Cfut9yaU.js → ganttDiagram-6RSMTGT7-QIShlsdI.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-BCuJdlfD.js → gitGraphDiagram-PVQCEYII-DJxdu2YS.js} +1 -1
- package/web-shell/assets/index-BPnhI7gl.css +1 -0
- package/web-shell/assets/index-De4rqTsW.js +706 -0
- package/web-shell/assets/{infoDiagram-5YYISTIA-CXKxF2VL.js → infoDiagram-5YYISTIA-BqjdrFeO.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-DE7HWSU8.js → ishikawaDiagram-YF4QCWOH-BP_a2YZ2.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-D__YUfds.js → journeyDiagram-JHISSGLW-BXg-S3Lk.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-D82R169M.js → kanban-definition-UN3LZRKU-BksAkdEJ.js} +1 -1
- package/web-shell/assets/{linear-DpyMbKqT.js → linear-D2m9-ODE.js} +1 -1
- package/web-shell/assets/{mermaid.core-D1KEFDhn.js → mermaid.core-dTtkZp2F.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-BwVUFGFE.js → mindmap-definition-RKZ34NQL-Bft9my8O.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-BO_qoEGx.js → pieDiagram-4H26LBE5-Cw8S-alZ.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-Cx0ZaWPo.js → quadrantDiagram-W4KKPZXB-DaDoTMts.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-BJPXejOA.js → requirementDiagram-4Y6WPE33-Cp5kSpwj.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-C1xeIL9i.js → sankeyDiagram-5OEKKPKP-CW8RsJJZ.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-CSYKQUjf.js → sequenceDiagram-3UESZ5HK-DTfpIiJK.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-d9hiHlAW.js → stateDiagram-AJRCARHV-DixFVzEs.js} +1 -1
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DZgE04s3.js +1 -0
- package/web-shell/assets/{timeline-definition-PNZ67QCA-BhCBkq8k.js → timeline-definition-PNZ67QCA-DYsbXn5l.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-DPPFWp_y.js → vennDiagram-CIIHVFJN-HUpRpuUp.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-CcOUIgXY.js → wardley-L42UT6IY-cT3nQH_T.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-p7oR5X7r.js → wardleyDiagram-YWT4CUSO-Dmm7J6Qc.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-Dfr7-SEy.js → xychartDiagram-2RQKCTM6-CX0L5p9C.js} +1 -1
- package/web-shell/index.html +3 -3
- package/chunks/chunk-77WXWU44.js +0 -26
- package/chunks/contextCommand-POQ6GYN3.js +0 -54
- package/web-shell/assets/channel-WwImfsc7.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-CJKQYFeJ.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CJKQYFeJ.js +0 -1
- package/web-shell/assets/index-BDZiTAkl.css +0 -1
- package/web-shell/assets/index-DaebdpHq.js +0 -516
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DgReoybQ.js +0 -1
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
BaseToolInvocation,
|
|
10
10
|
ToolDisplayNames,
|
|
11
11
|
ToolNames
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-L7U2RI5O.js";
|
|
13
13
|
import {
|
|
14
14
|
createDebugLogger
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-C4K3FEQ2.js";
|
|
16
16
|
import "./chunk-Z2Z3GUXZ.js";
|
|
17
17
|
import {
|
|
18
18
|
init_esbuild_shims
|
|
@@ -24,6 +24,14 @@ import {
|
|
|
24
24
|
// packages/core/src/tools/askUserQuestion.ts
|
|
25
25
|
init_esbuild_shims();
|
|
26
26
|
var debugLogger = createDebugLogger("ASK_USER_QUESTION");
|
|
27
|
+
function parseAnswerQuestionIndex(key, questionCount) {
|
|
28
|
+
const index = Number(key);
|
|
29
|
+
if (!Number.isSafeInteger(index) || index < 0 || index >= questionCount || String(index) !== key) {
|
|
30
|
+
return void 0;
|
|
31
|
+
}
|
|
32
|
+
return index;
|
|
33
|
+
}
|
|
34
|
+
__name(parseAnswerQuestionIndex, "parseAnswerQuestionIndex");
|
|
27
35
|
var askUserQuestionToolDescription = `Use this tool when you need to ask the user questions during execution. This allows you to:
|
|
28
36
|
1. Gather user preferences or requirements
|
|
29
37
|
2. Clarify ambiguous instructions
|
|
@@ -175,18 +183,23 @@ var AskUserQuestionToolInvocation = class extends BaseToolInvocation {
|
|
|
175
183
|
returnDisplay: cancellationMessage
|
|
176
184
|
};
|
|
177
185
|
}
|
|
178
|
-
const answersContent = Object.entries(this.userAnswers).
|
|
179
|
-
const questionIndex =
|
|
186
|
+
const answersContent = Object.entries(this.userAnswers).flatMap(([key, value]) => {
|
|
187
|
+
const questionIndex = parseAnswerQuestionIndex(
|
|
188
|
+
key,
|
|
189
|
+
this.params.questions.length
|
|
190
|
+
);
|
|
191
|
+
if (questionIndex === void 0) return [];
|
|
180
192
|
const question = this.params.questions[questionIndex];
|
|
181
|
-
return `**${question
|
|
193
|
+
return `**${question.header || `Question ${questionIndex + 1}`}**: ${value}`;
|
|
182
194
|
}).join("\n");
|
|
183
195
|
this.applyPlanGateMetadata();
|
|
196
|
+
const messageBody = answersContent.length > 0 ? answersContent : "No valid answers were provided.";
|
|
184
197
|
const llmMessage = `User has provided the following answers:
|
|
185
198
|
|
|
186
|
-
${
|
|
199
|
+
${messageBody}`;
|
|
187
200
|
const displayMessage = `User has provided the following answers:
|
|
188
201
|
|
|
189
|
-
${
|
|
202
|
+
${messageBody}`;
|
|
190
203
|
return {
|
|
191
204
|
llmContent: llmMessage,
|
|
192
205
|
returnDisplay: displayMessage
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
// Force strict mode and setup for ESM
|
|
2
|
+
"use strict";
|
|
3
|
+
import {
|
|
4
|
+
init_esbuild_shims
|
|
5
|
+
} from "./chunk-A4BMJM77.js";
|
|
6
|
+
import {
|
|
7
|
+
__name
|
|
8
|
+
} from "./chunk-J2S4EL5Y.js";
|
|
9
|
+
|
|
10
|
+
// packages/core/src/utils/browser.ts
|
|
11
|
+
init_esbuild_shims();
|
|
12
|
+
var browserBlocklist = ["www-browser"];
|
|
13
|
+
function isBrowserCommandBlocked(command) {
|
|
14
|
+
const commandName = command.replace(/\\/g, "/").split("/").pop();
|
|
15
|
+
return !!commandName && browserBlocklist.includes(commandName);
|
|
16
|
+
}
|
|
17
|
+
__name(isBrowserCommandBlocked, "isBrowserCommandBlocked");
|
|
18
|
+
function shouldAttemptBrowserLaunch(options = {}) {
|
|
19
|
+
const browserEnv = process.env["BROWSER"]?.trim();
|
|
20
|
+
const browserCommand = browserEnv?.match(/^\S+/)?.[0];
|
|
21
|
+
if (!options.ignoreBrowserBlocklist && process.platform !== "win32" && browserCommand && isBrowserCommandBlocked(browserCommand)) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
if (process.env["CI"] || process.env["DEBIAN_FRONTEND"] === "noninteractive") {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
const isSSH = !!process.env["SSH_CONNECTION"];
|
|
28
|
+
if (process.platform === "linux") {
|
|
29
|
+
const displayVariables = ["DISPLAY", "WAYLAND_DISPLAY", "MIR_SOCKET"];
|
|
30
|
+
const hasDisplay = displayVariables.some((v) => !!process.env[v]);
|
|
31
|
+
if (!hasDisplay) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (isSSH && process.platform !== "linux") {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
__name(shouldAttemptBrowserLaunch, "shouldAttemptBrowserLaunch");
|
|
41
|
+
|
|
42
|
+
// packages/core/src/utils/secure-browser-launcher.ts
|
|
43
|
+
init_esbuild_shims();
|
|
44
|
+
import { execFile, spawn } from "node:child_process";
|
|
45
|
+
import { promisify } from "node:util";
|
|
46
|
+
import { platform } from "node:os";
|
|
47
|
+
import { resolve } from "node:path";
|
|
48
|
+
import { URL, fileURLToPath } from "node:url";
|
|
49
|
+
var execFileAsync = promisify(execFile);
|
|
50
|
+
function validateUrl(url, { allowFile = false, allowedFilePaths } = {}) {
|
|
51
|
+
let parsedUrl;
|
|
52
|
+
try {
|
|
53
|
+
parsedUrl = new URL(url);
|
|
54
|
+
} catch (_error) {
|
|
55
|
+
throw new Error(`Invalid URL: ${url}`);
|
|
56
|
+
}
|
|
57
|
+
const allowedProtocols = allowFile ? ["http:", "https:", "file:"] : ["http:", "https:"];
|
|
58
|
+
if (!allowedProtocols.includes(parsedUrl.protocol)) {
|
|
59
|
+
throw new Error(
|
|
60
|
+
`Unsafe protocol: ${parsedUrl.protocol}. Only ${allowedProtocols.join(
|
|
61
|
+
", "
|
|
62
|
+
)} are allowed.`
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
if (parsedUrl.protocol === "file:" && allowFile) {
|
|
66
|
+
if (!allowedFilePaths?.length) {
|
|
67
|
+
throw new Error("allowedFilePaths is required when allowFile is true");
|
|
68
|
+
}
|
|
69
|
+
const requestedPath = resolve(fileURLToPath(parsedUrl));
|
|
70
|
+
const allowed = allowedFilePaths.map((filePath) => resolve(filePath));
|
|
71
|
+
if (!allowed.includes(requestedPath)) {
|
|
72
|
+
throw new Error("File URL is not in the allowed file set");
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (/[\r\n\x00-\x1f]/.test(url)) {
|
|
76
|
+
throw new Error("URL contains invalid characters");
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
__name(validateUrl, "validateUrl");
|
|
80
|
+
async function openBrowserSecurely(url, browserOptions = {}) {
|
|
81
|
+
validateUrl(url, browserOptions);
|
|
82
|
+
const platformName = platform();
|
|
83
|
+
let command;
|
|
84
|
+
let args;
|
|
85
|
+
const browserEnv = process.env["BROWSER"]?.trim();
|
|
86
|
+
const browserCommand = platformName === "win32" ? void 0 : buildBrowserCommand(browserEnv, url);
|
|
87
|
+
if (browserCommand) {
|
|
88
|
+
try {
|
|
89
|
+
await launchDetached(browserCommand.command, browserCommand.args);
|
|
90
|
+
return;
|
|
91
|
+
} catch (_error) {
|
|
92
|
+
console.warn(
|
|
93
|
+
`Failed to open BROWSER command ${browserCommand.command}: ${formatLaunchError(
|
|
94
|
+
_error
|
|
95
|
+
)}. Falling back to the platform browser opener.`
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (!shouldAttemptBrowserLaunch({ ignoreBrowserBlocklist: true })) {
|
|
100
|
+
console.warn(
|
|
101
|
+
`Browser launch is not available in this environment. Please open this URL manually: ${url}`
|
|
102
|
+
);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
{
|
|
106
|
+
switch (platformName) {
|
|
107
|
+
case "darwin":
|
|
108
|
+
command = "open";
|
|
109
|
+
args = [url];
|
|
110
|
+
break;
|
|
111
|
+
case "win32":
|
|
112
|
+
command = "powershell.exe";
|
|
113
|
+
args = [
|
|
114
|
+
"-NoProfile",
|
|
115
|
+
"-NonInteractive",
|
|
116
|
+
"-WindowStyle",
|
|
117
|
+
"Hidden",
|
|
118
|
+
"-Command",
|
|
119
|
+
`Start-Process '${url.replace(/'/g, "''")}'`
|
|
120
|
+
];
|
|
121
|
+
break;
|
|
122
|
+
case "linux":
|
|
123
|
+
case "freebsd":
|
|
124
|
+
case "openbsd":
|
|
125
|
+
command = "xdg-open";
|
|
126
|
+
args = [url];
|
|
127
|
+
break;
|
|
128
|
+
default:
|
|
129
|
+
throw new Error(`Unsupported platform: ${platformName}`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
const execOptions = {
|
|
133
|
+
// Don't inherit parent's environment to avoid potential issues
|
|
134
|
+
env: {
|
|
135
|
+
...process.env,
|
|
136
|
+
// Ensure we're not in a shell that might interpret special characters
|
|
137
|
+
SHELL: void 0
|
|
138
|
+
},
|
|
139
|
+
// Detach the browser process so it doesn't block
|
|
140
|
+
detached: true,
|
|
141
|
+
stdio: "ignore"
|
|
142
|
+
};
|
|
143
|
+
try {
|
|
144
|
+
await execFileAsync(command, args, execOptions);
|
|
145
|
+
} catch (_error) {
|
|
146
|
+
if ((platformName === "linux" || platformName === "freebsd" || platformName === "openbsd") && command === "xdg-open") {
|
|
147
|
+
const fallbackCommands = [
|
|
148
|
+
{ command: "gnome-open", detached: false },
|
|
149
|
+
{ command: "kde-open", detached: false },
|
|
150
|
+
{ command: "firefox", detached: true },
|
|
151
|
+
{ command: "chromium", detached: true },
|
|
152
|
+
{ command: "google-chrome", detached: true },
|
|
153
|
+
{ command: "microsoft-edge", detached: true }
|
|
154
|
+
];
|
|
155
|
+
for (const { command: fallbackCommand, detached } of fallbackCommands) {
|
|
156
|
+
try {
|
|
157
|
+
if (detached) {
|
|
158
|
+
await launchDetached(fallbackCommand, [url]);
|
|
159
|
+
} else {
|
|
160
|
+
await execFileAsync(fallbackCommand, [url], execOptions);
|
|
161
|
+
}
|
|
162
|
+
return;
|
|
163
|
+
} catch {
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
console.warn(
|
|
169
|
+
`Failed to open browser automatically. Please open this URL manually: ${url}`
|
|
170
|
+
);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
__name(openBrowserSecurely, "openBrowserSecurely");
|
|
175
|
+
async function launchDetached(command, args) {
|
|
176
|
+
const spawnOptions = {
|
|
177
|
+
env: {
|
|
178
|
+
...process.env,
|
|
179
|
+
SHELL: void 0
|
|
180
|
+
},
|
|
181
|
+
detached: true,
|
|
182
|
+
stdio: "ignore"
|
|
183
|
+
};
|
|
184
|
+
await new Promise((resolve2, reject) => {
|
|
185
|
+
const child = spawn(command, args, spawnOptions);
|
|
186
|
+
let settled = false;
|
|
187
|
+
child.once("error", (error) => {
|
|
188
|
+
if (settled) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
settled = true;
|
|
192
|
+
reject(error);
|
|
193
|
+
});
|
|
194
|
+
child.once("spawn", () => {
|
|
195
|
+
if (settled) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
settled = true;
|
|
199
|
+
child.unref();
|
|
200
|
+
resolve2();
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
__name(launchDetached, "launchDetached");
|
|
205
|
+
function formatLaunchError(error) {
|
|
206
|
+
return error instanceof Error ? error.message : String(error);
|
|
207
|
+
}
|
|
208
|
+
__name(formatLaunchError, "formatLaunchError");
|
|
209
|
+
function buildBrowserCommand(browserEnv, url) {
|
|
210
|
+
if (!browserEnv) {
|
|
211
|
+
return void 0;
|
|
212
|
+
}
|
|
213
|
+
const browserCommand = parseBrowserCommand(browserEnv);
|
|
214
|
+
if (!browserCommand) {
|
|
215
|
+
console.warn(
|
|
216
|
+
"Invalid BROWSER environment variable, falling back to platform default."
|
|
217
|
+
);
|
|
218
|
+
return void 0;
|
|
219
|
+
}
|
|
220
|
+
if (isBrowserCommandBlocked(browserCommand.command)) {
|
|
221
|
+
return void 0;
|
|
222
|
+
}
|
|
223
|
+
let usedPlaceholder = false;
|
|
224
|
+
const args = browserCommand.args.map((arg) => {
|
|
225
|
+
if (!arg.includes("%s")) {
|
|
226
|
+
return arg;
|
|
227
|
+
}
|
|
228
|
+
usedPlaceholder = true;
|
|
229
|
+
return arg.replace(/%s/g, () => url);
|
|
230
|
+
});
|
|
231
|
+
if (!usedPlaceholder) {
|
|
232
|
+
args.push(url);
|
|
233
|
+
}
|
|
234
|
+
return { command: browserCommand.command, args };
|
|
235
|
+
}
|
|
236
|
+
__name(buildBrowserCommand, "buildBrowserCommand");
|
|
237
|
+
function parseBrowserCommand(browserEnv) {
|
|
238
|
+
const parts = [];
|
|
239
|
+
let current = "";
|
|
240
|
+
let quote;
|
|
241
|
+
for (const char of browserEnv) {
|
|
242
|
+
if (quote) {
|
|
243
|
+
if (char === quote) {
|
|
244
|
+
quote = void 0;
|
|
245
|
+
} else {
|
|
246
|
+
current += char;
|
|
247
|
+
}
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
if (char === '"' || char === "'") {
|
|
251
|
+
quote = char;
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
if (/\s/.test(char)) {
|
|
255
|
+
if (current) {
|
|
256
|
+
parts.push(current);
|
|
257
|
+
current = "";
|
|
258
|
+
}
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
current += char;
|
|
262
|
+
}
|
|
263
|
+
if (quote) {
|
|
264
|
+
return void 0;
|
|
265
|
+
}
|
|
266
|
+
if (current) {
|
|
267
|
+
parts.push(current);
|
|
268
|
+
}
|
|
269
|
+
const [command, ...args] = parts;
|
|
270
|
+
if (!command) {
|
|
271
|
+
return void 0;
|
|
272
|
+
}
|
|
273
|
+
return { command, args };
|
|
274
|
+
}
|
|
275
|
+
__name(parseBrowserCommand, "parseBrowserCommand");
|
|
276
|
+
function shouldLaunchBrowser() {
|
|
277
|
+
return shouldAttemptBrowserLaunch();
|
|
278
|
+
}
|
|
279
|
+
__name(shouldLaunchBrowser, "shouldLaunchBrowser");
|
|
280
|
+
|
|
281
|
+
export {
|
|
282
|
+
isBrowserCommandBlocked,
|
|
283
|
+
shouldAttemptBrowserLaunch,
|
|
284
|
+
openBrowserSecurely,
|
|
285
|
+
shouldLaunchBrowser
|
|
286
|
+
};
|
|
287
|
+
/**
|
|
288
|
+
* @license
|
|
289
|
+
* Copyright 2025 Google LLC
|
|
290
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
291
|
+
*/
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
} from "./chunk-LD2XBG6Z.js";
|
|
11
11
|
import {
|
|
12
12
|
atomicWriteJSON
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-3UALQ56H.js";
|
|
14
14
|
import {
|
|
15
15
|
Storage,
|
|
16
16
|
isNodeError
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-C4K3FEQ2.js";
|
|
18
18
|
import {
|
|
19
19
|
init_esbuild_shims
|
|
20
20
|
} from "./chunk-A4BMJM77.js";
|
|
@@ -15,15 +15,15 @@ import {
|
|
|
15
15
|
readCronTasks,
|
|
16
16
|
removeCronTasks,
|
|
17
17
|
updateCronTasks
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-GZCJS5WH.js";
|
|
19
19
|
import {
|
|
20
20
|
ToolNames
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-L7U2RI5O.js";
|
|
22
22
|
import {
|
|
23
23
|
Storage,
|
|
24
24
|
createDebugLogger,
|
|
25
25
|
getProjectHash
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-C4K3FEQ2.js";
|
|
27
27
|
import {
|
|
28
28
|
init_esbuild_shims
|
|
29
29
|
} from "./chunk-A4BMJM77.js";
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
import {
|
|
4
4
|
t
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZC675NGC.js";
|
|
6
6
|
import {
|
|
7
7
|
computeThresholds,
|
|
8
8
|
getCoreSystemPrompt
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZXNEOCW2.js";
|
|
10
10
|
import {
|
|
11
11
|
buildSkillLlmContent
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OTBK43JR.js";
|
|
13
13
|
import {
|
|
14
14
|
DiscoveredMCPTool,
|
|
15
15
|
uiTelemetryService
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-UMRZ7XCR.js";
|
|
17
17
|
import {
|
|
18
18
|
ToolNames
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-L7U2RI5O.js";
|
|
20
20
|
import {
|
|
21
21
|
DEFAULT_TOKEN_LIMIT
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-F6XNTYNE.js";
|
|
23
23
|
import {
|
|
24
24
|
init_esbuild_shims
|
|
25
25
|
} from "./chunk-A4BMJM77.js";
|
|
@@ -568,7 +568,8 @@ async function collectContextData(config, showDetails) {
|
|
|
568
568
|
const modelName = config.getModel() || "unknown";
|
|
569
569
|
const contentGeneratorConfig = config.getContentGeneratorConfig();
|
|
570
570
|
const contextWindowSize = contentGeneratorConfig.contextWindowSize ?? DEFAULT_TOKEN_LIMIT;
|
|
571
|
-
const
|
|
571
|
+
const geminiClient = config.getGeminiClient?.();
|
|
572
|
+
const apiTotalTokens = geminiClient?.isInitialized?.() ? geminiClient.getChat().getLastPromptTokenCount() : uiTelemetryService.getLastPromptTokenCount();
|
|
572
573
|
const apiCachedTokens = uiTelemetryService.getLastCachedContentTokenCount();
|
|
573
574
|
const systemPromptText = getCoreSystemPrompt(void 0, modelName);
|
|
574
575
|
const systemPromptTokens = estimateTokens(systemPromptText);
|