@qwen-code/qwen-code 0.18.5-nightly.20260622.6bc3f853e → 0.18.5-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/bundled/qc-helper/SKILL.md +13 -5
  2. package/bundled/qc-helper/docs/configuration/_meta.ts +1 -0
  3. package/bundled/qc-helper/docs/configuration/auth.md +68 -48
  4. package/bundled/qc-helper/docs/configuration/model-providers.md +217 -195
  5. package/bundled/qc-helper/docs/configuration/qwen-ignore.md +31 -15
  6. package/bundled/qc-helper/docs/configuration/settings.md +44 -27
  7. package/bundled/qc-helper/docs/configuration/themes.md +7 -4
  8. package/bundled/qc-helper/docs/extension/extension-releasing.md +1 -1
  9. package/bundled/qc-helper/docs/extension/introduction.md +27 -21
  10. package/bundled/qc-helper/docs/features/arena.md +3 -3
  11. package/bundled/qc-helper/docs/features/channels/overview.md +1 -1
  12. package/bundled/qc-helper/docs/features/channels/plugins.md +1 -1
  13. package/bundled/qc-helper/docs/features/commands.md +6 -1
  14. package/bundled/qc-helper/docs/features/headless.md +1 -1
  15. package/bundled/qc-helper/docs/features/mcp.md +33 -14
  16. package/bundled/qc-helper/docs/features/sandbox.md +2 -2
  17. package/bundled/qc-helper/docs/features/tool-use-summaries.md +1 -1
  18. package/bundled/qc-helper/docs/integration-github-action.md +2 -2
  19. package/bundled/qc-helper/docs/overview.md +1 -1
  20. package/bundled/qc-helper/docs/quickstart.md +9 -5
  21. package/bundled/qc-helper/docs/qwen-serve.md +14 -2
  22. package/bundled/qc-helper/docs/support/tos-privacy.md +1 -1
  23. package/chunks/{agent-WFLPE5MW.js → agent-P4KSTVXX.js} +24 -22
  24. package/chunks/{agent-headless-Q27MG73I.js → agent-headless-QUAPWF55.js} +24 -22
  25. package/chunks/{anthropicContentGenerator-5S4OMMNL.js → anthropicContentGenerator-7352A7I5.js} +12 -11
  26. package/chunks/artifact-tool-5J4HUZAV.js +675 -0
  27. package/chunks/{askUserQuestion-WHVYL2S2.js → askUserQuestion-HF7HCWDD.js} +20 -7
  28. package/chunks/chunk-22IFUCVR.js +291 -0
  29. package/chunks/{chunk-26ZYKTYZ.js → chunk-2BIF2NVV.js} +2 -2
  30. package/chunks/{chunk-VKILGMZQ.js → chunk-2QDQTWCI.js} +1 -1
  31. package/chunks/{chunk-XGU3ETVO.js → chunk-3BR4OIOE.js} +3 -3
  32. package/chunks/{chunk-LTN3VYMZ.js → chunk-3UALQ56H.js} +1 -1
  33. package/chunks/{chunk-QBUR6J4B.js → chunk-BC5POO46.js} +8 -7
  34. package/chunks/{chunk-MSJ2MXJ6.js → chunk-BGUDAULQ.js} +11 -290
  35. package/chunks/{chunk-FH4P6RQA.js → chunk-BNXANYLH.js} +1 -1
  36. package/chunks/{chunk-WE6TNQJU.js → chunk-C4K3FEQ2.js} +36 -0
  37. package/chunks/{chunk-G4BUMVEY.js → chunk-CGEGHF2C.js} +2 -217
  38. package/chunks/chunk-EEEZIVFJ.js +908 -0
  39. package/chunks/{chunk-7Z2O7IBO.js → chunk-EIJYMXXX.js} +619 -135
  40. package/chunks/chunk-EJYJYJZ2.js +3703 -0
  41. package/chunks/{chunk-ATLUHLZE.js → chunk-EW6C27XX.js} +1 -1
  42. package/chunks/{chunk-42HGOMED.js → chunk-F6XNTYNE.js} +216 -1
  43. package/chunks/{chunk-C6MI2ASN.js → chunk-GZCJS5WH.js} +2 -2
  44. package/chunks/{chunk-KGV3F6UF.js → chunk-HGNSRCRB.js} +1 -1
  45. package/chunks/{chunk-CX3SGIPK.js → chunk-KBXLIVWQ.js} +2 -2
  46. package/chunks/{chunk-GOMVJKBL.js → chunk-L7U2RI5O.js} +59 -57
  47. package/chunks/{chunk-GBN55AWZ.js → chunk-NKJ6LRCR.js} +2 -2
  48. package/chunks/{chunk-2O3NAOJG.js → chunk-NWLUISRA.js} +1 -1
  49. package/chunks/{chunk-ID533GA3.js → chunk-OTBK43JR.js} +1 -1
  50. package/chunks/{chunk-AE6RQU6F.js → chunk-PRYMDRBV.js} +1 -1
  51. package/chunks/{chunk-KQIKOTQJ.js → chunk-RYLJU2DY.js} +60 -5
  52. package/chunks/{chunk-CTHZVIMD.js → chunk-T2VDEFUU.js} +2 -2
  53. package/chunks/{chunk-SWGPABMH.js → chunk-T336V435.js} +80 -83
  54. package/chunks/{chunk-LF6BKGZT.js → chunk-TXVGVZYR.js} +3 -3
  55. package/chunks/{chunk-GM3LTU6K.js → chunk-UMRZ7XCR.js} +170 -5015
  56. package/chunks/{chunk-XU7BKR3B.js → chunk-XU5P23GN.js} +3 -3
  57. package/chunks/{chunk-EJ6NFQ2L.js → chunk-ZC675NGC.js} +5 -5
  58. package/chunks/{chunk-CXZV4Q4J.js → chunk-ZXNEOCW2.js} +7118 -5113
  59. package/chunks/{computer-use-F5O56FVW.js → computer-use-4TLHI3UR.js} +24 -22
  60. package/chunks/contextCommand-HFEITKSR.js +56 -0
  61. package/chunks/{cron-create-THNDTYXU.js → cron-create-A5637KCI.js} +12 -9
  62. package/chunks/{cron-delete-BS5H6TFJ.js → cron-delete-AADOSEOZ.js} +4 -4
  63. package/chunks/{cron-list-7OBVHT7K.js → cron-list-OFCPTT2Y.js} +4 -4
  64. package/chunks/{dist-GKRNVFBH.js → dist-ZBX7LPJZ.js} +2 -1
  65. package/chunks/{edit-UV7MBOJU.js → edit-B7H73V6O.js} +24 -22
  66. package/chunks/{en-S3OQBISC.js → en-7OGNWWME.js} +48 -0
  67. package/chunks/{enter-worktree-TSCHZMJ3.js → enter-worktree-GG7ZHYPS.js} +24 -22
  68. package/chunks/{enterPlanMode-LKS7VIUG.js → enterPlanMode-RHTAKG52.js} +27 -23
  69. package/chunks/{exit-worktree-Q6EWFLZU.js → exit-worktree-U7VQZRMG.js} +24 -22
  70. package/chunks/{exitPlanMode-HS6I4D2O.js → exitPlanMode-S35A36II.js} +36 -28
  71. package/chunks/{geminiContentGenerator-GEZ63VSW.js → geminiContentGenerator-W7KVATBA.js} +4 -4
  72. package/chunks/{glob-ZN5LKB7E.js → glob-WOFF7ECI.js} +26 -23
  73. package/chunks/{grep-NIKBBYBU.js → grep-MWNYWYWQ.js} +24 -22
  74. package/chunks/{keychain-token-storage-YHXIWXIB.js → keychain-token-storage-CSYMNRPP.js} +2 -2
  75. package/chunks/{loop-wakeup-SSBWZ64K.js → loop-wakeup-DGSMT4N6.js} +5 -5
  76. package/chunks/{ls-YPFUHZRQ.js → ls-UGRZ4ZOM.js} +6 -6
  77. package/chunks/{lsp-FD6DNVAF.js → lsp-72IJURW3.js} +2 -2
  78. package/chunks/{monitor-A25XKPU5.js → monitor-AYUINLYN.js} +24 -22
  79. package/chunks/{notebook-edit-E72AIOUS.js → notebook-edit-EP4D4WFD.js} +25 -23
  80. package/chunks/{openaiContentGenerator-ZDLZDXLU.js → openaiContentGenerator-SLYYF7AM.js} +12 -15
  81. package/chunks/{qwenContentGenerator-HVJPPMTT.js → qwenContentGenerator-VZ7JYU4A.js} +26 -24
  82. package/chunks/{qwenOAuth2-WZ54YZ4J.js → qwenOAuth2-K4AASPCV.js} +5 -4
  83. package/chunks/{read-file-L6FM3KUX.js → read-file-65EQ53KS.js} +9 -8
  84. package/chunks/{ripGrep-YRJCUISE.js → ripGrep-5XLHJDDM.js} +24 -22
  85. package/chunks/{scheduler-M3742P2I.js → scheduler-5GLJSA2H.js} +73 -27
  86. package/chunks/{send-message-FWFTX62Q.js → send-message-URUZ7PLA.js} +24 -4
  87. package/chunks/{serve-ZIP2GDFY.js → serve-MUROZGCG.js} +618 -92
  88. package/chunks/{shell-T5VSPJLU.js → shell-ET3BQWKB.js} +24 -22
  89. package/chunks/{skill-ETTFYDOV.js → skill-YEYABCAF.js} +11 -10
  90. package/chunks/{src-UKOPSYDK.js → src-POVOI65Y.js} +140 -67
  91. package/chunks/{syntheticOutput-JY5NEDTV.js → syntheticOutput-65FRJGWM.js} +3 -3
  92. package/chunks/{task-create-IGILDV25.js → task-create-IH45HOFT.js} +6 -6
  93. package/chunks/{task-list-KBEJVAAG.js → task-list-FUB6JWSX.js} +5 -5
  94. package/chunks/{task-stop-WFTMQ6AC.js → task-stop-P6IOHQM3.js} +2 -2
  95. package/chunks/{task-update-UIVX7ZEV.js → task-update-RTUT7LJV.js} +6 -6
  96. package/chunks/{team-create-DRKUVGBN.js → team-create-EFZFKQFP.js} +28 -26
  97. package/chunks/{team-delete-LPOXDPVB.js → team-delete-RXGYRMHC.js} +5 -5
  98. package/chunks/{todoWrite-R4RIJKOD.js → todoWrite-O6JK24G6.js} +4 -4
  99. package/chunks/{tool-search-EIIK27ON.js → tool-search-BRJC42TE.js} +9 -8
  100. package/chunks/{web-fetch-JU7SS6KE.js → web-fetch-KUMBROUI.js} +4 -4
  101. package/chunks/{workflow-4RGAYFSJ.js → workflow-UDRBNFTT.js} +557 -97
  102. package/chunks/{write-file-GLQYJFEZ.js → write-file-F7TAHAHF.js} +24 -22
  103. package/chunks/{zh-QXLZV2PX.js → zh-3RMSEO5M.js} +48 -0
  104. package/chunks/{zh-TW-3OKU7LDA.js → zh-TW-R7WRLTJS.js} +48 -0
  105. package/cli.js +8473 -5091
  106. package/locales/en.js +69 -0
  107. package/locales/zh-TW.js +66 -0
  108. package/locales/zh.js +66 -0
  109. package/package.json +3 -2
  110. package/web-shell/assets/{arc-CRFN10gD.js → arc-DHUeMnnj.js} +1 -1
  111. package/web-shell/assets/{architectureDiagram-3BPJPVTR-IRlu1CpH.js → architectureDiagram-3BPJPVTR-DlX12yyj.js} +1 -1
  112. package/web-shell/assets/{blockDiagram-GPEHLZMM-htIZ6iw8.js → blockDiagram-GPEHLZMM-DTFUXMUT.js} +1 -1
  113. package/web-shell/assets/{c4Diagram-AAUBKEIU-A2GoRq3O.js → c4Diagram-AAUBKEIU-CWdB54fk.js} +1 -1
  114. package/web-shell/assets/channel-C3WhMjjP.js +1 -0
  115. package/web-shell/assets/{chunk-2J33WTMH-CdP2AC6u.js → chunk-2J33WTMH-CF5C5jNR.js} +1 -1
  116. package/web-shell/assets/{chunk-4BX2VUAB-DrA07nW2.js → chunk-4BX2VUAB-Cw7Ydfji.js} +1 -1
  117. package/web-shell/assets/{chunk-55IACEB6-CFGnVU2f.js → chunk-55IACEB6-CnbI1ZCw.js} +1 -1
  118. package/web-shell/assets/{chunk-727SXJPM-BTMkq3Tk.js → chunk-727SXJPM-DmSy00Pe.js} +1 -1
  119. package/web-shell/assets/{chunk-AQP2D5EJ-C9sYg04Z.js → chunk-AQP2D5EJ-DgNgXqBu.js} +1 -1
  120. package/web-shell/assets/{chunk-FMBD7UC4-Cag-cj6I.js → chunk-FMBD7UC4-tz2IvOXv.js} +1 -1
  121. package/web-shell/assets/{chunk-ND2GUHAM-CDSTFoR7.js → chunk-ND2GUHAM-DaBLEBPa.js} +1 -1
  122. package/web-shell/assets/{chunk-QZHKN3VN-CN9Z6oOs.js → chunk-QZHKN3VN-DVCQST3O.js} +1 -1
  123. package/web-shell/assets/classDiagram-4FO5ZUOK-CQ6TXPif.js +1 -0
  124. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CQ6TXPif.js +1 -0
  125. package/web-shell/assets/{cose-bilkent-S5V4N54A-DuN9j8Du.js → cose-bilkent-S5V4N54A-CAKTcdCQ.js} +1 -1
  126. package/web-shell/assets/{dagre-BM42HDAG-ByCWe45f.js → dagre-BM42HDAG-BdkBwlKg.js} +1 -1
  127. package/web-shell/assets/{diagram-2AECGRRQ-eWyU_pKZ.js → diagram-2AECGRRQ-DYt3G65F.js} +1 -1
  128. package/web-shell/assets/{diagram-5GNKFQAL-0Bfu3Fq5.js → diagram-5GNKFQAL-BWvROWjY.js} +1 -1
  129. package/web-shell/assets/{diagram-KO2AKTUF-B6KBKkQP.js → diagram-KO2AKTUF-BvvgwIaQ.js} +1 -1
  130. package/web-shell/assets/{diagram-LMA3HP47-TToDmeA_.js → diagram-LMA3HP47-E7NLSNKg.js} +1 -1
  131. package/web-shell/assets/{diagram-OG6HWLK6-CQCkC2Yx.js → diagram-OG6HWLK6-CYmUBgpE.js} +1 -1
  132. package/web-shell/assets/{erDiagram-TEJ5UH35-Cm9ls1iB.js → erDiagram-TEJ5UH35-BU5gY30h.js} +1 -1
  133. package/web-shell/assets/{flowDiagram-I6XJVG4X-Dyoz80Pv.js → flowDiagram-I6XJVG4X-V_ZssSZ9.js} +1 -1
  134. package/web-shell/assets/{ganttDiagram-6RSMTGT7-Cfut9yaU.js → ganttDiagram-6RSMTGT7-QIShlsdI.js} +1 -1
  135. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-BCuJdlfD.js → gitGraphDiagram-PVQCEYII-DJxdu2YS.js} +1 -1
  136. package/web-shell/assets/index-BPnhI7gl.css +1 -0
  137. package/web-shell/assets/index-De4rqTsW.js +706 -0
  138. package/web-shell/assets/{infoDiagram-5YYISTIA-CXKxF2VL.js → infoDiagram-5YYISTIA-BqjdrFeO.js} +1 -1
  139. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-DE7HWSU8.js → ishikawaDiagram-YF4QCWOH-BP_a2YZ2.js} +1 -1
  140. package/web-shell/assets/{journeyDiagram-JHISSGLW-D__YUfds.js → journeyDiagram-JHISSGLW-BXg-S3Lk.js} +1 -1
  141. package/web-shell/assets/{kanban-definition-UN3LZRKU-D82R169M.js → kanban-definition-UN3LZRKU-BksAkdEJ.js} +1 -1
  142. package/web-shell/assets/{linear-DpyMbKqT.js → linear-D2m9-ODE.js} +1 -1
  143. package/web-shell/assets/{mermaid.core-D1KEFDhn.js → mermaid.core-dTtkZp2F.js} +5 -5
  144. package/web-shell/assets/{mindmap-definition-RKZ34NQL-BwVUFGFE.js → mindmap-definition-RKZ34NQL-Bft9my8O.js} +1 -1
  145. package/web-shell/assets/{pieDiagram-4H26LBE5-BO_qoEGx.js → pieDiagram-4H26LBE5-Cw8S-alZ.js} +1 -1
  146. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-Cx0ZaWPo.js → quadrantDiagram-W4KKPZXB-DaDoTMts.js} +1 -1
  147. package/web-shell/assets/{requirementDiagram-4Y6WPE33-BJPXejOA.js → requirementDiagram-4Y6WPE33-Cp5kSpwj.js} +1 -1
  148. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-C1xeIL9i.js → sankeyDiagram-5OEKKPKP-CW8RsJJZ.js} +1 -1
  149. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-CSYKQUjf.js → sequenceDiagram-3UESZ5HK-DTfpIiJK.js} +1 -1
  150. package/web-shell/assets/{stateDiagram-AJRCARHV-d9hiHlAW.js → stateDiagram-AJRCARHV-DixFVzEs.js} +1 -1
  151. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DZgE04s3.js +1 -0
  152. package/web-shell/assets/{timeline-definition-PNZ67QCA-BhCBkq8k.js → timeline-definition-PNZ67QCA-DYsbXn5l.js} +1 -1
  153. package/web-shell/assets/{vennDiagram-CIIHVFJN-DPPFWp_y.js → vennDiagram-CIIHVFJN-HUpRpuUp.js} +1 -1
  154. package/web-shell/assets/{wardley-L42UT6IY-CcOUIgXY.js → wardley-L42UT6IY-cT3nQH_T.js} +1 -1
  155. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-p7oR5X7r.js → wardleyDiagram-YWT4CUSO-Dmm7J6Qc.js} +1 -1
  156. package/web-shell/assets/{xychartDiagram-2RQKCTM6-Dfr7-SEy.js → xychartDiagram-2RQKCTM6-CX0L5p9C.js} +1 -1
  157. package/web-shell/index.html +3 -3
  158. package/chunks/chunk-77WXWU44.js +0 -26
  159. package/chunks/contextCommand-WBVNKL2C.js +0 -54
  160. package/web-shell/assets/channel-WwImfsc7.js +0 -1
  161. package/web-shell/assets/classDiagram-4FO5ZUOK-CJKQYFeJ.js +0 -1
  162. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CJKQYFeJ.js +0 -1
  163. package/web-shell/assets/index-BDZiTAkl.css +0 -1
  164. package/web-shell/assets/index-DaebdpHq.js +0 -516
  165. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DgReoybQ.js +0 -1
@@ -2,17 +2,20 @@
2
2
  "use strict";
3
3
  import {
4
4
  formatFetchErrorForUser
5
- } from "./chunk-ATLUHLZE.js";
5
+ } from "./chunk-EW6C27XX.js";
6
+ import {
7
+ openBrowserSecurely
8
+ } from "./chunk-22IFUCVR.js";
6
9
  import {
7
10
  combineAbortSignals
8
11
  } from "./chunk-64WXLC72.js";
9
12
  import {
10
13
  atomicWriteFile
11
- } from "./chunk-LTN3VYMZ.js";
14
+ } from "./chunk-3UALQ56H.js";
12
15
  import {
13
16
  Storage,
14
17
  createDebugLogger
15
- } from "./chunk-WE6TNQJU.js";
18
+ } from "./chunk-C4K3FEQ2.js";
16
19
  import {
17
20
  init_esbuild_shims
18
21
  } from "./chunk-A4BMJM77.js";
@@ -28,279 +31,6 @@ import { promises as fs2 } from "node:fs";
28
31
  import { EventEmitter } from "events";
29
32
  import { randomUUID as randomUUID2 } from "node:crypto";
30
33
 
31
- // packages/core/src/utils/secure-browser-launcher.ts
32
- init_esbuild_shims();
33
- import { execFile, spawn } from "node:child_process";
34
- import { promisify } from "node:util";
35
- import { platform } from "node:os";
36
- import { resolve } from "node:path";
37
- import { URL, fileURLToPath } from "node:url";
38
-
39
- // packages/core/src/utils/browser.ts
40
- init_esbuild_shims();
41
- var browserBlocklist = ["www-browser"];
42
- function isBrowserCommandBlocked(command) {
43
- const commandName = command.replace(/\\/g, "/").split("/").pop();
44
- return !!commandName && browserBlocklist.includes(commandName);
45
- }
46
- __name(isBrowserCommandBlocked, "isBrowserCommandBlocked");
47
- function shouldAttemptBrowserLaunch(options = {}) {
48
- const browserEnv = process.env["BROWSER"]?.trim();
49
- const browserCommand = browserEnv?.match(/^\S+/)?.[0];
50
- if (!options.ignoreBrowserBlocklist && process.platform !== "win32" && browserCommand && isBrowserCommandBlocked(browserCommand)) {
51
- return false;
52
- }
53
- if (process.env["CI"] || process.env["DEBIAN_FRONTEND"] === "noninteractive") {
54
- return false;
55
- }
56
- const isSSH = !!process.env["SSH_CONNECTION"];
57
- if (process.platform === "linux") {
58
- const displayVariables = ["DISPLAY", "WAYLAND_DISPLAY", "MIR_SOCKET"];
59
- const hasDisplay = displayVariables.some((v) => !!process.env[v]);
60
- if (!hasDisplay) {
61
- return false;
62
- }
63
- }
64
- if (isSSH && process.platform !== "linux") {
65
- return false;
66
- }
67
- return true;
68
- }
69
- __name(shouldAttemptBrowserLaunch, "shouldAttemptBrowserLaunch");
70
-
71
- // packages/core/src/utils/secure-browser-launcher.ts
72
- var execFileAsync = promisify(execFile);
73
- function validateUrl(url, { allowFile = false, allowedFilePaths } = {}) {
74
- let parsedUrl;
75
- try {
76
- parsedUrl = new URL(url);
77
- } catch (_error) {
78
- throw new Error(`Invalid URL: ${url}`);
79
- }
80
- const allowedProtocols = allowFile ? ["http:", "https:", "file:"] : ["http:", "https:"];
81
- if (!allowedProtocols.includes(parsedUrl.protocol)) {
82
- throw new Error(
83
- `Unsafe protocol: ${parsedUrl.protocol}. Only ${allowedProtocols.join(
84
- ", "
85
- )} are allowed.`
86
- );
87
- }
88
- if (parsedUrl.protocol === "file:" && allowFile) {
89
- if (!allowedFilePaths?.length) {
90
- throw new Error("allowedFilePaths is required when allowFile is true");
91
- }
92
- const requestedPath = resolve(fileURLToPath(parsedUrl));
93
- const allowed = allowedFilePaths.map((filePath) => resolve(filePath));
94
- if (!allowed.includes(requestedPath)) {
95
- throw new Error("File URL is not in the allowed file set");
96
- }
97
- }
98
- if (/[\r\n\x00-\x1f]/.test(url)) {
99
- throw new Error("URL contains invalid characters");
100
- }
101
- }
102
- __name(validateUrl, "validateUrl");
103
- async function openBrowserSecurely(url, browserOptions = {}) {
104
- validateUrl(url, browserOptions);
105
- const platformName = platform();
106
- let command;
107
- let args;
108
- const browserEnv = process.env["BROWSER"]?.trim();
109
- const browserCommand = platformName === "win32" ? void 0 : buildBrowserCommand(browserEnv, url);
110
- if (browserCommand) {
111
- try {
112
- await launchDetached(browserCommand.command, browserCommand.args);
113
- return;
114
- } catch (_error) {
115
- console.warn(
116
- `Failed to open BROWSER command ${browserCommand.command}: ${formatLaunchError(
117
- _error
118
- )}. Falling back to the platform browser opener.`
119
- );
120
- }
121
- }
122
- if (!shouldAttemptBrowserLaunch({ ignoreBrowserBlocklist: true })) {
123
- console.warn(
124
- `Browser launch is not available in this environment. Please open this URL manually: ${url}`
125
- );
126
- return;
127
- }
128
- {
129
- switch (platformName) {
130
- case "darwin":
131
- command = "open";
132
- args = [url];
133
- break;
134
- case "win32":
135
- command = "powershell.exe";
136
- args = [
137
- "-NoProfile",
138
- "-NonInteractive",
139
- "-WindowStyle",
140
- "Hidden",
141
- "-Command",
142
- `Start-Process '${url.replace(/'/g, "''")}'`
143
- ];
144
- break;
145
- case "linux":
146
- case "freebsd":
147
- case "openbsd":
148
- command = "xdg-open";
149
- args = [url];
150
- break;
151
- default:
152
- throw new Error(`Unsupported platform: ${platformName}`);
153
- }
154
- }
155
- const execOptions = {
156
- // Don't inherit parent's environment to avoid potential issues
157
- env: {
158
- ...process.env,
159
- // Ensure we're not in a shell that might interpret special characters
160
- SHELL: void 0
161
- },
162
- // Detach the browser process so it doesn't block
163
- detached: true,
164
- stdio: "ignore"
165
- };
166
- try {
167
- await execFileAsync(command, args, execOptions);
168
- } catch (_error) {
169
- if ((platformName === "linux" || platformName === "freebsd" || platformName === "openbsd") && command === "xdg-open") {
170
- const fallbackCommands = [
171
- { command: "gnome-open", detached: false },
172
- { command: "kde-open", detached: false },
173
- { command: "firefox", detached: true },
174
- { command: "chromium", detached: true },
175
- { command: "google-chrome", detached: true },
176
- { command: "microsoft-edge", detached: true }
177
- ];
178
- for (const { command: fallbackCommand, detached } of fallbackCommands) {
179
- try {
180
- if (detached) {
181
- await launchDetached(fallbackCommand, [url]);
182
- } else {
183
- await execFileAsync(fallbackCommand, [url], execOptions);
184
- }
185
- return;
186
- } catch {
187
- continue;
188
- }
189
- }
190
- }
191
- console.warn(
192
- `Failed to open browser automatically. Please open this URL manually: ${url}`
193
- );
194
- return;
195
- }
196
- }
197
- __name(openBrowserSecurely, "openBrowserSecurely");
198
- async function launchDetached(command, args) {
199
- const spawnOptions = {
200
- env: {
201
- ...process.env,
202
- SHELL: void 0
203
- },
204
- detached: true,
205
- stdio: "ignore"
206
- };
207
- await new Promise((resolve2, reject) => {
208
- const child = spawn(command, args, spawnOptions);
209
- let settled = false;
210
- child.once("error", (error) => {
211
- if (settled) {
212
- return;
213
- }
214
- settled = true;
215
- reject(error);
216
- });
217
- child.once("spawn", () => {
218
- if (settled) {
219
- return;
220
- }
221
- settled = true;
222
- child.unref();
223
- resolve2();
224
- });
225
- });
226
- }
227
- __name(launchDetached, "launchDetached");
228
- function formatLaunchError(error) {
229
- return error instanceof Error ? error.message : String(error);
230
- }
231
- __name(formatLaunchError, "formatLaunchError");
232
- function buildBrowserCommand(browserEnv, url) {
233
- if (!browserEnv) {
234
- return void 0;
235
- }
236
- const browserCommand = parseBrowserCommand(browserEnv);
237
- if (!browserCommand) {
238
- console.warn(
239
- "Invalid BROWSER environment variable, falling back to platform default."
240
- );
241
- return void 0;
242
- }
243
- if (isBrowserCommandBlocked(browserCommand.command)) {
244
- return void 0;
245
- }
246
- let usedPlaceholder = false;
247
- const args = browserCommand.args.map((arg) => {
248
- if (!arg.includes("%s")) {
249
- return arg;
250
- }
251
- usedPlaceholder = true;
252
- return arg.replace(/%s/g, () => url);
253
- });
254
- if (!usedPlaceholder) {
255
- args.push(url);
256
- }
257
- return { command: browserCommand.command, args };
258
- }
259
- __name(buildBrowserCommand, "buildBrowserCommand");
260
- function parseBrowserCommand(browserEnv) {
261
- const parts = [];
262
- let current = "";
263
- let quote;
264
- for (const char of browserEnv) {
265
- if (quote) {
266
- if (char === quote) {
267
- quote = void 0;
268
- } else {
269
- current += char;
270
- }
271
- continue;
272
- }
273
- if (char === '"' || char === "'") {
274
- quote = char;
275
- continue;
276
- }
277
- if (/\s/.test(char)) {
278
- if (current) {
279
- parts.push(current);
280
- current = "";
281
- }
282
- continue;
283
- }
284
- current += char;
285
- }
286
- if (quote) {
287
- return void 0;
288
- }
289
- if (current) {
290
- parts.push(current);
291
- }
292
- const [command, ...args] = parts;
293
- if (!command) {
294
- return void 0;
295
- }
296
- return { command, args };
297
- }
298
- __name(parseBrowserCommand, "parseBrowserCommand");
299
- function shouldLaunchBrowser() {
300
- return shouldAttemptBrowserLaunch();
301
- }
302
- __name(shouldLaunchBrowser, "shouldLaunchBrowser");
303
-
304
34
  // packages/core/src/qwen/sharedTokenManager.ts
305
35
  init_esbuild_shims();
306
36
  import path from "node:path";
@@ -799,7 +529,7 @@ var SharedTokenManager = class _SharedTokenManager {
799
529
  `Failed to stat lock file ${lockPath}: ${statError instanceof Error ? statError.message : String(statError)}`
800
530
  );
801
531
  }
802
- await new Promise((resolve2) => setTimeout(resolve2, currentInterval));
532
+ await new Promise((resolve) => setTimeout(resolve, currentInterval));
803
533
  currentInterval = Math.min(currentInterval * 1.5, maxInterval);
804
534
  } else {
805
535
  throw new TokenManagerError(
@@ -1434,19 +1164,19 @@ Server requested to slow down, increasing poll interval to ${pollInterval}ms'`
1434
1164
  "polling",
1435
1165
  `Polling... (attempt ${attempt + 1}/${maxAttempts})`
1436
1166
  );
1437
- await new Promise((resolve2) => {
1167
+ await new Promise((resolve) => {
1438
1168
  const checkInterval = 100;
1439
1169
  let elapsedTime = 0;
1440
1170
  const intervalId = setInterval(() => {
1441
1171
  elapsedTime += checkInterval;
1442
1172
  if (isCancelled) {
1443
1173
  clearInterval(intervalId);
1444
- resolve2();
1174
+ resolve();
1445
1175
  return;
1446
1176
  }
1447
1177
  if (elapsedTime >= pollInterval) {
1448
1178
  clearInterval(intervalId);
1449
- resolve2();
1179
+ resolve();
1450
1180
  return;
1451
1181
  }
1452
1182
  }, checkInterval);
@@ -1492,7 +1222,7 @@ Server requested to slow down, increasing poll interval to ${pollInterval}ms'`
1492
1222
  }
1493
1223
  const message = `Error polling for token: ${errorMessage}`;
1494
1224
  emitAuthProgress("error", message);
1495
- await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
1225
+ await new Promise((resolve) => setTimeout(resolve, pollInterval));
1496
1226
  }
1497
1227
  }
1498
1228
  const timeoutMessage = "Authorization timeout, please restart the process.";
@@ -1591,10 +1321,6 @@ __name(getQwenCachedCredentialPath, "getQwenCachedCredentialPath");
1591
1321
  var clearCachedCredentialFile = clearQwenCredentials;
1592
1322
 
1593
1323
  export {
1594
- isBrowserCommandBlocked,
1595
- shouldAttemptBrowserLaunch,
1596
- openBrowserSecurely,
1597
- shouldLaunchBrowser,
1598
1324
  SharedTokenManager,
1599
1325
  generateCodeVerifier,
1600
1326
  generateCodeChallenge,
@@ -1614,11 +1340,6 @@ export {
1614
1340
  clearQwenCredentials,
1615
1341
  clearCachedCredentialFile
1616
1342
  };
1617
- /**
1618
- * @license
1619
- * Copyright 2025 Google LLC
1620
- * SPDX-License-Identifier: Apache-2.0
1621
- */
1622
1343
  /**
1623
1344
  * @license
1624
1345
  * Copyright 2025 Qwen
@@ -5,7 +5,7 @@ import {
5
5
  Storage,
6
6
  resolvePath,
7
7
  sanitizeCwd
8
- } from "./chunk-WE6TNQJU.js";
8
+ } from "./chunk-C4K3FEQ2.js";
9
9
  import {
10
10
  init_esbuild_shims
11
11
  } from "./chunk-A4BMJM77.js";
@@ -665,6 +665,42 @@ var Storage = class _Storage {
665
665
  getProjectCommandsDir() {
666
666
  return path2.join(this.getQwenDir(), "commands");
667
667
  }
668
+ /**
669
+ * Project-level saved-workflow scripts directory: `<targetDir>/.qwen/workflows`.
670
+ * Saved workflow scripts (`<name>.js`) here are surfaced as slash commands
671
+ * and resolvable by `workflow('<name>')` from inside a running workflow.
672
+ */
673
+ getProjectWorkflowsDir() {
674
+ return path2.join(this.getQwenDir(), "workflows");
675
+ }
676
+ /**
677
+ * User-level saved-workflow scripts directory: `~/.qwen/workflows`. User
678
+ * scope is lower-precedence than project scope when the same `<name>.js`
679
+ * exists in both.
680
+ */
681
+ static getUserWorkflowsDir() {
682
+ return path2.join(_Storage.getGlobalQwenDir(), "workflows");
683
+ }
684
+ /**
685
+ * Per-run workflow artifact directory: `<projectDir>/workflows`. Holds
686
+ * completed-run snapshot JSON files (`<runId>.json`) for the `/workflows`
687
+ * recent list, and per-run resume journals (`<runId>/journal.jsonl`).
688
+ */
689
+ getWorkflowRunsDir() {
690
+ return path2.join(this.getProjectDir(), "workflows");
691
+ }
692
+ /**
693
+ * Path to the persisted snapshot of a completed workflow run.
694
+ */
695
+ getWorkflowRunSnapshotPath(runId) {
696
+ return path2.join(this.getWorkflowRunsDir(), `${runId}.json`);
697
+ }
698
+ /**
699
+ * Path to the resume journal for an in-progress / resumable workflow run.
700
+ */
701
+ getWorkflowRunJournalPath(runId) {
702
+ return path2.join(this.getWorkflowRunsDir(), runId, "journal.jsonl");
703
+ }
668
704
  /**
669
705
  * Path to the runtime-status sidecar JSON for this session.
670
706
  *
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
  import {
4
4
  createDebugLogger
5
- } from "./chunk-WE6TNQJU.js";
5
+ } from "./chunk-C4K3FEQ2.js";
6
6
  import {
7
7
  init_esbuild_shims
8
8
  } from "./chunk-A4BMJM77.js";
@@ -375,207 +375,6 @@ function asOptionalRecord(value) {
375
375
  }
376
376
  __name(asOptionalRecord, "asOptionalRecord");
377
377
 
378
- // packages/core/src/core/tokenLimits.ts
379
- init_esbuild_shims();
380
- var DEFAULT_TOKEN_LIMIT = 131072;
381
- var DEFAULT_OUTPUT_TOKEN_LIMIT = 32e3;
382
- var CAPPED_DEFAULT_MAX_TOKENS = 8e3;
383
- var ESCALATED_MAX_TOKENS = 64e3;
384
- function parsePositiveIntegerEnvValue(raw) {
385
- if (raw === void 0) return void 0;
386
- const trimmed = raw.trim();
387
- if (!/^\d+$/.test(trimmed)) return void 0;
388
- const parsed = Number(trimmed);
389
- if (!Number.isSafeInteger(parsed) || parsed <= 0) return void 0;
390
- return parsed;
391
- }
392
- __name(parsePositiveIntegerEnvValue, "parsePositiveIntegerEnvValue");
393
- var LIMITS = {
394
- "32k": 32768,
395
- "64k": 65536,
396
- "128k": 131072,
397
- "192k": 196608,
398
- // MiniMax-M2.5 context window
399
- "200k": 2e5,
400
- // vendor-declared decimal, used by OpenAI, Anthropic, etc.
401
- "256k": 262144,
402
- "272k": 272e3,
403
- // vendor-declared decimal, GPT-5.x input (400K total - 128K output)
404
- "384k": 384e3,
405
- // vendor-declared decimal, DeepSeek V4 max output
406
- "400k": 4e5,
407
- // vendor-declared decimal, used by OpenAI GPT-5.x
408
- "512k": 524288,
409
- "1m": 1e6,
410
- // Output token limits (typically much smaller than input limits)
411
- "4k": 4096,
412
- "8k": 8192,
413
- "16k": 16384
414
- };
415
- function normalize(model) {
416
- let s = (model ?? "").toLowerCase().trim();
417
- s = s.replace(/^.*\//, "");
418
- s = s.split("|").pop() ?? s;
419
- s = s.split(":").pop() ?? s;
420
- s = s.replace(/\s+/g, "-");
421
- s = s.replace(/-preview/g, "");
422
- if (!s.match(/^qwen-(?:plus|flash|vl-max)-latest$/) && !s.match(/^kimi-k2-\d{4}$/)) {
423
- s = s.replace(
424
- /-(?:\d{4,}|\d+x\d+b|v\d+(?:\.\d+)*|(?<=-[^-]+-)\d+(?:\.\d+)+|latest|exp)$/g,
425
- ""
426
- );
427
- }
428
- s = s.replace(/-(?:\d?bit|int[48]|bf16|fp16|q[45]|quantized)$/g, "");
429
- return s;
430
- }
431
- __name(normalize, "normalize");
432
- var PATTERNS = [
433
- // -------------------
434
- // Google Gemini
435
- // -------------------
436
- [/^gemini-3/, LIMITS["1m"]],
437
- // Gemini 3.x (Pro, Flash, 3.1, etc.): 1M
438
- [/^gemini-/, LIMITS["1m"]],
439
- // Gemini fallback (1.5, 2.x): 1M
440
- // -------------------
441
- // OpenAI
442
- // -------------------
443
- [/^gpt-5/, LIMITS["272k"]],
444
- // GPT-5.x: 272K input (400K total - 128K output)
445
- [/^gpt-/, LIMITS["128k"]],
446
- // GPT fallback (4o, 4.1, etc.): 128K
447
- [/^o\d/, LIMITS["200k"]],
448
- // o-series (o3, o4-mini, etc.): 200K
449
- // -------------------
450
- // Anthropic Claude
451
- // -------------------
452
- [/^claude-/, LIMITS["200k"]],
453
- // All Claude models: 200K
454
- // -------------------
455
- // Alibaba / Qwen
456
- // -------------------
457
- // Commercial API models (1,000,000 context)
458
- [/^qwen3-coder-plus/, LIMITS["1m"]],
459
- [/^qwen3-coder-flash/, LIMITS["1m"]],
460
- [/^qwen3\.\d/, LIMITS["1m"]],
461
- [/^qwen-plus-latest$/, LIMITS["1m"]],
462
- [/^qwen-flash-latest$/, LIMITS["1m"]],
463
- [/^coder-model$/, LIMITS["1m"]],
464
- // Commercial API models (256K context)
465
- [/^qwen3-max/, LIMITS["256k"]],
466
- // Open-source Qwen3 variants: 256K native
467
- [/^qwen3-coder-/, LIMITS["256k"]],
468
- // Qwen fallback (VL, turbo, plus, 2.5, etc.): 128K
469
- [/^qwen/, LIMITS["256k"]],
470
- // -------------------
471
- // DeepSeek
472
- // -------------------
473
- [/^deepseek-v4/, LIMITS["1m"]],
474
- // DeepSeek V4 (flash, pro): 1M
475
- [/^deepseek/, LIMITS["128k"]],
476
- // -------------------
477
- // Zhipu GLM
478
- // -------------------
479
- // 1M context is the forward default for new GLM releases (GLM-5.2+, GLM-6.x,
480
- // and beyond) so they need no future code change. Confirmed 200K families
481
- // (GLM-5 / 5.0 / 5.1, GLM-4.x and older) are pinned explicitly first.
482
- [/^glm-5(\.[01])?(-|$)/, 202752],
483
- // GLM-5 / 5.0 / 5.1: 200K
484
- [/^glm-(?:[5-9]|\d{2,})/, LIMITS["1m"]],
485
- // GLM-5.2+, 6.x..9.x, 10.x+: 1M
486
- [/^glm-/, 202752],
487
- // GLM <=4.x / non-numeric fallback: 200K
488
- // -------------------
489
- // MiniMax
490
- // -------------------
491
- [/^minimax-m3/i, LIMITS["1m"]],
492
- // MiniMax-M3: 1,000,000
493
- [/^minimax-m2\.5/i, LIMITS["192k"]],
494
- // MiniMax-M2.5: 196,608
495
- [/^minimax-/i, LIMITS["200k"]],
496
- // MiniMax fallback: 200K
497
- // -------------------
498
- // Moonshot / Kimi
499
- // -------------------
500
- [/^kimi-/, LIMITS["256k"]],
501
- // Kimi fallback: 256K
502
- // -------------------
503
- // ByteDance Seed-OSS (512K)
504
- // -------------------
505
- [/^seed-oss/, LIMITS["512k"]]
506
- ];
507
- var OUTPUT_PATTERNS = [
508
- // Google Gemini
509
- [/^gemini-3/, LIMITS["64k"]],
510
- // Gemini 3.x: 64K
511
- [/^gemini-/, LIMITS["8k"]],
512
- // Gemini fallback: 8K
513
- // OpenAI
514
- [/^gpt-5/, LIMITS["128k"]],
515
- // GPT-5.x: 128K
516
- [/^gpt-/, LIMITS["16k"]],
517
- // GPT fallback: 16K
518
- [/^o\d/, LIMITS["128k"]],
519
- // o-series: 128K
520
- // Anthropic Claude
521
- [/^claude-opus-4-6/, LIMITS["128k"]],
522
- // Opus 4.6: 128K
523
- [/^claude-sonnet-4-6/, LIMITS["64k"]],
524
- // Sonnet 4.6: 64K
525
- [/^claude-/, LIMITS["64k"]],
526
- // Claude fallback: 64K
527
- // Alibaba / Qwen
528
- [/^qwen3\.\d/, LIMITS["64k"]],
529
- [/^coder-model$/, LIMITS["64k"]],
530
- [/^qwen/, LIMITS["32k"]],
531
- // Qwen fallback (VL, turbo, plus, etc.): 8K
532
- // DeepSeek
533
- [/^deepseek-v4/, LIMITS["384k"]],
534
- // DeepSeek V4 (flash, pro): 384K
535
- [/^deepseek-reasoner/, LIMITS["64k"]],
536
- [/^deepseek-r1/, LIMITS["64k"]],
537
- [/^deepseek-chat/, LIMITS["8k"]],
538
- // Zhipu GLM
539
- [/^glm-5(?:\.\d+)?(?:-|$)/, LIMITS["128k"]],
540
- [/^glm-4\.7/, LIMITS["16k"]],
541
- // MiniMax
542
- [/^minimax-m2\.5/i, LIMITS["64k"]],
543
- // Kimi
544
- [/^kimi-k2\.5/, LIMITS["32k"]]
545
- ];
546
- function findTokenLimit(model, type = "input") {
547
- const norm = normalize(model);
548
- const patterns = type === "output" ? OUTPUT_PATTERNS : PATTERNS;
549
- for (const [regex, limit] of patterns) {
550
- if (regex.test(norm)) {
551
- return limit;
552
- }
553
- }
554
- return void 0;
555
- }
556
- __name(findTokenLimit, "findTokenLimit");
557
- function hasExplicitOutputLimit(model) {
558
- const norm = normalize(model);
559
- return OUTPUT_PATTERNS.some(([regex]) => regex.test(norm));
560
- }
561
- __name(hasExplicitOutputLimit, "hasExplicitOutputLimit");
562
- function knownTokenLimit(model, type = "input") {
563
- return findTokenLimit(model, type);
564
- }
565
- __name(knownTokenLimit, "knownTokenLimit");
566
- function tokenLimit(model, type = "input") {
567
- return knownTokenLimit(model, type) ?? (type === "output" ? DEFAULT_OUTPUT_TOKEN_LIMIT : DEFAULT_TOKEN_LIMIT);
568
- }
569
- __name(tokenLimit, "tokenLimit");
570
-
571
- // packages/core/src/core/openaiContentGenerator/constants.ts
572
- init_esbuild_shims();
573
- var DEFAULT_TIMEOUT = 12e4;
574
- var DEFAULT_MAX_RETRIES = 3;
575
- var DEFAULT_OPENAI_BASE_URL = "https://api.openai.com/v1";
576
- var DEFAULT_DASHSCOPE_BASE_URL = "https://dashscope.aliyuncs.com/compatible-mode/v1";
577
- var DASHSCOPE_PROXY_BASE_URL = process.env["DASHSCOPE_PROXY_BASE_URL"];
578
-
579
378
  // packages/core/src/utils/safeJsonParse.ts
580
379
  init_esbuild_shims();
581
380
 
@@ -1397,21 +1196,7 @@ export {
1397
1196
  RuntimeDiagnosticsCollector,
1398
1197
  runtimeDiagnostics,
1399
1198
  summarizeOpenAIWireRequest,
1400
- summarizeAnthropicWireRequest,
1401
- DEFAULT_TOKEN_LIMIT,
1402
- DEFAULT_OUTPUT_TOKEN_LIMIT,
1403
- CAPPED_DEFAULT_MAX_TOKENS,
1404
- ESCALATED_MAX_TOKENS,
1405
- parsePositiveIntegerEnvValue,
1406
- normalize,
1407
- hasExplicitOutputLimit,
1408
- knownTokenLimit,
1409
- tokenLimit,
1410
- DEFAULT_TIMEOUT,
1411
- DEFAULT_MAX_RETRIES,
1412
- DEFAULT_OPENAI_BASE_URL,
1413
- DEFAULT_DASHSCOPE_BASE_URL,
1414
- DASHSCOPE_PROXY_BASE_URL
1199
+ summarizeAnthropicWireRequest
1415
1200
  };
1416
1201
  /**
1417
1202
  * @license