@qwen-code/qwen-code 0.19.0 → 0.19.1-nightly.20260624.a234860a4
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 +68 -48
- package/bundled/qc-helper/docs/configuration/model-providers.md +217 -195
- package/bundled/qc-helper/docs/configuration/settings.md +30 -14
- 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 +3 -15
- 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 +24 -8
- 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 +15 -3
- package/bundled/qc-helper/docs/support/tos-privacy.md +1 -1
- package/chunks/{agent-IPSDEZNB.js → agent-6KV474S5.js} +7 -7
- package/chunks/{agent-headless-ZMTUWMZJ.js → agent-headless-XO7MM6JT.js} +7 -7
- package/chunks/{anthropicContentGenerator-6MCH4X6S.js → anthropicContentGenerator-7352A7I5.js} +2 -2
- package/chunks/{artifact-tool-PBX64YTT.js → artifact-tool-5J4HUZAV.js} +1 -1
- package/chunks/{askUserQuestion-5ZQOWSRT.js → askUserQuestion-HF7HCWDD.js} +1 -1
- package/chunks/{chunk-PO5LVPK3.js → chunk-2QDQTWCI.js} +1 -1
- package/chunks/{chunk-255L5QYW.js → chunk-3BR4OIOE.js} +1 -1
- package/chunks/{chunk-KFR4QTV3.js → chunk-54J4JDWT.js} +123 -174
- package/chunks/{chunk-S7ILEIB4.js → chunk-76BDT2HH.js} +4 -5
- package/chunks/{chunk-YF3ORUIU.js → chunk-7QBKO4A6.js} +2348 -1817
- package/chunks/{chunk-GAAALA2X.js → chunk-C4JC2FL3.js} +7 -6
- package/chunks/{chunk-CICUTYTF.js → chunk-HNYTRFAM.js} +52 -45
- package/chunks/{chunk-JRVB4QUY.js → chunk-KBXLIVWQ.js} +1 -1
- package/chunks/{chunk-QKUAGMGE.js → chunk-NKJ6LRCR.js} +1 -1
- package/chunks/{chunk-57XRIZVC.js → chunk-NWLUISRA.js} +1 -1
- package/chunks/{chunk-VRIVIYRL.js → chunk-TKXRLRTF.js} +4 -4
- package/chunks/{computer-use-YYK42DD5.js → computer-use-WOKHYISX.js} +7 -7
- package/chunks/{contextCommand-BO45MUAA.js → contextCommand-JSYQAO3O.js} +9 -9
- package/chunks/{cron-create-DXKAP5KN.js → cron-create-A5637KCI.js} +9 -6
- package/chunks/{cron-delete-WGO4PZTF.js → cron-delete-AADOSEOZ.js} +1 -1
- package/chunks/{cron-list-EY7D3ZUC.js → cron-list-OFCPTT2Y.js} +1 -1
- package/chunks/{edit-QERNJN7K.js → edit-6EN6NO6G.js} +7 -7
- package/chunks/{en-UTXMGXIR.js → en-7OGNWWME.js} +1 -0
- package/chunks/{enter-worktree-6ZKH5IL3.js → enter-worktree-XJ4S74CL.js} +7 -7
- package/chunks/{enterPlanMode-B2PBF4MA.js → enterPlanMode-GQNQIH2V.js} +7 -7
- package/chunks/{exit-worktree-EOCMQO4I.js → exit-worktree-6MKLATVB.js} +7 -7
- package/chunks/{exitPlanMode-WSRXCBRZ.js → exitPlanMode-YACWA5GO.js} +7 -7
- package/chunks/{geminiContentGenerator-NTR4LTKS.js → geminiContentGenerator-OLJGOIWO.js} +1 -1
- package/chunks/{glob-IWDJQI2V.js → glob-YHSIN2LG.js} +7 -7
- package/chunks/{grep-2DV5BXMH.js → grep-5EMEAJBO.js} +7 -7
- package/chunks/{loop-wakeup-XVSDE7QR.js → loop-wakeup-DGSMT4N6.js} +2 -2
- package/chunks/{ls-LPY3ATQQ.js → ls-UGRZ4ZOM.js} +1 -1
- package/chunks/{lsp-ZT3AAXIF.js → lsp-72IJURW3.js} +1 -1
- package/chunks/{monitor-6HBDS2RS.js → monitor-ZGXTGINM.js} +7 -7
- package/chunks/{notebook-edit-J5AY5BRY.js → notebook-edit-O7WO3APR.js} +7 -7
- package/chunks/{openaiContentGenerator-ENABCJDM.js → openaiContentGenerator-N4FCEGU2.js} +6 -6
- package/chunks/{qwenContentGenerator-ISW42U7C.js → qwenContentGenerator-BOAZ7MMG.js} +9 -9
- package/chunks/{read-file-NRX2FSSQ.js → read-file-RB35MI5I.js} +3 -3
- package/chunks/{ripGrep-WF5CKHR5.js → ripGrep-CWJOA6JG.js} +7 -7
- package/chunks/{scheduler-PNPG5WJ3.js → scheduler-XUBHNI2Z.js} +7 -7
- package/chunks/{send-message-447W6NH6.js → send-message-URUZ7PLA.js} +1 -1
- package/chunks/{serve-ZBRCIIHW.js → serve-P356SCA2.js} +197 -31
- package/chunks/{shell-DLIL6MLU.js → shell-5TRHTPML.js} +7 -7
- package/chunks/{skill-32TXHY4A.js → skill-RW6N7GHL.js} +3 -3
- package/chunks/{src-PDDLF5BB.js → src-SPEHQKTK.js} +35 -9
- package/chunks/{syntheticOutput-GQRDRLGR.js → syntheticOutput-65FRJGWM.js} +2 -2
- package/chunks/{task-create-66DDSTVI.js → task-create-IH45HOFT.js} +2 -2
- package/chunks/{task-list-GOPXRSHG.js → task-list-FUB6JWSX.js} +1 -1
- package/chunks/{task-stop-M7NKGFX2.js → task-stop-P6IOHQM3.js} +1 -1
- package/chunks/{task-update-M5TBHLZV.js → task-update-RTUT7LJV.js} +2 -2
- package/chunks/{team-create-EHLDSJGI.js → team-create-D6GSPXCO.js} +7 -7
- package/chunks/{team-delete-DKKDS65W.js → team-delete-RXGYRMHC.js} +1 -1
- package/chunks/{todoWrite-4VX7X44D.js → todoWrite-O6JK24G6.js} +1 -1
- package/chunks/{tool-search-FU7IZAOO.js → tool-search-6YIMUUVD.js} +3 -3
- package/chunks/{web-fetch-YPP3V4FJ.js → web-fetch-KUMBROUI.js} +2 -2
- package/chunks/{workflow-WUDNBCGX.js → workflow-ML3XFTCN.js} +23 -15
- package/chunks/{write-file-NVFPX6CH.js → write-file-VLT6ODLK.js} +7 -7
- package/chunks/{zh-YOXVTJU5.js → zh-3RMSEO5M.js} +1 -0
- package/chunks/{zh-TW-J2TTW67R.js → zh-TW-R7WRLTJS.js} +1 -0
- package/cli.js +778 -382
- package/locales/en.js +1 -0
- package/locales/zh-TW.js +1 -0
- package/locales/zh.js +1 -0
- package/package.json +3 -3
- package/web-shell/assets/{arc-pxOt9B72.js → arc-DHUeMnnj.js} +1 -1
- package/web-shell/assets/{architectureDiagram-3BPJPVTR-B9XuYYOT.js → architectureDiagram-3BPJPVTR-DlX12yyj.js} +1 -1
- package/web-shell/assets/{blockDiagram-GPEHLZMM-5yK68iu4.js → blockDiagram-GPEHLZMM-DTFUXMUT.js} +1 -1
- package/web-shell/assets/{c4Diagram-AAUBKEIU-B1LY-qNI.js → c4Diagram-AAUBKEIU-CWdB54fk.js} +1 -1
- package/web-shell/assets/channel-C3WhMjjP.js +1 -0
- package/web-shell/assets/{chunk-2J33WTMH-DkgXg7cM.js → chunk-2J33WTMH-CF5C5jNR.js} +1 -1
- package/web-shell/assets/{chunk-4BX2VUAB-DdM45KFM.js → chunk-4BX2VUAB-Cw7Ydfji.js} +1 -1
- package/web-shell/assets/{chunk-55IACEB6-CmdsDjD4.js → chunk-55IACEB6-CnbI1ZCw.js} +1 -1
- package/web-shell/assets/{chunk-727SXJPM-CQ4pJ5GH.js → chunk-727SXJPM-DmSy00Pe.js} +1 -1
- package/web-shell/assets/{chunk-AQP2D5EJ-Dy6UWz37.js → chunk-AQP2D5EJ-DgNgXqBu.js} +1 -1
- package/web-shell/assets/{chunk-FMBD7UC4-CC8nFqap.js → chunk-FMBD7UC4-tz2IvOXv.js} +1 -1
- package/web-shell/assets/{chunk-ND2GUHAM-CkmS7lx7.js → chunk-ND2GUHAM-DaBLEBPa.js} +1 -1
- package/web-shell/assets/{chunk-QZHKN3VN-DynyqleZ.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-DA0fzCsY.js → cose-bilkent-S5V4N54A-CAKTcdCQ.js} +1 -1
- package/web-shell/assets/{dagre-BM42HDAG-DHYXRqCo.js → dagre-BM42HDAG-BdkBwlKg.js} +1 -1
- package/web-shell/assets/{diagram-2AECGRRQ-DWD6BcPs.js → diagram-2AECGRRQ-DYt3G65F.js} +1 -1
- package/web-shell/assets/{diagram-5GNKFQAL-CX9wnqVc.js → diagram-5GNKFQAL-BWvROWjY.js} +1 -1
- package/web-shell/assets/{diagram-KO2AKTUF-BpE8Kbt8.js → diagram-KO2AKTUF-BvvgwIaQ.js} +1 -1
- package/web-shell/assets/{diagram-LMA3HP47-DLPcrP0C.js → diagram-LMA3HP47-E7NLSNKg.js} +1 -1
- package/web-shell/assets/{diagram-OG6HWLK6-CSUCBsCe.js → diagram-OG6HWLK6-CYmUBgpE.js} +1 -1
- package/web-shell/assets/{erDiagram-TEJ5UH35-d3Z0uMXS.js → erDiagram-TEJ5UH35-BU5gY30h.js} +1 -1
- package/web-shell/assets/{flowDiagram-I6XJVG4X-C7vj5FX3.js → flowDiagram-I6XJVG4X-V_ZssSZ9.js} +1 -1
- package/web-shell/assets/{ganttDiagram-6RSMTGT7-BV9UvDV_.js → ganttDiagram-6RSMTGT7-QIShlsdI.js} +1 -1
- package/web-shell/assets/{gitGraphDiagram-PVQCEYII-CoWp0mW4.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-DUswfJHA.js → infoDiagram-5YYISTIA-BqjdrFeO.js} +1 -1
- package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-WidEKukx.js → ishikawaDiagram-YF4QCWOH-BP_a2YZ2.js} +1 -1
- package/web-shell/assets/{journeyDiagram-JHISSGLW-D7IRK3VN.js → journeyDiagram-JHISSGLW-BXg-S3Lk.js} +1 -1
- package/web-shell/assets/{kanban-definition-UN3LZRKU-CwFJ6Cja.js → kanban-definition-UN3LZRKU-BksAkdEJ.js} +1 -1
- package/web-shell/assets/{linear-BQ8GvDRY.js → linear-D2m9-ODE.js} +1 -1
- package/web-shell/assets/{mermaid.core-CwF8A_xO.js → mermaid.core-dTtkZp2F.js} +5 -5
- package/web-shell/assets/{mindmap-definition-RKZ34NQL-TR1s0iZi.js → mindmap-definition-RKZ34NQL-Bft9my8O.js} +1 -1
- package/web-shell/assets/{pieDiagram-4H26LBE5-Cd91pMl9.js → pieDiagram-4H26LBE5-Cw8S-alZ.js} +1 -1
- package/web-shell/assets/{quadrantDiagram-W4KKPZXB-BGxGDNMl.js → quadrantDiagram-W4KKPZXB-DaDoTMts.js} +1 -1
- package/web-shell/assets/{requirementDiagram-4Y6WPE33-Cq3fWmYz.js → requirementDiagram-4Y6WPE33-Cp5kSpwj.js} +1 -1
- package/web-shell/assets/{sankeyDiagram-5OEKKPKP-ChLyGdq0.js → sankeyDiagram-5OEKKPKP-CW8RsJJZ.js} +1 -1
- package/web-shell/assets/{sequenceDiagram-3UESZ5HK-tazy79aB.js → sequenceDiagram-3UESZ5HK-DTfpIiJK.js} +1 -1
- package/web-shell/assets/{stateDiagram-AJRCARHV-dIYLUNSf.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-BuENhrC2.js → timeline-definition-PNZ67QCA-DYsbXn5l.js} +1 -1
- package/web-shell/assets/{vennDiagram-CIIHVFJN-DLtum9dF.js → vennDiagram-CIIHVFJN-HUpRpuUp.js} +1 -1
- package/web-shell/assets/{wardley-L42UT6IY-Bf7OSF3y.js → wardley-L42UT6IY-cT3nQH_T.js} +1 -1
- package/web-shell/assets/{wardleyDiagram-YWT4CUSO-slMw3OB3.js → wardleyDiagram-YWT4CUSO-Dmm7J6Qc.js} +1 -1
- package/web-shell/assets/{xychartDiagram-2RQKCTM6-CdxOm8oC.js → xychartDiagram-2RQKCTM6-CX0L5p9C.js} +1 -1
- package/web-shell/index.html +3 -3
- package/web-shell/assets/channel-Cx7egbSX.js +0 -1
- package/web-shell/assets/classDiagram-4FO5ZUOK-CwH_F8cH.js +0 -1
- package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CwH_F8cH.js +0 -1
- package/web-shell/assets/index-BDZiTAkl.css +0 -1
- package/web-shell/assets/index-CjTH6cLP.js +0 -516
- package/web-shell/assets/stateDiagram-v2-BHNVJYJU-luL7KTiX.js +0 -1
- package/chunks/{chunk-JDV3VBPY.js → chunk-F6XNTYNE.js} +202 -202
- package/chunks/{chunk-PLY4F7QW.js → chunk-L7U2RI5O.js} +54 -54
package/cli.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
formatContextUsageText,
|
|
8
8
|
isTerminalGoalStatusKind,
|
|
9
9
|
require_react
|
|
10
|
-
} from "./chunks/chunk-
|
|
10
|
+
} from "./chunks/chunk-C4JC2FL3.js";
|
|
11
11
|
import {
|
|
12
12
|
noteInteraction
|
|
13
13
|
} from "./chunks/chunk-MRO43B25.js";
|
|
@@ -104,12 +104,10 @@ import {
|
|
|
104
104
|
setPendingSettingValue,
|
|
105
105
|
setPendingSettingValueAny,
|
|
106
106
|
settingExistsInScope,
|
|
107
|
-
subtleBandColor,
|
|
108
|
-
supportsTrueColor,
|
|
109
107
|
updateOutputLanguageFile,
|
|
110
108
|
validateCustomTheme,
|
|
111
109
|
writeOutputLanguageAndRegisterPath
|
|
112
|
-
} from "./chunks/chunk-
|
|
110
|
+
} from "./chunks/chunk-54J4JDWT.js";
|
|
113
111
|
import {
|
|
114
112
|
SUPPORTED_LANGUAGES,
|
|
115
113
|
clearScreen,
|
|
@@ -125,7 +123,7 @@ import {
|
|
|
125
123
|
ta,
|
|
126
124
|
writeStderrLine,
|
|
127
125
|
writeStdoutLine
|
|
128
|
-
} from "./chunks/chunk-
|
|
126
|
+
} from "./chunks/chunk-TKXRLRTF.js";
|
|
129
127
|
import {
|
|
130
128
|
AgentSideConnection,
|
|
131
129
|
PROTOCOL_VERSION,
|
|
@@ -272,6 +270,7 @@ import {
|
|
|
272
270
|
getTimeRangeBounds,
|
|
273
271
|
getWelcomeBackState,
|
|
274
272
|
glob,
|
|
273
|
+
hasImageParts,
|
|
275
274
|
hashMcpServerConfig,
|
|
276
275
|
hookEventSupportsMatcher,
|
|
277
276
|
ideContextStore,
|
|
@@ -331,6 +330,7 @@ import {
|
|
|
331
330
|
resolveOwnsModel,
|
|
332
331
|
restoreWorktreeContext,
|
|
333
332
|
runForkedAgent,
|
|
333
|
+
runVisionBridge,
|
|
334
334
|
saveWelcomeBackRestartChoice,
|
|
335
335
|
saveWorkflowScript,
|
|
336
336
|
sessionIdContext,
|
|
@@ -342,7 +342,9 @@ import {
|
|
|
342
342
|
shouldFirePermissionDeniedForAutoMode,
|
|
343
343
|
shouldForceAutoModeReviewForAllow,
|
|
344
344
|
shouldRunAutoModeForCall,
|
|
345
|
+
shouldRunVisionBridge,
|
|
345
346
|
shouldShowStep,
|
|
347
|
+
splitImageParts,
|
|
346
348
|
startSpeculation,
|
|
347
349
|
stripAnsi,
|
|
348
350
|
stripStartupContext,
|
|
@@ -358,7 +360,7 @@ import {
|
|
|
358
360
|
writeRuntimeStatus,
|
|
359
361
|
writeWorktreeSession,
|
|
360
362
|
writeWorktreeSessionMarker
|
|
361
|
-
} from "./chunks/chunk-
|
|
363
|
+
} from "./chunks/chunk-7QBKO4A6.js";
|
|
362
364
|
import {
|
|
363
365
|
external_exports
|
|
364
366
|
} from "./chunks/chunk-K5PGHDBN.js";
|
|
@@ -369,8 +371,8 @@ import {
|
|
|
369
371
|
} from "./chunks/chunk-2BIF2NVV.js";
|
|
370
372
|
import {
|
|
371
373
|
runSideQuery
|
|
372
|
-
} from "./chunks/chunk-
|
|
373
|
-
import "./chunks/chunk-
|
|
374
|
+
} from "./chunks/chunk-NWLUISRA.js";
|
|
375
|
+
import "./chunks/chunk-3BR4OIOE.js";
|
|
374
376
|
import "./chunks/chunk-2MPVVENX.js";
|
|
375
377
|
import "./chunks/chunk-ZTQ26VBE.js";
|
|
376
378
|
import "./chunks/chunk-GZCJS5WH.js";
|
|
@@ -445,7 +447,7 @@ import {
|
|
|
445
447
|
startToolSpan,
|
|
446
448
|
uiTelemetryService,
|
|
447
449
|
withInteractionSpan
|
|
448
|
-
} from "./chunks/chunk-
|
|
450
|
+
} from "./chunks/chunk-HNYTRFAM.js";
|
|
449
451
|
import "./chunks/chunk-3PJXIDKI.js";
|
|
450
452
|
import "./chunks/chunk-UWCTAVOD.js";
|
|
451
453
|
import {
|
|
@@ -460,13 +462,13 @@ import {
|
|
|
460
462
|
isAnyAutoMemPath
|
|
461
463
|
} from "./chunks/chunk-BNXANYLH.js";
|
|
462
464
|
import "./chunks/chunk-T2VDEFUU.js";
|
|
463
|
-
import "./chunks/chunk-
|
|
465
|
+
import "./chunks/chunk-2QDQTWCI.js";
|
|
464
466
|
import {
|
|
465
467
|
SchemaValidator,
|
|
466
468
|
ToolConfirmationOutcome,
|
|
467
469
|
ToolDisplayNames,
|
|
468
470
|
ToolNames
|
|
469
|
-
} from "./chunks/chunk-
|
|
471
|
+
} from "./chunks/chunk-L7U2RI5O.js";
|
|
470
472
|
import {
|
|
471
473
|
clearCachedCredentialFile,
|
|
472
474
|
qwenOAuth2Events
|
|
@@ -489,7 +491,7 @@ import {
|
|
|
489
491
|
isSupportedImageMimeType,
|
|
490
492
|
redactProxyCredentials,
|
|
491
493
|
tokenLimit
|
|
492
|
-
} from "./chunks/chunk-
|
|
494
|
+
} from "./chunks/chunk-F6XNTYNE.js";
|
|
493
495
|
import "./chunks/chunk-CGEGHF2C.js";
|
|
494
496
|
import "./chunks/chunk-EJYJYJZ2.js";
|
|
495
497
|
import {
|
|
@@ -11474,14 +11476,14 @@ var require_templates = __commonJS({
|
|
|
11474
11476
|
return results;
|
|
11475
11477
|
}
|
|
11476
11478
|
__name(parseStyle, "parseStyle");
|
|
11477
|
-
function buildStyle(
|
|
11479
|
+
function buildStyle(chalk6, styles10) {
|
|
11478
11480
|
const enabled2 = {};
|
|
11479
11481
|
for (const layer of styles10) {
|
|
11480
11482
|
for (const style of layer.styles) {
|
|
11481
11483
|
enabled2[style[0]] = layer.inverse ? null : style.slice(1);
|
|
11482
11484
|
}
|
|
11483
11485
|
}
|
|
11484
|
-
let current =
|
|
11486
|
+
let current = chalk6;
|
|
11485
11487
|
for (const [styleName, styles11] of Object.entries(enabled2)) {
|
|
11486
11488
|
if (!Array.isArray(styles11)) {
|
|
11487
11489
|
continue;
|
|
@@ -11494,7 +11496,7 @@ var require_templates = __commonJS({
|
|
|
11494
11496
|
return current;
|
|
11495
11497
|
}
|
|
11496
11498
|
__name(buildStyle, "buildStyle");
|
|
11497
|
-
module.exports = (
|
|
11499
|
+
module.exports = (chalk6, temporary) => {
|
|
11498
11500
|
const styles10 = [];
|
|
11499
11501
|
const chunks = [];
|
|
11500
11502
|
let chunk = [];
|
|
@@ -11504,13 +11506,13 @@ var require_templates = __commonJS({
|
|
|
11504
11506
|
} else if (style) {
|
|
11505
11507
|
const string = chunk.join("");
|
|
11506
11508
|
chunk = [];
|
|
11507
|
-
chunks.push(styles10.length === 0 ? string : buildStyle(
|
|
11509
|
+
chunks.push(styles10.length === 0 ? string : buildStyle(chalk6, styles10)(string));
|
|
11508
11510
|
styles10.push({ inverse, styles: parseStyle(style) });
|
|
11509
11511
|
} else if (close) {
|
|
11510
11512
|
if (styles10.length === 0) {
|
|
11511
11513
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
11512
11514
|
}
|
|
11513
|
-
chunks.push(buildStyle(
|
|
11515
|
+
chunks.push(buildStyle(chalk6, styles10)(chunk.join("")));
|
|
11514
11516
|
chunk = [];
|
|
11515
11517
|
styles10.pop();
|
|
11516
11518
|
} else {
|
|
@@ -11562,16 +11564,16 @@ var require_source = __commonJS({
|
|
|
11562
11564
|
}
|
|
11563
11565
|
};
|
|
11564
11566
|
var chalkFactory3 = /* @__PURE__ */ __name((options) => {
|
|
11565
|
-
const
|
|
11566
|
-
applyOptions3(
|
|
11567
|
-
|
|
11568
|
-
Object.setPrototypeOf(
|
|
11569
|
-
Object.setPrototypeOf(
|
|
11570
|
-
|
|
11567
|
+
const chalk7 = {};
|
|
11568
|
+
applyOptions3(chalk7, options);
|
|
11569
|
+
chalk7.template = (...arguments_) => chalkTag(chalk7.template, ...arguments_);
|
|
11570
|
+
Object.setPrototypeOf(chalk7, Chalk.prototype);
|
|
11571
|
+
Object.setPrototypeOf(chalk7.template, chalk7);
|
|
11572
|
+
chalk7.template.constructor = () => {
|
|
11571
11573
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
11572
11574
|
};
|
|
11573
|
-
|
|
11574
|
-
return
|
|
11575
|
+
chalk7.template.Instance = ChalkClass;
|
|
11576
|
+
return chalk7.template;
|
|
11575
11577
|
}, "chalkFactory");
|
|
11576
11578
|
function Chalk(options) {
|
|
11577
11579
|
return chalkFactory3(options);
|
|
@@ -11683,7 +11685,7 @@ var require_source = __commonJS({
|
|
|
11683
11685
|
return openAll + string + closeAll;
|
|
11684
11686
|
}, "applyStyle");
|
|
11685
11687
|
var template;
|
|
11686
|
-
var chalkTag = /* @__PURE__ */ __name((
|
|
11688
|
+
var chalkTag = /* @__PURE__ */ __name((chalk7, ...strings) => {
|
|
11687
11689
|
const [firstString] = strings;
|
|
11688
11690
|
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
11689
11691
|
return strings.join(" ");
|
|
@@ -11699,14 +11701,14 @@ var require_source = __commonJS({
|
|
|
11699
11701
|
if (template === void 0) {
|
|
11700
11702
|
template = require_templates();
|
|
11701
11703
|
}
|
|
11702
|
-
return template(
|
|
11704
|
+
return template(chalk7, parts.join(""));
|
|
11703
11705
|
}, "chalkTag");
|
|
11704
11706
|
Object.defineProperties(Chalk.prototype, styles10);
|
|
11705
|
-
var
|
|
11706
|
-
|
|
11707
|
-
|
|
11708
|
-
|
|
11709
|
-
module.exports =
|
|
11707
|
+
var chalk6 = Chalk();
|
|
11708
|
+
chalk6.supportsColor = stdoutColor3;
|
|
11709
|
+
chalk6.stderr = Chalk({ level: stderrColor3 ? stderrColor3.level : 0 });
|
|
11710
|
+
chalk6.stderr.supportsColor = stderrColor3;
|
|
11711
|
+
module.exports = chalk6;
|
|
11710
11712
|
}
|
|
11711
11713
|
});
|
|
11712
11714
|
|
|
@@ -32908,7 +32910,7 @@ var require_tinycolor = __commonJS({
|
|
|
32908
32910
|
var h = Math.round(hsl.h * 360), s = Math.round(hsl.s * 100), l = Math.round(hsl.l * 100);
|
|
32909
32911
|
return this._a == 1 ? "hsl(" + h + ", " + s + "%, " + l + "%)" : "hsla(" + h + ", " + s + "%, " + l + "%, " + this._roundA + ")";
|
|
32910
32912
|
}, "toHslString"),
|
|
32911
|
-
toHex: /* @__PURE__ */ __name(function
|
|
32913
|
+
toHex: /* @__PURE__ */ __name(function toHex2(allow3Char) {
|
|
32912
32914
|
return rgbToHex(this._r, this._g, this._b, allow3Char);
|
|
32913
32915
|
}, "toHex"),
|
|
32914
32916
|
toHexString: /* @__PURE__ */ __name(function toHexString(allow3Char) {
|
|
@@ -34128,7 +34130,7 @@ var require_gradient_string = __commonJS({
|
|
|
34128
34130
|
"node_modules/gradient-string/index.js"(exports, module) {
|
|
34129
34131
|
"use strict";
|
|
34130
34132
|
init_esbuild_shims();
|
|
34131
|
-
var
|
|
34133
|
+
var chalk6 = require_source();
|
|
34132
34134
|
var tinygradient = require_tinygradient();
|
|
34133
34135
|
var forbiddenChars = /\s/g;
|
|
34134
34136
|
function InitGradient(...args) {
|
|
@@ -34145,7 +34147,7 @@ var require_gradient_string = __commonJS({
|
|
|
34145
34147
|
const colors = getColors(gradient, options, colorsCount);
|
|
34146
34148
|
let result = "";
|
|
34147
34149
|
for (const s of str) {
|
|
34148
|
-
result += s.match(forbiddenChars) ? s :
|
|
34150
|
+
result += s.match(forbiddenChars) ? s : chalk6.hex(colors.shift().toHex())(s);
|
|
34149
34151
|
}
|
|
34150
34152
|
return result;
|
|
34151
34153
|
}
|
|
@@ -34160,7 +34162,7 @@ var require_gradient_string = __commonJS({
|
|
|
34160
34162
|
const lineColors = colors.slice(0);
|
|
34161
34163
|
let lineResult = "";
|
|
34162
34164
|
for (const l of line) {
|
|
34163
|
-
lineResult +=
|
|
34165
|
+
lineResult += chalk6.hex(lineColors.shift().toHex())(l);
|
|
34164
34166
|
}
|
|
34165
34167
|
results.push(lineResult);
|
|
34166
34168
|
}
|
|
@@ -45297,10 +45299,10 @@ var applyOptions = /* @__PURE__ */ __name((object, options = {}) => {
|
|
|
45297
45299
|
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
45298
45300
|
}, "applyOptions");
|
|
45299
45301
|
var chalkFactory = /* @__PURE__ */ __name((options) => {
|
|
45300
|
-
const
|
|
45301
|
-
applyOptions(
|
|
45302
|
-
Object.setPrototypeOf(
|
|
45303
|
-
return
|
|
45302
|
+
const chalk6 = /* @__PURE__ */ __name((...strings) => strings.join(" "), "chalk");
|
|
45303
|
+
applyOptions(chalk6, options);
|
|
45304
|
+
Object.setPrototypeOf(chalk6, createChalk.prototype);
|
|
45305
|
+
return chalk6;
|
|
45304
45306
|
}, "chalkFactory");
|
|
45305
45307
|
function createChalk(options) {
|
|
45306
45308
|
return chalkFactory(options);
|
|
@@ -48770,6 +48772,21 @@ var use_is_screen_reader_enabled_default = useIsScreenReaderEnabled;
|
|
|
48770
48772
|
// node_modules/ink/build/hooks/use-cursor.js
|
|
48771
48773
|
init_esbuild_shims();
|
|
48772
48774
|
var import_react30 = __toESM(require_react(), 1);
|
|
48775
|
+
var useCursor = /* @__PURE__ */ __name(() => {
|
|
48776
|
+
const context = (0, import_react30.useContext)(CursorContext_default);
|
|
48777
|
+
const positionRef = (0, import_react30.useRef)(void 0);
|
|
48778
|
+
const setCursorPosition = (0, import_react30.useCallback)((position) => {
|
|
48779
|
+
positionRef.current = position;
|
|
48780
|
+
}, []);
|
|
48781
|
+
(0, import_react30.useInsertionEffect)(() => {
|
|
48782
|
+
context.setCursorPosition(positionRef.current);
|
|
48783
|
+
return () => {
|
|
48784
|
+
context.setCursorPosition(void 0);
|
|
48785
|
+
};
|
|
48786
|
+
});
|
|
48787
|
+
return { setCursorPosition };
|
|
48788
|
+
}, "useCursor");
|
|
48789
|
+
var use_cursor_default = useCursor;
|
|
48773
48790
|
|
|
48774
48791
|
// node_modules/ink/build/hooks/use-animation.js
|
|
48775
48792
|
init_esbuild_shims();
|
|
@@ -48848,18 +48865,17 @@ import v83 from "node:v8";
|
|
|
48848
48865
|
// packages/cli/src/config/auth.ts
|
|
48849
48866
|
init_esbuild_shims();
|
|
48850
48867
|
var DEFAULT_ENV_KEYS = {
|
|
48851
|
-
[
|
|
48852
|
-
[
|
|
48853
|
-
[
|
|
48854
|
-
[
|
|
48868
|
+
["openai" /* USE_OPENAI */]: "OPENAI_API_KEY",
|
|
48869
|
+
["anthropic" /* USE_ANTHROPIC */]: "ANTHROPIC_API_KEY",
|
|
48870
|
+
["gemini" /* USE_GEMINI */]: "GEMINI_API_KEY",
|
|
48871
|
+
["vertex-ai" /* USE_VERTEX_AI */]: "GOOGLE_API_KEY"
|
|
48855
48872
|
};
|
|
48856
48873
|
function findModelConfig(modelProviders, authType, modelId, baseUrl) {
|
|
48857
48874
|
if (!modelProviders || !modelId) {
|
|
48858
48875
|
return void 0;
|
|
48859
48876
|
}
|
|
48860
|
-
const
|
|
48861
|
-
|
|
48862
|
-
if (!models) {
|
|
48877
|
+
const models = modelProviders[authType];
|
|
48878
|
+
if (!Array.isArray(models)) {
|
|
48863
48879
|
return void 0;
|
|
48864
48880
|
}
|
|
48865
48881
|
if (baseUrl) {
|
|
@@ -48965,7 +48981,7 @@ __name(getApiKeyError, "getApiKeyError");
|
|
|
48965
48981
|
function validateAuthMethod(authMethod, config) {
|
|
48966
48982
|
const settings = loadSettings(process.cwd(), false);
|
|
48967
48983
|
loadEnvironment(settings.merged);
|
|
48968
|
-
if (authMethod ===
|
|
48984
|
+
if (authMethod === "openai" /* USE_OPENAI */) {
|
|
48969
48985
|
const { hasKey, checkedEnvKey, isExplicitEnvKey } = hasApiKeyForAuth(
|
|
48970
48986
|
authMethod,
|
|
48971
48987
|
settings.merged,
|
|
@@ -48986,12 +49002,12 @@ function validateAuthMethod(authMethod, config) {
|
|
|
48986
49002
|
}
|
|
48987
49003
|
return null;
|
|
48988
49004
|
}
|
|
48989
|
-
if (authMethod ===
|
|
49005
|
+
if (authMethod === "qwen-oauth" /* QWEN_OAUTH */) {
|
|
48990
49006
|
return t(
|
|
48991
49007
|
"Qwen OAuth free tier was discontinued on 2026-04-15. Run /auth to switch to Coding Plan, OpenRouter, Fireworks AI, or another provider."
|
|
48992
49008
|
);
|
|
48993
49009
|
}
|
|
48994
|
-
if (authMethod ===
|
|
49010
|
+
if (authMethod === "anthropic" /* USE_ANTHROPIC */) {
|
|
48995
49011
|
const apiKeyError = getApiKeyError(authMethod, settings.merged, config);
|
|
48996
49012
|
if (apiKeyError) {
|
|
48997
49013
|
return apiKeyError;
|
|
@@ -49014,14 +49030,14 @@ function validateAuthMethod(authMethod, config) {
|
|
|
49014
49030
|
}
|
|
49015
49031
|
return null;
|
|
49016
49032
|
}
|
|
49017
|
-
if (authMethod ===
|
|
49033
|
+
if (authMethod === "gemini" /* USE_GEMINI */) {
|
|
49018
49034
|
const apiKeyError = getApiKeyError(authMethod, settings.merged, config);
|
|
49019
49035
|
if (apiKeyError) {
|
|
49020
49036
|
return apiKeyError;
|
|
49021
49037
|
}
|
|
49022
49038
|
return null;
|
|
49023
49039
|
}
|
|
49024
|
-
if (authMethod ===
|
|
49040
|
+
if (authMethod === "vertex-ai" /* USE_VERTEX_AI */) {
|
|
49025
49041
|
const apiKeyError = getApiKeyError(authMethod, settings.merged, config);
|
|
49026
49042
|
if (apiKeyError) {
|
|
49027
49043
|
return apiKeyError;
|
|
@@ -49277,7 +49293,9 @@ function extensionConsentString(extensionConfig, commands = [], skills = [], sub
|
|
|
49277
49293
|
}
|
|
49278
49294
|
const mcpServerEntries = Object.entries(extensionConfig.mcpServers || {});
|
|
49279
49295
|
const displayLabel = extensionConfig.displayName ?? extensionConfig.name;
|
|
49280
|
-
output.push(
|
|
49296
|
+
output.push(
|
|
49297
|
+
t('Installing extension "{{name}}".', { name: displayLabel })
|
|
49298
|
+
);
|
|
49281
49299
|
if (typeof extensionConfig.description === "string" && extensionConfig.description) {
|
|
49282
49300
|
output.push(stripAnsi(extensionConfig.description));
|
|
49283
49301
|
}
|
|
@@ -49584,6 +49602,30 @@ async function getExtensionManager() {
|
|
|
49584
49602
|
return extensionManager;
|
|
49585
49603
|
}
|
|
49586
49604
|
__name(getExtensionManager, "getExtensionManager");
|
|
49605
|
+
var EXTENSION_COMMAND_SCOPES = ["User" /* User */, "Workspace" /* Workspace */];
|
|
49606
|
+
function extensionCommandScopesList() {
|
|
49607
|
+
return EXTENSION_COMMAND_SCOPES.map((s) => s.toLowerCase()).join(", ");
|
|
49608
|
+
}
|
|
49609
|
+
__name(extensionCommandScopesList, "extensionCommandScopesList");
|
|
49610
|
+
function resolveExtensionCommandScope(scope) {
|
|
49611
|
+
if (!scope) {
|
|
49612
|
+
return "User" /* User */;
|
|
49613
|
+
}
|
|
49614
|
+
const normalized = scope.toLowerCase();
|
|
49615
|
+
const matched = EXTENSION_COMMAND_SCOPES.find(
|
|
49616
|
+
(candidate) => candidate.toLowerCase() === normalized
|
|
49617
|
+
);
|
|
49618
|
+
if (matched) {
|
|
49619
|
+
return matched;
|
|
49620
|
+
}
|
|
49621
|
+
throw new Error(
|
|
49622
|
+
t("Invalid scope: {{scope}}. Please use one of {{scopes}}.", {
|
|
49623
|
+
scope,
|
|
49624
|
+
scopes: extensionCommandScopesList()
|
|
49625
|
+
})
|
|
49626
|
+
);
|
|
49627
|
+
}
|
|
49628
|
+
__name(resolveExtensionCommandScope, "resolveExtensionCommandScope");
|
|
49587
49629
|
function extensionToOutputString(extension, extensionManager, workspaceDir, inline = false) {
|
|
49588
49630
|
const cwd5 = workspaceDir;
|
|
49589
49631
|
const userEnabled = extensionManager.isEnabled(
|
|
@@ -54922,11 +54964,8 @@ var yargs_default = Yargs;
|
|
|
54922
54964
|
async function handleDisable(args) {
|
|
54923
54965
|
const extensionManager = await getExtensionManager();
|
|
54924
54966
|
try {
|
|
54925
|
-
|
|
54926
|
-
|
|
54927
|
-
} else {
|
|
54928
|
-
extensionManager.disableExtension(args.name, "User" /* User */);
|
|
54929
|
-
}
|
|
54967
|
+
const scope = resolveExtensionCommandScope(args.scope);
|
|
54968
|
+
await extensionManager.disableExtension(args.name, scope);
|
|
54930
54969
|
writeStdoutLine(
|
|
54931
54970
|
t('Extension "{{name}}" successfully disabled for scope "{{scope}}".', {
|
|
54932
54971
|
name: args.name,
|
|
@@ -54950,14 +54989,7 @@ var disableCommand = {
|
|
|
54950
54989
|
type: "string",
|
|
54951
54990
|
default: "User" /* User */
|
|
54952
54991
|
}).check((argv) => {
|
|
54953
|
-
|
|
54954
|
-
throw new Error(
|
|
54955
|
-
t("Invalid scope: {{scope}}. Please use one of {{scopes}}.", {
|
|
54956
|
-
scope: argv.scope,
|
|
54957
|
-
scopes: Object.values(SettingScope).map((s) => s.toLowerCase()).join(", ")
|
|
54958
|
-
})
|
|
54959
|
-
);
|
|
54960
|
-
}
|
|
54992
|
+
resolveExtensionCommandScope(argv.scope);
|
|
54961
54993
|
return true;
|
|
54962
54994
|
}), "builder"),
|
|
54963
54995
|
handler: /* @__PURE__ */ __name(async (argv) => {
|
|
@@ -54973,11 +55005,8 @@ init_esbuild_shims();
|
|
|
54973
55005
|
async function handleEnable(args) {
|
|
54974
55006
|
const extensionManager = await getExtensionManager();
|
|
54975
55007
|
try {
|
|
54976
|
-
|
|
54977
|
-
|
|
54978
|
-
} else {
|
|
54979
|
-
extensionManager.enableExtension(args.name, "User" /* User */);
|
|
54980
|
-
}
|
|
55008
|
+
const scope = resolveExtensionCommandScope(args.scope);
|
|
55009
|
+
await extensionManager.enableExtension(args.name, scope);
|
|
54981
55010
|
if (args.scope) {
|
|
54982
55011
|
writeStdoutLine(
|
|
54983
55012
|
t('Extension "{{name}}" successfully enabled for scope "{{scope}}".', {
|
|
@@ -55009,14 +55038,7 @@ var enableCommand = {
|
|
|
55009
55038
|
),
|
|
55010
55039
|
type: "string"
|
|
55011
55040
|
}).check((argv) => {
|
|
55012
|
-
|
|
55013
|
-
throw new Error(
|
|
55014
|
-
t("Invalid scope: {{scope}}. Please use one of {{scopes}}.", {
|
|
55015
|
-
scope: argv.scope,
|
|
55016
|
-
scopes: Object.values(SettingScope).map((s) => s.toLowerCase()).join(", ")
|
|
55017
|
-
})
|
|
55018
|
-
);
|
|
55019
|
-
}
|
|
55041
|
+
resolveExtensionCommandScope(argv.scope);
|
|
55020
55042
|
return true;
|
|
55021
55043
|
}), "builder"),
|
|
55022
55044
|
handler: /* @__PURE__ */ __name(async (argv) => {
|
|
@@ -56536,6 +56558,19 @@ function findCliEntryPath() {
|
|
|
56536
56558
|
throw new Error("Cannot determine CLI entry path");
|
|
56537
56559
|
}
|
|
56538
56560
|
__name(findCliEntryPath, "findCliEntryPath");
|
|
56561
|
+
function resolveOptionalStringField(channelName, rawConfig, field) {
|
|
56562
|
+
const value = rawConfig[field];
|
|
56563
|
+
if (value === void 0 || value === null || value === "") {
|
|
56564
|
+
return void 0;
|
|
56565
|
+
}
|
|
56566
|
+
if (typeof value !== "string") {
|
|
56567
|
+
throw new Error(
|
|
56568
|
+
`Channel "${channelName}" field "${field}" must be a string.`
|
|
56569
|
+
);
|
|
56570
|
+
}
|
|
56571
|
+
return resolveEnvVars(value);
|
|
56572
|
+
}
|
|
56573
|
+
__name(resolveOptionalStringField, "resolveOptionalStringField");
|
|
56539
56574
|
async function parseChannelConfig(name, rawConfig) {
|
|
56540
56575
|
if (!rawConfig["type"]) {
|
|
56541
56576
|
throw new Error(`Channel "${name}" is missing required field "type".`);
|
|
@@ -56549,15 +56584,20 @@ async function parseChannelConfig(name, rawConfig) {
|
|
|
56549
56584
|
);
|
|
56550
56585
|
}
|
|
56551
56586
|
for (const field of plugin.requiredConfigFields ?? []) {
|
|
56552
|
-
|
|
56587
|
+
const value = rawConfig[field];
|
|
56588
|
+
if (value === void 0 || value === null || value === "") {
|
|
56553
56589
|
throw new Error(
|
|
56554
56590
|
`Channel "${name}" (${channelType}) requires "${field}".`
|
|
56555
56591
|
);
|
|
56556
56592
|
}
|
|
56557
56593
|
}
|
|
56558
|
-
const token = rawConfig
|
|
56559
|
-
const clientId = rawConfig
|
|
56560
|
-
const clientSecret =
|
|
56594
|
+
const token = resolveOptionalStringField(name, rawConfig, "token") ?? "";
|
|
56595
|
+
const clientId = resolveOptionalStringField(name, rawConfig, "clientId");
|
|
56596
|
+
const clientSecret = resolveOptionalStringField(
|
|
56597
|
+
name,
|
|
56598
|
+
rawConfig,
|
|
56599
|
+
"clientSecret"
|
|
56600
|
+
);
|
|
56561
56601
|
return {
|
|
56562
56602
|
...rawConfig,
|
|
56563
56603
|
type: channelType,
|
|
@@ -58798,6 +58838,10 @@ var serveCommand = {
|
|
|
58798
58838
|
type: "boolean",
|
|
58799
58839
|
default: false,
|
|
58800
58840
|
description: "Enable direct POST /session/:id/shell execution. Requires a bearer token and a session-bound client id on each call."
|
|
58841
|
+
}).option("experimental-lsp", {
|
|
58842
|
+
type: "boolean",
|
|
58843
|
+
default: false,
|
|
58844
|
+
description: "Forward the experimental LSP opt-in to spawned agent sessions."
|
|
58801
58845
|
}).option("web", {
|
|
58802
58846
|
type: "boolean",
|
|
58803
58847
|
default: true,
|
|
@@ -58951,7 +58995,7 @@ var serveCommand = {
|
|
|
58951
58995
|
process.exit(1);
|
|
58952
58996
|
}
|
|
58953
58997
|
}
|
|
58954
|
-
const { runQwenServe } = await import("./chunks/serve-
|
|
58998
|
+
const { runQwenServe } = await import("./chunks/serve-P356SCA2.js");
|
|
58955
58999
|
try {
|
|
58956
59000
|
const handle = await runQwenServe({
|
|
58957
59001
|
port: argv.port,
|
|
@@ -58982,7 +59026,8 @@ var serveCommand = {
|
|
|
58982
59026
|
...rateLimitPrompt !== void 0 ? { rateLimitPrompt } : {},
|
|
58983
59027
|
...rateLimitMutation !== void 0 ? { rateLimitMutation } : {},
|
|
58984
59028
|
...rateLimitRead !== void 0 ? { rateLimitRead } : {},
|
|
58985
|
-
...rateLimitWindowMs !== void 0 ? { rateLimitWindowMs } : {}
|
|
59029
|
+
...rateLimitWindowMs !== void 0 ? { rateLimitWindowMs } : {},
|
|
59030
|
+
...argv.experimentalLsp === true ? { experimentalLsp: true } : {}
|
|
58986
59031
|
});
|
|
58987
59032
|
await maybeOpenWebShellBrowser(handle, argv.open);
|
|
58988
59033
|
} catch (err) {
|
|
@@ -60057,11 +60102,11 @@ async function parseArguments() {
|
|
|
60057
60102
|
}).option("auth-type", {
|
|
60058
60103
|
type: "string",
|
|
60059
60104
|
choices: [
|
|
60060
|
-
|
|
60061
|
-
|
|
60062
|
-
|
|
60063
|
-
|
|
60064
|
-
|
|
60105
|
+
"openai" /* USE_OPENAI */,
|
|
60106
|
+
"anthropic" /* USE_ANTHROPIC */,
|
|
60107
|
+
"qwen-oauth" /* QWEN_OAUTH */,
|
|
60108
|
+
"gemini" /* USE_GEMINI */,
|
|
60109
|
+
"vertex-ai" /* USE_VERTEX_AI */
|
|
60065
60110
|
],
|
|
60066
60111
|
description: "Authentication type"
|
|
60067
60112
|
}).deprecateOption(
|
|
@@ -63570,6 +63615,13 @@ var ThemeManager = class {
|
|
|
63570
63615
|
* when the app first rendered.
|
|
63571
63616
|
*/
|
|
63572
63617
|
cachedAutoDetection;
|
|
63618
|
+
/**
|
|
63619
|
+
* Memoised synchronous detection of the terminal's background brightness,
|
|
63620
|
+
* used when no async OSC 11 result is available (e.g. an explicitly
|
|
63621
|
+
* configured theme, for which the startup probe never runs). Detected at
|
|
63622
|
+
* most once per process.
|
|
63623
|
+
*/
|
|
63624
|
+
terminalBackground;
|
|
63573
63625
|
/**
|
|
63574
63626
|
* Detects the terminal's dark/light preference (synchronous) and returns
|
|
63575
63627
|
* the corresponding Qwen theme.
|
|
@@ -63593,6 +63645,21 @@ var ThemeManager = class {
|
|
|
63593
63645
|
this.activeTheme = detected === "light" ? QwenLight : QwenDark;
|
|
63594
63646
|
debugLogger6.info(`Auto-detected theme (async): ${this.activeTheme.name}`);
|
|
63595
63647
|
}
|
|
63648
|
+
/**
|
|
63649
|
+
* Returns the terminal's detected background brightness ('dark' | 'light').
|
|
63650
|
+
*
|
|
63651
|
+
* Prefers the accurate async OSC 11 result captured at startup (for 'auto'
|
|
63652
|
+
* themes); otherwise falls back to a memoised synchronous heuristic
|
|
63653
|
+
* (COLORFGBG → macOS appearance → default dark). Lets UI code decide whether
|
|
63654
|
+
* the active theme's background matches the terminal without re-probing.
|
|
63655
|
+
*/
|
|
63656
|
+
getTerminalBackgroundType() {
|
|
63657
|
+
if (this.cachedAutoDetection) {
|
|
63658
|
+
return this.cachedAutoDetection;
|
|
63659
|
+
}
|
|
63660
|
+
this.terminalBackground ??= detectTerminalTheme();
|
|
63661
|
+
return this.terminalBackground;
|
|
63662
|
+
}
|
|
63596
63663
|
/**
|
|
63597
63664
|
* Gets the currently active theme.
|
|
63598
63665
|
* @returns The active theme.
|
|
@@ -65515,7 +65582,7 @@ function buildArenaExecutionInput(parsed, config) {
|
|
|
65515
65582
|
};
|
|
65516
65583
|
}
|
|
65517
65584
|
const contentGeneratorConfig = config.getContentGeneratorConfig();
|
|
65518
|
-
const defaultAuthType = contentGeneratorConfig?.authType ??
|
|
65585
|
+
const defaultAuthType = contentGeneratorConfig?.authType ?? "openai" /* USE_OPENAI */;
|
|
65519
65586
|
const modelsConfig = config.getModelsConfig();
|
|
65520
65587
|
const models = parsed.models.map((parsedModel) => {
|
|
65521
65588
|
const authType = parsedModel.authType ?? defaultAuthType;
|
|
@@ -72443,7 +72510,7 @@ async function extractMetadata(conversation, config) {
|
|
|
72443
72510
|
const gitBranch = firstRecord?.gitBranch;
|
|
72444
72511
|
let gitRepo;
|
|
72445
72512
|
if (cwd5) {
|
|
72446
|
-
const { getGitRepoName } = await import("./chunks/src-
|
|
72513
|
+
const { getGitRepoName } = await import("./chunks/src-SPEHQKTK.js");
|
|
72447
72514
|
gitRepo = getGitRepoName(cwd5);
|
|
72448
72515
|
}
|
|
72449
72516
|
let model;
|
|
@@ -76513,13 +76580,28 @@ var mcpCommand2 = {
|
|
|
76513
76580
|
get description() {
|
|
76514
76581
|
return t("Open MCP management dialog");
|
|
76515
76582
|
},
|
|
76516
|
-
argumentHint: "desc|nodesc|schema
|
|
76583
|
+
argumentHint: "desc|nodesc|schema",
|
|
76517
76584
|
kind: "built-in" /* BUILT_IN */,
|
|
76518
76585
|
supportedModes: ["interactive"],
|
|
76519
|
-
action: /* @__PURE__ */ __name(async () =>
|
|
76520
|
-
|
|
76521
|
-
|
|
76522
|
-
|
|
76586
|
+
action: /* @__PURE__ */ __name(async (_context, args = "") => {
|
|
76587
|
+
const [subcommand, serverName] = args.trim().split(/\s+/);
|
|
76588
|
+
if (subcommand === "auth" || subcommand === "noauth") {
|
|
76589
|
+
return {
|
|
76590
|
+
type: "message",
|
|
76591
|
+
messageType: "warning",
|
|
76592
|
+
content: serverName ? t(
|
|
76593
|
+
"MCP OAuth is now managed in the /mcp dialog. Open /mcp, select '{{serverName}}', then use the Auth actions there.",
|
|
76594
|
+
{ serverName }
|
|
76595
|
+
) : t(
|
|
76596
|
+
"MCP OAuth is now managed in the /mcp dialog. Open /mcp, select a server, then use the Auth actions there."
|
|
76597
|
+
)
|
|
76598
|
+
};
|
|
76599
|
+
}
|
|
76600
|
+
return {
|
|
76601
|
+
type: "dialog",
|
|
76602
|
+
dialog: "mcp"
|
|
76603
|
+
};
|
|
76604
|
+
}, "action")
|
|
76523
76605
|
};
|
|
76524
76606
|
|
|
76525
76607
|
// packages/cli/src/ui/commands/dreamCommand.ts
|
|
@@ -76655,7 +76737,7 @@ function resolveVoiceTransport(model) {
|
|
|
76655
76737
|
}
|
|
76656
76738
|
__name(resolveVoiceTransport, "resolveVoiceTransport");
|
|
76657
76739
|
function isTranscribableVoiceModel(model) {
|
|
76658
|
-
return model.authType ===
|
|
76740
|
+
return model.authType === "openai" /* USE_OPENAI */ && model.isRuntimeModel !== true && typeof model.baseUrl === "string" && model.baseUrl.trim().length > 0;
|
|
76659
76741
|
}
|
|
76660
76742
|
__name(isTranscribableVoiceModel, "isTranscribableVoiceModel");
|
|
76661
76743
|
function isSelectableVoiceModel(model) {
|
|
@@ -76685,7 +76767,7 @@ async function switchMainModel(config, settings, currentAuthType, modelArg) {
|
|
|
76685
76767
|
await config.switchModel(
|
|
76686
76768
|
parsed.authType,
|
|
76687
76769
|
parsed.modelId,
|
|
76688
|
-
parsed.authType !== currentAuthType && parsed.authType ===
|
|
76770
|
+
parsed.authType !== currentAuthType && parsed.authType === "qwen-oauth" /* QWEN_OAUTH */ ? { requireCachedCredentials: true } : void 0
|
|
76689
76771
|
);
|
|
76690
76772
|
persistSetting(settings, "security.auth.selectedType", parsed.authType);
|
|
76691
76773
|
persistSetting(settings, "model.name", parsed.modelId);
|
|
@@ -81186,7 +81268,7 @@ var lspCommand = {
|
|
|
81186
81268
|
return t("Show LSP server status. Usage: /lsp [status]");
|
|
81187
81269
|
},
|
|
81188
81270
|
kind: "built-in" /* BUILT_IN */,
|
|
81189
|
-
supportedModes: ["interactive", "non_interactive"],
|
|
81271
|
+
supportedModes: ["interactive", "non_interactive", "acp"],
|
|
81190
81272
|
action: /* @__PURE__ */ __name(async (context, _args) => {
|
|
81191
81273
|
const config = context.services.config;
|
|
81192
81274
|
if (!config) {
|
|
@@ -84722,7 +84804,8 @@ ${messages.join("\n")}`;
|
|
|
84722
84804
|
try {
|
|
84723
84805
|
const result = await readManyFiles(config, {
|
|
84724
84806
|
paths: pathSpecsToRead,
|
|
84725
|
-
signal
|
|
84807
|
+
signal,
|
|
84808
|
+
preserveUnsupportedImageForBridge: shouldRunVisionBridge(config)
|
|
84726
84809
|
});
|
|
84727
84810
|
const parts = Array.isArray(result.contentParts) ? result.contentParts : [result.contentParts];
|
|
84728
84811
|
fileDisplays = result.files.map((file, index) => ({
|
|
@@ -86271,7 +86354,7 @@ var SystemController = class extends BaseController {
|
|
|
86271
86354
|
throw new Error("Request aborted");
|
|
86272
86355
|
}
|
|
86273
86356
|
try {
|
|
86274
|
-
const mod = await import("./chunks/contextCommand-
|
|
86357
|
+
const mod = await import("./chunks/contextCommand-JSYQAO3O.js");
|
|
86275
86358
|
if (signal.aborted) {
|
|
86276
86359
|
throw new Error("Request aborted");
|
|
86277
86360
|
}
|
|
@@ -89460,8 +89543,7 @@ function getInstalledOwnedModelIds(settings, provider) {
|
|
|
89460
89543
|
const mergedSettings = settings.merged;
|
|
89461
89544
|
const modelProviders = mergedSettings["modelProviders"];
|
|
89462
89545
|
if (!modelProviders) return [];
|
|
89463
|
-
const
|
|
89464
|
-
const allModels = Array.isArray(entry) ? entry : entry?.models ?? [];
|
|
89546
|
+
const allModels = modelProviders[protocol] ?? [];
|
|
89465
89547
|
const ownsFn = resolveOwnsModel(provider);
|
|
89466
89548
|
if (!ownsFn) return allModels.map((m) => m.id);
|
|
89467
89549
|
return allModels.filter(ownsFn).map((m) => m.id);
|
|
@@ -95009,10 +95091,10 @@ var ContinuationMarkdownMessage = /* @__PURE__ */ __name(({
|
|
|
95009
95091
|
}
|
|
95010
95092
|
) });
|
|
95011
95093
|
}, "ContinuationMarkdownMessage");
|
|
95012
|
-
var UserMessage = /* @__PURE__ */ __name(({ text
|
|
95013
|
-
|
|
95014
|
-
|
|
95015
|
-
|
|
95094
|
+
var UserMessage = /* @__PURE__ */ __name(({ text }) => (
|
|
95095
|
+
// The TUI paints no background of its own; user messages render directly on
|
|
95096
|
+
// the terminal background so they blend in across terminals and themes.
|
|
95097
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
95016
95098
|
PrefixedTextMessage,
|
|
95017
95099
|
{
|
|
95018
95100
|
text,
|
|
@@ -95023,42 +95105,8 @@ var UserMessage = /* @__PURE__ */ __name(({ text, width }) => {
|
|
|
95023
95105
|
alignSelf: "flex-start",
|
|
95024
95106
|
marginTop: 1
|
|
95025
95107
|
}
|
|
95026
|
-
)
|
|
95027
|
-
|
|
95028
|
-
return fallback;
|
|
95029
|
-
}
|
|
95030
|
-
const bg = resolveColor(theme.background.primary) || theme.background.primary;
|
|
95031
|
-
const bandColor = subtleBandColor(bg);
|
|
95032
|
-
if (!bandColor) {
|
|
95033
|
-
return fallback;
|
|
95034
|
-
}
|
|
95035
|
-
const prefix = "> ";
|
|
95036
|
-
const lines = text.split("\n");
|
|
95037
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Box_default, { flexDirection: "column", width, children: [
|
|
95038
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { color: bandColor, children: "\u2584".repeat(width) }),
|
|
95039
|
-
lines.map((line, i) => {
|
|
95040
|
-
const linePrefix = i === 0 ? prefix : " ";
|
|
95041
|
-
const lineWidth2 = stringWidth2(linePrefix + line);
|
|
95042
|
-
const pad2 = Math.max(0, width - lineWidth2);
|
|
95043
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
95044
|
-
Text,
|
|
95045
|
-
{
|
|
95046
|
-
backgroundColor: bandColor,
|
|
95047
|
-
"aria-label": i === 0 ? SCREEN_READER_USER_PREFIX : void 0,
|
|
95048
|
-
children: [
|
|
95049
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Text, { color: theme.text.accent, children: [
|
|
95050
|
-
linePrefix,
|
|
95051
|
-
line
|
|
95052
|
-
] }),
|
|
95053
|
-
pad2 > 0 ? " ".repeat(pad2) : ""
|
|
95054
|
-
]
|
|
95055
|
-
},
|
|
95056
|
-
i
|
|
95057
|
-
);
|
|
95058
|
-
}),
|
|
95059
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Text, { color: bandColor, children: "\u2580".repeat(width) })
|
|
95060
|
-
] });
|
|
95061
|
-
}, "UserMessage");
|
|
95108
|
+
)
|
|
95109
|
+
), "UserMessage");
|
|
95062
95110
|
var UserShellMessage = /* @__PURE__ */ __name(({ text }) => {
|
|
95063
95111
|
const commandToDisplay = text.startsWith("!") ? text.substring(1) : text;
|
|
95064
95112
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
@@ -95658,7 +95706,6 @@ var import_react61 = __toESM(require_react(), 1);
|
|
|
95658
95706
|
|
|
95659
95707
|
// packages/cli/src/ui/components/shared/TextInput.tsx
|
|
95660
95708
|
init_esbuild_shims();
|
|
95661
|
-
var import_chalk6 = __toESM(require_source(), 1);
|
|
95662
95709
|
|
|
95663
95710
|
// packages/cli/src/ui/components/shared/text-buffer.ts
|
|
95664
95711
|
init_esbuild_shims();
|
|
@@ -98370,6 +98417,73 @@ __name(usePreferredEditor, "usePreferredEditor");
|
|
|
98370
98417
|
|
|
98371
98418
|
// packages/cli/src/ui/components/shared/TextInput.tsx
|
|
98372
98419
|
var import_react60 = __toESM(require_react(), 1);
|
|
98420
|
+
|
|
98421
|
+
// packages/cli/src/ui/utils/software-cursor.ts
|
|
98422
|
+
init_esbuild_shims();
|
|
98423
|
+
var import_chalk6 = __toESM(require_source(), 1);
|
|
98424
|
+
|
|
98425
|
+
// packages/cli/src/ui/utils/theme-background.ts
|
|
98426
|
+
init_esbuild_shims();
|
|
98427
|
+
var DARK_TERMINAL_BACKGROUND = "#000000";
|
|
98428
|
+
var LIGHT_TERMINAL_BACKGROUND = "#ffffff";
|
|
98429
|
+
function getEffectiveTerminalBackground() {
|
|
98430
|
+
return themeManager.getTerminalBackgroundType() === "light" ? LIGHT_TERMINAL_BACKGROUND : DARK_TERMINAL_BACKGROUND;
|
|
98431
|
+
}
|
|
98432
|
+
__name(getEffectiveTerminalBackground, "getEffectiveTerminalBackground");
|
|
98433
|
+
|
|
98434
|
+
// packages/cli/src/ui/utils/software-cursor.ts
|
|
98435
|
+
var LIGHT_CURSOR_BACKGROUND = "#D4D4D4";
|
|
98436
|
+
var DARK_CURSOR_BACKGROUND = "#3A3A3A";
|
|
98437
|
+
var INK_NAME_TO_HEX = {
|
|
98438
|
+
black: "#000000",
|
|
98439
|
+
red: "#ff0000",
|
|
98440
|
+
green: "#00ff00",
|
|
98441
|
+
yellow: "#ffff00",
|
|
98442
|
+
blue: "#0000ff",
|
|
98443
|
+
cyan: "#00ffff",
|
|
98444
|
+
magenta: "#ff00ff",
|
|
98445
|
+
white: "#ffffff",
|
|
98446
|
+
gray: "#808080",
|
|
98447
|
+
grey: "#808080",
|
|
98448
|
+
blackbright: "#808080",
|
|
98449
|
+
redbright: "#ff8080",
|
|
98450
|
+
greenbright: "#80ff80",
|
|
98451
|
+
yellowbright: "#ffff80",
|
|
98452
|
+
bluebright: "#8080ff",
|
|
98453
|
+
cyanbright: "#80ffff",
|
|
98454
|
+
magentabright: "#ff80ff",
|
|
98455
|
+
whitebright: "#ffffff"
|
|
98456
|
+
};
|
|
98457
|
+
function toHex(color2) {
|
|
98458
|
+
const resolved = resolveColor(color2) ?? color2;
|
|
98459
|
+
const lower2 = resolved.toLowerCase();
|
|
98460
|
+
if (/^#[0-9a-f]{3}$/.test(lower2)) {
|
|
98461
|
+
return `#${lower2.slice(1).split("").map((c) => c + c).join("")}`;
|
|
98462
|
+
}
|
|
98463
|
+
if (/^#[0-9a-f]{6}$/.test(lower2)) {
|
|
98464
|
+
return lower2;
|
|
98465
|
+
}
|
|
98466
|
+
return INK_NAME_TO_HEX[lower2];
|
|
98467
|
+
}
|
|
98468
|
+
__name(toHex, "toHex");
|
|
98469
|
+
function getSoftwareCursorBackground(backgroundColor = getEffectiveTerminalBackground()) {
|
|
98470
|
+
const hex = backgroundColor ? toHex(backgroundColor) : void 0;
|
|
98471
|
+
if (!hex) {
|
|
98472
|
+
return LIGHT_CURSOR_BACKGROUND;
|
|
98473
|
+
}
|
|
98474
|
+
const r = parseInt(hex.slice(1, 3), 16);
|
|
98475
|
+
const g = parseInt(hex.slice(3, 5), 16);
|
|
98476
|
+
const b = parseInt(hex.slice(5, 7), 16);
|
|
98477
|
+
const luminance = (r * 299 + g * 587 + b * 114) / 1e3;
|
|
98478
|
+
return luminance >= 128 ? DARK_CURSOR_BACKGROUND : LIGHT_CURSOR_BACKGROUND;
|
|
98479
|
+
}
|
|
98480
|
+
__name(getSoftwareCursorBackground, "getSoftwareCursorBackground");
|
|
98481
|
+
function renderSoftwareCursor(text) {
|
|
98482
|
+
return import_chalk6.default.bgHex(getSoftwareCursorBackground())(text || " ");
|
|
98483
|
+
}
|
|
98484
|
+
__name(renderSoftwareCursor, "renderSoftwareCursor");
|
|
98485
|
+
|
|
98486
|
+
// packages/cli/src/ui/components/shared/TextInput.tsx
|
|
98373
98487
|
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
|
|
98374
98488
|
function ellipsizeMiddle(text, width) {
|
|
98375
98489
|
if (width <= 0) return "";
|
|
@@ -98496,7 +98610,7 @@ function TextInput({
|
|
|
98496
98610
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { children: [
|
|
98497
98611
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: theme.text.accent, children: "> " }),
|
|
98498
98612
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box_default, { flexGrow: 1, flexDirection: "column", children: buffer.text.length === 0 && placeholder ? shouldRenderCursor ? /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { children: [
|
|
98499
|
-
|
|
98613
|
+
renderSoftwareCursor(placeholder.slice(0, 1)),
|
|
98500
98614
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: Colors.Gray, children: placeholder.slice(1) })
|
|
98501
98615
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: Colors.Gray, children: placeholder }) : ellipsizeOverflow && stringWidth2(buffer.text) > inputWidth ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { children: ellipsizeMiddle(buffer.text, inputWidth) }) : linesToRender.map((lineText, visualIdxInRenderedSet) => {
|
|
98502
98616
|
const cursorVisualRow = cursorVisualRowAbsolute - scrollVisualRow;
|
|
@@ -98514,10 +98628,10 @@ function TextInput({
|
|
|
98514
98628
|
relativeVisualColForHighlight,
|
|
98515
98629
|
relativeVisualColForHighlight + 1
|
|
98516
98630
|
) || " ";
|
|
98517
|
-
const highlighted =
|
|
98631
|
+
const highlighted = renderSoftwareCursor(charToHighlight);
|
|
98518
98632
|
display = cpSlice(display, 0, relativeVisualColForHighlight) + highlighted + cpSlice(display, relativeVisualColForHighlight + 1);
|
|
98519
98633
|
} else if (relativeVisualColForHighlight === cpLen(display) && cpLen(display) === inputWidth) {
|
|
98520
|
-
display = display +
|
|
98634
|
+
display = display + renderSoftwareCursor(" ");
|
|
98521
98635
|
}
|
|
98522
98636
|
}
|
|
98523
98637
|
}
|
|
@@ -102493,7 +102607,7 @@ var McpStatus = /* @__PURE__ */ __name(({
|
|
|
102493
102607
|
"- ",
|
|
102494
102608
|
t("Use"),
|
|
102495
102609
|
" ",
|
|
102496
|
-
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Text, { color: theme.text.accent, children: "/mcp
|
|
102610
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Text, { color: theme.text.accent, children: "/mcp" }),
|
|
102497
102611
|
" ",
|
|
102498
102612
|
t("to authenticate with OAuth-enabled servers")
|
|
102499
102613
|
] }),
|
|
@@ -103609,6 +103723,39 @@ var ThinkingViewerProvider = ThinkingViewerContext.Provider;
|
|
|
103609
103723
|
// packages/cli/src/ui/hooks/useMouseEvents.ts
|
|
103610
103724
|
init_esbuild_shims();
|
|
103611
103725
|
var import_react81 = __toESM(require_react(), 1);
|
|
103726
|
+
var mouseModeRefs = /* @__PURE__ */ new Map();
|
|
103727
|
+
var disableAllMouseModes = /* @__PURE__ */ __name(() => {
|
|
103728
|
+
for (const stdout of mouseModeRefs.keys()) {
|
|
103729
|
+
disableMouseEvents(stdout);
|
|
103730
|
+
}
|
|
103731
|
+
mouseModeRefs.clear();
|
|
103732
|
+
}, "disableAllMouseModes");
|
|
103733
|
+
function acquireMouseMode(stdout) {
|
|
103734
|
+
const entry = mouseModeRefs.get(stdout);
|
|
103735
|
+
if (entry) {
|
|
103736
|
+
entry.refs += 1;
|
|
103737
|
+
return;
|
|
103738
|
+
}
|
|
103739
|
+
enableMouseEvents(stdout);
|
|
103740
|
+
if (mouseModeRefs.size === 0) {
|
|
103741
|
+
process.on("exit", disableAllMouseModes);
|
|
103742
|
+
}
|
|
103743
|
+
mouseModeRefs.set(stdout, { refs: 1 });
|
|
103744
|
+
}
|
|
103745
|
+
__name(acquireMouseMode, "acquireMouseMode");
|
|
103746
|
+
function releaseMouseMode(stdout) {
|
|
103747
|
+
const entry = mouseModeRefs.get(stdout);
|
|
103748
|
+
if (!entry) return;
|
|
103749
|
+
entry.refs -= 1;
|
|
103750
|
+
if (entry.refs <= 0) {
|
|
103751
|
+
mouseModeRefs.delete(stdout);
|
|
103752
|
+
disableMouseEvents(stdout);
|
|
103753
|
+
if (mouseModeRefs.size === 0) {
|
|
103754
|
+
process.removeListener("exit", disableAllMouseModes);
|
|
103755
|
+
}
|
|
103756
|
+
}
|
|
103757
|
+
}
|
|
103758
|
+
__name(releaseMouseMode, "releaseMouseMode");
|
|
103612
103759
|
function useMouseEvents(handler, { isActive }) {
|
|
103613
103760
|
const { isRawModeSupported } = use_stdin_default();
|
|
103614
103761
|
const { stdout } = use_stdout_default();
|
|
@@ -103618,14 +103765,9 @@ function useMouseEvents(handler, { isActive }) {
|
|
|
103618
103765
|
const enabled2 = isActive && isRawModeSupported;
|
|
103619
103766
|
(0, import_react81.useEffect)(() => {
|
|
103620
103767
|
if (!enabled2) return;
|
|
103621
|
-
|
|
103622
|
-
const onExit = /* @__PURE__ */ __name(() => {
|
|
103623
|
-
disableMouseEvents(stdout);
|
|
103624
|
-
}, "onExit");
|
|
103625
|
-
process.on("exit", onExit);
|
|
103768
|
+
acquireMouseMode(stdout);
|
|
103626
103769
|
return () => {
|
|
103627
|
-
|
|
103628
|
-
disableMouseEvents(stdout);
|
|
103770
|
+
releaseMouseMode(stdout);
|
|
103629
103771
|
};
|
|
103630
103772
|
}, [enabled2, stdout]);
|
|
103631
103773
|
const mouseCallback = (0, import_react81.useCallback)((event) => {
|
|
@@ -103776,7 +103918,7 @@ var HistoryItemDisplayComponent = /* @__PURE__ */ __name(({
|
|
|
103776
103918
|
marginLeft: 2,
|
|
103777
103919
|
marginRight: 2,
|
|
103778
103920
|
children: [
|
|
103779
|
-
itemForDisplay.type === "user" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(UserMessage, { text: itemForDisplay.text
|
|
103921
|
+
itemForDisplay.type === "user" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(UserMessage, { text: itemForDisplay.text }),
|
|
103780
103922
|
itemForDisplay.type === "notification" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(InfoMessage, { text: itemForDisplay.text }),
|
|
103781
103923
|
itemForDisplay.type === "user_shell" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(UserShellMessage, { text: itemForDisplay.text }),
|
|
103782
103924
|
itemForDisplay.type === "gemini" && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
|
|
@@ -104880,7 +105022,7 @@ function getAuthDisplayType(authType, baseUrl, apiKeyEnvKey) {
|
|
|
104880
105022
|
return matched.label;
|
|
104881
105023
|
}
|
|
104882
105024
|
switch (authType) {
|
|
104883
|
-
case
|
|
105025
|
+
case "qwen-oauth" /* QWEN_OAUTH */:
|
|
104884
105026
|
return "qwen_oauth" /* QWEN_OAUTH */;
|
|
104885
105027
|
default:
|
|
104886
105028
|
return "api_key" /* API_KEY */;
|
|
@@ -105321,6 +105463,7 @@ function VirtualizedList(props, ref) {
|
|
|
105321
105463
|
return scrollToEnd;
|
|
105322
105464
|
});
|
|
105323
105465
|
const containerRef = (0, import_react90.useRef)(null);
|
|
105466
|
+
const rootRef = (0, import_react90.useRef)(null);
|
|
105324
105467
|
const { width: measuredContainerWidth, height: measuredContainerHeight } = use_box_metrics_default(containerRef);
|
|
105325
105468
|
const containerHeight = props.containerHeight ?? measuredContainerHeight;
|
|
105326
105469
|
const containerWidth = measuredContainerWidth;
|
|
@@ -105587,6 +105730,64 @@ function VirtualizedList(props, ref) {
|
|
|
105587
105730
|
Math.max(0, isStickingToBottom ? maxScroll : actualScrollTop),
|
|
105588
105731
|
maxScroll
|
|
105589
105732
|
);
|
|
105733
|
+
const getScrollbarGeometry = (0, import_react90.useCallback)(() => {
|
|
105734
|
+
const shouldShowScrollbar = (props.showScrollbar ?? true) && maxScroll > 0;
|
|
105735
|
+
if (!shouldShowScrollbar || !rootRef.current || scrollableContainerHeight <= 0) {
|
|
105736
|
+
return null;
|
|
105737
|
+
}
|
|
105738
|
+
const metrics = measureElementPosition(rootRef.current);
|
|
105739
|
+
if (metrics.width <= 0 || metrics.height <= 0) return null;
|
|
105740
|
+
return {
|
|
105741
|
+
col: metrics.x + metrics.width - 1,
|
|
105742
|
+
top: metrics.y,
|
|
105743
|
+
height: scrollableContainerHeight
|
|
105744
|
+
};
|
|
105745
|
+
}, [props.showScrollbar, maxScroll, scrollableContainerHeight]);
|
|
105746
|
+
const hitTestScrollbar = (0, import_react90.useCallback)(
|
|
105747
|
+
({ col, row }) => {
|
|
105748
|
+
const geometry = getScrollbarGeometry();
|
|
105749
|
+
if (!geometry) return false;
|
|
105750
|
+
const zeroBasedCol = col - 1;
|
|
105751
|
+
const zeroBasedRow = row - 1;
|
|
105752
|
+
return zeroBasedCol === geometry.col && zeroBasedRow >= geometry.top && zeroBasedRow < geometry.top + geometry.height;
|
|
105753
|
+
},
|
|
105754
|
+
[getScrollbarGeometry]
|
|
105755
|
+
);
|
|
105756
|
+
const scrollToScrollbarRow = (0, import_react90.useCallback)(
|
|
105757
|
+
(row) => {
|
|
105758
|
+
const geometry = getScrollbarGeometry();
|
|
105759
|
+
if (!geometry) return;
|
|
105760
|
+
const zeroBasedRow = row - 1;
|
|
105761
|
+
const rowInTrack = Math.max(
|
|
105762
|
+
0,
|
|
105763
|
+
Math.min(geometry.height - 1, zeroBasedRow - geometry.top)
|
|
105764
|
+
);
|
|
105765
|
+
const scrollRatio = rowInTrack / Math.max(1, geometry.height - 1);
|
|
105766
|
+
const newScrollTop = Math.round(scrollRatio * maxScroll);
|
|
105767
|
+
if (newScrollTop >= maxScroll) {
|
|
105768
|
+
setIsStickingToBottom(true);
|
|
105769
|
+
setPendingScrollTop(Number.MAX_SAFE_INTEGER);
|
|
105770
|
+
if (data.length > 0) {
|
|
105771
|
+
setScrollAnchor({
|
|
105772
|
+
index: data.length - 1,
|
|
105773
|
+
offset: SCROLL_TO_ITEM_END
|
|
105774
|
+
});
|
|
105775
|
+
}
|
|
105776
|
+
} else {
|
|
105777
|
+
setIsStickingToBottom(false);
|
|
105778
|
+
setPendingScrollTop(newScrollTop);
|
|
105779
|
+
setScrollAnchor(getAnchorForScrollTop(newScrollTop, offsets));
|
|
105780
|
+
}
|
|
105781
|
+
},
|
|
105782
|
+
[
|
|
105783
|
+
data.length,
|
|
105784
|
+
getAnchorForScrollTop,
|
|
105785
|
+
getScrollbarGeometry,
|
|
105786
|
+
maxScroll,
|
|
105787
|
+
offsets,
|
|
105788
|
+
setPendingScrollTop
|
|
105789
|
+
]
|
|
105790
|
+
);
|
|
105590
105791
|
(0, import_react90.useImperativeHandle)(
|
|
105591
105792
|
ref,
|
|
105592
105793
|
() => ({
|
|
@@ -105689,6 +105890,8 @@ function VirtualizedList(props, ref) {
|
|
|
105689
105890
|
}
|
|
105690
105891
|
}
|
|
105691
105892
|
}, "scrollToItem"),
|
|
105893
|
+
hitTestScrollbar,
|
|
105894
|
+
scrollToScrollbarRow,
|
|
105692
105895
|
getScrollIndex: /* @__PURE__ */ __name(() => scrollAnchor.index, "getScrollIndex"),
|
|
105693
105896
|
getScrollState: /* @__PURE__ */ __name(() => {
|
|
105694
105897
|
const maxScroll2 = Math.max(0, totalHeight - scrollableContainerHeight);
|
|
@@ -105707,7 +105910,9 @@ function VirtualizedList(props, ref) {
|
|
|
105707
105910
|
data,
|
|
105708
105911
|
scrollableContainerHeight,
|
|
105709
105912
|
getScrollTop,
|
|
105710
|
-
setPendingScrollTop
|
|
105913
|
+
setPendingScrollTop,
|
|
105914
|
+
hitTestScrollbar,
|
|
105915
|
+
scrollToScrollbarRow
|
|
105711
105916
|
]
|
|
105712
105917
|
);
|
|
105713
105918
|
const showScrollbar = (props.showScrollbar ?? true) && maxScroll > 0;
|
|
@@ -105746,6 +105951,7 @@ function VirtualizedList(props, ref) {
|
|
|
105746
105951
|
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
105747
105952
|
Box_default,
|
|
105748
105953
|
{
|
|
105954
|
+
ref: rootRef,
|
|
105749
105955
|
width: "100%",
|
|
105750
105956
|
height: props.containerHeight !== void 0 ? props.containerHeight : "100%",
|
|
105751
105957
|
flexDirection: "row",
|
|
@@ -105788,6 +105994,7 @@ var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1);
|
|
|
105788
105994
|
function ScrollableList(props, ref) {
|
|
105789
105995
|
const { hasFocus, ...virtualizedListProps } = props;
|
|
105790
105996
|
const virtualizedListRef = (0, import_react91.useRef)(null);
|
|
105997
|
+
const isDraggingScrollbar = (0, import_react91.useRef)(false);
|
|
105791
105998
|
(0, import_react91.useImperativeHandle)(
|
|
105792
105999
|
ref,
|
|
105793
106000
|
() => ({
|
|
@@ -105796,6 +106003,8 @@ function ScrollableList(props, ref) {
|
|
|
105796
106003
|
scrollToEnd: /* @__PURE__ */ __name(() => virtualizedListRef.current?.scrollToEnd(), "scrollToEnd"),
|
|
105797
106004
|
scrollToIndex: /* @__PURE__ */ __name((params) => virtualizedListRef.current?.scrollToIndex(params), "scrollToIndex"),
|
|
105798
106005
|
scrollToItem: /* @__PURE__ */ __name((params) => virtualizedListRef.current?.scrollToItem(params), "scrollToItem"),
|
|
106006
|
+
hitTestScrollbar: /* @__PURE__ */ __name((location) => virtualizedListRef.current?.hitTestScrollbar(location) ?? false, "hitTestScrollbar"),
|
|
106007
|
+
scrollToScrollbarRow: /* @__PURE__ */ __name((row) => virtualizedListRef.current?.scrollToScrollbarRow(row), "scrollToScrollbarRow"),
|
|
105799
106008
|
getScrollIndex: /* @__PURE__ */ __name(() => virtualizedListRef.current?.getScrollIndex() ?? 0, "getScrollIndex"),
|
|
105800
106009
|
getScrollState: /* @__PURE__ */ __name(() => virtualizedListRef.current?.getScrollState() ?? {
|
|
105801
106010
|
scrollTop: 0,
|
|
@@ -105841,6 +106050,21 @@ function ScrollableList(props, ref) {
|
|
|
105841
106050
|
const WHEEL_LINES_PER_TICK = 3;
|
|
105842
106051
|
const handleMouseEvent = (0, import_react91.useCallback)((event) => {
|
|
105843
106052
|
if (!virtualizedListRef.current) return;
|
|
106053
|
+
if (event.name === "left-release") {
|
|
106054
|
+
isDraggingScrollbar.current = false;
|
|
106055
|
+
return;
|
|
106056
|
+
}
|
|
106057
|
+
if (event.name === "left-press") {
|
|
106058
|
+
isDraggingScrollbar.current = virtualizedListRef.current.hitTestScrollbar(event);
|
|
106059
|
+
if (isDraggingScrollbar.current) {
|
|
106060
|
+
virtualizedListRef.current.scrollToScrollbarRow(event.row);
|
|
106061
|
+
}
|
|
106062
|
+
return;
|
|
106063
|
+
}
|
|
106064
|
+
if (event.name === "move" && isDraggingScrollbar.current) {
|
|
106065
|
+
virtualizedListRef.current.scrollToScrollbarRow(event.row);
|
|
106066
|
+
return;
|
|
106067
|
+
}
|
|
105844
106068
|
if (event.name === "scroll-up") {
|
|
105845
106069
|
virtualizedListRef.current.scrollBy(-WHEEL_LINES_PER_TICK);
|
|
105846
106070
|
} else if (event.name === "scroll-down") {
|
|
@@ -106638,7 +106862,6 @@ var ProviderUpdatePrompt = /* @__PURE__ */ __name(({
|
|
|
106638
106862
|
// packages/cli/src/ui/components/SettingInputPrompt.tsx
|
|
106639
106863
|
init_esbuild_shims();
|
|
106640
106864
|
var import_react95 = __toESM(require_react(), 1);
|
|
106641
|
-
var import_chalk7 = __toESM(require_source(), 1);
|
|
106642
106865
|
var import_jsx_runtime71 = __toESM(require_jsx_runtime(), 1);
|
|
106643
106866
|
var PasswordInput = /* @__PURE__ */ __name(({
|
|
106644
106867
|
value,
|
|
@@ -106671,7 +106894,7 @@ var PasswordInput = /* @__PURE__ */ __name(({
|
|
|
106671
106894
|
);
|
|
106672
106895
|
const maskedValue = "*".repeat(value.length);
|
|
106673
106896
|
const displayValue = maskedValue || "";
|
|
106674
|
-
const cursorChar =
|
|
106897
|
+
const cursorChar = renderSoftwareCursor(" ");
|
|
106675
106898
|
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(Box_default, { children: [
|
|
106676
106899
|
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Text, { color: theme.text.accent, children: "> " }),
|
|
106677
106900
|
value.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(Text, { children: [
|
|
@@ -107236,7 +107459,6 @@ var useVimModeActions = /* @__PURE__ */ __name(() => {
|
|
|
107236
107459
|
}, "useVimModeActions");
|
|
107237
107460
|
|
|
107238
107461
|
// packages/cli/src/ui/components/SettingsDialog.tsx
|
|
107239
|
-
var import_chalk8 = __toESM(require_source(), 1);
|
|
107240
107462
|
var import_jsx_runtime76 = __toESM(require_jsx_runtime(), 1);
|
|
107241
107463
|
var debugLogger46 = createDebugLogger("SETTINGS_DIALOG");
|
|
107242
107464
|
var maxItemsToShow = 8;
|
|
@@ -107803,9 +108025,9 @@ function SettingsDialog({
|
|
|
107803
108025
|
editCursorPos + 1
|
|
107804
108026
|
);
|
|
107805
108027
|
const afterCursor = cpSlice(editBuffer, editCursorPos + 1);
|
|
107806
|
-
displayValue = beforeCursor +
|
|
108028
|
+
displayValue = beforeCursor + renderSoftwareCursor(atCursor) + afterCursor;
|
|
107807
108029
|
} else if (cursorVisible && editCursorPos >= cpLen(editBuffer)) {
|
|
107808
|
-
displayValue = editBuffer +
|
|
108030
|
+
displayValue = editBuffer + renderSoftwareCursor(" ");
|
|
107809
108031
|
} else {
|
|
107810
108032
|
displayValue = editBuffer;
|
|
107811
108033
|
}
|
|
@@ -108813,7 +109035,7 @@ var useQwenAuth = /* @__PURE__ */ __name((pendingAuthType, isAuthenticating) =>
|
|
|
108813
109035
|
authStatus: "idle",
|
|
108814
109036
|
authMessage: null
|
|
108815
109037
|
});
|
|
108816
|
-
const isQwenAuth = pendingAuthType ===
|
|
109038
|
+
const isQwenAuth = pendingAuthType === "qwen-oauth" /* QWEN_OAUTH */;
|
|
108817
109039
|
(0, import_react103.useEffect)(() => {
|
|
108818
109040
|
if (!isQwenAuth || !isAuthenticating) {
|
|
108819
109041
|
setQwenAuthState({
|
|
@@ -108972,7 +109194,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem, onAuthCh
|
|
|
108972
109194
|
setAuthError(null);
|
|
108973
109195
|
}, []);
|
|
108974
109196
|
const cancelAuthentication = (0, import_react104.useCallback)(() => {
|
|
108975
|
-
if (isAuthenticating && pendingAuthType ===
|
|
109197
|
+
if (isAuthenticating && pendingAuthType === "qwen-oauth" /* QWEN_OAUTH */) {
|
|
108976
109198
|
cancelQwenAuth();
|
|
108977
109199
|
}
|
|
108978
109200
|
if (isAuthenticating && pendingAuthType) {
|
|
@@ -108986,11 +109208,11 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem, onAuthCh
|
|
|
108986
109208
|
(0, import_react104.useEffect)(() => {
|
|
108987
109209
|
const val = process.env["QWEN_DEFAULT_AUTH_TYPE"];
|
|
108988
109210
|
const valid = [
|
|
108989
|
-
|
|
108990
|
-
|
|
108991
|
-
|
|
108992
|
-
|
|
108993
|
-
|
|
109211
|
+
"qwen-oauth" /* QWEN_OAUTH */,
|
|
109212
|
+
"openai" /* USE_OPENAI */,
|
|
109213
|
+
"anthropic" /* USE_ANTHROPIC */,
|
|
109214
|
+
"gemini" /* USE_GEMINI */,
|
|
109215
|
+
"vertex-ai" /* USE_VERTEX_AI */
|
|
108994
109216
|
];
|
|
108995
109217
|
if (val && !valid.includes(val)) {
|
|
108996
109218
|
onAuthError(
|
|
@@ -109076,7 +109298,7 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
109076
109298
|
const [provider, setProvider] = (0, import_react105.useState)(null);
|
|
109077
109299
|
const [visibleSteps, setVisibleSteps] = (0, import_react105.useState)([]);
|
|
109078
109300
|
const [stepIndex, setStepIndex] = (0, import_react105.useState)(0);
|
|
109079
|
-
const [protocol, setProtocol] = (0, import_react105.useState)("openai" /*
|
|
109301
|
+
const [protocol, setProtocol] = (0, import_react105.useState)("openai" /* USE_OPENAI */);
|
|
109080
109302
|
const [baseUrl, setBaseUrl] = (0, import_react105.useState)("");
|
|
109081
109303
|
const [baseUrlPlaceholder, setBaseUrlPlaceholder] = (0, import_react105.useState)("");
|
|
109082
109304
|
const [baseUrlOptionIndex, setBaseUrlOptionIndex] = (0, import_react105.useState)(0);
|
|
@@ -109147,10 +109369,9 @@ function useProviderSetupFlow(onSubmit) {
|
|
|
109147
109369
|
}, [visibleSteps]);
|
|
109148
109370
|
const selectProtocol = (0, import_react105.useCallback)(
|
|
109149
109371
|
(selectedProtocol) => {
|
|
109150
|
-
|
|
109151
|
-
setProtocol(proto3);
|
|
109372
|
+
setProtocol(selectedProtocol);
|
|
109152
109373
|
setBaseUrl("");
|
|
109153
|
-
setBaseUrlPlaceholder(getDefaultBaseUrlForProtocol(
|
|
109374
|
+
setBaseUrlPlaceholder(getDefaultBaseUrlForProtocol(selectedProtocol));
|
|
109154
109375
|
setApiKey("");
|
|
109155
109376
|
setApiKeyError(null);
|
|
109156
109377
|
goNext();
|
|
@@ -109923,25 +110144,25 @@ function ReviewStep({ flow }) {
|
|
|
109923
110144
|
__name(ReviewStep, "ReviewStep");
|
|
109924
110145
|
var PROTOCOL_ITEMS = [
|
|
109925
110146
|
{
|
|
109926
|
-
key:
|
|
110147
|
+
key: "openai" /* USE_OPENAI */,
|
|
109927
110148
|
title: t("OpenAI-compatible"),
|
|
109928
110149
|
label: t("OpenAI-compatible"),
|
|
109929
110150
|
description: t("Standard OpenAI API format (most common)"),
|
|
109930
|
-
value:
|
|
110151
|
+
value: "openai" /* USE_OPENAI */
|
|
109931
110152
|
},
|
|
109932
110153
|
{
|
|
109933
|
-
key:
|
|
110154
|
+
key: "anthropic" /* USE_ANTHROPIC */,
|
|
109934
110155
|
title: t("Anthropic-compatible"),
|
|
109935
110156
|
label: t("Anthropic-compatible"),
|
|
109936
110157
|
description: t("Anthropic Messages API format"),
|
|
109937
|
-
value:
|
|
110158
|
+
value: "anthropic" /* USE_ANTHROPIC */
|
|
109938
110159
|
},
|
|
109939
110160
|
{
|
|
109940
|
-
key:
|
|
110161
|
+
key: "gemini" /* USE_GEMINI */,
|
|
109941
110162
|
title: t("Gemini-compatible"),
|
|
109942
110163
|
label: t("Gemini-compatible"),
|
|
109943
110164
|
description: t("Google Gemini API format"),
|
|
109944
|
-
value:
|
|
110165
|
+
value: "gemini" /* USE_GEMINI */
|
|
109945
110166
|
}
|
|
109946
110167
|
];
|
|
109947
110168
|
function ProviderSetupSteps({
|
|
@@ -111491,7 +111712,7 @@ function ModelDialog({
|
|
|
111491
111712
|
const allModels = config ? config.getAllConfiguredModels() : [];
|
|
111492
111713
|
const runtimeModels = allModels.filter((m) => m.isRuntimeModel);
|
|
111493
111714
|
const registryModels = allModels.filter(
|
|
111494
|
-
(m) => !m.isRuntimeModel && (m.authType !==
|
|
111715
|
+
(m) => !m.isRuntimeModel && (m.authType !== "qwen-oauth" /* QWEN_OAUTH */ || authType === "qwen-oauth" /* QWEN_OAUTH */) && (isFastModelMode || !m.fastOnly) && (isVoiceModelMode || !m.voiceOnly)
|
|
111495
111716
|
);
|
|
111496
111717
|
const modelsByAuthTypeMap = /* @__PURE__ */ new Map();
|
|
111497
111718
|
for (const model of registryModels) {
|
|
@@ -111501,25 +111722,17 @@ function ModelDialog({
|
|
|
111501
111722
|
}
|
|
111502
111723
|
modelsByAuthTypeMap.get(authType2).push(model);
|
|
111503
111724
|
}
|
|
111504
|
-
const
|
|
111505
|
-
|
|
111506
|
-
|
|
111507
|
-
|
|
111508
|
-
|
|
111509
|
-
|
|
111725
|
+
const authTypeOrder = [
|
|
111726
|
+
"qwen-oauth" /* QWEN_OAUTH */,
|
|
111727
|
+
"openai" /* USE_OPENAI */,
|
|
111728
|
+
"anthropic" /* USE_ANTHROPIC */,
|
|
111729
|
+
"gemini" /* USE_GEMINI */,
|
|
111730
|
+
"vertex-ai" /* USE_VERTEX_AI */
|
|
111510
111731
|
];
|
|
111511
111732
|
const availableAuthTypes = new Set(modelsByAuthTypeMap.keys());
|
|
111512
|
-
const orderedAuthTypes =
|
|
111513
|
-
|
|
111514
|
-
|
|
111515
|
-
orderedAuthTypes.push(authType2);
|
|
111516
|
-
}
|
|
111517
|
-
}
|
|
111518
|
-
for (const authType2 of availableAuthTypes) {
|
|
111519
|
-
if (!builtinAuthTypeOrder.includes(authType2)) {
|
|
111520
|
-
orderedAuthTypes.push(authType2);
|
|
111521
|
-
}
|
|
111522
|
-
}
|
|
111733
|
+
const orderedAuthTypes = authTypeOrder.filter(
|
|
111734
|
+
(t2) => availableAuthTypes.has(t2)
|
|
111735
|
+
);
|
|
111523
111736
|
const result = [];
|
|
111524
111737
|
for (const runtimeModel of runtimeModels) {
|
|
111525
111738
|
result.push({
|
|
@@ -111540,7 +111753,7 @@ function ModelDialog({
|
|
|
111540
111753
|
() => availableModelEntries.map(
|
|
111541
111754
|
({ authType: t2, model, isRuntime, snapshotId }) => {
|
|
111542
111755
|
const value = isRuntime && snapshotId ? snapshotId : buildModelSelectionKey(t2, model.id, model.baseUrl);
|
|
111543
|
-
const isQwenOAuth = t2 ===
|
|
111756
|
+
const isQwenOAuth = t2 === "qwen-oauth" /* QWEN_OAUTH */;
|
|
111544
111757
|
const title = /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(Text, { children: [
|
|
111545
111758
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
111546
111759
|
Text,
|
|
@@ -111709,9 +111922,9 @@ function ModelDialog({
|
|
|
111709
111922
|
onClose();
|
|
111710
111923
|
return;
|
|
111711
111924
|
}
|
|
111712
|
-
const isQwenOAuthSelection = selected.startsWith(`${
|
|
111925
|
+
const isQwenOAuthSelection = selected.startsWith(`${"qwen-oauth" /* QWEN_OAUTH */}::`) || selected.startsWith("$runtime|") && selected.split("|")[1] === "qwen-oauth" /* QWEN_OAUTH */;
|
|
111713
111926
|
const isRuntimeOAuthSelection = selected.startsWith(
|
|
111714
|
-
`$runtime|${
|
|
111927
|
+
`$runtime|${"qwen-oauth" /* QWEN_OAUTH */}|`
|
|
111715
111928
|
);
|
|
111716
111929
|
if (isQwenOAuthSelection && !isRuntimeOAuthSelection) {
|
|
111717
111930
|
setErrorMessage(
|
|
@@ -111749,7 +111962,7 @@ function ModelDialog({
|
|
|
111749
111962
|
selectedBaseUrl = parsed.baseUrl;
|
|
111750
111963
|
}
|
|
111751
111964
|
await config.switchModel(selectedAuthType, modelId, {
|
|
111752
|
-
...selectedAuthType !== authType && selectedAuthType ===
|
|
111965
|
+
...selectedAuthType !== authType && selectedAuthType === "qwen-oauth" /* QWEN_OAUTH */ ? { requireCachedCredentials: true } : {},
|
|
111753
111966
|
baseUrl: selectedBaseUrl
|
|
111754
111967
|
});
|
|
111755
111968
|
if (!isRuntime) {
|
|
@@ -111840,7 +112053,7 @@ ${baseErrorMessage}`);
|
|
|
111840
112053
|
borderColor: theme.border.default
|
|
111841
112054
|
}
|
|
111842
112055
|
),
|
|
111843
|
-
highlightedEntry.authType ===
|
|
112056
|
+
highlightedEntry.authType === "qwen-oauth" /* QWEN_OAUTH */ && !highlightedEntry.isRuntime && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Box_default, { marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(Text, { color: theme.status.warning, children: [
|
|
111844
112057
|
"\u26A0 ",
|
|
111845
112058
|
t("Discontinued \u2014 switch to Coding Plan or API Key")
|
|
111846
112059
|
] }) }),
|
|
@@ -111860,7 +112073,7 @@ ${baseErrorMessage}`);
|
|
|
111860
112073
|
)
|
|
111861
112074
|
}
|
|
111862
112075
|
),
|
|
111863
|
-
highlightedEntry.authType !==
|
|
112076
|
+
highlightedEntry.authType !== "qwen-oauth" /* QWEN_OAUTH */ && /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
|
|
111864
112077
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
111865
112078
|
DetailRow2,
|
|
111866
112079
|
{
|
|
@@ -111905,7 +112118,7 @@ function ArenaStartDialog({
|
|
|
111905
112118
|
const selectableModels = allModels.filter((model) => !model.isRuntimeModel);
|
|
111906
112119
|
return selectableModels.map((model) => {
|
|
111907
112120
|
const token = `${model.authType}:${model.id}`;
|
|
111908
|
-
const isQwenOauth = model.authType ===
|
|
112121
|
+
const isQwenOauth = model.authType === "qwen-oauth" /* QWEN_OAUTH */;
|
|
111909
112122
|
return {
|
|
111910
112123
|
key: token,
|
|
111911
112124
|
value: token,
|
|
@@ -117735,10 +117948,7 @@ function UninstallConfirmStep({
|
|
|
117735
117948
|
}
|
|
117736
117949
|
return /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(Box_default, { flexDirection: "column", gap: 1, children: [
|
|
117737
117950
|
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Text, { color: theme.status.error, children: t('Are you sure you want to uninstall extension "{{name}}"?', {
|
|
117738
|
-
name: getExtensionDisplayName(
|
|
117739
|
-
selectedExtension,
|
|
117740
|
-
getCurrentLanguage()
|
|
117741
|
-
)
|
|
117951
|
+
name: getExtensionDisplayName(selectedExtension, getCurrentLanguage())
|
|
117742
117952
|
}) }),
|
|
117743
117953
|
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Text, { color: theme.status.error, children: t("Note: Uninstall permanently removes this extension.") })
|
|
117744
117954
|
] });
|
|
@@ -126411,7 +126621,7 @@ var DialogManager = /* @__PURE__ */ __name(({
|
|
|
126411
126621
|
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(Box_default, { flexDirection: "column", children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(AuthDialog, {}) });
|
|
126412
126622
|
}
|
|
126413
126623
|
if (uiState.auth.isAuthenticating) {
|
|
126414
|
-
if (uiState.auth.pendingAuthType ===
|
|
126624
|
+
if (uiState.auth.pendingAuthType === "openai" /* USE_OPENAI */ && uiState.auth.externalAuthState) {
|
|
126415
126625
|
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
126416
126626
|
ExternalAuthProgress,
|
|
126417
126627
|
{
|
|
@@ -126425,7 +126635,7 @@ var DialogManager = /* @__PURE__ */ __name(({
|
|
|
126425
126635
|
}
|
|
126426
126636
|
);
|
|
126427
126637
|
}
|
|
126428
|
-
if (uiState.auth.pendingAuthType ===
|
|
126638
|
+
if (uiState.auth.pendingAuthType === "qwen-oauth" /* QWEN_OAUTH */) {
|
|
126429
126639
|
return /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
|
|
126430
126640
|
QwenOAuthProgress,
|
|
126431
126641
|
{
|
|
@@ -126792,6 +127002,7 @@ var PrepareLabel = import_react160.default.memo(_PrepareLabel);
|
|
|
126792
127002
|
// packages/cli/src/ui/components/SuggestionsDisplay.tsx
|
|
126793
127003
|
var import_jsx_runtime156 = __toESM(require_jsx_runtime(), 1);
|
|
126794
127004
|
var MAX_SUGGESTIONS_TO_SHOW = 8;
|
|
127005
|
+
var MIN_DESCRIPTION_WIDTH = 12;
|
|
126795
127006
|
function normalizeDescription(description) {
|
|
126796
127007
|
return description.replace(/\s+/g, " ").trim();
|
|
126797
127008
|
}
|
|
@@ -126822,7 +127033,11 @@ function SuggestionsDisplay({
|
|
|
126822
127033
|
const maxLabelLength = Math.max(
|
|
126823
127034
|
...suggestions.map((s) => getFullLabel(s).length)
|
|
126824
127035
|
);
|
|
126825
|
-
const
|
|
127036
|
+
const describedLabelLengths = suggestions.filter((s) => s.description).map((s) => getFullLabel(s).length);
|
|
127037
|
+
const labelColumnWidth = mode === "slash" ? Math.min(maxLabelLength, Math.floor(width * 0.5)) : describedLabelLengths.length > 0 ? Math.min(
|
|
127038
|
+
Math.max(...describedLabelLengths),
|
|
127039
|
+
Math.max(width - MIN_DESCRIPTION_WIDTH - 2, 1)
|
|
127040
|
+
) : 0;
|
|
126826
127041
|
return /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(Box_default, { flexDirection: "column", width, children: [
|
|
126827
127042
|
scrollOffset > 0 && /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(Text, { color: theme.text.primary, children: "\u25B2" }),
|
|
126828
127043
|
visibleSuggestions.map((suggestion, index) => {
|
|
@@ -126834,7 +127049,7 @@ function SuggestionsDisplay({
|
|
|
126834
127049
|
const isLong = displayLabel.length >= MAX_WIDTH;
|
|
126835
127050
|
const expansionIndicatorWidth = isActive && isLong ? 3 : 0;
|
|
126836
127051
|
const descriptionColumnWidth = Math.max(
|
|
126837
|
-
width -
|
|
127052
|
+
width - labelColumnWidth - 2 - expansionIndicatorWidth,
|
|
126838
127053
|
1
|
|
126839
127054
|
);
|
|
126840
127055
|
const labelElement = /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
@@ -126851,7 +127066,7 @@ function SuggestionsDisplay({
|
|
|
126851
127066
|
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)(
|
|
126852
127067
|
Box_default,
|
|
126853
127068
|
{
|
|
126854
|
-
...mode === "slash" ? { width:
|
|
127069
|
+
...mode === "slash" || suggestion.description ? { width: labelColumnWidth, flexShrink: 0 } : { flexShrink: 1 },
|
|
126855
127070
|
children: /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(Box_default, { children: [
|
|
126856
127071
|
labelElement,
|
|
126857
127072
|
suggestion.argumentHint && /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)(Text, { color: theme.text.secondary, children: [
|
|
@@ -126974,9 +127189,6 @@ function useInputHistory({
|
|
|
126974
127189
|
}
|
|
126975
127190
|
__name(useInputHistory, "useInputHistory");
|
|
126976
127191
|
|
|
126977
|
-
// packages/cli/src/ui/components/InputPrompt.tsx
|
|
126978
|
-
var import_chalk10 = __toESM(require_source(), 1);
|
|
126979
|
-
|
|
126980
127192
|
// packages/cli/src/ui/hooks/useShellHistory.ts
|
|
126981
127193
|
init_esbuild_shims();
|
|
126982
127194
|
var import_react162 = __toESM(require_react(), 1);
|
|
@@ -127317,30 +127529,71 @@ var import_react167 = __toESM(require_react(), 1);
|
|
|
127317
127529
|
// packages/cli/src/ui/hooks/useAtCompletion.ts
|
|
127318
127530
|
init_esbuild_shims();
|
|
127319
127531
|
var import_react165 = __toESM(require_react(), 1);
|
|
127532
|
+
function rankResourceMatch(uri, friendly, query) {
|
|
127533
|
+
if (uri.startsWith(query)) return 0;
|
|
127534
|
+
if (friendly.startsWith(query)) return 1;
|
|
127535
|
+
if (uri.includes(query)) return 2;
|
|
127536
|
+
if (friendly.includes(query)) return 3;
|
|
127537
|
+
return Infinity;
|
|
127538
|
+
}
|
|
127539
|
+
__name(rankResourceMatch, "rankResourceMatch");
|
|
127540
|
+
function rankResourcesToSuggestions(resources, query) {
|
|
127541
|
+
return resources.map((resource) => {
|
|
127542
|
+
const friendly = resource.title || resource.name || "";
|
|
127543
|
+
return {
|
|
127544
|
+
resource,
|
|
127545
|
+
friendly,
|
|
127546
|
+
ref: buildMcpResourceRef(resource.serverName, resource.uri),
|
|
127547
|
+
rank: rankResourceMatch(
|
|
127548
|
+
resource.uri.toLowerCase(),
|
|
127549
|
+
friendly.toLowerCase(),
|
|
127550
|
+
query
|
|
127551
|
+
)
|
|
127552
|
+
};
|
|
127553
|
+
}).filter((m) => m.rank !== Infinity).sort((a, b) => a.rank - b.rank || a.ref.localeCompare(b.ref)).slice(0, MAX_SUGGESTIONS_TO_SHOW * 3).map((m) => ({
|
|
127554
|
+
label: m.ref,
|
|
127555
|
+
value: m.ref,
|
|
127556
|
+
description: m.friendly && m.friendly !== m.resource.uri ? m.friendly : void 0,
|
|
127557
|
+
isDirectory: false
|
|
127558
|
+
}));
|
|
127559
|
+
}
|
|
127560
|
+
__name(rankResourcesToSuggestions, "rankResourcesToSuggestions");
|
|
127320
127561
|
function getMcpResourceSuggestions(config, pattern) {
|
|
127321
127562
|
if (!config) return null;
|
|
127322
127563
|
if (config.isTrustedFolder?.() === false) return null;
|
|
127323
127564
|
const mcpServers = config.getMcpServers?.() || {};
|
|
127324
127565
|
const match = matchMcpServerPrefix(pattern, Object.keys(mcpServers));
|
|
127325
127566
|
if (!match) return null;
|
|
127326
|
-
const
|
|
127327
|
-
|
|
127328
|
-
const resources = config.getResourceRegistry?.()?.getResourcesByServer(serverName) ?? [];
|
|
127329
|
-
const matches = resources.filter((r) => r.uri.includes(partialUri)).sort((a, b) => {
|
|
127330
|
-
const aPrefix = a.uri.startsWith(partialUri) ? 0 : 1;
|
|
127331
|
-
const bPrefix = b.uri.startsWith(partialUri) ? 0 : 1;
|
|
127332
|
-
return aPrefix - bPrefix || a.uri.localeCompare(b.uri);
|
|
127333
|
-
});
|
|
127334
|
-
return matches.slice(0, MAX_SUGGESTIONS_TO_SHOW * 3).map((r) => {
|
|
127335
|
-
const ref = buildMcpResourceRef(serverName, r.uri);
|
|
127336
|
-
return {
|
|
127337
|
-
label: ref,
|
|
127338
|
-
value: ref,
|
|
127339
|
-
isDirectory: false
|
|
127340
|
-
};
|
|
127341
|
-
});
|
|
127567
|
+
const resources = config.getResourceRegistry?.()?.getResourcesByServer(match.serverName) ?? [];
|
|
127568
|
+
return rankResourcesToSuggestions(resources, match.rest.toLowerCase());
|
|
127342
127569
|
}
|
|
127343
127570
|
__name(getMcpResourceSuggestions, "getMcpResourceSuggestions");
|
|
127571
|
+
function getGlobalMcpResourceSuggestions(config, pattern) {
|
|
127572
|
+
if (!config) return [];
|
|
127573
|
+
if (config.isTrustedFolder?.() === false) return [];
|
|
127574
|
+
if (pattern.length === 0) return [];
|
|
127575
|
+
const resources = config.getResourceRegistry?.()?.getAllResources?.() ?? [];
|
|
127576
|
+
return rankResourcesToSuggestions(resources, pattern.toLowerCase());
|
|
127577
|
+
}
|
|
127578
|
+
__name(getGlobalMcpResourceSuggestions, "getGlobalMcpResourceSuggestions");
|
|
127579
|
+
function getMcpServerSuggestions(config, pattern) {
|
|
127580
|
+
if (!config) return [];
|
|
127581
|
+
if (config.isTrustedFolder?.() === false) return [];
|
|
127582
|
+
if (pattern.length === 0) return [];
|
|
127583
|
+
const registry2 = config.getResourceRegistry?.();
|
|
127584
|
+
if (!registry2) return [];
|
|
127585
|
+
const mcpServers = config.getMcpServers?.() || {};
|
|
127586
|
+
const query = pattern.toLowerCase();
|
|
127587
|
+
return Object.keys(mcpServers).filter(
|
|
127588
|
+
(name) => name.toLowerCase().startsWith(query) && (registry2.getResourcesByServer(name)?.length ?? 0) > 0
|
|
127589
|
+
).sort((a, b) => a.localeCompare(b)).map((name) => ({
|
|
127590
|
+
label: `${name}:`,
|
|
127591
|
+
value: `${name}:`,
|
|
127592
|
+
description: t("MCP resource server"),
|
|
127593
|
+
isDirectory: true
|
|
127594
|
+
}));
|
|
127595
|
+
}
|
|
127596
|
+
__name(getMcpServerSuggestions, "getMcpServerSuggestions");
|
|
127344
127597
|
var initialState = {
|
|
127345
127598
|
status: "idle" /* IDLE */,
|
|
127346
127599
|
suggestions: [],
|
|
@@ -127482,7 +127735,22 @@ function useAtCompletion(props) {
|
|
|
127482
127735
|
dispatch({ type: "SEARCH_SUCCESS", payload: resourceSuggestions });
|
|
127483
127736
|
return;
|
|
127484
127737
|
}
|
|
127738
|
+
const serverSuggestions = getMcpServerSuggestions(config, state2.pattern);
|
|
127739
|
+
const globalResourceSuggestions = getGlobalMcpResourceSuggestions(
|
|
127740
|
+
config,
|
|
127741
|
+
state2.pattern
|
|
127742
|
+
);
|
|
127743
|
+
const mcpSuggestions = [
|
|
127744
|
+
...serverSuggestions,
|
|
127745
|
+
...globalResourceSuggestions
|
|
127746
|
+
];
|
|
127485
127747
|
if (!fileSearch.current) {
|
|
127748
|
+
if (mcpSuggestions.length > 0) {
|
|
127749
|
+
if (slowSearchTimer.current) {
|
|
127750
|
+
clearTimeout(slowSearchTimer.current);
|
|
127751
|
+
}
|
|
127752
|
+
dispatch({ type: "SEARCH_SUCCESS", payload: mcpSuggestions });
|
|
127753
|
+
}
|
|
127486
127754
|
return;
|
|
127487
127755
|
}
|
|
127488
127756
|
if (slowSearchTimer.current) {
|
|
@@ -127504,15 +127772,22 @@ function useAtCompletion(props) {
|
|
|
127504
127772
|
if (controller.signal.aborted) {
|
|
127505
127773
|
return;
|
|
127506
127774
|
}
|
|
127507
|
-
const
|
|
127775
|
+
const fileSuggestions = results.map((p) => ({
|
|
127508
127776
|
label: p,
|
|
127509
127777
|
value: escapePath(p),
|
|
127510
127778
|
isDirectory: p.endsWith("/")
|
|
127511
127779
|
}));
|
|
127512
|
-
dispatch({
|
|
127780
|
+
dispatch({
|
|
127781
|
+
type: "SEARCH_SUCCESS",
|
|
127782
|
+
payload: [...mcpSuggestions, ...fileSuggestions]
|
|
127783
|
+
});
|
|
127513
127784
|
} catch (error) {
|
|
127514
127785
|
if (!(error instanceof Error && error.name === "AbortError")) {
|
|
127515
|
-
|
|
127786
|
+
if (mcpSuggestions.length > 0) {
|
|
127787
|
+
dispatch({ type: "SEARCH_SUCCESS", payload: mcpSuggestions });
|
|
127788
|
+
} else {
|
|
127789
|
+
dispatch({ type: "ERROR" });
|
|
127790
|
+
}
|
|
127516
127791
|
}
|
|
127517
127792
|
}
|
|
127518
127793
|
}, "search");
|
|
@@ -129122,7 +129397,6 @@ var FeedbackDialog = /* @__PURE__ */ __name(() => {
|
|
|
129122
129397
|
// packages/cli/src/ui/components/BaseTextInput.tsx
|
|
129123
129398
|
init_esbuild_shims();
|
|
129124
129399
|
var import_react174 = __toESM(require_react(), 1);
|
|
129125
|
-
var import_chalk9 = __toESM(require_source(), 1);
|
|
129126
129400
|
var import_jsx_runtime159 = __toESM(require_jsx_runtime(), 1);
|
|
129127
129401
|
function defaultRenderLine({
|
|
129128
129402
|
lineText,
|
|
@@ -129137,7 +129411,7 @@ function defaultRenderLine({
|
|
|
129137
129411
|
if (cursorCol >= len) {
|
|
129138
129412
|
return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(Text, { children: [
|
|
129139
129413
|
lineText,
|
|
129140
|
-
|
|
129414
|
+
renderSoftwareCursor(" ") + "\u200B"
|
|
129141
129415
|
] });
|
|
129142
129416
|
}
|
|
129143
129417
|
const before = cpSlice(lineText, 0, cursorCol);
|
|
@@ -129145,18 +129419,49 @@ function defaultRenderLine({
|
|
|
129145
129419
|
const after = cpSlice(lineText, cursorCol + 1);
|
|
129146
129420
|
return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(Text, { children: [
|
|
129147
129421
|
before,
|
|
129148
|
-
|
|
129422
|
+
renderSoftwareCursor(cursorChar),
|
|
129149
129423
|
after
|
|
129150
129424
|
] });
|
|
129151
129425
|
}
|
|
129152
129426
|
__name(defaultRenderLine, "defaultRenderLine");
|
|
129153
|
-
function
|
|
129427
|
+
function getAbsolutePosition(node) {
|
|
129154
129428
|
if (!node) return void 0;
|
|
129155
|
-
|
|
129156
|
-
|
|
129157
|
-
|
|
129429
|
+
let top2 = 0;
|
|
129430
|
+
let left2 = 0;
|
|
129431
|
+
let current = node;
|
|
129432
|
+
while (current) {
|
|
129433
|
+
const layout = current.yogaNode?.getComputedLayout();
|
|
129434
|
+
if (layout) {
|
|
129435
|
+
top2 += layout.top;
|
|
129436
|
+
left2 += layout.left;
|
|
129437
|
+
}
|
|
129438
|
+
current = current.parentNode;
|
|
129439
|
+
}
|
|
129440
|
+
return { top: top2, left: left2 };
|
|
129441
|
+
}
|
|
129442
|
+
__name(getAbsolutePosition, "getAbsolutePosition");
|
|
129443
|
+
function getPhysicalCursorPosition(node, {
|
|
129444
|
+
hasMeasured,
|
|
129445
|
+
showCursor,
|
|
129446
|
+
cursorVisualRow,
|
|
129447
|
+
cursorVisualCol,
|
|
129448
|
+
scrollVisualRow,
|
|
129449
|
+
linesToRender,
|
|
129450
|
+
prefixWidth
|
|
129451
|
+
}) {
|
|
129452
|
+
if (!showCursor || !hasMeasured) return void 0;
|
|
129453
|
+
const position = getAbsolutePosition(node);
|
|
129454
|
+
if (!position) return void 0;
|
|
129455
|
+
const relativeRow = cursorVisualRow - scrollVisualRow;
|
|
129456
|
+
const lineText = linesToRender[relativeRow] || "";
|
|
129457
|
+
const textBeforeCursor = cpSlice(lineText, 0, cursorVisualCol);
|
|
129458
|
+
const physicalCol = stringWidth2(textBeforeCursor);
|
|
129459
|
+
return {
|
|
129460
|
+
x: position.left + prefixWidth + physicalCol,
|
|
129461
|
+
y: position.top + relativeRow + 1
|
|
129462
|
+
};
|
|
129158
129463
|
}
|
|
129159
|
-
__name(
|
|
129464
|
+
__name(getPhysicalCursorPosition, "getPhysicalCursorPosition");
|
|
129160
129465
|
var BaseTextInput = /* @__PURE__ */ __name(({
|
|
129161
129466
|
buffer,
|
|
129162
129467
|
onSubmit,
|
|
@@ -129241,9 +129546,11 @@ var BaseTextInput = /* @__PURE__ */ __name(({
|
|
|
129241
129546
|
const linesToRender = buffer.viewportVisualLines;
|
|
129242
129547
|
const [cursorVisualRow, cursorVisualCol] = buffer.visualCursor;
|
|
129243
129548
|
const scrollVisualRow = buffer.visualScrollRow;
|
|
129244
|
-
const
|
|
129245
|
-
const
|
|
129246
|
-
const
|
|
129549
|
+
const boxRef = (0, import_react174.useRef)(null);
|
|
129550
|
+
const { hasMeasured } = use_box_metrics_default(boxRef);
|
|
129551
|
+
const { setCursorPosition } = use_cursor_default();
|
|
129552
|
+
const cursorPosition = getPhysicalCursorPosition(boxRef.current, {
|
|
129553
|
+
hasMeasured,
|
|
129247
129554
|
showCursor,
|
|
129248
129555
|
cursorVisualRow,
|
|
129249
129556
|
cursorVisualCol,
|
|
@@ -129251,65 +129558,17 @@ var BaseTextInput = /* @__PURE__ */ __name(({
|
|
|
129251
129558
|
linesToRender,
|
|
129252
129559
|
prefixWidth
|
|
129253
129560
|
});
|
|
129254
|
-
|
|
129255
|
-
|
|
129256
|
-
|
|
129257
|
-
|
|
129258
|
-
scrollVisualRow,
|
|
129259
|
-
linesToRender,
|
|
129260
|
-
prefixWidth
|
|
129261
|
-
};
|
|
129262
|
-
(0, import_react174.useEffect)(() => {
|
|
129263
|
-
const rootNode = findRootNode2(rootRef.current);
|
|
129264
|
-
if (!rootNode) return;
|
|
129265
|
-
const unsub = addLayoutListener(rootNode, () => {
|
|
129266
|
-
const {
|
|
129267
|
-
showCursor: sc,
|
|
129268
|
-
cursorVisualRow: vr,
|
|
129269
|
-
cursorVisualCol: vc,
|
|
129270
|
-
scrollVisualRow: sr,
|
|
129271
|
-
linesToRender: lt,
|
|
129272
|
-
prefixWidth: pw
|
|
129273
|
-
} = stateRef.current;
|
|
129274
|
-
if (!sc) {
|
|
129275
|
-
cursorCtx.setCursorPosition(void 0);
|
|
129276
|
-
return;
|
|
129277
|
-
}
|
|
129278
|
-
const node = rootRef.current;
|
|
129279
|
-
if (!node) return;
|
|
129280
|
-
let absTop = 0;
|
|
129281
|
-
let absLeft = 0;
|
|
129282
|
-
let n = node;
|
|
129283
|
-
while (n) {
|
|
129284
|
-
const nd = n;
|
|
129285
|
-
const layout = nd.yogaNode?.getComputedLayout();
|
|
129286
|
-
if (layout) {
|
|
129287
|
-
absTop += layout.top;
|
|
129288
|
-
absLeft += layout.left;
|
|
129289
|
-
}
|
|
129290
|
-
n = nd.parentNode;
|
|
129291
|
-
}
|
|
129292
|
-
const relativeRow = vr - sr;
|
|
129293
|
-
const lineText = lt[relativeRow] || "";
|
|
129294
|
-
const textBeforeCursor = cpSlice(lineText, 0, vc);
|
|
129295
|
-
const physicalCol = stringWidth2(textBeforeCursor);
|
|
129296
|
-
cursorCtx.setCursorPosition({
|
|
129297
|
-
x: absLeft + pw + physicalCol,
|
|
129298
|
-
y: absTop + relativeRow + 1
|
|
129299
|
-
});
|
|
129300
|
-
});
|
|
129301
|
-
return () => {
|
|
129302
|
-
unsub();
|
|
129303
|
-
cursorCtx.setCursorPosition(void 0);
|
|
129304
|
-
};
|
|
129305
|
-
}, [cursorCtx]);
|
|
129561
|
+
(0, import_react174.useInsertionEffect)(() => {
|
|
129562
|
+
setCursorPosition(cursorPosition);
|
|
129563
|
+
return () => setCursorPosition(void 0);
|
|
129564
|
+
}, [setCursorPosition, cursorPosition]);
|
|
129306
129565
|
const resolvedBorderColor = borderColor ?? theme.border.focused;
|
|
129307
129566
|
const resolvedPrefix = prefix ?? /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Text, { color: theme.text.accent, children: "> " });
|
|
129308
129567
|
const columns = process.stdout.columns || 80;
|
|
129309
129568
|
const labelWidth = topRightLabel ? stringWidth2(topRightLabel) + 4 : 0;
|
|
129310
129569
|
const dashCount = Math.max(1, columns - labelWidth);
|
|
129311
129570
|
const topBorderLine = topRightLabel ? `${"\u2500".repeat(dashCount)} ${topRightLabel} ${"\u2500".repeat(2)}` : "\u2500".repeat(columns);
|
|
129312
|
-
return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(Box_default, { ref:
|
|
129571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(Box_default, { ref: boxRef, flexDirection: "column", children: [
|
|
129313
129572
|
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Text, { color: resolvedBorderColor, wrap: "truncate-end", children: topBorderLine }),
|
|
129314
129573
|
/* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(
|
|
129315
129574
|
Box_default,
|
|
@@ -129322,31 +129581,23 @@ var BaseTextInput = /* @__PURE__ */ __name(({
|
|
|
129322
129581
|
borderColor: resolvedBorderColor,
|
|
129323
129582
|
children: [
|
|
129324
129583
|
resolvedPrefix,
|
|
129325
|
-
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
|
|
129326
|
-
|
|
129327
|
-
{
|
|
129328
|
-
|
|
129329
|
-
|
|
129330
|
-
|
|
129331
|
-
|
|
129332
|
-
|
|
129333
|
-
|
|
129334
|
-
|
|
129335
|
-
|
|
129336
|
-
|
|
129337
|
-
|
|
129338
|
-
|
|
129339
|
-
|
|
129340
|
-
|
|
129341
|
-
|
|
129342
|
-
visualLineIndex: idx,
|
|
129343
|
-
absoluteVisualIndex,
|
|
129344
|
-
buffer,
|
|
129345
|
-
scrollVisualRow
|
|
129346
|
-
}) }, idx);
|
|
129347
|
-
})
|
|
129348
|
-
}
|
|
129349
|
-
)
|
|
129584
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Box_default, { flexGrow: 1, flexDirection: "column", children: buffer.text.length === 0 && placeholder ? showCursor ? /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(Text, { children: [
|
|
129585
|
+
renderSoftwareCursor(placeholder.slice(0, 1)),
|
|
129586
|
+
/* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Text, { color: theme.text.secondary, children: placeholder.slice(1) })
|
|
129587
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Text, { color: theme.text.secondary, children: placeholder }) : linesToRender.map((lineText, idx) => {
|
|
129588
|
+
const absoluteVisualIndex = scrollVisualRow + idx;
|
|
129589
|
+
const isOnCursorLine = absoluteVisualIndex === cursorVisualRow;
|
|
129590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(Box_default, { height: 1, children: renderLine({
|
|
129591
|
+
lineText,
|
|
129592
|
+
isOnCursorLine,
|
|
129593
|
+
cursorCol: cursorVisualCol,
|
|
129594
|
+
showCursor,
|
|
129595
|
+
visualLineIndex: idx,
|
|
129596
|
+
absoluteVisualIndex,
|
|
129597
|
+
buffer,
|
|
129598
|
+
scrollVisualRow
|
|
129599
|
+
}) }, idx);
|
|
129600
|
+
}) })
|
|
129350
129601
|
]
|
|
129351
129602
|
}
|
|
129352
129603
|
)
|
|
@@ -132385,7 +132636,7 @@ ${currentText}`);
|
|
|
132385
132636
|
cursorVisualColAbsolute - segStart,
|
|
132386
132637
|
cursorVisualColAbsolute - segStart + 1
|
|
132387
132638
|
);
|
|
132388
|
-
const highlighted = showCursorOpt ?
|
|
132639
|
+
const highlighted = showCursorOpt ? renderSoftwareCursor(charToHighlight) : charToHighlight;
|
|
132389
132640
|
display = cpSlice(seg.text, 0, cursorVisualColAbsolute - segStart) + highlighted + cpSlice(seg.text, cursorVisualColAbsolute - segStart + 1);
|
|
132390
132641
|
}
|
|
132391
132642
|
charCount = segEnd;
|
|
@@ -132400,7 +132651,7 @@ ${currentText}`);
|
|
|
132400
132651
|
if (ghostText && showCursorOpt && ghostText.text.length > 0) {
|
|
132401
132652
|
if (ghostText.showCursorBeforeText) {
|
|
132402
132653
|
renderedLine.push(
|
|
132403
|
-
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)(Text, { children:
|
|
132654
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)(Text, { children: renderSoftwareCursor(" ") }, "ghost-cursor")
|
|
132404
132655
|
);
|
|
132405
132656
|
renderedLine.push(
|
|
132406
132657
|
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)(Text, { color: theme.text.secondary, children: ghostText.text }, "ghost-rest")
|
|
@@ -132409,7 +132660,7 @@ ${currentText}`);
|
|
|
132409
132660
|
const firstChar = ghostText.text[0];
|
|
132410
132661
|
const rest = ghostText.text.slice(firstChar.length);
|
|
132411
132662
|
renderedLine.push(
|
|
132412
|
-
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)(Text, { children:
|
|
132663
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)(Text, { children: renderSoftwareCursor(firstChar) }, "ghost-cursor")
|
|
132413
132664
|
);
|
|
132414
132665
|
if (rest.length > 0) {
|
|
132415
132666
|
renderedLine.push(
|
|
@@ -132420,7 +132671,7 @@ ${currentText}`);
|
|
|
132420
132671
|
renderedLine.push(/* @__PURE__ */ (0, import_jsx_runtime161.jsx)(Text, { children: `\u200B` }, "ghost-zwsp"));
|
|
132421
132672
|
} else {
|
|
132422
132673
|
renderedLine.push(
|
|
132423
|
-
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)(Text, { children: showCursorOpt ?
|
|
132674
|
+
/* @__PURE__ */ (0, import_jsx_runtime161.jsx)(Text, { children: showCursorOpt ? renderSoftwareCursor(" ") + "\u200B" : " \u200B" }, `cursor-end-${cursorVisualColAbsolute}`)
|
|
132424
132675
|
);
|
|
132425
132676
|
}
|
|
132426
132677
|
}
|
|
@@ -137530,6 +137781,34 @@ import process36 from "node:process";
|
|
|
137530
137781
|
var debugLogger78 = createDebugLogger("GEMINI_STREAM");
|
|
137531
137782
|
var MID_TURN_AT_COMMAND_RESOLVE_TIMEOUT_MS = 1e4;
|
|
137532
137783
|
var MID_TURN_AT_COMMAND_RESOLVE_TIMEOUT_MESSAGE = "Mid-turn @ command resolution timed out";
|
|
137784
|
+
var VISION_BRIDGE_TRANSCRIPT_NOTICE_LIMIT = 2048;
|
|
137785
|
+
var TERMINAL_CONTROL_CHARS = /[\u0000-\u0008\u000B-\u001F\u007F-\u009F]/g;
|
|
137786
|
+
function truncateVisionBridgeTranscript(transcript) {
|
|
137787
|
+
const safe = transcript.replace(TERMINAL_CONTROL_CHARS, "");
|
|
137788
|
+
if (safe.length <= VISION_BRIDGE_TRANSCRIPT_NOTICE_LIMIT) {
|
|
137789
|
+
return safe;
|
|
137790
|
+
}
|
|
137791
|
+
return `${safe.slice(0, VISION_BRIDGE_TRANSCRIPT_NOTICE_LIMIT).trimEnd()}
|
|
137792
|
+
[Transcript truncated]`;
|
|
137793
|
+
}
|
|
137794
|
+
__name(truncateVisionBridgeTranscript, "truncateVisionBridgeTranscript");
|
|
137795
|
+
function formatVisionBridgeNotice(result) {
|
|
137796
|
+
const modelName = result.modelId ?? "vision model";
|
|
137797
|
+
const target = result.modelEndpoint ? `${modelName} (${result.modelEndpoint})` : modelName;
|
|
137798
|
+
const egressNote = result.egressOccurred ? ` Your image and prompt/context were sent to ${target}.` : "";
|
|
137799
|
+
if (result.status === "failed") {
|
|
137800
|
+
const reason = result.egressOccurred ? "the vision model request failed" : "the vision bridge could not run";
|
|
137801
|
+
return `\u26A0 Vision bridge (${modelName}) failed: ${reason}.${egressNote} The image was not interpreted.`;
|
|
137802
|
+
}
|
|
137803
|
+
if (result.status === "skipped") {
|
|
137804
|
+
return `\u{1F50E} Vision bridge cancelled.${egressNote}`;
|
|
137805
|
+
}
|
|
137806
|
+
const omitted = result.omittedCount > 0 ? ` (${result.omittedCount} image(s) omitted)` : "";
|
|
137807
|
+
const header = `\u{1F50E} Converted ${result.convertedCount} image(s)${omitted} to text via ${target}. Your image and prompt/context were sent to that model.`;
|
|
137808
|
+
return result.transcript ? `${header}
|
|
137809
|
+
${truncateVisionBridgeTranscript(result.transcript)}` : header;
|
|
137810
|
+
}
|
|
137811
|
+
__name(formatVisionBridgeNotice, "formatVisionBridgeNotice");
|
|
137533
137812
|
function extractLastAssistantText(history) {
|
|
137534
137813
|
for (let i = history.length - 1; i >= 0; i--) {
|
|
137535
137814
|
const item = history[i];
|
|
@@ -137933,6 +138212,36 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
137933
138212
|
config,
|
|
137934
138213
|
getPromptCount
|
|
137935
138214
|
]);
|
|
138215
|
+
const applyVisionBridgeIfNeeded = (0, import_react211.useCallback)(
|
|
138216
|
+
async (parts, timestamp, signal) => {
|
|
138217
|
+
if (parts === null || !hasImageParts(parts) || !shouldRunVisionBridge(config)) {
|
|
138218
|
+
return { parts, shouldProceed: true };
|
|
138219
|
+
}
|
|
138220
|
+
debugLogger78.debug("vision bridge: gate matched, running conversion");
|
|
138221
|
+
const bridgeResult = await runVisionBridge({ config, parts, signal });
|
|
138222
|
+
debugLogger78.debug(
|
|
138223
|
+
`vision bridge: status=${bridgeResult.status} applied=${bridgeResult.applied} model=${bridgeResult.modelId ?? "(none)"}`
|
|
138224
|
+
);
|
|
138225
|
+
if (bridgeResult.status !== "skipped" || bridgeResult.egressOccurred) {
|
|
138226
|
+
addItem(
|
|
138227
|
+
{
|
|
138228
|
+
type: bridgeResult.status === "failed" ? "error" /* ERROR */ : "info" /* INFO */,
|
|
138229
|
+
text: formatVisionBridgeNotice(bridgeResult)
|
|
138230
|
+
},
|
|
138231
|
+
timestamp
|
|
138232
|
+
);
|
|
138233
|
+
}
|
|
138234
|
+
if (signal.aborted) {
|
|
138235
|
+
return { parts: null, shouldProceed: false };
|
|
138236
|
+
}
|
|
138237
|
+
if (bridgeResult.applied && bridgeResult.parts != null) {
|
|
138238
|
+
return { parts: bridgeResult.parts, shouldProceed: true };
|
|
138239
|
+
}
|
|
138240
|
+
const textOnly = splitImageParts(parts).nonImageParts;
|
|
138241
|
+
return textOnly.length > 0 ? { parts: textOnly, shouldProceed: true } : { parts: null, shouldProceed: false };
|
|
138242
|
+
},
|
|
138243
|
+
[addItem, config]
|
|
138244
|
+
);
|
|
137936
138245
|
const prepareQueryForGemini = (0, import_react211.useCallback)(
|
|
137937
138246
|
async (query, userMessageTimestamp, abortSignal, prompt_id, submitType) => {
|
|
137938
138247
|
if (turnCancelledRef.current) {
|
|
@@ -138025,6 +138334,15 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
138025
138334
|
}
|
|
138026
138335
|
localQueryToSendToGemini = atCommandResult.processedQuery;
|
|
138027
138336
|
}
|
|
138337
|
+
const bridgeResult = await applyVisionBridgeIfNeeded(
|
|
138338
|
+
localQueryToSendToGemini,
|
|
138339
|
+
userMessageTimestamp,
|
|
138340
|
+
abortSignal
|
|
138341
|
+
);
|
|
138342
|
+
if (!bridgeResult.shouldProceed) {
|
|
138343
|
+
return { queryToSend: null, shouldProceed: false };
|
|
138344
|
+
}
|
|
138345
|
+
localQueryToSendToGemini = bridgeResult.parts;
|
|
138028
138346
|
} else {
|
|
138029
138347
|
localQueryToSendToGemini = query;
|
|
138030
138348
|
}
|
|
@@ -138044,7 +138362,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
138044
138362
|
handleSlashCommand2,
|
|
138045
138363
|
logger3,
|
|
138046
138364
|
shellModeActive,
|
|
138047
|
-
scheduleToolCalls
|
|
138365
|
+
scheduleToolCalls,
|
|
138366
|
+
applyVisionBridgeIfNeeded
|
|
138048
138367
|
]
|
|
138049
138368
|
);
|
|
138050
138369
|
const handleContentEvent = (0, import_react211.useCallback)(
|
|
@@ -139274,7 +139593,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
139274
139593
|
);
|
|
139275
139594
|
}
|
|
139276
139595
|
if (atCommandResult.recording) {
|
|
139277
|
-
config.getChatRecordingService()?.recordAtCommand?.({
|
|
139596
|
+
config.getChatRecordingService?.()?.recordAtCommand?.({
|
|
139278
139597
|
filesRead: atCommandResult.recording.filesRead,
|
|
139279
139598
|
status: atCommandResult.recording.status,
|
|
139280
139599
|
...atCommandResult.recording.message ? { message: atCommandResult.recording.message } : {},
|
|
@@ -139306,6 +139625,18 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
139306
139625
|
break;
|
|
139307
139626
|
}
|
|
139308
139627
|
}
|
|
139628
|
+
const bridgeResult = await applyVisionBridgeIfNeeded(
|
|
139629
|
+
resolvedMidTurnQuery,
|
|
139630
|
+
midTurnTimestamp + index,
|
|
139631
|
+
midTurnAbort.signal
|
|
139632
|
+
);
|
|
139633
|
+
if (!bridgeResult.shouldProceed) {
|
|
139634
|
+
if (midTurnAbort.signal.aborted) {
|
|
139635
|
+
break;
|
|
139636
|
+
}
|
|
139637
|
+
continue;
|
|
139638
|
+
}
|
|
139639
|
+
resolvedMidTurnQuery = bridgeResult.parts ?? resolvedMidTurnQuery;
|
|
139309
139640
|
const midTurnUserMessageParts = prefixMidTurnUserMessageParts(
|
|
139310
139641
|
resolvedMidTurnQuery,
|
|
139311
139642
|
msg
|
|
@@ -139323,7 +139654,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
139323
139654
|
);
|
|
139324
139655
|
}
|
|
139325
139656
|
responsesToSend.push(...midTurnUserMessageParts);
|
|
139326
|
-
config.getChatRecordingService()?.recordMidTurnUserMessage(midTurnUserMessageParts, msg);
|
|
139657
|
+
config.getChatRecordingService?.()?.recordMidTurnUserMessage(midTurnUserMessageParts, msg);
|
|
139327
139658
|
addItem({ type: "notification" /* NOTIFICATION */, text: msg }, Date.now());
|
|
139328
139659
|
}
|
|
139329
139660
|
} finally {
|
|
@@ -139348,7 +139679,8 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
139348
139679
|
midTurnDrainRef,
|
|
139349
139680
|
addItem,
|
|
139350
139681
|
dualOutput,
|
|
139351
|
-
onDebugMessage
|
|
139682
|
+
onDebugMessage,
|
|
139683
|
+
applyVisionBridgeIfNeeded
|
|
139352
139684
|
]
|
|
139353
139685
|
);
|
|
139354
139686
|
const pendingHistoryItems = (0, import_react211.useMemo)(
|
|
@@ -143033,10 +143365,10 @@ var applyOptions2 = /* @__PURE__ */ __name((object, options = {}) => {
|
|
|
143033
143365
|
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
143034
143366
|
}, "applyOptions");
|
|
143035
143367
|
var chalkFactory2 = /* @__PURE__ */ __name((options) => {
|
|
143036
|
-
const
|
|
143037
|
-
applyOptions2(
|
|
143038
|
-
Object.setPrototypeOf(
|
|
143039
|
-
return
|
|
143368
|
+
const chalk6 = /* @__PURE__ */ __name((...strings) => strings.join(" "), "chalk");
|
|
143369
|
+
applyOptions2(chalk6, options);
|
|
143370
|
+
Object.setPrototypeOf(chalk6, createChalk2.prototype);
|
|
143371
|
+
return chalk6;
|
|
143040
143372
|
}, "chalkFactory");
|
|
143041
143373
|
function createChalk2(options) {
|
|
143042
143374
|
return chalkFactory2(options);
|
|
@@ -143157,9 +143489,9 @@ var applyStyle2 = /* @__PURE__ */ __name((self2, string) => {
|
|
|
143157
143489
|
return openAll + string + closeAll;
|
|
143158
143490
|
}, "applyStyle");
|
|
143159
143491
|
Object.defineProperties(createChalk2.prototype, styles8);
|
|
143160
|
-
var
|
|
143492
|
+
var chalk5 = createChalk2();
|
|
143161
143493
|
var chalkStderr2 = createChalk2({ level: stderrColor2 ? stderrColor2.level : 0 });
|
|
143162
|
-
var source_default2 =
|
|
143494
|
+
var source_default2 = chalk5;
|
|
143163
143495
|
|
|
143164
143496
|
// node_modules/update-notifier/update-notifier.js
|
|
143165
143497
|
var import_diff3 = __toESM(require_diff(), 1);
|
|
@@ -151309,7 +151641,7 @@ init_esbuild_shims();
|
|
|
151309
151641
|
function buildAuthMethods() {
|
|
151310
151642
|
return [
|
|
151311
151643
|
{
|
|
151312
|
-
id:
|
|
151644
|
+
id: "openai" /* USE_OPENAI */,
|
|
151313
151645
|
name: "Use OpenAI API key",
|
|
151314
151646
|
description: "Requires setting the `OPENAI_API_KEY` environment variable",
|
|
151315
151647
|
_meta: {
|
|
@@ -151384,7 +151716,7 @@ var AcpFileSystemService = class {
|
|
|
151384
151716
|
if (!this.capabilities.writeTextFile) {
|
|
151385
151717
|
return this.fallback.writeTextFile(params);
|
|
151386
151718
|
}
|
|
151387
|
-
const finalContent = params._meta?.["bom"] ? "\uFEFF" + params.content : params.content;
|
|
151719
|
+
const finalContent = params._meta?.["bom"] && params.content.charCodeAt(0) !== 65279 ? "\uFEFF" + params.content : params.content;
|
|
151388
151720
|
await this.connection.writeTextFile({
|
|
151389
151721
|
...params,
|
|
151390
151722
|
content: finalContent,
|
|
@@ -152593,7 +152925,7 @@ var Session2 = class {
|
|
|
152593
152925
|
);
|
|
152594
152926
|
await this.historyReplayer.replay(records);
|
|
152595
152927
|
}
|
|
152596
|
-
rewindToTurn(targetTurnIndex) {
|
|
152928
|
+
rewindToTurn(targetTurnIndex, opts) {
|
|
152597
152929
|
if (!Number.isInteger(targetTurnIndex) || targetTurnIndex < 0) {
|
|
152598
152930
|
throw RequestError.invalidParams(
|
|
152599
152931
|
void 0,
|
|
@@ -152620,9 +152952,12 @@ var Session2 = class {
|
|
|
152620
152952
|
}
|
|
152621
152953
|
chat.truncateHistory(apiTruncateIndex);
|
|
152622
152954
|
chat.stripThoughtsFromHistory();
|
|
152955
|
+
const rewindFiles = opts?.rewindFiles !== false;
|
|
152623
152956
|
const fileHistoryService = this.config.getFileHistoryService();
|
|
152624
|
-
const survivingSnapshots = fileHistoryService.getSnapshots().slice(0, targetTurnIndex + 1);
|
|
152625
|
-
|
|
152957
|
+
const survivingSnapshots = rewindFiles ? fileHistoryService.getSnapshots().slice(0, targetTurnIndex + 1) : void 0;
|
|
152958
|
+
if (survivingSnapshots) {
|
|
152959
|
+
fileHistoryService.restoreFromSnapshots(survivingSnapshots);
|
|
152960
|
+
}
|
|
152626
152961
|
this.config.getChatRecordingService()?.rewindRecording(
|
|
152627
152962
|
targetTurnIndex,
|
|
152628
152963
|
{ truncatedCount: Math.max(0, apiHistory.length - apiTruncateIndex) },
|
|
@@ -152633,6 +152968,17 @@ var Session2 = class {
|
|
|
152633
152968
|
captureHistorySnapshot() {
|
|
152634
152969
|
return this.config.getGeminiClient().getChat().getHistoryShallow();
|
|
152635
152970
|
}
|
|
152971
|
+
getRewindableUserTurnCount() {
|
|
152972
|
+
const apiHistory = this.captureHistorySnapshot();
|
|
152973
|
+
const startIndex = getStartupContextLength(apiHistory);
|
|
152974
|
+
let count = 0;
|
|
152975
|
+
for (let i = startIndex; i < apiHistory.length; i++) {
|
|
152976
|
+
if (this.#isUserTextContent(apiHistory[i])) {
|
|
152977
|
+
count += 1;
|
|
152978
|
+
}
|
|
152979
|
+
}
|
|
152980
|
+
return count;
|
|
152981
|
+
}
|
|
152636
152982
|
restoreHistory(history) {
|
|
152637
152983
|
if (this.pendingPrompt || this.cronProcessing || this.cronAbortController || this.notificationProcessing || this.notificationAbortController) {
|
|
152638
152984
|
throw RequestError.invalidParams(
|
|
@@ -154184,7 +154530,7 @@ ${this.pendingWorktreeNotice}
|
|
|
154184
154530
|
await this.config.switchModel(
|
|
154185
154531
|
selectedAuthType,
|
|
154186
154532
|
parsed.modelId,
|
|
154187
|
-
selectedAuthType !== previousAuthType && selectedAuthType ===
|
|
154533
|
+
selectedAuthType !== previousAuthType && selectedAuthType === "qwen-oauth" /* QWEN_OAUTH */ ? { requireCachedCredentials: true } : void 0
|
|
154188
154534
|
);
|
|
154189
154535
|
const after = this.config.getContentGeneratorConfig?.();
|
|
154190
154536
|
const effectiveAuthType = after?.authType ?? selectedAuthType;
|
|
@@ -155144,6 +155490,7 @@ ${this.pendingWorktreeNotice}
|
|
|
155144
155490
|
if (!("outputHistoryItems" in result)) {
|
|
155145
155491
|
return;
|
|
155146
155492
|
}
|
|
155493
|
+
let hasActiveGoalStatus = false;
|
|
155147
155494
|
for (const item of result.outputHistoryItems ?? []) {
|
|
155148
155495
|
if (item.type === "goal_status" /* GOAL_STATUS */) {
|
|
155149
155496
|
this.emitGoalStatus({
|
|
@@ -155154,8 +155501,14 @@ ${this.pendingWorktreeNotice}
|
|
|
155154
155501
|
...item.durationMs !== void 0 ? { durationMs: item.durationMs } : {},
|
|
155155
155502
|
...item.lastReason !== void 0 ? { lastReason: item.lastReason } : {}
|
|
155156
155503
|
});
|
|
155504
|
+
if (!isTerminalGoalStatusKind(item.kind)) {
|
|
155505
|
+
hasActiveGoalStatus = true;
|
|
155506
|
+
}
|
|
155157
155507
|
}
|
|
155158
155508
|
}
|
|
155509
|
+
if (hasActiveGoalStatus) {
|
|
155510
|
+
this.#installGoalTerminalObserver();
|
|
155511
|
+
}
|
|
155159
155512
|
}
|
|
155160
155513
|
/**
|
|
155161
155514
|
* Processes the result of a slash command execution.
|
|
@@ -156274,10 +156627,8 @@ function readProviderModels(settings, protocol) {
|
|
|
156274
156627
|
const modelProviders = toRecord(
|
|
156275
156628
|
settings.merged["modelProviders"]
|
|
156276
156629
|
);
|
|
156277
|
-
const
|
|
156278
|
-
|
|
156279
|
-
const models = Array.isArray(entry) ? entry : Array.isArray(entryRecord?.["models"]) ? entryRecord["models"] : [];
|
|
156280
|
-
return models.filter(isProviderModelConfig);
|
|
156630
|
+
const models = modelProviders[protocol];
|
|
156631
|
+
return Array.isArray(models) ? models.filter(isProviderModelConfig) : [];
|
|
156281
156632
|
}
|
|
156282
156633
|
__name(readProviderModels, "readProviderModels");
|
|
156283
156634
|
function findExistingProviderModels(config, settings) {
|
|
@@ -157063,6 +157414,19 @@ function normalizeAcpSessionListSize(value) {
|
|
|
157063
157414
|
return Math.min(Math.max(value, 1), MAX_ACP_SESSION_PAGE_SIZE);
|
|
157064
157415
|
}
|
|
157065
157416
|
__name(normalizeAcpSessionListSize, "normalizeAcpSessionListSize");
|
|
157417
|
+
function parseAcpSessionListCursor(value) {
|
|
157418
|
+
if (value == null || value === "") return void 0;
|
|
157419
|
+
const trimmed = value.trim();
|
|
157420
|
+
const parsedCursor = Number(trimmed);
|
|
157421
|
+
if (trimmed === "" || !Number.isFinite(parsedCursor) || parsedCursor < 0 || parsedCursor > Number.MAX_SAFE_INTEGER) {
|
|
157422
|
+
throw RequestError.invalidParams(
|
|
157423
|
+
void 0,
|
|
157424
|
+
`Invalid cursor: "${value}" is not a valid numeric cursor`
|
|
157425
|
+
);
|
|
157426
|
+
}
|
|
157427
|
+
return parsedCursor;
|
|
157428
|
+
}
|
|
157429
|
+
__name(parseAcpSessionListCursor, "parseAcpSessionListCursor");
|
|
157066
157430
|
var QwenAgent = class {
|
|
157067
157431
|
constructor(config, settings, argv, connection) {
|
|
157068
157432
|
this.config = config;
|
|
@@ -157196,7 +157560,7 @@ var QwenAgent = class {
|
|
|
157196
157560
|
async initialize(args) {
|
|
157197
157561
|
this.clientCapabilities = args.clientCapabilities;
|
|
157198
157562
|
const authMethods = buildAuthMethods();
|
|
157199
|
-
const version = "0.19.
|
|
157563
|
+
const version = "0.19.1-nightly.20260624.a234860a4";
|
|
157200
157564
|
return {
|
|
157201
157565
|
protocolVersion: PROTOCOL_VERSION,
|
|
157202
157566
|
agentInfo: {
|
|
@@ -157224,7 +157588,7 @@ var QwenAgent = class {
|
|
|
157224
157588
|
};
|
|
157225
157589
|
}
|
|
157226
157590
|
async authenticate({ methodId }) {
|
|
157227
|
-
const method = methodId;
|
|
157591
|
+
const method = external_exports.nativeEnum(AuthType).parse(methodId);
|
|
157228
157592
|
let authUri;
|
|
157229
157593
|
const authUriHandler = /* @__PURE__ */ __name((deviceAuth) => {
|
|
157230
157594
|
authUri = deviceAuth.verification_uri_complete;
|
|
@@ -157232,7 +157596,7 @@ var QwenAgent = class {
|
|
|
157232
157596
|
_meta: { authUri }
|
|
157233
157597
|
});
|
|
157234
157598
|
}, "authUriHandler");
|
|
157235
|
-
if (method ===
|
|
157599
|
+
if (method === "qwen-oauth" /* QWEN_OAUTH */) {
|
|
157236
157600
|
qwenOAuth2Events.once("auth-uri" /* AuthUri */, authUriHandler);
|
|
157237
157601
|
}
|
|
157238
157602
|
await clearCachedCredentialFile();
|
|
@@ -157244,7 +157608,7 @@ var QwenAgent = class {
|
|
|
157244
157608
|
method
|
|
157245
157609
|
);
|
|
157246
157610
|
} finally {
|
|
157247
|
-
if (method ===
|
|
157611
|
+
if (method === "qwen-oauth" /* QWEN_OAUTH */) {
|
|
157248
157612
|
qwenOAuth2Events.off("auth-uri" /* AuthUri */, authUriHandler);
|
|
157249
157613
|
}
|
|
157250
157614
|
}
|
|
@@ -157292,10 +157656,7 @@ var QwenAgent = class {
|
|
|
157292
157656
|
await this.ensureAuthenticated(config);
|
|
157293
157657
|
this.setupFileSystem(config);
|
|
157294
157658
|
const sessionData = config.getResumedSessionData();
|
|
157295
|
-
const session2 = await this.createAndStoreSession(
|
|
157296
|
-
config,
|
|
157297
|
-
sessionData?.conversation
|
|
157298
|
-
);
|
|
157659
|
+
const session2 = await this.createAndStoreSession(config, sessionData);
|
|
157299
157660
|
await this.#restoreWorktreeOnResume(config, session2);
|
|
157300
157661
|
const modesData = this.buildModesData(config);
|
|
157301
157662
|
const availableModels = this.buildAvailableModels(config);
|
|
@@ -157326,7 +157687,11 @@ var QwenAgent = class {
|
|
|
157326
157687
|
);
|
|
157327
157688
|
await this.ensureAuthenticated(config);
|
|
157328
157689
|
this.setupFileSystem(config);
|
|
157329
|
-
const session2 = await this.createAndStoreSession(
|
|
157690
|
+
const session2 = await this.createAndStoreSession(
|
|
157691
|
+
config,
|
|
157692
|
+
config.getResumedSessionData(),
|
|
157693
|
+
{ replayHistory: false }
|
|
157694
|
+
);
|
|
157330
157695
|
await this.#restoreWorktreeOnResume(config, session2);
|
|
157331
157696
|
const modesData = this.buildModesData(config);
|
|
157332
157697
|
const availableModels = this.buildAvailableModels(config);
|
|
@@ -157356,17 +157721,7 @@ var QwenAgent = class {
|
|
|
157356
157721
|
}
|
|
157357
157722
|
async unstable_listSessions(params) {
|
|
157358
157723
|
const cwd5 = params.cwd || process.cwd();
|
|
157359
|
-
|
|
157360
|
-
if (params.cursor != null && params.cursor !== "") {
|
|
157361
|
-
const parsedCursor = Number(params.cursor);
|
|
157362
|
-
if (!Number.isFinite(parsedCursor)) {
|
|
157363
|
-
throw RequestError.invalidParams(
|
|
157364
|
-
void 0,
|
|
157365
|
-
`Invalid cursor: "${params.cursor}" is not a valid numeric cursor`
|
|
157366
|
-
);
|
|
157367
|
-
}
|
|
157368
|
-
numericCursor = parsedCursor;
|
|
157369
|
-
}
|
|
157724
|
+
const numericCursor = parseAcpSessionListCursor(params.cursor);
|
|
157370
157725
|
const size = normalizeAcpSessionListSize(params._meta?.["size"]);
|
|
157371
157726
|
const result = await runWithAcpRuntimeOutputDir(this.settings, cwd5, () => {
|
|
157372
157727
|
const sessionService = new SessionService(cwd5);
|
|
@@ -158466,6 +158821,32 @@ var QwenAgent = class {
|
|
|
158466
158821
|
const session2 = this.sessionOrThrow(sessionId);
|
|
158467
158822
|
return buildSessionTasksStatus(sessionId, session2.getConfig());
|
|
158468
158823
|
}
|
|
158824
|
+
buildSessionLspStatus(sessionId) {
|
|
158825
|
+
const session2 = this.sessionOrThrow(sessionId);
|
|
158826
|
+
const config = session2.getConfig();
|
|
158827
|
+
const snapshot = config.getLspStatusSnapshot();
|
|
158828
|
+
return {
|
|
158829
|
+
v: STATUS_SCHEMA_VERSION,
|
|
158830
|
+
sessionId,
|
|
158831
|
+
workspaceCwd: this.workspaceCwd(config),
|
|
158832
|
+
enabled: snapshot.enabled,
|
|
158833
|
+
configuredServers: snapshot.configuredServers,
|
|
158834
|
+
readyServers: snapshot.readyServers,
|
|
158835
|
+
failedServers: snapshot.failedServers,
|
|
158836
|
+
inProgressServers: snapshot.inProgressServers,
|
|
158837
|
+
notStartedServers: snapshot.notStartedServers,
|
|
158838
|
+
...snapshot.statusUnavailable ? { statusUnavailable: true } : {},
|
|
158839
|
+
...snapshot.initializationError ? { initializationError: snapshot.initializationError } : {},
|
|
158840
|
+
servers: snapshot.servers.map((server) => ({
|
|
158841
|
+
name: server.name,
|
|
158842
|
+
status: server.status,
|
|
158843
|
+
languages: server.languages,
|
|
158844
|
+
...server.transport ? { transport: server.transport } : {},
|
|
158845
|
+
...server.command ? { command: server.command } : {},
|
|
158846
|
+
...server.error ? { error: server.error } : {}
|
|
158847
|
+
}))
|
|
158848
|
+
};
|
|
158849
|
+
}
|
|
158469
158850
|
buildSessionStatsStatus(sessionId) {
|
|
158470
158851
|
const session2 = this.sessionOrThrow(sessionId);
|
|
158471
158852
|
const config = session2.getConfig();
|
|
@@ -159099,6 +159480,16 @@ var QwenAgent = class {
|
|
|
159099
159480
|
}
|
|
159100
159481
|
return this.buildSessionTasksStatus(sessionId);
|
|
159101
159482
|
}
|
|
159483
|
+
case SERVE_STATUS_EXT_METHODS.sessionLspStatus: {
|
|
159484
|
+
const sessionId = params["sessionId"];
|
|
159485
|
+
if (typeof sessionId !== "string" || sessionId.length === 0) {
|
|
159486
|
+
throw RequestError.invalidParams(
|
|
159487
|
+
void 0,
|
|
159488
|
+
"Invalid or missing sessionId"
|
|
159489
|
+
);
|
|
159490
|
+
}
|
|
159491
|
+
return this.buildSessionLspStatus(sessionId);
|
|
159492
|
+
}
|
|
159102
159493
|
case SERVE_STATUS_EXT_METHODS.sessionStats: {
|
|
159103
159494
|
const sessionId = params["sessionId"];
|
|
159104
159495
|
if (typeof sessionId !== "string" || sessionId.length === 0) {
|
|
@@ -159126,11 +159517,12 @@ var QwenAgent = class {
|
|
|
159126
159517
|
}
|
|
159127
159518
|
const fhs = session2.getConfig().getFileHistoryService();
|
|
159128
159519
|
const snapshots = fhs.getSnapshots();
|
|
159520
|
+
const rewindableTurnCount = session2.getRewindableUserTurnCount();
|
|
159129
159521
|
const prefix = sessionId + "########";
|
|
159130
159522
|
const results = await Promise.all(
|
|
159131
159523
|
snapshots.map((s, idx) => ({ s, idx })).filter(
|
|
159132
159524
|
({ s }) => s.promptId.startsWith(prefix) && /^\d+$/.test(s.promptId.slice(prefix.length))
|
|
159133
|
-
).map(async ({ s, idx }) => {
|
|
159525
|
+
).filter(({ idx }) => idx < rewindableTurnCount).map(async ({ s, idx }) => {
|
|
159134
159526
|
const stats = await fhs.getDiffStats(s.promptId);
|
|
159135
159527
|
return {
|
|
159136
159528
|
promptId: s.promptId,
|
|
@@ -160136,10 +160528,13 @@ ${outputText}
|
|
|
160136
160528
|
"Invalid or missing targetTurnIndex"
|
|
160137
160529
|
);
|
|
160138
160530
|
}
|
|
160531
|
+
const rewindFiles = params["rewindFiles"] !== false;
|
|
160139
160532
|
const historyBeforeRewind = session2.captureHistorySnapshot();
|
|
160140
160533
|
let rewindResult;
|
|
160141
160534
|
try {
|
|
160142
|
-
rewindResult = session2.rewindToTurn(turnIndex
|
|
160535
|
+
rewindResult = session2.rewindToTurn(turnIndex, {
|
|
160536
|
+
rewindFiles
|
|
160537
|
+
});
|
|
160143
160538
|
} catch (err) {
|
|
160144
160539
|
if (err instanceof RequestError) {
|
|
160145
160540
|
const msg = err.message;
|
|
@@ -160158,7 +160553,6 @@ ${outputText}
|
|
|
160158
160553
|
}
|
|
160159
160554
|
let filesChanged = [];
|
|
160160
160555
|
let filesFailed = [];
|
|
160161
|
-
const rewindFiles = params["rewindFiles"] !== false;
|
|
160162
160556
|
if (rewindFiles && promptId) {
|
|
160163
160557
|
const fhs = session2.getConfig().getFileHistoryService();
|
|
160164
160558
|
try {
|
|
@@ -160790,7 +161184,7 @@ ${outputText}
|
|
|
160790
161184
|
);
|
|
160791
161185
|
config.setFileSystemService(acpFileSystemService);
|
|
160792
161186
|
}
|
|
160793
|
-
async createAndStoreSession(config,
|
|
161187
|
+
async createAndStoreSession(config, sessionData, options = {}) {
|
|
160794
161188
|
const sessionId = config.getSessionId();
|
|
160795
161189
|
const geminiClient = config.getGeminiClient();
|
|
160796
161190
|
const needsInitialize = !geminiClient.isInitialized();
|
|
@@ -160808,8 +161202,11 @@ ${outputText}
|
|
|
160808
161202
|
setTimeout(async () => {
|
|
160809
161203
|
await session2.sendAvailableCommandsUpdate();
|
|
160810
161204
|
}, 0);
|
|
160811
|
-
if (
|
|
160812
|
-
|
|
161205
|
+
if (sessionData?.fileHistorySnapshots?.length) {
|
|
161206
|
+
config.getFileHistoryService().restoreFromSnapshots(sessionData.fileHistorySnapshots);
|
|
161207
|
+
}
|
|
161208
|
+
if (options.replayHistory !== false && sessionData?.conversation.messages) {
|
|
161209
|
+
await session2.replayHistory(sessionData.conversation.messages);
|
|
160813
161210
|
}
|
|
160814
161211
|
session2.installRewriter();
|
|
160815
161212
|
session2.startCronScheduler();
|
|
@@ -161449,7 +161846,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
161449
161846
|
process.exit(0);
|
|
161450
161847
|
}
|
|
161451
161848
|
if (config.isInteractive()) {
|
|
161452
|
-
void import("./chunks/scheduler-
|
|
161849
|
+
void import("./chunks/scheduler-XUBHNI2Z.js").then((m) => m.startBackgroundHousekeeping(config, settings)).catch((err) => {
|
|
161453
161850
|
debugLogger92.warn("failed to start background housekeeping:", err);
|
|
161454
161851
|
});
|
|
161455
161852
|
}
|
|
@@ -161464,7 +161861,7 @@ ${finalArgs[promptIndex + 1]}`;
|
|
|
161464
161861
|
}),
|
|
161465
161862
|
...getSettingsWarnings(settings),
|
|
161466
161863
|
...config.getWarnings(),
|
|
161467
|
-
...config.getModelsConfig().getCurrentAuthType() ===
|
|
161864
|
+
...config.getModelsConfig().getCurrentAuthType() === "qwen-oauth" /* QWEN_OAUTH */ ? [
|
|
161468
161865
|
"Qwen OAuth free tier was discontinued on 2026-04-15. Run /auth to switch to Coding Plan or another provider."
|
|
161469
161866
|
] : []
|
|
161470
161867
|
])
|
|
@@ -161720,10 +162117,9 @@ main().catch((error) => {
|
|
|
161720
162117
|
* Copyright 2025 Qwen
|
|
161721
162118
|
* SPDX-License-Identifier: Apache-2.0
|
|
161722
162119
|
*
|
|
161723
|
-
* Inspired by gemini-cli's MouseContext (Google LLC, Apache-2.0)
|
|
161724
|
-
*
|
|
161725
|
-
*
|
|
161726
|
-
* call the handler, restore on unmount.
|
|
162120
|
+
* Inspired by gemini-cli's MouseContext (Google LLC, Apache-2.0): enable SGR
|
|
162121
|
+
* mouse mode while at least one subscriber is active, parse mouse sequences
|
|
162122
|
+
* out of the KeypressContext pipeline, call each handler, restore on cleanup.
|
|
161727
162123
|
*/
|
|
161728
162124
|
/**
|
|
161729
162125
|
* @license
|