@qwen-code/qwen-code 0.21.0 → 0.21.1-simplify-system-prompt.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 (228) hide show
  1. package/chunks/{MaxSizedBox-5DPPWPGT.js → MaxSizedBox-INHRH72H.js} +11 -10
  2. package/chunks/{StandaloneSessionPicker-BIRMPLRD.js → StandaloneSessionPicker-O6RKBPU4.js} +25 -24
  3. package/chunks/{acpAgent-6J2U72PQ.js → acpAgent-HYFVXVDR.js} +119 -74
  4. package/chunks/{agent-6ODUANDO.js → agent-VXDAN5JK.js} +10 -9
  5. package/chunks/{agent-headless-7BYQTMHW.js → agent-headless-K4ZMMNBD.js} +10 -9
  6. package/chunks/{anthropicContentGenerator-75BKLTSP.js → anthropicContentGenerator-LXUXMOE7.js} +20 -9
  7. package/chunks/{bridge-ZUB64FAE.js → bridge-LGPZCFHO.js} +14 -13
  8. package/chunks/channel-management-service-G74LFADV.js +403 -0
  9. package/chunks/channel-settings-store-CHCDRTPY.js +89 -0
  10. package/chunks/{channel-worker-group-2ZD7TVAT.js → channel-worker-group-PTJIJSKC.js} +6 -5
  11. package/chunks/{channel-worker-manager-4OA4BCGB.js → channel-worker-manager-WIMGM2FD.js} +6 -5
  12. package/chunks/{channel-worker-supervisor-V7KCFJTS.js → channel-worker-supervisor-KUFTR6P5.js} +5 -4
  13. package/chunks/{chunk-OFDOK3VM.js → chunk-2JM6GZ5D.js} +3 -3
  14. package/chunks/{chunk-H4SBPHSA.js → chunk-2OM7GEXO.js} +1 -1
  15. package/chunks/{chunk-TGILQ3YH.js → chunk-2Q3OT4OV.js} +7 -7
  16. package/chunks/{chunk-PC6JANNU.js → chunk-2YZJCM5T.js} +4 -4
  17. package/chunks/{chunk-QAF7NMK7.js → chunk-32MVHM4T.js} +1 -1
  18. package/chunks/{chunk-K36B6G2O.js → chunk-3HBZKBMQ.js} +3 -3
  19. package/chunks/{chunk-GSN55ZRI.js → chunk-3IXOIAKE.js} +4 -4
  20. package/chunks/{chunk-IJTOWOD7.js → chunk-3JAQDSXN.js} +12 -0
  21. package/chunks/{chunk-UDX5OBWR.js → chunk-3MSHSCSN.js} +2 -2
  22. package/chunks/{chunk-ZFDTEDCF.js → chunk-4M377AZG.js} +3 -3
  23. package/chunks/{chunk-U7M2DMGW.js → chunk-52O2CIUL.js} +2 -2
  24. package/chunks/{chunk-R5AFZNQW.js → chunk-5THCYPLO.js} +3 -3
  25. package/chunks/{chunk-7MVVZO4N.js → chunk-5U4IPFBR.js} +4 -4
  26. package/chunks/{chunk-KIM5GUMA.js → chunk-66RMLJHC.js} +21 -21
  27. package/chunks/{chunk-FSITMZJH.js → chunk-6PSLCFQ2.js} +5 -5
  28. package/chunks/{chunk-ACY3A37B.js → chunk-7FZEBPKS.js} +3 -3
  29. package/chunks/{chunk-7JURR4JT.js → chunk-A6UO2C7C.js} +1 -1
  30. package/chunks/{chunk-JLU636DO.js → chunk-ALMR3E6Q.js} +1 -0
  31. package/chunks/{chunk-PWVFN2LF.js → chunk-B4UMZKMU.js} +1 -1
  32. package/chunks/{chunk-SQCQ4KO2.js → chunk-B6ZJ7SI6.js} +14 -14
  33. package/chunks/{chunk-YPE6A4GC.js → chunk-B7QDM6Z7.js} +1 -1
  34. package/chunks/{chunk-NIBLUX3Y.js → chunk-BO4XCS7P.js} +195 -3
  35. package/chunks/{chunk-WCXCRJYB.js → chunk-BRRAJXPA.js} +1 -1
  36. package/chunks/{chunk-TPRQ7RZH.js → chunk-BYFNTGKI.js} +37 -35
  37. package/chunks/{chunk-Y34KJKDC.js → chunk-C3NS4F2Q.js} +1 -1
  38. package/chunks/{chunk-Q4M4MDQ4.js → chunk-CC4N4M36.js} +1 -1
  39. package/chunks/{chunk-EBJQ6AXW.js → chunk-DM22XS4K.js} +5 -5
  40. package/chunks/{chunk-PHOF65IG.js → chunk-DM4Q4JJH.js} +1059 -722
  41. package/chunks/{chunk-JXJFVC6E.js → chunk-DN6ZX5AY.js} +3 -3
  42. package/chunks/{chunk-J24WCGIN.js → chunk-E5WH5O3C.js} +4 -4
  43. package/chunks/{chunk-4WIZGAH3.js → chunk-ER5LWJR6.js} +5 -57
  44. package/chunks/chunk-FY3M44RD.js +463 -0
  45. package/chunks/{chunk-IO3IX5Q4.js → chunk-G4WFQUYQ.js} +1 -1
  46. package/chunks/{chunk-VULLI6WQ.js → chunk-GDIPH4JY.js} +3 -3
  47. package/chunks/chunk-HV3G62R6.js +76 -0
  48. package/chunks/{chunk-YX324OPW.js → chunk-I7XZ3RY5.js} +1 -1
  49. package/chunks/{chunk-BULDBTYC.js → chunk-INADJJGW.js} +1 -26
  50. package/chunks/{chunk-RIBKPMRP.js → chunk-J6D3VXCC.js} +3 -3
  51. package/chunks/{chunk-TEHGS6UP.js → chunk-JALU3ZDU.js} +6 -6
  52. package/chunks/{chunk-YBL3QUDD.js → chunk-KIUFNBHR.js} +1 -1
  53. package/chunks/{chunk-VIA5XA4U.js → chunk-KU5XMLDK.js} +1 -1
  54. package/chunks/{chunk-KMQ33DO4.js → chunk-LG4GZIVV.js} +3 -3
  55. package/chunks/{chunk-ZNAUOR2I.js → chunk-LNARWLZQ.js} +1 -1
  56. package/chunks/{chunk-LQIW3YFY.js → chunk-LNURQEMZ.js} +4 -4
  57. package/chunks/{chunk-VRYUBFMC.js → chunk-LZEMEFKY.js} +1 -1
  58. package/chunks/{chunk-LB6DUZ26.js → chunk-M4UKFCZ2.js} +65 -46
  59. package/chunks/chunk-MK7VQDN3.js +79 -0
  60. package/chunks/{chunk-RWTEFFPU.js → chunk-ML52PL6O.js} +211 -209
  61. package/chunks/{chunk-RF3EXIHJ.js → chunk-MSLKI6C2.js} +12 -12
  62. package/chunks/{chunk-X5XDDSSH.js → chunk-MVS3NS2N.js} +1 -1
  63. package/chunks/{chunk-5NBDS5S6.js → chunk-N3FAY5CM.js} +7 -5
  64. package/chunks/{chunk-55DJUCI2.js → chunk-OJGCZBB7.js} +14 -9
  65. package/chunks/{chunk-BKHWX6I2.js → chunk-P5V4T7NK.js} +3 -3
  66. package/chunks/{chunk-LH2BYDQ5.js → chunk-PANH4R3B.js} +1 -1
  67. package/chunks/{chunk-RZIX2G32.js → chunk-PHVR5UUY.js} +1 -1
  68. package/chunks/{chunk-MZAXJAUM.js → chunk-PSWQZHEA.js} +1 -1
  69. package/chunks/{chunk-3RN6GBKS.js → chunk-QPDRAXDJ.js} +1 -1
  70. package/chunks/{chunk-2X55UKQE.js → chunk-QY5MMZ6O.js} +2 -2
  71. package/chunks/{chunk-CIKQ7KKO.js → chunk-RWS5VYWC.js} +14 -8
  72. package/chunks/{chunk-MVSUYZDT.js → chunk-SASBXAQL.js} +3 -3
  73. package/chunks/chunk-SQBYH7PX.js +1252 -0
  74. package/chunks/{chunk-MB4MZHMJ.js → chunk-SRZ6DXVG.js} +170 -389
  75. package/chunks/chunk-TF2X2WCT.js +363 -0
  76. package/chunks/{chunk-2SCDWPXI.js → chunk-TQCBGUHN.js} +2 -2
  77. package/chunks/{chunk-LK7CHLVP.js → chunk-U4VTUMMK.js} +0 -60
  78. package/chunks/{chunk-IKCX4CCL.js → chunk-U7TXFVUN.js} +6 -6
  79. package/chunks/{chunk-2NH6DYI4.js → chunk-V6VRAM7B.js} +10 -10
  80. package/chunks/{chunk-Z2BC6UJ5.js → chunk-VCBZUOSI.js} +1 -1
  81. package/chunks/{chunk-IKYJHJNF.js → chunk-VFSJ5VRH.js} +2 -2
  82. package/chunks/{chunk-LKEJ26GS.js → chunk-VV6XU5L7.js} +1 -1
  83. package/chunks/{chunk-7ZCNENPP.js → chunk-W4CQXHT6.js} +1 -1
  84. package/chunks/{chunk-HTR4WV6U.js → chunk-W4RQUHY3.js} +31 -1
  85. package/chunks/{chunk-ETSW4KLJ.js → chunk-WDSWXQU3.js} +1 -1
  86. package/chunks/{chunk-PSOO6YXD.js → chunk-XHRTVPG2.js} +8 -6
  87. package/chunks/{chunk-ZJHVAS7M.js → chunk-YAF5VNU7.js} +1 -1
  88. package/chunks/{chunk-JVPM2ULZ.js → chunk-Z5BLYMZM.js} +4 -4
  89. package/chunks/{chunk-M4FMGVY4.js → chunk-ZE5WPL4I.js} +2 -2
  90. package/chunks/{computer-use-SOQ4E3VX.js → computer-use-DOFAHZAB.js} +10 -9
  91. package/chunks/{config-utils-7V7GGIW6.js → config-utils-VFQXVGNR.js} +4 -3
  92. package/chunks/{contextCommand-JLHYA34Z.js → contextCommand-QIZYHDR5.js} +12 -11
  93. package/chunks/{create-sub-session-QRJLW5BV.js → create-sub-session-7543K2QA.js} +10 -9
  94. package/chunks/{daemon-YO6433NF.js → daemon-VOMQW7KZ.js} +189 -0
  95. package/chunks/{daemon-status-provider-2233Q37D.js → daemon-status-provider-OS5UWBHV.js} +18 -17
  96. package/chunks/{dist-WEAHOXDM.js → dist-ANLAT3GS.js} +1 -1
  97. package/chunks/{dist-BBLXMS3N.js → dist-BRB6EXK4.js} +1 -1
  98. package/chunks/{dist-YFNEUWSE.js → dist-K6Y4E7FX.js} +1 -1
  99. package/chunks/{dist-F6IBUDR4.js → dist-KTYYJ2C5.js} +1 -1
  100. package/chunks/{dist-46NQKLTW.js → dist-NNVBBOGU.js} +2 -2
  101. package/chunks/{dist-AIKFMUKK.js → dist-RTJFMNEZ.js} +1 -1
  102. package/chunks/{earlyInputCapture-A7NDU3PF.js → earlyInputCapture-WQT24RWD.js} +10 -9
  103. package/chunks/{edit-OBDSQURM.js → edit-RIEOJWKB.js} +10 -9
  104. package/chunks/{enter-worktree-U6MRPQ2P.js → enter-worktree-OGK5FQ3R.js} +10 -9
  105. package/chunks/{enterPlanMode-BC5QUZZ2.js → enterPlanMode-IWZYALIB.js} +10 -9
  106. package/chunks/{environment-W5UFC2CH.js → environment-VZ7BRI4Q.js} +12 -11
  107. package/chunks/{errors-M7CLORXH.js → errors-PCX25DVP.js} +12 -11
  108. package/chunks/{exit-worktree-DGNYMECB.js → exit-worktree-4TEYVIVP.js} +10 -9
  109. package/chunks/{exitPlanMode-GXTBWQAR.js → exitPlanMode-GHPUHBZJ.js} +38 -18
  110. package/chunks/{fast-path-JJZFJANL.js → fast-path-HYE7IFEV.js} +5 -5
  111. package/chunks/{gemini-QS36EBZV.js → gemini-NGRQX3YJ.js} +54 -51
  112. package/chunks/{geminiContentGenerator-AG4KB6CV.js → geminiContentGenerator-FQHPFZSR.js} +36 -7
  113. package/chunks/{glob-V7R3PSK3.js → glob-FRTM3X2E.js} +10 -9
  114. package/chunks/{grep-QYPSK7OP.js → grep-RKWVROCW.js} +10 -9
  115. package/chunks/{handleAutoUpdate-6DBEZYPV.js → handleAutoUpdate-2CZQRJ66.js} +14 -13
  116. package/chunks/{i18n-VUJJZIMU.js → i18n-XEQVMRKN.js} +11 -10
  117. package/chunks/{image-gen-Z3VPGKRC.js → image-gen-WIEM7KZA.js} +1 -1
  118. package/chunks/{initializer-UWAK5U5O.js → initializer-OVGZ4FLY.js} +15 -14
  119. package/chunks/{installationInfo-6O2YAA52.js → installationInfo-5UUQJI6Y.js} +11 -10
  120. package/chunks/{list-GB4ESM3T.js → list-HODU6RXD.js} +18 -17
  121. package/chunks/{loadedSettingsAdapter-OT6JVQ7U.js → loadedSettingsAdapter-TYNLBALY.js} +15 -14
  122. package/chunks/{loggingContentGenerator-HS3S5H3Q.js → loggingContentGenerator-WGM27QAW.js} +55 -91
  123. package/chunks/{managed-npm-update-JYEMMXA3.js → managed-npm-update-JQ2CG3RH.js} +11 -10
  124. package/chunks/{mcp-6DBDJPFU.js → mcp-J3DFWX4A.js} +15 -14
  125. package/chunks/{monitor-R3ODH5U6.js → monitor-7FEWXX5F.js} +10 -9
  126. package/chunks/{nonInteractiveCli-MOYCYBBU.js → nonInteractiveCli-F4GYSMHT.js} +50 -47
  127. package/chunks/{notebook-edit-BNOK452R.js → notebook-edit-JGJV2K6J.js} +10 -9
  128. package/chunks/{openaiContentGenerator-WMCU3O2H.js → openaiContentGenerator-JPVXDTAO.js} +8 -7
  129. package/chunks/{pidfile-TFRZZZIO.js → pidfile-4VNAR3EP.js} +10 -9
  130. package/chunks/{processUtils-RT7UNCC2.js → processUtils-V2LCK6T6.js} +2 -2
  131. package/chunks/{qwenContentGenerator-HHCRK4SX.js → qwenContentGenerator-TICV2W2Z.js} +12 -11
  132. package/chunks/{qwenOAuth2-OWLB5AKH.js → qwenOAuth2-XGFI5XJG.js} +1 -1
  133. package/chunks/{read-file-APMO3PSX.js → read-file-LZXUR4TO.js} +5 -5
  134. package/chunks/{resumeHistoryUtils-6KRYEAWZ.js → resumeHistoryUtils-65OX3SGJ.js} +14 -13
  135. package/chunks/{ripGrep-BEJDEDXW.js → ripGrep-2U2FRGMV.js} +10 -9
  136. package/chunks/{run-qwen-serve-FU6HEM4J.js → run-qwen-serve-3VCV4I7E.js} +69 -33
  137. package/chunks/{runtime-XXRRTNP6.js → runtime-AXJWIEDU.js} +20 -18
  138. package/chunks/{scheduler-G2ZS2Z7E.js → scheduler-RS2I6RU5.js} +10 -9
  139. package/chunks/{sdk-exporters-http-FYBSUCPD.js → sdk-exporters-http-FS6ZV7MF.js} +2 -2
  140. package/chunks/{sdk-impl-GMVPB7NB.js → sdk-impl-7FZSCSXB.js} +6 -6
  141. package/chunks/{serve-7BSTXJ4T.js → serve-W2GC47CM.js} +16 -15
  142. package/chunks/{server-4UMH7OIZ.js → server-HRZ23U7M.js} +499 -93
  143. package/chunks/{session-K3O3Q2SV.js → session-7XHZKTVV.js} +51 -48
  144. package/chunks/{settings-CR2EWTBA.js → settings-7ZGZDXAS.js} +14 -13
  145. package/chunks/{shell-HH3PF3A2.js → shell-45IPBDP5.js} +10 -9
  146. package/chunks/{skill-I3SDA4MB.js → skill-LIWXNLDW.js} +7 -6
  147. package/chunks/{spawnChannel-RWNDBXGA.js → spawnChannel-PVXQ5AGV.js} +12 -11
  148. package/chunks/{src-GE4TTTML.js → src-AY65BYR7.js} +36 -17
  149. package/chunks/{standalone-update-Q6WFRZZQ.js → standalone-update-ZMFNKAEY.js} +12 -11
  150. package/chunks/{startInteractiveUI-SLZGHRPH.js → startInteractiveUI-IW3CSKHA.js} +87 -88
  151. package/chunks/{team-create-YJALH5D2.js → team-create-O2FROQ4R.js} +10 -9
  152. package/chunks/{team-plan-approval-34QFYKGN.js → team-plan-approval-Q6WDBXTQ.js} +10 -9
  153. package/chunks/{theme-manager-SWRILQHI.js → theme-manager-YYPZFBAH.js} +10 -9
  154. package/chunks/{tool-search-NF7GB6LE.js → tool-search-APECNQ3Z.js} +5 -5
  155. package/chunks/{total-session-admission-DLHHHLD3.js → total-session-admission-JXES723M.js} +14 -13
  156. package/chunks/{tree-sitter-4D7QS7F6.js → tree-sitter-FS4VPMZA.js} +1 -1
  157. package/chunks/{tree-sitter-bash-VEJGF5XF.js → tree-sitter-bash-6B46JJCV.js} +1 -1
  158. package/chunks/{trustedFolders-KHXHY6PY.js → trustedFolders-HVI7IXUH.js} +11 -10
  159. package/chunks/{update-relaunch-WBUZJC5O.js → update-relaunch-ON5MDJQG.js} +5 -5
  160. package/chunks/{updateCheck-RKL6M5XN.js → updateCheck-WUJGHWZZ.js} +13 -12
  161. package/chunks/{useAutoAcceptIndicator-CFQ5BUJL.js → useAutoAcceptIndicator-CHSTZLZD.js} +17 -16
  162. package/chunks/{validateNonInterActiveAuth-3R223G3R.js → validateNonInterActiveAuth-JBLKBKRD.js} +47 -44
  163. package/chunks/{version-HS7YSFHV.js → version-LTNUBQJY.js} +1 -1
  164. package/chunks/{web-fetch-NKCSG7ZE.js → web-fetch-L5UTI53V.js} +5 -5
  165. package/chunks/{web-search-S62WAP4S.js → web-search-KM33JOS3.js} +2 -2
  166. package/chunks/{workflow-QAGU5RU4.js → workflow-K7FAWV77.js} +11 -10
  167. package/chunks/{workspace-providers-status-QSVZUETE.js → workspace-providers-status-GAKSF4LL.js} +18 -17
  168. package/chunks/{workspace-registration-store-24JMHDGF.js → workspace-registration-store-6TGVDJV5.js} +1 -1
  169. package/chunks/{workspace-registry-UT4RBNBM.js → workspace-registry-A7NQUONG.js} +14 -13
  170. package/chunks/{workspace-service-JFWRUS4V.js → workspace-service-STGVSO4N.js} +19 -18
  171. package/chunks/{workspace-skills-status-ZBBKJOI2.js → workspace-skills-status-66AK3DUA.js} +16 -15
  172. package/chunks/{write-file-VHIXW5M7.js → write-file-HUUCEG4P.js} +10 -9
  173. package/cli.js +12 -12
  174. package/package.json +3 -3
  175. package/web-shell/assets/{arc-DcbWnB9T.js → arc-BbHijhiN.js} +1 -1
  176. package/web-shell/assets/{architectureDiagram-3BPJPVTR-kMMF5sud.js → architectureDiagram-3BPJPVTR-Cb4B_JD0.js} +1 -1
  177. package/web-shell/assets/{blockDiagram-GPEHLZMM-Htl9vTJS.js → blockDiagram-GPEHLZMM-Dsjlh3H-.js} +1 -1
  178. package/web-shell/assets/{c4Diagram-AAUBKEIU-BnZnm0mQ.js → c4Diagram-AAUBKEIU-Cp5AeR4U.js} +1 -1
  179. package/web-shell/assets/channel-Bzdx6E8P.js +1 -0
  180. package/web-shell/assets/{chunk-2J33WTMH-DziB7kDG.js → chunk-2J33WTMH-CLcY7W2e.js} +1 -1
  181. package/web-shell/assets/{chunk-4BX2VUAB-CmkD8daw.js → chunk-4BX2VUAB-BUhvY2LR.js} +1 -1
  182. package/web-shell/assets/{chunk-55IACEB6-CHAd9A_U.js → chunk-55IACEB6-kDIFC_71.js} +1 -1
  183. package/web-shell/assets/{chunk-727SXJPM-Dqaam3fE.js → chunk-727SXJPM-CIBO15f2.js} +1 -1
  184. package/web-shell/assets/{chunk-AQP2D5EJ-D_-saBYM.js → chunk-AQP2D5EJ-BJ_T_slV.js} +1 -1
  185. package/web-shell/assets/{chunk-FMBD7UC4-B9r_veWD.js → chunk-FMBD7UC4-BEkW35J8.js} +1 -1
  186. package/web-shell/assets/{chunk-ND2GUHAM-B3EaCSpL.js → chunk-ND2GUHAM-GGPxofay.js} +1 -1
  187. package/web-shell/assets/{chunk-QZHKN3VN-CYq8x9mn.js → chunk-QZHKN3VN-Bifllrb6.js} +1 -1
  188. package/web-shell/assets/classDiagram-4FO5ZUOK-Cd6wbiuK.js +1 -0
  189. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Cd6wbiuK.js +1 -0
  190. package/web-shell/assets/{cose-bilkent-S5V4N54A-D0ng4uiB.js → cose-bilkent-S5V4N54A-C-Add_Dp.js} +1 -1
  191. package/web-shell/assets/{dagre-BM42HDAG-DCZollQv.js → dagre-BM42HDAG-B7MfwNq2.js} +1 -1
  192. package/web-shell/assets/{diagram-2AECGRRQ-Dfk2pWS0.js → diagram-2AECGRRQ-CY_0zuDz.js} +1 -1
  193. package/web-shell/assets/{diagram-5GNKFQAL-kX38ltWR.js → diagram-5GNKFQAL-VyYSbCgA.js} +1 -1
  194. package/web-shell/assets/{diagram-KO2AKTUF-CJz2vsXh.js → diagram-KO2AKTUF-CBiIZ2PL.js} +1 -1
  195. package/web-shell/assets/{diagram-LMA3HP47-BvMLZm_7.js → diagram-LMA3HP47-BL3CrVOx.js} +1 -1
  196. package/web-shell/assets/{diagram-OG6HWLK6-l7kfStkO.js → diagram-OG6HWLK6-CZUPx96P.js} +1 -1
  197. package/web-shell/assets/{erDiagram-TEJ5UH35-BSVa8GGT.js → erDiagram-TEJ5UH35-B81xHr1-.js} +1 -1
  198. package/web-shell/assets/{flowDiagram-I6XJVG4X-CoawKIXH.js → flowDiagram-I6XJVG4X-EZWhir-J.js} +1 -1
  199. package/web-shell/assets/{ganttDiagram-6RSMTGT7-DFUDH0zF.js → ganttDiagram-6RSMTGT7-CVFSuIAg.js} +1 -1
  200. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-Y2pvpT4e.js → gitGraphDiagram-PVQCEYII-C1H2uQDv.js} +1 -1
  201. package/web-shell/assets/{index-ckX9Pq5k.js → index-B2bXx96W.js} +273 -254
  202. package/web-shell/assets/{index-D0GX0zZf.js → index-BYo99NBH.js} +1 -1
  203. package/web-shell/assets/{index-D9haPt0X.css → index-_8mKjx8q.css} +1 -1
  204. package/web-shell/assets/{infoDiagram-5YYISTIA-CU8_zLiX.js → infoDiagram-5YYISTIA-BwyFMlF8.js} +1 -1
  205. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-AVQiV0DU.js → ishikawaDiagram-YF4QCWOH-CQ7Yhn2Y.js} +1 -1
  206. package/web-shell/assets/{journeyDiagram-JHISSGLW-DQ0VSKa3.js → journeyDiagram-JHISSGLW-CJn2sf0l.js} +1 -1
  207. package/web-shell/assets/{kanban-definition-UN3LZRKU-BqnWqsE_.js → kanban-definition-UN3LZRKU-DaNRqwVN.js} +1 -1
  208. package/web-shell/assets/{linear-BkoihsaA.js → linear-DCKODZe2.js} +1 -1
  209. package/web-shell/assets/{mermaid.core-5RJs-31j.js → mermaid.core-CTGJOk27.js} +5 -5
  210. package/web-shell/assets/{mindmap-definition-RKZ34NQL-D33Bxnpd.js → mindmap-definition-RKZ34NQL-BKU3_3rg.js} +1 -1
  211. package/web-shell/assets/{pieDiagram-4H26LBE5-BuEAw3BH.js → pieDiagram-4H26LBE5-COcwBJ82.js} +1 -1
  212. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-Kox_usEq.js → quadrantDiagram-W4KKPZXB-CQnQ443x.js} +1 -1
  213. package/web-shell/assets/{requirementDiagram-4Y6WPE33-CNjeUif0.js → requirementDiagram-4Y6WPE33-CZ2oj5cD.js} +1 -1
  214. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-BCd2OL_U.js → sankeyDiagram-5OEKKPKP-BxAv5mNu.js} +1 -1
  215. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-CF2ZTsz0.js → sequenceDiagram-3UESZ5HK-CztaySPs.js} +1 -1
  216. package/web-shell/assets/{stateDiagram-AJRCARHV-qenSzHtm.js → stateDiagram-AJRCARHV-CTQT1oGD.js} +1 -1
  217. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-BjMdT6E_.js +1 -0
  218. package/web-shell/assets/{timeline-definition-PNZ67QCA-B5DyWdgs.js → timeline-definition-PNZ67QCA-K9Mkex5A.js} +1 -1
  219. package/web-shell/assets/{vennDiagram-CIIHVFJN-DqP4I_o_.js → vennDiagram-CIIHVFJN-B2rVIw76.js} +1 -1
  220. package/web-shell/assets/{wardley-L42UT6IY-CJe2e4mg.js → wardley-L42UT6IY-Z1w2JR4M.js} +1 -1
  221. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-BMDSw-Rr.js → wardleyDiagram-YWT4CUSO-CIX9aKXf.js} +1 -1
  222. package/web-shell/assets/{xychartDiagram-2RQKCTM6-BTVZYkxD.js → xychartDiagram-2RQKCTM6-CI9DLIKB.js} +1 -1
  223. package/web-shell/index.html +2 -2
  224. package/chunks/chunk-LEH5C7FV.js +0 -232
  225. package/web-shell/assets/channel-Cq7YKtfC.js +0 -1
  226. package/web-shell/assets/classDiagram-4FO5ZUOK-CQ9aC1Tg.js +0 -1
  227. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CQ9aC1Tg.js +0 -1
  228. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-B7W4zlCr.js +0 -1
@@ -4,7 +4,7 @@ import {
4
4
  AgentHeadless,
5
5
  ContextState,
6
6
  templateString
7
- } from "./chunk-PHOF65IG.js";
7
+ } from "./chunk-DM4Q4JJH.js";
8
8
  import "./chunk-5M6IDOMF.js";
9
9
  import "./chunk-TWPJO254.js";
10
10
  import "./chunk-H6XPXXMH.js";
@@ -17,7 +17,7 @@ import "./chunk-ZOIFNCKL.js";
17
17
  import "./chunk-PWTZEM3C.js";
18
18
  import "./chunk-KRXPRVGL.js";
19
19
  import "./chunk-6PVPNMXU.js";
20
- import "./chunk-MZAXJAUM.js";
20
+ import "./chunk-PSWQZHEA.js";
21
21
  import "./chunk-SZRN75WQ.js";
22
22
  import "./chunk-HTO4JFDZ.js";
23
23
  import "./chunk-CPBF7KYF.js";
@@ -37,16 +37,17 @@ import "./chunk-XVNQMZ2I.js";
37
37
  import "./chunk-FODK6UMO.js";
38
38
  import "./chunk-GLNBDYUX.js";
39
39
  import "./chunk-DJ2GSRLV.js";
40
- import "./chunk-ZJHVAS7M.js";
41
- import "./chunk-NIBLUX3Y.js";
40
+ import "./chunk-YAF5VNU7.js";
41
+ import "./chunk-BO4XCS7P.js";
42
42
  import "./chunk-BPJSQIJX.js";
43
43
  import "./chunk-P3QQPMQA.js";
44
44
  import "./chunk-6FGBXPWM.js";
45
45
  import "./chunk-LS77BEZP.js";
46
- import "./chunk-CIKQ7KKO.js";
46
+ import "./chunk-SQBYH7PX.js";
47
+ import "./chunk-RWS5VYWC.js";
47
48
  import "./chunk-VGC4I5JJ.js";
48
49
  import "./chunk-MUP3T3AD.js";
49
- import "./chunk-IKCX4CCL.js";
50
+ import "./chunk-U7TXFVUN.js";
50
51
  import "./chunk-46UV252V.js";
51
52
  import "./chunk-A4UCTEB5.js";
52
53
  import "./chunk-XWRJCPHC.js";
@@ -54,9 +55,9 @@ import "./chunk-UW5EOVUN.js";
54
55
  import "./chunk-2JZBVYTU.js";
55
56
  import "./chunk-5I2IWRSH.js";
56
57
  import "./chunk-A5L3JMUA.js";
57
- import "./chunk-MB4MZHMJ.js";
58
- import "./chunk-HTR4WV6U.js";
59
- import "./chunk-BULDBTYC.js";
58
+ import "./chunk-SRZ6DXVG.js";
59
+ import "./chunk-W4RQUHY3.js";
60
+ import "./chunk-INADJJGW.js";
60
61
  import "./chunk-U7ZFW55U.js";
61
62
  import "./chunk-UUUTRMI2.js";
62
63
  import "./chunk-PR75REBZ.js";
@@ -33,8 +33,12 @@ import {
33
33
  setToolCallPreparations
34
34
  } from "./chunk-LS77BEZP.js";
35
35
  import {
36
- reportAnthropicRequest
37
- } from "./chunk-LEH5C7FV.js";
36
+ reportAnthropicEvent,
37
+ reportAnthropicFollowingRequest,
38
+ reportAnthropicRequest,
39
+ reportAnthropicResponse
40
+ } from "./chunk-FY3M44RD.js";
41
+ import "./chunk-SQBYH7PX.js";
38
42
  import {
39
43
  normalizeMcpToolName
40
44
  } from "./chunk-46UV252V.js";
@@ -5089,12 +5093,13 @@ var AnthropicContentGenerator = class {
5089
5093
  try {
5090
5094
  const anthropicRequest = await this.buildRequest(request);
5091
5095
  runtimeDiagnostics.recordAnthropicWireRequest(anthropicRequest);
5092
- reportAnthropicRequest(anthropicRequest);
5096
+ const telemetryAttempt = reportAnthropicRequest(anthropicRequest);
5093
5097
  const headers = this.buildPerRequestHeaders(anthropicRequest);
5094
5098
  response = await this.client.messages.create(anthropicRequest, {
5095
5099
  signal: perRequestAc?.signal,
5096
5100
  ...headers ? { headers } : {}
5097
5101
  });
5102
+ reportAnthropicResponse(telemetryAttempt, response);
5098
5103
  } catch (error) {
5099
5104
  throw redactProxyError(error);
5100
5105
  } finally {
@@ -5110,7 +5115,7 @@ var AnthropicContentGenerator = class {
5110
5115
  stream: true
5111
5116
  };
5112
5117
  runtimeDiagnostics.recordAnthropicWireRequest(streamingRequest);
5113
- reportAnthropicRequest(streamingRequest);
5118
+ const telemetryAttempt = reportAnthropicRequest(streamingRequest);
5114
5119
  const perRequestAc = createChildAbortController(
5115
5120
  request.config?.abortSignal
5116
5121
  );
@@ -5131,7 +5136,8 @@ var AnthropicContentGenerator = class {
5131
5136
  this.redactStreamErrors(stream),
5132
5137
  anthropicRequest,
5133
5138
  perRequestAc.signal,
5134
- headers
5139
+ headers,
5140
+ telemetryAttempt
5135
5141
  );
5136
5142
  async function* drainThenCleanup() {
5137
5143
  try {
@@ -5541,7 +5547,7 @@ var AnthropicContentGenerator = class {
5541
5547
  throw redactProxyError(error);
5542
5548
  }
5543
5549
  }
5544
- async *processStream(stream) {
5550
+ async *processStream(stream, telemetryAttempt) {
5545
5551
  let messageId;
5546
5552
  let model;
5547
5553
  let cachedTokens = 0;
@@ -5569,6 +5575,7 @@ var AnthropicContentGenerator = class {
5569
5575
  });
5570
5576
  }, "takePendingMessageStartUsage");
5571
5577
  for await (const event of stream) {
5578
+ reportAnthropicEvent(telemetryAttempt, event);
5572
5579
  switch (event.type) {
5573
5580
  case "message_start": {
5574
5581
  messageId = event.message.id ?? messageId;
@@ -5772,10 +5779,10 @@ var AnthropicContentGenerator = class {
5772
5779
  // limits hit mid-proxy). When that happens we probe once with the same
5773
5780
  // request in non-streaming mode so the real provider error surfaces
5774
5781
  // instead of the generic "stream ended without a finish reason".
5775
- async *processStreamWithEmptyFallback(stream, fallbackRequest, abortSignal, headers) {
5782
+ async *processStreamWithEmptyFallback(stream, fallbackRequest, abortSignal, headers, telemetryAttempt) {
5776
5783
  let hasAssistantPayload = false;
5777
5784
  let hasFinishReason = false;
5778
- for await (const chunk of this.processStream(stream)) {
5785
+ for await (const chunk of this.processStream(stream, telemetryAttempt)) {
5779
5786
  const candidates = chunk.candidates ?? [];
5780
5787
  hasFinishReason ||= candidates.some(
5781
5788
  (candidate) => candidate.finishReason !== void 0
@@ -5796,11 +5803,15 @@ var AnthropicContentGenerator = class {
5796
5803
  let response;
5797
5804
  try {
5798
5805
  runtimeDiagnostics.recordAnthropicWireRequest(fallbackRequest);
5799
- reportAnthropicRequest(fallbackRequest);
5806
+ const fallbackAttempt = reportAnthropicFollowingRequest(
5807
+ fallbackRequest,
5808
+ telemetryAttempt
5809
+ );
5800
5810
  response = await this.client.messages.create(fallbackRequest, {
5801
5811
  signal: abortSignal,
5802
5812
  ...headers ? { headers } : {}
5803
5813
  });
5814
+ reportAnthropicResponse(fallbackAttempt, response);
5804
5815
  yield this.converter.convertAnthropicResponseToGemini(response);
5805
5816
  } catch (error) {
5806
5817
  throw redactProxyError(error);
@@ -6,18 +6,18 @@ import {
6
6
  createHttpAcpBridge,
7
7
  extractErrorCode,
8
8
  extractErrorMessage
9
- } from "./chunk-KIM5GUMA.js";
9
+ } from "./chunk-66RMLJHC.js";
10
10
  import "./chunk-GLWP3FDB.js";
11
- import "./chunk-UH3WSE5L.js";
12
11
  import "./chunk-COH43MRJ.js";
13
12
  import "./chunk-3SJ43L4W.js";
14
- import "./chunk-7JURR4JT.js";
15
- import "./chunk-VIA5XA4U.js";
13
+ import "./chunk-UH3WSE5L.js";
14
+ import "./chunk-A6UO2C7C.js";
15
+ import "./chunk-KU5XMLDK.js";
16
16
  import "./chunk-2RFKHEXL.js";
17
17
  import "./chunk-BK2UNYWD.js";
18
18
  import "./chunk-M5GB774H.js";
19
19
  import "./chunk-UDXSXLER.js";
20
- import "./chunk-PHOF65IG.js";
20
+ import "./chunk-DM4Q4JJH.js";
21
21
  import "./chunk-5M6IDOMF.js";
22
22
  import "./chunk-TWPJO254.js";
23
23
  import "./chunk-H6XPXXMH.js";
@@ -30,7 +30,7 @@ import "./chunk-ZOIFNCKL.js";
30
30
  import "./chunk-PWTZEM3C.js";
31
31
  import "./chunk-KRXPRVGL.js";
32
32
  import "./chunk-6PVPNMXU.js";
33
- import "./chunk-MZAXJAUM.js";
33
+ import "./chunk-PSWQZHEA.js";
34
34
  import "./chunk-SZRN75WQ.js";
35
35
  import "./chunk-HTO4JFDZ.js";
36
36
  import "./chunk-CPBF7KYF.js";
@@ -50,16 +50,17 @@ import "./chunk-XVNQMZ2I.js";
50
50
  import "./chunk-FODK6UMO.js";
51
51
  import "./chunk-GLNBDYUX.js";
52
52
  import "./chunk-DJ2GSRLV.js";
53
- import "./chunk-ZJHVAS7M.js";
54
- import "./chunk-NIBLUX3Y.js";
53
+ import "./chunk-YAF5VNU7.js";
54
+ import "./chunk-BO4XCS7P.js";
55
55
  import "./chunk-BPJSQIJX.js";
56
56
  import "./chunk-P3QQPMQA.js";
57
57
  import "./chunk-6FGBXPWM.js";
58
58
  import "./chunk-LS77BEZP.js";
59
- import "./chunk-CIKQ7KKO.js";
59
+ import "./chunk-SQBYH7PX.js";
60
+ import "./chunk-RWS5VYWC.js";
60
61
  import "./chunk-VGC4I5JJ.js";
61
62
  import "./chunk-MUP3T3AD.js";
62
- import "./chunk-IKCX4CCL.js";
63
+ import "./chunk-U7TXFVUN.js";
63
64
  import "./chunk-46UV252V.js";
64
65
  import "./chunk-A4UCTEB5.js";
65
66
  import "./chunk-XWRJCPHC.js";
@@ -67,9 +68,9 @@ import "./chunk-UW5EOVUN.js";
67
68
  import "./chunk-2JZBVYTU.js";
68
69
  import "./chunk-5I2IWRSH.js";
69
70
  import "./chunk-A5L3JMUA.js";
70
- import "./chunk-MB4MZHMJ.js";
71
- import "./chunk-HTR4WV6U.js";
72
- import "./chunk-BULDBTYC.js";
71
+ import "./chunk-SRZ6DXVG.js";
72
+ import "./chunk-W4RQUHY3.js";
73
+ import "./chunk-INADJJGW.js";
73
74
  import "./chunk-U7ZFW55U.js";
74
75
  import "./chunk-UUUTRMI2.js";
75
76
  import "./chunk-PR75REBZ.js";
@@ -0,0 +1,403 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import {
4
+ resolveChannelCwd
5
+ } from "./chunk-W4CQXHT6.js";
6
+ import {
7
+ getPlugin
8
+ } from "./chunk-MK7VQDN3.js";
9
+ import {
10
+ canonicalizeWorkspace
11
+ } from "./chunk-2RFKHEXL.js";
12
+ import {
13
+ normalizeWorkerDiagnostic
14
+ } from "./chunk-HV3G62R6.js";
15
+ import {
16
+ isAllChannelSelectionName
17
+ } from "./chunk-ALMR3E6Q.js";
18
+ import {
19
+ redactLogCredentials
20
+ } from "./chunk-M5GB774H.js";
21
+ import {
22
+ PairingStore,
23
+ sanitizeLogText
24
+ } from "./chunk-ML52PL6O.js";
25
+ import "./chunk-UDXSXLER.js";
26
+ import "./chunk-TWPJO254.js";
27
+ import "./chunk-H6XPXXMH.js";
28
+ import {
29
+ init_esbuild_shims
30
+ } from "./chunk-5O2XNYP6.js";
31
+ import {
32
+ __name
33
+ } from "./chunk-J2S4EL5Y.js";
34
+
35
+ // packages/cli/src/serve/channel-management-service.ts
36
+ init_esbuild_shims();
37
+ var ChannelManagementError = class extends Error {
38
+ constructor(code, message) {
39
+ super(message);
40
+ this.code = code;
41
+ this.name = "ChannelManagementError";
42
+ }
43
+ static {
44
+ __name(this, "ChannelManagementError");
45
+ }
46
+ };
47
+ function diagnostic(error) {
48
+ const message = error instanceof Error ? error.message : String(error);
49
+ return sanitizeLogText(
50
+ redactLogCredentials(normalizeWorkerDiagnostic(message)),
51
+ 512
52
+ );
53
+ }
54
+ __name(diagnostic, "diagnostic");
55
+ function usesEnvironment(value) {
56
+ return typeof value === "string" && /^\$[A-Za-z_][A-Za-z0-9_]*$/.test(value);
57
+ }
58
+ __name(usesEnvironment, "usesEnvironment");
59
+ function createChannelManagementService(opts) {
60
+ const diagnostics = /* @__PURE__ */ new Map();
61
+ let mutationTail = Promise.resolve();
62
+ const inMutationLane = /* @__PURE__ */ __name((mutation) => {
63
+ const result = mutationTail.then(mutation, mutation);
64
+ mutationTail = result.then(
65
+ () => void 0,
66
+ () => void 0
67
+ );
68
+ return result;
69
+ }, "inMutationLane");
70
+ const assertExpectedRevision = /* @__PURE__ */ __name((snapshot, expectedRevision) => {
71
+ if (snapshot.revision !== expectedRevision) {
72
+ throw new ChannelManagementError(
73
+ "channel_settings_conflict",
74
+ "Channel settings changed; reload before trying again."
75
+ );
76
+ }
77
+ }, "assertExpectedRevision");
78
+ const workerFor = /* @__PURE__ */ __name((name) => {
79
+ const matches = opts.manager.state().workers.filter(
80
+ (worker) => worker.adapters?.some((adapter) => adapter.name === name) || worker.requestedChannels?.includes(name) || worker.channels.includes(name)
81
+ );
82
+ return matches;
83
+ }, "workerFor");
84
+ const workspaceCommittedNames = /* @__PURE__ */ __name(() => opts.manager.committedChannelNames().filter(
85
+ (name) => workerFor(name).some((w) => w.workspaceCwd === opts.workspaceCwd)
86
+ ), "workspaceCommittedNames");
87
+ const assertOwnedRuntime = /* @__PURE__ */ __name((name) => {
88
+ if (!workspaceCommittedNames().includes(name)) return;
89
+ const workers = workerFor(name).filter(
90
+ (worker) => worker.workspaceCwd === opts.workspaceCwd
91
+ );
92
+ if (workers.length !== 1) {
93
+ throw new ChannelManagementError(
94
+ "channel_runtime_owner_mismatch",
95
+ `Channel "${name}" does not have one confirmed runtime owner in this workspace.`
96
+ );
97
+ }
98
+ }, "assertOwnedRuntime");
99
+ const runtimeFor = /* @__PURE__ */ __name((name) => {
100
+ const retainedError = diagnostics.get(name);
101
+ if (retainedError) return { state: "error", lastError: retainedError };
102
+ if (!workspaceCommittedNames().includes(name)) {
103
+ return { state: "stopped" };
104
+ }
105
+ const state = opts.manager.state();
106
+ const workers = workerFor(name).filter(
107
+ (worker2) => worker2.workspaceCwd === opts.workspaceCwd
108
+ );
109
+ if (workers.length !== 1) {
110
+ return {
111
+ state: "error",
112
+ lastError: "Channel runtime owner is unknown or ambiguous."
113
+ };
114
+ }
115
+ const worker = workers[0];
116
+ const adapter = worker.adapters?.find((item) => item.name === name);
117
+ if (adapter?.state === "connected") return { state: "connected" };
118
+ if (adapter?.state === "error") {
119
+ return {
120
+ state: "error",
121
+ ...adapter.error ? { lastError: diagnostic(adapter.error) } : {}
122
+ };
123
+ }
124
+ if (adapter?.state === "starting" || state.transition === "starting" || state.transition === "reconciling") {
125
+ return { state: "starting" };
126
+ }
127
+ if (worker.state === "running") return { state: "partial" };
128
+ return {
129
+ state: "error",
130
+ ...worker.error ? { lastError: diagnostic(worker.error) } : {}
131
+ };
132
+ }, "runtimeFor");
133
+ const instanceFrom = /* @__PURE__ */ __name(async (name, rawConfig, startupNames) => {
134
+ const type = typeof rawConfig["type"] === "string" ? rawConfig["type"] : "";
135
+ const plugin = type ? await getPlugin(type) : void 0;
136
+ if (!plugin?.management) {
137
+ return {
138
+ name,
139
+ config: type ? { type } : {},
140
+ secrets: {},
141
+ startsWithServe: startupNames.some(isAllChannelSelectionName) || startupNames.includes(name),
142
+ runtime: runtimeFor(name)
143
+ };
144
+ }
145
+ const secretKeys = new Set(
146
+ plugin.management.fields.filter((field) => field.kind === "secret").map((field) => field.key)
147
+ );
148
+ const config = {};
149
+ const secrets = {};
150
+ for (const [key, value] of Object.entries(rawConfig)) {
151
+ if (!secretKeys.has(key)) {
152
+ config[key] = value;
153
+ continue;
154
+ }
155
+ secrets[key] = {
156
+ present: value !== void 0,
157
+ ...value !== void 0 ? { source: usesEnvironment(value) ? "environment" : "literal" } : {}
158
+ };
159
+ }
160
+ for (const key of secretKeys) {
161
+ secrets[key] ??= { present: false };
162
+ }
163
+ return {
164
+ name,
165
+ config,
166
+ secrets,
167
+ startsWithServe: startupNames.some(isAllChannelSelectionName) || startupNames.includes(name),
168
+ runtime: runtimeFor(name)
169
+ };
170
+ }, "instanceFrom");
171
+ const listFrom = /* @__PURE__ */ __name(async (persisted) => {
172
+ const entries = await Promise.all(
173
+ Object.entries(persisted.channels).map(
174
+ async ([name, config]) => [
175
+ name,
176
+ await instanceFrom(name, config, persisted.startupNames)
177
+ ]
178
+ )
179
+ );
180
+ return {
181
+ revision: persisted.revision,
182
+ instances: Object.fromEntries(entries)
183
+ };
184
+ }, "listFrom");
185
+ const resultFor = /* @__PURE__ */ __name(async (name, persisted = opts.store.snapshot()) => {
186
+ const snapshot = await listFrom(persisted);
187
+ const instance = Object.hasOwn(snapshot.instances, name) ? snapshot.instances[name] : {
188
+ name,
189
+ config: {},
190
+ secrets: {},
191
+ startsWithServe: false,
192
+ runtime: runtimeFor(name)
193
+ };
194
+ return { snapshot, instance };
195
+ }, "resultFor");
196
+ const stopChannel = /* @__PURE__ */ __name((name) => opts.manager.setChannelEnabled(
197
+ { name, workspaceCwd: opts.workspaceCwd },
198
+ false
199
+ ), "stopChannel");
200
+ const assertManageableInstanceName = /* @__PURE__ */ __name((name) => {
201
+ if (isAllChannelSelectionName(name)) {
202
+ throw new ChannelManagementError(
203
+ "invalid_channel_instance_name",
204
+ 'Channel instance name "all" is reserved for startup selection.'
205
+ );
206
+ }
207
+ }, "assertManageableInstanceName");
208
+ const assertWorkspaceConfig = /* @__PURE__ */ __name((config) => {
209
+ const rawCwd = config["cwd"];
210
+ if (typeof rawCwd !== "string") return;
211
+ const workspaceCwd = canonicalizeWorkspace(opts.workspaceCwd);
212
+ const channelCwd = canonicalizeWorkspace(
213
+ resolveChannelCwd(rawCwd, workspaceCwd)
214
+ );
215
+ if (channelCwd !== workspaceCwd) {
216
+ throw new ChannelManagementError(
217
+ "channel_workspace_mismatch",
218
+ "Channel workspace must match the selected workspace."
219
+ );
220
+ }
221
+ }, "assertWorkspaceConfig");
222
+ const pairingStoreFor = /* @__PURE__ */ __name((name) => {
223
+ assertManageableInstanceName(name);
224
+ const channels = opts.store.snapshot().channels;
225
+ if (!Object.hasOwn(channels, name)) {
226
+ throw new ChannelManagementError(
227
+ "channel_instance_not_found",
228
+ `Channel "${name}" is not configured in this workspace.`
229
+ );
230
+ }
231
+ const config = channels[name];
232
+ assertWorkspaceConfig(config);
233
+ if (config["senderPolicy"] !== "pairing") {
234
+ throw new ChannelManagementError(
235
+ "channel_pairing_not_enabled",
236
+ `Channel "${name}" does not use pairing mode.`
237
+ );
238
+ }
239
+ return new PairingStore(name, opts.workspaceCwd);
240
+ }, "pairingStoreFor");
241
+ const service = {
242
+ async list() {
243
+ return listFrom(opts.store.snapshot());
244
+ },
245
+ async upsert(name, request) {
246
+ assertManageableInstanceName(name);
247
+ assertWorkspaceConfig(request.config);
248
+ const active = workspaceCommittedNames().includes(name);
249
+ if (active) assertOwnedRuntime(name);
250
+ const persisted = await opts.store.upsert(name, request);
251
+ diagnostics.delete(name);
252
+ if (active) {
253
+ try {
254
+ await opts.manager.reloadWorkspace(opts.workspaceCwd, name);
255
+ } catch (error) {
256
+ diagnostics.set(name, diagnostic(error));
257
+ try {
258
+ await stopChannel(name);
259
+ } catch {
260
+ }
261
+ }
262
+ }
263
+ return resultFor(name, persisted);
264
+ },
265
+ async remove(name, request) {
266
+ assertManageableInstanceName(name);
267
+ const current = opts.store.snapshot();
268
+ if (!Object.hasOwn(current.channels, name)) {
269
+ throw new ChannelManagementError(
270
+ "channel_instance_not_found",
271
+ `Channel "${name}" is not configured in this workspace.`
272
+ );
273
+ }
274
+ assertWorkspaceConfig(current.channels[name]);
275
+ assertExpectedRevision(current, request.expectedRevision);
276
+ if (workspaceCommittedNames().includes(name)) {
277
+ assertOwnedRuntime(name);
278
+ await stopChannel(name);
279
+ }
280
+ const persisted = await opts.store.remove(name, request);
281
+ diagnostics.delete(name);
282
+ return resultFor(name, persisted);
283
+ },
284
+ async setStartup(name, request) {
285
+ assertManageableInstanceName(name);
286
+ const current = opts.store.snapshot();
287
+ if (!Object.hasOwn(current.channels, name)) {
288
+ throw new ChannelManagementError(
289
+ "channel_instance_not_found",
290
+ `Channel "${name}" is not configured in this workspace.`
291
+ );
292
+ }
293
+ assertWorkspaceConfig(current.channels[name]);
294
+ const startsAll = current.startupNames.some(isAllChannelSelectionName);
295
+ if (startsAll && request.enabled) {
296
+ assertExpectedRevision(current, request.expectedRevision);
297
+ return resultFor(name, current);
298
+ }
299
+ const startupNames = startsAll ? Object.keys(current.channels).filter(
300
+ (item) => !isAllChannelSelectionName(item) && item !== name
301
+ ) : request.enabled ? current.startupNames.includes(name) ? current.startupNames : [...current.startupNames, name] : current.startupNames.filter((item) => item !== name);
302
+ const persisted = await opts.store.setStartupNames(startupNames, {
303
+ expectedRevision: request.expectedRevision
304
+ });
305
+ return resultFor(name, persisted);
306
+ },
307
+ async start(name) {
308
+ assertManageableInstanceName(name);
309
+ const persisted = opts.store.snapshot();
310
+ if (!Object.hasOwn(persisted.channels, name)) {
311
+ throw new ChannelManagementError(
312
+ "channel_instance_not_found",
313
+ `Channel "${name}" is not configured in this workspace.`
314
+ );
315
+ }
316
+ assertWorkspaceConfig(persisted.channels[name]);
317
+ await opts.manager.setChannelEnabled(
318
+ { name, workspaceCwd: opts.workspaceCwd },
319
+ true
320
+ );
321
+ diagnostics.delete(name);
322
+ return resultFor(name, persisted);
323
+ },
324
+ async stop(name) {
325
+ assertManageableInstanceName(name);
326
+ const persisted = opts.store.snapshot();
327
+ if (!Object.hasOwn(persisted.channels, name)) {
328
+ throw new ChannelManagementError(
329
+ "channel_instance_not_found",
330
+ `Channel "${name}" is not configured in this workspace.`
331
+ );
332
+ }
333
+ assertWorkspaceConfig(persisted.channels[name]);
334
+ await opts.manager.setChannelEnabled(
335
+ { name, workspaceCwd: opts.workspaceCwd },
336
+ false
337
+ );
338
+ diagnostics.delete(name);
339
+ return resultFor(name, persisted);
340
+ },
341
+ async restart(name) {
342
+ assertManageableInstanceName(name);
343
+ const persisted = opts.store.snapshot();
344
+ if (!Object.hasOwn(persisted.channels, name)) {
345
+ throw new ChannelManagementError(
346
+ "channel_instance_not_found",
347
+ `Channel "${name}" is not configured in this workspace.`
348
+ );
349
+ }
350
+ assertWorkspaceConfig(persisted.channels[name]);
351
+ if (!workspaceCommittedNames().includes(name)) {
352
+ throw new ChannelManagementError(
353
+ "channel_worker_not_enabled",
354
+ `Channel "${name}" is not running.`
355
+ );
356
+ }
357
+ assertOwnedRuntime(name);
358
+ try {
359
+ await opts.manager.reloadWorkspace(opts.workspaceCwd, name);
360
+ diagnostics.delete(name);
361
+ } catch (error) {
362
+ diagnostics.set(name, diagnostic(error));
363
+ throw error;
364
+ }
365
+ return resultFor(name, persisted);
366
+ },
367
+ async pairingRequests(name) {
368
+ return { requests: pairingStoreFor(name).listPending() };
369
+ },
370
+ async approvePairing(name, code) {
371
+ const store = pairingStoreFor(name);
372
+ const approved = store.approve(code);
373
+ if (!approved) {
374
+ throw new ChannelManagementError(
375
+ "channel_pairing_request_not_found",
376
+ "Pairing request was not found or has expired."
377
+ );
378
+ }
379
+ return { approved, requests: store.listPending() };
380
+ }
381
+ };
382
+ return {
383
+ list: /* @__PURE__ */ __name(() => service.list(), "list"),
384
+ upsert: /* @__PURE__ */ __name((name, request) => inMutationLane(() => service.upsert(name, request)), "upsert"),
385
+ remove: /* @__PURE__ */ __name((name, request) => inMutationLane(() => service.remove(name, request)), "remove"),
386
+ setStartup: /* @__PURE__ */ __name((name, request) => inMutationLane(() => service.setStartup(name, request)), "setStartup"),
387
+ start: /* @__PURE__ */ __name((name) => inMutationLane(() => service.start(name)), "start"),
388
+ stop: /* @__PURE__ */ __name((name) => inMutationLane(() => service.stop(name)), "stop"),
389
+ restart: /* @__PURE__ */ __name((name) => inMutationLane(() => service.restart(name)), "restart"),
390
+ pairingRequests: /* @__PURE__ */ __name((name) => service.pairingRequests(name), "pairingRequests"),
391
+ approvePairing: /* @__PURE__ */ __name((name, code) => inMutationLane(() => service.approvePairing(name, code)), "approvePairing")
392
+ };
393
+ }
394
+ __name(createChannelManagementService, "createChannelManagementService");
395
+ export {
396
+ ChannelManagementError,
397
+ createChannelManagementService
398
+ };
399
+ /**
400
+ * @license
401
+ * Copyright 2026 Qwen Team
402
+ * SPDX-License-Identifier: Apache-2.0
403
+ */